linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Anderson <andmike@us.ibm.com>
To: linux-scsi@vger.kernel.org
Cc: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@suse.de>
Subject: [PATCH] reorder call in scsi_remove_host
Date: Mon, 16 Aug 2004 13:18:35 -0700	[thread overview]
Message-ID: <20040816201835.GA2179@us.ibm.com> (raw)

This patch against scsi-misc-2.6 reorders a call to scsi_forget_host in
the scsi_remove_host function. This removes the error message
"Synchronizing SCSI cache..." on rmmod of a scsi host driver module as
shown in example output 1 and 2 below.

I had previous created a much more complicated patch to work around this
problem. In response Christoph mention a simpler solution (pointer to
thread below) which is this patch.

http://marc.theaimsgroup.com/?l=linux-scsi&m=108720042210331&w=2

Example output.

1.) Before patch.

elm:~# scsi1 : scsi_debug, version 1.73 [20040518], dev_size_mb=8,
opts=0x0
  Vendor: Linux     Model: scsi_debug        Rev: 0004
  Type:   Direct-Access                      ANSI SCSI revision: 03
SCSI device sdc: 16384 512-byte hdwr sectors (8 MB)
SCSI device sdc: drive cache: write back
 sdc: unknown partition table
Attached scsi disk sdc at scsi1, channel 0, id 0, lun 0
Attached scsi generic sg4 at scsi1, channel 0, id 0, lun 0,  type 0
Synchronizing SCSI cache for disk sdc: <4>FAILED
  status = 0, message = 00, host = 1, driver = 00

2.) After patch.

elm:~# scsi1 : scsi_debug, version 1.73 [20040518], dev_size_mb=8, opts=0x0
  Vendor: Linux     Model: scsi_debug        Rev: 0004
  Type:   Direct-Access                      ANSI SCSI revision: 03
SCSI device sdc: 16384 512-byte hdwr sectors (8 MB)
SCSI device sdc: drive cache: write back
 sdc: unknown partition table
Attached scsi disk sdc at scsi1, channel 0, id 0, lun 0
Attached scsi generic sg4 at scsi1, channel 0, id 0, lun 0,  type 0
Synchronizing SCSI cache for disk sdc:

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


DESC
Reorder call to scsi_forget_host in scsi_remove_host function.

Signed-off-by: Mike Anderson <andmike@us.ibm.com>
EDESC


 patched-scsi-misc-2.6-andmike/drivers/scsi/hosts.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/scsi/hosts.c~scsi_forget_host drivers/scsi/hosts.c
--- patched-scsi-misc-2.6/drivers/scsi/hosts.c~scsi_forget_host	Wed Aug 11 17:33:46 2004
+++ patched-scsi-misc-2.6-andmike/drivers/scsi/hosts.c	Wed Aug 11 17:35:07 2004
@@ -75,9 +75,9 @@ void scsi_host_cancel(struct Scsi_Host *
  **/
 void scsi_remove_host(struct Scsi_Host *shost)
 {
+	scsi_forget_host(shost);
 	scsi_host_cancel(shost, 0);
 	scsi_proc_host_rm(shost);
-	scsi_forget_host(shost);
 
 	set_bit(SHOST_DEL, &shost->shost_state);
 

                 reply	other threads:[~2004-08-16 20:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20040816201835.GA2179@us.ibm.com \
    --to=andmike@us.ibm.com \
    --cc=axboe@suse.de \
    --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;
as well as URLs for NNTP newsgroup(s).