Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4713405pxf; Tue, 23 Mar 2021 18:55:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLpw89V/1lkkXdYVQEP30RW1io0Qte4vPOC/IWegrgFIbVegjAb+aNgxM7AQdpCWVUV2GR X-Received: by 2002:a17:906:3488:: with SMTP id g8mr1080863ejb.282.1616550930940; Tue, 23 Mar 2021 18:55:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616550930; cv=none; d=google.com; s=arc-20160816; b=SCwtyeF+YVQ5ohOc0Rzcp5iG9+KwhMEitcqPOUUAp/yYXlh0cpq7dRamRPYwBT3PZn ObmlsKYX57F02ZV1h7IttGAiZdDLB5s3mY4m/XTxVFkTkiVwNT0hxiXQqPNW7gfxkWil n9taJgF2PV+NumG5bycXmqdoo+jqoEXmDaNDYraOnILFdlyTZuLtr8YbFh6Yi2e3DAu0 Oh/wpFY+maa0DSnGG6YisCNH8Dyza19dkxlWnD448tP6tJSe1pqvaqHmXO9yUK1I0WmH eq8epEnfp6qGZra2vRRbTF+01Z52g35Oz2ete27yp50x6xekv6yQ7Xa9pHIibYN440XY BHFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=a/N0F7IkZlOOHZTuc05oX4e82SoGxtLiEHQKMRAsXRY=; b=aaxQiV9n0BDo6WgHUXessQmusDGsORq8jB+bd4K95NcV9LEyM27k3XSmTqTYqnrnGG c7RJsH3Jw19A8N7yaYkiHamcRXu3kKwDw06IDJr6GkVnqq467JUVKjRdF23266HAC945 colhJed2YwAQLZygCyzt4eIcO8woI8iVcZ//zD7qCQPb1TfCaiFN4agYMhW76zFOxU6a 2BKXq5o3An0WuCTgqrBy0wpvKYHCpNic7hNUyqSJ6kVaEVNNsU4INKoSW/3TRqcc2WCc ZrkypZXwhaWRGsw/15iTwtz9zvXKmliiohOYKERTDy/ZLbLNgPYxOK1GxxmsVkwUsYGL YIXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t13si582205ejf.189.2021.03.23.18.55.08; Tue, 23 Mar 2021 18:55:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232099AbhCWN7m (ORCPT + 99 others); Tue, 23 Mar 2021 09:59:42 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:2732 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232113AbhCWN7U (ORCPT ); Tue, 23 Mar 2021 09:59:20 -0400 Received: from fraeml744-chm.china.huawei.com (unknown [172.18.147.207]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4F4Xqz3cftz682Vk; Tue, 23 Mar 2021 21:52:47 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml744-chm.china.huawei.com (10.206.15.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Tue, 23 Mar 2021 14:59:14 +0100 Received: from [10.47.11.95] (10.47.11.95) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Tue, 23 Mar 2021 13:59:13 +0000 Subject: Re: [PATCH 3/3] iova: Correct comment for free_cpu_cached_iovas() To: Robin Murphy , , , , CC: , , References: <1614600741-15696-1-git-send-email-john.garry@huawei.com> <1614600741-15696-4-git-send-email-john.garry@huawei.com> <87b4af01-2352-e963-824f-1cea1a6ee718@arm.com> From: John Garry Message-ID: Date: Tue, 23 Mar 2021 13:56:58 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: <87b4af01-2352-e963-824f-1cea1a6ee718@arm.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.47.11.95] X-ClientProxiedBy: lhreml747-chm.china.huawei.com (10.201.108.197) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/03/2021 13:05, Robin Murphy wrote: > On 2021-03-01 12:12, John Garry wrote: >> Function free_cpu_cached_iovas() is not only called when a CPU is >> hotplugged, so remove that part of the code comment. > > FWIW I read it as clarifying why this is broken out into a separate > function vs. a monolithic "free all cached IOVAs" routine that handles > both the per-cpu and global caches > it never said "*only* used..." It seems to be implying that. It's only a code comment, so I don't care too much either way and can drop this change. > > As such I'd hesitate to call it incorrect, but it's certainly arguable > whether it needs to be stated or not, especially once the hotplug > callsite is now obvious in the same file - on which note the function > itself also shouldn't need to be public any more, no? > Right, I actually missed deleting iommu_dma_free_cpu_cached_iovas(), so can fix that now. Cheers, John > Robin. > >> Signed-off-by: John Garry >> --- >>   drivers/iommu/iova.c | 2 +- >>   1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/iommu/iova.c b/drivers/iommu/iova.c >> index c78312560425..465b3b0eeeb0 100644 >> --- a/drivers/iommu/iova.c >> +++ b/drivers/iommu/iova.c >> @@ -996,7 +996,7 @@ static void free_iova_rcaches(struct iova_domain >> *iovad) >>   } >>   /* >> - * free all the IOVA ranges cached by a cpu (used when cpu is unplugged) >> + * free all the IOVA ranges cached by a cpu >>    */ >>   void free_cpu_cached_iovas(unsigned int cpu, struct iova_domain *iovad) >>   { >> > .