linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: designware/imx6: question regarding MSI
       [not found] <25.15.01844.D5C20E25@epmailin6.samsung.com>
@ 2014-01-23  5:52 ` Jingoo Han
  2014-01-23  6:51   ` Pratyush Anand
  0 siblings, 1 reply; 9+ messages in thread
From: Jingoo Han @ 2014-01-23  5:52 UTC (permalink / raw)
  To: 'Bjørn Erik Nilsen'
  Cc: linux-pci, 'Mohit KUMAR', 'Harro Haan',
	'Marek Vasut', 'Pratyush Anand',
	'Jingoo Han'

On Thursday, January 23, 2014 5:39 AM, Jingoo Han wrote:
> 
> I’m currently playing with MSI support in pci-imx6.c using Harro Haan’s patch [*].
> 
> Are there any technical reasons why dw_pcie_msi_init cannot be called from dw_msi_setup_irq? Or rather,
> why it should not?

No, there is no special reason.
The patch (call dw_pcie_msi_init from dw_msi_setup_irq) would be
good. Thank you for your effort.

Mohit, Pratyush,
If you have different opinions, please let us know. :-)

Best regards,
Jingoo Han

> 
> I’m asking because I have a hotplug scenario where this little hack (call dw_pcie_msi_init from
> dw_msi_setup_irq) fixes a problem with MSI. I therefore need to understand whether it is a sensible
> hack or just crap, and more importantly; how it can be fixed properly.
> 
> Scenario:
> 
> (remove endpoints)
> # echo 1 > /sys/bus/pci/devices/0000:01:00.0/remove
> # echo 1 > /sys/bus/pci/devices/0000:01:00.1/remove
> 
> # take fpga in and out of reset (this will mess up the configuration space of the bridge)
> 
> (reset bridge)
> # echo 1 > /sys/bus/pci/devices/0000:00:00.0/reset
> 
> (rescan bus)
> # echo 1 > /sys/bus/pci/rescan
> 
> At this point everything works fine except MSI. With above mention hack it works like a charm.
> 
> I would be grateful if someone could shed light on this. I might have missed some important details.
> 
> 
> Best regards,
> Bjørn Erik Nilsen
> 
> [*]
> 
> From: Harro Haan <hrhaan@gmail.com>
> Date: Thu, 5 Dec 2013 14:06:37 +0100
> Subject: [PATCH 2/2] PCI: imx6: add support for MSI


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

* Re: designware/imx6: question regarding MSI
  2014-01-23  5:52 ` designware/imx6: question regarding MSI Jingoo Han
@ 2014-01-23  6:51   ` Pratyush Anand
       [not found]     ` <52e1335a.8917980a.31fa.ffffd7a8SMTPIN_ADDED_MISSING@mx.google.com>
       [not found]     ` <56523137843406465091127182657491@psmtp.com>
  0 siblings, 2 replies; 9+ messages in thread
From: Pratyush Anand @ 2014-01-23  6:51 UTC (permalink / raw)
  To: Jingoo Han, 'Bjørn Erik Nilsen'
  Cc: linux-pci@vger.kernel.org, Mohit KUMAR DCG, 'Harro Haan',
	'Marek Vasut'

On Thu, Jan 23, 2014 at 01:52:19PM +0800, Jingoo Han wrote:
> On Thursday, January 23, 2014 5:39 AM, Jingoo Han wrote:
> > 
> > I’m currently playing with MSI support in pci-imx6.c using Harro Haan’s patch [*].
> > 
> > Are there any technical reasons why dw_pcie_msi_init cannot be called from dw_msi_setup_irq? Or rather,
> > why it should not?
> 
> No, there is no special reason.
> The patch (call dw_pcie_msi_init from dw_msi_setup_irq) would be
> good. Thank you for your effort.
> 
> Mohit, Pratyush,
> If you have different opinions, please let us know. :-)

dw_msi_setup_irq will be called for each function which needs msi
assignment. However, dw_pcie_msi_init should be called only once. So,
in my opinion calling dw_pcie_msi_init from dw_msi_setup_irq would not
be the best option.

@Bjørn, can you help us with tracing calling sequence of
dw_pcie_setup & dw_pcie_scan_bus. I think when you do "reset bridge",
it will call dw_pcie_setup and when you do "rescan bus", it will call
dw_pcie_scan_bus. If yes, then you can move dw_pcie_msi_init to
dw_pcie_setup.

Regards
Pratyush

> 
> Best regards,
> Jingoo Han
> 
> > 
> > I’m asking because I have a hotplug scenario where this little hack (call dw_pcie_msi_init from
> > dw_msi_setup_irq) fixes a problem with MSI. I therefore need to understand whether it is a sensible
> > hack or just crap, and more importantly; how it can be fixed properly.
> > 
> > Scenario:
> > 
> > (remove endpoints)
> > # echo 1 > /sys/bus/pci/devices/0000:01:00.0/remove
> > # echo 1 > /sys/bus/pci/devices/0000:01:00.1/remove
> > 
> > # take fpga in and out of reset (this will mess up the configuration space of the bridge)
> > 
> > (reset bridge)
> > # echo 1 > /sys/bus/pci/devices/0000:00:00.0/reset
> > 
> > (rescan bus)
> > # echo 1 > /sys/bus/pci/rescan
> > 
> > At this point everything works fine except MSI. With above mention hack it works like a charm.
> > 
> > I would be grateful if someone could shed light on this. I might have missed some important details.
> > 
> > 
> > Best regards,
> > Bjørn Erik Nilsen
> > 
> > [*]
> > 
> > From: Harro Haan <hrhaan@gmail.com>
> > Date: Thu, 5 Dec 2013 14:06:37 +0100
> > Subject: [PATCH 2/2] PCI: imx6: add support for MSI

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

* Re: designware/imx6: question regarding MSI
       [not found]     ` <52e1335a.8917980a.31fa.ffffd7a8SMTPIN_ADDED_MISSING@mx.google.com>
@ 2014-01-23 17:32       ` Harro Haan
       [not found]         ` <6b747b65-ef6c-4f39-b61d-f534c981c98f@CH1EHSMHS003.ehs.local>
  0 siblings, 1 reply; 9+ messages in thread
From: Harro Haan @ 2014-01-23 17:32 UTC (permalink / raw)
  To: Bjørn Erik Nilsen, Richard Zhu, Richard Zhu
  Cc: Pratyush Anand, Jingoo Han, linux-pci@vger.kernel.org,
	Mohit KUMAR DCG, Marek Vasut

On 23 January 2014 16:20, Bjørn Erik Nilsen <ben@datarespons.no> wrote:
> Hi Pratyush,
>
> On Thu, 2014-01-23 at 07:51 +0100, Pratyush Anand wrote:
>> On Thu, Jan 23, 2014 at 01:52:19PM +0800, Jingoo Han wrote:
>> > On Thursday, January 23, 2014 5:39 AM, Jingoo Han wrote:
>> > >
>> > > I’m currently playing with MSI support in pci-imx6.c using Harro Haan’s patch [*].

The above patch mentioned will not become part of mainline Linux, but
I expect/hope a reworked version of "[PATCH] pci: imx: enable pcie msi
support" from Richard Zhu will become part of mainline, because this
patch supports MSIX as well. Reference to the patch with review
remarks:
http://www.spinics.net/lists/linux-ide/msg47074.html

@Richard Zhu: Is this a correct assumption?

>> > >
>> > > Are there any technical reasons why dw_pcie_msi_init cannot be called from dw_msi_setup_irq? Or rather,
>> > > why it should not?
>> >
>> > No, there is no special reason.
>> > The patch (call dw_pcie_msi_init from dw_msi_setup_irq) would be
>> > good. Thank you for your effort.
>> >
>> > Mohit, Pratyush,
>> > If you have different opinions, please let us know. :-)
>>
>> dw_msi_setup_irq will be called for each function which needs msi
>> assignment. However, dw_pcie_msi_init should be called only once. So,
>> in my opinion calling dw_pcie_msi_init from dw_msi_setup_irq would not
>> be the best option.
>>
>> @Bjørn, can you help us with tracing calling sequence of
>> dw_pcie_setup & dw_pcie_scan_bus. I think when you do "reset bridge",
>> it will call dw_pcie_setup and when you do "rescan bus", it will call
>> dw_pcie_scan_bus. If yes, then you can move dw_pcie_msi_init to
>> dw_pcie_setup.
>
>
> It looks like dw_pcie_setup and dw_pcie_scan_bus is only called when
> booting. Resetting the bridge or scanning the bus will not trigger any
> of these functions, unfortunately.
>
> I have looked for other hooks too, without luck.

@Bjørn: have you applied the following patch?
"[PATCH] pci: designware: fix missing msi irqs"
Reference to the patch:
http://lists.infradead.org/pipermail/linux-arm-kernel/2013-December/218629.html

Best regards,

Harro

>
>>
>> Regards
>> Pratyush
>>
>> >
>> > Best regards,
>> > Jingoo Han
>> >
>> > >
>> > > I’m asking because I have a hotplug scenario where this little hack (call dw_pcie_msi_init from
>> > > dw_msi_setup_irq) fixes a problem with MSI. I therefore need to understand whether it is a sensible
>> > > hack or just crap, and more importantly; how it can be fixed properly.
>> > >
>> > > Scenario:
>> > >
>> > > (remove endpoints)
>> > > # echo 1 > /sys/bus/pci/devices/0000:01:00.0/remove
>> > > # echo 1 > /sys/bus/pci/devices/0000:01:00.1/remove
>> > >
>> > > # take fpga in and out of reset (this will mess up the configuration space of the bridge)
>> > >
>> > > (reset bridge)
>> > > # echo 1 > /sys/bus/pci/devices/0000:00:00.0/reset
>> > >
>> > > (rescan bus)
>> > > # echo 1 > /sys/bus/pci/rescan
>> > >
>> > > At this point everything works fine except MSI. With above mention hack it works like a charm.
>> > >
>> > > I would be grateful if someone could shed light on this. I might have missed some important details.
>> > >
>> > >
>> > > Best regards,
>> > > Bjørn Erik Nilsen
>> > >
>> > > [*]
>> > >
>> > > From: Harro Haan <hrhaan@gmail.com>
>> > > Date: Thu, 5 Dec 2013 14:06:37 +0100
>> > > Subject: [PATCH 2/2] PCI: imx6: add support for MSI
>

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

* Re: designware/imx6: question regarding MSI
       [not found]     ` <56523137843406465091127182657491@psmtp.com>
@ 2014-01-24  6:48       ` Pratyush Anand
       [not found]         ` <8E.DE.30335.83C29E25@epmailin2.samsung.com>
  0 siblings, 1 reply; 9+ messages in thread
From: Pratyush Anand @ 2014-01-24  6:48 UTC (permalink / raw)
  To: Bjørn Erik Nilsen
  Cc: Jingoo Han, linux-pci@vger.kernel.org, Mohit KUMAR DCG,
	'Harro Haan', 'Marek Vasut'

On Thu, Jan 23, 2014 at 11:20:55PM +0800, Bjørn Erik Nilsen wrote:
> Hi Pratyush,
> 
> On Thu, 2014-01-23 at 07:51 +0100, Pratyush Anand wrote:
> > On Thu, Jan 23, 2014 at 01:52:19PM +0800, Jingoo Han wrote:
> > > On Thursday, January 23, 2014 5:39 AM, Jingoo Han wrote:
> > > > 
> > > > I’m currently playing with MSI support in pci-imx6.c using Harro Haan’s patch [*].
> > > > 
> > > > Are there any technical reasons why dw_pcie_msi_init cannot be called from dw_msi_setup_irq? Or rather,
> > > > why it should not?
> > > 
> > > No, there is no special reason.
> > > The patch (call dw_pcie_msi_init from dw_msi_setup_irq) would be
> > > good. Thank you for your effort.
> > > 
> > > Mohit, Pratyush,
> > > If you have different opinions, please let us know. :-)
> > 
> > dw_msi_setup_irq will be called for each function which needs msi
> > assignment. However, dw_pcie_msi_init should be called only once. So,
> > in my opinion calling dw_pcie_msi_init from dw_msi_setup_irq would not
> > be the best option.
> > 
> > @Bjørn, can you help us with tracing calling sequence of
> > dw_pcie_setup & dw_pcie_scan_bus. I think when you do "reset bridge",
> > it will call dw_pcie_setup and when you do "rescan bus", it will call
> > dw_pcie_scan_bus. If yes, then you can move dw_pcie_msi_init to
> > dw_pcie_setup.
> 
> 
> It looks like dw_pcie_setup and dw_pcie_scan_bus is only called when
> booting. Resetting the bridge or scanning the bus will not trigger any
> of these functions, unfortunately.

