All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: Lin Mac <mkl0301@gmail.com>
Cc: cbouatmailru@gmail.com, linux-arm-kernel@lists.infradead.org,
	jgarzik@pobox.com, linux-ide@vger.kernel.org
Subject: Re: Cannot detect SATA disks w/ CONFIG_SATA_PMP w/o actually using SATA multiplier
Date: Thu, 02 Dec 2010 11:31:12 +0100	[thread overview]
Message-ID: <4CF77570.9000700@gmail.com> (raw)
In-Reply-To: <AANLkTimWqFh-PD4DFXwaRmthb5Lyw3MAFknFmT7vp5pY@mail.gmail.com>

Hello,

On 12/02/2010 11:23 AM, Lin Mac wrote:
>> One thing which could be possible is that the controller stashes the
>> result code for the PMP aware SRST according to the PMP number instead
>> of the usual place, so the driver can't see it.  In that case, the
>> driver can be modified to check both places I suppose but if the
>> hardware can be fixed, that would be great.
> the usual place, I presume you mean PxTFD+PxSIG.
> I've check RFIS of received FIS structure after softreset failed and
> nothing there. (UFIS neither)
> Is there any other suspect to check?

Have you checked all PxTFDs?  It could be that the controller is
saving it in the wrong slot.

> My situation is that device is sending D2H Reg FIS, but controller is
> not reflecting it on PxTFD, PxSIG, or RFIS of received FIS
> structure.With the patch I sent, it seems the controller receives D2H
> Reg FIS of the same PMP setting of the previous sent H2D Reg FIS, and
> drop the different one.

If the controller is dropping the D2H Reg FIS altogether, it'll
probably need more intricate workaround.  :-(

> The AHCI controller I used is AHCI v1.1 compatible, command-based switching.
> 
> In SATA spec (rev2.6) 16.7.1, it says:
> 
> A host controller may support command-based switching by implementing
> the Port Multiplier Port (PMP) field in the SControl register as
> detailed in section 14.1.3.In order to use this mechanism, host
> software would set the PMP field appropriately before issuing a
> command to a device conected to the Port Multiplier. (...) Note that
> the PMP field shall be set to the control port when host software
> issues commands to the Port Multiplier itself.
> --
> 
> In AHCI spec, the PMP field of PxSCTL "is not used by AHCI".Does it
> implies AHCI would set it and software doesn't need to do anything?
> 
> 13.13.4.1 Port Multiplier Discovery
> If  a device is present, the host issues a software reset with the PM
> Port field set  to the control port. The host checks the signature
> value returned and if....
> --
> 
> SATA spec didn't says what to do IF it received a data with PMP
> setting doesn't match it's current setting (did it?). While 13.13.4.1
> only implies the host should receive the signature successfully, even
> if it is of different PMP setting.

The probing sequence is described somewhere in the ahci spec and I'm
fairly sure the dropping behavior you're describing is out of spec.
You'll need to find a way to reliably distinguish a PMP device and
then probably implement the workaround in custom hardreset or
softreset method for the specific controller.

Good luck.

-- 
tejun

WARNING: multiple messages have this Message-ID (diff)
From: htejun@gmail.com (Tejun Heo)
To: linux-arm-kernel@lists.infradead.org
Subject: Cannot detect SATA disks w/ CONFIG_SATA_PMP w/o actually using SATA multiplier
Date: Thu, 02 Dec 2010 11:31:12 +0100	[thread overview]
Message-ID: <4CF77570.9000700@gmail.com> (raw)
In-Reply-To: <AANLkTimWqFh-PD4DFXwaRmthb5Lyw3MAFknFmT7vp5pY@mail.gmail.com>

Hello,

On 12/02/2010 11:23 AM, Lin Mac wrote:
>> One thing which could be possible is that the controller stashes the
>> result code for the PMP aware SRST according to the PMP number instead
>> of the usual place, so the driver can't see it.  In that case, the
>> driver can be modified to check both places I suppose but if the
>> hardware can be fixed, that would be great.
> the usual place, I presume you mean PxTFD+PxSIG.
> I've check RFIS of received FIS structure after softreset failed and
> nothing there. (UFIS neither)
> Is there any other suspect to check?

Have you checked all PxTFDs?  It could be that the controller is
saving it in the wrong slot.

> My situation is that device is sending D2H Reg FIS, but controller is
> not reflecting it on PxTFD, PxSIG, or RFIS of received FIS
> structure.With the patch I sent, it seems the controller receives D2H
> Reg FIS of the same PMP setting of the previous sent H2D Reg FIS, and
> drop the different one.

If the controller is dropping the D2H Reg FIS altogether, it'll
probably need more intricate workaround.  :-(

> The AHCI controller I used is AHCI v1.1 compatible, command-based switching.
> 
> In SATA spec (rev2.6) 16.7.1, it says:
> 
> A host controller may support command-based switching by implementing
> the Port Multiplier Port (PMP) field in the SControl register as
> detailed in section 14.1.3.In order to use this mechanism, host
> software would set the PMP field appropriately before issuing a
> command to a device conected to the Port Multiplier. (...) Note that
> the PMP field shall be set to the control port when host software
> issues commands to the Port Multiplier itself.
> --
> 
> In AHCI spec, the PMP field of PxSCTL "is not used by AHCI".Does it
> implies AHCI would set it and software doesn't need to do anything?
> 
> 13.13.4.1 Port Multiplier Discovery
> If  a device is present, the host issues a software reset with the PM
> Port field set  to the control port. The host checks the signature
> value returned and if....
> --
> 
> SATA spec didn't says what to do IF it received a data with PMP
> setting doesn't match it's current setting (did it?). While 13.13.4.1
> only implies the host should receive the signature successfully, even
> if it is of different PMP setting.

The probing sequence is described somewhere in the ahci spec and I'm
fairly sure the dropping behavior you're describing is out of spec.
You'll need to find a way to reliably distinguish a PMP device and
then probably implement the workaround in custom hardreset or
softreset method for the specific controller.

Good luck.

-- 
tejun

  reply	other threads:[~2010-12-02 10:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-30  4:02 Cannot detect SATA disks w/ CONFIG_SATA_PMP w/o actually using SATA multiplier Lin Mac
2010-11-30  4:02 ` Lin Mac
2010-11-30 14:08 ` Tejun Heo
2010-11-30 14:08   ` Tejun Heo
2010-11-30 17:46   ` Lin Mac
2010-11-30 17:46     ` Lin Mac
2010-11-30 19:49     ` Tejun Heo
2010-11-30 19:49       ` Tejun Heo
2010-12-01  5:53       ` Lin Mac
2010-12-01  5:53         ` Lin Mac
2010-12-01  9:45         ` Tejun Heo
2010-12-01  9:45           ` Tejun Heo
2010-12-02 10:23       ` Lin Mac
2010-12-02 10:23         ` Lin Mac
2010-12-02 10:31         ` Tejun Heo [this message]
2010-12-02 10:31           ` Tejun Heo
2010-12-04 17:07           ` Lin Mac
2010-12-04 17:07             ` Lin Mac

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=4CF77570.9000700@gmail.com \
    --to=htejun@gmail.com \
    --cc=cbouatmailru@gmail.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=mkl0301@gmail.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 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.