netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joakim Zhang <qiangqing.zhang@nxp.com>
To: Sean Nyekjaer <sean@geanix.com>,
	"mkl@pengutronix.de" <mkl@pengutronix.de>,
	"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Cc: dl-linux-imx <linux-imx@nxp.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: RE: [PATCH V2 0/4] can: flexcan: fixes for stop mode
Date: Wed, 27 Nov 2019 09:48:29 +0000	[thread overview]
Message-ID: <DB7PR04MB4618C541894AD851BED5B0B7E6440@DB7PR04MB4618.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <DB7PR04MB46186472F0437A825548CE11E6440@DB7PR04MB4618.eurprd04.prod.outlook.com>


> -----Original Message-----
> From: Joakim Zhang <qiangqing.zhang@nxp.com>
> Sent: 2019年11月27日 17:37
> To: Sean Nyekjaer <sean@geanix.com>; mkl@pengutronix.de;
> linux-can@vger.kernel.org
> Cc: dl-linux-imx <linux-imx@nxp.com>; netdev@vger.kernel.org
> Subject: RE: [PATCH V2 0/4] can: flexcan: fixes for stop mode
> 
> 
> > -----Original Message-----
> > From: Sean Nyekjaer <sean@geanix.com>
> > Sent: 2019年11月27日 16:13
> > To: Joakim Zhang <qiangqing.zhang@nxp.com>; mkl@pengutronix.de;
> > linux-can@vger.kernel.org
> > Cc: dl-linux-imx <linux-imx@nxp.com>; netdev@vger.kernel.org
> > Subject: Re: [PATCH V2 0/4] can: flexcan: fixes for stop mode
> >
> >
> >
> > On 27/11/2019 07.12, Sean Nyekjaer wrote:
> > >
> > >
> > > On 27/11/2019 06.56, Joakim Zhang wrote:
> > >>     Could you help check the patch set? With your suggestions, I
> > >> have cooked a patch to exit stop mode during probe stage.
> > >>
> > >>     IMHO, I think this patch is unneed, now in flexcan driver,
> > >> enter stop mode when suspend, and then exit stop mode when resume.
> > >> AFAIK, as long as flexcan_suspend has been called, flexcan_resume
> > >> will be called, unless the system hang during suspend/resume. If
> > >> so, only code reset can activate OS again. Could you please tell me
> > >> how does CAN stucked in stop mode at your side?
> > >
> > > Hi Joakim,
> > >
> > > Thanks I'll test this :-)
> > > Guess I will have do some hacking to get it stuck in stop mode.
> > >
> > > We have a lot of devices in the field that doesn't have:
> > > "can: flexcan: fix deadlock when using self wakeup"
> > >
> > > And they have traffic on both CAN interfaces, that way it's quite
> > > easy to get them stuck in stop mode.
> > >
> > > /Sean
> >
> > Hi Joakim,
> >
> > I have been testing this.
> > I have a hacked version of the driver that calls
> > flexcan_enter_stop_mode() as the last step in the probe function.
> >
> > First insert of flexcan.ko when stop mode is activated:
> > flexcan 2090000.flexcan: Linked as a consumer to regulator.4
> >
> > flexcan 2090000.flexcan: registering netdev failed
> >
> > flexcan 2090000.flexcan: Dropping the link to regulator.4
> >
> > flexcan: probe of 2090000.flexcan failed with error -110
> >
> > flexcan 2094000.flexcan: Linked as a consumer to regulator.4
> >
> > flexcan 2094000.flexcan: registering netdev failed
> >
> > flexcan 2094000.flexcan: Dropping the link to regulator.4
> >
> > flexcan: probe of 2094000.flexcan failed with error -110
> >
> >
> > When I insert a flexcan.ko with the patch
> > "can: flexcan: try to exit stop mode during probe stage":
> > flexcan 2090000.flexcan: Linked as a consumer to regulator.4
> >
> > flexcan 2090000.flexcan: Unbalanced pm_runtime_enable!
> >
> > flexcan 2094000.flexcan: Linked as a consumer to regulator.4
> >
> > flexcan 2094000.flexcan: Unbalanced pm_runtime_enable!
> >
> > I works as I expected but, I think we need to do some pm_runtime
> > cleanup when bailing with error -110.
> > Anyways it works great, thanks for your work on this.
> 
> Hi Sean,
> 
> Thanks for your quirk test, I used unbind/bind to test, do not meet such issue.
> I will build as a module to have a test.

