From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86AC1C4338F for ; Tue, 17 Aug 2021 13:20:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6602A60F39 for ; Tue, 17 Aug 2021 13:20:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237050AbhHQNUd (ORCPT ); Tue, 17 Aug 2021 09:20:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235267AbhHQNUb (ORCPT ); Tue, 17 Aug 2021 09:20:31 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D93CC061764 for ; Tue, 17 Aug 2021 06:19:58 -0700 (PDT) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[IPv6:::1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1mFz0P-0008JJ-6g; Tue, 17 Aug 2021 15:19:49 +0200 Subject: Re: [PATCH] brcmfmac: pcie: fix oops on failure to resume and reprobe To: Andy Shevchenko Cc: "brcm80211-dev-list.pdl@broadcom.com" , Arend van Spriel , Chung-hsien Hsu , Chi-hsien Lin , "netdev@vger.kernel.org" , "linux-wireless@vger.kernel.org" , Hante Meuleman , "linux-kernel@vger.kernel.org" , Wright Feng , "SHA-cyfmac-dev-list@infineon.com" , "kernel@pengutronix.de" , Jakub Kicinski , "David S. Miller" , Kalle Valo , Franky Lin References: <20210817063521.22450-1-a.fatoum@pengutronix.de> <3a9a3789-5a13-7e72-b909-8f0826b8ab86@pengutronix.de> <85e30fb4-ce7d-6402-f93e-09efadbbcd06@pengutronix.de> From: Ahmad Fatoum Message-ID: <479c2aaa-c67e-4a98-4ed1-57c44e9484c5@pengutronix.de> Date: Tue, 17 Aug 2021 15:19:43 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: a.fatoum@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17.08.21 15:06, Andy Shevchenko wrote: > On Tue, Aug 17, 2021 at 3:07 PM Ahmad Fatoum 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 wrote: >>>>> On 17.08.21 13:02, Andy Shevchenko wrote: >>>>>> On Tuesday, August 17, 2021, Ahmad Fatoum 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 |