From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: [PATCH 2/3] tpm: Add start method for ARM Secure Monitor Call Date: Fri, 10 Mar 2017 10:00:17 -0700 Message-ID: <20170310170017.GB22960@obsidianresearch.com> References: <1489139889-14376-1-git-send-email-anjiandi@codeaurora.org> <1489139889-14376-3-git-send-email-anjiandi@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1489139889-14376-3-git-send-email-anjiandi-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Jiandi An Cc: rafael.j.wysocki-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, robert.moore-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, lv.zheng-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, lenb-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org List-Id: tpmdd-devel@lists.sourceforge.net On Fri, Mar 10, 2017 at 03:58:08AM -0600, Jiandi An wrote: > +/* > + * This is a TPM Command Response Buffer start method that invokes a > + * Secure Monitor Call to requrest the firmware to execute or cancel > + * a TPM 2.0 command. > + */ > +static inline int tpm_crb_smc_start(unsigned long func_id) > +{ > + struct arm_smccc_res res; > + > + arm_smccc_smc(func_id, 0, 0, 0, 0, 0, 0, 0, &res); > + if (res.a0 != 0) { > + WARN(1, "tpm_crb_smc_start() returns res.a0 = 0x%lx\n", res.a0); > + return -EIO; I don't think either of these WARN's are appropriate. 'dev_err(FIRMWARE_BUG' would be better. Jason ------------------------------------------------------------------------------ Announcing the Oxford Dictionaries API! The API offers world-renowned dictionary content that is easy and intuitive to access. Sign up for an account today to start using our lexical data to power your apps and projects. Get started today and enter our developer competition. http://sdm.link/oxford