linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Cc: cw00.choi@samsung.com, myungjoo.ham@samsung.com,
	sameo@linux.intel.com, patches@opensource.wolfsonmicro.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] extcon: arizona: Fix reset of HPDET after race with removal
Date: Sat, 26 Oct 2013 09:29:07 -0700	[thread overview]
Message-ID: <20131026162907.GC7698@lee--X1> (raw)
In-Reply-To: <1382796618-19921-2-git-send-email-ckeepax@opensource.wolfsonmicro.com>

On Sat, 26 Oct 2013, Charles Keepax wrote:

> We need to make sure we reset back to our starting state, especially
> making sure that we have disabled poll in the register cache.
> 
> Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
> ---
>  drivers/extcon/extcon-arizona.c |   10 +++++++++-
>  1 files changed, 9 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
> index 92eb486..3ce7b49 100644
> --- a/drivers/extcon/extcon-arizona.c
> +++ b/drivers/extcon/extcon-arizona.c
> @@ -572,6 +572,14 @@ static irqreturn_t arizona_hpdet_irq(int irq, void *data)
>  		goto out;
>  	} else if (!ret) {
>  		dev_dbg(arizona->dev, "Ignoring HPDET for removed cable\n");
> +
> +		/* Reset back to starting range */
> +		regmap_update_bits(arizona->regmap,
> +				   ARIZONA_HEADPHONE_DETECT_1,
> +				   ARIZONA_HP_IMPEDANCE_RANGE_MASK |
> +				   ARIZONA_HP_POLL,
> +				   0);
> +
>  		goto done;
>  	}
>  
> @@ -607,9 +615,9 @@ static irqreturn_t arizona_hpdet_irq(int irq, void *data)
>  		dev_err(arizona->dev, "Failed to report HP/line: %d\n",
>  			ret);
>  
> +done:
>  	arizona_extcon_do_magic(info, 0);
>  
> -done:
>  	if (id_gpio)
>  		gpio_set_value_cansleep(id_gpio, 0);
>  

What happens if we don't update the bits and we still do magic in the
new error path? Does that adversely affect any later 'goto done's?

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2013-10-26 16:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-26 14:10 [PATCH 1/2] extcon: arizona: Add defines for microphone detection levels Charles Keepax
2013-10-26 14:10 ` [PATCH 2/2] extcon: arizona: Fix reset of HPDET after race with removal Charles Keepax
2013-10-26 16:29   ` Lee Jones [this message]
2013-10-26 17:27     ` Charles Keepax
2013-10-26 16:23 ` [PATCH 1/2] extcon: arizona: Add defines for microphone detection levels Lee Jones

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=20131026162907.GC7698@lee--X1 \
    --to=lee.jones@linaro.org \
    --cc=ckeepax@opensource.wolfsonmicro.com \
    --cc=cw00.choi@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=sameo@linux.intel.com \
    /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 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).