From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 169A9C433EF for ; Sat, 18 Dec 2021 20:42:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234169AbhLRUmX (ORCPT ); Sat, 18 Dec 2021 15:42:23 -0500 Received: from 9.mo548.mail-out.ovh.net ([46.105.48.137]:53161 "EHLO 9.mo548.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230130AbhLRUmW (ORCPT ); Sat, 18 Dec 2021 15:42:22 -0500 X-Greylist: delayed 994 seconds by postgrey-1.27 at vger.kernel.org; Sat, 18 Dec 2021 15:42:22 EST Received: from mxplan5.mail.ovh.net (unknown [10.109.138.121]) by mo548.mail-out.ovh.net (Postfix) with ESMTPS id 3A38A20143; Sat, 18 Dec 2021 20:25:43 +0000 (UTC) Received: from kaod.org (37.59.142.97) by DAG4EX1.mxp5.local (172.16.2.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Sat, 18 Dec 2021 21:25:41 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-97G0022d2cf51f-56be-41f7-b9ac-2c271cc1d1bb, B1F2FCB93787BB0875C07E604CDE73E7ADF677F7) smtp.auth=clg@kaod.org X-OVh-ClientIp: 90.11.79.163 Message-ID: Date: Sat, 18 Dec 2021 21:25:40 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [patch V3 28/35] PCI/MSI: Simplify pci_irq_get_affinity() Content-Language: en-US To: Thomas Gleixner , Nathan Chancellor CC: LKML , Bjorn Helgaas , Marc Zygnier , Alex Williamson , Kevin Tian , Jason Gunthorpe , Megha Dey , Ashok Raj , , Greg Kroah-Hartman , Juergen Gross , , Arnd Bergmann , Michael Ellerman , Benjamin Herrenschmidt , , Bjorn Helgaas , Stuart Yoder , Laurentiu Tudor , Nishanth Menon , Tero Kristo , Santosh Shilimkar , , Vinod Koul , , Mark Rutland , Will Deacon , Robin Murphy , Joerg Roedel , , Jassi Brar , Peter Ujfalusi , Sinan Kaya References: <20211210221642.869015045@linutronix.de> <20211210221814.900929381@linutronix.de> <87v8zm9pmd.ffs@tglx> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= In-Reply-To: <87v8zm9pmd.ffs@tglx> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [37.59.142.97] X-ClientProxiedBy: DAG1EX1.mxp5.local (172.16.2.1) To DAG4EX1.mxp5.local (172.16.2.31) X-Ovh-Tracer-GUID: 2aa807ab-02a3-4ad6-8447-d206fc92c88e X-Ovh-Tracer-Id: 4883872323797683005 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvuddrleekgddufeeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvfhfhjggtgfhisehtkeertddtfeejnecuhfhrohhmpeevrogurhhitggpnfgvpgfiohgrthgvrhcuoegtlhhgsehkrghougdrohhrgheqnecuggftrfgrthhtvghrnhepieegvdffkeegfeetuddttddtveduiefhgeduffekiedtkeekteekhfffleevleelnecukfhppedtrddtrddtrddtpdefjedrheelrddugedvrdeljeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhhtpdhhvghlohepmhigphhlrghnhedrmhgrihhlrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpegtlhhgsehkrghougdrohhrghdprhgtphhtthhopehokhgrhigrsehkvghrnhgvlhdrohhrgh Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/18/21 11:25, Thomas Gleixner wrote: > On Fri, Dec 17 2021 at 15:30, Nathan Chancellor wrote: >> On Fri, Dec 10, 2021 at 11:19:26PM +0100, Thomas Gleixner wrote: >> I just bisected a boot failure on my AMD test desktop to this patch as >> commit f48235900182 ("PCI/MSI: Simplify pci_irq_get_affinity()") in >> -next. It looks like there is a problem with the NVMe drive after this >> change according to the logs. Given that the hard drive is not getting >> mounted for journald to write logs to, I am not really sure how to get >> them from the machine so I have at least taken a picture of what I see >> on my screen; open to ideas on that front! > > Bah. Fix below. That's a fix for the issue I was seeing on pseries with NVMe. Tested-by: Cédric Le Goater Thanks, C. > Thanks, > > tglx > --- > diff --git a/drivers/pci/msi/msi.c b/drivers/pci/msi/msi.c > index 71802410e2ab..9b4910befeda 100644 > --- a/drivers/pci/msi/msi.c > +++ b/drivers/pci/msi/msi.c > @@ -1100,7 +1100,7 @@ EXPORT_SYMBOL(pci_irq_vector); > */ > const struct cpumask *pci_irq_get_affinity(struct pci_dev *dev, int nr) > { > - int irq = pci_irq_vector(dev, nr); > + int idx, irq = pci_irq_vector(dev, nr); > struct msi_desc *desc; > > if (WARN_ON_ONCE(irq <= 0)) > @@ -1113,7 +1113,10 @@ const struct cpumask *pci_irq_get_affinity(struct pci_dev *dev, int nr) > > if (WARN_ON_ONCE(!desc->affinity)) > return NULL; > - return &desc->affinity[nr].mask; > + > + /* MSI has a mask array in the descriptor. */ > + idx = dev->msi_enabled ? nr : 0; > + return &desc->affinity[idx].mask; > } > EXPORT_SYMBOL(pci_irq_get_affinity); > >