* [PATCH] fsi: scom: Reset the FSI2PIB engine for any error
@ 2021-03-29 15:13 Eddie James
2021-05-27 6:47 ` Joel Stanley
0 siblings, 1 reply; 2+ messages in thread
From: Eddie James @ 2021-03-29 15:13 UTC (permalink / raw)
To: joel; +Cc: jk, alistair, linux-fsi, linux-kernel, Eddie James
The error bits in the FSI2PIB status are only cleared by a reset. So
the driver needs to perform a reset after seeing any of the FSI2PIB
errors, otherwise subsequent operations will also look like failures.
Fixes: 6b293258cded ("fsi: scom: Major overhaul")
Signed-off-by: Eddie James <eajames@linux.ibm.com>
---
drivers/fsi/fsi-scom.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/fsi/fsi-scom.c b/drivers/fsi/fsi-scom.c
index b45bfab7b7f5..75d1389e2626 100644
--- a/drivers/fsi/fsi-scom.c
+++ b/drivers/fsi/fsi-scom.c
@@ -38,9 +38,10 @@
#define SCOM_STATUS_PIB_RESP_MASK 0x00007000
#define SCOM_STATUS_PIB_RESP_SHIFT 12
-#define SCOM_STATUS_ANY_ERR (SCOM_STATUS_PROTECTION | \
- SCOM_STATUS_PARITY | \
- SCOM_STATUS_PIB_ABORT | \
+#define SCOM_STATUS_FSI2PIB_ERROR (SCOM_STATUS_PROTECTION | \
+ SCOM_STATUS_PARITY | \
+ SCOM_STATUS_PIB_ABORT)
+#define SCOM_STATUS_ANY_ERR (SCOM_STATUS_FSI2PIB_ERROR | \
SCOM_STATUS_PIB_RESP_MASK)
/* SCOM address encodings */
#define XSCOM_ADDR_IND_FLAG BIT_ULL(63)
@@ -240,13 +241,14 @@ static int handle_fsi2pib_status(struct scom_device *scom, uint32_t status)
{
uint32_t dummy = -1;
- if (status & SCOM_STATUS_PROTECTION)
- return -EPERM;
- if (status & SCOM_STATUS_PARITY) {
+ if (status & SCOM_STATUS_FSI2PIB_ERROR)
fsi_device_write(scom->fsi_dev, SCOM_FSI2PIB_RESET_REG, &dummy,
sizeof(uint32_t));
+
+ if (status & SCOM_STATUS_PROTECTION)
+ return -EPERM;
+ if (status & SCOM_STATUS_PARITY)
return -EIO;
- }
/* Return -EBUSY on PIB abort to force a retry */
if (status & SCOM_STATUS_PIB_ABORT)
return -EBUSY;
--
2.27.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fsi: scom: Reset the FSI2PIB engine for any error
2021-03-29 15:13 [PATCH] fsi: scom: Reset the FSI2PIB engine for any error Eddie James
@ 2021-05-27 6:47 ` Joel Stanley
0 siblings, 0 replies; 2+ messages in thread
From: Joel Stanley @ 2021-05-27 6:47 UTC (permalink / raw)
To: Eddie James
Cc: Jeremy Kerr, Alistair Popple, linux-fsi, Linux Kernel Mailing List
On Mon, 29 Mar 2021 at 15:13, Eddie James <eajames@linux.ibm.com> wrote:
>
> The error bits in the FSI2PIB status are only cleared by a reset. So
> the driver needs to perform a reset after seeing any of the FSI2PIB
> errors, otherwise subsequent operations will also look like failures.
>
> Fixes: 6b293258cded ("fsi: scom: Major overhaul")
> Signed-off-by: Eddie James <eajames@linux.ibm.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
I've got some other FSI fixes that I will send out shortly. I will
include this one in that series to ensure it gets applied.
> ---
> drivers/fsi/fsi-scom.c | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/fsi/fsi-scom.c b/drivers/fsi/fsi-scom.c
> index b45bfab7b7f5..75d1389e2626 100644
> --- a/drivers/fsi/fsi-scom.c
> +++ b/drivers/fsi/fsi-scom.c
> @@ -38,9 +38,10 @@
> #define SCOM_STATUS_PIB_RESP_MASK 0x00007000
> #define SCOM_STATUS_PIB_RESP_SHIFT 12
>
> -#define SCOM_STATUS_ANY_ERR (SCOM_STATUS_PROTECTION | \
> - SCOM_STATUS_PARITY | \
> - SCOM_STATUS_PIB_ABORT | \
> +#define SCOM_STATUS_FSI2PIB_ERROR (SCOM_STATUS_PROTECTION | \
> + SCOM_STATUS_PARITY | \
> + SCOM_STATUS_PIB_ABORT)
> +#define SCOM_STATUS_ANY_ERR (SCOM_STATUS_FSI2PIB_ERROR | \
> SCOM_STATUS_PIB_RESP_MASK)
> /* SCOM address encodings */
> #define XSCOM_ADDR_IND_FLAG BIT_ULL(63)
> @@ -240,13 +241,14 @@ static int handle_fsi2pib_status(struct scom_device *scom, uint32_t status)
> {
> uint32_t dummy = -1;
>
> - if (status & SCOM_STATUS_PROTECTION)
> - return -EPERM;
> - if (status & SCOM_STATUS_PARITY) {
> + if (status & SCOM_STATUS_FSI2PIB_ERROR)
> fsi_device_write(scom->fsi_dev, SCOM_FSI2PIB_RESET_REG, &dummy,
> sizeof(uint32_t));
> +
> + if (status & SCOM_STATUS_PROTECTION)
> + return -EPERM;
> + if (status & SCOM_STATUS_PARITY)
> return -EIO;
> - }
> /* Return -EBUSY on PIB abort to force a retry */
> if (status & SCOM_STATUS_PIB_ABORT)
> return -EBUSY;
> --
> 2.27.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-27 6:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-29 15:13 [PATCH] fsi: scom: Reset the FSI2PIB engine for any error Eddie James
2021-05-27 6:47 ` Joel Stanley
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.