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.5 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, 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 8517DC433DB for ; Sun, 28 Mar 2021 08:46:20 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 1CBE86196C for ; Sun, 28 Mar 2021 08:46:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1CBE86196C 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=desiato.20200630; 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=dxCY64kbMEvUvzI0SgC41N0YgMQpumHjSUJMQRxazaU=; b=PC5POQNpR8HmLxS6G50rVBjho mGXoKAiYAgX6eOVLLYeV9oZxmbbClYxMoknJantYOy6uMD5y40WdtrY8Snq1J3nsMySY8IiZrbQ8g fNZJkMisIaI+4xu+JOV2stp6O52oFQRZzplSaT4+btWOQfKdRDAIHAs6e30yhpuIQPvvpDhl4mtOt q4DL0Y/Dype2UMF89AD7BplDcB8Tdzh7MFjuCYKVAjZUsecN2U3PdVjmM9W7rvMRzWvQpY/i/My6T B3Ep5Cxo6wCaDz/MtRnXG7flM81C/GJIYKjyePgJPL0omoakWTJseRuAhshmDMKPYmArxvZSCsnSG PU2H6Dhgw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lQR25-0062Eu-Og; Sun, 28 Mar 2021 08:44:29 +0000 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lQR20-0062E2-GV for linux-arm-kernel@lists.infradead.org; Sun, 28 Mar 2021 08:44:26 +0000 Received: by mail-pl1-x62e.google.com with SMTP id e14so2960614plj.2 for ; Sun, 28 Mar 2021 01:44:20 -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:user-agent; bh=k7DNSySKD5MKuy3jeurqGQcSktq1fou282VSwzZ8yXY=; b=F9Fe+2sbDcz+y67SRvhYF8tAfkw8a4tPP/BbTmR2Er/yods7GIBLL5dev9nqJAKNS4 SzAyCQGGP1cYjFnN3z8xbEd03N4ekxEePFrqYVmZJAahxA0Tkt8il+4Ba5gHWu1FMdLJ hBEP49TLND8E3j6/GnKsUFmu6utq0O8U1ADCqUY75rYBjxDtAxrtsaL9bljIeFfVrHZP hcJpbp5bdAf7Ck1diUNjb+waaWhajrVt6vWl0zWZpUNsMrzT8PP/GoG1lOus3oiN4QVD Z3DOsTTxVAS2K/RCgY1qEoHrUt8vA0Q1CRvj3OR6kJ1ZpCVcZuaJ7a3DfN/H3POOiitJ YxsQ== 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:user-agent; bh=k7DNSySKD5MKuy3jeurqGQcSktq1fou282VSwzZ8yXY=; b=S7F+FpN3gPOTvyclG+Bx0yqxTZXrc2SREmV7dHvvAhmtRrsIe8DO4T8XP9EUYoLRiJ A36IaULhb3Wo/C5L/1G1G5okfLpqDcvi/SoOtHiWvXFUlGfvpGKbEiPbJSZdUqPbiZ3a 0XSQCswLWopNYkQqVsG6Mwp4bvezrPiDtIBrN+WeoHoi23OGwy3aWpptZJjo3DL46gtH +u5/Er+7C5gfWqPoVyjdgqp2AiWgI6p1OQJrTqee0QT3HP/FBoSqIO4ttpt3pSwiEkl7 AvRKiGSkobHK0LEP64tjNw0jnTMM7N95RdVEADdgD7pZqrRZJwhvZsbHba0+WA3BZQby iLMg== X-Gm-Message-State: AOAM532OFCKArld8ulX3Em5NTAQjlmxa+mSE0e/R5d/vfPKTASpRYtBo XOqHqrHfER+Yjp9dBRUnpx654Q== X-Google-Smtp-Source: ABdhPJzwa0oOhI412a1utddSj0DLOdkQyPGRS6iRZS3TRG5DNG8kyW3RqCdnd1ZNFtpkpAClx6woeg== X-Received: by 2002:a17:902:9a45:b029:e6:1444:5287 with SMTP id x5-20020a1709029a45b02900e614445287mr23440562plv.54.1616921059143; Sun, 28 Mar 2021 01:44:19 -0700 (PDT) Received: from dragon (80.251.214.228.16clouds.com. [80.251.214.228]) by smtp.gmail.com with ESMTPSA id v19sm14700193pfc.183.2021.03.28.01.44.16 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 28 Mar 2021 01:44:18 -0700 (PDT) Date: Sun, 28 Mar 2021 16:44:12 +0800 From: Shawn Guo To: Robin Murphy Cc: Bjorn Andersson , Will Deacon , lorenzo.pieralisi@arm.com, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH] iommu/arm-smmu-qcom: create qcom_smmu_impl for ACPI boot Message-ID: <20210328084411.GB24152@dragon> References: <20210301074021.20059-1-shawn.guo@linaro.org> <20210325145914.GC15172@willie-the-truck> <20210325170256.GA904837@yoga> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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-20210328_094424_814169_9C5D66EF X-CRM114-Status: GOOD ( 28.97 ) 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 Thu, Mar 25, 2021 at 05:07:52PM +0000, Robin Murphy wrote: > On 2021-03-25 17:02, Bjorn Andersson wrote: > > On Thu 25 Mar 09:59 CDT 2021, Will Deacon wrote: > > > > > [+ Lorenzo] > > > > > > On Mon, Mar 01, 2021 at 03:40:21PM +0800, Shawn Guo wrote: > > > > Though qcom_adreno_smmu_impl is not used by ACPI boot right now, > > > > qcom_smmu_impl is already required at least to boot up Lenovo Flex 5G > > > > laptop. Let's check asl_compiler_id in IORT header to ensure we are > > > > running a QCOM SMMU and create qcom_smmu_impl for it. > > > > > > > > !np is used to check ACPI boot, because fwnode of SMMU device is > > > > a static allocation and thus has_acpi_companion() doesn't work here. > > > > > > > > Signed-off-by: Shawn Guo > > > > --- > > > > drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 33 ++++++++++++++++++++++ > > > > 1 file changed, 33 insertions(+) > > > > > > I don't know what a "asl_compiler_id" is, but it doesn't sound like it > > > has an awful lot to do with the SMMU. > > > > > > > I would prefer that we somehow relate this to the particular board, > > rather than all Qualcomm-related ACPI tables. E.g. by relying on the > > SMMU devices having a _HID of QCOM0409. > > > > Shawn, any reason for this wouldn't be possible? > > To do something broadly similar to identify HiSilicon's SMMU PMCG > implementation, we use acpi_match_platform_list() - could we do the same for > this? Thanks for the suggestion, Robin! Yes, acpi_platform_list is useful for our problem as well. But we will need multiple entries even for a single Snapdragon SoC. For example, both Lenovo Flex 5G and Microsoft Surface Pro X are powered by Snapdragon SC8180X, but their IORT tables have different fields that acpi_match_platform_list() is looking at. If this is not a problem, yeah, acpi_platform_list is a better way out, and I will start updating the patch. Shawn * Lenovo Flex 5G [000h 0000 4] Signature : "IORT" [IO Remapping Table] [004h 0004 4] Table Length : 00001943 [008h 0008 1] Revision : 00 [009h 0009 1] Checksum : DA [00Ah 0010 6] Oem ID : "LENOVO" [010h 0016 8] Oem Table ID : "CB-01 " [018h 0024 4] Oem Revision : 00008180 [01Ch 0028 4] Asl Compiler ID : "QCOM" [020h 0032 4] Asl Compiler Revision : 00000001 * Microsoft Surface Pro X [000h 0000 4] Signature : "IORT" [IO Remapping Table] [004h 0004 4] Table Length : 0000169C [008h 0008 1] Revision : 00 [009h 0009 1] Checksum : 3A [00Ah 0010 6] Oem ID : "QCOM " [010h 0016 8] Oem Table ID : "QCOMEDK2" [018h 0024 4] Oem Revision : 00008180 [01Ch 0028 4] Asl Compiler ID : "QCOM" [020h 0032 4] Asl Compiler Revision : 00000001 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel