Re: [PATCH v2 06/22] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip

2014-09-27 Thread Yijing Wang
 MSI chip in this series is to setup MSI irq, including IRQ allocation, Map,
 compose MSI msg ..., in different platform, many arch specific MSI irq 
 details in it.
 It's difficult to extract the common data and code.

 I have a plan to rework MSI related irq_chips in kernel, PCI and Non-PCI, 
 currently,
 HPET, DMAR and PCI have their own irq_chip and MSI related functions, 
 write_msi_msg(),
 mask_msi_irq(), etc... I want to extract the common data set for that, so we 
 can
 remove lots of unnecessary MSI code.
 
 That makes sense. Can you please make sure that this does not conflict
 with the ongoing work Jiang is doing in the x86 irq area with
 hierarchical irqdomains to distangle layered levels like MSI from the
 underlying vector/irqremap mechanics.

Yes, I'm reviewing Jiang hierarchical irqdomains series, I'm interested in that 
changes.

Thanks!
Yijing.

 
 Thanks,
 
   tglx
 
 .
 


-- 
Thanks!
Yijing

___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: [PATCH v2 06/22] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip

2014-09-26 Thread Thomas Gleixner
On Fri, 26 Sep 2014, Yijing Wang wrote:
 On 2014/9/25 18:38, Thomas Gleixner wrote:
  On Thu, 25 Sep 2014, Yijing Wang wrote:
  
  Introduce weak arch_find_msi_chip() to find the match msi_chip.
  Currently, MSI chip associates pci bus to msi_chip. Because in
  ARM platform, there may be more than one MSI controller in system.
  Associate pci bus to msi_chip help pci device to find the match
  msi_chip and setup MSI/MSI-X irq correctly. But in other platform,
  like in x86. we only need one MSI chip, because all device use
  the same MSI address/data and irq etc. So it's no need to associate
  pci bus to MSI chip, just use a arch function, arch_find_msi_chip()
  to return the MSI chip for simplicity. The default weak
  arch_find_msi_chip() used in ARM platform, find the MSI chip
  by pci bus.
  
  This is really backwards. On one hand you try to get rid of the weak
  arch functions zoo and then you invent new ones for no good
  reason. Why can't x86 store the chip in the pci bus?
  
  Looking deeper, I'm questioning the whole notion of different
  msi_chips. Are this really different MSI controllers with a different
  feature set or are this defacto multiple instances of the same
  controller which just need a different data set?
 
 MSI chip in this series is to setup MSI irq, including IRQ allocation, Map,
 compose MSI msg ..., in different platform, many arch specific MSI irq 
 details in it.
 It's difficult to extract the common data and code.
 
 I have a plan to rework MSI related irq_chips in kernel, PCI and Non-PCI, 
 currently,
 HPET, DMAR and PCI have their own irq_chip and MSI related functions, 
 write_msi_msg(),
 mask_msi_irq(), etc... I want to extract the common data set for that, so we 
 can
 remove lots of unnecessary MSI code.

That makes sense. Can you please make sure that this does not conflict
with the ongoing work Jiang is doing in the x86 irq area with
hierarchical irqdomains to distangle layered levels like MSI from the
underlying vector/irqremap mechanics.

Thanks,

tglx
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: [PATCH v2 06/22] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip

2014-09-25 Thread Thierry Reding
On Thu, Sep 25, 2014 at 11:14:16AM +0800, Yijing Wang wrote:
 Introduce weak arch_find_msi_chip() to find the match msi_chip.
 Currently, MSI chip associates pci bus to msi_chip. Because in
 ARM platform, there may be more than one MSI controller in system.
 Associate pci bus to msi_chip help pci device to find the match
 msi_chip and setup MSI/MSI-X irq correctly. But in other platform,
 like in x86. we only need one MSI chip, because all device use
 the same MSI address/data and irq etc. So it's no need to associate
 pci bus to MSI chip, just use a arch function, arch_find_msi_chip()
 to return the MSI chip for simplicity. The default weak
 arch_find_msi_chip() used in ARM platform, find the MSI chip
 by pci bus.

Can't x86 simply set the bus' .msi field anyway? It would seem to be
easy to do and unifies the code rather than driving it further apart
using even more of the __weak functions.

Thierry


pgpeQUDOlrou7.pgp
Description: PGP signature
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH v2 06/22] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip

2014-09-25 Thread Thomas Gleixner
On Thu, 25 Sep 2014, Yijing Wang wrote:

 Introduce weak arch_find_msi_chip() to find the match msi_chip.
 Currently, MSI chip associates pci bus to msi_chip. Because in
 ARM platform, there may be more than one MSI controller in system.
 Associate pci bus to msi_chip help pci device to find the match
 msi_chip and setup MSI/MSI-X irq correctly. But in other platform,
 like in x86. we only need one MSI chip, because all device use
 the same MSI address/data and irq etc. So it's no need to associate
 pci bus to MSI chip, just use a arch function, arch_find_msi_chip()
 to return the MSI chip for simplicity. The default weak
 arch_find_msi_chip() used in ARM platform, find the MSI chip
 by pci bus.

