From mboxrd@z Thu Jan 1 00:00:00 1970 From: Russell King - ARM Linux Subject: Re: [Patch v3 1/2] arm: kernel: Add SMC structure parameter Date: Thu, 19 Jan 2017 14:40:08 +0000 Message-ID: <20170119144008.GA27312@n2100.armlinux.org.uk> References: <1484173918-25090-1-git-send-email-andy.gross@linaro.org> <1484173918-25090-2-git-send-email-andy.gross@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1484173918-25090-2-git-send-email-andy.gross@linaro.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Andy Gross Cc: lorenzo.pieralisi@arm.com, linux-arm-msm@vger.kernel.org, will.deacon@arm.com, linux-kernel@vger.kernel.org, Bjorn Andersson , Srinivas Kandagatla , Kevin Hilman , linux-arm-kernel@lists.infradead.org List-Id: linux-arm-msm@vger.kernel.org On Wed, Jan 11, 2017 at 04:31:57PM -0600, Andy Gross wrote: > diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h > index b5abfda..3e28d08 100644 > --- a/include/linux/arm-smccc.h > +++ b/include/linux/arm-smccc.h > @@ -72,19 +72,33 @@ struct arm_smccc_res { > }; > > /** > - * arm_smccc_smc() - make SMC calls > + * struct arm_smccc_quirk - Contains quirk information > + * id contains quirk identification > + * state contains the quirk specific information Given that this is a kerneldoc comment, it should really conform to the kerneldoc requirements - see Documentation/kernel-doc-nano-HOWTO.txt: /** * struct arm_smccc_quirk - Contains quirk information * @id: quirk identification * @state: the quirk specific information > + */ > +struct arm_smccc_quirk { > + int id; > + union { > + unsigned long a6; > + } state; > +}; > + > +/** > + * __arm_smccc_smc() - make SMC calls > * @a0-a7: arguments passed in registers 0 to 7 > * @res: result values from registers 0 to 3 > + * @quirk: optional quirk structure > * > * This function is used to make SMC calls following SMC Calling Convention. > * The content of the supplied param are copied to registers 0 to 7 prior > * to the SMC instruction. The return values are updated with the content > - * from register 0 to 3 on return from the SMC instruction. > + * from register 0 to 3 on return from the SMC instruction. An optional > + * quirk structure provides vendor specific behavior. It's quite odd to have the result buried in the middle of arguments passed to a function, but I guess for the sake of simplicity in the assembly code that's what we need. Also: "@quirk points to an arm_smccc_quirk, or NULL when no quirks are required." And... should this not be const? Are we expecting anyone to modify the quirk structure? Thanks. -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net. From mboxrd@z Thu Jan 1 00:00:00 1970 From: linux@armlinux.org.uk (Russell King - ARM Linux) Date: Thu, 19 Jan 2017 14:40:08 +0000 Subject: [Patch v3 1/2] arm: kernel: Add SMC structure parameter In-Reply-To: <1484173918-25090-2-git-send-email-andy.gross@linaro.org> References: <1484173918-25090-1-git-send-email-andy.gross@linaro.org> <1484173918-25090-2-git-send-email-andy.gross@linaro.org> Message-ID: <20170119144008.GA27312@n2100.armlinux.org.uk> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wed, Jan 11, 2017 at 04:31:57PM -0600, Andy Gross wrote: > diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h > index b5abfda..3e28d08 100644 > --- a/include/linux/arm-smccc.h > +++ b/include/linux/arm-smccc.h > @@ -72,19 +72,33 @@ struct arm_smccc_res { > }; > > /** > - * arm_smccc_smc() - make SMC calls > + * struct arm_smccc_quirk - Contains quirk information > + * id contains quirk identification > + * state contains the quirk specific information Given that this is a kerneldoc comment, it should really conform to the kerneldoc requirements - see Documentation/kernel-doc-nano-HOWTO.txt: /** * struct arm_smccc_quirk - Contains quirk information * @id: quirk identification * @state: the quirk specific information > + */ > +struct arm_smccc_quirk { > + int id; > + union { > + unsigned long a6; > + } state; > +}; > + > +/** > + * __arm_smccc_smc() - make SMC calls > * @a0-a7: arguments passed in registers 0 to 7 > * @res: result values from registers 0 to 3 > + * @quirk: optional quirk structure > * > * This function is used to make SMC calls following SMC Calling Convention. > * The content of the supplied param are copied to registers 0 to 7 prior > * to the SMC instruction. The return values are updated with the content > - * from register 0 to 3 on return from the SMC instruction. > + * from register 0 to 3 on return from the SMC instruction. An optional > + * quirk structure provides vendor specific behavior. It's quite odd to have the result buried in the middle of arguments passed to a function, but I guess for the sake of simplicity in the assembly code that's what we need. Also: "@quirk points to an arm_smccc_quirk, or NULL when no quirks are required." And... should this not be const? Are we expecting anyone to modify the quirk structure? Thanks. -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753326AbdASOmE (ORCPT ); Thu, 19 Jan 2017 09:42:04 -0500 Received: from pandora.armlinux.org.uk ([78.32.30.218]:32772 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753287AbdASOle (ORCPT ); Thu, 19 Jan 2017 09:41:34 -0500 Date: Thu, 19 Jan 2017 14:40:08 +0000 From: Russell King - ARM Linux To: Andy Gross Cc: linux-arm-kernel@lists.infradead.org, lorenzo.pieralisi@arm.com, linux-arm-msm@vger.kernel.org, will.deacon@arm.com, linux-kernel@vger.kernel.org, Bjorn Andersson , Srinivas Kandagatla , Kevin Hilman Subject: Re: [Patch v3 1/2] arm: kernel: Add SMC structure parameter Message-ID: <20170119144008.GA27312@n2100.armlinux.org.uk> References: <1484173918-25090-1-git-send-email-andy.gross@linaro.org> <1484173918-25090-2-git-send-email-andy.gross@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1484173918-25090-2-git-send-email-andy.gross@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 11, 2017 at 04:31:57PM -0600, Andy Gross wrote: > diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h > index b5abfda..3e28d08 100644 > --- a/include/linux/arm-smccc.h > +++ b/include/linux/arm-smccc.h > @@ -72,19 +72,33 @@ struct arm_smccc_res { > }; > > /** > - * arm_smccc_smc() - make SMC calls > + * struct arm_smccc_quirk - Contains quirk information > + * id contains quirk identification > + * state contains the quirk specific information Given that this is a kerneldoc comment, it should really conform to the kerneldoc requirements - see Documentation/kernel-doc-nano-HOWTO.txt: /** * struct arm_smccc_quirk - Contains quirk information * @id: quirk identification * @state: the quirk specific information > + */ > +struct arm_smccc_quirk { > + int id; > + union { > + unsigned long a6; > + } state; > +}; > + > +/** > + * __arm_smccc_smc() - make SMC calls > * @a0-a7: arguments passed in registers 0 to 7 > * @res: result values from registers 0 to 3 > + * @quirk: optional quirk structure > * > * This function is used to make SMC calls following SMC Calling Convention. > * The content of the supplied param are copied to registers 0 to 7 prior > * to the SMC instruction. The return values are updated with the content > - * from register 0 to 3 on return from the SMC instruction. > + * from register 0 to 3 on return from the SMC instruction. An optional > + * quirk structure provides vendor specific behavior. It's quite odd to have the result buried in the middle of arguments passed to a function, but I guess for the sake of simplicity in the assembly code that's what we need. Also: "@quirk points to an arm_smccc_quirk, or NULL when no quirks are required." And... should this not be const? Are we expecting anyone to modify the quirk structure? Thanks. -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.