Skip to content

Commit ec622ab

Browse files
Jiri Slabydavem330
authored andcommitted
ATM: iphase, remove sleep-inside-atomic
Stanse found that ia_init_one locks a spinlock and inside of that it calls ia_start which calls: * request_irq * tx_init which does kmalloc(GFP_KERNEL) Both of them can thus sleep and result in a deadlock. I don't see a reason to have a per-device spinlock there which is used only there and inited right before the lock location. So remove it completely. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Chas Williams <chas@cmf.nrl.navy.mil> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5518b29 commit ec622ab

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

drivers/atm/iphase.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3156,7 +3156,6 @@ static int __devinit ia_init_one(struct pci_dev *pdev,
31563156
{
31573157
struct atm_dev *dev;
31583158
IADEV *iadev;
3159-
unsigned long flags;
31603159
int ret;
31613160

31623161
iadev = kzalloc(sizeof(*iadev), GFP_KERNEL);
@@ -3188,19 +3187,14 @@ static int __devinit ia_init_one(struct pci_dev *pdev,
31883187
ia_dev[iadev_count] = iadev;
31893188
_ia_dev[iadev_count] = dev;
31903189
iadev_count++;
3191-
spin_lock_init(&iadev->misc_lock);
3192-
/* First fixes first. I don't want to think about this now. */
3193-
spin_lock_irqsave(&iadev->misc_lock, flags);
31943190
if (ia_init(dev) || ia_start(dev)) {
31953191
IF_INIT(printk("IA register failed!\n");)
31963192
iadev_count--;
31973193
ia_dev[iadev_count] = NULL;
31983194
_ia_dev[iadev_count] = NULL;
3199-
spin_unlock_irqrestore(&iadev->misc_lock, flags);
32003195
ret = -EINVAL;
32013196
goto err_out_deregister_dev;
32023197
}
3203-
spin_unlock_irqrestore(&iadev->misc_lock, flags);
32043198
IF_EVENT(printk("iadev_count = %d\n", iadev_count);)
32053199

32063200
iadev->next_board = ia_boards;

drivers/atm/iphase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ typedef struct iadev_t {
10221022
struct dle_q rx_dle_q;
10231023
struct free_desc_q *rx_free_desc_qhead;
10241024
struct sk_buff_head rx_dma_q;
1025-
spinlock_t rx_lock, misc_lock;
1025+
spinlock_t rx_lock;
10261026
struct atm_vcc **rx_open; /* list of all open VCs */
10271027
u16 num_rx_desc, rx_buf_sz, rxing;
10281028
u32 rx_pkt_ram, rx_tmp_cnt;

0 commit comments

Comments
 (0)