LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [Patch 2/2] cciss: add shutdown support (replaces reboot notifier)
@ 2007-02-22 21:38 Mike Miller (OS Dev)
  2007-02-22 21:45 ` Christoph Hellwig
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Mike Miller (OS Dev) @ 2007-02-22 21:38 UTC (permalink / raw)
  To: akpm, jens.axboe; +Cc: linux-kernel, linux-scsi, gregkh, hch

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.

Signed-off-by: Mike Miller <mike.miller@hp.com>
------------------------------------------------------------------------------------------
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 916aab0..1abf1f5 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -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,
 };
 
 /*

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Patch 2/2] cciss: add shutdown support (replaces reboot notifier)
  2007-02-22 21:38 [Patch 2/2] cciss: add shutdown support (replaces reboot notifier) Mike Miller (OS Dev)
@ 2007-02-22 21:45 ` Christoph Hellwig
  2007-02-22 21:56   ` Mike Miller (OS Dev)
  2007-02-22 21:49 ` James Bottomley
  2007-02-22 21:50 ` scott.ashcroft
  2 siblings, 1 reply; 8+ messages in thread
From: Christoph Hellwig @ 2007-02-22 21:45 UTC (permalink / raw)
  To: Mike Miller (OS Dev)
  Cc: akpm, jens.axboe, linux-kernel, linux-scsi, gregkh, hch

On Thu, Feb 22, 2007 at 03:38:45PM -0600, Mike Miller (OS Dev) wrote:
> 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?


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Patch 2/2] cciss: add shutdown support (replaces reboot notifier)
  2007-02-22 21:38 [Patch 2/2] cciss: add shutdown support (replaces reboot notifier) Mike Miller (OS Dev)
  2007-02-22 21:45 ` Christoph Hellwig
@ 2007-02-22 21:49 ` James Bottomley
  2007-02-22 21:55   ` Christoph Hellwig
  2007-02-22 21:50 ` scott.ashcroft
  2 siblings, 1 reply; 8+ messages in thread
From: James Bottomley @ 2007-02-22 21:49 UTC (permalink / raw)
  To: Mike Miller (OS Dev)
  Cc: akpm, jens.axboe, linux-kernel, linux-scsi, gregkh, hch

On Thu, 2007-02-22 at 15:38 -0600, Mike Miller (OS Dev) wrote:
>         .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



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Patch 2/2] cciss: add shutdown support (replaces reboot notifier)
  2007-02-22 21:38 [Patch 2/2] cciss: add shutdown support (replaces reboot notifier) Mike Miller (OS Dev)
  2007-02-22 21:45 ` Christoph Hellwig
  2007-02-22 21:49 ` James Bottomley
@ 2007-02-22 21:50 ` scott.ashcroft
  2 siblings, 0 replies; 8+ messages in thread
From: scott.ashcroft @ 2007-02-22 21:50 UTC (permalink / raw)
  To: Mike Miller (OS Dev)
  Cc: akpm, jens.axboe, linux-kernel, linux-scsi, gregkh, hch

Mike Miller (OS Dev) wrote:
> +	if (return_code = IO_OK) {

Shouldn't that be ==

> +		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]);


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Patch 2/2] cciss: add shutdown support (replaces reboot notifier)
  2007-02-22 21:49 ` James Bottomley
@ 2007-02-22 21:55   ` Christoph Hellwig
  2007-02-22 22:38     ` Mike Miller (OS Dev)
  0 siblings, 1 reply; 8+ messages in thread
From: Christoph Hellwig @ 2007-02-22 21:55 UTC (permalink / raw)
  To: James Bottomley
  Cc: Mike Miller (OS Dev),
	akpm, jens.axboe, linux-kernel, linux-scsi, gregkh, hch

On Thu, Feb 22, 2007 at 03:49:38PM -0600, James Bottomley wrote:
> On Thu, 2007-02-22 at 15:38 -0600, Mike Miller (OS Dev) wrote:
> >         .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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Patch 2/2] cciss: add shutdown support (replaces reboot notifier)
  2007-02-22 21:45 ` Christoph Hellwig
@ 2007-02-22 21:56   ` Mike Miller (OS Dev)
  2007-02-22 23:08     ` Greg KH
  0 siblings, 1 reply; 8+ messages in thread
From: Mike Miller (OS Dev) @ 2007-02-22 21:56 UTC (permalink / raw)
  To: Christoph Hellwig, akpm, jens.axboe, linux-kernel, linux-scsi, gregkh

On Thu, Feb 22, 2007 at 09:45:02PM +0000, Christoph Hellwig wrote:
> On Thu, Feb 22, 2007 at 03:38:45PM -0600, Mike Miller (OS Dev) wrote:
> > 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Patch 2/2] cciss: add shutdown support (replaces reboot notifier)
  2007-02-22 21:55   ` Christoph Hellwig
@ 2007-02-22 22:38     ` Mike Miller (OS Dev)
  0 siblings, 0 replies; 8+ messages in thread
From: Mike Miller (OS Dev) @ 2007-02-22 22:38 UTC (permalink / raw)
  To: Christoph Hellwig, James Bottomley, akpm, jens.axboe,
	linux-kernel, linux-scsi, gregkh

On Thu, Feb 22, 2007 at 09:55:01PM +0000, Christoph Hellwig wrote:
> On Thu, Feb 22, 2007 at 03:49:38PM -0600, James Bottomley wrote:
> > On Thu, 2007-02-22 at 15:38 -0600, Mike Miller (OS Dev) wrote:
> > >         .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.

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

-- mikem

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Patch 2/2] cciss: add shutdown support (replaces reboot notifier)
  2007-02-22 21:56   ` Mike Miller (OS Dev)
@ 2007-02-22 23:08     ` Greg KH
  0 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2007-02-22 23:08 UTC (permalink / raw)
  To: Mike Miller (OS Dev)
  Cc: Christoph Hellwig, akpm, jens.axboe, linux-kernel, linux-scsi

On Thu, Feb 22, 2007 at 03:56:11PM -0600, Mike Miller (OS Dev) wrote:
> On Thu, Feb 22, 2007 at 09:45:02PM +0000, Christoph Hellwig wrote:
> > On Thu, Feb 22, 2007 at 03:38:45PM -0600, Mike Miller (OS Dev) wrote:
> > > 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. 

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

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-02-22 23:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-22 21:38 [Patch 2/2] cciss: add shutdown support (replaces reboot notifier) Mike Miller (OS Dev)
2007-02-22 21:45 ` Christoph Hellwig
2007-02-22 21:56   ` Mike Miller (OS Dev)
2007-02-22 23:08     ` Greg KH
2007-02-22 21:49 ` James Bottomley
2007-02-22 21:55   ` Christoph Hellwig
2007-02-22 22:38     ` Mike Miller (OS Dev)
2007-02-22 21:50 ` scott.ashcroft

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).