2011-05-08 16:31:46

by Rafał Miłecki

[permalink] [raw]
Subject: [PATCH 0/3] ssb/b43(legacy): clean dangling cores workarounds

There is no perfect place for this workarounds, but keeping it in ssb sounds
more reasonable.
1) We already have in ssb similar workarounds for different cores
2) We do not register not working devices in system
3) We do not duplicate code in b43 and b43legacy

Rafał Miłecki (3):
ssb: update list of devices supporting multiple 80211 cores
b43: drop ssb-duplicated workaround for dangling cores
b43legacy: drop ssb-duplicated workaround for dangling cores

drivers/net/wireless/b43/main.c | 17 -----------------
drivers/net/wireless/b43legacy/main.c | 18 ------------------
drivers/ssb/scan.c | 5 ++++-
3 files changed, 4 insertions(+), 36 deletions(-)

--
1.7.3.4



2011-05-08 16:31:54

by Rafał Miłecki

[permalink] [raw]
Subject: [PATCH 3/3] b43legacy: drop ssb-duplicated workaround for dangling cores


Signed-off-by: Rafał Miłecki <[email protected]>
---
drivers/net/wireless/b43legacy/main.c | 18 ------------------
1 files changed, 0 insertions(+), 18 deletions(-)

diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index 2162663..f6d5446 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -3696,26 +3696,8 @@ static int b43legacy_one_core_attach(struct ssb_device *dev,
struct b43legacy_wl *wl)
{
struct b43legacy_wldev *wldev;
- struct pci_dev *pdev;
int err = -ENOMEM;

- if (!list_empty(&wl->devlist)) {
- /* We are not the first core on this chip. */
- pdev = (dev->bus->bustype == SSB_BUSTYPE_PCI) ? dev->bus->host_pci : NULL;
- /* Only special chips support more than one wireless
- * core, although some of the other chips have more than
- * one wireless core as well. Check for this and
- * bail out early.
- */
- if (!pdev ||
- ((pdev->device != 0x4321) &&
- (pdev->device != 0x4313) &&
- (pdev->device != 0x431A))) {
- b43legacydbg(wl, "Ignoring unconnected 802.11 core\n");
- return -ENODEV;
- }
- }
-
wldev = kzalloc(sizeof(*wldev), GFP_KERNEL);
if (!wldev)
goto out;
--
1.7.3.4


2011-05-08 18:34:23

by Larry Finger

[permalink] [raw]
Subject: Re: [PATCH 0/3] ssb/b43(legacy): clean dangling cores workarounds

On 05/08/2011 12:16 PM, Michael Büsch wrote:
> On Sun, 2011-05-08 at 19:11 +0200, Rafał Miłecki wrote:
>> Oh, do you have some device with 2 active cores? Nice :)
>
> I don't think there are any supported multicore devices anyway. Those
> are the very early A-PHY, only. AFAIK.

Yes, I have a Linksys WPC54G Cardbus device that uses b43legacy.

The 'dmesg | egrep "ssb|b43"' output for it is

b43-pci-bridge 0000:06:00.0: PCI INT A -> Link[LNK1] -> GSI 11 (level, low) ->
IRQ 11
ssb: Core 0 found: ChipCommon (cc 0x800, rev 0x02, vendor 0x4243)
ssb: Core 1 found: IEEE 802.11 (cc 0x812, rev 0x04, vendor 0x4243)
ssb: Core 2 found: PCMCIA (cc 0x80D, rev 0x01, vendor 0x4243)
ssb: Core 3 found: V90 (cc 0x807, rev 0x01, vendor 0x4243)
ssb: Core 4 found: PCI (cc 0x804, rev 0x07, vendor 0x4243)
ssb: Core 5 found: IEEE 802.11 (cc 0x812, rev 0x04, vendor 0x4243)
ssb: Ignoring additional 802.11 core
ssb: chipcommon status is 0x0
ssb: SPROM offset is 0x1000
ssb: SPROM revision 1 detected.
ssb: Sonics Silicon Backplane found on PCI device 0000:06:00.0
b43legacy-phy0: Broadcom 4306 WLAN found
b43legacy-phy0 debug: Found PHY: Analog 1, Type 2, Revision 1
b43legacy-phy0 debug: Found Radio: Manuf 0x17F, Version 0x2050, Revision 2
b43legacy-phy0 debug: Radio initialized
b43legacy-phy0: Loading firmware version 0x127, patch level 14 (2005-04-18 02:36:27)
b43legacy-phy0 debug: Chip initialized
b43legacy-phy0 debug: 30-bit DMA initialized
b43legacy-phy0 debug: Wireless interface started
b43legacy-phy0 debug: Adding Interface type 2

You can add a Tested-by: and an ACK to the patches.

Larry



2011-05-08 16:31:49

by Rafał Miłecki

[permalink] [raw]
Subject: [PATCH 1/3] ssb: update list of devices supporting multiple 80211 cores


Signed-off-by: Rafał Miłecki <[email protected]>
---
drivers/ssb/scan.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/ssb/scan.c b/drivers/ssb/scan.c
index 7dca719..45e5bab 100644
--- a/drivers/ssb/scan.c
+++ b/drivers/ssb/scan.c
@@ -258,7 +258,10 @@ static int we_support_multiple_80211_cores(struct ssb_bus *bus)
#ifdef CONFIG_SSB_PCIHOST
if (bus->bustype == SSB_BUSTYPE_PCI) {
if (bus->host_pci->vendor == PCI_VENDOR_ID_BROADCOM &&
- bus->host_pci->device == 0x4324)
+ ((bus->host_pci->device == 0x4313) ||
+ (bus->host_pci->device == 0x431A) ||
+ (bus->host_pci->device == 0x4321) ||
+ (bus->host_pci->device == 0x4324)))
return 1;
}
#endif /* CONFIG_SSB_PCIHOST */
--
1.7.3.4


2011-05-08 17:16:20

by Michael Büsch

[permalink] [raw]
Subject: Re: [PATCH 0/3] ssb/b43(legacy): clean dangling cores workarounds

On Sun, 2011-05-08 at 19:11 +0200, Rafał Miłecki wrote:
> Oh, do you have some device with 2 active cores? Nice :)

I don't think there are any supported multicore devices anyway. Those
are the very early A-PHY, only. AFAIK.

--
Greetings Michael.


2011-05-08 18:36:27

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH 0/3] ssb/b43(legacy): clean dangling cores workarounds

W dniu 8 maja 2011 20:34 użytkownik Larry Finger
<[email protected]> napisał:
> On 05/08/2011 12:16 PM, Michael Büsch wrote:
>>
>> On Sun, 2011-05-08 at 19:11 +0200, Rafał Miłecki wrote:
>>>
>>> Oh, do you have some device with 2 active cores? Nice :)
>>
>> I don't think there are any supported multicore devices anyway. Those
>> are the very early A-PHY, only. AFAIK.
>
> Yes, I have a Linksys WPC54G Cardbus device that uses b43legacy.
>
> The 'dmesg | egrep "ssb|b43"' output for it is
>
> b43-pci-bridge 0000:06:00.0: PCI INT A -> Link[LNK1] -> GSI 11 (level, low)
> -> IRQ 11
> ssb: Core 0 found: ChipCommon (cc 0x800, rev 0x02, vendor 0x4243)
> ssb: Core 1 found: IEEE 802.11 (cc 0x812, rev 0x04, vendor 0x4243)
> ssb: Core 2 found: PCMCIA (cc 0x80D, rev 0x01, vendor 0x4243)
> ssb: Core 3 found: V90 (cc 0x807, rev 0x01, vendor 0x4243)
> ssb: Core 4 found: PCI (cc 0x804, rev 0x07, vendor 0x4243)
> ssb: Core 5 found: IEEE 802.11 (cc 0x812, rev 0x04, vendor 0x4243)
> ssb: Ignoring additional 802.11 core
> ssb: chipcommon status is 0x0
> ssb: SPROM offset is 0x1000
> ssb: SPROM revision 1 detected.
> ssb: Sonics Silicon Backplane found on PCI device 0000:06:00.0
> b43legacy-phy0: Broadcom 4306 WLAN found
> b43legacy-phy0 debug: Found PHY: Analog 1, Type 2, Revision 1
> b43legacy-phy0 debug: Found Radio: Manuf 0x17F, Version 0x2050, Revision 2
> b43legacy-phy0 debug: Radio initialized
> b43legacy-phy0: Loading firmware version 0x127, patch level 14 (2005-04-18
> 02:36:27)
> b43legacy-phy0 debug: Chip initialized
> b43legacy-phy0 debug: 30-bit DMA initialized
> b43legacy-phy0 debug: Wireless interface started
> b43legacy-phy0 debug: Adding Interface type 2
>
> You can add a Tested-by: and an ACK to the patches.

John, is this something you can do easily? Or do you want me to
resubmit patches with Larry's Tested?

--
Rafał

2011-05-08 17:06:26

by Larry Finger

[permalink] [raw]
Subject: Re: [PATCH 0/3] ssb/b43(legacy): clean dangling cores workarounds

On 05/08/2011 12:09 PM, Rafał Miłecki wrote:
> There is no perfect place for this workarounds, but keeping it in ssb sounds
> more reasonable.
> 1) We already have in ssb similar workarounds for different cores
> 2) We do not register not working devices in system
> 3) We do not duplicate code in b43 and b43legacy
>
> Rafał Miłecki (3):
> ssb: update list of devices supporting multiple 80211 cores
> b43: drop ssb-duplicated workaround for dangling cores
> b43legacy: drop ssb-duplicated workaround for dangling cores
>
> drivers/net/wireless/b43/main.c | 17 -----------------
> drivers/net/wireless/b43legacy/main.c | 18 ------------------
> drivers/ssb/scan.c | 5 ++++-
> 3 files changed, 4 insertions(+), 36 deletions(-)

