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: <20170120235856.GF20800@codeaurora.org>
Date:   Fri, 20 Jan 2017 15:58:56 -0800
From:   Stephen Boyd <sboyd@...eaurora.org>
To:     Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
Cc:     linux-clk@...r.kernel.org, x86@...nel.org,
        platform-driver-x86@...r.kernel.org,
        Darren Hart <dvhart@...radead.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        alsa-devel@...a-project.org, Irina Tirdea <irina.tirdea@...el.com>,
        Michael Turquette <mturquette@...libre.com>,
        "Rafael J . Wysocki" <rjw@...ysocki.net>,
        Takashi Iwai <tiwai@...e.com>, linux-kernel@...r.kernel.org,
        linux-acpi@...r.kernel.org, Ingo Molnar <mingo@...hat.com>,
        Mark Brown <broonie@...nel.org>,
        "H . Peter Anvin" <hpa@...or.com>, Len Brown <lenb@...nel.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Vinod Koul <vinod.koul@...el.com>
Subject: Re: [PATCH v7 2/5] clk: x86: Add Atom PMC platform clocks

On 01/17, Pierre-Louis Bossart wrote:
> diff --git a/drivers/clk/x86/clk-pmc-atom.c b/drivers/clk/x86/clk-pmc-atom.c
> new file mode 100644
> index 0000000..312d4e9
> --- /dev/null
> +++ b/drivers/clk/x86/clk-pmc-atom.c
[...]
> +
> +static void plt_clk_reg_update(struct clk_plt *clk, u32 mask, u32 val)
> +{
> +	u32 tmp;
> +	unsigned long flags;
> +
> +	spin_lock_irqsave(&clk->lock, flags);
> +
> +	tmp = clk_readl(clk->reg);

Do you need to use clk_readl? I'd prefer we deleted that
function/macro because it's just confusing. Please don't use it
unless you need it for some reason.

> +	tmp = (tmp & ~mask) | (val & mask);
> +	clk_writel(tmp, clk->reg);
> +
> +	spin_unlock_irqrestore(&clk->lock, flags);
> +}
> +
[..]
> +
> +static void plt_clk_unregister_parents(struct clk_plt_data *data)
> +{
> +	plt_clk_unregister_fixed_rate_loop(data, data->nparents);
> +}
> +
> +

Nitpick: Single newline please

> +static int plt_clk_probe(struct platform_device *pdev)
> +{
> +	const struct pmc_clk_data *pmc_data;
> +	const char **parent_names;
> +	struct clk_plt_data *data;
> +	unsigned int i;
> +	int err;
> +
> +	pmc_data = dev_get_platdata(&pdev->dev);
> +	if (!pmc_data || !pmc_data->clks)
> +		return -EINVAL;
> +
> +	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
> +	if (!data)
> +		return -ENOMEM;
> +
> +	parent_names = plt_clk_register_parents(pdev, data, pmc_data->clks);
> +	if (IS_ERR(parent_names))
> +		return PTR_ERR(parent_names);
> +
> +	for (i = 0; i < PMC_CLK_NUM; i++) {
> +		data->clks[i] = plt_clk_register(pdev, i, pmc_data->base,
> +						 parent_names, data->nparents);
> +		if (IS_ERR(data->clks[i])) {
> +			err = PTR_ERR(data->clks[i]);
> +			goto err_unreg_clk_plt;
> +		}
> +	}
> +
> +	plt_clk_free_parent_names_loop(parent_names, data->nparents);
> +
> +	platform_set_drvdata(pdev, data);
> +	return 0;
> +
> +err_unreg_clk_plt:
> +	plt_clk_unregister_loop(data, i);
> +	plt_clk_unregister_parents(data);
> +	plt_clk_free_parent_names_loop(parent_names, data->nparents);
> +	return err;
> +}
> +
> +static int plt_clk_remove(struct platform_device *pdev)
> +{
> +	struct clk_plt_data *data;
> +
> +	data = platform_get_drvdata(pdev);
> +
> +	plt_clk_unregister_loop(data, PMC_CLK_NUM);
> +	plt_clk_unregister_parents(data);
> +	return 0;
> +}
> +
> +static struct platform_driver plt_clk_driver = {
> +	.driver = {
> +		.name = PLT_CLK_DRIVER_NAME,

Nitpick: Just put the string here

> +	},
> +	.probe = plt_clk_probe,
> +	.remove = plt_clk_remove,
> +};
> +builtin_platform_driver(plt_clk_driver);

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