[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <91796ce2-2f63-4b07-3e44-dc2a2a98615e@linux.alibaba.com>
Date: Mon, 20 Mar 2023 10:25:12 +0800
From: Shuai Xue <xueshuai@...ux.alibaba.com>
To: "Luck, Tony" <tony.luck@...el.com>
Cc: "baolin.wang@...ux.alibaba.com" <baolin.wang@...ux.alibaba.com>,
"benjamin.cheatham@....com" <benjamin.cheatham@....com>,
"bp@...en8.de" <bp@...en8.de>,
"Williams, Dan J" <dan.j.williams@...el.com>,
"james.morse@....com" <james.morse@....com>,
"jaylu102@....com" <jaylu102@....com>,
"lenb@...nel.org" <lenb@...nel.org>,
"linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"rafael@...nel.org" <rafael@...nel.org>,
"zhuo.song@...ux.alibaba.com" <zhuo.song@...ux.alibaba.com>
Subject: Re: [PATCH] ACPI: APEI: EINJ: warn on invalid argument when
explicitly indicated by platform
On 2023/3/18 AM5:24, Luck, Tony wrote:
> - if (val != EINJ_STATUS_SUCCESS)
> + if (val == EINJ_STATUS_FAIL)
> return -EBUSY;
> + else if (val == EINJ_STATUS_INVAL)
> + return -EINVAL;
>
> The ACPI Specification is really vague here. Documented error codes are
>
> 0 = Success (Linux #define EINJ_STATUS_SUCCESS)
> 1 = Unknown failure (Linux #define EINJ_STATUS_FAIL)
> 2 = Invalid Access (Linux #define EINJ_STATUS_INVAL)
Absolutely right.
>
> I don't see how reporting -EBUSY for the "Unknown Failure" case is
> actually better.
Tony, did you misunderstand this patch?
The original code report -EBUSY for both "Unknown Failure" and
"Invalid Access" cases.
This patch intends to report -EINVAL for "Invalid Access" case
and keeps reporting -EBUSY for "Unknown Failure" case unchanged.
Although -EBUSY for "Unknown Failure" case is not a good choice.
Will -EIO for "Unknown failure" case be better?
By the way, do you think -EIO for time out case is suitable.
for (;;) {
rc = apei_exec_run(&ctx, ACPI_EINJ_CHECK_BUSY_STATUS);
if (rc)
return rc;
val = apei_exec_ctx_get_output(&ctx);
if (!(val & EINJ_OP_BUSY))
break;
if (einj_timedout(&timeout))
return -EIO;
For example, the OSPM will may warn:
Firmware does not respond in time.
And a message is printed on the console:
echo: write error: Input/output error
Will -EBUSY or -ETIME for timeout be better?
>
> -Tony
Thank you for comments.
Best Regards.
Shuai
Powered by blists - more mailing lists