lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <479c2aaa-c67e-4a98-4ed1-57c44e9484c5@pengutronix.de>
Date:   Tue, 17 Aug 2021 15:19:43 +0200
From:   Ahmad Fatoum <a.fatoum@...gutronix.de>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     "brcm80211-dev-list.pdl@...adcom.com" 
        <brcm80211-dev-list.pdl@...adcom.com>,
        Arend van Spriel <aspriel@...il.com>,
        Chung-hsien Hsu <chung-hsien.hsu@...ineon.com>,
        Chi-hsien Lin <chi-hsien.lin@...ineon.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>,
        Hante Meuleman <hante.meuleman@...adcom.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Wright Feng <wright.feng@...ineon.com>,
        "SHA-cyfmac-dev-list@...ineon.com" <SHA-cyfmac-dev-list@...ineon.com>,
        "kernel@...gutronix.de" <kernel@...gutronix.de>,
        Jakub Kicinski <kuba@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Kalle Valo <kvalo@...eaurora.org>,
        Franky Lin <franky.lin@...adcom.com>
Subject: Re: [PATCH] brcmfmac: pcie: fix oops on failure to resume and reprobe

On 17.08.21 15:06, Andy Shevchenko wrote:
> On Tue, Aug 17, 2021 at 3:07 PM Ahmad Fatoum <a.fatoum@...gutronix.de> wrote:
>> On 17.08.21 14:03, Ahmad Fatoum wrote:
>>> On 17.08.21 13:54, Andy Shevchenko wrote:
>>>> On Tue, Aug 17, 2021 at 2:11 PM Ahmad Fatoum <a.fatoum@...gutronix.de> wrote:
>>>>> On 17.08.21 13:02, Andy Shevchenko wrote:
>>>>>> On Tuesday, August 17, 2021, Ahmad Fatoum <a.fatoum@...gutronix.de> wrote:
> 
> ...
> 
>>>>>>>         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.
>>>>
>>>> So, then the problem is in macro here. You need another portion of
>>>> macro(s) that will use the dev pointer directly. When you have a valid
>>>> device, use it. And here it seems the case.
>>>
>>> Ah, you mean using pdev instead of the stale bus. Ye, I could do that.
>>> Thanks for pointing out.
>>
>> Ah, not so easy: __brcmf_err accepts a struct brcmf_bus * as first argument,
>> but there is none I can pass along. As the whole file uses the brcm_
>> logging functions, I'd just leave this one without a device.
> 
> And what exactly prevents you to split that to something like
> 
> __brcm_dev_err() // as current __brcm_err with dev argument
> {
> ...
> }
> 
> __brsm_err(bus, ...)  __brcm_dev_err(bus->dev, ...)
> 
> ?

I like my regression fixes to be short and to the point.

Cheers,
Ahmad


-- 
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 |

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