From owner-freebsd-current@FreeBSD.ORG Sat Mar 6 00:16:54 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3856106564A; Sat, 6 Mar 2010 00:16:53 +0000 (UTC) (envelope-from weongyo.jeong@gmail.com) Received: from mail-iw0-f183.google.com (mail-iw0-f183.google.com [209.85.223.183]) by mx1.freebsd.org (Postfix) with ESMTP id 9C45D8FC14; Sat, 6 Mar 2010 00:16:53 +0000 (UTC) Received: by iwn13 with SMTP id 13so3199714iwn.14 for ; Fri, 05 Mar 2010 16:16:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent:organization:x-operation-sytem; bh=4A1sdn7tBGyzTuw6hAHxS017mtlk5HfKHlgQbE3Uj1A=; b=RYkMEN8y6i+kCVMfuSl0mLJh1FPwmuRG1KjAZ38rkYGeQM5nIIcs2m7PYXys4Bz8Zt 8Z4wXiZ7DWOjcYR4DicmCZEaKZWPH9kwiJVKMz5jHfFtSmdz00iwiTzdTw9zR+IFXZJc FlI1NvBqRqnJxB4P1SCMO1KoR1ESGdpoWwKsM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent:organization:x-operation-sytem; b=jGdNrH7peApYT9g2IbaoVO56QL10M4YQhow81q1vrWH0CK9Rmix1onEYqpObfcKqTY f7TElENB/VO3zBTw3MaZl3aX0VyW2Xk/atb6IaUlv4mWpy0ub3GUEpEk3SO0Q18ZWNIx fodO68RIL9I926Ihqfj2XNNXKOHX9lQZ604PA= Received: by 10.231.167.65 with SMTP id p1mr452650iby.20.1267834610515; Fri, 05 Mar 2010 16:16:50 -0800 (PST) Received: from weongyo ([174.35.1.224]) by mx.google.com with ESMTPS id 21sm1823366iwn.7.2010.03.05.16.16.49 (version=SSLv3 cipher=RC4-MD5); Fri, 05 Mar 2010 16:16:49 -0800 (PST) Received: by weongyo (sSMTP sendmail emulation); Fri, 5 Mar 2010 16:16:56 -0800 From: Weongyo Jeong Date: Fri, 5 Mar 2010 16:16:56 -0800 To: Joe Marcus Clarke Message-ID: <20100306001656.GS1295@weongyo> Mail-Followup-To: Joe Marcus Clarke , current References: <1267388668.39569.2410.camel@shumai.marcuscom.com> <20100301233706.GH1295@weongyo> <1267505443.35639.9.camel@shumai.marcuscom.com> <20100303220452.GL1295@weongyo> <4B8EE6B1.6030605@freebsd.org> <20100303231416.GN1295@weongyo> <1267679522.5324.20.camel@shumai.marcuscom.com> <20100305205349.GR1295@weongyo> <4B917B42.1060900@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="DqhR8hV3EnoxUkKN" Content-Disposition: inline In-Reply-To: <4B917B42.1060900@freebsd.org> User-Agent: Mutt/1.4.2.3i Organization: CDNetworks. X-Operation-Sytem: FreeBSD Cc: current Subject: Re: Problem with new bwn driver on -CURRENT X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Weongyo Jeong List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2010 00:16:54 -0000 --DqhR8hV3EnoxUkKN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Mar 05, 2010 at 04:44:34PM -0500, Joe Marcus Clarke wrote: > On 3/5/10 3:53 PM, Weongyo Jeong wrote: > > On Thu, Mar 04, 2010 at 12:12:02AM -0500, Joe Marcus Clarke wrote: > >> On Wed, 2010-03-03 at 15:14 -0800, Weongyo Jeong wrote: > >>>> When it occurs again, I will get you the details and the full dmesg. Do > >>>> you want a verbose dmesg, or a standard one? > >>> > >>> I think a standard one is enough. Thank you. > >> > >> Here you go. This is on -CURRENT from about 30 minutes ago. Thanks for > >> looking into this. > >> > >> http://www.marcuscom.com/downloads/salami.dmesg > > > > Thank you for dmesg. It looks using PIO mode is only a way to avoid > > this problem. > > > > I looked sources and problems of other Broadcom wireless driver for LP > > PHY users. They also encounters this issue and are trying to solve > > this but no luck and no perfect patch until now. > > > > Recently AFAIK wireless-test git of linux adopted a patch `gracefully > > convert DMA to PIO mode' to solve it. > > > > Additionally some guys tolds some success story when they disabled ACPI > > but it looks it's not a perfect solution. > > > > IIRC you said PIO worked for association with your AP but no further > > traffic. However I wonder that this is weird for me because paths of > > sending management frames and sending data frames are same. Could you > > please recheck whether PIO mode worked? I'll try to test PIO mode on my > > environment again. > > I can absolutely confirm PIO mode does NOT work with my card. I tested > on a clean power-up. The card associates, but does not pass any > traffic. I do not see the same decryption messages that I do with DMA mode. OK. I'd like to see some verbose message from bwn(4) after applying attached patch with email. Could you please test with it and show me dmesg? I tested 3 broadcom card whose revisions are 5 and 9 and it looks it's working. I have one LP PHY device, half MiniPCI-E for laptop, but could not test with this patch because I could not turn on RF; it's connected with desktop using converter MiniPCI-E to PCI-E though normally it looks MiniPCI-E devices are turned on using H/W RF switch. regards, Weongyo Jeong --DqhR8hV3EnoxUkKN Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="patch_bwn_20100305.diff" Index: if_bwn.c =================================================================== --- if_bwn.c (revision 204657) +++ if_bwn.c (working copy) @@ -73,6 +73,7 @@ #include #include +#define BWN_DEBUG SYSCTL_NODE(_hw, OID_AUTO, bwn, CTLFLAG_RD, 0, "Broadcom driver parameters"); /* @@ -102,6 +103,7 @@ BWN_DEBUG_FW = 0x00004000, /* firmware */ BWN_DEBUG_WME = 0x00008000, /* WME */ BWN_DEBUG_RF = 0x00010000, /* RF */ + BWN_DEBUG_PIO = 0x00020000, /* PIO */ BWN_DEBUG_FATAL = 0x80000000, /* fatal errors */ BWN_DEBUG_ANY = 0xffffffff }; @@ -124,7 +126,7 @@ "uses H/W power control"); static int bwn_msi_disable = 0; /* MSI disabled */ TUNABLE_INT("hw.bwn.msi_disable", &bwn_msi_disable); -static int bwn_usedma = 1; +static int bwn_usedma = 0; SYSCTL_INT(_hw_bwn, OID_AUTO, usedma, CTLFLAG_RD, &bwn_usedma, 0, "uses DMA"); TUNABLE_INT("hw.bwn.usedma", &bwn_usedma); @@ -936,8 +938,11 @@ sc->sc_sd = sd; #ifdef BWN_DEBUG sc->sc_debug = bwn_debug; + sc->sc_debug |= BWN_DEBUG_ANY; #endif + device_printf(dev, "DEBUG %#x\n", sc->sc_debug); + if ((sc->sc_flags & BWN_FLAG_ATTACHED) == 0) { error = bwn_attach_pre(sc); if (error != 0) @@ -1410,6 +1415,7 @@ struct bwn_pio_txqueue *tq = bwn_pio_select(mac, M_WME_GETAC(m)); struct bwn_softc *sc = mac->mac_sc; struct bwn_txhdr txhdr; + struct ieee80211_frame *wh; struct mbuf *m_new; uint32_t ctl32; int error; @@ -1434,6 +1440,12 @@ tq->tq_used += roundup(m->m_pkthdr.len + BWN_HDRSIZE(mac), 4); tq->tq_free--; + wh = mtod(m, struct ieee80211_frame *); + DPRINTF(sc, BWN_DEBUG_PIO, + "tx: used %d free %d (type %#x subtype %#x)\n", tq->tq_used, + tq->tq_free, wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK, + wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK); + if (mac->mac_sd->sd_id.sd_rev >= 8) { /* * XXX please removes m_defrag(9) @@ -9236,6 +9248,8 @@ m->m_pkthdr.rcvif = ifp; m->m_len = m->m_pkthdr.len = len + padding; + DPRINTF(sc, BWN_DEBUG_PIO, "rx: m %p len %d\n", m, m->m_pkthdr.len); + bwn_rxeof(prq->prq_mac, m, &rxhdr); return (1); @@ -9562,6 +9576,9 @@ tp->tp_m = NULL; TAILQ_INSERT_TAIL(&tq->tq_pktlist, tp, tp_list); + DPRINTF(sc, BWN_DEBUG_PIO, "txeof: used %d free %d\n", tq->tq_used, + tq->tq_free); + ifp->if_opackets++; sc->sc_watchdog_timer = 0; --DqhR8hV3EnoxUkKN--