LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] sata_mv: Manage SATA port multiplier while searching for active links
@ 2015-03-30 17:32 Gregory CLEMENT
  2015-03-30 17:35 ` Tejun Heo
  0 siblings, 1 reply; 3+ messages in thread
From: Gregory CLEMENT @ 2015-03-30 17:32 UTC (permalink / raw)
  To: Tejun Heo
  Cc: linux-ide, linux-kernel, Jason Cooper, Andrew Lunn,
	Sebastian Hesselbarth, Gregory CLEMENT, Thomas Petazzoni,
	Ezequiel Garcia, linux-arm-kernel, Maxime Ripard,
	Boris BREZILLON, Lior Amsalem, Tawfik Bayouk, Nadav Haklai

From: Nadav Haklai <nadavh@marvell.com>

With this patch, when searching for active link, first search through
the port multiplier links. And then fall to the default ap active_tag
only if no there is no active link in the port multiplier.

[gregory.clement@free-electrons.com: reword commit log and title]

Signed-off-by: Lior Amsalem <alior@marvell.com>
Reviewed-by: Nadav Haklai <nadavh@marvell.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
---
 drivers/ata/sata_mv.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index f8c33e3772b8..7fac4d0fee86 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -2423,10 +2423,19 @@ static struct ata_queued_cmd *mv_get_active_qc(struct ata_port *ap)
 {
 	struct mv_port_priv *pp = ap->private_data;
 	struct ata_queued_cmd *qc;
+	struct ata_link *link = NULL;
 
 	if (pp->pp_flags & MV_PP_FLAG_NCQ_EN)
 		return NULL;
-	qc = ata_qc_from_tag(ap, ap->link.active_tag);
+
+	ata_for_each_link(link, ap, EDGE)
+		if (ata_link_active(link))
+			break;
+
+	if (!link)
+		link = &ap->link;
+
+	qc = ata_qc_from_tag(ap, link->active_tag);
 	if (qc && !(qc->tf.flags & ATA_TFLAG_POLLING))
 		return qc;
 	return NULL;
-- 
2.1.0


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

* Re: [PATCH] sata_mv: Manage SATA port multiplier while searching for active links
  2015-03-30 17:32 [PATCH] sata_mv: Manage SATA port multiplier while searching for active links Gregory CLEMENT
@ 2015-03-30 17:35 ` Tejun Heo
  2015-03-31  7:15   ` Gregory CLEMENT
  0 siblings, 1 reply; 3+ messages in thread
From: Tejun Heo @ 2015-03-30 17:35 UTC (permalink / raw)
  To: Gregory CLEMENT
  Cc: linux-ide, linux-kernel, Jason Cooper, Andrew Lunn,
	Sebastian Hesselbarth, Thomas Petazzoni, Ezequiel Garcia,
	linux-arm-kernel, Maxime Ripard, Boris BREZILLON, Lior Amsalem,
	Tawfik Bayouk, Nadav Haklai

Hello,

On Mon, Mar 30, 2015 at 07:32:45PM +0200, Gregory CLEMENT wrote:
> From: Nadav Haklai <nadavh@marvell.com>
> 
> With this patch, when searching for active link, first search through
> the port multiplier links. And then fall to the default ap active_tag
> only if no there is no active link in the port multiplier.

What does this fix?  What was broken before?  What's the impact of the
patch?  A patch description which just restates the patch content
isn't all that useful.

Thanks.

-- 
tejun

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

* Re: [PATCH] sata_mv: Manage SATA port multiplier while searching for active links
  2015-03-30 17:35 ` Tejun Heo
@ 2015-03-31  7:15   ` Gregory CLEMENT
  0 siblings, 0 replies; 3+ messages in thread
From: Gregory CLEMENT @ 2015-03-31  7:15 UTC (permalink / raw)
  To: Tejun Heo
  Cc: linux-ide, linux-kernel, Jason Cooper, Andrew Lunn,
	Sebastian Hesselbarth, Thomas Petazzoni, Ezequiel Garcia,
	linux-arm-kernel, Maxime Ripard, Boris BREZILLON, Lior Amsalem,
	Tawfik Bayouk, Nadav Haklai

Hi Tejun,

On 30/03/2015 19:35, Tejun Heo wrote:
> Hello,
> 
> On Mon, Mar 30, 2015 at 07:32:45PM +0200, Gregory CLEMENT wrote:
>> From: Nadav Haklai <nadavh@marvell.com>
>>
>> With this patch, when searching for active link, first search through
>> the port multiplier links. And then fall to the default ap active_tag
>> only if no there is no active link in the port multiplier.
> 
> What does this fix?  What was broken before?  What's the impact of the
> patch?  A patch description which just restates the patch content
> isn't all that useful.

I _thought_ that the purpose of this patch was to manage the port multiplier,
and without this patch we don't only handle it. I will ask more detail and
come back with a new version of the patch with a more useful description.

Thanks,

Gregory



> 
> Thanks.
> 


-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

end of thread, other threads:[~2015-03-31  7:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-30 17:32 [PATCH] sata_mv: Manage SATA port multiplier while searching for active links Gregory CLEMENT
2015-03-30 17:35 ` Tejun Heo
2015-03-31  7:15   ` Gregory CLEMENT

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