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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3C701C43334 for ; Fri, 1 Jul 2022 15:22:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jO+1OwHmnNVT1hX1xCOPRJHAJ0cr2wXTqgTNAQKFfbs=; b=acJpBsldT3fGbr va3zlO6VdbGQrdOkI6t16Cx+9/H7O/V5W4UR79XYepmo0qQeT1lCOUSQHiDEg9SeJGOLuGdc0eKmQ SSbIwSJSIeBGBSkYJ+0JPEqJaMNwUPOPVBWi0XMj8zwuVot4ZjZHGwx7J+Q7lTI0do0wWMJURl1nE HvpMJW0l1axtKcPm83UwKuVQ7ggzXlQYY1fkSEvVd+pV8D2aLn73IRkSZ6ED3UKL6LC3wMHiuiPnf jZpFWqPPnOQaA396ffPUc+8r4GSorcXGLEzEcWPwotnZh5nzrJe6wM0a4L0tGuLYgIZr2laWfmx8j m4RM26PtOKSddmc5ouiw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o7ISP-005dQ7-BF; Fri, 01 Jul 2022 15:21:21 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o7ISL-005dOO-W1 for linux-arm-kernel@lists.infradead.org; Fri, 01 Jul 2022 15:21:19 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 503D3113E; Fri, 1 Jul 2022 08:21:15 -0700 (PDT) Received: from e120937-lin (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 463EC3F66F; Fri, 1 Jul 2022 08:21:13 -0700 (PDT) Date: Fri, 1 Jul 2022 16:21:11 +0100 From: Cristian Marussi To: Sudeep Holla Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, james.quinlan@broadcom.com, Jonathan.Cameron@huawei.com, f.fainelli@gmail.com, etienne.carriere@linaro.org, vincent.guittot@linaro.org, daniel.lezcano@linaro.org, tarek.el-sherbiny@arm.com, adrian.slatineanu@arm.com, souvik.chakravarty@arm.com, wleavitt@marvell.com, wbartczak@marvell.com Subject: Re: [PATCH v3 8/9] firmware: arm_scmi: Add scmi_driver optional setup/teardown callbacks Message-ID: References: <20220627123038.1427067-1-cristian.marussi@arm.com> <20220627123038.1427067-9-cristian.marussi@arm.com> <20220701140946.uar5ohadyjksf2ka@bogus> <20220701151829.j2blytsgma5so6ox@bogus> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220701151829.j2blytsgma5so6ox@bogus> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220701_082118_122431_9A7CC152 X-CRM114-Status: GOOD ( 30.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jul 01, 2022 at 04:18:29PM +0100, Sudeep Holla wrote: > On Fri, Jul 01, 2022 at 04:09:05PM +0100, Cristian Marussi wrote: > > On Fri, Jul 01, 2022 at 03:09:46PM +0100, Sudeep Holla wrote: > > > On Mon, Jun 27, 2022 at 01:30:37PM +0100, Cristian Marussi wrote: > > > > Add optional .setup and .teardown methods to the scmi_driver descriptor: > > > > such callbacks, if provided, will be called by the SCIM core at driver > > > > registration time, so that, an SCMI driver, registered as usual with the > > > > module_scmi_driver() helper macro, can provide custom callbacks to be > > > > run once for all at module load/unload time to perform specific setup > > > > or teardown operations before/after .probe and .remove steps. > > > > > > > > > > What can't the driver call this setup/teardown on its own before/after > > > calling scmi_driver_register/unregister ? > > > > > > > > Based on the usage in 9/9, I guess it is mainly to use the > > > module_scmi_driver ? If so, I would avoid using that or have another > > > macro to manage this setup/teardown(once there are multiple users for that). > > > IMO, it doesn't make sense to add callbacks to do things that are outside > > > the scope of scmi drivers. No ? > > > > > > > This is exactly what I was doing in fact :D at first ... defining a normal > > init/exit from where I called what I needed at first and then ivoke the > > scmi_driver_register()...so bypassing/not using the module_scmi-driver macro > > indeed...then I realized I needed something similar also for the SCMI Test > > driver, so I tried to unify; in both cases indeed the required ops to be > > done before the scmi_driver_register are NOT scmi related things. > > > > So I can drop this if you prefer and use bare module_init/exit that > > calls scmi_driver_register() after having setup what needed for the > > specific driver initialization (before probe)...I was not really > > convinced it was worth this level of unification. > > > > We can add macro for that too if there is another user for this. i.e. > if and when we merge the test code using something similar, we can > wrap them in a macro module_scmi_driver_setup_teardown(driver, setup, teardown) > and simplify things for the users. > Ok, thanks I'll drop this for this series. Thanks, Cristian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel