uart2 read problem

hi all,
i m testing the uart2 of my xm in a loop back mode.....
whenever i do echo a > /dev/ttyS1 i observe the incrementation in
cat /proc/tty/driver/serial
1: uart:ST16654 mmio:0x4806C000 irq:73 tx:1 rx:1 DSR|CD|RI when i
short
the rx(8) and tx(6).
when shorting is removed no observation on the rx line of the above
line
so i concluded that the mux configuration settings are fine.
but when i m doing the programming as below
fd=open("/dev/ttyS1",O_RDWR)
char tx ='c';
write(fd,&tx,1); this is successfull
read(fd,&rx,1); this call returns -1 errno= resource temporarily
unavailable.
how to read successfully what i have written to uart2?
below is my tty settings........

int tty_init (void)
{
struct termios tio;
fd=open("/dev/ttyS1",O_RDWR | O_NONBLOCK | O_NOCTTY); //Open ttyS1
port
if(fd < 0)
return 0; //no fd found
else
printf("File Descriptor: %d\n", fd);
tio.c_cflag = B115200 | CS8 | CREAD | CLOCAL; //Set baud, no. of bits,

tio.c_iflag = IGNPAR; //Ignore parity

tio.c_oflag = 0;

tio.c_lflag = 0;

tio.c_cc[VMIN] = 5;

tio.c_cc[VTIME] = 0;

tcflush(fd, TCIFLUSH);

tcsetattr(fd,TCSANOW,&tio);
return 1;
}