From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x2247IjcE3DBcExcI8sfGMnJyL+QkJEQrnUte6zXjDv8eIdeMiiz1uldd2ER/AZ2JuMbozHC4 ARC-Seal: i=1; a=rsa-sha256; t=1516972647; cv=none; d=google.com; s=arc-20160816; b=wq+jY+UVrC/lVLT++ENlxS4nRqcATsIS+46RQ4aZTVazVfXvaRs3soTzJGwhdX3gCX sjV3kAUVr8m1Z6knadh/QU11NWrBnZPBUnDgE6KsMAS3eRNkxgZNTcSYdxJQjltMWpxy 376kOxRHMyrKlHDA5tAl0KMS6x7s8PV3eZACYNXAcj86g0tJfVfloz8MotxOS6mcwSNm e7kkS+aEp7naucyR1vALPSZ3cqy7+L4UIa/gws3tsMroLsAzzaqPbbiXQWCumbUFPZii S18o4Hm13/2blURKjPtGjX+T1wKppPbBj4KvgU3gZd2f+8GM+4buo8/JES8MGf5LKXA1 p/ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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=XJLXYOnw2uzQ3eAIt4oyoW5IlBHwmY9mTY+MwyIBcCobsezVqKenxrKNbTaqUHtn1n vgBtQ85M7JBuvlsH2boazlX2XTyf3XCKga7IhNUmoT5XofoQGkCX3iNY9RYgbi6xHjJQ 9wNU/OfGdRiAVoXsTgv6ZI48bZgqkSJJTUmqiR832kgiiw5fKCY1IfVygsohTLEE2Q/A oiNlq1jAfEVnX3dFz18CMwmP366NEpwiZ9zHSAlANYCK/hFxkt+LfhoV3Td15KA0NMqv BQQ6f4b/eH1CdZukS1a/fMUoks8/FS1dWcNPDvJAmo8PlIGGd6VzGQ1+WVUY23hoUpIg GKjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of marc.zyngier@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=marc.zyngier@arm.com Authentication-Results: mx.google.com; spf=pass (google.com: domain of marc.zyngier@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=marc.zyngier@arm.com 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1590659528424089725?= X-GMAIL-MSGID: =?utf-8?q?1590661110402546089?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 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...