All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: Boaz Harrosh <bharrosh@panasas.com>,
	FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
	jens.axboe@oracle.com, linux-scsi@vger.kernel.org,
	bhalevy@panasas.com, hch@infradead.org,
	akpm@linux-foundation.org, michaelc@cs.wisc.edu
Subject: Re: [PATCH v2] add bidi support for block pc requests
Date: Sat, 07 Jul 2007 11:27:11 -0400	[thread overview]
Message-ID: <468FB0CF.9000500@garzik.org> (raw)
In-Reply-To: <1180876623.3876.50.camel@mulgrave.il.steeleye.com>

James Bottomley wrote:
> On Sun, 2007-06-03 at 10:45 +0300, Boaz Harrosh wrote:
>> Jeff Garzik wrote:
>>> Boaz Harrosh wrote:
>>>> FUJITA Tomonori wrote:
>>>>> From: Boaz Harrosh <bharrosh@panasas.com>
>>>>> Subject: Re: [PATCH v2] add bidi support for block pc requests
>>>>> Date: Thu, 17 May 2007 17:00:21 +0300
>>>>>
>>>>>> Yes Tomo found it at ata_scsi_slave_config(). Attached below the way I
>>>>>> fixed it. Now it works with 127.
>>>>> I think that we can just remove blk_queue_max_phys_segments since the
>>>>> ata drivers seem to set sg_tablesize to LIBATA_MAX_PRD.
>>>>>
>>>> Who should send a patch upstream? (I cc'ed Jeff Garzik)
>>>>
>>>> Boaz
>>>>
>>>> diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
>>>> index dd81fa7..3660f3e 100644
>>>> --- a/drivers/ata/libata-scsi.c
>>>> +++ b/drivers/ata/libata-scsi.c
>>>> @@ -800,8 +800,6 @@ int ata_scsi_slave_config(struct scsi_device *sdev)
>>>>
>>>>  	ata_scsi_sdev_config(sdev);
>>>>
>>>> -	blk_queue_max_phys_segments(sdev->request_queue, LIBATA_MAX_PRD);
>>>> -
>>>>  	sdev->manage_start_stop = 1;
>>> I don't mind the patch, but could someone refresh me as to the context?
>>>
>>> Is there something wrong with the above code, or is it simply redundant 
>>> to the scsi_host_template settings in each LLDD?
>>>
>>> 	Jeff
>>>
>>>
>>>
>> Hi Jeff
>> What happens is that if SCSI-ml sets an higher value than LIBATA_MAX_PRD (=128)
>> than every thing is OK and libata-scsi will only see its LIBATA_MAX_PRD. But what
>> happens if SCSI-ml sets a lower value? It will than crash on unexpected high sg
>> count. My first Patch was an "if >" but Tomo said that it is redundant since
>> drivers do that already. So I guess it is your call. Can it be removed or we need
>> a: if ( sdev->request_queue->max_phys_segments > LIBATA_MAX_PRD)
> 
> Ordinarily, in SCSI, phys_segments is the wrong thing for a driver to
> set because what a driver wants to see is what comes out the other side
> of dma_map_sg() (which is controlled by hw_segments) not what goes in.
> However, I could see libata having an interest in the phys_segments if
> the physical region descriptors are going to the device via PIO ... is
> that what this is for?

LIBATA_MAX_PRD is the maximum number of DMA scatter/gather elements 
permitted by the HBA's DMA engine, for a single ATA command.

The PIO code doesn't really care about segments.

	Jeff




  reply	other threads:[~2007-07-07 15:27 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-08  2:25 [PATCH v2] add bidi support for block pc requests FUJITA Tomonori
2007-05-08 18:53 ` Boaz Harrosh
2007-05-08 20:01   ` James Bottomley
2007-05-09  7:46     ` Boaz Harrosh
2007-05-09 10:52       ` FUJITA Tomonori
2007-05-09 13:58         ` Boaz Harrosh
2007-05-09 14:54           ` FUJITA Tomonori
2007-05-09 14:55           ` James Bottomley
2007-05-09 16:54             ` Boaz Harrosh
2007-05-10  6:53               ` FUJITA Tomonori
2007-05-10  7:45                 ` FUJITA Tomonori
2007-05-10 12:37                   ` Boaz Harrosh
2007-05-10 13:01                     ` FUJITA Tomonori
2007-05-10 15:10                     ` Douglas Gilbert
2007-05-10 15:48                       ` Boaz Harrosh
2007-05-11 16:26                       ` James Bottomley
2007-05-16 17:29       ` Boaz Harrosh
2007-05-16 17:53         ` Jens Axboe
2007-05-16 18:06           ` James Bottomley
2007-05-16 18:13             ` Jens Axboe
2007-05-17  8:46               ` Boaz Harrosh
2007-05-17  2:57           ` FUJITA Tomonori
2007-05-17  5:48             ` Jens Axboe
2007-05-17  5:59               ` FUJITA Tomonori
2007-05-17  8:49                 ` Boaz Harrosh
2007-05-17 11:12                   ` FUJITA Tomonori
2007-05-17 17:37                     ` Benny Halevy
2007-05-24 16:37                     ` Boaz Harrosh
2007-05-24 16:46                       ` Boaz Harrosh
2007-05-24 16:47                       ` FUJITA Tomonori
2007-05-24 16:59                         ` Boaz Harrosh
2007-05-17 11:29                   ` FUJITA Tomonori
2007-05-17 13:27                   ` James Bottomley
2007-05-17 14:00                     ` Boaz Harrosh
2007-05-17 14:11                       ` FUJITA Tomonori
2007-05-17 15:49                         ` Boaz Harrosh
2007-06-01 20:21                           ` Jeff Garzik
2007-06-03  7:45                             ` Boaz Harrosh
2007-06-03 13:17                               ` James Bottomley
2007-07-07 15:27                                 ` Jeff Garzik [this message]
2007-07-07 15:42                                   ` James Bottomley
2007-07-07 16:59                                     ` Jeff Garzik
2007-05-09 10:49     ` FUJITA Tomonori

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=468FB0CF.9000500@garzik.org \
    --to=jeff@garzik.org \
    --cc=James.Bottomley@SteelEye.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhalevy@panasas.com \
    --cc=bharrosh@panasas.com \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=hch@infradead.org \
    --cc=jens.axboe@oracle.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michaelc@cs.wisc.edu \
    /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 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.