2018-10-14 18:10:05

by Randy Dunlap

[permalink] [raw]
Subject: net/wan: hostess_sv11 + z85230 problems

kernel 4.19-rc7, on i386, with NO wan/hdlc/hostess/z85230 hardware:

modprobe hostess_sv11 + autoload of z85230 give:


[ 3162.494393] calling hdlc_module_init+0x0/0x1000 [hdlc] @ 4024
[ 3162.495528] hdlc: HDLC support module revision 1.22
[ 3162.496877] initcall hdlc_module_init+0x0/0x1000 [hdlc] returned 0 after 1312 usecs
[ 3162.500840] calling z85230_init_driver+0x0/0x1000 [z85230] @ 4024
[ 3162.502877] Generic Z85C30/Z85230 interface driver v0.02
[ 3162.503895] initcall z85230_init_driver+0x0/0x1000 [z85230] returned 0 after 987 usecs
[ 3162.506869] calling init_module+0x0/0x270 [hostess_sv11] @ 4024
[ 3162.508065] INFO: trying to register non-static key.
[ 3162.508986] the code is fine but needs lockdep annotation.
[ 3162.509026] turning off the locking correctness validator.
[ 3162.509026] CPU: 1 PID: 4024 Comm: modprobe Not tainted 4.19.0-rc7 #2
[ 3162.511877] Hardware name: Dell Inc. Inspiron 1318 /0C236D, BIOS A04 01/15/2009
[ 3162.511877] Call Trace:
[ 3162.511877] <IRQ>
[ 3162.511877] dump_stack+0x58/0x7d
[ 3162.511877] register_lock_class+0x4a3/0x4b0
[ 3162.511877] ? native_sched_clock+0x2f/0x110
[ 3162.511877] __lock_acquire.isra.26+0x46/0x770
[ 3162.511877] ? sched_clock+0x8/0x10
[ 3162.511877] lock_acquire+0x5c/0x80
[ 3162.511877] ? z8530_interrupt+0x35/0x180 [z85230]
[ 3162.511877] _raw_spin_lock+0x28/0x70
[ 3162.511877] ? z8530_interrupt+0x35/0x180 [z85230]
[ 3162.511877] z8530_interrupt+0x35/0x180 [z85230]
[ 3162.511877] __handle_irq_event_percpu+0x35/0xe0
[ 3162.511877] handle_irq_event_percpu+0x26/0x70
[ 3162.511877] handle_irq_event+0x29/0x42
[ 3162.511877] handle_fasteoi_irq+0x9b/0x170
[ 3162.511877] ? handle_simple_irq+0x90/0x90
[ 3162.511877] handle_irq+0xc3/0xee
[ 3162.511877] </IRQ>
[ 3162.511877] do_IRQ+0x51/0xe0
[ 3162.511877] common_interrupt+0xe7/0xec
[ 3162.511877] EIP: _raw_spin_unlock_irqrestore+0x24/0x50
[ 3162.511877] Code: 5b 5d c3 8d 76 00 55 89 e5 56 89 c6 83 c0 10 53 8b 4d 04 89 d3 ba 01 00 00 00 e8 17 14 9a ff 89 f0 e8 e0 4d 9a ff 89 d8 50 9d <66> 66 66 90 b8 01 00 00 00 e8 ee 89 97 ff 64 a1 ec 07 74 c7 85 c0
[ 3162.511877] EAX: 00000246 EBX: 00000246 ECX: 00000002 EDX: 00000058
[ 3162.511877] ESI: f400d8e4 EDI: 00000000 EBP: efbf9d74 ESP: efbf9d6c
[ 3162.511877] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 EFLAGS: 00000246
[ 3162.511877] __setup_irq+0x2f0/0x620
[ 3162.511877] request_threaded_irq+0xcd/0x170
[ 3162.511877] init_module+0xb0/0x270 [hostess_sv11]
[ 3162.511877] ? hostess_queue_xmit+0x20/0x20 [hostess_sv11]
[ 3162.511877] do_one_initcall+0x3e/0x15a
[ 3162.511877] ? __slab_alloc.isra.71.constprop.76+0x3a/0x50
[ 3162.511877] ? do_init_module+0x17/0x1d0
[ 3162.511877] ? kmem_cache_alloc+0x13f/0x190
[ 3162.511877] ? do_init_module+0x17/0x1d0
[ 3162.511877] do_init_module+0x46/0x1d0
[ 3162.511877] load_module+0x131f/0x14f0
[ 3162.511877] sys_finit_module+0x81/0xd0
[ 3162.511877] do_fast_syscall_32+0x89/0x1f0
[ 3162.511877] entry_SYSENTER_32+0x6b/0xbe
[ 3162.511877] EIP: 0xb7facd11
[ 3162.511877] Code: f6 ff ff 55 89 e5 8b 55 08 8b 80 5c cd ff ff 85 d2 74 02 89 02 5d c3 8b 04 24 c3 8b 1c 24 c3 90 90 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d 76 00 58 b8 77 00 00 00 cd 80 90 8d 76
[ 3162.511877] EAX: ffffffda EBX: 00000005 ECX: 0048834e EDX: 00000000
[ 3162.511877] ESI: 004a5870 EDI: 004a3470 EBP: 00000000 ESP: bfb9c32c
[ 3162.511877] DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 007b EFLAGS: 00000292
[ 3162.883280] systemd-journald[1693]: Sent WATCHDOG=1 notification.
[ 3162.511877] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3163.549994] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3164.034994] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3164.522999] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3165.007005] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3165.494999] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3165.978998] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3166.466999] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3166.951999] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3167.440000] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3167.924000] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3168.408002] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3168.895999] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3169.380000] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3169.868001] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3170.351999] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3170.836001] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3171.324988] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3171.810991] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3172.296991] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3172.781991] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3173.268002] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3173.753994] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3174.240002] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3174.725990] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3175.211999] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3175.697002] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3176.183999] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3176.668989] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3177.153986] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3177.640002] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3178.125993] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3178.612002] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3179.097993] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3179.584002] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3180.069994] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3180.556001] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3181.041986] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3181.528001] z85230: (null): interrupt jammed - abort(0xFF)!
[ 3182.013986] z85230: (null): interrupt jammed - abort(0xFF)!



