All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI: designware: fix dw_pcie_cfg_write
@ 2015-08-20 13:58 Gabriele Paoloni
  2015-08-21  1:51 ` Zhou Wang
  2015-09-03 20:59 ` Bjorn Helgaas
  0 siblings, 2 replies; 12+ messages in thread
From: Gabriele Paoloni @ 2015-08-20 13:58 UTC (permalink / raw)
  To: bhelgaas, linux-pci
  Cc: gabriele.paoloni, wangzhou1, jingoohan1, pratyush.anand,
	yuanzhichang, zhudacai, zhangjukuo, qiuzhenfa, liguozhu

From: gabriele paoloni <gabriele.paoloni@huawei.com>

Currently in dw_pcie_cfg_write() if the input size is 2 bytes
the address offset is wrongly calculated as we mask also bit0
of "where" input parameter. Instead we should mask all bits of
"where" except bit0 and bit1.

Signed-off-by: Gabriele Paoloni <gabriele.paoloni@huawei.com>
---
 drivers/pci/host/pcie-designware.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
index 69486be..a27f536 100644
--- a/drivers/pci/host/pcie-designware.c
+++ b/drivers/pci/host/pcie-designware.c
@@ -99,7 +99,7 @@ int dw_pcie_cfg_write(void __iomem *addr, int where, int size, u32 val)
 	if (size == 4)
 		writel(val, addr);
 	else if (size == 2)
-		writew(val, addr + (where & 2));
+		writew(val, addr + (where & 3));
 	else if (size == 1)
 		writeb(val, addr + (where & 3));
 	else
-- 
1.9.1


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

end of thread, other threads:[~2015-09-08 16:20 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-20 13:58 [PATCH] PCI: designware: fix dw_pcie_cfg_write Gabriele Paoloni
2015-08-21  1:51 ` Zhou Wang
2015-08-21  4:48   ` Jingoo Han
2015-08-21  5:16     ` Zhou Wang
2015-08-21  8:58     ` Gabriele Paoloni
2015-08-21  9:25       ` Jingoo Han
2015-08-21 10:29         ` Gabriele Paoloni
2015-08-21 11:07           ` Jingoo Han
2015-08-21 12:40             ` Gabriele Paoloni
2015-09-03 20:59 ` Bjorn Helgaas
2015-09-04  6:06   ` Pratyush Anand
2015-09-08 16:19     ` Gabriele Paoloni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.