All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: linux-scsi@vger.kernel.org
Subject: [PATCH 10/11] [SYM2] Report disabled devices and LUNs more attractively
Date: Tue, 29 Nov 2005 23:08:46 -0500 (EST)	[thread overview]
Message-ID: <20051130040846.E251F7626C@gonzo> (raw)
In-Reply-To: <20051130040537.GC1597@parisc-linux.org>

Rather than print a list of targets at driver init time, print each
disabled target as we attempt to scan it.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>

---

 drivers/scsi/sym53c8xx_2/sym_glue.c |   14 +++++++++++---
 drivers/scsi/sym53c8xx_2/sym_hipd.c |   30 ------------------------------
 2 files changed, 11 insertions(+), 33 deletions(-)

applies-to: 4ce895552fb045694ebbcf767bf85eeecaa6331a
2d9e3ce82a8a754cf84be377165dc7214944e55b
diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c
index cb3d195..1fffd2b 100644
--- a/drivers/scsi/sym53c8xx_2/sym_glue.c
+++ b/drivers/scsi/sym53c8xx_2/sym_glue.c
@@ -1018,6 +1018,7 @@ static int sym53c8xx_slave_alloc(struct 
 	if (sdev->id >= SYM_CONF_MAX_TARGET || sdev->lun >= SYM_CONF_MAX_LUN)
 		return -ENXIO;
 
+	tp->starget = sdev->sdev_target;
 	/*
 	 * Fail the device init if the device is flagged NOSCAN at BOOT in
 	 * the NVRAM.  This may speed up boot and maintain coherency with
@@ -1027,17 +1028,24 @@ static int sym53c8xx_slave_alloc(struct 
 	 * lun devices behave badly when asked for a non zero LUN.
 	 */
 
-	if ((tp->usrflags & SYM_SCAN_BOOT_DISABLED) ||
-	    ((tp->usrflags & SYM_SCAN_LUNS_DISABLED) && sdev->lun != 0)) {
+	if (tp->usrflags & SYM_SCAN_BOOT_DISABLED) {
 		tp->usrflags &= ~SYM_SCAN_BOOT_DISABLED;
+		starget_printk(KERN_INFO, tp->starget,
+				"Scan at boot disabled in NVRAM\n");
 		return -ENXIO;
 	}
 
+	if (tp->usrflags & SYM_SCAN_LUNS_DISABLED) {
+		if (sdev->lun != 0)
+			return -ENXIO;
+		starget_printk(KERN_INFO, tp->starget,
+				"Multiple LUNs disabled in NVRAM\n");
+	}
+
 	lp = sym_alloc_lcb(np, sdev->id, sdev->lun);
 	if (!lp)
 		return -ENOMEM;
 
-	tp->starget = sdev->sdev_target;
 	spi_min_period(tp->starget) = tp->usr_period;
 	spi_max_width(tp->starget) = tp->usr_width;
 
diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.c b/drivers/scsi/sym53c8xx_2/sym_hipd.c
index cea2bc6..1010e71 100644
--- a/drivers/scsi/sym53c8xx_2/sym_hipd.c
+++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c
@@ -616,29 +616,6 @@ static __inline void sym_init_burst(stru
 	}
 }
 
-
-/*
- * Print out the list of targets that have some flag disabled by user.
- */
-static void sym_print_targets_flag(struct sym_hcb *np, int mask, char *msg)
-{
-	int cnt;
-	int i;
-
-	for (cnt = 0, i = 0 ; i < SYM_CONF_MAX_TARGET ; i++) {
-		if (i == np->myaddr)
-			continue;
-		if (np->target[i].usrflags & mask) {
-			if (!cnt++)
-				printf("%s: %s disabled for targets",
-					sym_name(np), msg);
-			printf(" %d", i);
-		}
-	}
-	if (cnt)
-		printf(".\n");
-}
-
 /*
  *  Save initial settings of some IO registers.
  *  Assumed to have been set by BIOS.
@@ -986,13 +963,6 @@ static int sym_prepare_setting(struct Sc
 			sym_name(np), np->rv_scntl3, np->rv_dmode, np->rv_dcntl,
 			np->rv_ctest3, np->rv_ctest4, np->rv_ctest5);
 	}
-	/*
-	 *  Let user be aware of targets that have some disable flags set.
-	 */
-	sym_print_targets_flag(np, SYM_SCAN_BOOT_DISABLED, "SCAN AT BOOT");
-	if (sym_verbose)
-		sym_print_targets_flag(np, SYM_SCAN_LUNS_DISABLED,
-				       "SCAN FOR LUNS");
 
 	return 0;
 }
---
0.99.9.GIT

  parent reply	other threads:[~2005-11-30  4:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-30  4:05 [PATCH 0/11] sym2 version 2.2.2 Matthew Wilcox
2005-11-30  4:08 ` [PATCH 1/11] [SYM2] Remove FreeBSD ifdefs Matthew Wilcox
2005-11-30  4:08 ` [PATCH 2/11] [SYM2] Remove last vestiges of sym_sniff_inquiry Matthew Wilcox
2005-11-30  4:08 ` [PATCH 3/11] [SYM2] Manage sym_lcb properly Matthew Wilcox
2005-11-30  4:08 ` [PATCH 4/11] [SYM2] Remove code to handle DMA_BIDIRECTION requests Matthew Wilcox
2005-11-30  4:08 ` [PATCH 5/11] [SYM2] Use DMA_40BIT_MASK constant Matthew Wilcox
2005-11-30  4:08 ` [PATCH 6/11] [SYM2] Disable IU and QAS negotiation Matthew Wilcox
2005-11-30  4:08 ` [PATCH 7/11] [SYM2] Negotiate correctly with async-only devices Matthew Wilcox
2005-11-30  4:08 ` [PATCH 8/11] [SYM2] Use scsi_print_msg Matthew Wilcox
2005-11-30  4:08 ` [PATCH 9/11] [SYM2] Allow NVRAM settings to limit speed and width Matthew Wilcox
2005-11-30  4:08 ` Matthew Wilcox [this message]
2005-11-30  4:08 ` [PATCH 11/11] [SYM2] Version 2.2.2 Matthew Wilcox

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=20051130040846.E251F7626C@gonzo \
    --to=matthew@wil.cx \
    --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 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.