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.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 E146CC2B9F8 for ; Tue, 25 May 2021 03:58:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C21CE613D2 for ; Tue, 25 May 2021 03:58:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229612AbhEYEAS (ORCPT ); Tue, 25 May 2021 00:00:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229492AbhEYEAS (ORCPT ); Tue, 25 May 2021 00:00:18 -0400 Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3A54C061574 for ; Mon, 24 May 2021 20:58:48 -0700 (PDT) Received: by mail-ot1-x333.google.com with SMTP id i14-20020a9d624e0000b029033683c71999so16173619otk.5 for ; Mon, 24 May 2021 20:58:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=PYCLMkEW+70ZigxLY6fmQ8dsM2q44x8Y2+ykUv3XIXI=; b=H/DNaR8iAlpSqa0esisrNprCRmPr13QukJqyvgKoswi/uVSRceh8FbYO0f0yn8wWr2 5CxdFWvAqaandf7G4vv2VMokMy8X5uWVh4cXcK4HAER3PBoCW0Y4HtzoeDWl66MO6dJG Wauw5mQMhH1SEPq3IdTEFF0NJMZkCP7B0dHxRU0jZhmyZTl1QFYwILexn5De6rQ3wGw6 DY1TkP7fHk+5dhtVBzIdhBKmFXi8aQaD8jyGRx55FyI+l/g0EVHIZZZYx9IaGFFpgrRt 0EeC6i/xjruU4te9J3va4X8xT62jGLkA8yfvhNCQ/kLabt6QioFKbJENa2+UGEOImzdY jXNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=PYCLMkEW+70ZigxLY6fmQ8dsM2q44x8Y2+ykUv3XIXI=; b=VqB5SKGRB5xXSfBXxDMF7/sJHTtF8NzlXsp1dRqJdtVarYbHTwLYJMv6KlIXUgvOYl VGibN3SBlR7z5n505gNtZzqkYaJMtsPHDRt72fTCq2pbLs34c6tdtqJHFucdTUQmHNeR /3Duzv6e9E8rKUmTnH3mxuDyLfFxgdvlKWjAcZIFCzGZaSxO/66gy2WUxinh3ShEbKOl uyN6yJwER6DZ+HbXrCCqMgycz+fX8PPgnwkTn7iZrEb6gBLIMzz8rDbJ6H2w/u1CkhYr g8rgkAMEIb6b8aJovRo0OQhSzeqUl9LQKMcqx4biuygJ52EXzAI9yS9ilQXOjCMZBPTZ 50og== X-Gm-Message-State: AOAM533ZGrI0bW9BEyNo+tJomkiqqe3uRKzmBpsrrAqn/4khm5W8v5cc qp+vKq6ELDhe9skBkx3jeBfQbg== X-Google-Smtp-Source: ABdhPJyZXjYefLWliDSQvzVJp/OI2fPtOpIRZ7Tdcbr5odCMqVIiAaZVb8gEVfZxmY1u5CrCa2S9kg== X-Received: by 2002:a05:6830:1687:: with SMTP id k7mr22164926otr.220.1621915128032; Mon, 24 May 2021 20:58:48 -0700 (PDT) Received: from yoga (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id 35sm3587790oth.49.2021.05.24.20.58.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 20:58:47 -0700 (PDT) Date: Mon, 24 May 2021 22:58:45 -0500 From: Bjorn Andersson To: Shawn Guo Cc: Will Deacon , Robin Murphy , Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH v3] iommu/arm-smmu-qcom: hook up qcom_smmu_impl for ACPI boot Message-ID: References: <20210509022607.17534-1-shawn.guo@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210509022607.17534-1-shawn.guo@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Sat 08 May 21:26 CDT 2021, Shawn Guo wrote: > The hookup with qcom_smmu_impl is required to do ACPI boot on SC8180X > based devices like Lenovo Flex 5G laptop and Microsoft Surface Pro X. > Define acpi_platform_list for these platforms and match them using > acpi_match_platform_list() call, and create qcom_smmu_impl accordingly. > > (np == NULL) is used to check ACPI boot, because fwnode of SMMU device > is a static allocation and thus helpers like has_acpi_companion() don't > work here. > Reviewed-by: Bjorn Andersson Regards, Bjorn > Signed-off-by: Shawn Guo > --- > Changes for v3: > - Call acpi_match_platform_list() to match platform in qcom smmu > driver rather than IORT code. > > Changes for v2: > - Rather than using asl_compiler_id in IORT table, follow suggestion > from Robin Murphy to use acpi_match_platform_list() to match platform. > > drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c > index 98b3a1c2a181..f7e187f3fa66 100644 > --- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c > +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c > @@ -3,6 +3,7 @@ > * Copyright (c) 2019, The Linux Foundation. All rights reserved. > */ > > +#include > #include > #include > #include > @@ -339,10 +340,22 @@ static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { > { } > }; > > +static struct acpi_platform_list qcom_acpi_platlist[] = { > + { "LENOVO", "CB-01 ", 0x8180, ACPI_SIG_IORT, equal, "QCOM SMMU" }, > + { "QCOM ", "QCOMEDK2", 0x8180, ACPI_SIG_IORT, equal, "QCOM SMMU" }, > + { } > +}; > + > struct arm_smmu_device *qcom_smmu_impl_init(struct arm_smmu_device *smmu) > { > const struct device_node *np = smmu->dev->of_node; > > + if (np == NULL) { > + /* Match platform for ACPI boot */ > + if (acpi_match_platform_list(qcom_acpi_platlist) >= 0) > + return qcom_smmu_create(smmu, &qcom_smmu_impl); > + } > + > if (of_match_node(qcom_smmu_impl_of_match, np)) > return qcom_smmu_create(smmu, &qcom_smmu_impl); > > -- > 2.17.1 > 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=-14.1 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,URIBL_BLOCKED autolearn=unavailable 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 57EA8C2B9F8 for ; Tue, 25 May 2021 04:03:02 +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 1498D6141D for ; Tue, 25 May 2021 04:03:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1498D6141D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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=gDpmIlOPHEUX/6hTt5MhTPdWEYQDsutW1iXN4cKj3lA=; b=Q8MHp4wzWew9Ik +vPNWm/UleDdAmMe2NAI70mpAhy2kHzsaJpmW7smj1ZoDcPHcEqsWig8sVyX9+GGLWB760OeKsw9X blktkI/Fi1dhbtNDrHyACvWJbMZKawXXTM3wvvLPRKh/Fw9/tAj5xFLg3zlXy+AtdXxt0vLZJHJup CogtjYQDorRn4uKmI8K2Ez7vmoPj4rBr4W5rzFrX+DBIqwkiJHYUaXJ69d0O1TdpVYQGLnwwwB6Av WCNGLTTTmZDkRHpFi/Tj2v6U/43C6U6KdUtIaRkLybb+J4loCtRKFlSqrn0cCBv9qvACWg6+lyIv/ QhQZm9Ec8RZqT+12dtpQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1llOEJ-003Fai-Ry; Tue, 25 May 2021 03:59:44 +0000 Received: from mail-ot1-x32f.google.com ([2607:f8b0:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1llODQ-003FMV-VN for linux-arm-kernel@lists.infradead.org; Tue, 25 May 2021 03:58:50 +0000 Received: by mail-ot1-x32f.google.com with SMTP id n3-20020a9d74030000b029035e65d0a0b8so5965965otk.9 for ; Mon, 24 May 2021 20:58:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=PYCLMkEW+70ZigxLY6fmQ8dsM2q44x8Y2+ykUv3XIXI=; b=H/DNaR8iAlpSqa0esisrNprCRmPr13QukJqyvgKoswi/uVSRceh8FbYO0f0yn8wWr2 5CxdFWvAqaandf7G4vv2VMokMy8X5uWVh4cXcK4HAER3PBoCW0Y4HtzoeDWl66MO6dJG Wauw5mQMhH1SEPq3IdTEFF0NJMZkCP7B0dHxRU0jZhmyZTl1QFYwILexn5De6rQ3wGw6 DY1TkP7fHk+5dhtVBzIdhBKmFXi8aQaD8jyGRx55FyI+l/g0EVHIZZZYx9IaGFFpgrRt 0EeC6i/xjruU4te9J3va4X8xT62jGLkA8yfvhNCQ/kLabt6QioFKbJENa2+UGEOImzdY jXNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=PYCLMkEW+70ZigxLY6fmQ8dsM2q44x8Y2+ykUv3XIXI=; b=PPzS6KjO0JZ0z5euExlEKXHP4SDENAPkl2fimVqoVqyuvQI+jYrPQZ+TN8bsMSS3Fo CxcDx7Mc2wgV++jvSDSRdvRI+Qyt36Q8uUlg+r4RCe44ecME/F3Qe9zkuB8T4xzuFnD8 7RlOyxfFRKDyMR/I9STePxR6D3IgX3kdBoSQvEJma1iRB+iBI2N0NYg4CRPI7zD6LeK5 Xjq01p/GRS4J4mXomHbkBAHijUvgJHcEavcs/obws4rJd4RGnoiPzwJ8VShcSAnv2Rbm BW0fwfxmzq50qyZZSCQIgSFzvXYhohRuBAW6byftsit57VMB77e9/n7QnaQUiz7A6/wY hdnA== X-Gm-Message-State: AOAM532jTqXmEUCFmCdQVArT8hhWBhHklfKYdVwEXlLAXcOAIrvjQ+1Z ZuiCRkW76Kb2OXNe+BzsY+VHOw== X-Google-Smtp-Source: ABdhPJyZXjYefLWliDSQvzVJp/OI2fPtOpIRZ7Tdcbr5odCMqVIiAaZVb8gEVfZxmY1u5CrCa2S9kg== X-Received: by 2002:a05:6830:1687:: with SMTP id k7mr22164926otr.220.1621915128032; Mon, 24 May 2021 20:58:48 -0700 (PDT) Received: from yoga (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id 35sm3587790oth.49.2021.05.24.20.58.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 20:58:47 -0700 (PDT) Date: Mon, 24 May 2021 22:58:45 -0500 From: Bjorn Andersson To: Shawn Guo Cc: Will Deacon , Robin Murphy , Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH v3] iommu/arm-smmu-qcom: hook up qcom_smmu_impl for ACPI boot Message-ID: References: <20210509022607.17534-1-shawn.guo@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210509022607.17534-1-shawn.guo@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210524_205849_062841_6A599D35 X-CRM114-Status: GOOD ( 23.41 ) 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 Sat 08 May 21:26 CDT 2021, Shawn Guo wrote: > The hookup with qcom_smmu_impl is required to do ACPI boot on SC8180X > based devices like Lenovo Flex 5G laptop and Microsoft Surface Pro X. > Define acpi_platform_list for these platforms and match them using > acpi_match_platform_list() call, and create qcom_smmu_impl accordingly. > > (np == NULL) is used to check ACPI boot, because fwnode of SMMU device > is a static allocation and thus helpers like has_acpi_companion() don't > work here. > Reviewed-by: Bjorn Andersson Regards, Bjorn > Signed-off-by: Shawn Guo > --- > Changes for v3: > - Call acpi_match_platform_list() to match platform in qcom smmu > driver rather than IORT code. > > Changes for v2: > - Rather than using asl_compiler_id in IORT table, follow suggestion > from Robin Murphy to use acpi_match_platform_list() to match platform. > > drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c > index 98b3a1c2a181..f7e187f3fa66 100644 > --- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c > +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c > @@ -3,6 +3,7 @@ > * Copyright (c) 2019, The Linux Foundation. All rights reserved. > */ > > +#include > #include > #include > #include > @@ -339,10 +340,22 @@ static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { > { } > }; > > +static struct acpi_platform_list qcom_acpi_platlist[] = { > + { "LENOVO", "CB-01 ", 0x8180, ACPI_SIG_IORT, equal, "QCOM SMMU" }, > + { "QCOM ", "QCOMEDK2", 0x8180, ACPI_SIG_IORT, equal, "QCOM SMMU" }, > + { } > +}; > + > struct arm_smmu_device *qcom_smmu_impl_init(struct arm_smmu_device *smmu) > { > const struct device_node *np = smmu->dev->of_node; > > + if (np == NULL) { > + /* Match platform for ACPI boot */ > + if (acpi_match_platform_list(qcom_acpi_platlist) >= 0) > + return qcom_smmu_create(smmu, &qcom_smmu_impl); > + } > + > if (of_match_node(qcom_smmu_impl_of_match, np)) > return qcom_smmu_create(smmu, &qcom_smmu_impl); > > -- > 2.17.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel