Messages in this thread Patch in this message | | | Date | Thu, 21 Oct 2004 21:42:51 -0400 | From | Mark Lord <> | Subject | [patch 2.6.9-ac3] ide: fixes for 2.6.9-ac3 ide issues |
| |
The attached patch fixes two problems with 2.6.9-ac3:
1. restores the missing spin_unlock_irq() line, and 2. removes hwif from /proc/ide/ as part of __ide_unregister_hwif().
(and also removes a bogus compiler warning)
Signed-off-by: Mark Lord <lkml@rtr.ca> -- Mark Lord (hdparm keeper & the original "Linux IDE Guy") diff -u --recursive --new-file --exclude='.*' linux-2.6.9-ac3/drivers/ide/ide.c linux/drivers/ide/ide.c --- linux-2.6.9-ac3/drivers/ide/ide.c 2004-10-21 20:45:22.000000000 -0400 +++ linux/drivers/ide/ide.c 2004-10-21 21:28:54.000000000 -0400 @@ -862,7 +862,7 @@ int __ide_unregister_hwif(ide_hwif_t *hwif) { - ide_drive_t *drive; + ide_drive_t *drive = NULL; /* keep compiler happy */ ide_hwif_t *g; static ide_hwif_t tmp_hwif; /* protected by ide_cfg_sem */ ide_hwgroup_t *hwgroup; @@ -901,6 +901,7 @@ was_present = hwif->present; hwif->present = 0; + spin_unlock_irq(&ide_lock); up(&ide_setting_sem); for (unit = 0; unit < MAX_DRIVES; ++unit) { @@ -912,6 +913,7 @@ #ifdef CONFIG_PROC_FS destroy_proc_ide_drives(hwif); + destroy_proc_ide_interface(hwif); #endif spin_lock_irq(&ide_lock); diff -u --recursive --new-file --exclude='.*' linux-2.6.9-ac3/drivers/ide/ide-proc.c linux/drivers/ide/ide-proc.c --- linux-2.6.9-ac3/drivers/ide/ide-proc.c 2004-10-21 20:45:22.000000000 -0400 +++ linux/drivers/ide/ide-proc.c 2004-10-21 21:25:06.000000000 -0400 @@ -821,24 +821,30 @@ EXPORT_SYMBOL_GPL(ide_pci_create_host_proc); #endif +void destroy_proc_ide_interface(ide_hwif_t *hwif) +{ + int exist = (hwif->proc != NULL); +#if 0 + if (!hwif->present) + continue; +#endif + if (exist) { + destroy_proc_ide_drives(hwif); + ide_remove_proc_entries(hwif->proc, hwif_entries); + remove_proc_entry(hwif->name, proc_ide_root); + hwif->proc = NULL; + } +} + +EXPORT_SYMBOL(destroy_proc_ide_interface); + void destroy_proc_ide_interfaces(void) { int h; for (h = 0; h < MAX_HWIFS; h++) { ide_hwif_t *hwif = &ide_hwifs[h]; - int exist = (hwif->proc != NULL); -#if 0 - if (!hwif->present) - continue; -#endif - if (exist) { - destroy_proc_ide_drives(hwif); - ide_remove_proc_entries(hwif->proc, hwif_entries); - remove_proc_entry(hwif->name, proc_ide_root); - hwif->proc = NULL; - } else - continue; + destroy_proc_ide_interface(hwif); } } diff -u --recursive --new-file --exclude='.*' linux-2.6.9-ac3/include/linux/ide.h linux/include/linux/ide.h --- linux-2.6.9-ac3/include/linux/ide.h 2004-10-21 20:45:22.000000000 -0400 +++ linux/include/linux/ide.h 2004-10-21 21:27:39.000000000 -0400 @@ -1076,6 +1076,7 @@ extern void proc_ide_create(void); extern void proc_ide_destroy(void); extern void destroy_proc_ide_drives(ide_hwif_t *); +extern void destroy_proc_ide_interface(ide_hwif_t *); extern void create_proc_ide_interfaces(void); extern void ide_add_proc_entries(struct proc_dir_entry *, ide_proc_entry_t *, void *); extern void ide_remove_proc_entries(struct proc_dir_entry *, ide_proc_entry_t *); | |