Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Kirjanov <dkirjanov@suse.com>2019-03-20 13:36:06 +0100
committerDenis Kirjanov <dkirjanov@suse.com>2019-03-21 09:42:33 +0100
commit5cdea6c4fa8a9de12d8c23980c3dc6758993cb31 (patch)
tree9b92e4db9635fc90b5598e178f81fe697282d3e8
parentef5602d0200416cb9e3774f6493be0d2faf1a79e (diff)
net: stmmac: handle endianness in dwmac4_get_timestamp (git-fixes).
-rw-r--r--patches.fixes/0001-net-stmmac-handle-endianness-in-dwmac4_get_timestamp.patch42
-rw-r--r--series.conf1
2 files changed, 43 insertions, 0 deletions
diff --git a/patches.fixes/0001-net-stmmac-handle-endianness-in-dwmac4_get_timestamp.patch b/patches.fixes/0001-net-stmmac-handle-endianness-in-dwmac4_get_timestamp.patch
new file mode 100644
index 0000000000..5f4da7f27d
--- /dev/null
+++ b/patches.fixes/0001-net-stmmac-handle-endianness-in-dwmac4_get_timestamp.patch
@@ -0,0 +1,42 @@
+From: Alexandre Torgue <alexandre.torgue@st.com>
+Subject: net: stmmac: handle endianness in dwmac4_get_timestamp
+Patch-mainline: v5.0-rc8
+Git-commit: 4012e7d09d99b62d80046790657c0b0e32310d50
+References: git-fixes
+
+GMAC IP is little-endian and used on several kind of CPU (big or little
+endian). Main callbacks functions of the stmmac drivers take care about
+it. It was not the case for dwmac4_get_timestamp function.
+
+Fixes: ba1ffd74df74 ("stmmac: fix PTP support for GMAC4")
+Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Denis Kirjanov <dkirjanov@suse.com>
+---
+ drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
+@@ -238,15 +238,18 @@ static inline u64 dwmac4_get_timestamp(v
+ static int dwmac4_rx_check_timestamp(void *desc)
+ {
+ struct dma_desc *p = (struct dma_desc *)desc;
++ unsigned int rdes0 = le32_to_cpu(p->des0);
++ unsigned int rdes1 = le32_to_cpu(p->des1);
++ unsigned int rdes3 = le32_to_cpu(p->des3);
+ u32 own, ctxt;
+ int ret = 1;
+
+- own = p->des3 & RDES3_OWN;
+- ctxt = ((p->des3 & RDES3_CONTEXT_DESCRIPTOR)
++ own = rdes3 & RDES3_OWN;
++ ctxt = ((rdes3 & RDES3_CONTEXT_DESCRIPTOR)
+ >> RDES3_CONTEXT_DESCRIPTOR_SHIFT);
+
+ if (likely(!own && ctxt)) {
+- if ((p->des0 == 0xffffffff) && (p->des1 == 0xffffffff))
++ if ((rdes0 == 0xffffffff) && (rdes1 == 0xffffffff))
+ /* Corrupted value */
+ ret = -EINVAL;
+ else
diff --git a/series.conf b/series.conf
index 7ae5894cd6..265289a2aa 100644
--- a/series.conf
+++ b/series.conf
@@ -20705,6 +20705,7 @@
patches.fixes/mailbox-bcm-flexrm-mailbox-Fix-FlexRM-ring-flush-tim.patch
patches.fixes/mac80211-Free-mpath-object-when-rhashtable-insertion.patch
patches.fixes/mac80211-Restore-vif-beacon-interval-if-start-ap-fai.patch
+ patches.fixes/0001-net-stmmac-handle-endianness-in-dwmac4_get_timestamp.patch
patches.fixes/net-crypto-set-sk-to-NULL-when-af_alg_release.patch
patches.fixes/0001-net-stmmac-Fix-a-race-in-EEE-enable-callback.patch
patches.fixes/vhost-correctly-check-the-return-value-of-translate_.patch