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=-15.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable 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 BDECDC433E0 for ; Mon, 8 Mar 2021 11:38:52 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3938A6024A for ; Mon, 8 Mar 2021 11:38:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3938A6024A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; 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=gctDbr28OYamKCydGwoGmgZGZaqKcaa2FudCaUhwqhU=; b=SjvCU5l12tYE+MCnrBEZ0fico PEPAPxD8T9qCspf4xlPDHd45DT+df91BmgqMS2tMvCUkv4q0i866l/YCawOY26f98jXgijykhLsVs VUdnGRr3Vj+1g/KLFH14g/1efLiKXEtCsH0vI8ONn9+eUcieufSjTKzDX0rtPJlBYHozCHkyJYb8D ChqeGKfXYBTiF+2qruChUfF2aXFtHt3vcrlYHDfyeMM4l5hl/2v3wu4TaAGOkK2eduzQq9SygmY5g FQLnWqRgUPtnGz27m3CZyaGrJOyp/jxU6a8SprZ4pLKku5gBrTryR/5XmvtppwKoTfiJ6Q1rB2gSW 8XtZ4sRag==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lJECP-00Gnvk-EU; Mon, 08 Mar 2021 11:37:25 +0000 Received: from foss.arm.com ([217.140.110.172]) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lJECH-00GnsY-F1 for linux-arm-kernel@lists.infradead.org; Mon, 08 Mar 2021 11:37:15 +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 04F34D6E; Mon, 8 Mar 2021 03:37:09 -0800 (PST) Received: from e120937-lin (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1F1703F73C; Mon, 8 Mar 2021 03:37:07 -0800 (PST) Date: Mon, 8 Mar 2021 11:37:04 +0000 From: Cristian Marussi To: Sudeep Holla Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, lukasz.luba@arm.com, james.quinlan@broadcom.com, Jonathan.Cameron@Huawei.com, f.fainelli@gmail.com, etienne.carriere@linaro.org, thara.gopinath@linaro.org, vincent.guittot@linaro.org, souvik.chakravarty@arm.com Subject: Re: [PATCH v6 02/37] firmware: arm_scmi: introduce protocol handle definitions Message-ID: <20210308113704.GD30179@e120937-lin> References: <20210202221555.41167-1-cristian.marussi@arm.com> <20210202221555.41167-3-cristian.marussi@arm.com> <20210308055030.ljgyybawujmaf2gg@bogus> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210308055030.ljgyybawujmaf2gg@bogus> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210308_113713_806849_50448FB3 X-CRM114-Status: GOOD ( 24.07 ) 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 Mon, Mar 08, 2021 at 05:50:30AM +0000, Sudeep Holla wrote: > On Tue, Feb 02, 2021 at 10:15:20PM +0000, Cristian Marussi wrote: > > Add basic protocol handles definitions and private data helpers support. > > > > A protocol handle identifies a protocol instance initialized against a > > specific handle; it embeds all the references to the core SCMI xfer methods > > that will be needed by a protocol implementation to build and send its own > > protocol specific messages using common core methods. > > > > As such, in the interface, a protocol handle will be passed down from the > > core to the protocol specific initialization callback at init time. > > > > Anyway at this point only definitions are introduced, all protocols > > initialization code and SCMI drivers probing is still based on the old > > interface, so no functional change. > > > > Signed-off-by: Cristian Marussi > > --- > > drivers/firmware/arm_scmi/common.h | 59 ++++++++++++++++++++++++++++++ > > drivers/firmware/arm_scmi/driver.c | 45 +++++++++++++++++++++++ > > 2 files changed, 104 insertions(+) > > > > [...] > > > diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c > > index ed94efbecd61..2328a468bbd1 100644 > > --- a/drivers/firmware/arm_scmi/driver.c > > +++ b/drivers/firmware/arm_scmi/driver.c > > [...] > > > /** > > * scmi_get_protocol_instance - Protocol initialization helper. > > * @handle: A reference to the SCMI platform instance. > > @@ -588,6 +629,10 @@ scmi_get_protocol_instance(struct scmi_handle *handle, u8 protocol_id) > > > > pi->gid = gid; > > pi->proto = proto; > > + pi->handle = handle; > > + pi->ph.dev = handle->dev; > > + pi->ph.set_priv = scmi_set_protocol_priv; > > + pi->ph.get_priv = scmi_get_protocol_priv; > > > Sorry missed this in earlier patch. Not a must, but I prefer if you can move > all these initialisation into separate functions so that scmi_get_protocol_instance > can be simplified to read. > > if (pi) > increment refcount > else > scmi_get_protocol > alloc and init protocol instance > register events > > How about some thing like above ? > Sure I'll do. > -- > Regards, > Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel