Re: [PATCH v3 3/7] usb: mtu3: support ip-sleep wakeup for MT8183

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

 



Hi Chunfeng,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[cannot apply to v5.3-rc6 next-20190830]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Chunfeng-Yun/add-support-USB-for-MT8183/20190901-163637
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=ia64 

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

All warnings (new ones prefixed by >>):

   In file included from include/linux/bitops.h:5:0,
                    from include/linux/kernel.h:12,
                    from include/linux/clk.h:13,
                    from drivers//usb/mtu3/mtu3_host.c:10:
   drivers//usb/mtu3/mtu3_host.c: In function 'ssusb_wakeup_ip_sleep_set':
>> include/linux/bits.h:8:19: warning: large integer implicitly truncated to unsigned type [-Woverflow]
    #define BIT(nr)   (UL(1) << (nr))
                      ^
>> drivers//usb/mtu3/mtu3_host.c:25:19: note: in expansion of macro 'BIT'
    #define WC0_IS_EN BIT(6)
                      ^~~
>> drivers//usb/mtu3/mtu3_host.c:55:9: note: in expansion of macro 'WC0_IS_EN'
      msk = WC0_IS_EN | WC0_IS_C(0xf) | WC0_IS_P;
            ^~~~~~~~~
--
   In file included from include/linux/bitops.h:5:0,
                    from include/linux/kernel.h:12,
                    from include/linux/clk.h:13,
                    from drivers/usb/mtu3/mtu3_host.c:10:
   drivers/usb/mtu3/mtu3_host.c: In function 'ssusb_wakeup_ip_sleep_set':
>> include/linux/bits.h:8:19: warning: large integer implicitly truncated to unsigned type [-Woverflow]
    #define BIT(nr)   (UL(1) << (nr))
                      ^
   drivers/usb/mtu3/mtu3_host.c:25:19: note: in expansion of macro 'BIT'
    #define WC0_IS_EN BIT(6)
                      ^~~
   drivers/usb/mtu3/mtu3_host.c:55:9: note: in expansion of macro 'WC0_IS_EN'
      msk = WC0_IS_EN | WC0_IS_C(0xf) | WC0_IS_P;
            ^~~~~~~~~

vim +/WC0_IS_EN +55 drivers//usb/mtu3/mtu3_host.c

  > 10	#include <linux/clk.h>
    11	#include <linux/iopoll.h>
    12	#include <linux/irq.h>
    13	#include <linux/kernel.h>
    14	#include <linux/mfd/syscon.h>
    15	#include <linux/of_device.h>
    16	#include <linux/regmap.h>
    17	
    18	#include "mtu3.h"
    19	#include "mtu3_dr.h"
    20	
    21	/* mt8183 etc */
    22	#define PERI_WK_CTRL0	0x20
    23	#define WC0_IS_C(x)	(((x) & 0xf) << 28)  /* cycle debounce */
    24	#define WC0_IS_P	BIT(12)	/* polarity */
  > 25	#define WC0_IS_EN	BIT(6)
    26	
    27	/* mt8173 etc */
    28	#define PERI_WK_CTRL1	0x4
    29	#define WC1_IS_C(x)	(((x) & 0xf) << 26)  /* cycle debounce */
    30	#define WC1_IS_EN	BIT(25)
    31	#define WC1_IS_P	BIT(6)  /* polarity for ip sleep */
    32	
    33	/* mt2712 etc */
    34	#define PERI_SSUSB_SPM_CTRL	0x0
    35	#define SSC_IP_SLEEP_EN	BIT(4)
    36	#define SSC_SPM_INT_EN		BIT(1)
    37	
    38	enum ssusb_uwk_vers {
    39		SSUSB_UWK_V0 = 0,
    40		SSUSB_UWK_V1,
    41		SSUSB_UWK_V2,
    42	};
    43	
    44	/*
    45	 * ip-sleep wakeup mode:
    46	 * all clocks can be turn off, but power domain should be kept on
    47	 */
    48	static void ssusb_wakeup_ip_sleep_set(struct ssusb_mtk *ssusb, bool enable)
    49	{
    50		u32 reg, msk, val;
    51	
    52		switch (ssusb->uwk_vers) {
    53		case SSUSB_UWK_V0:
    54			reg = ssusb->uwk_reg_base + PERI_WK_CTRL0;
  > 55			msk = WC0_IS_EN | WC0_IS_C(0xf) | WC0_IS_P;
    56			val = enable ? (WC0_IS_EN | WC0_IS_C(0x8)) : 0;
    57			break;
    58		case SSUSB_UWK_V1:
    59			reg = ssusb->uwk_reg_base + PERI_WK_CTRL1;
    60			msk = WC1_IS_EN | WC1_IS_C(0xf) | WC1_IS_P;
    61			val = enable ? (WC1_IS_EN | WC1_IS_C(0x8)) : 0;
    62			break;
    63		case SSUSB_UWK_V2:
    64			reg = ssusb->uwk_reg_base + PERI_SSUSB_SPM_CTRL;
    65			msk = SSC_IP_SLEEP_EN | SSC_SPM_INT_EN;
    66			val = enable ? msk : 0;
    67			break;
    68		default:
    69			return;
    70		}
    71		regmap_update_bits(ssusb->uwk, reg, msk, val);
    72	}
    73	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux