Linux-MIPS Archive on lore.kernel.org
 help / Atom feed
* [PATCH v2] Disable MSI also when pcie-octeon.pcie_disable on
@ 2019-01-08  5:45 YunQiang Su
  2019-01-08  7:41 ` YunQiang Su
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: YunQiang Su @ 2019-01-08  5:45 UTC (permalink / raw)
  To: pburton, linux-mips, aaro.koskinen; +Cc: YunQiang Su

From: YunQiang Su <ysu@wavecomp.com>

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.

Signed-off-by: YunQiang Su <ysu@wavecomp.com>
---
 arch/mips/pci/msi-octeon.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/mips/pci/msi-octeon.c b/arch/mips/pci/msi-octeon.c
index 2a5bb849b..288b58b00 100644
--- a/arch/mips/pci/msi-octeon.c
+++ b/arch/mips/pci/msi-octeon.c
@@ -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;
-- 
2.20.1


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

* Re: [PATCH v2] Disable MSI also when pcie-octeon.pcie_disable on
  2019-01-08  5:45 [PATCH v2] Disable MSI also when pcie-octeon.pcie_disable on YunQiang Su
@ 2019-01-08  7:41 ` YunQiang Su
  2019-01-10 18:24 ` Paul Burton
  2019-01-10 18:58 ` Paul Burton
  2 siblings, 0 replies; 8+ messages in thread
From: YunQiang Su @ 2019-01-08  7:41 UTC (permalink / raw)
  To: Paul Burton, linux-mips, Aaro Koskinen; +Cc: YunQiang Su

YunQiang Su <syq@debian.org> 于2019年1月8日周二 下午1:45写道:
>
> From: YunQiang Su <ysu@wavecomp.com>
>
> 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.
>
> Signed-off-by: YunQiang Su <ysu@wavecomp.com>
> ---
>  arch/mips/pci/msi-octeon.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/arch/mips/pci/msi-octeon.c b/arch/mips/pci/msi-octeon.c
> index 2a5bb849b..288b58b00 100644
> --- a/arch/mips/pci/msi-octeon.c
> +++ b/arch/mips/pci/msi-octeon.c
> @@ -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+.

>                 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
>

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

* Re: [PATCH v2] Disable MSI also when pcie-octeon.pcie_disable on
  2019-01-08  5:45 [PATCH v2] Disable MSI also when pcie-octeon.pcie_disable on YunQiang Su
  2019-01-08  7:41 ` YunQiang Su
@ 2019-01-10 18:24 ` Paul Burton
  2019-01-10 18:35   ` Yunqiang Su
  2019-01-10 18:58 ` Paul Burton
  2 siblings, 1 reply; 8+ messages in thread
From: Paul Burton @ 2019-01-10 18:24 UTC (permalink / raw)
  To: YunQiang Su; +Cc: Paul Burton, linux-mips, aaro.koskinen, Yunqiang Su

Hi YunQiang,

On Tue, Jan 08, 2019 at 01:45:10PM +0800, YunQiang Su wrote:
> From: YunQiang Su <ysu@wavecomp.com>
> 
> 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

> Signed-off-by: YunQiang Su <ysu@wavecomp.com>
> ---
>  arch/mips/pci/msi-octeon.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/mips/pci/msi-octeon.c b/arch/mips/pci/msi-octeon.c
> index 2a5bb849b..288b58b00 100644
> --- a/arch/mips/pci/msi-octeon.c
> +++ b/arch/mips/pci/msi-octeon.c
> @@ -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;
> -- 
> 2.20.1
> 

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

* Re: [PATCH v2] Disable MSI also when pcie-octeon.pcie_disable on
  2019-01-10 18:24 ` Paul Burton
@ 2019-01-10 18:35   ` Yunqiang Su
  2019-01-10 18:45     ` Paul Burton
  0 siblings, 1 reply; 8+ messages in thread
From: Yunqiang Su @ 2019-01-10 18:35 UTC (permalink / raw)
  To: Paul Burton; +Cc: YunQiang Su, linux-mips, aaro.koskinen



> ÔÚ 2019Äê1ÔÂ11ÈÕ£¬ÉÏÎç2:24£¬Paul Burton <pburton@wavecomp.com> дµÀ£º
> 
> Hi YunQiang,
> 
> On Tue, Jan 08, 2019 at 01:45:10PM +0800, YunQiang Su wrote:
>> From: YunQiang Su <ysu@wavecomp.com>
>> 
>> 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.

> 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.

> Thanks,
>    Paul
> 
>> Signed-off-by: YunQiang Su <ysu@wavecomp.com>
>> ---
>> arch/mips/pci/msi-octeon.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>> 
>> diff --git a/arch/mips/pci/msi-octeon.c b/arch/mips/pci/msi-octeon.c
>> index 2a5bb849b..288b58b00 100644
>> --- a/arch/mips/pci/msi-octeon.c
>> +++ b/arch/mips/pci/msi-octeon.c
>> @@ -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;
>> -- 
>> 2.20.1
>> 


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

* Re: [PATCH v2] Disable MSI also when pcie-octeon.pcie_disable on
  2019-01-10 18:35   ` Yunqiang Su
