diff mbox series

[v2,4/5] PCI: dwc: Skip PCIE_MSI_INTR0* programming if MSI is disabled

Message ID 20200924190713.74e0afd6@xhacker.debian (mailing list archive)
State Superseded, archived
Headers show
Series PCI: dwc: improve msi handling | expand

Commit Message

Jisheng Zhang Sept. 24, 2020, 11:07 a.m. UTC
If MSI is disabled, there's no need to program PCIE_MSI_INTR0_MASK
and PCIE_MSI_INTR0_ENABLE registers.

Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
---
 drivers/pci/controller/dwc/pcie-designware-host.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Gustavo Pimentel Sept. 24, 2020, 11:49 a.m. UTC | #1
On Thu, Sep 24, 2020 at 12:7:13, Jisheng Zhang 
<Jisheng.Zhang@synaptics.com> wrote:

> If MSI is disabled, there's no need to program PCIE_MSI_INTR0_MASK
> and PCIE_MSI_INTR0_ENABLE registers.
> 
> Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
> ---
>  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 d2de8bc5db91..7a8adf597803 100644
> --- a/drivers/pci/controller/dwc/pcie-designware-host.c
> +++ b/drivers/pci/controller/dwc/pcie-designware-host.c
> @@ -641,7 +641,7 @@ void dw_pcie_setup_rc(struct pcie_port *pp)
>  
>  	dw_pcie_setup(pci);
>  
> -	if (!pp->ops->msi_host_init) {
> +	if (pci_msi_enabled() && !pp->ops->msi_host_init) {
>  		num_ctrls = pp->num_vectors / MAX_MSI_IRQS_PER_CTRL;
>  
>  		/* Initialize IRQ Status array */
> -- 
> 2.28.0

Acked-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
diff mbox series

Patch

diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
index d2de8bc5db91..7a8adf597803 100644
--- a/drivers/pci/controller/dwc/pcie-designware-host.c
+++ b/drivers/pci/controller/dwc/pcie-designware-host.c
@@ -641,7 +641,7 @@  void dw_pcie_setup_rc(struct pcie_port *pp)
 
 	dw_pcie_setup(pci);
 
-	if (!pp->ops->msi_host_init) {
+	if (pci_msi_enabled() && !pp->ops->msi_host_init) {
 		num_ctrls = pp->num_vectors / MAX_MSI_IRQS_PER_CTRL;
 
 		/* Initialize IRQ Status array */