linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] PCI: dwc: Fix MSI-X EP framework address calculation bug
@ 2018-11-23 17:00 Gustavo Pimentel
  2018-11-27 11:36 ` Lorenzo Pieralisi
  0 siblings, 1 reply; 2+ messages in thread
From: Gustavo Pimentel @ 2018-11-23 17:00 UTC (permalink / raw)
  To: jingoohan1, bhelgaas, lorenzo.pieralisi
  Cc: joao.pinto, linux-pci, Gustavo Pimentel, stable

Fixes an error caused by 3-bit right rotation on offset address
calculation of MSI-X table in dw_pcie_ep_raise_msix_irq().

During the development time, by default the offset address of MSI-X
table was set to zero, so that even with a 3-bit right rotation the
computed result would still be zero and valid, therefore not being
noticed this bug.

Fixes: beb4641a787d ("PCI: dwc: Add MSI-X callbacks handler")
Signed-off-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
Cc: stable@vger.kernel.org
---
 drivers/pci/controller/dwc/pcie-designware-ep.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c
index 1e7b022..de8635a 100644
--- a/drivers/pci/controller/dwc/pcie-designware-ep.c
+++ b/drivers/pci/controller/dwc/pcie-designware-ep.c
@@ -440,7 +440,6 @@ int dw_pcie_ep_raise_msix_irq(struct dw_pcie_ep *ep, u8 func_no,
 	tbl_offset = dw_pcie_readl_dbi(pci, reg);
 	bir = (tbl_offset & PCI_MSIX_TABLE_BIR);
 	tbl_offset &= PCI_MSIX_TABLE_OFFSET;
-	tbl_offset >>= 3;
 
 	reg = PCI_BASE_ADDRESS_0 + (4 * bir);
 	bar_addr_upper = 0;
-- 
2.7.4


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

* Re: [PATCH v2] PCI: dwc: Fix MSI-X EP framework address calculation bug
  2018-11-23 17:00 [PATCH v2] PCI: dwc: Fix MSI-X EP framework address calculation bug Gustavo Pimentel
@ 2018-11-27 11:36 ` Lorenzo Pieralisi
  0 siblings, 0 replies; 2+ messages in thread
From: Lorenzo Pieralisi @ 2018-11-27 11:36 UTC (permalink / raw)
  To: Gustavo Pimentel; +Cc: jingoohan1, bhelgaas, joao.pinto, linux-pci, stable

On Fri, Nov 23, 2018 at 06:00:21PM +0100, Gustavo Pimentel wrote:
> Fixes an error caused by 3-bit right rotation on offset address
> calculation of MSI-X table in dw_pcie_ep_raise_msix_irq().
> 
> During the development time, by default the offset address of MSI-X
> table was set to zero, so that even with a 3-bit right rotation the
> computed result would still be zero and valid, therefore not being
> noticed this bug.
> 
> Fixes: beb4641a787d ("PCI: dwc: Add MSI-X callbacks handler")
> Signed-off-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
> Cc: stable@vger.kernel.org
> ---
>  drivers/pci/controller/dwc/pcie-designware-ep.c | 1 -
>  1 file changed, 1 deletion(-)

Applied to pci/controller-fixes for the upcoming rc, thanks.

Lorenzo

> diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c
> index 1e7b022..de8635a 100644
> --- a/drivers/pci/controller/dwc/pcie-designware-ep.c
> +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c
> @@ -440,7 +440,6 @@ int dw_pcie_ep_raise_msix_irq(struct dw_pcie_ep *ep, u8 func_no,
>  	tbl_offset = dw_pcie_readl_dbi(pci, reg);
>  	bir = (tbl_offset & PCI_MSIX_TABLE_BIR);
>  	tbl_offset &= PCI_MSIX_TABLE_OFFSET;
> -	tbl_offset >>= 3;
>  
>  	reg = PCI_BASE_ADDRESS_0 + (4 * bir);
>  	bar_addr_upper = 0;
> -- 
> 2.7.4
> 

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

end of thread, other threads:[~2018-11-27 11:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-23 17:00 [PATCH v2] PCI: dwc: Fix MSI-X EP framework address calculation bug Gustavo Pimentel
2018-11-27 11:36 ` Lorenzo Pieralisi

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).