mbox series

[v4,0/9] misc brcmfmac fixes (M1/T2 series spin-off)

Message ID 20220131160713.245637-1-marcan@marcan.st
Headers show
Series misc brcmfmac fixes (M1/T2 series spin-off) | expand

Message

Hector Martin Jan. 31, 2022, 4:07 p.m. UTC
Hi everyone,

This series contains just the fixes / misc improvements from the
previously submitted series:

brcmfmac: Support Apple T2 and M1 platforms

Patches 8-9 aren't strictly bugfixes but rather just general
improvements; they can be safely skipped, although patch 8 will be a
dependency of the subsequent series to avoid a compile warning.

Changes since v3:
 - Sprinkled Cc: stable tags on all the commits that fix real bugs
 - Added review tags
 - Removed error message on alloc failure path in #7

Hector Martin (9):
  brcmfmac: pcie: Release firmwares in the brcmf_pcie_setup error path
  brcmfmac: firmware: Allocate space for default boardrev in nvram
  brcmfmac: firmware: Do not crash on a NULL board_type
  brcmfmac: pcie: Declare missing firmware files in pcie.c
  brcmfmac: pcie: Replace brcmf_pcie_copy_mem_todev with memcpy_toio
  brcmfmac: pcie: Fix crashes due to early IRQs
  brcmfmac: of: Use devm_kstrdup for board_type & check for errors
  brcmfmac: fwil: Constify iovar name arguments
  brcmfmac: pcie: Read the console on init and shutdown

 .../broadcom/brcm80211/brcmfmac/firmware.c    |  5 ++
 .../broadcom/brcm80211/brcmfmac/fwil.c        | 34 ++++----
 .../broadcom/brcm80211/brcmfmac/fwil.h        | 28 +++----
 .../wireless/broadcom/brcm80211/brcmfmac/of.c |  7 +-
 .../broadcom/brcm80211/brcmfmac/pcie.c        | 77 ++++++++-----------
 .../broadcom/brcm80211/brcmfmac/sdio.c        |  1 -
 6 files changed, 71 insertions(+), 81 deletions(-)

Comments

Andy Shevchenko Jan. 31, 2022, 4:28 p.m. UTC | #1
On Mon, Jan 31, 2022 at 6:07 PM Hector Martin <marcan@marcan.st> wrote:
>
> This unbreaks support for USB devices, which do not have a board_type
> to create an alt_path out of and thus were running into a NULL
> dereference.

...

> @@ -599,6 +599,9 @@ static char *brcm_alt_fw_path(const char *path, const char *board_type)
>         char alt_path[BRCMF_FW_NAME_LEN];
>         char suffix[5];
>
> +       if (!board_type)
> +               return NULL;

I still think it's better to have both callers do the same thing.

Now it will be the double check in one case,
Kalle Valo Jan. 31, 2022, 4:49 p.m. UTC | #2
Andy Shevchenko <andy.shevchenko@gmail.com> writes:

> On Mon, Jan 31, 2022 at 6:07 PM Hector Martin <marcan@marcan.st> wrote:
>>
>> This unbreaks support for USB devices, which do not have a board_type
>> to create an alt_path out of and thus were running into a NULL
>> dereference.
>
> ...
>
>> @@ -599,6 +599,9 @@ static char *brcm_alt_fw_path(const char *path,
>> const char *board_type)
>>         char alt_path[BRCMF_FW_NAME_LEN];
>>         char suffix[5];
>>
>> +       if (!board_type)
>> +               return NULL;
>
> I still think it's better to have both callers do the same thing.
>
> Now it will be the double check in one case,

I already applied a similar patch:

https://git.kernel.org/wireless/wireless/c/665408f4c3a5
Hector Martin Jan. 31, 2022, 4:53 p.m. UTC | #3
On 01/02/2022 01.49, Kalle Valo wrote:
> Andy Shevchenko <andy.shevchenko@gmail.com> writes:
> 
>> On Mon, Jan 31, 2022 at 6:07 PM Hector Martin <marcan@marcan.st> wrote:
>>>
>>> This unbreaks support for USB devices, which do not have a board_type
>>> to create an alt_path out of and thus were running into a NULL
>>> dereference.
>>
>> ...
>>
>>> @@ -599,6 +599,9 @@ static char *brcm_alt_fw_path(const char *path,
>>> const char *board_type)
>>>         char alt_path[BRCMF_FW_NAME_LEN];
>>>         char suffix[5];
>>>
>>> +       if (!board_type)
>>> +               return NULL;
>>
>> I still think it's better to have both callers do the same thing.
>>
>> Now it will be the double check in one case,
> 
> I already applied a similar patch:
> 
> https://git.kernel.org/wireless/wireless/c/665408f4c3a5
> 

Feel free to drop this one from the series then, if everything else
looks good.
Andy Shevchenko Jan. 31, 2022, 5:49 p.m. UTC | #4
On Mon, Jan 31, 2022 at 6:49 PM Kalle Valo <kvalo@kernel.org> wrote:
> Andy Shevchenko <andy.shevchenko@gmail.com> writes:
> > On Mon, Jan 31, 2022 at 6:07 PM Hector Martin <marcan@marcan.st> wrote:

...

> >> +       if (!board_type)
> >> +               return NULL;
> >
> > I still think it's better to have both callers do the same thing.
> >
> > Now it will be the double check in one case,
>
> I already applied a similar patch:
>
> https://git.kernel.org/wireless/wireless/c/665408f4c3a5

"Similar" means that it took into account the concern I expressed here :-)
I would have done slightly differently, but the main idea is the same.
Thank you!
Kalle Valo Feb. 1, 2022, 5:12 a.m. UTC | #5
Hector Martin <marcan@marcan.st> writes:

> On 01/02/2022 01.49, Kalle Valo wrote:
>> Andy Shevchenko <andy.shevchenko@gmail.com> writes:
>> 
>>> On Mon, Jan 31, 2022 at 6:07 PM Hector Martin <marcan@marcan.st> wrote:
>>>>
>>>> This unbreaks support for USB devices, which do not have a board_type
>>>> to create an alt_path out of and thus were running into a NULL
>>>> dereference.
>>>
>>> ...
>>>
>>>> @@ -599,6 +599,9 @@ static char *brcm_alt_fw_path(const char *path,
>>>> const char *board_type)
>>>>         char alt_path[BRCMF_FW_NAME_LEN];
>>>>         char suffix[5];
>>>>
>>>> +       if (!board_type)
>>>> +               return NULL;
>>>
>>> I still think it's better to have both callers do the same thing.
>>>
>>> Now it will be the double check in one case,
>> 
>> I already applied a similar patch:
>> 
>> https://git.kernel.org/wireless/wireless/c/665408f4c3a5
>> 
>
> Feel free to drop this one from the series then, if everything else
> looks good.

Yes, I'll drop this patch 3.