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=ham 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 F4136C433DB for ; Mon, 8 Mar 2021 05:56:22 +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 C6C53651F1 for ; Mon, 8 Mar 2021 05:56:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C6C53651F1 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=84rAM9gHP6Ul4O7VacJjpvcvLWJeZ5Bkzif3Yg7N3MY=; b=LH6d9okIFa4SRnH9VRmSxmesu HeZXppvZEgEWWqj+HylqHwdjz4+cOCgzvNQxEPNEZ0UOacjcH67k3V2nkDVtn9ADk6EmvEOgghEpZ /DR4iqsCm+/FJ36jFNmEhP9VrNp0fxbHJUXbghpdhccxmrFvQYOinHqjzzFscgXE5SGVHNVZ9n49C iI+tB6i1sn9QFwhYl9cBQyGAQkZlFD1ij3ruCEjQVHuyPYYzDZNiQnfrEPjBLbqdVqodj3B/x4HRF AeZ7d44hGNcagiPnKCMzCjTB+EyUO/IBwhqJK22gGXlS8G3oHR6mboiaRP2lKLaa6FcANh0iQOReW 7eMrxuqqw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lJ8qa-00FNBS-6K; Mon, 08 Mar 2021 05:54:28 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lJ8nc-00FMAK-Po for linux-arm-kernel@desiato.infradead.org; Mon, 08 Mar 2021 05:51:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=4kl45VAz6Dz7eGvBslzd5Wa8yVSitwrUT3GV8ajvjk0=; b=LqH7jKJb/nMJK+sBaZOzXgHsrS iuHWSf6WLCkRJzCy3vAPBv7LELDd4w5PXNIj6S8km6+iU0Z+x2bGMmX+JruOvS5PH9avIPJhhQuUl D1xkuXXfGZDBg+s+pOXaoMtEViVfxygPaA5pKbj72brzogJdZBBjVAdpvrhg7/z6Et6ozx+torFcD RwJKhtU7m69YM8zu+zNacM4Pr1wuCrKDpJS9aFii80OsyVAlps6vXJ7Mpay/4e2eHaTZMNhvSGXcW ecutBXTOOZZOZLjCKr/5kBFbOmWc4f5mMxj+Vl+kWffmfKhecmYTGTsKgamBmbq2AZLuTb7M5lIup aI03NOtQ==; Received: from foss.arm.com ([217.140.110.172]) by casper.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lJ8n0-00F6GS-Ue for linux-arm-kernel@lists.infradead.org; Mon, 08 Mar 2021 05:51:07 +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 E430DED1; Sun, 7 Mar 2021 21:50:41 -0800 (PST) Received: from bogus (unknown [10.57.15.109]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 95B443F73C; Sun, 7 Mar 2021 21:50:38 -0800 (PST) Date: Mon, 8 Mar 2021 05:50:30 +0000 From: Sudeep Holla To: Cristian Marussi 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: <20210308055030.ljgyybawujmaf2gg@bogus> References: <20210202221555.41167-1-cristian.marussi@arm.com> <20210202221555.41167-3-cristian.marussi@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210202221555.41167-3-cristian.marussi@arm.com> User-Agent: NeoMutt/20171215 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210308_055052_913412_C50DB6EA X-CRM114-Status: GOOD ( 17.94 ) 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 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 ? -- Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel