Skip to contentSkip to conversation

PCI: altera: Fix TLP completion status

PATCH In review Yadi Hu 3 participants 4 messages Feb 17, 2017 PCI

lore
Share & tools
lore

Yadi Hu

author
#0 lore raw

the upstream driver does not use exactly 'Completion Status' value in TLP, these bits should be b15:13 not b14:12.

author
#1 lore raw

PATCH 1/1 PCI: altera: Fix TLP completion status

From: "Hu Yadi" <[email protected]>

the driver does not use exactly 'Completion Status' value in TLP, these bits should be b15:13 not b14:12.

---
 drivers/pci/host/pcie-altera.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/host/pcie-altera.c +1 -1
index dbac6fb..650862e 100644
@@ -56,7 +56,7 @@
 #define TLP_CFG_DW2(bus, devfn, offset)	\
 				(((bus) << 24) | ((devfn) << 16) | (offset))
 #define TLP_REQ_ID(bus, devfn)		(((bus) << 8) | (devfn))
-#define TLP_COMP_STATUS(s)		(((s) >> 12) & 7)
+#define TLP_COMP_STATUS(s)		(((s) >> 13) & 7)
 #define TLP_HDR_SIZE			3
 #define TLP_LOOP			500
 #define RP_DEVFN			0
Signature · 1 line
2.9.3
Acked-by on v1 1/1
#2 lore raw
Quoted 6 lines · Yadi Hu

From: "Hu Yadi" <[email protected]>
=20
the driver does not use exactly 'Completion Status' value in TLP, these bits should be b15:13 not b14:12.
=20

Thanks for the fix.

Quoted 11 lines

---
=C2=A0drivers/pci/host/pcie-altera.c | 2 +- =C2=A01 file changed, 1 insertion(+), 1 deletion(-) =20

drivers/pci/host/pcie- renamed from drivers/pci/host/pcie-altera.c +0 -0

altera.c
index dbac6fb..650862e 100644

drivers/pci/host/pcie-altera.c +0 -0
@@ -56,7 +56,7 @@

=C2=A0#define TLP_CFG_DW2(bus, devfn, offset)=C2=A0=C2=A0=C2=A0=C2=A0=C2=

=A0=C2=A0=C2=A0=C2=A0\

Quoted 1 line

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(((bus) << 24) | ((devfn) << 1=
6) |

Quoted 2 lines

(offset))
=C2=A0#define TLP_REQ_ID(bus, devfn)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=

=C2=A0=C2=A0=C2=A0(((bus) << 8) | (devfn))

Quoted 1 line

-#define TLP_COMP_STATUS(s)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=

=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(((s) >> 12) & 7)

Quoted 1 line

+#define TLP_COMP_STATUS(s)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=

=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(((s) >> 13) & 7)

Quoted 1 line

=C2=A0#define TLP_HDR_SIZE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=

=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A03

Quoted 1 line

=C2=A0#define TLP_LOOP=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=

=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0500

Quoted 1 line

=C2=A0#define RP_DEVFN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=

=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A00

Quoted 14 lines

--
2.9.3
=20
=20
________________________________
=20
Confidentiality Notice.
This message may contain information that is confidential or otherwise protected from disclosure. If you are not the intended recipient, you are hereby notified that any use, disclosure, dissemination, distribution, or copying of this message, or any attachments, is strictly prohibited. If you have received this message in error, please advise the sender by reply e-mail, and delete the message and any attachments. Thank you.

#3 lore raw
In reply to Yadi Hu
Quoted 6 lines · Yadi Hu

From: "Hu Yadi" <[email protected]>

the driver does not use exactly 'Completion Status' value in TLP, these bits should be b15:13 not b14:12.

Applied with Ley Foon's ack to pci/host-altera for v4.11, thanks.

BTW, the patch was apparently built against an old kernel (pre-v4.9), so it didn't apply directly. But I applied it by hand.

Quoted 20 lines
---
 drivers/pci/host/pcie-altera.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/host/pcie-altera.c +1 -1
index dbac6fb..650862e 100644
@@ -56,7 +56,7 @@
 #define TLP_CFG_DW2(bus, devfn, offset)	\
 				(((bus) << 24) | ((devfn) << 16) | (offset))
 #define TLP_REQ_ID(bus, devfn)		(((bus) << 8) | (devfn))
-#define TLP_COMP_STATUS(s)		(((s) >> 12) & 7)
+#define TLP_COMP_STATUS(s)		(((s) >> 13) & 7)
 #define TLP_HDR_SIZE			3
 #define TLP_LOOP			500
 #define RP_DEVFN			0
Signature · 1 line
2.9.3