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 0B70AC47082 for ; Thu, 3 Jun 2021 17:26:53 +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 CC9E66108E for ; Thu, 3 Jun 2021 17:26:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CC9E66108E 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:References:Cc:To:From:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=HJdMzUlCWig4ry4pux/8QVMUCuWP5DJFF3MnwZFvU4k=; b=f2gEkpHEmFiANrbzXrDAg+IesM 7CRXTlUkeNIPxfUp4WonC10D9d+kU6nJ6Hh/3wUUjMj6pB5YQX2akk4F++Y5vM2CGFyTwgfmD6G18 SIGxMseqch0MeFyYM4/l79kR4ug29Lzu1OQuHsF+W7r8bwvsjTaNn7cqdjt/52+8tcg+8g/ZRbyX9 BXtcetNwtiJf5thE0S5fKBQWfxNO0AU1N8vKdy3ot97c8pWSKmgUe4HGVuhyJZBmIYDSbNMXCgif/ SoQ4uHczKRvuUvMuU3ngNtvCrY4twlRr9FyXga301ndY2Se9rpKeRjtLgMuF4SjR730K2SHOx+puv d3iGVo7A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lor5D-009qTv-0I; Thu, 03 Jun 2021 17:24:42 +0000 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lor1I-009pL9-Og for linux-arm-kernel@lists.infradead.org; Thu, 03 Jun 2021 17:20:38 +0000 Received: by mail-pg1-x533.google.com with SMTP id o9so2832275pgd.2 for ; Thu, 03 Jun 2021 10:20:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=8VbKalmZ30otJSd/nus+X8pj+dF4RaLdBskT6BDW7Ew=; b=e5eYnQT8Zqr5LyKLpE2VnH9/7sFt9VuJZJpmMoNYxtbghoftaeqrHyhTh3PDqp1AOw pY9x52dKdE0LFEBvP4aHlJ19Agz4lzKsWIK/PeuEwxD0py0oTsbG09umvLSx5Ixwfm8t 4uFfSjpPBjNJh9tAs5esnM6tcUfsatGCq6vJQIGdZNR6U6/cnm+jbK5CHhaLfWBTf53s F6kPn/hfCyeolsK2/mScoyj/gciqI3gP9ryBjuIelvOK7OGTB6WbL8LEFeDrtXFGmNMj UOtinIp58Nb5V5SFTWiqqT6ISfOF99eqNPSIEWFTa+2Y1B7cPGDMSuS4EPdfgWR3hj7t I4Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=8VbKalmZ30otJSd/nus+X8pj+dF4RaLdBskT6BDW7Ew=; b=bkSr6TX5SdFN/gsOK6Xb57dKr/oXBlTiaXyoHoF/Dl6ccy7bbzbIZmyap1DWEUJAV1 XP03NiPpINr/di7ivaHz6XbfR7dkUPVB8hqrNNtvZYK8nKR7L1z7vHvkaDUg/AARTzuM 0w9r6B6VS8IiX/ga++X2HkePO9n7RMQgTuLCfMGrIziZWgTlnXYQAJFdwRAMVURgmntC egZPWqw0mG8EwwZvaxqx1ssdbibsHfezyV0j34TG0sWklGDwWNGe+AFwuCkc3i3PzfHi Gav/LsueCTutEnA0H+eR4OjhB060meg0GaRH+Mg3kX08ykPtRzJeUmR5Dx4nDUe4PvaZ z5Aw== X-Gm-Message-State: AOAM530BoTLeYTFoUddJzsJbpg2TUJRmXnQqZiOMWxGFp3V8TOefGTQe 0bqJ2o4yzSBnYRjz6pMx6Mk= X-Google-Smtp-Source: ABdhPJzR+fIqxGq78fxc2h+1qU8iqBd4BwXzB/Q8WD6oZO+5KxhLQvP7BJvInCBwIOxklFSY9pgndg== X-Received: by 2002:aa7:8a99:0:b029:2e9:b9f:bf4e with SMTP id a25-20020aa78a990000b02902e90b9fbf4emr363821pfc.56.1622740835431; Thu, 03 Jun 2021 10:20:35 -0700 (PDT) Received: from [10.67.49.104] ([192.19.223.252]) by smtp.googlemail.com with ESMTPSA id f7sm2720857pfk.191.2021.06.03.10.20.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Jun 2021 10:20:34 -0700 (PDT) Subject: Re: [PATCH 2/2] firmware: arm_scmi: Add compatibility checks for shmem node From: Florian Fainelli 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> <0963a5e1-5ce2-4ef4-7ff9-cbbea0f974d0@gmail.com> Message-ID: Date: Thu, 3 Jun 2021 10:20:32 -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: <0963a5e1-5ce2-4ef4-7ff9-cbbea0f974d0@gmail.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210603_102036_861281_788F5B61 X-CRM114-Status: GOOD ( 27.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/3/21 10:18 AM, Florian Fainelli wrote: > 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? Sorry, I incorrectly browsed the binding history, this is not a new requirement, will make sure we fix it at our end, too. -- Florian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel