Re: b43 kills my kernel
On Friday 20 November 2009 02:41:58 Oncaphillis wrote: On 11/20/2009 12:46 AM, Oncaphillis wrote: On 11/19/2009 06:44 PM, Michael Buesch wrote: On Thursday 19 November 2009 16:41:12 Michael Buesch wrote: Wait, that still can't work. I'll fix it soon... Ok, here's the updated version. Please test this: http://bu3sch.de/patches/wireless-testing/20091119-1842/patches/002-ssb-rewrite-sprom-fallback-mechanism.patch Heureka -- seems like I'm the first linux user on the planet with a WLAN connection on that device. The MAC address is random which of course is a pain for DHCP but it seems to work. Thanks. I'll see what I can do about this. [ 6415.479127] b43-phy0 debug: Removing Interface type 2 [ 6415.479601] b43-phy0 debug: Wireless interface stopped [ 6415.479615] b43-phy0 debug: DMA-64 rx_ring: Used slots 8/64, Failed frames 0/0 = 0.0%, Average tries 0.00 [ 6415.479710] b43-phy0 debug: DMA-64 tx_ring_AC_BK: Used slots 0/256, Failed frames 0/0 = 0.0%, Average tries 0.0 [ 6415.481511] b43-phy0 debug: DMA-64 tx_ring_AC_BE: Used slots 152/256, Failed frames 2795/23615 = 11.8%, Averag tries 3.38 [ 6415.483077] b43-phy0 debug: DMA-64 tx_ring_AC_VI: Used slots 0/256, Failed frames 0/0 = 0.0%, Average tries 0.0 [ 6415.485064] b43-phy0 debug: DMA-64 tx_ring_AC_VO: Used slots 12/256, Failed frames 35/2939 = 1.1%, Average tris 1.05 [ 6415.487069] b43-phy0 debug: DMA-64 tx_ring_mcast: Used slots 0/256, Failed frames 0/0 = 0.0%, Average tries 0.0 and loose the interface Well, somebody shuts down the interfsce. There's nothing wrong with these logs. I would point at network manager or something like that. -- Greetings, Michael. ___ Bcm43xx-dev mailing list Bcm43xx-dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/bcm43xx-dev
Re: [PATCH] b43: Enforce DMA descriptor memory constraints
On Friday 20 November 2009 00:55:07 Larry Finger wrote: On 11/18/2009 11:21 PM, William Bourque wrote: Also, just saying, but it seems Larry's pm_qos_update_requirement patch had some good effects; I can hardly get any connectivity without it. With the patch, the wireless seems to be stable for a few minutes before generating DMA errors... without the patch the error start piling up as soon the interface get up. If the pm_qos patch has some positive benefits, I'll push it; however, I think this is just a band aid, not a real fix. It also has the bad side effect of keeping the CPU from going into deep sleep, which increases the power usage with reduced battery life. Yes, that's why it should at least only be set if DMA is used. We could also make it depend on specific PCI IDs, but I'm not sure how big the list would grow. -- Greetings, Michael. ___ Bcm43xx-dev mailing list Bcm43xx-dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/bcm43xx-dev
Re: b43 kills my kernel
On 11/20/2009 10:27 AM, Michael Buesch wrote: On Friday 20 November 2009 02:41:58 Oncaphillis wrote: On 11/20/2009 12:46 AM, Oncaphillis wrote: On 11/19/2009 06:44 PM, Michael Buesch wrote: On Thursday 19 November 2009 16:41:12 Michael Buesch wrote: Wait, that still can't work. I'll fix it soon... Ok, here's the updated version. Please test this: http://bu3sch.de/patches/wireless-testing/20091119-1842/patches/002-ssb-rewrite-sprom-fallback-mechanism.patch Heureka -- seems like I'm the first linux user on the planet with a WLAN connection on that device. The MAC address is random which of course is a pain for DHCP but it seems to work. Thanks. I'll see what I can do about this. [ 6415.479127] b43-phy0 debug: Removing Interface type 2 [ 6415.479601] b43-phy0 debug: Wireless interface stopped [ 6415.479615] b43-phy0 debug: DMA-64 rx_ring: Used slots 8/64, Failed frames 0/0 = 0.0%, Average tries 0.00 [ 6415.479710] b43-phy0 debug: DMA-64 tx_ring_AC_BK: Used slots 0/256, Failed frames 0/0 = 0.0%, Average tries 0.0 [ 6415.481511] b43-phy0 debug: DMA-64 tx_ring_AC_BE: Used slots 152/256, Failed frames 2795/23615 = 11.8%, Averag tries 3.38 [ 6415.483077] b43-phy0 debug: DMA-64 tx_ring_AC_VI: Used slots 0/256, Failed frames 0/0 = 0.0%, Average tries 0.0 [ 6415.485064] b43-phy0 debug: DMA-64 tx_ring_AC_VO: Used slots 12/256, Failed frames 35/2939 = 1.1%, Average tris 1.05 [ 6415.487069] b43-phy0 debug: DMA-64 tx_ring_mcast: Used slots 0/256, Failed frames 0/0 = 0.0%, Average tries 0.0 and loose the interface Well, somebody shuts down the interfsce. There's nothing wrong with these logs. I would point at network manager or something like that. Ok -- Some more details about my experience that it appears to be slow. As a test I've transfered a couple of 100 Mbyte files via NFS to my desktop. I don't know much about the overhead it has but if wlan0 tells me I have a 11MBit connection a throughput of at least 500kbyte/s should be possible and I'm far away from this. It also appeared that the transfer freezes for a couple of seconds ( I had a look at the file sizes on the recipient side in second intervals). Nothing suspicious in dmesg or syslog though. This of course is a very crude analysis, but if someone can point me to better tools to check for data throughput and connection stability I'll be happy to check in more detail. Sebastian ___ Bcm43xx-dev mailing list Bcm43xx-dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/bcm43xx-dev
Re: b43 kills my kernel
On Friday 20 November 2009 11:29:20 Oncaphillis wrote: Ok -- Some more details about my experience that it appears to be slow. Note that there are several issues. First one being the sprom calibration values being _wrong_ for your card. Second one is LP-PHY performance being crappy in general for the current implementation. Can somebody give me a genuine SPROM image for an LP-PHY card, please? Just do this: sudo cat $(find /sys/devices -name ssb_sprom) ssb_sprom_copy -- Greetings, Michael. ___ Bcm43xx-dev mailing list Bcm43xx-dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/bcm43xx-dev
[PATCH RFC] ssb: Generic SPROM override for devices without SPROM
This patch adds a generic mechanism for overriding the SPROM mechanism on devices without SPROM hardware. There currently is a major problem with this: It tries to deduce a MAC address from various hardware parameters. But currently it will result in the same MAC address for machines of the same type. Does somebody have an idea of some device-instance specific serial number or something similar that could be hashed into the MAC? Index: wireless-testing/drivers/ssb/pci.c === --- wireless-testing.orig/drivers/ssb/pci.c 2009-11-19 18:34:42.0 +0100 +++ wireless-testing/drivers/ssb/pci.c 2009-11-19 18:37:27.0 +0100 @@ -252,6 +252,9 @@ static int sprom_do_read(struct ssb_bus { int i; + if (!bus-sprom_size) + return -ENODEV; + for (i = 0; i bus-sprom_size; i++) sprom[i] = ioread16(bus-mmio + SSB_SPROM_BASE + (i * 2)); @@ -265,6 +268,9 @@ static int sprom_do_write(struct ssb_bus u32 spromctl; u16 size = bus-sprom_size; + if (!size) + return -ENODEV; + ssb_printk(KERN_NOTICE PFX Writing SPROM. Do NOT turn off the power! Please stand by...\n); err = pci_read_config_dword(pdev, SSB_SPROMCTL, spromctl); if (err) @@ -616,10 +622,17 @@ static int sprom_extract(struct ssb_bus static int ssb_pci_sprom_get(struct ssb_bus *bus, struct ssb_sprom *sprom) { - const struct ssb_sprom *fallback; - int err = -ENOMEM; + int err; u16 *buf; + bus-sprom_size = 0; + err = ssb_find_sprom_override(bus, sprom); + if (!err) { + ssb_printk(KERN_INFO PFX Overriding SPROM image\n); + return 0; + } + + err = -ENOMEM; buf = kcalloc(SSB_SPROMSIZE_WORDS_R123, sizeof(u16), GFP_KERNEL); if (!buf) goto out; @@ -637,22 +650,12 @@ static int ssb_pci_sprom_get(struct ssb_ sprom_do_read(bus, buf); err = sprom_check_crc(buf, bus-sprom_size); if (err) { - /* All CRC attempts failed. -* Maybe there is no SPROM on the device? -* If we have a fallback, use that. */ - fallback = ssb_get_fallback_sprom(); - if (fallback) { - memcpy(sprom, fallback, sizeof(*sprom)); - err = 0; - goto out_free; - } ssb_printk(KERN_WARNING PFX WARNING: Invalid SPROM CRC (corrupt SPROM)\n); } } err = sprom_extract(bus, sprom, buf, bus-sprom_size); -out_free: kfree(buf); out: return err; Index: wireless-testing/drivers/ssb/sprom.c === --- wireless-testing.orig/drivers/ssb/sprom.c 2009-11-19 18:34:42.0 +0100 +++ wireless-testing/drivers/ssb/sprom.c2009-11-19 18:37:27.0 +0100 @@ -13,8 +13,13 @@ #include ssb_private.h +#include linux/list.h +#include linux/spinlock.h -static const struct ssb_sprom *fallback_sprom; + +/* List of registered SPROM overrides. */ +static LIST_HEAD(override_list); +static DEFINE_SPINLOCK(override_list_lock); static int sprom2hex(const u16 *sprom, char *buf, size_t buf_len, @@ -135,35 +140,34 @@ out: return err ? err : count; } -/** - * ssb_arch_set_fallback_sprom - Set a fallback SPROM for use if no SPROM is found. - * - * @sprom: The SPROM data structure to register. - * - * With this function the architecture implementation may register a fallback - * SPROM data structure. The fallback is only used for PCI based SSB devices, - * where no valid SPROM can be found in the shadow registers. - * - * This function is useful for weird architectures that have a half-assed SSB device - * hardwired to their PCI bus. - * - * Note that it does only work with PCI attached SSB devices. PCMCIA devices currently - * don't use this fallback. - * Architectures must provide the SPROM for native SSB devices anyway, - * so the fallback also isn't used for native devices. - * - * This function is available for architecture code, only. So it is not exported. - */ -int ssb_arch_set_fallback_sprom(const struct ssb_sprom *sprom) -{ - if (fallback_sprom) - return -EEXIST; - fallback_sprom = sprom; +void ssb_register_sprom_override(struct ssb_sprom_override *ovr) +{ + spin_lock(override_list_lock); + list_add_tail(ovr-list, override_list); + spin_unlock(override_list_lock); +} +EXPORT_SYMBOL(ssb_register_sprom_override); - return 0; +void ssb_unregister_sprom_override(struct ssb_sprom_override *ovr) +{ + spin_lock(override_list_lock); + list_del(ovr-list); +
Re: [PATCH RFC] ssb: Generic SPROM override for devices without SPROM
On Friday 20 November 2009 12:38:07 Florian Fainelli wrote: Why not call once random_ether_addr instead of using some kind of hash? Is it because you want the same MAC from a reboot to another? yes. Ok, so for BCM63xx I would no longer have to declare my SPROM, fine. No you still need to do that. The sprom is device specific. You need to call ssb_register_sprom_override() from the arch code with that callback that sets up your sprom image. -- Greetings, Michael. ___ Bcm43xx-dev mailing list Bcm43xx-dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/bcm43xx-dev
Re: b43 kills my kernel
On 11/20/2009 04:54 AM, Michael Buesch wrote: On Friday 20 November 2009 11:29:20 Oncaphillis wrote: Ok -- Some more details about my experience that it appears to be slow. Note that there are several issues. First one being the sprom calibration values being _wrong_ for your card. Second one is LP-PHY performance being crappy in general for the current implementation. Can somebody give me a genuine SPROM image for an LP-PHY card, please? Just do this: sudo cat $(find /sys/devices -name ssb_sprom) ssb_sprom_copy Real LP PHY, rev 8 SPROM image attached. Larry sprom.dat Description: MPEG movie ___ Bcm43xx-dev mailing list Bcm43xx-dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/bcm43xx-dev
Re: [PATCH] b43: Enforce DMA descriptor memory constraints
On 11/20/2009 03:29 AM, Michael Buesch wrote: On Friday 20 November 2009 00:55:07 Larry Finger wrote: If the pm_qos patch has some positive benefits, I'll push it; however, I think this is just a band aid, not a real fix. It also has the bad side effect of keeping the CPU from going into deep sleep, which increases the power usage with reduced battery life. Yes, that's why it should at least only be set if DMA is used. We could also make it depend on specific PCI IDs, but I'm not sure how big the list would grow. I'll start with the 4315. Larry ___ Bcm43xx-dev mailing list Bcm43xx-dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/bcm43xx-dev
Fatal DMA error problem with netbook and BCM4312
One last check. I would appreciate receiving answers to the following questions. These questions apply to anyone else with this problem. Does the pm_qos patch help your fatal DMA error problem, particularly when booted from power-off? If you warm-boot after loading the wl driver, does the patch make any difference? Larry ___ Bcm43xx-dev mailing list Bcm43xx-dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/bcm43xx-dev
Re: [PATCH] b43: Enforce DMA descriptor memory constraints
On Thu, Nov 19, 2009 at 05:55:07PM -0600, Larry Finger wrote: On 11/18/2009 11:21 PM, William Bourque wrote: Also, just saying, but it seems Larry's pm_qos_update_requirement patch had some good effects; I can hardly get any connectivity without it. With the patch, the wireless seems to be stable for a few minutes before generating DMA errors... without the patch the error start piling up as soon the interface get up. If the pm_qos patch has some positive benefits, I'll push it; however, I think this is just a band aid, not a real fix. It also has the bad side effect of keeping the CPU from going into deep sleep, which increases the power usage with reduced battery life. John: Any thoughts on this matter? Missing deep sleep is bad. At the very least you need to limit that to devices that truly need it, as Michael suggested. John -- John W. LinvilleSomeday the world will need a hero, and you linvi...@tuxdriver.com might be all we have. Be ready. ___ Bcm43xx-dev mailing list Bcm43xx-dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/bcm43xx-dev
Re: Fatal DMA error problem with netbook and BCM4312
Larry Finger wrote: One last check. I would appreciate receiving answers to the following questions. These questions apply to anyone else with this problem. Does the pm_qos patch help your fatal DMA error problem, particularly when booted from power-off? If you warm-boot after loading the wl driver, does the patch make any difference? I would say yes right now to both, but I'm afraid it could be coincidence. I don't want to send you on a wrong path, I will perform and document several tests on each case today and I will get back to you with a definitive answer supported by documented test case. - William ___ Bcm43xx-dev mailing list Bcm43xx-dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/bcm43xx-dev
Re: [PATCH RFC] ssb: Generic SPROM override for devices without SPROM
On 11/20/2009 05:12 AM, Michael Buesch wrote: This patch adds a generic mechanism for overriding the SPROM mechanism on devices without SPROM hardware. There currently is a major problem with this: It tries to deduce a MAC address from various hardware parameters. But currently it will result in the same MAC address for machines of the same type. Does somebody have an idea of some device-instance specific serial number or something similar that could be hashed into the MAC? You might look at the root= part of /proc/cmdline. Mine says root=/dev/disk/by-id/ata-TOSHIBA_MK2546GSX_18C2P0KCT-part1. That disk serial number would certainly be unique. Even if it just said root=/dev/sda1, it would be repeatable. Larry ___ Bcm43xx-dev mailing list Bcm43xx-dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/bcm43xx-dev
Re: [PATCH RFC] ssb: Generic SPROM override for devices without SPROM
Hi On Friday 20 November 2009, Larry Finger wrote: On 11/20/2009 05:12 AM, Michael Buesch wrote: [...] You might look at the root= part of /proc/cmdline. Mine says root=/dev/disk/by-id/ata-TOSHIBA_MK2546GSX_18C2P0KCT-part1. That disk serial number would certainly be unique. Even if it just said root=/dev/sda1, it would be repeatable. [...] by-id has the disadvantage that it changes with the means of accessing the disk, namely if your driver uses the old (obsolete) ide API or is a new libata driver. Technically only by-uuid is relatively guaranteed to be stable (unless a partition gets cloned with dd), with by-label coming close (only bad if any disk or USB storage device duplicates an existing label, like root). Regards Stefan Lippers-Hollmann ___ Bcm43xx-dev mailing list Bcm43xx-dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/bcm43xx-dev
Re: [PATCH RFC] ssb: Generic SPROM override for devices without SPROM
You might look at the root= part of /proc/cmdline. Mine says root=/dev/disk/by-id/ata-TOSHIBA_MK2546GSX_18C2P0KCT-part1. That disk serial number would certainly be unique. Even if it just said root=/dev/sda1, it would be repeatable. Ok, I think this is getting ugly :) The problem with all this is that if you change the harddisk, or change the partitioning, the wireless mac address would change. That would surely lead to confusion. I think we probably have to drop this patch and instead do a mechanism that fetches the sprom from userspace, if the card doesn't have one. This way we can have a script in userspace that generates the image based on the PCI ID information and just randomizes the MAC address once. The firmware loading mechanism would be useful for that. In case of an embedded device with the MAC in the nvram, the kernel can still override the mac address provided by userspace. At least on my Acer One D250 dmidecode provides a mainboard UUID. Sebastian ___ Bcm43xx-dev mailing list Bcm43xx-dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/bcm43xx-dev
Re: [PATCH RFC] ssb: Generic SPROM override for devices without SPROM
On 11/20/2009 08:11 AM, Michael Buesch wrote: Ok, I think this is getting ugly :) The problem with all this is that if you change the harddisk, or change the partitioning, the wireless mac address would change. That would surely lead to confusion. I think we probably have to drop this patch and instead do a mechanism that fetches the sprom from userspace, if the card doesn't have one. This way we can have a script in userspace that generates the image based on the PCI ID information and just randomizes the MAC address once. The firmware loading mechanism would be useful for that. In case of an embedded device with the MAC in the nvram, the kernel can still override the mac address provided by userspace. Perhaps we could have fwcutter generate pseudo-SPROM contents for the necessary revisions and write them to /lib/firmware/b43 with randomized MAC. In fact, one might only want to randomize the serial number part. That way ethereal would get the vendor right. Larry ___ Bcm43xx-dev mailing list Bcm43xx-dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/bcm43xx-dev
Re: [PATCH RFC] ssb: Generic SPROM override for devices without SPROM
On 11/20/2009 08:50 AM, Ehud Gavron wrote: How does WL do it? Broadcom *has* to generate a MAC address that is both unique and in its assigned range. If we can do the same thing in B43 that would be ideal. They are memory mapping a file in /etc/wlan. How this file is generated is not known. I looked at the Acer One D250 driver for Windows, but got no clue there. Larry ___ Bcm43xx-dev mailing list Bcm43xx-dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/bcm43xx-dev
Re: [PATCH RFC] ssb: Generic SPROM override for devices without SPROM
Larry Finger wrote: On 11/20/2009 05:12 AM, Michael Buesch wrote: This patch adds a generic mechanism for overriding the SPROM mechanism on devices without SPROM hardware. There currently is a major problem with this: It tries to deduce a MAC address from various hardware parameters. But currently it will result in the same MAC address for machines of the same type. Does somebody have an idea of some device-instance specific serial number or something similar that could be hashed into the MAC? You might look at the root= part of /proc/cmdline. Mine says root=/dev/disk/by-id/ata-TOSHIBA_MK2546GSX_18C2P0KCT-part1. That disk serial number would certainly be unique. Even if it just said root=/dev/sda1, it would be repeatable. Larry How does WL do it? Broadcom *has* to generate a MAC address that is both unique and in its assigned range. If we can do the same thing in B43 that would be ideal. E ___ Bcm43xx-dev mailing list Bcm43xx-dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/bcm43xx-dev ___ Bcm43xx-dev mailing list Bcm43xx-dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/bcm43xx-dev
Re: [PATCH RFC] ssb: Generic SPROM override for devices without SPROM
On 11/20/2009 04:36 PM, Bartłomiej Ochman wrote: Oncaphillis wrote: At least on my Acer One D250 dmidecode provides a mainboard UUID. Who's the vendor of ethernet chip in this acer? Broadcom too? lspci tells me its broadcom See the lspci under http://oncaphillis.net/lspci-aspire-d250.txt and the dmidecode output under http://oncaphillis.net/dmidecode-aspire-d250.txt Sebastian ___ Bcm43xx-dev mailing list Bcm43xx-dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/bcm43xx-dev
unsubscribe
unsubscribe me please From: Michael Buesch m...@bu3sch.de To: Larry Finger larry.fin...@lwfinger.net Cc: linux-wirel...@vger.kernel.org; bcm43xx-dev@lists.berlios.de Sent: Thu, November 19, 2009 3:13:33 PM Subject: Re: [PATCH] ssb: Unconditionally log results of core scans On Thursday 19 November 2009 20:43:54 Larry Finger wrote: At present, the results of an SSB core scan are only logged when CONFIG_SSB_DEBUG is y. As this may not be set in a distro kernel, it is difficult interpret many problems posted in bug reports or in help forums. Signed-off-by: Larry Finger larry.fin...@lwfinger.net --- Index: wireless-testing/drivers/ssb/scan.c === --- wireless-testing.orig/drivers/ssb/scan.c +++ wireless-testing/drivers/ssb/scan.c @@ -354,7 +354,7 @@ int ssb_bus_scan(struct ssb_bus *bus, dev-bus = bus; dev-ops = bus-ops; - ssb_dprintk(KERN_INFO PFX + printk(KERN_INFO PFX Core %d found: %s (cc 0x%03X, rev 0x%02X, vendor 0x%04X)\n, i, ssb_core_name(dev-id.coreid), Please use KERN_DEBUG -- Greetings, Michael. ___ Bcm43xx-dev mailing list Bcm43xx-dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/bcm43xx-dev ___ Bcm43xx-dev mailing list Bcm43xx-dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/bcm43xx-dev
Re: Fatal DMA error problem with netbook and BCM4312
On Fri, 20 Nov 2009 06:43:05 -0600 Larry Finger larry.fin...@lwfinger.net wrote: One last check. I would appreciate receiving answers to the following questions. These questions apply to anyone else with this problem. Does the pm_qos patch help your fatal DMA error problem, particularly when booted from power-off? If you warm-boot after loading the wl driver, does the patch make any difference? What's the date/time of the last patch you posted for this and what kernel does it apply to? Chris ___ Bcm43xx-dev mailing list Bcm43xx-dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/bcm43xx-dev
Re: b43 kills my kernel
On 20/11/09 10:54, Michael Buesch wrote: Can somebody give me a genuine SPROM image for an LP-PHY card, please? Just do this: sudo cat $(find /sys/devices -name ssb_sprom) ssb_sprom_copy Does this help? Andy ssb_sprom_copy Description: Binary data ___ Bcm43xx-dev mailing list Bcm43xx-dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/bcm43xx-dev