Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp891999pxj; Wed, 16 Jun 2021 16:28:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzaO9zS+ZI0Czf12qcL7wg275KBfHMARW81TB+slGkW3HtClSPv+5nDc6iSkkBmkCWhSlyP X-Received: by 2002:a17:906:2d51:: with SMTP id e17mr1931113eji.500.1623886127485; Wed, 16 Jun 2021 16:28:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623886127; cv=none; d=google.com; s=arc-20160816; b=cBbi8D/rglH2eJ/wvfgTVJgtjFSL7c6W+uw9Et1ityniEFBF3NrfQ+RCc0m0+bAI7L vfMWu6nxBjaY5JdPwJ3j1jCxOtD2GuH1EZG3xnVePT2/sF/l5b3/nfujDvG9C1kmG4Es mKW50S/JmA5Iiw91Sni/Cuq8bq8SytfiE/J+vt/Dv6jGbSvT3bPhtH4iFZ+hICGOlpjy r+HQN60sNXJ1z9oG3px0SYbA+BCkLRVYXwTk7zVDkkUrt3w07DMTvpyX99KvHagWTMzU lqdLwzRTevez5rpZ2vyLMtlciy3QV3A7HMzwf5Ja3jukBwDwCy+07FmN5bZMrwOymTwU oK8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=/HD5yhSTBDr9KCszbvgwjskaAfMR27SyDjtu1WerIg0=; b=xYunOPiBTSbjtQ8jxmPXmouzzJ4lruvTgqQGL4ltVnyqgq3PFy0cYn1Rkl1T12DRqc UHTbMGynWIUA6iemGnEe8WWeJsmJ+EUHSYj9vXhrAxnCh+vJYxJYpZmXc+xo38S2rkBD 9rvGPtNZcD11FJpruZuzCsE8vA9/QJDR57M1DDVEcIwZxicL/HisAypfJJtqYz78IGRs Hkuc6lydQE3Lpgy2U9YeYlQk+1qpxiStirCuHjzMajpRLEODpa6oBacW94ZehrfNyDlw x5FiqCzDRPYX8mrczMsBFve/PWFe8HrSR+lzn46rLO3XJZ/eo/YyQZbvA7J5kPEOrCpu 1ByQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c27si3736248ejj.287.2021.06.16.16.28.24; Wed, 16 Jun 2021 16:28:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235660AbhFPPrq convert rfc822-to-8bit (ORCPT + 99 others); Wed, 16 Jun 2021 11:47:46 -0400 Received: from mail-lj1-f175.google.com ([209.85.208.175]:46660 "EHLO mail-lj1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235727AbhFPPqb (ORCPT ); Wed, 16 Jun 2021 11:46:31 -0400 Received: by mail-lj1-f175.google.com with SMTP id b37so4435194ljr.13; Wed, 16 Jun 2021 08:44:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=bx6pJveQBPVAV+AJO0rwH2DDFurC6rZ+xmLnsk0p5p0=; b=M5dJ2sD5vJNuU9yn/+ll8720MTu2jLo2Fni9RU1MpOSFQpKz81u7B15T93w60E2mNy yR9iv/a/y9iaUsu9oyhimakJkw2+lBhvgFHSWtPERT+S2Dhv2dw+RQHXI+JUbx1lezfD RvOeHu49POlf/Nc9IEll5cxNdd8PJ3kX9qjb5vtK0laVpo6KcIuW4GmG/x9Xg3HawyGz vnBSTGQo60Z5dlw4YE92aEqXjttwYEzmbnjnaT3aDM0sZ2FRDiMoy4DEYXhE02ZlqPyM 3omOkGepaZthiz3BSG8BNmqzO3r4I8ehJn8UOBuhfTwS9RjGHksbkjhhPKhqCV0PuzEC 9wTQ== X-Gm-Message-State: AOAM533t+LyVU97pMGkt189FI3I/grkUYaLCA/B5OYi2suP+rfBdTDr5 lMzbsesoFRrNz17SKnL9sU1Syb10Bw2Z1mwcvEU= X-Received: by 2002:a2e:984a:: with SMTP id e10mr397620ljj.331.1623858263457; Wed, 16 Jun 2021 08:44:23 -0700 (PDT) MIME-Version: 1.0 References: <20210603151550.140727-1-mailhol.vincent@wanadoo.fr> <20210603151550.140727-3-mailhol.vincent@wanadoo.fr> <20210616094633.fwg6rsyxyvm2zc6d@pengutronix.de> <20210616142940.wxllr3c55rk66rij@pengutronix.de> <20210616144640.l4hjc6mc3ndw25hj@pengutronix.de> In-Reply-To: <20210616144640.l4hjc6mc3ndw25hj@pengutronix.de> From: Vincent MAILHOL Date: Thu, 17 Jun 2021 00:44:12 +0900 Message-ID: Subject: Re: [PATCH v2 2/2] can: netlink: add interface for CAN-FD Transmitter Delay Compensation (TDC) To: Marc Kleine-Budde Cc: linux-can , netdev , open list , Oliver Hartkopp Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed. 16 Jun 2021 at 23:46, Marc Kleine-Budde 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