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]
Date:	Sun, 06 Sep 2015 11:04:58 +0800
From:	Caesar Wang <wxt@...k-chips.com>
To:	Kevin Hilman <khilman@...aro.org>
CC:	Caesar Wang <wxt@...k-chips.com>, devicetree@...r.kernel.org,
	ulf.hansson@...aro.org, linux@....linux.org.uk, heiko@...ech.de,
	arnd@...db.de, ijc+devicetree@...lion.org.uk,
	"jinkun.hong" <jinkun.hong@...k-chips.com>,
	linus.walleij@...aro.org, dmitry.torokhov@...il.com,
	linux-kernel@...r.kernel.org, dianders@...omium.org,
	linux-rockchip@...ts.infradead.org, robh+dt@...nel.org,
	galak@...eaurora.org, tomasz.figa@...il.com,
	mturquette@...libre.com, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v17 3/4] soc: rockchip: power-domain: Add power domain
 driver

Kevin,

Thanks for having a look into it.


在 2015年09月03日 02:28, Kevin Hilman 写道:
> Caesar Wang <wxt@...k-chips.com> writes:
>
>> This driver is found on RK3288 SoCs.
>>
>> In order to meet high performance and low power requirements, a power
>> management unit is designed or saving power when RK3288 in low power
>> mode.
>> The RK3288 PMU is dedicated for managing the power of the whole chip.
>>
>> PMU can work in the Low Power Mode by setting bit[0] of PMU_PWRMODE_CON
>> register. After setting the register, PMU would enter the Low Power mode.
>> In the low power mode, pmu will auto power on/off the specified power
>> domain, send idle req to specified power domain, shut down/up pll and
>> so on. All of above are configurable by setting corresponding registers.
>>
>> Signed-off-by: jinkun.hong <jinkun.hong@...k-chips.com>
>> Signed-off-by: Caesar Wang <wxt@...k-chips.com>
> [...]
>
>> +static void rockchip_pm_remove_one_domain(struct rockchip_pm_domain *pd)
>> +{
>> +	int i;
>> +
>> +	for (i = 0; i < pd->num_clks; i++) {
>> +		clk_unprepare(pd->clks[i]);
>> +		clk_put(pd->clks[i]);
>> +	}
>
> You don't set pd->num_clks = 0 here, which means other places that
> iterate over the clocks might race with this and try to use clocks that
> have been unprepared/put.

Agree, we should set the "pd->num_cloks=0' in here.
> This might be over-paranoid, but in particular, this could race with
> rockchip_pd_power().
>
> Also not setting the pd->num_clks to zero would be a problem for a
> power-controller that is configured as a module which could be unloaded
> and reloaded (I know that doesn't really work now, but it will
> eventually, I hope.)

Yep.
>
> Maybe use the mutex here?  It should at least protect the zeroing of
> pm->num_clks.

Sound resonable.
Done.

---
Thanks,
Caesar
>
> Kevin
>
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip

--
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