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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C9A68C433EF for ; Tue, 7 Dec 2021 17:44:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:CC:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZrbiGg7MYHYz1kd1wASca/bNGu2barCAon+l8jAif+U=; b=ITj+V5LG72nUy5 Q50ETAAn2rU78vTi7LYMdmVK+Kpsbdtpey/YAD6M17mXxd0jqN2PFOBkLz9VKhQGTMj78L+l9n38q nwH8e87UTEzYywrIW8xLg94Mc1/b4RhXXCa9nlXgSPjGZFKVXaAFuWLpfpB/ie1M+RdN11zTGaoRc d8Ol3p1dM2J5INOUpJn2uXMBD3fE1cjUaIJBAsDk9EoOBdn2yJqJ6ZbF4W4Lp2K5M7JLqs0jbPP20 31xy/6Qoe7TH2QSUviYOUM0kWIerus7XKgoiF1cpcH7hxpuF8g2i/shJ3cAAWvJPk9l+YRDe3ROXv Borwqdp2jn+JVB9Zqhzg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mueU5-009Zc4-Dg; Tue, 07 Dec 2021 17:42:33 +0000 Received: from smtpout2.mo529.mail-out.ovh.net ([79.137.123.220]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mueU0-009ZbE-OL for linux-arm-kernel@lists.infradead.org; Tue, 07 Dec 2021 17:42:30 +0000 Received: from mxplan5.mail.ovh.net (unknown [10.108.16.17]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id 4DC6CD06F169; Tue, 7 Dec 2021 18:42:25 +0100 (CET) Received: from kaod.org (37.59.142.102) 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.2308.20; Tue, 7 Dec 2021 18:42:23 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-102R0045e25c049-ab10-4875-94b1-6aac2f02c5c1, EDCC1E77E28A65BD51DFCD2B92BF934EEA10E5FB) smtp.auth=clg@kaod.org X-OVh-ClientIp: 86.201.172.254 Message-ID: Date: Tue, 7 Dec 2021 18:42:22 +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 V2 29/36] PCI/MSI: Simplify pci_irq_get_affinity() Content-Language: en-US To: Thomas Gleixner , LKML CC: Bjorn Helgaas , Marc Zygnier , Alex Williamson , Kevin Tian , Jason Gunthorpe , Megha Dey , Ashok Raj , , , Juergen Gross , Greg Kroah-Hartman , Will Deacon , Santosh Shilimkar , , , Stuart Yoder , Laurentiu Tudor , Nishanth Menon , Tero Kristo , , Vinod Koul , Mark Rutland , Robin Murphy , Sinan Kaya References: <20211206210307.625116253@linutronix.de> <20211206210439.235197701@linutronix.de> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= In-Reply-To: <20211206210439.235197701@linutronix.de> X-Originating-IP: [37.59.142.102] X-ClientProxiedBy: DAG5EX1.mxp5.local (172.16.2.41) To DAG4EX1.mxp5.local (172.16.2.31) X-Ovh-Tracer-GUID: 9a201c60-92f7-40d1-8e65-204b0cf1b1c0 X-Ovh-Tracer-Id: 11313323742435773410 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvuddrjeehgddutdeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvfhfhjggtgfhisehtjeertddtfeejnecuhfhrohhmpeevrogurhhitggpnfgvpgfiohgrthgvrhcuoegtlhhgsehkrghougdrohhrgheqnecuggftrfgrthhtvghrnhephffhleegueektdetffdvffeuieeugfekkeelheelteeftdfgtefffeehueegleehnecukfhppedtrddtrddtrddtpdefjedrheelrddugedvrddutddvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopehmgihplhgrnhehrdhmrghilhdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomheptghlgheskhgrohgurdhorhhgpdhrtghpthhtohepohhkrgihrgeskhgvrhhnvghlrdhorhhg X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211207_094228_980079_1667BE67 X-CRM114-Status: GOOD ( 18.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Thomas, On 12/6/21 23:39, Thomas Gleixner wrote: > Replace open coded MSI descriptor chasing and use the proper accessor > functions instead. > > Signed-off-by: Thomas Gleixner > Reviewed-by: Greg Kroah-Hartman > Reviewed-by: Jason Gunthorpe > --- > drivers/pci/msi/msi.c | 26 ++++++++++---------------- > 1 file changed, 10 insertions(+), 16 deletions(-) > > --- a/drivers/pci/msi/msi.c > +++ b/drivers/pci/msi/msi.c > @@ -1056,26 +1056,20 @@ EXPORT_SYMBOL(pci_irq_vector); > */ > const struct cpumask *pci_irq_get_affinity(struct pci_dev *dev, int nr) > { > - if (dev->msix_enabled) { > - struct msi_desc *entry; > + int irq = pci_irq_vector(dev, nr); > + struct msi_desc *desc; > > - for_each_pci_msi_entry(entry, dev) { > - if (entry->msi_index == nr) > - return &entry->affinity->mask; > - } > - WARN_ON_ONCE(1); > + if (WARN_ON_ONCE(irq <= 0)) > return NULL; > - } else if (dev->msi_enabled) { > - struct msi_desc *entry = first_pci_msi_entry(dev); > > - if (WARN_ON_ONCE(!entry || !entry->affinity || > - nr >= entry->nvec_used)) > - return NULL; > - > - return &entry->affinity[nr].mask; > - } else { > + desc = irq_get_msi_desc(irq); > + /* Non-MSI does not have the information handy */ > + if (!desc) > return cpu_possible_mask; > - } > + > + if (WARN_ON_ONCE(!desc->affinity)) > + return NULL; > + return &desc->affinity[nr].mask; > } > EXPORT_SYMBOL(pci_irq_get_affinity); This is breaking nvme on pseries but it's probably one of the previous patches. I haven't figured out what's wrong yet. Here is the oops FYI. Thanks, C. [ 32.494536] ------------[ cut here ]------------ [ 32.494562] WARNING: CPU: 26 PID: 658 at kernel/irq/chip.c:210 irq_startup+0x1c0/0x1e0 [ 32.494575] Modules linked in: ibmvscsi ibmveth scsi_transport_srp bnx2x ipr libata xhci_pci xhci_hcd nvme xts vmx_crypto nvme_core mdio t10_pi libcrc32c dm_mirror dm_region_hash dm_log dm_mod [ 32.494601] CPU: 26 PID: 658 Comm: kworker/26:1H Not tainted 5.16.0-rc4-clg+ #54 [ 32.494607] Workqueue: kblockd blk_mq_timeout_work [ 32.494615] NIP: c000000000206f00 LR: c000000000206df0 CTR: c000000000201570 [ 32.494619] REGS: c0000018050f3610 TRAP: 0700 Not tainted (5.16.0-rc4-clg+) [ 32.494624] MSR: 800000000282b033 CR: 44002288 XER: 00000000 [ 32.494636] CFAR: c000000000206e0c IRQMASK: 1 [ 32.494636] GPR00: c000000000206df0 c0000018050f38b0 c000000001ca2900 0000000000000800 [ 32.494636] GPR04: c000000001ce21b8 0000000000000800 0000000000000800 0000000000000000 [ 32.494636] GPR08: 0000000000000000 0000000000000200 0000000000000000 fffffffffffffffd [ 32.494636] GPR12: 0000000000000000 c000001fff7c5880 c00000000018f488 c00000012faaba40 [ 32.494636] GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000001 [ 32.494636] GPR20: 0000000000000000 c0000018050f3c40 c00000000076e110 c00000013ac23678 [ 32.494636] GPR24: 000000000000007f 0000000000000100 0000000000000001 c000001805b08000 [ 32.494636] GPR28: c000000139b8cc18 0000000000000001 0000000000000001 c000000139b8cc00 [ 32.494681] NIP [c000000000206f00] irq_startup+0x1c0/0x1e0 [ 32.494686] LR [c000000000206df0] irq_startup+0xb0/0x1e0 [ 32.494690] Call Trace: [ 32.494692] [c0000018050f38b0] [c000000000206df0] irq_startup+0xb0/0x1e0 (unreliable) [ 32.494699] [c0000018050f38f0] [c00000000020155c] __enable_irq+0x9c/0xb0 [ 32.494705] [c0000018050f3950] [c0000000002015d0] enable_irq+0x60/0xc0 [ 32.494710] [c0000018050f39d0] [c008000014a54ae8] nvme_poll_irqdisable+0x80/0xc0 [nvme] [ 32.494719] [c0000018050f3a00] [c008000014a55824] nvme_timeout+0x18c/0x420 [nvme] [ 32.494726] [c0000018050f3ae0] [c00000000076e1b8] blk_mq_check_expired+0xa8/0x130 [ 32.494732] [c0000018050f3b10] [c0000000007793e8] bt_iter+0xd8/0x120 [ 32.494737] [c0000018050f3b60] [c00000000077a34c] blk_mq_queue_tag_busy_iter+0x25c/0x3f0 [ 32.494742] [c0000018050f3c20] [c00000000076ffa4] blk_mq_timeout_work+0x84/0x1a0 [ 32.494747] [c0000018050f3c70] [c000000000182a78] process_one_work+0x2a8/0x5a0 [ 32.494754] [c0000018050f3d10] [c000000000183468] worker_thread+0xa8/0x610 [ 32.494759] [c0000018050f3da0] [c00000000018f634] kthread+0x1b4/0x1c0 [ 32.494764] [c0000018050f3e10] [c00000000000cd64] ret_from_kernel_thread+0x5c/0x64 [ 32.494769] Instruction dump: [ 32.494773] 60000000 0b030000 38a00000 7f84e378 7fc3f378 4bff9a55 60000000 7fe3fb78 [ 32.494781] 4bfffd79 eb810020 7c7e1b78 4bfffe94 <0fe00000> 60000000 60000000 60420000 [ 32.494788] ---[ end trace 2a27b87f2b3e7a1f ]--- [ 32.494798] nvme nvme0: I/O 192 QID 128 timeout, aborting [ 32.584562] nvme nvme0: Abort status: 0x0 [ 62.574526] nvme nvme0: I/O 200 QID 128 timeout, aborting [ 62.574587] nvme0n1: p1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel