summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-04-07 10:08:28 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-04-07 10:08:28 +0200
commit6470a8206a10cae1f18a3e5a95dde2b364a06e10 (patch)
treec0289bba29f70d3292b3cb07555a9be0866a635f /kernel
parente91cafdf3c18b927e61eb4ee18e4865b8485f24f (diff)
parente09fe9135399807b8397798a53160e055dc6c29f (diff)
Merge tag 'iio-for-5.13b-take2' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes: 2nd set of IIO features, cleanups etc for 5.13 Trying again as a wrong fixes tag managed to beat the checking script I was running. A few of these are fixes for major rework earlier in cycle. Bulk of patches are the ad7150 pre graduation cleanup, some link fixes in maintainers and set using the new IRQF_NO_AUTOEN flag. Note includes a merge of a tag from tip to get the IRQF_NO_AUTOEN support (one patch only from Barry Song) Staging graduation * adi,ad7150 CDC - A lot of precursor patches cleaning it up first. - Includes core support for timeout event ABI where after a time a adaptive threshold jumps to fix slow tracking problems. Cleanups and minor / late breaking fixes * core - Use sysfs_emit() and sysfs_emit_at() as appropriate - Fix a bug introduced in this cycle for iio_read_channel_processed_scale() - Fix handling of getfd ioctl as IIO_IOCTL_UNHANDLED is a valid ioctl number - Tidy up some pointless type conversion in string formatting and odd indentation. * dac - Use sysfs_emit() for powerdown attribute show() functions. * docs - Fix dead links due to txt to yaml binding conversions. * treewide - Use IRQF_NO_AUTOEN * various - Typo fixes in comments. * triggers/hr-timer-trigger - Fix an overflow handing issue. * ad,ad7923 - Device managed functions in probe() * ad,ad9467 - Fix kconfig dependency issue * adi,adis16201 - Fix a wrong axis assignment that stops the driver loading. * invensense,mpu6050 - Allow use as a standalone trigger (no channels enabled) - Drop unnecessary manual assignment of indio_dev->modes - Make device function in a basic way if no interrupt wired. - Sanity check scale writes. * semtech,sx9310 - Fix access to a variable length array in DT binding. - Sanity check input before writing debounce register. * st,stm32-dfsdm - Drop __func__ from dev_dbg() and pr_debug(). * yamaha,yas530 - Include asm/unaligned.h instead of be_byteshift.h - Fix an issue with return value on an error path. * tag 'iio-for-5.13b-take2' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (76 commits) iio: inv_mpu6050: Fully validate gyro and accel scale writes iio: sx9310: Fix write_.._debounce() iio: sx9310: Fix access to variable DT array iio: adc: Kconfig: make AD9467 depend on ADI_AXI_ADC symbol iio: magnetometer: yas530: Include right header iio: magnetometer: yas530: Fix return value on error path iio:cdc:ad7150: Fix use of uninitialized ret iio: hrtimer-trigger: Fix potential integer overflow in iio_hrtimer_store_sampling_frequency iio:adc: Fix trivial typo iio:adc:ad7476: Fix remove handling iio:adc:ad_sigma_delta: Use IRQF_NO_AUTOEN rather than request and disable iio:imu:adis: Use IRQF_NO_AUTOEN instead of irq request then disable iio:chemical:scd30: Use IRQF_NO_AUTOEN to avoid irq request then disable iio:adc:sun4i-gpadc: Use new IRQF_NO_AUTOEN flag instead of request then disable iio:adc:nau7802: Use IRQF_NO_AUTOEN instead of request then disable iio:adc:exynos-adc: Use new IRQF_NO_AUTOEN flag rather than separate irq_disable() iio:adc:ad7766: Use new IRQF_NO_AUTOEN to reduce boilerplate iio: buffer: use sysfs_attr_init() on allocated attrs iio: trigger: Fix strange (ladder-type) indentation iio: trigger: Replace explicit casting and wrong specifier with proper one ...
Diffstat (limited to 'kernel')
-rw-r--r--kernel/irq/manage.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 21ea370fccda..49288e941365 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -1697,7 +1697,8 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
irqd_set(&desc->irq_data, IRQD_NO_BALANCING);
}
- if (irq_settings_can_autoenable(desc)) {
+ if (!(new->flags & IRQF_NO_AUTOEN) &&
+ irq_settings_can_autoenable(desc)) {
irq_startup(desc, IRQ_RESEND, IRQ_START_COND);
} else {
/*
@@ -2090,10 +2091,15 @@ int request_threaded_irq(unsigned int irq, irq_handler_t handler,
* which interrupt is which (messes up the interrupt freeing
* logic etc).
*
+ * Also shared interrupts do not go well with disabling auto enable.
+ * The sharing interrupt might request it while it's still disabled
+ * and then wait for interrupts forever.
+ *
* Also IRQF_COND_SUSPEND only makes sense for shared interrupts and
* it cannot be set along with IRQF_NO_SUSPEND.
*/
if (((irqflags & IRQF_SHARED) && !dev_id) ||
+ ((irqflags & IRQF_SHARED) && (irqflags & IRQF_NO_AUTOEN)) ||
(!(irqflags & IRQF_SHARED) && (irqflags & IRQF_COND_SUSPEND)) ||
((irqflags & IRQF_NO_SUSPEND) && (irqflags & IRQF_COND_SUSPEND)))
return -EINVAL;
@@ -2249,7 +2255,8 @@ int request_nmi(unsigned int irq, irq_handler_t handler,
desc = irq_to_desc(irq);
- if (!desc || irq_settings_can_autoenable(desc) ||
+ if (!desc || (irq_settings_can_autoenable(desc) &&
+ !(irqflags & IRQF_NO_AUTOEN)) ||
!irq_settings_can_request(desc) ||
WARN_ON(irq_settings_is_per_cpu_devid(desc)) ||
!irq_supports_nmi(desc))