lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-id: <5406BEC2.60801@samsung.com>
Date:	Wed, 03 Sep 2014 16:09:54 +0900
From:	Chanwoo Choi <cw00.choi@...sung.com>
To:	Jonghwa Lee <jonghwa3.lee@...sung.com>
Cc:	linux-kernel@...r.kernel.org, myungjoo.ham@...sung.com,
	r.baldyga@...sung.com
Subject: Re: [PATCH v2] extcon: max77693: Fix a bug occured at changing ADC
 debounce time.

Hi Jonghwa,

On 09/03/2014 03:47 PM, Jonghwa Lee wrote:
> When it writes some value other than 0 to BTLDset and JIGset, muic device
> will be reset automatically. And it happens during updating ADC debounce time,
> because it shares same register. To update ADC debounce time without reset,
> set value only to ADCDbset and 0 to BTLDset and JIGset.
> 
> Signed-off-by: Jonghwa Lee <jonghwa3.lee@...sung.com>
> ---
> Changes in v2
>  - Fix comments.
> 
>  drivers/extcon/extcon-max77693.c |   11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
> index 77460f2..171f35a 100644
> --- a/drivers/extcon/extcon-max77693.c
> +++ b/drivers/extcon/extcon-max77693.c
> @@ -255,10 +255,15 @@ static int max77693_muic_set_debounce_time(struct max77693_muic_info *info,
>  	case ADC_DEBOUNCE_TIME_10MS:
>  	case ADC_DEBOUNCE_TIME_25MS:
>  	case ADC_DEBOUNCE_TIME_38_62MS:
> -		ret = regmap_update_bits(info->max77693->regmap_muic,
> +		/*
> +		 * Don't touch BTLDset, JIGset when you want to change adc
> +		 * debounce time. If it writes other than 0 to BTLDset, JIGset
> +		 * muic device will be reset and loose current state.
> +		 */
> +		ret = regmap_write_bits(info->max77693->regmap_muic,

regmap_write_bits() is wrong. You have to use regmap_write().

>  					  MAX77693_MUIC_REG_CTRL3,
> -					  CONTROL3_ADCDBSET_MASK,
> -					  time << CONTROL3_ADCDBSET_SHIFT);
> +					  (CONTROL3_ADCDBSET_MASK &
> +					  time << CONTROL3_ADCDBSET_SHIFT));

I think you don't need to mask with CONTROL3_ADCDBSET_MASK.
You can just write following statement wihtout masking operation
because of using regmap_write() function.

		ret = regmap_write(info->max77693->regmap_muic,			
  				  MAX77693_MUIC_REG_CTRL3,
				  time << CONTROL3_ADCDBSET_SHIFT);

Thanks,
Chanwoo Choi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