All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Abraham van der Merwe <abz@frogfoot.net>
Cc: Zwane Mwaikambo <zwane@arm.linux.org.uk>,
	Linux Kernel Discussions <linux-kernel@vger.kernel.org>
Subject: Re: sleeping in dev->tx_timeout?
Date: Sun, 03 Aug 2003 15:48:55 -0400	[thread overview]
Message-ID: <3F2D6727.8070203@pobox.com> (raw)
In-Reply-To: <20030803193708.GA13992@oasis.frogfoot.net>

Abraham van der Merwe wrote:
> Hi Zwane                                         >@2003.08.03_21:10:56_+0200
> 
> 
>>>Is it safe to sleep in tx_timeout (in the networking code), i.e. to call
>>>schedule_timeout and friends from that routine?
>>
>>No it's called from softirq context and with the dev->xmit_lock held in 
>>places.
> 
> 
> That's what I thought. How are you supposed to wait for long periods from
> tx_timeout? My problem is that I have a chip reset which takes around 10ms
> (i.e. too long to use mdelay())

Simple answer, don't wait in tx_timeout :)

These days drivers often need quite a while for hardware reset.  I am 
pushing to move this code, long term, into process context.  So, in 
tx_timeout:
* disable NIC and interrupts as best you can, quickly
* schedule_task/schedule_work to schedule the full hardware reset

	Jeff





  reply	other threads:[~2003-08-03 19:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-03 18:37 sleeping in dev->tx_timeout? Abraham van der Merwe
2003-08-03 19:10 ` Zwane Mwaikambo
2003-08-03 19:37   ` Abraham van der Merwe
2003-08-03 19:48     ` Jeff Garzik [this message]
2003-08-03 20:54       ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F2D6727.8070203@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=abz@frogfoot.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zwane@arm.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.