public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] serial.c, dsr_lock for read or write
@ 2001-05-22 15:11 Phung Te Ha
  2001-05-23  6:11 ` Gary Thomas
  0 siblings, 1 reply; 3+ messages in thread
From: Phung Te Ha @ 2001-05-22 15:11 UTC (permalink / raw)
  To: ecos-discuss

Hi everyone,

I'm using eCos on a custom board. The CPU is an ARM7.
I use serial.c to buffer my USB device driver and
realize that there's a call to
cyg_drv_dsr_lock()/unlock() around the serial_read()
and serial_write core. This blocks the other DSRs if I
have a blocking read waiting for data for instance.

Am I seeing it right? It seems too strong for me
blocking all the DSRs, and possibly quite long time
this way.

Thanks for your ideas.
Phungte

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [ECOS] serial.c, dsr_lock for read or write
  2001-05-22 15:11 [ECOS] serial.c, dsr_lock for read or write Phung Te Ha
@ 2001-05-23  6:11 ` Gary Thomas
  2001-05-23  9:12   ` Jonathan Larmour
  0 siblings, 1 reply; 3+ messages in thread
From: Gary Thomas @ 2001-05-23  6:11 UTC (permalink / raw)
  To: Phung Te Ha; +Cc: ecos-discuss

On 22-May-2001 Phung Te Ha wrote:
> Hi everyone,
> 
> I'm using eCos on a custom board. The CPU is an ARM7.
> I use serial.c to buffer my USB device driver and
> realize that there's a call to
> cyg_drv_dsr_lock()/unlock() around the serial_read()
> and serial_write core. This blocks the other DSRs if I
> have a blocking read waiting for data for instance.
> 
> Am I seeing it right? It seems too strong for me
> blocking all the DSRs, and possibly quite long time
> this way.

DSRs are only locked out while shared data structures are being
examined.  Once it is determined that the driver needs to wait
for data to move (in or out), the lock will be dropped.

Note: this mechanism really only works for interrupt-driven devices.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ECOS] serial.c, dsr_lock for read or write
  2001-05-23  6:11 ` Gary Thomas
@ 2001-05-23  9:12   ` Jonathan Larmour
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Larmour @ 2001-05-23  9:12 UTC (permalink / raw)
  To: Gary Thomas; +Cc: Phung Te Ha, ecos-discuss

Gary Thomas wrote:
> 
> On 22-May-2001 Phung Te Ha wrote:
> > Hi everyone,
> >
> > I'm using eCos on a custom board. The CPU is an ARM7.
> > I use serial.c to buffer my USB device driver and
> > realize that there's a call to
> > cyg_drv_dsr_lock()/unlock() around the serial_read()
> > and serial_write core. This blocks the other DSRs if I
> > have a blocking read waiting for data for instance.
> >
> > Am I seeing it right? It seems too strong for me
> > blocking all the DSRs, and possibly quite long time
> > this way.
> 
> DSRs are only locked out while shared data structures are being
> examined.  Once it is determined that the driver needs to wait
> for data to move (in or out), the lock will be dropped.
> 
> Note: this mechanism really only works for interrupt-driven devices.

I think Phung is concerned that we lock _all_ DSRs, not just the serial
DSRs. Unfortunately we can't be selective about which DSRs to run once we
get an interrupt - we can't restart the serial DSR later if we get a serial
interrupt.

The only scope for improvement in that respect is if we masked all the
serial interrupt(s) in the interrupt controller (if one exists!) or on the
device. Trying to do all this portably would take some care given the
presence or absence of an interrupt controller, the presence or absence of
disabling it at the device, and/or the selection of interrupts that need to
be masked.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-05-23  9:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-22 15:11 [ECOS] serial.c, dsr_lock for read or write Phung Te Ha
2001-05-23  6:11 ` Gary Thomas
2001-05-23  9:12   ` Jonathan Larmour

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).