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=-12.9 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham 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 47A3FC47082 for ; Thu, 3 Jun 2021 17:25:03 +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 11BC2613BA for ; Thu, 3 Jun 2021 17:25:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 11BC2613BA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=szZg+brdyw5nSRuv7P+91e3xLpPDER1xw7jcHImAkZ8=; b=DPmSQWHqGdFIyLp8+1u7INk9/+ VN2Fm76l/zI2AZrB6eQy7RU1qt4H7sQyOyItx0mhuQoj/VpQjdJ0NdJAQ0Xwopo7GAAaGxgthr9BQ t7TTMnFdUUrqe0zqm5e9AFa7KE3z2apKa6ag+jIGkeLT54d7WpXsrJxCUUffDdlFiPNgl26glZLVG LNSANo6rk2vCmLD2PWm8TUuGGVUHagGet7FxpXX1UeqI5q8fetLX45ueCjO61ArcPLomnxYXtXGz2 ca0S4n24KoaJwZZuSgh8T6cHvTrm0ndyFLIzzFVeD9QwfbuXowtqiLdST5G0MKUOiG/Can0qzcciL ThVOPyqg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lor3d-009pyz-2o; Thu, 03 Jun 2021 17:23:01 +0000 Received: from mail-pg1-f181.google.com ([209.85.215.181]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lor0C-009p2W-Ct for linux-arm-kernel@lists.infradead.org; Thu, 03 Jun 2021 17:19:29 +0000 Received: by mail-pg1-f181.google.com with SMTP id e22so5645271pgv.10 for ; Thu, 03 Jun 2021 10:19:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=RSM5cEWMOBtg0w4EbSWs2j+PYMqroQoduezc0oKRRBQ=; b=cGwZ7szb9sfYv2aTXF0cAHXecdH+17NkfG8oVp05c3VeS8W+XoTQ1GBgnFd6/sijzI Fz60lYNlmYI6sUR8JZvK6Zvx9vR+ErC6lRccRKTrPTeo+Y9InnJpLPgoauH618qD+kns lilidYKJXhdgoFr7KrqjQ2HQZxV0G3aOGgRZa/a8Hdi/tVKD6RP3TJ+WPkiU6sJE3DDw iAc3Oq2UPKbWNIXC4oDlIMmAFFviK/X/cz+iGe2X5ApoBr6apMwGzAL67kapT/CnFT+9 OVMNihCsJiBXrR3Y4kWOfxHHqWH4ckDBr5DN1u6OykgaT5epQS9GjZ7k8odOyAETuiZg VTKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=RSM5cEWMOBtg0w4EbSWs2j+PYMqroQoduezc0oKRRBQ=; b=blXMKIKGBUWi3J+yAk8Djk1/wtLDwtl8deCSrEBRSPjbIsD267g9329z0121oxJh+G e0wBbK/G2hE3/g7yi0+V6GzTD3q7dJ4EGgSk85gr+Ou/wMbp04y2BalZ4lRI9104Ioq5 ubSqJjrIcTzHtBvpWB7lPEVqNoP+oWvLbAm7/9rKEIC8LNmZJEt0SELzEszxyrEx1BdT 0VObI5ahUEK/bFcnprqIh9Ap8rQZj5va3ntKlnAaLXxYQwApnPPSDPkKA0DT9jWyEES5 iy1Q82yVfpntmnVRYvzhCxgDPIPVBNpqM6rG0IfDZBWiRhFz0JT8FJp0XTypQs2r4zdr k4TA== X-Gm-Message-State: AOAM530IDlxM2Zo5MFr7v1zECMrBcpxCXf8SIDtH5bbM75HKSXfeVuZx Aa+HKjy6NBJYB3tEurO+WNs= X-Google-Smtp-Source: ABdhPJwXqsMClTSMJxwLrVt7GGZRq+QLd2+qvEyZkuBuf9riZAHkfzipINjOmSK/9UHlCNIuEqo+TQ== X-Received: by 2002:a62:ea03:0:b029:2e7:8445:243c with SMTP id t3-20020a62ea030000b02902e78445243cmr186276pfh.54.1622740705594; Thu, 03 Jun 2021 10:18:25 -0700 (PDT) Received: from [10.67.49.104] ([192.19.223.252]) by smtp.googlemail.com with ESMTPSA id br14sm2673632pjb.41.2021.06.03.10.18.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Jun 2021 10:18:24 -0700 (PDT) Subject: Re: [PATCH 2/2] firmware: arm_scmi: Add compatibility checks for shmem node To: Sudeep Holla , Etienne Carriere Cc: "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , Cristian Marussi , Kevin Hilman , Neil Armstrong , Jerome Brunet , Jim Quinlan References: <20210601225125.918225-1-sudeep.holla@arm.com> <20210601225125.918225-2-sudeep.holla@arm.com> <20210602073653.x4bon6jbiat2jnqv@bogus> <20210602075326.clypj7qmiv4gebas@bogus> From: Florian Fainelli Message-ID: <0963a5e1-5ce2-4ef4-7ff9-cbbea0f974d0@gmail.com> Date: Thu, 3 Jun 2021 10:18:20 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210602075326.clypj7qmiv4gebas@bogus> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210603_101928_498841_DC9BA90F X-CRM114-Status: GOOD ( 24.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 6/2/21 12:53 AM, Sudeep Holla wrote: > On Wed, Jun 02, 2021 at 09:44:40AM +0200, Etienne Carriere wrote: >> On Wed, 2 Jun 2021 at 09:37, Sudeep Holla wrote: >>> >>> On Wed, Jun 02, 2021 at 09:33:03AM +0200, Etienne Carriere wrote: >>>> Hello Sudeep, >>>> >>>> >>>> On Wed, 2 Jun 2021 at 00:51, Sudeep Holla wrote: >>>>> >>>>> The shared memory node used for communication between the firmware and >>>>> the OS should be compatible with "arm,scmi-shmem". Add the check for the >>>>> same while parsing the node before fetching the memory regions. >>>>> >>>>> Cc: Cristian Marussi >>>>> Cc: Florian Fainelli >>>>> Cc: Jim Quinlan >>>>> Cc: Etienne Carriere >>>>> Signed-off-by: Sudeep Holla >>>>> --- >>>>> drivers/firmware/arm_scmi/mailbox.c | 3 +++ >>>>> drivers/firmware/arm_scmi/smc.c | 3 +++ >>>>> 2 files changed, 6 insertions(+) >>>>> >>>>> diff --git a/drivers/firmware/arm_scmi/mailbox.c b/drivers/firmware/arm_scmi/mailbox.c >>>>> index 4626404be541..e3dcb58314ae 100644 >>>>> --- a/drivers/firmware/arm_scmi/mailbox.c >>>>> +++ b/drivers/firmware/arm_scmi/mailbox.c >>>>> @@ -69,6 +69,9 @@ static int mailbox_chan_setup(struct scmi_chan_info *cinfo, struct device *dev, >>>>> return -ENOMEM; >>>>> >>>>> shmem = of_parse_phandle(cdev->of_node, "shmem", idx); >>>>> + if (!of_device_is_compatible(shmem, "arm,scmi-shmem")) >>>>> + return -ENXIO; >>>> >>>> Before this change, one could use another type of memory node, like "mmio-sram". >>>> Is there a strong reason to enforce use of "arm,scmi-shmem" nodes? >>>> >>> >>> No that is for the entire SRAM which still holds and generic on-chip SRAM >>> driver will take care of that, this is only for the subsections that is >>> reserved for the scp shmem. The binding has been always there, just the >>> missing check. When I move to yaml, I realised that and hence the >>> addition of check. >> >> Ok, I understand. True the binding was there but only in the DTS >> examples snipped. >> This constraint on the compatible property of the shmem node should be >> clearly stated in the yaml I think. >> > > Was this missing in your DTS files ? Just curious. > FWIW, our legacy DTs would have the following: reserved-memory { /* This is a placeholder */ NWMBOX: NWMBOX { }; }; brcm_scmi: brcm_scmi@0 { compatible = "arm,scmi-smc", "arm,scmi"; mboxes = <&brcm_scmi_mailbox 0>, <&brcm_scmi_mailbox 1>; mbox-names = "tx", "rx"; shmem = <&NWMBOX>; status = "disabled"; so while we have since switched to the SMC transport, the shared memory still does not have an "arm,scmi-shmem" compatible string, and this is a relatively new thing, so I am not sure we can enforce that just yet? -- Florian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel