Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 56901
b: refs/heads/master
c: c8511f9
h: refs/heads/master
i:
  56899: 649c2bc
v: v3
  • Loading branch information
Jiri Slaby authored and Linus Torvalds committed May 24, 2007
1 parent a713329 commit d7150cd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 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: c15395c0dbdd646ca80945a7578c8c6cd44ce942
refs/heads/master: c8511f94908a92337b80f0c12342b9051232054f
11 changes: 10 additions & 1 deletion trunk/drivers/misc/phantom.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ static int phantom_status(struct phantom_device *dev, unsigned long newstat)
atomic_set(&dev->counter, 0);
iowrite32(PHN_CTL_IRQ, dev->iaddr + PHN_CONTROL);
iowrite32(0x43, dev->caddr + PHN_IRQCTL);
} else if ((dev->status & PHB_RUNNING) && !(newstat & PHB_RUNNING))
ioread32(dev->caddr + PHN_IRQCTL); /* PCI posting */
} else if ((dev->status & PHB_RUNNING) && !(newstat & PHB_RUNNING)) {
iowrite32(0, dev->caddr + PHN_IRQCTL);
ioread32(dev->caddr + PHN_IRQCTL); /* PCI posting */
}

dev->status = newstat;

Expand Down Expand Up @@ -102,6 +105,7 @@ static long phantom_ioctl(struct file *file, unsigned int cmd,

pr_debug("phantom: writing %x to %u\n", r.value, r.reg);
iowrite32(r.value, dev->iaddr + r.reg);
ioread32(dev->iaddr); /* PCI posting */

if (r.reg == PHN_CONTROL && !(r.value & PHN_CTL_IRQ))
phantom_status(dev, dev->status & ~PHB_RUNNING);
Expand All @@ -116,6 +120,7 @@ static long phantom_ioctl(struct file *file, unsigned int cmd,
for (i = 0; i < min(rs.count, 8U); i++)
if ((1 << i) & rs.mask)
iowrite32(rs.values[i], dev->oaddr + i);
ioread32(dev->iaddr); /* PCI posting */
spin_unlock(&dev->ioctl_lock);
break;
case PHN_GET_REG:
Expand Down Expand Up @@ -221,6 +226,7 @@ static irqreturn_t phantom_isr(int irq, void *data)

iowrite32(0, dev->iaddr);
iowrite32(0xc0, dev->iaddr);
ioread32(dev->iaddr); /* PCI posting */

atomic_inc(&dev->counter);
wake_up_interruptible(&dev->wait);
Expand Down Expand Up @@ -297,6 +303,7 @@ static int __devinit phantom_probe(struct pci_dev *pdev,
pht->cdev.owner = THIS_MODULE;

iowrite32(0, pht->caddr + PHN_IRQCTL);
ioread32(pht->caddr + PHN_IRQCTL); /* PCI posting */
retval = request_irq(pdev->irq, phantom_isr,
IRQF_SHARED | IRQF_DISABLED, "phantom", pht);
if (retval) {
Expand Down Expand Up @@ -347,6 +354,7 @@ static void __devexit phantom_remove(struct pci_dev *pdev)
cdev_del(&pht->cdev);

iowrite32(0, pht->caddr + PHN_IRQCTL);
ioread32(pht->caddr + PHN_IRQCTL); /* PCI posting */
free_irq(pdev->irq, pht);

pci_iounmap(pdev, pht->oaddr);
Expand All @@ -368,6 +376,7 @@ static int phantom_suspend(struct pci_dev *pdev, pm_message_t state)
struct phantom_device *dev = pci_get_drvdata(pdev);

iowrite32(0, dev->caddr + PHN_IRQCTL);
ioread32(dev->caddr + PHN_IRQCTL); /* PCI posting */

return 0;
}
Expand Down

0 comments on commit d7150cd

Please sign in to comment.