RE: [PATCHv2] aacraid: don't assign cpu_to_le32(constant) to u8

2007-11-01 Thread Salyzyn, Mark
ACK v2

Sincerely -- Mark Salyzyn

 -Original Message-
 From: Stephen Rothwell [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, November 01, 2007 2:32 AM
 To: AACRAID
 Cc: linux-scsi@vger.kernel.org; LKML
 Subject: [PATCHv2] aacraid: don't assign cpu_to_le32(constant) to u8
 
 Noticed on PowerPC allmod config build:
 
 drivers/scsi/aacraid/commsup.c:1342: warning: large integer 
 implicitly truncated to unsigned type
 drivers/scsi/aacraid/commsup.c:1343: warning: large integer 
 implicitly truncated to unsigned type
 drivers/scsi/aacraid/commsup.c:1344: warning: large integer 
 implicitly truncated to unsigned type
 
 Also fix some whitespace on the changed lines.
 
 Signed-off-by: Stephen Rothwell [EMAIL PROTECTED]
 ---
  drivers/scsi/aacraid/commsup.c |6 +++---
  1 files changed, 3 insertions(+), 3 deletions(-)
 
 This version just fixes a couple of whitespace anomolies on 
 the lines I
 changed.
 
 -- 
 Cheers,
 Stephen Rothwell[EMAIL PROTECTED]
 
 diff --git a/drivers/scsi/aacraid/commsup.c 
 b/drivers/scsi/aacraid/commsup.c
 index 240a0bb..3c2dbc0 100644
 --- a/drivers/scsi/aacraid/commsup.c
 +++ b/drivers/scsi/aacraid/commsup.c
 @@ -1339,9 +1339,9 @@ int aac_check_health(struct aac_dev * aac)
   aif = (struct aac_aifcmd *)hw_fib-data;
   aif-command = cpu_to_le32(AifCmdEventNotify);
   aif-seqnum = cpu_to_le32(0x);
 - aif-data[0] = cpu_to_le32(AifEnExpEvent);
 - aif-data[1] = cpu_to_le32(AifExeFirmwarePanic);
 - aif-data[2] = cpu_to_le32(AifHighPriority);
 + aif-data[0] = AifEnExpEvent;
 + aif-data[1] = AifExeFirmwarePanic;
 + aif-data[2] = AifHighPriority;
   aif-data[3] = cpu_to_le32(BlinkLED);
  
   /*
 -- 
 1.5.3.4
 
-
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: DMA API Re: Remove dma_coherent_mem interface

2007-11-01 Thread ian
On Thu, 2007-11-01 at 19:07 +0900, Paul Mundt wrote:
 Indeed. The SH case for OHCI on MFDs is the same. So that's at least 2
 users. 

three if you count James SCSI card.

-
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: DMA API Re: Remove dma_coherent_mem interface

2007-11-01 Thread Bernhard Walle
* ian [EMAIL PROTECTED] [2007-11-01 16:33]:
 On Thu, 2007-11-01 at 19:07 +0900, Paul Mundt wrote:
  Indeed. The SH case for OHCI on MFDs is the same. So that's at least 2
  users. 
 
 three if you count James SCSI card.

Four if you count http://most4linux.sourceforge.net/.


Thanks,
   Bernhard
-
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] aha152x: Use scsi_eh API for REQUEST_SENSE invocation

2007-11-01 Thread Boaz Harrosh

  - Use new scsi_eh_prep/restor_cmnd() for synchronous
REQUEST_SENSE invocation.

Signed-off-by: Boaz Harrosh [EMAIL PROTECTED]

 drivers/scsi/aha152x.c |   38 --
 1 files changed, 8 insertions(+), 30 deletions(-)

diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
index ea8c699..6ccdc96 100644
--- a/drivers/scsi/aha152x.c
+++ b/drivers/scsi/aha152x.c
@@ -260,6 +260,7 @@
 #include scsi/scsi_dbg.h
 #include scsi/scsi_host.h
 #include scsi/scsi_transport_spi.h
+#include scsi/scsi_eh.h
 #include aha152x.h
 
 static LIST_HEAD(aha152x_host_list);
@@ -558,9 +559,7 @@ struct aha152x_hostdata {
 struct aha152x_scdata {
Scsi_Cmnd *next;/* next sc in queue */
struct completion *done;/* semaphore to block on */
-   unsigned char aha_orig_cmd_len;
-   unsigned char aha_orig_cmnd[MAX_COMMAND_SIZE];
-   int aha_orig_resid;
+   struct scsi_eh_save ses;
 };
 
 /* access macros for hostdata */
@@ -1017,16 +1016,10 @@ static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, 
struct completion *complete,
   SCp.buffers_residual : left buffers in list
   SCp.phase: current state of the command */
 
-   if ((phase  (check_condition|resetting)) || !scsi_sglist(SCpnt)) {
-   if (phase  check_condition) {
-   SCpnt-SCp.ptr   = SCpnt-sense_buffer;
-   SCpnt-SCp.this_residual = sizeof(SCpnt-sense_buffer);
-   scsi_set_resid(SCpnt, sizeof(SCpnt-sense_buffer));
-   } else {
-   SCpnt-SCp.ptr   = NULL;
-   SCpnt-SCp.this_residual = 0;
-   scsi_set_resid(SCpnt, 0);
-   }
+   if ((phase  resetting) || !scsi_sglist(SCpnt)) {
+   SCpnt-SCp.ptr   = NULL;
+   SCpnt-SCp.this_residual = 0;
+   scsi_set_resid(SCpnt, 0);
SCpnt-SCp.buffer   = NULL;
SCpnt-SCp.buffers_residual = 0;
} else {
@@ -1561,10 +1554,7 @@ static void busfree_run(struct Scsi_Host *shpnt)
}
 #endif
 
-   /* restore old command */
-   memcpy(cmd-cmnd, sc-aha_orig_cmnd, sizeof(cmd-cmnd));
-   cmd-cmd_len = sc-aha_orig_cmd_len;
-   scsi_set_resid(cmd, sc-aha_orig_resid);
+   scsi_eh_restore_cmnd(cmd, sc-ses);
 
cmd-SCp.Status = SAM_STAT_CHECK_CONDITION;
 
@@ -1587,22 +1577,10 @@ static void busfree_run(struct Scsi_Host *shpnt)
DPRINTK(debug_eh, ERR_LEAD requesting 
sense\n, CMDINFO(ptr));
 #endif
 
-   /* save old command */
sc = SCDATA(ptr);
/* It was allocated in aha152x_internal_queue? 
*/
BUG_ON(!sc);
-   memcpy(sc-aha_orig_cmnd, ptr-cmnd,
-   sizeof(ptr-cmnd));
-   sc-aha_orig_cmd_len = ptr-cmd_len;
-   sc-aha_orig_resid = scsi_get_resid(ptr);
-
-   ptr-cmnd[0] = REQUEST_SENSE;
-   ptr-cmnd[1] = 0;
-   ptr-cmnd[2] = 0;
-   ptr-cmnd[3] = 0;
-   ptr-cmnd[4] = 
sizeof(ptr-sense_buffer);
-   ptr-cmnd[5] = 0;
-   ptr-cmd_len = 6;
+   scsi_eh_prep_cmnd(ptr, sc-ses, NULL, 0, ~0);
 
DO_UNLOCK(flags);
aha152x_internal_queue(ptr, NULL, 
check_condition, ptr-scsi_done);
-- 
1.5.3.1

-
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 2/4] block layer varlen-cdb

