2016-07-26 22:35:25

by Fabio Estevam

[permalink] [raw]
Subject: brcm4330 fails to load on newer kernels

Hi,

On a imx6sl-warp board with a brcm4330 I get the following results
depending on the kernel version:

- Kernel 4.4.15: place brcmfmac4330-sdio.bin and brcmfmac4330-sdio.txt
in the rootfs and the kernel is able to read them correctly. wlan0 is
present. All is fine.

- Kernel 4.5.7: place brcmfmac4330-sdio.bin brcmfmac4330-sdio.txt in
the rootfs and the kernel fails to load them:

brcmfmac mmc1:0001:1: Direct firmware load for
brcm/brcmfmac4330-sdio.bin failed with error -2

Then I build brcmfmac4330-sdio.bin brcmfmac4330-sdio.txt into the
kernel and then firmware is detected and wlan0 appears.

- Kernel 4.7: I can place the firmware and nvram file into the rootfs
or built-i and the following error is seen:

brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50
brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50
brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50

So wlan0 never appears here.

Does anyone have any suggestions about these different behaviours?

Thanks,

Fabio Estevam


2016-07-28 18:37:22

by Arend Van Spriel

[permalink] [raw]
Subject: Re: brcm4330 fails to load on newer kernels

On 27-07-16 22:57, Fabio Estevam wrote:
> Hi Arend,
>
> On Wed, Jul 27, 2016 at 5:51 PM, Arend van Spriel
> <[email protected]> wrote:
>> On 27-07-16 00:35, Fabio Estevam wrote:
>>> Hi,
>>>
>>> On a imx6sl-warp board with a brcm4330 I get the following results
>>> depending on the kernel version:
>>>
>>> - Kernel 4.4.15: place brcmfmac4330-sdio.bin and brcmfmac4330-sdio.txt
>>> in the rootfs and the kernel is able to read them correctly. wlan0 is
>>> present. All is fine.
>>>
>>> - Kernel 4.5.7: place brcmfmac4330-sdio.bin brcmfmac4330-sdio.txt in
>>> the rootfs and the kernel fails to load them:
>>>
>>> brcmfmac mmc1:0001:1: Direct firmware load for
>>> brcm/brcmfmac4330-sdio.bin failed with error -2
>>>
>>> Then I build brcmfmac4330-sdio.bin brcmfmac4330-sdio.txt into the
>>> kernel and then firmware is detected and wlan0 appears.
>>>
>>> - Kernel 4.7: I can place the firmware and nvram file into the rootfs
>>> or built-i and the following error is seen:
>>>
>>> brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50
>>> brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50
>>> brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50
>>>
>>> So wlan0 never appears here.
>>>
>>> Does anyone have any suggestions about these different behaviours?
>>
>> So for all kernel you have brcmfmac built-in the kernel or as a module?
>
> In all these tests I have brcmfmac built-in the kernel.

Hi Fabio,

So this is another fine example of firmware API not able to deliver. I
think in all these kernels you have the same issue. The problem is that
the order of events upon kernel boot is not predictable. In this case
you have rootfs being mounted and brcmfmac getting probed as the two
competing events. When rootfs is mounted before brcmfmac is being probed
it works, but if brcmfmac is probed before rootfs is mounted the
firmware request will fail. So the only reliable option for built-in
drivers requiring firmware is to built-in the firmware into the kernel
as well.

Regards,
Arend

2016-07-27 20:51:57

by Arend Van Spriel

[permalink] [raw]
Subject: Re: brcm4330 fails to load on newer kernels

On 27-07-16 00:35, Fabio Estevam wrote:
> Hi,
>
> On a imx6sl-warp board with a brcm4330 I get the following results
> depending on the kernel version:
>
> - Kernel 4.4.15: place brcmfmac4330-sdio.bin and brcmfmac4330-sdio.txt
> in the rootfs and the kernel is able to read them correctly. wlan0 is
> present. All is fine.
>
> - Kernel 4.5.7: place brcmfmac4330-sdio.bin brcmfmac4330-sdio.txt in
> the rootfs and the kernel fails to load them:
>
> brcmfmac mmc1:0001:1: Direct firmware load for
> brcm/brcmfmac4330-sdio.bin failed with error -2
>
> Then I build brcmfmac4330-sdio.bin brcmfmac4330-sdio.txt into the
> kernel and then firmware is detected and wlan0 appears.
>
> - Kernel 4.7: I can place the firmware and nvram file into the rootfs
> or built-i and the following error is seen:
>
> brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50
> brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50
> brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50
>
> So wlan0 never appears here.
>
> Does anyone have any suggestions about these different behaviours?

So for all kernel you have brcmfmac built-in the kernel or as a module?

Regards,
Arend

> Thanks,
>
> Fabio Estevam
>

2016-07-27 20:57:11

by Fabio Estevam

[permalink] [raw]
Subject: Re: brcm4330 fails to load on newer kernels

Hi Arend,

On Wed, Jul 27, 2016 at 5:51 PM, Arend van Spriel
<[email protected]> wrote:
> On 27-07-16 00:35, Fabio Estevam wrote:
>> Hi,
>>
>> On a imx6sl-warp board with a brcm4330 I get the following results
>> depending on the kernel version:
>>
>> - Kernel 4.4.15: place brcmfmac4330-sdio.bin and brcmfmac4330-sdio.txt
>> in the rootfs and the kernel is able to read them correctly. wlan0 is
>> present. All is fine.
>>
>> - Kernel 4.5.7: place brcmfmac4330-sdio.bin brcmfmac4330-sdio.txt in
>> the rootfs and the kernel fails to load them:
>>
>> brcmfmac mmc1:0001:1: Direct firmware load for
>> brcm/brcmfmac4330-sdio.bin failed with error -2
>>
>> Then I build brcmfmac4330-sdio.bin brcmfmac4330-sdio.txt into the
>> kernel and then firmware is detected and wlan0 appears.
>>
>> - Kernel 4.7: I can place the firmware and nvram file into the rootfs
>> or built-i and the following error is seen:
>>
>> brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50
>> brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50
>> brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50
>>
>> So wlan0 never appears here.
>>
>> Does anyone have any suggestions about these different behaviours?
>
> So for all kernel you have brcmfmac built-in the kernel or as a module?

In all these tests I have brcmfmac built-in the kernel.

Thanks,

Fabio Estevam

2016-07-29 01:05:27

by Fabio Estevam

[permalink] [raw]
Subject: Re: brcm4330 fails to load on newer kernels

Hi Arend,

On Thu, Jul 28, 2016 at 3:37 PM, Arend van Spriel
<[email protected]> wrote:

> Hi Fabio,
>
> So this is another fine example of firmware API not able to deliver. I
> think in all these kernels you have the same issue. The problem is that
> the order of events upon kernel boot is not predictable. In this case
> you have rootfs being mounted and brcmfmac getting probed as the two
> competing events. When rootfs is mounted before brcmfmac is being probed
> it works, but if brcmfmac is probed before rootfs is mounted the
> firmware request will fail. So the only reliable option for built-in
> drivers requiring firmware is to built-in the firmware into the kernel
> as well.

Thanks for your explanation.

Tried building brcmfmac as module and after doing 'modprobe brcmfmac'
the firmware is correctly loaded from the rootfs in all the kernels I
tested.

Now I just need it to load brcmfmac module automatically, but this is
a a separate issue I will investigate.

Thanks a lot for your help!

Fabio Estevam