All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/pseries/msi: Add an empty irq_write_msi_msg() handler
@ 2021-09-30 10:25 Cédric Le Goater
  2021-09-30 12:17 ` Cédric Le Goater
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Cédric Le Goater @ 2021-09-30 10:25 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Brian King, Wen Xiong, Cédric Le Goater, Douglas Miller

The IPR drivers tests for MSI support at probe time with MSI vector 0
and when done, frees the IRQ with free_irq(). This test was introduced
by 95fecd90397e ("ipr: add test for MSI interrupt support") as an
improvement of commit 5a9ef25b14d3 ("[SCSI] ipr: add MSI support")
because a boot failure was reported on a Bimini PowerPC system :

  https://x-lore.kernel.org/all/1242926159.3007.5.camel@localhost.localdomain/

It was finally decided to remove MSI support on Bimini systems in
6eb0ac03899a ("powerpc/maple: Add a quirk to disable MSI for IPR on
Bimini").

Linux 5.15-rc1 added MSI domain support to the pseries machine and
when free_irq is called() in the driver, msi_domain_deactivate() also
is. This resets the MSI table entry of the associate vector by calling
__pci_write_msi_msg() with an empty message and breaks any further
activation of the same vector. In the case of the IPR driver, it
breaks the initialization sequence of the IOA.

Introduce an empty irq_write_msi_msg() handler in the MSI domain of
the pseries machine to avoid clearing the MSI vector entry. Updating
the entry is not strictly necessary since it is initialized by the
underlying hypervisor, PowerVM or QEMU/KVM.

Cc: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Cc: Douglas Miller <dougmill@linux.vnet.ibm.com>
Cc: Brian King <brking@linux.vnet.ibm.com>
Fixes: a5f3d2c17b07 ("powerpc/pseries/pci: Add MSI domains")
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---

 We could also revert commit 95fecd90397e ("ipr: add test for MSI
 interrupt support") which doesn't seem very useful nowdays. Or
 rewrite the test to improve how MSI vectors are used.

 Please advise !

 Thanks,


 arch/powerpc/platforms/pseries/msi.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c
index 1b305e411862..37eb35f5194d 100644
--- a/arch/powerpc/platforms/pseries/msi.c
+++ b/arch/powerpc/platforms/pseries/msi.c
@@ -507,12 +507,27 @@ static void pseries_msi_unmask(struct irq_data *d)
 	irq_chip_unmask_parent(d);
 }
 
+static void pseries_msi_write_msg(struct irq_data *data, struct msi_msg *msg)
+{
+	struct msi_desc *entry = irq_data_get_msi_desc(data);
+
+	/* Do not update the MSIx vector table. This is not strictly
+	 * necessary since the table is initialized by the underlying
+	 * hypervisor, PowerVM or QEMU/KVM. However, if the MSIx
+	 * vector entry is cleared, any further activation will fail.
+	 * This can happen in some drivers (IPR) which deactivate the
+	 * IRQ used for testing MSI support.
+	 */
+	entry->msg = *msg;
+}
+
 static struct irq_chip pseries_pci_msi_irq_chip = {
 	.name		= "pSeries-PCI-MSI",
 	.irq_shutdown	= pseries_msi_shutdown,
 	.irq_mask	= pseries_msi_mask,
 	.irq_unmask	= pseries_msi_unmask,
 	.irq_eoi	= irq_chip_eoi_parent,
+	.irq_write_msi_msg	= pseries_msi_write_msg,
 };
 
 static struct msi_domain_info pseries_msi_domain_info = {
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc/pseries/msi: Add an empty irq_write_msi_msg() handler
  2021-09-30 10:25 [PATCH] powerpc/pseries/msi: Add an empty irq_write_msi_msg() handler Cédric Le Goater
@ 2021-09-30 12:17 ` Cédric Le Goater
  2021-09-30 13:32 ` Mahesh J Salgaonkar
  2021-10-08 13:23 ` Michael Ellerman
  2 siblings, 0 replies; 4+ messages in thread
From: Cédric Le Goater @ 2021-09-30 12:17 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Brian King, Wen Xiong, Douglas Miller