Yes, I browsed pcie sysfs rescan and reset code and it does not go
into that path. Sorry for the wrong pointers. I should have looked
into code earlier :(

Coming to the issue, I am still not convinced that msi_init part should
go to msi_setup_irq. May be something is missing.
@Mohit, Jingoo: How does remove, reset and rescan behave with your
platform.

Regards
Pratyush

> 
> I have looked for other hooks too, without luck.
> 
> > 
> > Regards
> > Pratyush
> > 
> > > 
> > > Best regards,
> > > Jingoo Han
> > > 
> > > > 
> > > > I’m asking because I have a hotplug scenario where this little hack (call dw_pcie_msi_init from
> > > > dw_msi_setup_irq) fixes a problem with MSI. I therefore need to understand whether it is a sensible
> > > > hack or just crap, and more importantly; how it can be fixed properly.
> > > > 
> > > > Scenario:
> > > > 
> > > > (remove endpoints)
> > > > # echo 1 > /sys/bus/pci/devices/0000:01:00.0/remove
> > > > # echo 1 > /sys/bus/pci/devices/0000:01:00.1/remove
> > > > 
> > > > # take fpga in and out of reset (this will mess up the configuration space of the bridge)
> > > > 
> > > > (reset bridge)
> > > > # echo 1 > /sys/bus/pci/devices/0000:00:00.0/reset
> > > > 
> > > > (rescan bus)
> > > > # echo 1 > /sys/bus/pci/rescan
> > > > 
> > > > At this point everything works fine except MSI. With above mention hack it works like a charm.
> > > > 
> > > > I would be grateful if someone could shed light on this. I might have missed some important details.
> > > > 
> > > > 
> > > > Best regards,
> > > > Bjørn Erik Nilsen
> > > > 
> > > > [*]
> > > > 
> > > > From: Harro Haan <hrhaan@gmail.com>
> > > > Date: Thu, 5 Dec 2013 14:06:37 +0100
> > > > Subject: [PATCH 2/2] PCI: imx6: add support for MSI
> 

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

* RE: designware/imx6: question regarding MSI
       [not found]         ` <6b747b65-ef6c-4f39-b61d-f534c981c98f@CH1EHSMHS003.ehs.local>
@ 2014-01-24  8:09           ` Hong-Xing.Zhu
  0 siblings, 0 replies; 9+ messages in thread
From: Hong-Xing.Zhu @ 2014-01-24  8:09 UTC (permalink / raw)
  To: Bjørn Erik Nilsen, Harro Haan
  Cc: Richard Zhu, Pratyush Anand, Jingoo Han,
	linux-pci@vger.kernel.org, Mohit KUMAR DCG, Marek Vasut

SGk6DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogQmrDuHJuIEVyaWsg
Tmlsc2VuIFttYWlsdG86YmVuQGRhdGFyZXNwb25zLm5vXQ0KPiBTZW50OiBGcmlkYXksIEphbnVh
cnkgMjQsIDIwMTQgMzo0NyBQTQ0KPiBUbzogSGFycm8gSGFhbg0KPiBDYzogUmljaGFyZCBaaHU7
IFpodSBSaWNoYXJkLVI2NTAzNzsgUHJhdHl1c2ggQW5hbmQ7IEppbmdvbyBIYW47IGxpbnV4LQ0K
PiBwY2lAdmdlci5rZXJuZWwub3JnOyBNb2hpdCBLVU1BUiBEQ0c7IE1hcmVrIFZhc3V0DQo+IFN1
YmplY3Q6IFJlOiBkZXNpZ253YXJlL2lteDY6IHF1ZXN0aW9uIHJlZ2FyZGluZyBNU0kNCj4gDQo+
IE9uIFRodSwgMjAxNC0wMS0yMyBhdCAxODozMiArMDEwMCwgSGFycm8gSGFhbiB3cm90ZToNCj4g
PiBPbiAyMyBKYW51YXJ5IDIwMTQgMTY6MjAsIEJqw7hybiBFcmlrIE5pbHNlbiA8YmVuQGRhdGFy
ZXNwb25zLm5vPiB3cm90ZToNCj4gPiA+IEhpIFByYXR5dXNoLA0KPiA+ID4NCj4gPiA+IE9uIFRo
dSwgMjAxNC0wMS0yMyBhdCAwNzo1MSArMDEwMCwgUHJhdHl1c2ggQW5hbmQgd3JvdGU6DQo+ID4g
Pj4gT24gVGh1LCBKYW4gMjMsIDIwMTQgYXQgMDE6NTI6MTlQTSArMDgwMCw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W1iZXIvMjENCj4g
PiA4NjI5Lmh0bWwNCj4gDQo+IFllcywgSSBoYXZlIHRoYXQgb25lIGFwcGxpZWQgYXMgd2VsbC4g
DQoNCkJlc3QgUmVnYXJkcw0KUmljaGFyZCBaaHUNCg==

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

* Re: designware/imx6: question regarding MSI
       [not found]         ` <8E.DE.30335.83C29E25@epmailin2.samsung.com>
@ 2014-02-03  9:28           ` Jingoo Han
  2014-02-03  9:55             ` Jingoo Han
  0 siblings, 1 reply; 9+ messages in thread
From: Jingoo Han @ 2014-02-03  9:28 UTC (permalink / raw)
  To: 'Bjørn Erik Nilsen'
  Cc: 'Pratyush Anand', 'Mohit KUMAR DCG', linux-pci,
	'Harro Haan', 'Marek Vasut', 'Jingoo Han'

On Thursday, January 30, 2014 1:29 AM, Bjørn Erik Nilsen wrote:
> On Fri, 2014-01-24 at 07:48 +0100, Pratyush Anand wrote:
> > On Thu, Jan 23, 2014 at 11:20:55PM +0800, Bjørn Erik Nilsen wrote:
> > > On Thu, 2014-01-23 at 07:51 +0100, Pratyush Anand wrote:
> > > > On Thu, Jan 23, 2014 at 01:52:19PM +0800, Jingoo Han wrote:
> > > > > On Thursday, January 23, 2014 5:39 AM, Jingoo Han wrote:
> > > > > >
> > > > > > I’m currently playing with MSI support in pci-imx6.c using Harro Haan’s patch [*].
> > > > > >
> > > > > > Are there any technical reasons why dw_pcie_msi_init cannot be called
> > > > > > from dw_msi_setup_irq?
> Or rather,
> > > > > > why it should not?
> > > > >
> > > > > No, there is no special reason.
> > > > > The patch (call dw_pcie_msi_init from dw_msi_setup_irq) would be
> > > > > good. Thank you for your effort.
> > > > >
> > > > > Mohit, Pratyush,
> > > > > If you have different opinions, please let us know. :-)
> > > >
> > > > dw_msi_setup_irq will be called for each function which needs msi
> > > > assignment. However, dw_pcie_msi_init should be called only once. So,
> > > > in my opinion calling dw_pcie_msi_init from dw_msi_setup_irq would not
> > > > be the best option.
> > > >
> > > > @Bjørn, can you help us with tracing calling sequence of
> > > > dw_pcie_setup & dw_pcie_scan_bus. I think when you do "reset bridge",
> > > > it will call dw_pcie_setup and when you do "rescan bus", it will call
> > > > dw_pcie_scan_bus. If yes, then you can move dw_pcie_msi_init to
> > > > dw_pcie_setup.
> > >
> > >
> > > It looks like dw_pcie_setup and dw_pcie_scan_bus is only called when
> > > booting. Resetting the bridge or scanning the bus will not trigger any
> > > of these functions, unfortunately.
> >
> > Yes, I browsed pcie sysfs rescan and reset code and it does not go
> > into that path. Sorry for the wrong pointers. I should have looked
> > into code earlier :(
> >
> > Coming to the issue, I am still not convinced that msi_init part should
> > go to msi_setup_irq. May be something is missing.
> > @Mohit, Jingoo: How does remove, reset and rescan behave with your
> > platform.
> 
> Any comments?

Sorry for late response.
I tested 'remove, reset and rescan' on Exynos platform
as you did.

(remove endpoints)
# echo 1 > /sys/bus/pci/devices/0000:01:00.0/remove
# echo 1 > /sys/bus/pci/devices/0000:01:00.1/remove

(reset bridge)
# echo 1 > /sys/bus/pci/devices/0000:00:00.0/reset

(rescan bus)
# echo 1 > /sys/bus/pci/rescan

Without MSI (legacy INTx mode), it works properly. However,
with MSI, it makes the problem.

> 
> I can prepare a patch (which calls dw_pcie_msi_init from
> dw_msi_setup_irq), however if this is not the right solution then we
> need to figure out what a proper solution should look like.

If you send the patch, I will test it on Exynos platform.
Thank you for your effort. :-)

Best regards,
Jingoo Han


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

* Re: designware/imx6: question regarding MSI
  2014-02-03  9:28           ` Jingoo Han
@ 2014-02-03  9:55             ` Jingoo Han
       [not found]               ` <C3.BD.30335.F2DBFE25@epmailin2.samsung.com>
  0 siblings, 1 reply; 9+ messages in thread
From: Jingoo Han @ 2014-02-03  9:55 UTC (permalink / raw)
  To: 'Bjørn Erik Nilsen'
  Cc: 'Pratyush Anand', 'Mohit KUMAR DCG', linux-pci,
	'Harro Haan', 'Marek Vasut', 'Jingoo Han'

On Monday, February 03, 2014 6:29 PM, Jingoo Han wrote:
> On Thursday, January 30, 2014 1:29 AM, Bjørn Erik Nilsen wrote:
> > On Fri, 2014-01-24 at 07:48 +0100, Pratyush Anand wrote:
> > > On Thu, Jan 23, 2014 at 11:20:55PM +0800, Bjørn Erik Nilsen wrote:
> > > > On Thu, 2014-01-23 at 07:51 +0100, Pratyush Anand wrote:
> > > > > On Thu, Jan 23, 2014 at 01:52:19PM +0800, Jingoo Han wrote:
> > > > > > On Thursday, January 23, 2014 5:39 AM, Jingoo Han wrote:
> > > > > > >
> > > > > > > I’m currently playing with MSI support in pci-imx6.c using Harro Haan’s patch [*].
> > > > > > >
> > > > > > > Are there any technical reasons why dw_pcie_msi_init cannot be called
> > > > > > > from dw_msi_setup_irq?
> > Or rather,
> > > > > > > why it should not?
> > > > > >
> > > > > > No, there is no special reason.
> > > > > > The patch (call dw_pcie_msi_init from dw_msi_setup_irq) would be
> > > > > > good. Thank you for your effort.
> > > > > >
> > > > > > Mohit, Pratyush,
> > > > > > If you have different opinions, please let us know. :-)
> > > > >
> > > > > dw_msi_setup_irq will be called for each function which needs msi
> > > > > assignment. However, dw_pcie_msi_init should be called only once. So,
> > > > > in my opinion calling dw_pcie_msi_init from dw_msi_setup_irq would not
> > > > > be the best option.
> > > > >
> > > > > @Bjørn, can you help us with tracing calling sequence of
> > > > > dw_pcie_setup & dw_pcie_scan_bus. I think when you do "reset bridge",
> > > > > it will call dw_pcie_setup and when you do "rescan bus", it will call
> > > > > dw_pcie_scan_bus. If yes, then you can move dw_pcie_msi_init to
> > > > > dw_pcie_setup.
> > > >
> > > >
> > > > It looks like dw_pcie_setup and dw_pcie_scan_bus is only called when
> > > > booting. Resetting the bridge or scanning the bus will not trigger any
> > > > of these functions, unfortunately.
> > >
> > > Yes, I browsed pcie sysfs rescan and reset code and it does not go
> > > into that path. Sorry for the wrong pointers. I should have looked
> > > into code earlier :(
> > >
> > > Coming to the issue, I am still not convinced that msi_init part should
> > > go to msi_setup_irq. May be something is missing.
> > > @Mohit, Jingoo: How does remove, reset and rescan behave with your
> > > platform.
> >
> > Any comments?
> 
> Sorry for late response.
> I tested 'remove, reset and rescan' on Exynos platform
> as you did.
> 
> (remove endpoints)
> # echo 1 > /sys/bus/pci/devices/0000:01:00.0/remove
> # echo 1 > /sys/bus/pci/devices/0000:01:00.1/remove
> 
> (reset bridge)
> # echo 1 > /sys/bus/pci/devices/0000:00:00.0/reset
> 
> (rescan bus)
> # echo 1 > /sys/bus/pci/rescan
> 
> Without MSI (legacy INTx mode), it works properly. However,
> with MSI, it makes the problem.

Oh, there was my mistake. There is no problem on Exynos platform.
I tested two different LAN cards. With MSI, 'remove, reset and
rescan' works properly on Exynos platform using the current
pci/next tree. Sorry for the confusion.
Thank you.

Best regards,
Jingoo Han

> 
> >
> > I can prepare a patch (which calls dw_pcie_msi_init from
> > dw_msi_setup_irq), however if this is not the right solution then we
> > need to figure out what a proper solution should look like.
> 
> If you send the patch, I will test it on Exynos platform.
> Thank you for your effort. :-)
> 
> Best regards,
> Jingoo Han


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

