[OpenWrt-Devel] [PATCH] ar71xx: WNR612v2: fix kernel panic due to wrong Wifi LED init

Hartmut Knaack knaack.h at gmx.de
Mon Aug 27 16:22:20 EDT 2018


Mathias Kresin would have been the one to CC, as he contributed that code.
I just added him now.


Michal Cieslakiewicz schrieb am 27.08.2018 um 20:24:
> Netgear WNR612v2 flashed with recent OpenWrt builds suffers from kernel panic
> at boot during wireless chip initialization, making device unusable 
> (system enters 'panic-reboot' loop). TFTP recovery procedure is required
> to load working image. 
> 
> LEDE-17.01 branch is working OK.
> All later builds (OpenWrt-18.06, current) are affected (including stable 
> official 18.06.1 image from downloads.openwrt.org).
> 
> Example log entry:
> 
>  ath: phy0: Ignoring endianness difference in EEPROM magic bytes.
>  ath: phy0: Enable LNA combining
>  CPU 0 Unable to handle kernel paging request at virtual address 1000fee1, epc == 801d08f0, ra == 801d0d90
>  Oops[#1]:
>  CPU: 0 PID: 469 Comm: kmodloader Not tainted 4.9.120 #0
>  [ ... register dump etc ... ]
>  Kernel panic - not syncing: Fatal exception
>  Rebooting in 1 seconds..
> 
> This simple patch fixes above error. It keeps LED table in memory after kernel
> init phase for ath9k driver to operate correctly (__initdata removed).
> Also, another bug is fixed - correct array size is provided to function that
> adds platform LEDs (this device has only 1 connected to Wifi chip) preventing 
> code from going outside array bounds.
> Patch tested succesfully (router boots OK) for both 18.06 and current trees.
> 
> Please accept and include this patch for both current and 18.06 trees (applies
> to both branches identically) as without it WNR612v2 support is utterly broken.
> 
> ===============================================================================
> Notice to all WNR612v2 owners: please do not flash WNR612v2 with anything newer
> than LEDE 17.01.x until bug mentioned here gets fixed.
> ===============================================================================
> 
> Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz at wp.pl>
> ---
>  target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2000-v3.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2000-v3.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2000-v3.c
> index 6c18dc6d90..76c9cb99c9 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2000-v3.c
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2000-v3.c
> @@ -197,7 +197,7 @@ static struct gpio_led wnr612v2_leds_gpio[] __initdata = {
>  	}
>  };
>  
> -static struct gpio_led wnr612v2_wmac_leds_gpio[] __initdata = {
> +static struct gpio_led wnr612v2_wmac_leds_gpio[] = {
>  	{
>  		.name		= "netgear:green:wlan",
>  		.gpio		= WNR612V2_GPIO_WMAC_LED_WLAN_GREEN,
> @@ -561,7 +561,7 @@ static void __init wnr612v2_setup(void)
>  				 wnr612v2_leds_gpio);
>  
>  	ap9x_pci_setup_wmac_leds(0, wnr612v2_wmac_leds_gpio,
> -				 ARRAY_SIZE(wnr612v2_leds_gpio));
> +				 ARRAY_SIZE(wnr612v2_wmac_leds_gpio));
>  
>  	ap9x_pci_setup_wmac_btns(0, wnr612v2_wmac_keys_gpio,
>  				 ARRAY_SIZE(wnr612v2_wmac_keys_gpio),
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0x03684A18FAC89148.asc
Type: application/pgp-keys
Size: 3086 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20180827/c095223d/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20180827/c095223d/attachment.sig>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list