From: Jeff Garzik <jeff@garzik.org>
To: Boaz Harrosh <bharrosh@panasas.com>
Cc: linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
Jens Axboe <jens.axboe@oracle.com>, Tejun Heo <htejun@gmail.com>
Subject: Re: [PATCH] libata: rewrite SCSI host scheme to be one per ATA host
Date: Wed, 22 Apr 2009 12:48:05 -0400 [thread overview]
Message-ID: <49EF4A45.8040901@garzik.org> (raw)
In-Reply-To: <49EF0A92.1070400@panasas.com>
Boaz Harrosh wrote:
> On 04/22/2009 12:23 PM, Jeff Garzik wrote:
>> Jeff Garzik wrote:
>>> Currently, libata creates a Scsi_Host per port. This was originally
>>> done to leverage SCSI's infrastructure to arbitrate among master/slave
>>> devices, but is not needed for most modern SATA controllers. And I
>>> _think_ it is not needed for master/slave if done properly, either.
>> BTW note the above, with regards to the libata SCSI->block conversion.
>> libata currently relies on SCSI for some amount of generic device
>> arbitration, in several situations (see ->qc_defer,
>> SCSI_MLQUEUE_.*_BUSY). libata expects SCSI to be intelligent and not
>> starve devices, etc.
>>
>>
>>> I was able to successfully boot the following patch on
>>> AHCI/x86-64/Fedora.
>>>
>>> It may work with other controllers -- TRY AT YOUR OWN RISK. It will
>>> probably fail for master/slave configurations, and SAS & PMP also
>>> need looking at. It yielded this lsscsi output on my AHCI box:
>>>
>>> [0:0:0:0] disk ATA ST3500320AS SD15 /dev/sda
>>> [0:2:0:0] disk ATA G.SKILL 128GB SS 02.1 /dev/sdb
>>> [0:5:0:0] cd/dvd PIONEER BD-ROM BDC-202 1.04 /dev/sr0
>> For comparison, here is unmodified 2.6.30-rc3:
>>
>> [jgarzik@bd ~]$ lsscsi
>> [0:0:0:0] disk ATA ST3500320AS SD15 /dev/sda
>> [2:0:0:0] disk ATA G.SKILL 128GB SS 02.1 /dev/sdb
>> [5:0:0:0] cd/dvd PIONEER BD-ROM BDC-202 1.04 /dev/sr0
>>
>
> Could the master/slave be simply solved by emulating a SCSI LUN
> for example below is my machine today:
> []$ lsscsi
> [0:0:0:0] disk ATA ST3160023A 3.01 /dev/sda
> [1:0:0:0] cd/dvd _NEC DVD_RW ND-3550A 1.05 /dev/sr0
> [4:0:0:0] disk ATA WDC WD1600JS-60M 10.0 /dev/sdb
>
> the /dev/sda and /dev/sr0 share a master/slave wide cable (sdb is sata)
>
> it could be made to scan as:
> []$ lsscsi
> [0:0:0:0] disk ATA ST3160023A 3.01 /dev/sda
> [0:0:0:1] cd/dvd _NEC DVD_RW ND-3550A 1.05 /dev/sr0
> [1:0:0:0] disk ATA WDC WD1600JS-60M 10.0 /dev/sdb
>
> So we need to emulate the REPORT_LUN (or what ever else) to return
> two LUNs. Or do you want to report a separate target for the master/slave?
Mapping master/slave is not difficult -- each should be a separate
target, just like with parallel SCSI.
The issue with master/slave and simplex is guaranteeing that only _one_
command may be executing at a time, for a given set of targets, i.e.
only one command per master/slave pair, only one command per pair of
simplex ports (== 4 ATA devices max).
Originally this was done by setting can_queue==1, cmd_per_lun==1, and
assigning each master/slave pair to a different Scsi_Host.
Jeff
next prev parent reply other threads:[~2009-04-22 16:48 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-22 9:09 [PATCH] libata: rewrite SCSI host scheme to be one per ATA host Jeff Garzik
2009-04-22 9:23 ` Jeff Garzik
2009-04-22 12:16 ` Boaz Harrosh
2009-04-22 15:10 ` Daniela Engert
2009-04-22 15:18 ` Alan Cox
2009-04-22 15:37 ` James Bottomley
2009-04-22 16:27 ` Alan Cox
2009-04-22 18:36 ` Jeff Garzik
2009-04-22 19:27 ` James Bottomley
2009-04-22 16:48 ` Jeff Garzik [this message]
2009-04-23 6:35 ` Jens Axboe
2009-04-23 10:39 ` Jeff Garzik
2009-04-23 10:43 ` Jens Axboe
2009-04-22 13:09 ` Mark Lord
2009-04-22 16:52 ` Jeff Garzik
2009-04-22 19:08 ` Grant Grundler
2009-04-23 11:00 ` Jeff Garzik
2009-04-23 17:59 ` Grant Grundler
2009-04-23 18:09 ` James Bottomley
2009-04-24 11:00 ` Stefan Richter
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=49EF4A45.8040901@garzik.org \
--to=jeff@garzik.org \
--cc=bharrosh@panasas.com \
--cc=htejun@gmail.com \
--cc=jens.axboe@oracle.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/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).