netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* pull-request: can 2020-10-08
@ 2020-10-08 21:40 Marc Kleine-Budde
  2020-10-08 21:40 ` [PATCH 1/3] can: m_can_platform: don't call m_can_class_suspend in runtime suspend Marc Kleine-Budde
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2020-10-08 21:40 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, linux-can, kernel

Subject: pull-request: can 2020-10-08

Hello Jakub, hello David,

as Jakub pointed out, in case there is a last minute PR to Linux, please take
this pull request into net/master for 5.9.

The first patch is part of my pull request "linux-can-fixes-for-5.9-20201006",
so consider that one obsolete and take this instead.

The first patch is by Lucas Stach and fixes m_can driver by removing an
erroneous call to m_can_class_suspend() in runtime suspend. Which causes the
pinctrl state to get stuck on the "sleep" state, which breaks all CAN
functionality on SoCs where this state is defined.

The last two patches target the j1939 protocol: Cong Wang fixes a syzbot
finding of an uninitialized variable in the j1939 transport protocol. I
contribute a patch, that fixes the initialization of a same uninitialized
variable in a different function.

regards,
Marc

---

The following changes since commit d91dc434f2baa592e9793597421231174d57bbbf:

  Merge tag 'rxrpc-fixes-20201005' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs (2020-10-06 06:18:20 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git tags/linux-can-fixes-for-5.9-20201008

for you to fetch changes up to 13ba4c434422837d7c8c163f9c8d854e67bf3c99:

  net: j1939: j1939_session_fresh_new(): fix missing initialization of skbcnt (2020-10-08 23:28:09 +0200)

----------------------------------------------------------------
linux-can-fixes-for-5.9-20201008

----------------------------------------------------------------
Cong Wang (1):
      can: j1935: j1939_tp_tx_dat_new(): fix missing initialization of skbcnt

Lucas Stach (1):
      can: m_can_platform: don't call m_can_class_suspend in runtime suspend

Marc Kleine-Budde (1):
      net: j1939: j1939_session_fresh_new(): fix missing initialization of skbcnt

 drivers/net/can/m_can/m_can_platform.c | 2 --
 net/can/j1939/transport.c              | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)



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

* [PATCH 1/3] can: m_can_platform: don't call m_can_class_suspend in runtime suspend
  2020-10-08 21:40 pull-request: can 2020-10-08 Marc Kleine-Budde
@ 2020-10-08 21:40 ` Marc Kleine-Budde
  2020-10-08 21:40 ` [PATCH 2/3] can: j1935: j1939_tp_tx_dat_new(): fix missing initialization of skbcnt Marc Kleine-Budde
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2020-10-08 21:40 UTC (permalink / raw)
  To: netdev
  Cc: davem, kuba, linux-can, kernel, Lucas Stach, Dan Murphy,
	Marc Kleine-Budde

From: Lucas Stach <l.stach@pengutronix.de>

    0704c5743694 can: m_can_platform: remove unnecessary m_can_class_resume() call

removed the m_can_class_resume() call in the runtime resume path to get
rid of a infinite recursion, so the runtime resume now only handles the device
clocks.

Unfortunately it did not remove the complementary m_can_class_suspend() call in
the runtime suspend function, so those paths are now unbalanced, which causes
the pinctrl state to get stuck on the "sleep" state, which breaks all CAN
functionality on SoCs where this state is defined. Remove the
m_can_class_suspend() call to fix this.

Fixes: 0704c5743694 can: m_can_platform: remove unnecessary m_can_class_resume() call
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Link: https://lore.kernel.org/r/20200811081545.19921-1-l.stach@pengutronix.de
Acked-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/m_can/m_can_platform.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/can/m_can/m_can_platform.c b/drivers/net/can/m_can/m_can_platform.c
index 38ea5e600fb8..e6d0cb9ee02f 100644
--- a/drivers/net/can/m_can/m_can_platform.c
+++ b/drivers/net/can/m_can/m_can_platform.c
@@ -144,8 +144,6 @@ static int __maybe_unused m_can_runtime_suspend(struct device *dev)
 	struct net_device *ndev = dev_get_drvdata(dev);
 	struct m_can_classdev *mcan_class = netdev_priv(ndev);
 
-	m_can_class_suspend(dev);
-
 	clk_disable_unprepare(mcan_class->cclk);
 	clk_disable_unprepare(mcan_class->hclk);
 
-- 
2.28.0


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

* [PATCH 2/3] can: j1935: j1939_tp_tx_dat_new(): fix missing initialization of skbcnt
  2020-10-08 21:40 pull-request: can 2020-10-08 Marc Kleine-Budde
  2020-10-08 21:40 ` [PATCH 1/3] can: m_can_platform: don't call m_can_class_suspend in runtime suspend Marc Kleine-Budde
