Re: [PATCH 1/1] mct_u232: added _ioctl, _msr_to_icount and _get_icount functions

Previous thread: [PATCH RESEND] [ARM] Add missing include "asm/memory.h" by Axel Lin on Monday, December 27, 2010 - 6:56 pm. (2 messages)

Next thread: Re: hello by Azzam Yuan on Monday, December 27, 2010 - 10:16 pm. (1 message)
From: Tsozik
Date: Monday, December 27, 2010 - 9:04 pm

Pete,

Many thanks for your reply again. I actually still own an antique HP a230n (disclaimer: I got it from/with my wife and would never buy it myself). According to dmesg it's got built-in 8250-compliant serial:

[vtsozik@f15 serial]$  dmesg | grep -i serial | grep 8250
Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[vtsozik@f15 serial]$

So I ran geiger counter against /dev/ttyS0 device for 20 minutes and acquired 20 measurements. Then I compared last average with last 20 minute measurement average acquired via mct_u232 on the laptop placed nearby. The error was ~4% (rounded up). Taking in consideration that measurements were not acquired synchronously (i.e. in 2 different time slots) this is a pretty good match. 

Thank you again,
 Vadim.



      
--

From: Pete Zaitcev
Date: Monday, December 27, 2010 - 11:40 pm

On Mon, 27 Dec 2010 20:04:51 -0800 (PST)

Great, I'm ready to ack.

There's just one thing that is bugging me... I think it would be best
if Alan Cox or Greg Kroah commented on it. The edgeport does the
following, which we copied:


		schedule();
		........
		if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr &&
		    cnow.dcd == cprev.dcd && cnow.cts == cprev.cts)
			return -EIO; /* no change => error */
		if (((arg & TIOCM_RNG) && (cnow.rng != cprev.rng)) ||
		    ((arg & TIOCM_DSR) && (cnow.dsr != cprev.dsr)) ||
		    ((arg & TIOCM_CD)  && (cnow.dcd != cprev.dcd)) ||
		    ((arg & TIOCM_CTS) && (cnow.cts != cprev.cts))) {
			return 0;
		}

So, if there was a status report, but no change to bits, the ioctl
TIOCMIWAIT would return with -EIO. In serial_core.c, that serves
conventional non-USB UARTs, nothing like this occurs. I am not quite
sure what the point of doing this -EIO check is.

Oh and BTW, I'm wondering what is going to happen if the device is
disconnected while an application is blocked waiting for the status
change. The patch is not particularly bad here, it just copies
an existing code from elsewhere.

-- Pete
--

Previous thread: [PATCH RESEND] [ARM] Add missing include "asm/memory.h" by Axel Lin on Monday, December 27, 2010 - 6:56 pm. (2 messages)

Next thread: Re: hello by Azzam Yuan on Monday, December 27, 2010 - 10:16 pm. (1 message)