then manual poweroff.

--
~Randy


2018-10-15 08:22:24

by Krzysztof Hałasa

[permalink] [raw]
Subject: Re: net/wan: hostess_sv11 + z85230 problems

Hi,

Randy Dunlap <[email protected]> writes:

> kernel 4.19-rc7, on i386, with NO wan/hdlc/hostess/z85230 hardware:
>
> modprobe hostess_sv11 + autoload of z85230 give:

BTW Hostess SV11 is apparently an ISA card, with all those problems.

> [ 3162.511877] Call Trace:
> [ 3162.511877] <IRQ>
> [ 3162.511877] dump_stack+0x58/0x7d
> [ 3162.511877] register_lock_class+0x4a3/0x4b0
> [ 3162.511877] ? native_sched_clock+0x2f/0x110
> [ 3162.511877] __lock_acquire.isra.26+0x46/0x770
> [ 3162.511877] ? sched_clock+0x8/0x10
> [ 3162.511877] lock_acquire+0x5c/0x80
> [ 3162.511877] ? z8530_interrupt+0x35/0x180 [z85230]
> [ 3162.511877] _raw_spin_lock+0x28/0x70
> [ 3162.511877] ? z8530_interrupt+0x35/0x180 [z85230]
> [ 3162.511877] z8530_interrupt+0x35/0x180 [z85230]
> [ 3162.511877] __handle_irq_event_percpu+0x35/0xe0
> [ 3162.511877] handle_irq_event_percpu+0x26/0x70
> [ 3162.511877] handle_irq_event+0x29/0x42
> [ 3162.511877] handle_fasteoi_irq+0x9b/0x170
> [ 3162.511877] ? handle_simple_irq+0x90/0x90
> [ 3162.511877] handle_irq+0xc3/0xee
> [ 3162.511877] </IRQ>
> [ 3162.511877] do_IRQ+0x51/0xe0
> [ 3162.511877] common_interrupt+0xe7/0xec

Look's like something triggered an IRQ, and the z8530 driver got
confused given the lack of z8530 hardware.

> [ 3162.511877] EAX: 00000246 EBX: 00000246 ECX: 00000002 EDX: 00000058
> [ 3162.511877] ESI: f400d8e4 EDI: 00000000 EBP: efbf9d74 ESP: efbf9d6c
> [ 3162.511877] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 EFLAGS: 00000246
> [ 3162.511877] __setup_irq+0x2f0/0x620
> [ 3162.511877] request_threaded_irq+0xcd/0x170
> [ 3162.511877] init_module+0xb0/0x270 [hostess_sv11]

I think the IRQ came as soon as it was requested (enabled).

Now the code does:
static struct z8530_dev *sv11_init(int iobase, int irq)
{
...
if (request_irq(irq, z8530_interrupt, 0,
"Hostess SV11", sv) < 0) {
pr_warn("IRQ %d already in use\n", irq);
goto err_irq;
}
...
disable_irq(irq);

and only then:
if (z8530_init(sv)) {
pr_err("Z8530 series device not found\n");
enable_irq(irq);
goto free_dma; (including free_irq())
}

Not sure about z8530 internals (driver and hw), but I guess the sv11
driver should initialize the hw first, and only then request_irq().
Perhaps there should be no "default address" either? The user would
have to provide the hardware parameters explicitly.

How about this (totally untested):
Fix the Hostess SV11 driver trying to use the hardware before its
existence is detected.

Signed-off-by: Krzysztof Halasa <[email protected]>

diff --git a/drivers/net/wan/hostess_sv11.c b/drivers/net/wan/hostess_sv11.c
index 4de0737fbf8a..e8808449c9e5 100644
--- a/drivers/net/wan/hostess_sv11.c
+++ b/drivers/net/wan/hostess_sv11.c
@@ -216,15 +216,6 @@ static struct z8530_dev *sv11_init(int iobase, int irq)

outb(0, iobase + 4); /* DMA off */

- /* We want a fast IRQ for this device. Actually we'd like an even faster
- IRQ ;) - This is one driver RtLinux is made for */
-
- if (request_irq(irq, z8530_interrupt, 0,
- "Hostess SV11", sv) < 0) {
- pr_warn("IRQ %d already in use\n", irq);
- goto err_irq;
- }
-
sv->irq = irq;
sv->chanA.private = sv;
sv->chanA.dev = sv;
@@ -246,17 +237,12 @@ static struct z8530_dev *sv11_init(int iobase, int irq)
goto err_rxdma;
}

