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=-15.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,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 A0FF6C47082 for ; Thu, 3 Jun 2021 12:55:09 +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 7094B6124B for ; Thu, 3 Jun 2021 12:55:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7094B6124B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.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:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Fh0HGnzwLWdWjGxshTV1qpPVyaJLR6GkxNf5BFS8ewI=; b=hGyEJlMG06McS7 PM8gKPxkprYAL8eDJKe/h8gLCGwEJa+fs+zVzdVTI8jZeyQ1KRhtmCHA/zEGHxDMOFgvppzLqaWTN vY+HOWBo4AF17XCkE1Iupf66ZUlELRHu/pmphYpGtLuaUItk+o3ZxhYligStbYbb5jdl659QXBc5B e/UG8vX+nnd5CNUXqBU/xWTq5o0dPNYxZLqsUvkfQaqXrqqeLXx6rk+yFS9vM6CkJpB3vYWv8gxHP tOizx+dzwwiTzG6ksUQA3FHvK2mXXR//OmhREBN6RSTo8MSPNIWpCnl2Sn/3k2rt7JIuKvKxEJ7m1 OApC65Femh4KikYOvW5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lomqT-008lf0-Nr; Thu, 03 Jun 2021 12:53:09 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lomqQ-008ldo-Jj for linux-arm-kernel@lists.infradead.org; Thu, 03 Jun 2021 12:53:08 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C17FC1063; Thu, 3 Jun 2021 05:52:54 -0700 (PDT) Received: from e120937-lin (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C5D603F774; Thu, 3 Jun 2021 05:52:53 -0700 (PDT) Date: Thu, 3 Jun 2021 13:52:49 +0100 From: Cristian Marussi To: Sudeep Holla Cc: linux-arm-kernel@lists.infradead.org, Rob Herring , Kevin Hilman , Neil Armstrong , Jerome Brunet Subject: Re: [RESEND PATCH 1/2] firmware: arm_scpi: Add compatibility checks for shmem node Message-ID: <20210603125249.GA28060@e120937-lin> References: <20210602073851.1005607-1-sudeep.holla@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210602073851.1005607-1-sudeep.holla@arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210603_055306_728002_E9B70738 X-CRM114-Status: GOOD ( 20.86 ) 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 Reviewed-by: Cristian Marussi Tested-by: Cristian Marussi Cristian On Wed, Jun 02, 2021 at 08:38:50AM +0100, Sudeep Holla wrote: > The shared memory node used for communication between the firmware and > the OS should be compatible with one of the following: > - amlogic,meson-gxbb-scp-shmem > - amlogic,meson-axg-scp-shmem > - arm,juno-scp-shmem > - arm,scp-shmem > Add the check for the same while parsing the node before fetching the memory > regions. > > Cc: Rob Herring > Cc: Kevin Hilman > Cc: Neil Armstrong > Cc: Jerome Brunet > Signed-off-by: Sudeep Holla > --- > drivers/firmware/arm_scpi.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/firmware/arm_scpi.c b/drivers/firmware/arm_scpi.c > index d0dee37ad522..7b827258e163 100644 > --- a/drivers/firmware/arm_scpi.c > +++ b/drivers/firmware/arm_scpi.c > @@ -897,6 +897,13 @@ static const struct of_device_id legacy_scpi_of_match[] = { > {}, > }; > > +static const struct of_device_id shmem_of_match[] = { > + { .compatible = "amlogic,meson-gxbb-scp-shmem", }, > + { .compatible = "amlogic,meson-axg-scp-shmem", }, > + { .compatible = "arm,juno-scp-shmem", }, > + { .compatible = "arm,scp-shmem", }, > + { } > +}; > static int scpi_probe(struct platform_device *pdev) > { > int count, idx, ret; > @@ -933,6 +940,9 @@ static int scpi_probe(struct platform_device *pdev) > struct mbox_client *cl = &pchan->cl; > struct device_node *shmem = of_parse_phandle(np, "shmem", idx); > > + if (!of_match_node(shmem_of_match, shmem)) > + return -ENXIO; > + > ret = of_address_to_resource(shmem, 0, &res); > of_node_put(shmem); > if (ret) { > -- > 2.25.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel