From patchwork Wed May 31 21:55:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mason X-Patchwork-Id: 9758219 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F332D602BF for ; Wed, 31 May 2017 21:56:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5B15284C3 for ; Wed, 31 May 2017 21:56:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA58C284E4; Wed, 31 May 2017 21:56:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE0272018E for ; Wed, 31 May 2017 21:56:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751134AbdEaV4K (ORCPT ); Wed, 31 May 2017 17:56:10 -0400 Received: from smtp2-g21.free.fr ([212.27.42.2]:42088 "EHLO smtp2-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751000AbdEaV4J (ORCPT ); Wed, 31 May 2017 17:56:09 -0400 Received: from [192.168.0.66] (unknown [88.191.210.51]) (Authenticated sender: shill) by smtp2-g21.free.fr (Postfix) with ESMTPSA id 5C71D2003AE; Wed, 31 May 2017 23:55:41 +0200 (CEST) Subject: Re: [PATCH v4 1/2] PCI: Add tango MSI controller support To: Bjorn Helgaas , Marc Zyngier , Thomas Gleixner Cc: Lorenzo Pieralisi , linux-pci , Liviu Dudau , LKML , David Laight , Robin Murphy , Linux ARM , Marc Gonzalez References: <20170531173414.GB4496@bhelgaas-glaptop.roam.corp.google.com> <4885137f-7c1c-5742-4f66-f48c32ce7abb@free.fr> <20170531190037.GA18084@bhelgaas-glaptop.roam.corp.google.com> <20170531191258.GA18454@bhelgaas-glaptop.roam.corp.google.com> <74d6d867-313a-2304-9753-9739ad4703a8@free.fr> <20170531200424.GA23171@bhelgaas-glaptop.roam.corp.google.com> From: Mason Message-ID: <8bbdc8a4-98a5-ae13-ff0f-d644307986d5@free.fr> Date: Wed, 31 May 2017 23:55:37 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49 MIME-Version: 1.0 In-Reply-To: <20170531200424.GA23171@bhelgaas-glaptop.roam.corp.google.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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);