[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202210061412.6vtElqi7-lkp@intel.com>
Date: Thu, 6 Oct 2022 14:14:42 +0800
From: kernel test robot <lkp@...el.com>
To: Jeff Johnson <quic_jjohnson@...cinc.com>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
0day robot <lkp@...el.com>, Alex Elder <elder@...aro.org>,
Sibi Sankar <quic_sibis@...cinc.com>
Subject: drivers/remoteproc/qcom_sysmon.c:302:23: warning: initialization
discards 'const' qualifier from pointer target type
tree: https://github.com/intel-lab-lkp/linux/commits/UPDATE-20221006-045615/Jeff-Johnson/net-ipa-Make-QMI-message-rules-const/20220915-084715
head: ae4987712d869a752d8172a1c3d48a2d0c16b47b
commit: 0566df33496b328022e7385a0065e808989cfda6 remoteproc: sysmon: Make QMI message rules const
date: 9 hours ago
config: arm-defconfig
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.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
# https://github.com/intel-lab-lkp/linux/commit/0566df33496b328022e7385a0065e808989cfda6
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review UPDATE-20221006-045615/Jeff-Johnson/net-ipa-Make-QMI-message-rules-const/20220915-084715
git checkout 0566df33496b328022e7385a0065e808989cfda6
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/remoteproc/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
>> drivers/remoteproc/qcom_sysmon.c:302:23: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
302 | .ei = ssctl_shutdown_ind_ei,
| ^~~~~~~~~~~~~~~~~~~~~
drivers/remoteproc/qcom_sysmon.c: In function 'ssctl_request_shutdown':
>> drivers/remoteproc/qcom_sysmon.c:340:48: warning: passing argument 3 of 'qmi_txn_init' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
340 | ret = qmi_txn_init(&sysmon->qmi, &txn, ssctl_shutdown_resp_ei, &resp);
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/remoteproc/qcom_common.h:7,
from drivers/remoteproc/qcom_sysmon.c:17:
include/linux/soc/qcom/qmi.h:268:40: note: expected 'struct qmi_elem_info *' but argument is of type 'const struct qmi_elem_info *'
268 | struct qmi_elem_info *ei, void *c_struct);
| ~~~~~~~~~~~~~~~~~~~~~~^~
drivers/remoteproc/qcom_sysmon.c: In function 'ssctl_send_event':
drivers/remoteproc/qcom_sysmon.c:384:48: warning: passing argument 3 of 'qmi_txn_init' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
384 | ret = qmi_txn_init(&sysmon->qmi, &txn, ssctl_subsys_event_resp_ei, &resp);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/soc/qcom/qmi.h:268:40: note: expected 'struct qmi_elem_info *' but argument is of type 'const struct qmi_elem_info *'
268 | struct qmi_elem_info *ei, void *c_struct);
| ~~~~~~~~~~~~~~~~~~~~~~^~
>> drivers/remoteproc/qcom_sysmon.c:399:32: warning: passing argument 6 of 'qmi_send_request' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
399 | ssctl_subsys_event_req_ei, &req);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/soc/qcom/qmi.h:252:48: note: expected 'struct qmi_elem_info *' but argument is of type 'const struct qmi_elem_info *'
252 | struct qmi_elem_info *ei, const void *c_struct);
| ~~~~~~~~~~~~~~~~~~~~~~^~
vim +/const +302 drivers/remoteproc/qcom_sysmon.c
74f27202655410 Sibi Sankar 2019-01-08 297
dd8f52660cb1f6 Rikard Falkeborn 2020-11-23 298 static const struct qmi_msg_handler qmi_indication_handler[] = {
74f27202655410 Sibi Sankar 2019-01-08 299 {
74f27202655410 Sibi Sankar 2019-01-08 300 .type = QMI_INDICATION,
74f27202655410 Sibi Sankar 2019-01-08 301 .msg_id = SSCTL_SHUTDOWN_READY_IND,
74f27202655410 Sibi Sankar 2019-01-08 @302 .ei = ssctl_shutdown_ind_ei,
74f27202655410 Sibi Sankar 2019-01-08 303 .decoded_size = 0,
74f27202655410 Sibi Sankar 2019-01-08 304 .fn = sysmon_ind_cb
74f27202655410 Sibi Sankar 2019-01-08 305 },
74f27202655410 Sibi Sankar 2019-01-08 306 {}
74f27202655410 Sibi Sankar 2019-01-08 307 };
74f27202655410 Sibi Sankar 2019-01-08 308
5c212aaf5457ca Bjorn Andersson 2020-11-21 309 static bool ssctl_request_shutdown_wait(struct qcom_sysmon *sysmon)
5c212aaf5457ca Bjorn Andersson 2020-11-21 310 {
5c212aaf5457ca Bjorn Andersson 2020-11-21 311 int ret;
5c212aaf5457ca Bjorn Andersson 2020-11-21 312
5c212aaf5457ca Bjorn Andersson 2020-11-21 313 ret = wait_for_completion_timeout(&sysmon->shutdown_comp, 10 * HZ);
5c212aaf5457ca Bjorn Andersson 2020-11-21 314 if (ret)
5c212aaf5457ca Bjorn Andersson 2020-11-21 315 return true;
5c212aaf5457ca Bjorn Andersson 2020-11-21 316
5c212aaf5457ca Bjorn Andersson 2020-11-21 317 ret = try_wait_for_completion(&sysmon->ind_comp);
5c212aaf5457ca Bjorn Andersson 2020-11-21 318 if (ret)
5c212aaf5457ca Bjorn Andersson 2020-11-21 319 return true;
5c212aaf5457ca Bjorn Andersson 2020-11-21 320
5c212aaf5457ca Bjorn Andersson 2020-11-21 321 dev_err(sysmon->dev, "timeout waiting for shutdown ack\n");
5c212aaf5457ca Bjorn Andersson 2020-11-21 322 return false;
5c212aaf5457ca Bjorn Andersson 2020-11-21 323 }
5c212aaf5457ca Bjorn Andersson 2020-11-21 324
1fb82ee806d170 Bjorn Andersson 2017-08-27 325 /**
1fb82ee806d170 Bjorn Andersson 2017-08-27 326 * ssctl_request_shutdown() - request shutdown via SSCTL QMI service
1fb82ee806d170 Bjorn Andersson 2017-08-27 327 * @sysmon: sysmon context
5c212aaf5457ca Bjorn Andersson 2020-11-21 328 *
5c212aaf5457ca Bjorn Andersson 2020-11-21 329 * Return: boolean indicator of the remote processor acking the request
1fb82ee806d170 Bjorn Andersson 2017-08-27 330 */
5c212aaf5457ca Bjorn Andersson 2020-11-21 331 static bool ssctl_request_shutdown(struct qcom_sysmon *sysmon)
1fb82ee806d170 Bjorn Andersson 2017-08-27 332 {
1fb82ee806d170 Bjorn Andersson 2017-08-27 333 struct ssctl_shutdown_resp resp;
1fb82ee806d170 Bjorn Andersson 2017-08-27 334 struct qmi_txn txn;
5c212aaf5457ca Bjorn Andersson 2020-11-21 335 bool acked = false;
1fb82ee806d170 Bjorn Andersson 2017-08-27 336 int ret;
1fb82ee806d170 Bjorn Andersson 2017-08-27 337
74f27202655410 Sibi Sankar 2019-01-08 338 reinit_completion(&sysmon->ind_comp);
74f27202655410 Sibi Sankar 2019-01-08 339 reinit_completion(&sysmon->shutdown_comp);
1fb82ee806d170 Bjorn Andersson 2017-08-27 @340 ret = qmi_txn_init(&sysmon->qmi, &txn, ssctl_shutdown_resp_ei, &resp);
1fb82ee806d170 Bjorn Andersson 2017-08-27 341 if (ret < 0) {
1fb82ee806d170 Bjorn Andersson 2017-08-27 342 dev_err(sysmon->dev, "failed to allocate QMI txn\n");
5c212aaf5457ca Bjorn Andersson 2020-11-21 343 return false;
1fb82ee806d170 Bjorn Andersson 2017-08-27 344 }
1fb82ee806d170 Bjorn Andersson 2017-08-27 345
1fb82ee806d170 Bjorn Andersson 2017-08-27 346 ret = qmi_send_request(&sysmon->qmi, &sysmon->ssctl, &txn,
1fb82ee806d170 Bjorn Andersson 2017-08-27 347 SSCTL_SHUTDOWN_REQ, 0, NULL, NULL);
1fb82ee806d170 Bjorn Andersson 2017-08-27 348 if (ret < 0) {
1fb82ee806d170 Bjorn Andersson 2017-08-27 349 dev_err(sysmon->dev, "failed to send shutdown request\n");
1fb82ee806d170 Bjorn Andersson 2017-08-27 350 qmi_txn_cancel(&txn);
5c212aaf5457ca Bjorn Andersson 2020-11-21 351 return false;
1fb82ee806d170 Bjorn Andersson 2017-08-27 352 }
1fb82ee806d170 Bjorn Andersson 2017-08-27 353
1fb82ee806d170 Bjorn Andersson 2017-08-27 354 ret = qmi_txn_wait(&txn, 5 * HZ);
5c212aaf5457ca Bjorn Andersson 2020-11-21 355 if (ret < 0) {
0ac72f909ffe37 Bjorn Andersson 2020-11-21 356 dev_err(sysmon->dev, "timeout waiting for shutdown response\n");
5c212aaf5457ca Bjorn Andersson 2020-11-21 357 } else if (resp.resp.result) {
0ac72f909ffe37 Bjorn Andersson 2020-11-21 358 dev_err(sysmon->dev, "shutdown request rejected\n");
5c212aaf5457ca Bjorn Andersson 2020-11-21 359 } else {
1fb82ee806d170 Bjorn Andersson 2017-08-27 360 dev_dbg(sysmon->dev, "shutdown request completed\n");
5c212aaf5457ca Bjorn Andersson 2020-11-21 361 acked = true;
74f27202655410 Sibi Sankar 2019-01-08 362 }
5c212aaf5457ca Bjorn Andersson 2020-11-21 363
5c212aaf5457ca Bjorn Andersson 2020-11-21 364 if (sysmon->shutdown_irq > 0)
5c212aaf5457ca Bjorn Andersson 2020-11-21 365 return ssctl_request_shutdown_wait(sysmon);
5c212aaf5457ca Bjorn Andersson 2020-11-21 366
5c212aaf5457ca Bjorn Andersson 2020-11-21 367 return acked;
1fb82ee806d170 Bjorn Andersson 2017-08-27 368 }
1fb82ee806d170 Bjorn Andersson 2017-08-27 369
1fb82ee806d170 Bjorn Andersson 2017-08-27 370 /**
1fb82ee806d170 Bjorn Andersson 2017-08-27 371 * ssctl_send_event() - send notification of other remote's SSR event
1fb82ee806d170 Bjorn Andersson 2017-08-27 372 * @sysmon: sysmon context
5b435ca38b2ce7 Lee Jones 2020-07-15 373 * @event: sysmon event context
1fb82ee806d170 Bjorn Andersson 2017-08-27 374 */
66a4347e9a3e6a Siddharth Gupta 2020-04-08 375 static void ssctl_send_event(struct qcom_sysmon *sysmon,
66a4347e9a3e6a Siddharth Gupta 2020-04-08 376 const struct sysmon_event *event)
1fb82ee806d170 Bjorn Andersson 2017-08-27 377 {
1fb82ee806d170 Bjorn Andersson 2017-08-27 378 struct ssctl_subsys_event_resp resp;
1fb82ee806d170 Bjorn Andersson 2017-08-27 379 struct ssctl_subsys_event_req req;
1fb82ee806d170 Bjorn Andersson 2017-08-27 380 struct qmi_txn txn;
1fb82ee806d170 Bjorn Andersson 2017-08-27 381 int ret;
1fb82ee806d170 Bjorn Andersson 2017-08-27 382
1fb82ee806d170 Bjorn Andersson 2017-08-27 383 memset(&resp, 0, sizeof(resp));
1fb82ee806d170 Bjorn Andersson 2017-08-27 384 ret = qmi_txn_init(&sysmon->qmi, &txn, ssctl_subsys_event_resp_ei, &resp);
1fb82ee806d170 Bjorn Andersson 2017-08-27 385 if (ret < 0) {
1fb82ee806d170 Bjorn Andersson 2017-08-27 386 dev_err(sysmon->dev, "failed to allocate QMI txn\n");
1fb82ee806d170 Bjorn Andersson 2017-08-27 387 return;
1fb82ee806d170 Bjorn Andersson 2017-08-27 388 }
1fb82ee806d170 Bjorn Andersson 2017-08-27 389
1fb82ee806d170 Bjorn Andersson 2017-08-27 390 memset(&req, 0, sizeof(req));
66a4347e9a3e6a Siddharth Gupta 2020-04-08 391 strlcpy(req.subsys_name, event->subsys_name, sizeof(req.subsys_name));
1fb82ee806d170 Bjorn Andersson 2017-08-27 392 req.subsys_name_len = strlen(req.subsys_name);
66a4347e9a3e6a Siddharth Gupta 2020-04-08 393 req.event = event->ssr_event;
1fb82ee806d170 Bjorn Andersson 2017-08-27 394 req.evt_driven_valid = true;
1fb82ee806d170 Bjorn Andersson 2017-08-27 395 req.evt_driven = SSCTL_SSR_EVENT_FORCED;
1fb82ee806d170 Bjorn Andersson 2017-08-27 396
1fb82ee806d170 Bjorn Andersson 2017-08-27 397 ret = qmi_send_request(&sysmon->qmi, &sysmon->ssctl, &txn,
1fb82ee806d170 Bjorn Andersson 2017-08-27 398 SSCTL_SUBSYS_EVENT_REQ, 40,
1fb82ee806d170 Bjorn Andersson 2017-08-27 @399 ssctl_subsys_event_req_ei, &req);
1fb82ee806d170 Bjorn Andersson 2017-08-27 400 if (ret < 0) {
0ac72f909ffe37 Bjorn Andersson 2020-11-21 401 dev_err(sysmon->dev, "failed to send subsystem event\n");
1fb82ee806d170 Bjorn Andersson 2017-08-27 402 qmi_txn_cancel(&txn);
1fb82ee806d170 Bjorn Andersson 2017-08-27 403 return;
1fb82ee806d170 Bjorn Andersson 2017-08-27 404 }
1fb82ee806d170 Bjorn Andersson 2017-08-27 405
1fb82ee806d170 Bjorn Andersson 2017-08-27 406 ret = qmi_txn_wait(&txn, 5 * HZ);
1fb82ee806d170 Bjorn Andersson 2017-08-27 407 if (ret < 0)
0ac72f909ffe37 Bjorn Andersson 2020-11-21 408 dev_err(sysmon->dev, "timeout waiting for subsystem event response\n");
1fb82ee806d170 Bjorn Andersson 2017-08-27 409 else if (resp.resp.result)
0ac72f909ffe37 Bjorn Andersson 2020-11-21 410 dev_err(sysmon->dev, "subsystem event rejected\n");
1fb82ee806d170 Bjorn Andersson 2017-08-27 411 else
0ac72f909ffe37 Bjorn Andersson 2020-11-21 412 dev_dbg(sysmon->dev, "subsystem event accepted\n");
1fb82ee806d170 Bjorn Andersson 2017-08-27 413 }
1fb82ee806d170 Bjorn Andersson 2017-08-27 414
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (260219 bytes)
Powered by blists - more mailing lists