From: "Cédric Le Goater" <clg@kaod.org>
To: Thomas Gleixner <tglx@linutronix.de>,
LKML <linux-kernel@vger.kernel.org>
Cc: Nishanth Menon <nm@ti.com>, Mark Rutland <mark.rutland@arm.com>,
Stuart Yoder <stuyoder@gmail.com>,
linux-pci@vger.kernel.org, Will Deacon <will@kernel.org>,
Ashok Raj <ashok.raj@intel.com>, Marc Zygnier <maz@kernel.org>,
Sinan Kaya <okaya@kernel.org>,
iommu@lists.linux-foundation.org,
Bjorn Helgaas <helgaas@kernel.org>,
Megha Dey <megha.dey@intel.com>, Jason Gunthorpe <jgg@nvidia.com>,
xen-devel@lists.xenproject.org, Kevin Tian <kevin.tian@intel.com>,
Alex Williamson <alex.williamson@redhat.com>,
Santosh Shilimkar <ssantosh@kernel.org>,
linux-arm-kernel@lists.infradead.org,
Juergen Gross <jgross@suse.com>, Tero Kristo <kristo@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Vinod Koul <vkoul@kernel.org>,
dmaengine@vger.kernel.org, Robin Murphy <robin.murphy@arm.com>
Subject: Re: [patch V2 29/36] PCI/MSI: Simplify pci_irq_get_affinity()
Date: Tue, 7 Dec 2021 18:42:22 +0100 [thread overview]
Message-ID: <e32237f3-0ff2-cf80-cd99-0b4813d1ed21@kaod.org> (raw)
In-Reply-To: <20211206210439.235197701@linutronix.de>
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 <tglx@linutronix.de>
> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
> ---
> 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 <SF,VEC,VSX,EE,FP,ME,IR,DR,RI,LE> 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
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
next prev parent reply other threads:[~2021-12-07 17:47 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-06 22:38 [patch V2 00/36] genirq/msi, PCI/MSI: Spring cleaning - Part 2 Thomas Gleixner
2021-12-06 22:38 ` [patch V2 01/36] device: Move MSI related data into a struct Thomas Gleixner
2021-12-06 22:38 ` [patch V2 02/36] device: Add device::msi_data pointer and struct msi_device_data Thomas Gleixner
2021-12-06 22:39 ` [patch V2 03/36] PCI/MSI: Allocate MSI device data on first use Thomas Gleixner
2021-12-07 21:03 ` Bjorn Helgaas
2021-12-06 22:39 ` [patch V2 04/36] platform-msi: " Thomas Gleixner
2021-12-06 22:39 ` [patch V2 05/36] bus: fsl-mc-msi: " Thomas Gleixner
2021-12-06 22:39 ` [patch V2 06/36] soc: ti: ti_sci_inta_msi: " Thomas Gleixner
2021-12-06 22:39 ` [patch V2 07/36] genirq/msi: Provide msi_device_populate/destroy_sysfs() Thomas Gleixner
2021-12-06 22:39 ` [patch V2 08/36] PCI/MSI: Let the irq code handle sysfs groups Thomas Gleixner
2021-12-07 21:04 ` Bjorn Helgaas
2021-12-06 22:39 ` [patch V2 09/36] platform-msi: Let the core " Thomas Gleixner
2021-12-06 22:39 ` [patch V2 10/36] genirq/msi: Remove the original sysfs interfaces Thomas Gleixner
2021-12-06 22:39 ` [patch V2 11/36] platform-msi: Rename functions and clarify comments Thomas Gleixner
2021-12-06 22:39 ` [patch V2 12/36] platform-msi: Store platform private data pointer in msi_device_data Thomas Gleixner
2021-12-06 22:39 ` [patch V2 13/36] genirq/msi: Consolidate MSI descriptor data Thomas Gleixner
2021-12-06 22:39 ` [patch V2 14/36] platform-msi: Use msi_desc::msi_index Thomas Gleixner
2021-12-06 22:39 ` [patch V2 15/36] bus: fsl-mc-msi: " Thomas Gleixner
2021-12-06 22:39 ` [patch V2 16/36] soc: ti: ti_sci_inta_msi: " Thomas Gleixner
2021-12-06 22:39 ` [patch V2 17/36] PCI/MSI: " Thomas Gleixner
2021-12-07 21:04 ` Bjorn Helgaas
2021-12-06 22:39 ` [patch V2 18/36] genirq/msi: Add msi_device_data::properties Thomas Gleixner
2021-12-07 7:52 ` Greg Kroah-Hartman
2021-12-07 9:04 ` Cédric Le Goater
2021-12-07 12:47 ` Thomas Gleixner
2021-12-07 12:53 ` Thomas Gleixner
2021-12-06 22:39 ` [patch V2 19/36] PCI/MSI: Store properties in device::msi::data Thomas Gleixner
2021-12-07 7:52 ` Greg Kroah-Hartman
2021-12-07 21:05 ` Bjorn Helgaas
2021-12-08 15:58 ` Jason Gunthorpe via iommu
2021-12-09 17:53 ` Thomas Gleixner
2021-12-09 21:02 ` Thomas Gleixner
2021-12-06 22:39 ` [patch V2 20/36] x86/pci/XEN: Use device MSI properties Thomas Gleixner
2021-12-08 15:53 ` Jason Gunthorpe via iommu
2021-12-08 17:53 ` Thomas Gleixner
2021-12-06 22:39 ` [patch V2 21/36] x86/apic/msi: " Thomas Gleixner
2021-12-08 15:45 ` Jason Gunthorpe via iommu
2021-12-06 22:39 ` [patch V2 22/36] genirq/msi: " Thomas Gleixner
2021-12-06 22:39 ` [patch V2 23/36] powerpc/cell/axon_msi: Use MSI device properties Thomas Gleixner
2021-12-07 7:52 ` Greg Kroah-Hartman
2021-12-08 15:54 ` Jason Gunthorpe via iommu
2021-12-06 22:39 ` [patch V2 24/36] powerpc/pseries/msi: " Thomas Gleixner
2021-12-08 15:51 ` Jason Gunthorpe via iommu
2021-12-06 22:39 ` [patch V2 25/36] PCI/MSI: Provide MSI_FLAG_MSIX_CONTIGUOUS Thomas Gleixner
2021-12-07 21:05 ` Bjorn Helgaas
2021-12-06 22:39 ` [patch V2 26/36] powerpc/pseries/msi: Let core code check for contiguous entries Thomas Gleixner
2021-12-07 7:52 ` Greg Kroah-Hartman
2021-12-06 22:39 ` [patch V2 27/36] genirq/msi: Provide interface to retrieve Linux interrupt number Thomas Gleixner
2021-12-07 7:51 ` Greg Kroah-Hartman
2021-12-06 22:39 ` [patch V2 28/36] PCI/MSI: Use __msi_get_virq() in pci_get_vector() Thomas Gleixner
2021-12-07 7:52 ` Greg Kroah-Hartman
2021-12-07 21:05 ` Bjorn Helgaas
2021-12-06 22:39 ` [patch V2 29/36] PCI/MSI: Simplify pci_irq_get_affinity() Thomas Gleixner
2021-12-07 17:42 ` Cédric Le Goater [this message]
2021-12-07 21:19 ` Thomas Gleixner
2021-12-06 22:39 ` [patch V2 30/36] dmaengine: mv_xor_v2: Get rid of msi_desc abuse Thomas Gleixner
2021-12-06 22:39 ` [patch V2 31/36] perf/smmuv3: Use msi_get_virq() Thomas Gleixner
2021-12-06 22:39 ` [patch V2 32/36] iommu/arm-smmu-v3: " Thomas Gleixner
2021-12-06 22:39 ` [patch V2 33/36] mailbox: bcm-flexrm-mailbox: Rework MSI interrupt handling Thomas Gleixner
2021-12-06 22:39 ` [patch V2 34/36] bus: fsl-mc: fsl-mc-allocator: Rework MSI handling Thomas Gleixner
2021-12-06 22:39 ` [patch V2 35/36] soc: ti: ti_sci_inta_msi: Get rid of ti_sci_inta_msi_get_virq() Thomas Gleixner
2021-12-06 22:39 ` [patch V2 36/36] dmaengine: qcom_hidma: Cleanup MSI handling Thomas Gleixner
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=e32237f3-0ff2-cf80-cd99-0b4813d1ed21@kaod.org \
--to=clg@kaod.org \
--cc=alex.williamson@redhat.com \
--cc=ashok.raj@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=helgaas@kernel.org \
--cc=iommu@lists.linux-foundation.org \
--cc=jgg@nvidia.com \
--cc=jgross@suse.com \
--cc=kevin.tian@intel.com \
--cc=kristo@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=megha.dey@intel.com \
--cc=nm@ti.com \
--cc=okaya@kernel.org \
--cc=robin.murphy@arm.com \
--cc=ssantosh@kernel.org \
--cc=stuyoder@gmail.com \
--cc=tglx@linutronix.de \
--cc=vkoul@kernel.org \
--cc=will@kernel.org \
--cc=xen-devel@lists.xenproject.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