Received: by 10.223.176.46 with SMTP id f43csp680873wra; Fri, 26 Jan 2018 05:18:07 -0800 (PST) X-Google-Smtp-Source: AH8x226E4ev1mcuM2Azy+W5Gr6dYOnRcOY6AvvNmnmeaoHOjCdXGGuFFHQTHk0EN1thxpViZvySp X-Received: by 10.99.188.2 with SMTP id q2mr11867642pge.67.1516972687587; Fri, 26 Jan 2018 05:18:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516972687; cv=none; d=google.com; s=arc-20160816; b=qOEvNqA3zOPUeXIsV+YkWbo8kHbB0FMg9V+uuqe4E5eYa39nU+EJHTnpGKR+J0M5/K eauK+9XmmSDud3CGWJzJ77yfBzDHQeSPjotrw+lTd+Kn5hGwK9IoEvA4yCG/dL14m3Fd 5sCTKgUIM7PqKteIQdI4/gbj8RQW0BM0+p1Ts80vOKaAEthACIf/2jIlyvFDDo+drhjm 0dJRPCUSInrXoaBtIjTUltkJu51vMSEvbhR+ePFepHcIQuKr7SyaWelWnrHr59gKI+Wx 23BG80gJk7eEsKOCLyiZOQeDrMnuDbvtq+kQGkS5lpSFpUd4r6yz2N8uPT4FIIqDQNg4 F14Q== 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:organization:from:references:cc:to:subject :arc-authentication-results; bh=navbTrSeTrjFVdw1/07qFt/Jr1DmYno8mq94BukL9W8=; b=Aryu/oTuARxciH7zoEp/uBfXypjVtmJ83R3U1yKNYpc/CFe7Jmu5L+AwaDd3XFik/i JveQf+w8IeEKersjUi+oQntplHOL9WXCZ8Qlmu+QjK0NUVshZOew3NeHAconkQCkWnfC 7ubev1r1X7Yz4dOfGxLW8WLjIvU5ITTCWu/fQL+MLfzjLJKUwYr3QdEQjkgiGDx7eRkG y/ncW/IDxUBJFW9VBg33AbsNRy1KVEm/uFZUP/73XpIEmAwjah7xRYJcxeJ8BAtOcZ4r g0nMNqKcqSFoBtdCP5Y9kuci74rcRT6GH9eh9aXO6aJsAatIs4aHP4MMVPnk0CzOWTbB hGFQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e1-v6si3707223pli.294.2018.01.26.05.17.51; Fri, 26 Jan 2018 05:18:07 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751530AbeAZNR1 (ORCPT + 99 others); Fri, 26 Jan 2018 08:17:27 -0500 Received: from foss.arm.com ([217.140.101.70]:46826 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751377AbeAZNR0 (ORCPT ); Fri, 26 Jan 2018 08:17:26 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 43DB21435; Fri, 26 Jan 2018 05:17:26 -0800 (PST) Received: from [10.1.207.62] (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A04643F53D; Fri, 26 Jan 2018 05:17:23 -0800 (PST) Subject: Re: [PATCH v5 2/2] staging: fsl-mc: Move irqchip code out of staging To: Bogdan Purcareata , gregkh@linuxfoundation.org, laurentiu.tudor@nxp.com, ruxandra.radulescu@nxp.com Cc: stuyoder@gmail.com, arnd@arndb.de, robh@kernel.org, ioana.ciornei@nxp.com, nipun.gupta@nxp.com, roy.pledge@nxp.com, horia.geanta@nxp.com, tglx@linutronix.de, jason@lakedaemon.net, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20180126125127.26439-1-bogdan.purcareata@nxp.com> <20180126125127.26439-3-bogdan.purcareata@nxp.com> From: Marc Zyngier Organization: ARM Ltd Message-ID: <31df6b54-a115-85fb-b66f-9345c97df9cf@arm.com> Date: Fri, 26 Jan 2018 13:17:22 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180126125127.26439-3-bogdan.purcareata@nxp.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26/01/18 12:51, Bogdan Purcareata wrote: > Now that the fsl-mc bus core infrastructure is out of staging, the > remaining irqchip glue code used (irq-gic-v3-its-fsl-mc-msi.c) goes > to drivers/irqchip. > > Signed-off-by: Stuart Yoder > [rebased, add dpaa2_eth and dpio #include updates] > Signed-off-by: Laurentiu Tudor > [rebased, split irqchip to separate patch] > Signed-off-by: Bogdan Purcareata > Cc: Thomas Gleixner > Cc: Jason Cooper > Cc: Marc Zyngier > --- > Notes: > -v5: > - split irqchip glue code to separate patch (GregKH) > -v4 - v1: > - no change > > drivers/irqchip/Makefile | 1 + > drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c | 100 +++++++++++++++++++++ > drivers/staging/fsl-mc/bus/Makefile | 3 +- > .../staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c | 100 --------------------- > 4 files changed, 102 insertions(+), 102 deletions(-) > create mode 100644 drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c > delete mode 100644 drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c > > diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile > index d2df34a..641d8a4 100644 > --- a/drivers/irqchip/Makefile > +++ b/drivers/irqchip/Makefile > @@ -32,6 +32,7 @@ obj-$(CONFIG_ARM_GIC_V2M) += irq-gic-v2m.o > obj-$(CONFIG_ARM_GIC_V3) += irq-gic-v3.o irq-gic-common.o > obj-$(CONFIG_ARM_GIC_V3_ITS) += irq-gic-v3-its.o irq-gic-v3-its-platform-msi.o irq-gic-v4.o > obj-$(CONFIG_ARM_GIC_V3_ITS_PCI) += irq-gic-v3-its-pci-msi.o > +obj-$(CONFIG_FSL_MC_BUS) += irq-gic-v3-its-fsl-mc-msi.o > obj-$(CONFIG_PARTITION_PERCPU) += irq-partition-percpu.o > obj-$(CONFIG_HISILICON_IRQ_MBIGEN) += irq-mbigen.o > obj-$(CONFIG_ARM_NVIC) += irq-nvic.o > diff --git a/drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c b/drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c > new file mode 100644 > index 0000000..b365fbb > --- /dev/null > +++ b/drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c > @@ -0,0 +1,100 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Freescale Management Complex (MC) bus driver MSI support > + * > + * Copyright (C) 2015-2016 Freescale Semiconductor, Inc. > + * Author: German Rivera > + * > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +static struct irq_chip its_msi_irq_chip = { > + .name = "ITS-fMSI", > + .irq_mask = irq_chip_mask_parent, > + .irq_unmask = irq_chip_unmask_parent, > + .irq_eoi = irq_chip_eoi_parent, > + .irq_set_affinity = msi_domain_set_affinity > +}; > + > +static int its_fsl_mc_msi_prepare(struct irq_domain *msi_domain, > + struct device *dev, > + int nvec, msi_alloc_info_t *info) > +{ > + struct fsl_mc_device *mc_bus_dev; > + struct msi_domain_info *msi_info; > + > + if (!dev_is_fsl_mc(dev)) > + return -EINVAL; > + > + mc_bus_dev = to_fsl_mc_device(dev); > + if (!(mc_bus_dev->flags & FSL_MC_IS_DPRC)) > + return -EINVAL; > + > + /* > + * Set the device Id to be passed to the GIC-ITS: > + * > + * NOTE: This device id corresponds to the IOMMU stream ID > + * associated with the DPRC object (ICID). > + */ > +#ifdef GENERIC_MSI_DOMAIN_OPS > + info->scratchpad[0].ul = mc_bus_dev->icid; > +#endif I'd really like to avoid this kind of condition in irqchip drivers. Either the architecture you're targeting this at can deal with it, and you can compile this driver, or it doesn't, and you really shouldn't offer it. And given that this thing is 100% specific to the ARM GICv3 ITS, you should really have a dependency on it. Thanks, M. -- Jazz is not dead. It just smells funny...