Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 59070
b: refs/heads/master
c: a77720a
h: refs/heads/master
v: v3
  • Loading branch information
Mikael Pettersson authored and Jeff Garzik committed Jul 11, 2007
1 parent 4aa16b5 commit ee7ae29
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 15ce09432a4399e61b57f2ceb564522d6534c15f
refs/heads/master: a77720ad0a4049e4bc6355e4febf899966a48222
41 changes: 36 additions & 5 deletions trunk/drivers/ata/sata_promise.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#include "sata_promise.h"

#define DRV_NAME "sata_promise"
#define DRV_VERSION "2.08"
#define DRV_VERSION "2.09"

enum {
PDC_MAX_PORTS = 4,
Expand Down Expand Up @@ -716,6 +716,9 @@ static irqreturn_t pdc_interrupt (int irq, void *dev_instance)
unsigned int i, tmp;
unsigned int handled = 0;
void __iomem *mmio_base;
unsigned int hotplug_offset, ata_no;
u32 hotplug_status;
int is_sataii_tx4;

VPRINTK("ENTER\n");

Expand All @@ -726,27 +729,55 @@ static irqreturn_t pdc_interrupt (int irq, void *dev_instance)

mmio_base = host->iomap[PDC_MMIO_BAR];

/* read and clear hotplug flags for all ports */
if (host->ports[0]->flags & PDC_FLAG_GEN_II)
hotplug_offset = PDC2_SATA_PLUG_CSR;
else
hotplug_offset = PDC_SATA_PLUG_CSR;
hotplug_status = readl(mmio_base + hotplug_offset);
if (hotplug_status & 0xff)
writel(hotplug_status | 0xff, mmio_base + hotplug_offset);
hotplug_status &= 0xff; /* clear uninteresting bits */

/* reading should also clear interrupts */
mask = readl(mmio_base + PDC_INT_SEQMASK);

if (mask == 0xffffffff) {
if (mask == 0xffffffff && hotplug_status == 0) {
VPRINTK("QUICK EXIT 2\n");
return IRQ_NONE;
}

spin_lock(&host->lock);

mask &= 0xffff; /* only 16 tags possible */
if (!mask) {
if (mask == 0 && hotplug_status == 0) {
VPRINTK("QUICK EXIT 3\n");
goto done_irq;
}

writel(mask, mmio_base + PDC_INT_SEQMASK);

is_sataii_tx4 = pdc_is_sataii_tx4(host->ports[0]->flags);

for (i = 0; i < host->n_ports; i++) {
VPRINTK("port %u\n", i);
ap = host->ports[i];

/* check for a plug or unplug event */
ata_no = pdc_port_no_to_ata_no(i, is_sataii_tx4);
tmp = hotplug_status & (0x11 << ata_no);
if (tmp && ap &&
!(ap->flags & ATA_FLAG_DISABLED)) {
struct ata_eh_info *ehi = &ap->eh_info;
ata_ehi_clear_desc(ehi);
ata_ehi_hotplugged(ehi);
ata_ehi_push_desc(ehi, "hotplug_status %#x", tmp);
ata_port_freeze(ap);
++handled;
continue;
}

/* check for a packet interrupt */
tmp = mask & (1 << (i + 1));
if (tmp && ap &&
!(ap->flags & ATA_FLAG_DISABLED)) {
Expand Down Expand Up @@ -902,9 +933,9 @@ static void pdc_host_init(struct ata_host *host)
tmp = readl(mmio + hotplug_offset);
writel(tmp | 0xff, mmio + hotplug_offset);

/* mask plug/unplug ints */
/* unmask plug/unplug ints */
tmp = readl(mmio + hotplug_offset);
writel(tmp | 0xff0000, mmio + hotplug_offset);
writel(tmp & ~0xff0000, mmio + hotplug_offset);

/* don't initialise TBG or SLEW on 2nd generation chips */
if (is_gen2)
Expand Down

0 comments on commit ee7ae29

Please sign in to comment.