All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Wesley Cheng <wcheng@codeaurora.org>,
	heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org,
	mark.rutland@arm.com, robh+dt@kernel.org, agross@kernel.org,
	bjorn.andersson@linaro.org
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-usb@vger.kernel.org
Subject: Re: [PATCH 1/3] usb: typec: Add QCOM PMIC typec detection driver
Date: Wed, 10 Jun 2020 09:25:34 +0800	[thread overview]
Message-ID: <202006100937.st7V5Pyj%lkp@intel.com> (raw)
In-Reply-To: <20200609205851.30113-2-wcheng@codeaurora.org>

[-- Attachment #1: Type: text/plain, Size: 7277 bytes --]

Hi Wesley,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on usb/usb-testing]
[also build test ERROR on robh/for-next v5.7 next-20200609]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Wesley-Cheng/Introduce-PMIC-based-USB-type-C-detection/20200610-050045
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
config: arm-allyesconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.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
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>, old ones prefixed by <<):

>> drivers/usb/typec/qcom-pmic-typec.c:86:6: warning: no previous prototype for 'qcom_pmic_typec_bh_work' [-Wmissing-prototypes]
86 | void qcom_pmic_typec_bh_work(struct work_struct *w)
|      ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/usb/typec/qcom-pmic-typec.c:116:13: warning: no previous prototype for 'qcom_pmic_typec_interrupt' [-Wmissing-prototypes]
116 | irqreturn_t qcom_pmic_typec_interrupt(int irq, void *_qcom_usb)
|             ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/usb/typec/qcom-pmic-typec.c:7:
drivers/usb/typec/qcom-pmic-typec.c: In function 'qcom_pmic_typec_typec_hw_init':
>> include/linux/build_bug.h:16:51: error: negative width in bit-field '<anonymous>'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
|                                                   ^
include/linux/regmap.h:84:36: note: in definition of macro 'regmap_update_bits'
84 |  regmap_update_bits_base(map, reg, mask, val, NULL, false, false)
|                                    ^~~~
include/linux/bits.h:25:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
25 |  (BUILD_BUG_ON_ZERO(__builtin_choose_expr(          |   ^~~~~~~~~~~~~~~~~
include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
39 |  (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
|   ^~~~~~~~~~~~~~~~~~~
>> drivers/usb/typec/qcom-pmic-typec.c:48:34: note: in expansion of macro 'GENMASK'
48 | #define TYPEC_INTR_EN_CFG_1_MASK GENMASK(0, 7)
|                                  ^~~~~~~
>> drivers/usb/typec/qcom-pmic-typec.c:132:7: note: in expansion of macro 'TYPEC_INTR_EN_CFG_1_MASK'
132 |       TYPEC_INTR_EN_CFG_1_MASK, 0);
|       ^~~~~~~~~~~~~~~~~~~~~~~~

vim +/qcom_pmic_typec_bh_work +86 drivers/usb/typec/qcom-pmic-typec.c

    31	
    32	#define TYPEC_BASE			0x1500
    33	#define TYPEC_MISC_STATUS		(TYPEC_BASE + 0xb)
    34	#define CC_ATTACHED			BIT(0)
    35	#define CC_ORIENTATION			BIT(1)
    36	#define SNK_SRC_MODE			BIT(6)
    37	#define TYPEC_MODE_CFG			(TYPEC_BASE + 0x44)
    38	#define TYPEC_DISABLE_CMD		BIT(0)
    39	#define EN_SNK_ONLY			BIT(1)
    40	#define EN_SRC_ONLY			BIT(2)
    41	#define EN_TRY_SNK			BIT(4)
    42	#define TYPEC_VCONN_CONTROL		(TYPEC_BASE + 0x46)
    43	#define VCONN_EN_SRC			BIT(0)
    44	#define VCONN_EN_VAL			BIT(1)
    45	#define TYPEC_EXIT_STATE_CFG		(TYPEC_BASE + 0x50)
    46	#define SEL_SRC_UPPER_REF		BIT(2)
    47	#define TYPEC_INTR_EN_CFG_1		(TYPEC_BASE + 0x5e)
  > 48	#define TYPEC_INTR_EN_CFG_1_MASK	GENMASK(0, 7)
    49	
    50	struct qcom_pmic_typec {
    51		struct device		*dev;
    52		struct fwnode_handle	*fwnode;
    53		struct regmap		*regmap;
    54		struct work_struct	bh_work;
    55	
    56		struct typec_capability *cap;
    57		struct typec_port	*port;
    58		struct usb_role_switch *role_sw;
    59	
    60		struct regulator_desc usb_vbus_rdesc;
    61		struct regulator_dev *usb_vbus_reg;
    62	};
    63	
    64	static int qcom_pmic_typec_vbus_enable(struct qcom_pmic_typec *qcom_usb)
    65	{
    66		int rc;
    67	
    68		rc = regmap_update_bits(qcom_usb->regmap, CMD_OTG, OTG_EN, OTG_EN);
    69		if (rc)
    70			dev_err(qcom_usb->dev, "failed to update OTG_CTL\n");
    71	
    72		return rc;
    73	}
    74	
    75	static int qcom_pmic_typec_vbus_disable(struct qcom_pmic_typec *qcom_usb)
    76	{
    77		int rc;
    78	
    79		rc = regmap_update_bits(qcom_usb->regmap, CMD_OTG, OTG_EN, 0);
    80		if (rc)
    81			dev_err(qcom_usb->dev, "failed to update OTG_CTL\n");
    82	
    83		return rc;
    84	}
    85	
  > 86	void qcom_pmic_typec_bh_work(struct work_struct *w)
    87	{
    88		struct qcom_pmic_typec *qcom_usb = container_of(w,
    89								struct qcom_pmic_typec,
    90								bh_work);
    91		enum typec_orientation orientation;
    92		enum usb_role role;
    93		unsigned int stat;
    94	
    95		regmap_read(qcom_usb->regmap, TYPEC_MISC_STATUS, &stat);
    96	
    97		if (stat & CC_ATTACHED) {
    98			orientation = ((stat & CC_ORIENTATION) >> 1) ?
    99					TYPEC_ORIENTATION_REVERSE :
   100					TYPEC_ORIENTATION_NORMAL;
   101			typec_set_orientation(qcom_usb->port, orientation);
   102	
   103			role = (stat & SNK_SRC_MODE) ? USB_ROLE_HOST : USB_ROLE_DEVICE;
   104			if (role == USB_ROLE_HOST)
   105				qcom_pmic_typec_vbus_enable(qcom_usb);
   106			else
   107				qcom_pmic_typec_vbus_disable(qcom_usb);
   108	
   109			usb_role_switch_set_role(qcom_usb->role_sw, role);
   110		} else {
   111			usb_role_switch_set_role(qcom_usb->role_sw, USB_ROLE_NONE);
   112			qcom_pmic_typec_vbus_disable(qcom_usb);
   113		}
   114	}
   115	
 > 116	irqreturn_t qcom_pmic_typec_interrupt(int irq, void *_qcom_usb)
   117	{
   118		struct qcom_pmic_typec *qcom_usb = _qcom_usb;
   119	
   120		queue_work(system_power_efficient_wq, &qcom_usb->bh_work);
   121	
   122		return IRQ_HANDLED;
   123	}
   124	
   125	static void qcom_pmic_typec_typec_hw_init(struct qcom_pmic_typec *qcom_usb)
   126	{
   127		u8 mode;
   128	
   129		regmap_update_bits(qcom_usb->regmap, TYPE_C_CFG_REG, BC12_START_ON_CC,
   130				   0);
   131		regmap_update_bits(qcom_usb->regmap, TYPEC_INTR_EN_CFG_1,
 > 132				   TYPEC_INTR_EN_CFG_1_MASK, 0);
   133	
   134		if (qcom_usb->cap->type != TYPEC_PORT_DRP)
   135			mode = (qcom_usb->cap->type == TYPEC_PORT_SNK) ?
   136						EN_SNK_ONLY : EN_SRC_ONLY;
   137		else
   138			mode = EN_TRY_SNK;
   139		regmap_update_bits(qcom_usb->regmap, TYPEC_MODE_CFG,
   140				   EN_SNK_ONLY | EN_TRY_SNK | EN_SRC_ONLY, mode);
   141	
   142		regmap_update_bits(qcom_usb->regmap, TYPEC_VCONN_CONTROL,
   143				   VCONN_EN_SRC | VCONN_EN_VAL, VCONN_EN_SRC);
   144		regmap_update_bits(qcom_usb->regmap, TYPEC_VCONN_CONTROL,
   145				   VCONN_EN_SRC | VCONN_EN_VAL, VCONN_EN_SRC);
   146		regmap_update_bits(qcom_usb->regmap, TYPEC_EXIT_STATE_CFG,
   147				   SEL_SRC_UPPER_REF, SEL_SRC_UPPER_REF);
   148		regmap_update_bits(qcom_usb->regmap, OTG_CFG, OTG_EN_SRC_CFG,
   149				   OTG_EN_SRC_CFG);
   150	}
   151	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 74956 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH 1/3] usb: typec: Add QCOM PMIC typec detection driver
Date: Wed, 10 Jun 2020 09:25:34 +0800	[thread overview]
Message-ID: <202006100937.st7V5Pyj%lkp@intel.com> (raw)
In-Reply-To: <20200609205851.30113-2-wcheng@codeaurora.org>

[-- Attachment #1: Type: text/plain, Size: 7457 bytes --]

Hi Wesley,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on usb/usb-testing]
[also build test ERROR on robh/for-next v5.7 next-20200609]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Wesley-Cheng/Introduce-PMIC-based-USB-type-C-detection/20200610-050045
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
config: arm-allyesconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.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
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>, old ones prefixed by <<):

>> drivers/usb/typec/qcom-pmic-typec.c:86:6: warning: no previous prototype for 'qcom_pmic_typec_bh_work' [-Wmissing-prototypes]
86 | void qcom_pmic_typec_bh_work(struct work_struct *w)
|      ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/usb/typec/qcom-pmic-typec.c:116:13: warning: no previous prototype for 'qcom_pmic_typec_interrupt' [-Wmissing-prototypes]
116 | irqreturn_t qcom_pmic_typec_interrupt(int irq, void *_qcom_usb)
|             ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/usb/typec/qcom-pmic-typec.c:7:
drivers/usb/typec/qcom-pmic-typec.c: In function 'qcom_pmic_typec_typec_hw_init':
>> include/linux/build_bug.h:16:51: error: negative width in bit-field '<anonymous>'
16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
|                                                   ^
include/linux/regmap.h:84:36: note: in definition of macro 'regmap_update_bits'
84 |  regmap_update_bits_base(map, reg, mask, val, NULL, false, false)
|                                    ^~~~
include/linux/bits.h:25:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
25 |  (BUILD_BUG_ON_ZERO(__builtin_choose_expr(          |   ^~~~~~~~~~~~~~~~~
include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
39 |  (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
|   ^~~~~~~~~~~~~~~~~~~
>> drivers/usb/typec/qcom-pmic-typec.c:48:34: note: in expansion of macro 'GENMASK'
48 | #define TYPEC_INTR_EN_CFG_1_MASK GENMASK(0, 7)
|                                  ^~~~~~~
>> drivers/usb/typec/qcom-pmic-typec.c:132:7: note: in expansion of macro 'TYPEC_INTR_EN_CFG_1_MASK'
132 |       TYPEC_INTR_EN_CFG_1_MASK, 0);
|       ^~~~~~~~~~~~~~~~~~~~~~~~

vim +/qcom_pmic_typec_bh_work +86 drivers/usb/typec/qcom-pmic-typec.c

    31	
    32	#define TYPEC_BASE			0x1500
    33	#define TYPEC_MISC_STATUS		(TYPEC_BASE + 0xb)
    34	#define CC_ATTACHED			BIT(0)
    35	#define CC_ORIENTATION			BIT(1)
    36	#define SNK_SRC_MODE			BIT(6)
    37	#define TYPEC_MODE_CFG			(TYPEC_BASE + 0x44)
    38	#define TYPEC_DISABLE_CMD		BIT(0)
    39	#define EN_SNK_ONLY			BIT(1)
    40	#define EN_SRC_ONLY			BIT(2)
    41	#define EN_TRY_SNK			BIT(4)
    42	#define TYPEC_VCONN_CONTROL		(TYPEC_BASE + 0x46)
    43	#define VCONN_EN_SRC			BIT(0)
    44	#define VCONN_EN_VAL			BIT(1)
    45	#define TYPEC_EXIT_STATE_CFG		(TYPEC_BASE + 0x50)
    46	#define SEL_SRC_UPPER_REF		BIT(2)
    47	#define TYPEC_INTR_EN_CFG_1		(TYPEC_BASE + 0x5e)
  > 48	#define TYPEC_INTR_EN_CFG_1_MASK	GENMASK(0, 7)
    49	
    50	struct qcom_pmic_typec {
    51		struct device		*dev;
    52		struct fwnode_handle	*fwnode;
    53		struct regmap		*regmap;
    54		struct work_struct	bh_work;
    55	
    56		struct typec_capability *cap;
    57		struct typec_port	*port;
    58		struct usb_role_switch *role_sw;
    59	
    60		struct regulator_desc usb_vbus_rdesc;
    61		struct regulator_dev *usb_vbus_reg;
    62	};
    63	
    64	static int qcom_pmic_typec_vbus_enable(struct qcom_pmic_typec *qcom_usb)
    65	{
    66		int rc;
    67	
    68		rc = regmap_update_bits(qcom_usb->regmap, CMD_OTG, OTG_EN, OTG_EN);
    69		if (rc)
    70			dev_err(qcom_usb->dev, "failed to update OTG_CTL\n");
    71	
    72		return rc;
    73	}
    74	
    75	static int qcom_pmic_typec_vbus_disable(struct qcom_pmic_typec *qcom_usb)
    76	{
    77		int rc;
    78	
    79		rc = regmap_update_bits(qcom_usb->regmap, CMD_OTG, OTG_EN, 0);
    80		if (rc)
    81			dev_err(qcom_usb->dev, "failed to update OTG_CTL\n");
    82	
    83		return rc;
    84	}
    85	
  > 86	void qcom_pmic_typec_bh_work(struct work_struct *w)
    87	{
    88		struct qcom_pmic_typec *qcom_usb = container_of(w,
    89								struct qcom_pmic_typec,
    90								bh_work);
    91		enum typec_orientation orientation;
    92		enum usb_role role;
    93		unsigned int stat;
    94	
    95		regmap_read(qcom_usb->regmap, TYPEC_MISC_STATUS, &stat);
    96	
    97		if (stat & CC_ATTACHED) {
    98			orientation = ((stat & CC_ORIENTATION) >> 1) ?
    99					TYPEC_ORIENTATION_REVERSE :
   100					TYPEC_ORIENTATION_NORMAL;
   101			typec_set_orientation(qcom_usb->port, orientation);
   102	
   103			role = (stat & SNK_SRC_MODE) ? USB_ROLE_HOST : USB_ROLE_DEVICE;
   104			if (role == USB_ROLE_HOST)
   105				qcom_pmic_typec_vbus_enable(qcom_usb);
   106			else
   107				qcom_pmic_typec_vbus_disable(qcom_usb);
   108	
   109			usb_role_switch_set_role(qcom_usb->role_sw, role);
   110		} else {
   111			usb_role_switch_set_role(qcom_usb->role_sw, USB_ROLE_NONE);
   112			qcom_pmic_typec_vbus_disable(qcom_usb);
   113		}
   114	}
   115	
 > 116	irqreturn_t qcom_pmic_typec_interrupt(int irq, void *_qcom_usb)
   117	{
   118		struct qcom_pmic_typec *qcom_usb = _qcom_usb;
   119	
   120		queue_work(system_power_efficient_wq, &qcom_usb->bh_work);
   121	
   122		return IRQ_HANDLED;
   123	}
   124	
   125	static void qcom_pmic_typec_typec_hw_init(struct qcom_pmic_typec *qcom_usb)
   126	{
   127		u8 mode;
   128	
   129		regmap_update_bits(qcom_usb->regmap, TYPE_C_CFG_REG, BC12_START_ON_CC,
   130				   0);
   131		regmap_update_bits(qcom_usb->regmap, TYPEC_INTR_EN_CFG_1,
 > 132				   TYPEC_INTR_EN_CFG_1_MASK, 0);
   133	
   134		if (qcom_usb->cap->type != TYPEC_PORT_DRP)
   135			mode = (qcom_usb->cap->type == TYPEC_PORT_SNK) ?
   136						EN_SNK_ONLY : EN_SRC_ONLY;
   137		else
   138			mode = EN_TRY_SNK;
   139		regmap_update_bits(qcom_usb->regmap, TYPEC_MODE_CFG,
   140				   EN_SNK_ONLY | EN_TRY_SNK | EN_SRC_ONLY, mode);
   141	
   142		regmap_update_bits(qcom_usb->regmap, TYPEC_VCONN_CONTROL,
   143				   VCONN_EN_SRC | VCONN_EN_VAL, VCONN_EN_SRC);
   144		regmap_update_bits(qcom_usb->regmap, TYPEC_VCONN_CONTROL,
   145				   VCONN_EN_SRC | VCONN_EN_VAL, VCONN_EN_SRC);
   146		regmap_update_bits(qcom_usb->regmap, TYPEC_EXIT_STATE_CFG,
   147				   SEL_SRC_UPPER_REF, SEL_SRC_UPPER_REF);
   148		regmap_update_bits(qcom_usb->regmap, OTG_CFG, OTG_EN_SRC_CFG,
   149				   OTG_EN_SRC_CFG);
   150	}
   151	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 74956 bytes --]

  parent reply	other threads:[~2020-06-10  2:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-09 20:58 [PATCH 0/3] Introduce PMIC based USB type C detection Wesley Cheng
2020-06-09 20:58 ` [PATCH 1/3] usb: typec: Add QCOM PMIC typec detection driver Wesley Cheng
2020-06-09 21:20   ` Randy Dunlap
2020-06-12  4:15     ` Wesley Cheng
2020-06-10  1:20   ` Jack Pham
2020-06-10 19:37     ` Bjorn Andersson
2020-06-12  4:19       ` Wesley Cheng
2020-06-10  1:25   ` kernel test robot [this message]
2020-06-10  1:25     ` kernel test robot
2020-06-10  2:27   ` Jun Li
2020-06-12  4:17     ` Wesley Cheng
2020-06-09 20:58 ` [PATCH 2/3] dt-bindings: usb: Add Qualcomm PMIC type C controller dt-binding Wesley Cheng
2020-06-09 20:58 ` [PATCH 3/3] arm64: boot: dts: qcom: pm8150b: Add node for USB type C block Wesley Cheng

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=202006100937.st7V5Pyj%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=wcheng@codeaurora.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.