Re: (pl2303): open("/dev/ttyUSB0", ....) blocks forever after kernel update (custom compilation)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 10 Dec 2010, ENRIQUE ARIZON BENITO wrote:

> On Thu, Dec 9, 2010 at 11:30 PM, Matthew Dharm
> <mdharm-usb@xxxxxxxxxxxxxxxxxx> wrote:
> > On Thu, Dec 09, 2010 at 10:45:13PM +0100, ENRIQUE ARIZON BENITO wrote:
> >> A simple script like:
> >>
> >> echo "1" > /dev/ttyUSB0
> >>
> >> stopped to work after upgrading my system to a custom compiled version
> >> of kernel 2.6.35.
> >>
> >> There are no errors in syslog or dmesg and the pl2303 loads without
> >> complains, but strace shows that
> >> open("/dev/ttyUSB0",...) blocks forever.
> >>
> >> I guess it must be some wrong parameter in the compilation, but I'm
> >> blind trying to find the solution.
> >
> > Have you used stty to check the port mode settings?  It may be blocking for
> > carrier detect....
> >
> > Matt
> >
> 
> Yes, I did. In fact the setting as displayed from the output command
> "stty -a -F /dev/ttyUSB0" are equals both for the working kernel and
> the new (non working) one.

That means nothing, since the kernel's behavior in this regard has 
changed.  Older versions of the kernel were buggy; they would not block 
for a handshaking signal when they should have.  That's probably why 
your test didn't hang under the working kernel.

To prevent waiting for a handshake signal, you can do

	stty -F /dev/ttyUSB0 clocal -crtscts

before running the test.  But a better idea is to avoid doing regular 
I/O to a serial port and instead use a program designed for that task, 
like minicom.

On Fri, 10 Dec 2010, ENRIQUE ARIZON BENITO wrote:

> Solved!
> 
> Udev was loading both uhci an ohci even if the system was not using ohci at all.

That would not cause any problems.  The ohci-hcd driver would simply be 
inactive; it would not interfere with uhci-hcd.

>  "rmmoding" both on them as well as "pl2303" and "modprobing" uchi and
> pl2303 (in that order), the blocking dissapeared.

I think you are fooling yourself.  The port settings are much more 
likely to be the cause of the problem.  Reloading pl2303 probably 
caused the settings to change.

> ohci was also beeing loaded by the old 2.6.30 kernel. Still it didn't
> affect the normal behaviour. That makes me suspect there could be
> another bug somewhere else.

Not a bug, just the system operating the way it is supposed to.

Alan Stern


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux