[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202210060642.pYH5AqdE-lkp@intel.com>
Date: Thu, 6 Oct 2022 06:41:40 +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/net/ipa/ipa_qmi.c:97:36: warning: passing argument 5 of
'qmi_send_indication' 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: 26b534ea602238a35a78ea9d2fe9374eb4f22b42 net: ipa: Make QMI message rules const
date: 2 hours ago
config: s390-allyesconfig
compiler: s390-linux-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/26b534ea602238a35a78ea9d2fe9374eb4f22b42
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 26b534ea602238a35a78ea9d2fe9374eb4f22b42
# 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=s390 SHELL=/bin/bash drivers/net/ipa/ drivers/soc/qcom/
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/net/ipa/ipa_qmi.c: In function 'ipa_server_init_complete':
>> drivers/net/ipa/ipa_qmi.c:97:36: warning: passing argument 5 of 'qmi_send_indication' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
97 | ipa_init_complete_ind_ei, &ind);
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/net/ipa/ipa_qmi.c:11:
include/linux/soc/qcom/qmi.h:257:75: note: expected 'struct qmi_elem_info *' but argument is of type 'const struct qmi_elem_info *'
257 | int msg_id, size_t len, struct qmi_elem_info *ei,
| ~~~~~~~~~~~~~~~~~~~~~~^~
drivers/net/ipa/ipa_qmi.c: In function 'ipa_server_indication_register':
>> drivers/net/ipa/ipa_qmi.c:197:33: warning: passing argument 6 of 'qmi_send_response' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
197 | ipa_indication_register_rsp_ei, &rsp);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/soc/qcom/qmi.h:255:49: note: expected 'struct qmi_elem_info *' but argument is of type 'const struct qmi_elem_info *'
255 | struct qmi_elem_info *ei, const void *c_struct);
| ~~~~~~~~~~~~~~~~~~~~~~^~
drivers/net/ipa/ipa_qmi.c: In function 'ipa_server_driver_init_complete':
drivers/net/ipa/ipa_qmi.c:226:33: warning: passing argument 6 of 'qmi_send_response' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
226 | ipa_driver_init_complete_rsp_ei, &rsp);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/soc/qcom/qmi.h:255:49: note: expected 'struct qmi_elem_info *' but argument is of type 'const struct qmi_elem_info *'
255 | struct qmi_elem_info *ei, const void *c_struct);
| ~~~~~~~~~~~~~~~~~~~~~~^~
drivers/net/ipa/ipa_qmi.c: At top level:
>> drivers/net/ipa/ipa_qmi.c:241:35: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
241 | .ei = ipa_indication_register_req_ei,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ipa/ipa_qmi.c:248:35: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
248 | .ei = ipa_driver_init_complete_req_ei,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ipa/ipa_qmi.c:269:35: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
269 | .ei = ipa_init_modem_driver_rsp_ei,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ipa/ipa_qmi.c: In function 'ipa_client_init_driver_work':
>> drivers/net/ipa/ipa_qmi.c:431:32: warning: passing argument 6 of 'qmi_send_request' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
431 | ipa_init_modem_driver_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 +97 drivers/net/ipa/ipa_qmi.c
530f9216a9537b5 Alex Elder 2020-03-05 82
530f9216a9537b5 Alex Elder 2020-03-05 83 /* Send an INIT_COMPLETE indication message to the modem */
530f9216a9537b5 Alex Elder 2020-03-05 84 static void ipa_server_init_complete(struct ipa_qmi *ipa_qmi)
530f9216a9537b5 Alex Elder 2020-03-05 85 {
530f9216a9537b5 Alex Elder 2020-03-05 86 struct ipa *ipa = container_of(ipa_qmi, struct ipa, qmi);
530f9216a9537b5 Alex Elder 2020-03-05 87 struct qmi_handle *qmi = &ipa_qmi->server_handle;
530f9216a9537b5 Alex Elder 2020-03-05 88 struct sockaddr_qrtr *sq = &ipa_qmi->modem_sq;
530f9216a9537b5 Alex Elder 2020-03-05 89 struct ipa_init_complete_ind ind = { };
530f9216a9537b5 Alex Elder 2020-03-05 90 int ret;
530f9216a9537b5 Alex Elder 2020-03-05 91
530f9216a9537b5 Alex Elder 2020-03-05 92 ind.status.result = QMI_RESULT_SUCCESS_V01;
530f9216a9537b5 Alex Elder 2020-03-05 93 ind.status.error = QMI_ERR_NONE_V01;
530f9216a9537b5 Alex Elder 2020-03-05 94
530f9216a9537b5 Alex Elder 2020-03-05 95 ret = qmi_send_indication(qmi, sq, IPA_QMI_INIT_COMPLETE,
530f9216a9537b5 Alex Elder 2020-03-05 96 IPA_QMI_INIT_COMPLETE_IND_SZ,
530f9216a9537b5 Alex Elder 2020-03-05 @97 ipa_init_complete_ind_ei, &ind);
530f9216a9537b5 Alex Elder 2020-03-05 98 if (ret)
530f9216a9537b5 Alex Elder 2020-03-05 99 dev_err(&ipa->pdev->dev,
530f9216a9537b5 Alex Elder 2020-03-05 100 "error %d sending init complete indication\n", ret);
530f9216a9537b5 Alex Elder 2020-03-05 101 else
530f9216a9537b5 Alex Elder 2020-03-05 102 ipa_qmi->indication_sent = true;
530f9216a9537b5 Alex Elder 2020-03-05 103 }
530f9216a9537b5 Alex Elder 2020-03-05 104
530f9216a9537b5 Alex Elder 2020-03-05 105 /* If requested (and not already sent) send the INIT_COMPLETE indication */
530f9216a9537b5 Alex Elder 2020-03-05 106 static void ipa_qmi_indication(struct ipa_qmi *ipa_qmi)
530f9216a9537b5 Alex Elder 2020-03-05 107 {
530f9216a9537b5 Alex Elder 2020-03-05 108 if (!ipa_qmi->indication_requested)
530f9216a9537b5 Alex Elder 2020-03-05 109 return;
530f9216a9537b5 Alex Elder 2020-03-05 110
530f9216a9537b5 Alex Elder 2020-03-05 111 if (ipa_qmi->indication_sent)
530f9216a9537b5 Alex Elder 2020-03-05 112 return;
530f9216a9537b5 Alex Elder 2020-03-05 113
530f9216a9537b5 Alex Elder 2020-03-05 114 ipa_server_init_complete(ipa_qmi);
530f9216a9537b5 Alex Elder 2020-03-05 115 }
530f9216a9537b5 Alex Elder 2020-03-05 116
530f9216a9537b5 Alex Elder 2020-03-05 117 /* Determine whether everything is ready to start normal operation.
530f9216a9537b5 Alex Elder 2020-03-05 118 * We know everything (else) is ready when we know the IPA driver on
530f9216a9537b5 Alex Elder 2020-03-05 119 * the modem is ready, and the microcontroller is ready.
530f9216a9537b5 Alex Elder 2020-03-05 120 *
530f9216a9537b5 Alex Elder 2020-03-05 121 * When the modem boots (or reboots), the handshake sequence starts
530f9216a9537b5 Alex Elder 2020-03-05 122 * with the AP sending the modem an INIT_DRIVER request. Within
530f9216a9537b5 Alex Elder 2020-03-05 123 * that request, the uc_loaded flag will be zero (false) for an
530f9216a9537b5 Alex Elder 2020-03-05 124 * initial boot, non-zero (true) for a subsequent (SSR) boot.
530f9216a9537b5 Alex Elder 2020-03-05 125 */
530f9216a9537b5 Alex Elder 2020-03-05 126 static void ipa_qmi_ready(struct ipa_qmi *ipa_qmi)
530f9216a9537b5 Alex Elder 2020-03-05 127 {
8d017efb1eaad69 Alex Elder 2022-05-12 128 struct ipa *ipa;
530f9216a9537b5 Alex Elder 2020-03-05 129 int ret;
530f9216a9537b5 Alex Elder 2020-03-05 130
530f9216a9537b5 Alex Elder 2020-03-05 131 /* We aren't ready until the modem and microcontroller are */
530f9216a9537b5 Alex Elder 2020-03-05 132 if (!ipa_qmi->modem_ready || !ipa_qmi->uc_ready)
530f9216a9537b5 Alex Elder 2020-03-05 133 return;
530f9216a9537b5 Alex Elder 2020-03-05 134
530f9216a9537b5 Alex Elder 2020-03-05 135 /* Send the indication message if it was requested */
530f9216a9537b5 Alex Elder 2020-03-05 136 ipa_qmi_indication(ipa_qmi);
530f9216a9537b5 Alex Elder 2020-03-05 137
530f9216a9537b5 Alex Elder 2020-03-05 138 /* The initial boot requires us to send the indication. */
530f9216a9537b5 Alex Elder 2020-03-05 139 if (ipa_qmi->initial_boot) {
530f9216a9537b5 Alex Elder 2020-03-05 140 if (!ipa_qmi->indication_sent)
530f9216a9537b5 Alex Elder 2020-03-05 141 return;
530f9216a9537b5 Alex Elder 2020-03-05 142
530f9216a9537b5 Alex Elder 2020-03-05 143 /* The initial modem boot completed successfully */
530f9216a9537b5 Alex Elder 2020-03-05 144 ipa_qmi->initial_boot = false;
530f9216a9537b5 Alex Elder 2020-03-05 145 }
530f9216a9537b5 Alex Elder 2020-03-05 146
530f9216a9537b5 Alex Elder 2020-03-05 147 /* We're ready. Start up normal operation */
530f9216a9537b5 Alex Elder 2020-03-05 148 ipa = container_of(ipa_qmi, struct ipa, qmi);
530f9216a9537b5 Alex Elder 2020-03-05 149 ret = ipa_modem_start(ipa);
530f9216a9537b5 Alex Elder 2020-03-05 150 if (ret)
530f9216a9537b5 Alex Elder 2020-03-05 151 dev_err(&ipa->pdev->dev, "error %d starting modem\n", ret);
530f9216a9537b5 Alex Elder 2020-03-05 152 }
530f9216a9537b5 Alex Elder 2020-03-05 153
530f9216a9537b5 Alex Elder 2020-03-05 154 /* All QMI clients from the modem node are gone (modem shut down or crashed). */
530f9216a9537b5 Alex Elder 2020-03-05 155 static void ipa_server_bye(struct qmi_handle *qmi, unsigned int node)
530f9216a9537b5 Alex Elder 2020-03-05 156 {
530f9216a9537b5 Alex Elder 2020-03-05 157 struct ipa_qmi *ipa_qmi;
530f9216a9537b5 Alex Elder 2020-03-05 158
530f9216a9537b5 Alex Elder 2020-03-05 159 ipa_qmi = container_of(qmi, struct ipa_qmi, server_handle);
530f9216a9537b5 Alex Elder 2020-03-05 160
530f9216a9537b5 Alex Elder 2020-03-05 161 /* The modem client and server go away at the same time */
530f9216a9537b5 Alex Elder 2020-03-05 162 memset(&ipa_qmi->modem_sq, 0, sizeof(ipa_qmi->modem_sq));
530f9216a9537b5 Alex Elder 2020-03-05 163
530f9216a9537b5 Alex Elder 2020-03-05 164 /* initial_boot doesn't change when modem reboots */
530f9216a9537b5 Alex Elder 2020-03-05 165 /* uc_ready doesn't change when modem reboots */
530f9216a9537b5 Alex Elder 2020-03-05 166 ipa_qmi->modem_ready = false;
530f9216a9537b5 Alex Elder 2020-03-05 167 ipa_qmi->indication_requested = false;
530f9216a9537b5 Alex Elder 2020-03-05 168 ipa_qmi->indication_sent = false;
530f9216a9537b5 Alex Elder 2020-03-05 169 }
530f9216a9537b5 Alex Elder 2020-03-05 170
b5094a3b535b5a2 Rikard Falkeborn 2020-11-23 171 static const struct qmi_ops ipa_server_ops = {
530f9216a9537b5 Alex Elder 2020-03-05 172 .bye = ipa_server_bye,
530f9216a9537b5 Alex Elder 2020-03-05 173 };
530f9216a9537b5 Alex Elder 2020-03-05 174
530f9216a9537b5 Alex Elder 2020-03-05 175 /* Callback function to handle an INDICATION_REGISTER request message from the
530f9216a9537b5 Alex Elder 2020-03-05 176 * modem. This informs the AP that the modem is now ready to receive the
530f9216a9537b5 Alex Elder 2020-03-05 177 * INIT_COMPLETE indication message.
530f9216a9537b5 Alex Elder 2020-03-05 178 */
530f9216a9537b5 Alex Elder 2020-03-05 179 static void ipa_server_indication_register(struct qmi_handle *qmi,
530f9216a9537b5 Alex Elder 2020-03-05 180 struct sockaddr_qrtr *sq,
530f9216a9537b5 Alex Elder 2020-03-05 181 struct qmi_txn *txn,
530f9216a9537b5 Alex Elder 2020-03-05 182 const void *decoded)
530f9216a9537b5 Alex Elder 2020-03-05 183 {
530f9216a9537b5 Alex Elder 2020-03-05 184 struct ipa_indication_register_rsp rsp = { };
530f9216a9537b5 Alex Elder 2020-03-05 185 struct ipa_qmi *ipa_qmi;
530f9216a9537b5 Alex Elder 2020-03-05 186 struct ipa *ipa;
530f9216a9537b5 Alex Elder 2020-03-05 187 int ret;
530f9216a9537b5 Alex Elder 2020-03-05 188
530f9216a9537b5 Alex Elder 2020-03-05 189 ipa_qmi = container_of(qmi, struct ipa_qmi, server_handle);
530f9216a9537b5 Alex Elder 2020-03-05 190 ipa = container_of(ipa_qmi, struct ipa, qmi);
530f9216a9537b5 Alex Elder 2020-03-05 191
530f9216a9537b5 Alex Elder 2020-03-05 192 rsp.rsp.result = QMI_RESULT_SUCCESS_V01;
530f9216a9537b5 Alex Elder 2020-03-05 193 rsp.rsp.error = QMI_ERR_NONE_V01;
530f9216a9537b5 Alex Elder 2020-03-05 194
530f9216a9537b5 Alex Elder 2020-03-05 195 ret = qmi_send_response(qmi, sq, txn, IPA_QMI_INDICATION_REGISTER,
530f9216a9537b5 Alex Elder 2020-03-05 196 IPA_QMI_INDICATION_REGISTER_RSP_SZ,
530f9216a9537b5 Alex Elder 2020-03-05 @197 ipa_indication_register_rsp_ei, &rsp);
530f9216a9537b5 Alex Elder 2020-03-05 198 if (!ret) {
530f9216a9537b5 Alex Elder 2020-03-05 199 ipa_qmi->indication_requested = true;
530f9216a9537b5 Alex Elder 2020-03-05 200 ipa_qmi_ready(ipa_qmi); /* We might be ready now */
530f9216a9537b5 Alex Elder 2020-03-05 201 } else {
530f9216a9537b5 Alex Elder 2020-03-05 202 dev_err(&ipa->pdev->dev,
530f9216a9537b5 Alex Elder 2020-03-05 203 "error %d sending register indication response\n", ret);
530f9216a9537b5 Alex Elder 2020-03-05 204 }
530f9216a9537b5 Alex Elder 2020-03-05 205 }
530f9216a9537b5 Alex Elder 2020-03-05 206
530f9216a9537b5 Alex Elder 2020-03-05 207 /* Respond to a DRIVER_INIT_COMPLETE request message from the modem. */
530f9216a9537b5 Alex Elder 2020-03-05 208 static void ipa_server_driver_init_complete(struct qmi_handle *qmi,
530f9216a9537b5 Alex Elder 2020-03-05 209 struct sockaddr_qrtr *sq,
530f9216a9537b5 Alex Elder 2020-03-05 210 struct qmi_txn *txn,
530f9216a9537b5 Alex Elder 2020-03-05 211 const void *decoded)
530f9216a9537b5 Alex Elder 2020-03-05 212 {
530f9216a9537b5 Alex Elder 2020-03-05 213 struct ipa_driver_init_complete_rsp rsp = { };
530f9216a9537b5 Alex Elder 2020-03-05 214 struct ipa_qmi *ipa_qmi;
530f9216a9537b5 Alex Elder 2020-03-05 215 struct ipa *ipa;
530f9216a9537b5 Alex Elder 2020-03-05 216 int ret;
530f9216a9537b5 Alex Elder 2020-03-05 217
530f9216a9537b5 Alex Elder 2020-03-05 218 ipa_qmi = container_of(qmi, struct ipa_qmi, server_handle);
530f9216a9537b5 Alex Elder 2020-03-05 219 ipa = container_of(ipa_qmi, struct ipa, qmi);
530f9216a9537b5 Alex Elder 2020-03-05 220
530f9216a9537b5 Alex Elder 2020-03-05 221 rsp.rsp.result = QMI_RESULT_SUCCESS_V01;
530f9216a9537b5 Alex Elder 2020-03-05 222 rsp.rsp.error = QMI_ERR_NONE_V01;
530f9216a9537b5 Alex Elder 2020-03-05 223
530f9216a9537b5 Alex Elder 2020-03-05 224 ret = qmi_send_response(qmi, sq, txn, IPA_QMI_DRIVER_INIT_COMPLETE,
530f9216a9537b5 Alex Elder 2020-03-05 225 IPA_QMI_DRIVER_INIT_COMPLETE_RSP_SZ,
530f9216a9537b5 Alex Elder 2020-03-05 226 ipa_driver_init_complete_rsp_ei, &rsp);
530f9216a9537b5 Alex Elder 2020-03-05 227 if (!ret) {
530f9216a9537b5 Alex Elder 2020-03-05 228 ipa_qmi->uc_ready = true;
530f9216a9537b5 Alex Elder 2020-03-05 229 ipa_qmi_ready(ipa_qmi); /* We might be ready now */
530f9216a9537b5 Alex Elder 2020-03-05 230 } else {
530f9216a9537b5 Alex Elder 2020-03-05 231 dev_err(&ipa->pdev->dev,
530f9216a9537b5 Alex Elder 2020-03-05 232 "error %d sending init complete response\n", ret);
530f9216a9537b5 Alex Elder 2020-03-05 233 }
530f9216a9537b5 Alex Elder 2020-03-05 234 }
530f9216a9537b5 Alex Elder 2020-03-05 235
530f9216a9537b5 Alex Elder 2020-03-05 236 /* The server handles two request message types sent by the modem. */
b5094a3b535b5a2 Rikard Falkeborn 2020-11-23 237 static const struct qmi_msg_handler ipa_server_msg_handlers[] = {
530f9216a9537b5 Alex Elder 2020-03-05 238 {
530f9216a9537b5 Alex Elder 2020-03-05 239 .type = QMI_REQUEST,
530f9216a9537b5 Alex Elder 2020-03-05 240 .msg_id = IPA_QMI_INDICATION_REGISTER,
530f9216a9537b5 Alex Elder 2020-03-05 @241 .ei = ipa_indication_register_req_ei,
530f9216a9537b5 Alex Elder 2020-03-05 242 .decoded_size = IPA_QMI_INDICATION_REGISTER_REQ_SZ,
530f9216a9537b5 Alex Elder 2020-03-05 243 .fn = ipa_server_indication_register,
530f9216a9537b5 Alex Elder 2020-03-05 244 },
530f9216a9537b5 Alex Elder 2020-03-05 245 {
530f9216a9537b5 Alex Elder 2020-03-05 246 .type = QMI_REQUEST,
530f9216a9537b5 Alex Elder 2020-03-05 247 .msg_id = IPA_QMI_DRIVER_INIT_COMPLETE,
530f9216a9537b5 Alex Elder 2020-03-05 248 .ei = ipa_driver_init_complete_req_ei,
530f9216a9537b5 Alex Elder 2020-03-05 249 .decoded_size = IPA_QMI_DRIVER_INIT_COMPLETE_REQ_SZ,
530f9216a9537b5 Alex Elder 2020-03-05 250 .fn = ipa_server_driver_init_complete,
530f9216a9537b5 Alex Elder 2020-03-05 251 },
3a9ef3e11c5d33e Alex Elder 2021-03-12 252 { },
530f9216a9537b5 Alex Elder 2020-03-05 253 };
530f9216a9537b5 Alex Elder 2020-03-05 254
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (305698 bytes)
Powered by blists - more mailing lists