2007-10-27 18:44:19

by Al Viro

[permalink] [raw]
Subject: [PATCH] scatterlist fallout: drivers/scsi/arm/


Signed-off-by: Al Viro <[email protected]>
---
diff --git a/drivers/scsi/arm/scsi.h b/drivers/scsi/arm/scsi.h
index 21ba571..2d09fef 100644
--- a/drivers/scsi/arm/scsi.h
+++ b/drivers/scsi/arm/scsi.h
@@ -39,7 +39,7 @@ static inline int next_SCp(struct scsi_pointer *SCp)
SCp->buffer++;
SCp->buffers_residual--;
SCp->ptr = (char *)
- (page_address(SCp->buffer->page) +
+ (page_address(sg_page(SCp->buffer)) +
SCp->buffer->offset);
SCp->this_residual = SCp->buffer->length;
} else {
@@ -77,7 +77,7 @@ static inline void init_SCp(struct scsi_cmnd *SCpnt)
SCpnt->SCp.buffer = (struct scatterlist *) SCpnt->request_buffer;
SCpnt->SCp.buffers_residual = SCpnt->use_sg - 1;
SCpnt->SCp.ptr = (char *)
- (page_address(SCpnt->SCp.buffer->page) +
+ (page_address(sg_page(SCpnt->SCp.buffer)) +
SCpnt->SCp.buffer->offset);
SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length;
SCpnt->SCp.phase = SCpnt->request_bufflen;


2007-10-27 19:27:29

by Russell King

[permalink] [raw]
Subject: Re: [PATCH] scatterlist fallout: drivers/scsi/arm/

Already have this one queued for Linus in my tree.

On Sat, Oct 27, 2007 at 07:44:04PM +0100, Al Viro wrote:
>
> Signed-off-by: Al Viro <[email protected]>
> ---
> diff --git a/drivers/scsi/arm/scsi.h b/drivers/scsi/arm/scsi.h
> index 21ba571..2d09fef 100644
> --- a/drivers/scsi/arm/scsi.h
> +++ b/drivers/scsi/arm/scsi.h
> @@ -39,7 +39,7 @@ static inline int next_SCp(struct scsi_pointer *SCp)
> SCp->buffer++;
> SCp->buffers_residual--;
> SCp->ptr = (char *)
> - (page_address(SCp->buffer->page) +
> + (page_address(sg_page(SCp->buffer)) +
> SCp->buffer->offset);
> SCp->this_residual = SCp->buffer->length;
> } else {
> @@ -77,7 +77,7 @@ static inline void init_SCp(struct scsi_cmnd *SCpnt)
> SCpnt->SCp.buffer = (struct scatterlist *) SCpnt->request_buffer;
> SCpnt->SCp.buffers_residual = SCpnt->use_sg - 1;
> SCpnt->SCp.ptr = (char *)
> - (page_address(SCpnt->SCp.buffer->page) +
> + (page_address(sg_page(SCpnt->SCp.buffer)) +
> SCpnt->SCp.buffer->offset);
> SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length;
> SCpnt->SCp.phase = SCpnt->request_bufflen;

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:

2007-10-27 20:22:27

by Russell King

[permalink] [raw]
Subject: Re: [PATCH] scatterlist fallout: drivers/scsi/arm/

On Sat, Oct 27, 2007 at 07:44:04PM +0100, Al Viro wrote:
>
> Signed-off-by: Al Viro <[email protected]>
> ---
> diff --git a/drivers/scsi/arm/scsi.h b/drivers/scsi/arm/scsi.h
> index 21ba571..2d09fef 100644
> --- a/drivers/scsi/arm/scsi.h
> +++ b/drivers/scsi/arm/scsi.h
> @@ -39,7 +39,7 @@ static inline int next_SCp(struct scsi_pointer *SCp)
> SCp->buffer++;
> SCp->buffers_residual--;
> SCp->ptr = (char *)
> - (page_address(SCp->buffer->page) +
> + (page_address(sg_page(SCp->buffer)) +
> SCp->buffer->offset);
> SCp->this_residual = SCp->buffer->length;
> } else {
> @@ -77,7 +77,7 @@ static inline void init_SCp(struct scsi_cmnd *SCpnt)
> SCpnt->SCp.buffer = (struct scatterlist *) SCpnt->request_buffer;
> SCpnt->SCp.buffers_residual = SCpnt->use_sg - 1;
> SCpnt->SCp.ptr = (char *)
> - (page_address(SCpnt->SCp.buffer->page) +
> + (page_address(sg_page(SCpnt->SCp.buffer)) +
> SCpnt->SCp.buffer->offset);
> SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length;
> SCpnt->SCp.phase = SCpnt->request_bufflen;

FYI, here's what I have queued (cut'n'pasted so probably won't apply):

diff --git a/drivers/scsi/arm/scsi.h b/drivers/scsi/arm/scsi.h
index 21ba571..bb6550e 100644
--- a/drivers/scsi/arm/scsi.h
+++ b/drivers/scsi/arm/scsi.h
@@ -38,9 +38,7 @@ static inline int next_SCp(struct scsi_pointer *SCp)
if (ret) {
SCp->buffer++;
SCp->buffers_residual--;
- SCp->ptr = (char *)
- (page_address(SCp->buffer->page) +
- SCp->buffer->offset);
+ SCp->ptr = sg_virt(SCp->buffer);
SCp->this_residual = SCp->buffer->length;
} else {
SCp->ptr = NULL;
@@ -76,9 +74,7 @@ static inline void init_SCp(struct scsi_cmnd *SCpnt)

SCpnt->SCp.buffer = (struct scatterlist *) SCpnt->request_buffer;
SCpnt->SCp.buffers_residual = SCpnt->use_sg - 1;
- SCpnt->SCp.ptr = (char *)
- (page_address(SCpnt->SCp.buffer->page) +
- SCpnt->SCp.buffer->offset);
+ SCpnt->SCp.ptr = sg_virt(SCpnt->SCp.buffer);
SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length;
SCpnt->SCp.phase = SCpnt->request_bufflen;



--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:

2007-10-28 05:21:18

by Linus Torvalds

[permalink] [raw]
Subject: Re: [PATCH] scatterlist fallout: drivers/scsi/arm/



On Sat, 27 Oct 2007, Russell King wrote:
>
> FYI, here's what I have queued (cut'n'pasted so probably won't apply):

Yes, much nicer.

Linus

2007-10-29 09:02:10

by Jens Axboe

[permalink] [raw]
Subject: Re: [PATCH] scatterlist fallout: drivers/scsi/arm/

On Sat, Oct 27 2007, Russell King wrote:
> On Sat, Oct 27, 2007 at 07:44:04PM +0100, Al Viro wrote:
> >
> > Signed-off-by: Al Viro <[email protected]>
> > ---
> > diff --git a/drivers/scsi/arm/scsi.h b/drivers/scsi/arm/scsi.h
> > index 21ba571..2d09fef 100644
> > --- a/drivers/scsi/arm/scsi.h
> > +++ b/drivers/scsi/arm/scsi.h
> > @@ -39,7 +39,7 @@ static inline int next_SCp(struct scsi_pointer *SCp)
> > SCp->buffer++;
> > SCp->buffers_residual--;
> > SCp->ptr = (char *)
> > - (page_address(SCp->buffer->page) +
> > + (page_address(sg_page(SCp->buffer)) +
> > SCp->buffer->offset);
> > SCp->this_residual = SCp->buffer->length;
> > } else {
> > @@ -77,7 +77,7 @@ static inline void init_SCp(struct scsi_cmnd *SCpnt)
> > SCpnt->SCp.buffer = (struct scatterlist *) SCpnt->request_buffer;
> > SCpnt->SCp.buffers_residual = SCpnt->use_sg - 1;
> > SCpnt->SCp.ptr = (char *)
> > - (page_address(SCpnt->SCp.buffer->page) +
> > + (page_address(sg_page(SCpnt->SCp.buffer)) +
> > SCpnt->SCp.buffer->offset);
> > SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length;
> > SCpnt->SCp.phase = SCpnt->request_bufflen;
>
> FYI, here's what I have queued (cut'n'pasted so probably won't apply):
>
> diff --git a/drivers/scsi/arm/scsi.h b/drivers/scsi/arm/scsi.h
> index 21ba571..bb6550e 100644
> --- a/drivers/scsi/arm/scsi.h
> +++ b/drivers/scsi/arm/scsi.h
> @@ -38,9 +38,7 @@ static inline int next_SCp(struct scsi_pointer *SCp)
> if (ret) {
> SCp->buffer++;
> SCp->buffers_residual--;
> - SCp->ptr = (char *)
> - (page_address(SCp->buffer->page) +
> - SCp->buffer->offset);
> + SCp->ptr = sg_virt(SCp->buffer);
> SCp->this_residual = SCp->buffer->length;
> } else {
> SCp->ptr = NULL;
> @@ -76,9 +74,7 @@ static inline void init_SCp(struct scsi_cmnd *SCpnt)
>
> SCpnt->SCp.buffer = (struct scatterlist *) SCpnt->request_buffer;
> SCpnt->SCp.buffers_residual = SCpnt->use_sg - 1;
> - SCpnt->SCp.ptr = (char *)
> - (page_address(SCpnt->SCp.buffer->page) +
> - SCpnt->SCp.buffer->offset);
> + SCpnt->SCp.ptr = sg_virt(SCpnt->SCp.buffer);
> SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length;
> SCpnt->SCp.phase = SCpnt->request_bufflen;

Russell, will you be merging this yourself or do you want me to include
it in the sg fixup branch?

--
Jens Axboe

2007-10-29 09:13:11

by Russell King

[permalink] [raw]
Subject: Re: [PATCH] scatterlist fallout: drivers/scsi/arm/

On Mon, Oct 29, 2007 at 09:59:36AM +0100, Jens Axboe wrote:
> On Sat, Oct 27 2007, Russell King wrote:
> > On Sat, Oct 27, 2007 at 07:44:04PM +0100, Al Viro wrote:
> > >
> > > Signed-off-by: Al Viro <[email protected]>
> > > ---
> > > diff --git a/drivers/scsi/arm/scsi.h b/drivers/scsi/arm/scsi.h
> > > index 21ba571..2d09fef 100644
> > > --- a/drivers/scsi/arm/scsi.h
> > > +++ b/drivers/scsi/arm/scsi.h
> > > @@ -39,7 +39,7 @@ static inline int next_SCp(struct scsi_pointer *SCp)
> > > SCp->buffer++;
> > > SCp->buffers_residual--;
> > > SCp->ptr = (char *)
> > > - (page_address(SCp->buffer->page) +
> > > + (page_address(sg_page(SCp->buffer)) +
> > > SCp->buffer->offset);
> > > SCp->this_residual = SCp->buffer->length;
> > > } else {
> > > @@ -77,7 +77,7 @@ static inline void init_SCp(struct scsi_cmnd *SCpnt)
> > > SCpnt->SCp.buffer = (struct scatterlist *) SCpnt->request_buffer;
> > > SCpnt->SCp.buffers_residual = SCpnt->use_sg - 1;
> > > SCpnt->SCp.ptr = (char *)
> > > - (page_address(SCpnt->SCp.buffer->page) +
> > > + (page_address(sg_page(SCpnt->SCp.buffer)) +
> > > SCpnt->SCp.buffer->offset);
> > > SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length;
> > > SCpnt->SCp.phase = SCpnt->request_bufflen;
> >
> > FYI, here's what I have queued (cut'n'pasted so probably won't apply):
> >
> > diff --git a/drivers/scsi/arm/scsi.h b/drivers/scsi/arm/scsi.h
> > index 21ba571..bb6550e 100644
> > --- a/drivers/scsi/arm/scsi.h
> > +++ b/drivers/scsi/arm/scsi.h
> > @@ -38,9 +38,7 @@ static inline int next_SCp(struct scsi_pointer *SCp)
> > if (ret) {
> > SCp->buffer++;
> > SCp->buffers_residual--;
> > - SCp->ptr = (char *)
> > - (page_address(SCp->buffer->page) +
> > - SCp->buffer->offset);
> > + SCp->ptr = sg_virt(SCp->buffer);
> > SCp->this_residual = SCp->buffer->length;
> > } else {
> > SCp->ptr = NULL;
> > @@ -76,9 +74,7 @@ static inline void init_SCp(struct scsi_cmnd *SCpnt)
> >
> > SCpnt->SCp.buffer = (struct scatterlist *) SCpnt->request_buffer;
> > SCpnt->SCp.buffers_residual = SCpnt->use_sg - 1;
> > - SCpnt->SCp.ptr = (char *)
> > - (page_address(SCpnt->SCp.buffer->page) +
> > - SCpnt->SCp.buffer->offset);
> > + SCpnt->SCp.ptr = sg_virt(SCpnt->SCp.buffer);
> > SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length;
> > SCpnt->SCp.phase = SCpnt->request_bufflen;
>
> Russell, will you be merging this yourself or do you want me to include
> it in the sg fixup branch?

It's already merged into the ARM git tree as of Friday. Waiting for
ack's from various people for other merged patches before sending the
set to Linus.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:

2007-10-29 09:14:36

by Jens Axboe

[permalink] [raw]
Subject: Re: [PATCH] scatterlist fallout: drivers/scsi/arm/

On Mon, Oct 29 2007, Russell King wrote:
> On Mon, Oct 29, 2007 at 09:59:36AM +0100, Jens Axboe wrote:
> > On Sat, Oct 27 2007, Russell King wrote:
> > > On Sat, Oct 27, 2007 at 07:44:04PM +0100, Al Viro wrote:
> > > >
> > > > Signed-off-by: Al Viro <[email protected]>
> > > > ---
> > > > diff --git a/drivers/scsi/arm/scsi.h b/drivers/scsi/arm/scsi.h
> > > > index 21ba571..2d09fef 100644
> > > > --- a/drivers/scsi/arm/scsi.h
> > > > +++ b/drivers/scsi/arm/scsi.h
> > > > @@ -39,7 +39,7 @@ static inline int next_SCp(struct scsi_pointer *SCp)
> > > > SCp->buffer++;
> > > > SCp->buffers_residual--;
> > > > SCp->ptr = (char *)
> > > > - (page_address(SCp->buffer->page) +
> > > > + (page_address(sg_page(SCp->buffer)) +
> > > > SCp->buffer->offset);
> > > > SCp->this_residual = SCp->buffer->length;
> > > > } else {
> > > > @@ -77,7 +77,7 @@ static inline void init_SCp(struct scsi_cmnd *SCpnt)
> > > > SCpnt->SCp.buffer = (struct scatterlist *) SCpnt->request_buffer;
> > > > SCpnt->SCp.buffers_residual = SCpnt->use_sg - 1;
> > > > SCpnt->SCp.ptr = (char *)
> > > > - (page_address(SCpnt->SCp.buffer->page) +
> > > > + (page_address(sg_page(SCpnt->SCp.buffer)) +
> > > > SCpnt->SCp.buffer->offset);
> > > > SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length;
> > > > SCpnt->SCp.phase = SCpnt->request_bufflen;
> > >
> > > FYI, here's what I have queued (cut'n'pasted so probably won't apply):
> > >
> > > diff --git a/drivers/scsi/arm/scsi.h b/drivers/scsi/arm/scsi.h
> > > index 21ba571..bb6550e 100644
> > > --- a/drivers/scsi/arm/scsi.h
> > > +++ b/drivers/scsi/arm/scsi.h
> > > @@ -38,9 +38,7 @@ static inline int next_SCp(struct scsi_pointer *SCp)
> > > if (ret) {
> > > SCp->buffer++;
> > > SCp->buffers_residual--;
> > > - SCp->ptr = (char *)
> > > - (page_address(SCp->buffer->page) +
> > > - SCp->buffer->offset);
> > > + SCp->ptr = sg_virt(SCp->buffer);
> > > SCp->this_residual = SCp->buffer->length;
> > > } else {
> > > SCp->ptr = NULL;
> > > @@ -76,9 +74,7 @@ static inline void init_SCp(struct scsi_cmnd *SCpnt)
> > >
> > > SCpnt->SCp.buffer = (struct scatterlist *) SCpnt->request_buffer;
> > > SCpnt->SCp.buffers_residual = SCpnt->use_sg - 1;
> > > - SCpnt->SCp.ptr = (char *)
> > > - (page_address(SCpnt->SCp.buffer->page) +
> > > - SCpnt->SCp.buffer->offset);
> > > + SCpnt->SCp.ptr = sg_virt(SCpnt->SCp.buffer);
> > > SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length;
> > > SCpnt->SCp.phase = SCpnt->request_bufflen;
> >
> > Russell, will you be merging this yourself or do you want me to include
> > it in the sg fixup branch?
>
> It's already merged into the ARM git tree as of Friday. Waiting for
> ack's from various people for other merged patches before sending the
> set to Linus.

Great, thanks.

--
Jens Axboe

2007-10-29 09:21:22

by Al Viro

[permalink] [raw]
Subject: Re: [PATCH] scatterlist fallout: drivers/scsi/arm/

On Mon, Oct 29, 2007 at 10:12:06AM +0100, Jens Axboe wrote:
> > > Russell, will you be merging this yourself or do you want me to include
> > > it in the sg fixup branch?
> >
> > It's already merged into the ARM git tree as of Friday. Waiting for
> > ack's from various people for other merged patches before sending the
> > set to Linus.
>
> Great, thanks.

Speaking of sg fixups... What should be done about zfcp_address_to_sg()?
You've added the third argument to all calls, but not to definition...

static inline void
zfcp_address_to_sg(void *address, struct scatterlist *list, size_t size)
{
sg_set_buf(list, address, size);
}
seems to be a plausible guess at what you meant to do, but that's a guess
without anything to back it - I really have not looked into the area at all.

2007-10-29 09:38:56

by Jens Axboe

[permalink] [raw]
Subject: Re: [PATCH] scatterlist fallout: drivers/scsi/arm/

On Mon, Oct 29 2007, Al Viro wrote:
> On Mon, Oct 29, 2007 at 10:12:06AM +0100, Jens Axboe wrote:
> > > > Russell, will you be merging this yourself or do you want me to include
> > > > it in the sg fixup branch?
> > >
> > > It's already merged into the ARM git tree as of Friday. Waiting for
> > > ack's from various people for other merged patches before sending the
> > > set to Linus.
> >
> > Great, thanks.
>
> Speaking of sg fixups... What should be done about zfcp_address_to_sg()?
> You've added the third argument to all calls, but not to definition...
>
> static inline void
> zfcp_address_to_sg(void *address, struct scatterlist *list, size_t size)
> {
> sg_set_buf(list, address, size);
> }
> seems to be a plausible guess at what you meant to do, but that's a guess
> without anything to back it - I really have not looked into the area at all.

Should already be fixed up in the 'sg' branch, like this:

diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h
index 0754542..e268f79 100644
--- a/drivers/s390/scsi/zfcp_def.h
+++ b/drivers/s390/scsi/zfcp_def.h
@@ -70,11 +70,12 @@ zfcp_sg_to_address(struct scatterlist *list)
* zfcp_address_to_sg - set up struct scatterlist from kernel address
* @address: kernel address
* @list: struct scatterlist
+ * @size: buffer size
*/
static inline void
-zfcp_address_to_sg(void *address, struct scatterlist *list)
+zfcp_address_to_sg(void *address, struct scatterlist *list, unsigned int size)
{
- sg_set_buf(list, address, 0);
+ sg_set_buf(list, address, size);
}

#define REQUEST_LIST_SIZE 128

--
Jens Axboe