First of all, a minor grammatical mistake. It should be "this workaround" as
there is only only one workaround discussed here.

Secondly, "we do not register not working" is a little awkward. "We do not
register inactive devices..." would be better.

Finally, this commit message will never show up in the git commit logs. I think
this info is valuable, thus it should be in the real commits.

My suggestion for the [1/3] patch is something like:

"Many of the BCM43xx chips contain cores that are attached to the SSB, but are
inactive as they do not connect to the external environment. These must not be
registered. Several of these types are handled in driver ssb; however, the
specific case of an inactive 802.11 cores is now treated in b43 and b43legacy.
Although the current setup works, this minor change will place all such
workarounds in ssb, and simplify the code in drivers b43 and b43legacy."

In each of the other two patches, add a commit message something like:

"Remove the code to detect inactive 802.11 cores, as that function is now done
in ssb."

I have not yet tested the patches, but will do so soon.

Larry

2011-05-08 16:31:52

by Rafał Miłecki

[permalink] [raw]
Subject: [PATCH 2/3] b43: drop ssb-duplicated workaround for dangling cores


Signed-off-by: Rafał Miłecki <[email protected]>
---
drivers/net/wireless/b43/main.c | 17 -----------------
1 files changed, 0 insertions(+), 17 deletions(-)

diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index f907df0..b02fbab 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -4837,25 +4837,8 @@ static void b43_one_core_detach(struct ssb_device *dev)
static int b43_one_core_attach(struct ssb_device *dev, struct b43_wl *wl)
{
struct b43_wldev *wldev;
- struct pci_dev *pdev;
int err = -ENOMEM;

- if (!list_empty(&wl->devlist)) {
- /* We are not the first core on this chip. */
- pdev = (dev->bus->bustype == SSB_BUSTYPE_PCI) ? dev->bus->host_pci : NULL;
- /* Only special chips support more than one wireless
- * core, although some of the other chips have more than
- * one wireless core as well. Check for this and
- * bail out early.
- */
- if (!pdev ||
- ((pdev->device != 0x4321) &&
- (pdev->device != 0x4313) && (pdev->device != 0x431A))) {
- b43dbg(wl, "Ignoring unconnected 802.11 core\n");
- return -ENODEV;
- }
- }
-
wldev = kzalloc(sizeof(*wldev), GFP_KERNEL);
if (!wldev)
goto out;
--
1.7.3.4


2011-05-08 17:11:44

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH 0/3] ssb/b43(legacy): clean dangling cores workarounds

2011/5/8 Larry Finger <[email protected]>:
> On 05/08/2011 12:09 PM, Rafał Miłecki wrote:
>>
>> There is no perfect place for this workarounds, but keeping it in ssb
>> sounds
>> more reasonable.
>> 1) We already have in ssb similar workarounds for different cores
>> 2) We do not register not working devices in system
>> 3) We do not duplicate code in b43 and b43legacy
>>
>> Rafał Miłecki (3):
>>   ssb: update list of devices supporting multiple 80211 cores
>>   b43: drop ssb-duplicated workaround for dangling cores
>>   b43legacy: drop ssb-duplicated workaround for dangling cores
>>
>>  drivers/net/wireless/b43/main.c       |   17 -----------------
>>  drivers/net/wireless/b43legacy/main.c |   18 ------------------
>>  drivers/ssb/scan.c                    |    5 ++++-
>>  3 files changed, 4 insertions(+), 36 deletions(-)
>
> First of all, a minor grammatical mistake. It should be "this workaround" as
> there is only only one workaround discussed here.
>
> Secondly, "we do not register not working" is a little awkward. "We do not
> register inactive devices..." would be better.
>
> Finally, this commit message will never show up in the git commit logs. I
> think this info is valuable, thus it should be in the real commits.
>
> My suggestion for the [1/3] patch is something like:
>
> "Many of the BCM43xx chips contain cores that are attached to the SSB, but
> are inactive as they do not connect to the external environment. These must
> not be registered. Several of these types are handled in driver ssb;
> however, the specific case of an inactive 802.11 cores is now treated in b43
> and b43legacy. Although the current setup works, this minor change will
> place all such workarounds in ssb, and simplify the code in drivers b43 and
> b43legacy."
>
> In each of the other two patches, add a commit message something like:
>
> "Remove the code to detect inactive 802.11 cores, as that function is now
> done in ssb."

Thank you for reviewing.


> I have not yet tested the patches, but will do so soon.

Oh, do you have some device with 2 active cores? Nice :)

--
Rafał