On 9/30/21 12:25, Cédric Le Goater wrote:
> The IPR drivers tests for MSI support at probe time with MSI vector 0
> and when done, frees the IRQ with free_irq(). This test was introduced
> by 95fecd90397e ("ipr: add test for MSI interrupt support") as an
> improvement of commit 5a9ef25b14d3 ("[SCSI] ipr: add MSI support")
> because a boot failure was reported on a Bimini PowerPC system :
> 
>    https://x-lore.kernel.org/all/1242926159.3007.5.camel@localhost.localdomain/
> 
> It was finally decided to remove MSI support on Bimini systems in
> 6eb0ac03899a ("powerpc/maple: Add a quirk to disable MSI for IPR on
> Bimini").
> 
> Linux 5.15-rc1 added MSI domain support to the pseries machine and
> when free_irq is called() in the driver, msi_domain_deactivate() also
> is. This resets the MSI table entry of the associate vector by calling
> __pci_write_msi_msg() with an empty message and breaks any further
> activation of the same vector. In the case of the IPR driver, it
> breaks the initialization sequence of the IOA.
> 
> Introduce an empty irq_write_msi_msg() handler in the MSI domain of
> the pseries machine to avoid clearing the MSI vector entry. Updating
> the entry is not strictly necessary since it is initialized by the
> underlying hypervisor, PowerVM or QEMU/KVM.
> 
> Cc: Wen Xiong <wenxiong@linux.vnet.ibm.com>
> Cc: Douglas Miller <dougmill@linux.vnet.ibm.com>
> Cc: Brian King <brking@linux.vnet.ibm.com>
> Fixes: a5f3d2c17b07 ("powerpc/pseries/pci: Add MSI domains")
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

This is missing :

Reported-by: Abdul Haleem <abdhalee@linux.vnet.ibm.com>

Thanks,

C.

> ---
> 
>   We could also revert commit 95fecd90397e ("ipr: add test for MSI
>   interrupt support") which doesn't seem very useful nowdays. Or
>   rewrite the test to improve how MSI vectors are used.
> 
>   Please advise !
> 
>   Thanks,
> 
> 
>   arch/powerpc/platforms/pseries/msi.c | 15 +++++++++++++++
>   1 file changed, 15 insertions(+)
> 
> diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c
> index 1b305e411862..37eb35f5194d 100644
> --- a/arch/powerpc/platforms/pseries/msi.c
> +++ b/arch/powerpc/platforms/pseries/msi.c
> @@ -507,12 +507,27 @@ static void pseries_msi_unmask(struct irq_data *d)
>   	irq_chip_unmask_parent(d);
>   }
>   
> +static void pseries_msi_write_msg(struct irq_data *data, struct msi_msg *msg)
> +{
> +	struct msi_desc *entry = irq_data_get_msi_desc(data);
> +
> +	/* Do not update the MSIx vector table. This is not strictly
> +	 * necessary since the table is initialized by the underlying
> +	 * hypervisor, PowerVM or QEMU/KVM. However, if the MSIx
> +	 * vector entry is cleared, any further activation will fail.
> +	 * This can happen in some drivers (IPR) which deactivate the
> +	 * IRQ used for testing MSI support.
> +	 */
> +	entry->msg = *msg;
> +}
> +
>   static struct irq_chip pseries_pci_msi_irq_chip = {
>   	.name		= "pSeries-PCI-MSI",
>   	.irq_shutdown	= pseries_msi_shutdown,
>   	.irq_mask	= pseries_msi_mask,
>   	.irq_unmask	= pseries_msi_unmask,
>   	.irq_eoi	= irq_chip_eoi_parent,
> +	.irq_write_msi_msg	= pseries_msi_write_msg,
>   };
>   
>   static struct msi_domain_info pseries_msi_domain_info = {
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc/pseries/msi: Add an empty irq_write_msi_msg() handler
  2021-09-30 10:25 [PATCH] powerpc/pseries/msi: Add an empty irq_write_msi_msg() handler Cédric Le Goater
  2021-09-30 12:17 ` Cédric Le Goater
@ 2021-09-30 13:32 ` Mahesh J Salgaonkar
  2021-10-08 13:23 ` Michael Ellerman
  2 siblings, 0 replies; 4+ messages in thread
From: Mahesh J Salgaonkar @ 2021-09-30 13:32 UTC (permalink / raw)
  To: Cédric Le Goater; +Cc: Brian King, Wen Xiong, linuxppc-dev, Douglas Miller

On 2021-09-30 12:25:35 Thu, Cédric Le Goater wrote:
> The IPR drivers tests for MSI support at probe time with MSI vector 0
> and when done, frees the IRQ with free_irq(). This test was introduced
> by 95fecd90397e ("ipr: add test for MSI interrupt support") as an
> improvement of commit 5a9ef25b14d3 ("[SCSI] ipr: add MSI support")
> because a boot failure was reported on a Bimini PowerPC system :
> 
>   https://x-lore.kernel.org/all/1242926159.3007.5.camel@localhost.localdomain/
> 
> It was finally decided to remove MSI support on Bimini systems in
> 6eb0ac03899a ("powerpc/maple: Add a quirk to disable MSI for IPR on
> Bimini").
> 
> Linux 5.15-rc1 added MSI domain support to the pseries machine and
> when free_irq is called() in the driver, msi_domain_deactivate() also
> is. This resets the MSI table entry of the associate vector by calling
> __pci_write_msi_msg() with an empty message and breaks any further
> activation of the same vector. In the case of the IPR driver, it
> breaks the initialization sequence of the IOA.
> 
> Introduce an empty irq_write_msi_msg() handler in the MSI domain of
> the pseries machine to avoid clearing the MSI vector entry. Updating
> the entry is not strictly necessary since it is initialized by the
> underlying hypervisor, PowerVM or QEMU/KVM.
> 
> Cc: Wen Xiong <wenxiong@linux.vnet.ibm.com>
> Cc: Douglas Miller <dougmill@linux.vnet.ibm.com>
> Cc: Brian King <brking@linux.vnet.ibm.com>
> Fixes: a5f3d2c17b07 ("powerpc/pseries/pci: Add MSI domains")
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

Tested-by: Mahesh Salgaonkar <mahesh@linux.ibm.com>

This fixes the issue reported at
https://lore.kernel.org/linuxppc-dev/65f0085f-c6a9-e3ea-4d60-fcf09b7c7360@linux.vnet.ibm.com/T/#u
by Abdul.

Thanks,
-- 
Mahesh J Salgaonkar

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc/pseries/msi: Add an empty irq_write_msi_msg() handler
  2021-09-30 10:25 [PATCH] powerpc/pseries/msi: Add an empty irq_write_msi_msg() handler Cédric Le Goater
  2021-09-30 12:17 ` Cédric Le Goater
  2021-09-30 13:32 ` Mahesh J Salgaonkar
@ 2021-10-08 13:23 ` Michael Ellerman
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2021-10-08 13:23 UTC (permalink / raw)
  To: Cédric Le Goater, linuxppc-dev; +Cc: Brian King, Wen Xiong, Douglas Miller

On Thu, 30 Sep 2021 12:25:35 +0200, Cédric Le Goater wrote:
> The IPR drivers tests for MSI support at probe time with MSI vector 0
> and when done, frees the IRQ with free_irq(). This test was introduced
> by 95fecd90397e ("ipr: add test for MSI interrupt support") as an
> improvement of commit 5a9ef25b14d3 ("[SCSI] ipr: add MSI support")
> because a boot failure was reported on a Bimini PowerPC system :
> 
>   https://x-lore.kernel.org/all/1242926159.3007.5.camel@localhost.localdomain/
> 
> [...]

Applied to powerpc/fixes.

[1/1] powerpc/pseries/msi: Add an empty irq_write_msi_msg() handler
      https://git.kernel.org/powerpc/c/5a4b0320783a19f877dd595813569b3c25f4ff81

cheers

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-08 13:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-30 10:25 [PATCH] powerpc/pseries/msi: Add an empty irq_write_msi_msg() handler Cédric Le Goater
2021-09-30 12:17 ` Cédric Le Goater
2021-09-30 13:32 ` Mahesh J Salgaonkar
2021-10-08 13:23 ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.