public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Drivers: hv: Use -ETIMEDOUT for HV_STATUS_TIME_OUT instead of -EIO
@ 2025-10-02 22:13 Easwar Hariharan
  2025-10-02 22:30 ` Easwar Hariharan
  2025-10-02 22:37 ` Stanislav Kinsburskii
  0 siblings, 2 replies; 4+ messages in thread
From: Easwar Hariharan @ 2025-10-02 22:13 UTC (permalink / raw)
  To: K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui,
	Nuno Das Neves, Stanislav Kinsburskii,
	open list:Hyper-V/Azure CORE AND DRIVERS, open list
  Cc: Easwar Hariharan

Use the -ETIMEDOUT errno value as the correct 1:1 match for the
hypervisor timeout status

Fixes: 3817854ba89201 ("hyperv: Log hypercall status codes as strings")
Signed-off-by: Easwar Hariharan <easwar.hariharan@linux.microsoft.com>
---
 drivers/hv/hv_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hv/hv_common.c b/drivers/hv/hv_common.c
index 49898d10fafff..9b51b67d54cc8 100644
--- a/drivers/hv/hv_common.c
+++ b/drivers/hv/hv_common.c
@@ -781,7 +781,7 @@ static const struct hv_status_info hv_status_infos[] = {
 	_STATUS_INFO(HV_STATUS_INVALID_LP_INDEX,		-EIO),
 	_STATUS_INFO(HV_STATUS_INVALID_REGISTER_VALUE,		-EIO),
 	_STATUS_INFO(HV_STATUS_OPERATION_FAILED,		-EIO),
-	_STATUS_INFO(HV_STATUS_TIME_OUT,			-EIO),
+	_STATUS_INFO(HV_STATUS_TIME_OUT,			-ETIMEDOUT),
 	_STATUS_INFO(HV_STATUS_CALL_PENDING,			-EIO),
 	_STATUS_INFO(HV_STATUS_VTL_ALREADY_ENABLED,		-EIO),
 #undef _STATUS_INFO
-- 
2.43.0


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

* Re: [PATCH] Drivers: hv: Use -ETIMEDOUT for HV_STATUS_TIME_OUT instead of -EIO
  2025-10-02 22:13 [PATCH] Drivers: hv: Use -ETIMEDOUT for HV_STATUS_TIME_OUT instead of -EIO Easwar Hariharan
@ 2025-10-02 22:30 ` Easwar Hariharan
  2025-10-02 22:37 ` Stanislav Kinsburskii
  1 sibling, 0 replies; 4+ messages in thread
From: Easwar Hariharan @ 2025-10-02 22:30 UTC (permalink / raw)
  To: K. Y. Srinivasan
  Cc: Haiyang Zhang, Wei Liu, Dexuan Cui, Nuno Das Neves,
	Stanislav Kinsburskii, open list:Hyper-V/Azure CORE AND DRIVERS,
	open list, easwar.hariharan

On 10/2/2025 3:13 PM, Easwar Hariharan wrote:
> Use the -ETIMEDOUT errno value as the correct 1:1 match for the
> hypervisor timeout status
> 
> Fixes: 3817854ba89201 ("hyperv: Log hypercall status codes as strings")
> Signed-off-by: Easwar Hariharan <easwar.hariharan@linux.microsoft.com>
> ---
>  drivers/hv/hv_common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hv/hv_common.c b/drivers/hv/hv_common.c
> index 49898d10fafff..9b51b67d54cc8 100644
> --- a/drivers/hv/hv_common.c
> +++ b/drivers/hv/hv_common.c
> @@ -781,7 +781,7 @@ static const struct hv_status_info hv_status_infos[] = {
>  	_STATUS_INFO(HV_STATUS_INVALID_LP_INDEX,		-EIO),
>  	_STATUS_INFO(HV_STATUS_INVALID_REGISTER_VALUE,		-EIO),
>  	_STATUS_INFO(HV_STATUS_OPERATION_FAILED,		-EIO),
> -	_STATUS_INFO(HV_STATUS_TIME_OUT,			-EIO),
> +	_STATUS_INFO(HV_STATUS_TIME_OUT,			-ETIMEDOUT),
>  	_STATUS_INFO(HV_STATUS_CALL_PENDING,			-EIO),
>  	_STATUS_INFO(HV_STATUS_VTL_ALREADY_ENABLED,		-EIO),
>  #undef _STATUS_INFO

Actually looking at the whole struct, it may be useful to also change at least some of
 the following codes?

        _STATUS_INFO(HV_STATUS_INVALID_ALIGNMENT,               -EIO), -> EINVAL
        _STATUS_INFO(HV_STATUS_ACCESS_DENIED,                   -EIO), -> EACCES
        _STATUS_INFO(HV_STATUS_INVALID_PARTITION_STATE,         -EIO), -> EINVAL
        _STATUS_INFO(HV_STATUS_OPERATION_DENIED,                -EIO), -> EACCES
        _STATUS_INFO(HV_STATUS_PROPERTY_VALUE_OUT_OF_RANGE,     -EIO), -> ERANGE
        _STATUS_INFO(HV_STATUS_INSUFFICIENT_BUFFERS,            -EIO), -> ENOBUFS
        _STATUS_INFO(HV_STATUS_NOT_ACKNOWLEDGED,                -EIO), -> EBUSY
        _STATUS_INFO(HV_STATUS_INVALID_VP_STATE,                -EIO), -> EINVAL
        _STATUS_INFO(HV_STATUS_INVALID_LP_INDEX,                -EIO), -> EINVAL
        _STATUS_INFO(HV_STATUS_INVALID_REGISTER_VALUE,          -EIO), -> EINVAL
        _STATUS_INFO(HV_STATUS_VTL_ALREADY_ENABLED,             -EIO), -> EBUSY

Nuno, Stas, others, what do you think?

Thanks,
Easwar (he/him)

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

* Re: [PATCH] Drivers: hv: Use -ETIMEDOUT for HV_STATUS_TIME_OUT instead of -EIO
  2025-10-02 22:13 [PATCH] Drivers: hv: Use -ETIMEDOUT for HV_STATUS_TIME_OUT instead of -EIO Easwar Hariharan
  2025-10-02 22:30 ` Easwar Hariharan
@ 2025-10-02 22:37 ` Stanislav Kinsburskii
  2025-10-02 23:06   ` Easwar Hariharan
  1 sibling, 1 reply; 4+ messages in thread
From: Stanislav Kinsburskii @ 2025-10-02 22:37 UTC (permalink / raw)
  To: Easwar Hariharan
  Cc: K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui,
	Nuno Das Neves, open list:Hyper-V/Azure CORE AND DRIVERS,
	open list

On Thu, Oct 02, 2025 at 10:13:46PM +0000, Easwar Hariharan wrote:
> Use the -ETIMEDOUT errno value as the correct 1:1 match for the
> hypervisor timeout status
> 

The commit message should answer the question why this change is being
made.
Is there a practical reason for this or is it only for consistensy?

Thanks,
Stanislav

> Fixes: 3817854ba89201 ("hyperv: Log hypercall status codes as strings")
> Signed-off-by: Easwar Hariharan <easwar.hariharan@linux.microsoft.com>
> ---
>  drivers/hv/hv_common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hv/hv_common.c b/drivers/hv/hv_common.c
> index 49898d10fafff..9b51b67d54cc8 100644
> --- a/drivers/hv/hv_common.c
> +++ b/drivers/hv/hv_common.c
> @@ -781,7 +781,7 @@ static const struct hv_status_info hv_status_infos[] = {
>  	_STATUS_INFO(HV_STATUS_INVALID_LP_INDEX,		-EIO),
>  	_STATUS_INFO(HV_STATUS_INVALID_REGISTER_VALUE,		-EIO),
>  	_STATUS_INFO(HV_STATUS_OPERATION_FAILED,		-EIO),
> -	_STATUS_INFO(HV_STATUS_TIME_OUT,			-EIO),
> +	_STATUS_INFO(HV_STATUS_TIME_OUT,			-ETIMEDOUT),
>  	_STATUS_INFO(HV_STATUS_CALL_PENDING,			-EIO),
>  	_STATUS_INFO(HV_STATUS_VTL_ALREADY_ENABLED,		-EIO),
>  #undef _STATUS_INFO
> -- 
> 2.43.0

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

* Re: [PATCH] Drivers: hv: Use -ETIMEDOUT for HV_STATUS_TIME_OUT instead of -EIO
  2025-10-02 22:37 ` Stanislav Kinsburskii
@ 2025-10-02 23:06   ` Easwar Hariharan
  0 siblings, 0 replies; 4+ messages in thread
From: Easwar Hariharan @ 2025-10-02 23:06 UTC (permalink / raw)
  To: Stanislav Kinsburskii
  Cc: easwar.hariharan, K. Y. Srinivasan, Haiyang Zhang, Wei Liu,
	Dexuan Cui, Nuno Das Neves,
	open list:Hyper-V/Azure CORE AND DRIVERS, open list

On 10/2/2025 3:37 PM, Stanislav Kinsburskii wrote:
> On Thu, Oct 02, 2025 at 10:13:46PM +0000, Easwar Hariharan wrote:
>> Use the -ETIMEDOUT errno value as the correct 1:1 match for the
>> hypervisor timeout status
>>
> 
> The commit message should answer the question why this change is being
> made.
> Is there a practical reason for this or is it only for consistensy?
> 
<snip>

It's for consistency and because it's a better match. See my sibling response
for other error codes that I can also fix in a v2.

Thanks,
Easwar (he/him)

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

end of thread, other threads:[~2025-10-02 23:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-02 22:13 [PATCH] Drivers: hv: Use -ETIMEDOUT for HV_STATUS_TIME_OUT instead of -EIO Easwar Hariharan
2025-10-02 22:30 ` Easwar Hariharan
2025-10-02 22:37 ` Stanislav Kinsburskii
2025-10-02 23:06   ` Easwar Hariharan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox