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: <3e48b6b3-62e4-8a15-6c73-e2f35c07b842@gmail.com>
Date:   Thu, 1 Jul 2021 12:04:17 +0300
From:   Sergei Shtylyov <sergei.shtylyov@...il.com>
To:     Qing Zhang <zhangqing@...ngson.cn>,
        Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
        Rob Herring <robh+dt@...nel.org>,
        Jiaxun Yang <jiaxun.yang@...goat.com>
Cc:     devicetree@...r.kernel.org, linux-mips@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v7 1/3] MIPS: Loongson64: Add Loongson-2K1000 reset
 platform driver

Hello!

On 01.07.2021 6:01, Qing Zhang wrote:

> Add power management register operations to support reboot and poweroff.
> 
> Signed-off-by: Qing Zhang <zhangqing@...ngson.cn>
[...]
> diff --git a/drivers/platform/mips/ls2k-reset.c b/drivers/platform/mips/ls2k-reset.c
> new file mode 100644
> index 000000000000..286d47bf6964
> --- /dev/null
> +++ b/drivers/platform/mips/ls2k-reset.c
> @@ -0,0 +1,53 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + *  Copyright (C) 2021, Qing Zhang <zhangqing@...ngson.cn>
> + *  Loongson-2K1000 reset support
> + */
> +
> +#include <linux/of_address.h>
> +#include <linux/pm.h>
> +#include <asm/reboot.h>
> +
> +#define	PM1_STS		0x0c /* Power Management1 Status Register */
                                                         ^ space missing?

> +#define	PM1_CNT		0x14 /* Power Management 1 Control Register */
> +#define	RST_CNT		0x30 /* Reset Control Register */
> +
> +static void __iomem *base;
> +
> +static void ls2k_restart(char *command)
> +{
> +	writel(0x1, (void *)base + RST_CNT);
> +}
> +
> +static void ls2k_poweroff(void)
> +{
> +	/* Clear */
> +	writel((readl((void *)base + PM1_STS) & 0xffffffff), (void *)base + PM1_STS);

    Are the pointer casts really necessary above?

> +	/* Sleep Enable | Soft Off*/
> +	writel(GENMASK(12, 10)|BIT(13), (void *)base + PM1_CNT);

    Spaces around that | are needed.

[...]

MBR, Sergei

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