This is really backwards. On one hand you try to get rid of the weak
arch functions zoo and then you invent new ones for no good
reason. Why can't x86 store the chip in the pci bus?

Looking deeper, I'm questioning the whole notion of different
msi_chips. Are this really different MSI controllers with a different
feature set or are this defacto multiple instances of the same
controller which just need a different data set?

Thanks,

tglx
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: [PATCH v2 06/22] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip

2014-09-25 Thread Yijing Wang
On 2014/9/25 15:26, Thierry Reding wrote:
 On Thu, Sep 25, 2014 at 11:14:16AM +0800, Yijing Wang wrote:
 Introduce weak arch_find_msi_chip() to find the match msi_chip.
 Currently, MSI chip associates pci bus to msi_chip. Because in
 ARM platform, there may be more than one MSI controller in system.
 Associate pci bus to msi_chip help pci device to find the match
 msi_chip and setup MSI/MSI-X irq correctly. But in other platform,
 like in x86. we only need one MSI chip, because all device use
 the same MSI address/data and irq etc. So it's no need to associate
 pci bus to MSI chip, just use a arch function, arch_find_msi_chip()
 to return the MSI chip for simplicity. The default weak
 arch_find_msi_chip() used in ARM platform, find the MSI chip
 by pci bus.
 
 Can't x86 simply set the bus' .msi field anyway? It would seem to be
 easy to do and unifies the code rather than driving it further apart
 using even more of the __weak functions.

As mentioned in the first reply, I will rework this one when we find a better 
solution.

Thanks!
Yijing.

 
 Thierry
 


-- 
Thanks!
Yijing

___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: [PATCH v2 06/22] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip

2014-09-25 Thread Yijing Wang
On 2014/9/25 18:38, Thomas Gleixner wrote:
 On Thu, 25 Sep 2014, Yijing Wang wrote:
 
 Introduce weak arch_find_msi_chip() to find the match msi_chip.
 Currently, MSI chip associates pci bus to msi_chip. Because in
 ARM platform, there may be more than one MSI controller in system.
 Associate pci bus to msi_chip help pci device to find the match
 msi_chip and setup MSI/MSI-X irq correctly. But in other platform,
 like in x86. we only need one MSI chip, because all device use
 the same MSI address/data and irq etc. So it's no need to associate
 pci bus to MSI chip, just use a arch function, arch_find_msi_chip()
 to return the MSI chip for simplicity. The default weak
 arch_find_msi_chip() used in ARM platform, find the MSI chip
 by pci bus.
 
 This is really backwards. On one hand you try to get rid of the weak
 arch functions zoo and then you invent new ones for no good
 reason. Why can't x86 store the chip in the pci bus?

Hi Thomas, I introduced this weak function , because I thought all platforms
except arm always have only one msi chip, and I hoped to provide a simplest
solution, less code changes. I consider several solutions to associate msi chip
and PCI device. In my reply to Thierry in first reply,
http://marc.info/?l=linux-pcim=141169658208255w=2
Could you give me some advices ?

Thanks!
Yijing.


 
 Looking deeper, I'm questioning the whole notion of different
 msi_chips. Are this really different MSI controllers with a different
 feature set or are this defacto multiple instances of the same
 controller which just need a different data set?
 
 Thanks,
 
   tglx
 
 .
 


-- 
Thanks!
Yijing

___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: [PATCH v2 06/22] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip

2014-09-25 Thread Yijing Wang
On 2014/9/25 18:38, Thomas Gleixner wrote:
 On Thu, 25 Sep 2014, Yijing Wang wrote:
 
 Introduce weak arch_find_msi_chip() to find the match msi_chip.
 Currently, MSI chip associates pci bus to msi_chip. Because in
 ARM platform, there may be more than one MSI controller in system.
 Associate pci bus to msi_chip help pci device to find the match
 msi_chip and setup MSI/MSI-X irq correctly. But in other platform,
 like in x86. we only need one MSI chip, because all device use
 the same MSI address/data and irq etc. So it's no need to associate
 pci bus to MSI chip, just use a arch function, arch_find_msi_chip()
 to return the MSI chip for simplicity. The default weak
 arch_find_msi_chip() used in ARM platform, find the MSI chip
 by pci bus.
 
 This is really backwards. On one hand you try to get rid of the weak
 arch functions zoo and then you invent new ones for no good
 reason. Why can't x86 store the chip in the pci bus?
 
 Looking deeper, I'm questioning the whole notion of different
 msi_chips. Are this really different MSI controllers with a different
 feature set or are this defacto multiple instances of the same
 controller which just need a different data set?

MSI chip in this series is to setup MSI irq, including IRQ allocation, Map,
compose MSI msg ..., in different platform, many arch specific MSI irq details 
in it.
It's difficult to extract the common data and code.

I have a plan to rework MSI related irq_chips in kernel, PCI and Non-PCI, 
currently,
HPET, DMAR and PCI have their own irq_chip and MSI related functions, 
write_msi_msg(),
mask_msi_irq(), etc... I want to extract the common data set for that, so we can
remove lots of unnecessary MSI code.

Thanks!
Yijing.

 
 Thanks,
 
   tglx
 
 .
 


-- 
Thanks!
Yijing

___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu