linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: FUJITA Tomonori <tomof@acm.org>
To: bharrosh@panasas.com
Cc: linux-ide@vger.kernel.org, fujita.tomonori@lab.ntt.co.jp,
	linux-scsi@vger.kernel.org, tomof@acm.org,
	James.Bottomley@HansenPartnership.com, jens.axboe@oracle.com,
	dougg@torque.net, Geert.Uytterhoeven@sonycom.com,
	tony.luck@intel.com, Mark_Salyzyn@adaptec.com,
	ed.lin@promise.com, linuxraid@amcc.com,
	linux-usb@vger.kernel.org
Subject: Re: [PATCH 00/10] sg buffer copy helper functions
Date: Tue, 11 Mar 2008 07:39:44 +0900	[thread overview]
Message-ID: <20080311070956E.tomof@acm.org> (raw)
In-Reply-To: <47D5415C.3010904@panasas.com>

CC'ed linux-ide,

On Mon, 10 Mar 2008 16:10:36 +0200
Boaz Harrosh <bharrosh@panasas.com> wrote:

> On Sun, Mar 09 2008 at 6:44 +0200, FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> wrote:
> > This patchset adds new two helper functions to copy data between an SG
> > table and liner buffer, and converts severl LLDs to use them.
> > 
> > The new APIs are used mainly in the code to spoof SCSI commands
> > (INQUIRY, READ CAPACITY, MODE SENSE etc), that is, LLDs build a fake
> > reposense and copy it to the sg list in scsi_cmnd struct. Several LLDs
> > have similar functions for such code. This patchset removes such
> > duplication.
> > 
> > Another reason to do this work is that because we relaxed the default
> > alignment requirements (from 511 to 3) post 2.6.24, the above commands
> > might come with multiple scatter gather entries but several LLDs make
> > the assumption that such commands come with only one sg entries and
> > can't handle multiple sg entries. The new APIs can handle multiple sg
> > entries so LLDs don't need to care about anything.
> > 
> > The first patch adds the new APIs to lib/scatterlist.c and the rest
> > are for SCSI. I like to push the whole patchset via scsi-misc (since
> > it's easier).
> > 
> > This is against scsi-misc (a6680f71ca27ea78c4c4e577076aecb9ace476f1).
> > 
> >  arch/ia64/hp/sim/simscsi.c    |   23 ++--------
> >  drivers/scsi/3w-9xxx.c        |   21 ++++-----
> >  drivers/scsi/3w-xxxx.c        |   12 +----
> >  drivers/scsi/aacraid/aachba.c |   49 ++++++++--------------
> >  drivers/scsi/ips.c            |   50 ++++-------------------
> >  drivers/scsi/ps3rom.c         |   92 ++++------------------------------------
> >  drivers/scsi/scsi_debug.c     |   79 ++++++-----------------------------
> >  drivers/scsi/stex.c           |   66 ++++-------------------------
> >  include/linux/scatterlist.h   |    5 ++
> >  include/scsi/scsi_cmnd.h      |   14 ++++++
> >  lib/scatterlist.c             |   90 ++++++++++++++++++++++++++++++++++++++++
> >  11 files changed, 182 insertions(+), 319 deletions(-)
> > 
> >
> 
> Hi Tomo. Nice cleanup, Cheers.
> 
> Have you had a look at drivers/usb/storage/protocol.c usb_stor_access_xfer_buf() ?
> It looks like it could also use these, but there they have a twist where they want
> to do it in parts. Do you think that the code there could also use the helpers 
> presented here somehow? (I know that one of the USB guys was asking about it)

I've not. If the USB people are eager to use the new APIs, I'll try
though I prefer to keep them simple.

There are other potential users of the new APIs, gdth and libata.

I think that gdth can use the APIs without any changes to the APIs but
I leave it to a gdth expert.

ata_scsi_simulate could use the new APIs but it directly builds a
response in the buffer of a sg list instead of building a response in
temporary buffer and copying it to a sg list. So the new APIs are not
fit for it. If libata people are fine with switching to the latter,
I'll send a patch.

       reply	other threads:[~2008-03-10 22:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1205037877-12843-1-git-send-email-fujita.tomonori@lab.ntt.co.jp>
     [not found] ` <47D5415C.3010904@panasas.com>
2008-03-10 22:39   ` FUJITA Tomonori [this message]
2008-03-11 10:05     ` [PATCH 00/10] sg buffer copy helper functions Boaz Harrosh
2008-03-11 20:09     ` Alan Stern
2008-03-12  0:14       ` FUJITA Tomonori
2008-03-12  0:28         ` FUJITA Tomonori
2008-03-12  2:24           ` FUJITA Tomonori
2008-03-12 16:04           ` Alan Stern
2008-03-13  0:03             ` FUJITA Tomonori
2008-03-13  0:18               ` FUJITA Tomonori
2008-03-13 18:34                 ` Alan Stern
2008-03-12 16:01         ` Alan Stern
2008-03-12 16:26           ` Boaz Harrosh
2008-03-13  0:03           ` FUJITA Tomonori
2008-03-13 18:32             ` Alan Stern
2008-03-14  9:35               ` FUJITA Tomonori
     [not found]                 ` <20080314183434J.tomof-HInyCGIudOg@public.gmane.org>
2008-03-14 14:46                   ` Alan Stern
2008-03-16 11:55                     ` FUJITA Tomonori
2008-03-16 17:18                       ` Alan Stern
2008-03-17  3:23                         ` FUJITA Tomonori
2008-03-17 14:06                           ` Alan Stern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080311070956E.tomof@acm.org \
    --to=tomof@acm.org \
    --cc=Geert.Uytterhoeven@sonycom.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=Mark_Salyzyn@adaptec.com \
    --cc=bharrosh@panasas.com \
    --cc=dougg@torque.net \
    --cc=ed.lin@promise.com \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=jens.axboe@oracle.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linuxraid@amcc.com \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).