linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] First set of Counter fixes for 6.0
@ 2022-09-22 11:20 William Breathitt Gray
  2022-09-22 11:20 ` [PATCH 1/2] counter: 104-quad-8: Fix skipped IRQ lines during events configuration William Breathitt Gray
  2022-09-22 11:20 ` [PATCH 2/2] counter: Realign counter_comp comment block to 80 characters William Breathitt Gray
  0 siblings, 2 replies; 5+ messages in thread
From: William Breathitt Gray @ 2022-09-22 11:20 UTC (permalink / raw)
  To: gregkh; +Cc: linux-iio, William Breathitt Gray

This is the same as the earlier pull request [0] but as a patch series
here instead.

There's nothing particularly special here: just a patch fixing a bug in
104-quad-8, and another realigning some comment blocks.

[0] https://lore.kernel.org/r/YyNWADWgfl1sL10S@ishi/

William Breathitt Gray (2):
  counter: 104-quad-8: Fix skipped IRQ lines during events configuration
  counter: Realign counter_comp comment block to 80 characters

 drivers/counter/104-quad-8.c |  6 +++---
 include/linux/counter.h      | 40 ++++++++++++++++++------------------
 2 files changed, 23 insertions(+), 23 deletions(-)


base-commit: 568035b01cfb107af8d2e4bd2fb9aea22cf5b868
-- 
2.37.3


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] counter: 104-quad-8: Fix skipped IRQ lines during events configuration
  2022-09-22 11:20 [PATCH 0/2] First set of Counter fixes for 6.0 William Breathitt Gray
@ 2022-09-22 11:20 ` William Breathitt Gray
  2022-09-22 11:27   ` Greg KH
  2022-09-22 11:20 ` [PATCH 2/2] counter: Realign counter_comp comment block to 80 characters William Breathitt Gray
  1 sibling, 1 reply; 5+ messages in thread
From: William Breathitt Gray @ 2022-09-22 11:20 UTC (permalink / raw)
  To: gregkh; +Cc: linux-iio, William Breathitt Gray

IRQ trigger configuration is skipped if it has already been set before;
however, the IRQ line still needs to be OR'd to irq_enabled because
irq_enabled is reset for every events_configure call. This patch moves
the irq_enabled OR operation update to before the irq_trigger check so
that IRQ line enablement is not skipped.

Fixes: c95cc0d95702 ("counter: 104-quad-8: Fix persistent enabled events bug")
Link: https://lore.kernel.org/r/20220815122301.2750-1-william.gray@linaro.org/
Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
---
 drivers/counter/104-quad-8.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/counter/104-quad-8.c b/drivers/counter/104-quad-8.c
index 62c2b7ac4339..4407203e0c9b 100644
--- a/drivers/counter/104-quad-8.c
+++ b/drivers/counter/104-quad-8.c
@@ -449,6 +449,9 @@ static int quad8_events_configure(struct counter_device *counter)
 			return -EINVAL;
 		}
 
+		/* Enable IRQ line */
+		irq_enabled |= BIT(event_node->channel);
+
 		/* Skip configuration if it is the same as previously set */
 		if (priv->irq_trigger[event_node->channel] == next_irq_trigger)
 			continue;
@@ -462,9 +465,6 @@ static int quad8_events_configure(struct counter_device *counter)
 			  priv->irq_trigger[event_node->channel] << 3;
 		iowrite8(QUAD8_CTR_IOR | ior_cfg,
 			 &priv->reg->channel[event_node->channel].control);
-
-		/* Enable IRQ line */
-		irq_enabled |= BIT(event_node->channel);
 	}
 
 	iowrite8(irq_enabled, &priv->reg->index_interrupt);
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] counter: Realign counter_comp comment block to 80 characters
  2022-09-22 11:20 [PATCH 0/2] First set of Counter fixes for 6.0 William Breathitt Gray
  2022-09-22 11:20 ` [PATCH 1/2] counter: 104-quad-8: Fix skipped IRQ lines during events configuration William Breathitt Gray
@ 2022-09-22 11:20 ` William Breathitt Gray
  2022-09-22 11:28   ` Greg KH
  1 sibling, 1 reply; 5+ messages in thread
From: William Breathitt Gray @ 2022-09-22 11:20 UTC (permalink / raw)
  To: gregkh; +Cc: linux-iio, William Breathitt Gray, Yanteng Si

The member documentation comment lines for struct counter_comp extend
past the 80-characters column boundary due to extra identation at the
start of each section. This patch realigns the comment block within the
80-characters boundary by removing these superfluous indents.

Reviewed-by: Yanteng Si <siyanteng@loongson.cn>
Link: https://lore.kernel.org/r/20220902120839.4260-1-william.gray@linaro.org/
Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
---
 include/linux/counter.h | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/include/linux/counter.h b/include/linux/counter.h
index 1fe17f5adb09..a81234bc8ea8 100644
--- a/include/linux/counter.h
+++ b/include/linux/counter.h
@@ -38,64 +38,64 @@ enum counter_comp_type {
  * @type:		Counter component data type
  * @name:		device-specific component name
  * @priv:		component-relevant data
- * @action_read:		Synapse action mode read callback. The read value of the
+ * @action_read:	Synapse action mode read callback. The read value of the
  *			respective Synapse action mode should be passed back via
  *			the action parameter.
- * @device_u8_read:		Device u8 component read callback. The read value of the
+ * @device_u8_read:	Device u8 component read callback. The read value of the
  *			respective Device u8 component should be passed back via
  *			the val parameter.
- * @count_u8_read:		Count u8 component read callback. The read value of the
+ * @count_u8_read:	Count u8 component read callback. The read value of the
  *			respective Count u8 component should be passed back via
  *			the val parameter.
- * @signal_u8_read:		Signal u8 component read callback. The read value of the
+ * @signal_u8_read:	Signal u8 component read callback. The read value of the
  *			respective Signal u8 component should be passed back via
  *			the val parameter.
- * @device_u32_read:		Device u32 component read callback. The read value of
+ * @device_u32_read:	Device u32 component read callback. The read value of
  *			the respective Device u32 component should be passed
  *			back via the val parameter.
- * @count_u32_read:		Count u32 component read callback. The read value of the
+ * @count_u32_read:	Count u32 component read callback. The read value of the
  *			respective Count u32 component should be passed back via
  *			the val parameter.
- * @signal_u32_read:		Signal u32 component read callback. The read value of
+ * @signal_u32_read:	Signal u32 component read callback. The read value of
  *			the respective Signal u32 component should be passed
  *			back via the val parameter.
- * @device_u64_read:		Device u64 component read callback. The read value of
+ * @device_u64_read:	Device u64 component read callback. The read value of
  *			the respective Device u64 component should be passed
  *			back via the val parameter.
- * @count_u64_read:		Count u64 component read callback. The read value of the
+ * @count_u64_read:	Count u64 component read callback. The read value of the
  *			respective Count u64 component should be passed back via
  *			the val parameter.
- * @signal_u64_read:		Signal u64 component read callback. The read value of
+ * @signal_u64_read:	Signal u64 component read callback. The read value of
  *			the respective Signal u64 component should be passed
  *			back via the val parameter.
- * @action_write:		Synapse action mode write callback. The write value of
+ * @action_write:	Synapse action mode write callback. The write value of
  *			the respective Synapse action mode is passed via the
  *			action parameter.
- * @device_u8_write:		Device u8 component write callback. The write value of
+ * @device_u8_write:	Device u8 component write callback. The write value of
  *			the respective Device u8 component is passed via the val
  *			parameter.
- * @count_u8_write:		Count u8 component write callback. The write value of
+ * @count_u8_write:	Count u8 component write callback. The write value of
  *			the respective Count u8 component is passed via the val
  *			parameter.
- * @signal_u8_write:		Signal u8 component write callback. The write value of
+ * @signal_u8_write:	Signal u8 component write callback. The write value of
  *			the respective Signal u8 component is passed via the val
  *			parameter.
- * @device_u32_write:		Device u32 component write callback. The write value of
+ * @device_u32_write:	Device u32 component write callback. The write value of
  *			the respective Device u32 component is passed via the
  *			val parameter.
- * @count_u32_write:		Count u32 component write callback. The write value of
+ * @count_u32_write:	Count u32 component write callback. The write value of
  *			the respective Count u32 component is passed via the val
  *			parameter.
- * @signal_u32_write:		Signal u32 component write callback. The write value of
+ * @signal_u32_write:	Signal u32 component write callback. The write value of
  *			the respective Signal u32 component is passed via the
  *			val parameter.
- * @device_u64_write:		Device u64 component write callback. The write value of
+ * @device_u64_write:	Device u64 component write callback. The write value of
  *			the respective Device u64 component is passed via the
  *			val parameter.
- * @count_u64_write:		Count u64 component write callback. The write value of
+ * @count_u64_write:	Count u64 component write callback. The write value of
  *			the respective Count u64 component is passed via the val
  *			parameter.
- * @signal_u64_write:		Signal u64 component write callback. The write value of
+ * @signal_u64_write:	Signal u64 component write callback. The write value of
  *			the respective Signal u64 component is passed via the
  *			val parameter.
  */
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] counter: 104-quad-8: Fix skipped IRQ lines during events configuration
  2022-09-22 11:20 ` [PATCH 1/2] counter: 104-quad-8: Fix skipped IRQ lines during events configuration William Breathitt Gray
@ 2022-09-22 11:27   ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2022-09-22 11:27 UTC (permalink / raw)
  To: William Breathitt Gray; +Cc: linux-iio

On Thu, Sep 22, 2022 at 07:20:56AM -0400, William Breathitt Gray wrote:
> IRQ trigger configuration is skipped if it has already been set before;
> however, the IRQ line still needs to be OR'd to irq_enabled because
> irq_enabled is reset for every events_configure call. This patch moves
> the irq_enabled OR operation update to before the irq_trigger check so
> that IRQ line enablement is not skipped.
> 
> Fixes: c95cc0d95702 ("counter: 104-quad-8: Fix persistent enabled events bug")
> Link: https://lore.kernel.org/r/20220815122301.2750-1-william.gray@linaro.org/
> Signed-off-by: William Breathitt Gray <william.gray@linaro.org>

This should have also cc: stable.  I'll add that when I apply it,
thanks.

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] counter: Realign counter_comp comment block to 80 characters
  2022-09-22 11:20 ` [PATCH 2/2] counter: Realign counter_comp comment block to 80 characters William Breathitt Gray
