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=-5.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 6C368C433FF for ; Mon, 29 Jul 2019 10:34:36 +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 3E1E5206E0 for ; Mon, 29 Jul 2019 10:34:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="A0ljHx/L" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E1E5206E0 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=Xn7Zz1o2/FbiWeTOn2OJRvo82l7jxOZu5W0LVYusRdM=; b=A0ljHx/LBOiR7j odKIOweZQF3K7trCjmYoeOg8KKZe5bCCKwc//pTMMhcRUXao8pWbs9VPFwhb3jRfUU4Wxap6j8qAl y7jSzXn0xQ506XoGVGqz4B1aonKwlA1ZxR0P4GtvuobsNp7xBtwCf+zsZJhNac8CJ6xnlKMs5zAS/ +/4m8pVIZ5s21sFSgI6erPnqv5cjdy9yyIrEtz9KYGr8tpw2WiM5WFUFXuuo3lKEj/p4jLVUsXRTa 2LJaPQqc+8NgyFUAUsKa6+NIBksuX8lYPZoSiFIrGTPWH3H3Ukg/VQOWEvFcK0IAV+o5DYi+imfwx Hq4R3J1o3aGcOwakiTXw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hs2zB-0001Gr-V8; Mon, 29 Jul 2019 10:34:33 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hs2z9-0001G5-2I for linux-arm-kernel@lists.infradead.org; Mon, 29 Jul 2019 10:34:32 +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 25567344; Mon, 29 Jul 2019 03:34:28 -0700 (PDT) Received: from e107155-lin (e107155-lin.cambridge.arm.com [10.1.196.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3D8923F694; Mon, 29 Jul 2019 03:34:26 -0700 (PDT) Date: Mon, 29 Jul 2019 11:34:24 +0100 From: Sudeep Holla To: Philipp Zabel Subject: Re: [PATCH 5/5] reset: Add support for resets provided by SCMI Message-ID: <20190729103424.GB831@e107155-lin> References: <20190726135954.11078-1-sudeep.holla@arm.com> <20190726135954.11078-6-sudeep.holla@arm.com> <1564394355.7633.5.camel@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1564394355.7633.5.camel@pengutronix.de> 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-20190729_033431_199876_35FE1514 X-CRM114-Status: GOOD ( 19.26 ) 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: Peng Fan , Etienne Carriere , Souvik Chakravarty , wesleys@xilinx.com, aidapala@qti.qualcomm.com, linux-kernel@vger.kernel.org, Saeed Nowshadi , Bo Zhang , Felix Burton , Jim Quinlan , pajay@qti.qualcomm.com, Gaku Inami , Volodymyr Babchuk , linux-arm-kernel@lists.infradead.org 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 Mon, Jul 29, 2019 at 11:59:15AM +0200, Philipp Zabel wrote: > Hi Sudeep, > > On Fri, 2019-07-26 at 14:59 +0100, Sudeep Holla wrote: > > On some ARM based systems, a separate Cortex-M based System Control > > Processor(SCP) provides the overall power, clock, reset and system > > control. System Control and Management Interface(SCMI) Message Protocol > > is defined for the communication between the Application Cores(AP) > > and the SCP. > > > > Adds support for the resets provided using SCMI protocol for performing > > reset management of various devices present on the SoC. Various reset > > functionalities are achieved by the means of different ARM SCMI device > > operations provided by the ARM SCMI framework. > > > > Cc: Philipp Zabel > > Signed-off-by: Sudeep Holla > > thank you for the patch. I have a few suggestions below. > Thanks for reviewing so quickly, all points taken and fixed locally. Will wait for some more time before posting v2. [...] > > +static int > > +scmi_reset_assert(struct reset_controller_dev *rcdev, unsigned long id) > > +{ > > + struct scmi_reset_data *data = to_scmi_reset_data(rcdev); > > + const struct scmi_handle *handle = data->handle; > > This could be shortened to to_scmi_handle(rcdev), since none of the > other fields in scmi_reset_data are used by the reset_control_ops > callbacks. > Makes sense, missed to see that. [...] > > + > > +static int scmi_reset_probe(struct scmi_device *sdev) > > +{ > > + struct scmi_reset_data *data; > > + struct device *dev = &sdev->dev; > > + struct device_node *np = dev->of_node; > > + const struct scmi_handle *handle = sdev->handle; > > + > > + if (!handle || !handle->reset_ops) > > + return -ENODEV; > > + > > + data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); > > + if (!data) > > + return -ENOMEM; > > + > > + data->rcdev.ops = &scmi_reset_ops; > > + data->rcdev.owner = THIS_MODULE; > > + data->rcdev.of_node = np; > > This is missing rcdev.nr_resets. When nr_resets is kept at zero, the > check in of_reset_simple_xlate will fail for any id. > I clearly missed to do git add for the above :(. I did find these after testing. > > + data->dev = dev; > > + > > + return devm_reset_controller_register(dev, &data->rcdev); > > +} > > + > > +static const struct scmi_device_id scmi_id_table[] = { > > + { SCMI_PROTOCOL_RESET }, > > + { }, > > +}; > > +MODULE_DEVICE_TABLE(scmi, scmi_id_table); > > + > > +static struct scmi_driver scmi_reset_driver = { > > + .name = "scmi-reset", > > + .probe = scmi_reset_probe, > > + .id_table = scmi_id_table, > > +}; > > +module_scmi_driver(scmi_reset_driver); > > + > > +MODULE_AUTHOR("Sudeep Holla "); > > +MODULE_DESCRIPTION("ARM SCMI clock driver"); > > s/clock/reset controller/ > Stupid copy-paste :( Thanks again. -- Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel