From: Jeff Garzik <jgarzik@pobox.com>
To: Matthew Garrett <mjg@redhat.com>
Cc: linux-ide@vger.kernel.org,
Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Subject: Re: [PATCH] ahci: Turn off DMA engines when there's no device attached
Date: Mon, 29 Mar 2010 17:30:55 -0400 [thread overview]
Message-ID: <4BB11C0F.2090308@pobox.com> (raw)
In-Reply-To: <1268253150-24050-1-git-send-email-mjg@redhat.com>
On 03/10/2010 03:32 PM, Matthew Garrett wrote:
> +static int ahci_is_device_present(struct ata_port *ap)
> +{
> + void __iomem *port_mmio = ahci_port_base(ap);
> + u8 status = readl(port_mmio + PORT_TFDATA)& 0xff;
> +
> + /* Make sure PxTFD.STS.BSY and PxTFD.STS.DRQ are 0 */
> + if (status& (ATA_BUSY | ATA_DRQ))
> + return 0;
> +
> + /* Make sure PxSSTS.DET is 3h */
> + status = readl(port_mmio + PORT_SCR_STAT)& 0xf;
> + if (status != 3)
> + return 0;
> + return 1;
Note that this last test, reading SATA Control Register (SCR) Status,
does not account for in-transition status, ie. devices that were just
plugged in.
Jeff
prev parent reply other threads:[~2010-03-29 21:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-10 20:32 [PATCH] ahci: Turn off DMA engines when there's no device attached Matthew Garrett
2010-03-24 14:19 ` Matthew Garrett
2010-03-24 14:43 ` Jeff Garzik
2010-03-28 4:39 ` Jeff Garzik
2010-03-29 21:30 ` Jeff Garzik [this message]
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=4BB11C0F.2090308@pobox.com \
--to=jgarzik@pobox.com \
--cc=kristen.c.accardi@intel.com \
--cc=linux-ide@vger.kernel.org \
--cc=mjg@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.