Skip to contentSkip to conversation

cciss: add shutdown support (replaces reboot notifier)

PATCH In review Mike Miller (OS Dev) 5 participants 8 messages Feb 22, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 cciss: add shutdown support (replaces reboot notifier)

Patch 2/2

This adds support for struct pci_driver shutdown and negates the previous NAK'ed reboot_notifier patch. It's much easier, wish I had know about this before. Thanks to Christoph for pointing this out.

------------------------------------------------------------------------------------------

drivers/block/cciss.c +5 -3
index 916aab0..1abf1f5 100644
@@ -3428,9 +3428,10 @@ static void __devexit cciss_remove_one(s
 	memset(flush_buf, 0, 4);
 	return_code = sendcmd(CCISS_CACHE_FLUSH, i, flush_buf, 4, 0, 0, 0, NULL,
 			      TYPE_CMD);
-	if (return_code != IO_OK) {
-		printk(KERN_WARNING "Error Flushing cache on controller %d\n",
-		       i);
+	if (return_code = IO_OK) {
+		printk(KERN_WARNING "Completed cache flush on controller %d\n", i);
+	} else {
+		printk(KERN_WARNING "Error Flushing cache on controller %d\n", i);
 	}
 	free_irq(hba[i]->intr[2], hba[i]);
 
@@ -3481,6 +3482,7 @@ static struct pci_driver cciss_pci_drive
 	.probe = cciss_init_one,
 	.remove = __devexit_p(cciss_remove_one),
 	.id_table = cciss_pci_device_id,	/* id_table */
+	.shutdown = cciss_remove_one,
 };
 
 /*
#1 lore raw
Quoted 5 lines · Mike Miller (OS Dev)

Patch 2/2

This adds support for struct pci_driver shutdown and negates the previous NAK'ed reboot_notifier patch. It's much easier, wish I had know about this before. Thanks to Christoph for pointing this out.

Just sondering, where should we have put information about this so driver writers/maintainers like you would have found it easily?

#2 lore raw
Quoted 10 lines · Christoph Hellwig
Quoted 5 lines · Mike Miller (OS Dev)

Patch 2/2

This adds support for struct pci_driver shutdown and negates the previous NAK'ed reboot_notifier patch. It's much easier, wish I had know about this before. Thanks to Christoph for pointing this out.

Just sondering, where should we have put information about this so driver writers/maintainers like you would have found it easily?

Excellent question. I wish I had a good answer. It's pretty difficult to monitor everything going on, especially when I also have to consider HP's schedule and those of our partners.

-- mikem

#3 lore raw
Quoted 8 lines · Mike Miller (OS Dev)
Quoted 7 lines · Christoph Hellwig
Quoted 5 lines · Mike Miller (OS Dev)

Patch 2/2

This adds support for struct pci_driver shutdown and negates the previous NAK'ed reboot_notifier patch. It's much easier, wish I had know about this before. Thanks to Christoph for pointing this out.

Quoted 6 lines
Quoted 3 lines

Just sondering, where should we have put information about this so driver writers/maintainers like you would have found it easily?

Excellent question. I wish I had a good answer. It's pretty difficult to monitor everything going on, especially when I also have to consider HP's schedule and those of our partners.

It is properly documented in Documentation/pci.txt as to how to do this...

thanks,

greg k-h

#4 lore raw
In reply to Mike Miller (OS Dev)
Quoted 3 lines · Mike Miller (OS Dev)

.remove = __devexit_p(cciss_remove_one),
.id_table = cciss_pci_device_id, /* id_table */
+ .shutdown = cciss_remove_one,

You need a __devexit_p() wrapper for this one too.

James

#5 lore raw
Quoted 6 lines · James Bottomley
Quoted 3 lines · Mike Miller (OS Dev)

.remove = __devexit_p(cciss_remove_one),
.id_table = cciss_pci_device_id, /* id_table */
+ .shutdown = cciss_remove_one,

You need a __devexit_p() wrapper for this one too.

No. We want to call this even in the non-modular, non-hotplug case. So we should remove __devexit from cciss_remove_one. Or alternatively implement a separate cciss_shutdown that just does the nessecary cache flushing, like most other drivers do.

#6 lore raw
Quoted 6 lines · Christoph Hellwig
Quoted 5 lines · James Bottomley
Quoted 3 lines · Mike Miller (OS Dev)

.remove = __devexit_p(cciss_remove_one),
.id_table = cciss_pci_device_id, /* id_table */
+ .shutdown = cciss_remove_one,

Quoted 6 lines
Quoted 1 line

You need a __devexit_p() wrapper for this one too.

No. We want to call this even in the non-modular, non-hotplug case. So we should remove __devexit from cciss_remove_one. Or alternatively implement a separate cciss_shutdown that just does the nessecary cache flushing, like most other drivers do.

So if I remove __devexit from cciss_init_one do I also remove the __devexit_p wrapper from the remove method?

-- mikem

#7 lore raw
In reply to Mike Miller (OS Dev)

drivers/block/cciss.c static void __devexit cciss_remove_one(s · line 3431

Quoted 1 line · Mike Miller (OS Dev)
drivers/block/cciss.c +1 -0
+	if (return_code = IO_OK) {

Shouldn't that be ==

Quoted 5 lines
drivers/block/cciss.c +3 -0
+		printk(KERN_WARNING "Completed cache flush on controller %d\n", i);
+	} else {
+		printk(KERN_WARNING "Error Flushing cache on controller %d\n", i);
 	}
 	free_irq(hba[i]->intr[2], hba[i]);