* [PATCH] ahci_sunxi: Drop AHCI_HFLAG_NO_PMP flag
@ 2014-11-13 10:24 Hans de Goede
[not found] ` <1415874256-6580-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Hans de Goede @ 2014-11-13 10:24 UTC (permalink / raw)
To: Tejun Heo
Cc: Ian Campbell, Maxime Ripard, linux-ide-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw, Hans de Goede
This is something which we inherited from the Allwinner android kernel sources,
and I've always wanted to test if this is really necessary.
So recently I've bought a sata port multiplexer, and I've given this a test
spin on both A10 and A20 devices, and it seems to work fine:
[ 2.154456] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[ 2.161092] ata1.15: Port Multiplier 1.2, 0x197b:0x0325 r0, 5 ports, feat 0x5/0xf
[ 2.175511] ata1.00: hard resetting link
[ 2.524929] ata1.00: SATA link up 3.0 Gbps (SStatus 123 SControl 320)
[ 2.531430] ata1.01: hard resetting link
[ 2.974465] ata1.01: link resume succeeded after 1 retries
[ 3.094932] ata1.01: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[ 3.101431] ata1.02: hard resetting link
[ 4.174466] ata1.02: failed to resume link (SControl 0)
[ 4.180065] ata1.02: SATA link down (SStatus 0 SControl 0)
(and the same for links 3 and 4)
Once the NO_PMP flag is removed it correctly sees the 2 disks which I've
attached, and I can mount and use them just fine, so lets drop the flag.
Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
drivers/ata/ahci_sunxi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ata/ahci_sunxi.c b/drivers/ata/ahci_sunxi.c
index e44d675..3dd0224 100644
--- a/drivers/ata/ahci_sunxi.c
+++ b/drivers/ata/ahci_sunxi.c
@@ -184,7 +184,7 @@ static int ahci_sunxi_probe(struct platform_device *pdev)
goto disable_resources;
hpriv->flags = AHCI_HFLAG_32BIT_ONLY | AHCI_HFLAG_NO_MSI |
- AHCI_HFLAG_NO_PMP | AHCI_HFLAG_YES_NCQ;
+ AHCI_HFLAG_YES_NCQ;
rc = ahci_platform_init_host(pdev, hpriv, &ahci_sunxi_port_info);
if (rc)
--
2.1.0
^ permalink raw reply related [flat|nested] 6+ messages in thread[parent not found: <1415874256-6580-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH] ahci_sunxi: Drop AHCI_HFLAG_NO_PMP flag [not found] ` <1415874256-6580-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2014-11-13 22:29 ` Tejun Heo [not found] ` <20141113222952.GI2598-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Tejun Heo @ 2014-11-13 22:29 UTC (permalink / raw) To: Hans de Goede Cc: Ian Campbell, Maxime Ripard, linux-ide-u79uwXL29TY76Z2rM5mHXA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-sunxi-/JYPxA39Uh5TLH3MbocFFw On Thu, Nov 13, 2014 at 11:24:16AM +0100, Hans de Goede wrote: > This is something which we inherited from the Allwinner android kernel sources, > and I've always wanted to test if this is really necessary. > > So recently I've bought a sata port multiplexer, and I've given this a test > spin on both A10 and A20 devices, and it seems to work fine: > > [ 2.154456] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300) > [ 2.161092] ata1.15: Port Multiplier 1.2, 0x197b:0x0325 r0, 5 ports, feat 0x5/0xf > [ 2.175511] ata1.00: hard resetting link > [ 2.524929] ata1.00: SATA link up 3.0 Gbps (SStatus 123 SControl 320) > [ 2.531430] ata1.01: hard resetting link > [ 2.974465] ata1.01: link resume succeeded after 1 retries > [ 3.094932] ata1.01: SATA link up 3.0 Gbps (SStatus 123 SControl 300) > [ 3.101431] ata1.02: hard resetting link > [ 4.174466] ata1.02: failed to resume link (SControl 0) > [ 4.180065] ata1.02: SATA link down (SStatus 0 SControl 0) > (and the same for links 3 and 4) > > Once the NO_PMP flag is removed it correctly sees the 2 disks which I've > attached, and I can mount and use them just fine, so lets drop the flag. > > Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> Applied to libata/for-3.18-fixes. Thanks. -- tejun ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <20141113222952.GI2598-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>]
* Re: [PATCH] ahci_sunxi: Drop AHCI_HFLAG_NO_PMP flag [not found] ` <20141113222952.GI2598-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org> @ 2014-11-14 11:56 ` Hans de Goede [not found] ` <037f97ce-468b-4b91-9616-51a3301c5be6-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Hans de Goede @ 2014-11-14 11:56 UTC (permalink / raw) To: linux-sunxi-/JYPxA39Uh5TLH3MbocFFw Cc: hdegoede-H+wXaHxf7aLQT0dZR+AlfA, ijc-KcIKpvwj1kUDXYZnReoRVg, maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8, linux-ide-u79uwXL29TY76Z2rM5mHXA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, tj-DgEjT+Ai2ygdnm+yROfE0A [-- Attachment #1: Type: text/plain, Size: 2506 bytes --] Hi, On Thursday, November 13, 2014 11:29:56 PM UTC+1, Tejun Heo wrote: > > On Thu, Nov 13, 2014 at 11:24:16AM +0100, Hans de Goede wrote: > > This is something which we inherited from the Allwinner android kernel > sources, > > and I've always wanted to test if this is really necessary. > > > > So recently I've bought a sata port multiplexer, and I've given this a > test > > spin on both A10 and A20 devices, and it seems to work fine: > > > > [ 2.154456] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300) > > [ 2.161092] ata1.15: Port Multiplier 1.2, 0x197b:0x0325 r0, 5 ports, > feat 0x5/0xf > > [ 2.175511] ata1.00: hard resetting link > > [ 2.524929] ata1.00: SATA link up 3.0 Gbps (SStatus 123 SControl 320) > > [ 2.531430] ata1.01: hard resetting link > > [ 2.974465] ata1.01: link resume succeeded after 1 retries > > [ 3.094932] ata1.01: SATA link up 3.0 Gbps (SStatus 123 SControl 300) > > [ 3.101431] ata1.02: hard resetting link > > [ 4.174466] ata1.02: failed to resume link (SControl 0) > > [ 4.180065] ata1.02: SATA link down (SStatus 0 SControl 0) > > (and the same for links 3 and 4) > > > > Once the NO_PMP flag is removed it correctly sees the 2 disks which I've > > attached, and I can mount and use them just fine, so lets drop the flag. > > > > Signed-off-by: Hans de Goede <hdeg...-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org <javascript:>> > > Applied to libata/for-3.18-fixes. > I just found out why Allwinner added that AHCI_HFLAG_NO_PMP flag, after putting the system I used to test the port multiplexer back together this morning, it seems that probing for a port multiplexer being present breaks the no-port-multiplexer (so direct attached disk) case :( I guess I should have tested for that before sending the patch, but the thought of it breaking normal usage did not cross my mind. So self NACK. If it is not too late, can you please drop this from your tree ? Let me know if you want me to send a revert instead. I'll look into fixing this another way, maybe with a quirk + an extra reset after failed pmp testing, and it that does not work a module option. Thanks & Regards, Hans -- You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/d/optout. [-- Attachment #2: Type: text/html, Size: 3254 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <037f97ce-468b-4b91-9616-51a3301c5be6-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>]
* Re: [PATCH] ahci_sunxi: Drop AHCI_HFLAG_NO_PMP flag [not found] ` <037f97ce-468b-4b91-9616-51a3301c5be6-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> @ 2014-11-14 12:49 ` Hans de Goede [not found] ` <5465FA40.8000508-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Hans de Goede @ 2014-11-14 12:49 UTC (permalink / raw) To: Hans de Goede, linux-sunxi-/JYPxA39Uh5TLH3MbocFFw Cc: ijc-KcIKpvwj1kUDXYZnReoRVg, maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8, linux-ide-u79uwXL29TY76Z2rM5mHXA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, tj-DgEjT+Ai2ygdnm+yROfE0A Hi, On 11/14/2014 12:56 PM, Hans de Goede wrote: > Hi, > > On Thursday, November 13, 2014 11:29:56 PM UTC+1, Tejun Heo wrote: >> >> On Thu, Nov 13, 2014 at 11:24:16AM +0100, Hans de Goede wrote: >>> This is something which we inherited from the Allwinner android kernel >> sources, >>> and I've always wanted to test if this is really necessary. >>> >>> So recently I've bought a sata port multiplexer, and I've given this a >> test >>> spin on both A10 and A20 devices, and it seems to work fine: >>> >>> [ 2.154456] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300) >>> [ 2.161092] ata1.15: Port Multiplier 1.2, 0x197b:0x0325 r0, 5 ports, >> feat 0x5/0xf >>> [ 2.175511] ata1.00: hard resetting link >>> [ 2.524929] ata1.00: SATA link up 3.0 Gbps (SStatus 123 SControl 320) >>> [ 2.531430] ata1.01: hard resetting link >>> [ 2.974465] ata1.01: link resume succeeded after 1 retries >>> [ 3.094932] ata1.01: SATA link up 3.0 Gbps (SStatus 123 SControl 300) >>> [ 3.101431] ata1.02: hard resetting link >>> [ 4.174466] ata1.02: failed to resume link (SControl 0) >>> [ 4.180065] ata1.02: SATA link down (SStatus 0 SControl 0) >>> (and the same for links 3 and 4) >>> >>> Once the NO_PMP flag is removed it correctly sees the 2 disks which I've >>> attached, and I can mount and use them just fine, so lets drop the flag. >>> >>> Signed-off-by: Hans de Goede <hdeg...-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org <javascript:>> >> >> Applied to libata/for-3.18-fixes. >> > > I just found out why Allwinner added that AHCI_HFLAG_NO_PMP flag, after > putting the system I used to test the port multiplexer back together this > morning, it seems that probing for a port multiplexer being present breaks > the no-port-multiplexer (so direct attached disk) case :( I guess I should > have tested for that before sending the patch, but the thought of it > breaking normal usage did not cross my mind. > > So self NACK. If it is not too late, can you please drop this from your > tree ? > > Let me know if you want me to send a revert instead. > > I'll look into fixing this another way, maybe with a quirk + an extra reset > after failed pmp testing, and it that does not work a module option. Ok, so the problem seems to be that the controller fails to do a soft-reset when attached directly to a normal device rather then to a pmp. If I comment out this block of code in libata-core.c: if (sata_pmp_supported(link->ap) && ata_is_host_link(link)) { /* If PMP is supported, we have to do follow-up SRST. * Some PMPs don't send D2H Reg FIS after hardreset if * the first port is empty. Wait only for * ATA_TMOUT_PMP_SRST_WAIT. */ if (check_ready) { unsigned long pmp_deadline; pmp_deadline = ata_deadline(jiffies, ATA_TMOUT_PMP_SRST_WAIT); if (time_after(pmp_deadline, deadline)) pmp_deadline = deadline; ata_wait_ready(link, pmp_deadline, check_ready); } rc = -EAGAIN; goto out; } Then things work again. This code looks like it is a must have for pmp use, so I'll do a follow up patch to my initial patch dropping the AHCI_HFLAG_NO_PMP flag, which re-adds it based on a module option (defaulting to the non-pmp case). This way you don't have to do a forced-push to your tree to drop the original patch (or revert it). Regards, Hans ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <5465FA40.8000508-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH] ahci_sunxi: Drop AHCI_HFLAG_NO_PMP flag [not found] ` <5465FA40.8000508-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2014-11-14 13:08 ` Tejun Heo 2014-11-14 13:24 ` Hans de Goede 1 sibling, 0 replies; 6+ messages in thread From: Tejun Heo @ 2014-11-14 13:08 UTC (permalink / raw) To: Hans de Goede Cc: Hans de Goede, linux-sunxi-/JYPxA39Uh5TLH3MbocFFw, ijc-KcIKpvwj1kUDXYZnReoRVg, maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8, linux-ide-u79uwXL29TY76Z2rM5mHXA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r On Fri, Nov 14, 2014 at 01:49:04PM +0100, Hans de Goede wrote: > > I just found out why Allwinner added that AHCI_HFLAG_NO_PMP flag, after > > putting the system I used to test the port multiplexer back together this > > morning, it seems that probing for a port multiplexer being present breaks > > the no-port-multiplexer (so direct attached disk) case :( I guess I should > > have tested for that before sending the patch, but the thought of it > > breaking normal usage did not cross my mind. > > > > So self NACK. If it is not too late, can you please drop this from your > > tree ? I popped the commit from libata/for-3.18-fixes. Thanks. -- tejun ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ahci_sunxi: Drop AHCI_HFLAG_NO_PMP flag [not found] ` <5465FA40.8000508-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 2014-11-14 13:08 ` Tejun Heo @ 2014-11-14 13:24 ` Hans de Goede 1 sibling, 0 replies; 6+ messages in thread From: Hans de Goede @ 2014-11-14 13:24 UTC (permalink / raw) To: Hans de Goede, linux-sunxi-/JYPxA39Uh5TLH3MbocFFw Cc: ijc-KcIKpvwj1kUDXYZnReoRVg, maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8, linux-ide-u79uwXL29TY76Z2rM5mHXA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, tj-DgEjT+Ai2ygdnm+yROfE0A Hi, On 11/14/2014 01:49 PM, Hans de Goede wrote: > Hi, > > On 11/14/2014 12:56 PM, Hans de Goede wrote: >> Hi, >> >> On Thursday, November 13, 2014 11:29:56 PM UTC+1, Tejun Heo wrote: >>> >>> On Thu, Nov 13, 2014 at 11:24:16AM +0100, Hans de Goede wrote: >>>> This is something which we inherited from the Allwinner android kernel >>> sources, >>>> and I've always wanted to test if this is really necessary. >>>> >>>> So recently I've bought a sata port multiplexer, and I've given this a >>> test >>>> spin on both A10 and A20 devices, and it seems to work fine: >>>> >>>> [ 2.154456] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300) >>>> [ 2.161092] ata1.15: Port Multiplier 1.2, 0x197b:0x0325 r0, 5 ports, >>> feat 0x5/0xf >>>> [ 2.175511] ata1.00: hard resetting link >>>> [ 2.524929] ata1.00: SATA link up 3.0 Gbps (SStatus 123 SControl 320) >>>> [ 2.531430] ata1.01: hard resetting link >>>> [ 2.974465] ata1.01: link resume succeeded after 1 retries >>>> [ 3.094932] ata1.01: SATA link up 3.0 Gbps (SStatus 123 SControl 300) >>>> [ 3.101431] ata1.02: hard resetting link >>>> [ 4.174466] ata1.02: failed to resume link (SControl 0) >>>> [ 4.180065] ata1.02: SATA link down (SStatus 0 SControl 0) >>>> (and the same for links 3 and 4) >>>> >>>> Once the NO_PMP flag is removed it correctly sees the 2 disks which I've >>>> attached, and I can mount and use them just fine, so lets drop the flag. >>>> >>>> Signed-off-by: Hans de Goede <hdeg...-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org <javascript:>> >>> >>> Applied to libata/for-3.18-fixes. >>> >> >> I just found out why Allwinner added that AHCI_HFLAG_NO_PMP flag, after >> putting the system I used to test the port multiplexer back together this >> morning, it seems that probing for a port multiplexer being present breaks >> the no-port-multiplexer (so direct attached disk) case :( I guess I should >> have tested for that before sending the patch, but the thought of it >> breaking normal usage did not cross my mind. >> >> So self NACK. If it is not too late, can you please drop this from your >> tree ? >> >> Let me know if you want me to send a revert instead. >> >> I'll look into fixing this another way, maybe with a quirk + an extra reset >> after failed pmp testing, and it that does not work a module option. > > Ok, so the problem seems to be that the controller fails to do a soft-reset > when attached directly to a normal device rather then to a pmp. > > If I comment out this block of code in libata-core.c: > > if (sata_pmp_supported(link->ap) && ata_is_host_link(link)) { > /* If PMP is supported, we have to do follow-up SRST. > * Some PMPs don't send D2H Reg FIS after hardreset if > * the first port is empty. Wait only for > * ATA_TMOUT_PMP_SRST_WAIT. > */ > if (check_ready) { > unsigned long pmp_deadline; > > pmp_deadline = ata_deadline(jiffies, > ATA_TMOUT_PMP_SRST_WAIT); > if (time_after(pmp_deadline, deadline)) > pmp_deadline = deadline; > ata_wait_ready(link, pmp_deadline, check_ready); > } > rc = -EAGAIN; > goto out; > } > > Then things work again. This code looks like it is a must have for > pmp use, so I'll do a follow up patch to my initial patch dropping the > AHCI_HFLAG_NO_PMP flag, which re-adds it based on a module option > (defaulting to the non-pmp case). > > This way you don't have to do a forced-push to your tree to drop the > original patch (or revert it). Just saw your message that you've dropped the troublesome patch, in that case I'll do a completely new patch, rather then a follow on patch, to add a module option for this (unless you've a better idea). Regards, Hans ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-11-14 13:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-13 10:24 [PATCH] ahci_sunxi: Drop AHCI_HFLAG_NO_PMP flag Hans de Goede
[not found] ` <1415874256-6580-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-11-13 22:29 ` Tejun Heo
[not found] ` <20141113222952.GI2598-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2014-11-14 11:56 ` Hans de Goede
[not found] ` <037f97ce-468b-4b91-9616-51a3301c5be6-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2014-11-14 12:49 ` Hans de Goede
[not found] ` <5465FA40.8000508-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-11-14 13:08 ` Tejun Heo
2014-11-14 13:24 ` Hans de Goede
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).