devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"linux-ide-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-ide-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Andy Gross <andy.gross-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-arm-msm
	<linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	jmaggard10-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: Re: [RFC PATCH 2/3] ata: ahci-platform: Add ports-implemented dt bindings.
Date: Tue, 29 Mar 2016 15:43:06 +0100	[thread overview]
Message-ID: <56FA947A.5080806@linaro.org> (raw)
In-Reply-To: <CAL_JsqLhSz1qWj01mAAg4X89hb4LnYB-CjJ2d1JW=jJw66Oq=g@mail.gmail.com>



On 29/03/16 15:11, Rob Herring wrote:
> On Tue, Mar 29, 2016 at 8:11 AM, Srinivas Kandagatla
> <srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
>> On some SOCs PORTS_IMPL register value is never programmed by the BIOS
>
> s/BIOS/firmware/
BIOS is the word used in the AHCI SPECS so want to stick to this.
>
> You do plan to fix this in your firmware/bootloader, too, right?

No. This feature was working just before v4.5, we have no plans to fix 
this in firmware as of today.
>
>> and left at zero value. Which means that no sata ports are avaiable for
>> software. AHCI driver used to cope up with this by fabricating the
>> port_map if the PORTS_IMPL register is read zero, but recent patch
>> broke this workaround as zero value was valid for nvme disks.
>
> s/nvme/NVMe/

Yep, will fix it.
>
>>
>> This patch adds ports-implemented dt bindings as workaround for this issue
>
> s/dt/DT/
Ok, will fix it.

>
>> in a way that DT can dictate the port_map incase where the SOCs does not
>> program it already.
>
> port_map is a Linux term.
Yes, I can rephrase it to ports implemented.
>
> ...can override the PORTS_IMPL register in cases where the firmware
> did not program it already.
>
>>
>> Fixes: 566d1827df2e ("libata: disable forced PORTS_IMPL for >= AHCI 1.3)
>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
>> ---
>>   Documentation/devicetree/bindings/ata/ahci-platform.txt | 11 +++++++++++
>>   drivers/ata/ahci_platform.c                             |  4 ++++
>>   2 files changed, 15 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.txt b/Documentation/devicetree/bindings/ata/ahci-platform.txt
>> index 30df832..8165db3 100644
>> --- a/Documentation/devicetree/bindings/ata/ahci-platform.txt
>> +++ b/Documentation/devicetree/bindings/ata/ahci-platform.txt
>> @@ -32,6 +32,10 @@ Optional properties:
>>   - target-supply     : regulator for SATA target power
>>   - phys              : reference to the SATA PHY node
>>   - phy-names         : must be "sata-phy"
>> +- ports-implemented : Mask that indicates which ports that the HBA supports
>> +                     are available for software to use. Useful if PORTS_IMPL
>> +                     is not programmed by the BIOS, which is true with
>> +                     some embedded SOC's.
>>
>>   Required properties when using sub-nodes:
>>   - #address-cells    : number of cells to encode an address
>> @@ -59,6 +63,13 @@ Examples:
>>                  target-supply = <&reg_ahci_5v>;
>>          };
>>
>> +       sata0: sata@29000000 { /* Qualcomm APQ8064 */
>
> Do you really need another example just for this?
>
>> +               compatible = "generic-ahci";
>
> Where's your chip specific compatible string? You would not require a
> DT update to fix this if you had that.

Possibly, But we really are not doing anything specific in the ahci 
driver which is not generic, that might be the reason why we skipped 
this in the first place.

I agree we could solve this issue in more than one way, The only 
advantage of this new bindings would be to other platforms benefiting 
from this workaround would not have to keep adding a new compatible 
string into the ahci-platform driver.

Like Annapurna Alpine platform seems to have the same issue.

Am ok to do it either way.


thanks,
srini

>
>> +               reg = <0x29000000 0x180>;
>> +               interrupts = <GIC_SPI 209 IRQ_TYPE_NONE>;
>> +               ports-implemented = <0x1>;
>> +       };
>> +
>>   With sub-nodes:
>>          sata@f7e90000 {
>>                  compatible = "marvell,berlin2q-achi", "generic-ahci";
>> diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
>> index 4044233..ec8db80 100644
>> --- a/drivers/ata/ahci_platform.c
>> +++ b/drivers/ata/ahci_platform.c
>> @@ -42,6 +42,7 @@ static int ahci_probe(struct platform_device *pdev)
>>          struct device *dev = &pdev->dev;
>>          struct ahci_host_priv *hpriv;
>>          int rc;
>> +       u32 ports_impl;
>>
>>          hpriv = ahci_platform_get_resources(pdev);
>>          if (IS_ERR(hpriv))
>> @@ -51,6 +52,9 @@ static int ahci_probe(struct platform_device *pdev)
>>          if (rc)
>>                  return rc;
>>
>> +       of_property_read_u32(dev->of_node,
>> +                            "ports-implemented", &hpriv->force_port_map);
>> +
>>          if (of_device_is_compatible(dev->of_node, "hisilicon,hisi-ahci"))
>>                  hpriv->flags |= AHCI_HFLAG_NO_FBS | AHCI_HFLAG_NO_NCQ;
>>
>> --
>> 2.5.0
>>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-03-29 14:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-29 13:11 [RFC PATCH 0/3] ahci: add ports-implemented dt bindings Srinivas Kandagatla
2016-03-29 13:11 ` [RFC PATCH 1/3] libahci: save port map for forced port map Srinivas Kandagatla
2016-03-30 18:57   ` Tejun Heo
2016-03-31 15:58     ` Srinivas Kandagatla
2016-03-31 16:43       ` Tejun Heo
2016-03-31 16:51         ` Srinivas Kandagatla
2016-03-29 13:11 ` [RFC PATCH 2/3] ata: ahci-platform: Add ports-implemented dt bindings Srinivas Kandagatla
2016-03-29 14:11   ` Rob Herring
2016-03-29 14:43     ` Srinivas Kandagatla [this message]
2016-03-29 17:07       ` Rob Herring
2016-03-29 17:10         ` Srinivas Kandagatla
2016-03-29 13:11 ` [RFC PATCH 3/3] ARM: dts: apq8064: add ahci ports-implemented mask Srinivas Kandagatla

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=56FA947A.5080806@linaro.org \
    --to=srinivas.kandagatla-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
    --cc=andy.gross-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=jmaggard10-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-ide-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    /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).