linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andri Yngvason <andri.yngvason@marel.com>
To: "Ahmed S.Darwish" <darwish.07@gmail.com>,
	"\"Thomas Körper" <Thomas.Koerper@esd.eu>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>,
	"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Subject: Re: [PATCH V5 1/1] can: Add support for esd CAN PCIe/402 card
Date: Tue, 17 Mar 2015 10:10:18 +0000	[thread overview]
Message-ID: <20150317101018.11690.58372@shannon> (raw)
In-Reply-To: <20150317072639.GA2802@Darwish.PC>

Quoting Ahmed S. Darwish (2015-03-17 07:26:39)
> Hi Thomas,
> 
> On Tue, Mar 17, 2015 at 07:30:02AM +0100, Thomas Körper wrote:
> > Hi Andri,
> > 
> > I've looked at the sources you mentioned, but I'm a little bit unsure now /
> > the handling seems not perfectly consistent to me. (flexcan calls
> > can_change_state() with tx/rx_state of 0 in the bus off path.
> >
> 
> There're discrpeancies indeed on the BUSOFF path:
> 
> 1) flexcan calls can_change_state(dev, cf, 0, 0). kvaser and others
>    do can_change_state(dev, cf, tx, rx) where either tx or rx =
>    CAN_STATE_BUS_OFF. In this case, kvaser and the other drivers
>    are the _correct_ behavior. This is validated by can-dev
>    can_chage_state() code:
> 
>         if (unlikely(new_state == CAN_STATE_BUS_OFF)) {
>                 cf->can_id |= CAN_ERR_BUSOFF;
>                 return;
>         }
Indeed, I'll have to fix that. Well spotted Thomas!
> 
> 2) flexcan calls can_bus_off(dev), while kvaser goes a layer deeper
>    and directly calls netif_carrier_off(netdev). In this case,
>    flexcan is the more correct behavior.
> 
IMO, that's fine as long as it doesn't add to inconsistency between outwards
behaviour of the system; which it doesn't.

Best regards,
Andri

  reply	other threads:[~2015-03-17 10:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-16 12:15 [PATCH V5 1/1] can: Add support for esd CAN PCIe/402 card Thomas Körper
2015-03-16 12:46 ` Andri Yngvason
2015-03-16 13:35   ` Marc Kleine-Budde
2015-03-17  6:30   ` AW: " Thomas Körper
2015-03-17  7:26     ` Ahmed S. Darwish
2015-03-17 10:10       ` Andri Yngvason [this message]
2015-03-17 10:33     ` AW: " Andri Yngvason
2015-03-17 21:27 ` Marc Kleine-Budde
2015-03-18  5:08   ` Thomas Körper

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=20150317101018.11690.58372@shannon \
    --to=andri.yngvason@marel.com \
    --cc=Thomas.Koerper@esd.eu \
    --cc=darwish.07@gmail.com \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    /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).