From: <Conor.Dooley@microchip.com>
To: <conor@kernel.org>, <jassisinghbrar@gmail.com>
Cc: <Daire.McNamara@microchip.com>, <linux-riscv@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 2/2] mailbox: mpfs: read the system controller's status
Date: Sat, 19 Nov 2022 21:55:44 +0000 [thread overview]
Message-ID: <8e9cfab2-4ab2-698f-36f7-b191c5ea8a0a@microchip.com> (raw)
In-Reply-To: <20221118222043.1214776-3-conor@kernel.org>
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@microchip.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@microchip.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@microchip.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.
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
prev parent reply other threads:[~2022-11-19 21:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-18 22:20 [PATCH v2 0/2] mpfs: fix handling failed service requests Conor Dooley
2022-11-18 22:20 ` [PATCH v2 1/2] soc: microchip: mpfs: handle failed system " Conor Dooley
2022-11-18 22:20 ` [PATCH v2 2/2] mailbox: mpfs: read the system controller's status Conor Dooley
2022-11-19 21:55 ` Conor.Dooley [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8e9cfab2-4ab2-698f-36f7-b191c5ea8a0a@microchip.com \
--to=conor.dooley@microchip.com \
--cc=Daire.McNamara@microchip.com \
--cc=conor@kernel.org \
--cc=jassisinghbrar@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox