linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Kyle Tso <kyletso@google.com>
Cc: kbuild-all@01.org, linux@roeck-us.net,
	heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org,
	badhri@google.com, hdegoede@redhat.com,
	Adam.Thomson.Opensource@diasemi.com, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, Kyle Tso <kyletso@google.com>
Subject: Re: [PATCH v3 2/2] usb: typec: tcpm: AMS for PD2.0
Date: Sun, 22 Sep 2019 00:02:42 +0800	[thread overview]
Message-ID: <20190921160242.GC13569@xsang-OptiPlex-9020> (raw)
In-Reply-To: <20190920032437.242187-3-kyletso@google.com>

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

Hi Kyle,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[cannot apply to v5.3 next-20190919]
[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/Kyle-Tso/usb-typec-tcpm-AMS-and-Collision-Avoidance/20190920-112652
config: i386-allmodconfig (attached as .config)
compiler: gcc-7 (Debian 7.4.0-13) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 
:::::: branch date: 7 hours ago
:::::: commit date: 7 hours ago

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

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   drivers/usb/typec/tcpm/tcpm.c: In function 'tcpm_ams_start':
>> drivers/usb/typec/tcpm/tcpm.c:1144:5: warning: 'cc_req' may be used uninitialized in this function [-Wmaybe-uninitialized]
        tcpm_set_state(port, AMS_START,
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                cc_req == SINK_TX_OK ?
                ~~~~~~~~~~~~~~~~~~~~~~
                PD_T_SINK_TX : 0);
                ~~~~~~~~~~~~~~~~~

# https://github.com/0day-ci/linux/commit/59e8594ebb63b2f2f6d8ec5a9c9c914f6c476cae
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 59e8594ebb63b2f2f6d8ec5a9c9c914f6c476cae
vim +/cc_req +1144 drivers/usb/typec/tcpm/tcpm.c

0ea47e4d06fe89 Kyle Tso 2019-09-20  1095  
0ea47e4d06fe89 Kyle Tso 2019-09-20  1096  static int tcpm_ams_start(struct tcpm_port *port, enum tcpm_ams ams)
0ea47e4d06fe89 Kyle Tso 2019-09-20  1097  {
0ea47e4d06fe89 Kyle Tso 2019-09-20  1098  	int ret = 0;
0ea47e4d06fe89 Kyle Tso 2019-09-20  1099  
0ea47e4d06fe89 Kyle Tso 2019-09-20  1100  	tcpm_log(port, "AMS %s start", tcpm_ams_str[ams]);
0ea47e4d06fe89 Kyle Tso 2019-09-20  1101  
0ea47e4d06fe89 Kyle Tso 2019-09-20  1102  	if (!tcpm_ams_interruptible(port) && ams != HARD_RESET) {
0ea47e4d06fe89 Kyle Tso 2019-09-20  1103  		port->upcoming_state = INVALID_STATE;
0ea47e4d06fe89 Kyle Tso 2019-09-20  1104  		tcpm_log(port, "AMS %s not interruptible, aborting",
0ea47e4d06fe89 Kyle Tso 2019-09-20  1105  			 tcpm_ams_str[port->ams]);
0ea47e4d06fe89 Kyle Tso 2019-09-20  1106  		return -EAGAIN;
0ea47e4d06fe89 Kyle Tso 2019-09-20  1107  	}
0ea47e4d06fe89 Kyle Tso 2019-09-20  1108  
0ea47e4d06fe89 Kyle Tso 2019-09-20  1109  	if (port->pwr_role == TYPEC_SOURCE) {
0ea47e4d06fe89 Kyle Tso 2019-09-20  1110  		enum typec_cc_status cc_req;
0ea47e4d06fe89 Kyle Tso 2019-09-20  1111  
0ea47e4d06fe89 Kyle Tso 2019-09-20  1112  		port->ams = ams;
0ea47e4d06fe89 Kyle Tso 2019-09-20  1113  
0ea47e4d06fe89 Kyle Tso 2019-09-20  1114  		if (ams == HARD_RESET) {
0ea47e4d06fe89 Kyle Tso 2019-09-20  1115  			tcpm_set_cc(port, tcpm_rp_cc(port));
0ea47e4d06fe89 Kyle Tso 2019-09-20  1116  			tcpm_pd_transmit(port, TCPC_TX_HARD_RESET, NULL);
0ea47e4d06fe89 Kyle Tso 2019-09-20  1117  			tcpm_set_state(port, HARD_RESET_START, 0);
0ea47e4d06fe89 Kyle Tso 2019-09-20  1118  			return ret;
0ea47e4d06fe89 Kyle Tso 2019-09-20  1119  		} else if (ams == SOFT_RESET_AMS) {
0ea47e4d06fe89 Kyle Tso 2019-09-20  1120  			if (!port->explicit_contract) {
0ea47e4d06fe89 Kyle Tso 2019-09-20  1121  				port->upcoming_state = INVALID_STATE;
0ea47e4d06fe89 Kyle Tso 2019-09-20  1122  				tcpm_set_cc(port, tcpm_rp_cc(port));
0ea47e4d06fe89 Kyle Tso 2019-09-20  1123  				return ret;
0ea47e4d06fe89 Kyle Tso 2019-09-20  1124  			}
0ea47e4d06fe89 Kyle Tso 2019-09-20  1125  		} else if (tcpm_vdm_ams(port)) {
0ea47e4d06fe89 Kyle Tso 2019-09-20  1126  			/* tSinkTx is enforced in vdm_run_state_machine */
59e8594ebb63b2 Kyle Tso 2019-09-20  1127  			if (port->negotiated_rev >= PD_REV30)
0ea47e4d06fe89 Kyle Tso 2019-09-20  1128  				tcpm_set_cc(port, SINK_TX_NG);
0ea47e4d06fe89 Kyle Tso 2019-09-20  1129  			return ret;
0ea47e4d06fe89 Kyle Tso 2019-09-20  1130  		}
0ea47e4d06fe89 Kyle Tso 2019-09-20  1131  
59e8594ebb63b2 Kyle Tso 2019-09-20  1132  		if (port->negotiated_rev >= PD_REV30) {
0ea47e4d06fe89 Kyle Tso 2019-09-20  1133  			cc_req = port->cc_req;
0ea47e4d06fe89 Kyle Tso 2019-09-20  1134  			tcpm_set_cc(port, SINK_TX_NG);
59e8594ebb63b2 Kyle Tso 2019-09-20  1135  		}
59e8594ebb63b2 Kyle Tso 2019-09-20  1136  
59e8594ebb63b2 Kyle Tso 2019-09-20  1137  		switch (port->state) {
59e8594ebb63b2 Kyle Tso 2019-09-20  1138  		case SRC_READY:
59e8594ebb63b2 Kyle Tso 2019-09-20  1139  		case SRC_STARTUP:
59e8594ebb63b2 Kyle Tso 2019-09-20  1140  		case SRC_SOFT_RESET_WAIT_SNK_TX:
59e8594ebb63b2 Kyle Tso 2019-09-20  1141  		case SOFT_RESET:
59e8594ebb63b2 Kyle Tso 2019-09-20  1142  		case SOFT_RESET_SEND:
59e8594ebb63b2 Kyle Tso 2019-09-20  1143  			if (port->negotiated_rev >= PD_REV30)
59e8594ebb63b2 Kyle Tso 2019-09-20 @1144  				tcpm_set_state(port, AMS_START,
59e8594ebb63b2 Kyle Tso 2019-09-20  1145  					       cc_req == SINK_TX_OK ?
0ea47e4d06fe89 Kyle Tso 2019-09-20  1146  					       PD_T_SINK_TX : 0);
0ea47e4d06fe89 Kyle Tso 2019-09-20  1147  			else
59e8594ebb63b2 Kyle Tso 2019-09-20  1148  				tcpm_set_state(port, AMS_START, 0);
59e8594ebb63b2 Kyle Tso 2019-09-20  1149  			break;
59e8594ebb63b2 Kyle Tso 2019-09-20  1150  		default:
59e8594ebb63b2 Kyle Tso 2019-09-20  1151  			if (port->negotiated_rev >= PD_REV30)
59e8594ebb63b2 Kyle Tso 2019-09-20  1152  				tcpm_set_state(port, SRC_READY,
59e8594ebb63b2 Kyle Tso 2019-09-20  1153  					       cc_req == SINK_TX_OK ?
0ea47e4d06fe89 Kyle Tso 2019-09-20  1154  					       PD_T_SINK_TX : 0);
59e8594ebb63b2 Kyle Tso 2019-09-20  1155  			else
59e8594ebb63b2 Kyle Tso 2019-09-20  1156  				tcpm_set_state(port, SRC_READY, 0);
59e8594ebb63b2 Kyle Tso 2019-09-20  1157  			break;
59e8594ebb63b2 Kyle Tso 2019-09-20  1158  		}
0ea47e4d06fe89 Kyle Tso 2019-09-20  1159  	} else {
59e8594ebb63b2 Kyle Tso 2019-09-20  1160  		if (port->negotiated_rev >= PD_REV30 &&
59e8594ebb63b2 Kyle Tso 2019-09-20  1161  		    !tcpm_sink_tx_ok(port) &&
0ea47e4d06fe89 Kyle Tso 2019-09-20  1162  		    ams != SOFT_RESET_AMS &&
0ea47e4d06fe89 Kyle Tso 2019-09-20  1163  		    ams != HARD_RESET) {
0ea47e4d06fe89 Kyle Tso 2019-09-20  1164  			port->upcoming_state = INVALID_STATE;
0ea47e4d06fe89 Kyle Tso 2019-09-20  1165  			tcpm_log(port, "Sink TX No Go");
0ea47e4d06fe89 Kyle Tso 2019-09-20  1166  			return -EAGAIN;
0ea47e4d06fe89 Kyle Tso 2019-09-20  1167  		}
0ea47e4d06fe89 Kyle Tso 2019-09-20  1168  
0ea47e4d06fe89 Kyle Tso 2019-09-20  1169  		port->ams = ams;
0ea47e4d06fe89 Kyle Tso 2019-09-20  1170  
0ea47e4d06fe89 Kyle Tso 2019-09-20  1171  		if (ams == HARD_RESET) {
0ea47e4d06fe89 Kyle Tso 2019-09-20  1172  			tcpm_pd_transmit(port, TCPC_TX_HARD_RESET, NULL);
0ea47e4d06fe89 Kyle Tso 2019-09-20  1173  			tcpm_set_state(port, HARD_RESET_START, 0);
0ea47e4d06fe89 Kyle Tso 2019-09-20  1174  			return ret;
0ea47e4d06fe89 Kyle Tso 2019-09-20  1175  		} else if (tcpm_vdm_ams(port)) {
0ea47e4d06fe89 Kyle Tso 2019-09-20  1176  			return ret;
0ea47e4d06fe89 Kyle Tso 2019-09-20  1177  		}
0ea47e4d06fe89 Kyle Tso 2019-09-20  1178  
0ea47e4d06fe89 Kyle Tso 2019-09-20  1179  		if (port->state == SNK_READY ||
0ea47e4d06fe89 Kyle Tso 2019-09-20  1180  		    port->state == SNK_SOFT_RESET)
0ea47e4d06fe89 Kyle Tso 2019-09-20  1181  			tcpm_set_state(port, AMS_START, 0);
0ea47e4d06fe89 Kyle Tso 2019-09-20  1182  		else
0ea47e4d06fe89 Kyle Tso 2019-09-20  1183  			tcpm_set_state(port, SNK_READY, 0);
0ea47e4d06fe89 Kyle Tso 2019-09-20  1184  	}
0ea47e4d06fe89 Kyle Tso 2019-09-20  1185  
0ea47e4d06fe89 Kyle Tso 2019-09-20  1186  	return ret;
0ea47e4d06fe89 Kyle Tso 2019-09-20  1187  }
0ea47e4d06fe89 Kyle Tso 2019-09-20  1188  

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

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

  reply	other threads:[~2019-09-21 15:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-20  3:24 [PATCH v3 0/2] tcpm: AMS and Collision Avoidance Kyle Tso
2019-09-20  3:24 ` [PATCH v3 1/2] usb: typec: " Kyle Tso
2019-09-20  3:24 ` [PATCH v3 2/2] usb: typec: tcpm: AMS for PD2.0 Kyle Tso
2019-09-21 16:02   ` kbuild test robot [this message]
2019-09-20  8:02 ` [PATCH v3 0/2] tcpm: AMS and Collision Avoidance Hans de Goede
2019-09-20  8:19   ` Kyle Tso
2019-09-20  8:25     ` Hans de Goede
2019-09-20  8:54       ` Kyle Tso
2019-10-03  9:47 ` Hans de Goede
2019-10-03 10:04   ` Kyle Tso
2019-10-03 10:38     ` Hans de Goede
2019-10-04 13:47       ` Kyle Tso

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=20190921160242.GC13569@xsang-OptiPlex-9020 \
    --to=lkp@intel.com \
    --cc=Adam.Thomson.Opensource@diasemi.com \
    --cc=badhri@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=kbuild-all@01.org \
    --cc=kyletso@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).