All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neil Armstrong <narmstrong@baylibre.com>
To: Heiner Kallweit <hkallweit1@gmail.com>,
	Mauro Carvalho Chehab <mchehab@s-opensource.com>,
	Sean Young <sean@mess.org>, Kevin Hilman <khilman@baylibre.com>
Cc: linux-amlogic@lists.infradead.org, linux-media@vger.kernel.org
Subject: Re: [PATCH 4/5] media: rc: meson-ir: use readl_relaxed in the interrupt handler
Date: Tue, 11 Apr 2017 09:15:38 +0200	[thread overview]
Message-ID: <21c29ede-771c-bf91-6079-5e2f44b84457@baylibre.com> (raw)
In-Reply-To: <3add55c4-1e29-f070-6fef-7f92b2595874@gmail.com>

On 04/11/2017 08:05 AM, Heiner Kallweit wrote:
> We don't need the memory barriers here and an interrupt handler should
> be as fast as possible. Therefore switch to readl_relaxed.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
>  drivers/media/rc/meson-ir.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/rc/meson-ir.c b/drivers/media/rc/meson-ir.c
> index d56ef27e..246da2db 100644
> --- a/drivers/media/rc/meson-ir.c
> +++ b/drivers/media/rc/meson-ir.c
> @@ -83,16 +83,17 @@ static void meson_ir_set_mask(struct meson_ir *ir, unsigned int reg,
>  static irqreturn_t meson_ir_irq(int irqno, void *dev_id)
>  {
>  	struct meson_ir *ir = dev_id;
> -	u32 duration;
> +	u32 duration, status;
>  	DEFINE_IR_RAW_EVENT(rawir);
>  
>  	spin_lock(&ir->lock);
>  
> -	duration = readl(ir->reg + IR_DEC_REG1);
> +	duration = readl_relaxed(ir->reg + IR_DEC_REG1);
>  	duration = FIELD_GET(REG1_TIME_IV_MASK, duration);
>  	rawir.duration = US_TO_NS(duration * MESON_TRATE);
>  
> -	rawir.pulse = !!(readl(ir->reg + IR_DEC_STATUS) & STATUS_IR_DEC_IN);
> +	status = readl_relaxed(ir->reg + IR_DEC_STATUS);
> +	rawir.pulse = !!(status & STATUS_IR_DEC_IN);
>  
>  	ir_raw_event_store_with_filter(ir->rc, &rawir);
>  	ir_raw_event_handle(ir->rc);
> 

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>

WARNING: multiple messages have this Message-ID (diff)
From: narmstrong@baylibre.com (Neil Armstrong)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH 4/5] media: rc: meson-ir: use readl_relaxed in the interrupt handler
Date: Tue, 11 Apr 2017 09:15:38 +0200	[thread overview]
Message-ID: <21c29ede-771c-bf91-6079-5e2f44b84457@baylibre.com> (raw)
In-Reply-To: <3add55c4-1e29-f070-6fef-7f92b2595874@gmail.com>

On 04/11/2017 08:05 AM, Heiner Kallweit wrote:
> We don't need the memory barriers here and an interrupt handler should
> be as fast as possible. Therefore switch to readl_relaxed.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
>  drivers/media/rc/meson-ir.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/rc/meson-ir.c b/drivers/media/rc/meson-ir.c
> index d56ef27e..246da2db 100644
> --- a/drivers/media/rc/meson-ir.c
> +++ b/drivers/media/rc/meson-ir.c
> @@ -83,16 +83,17 @@ static void meson_ir_set_mask(struct meson_ir *ir, unsigned int reg,
>  static irqreturn_t meson_ir_irq(int irqno, void *dev_id)
>  {
>  	struct meson_ir *ir = dev_id;
> -	u32 duration;
> +	u32 duration, status;
>  	DEFINE_IR_RAW_EVENT(rawir);
>  
>  	spin_lock(&ir->lock);
>  
> -	duration = readl(ir->reg + IR_DEC_REG1);
> +	duration = readl_relaxed(ir->reg + IR_DEC_REG1);
>  	duration = FIELD_GET(REG1_TIME_IV_MASK, duration);
>  	rawir.duration = US_TO_NS(duration * MESON_TRATE);
>  
> -	rawir.pulse = !!(readl(ir->reg + IR_DEC_STATUS) & STATUS_IR_DEC_IN);
> +	status = readl_relaxed(ir->reg + IR_DEC_STATUS);
> +	rawir.pulse = !!(status & STATUS_IR_DEC_IN);
>  
>  	ir_raw_event_store_with_filter(ir->rc, &rawir);
>  	ir_raw_event_handle(ir->rc);
> 

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>

  reply	other threads:[~2017-04-11  7:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-11  5:51 [PATCH 0/5] media: rc: meson-ir: series with smaller improvements Heiner Kallweit
2017-04-11  5:51 ` Heiner Kallweit
2017-04-11  5:53 ` [PATCH 1/5] media: rc: meson-ir: remove irq from struct meson_ir Heiner Kallweit
2017-04-11  5:53   ` Heiner Kallweit
2017-04-11  9:50   ` Neil Armstrong
2017-04-11  9:50     ` Neil Armstrong
2017-04-11 15:26     ` Sean Young
2017-04-11 15:26       ` Sean Young
2017-04-11  6:00 ` [PATCH 2/5] media: rc: meson-ir: make use of the bitfield macros Heiner Kallweit
2017-04-11  6:00   ` Heiner Kallweit
2017-04-11  7:14   ` Neil Armstrong
2017-04-11  6:02 ` [PATCH 3/5] media: rc: meson-ir: switch to managed rc device allocation / registration Heiner Kallweit
2017-04-11  6:02   ` Heiner Kallweit
2017-04-11  7:15   ` Neil Armstrong
2017-04-11  7:15     ` Neil Armstrong
2017-04-11  6:05 ` [PATCH 4/5] media: rc: meson-ir: use readl_relaxed in the interrupt handler Heiner Kallweit
2017-04-11  6:05   ` Heiner Kallweit
2017-04-11  7:15   ` Neil Armstrong [this message]
2017-04-11  7:15     ` Neil Armstrong
2017-04-11  6:07 ` [PATCH 5/5] media: rc: meson-ir: change irq name to to of node name Heiner Kallweit
2017-04-11  6:07   ` Heiner Kallweit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=21c29ede-771c-bf91-6079-5e2f44b84457@baylibre.com \
    --to=narmstrong@baylibre.com \
    --cc=hkallweit1@gmail.com \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@s-opensource.com \
    --cc=sean@mess.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.