From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Mirza Krak <mirza.krak@hostmobility.com>
Cc: wg@grandegger.com, andri.yngvason@marel.com,
"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>,
netdev@vger.kernel.org,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] can: sja1000: clear interrupts on start
Date: Wed, 11 Nov 2015 11:06:34 +0100 [thread overview]
Message-ID: <5643132A.7080504@pengutronix.de> (raw)
In-Reply-To: <CAJ=nTssqwtYAos67GRr8fOzsm63v_Bx+GKEWriOjbTALuzv-0g@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2377 bytes --]
On 11/11/2015 10:54 AM, Mirza Krak wrote:
> 2015-11-11 9:04 GMT+01:00 Marc Kleine-Budde <mkl@pengutronix.de>:
>> This problem occurs only an hardware, where the SJA1000 is powered
>> during system suspend?
>
> Correct, and the controller is in UP state.
>
>> Doesn't the SJA1000 trigger an interrupt that is detected after
>> resuming? You add the fix to the open() function, which is triggered
>> during $(ifconfig up), how is related to suspend/resume? Does the
>> network layer call $(ifconfig down) during shutdown?
>
> It does not trigger another interrupt.
Can you put a scope on the interrupt pin and see if it's a problem of
the SoC and/or Linux or the SJA1000 not pulling the IRQ line.
> In our tests we have seen that IE and EPI flags are set in the IR
> registered when we resume the system. If we do not clear these two
> flags it does not produce any other interrupts. Setting the controller
> in to reset mode does not clear the IE and EPI flags, I can understand
> that IE flag is not cleared as this is stated in the data-sheet, can
> not explain why EPI flag is not cleared though as data-sheet states 0
> (reset) for both hardware reset and SETTING MOD.0 BY SOFTWARE (which
> is the reset-mode)
>
> Reason I put it in open() is so at least a DOWN/UP procedure returns
> the controller to an operating state. Also if we do an UP we should
> clear any earlier states that might exist in the registers like we do
> with error counters and error code capture.
Yes - makes sense to have it in open().
> Network layer does not call $(ifconfig down) during shutdown.
>
>> There isn't any suspend/resume code in the sja1000 driver, for me it
>> seems that we should add resume code that handles this problem.
>
> Yes, resume code should be implemented to handle this and other
> problems (receive data). But still a DOWN/UP procedure should clear
> any previous state that could exist in the controller registers.
I'll add your patch to can/master and add stable on Cc. Looking forward
for some suspend/resume code :)
Thanks,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
next prev parent reply other threads:[~2015-11-11 10:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-10 13:59 [PATCH 1/1] can: sja1000: clear interrupts on start Mirza Krak
2015-11-11 8:04 ` Marc Kleine-Budde
2015-11-11 9:54 ` Mirza Krak
2015-11-11 10:06 ` Marc Kleine-Budde [this message]
2015-11-11 12:29 ` Mirza Krak
2015-11-11 12:37 ` Marc Kleine-Budde
2015-11-11 12:46 ` Mirza Krak
2015-11-11 12:48 ` Marc Kleine-Budde
2015-11-11 12:49 ` Christian Magnusson
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=5643132A.7080504@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=andri.yngvason@marel.com \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mirza.krak@hostmobility.com \
--cc=netdev@vger.kernel.org \
--cc=wg@grandegger.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).