public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Anderson <andmike@us.ibm.com>
To: Christoph Hellwig <hch@lst.de>
Cc: James.Bottomley@steeleye.com, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] introduce scsi_host_alloc
Date: Thu, 5 Jun 2003 13:50:10 -0700	[thread overview]
Message-ID: <20030605205010.GD2154@beaverton.ibm.com> (raw)
In-Reply-To: <20030603203243.GA9018@lst.de>

I ran your series of patches. The ips driver was missed in your updates I
attached the patch below. David Jeffery may want a wrapper for 2.4/2.5
compatibility.

Christoph Hellwig [hch@lst.de] wrote:
> Currently this is juist a new name for scsi_register, but we make
> sure new-style drivers never call scsi_register/scsi_unregister
> but always scsi_host_alloc/scsi_host_put in this patch so the
> next patch can introduce code specific to legacy drivers in
> the former.  Also cleanup scsi_register/scsi_host_alloc a bit.
> 
> 
> +
> +	shost->host_no = scsi_host_next_hn++; /* XXX(hch): still racy */
>

We could move the host_no to scsi_sysfs_init_host and use the
class->subsys.rwsem to protect this.


-andmike
--
Michael Anderson
andmike@us.ibm.com

 drivers/scsi/ips.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff -puN drivers/scsi/ips.c~ips_scsi_alloc_fix drivers/scsi/ips.c
--- hch-scsi-misc-2.5/drivers/scsi/ips.c~ips_scsi_alloc_fix	Thu Jun  5 00:12:53 2003
+++ hch-scsi-misc-2.5-andmike/drivers/scsi/ips.c	Thu Jun  5 00:14:28 2003
@@ -725,7 +725,7 @@ ips_release(struct Scsi_Host *sh) {
    free_irq(ha->irq, ha);
 
    IPS_REMOVE_HOST(sh);
-   scsi_unregister(sh);
+   scsi_host_put(sh);
 
    ips_released_controllers++;
 
@@ -6732,7 +6732,7 @@ static int
 ips_register_scsi( int index){
 	struct Scsi_Host *sh;
 	ips_ha_t *ha, *oldha = ips_ha[index];
-	sh = scsi_register(&ips_driver_template, sizeof(ips_ha_t));
+	sh = scsi_host_alloc(&ips_driver_template, sizeof(ips_ha_t));
 	if(!sh) {
 		IPS_PRINTK(KERN_WARNING, oldha->pcidev, "Unable to register controller with SCSI subsystem\n");
 		return -1;
@@ -6743,7 +6743,7 @@ ips_register_scsi( int index){
 	/* Install the interrupt handler with the new ha */
 	if (request_irq(ha->irq, do_ipsintr, SA_SHIRQ, ips_name, ha)) {
 		IPS_PRINTK(KERN_WARNING, ha->pcidev, "Unable to install interrupt handler\n" );
-		scsi_unregister(sh);
+		scsi_host_put(sh);
 		return -1;
 	}
 

_


  reply	other threads:[~2003-06-05 20:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-03 20:32 [PATCH] introduce scsi_host_alloc Christoph Hellwig
2003-06-05 20:50 ` Mike Anderson [this message]
2003-06-05 21:24   ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2003-06-06  8:01 Christoph Hellwig
2003-06-06 11:40 ` Jamie Lenehan
2003-06-06 11:43   ` Christoph Hellwig
2003-06-06 20:24 ` Luben Tuikov
2003-06-06 20:30   ` Luben Tuikov
2003-06-06 20:42   ` Christoph Hellwig
2003-06-06 23:20     ` Luben Tuikov
2003-06-07  6:44       ` Christoph Hellwig
2003-06-07 18:55         ` Luben Tuikov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030605205010.GD2154@beaverton.ibm.com \
    --to=andmike@us.ibm.com \
    --cc=James.Bottomley@steeleye.com \
    --cc=hch@lst.de \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox