Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9700
b: refs/heads/master
c: 923f122
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Sep 14, 2005
1 parent be126bb commit 7a360e3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 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: 905ec87e93bc9e01b15c60035cd6a50c636cbaef
refs/heads/master: 923f122573851d18a3832ca808269fa2d5046fb1
31 changes: 23 additions & 8 deletions trunk/drivers/scsi/sata_sil24.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include <asm/io.h>

#define DRV_NAME "sata_sil24"
#define DRV_VERSION "0.20" /* Silicon Image's preview driver was 0.10 */
#define DRV_VERSION "0.21" /* Silicon Image's preview driver was 0.10 */

#define NR_PORTS 4

Expand Down Expand Up @@ -426,15 +426,11 @@ static void sil24_irq_clear(struct ata_port *ap)
/* unused */
}

static void sil24_reset_controller(struct ata_port *ap)
static int __sil24_reset_controller(void *port)
{
void *port = (void *)ap->ioaddr.cmd_addr;
int cnt;
u32 tmp;

printk(KERN_NOTICE DRV_NAME
" ata%u: resetting controller...\n", ap->id);

/* Reset controller state. Is this correct? */
writel(PORT_CS_DEV_RST, port + PORT_CTRL_STAT);
readl(port + PORT_CTRL_STAT); /* sync */
Expand All @@ -446,9 +442,19 @@ static void sil24_reset_controller(struct ata_port *ap)
if (!(tmp & PORT_CS_DEV_RST))
break;
}

if (tmp & PORT_CS_DEV_RST)
printk(KERN_ERR DRV_NAME
" ata%u: failed to reset controller\n", ap->id);
return -1;
return 0;
}

static void sil24_reset_controller(struct ata_port *ap)
{
printk(KERN_NOTICE DRV_NAME
" ata%u: resetting controller...\n", ap->id);
if (__sil24_reset_controller((void *)ap->ioaddr.cmd_addr))
printk(KERN_ERR DRV_NAME
" ata%u: failed to reset controller\n", ap->id);
}

static void sil24_eng_timeout(struct ata_port *ap)
Expand Down Expand Up @@ -740,6 +746,15 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
/* Clear interrupts */
writel(0x0fff0fff, port + PORT_IRQ_STAT);
writel(PORT_CS_IRQ_WOC, port + PORT_CTRL_CLR);

/* Clear port multiplier enable and resume bits */
writel(PORT_CS_PM_EN | PORT_CS_RESUME, port + PORT_CTRL_CLR);

/* Reset itself */
if (__sil24_reset_controller(port))
printk(KERN_ERR DRV_NAME
"(%s): failed to reset controller\n",
pci_name(pdev));
}

/* Turn on interrupts */
Expand Down

0 comments on commit 7a360e3

Please sign in to comment.