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=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,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 F2F1FC43603 for ; Thu, 12 Dec 2019 12:15:50 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id C02A721655 for ; Thu, 12 Dec 2019 12:15:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="EuVRPqjI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C02A721655 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject: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=Bk/RzIVU3PnBYLxMasUs52MCj/6XD7eFJHAg2nyJFkA=; b=EuVRPqjIdyM67y Ie/5x6/Fzv1a/uQqwNUcqVQIOunb/F3UNVOGEtLpiG9xImE29+3x0RntlryDVoSprj/lU9lHdjEgG Eg0rR27nAuNvV4hwHk8PAZkVQg+Uk2NuihOcCNQJ3ALFLoaQIi78Z4gCm7NwoEueQZj7qLnZAS+7G qr/MGhNMbm9Gs7E6z6JGM3w4ifst9XrkV1OVuPI8G5ocvFcAuw/abBRtYaZrDQS/KO3xNaNG0Eu4J cYy+isGMPkGTEDUnp7dgQRHQvpPwMh7l42DikR7UKzBnUkeFHBmdtcPIp+eZc7Cvc8QXY3JPG4EwB AY9/f/KXg2zdaGRANdMA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifNNd-0005Ps-Cs; Thu, 12 Dec 2019 12:15:41 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifNNZ-0005Oi-Pc for linux-arm-kernel@lists.infradead.org; Thu, 12 Dec 2019 12:15:39 +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 B26B11FB; Thu, 12 Dec 2019 04:15:36 -0800 (PST) Received: from bogus (e107155-lin.cambridge.arm.com [10.1.196.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0B74C3F718; Thu, 12 Dec 2019 04:15:35 -0800 (PST) Date: Thu, 12 Dec 2019 12:15:31 +0000 From: Sudeep Holla To: Cristian Marussi Subject: Re: [PATCH 08/15] firmware: arm_scmi: Add and initialise protocol version to scmi_device structure Message-ID: <20191212121531.GA27215@bogus> References: <20191210145345.11616-1-sudeep.holla@arm.com> <20191210145345.11616-9-sudeep.holla@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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-20191212_041537_885132_4D1A106E X-CRM114-Status: GOOD ( 22.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sudeep Holla Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Dec 11, 2019 at 06:06:50PM +0000, Cristian Marussi wrote: > On 10/12/2019 14:53, Sudeep Holla wrote: > > It's useful to keep track of scmi protocol version in the scmi device > > structure along with the protocol id. These can be used to expose the > > information to the userspace via bus dev_groups attributes as well. > > > > Signed-off-by: Sudeep Holla > > --- > > drivers/firmware/arm_scmi/clock.c | 6 +++++- > > drivers/firmware/arm_scmi/perf.c | 6 +++++- > > drivers/firmware/arm_scmi/power.c | 6 +++++- > > drivers/firmware/arm_scmi/reset.c | 6 +++++- > > drivers/firmware/arm_scmi/sensors.c | 6 +++++- > > include/linux/scmi_protocol.h | 1 + > > 6 files changed, 26 insertions(+), 5 deletions(-) > > > > diff --git a/drivers/firmware/arm_scmi/clock.c b/drivers/firmware/arm_scmi/clock.c > > index b567ec03f711..b68736ae7f88 100644 > > --- a/drivers/firmware/arm_scmi/clock.c > > +++ b/drivers/firmware/arm_scmi/clock.c > > @@ -318,8 +318,11 @@ static int scmi_clock_protocol_init(struct scmi_device *dev) > > struct clock_info *cinfo; > > struct scmi_handle *handle = dev->handle; > > > > - if (handle->clk_ops && handle->clk_priv) > > + if (handle->clk_ops && handle->clk_priv) { > > + cinfo = handle->clk_priv; > > + dev->version = cinfo->version; > > return 0; /* initialised already for the first device */ > > + } > > > > This is the device specific init stuff which I would remove from this proto > initialization, which is the reason for this proto_init to be invoked for > all devices defined for such proto. > Agreed, this is something I could come up with quickly, I have to think about this more for sure. > I'd say to move dev->version initialization into the specific > scmi_drv->probe which is called after scmi_protocol_init inside > bus:scmi_dev_probe, after having disabled the proto_init after the first > invocation, once the protocol is initialized, BUT this would result anyway > in duplication since you'll have to fill dev->version from the custom > protocol info in each of the related scmi drivers, and that would also mean > delegating to a possible user scmi driver .probe an initialization which is > then needed by the sysfs attribute exposed by the SCMI framework code. > I am trying to avoid that as it's just version and we should be able to manage this in the scmi_bus layer. I agree what we have in these patches are not so pretty. Anyways, thanks a lot for all the review. -- Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel