android_kernel_xiaomi_sm8350/drivers/s390/cio
Cornelia Huck f26fd5d6e5 [S390] cio: Fix driver_data handling for ccwgroup devices.
Since 16f7f9564c, we've seen
oopses when grouping/ungrouping devices:

Unable to handle kernel pointer dereference at virtual kernel address 0000000000
114000
Oops: 0004 [#1] PREEMPT SMP
Modules linked in: bonding qeth_l2 dm_multipath sunrpc qeth_l3 dm_mod qeth chsc_
sch ccwgroup
CPU: 1 Not tainted 2.6.26-29.x.20080815-s390xdefault #1
Process iperf (pid: 24412, task: 000000003f446038, ksp: 000000003c929e08)
Krnl PSW : 0404d00180000000 000003e00006f6e6 (qeth_irq+0xda/0xb28 [qeth])
           R:0 T:1 IO:0 EX:0 Key:0 M:1 W:0 P:0 AS:3 CC:1 PM:0 EA:3
Krnl GPRS: 0000000000000000 000003e000000003 0000000000000000 0000000000114ccc
           000000003fb82e48 000003e00006f60c 000000000000000c 000000003ce72100
           0000000000114944 000000003fb82e48 0000000000114ccc 000000003fe8fd28
           000003e000066000 000003e000076128 000000003fe8fdb8 000000003fe8fd28
Krnl Code: 000003e00006f6da: bf3f2024            icm     %r3,15,36(%r2)
           000003e00006f6de: a774023c            brc     7,3e00006fb56
           000003e00006f6e2: a7280000            lhi     %r2,0
          >000003e00006f6e6: 5020a1a0            st      %r2,416(%r10)
           000003e00006f6ea: 58109000            l       %r1,0(%r9)
           000003e00006f6ee: a7111000            tmll    %r1,4096
           000003e00006f6f2: a77400f9            brc     7,3e00006f8e4
           000003e00006f6f6: 8810000c            srl     %r1,12
Call Trace:
([<000000003fe8fd20>] 0x3fe8fd20)
 [<000000000033bf2a>] ccw_device_call_handler+0xb2/0xd8
 [<0000000000339e1c>] ccw_device_irq+0x124/0x164
 [<0000000000339758>] io_subchannel_irq+0x8c/0x118
 [<00000000003309ba>] do_IRQ+0x192/0x1bc
 [<0000000000114f66>] io_return+0x0/0x8
 [<00000000001149cc>] sysc_do_svc+0x0/0x22
([<0000000000114a18>] sysc_noemu+0x10/0x16)
 [<00000200002e047c>] 0x200002e047c
Last Breaking-Event-Address:
 [<000003e00006f6d6>] qeth_irq+0xca/0xb28 [qeth]

The problem is that dev->driver_data for a ccw device is NULL,
while it should point to the ccwgroup device it is a member of.
This happened due to incorrect cleanup if creating a ccwgroup
device failed because the ccw devices were already grouped.

Fix this by setting cdev[i] to NULL in the error handling of
ccwgroup_create_from_string() after we give up our reference and
by checking if the driver_data points to the ccwgroup device in
ccwgroup_release() just to be really sure.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-09-16 09:34:31 -07:00
..
airq.c [S390] cio: Allow adapter interrupt handlers per isc. 2008-07-14 10:02:10 +02:00
blacklist.c
blacklist.h
ccwgroup.c [S390] cio: Fix driver_data handling for ccwgroup devices. 2008-09-16 09:34:31 -07:00
chp.c [S390] cio: Correct cleanup on error. 2008-09-09 12:39:07 +02:00
chp.h [S390] cio: Repair chpid event handling. 2008-07-14 10:02:11 +02:00
chsc_sch.c [S390] cio: Add chsc subchannel driver. 2008-07-14 10:02:12 +02:00
chsc_sch.h [S390] cio: Add chsc subchannel driver. 2008-07-14 10:02:12 +02:00
chsc.c [S390] cio: Export chsc_error_from_response(). 2008-07-17 17:22:10 +02:00
chsc.h [S390] cio: Export chsc_error_from_response(). 2008-07-17 17:22:10 +02:00
cio_debug.h
cio.c [S390] cio: handle ssch() return codes correctly. 2008-09-09 12:39:07 +02:00
cio.h [S390] cio: Add chsc subchannel driver. 2008-07-14 10:02:12 +02:00
cmf.c [S390] Cleanup cio printk messages. 2008-07-14 10:02:18 +02:00
css.c [S390] cio: Correct cleanup on error. 2008-09-09 12:39:07 +02:00
css.h [S390] cio: Add chsc subchannel driver. 2008-07-14 10:02:12 +02:00
device_fsm.c [S390] cio: allow offline processing for disconnected devices 2008-09-09 12:39:07 +02:00
device_id.c [S390] cio: provide functions for fcx enabled I/O 2008-07-14 10:02:08 +02:00
device_ops.c [S390] cio: provide functions for fcx enabled I/O 2008-07-14 10:02:08 +02:00
device_pgid.c [S390] cio: provide functions for fcx enabled I/O 2008-07-14 10:02:08 +02:00
device_status.c [S390] cio: introduce fcx enabled scsw format 2008-07-14 10:02:07 +02:00
device.c [S390] cio: call ccw driver notify function with lock held 2008-08-21 19:46:41 +02:00
device.h [S390] cio: call ccw driver notify function with lock held 2008-08-21 19:46:41 +02:00
fcx.c [S390] cio: provide functions for fcx enabled I/O 2008-07-14 10:02:08 +02:00
idset.c [S390] cio: Memory allocation for idset changed. 2008-08-01 16:39:31 +02:00
idset.h [S390] cio: Add chsc subchannel driver. 2008-07-14 10:02:12 +02:00
io_sch.h [S390] cio: Add chsc subchannel driver. 2008-07-14 10:02:12 +02:00
ioasm.h [S390] cio: Add chsc subchannel driver. 2008-07-14 10:02:12 +02:00
isc.c [S390] cio: introduce isc_(un)register functions. 2008-07-14 10:02:11 +02:00
itcw.c [S390] cio: provide helper functions for fcx enabled I/O 2008-07-14 10:02:08 +02:00
Makefile [S390] qdio: new qdio driver. 2008-07-17 17:22:10 +02:00
qdio_debug.c [S390] qdio: new qdio driver. 2008-07-17 17:22:10 +02:00
qdio_debug.h [S390] qdio: improve s390 debug feature usage 2008-08-21 19:46:40 +02:00
qdio_main.c [S390] qdio: remove the module_get & module_put pair 2008-08-21 19:46:40 +02:00
qdio_perf.c [S390] qdio: fix section mismatch bug. 2008-08-01 16:39:35 +02:00
qdio_perf.h [S390] qdio: new qdio driver. 2008-07-17 17:22:10 +02:00
qdio_setup.c [S390] qdio: improve s390 debug feature usage 2008-08-21 19:46:40 +02:00
qdio_thinint.c [S390] qdio: prevent oopsing if qdio_establish fails 2008-08-21 19:46:39 +02:00
qdio.h [S390] qdio: new qdio driver. 2008-07-17 17:22:10 +02:00
scsw.c [S390] cio: introduce fcx enabled scsw format 2008-07-14 10:02:07 +02:00