Commit d8aef84e authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'counter-fixes-for-6.19' of...

Merge tag 'counter-fixes-for-6.19' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/wbg/counter into char-misc-linus

William writes:

Counter fixes for 6.19

A fix for interrupt-cnt dropping the IRQF_NO_THREAD configuration to
allow the IRQ handler to correctly acquire a spinlock_t lock. A fix for
104-quad-8 correcting quad8_irq_handler() to return irqreturn_t enum
values rather than negative errno codes on error.

* tag 'counter-fixes-for-6.19' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/wbg/counter:
  counter: 104-quad-8: Fix incorrect return value in IRQ handler
  counter: interrupt-cnt: Drop IRQF_NO_THREAD flag
parents 9448598b 9517d76d
Loading
Loading
Loading
Loading
+14 −6
Original line number Diff line number Diff line
@@ -1192,6 +1192,7 @@ static irqreturn_t quad8_irq_handler(int irq, void *private)
{
	struct counter_device *counter = private;
	struct quad8 *const priv = counter_priv(counter);
	struct device *dev = counter->parent;
	unsigned int status;
	unsigned long irq_status;
	unsigned long channel;
@@ -1200,8 +1201,11 @@ static irqreturn_t quad8_irq_handler(int irq, void *private)
	int ret;

	ret = regmap_read(priv->map, QUAD8_INTERRUPT_STATUS, &status);
	if (ret)
		return ret;
	if (ret) {
		dev_WARN_ONCE(dev, true,
			"Attempt to read Interrupt Status Register failed: %d\n", ret);
		return IRQ_NONE;
	}
	if (!status)
		return IRQ_NONE;

@@ -1223,7 +1227,8 @@ static irqreturn_t quad8_irq_handler(int irq, void *private)
				break;
		default:
			/* should never reach this path */
			WARN_ONCE(true, "invalid interrupt trigger function %u configured for channel %lu\n",
			dev_WARN_ONCE(dev, true,
				"invalid interrupt trigger function %u configured for channel %lu\n",
				flg_pins, channel);
			continue;
		}
@@ -1232,8 +1237,11 @@ static irqreturn_t quad8_irq_handler(int irq, void *private)
	}

	ret = regmap_write(priv->map, QUAD8_CHANNEL_OPERATION, CLEAR_PENDING_INTERRUPTS);
	if (ret)
		return ret;
	if (ret) {
		dev_WARN_ONCE(dev, true,
			"Attempt to clear pending interrupts by writing to Channel Operation Register failed: %d\n", ret);
		return IRQ_HANDLED;
	}

	return IRQ_HANDLED;
}
+1 −2
Original line number Diff line number Diff line
@@ -229,8 +229,7 @@ static int interrupt_cnt_probe(struct platform_device *pdev)

	irq_set_status_flags(priv->irq, IRQ_NOAUTOEN);
	ret = devm_request_irq(dev, priv->irq, interrupt_cnt_isr,
			       IRQF_TRIGGER_RISING | IRQF_NO_THREAD,
			       dev_name(dev), counter);
			       IRQF_TRIGGER_RISING, dev_name(dev), counter);
	if (ret)
		return ret;