linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* AHCI support Port Multiplier problem.
@ 2011-01-07  2:55 Luo Dislo
  2011-01-07 21:25 ` Tejun Heo
  0 siblings, 1 reply; 16+ messages in thread
From: Luo Dislo @ 2011-01-07  2:55 UTC (permalink / raw)
  To: jgarzik; +Cc: linux-ide

Dear Jeff Garzik,


I am using AHCI driver, when CONFIG_SATA_PMP is set and the ahci driver DOES NOT have AHCI_HFLAG_NO_PMP. Libata sends Software Reset with PMP=0xF, trying to detect if Port Multiplier connected to the port. Unfortunately, if I plugged in general Hard drive, my controller failed to identify the hard drive.

What I observed was that libata always sent Software Reset with PMP=0xF and I guessed expecting signature is 0x96690101. I think libata should give up if the device does not return the Port Multiplier signature at the first time and take the signature value from device as the real device connnecting to the port now.

What we said "support" PMP does not mean the port can only connnect to Port Multiplier. It might connect with hard drive or ATAPI device.

Thank you.


Regards,
Dislo


      

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: AHCI support Port Multiplier problem.
  2011-01-07  2:55 AHCI support Port Multiplier problem Luo Dislo
@ 2011-01-07 21:25 ` Tejun Heo
  2011-01-10  1:46   ` Luo Dislo
  0 siblings, 1 reply; 16+ messages in thread
From: Tejun Heo @ 2011-01-07 21:25 UTC (permalink / raw)
  To: Luo Dislo; +Cc: jgarzik, linux-ide

Hello,

On Fri, Jan 07, 2011 at 10:55:14AM +0800, Luo Dislo wrote:
> I am using AHCI driver, when CONFIG_SATA_PMP is set and the ahci
> driver DOES NOT have AHCI_HFLAG_NO_PMP. Libata sends Software Reset
> with PMP=0xF, trying to detect if Port Multiplier connected to the
> port. Unfortunately, if I plugged in general Hard drive, my
> controller failed to identify the hard drive.
> 
> What I observed was that libata always sent Software Reset with
> PMP=0xF and I guessed expecting signature is 0x96690101. I think
> libata should give up if the device does not return the Port
> Multiplier signature at the first time and take the signature value
> from device as the real device connnecting to the port now.
>
> What we said "support" PMP does not mean the port can only connnect
> to Port Multiplier. It might connect with hard drive or ATAPI
> device.

Which controller is this?  Can you please post the output of "lspci
-nn"?  SB600 had this problem and needed workaround but later SBs
fixed it.  Looks like someone else screwed up similarly.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: AHCI support Port Multiplier problem.
  2011-01-07 21:25 ` Tejun Heo
@ 2011-01-10  1:46   ` Luo Dislo
  2011-01-10 15:42     ` Mac Lin
                       ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Luo Dislo @ 2011-01-10  1:46 UTC (permalink / raw)
  To: Tejun Heo; +Cc: jgarzik, linux-ide

Hello,

This is my company(Faraday) implemented AHCI SATA controller. Our 
controller is not located at PCI bus, but AHB bus(ARM based platform).

However, I modify Linux kernel builtin AHCI driver(ahci.c) to replace
the PCI related code by using platform bus. Just pretty similar way 
with drivers/ata/ahci_platform.c (Kernel 2.6.35).

I think the problem happens because libata does not give up, keep on 
expecting the Port Multiplier Signature when we set CONFIG_SATA_PMP 
to 1. 

I know how to fix this problem, just add AHCI_HFLAG_NO_PMP to AHCI_HFLAGS when I connect hard drive to the controller. Meanwhile, when I want to connect the Port Muliplier to my controller, I need to remove AHCI_HFLAG_NO_PMP from AHCI_HFLAGS. 

I don't think this is a good solution because I have to compile two version of my code. It does not make sense. We set CONFIG_SATA_PMP to 1 and inside the driver code DOES NOT have AHCI_HFLAG_NO_PMP just means that controller support Port Multiplier but the device connecting to the port might be others type.



Regards,

Dislo


 

--- 11/1/8 (六),Tejun Heo <tj@kernel.org> 寫道:

> 寄件者: Tejun Heo <tj@kernel.org>
> 主旨: Re: AHCI support Port Multiplier problem.
> 收件者: "Luo Dislo" <dislo_b_j@yahoo.com.tw>
> 副本: jgarzik@pobox.com, linux-ide@vger.kernel.org
> 日期: 2011年1月8日,六,上午5:25
> Hello,
> 
> On Fri, Jan 07, 2011 at 10:55:14AM +0800, Luo Dislo wrote:
> > I am using AHCI driver, when CONFIG_SATA_PMP is set
> and the ahci
> > driver DOES NOT have AHCI_HFLAG_NO_PMP. Libata sends
> Software Reset
> > with PMP=0xF, trying to detect if Port Multiplier
> connected to the
> > port. Unfortunately, if I plugged in general Hard
> drive, my
> > controller failed to identify the hard drive.
> > 
> > What I observed was that libata always sent Software
> Reset with
> > PMP=0xF and I guessed expecting signature is
> 0x96690101. I think
> > libata should give up if the device does not return
> the Port
> > Multiplier signature at the first time and take the
> signature value
> > from device as the real device connnecting to the port
> now.
> >
> > What we said "support" PMP does not mean the port can
> only connnect
> > to Port Multiplier. It might connect with hard drive
> or ATAPI
> > device.
> 
> Which controller is this?  Can you please post the
> output of "lspci
> -nn"?  SB600 had this problem and needed workaround
> but later SBs
> fixed it.  Looks like someone else screwed up
> similarly.
> 
> Thanks.
> 
> -- 
> tejun
> 


      

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: AHCI support Port Multiplier problem.
  2011-01-10  1:46   ` Luo Dislo
@ 2011-01-10 15:42     ` Mac Lin
  2011-01-11  1:54     ` Robert Hancock
  2011-01-11 14:37     ` Tejun Heo
  2 siblings, 0 replies; 16+ messages in thread
From: Mac Lin @ 2011-01-10 15:42 UTC (permalink / raw)
  To: linux-ide

Luo Dislo <dislo_b_j <at> yahoo.com.tw> writes:

> 
> Hello,
> 
> This is my company(Faraday) implemented AHCI SATA controller. Our 
> controller is not located at PCI bus, but AHB bus(ARM based platform).
> 
> However, I modify Linux kernel builtin AHCI driver(ahci.c) to replace
> the PCI related code by using platform bus. Just pretty similar way 
> with drivers/ata/ahci_platform.c (Kernel 2.6.35).
> 
> I think the problem happens because libata does not give up, keep on 
> expecting the Port Multiplier Signature when we set CONFIG_SATA_PMP 
> to 1. 
> 
> I know how to fix this problem, just add AHCI_HFLAG_NO_PMP to AHCI_HFLAGS when
I connect hard drive to the
> controller. Meanwhile, when I want to connect the Port Muliplier to my
controller, I need to remove
> AHCI_HFLAG_NO_PMP from AHCI_HFLAGS. 
> 
> I don't think this is a good solution because I have to compile two version of
my code. It does not make sense.
> We set CONFIG_SATA_PMP to 1 and inside the driver code DOES NOT have
AHCI_HFLAG_NO_PMP just means that
> controller support Port Multiplier but the device connecting to the port might
be others type.

We have a similar issue on cns3xxx
http://www.spinics.net/lists/linux-ide/msg39512.html
http://www.spinics.net/lists/linux-ide/msg39859.html

Could you try the following patch with CONFIG_SATA_PMP enabled and see if it fix
the issue?
If so, then it would be the same issue.
---
 drivers/ata/libahci.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index ebc08d6..081548f 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -1302,10 +1302,15 @@ static int ahci_softreset(struct ata_link *link,
unsigned int *class,
                          unsigned long deadline)
 {
        int pmp = sata_srst_pmp(link);
+       int ret;

        DPRINTK("ENTER\n");

-       return ahci_do_softreset(link, class, pmp, deadline, ahci_check_ready);
+       ret = ahci_do_softreset(link, class, pmp, deadline, ahci_check_ready);
+       if (ret && pmp)
+               return ahci_do_softreset(link, class, 0, deadline,
+                       ahci_check_ready);
+       return ret;
 }
 EXPORT_SYMBOL_GPL(ahci_do_softreset);

-- 

> 
> Regards,
> 
> Dislo
> 
> --- 11/1/8 (六),Tejun Heo <tj <at> kernel.org> 寫道:
> 
> > 寄件者: Tejun Heo <tj <at> kernel.org>
> > 主旨: Re: AHCI support Port Multiplier problem.
> > 收件者: "Luo Dislo" <dislo_b_j <at> yahoo.com.tw>
> > 副本: jgarzik <at> pobox.com, linux-ide <at> vger.kernel.org
> > 日期: 2011年1月8日,六,上午5:25
> > Hello,
> > 
> > On Fri, Jan 07, 2011 at 10:55:14AM +0800, Luo Dislo wrote:
> > > I am using AHCI driver, when CONFIG_SATA_PMP is set
> > and the ahci
> > > driver DOES NOT have AHCI_HFLAG_NO_PMP. Libata sends
> > Software Reset
> > > with PMP=0xF, trying to detect if Port Multiplier
> > connected to the
> > > port. Unfortunately, if I plugged in general Hard
> > drive, my
> > > controller failed to identify the hard drive.
> > > 
> > > What I observed was that libata always sent Software
> > Reset with
> > > PMP=0xF and I guessed expecting signature is
> > 0x96690101. I think
> > > libata should give up if the device does not return
> > the Port
> > > Multiplier signature at the first time and take the
> > signature value
> > > from device as the real device connnecting to the port
> > now.
> > >
> > > What we said "support" PMP does not mean the port can
> > only connnect
> > > to Port Multiplier. It might connect with hard drive
> > or ATAPI
> > > device.
> > 
> > Which controller is this?  Can you please post the
> > output of "lspci
> > -nn"?  SB600 had this problem and needed workaround
> > but later SBs
> > fixed it.  Looks like someone else screwed up
> > similarly.
> > 
> > Thanks.
> > 
> > -- 
> > tejun


Best Regards,
Mac Lin



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: AHCI support Port Multiplier problem.
  2011-01-10  1:46   ` Luo Dislo
  2011-01-10 15:42     ` Mac Lin
@ 2011-01-11  1:54     ` Robert Hancock
  2011-01-11 14:39       ` Tejun Heo
  2011-01-11 14:37     ` Tejun Heo
  2 siblings, 1 reply; 16+ messages in thread
From: Robert Hancock @ 2011-01-11  1:54 UTC (permalink / raw)
  To: Luo Dislo; +Cc: Tejun Heo, jgarzik, linux-ide

On 01/09/2011 07:46 PM, Luo Dislo wrote:
> Hello,
>
> This is my company(Faraday) implemented AHCI SATA controller. Our
> controller is not located at PCI bus, but AHB bus(ARM based platform).
>
> However, I modify Linux kernel builtin AHCI driver(ahci.c) to replace
> the PCI related code by using platform bus. Just pretty similar way
> with drivers/ata/ahci_platform.c (Kernel 2.6.35).
>
> I think the problem happens because libata does not give up, keep on
> expecting the Port Multiplier Signature when we set CONFIG_SATA_PMP
> to 1.

It shouldn't be expecting only a PMP signature in this case if there is 
no PMP connected. The PMP spec states:

"To determine if a Port Multiplier is present, the host performs the 
following procedure. The host will determine if communication is 
established on the host’s Serial ATA port by checking the host’s SStatus 
register. If a device is present, the host will issue a software reset 
with the PM Port field set to the control port. The host will check the 
signature value returned and if it corresponds to the Port Multiplier 
Signature, the host knows that a Port Multiplier is present. If the 
signature value does not correspond to a Port Multiplier, the host may 
proceed with the normal initialization sequence for that device type."

The code is doing this. However, I suspect the problem is that on some 
controllers, it won't fill in the signature as expected if the PMP field 
on the received D2H Register FIS doesn't match the one listed in the 
command 15, for the PMP control port), which it won't if there's no PMP 
connected. I'm not sure if this is the intent of the AHCI spec or not, 
but in any case it appears that a number of controllers have this issue. 
I suspect that retrying with PMP=0 if the softreset with PMP=15 failed 
to acquire a signature is likely the thing to do.


>
> I know how to fix this problem, just add AHCI_HFLAG_NO_PMP to AHCI_HFLAGS when I connect hard drive to the controller. Meanwhile, when I want to connect the Port Muliplier to my controller, I need to remove AHCI_HFLAG_NO_PMP from AHCI_HFLAGS.
>
> I don't think this is a good solution because I have to compile two version of my code. It does not make sense. We set CONFIG_SATA_PMP to 1 and inside the driver code DOES NOT have AHCI_HFLAG_NO_PMP just means that controller support Port Multiplier but the device connecting to the port might be others type.
>
>
>
> Regards,
>
> Dislo
>
>
>
>
> --- 11/1/8 (六),Tejun Heo<tj@kernel.org>  寫道:
>
>> 寄件者: Tejun Heo<tj@kernel.org>
>> 主旨: Re: AHCI support Port Multiplier problem.
>> 收件者: "Luo Dislo"<dislo_b_j@yahoo.com.tw>
>> 副本: jgarzik@pobox.com, linux-ide@vger.kernel.org
>> 日期: 2011年1月8日,六,上午5:25
>> Hello,
>>
>> On Fri, Jan 07, 2011 at 10:55:14AM +0800, Luo Dislo wrote:
>>> I am using AHCI driver, when CONFIG_SATA_PMP is set
>> and the ahci
>>> driver DOES NOT have AHCI_HFLAG_NO_PMP. Libata sends
>> Software Reset
>>> with PMP=0xF, trying to detect if Port Multiplier
>> connected to the
>>> port. Unfortunately, if I plugged in general Hard
>> drive, my
>>> controller failed to identify the hard drive.
>>>
>>> What I observed was that libata always sent Software
>> Reset with
>>> PMP=0xF and I guessed expecting signature is
>> 0x96690101. I think
>>> libata should give up if the device does not return
>> the Port
>>> Multiplier signature at the first time and take the
>> signature value
>>> from device as the real device connnecting to the port
>> now.
>>>
>>> What we said "support" PMP does not mean the port can
>> only connnect
>>> to Port Multiplier. It might connect with hard drive
>> or ATAPI
>>> device.
>>
>> Which controller is this?  Can you please post the
>> output of "lspci
>> -nn"?  SB600 had this problem and needed workaround
>> but later SBs
>> fixed it.  Looks like someone else screwed up
>> similarly.
>>
>> Thanks.
>>
>> --
>> tejun
>>
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ide" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: AHCI support Port Multiplier problem.
  2011-01-10  1:46   ` Luo Dislo
  2011-01-10 15:42     ` Mac Lin
  2011-01-11  1:54     ` Robert Hancock
@ 2011-01-11 14:37     ` Tejun Heo
  2011-01-12  1:26       ` Luo Dislo
                         ` (2 more replies)
  2 siblings, 3 replies; 16+ messages in thread
From: Tejun Heo @ 2011-01-11 14:37 UTC (permalink / raw)
  To: Luo Dislo; +Cc: jgarzik, linux-ide

Hi,

On Mon, Jan 10, 2011 at 09:46:45AM +0800, Luo Dislo wrote:
> This is my company(Faraday) implemented AHCI SATA controller. Our 
> controller is not located at PCI bus, but AHB bus(ARM based platform).
> 
> However, I modify Linux kernel builtin AHCI driver(ahci.c) to replace
> the PCI related code by using platform bus. Just pretty similar way 
> with drivers/ata/ahci_platform.c (Kernel 2.6.35).
> 
> I think the problem happens because libata does not give up, keep on 
> expecting the Port Multiplier Signature when we set CONFIG_SATA_PMP 
> to 1. 
> 
> I know how to fix this problem, just add AHCI_HFLAG_NO_PMP to
> AHCI_HFLAGS when I connect hard drive to the controller. Meanwhile,
> when I want to connect the Port Muliplier to my controller, I need
> to remove AHCI_HFLAG_NO_PMP from AHCI_HFLAGS.
> 
> I don't think this is a good solution because I have to compile two
> version of my code. It does not make sense. We set CONFIG_SATA_PMP
> to 1 and inside the driver code DOES NOT have AHCI_HFLAG_NO_PMP just
> means that controller support Port Multiplier but the device
> connecting to the port might be others type.

Please take a look at ahci_sb600_softreset() in ahci.c.  The
controller had the same problem.  Preferably, please fix your
controller but as there are more than one controller with this
problem, we probably should implement it as a quirk in libahci.c.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: AHCI support Port Multiplier problem.
  2011-01-11  1:54     ` Robert Hancock
@ 2011-01-11 14:39       ` Tejun Heo
  0 siblings, 0 replies; 16+ messages in thread
From: Tejun Heo @ 2011-01-11 14:39 UTC (permalink / raw)
  To: Robert Hancock; +Cc: Luo Dislo, jgarzik, linux-ide

Hello,

On Mon, Jan 10, 2011 at 07:54:29PM -0600, Robert Hancock wrote:
> I suspect that retrying with PMP=0 if the softreset with PMP=15
> failed to acquire a signature is likely the thing to do.

Of the non-platform ones, sb600 is the only one with this problem and
the workaround will unnecessarily lengthen response time for other
controllers.  I'd suggest implementing it as a quirk in libahci.c and
applying it only to the broken controllers.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: AHCI support Port Multiplier problem.
  2011-01-11 14:37     ` Tejun Heo
