Skip to contentSkip to conversation

Disable MSI also when pcie-octeon.pcie_disable on

PATCH Applied YunQiang Su 3 participants 8 messages Jan 8, 2019 – Jan 10, 2019 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Disable MSI also when pcie-octeon.pcie_disable on

From: YunQiang Su <[email protected]>

Octeon has an boot-time option to disable pcie.

Since MSI depends on PCI-E, we should also disable MSI also with this options is on.

---
 arch/mips/pci/msi-octeon.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/mips/pci/msi-octeon.c +3 -1
index 2a5bb849b..288b58b00 100644
@@ -369,7 +369,9 @@ int __init octeon_msi_initialize(void)
 	int irq;
 	struct irq_chip *msi;
 
-	if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_PCIE) {
+	if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_INVALID) {
+		return 0;
+	} else if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_PCIE) {
 		msi_rcv_reg[0] = CVMX_PEXP_NPEI_MSI_RCV0;
 		msi_rcv_reg[1] = CVMX_PEXP_NPEI_MSI_RCV1;
 		msi_rcv_reg[2] = CVMX_PEXP_NPEI_MSI_RCV2;
Signature · 1 line
2.20.1
#1 lore raw
Quoted 18 lines · YunQiang Su <[email protected]> 于2019年1月8日周二 下午1:45写道:

From: YunQiang Su <[email protected]>

Octeon has an boot-time option to disable pcie.

Since MSI depends on PCI-E, we should also disable MSI also with this options is on.

---
 arch/mips/pci/msi-octeon.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/mips/pci/msi-octeon.c +0 -0
index 2a5bb849b..288b58b00 100644

arch/mips/pci/msi-octeon.c int __init octeon_msi_initialize(void) · line 374

Quoted 7 lines
arch/mips/pci/msi-octeon.c +3 -1
@@ -369,7 +369,9 @@ int __init octeon_msi_initialize(void)
        int irq;
        struct irq_chip *msi;
 
-       if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_PCIE) {
+       if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_INVALID) {
+               return 0;
+       } else if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_PCIE) {

This code snip appears when 2.6.36, and this boot time option first appears when 3.3.
So, when backport, it make sense for 3.3+.

Quoted 6 lines
arch/mips/pci/msi-octeon.c +0 -1
                msi_rcv_reg[0] = CVMX_PEXP_NPEI_MSI_RCV0;
                msi_rcv_reg[1] = CVMX_PEXP_NPEI_MSI_RCV1;
                msi_rcv_reg[2] = CVMX_PEXP_NPEI_MSI_RCV2;
--

2.20.1

#2 lore raw
In reply to YunQiang Su

Hi YunQiang,

Quoted 6 lines · YunQiang Su

From: YunQiang Su <[email protected]>

Octeon has an boot-time option to disable pcie.

Since MSI depends on PCI-E, we should also disable MSI also with this options is on.

Does this fix a bug you're seeing? Or is it just intended to avoid redundant work?

If it fixes a bug then I'll apply it to mips-fixes & copy stable, otherwise I'll apply it to mips-next & not copy stable.

Thanks,
Paul

Quoted 23 lines
---
 arch/mips/pci/msi-octeon.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/mips/pci/msi-octeon.c +3 -1
index 2a5bb849b..288b58b00 100644
@@ -369,7 +369,9 @@ int __init octeon_msi_initialize(void)
 	int irq;
 	struct irq_chip *msi;
 
-	if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_PCIE) {
+	if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_INVALID) {
+		return 0;
+	} else if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_PCIE) {
 		msi_rcv_reg[0] = CVMX_PEXP_NPEI_MSI_RCV0;
 		msi_rcv_reg[1] = CVMX_PEXP_NPEI_MSI_RCV1;
 		msi_rcv_reg[2] = CVMX_PEXP_NPEI_MSI_RCV2;
Signature · 1 line
2.20.1
#3 lore raw
Quoted 9 lines · 在 2019年1月11日,上午2:24,Paul Burton <[email protected]> 写道:

Hi YunQiang,

Quoted 2 lines · YunQiang Su

From: YunQiang Su <[email protected]>

Quoted 8 lines
Quoted 4 lines

Octeon has an boot-time option to disable pcie.

Since MSI depends on PCI-E, we should also disable MSI also with this options is on.

Does this fix a bug you're seeing? Or is it just intended to avoid redundant work?

I have no idea whether this is a bug or new feathers.
I get an Cavium machine, which has no PCI at all, and so I have to disable the PCI totally.

For me there are 2 ways: disable on build-time or disable on runtime. Since Debian prefer to use a single kernel image.
So I need to disable it on runtime.

Quoted 3 lines

If it fixes a bug then I'll apply it to mips-fixes & copy stable, otherwise I'll apply it to mips-next & not copy stable.

I prefer it to be backported.

Quoted 26 lines

Thanks,
Paul

Quoted 23 lines

---
arch/mips/pci/msi-octeon.c | 4 +++-

1 file changed, 3 insertions(+), 1 deletion(-)
arch/mips/pci/msi-octeon.c +3 -1
index 2a5bb849b..288b58b00 100644
@@ -369,7 +369,9 @@ int __init octeon_msi_initialize(void)
 	int irq;
 	struct irq_chip *msi;
 
-	if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_PCIE) {
+	if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_INVALID) {
+		return 0;
+	} else if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_PCIE) {
 		msi_rcv_reg[0] = CVMX_PEXP_NPEI_MSI_RCV0;
 		msi_rcv_reg[1] = CVMX_PEXP_NPEI_MSI_RCV1;
 		msi_rcv_reg[2] = CVMX_PEXP_NPEI_MSI_RCV2;
Signature · 1 line
2.20.1
#4 lore raw

Hi Yunqiang,

Quoted 14 lines · Yunqiang Su
Quoted 6 lines · 在 2019年1月11日,上午2:24,Paul Burton <[email protected]> 写道:

Hi YunQiang,

Quoted 2 lines · YunQiang Su

From: YunQiang Su <[email protected]>

Quoted 7 lines
Quoted 4 lines

Octeon has an boot-time option to disable pcie.

Since MSI depends on PCI-E, we should also disable MSI also with this options is on.

Does this fix a bug you're seeing? Or is it just intended to avoid redundant work?

Quoted 6 lines

I have no idea whether this is a bug or new feathers.
I get an Cavium machine, which has no PCI at all, and so I have to disable the PCI totally.

For me there are 2 ways: disable on build-time or disable on runtime. Since Debian prefer to use a single kernel image.
So I need to disable it on runtime.

Let me phrase this another way - if you boot with PCIe disabled, but without your patch applied, what happens? Does the system work or does it break?

You must have written the patch for a reason, I just want to know what that reason is.

Quoted 4 lines
Quoted 2 lines

If it fixes a bug then I'll apply it to mips-fixes & copy stable, otherwise I'll apply it to mips-next & not copy stable.

I prefer it to be backported.

Only if it fixes a bug.

Thanks,
Paul

#5 lore raw
Quoted 21 lines · Paul Burton <[email protected]> 于2019年1月11日周五 上午2:45写道:

Hi Yunqiang,

Quoted 17 lines · Yunqiang Su
Quoted 6 lines · 在 2019年1月11日,上午2:24,Paul Burton <[email protected]> 写道:

Hi YunQiang,

Quoted 2 lines · YunQiang Su

From: YunQiang Su <[email protected]>

Quoted 7 lines
Quoted 4 lines

Octeon has an boot-time option to disable pcie.

Since MSI depends on PCI-E, we should also disable MSI also with this options is on.

Does this fix a bug you're seeing? Or is it just intended to avoid redundant work?

I have no idea whether this is a bug or new feathers.
I get an Cavium machine, which has no PCI at all, and so I have to disable the PCI totally.

Quoted 8 lines
Quoted 3 lines

For me there are 2 ways: disable on build-time or disable on runtime. Since Debian prefer to use a single kernel image.
So I need to disable it on runtime.

Let me phrase this another way - if you boot with PCIe disabled, but without your patch applied, what happens? Does the system work or does it break?

Yes. I think it is another bug.
https://lore.kernel.org/linux-mips/CAKcpw6Uf=_f4T1ZBLnp9gWrp1rjwuLfpF0h865-U4BOpuFLiiw@mail.gmail.com/T/#t

Quoted 12 lines

You must have written the patch for a reason, I just want to know what that reason is.

Quoted 4 lines
Quoted 2 lines

If it fixes a bug then I'll apply it to mips-fixes & copy stable, otherwise I'll apply it to mips-next & not copy stable.

I prefer it to be backported.

Only if it fixes a bug.

Thanks,
Paul

#6 lore raw
In reply to Paul Burton
Quoted 21 lines · Paul Burton <[email protected]> 于2019年1月11日周五 上午2:45写道:

Hi Yunqiang,

Quoted 17 lines · Yunqiang Su
Quoted 6 lines · 在 2019年1月11日,上午2:24,Paul Burton <[email protected]> 写道:

Hi YunQiang,

Quoted 2 lines · YunQiang Su

From: YunQiang Su <[email protected]>

Quoted 7 lines
Quoted 4 lines

Octeon has an boot-time option to disable pcie.

Since MSI depends on PCI-E, we should also disable MSI also with this options is on.

Does this fix a bug you're seeing? Or is it just intended to avoid redundant work?

I have no idea whether this is a bug or new feathers.
I get an Cavium machine, which has no PCI at all, and so I have to disable the PCI totally.

Quoted 7 lines
Quoted 3 lines

For me there are 2 ways: disable on build-time or disable on runtime. Since Debian prefer to use a single kernel image.
So I need to disable it on runtime.

Let me phrase this another way - if you boot with PCIe disabled, but without your patch applied, what happens? Does the system work or does it break?

With pcie disabled pcie with pcie-octeon.pcie_disable, and without this patch, the kernel will fail to boot very early.

On https://elixir.bootlin.com/linux/latest/source/arch/mips/pci/msi-octeon.c#L399
request_irq

Quoted 13 lines

You must have written the patch for a reason, I just want to know what that reason is.

Quoted 4 lines
Quoted 2 lines

If it fixes a bug then I'll apply it to mips-fixes & copy stable, otherwise I'll apply it to mips-next & not copy stable.

I prefer it to be backported.

Only if it fixes a bug.

Thanks,
Paul