[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20221014113603.hrg3ttsgofgq44ba@pengutronix.de>
Date: Fri, 14 Oct 2022 13:36:03 +0200
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Vivek Yadav <vivek.2311@...sung.com>
Cc: rcsekar@...sung.com, wg@...ndegger.com, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
pankaj.dubey@...sung.com, ravi.patel@...sung.com,
linux-can@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] can: mcan: Add support for handling DLEC error on CAN
FD
On 14.10.2022 16:53:19, Vivek Yadav wrote:
> >
> > if (is_lec_err(lec))
> > work_done += m_can_handle_lec_err(dev, lec);
> >
> > if (is_lec_err(dlec))
> > work_done += m_can_handle_lec_err(dev, dlec);
> >
> > > + u8 dlec = FIELD_GET(PSR_DLEC_MASK, psr);
> > > +
> > > + if (is_lec_err(dlec)) {
> > > + netdev_dbg(dev, "Data phase error
> > detected\n");
> >
> > If you add a debug, please add one for the Arbitration phase, too.
>
> I have added the debug print specially for dlec (data phase). So we
> can differentiate lec errors (for all type of frames except FD with
> BRS) and Data phase errors, as we are calling same handler function
> for both the errors.
>
> If I understood your comment correctly, you are asking something like below:
> /* handle protocol errors in arbitration phase */
> if ((cdev->can.ctrlmode & CAN_CTRLMODE_BERR_REPORTING) &&
> - m_can_is_protocol_err(irqstatus))
> + m_can_is_protocol_err(irqstatus)) {
> + netdev_dbg(dev, "Arbitration phase error detected\n");
> work_done += m_can_handle_protocol_error(dev, irqstatus);
> + }
>
> If the above implementation is correct as per your review comment, I
> think we don't need the above changes because Debug print for
> arbitration failure are already there in "
> m_can_handle_protocol_error" function.
Ok
regards,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists