linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Boaz Harrosh <bharrosh@panasas.com>
To: FUJITA Tomonori <tomof@acm.org>
Cc: linux-ide@vger.kernel.org, fujita.tomonori@lab.ntt.co.jp,
	linux-scsi@vger.kernel.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, Alan Stern <stern@rowland.harvard.edu>,
	Matthew Dharm <mdharm-scsi@one-eyed-alien.net>
Subject: Re: [PATCH 00/10] sg buffer copy helper functions
Date: Tue, 11 Mar 2008 12:05:06 +0200	[thread overview]
Message-ID: <47D65952.2050302@panasas.com> (raw)
In-Reply-To: <20080311070956E.tomof@acm.org>

On Tue, Mar 11 2008 at 0:39 +0200, FUJITA Tomonori <tomof@acm.org> wrote:
> 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.
> 

CC: Alan Stern <stern@rowland.harvard.edu>
CC: Matthew Dharm <mdharm-scsi@one-eyed-alien.net>

> 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.

Sure I can do that. Thanks

> 
> 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.

Boaz


  reply	other threads:[~2008-03-11 10:07 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   ` [PATCH 00/10] sg buffer copy helper functions FUJITA Tomonori
2008-03-11 10:05     ` Boaz Harrosh [this message]
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=47D65952.2050302@panasas.com \
    --to=bharrosh@panasas.com \
    --cc=Geert.Uytterhoeven@sonycom.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=Mark_Salyzyn@adaptec.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=mdharm-scsi@one-eyed-alien.net \
    --cc=stern@rowland.harvard.edu \
    --cc=tomof@acm.org \
    --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).