Search Linux Wireless

Re: [PATCH v2 10/16] rt2x00: add TX LOFT calibration for MT7620

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Daniel,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on wireless-next/main]
[also build test WARNING on wireless/main linus/master v6.0-rc6 next-20220919]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Daniel-Golle/rt2x00-OpenWrt-patches-improving-MT7620/20220918-005109
base:   https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git main
config: arm-defconfig (https://download.01.org/0day-ci/archive/20220920/202209200402.3TMVPkx4-lkp@xxxxxxxxx/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://github.com/intel-lab-lkp/linux/commit/40cb92749cf8545acfa03c180c973181abed168c
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Daniel-Golle/rt2x00-OpenWrt-patches-improving-MT7620/20220918-005109
        git checkout 40cb92749cf8545acfa03c180c973181abed168c
        # 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=arm SHELL=/bin/bash drivers/irqchip/ drivers/net/wireless/ralink/rt2x00/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> drivers/net/wireless/ralink/rt2x00/rt2800lib.c:9439:15: warning: result of comparison of constant -7 with expression of type 'char' is always false [-Wtautological-constant-out-of-range-compare]
           gerr = (gerr < -0x07) ? -0x07 : (gerr > 0x05) ? 0x05 : gerr;
                   ~~~~ ^ ~~~~~
   drivers/net/wireless/ralink/rt2x00/rt2800lib.c:9443:15: warning: result of comparison of constant -31 with expression of type 'char' is always false [-Wtautological-constant-out-of-range-compare]
           perr = (perr < -0x1f) ? -0x1f : (perr > 0x1d) ? 0x1d : perr;
                   ~~~~ ^ ~~~~~
   drivers/net/wireless/ralink/rt2x00/rt2800lib.c:9509:6: warning: no previous prototype for function 'rt2800_loft_iq_calibration' [-Wmissing-prototypes]
   void rt2800_loft_iq_calibration(struct rt2x00_dev *rt2x00dev)
        ^
   drivers/net/wireless/ralink/rt2x00/rt2800lib.c:9509:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void rt2800_loft_iq_calibration(struct rt2x00_dev *rt2x00dev)
   ^
   static 
   3 warnings generated.


vim +/char +9439 drivers/net/wireless/ralink/rt2x00/rt2800lib.c

  9350	
  9351	static void rt2800_iq_search(struct rt2x00_dev *rt2x00dev, u8 ch_idx, u8 *ges, u8 *pes)
  9352	{
  9353		u32 p0 = 0, p1 = 0, pf = 0;
  9354		char perr = 0, gerr = 0, iq_err = 0;
  9355		char pef = 0, gef = 0;
  9356		char psta, pend;
  9357		char gsta, gend;
  9358	
  9359		u8 ibit = 0x20;
  9360		u8 first_search = 0x00, touch_neg_max = 0x00;
  9361		char idx0 = 0, idx1 = 0;
  9362		u8 gop;
  9363		u8 bbp = 0;
  9364		char bidx;
  9365	
  9366		for (bidx = 5; bidx >= 1; bidx--) {
  9367			for (gop = 0; gop < 2; gop++) {
  9368				if (gop == 1 || bidx < 4) {
  9369					if (gop == 0)
  9370						iq_err = gerr;
  9371					else
  9372						iq_err = perr;
  9373	
  9374					first_search = (gop == 0) ? (bidx == 3) : (bidx == 5);
  9375					touch_neg_max = (gop) ? ((iq_err & 0x0F) == 0x08) :
  9376								((iq_err & 0x3F) == 0x20);
  9377	
  9378					if (touch_neg_max) {
  9379						p0 = pf;
  9380						idx0 = iq_err;
  9381					} else {
  9382						idx0 = iq_err - ibit;
  9383						bbp = (ch_idx == 0) ? ((gop == 0) ? 0x28 : 0x29) :
  9384								      ((gop == 0) ? 0x46 : 0x47);
  9385	
  9386						rt2800_bbp_write(rt2x00dev, 158, bbp);
  9387						rt2800_bbp_write(rt2x00dev, 159, idx0);
  9388	
  9389						p0 = rt2800_do_fft_accumulation(rt2x00dev, 0x14, 1);
  9390					}
  9391	
  9392					idx1 = iq_err + (first_search ? 0 : ibit);
  9393					idx1 = (gop == 0) ? (idx1 & 0x0F) : (idx1 & 0x3F);
  9394	
  9395					bbp = (ch_idx == 0) ? (gop == 0) ? 0x28 : 0x29 :
  9396					      (gop == 0) ? 0x46 : 0x47;
  9397	
  9398					rt2800_bbp_write(rt2x00dev, 158, bbp);
  9399					rt2800_bbp_write(rt2x00dev, 159, idx1);
  9400	
  9401					p1 = rt2800_do_fft_accumulation(rt2x00dev, 0x14, 1);
  9402	
  9403					rt2x00_dbg(rt2x00dev,
  9404						   "p0=%x, p1=%x, pwer_final=%x, idx0=%x, idx1=%x, iq_err=%x, gop=%d, ibit=%x\n",
  9405						   p0, p1, pf, idx0, idx1, iq_err, gop, ibit);
  9406	
  9407					if (!(!first_search && pf <= p0 && pf < p1)) {
  9408						if (p0 < p1) {
  9409							pf = p0;
  9410							iq_err = idx0;
  9411						} else {
  9412							pf = p1;
  9413							iq_err = idx1;
  9414						}
  9415					}
  9416	
  9417					bbp = (ch_idx == 0) ? (gop == 0) ? 0x28 : 0x29 :
  9418							      (gop == 0) ? 0x46 : 0x47;
  9419	
  9420					rt2800_bbp_write(rt2x00dev, 158, bbp);
  9421					rt2800_bbp_write(rt2x00dev, 159, iq_err);
  9422	
  9423					if (gop == 0)
  9424						gerr = iq_err;
  9425					else
  9426						perr = iq_err;
  9427	
  9428					rt2x00_dbg(rt2x00dev, "IQCalibration pf=%8x (%2x, %2x) !\n",
  9429						   pf, gerr & 0x0F, perr & 0x3F);
  9430				}
  9431			}
  9432	
  9433			if (bidx > 0)
  9434				ibit = (ibit >> 1);
  9435		}
  9436		gerr = (gerr & 0x08) ? (gerr & 0x0F) - 0x10 : (gerr & 0x0F);
  9437		perr = (perr & 0x20) ? (perr & 0x3F) - 0x40 : (perr & 0x3F);
  9438	
> 9439		gerr = (gerr < -0x07) ? -0x07 : (gerr > 0x05) ? 0x05 : gerr;
  9440		gsta = gerr - 1;
  9441		gend = gerr + 2;
  9442	
  9443		perr = (perr < -0x1f) ? -0x1f : (perr > 0x1d) ? 0x1d : perr;
  9444		psta = perr - 1;
  9445		pend = perr + 2;
  9446	
  9447		for (gef = gsta; gef <= gend; gef = gef + 1)
  9448			for (pef = psta; pef <= pend; pef = pef + 1) {
  9449				bbp = (ch_idx == 0) ? 0x28 : 0x46;
  9450				rt2800_bbp_write(rt2x00dev, 158, bbp);
  9451				rt2800_bbp_write(rt2x00dev, 159, gef & 0x0F);
  9452	
  9453				bbp = (ch_idx == 0) ? 0x29 : 0x47;
  9454				rt2800_bbp_write(rt2x00dev, 158, bbp);
  9455				rt2800_bbp_write(rt2x00dev, 159, pef & 0x3F);
  9456	
  9457				p1 = rt2800_do_fft_accumulation(rt2x00dev, 0x14, 1);
  9458				if (gef == gsta && pef == psta) {
  9459					pf = p1;
  9460					gerr = gef;
  9461					perr = pef;
  9462				} else if (pf > p1) {
  9463					pf = p1;
  9464					gerr = gef;
  9465					perr = pef;
  9466				}
  9467				rt2x00_dbg(rt2x00dev, "Fine IQCalibration p1=%8x pf=%8x (%2x, %2x) !\n",
  9468					   p1, pf, gef & 0x0F, pef & 0x3F);
  9469			}
  9470	
  9471		ges[ch_idx] = gerr & 0x0F;
  9472		pes[ch_idx] = perr & 0x3F;
  9473	}
  9474	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux