Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2733254ybh; Mon, 16 Mar 2020 08:41:01 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuZicJky4dcKl2K56lJVotxOHrFI+sxcWFeSVRHc3osJfiHjDb7YM/y8vyXI+9Heft7BNtp X-Received: by 2002:a05:6808:90f:: with SMTP id w15mr160189oih.0.1584373261721; Mon, 16 Mar 2020 08:41:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584373261; cv=none; d=google.com; s=arc-20160816; b=VOtCvLhgFLuxyZrMVJPpdr2VmxN8ljJyH50g2qFBVLoGFD0vaekpZLwMNkRaXyU29D f8OIlC41RezdE530KNnGkXapROKz89nn81HJs0C8Zns3tS61vBJScvt4c//oSJZOdKxH 15d/efd+C1gylcFnrUzVmHeVuPkzhW6/oZCMhMBdnLe4bKEze2Nip0RPLqE/Ovgc4dD2 qJmce6PfOZAFoAFJPaXQ6Yk4XZEVcCpPmRKEu2/wZ+t7pTlWO+gnVvYKdEKtOVezLbdw A5YNCWhbAABB4NIafl4NuJ/U4AO1WoinT+v9XUnKFEfUW1HwYKV6IOITM66lrYSv6FuW FFMg== 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=vJQ7s9x85ia8HxlMYprwaZJGn4L6RP+BR7+jWVKPLTo=; b=K4FZLWyhH1AO7PhTBbvMfhOS/u9C49j8DYotfnV5l5vGZky8rT8wej0GwneYFgoNS4 1HGO5RuIHhPoOaZFRbNP+ZzX3+32E74cqwOqjzuC5Oon8d5YxfWCB9FzUU8bnBD8xHfL rQHQJ/j+vpew5QC/ubxoNuyD7enbEFZANDEhmEdglgy97H9acNChRuzfNMSlkWjeeORq HO59y2vbopQQqJIXRZHbXSvrVN1Ly5kiP8Pgt2BX98D3f+j0wFn/uGJPYbsaf6YDrhRS djCe/CbNd/NBMTjG8evE9l4xzF2Js89jeIHVmLMshyGIc39tDl0F9bY7j0Flrie20OuT 5kgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w84O1QQJ; 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 w11si139484otp.239.2020.03.16.08.40.49; Mon, 16 Mar 2020 08:41:01 -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=w84O1QQJ; 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 S1731875AbgCPPkO (ORCPT + 99 others); Mon, 16 Mar 2020 11:40:14 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:38532 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731550AbgCPPkO (ORCPT ); Mon, 16 Mar 2020 11:40:14 -0400 Received: by mail-wr1-f65.google.com with SMTP id s1so91756wrv.5 for ; Mon, 16 Mar 2020 08:40:12 -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=vJQ7s9x85ia8HxlMYprwaZJGn4L6RP+BR7+jWVKPLTo=; b=w84O1QQJwU6wMTGEhyd3tdZmzyokkNQNgtvlgCbk7JrgRg0w2R3EtdUzes5TKo/XyE 0GN9BzerCd+PBe2gdX+VVWalWV0GvUaZ1Hvpn02xC7Z6cQbZ9zUYoVR8SlrMkeTHa5pO ZNV7G4zwVtMQAtwNFVsP7G9rAugODJUvegfg+Joz2/pLSwTVFLeBdLC69Mm9fmsFaT0H 4lQ985eQTWmn73BDP/WhhWDXVBZBfC45ZHQLQxe35G5uOfpUGYH7dFLUTw7I6qKsVqm6 VCf79+8VBzgdX46YQ4mkH13lYwMdQrGC6Ai/EhOinV88dF/tVd63mOiTbTus//PTo1AD eHZg== 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=vJQ7s9x85ia8HxlMYprwaZJGn4L6RP+BR7+jWVKPLTo=; b=mU1KArjaLdF/I0V4dFaLCWv3hUhi9KAbqXifL86HKoYUwBfmKF38qsn226MGkq/FMG 00VW7igsYthEVJM+NCVqEk6wEY6nwfz7ZwOxAcaYGlzZxvgW5iq7sigLEIj19akPYesF yF6LLsOeSf0XenLa3v7aZnDddYbKmS7Pj+Lh0WufyBCNMZKJ/CZ/QwMp52DCbOR6KBcF evOYSYf4d1oKdPrqhSGvi/WaHPNuBM9HN4o0Pmlkmm5Pi+Iagv2MMKi9/i8nEy5uWr+i QRHnRviuhN9ZCFD4K7UUcK4JT9nE7HdNnnb1/eZXCknCZ9QhPcIvOCpM0AJHBfOudyCz XIiw== X-Gm-Message-State: ANhLgQ2bzUv7eKOa5dbO755jAhG4yZHeTm1YFTYtlfnUj0Vub4kf3PFK wfVitVF1+im5Y0j6bHNJUQDaJg== X-Received: by 2002:a5d:4ad1:: with SMTP id y17mr29213545wrs.119.1584373212032; Mon, 16 Mar 2020 08:40:12 -0700 (PDT) Received: from myrica ([2001:171b:226b:54a0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id u17sm393519wrm.43.2020.03.16.08.40.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2020 08:40:11 -0700 (PDT) Date: Mon, 16 Mar 2020 16:40:03 +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 02/15] ACPI/IORT: Remove direct access of dev->iommu_fwspec Message-ID: <20200316154003.GC304669@myrica> References: <20200310091229.29830-1-joro@8bytes.org> <20200310091229.29830-3-joro@8bytes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200310091229.29830-3-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:16AM +0100, Joerg Roedel wrote: > From: Joerg Roedel > > Use the accessor functions instead of directly dereferencing > dev->iommu_fwspec. > > Tested-by: Hanjun Guo > Signed-off-by: Joerg Roedel Reviewed-by: Jean-Philippe Brucker > --- > drivers/acpi/arm64/iort.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c > index ed3d2d1a7ae9..7d04424189df 100644 > --- a/drivers/acpi/arm64/iort.c > +++ b/drivers/acpi/arm64/iort.c > @@ -1015,6 +1015,7 @@ const struct iommu_ops *iort_iommu_configure(struct device *dev) > return ops; > > if (dev_is_pci(dev)) { > + struct iommu_fwspec *fwspec; > struct pci_bus *bus = to_pci_dev(dev)->bus; > struct iort_pci_alias_info info = { .dev = dev }; > > @@ -1027,8 +1028,9 @@ const struct iommu_ops *iort_iommu_configure(struct device *dev) > err = pci_for_each_dma_alias(to_pci_dev(dev), > iort_pci_iommu_init, &info); > > - if (!err && iort_pci_rc_supports_ats(node)) > - dev->iommu_fwspec->flags |= IOMMU_FWSPEC_PCI_RC_ATS; > + fwspec = dev_iommu_fwspec_get(dev); > + if (fwspec && iort_pci_rc_supports_ats(node)) > + fwspec->flags |= IOMMU_FWSPEC_PCI_RC_ATS; > } else { > int i = 0; > > -- > 2.17.1 >