Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1876851ybn; Thu, 26 Sep 2019 03:37:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqw8NoCjinNxTpL++CnUtH2TG/UPk1iWDxDyjb+VMUIv0p481fUIBtM2cQrHb0m7XW6dt/F0 X-Received: by 2002:a50:eb44:: with SMTP id z4mr2658657edp.207.1569494235509; Thu, 26 Sep 2019 03:37:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569494235; cv=none; d=google.com; s=arc-20160816; b=LrZpuEXMWreRGd7QNds7WRalMjZ54pvPFa82b616afGmXXOVaYrlu5niOyWvCkQR7q kiuDytmw2a3AIzo3BAtbX9oYp0+O0c7EveKUuV6xtK/xyNVZrOR/iPhr12kwi8Uh04iY k/kQeSJ0O/4AdU2WT3oQAeMJa2ocaqWbV3OC+cOHbdIFiDoKPVkqW6SCTS56bqupsOix rDAePrSZOQd15W9RC4xyo3gYx7v8ciMNcDSn7b60jxpcVd1ixqvN14OJkl6DTP88SEiW 8HRH6iwRL9CZkx5e5WuhAzlvvKI9sPfO8xYJiiJ0Qo1fRljmAHX9XCOY+ax18qWPhc+J xFrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=7wLYi3Yew0fAvrlktiSZglU5aNwEab8u93+sDb3JEKA=; b=k4TVZnJrI6qN8UOYMLuKY10R8QxUZKnZqmM0xuHF4u9HmYLBS+xCqZH1KBPNYhA3Lo EnTFHR/4w59spav74FfWxyNZofVnonXjcZIGq4cg8K58tKs2HmaanmxGmQNciVocAh3w cnIkmi/m5R0sVI3O1LEWkQLn7w1WQopD7bC8/nSTtbwqXaGzHuIfQpmvhFjAbZZGuLNr VkR1gyiApIMhSUJkuWN82SWuwU8l/JYULFP4hlV1DFCGl0u4fydRXwv5s3ZKH5fBfKyH ItjkmIUYtnqIdRJQbiEmFSSDVJFRhoIsKKJN8kuFFkUafdrkiaB4WfjAHMgPl8OTqU3U 0pzw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x14si970766edq.49.2019.09.26.03.36.50; Thu, 26 Sep 2019 03:37:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726139AbfIZKGE (ORCPT + 99 others); Thu, 26 Sep 2019 06:06:04 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:35243 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726086AbfIZKGD (ORCPT ); Thu, 26 Sep 2019 06:06:03 -0400 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iDQet-0004yT-DP; Thu, 26 Sep 2019 12:05:59 +0200 Received: from mfe by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1iDQes-000329-OD; Thu, 26 Sep 2019 12:05:58 +0200 Date: Thu, 26 Sep 2019 12:05:58 +0200 From: Marco Felsch To: Anson Huang Cc: "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , "festevam@gmail.com" , Aisheng Dong , Leonard Crestez , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , dl-linux-imx Subject: Re: [PATCH] firmware: imx: Skip return value check for some special SCU firmware APIs Message-ID: <20190926100558.egils3ds37m3s5wo@pengutronix.de> References: <1569406066-16626-1-git-send-email-Anson.Huang@nxp.com> <20190926075914.i7tsd3cbpitrqe4q@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 10:11:00 up 131 days, 14:29, 85 users, load average: 0.24, 0.16, 0.14 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Anson, On 19-09-26 08:03, Anson Huang wrote: > Hi, Marco > > > On 19-09-25 18:07, Anson Huang wrote: > > > The SCU firmware does NOT always have return value stored in message > > > header's function element even the API has response data, those > > > special APIs are defined as void function in SCU firmware, so they > > > should be treated as return success always. > > > > > > Signed-off-by: Anson Huang > > > --- > > > - This patch is based on the patch of > > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatc > > > > > hwork.kernel.org%2Fpatch%2F11129553%2F&data=02%7C01%7Canson. > > huang% > > > > > 40nxp.com%7C1f4108cc25eb4618f43c08d742576fa3%7C686ea1d3bc2b4c6fa > > 92cd99 > > > > > c5c301635%7C0%7C0%7C637050815608963707&sdata=BZBg4cOR2rP%2 > > BRBNn15i > > > Qq3%2FXBYwhuCLkgYzFRbfEgVU%3D&reserved=0 > > > --- > > > drivers/firmware/imx/imx-scu.c | 34 > > > ++++++++++++++++++++++++++++++++-- > > > 1 file changed, 32 insertions(+), 2 deletions(-) > > > > > > diff --git a/drivers/firmware/imx/imx-scu.c > > > b/drivers/firmware/imx/imx-scu.c index 869be7a..ced5b12 100644 > > > --- a/drivers/firmware/imx/imx-scu.c > > > +++ b/drivers/firmware/imx/imx-scu.c > > > @@ -78,6 +78,11 @@ static int imx_sc_linux_errmap[IMX_SC_ERR_LAST] = > > { > > > -EIO, /* IMX_SC_ERR_FAIL */ > > > }; > > > > > > +static const struct imx_sc_rpc_msg whitelist[] = { > > > + { .svc = IMX_SC_RPC_SVC_MISC, .func = > > IMX_SC_MISC_FUNC_UNIQUE_ID }, > > > + { .svc = IMX_SC_RPC_SVC_MISC, .func = > > > +IMX_SC_MISC_FUNC_GET_BUTTON_STATUS }, }; > > > > Is this going to be extended in the near future? I see some upcoming > > problems here if someone uses a different scu-fw<->kernel combination as > > nxp would suggest. > > Could be, but I checked the current APIs, ONLY these 2 will be used in Linux kernel, so > I ONLY add these 2 APIs for now. Okay. > However, after rethink, maybe we should add another imx_sc_rpc API for those special > APIs? To avoid checking it for all the APIs called which may impact some performance. > Still under discussion, if you have better idea, please advise, thanks! Adding a special api shouldn't be the right fix. Imagine if someone (not a nxp-developer) wants to add a new driver. How could he be expected to know which api he should use. The better abbroach would be to fix the scu-fw instead of adding quirks.. Regards, Marco > > Anson