2007-11-01 Thread Matthew Wilcox
On Thu, Nov 01, 2007 at 08:05:06PM +0200, Boaz Harrosh wrote:
 @@ -287,8 +287,13 @@ struct request {
   /*
* when request is used as a packet command carrier
*/
 - unsigned int cmd_len;
 + unsigned short cmd_len;
 + unsigned short varlen_cdb_len;  /* length of varlen_cdb buffer */
   unsigned char cmd[BLK_MAX_CDB];
 + unsigned char *varlen_cdb;  /* an optional variable-length cdb.
 +  * points to a user buffer that must be
 +  * valid until end of request
 +  */
  

Try this instead:

unsigned int cmd_len;
-   unsigned char cmd[BLK_MAX_CDB];
+   unsigned char _cmd[BLK_MAX_CDB];
+   unsigned char *cmd;

Then initialise cmd to the address of _cmd.  If you need to override it
later (ie patch 3), you can.

-- 
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.
-
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/3] debloat aic7xxx and aic79xx drivers

2007-11-01 Thread Matthew Wilcox
On Sun, Oct 14, 2007 at 04:00:10PM +0100, Denys Vlasenko wrote:
 Deinlines and moves big functions from .h to .c files.
 Adds prototypes for ahc_lookup_scb and ahd_lookup_scb to .h files.

Adds trailing whitespace.
.dotest/patch:216:   * We also set the full residual flag which the 
Adds trailing whitespace.
.dotest/patch:2383:{   
warning: 2 lines add trailing whitespaces.

-- 
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.
-
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/3] debloat aic7xxx and aic79xx drivers

2007-11-01 Thread Matthew Wilcox
On Sun, Oct 14, 2007 at 04:02:15PM +0100, Denys Vlasenko wrote:
 Adds more consts

error: patch failed: drivers/scsi/aic7xxx/aic79xx.h:1328
error: drivers/scsi/aic7xxx/aic79xx.h: patch does not apply
error: patch failed: drivers/scsi/aic7xxx/aic7xxx.h:1145
error: drivers/scsi/aic7xxx/aic7xxx.h: patch does not apply

-- 
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.
-
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/3] debloat aic7xxx and aic79xx drivers

2007-11-01 Thread Matthew Wilcox
On Thu, Nov 01, 2007 at 03:23:28PM -0700, Randy Dunlap wrote:
 when attempting to apply to scsi-misc or linus-git or ... ?

scsi-misc

-- 
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.
-
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: Prevent IO during partner login

2007-11-01 Thread Robert Jennings
The prior version of this patch introduced a problem for the error
handler routines.  Calling ibmvscsi_eh_reset_device during a
initialization/login would result in the reset failing without need.
 
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.
 
By setting the request_limit in send_srp_login to 1 we allowed login
requests to be sent to the server adapter.  If this was not an initial
login, but was a login after a disconnect with the server, other I/O
requests could attempt to be processed before the login occured.
 
To address this we can set the request_limit to 0 while doing the login
and add an exception where login requests, along with task management
events, are always passed to the server.
 
