All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] firmware: arm_scmi: Add delayed response status check
@ 2021-06-08 10:30 ` Cristian Marussi
  0 siblings, 0 replies; 6+ messages in thread
From: Cristian Marussi @ 2021-06-08 10:30 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel; +Cc: sudeep.holla, cristian.marussi

A successfully received delayed response could anyway report a failure at
the protocol layer in the message status field.

Add a check also for this error condition.

Fixes: 58ecdf03dbb9 ("firmware: arm_scmi: Add support for asynchronous commands and delayed response")
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
---
 drivers/firmware/arm_scmi/driver.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
index 759ae4a23e74..6826d516e4eb 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -519,8 +519,12 @@ static int do_xfer_with_response(const struct scmi_protocol_handle *ph,
 	xfer->async_done = &async_response;
 
 	ret = do_xfer(ph, xfer);
-	if (!ret && !wait_for_completion_timeout(xfer->async_done, timeout))
-		ret = -ETIMEDOUT;
+	if (!ret) {
+		if (!wait_for_completion_timeout(xfer->async_done, timeout))
+			ret = -ETIMEDOUT;
+		else if (xfer->hdr.status)
+			ret = scmi_to_linux_errno(xfer->hdr.status);
+	}
 
 	xfer->async_done = NULL;
 	return ret;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] firmware: arm_scmi: Add delayed response status check
@ 2021-06-08 10:30 ` Cristian Marussi
  0 siblings, 0 replies; 6+ messages in thread
From: Cristian Marussi @ 2021-06-08 10:30 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel; +Cc: sudeep.holla, cristian.marussi

A successfully received delayed response could anyway report a failure at
the protocol layer in the message status field.

Add a check also for this error condition.

Fixes: 58ecdf03dbb9 ("firmware: arm_scmi: Add support for asynchronous commands and delayed response")
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
---
 drivers/firmware/arm_scmi/driver.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
index 759ae4a23e74..6826d516e4eb 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -519,8 +519,12 @@ static int do_xfer_with_response(const struct scmi_protocol_handle *ph,
 	xfer->async_done = &async_response;
 
 	ret = do_xfer(ph, xfer);
-	if (!ret && !wait_for_completion_timeout(xfer->async_done, timeout))
-		ret = -ETIMEDOUT;
+	if (!ret) {
+		if (!wait_for_completion_timeout(xfer->async_done, timeout))
+			ret = -ETIMEDOUT;
+		else if (xfer->hdr.status)
+			ret = scmi_to_linux_errno(xfer->hdr.status);
+	}
 
 	xfer->async_done = NULL;
 	return ret;
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] firmware: arm_scmi: Add delayed response status check
  2021-06-08 10:30 ` Cristian Marussi
@ 2021-06-09 20:46   ` Sudeep Holla
  -1 siblings, 0 replies; 6+ messages in thread
From: Sudeep Holla @ 2021-06-09 20:46 UTC (permalink / raw)
  To: linux-arm-kernel, Cristian Marussi, linux-kernel; +Cc: Sudeep Holla

On Tue, 8 Jun 2021 11:30:56 +0100, Cristian Marussi wrote:
> A successfully received delayed response could anyway report a failure at
> the protocol layer in the message status field.
> 
> Add a check also for this error condition.

Applied to sudeep.holla/linux (master), thanks!

[1/1] firmware: arm_scmi: Add delayed response status check
      https://git.kernel.org/sudeep.holla/c/f1748b1ee1

--
Regards,
Sudeep


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] firmware: arm_scmi: Add delayed response status check
@ 2021-06-09 20:46   ` Sudeep Holla
  0 siblings, 0 replies; 6+ messages in thread
From: Sudeep Holla @ 2021-06-09 20:46 UTC (permalink / raw)
  To: linux-arm-kernel, Cristian Marussi, linux-kernel; +Cc: Sudeep Holla

On Tue, 8 Jun 2021 11:30:56 +0100, Cristian Marussi wrote:
> A successfully received delayed response could anyway report a failure at
> the protocol layer in the message status field.
> 
> Add a check also for this error condition.

Applied to sudeep.holla/linux (master), thanks!

[1/1] firmware: arm_scmi: Add delayed response status check
      https://git.kernel.org/sudeep.holla/c/f1748b1ee1

--
Regards,
Sudeep


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] firmware: arm_scmi: Add delayed response status check
  2021-08-04 11:35 Cristian Marussi
@ 2021-08-06  6:24 ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2021-08-06  6:24 UTC (permalink / raw)
  To: Cristian Marussi; +Cc: stable, sashal, Sudeep Holla

On Wed, Aug 04, 2021 at 12:35:55PM +0100, Cristian Marussi wrote:
> [ Upstream commit f1748b1ee1fa0fd1a074504045b530b62f949188 ]
> 
> A successfully received delayed response could anyway report a failure at
> the protocol layer in the message status field.
> 
> Add a check also for this error condition.
> 
> Cc: <stable@vger.kernel.org> # v5.4+
> Link: https://lore.kernel.org/r/20210608103056.3388-1-cristian.marussi@arm.com
> Fixes: 58ecdf03dbb9 ("firmware: arm_scmi: Add support for asynchronous commands and delayed response")
> Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
> Upstream commit f1748b1ee1fa0fd1a074504045b530b62f949188 has been already
> applied to stable/linux-5.13.y, this is a backport with conflicts resolved
> for v5.4 and v5.10 (The code fixed here was introduced after v4.19)

All now queued up, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] firmware: arm_scmi: Add delayed response status check
@ 2021-08-04 11:35 Cristian Marussi
  2021-08-06  6:24 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Cristian Marussi @ 2021-08-04 11:35 UTC (permalink / raw)
  To: stable; +Cc: gregkh, sashal, cristian.marussi, Sudeep Holla

[ Upstream commit f1748b1ee1fa0fd1a074504045b530b62f949188 ]

A successfully received delayed response could anyway report a failure at
the protocol layer in the message status field.

Add a check also for this error condition.

Cc: <stable@vger.kernel.org> # v5.4+
Link: https://lore.kernel.org/r/20210608103056.3388-1-cristian.marussi@arm.com
Fixes: 58ecdf03dbb9 ("firmware: arm_scmi: Add support for asynchronous commands and delayed response")
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
Upstream commit f1748b1ee1fa0fd1a074504045b530b62f949188 has been already
applied to stable/linux-5.13.y, this is a backport with conflicts resolved
for v5.4 and v5.10 (The code fixed here was introduced after v4.19)
---
 drivers/firmware/arm_scmi/driver.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
index 48e6e2b48924..4e43bdfa041f 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -515,8 +515,12 @@ int scmi_do_xfer_with_response(const struct scmi_handle *handle,
 	xfer->async_done = &async_response;
 
 	ret = scmi_do_xfer(handle, xfer);
-	if (!ret && !wait_for_completion_timeout(xfer->async_done, timeout))
-		ret = -ETIMEDOUT;
+	if (!ret) {
+		if (!wait_for_completion_timeout(xfer->async_done, timeout))
+			ret = -ETIMEDOUT;
+		else if (xfer->hdr.status)
+			ret = scmi_to_linux_errno(xfer->hdr.status);
+	}
 
 	xfer->async_done = NULL;
 	return ret;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-08-06  6:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-08 10:30 [PATCH] firmware: arm_scmi: Add delayed response status check Cristian Marussi
2021-06-08 10:30 ` Cristian Marussi
2021-06-09 20:46 ` Sudeep Holla
2021-06-09 20:46   ` Sudeep Holla
2021-08-04 11:35 Cristian Marussi
2021-08-06  6:24 ` Greg KH

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.