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] [thread-next>] [day] [month] [year] [list]
Message-Id: <20120207145458.6397d04c.akpm@linux-foundation.org>
Date:	Tue, 7 Feb 2012 14:54:58 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	"Kim, Milo" <Milo.Kim@...com>
Cc:	"Linus Walleij" <linus.walleij@...aro.org>,
	"shreshthakumar.sahu@...ricsson.com" 
	<shreshthakumar.sahu@...ricsson.com>,
	"rpurdie@...ys.net" <rpurdie@...ys.net>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 3/5] leds-lm3530: support pwm input mode

On Mon, 6 Feb 2012 21:14:21 -0800
"Kim, Milo" <Milo.Kim@...com> wrote:

> * add 'struct lm3530_pwm_data' in the platform data
>   The pwm data is the platform specific functions which generate the pwm.
>   The pwm data is only valid when brightness is pwm input mode.
>   Functions should be implemented by the pwm driver.
>   pwm_set_intensity() : set duty of pwm.
>   pwm_get_intensity() : get current the brightness.
> 
> * brightness control by pwm
>   If the control mode is pwm, then brightness is changed by the duty of pwm.
>   So pwm platform function should be called in lm3530_brightness_set().
> 
> * do not update brightness register when pwm input mode
>   In pwm input mode, brightness register is not used.
>   If any value is updated in this register, then the led will be off.
> 
> * when input mode is changed, set duty of pwm to 0 if unnecessary.
> 
> * patch base version : kernel 3.2.4
> 
>
> ...
>
> @@ -327,14 +344,11 @@ static ssize_t lm3530_mode_set(struct device *dev, struct device_attribute
>  		return -EINVAL;
>  	}
>  
> -	if (mode == LM3530_BL_MODE_MANUAL)
> -		drvdata->mode = LM3530_BL_MODE_MANUAL;
> -	else if (mode == LM3530_BL_MODE_ALS)
> -		drvdata->mode = LM3530_BL_MODE_ALS;
> -	else if (mode == LM3530_BL_MODE_PWM) {
> -		dev_err(dev, "PWM mode not supported\n");
> -		return -EINVAL;
> -	}
> +	drvdata->mode = mode;
> +
> +	/* set pwm to low if unnecessary */
> +	if (mode != LM3530_BL_MODE_PWM && pwm->pwm_set_intensity)
> +		pwm->pwm_set_intensity(0, max_brightness);

lm3530_mode_set() has no local variable "pwm" and has no local variable
"brightness".

I see now that you prepared the patches against 3.2.4, which might
contribute to this problem, but I don't see how the patches could work
in 3.2 either.  Perhaps 3.2.4 is significantly different from 3.2.

Anyway, I think I will drop all the patches again until we can get this
fully sorted out.  Please don't prepare patches against ancient old
kernels like 3.2.4!  They should be prepared and tested against the
latest Linus tree, from
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git.  Or
against the latest linux-next from 
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
--
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