From: Michael Schmitz <hidden> Date: 2012-02-27 07:07:34
Hi.
after much prodding from Geert, and a bit of bouncing ideas back and
forth, I've rewritten the Atari EtherNEC ethercard driver to use work
with only minimal patches to ne.c (instead of duplicating ne.c as
atari_ethernec.c).
The EtherNEC adapter is a solution to use a RTL8019 ISA card on the
cartridge (ROM) port of m68k Atari computers. The cartridge port does
not support generating interrupts. To service card interrupts, the 8390
interrupt handler is called periodically from a dedicated hardware timer
which needs to be shared with other users (the SMC91C111 EtherNAT
driver, and a dummy handler dedicated to preventing interference from
the interrupt watchdog if the card is idle).
netdev subscribers please focus on the patch to ne.c at the top. Changes
to ne.c are twofold: to select 8-bit mode for the driver, and to ensure
the interrupt can be shared with aforementioned other users if the
driver is used on Atari.
This patch applies on top of Geert's current linux-m68k. It won't
cleanly apply on top of, or work if built from Linus' tree, as it relies
on further patches relating to bus access quirks that are pending in
Geert's tree.
The old EtherNEC driver is retained as-is, to be removed from Geert's
tree after this code has been accepted. It can still be built by
selecting the CONFIG_ATARI_ETHERNEC_OLD option.
Comments to linux-m68k or me, please - I'm not subscribed to netdev.
Cheers,
Michael
@@ -492,7 +496,16 @@ static int __init ne_probe1(struct net_device *dev,
unsigned long ioaddr)
/* Snarf the interrupt now. There's no point in waiting since we
cannot
share and the board will usually be enabled. */
- ret = request_irq(dev->irq, eip_interrupt, 0, name, dev);
+#if IS_ENABLED(CONFIG_ATARI_ETHERNEC)
+ if (MACH_IS_ATARI) {
+ /* Atari EtherNEC emulates the card interrupt via a timer -
+ this needs to be shared with the smc91C111 driver and with
+ a dummy handler to catch unhandled interrupts ! */
+ ret = request_irq(dev->irq, eip_interrupt, IRQF_SHARED, name, dev);
+ } else
+#endif
+ ret = request_irq(dev->irq, eip_interrupt, 0, name, dev);
+
if (ret) {
printk (" unable to get IRQ %d (errno=%d).\n", dev->irq, ret);
goto err_out;
@@ -201,7 +201,7 @@ CONFIG_NET_ETHERNET=y CONFIG_MII=y CONFIG_ATARILANCE=y CONFIG_ATARI_ETHERNAT=m-CONFIG_ATARI_ETHERNEC=y+CONFIG_ATARI_ETHERNEC=m # CONFIG_NETDEV_1000 is not set # CONFIG_NETDEV_10000 is not set CONFIG_PPP=m
@@ -456,7 +457,7 @@ static int __init ne_probe1(struct net_device *dev,
int ioaddr)
}
if (ei_debug && version_printed++ == 0)
- printk(KERN_INFO "%s" KERN_INFO "%s", version1, version2);
+ printk(KERN_INFO "%s%s", version1, version2);
/* A user with a poor card that fails to ack the reset, or that
does not have a valid 0x57,0x57 signature can still use this
@@ -941,9 +942,10 @@ module_param(use_poll, int, 0); MODULE_PARM_DESC(io, "I/O base address(es),required"); MODULE_PARM_DESC(irq, "IRQ number(s)"); MODULE_PARM_DESC(bad, "Accept card(s) with bad signatures");-MODULE_PARM_DESC(use_poll, "Use timer interrupt to poll driver");+MODULE_PARM_DESC(use_poll, "Use system timer to poll driver"); MODULE_DESCRIPTION("NE1000/NE2000 ISA/PnP Ethernet driver"); MODULE_LICENSE("GPL");+MODULE_ALIAS("platform:8390"); /* This is set up so that no ISA autoprobe takes place. We can't guarantee that the ne2k probe is the last 8390 based probe to take place (as it
after much prodding from Geert, and a bit of bouncing ideas back and forth,
I've rewritten the Atari EtherNEC ethercard driver to use work with only
minimal patches to ne.c (instead of duplicating ne.c as atari_ethernec.c).
The EtherNEC adapter is a solution to use a RTL8019 ISA card on the cartridge
(ROM) port of m68k Atari computers. The cartridge port does not support
generating interrupts. To service card interrupts, the 8390 interrupt handler
is called periodically from a dedicated hardware timer which needs to be
shared with other users (the SMC91C111 EtherNAT driver, and a dummy handler
dedicated to preventing interference from the interrupt watchdog if the card
is idle).
netdev subscribers please focus on the patch to ne.c at the top. Changes to
ne.c are twofold: to select 8-bit mode for the driver, and to ensure the
interrupt can be shared with aforementioned other users if the driver is used
on Atari.
This patch applies on top of Geert's current linux-m68k. It won't cleanly
apply on top of, or work if built from Linus' tree, as it relies on further
patches relating to bus access quirks that are pending in Geert's tree.
The old EtherNEC driver is retained as-is, to be removed from Geert's tree
after this code has been accepted. It can still be built by selecting the
CONFIG_ATARI_ETHERNEC_OLD option.
Comments to linux-m68k or me, please - I'm not subscribed to netdev.
Cheers,
Michael
@@ -492,7 +496,16 @@ static int __init ne_probe1(struct net_device *dev,
unsigned long ioaddr)
/* Snarf the interrupt now. There's no point in waiting since we cannot
share and the board will usually be enabled. */
- ret = request_irq(dev->irq, eip_interrupt, 0, name, dev);
+#if IS_ENABLED(CONFIG_ATARI_ETHERNEC)
+ if (MACH_IS_ATARI) {
+ /* Atari EtherNEC emulates the card interrupt via a timer -
+ this needs to be shared with the smc91C111 driver and with
+ a dummy handler to catch unhandled interrupts ! */
+ ret = request_irq(dev->irq, eip_interrupt, IRQF_SHARED, name, dev);
+ } else
+#endif
+ ret = request_irq(dev->irq, eip_interrupt, 0, name, dev);
+
if (ret) {
printk (" unable to get IRQ %d (errno=%d).\n", dev->irq, ret);
goto err_out;
Netdev people: are these changes to ne.c acceptable?
If yes, I'll split everything and queue it up (the ne.c part through netdev,
the rest through m68k).
If not, do you have a better solution[*]?
Are there other network drivers using/requiring a similar approach?
Thanks!
[*] I can imagine an alternative, which could be generalized for other
platforms:
- Leave the irq at zero to indicate polling.
- In the driver, do
if (!dev->irq) {
ret = -E...;
#ifdef CONFIG_ATARI
if (MACH_IS_ATARI) {
ret = atari_request_poll(eip_interrupt, name, dev);
}
#endif
} else {
ret = request_irq(dev->irq, ...);
...
}
and a similar thing for free_irq().
This has the advantage that atari_request_poll() can decide to register the
timer interrupt only when EtherNEC or EtherNAT are active.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
From: Michael Schmitz <hidden> Date: 2012-03-07 18:42:48
Hi Geert,
Netdev people: are these changes to ne.c acceptable?
If yes, I'll split everything and queue it up (the ne.c part through netdev,
the rest through m68k).
If not, do you have a better solution[*]?
Are there other network drivers using/requiring a similar approach?
smc91x requires the same approach - the only changes necessary there
are to smc91x.h (and Kconfig).
(no patch yet; the code is stuck on my devel PC which refuses to boot ATM).
Cheers,
Michael
From: Paul Gortmaker <hidden> Date: 2012-03-09 03:11:17
On Mon, Feb 27, 2012 at 2:07 AM, Michael Schmitz
[off-list ref] wrote:
quoted hunk
Hi.
after much prodding from Geert, and a bit of bouncing ideas back and forth,
I've rewritten the Atari EtherNEC ethercard driver to use work with only
minimal patches to ne.c (instead of duplicating ne.c as atari_ethernec.c).
The EtherNEC adapter is a solution to use a RTL8019 ISA card on the
cartridge (ROM) port of m68k Atari computers. The cartridge port does not
support generating interrupts. To service card interrupts, the 8390
interrupt handler is called periodically from a dedicated hardware timer
which needs to be shared with other users (the SMC91C111 EtherNAT driver,
and a dummy handler dedicated to preventing interference from the interrupt
watchdog if the card is idle).
netdev subscribers please focus on the patch to ne.c at the top. Changes to
ne.c are twofold: to select 8-bit mode for the driver, and to ensure the
interrupt can be shared with aforementioned other users if the driver is
used on Atari.
This patch applies on top of Geert's current linux-m68k. It won't cleanly
apply on top of, or work if built from Linus' tree, as it relies on further
patches relating to bus access quirks that are pending in Geert's tree.
The old EtherNEC driver is retained as-is, to be removed from Geert's tree
after this code has been accepted. It can still be built by selecting the
CONFIG_ATARI_ETHERNEC_OLD option.
Comments to linux-m68k or me, please - I'm not subscribed to netdev.
Cheers,
Michael
@@ -492,7 +496,16 @@ static int __init ne_probe1(struct net_device *dev,
unsigned long ioaddr)
/* Snarf the interrupt now. There's no point in waiting since we cannot
share and the board will usually be enabled. */
- ret = request_irq(dev->irq, eip_interrupt, 0, name, dev);
+#if IS_ENABLED(CONFIG_ATARI_ETHERNEC)
+ if (MACH_IS_ATARI) {
+ /* Atari EtherNEC emulates the card interrupt via a timer -
+ this needs to be shared with the smc91C111 driver and with
+ a dummy handler to catch unhandled interrupts ! */
+ ret = request_irq(dev->irq, eip_interrupt, IRQF_SHARED, name, dev);
+ } else
+#endif
+ ret = request_irq(dev->irq, eip_interrupt, 0, name, dev);
+
There has to be a cleaner way than this. Something as simple as creating
a platform specific 8380_IRQ_FLAGS would get rid of this ifdef'ery in
the driver and that is with only 20s of thought invested.
Paul.
--
quoted hunk
if (ret) {
printk (" unable to get IRQ %d (errno=%d).\n", dev->irq, ret);
goto err_out;
CONFIG_MII=y
CONFIG_ATARILANCE=y
CONFIG_ATARI_ETHERNAT=m
-CONFIG_ATARI_ETHERNEC=y
+CONFIG_ATARI_ETHERNEC=m
# CONFIG_NETDEV_1000 is not set
# CONFIG_NETDEV_10000 is not set
CONFIG_PPP=m
To compile this driver as a module, choose M here: the module
will be called apne.
+config ATARI_ETHERNEC_OLD
+ tristate "Atari EtherNEC Ethernet support - old driver"
+ depends on ATARI_ROM_ISA
+ help
+ Say Y to include support for the EtherNEC network adapter for the
+ ROM port. The driver works by polling instead of interrupts, so it
+ is quite slow.
+
config ATARI_ETHERNEC
- tristate "Atari EtherNEC Ethernet support"
+ tristate "Atari EtherNEC Ethernet support - mainstream NE2000 driver"
depends on ATARI_ROM_ISA
+ select CRC32
help
Say Y to include support for the EtherNEC network adapter for the
ROM port. The driver works by polling instead of interrupts, so it
diff --git a/drivers/net/ethernet/8390/Makefile
b/drivers/net/ethernet/8390/Makefile
index d896466..e620355 100644
@@ -456,7 +457,7 @@ static int __init ne_probe1(struct net_device *dev, int
ioaddr)
}
if (ei_debug && version_printed++ == 0)
- printk(KERN_INFO "%s" KERN_INFO "%s", version1, version2);
+ printk(KERN_INFO "%s%s", version1, version2);
/* A user with a poor card that fails to ack the reset, or that
does not have a valid 0x57,0x57 signature can still use this
MODULE_PARM_DESC(io, "I/O base address(es),required");
MODULE_PARM_DESC(irq, "IRQ number(s)");
MODULE_PARM_DESC(bad, "Accept card(s) with bad signatures");
-MODULE_PARM_DESC(use_poll, "Use timer interrupt to poll driver");
+MODULE_PARM_DESC(use_poll, "Use system timer to poll driver");
MODULE_DESCRIPTION("NE1000/NE2000 ISA/PnP Ethernet driver");
MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:8390");
/* This is set up so that no ISA autoprobe takes place. We can't guarantee
that the ne2k probe is the last 8390 based probe to take place (as it
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
@@ -492,7 +496,16 @@ static int __init ne_probe1(struct net_device *dev,
unsigned long ioaddr)
/* Snarf the interrupt now. There's no point in waiting since we cannot
share and the board will usually be enabled. */
- ret = request_irq(dev->irq, eip_interrupt, 0, name, dev);
+#if IS_ENABLED(CONFIG_ATARI_ETHERNEC)
+ if (MACH_IS_ATARI) {
+ /* Atari EtherNEC emulates the card interrupt via a timer -
+ this needs to be shared with the smc91C111 driver and with
+ a dummy handler to catch unhandled interrupts ! */
+ ret = request_irq(dev->irq, eip_interrupt, IRQF_SHARED, name, dev);
+ } else
+#endif
+ ret = request_irq(dev->irq, eip_interrupt, 0, name, dev);
+
There has to be a cleaner way than this. Something as simple as creating
a platform specific 8380_IRQ_FLAGS would get rid of this ifdef'ery in
the driver and that is with only 20s of thought invested.
That would have been the alternative - would you prefer to have this
added in 8390.h or ne.c?
Thanks,
Michael
Do you really need the #if here? Should be avoidable.
<asm/atariints.h> exists on m68k only, and is not included by any header in
arch/m68k/include/.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Do you really need the #if here? Should be avoidable.
<asm/atariints.h> exists on m68k only, and is not included by any header in
arch/m68k/include/.
This kind of arch specific stuff still shouldn't need to
bubble right up to the driver level I'd think a driver
should be able to include <asm/irq.h> and have whatever
arch specific goo like this be present.
So maybe this kind of magic should be in arch/m68k/include/asm/irq*
instead of here?
And on re-reading the comments in the other part of the patch, i.e.
"...emulates the card interrupt via a timer" --perhaps the driver
should be just fixed to support generic netpoll, instead of adding
an arch specific thing that amounts to netpoll. Then anyone can
attempt to limp along and use one of these ancient relics w/o IRQ.
Paul.
--
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
From: Michael Schmitz <hidden> Date: 2012-03-11 06:31:28
Paul Gortmaker wrote:
quoted
<asm/atariints.h> exists on m68k only, and is not included by any header in
arch/m68k/include/.
This kind of arch specific stuff still shouldn't need to
bubble right up to the driver level I'd think a driver
should be able to include <asm/irq.h> and have whatever
arch specific goo like this be present.
So maybe this kind of magic should be in arch/m68k/include/asm/irq*
instead of here?
I've double checked - that hunk should not actually have been in the
patch at all. My bad ...
With all arch-specific interrupt tweaks (aside from the interrupt
flags) now removed from the driver, the definition wasn't actually used
any longer in the main driver file.
The non-standard interrupt flag will still be required for those users
that decide to wire up the card interrupt line to, for example, the
modem serial port's ring input.
And on re-reading the comments in the other part of the patch, i.e.
"...emulates the card interrupt via a timer" --perhaps the driver
should be just fixed to support generic netpoll, instead of adding
an arch specific thing that amounts to netpoll. Then anyone can
attempt to limp along and use one of these ancient relics w/o IRQ.
I had in fact implemented that as a fallback option earlier, and it
turned out to be quite a bit slower that way.
If that's the preferred option, I'll add netpoll to the 8390 driver and
resubmit.
Thanks,
Michael
From: Michael Schmitz <hidden> Date: 2012-04-01 08:49:52
Hi Paul, Geert,
And on re-reading the comments in the other part of the patch, i.e.
"...emulates the card interrupt via a timer" --perhaps the driver
should be just fixed to support generic netpoll, instead of adding
an arch specific thing that amounts to netpoll. Then anyone can
attempt to limp along and use one of these ancient relics w/o IRQ.
Here's take two of my patch to convert the m68k Atari ROM port Ethernet
driver to use mainstream ne.c, with minimal changes to the core NE2000
code.
In particular:
Changes to core net code:
* add a platform specific IRQ flag, so ne.c can share a hardware or
timer interrupt with some other interrupt source.
Changes to arch/m68k code:
* register the 8390 platform device on Atari only if the hardware is present
* retain the old driver (atari_ethernec.c in Geert's tree) under a
different config option, to be removed soon.
Regarding your suggestion that netpoll be used instead of a dedicated
timer interrupt: no changes to ne.c or 8390p.c are required to use
netpoll, it all works out of the box. All that is needed to use the
driver with netpoll is setting the device interrupt to some source that
can be registered, and enabling CONFIG_NETPOLL. Interrupt rate and hence
throughput is lower with netpoll though, which is why I still prefer the
dedicated timer option.
Comments?
Cheers,
Michael Schmitz
Signed-off-by: Michael Schmitz <redacted>
--
arch/m68k/atari/config.c | 41
+++++++++++++++++++++++++---
drivers/net/Space.c | 2 +-
drivers/net/ethernet/8390/8390.h | 8 +++++
drivers/net/ethernet/8390/Kconfig | 18 +++++++++++-
drivers/net/ethernet/8390/Makefile | 3 +-
drivers/net/ethernet/8390/atari_ethernec.c | 6 ++--
drivers/net/ethernet/8390/ne.c | 5 ++-
7 files changed, 71 insertions(+), 12 deletions(-)
@@ -788,6 +820,7 @@ int __init atari_platform_init(void) #endif if (need_timer) {+ int ret; const char *name = "Timer D dummy interrupt"; /* timer routine set up in atari_ethernec_probe() */
@@ -802,7 +835,7 @@ int __init atari_platform_init(void) } }- if (ret) return ret;+ if (rv1) return rv1; return rv; }
@@ -32,6 +32,14 @@ extern void ei_poll(struct net_device *dev);externvoideip_poll(structnet_device*dev);#endif+/* Some platforms may need special IRQ flags */+#if IS_ENABLED(CONFIG_ATARI_ETHERNEC)+# define EI_IRQ_FLAGS IRQF_SHARED+#endif++#ifndef EI_IRQ_FLAGS+# define EI_IRQ_FLAGS 0+#endif/* Without I/O delay - non ISA or later chips */externvoidNS8390_init(structnet_device*dev,intstartp);
diff --git a/drivers/net/ethernet/8390/Kconfig
b/drivers/net/ethernet/8390/Kconfig
index b801056..75875f2 100644
@@ -492,7 +493,7 @@ static int __init ne_probe1(struct net_device *dev,
unsigned long ioaddr)
/* Snarf the interrupt now. There's no point in waiting since we
cannot
share and the board will usually be enabled. */
- ret = request_irq(dev->irq, eip_interrupt, 0, name, dev);
+ ret = request_irq(dev->irq, eip_interrupt, EI_IRQ_FLAGS, name, dev);
if (ret) {
printk (" unable to get IRQ %d (errno=%d).\n", dev->irq, ret);
goto err_out;
And on re-reading the comments in the other part of the patch, i.e.
"...emulates the card interrupt via a timer" --perhaps the driver
should be just fixed to support generic netpoll, instead of adding
an arch specific thing that amounts to netpoll. Then anyone can
attempt to limp along and use one of these ancient relics w/o IRQ.
Here's take two of my patch to convert the m68k Atari ROM port
Ethernet driver to use mainstream ne.c, with minimal changes to the
core NE2000 code.
Please fix your email client, it corrupts your outgoing patches
by breaking up long lines with newlines amongst other things.
From: Paul Gortmaker <hidden> Date: 2012-04-04 20:46:29
On 12-04-01 04:49 AM, Michael Schmitz wrote:
Hi Paul, Geert,
quoted
And on re-reading the comments in the other part of the patch, i.e.
"...emulates the card interrupt via a timer" --perhaps the driver
should be just fixed to support generic netpoll, instead of adding
an arch specific thing that amounts to netpoll. Then anyone can
attempt to limp along and use one of these ancient relics w/o IRQ.
Here's take two of my patch to convert the m68k Atari ROM port Ethernet
driver to use mainstream ne.c, with minimal changes to the core NE2000
code.
In particular:
Changes to core net code:
* add a platform specific IRQ flag, so ne.c can share a hardware or
timer interrupt with some other interrupt source.
Changes to arch/m68k code:
* register the 8390 platform device on Atari only if the hardware is present
* retain the old driver (atari_ethernec.c in Geert's tree) under a
different config option, to be removed soon.
Regarding your suggestion that netpoll be used instead of a dedicated
timer interrupt: no changes to ne.c or 8390p.c are required to use
netpoll, it all works out of the box. All that is needed to use the
driver with netpoll is setting the device interrupt to some source that
can be registered, and enabling CONFIG_NETPOLL. Interrupt rate and hence
throughput is lower with netpoll though, which is why I still prefer the
dedicated timer option.
How much lower? Enough to matter? Implicit in that question is
the assumption that this is largely a hobbyist platform and nobody
is using it in a closet to route gigabytes of traffic.
Also, the only advantage to modifying ne.c is to allow dumping
the old driver. What is the "remove soon" plan? Any reason
for it to not be synchronous? That would eliminate the Kconfig
churn and the introduction of the _OLD option. Modifying ne.c
and then deciding to keep the old driver because it is "faster"
would make this change pointless.
Comments?
Some specific to the non-atari network parts inline below.
P.
@@ -32,6 +32,14 @@ extern void ei_poll(struct net_device *dev);externvoideip_poll(structnet_device*dev);#endif+/* Some platforms may need special IRQ flags */+#if IS_ENABLED(CONFIG_ATARI_ETHERNEC)+# define EI_IRQ_FLAGS IRQF_SHARED+#endif++#ifndef EI_IRQ_FLAGS+# define EI_IRQ_FLAGS 0+#endif
This seems more klunky than it needs to be. If we assume that anyone
building ne.c on atari is hence trying to drive an ethernec device
than it can just be
#ifdef CONFIG_ATARI
#define EI_IRQ_FLAGS IRQF_SHARED
#else
#define EI_IRQ_FLAGS 0
#endif
quoted hunk
/* Without I/O delay - non ISA or later chips */
extern void NS8390_init(struct net_device *dev, int startp);
diff --git a/drivers/net/ethernet/8390/Kconfig
b/drivers/net/ethernet/8390/Kconfig
index b801056..75875f2 100644
Rather than use IS_ENABLED on a driver setting, you can follow
the surrounding context and use defined(CONFIG_ATARI) -- i.e.
work off a platform setting.
Paul.
@@ -492,7 +493,7 @@ static int __init ne_probe1(struct net_device *dev,
unsigned long ioaddr)
/* Snarf the interrupt now. There's no point in waiting since we
cannot
share and the board will usually be enabled. */
- ret = request_irq(dev->irq, eip_interrupt, 0, name, dev);
+ ret = request_irq(dev->irq, eip_interrupt, EI_IRQ_FLAGS, name, dev);
if (ret) {
printk (" unable to get IRQ %d (errno=%d).\n", dev->irq, ret);
goto err_out;
On Wed, Apr 4, 2012 at 22:46, Paul Gortmaker
[off-list ref] wrote:
On 12-04-01 04:49 AM, Michael Schmitz wrote:
quoted
quoted
And on re-reading the comments in the other part of the patch, i.e.
"...emulates the card interrupt via a timer" --perhaps the driver
should be just fixed to support generic netpoll, instead of adding
an arch specific thing that amounts to netpoll. Then anyone can
attempt to limp along and use one of these ancient relics w/o IRQ.
Here's take two of my patch to convert the m68k Atari ROM port Ethernet
driver to use mainstream ne.c, with minimal changes to the core NE2000
code.
In particular:
Changes to core net code:
* add a platform specific IRQ flag, so ne.c can share a hardware or
timer interrupt with some other interrupt source.
Changes to arch/m68k code:
* register the 8390 platform device on Atari only if the hardware is present
* retain the old driver (atari_ethernec.c in Geert's tree) under a
different config option, to be removed soon.
Regarding your suggestion that netpoll be used instead of a dedicated
timer interrupt: no changes to ne.c or 8390p.c are required to use
netpoll, it all works out of the box. All that is needed to use the
driver with netpoll is setting the device interrupt to some source that
can be registered, and enabling CONFIG_NETPOLL. Interrupt rate and hence
throughput is lower with netpoll though, which is why I still prefer the
dedicated timer option.
How much lower? Enough to matter? Implicit in that question is
the assumption that this is largely a hobbyist platform and nobody
is using it in a closet to route gigabytes of traffic.
One other thing we could do is increase CONFIG_HZ to 250.
Also, the only advantage to modifying ne.c is to allow dumping
the old driver. What is the "remove soon" plan? Any reason
for it to not be synchronous? That would eliminate the Kconfig
churn and the introduction of the _OLD option. Modifying ne.c
and then deciding to keep the old driver because it is "faster"
would make this change pointless.
From my point of view, "remove soon" means it will never hit mainline.
quoted
diff --git a/drivers/net/ethernet/8390/8390.h
b/drivers/net/ethernet/8390/8390.h
index ef325ff..9416245 100644
extern void eip_poll(struct net_device *dev);
#endif
+/* Some platforms may need special IRQ flags */
+#if IS_ENABLED(CONFIG_ATARI_ETHERNEC)
+# define EI_IRQ_FLAGS IRQF_SHARED
+#endif
+
+#ifndef EI_IRQ_FLAGS
+# define EI_IRQ_FLAGS 0
+#endif
This seems more klunky than it needs to be. If we assume that anyone
building ne.c on atari is hence trying to drive an ethernec device
than it can just be
#ifdef CONFIG_ATARI
#define EI_IRQ_FLAGS IRQF_SHARED
#else
#define EI_IRQ_FLAGS 0
#endif
Indeed, with a small modification (keep multi-platform kernels in mind):
#ifdef CONFIG_ATARI
#define EI_IRQ_FLAGS (MACH_IS_ATARI ? IRQF_SHARED : 0)
#else
#define EI_IRQ_FLAGS 0
#endif
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
From: Michael Schmitz <hidden> Date: 2012-04-05 09:44:14
Hi Paul,
(Apologies to all for botching the patch format ...)
quoted
Regarding your suggestion that netpoll be used instead of a dedicated
timer interrupt: no changes to ne.c or 8390p.c are required to use
netpoll, it all works out of the box. All that is needed to use the
driver with netpoll is setting the device interrupt to some source that
can be registered, and enabling CONFIG_NETPOLL. Interrupt rate and hence
throughput is lower with netpoll though, which is why I still prefer the
dedicated timer option.
How much lower? Enough to matter? Implicit in that question is
the assumption that this is largely a hobbyist platform and nobody
is using it in a closet to route gigabytes of traffic.
I'd say about at least double latency. I can try and measure bulk data
rates if it matters. My gut feeling is latency limits data rates even
when say behind a DSL modem for downloads. It sure did when my Falcon
was still hooked up to a university network, uploading and downloading
source and binary packages for Debian/68k.
Of course you're not routing gigabytes of traffic with this (where to -
a PPP connection? :). Whoever wants minimum latency better reach for the
soldering iron and wire up the interrupt line to some suitable input.
Also, the only advantage to modifying ne.c is to allow dumping
the old driver. What is the "remove soon" plan? Any reason
for it to not be synchronous? That would eliminate the Kconfig
churn and the introduction of the _OLD option. Modifying ne.c
and then deciding to keep the old driver because it is "faster"
would make this change pointless.
As soon as eventual changes to ne.c get accepted. If you want us to drop
the old driver in the same patch, fine by me.
quoted
diff --git a/drivers/net/ethernet/8390/8390.h
b/drivers/net/ethernet/8390/8390.h
index ef325ff..9416245 100644
@@ -32,6 +32,14 @@ extern void ei_poll(struct net_device *dev);externvoideip_poll(structnet_device*dev);#endif+/* Some platforms may need special IRQ flags */+#if IS_ENABLED(CONFIG_ATARI_ETHERNEC)+# define EI_IRQ_FLAGS IRQF_SHARED+#endif++#ifndef EI_IRQ_FLAGS+# define EI_IRQ_FLAGS 0+#endif
This seems more klunky than it needs to be. If we assume that anyone
building ne.c on atari is hence trying to drive an ethernec device
than it can just be
#ifdef CONFIG_ATARI
#define EI_IRQ_FLAGS IRQF_SHARED
#else
#define EI_IRQ_FLAGS 0
#endif
Pretty safe assumption - if we further assume no other arch has reason
to resort to such a kludge, we can simplify it this way.
Rather than use IS_ENABLED on a driver setting, you can follow
the surrounding context and use defined(CONFIG_ATARI) -- i.e.
work off a platform setting.
True as well, point taken. Is the patch acceptable with these changes?
If so, would you be OK with this going through Geert's tree?
Cheers,
Michael
From: Paul Gortmaker <hidden> Date: 2012-04-05 13:24:52
On 12-04-05 05:28 AM, Geert Uytterhoeven wrote:
On Wed, Apr 4, 2012 at 22:46, Paul Gortmaker
[off-list ref] wrote:
quoted
On 12-04-01 04:49 AM, Michael Schmitz wrote:
quoted
quoted
And on re-reading the comments in the other part of the patch, i.e.
"...emulates the card interrupt via a timer" --perhaps the driver
should be just fixed to support generic netpoll, instead of adding
an arch specific thing that amounts to netpoll. Then anyone can
attempt to limp along and use one of these ancient relics w/o IRQ.
Here's take two of my patch to convert the m68k Atari ROM port Ethernet
driver to use mainstream ne.c, with minimal changes to the core NE2000
code.
In particular:
Changes to core net code:
* add a platform specific IRQ flag, so ne.c can share a hardware or
timer interrupt with some other interrupt source.
Changes to arch/m68k code:
* register the 8390 platform device on Atari only if the hardware is present
* retain the old driver (atari_ethernec.c in Geert's tree) under a
different config option, to be removed soon.
Regarding your suggestion that netpoll be used instead of a dedicated
timer interrupt: no changes to ne.c or 8390p.c are required to use
netpoll, it all works out of the box. All that is needed to use the
driver with netpoll is setting the device interrupt to some source that
can be registered, and enabling CONFIG_NETPOLL. Interrupt rate and hence
throughput is lower with netpoll though, which is why I still prefer the
dedicated timer option.
How much lower? Enough to matter? Implicit in that question is
the assumption that this is largely a hobbyist platform and nobody
is using it in a closet to route gigabytes of traffic.
One other thing we could do is increase CONFIG_HZ to 250.
quoted
Also, the only advantage to modifying ne.c is to allow dumping
the old driver. What is the "remove soon" plan? Any reason
for it to not be synchronous? That would eliminate the Kconfig
churn and the introduction of the _OLD option. Modifying ne.c
and then deciding to keep the old driver because it is "faster"
would make this change pointless.
From my point of view, "remove soon" means it will never hit mainline.
Can you clarify what "it" is? It isn't clear to me if you
mean the _removal_ will never hit mainline, or the transient
renamed "old" driver will never hit mainline.
If the former, then there is no point pursuing this any further
as I said above.
If the latter, then the commit sent out for review should have
no instances of this "renaming to old" related changes.
Thanks,
Paul.
quoted
quoted
diff --git a/drivers/net/ethernet/8390/8390.h
b/drivers/net/ethernet/8390/8390.h
index ef325ff..9416245 100644
@@ -32,6 +32,14 @@ extern void ei_poll(struct net_device *dev);externvoideip_poll(structnet_device*dev);#endif+/* Some platforms may need special IRQ flags */+#if IS_ENABLED(CONFIG_ATARI_ETHERNEC)+# define EI_IRQ_FLAGS IRQF_SHARED+#endif++#ifndef EI_IRQ_FLAGS+# define EI_IRQ_FLAGS 0+#endif
This seems more klunky than it needs to be. If we assume that anyone
building ne.c on atari is hence trying to drive an ethernec device
than it can just be
#ifdef CONFIG_ATARI
#define EI_IRQ_FLAGS IRQF_SHARED
#else
#define EI_IRQ_FLAGS 0
#endif
Indeed, with a small modification (keep multi-platform kernels in mind):
#ifdef CONFIG_ATARI
#define EI_IRQ_FLAGS (MACH_IS_ATARI ? IRQF_SHARED : 0)
#else
#define EI_IRQ_FLAGS 0
#endif
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Hi Paul,
On Thu, Apr 5, 2012 at 15:24, Paul Gortmaker
[off-list ref] wrote:
On 12-04-05 05:28 AM, Geert Uytterhoeven wrote:
quoted
On Wed, Apr 4, 2012 at 22:46, Paul Gortmaker
[off-list ref] wrote:
quoted
On 12-04-01 04:49 AM, Michael Schmitz wrote:
quoted
quoted
And on re-reading the comments in the other part of the patch, i.e.
"...emulates the card interrupt via a timer" --perhaps the driver
should be just fixed to support generic netpoll, instead of adding
an arch specific thing that amounts to netpoll. Then anyone can
attempt to limp along and use one of these ancient relics w/o IRQ.
Here's take two of my patch to convert the m68k Atari ROM port Ethernet
driver to use mainstream ne.c, with minimal changes to the core NE2000
code.
In particular:
Changes to core net code:
* add a platform specific IRQ flag, so ne.c can share a hardware or
timer interrupt with some other interrupt source.
Changes to arch/m68k code:
* register the 8390 platform device on Atari only if the hardware is present
* retain the old driver (atari_ethernec.c in Geert's tree) under a
different config option, to be removed soon.
Regarding your suggestion that netpoll be used instead of a dedicated
timer interrupt: no changes to ne.c or 8390p.c are required to use
netpoll, it all works out of the box. All that is needed to use the
driver with netpoll is setting the device interrupt to some source that
can be registered, and enabling CONFIG_NETPOLL. Interrupt rate and hence
throughput is lower with netpoll though, which is why I still prefer the
dedicated timer option.
How much lower? Enough to matter? Implicit in that question is
the assumption that this is largely a hobbyist platform and nobody
is using it in a closet to route gigabytes of traffic.
One other thing we could do is increase CONFIG_HZ to 250.
quoted
Also, the only advantage to modifying ne.c is to allow dumping
the old driver. What is the "remove soon" plan? Any reason
for it to not be synchronous? That would eliminate the Kconfig
churn and the introduction of the _OLD option. Modifying ne.c
and then deciding to keep the old driver because it is "faster"
would make this change pointless.
From my point of view, "remove soon" means it will never hit mainline.
Can you clarify what "it" is? It isn't clear to me if you
mean the _removal_ will never hit mainline, or the transient
renamed "old" driver will never hit mainline.
If the former, then there is no point pursuing this any further
as I said above.
If the latter, then the commit sent out for review should have
no instances of this "renaming to old" related changes.
Sorry for being unclear. The latter (i.e. the old driver will
never hit mainline).
And Michael's patch against ne.c should indeed not touch the old
driver, as it doesn't exist in mainline.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
From: Michael Schmitz <hidden> Date: 2012-04-05 22:10:19
Geert,
quoted
How much lower? Enough to matter? Implicit in that question is
the assumption that this is largely a hobbyist platform and nobody
is using it in a closet to route gigabytes of traffic.
One other thing we could do is increase CONFIG_HZ to 250.
Making 3.x kernels run even more sluggish than they already do?
quoted
Also, the only advantage to modifying ne.c is to allow dumping
the old driver. What is the "remove soon" plan? Any reason
for it to not be synchronous? That would eliminate the Kconfig
churn and the introduction of the _OLD option. Modifying ne.c
and then deciding to keep the old driver because it is "faster"
would make this change pointless.
From my point of view, "remove soon" means it will never hit mainline.
That's what I meant to say - my patch is based on the m68k tree which
currently has another driver for this hardware, based on an older
version of ne.c which was never submitted to mainline. The old driver
would be removed from the m68k tree as soon as possible.
quoted
This seems more klunky than it needs to be. If we assume that anyone
building ne.c on atari is hence trying to drive an ethernec device
than it can just be
#ifdef CONFIG_ATARI
#define EI_IRQ_FLAGS IRQF_SHARED
#else
#define EI_IRQ_FLAGS 0
#endif
Indeed, with a small modification (keep multi-platform kernels in mind):
#ifdef CONFIG_ATARI
#define EI_IRQ_FLAGS (MACH_IS_ATARI ? IRQF_SHARED : 0)
#else
#define EI_IRQ_FLAGS 0
#endif
Right you are. Is any other m68k platform using ne.c directly, or do you
plan to convert all other NE2000 based drivers to ne.c now?
Cheers,
Michael
On Fri, Apr 6, 2012 at 00:10, Michael Schmitz [off-list ref] wrote:
quoted
Indeed, with a small modification (keep multi-platform kernels in mind):
#ifdef CONFIG_ATARI
#define EI_IRQ_FLAGS (MACH_IS_ATARI ? IRQF_SHARED : 0)
#else
#define EI_IRQ_FLAGS 0
#endif
Right you are. Is any other m68k platform using ne.c directly, or do you
plan to convert all other NE2000 based drivers to ne.c now?
Plain ne is also used on Q40.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
From: Michael Schmitz <schmitzmic@gmail.com> Date: 2014-08-09 01:09:34
Hi Paul,
I hate to bring this up again after such a long delay - my usual
slackness is to blame, sorry.
Geert has reminded me that the IRQ-less ne.c driver is one of the few
remaining unmerged patches in his queue.
We had resolved the polling from timer interrupt issues in the m68k
interrupt code, with a little help from Thomas Gleixner (commit
b39898cd4077f4b6ec706e717c938751c34e1dc4) so changes to ne.c are now
minimal.
Are you willing to review this minimal patch again?
Regards,
Michael Schmitz
On 12-04-05 05:28 AM, Geert Uytterhoeven wrote:
quoted
On Wed, Apr 4, 2012 at 22:46, Paul Gortmaker
[off-list ref] wrote:
quoted
On 12-04-01 04:49 AM, Michael Schmitz wrote:
quoted
quoted
And on re-reading the comments in the other part of the patch, i.e.
"...emulates the card interrupt via a timer" --perhaps the driver
should be just fixed to support generic netpoll, instead of adding
an arch specific thing that amounts to netpoll. Then anyone can
attempt to limp along and use one of these ancient relics w/o IRQ.
Here's take two of my patch to convert the m68k Atari ROM port Ethernet
driver to use mainstream ne.c, with minimal changes to the core NE2000
code.
In particular:
Changes to core net code:
* add a platform specific IRQ flag, so ne.c can share a hardware or
timer interrupt with some other interrupt source.
Changes to arch/m68k code:
* register the 8390 platform device on Atari only if the hardware is present
* retain the old driver (atari_ethernec.c in Geert's tree) under a
different config option, to be removed soon.
Regarding your suggestion that netpoll be used instead of a dedicated
timer interrupt: no changes to ne.c or 8390p.c are required to use
netpoll, it all works out of the box. All that is needed to use the
driver with netpoll is setting the device interrupt to some source that
can be registered, and enabling CONFIG_NETPOLL. Interrupt rate and hence
throughput is lower with netpoll though, which is why I still prefer the
dedicated timer option.
How much lower? Enough to matter? Implicit in that question is
the assumption that this is largely a hobbyist platform and nobody
is using it in a closet to route gigabytes of traffic.
One other thing we could do is increase CONFIG_HZ to 250.
quoted
Also, the only advantage to modifying ne.c is to allow dumping
the old driver. What is the "remove soon" plan? Any reason
for it to not be synchronous? That would eliminate the Kconfig
churn and the introduction of the _OLD option. Modifying ne.c
and then deciding to keep the old driver because it is "faster"
would make this change pointless.
From my point of view, "remove soon" means it will never hit mainline.
Can you clarify what "it" is? It isn't clear to me if you
mean the _removal_ will never hit mainline, or the transient
renamed "old" driver will never hit mainline.
If the former, then there is no point pursuing this any further
as I said above.
If the latter, then the commit sent out for review should have
no instances of this "renaming to old" related changes.
Thanks,
Paul.
quoted
quoted
quoted
diff --git a/drivers/net/ethernet/8390/8390.h
b/drivers/net/ethernet/8390/8390.h
index ef325ff..9416245 100644
@@ -32,6 +32,14 @@ extern void ei_poll(struct net_device *dev);externvoideip_poll(structnet_device*dev);#endif+/* Some platforms may need special IRQ flags */+#if IS_ENABLED(CONFIG_ATARI_ETHERNEC)+# define EI_IRQ_FLAGS IRQF_SHARED+#endif++#ifndef EI_IRQ_FLAGS+# define EI_IRQ_FLAGS 0+#endif
This seems more klunky than it needs to be. If we assume that anyone
building ne.c on atari is hence trying to drive an ethernec device
than it can just be
#ifdef CONFIG_ATARI
#define EI_IRQ_FLAGS IRQF_SHARED
#else
#define EI_IRQ_FLAGS 0
#endif
Indeed, with a small modification (keep multi-platform kernels in mind):
#ifdef CONFIG_ATARI
#define EI_IRQ_FLAGS (MACH_IS_ATARI ? IRQF_SHARED : 0)
#else
#define EI_IRQ_FLAGS 0
#endif
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds