[PATCH] [SCSI] aic7xxx: Fix warnings with CONFIG_PM=n

2007-11-12 Thread Frank Lichtenheld
Fixes the following warnings:
  CC [M]  drivers/scsi/aic7xxx/aic79xx_osm_pci.o
drivers/scsi/aic7xxx/aic79xx_osm_pci.c:101: warning: 
‘ahd_linux_pci_dev_suspend’ defined but not used
drivers/scsi/aic7xxx/aic79xx_osm_pci.c:121: warning: ‘ahd_linux_pci_dev_resume’ 
defined but not used

  CC [M]  drivers/scsi/aic7xxx/aic7xxx_osm_pci.o
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c:148: warning: 
‘ahc_linux_pci_dev_suspend’ defined but not used
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c:166: warning: ‘ahc_linux_pci_dev_resume’ 
defined but not used

Reorder code as suggested by Randy Dunlap to minimize
needed #ifdefs

Acked-by: Randy Dunlap [EMAIL PROTECTED]
Signed-off-by: Frank Lichtenheld [EMAIL PROTECTED]
---
 drivers/scsi/aic7xxx/aic79xx_osm_pci.c |   25 +
 drivers/scsi/aic7xxx/aic7xxx_osm_pci.c |   25 +
 2 files changed, 26 insertions(+), 24 deletions(-)

   with one nit:
   Warning: trailing whitespace in line 174 of 
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
   Warning: trailing whitespace in lines 131,132 of 
drivers/scsi/aic7xxx/aic79xx_osm_pci.c

  fixed