@ 2011-01-12  1:26       ` Luo Dislo
  2011-01-13  8:16       ` Luo Dislo
  2011-02-15  7:48       ` Question regarding PORT_IRQ_BAD_PMP (Re: AHCI support Port Multiplier problem.) Mac Lin
  2 siblings, 0 replies; 16+ messages in thread
From: Luo Dislo @ 2011-01-12  1:26 UTC (permalink / raw)
  To: Tejun Heo; +Cc: jgarzik, linux-ide


Thank you. I will take a look the code.


Regards,
Dislo
--- 11/1/11 (二),Tejun Heo <tj@kernel.org> 寫道:

> 寄件者: Tejun Heo <tj@kernel.org>
> 主旨: Re: AHCI support Port Multiplier problem.
> 收件者: "Luo Dislo" <dislo_b_j@yahoo.com.tw>
> 副本: jgarzik@pobox.com, linux-ide@vger.kernel.org
> 日期: 2011年1月11日,二,下午10:37
> Hi,
> 
> On Mon, Jan 10, 2011 at 09:46:45AM +0800, Luo Dislo wrote:
> > This is my company(Faraday) implemented AHCI SATA
> controller. Our 
> > controller is not located at PCI bus, but AHB bus(ARM
> based platform).
> > 
> > However, I modify Linux kernel builtin AHCI
> driver(ahci.c) to replace
> > the PCI related code by using platform bus. Just
> pretty similar way 
> > with drivers/ata/ahci_platform.c (Kernel 2.6.35).
> > 
> > I think the problem happens because libata does not
> give up, keep on 
> > expecting the Port Multiplier Signature when we set
> CONFIG_SATA_PMP 
> > to 1. 
> > 
> > I know how to fix this problem, just add
> AHCI_HFLAG_NO_PMP to
> > AHCI_HFLAGS when I connect hard drive to the
> controller. Meanwhile,
> > when I want to connect the Port Muliplier to my
> controller, I need
> > to remove AHCI_HFLAG_NO_PMP from AHCI_HFLAGS.
> > 
> > I don't think this is a good solution because I have
> to compile two
> > version of my code. It does not make sense. We set
> CONFIG_SATA_PMP
> > to 1 and inside the driver code DOES NOT have
> AHCI_HFLAG_NO_PMP just
> > means that controller support Port Multiplier but the
> device
> > connecting to the port might be others type.
> 
> Please take a look at ahci_sb600_softreset() in
> ahci.c.  The
> controller had the same problem.  Preferably, please
> fix your
> controller but as there are more than one controller with
> this
> problem, we probably should implement it as a quirk in
> libahci.c.
> 
> Thanks.
> 
> -- 
> tejun
> 


      

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: AHCI support Port Multiplier problem.
  2011-01-11 14:37     ` Tejun Heo
  2011-01-12  1:26       ` Luo Dislo
@ 2011-01-13  8:16       ` Luo Dislo
  2011-02-15  7:48       ` Question regarding PORT_IRQ_BAD_PMP (Re: AHCI support Port Multiplier problem.) Mac Lin
  2 siblings, 0 replies; 16+ messages in thread
From: Luo Dislo @ 2011-01-13  8:16 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-ide

Yes, refer to ahci_sb600_softreset() function solved my problem.

Thanks 

--- 11/1/11 (二),Tejun Heo <tj@kernel.org> 寫道:

> 寄件者: Tejun Heo <tj@kernel.org>
> 主旨: Re: AHCI support Port Multiplier problem.
> 收件者: "Luo Dislo" <dislo_b_j@yahoo.com.tw>
> 副本: jgarzik@pobox.com, linux-ide@vger.kernel.org
> 日期: 2011年1月11日,二,下午10:37
> Hi,
> 
> On Mon, Jan 10, 2011 at 09:46:45AM +0800, Luo Dislo wrote:
> > This is my company(Faraday) implemented AHCI SATA
> controller. Our 
> > controller is not located at PCI bus, but AHB bus(ARM
> based platform).
> > 
> > However, I modify Linux kernel builtin AHCI
> driver(ahci.c) to replace
> > the PCI related code by using platform bus. Just
> pretty similar way 
> > with drivers/ata/ahci_platform.c (Kernel 2.6.35).
> > 
> > I think the problem happens because libata does not
> give up, keep on 
> > expecting the Port Multiplier Signature when we set
> CONFIG_SATA_PMP 
> > to 1. 
> > 
> > I know how to fix this problem, just add
> AHCI_HFLAG_NO_PMP to
> > AHCI_HFLAGS when I connect hard drive to the
> controller. Meanwhile,
> > when I want to connect the Port Muliplier to my
> controller, I need
> > to remove AHCI_HFLAG_NO_PMP from AHCI_HFLAGS.
> > 
> > I don't think this is a good solution because I have
> to compile two
> > version of my code. It does not make sense. We set
> CONFIG_SATA_PMP
> > to 1 and inside the driver code DOES NOT have
> AHCI_HFLAG_NO_PMP just
> > means that controller support Port Multiplier but the
> device
> > connecting to the port might be others type.
> 
> Please take a look at ahci_sb600_softreset() in
> ahci.c.  The
> controller had the same problem.  Preferably, please
> fix your
> controller but as there are more than one controller with
> this
> problem, we probably should implement it as a quirk in
> libahci.c.
> 
> Thanks.
> 
> -- 
> tejun
> 


      

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Question regarding PORT_IRQ_BAD_PMP (Re: AHCI support Port Multiplier problem.)
  2011-01-11 14:37     ` Tejun Heo
  2011-01-12  1:26       ` Luo Dislo
  2011-01-13  8:16       ` Luo Dislo
