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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 036C4C433EF for ; Tue, 12 Oct 2021 03:38: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 BDCD66101D for ; Tue, 12 Oct 2021 03:38:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BDCD66101D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=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:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wUD1faeNHgetZ/0cvF6tEQlMOsUaCexbYt2abhydHFk=; b=yY+GCMY0yCcHop K1UITWzSvBVPgDI8JBR7OA9ttZyDDtBzi+XlAuRcgZC2KQdHpsIivbOOwyFpkkv2iseutLjCIIMw1 S6BRz6QtEdgXcVpJ+eyaMBN8ZICVIxcjaTdkNiWvTDYho//TiFgEPV0ggyMWVlaZpoFMOGe7hAXLm Km6IrbVBYbzFIrJ+lKRu7I+G9brHoggH3ZcVvFNBFfzhuVq5GKoJstcnYPZ7mwENA8UAGpYynL1jS 9wRLm7GkPO2biDybR3jk7Sk8wZgu6wj6em23lCQUwRbROt7FImal+4/4kHLeghUjo7qKXpr0GCl69 ARCSxJ/CqA+4SC1xiMuw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ma8aF-00BLdO-1t; Tue, 12 Oct 2021 03:36:07 +0000 Received: from mail-qv1-xf34.google.com ([2607:f8b0:4864:20::f34]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ma8aC-00BLcj-39 for linux-arm-kernel@lists.infradead.org; Tue, 12 Oct 2021 03:36:05 +0000 Received: by mail-qv1-xf34.google.com with SMTP id m13so11144397qvk.1 for ; Mon, 11 Oct 2021 20:36:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PuQBYQiE0//qwdR0lx7ufC/zx2o6SBXy6e/jdiWZvrU=; b=os/NuwEqCmcu0BrOeQfB4+n7QKmw1s47pBPDW8YOBVogWBAmvvbRsvbsJA46s5un4n eIzjs6xSLG8TCx9TycSaw6F9URHG/10SY7z/h9OBcxjvvNVWs0F15ZI/fMSyHTaGiGY/ gjLYecaGaHCYDEEtMUERWa8As1PEiyzLLFvGQWUqhPHcMJ4RlG1LXh1MpyV7a8nJ/ubX 6rVk6jca+FTiUatOC3sYtLC3jRs4hxLAIT2mkIWF4khFzpcSUdeY1xsGIxbnPai9Ckwd 03jBu5odwiHeSOV9gnYJJTuDUSG6gnsbQVRAYkV3ADgfGRa0UaoyWB5ysNN0imlQWFsq ipvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PuQBYQiE0//qwdR0lx7ufC/zx2o6SBXy6e/jdiWZvrU=; b=Ftj9fX+lc6t80HDOex/RAqFWkbsPxpisYWxPFxinjT4d3ihRXpgFxM6PPgdYzx9IKs 6go5br+TjZeRY3+5gbyS9arVMTfODfG4cKclphROl+MYJ3qOWoD43vtFB1Bazex4vBF8 0Q9r5L6ZmcmCqAvFFknWxS8aKcgvme+5LfniPA6r6tpCOfaEB92MJAMTNuIwqtffo9X8 ErJXty++9XK+dKFpJkK7moK6267imVshaQwe3sMuRq3z/A5v5UT7G0gXoK3IZalOch8f xhvk0J1Uzx9T3el3dRCNGwTiS78s4EsrppYVSwYVjpDwKQuvhtL7VtfMqW2PHVxWMcHb 1SJA== X-Gm-Message-State: AOAM533nlq6ybyO2lP/MPr/OiXHOg60wHF4GAv6nNCRMFleSyh+eieRd kqd46er3THcxaCUFg64hXF27qL2f8FI9sYPNZ2IjSA== X-Google-Smtp-Source: ABdhPJxlbpmzun2i5ifUkeHpsWQA8qd+5ZG5Cd31eOgNJQa6VTEb8HUSywYsLuVpWrVbDUjc6Uz4EsHBYXxFEF/i6bg= X-Received: by 2002:a0c:fad0:: with SMTP id p16mr255245qvo.3.1634009763022; Mon, 11 Oct 2021 20:36:03 -0700 (PDT) MIME-Version: 1.0 References: <20211010023350.978638-1-dmitry.baryshkov@linaro.org> In-Reply-To: From: Dmitry Baryshkov Date: Tue, 12 Oct 2021 06:35:51 +0300 Message-ID: Subject: Re: [PATCH] iommu: fix ARM_SMMU vs QCOM_SCM compilation To: Arnd Bergmann Cc: Bjorn Andersson , Joerg Roedel , Will Deacon , Robin Murphy , Kalle Valo , Thierry Reding , Andy Gross , linux-arm-msm , "open list:IOMMU DRIVERS" , Linux Kernel Mailing List , Linux ARM , Daniel Lezcano X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211011_203604_158856_4D5BFE2F X-CRM114-Status: GOOD ( 32.73 ) 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 Sun, 10 Oct 2021 at 20:42, Arnd Bergmann wrote: > > On Sun, Oct 10, 2021 at 6:17 AM Bjorn Andersson > wrote: > > > > On Sat 09 Oct 21:33 CDT 2021, Dmitry Baryshkov wrote: > > > > > After commit 424953cf3c66 ("qcom_scm: hide Kconfig symbol") arm-smmu got > > > qcom_smmu_impl_init() call guarded by IS_ENABLED(CONFIG_ARM_SMMU_QCOM). > > > However the CONFIG_ARM_SMMU_QCOM Kconfig entry does not exist, so the > > > qcom_smmu_impl_init() is never called. > > > > > > So, let's fix this by always calling qcom_smmu_impl_init(). It does not > > > touch the smmu passed unless the device is a non-Qualcomm one. Make > > > ARM_SMMU select QCOM_SCM for ARCH_QCOM. > > Sorry about this bug. I was sure I had it working, but I lost part of the commit > during a rebase, and my randconfig builds still succeeded without it, so I > sent a wrong version. > > > Arnd's intention was to not force QCOM_SCM to be built on non-Qualcomm > > devices. But as Daniel experienced, attempting to boot most Qualcomm > > boards without this results in a instant reboot. > > > > I think it's okay if we tinker with CONFIG_ARM_SMMU_QCOM for v5.16, but > > we're getting late in v5.15 so I would prefer if we make sure this works > > out of the box. > > Yes, makes sense. For reference, see below for how I would fix this properly, > this is what I had intended to have in the patch. Feel free to pick > either version > as the immediate bugfix. I'll give the below a little more randconfig testing > overnight though. The pasted version of the patch is probably > whitespace-damaged, > let me know if you would like me to send it as a proper patch. > > Arnd > > 8<----- > Subject: iommu: fix ARM_SMMU_QCOM compilation > > My previous bugfix ended up making things worse for the QCOM IOMMU > driver when it forgot to add the Kconfig symbol that is getting used to > control the compilation of the SMMU implementation specific code > for Qualcomm. > > Fixes: 424953cf3c66 ("qcom_scm: hide Kconfig symbol") > Reported-by: Daniel Lezcano > Reported-by: Dmitry Baryshkov > Signed-off-by: Arnd Bergmann Reviewed-by: Dmitry Baryshkov Let's get either of them in. > ---- > diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig > index c5c71b7ab7e8..2dfe744ddd97 100644 > --- a/drivers/iommu/Kconfig > +++ b/drivers/iommu/Kconfig > @@ -311,6 +311,7 @@ config ARM_SMMU > select IOMMU_API > select IOMMU_IO_PGTABLE_LPAE > select ARM_DMA_USE_IOMMU if ARM > + select QCOM_SCM if ARM_SMMU_QCOM > help > Support for implementations of the ARM System MMU architecture > versions 1 and 2. > @@ -355,6 +356,13 @@ config ARM_SMMU_DISABLE_BYPASS_BY_DEFAULT > 'arm-smmu.disable_bypass' will continue to override this > config. > > +config ARM_SMMU_QCOM > + def_bool y > + depends on ARM_SMMU && ARCH_QCOM > + help > + When running on a Qualcomm platform that has the custom variant > + of the ARM SMMU, this needs to be built into the SMMU driver. > + > config ARM_SMMU_V3 > tristate "ARM Ltd. System MMU Version 3 (SMMUv3) Support" > depends on ARM64 -- With best wishes Dmitry _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel