Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp550975ybm; Wed, 27 May 2020 02:04:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHUdrZKI4Kw6umfmNbfJtp7ePCXzyEilWE7sGLtqe9nkJSdhOzfTXafaw/TkvmdNHV5iCd X-Received: by 2002:aa7:cd15:: with SMTP id b21mr1913234edw.384.1590570240912; Wed, 27 May 2020 02:04:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590570240; cv=none; d=google.com; s=arc-20160816; b=zFkHJM2VOUKJFBEA7YMObKpNW2iisb8XsLCJMEJu99LkJP3HHbUG3q2owWndNxEHPw UwAsQwKMvMg8hexVt074sqjKvpbm8mJVEsNAHUZdMUj4vZ7gtCN7/9QfLtd++APUjMx2 DhzRsa44tHJVyT8FfYIqzxQ5aDBSS2EdJEBxFpTwy197q8XbJk2ZkaVcHVhIOA1SBS3r tGp8Mlzb2VJgPPbUREG8/p2jf5yM/QUo5XUdtAs7jSfpz49HpB/sKjFg7uJ/7fvoED6O pAsfOKMiMzNkut7Qwl/8f2QDlqjk7SVG+kiQrJbsWg5vR0MEFs7DGi0j+yddGBSxoGPa l/Hg== 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=+6DR/+9DGOqJEH7Hmf0MlHAeZlxAHNon9ufanKrbWfg=; b=OyffkLPAtC9Dq4t9WQJ602IC8Ie4Sg3cmOkxp777WMlIj7GJNGOMecBqvIFXr/+hNJ NOdIJNwxLZIzHiAwMcqZ+qPqfpR9+YkAbdC4o8dGYU6WibilvE4d+5Tjgf/niaJdJhJy UFKKvsVjvrASoX48S0XXijxnakuVpzRoPCZ84GdZAjNW4cCnp2Ipccoyz9To6NBWi6rx MgF1MqaWQDWSzc6daAFA+peAHAlZrpp567p2VtAFHiYfqN59UvO+dnkEjjUMbRjCeRqs LXt4UYHaOz6W3CCU1fDgAlFYV6guY69wDLix1ZmJFKy+zqAabrDjatmZmkDnPJCKTXXC SrYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mGy3UQlK; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dt20si1493951ejb.311.2020.05.27.02.03.37; Wed, 27 May 2020 02:04:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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=@kernel.org header.s=default header.b=mGy3UQlK; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388362AbgE0JBS (ORCPT + 99 others); Wed, 27 May 2020 05:01:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:35200 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388331AbgE0JBS (ORCPT ); Wed, 27 May 2020 05:01:18 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1184920723; Wed, 27 May 2020 09:01:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590570077; bh=WaKZbkte9zWy+gFwJcABM4VB+ItBxdRy7nyXN7rBb3o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mGy3UQlKkCSG671Ydi7G9PDHAXHw3tvtIYrcoZsk94xWH7NkmD8YF+mjSEFmwocHn dx9nTApSCbCQ2C0rP4Wh0RmwLgzASHW4OVNvv0tAMviYc/4qJ0+c7Nh6YkoAjWCiYF MbwANd2b+y59F8114ucQHxhJVnTvz7S8zkgTDHe8= Date: Wed, 27 May 2020 11:01:15 +0200 From: Greg Kroah-Hartman To: Zhangfei Gao Cc: Joerg Roedel , Bjorn Helgaas , Arnd Bergmann , Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , "Rafael J. Wysocki" , Len Brown , jean-philippe , Herbert Xu , kenneth-lee-2012@foxmail.com, Wangzhou , linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, iommu@lists.linux-foundation.org, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org Subject: Re: [PATCH 2/2] iommu: calling pci_fixup_iommu in iommu_fwspec_init Message-ID: <20200527090115.GB179718@kroah.com> References: <1590493749-13823-1-git-send-email-zhangfei.gao@linaro.org> <1590493749-13823-3-git-send-email-zhangfei.gao@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1590493749-13823-3-git-send-email-zhangfei.gao@linaro.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, May 26, 2020 at 07:49:09PM +0800, Zhangfei Gao wrote: > Calling pci_fixup_iommu in iommu_fwspec_init, which alloc > iommu_fwnode. Some platform devices appear as PCI but are > actually on the AMBA bus, and they need fixup in > drivers/pci/quirks.c handling iommu_fwnode. > So calling pci_fixup_iommu after iommu_fwnode is allocated. > > Signed-off-by: Zhangfei Gao > --- > drivers/iommu/iommu.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c > index 7b37542..fb84c42 100644 > --- a/drivers/iommu/iommu.c > +++ b/drivers/iommu/iommu.c > @@ -2418,6 +2418,10 @@ int iommu_fwspec_init(struct device *dev, struct fwnode_handle *iommu_fwnode, > fwspec->iommu_fwnode = iommu_fwnode; > fwspec->ops = ops; > dev_iommu_fwspec_set(dev, fwspec); > + > + if (dev_is_pci(dev)) > + pci_fixup_device(pci_fixup_iommu, to_pci_dev(dev)); Why can't the caller do this as it "knows" it is a PCI device at that point in time, right? thanks, greg k-h