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] [day] [month] [year] [list]
Message-ID: <8e9cfab2-4ab2-698f-36f7-b191c5ea8a0a@microchip.com>
Date:   Sat, 19 Nov 2022 21:55:44 +0000
From:   <Conor.Dooley@...rochip.com>
To:     <conor@...nel.org>, <jassisinghbrar@...il.com>
CC:     <Daire.McNamara@...rochip.com>, <linux-riscv@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 2/2] mailbox: mpfs: read the system controller's status

On 18/11/2022 22:20, Conor Dooley wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> From: Conor Dooley <conor.dooley@...rochip.com>
> 
> Some services explicitly return an error code in their response, but
> others rely on the system controller to set a status in its status
> register. The meaning of the bits varies based on what service is
> requested, so pass it back up to the driver that requested the service
> in the first place. The field in the message struct already existed, but
> was unused until now.
> 
> If the system controller is busy, in which case we should never actually
> be in the interrupt handler, or if the service fails the mailbox itself
> should not be read. Callers should check the status before operating on
> the response.
> 
> Fixes: 83d7b1560810 ("mbox: add polarfire soc system controller mailbox")
> Signed-off-by: Conor Dooley <conor.dooley@...rochip.com>
> ---
>  drivers/mailbox/mailbox-mpfs.c | 31 +++++++++++++++++++++++++++++--
>  1 file changed, 29 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mailbox/mailbox-mpfs.c b/drivers/mailbox/mailbox-mpfs.c
> index cfacb3f320a6..6b99abac0b11 100644
> --- a/drivers/mailbox/mailbox-mpfs.c
> +++ b/drivers/mailbox/mailbox-mpfs.c
> @@ -2,7 +2,7 @@
>  /*
>   * Microchip PolarFire SoC (MPFS) system controller/mailbox controller driver
>   *
> - * Copyright (c) 2020 Microchip Corporation. All rights reserved.
> + * Copyright (c) 2020-2022 Microchip Corporation. All rights reserved.
>   *
>   * Author: Conor Dooley <conor.dooley@...rochip.com>
>   *
> @@ -23,6 +23,8 @@
>  #define MAILBOX_REG_OFFSET             0x800u
>  #define MSS_SYS_MAILBOX_DATA_OFFSET    0u
>  #define SCB_MASK_WIDTH                 16u
> +#define SCB_STATUS_SHIFT               16u
> +#define SCB_STATUS_MASK                        GENMASK(31, SCB_STATUS_SHIFT)

*sigh* these macros aren't needed & generate some -Wmacro-redefined issues.
I'll do a v3 in a few days.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