linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "saeed bishara" <saeed.bishara@gmail.com>
To: Mark Lord <liml@rtr.ca>
Cc: Jeff Garzik <jgarzik@pobox.com>, Tejun Heo <htejun@gmail.com>,
	IDE/ATA development list <linux-ide@vger.kernel.org>,
	Saeed Bishara <saeed@marvell.com>
Subject: Re: [PATCH] libata-pmp: clear hob for pmp register accesses
Date: Thu, 21 Feb 2008 23:51:10 +0200	[thread overview]
Message-ID: <c70ff3ad0802211351s360eea12p64e4e79f359813af@mail.gmail.com> (raw)
In-Reply-To: <47BDE489.6070701@rtr.ca>

Hi,
 I just what to make it clear that this is not a bug of the Marvell's
PM, the sata specification (I'm looking at version 2.5) defines the
READ/WRITE PM registers to be extended commands, specifically, the
features HOB of the READ PM register defined to be RegNum[15:8].

saeed

On Thu, Feb 21, 2008 at 10:52 PM, Mark Lord <liml@rtr.ca> wrote:
> Mark Lord wrote:
>  > Tejun Heo wrote:
>  >> Hello, Mark.
>  >>
>  >> Mark Lord wrote:
>  >>> Tejun, I've added PMP to sata_mv, and am now trying to get it
>  >>> to work with a Marvell PM attached.
>  >>>
>  >>> And the behaviour I see is very bizarre.
>  >>>
>  >>> After hard+soft resets, the PM signature is found,
>  >>> and libata interrogates the PM registers.
>  >>>
>  >>> It successfully reads register 0, and then register 1.
>  >>> But all subsequent registers read out (incorrectly) as zeros.
>  ..
>
>  Saeed has confirmed this behaviour with a SATA analyzer.
>  The Marvell port-multiplier apparently likes to see clean HOB
>  information when accessing PMP registers.
>
>  Since sata_mv uses PIO shadow register access, this doesn't happen
>  automatically, as it might in a more purely FIS-based driver (eg. ahci).
>
>  One way to fix this is to flag these commands with ATA_TFLAG_LBA48,
>  forcing libata to write out the HOB fields with known (zero) values.
>
>  Signed-off-by: Saeed Bishara <saeed@marvell.com>
>  Acked-by: Mark Lord <mlord@pobox.com>
>  ---
>   drivers/ata/libata-pmp.c |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
>  diff --git a/drivers/ata/libata-pmp.c b/drivers/ata/libata-pmp.c
>  index caef2bb..d91f509 100644
>  --- a/drivers/ata/libata-pmp.c
>  +++ b/drivers/ata/libata-pmp.c
>  @@ -35,7 +35,7 @@ static unsigned int sata_pmp_read(struct ata_link *link, int reg, u32 *r_val)
>         ata_tf_init(pmp_dev, &tf);
>         tf.command = ATA_CMD_PMP_READ;
>         tf.protocol = ATA_PROT_NODATA;
>  -       tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
>  +       tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE | ATA_TFLAG_LBA48;
>         tf.feature = reg;
>         tf.device = link->pmp;
>
>  @@ -71,7 +71,7 @@ static unsigned int sata_pmp_write(struct ata_link *link, int reg, u32 val)
>         ata_tf_init(pmp_dev, &tf);
>         tf.command = ATA_CMD_PMP_WRITE;
>         tf.protocol = ATA_PROT_NODATA;
>  -       tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
>  +       tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE | ATA_TFLAG_LBA48;
>         tf.feature = reg;
>         tf.device = link->pmp;
>         tf.nsect = val & 0xff;
>  -
>  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
>

  reply	other threads:[~2008-02-21 21:51 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-06 21:56 only one drive in a port multiplier system is being recognized Greg Hennessy
2007-11-12  2:58 ` Tejun Heo
     [not found]   ` <4738827D.9060405@pobox.com>
2007-11-13  1:09     ` What's needed for PMP support? Tejun Heo
2008-02-20 19:03       ` Mark Lord
2008-02-21  3:39         ` Tejun Heo
2008-02-21 15:07           ` Mark Lord
2008-02-21 20:52             ` [PATCH] libata-pmp: clear hob for pmp register accesses Mark Lord
2008-02-21 21:51               ` saeed bishara [this message]
2008-02-22  1:40               ` Tejun Heo
2008-02-24  5:29               ` Jeff Garzik
2008-02-22  0:31         ` What's needed for PMP support? Mark Lord
2008-02-22  0:32           ` Mark Lord
2008-02-22  1:57             ` Tejun Heo
2008-02-22  2:04               ` Mark Lord
2008-02-22  2:12                 ` Tejun Heo
2008-02-22  2:25                   ` Mark Lord
2008-02-22  2:27                     ` Mark Lord
2008-02-22  3:52                       ` Mark Lord
2008-02-22  4:22                         ` new ata_port_operations for .pmp_{read,write} ? Mark Lord
2008-02-22 14:23                           ` Mark Lord
2008-02-22 14:28                             ` Mark Lord
2008-02-23  0:38                               ` Mark Lord
2008-02-23  2:49                                 ` Tejun Heo
2008-02-23  2:43                             ` Tejun Heo
2008-02-23  2:59                               ` Jeff Garzik
2008-02-23  5:15                             ` Mark Lord
2008-02-24  7:03                               ` Tejun Heo
2008-02-24  7:14                                 ` Jeff Garzik
2008-02-25  4:34                                   ` Mark Lord
2008-02-25  4:46                                     ` Jeff Garzik
2008-02-25  4:31                                 ` Mark Lord
2008-02-25  4:49                                 ` Mark Lord
2008-02-25  4:56                                   ` Jeff Garzik
2008-02-25  5:20                                   ` Tejun Heo
2008-02-25 16:55                                     ` Mark Lord
2008-02-25 23:44                                       ` Tejun Heo
2008-02-26  0:12                                         ` Mark Lord
2008-02-26  2:01                                           ` Tejun Heo
2008-02-22  9:57             ` What's needed for PMP support? Alan Cox

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=c70ff3ad0802211351s360eea12p64e4e79f359813af@mail.gmail.com \
    --to=saeed.bishara@gmail.com \
    --cc=htejun@gmail.com \
    --cc=jgarzik@pobox.com \
    --cc=liml@rtr.ca \
    --cc=linux-ide@vger.kernel.org \
    --cc=saeed@marvell.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 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).