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: 9758221 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 00FE2603F7 for ; Wed, 31 May 2017 21:56:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E6EF6284DC for ; Wed, 31 May 2017 21:56:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DBAC92018E; 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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 17513284C3 for ; Wed, 31 May 2017 21:56:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Y/3mdDYLlA4GilNDFFOQziVW1+MdKo5WXIoQDLL2Lq4=; b=KdRlUcYY8jpW1t zGOo6bxMsCQm2s5rzfBQAzay0Gm8KxtcOrnHy41U93CbVcAuFHfMed3Z9Nf/hExdsrOYCytjvryLw p3KFbrALJ+hN3M4RXGR/k/0msh6DbgsH+jUWvNJGYBy0frqUKXiiR8Vgqt0IN84lCb+d4NvjmxLyJ /frKFHUnEC1l/4bi1F/iOAsVw8k+LtI2EeFZcxfPXVCV9CLiXVaVaNBP5uU1FTp6iyYETPWn0l9Ai ogvtJaEADCZbn9Z49xPj6MzoOwazyGInd/I1NIsBxIcOZ+Y2YppI4T7q7NBqE23QgAlRckFhFahIW I5p2OqWcc8GraI15u1iQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dGBbV-0005Lg-SG; Wed, 31 May 2017 21:56:33 +0000 Received: from smtp2-g21.free.fr ([212.27.42.2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dGBbR-0005Jw-Q2 for linux-arm-kernel@lists.infradead.org; Wed, 31 May 2017 21:56:32 +0000 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170531_145630_159153_25A6490A X-CRM114-Status: UNSURE ( 9.17 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , linux-pci , Liviu Dudau , LKML , David Laight , Robin Murphy , Linux ARM , Marc Gonzalez Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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);