Skip to content

Commit 4e0b72f

Browse files
bovigregkh
authored andcommitted
uio: uio_pci_generic: Remove useless spin_lock
The spin_lock in uio_pci_generic.c is only used in the interrupt handler, which cannot be executed twice at the same time. That makes the lock rather pointless. This patch removes it. Cc: "Michael S. Tsirkin" <mst@redhat.com> Cc: Chris Wright <chrisw@redhat.com> Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: Anthony Foiani <anthony.foiani@gmail.com> Reported-by: Anthony Foiani <anthony.foiani@gmail.com> Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Hans J. Koch <hjk@hansjkoch.de> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent a406f75 commit 4e0b72f

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

‎drivers/uio/uio_pci_generic.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include <linux/pci.h>
2525
#include <linux/slab.h>
2626
#include <linux/uio_driver.h>
27-
#include <linux/spinlock.h>
2827

2928
#define DRIVER_VERSION "0.01.0"
3029
#define DRIVER_AUTHOR "Michael S. Tsirkin <mst@redhat.com>"
@@ -33,7 +32,6 @@
3332
struct uio_pci_generic_dev {
3433
struct uio_info info;
3534
struct pci_dev *pdev;
36-
spinlock_t lock; /* guards command register accesses */
3735
};
3836

3937
static inline struct uio_pci_generic_dev *
@@ -57,7 +55,6 @@ static irqreturn_t irqhandler(int irq, struct uio_info *info)
5755
BUILD_BUG_ON(PCI_COMMAND % 4);
5856
BUILD_BUG_ON(PCI_COMMAND + 2 != PCI_STATUS);
5957

60-
spin_lock_irq(&gdev->lock);
6158
pci_block_user_cfg_access(pdev);
6259

6360
/* Read both command and status registers in a single 32-bit operation.
@@ -83,7 +80,6 @@ static irqreturn_t irqhandler(int irq, struct uio_info *info)
8380
done:
8481

8582
pci_unblock_user_cfg_access(pdev);
86-
spin_unlock_irq(&gdev->lock);
8783
return ret;
8884
}
8985

@@ -158,7 +154,6 @@ static int __devinit probe(struct pci_dev *pdev,
158154
gdev->info.irq_flags = IRQF_SHARED;
159155
gdev->info.handler = irqhandler;
160156
gdev->pdev = pdev;
161-
spin_lock_init(&gdev->lock);
162157

163158
if (uio_register_device(&pdev->dev, &gdev->info))
164159
goto err_register;

0 commit comments

Comments
 (0)