linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Tejun Heo <tj@kernel.org>
Cc: IDE/ATA development list <linux-ide@vger.kernel.org>,
	David Haun <drhaun88@gmail.com>,
	liw@liw.fi, jmcarranza@gmail.com
Subject: Re: [PATCH #upstream-fixes] libata: handle SEMB signature better
Date: Tue, 14 Apr 2009 17:08:18 -0400	[thread overview]
Message-ID: <49E4FB42.7010609@garzik.org> (raw)
In-Reply-To: <49E4FA13.1090400@kernel.org>

Tejun Heo wrote:
> Hello, Jeff.
> 
> Jeff Garzik wrote:
>>>      switch (class) {
>>> +    case ATA_DEV_SEMB:
>>> +        class = ATA_DEV_ATA;    /* some hard drives report SEMB sig */
>>>      case ATA_DEV_ATA:
>>>          tf.command = ATA_CMD_ID_ATA;
>>>          break;
>> Why assign class now, as opposed to after IDENTIFY DEVICE succeeds / fails?
> 
> The class variable indicates which class the code is gonna try not the
> one which is discovered, so it's more consistent to set it before
> trying it out.
> 
>>> @@ -2119,6 +2125,7 @@ retry:
>>>      else
>>>          err_mask = ata_do_dev_read_id(dev, &tf, id);
>>>  
>>> +    err_mask |= AC_ERR_DEV;
>>>      if (err_mask) {
>>>          if (err_mask & AC_ERR_NODEV_HINT) {
>>>              ata_dev_printk(dev, KERN_DEBUG,
>> Why is err_mask being unconditionally set?
> 
> Oh.. c**p, that's debug code I forgot to remove.  Thanks for spotting
> it.  :-)
> 
>> I would think this would make more sense:
>>
>>     if (!err_mask && class == ATA_DEV_SEMB)
>>         class = ATA_DEV_ATA;
>>     else if (err_mask) {
>>         if (err_mask & AC_ERR_NODEV_HINT) {
>>         ...
> 
> I made the code a fast exit path because I didn't know how an actual
> SEMB device would respond to it.  If the device timeouts IDENTIFYs,
> retrying can be quite painful.  ATA drives w/ SEMB signature being
> extrmemely rare, I think it's better to trade their slight chance of
> detection failure but then again it's not like we have a lot of SEMB
> devices.  What do you think?

That's fine -- it is mainly the unconditional err_mask assignment that 
confused me.  I was trying to figure out the rest of the changes, in the 
context of that variable assignment :)

	Jeff





  reply	other threads:[~2009-04-14 21:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-14 10:35 [PATCH #upstream-fixes] libata: handle SEMB signature better Tejun Heo
2009-04-14 12:12 ` Jeff Garzik
2009-04-14 21:03   ` Tejun Heo
2009-04-14 21:08     ` Jeff Garzik [this message]
2009-04-14 21:21       ` [PATCH UPDATED " Tejun Heo
2009-04-16  7:37         ` Borislav Petkov
2009-04-16 19:22         ` Jeff Garzik

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=49E4FB42.7010609@garzik.org \
    --to=jeff@garzik.org \
    --cc=drhaun88@gmail.com \
    --cc=jmcarranza@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=liw@liw.fi \
    --cc=tj@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).