* Re: designware/imx6: question regarding MSI
       [not found]               ` <C3.BD.30335.F2DBFE25@epmailin2.samsung.com>
@ 2014-02-04  4:40                 ` Jingoo Han
  2014-02-05  3:13                   ` Marek Vasut
  0 siblings, 1 reply; 9+ messages in thread
From: Jingoo Han @ 2014-02-04  4:40 UTC (permalink / raw)
  To: 'Bjørn Erik Nilsen'
  Cc: 'Pratyush Anand', 'Mohit KUMAR DCG', linux-pci,
	'Harro Haan', 'Marek Vasut', 'Jingoo Han'

On Tuesday, February 04, 2014 1:01 AM, Bjørn Erik Nilsen wrote:
> On Mon, 2014-02-03 at 10:55 +0100, Jingoo Han wrote:
> > On Monday, February 03, 2014 6:29 PM, Jingoo Han wrote:
> > > On Thursday, January 30, 2014 1:29 AM, Bjørn Erik Nilsen wrote:
> > > > On Fri, 2014-01-24 at 07:48 +0100, Pratyush Anand wrote:
> > > > >
> > > > > Yes, I browsed pcie sysfs rescan and reset code and it does not go
> > > > > into that path. Sorry for the wrong pointers. I should have looked
> > > > > into code earlier :(
> > > > >
> > > > > Coming to the issue, I am still not convinced that msi_init part should
> > > > > go to msi_setup_irq. May be something is missing.
> > > > > @Mohit, Jingoo: How does remove, reset and rescan behave with your
> > > > > platform.
> > > >
> > > > Any comments?
> > >
> > > Sorry for late response.
> > > I tested 'remove, reset and rescan' on Exynos platform
> > > as you did.
> > >
> > > (remove endpoints)
> > > # echo 1 > /sys/bus/pci/devices/0000:01:00.0/remove
> > > # echo 1 > /sys/bus/pci/devices/0000:01:00.1/remove
> > >
> > > (reset bridge)
> > > # echo 1 > /sys/bus/pci/devices/0000:00:00.0/reset
> > >
> > > (rescan bus)
> > > # echo 1 > /sys/bus/pci/rescan
> > >
> > > Without MSI (legacy INTx mode), it works properly. However,
> > > with MSI, it makes the problem.
> >
> > Oh, there was my mistake. There is no problem on Exynos platform.
> > I tested two different LAN cards. With MSI, 'remove, reset and
> > rescan' works properly on Exynos platform using the current
> > pci/next tree. Sorry for the confusion.
> > Thank you.
> 
> Right.
> 
> So if I understand you correctly it works fine with pci/next, however
> you were able to reproduce with an earlier kernel version? That is
> indeed very good news. I will try to pull in the latest and greatest
> from pci/next to verify this.

Hi Bjørn Erik Nilsen,

I tested an earlier kernel v3.13. As you know, this version have
Some problems about designware PCIe MSI handling.

I tested the latest v3.14-rc1 kernel (vanilla kernel). It works
properly. Currently, v3.14-rc1 kernel was merged to the current
pci/next kernel. So, you can test 'mainline kernel v3.14-rc1' or
'the latest pci/next kernel'. (the commit 7f2d86 "Merge branch
'pci/numa-cleanup' into next")

If you have some problems, please let us know. :-)
Thank you.

Best regards,
Jingoo Han


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

* Re: designware/imx6: question regarding MSI
  2014-02-04  4:40                 ` Jingoo Han
@ 2014-02-05  3:13                   ` Marek Vasut
  0 siblings, 0 replies; 9+ messages in thread
From: Marek Vasut @ 2014-02-05  3:13 UTC (permalink / raw)
  To: Jingoo Han
  Cc: 'Bjørn Erik Nilsen', 'Pratyush Anand',
	'Mohit KUMAR DCG', linux-pci, 'Harro Haan'

On Tuesday, February 04, 2014 at 05:40:07 AM, Jingoo Han wrote:

[...]

> Hi Bjørn Erik Nilsen,
> 
> I tested an earlier kernel v3.13. As you know, this version have
> Some problems about designware PCIe MSI handling.
> 
> I tested the latest v3.14-rc1 kernel (vanilla kernel). It works
> properly. Currently, v3.14-rc1 kernel was merged to the current
> pci/next kernel. So, you can test 'mainline kernel v3.14-rc1' or
> 'the latest pci/next kernel'. (the commit 7f2d86 "Merge branch
> 'pci/numa-cleanup' into next")
> 
> If you have some problems, please let us know. :-)
> Thank you.

I'm now also back in the game, so please keep me on the list.

Best regards,
Marek Vasut

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

end of thread, other threads:[~2014-02-05  3:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <25.15.01844.D5C20E25@epmailin6.samsung.com>
2014-01-23  5:52 ` designware/imx6: question regarding MSI Jingoo Han
2014-01-23  6:51   ` Pratyush Anand
     [not found]     ` <52e1335a.8917980a.31fa.ffffd7a8SMTPIN_ADDED_MISSING@mx.google.com>
2014-01-23 17:32       ` Harro Haan
     [not found]         ` <6b747b65-ef6c-4f39-b61d-f534c981c98f@CH1EHSMHS003.ehs.local>
2014-01-24  8:09           ` Hong-Xing.Zhu
     [not found]     ` <56523137843406465091127182657491@psmtp.com>
2014-01-24  6:48       ` Pratyush Anand
     [not found]         ` <8E.DE.30335.83C29E25@epmailin2.samsung.com>
2014-02-03  9:28           ` Jingoo Han
2014-02-03  9:55             ` Jingoo Han
     [not found]               ` <C3.BD.30335.F2DBFE25@epmailin2.samsung.com>
2014-02-04  4:40                 ` Jingoo Han
2014-02-05  3:13                   ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).