Re: [PATCH v6 8/8] tty: i3c: add TTY over I3C master support
From: kernel test robot
Date: Mon Feb 05 2024 - 08:15:45 EST
Hi Frank,
kernel test robot noticed the following build warnings:
[auto build test WARNING on tty/tty-testing]
[also build test WARNING on tty/tty-next tty/tty-linus robh/for-next linus/master v6.8-rc3 next-20240205]
[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#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Frank-Li/i3c-add-target-mode-support/20240203-071519
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
patch link: https://lore.kernel.org/r/20240202230925.1000659-9-Frank.Li%40nxp.com
patch subject: [PATCH v6 8/8] tty: i3c: add TTY over I3C master support
config: powerpc-randconfig-r071-20240205 (https://download.01.org/0day-ci/archive/20240205/202402052026.UNrmrB2M-lkp@xxxxxxxxx/config)
compiler: powerpc-linux-gcc (GCC) 13.2.0
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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202402052026.UNrmrB2M-lkp@xxxxxxxxx/
smatch warnings:
drivers/tty/i3c_tty.c:237 tty_i3c_rxwork() error: uninitialized symbol 'status'.
vim +/status +237 drivers/tty/i3c_tty.c
191
192 static void tty_i3c_rxwork(struct work_struct *work)
193 {
194 struct ttyi3c_port *sport = container_of(work, struct ttyi3c_port, rxwork);
195 struct i3c_priv_xfer xfers;
196 u32 retry = I3C_TTY_RETRY;
197 u16 status;
198 int ret;
199
200 memset(&xfers, 0, sizeof(xfers));
201 xfers.data.in = sport->rx_buff;
202 xfers.len = I3C_TTY_TRANS_SIZE;
203 xfers.rnw = 1;
204
205 do {
206 if (test_bit(I3C_TTY_RX_STOP, &sport->status))
207 break;
208
209 i3c_device_do_priv_xfers(sport->i3cdev, &xfers, 1);
210
211 if (xfers.actual_len) {
212 ret = tty_insert_flip_string(&sport->port, sport->rx_buff,
213 xfers.actual_len);
214 if (ret < xfers.actual_len)
215 sport->buf_overrun++;
216
217 retry = I3C_TTY_RETRY;
218 continue;
219 }
220
221 status = I3C_TTY_TARGET_RX_READY;
222 i3c_device_getstatus_format1(sport->i3cdev, &status);
223 /*
224 * Target side needs some time to fill data into fifo. Target side may not
225 * have hardware update status in real time. Software update status always
226 * needs some delays.
227 *
228 * Generally, target side have circular buffer in memory, it will be moved
229 * into FIFO by CPU or DMA. 'status' just show if circular buffer empty. But
230 * there are gap, especially CPU have not response irq to fill FIFO in time.
231 * So xfers.actual will be zero, wait for little time to avoid flood
232 * transfer in i3c bus.
233 */
234 usleep_range(I3C_TTY_YIELD_US, 10 * I3C_TTY_YIELD_US);
235 retry--;
236
> 237 } while (retry && (status & I3C_TTY_TARGET_RX_READY));
238
239 tty_flip_buffer_push(&sport->port);
240 }
241
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki