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: <95f87650-ac38-4477-9bad-1b4f098c4072@wanadoo.fr>
Date: Sat, 14 Dec 2024 08:35:56 +0100
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: "Jackson.lee" <jackson.lee@...psnmedia.com>, mchehab@...nel.org,
 hverkuil-cisco@...all.nl, sebastian.fricke@...labora.com,
 nicolas.dufresne@...labora.com, bob.beckett@...labora.com,
 dafna.hirschfeld@...labora.com
Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
 lafley.kim@...psnmedia.com, b-brnich@...com, hverkuil@...all.nl,
 nas.chung@...psnmedia.com
Subject: Re: [PATCH v1 2/5] media: chips-media: wave5: Avoid race condition
 for interrupt handling

Le 09/12/2024 à 06:36, Jackson.lee a écrit :
> In case of multi instance, interrupts can occurr for other instances as

If the serie is resent:

s/occurr/occur/

> soon as interrupt is cleared. If driver reads the instance_info after
> clearing the interrupt, it is not guaranteed that the instance_info is
> valid for the current interrupt.
> 
> Read the instance_info register for each interrupt before clearing the
> interrupt.
> 
> Signed-off-by: Jackson.lee <jackson.lee@...psnmedia.com>
> Signed-off-by: Nas Chung <nas.chung@...psnmedia.com>
> ---
>   drivers/media/platform/chips-media/wave5/wave5-vpu.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu.c b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> index 6b294a2d6717..63a607d10433 100644
> --- a/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> +++ b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> @@ -55,12 +55,12 @@ static void wave5_vpu_handle_irq(void *dev_id)
>   	struct vpu_device *dev = dev_id;
>   
>   	irq_reason = wave5_vdi_read_register(dev, W5_VPU_VINT_REASON);
> +	seq_done = wave5_vdi_read_register(dev, W5_RET_SEQ_DONE_INSTANCE_INFO);
> +	cmd_done = wave5_vdi_read_register(dev, W5_RET_QUEUE_CMD_DONE_INST);
>   	wave5_vdi_write_register(dev, W5_VPU_VINT_REASON_CLR, irq_reason);
>   	wave5_vdi_write_register(dev, W5_VPU_VINT_CLEAR, 0x1);
>   
>   	list_for_each_entry(inst, &dev->instances, list) {
> -		seq_done = wave5_vdi_read_register(dev, W5_RET_SEQ_DONE_INSTANCE_INFO);
> -		cmd_done = wave5_vdi_read_register(dev, W5_RET_QUEUE_CMD_DONE_INST);
>   
>   		if (irq_reason & BIT(INT_WAVE5_INIT_SEQ) ||
>   		    irq_reason & BIT(INT_WAVE5_ENC_SET_PARAM)) {


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