From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH] pinctrl: core: Handling pinmux and pinconf separately
Date: Wed, 10 Mar 2021 23:50:44 +0800 [thread overview]
Message-ID: <202103102354.8cGlTmU3-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 9679 bytes --]
CC: kbuild-all(a)lists.01.org
In-Reply-To: <cfbe01f791c2dd42a596cbda57e15599969b57aa.1615364211.git.michal.simek@xilinx.com>
References: <cfbe01f791c2dd42a596cbda57e15599969b57aa.1615364211.git.michal.simek@xilinx.com>
TO: Michal Simek <monstr@monstr.eu>
TO: linux-kernel(a)vger.kernel.org
TO: monstr(a)monstr.eu
TO: michal.simek(a)xilinx.com
TO: git(a)xilinx.com
TO: Linus Walleij <linus.walleij@linaro.org>
CC: linux-gpio(a)vger.kernel.org
Hi Michal,
I love your patch! Perhaps something to improve:
[auto build test WARNING on pinctrl/devel]
[also build test WARNING on linux/master linus/master v5.12-rc2 next-20210310]
[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/Michal-Simek/pinctrl-core-Handling-pinmux-and-pinconf-separately/20210310-162420
base: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel
:::::: branch date: 7 hours ago
:::::: commit date: 7 hours ago
config: x86_64-randconfig-m001-20210309 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
New smatch warnings:
drivers/pinctrl/core.c:1275 pinctrl_commit_state() error: uninitialized symbol 'ret'.
Old smatch warnings:
drivers/pinctrl/core.c:1297 pinctrl_commit_state() error: uninitialized symbol 'ret'.
vim +/ret +1275 drivers/pinctrl/core.c
036f394dd77f81 Benjamin Gaignard 2019-05-22 1233
befe5bdfbb698b Linus Walleij 2012-02-09 1234 /**
981ed1bfbc6c46 Florian Fainelli 2017-03-01 1235 * pinctrl_commit_state() - select/activate/program a pinctrl state to HW
42fed7ba44e4e8 Patrice Chotard 2013-04-11 1236 * @p: the pinctrl handle for the device that requests configuration
42fed7ba44e4e8 Patrice Chotard 2013-04-11 1237 * @state: the state handle to select/activate/program
befe5bdfbb698b Linus Walleij 2012-02-09 1238 */
981ed1bfbc6c46 Florian Fainelli 2017-03-01 1239 static int pinctrl_commit_state(struct pinctrl *p, struct pinctrl_state *state)
befe5bdfbb698b Linus Walleij 2012-02-09 1240 {
6e5e959dde0d92 Stephen Warren 2012-03-02 1241 struct pinctrl_setting *setting, *setting2;
50cf7c8ab324de Richard Genoud 2013-03-25 1242 struct pinctrl_state *old_state = p->state;
6e5e959dde0d92 Stephen Warren 2012-03-02 1243 int ret;
7ecdb16fe63e5b Stephen Warren 2012-03-02 1244
6e5e959dde0d92 Stephen Warren 2012-03-02 1245 if (p->state) {
6e5e959dde0d92 Stephen Warren 2012-03-02 1246 /*
2243a87d90b42e Fan Wu 2014-06-09 1247 * For each pinmux setting in the old state, forget SW's record
2243a87d90b42e Fan Wu 2014-06-09 1248 * of mux owner for that pingroup. Any pingroups which are
2243a87d90b42e Fan Wu 2014-06-09 1249 * still owned by the new state will be re-acquired by the call
2243a87d90b42e Fan Wu 2014-06-09 1250 * to pinmux_enable_setting() in the loop below.
6e5e959dde0d92 Stephen Warren 2012-03-02 1251 */
6e5e959dde0d92 Stephen Warren 2012-03-02 1252 list_for_each_entry(setting, &p->state->settings, node) {
1e2082b5207217 Stephen Warren 2012-03-02 1253 if (setting->type != PIN_MAP_TYPE_MUX_GROUP)
1e2082b5207217 Stephen Warren 2012-03-02 1254 continue;
7ecdb16fe63e5b Stephen Warren 2012-03-02 1255 pinmux_disable_setting(setting);
befe5bdfbb698b Linus Walleij 2012-02-09 1256 }
57b676f9c1b7cd Stephen Warren 2012-03-02 1257 }
57b676f9c1b7cd Stephen Warren 2012-03-02 1258
3102a76cfbf9ac Richard Genoud 2013-03-25 1259 p->state = NULL;
6e5e959dde0d92 Stephen Warren 2012-03-02 1260
501d24ec47c0e4 Michal Simek 2021-03-10 1261 /* Apply all the settings for the new state - pinmux first */
6e5e959dde0d92 Stephen Warren 2012-03-02 1262 list_for_each_entry(setting, &state->settings, node) {
1e2082b5207217 Stephen Warren 2012-03-02 1263 switch (setting->type) {
1e2082b5207217 Stephen Warren 2012-03-02 1264 case PIN_MAP_TYPE_MUX_GROUP:
6e5e959dde0d92 Stephen Warren 2012-03-02 1265 ret = pinmux_enable_setting(setting);
1e2082b5207217 Stephen Warren 2012-03-02 1266 break;
1e2082b5207217 Stephen Warren 2012-03-02 1267 case PIN_MAP_TYPE_CONFIGS_PIN:
501d24ec47c0e4 Michal Simek 2021-03-10 1268 case PIN_MAP_TYPE_CONFIGS_GROUP:
501d24ec47c0e4 Michal Simek 2021-03-10 1269 break;
501d24ec47c0e4 Michal Simek 2021-03-10 1270 default:
501d24ec47c0e4 Michal Simek 2021-03-10 1271 ret = -EINVAL;
501d24ec47c0e4 Michal Simek 2021-03-10 1272 break;
501d24ec47c0e4 Michal Simek 2021-03-10 1273 }
501d24ec47c0e4 Michal Simek 2021-03-10 1274
501d24ec47c0e4 Michal Simek 2021-03-10 @1275 if (ret < 0)
501d24ec47c0e4 Michal Simek 2021-03-10 1276 goto unapply_new_state;
501d24ec47c0e4 Michal Simek 2021-03-10 1277
501d24ec47c0e4 Michal Simek 2021-03-10 1278 /* Do not link hogs (circular dependency) */
501d24ec47c0e4 Michal Simek 2021-03-10 1279 if (p != setting->pctldev->p)
501d24ec47c0e4 Michal Simek 2021-03-10 1280 pinctrl_link_add(setting->pctldev, p->dev);
501d24ec47c0e4 Michal Simek 2021-03-10 1281 }
501d24ec47c0e4 Michal Simek 2021-03-10 1282
501d24ec47c0e4 Michal Simek 2021-03-10 1283 /* Apply all the settings for the new state - pinconf after */
501d24ec47c0e4 Michal Simek 2021-03-10 1284 list_for_each_entry(setting, &state->settings, node) {
501d24ec47c0e4 Michal Simek 2021-03-10 1285 switch (setting->type) {
501d24ec47c0e4 Michal Simek 2021-03-10 1286 case PIN_MAP_TYPE_MUX_GROUP:
501d24ec47c0e4 Michal Simek 2021-03-10 1287 break;
501d24ec47c0e4 Michal Simek 2021-03-10 1288 case PIN_MAP_TYPE_CONFIGS_PIN:
1e2082b5207217 Stephen Warren 2012-03-02 1289 case PIN_MAP_TYPE_CONFIGS_GROUP:
1e2082b5207217 Stephen Warren 2012-03-02 1290 ret = pinconf_apply_setting(setting);
1e2082b5207217 Stephen Warren 2012-03-02 1291 break;
1e2082b5207217 Stephen Warren 2012-03-02 1292 default:
1e2082b5207217 Stephen Warren 2012-03-02 1293 ret = -EINVAL;
1e2082b5207217 Stephen Warren 2012-03-02 1294 break;
1e2082b5207217 Stephen Warren 2012-03-02 1295 }
3102a76cfbf9ac Richard Genoud 2013-03-25 1296
42fed7ba44e4e8 Patrice Chotard 2013-04-11 1297 if (ret < 0) {
3102a76cfbf9ac Richard Genoud 2013-03-25 1298 goto unapply_new_state;
6e5e959dde0d92 Stephen Warren 2012-03-02 1299 }
036f394dd77f81 Benjamin Gaignard 2019-05-22 1300
b672a87ae5ab07 Linus Walleij 2019-05-24 1301 /* Do not link hogs (circular dependency) */
b672a87ae5ab07 Linus Walleij 2019-05-24 1302 if (p != setting->pctldev->p)
036f394dd77f81 Benjamin Gaignard 2019-05-22 1303 pinctrl_link_add(setting->pctldev, p->dev);
42fed7ba44e4e8 Patrice Chotard 2013-04-11 1304 }
6e5e959dde0d92 Stephen Warren 2012-03-02 1305
3102a76cfbf9ac Richard Genoud 2013-03-25 1306 p->state = state;
3102a76cfbf9ac Richard Genoud 2013-03-25 1307
6e5e959dde0d92 Stephen Warren 2012-03-02 1308 return 0;
3102a76cfbf9ac Richard Genoud 2013-03-25 1309
3102a76cfbf9ac Richard Genoud 2013-03-25 1310 unapply_new_state:
da58751ca2490d Richard Genoud 2013-03-28 1311 dev_err(p->dev, "Error applying setting, reverse things back\n");
3102a76cfbf9ac Richard Genoud 2013-03-25 1312
3102a76cfbf9ac Richard Genoud 2013-03-25 1313 list_for_each_entry(setting2, &state->settings, node) {
3102a76cfbf9ac Richard Genoud 2013-03-25 1314 if (&setting2->node == &setting->node)
3102a76cfbf9ac Richard Genoud 2013-03-25 1315 break;
af606177713163 Richard Genoud 2013-03-29 1316 /*
af606177713163 Richard Genoud 2013-03-29 1317 * All we can do here is pinmux_disable_setting.
af606177713163 Richard Genoud 2013-03-29 1318 * That means that some pins are muxed differently now
af606177713163 Richard Genoud 2013-03-29 1319 * than they were before applying the setting (We can't
af606177713163 Richard Genoud 2013-03-29 1320 * "unmux a pin"!), but it's not a big deal since the pins
af606177713163 Richard Genoud 2013-03-29 1321 * are free to be muxed by another apply_setting.
af606177713163 Richard Genoud 2013-03-29 1322 */
af606177713163 Richard Genoud 2013-03-29 1323 if (setting2->type == PIN_MAP_TYPE_MUX_GROUP)
af606177713163 Richard Genoud 2013-03-29 1324 pinmux_disable_setting(setting2);
3102a76cfbf9ac Richard Genoud 2013-03-25 1325 }
8009d5ff00df6a Richard Genoud 2013-03-28 1326
385d94246b05f7 Richard Genoud 2013-03-29 1327 /* There's no infinite recursive loop here because p->state is NULL */
385d94246b05f7 Richard Genoud 2013-03-29 1328 if (old_state)
42fed7ba44e4e8 Patrice Chotard 2013-04-11 1329 pinctrl_select_state(p, old_state);
6e5e959dde0d92 Stephen Warren 2012-03-02 1330
6e5e959dde0d92 Stephen Warren 2012-03-02 1331 return ret;
befe5bdfbb698b Linus Walleij 2012-02-09 1332 }
981ed1bfbc6c46 Florian Fainelli 2017-03-01 1333
---
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: 41414 bytes --]
next reply other threads:[~2021-03-10 15:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-10 15:50 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-03-10 8:16 [PATCH] pinctrl: core: Handling pinmux and pinconf separately Michal Simek
2021-03-11 0:01 ` Linus Walleij
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=202103102354.8cGlTmU3-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.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.