linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: "zhao, forrest" <forrest.zhao@intel.com>,
	liml@rtr.ca, linux-ide@vger.kernel.org
Subject: Re: [PATCH] Snoop SET FEATURES - WRITE CACHE ENABLE/DISABLE command
Date: Mon, 29 May 2006 18:43:47 +0900	[thread overview]
Message-ID: <447AC253.10608@gmail.com> (raw)
In-Reply-To: <447ABCD0.2060305@garzik.org>

Jeff Garzik wrote:
> Tejun Heo wrote:
>> Jeff Garzik wrote:
>>> 4) Using [__]scsi_add_device() is a regression from using 
>>> scsi_scan_target()
>>
>> I think it's taken from the hotplug patch 
>> store-attached-SCSI-device[1].  Using [__]scsi_add_device() seems to 
>> be the only way to reliably obtain the attached sdev.
> 
> 
> We want to continue to use scsi_scan_target(), because that's the 
> preferred model.  In SCSI-land, the target is what receives RPC calls 
> (ATA commands, for us), which are then dispatched internally to one of 
> $N logical units (LU) according to the logical unit number (LUN).
> 
> In libata, of course, there is only one logical unit attached to the 
> target, LUN 0.
> 
> Regardless, using [__]scsi_add_device() is a regression, because libata 
> handles the transport layer completely -- and importantly -- handles all 
> addressing.  scsi_add_device() is specifically for H/C/I/L, i.e. SPI 
> (parallel SCSI) addressing.
> 
> Eventually SCSI will reach a point where HCIL is not the only addressing 
> method.  SAS disks, for example, are addressed via a LUN's WWN.  SCSI 
> fibre channel addresses LUNs via WWN as well.  Once SCSI core does not 
> exclusively use HCIL addressing, libata will reap the benefits of using 
> the proper scsi_target model.

I fully agree with everything you said, but we're faced with a real 
problem here.  libata needs to know the current attached sdev for 
hotplug and rescan; however, there's no way to determine the current 
sdev after it's already added.

scsi_device_lookup*() functions don't discriminate between dead and live 
devices and ends up operating on the first device it stumbles upon (the 
dead one if it's still hanging around).  Storing dev->sdev was a way to 
get around the limitation.  If a SCSI function which looks up the live 
device is implemented, we don't need to store dev->sdev at all.  IMHO, 
the current implementation can be left as it is until such interface is 
implemented.

Thanks.

-- 
tejun

  reply	other threads:[~2006-05-29  9:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-25  9:02 [PATCH] Snoop SET FEATURES - WRITE CACHE ENABLE/DISABLE command zhao, forrest
2006-05-27  0:15 ` Jeff Garzik
2006-05-29  6:35   ` zhao, forrest
2006-05-29 11:29     ` Mark Lord
2006-05-29  9:08   ` Tejun Heo
2006-05-29  9:18     ` zhao, forrest
2006-05-29  9:46       ` Tejun Heo
2006-05-29  9:20     ` Jeff Garzik
2006-05-29  9:43       ` Tejun Heo [this message]
2006-05-30  3:57         ` Jeff Garzik
2006-05-30  4:41     ` Jeff Garzik
2006-05-30  4:50       ` Tejun Heo
2006-05-30  4:57         ` Jeff Garzik
2006-05-30  5:10           ` Tejun Heo
2006-05-30  5:08             ` zhao, forrest
2006-05-30  7:22               ` Tejun Heo

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=447AC253.10608@gmail.com \
    --to=htejun@gmail.com \
    --cc=forrest.zhao@intel.com \
    --cc=jeff@garzik.org \
    --cc=liml@rtr.ca \
    --cc=linux-ide@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).