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: <CRDPDHCPMF0Y.2F1OU3EK4P9NI@den-dk-m31857>
Date:   Thu, 23 Mar 2023 10:49:48 +0000
From:   <Steen.Hegelund@...rochip.com>
To:     <jiawenwu@...stnetic.com>, <netdev@...r.kernel.org>
CC:     <mengyuanlou@...-swift.com>
Subject: Re: [PATCH net] net: wangxun: Fix vector length of interrupt cause

Hi Jiawen,


On Wed Mar 22, 2023 at 11:36 AM CET, Jiawen Wu wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> There is 64-bit interrupt cause register for txgbe. Fix to clear upper
> 32 bits.
>
> Fixes: 3f703186113f ("net: libwx: Add irq flow functions")
> Signed-off-by: Jiawen Wu <jiawenwu@...stnetic.com>
> ---
>  drivers/net/ethernet/wangxun/libwx/wx_type.h    | 2 +-
>  drivers/net/ethernet/wangxun/ngbe/ngbe_main.c   | 2 +-
>  drivers/net/ethernet/wangxun/txgbe/txgbe_main.c | 3 ++-
>  3 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/wangxun/libwx/wx_type.h b/drivers/net/ethernet/wangxun/libwx/wx_type.h
> index 77d8d7f1707e..97e2c1e13b80 100644
> --- a/drivers/net/ethernet/wangxun/libwx/wx_type.h
> +++ b/drivers/net/ethernet/wangxun/libwx/wx_type.h
> @@ -222,7 +222,7 @@
>  #define WX_PX_INTA                   0x110
>  #define WX_PX_GPIE                   0x118
>  #define WX_PX_GPIE_MODEL             BIT(0)
> -#define WX_PX_IC                     0x120
> +#define WX_PX_IC(_i)                 (0x120 + (_i) * 4)
>  #define WX_PX_IMS(_i)                (0x140 + (_i) * 4)
>  #define WX_PX_IMC(_i)                (0x150 + (_i) * 4)
>  #define WX_PX_ISB_ADDR_L             0x160
> diff --git a/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c b/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c
> index 5b564d348c09..17412e5282de 100644
> --- a/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c
> +++ b/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c
> @@ -352,7 +352,7 @@ static void ngbe_up(struct wx *wx)
>         netif_tx_start_all_queues(wx->netdev);
>
>         /* clear any pending interrupts, may auto mask */
> -       rd32(wx, WX_PX_IC);
> +       rd32(wx, WX_PX_IC(0));

Here you only clear irq 0 but not 1...

>         rd32(wx, WX_PX_MISC_IC);
>         ngbe_irq_enable(wx, true);
>         if (wx->gpio_ctrl)
> diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
> index 6c0a98230557..a58ce5463686 100644
> --- a/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
> +++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
> @@ -229,7 +229,8 @@ static void txgbe_up_complete(struct wx *wx)
>         wx_napi_enable_all(wx);
>
>         /* clear any pending interrupts, may auto mask */
> -       rd32(wx, WX_PX_IC);
> +       rd32(wx, WX_PX_IC(0));
> +       rd32(wx, WX_PX_IC(1));

Here you clear irq 0 and 1

>         rd32(wx, WX_PX_MISC_IC);
>         txgbe_irq_enable(wx, true);
>
> --
> 2.27.0

Why is there a difference between the two situations?

BR
Steen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