[Armadeus-commitlog] armadeus branch, master, updated. armadeus-7.0-225-g4b9532e55
Brought to you by:
sszy
|
From: Sébastien S. <ss...@us...> - 2021-01-22 09:20:41
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 4b9532e55762a9de9a258292e6dc40b8919aa412 (commit)
from e10e2d19a158bb5e9b4970a01bd09c9dd698c94c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 4b9532e55762a9de9a258292e6dc40b8919aa412
Author: Sébastien Szymanski <seb...@ar...>
Date: Fri Jan 22 10:20:09 2021 +0100
[PATCH] 5.4.imx_legacy: two more patches for tcan
-----------------------------------------------------------------------
Summary of changes:
.../0541-can-tcan4x5x-use-spi_sync_transfer.patch | 86 ++++++++++++++++++++++
..._can_do_rx_poll-don-t-waste-time-if-quota.patch | 51 +++++++++++++
2 files changed, 137 insertions(+)
create mode 100644 patches/linux/5.4.imx_legacy/0541-can-tcan4x5x-use-spi_sync_transfer.patch
create mode 100644 patches/linux/5.4.imx_legacy/0542-can-m_can-m_can_do_rx_poll-don-t-waste-time-if-quota.patch
diff --git a/patches/linux/5.4.imx_legacy/0541-can-tcan4x5x-use-spi_sync_transfer.patch b/patches/linux/5.4.imx_legacy/0541-can-tcan4x5x-use-spi_sync_transfer.patch
new file mode 100644
index 000000000..64dca4c14
--- /dev/null
+++ b/patches/linux/5.4.imx_legacy/0541-can-tcan4x5x-use-spi_sync_transfer.patch
@@ -0,0 +1,86 @@
+From c719c2f0991ed5cb894280c7ad53f8fc954de4c0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?S=C3=A9bastien=20Szymanski?=
+ <seb...@ar...>
+Date: Fri, 22 Jan 2021 10:10:00 +0100
+Subject: [PATCH 541/542] can: tcan4x5x: use spi_sync_transfer
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Sébastien Szymanski <seb...@ar...>
+---
+ drivers/net/can/m_can/tcan4x5x.c | 45 +++++++++++++++++++++++---------
+ 1 file changed, 33 insertions(+), 12 deletions(-)
+
+diff --git a/drivers/net/can/m_can/tcan4x5x.c b/drivers/net/can/m_can/tcan4x5x.c
+index c1870c8bc4e5..914f0b42531c 100644
+--- a/drivers/net/can/m_can/tcan4x5x.c
++++ b/drivers/net/can/m_can/tcan4x5x.c
+@@ -195,20 +195,24 @@ static int regmap_spi_gather_write(void *context, const void *reg,
+ {
+ struct device *dev = context;
+ struct spi_device *spi = to_spi_device(dev);
+- struct spi_message m;
+- u32 addr;
+- struct spi_transfer t[2] = {
+- { .tx_buf = &addr, .len = reg_len, .cs_change = 0,},
+- { .tx_buf = val, .len = val_len, },
++ int ret;
++ u8 txbuf[8] = { };
++
++ struct spi_transfer xfers = {
++ .rx_buf = NULL,
++ .tx_buf = &txbuf,
++ .len = 8,
++ .cs_change = false,
+ };
+
+- addr = TCAN4X5X_WRITE_CMD | (*((u16 *)reg) << 8) | val_len >> 2;
++ (*(u32*)txbuf) = TCAN4X5X_WRITE_CMD | (*((u16 *)reg) << 8) | val_len >> 2;
++ memcpy(&txbuf[4], val, 4);
+
+- spi_message_init(&m);
+- spi_message_add_tail(&t[0], &m);
+- spi_message_add_tail(&t[1], &m);
++ ret = spi_sync_transfer(spi, &xfers, 1);
++ if (ret < 0)
++ return ret;
+
+- return spi_sync(spi, &m);
++ return 0;
+ }
+
+ static int tcan4x5x_regmap_write(void *context, const void *data, size_t count)
+@@ -238,10 +242,27 @@ static int tcan4x5x_regmap_read(void *context,
+ {
+ struct device *dev = context;
+ struct spi_device *spi = to_spi_device(dev);
++ int ret;
++
++ u8 rxbuf[8] = { };
++ u8 txbuf[8] = { };
+
+- u32 addr = TCAN4X5X_READ_CMD | (*((u16 *)reg) << 8) | val_size >> 2;
++ struct spi_transfer xfers = {
++ .rx_buf = &rxbuf,
++ .tx_buf = &txbuf,
++ .len = 8,
++ .cs_change = false,
++ };
++
++ (*(u32*)txbuf) = TCAN4X5X_READ_CMD | (*((u16 *)reg) << 8) | val_size >> 2;
++
++ ret = spi_sync_transfer(spi, &xfers, 1);
++ if (ret < 0)
++ return ret;
++
++ memcpy(val, &rxbuf[4], 4);
+
+- return spi_write_then_read(spi, &addr, reg_size, (u32 *)val, val_size);
++ return 0;
+ }
+
+ static struct regmap_bus tcan4x5x_bus = {
+--
+2.26.2
+
diff --git a/patches/linux/5.4.imx_legacy/0542-can-m_can-m_can_do_rx_poll-don-t-waste-time-if-quota.patch b/patches/linux/5.4.imx_legacy/0542-can-m_can-m_can_do_rx_poll-don-t-waste-time-if-quota.patch
new file mode 100644
index 000000000..efabbd832
--- /dev/null
+++ b/patches/linux/5.4.imx_legacy/0542-can-m_can-m_can_do_rx_poll-don-t-waste-time-if-quota.patch
@@ -0,0 +1,51 @@
+From 0fc8417adc1106eaef094b222c460a15bfb49f5b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?S=C3=A9bastien=20Szymanski?=
+ <seb...@ar...>
+Date: Fri, 22 Jan 2021 10:17:36 +0100
+Subject: [PATCH 542/542] can: m_can: m_can_do_rx_poll: don't waste time if
+ quota == 0
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Sébastien Szymanski <seb...@ar...>
+---
+ drivers/net/can/m_can/m_can.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
+index 02c5795b7393..b14a5b7a9868 100644
+--- a/drivers/net/can/m_can/m_can.c
++++ b/drivers/net/can/m_can/m_can.c
+@@ -499,13 +499,16 @@ static int m_can_do_rx_poll(struct net_device *dev, int quota)
+ u32 pkts = 0;
+ u32 rxfs;
+
++ if (quota <= 0)
++ return 0;
++
+ rxfs = m_can_read(cdev, M_CAN_RXF0S);
+ if (!(rxfs & RXFS_FFL_MASK)) {
+ netdev_dbg(dev, "no messages in fifo0\n");
+ return 0;
+ }
+
+- while ((rxfs & RXFS_FFL_MASK) && (quota > 0)) {
++ while ((rxfs & RXFS_FFL_MASK)) {
+ if (rxfs & RXFS_RFL)
+ netdev_warn(dev, "Rx FIFO 0 Message Lost\n");
+
+@@ -513,6 +516,10 @@ static int m_can_do_rx_poll(struct net_device *dev, int quota)
+
+ quota--;
+ pkts++;
++
++ if (quota <= 0)
++ break;
++
+ rxfs = m_can_read(cdev, M_CAN_RXF0S);
+ }
+
+--
+2.26.2
+
hooks/post-receive
--
armadeus
|