@ 2011-02-15  7:48       ` Mac Lin
  2011-02-15  8:55         ` Tejun Heo
  2 siblings, 1 reply; 16+ messages in thread
From: Mac Lin @ 2011-02-15  7:48 UTC (permalink / raw)
  To: linux-ide

Tejun Heo <tj <at> kernel.org> writes:

[snip]

> Please take a look at ahci_sb600_softreset() in ahci.c.  The
> controller had the same problem.  Preferably, please fix your
> controller but as there are more than one controller with this
> problem, we probably should implement it as a quirk in libahci.c.

I refer to the ahci_sb600_softreset and ahci_sb600_check_ready to make my patch,
but I found that the following code changes in ahci_sb600_check_ready:

        /*                                                    
         * There is no need to check TFDATA if BAD PMP is found due to HW bug, 
                                             
         * which can save timeout delay.
         */                                                   
        if (irq_status & PORT_IRQ_BAD_PMP)
                return -EIO;

On my system (CNS3xxx) it result in:

ata2: softreset failed (device not ready)
ata2: applying PMP SRST workaround and retrying
ata2: softreset failed (device not ready)
ata2: reset failed (errno=-5), retrying in 9 secs
ata2: softreset failed (device not ready)
ata2: applying PMP SRST workaround and retrying
ata2: softreset failed (device not ready)
ata2: reset failed (errno=-5), retrying in 9 secs
ata2: softreset failed (device not ready)
ata2: applying PMP SRST workaround and retrying
ata2: softreset failed (device not ready)
ata2: reset failed (errno=-5), retrying in 34 secs
ata2: limiting SATA link speed to 1.5 Gbps
ata2: softreset failed (device not ready)
ata2: applying PMP SRST workaround and retrying
ata2: softreset failed (device not ready)
ata2: reset failed, giving up

It seems that the PORT_IRQ_BAD_PMP is not getting cleared, or, asserted every
time when it "received a FIS from a device that did not have a command
outstanding", which is the D2H FIS of softreset.

The sb600, which I assume the code work correctly, seems doesn't have this
problem. So I am wondering that whether is this the right behavior on cns3xxx,
or  and just another issue of the chip?

Best Regards,
Mac Lin




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Question regarding PORT_IRQ_BAD_PMP (Re: AHCI support Port Multiplier problem.)
  2011-02-15  7:48       ` Question regarding PORT_IRQ_BAD_PMP (Re: AHCI support Port Multiplier problem.) Mac Lin
@ 2011-02-15  8:55         ` Tejun Heo
  2011-02-15  9:50           ` Lin Mac
  0 siblings, 1 reply; 16+ messages in thread
From: Tejun Heo @ 2011-02-15  8:55 UTC (permalink / raw)
  To: Mac Lin; +Cc: linux-ide

Hello,

(please always reply-to-all)

On Tue, Feb 15, 2011 at 07:48:18AM +0000, Mac Lin wrote:
> It seems that the PORT_IRQ_BAD_PMP is not getting cleared, or, asserted every
> time when it "received a FIS from a device that did not have a command
> outstanding", which is the D2H FIS of softreset.
> 
> The sb600, which I assume the code work correctly, seems doesn't have this
> problem. So I am wondering that whether is this the right behavior on cns3xxx,
> or  and just another issue of the chip?

You're already working around buggy hardware.  It isn't surprising
that both behave incorrectly in their own separate ways.  Just do
what's necessary to get the hardware working as long as the workaround
is localized to the specific controller.

Good luck.

-- 
tejun

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Question regarding PORT_IRQ_BAD_PMP (Re: AHCI support Port Multiplier problem.)
  2011-02-15  8:55         ` Tejun Heo
@ 2011-02-15  9:50           ` Lin Mac
  2011-02-15 10:03             ` Tejun Heo
  0 siblings, 1 reply; 16+ messages in thread
