linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Stefan Brüns" <stefan.bruens@rwth-aachen.de>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: Throughput regression in b43 caused by spurious avoidance implementation
Date: Mon, 17 Dec 2012 04:39:23 +0100	[thread overview]
Message-ID: <7518862.S5jbS4KJYD@pebbles> (raw)
In-Reply-To: <CACna6rwH5ixD=f_oXse9AZpK_SNoMEXu=n-2c4ba5gFy1u3prQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 232 bytes --]

Hi Rafal, hi list,

had a look at it myself, the culprit is the missing setting operations in case 
CONFIG_B43_SSB is used.

The attached patch fixes the problem in my case, chip_id 0x4322, bus=SSB, 
channel=6/13.

Regards,

Stefan

[-- Attachment #2: ssb_ppl_support.diff --]
[-- Type: text/x-patch, Size: 2100 bytes --]

--- phy_n.c_orig	2012-12-17 03:38:22.338451489 +0100
+++ phy_n.c	2012-12-17 04:28:02.308743464 +0100
@@ -4518,10 +4518,20 @@
 	b43_phy_write(dev, B43_NPHY_BW6, e->phy_bw6);
 }
 
+/* copied verbatim from ssb/driver_chipcommon_pmu.c */
+static void ssb_chipco_pll_write(struct ssb_chipcommon *cc,
+                                 u32 offset, u32 value)
+{
+        chipco_write32(cc, SSB_CHIPCO_PLLCTL_ADDR, offset);
+        chipco_write32(cc, SSB_CHIPCO_PLLCTL_DATA, value);
+}
+
+
 /* http://bcm-v4.sipsolutions.net/802.11/PmuSpurAvoid */
 static void b43_nphy_pmu_spur_avoid(struct b43_wldev *dev, bool avoid)
 {
 	struct bcma_drv_cc __maybe_unused *cc;
+	struct ssb_chipcommon __maybe_unused *ssb_cc;
 	u32 __maybe_unused pmu_ctl;
 
 	switch (dev->dev->bus_type) {
@@ -4583,6 +4593,28 @@
 #ifdef CONFIG_B43_SSB
 	case B43_BUS_SSB:
 		/* FIXME */
+		b43info(dev->wl, "Spur avoid: bus type=%i (SSB, experimental)"
+			"chip_id=%i/0x%x avoid=%i\n", dev->dev->bus_type,
+			dev->dev->chip_id, dev->dev->chip_id, avoid);
+		ssb_cc = &dev->dev->sdev->bus->chipco;
+		if (dev->dev->chip_id == 0x4322 ||
+			   dev->dev->chip_id == 0x4340 ||
+			   dev->dev->chip_id == 0x4341) {
+			ssb_chipco_pll_write(ssb_cc, 0x0, 0x11100070);
+			ssb_chipco_pll_write(ssb_cc, 0x1, 0x1014140a);
+			ssb_chipco_pll_write(ssb_cc, 0x5, 0x88888854);
+			if (avoid)
+				ssb_chipco_pll_write(ssb_cc, 0x2, 0x05201828);
+			else
+				ssb_chipco_pll_write(ssb_cc, 0x2, 0x05001828);
+			/* guessed by comparing {bcma,ssb}_driver_chipcommon.h */
+			#define SSB_CHIPCO_PMU_CTL_PLL_UPD 0x400;
+			pmu_ctl = SSB_CHIPCO_PMU_CTL_PLL_UPD;
+		} else {
+			b43err(dev->wl, "unsupported!\n");
+			return;
+		}
+		chipco_set32(ssb_cc, SSB_CHIPCO_PMU_CTL, pmu_ctl);
 		break;
 #endif
 	}
@@ -4635,6 +4667,11 @@
 
 	b43_nphy_tx_lp_fbw(dev);
 
+	b43info(dev->wl, "phy.rev=%i phy.n->spavoid=%i(%s) ch=%i\n",
+	    dev->phy.rev, dev->phy.n->spur_avoid, 
+	    (dev->phy.n->spur_avoid == B43_SPUR_AVOID_AUTO)?"auto":"?",
+	    ch);
+
 	if (dev->phy.rev >= 3 &&
 	    dev->phy.n->spur_avoid != B43_SPUR_AVOID_DISABLE) {
 		bool avoid = false;

  reply	other threads:[~2012-12-17  4:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-24 21:46 Throughput regression in b43 caused by spurious avoidance implementation Stefan Brüns
2012-09-25  6:29 ` Rafał Miłecki
2012-12-17  3:39   ` Stefan Brüns [this message]
2013-04-26  9:51 ` Rafał Miłecki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7518862.S5jbS4KJYD@pebbles \
    --to=stefan.bruens@rwth-aachen.de \
    --cc=linux-wireless@vger.kernel.org \
    --cc=zajec5@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).