Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp5924829iob; Tue, 10 May 2022 06:51:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXlNU+/MRvmb+hIGxP+y2OR+9B2gG2UHUtEcdQxcMMTq2HFPBTh2b6h10+r4u5LXOFJG+x X-Received: by 2002:aa7:d44d:0:b0:425:ecf1:e0bd with SMTP id q13-20020aa7d44d000000b00425ecf1e0bdmr23612887edr.309.1652190661557; Tue, 10 May 2022 06:51:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652190661; cv=none; d=google.com; s=arc-20160816; b=Qc4cEND7mwoQmyELdFefKKnc/lfsg7udbaX5eF3Bu4/B+zeXl6KwyyP5VYaYYBO2gz urg/rABoo3QtAeGhauVYKVYvs3kSh21M6itYPRAJdXBtlV//qHkVBLDurW5pz5Tb91ok WwjGpAplT6ifnNZ9jGyVRHkAiS4te0Kh3XIVU77O+tEpJBjxbOQ2c9K/8c8lgPX/llg4 5oI3CqCys3ePyLgWijkrzhGBJRnsgVQJP9nnNww/NGIvkkfy45S+vOCUEGKRqT8n6Hrs aG/QXkjiOjXlP3Hd6Acb73dr/TO7/tj28ee7jYBrv2G/NPkqoekwpSgSqr4ZqPFJlfAf fQDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:to:subject :cc; bh=6b8IekYJhZ7RTDgsExizw8PMGXPiVdLxaG+6wtRoFQQ=; b=XKPWaFPqkvxOS3oBRLeUMCacD52TTUpVmG/9SMTUj+7+pvT6q1ditIw7edno5WIwGj XiVqEBwtPhTb6Ujqw652Nx+tu6TOL5XnHgNWmRg5mmnwnoywATX/4Vtc+MevHaLxcayP WUsdnJJLgsntfwU2+BUvHz1UJfWw/8llJ4YoMMPreiiTTLuqBZt09WcxcukVtttDS7pF uzBlaCn938d2sbGCJQ39lVrC+LieEYbtgvSUAZ7gZF3aCK9bcVbJcMXxwrJZPLEbuEam 5LKUbLJf42j65UIq5W6oTqv/ZHXkAKpbhM0tKFr9YhkvOCotj24+BBkt+zrYPdogubZu BHkw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s3-20020a056402520300b00425d7c23c18si19200860edd.385.2022.05.10.06.50.36; Tue, 10 May 2022 06:51:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241591AbiEJMrP (ORCPT + 99 others); Tue, 10 May 2022 08:47:15 -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 X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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