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.3 required=3.0 tests=BAYES_00, 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 DD8E1C04FF3 for ; Mon, 24 May 2021 12:09:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BA0FA610A6 for ; Mon, 24 May 2021 12:09:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232476AbhEXMLJ (ORCPT ); Mon, 24 May 2021 08:11:09 -0400 Received: from foss.arm.com ([217.140.110.172]:41516 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232110AbhEXMLJ (ORCPT ); Mon, 24 May 2021 08:11:09 -0400 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 8C2A931B; Mon, 24 May 2021 05:09:40 -0700 (PDT) Received: from [10.57.73.64] (unknown [10.57.73.64]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 29CBC3F719; Mon, 24 May 2021 05:09:39 -0700 (PDT) Subject: Re: [PATCH v3] iommu/arm-smmu-qcom: hook up qcom_smmu_impl for ACPI boot To: Shawn Guo , Will Deacon Cc: Bjorn Andersson , Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org References: <20210509022607.17534-1-shawn.guo@linaro.org> <20210523060505.GB29015@dragon> From: Robin Murphy Message-ID: Date: Mon, 24 May 2021 13:09:32 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210523060505.GB29015@dragon> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On 2021-05-23 07:05, Shawn Guo wrote: > On Sun, May 09, 2021 at 10:26:07AM +0800, 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. >> >> Signed-off-by: Shawn Guo >> --- >> Changes for v3: >> - Call acpi_match_platform_list() to match platform in qcom smmu >> driver rather than IORT code. > > Hi Robin, > > How does this version look? So good that I glanced at it, thought "nice!", then having no remaining concerns promptly moved on to something else forgot about it. Sorry about that! Reviewed-by: Robin Murphy Cheers, Robin. > Shawn > >> >> 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 >>