Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Nov 2006 13:01:41 -0700 (MST)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        jackie7691@yahoo.com.mx
Cc:        attilio@freebsd.org, freebsd-drivers@freebsd.org
Subject:   Re: PCCARD - interruptible sleep
Message-ID:  <20061116.130141.228973534.imp@bsdimp.com>
In-Reply-To: <331679.63275.qm@web56013.mail.re3.yahoo.com>
References:  <3bbf2fe10611081130i1e34ab2end66bf238117cfcf8@mail.gmail.com> <331679.63275.qm@web56013.mail.re3.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <331679.63275.qm@web56013.mail.re3.yahoo.com>
            Jacqueline P <jackie7691@yahoo.com.mx> writes:
:   so what can I do to get my driver running ?
:   Actually I have no idea.

Make sure that your ISR doesn't loop.  You can do this by calling
bus_child_present() if you think you'd want to loop.

Warner


: Attilio Rao <attilio@freebsd.org> escribi=F3:
:   2006/11/8, Warner Losh :
: > From: "Attilio Rao" =

: > Subject: Re: PCCARD - interruptible sleep
: > Date: Wed, 8 Nov 2006 14:43:59 +0100
: >
: > > 2006/11/8, Jacqueline P :
: > > > Hi all
: > > >
: > > > how can I implement an interruptible sleep within my pccard sma=
rt card reader driver like ?
: > > > For Linux I do this the following way
: > > >
: > > > // interruptible_pause()
: > > > static inline void ipause(unsigned long amount) {
: > > > set_current_state(TASK_INTERRUPTIBLE);
: > > > schedule_timeout(amount);
: > > > }
: > > >
: > > > and within my driver I use the function DELAY which does a busy=
 wait.
: > > >
: > > > The problem is, that the driver does not recognize when the pcc=
ard is detached during a read / write operation.
: > > >
: > > > Does the kernel update the struct device_t, so that the driver =
can use the function device_is_attached() to determine that the device =
is detached ?
: > >
: > > You can implement a 'dying' flag in your softc structure (and
: > > subsequent macro in order to handle).
: >
: > But that won't tell you if the hardware has disappeared. Experience=

: > has shown that dying isn't such a good idea in many cases and tends=
 to
: > cause more races than it solves.
: =

: Nothing that can't be solved with a softc lock?
: Give an example please.
: =

: Attilio
: =

: =

: -- =

: Peace can only be achieved by understanding - A. Einstein
: _______________________________________________
: freebsd-drivers@freebsd.org mailing list
: http://lists.freebsd.org/mailman/listinfo/freebsd-drivers
: To unsubscribe, send any mail to "freebsd-drivers-unsubscribe@freebsd=
.org"
: =

: =

:  		=

: ---------------------------------
:   Do You Yahoo!? La mejor conexi=F3n a Internet y 2GB extra a tu corr=
eo por $100 al mes. http://net.yahoo.com.mx =




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061116.130141.228973534.imp>