From: Sean Nyekjaer <sean@geanix.com>
To: mkl@pengutronix.de, dmurphy@ti.com, linux-can@vger.kernel.org
Cc: Sean Nyekjaer <sean@geanix.com>,
martin@geanix.com, stable@vger.kernel.org
Subject: [PATCH v3 1/2] can: m_can: tcan4x5x: put the device out of standby before register access
Date: Wed, 11 Dec 2019 07:42:07 +0100 [thread overview]
Message-ID: <20191211064208.84656-1-sean@geanix.com> (raw)
The m_can tries to detect if Non ISO Operation is available while in standby,
this function results in the following error:
tcan4x5x spi2.0 (unnamed net_device) (uninitialized): Failed to init module
tcan4x5x spi2.0: m_can device registered (irq=84, version=32)
tcan4x5x spi2.0 can2: TCAN4X5X successfully initialized.
When the tcan device comes out of reset it comes out in standby mode.
The m_can driver tries to access the control register but fails due to
the device is in standby mode.
So this patch will put the tcan device in normal mode before the m_can
driver does the initialization.
Fixes: a229abeed7f7 ("can: tcan4x5x: Turn on the power before parsing the config")
Cc: stable@vger.kernel.org
Signed-off-by: Sean Nyekjaer <sean@geanix.com>
---
Changes since v2:
- added error handling for tcan4x5x_init call
drivers/net/can/m_can/tcan4x5x.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/can/m_can/tcan4x5x.c b/drivers/net/can/m_can/tcan4x5x.c
index b6b2feca9e8f..1f04fec7723d 100644
--- a/drivers/net/can/m_can/tcan4x5x.c
+++ b/drivers/net/can/m_can/tcan4x5x.c
@@ -460,6 +460,10 @@ static int tcan4x5x_can_probe(struct spi_device *spi)
if (ret)
goto out_power;
+ ret = tcan4x5x_init(mcan_class);
+ if (ret)
+ goto out_power;
+
ret = m_can_class_register(mcan_class);
if (ret)
goto out_power;
--
2.24.0
next reply other threads:[~2019-12-11 6:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-11 6:42 Sean Nyekjaer [this message]
2019-12-11 8:42 ` [PATCH v3 1/2] can: m_can: tcan4x5x: put the device out of standby before register access Marc Kleine-Budde
2019-12-11 9:13 ` Sean Nyekjaer
2019-12-11 9:44 ` Marc Kleine-Budde
2019-12-11 11:28 ` Sean Nyekjaer
2019-12-11 12:10 ` Marc Kleine-Budde
2019-12-11 12:15 ` Sean Nyekjaer
2019-12-11 12:35 ` Marc Kleine-Budde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191211064208.84656-1-sean@geanix.com \
--to=sean@geanix.com \
--cc=dmurphy@ti.com \
--cc=linux-can@vger.kernel.org \
--cc=martin@geanix.com \
--cc=mkl@pengutronix.de \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox