Re: [PATCH 2/2] sh_eth: kill redundant check in the probe() method

2018-01-01 Thread Geert Uytterhoeven
H Sergei,

On Sun, Dec 31, 2017 at 7:41 PM, Sergei Shtylyov
 wrote:
> Browsing thru the driver diassembly, I noticed that gcc was  able to
> figure  out  that the 'ndev' pointer is always non-NULL when calling
> free_netdev()  on the probe() method's  error path and  thus skip that
> redundant NULL check... gcc is smart, be like gcc! :-)

Thanks for your patch!

> Signed-off-by: Sergei Shtylyov 

Reviewed-by: Geert Uytterhoeven 

> --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c
> +++ net-next/drivers/net/ethernet/renesas/sh_eth.c
> @@ -3282,8 +3282,7 @@ out_napi_del:
>
>  out_release:
> /* net_dev free */
> -   if (ndev)
> -   free_netdev(ndev);
> +   free_netdev(ndev);
>
> pm_runtime_put(&pdev->dev);
> pm_runtime_disable(&pdev->dev);

BTW, there isn't a functional dependency, but you may want to move the
freeing of the netdev below disabling of Runtime PM for symmetry (use
reverse order in cleanup).

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds


Re: [PATCH 1/2] ravb: kill redundant check in the probe() method

2018-01-01 Thread Geert Uytterhoeven
Hi Sergei,

On Sun, Dec 31, 2017 at 7:41 PM, Sergei Shtylyov
 wrote:
> Browsing thru the driver diassembly, I noticed that gcc was  able to
> figure  out  that the 'ndev' pointer is always non-NULL when calling
> free_netdev()  on the probe() method's  error path and  thus skip that
> redundant NULL check... gcc is smart, be like gcc! :-)

Thanks for your patch!

> Signed-off-by: Sergei Shtylyov 

Reviewed-by: Geert Uytterhoeven 

> --- net-next.orig/drivers/net/ethernet/renesas/ravb_main.c
> +++ net-next/drivers/net/ethernet/renesas/ravb_main.c
> @@ -2205,8 +2205,7 @@ out_dma_free:
> if (chip_id != RCAR_GEN2)
> ravb_ptp_stop(ndev);
>  out_release:
> -   if (ndev)
> -   free_netdev(ndev);
> +   free_netdev(ndev);
>
> pm_runtime_put(&pdev->dev);
> pm_runtime_disable(&pdev->dev);

BTW, there isn't a functional dependency, but you may want to move the
freeing of the netdev below disabling of Runtime PM for symmetry (use
reverse order in cleanup).

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds


Re: [PATCH v2 2/2] ARM: dts: r8a7743: Add thermal device to DT

2018-01-01 Thread Eduardo Valentin
On Tue, Dec 19, 2017 at 01:17:29PM +, Biju Das wrote:
> This patch instantiates the thermal sensor module with thermal-zone
> support.
> 
> This patch is based on the commit cac68a56e34b
> ("ARM: dts: r8a7791: enable to use thermal-zone") by Kuninori Morimoto.
> 
> Signed-off-by: Biju Das 
> Reviewed-by: Fabrizio Castro 
> Reviewed-by: Geert Uytterhoeven 

As for the thermal composition of this patch:
Acked-by: Eduardo Valentin 

Also taking care of patch 1.


Re: [1/2] arm64: dts: r8a7795: add thermal cooling management

2018-01-01 Thread Eduardo Valentin
On Wed, Sep 13, 2017 at 12:59:08PM +0200, Niklas Söderlund wrote:
> Add nodes and properties for thermal cooling management support.
> 
> Signed-off-by: Niklas Söderlund 
> ---

Just a reminder, this series should go via your arch tree. You may add
my acks.


Re: [1/2] arm64: dts: r8a7795: add thermal cooling management

2018-01-01 Thread Eduardo Valentin
On Wed, Sep 13, 2017 at 12:59:08PM +0200, Niklas Söderlund wrote:
> Add nodes and properties for thermal cooling management support.
> 
> Signed-off-by: Niklas Söderlund 

Acked-by: Eduardo Valentin 

> ---
>  arch/arm64/boot/dts/renesas/r8a7795.dtsi | 40 
> 
>  1 file changed, 40 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/renesas/r8a7795.dtsi 
> b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
> index 0ccac86bccc6b6f0..1818fd20660d0315 100644
> --- a/arch/arm64/boot/dts/renesas/r8a7795.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
> @@ -53,6 +53,7 @@
>   <&cluster0_opp_tb3>, <&cluster0_opp_tb4>,
>   <&cluster0_opp_tb5>, <&cluster0_opp_tb6>,
>   <&cluster0_opp_tb7>;
> + #cooling-cells = <2>;
>   };
>  
>   a57_1: cpu@1 {
> @@ -67,6 +68,7 @@
>   <&cluster0_opp_tb3>, <&cluster0_opp_tb4>,
>   <&cluster0_opp_tb5>, <&cluster0_opp_tb6>,
>   <&cluster0_opp_tb7>;
> + #cooling-cells = <2>;
>   };
>  
>   a57_2: cpu@2 {
> @@ -81,6 +83,7 @@
>   <&cluster0_opp_tb3>, <&cluster0_opp_tb4>,
>   <&cluster0_opp_tb5>, <&cluster0_opp_tb6>,
>   <&cluster0_opp_tb7>;
> + #cooling-cells = <2>;
>   };
>  
>   a57_3: cpu@3 {
> @@ -95,6 +98,7 @@
>   <&cluster0_opp_tb3>, <&cluster0_opp_tb4>,
>   <&cluster0_opp_tb5>, <&cluster0_opp_tb6>,
>   <&cluster0_opp_tb7>;
> + #cooling-cells = <2>;
>   };
>  
>   a53_0: cpu@100 {
> @@ -2821,12 +2825,24 @@
>   thermal-sensors = <&tsc 0>;
>  
>   trips {
> + sensor1_passive: sensor1-passive {
> + temperature = <95000>;
> + hysteresis = <2000>;
> + type = "passive";
> + };
>   sensor1_crit: sensor1-crit {
>   temperature = <12>;
>   hysteresis = <2000>;
>   type = "critical";
>   };
>   };
> +
> + cooling-maps {
> + map0 {
> + trip = <&sensor1_passive>;
> + cooling-device = <&a57_0 4 4>;
> + };
> + };
>   };
>  
>   sensor_thermal2: sensor-thermal2 {
> @@ -2835,12 +2851,24 @@
>   thermal-sensors = <&tsc 1>;
>  
>   trips {
> + sensor2_passive: sensor2-passive {
> + temperature = <95000>;
> + hysteresis = <2000>;
> + type = "passive";
> + };
>   sensor2_crit: sensor2-crit {
>   temperature = <12>;
>   hysteresis = <2000>;
>   type = "critical";
>   };
>   };
> +
> + cooling-maps {
> + map0 {
> + trip = <&sensor2_passive>;
> + cooling-device = <&a57_0 4 4>;
> + };
> + };
>   };
>  
>   sensor_thermal3: sensor-thermal3 {
> @@ -2849,12 +2877,24 @@
>   thermal-sensors = <&tsc 2>;
>  
>   trips {
> + sensor3_passive: sensor3-passive {
> + temperature = <95000>;
> + hysteresis = <2000>;
> + type = "passive";
> + };
>   sensor3_crit: sensor3-crit {
>   temperature = <12>;
>   hysteresis = <2000>;
> 

Re: [2/2] arm64: dts: r8a7796: add thermal cooling management

2018-01-01 Thread Eduardo Valentin
On Wed, Sep 13, 2017 at 12:59:09PM +0200, Niklas Söderlund wrote:
> Add nodes and properties for thermal cooling management support.
> 
> Signed-off-by: Niklas Söderlund 

Acked-by: Eduardo Valentin 

> ---
>  arch/arm64/boot/dts/renesas/r8a7796.dtsi | 38 
> 
>  1 file changed, 38 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/renesas/r8a7796.dtsi 
> b/arch/arm64/boot/dts/renesas/r8a7796.dtsi
> index 2905a3b953aab145..0b805dc30925e9be 100644
> --- a/arch/arm64/boot/dts/renesas/r8a7796.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r8a7796.dtsi
> @@ -53,6 +53,7 @@
>   <&cluster0_opp_tb3>, <&cluster0_opp_tb4>,
>   <&cluster0_opp_tb5>, <&cluster0_opp_tb6>,
>   <&cluster0_opp_tb7>;
> + #cooling-cells = <2>;
>   };
>  
>   a57_1: cpu@1 {
> @@ -67,6 +68,7 @@
>   <&cluster0_opp_tb3>, <&cluster0_opp_tb4>,
>   <&cluster0_opp_tb5>, <&cluster0_opp_tb6>,
>   <&cluster0_opp_tb7>;
> + #cooling-cells = <2>;
>   };
>  
>   a53_0: cpu@100 {
> @@ -2116,12 +2118,24 @@
>   thermal-sensors = <&tsc 0>;
>  
>   trips {
> + sensor1_passive: sensor1-passive {
> + temperature = <95000>;
> + hysteresis = <2000>;
> + type = "passive";
> + };
>   sensor1_crit: sensor1-crit {
>   temperature = <12>;
>   hysteresis = <2000>;
>   type = "critical";
>   };
>   };
> +
> + cooling-maps {
> + map0 {
> + trip = <&sensor1_passive>;
> + cooling-device = <&a57_0 5 5>;
> + };
> + };
>   };
>  
>   sensor_thermal2: sensor-thermal2 {
> @@ -2130,12 +2144,24 @@
>   thermal-sensors = <&tsc 1>;
>  
>   trips {
> + sensor2_passive: sensor2-passive {
> + temperature = <95000>;
> + hysteresis = <2000>;
> + type = "passive";
> + };
>   sensor2_crit: sensor2-crit {
>   temperature = <12>;
>   hysteresis = <2000>;
>   type = "critical";
>   };
>   };
> +
> + cooling-maps {
> + map0 {
> + trip = <&sensor2_passive>;
> + cooling-device = <&a57_0 5 5>;
> + };
> + };
>   };
>  
>   sensor_thermal3: sensor-thermal3 {
> @@ -2144,12 +2170,24 @@
>   thermal-sensors = <&tsc 2>;
>  
>   trips {
> + sensor3_passive: sensor3-passive {
> + temperature = <95000>;
> + hysteresis = <2000>;
> + type = "passive";
> + };
>   sensor3_crit: sensor3-crit {
>   temperature = <12>;
>   hysteresis = <2000>;
>   type = "critical";
>   };
>   };
> +
> + cooling-maps {
> + map0 {
> + trip = <&sensor3_passive>;
> + cooling-device = <&a57_0 5 5>;
> + };
> + };
>   };
>   };
>  


Re: [PATCH 01/33] clk_ops: change round_rate() to return unsigned long

2018-01-01 Thread kbuild test robot
Hi Bryan,

I love your patch! Perhaps something to improve:

[auto build test WARNING on tegra/for-next]
[also build test WARNING on v4.15-rc6]
[cannot apply to clk/clk-next next-20171222]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Bryan-O-Donoghue/change-clk_ops-round_rate-to-scale-past-LONG_MAX/20180101-212907
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux.git for-next
reproduce:
# apt-get install sparse
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)


vim +321 drivers/clk/clk-versaclock5.c

8c1ebe97 Marek Vasut 2017-07-09  318  
8c1ebe97 Marek Vasut 2017-07-09  319  static const struct clk_ops vc5_dbl_ops = 
{
8c1ebe97 Marek Vasut 2017-07-09  320.recalc_rate= vc5_dbl_recalc_rate,
8c1ebe97 Marek Vasut 2017-07-09 @321.round_rate = vc5_dbl_round_rate,
8c1ebe97 Marek Vasut 2017-07-09  322.set_rate   = vc5_dbl_set_rate,
8c1ebe97 Marek Vasut 2017-07-09  323  };
8c1ebe97 Marek Vasut 2017-07-09  324  

:: The code at line 321 was first introduced by commit
:: 8c1ebe9762670159ca982167131af63c94ff1571 clk: vc5: Add support for the 
input frequency doubler

:: TO: Marek Vasut 
:: CC: Stephen Boyd 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


Re: [PATCH 01/33] clk_ops: change round_rate() to return unsigned long

2018-01-01 Thread kbuild test robot
Hi Bryan,

I love your patch! Yet something to improve:

[auto build test ERROR on tegra/for-next]
[also build test ERROR on v4.15-rc6]
[cannot apply to clk/clk-next next-20171222]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Bryan-O-Donoghue/change-clk_ops-round_rate-to-scale-past-LONG_MAX/20180101-212907
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux.git for-next
config: x86_64-randconfig-x016-201800 (attached as .config)
compiler: gcc-7 (Debian 7.2.0-12) 7.2.1 20171025
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 

All errors (new ones prefixed by >>):