@ 2022-09-22 11:28   ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2022-09-22 11:28 UTC (permalink / raw)
  To: William Breathitt Gray; +Cc: linux-iio, Yanteng Si

On Thu, Sep 22, 2022 at 07:20:57AM -0400, William Breathitt Gray wrote:
> The member documentation comment lines for struct counter_comp extend
> past the 80-characters column boundary due to extra identation at the
> start of each section. This patch realigns the comment block within the
> 80-characters boundary by removing these superfluous indents.
> 
> Reviewed-by: Yanteng Si <siyanteng@loongson.cn>
> Link: https://lore.kernel.org/r/20220902120839.4260-1-william.gray@linaro.org/
> Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
> ---
>  include/linux/counter.h | 40 ++++++++++++++++++++--------------------
>  1 file changed, 20 insertions(+), 20 deletions(-)

This isn't needed for 6.0-final, I'll queue it up in my -next branch for
6.1-rc1.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-09-22 11:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-22 11:20 [PATCH 0/2] First set of Counter fixes for 6.0 William Breathitt Gray
2022-09-22 11:20 ` [PATCH 1/2] counter: 104-quad-8: Fix skipped IRQ lines during events configuration William Breathitt Gray
2022-09-22 11:27   ` Greg KH
2022-09-22 11:20 ` [PATCH 2/2] counter: Realign counter_comp comment block to 80 characters William Breathitt Gray
2022-09-22 11:28   ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).