Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2739862ybh; Mon, 16 Mar 2020 08:48:55 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsbMe53CamfAQ5C8RrLrVtnhewT/jcqh6QADIAmLlOwZgAhc/wbhR/4nnxR1Kl82FlUQ7Es X-Received: by 2002:a9d:6ac6:: with SMTP id m6mr6168598otq.198.1584373735042; Mon, 16 Mar 2020 08:48:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584373735; cv=none; d=google.com; s=arc-20160816; b=zgPl/SHfT/Lnka7kHbo1mvuHtYeyFIVBGXxRGtbCgCaJI/Ys6CJ5tq8mT1raflXQpb FtBVugYKFQZiM4pyTNGYBUinTFFYEo5aIR5tNBvZijnWRKP4dleIpQQP/lHW2+X04u0c xETMBtkhJ3ljHh+2D7x2BHM5pwDwWiQkzEUycrYJpb1crWZrTbZdfo7kXpceza56bys2 4l253PxV4XPiJRMJStmizlUewIMq78tZ/dSWthebVGOSNzWtW4LnS/6quj9qdRWCfLv1 8xCXh/SH31oq3x3F117avZ3vg1t4cCRAorwPGOxOt0JhzbDk6iBzOYKFdu7OZ1dJWTPe QRUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=J+yCX5u1YDN6eK0N92vhv3vwdN0qX/QOnRznwSw/NEU=; b=SSIbELgkmBli0nNrQF25w76VdzdtnMeW/hC/z5Z9jf/jcsGRJ0KBe3UmJgBAMqjrEI 9a8dyfMqVBo6Gb9YqDj01zc+YBxISPCUsrErv/igtC1N9+lMloDwQ0lFaV6DsExXFmOJ ZqMQKLbF0PO7rhrSzXWlQhpYQP/dnQKHJotFr0bUO4tOxdJDKEsolEjYJojfZjanj4Oi 9mcGehZGIALjI5EQciMowdPtVy+IHTQyAPTectzHgS4Zn8dc0kFgYnOoce8n9RXxyie5 xaaeK0SaI9W9aJOFQa81v+15Pm9rSIqN4IeWjR7c2aiC2uU8EGBYAq+znog+lBuzHZaq UZOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="wqEM+8T/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j18si163606oib.191.2020.03.16.08.48.43; Mon, 16 Mar 2020 08:48:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="wqEM+8T/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731946AbgCPPsB (ORCPT + 99 others); Mon, 16 Mar 2020 11:48:01 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:46296 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731914AbgCPPsB (ORCPT ); Mon, 16 Mar 2020 11:48:01 -0400 Received: by mail-wr1-f66.google.com with SMTP id w16so5431835wrv.13 for ; Mon, 16 Mar 2020 08:47:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=J+yCX5u1YDN6eK0N92vhv3vwdN0qX/QOnRznwSw/NEU=; b=wqEM+8T/4h/xHj/JCPK+rRTCXxcVR4eDf7FRmVy6tL77x3zHH/AiX26KSVcpaAUPYM H2E3TxgVcsUZps0ZwbKrOGHGA1w+q7Tk9JZyHOG4r0miXlsNK9DAr6ASz77gWGMYoThi aqIcdck8zrW9cmOsVNIVfmvriv2jyBKV2gCHKWxDzNBhDSaeuNibLyNo1rN/KPESbvGx bYFXAMI7K3kXwTe2xy6IA/A4hJbQRhpt2ZZKRbDn2/H/Lo/rmmzCexG9w/kcno6ZiI77 ppej5XGet0RlmPFvfqjzVDbUXtrDAc80RMkysk6JhzvWsm3/Qn/rhmBAkBM9JFQCl/h+ nSCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=J+yCX5u1YDN6eK0N92vhv3vwdN0qX/QOnRznwSw/NEU=; b=aZxtNJ+tCw/3WUnUlEjumfjaTb4pDu1jWVkI65WLvNH3fBV9auCYjbOUa726dFKA0/ MNcLZj7m56BX4tFx01iRoVV79yiob9nMw6k0KCJbhMBjg3VEUndM77VFLduM9v0UyE2T am9KZBXM/GwOmFrK9+9CCyvwn3TH7JHO6wadGbZJlVzPNOTOobMKriF5IhJF8EeKyJTh TQsEIElD6Mo+UbpTuRXtTnBdlmPuxiVJLvLWXE074QBbepiAUiZT2QJ5hmookGBoV96N tA/xWXb+rFZhWaGfisneZEGR8c644Jv2q3zN+RzmtwSlY/SNKWAYTxvEIPfQLoHxCXNR qbFA== X-Gm-Message-State: ANhLgQ2vEzWjuoK2Ufy1oYWOJZaJsUdNdMYyHBr5wbiFiVGY68hd/bm0 KK7Y/3rvF2Qkj0iC7wBjtrYTQQ== X-Received: by 2002:adf:f510:: with SMTP id q16mr6841064wro.43.1584373677809; Mon, 16 Mar 2020 08:47:57 -0700 (PDT) Received: from myrica ([2001:171b:226b:54a0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id l7sm488506wrw.33.2020.03.16.08.47.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2020 08:47:57 -0700 (PDT) Date: Mon, 16 Mar 2020 16:47:49 +0100 From: Jean-Philippe Brucker To: Joerg Roedel Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, virtualization@lists.linux-foundation.org, Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , Rob Clark , Sean Paul , Will Deacon , Robin Murphy , Matthias Brugger , Thierry Reding , Andy Gross , Bjorn Andersson , Joerg Roedel Subject: Re: [PATCH 08/15] iommu: Introduce accessors for iommu private data Message-ID: <20200316154749.GI304669@myrica> References: <20200310091229.29830-1-joro@8bytes.org> <20200310091229.29830-9-joro@8bytes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200310091229.29830-9-joro@8bytes.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 10, 2020 at 10:12:22AM +0100, Joerg Roedel wrote: > From: Joerg Roedel > > Add dev_iommu_priv_get/set() functions to access per-device iommu > private data. This makes it easier to move the pointer to a different > location. > > Tested-by: Will Deacon # arm-smmu > Signed-off-by: Joerg Roedel Reviewed-by: Jean-Philippe Brucker > --- > include/linux/iommu.h | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/include/linux/iommu.h b/include/linux/iommu.h > index f5edc21a644d..056900e75758 100644 > --- a/include/linux/iommu.h > +++ b/include/linux/iommu.h > @@ -627,6 +627,16 @@ static inline void dev_iommu_fwspec_set(struct device *dev, > dev->iommu->fwspec = fwspec; > } > > +static inline void *dev_iommu_priv_get(struct device *dev) > +{ > + return dev->iommu->fwspec->iommu_priv; > +} > + > +static inline void dev_iommu_priv_set(struct device *dev, void *priv) > +{ > + dev->iommu->fwspec->iommu_priv = priv; > +} > + > int iommu_probe_device(struct device *dev); > void iommu_release_device(struct device *dev); > > -- > 2.17.1 >