mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Biao Huang <biao.huang@mediatek.com>
To: kernel test robot <lkp@intel.com>,
	David Miller <davem@davemloft.net>,
	Matthias Brugger <matthias.bgg@gmail.com>
Cc: <llvm@lists.linux.dev>, <kbuild-all@lists.01.org>,
	<netdev@vger.kernel.org>,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	"Eric Dumazet" <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	AngeloGioacchino Del Regno 
	<angelogioacchino.delregno@collabora.com>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>,
	<linux-mediatek@lists.infradead.org>, <macpaul.lin@mediatek.com>,
	"Jisheng Zhang" <jszhang@kernel.org>,
	Mohammad Athari Bin Ismail <mohammad.athari.ismail@intel.com>
Subject: Re: [PATCH net v4 3/3] net: stmmac: fix unbalanced ptp clock issue in suspend/resume flow
Date: Fri, 15 Jul 2022 15:52:22 +0800	[thread overview]
Message-ID: <5a36c4d676b462a8652a27ce9748d4b7597eb0b2.camel@mediatek.com> (raw)
In-Reply-To: <202207150612.B3phHNEY-lkp@intel.com>

Hi,
	This warning is fixed in v5 send, please test with v5.

Best Regards!
Biao

On Fri, 2022-07-15 at 06:40 +0800, kernel test robot wrote:
> Hi Biao,
> 
> Thank you for the patch! Perhaps something to improve:
> 
> [auto build test WARNING on net/master]
> 
> url:    
> https://urldefense.com/v3/__https://github.com/intel-lab-lkp/linux/commits/Biao-Huang/stmmac-dwmac-mediatek-fix-clock-issue/20220713-181044__;!!CTRNKA9wMg0ARbw!zSIorkBYIMJM_lsS_i-iPXUHkJnImzF7_legwMzhyi3I_4dNo9-GDn7_MBAjUJw2wA$
>  
> base:   
> https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git__;!!CTRNKA9wMg0ARbw!zSIorkBYIMJM_lsS_i-iPXUHkJnImzF7_legwMzhyi3I_4dNo9-GDn7_MBA1ViIHxA$
>   22b9c41a3fb8ef4624bcda312665937d2ba98aa7
> config: x86_64-randconfig-a016 (
> https://urldefense.com/v3/__https://download.01.org/0day-ci/archive/20220715/202207150612.B3phHNEY-lkp@intel.com/config__;!!CTRNKA9wMg0ARbw!zSIorkBYIMJM_lsS_i-iPXUHkJnImzF7_legwMzhyi3I_4dNo9-GDn7_MBDrBZ7cUQ$
>  )
> compiler: clang version 15.0.0 (
> https://urldefense.com/v3/__https://github.com/llvm/llvm-project__;!!CTRNKA9wMg0ARbw!zSIorkBYIMJM_lsS_i-iPXUHkJnImzF7_legwMzhyi3I_4dNo9-GDn7_MBB4_f7rKw$
> $  5e61b9c556267086ef9b743a0b57df302eef831b)
> reproduce (this is a W=1 build):
>         wget 
> https://urldefense.com/v3/__https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross__;!!CTRNKA9wMg0ARbw!zSIorkBYIMJM_lsS_i-iPXUHkJnImzF7_legwMzhyi3I_4dNo9-GDn7_MBBCyTTgjA$
>   -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # 
> https://urldefense.com/v3/__https://github.com/intel-lab-lkp/linux/commit/f145c999bcff52c22cc849bf17f2b30c5e991c0a__;!!CTRNKA9wMg0ARbw!zSIorkBYIMJM_lsS_i-iPXUHkJnImzF7_legwMzhyi3I_4dNo9-GDn7_MBCdfrCTBg$
>  
>         git remote add linux-review 
> https://urldefense.com/v3/__https://github.com/intel-lab-lkp/linux__;!!CTRNKA9wMg0ARbw!zSIorkBYIMJM_lsS_i-iPXUHkJnImzF7_legwMzhyi3I_4dNo9-GDn7_MBAnpXqSbQ$
>  
>         git fetch --no-tags linux-review Biao-Huang/stmmac-dwmac-
> mediatek-fix-clock-issue/20220713-181044
>         git checkout f145c999bcff52c22cc849bf17f2b30c5e991c0a
>         # save the config file
>         mkdir build_dir && cp config build_dir/.config
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross
> W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
> drivers/net/ethernet/stmicro/stmmac/
> 
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All warnings (new ones prefixed by >>):
> 
> > > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:837:6: warning:
> > > unused variable 'ret' [-Wunused-variable]
> 
>            int ret;
>                ^
>    1 warning generated.
> 
> 
> vim +/ret +837 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> 
> 891434b18ec0a2 Rayagond Kokatanur 2013-03-26  820  
> a6da2bbb0005e6 Holger Assmann     2021-11-21  821  /**
> a6da2bbb0005e6 Holger Assmann     2021-11-21  822   *
> stmmac_init_tstamp_counter - init hardware timestamping counter
> a6da2bbb0005e6 Holger Assmann     2021-11-21  823   * @priv: driver
> private structure
> a6da2bbb0005e6 Holger Assmann     2021-11-21  824   * @systime_flags:
> timestamping flags
> a6da2bbb0005e6 Holger Assmann     2021-11-21  825   * Description:
> a6da2bbb0005e6 Holger Assmann     2021-11-21  826   * Initialize
> hardware counter for packet timestamping.
> a6da2bbb0005e6 Holger Assmann     2021-11-21  827   * This is valid
> as long as the interface is open and not suspended.
> a6da2bbb0005e6 Holger Assmann     2021-11-21  828   * Will be rerun
> after resuming from suspend, case in which the timestamping
> a6da2bbb0005e6 Holger Assmann     2021-11-21  829   * flags updated
> by stmmac_hwtstamp_set() also need to be restored.
> a6da2bbb0005e6 Holger Assmann     2021-11-21  830   */
> a6da2bbb0005e6 Holger Assmann     2021-11-21  831  int
> stmmac_init_tstamp_counter(struct stmmac_priv *priv, u32
> systime_flags)
> a6da2bbb0005e6 Holger Assmann     2021-11-21  832  {
> a6da2bbb0005e6 Holger Assmann     2021-11-21  833  	bool xmac =
> priv->plat->has_gmac4 || priv->plat->has_xgmac;
> a6da2bbb0005e6 Holger Assmann     2021-11-21  834  	struct
> timespec64 now;
> a6da2bbb0005e6 Holger Assmann     2021-11-21  835  	u32 sec_inc =
> 0;
> a6da2bbb0005e6 Holger Assmann     2021-11-21  836  	u64 temp = 0;
> a6da2bbb0005e6 Holger Assmann     2021-11-21 @837  	int ret;
> a6da2bbb0005e6 Holger Assmann     2021-11-21  838  
> a6da2bbb0005e6 Holger Assmann     2021-11-21  839  	if (!(priv-
> >dma_cap.time_stamp || priv->dma_cap.atime_stamp))
> a6da2bbb0005e6 Holger Assmann     2021-11-21  840  		return
> -EOPNOTSUPP;
> a6da2bbb0005e6 Holger Assmann     2021-11-21  841  
> a6da2bbb0005e6 Holger Assmann     2021-11-21  842  	stmmac_config_h
> w_tstamping(priv, priv->ptpaddr, systime_flags);
> a6da2bbb0005e6 Holger Assmann     2021-11-21  843  	priv-
> >systime_flags = systime_flags;
> a6da2bbb0005e6 Holger Assmann     2021-11-21  844  
> a6da2bbb0005e6 Holger Assmann     2021-11-21  845  	/* program Sub
> Second Increment reg */
> a6da2bbb0005e6 Holger Assmann     2021-11-21  846  	stmmac_config_s
> ub_second_increment(priv, priv->ptpaddr,
> a6da2bbb0005e6 Holger Assmann     2021-11-21  847  			
> 		   priv->plat->clk_ptp_rate,
> a6da2bbb0005e6 Holger Assmann     2021-11-21  848  			
> 		   xmac, &sec_inc);
> a6da2bbb0005e6 Holger Assmann     2021-11-21  849  	temp =
> div_u64(1000000000ULL, sec_inc);
> a6da2bbb0005e6 Holger Assmann     2021-11-21  850  
> a6da2bbb0005e6 Holger Assmann     2021-11-21  851  	/* Store sub
> second increment for later use */
> a6da2bbb0005e6 Holger Assmann     2021-11-21  852  	priv-
> >sub_second_inc = sec_inc;
> a6da2bbb0005e6 Holger Assmann     2021-11-21  853  
> a6da2bbb0005e6 Holger Assmann     2021-11-21  854  	/* calculate
> default added value:
> a6da2bbb0005e6 Holger Assmann     2021-11-21  855  	 * formula is :
> a6da2bbb0005e6 Holger Assmann     2021-11-21  856  	 * addend =
> (2^32)/freq_div_ratio;
> a6da2bbb0005e6 Holger Assmann     2021-11-21  857  	 * where,
> freq_div_ratio = 1e9ns/sec_inc
> a6da2bbb0005e6 Holger Assmann     2021-11-21  858  	 */
> a6da2bbb0005e6 Holger Assmann     2021-11-21  859  	temp =
> (u64)(temp << 32);
> a6da2bbb0005e6 Holger Assmann     2021-11-21  860  	priv-
> >default_addend = div_u64(temp, priv->plat->clk_ptp_rate);
> a6da2bbb0005e6 Holger Assmann     2021-11-21  861  	stmmac_config_a
> ddend(priv, priv->ptpaddr, priv->default_addend);
> a6da2bbb0005e6 Holger Assmann     2021-11-21  862  
> a6da2bbb0005e6 Holger Assmann     2021-11-21  863  	/* initialize
> system time */
> a6da2bbb0005e6 Holger Assmann     2021-11-21  864  	ktime_get_real_
> ts64(&now);
> a6da2bbb0005e6 Holger Assmann     2021-11-21  865  
> a6da2bbb0005e6 Holger Assmann     2021-11-21  866  	/* lower 32
> bits of tv_sec are safe until y2106 */
> a6da2bbb0005e6 Holger Assmann     2021-11-21  867  	stmmac_init_sys
> time(priv, priv->ptpaddr, (u32)now.tv_sec, now.tv_nsec);
> a6da2bbb0005e6 Holger Assmann     2021-11-21  868  
> a6da2bbb0005e6 Holger Assmann     2021-11-21  869  	return 0;
> a6da2bbb0005e6 Holger Assmann     2021-11-21  870  }
> a6da2bbb0005e6 Holger Assmann     2021-11-
> 21  871  EXPORT_SYMBOL_GPL(stmmac_init_tstamp_counter);
> a6da2bbb0005e6 Holger Assmann     2021-11-21  872  
> 


      reply	other threads:[~2022-07-15  7:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-13 10:09 [PATCH net v4 0/3] stmmac: dwmac-mediatek: fix clock issue Biao Huang
2022-07-13 10:10 ` [PATCH net v4 1/3] " Biao Huang
2022-07-13 12:11   ` Matthias Brugger
2022-07-14  1:18     ` Biao Huang
2022-07-13 10:10 ` [PATCH net v4 2/3] net: stmmac: fix pm runtime issue in stmmac_dvr_remove() Biao Huang
2022-07-13 10:10 ` [PATCH net v4 3/3] net: stmmac: fix unbalanced ptp clock issue in suspend/resume flow Biao Huang
2022-07-14  3:39   ` Jakub Kicinski
2022-07-14  5:37     ` Biao Huang
2022-07-14 22:40   ` kernel test robot
2022-07-15  7:52     ` Biao Huang [this message]

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=5a36c4d676b462a8652a27ce9748d4b7597eb0b2.camel@mediatek.com \
    --to=biao.huang@mediatek.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=joabreu@synopsys.com \
    --cc=jszhang@kernel.org \
    --cc=kbuild-all@lists.01.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=macpaul.lin@mediatek.com \
    --cc=matthias.bgg@gmail.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=mohammad.athari.ismail@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=peppe.cavallaro@st.com \
    /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

all inboxes | Powered by JetHome®