From: Tejun Heo <htejun@gmail.com>
To: "zhao, forrest" <forrest.zhao@intel.com>
Cc: jeff@garzik.org, hare@suse.de, axboe@suse.de, jeremy@goop.org,
lkml@rtr.ca, linux-ide@vger.kernel.org
Subject: Re: [PATCH 6/6] Implement the AHCI suspend/resume
Date: Sat, 3 Jun 2006 22:35:31 +0900 [thread overview]
Message-ID: <20060603133531.GD25958@htj.dyndns.org> (raw)
In-Reply-To: <1149234379.13451.59.camel@forrest26.sh.intel.com>
On Fri, Jun 02, 2006 at 03:46:19PM +0800, zhao, forrest wrote:
> --- a/drivers/scsi/ahci.c
> +++ b/drivers/scsi/ahci.c
> @@ -188,6 +188,7 @@ struct ahci_host_priv {
> unsigned long flags;
> u32 cap; /* cache of HOST_CAP register */
> u32 port_map; /* cache of HOST_PORTS_IMPL reg */
> + u32 dev_map; /* connected devices */
I'm having difficult time understanding the usage of dev_map. Why is
it needed?
> +static int ahci_port_resume(struct ata_port *ap)
> +{
> + void __iomem *mmio = ap->host_set->mmio_base;
> + void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no);
> + struct ahci_host_priv *hpriv = ap->host_set->private_data;
> + struct ahci_port_priv *pp = ap->private_data;
> + int rc;
> + u32 tmp;
> +
> + /*
> + * Enable FIS reception
> + */
> + ahci_start_fis_rx(port_mmio, pp, hpriv);
> +
> + rc = ahci_port_spinup(port_mmio, hpriv->cap);
> + if (rc)
> + ata_port_printk(ap, KERN_WARNING, "Could not spinup device"
> + " (%d)\n", rc);
> +
> + /*
> + * Clear error status
> + */
> + tmp = readl(port_mmio + PORT_SCR_ERR);
> + writel(tmp, port_mmio + PORT_SCR_ERR);
> + /*
> + * Clear interrupt status
> + */
> + tmp = readl(mmio + HOST_CTL);
> + if (!(tmp & HOST_IRQ_EN)) {
> + u32 irq_stat;
> +
> + /* ack any pending irq events for this port */
> + irq_stat = readl(port_mmio + PORT_IRQ_STAT);
> + if (irq_stat)
> + writel(irq_stat, port_mmio + PORT_IRQ_STAT);
> +
> + /* set irq mask (enables interrupts) */
> + writel(DEF_PORT_IRQ, port_mmio + PORT_IRQ_MASK);
> +
> + if ((hpriv->dev_map >> (ap->port_no + 1)) == 0) {
> + /*
> + * Enable interrupts if this was the last port
> + */
> + ata_port_printk(ap, KERN_INFO, "Enable interrupts\n");
> +
> + irq_stat = readl(mmio + HOST_IRQ_STAT);
> + if (irq_stat)
> + writel(irq_stat, mmio + HOST_IRQ_STAT);
> +
> + tmp |= HOST_IRQ_EN;
> + writel(tmp, mmio + HOST_CTL);
> + (void) readl(mmio + HOST_CTL);
> + }
Can't above enable-IRQ block be moved into ahci_pci_device_resume()
after resuming all ports?
--
tejun
next prev parent reply other threads:[~2006-06-03 13:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-02 7:46 [PATCH 6/6] Implement the AHCI suspend/resume zhao, forrest
2006-06-02 8:21 ` Hannes Reinecke
2006-06-02 8:34 ` Tejun Heo
2006-06-03 13:35 ` Tejun Heo [this message]
2006-06-05 5:05 ` zhao, forrest
-- strict thread matches above, loose matches on Subject: below --
2006-06-06 10:17 zhao, forrest
2006-06-29 8:21 zhao, forrest
2006-07-10 3:35 zhao, forrest
2006-07-10 7:34 ` zhao, forrest
2006-07-10 7:34 zhao, forrest
2006-07-11 6:42 zhao, forrest
2006-07-13 5:39 zhao, forrest
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=20060603133531.GD25958@htj.dyndns.org \
--to=htejun@gmail.com \
--cc=axboe@suse.de \
--cc=forrest.zhao@intel.com \
--cc=hare@suse.de \
--cc=jeff@garzik.org \
--cc=jeremy@goop.org \
--cc=linux-ide@vger.kernel.org \
--cc=lkml@rtr.ca \
/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).