Message ID | 1626838752-7013-1-git-send-email-vincent.chen@sifive.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v2] riscv: Kconfig: do not select PCI_MSI if CONIFG_PCI is enabled | expand |
On Wed, Jul 21, 2021 at 11:39:12AM +0800, Vincent Chen wrote: > The CONFIG_PCI_MSI is used to allow device drivers to enable MSI. The MSI > enables a device to generate an interrupt using an inbound Memory Write > on its PCI bus instead of asserting a device IRQ pin. The whole mechanism > needs support from the PCI controller or generic interrupt controller and > the corresponding software driver. > > The RISC-V Kconfig file actively selects the PCI_MSI if users enable > CONFIG_PCI. However, the RISC-V specification does not require every RISC-V > platform shall have MSI support. In other words, Kconfig enables CONFIG_PCI > to allow PCI devices to use MSI, but due to lack of MSI support, the kernel > may not have any function to deal with the MSI from PCI devices. When this > case happens, it leads to the following warning message displayed in > booting a v5.10~v5.12 kernel. So make sure the runtime detection works fine. An x86 kernel with CONFIG_PCI_MSI also works on non-MSI systems. NAK to this patch.
On Wed, Jul 21, 2021 at 1:57 PM Christoph Hellwig <hch@infradead.org> wrote: > > On Wed, Jul 21, 2021 at 11:39:12AM +0800, Vincent Chen wrote: > > The CONFIG_PCI_MSI is used to allow device drivers to enable MSI. The MSI > > enables a device to generate an interrupt using an inbound Memory Write > > on its PCI bus instead of asserting a device IRQ pin. The whole mechanism > > needs support from the PCI controller or generic interrupt controller and > > the corresponding software driver. > > > > The RISC-V Kconfig file actively selects the PCI_MSI if users enable > > CONFIG_PCI. However, the RISC-V specification does not require every RISC-V > > platform shall have MSI support. In other words, Kconfig enables CONFIG_PCI > > to allow PCI devices to use MSI, but due to lack of MSI support, the kernel > > may not have any function to deal with the MSI from PCI devices. When this > > case happens, it leads to the following warning message displayed in > > booting a v5.10~v5.12 kernel. > > So make sure the runtime detection works fine. An x86 kernel with > CONFIG_PCI_MSI also works on non-MSI systems. > > NAK to this patch. Thanks for your information. I think this will be a good reference to solve this warning message for the v5.10~v5.12 riscv kernel. However, the current RISC-V does not specify that each platform must have a controller to support PCI_MSI. Even there is no a ratified specification to provide an interrupt controller to support MSI. In this circumstance, removing the CONFIG_PCI_MSI selection from the Kconfig file seems to more close to the RISC-V platform setting. I guess that is why most architectures, such as ARM and x86, do not add "select PCI_MSI if PCI" to their Kconfig file. Therefore, I prefer to remove the "select PCI_MSI if PCI" from the Kconfig file. Please correct me if I have misunderstands. Thank you.
Just a gentle ping. If there are still problems with this patch, please let me know. Thank you. On Thu, Jul 22, 2021 at 10:21 AM Vincent Chen <vincent.chen@sifive.com> wrote: > > On Wed, Jul 21, 2021 at 1:57 PM Christoph Hellwig <hch@infradead.org> wrote: > > > > On Wed, Jul 21, 2021 at 11:39:12AM +0800, Vincent Chen wrote: > > > The CONFIG_PCI_MSI is used to allow device drivers to enable MSI. The MSI > > > enables a device to generate an interrupt using an inbound Memory Write > > > on its PCI bus instead of asserting a device IRQ pin. The whole mechanism > > > needs support from the PCI controller or generic interrupt controller and > > > the corresponding software driver. > > > > > > The RISC-V Kconfig file actively selects the PCI_MSI if users enable > > > CONFIG_PCI. However, the RISC-V specification does not require every RISC-V > > > platform shall have MSI support. In other words, Kconfig enables CONFIG_PCI > > > to allow PCI devices to use MSI, but due to lack of MSI support, the kernel > > > may not have any function to deal with the MSI from PCI devices. When this > > > case happens, it leads to the following warning message displayed in > > > booting a v5.10~v5.12 kernel. > > > > So make sure the runtime detection works fine. An x86 kernel with > > CONFIG_PCI_MSI also works on non-MSI systems. > > > > NAK to this patch. > > Thanks for your information. I think this will be a good reference to > solve this warning message for the v5.10~v5.12 riscv kernel. However, > the current RISC-V does not specify that each platform must have a > controller to support PCI_MSI. Even there is no a ratified > specification to provide an interrupt controller to support MSI. In > this circumstance, removing the CONFIG_PCI_MSI selection from the > Kconfig file seems to more close to the RISC-V platform setting. I > guess that is why most architectures, such as ARM and x86, do not add > "select PCI_MSI if PCI" to their Kconfig file. Therefore, I prefer to > remove the "select PCI_MSI if PCI" from the Kconfig file. Please > correct me if I have misunderstands. > > Thank you.
Nothing changed at all from my previous reply. This patch is wrong, and you need to implement proper runtime detection.
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 469a70bd8da6..563d550cb682 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -97,7 +97,6 @@ config RISCV select OF_EARLY_FLATTREE select OF_IRQ select PCI_DOMAINS_GENERIC if PCI - select PCI_MSI if PCI select RISCV_INTC select RISCV_TIMER if RISCV_SBI select SPARSE_IRQ