Search Linux Wireless

Re: [PATCH] brcmfmac: pcie: fix oops on failure to resume and reprobe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 17.08.21 13:02, Andy Shevchenko wrote:
> On Tuesday, August 17, 2021, Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx> wrote:
> 
>> When resuming from suspend, brcmf_pcie_pm_leave_D3 will first attempt a
>> hot resume and then fall back to removing the PCI device and then
>> reprobing. If this probe fails, the kernel will oops, because brcmf_err,
>> which is called to report the failure will dereference the stale bus
>> pointer. Open code and use the default bus-less brcmf_err to avoid this.
>>
>> Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
>> ---
>> To: Arend van Spriel <aspriel@xxxxxxxxx>
>> To: Franky Lin <franky.lin@xxxxxxxxxxxx>
>> To: Hante Meuleman <hante.meuleman@xxxxxxxxxxxx>
>> To: Chi-hsien Lin <chi-hsien.lin@xxxxxxxxxxxx>
>> To: Wright Feng <wright.feng@xxxxxxxxxxxx>
>> To: Chung-hsien Hsu <chung-hsien.hsu@xxxxxxxxxxxx>
>> Cc: SHA-cyfmac-dev-list@xxxxxxxxxxxx
>> Cc: brcm80211-dev-list.pdl@xxxxxxxxxxxx
>> Cc: netdev@xxxxxxxxxxxxxxx
>> Cc: linux-wireless@xxxxxxxxxxxxxxx
>> Cc: Kalle Valo <kvalo@xxxxxxxxxxxxxx>
>> Cc: Jakub Kicinski <kuba@xxxxxxxxxx>
>> Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>
>> Cc: linux-kernel@xxxxxxxxxxxxxxx
>> ---
>>  drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
>> b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
>> index 9ef94d7a7ca7..d824bea4b79d 100644
>> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
>> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
>> @@ -2209,7 +2209,7 @@ static int brcmf_pcie_pm_leave_D3(struct device *dev)
>>
>>         err = brcmf_pcie_probe(pdev, NULL);
>>         if (err)
>> -               brcmf_err(bus, "probe after resume failed, err=%d\n", err);
>> +               __brcmf_err(NULL, __func__, "probe after resume failed,
>> err=%d\n",
> 
> 
> This is weird looking line now. Why can’t you simply use dev_err() /
> netdev_err()?

That's what brcmf_err normally expands to, but in this file the macro
is overridden to add the extra first argument.

The brcmf_ logging function write to brcmf trace buffers. This is not
done with netdev_err/dev_err (and replacing the existing logging
is out of scope for a regression fix anyway).

Cheers,
Ahmad

> 
> 
>>
>>         return err;
>>  }
>> --
>> 2.30.2
>>
>>
> 


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux