netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joakim Zhang <qiangqing.zhang@nxp.com>
To: Marc Kleine-Budde <mkl@pengutronix.de>, Michael Walle <michael@walle.cc>
Cc: "linux-can@vger.kernel.org" <linux-can@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: RE: [PATCH linux-can-next/flexcan] can: flexcan: fix TDC feature
Date: Wed, 16 Sep 2020 02:26:52 +0000	[thread overview]
Message-ID: <DB8PR04MB6795D75BE5A285980E75892EE6210@DB8PR04MB6795.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <61489f52-84d5-e800-02f9-e40596e269ef@pengutronix.de>


> -----Original Message-----
> From: Marc Kleine-Budde <mkl@pengutronix.de>
> Sent: 2020年9月16日 6:16
> To: Joakim Zhang <qiangqing.zhang@nxp.com>; Michael Walle
> <michael@walle.cc>
> Cc: linux-can@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>;
> netdev@vger.kernel.org
> Subject: Re: [PATCH linux-can-next/flexcan] can: flexcan: fix TDC feature
> 
> On 6/30/20 4:25 AM, Joakim Zhang wrote:
> > I have also noticed this difference, although this could not break
> > function, but IMO, using priv->can.ctrlmode should be better.
> >
[...]

> > 2) Clean timing register.
> > --- a/drivers/net/can/flexcan.c
> > +++ b/drivers/net/can/flexcan.c
> > @@ -1167,6 +1167,14 @@ static void flexcan_set_bittiming_cbt(const
> struct net_device *dev)
> >         struct flexcan_regs __iomem *regs = priv->regs;
> >         u32 reg_cbt, reg_fdctrl;
> >
> > +       reg_cbt = priv->read(&regs->cbt);
> > +       reg_cbt &= ~(FLEXCAN_CBT_BTF |
> > +               FIELD_PREP(FLEXCAN_CBT_EPRESDIV_MASK, 0x3ff) |
> > +               FIELD_PREP(FLEXCAN_CBT_ERJW_MASK, 0x1f) |
> > +               FIELD_PREP(FLEXCAN_CBT_EPROPSEG_MASK, 0x3f) |
> > +               FIELD_PREP(FLEXCAN_CBT_EPSEG1_MASK, 0x1f) |
> > +               FIELD_PREP(FLEXCAN_CBT_EPSEG2_MASK, 0x1f));
> > +
> 
> Why is this needed? The "reg_cbt &=" sets reg_cbt basically to 0, as the fields
> and the BTF occupy all 32bit.
> 
> The only thing that's left over is the read()....

Yes, need not, I have not noticed it has occupy the whole 32bit.

There is a small improve patch to balance the usage_count if register flexcandev failed. Could you pick up it by the way this time?
https://www.spinics.net/lists/linux-can/msg03052.html


Best Regards,
Joakim Zhang

  reply	other threads:[~2020-09-16  2:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-16  9:31 [PATCH Resend linux-can-next/testing] can: flexcan: add correctable errors correction when HW supports ECC Joakim Zhang
2020-04-16  9:31 ` [PATCH linux-can-next/flexcan] can: flexcan: fix TDC feature Joakim Zhang
2020-04-16  9:41   ` Joakim Zhang
2020-06-02 10:15     ` Michael Walle
2020-06-25 12:37       ` Michael Walle
2020-06-25 12:56         ` Marc Kleine-Budde
2020-06-29  5:37           ` Joakim Zhang
2020-06-29 16:23           ` Michael Walle
2020-06-30  2:25             ` Joakim Zhang
2020-09-15 22:16               ` Marc Kleine-Budde
2020-09-16  2:26                 ` Joakim Zhang [this message]
2020-09-15 22:15             ` Marc Kleine-Budde
2020-07-23 21:09           ` Michael Walle
2020-09-14 15:16             ` Michael Walle

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=DB8PR04MB6795D75BE5A285980E75892EE6210@DB8PR04MB6795.eurprd04.prod.outlook.com \
    --to=qiangqing.zhang@nxp.com \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=michael@walle.cc \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.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 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).