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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D548FC433F5 for ; Mon, 6 Dec 2021 08:29:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239220AbhLFIco (ORCPT ); Mon, 6 Dec 2021 03:32:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239064AbhLFIco (ORCPT ); Mon, 6 Dec 2021 03:32:44 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABD1DC061746; Mon, 6 Dec 2021 00:29:15 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CA35D611D2; Mon, 6 Dec 2021 08:29:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3914BC341C7; Mon, 6 Dec 2021 08:29:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638779354; bh=dnJx9G/Cc3hqlcmsNivMKN+DHTvDe/PrQ54pAwm7O3k=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=NyXfOQ3CVyzi2KCEaUw4SFz9mB8RHQh6hoVVGMpxiA2CHcoOfLLpenWbU4ZWxJ5HQ 3WZEp3nEzwrXblKoIVMLCR1RAV4rh3mpnBHNrFB2LlhxHC7+QOBFkEWef7ji199XqI f+x0RPi4uUsk9sNH6D9LqBdW+sjWbZslBc7xrbz/cZAftiF+aoJxxnx6QIOuQSjncM ouQ2qKMc3njxUZwKsbeSENBj2deaFOPmU+joCx5JR+Rl8SxsEMxUwboNYxbd6Dduic Ub/Kk91btY6NxbHkf83G13IxnNUZz7+0eEJHbvNJVT5nw1t860sG1/uHcfHFjajnbh AEdM3WixV16Sg== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mu9N1-00A7kG-UF; Mon, 06 Dec 2021 08:29:12 +0000 Date: Mon, 06 Dec 2021 08:29:11 +0000 Message-ID: <87y24ykug8.wl-maz@kernel.org> From: Marc Zyngier To: Shawn Guo Cc: Florian Fainelli , Thomas Gleixner , Maulik Shah , Bjorn Andersson , Loic Poulain , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Claudiu Beznea , Neil Armstrong Subject: Re: [PATCH v3 1/3] irqchip: Pass platform_device pointer to init_cb In-Reply-To: <20211206064004.GL10105@dragon> References: <20211202122122.23548-1-shawn.guo@linaro.org> <20211202122122.23548-2-shawn.guo@linaro.org> <20211206064004.GL10105@dragon> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: shawn.guo@linaro.org, f.fainelli@gmail.com, tglx@linutronix.de, quic_mkshah@quicinc.com, bjorn.andersson@linaro.org, loic.poulain@linaro.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, claudiu.beznea@microchip.com, narmstrong@baylibre.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 06 Dec 2021 06:40:05 +0000, Shawn Guo wrote: > > On Thu, Dec 02, 2021 at 07:10:04PM +0000, Marc Zyngier wrote: > > On 2021-12-02 17:52, Florian Fainelli wrote: > > > On 12/2/21 4:21 AM, Shawn Guo wrote: > > > > It makes sense to just pass device_node for callback in > > > > IRQCHIP_DECLARE > > > > case, but not so much for IRQCHIP_PLATFORM_DRIVER one, because > > > > platform_driver probe/init usually needs device pointer for various > > > > purposes, e.g. resource allocation, service request, device prefixed > > > > message output, etc. Create a new callback type irqchip_init_cb_t > > > > which > > > > takes platform_device pointer as parameter, and update the existing > > > > IRQCHIP_PLATFORM_DRIVER users accordingly. > > > > > > > > Cc: Florian Fainelli > > > > Cc: Claudiu Beznea > > > > Cc: Neil Armstrong > > > > Signed-off-by: Shawn Guo > > > > > > Could you copy all recipients on all 3 patches plus your cover letter > > > next time so we have the full context? Thanks! > > > > > > [snip] > > > > > > > > > > > -static int __init bcm7120_l2_intc_probe_7120(struct device_node *dn, > > > > +static int __init bcm7120_l2_intc_probe_7120(struct platform_device > > > > *pdev, > > > > struct device_node *parent) > > > > { > > > > - return bcm7120_l2_intc_probe(dn, parent, bcm7120_l2_intc_iomap_7120, > > > > + return bcm7120_l2_intc_probe(pdev->dev.of_node, parent, > > > > + bcm7120_l2_intc_iomap_7120, > > > > "BCM7120 L2"); > > > > > > If you look further into that driver, you will see that we do something > > > like this in bcm7120_l2_intc_probe: > > > > > > pdev = of_find_device_by_node(dn); > > > if (!pdev) { > > > ret = -ENODEV; > > > goto out_free_data; > > > } > > > > > > which would be completely superfluous now that we pass a platform_device > > > directly. Can you rework your patch so as to eliminate that > > > of_find_device_by_ndoe() (and the companion put_device call)? > > > > Or just adopt the same construct in the MPM driver. At this stage, drivers > > requiring a platform_device are the minority. > > Marc, > > I need to ensure I understand you comment. Are you suggesting that I > keep IRQCHIP_MATCH() unchanged, and go back to the MPM driver > construction I used in v2? No. I suggest that you leave the irqchip API as is (i.e. drop this patch) and use of_find_device_by_node() in the MPM driver, just like the Broadcom driver does. This should be enough for your use case. M. -- Without deviation from the norm, progress is not possible.