Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: slash.tmp@free.fr (Mason)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 1/2] PCI: Add tango MSI controller support
Date: Wed, 31 May 2017 23:55:37 +0200	[thread overview]
Message-ID: <8bbdc8a4-98a5-ae13-ff0f-d644307986d5@free.fr> (raw)
In-Reply-To: <20170531200424.GA23171@bhelgaas-glaptop.roam.corp.google.com>

On 31/05/2017 22:04, Bjorn Helgaas wrote:

> Cscope only sees 94 definitions of irq_set_affinity.  I know *I* could
> never write a script faster than looking at them manually.

for F in $(find -name '*.c'); do
  if grep -q pci_msi_create_irq_domain $F; then
    grep 'irq_set_affinity\s*=' $F | cut -f2 -d= | tr -d ',;' | while read CALLBACK
    do
      Y=$(grep -A4 "$CALLBACK(struct" $F)
      echo $Y | grep static
    done
  fi
done

static int ls_scfg_msi_set_affinity(struct irq_data *irq_data, const struct cpumask *mask, bool force) { return -EINVAL; }
static int armada_370_xp_msi_set_affinity(struct irq_data *irq_data, const struct cpumask *mask, bool force) { return -EINVAL; }
static int armada_xp_set_affinity(struct irq_data *d, const struct cpumask *mask_val, bool force) { irq_hw_number_t hwirq = irqd_to_hwirq(d);
static int nwl_msi_set_affinity(struct irq_data *irq_data, const struct cpumask *mask, bool force) { return -EINVAL; }
static int hv_set_affinity(struct irq_data *data, const struct cpumask *dest, bool force) { struct irq_data *parent = data->parent_data;
static int xgene_msi_set_affinity(struct irq_data *irqdata, const struct cpumask *mask, bool force) { int target_cpu = cpumask_first(mask); int curr_cpu;
static int vmd_irq_set_affinity(struct irq_data *data, const struct cpumask *dest, bool force) { return -EINVAL; }
static int altera_msi_set_affinity(struct irq_data *irq_data, const struct cpumask *mask, bool force) { return -EINVAL; }
static int advk_msi_set_affinity(struct irq_data *irq_data, const struct cpumask *mask, bool force) { return -EINVAL; }
static int iproc_msi_irq_set_affinity(struct irq_data *data, const struct cpumask *mask, bool force) { struct iproc_msi *msi = irq_data_get_irq_chip_data(data);

> While doing that, I noticed irq_chip_set_affinity_parent(), which is
> used in 14 cases and appears similar to your patch.

Indeed. I suppose msi_domain_set_affinity() could look like below,
if we don't mind changing EINVAL to ENOSYS. What do you think?

diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
index ddc2f5427f75..d37d2ba790df 100644
--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -87,11 +87,10 @@ static inline void irq_chip_write_msi_msg(struct irq_data *data,
 int msi_domain_set_affinity(struct irq_data *irq_data,
                            const struct cpumask *mask, bool force)
 {
-       struct irq_data *parent = irq_data->parent_data;
        struct msi_msg msg;
        int ret;
 
-       ret = parent->chip->irq_set_affinity(parent, mask, force);
+       ret = irq_chip_set_affinity_parent(irq_data, mask, force);
        if (ret >= 0 && ret != IRQ_SET_MASK_OK_DONE) {
                BUG_ON(irq_chip_compose_msi_msg(irq_data, &msg));
                irq_chip_write_msi_msg(irq_data, &msg);

  reply	other threads:[~2017-05-31 21:55 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-20 14:24 [PATCH v4 0/2] Tango PCIe controller support Marc Gonzalez
2017-04-20 14:28 ` [PATCH v4 1/2] PCI: Add tango MSI " Marc Gonzalez
2017-05-17 14:56   ` Marc Gonzalez
2017-05-23 17:03     ` Bjorn Helgaas
2017-05-23 17:54       ` Mason
2017-05-23 18:03         ` Robin Murphy
2017-05-23 19:15           ` Mason
2017-05-24 10:00             ` Robin Murphy
2017-05-24 10:22               ` Marc Zyngier
2017-05-31 14:18                 ` Mason
2017-05-31 17:34                   ` Bjorn Helgaas
2017-05-31 18:49                     ` Mason
2017-05-31 19:00                       ` Bjorn Helgaas
2017-05-31 19:12                         ` Bjorn Helgaas
2017-05-31 19:27                           ` Mason
2017-05-31 20:04                             ` Bjorn Helgaas
2017-05-31 21:55                               ` Mason [this message]
2017-05-25  8:37   ` Marc Zyngier
2017-05-31  7:32     ` Marc Gonzalez
2017-04-20 14:31 ` [PATCH v4 2/2] PCI: Add tango PCIe host bridge support Marc Gonzalez
2017-05-23 17:24   ` Bjorn Helgaas
2017-05-23 17:43     ` Mason
2017-05-23 18:35       ` Bjorn Helgaas
2017-05-23 19:29         ` Mason
2017-05-25  8:48   ` Marc Zyngier
2017-05-25 12:00     ` Mason
2017-05-25 12:23       ` Marc Zyngier
2017-05-25 12:41         ` Mason
2017-05-25 13:20           ` Marc Zyngier
2017-05-15  8:16 ` [PATCH v4 0/2] Tango PCIe controller support Marc Gonzalez
2017-05-23 17:17 ` Bjorn Helgaas
2017-05-23 18:07   ` Mason
2017-05-23 18:30     ` Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8bbdc8a4-98a5-ae13-ff0f-d644307986d5@free.fr \
    --to=slash.tmp@free.fr \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox