Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1674935pxk; Tue, 1 Sep 2020 05:08:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5EelwFFY6C+iOZo/b6xct36O2UF5KTYGylvXgTvKhYm773YJOpqlky06GJZNopgiH6G+q X-Received: by 2002:a50:8d87:: with SMTP id r7mr1441129edh.26.1598962086329; Tue, 01 Sep 2020 05:08:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598962086; cv=none; d=google.com; s=arc-20160816; b=dmmyftHrLJ52zDb5Mda3Mq6dud4pqTq4oZuZv7LK9zDb52JE7bG0lYRwjsuE6a8Zcc HbSfXxLWX8sX75Stu+cv+wO2TFcLuwsT0m/qkNz4u1eHG/U14wZBRwFYfzNGl2ZmBoDb yhyGQa/yaSmbyxmMudBGhB1E605dFSFEMjv2uwYTY4v2dm+c8hqWiOZZw7uMxjZpAsab +fT+vaLIbdfkK/4LJeBvXx8LFDhNXyXnjevt2xGNQsYmQrAvEwbp1m+BrMdnRtQAo7kf MRNdS+iY9g4ytIrbzC5Ncj56eHntXCrMJpRdReJlp7rKUCMuGkJptbjPJXnKd9xKJoTJ ndtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:subject:from:dkim-signature; bh=ESRP55Rg69yEwDMYjivqnTqvuKK7oN+Pled0DdWVsmg=; b=MUnFSo1g+0wUKSyASFjgTIQeNsSNuL4QRKWkw0u5yi0wMD/X1qq6u6EkkXKJFxHrBM IVb9iv3QDELwZkncLSAH6Q0bvQhgs+X9uz97rKKa0uHPz3R6Ps63mFaOYzaRDy4tdIWg Hz57+ssWj0R/+rTp8BZKhIIqscob+c/1aACkIcc9kGQDhAjkuSIS7wzVb0JyUxoW3jXS AFKu/NoQ+V7isrbk8AD78a6BYG+690xO61JLU0Mz4fcdUI2qPGjlgV+7gm0vVOC5J6Zu fx3ImUswqnx3ImZSyUVvKmQtOJy6gXYS9y3m2/a5gUFeG87wxxKZYZ7IAY85H34Rm7Pu Vg+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=R5FCLmAF; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gs14si509273ejb.615.2020.09.01.05.07.43; Tue, 01 Sep 2020 05:08:06 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=R5FCLmAF; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727025AbgIAMEB (ORCPT + 99 others); Tue, 1 Sep 2020 08:04:01 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:38174 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727049AbgIALvl (ORCPT ); Tue, 1 Sep 2020 07:51:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598961099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ESRP55Rg69yEwDMYjivqnTqvuKK7oN+Pled0DdWVsmg=; b=R5FCLmAFqqd9FjLUQDg07EV9NH/ZFVRvlChjkgGZAnrztzIDmIsosnqKO1QnaFDgn2n2jA vT0E/XmAHVcg3ZnU82JZXScIVRMPYP73T2uDU7SecHyrKucLYGX93DKCUT1L/maMahozix eFP8jH3E8jdBJs0t66mnfwuuSbgOvPQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-21-mmEQVsJONMuZ0kRtnv8r2Q-1; Tue, 01 Sep 2020 07:51:35 -0400 X-MC-Unique: mmEQVsJONMuZ0kRtnv8r2Q-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 652C510ABDAB; Tue, 1 Sep 2020 11:51:33 +0000 (UTC) Received: from [10.36.112.51] (ovpn-112-51.ams2.redhat.com [10.36.112.51]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B908319C4F; Tue, 1 Sep 2020 11:51:30 +0000 (UTC) From: Auger Eric Subject: Re: [PATCH v2 2/9] iommu/ioasid: Rename ioasid_set_data() To: Jacob Pan , iommu@lists.linux-foundation.org, LKML , Jean-Philippe Brucker , Lu Baolu , Joerg Roedel , David Woodhouse Cc: Yi Liu , "Tian, Kevin" , Raj Ashok , Wu Hao References: <1598070918-21321-1-git-send-email-jacob.jun.pan@linux.intel.com> <1598070918-21321-3-git-send-email-jacob.jun.pan@linux.intel.com> Message-ID: Date: Tue, 1 Sep 2020 13:51:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <1598070918-21321-3-git-send-email-jacob.jun.pan@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi jacob, On 8/22/20 6:35 AM, Jacob Pan wrote: > Rename ioasid_set_data() to ioasid_attach_data() to avoid confusion with > struct ioasid_set. ioasid_set is a group of IOASIDs that share a common > token. > > Signed-off-by: Jacob Pan Reviewed-by: Eric Auger Eric > --- > drivers/iommu/intel/svm.c | 6 +++--- > drivers/iommu/ioasid.c | 6 +++--- > include/linux/ioasid.h | 4 ++-- > 3 files changed, 8 insertions(+), 8 deletions(-) > > diff --git a/drivers/iommu/intel/svm.c b/drivers/iommu/intel/svm.c > index b6972dca2ae0..37a9beabc0ca 100644 > --- a/drivers/iommu/intel/svm.c > +++ b/drivers/iommu/intel/svm.c > @@ -342,7 +342,7 @@ int intel_svm_bind_gpasid(struct iommu_domain *domain, struct device *dev, > svm->gpasid = data->gpasid; > svm->flags |= SVM_FLAG_GUEST_PASID; > } > - ioasid_set_data(data->hpasid, svm); > + ioasid_attach_data(data->hpasid, svm); > INIT_LIST_HEAD_RCU(&svm->devs); > mmput(svm->mm); > } > @@ -394,7 +394,7 @@ int intel_svm_bind_gpasid(struct iommu_domain *domain, struct device *dev, > list_add_rcu(&sdev->list, &svm->devs); > out: > if (!IS_ERR_OR_NULL(svm) && list_empty(&svm->devs)) { > - ioasid_set_data(data->hpasid, NULL); > + ioasid_attach_data(data->hpasid, NULL); > kfree(svm); > } > > @@ -437,7 +437,7 @@ int intel_svm_unbind_gpasid(struct device *dev, int pasid) > * the unbind, IOMMU driver will get notified > * and perform cleanup. > */ > - ioasid_set_data(pasid, NULL); > + ioasid_attach_data(pasid, NULL); > kfree(svm); > } > } > diff --git a/drivers/iommu/ioasid.c b/drivers/iommu/ioasid.c > index 0f8dd377aada..5f63af07acd5 100644 > --- a/drivers/iommu/ioasid.c > +++ b/drivers/iommu/ioasid.c > @@ -258,14 +258,14 @@ void ioasid_unregister_allocator(struct ioasid_allocator_ops *ops) > EXPORT_SYMBOL_GPL(ioasid_unregister_allocator); > > /** > - * ioasid_set_data - Set private data for an allocated ioasid > + * ioasid_attach_data - Set private data for an allocated ioasid > * @ioasid: the ID to set data > * @data: the private data > * > * For IOASID that is already allocated, private data can be set > * via this API. Future lookup can be done via ioasid_find. > */ > -int ioasid_set_data(ioasid_t ioasid, void *data) > +int ioasid_attach_data(ioasid_t ioasid, void *data) > { > struct ioasid_data *ioasid_data; > int ret = 0; > @@ -287,7 +287,7 @@ int ioasid_set_data(ioasid_t ioasid, void *data) > > return ret; > } > -EXPORT_SYMBOL_GPL(ioasid_set_data); > +EXPORT_SYMBOL_GPL(ioasid_attach_data); > > /** > * ioasid_alloc - Allocate an IOASID > diff --git a/include/linux/ioasid.h b/include/linux/ioasid.h > index 6f000d7a0ddc..9c44947a68c8 100644 > --- a/include/linux/ioasid.h > +++ b/include/linux/ioasid.h > @@ -39,7 +39,7 @@ void *ioasid_find(struct ioasid_set *set, ioasid_t ioasid, > bool (*getter)(void *)); > int ioasid_register_allocator(struct ioasid_allocator_ops *allocator); > void ioasid_unregister_allocator(struct ioasid_allocator_ops *allocator); > -int ioasid_set_data(ioasid_t ioasid, void *data); > +int ioasid_attach_data(ioasid_t ioasid, void *data); > > #else /* !CONFIG_IOASID */ > static inline ioasid_t ioasid_alloc(struct ioasid_set *set, ioasid_t min, > @@ -67,7 +67,7 @@ static inline void ioasid_unregister_allocator(struct ioasid_allocator_ops *allo > { > } > > -static inline int ioasid_set_data(ioasid_t ioasid, void *data) > +static inline int ioasid_attach_data(ioasid_t ioasid, void *data) > { > return -ENOTSUPP; > } >