There is a case where the request_limit had already reached 0 would
result
in all events being sent rather than returning SCSI_MLQUEUE_HOST_BUSY;
this
has also been fixed by this patch.
 
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: b/drivers/scsi/ibmvscsi/ibmvscsi.c
===
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -556,7 +556,7 @@ static int ibmvscsi_send_srp_event(struc
   unsigned long timeout)
 {
u64 *crq_as_u64 = (u64 *) evt_struct-crq;
-   int request_status;
+   int request_status = 0;
int rc;
 
/* If we have exhausted our request limit, just fail this request,
@@ -574,6 +574,13 @@ static int ibmvscsi_send_srp_event(struc
if (request_status  -1)
goto send_error;
/* Otherwise, we may have run out of requests. */
+   /* If request limit was 0 when we started the adapter is in the
+* process of performing a login with the server adapter, or
+* we may have run out of requests.
+*/
+   else if (request_status == -1 
+evt_struct-iu.srp.login_req.opcode != SRP_LOGIN_REQ)
+   goto send_busy;
/* Abort and reset calls should make it through.
 * Nothing except abort and reset should use the last two
 * slots unless we had two or less to begin with.
@@ -633,7 +640,8 @@ static int ibmvscsi_send_srp_event(struc
unmap_cmd_data(evt_struct-iu.srp.cmd, evt_struct, hostdata-dev);
 
free_event_struct(hostdata-pool, evt_struct);
-   atomic_inc(hostdata-request_limit);
+   if (request_status != -1)
+   atomic_inc(hostdata-request_limit);
return SCSI_MLQUEUE_HOST_BUSY;
 
  send_error:
@@ -927,10 +935,11 @@ static int send_srp_login(struct ibmvscs
login-req_buf_fmt = SRP_BUF_FORMAT_DIRECT | SRP_BUF_FORMAT_INDIRECT;

spin_lock_irqsave(hostdata-host-host_lock, flags);
-   /* Start out with a request limit of 1, since this is negotiated in
-* the login request we are just sending
+   /* Start out with a request limit of 0, since this is negotiated in
+* the login request we are just sending and login requests always
+* get sent by the driver regardless of request_limit.
 */
-   atomic_set(hostdata-request_limit, 1);
+   atomic_set(hostdata-request_limit, 0);
 
rc = ibmvscsi_send_srp_event(evt_struct, hostdata, init_timeout * 2);
spin_unlock_irqrestore(hostdata-host-host_lock, flags);
@@ -967,6 +976,7 @@ static int ibmvscsi_eh_abort_handler(str
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
@@ -1010,15 +1020,30 @@ static int ibmvscsi_eh_abort_handler(str
tsk_mgmt-lun, tsk_mgmt-task_tag);
 
evt-sync_srp = srp_rsp;
-   init_completion(evt-comp);
-   rsp_rc = ibmvscsi_send_srp_event(evt, hostdata, init_timeout * 2);
-   spin_unlock_irqrestore(hostdata-host-host_lock, flags);
+
+   wait_switch = jiffies + (init_timeout * HZ);
+   do {
+   init_completion(evt-comp);
+   rsp_rc = ibmvscsi_send_srp_event(evt, hostdata, init_timeout * 
2);
+
+   if (rsp_rc != SCSI_MLQUEUE_HOST_BUSY)
+   break;
+
+   spin_unlock_irqrestore(hostdata-host-host_lock, flags);
+   msleep(10);
+   spin_lock_irqsave(hostdata-host-host_lock, flags);
+   } while (time_before(jiffies, wait_switch));
+
if (rsp_rc != 0) {
+   free_event_struct(found_evt-hostdata-pool, found_evt);
+   

Re: [PATCH 2/4] block layer varlen-cdb

2007-11-01 Thread Benny Halevy
On Nov. 01, 2007, 20:40 +0200, Matthew Wilcox [EMAIL PROTECTED] wrote:
 On Thu, Nov 01, 2007 at 08:05:06PM +0200, Boaz Harrosh wrote:
 @@ -287,8 +287,13 @@ struct request {
  /*
   * when request is used as a packet command carrier
   */
 -unsigned int cmd_len;
 +unsigned short cmd_len;
 +unsigned short varlen_cdb_len;  /* length of varlen_cdb buffer */
  unsigned char cmd[BLK_MAX_CDB];
 +unsigned char *varlen_cdb;  /* an optional variable-length cdb.
 + * points to a user buffer that must be
 + * valid until end of request
 + */
  
 
 Try this instead:
 
   unsigned int cmd_len;
 - unsigned char cmd[BLK_MAX_CDB];
 + unsigned char _cmd[BLK_MAX_CDB];
 + unsigned char *cmd;
 
 Then initialise cmd to the address of _cmd.  If you need to override it
 later (ie patch 3), you can.
 

I agree this is probably the cleanest implementation but when Boaz and I
initially discussed this approach he convinced me that LL block devices assume
that req-cmd_len = BLK_MAX_CDB and it is unsafe at the moment to expose them
potentially larger commands.

-
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