* [ulfh-mmc:next 37/61] drivers/mmc/core/sd_uhs2.c:251:31: sparse: sparse: incorrect type in argument 1 (different base types)
@ 2024-10-26 10:21 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-10-26 10:21 UTC (permalink / raw)
To: Victor Shih; +Cc: oe-kbuild-all, Ulf Hansson, Jason Lai
tree: https://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc.git next
head: 3c0946b6a378fb92658aabcda5c70ea3e83143bf
commit: 9a9f7e13952b2638bc57bc9b34e6bdd106509836 [37/61] mmc: core: Support UHS-II card control and access
config: arc-randconfig-r122-20241026 (https://download.01.org/0day-ci/archive/20241026/202410261827.7h8YK8u2-lkp@intel.com/config)
compiler: arc-elf-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20241026/202410261827.7h8YK8u2-lkp@intel.com/reproduce)
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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410261827.7h8YK8u2-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
drivers/mmc/core/sd_uhs2.c:183:37: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be32 @@ got unsigned long @@
drivers/mmc/core/sd_uhs2.c:183:37: sparse: expected restricted __be32
drivers/mmc/core/sd_uhs2.c:183:37: sparse: got unsigned long
drivers/mmc/core/sd_uhs2.c:250:29: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be32 @@ got int @@
drivers/mmc/core/sd_uhs2.c:250:29: sparse: expected restricted __be32
drivers/mmc/core/sd_uhs2.c:250:29: sparse: got int
>> drivers/mmc/core/sd_uhs2.c:251:31: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] val @@ got restricted __be32 @@
drivers/mmc/core/sd_uhs2.c:251:31: sparse: expected unsigned int [usertype] val
drivers/mmc/core/sd_uhs2.c:251:31: sparse: got restricted __be32
drivers/mmc/core/sd_uhs2.c:251:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:251:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:251:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:251:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:494:29: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be32 @@ got int @@
drivers/mmc/core/sd_uhs2.c:494:29: sparse: expected restricted __be32
drivers/mmc/core/sd_uhs2.c:494:29: sparse: got int
drivers/mmc/core/sd_uhs2.c:496:31: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] val @@ got restricted __be32 @@
drivers/mmc/core/sd_uhs2.c:496:31: sparse: expected unsigned int [usertype] val
drivers/mmc/core/sd_uhs2.c:496:31: sparse: got restricted __be32
drivers/mmc/core/sd_uhs2.c:496:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:496:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:496:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:496:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:497:31: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] val @@ got restricted __be32 @@
drivers/mmc/core/sd_uhs2.c:497:31: sparse: expected unsigned int [usertype] val
drivers/mmc/core/sd_uhs2.c:497:31: sparse: got restricted __be32
drivers/mmc/core/sd_uhs2.c:497:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:497:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:497:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:497:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:552:29: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be32 @@ got int @@
drivers/mmc/core/sd_uhs2.c:552:29: sparse: expected restricted __be32
drivers/mmc/core/sd_uhs2.c:552:29: sparse: got int
drivers/mmc/core/sd_uhs2.c:565:29: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be32 @@ got int @@
drivers/mmc/core/sd_uhs2.c:565:29: sparse: expected restricted __be32
drivers/mmc/core/sd_uhs2.c:565:29: sparse: got int
drivers/mmc/core/sd_uhs2.c:567:31: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] val @@ got restricted __be32 @@
drivers/mmc/core/sd_uhs2.c:567:31: sparse: expected unsigned int [usertype] val
drivers/mmc/core/sd_uhs2.c:567:31: sparse: got restricted __be32
drivers/mmc/core/sd_uhs2.c:567:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:567:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:567:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:567:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:568:31: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] val @@ got restricted __be32 @@
drivers/mmc/core/sd_uhs2.c:568:31: sparse: expected unsigned int [usertype] val
drivers/mmc/core/sd_uhs2.c:568:31: sparse: got restricted __be32
drivers/mmc/core/sd_uhs2.c:568:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:568:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:568:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:568:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:615:29: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be32 @@ got unsigned int @@
drivers/mmc/core/sd_uhs2.c:615:29: sparse: expected restricted __be32
drivers/mmc/core/sd_uhs2.c:615:29: sparse: got unsigned int
drivers/mmc/core/sd_uhs2.c:619:29: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be32 @@ got unsigned char [usertype] n_data_gap_set @@
drivers/mmc/core/sd_uhs2.c:619:29: sparse: expected restricted __be32
drivers/mmc/core/sd_uhs2.c:619:29: sparse: got unsigned char [usertype] n_data_gap_set
drivers/mmc/core/sd_uhs2.c:620:31: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] val @@ got restricted __be32 @@
drivers/mmc/core/sd_uhs2.c:620:31: sparse: expected unsigned int [usertype] val
drivers/mmc/core/sd_uhs2.c:620:31: sparse: got restricted __be32
drivers/mmc/core/sd_uhs2.c:620:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:620:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:620:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:620:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:621:31: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] val @@ got restricted __be32 @@
drivers/mmc/core/sd_uhs2.c:621:31: sparse: expected unsigned int [usertype] val
drivers/mmc/core/sd_uhs2.c:621:31: sparse: got restricted __be32
drivers/mmc/core/sd_uhs2.c:621:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:621:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:621:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:621:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:649:29: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be32 @@ got unsigned long @@
drivers/mmc/core/sd_uhs2.c:649:29: sparse: expected restricted __be32
drivers/mmc/core/sd_uhs2.c:649:29: sparse: got unsigned long
drivers/mmc/core/sd_uhs2.c:650:31: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] val @@ got restricted __be32 @@
drivers/mmc/core/sd_uhs2.c:650:31: sparse: expected unsigned int [usertype] val
drivers/mmc/core/sd_uhs2.c:650:31: sparse: got restricted __be32
drivers/mmc/core/sd_uhs2.c:650:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:650:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:650:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:650:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:651:31: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] val @@ got restricted __be32 @@
drivers/mmc/core/sd_uhs2.c:651:31: sparse: expected unsigned int [usertype] val
drivers/mmc/core/sd_uhs2.c:651:31: sparse: got restricted __be32
drivers/mmc/core/sd_uhs2.c:651:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:651:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:651:31: sparse: sparse: cast from restricted __be32
drivers/mmc/core/sd_uhs2.c:651:31: sparse: sparse: cast from restricted __be32
vim +251 drivers/mmc/core/sd_uhs2.c
136
137 /*
138 * Do the early initialization of the card, by sending the device init broadcast
139 * command and wait for the process to be completed.
140 */
141 static int sd_uhs2_dev_init(struct mmc_host *host)
142 {
143 struct mmc_command cmd = {0};
144 struct uhs2_command uhs2_cmd = {};
145 u32 cnt;
146 u32 dap, gap, resp_gap;
147 u8 gd = 0;
148 int err;
149
150 dap = host->uhs2_caps.dap;
151 gap = host->uhs2_caps.gap;
152
153 /*
154 * Refer to UHS-II Addendum Version 1.02 Figure 6-21 to see DEVICE_INIT CCMD format.
155 * Head:
156 * - Control Write(R/W=1) with 4-Byte payload(PLEN=01b).
157 * - IOADR = CMD_BASE + 002h
158 * Payload:
159 * - bit [3:0] : GAP(Group Allocated Power)
160 * - bit [7:4] : GD(Group Descriptor)
161 * - bit [11] : Complete Flag
162 * - bit [15:12]: DAP(Device Allocated Power)
163 */
164 uhs2_cmd.header = UHS2_NATIVE_PACKET | UHS2_PACKET_TYPE_CCMD;
165 uhs2_cmd.arg = ((UHS2_DEV_CMD_DEVICE_INIT & 0xFF) << 8) |
166 UHS2_NATIVE_CMD_WRITE |
167 UHS2_NATIVE_CMD_PLEN_4B |
168 (UHS2_DEV_CMD_DEVICE_INIT >> 8);
169
170 /*
171 * Refer to UHS-II Addendum Version 1.02 section 6.3.1.
172 * Max. time from DEVICE_INIT CCMD EOP reception on Device
173 * Rx to its SOP transmission on Device Tx(Tfwd_init_cmd) is
174 * 1 second.
175 */
176 cmd.busy_timeout = 1000;
177
178 /*
179 * Refer to UHS-II Addendum Version 1.02 section 6.2.6.3.
180 * Let's retry the DEVICE_INIT command no more than 30 times.
181 */
182 for (cnt = 0; cnt < 30; cnt++) {
> 183 uhs2_cmd.payload[0] = ((dap & 0xF) << 12) |
184 UHS2_DEV_INIT_COMPLETE_FLAG |
185 ((gd & 0xF) << 4) |
186 (gap & 0xF);
187
188 sd_uhs2_cmd_assemble(&cmd, &uhs2_cmd, UHS2_DEV_INIT_PAYLOAD_LEN,
189 UHS2_DEV_INIT_RESP_LEN);
190
191 err = mmc_wait_for_cmd(host, &cmd, 0);
192
193 if (err) {
194 pr_err("%s: %s: UHS2 CMD send fail, err= 0x%x!\n",
195 mmc_hostname(host), __func__, err);
196 continue;
197 }
198
199 if (uhs2_cmd.uhs2_resp[3] != (UHS2_DEV_CMD_DEVICE_INIT & 0xFF)) {
200 pr_err("%s: DEVICE_INIT response is wrong!\n",
201 mmc_hostname(host));
202 return -EIO;
203 }
204
205 if (uhs2_cmd.uhs2_resp[5] & 0x8) {
206 host->uhs2_caps.group_desc = gd;
207 return 0;
208 }
209 resp_gap = uhs2_cmd.uhs2_resp[4] & 0x0F;
210 if (gap == resp_gap)
211 gd++;
212 }
213
214 if (err) {
215 pr_err("%s: %s: UHS2 CMD send fail, err= 0x%x!\n",
216 mmc_hostname(host), __func__, err);
217 return err;
218 }
219
220 return 0;
221 }
222
223 /*
224 * Run the enumeration process by sending the enumerate command to the card.
225 * Note that, we currently support only the point to point connection, which
226 * means only one card can be attached per host/slot.
227 */
228 static int sd_uhs2_enum(struct mmc_host *host, u32 *node_id)
229 {
230 struct mmc_command cmd = {0};
231 struct uhs2_command uhs2_cmd = {};
232 u8 id_f = 0xF, id_l = 0x0;
233 int err;
234
235 /*
236 * Refer to UHS-II Addendum Version 1.02 Figure 6-28 to see ENUMERATE CCMD format.
237 * Header:
238 * - Control Write(R/W=1) with 4-Byte payload(PLEN=01b).
239 * - IOADR = CMD_BASE + 003h
240 * Payload:
241 * - bit [3:0]: ID_L(Last Node ID)
242 * - bit [7:4]: ID_F(First Node ID)
243 */
244 uhs2_cmd.header = UHS2_NATIVE_PACKET | UHS2_PACKET_TYPE_CCMD;
245 uhs2_cmd.arg = ((UHS2_DEV_CMD_ENUMERATE & 0xFF) << 8) |
246 UHS2_NATIVE_CMD_WRITE |
247 UHS2_NATIVE_CMD_PLEN_4B |
248 (UHS2_DEV_CMD_ENUMERATE >> 8);
249
250 uhs2_cmd.payload[0] = (id_f << 4) | id_l;
> 251 uhs2_cmd.payload[0] = cpu_to_be32(uhs2_cmd.payload[0]);
252
253 sd_uhs2_cmd_assemble(&cmd, &uhs2_cmd, UHS2_DEV_ENUM_PAYLOAD_LEN, UHS2_DEV_ENUM_RESP_LEN);
254
255 err = mmc_wait_for_cmd(host, &cmd, 0);
256 if (err) {
257 pr_err("%s: %s: UHS2 CMD send fail, err= 0x%x!\n",
258 mmc_hostname(host), __func__, err);
259 return err;
260 }
261
262 if (uhs2_cmd.uhs2_resp[3] != (UHS2_DEV_CMD_ENUMERATE & 0xFF)) {
263 pr_err("%s: ENUMERATE response is wrong!\n",
264 mmc_hostname(host));
265 return -EIO;
266 }
267
268 id_f = (uhs2_cmd.uhs2_resp[4] >> 4) & 0xF;
269 id_l = uhs2_cmd.uhs2_resp[4] & 0xF;
270 *node_id = id_f;
271
272 return 0;
273 }
274
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-10-26 10:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-26 10:21 [ulfh-mmc:next 37/61] drivers/mmc/core/sd_uhs2.c:251:31: sparse: sparse: incorrect type in argument 1 (different base types) kernel test robot
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.