RE: [PATCH V5 4/9] wifi: mac80211: Add support for ACPI WBRF

2023-07-03 Thread Quan, Evan
[AMD Official Use Only - General]

Hi Andrew,

> -Original Message-
> From: Andrew Lunn 
> Sent: Saturday, July 1, 2023 9:02 AM
> To: Quan, Evan 
> Cc: raf...@kernel.org; l...@kernel.org; Deucher, Alexander
> ; Koenig, Christian
> ; Pan, Xinhui ;
> airl...@gmail.com; dan...@ffwll.ch; johan...@sipsolutions.net;
> da...@davemloft.net; eduma...@google.com; k...@kernel.org;
> pab...@redhat.com; Limonciello, Mario ;
> mdaen...@redhat.com; maarten.lankho...@linux.intel.com;
> tzimmerm...@suse.de; hdego...@redhat.com; jingyuwang_...@163.com;
> Lazar, Lijo ; jim.cro...@gmail.com;
> bellosili...@gmail.com; andrealm...@igalia.com; t...@redhat.com;
> j...@jsg.id.au; a...@arndb.de; linux-ker...@vger.kernel.org; linux-
> a...@vger.kernel.org; amd-...@lists.freedesktop.org; dri-
> de...@lists.freedesktop.org; linux-wirel...@vger.kernel.org;
> net...@vger.kernel.org
> Subject: Re: [PATCH V5 4/9] wifi: mac80211: Add support for ACPI WBRF
>
> > +static void get_chan_freq_boundary(u32 center_freq,
> > +  u32 bandwidth,
> > +  u64 *start,
> > +  u64 *end)
> > +{
> > +   bandwidth = MHZ_TO_KHZ(bandwidth);
> > +   center_freq = MHZ_TO_KHZ(center_freq);
> > +
> > +   *start = center_freq - bandwidth / 2;
> > +   *end = center_freq + bandwidth / 2;
> > +
> > +   /* Frequency in HZ is expected */
> > +   *start = KHZ_TO_HZ(*start);
> > +   *end = KHZ_TO_HZ(*end);
> > +}
>
> This seems pretty generic, so maybe it should be moved into the shared code?
> It can then become a NOP when the functionality if disabled.
The shared code you mean is some place around mac80211?
Actually, there are two similar variants existed already: 
cfg80211_get_start_freq and cfg80211_get_end_freq.
The outputs of them are really what most mac80211 logics care.
The new API here is unlikely to be shared by other mac80211 part.
So, I suppose placing it here(only in wbrf.c) seems proper.
How do you think?

Evan
>
>   Andrew



Re: [PATCH V5 4/9] wifi: mac80211: Add support for ACPI WBRF

2023-06-30 Thread Andrew Lunn
> +static void get_chan_freq_boundary(u32 center_freq,
> +u32 bandwidth,
> +u64 *start,
> +u64 *end)
> +{
> + bandwidth = MHZ_TO_KHZ(bandwidth);
> + center_freq = MHZ_TO_KHZ(center_freq);
> +
> + *start = center_freq - bandwidth / 2;
> + *end = center_freq + bandwidth / 2;
> +
> + /* Frequency in HZ is expected */
> + *start = KHZ_TO_HZ(*start);
> + *end = KHZ_TO_HZ(*end);
> +}

This seems pretty generic, so maybe it should be moved into the shared
code? It can then become a NOP when the functionality if disabled.

  Andrew



Re: [PATCH V5 4/9] wifi: mac80211: Add support for ACPI WBRF

2023-06-30 Thread kernel test robot
Hi Evan,

kernel test robot noticed the following build errors:

[auto build test ERROR on wireless-next/main]
[also build test ERROR on wireless/main linus/master v6.4]
[cannot apply to drm-misc/drm-misc-next next-20230630]
[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/Evan-Quan/drivers-core-Add-support-for-Wifi-band-RF-mitigations/20230630-183633
base:   
https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git main
patch link:
https://lore.kernel.org/r/20230630103240.1557100-5-evan.quan%40amd.com
patch subject: [PATCH V5 4/9] wifi: mac80211: Add support for ACPI WBRF
config: powerpc-randconfig-r025-20230630 
(https://download.01.org/0day-ci/archive/20230630/202306302133.px6k3lmq-...@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 
4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce: 
(https://download.01.org/0day-ci/archive/20230630/202306302133.px6k3lmq-...@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot 
| Closes: 
https://lore.kernel.org/oe-kbuild-all/202306302133.px6k3lmq-...@intel.com/

All errors (new ones prefixed by >>):

 | ^~
   :87:1: note: expanded from here
  87 | __do_insw
 | ^
   arch/powerpc/include/asm/io.h:615:56: note: expanded from macro '__do_insw'
 615 | #define __do_insw(p, b, n)  readsw((PCI_IO_ADDR)_IO_BASE+(p), 
(b), (n))
 |~^
   In file included from net/mac80211/rx.c:15:
   In file included from include/linux/skbuff.h:17:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:12:
   In file included from include/linux/hardirq.h:11:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:677:
   arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer 
arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
  47 | DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c),
 | ^~~
  48 |  (p, b, c), pio, p)
 |  ~~
   arch/powerpc/include/asm/io.h:674:3: note: expanded from macro 
'DEF_PCI_AC_NORET'
 674 | __do_##name al; \
 | ^~
   :89:1: note: expanded from here
  89 | __do_insl
 | ^
   arch/powerpc/include/asm/io.h:616:56: note: expanded from macro '__do_insl'
 616 | #define __do_insl(p, b, n)  readsl((PCI_IO_ADDR)_IO_BASE+(p), 
(b), (n))
 |~^
   In file included from net/mac80211/rx.c:15:
   In file included from include/linux/skbuff.h:17:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:12:
   In file included from include/linux/hardirq.h:11:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:677:
   arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer 
arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
  49 | DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned 
long c),
 | 
^~
  50 |  (p, b, c), pio, p)
 |  ~~
   arch/powerpc/include/asm/io.h:674:3: note: expanded from macro 
'DEF_PCI_AC_NORET'
 674 | __do_##name al; \
 | ^~
   :91:1: note: expanded from here
  91 | __do_outsb
 | ^
   arch/powerpc/include/asm/io.h:617:58: note: expanded from macro '__do_outsb'
 617 | #define __do_outsb(p, b, n) 
writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
 | ~^
   In file included from net/mac80211/rx.c:15:
   In file included from include/linux/skbuff.h:17:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:12:
   In file included from include/linux/hardirq.h:11:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20: