Re: [PATCH] PCI: dwc: skip MSI init if MSIs have been explicitly disabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[+cc Marc, in case you have any suggestions]

Hi Lucas,

Nit: this has already been merged, but next time please make the
subject line match the convention wrt capitalization.  This is not a
PCI-specific idea; all it takes is "git log --oneline <file>", and
that should be common practice anywhere in the kernel.

On Wed, Feb 27, 2019 at 05:52:19PM +0100, Lucas Stach wrote:
> Since 7c5925afbc58 (PCI: dwc: Move MSI IRQs allocation to IRQ domains
> hierarchical API) the MSI init claims one of the controller IRQs as a
> chained IRQ line for the MSI controller. On some designs, like the i.MX6,
> this line is shared with a PCIe legacy IRQ. When the line is claimed for
> the MSI domain, any device trying to use this legacy IRQs will fail to
> request this IRQ line.
> 
> As MSI and legacy IRQs are already mutually exclusive on the DWC core,
> as the core won't forward any legacy IRQs once any MSI has been enabled,
> users wishing to use legacy IRQs already need to explictly disable MSI
> support (usually via the pci=nomsi kernel commandline option). To avoid
> any issues with MSI conflicting with legacy IRQs, just skip all of the
> DWC MSI initalization, including the IRQ line claim, when MSI is disabled.

Does this mean that if we have a device that uses legacy IRQs, the
user has to figure out to boot with "pci=nomsi"?

I don't like kernel command line parameters.  If we need that
parameter to make devices with legacy IRQs work, what happens without
the parameter?  How obvious is it that the fix is to use "pci=nomsi"?
Is it impossible for Linux to figure this out and make it work
automatically?

If we can't do it automatically, fine, maybe we have to live with the
parameter.  But if there's any way we can avoid it, we should.

> Fixes: c5925afbc58
>        (PCI: dwc: Move MSI IRQs allocation to IRQ domains hierarchical API)
> Signed-off-by: Lucas Stach <l.stach@xxxxxxxxxxxxxx>
> Tested-by: Tim Harvey <tharvey@xxxxxxxxxxxxx>
> ---
>  drivers/pci/controller/dwc/pcie-designware-host.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
> index 29a05759a294..f4a8494f616b 100644
> --- a/drivers/pci/controller/dwc/pcie-designware-host.c
> +++ b/drivers/pci/controller/dwc/pcie-designware-host.c
> @@ -433,7 +433,7 @@ int dw_pcie_host_init(struct pcie_port *pp)
>  	if (ret)
>  		pci->num_viewport = 2;
>  
> -	if (IS_ENABLED(CONFIG_PCI_MSI)) {
> +	if (IS_ENABLED(CONFIG_PCI_MSI) && pci_msi_enabled()) {
>  		/*
>  		 * If a specific SoC driver needs to change the
>  		 * default number of vectors, it needs to implement
> -- 
> 2.20.1
> 



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux