[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c1e59ca9-d2f5-4a9c-a653-f533ff5772c1@suswa.mountain>
Date: Tue, 2 Jan 2024 17:02:33 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: oe-kbuild@...ts.linux.dev, RD Babiera <rdbabiera@...gle.com>,
heikki.krogerus@...ux.intel.com, linux@...ck-us.net,
gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org,
linux-usb@...r.kernel.org
Cc: lkp@...el.com, oe-kbuild-all@...ts.linux.dev, badhri@...gle.com,
bryan.odonoghue@...aro.org, agross@...nel.org, andersson@...nel.org,
konrad.dybcio@...aro.org
Subject: Re: [PATCH v2 12/12] usb: typec: altmodes/displayport: add SOP'
support
Hi RD,
kernel test robot noticed the following build warnings:
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/RD-Babiera/usb-typec-altmodes-add-typec_cable_ops-to-typec_altmode/20231215-071339
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
patch link: https://lore.kernel.org/r/20231214230850.379863-26-rdbabiera%40google.com
patch subject: [PATCH v2 12/12] usb: typec: altmodes/displayport: add SOP' support
config: riscv-randconfig-r081-20231216 (https://download.01.org/0day-ci/archive/20231216/202312161205.sNH5M6Pz-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
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 <lkp@...el.com>
| Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
| Closes: https://lore.kernel.org/r/202312161205.sNH5M6Pz-lkp@intel.com/
smatch warnings:
drivers/usb/typec/altmodes/displayport.c:317 dp_altmode_work() warn: inconsistent returns '&dp->lock'.
vim +317 drivers/usb/typec/altmodes/displayport.c
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 240 static void dp_altmode_work(struct work_struct *work)
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 241 {
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 242 struct dp_altmode *dp = container_of(work, struct dp_altmode, work);
4c93cad8cc78bd Kyle Tso 2021-02-05 243 int svdm_version;
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 244 u32 header;
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 245 u32 vdo;
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 246 int ret;
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 247
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 248 mutex_lock(&dp->lock);
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 249
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 250 switch (dp->state) {
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 251 case DP_STATE_ENTER:
8face9aa57c833 Heikki Krogerus 2019-12-30 252 ret = typec_altmode_enter(dp->alt, NULL);
5789051fc57bb6 Heikki Krogerus 2020-09-28 253 if (ret && ret != -EBUSY)
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 254 dev_err(&dp->alt->dev, "failed to enter mode\n");
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 255 break;
92483f2f3092f0 RD Babiera 2023-12-14 256 case DP_STATE_ENTER_PRIME:
92483f2f3092f0 RD Babiera 2023-12-14 257 ret = typec_cable_altmode_enter(dp->alt, TYPEC_PLUG_SOP_P, NULL);
92483f2f3092f0 RD Babiera 2023-12-14 258 /*
92483f2f3092f0 RD Babiera 2023-12-14 259 * If we fail to enter Alt Mode on SOP', then we should drop the
92483f2f3092f0 RD Babiera 2023-12-14 260 * plug from the driver and attempt to run the driver without
92483f2f3092f0 RD Babiera 2023-12-14 261 * it.
92483f2f3092f0 RD Babiera 2023-12-14 262 */
92483f2f3092f0 RD Babiera 2023-12-14 263 if (ret && ret != -EBUSY) {
92483f2f3092f0 RD Babiera 2023-12-14 264 dev_err(&dp->alt->dev, "plug failed to enter mode\n");
92483f2f3092f0 RD Babiera 2023-12-14 265 dp->state = DP_STATE_ENTER;
92483f2f3092f0 RD Babiera 2023-12-14 266 goto disable_prime;
92483f2f3092f0 RD Babiera 2023-12-14 267 }
92483f2f3092f0 RD Babiera 2023-12-14 268 break;
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 269 case DP_STATE_UPDATE:
4c93cad8cc78bd Kyle Tso 2021-02-05 270 svdm_version = typec_altmode_get_svdm_version(dp->alt);
4c93cad8cc78bd Kyle Tso 2021-02-05 271 if (svdm_version < 0)
4c93cad8cc78bd Kyle Tso 2021-02-05 272 break;
4c93cad8cc78bd Kyle Tso 2021-02-05 273 header = DP_HEADER(dp, svdm_version, DP_CMD_STATUS_UPDATE);
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 274 vdo = 1;
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 275 ret = typec_altmode_vdm(dp->alt, header, &vdo, 2);
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 276 if (ret)
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 277 dev_err(&dp->alt->dev,
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 278 "unable to send Status Update command (%d)\n",
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 279 ret);
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 280 break;
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 281 case DP_STATE_CONFIGURE:
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 282 ret = dp_altmode_configure_vdm(dp, dp->data.conf);
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 283 if (ret)
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 284 dev_err(&dp->alt->dev,
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 285 "unable to send Configure command (%d)\n", ret);
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 286 break;
92483f2f3092f0 RD Babiera 2023-12-14 287 case DP_STATE_CONFIGURE_PRIME:
92483f2f3092f0 RD Babiera 2023-12-14 288 ret = dp_altmode_configure_vdm_cable(dp, dp->data_prime.conf);
92483f2f3092f0 RD Babiera 2023-12-14 289 if (ret) {
92483f2f3092f0 RD Babiera 2023-12-14 290 dev_err(&dp->plug_prime->dev,
92483f2f3092f0 RD Babiera 2023-12-14 291 "unable to send Configure command (%d)\n",
92483f2f3092f0 RD Babiera 2023-12-14 292 ret);
92483f2f3092f0 RD Babiera 2023-12-14 293 dp->state = DP_STATE_CONFIGURE;
92483f2f3092f0 RD Babiera 2023-12-14 294 goto disable_prime;
92483f2f3092f0 RD Babiera 2023-12-14 295 }
92483f2f3092f0 RD Babiera 2023-12-14 296 break;
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 297 case DP_STATE_EXIT:
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 298 if (typec_altmode_exit(dp->alt))
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 299 dev_err(&dp->alt->dev, "Exit Mode Failed!\n");
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 300 break;
92483f2f3092f0 RD Babiera 2023-12-14 301 case DP_STATE_EXIT_PRIME:
92483f2f3092f0 RD Babiera 2023-12-14 302 if (typec_cable_altmode_exit(dp->plug_prime, TYPEC_PLUG_SOP_P))
92483f2f3092f0 RD Babiera 2023-12-14 303 dev_err(&dp->plug_prime->dev, "Exit Mode Failed!\n");
92483f2f3092f0 RD Babiera 2023-12-14 304 break;
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 305 default:
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 306 break;
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 307 }
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 308
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 309 dp->state = DP_STATE_IDLE;
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 310
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 311 mutex_unlock(&dp->lock);
92483f2f3092f0 RD Babiera 2023-12-14 312 return;
92483f2f3092f0 RD Babiera 2023-12-14 313
92483f2f3092f0 RD Babiera 2023-12-14 314 disable_prime:
92483f2f3092f0 RD Babiera 2023-12-14 315 typec_altmode_put_plug(dp->plug_prime);
92483f2f3092f0 RD Babiera 2023-12-14 316 dp->plug_prime = NULL;
We need a mutex_unlock(&dp->lock); somewhere here.
92483f2f3092f0 RD Babiera 2023-12-14 @317 schedule_work(&dp->work);
0e3bb7d6894d9b Heikki Krogerus 2018-06-27 318 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists