Re: [PATCH] set supported_mode for lots of llds

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 15 Sep 2007 23:07:10 -0400
Jeff Garzik <jeff@xxxxxxxxxx> wrote:

> FUJITA Tomonori wrote:
> > The majority of llds don't set supported_mode in scsi_host_template so
> > we get:
> > 
> > luce:/sys/class/scsi_host/host0$ cat supported_mode
> > unknown
> > 
> > It's harmless but it would be better to get:
> > 
> > luce:/sys/class/scsi_host/host0$ cat supported_mode
> > Initiator
> 
> Given that this is the /vast/ majority, just set it once as a default 
> value, and let target drivers change the mode if different.

I thought that it's a bit hacky but it should work.


From: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>
Subject: [PATCH] set supported_mode to MODE_INITIATOR by default

This sets supported_mode to MODE_INITIATOR if a lld doesn't set
supported_mode in scsi_host_template.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>
---
 drivers/scsi/hosts.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index adc9559..694015d 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -342,6 +342,10 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
 	shost->unchecked_isa_dma = sht->unchecked_isa_dma;
 	shost->use_clustering = sht->use_clustering;
 	shost->ordered_tag = sht->ordered_tag;
+
+	if (!sht->supported_mode)
+		sht->supported_mode = MODE_INITIATOR;
+
 	shost->active_mode = sht->supported_mode;
 
 	if (sht->max_host_blocked)
-- 
1.5.2.4

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux