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] [day] [month] [year] [list]
Message-ID: <3dd246b0-ead3-e1e8-8700-22d68fc82042@wanadoo.fr>
Date:   Thu, 3 Nov 2022 12:33:37 +0100
From:   Christophe JAILLET <christophe.jaillet@...adoo.fr>
To:     zhuyinbo@...ngson.cn
Cc:     chenhuacai@...nel.org, daniel.lezcano@...aro.org,
        devicetree@...r.kernel.org, jiaxun.yang@...goat.com,
        kernel@...0n.name, krzysztof.kozlowski+dt@...aro.org,
        linux-kernel@...r.kernel.org, liuyun@...ngson.cn,
        loongarch@...ts.linux.dev, lvjianmin@...ngson.cn,
        robh+dt@...nel.org, tglx@...utronix.de, yang.lee@...ux.alibaba.com
Subject: Re: [PATCH v9 1/2] clocksource: loongson2_hpet: add hpet driver
 support

Le 03/11/2022 à 10:54, Yinbo Zhu a écrit :
> HPET (High Precision Event Timer) defines a new set of timers, which
> are used by the operating system to schedule threads, interrupt the
> kernel and interrupt the multimedia timer server. The operating
> system can assign different timers to different applications. By
> configuration, each timer can generate interrupt independently.
> 
> The Loongson-2 HPET module includes a main count and three comparators,
> all of which are 32 bits wide. Among the three comparators, only
> one comparator supports periodic interrupt, all three comparators
> support non periodic interrupts.
> 
> Signed-off-by: Yinbo Zhu <zhuyinbo-cXZgJK919ebM1kAEIRd3EQ@...lic.gmane.org>
> ---

[...]

> +static int __init loongson2_hpet_init(struct device_node *np)
> +{
> +	struct clk *clk;
> +	int ret = -EINVAL;
> +
> +	hpet_mmio_base = of_iomap(np, 0);
> +	if (!hpet_mmio_base) {
> +		pr_err("hpet: unable to map loongson2 hpet registers\n");
> +		goto err;

Hi,

It looks odd to iounmap() after a failed of_iomap().
It is maybe fine on your arch, but still looks odd.

CJ

> +	}
> +
> +	hpet_t0_irq = irq_of_parse_and_map(np, 0);
> +	if (hpet_t0_irq <= 0) {
> +		pr_err("hpet: unable to get IRQ from DT, %d\n", hpet_t0_irq);
> +		goto err;
> +	}
> +
> +	clk = of_clk_get(np, 0);
> +	if (IS_ERR(clk))
> +		goto err;
> +
> +	hpet_freq = clk_get_rate(clk);
> +	clk_put(clk);
> +
> +	hpet_irq_flags = HPET_TN_LEVEL;
> +
> +	loongson2_hpet_clocksource_init();
> +
> +	loongson2_hpet_clockevent_init();
> +
> +	return 0;
> +
> +err:
> +	iounmap(hpet_mmio_base);
> +	return ret;
> +}
> +
> +TIMER_OF_DECLARE(loongson2_hpet, "loongson,ls2k-hpet", loongson2_hpet_init);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