Re: [Intel-wired-lan] [PATCH intel-next] ice: Fix E810 PTP reset flow
by kernel test robot
Hi Karol,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on v5.16-rc5]
[also build test ERROR on next-20211213]
[cannot apply to tnguy-next-queue/dev-queue]
[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]
url: https://github.com/0day-ci/linux/commits/Karol-Kolacinski/ice-Fix-E810-PT...
base: 2585cf9dfaaddf00b069673f27bb3f8530e2039c
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20211215/202112150216.KjZRqhcv-lk...)
compiler: arceb-elf-gcc (GCC) 11.2.0
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
# https://github.com/0day-ci/linux/commit/b0b4ffaf89f2043ff019a735373e6cf0b...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Karol-Kolacinski/ice-Fix-E810-PTP-reset-flow/20211214-205421
git checkout b0b4ffaf89f2043ff019a735373e6cf0b9439683
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/net/ethernet/intel/ice/ice_ptp.c: In function 'ice_ptp_reset':
>> drivers/net/ethernet/intel/ice/ice_ptp.c:1792:22: error: 'hw' undeclared (first use in this function)
1792 | u8 src_idx = hw->func_caps.ts_func_info.tmr_index_owned;
| ^~
drivers/net/ethernet/intel/ice/ice_ptp.c:1792:22: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/net/ethernet/intel/ice/ice_ptp.c:1799:22: error: '__ICE_PFR_REQ' undeclared (first use in this function); did you mean 'ICE_PFR_REQ'?
1799 | if (test_bit(__ICE_PFR_REQ, pf->state))
| ^~~~~~~~~~~~~
| ICE_PFR_REQ
drivers/net/ethernet/intel/ice/ice_ptp.c: In function 'ice_ptp_prepare_for_reset':
drivers/net/ethernet/intel/ice/ice_ptp.c:1883:22: error: '__ICE_PFR_REQ' undeclared (first use in this function); did you mean 'ICE_PFR_REQ'?
1883 | if (test_bit(__ICE_PFR_REQ, pf->state))
| ^~~~~~~~~~~~~
| ICE_PFR_REQ
vim +/hw +1792 drivers/net/ethernet/intel/ice/ice_ptp.c
1785
1786 /**
1787 * ice_ptp_reset - Initialize PTP hardware clock support after reset
1788 * @pf: Board private structure
1789 */
1790 void ice_ptp_reset(struct ice_pf *pf)
1791 {
> 1792 u8 src_idx = hw->func_caps.ts_func_info.tmr_index_owned;
1793 struct ice_ptp *ptp = &pf->ptp;
1794 struct ice_hw *hw = &pf->hw;
1795 struct timespec64 ts;
1796 int err = 1;
1797 u64 time_diff;
1798
> 1799 if (test_bit(__ICE_PFR_REQ, pf->state))
1800 goto pfr;
1801
1802 wr32(hw, GLTSYN_SYNC_DLAY, 0);
1803
1804 /* Enable source clocks */
1805 wr32(hw, GLTSYN_ENA(src_idx), GLTSYN_ENA_TSYN_ENA_M);
1806
1807 /* Enable PHY time sync */
1808 err = ice_ptp_init_phy_e810(hw);
1809 if (err)
1810 goto err;
1811
1812 /* Clear event status indications for auxiliary pins */
1813 (void)rd32(hw, GLTSYN_STAT(src_idx));
1814
1815 /* Acquire the global hardware lock */
1816 if (!ice_ptp_lock(hw)) {
1817 err = -EBUSY;
1818 goto err;
1819 }
1820
1821 /* Write the increment time value to PHY and LAN */
1822 err = ice_ptp_write_incval(hw, ICE_PTP_NOMINAL_INCVAL_E810);
1823 if (err) {
1824 ice_ptp_unlock(hw);
1825 goto err;
1826 }
1827
1828 /* Write the initial Time value to PHY and LAN using the cached PHC
1829 * time before the reset and time difference between stopping and
1830 * starting the clock.
1831 */
1832 if (ptp->cached_phc_time) {
1833 time_diff = ktime_get_real_ns() - ptp->reset_time;
1834 ts = ns_to_timespec64(ptp->cached_phc_time + time_diff);
1835 } else {
1836 ts = ktime_to_timespec64(ktime_get_real());
1837 }
1838 err = ice_ptp_write_init(pf, &ts);
1839 if (err) {
1840 ice_ptp_unlock(hw);
1841 goto err;
1842 }
1843
1844 /* Release the global hardware lock */
1845 ice_ptp_unlock(hw);
1846
1847 pfr:
1848 /* Init Tx structures */
1849 if (ice_is_e810(&pf->hw))
1850 err = ice_ptp_init_tx_e810(pf, &ptp->port.tx);
1851 if (err)
1852 goto err;
1853
1854 set_bit(ICE_FLAG_PTP, pf->flags);
1855
1856 /* Start periodic work going */
1857 kthread_queue_delayed_work(ptp->kworker, &ptp->work, 0);
1858
1859 dev_info(ice_pf_to_dev(pf), "PTP reset successful\n");
1860 return;
1861
1862 err:
1863 dev_err(ice_pf_to_dev(pf), "PTP reset failed %d\n", err);
1864 }
1865
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 1 week
[xilinx-xlnx:xlnx_rebase_v5.10 1566/1981] fs/pstore/zone.c:39: warning: expecting prototype for struct psz_head. Prototype was for struct psz_buffer instead
by kernel test robot
tree: https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.10
head: 87ec9a2d98a7a7dfc98b57348a0ec310fd170e4b
commit: d3328cb2dd0a2fb94a09587105c37299e296d4c6 [1566/1981] scripts: kernel-doc: validate kernel-doc markup with the actual names
config: x86_64-randconfig-a011-20211214 (https://download.01.org/0day-ci/archive/20211215/202112150136.7UyCfGsC-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project b6a2ddb6c8ac29412b1361810972e15221fa021c)
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
# https://github.com/Xilinx/linux-xlnx/commit/d3328cb2dd0a2fb94a09587105c37...
git remote add xilinx-xlnx https://github.com/Xilinx/linux-xlnx
git fetch --no-tags xilinx-xlnx xlnx_rebase_v5.10
git checkout d3328cb2dd0a2fb94a09587105c37299e296d4c6
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash fs/pstore/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> fs/pstore/zone.c:39: warning: expecting prototype for struct psz_head. Prototype was for struct psz_buffer instead
vim +39 fs/pstore/zone.c
d26c3321fe18dc WeiXiong Liao 2020-03-25 24
d26c3321fe18dc WeiXiong Liao 2020-03-25 25 /**
d26c3321fe18dc WeiXiong Liao 2020-03-25 26 * struct psz_head - header of zone to flush to storage
d26c3321fe18dc WeiXiong Liao 2020-03-25 27 *
d26c3321fe18dc WeiXiong Liao 2020-03-25 28 * @sig: signature to indicate header (PSZ_SIG xor PSZONE-type value)
d26c3321fe18dc WeiXiong Liao 2020-03-25 29 * @datalen: length of data in @data
0dc068265a1c59 WeiXiong Liao 2020-03-25 30 * @start: offset into @data where the beginning of the stored bytes begin
d26c3321fe18dc WeiXiong Liao 2020-03-25 31 * @data: zone data.
d26c3321fe18dc WeiXiong Liao 2020-03-25 32 */
d26c3321fe18dc WeiXiong Liao 2020-03-25 33 struct psz_buffer {
d26c3321fe18dc WeiXiong Liao 2020-03-25 34 #define PSZ_SIG (0x43474244) /* DBGC */
d26c3321fe18dc WeiXiong Liao 2020-03-25 35 uint32_t sig;
d26c3321fe18dc WeiXiong Liao 2020-03-25 36 atomic_t datalen;
0dc068265a1c59 WeiXiong Liao 2020-03-25 37 atomic_t start;
d26c3321fe18dc WeiXiong Liao 2020-03-25 38 uint8_t data[];
d26c3321fe18dc WeiXiong Liao 2020-03-25 @39 };
d26c3321fe18dc WeiXiong Liao 2020-03-25 40
:::::: The code at line 39 was first introduced by commit
:::::: d26c3321fe18dc74517dc1f518d584aa33b0a851 pstore/zone: Introduce common layer to manage storage zones
:::::: TO: WeiXiong Liao <liaoweixiong(a)allwinnertech.com>
:::::: CC: Kees Cook <keescook(a)chromium.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 1 week
[xilinx-xlnx:xlnx_rebase_v5.10 1566/1981] drivers/usb/cdns3/ep0.c:690: warning: expecting prototype for cdns3_gadget_ep0_queue Transfer data on endpoint zero(). Prototype was for cdns3_gadget_ep0_queue() instead
by kernel test robot
tree: https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.10
head: 87ec9a2d98a7a7dfc98b57348a0ec310fd170e4b
commit: d3328cb2dd0a2fb94a09587105c37299e296d4c6 [1566/1981] scripts: kernel-doc: validate kernel-doc markup with the actual names
config: x86_64-randconfig-a016-20211214 (https://download.01.org/0day-ci/archive/20211215/202112150159.zq5SREqP-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project b6a2ddb6c8ac29412b1361810972e15221fa021c)
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
# https://github.com/Xilinx/linux-xlnx/commit/d3328cb2dd0a2fb94a09587105c37...
git remote add xilinx-xlnx https://github.com/Xilinx/linux-xlnx
git fetch --no-tags xilinx-xlnx xlnx_rebase_v5.10
git checkout d3328cb2dd0a2fb94a09587105c37299e296d4c6
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/usb/cdns3/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/usb/cdns3/ep0.c:690: warning: expecting prototype for cdns3_gadget_ep0_queue Transfer data on endpoint zero(). Prototype was for cdns3_gadget_ep0_queue() instead
>> drivers/usb/cdns3/ep0.c:781: warning: expecting prototype for cdns3_gadget_ep_set_wedge Set wedge on selected endpoint(). Prototype was for cdns3_gadget_ep_set_wedge() instead
>> drivers/usb/cdns3/ep0.c:876: warning: expecting prototype for cdns3_init_ep0 Initializes software endpoint 0 of gadget(). Prototype was for cdns3_init_ep0() instead
--
>> drivers/usb/cdns3/gadget.c:162: warning: expecting prototype for select_ep(). Prototype was for cdns3_select_ep() instead
>> drivers/usb/cdns3/gadget.c:509: warning: expecting prototype for cdns3_wa2_descmiss_copy_data copy data from internal requests to(). Prototype was for cdns3_wa2_descmiss_copy_data() instead
>> drivers/usb/cdns3/gadget.c:2029: warning: expecting prototype for cdns3_ep_config Configure hardware endpoint(). Prototype was for cdns3_ep_config() instead
>> drivers/usb/cdns3/gadget.c:2233: warning: expecting prototype for cdns3_gadget_ep_alloc_request Allocates request(). Prototype was for cdns3_gadget_ep_alloc_request() instead
>> drivers/usb/cdns3/gadget.c:2254: warning: expecting prototype for cdns3_gadget_ep_free_request Free memory occupied by request(). Prototype was for cdns3_gadget_ep_free_request() instead
>> drivers/usb/cdns3/gadget.c:2273: warning: expecting prototype for cdns3_gadget_ep_enable Enable endpoint(). Prototype was for cdns3_gadget_ep_enable() instead
>> drivers/usb/cdns3/gadget.c:2406: warning: expecting prototype for cdns3_gadget_ep_disable Disable endpoint(). Prototype was for cdns3_gadget_ep_disable() instead
>> drivers/usb/cdns3/gadget.c:2500: warning: expecting prototype for cdns3_gadget_ep_queue Transfer data on endpoint(). Prototype was for __cdns3_gadget_ep_queue() instead
>> drivers/usb/cdns3/gadget.c:2598: warning: expecting prototype for cdns3_gadget_ep_dequeue Remove request from transfer queue(). Prototype was for cdns3_gadget_ep_dequeue() instead
>> drivers/usb/cdns3/gadget.c:2662: warning: expecting prototype for __cdns3_gadget_ep_set_halt Sets stall on selected endpoint(). Prototype was for __cdns3_gadget_ep_set_halt() instead
>> drivers/usb/cdns3/gadget.c:2683: warning: expecting prototype for __cdns3_gadget_ep_clear_halt Clears stall on selected endpoint(). Prototype was for __cdns3_gadget_ep_clear_halt() instead
>> drivers/usb/cdns3/gadget.c:2730: warning: expecting prototype for clears stall on selected endpoint(). Prototype was for cdns3_gadget_ep_set_halt() instead
>> drivers/usb/cdns3/gadget.c:2775: warning: expecting prototype for cdns3_gadget_get_frame Returns number of actual ITP frame(). Prototype was for cdns3_gadget_get_frame() instead
>> drivers/usb/cdns3/gadget.c:2886: warning: expecting prototype for cdns3_gadget_udc_start Gadget start(). Prototype was for cdns3_gadget_udc_start() instead
>> drivers/usb/cdns3/gadget.c:2930: warning: expecting prototype for cdns3_gadget_udc_stop Stops gadget(). Prototype was for cdns3_gadget_udc_stop() instead
>> drivers/usb/cdns3/gadget.c:2993: warning: expecting prototype for cdns3_init_eps Initializes software endpoints of gadget(). Prototype was for cdns3_init_eps() instead
vim +690 drivers/usb/cdns3/ep0.c
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 678
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 679 /**
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 680 * cdns3_gadget_ep0_queue Transfer data on endpoint zero
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 681 * @ep: pointer to endpoint zero object
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 682 * @request: pointer to request object
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 683 * @gfp_flags: gfp flags
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 684 *
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 685 * Returns 0 on success, error code elsewhere
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 686 */
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 687 static int cdns3_gadget_ep0_queue(struct usb_ep *ep,
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 688 struct usb_request *request,
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 689 gfp_t gfp_flags)
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 @690 {
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 691 struct cdns3_endpoint *priv_ep = ep_to_cdns3_ep(ep);
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 692 struct cdns3_device *priv_dev = priv_ep->cdns3_dev;
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 693 unsigned long flags;
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 694 int ret = 0;
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 695 u8 zlp = 0;
52d3967704aea6c Pawel Laszczak 2020-10-22 696 int i;
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 697
d0b78265cac9d8b Peter Chen 2020-06-23 698 spin_lock_irqsave(&priv_dev->lock, flags);
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 699 trace_cdns3_ep0_queue(priv_dev, request);
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 700
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 701 /* cancel the request if controller receive new SETUP packet. */
d0b78265cac9d8b Peter Chen 2020-06-23 702 if (cdns3_check_new_setup(priv_dev)) {
d0b78265cac9d8b Peter Chen 2020-06-23 703 spin_unlock_irqrestore(&priv_dev->lock, flags);
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 704 return -ECONNRESET;
d0b78265cac9d8b Peter Chen 2020-06-23 705 }
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 706
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 707 /* send STATUS stage. Should be called only for SET_CONFIGURATION */
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 708 if (priv_dev->ep0_stage == CDNS3_STATUS_STAGE) {
b21cf9371c2e659 Peter Chen 2020-09-01 709 u32 val;
b21cf9371c2e659 Peter Chen 2020-09-01 710
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 711 cdns3_select_ep(priv_dev, 0x00);
52d3967704aea6c Pawel Laszczak 2020-10-22 712
52d3967704aea6c Pawel Laszczak 2020-10-22 713 /*
52d3967704aea6c Pawel Laszczak 2020-10-22 714 * Configure all non-control EPs which are not enabled by class driver
52d3967704aea6c Pawel Laszczak 2020-10-22 715 */
52d3967704aea6c Pawel Laszczak 2020-10-22 716 for (i = 0; i < CDNS3_ENDPOINTS_MAX_COUNT; i++) {
52d3967704aea6c Pawel Laszczak 2020-10-22 717 priv_ep = priv_dev->eps[i];
52d3967704aea6c Pawel Laszczak 2020-10-22 718 if (priv_ep && priv_ep->flags & EP_CLAIMED &&
52d3967704aea6c Pawel Laszczak 2020-10-22 719 !(priv_ep->flags & EP_ENABLED))
52d3967704aea6c Pawel Laszczak 2020-10-22 720 cdns3_ep_config(priv_ep, 0);
52d3967704aea6c Pawel Laszczak 2020-10-22 721 }
52d3967704aea6c Pawel Laszczak 2020-10-22 722
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 723 cdns3_set_hw_configuration(priv_dev);
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 724 cdns3_ep0_complete_setup(priv_dev, 0, 1);
b21cf9371c2e659 Peter Chen 2020-09-01 725 /* wait until configuration set */
b21cf9371c2e659 Peter Chen 2020-09-01 726 ret = readl_poll_timeout_atomic(&priv_dev->regs->usb_sts, val,
b21cf9371c2e659 Peter Chen 2020-09-01 727 val & USB_STS_CFGSTS_MASK, 1, 100);
b21cf9371c2e659 Peter Chen 2020-09-01 728 if (ret == -ETIMEDOUT)
b21cf9371c2e659 Peter Chen 2020-09-01 729 dev_warn(priv_dev->dev, "timeout for waiting configuration set\n");
b21cf9371c2e659 Peter Chen 2020-09-01 730
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 731 request->actual = 0;
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 732 priv_dev->status_completion_no_call = true;
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 733 priv_dev->pending_status_request = request;
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 734 spin_unlock_irqrestore(&priv_dev->lock, flags);
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 735
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 736 /*
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 737 * Since there is no completion interrupt for status stage,
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 738 * it needs to call ->completion in software after
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 739 * ep0_queue is back.
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 740 */
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 741 queue_work(system_freezable_wq, &priv_dev->pending_status_wq);
b21cf9371c2e659 Peter Chen 2020-09-01 742 return ret;
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 743 }
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 744
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 745 if (!list_empty(&priv_ep->pending_req_list)) {
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 746 dev_err(priv_dev->dev,
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 747 "can't handle multiple requests for ep0\n");
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 748 spin_unlock_irqrestore(&priv_dev->lock, flags);
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 749 return -EBUSY;
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 750 }
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 751
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 752 ret = usb_gadget_map_request_by_dev(priv_dev->sysdev, request,
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 753 priv_dev->ep0_data_dir);
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 754 if (ret) {
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 755 spin_unlock_irqrestore(&priv_dev->lock, flags);
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 756 dev_err(priv_dev->dev, "failed to map request\n");
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 757 return -EINVAL;
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 758 }
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 759
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 760 request->status = -EINPROGRESS;
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 761 list_add_tail(&request->list, &priv_ep->pending_req_list);
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 762
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 763 if (request->zero && request->length &&
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 764 (request->length % ep->maxpacket == 0))
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 765 zlp = 1;
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 766
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 767 cdns3_ep0_run_transfer(priv_dev, request->dma, request->length, 1, zlp);
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 768
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 769 spin_unlock_irqrestore(&priv_dev->lock, flags);
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 770
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 771 return ret;
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 772 }
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 773
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 774 /**
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 775 * cdns3_gadget_ep_set_wedge Set wedge on selected endpoint
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 776 * @ep: endpoint object
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 777 *
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 778 * Returns 0
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 779 */
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 780 int cdns3_gadget_ep_set_wedge(struct usb_ep *ep)
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 @781 {
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 782 struct cdns3_endpoint *priv_ep = ep_to_cdns3_ep(ep);
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 783 struct cdns3_device *priv_dev = priv_ep->cdns3_dev;
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 784
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 785 dev_dbg(priv_dev->dev, "Wedge for %s\n", ep->name);
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 786 cdns3_gadget_ep_set_halt(ep, 1);
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 787 priv_ep->flags |= EP_WEDGE;
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 788
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 789 return 0;
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 790 }
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 791
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 792 const struct usb_ep_ops cdns3_gadget_ep0_ops = {
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 793 .enable = cdns3_gadget_ep0_enable,
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 794 .disable = cdns3_gadget_ep0_disable,
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 795 .alloc_request = cdns3_gadget_ep_alloc_request,
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 796 .free_request = cdns3_gadget_ep_free_request,
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 797 .queue = cdns3_gadget_ep0_queue,
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 798 .dequeue = cdns3_gadget_ep_dequeue,
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 799 .set_halt = cdns3_gadget_ep0_set_halt,
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 800 .set_wedge = cdns3_gadget_ep_set_wedge,
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 801 };
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 802
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 803 /**
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 804 * cdns3_ep0_config - Configures default endpoint
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 805 * @priv_dev: extended gadget object
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 806 *
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 807 * Functions sets parameters: maximal packet size and enables interrupts
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 808 */
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 809 void cdns3_ep0_config(struct cdns3_device *priv_dev)
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 810 {
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 811 struct cdns3_usb_regs __iomem *regs;
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 812 struct cdns3_endpoint *priv_ep;
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 813 u32 max_packet_size = 64;
52d3967704aea6c Pawel Laszczak 2020-10-22 814 u32 ep_cfg;
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 815
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 816 regs = priv_dev->regs;
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 817
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 818 if (priv_dev->gadget.speed == USB_SPEED_SUPER)
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 819 max_packet_size = 512;
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 820
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 821 priv_ep = priv_dev->eps[0];
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 822
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 823 if (!list_empty(&priv_ep->pending_req_list)) {
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 824 struct usb_request *request;
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 825
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 826 request = cdns3_next_request(&priv_ep->pending_req_list);
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 827 list_del_init(&request->list);
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 828 }
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 829
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 830 priv_dev->u1_allowed = 0;
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 831 priv_dev->u2_allowed = 0;
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 832
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 833 priv_dev->gadget.ep0->maxpacket = max_packet_size;
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 834 cdns3_gadget_ep0_desc.wMaxPacketSize = cpu_to_le16(max_packet_size);
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 835
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 836 /* init ep out */
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 837 cdns3_select_ep(priv_dev, USB_DIR_OUT);
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 838
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 839 if (priv_dev->dev_ver >= DEV_VER_V3) {
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 840 cdns3_set_register_bit(&priv_dev->regs->dtrans,
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 841 BIT(0) | BIT(16));
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 842 cdns3_set_register_bit(&priv_dev->regs->tdl_from_trb,
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 843 BIT(0) | BIT(16));
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 844 }
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 845
52d3967704aea6c Pawel Laszczak 2020-10-22 846 ep_cfg = EP_CFG_ENABLE | EP_CFG_MAXPKTSIZE(max_packet_size);
52d3967704aea6c Pawel Laszczak 2020-10-22 847
52d3967704aea6c Pawel Laszczak 2020-10-22 848 if (!(priv_ep->flags & EP_CONFIGURED))
52d3967704aea6c Pawel Laszczak 2020-10-22 849 writel(ep_cfg, ®s->ep_cfg);
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 850
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 851 writel(EP_STS_EN_SETUPEN | EP_STS_EN_DESCMISEN | EP_STS_EN_TRBERREN,
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 852 ®s->ep_sts_en);
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 853
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 854 /* init ep in */
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 855 cdns3_select_ep(priv_dev, USB_DIR_IN);
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 856
52d3967704aea6c Pawel Laszczak 2020-10-22 857 if (!(priv_ep->flags & EP_CONFIGURED))
52d3967704aea6c Pawel Laszczak 2020-10-22 858 writel(ep_cfg, ®s->ep_cfg);
52d3967704aea6c Pawel Laszczak 2020-10-22 859
52d3967704aea6c Pawel Laszczak 2020-10-22 860 priv_ep->flags |= EP_CONFIGURED;
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 861
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 862 writel(EP_STS_EN_SETUPEN | EP_STS_EN_TRBERREN, ®s->ep_sts_en);
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 863
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 864 cdns3_set_register_bit(®s->usb_conf, USB_CONF_U1DS | USB_CONF_U2DS);
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 865 }
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 866
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 867 /**
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 868 * cdns3_init_ep0 Initializes software endpoint 0 of gadget
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 869 * @priv_dev: extended gadget object
9293b7db8c33b28 Lee Jones 2020-07-02 870 * @priv_ep: extended endpoint object
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 871 *
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 872 * Returns 0 on success else error code.
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 873 */
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 874 int cdns3_init_ep0(struct cdns3_device *priv_dev,
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 875 struct cdns3_endpoint *priv_ep)
7733f6c32e36ff9 Pawel Laszczak 2019-08-26 @876 {
:::::: The code at line 690 was first introduced by commit
:::::: 7733f6c32e36ff9d7adadf40001039bf219b1cbe usb: cdns3: Add Cadence USB3 DRD Driver
:::::: TO: Pawel Laszczak <pawell(a)cadence.com>
:::::: CC: Felipe Balbi <felipe.balbi(a)linux.intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 1 week
Re: [PATCH] pktgen: use min() to make code cleaner
by kernel test robot
Hi,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
[also build test WARNING on net/master horms-ipvs/master linus/master v5.16-rc5 next-20211213]
[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]
url: https://github.com/0day-ci/linux/commits/cgel-zte-gmail-com/pktgen-use-mi...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git a3c62a042237d1adeb0290dcb768e17edd6dcd25
config: x86_64-randconfig-r016-20211214 (https://download.01.org/0day-ci/archive/20211215/202112150130.jdr5Ps5z-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project b6a2ddb6c8ac29412b1361810972e15221fa021c)
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
# https://github.com/0day-ci/linux/commit/7cc9aa88278e63d75ce0af120e4b6992b...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review cgel-zte-gmail-com/pktgen-use-min-to-make-code-cleaner/20211214-194646
git checkout 7cc9aa88278e63d75ce0af120e4b6992bff00e7e
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/power/supply/ net/core/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> net/core/pktgen.c:2781:14: warning: comparison of distinct pointer types ('typeof (datalen / frags) *' (aka 'int *') and 'typeof (((1UL) << 12)) *' (aka 'unsigned long *')) [-Wcompare-distinct-pointer-types]
frag_len = min(datalen / frags, PAGE_SIZE);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:45:19: note: expanded from macro 'min'
#define min(x, y) __careful_cmp(x, y, <)
^~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:36:24: note: expanded from macro '__careful_cmp'
__builtin_choose_expr(__safe_cmp(x, y), \
^~~~~~~~~~~~~~~~
include/linux/minmax.h:26:4: note: expanded from macro '__safe_cmp'
(__typecheck(x, y) && __no_side_effects(x, y))
^~~~~~~~~~~~~~~~~
include/linux/minmax.h:20:28: note: expanded from macro '__typecheck'
(!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
>> net/core/pktgen.c:2798:9: warning: comparison of distinct pointer types ('typeof (datalen) *' (aka 'int *') and 'typeof (((1UL) << 12)) *' (aka 'unsigned long *')) [-Wcompare-distinct-pointer-types]
min(datalen, PAGE_SIZE));
^~~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:45:19: note: expanded from macro 'min'
#define min(x, y) __careful_cmp(x, y, <)
^~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:36:24: note: expanded from macro '__careful_cmp'
__builtin_choose_expr(__safe_cmp(x, y), \
^~~~~~~~~~~~~~~~
include/linux/minmax.h:26:4: note: expanded from macro '__safe_cmp'
(__typecheck(x, y) && __no_side_effects(x, y))
^~~~~~~~~~~~~~~~~
include/linux/minmax.h:20:28: note: expanded from macro '__typecheck'
(!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
2 warnings generated.
vim +2781 net/core/pktgen.c
2754
2755 static void pktgen_finalize_skb(struct pktgen_dev *pkt_dev, struct sk_buff *skb,
2756 int datalen)
2757 {
2758 struct timespec64 timestamp;
2759 struct pktgen_hdr *pgh;
2760
2761 pgh = skb_put(skb, sizeof(*pgh));
2762 datalen -= sizeof(*pgh);
2763
2764 if (pkt_dev->nfrags <= 0) {
2765 skb_put_zero(skb, datalen);
2766 } else {
2767 int frags = pkt_dev->nfrags;
2768 int i, len;
2769 int frag_len;
2770
2771
2772 if (frags > MAX_SKB_FRAGS)
2773 frags = MAX_SKB_FRAGS;
2774 len = datalen - frags * PAGE_SIZE;
2775 if (len > 0) {
2776 skb_put_zero(skb, len);
2777 datalen = frags * PAGE_SIZE;
2778 }
2779
2780 i = 0;
> 2781 frag_len = min(datalen / frags, PAGE_SIZE);
2782 while (datalen > 0) {
2783 if (unlikely(!pkt_dev->page)) {
2784 int node = numa_node_id();
2785
2786 if (pkt_dev->node >= 0 && (pkt_dev->flags & F_NODE))
2787 node = pkt_dev->node;
2788 pkt_dev->page = alloc_pages_node(node, GFP_KERNEL | __GFP_ZERO, 0);
2789 if (!pkt_dev->page)
2790 break;
2791 }
2792 get_page(pkt_dev->page);
2793 skb_frag_set_page(skb, i, pkt_dev->page);
2794 skb_frag_off_set(&skb_shinfo(skb)->frags[i], 0);
2795 /*last fragment, fill rest of data*/
2796 if (i == (frags - 1))
2797 skb_frag_size_set(&skb_shinfo(skb)->frags[i],
> 2798 min(datalen, PAGE_SIZE));
2799 else
2800 skb_frag_size_set(&skb_shinfo(skb)->frags[i], frag_len);
2801 datalen -= skb_frag_size(&skb_shinfo(skb)->frags[i]);
2802 skb->len += skb_frag_size(&skb_shinfo(skb)->frags[i]);
2803 skb->data_len += skb_frag_size(&skb_shinfo(skb)->frags[i]);
2804 i++;
2805 skb_shinfo(skb)->nr_frags = i;
2806 }
2807 }
2808
2809 /* Stamp the time, and sequence number,
2810 * convert them to network byte order
2811 */
2812 pgh->pgh_magic = htonl(PKTGEN_MAGIC);
2813 pgh->seq_num = htonl(pkt_dev->seq_num);
2814
2815 if (pkt_dev->flags & F_NO_TIMESTAMP) {
2816 pgh->tv_sec = 0;
2817 pgh->tv_usec = 0;
2818 } else {
2819 /*
2820 * pgh->tv_sec wraps in y2106 when interpreted as unsigned
2821 * as done by wireshark, or y2038 when interpreted as signed.
2822 * This is probably harmless, but if anyone wants to improve
2823 * it, we could introduce a variant that puts 64-bit nanoseconds
2824 * into the respective header bytes.
2825 * This would also be slightly faster to read.
2826 */
2827 ktime_get_real_ts64(×tamp);
2828 pgh->tv_sec = htonl(timestamp.tv_sec);
2829 pgh->tv_usec = htonl(timestamp.tv_nsec / NSEC_PER_USEC);
2830 }
2831 }
2832
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 1 week
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:2393:5: warning: no previous prototype for function 'mt7915_mcu_set_fixed_rate'
by kernel test robot
Hi Ryder,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 5472f14a37421d1bca3dddf33cabd3bd6dbefbbc
commit: 9a93364d6595358a11d07e7f4261ae263ae2a02a mt76: mt7915: rework debugfs fixed-rate knob
date: 7 weeks ago
config: arm64-randconfig-r026-20211214 (https://download.01.org/0day-ci/archive/20211215/202112150129.mnFkjamR-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project b6a2ddb6c8ac29412b1361810972e15221fa021c)
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 arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 9a93364d6595358a11d07e7f4261ae263ae2a02a
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/net/wireless/mediatek/mt76/mt7915/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:2393:5: warning: no previous prototype for function 'mt7915_mcu_set_fixed_rate' [-Wmissing-prototypes]
int mt7915_mcu_set_fixed_rate(struct mt7915_dev *dev,
^
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:2393:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int mt7915_mcu_set_fixed_rate(struct mt7915_dev *dev,
^
static
1 warning generated.
vim +/mt7915_mcu_set_fixed_rate +2393 drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
e57b7901469fc0b Ryder Lee 2020-04-25 2392
9fac3c81eebd81b Ryder Lee 2020-04-25 @2393 int mt7915_mcu_set_fixed_rate(struct mt7915_dev *dev,
9fac3c81eebd81b Ryder Lee 2020-04-25 2394 struct ieee80211_sta *sta, u32 rate)
9fac3c81eebd81b Ryder Lee 2020-04-25 2395 {
9fac3c81eebd81b Ryder Lee 2020-04-25 2396 struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv;
9fac3c81eebd81b Ryder Lee 2020-04-25 2397 struct mt7915_vif *mvif = msta->vif;
9fac3c81eebd81b Ryder Lee 2020-04-25 2398 struct sta_rec_ra_fixed *ra;
9fac3c81eebd81b Ryder Lee 2020-04-25 2399 struct sk_buff *skb;
9fac3c81eebd81b Ryder Lee 2020-04-25 2400 struct tlv *tlv;
3e68af622254bad Ryder Lee 2020-05-12 2401 int len = sizeof(struct sta_req_hdr) + sizeof(*ra);
9fac3c81eebd81b Ryder Lee 2020-04-25 2402
3e68af622254bad Ryder Lee 2020-05-12 2403 skb = mt7915_mcu_alloc_sta_req(dev, mvif, msta, len);
9fac3c81eebd81b Ryder Lee 2020-04-25 2404 if (IS_ERR(skb))
9fac3c81eebd81b Ryder Lee 2020-04-25 2405 return PTR_ERR(skb);
9fac3c81eebd81b Ryder Lee 2020-04-25 2406
9fac3c81eebd81b Ryder Lee 2020-04-25 2407 tlv = mt7915_mcu_add_tlv(skb, STA_REC_RA_UPDATE, sizeof(*ra));
9fac3c81eebd81b Ryder Lee 2020-04-25 2408 ra = (struct sta_rec_ra_fixed *)tlv;
9fac3c81eebd81b Ryder Lee 2020-04-25 2409
9fac3c81eebd81b Ryder Lee 2020-04-25 2410 if (!rate) {
9fac3c81eebd81b Ryder Lee 2020-04-25 2411 ra->field = cpu_to_le32(RATE_PARAM_AUTO);
9fac3c81eebd81b Ryder Lee 2020-04-25 2412 goto out;
9fac3c81eebd81b Ryder Lee 2020-04-25 2413 }
9fac3c81eebd81b Ryder Lee 2020-04-25 2414
4d2423326de9e98 Ryder Lee 2021-08-07 2415 ra->field = cpu_to_le32(RATE_PARAM_FIXED);
9fac3c81eebd81b Ryder Lee 2020-04-25 2416 ra->phy.type = FIELD_GET(RATE_CFG_PHY_TYPE, rate);
9fac3c81eebd81b Ryder Lee 2020-04-25 2417 ra->phy.bw = FIELD_GET(RATE_CFG_BW, rate);
9fac3c81eebd81b Ryder Lee 2020-04-25 2418 ra->phy.nss = FIELD_GET(RATE_CFG_NSS, rate);
9fac3c81eebd81b Ryder Lee 2020-04-25 2419 ra->phy.mcs = FIELD_GET(RATE_CFG_MCS, rate);
9fac3c81eebd81b Ryder Lee 2020-04-25 2420 ra->phy.stbc = FIELD_GET(RATE_CFG_STBC, rate);
9fac3c81eebd81b Ryder Lee 2020-04-25 2421
9fac3c81eebd81b Ryder Lee 2020-04-25 2422 if (ra->phy.bw)
9fac3c81eebd81b Ryder Lee 2020-04-25 2423 ra->phy.ldpc = 7;
9fac3c81eebd81b Ryder Lee 2020-04-25 2424 else
9fac3c81eebd81b Ryder Lee 2020-04-25 2425 ra->phy.ldpc = FIELD_GET(RATE_CFG_LDPC, rate) * 7;
9fac3c81eebd81b Ryder Lee 2020-04-25 2426
9fac3c81eebd81b Ryder Lee 2020-04-25 2427 /* HT/VHT - SGI: 1, LGI: 0; HE - SGI: 0, MGI: 1, LGI: 2 */
4d2423326de9e98 Ryder Lee 2021-08-07 2428 if (ra->phy.type > MT_PHY_TYPE_VHT) {
4d2423326de9e98 Ryder Lee 2021-08-07 2429 ra->phy.he_ltf = FIELD_GET(RATE_CFG_HE_LTF, rate) * 85;
4d2423326de9e98 Ryder Lee 2021-08-07 2430 ra->phy.sgi = FIELD_GET(RATE_CFG_GI, rate) * 85;
4d2423326de9e98 Ryder Lee 2021-08-07 2431 } else {
4d2423326de9e98 Ryder Lee 2021-08-07 2432 ra->phy.sgi = FIELD_GET(RATE_CFG_GI, rate) * 15;
4d2423326de9e98 Ryder Lee 2021-08-07 2433 }
9fac3c81eebd81b Ryder Lee 2020-04-25 2434
9fac3c81eebd81b Ryder Lee 2020-04-25 2435 out:
fa62d0e0080bca7 Felix Fietkau 2020-09-30 2436 return mt76_mcu_skb_send_msg(&dev->mt76, skb,
c203dd621780842 Felix Fietkau 2021-01-06 2437 MCU_EXT_CMD(STA_REC_UPDATE), true);
9fac3c81eebd81b Ryder Lee 2020-04-25 2438 }
9fac3c81eebd81b Ryder Lee 2020-04-25 2439
:::::: The code at line 2393 was first introduced by commit
:::::: 9fac3c81eebd81bbce8b050e15b03d3490841717 mt76: mt7915: set peer Tx fixed rate through debugfs
:::::: TO: Ryder Lee <ryder.lee(a)mediatek.com>
:::::: CC: Felix Fietkau <nbd(a)nbd.name>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 1 week
Re: [PATCH] drm: nouveau: lsfw: cleanup coccinelle warning
by kernel test robot
Hi Qing,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on drm/drm-next]
[also build test ERROR on v5.16-rc5 next-20211213]
[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]
url: https://github.com/0day-ci/linux/commits/Qing-Wang/drm-nouveau-lsfw-clean...
base: git://anongit.freedesktop.org/drm/drm drm-next
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20211215/202112150140.JBV3kw5P-lk...)
compiler: arceb-elf-gcc (GCC) 11.2.0
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
# https://github.com/0day-ci/linux/commit/3a85ab7f09d9dc599e9910c320115b93f...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Qing-Wang/drm-nouveau-lsfw-cleanup-coccinelle-warning/20211214-202245
git checkout 3a85ab7f09d9dc599e9910c320115b93f0274272
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c: In function 'nvkm_acr_lsfw_load_bl_inst_data_sig':
>> drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c:195:25: error: expected ')' before 'return'
195 | if (IS_ERR(lsfw)
| ~ ^
| )
196 | return PTR_ERR(lsfw);
| ~~~~~~
>> drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c:254:1: error: expected expression before '}' token
254 | }
| ^
drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c:192:13: warning: unused variable 'ret' [-Wunused-variable]
192 | int ret;
| ^~~
drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c:191:14: warning: unused variable 'bldata' [-Wunused-variable]
191 | u32 *bldata;
| ^~~~~~
drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c:190:36: warning: unused variable 'desc' [-Wunused-variable]
190 | const struct nvfw_bl_desc *desc;
| ^~~~
drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c:189:36: warning: unused variable 'hdr' [-Wunused-variable]
189 | const struct nvfw_bin_hdr *hdr;
| ^~~
drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c:188:58: warning: unused variable 'data' [-Wunused-variable]
188 | const struct firmware *bl = NULL, *inst = NULL, *data = NULL;
| ^~~~
drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c:188:44: warning: unused variable 'inst' [-Wunused-variable]
188 | const struct firmware *bl = NULL, *inst = NULL, *data = NULL;
| ^~~~
drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c:188:32: warning: unused variable 'bl' [-Wunused-variable]
188 | const struct firmware *bl = NULL, *inst = NULL, *data = NULL;
| ^~
drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c:254:1: error: control reaches end of non-void function [-Werror=return-type]
254 | }
| ^
cc1: some warnings being treated as errors
vim +195 drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c
178
179 int
180 nvkm_acr_lsfw_load_bl_inst_data_sig(struct nvkm_subdev *subdev,
181 struct nvkm_falcon *falcon,
182 enum nvkm_acr_lsf_id id,
183 const char *path, int ver,
184 const struct nvkm_acr_lsf_func *func)
185 {
186 struct nvkm_acr *acr = subdev->device->acr;
187 struct nvkm_acr_lsfw *lsfw;
188 const struct firmware *bl = NULL, *inst = NULL, *data = NULL;
189 const struct nvfw_bin_hdr *hdr;
190 const struct nvfw_bl_desc *desc;
191 u32 *bldata;
192 int ret;
193
194 lsfw = nvkm_acr_lsfw_add(func, acr, falcon, id);
> 195 if (IS_ERR(lsfw)
196 return PTR_ERR(lsfw);
197
198 ret = nvkm_firmware_load_name(subdev, path, "bl", ver, &bl);
199 if (ret)
200 goto done;
201
202 hdr = nvfw_bin_hdr(subdev, bl->data);
203 desc = nvfw_bl_desc(subdev, bl->data + hdr->header_offset);
204 bldata = (void *)(bl->data + hdr->data_offset);
205
206 ret = nvkm_firmware_load_name(subdev, path, "inst", ver, &inst);
207 if (ret)
208 goto done;
209
210 ret = nvkm_firmware_load_name(subdev, path, "data", ver, &data);
211 if (ret)
212 goto done;
213
214 ret = nvkm_firmware_load_name(subdev, path, "sig", ver, &lsfw->sig);
215 if (ret)
216 goto done;
217
218 lsfw->bootloader_size = ALIGN(desc->code_size, 256);
219 lsfw->bootloader_imem_offset = desc->start_tag << 8;
220
221 lsfw->app_start_offset = lsfw->bootloader_size;
222 lsfw->app_imem_entry = 0;
223 lsfw->app_resident_code_offset = 0;
224 lsfw->app_resident_code_size = ALIGN(inst->size, 256);
225 lsfw->app_resident_data_offset = lsfw->app_resident_code_size;
226 lsfw->app_resident_data_size = ALIGN(data->size, 256);
227 lsfw->app_size = lsfw->app_resident_code_size +
228 lsfw->app_resident_data_size;
229
230 lsfw->img.size = lsfw->bootloader_size + lsfw->app_size;
231 if (!(lsfw->img.data = kzalloc(lsfw->img.size, GFP_KERNEL))) {
232 ret = -ENOMEM;
233 goto done;
234 }
235
236 memcpy(lsfw->img.data, bldata, lsfw->bootloader_size);
237 memcpy(lsfw->img.data + lsfw->app_start_offset +
238 lsfw->app_resident_code_offset, inst->data, inst->size);
239 memcpy(lsfw->img.data + lsfw->app_start_offset +
240 lsfw->app_resident_data_offset, data->data, data->size);
241
242 lsfw->ucode_size = ALIGN(lsfw->app_resident_data_offset, 256) +
243 lsfw->bootloader_size;
244 lsfw->data_size = lsfw->app_size + lsfw->bootloader_size -
245 lsfw->ucode_size;
246
247 done:
248 if (ret)
249 nvkm_acr_lsfw_del(lsfw);
250 nvkm_firmware_put(data);
251 nvkm_firmware_put(inst);
252 nvkm_firmware_put(bl);
253 return ret;
> 254 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 1 week