From: Will Deacon Subject: Re: [RFC][PATCH] iommu/arm: Add hotplugged devices support for arm-smmu. Date: Wed, 12 Mar 2014 16:23:23 +0000 Message-ID: <20140312162323.GH9691@mudshark.cambridge.arm.com> References: <1394305540-16352-1-git-send-email-Varun.Sethi@freescale.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1394305540-16352-1-git-send-email-Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Varun Sethi Cc: "iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org" List-Id: iommu@lists.linux-foundation.org Hi Varun, On Sat, Mar 08, 2014 at 07:05:40PM +0000, Varun Sethi wrote: > Currently the ARM SMMU driver only considers the bus master devices in the device > tree. The master device and stream ID information is maintained per SMMU. Currently > there is no mechanism for representing this information in case of PCI or hot > plugged devices. > > This RFC patch proposes a mechanism for representing this information for hot > plugged/PCI devices. > > Patch doesn't contain the add_device callback modification for hot plug devices. > This would be bus specific and would be responsible for populating the hot plug > devices masters list for the SMMU. > > Signed-off-by: Varun Sethi > --- > drivers/iommu/arm-smmu.c | 93 ++++++++++++++++++++++++++++++++++++++++++++-- > 1 file changed, 90 insertions(+), 3 deletions(-) > > diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c > index 1d9ab39..6c10df4 100644 > --- a/drivers/iommu/arm-smmu.c > +++ b/drivers/iommu/arm-smmu.c > @@ -327,6 +327,9 @@ struct arm_smmu_master { > * SMMU chain. > */ > struct rb_node node; > + /* Following fields correspond to the hot plug masters */ > + struct list_head hotplug_masters_node; > + struct device *dev; I'd much rather have one list for all masters. Distinguishing between masters and `hotplug masters' is unnecessary. > +static int is_device_hotplug(struct device *dev) > +{ > + return (dev->bus != &platform_bus_type) && > + (dev->bus != &amba_bustype); > +} I'm not fond of this. Why not rework what we currently have so that it can work for other (hotpluggable) buses? Will