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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70D41C433EF for ; Tue, 10 May 2022 12:43:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237389AbiEJMrO (ORCPT ); Tue, 10 May 2022 08:47:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234623AbiEJMrM (ORCPT ); Tue, 10 May 2022 08:47:12 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2C251209B; Tue, 10 May 2022 05:43:15 -0700 (PDT) Received: from canpemm500009.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4KyHkM6qnxzhZ3l; Tue, 10 May 2022 20:42:35 +0800 (CST) Received: from [10.67.102.169] (10.67.102.169) by canpemm500009.china.huawei.com (7.192.105.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 10 May 2022 20:43:13 +0800 CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v7 1/7] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity To: Will Deacon References: <20220407125841.3678-1-yangyicong@hisilicon.com> <20220407125841.3678-2-yangyicong@hisilicon.com> <20220510112326.GA27790@willie-the-truck> From: Yicong Yang Message-ID: Date: Tue, 10 May 2022 20:43:13 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <20220510112326.GA27790@willie-the-truck> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.102.169] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500009.china.huawei.com (7.192.105.203) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On 2022/5/10 19:23, Will Deacon wrote: > On Thu, Apr 07, 2022 at 08:58:35PM +0800, Yicong Yang wrote: >> The DMA operations of HiSilicon PTT device can only work properly with >> identical mappings. So add a quirk for the device to force the domain >> as passthrough. >> >> Signed-off-by: Yicong Yang >> --- >> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 16 ++++++++++++++++ >> 1 file changed, 16 insertions(+) > > I still don't like this being part of the SMMU driver, but given that > (a) Robin doesn't seem to agree with the objection and (b) you've been > refreshing the patch series: > > Acked-by: Will Deacon > > If you do respin, then: > >> diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c >> index 627a3ed5ee8f..5ec15ae2a9b1 100644 >> --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c >> +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c >> @@ -2839,6 +2839,21 @@ static int arm_smmu_dev_disable_feature(struct device *dev, >> } >> } > > It might be worth adding a brief comment here to explain what this device is > and why it needs an identity mapping. > >> +#define IS_HISI_PTT_DEVICE(pdev) ((pdev)->vendor == PCI_VENDOR_ID_HUAWEI && \ >> + (pdev)->device == 0xa12e) > Will add a brief comment here in next version. Thanks, Yicong