From: Lin Mac @ 2011-02-15  9:50 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-ide

2011/2/15 Tejun Heo <tj@kernel.org>:
> Hello,
> (please always reply-to-all)
I'm sorry about that. I was not subscribed to linux-ide, and replied by gmane.

> On Tue, Feb 15, 2011 at 07:48:18AM +0000, Mac Lin wrote:
>> It seems that the PORT_IRQ_BAD_PMP is not getting cleared, or, asserted every
>> time when it "received a FIS from a device that did not have a command
>> outstanding", which is the D2H FIS of softreset.
>>
>> The sb600, which I assume the code work correctly, seems doesn't have this
>> problem. So I am wondering that whether is this the right behavior on cns3xxx,
>> or  and just another issue of the chip?
>
> You're already working around buggy hardware.  It isn't surprising
> that both behave incorrectly in their own separate ways.  Just do
> what's necessary to get the hardware working as long as the workaround
> is localized to the specific controller.
If I implement it as a quirk, would you prefer to add a new field
quirk, or just use flags of ahci_host_priv and add a new AHCI_HFLAG*?
I prefer the later, but afraid that it's not what it is for.

Best Regards,
Mac Lin

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Question regarding PORT_IRQ_BAD_PMP (Re: AHCI support Port Multiplier problem.)
  2011-02-15  9:50           ` Lin Mac
@ 2011-02-15 10:03             ` Tejun Heo
  2011-02-15 10:26               ` Lin Mac
  0 siblings, 1 reply; 16+ messages in thread
From: Tejun Heo @ 2011-02-15 10:03 UTC (permalink / raw)
  To: Lin Mac; +Cc: linux-ide

On Tue, Feb 15, 2011 at 05:50:55PM +0800, Lin Mac wrote:
> > You're already working around buggy hardware.  It isn't surprising
> > that both behave incorrectly in their own separate ways.  Just do
> > what's necessary to get the hardware working as long as the workaround
> > is localized to the specific controller.
>
> If I implement it as a quirk, would you prefer to add a new field
> quirk, or just use flags of ahci_host_priv and add a new AHCI_HFLAG*?
> I prefer the later, but afraid that it's not what it is for.

Please implement it as a separate ata_port_operations like
ahci_CONTROLLER_NAME_ops and use the customized reset methods.

-- 
tejun

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Question regarding PORT_IRQ_BAD_PMP (Re: AHCI support Port Multiplier problem.)
  2011-02-15 10:03             ` Tejun Heo
@ 2011-02-15 10:26               ` Lin Mac
  2011-02-15 10:31                 ` Tejun Heo
  0 siblings, 1 reply; 16+ messages in thread
From: Lin Mac @ 2011-02-15 10:26 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-ide, jgarzik

2011/2/15 Tejun Heo <tj@kernel.org>:
> On Tue, Feb 15, 2011 at 05:50:55PM +0800, Lin Mac wrote:
>> > You're already working around buggy hardware.  It isn't surprising
>> > that both behave incorrectly in their own separate ways.  Just do
>> > what's necessary to get the hardware working as long as the workaround
>> > is localized to the specific controller.
>>
>> If I implement it as a quirk, would you prefer to add a new field
>> quirk, or just use flags of ahci_host_priv and add a new AHCI_HFLAG*?
>> I prefer the later, but afraid that it's not what it is for.
>
> Please implement it as a separate ata_port_operations like
> ahci_CONTROLLER_NAME_ops and use the customized reset methods.

In fact, I did. But it doesn't get accepted.

    [PATCH v5 0/3] add CNS3xxx AHCI support (Cavium Networks)
    http://www.spinics.net/lists/linux-ide/msg39859.html

And given that there are many of them, shouldn't we implement it as quirk?


    AHCI support Port Multiplier problem. (Faraday)
    http://www.spinics.net/lists/linux-ide/msg39815.html

    Texas Instruments OMAP L138

    ATI SB600/SB700 (ahci_sb600_softreset)
    http://kerneltrap.org/mailarchive/git-commits-head/2008/6/14/2122314

Best Regards,
Mac Lin

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Question regarding PORT_IRQ_BAD_PMP (Re: AHCI support Port Multiplier problem.)
  2011-02-15 10:26               ` Lin Mac
@ 2011-02-15 10:31                 ` Tejun Heo
  2011-02-15 13:00                   ` Lin Mac
  0 siblings, 1 reply; 16+ messages in thread
From: Tejun Heo @ 2011-02-15 10:31 UTC (permalink / raw)
  To: Lin Mac; +Cc: linux-ide, jgarzik

On Tue, Feb 15, 2011 at 06:26:21PM +0800, Lin Mac wrote:
> 2011/2/15 Tejun Heo <tj@kernel.org>:
> > On Tue, Feb 15, 2011 at 05:50:55PM +0800, Lin Mac wrote:
> >> > You're already working around buggy hardware.  It isn't surprising
> >> > that both behave incorrectly in their own separate ways.  Just do
> >> > what's necessary to get the hardware working as long as the workaround
> >> > is localized to the specific controller.
> >>
> >> If I implement it as a quirk, would you prefer to add a new field
> >> quirk, or just use flags of ahci_host_priv and add a new AHCI_HFLAG*?
> >> I prefer the later, but afraid that it's not what it is for.
> >
> > Please implement it as a separate ata_port_operations like
> > ahci_CONTROLLER_NAME_ops and use the customized reset methods.
> 
> In fact, I did. But it doesn't get accepted.
> 
>     [PATCH v5 0/3] add CNS3xxx AHCI support (Cavium Networks)
>     http://www.spinics.net/lists/linux-ide/msg39859.html
> 
> And given that there are many of them, shouldn't we implement it as quirk?

IIRC, the rejected part was the renaming of files and addition of a
new driver, no?

-- 
tejun

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Question regarding PORT_IRQ_BAD_PMP (Re: AHCI support Port Multiplier problem.)
  2011-02-15 10:31                 ` Tejun Heo
@ 2011-02-15 13:00                   ` Lin Mac
  0 siblings, 0 replies; 16+ messages in thread
From: Lin Mac @ 2011-02-15 13:00 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-ide, jgarzik, Anton Vorontsov, Basheer, Mansoor Ahamed

2011/2/15 Tejun Heo <tj@kernel.org>:
> On Tue, Feb 15, 2011 at 06:26:21PM +0800, Lin Mac wrote:
>> 2011/2/15 Tejun Heo <tj@kernel.org>:
>> > On Tue, Feb 15, 2011 at 05:50:55PM +0800, Lin Mac wrote:
>> >> > You're already working around buggy hardware.  It isn't surprising
>> >> > that both behave incorrectly in their own separate ways.  Just do
>> >> > what's necessary to get the hardware working as long as the workaround
>> >> > is localized to the specific controller.
>> >>
>> >> If I implement it as a quirk, would you prefer to add a new field
>> >> quirk, or just use flags of ahci_host_priv and add a new AHCI_HFLAG*?
>> >> I prefer the later, but afraid that it's not what it is for.
>> >
>> > Please implement it as a separate ata_port_operations like
>> > ahci_CONTROLLER_NAME_ops and use the customized reset methods.
>>
>> In fact, I did. But it doesn't get accepted.
>>
>>     [PATCH v5 0/3] add CNS3xxx AHCI support (Cavium Networks)
>>     http://www.spinics.net/lists/linux-ide/msg39859.html
>>
>> And given that there are many of them, shouldn't we implement it as quirk?
>
> IIRC, the rejected part was the renaming of files and addition of a
> new driver, no?

Before v5,
Jeff's concern is the renaming of the ahci_platform.c. Therefore I
fixed that part and rename the module name instead.

In v5, first I rename the module ahci_platform to ahci_platforms. Then
switch the ahci platform driver to device table matching. And add
cns3xxx change with a new entry in device table.

Basheer suggest that several platform have this issue, and can be
implemented as quirk.

Hi guys, could you kindly provide some input on the patchset:
[PATCH v5 0/3] add CNS3xxx AHCI support (Cavium Networks)
http://www.spinics.net/lists/linux-ide/msg39859.html

Best Regards,
Mac Lin

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2011-02-15 13:00 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-07  2:55 AHCI support Port Multiplier problem Luo Dislo
2011-01-07 21:25 ` Tejun Heo
2011-01-10  1:46   ` Luo Dislo
2011-01-10 15:42     ` Mac Lin
2011-01-11  1:54     ` Robert Hancock
2011-01-11 14:39       ` Tejun Heo
2011-01-11 14:37     ` Tejun Heo
2011-01-12  1:26       ` Luo Dislo
2011-01-13  8:16       ` Luo Dislo
2011-02-15  7:48       ` Question regarding PORT_IRQ_BAD_PMP (Re: AHCI support Port Multiplier problem.) Mac Lin
2011-02-15  8:55         ` Tejun Heo
2011-02-15  9:50           ` Lin Mac
2011-02-15 10:03             ` Tejun Heo
2011-02-15 10:26               ` Lin Mac
2011-02-15 10:31                 ` Tejun Heo
2011-02-15 13:00                   ` Lin Mac

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).