[parisc-linux-cvs] [Patch] 2.6.9-rc4-pa3: fix HIL panic on boot
with 2.6.9-rc4-pa2 (crash due to HP SDC MLC)
Helge Deller
deller at gmx.de
Wed Oct 13 15:05:36 MDT 2004
On Wednesday 13 October 2004 23:02, Helge Deller wrote:
> CVSROOT: /var/cvs
> Module name: linux-2.6
> Changes by: deller 04/10/13 15:02:49
>
> Modified files:
> . : Makefile
> include/linux : hil_mlc.h
> drivers/input/serio: hil_mlc.c
>
> Log message:
> 2.6.9-rc4-pa3: fix HIL panic on boot with 2.6.9-rc4-pa2 (crash due to HP SDC MLC)
-------------- next part --------------
Index: Makefile
===================================================================
RCS file: /var/cvs/linux-2.6/Makefile,v
retrieving revision 1.268
diff -u -p -r1.268 Makefile
--- Makefile 12 Oct 2004 01:07:01 -0000 1.268
+++ Makefile 13 Oct 2004 20:58:01 -0000
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 9
-EXTRAVERSION = -rc4-pa2
+EXTRAVERSION = -rc4-pa3
NAME=Zonked Quokka
# *DOCUMENTATION*
Index: include/linux/hil_mlc.h
===================================================================
RCS file: /var/cvs/linux-2.6/include/linux/hil_mlc.h,v
retrieving revision 1.7
diff -u -p -r1.7 hil_mlc.h
--- include/linux/hil_mlc.h 8 Sep 2003 22:00:28 -0000 1.7
+++ include/linux/hil_mlc.h 13 Oct 2004 20:58:02 -0000
@@ -153,7 +153,7 @@ struct hil_mlc {
int di_map[7]; /* Maps below items to live devs */
struct hil_mlc_devinfo di[HIL_MLC_DEVMEM];
- struct serio serio[HIL_MLC_DEVMEM];
+ struct serio *serio[HIL_MLC_DEVMEM];
struct hil_mlc_serio_map serio_map[HIL_MLC_DEVMEM];
hil_packet serio_opacket[HIL_MLC_DEVMEM];
int serio_oidx[HIL_MLC_DEVMEM];
Index: drivers/input/serio/hil_mlc.c
===================================================================
RCS file: /var/cvs/linux-2.6/drivers/input/serio/hil_mlc.c,v
retrieving revision 1.9
diff -u -p -r1.9 hil_mlc.c
--- drivers/input/serio/hil_mlc.c 1 Oct 2004 20:09:02 -0000 1.9
+++ drivers/input/serio/hil_mlc.c 13 Oct 2004 20:58:04 -0000
@@ -153,7 +153,7 @@ static void hil_mlc_send_polls(hil_mlc *
i = cnt = 0;
did = (mlc->ipacket[0] & HIL_PKT_ADDR_MASK) >> 8;
- serio = did ? &(mlc->serio[mlc->di_map[did - 1]]) : NULL;
+ serio = did ? mlc->serio[mlc->di_map[did - 1]] : NULL;
drv = (serio != NULL) ? serio->drv : NULL;
while (mlc->icount < 15 - i) {
@@ -168,7 +168,7 @@ static void hil_mlc_send_polls(hil_mlc *
drv->interrupt(serio, HIL_CMD_POL + cnt, 0, NULL);
skip:
did = (p & HIL_PKT_ADDR_MASK) >> 8;
- serio = did ? &(mlc->serio[mlc->di_map[did-1]]) : NULL;
+ serio = did ? mlc->serio[mlc->di_map[did-1]] : NULL;
drv = (serio != NULL) ? serio->drv : NULL;
cnt = 0;
}
@@ -229,7 +229,7 @@ static int hilse_match(hil_mlc *mlc, int
mlc->di_map[mlc->ddi] = rc;
mlc->serio_map[rc].di_revmap = mlc->ddi;
hil_mlc_clean_serio_map(mlc);
- serio_rescan(mlc->serio + rc);
+ serio_rescan(mlc->serio[rc]);
return -1;
}
mlc->di_map[mlc->ddi] = rc;
@@ -868,19 +868,22 @@ int hil_mlc_register(hil_mlc *mlc) {
hil_mlc_clear_di_scratch(mlc);
hil_mlc_clear_di_map(mlc, 0);
for (i = 0; i < HIL_MLC_DEVMEM; i++) {
+ struct serio *mlc_serio;
hil_mlc_copy_di_scratch(mlc, i);
- memset(&(mlc->serio[i]), 0, sizeof(mlc->serio[0]));
- mlc->serio[i].type = SERIO_HIL | SERIO_HIL_MLC;
- mlc->serio[i].write = hil_mlc_serio_write;
- mlc->serio[i].open = hil_mlc_serio_open;
- mlc->serio[i].close = hil_mlc_serio_close;
- mlc->serio[i].port_data = &(mlc->serio_map[i]);
+ mlc_serio = kmalloc(sizeof(*mlc_serio), GFP_KERNEL);
+ mlc->serio[i] = mlc_serio;
+ memset(mlc_serio, 0, sizeof(*mlc_serio));
+ mlc_serio->type = SERIO_HIL | SERIO_HIL_MLC;
+ mlc_serio->write = hil_mlc_serio_write;
+ mlc_serio->open = hil_mlc_serio_open;
+ mlc_serio->close = hil_mlc_serio_close;
+ mlc_serio->port_data = &(mlc->serio_map[i]);
mlc->serio_map[i].mlc = mlc;
mlc->serio_map[i].didx = i;
mlc->serio_map[i].di_revmap = -1;
mlc->serio_opacket[i] = 0;
mlc->serio_oidx[i] = 0;
- serio_register_port(&(mlc->serio[i]));
+ serio_register_port(mlc_serio);
}
mlc->tasklet = &hil_mlcs_tasklet;
@@ -918,8 +921,10 @@ int hil_mlc_unregister(hil_mlc *mlc) {
write_unlock_irqrestore(&hil_mlcs_lock, flags);
MOD_DEC_USE_COUNT;
- for (i = 0; i < HIL_MLC_DEVMEM; i++)
- serio_unregister_port(&(mlc->serio[i]));
+ for (i = 0; i < HIL_MLC_DEVMEM; i++) {
+ serio_unregister_port(mlc->serio[i]);
+ mlc->serio[i] = NULL;
+ }
tasklet_schedule(&hil_mlcs_tasklet);
return 0;
More information about the parisc-linux-cvs
mailing list