All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: sd: Make sd_spinup_disk less noisy
@ 2021-09-11 12:11 Heiner Kallweit
  2021-09-11 21:38 ` Bart Van Assche
  2021-09-14  4:40 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Heiner Kallweit @ 2021-09-11 12:11 UTC (permalink / raw)
  To: Martin K. Petersen, James E.J. Bottomley
  Cc: SCSI development list, Christian Loehle

For my personal taste sd_spinup_disk() is a little bit noisy after
848ade90ba9c ("scsi: sd: Do not exit sd_spinup_disk() quietly").

scsi 0:0:0:0: Direct-Access     Multiple Card  Reader     1.00 PQ: 0 ANSI: 0
sd 0:0:0:0: Attached scsi generic sg0 type 0
sd 0:0:0:0: [sda] Media removed, stopped polling
sd 0:0:0:0: [sda] Media removed, stopped polling
sd 0:0:0:0: [sda] Attached SCSI removable disk
sd 0:0:0:0: [sda] Media removed, stopped polling

There's not really a benefit in printing the same message multiple
times. Therefore print it only if media_present was set before.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/scsi/sd.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index cbd9999f9..af7e7b0da 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2124,6 +2124,8 @@ sd_spinup_disk(struct scsi_disk *sdkp)
 		retries = 0;
 
 		do {
+			bool media_was_present = sdkp->media_present;
+
 			cmd[0] = TEST_UNIT_READY;
 			memset((void *) &cmd[1], 0, 9);
 
@@ -2138,7 +2140,8 @@ sd_spinup_disk(struct scsi_disk *sdkp)
 			 * with any more polling.
 			 */
 			if (media_not_present(sdkp, &sshdr)) {
-				sd_printk(KERN_NOTICE, sdkp, "Media removed, stopped polling\n");
+				if (media_was_present)
+					sd_printk(KERN_NOTICE, sdkp, "Media removed, stopped polling\n");
 				return;
 			}
 
-- 
2.33.0


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

* Re: [PATCH] scsi: sd: Make sd_spinup_disk less noisy
  2021-09-11 12:11 [PATCH] scsi: sd: Make sd_spinup_disk less noisy Heiner Kallweit
@ 2021-09-11 21:38 ` Bart Van Assche
  2021-09-14  4:40 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Bart Van Assche @ 2021-09-11 21:38 UTC (permalink / raw)
  To: Heiner Kallweit, Martin K. Petersen, James E.J. Bottomley
  Cc: SCSI development list, Christian Loehle

On 9/11/21 05:11, Heiner Kallweit wrote:
> For my personal taste sd_spinup_disk() is a little bit noisy after
> 848ade90ba9c ("scsi: sd: Do not exit sd_spinup_disk() quietly").

Reviewed-by: Bart Van Assche <bvanassche@acm.org>

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

* Re: [PATCH] scsi: sd: Make sd_spinup_disk less noisy
  2021-09-11 12:11 [PATCH] scsi: sd: Make sd_spinup_disk less noisy Heiner Kallweit
  2021-09-11 21:38 ` Bart Van Assche
@ 2021-09-14  4:40 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2021-09-14  4:40 UTC (permalink / raw)
  To: James E.J. Bottomley, Heiner Kallweit
  Cc: Martin K . Petersen, SCSI development list, Christian Loehle

On Sat, 11 Sep 2021 14:11:59 +0200, Heiner Kallweit wrote:

> For my personal taste sd_spinup_disk() is a little bit noisy after
> 848ade90ba9c ("scsi: sd: Do not exit sd_spinup_disk() quietly").
> 
> scsi 0:0:0:0: Direct-Access     Multiple Card  Reader     1.00 PQ: 0 ANSI: 0
> sd 0:0:0:0: Attached scsi generic sg0 type 0
> sd 0:0:0:0: [sda] Media removed, stopped polling
> sd 0:0:0:0: [sda] Media removed, stopped polling
> sd 0:0:0:0: [sda] Attached SCSI removable disk
> sd 0:0:0:0: [sda] Media removed, stopped polling
> 
> [...]

Applied to 5.15/scsi-fixes, thanks!

[1/1] scsi: sd: Make sd_spinup_disk less noisy
      https://git.kernel.org/mkp/scsi/c/4521428c4811

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2021-09-14  4:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-11 12:11 [PATCH] scsi: sd: Make sd_spinup_disk less noisy Heiner Kallweit
2021-09-11 21:38 ` Bart Van Assche
2021-09-14  4:40 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.