@ 2020-10-08 21:40 ` Marc Kleine-Budde
  2020-10-08 21:40 ` [PATCH 3/3] net: j1939: j1939_session_fresh_new(): " Marc Kleine-Budde
  2020-10-10 17:32 ` pull-request: can 2020-10-08 Jakub Kicinski
  3 siblings, 0 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2020-10-08 21:40 UTC (permalink / raw)
  To: netdev
  Cc: davem, kuba, linux-can, kernel, Cong Wang,
	syzbot+3f3837e61a48d32b495f, Robin van der Gracht,
	Oleksij Rempel, Oliver Hartkopp, Marc Kleine-Budde

From: Cong Wang <xiyou.wangcong@gmail.com>

This fixes an uninit-value warning:
BUG: KMSAN: uninit-value in can_receive+0x26b/0x630 net/can/af_can.c:650

Reported-and-tested-by: syzbot+3f3837e61a48d32b495f@syzkaller.appspotmail.com
Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol")
Cc: Robin van der Gracht <robin@protonic.nl>
Cc: Oleksij Rempel <linux@rempel-privat.de>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Link: https://lore.kernel.org/r/20201008061821.24663-1-xiyou.wangcong@gmail.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 net/can/j1939/transport.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/can/j1939/transport.c b/net/can/j1939/transport.c
index 0cec4152f979..88cf1062e1e9 100644
--- a/net/can/j1939/transport.c
+++ b/net/can/j1939/transport.c
@@ -580,6 +580,7 @@ sk_buff *j1939_tp_tx_dat_new(struct j1939_priv *priv,
 	skb->dev = priv->ndev;
 	can_skb_reserve(skb);
 	can_skb_prv(skb)->ifindex = priv->ndev->ifindex;
+	can_skb_prv(skb)->skbcnt = 0;
 	/* reserve CAN header */
 	skb_reserve(skb, offsetof(struct can_frame, data));
 
-- 
2.28.0


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

* [PATCH 3/3] net: j1939: j1939_session_fresh_new(): fix missing initialization of skbcnt
  2020-10-08 21:40 pull-request: can 2020-10-08 Marc Kleine-Budde
  2020-10-08 21:40 ` [PATCH 1/3] can: m_can_platform: don't call m_can_class_suspend in runtime suspend Marc Kleine-Budde
  2020-10-08 21:40 ` [PATCH 2/3] can: j1935: j1939_tp_tx_dat_new(): fix missing initialization of skbcnt Marc Kleine-Budde
@ 2020-10-08 21:40 ` Marc Kleine-Budde
  2020-10-10 17:32 ` pull-request: can 2020-10-08 Jakub Kicinski
  3 siblings, 0 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2020-10-08 21:40 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, linux-can, kernel, Marc Kleine-Budde

This patch add the initialization of skbcnt, similar to:

    e009f95b1543 can: j1935: j1939_tp_tx_dat_new(): fix missing initialization of skbcnt

Let's play save and initialize this skbcnt as well.

Suggested-by: Jakub Kicinski <kuba@kernel.org>
Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 net/can/j1939/transport.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/can/j1939/transport.c b/net/can/j1939/transport.c
index 88cf1062e1e9..e09d087ba240 100644
--- a/net/can/j1939/transport.c
+++ b/net/can/j1939/transport.c
@@ -1488,6 +1488,7 @@ j1939_session *j1939_session_fresh_new(struct j1939_priv *priv,
 	skb->dev = priv->ndev;
 	can_skb_reserve(skb);
 	can_skb_prv(skb)->ifindex = priv->ndev->ifindex;
+	can_skb_prv(skb)->skbcnt = 0;
 	skcb = j1939_skb_to_cb(skb);
 	memcpy(skcb, rel_skcb, sizeof(*skcb));
 
-- 
2.28.0


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

* Re: pull-request: can 2020-10-08
  2020-10-08 21:40 pull-request: can 2020-10-08 Marc Kleine-Budde
                   ` (2 preceding siblings ...)
  2020-10-08 21:40 ` [PATCH 3/3] net: j1939: j1939_session_fresh_new(): " Marc Kleine-Budde
@ 2020-10-10 17:32 ` Jakub Kicinski
  2020-10-11  7:16   ` Marc Kleine-Budde
  3 siblings, 1 reply; 6+ messages in thread
From: Jakub Kicinski @ 2020-10-10 17:32 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: netdev, davem, linux-can, kernel

On Thu,  8 Oct 2020 23:40:19 +0200 Marc Kleine-Budde wrote:
> The first patch is part of my pull request "linux-can-fixes-for-5.9-20201006",
> so consider that one obsolete and take this instead.
> 
> The first patch is by Lucas Stach and fixes m_can driver by removing an
> erroneous call to m_can_class_suspend() in runtime suspend. Which causes the
> pinctrl state to get stuck on the "sleep" state, which breaks all CAN
> functionality on SoCs where this state is defined.
> 
> The last two patches target the j1939 protocol: Cong Wang fixes a syzbot
> finding of an uninitialized variable in the j1939 transport protocol. I
> contribute a patch, that fixes the initialization of a same uninitialized
> variable in a different function.

Pulled, thanks!

Since we missed 5.9 would you like me to queue these up for stable?

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

* Re: pull-request: can 2020-10-08
  2020-10-10 17:32 ` pull-request: can 2020-10-08 Jakub Kicinski
@ 2020-10-11  7:16   ` Marc Kleine-Budde
  0 siblings, 0 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2020-10-11  7:16 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: netdev, davem, linux-can, kernel


[-- Attachment #1.1: Type: text/plain, Size: 1203 bytes --]

On 10/10/20 7:32 PM, Jakub Kicinski wrote:
> On Thu,  8 Oct 2020 23:40:19 +0200 Marc Kleine-Budde wrote:
>> The first patch is part of my pull request "linux-can-fixes-for-5.9-20201006",
>> so consider that one obsolete and take this instead.
>>
>> The first patch is by Lucas Stach and fixes m_can driver by removing an
>> erroneous call to m_can_class_suspend() in runtime suspend. Which causes the
>> pinctrl state to get stuck on the "sleep" state, which breaks all CAN
>> functionality on SoCs where this state is defined.
>>
>> The last two patches target the j1939 protocol: Cong Wang fixes a syzbot
>> finding of an uninitialized variable in the j1939 transport protocol. I
>> contribute a patch, that fixes the initialization of a same uninitialized
>> variable in a different function.
> 
> Pulled, thanks!
> 
> Since we missed 5.9 would you like me to queue these up for stable?

Yes.

tnx,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2020-10-11  7:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-08 21:40 pull-request: can 2020-10-08 Marc Kleine-Budde
2020-10-08 21:40 ` [PATCH 1/3] can: m_can_platform: don't call m_can_class_suspend in runtime suspend Marc Kleine-Budde
2020-10-08 21:40 ` [PATCH 2/3] can: j1935: j1939_tp_tx_dat_new(): fix missing initialization of skbcnt Marc Kleine-Budde
2020-10-08 21:40 ` [PATCH 3/3] net: j1939: j1939_session_fresh_new(): " Marc Kleine-Budde
2020-10-10 17:32 ` pull-request: can 2020-10-08 Jakub Kicinski
2020-10-11  7:16   ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).