Skip to content

Commit 3876ec9

Browse files
committed
genirq: Provide compat handling for bus_lock/bus_sync_unlock
Wrap the old chip functions for bus_lock/bus_sync_unlock until the migration is complete and the old chip functions are removed. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> LKML-Reference: <20100927121841.842536121@linutronix.de> Reviewed-by: H. Peter Anvin <hpa@zytor.com> Reviewed-by: Ingo Molnar <mingo@elte.hu>
1 parent a77c463 commit 3876ec9

3 files changed

Lines changed: 35 additions & 19 deletions

File tree

‎kernel/irq/chip.c‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,17 @@ static void default_shutdown(unsigned int irq)
324324
desc->status |= IRQ_MASKED;
325325
}
326326

327+
/* Temporary migration helpers */
328+
static void compat_bus_lock(struct irq_data *data)
329+
{
330+
data->chip->bus_lock(data->irq);
331+
}
332+
333+
static void compat_bus_sync_unlock(struct irq_data *data)
334+
{
335+
data->chip->bus_sync_unlock(data->irq);
336+
}
337+
327338
/*
328339
* Fixup enable/disable function pointers
329340
*/
@@ -346,6 +357,11 @@ void irq_chip_set_defaults(struct irq_chip *chip)
346357
chip->disable : default_shutdown;
347358
if (!chip->end)
348359
chip->end = dummy_irq_chip.end;
360+
361+
if (chip->bus_lock)
362+
chip->irq_bus_lock = compat_bus_lock;
363+
if (chip->bus_sync_unlock)
364+
chip->irq_bus_sync_unlock = compat_bus_sync_unlock;
349365
}
350366

351367
static inline void mask_ack_irq(struct irq_desc *desc, int irq)
@@ -687,7 +703,7 @@ __set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
687703
desc->irq_data.chip = &dummy_irq_chip;
688704
}
689705

690-
chip_bus_lock(irq, desc);
706+
chip_bus_lock(desc);
691707
raw_spin_lock_irqsave(&desc->lock, flags);
692708

693709
/* Uninstall? */
@@ -707,7 +723,7 @@ __set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
707723
desc->irq_data.chip->startup(irq);
708724
}
709725
raw_spin_unlock_irqrestore(&desc->lock, flags);
710-
chip_bus_sync_unlock(irq, desc);
726+
chip_bus_sync_unlock(desc);
711727
}
712728
EXPORT_SYMBOL_GPL(__set_irq_handler);
713729

‎kernel/irq/internals.h‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@ extern int irq_select_affinity_usr(unsigned int irq);
4343
extern void irq_set_thread_affinity(struct irq_desc *desc);
4444

4545
/* Inline functions for support of irq chips on slow busses */
46-
static inline void chip_bus_lock(unsigned int irq, struct irq_desc *desc)
46+
static inline void chip_bus_lock(struct irq_desc *desc)
4747
{
48-
if (unlikely(desc->irq_data.chip->bus_lock))
49-
desc->irq_data.chip->bus_lock(irq);
48+
if (unlikely(desc->irq_data.chip->irq_bus_lock))
49+
desc->irq_data.chip->irq_bus_lock(&desc->irq_data);
5050
}
5151

52-
static inline void chip_bus_sync_unlock(unsigned int irq, struct irq_desc *desc)
52+
static inline void chip_bus_sync_unlock(struct irq_desc *desc)
5353
{
54-
if (unlikely(desc->irq_data.chip->bus_sync_unlock))
55-
desc->irq_data.chip->bus_sync_unlock(irq);
54+
if (unlikely(desc->irq_data.chip->irq_bus_sync_unlock))
55+
desc->irq_data.chip->irq_bus_sync_unlock(&desc->irq_data);
5656
}
5757

5858
/*

‎kernel/irq/manage.c‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,11 @@ void disable_irq_nosync(unsigned int irq)
246246
if (!desc)
247247
return;
248248

249-
chip_bus_lock(irq, desc);
249+
chip_bus_lock(desc);
250250
raw_spin_lock_irqsave(&desc->lock, flags);
251251
__disable_irq(desc, irq, false);
252252
raw_spin_unlock_irqrestore(&desc->lock, flags);
253-
chip_bus_sync_unlock(irq, desc);
253+
chip_bus_sync_unlock(desc);
254254
}
255255
EXPORT_SYMBOL(disable_irq_nosync);
256256

@@ -323,11 +323,11 @@ void enable_irq(unsigned int irq)
323323
if (!desc)
324324
return;
325325

326-
chip_bus_lock(irq, desc);
326+
chip_bus_lock(desc);
327327
raw_spin_lock_irqsave(&desc->lock, flags);
328328
__enable_irq(desc, irq, false);
329329
raw_spin_unlock_irqrestore(&desc->lock, flags);
330-
chip_bus_sync_unlock(irq, desc);
330+
chip_bus_sync_unlock(desc);
331331
}
332332
EXPORT_SYMBOL(enable_irq);
333333

@@ -507,7 +507,7 @@ static int irq_wait_for_interrupt(struct irqaction *action)
507507
static void irq_finalize_oneshot(unsigned int irq, struct irq_desc *desc)
508508
{
509509
again:
510-
chip_bus_lock(irq, desc);
510+
chip_bus_lock(desc);
511511
raw_spin_lock_irq(&desc->lock);
512512

513513
/*
@@ -521,7 +521,7 @@ static void irq_finalize_oneshot(unsigned int irq, struct irq_desc *desc)
521521
*/
522522
if (unlikely(desc->status & IRQ_INPROGRESS)) {
523523
raw_spin_unlock_irq(&desc->lock);
524-
chip_bus_sync_unlock(irq, desc);
524+
chip_bus_sync_unlock(desc);
525525
cpu_relax();
526526
goto again;
527527
}
@@ -531,7 +531,7 @@ static void irq_finalize_oneshot(unsigned int irq, struct irq_desc *desc)
531531
desc->irq_data.chip->unmask(irq);
532532
}
533533
raw_spin_unlock_irq(&desc->lock);
534-
chip_bus_sync_unlock(irq, desc);
534+
chip_bus_sync_unlock(desc);
535535
}
536536

537537
#ifdef CONFIG_SMP
@@ -997,9 +997,9 @@ void free_irq(unsigned int irq, void *dev_id)
997997
if (!desc)
998998
return;
999999

1000-
chip_bus_lock(irq, desc);
1000+
chip_bus_lock(desc);
10011001
kfree(__free_irq(irq, dev_id));
1002-
chip_bus_sync_unlock(irq, desc);
1002+
chip_bus_sync_unlock(desc);
10031003
}
10041004
EXPORT_SYMBOL(free_irq);
10051005

@@ -1086,9 +1086,9 @@ int request_threaded_irq(unsigned int irq, irq_handler_t handler,
10861086
action->name = devname;
10871087
action->dev_id = dev_id;
10881088

1089-
chip_bus_lock(irq, desc);
1089+
chip_bus_lock(desc);
10901090
retval = __setup_irq(irq, desc, action);
1091-
chip_bus_sync_unlock(irq, desc);
1091+
chip_bus_sync_unlock(desc);
10921092

10931093
if (retval)
10941094
kfree(action);

0 commit comments

Comments
 (0)