- /* Kill our private IRQ line the hostess can end up chattering
- until the configuration is set */
- disable_irq(irq);
-
/*
* Begin normal initialise
*/

if (z8530_init(sv)) {
pr_err("Z8530 series device not found\n");
- enable_irq(irq);
goto free_dma;
}
z8530_channel_load(&sv->chanB, z8530_dead_port);
@@ -265,12 +251,6 @@ static struct z8530_dev *sv11_init(int iobase, int irq)
else
z8530_channel_load(&sv->chanA, z8530_hdlc_kilostream_85230);

- enable_irq(irq);
-
- /*
- * Now we can take the IRQ
- */
-
sv->chanA.netdevice = netdev = alloc_hdlcdev(sv);
if (!netdev)
goto free_dma;
@@ -288,9 +268,21 @@ static struct z8530_dev *sv11_init(int iobase, int irq)
}

z8530_describe(sv, "I/O", iobase);
+
+ /* We want a fast IRQ for this device. Actually we'd like an even faster
+ IRQ ;) - This is one driver RtLinux is made for */
+
+ if (request_irq(irq, z8530_interrupt, 0,
+ "Hostess SV11", sv) < 0) {
+ pr_warn("IRQ %d already in use\n", irq);
+ goto err_irq;
+ }
+
sv->active = 1;
return sv;

+err_irq:
+ unregister_hdlc_device(netdev);
free_dma:
if (dma == 1)
free_dma(sv->chanA.rxdma);
@@ -298,8 +290,6 @@ static struct z8530_dev *sv11_init(int iobase, int irq)
if (dma)
free_dma(sv->chanA.txdma);
err_txdma:
- free_irq(irq, sv);
-err_irq:
kfree(sv);
err_kzalloc:
release_region(iobase, 8);

--
Krzysztof Halasa

Industrial Research Institute for Automation and Measurements PIAP
Al. Jerozolimskie 202, 02-486 Warsaw, Poland

2018-10-15 10:30:16

by Alan Cox

[permalink] [raw]
Subject: Re: net/wan: hostess_sv11 + z85230 problems

On Mon, 15 Oct 2018 10:20:21 +0200
[email protected] (Krzysztof Hałasa) wrote:

> Hi,
>
> Randy Dunlap <[email protected]> writes:
>
> > kernel 4.19-rc7, on i386, with NO wan/hdlc/hostess/z85230 hardware:
> >
> > modprobe hostess_sv11 + autoload of z85230 give:
>
> BTW Hostess SV11 is apparently an ISA card, with all those problems.

Actually it worked perfectly well of old but people kept changing it
who didn't have hardware. Please just delete the driver instead of
pretending we can test it.

Nobody has one, even if they did there is no use for it as nobody runs
their internet over an old HDLC 64K link any more.

And we know since it's broken several ways by bit-rot that nobody uses it.

Alan

2018-10-15 12:42:25

by Krzysztof Hałasa

[permalink] [raw]
Subject: Re: net/wan: hostess_sv11 + z85230 problems

Alan Cox <[email protected]> writes:

>> BTW Hostess SV11 is apparently an ISA card, with all those problems.
>
> Actually it worked perfectly well of old but people kept changing it
> who didn't have hardware.

Right, that's the same with all of this hardware.

In fact I meant all the ISA problems (in comparison to e.g. PCI),
not of any particular design.
--
Krzysztof Halasa

Industrial Research Institute for Automation and Measurements PIAP
Al. Jerozolimskie 202, 02-486 Warsaw, Poland

2018-10-15 22:26:38

by Randy Dunlap

[permalink] [raw]
Subject: Re: net/wan: hostess_sv11 + z85230 problems

On 10/15/18 1:20 AM, Krzysztof Hałasa wrote:
> Hi,
>
> Randy Dunlap <[email protected]> writes:
>
>> kernel 4.19-rc7, on i386, with NO wan/hdlc/hostess/z85230 hardware:
>>
>> modprobe hostess_sv11 + autoload of z85230 give:
>
> BTW Hostess SV11 is apparently an ISA card, with all those problems.

Yeah.

>> [ 3162.511877] Call Trace:
...
>
> Not sure about z8530 internals (driver and hw), but I guess the sv11
> driver should initialize the hw first, and only then request_irq().
> Perhaps there should be no "default address" either? The user would
> have to provide the hardware parameters explicitly.
>
> How about this (totally untested):
> Fix the Hostess SV11 driver trying to use the hardware before its
> existence is detected.
>
> Signed-off-by: Krzysztof Halasa <[email protected]>

Tested-by: Randy Dunlap <[email protected]>

or you can just rm it, like Alan suggested.

thanks.
--
~Randy