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>] [day] [month] [year] [list]
Message-ID: <20150104010051.GA26438@developer>
Date:	Sat, 3 Jan 2015 21:00:53 -0400
From:	Eduardo Valentin <edubezval@...il.com>
To:	Pankaj Jangra <jangra.pankaj9@...il.com>
Cc:	Anson Huang <b20788@...escale.com>, linux-pm@...r.kernel.org,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	rui.zhang@...el.com
Subject: Re: [PATCH] Thermal: imx: add clk disable/enable for suspend/resume

Hello,

On Mon, Jan 05, 2015 at 10:34:11PM +0530, Pankaj Jangra wrote:
> Hi Anson,
> 
> On Mon, Jan 5, 2015 at 7:59 PM, Anson Huang <b20788@...escale.com> wrote:
> 
> > Thermal sensor's clk is from pll3_usb_otg, per hardware
> > design requirement, need to make sure pll3_usb_otg is disabled
> > before STOP mode is entered, otherwise, all PFDs under it may
> > enter incorrect state, this patch disables pll3_usb_otg before
> > suspend and enables it after resume.
> >
> > Signed-off-by: Anson Huang <b20788@...escale.com>
> >
> > +++ b/drivers/thermal/imx_thermal.c
> > @@ -600,6 +600,8 @@ static int imx_thermal_suspend(struct device *dev)
> >         regmap_write(map, TEMPSENSE0 + REG_CLR, TEMPSENSE0_MEASURE_TEMP);
> >         regmap_write(map, TEMPSENSE0 + REG_SET, TEMPSENSE0_POWER_DOWN);
> >         data->mode = THERMAL_DEVICE_DISABLED;
> > +       if (!IS_ERR(data->thermal_clk))
> >
> I think you do not need to check for the error condition here. Because
> during the probe of driver, this condition is already checked and if the
> clock get is failed,
> it will fail the driver probing itself.
> 

Agreed here, no need for this extra check.

> +               clk_disable_unprepare(data->thermal_clk);
> 
> 
> >         return 0;
> >  }
> > @@ -609,6 +611,8 @@ static int imx_thermal_resume(struct device *dev)
> >         struct imx_thermal_data *data = dev_get_drvdata(dev);
> >         struct regmap *map = data->tempmon;
> >
> > +       if (!IS_ERR(data->thermal_clk))
> >
> Same as above.
> 
> > +               clk_prepare_enable(data->thermal_clk);
> >         /* Enabled thermal sensor after resume */
> >         regmap_write(map, TEMPSENSE0 + REG_CLR, TEMPSENSE0_POWER_DOWN);
> >         regmap_write(map, TEMPSENSE0 + REG_SET, TEMPSENSE0_MEASURE_TEMP);
> > --
> >
> 
> Else changes looks good to me.
> 
> -- Pankaj Jangra
> 
> > 1.9.1
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> > the body of a message to majordomo@...r.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >

Download attachment "signature.asc" of type "application/pgp-signature" (474 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