Skip to content

Commit 69790ba

Browse files
committed
genirq: Introduce IRQD_CAN_RESERVE flag
Add a new flag to mark interrupts which can use reservation mode. This is going to be used in subsequent patches to disable reservation mode for a certain class of MSI devices. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Alexandru Chirvasitu <achirvasub@gmail.com> Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Dou Liyang <douly.fnst@cn.fujitsu.com> Cc: Pavel Machek <pavel@ucw.cz> Cc: Maciej W. Rozycki <macro@linux-mips.org> Cc: Mikael Pettersson <mikpelinux@gmail.com> Cc: Josh Poulson <jopoulso@microsoft.com> Cc: Mihai Costache <v-micos@microsoft.com> Cc: Stephen Hemminger <sthemmin@microsoft.com> Cc: Marc Zyngier <marc.zyngier@arm.com> Cc: linux-pci@vger.kernel.org Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Dexuan Cui <decui@microsoft.com> Cc: Simon Xiao <sixiao@microsoft.com> Cc: Saeed Mahameed <saeedm@mellanox.com> Cc: Jork Loeser <Jork.Loeser@microsoft.com> Cc: Bjorn Helgaas <bhelgaas@google.com> Cc: devel@linuxdriverproject.org Cc: KY Srinivasan <kys@microsoft.com> Cc: Alan Cox <alan@linux.intel.com> Cc: Sakari Ailus <sakari.ailus@intel.com>, Cc: linux-media@vger.kernel.org
1 parent da5dd9e commit 69790ba

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

include/linux/irq.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ struct irq_data {
212212
* mask. Applies only to affinity managed irqs.
213213
* IRQD_SINGLE_TARGET - IRQ allows only a single affinity target
214214
* IRQD_DEFAULT_TRIGGER_SET - Expected trigger already been set
215+
* IRQD_CAN_RESERVE - Can use reservation mode
215216
*/
216217
enum {
217218
IRQD_TRIGGER_MASK = 0xf,
@@ -233,6 +234,7 @@ enum {
233234
IRQD_MANAGED_SHUTDOWN = (1 << 23),
234235
IRQD_SINGLE_TARGET = (1 << 24),
235236
IRQD_DEFAULT_TRIGGER_SET = (1 << 25),
237+
IRQD_CAN_RESERVE = (1 << 26),
236238
};
237239

238240
#define __irqd_to_state(d) ACCESS_PRIVATE((d)->common, state_use_accessors)
@@ -377,6 +379,21 @@ static inline bool irqd_is_managed_and_shutdown(struct irq_data *d)
377379
return __irqd_to_state(d) & IRQD_MANAGED_SHUTDOWN;
378380
}
379381

382+
static inline void irqd_set_can_reserve(struct irq_data *d)
383+
{
384+
__irqd_to_state(d) |= IRQD_CAN_RESERVE;
385+
}
386+
387+
static inline void irqd_clr_can_reserve(struct irq_data *d)
388+
{
389+
__irqd_to_state(d) &= ~IRQD_CAN_RESERVE;
390+
}
391+
392+
static inline bool irqd_can_reserve(struct irq_data *d)
393+
{
394+
return __irqd_to_state(d) & IRQD_CAN_RESERVE;
395+
}
396+
380397
#undef __irqd_to_state
381398

382399
static inline irq_hw_number_t irqd_to_hwirq(struct irq_data *d)

kernel/irq/debugfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ static const struct irq_bit_descr irqdata_states[] = {
113113
BIT_MASK_DESCR(IRQD_SETAFFINITY_PENDING),
114114
BIT_MASK_DESCR(IRQD_AFFINITY_MANAGED),
115115
BIT_MASK_DESCR(IRQD_MANAGED_SHUTDOWN),
116+
BIT_MASK_DESCR(IRQD_CAN_RESERVE),
116117

117118
BIT_MASK_DESCR(IRQD_FORWARDED_TO_VCPU),
118119

0 commit comments

Comments
 (0)