From: Andy Fleming <afleming@gmail.com>
To: Richard Cochran <richardcochran@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH 4/4] phylib: Allow reading and writing a mii bus from atomic context.
Date: Tue, 6 Jul 2010 12:09:10 -0500 [thread overview]
Message-ID: <AANLkTikEF3B-0JGvqosY5jMaChbpYctOmKW1jJKOWsQE@mail.gmail.com> (raw)
In-Reply-To: <a06cf09ed5096bf8f9434d90828adfa70586e936.1278307573.git.richard.cochran@omicron.at>
On Mon, Jul 5, 2010 at 12:33 AM, Richard Cochran
<richardcochran@gmail.com> wrote:
> In order to support hardware time stamping from a PHY, it is necessary to
> read from the PHY while running in_interrupt(). This patch allows a mii
> bus to operate in an atomic context. An mii_bus driver may declare itself
> capable for this mode. Drivers which do not do this will remain with the
> default that bus operations may sleep.
>
> Before commit 35b5f6b1a82b5c586e0b24c711dc6ba944e88ef1 mii bus
> operations were protected with spin locks. That commit replaced the
> locks with mutexs in order to accommodate i2c buses that need to
> sleep. Thus, this patch restores the original behavior as a run time
> option.
The reason we moved to mutexes was because we didn't want PHY
operations to be done in interrupt context. They are too slow. Also,
some MII busses will trigger an interrupt when the operation is done,
which means their driver has the option of sleeping. As such, it was
an original principle of the PHY lib that MII transactions were not
allowed in interrupt context. *Certainly*, once you *do* allow MII
transactions in interrupt context, you *cannot* use spin_lock(). You
at least have to use spin_lock_irq[save].
Also, I agree with David's comments, and Grant's. There's got to be
another way to do this.
Andy
next prev parent reply other threads:[~2010-07-06 19:07 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-05 5:30 [PATCH v2 0/4] Extend Time Stamping Richard Cochran
2010-07-05 5:31 ` [PATCH 1/4] net: add driver hooks for time stamping Richard Cochran
2010-07-06 2:03 ` David Miller
2010-07-06 2:39 ` David Miller
2010-07-05 5:32 ` [PATCH 2/4] phylib: add a way to make PHY time stamps possible Richard Cochran
2010-07-06 2:03 ` David Miller
2010-07-05 5:33 ` [PATCH 3/4] phylib: preserve ifreq parameter when calling generic phy_mii_ioctl() Richard Cochran
2010-07-06 2:03 ` David Miller
2010-07-05 5:33 ` [PATCH 4/4] phylib: Allow reading and writing a mii bus from atomic context Richard Cochran
2010-07-06 2:05 ` David Miller
2010-07-06 17:09 ` Andy Fleming [this message]
2010-07-07 7:18 ` Richard Cochran
2010-07-16 11:25 ` Richard Cochran
2010-07-16 11:49 ` Richard Cochran
-- strict thread matches above, loose matches on Subject: below --
2010-06-28 15:33 [PATCH 0/4] Extend Time Stamping Richard Cochran
2010-06-28 15:35 ` [PATCH 4/4] phylib: Allow reading and writing a mii bus from atomic context Richard Cochran
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=AANLkTikEF3B-0JGvqosY5jMaChbpYctOmKW1jJKOWsQE@mail.gmail.com \
--to=afleming@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.com \
/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 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 NNTP newsgroup(s).