From: Chuck Ebbert <76306.1226@compuserve.com>
To: linux-scsi <linux-scsi@vger.kernel.org>
Subject: [Patch 2.6] sd.c spinup messages
Date: Wed, 9 Jun 2004 19:48:27 -0400 [thread overview]
Message-ID: <200406091950_MC3-1-8463-F129@compuserve.com> (raw)
With an empty Iomega USB Powered Zip 250 drive and kernel 2.6.6,
I get this in the syslog on bootup:
Jun 9 14:38:42 d2 kernel: usb 1-1: new full speed USB device using address 2
Jun 9 14:38:42 d2 kernel: scsi1 : SCSI emulation for USB Mass Storage devices
Jun 9 14:38:42 d2 kernel: Vendor: IOMEGA Model: ZIP 250 Rev: 61.T
Jun 9 14:38:42 d2 kernel: Type: Direct-Access ANSI SCSI revision: 02
Jun 9 14:38:42 d2 kernel: sda: Spinning up disk....<6>EXT3 FS on hde3, internal journal
Jun 9 14:38:42 d2 kernel: Adding 524152k swap on /dev/hdg2. Priority:-1 extents:1
Jun 9 14:38:42 d2 kernel: Adding 524152k swap on /dev/hde2. Priority:-2 extents:1
Jun 9 14:38:42 d2 kernel: .<5>Attached scsi removable disk sda at scsi1, channel 0, id 0, lun 0
Jun 9 14:38:42 d2 kernel: Attached scsi generic sg1 at scsi1, channel 0, id 0, lun 0, type 0
Jun 9 14:38:42 d2 kernel: kjournald starting. Commit interval 5 seconds
Code in sd.c:sd_spinup_disk is looping and calling printk(".") while
waiting for the disk to spin up. Then it detects media not present
and the function just exits, leaving an incomplete line in the buffer.
Meanwhile other messages get mixed in.
I fixed it so it prints only whole-line messages and emits a
media-not-present message if it printed a spinup message earlier:
Jun 9 16:42:06 d2 kernel: usb 1-1: new full speed USB device using address 2
Jun 9 16:42:06 d2 kernel: scsi1 : SCSI emulation for USB Mass Storage devices
Jun 9 16:42:06 d2 kernel: Vendor: IOMEGA Model: ZIP 250 Rev: 61.T
Jun 9 16:42:06 d2 kernel: Type: Direct-Access ANSI SCSI revision: 02
Jun 9 16:42:06 d2 kernel: sda: Spinning up disk...
Jun 9 16:42:06 d2 kernel: EXT3 FS on hde3, internal journal
Jun 9 16:42:06 d2 kernel: Adding 524152k swap on /dev/hdg2. Priority:-1 extents:1
Jun 9 16:42:06 d2 kernel: Adding 524152k swap on /dev/hde2. Priority:-2 extents:1
Jun 9 16:42:06 d2 kernel: sda: No media present
Jun 9 16:42:06 d2 kernel: Attached scsi removable disk sda at scsi1, channel 0, id 0, lun 0
Jun 9 16:42:06 d2 kernel: Attached scsi generic sg1 at scsi1, channel 0, id 0, lun 0, type 0
Jun 9 16:42:06 d2 kernel: kjournald starting. Commit interval 5 seconds
And with media present:
Jun 9 17:52:46 d2 kernel: usb 1-1: new full speed USB device using address 2
Jun 9 17:52:46 d2 kernel: scsi1 : SCSI emulation for USB Mass Storage devices
Jun 9 17:52:46 d2 kernel: Vendor: IOMEGA Model: ZIP 250 Rev: 61.T
Jun 9 17:52:46 d2 kernel: Type: Direct-Access ANSI SCSI revision: 02
Jun 9 17:52:46 d2 kernel: sda: Spinning up disk...
Jun 9 17:52:46 d2 kernel: EXT3 FS on hde3, internal journal
Jun 9 17:52:46 d2 kernel: Adding 524152k swap on /dev/hdg2. Priority:-1 extents:1
Jun 9 17:52:46 d2 kernel: Adding 524152k swap on /dev/hde2. Priority:-2 extents:1
Jun 9 17:52:46 d2 kernel: kjournald starting. Commit interval 5 seconds
((( Snip 15 lines of ext3 mount messages )))
Jun 9 17:52:46 d2 kernel: sda: Drive ready
Jun 9 17:52:46 d2 kernel: SCSI device sda: 196608 512-byte hdwr sectors (101 MB)
Jun 9 17:52:46 d2 kernel: sda: assuming Write Enabled
Jun 9 17:52:46 d2 kernel: sda: assuming drive cache: write through
Jun 9 17:52:46 d2 kernel: sda: sda4
Jun 9 17:52:46 d2 kernel: Attached scsi removable disk sda at scsi1, channel 0, id 0, lun 0
Jun 9 17:52:46 d2 kernel: Attached scsi generic sg1 at scsi1, channel 0, id 0, lun 0, type 0
Patch:
--- 266.0/drivers/scsi/sd.c 2004-06-09 15:26:49.000000000 -0400
+++ 266.1/drivers/scsi/sd.c 2004-06-09 16:37:21.000000000 -0400
@@ -847,8 +847,11 @@ sd_spinup_disk(struct scsi_disk *sdkp, c
* any media in it, don't bother with any of the rest of
* this crap.
*/
- if (media_not_present(sdkp, SRpnt))
+ if (media_not_present(sdkp, SRpnt)) {
+ if (spintime)
+ printk(KERN_NOTICE "%s: No media present\n", diskname);
return;
+ }
if ((driver_byte(the_result) & DRIVER_SENSE) == 0) {
/* no sense, TUR either succeeded or failed
@@ -880,7 +883,7 @@ sd_spinup_disk(struct scsi_disk *sdkp, c
} else if (SRpnt->sr_sense_buffer[2] == NOT_READY) {
unsigned long time1;
if (!spintime) {
- printk(KERN_NOTICE "%s: Spinning up disk...",
+ printk(KERN_NOTICE "%s: Spinning up disk...\n",
diskname);
cmd[0] = START_STOP;
cmd[1] = 1; /* Return immediately */
@@ -903,7 +906,6 @@ sd_spinup_disk(struct scsi_disk *sdkp, c
current->state = TASK_UNINTERRUPTIBLE;
time1 = schedule_timeout(time1);
} while(time1);
- printk(".");
} else {
/* we don't understand the sense code, so it's
* probably pointless to loop */
@@ -917,12 +919,10 @@ sd_spinup_disk(struct scsi_disk *sdkp, c
} while (spintime &&
time_after(spintime_value + 100 * HZ, jiffies));
- if (spintime) {
- if (scsi_status_is_good(the_result))
- printk("ready\n");
- else
- printk("not responding...\n");
- }
+ if (spintime)
+ printk(KERN_NOTICE "%s: Drive %s\n", diskname,
+ scsi_status_is_good(the_result) ? "ready" : "not responding!");
+
}
/*
next reply other threads:[~2004-06-09 23:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-09 23:48 Chuck Ebbert [this message]
2004-06-24 22:02 ` [Patch 2.6] sd.c spinup messages James Bottomley
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=200406091950_MC3-1-8463-F129@compuserve.com \
--to=76306.1226@compuserve.com \
--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