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: <183a86f912ba28930845847c0b19b4118e3db80a.camel@mediatek.com>
Date:   Tue, 7 Dec 2021 09:38:00 +0800
From:   Biao Huang <biao.huang@...iatek.com>
To:     AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>, <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Rob Herring <robh+dt@...nel.org>
CC:     Matthias Brugger <matthias.bgg@...il.com>,
        Giuseppe Cavallaro <peppe.cavallaro@...com>,
        Alexandre Torgue <alexandre.torgue@...s.st.com>,
        Jose Abreu <joabreu@...opsys.com>,
        Maxime Coquelin <mcoquelin.stm32@...il.com>,
        <netdev@...r.kernel.org>, <devicetree@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-mediatek@...ts.infradead.org>,
        <linux-stm32@...md-mailman.stormreply.com>,
        <srv_heupstream@...iatek.com>, <macpaul.lin@...iatek.com>,
        <dkirjanov@...e.de>
Subject: Re: [PATCH v4 1/7] net-next: stmmac: dwmac-mediatek: add platform
 level clocks management

Dear Angelo,
	Thanks for your comments~

On Mon, 2021-12-06 at 16:14 +0100, AngeloGioacchino Del Regno wrote:
> Il 03/12/21 07:34, Biao Huang ha scritto:
> > This patch implements clks_config callback for dwmac-mediatek
> > platform,
> > which could support platform level clocks management.
> > 
> > Signed-off-by: Biao Huang <biao.huang@...iatek.com>
> > ---
> >   .../ethernet/stmicro/stmmac/dwmac-mediatek.c  | 24
> > ++++++++++++++-----
> >   1 file changed, 18 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
> > b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
> > index 58c0feaa8131..157ff655c85e 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
> > @@ -359,9 +359,6 @@ static int mediatek_dwmac_init(struct
> > platform_device *pdev, void *priv)
> >   		return ret;
> >   	}
> >   
> > -	pm_runtime_enable(&pdev->dev);
> > -	pm_runtime_get_sync(&pdev->dev);
> > -
> >   	return 0;
> >   }
> >   
> > @@ -370,11 +367,25 @@ static void mediatek_dwmac_exit(struct
> > platform_device *pdev, void *priv)
> >   	struct mediatek_dwmac_plat_data *plat = priv;
> >   
> >   	clk_bulk_disable_unprepare(plat->num_clks_to_config, plat-
> > >clks);
> > -
> > -	pm_runtime_put_sync(&pdev->dev);
> > -	pm_runtime_disable(&pdev->dev);
> >   }
> >   
> > +static int mediatek_dwmac_clks_config(void *priv, bool enabled)
> > +{
> > +	struct mediatek_dwmac_plat_data *plat = priv;
> > +	int ret = 0;
> > +
> > +	if (enabled) {
> > +		ret = clk_bulk_prepare_enable(plat->num_clks_to_config, 
> > plat->clks);
> > +		if (ret) {
> > +			dev_err(plat->dev, "failed to enable clks, err
> > = %d\n", ret);
> > +			return ret;
> > +		}
> > +	} else {
> > +		clk_bulk_disable_unprepare(plat->num_clks_to_config,
> > plat->clks);
> > +	}
> > +
> > +	return ret;
> > +}
> >   static int mediatek_dwmac_probe(struct platform_device *pdev)
> >   {
> >   	struct mediatek_dwmac_plat_data *priv_plat;
> > @@ -420,6 +431,7 @@ static int mediatek_dwmac_probe(struct
> > platform_device *pdev)
> >   	plat_dat->bsp_priv = priv_plat;
> >   	plat_dat->init = mediatek_dwmac_init;
> >   	plat_dat->exit = mediatek_dwmac_exit;
> > +	plat_dat->clks_config = mediatek_dwmac_clks_config;
> >   	mediatek_dwmac_init(pdev, priv_plat);
> >   
> >   	ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
> > 
> 
> Hello Biao,
> 
> you're removing all calls to pm_runtime_* functions, so there is no
> more reason
> to include linux/pm_runtime.h in this file: please also remove the
> inclusion.
> 
> Thanks!
Yes, I'll remove the inclusion in the next send.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