lkml.org 
[lkml]   [2020]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectdrivers/tty/serial/ucc_uart.c:264:21: sparse: sparse: incorrect type in argument 1 (different address spaces)
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dea8dcf2a9fa8cc540136a6cd885c3beece16ec3
commit: 894fa235eb4ca0bfa692dbe4932c2f940cdc8c1e powerpc: inline iomap accessors
date: 4 weeks ago
config: powerpc64-randconfig-s031-20201223 (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-184-g1b896707-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=894fa235eb4ca0bfa692dbe4932c2f940cdc8c1e
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 894fa235eb4ca0bfa692dbe4932c2f940cdc8c1e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=powerpc64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


"sparse warnings: (new ones prefixed by >>)"
>> drivers/tty/serial/ucc_uart.c:264:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:264:21: sparse: expected void const [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:264:21: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:268:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:268:21: sparse: expected void const [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:268:21: sparse: got restricted __be16 *
>> drivers/tty/serial/ucc_uart.c:347:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:347:17: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:347:17: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:348:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:348:17: sparse: expected void const [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:348:17: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:348:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:348:17: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:348:17: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:350:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:350:21: sparse: expected void const [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:350:21: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:369:18: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:369:18: sparse: expected void const [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:369:18: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:382:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:382:17: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:382:17: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:383:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:383:17: sparse: expected void const [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:383:17: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:383:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:383:17: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:383:17: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:386:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:386:21: sparse: expected void const [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:386:21: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:474:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:474:26: sparse: expected void const [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:474:26: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:481:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:481:21: sparse: expected void const [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:481:21: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:512:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:512:17: sparse: expected void const [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:512:17: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:512:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:512:17: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:512:17: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:515:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:515:21: sparse: expected void const [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:515:21: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:604:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:604:17: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:604:17: sparse: got restricted __be16 *
>> drivers/tty/serial/ucc_uart.c:605:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/tty/serial/ucc_uart.c:605:17: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:605:17: sparse: got restricted __be32 *
drivers/tty/serial/ucc_uart.c:606:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:606:17: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:606:17: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:612:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:612:9: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:612:9: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:613:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/tty/serial/ucc_uart.c:613:9: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:613:9: sparse: got restricted __be32 *
drivers/tty/serial/ucc_uart.c:614:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:614:9: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:614:9: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:625:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:625:17: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:625:17: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:626:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/tty/serial/ucc_uart.c:626:17: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:626:17: sparse: got restricted __be32 *
drivers/tty/serial/ucc_uart.c:627:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:627:17: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:627:17: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:637:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:637:9: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:637:9: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:638:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/tty/serial/ucc_uart.c:638:9: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:638:9: sparse: got restricted __be32 *
drivers/tty/serial/ucc_uart.c:639:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:639:9: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:639:9: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:653:46: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct ucc_uart_pram *uccup @@ got struct ucc_uart_pram [noderef] __iomem *uccup @@
drivers/tty/serial/ucc_uart.c:653:46: sparse: expected struct ucc_uart_pram *uccup
drivers/tty/serial/ucc_uart.c:653:46: sparse: got struct ucc_uart_pram [noderef] __iomem *uccup
drivers/tty/serial/ucc_uart.c:661:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got unsigned char * @@
drivers/tty/serial/ucc_uart.c:661:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:661:9: sparse: got unsigned char *
drivers/tty/serial/ucc_uart.c:662:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got unsigned char * @@
drivers/tty/serial/ucc_uart.c:662:9: sparse: expected void volatile [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:662:9: sparse: got unsigned char *
drivers/tty/serial/ucc_uart.c:663:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:663:9: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:663:9: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:664:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:664:9: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:664:9: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:665:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:665:9: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:665:9: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:666:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:666:9: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:666:9: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:667:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:667:9: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:667:9: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:668:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:668:9: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:668:9: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:669:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:669:9: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:669:9: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:670:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:670:9: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:670:9: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:671:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:671:9: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:671:9: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:672:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:672:9: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:672:9: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:674:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:674:17: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:674:17: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:675:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:675:9: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:675:9: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:713:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:713:17: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:713:17: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:714:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be16 * @@
drivers/tty/serial/ucc_uart.c:714:17: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:714:17: sparse: got restricted __be16 *
drivers/tty/serial/ucc_uart.c:715:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/tty/serial/ucc_uart.c:715:17: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:715:17: sparse: got restricted __be32 *
drivers/tty/serial/ucc_uart.c:716:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/tty/serial/ucc_uart.c:716:17: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:716:17: sparse: got restricted __be32 *
drivers/tty/serial/ucc_uart.c:717:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got unsigned char * @@
drivers/tty/serial/ucc_uart.c:717:17: sparse: expected void volatile [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:717:17: sparse: got unsigned char *
drivers/tty/serial/ucc_uart.c:718:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got unsigned char * @@
drivers/tty/serial/ucc_uart.c:718:17: sparse: expected void volatile [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:718:17: sparse: got unsigned char *
drivers/tty/serial/ucc_uart.c:719:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/tty/serial/ucc_uart.c:719:17: sparse: expected void [noderef] __iomem *addr
drivers/tty/serial/ucc_uart.c:719:17: sparse: got restricted __be32 *
drivers/tty/serial/ucc_uart.c:720:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got unsigned char * @@
drivers/tty/serial/ucc_uart.c:720:17: sparse: expected void volatile [noderef] __iomem *addr

vim +264 drivers/tty/serial/ucc_uart.c

d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 248
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 249 /*
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 250 * Return 1 if the QE is done transmitting all buffers for this port
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 251 *
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 252 * This function scans each BD in sequence. If we find a BD that is not
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 253 * ready (READY=1), then we return 0 indicating that the QE is still sending
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 254 * data. If we reach the last BD (WRAP=1), then we know we've scanned
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 255 * the entire list, and all BDs are done.
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 256 */
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 257 static unsigned int qe_uart_tx_empty(struct uart_port *port)
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 258 {
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 259 struct uart_qe_port *qe_port =
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 260 container_of(port, struct uart_qe_port, port);
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 261 struct qe_bd *bdp = qe_port->tx_bd_base;
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 262
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 263 while (1) {
8b1cdc4033bd165 drivers/tty/serial/ucc_uart.c Rasmus Villemoes 2019-11-28 @264 if (qe_ioread16be(&bdp->status) & BD_SC_READY)
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 265 /* This BD is not done, so return "not done" */
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 266 return 0;
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 267
8b1cdc4033bd165 drivers/tty/serial/ucc_uart.c Rasmus Villemoes 2019-11-28 268 if (qe_ioread16be(&bdp->status) & BD_SC_WRAP)
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 269 /*
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 270 * This BD is done and it's the last one, so return
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 271 * "done"
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 272 */
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 273 return 1;
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 274
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 275 bdp++;
fc811472c2167cc drivers/tty/serial/ucc_uart.c Joe Perches 2013-10-08 276 }
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 277 }
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 278
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 279 /*
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 280 * Set the modem control lines
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 281 *
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 282 * Although the QE can control the modem control lines (e.g. CTS), we
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 283 * don't need that support. This function must exist, however, otherwise
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 284 * the kernel will panic.
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 285 */
4be002f1dec8418 drivers/tty/serial/ucc_uart.c Jason Yan 2020-09-12 286 static void qe_uart_set_mctrl(struct uart_port *port, unsigned int mctrl)
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 287 {
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 288 }
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 289
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 290 /*
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 291 * Get the current modem control line status
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 292 *
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 293 * Although the QE can control the modem control lines (e.g. CTS), this
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 294 * driver currently doesn't support that, so we always return Carrier
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 295 * Detect, Data Set Ready, and Clear To Send.
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 296 */
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 297 static unsigned int qe_uart_get_mctrl(struct uart_port *port)
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 298 {
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 299 return TIOCM_CAR | TIOCM_DSR | TIOCM_CTS;
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 300 }
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 301
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 302 /*
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 303 * Disable the transmit interrupt.
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 304 *
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 305 * Although this function is called "stop_tx", it does not actually stop
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 306 * transmission of data. Instead, it tells the QE to not generate an
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 307 * interrupt when the UCC is finished sending characters.
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 308 */
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 309 static void qe_uart_stop_tx(struct uart_port *port)
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 310 {
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 311 struct uart_qe_port *qe_port =
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 312 container_of(port, struct uart_qe_port, port);
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 313
8b1cdc4033bd165 drivers/tty/serial/ucc_uart.c Rasmus Villemoes 2019-11-28 314 qe_clrbits_be16(&qe_port->uccp->uccm, UCC_UART_UCCE_TX);
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 315 }
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 316
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 317 /*
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 318 * Transmit as many characters to the HW as possible.
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 319 *
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 320 * This function will attempt to stuff of all the characters from the
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 321 * kernel's transmit buffer into TX BDs.
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 322 *
af901ca181d92aa drivers/serial/ucc_uart.c André Goddard Rosa 2009-11-14 323 * A return value of non-zero indicates that it successfully stuffed all
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 324 * characters from the kernel buffer.
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 325 *
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 326 * A return value of zero indicates that there are still characters in the
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 327 * kernel's buffer that have not been transmitted, but there are no more BDs
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 328 * available. This function should be called again after a BD has been made
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 329 * available.
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 330 */
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 331 static int qe_uart_tx_pump(struct uart_qe_port *qe_port)
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 332 {
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 333 struct qe_bd *bdp;
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 334 unsigned char *p;
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 335 unsigned int count;
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 336 struct uart_port *port = &qe_port->port;
ebd2c8f6d2ec401 drivers/serial/ucc_uart.c Alan Cox 2009-09-19 337 struct circ_buf *xmit = &port->state->xmit;
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 338
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 339 /* Handle xon/xoff */
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 340 if (port->x_char) {
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 341 /* Pick next descriptor and fill from buffer */
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 342 bdp = qe_port->tx_cur;
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 343
09a39ec9decd99e drivers/tty/serial/ucc_uart.c Rasmus Villemoes 2019-11-28 344 p = qe2cpu_addr(be32_to_cpu(bdp->buf), qe_port);
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 345
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 346 *p++ = port->x_char;
8b1cdc4033bd165 drivers/tty/serial/ucc_uart.c Rasmus Villemoes 2019-11-28 @347 qe_iowrite16be(1, &bdp->length);
8b1cdc4033bd165 drivers/tty/serial/ucc_uart.c Rasmus Villemoes 2019-11-28 348 qe_setbits_be16(&bdp->status, BD_SC_READY);
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 349 /* Get next BD. */
8b1cdc4033bd165 drivers/tty/serial/ucc_uart.c Rasmus Villemoes 2019-11-28 350 if (qe_ioread16be(&bdp->status) & BD_SC_WRAP)
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 351 bdp = qe_port->tx_bd_base;
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 352 else
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 353 bdp++;
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 354 qe_port->tx_cur = bdp;
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 355
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 356 port->icount.tx++;
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 357 port->x_char = 0;
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 358 return 1;
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 359 }
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 360
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 361 if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 362 qe_uart_stop_tx(port);
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 363 return 0;
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 364 }
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 365
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 366 /* Pick next descriptor and fill from buffer */
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 367 bdp = qe_port->tx_cur;
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 368
8b1cdc4033bd165 drivers/tty/serial/ucc_uart.c Rasmus Villemoes 2019-11-28 369 while (!(qe_ioread16be(&bdp->status) & BD_SC_READY) &&
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 370 (xmit->tail != xmit->head)) {
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 371 count = 0;
09a39ec9decd99e drivers/tty/serial/ucc_uart.c Rasmus Villemoes 2019-11-28 372 p = qe2cpu_addr(be32_to_cpu(bdp->buf), qe_port);
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 373 while (count < qe_port->tx_fifosize) {
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 374 *p++ = xmit->buf[xmit->tail];
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 375 xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 376 port->icount.tx++;
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 377 count++;
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 378 if (xmit->head == xmit->tail)
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 379 break;
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 380 }
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 381
8b1cdc4033bd165 drivers/tty/serial/ucc_uart.c Rasmus Villemoes 2019-11-28 382 qe_iowrite16be(count, &bdp->length);
8b1cdc4033bd165 drivers/tty/serial/ucc_uart.c Rasmus Villemoes 2019-11-28 383 qe_setbits_be16(&bdp->status, BD_SC_READY);
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 384
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 385 /* Get next BD. */
8b1cdc4033bd165 drivers/tty/serial/ucc_uart.c Rasmus Villemoes 2019-11-28 386 if (qe_ioread16be(&bdp->status) & BD_SC_WRAP)
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 387 bdp = qe_port->tx_bd_base;
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 388 else
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 389 bdp++;
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 390 }
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 391 qe_port->tx_cur = bdp;
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 392
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 393 if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 394 uart_write_wakeup(port);
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 395
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 396 if (uart_circ_empty(xmit)) {
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 397 /* The kernel buffer is empty, so turn off TX interrupts. We
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 398 don't need to be told when the QE is finished transmitting
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 399 the data. */
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 400 qe_uart_stop_tx(port);
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 401 return 0;
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 402 }
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 403
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 404 return 1;
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 405 }
d7584ed2b994a57 drivers/serial/ucc_uart.c Timur Tabi 2008-01-15 406

:::::: The code at line 264 was first introduced by commit
:::::: 8b1cdc4033bd1659c5499c918d4e59bf8253abec serial: ucc_uart: replace ppc-specific IO accessors

:::::: TO: Rasmus Villemoes <linux@rasmusvillemoes.dk>
:::::: CC: Li Yang <leoyang.li@nxp.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[unhandled content-type:application/gzip]
\
 
 \ /
  Last update: 2020-12-29 04:00    [W:0.062 / U:0.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site