All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/2] can: m_can: tcan4x5x: put the device out of standby before register access
@ 2019-12-11  6:42 Sean Nyekjaer
  2019-12-11  8:42 ` Marc Kleine-Budde
  0 siblings, 1 reply; 8+ messages in thread
From: Sean Nyekjaer @ 2019-12-11  6:42 UTC (permalink / raw)
  To: mkl, dmurphy, linux-can; +Cc: Sean Nyekjaer, martin, stable

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

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

* Re: [PATCH v3 1/2] can: m_can: tcan4x5x: put the device out of standby before register access
  2019-12-11  6:42 [PATCH v3 1/2] can: m_can: tcan4x5x: put the device out of standby before register access Sean Nyekjaer
@ 2019-12-11  8:42 ` Marc Kleine-Budde
  2019-12-11  9:13   ` Sean Nyekjaer
  0 siblings, 1 reply; 8+ messages in thread
From: Marc Kleine-Budde @ 2019-12-11  8:42 UTC (permalink / raw)
  To: Sean Nyekjaer, dmurphy, linux-can; +Cc: martin, stable


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

On 12/11/19 7:42 AM, Sean Nyekjaer wrote:
> 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>

Applied both to linux-can.

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] 8+ messages in thread

* Re: [PATCH v3 1/2] can: m_can: tcan4x5x: put the device out of standby before register access
  2019-12-11  8:42 ` Marc Kleine-Budde
@ 2019-12-11  9:13   ` Sean Nyekjaer
  2019-12-11  9:44     ` Marc Kleine-Budde
  0 siblings, 1 reply; 8+ messages in thread
From: Sean Nyekjaer @ 2019-12-11  9:13 UTC (permalink / raw)
  To: Marc Kleine-Budde, dmurphy, linux-can; +Cc: martin, stable



On 11/12/2019 09.42, Marc Kleine-Budde wrote:
> On 12/11/19 7:42 AM, Sean Nyekjaer wrote:
>> 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>
> 
> Applied both to linux-can.
> 

Oh, the commit id for "can: tcan4x5x: Turn on the power before parsing 
the config" have changed, since this morning :)

The new commit is 0d38aa7d1090

Thanks
/Sean

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

* Re: [PATCH v3 1/2] can: m_can: tcan4x5x: put the device out of standby before register access
  2019-12-11  9:13   ` Sean Nyekjaer
@ 2019-12-11  9:44     ` Marc Kleine-Budde
  2019-12-11 11:28       ` Sean Nyekjaer
  0 siblings, 1 reply; 8+ messages in thread
From: Marc Kleine-Budde @ 2019-12-11  9:44 UTC (permalink / raw)
  To: Sean Nyekjaer, dmurphy, linux-can; +Cc: martin, stable


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

On 12/11/19 10:13 AM, Sean Nyekjaer wrote:
>>> 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>
>>
>> Applied both to linux-can.
> 
> Oh, the commit id for "can: tcan4x5x: Turn on the power before parsing 
> the config" have changed, since this morning :)

Ahh, I see.

Until there is a pull request (including a tag) the testing branch is
subject to rebase. Meaning, when there is a patch, that needs update I'm
happy to squash things into it.

I'm squashing there two commits into one:

> # This is a combination of 2 commits.
> # This is the 1st commit message:
> 
> can: tcan4x5x: Turn on the power before parsing the config
> 
> The parse config function now performs action on the device either
> reading or writing and a reset.  If the regulator is managed it needs
> to be turned on.  So turn on the regulator if available if the parsing
> fails then turn off the regulator.
> 
> Fixes: a5235f3c7c23 ("can: tcan45x: Make wake-up GPIO an optional GPIO")
> Signed-off-by: Dan Murphy <dmurphy@ti.com>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> 
> # This is the commit message #2:
> 
> can: tcan4x5x: put the device out of standby before register access
> 
> 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>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

Can you give me an updated commit message?

regards,
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] 8+ messages in thread

* Re: [PATCH v3 1/2] can: m_can: tcan4x5x: put the device out of standby before register access
  2019-12-11  9:44     ` Marc Kleine-Budde
@ 2019-12-11 11:28       ` Sean Nyekjaer
  2019-12-11 12:10         ` Marc Kleine-Budde
  0 siblings, 1 reply; 8+ messages in thread
From: Sean Nyekjaer @ 2019-12-11 11:28 UTC (permalink / raw)
  To: Marc Kleine-Budde, dmurphy, linux-can; +Cc: martin, stable



On 11/12/2019 10.44, Marc Kleine-Budde wrote:
> On 12/11/19 10:13 AM, Sean Nyekjaer wrote:
>>>> 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>
>>>
>>> Applied both to linux-can.
>>
>> Oh, the commit id for "can: tcan4x5x: Turn on the power before parsing
>> the config" have changed, since this morning :)
> 
> Ahh, I see.
> 
> Until there is a pull request (including a tag) the testing branch is
> subject to rebase. Meaning, when there is a patch, that needs update I'm
> happy to squash things into it.
> 
> I'm squashing there two commits into one:

It's two different authors :-)
> 
>> # This is a combination of 2 commits.
>> # This is the 1st commit message:
>>
>> can: tcan4x5x: Turn on the power before parsing the config
>>
>> The parse config function now performs action on the device either
>> reading or writing and a reset.  If the regulator is managed it needs
>> to be turned on.  So turn on the regulator if available if the parsing
>> fails then turn off the regulator.
>>
>> Fixes: a5235f3c7c23 ("can: tcan45x: Make wake-up GPIO an optional GPIO")
>> Signed-off-by: Dan Murphy <dmurphy@ti.com>
>> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
>>
>> # This is the commit message #2:
>>
>> can: tcan4x5x: put the device out of standby before register access
>>
>> 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>
>> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> 
> Can you give me an updated commit message?
> 

I think it would be better to update the fixes tag :)

Could update the fixes tag for with the new commit id...

/Sean

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

* Re: [PATCH v3 1/2] can: m_can: tcan4x5x: put the device out of standby before register access
  2019-12-11 11:28       ` Sean Nyekjaer
@ 2019-12-11 12:10         ` Marc Kleine-Budde
  2019-12-11 12:15           ` Sean Nyekjaer
  0 siblings, 1 reply; 8+ messages in thread
From: Marc Kleine-Budde @ 2019-12-11 12:10 UTC (permalink / raw)
  To: Sean Nyekjaer, dmurphy, linux-can; +Cc: martin, stable


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

On 12/11/19 12:28 PM, Sean Nyekjaer wrote:
> On 11/12/2019 10.44, Marc Kleine-Budde wrote:
>> On 12/11/19 10:13 AM, Sean Nyekjaer wrote:
>>>>> 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>
>>>>
>>>> Applied both to linux-can.
>>>
>>> Oh, the commit id for "can: tcan4x5x: Turn on the power before parsing
>>> the config" have changed, since this morning :)
>>
>> Ahh, I see.
>>
>> Until there is a pull request (including a tag) the testing branch is
>> subject to rebase. Meaning, when there is a patch, that needs update I'm
>> happy to squash things into it.
>>
>> I'm squashing there two commits into one:
> 
> It's two different authors :-)

No problem with me. I don't want to have a known broken patch in one
pull request that gets fixed by another patch in that pull request.

So we have to sort this out. :)

regards,
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] 8+ messages in thread

* Re: [PATCH v3 1/2] can: m_can: tcan4x5x: put the device out of standby before register access
  2019-12-11 12:10         ` Marc Kleine-Budde
@ 2019-12-11 12:15           ` Sean Nyekjaer
  2019-12-11 12:35             ` Marc Kleine-Budde
  0 siblings, 1 reply; 8+ messages in thread
From: Sean Nyekjaer @ 2019-12-11 12:15 UTC (permalink / raw)
  To: Marc Kleine-Budde, dmurphy, linux-can; +Cc: martin, stable



On 11/12/2019 13.10, Marc Kleine-Budde wrote:
> On 12/11/19 12:28 PM, Sean Nyekjaer wrote:
>> On 11/12/2019 10.44, Marc Kleine-Budde wrote:
>>> On 12/11/19 10:13 AM, Sean Nyekjaer wrote:
>>>>>> 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>
>>>>>
>>>>> Applied both to linux-can.
>>>>
>>>> Oh, the commit id for "can: tcan4x5x: Turn on the power before parsing
>>>> the config" have changed, since this morning :)
>>>
>>> Ahh, I see.
>>>
>>> Until there is a pull request (including a tag) the testing branch is
>>> subject to rebase. Meaning, when there is a patch, that needs update I'm
>>> happy to squash things into it.
>>>
>>> I'm squashing there two commits into one:
>>
>> It's two different authors :-)
> 
> No problem with me. I don't want to have a known broken patch in one
> pull request that gets fixed by another patch in that pull request.

No problem with me, either.
But it's not exactly the same problem they are fixing. They can exist 
separately.

Just do a you find best...

/Sean

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

* Re: [PATCH v3 1/2] can: m_can: tcan4x5x: put the device out of standby before register access
  2019-12-11 12:15           ` Sean Nyekjaer
@ 2019-12-11 12:35             ` Marc Kleine-Budde
  0 siblings, 0 replies; 8+ messages in thread
From: Marc Kleine-Budde @ 2019-12-11 12:35 UTC (permalink / raw)
  To: Sean Nyekjaer, dmurphy, linux-can; +Cc: martin, stable


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

On 12/11/19 1:15 PM, Sean Nyekjaer wrote:
> 
> 
> On 11/12/2019 13.10, Marc Kleine-Budde wrote:
>> On 12/11/19 12:28 PM, Sean Nyekjaer wrote:
>>> On 11/12/2019 10.44, Marc Kleine-Budde wrote:
>>>> On 12/11/19 10:13 AM, Sean Nyekjaer wrote:
>>>>>>> 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>
>>>>>>
>>>>>> Applied both to linux-can.
>>>>>
>>>>> Oh, the commit id for "can: tcan4x5x: Turn on the power before parsing
>>>>> the config" have changed, since this morning :)
>>>>
>>>> Ahh, I see.
>>>>
>>>> Until there is a pull request (including a tag) the testing branch is
>>>> subject to rebase. Meaning, when there is a patch, that needs update I'm
>>>> happy to squash things into it.
>>>>
>>>> I'm squashing there two commits into one:
>>>
>>> It's two different authors :-)
>>
>> No problem with me. I don't want to have a known broken patch in one
>> pull request that gets fixed by another patch in that pull request.
> 
> No problem with me, either.
> But it's not exactly the same problem they are fixing. They can exist 
> separately.
> 
> Just do a you find best...

If they do different things, you don't need a fixed tag from one to the
other...

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] 8+ messages in thread

end of thread, other threads:[~2019-12-11 12:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-11  6:42 [PATCH v3 1/2] can: m_can: tcan4x5x: put the device out of standby before register access Sean Nyekjaer
2019-12-11  8:42 ` 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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.