From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Fabio Estevam <festevam@gmail.com>
Cc: shawn.guo@linaro.org, linux-can@vger.kernel.org,
Fabio Estevam <fabio.estevam@freescale.com>
Subject: Re: [PATCH 2/2] flexcan: Enable/Disable the CAN regulator in probe/remove
Date: Mon, 10 Jun 2013 22:39:16 +0200 [thread overview]
Message-ID: <51B63974.2000100@pengutronix.de> (raw)
In-Reply-To: <CAOMZO5CEWHTyw3s+vLtOVMdWmNWUndOZ3E4ohpCyTFXiz+VEOQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1735 bytes --]
On 06/10/2013 09:05 PM, Fabio Estevam wrote:
> Hi Marc,
>
> On Mon, Jun 10, 2013 at 2:02 PM, Marc Kleine-Budde <mkl@pengutronix.de> wrote:
>> On 06/05/2013 09:27 PM, Fabio Estevam wrote:
>>> mx28evk has two CAN ports and they are controlled by the same GPIO.
>>>
>>> If can0 runs flexcan_chip_stop(), then the regulator will be disabled, which
>>> means that can1 cannot run anymore.
>>
>> Are you sure? I think the regulator framework has a proper refcount.
>
> Yes, the refcount is OK. The problem is that on mx28evk we have two
> CAN ports controlled by the same regulator.
>
> Let's say that can0 executes flexcan_chip_stop:
>
> static void flexcan_chip_stop(struct net_device *dev)
> {
> struct flexcan_priv *priv = netdev_priv(dev);
> struct flexcan_regs __iomem *regs = priv->base;
> u32 reg;
>
> /* Disable all interrupts */
> flexcan_write(0, ®s->imask1);
>
> /* Disable + halt module */
> reg = flexcan_read(®s->mcr);
> reg |= FLEXCAN_MCR_MDIS | FLEXCAN_MCR_HALT;
> flexcan_write(reg, ®s->mcr);
>
> if (priv->reg_xceiver)
> regulator_disabled(priv->reg_xceiver);
> ...
>
> It will turn off the transceiver here, which means that can1 will not
> be able to operate.
>
> Currently this situation is properly handled inside mach-mxs by only
> disabling the CAN transceiver when both CAN ports are not used.
Why don't you enable the regulator in can1, too?
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: 263 bytes --]
next prev parent reply other threads:[~2013-06-10 20:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-05 19:27 [PATCH 1/2] flexcan: Use a regulator to control the CAN transceiver Fabio Estevam
2013-06-05 19:27 ` [PATCH 2/2] flexcan: Enable/Disable the CAN regulator in probe/remove Fabio Estevam
2013-06-10 17:02 ` Marc Kleine-Budde
2013-06-10 19:05 ` Fabio Estevam
2013-06-10 20:39 ` Marc Kleine-Budde [this message]
2013-06-10 20:49 ` Fabio Estevam
2013-06-10 23:35 ` Marc Kleine-Budde
2013-06-06 5:21 ` [PATCH 1/2] flexcan: Use a regulator to control the CAN transceiver Marc Kleine-Budde
2013-06-10 16:59 ` Marc Kleine-Budde
2013-06-10 17:03 ` Fabio Estevam
2013-06-11 2:38 ` Fabio Estevam
2013-06-12 9:39 ` Marc Kleine-Budde
2013-06-12 11:42 ` Shawn Guo
2013-06-12 12:06 ` 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=51B63974.2000100@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=fabio.estevam@freescale.com \
--cc=festevam@gmail.com \
--cc=linux-can@vger.kernel.org \
--cc=shawn.guo@linaro.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 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.