All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent MAILHOL <mailhol.vincent@wanadoo.fr>
To: Thomas.Kopp@microchip.com
Cc: Marc Kleine-Budde <mkl@pengutronix.de>,
	Ayoub Kaanich <kayoub5@live.com>,
	linux-can <linux-can@vger.kernel.org>
Subject: Re: mcp251xfd receiving non ACKed frames (was: Re: More flags for logging)
Date: Tue, 4 May 2021 23:26:47 +0900	[thread overview]
Message-ID: <CAMZ6RqJt0Ai6Uk2ZsOTqD_C1Cw2FTNOg088RXp7UsgHKcAkE2w@mail.gmail.com> (raw)
In-Reply-To: <DM6PR11MB42835BBA69260C24BEAECA2EFB5A9@DM6PR11MB4283.namprd11.prod.outlook.com>

On Tue. 4 Mai 2021 à 21:53, <Thomas.Kopp@microchip.com> wrote:
> Hi All,
>
> > I guess that above error flags are the consequence of the
> > interferences on the bus while unplugging the candlelight. Those
> > are probably not relevant to our specific topic.
> >
> > > | (2021-05-04 09:05:02.100540)  mcp251xfd0  RX - -  222   [8]  4D 00 00 00 00
> > 00 00 00
> > > | (2021-05-04 09:05:02.100570)  mcp251xfd0  RX - -  222   [8]  4D 00 00 00 00
> > 00 00 00
> > > | (2021-05-04 09:05:02.100583)  mcp251xfd0  RX - -  222   [8]  4D 00 00 00 00
> > 00 00 00
> > > | (2021-05-04 09:05:02.100593)  mcp251xfd0  RX - -  222   [8]  4D 00 00 00 00
> > 00 00 00
> > > | (2021-05-04 09:05:02.101326)  mcp251xfd0  RX - -  222   [8]  4D 00 00 00 00
> > 00 00 00
> > >
> Could be, would be worth to check that one a scope. From what I've seen so far the Bus looks clean without disconnecting nodes.
>
>
> > Second, the receiver behaviour when receiving an non-ACKed frame
> > is actually unspecified. As mentioned before, non-ACKed frames
> > should be immediately followed by an ACK error flag. Here, the
> > receiving nodes are facing a situation which should never
> > occur. The mcp2518fd decides to register the frame as received
> > and the flexcan decides to not register the frame. I think that
> > both behaviors are actually fine: with the lack of specification,
> > the implementation is free to decide how to handle this side
> > case.
>
> I'd say it is actually defined. ISO 11989-1:2015 states the following in chapter 10.4 Bus monitoring
> "Optionally, CAN implementations may provide the bus monitoring mode, where they shall be able to
> receive valid DFs and valid RFs, but it sends only recessive bits on the CAN network and does not start
> a transmission. If the MAC sub-layer is required to send a dominant bit (ACK bit, overload flag, active
> error flag), the bit shall be rerouted internally so that the MAC sub-layer monitors this dominant bit,
> although the CAN network may remain in recessive state."
>
> Looking at the MCAN manual here: https://github.com/linux-can/can-doc/blob/master/m_can/mcan_users_manual_v330.pdf
>
> There's a similar description including a picture showing the TX signal being "connected" internally to the RX path to generate the Ack internally.

Thanks for pointing this out. You are right and I completely
missed that paragraph of the ISO.

So this perfectly explains the behaviour of the mcp251xfd0. It
also means that the ACK flag is set by the transmitter so there
is indeed no way to differentiate if the frame was indeed ACKed
or not by the other nodes.

Concerning the flexcan it is not following the standard. Even if
the monitor mode is optional, once it is implemented, it should
behave as stated in chapter 10.4.

However, this still does not explain why the Peak does not
generate the ACK error flag. Also, the ISO says that in
monitoring mode, the controller "does not start a
transmission". So it also seems like a violation of the standard
that Peak devices are able to transmit frames while being in
monitor mode.


Yours sincerely,
Vincent

  reply	other threads:[~2021-05-04 14:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-03 10:02 More flags for logging Marc Kleine-Budde
2021-05-03 10:08 ` Marc Kleine-Budde
2021-05-03 15:02   ` Vincent MAILHOL
2021-05-03 15:43     ` Marc Kleine-Budde
     [not found]     ` <DBBPR03MB70828377F51A1747B4E9E6529D5B9@DBBPR03MB7082.eurprd03.prod.outlook.com>
2021-05-03 15:47       ` Marc Kleine-Budde
     [not found]         ` <DBBPR03MB7082F029173018680E5D869C9D5B9@DBBPR03MB7082.eurprd03.prod.outlook.com>
2021-05-03 21:46           ` Vincent MAILHOL
2021-05-04  5:40             ` Patrick Menschel
2021-05-04  7:48             ` mcp251xfd receiving non ACKed frames (was: Re: More flags for logging) Marc Kleine-Budde
2021-05-04 12:22               ` Vincent MAILHOL
2021-05-04 12:53                 ` Thomas.Kopp
2021-05-04 14:26                   ` Vincent MAILHOL [this message]
2021-05-04 17:44                 ` Vincent MAILHOL
2021-05-04 10:10         ` More flags for logging Kurt Van Dijck
2021-05-04 10:07     ` Kurt Van Dijck
2021-05-04  8:49   ` Oliver Hartkopp
     [not found]     ` <DBBPR03MB7082C7E8FD22D0CA8C2DA99D9D5A9@DBBPR03MB7082.eurprd03.prod.outlook.com>
     [not found]       ` <AM8PR08MB5698886555F8531B6CF65982B75A9@AM8PR08MB5698.eurprd08.prod.outlook.com>
2021-05-04  9:49         ` Ayoub Kaanich
2021-05-04 10:13           ` Oliver Hartkopp
2021-05-04 13:58             ` Ayoub Kaanich
2021-05-04 14:38               ` Oliver Hartkopp
     [not found]     ` <DBBPR03MB70824BB82F7BB335928BE36A9D2F9@DBBPR03MB7082.eurprd03.prod.outlook.com>
2021-05-17  7:29       ` Oliver Hartkopp

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=CAMZ6RqJt0Ai6Uk2ZsOTqD_C1Cw2FTNOg088RXp7UsgHKcAkE2w@mail.gmail.com \
    --to=mailhol.vincent@wanadoo.fr \
    --cc=Thomas.Kopp@microchip.com \
    --cc=kayoub5@live.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 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.