* Drivers accessors latest version
@ 2007-10-30 17:49 Boaz Harrosh
2007-10-30 18:21 ` Boaz Harrosh
2007-11-03 19:41 ` James Bottomley
0 siblings, 2 replies; 7+ messages in thread
From: Boaz Harrosh @ 2007-10-30 17:49 UTC (permalink / raw)
To: James Bottomley, linux-scsi
Hi
lots of drivers changed yet again do to latest SG API fixes.
There is no use me sending all of them again. They are available
on a public git tree.
you can pull them from:
git-pull git://bhalevy.com/open-osd accessors
They are based on todays scsi-misc tree. If you want that I preform
any changes before you pull please just ask.
shortlog below
b6f2026... isd200.c: use one-element sg list in issuing commands
6b3727d... usb: transport - convert to accessors and !use_sg code path removal
3439a91... usb: protocol.c - convert to accessors and !use_sg code path removal
8739148... usb: shuttle_usbat.c - convert to accessors and !use_sg code path removal
a5207db... usb: freecom.c & sddr09.c - convert to accessors and !use_sg cleanup
1390243... NCR5380 familly convert to accessors & !use_sg cleanup
cdd77de... arm: scsi convert to accessors and !use_sg cleanup
9bc7373... nsp_cs.c convert to data accessors and !use_sg cleanup
b82e0e9... eata_pio.c: convert to accessors and !use_sg cleanup
2761373... a2091.c: convert to accessors and !use_sg cleanup
7f8e3b0... a3000.c: convert to accessors and !use_sg cleanup
36f4896... aha1542.c: convert to accessors and !use_sg cleanup
707fe55... atp870u.c: convert to accessors and !use_sg cleanup
2fb56c0... fd_mcs.c: convert to accessors and !use_sg cleanup
80736b1... imm.c: convert to accessors and !use_sg cleanup
25a55f7... ppa.c: convert to accessors and !use_sg cleanup
f9fb2ad... wd33c93.c: convert to accessors and !use_sg cleanup
ac0b49c... qlogicpti.c: convert to accessors and !use_sg cleanup
2f5cb3d... in2000.c: convert to accessors and !use_sg cleanup
cb23b86... scsi_debug: convert to use the data buffer accessors
f7e0b4d... wd7000.c - proper fix for boards without sg support
9cd3d65... Remove psi240i driver from kernel
4dcf751... Remove of seagate.c driver
there is also a scsi_data_buffer branch on the same tree.
The last version I sent had a stupid but fatal bug which
is now fixed.
Thanks
Boaz
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Drivers accessors latest version
2007-10-30 17:49 Drivers accessors latest version Boaz Harrosh
@ 2007-10-30 18:21 ` Boaz Harrosh
2007-11-03 19:41 ` James Bottomley
1 sibling, 0 replies; 7+ messages in thread
From: Boaz Harrosh @ 2007-10-30 18:21 UTC (permalink / raw)
To: James Bottomley, linux-scsi
On Tue, Oct 30 2007 at 19:49 +0200, Boaz Harrosh <bharrosh@panasas.com> wrote:
> Hi
>
> lots of drivers changed yet again do to latest SG API fixes.
> There is no use me sending all of them again. They are available
> on a public git tree.
>
> you can pull them from:
> git-pull git://bhalevy.com/open-osd accessors
>
> They are based on todays scsi-misc tree. If you want that I preform
> any changes before you pull please just ask.
>
There is also gitweb at:
http://www.bhalevy.com/git
Boaz
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Drivers accessors latest version
2007-10-30 17:49 Drivers accessors latest version Boaz Harrosh
2007-10-30 18:21 ` Boaz Harrosh
@ 2007-11-03 19:41 ` James Bottomley
2007-11-05 9:09 ` Boaz Harrosh
1 sibling, 1 reply; 7+ messages in thread
From: James Bottomley @ 2007-11-03 19:41 UTC (permalink / raw)
To: Boaz Harrosh; +Cc: linux-scsi
On Tue, 2007-10-30 at 19:49 +0200, Boaz Harrosh wrote:
> Hi
>
> lots of drivers changed yet again do to latest SG API fixes.
> There is no use me sending all of them again. They are available
> on a public git tree.
>
> you can pull them from:
> git-pull git://bhalevy.com/open-osd accessors
>
> They are based on todays scsi-misc tree. If you want that I preform
> any changes before you pull please just ask.
>
> shortlog below
I'm going through these now ... I'll cherry pick most into the relevant
trees.
> b6f2026... isd200.c: use one-element sg list in issuing commands
> 6b3727d... usb: transport - convert to accessors and !use_sg code path removal
> 3439a91... usb: protocol.c - convert to accessors and !use_sg code path removal
> 8739148... usb: shuttle_usbat.c - convert to accessors and !use_sg code path removal
> a5207db... usb: freecom.c & sddr09.c - convert to accessors and !use_sg cleanup
> 1390243... NCR5380 familly convert to accessors & !use_sg cleanup
This one has a clear merge bug:
index 2597209..bc63349 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -295,16 +295,24 @@ static __inline__ void initialize_SCp(Scsi_Cmnd * cmd)
* various queues are valid.
*/
+<<<<<<< HEAD:drivers/scsi/NCR5380.c
if (cmd->use_sg) {
cmd->SCp.buffer = (struct scatterlist *) cmd->request_buffer;
cmd->SCp.buffers_residual = cmd->use_sg - 1;
cmd->SCp.ptr = sg_virt(cmd->SCp.buffer);
+=======
+ if (scsi_bufflen(cmd)) {
+ cmd->SCp.buffer = scsi_sglist(cmd);
+ cmd->SCp.buffers_residual = scsi_sg_count(cmd) - 1;
+ cmd->SCp.ptr = page_address(cmd->SCp.buffer->page)+
+ cmd->SCp.buffer->offset;
+>>>>>>> d9ab658... NCR5380 familly convert to accessors & !use_sg cleanup:drive
So could you fix it up correctly, please (and just email the patch, I
think it's the only problem commit).
Thanks,
James
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: Drivers accessors latest version
2007-11-03 19:41 ` James Bottomley
@ 2007-11-05 9:09 ` Boaz Harrosh
2007-11-05 9:21 ` [PATCH] wd7000.c - proper fix for boards without sg support Boaz Harrosh
2007-11-05 9:23 ` [PATCH] NCR5380 familly convert to accessors & !use_sg cleanup Boaz Harrosh
0 siblings, 2 replies; 7+ messages in thread
From: Boaz Harrosh @ 2007-11-05 9:09 UTC (permalink / raw)
To: James Bottomley; +Cc: linux-scsi
On Sat, Nov 03 2007 at 21:41 +0200, James Bottomley <James.Bottomley@HansenPartnership.com> wrote:
>
> This one has a clear merge bug:
>
> index 2597209..bc63349 100644
> --- a/drivers/scsi/NCR5380.c
> +++ b/drivers/scsi/NCR5380.c
> <snip>
> So could you fix it up correctly, please (and just email the patch, I
> think it's the only problem commit).
>
> Thanks,
>
> James
>
Sorry about that. I saw it and fixed it in git tree, (rebase),
anticipating a branch pull. But since you had to cherry-pick them
by number you fetched the older patches. There is also a fix needed
for wd7000.c, the one you have will not compile.
I will send both patches as reply to this mail.
Again sorry
Boaz
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] wd7000.c - proper fix for boards without sg support
2007-11-05 9:09 ` Boaz Harrosh
@ 2007-11-05 9:21 ` Boaz Harrosh
2007-11-05 16:35 ` Boaz Harrosh
2007-11-05 9:23 ` [PATCH] NCR5380 familly convert to accessors & !use_sg cleanup Boaz Harrosh
1 sibling, 1 reply; 7+ messages in thread
From: Boaz Harrosh @ 2007-11-05 9:21 UTC (permalink / raw)
To: James Bottomley; +Cc: linux-scsi
- code used to set sg_tablesize to zero for board revision
less than 6. This is no longer supported, therefore I
use sg_tablesize=1 and open code the sg handling for that case.
- Get rid of use of SG_NONE which will be removed soon.
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
drivers/scsi/wd7000.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/scsi/wd7000.c b/drivers/scsi/wd7000.c
index 03cd44f..b4304ae 100644
--- a/drivers/scsi/wd7000.c
+++ b/drivers/scsi/wd7000.c
@@ -1108,13 +1108,10 @@ static int wd7000_queuecommand(struct scsi_cmnd *SCpnt,
scb->host = host;
nseg = scsi_sg_count(SCpnt);
- if (nseg) {
+ if (nseg > 1) {
struct scatterlist *sg;
unsigned i;
- if (SCpnt->device->host->sg_tablesize == SG_NONE) {
- panic("wd7000_queuecommand: scatter/gather not supported.\n");
- }
dprintk("Using scatter/gather with %d elements.\n", nseg);
sgb = scb->sgb;
@@ -1128,7 +1125,10 @@ static int wd7000_queuecommand(struct scsi_cmnd *SCpnt,
}
} else {
scb->op = 0;
- any2scsi(scb->dataptr, isa_virt_to_bus(scsi_sglist(SCpnt)));
+ if (nseg) {
+ struct scatterlist *sg = scsi_sglist(SCpnt);
+ any2scsi(scb->dataptr, isa_page_to_bus(sg_page(sg)) + sg->offset);
+ }
any2scsi(scb->maxlen, scsi_bufflen(SCpnt));
}
@@ -1524,7 +1524,7 @@ static __init int wd7000_detect(struct scsi_host_template *tpnt)
* For boards before rev 6.0, scatter/gather isn't supported.
*/
if (host->rev1 < 6)
- sh->sg_tablesize = SG_NONE;
+ sh->sg_tablesize = 1;
present++; /* count it */
--
1.5.3.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] NCR5380 familly convert to accessors & !use_sg cleanup
2007-11-05 9:09 ` Boaz Harrosh
2007-11-05 9:21 ` [PATCH] wd7000.c - proper fix for boards without sg support Boaz Harrosh
@ 2007-11-05 9:23 ` Boaz Harrosh
1 sibling, 0 replies; 7+ messages in thread
From: Boaz Harrosh @ 2007-11-05 9:23 UTC (permalink / raw)
To: James Bottomley; +Cc: linux-scsi
- This patch depends on:
NCR5380: Use scsi_eh API for REQUEST_SENSE invocation
- convert to accessors and !use_sg cleanup
- FIXME: Not sg-chain ready look for ++cmd->SCp.buffer
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
drivers/scsi/NCR5380.c | 14 +++++++-------
drivers/scsi/atari_NCR5380.c | 22 +++++++++++-----------
drivers/scsi/sun3_NCR5380.c | 22 +++++++++++-----------
3 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
index 2597209..1e9f828 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -295,16 +295,16 @@ static __inline__ void initialize_SCp(Scsi_Cmnd * cmd)
* various queues are valid.
*/
- if (cmd->use_sg) {
- cmd->SCp.buffer = (struct scatterlist *) cmd->request_buffer;
- cmd->SCp.buffers_residual = cmd->use_sg - 1;
+ if (scsi_bufflen(cmd)) {
+ cmd->SCp.buffer = scsi_sglist(cmd);
+ cmd->SCp.buffers_residual = scsi_sg_count(cmd) - 1;
cmd->SCp.ptr = sg_virt(cmd->SCp.buffer);
cmd->SCp.this_residual = cmd->SCp.buffer->length;
} else {
cmd->SCp.buffer = NULL;
cmd->SCp.buffers_residual = 0;
- cmd->SCp.ptr = (char *) cmd->request_buffer;
- cmd->SCp.this_residual = cmd->request_bufflen;
+ cmd->SCp.ptr = NULL;
+ cmd->SCp.this_residual = 0;
}
}
@@ -975,14 +975,14 @@ static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
case WRITE_6:
case WRITE_10:
hostdata->time_write[cmd->device->id] -= (jiffies - hostdata->timebase);
- hostdata->bytes_write[cmd->device->id] += cmd->request_bufflen;
+ hostdata->bytes_write[cmd->device->id] += scsi_bufflen(cmd);
hostdata->pendingw++;
break;
case READ:
case READ_6:
case READ_10:
hostdata->time_read[cmd->device->id] -= (jiffies - hostdata->timebase);
- hostdata->bytes_read[cmd->device->id] += cmd->request_bufflen;
+ hostdata->bytes_read[cmd->device->id] += scsi_bufflen(cmd);
hostdata->pendingr++;
break;
}
diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c
index a9680b5..d2ca3fa 100644
--- a/drivers/scsi/atari_NCR5380.c
+++ b/drivers/scsi/atari_NCR5380.c
@@ -511,9 +511,9 @@ static inline void initialize_SCp(Scsi_Cmnd *cmd)
* various queues are valid.
*/
- if (cmd->use_sg) {
- cmd->SCp.buffer = (struct scatterlist *)cmd->request_buffer;
- cmd->SCp.buffers_residual = cmd->use_sg - 1;
+ if (scsi_bufflen(cmd)) {
+ cmd->SCp.buffer = scsi_sglist(cmd);
+ cmd->SCp.buffers_residual = scsi_sg_count(cmd) - 1;
cmd->SCp.ptr = sg_virt(cmd->SCp.buffer);
cmd->SCp.this_residual = cmd->SCp.buffer->length;
/* ++roman: Try to merge some scatter-buffers if they are at
@@ -523,8 +523,8 @@ static inline void initialize_SCp(Scsi_Cmnd *cmd)
} else {
cmd->SCp.buffer = NULL;
cmd->SCp.buffers_residual = 0;
- cmd->SCp.ptr = (char *)cmd->request_buffer;
- cmd->SCp.this_residual = cmd->request_bufflen;
+ cmd->SCp.ptr = NULL;
+ cmd->SCp.this_residual = 0;
}
}
@@ -936,21 +936,21 @@ static int NCR5380_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
}
# endif
# ifdef NCR5380_STAT_LIMIT
- if (cmd->request_bufflen > NCR5380_STAT_LIMIT)
+ if (scsi_bufflen(cmd) > NCR5380_STAT_LIMIT)
# endif
switch (cmd->cmnd[0]) {
case WRITE:
case WRITE_6:
case WRITE_10:
hostdata->time_write[cmd->device->id] -= (jiffies - hostdata->timebase);
- hostdata->bytes_write[cmd->device->id] += cmd->request_bufflen;
+ hostdata->bytes_write[cmd->device->id] += scsi_bufflen(cmd);
hostdata->pendingw++;
break;
case READ:
case READ_6:
case READ_10:
hostdata->time_read[cmd->device->id] -= (jiffies - hostdata->timebase);
- hostdata->bytes_read[cmd->device->id] += cmd->request_bufflen;
+ hostdata->bytes_read[cmd->device->id] += scsi_bufflen(cmd);
hostdata->pendingr++;
break;
}
@@ -1352,21 +1352,21 @@ static irqreturn_t NCR5380_intr(int irq, void *dev_id)
static void collect_stats(struct NCR5380_hostdata* hostdata, Scsi_Cmnd *cmd)
{
# ifdef NCR5380_STAT_LIMIT
- if (cmd->request_bufflen > NCR5380_STAT_LIMIT)
+ if (scsi_bufflen(cmd) > NCR5380_STAT_LIMIT)
# endif
switch (cmd->cmnd[0]) {
case WRITE:
case WRITE_6:
case WRITE_10:
hostdata->time_write[cmd->device->id] += (jiffies - hostdata->timebase);
- /*hostdata->bytes_write[cmd->device->id] += cmd->request_bufflen;*/
+ /*hostdata->bytes_write[cmd->device->id] += scsi_bufflen(cmd);*/
hostdata->pendingw--;
break;
case READ:
case READ_6:
case READ_10:
hostdata->time_read[cmd->device->id] += (jiffies - hostdata->timebase);
- /*hostdata->bytes_read[cmd->device->id] += cmd->request_bufflen;*/
+ /*hostdata->bytes_read[cmd->device->id] += scsi_bufflen(cmd);*/
hostdata->pendingr--;
break;
}
diff --git a/drivers/scsi/sun3_NCR5380.c b/drivers/scsi/sun3_NCR5380.c
index 2dcde37..264f14a 100644
--- a/drivers/scsi/sun3_NCR5380.c
+++ b/drivers/scsi/sun3_NCR5380.c
@@ -515,9 +515,9 @@ static __inline__ void initialize_SCp(struct scsi_cmnd *cmd)
* various queues are valid.
*/
- if (cmd->use_sg) {
- cmd->SCp.buffer = (struct scatterlist *) cmd->request_buffer;
- cmd->SCp.buffers_residual = cmd->use_sg - 1;
+ if (scsi_bufflen(cmd)) {
+ cmd->SCp.buffer = scsi_sglist(cmd);
+ cmd->SCp.buffers_residual = scsi_sg_count(cmd) - 1;
cmd->SCp.ptr = (char *) SGADDR(cmd->SCp.buffer);
cmd->SCp.this_residual = cmd->SCp.buffer->length;
@@ -528,8 +528,8 @@ static __inline__ void initialize_SCp(struct scsi_cmnd *cmd)
} else {
cmd->SCp.buffer = NULL;
cmd->SCp.buffers_residual = 0;
- cmd->SCp.ptr = (char *) cmd->request_buffer;
- cmd->SCp.this_residual = cmd->request_bufflen;
+ cmd->SCp.ptr = NULL;
+ cmd->SCp.this_residual = 0;
}
}
@@ -935,7 +935,7 @@ static int NCR5380_queue_command(struct scsi_cmnd *cmd,
}
# endif
# ifdef NCR5380_STAT_LIMIT
- if (cmd->request_bufflen > NCR5380_STAT_LIMIT)
+ if (scsi_bufflen(cmd) > NCR5380_STAT_LIMIT)
# endif
switch (cmd->cmnd[0])
{
@@ -943,14 +943,14 @@ static int NCR5380_queue_command(struct scsi_cmnd *cmd,
case WRITE_6:
case WRITE_10:
hostdata->time_write[cmd->device->id] -= (jiffies - hostdata->timebase);
- hostdata->bytes_write[cmd->device->id] += cmd->request_bufflen;
+ hostdata->bytes_write[cmd->device->id] += scsi_bufflen(cmd);
hostdata->pendingw++;
break;
case READ:
case READ_6:
case READ_10:
hostdata->time_read[cmd->device->id] -= (jiffies - hostdata->timebase);
- hostdata->bytes_read[cmd->device->id] += cmd->request_bufflen;
+ hostdata->bytes_read[cmd->device->id] += scsi_bufflen(cmd);
hostdata->pendingr++;
break;
}
@@ -1345,7 +1345,7 @@ static void collect_stats(struct NCR5380_hostdata *hostdata,
struct scsi_cmnd *cmd)
{
# ifdef NCR5380_STAT_LIMIT
- if (cmd->request_bufflen > NCR5380_STAT_LIMIT)
+ if (scsi_bufflen(cmd) > NCR5380_STAT_LIMIT)
# endif
switch (cmd->cmnd[0])
{
@@ -1353,14 +1353,14 @@ static void collect_stats(struct NCR5380_hostdata *hostdata,
case WRITE_6:
case WRITE_10:
hostdata->time_write[cmd->device->id] += (jiffies - hostdata->timebase);
- /*hostdata->bytes_write[cmd->device->id] += cmd->request_bufflen;*/
+ /*hostdata->bytes_write[cmd->device->id] += scsi_bufflen(cmd);*/
hostdata->pendingw--;
break;
case READ:
case READ_6:
case READ_10:
hostdata->time_read[cmd->device->id] += (jiffies - hostdata->timebase);
- /*hostdata->bytes_read[cmd->device->id] += cmd->request_bufflen;*/
+ /*hostdata->bytes_read[cmd->device->id] += scsi_bufflen(cmd);*/
hostdata->pendingr--;
break;
}
--
1.5.3.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] wd7000.c - proper fix for boards without sg support
2007-11-05 9:21 ` [PATCH] wd7000.c - proper fix for boards without sg support Boaz Harrosh
@ 2007-11-05 16:35 ` Boaz Harrosh
0 siblings, 0 replies; 7+ messages in thread
From: Boaz Harrosh @ 2007-11-05 16:35 UTC (permalink / raw)
To: James Bottomley; +Cc: linux-scsi
On Mon, Nov 05 2007 at 11:21 +0200, Boaz Harrosh <bharrosh@panasas.com> wrote:
> - code used to set sg_tablesize to zero for board revision
> less than 6. This is no longer supported, therefore I
> use sg_tablesize=1 and open code the sg handling for that case.
> - Get rid of use of SG_NONE which will be removed soon.
>
> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
> ---
> drivers/scsi/wd7000.c | 12 ++++++------
> 1 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/scsi/wd7000.c b/drivers/scsi/wd7000.c
> index 03cd44f..b4304ae 100644
> --- a/drivers/scsi/wd7000.c
> +++ b/drivers/scsi/wd7000.c
> @@ -1108,13 +1108,10 @@ static int wd7000_queuecommand(struct scsi_cmnd *SCpnt,
<snip>
I see it is already applied so you might want to use this one instead
---
>From f7df6bc1477777256b015636a2ba8b1c8677bc4e Mon Sep 17 00:00:00 2001
From: Boaz Harrosh <bharrosh@panasas.com>
Date: Mon, 5 Nov 2007 18:31:51 +0200
Subject: [PATCH] wd7000.c sg breakage do to last commit
Last merge of this driver reverted an SG fix.
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
drivers/scsi/wd7000.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/scsi/wd7000.c b/drivers/scsi/wd7000.c
index 4ae2e5c..77f5847 100644
--- a/drivers/scsi/wd7000.c
+++ b/drivers/scsi/wd7000.c
@@ -1127,7 +1127,8 @@ static int wd7000_queuecommand(struct scsi_cmnd *SCpnt,
scb->op = 0;
if (nseg) {
struct scatterlist *sg = scsi_sglist(SCpnt);
- any2scsi(scb->dataptr, isa_page_to_bus(sg->page) + sg->offset);
+ any2scsi(scb->dataptr,
+ isa_page_to_bus(sg_page(sg)) + sg->offset);
}
any2scsi(scb->maxlen, scsi_bufflen(SCpnt));
}
--
1.5.3.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-11-05 16:35 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-30 17:49 Drivers accessors latest version Boaz Harrosh
2007-10-30 18:21 ` Boaz Harrosh
2007-11-03 19:41 ` James Bottomley
2007-11-05 9:09 ` Boaz Harrosh
2007-11-05 9:21 ` [PATCH] wd7000.c - proper fix for boards without sg support Boaz Harrosh
2007-11-05 16:35 ` Boaz Harrosh
2007-11-05 9:23 ` [PATCH] NCR5380 familly convert to accessors & !use_sg cleanup Boaz Harrosh
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.