Re: AHCI support Port Multiplier problem.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux