From: kbuild test robot <fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: kbuild-all-JC7UmRfGjtg@public.gmane.org,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Felipe Balbi
<felipe.balbi-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Subject: [balbi-usb:testing/next 48/49] drivers/usb//gadget/function/u_serial.c:540:19: error: invalid operands to binary & (have 'unsigned int' and 'struct tty_struct *')
Date: Fri, 18 Aug 2017 16:29:28 +0800 [thread overview]
Message-ID: <201708181625.uPy8R6nk%fengguang.wu@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 4836 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git testing/next
head: 862b43460309779e5814616a68aa36d29a70d6e0
commit: 2b4e4d3c929db0fc7cf99212bfac0570b6902c14 [48/49] usb: gadget: serial: fix oops when data rx'd after close
config: xtensa-allmodconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 4.9.0
reproduce:
wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 2b4e4d3c929db0fc7cf99212bfac0570b6902c14
# save the attached .config to linux build tree
make.cross ARCH=xtensa
All errors (new ones prefixed by >>):
drivers/usb//gadget/function/u_serial.c: In function 'gs_rx_push':
>> drivers/usb//gadget/function/u_serial.c:540:19: error: invalid operands to binary & (have 'unsigned int' and 'struct tty_struct *')
if (req->actual & tty) {
^
vim +540 drivers/usb//gadget/function/u_serial.c
492
493 /*
494 * RX tasklet takes data out of the RX queue and hands it up to the TTY
495 * layer until it refuses to take any more data (or is throttled back).
496 * Then it issues reads for any further data.
497 *
498 * If the RX queue becomes full enough that no usb_request is queued,
499 * the OUT endpoint may begin NAKing as soon as its FIFO fills up.
500 * So QUEUE_SIZE packets plus however many the FIFO holds (usually two)
501 * can be buffered before the TTY layer's buffers (currently 64 KB).
502 */
503 static void gs_rx_push(unsigned long _port)
504 {
505 struct gs_port *port = (void *)_port;
506 struct tty_struct *tty;
507 struct list_head *queue = &port->read_queue;
508 bool disconnect = false;
509 bool do_push = false;
510
511 /* hand any queued data to the tty */
512 spin_lock_irq(&port->port_lock);
513 tty = port->port.tty;
514 while (!list_empty(queue)) {
515 struct usb_request *req;
516
517 req = list_first_entry(queue, struct usb_request, list);
518
519 /* leave data queued if tty was rx throttled */
520 if (tty && tty_throttled(tty))
521 break;
522
523 switch (req->status) {
524 case -ESHUTDOWN:
525 disconnect = true;
526 pr_vdebug("ttyGS%d: shutdown\n", port->port_num);
527 break;
528
529 default:
530 /* presumably a transient fault */
531 pr_warn("ttyGS%d: unexpected RX status %d\n",
532 port->port_num, req->status);
533 /* FALLTHROUGH */
534 case 0:
535 /* normal completion */
536 break;
537 }
538
539 /* push data to (open) tty */
> 540 if (req->actual & tty) {
541 char *packet = req->buf;
542 unsigned size = req->actual;
543 unsigned n;
544 int count;
545
546 /* we may have pushed part of this packet already... */
547 n = port->n_read;
548 if (n) {
549 packet += n;
550 size -= n;
551 }
552
553 count = tty_insert_flip_string(&port->port, packet,
554 size);
555 if (count)
556 do_push = true;
557 if (count != size) {
558 /* stop pushing; TTY layer can't handle more */
559 port->n_read += count;
560 pr_vdebug("ttyGS%d: rx block %d/%d\n",
561 port->port_num, count, req->actual);
562 break;
563 }
564 port->n_read = 0;
565 }
566
567 list_move(&req->list, &port->read_pool);
568 port->read_started--;
569 }
570
571 /* Push from tty to ldisc; this is handled by a workqueue,
572 * so we won't get callbacks and can hold port_lock
573 */
574 if (do_push)
575 tty_flip_buffer_push(&port->port);
576
577
578 /* We want our data queue to become empty ASAP, keeping data
579 * in the tty and ldisc (not here). If we couldn't push any
580 * this time around, there may be trouble unless there's an
581 * implicit tty_unthrottle() call on its way...
582 *
583 * REVISIT we should probably add a timer to keep the tasklet
584 * from starving ... but it's not clear that case ever happens.
585 */
586 if (!list_empty(queue) && tty) {
587 if (!tty_throttled(tty)) {
588 if (do_push)
589 tasklet_schedule(&port->push);
590 else
591 pr_warn("ttyGS%d: RX not scheduled?\n",
592 port->port_num);
593 }
594 }
595
596 /* If we're still connected, refill the USB RX queue. */
597 if (!disconnect && port->port_usb)
598 gs_start_rx(port);
599
600 spin_unlock_irq(&port->port_lock);
601 }
602
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 50926 bytes --]
next reply other threads:[~2017-08-18 8:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-18 8:29 kbuild test robot [this message]
[not found] ` <201708181625.uPy8R6nk%fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-08-18 9:30 ` [balbi-usb:testing/next 48/49] drivers/usb//gadget/function/u_serial.c:540:19: error: invalid operands to binary & (have 'unsigned int' and 'struct tty_struct *') Felipe Balbi
[not found] ` <87d17tql3l.fsf-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-08-18 16:10 ` Stephen Warren
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=201708181625.uPy8R6nk%fengguang.wu@intel.com \
--to=fengguang.wu-ral2jqcrhueavxtiumwx3w@public.gmane.org \
--cc=felipe.balbi-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=kbuild-all-JC7UmRfGjtg@public.gmane.org \
--cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox