Linux ATA/IDE development
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Brijesh Singh <brijesh.singh@amd.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Cc: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
	ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
	tj@kernel.org, devicetree@vger.kernel.org,
	linux-ide@vger.kernel.org
Subject: Re: [PATCH] ata: add AMD Seattle platform driver
Date: Fri, 08 Jan 2016 11:59:53 -0800	[thread overview]
Message-ID: <1452283193.4028.84.camel@perches.com> (raw)
In-Reply-To: <1452200002-31590-1-git-send-email-brijesh.singh@amd.com>

On Thu, 2016-01-07 at 14:53 -0600, Brijesh Singh wrote:
> AMD Seattle SATA controller mostly conforms to AHCI interface with some
> special register to control SGPIO interface. In the case of an AHCI
> controller, the SGPIO feature is ideally implemented using the
> "Enclosure Management" register of the AHCI controller, but those
> registeres are not implemented in the Seattle SoC. Instead SoC
> (Rev B0 onwards) provides a 32-bit SGPIO control register which should
> be programmed to control the activity, locate and fault LEDs.

trivia:

> diff --git a/drivers/ata/ahci_seattle.c b/drivers/ata/ahci_seattle.c
[]
> +static ssize_t seattle_transmit_led_message(struct ata_port *ap, u32 state,
> +					    ssize_t size)
> +{
> +	struct ahci_host_priv *hpriv = ap->host->private_data;
> +	struct ahci_port_priv *pp = ap->private_data;
> +	struct seattle_plat_data *plat_data = hpriv->plat_data;
> +	unsigned long flags;
> +	int pmp;
> +	struct ahci_em_priv *emp;
> +	u32 val;
> +
> +	/* get the slot number from the message */
> +	pmp = (state & EM_MSG_LED_PMP_SLOT) >> 8;
> +	if (pmp < EM_MAX_SLOTS)
> +		emp = &pp->em_priv[pmp];
> +	else
> +		return -EINVAL;

This is generally done using a inverted test that
returns immediately

	if (pmp >= EMP_MAX_SLOTS)
		return -EINVAL;

	emp = &pp->em_priv[pmp];



  parent reply	other threads:[~2016-01-08 19:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-07 20:53 [PATCH] ata: add AMD Seattle platform driver Brijesh Singh
2016-01-07 21:25 ` Arnd Bergmann
2016-01-07 22:24   ` Brijesh Singh
2016-01-07 23:42     ` Arnd Bergmann
2016-01-08  1:46       ` Brijesh Singh
2016-01-08  8:46         ` Arnd Bergmann
2016-01-08 22:21           ` Brijesh Singh
2016-01-08 22:47             ` Arnd Bergmann
2016-01-11 18:56               ` Brijesh Singh
     [not found]                 ` <5693FAC2.4070003-5C7GfCeVMHo@public.gmane.org>
2016-01-12 14:24                   ` Arnd Bergmann
2016-01-13 16:55                     ` Brijesh Singh
2016-01-13 20:39                       ` Arnd Bergmann
     [not found]             ` <5690367E.8060609-5C7GfCeVMHo@public.gmane.org>
2016-01-11 15:33               ` Mark Langsdorf
2016-01-11 16:55                 ` Brijesh Singh
2016-01-07 22:56   ` Rob Herring
2016-01-08 19:59 ` Joe Perches [this message]
2016-01-11 10:23 ` Hans de Goede

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=1452283193.4028.84.camel@perches.com \
    --to=joe@perches.com \
    --cc=brijesh.singh@amd.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=tj@kernel.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