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: <87lepcgtvm.wl-maz@kernel.org>
Date:   Wed, 19 Oct 2022 08:22:37 +0100
From:   Marc Zyngier <maz@...nel.org>
To:     Huacai Chen <chenhuacai@...ngson.cn>
Cc:     Thomas Gleixner <tglx@...utronix.de>, linux-kernel@...r.kernel.org,
        Xuefeng Li <lixuefeng@...ngson.cn>,
        Huacai Chen <chenhuacai@...il.com>,
        Jiaxun Yang <jiaxun.yang@...goat.com>
Subject: Re: [PATCH 2/4] irqchip/loongson-eiointc: Add suspend/resume support

On Mon, 17 Oct 2022 04:39:02 +0100,
Huacai Chen <chenhuacai@...ngson.cn> wrote:
> 
> Add suspend/resume support for EIOINTC irqchip, which is needed for
> upcoming suspend/hibernation.
> 
> Signed-off-by: Huacai Chen <chenhuacai@...ngson.cn>
> ---
>  drivers/irqchip/irq-loongson-eiointc.c | 31 ++++++++++++++++++++++++++
>  1 file changed, 31 insertions(+)
> 
> diff --git a/drivers/irqchip/irq-loongson-eiointc.c b/drivers/irqchip/irq-loongson-eiointc.c
> index 16e9af8d8b1e..c68f8de3ae09 100644
> --- a/drivers/irqchip/irq-loongson-eiointc.c
> +++ b/drivers/irqchip/irq-loongson-eiointc.c
> @@ -17,6 +17,7 @@
>  #include <linux/of_address.h>
>  #include <linux/of_irq.h>
>  #include <linux/of_platform.h>
> +#include <linux/syscore_ops.h>
>  
>  #define EIOINTC_REG_NODEMAP	0x14a0
>  #define EIOINTC_REG_IPMAP	0x14c0
> @@ -301,6 +302,35 @@ static struct irq_domain *acpi_get_vec_parent(int node, struct acpi_vector_group
>  	return NULL;
>  }
>  
> +static int eiointc_suspend(void)
> +{
> +	return 0;
> +}
> +
> +static void eiointc_resume(void)
> +{
> +	int i, j;
> +	struct irq_desc *desc;
> +	struct irq_data *irq_data;
> +
> +	eiointc_router_init(0);
> +
> +	for (i = 0; i < nr_pics; i++) {
> +		for (j = 0; j < VEC_COUNT; j++) {
> +			desc = irq_resolve_mapping(eiointc_priv[i]->eiointc_domain, j);
> +			if (desc && desc->handle_irq && desc->handle_irq != handle_bad_irq) {
> +				irq_data = &desc->irq_data;
> +				eiointc_set_irq_affinity(irq_data, irq_data->common->affinity, 0);

Changing the affinity without holding the irq_desc lock? What makes
this safe?

	M.

-- 
Without deviation from the norm, progress is not possible.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