Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 205206
b: refs/heads/master
c: 213373c
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Aug 1, 2010
1 parent d01b91e commit 135e244
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4d1f9082251a835ea387b47bb9dd26980bf8e0d0
refs/heads/master: 213373cf974fe69e78ec894b07f45ae2f5a3a078
8 changes: 8 additions & 0 deletions trunk/drivers/ata/ata_piix.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ struct piix_map_db {
struct piix_host_priv {
const int *map;
u32 saved_iocfg;
spinlock_t sidpr_lock; /* FIXME: remove once locking in EH is fixed */
void __iomem *sidpr;
};

Expand Down Expand Up @@ -951,25 +952,31 @@ static int piix_sidpr_scr_read(struct ata_link *link,
unsigned int reg, u32 *val)
{
struct piix_host_priv *hpriv = link->ap->host->private_data;
unsigned long flags;

if (reg >= ARRAY_SIZE(piix_sidx_map))
return -EINVAL;

spin_lock_irqsave(&hpriv->sidpr_lock, flags);
piix_sidpr_sel(link, reg);
*val = ioread32(hpriv->sidpr + PIIX_SIDPR_DATA);
spin_unlock_irqrestore(&hpriv->sidpr_lock, flags);
return 0;
}

static int piix_sidpr_scr_write(struct ata_link *link,
unsigned int reg, u32 val)
{
struct piix_host_priv *hpriv = link->ap->host->private_data;
unsigned long flags;

if (reg >= ARRAY_SIZE(piix_sidx_map))
return -EINVAL;

spin_lock_irqsave(&hpriv->sidpr_lock, flags);
piix_sidpr_sel(link, reg);
iowrite32(val, hpriv->sidpr + PIIX_SIDPR_DATA);
spin_unlock_irqrestore(&hpriv->sidpr_lock, flags);
return 0;
}

Expand Down Expand Up @@ -1566,6 +1573,7 @@ static int __devinit piix_init_one(struct pci_dev *pdev,
hpriv = devm_kzalloc(dev, sizeof(*hpriv), GFP_KERNEL);
if (!hpriv)
return -ENOMEM;
spin_lock_init(&hpriv->sidpr_lock);

/* Save IOCFG, this will be used for cable detection, quirk
* detection and restoration on detach. This is necessary
Expand Down

0 comments on commit 135e244

Please sign in to comment.