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,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 72A64C2B9F7 for ; Mon, 24 May 2021 16:47:46 +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 2F298613F6 for ; Mon, 24 May 2021 16:47:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2F298613F6 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-Type: Content-Transfer-Encoding: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=XwrGQaQYQVLtQsRnveTV29FktKXlkWzmY8qX0DAgMWA=; b=Sm98L4QMTeSs0hXq9D1PlLVYi 8kpiQxgRnvKRz9XTcZA1xgEjCYdrUCCpYVvXF/tRaOUhi/fcVg74z6VfxWn/vyVN9tocvkeTLgwBN N81BD7ZZmNgwegZJmrv/uRFBHZh4wiouh/Enxfs4HQ+/5QTcLj3DOFsEWGRZOPHPu5oOvP3z5mf4D GGf9dUTL8KtltfyVVxmsjSFj7VqCOOLEjX5it8nFWOElUU00aB3W00qHJuCrzuu40vZeDS85JOTbG q9oTzMmunH7GENbV/8rH+yAcC8Din/4Q1K4Mgf3vjAn+PsSLqQ3s/rQa52BLhZRNTRAvpFVxX+XHr 6AtVH0jIQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1llDi2-0019fG-IY; Mon, 24 May 2021 16:45:44 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1ll9P8-000tx2-U4 for linux-arm-kernel@lists.infradead.org; Mon, 24 May 2021 12:09:56 +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 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-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210524_050955_049771_719985B0 X-CRM114-Status: GOOD ( 22.54 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 >> _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel