From: James Chapman <jchapman@katalix.com>
To: Andy Fleming <afleming@freescale.com>
Cc: netdev@oss.sgi.com, "David S. Miller" <davem@davemloft.net>,
linuxppc-embedded@ozlabs.org,
Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: Re: RFC: PHY Abstraction Layer II
Date: Sun, 17 Apr 2005 14:00:11 +0100 [thread overview]
Message-ID: <42625DDB.4090600@katalix.com> (raw)
In-Reply-To: <96c50184a02557c88dee0e6d17f3a539@freescale.com>
Andy Fleming wrote:
> Ok, here's the new patch with changes suggested by James Chapman:
I guess I still have questions about the way interrupts are used.
Using an interrupt to schedule a work queue which then sets a variable
that is used by a timer seems odd. Why not do all the work in the work
queue and schedule it from the interrupt handler or timer?
Many network devices have status bits in their interrupt status
registers to indicate PHY events. These bits are handled in the
network device driver; there is no separate irq. It would obviously be
good to change these drivers to hook up your abstraction layer to
handle PHY functions. You suggested previously that the network driver
and PHY driver could share the irq when the PHY's interrupt is
indicated through the network device's status registers. I still don't
see how SA_SHIRQ could work given that the PHY code uses
disable_irq_nosync() and enable_irq() when handling interrupts. If the
irq is shared with the net device interrupt, this will cause packet
interrupts to stop until the phy's work queue callback is called. If
the irq is shared with other possibly unrelated devices, other bad
effects could occur.
Perhaps the following code (taken from phy_change()) could be called
by the net driver when link state changes are detected by its
interrupt or NAPI poll handler?
if ((PHY_RUNNING == phydev->state) || (PHY_NOLINK == phydev->state)) {
phydev->state = PHY_CHANGELINK;
schedule_work(&phydev->phy_queue);
}
In the above case, the net driver would use phy_connect() to connect
its PHY and phydev->irq would be -1 to disable use of PHY interrupts
by the PHY code. Would this work? If so, a new API function for net
drivers to call would be useful.
Also, did you mean to leave the #if 0 code in davicom.c?
/james
next prev parent reply other threads:[~2005-04-17 13:00 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-09 1:47 RFC: PHY Abstraction Layer II Andy Fleming
2005-03-09 2:14 ` Benjamin Herrenschmidt
2005-03-09 3:42 ` David S. Miller
2005-03-09 3:50 ` Benjamin Herrenschmidt
2005-03-09 17:24 ` Andy Fleming
2005-03-10 23:01 ` James Chapman
2005-03-10 23:06 ` Benjamin Herrenschmidt
2005-03-10 23:27 ` Jeff Garzik
2005-03-10 23:27 ` Benjamin Herrenschmidt
2005-03-15 0:41 ` Andy Fleming
2005-03-15 19:18 ` James Chapman
2005-03-18 23:14 ` Andy Fleming
2005-03-24 21:48 ` Andy Fleming
2005-03-25 22:56 ` Andy Fleming
2005-03-28 23:45 ` Kumar Gala
2005-04-17 13:00 ` James Chapman [this message]
2005-05-10 17:04 ` Andy Fleming
2005-05-12 6:08 ` Pantelis Antoniou
2005-05-25 23:00 ` Kumar Gala
2005-03-09 17:17 ` Andy Fleming
2005-05-26 18:32 ` Stephen Hemminger
2005-05-26 18:45 ` Andy Fleming
2005-05-31 17:59 ` Stephen Hemminger
2005-06-01 20:45 ` Andy Fleming
2005-06-01 21:19 ` Stephen Hemminger
2005-06-01 22:42 ` Andy Fleming
2005-06-01 21:41 ` Stephen Hemminger
2005-06-01 22:36 ` Andy Fleming
2005-06-05 20:29 ` Glen Turner
2005-06-09 21:32 ` Andy Fleming
2005-06-28 6:38 ` Glen Turner
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=42625DDB.4090600@katalix.com \
--to=jchapman@katalix.com \
--cc=afleming@freescale.com \
--cc=benh@kernel.crashing.org \
--cc=davem@davemloft.net \
--cc=linuxppc-embedded@ozlabs.org \
--cc=netdev@oss.sgi.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).