pull-request: can-next 2021-08-04
Subsystems (7)
Marc Kleine-Budde
maintainerHello Jakub, hello David,
this is a pull request of 5 patches for net-next/master.
The first patch is by me and fixes a typo in a comment in the CAN J1939 protocol.
The next 2 patches are by Oleksij Rempel and update the CAN J1939 protocol to send RX status updates via the error queue mechanism.
The next patch is by me and adds a missing variable initialization to the flexcan driver (the problem was introduced in the current net-next cycle).
The last patch is by Aswath Govindraju and adds power-domains to the Bosch m_can DT binding documentation.
regards,
Marc
---
The following changes since commit 7cdd0a89ec70ce6a720171f1f7817ee9502b134c:
net/mlx4: make the array states static const, makes object smaller (2021-08-02 15:02:13 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git tags/linux-can-next-for-5.15-20210804
for you to fetch changes up to d85165b2381ce2638cfb8c8787a61b97b38251c2:
dt-bindings: net: can: Document power-domains property (2021-08-04 12:11:57 +0200)
----------------------------------------------------------------
linux-can-next-for-5.15-20210804
----------------------------------------------------------------
Aswath Govindraju (1):
dt-bindings: net: can: Document power-domains property
Marc Kleine-Budde (2):
can: j1939: j1939_session_tx_dat(): fix typo
can: flexcan: flexcan_clks_enable(): add missing variable initialization
Oleksij Rempel (2):
can: j1939: rename J1939_ERRQUEUE_* to J1939_ERRQUEUE_TX_*
can: j1939: extend UAPI to notify about RX status
.../devicetree/bindings/net/can/bosch,m_can.yaml | 6 + drivers/net/can/flexcan.c | 2 +- include/uapi/linux/can/j1939.h | 9 ++ net/can/j1939/j1939-priv.h | 10 +- net/can/j1939/socket.c | 141 ++++++++++++++++----- net/can/j1939/transport.c | 28 +++- 6 files changed, 152 insertions(+), 44 deletions(-)
Marc Kleine-Budde
maintainerPATCH 1/5 can: j1939: j1939_session_tx_dat(): fix typo
This patch fixes a typo in the j1939_session_tx_dat() function.
--- net/can/j1939/transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/can/j1939/transport.c +1 -1
@@ -822,7 +822,7 @@ static int j1939_session_tx_dat(struct j1939_session *session)memcpy (&dat[1 ], &tpdat[offset], len); ret =j1939_tp_tx_dat (session, dat, len +1 );if (ret <0 ) { -/* ENOBUS == CAN interface TX queue is full */ +/* ENOBUFS == CAN interface TX queue is full */ if (ret != -ENOBUFS ) netdev_alert(priv->ndev, "%s: 0x%p: queue data error: %i\n",
base-commit: 7cdd0a89ec70ce6a720171f1f7817ee9502b134c
Signature · 1 line
2.30.2
Marc Kleine-Budde
maintainerPATCH 2/5 can: j1939: rename J1939_ERRQUEUE_* to J1939_ERRQUEUE_TX_*
In reply to Marc Kleine-BuddeFrom: Oleksij Rempel <[email protected]>
Prepare the world for the J1939_ERRQUEUE_RX_ version
--- net/can/j1939/j1939-priv.h | 6 +++--- net/can/j1939/socket.c | 6 +++--- net/can/j1939/transport.c | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-)
net/can/j1939/j1939-priv.h +3 -3
@@ -20,9 +20,9 @@struct j1939_session ;enum j1939_sk_errqueue_type { -J1939_ERRQUEUE_ACK , -J1939_ERRQUEUE_SCHED , -J1939_ERRQUEUE_ABORT , +J1939_ERRQUEUE_TX_ACK , +J1939_ERRQUEUE_TX_SCHED , +J1939_ERRQUEUE_TX_ABORT , };/* j1939 devices */
net/can/j1939/socket.c +3 -3
@@ -964,7 +964,7 @@ void j1939_sk_errqueue(struct j1939_session *session, serr =SKB_EXT_ERR (skb);memset (serr,0 ,sizeof (*serr));switch (type) { -case J1939_ERRQUEUE_ACK : +case J1939_ERRQUEUE_TX_ACK :if (!(sk->sk_tsflags &SOF_TIMESTAMPING_TX_ACK )) {kfree_skb (skb);return ;
@@ -975,7 +975,7 @@ void j1939_sk_errqueue(struct j1939_session *session, serr->ee.ee_info =SCM_TSTAMP_ACK ; state ="ACK" ;break ; -case J1939_ERRQUEUE_SCHED : +case J1939_ERRQUEUE_TX_SCHED :if (!(sk->sk_tsflags &SOF_TIMESTAMPING_TX_SCHED )) {kfree_skb (skb);return ;
@@ -986,7 +986,7 @@ void j1939_sk_errqueue(struct j1939_session *session, serr->ee.ee_info =SCM_TSTAMP_SCHED ; state ="SCH" ;break ; -case J1939_ERRQUEUE_ABORT : +case J1939_ERRQUEUE_TX_ABORT : serr->ee.ee_errno = session->err; serr->ee.ee_origin =SO_EE_ORIGIN_LOCAL ; serr->ee.ee_info =J1939_EE_INFO_TX_ABORT ;
net/can/j1939/transport.c +4 -4
@@ -261,9 +261,9 @@ static void __j1939_session_drop(struct j1939_session *session)static void j1939_session_destroy (struct j1939_session *session) {if (session->err) -j1939_sk_errqueue (session,J1939_ERRQUEUE_ABORT ); +j1939_sk_errqueue (session,J1939_ERRQUEUE_TX_ABORT );else -j1939_sk_errqueue (session,J1939_ERRQUEUE_ACK ); +j1939_sk_errqueue (session,J1939_ERRQUEUE_TX_ACK );netdev_dbg (session->priv->ndev,"%s: 0x%p\n" , __func__, session);
@@ -1044,7 +1044,7 @@ static int j1939_simple_txnext(struct j1939_session *session)if (ret) goto out_free; -j1939_sk_errqueue (session,J1939_ERRQUEUE_SCHED ); +j1939_sk_errqueue (session,J1939_ERRQUEUE_TX_SCHED );j1939_sk_queue_activate_next (session); out_free:
@@ -1438,7 +1438,7 @@ j1939_xtp_rx_cts_one(struct j1939_session *session, struct sk_buff *skb)if (session->transmission) {if (session->pkt.tx_acked)j1939_sk_errqueue (session, -J1939_ERRQUEUE_SCHED ); +J1939_ERRQUEUE_TX_SCHED );j1939_session_txtimer_cancel (session);j1939_tp_schedule_txtimer (session,0 ); }
Signature · 1 line
2.30.2
Marc Kleine-Budde
maintainerPATCH 3/5 can: j1939: extend UAPI to notify about RX status
In reply to Marc Kleine-BuddeFrom: Oleksij Rempel <[email protected]>
To be able to create applications with user friendly feedback, we need be able to provide receive status information.
Typical ETP transfer may take seconds or even hours. To give user some clue or show a progress bar, the stack should push status updates. Same as for the TX information, the socket error queue will be used with following new signals:
- J1939_EE_INFO_RX_RTS - received and accepted request to send signal.
- J1939_EE_INFO_RX_DPO - received data package offset signal
- J1939_EE_INFO_RX_ABORT - RX session was aborted
Instead of completion signal, user will get data package.
To activate this signals, application should set SOF_TIMESTAMPING_RX_SOFTWARE to the SO_TIMESTAMPING socket option. This will avoid unpredictable application behavior for the old software.
--- include/uapi/linux/can/j1939.h | 9 +++ net/can/j1939/j1939-priv.h | 4 + net/can/j1939/socket.c | 135 +++++++++++++++++++++++++-------- net/can/j1939/transport.c | 22 +++++- 4 files changed, 136 insertions(+), 34 deletions(-)
include/uapi/linux/can/j1939.h +9 -0
@@ -78,11 +78,20 @@ enum {enum {J1939_NLA_PAD ,J1939_NLA_BYTES_ACKED , +J1939_NLA_TOTAL_SIZE , +J1939_NLA_PGN , +J1939_NLA_SRC_NAME , +J1939_NLA_DEST_NAME , +J1939_NLA_SRC_ADDR , +J1939_NLA_DEST_ADDR , };enum {J1939_EE_INFO_NONE ,J1939_EE_INFO_TX_ABORT , +J1939_EE_INFO_RX_RTS , +J1939_EE_INFO_RX_DPO , +J1939_EE_INFO_RX_ABORT , };struct j1939_filter {
net/can/j1939/j1939-priv.h +4 -0
@@ -23,6 +23,9 @@ enum j1939_sk_errqueue_type {J1939_ERRQUEUE_TX_ACK ,J1939_ERRQUEUE_TX_SCHED ,J1939_ERRQUEUE_TX_ABORT , +J1939_ERRQUEUE_RX_RTS , +J1939_ERRQUEUE_RX_DPO , + J1939_ERRQUEUE_RX_ABORT, };/* j1939 devices */
@@ -87,6 +90,7 @@ struct j1939_priv {struct list_head j1939_socks;struct kref rx_kref; +u32 rx_tskey; };void j1939_ecu_put (struct j1939_ecu *ecu);
net/can/j1939/socket.c +105 -30
198 lines not on this page · raw message
net/can/j1939/transport.c +18 -4
@@ -260,10 +260,14 @@ static void __j1939_session_drop(struct j1939_session *session)static void j1939_session_destroy (struct j1939_session *session) { -if (session->err) -j1939_sk_errqueue (session,J1939_ERRQUEUE_TX_ABORT ); -else -j1939_sk_errqueue (session,J1939_ERRQUEUE_TX_ACK ); +if (session->transmission) { +if (session->err) +j1939_sk_errqueue (session,J1939_ERRQUEUE_TX_ABORT ); +else +j1939_sk_errqueue (session,J1939_ERRQUEUE_TX_ACK ); + }else if (session->err) { +j1939_sk_errqueue (session,J1939_ERRQUEUE_RX_ABORT ); + }netdev_dbg (session->priv->ndev,"%s: 0x%p\n" , __func__, session);
@@ -1116,6 +1120,8 @@ static void __j1939_session_cancel(struct j1939_session *session,if (session->sk)j1939_sk_send_loop_abort (session->sk, session->err); +else +j1939_sk_errqueue (session,J1939_ERRQUEUE_RX_ABORT ); } static void j1939_session_cancel(struct j1939_session *session,
@@ -1330,6 +1336,8 @@ static void j1939_xtp_rx_abort_one(struct j1939_priv *priv, struct sk_buff *skb, session->err =j1939_xtp_abort_to_errno (priv, abort);if (session->sk)j1939_sk_send_loop_abort (session->sk, session->err); +else +j1939_sk_errqueue (session,J1939_ERRQUEUE_RX_ABORT );j1939_session_deactivate_activate_next (session); abort_put:
@@ -1630,6 +1638,9 @@ j1939_session *j1939_xtp_rx_rts_session_new(struct j1939_priv *priv, session->pkt.rx =0 ; session->pkt.tx =0 ; + session->tskey = priv->rx_tskey++; +j1939_sk_errqueue (session,J1939_ERRQUEUE_RX_RTS ); +WARN_ON_ONCE (j1939_session_activate (session));return session;
@@ -1752,6 +1763,9 @@ static void j1939_xtp_rx_dpo_one(struct j1939_session *session, session->pkt.dpo =j1939_etp_ctl_to_packet (skb->data); session->last_cmd = dat[0 ];j1939_tp_set_rxtimeout (session,750 ); + +if (!session->transmission) +j1939_sk_errqueue (session,J1939_ERRQUEUE_RX_DPO ); } static void j1939_xtp_rx_dpo(struct j1939_priv *priv, struct sk_buff *skb,
Signature · 1 line
2.30.2
Marc Kleine-Budde
maintainerPATCH 4/5 can: flexcan: flexcan_clks_enable(): add missing variable initialization
In reply to Marc Kleine-BuddeThis patch adds the missing initialization of the "err" variable in the flexcan_clks_enable() function.
--- drivers/net/can/flexcan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/flexcan.c +1 -1
@@ -649,7 +649,7 @@ static inline void flexcan_error_irq_disable(const struct flexcan_priv *priv)static int flexcan_clks_enable (const struct flexcan_priv *priv) { -int err; +int err =0 ;if (priv->clk_ipg) { err =clk_prepare_enable (priv->clk_ipg);
Signature · 1 line
2.30.2
Marc Kleine-Budde
maintainerPATCH 5/5 dt-bindings: net: can: Document power-domains property
In reply to Marc Kleine-BuddeFrom: Aswath Govindraju <[email protected]>
Document power-domains property for adding the Power domain provider.
--- Documentation/devicetree/bindings/net/can/bosch,m_can.yaml | 6 ++++++ 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/net/can/bosch,m_can.yaml +6 -0
@@ -104,6 +104,12 @@ properties: maximum: 32 maxItems: 1 + power-domains: + description: + Power domain provider node and an args specifier containing + the can device id value. + maxItems: 1 + can-transceiver: $ref: can-transceiver.yaml#
Signature · 1 line
2.30.2
This pull request was applied to netdev/net-next.git (refs/heads/master):
Hello:
This pull request was applied to netdev/net-next.git (refs/heads/master):
Quoted 8 lines · On Wed, 4 Aug 2021 12:17:48 +0200 you wrote:
Hello Jakub, hello David,
this is a pull request of 5 patches for net-next/master.
The first patch is by me and fixes a typo in a comment in the CAN J1939 protocol.
[...]
Here is the summary with links:
- pull-request: can-next 2021-08-04
https://git.kernel.org/netdev/net-next/c/9c0532f9cc93 - [net-next,2/5] can: j1939: rename J1939_ERRQUEUE_* to J1939_ERRQUEUE_TX_* https://git.kernel.org/netdev/net-next/c/cd85d3aed5cf - [net-next,3/5] can: j1939: extend UAPI to notify about RX status https://git.kernel.org/netdev/net-next/c/5b9272e93f2e - [net-next,4/5] can: flexcan: flexcan_clks_enable(): add missing variable initialization https://git.kernel.org/netdev/net-next/c/336266697213 - [net-next,5/5] dt-bindings: net: can: Document power-domains property https://git.kernel.org/netdev/net-next/c/d85165b2381c
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html