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: <35ad437f-7527-e9b1-4819-8f4faa765e26@gmail.com>
Date:   Wed, 22 Sep 2021 17:05:45 +0900
From:   Chanwoo Choi <cwchoi00@...il.com>
To:     Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>,
        Rob Herring <robh+dt@...nel.org>,
        Chanwoo Choi <cw00.choi@...sung.com>,
        MyungJoo Ham <myungjoo.ham@...sung.com>,
        Kyungmin Park <kyungmin.park@...sung.com>,
        devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-samsung-soc@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-pm@...r.kernel.org
Cc:     Marek Szyprowski <m.szyprowski@...sung.com>,
        Sylwester Nawrocki <snawrocki@...nel.org>,
        Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
Subject: Re: [PATCH v2 2/3] devfreq: exynos-ppmu: simplify parsing event-type
 from DT

Hi Krzysztof,

On 21. 9. 20. 오후 4:17, Krzysztof Kozlowski wrote:
> When parsing devicetree, the function of_get_devfreq_events(), for each
> device child node, iterates over array of possible events "ppmu_events"
> till it finds one matching by node name.  When match is found the
> ppmu_events[i] points to element having both the name of the event and
> the counters ID.
> 
> Each PPMU device child node might have an "event-name" property with the
> name of the event, however due to the design of devfreq it must be the
> same as the device node name.  If it is not the same, the devfreq client
> won't be able to use it via devfreq_event_get_edev_by_phandle().
> 
> Since PPMU device child node name must be equal to the "event-name"
> property (event-name == ppmu_events[i].name), there is no need to find
> the counters ID by the "event-name".  Instead use ppmu_events[i].id
> which must be equal to it.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>
> ---
>   drivers/devfreq/event/exynos-ppmu.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/devfreq/event/exynos-ppmu.c b/drivers/devfreq/event/exynos-ppmu.c
> index 541bd13ab61d..9b849d781116 100644
> --- a/drivers/devfreq/event/exynos-ppmu.c
> +++ b/drivers/devfreq/event/exynos-ppmu.c
> @@ -566,13 +566,10 @@ static int of_get_devfreq_events(struct device_node *np,
>   			 * use default if not.
>   			 */
>   			if (info->ppmu_type == EXYNOS_TYPE_PPMU_V2) {
> -				int id;
>   				/* Not all registers take the same value for
>   				 * read+write data count.
>   				 */
> -				id = __exynos_ppmu_find_ppmu_id(desc[j].name);
> -
> -				switch (id) {
> +				switch (ppmu_events[i].id) {
>   				case PPMU_PMNCNT0:
>   				case PPMU_PMNCNT1:
>   				case PPMU_PMNCNT2:
> 

Applied it. Thanks.


-- 
Best Regards,
Samsung Electronics
Chanwoo Choi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