Andrew asked that I provide a status report of pending updates. The
list is attached below. It's pretty much driver updates and minor bug
fixes. The main functionality changes are Kay's sysfs updates and the
shift of the ULD attachement towards the block prep function.
James
---
Adrian Bunk (2):
make scsi_decode_sense_buffer and scsi_decode_sense_extras static
scsi_error.c should #include "scsi_transport_api.h"
Alan Cox (3):
dtc: Fix typo
eata_pio: Clean up proc handling, bracketing and use cpu_relax()
dtc: clean up indent damage and add printk levels
Andrew Morton (3):
ips: warning fix
aacraid: rename check_reset
bsg: declare structures for the non BSG case
Andrew Vasquez (15):
qla2xxx: Update version number to 8.02.00-k4.
qla2xxx: Limit iIDMA speed adjustments.
qla2xxx: Rework MSI-X handlers.
qla2xxx: Clear options-flags while staging firmware-execution.
qla2xxx: Sparse cleanups in qla_mid.c
qla2xxx: Cleanup several 'sparse' warnings.
qla2xxx: Use shost_priv().
qla2xxx: Remove unused member (list) from srb_t structure.
qla2xxx: Use the correct pointer-address during NVRAM writes.
qla2xxx: Set correct attribute count during FDMI RPA.
qla2xxx: Query additional RISC registers during ISP25XX firmware dump.
qla2xxx: Correct staging of RISC while attempting to pause.
qla2xxx: Query additional RISC information during a pause.
qla2xxx: Add flash burst-read/write support.
qla2xxx: Collapse and simplify ISP2XXX firmware dump routines.
Bartlomiej Zolnierkiewicz (1):
MAINTAINERS: mark ide-scsi as Orphan
Bernhard Walle (1):
ips: Update version information
Boaz Harrosh (2):
ide-scsi.: convert to data accessors and !use_sg cleanup
microtek: use data accessors and !use_sg cleanup
Christof Schmitt (5):
zfcp: Enable debug feature before setting adapter online
scsi_transport_fc: Introduce disable_target_scan flag
zfcp: Remove braces for only one statement
zfcp: Remove unnecessary assignment
zfcp: correct indentation for nested if-else
David Miller (1):
esp: fix instance numbering.
David Woodhouse (1):
Fix ibmvscsi client for multiplatform iSeries+pSeries kernel
Eric Moore (10):
MAINTAINERS : mpt fusion mailing list change
mpt fusion: bump version to 3.04.06
mpt fusion: Kconfig cleanup
mpt fusion: removing Dell copyright
mpt fusion: removing references to hd->ioc
mpt fusion: rename vdev to vdevice
mpt fusion: adding/removing white space
mpt fusion: standardize printks and debug info
mpt fusion: Add support for ATTO 4LD: Rebranded LSI 53C1030
Addition to pci_ids.h for ATTO Technology, Inc.
FUJITA Tomonori (17):
srp_transport: convert to use supported_mode attribute
fc_transport: add target driver support
add supported_mode and active_mode attributes to the host
tgt: fix can_queue bug
fc4: convert to use the data buffer accessors
sg: increase sglist_len of the sg_scatter_hold structure
ps3rom: convert to use the data buffer accessors
scsi_transport_srp: remove tgt dependencies
tgt: convert ibmvstgt to use transport tsk_mgmt_response callback
tgt: move tsk_mgmt_response callback to transport class
tgt: convert libsrp and ibmvstgt to use srp_transport
srp_transport: add target driver support
tgt: add I_T nexus support
transport_srp: add rport roles attribute
ib_srp: convert to use the srp transport class
ibmvscsi: convert to use the srp transport class
add srp transport class
Gabriel C (1):
NCR5380: fix NCR53C400_PSEUDO_DMA is not defined
Gilbert Wu (1):
aic94xx: Add new PCI ID for ASC58300
Heiko Carstens (3):
zfcp: avoid if (whatever) ; constructs.
zfcp: allocate gid_pn_data objects from gid_pn_cache.
zfcp: fix memory leak.
HighPoint Linux Team (1):
hptiop: adding new firmware interface and more PCI device IDs
James Bottomley (3):
sg: use idr to replace static arrays
move ULD attachment into the prep function
arcmsr: fix compile problems
Jan Engelhardt (1):
mpt fusion: Use menuconfig objects
Jeff Garzik (2):
arcmsr: irq handler fixes, cleanups, micro-opts
arcmsr: Fix hardware wait loops
Jesper Juhl (3):
mpt fusion: fix two potential mem leaks
NCR_D700, lpfc: Clean up duplicate includes
lpfc: fix potential overflow of hbqs array
Joe Carnuccio (1):
qla2xxx: Allow region-based flash-part accesses.
Kay Sievers (1):
switch sdev sysfs attributes to default attributes
Mariusz Kozlowski (3):
mpt fusion: remove redundant memset
mpt fusion: mostly kmalloc + memset conversion to kzalloc
kmalloc + memset conversion to kzalloc
Masatake YAMATO (1):
Fix signness of parameters in scsi module
Matthew Wilcox (49):
ips: Close narrow race in release
aic94xx: Free scsi host on error
simscsi: Free scsi host on error
qlogicfas: Close narrow race in release
aha152x: Close narrow race in release
ncr53c8xx: Call scsi_host_put in release
ide-scsi: Close narrow race in release
ibmmca: Stop leaking scsi_hosts on exit
scsi_scan: Cope with kthread_run failing
Improve error message when offlining a device
advansys: Use DRV_NAME
advansys: Comment/indentation/macro cleanup
advansys: Remove some custom wrappers
advansys: Remove a check for an impossible condition
advansys: Support 16-byte commands properly
advansys: Enable interrupts earlier in queuecommand
advansys: Remove `active' queue and all remaining internal queueing code
advansys: Remove `done' queue
advansys: Remove a check for an impossible condition
advansys: Remove `waiting' queue
advansys: Shrink advansys_board_found a little more
advansys: Reformat microcode
advansys: Create AdvLoadMicrocode
advansys: Create AdvBuildCarrierFreelist
advansys: Fix VLB driver name
advansys: Move documentation to Documentation/scsi
advansys: use memcpy instead of open-coded loop
advansys: Remove pci_slot_info
advansys: Remove library-style callback routines
advansys: Move struct device out of the cfg structures
advansys: Stop using n_io_port in Scsi_Host structure
advansys: ioremap no longer needs page-aligned addresses
advansys: delete AscGetChipBusType
advansys: misc reformatting
advansys: remove INQUIRY sniffing
Add QUANTUM XP34301 to the blacklist
advansys: remove AscCompareString()
advansys: More PCI cleanups
advansys: Update resource management
advansys: Convert to ISA driver model
advansys: Convert to EISA driver model
advansys: Convert to PCI driver model
advansys: Move to scsi hotplug initialisation model
advansys: Make advansys_board_found a little more readable
advansys: Stop checking the scsi_cmnd belongs to our Scsi_Host
advansys: Improve interrupt handler
advansys: Clean up proc_info implementation
advansys: undate version, copyright, etc
Fix async scanning double-add problems
Matthias Kaehlcke (1):
osst: Use mutex instead of semaphore
Michael Reed (1):
stale residual returned on write following BUSY retry
Mike Christie (1):
fix write buffer length in scsi_req_map_sg()
Nick Cheng (1):
arcmsr: 1.20.00.15: add SATA RAID plus other fixes
Prakash, Sathya (5):
mpt fusion: Change company name from LSI Logic to LSI
mpt fusion: Link speed change display support
mpt fusion: Creation of mptsas.h header file
mpt fusion: Change call back indices to u8 from int
mpt fusion: Usage of high priority request FIFO to send task management commands
Ravi Anand (1):
qla2xxx: Correct infinite-login-retry issue.
Salyzyn, Mark (1):
aacraid: Add documentation for new Adaptec, SMC and SUN cards
Seokmann Ju (2):
qla2xxx: Retrieve max-NPIV support capabilities from FW.
qla2xxx: Add PCI error recovery support.
Swen Schillig (2):
zfcp: whitespace cleanup
zfcp: cleanup, separation of ERP, non ERP-version for exchange_ functions
From: James Bottomley <[email protected]>
Date: Tue, 25 Sep 2007 20:00:02 -0500
> David Miller (1):
> esp: fix instance numbering.
I'd like to request that this one goes into 2.6.23 as
it is a bug fix and the bug confuses users.
Thanks.
On Tue, 25 Sep 2007 20:00:02 -0500
James Bottomley <[email protected]> wrote:
> Andrew asked that I provide a status report of pending updates. The
> list is attached below. It's pretty much driver updates and minor bug
> fixes. The main functionality changes are Kay's sysfs updates and the
> shift of the ULD attachement towards the block prep function.
Can we make new 'supporrted_mode' and 'active_mode' attributes look
better?
http://marc.info/?l=linux-scsi&m=118991196128245&w=2
On Wed, 2007-09-26 at 10:28 +0900, FUJITA Tomonori wrote:
> On Tue, 25 Sep 2007 20:00:02 -0500
> James Bottomley <[email protected]> wrote:
>
> > Andrew asked that I provide a status report of pending updates. The
> > list is attached below. It's pretty much driver updates and minor bug
> > fixes. The main functionality changes are Kay's sysfs updates and the
> > shift of the ULD attachement towards the block prep function.
>
> Can we make new 'supporrted_mode' and 'active_mode' attributes look
> better?
>
> http://marc.info/?l=linux-scsi&m=118991196128245&w=2
Sure, but Jeff's suggestion was a good one to avoid me having to change
hundreds of files. Could you roll it up and resubmit?
James
On Tue, 25 Sep 2007 20:42:35 -0500
James Bottomley <[email protected]> wrote:
> On Wed, 2007-09-26 at 10:28 +0900, FUJITA Tomonori wrote:
> > On Tue, 25 Sep 2007 20:00:02 -0500
> > James Bottomley <[email protected]> wrote:
> >
> > > Andrew asked that I provide a status report of pending updates. The
> > > list is attached below. It's pretty much driver updates and minor bug
> > > fixes. The main functionality changes are Kay's sysfs updates and the
> > > shift of the ULD attachement towards the block prep function.
> >
> > Can we make new 'supporrted_mode' and 'active_mode' attributes look
> > better?
> >
> > http://marc.info/?l=linux-scsi&m=118991196128245&w=2
>
> Sure, but Jeff's suggestion was a good one to avoid me having to change
> hundreds of files. Could you roll it up and resubmit?
This can be cleanly applied to scsi-misc.
-
From: FUJITA Tomonori <[email protected]>
Subject: [PATCH] set supported_mode to MODE_INITIATOR by default
This sets supported_mode to MODE_INITIATOR if a lld doesn't specify
supported_mode in scsi_host_template.
Signed-off-by: FUJITA Tomonori <[email protected]>
---
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
FUJITA Tomonori wrote:
> 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;
I almost hesitate to speak up, after making the original suggestion, but:
Are there any const-ness worries for scsi_host_template, or plans for
the future? I do not see any other examples of the host template
members getting modified.
Perhaps this value should instead be mirrored in scsi_host, like many
others?
Jeff
On Tue, Sep 25, 2007 at 10:37:33PM -0400, Jeff Garzik wrote:
> Are there any const-ness worries for scsi_host_template, or plans for
> the future? I do not see any other examples of the host template
> members getting modified.
Goodness, Jeff, you haven't looked too hard. There's dozens of examples
I've come across trawling the horrible unmaintained drivers. I'd love
to see scsi_host_template become const, but it's not happening any time
soon, and we can address this little piece when the time comes.
--
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
Matthew Wilcox wrote:
> On Tue, Sep 25, 2007 at 10:37:33PM -0400, Jeff Garzik wrote:
>> Are there any const-ness worries for scsi_host_template, or plans for
>> the future? I do not see any other examples of the host template
>> members getting modified.
>
> Goodness, Jeff, you haven't looked too hard. There's dozens of examples
> I've come across trawling the horrible unmaintained drivers. I'd love
> to see scsi_host_template become const, but it's not happening any time
> soon, and we can address this little piece when the time comes.
Well, sure, the driver is the owner of that memory.
We're talking about common code.
If everybody agrees SHT is R/W in the core, Fujita-san's patch is fine.
Jeff
On Tue, Sep 25, 2007 at 11:34:00PM -0400, Jeff Garzik wrote:
> Well, sure, the driver is the owner of that memory.
>
> We're talking about common code.
>
> If everybody agrees SHT is R/W in the core, Fujita-san's patch is fine.
Oh ... harder to find, but scsi_module.c does that, as does
scsi_register/scsi_unregister. OK, those are legacy, but they still
exist today.
--
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
On Tue, 25 Sep 2007 22:37:33 -0400
Jeff Garzik <[email protected]> wrote:
> FUJITA Tomonori wrote:
> > 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;
>
>
> I almost hesitate to speak up, after making the original suggestion, but:
>
> Are there any const-ness worries for scsi_host_template, or plans for
> the future? I do not see any other examples of the host template
> members getting modified.
Yeah, that's why I said it's hacky in the previous
discussion. Changing scsi_host_template behind llds is not nice, I
think.
> Perhaps this value should instead be mirrored in scsi_host, like
> many others?
supported_mode should be static like 'name'. I'm not sure about having
supported_mode in scsi_host. All the scsi_hosts of one driver always
use the same supported_mode value unlike active_mode.
On Tue, 2007-09-25 at 23:34 -0400, Jeff Garzik wrote:
> Matthew Wilcox wrote:
> > On Tue, Sep 25, 2007 at 10:37:33PM -0400, Jeff Garzik wrote:
> >> Are there any const-ness worries for scsi_host_template, or plans for
> >> the future? I do not see any other examples of the host template
> >> members getting modified.
> >
> > Goodness, Jeff, you haven't looked too hard. There's dozens of examples
> > I've come across trawling the horrible unmaintained drivers. I'd love
> > to see scsi_host_template become const, but it's not happening any time
> > soon, and we can address this little piece when the time comes.
>
> Well, sure, the driver is the owner of that memory.
>
> We're talking about common code.
>
> If everybody agrees SHT is R/W in the core, Fujita-san's patch is fine.
Well, I don't like mucking with the template either.
This whole mess is generated basically because the zero default of the
template should be treated as initiator. How about this, which makes
that manifest?
James
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index adc9559..7e26440 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -342,7 +342,11 @@ 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;
- shost->active_mode = sht->supported_mode;
+ if (sht->supported_mode == MODE_UNKNOWN)
+ /* means we didn't set it ... default to INITIATOR */
+ shost->active_mode = MODE_INITIATOR;
+ else
+ shost->active_mode = sht->supported_mode;
if (sht->max_host_blocked)
shost->max_host_blocked = sht->max_host_blocked;
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index 0088c4d..4965e9e 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -209,11 +209,13 @@ show_shost_mode(unsigned int mode, char *buf)
static ssize_t show_shost_supported_mode(struct class_device *class_dev, char *buf)
{
struct Scsi_Host *shost = class_to_shost(class_dev);
+ unsigned int supported_mode = shost->hostt->supported_mode;
- if (shost->hostt->supported_mode == MODE_UNKNOWN)
- return snprintf(buf, 20, "unknown\n");
- else
- return show_shost_mode(shost->hostt->supported_mode, buf);
+ if (supported_mode == MODE_UNKNOWN)
+ /* by default this should be initiator */
+ supported_mode = MODE_INITIATOR;
+
+ return show_shost_mode(shost->hostt->supported_mode, buf);
}
static CLASS_DEVICE_ATTR(supported_mode, S_IRUGO | S_IWUSR, show_shost_supported_mode, NULL);
James Bottomley wrote:
> This whole mess is generated basically because the zero default of the
> template should be treated as initiator. How about this, which makes
> that manifest?
>
> James
>
> diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
> index adc9559..7e26440 100644
> --- a/drivers/scsi/hosts.c
> +++ b/drivers/scsi/hosts.c
> @@ -342,7 +342,11 @@ 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;
> - shost->active_mode = sht->supported_mode;
> + if (sht->supported_mode == MODE_UNKNOWN)
> + /* means we didn't set it ... default to INITIATOR */
> + shost->active_mode = MODE_INITIATOR;
> + else
> + shost->active_mode = sht->supported_mode;
>
> if (sht->max_host_blocked)
> shost->max_host_blocked = sht->max_host_blocked;
> diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
> index 0088c4d..4965e9e 100644
> --- a/drivers/scsi/scsi_sysfs.c
> +++ b/drivers/scsi/scsi_sysfs.c
> @@ -209,11 +209,13 @@ show_shost_mode(unsigned int mode, char *buf)
> static ssize_t show_shost_supported_mode(struct class_device *class_dev, char *buf)
> {
> struct Scsi_Host *shost = class_to_shost(class_dev);
> + unsigned int supported_mode = shost->hostt->supported_mode;
>
> - if (shost->hostt->supported_mode == MODE_UNKNOWN)
> - return snprintf(buf, 20, "unknown\n");
> - else
> - return show_shost_mode(shost->hostt->supported_mode, buf);
> + if (supported_mode == MODE_UNKNOWN)
> + /* by default this should be initiator */
> + supported_mode = MODE_INITIATOR;
> +
> + return show_shost_mode(shost->hostt->supported_mode, buf);
> }
>
> static CLASS_DEVICE_ATTR(supported_mode, S_IRUGO | S_IWUSR, show_shost_supported_mode, NULL);
ACK
On Tue, 25 Sep 2007 22:45:53 -0500
James Bottomley <[email protected]> wrote:
> On Tue, 2007-09-25 at 23:34 -0400, Jeff Garzik wrote:
> > Matthew Wilcox wrote:
> > > On Tue, Sep 25, 2007 at 10:37:33PM -0400, Jeff Garzik wrote:
> > >> Are there any const-ness worries for scsi_host_template, or plans for
> > >> the future? I do not see any other examples of the host template
> > >> members getting modified.
> > >
> > > Goodness, Jeff, you haven't looked too hard. There's dozens of examples
> > > I've come across trawling the horrible unmaintained drivers. I'd love
> > > to see scsi_host_template become const, but it's not happening any time
> > > soon, and we can address this little piece when the time comes.
> >
> > Well, sure, the driver is the owner of that memory.
> >
> > We're talking about common code.
> >
> > If everybody agrees SHT is R/W in the core, Fujita-san's patch is fine.
>
> Well, I don't like mucking with the template either.
>
> This whole mess is generated basically because the zero default of the
> template should be treated as initiator. How about this, which makes
> that manifest?
But how can we handle dual-mode drivers?
luce:/sys/class/scsi_host/host0$ cat supported_mode
Initiator, Target
The values are not enumerated. They are like FC_PORT_ROLE.
On Wed, 2007-09-26 at 12:55 +0900, FUJITA Tomonori wrote:
> On Tue, 25 Sep 2007 22:45:53 -0500
> James Bottomley <[email protected]> wrote:
>
> > On Tue, 2007-09-25 at 23:34 -0400, Jeff Garzik wrote:
> > > Matthew Wilcox wrote:
> > > > On Tue, Sep 25, 2007 at 10:37:33PM -0400, Jeff Garzik wrote:
> > > >> Are there any const-ness worries for scsi_host_template, or plans for
> > > >> the future? I do not see any other examples of the host template
> > > >> members getting modified.
> > > >
> > > > Goodness, Jeff, you haven't looked too hard. There's dozens of examples
> > > > I've come across trawling the horrible unmaintained drivers. I'd love
> > > > to see scsi_host_template become const, but it's not happening any time
> > > > soon, and we can address this little piece when the time comes.
> > >
> > > Well, sure, the driver is the owner of that memory.
> > >
> > > We're talking about common code.
> > >
> > > If everybody agrees SHT is R/W in the core, Fujita-san's patch is fine.
> >
> > Well, I don't like mucking with the template either.
> >
> > This whole mess is generated basically because the zero default of the
> > template should be treated as initiator. How about this, which makes
> > that manifest?
>
> But how can we handle dual-mode drivers?
>
> luce:/sys/class/scsi_host/host0$ cat supported_mode
> Initiator, Target
>
>
> The values are not enumerated. They are like FC_PORT_ROLE.
Any driver that does other than the default INITIATOR has to set it in
the template. The code only defaults zero (which is what the templates
get if its unset) to MODE_INITIATOR.
James
On Tue, 25 Sep 2007 23:01:53 -0500
James Bottomley <[email protected]> wrote:
> On Wed, 2007-09-26 at 12:55 +0900, FUJITA Tomonori wrote:
> > On Tue, 25 Sep 2007 22:45:53 -0500
> > James Bottomley <[email protected]> wrote:
> >
> > > On Tue, 2007-09-25 at 23:34 -0400, Jeff Garzik wrote:
> > > > Matthew Wilcox wrote:
> > > > > On Tue, Sep 25, 2007 at 10:37:33PM -0400, Jeff Garzik wrote:
> > > > >> Are there any const-ness worries for scsi_host_template, or plans for
> > > > >> the future? I do not see any other examples of the host template
> > > > >> members getting modified.
> > > > >
> > > > > Goodness, Jeff, you haven't looked too hard. There's dozens of examples
> > > > > I've come across trawling the horrible unmaintained drivers. I'd love
> > > > > to see scsi_host_template become const, but it's not happening any time
> > > > > soon, and we can address this little piece when the time comes.
> > > >
> > > > Well, sure, the driver is the owner of that memory.
> > > >
> > > > We're talking about common code.
> > > >
> > > > If everybody agrees SHT is R/W in the core, Fujita-san's patch is fine.
> > >
> > > Well, I don't like mucking with the template either.
> > >
> > > This whole mess is generated basically because the zero default of the
> > > template should be treated as initiator. How about this, which makes
> > > that manifest?
> >
> > But how can we handle dual-mode drivers?
> >
> > luce:/sys/class/scsi_host/host0$ cat supported_mode
> > Initiator, Target
> >
> >
> > The values are not enumerated. They are like FC_PORT_ROLE.
>
> Any driver that does other than the default INITIATOR has to set it in
> the template. The code only defaults zero (which is what the templates
> get if its unset) to MODE_INITIATOR.
Oh yeah, the patch is fine.
I just wanted to say that supported_mode/active_mode are designed not
to be enumerated and we can't just set INITIATOR to zero and TARGET to
non-zero.
On Tue, 25 Sep 2007 22:45:53 -0500
James Bottomley <[email protected]> wrote:
> On Tue, 2007-09-25 at 23:34 -0400, Jeff Garzik wrote:
> > Matthew Wilcox wrote:
> > > On Tue, Sep 25, 2007 at 10:37:33PM -0400, Jeff Garzik wrote:
> > >> Are there any const-ness worries for scsi_host_template, or plans for
> > >> the future? I do not see any other examples of the host template
> > >> members getting modified.
> > >
> > > Goodness, Jeff, you haven't looked too hard. There's dozens of examples
> > > I've come across trawling the horrible unmaintained drivers. I'd love
> > > to see scsi_host_template become const, but it's not happening any time
> > > soon, and we can address this little piece when the time comes.
> >
> > Well, sure, the driver is the owner of that memory.
> >
> > We're talking about common code.
> >
> > If everybody agrees SHT is R/W in the core, Fujita-san's patch is fine.
>
> Well, I don't like mucking with the template either.
>
> This whole mess is generated basically because the zero default of the
> template should be treated as initiator. How about this, which makes
> that manifest?
>
> James
>
> diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
> index adc9559..7e26440 100644
> --- a/drivers/scsi/hosts.c
> +++ b/drivers/scsi/hosts.c
> @@ -342,7 +342,11 @@ 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;
> - shost->active_mode = sht->supported_mode;
> + if (sht->supported_mode == MODE_UNKNOWN)
> + /* means we didn't set it ... default to INITIATOR */
> + shost->active_mode = MODE_INITIATOR;
> + else
> + shost->active_mode = sht->supported_mode;
>
> if (sht->max_host_blocked)
> shost->max_host_blocked = sht->max_host_blocked;
> diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
> index 0088c4d..4965e9e 100644
> --- a/drivers/scsi/scsi_sysfs.c
> +++ b/drivers/scsi/scsi_sysfs.c
> @@ -209,11 +209,13 @@ show_shost_mode(unsigned int mode, char *buf)
> static ssize_t show_shost_supported_mode(struct class_device *class_dev, char *buf)
> {
> struct Scsi_Host *shost = class_to_shost(class_dev);
> + unsigned int supported_mode = shost->hostt->supported_mode;
>
> - if (shost->hostt->supported_mode == MODE_UNKNOWN)
> - return snprintf(buf, 20, "unknown\n");
> - else
> - return show_shost_mode(shost->hostt->supported_mode, buf);
> + if (supported_mode == MODE_UNKNOWN)
> + /* by default this should be initiator */
> + supported_mode = MODE_INITIATOR;
> +
> + return show_shost_mode(shost->hostt->supported_mode, buf);
should be:
return show_shost_mode(supported_mode, buf);
>
> static CLASS_DEVICE_ATTR(supported_mode, S_IRUGO | S_IWUSR, show_shost_supported_mode, NULL);
>
On Wed, 2007-09-26 at 13:56 +0900, FUJITA Tomonori wrote:
> On Tue, 25 Sep 2007 22:45:53 -0500
> James Bottomley <[email protected]> wrote:
>
> > On Tue, 2007-09-25 at 23:34 -0400, Jeff Garzik wrote:
> > > Matthew Wilcox wrote:
> > > > On Tue, Sep 25, 2007 at 10:37:33PM -0400, Jeff Garzik wrote:
> > > >> Are there any const-ness worries for scsi_host_template, or plans for
> > > >> the future? I do not see any other examples of the host template
> > > >> members getting modified.
> > > >
> > > > Goodness, Jeff, you haven't looked too hard. There's dozens of examples
> > > > I've come across trawling the horrible unmaintained drivers. I'd love
> > > > to see scsi_host_template become const, but it's not happening any time
> > > > soon, and we can address this little piece when the time comes.
> > >
> > > Well, sure, the driver is the owner of that memory.
> > >
> > > We're talking about common code.
> > >
> > > If everybody agrees SHT is R/W in the core, Fujita-san's patch is fine.
> >
> > Well, I don't like mucking with the template either.
> >
> > This whole mess is generated basically because the zero default of the
> > template should be treated as initiator. How about this, which makes
> > that manifest?
> >
> > James
> >
> > diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
> > index adc9559..7e26440 100644
> > --- a/drivers/scsi/hosts.c
> > +++ b/drivers/scsi/hosts.c
> > @@ -342,7 +342,11 @@ 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;
> > - shost->active_mode = sht->supported_mode;
> > + if (sht->supported_mode == MODE_UNKNOWN)
> > + /* means we didn't set it ... default to INITIATOR */
> > + shost->active_mode = MODE_INITIATOR;
> > + else
> > + shost->active_mode = sht->supported_mode;
> >
> > if (sht->max_host_blocked)
> > shost->max_host_blocked = sht->max_host_blocked;
> > diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
> > index 0088c4d..4965e9e 100644
> > --- a/drivers/scsi/scsi_sysfs.c
> > +++ b/drivers/scsi/scsi_sysfs.c
> > @@ -209,11 +209,13 @@ show_shost_mode(unsigned int mode, char *buf)
> > static ssize_t show_shost_supported_mode(struct class_device *class_dev, char *buf)
> > {
> > struct Scsi_Host *shost = class_to_shost(class_dev);
> > + unsigned int supported_mode = shost->hostt->supported_mode;
> >
> > - if (shost->hostt->supported_mode == MODE_UNKNOWN)
> > - return snprintf(buf, 20, "unknown\n");
> > - else
> > - return show_shost_mode(shost->hostt->supported_mode, buf);
> > + if (supported_mode == MODE_UNKNOWN)
> > + /* by default this should be initiator */
> > + supported_mode = MODE_INITIATOR;
> > +
> > + return show_shost_mode(shost->hostt->supported_mode, buf);
>
> should be:
>
> return show_shost_mode(supported_mode, buf);
Yes, sorry ... code in haste etc.
James