linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: hdegoede@redhat.com (Hans de Goede)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v10 0/8] ARM: berlin: add AHCI support
Date: Sat, 19 Jul 2014 12:31:19 +0200	[thread overview]
Message-ID: <53CA48F7.5020405@redhat.com> (raw)
In-Reply-To: <53CA4608.3040208@redhat.com>

Hi,

On 07/19/2014 12:18 PM, Hans de Goede wrote:

<snip>

> The problem is that:
>
> 1) We need to enable resources before we can do ahci_save_initial_config()
> 2) We must do ahci_save_initial_config() before we can do ata_host_alloc_pinfo()
> 3) Therefor we don't have port_info at enable_resources time, which is when we
> want to enable the phys (and we cannot just enable the phys elsewhere as
> enable_resouces gets used on e.g. resume too).
>
> So I think it is best to just make the phy pointers an array inside
> ahci_host_priv, with a comment that the array indexes must match port
> indexes.

So looking at "[PATCH v10 4/8] ata: libahci: allow to use multiple PHYs"
I see that currently the phy array indexes do not necessarily match the
port indexes. Since you already allocate the phys array at nports size,
I suggest simply making the array sparse, leaving in NULL entries for
unused ports, and adjusting enable / disable_phys to check for NULL
pointers. This way we still have a 1:1 way to map ports <-> phys if
we want to do something with phys on a per port basis in the future.

Note please also add a check that reg < nports so that we don't use
the array out of bounds if there is an error in the dts.

<snip>

Regards,

Hans

  reply	other threads:[~2014-07-19 10:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-18 12:29 [PATCH v10 0/8] ARM: berlin: add AHCI support Antoine Ténart
2014-07-18 12:30 ` [PATCH v10 1/8] phy: add a driver for the Berlin SATA PHY Antoine Ténart
2014-07-18 12:54   ` Varka Bhadram
2014-07-18 12:30 ` [PATCH v10 2/8] Documentation: bindings: add " Antoine Ténart
2014-07-18 17:27   ` Sergei Shtylyov
2014-07-21  9:04     ` Antoine Ténart
2014-07-18 12:30 ` [PATCH v10 3/8] ata: libahci_platform: move port_map parameters into the AHCI structure Antoine Ténart
2014-07-18 13:47   ` Tejun Heo
2014-07-21  9:02     ` Antoine Ténart
2014-07-18 12:30 ` [PATCH v10 4/8] ata: libahci: allow to use multiple PHYs Antoine Ténart
2014-07-18 13:17   ` Lothar Waßmann
2014-07-21  9:01     ` Antoine Ténart
2014-07-18 12:30 ` [PATCH v10 5/8] ata: ahci_platform: add a generic AHCI compatible Antoine Ténart
2014-07-18 14:30   ` Hans de Goede
2014-07-18 12:30 ` [PATCH v10 6/8] Documentation: bindings: document the sub-nodes AHCI bindings Antoine Ténart
2014-07-18 12:30 ` [PATCH v10 7/8] ARM: berlin: add the AHCI node for the BG2Q Antoine Ténart
2014-07-18 12:30 ` [PATCH v10 8/8] ARM: berlin: enable the eSATA interface on the BG2Q DMP Antoine Ténart
2014-07-18 13:57 ` [PATCH v10 0/8] ARM: berlin: add AHCI support Tejun Heo
2014-07-19  9:03   ` Sebastian Hesselbarth
2014-07-19 10:18   ` Hans de Goede
2014-07-19 10:31     ` Hans de Goede [this message]
2014-07-21  9:09       ` Antoine Ténart

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=53CA48F7.5020405@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.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).