diff --git a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c 
b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
index 66f0259..2b7c9a9 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
+++ b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
@@ -50,8 +50,6 @@ static intahd_linux_pci_reserve_io_regions(struct 
ahd_softc *ahd,
 static int ahd_linux_pci_reserve_mem_region(struct ahd_softc *ahd,
 u_long *bus_addr,
 uint8_t __iomem **maddr);
-static int ahd_linux_pci_dev_suspend(struct pci_dev *pdev, pm_message_t 
mesg);
-static int ahd_linux_pci_dev_resume(struct pci_dev *pdev);
 static voidahd_linux_pci_dev_remove(struct pci_dev *pdev);
 
 /* Define the macro locally since it's different for different class of chips.
@@ -85,17 +83,7 @@ static struct pci_device_id ahd_linux_pci_id_table[] = {
 
 MODULE_DEVICE_TABLE(pci, ahd_linux_pci_id_table);
 
-static struct pci_driver aic79xx_pci_driver = {
-   .name   = aic79xx,
-   .probe  = ahd_linux_pci_dev_probe,
 #ifdef CONFIG_PM
-   .suspend= ahd_linux_pci_dev_suspend,
-   .resume = ahd_linux_pci_dev_resume,
-#endif
-   .remove = ahd_linux_pci_dev_remove,
-   .id_table   = ahd_linux_pci_id_table
-};
-
 static int
 ahd_linux_pci_dev_suspend(struct pci_dev *pdev, pm_message_t mesg)
 {
@@ -139,6 +127,19 @@ ahd_linux_pci_dev_resume(struct pci_dev *pdev)
 
return rc;
 }
+#else
+#define ahd_linux_pci_dev_suspend NULL
+#define ahd_linux_pci_dev_resume  NULL
+#endif
+
+static struct pci_driver aic79xx_pci_driver = {
+   .name   = aic79xx,
+   .probe  = ahd_linux_pci_dev_probe,
+   .suspend= ahd_linux_pci_dev_suspend,
+   .resume = ahd_linux_pci_dev_resume,
+   .remove = ahd_linux_pci_dev_remove,
+   .id_table   = ahd_linux_pci_id_table
+};
 
 static void
 ahd_linux_pci_dev_remove(struct pci_dev *pdev)
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c 
b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
index 4488946..d10553e 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
@@ -49,8 +49,6 @@ static intahc_linux_pci_reserve_io_region(struct 
ahc_softc *ahc,
 static int ahc_linux_pci_reserve_mem_region(struct ahc_softc *ahc,
 u_long *bus_addr,
 uint8_t __iomem **maddr);
-static int ahc_linux_pci_dev_suspend(struct pci_dev *pdev, pm_message_t 
mesg);
-static int ahc_linux_pci_dev_resume(struct pci_dev *pdev);
 static voidahc_linux_pci_dev_remove(struct pci_dev *pdev);
 
 /* Define the macro locally since it's different for different class of chips.
@@ -132,17 +130,7 @@ static struct pci_device_id ahc_linux_pci_id_table[] = {
 
 MODULE_DEVICE_TABLE(pci, ahc_linux_pci_id_table);
 
-static struct pci_driver aic7xxx_pci_driver = {
-   .name   = aic7xxx,
-   .probe  = ahc_linux_pci_dev_probe,
 #ifdef CONFIG_PM
-   .suspend= ahc_linux_pci_dev_suspend,
-   .resume = ahc_linux_pci_dev_resume,
-#endif
-   .remove = ahc_linux_pci_dev_remove,
-   .id_table   = ahc_linux_pci_id_table
-};
-
 static int
 ahc_linux_pci_dev_suspend(struct pci_dev *pdev, pm_message_t mesg)
 {
@@ -182,6 +170,19 @@ ahc_linux_pci_dev_resume(struct pci_dev *pdev)
 
return (ahc_resume(ahc));
 }
+#else
+#define ahc_linux_pci_dev_suspend NULL
+#define ahc_linux_pci_dev_resume  NULL
+#endif
+
+static struct pci_driver aic7xxx_pci_driver = {
+   .name   = aic7xxx,
+   .probe  = ahc_linux_pci_dev_probe,
+   .suspend= ahc_linux_pci_dev_suspend,
+   .resume = ahc_linux_pci_dev_resume,
+   .remove = 

[PATCH] scsi: move single_lun flag from scsi_device to scsi_target

2007-11-12 Thread Tony Battersby
Some SCSI tape medium changers that need the BLIST_SINGLELUN flag have
the medium changer at one LUN and the tape drive at a different LUN.
The inquiry string of the tape drive may be different from that of the
medium changer.  In order for single_lun to be effective, every
scsi_device under a given scsi_target must have it set.  This means that
there needs to be a blacklist entry for BOTH the medium changer AND the
tape drive, which is impractical because some medium changers may be
paired with a variety of different tape drive models.  It makes more
sense to put the single_lun flag in scsi_target instead of scsi_device,
which causes every device at a given target ID to inherit the single_lun
flag from one LUN.  This makes it possible to blacklist just the medium
changer and not the tape drive.

Signed-off-by: Tony Battersby [EMAIL PROTECTED]
---
diff -urpN linux-2.6.24-rc2-vanilla/drivers/scsi/scsi_lib.c 
linux-2.6.24-rc2/drivers/scsi/scsi_lib.c
--- linux-2.6.24-rc2-vanilla/drivers/scsi/scsi_lib.c2007-11-09 
16:48:57.0 -0500
+++ linux-2.6.24-rc2/drivers/scsi/scsi_lib.c2007-11-09 16:54:27.0 
-0500
@@ -524,7 +524,7 @@ static void scsi_run_queue(struct reques
struct Scsi_Host *shost = sdev-host;
unsigned long flags;
 
-   if (sdev-single_lun)
+   if (scsi_target(sdev)-single_lun)
scsi_single_lun_run(sdev);
 
spin_lock_irqsave(shost-host_lock, flags);
@@ -1557,7 +1557,7 @@ static void scsi_request_fn(struct reque
 
if (!scsi_host_queue_ready(q, shost, sdev))
goto not_ready;
-   if (sdev-single_lun) {
+   if (scsi_target(sdev)-single_lun) {
if (scsi_target(sdev)-starget_sdev_user 
scsi_target(sdev)-starget_sdev_user != sdev)
goto not_ready;
diff -urpN linux-2.6.24-rc2-vanilla/drivers/scsi/scsi_scan.c 
linux-2.6.24-rc2/drivers/scsi/scsi_scan.c
--- linux-2.6.24-rc2-vanilla/drivers/scsi/scsi_scan.c   2007-11-09 
16:48:57.0 -0500
+++ linux-2.6.24-rc2/drivers/scsi/scsi_scan.c   2007-11-09 16:55:59.0 
-0500
@@ -863,7 +863,7 @@ static int scsi_add_lun(struct scsi_devi
sdev-no_start_on_add = 1;
 
if (*bflags  BLIST_SINGLELUN)
-   sdev-single_lun = 1;
+   scsi_target(sdev)-single_lun = 1;
 
sdev-use_10_for_rw = 1;
 
diff -urpN linux-2.6.24-rc2-vanilla/include/scsi/scsi_device.h 
linux-2.6.24-rc2/include/scsi/scsi_device.h
--- linux-2.6.24-rc2-vanilla/include/scsi/scsi_device.h 2007-11-09 
16:49:05.0 -0500
+++ linux-2.6.24-rc2/include/scsi/scsi_device.h 2007-11-09 16:53:43.0 
-0500
@@ -122,9 +122,6 @@ struct scsi_device {
unsigned tagged_supported:1;/* Supports SCSI-II tagged queuing */
unsigned simple_tags:1; /* simple queue tag messages are enabled */
unsigned ordered_tags:1;/* ordered queue tag messages are enabled */
-   unsigned single_lun:1;  /* Indicates we should only allow I/O to
-* one of the luns for the device at a 
-* time. */
unsigned was_reset:1;   /* There was a bus reset on the bus for 
 * this device */
unsigned expecting_cc_ua:1; /* Expecting a CHECK_CONDITION/UNIT_ATTN
@@ -202,6 +199,9 @@ struct scsi_target {
unsigned intid; /* target id ... replace
 * scsi_device.id eventually */
unsigned intcreate:1; /* signal that it needs to be added */
+   unsigned intsingle_lun:1;   /* Indicates we should only
+* allow I/O to one of the luns
+* for the device at a time. */
unsigned intpdt_1f_for_no_lun;  /* PDT = 0x1f */
/* means no lun present */
 


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


Re: [PATCH 1/1] [v2] ibmvscsi: requeue while CRQ closed

2007-11-12 Thread Robert Jennings
CRQ send errors that return with H_CLOSED should return with
SCSI_MLQUEUE_HOST_BUSY until firmware alerts the client of a CRQ
transport event.  The transport event will either reinitialize and
requeue the requests or fail and return IO with DID_ERROR.

To avoid failing the eh_* functions while re-attaching to the server
adapter this will retry for a period of time while ibmvscsi_send_srp_event
returns SCSI_MLQUEUE_HOST_BUSY.

In ibmvscsi_eh_abort_handler() the loop includes the search of the
event list.  The lock on the hostdata is dropped while waiting to try
again after failing ibmvscsi_send_srp_event.  The event could have been
purged if a login was in progress when the function was called.

In ibmvscsi_eh_device_reset_handler() the loop includes the call to
get_event_struct() because a failing call to ibmvscsi_send_srp_event()
will have freed the event struct.

Signed-off-by: Robert Jennings [EMAIL PROTECTED]
Signed-off-by: Brian King [EMAIL PROTECTED]

---
 drivers/scsi/ibmvscsi/ibmvscsi.c |   59 ---
 1 file changed, 48 insertions(+), 11 deletions(-)

Index: linux-2.6/drivers/scsi/ibmvscsi/ibmvscsi.c
===
--- linux-2.6.orig/drivers/scsi/ibmvscsi/ibmvscsi.c 2007-11-12 
08:52:59.0 -0600
+++ linux-2.6/drivers/scsi/ibmvscsi/ibmvscsi.c  2007-11-12 08:54:17.0 
-0600
@@ -629,6 +629,16 @@
list_del(evt_struct-list);
del_timer(evt_struct-timer);
 
+   /* If send_crq returns H_CLOSED, return SCSI_MLQUEUE_HOST_BUSY.
+* Firmware will send a CRQ with a transport event (0xFF) to
+* tell this client what has happened to the transport.  This
+* will be handled in ibmvscsi_handle_crq()
+*/
+   if (rc == H_CLOSED) {
+   dev_warn(hostdata-dev, send warning. 
+Receive queue closed, will retry.\n);
+   goto send_busy;
+   }
dev_err(hostdata-dev, send error %d\n, rc);
atomic_inc(hostdata-request_limit);
goto send_error;
@@ -976,58 +986,74 @@
int rsp_rc;
unsigned long flags;
u16 lun = lun_from_dev(cmd-device);
+   unsigned long wait_switch = 0;
 
/* First, find this command in our sent list so we can figure
 * out the correct tag
 */
spin_lock_irqsave(hostdata-host-host_lock, flags);
-   found_evt = NULL;
-   list_for_each_entry(tmp_evt, hostdata-sent, list) {
-   if (tmp_evt-cmnd == cmd) {
-   found_evt = tmp_evt;
-   break;
+   wait_switch = jiffies + (init_timeout * HZ);
+   do {
+   found_evt = NULL;
+   list_for_each_entry(tmp_evt, hostdata-sent, list) {
+   if (tmp_evt-cmnd == cmd) {
+   found_evt = tmp_evt;
+   break;
+   }
}
-   }
 
-   if (!found_evt) {
-   spin_unlock_irqrestore(hostdata-host-host_lock, flags);
-   return SUCCESS;
-   }
+   if (!found_evt) {
+   spin_unlock_irqrestore(hostdata-host-host_lock, 
flags);
+   return SUCCESS;
+   }
 
-   evt = get_event_struct(hostdata-pool);
-   if (evt == NULL) {
-   spin_unlock_irqrestore(hostdata-host-host_lock, flags);
-   sdev_printk(KERN_ERR, cmd-device, failed to allocate abort 
event\n);
-   return FAILED;
-   }
+   evt = get_event_struct(hostdata-pool);
+   if (evt == NULL) {
+   spin_unlock_irqrestore(hostdata-host-host_lock, 
flags);
+   sdev_printk(KERN_ERR, cmd-device,
+   failed to allocate abort event\n);
+   return FAILED;
+   }

-   init_event_struct(evt,
- sync_completion,
- VIOSRP_SRP_FORMAT,
- init_timeout);
+   init_event_struct(evt,
+ sync_completion,
+ VIOSRP_SRP_FORMAT,
+ init_timeout);
 
-   tsk_mgmt = evt-iu.srp.tsk_mgmt;
+   tsk_mgmt = evt-iu.srp.tsk_mgmt;

-   /* Set up an abort SRP command */
-   memset(tsk_mgmt, 0x00, sizeof(*tsk_mgmt));
-   tsk_mgmt-opcode = SRP_TSK_MGMT;
-   tsk_mgmt-lun = ((u64) lun)  48;
-   tsk_mgmt-tsk_mgmt_func = SRP_TSK_ABORT_TASK;
-   tsk_mgmt-task_tag = (u64) found_evt;
-
-   sdev_printk(KERN_INFO, cmd-device, aborting command. lun 0x%lx, tag 
0x%lx\n,
-   tsk_mgmt-lun, tsk_mgmt-task_tag);
-
-   evt-sync_srp = srp_rsp;
-   init_completion(evt-comp);
-   

[PATCH 0/4] qla2xxx: fixes for 2.6.24 [8.02.00-k6].

2007-11-12 Thread Andrew Vasquez
This patchset contains fixes for 2.6.24.

 drivers/scsi/qla2xxx/qla_attr.c|2 +-
 drivers/scsi/qla2xxx/qla_def.h |   10 +-
 drivers/scsi/qla2xxx/qla_fw.h  |   16 ++--
 drivers/scsi/qla2xxx/qla_init.c|   19 +++
 drivers/scsi/qla2xxx/qla_isr.c |   11 +--
 drivers/scsi/qla2xxx/qla_mbx.c |4 ++--
 drivers/scsi/qla2xxx/qla_mid.c |   33 -
 drivers/scsi/qla2xxx/qla_version.h |2 +-
 8 files changed, 39 insertions(+), 58 deletions(-)

here's the commits:

- Don't explicitly read mbx registers while processing a system-error.
- Correct NPIV support for recent ISPs.
- Properly handle Vport state-change-notifications.
- Update version number to 8.02.00-k6.

Regards,
Andrew Vasquez
QLogic Corporation
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/4] qla2xxx: Don't explicitly read mbx registers while processing a system-error.

2007-11-12 Thread Andrew Vasquez
Callers of qla2x00_async_event() already populate the mb[] array
upon invocation, doing so via the appropriate mailbox register
accessors.  The stale codes removed are leftover-bits kept during
the FWI2 transition.  Though relatively benign, the extra-reads
are not valid for FWI2 boards (ISP24xx and above) and peek into
the incorrect regions of registers.

Signed-off-by: Andrew Vasquez [EMAIL PROTECTED]
---
 drivers/scsi/qla2xxx/qla_isr.c |4 
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 1104bd2..343af39 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -347,10 +347,6 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
break;
 
case MBA_SYSTEM_ERR:/* System Error */
-   mb[1] = RD_MAILBOX_REG(ha, reg, 1);
-   mb[2] = RD_MAILBOX_REG(ha, reg, 2);
-   mb[3] = RD_MAILBOX_REG(ha, reg, 3);
-
qla_printk(KERN_INFO, ha,
ISP System Error - mbx1=%xh mbx2=%xh mbx3=%xh.\n,
mb[1], mb[2], mb[3]);
-- 
1.5.3.5.643.g40e25

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


[PATCH 3/4] qla2xxx: Properly handle Vport state-change-notifications.

2007-11-12 Thread Andrew Vasquez
From: Shyam Sundar [EMAIL PROTECTED]

Drivers do SCRs for each Vport. When something changes in the
fabric, firmware generates one interrupt for each RSCN. Based on
the current implementation, in each case, we make recursive calls
to handle RSCN for physical and each subsequent virtual ports.
The fix is to also take into consideration the vp_idx, which is
set by the firmware to indicate the vport the RSCN was meant for.

Signed-off-by: Andrew Vasquez [EMAIL PROTECTED]
---
 drivers/scsi/qla2xxx/qla_isr.c |7 +--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 343af39..798b7e8 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -575,12 +575,15 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
/* Check if the Vport has issued a SCR */
if (ha-parent  test_bit(VP_SCR_NEEDED, ha-vp_flags))
break;
+   /* Only handle SCNs for our Vport index. */
+   if (ha-flags.npiv_supported  ha-vp_idx != mb[3])
+   break;
 
DEBUG2(printk(scsi(%ld): Asynchronous RSCR UPDATE.\n,
ha-host_no));
DEBUG(printk(KERN_INFO
-   scsi(%ld): RSCN database changed -- %04x %04x.\n,
-   ha-host_no, mb[1], mb[2]));
+   scsi(%ld): RSCN database changed -- %04x %04x %04x.\n,
+   ha-host_no, mb[1], mb[2], mb[3]));
 
rscn_entry = (mb[1]  16) | mb[2];
host_pid = (ha-d_id.b.domain  16) | (ha-d_id.b.area  8) |
-- 
1.5.3.5.643.g40e25

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


[PATCH 4/4] qla2xxx: Update version number to 8.02.00-k6.

2007-11-12 Thread Andrew Vasquez
Signed-off-by: Andrew Vasquez [EMAIL PROTECTED]
---
 drivers/scsi/qla2xxx/qla_version.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_version.h 
b/drivers/scsi/qla2xxx/qla_version.h
index ae6f7a2..6e3dc40 100644
--- a/drivers/scsi/qla2xxx/qla_version.h
+++ b/drivers/scsi/qla2xxx/qla_version.h
@@ -7,7 +7,7 @@
 /*
  * Driver version
  */
-#define QLA2XXX_VERSION  8.02.00-k5
+#define QLA2XXX_VERSION  8.02.00-k6
 
 #define QLA_DRIVER_MAJOR_VER   8
 #define QLA_DRIVER_MINOR_VER   2
-- 
1.5.3.5.643.g40e25

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


[PATCH 2/4] qla2xxx: Correct NPIV support for recent ISPs.

2007-11-12 Thread Andrew Vasquez
Firmware will export to software the maximum number of vports
supported for any given firmware version and ISP type.  Use this
information rather than the current hardcoding of limitations
within the driver.

Signed-off-by: Andrew Vasquez [EMAIL PROTECTED]
---
 drivers/scsi/qla2xxx/qla_attr.c |2 +-
 drivers/scsi/qla2xxx/qla_def.h  |   10 +-
 drivers/scsi/qla2xxx/qla_fw.h   |   16 ++--
 drivers/scsi/qla2xxx/qla_init.c |   19 +++
 drivers/scsi/qla2xxx/qla_mbx.c  |4 ++--
 drivers/scsi/qla2xxx/qla_mid.c  |   33 -
 6 files changed, 33 insertions(+), 51 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index fb388b8..745283f 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -1124,7 +1124,7 @@ qla24xx_vport_delete(struct fc_vport *fc_vport)
 
down(ha-vport_sem);
ha-cur_vport_count--;
-   clear_bit(vha-vp_idx, (unsigned long *)ha-vp_idx_map);
+   clear_bit(vha-vp_idx, ha-vp_idx_map);
up(ha-vport_sem);
 
kfree(vha-node_name);
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 04e8cbc..fe8f782 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -2116,14 +2116,6 @@ struct qla_msix_entry {
 
 #defineWATCH_INTERVAL  1   /* number of seconds */
 
-/* NPIV */
-#define MAX_MULTI_ID_LOOP 126
-#define MAX_MULTI_ID_FABRIC64
-#define MAX_NUM_VPORT_LOOP  (MAX_MULTI_ID_LOOP - 1)
-#define MAX_NUM_VPORT_FABRIC(MAX_MULTI_ID_FABRIC - 1)
-#define MAX_NUM_VHBA_LOOP   (MAX_MULTI_ID_LOOP - 1)
-#define MAX_NUM_VHBA_FABRIC (MAX_MULTI_ID_FABRIC - 1)
-
 /*
  * Linux Host Adapter structure
  */
@@ -2507,7 +2499,7 @@ typedef struct scsi_qla_host {
 
struct list_headvp_list;/* list of VP */
struct fc_vport *fc_vport;  /* holds fc_vport * for each vport */
-   uint8_t vp_idx_map[16];
+   unsigned long   vp_idx_map[(MAX_MULTI_ID_FABRIC / 8) / sizeof(unsigned 
long)];
uint16_tnum_vhosts; /* number of vports created */
uint16_tnum_vsans;  /* number of vsan created */
uint16_tvp_idx; /* vport ID */
diff --git a/drivers/scsi/qla2xxx/qla_fw.h b/drivers/scsi/qla2xxx/qla_fw.h
index 25364b1..69a5e31 100644
--- a/drivers/scsi/qla2xxx/qla_fw.h
+++ b/drivers/scsi/qla2xxx/qla_fw.h
@@ -954,7 +954,15 @@ struct device_reg_24xx {
 
 /* MID Support ***/
 
-#define MAX_MID_VPS125
+#define MIN_MULTI_ID_FABRIC64  /* Must be power-of-2. */
+#define MAX_MULTI_ID_FABRIC256 /* ... */
+
+#define for_each_mapped_vp_idx(_ha, _idx)  \
+   for (_idx = find_next_bit((_ha)-vp_idx_map,\
+   (_ha)-max_npiv_vports + 1, 1); \
+   _idx = (_ha)-max_npiv_vports; \
+   _idx = find_next_bit((_ha)-vp_idx_map, \
+   (_ha)-max_npiv_vports + 1, _idx + 1))  \
 
 struct mid_conf_entry_24xx {
uint16_t reserved_1;
@@ -982,7 +990,7 @@ struct mid_init_cb_24xx {
uint16_t count;
uint16_t options;
 
-   struct mid_conf_entry_24xx entries[MAX_MID_VPS];
+   struct mid_conf_entry_24xx entries[MAX_MULTI_ID_FABRIC];
 };
 
 
@@ -1002,10 +1010,6 @@ struct mid_db_entry_24xx {
uint8_t reserved_1;
 };
 
-struct mid_db_24xx {
-   struct mid_db_entry_24xx entries[MAX_MID_VPS];
-};
-
  /*
  * Virtual Fabric ID type definition.
  */
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 191dafd..03444d6 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -922,9 +922,9 @@ qla2x00_setup_chip(scsi_qla_host_t *ha)
ha-flags.npiv_supported = 1;
if ((!ha-max_npiv_vports) ||
((ha-max_npiv_vports + 1) %
-   MAX_MULTI_ID_FABRIC))
+   MIN_MULTI_ID_FABRIC))
ha-max_npiv_vports =
-   MAX_NUM_VPORT_FABRIC;
+   MIN_MULTI_ID_FABRIC - 1;
}
 
if (ql2xallocfwdump)
@@ -1162,7 +1162,8 @@ qla2x00_init_rings(scsi_qla_host_t *ha)
 
DEBUG(printk(scsi(%ld): Issue init firmware.\n, ha-host_no));
 
-   mid_init_cb-count = ha-max_npiv_vports;
+   mid_init_cb-count = cpu_to_le16(ha-max_npiv_vports);
+   mid_init_cb-options = __constant_cpu_to_le16(BIT_1);
 
rval = qla2x00_init_firmware(ha, ha-init_cb_size);
if (rval) {
@@ 

[PATCH 2/2] libsas: Use new ATA configuration mechanism

2007-11-12 Thread Darrick J. Wong
Update sas_ata to use the new ata_sas_rphy mechanisms as provided by
Brian King, and simplify ATA device discovery...

WARNING WARNING WARNING!  This patch is experimental, use at your own
risk.

Comments-requested-by: Darrick J. Wong [EMAIL PROTECTED]
---

 drivers/scsi/libsas/sas_ata.c   |  206 +--
 drivers/scsi/libsas/sas_discover.c  |4 +
 drivers/scsi/libsas/sas_scsi_host.c |   37 +-
 include/scsi/libsas.h   |4 -
 4 files changed, 91 insertions(+), 160 deletions(-)

diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
index a9925d5..c6b4213 100644
--- a/drivers/scsi/libsas/sas_ata.c
+++ b/drivers/scsi/libsas/sas_ata.c
@@ -35,6 +35,13 @@
 #include ../scsi_transport_api.h
 #include scsi/scsi_eh.h
 
+struct sas_ata_descr {
+   struct ata_sas_rphy rphy;
+   struct scsi_host_template sht;
+};
+
+#define ata_rphy_to_descr(x) container_of((x), struct sas_ata_descr, rphy)
+
 static int sas_issue_ata_srst(struct domain_device *dev);
 
 static enum ata_completion_errors sas_to_ata_err(struct task_status_struct *ts)
@@ -323,55 +330,6 @@ static void sas_ata_tf_read(struct ata_port *ap, struct 
ata_taskfile *tf)
memcpy(tf, dev-sata_dev.tf, sizeof (*tf));
 }
 
-static int sas_ata_scr_write(struct ata_port *ap, unsigned int sc_reg_in,
- u32 val)
-{
-   struct domain_device *dev = ap-private_data;
-
-   SAS_DPRINTK(STUB %s\n, __FUNCTION__);
-   switch (sc_reg_in) {
-   case SCR_STATUS:
-   dev-sata_dev.sstatus = val;
-   break;
-   case SCR_CONTROL:
-   dev-sata_dev.scontrol = val;
-   break;
-   case SCR_ERROR:
-   dev-sata_dev.serror = val;
-   break;
-   case SCR_ACTIVE:
-   dev-sata_dev.ap-link.sactive = val;
-   break;
-   default:
-   return -EINVAL;
-   }
-   return 0;
-}
-
-static int sas_ata_scr_read(struct ata_port *ap, unsigned int sc_reg_in,
-   u32 *val)
-{
-   struct domain_device *dev = ap-private_data;
-
-   SAS_DPRINTK(STUB %s\n, __FUNCTION__);
-   switch (sc_reg_in) {
-   case SCR_STATUS:
-   *val = dev-sata_dev.sstatus;
-   return 0;
-   case SCR_CONTROL:
-   *val = dev-sata_dev.scontrol;
-   return 0;
-   case SCR_ERROR:
-   *val = dev-sata_dev.serror;
-   return 0;
-   case SCR_ACTIVE:
-   *val = dev-sata_dev.ap-link.sactive;
-   return 0;
-   default:
-   return -EINVAL;
-   }
-}
-
 static struct ata_port_operations sas_sata_ops = {
.check_status   = sas_ata_check_status,
.check_altstatus= sas_ata_check_status,
@@ -385,8 +343,6 @@ static struct ata_port_operations sas_sata_ops = {
.qc_issue   = sas_ata_qc_issue,
.port_start = ata_sas_port_start,
.port_stop  = ata_sas_port_stop,
-   .scr_read   = sas_ata_scr_read,
-   .scr_write  = sas_ata_scr_write
 };
 
 static struct ata_port_info sata_port_info = {
@@ -398,33 +354,6 @@ static struct ata_port_info sata_port_info = {
.port_ops = sas_sata_ops
 };
 
-int sas_ata_init_host_and_port(struct domain_device *found_dev,
-  struct scsi_target *starget)
-{
-   struct Scsi_Host *shost = dev_to_shost(starget-dev);
-   struct sas_ha_struct *ha = SHOST_TO_SAS_HA(shost);
-   struct ata_port *ap;
-
-   ata_host_init(found_dev-sata_dev.ata_host,
- ha-dev,
- sata_port_info.flags,
- sas_sata_ops);
-   ap = ata_sas_port_alloc(found_dev-sata_dev.ata_host,
-   sata_port_info,
-   shost);
-   if (!ap) {
-   SAS_DPRINTK(ata_sas_port_alloc failed.\n);
-   return -ENODEV;
-   }
-
-   ap-private_data = found_dev;
-   ap-cbl = ATA_CBL_SATA;
-   ap-scsi_host = shost;
-   found_dev-sata_dev.ap = ap;
-
-   return 0;
-}
-
 void sas_ata_task_abort(struct sas_task *task)
 {
struct ata_queued_cmd *qc = task-uldd_task;
@@ -601,50 +530,6 @@ out:
 }
 
 /* -- SATA -- */
-
-static void sas_get_ata_command_set(struct domain_device *dev)
-{
-   struct dev_to_host_fis *fis =
-   (struct dev_to_host_fis *) dev-frame_rcvd;
-
-   if ((fis-sector_count == 1  /* ATA */
-fis-lbal == 1 
-fis-lbam == 0 
-fis-lbah == 0 
-fis-device   == 0)
-   ||
-   (fis-sector_count 

[PATCH 1/2] libsas: Convert ATA bridge to use new EH

2007-11-12 Thread Darrick J. Wong
Migrate the sas_ata bridge to use the new libata EH strategy, and
finally implement correct software reset.

WARNING WARNING WARNING!  This patch is for experimental use only; it is
nowhere near complete!  Especially the sas_ata_freeze() function.  This
patch may eat your data and kill your trees.

jgarzik: If an ATA command was in-progress at the time of a port freeze,
can complete after thawing?  (Does that even make sense?)

Comments-requested-by: Darrick J. Wong [EMAIL PROTECTED]
---

 drivers/scsi/libsas/sas_ata.c |   86 ++---
 1 files changed, 71 insertions(+), 15 deletions(-)

diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
index 0829b55..a9925d5 100644
--- a/drivers/scsi/libsas/sas_ata.c
+++ b/drivers/scsi/libsas/sas_ata.c
@@ -35,6 +35,8 @@
 #include ../scsi_transport_api.h
 #include scsi/scsi_eh.h
 
+static int sas_issue_ata_srst(struct domain_device *dev);
+
 static enum ata_completion_errors sas_to_ata_err(struct task_status_struct *ts)
 {
/* Cheesy attempt to translate SAS errors into ATA.  Hah! */
@@ -233,37 +235,58 @@ static u8 sas_ata_check_status(struct ata_port *ap)
return dev-sata_dev.tf.command;
 }
 
-static void sas_ata_phy_reset(struct ata_port *ap)
+static void sas_ata_freeze(struct ata_port *ap)
 {
-   struct domain_device *dev = ap-private_data;
-   struct sas_internal *i =
-   to_sas_internal(dev-port-ha-core.shost-transportt);
-   int res = 0;
+   /* reroute qc_done for all qc's on this port to a dumb free func */
+   /* i wonder if we can get away with throwing out anything that
+* completes in this time frame, or if we must find the commands
+* that are in progress and cancel only those? */
+   printk(KERN_ERR %s: STUB\n, __FUNCTION__);
+}
 
-   if (i-dft-lldd_I_T_nexus_reset)
-   res = i-dft-lldd_I_T_nexus_reset(dev);
+static void sas_ata_thaw(struct ata_port *ap)
+{
+   /* empty */
+   printk(KERN_ERR %s: STUB\n, __FUNCTION__);
+}
 
-   if (res)
-   SAS_DPRINTK(%s: Unable to reset I T nexus?\n, __FUNCTION__);
+static int sas_ata_soft_reset(struct ata_link *link, unsigned int *classes,
+  unsigned long deadline)
+{
+   struct ata_port *ap = link-ap;
+   struct domain_device *dev = ap-private_data;
+   int res;
 
+   /* Send SRST to device */
+   res = sas_issue_ata_srst(dev);
+   printk(KERN_ERR srst 0 returns %d\n, res);
+
+   /* Set new device type */
switch (dev-sata_dev.command_set) {
case ATA_COMMAND_SET:
SAS_DPRINTK(%s: Found ATA device.\n, __FUNCTION__);
-   ap-link.device[0].class = ATA_DEV_ATA;
+   *classes = ATA_DEV_ATA;
break;
case ATAPI_COMMAND_SET:
SAS_DPRINTK(%s: Found ATAPI device.\n, __FUNCTION__);
-   ap-link.device[0].class = ATA_DEV_ATAPI;
+   *classes = ATA_DEV_ATAPI;
break;
default:
SAS_DPRINTK(%s: Unknown SATA command set: %d.\n,
__FUNCTION__,
dev-sata_dev.command_set);
-   ap-link.device[0].class = ATA_DEV_UNKNOWN;
-   break;
+   *classes = ATA_DEV_UNKNOWN;
+   break;
}
 
-   ap-cbl = ATA_CBL_SATA;
+   /* FIXME: What if SRST fails? */
+   return 0;
+}
+
+static void sas_ata_error_handler(struct ata_port *ap)
+{
+   ata_do_eh(ap, NULL, sas_ata_soft_reset, NULL, NULL);
+   //uh... hopefully there's no commands left in here?
 }
 
 static void sas_ata_post_internal(struct ata_queued_cmd *qc)
@@ -353,7 +376,9 @@ static struct ata_port_operations sas_sata_ops = {
.check_status   = sas_ata_check_status,
.check_altstatus= sas_ata_check_status,
.dev_select = ata_noop_dev_select,
-   .phy_reset  = sas_ata_phy_reset,
+   .error_handler  = sas_ata_error_handler,
+   .freeze = sas_ata_freeze,
+   .thaw   = sas_ata_thaw,
.post_internal_cmd  = sas_ata_post_internal,
.tf_read= sas_ata_tf_read,
.qc_prep= ata_noop_qc_prep,
@@ -658,6 +683,37 @@ out:
return res;
 }
 
+static int sas_issue_ata_srst(struct domain_device *dev)
+{
+   int res = 0;
+   struct sas_task *task;
+   struct dev_to_host_fis *d2h_fis = (struct dev_to_host_fis *)
+   dev-frame_rcvd[0];
+
+   res = -ENOMEM;
+   task = sas_alloc_task(GFP_KERNEL);
+   if (!task)
+   goto out;
+
+   task-dev = dev;
+
+   task-ata_task.fis.fis_type = 0x27;
+   /* FIXME: What's a good dummy command? */
+   task-ata_task.fis.command = 

Re: [PATCH 3/4] scsi_data_buffer

2007-11-12 Thread Andrew Morton
On Thu, 08 Nov 2007 18:59:30 +0200 Boaz Harrosh [EMAIL PROTECTED] wrote:

   In preparation for bidi we abstract all IO members of scsi_cmnd,
   that will need to duplicate, into a substructure.
 
   - Group all IO members of scsi_cmnd into a scsi_data_buffer
 structure.

drivers/scsi/qla1280.c: In function 'qla1280_done':
drivers/scsi/qla1280.c:1313: error: 'struct scsi_cmnd' has no member named 
'use_sg'
drivers/scsi/qla1280.c:1314: error: 'struct scsi_cmnd' has no member named 
'request_buffer'
drivers/scsi/qla1280.c:1315: error: 'struct scsi_cmnd' has no member named 
'use_sg'
drivers/scsi/qla1280.c:1316: error: 'struct scsi_cmnd' has no member named 
'request_bufflen'
drivers/scsi/qla1280.c:1318: error: 'struct scsi_cmnd' has no member named 
'request_bufflen'
drivers/scsi/qla1280.c: In function 'qla1280_return_status':
drivers/scsi/qla1280.c:1409: error: 'struct scsi_cmnd' has no member named 
'request_bufflen'
drivers/scsi/qla1280.c:1416: error: 'struct scsi_cmnd' has no member named 
'resid'
drivers/scsi/qla1280.c: In function 'qla1280_64bit_start_scsi':
drivers/scsi/qla1280.c:2791: error: 'struct scsi_cmnd' has no member named 
'use_sg'
drivers/scsi/qla1280.c:2792: error: 'struct scsi_cmnd' has no member named 
'request_buffer'
drivers/scsi/qla1280.c:2793: error: 'struct scsi_cmnd' has no member named 
'use_sg'
drivers/scsi/qla1280.c:2801: error: 'struct scsi_cmnd' has no member named 
'request_bufflen'
drivers/scsi/qla1280.c:2896: error: 'struct scsi_cmnd' has no member named 
'use_sg'
drivers/scsi/qla1280.c:2991: error: 'struct scsi_cmnd' has no member named 
'request_buffer'
drivers/scsi/qla1280.c:2992: error: 'struct scsi_cmnd' has no member named 
'request_bufflen'
drivers/scsi/qla1280.c:3004: error: 'struct scsi_cmnd' has no member named 
'request_bufflen'
make[2]: *** [drivers/scsi/qla1280.o] Error 1

It mystfies me how a patch like this can have been floating about in N
submissions across M months and nobody has done an allmodconfig build or
even a grep to find out what broke.

ho hum.  I shall mark qla1280 BROKEN and shall plod onwards.
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/4] scsi_data_buffer

2007-11-12 Thread FUJITA Tomonori
On Mon, 12 Nov 2007 22:06:52 -0800
Andrew Morton [EMAIL PROTECTED] wrote:

 On Thu, 08 Nov 2007 18:59:30 +0200 Boaz Harrosh [EMAIL PROTECTED] wrote:
 
In preparation for bidi we abstract all IO members of scsi_cmnd,
that will need to duplicate, into a substructure.
  
- Group all IO members of scsi_cmnd into a scsi_data_buffer
  structure.
 
 drivers/scsi/qla1280.c: In function 'qla1280_done':
 drivers/scsi/qla1280.c:1313: error: 'struct scsi_cmnd' has no member named 
 'use_sg'
 drivers/scsi/qla1280.c:1314: error: 'struct scsi_cmnd' has no member named 
 'request_buffer'
 drivers/scsi/qla1280.c:1315: error: 'struct scsi_cmnd' has no member named 
 'use_sg'
 drivers/scsi/qla1280.c:1316: error: 'struct scsi_cmnd' has no member named 
 'request_bufflen'
 drivers/scsi/qla1280.c:1318: error: 'struct scsi_cmnd' has no member named 
 'request_bufflen'
 drivers/scsi/qla1280.c: In function 'qla1280_return_status':
 drivers/scsi/qla1280.c:1409: error: 'struct scsi_cmnd' has no member named 
 'request_bufflen'
 drivers/scsi/qla1280.c:1416: error: 'struct scsi_cmnd' has no member named 
 'resid'
 drivers/scsi/qla1280.c: In function 'qla1280_64bit_start_scsi':
 drivers/scsi/qla1280.c:2791: error: 'struct scsi_cmnd' has no member named 
 'use_sg'
 drivers/scsi/qla1280.c:2792: error: 'struct scsi_cmnd' has no member named 
 'request_buffer'
 drivers/scsi/qla1280.c:2793: error: 'struct scsi_cmnd' has no member named 
 'use_sg'
 drivers/scsi/qla1280.c:2801: error: 'struct scsi_cmnd' has no member named 
 'request_bufflen'
 drivers/scsi/qla1280.c:2896: error: 'struct scsi_cmnd' has no member named 
 'use_sg'
 drivers/scsi/qla1280.c:2991: error: 'struct scsi_cmnd' has no member named 
 'request_buffer'
 drivers/scsi/qla1280.c:2992: error: 'struct scsi_cmnd' has no member named 
 'request_bufflen'
 drivers/scsi/qla1280.c:3004: error: 'struct scsi_cmnd' has no member named 
 'request_bufflen'
 make[2]: *** [drivers/scsi/qla1280.o] Error 1
 
 It mystfies me how a patch like this can have been floating about in N
 submissions across M months and nobody has done an allmodconfig build or
 even a grep to find out what broke.
 
 ho hum.  I shall mark qla1280 BROKEN and shall plod onwards.

A patch to fix this is in James' scsi-pending tree. Jes tested and
fixed it (thanks !) so it will go to -mm via scsi-misc soon.

Boaz, it's better to send major scsi patches to -mm via scsi-misc to
avoid problems like this.


By the way, Andrew, can you add the following patchset to -mm?

http://lkml.org/lkml/2007/10/24/138

It fixes the IOMMUs' problem to merge scatter/gather segments without
considering LLDs' restrictions.


Thanks,
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/4] scsi_data_buffer

2007-11-12 Thread Andrew Morton
On Tue, 13 Nov 2007 15:40:42 +0900 FUJITA Tomonori [EMAIL PROTECTED] wrote:

 On Mon, 12 Nov 2007 22:06:52 -0800
 Andrew Morton [EMAIL PROTECTED] wrote:
 
  On Thu, 08 Nov 2007 18:59:30 +0200 Boaz Harrosh [EMAIL PROTECTED] wrote:
  
 In preparation for bidi we abstract all IO members of scsi_cmnd,
 that will need to duplicate, into a substructure.
   
 - Group all IO members of scsi_cmnd into a scsi_data_buffer
   structure.
  
  drivers/scsi/qla1280.c: In function 'qla1280_done':
  drivers/scsi/qla1280.c:1313: error: 'struct scsi_cmnd' has no member named 
  'use_sg'
  drivers/scsi/qla1280.c:1314: error: 'struct scsi_cmnd' has no member named 
  'request_buffer'
  drivers/scsi/qla1280.c:1315: error: 'struct scsi_cmnd' has no member named 
  'use_sg'
  drivers/scsi/qla1280.c:1316: error: 'struct scsi_cmnd' has no member named 
  'request_bufflen'
  drivers/scsi/qla1280.c:1318: error: 'struct scsi_cmnd' has no member named 
  'request_bufflen'
  drivers/scsi/qla1280.c: In function 'qla1280_return_status':
  drivers/scsi/qla1280.c:1409: error: 'struct scsi_cmnd' has no member named 
  'request_bufflen'
  drivers/scsi/qla1280.c:1416: error: 'struct scsi_cmnd' has no member named 
  'resid'
  drivers/scsi/qla1280.c: In function 'qla1280_64bit_start_scsi':
  drivers/scsi/qla1280.c:2791: error: 'struct scsi_cmnd' has no member named 
  'use_sg'
  drivers/scsi/qla1280.c:2792: error: 'struct scsi_cmnd' has no member named 
  'request_buffer'
  drivers/scsi/qla1280.c:2793: error: 'struct scsi_cmnd' has no member named 
  'use_sg'
  drivers/scsi/qla1280.c:2801: error: 'struct scsi_cmnd' has no member named 
  'request_bufflen'
  drivers/scsi/qla1280.c:2896: error: 'struct scsi_cmnd' has no member named 
  'use_sg'
  drivers/scsi/qla1280.c:2991: error: 'struct scsi_cmnd' has no member named 
  'request_buffer'
  drivers/scsi/qla1280.c:2992: error: 'struct scsi_cmnd' has no member named 
  'request_bufflen'
  drivers/scsi/qla1280.c:3004: error: 'struct scsi_cmnd' has no member named 
  'request_bufflen'
  make[2]: *** [drivers/scsi/qla1280.o] Error 1
  
  It mystfies me how a patch like this can have been floating about in N
  submissions across M months and nobody has done an allmodconfig build or
  even a grep to find out what broke.
  
  ho hum.  I shall mark qla1280 BROKEN and shall plod onwards.
 
 A patch to fix this is in James' scsi-pending tree. Jes tested and
 fixed it (thanks !) so it will go to -mm via scsi-misc soon.

oh gawd.  So we have git-scsi-misc, git-scsi-rc-fixes and now
git-scsi-pending?

I hope you fixed imm, ppa and any other broken drivers?

 Boaz, it's better to send major scsi patches to -mm via scsi-misc to
 avoid problems like this.
 
 
 By the way, Andrew, can you add the following patchset to -mm?
 
 http://lkml.org/lkml/2007/10/24/138
 
 It fixes the IOMMUs' problem to merge scatter/gather segments without
 considering LLDs' restrictions.

hmm, OK, I saved them away to look at after next -mm.
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/4] scsi_data_buffer

2007-11-12 Thread FUJITA Tomonori
On Mon, 12 Nov 2007 23:07:03 -0800
Andrew Morton [EMAIL PROTECTED] wrote:

 On Tue, 13 Nov 2007 15:40:42 +0900 FUJITA Tomonori [EMAIL PROTECTED] wrote:
 
  On Mon, 12 Nov 2007 22:06:52 -0800
  Andrew Morton [EMAIL PROTECTED] wrote:
  
   On Thu, 08 Nov 2007 18:59:30 +0200 Boaz Harrosh [EMAIL PROTECTED] wrote:
   
  In preparation for bidi we abstract all IO members of scsi_cmnd,
  that will need to duplicate, into a substructure.

  - Group all IO members of scsi_cmnd into a scsi_data_buffer
structure.
   
   drivers/scsi/qla1280.c: In function 'qla1280_done':
   drivers/scsi/qla1280.c:1313: error: 'struct scsi_cmnd' has no member 
   named 'use_sg'
   drivers/scsi/qla1280.c:1314: error: 'struct scsi_cmnd' has no member 
   named 'request_buffer'
   drivers/scsi/qla1280.c:1315: error: 'struct scsi_cmnd' has no member 
   named 'use_sg'
   drivers/scsi/qla1280.c:1316: error: 'struct scsi_cmnd' has no member 
   named 'request_bufflen'
   drivers/scsi/qla1280.c:1318: error: 'struct scsi_cmnd' has no member 
   named 'request_bufflen'
   drivers/scsi/qla1280.c: In function 'qla1280_return_status':
   drivers/scsi/qla1280.c:1409: error: 'struct scsi_cmnd' has no member 
   named 'request_bufflen'
   drivers/scsi/qla1280.c:1416: error: 'struct scsi_cmnd' has no member 
   named 'resid'
   drivers/scsi/qla1280.c: In function 'qla1280_64bit_start_scsi':
   drivers/scsi/qla1280.c:2791: error: 'struct scsi_cmnd' has no member 
   named 'use_sg'
   drivers/scsi/qla1280.c:2792: error: 'struct scsi_cmnd' has no member 
   named 'request_buffer'
   drivers/scsi/qla1280.c:2793: error: 'struct scsi_cmnd' has no member 
   named 'use_sg'
   drivers/scsi/qla1280.c:2801: error: 'struct scsi_cmnd' has no member 
   named 'request_bufflen'
   drivers/scsi/qla1280.c:2896: error: 'struct scsi_cmnd' has no member 
   named 'use_sg'
   drivers/scsi/qla1280.c:2991: error: 'struct scsi_cmnd' has no member 
   named 'request_buffer'
   drivers/scsi/qla1280.c:2992: error: 'struct scsi_cmnd' has no member 
   named 'request_bufflen'
   drivers/scsi/qla1280.c:3004: error: 'struct scsi_cmnd' has no member 
   named 'request_bufflen'
   make[2]: *** [drivers/scsi/qla1280.o] Error 1
   
   It mystfies me how a patch like this can have been floating about in N
   submissions across M months and nobody has done an allmodconfig build or
   even a grep to find out what broke.
   
   ho hum.  I shall mark qla1280 BROKEN and shall plod onwards.
  
  A patch to fix this is in James' scsi-pending tree. Jes tested and
  fixed it (thanks !) so it will go to -mm via scsi-misc soon.
 
 oh gawd.  So we have git-scsi-misc, git-scsi-rc-fixes and now
 git-scsi-pending?

I don't think that you will have git-scsi-pending. James just uses the
tree for patches that are not ready for scsi-misc.


 I hope you fixed imm, ppa and any other broken drivers?

There are patches to fix both.

All the scsi drivers are ready for the scsi_data_buffer patchset
though some patches have not been merged yet, I think.

Probabaly, it's the easiest way to handle the scsi_data_buffer
patchset is adding it via scsi-misc.


  Boaz, it's better to send major scsi patches to -mm via scsi-misc to
  avoid problems like this.
  
  
  By the way, Andrew, can you add the following patchset to -mm?
  
  http://lkml.org/lkml/2007/10/24/138
  
  It fixes the IOMMUs' problem to merge scatter/gather segments without
  considering LLDs' restrictions.
 
 hmm, OK, I saved them away to look at after next -mm.

Thanks.
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html