One more should confirm with you, you inserted a flexcan.ko after stop mode activated without fix patch firstly, and then inserted a flexcan.ko
with fix patch. If yes, this could cause unbalanced pm_runtime_enabled. The reason is that firstly inserted the flexcan.ko would enable device runtime pm,
and then you inserted flexcan.ko enable device runtime pm again.

Could you please insert flexcan.ko with fix patch directly after stop mode activated?
 
Best Regards,
Joakim Zhang
> Best Regards,
> Joakim Zhang
> > /Sean

  reply	other threads:[~2019-11-27  9:48 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-27  5:56 [PATCH V2 0/4] can: flexcan: fixes for stop mode Joakim Zhang
2019-11-27  5:56 ` [PATCH V2 1/4] can: flexcan: fix deadlock when using self wakeup Joakim Zhang
2019-11-27  9:58   ` Sean Nyekjaer
2019-12-03 17:25   ` Marc Kleine-Budde
2019-12-03 17:42     ` Marc Kleine-Budde
2019-12-04  1:58     ` Joakim Zhang
2019-12-04  8:31       ` Marc Kleine-Budde
2019-12-04  8:35         ` Joakim Zhang
2019-11-27  5:56 ` [PATCH V2 2/4] can: flexcan: try to exit stop mode during probe stage Joakim Zhang
2019-11-27  9:58   ` Sean Nyekjaer
2019-12-03 18:14   ` Marc Kleine-Budde
2019-12-04  2:22     ` Joakim Zhang
2019-12-04  8:45       ` Marc Kleine-Budde
2019-12-04  9:58         ` Joakim Zhang
2019-12-05  8:46         ` Joakim Zhang
2019-12-05  9:21         ` Sean Nyekjaer
2019-12-05 11:04           ` Joakim Zhang
2019-12-05 11:11             ` Sean Nyekjaer
2019-12-05 11:19               ` Joakim Zhang
2019-12-05 11:32                 ` Sean Nyekjaer
2019-12-07 20:32                   ` Marc Kleine-Budde
2019-12-08 10:47                     ` Sean Nyekjaer
2019-12-08 10:56                       ` Marc Kleine-Budde
2019-11-27  5:56 ` [PATCH V2 3/4] can: flexcan: change the way of stop mode acknowledgment Joakim Zhang
2019-11-27  9:58   ` Sean Nyekjaer
2019-12-03 18:21   ` Marc Kleine-Budde
2019-12-04  2:23     ` Joakim Zhang
2019-11-27  5:56 ` [PATCH V2 4/4] can: flexcan: add LPSR mode support Joakim Zhang
2019-12-04  2:25   ` Joakim Zhang
2019-12-04  8:59   ` Marc Kleine-Budde
2019-12-04  9:58     ` Joakim Zhang
2019-12-04  9:20   ` Marc Kleine-Budde
2019-12-04  9:59     ` Joakim Zhang
2019-12-04 10:58     ` Joakim Zhang
2019-11-27  6:12 ` [PATCH V2 0/4] can: flexcan: fixes for stop mode Sean Nyekjaer
2019-11-27  8:12   ` Sean Nyekjaer
2019-11-27  9:36     ` Joakim Zhang
2019-11-27  9:48       ` Joakim Zhang [this message]
2019-11-27  9:52         ` Sean Nyekjaer
2019-11-27  9:58           ` Joakim Zhang
2019-11-27  9:59             ` Sean Nyekjaer
2019-11-27 10:04               ` Joakim Zhang
2019-12-03 10:16               ` Joakim Zhang

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=DB7PR04MB4618C541894AD851BED5B0B7E6440@DB7PR04MB4618.eurprd04.prod.outlook.com \
    --to=qiangqing.zhang@nxp.com \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=sean@geanix.com \
    /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;
as well as URLs for NNTP newsgroup(s).