Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6109366yba; Tue, 14 May 2019 01:41:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqznEUYZkhJs7E6si1dcFdHVL9bIw0D3SPZxL3TpTetiug26DQjbv0Ebwo8m2rfo3yf0+nGa X-Received: by 2002:a65:448b:: with SMTP id l11mr36178979pgq.185.1557823297094; Tue, 14 May 2019 01:41:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557823297; cv=none; d=google.com; s=arc-20160816; b=Uam+MshVZ8qSUG9TyRaaenoZwQtcha/LA3EVOkWMa5euRjqoMaNrwNWa/vXmhRkMLy qGtTnPajm8NFjx/tmoREnnyauhT3smqO+6IntgJfhU5+EfX4M44YQThCQOXl24A3kpDV 1BOrXDMk4nyKFoQml2PYoMLv7W4xhEnqDwRwq10E4seOcoqq+CHh2NNuZRxigK0KlrZc pXpcZ5uhil9lsHzimRH2ip0uDKBUllJSu2ZfZmyJ1DMiXKiuQ+/9lzP2OKiiEd4NTKBL NdU5NtKfWVFZ7iSHcoqz/TJwPMhDWud2T1/PeVUG5Xc3LBAMmG06y84yUKNlI0JYHhbt VQig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=RVI9iWgc55Qe0q3tLtvRyel7wrcIN68nuDWX5YnzBtc=; b=jbTRiKbZHjo5Jw75IiO465xsWCh5lDC5T0p1wNY61bWE+aZXhCEgQu+oNLrd36+Hyi M268Qbyt53hUSGA2kiyzvOYvHrkJLVRxhy8VEEABbIpU4PbCis23i3Y6Eu4DYnP8hqDM 6jhernjFL5dPz0iDL3bOWN0KNwz1AvDQ0btZN2Sw4Mg3BmJBFyA51h27nGKcu8nkITUh mP86VXrhk6Yap/CHUskDVJ3yP5n6yBT6b6jqzbpXf8niftqHS9P7vGYNKr4cEfdjO08l TY6uF6nMxhTG3fQz/YMKcBHVLW3U1/8mC887xHGnF7mo6MiazClwdbToWW4ZFrcK9gJY juQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=F15QTDXn; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r4si295062pgv.195.2019.05.14.01.41.22; Tue, 14 May 2019 01:41:37 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=F15QTDXn; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726525AbfENIjF (ORCPT + 99 others); Tue, 14 May 2019 04:39:05 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:45231 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725985AbfENIjE (ORCPT ); Tue, 14 May 2019 04:39:04 -0400 Received: by mail-ed1-f65.google.com with SMTP id g57so21664869edc.12 for ; Tue, 14 May 2019 01:39:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RVI9iWgc55Qe0q3tLtvRyel7wrcIN68nuDWX5YnzBtc=; b=F15QTDXnjQ7h1JnwI/L/yLlLHNZz3LU5SuAP4NtoAxncLb9P+u6MXb0HOEomLvKrBX 3R9ouMCzZJj6s16y+Np4CXsnPFiAOlSVa8xYckHTSa1HLBClfVhbUguAPcjWoqOvWPuv tV5M9+7jxZSHo1moP4c4ra1XRQeRyuTrJn4kI8khIhUhF/EpSRRo3Atj1lPHAgnIHylm wvMtnm6MJ/nMjug4ihZ4d+//xf/pNpsXyGoDbE6mlzji05xNaUfGMsL3JaqClUCqmqTC o/nyt/ObxuovlVXJDhYwxJroRLP1vPfKnMjW35G99l4PLkfjN/A6jJj1l8dvl/9C2oAg Dd5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RVI9iWgc55Qe0q3tLtvRyel7wrcIN68nuDWX5YnzBtc=; b=cN9QZGj99x6EXVOu//dCI6mKKuFT3HF17XmwEFQeNvLFiVcGgGl+c+GLafAMLp6wKu RrVSwERGDIhqiRkB3uL3tm6HxI9IPi8UniVM/rNM2b3YDxb5mpilgHNv8Zqj7zGHnFCF q71rvWlnL2ckhGFVhgfxK424MszkOACf4OZBMl7iZKKIxTwaD0KK9azD8e4JRgXUqV+O Ry7rH7OG0FV/EfIsZTPV74wh9sGiFmOONUj6lGSWTU1NAH0zQga6x7hruciZry+WB0RJ 3C5/rMGBRz+zGW9rx2Vwcmce/wYCA0pbXQBYvLkW7aDdJiVDFRjhImaEAB/EeGo/J/E4 heXQ== X-Gm-Message-State: APjAAAVvgflYfmoJu1nHLnvkmkoESlPJkknljjnPYfWJIzqWfp+m4guY om8K3xJHCkp/gfFHgRPyOgLhHJZwEE2n7HJSv/Q= X-Received: by 2002:a50:9441:: with SMTP id q1mr34683894eda.101.1557823142649; Tue, 14 May 2019 01:39:02 -0700 (PDT) MIME-Version: 1.0 References: <1557716049-22744-1-git-send-email-Anson.Huang@nxp.com> In-Reply-To: From: Daniel Baluta Date: Tue, 14 May 2019 11:38:51 +0300 Message-ID: Subject: Re: [PATCH RESEND 1/2] soc: imx: Add SCU SoC info driver support To: Anson Huang Cc: "catalin.marinas@arm.com" , "will.deacon@arm.com" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , "festevam@gmail.com" , "maxime.ripard@bootlin.com" , "agross@kernel.org" , "olof@lixom.net" , "horms+renesas@verge.net.au" , "jagan@amarulasolutions.com" , "bjorn.andersson@linaro.org" , Leonard Crestez , "marc.w.gonzalez@free.fr" , "dinguyen@kernel.org" , "enric.balletbo@collabora.com" , Aisheng Dong , "robh@kernel.org" , Abel Vesa , "l.stach@pengutronix.de" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , dl-linux-imx , Daniel Baluta Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 14, 2019 at 2:34 AM Anson Huang wrote: > > Hi, Daniel > > > -----Original Message----- > > From: Daniel Baluta [mailto:daniel.baluta@gmail.com] > > Sent: Monday, May 13, 2019 10:30 PM > > To: Anson Huang > > Cc: catalin.marinas@arm.com; will.deacon@arm.com; > > shawnguo@kernel.org; s.hauer@pengutronix.de; kernel@pengutronix.de; > > festevam@gmail.com; maxime.ripard@bootlin.com; agross@kernel.org; > > olof@lixom.net; horms+renesas@verge.net.au; > > jagan@amarulasolutions.com; bjorn.andersson@linaro.org; Leonard Crestez > > ; marc.w.gonzalez@free.fr; > > dinguyen@kernel.org; enric.balletbo@collabora.com; Aisheng Dong > > ; robh@kernel.org; Abel Vesa > > ; l.stach@pengutronix.de; linux-arm- > > kernel@lists.infradead.org; linux-kernel@vger.kernel.org; dl-linux-imx > > ; Daniel Baluta > > Subject: Re: [PATCH RESEND 1/2] soc: imx: Add SCU SoC info driver support > > > > > > > > > + > > > +static u32 imx8qxp_soc_revision(void) { > > > + struct imx_sc_msg_misc_get_soc_id msg; > > > + struct imx_sc_rpc_msg *hdr = &msg.hdr; > > > + u32 rev = 0; > > > + int ret; > > > + > > > + hdr->ver = IMX_SC_RPC_VERSION; > > > + hdr->svc = IMX_SC_RPC_SVC_MISC; > > > + hdr->func = IMX_SC_MISC_FUNC_GET_CONTROL; > > > + hdr->size = 3; > > > + > > > + msg.data.send.control = IMX_SC_C_ID; > > > + msg.data.send.resource = IMX_SC_R_SYSTEM; > > > + > > > + ret = imx_scu_call_rpc(soc_ipc_handle, &msg, true); > > > + if (ret) { > > > + dev_err(&imx_scu_soc_pdev->dev, > > > + "get soc info failed, ret %d\n", ret); > > > + return rev; > > > > So you return 0 (rev = 0) here in case of error? This doesn't seem to be right. > > Maybe return ret? > > This is intentional, similar with current i.MX8MQ soc info driver, when getting revision > failed, just return 0 as revision info and it will show "unknown" in sysfs. Ok, I understand. Lets make this clear from the source code. ret = imx_scu_call_rpc(soc_ipc_handle, &msg, true); + if (ret) { + dev_err(&imx_scu_soc_pdev->dev, + "get soc info failed, ret %d\n", ret); /* returning 0 means getting revision failed */ + return 0; + }