LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 04-17-2012, 03:05 PM   #1
sashas83
LQ Newbie
 
Registered: Apr 2012
Posts: 1

Rep: Reputation: Disabled
poll_get_char method in uart driver


Hi all.
I`m trying to activate kgdb on amlogic board, running kernel version.

It seems that they have implemented poll_get_char method incorrectly,
from documentation of kgdb (example driver 8250.c) it seems that the
method poll_get_char should block until character is available,
here is the code from 8250.c file


static int serial8250_get_poll_char(struct uart_port *port)
{
struct uart_8250_port *up = (struct uart_8250_port *)port;
unsigned char lsr = serial_inp(up, UART_LSR);

while (!(lsr & UART_LSR_DR))
lsr = serial_inp(up, UART_LSR);

return serial_inp(up, UART_RX);
}

while amlogic does not do that.

amlogic implementation:

static int am_uart_get_poll_char(struct uart_port *port)
{
struct am_uart_port * info = &am_ports[port->line];
am_uart_t *uart = uart_addr[info->line];
int status,rx;

mutex_lock(&info->info_mutex);
if ((status = __raw_readl(&uart->status) & 0x7f))
rx = __raw_readl(&uart->rdata);
else
rx = 0;
mutex_unlock(&info->info_mutex);

return rx;
}


I could not find any "contract" of this method in documentation or forums , so it is unclear whether the "poll_get_char" implementation should "poll" indefinitely until there is a character available, or just check whether there is character available, or poll during some amount of time.

This is the question, what is the contract of this method?

Thanks, Regards Sasha.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Where does uart console get its value of uart port membase? unifoxz Linux - Kernel 1 12-20-2011 02:28 PM
Writing GPS driver over High Speed UART souvikdatta Programming 5 10-23-2010 11:46 AM
UART driver porting from 2.4.20 to 2.6.10 for freescale imx21ADS21 board. AshishVyas Linux - Newbie 1 05-15-2008 06:30 AM
how to modified 16c550 uart driver from kernel 2.4 to 2.6 first1113 Programming 3 03-02-2007 01:24 PM
uart driver for infrared remote control ubuntu_amateur Linux - Kernel 4 11-04-2006 01:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 05:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration