[PATCH v3] raw/ifpga: fix pthread cannot join

Stephen Hemminger stephen at networkplumber.org
Thu Jan 20 16:46:43 CET 2022


On Thu, 20 Jan 2022 00:58:14 -0500
Wei Huang <wei.huang at intel.com> wrote:

> diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c
> index 8d9db58..2bc569b 100644
> --- a/drivers/raw/ifpga/ifpga_rawdev.c
> +++ b/drivers/raw/ifpga/ifpga_rawdev.c
> @@ -497,7 +497,7 @@ static int set_surprise_link_check_aer(
>  	int gsd_enable, ret;
>  #define MS 1000
>  
> -	while (1) {
> +	while (ifpga_monitor_start) {

This will work on x86 CPU but not on CPU's with weak memory
ordering like ARM.

You need to use atomic_builtin when accessing a flag shared between
threads that is not being protected by a lock.


More information about the stable mailing list