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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 7C665C27C55 for ; Fri, 7 Jun 2024 08:07:20 +0000 (UTC) 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:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yJW7cvKFzEJngCp/y96tiBJ1sZfDezJyMVwmHT+uhsY=; b=okNXV75mtfaGxH ICLYqnNNq3ADBLlZ+elyF9FlUSJuOt267dFwbWagQEXRxdQBBJlBiLkvosdI1+kVNbLF8Y/LTcgwT qOv8DiKiG3Bg74SJJ0FAMTKgiy9WMoDyRDXkiyH6tjT3Y5nwtKdpAgS2ZuQZFKQcmylRGxkK5gonB XZMzAH1ep3E3DbGe9XRV6xewsVlQ7S4Sz6L8zH3Sj46lbApByWAbZVMwXPNdtd7n4403V2AE93mq5 85cf4rlQTX9zRjtueVoixVkibHNBwl218MKBib+HgCzqZ8buFHLydhbdKOxq1kIUGqxW8hRvnZ5ov 2neGMFO6Iiuvf5DB0hsw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sFUcr-0000000D3sZ-0diZ; Fri, 07 Jun 2024 08:07:05 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sFUco-0000000D3pI-046G for linux-arm-kernel@lists.infradead.org; Fri, 07 Jun 2024 08:07:04 +0000 Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4VwYfC3zmfzdZjq; Fri, 7 Jun 2024 16:05:23 +0800 (CST) Received: from dggems704-chm.china.huawei.com (unknown [10.3.19.181]) by mail.maildlp.com (Postfix) with ESMTPS id 88DE914037F; Fri, 7 Jun 2024 16:06:48 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (7.191.163.240) by dggems704-chm.china.huawei.com (10.3.19.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Fri, 7 Jun 2024 16:04:47 +0800 Received: from lhrpeml500005.china.huawei.com ([7.191.163.240]) by lhrpeml500005.china.huawei.com ([7.191.163.240]) with mapi id 15.01.2507.039; Fri, 7 Jun 2024 09:04:45 +0100 From: Shameerali Kolothum Thodi To: Nicolin Chen CC: "iommu@lists.linux.dev" , "linux-arm-kernel@lists.infradead.org" , "robin.murphy@arm.com" , "will@kernel.org" , "joro@8bytes.org" , "jgg@nvidia.com" , "ryan.roberts@arm.com" , "kevin.tian@intel.com" , "mshavit@google.com" , "eric.auger@redhat.com" , "joao.m.martins@oracle.com" , jiangkunkun , zhukeqian , Linuxarm Subject: RE: [PATCH v5 3/6] iommu/arm-smmu-v3: Add feature detection for HTTU Thread-Topic: [PATCH v5 3/6] iommu/arm-smmu-v3: Add feature detection for HTTU Thread-Index: AQHauBZ4GMbpI//3skeO1mpud6e6MLG7TJwAgACWzdA= Date: Fri, 7 Jun 2024 08:04:45 +0000 Message-ID: References: <20240606133302.17540-1-shameerali.kolothum.thodi@huawei.com> <20240606133302.17540-4-shameerali.kolothum.thodi@huawei.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.202.227.28] MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240607_010702_428921_BBB23349 X-CRM114-Status: GOOD ( 20.05 ) 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 > -----Original Message----- > From: Nicolin Chen > Sent: Friday, June 7, 2024 12:11 AM > To: Shameerali Kolothum Thodi > Cc: iommu@lists.linux.dev; linux-arm-kernel@lists.infradead.org; > robin.murphy@arm.com; will@kernel.org; joro@8bytes.org; > jgg@nvidia.com; ryan.roberts@arm.com; kevin.tian@intel.com; > mshavit@google.com; eric.auger@redhat.com; joao.m.martins@oracle.com; > jiangkunkun ; zhukeqian > ; Linuxarm > Subject: Re: [PATCH v5 3/6] iommu/arm-smmu-v3: Add feature detection for > HTTU > > Hi Shameer, > > Some nitpicking inline. Thanks for taking a look Nicolin. > > On Thu, Jun 06, 2024 at 02:32:59PM +0100, Shameer Kolothum wrote: > > > 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 e30ce55ed1af..c05a74aa52a4 100644 > > --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > > +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > > @@ -3738,6 +3738,29 @@ static void arm_smmu_device_iidr_probe(struct > arm_smmu_device *smmu) > > } > > } > > > > +static void arm_smmu_get_httu(struct arm_smmu_device *smmu, u32 > reg) > > Following the other helper arm_smmu_device_iidr_probe, how about > arm_smmu_device_httu_probe? Hmm..I don't have any objection per se but "_get_" feels like more simple and straightforward to me. Let me know if you feel strongly about this. > And we could pass in FIELD_GET(IDR0_HTTU, reg) too? Same here. > > > +{ > > + u32 fw_features = smmu->features & (ARM_SMMU_FEAT_HA | > ARM_SMMU_FEAT_HD); > > + u32 httu = FIELD_GET(IDR0_HTTU, reg); > > + u32 features = 0; > > How about "hw_feats" v.s. "fw_feats"? Ok. > > > + > > + switch (httu) { > > + case IDR0_HTTU_ACCESS_DIRTY: > > + features |= ARM_SMMU_FEAT_HD; > > + fallthrough; > > + case IDR0_HTTU_ACCESS: > > + features |= ARM_SMMU_FEAT_HA; > > + } > > + > > + if (smmu->dev->of_node) > > + smmu->features |= features; > > + else if (features != fw_features) > > + /* ACPI IORT sets the HTTU bits */ > > + dev_warn(smmu->dev, > > + "IDR0.HTTU(0x%x) overridden by FW configuration > (0x%x)\n", > > + httu, fw_features); > > httu and fw_features have different shifts -- could be odd to see: > IDR0.HTTU(0x2) overridden by FW configuration (0x600000) > > FIELD_GET(ACPI_IORT_SMMU_V3_HTTU_OVERRIDE, iort_smmu->flags) > seems > to be overcomplicated to reference? So, how about just features? > + "IDR0.HTTU features (0x%x) overridden by FW > configuration (0x%x)\n", Yes. I think that make sense. Will change. Thanks, Shameer _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel