linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vincent MAILHOL <mailhol.vincent@wanadoo.fr>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: linux-can <linux-can@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	Oliver Hartkopp <socketcan@hartkopp.net>
Subject: Re: [PATCH v2 2/2] can: netlink: add interface for CAN-FD Transmitter Delay Compensation (TDC)
Date: Thu, 17 Jun 2021 00:44:12 +0900	[thread overview]
Message-ID: <CAMZ6RqLZAO3UX=B8yVUse=4DAVG_zGPrdoYpd-7Cp_To58CChw@mail.gmail.com> (raw)
In-Reply-To: <20210616144640.l4hjc6mc3ndw25hj@pengutronix.de>

On Wed. 16 Jun 2021 at 23:46, Marc Kleine-Budde <mkl@pengutronix.de> wrote:
> On 16.06.2021 23:43:35, Vincent MAILHOL wrote:
> > > Sounds good, I'm squashing this patch:
> > >
> > > | diff --git a/drivers/net/can/dev/netlink.c b/drivers/net/can/dev/netlink.c
> > > | index 6134bbf69c10..d48be574eae7 100644
> > > | --- a/drivers/net/can/dev/netlink.c
> > > | +++ b/drivers/net/can/dev/netlink.c
> > > | @@ -311,7 +311,7 @@ static size_t can_tdc_get_size(const struct net_device *dev)
> > > |         size += nla_total_size(sizeof(u32));            /* IFLA_CAN_TDCO_MAX */
> > > |         size += nla_total_size(sizeof(u32));            /* IFLA_CAN_TDCF_MAX */
> > > |
> > > | -       if (priv->tdc.tdco) {
> > > | +       if (can_tdc_is_enabled(priv)) {
> > > |                 size += nla_total_size(sizeof(u32));    /* IFLA_CAN_TDCV */
> > > |                 size += nla_total_size(sizeof(u32));    /* IFLA_CAN_TDCO */
> > > |                 size += nla_total_size(sizeof(u32));    /* IFLA_CAN_TDCF */
> > > | @@ -352,6 +352,7 @@ static size_t can_get_size(const struct net_device *dev)
> > > |                                        priv->data_bitrate_const_cnt);
> > > |         size += sizeof(priv->bitrate_max);                      /* IFLA_CAN_BITRATE_MAX */
> > > |         size += can_tdc_get_size(dev);                          /* IFLA_CAN_TDC */
> > > | +
> > > |         return size;
> > > |  }
> > > |
> > > | @@ -374,7 +375,7 @@ static int can_tdc_fill_info(struct sk_buff *skb, const struct net_device *dev)
> > > |             nla_put_u32(skb, IFLA_CAN_TDC_TDCF_MAX, tdc_const->tdcf_max))
> > > |                 goto err_cancel;
> > > |
> > > | -       if (priv->tdc.tdco)
> > > | +       if (can_tdc_is_enabled(priv)) {
> > > |                 if (nla_put_u32(skb, IFLA_CAN_TDC_TDCV, tdc->tdcv) ||
> > > |                     nla_put_u32(skb, IFLA_CAN_TDC_TDCO, tdc->tdco) ||
> > > |                     nla_put_u32(skb, IFLA_CAN_TDC_TDCF, tdc->tdcf))
> > > | diff --git a/include/linux/can/bittiming.h b/include/linux/can/bittiming.h
> > > | index 9de6e9053e34..b6d1db1e7258 100644
> > > | --- a/include/linux/can/bittiming.h
> > > | +++ b/include/linux/can/bittiming.h
> > > | @@ -83,6 +83,11 @@ struct can_tdc_const {
> > > |         u32 tdcf_max;
> > > |  };
> > > |
> > > | +static inline bool can_tdc_is_enabled(const struct can_priv *priv)
> >
> > Did you try to compile?
>
> Not before sending that mail :)
>
> > I am not sure if bittiming.h is able to see struct can_priv which is
> > defined in dev.h.
>
> Nope it doesn't, I moved the can_tdc_is_enabled() to
> include/linux/can/dev.h

Ack. It seems to be the only solution…

Moving forward, I will do one more round of tests and send the
patch for iproute2-next (warning, the RFC I sent last month has
some issues, if you wish to test it on your side, please wait).

I will also apply can_tdc_is_enabled() to the etas_es58x driver.

Could you push the recent changes on the testing branch of linux-can-next? It
would be really helpful for me!


Yours sincerely,
Vincent

  reply	other threads:[~2021-06-16 15:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-03 15:15 [PATCH v2 0/2] add the netlink interface for CAN-FD Transmitter Delay Compensation (TDC) Vincent Mailhol
2021-06-03 15:15 ` [PATCH v2 1/2] can: netlink: remove redundant check in can_validate() Vincent Mailhol
2021-06-03 15:15 ` [PATCH v2 2/2] can: netlink: add interface for CAN-FD Transmitter Delay Compensation (TDC) Vincent Mailhol
2021-06-16  9:46   ` Marc Kleine-Budde
2021-06-16 13:53     ` Vincent MAILHOL
2021-06-16 14:29       ` Marc Kleine-Budde
2021-06-16 14:43         ` Vincent MAILHOL
2021-06-16 14:46           ` Marc Kleine-Budde
2021-06-16 15:44             ` Vincent MAILHOL [this message]
2021-06-17 11:38               ` Marc Kleine-Budde
2021-06-18  9:34   ` Marc Kleine-Budde
2021-06-18 10:23     ` Vincent MAILHOL
2021-06-18 11:17       ` Vincent MAILHOL
2021-06-18 12:44         ` CAN-FD Transmitter Delay Compensation (TDC) on mcp2518fd Marc Kleine-Budde
2021-06-18 14:27           ` Vincent MAILHOL
2021-06-18 15:55             ` Stefan Mätje
2021-06-19 12:34               ` Vincent MAILHOL
2021-06-21 18:42                 ` Stefan Mätje
2021-06-21 23:52                   ` Vincent MAILHOL
2021-06-22  0:04                     ` Vincent MAILHOL

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='CAMZ6RqLZAO3UX=B8yVUse=4DAVG_zGPrdoYpd-7Cp_To58CChw@mail.gmail.com' \
    --to=mailhol.vincent@wanadoo.fr \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=socketcan@hartkopp.net \
    /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).