@ 2019-01-10 18:45     ` Paul Burton
  2019-01-10 18:49       ` YunQiang Su
  2019-01-10 18:55       ` YunQiang Su
  0 siblings, 2 replies; 8+ messages in thread
From: Paul Burton @ 2019-01-10 18:45 UTC (permalink / raw)
  To: Yunqiang Su; +Cc: Paul Burton, YunQiang Su, linux-mips, aaro.koskinen

Hi Yunqiang,

On Thu, Jan 10, 2019 at 10:35:13AM -0800, Yunqiang Su wrote:
> > 在 2019年1月11日,上午2:24,Paul Burton <pburton@wavecomp.com> 写道:
> > Hi YunQiang,
> > 
> > On Tue, Jan 08, 2019 at 01:45:10PM +0800, YunQiang Su wrote:
> >> From: YunQiang Su <ysu@wavecomp.com>
> >> 
> >> 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.

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.

> > 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

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

* Re: [PATCH v2] Disable MSI also when pcie-octeon.pcie_disable on
  2019-01-10 18:45     ` Paul Burton
@ 2019-01-10 18:49       ` YunQiang Su
  2019-01-10 18:55       ` YunQiang Su
  1 sibling, 0 replies; 8+ messages in thread
From: YunQiang Su @ 2019-01-10 18:49 UTC (permalink / raw)
  To: Paul Burton; +Cc: Yunqiang Su, Paul Burton, linux-mips, aaro.koskinen

Paul Burton <paul.burton@mips.com> 于2019年1月11日周五 上午2:45写道:
>
> Hi Yunqiang,
>
> On Thu, Jan 10, 2019 at 10:35:13AM -0800, Yunqiang Su wrote:
> > > 在 2019年1月11日,上午2:24,Paul Burton <pburton@wavecomp.com> 写道:
> > > Hi YunQiang,
> > >
> > > On Tue, Jan 08, 2019 at 01:45:10PM +0800, YunQiang Su wrote:
> > >> From: YunQiang Su <ysu@wavecomp.com>
> > >>
> > >> 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.
>
> 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

> You must have written the patch for a reason, I just want to know what
> that reason is.
>
> > > 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

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

* Re: [PATCH v2] Disable MSI also when pcie-octeon.pcie_disable on
  2019-01-10 18:45     ` Paul Burton
  2019-01-10 18:49       ` YunQiang Su
@ 2019-01-10 18:55       ` YunQiang Su
  1 sibling, 0 replies; 8+ messages in thread
From: YunQiang Su @ 2019-01-10 18:55 UTC (permalink / raw)
  To: Paul Burton; +Cc: Yunqiang Su, Paul Burton, linux-mips, aaro.koskinen

Paul Burton <paul.burton@mips.com> 于2019年1月11日周五 上午2:45写道:
>
> Hi Yunqiang,
>
> On Thu, Jan 10, 2019 at 10:35:13AM -0800, Yunqiang Su wrote:
> > > 在 2019年1月11日,上午2:24,Paul Burton <pburton@wavecomp.com> 写道:
> > > Hi YunQiang,
> > >
> > > On Tue, Jan 08, 2019 at 01:45:10PM +0800, YunQiang Su wrote:
> > >> From: YunQiang Su <ysu@wavecomp.com>
> > >>
> > >> 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.
>
> 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

>
> You must have written the patch for a reason, I just want to know what
> that reason is.
>
> > > 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

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

* Re: [PATCH v2] Disable MSI also when pcie-octeon.pcie_disable on
  2019-01-08  5:45 [PATCH v2] Disable MSI also when pcie-octeon.pcie_disable on YunQiang Su
  2019-01-08  7:41 ` YunQiang Su
  2019-01-10 18:24 ` Paul Burton
@ 2019-01-10 18:58 ` Paul Burton
  2 siblings, 0 replies; 8+ messages in thread
From: Paul Burton @ 2019-01-10 18:58 UTC (permalink / raw)
  To: YunQiang Su
  Cc: Paul Burton, linux-mips, aaro.koskinen, Yunqiang Su, linux-mips

Hello,

YunQiang Su wrote:
> From: YunQiang Su <ysu@wavecomp.com>
> 
> 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.
> 
> Signed-off-by: YunQiang Su <ysu@wavecomp.com>

Applied to mips-fixes.

Thanks,
    Paul

[ This message was auto-generated; if you believe anything is incorrect
  then please email paul.burton@mips.com to report it. ]

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

end of thread, back to index

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-08  5:45 [PATCH v2] Disable MSI also when pcie-octeon.pcie_disable on YunQiang Su
2019-01-08  7:41 ` YunQiang Su
2019-01-10 18:24 ` Paul Burton
2019-01-10 18:35   ` Yunqiang Su
2019-01-10 18:45     ` Paul Burton
2019-01-10 18:49       ` YunQiang Su
2019-01-10 18:55       ` YunQiang Su
2019-01-10 18:58 ` Paul Burton

Linux-MIPS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mips/0 linux-mips/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mips linux-mips/ https://lore.kernel.org/linux-mips \
		linux-mips@vger.kernel.org linux-mips@archiver.kernel.org
	public-inbox-index linux-mips


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-mips


AGPL code for this site: git clone https://public-inbox.org/ public-inbox