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:	Wed, 23 Mar 2016 10:10:33 +0530
From:	Viresh Kumar <viresh.kumar@...aro.org>
To:	Feng Xiao <xf@...k-chips.com>
Cc:	linux@....linux.org.uk, heiko@...ech.de, rjw@...ysocki.net,
	linux-arm-kernel@...ts.infradead.org,
	linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org,
	linux-pm@...r.kernel.org, wxt@...k-chips.com, zyw@...k-chips.com,
	jay.xu@...k-chips.com, tim.chen@...k-chips.com, xxx@...k-chips.com,
	huangtao@...k-chips.com
Subject: Re: [PATCH v2] cpufreq: rockchip: add driver

On 23-03-16, 10:18, Feng Xiao wrote:
> diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
> index 14b1f93..1786315 100644
> --- a/drivers/cpufreq/Kconfig.arm
> +++ b/drivers/cpufreq/Kconfig.arm
> @@ -97,6 +97,16 @@ config ARM_OMAP2PLUS_CPUFREQ
>  	depends on ARCH_OMAP2PLUS
>  	default ARCH_OMAP2PLUS
>  
> +config ARM_ROCKCHIP_CPUFREQ
> +	tristate "Rockchip CPUfreq driver"

Since you are allowing it to be built as a module ...

> +	depends on ARCH_ROCKCHIP && CPUFREQ_DT
> +	select PM_OPP
> +	help
> +	  This adds the CPUFreq driver support for Rockchip SoCs.
> +	  The driver will directly use cpufreq-dt driver as backend.
> +
> +	  If in doubt, say N.

> +++ b/drivers/cpufreq/rockchip-cpufreq.c
> +static int __init rockchip_cpufreq_driver_init(void)
> +{
> +	struct platform_device *pdev;
> +	int i;
> +
> +	for (i = 0; i < ARRAY_SIZE(rockchip_compat); i++) {
> +		if (of_machine_is_compatible(rockchip_compat[i])) {
> +			pdev = platform_device_register_simple("cpufreq-dt",
> +							       -1, NULL, 0);
> +			return PTR_ERR_OR_ZERO(pdev);
> +		}
> +	}
> +
> +	return -ENODEV;
> +}
> +module_init(rockchip_cpufreq_driver_init);

You need a module exit as well to remove the device. Otherwise following
sequence will give you errors:

insmod rockchip-cpufreq.ko
rmmod rockchip-cpufreq.ko
insmod rockchip-cpufreq.ko //Errors on this..

So, either don't allow it to be built as a module or fix the module-exit path.

-- 
viresh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