From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v6 2/2] serial:sunplus-uart:Add Sunplus SoC UART Driver
Date: Wed, 12 Jan 2022 18:51:13 +0800 [thread overview]
Message-ID: <202201121800.PmWf0zhj-lkp@intel.com> (raw)
In-Reply-To: <1641979444-11661-3-git-send-email-hammerh0314@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 9653 bytes --]
Hi Hammer,
I love your patch! Yet something to improve:
[auto build test ERROR on tty/tty-testing]
[also build test ERROR on robh/for-next linux/master linus/master v5.16]
[cannot apply to next-20220112]
[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]
url: https://github.com/0day-ci/linux/commits/Hammer-Hsieh/Add-UART-driver-for-Suplus-SP7021-SoC/20220112-172542
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
config: nios2-randconfig-m031-20220112 (https://download.01.org/0day-ci/archive/20220112/202201121800.PmWf0zhj-lkp(a)intel.com/config)
compiler: nios2-linux-gcc (GCC) 11.2.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/0day-ci/linux/commit/359e5930a7804fbe8d313226cfec1ff484c16d11
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Hammer-Hsieh/Add-UART-driver-for-Suplus-SP7021-SoC/20220112-172542
git checkout 359e5930a7804fbe8d313226cfec1ff484c16d11
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=nios2 SHELL=/bin/bash drivers/tty/serial/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All error/warnings (new ones prefixed by >>):
drivers/tty/serial/sunplus-uart.c: In function 'sunplus_poll_put_char':
>> drivers/tty/serial/sunplus-uart.c:430:9: error: implicit declaration of function 'wait_for_xmitr'; did you mean 'wait_on_bit'? [-Werror=implicit-function-declaration]
430 | wait_for_xmitr(port);
| ^~~~~~~~~~~~~~
| wait_on_bit
drivers/tty/serial/sunplus-uart.c: In function 'sunplus_uart_probe':
>> drivers/tty/serial/sunplus-uart.c:624:40: warning: cast between incompatible function types from 'int (*)(struct reset_control *)' to 'void (*)(void *)' [-Wcast-function-type]
624 | (void(*)(void *))reset_control_assert,
| ^
At top level:
drivers/tty/serial/sunplus-uart.c:663:12: warning: 'sunplus_uart_resume' defined but not used [-Wunused-function]
663 | static int sunplus_uart_resume(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~
drivers/tty/serial/sunplus-uart.c:653:12: warning: 'sunplus_uart_suspend' defined but not used [-Wunused-function]
653 | static int sunplus_uart_suspend(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +430 drivers/tty/serial/sunplus-uart.c
426
427 #ifdef CONFIG_CONSOLE_POLL
428 static void sunplus_poll_put_char(struct uart_port *port, unsigned char data)
429 {
> 430 wait_for_xmitr(port);
431 sp_uart_put_char(port, data);
432 }
433
434 static int sunplus_poll_get_char(struct uart_port *port)
435 {
436 unsigned int lsr = readl(port->membase + SUP_UART_LSR);
437
438 if (!(lsr & SUP_UART_LSR_RX))
439 return NO_POLL_CHAR;
440
441 return readl(port->membase + SUP_UART_DATA);
442 }
443 #endif
444
445 static const struct uart_ops sunplus_uart_ops = {
446 .tx_empty = sunplus_tx_empty,
447 .set_mctrl = sunplus_set_mctrl,
448 .get_mctrl = sunplus_get_mctrl,
449 .stop_tx = sunplus_stop_tx,
450 .start_tx = sunplus_start_tx,
451 .stop_rx = sunplus_stop_rx,
452 .break_ctl = sunplus_break_ctl,
453 .startup = sunplus_startup,
454 .shutdown = sunplus_shutdown,
455 .set_termios = sunplus_set_termios,
456 .set_ldisc = sunplus_set_ldisc,
457 .type = sunplus_type,
458 .config_port = sunplus_config_port,
459 .verify_port = sunplus_verify_port,
460 #ifdef CONFIG_CONSOLE_POLL
461 .poll_put_char = sunplus_poll_put_char,
462 .poll_get_char = sunplus_poll_get_char,
463 #endif
464 };
465
466 #ifdef CONFIG_SERIAL_SUNPLUS_CONSOLE
467 struct sunplus_uart_port *sunplus_console_ports[SUP_UART_NR];
468
469 static void wait_for_xmitr(struct uart_port *port)
470 {
471 unsigned int val;
472 int ret;
473
474 /* Wait while FIFO is full or timeout */
475 ret = readl_poll_timeout_atomic(port->membase + SUP_UART_LSR, val,
476 (val & SUP_UART_LSR_TX), 1, 10000);
477
478 if (ret == -ETIMEDOUT) {
479 dev_err(port->dev, "Timeout waiting while UART TX FULL\n");
480 return;
481 }
482 }
483
484 static void sunplus_uart_console_putchar(struct uart_port *port, int ch)
485 {
486 wait_for_xmitr(port);
487 sp_uart_put_char(port, ch);
488 }
489
490 static void sunplus_console_write(struct console *co,
491 const char *s,
492 unsigned int count)
493 {
494 unsigned long flags;
495 int locked = 1;
496
497 local_irq_save(flags);
498
499 if (sunplus_console_ports[co->index]->port.sysrq)
500 locked = 0;
501 else if (oops_in_progress)
502 locked = spin_trylock(&sunplus_console_ports[co->index]->port.lock);
503 else
504 spin_lock(&sunplus_console_ports[co->index]->port.lock);
505
506 uart_console_write(&sunplus_console_ports[co->index]->port, s, count,
507 sunplus_uart_console_putchar);
508
509 if (locked)
510 spin_unlock(&sunplus_console_ports[co->index]->port.lock);
511
512 local_irq_restore(flags);
513 }
514
515 static int __init sunplus_console_setup(struct console *co, char *options)
516 {
517 struct sunplus_uart_port *sup;
518 int baud = 115200;
519 int bits = 8;
520 int parity = 'n';
521 int flow = 'n';
522
523 if (co->index < 0 || co->index >= SUP_UART_NR)
524 return -EINVAL;
525
526 sup = sunplus_console_ports[co->index];
527 if (!sup)
528 return -ENODEV;
529
530 if (options)
531 uart_parse_options(options, &baud, &parity, &bits, &flow);
532
533 return uart_set_options(&sup->port, co, baud, parity, bits, flow);
534 }
535
536 static struct uart_driver sunplus_uart_driver;
537 static struct console sunplus_uart_console = {
538 .name = "ttySUP",
539 .write = sunplus_console_write,
540 .device = uart_console_device,
541 .setup = sunplus_console_setup,
542 .flags = CON_PRINTBUFFER,
543 .index = -1,
544 .data = &sunplus_uart_driver
545 };
546
547 static int __init sunplus_console_init(void)
548 {
549 register_console(&sunplus_uart_console);
550 return 0;
551 }
552 console_initcall(sunplus_console_init);
553 #endif
554
555 static struct uart_driver sunplus_uart_driver = {
556 .owner = THIS_MODULE,
557 .driver_name = "sunplus_uart",
558 .dev_name = "ttySUP",
559 .major = TTY_MAJOR,
560 .minor = 64,
561 .nr = SUP_UART_NR,
562 .cons = NULL,
563 };
564
565 static int sunplus_uart_probe(struct platform_device *pdev)
566 {
567 struct sunplus_uart_port *sup;
568 struct uart_port *port;
569 struct resource *res;
570 int ret, irq;
571
572 pdev->id = of_alias_get_id(pdev->dev.of_node, "serial");
573
574 if (pdev->id < 0 || pdev->id >= SUP_UART_NR)
575 return -EINVAL;
576
577 sup = devm_kzalloc(&pdev->dev, sizeof(*sup), GFP_KERNEL);
578 if (!sup)
579 return -ENOMEM;
580
581 sup->clk = devm_clk_get_optional(&pdev->dev, NULL);
582 if (IS_ERR(sup->clk))
583 return dev_err_probe(&pdev->dev, PTR_ERR(sup->clk), "clk not found\n");
584
585 ret = clk_prepare_enable(sup->clk);
586 if (ret)
587 return ret;
588
589 ret = devm_add_action_or_reset(&pdev->dev,
590 (void(*)(void *))clk_disable_unprepare,
591 sup->clk);
592 if (ret)
593 return ret;
594
595 sup->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
596 if (IS_ERR(sup->rstc))
597 return dev_err_probe(&pdev->dev, PTR_ERR(sup->rstc), "rstc not found\n");
598
599 port = &sup->port;
600
601 port->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
602 if (IS_ERR(port->membase))
603 return dev_err_probe(&pdev->dev, PTR_ERR(port->membase), "membase not found\n");
604
605 irq = platform_get_irq(pdev, 0);
606 if (irq < 0)
607 return irq;
608
609 port->mapbase = res->start;
610 port->uartclk = clk_get_rate(sup->clk);
611 port->line = pdev->id;
612 port->irq = irq;
613 port->dev = &pdev->dev;
614 port->iotype = UPIO_MEM;
615 port->ops = &sunplus_uart_ops;
616 port->flags = UPF_BOOT_AUTOCONF;
617 port->fifosize = 128;
618
619 ret = reset_control_deassert(sup->rstc);
620 if (ret)
621 return ret;
622
623 ret = devm_add_action_or_reset(&pdev->dev,
> 624 (void(*)(void *))reset_control_assert,
625 sup->rstc);
626 if (ret)
627 return ret;
628
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
next prev parent reply other threads:[~2022-01-12 10:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-12 9:24 [PATCH v6 0/2] Add UART driver for Suplus SP7021 SoC Hammer Hsieh
2022-01-12 9:24 ` [PATCH v6 1/2] dt-bindings:serial:Add bindings doc for Sunplus SoC UART Driver Hammer Hsieh
2022-01-12 9:24 ` [PATCH v6 2/2] serial:sunplus-uart:Add " Hammer Hsieh
2022-01-12 10:51 ` kernel test robot [this message]
2022-01-12 11:31 ` kernel test robot
2022-01-13 7:06 ` Jiri Slaby
2022-01-13 8:54 ` hammer hsieh
2022-01-13 9:08 ` Jiri Slaby
2022-01-13 10:56 ` hammer hsieh
2022-01-13 11:12 ` Jiri Slaby
2022-01-14 2:22 ` hammer hsieh
2022-01-26 13:47 ` Greg KH
2022-01-28 3:36 ` hammer hsieh
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=202201121800.PmWf0zhj-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.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 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.