>> drivers//clk/clk-versaclock5.c:321:16: error: initialization from 
>> incompatible pointer type [-Werror=incompatible-pointer-types]
 .round_rate = vc5_dbl_round_rate,
   ^~
   drivers//clk/clk-versaclock5.c:321:16: note: (near initialization for 
'vc5_dbl_ops.round_rate')
   cc1: some warnings being treated as errors

vim +321 drivers//clk/clk-versaclock5.c

8c1ebe97 Marek Vasut 2017-07-09  318  
8c1ebe97 Marek Vasut 2017-07-09  319  static const struct clk_ops vc5_dbl_ops = 
{
8c1ebe97 Marek Vasut 2017-07-09  320.recalc_rate= vc5_dbl_recalc_rate,
8c1ebe97 Marek Vasut 2017-07-09 @321.round_rate = vc5_dbl_round_rate,
8c1ebe97 Marek Vasut 2017-07-09  322.set_rate   = vc5_dbl_set_rate,
8c1ebe97 Marek Vasut 2017-07-09  323  };
8c1ebe97 Marek Vasut 2017-07-09  324  

:: The code at line 321 was first introduced by commit
:: 8c1ebe9762670159ca982167131af63c94ff1571 clk: vc5: Add support for the 
input frequency doubler

:: TO: Marek Vasut 
:: CC: Stephen Boyd 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


Re: [PATCH 01/33] clk_ops: change round_rate() to return unsigned long

2018-01-01 Thread kbuild test robot
Hi Bryan,

I love your patch! Perhaps something to improve:

[auto build test WARNING on tegra/for-next]
[also build test WARNING on v4.15-rc6]
[cannot apply to clk/clk-next next-20171222]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Bryan-O-Donoghue/change-clk_ops-round_rate-to-scale-past-LONG_MAX/20180101-212907
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux.git for-next
config: i386-randconfig-b0-01011934 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All warnings (new ones prefixed by >>):

>> drivers/clk/clk-versaclock5.c:321:2: warning: initialization from 
>> incompatible pointer type
 .round_rate = vc5_dbl_round_rate,
 ^
   drivers/clk/clk-versaclock5.c:321:2: warning: (near initialization for 
'vc5_dbl_ops.round_rate')

vim +321 drivers/clk/clk-versaclock5.c

8c1ebe97 Marek Vasut 2017-07-09  318  
8c1ebe97 Marek Vasut 2017-07-09  319  static const struct clk_ops vc5_dbl_ops = 
{
8c1ebe97 Marek Vasut 2017-07-09  320.recalc_rate= vc5_dbl_recalc_rate,
8c1ebe97 Marek Vasut 2017-07-09 @321.round_rate = vc5_dbl_round_rate,
8c1ebe97 Marek Vasut 2017-07-09  322.set_rate   = vc5_dbl_set_rate,
8c1ebe97 Marek Vasut 2017-07-09  323  };
8c1ebe97 Marek Vasut 2017-07-09  324  

:: The code at line 321 was first introduced by commit
:: 8c1ebe9762670159ca982167131af63c94ff1571 clk: vc5: Add support for the 
input frequency doubler

:: TO: Marek Vasut 
:: CC: Stephen Boyd 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


Re: [PATCH] sata: rcar_sata: Reset SATA PHY when Salvator-X board resumes

2018-01-01 Thread Sergei Shtylyov

Hello!

On 12/6/2017 9:45 PM, Yoshihiro Kaneko wrote:


From: Khiem Nguyen 

Because power of Salvator-X board is cut off in suspend,
it needs to reset SATA PHY state in resume.
Otherwise, SATA partition could not be accessed anymore.

Signed-off-by: Khiem Nguyen 
Signed-off-by: Hien Dang 
Signed-off-by: Yoshihiro Kaneko 
---

This patch is based on the for-next branch of libata tree.

  drivers/ata/sata_rcar.c | 32 
  1 file changed, 32 insertions(+)

diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
index 80ee2f2..aba6121 100644
--- a/drivers/ata/sata_rcar.c
+++ b/drivers/ata/sata_rcar.c
@@ -977,11 +977,43 @@ static int sata_rcar_resume(struct device *dev)
struct sata_rcar_priv *priv = host->private_data;
void __iomem *base = priv->base;
int ret;
+   u32 val;
  
  	ret = clk_prepare_enable(priv->clk);

if (ret)
return ret;
  
+	/* Re-use from sata_rcar_init_controller() */


   Why not just call it? Or at least factor out a common part?

[...]

MBR, Sergei