From: Shiju Jose <shiju.jose@huawei.com>
To: Daniel Ferguson <danielf@os.amperecomputing.com>,
"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>
Cc: "bp@alien8.de" <bp@alien8.de>,
"rafael@kernel.org" <rafael@kernel.org>,
"tony.luck@intel.com" <tony.luck@intel.com>,
"lenb@kernel.org" <lenb@kernel.org>,
"leo.duran@amd.com" <leo.duran@amd.com>,
"Yazen.Ghannam@amd.com" <Yazen.Ghannam@amd.com>,
"mchehab@kernel.org" <mchehab@kernel.org>,
Jonathan Cameron <jonathan.cameron@huawei.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
Linuxarm <linuxarm@huawei.com>,
"rientjes@google.com" <rientjes@google.com>,
"jiaqiyan@google.com" <jiaqiyan@google.com>,
"Jon.Grimm@amd.com" <Jon.Grimm@amd.com>,
"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
"naoya.horiguchi@nec.com" <naoya.horiguchi@nec.com>,
"james.morse@arm.com" <james.morse@arm.com>,
"jthoughton@google.com" <jthoughton@google.com>,
"somasundaram.a@hpe.com" <somasundaram.a@hpe.com>,
"erdemaktas@google.com" <erdemaktas@google.com>,
"pgonda@google.com" <pgonda@google.com>,
"duenwen@google.com" <duenwen@google.com>,
"gthelen@google.com" <gthelen@google.com>,
"wschwartz@amperecomputing.com" <wschwartz@amperecomputing.com>,
"dferguson@amperecomputing.com" <dferguson@amperecomputing.com>,
"wbs@os.amperecomputing.com" <wbs@os.amperecomputing.com>,
"nifan.cxl@gmail.com" <nifan.cxl@gmail.com>,
tanxiaofei <tanxiaofei@huawei.com>,
"Zengtao (B)" <prime.zeng@hisilicon.com>,
Roberto Sassu <roberto.sassu@huawei.com>,
"kangkang.shen@futurewei.com" <kangkang.shen@futurewei.com>,
wanghuiqiang <wanghuiqiang@huawei.com>
Subject: RE: [PATCH v6 1/2] ACPI:RAS2: Add ACPI RAS2 driver
Date: Mon, 19 May 2025 12:12:41 +0000 [thread overview]
Message-ID: <a98451bf422e4dcba7bb0075fa892e5b@huawei.com> (raw)
In-Reply-To: <51bcb52c-4132-4daf-8903-29b121c485a1@os.amperecomputing.com>
>-----Original Message-----
>From: Daniel Ferguson <danielf@os.amperecomputing.com>
>Sent: 16 May 2025 20:05
>To: Shiju Jose <shiju.jose@huawei.com>; linux-edac@vger.kernel.org; linux-
>acpi@vger.kernel.org; linux-doc@vger.kernel.org
>Cc: bp@alien8.de; rafael@kernel.org; tony.luck@intel.com; lenb@kernel.org;
>leo.duran@amd.com; Yazen.Ghannam@amd.com; mchehab@kernel.org;
>Jonathan Cameron <jonathan.cameron@huawei.com>; linux-mm@kvack.org;
>Linuxarm <linuxarm@huawei.com>; rientjes@google.com;
>jiaqiyan@google.com; Jon.Grimm@amd.com; dave.hansen@linux.intel.com;
>naoya.horiguchi@nec.com; james.morse@arm.com; jthoughton@google.com;
>somasundaram.a@hpe.com; erdemaktas@google.com; pgonda@google.com;
>duenwen@google.com; gthelen@google.com;
>wschwartz@amperecomputing.com; dferguson@amperecomputing.com;
>wbs@os.amperecomputing.com; nifan.cxl@gmail.com; tanxiaofei
><tanxiaofei@huawei.com>; Zengtao (B) <prime.zeng@hisilicon.com>; Roberto
>Sassu <roberto.sassu@huawei.com>; kangkang.shen@futurewei.com;
>wanghuiqiang <wanghuiqiang@huawei.com>
>Subject: Re: [PATCH v6 1/2] ACPI:RAS2: Add ACPI RAS2 driver
>
>> +static int ras2_check_pcc_chan(struct ras2_pcc_subspace
>> +*pcc_subspace) {
>> + struct acpi_ras2_shmem __iomem *gen_comm_base = pcc_subspace-
>>comm_addr;
>> + u32 cap_status;
>> + u16 status;
>> + u32 rc;
>> +
>> + /*
>> + * As per ACPI spec, the PCC space will be initialized by
>> + * platform and should have set the command completion bit when
>> + * PCC can be used by OSPM.
>> + *
>> + * Poll PCC status register every 3us(delay_us) for maximum of
>> + * deadline_us(timeout_us) until PCC command complete bit is
>set(cond).
>> + */
>> + rc = readw_relaxed_poll_timeout(&gen_comm_base->status, status,
>> + status &
>PCC_STATUS_CMD_COMPLETE, 3,
>> + pcc_subspace->deadline_us);
>> + if (rc) {
>> + pr_warn("PCC check channel failed for : %d rc=%d\n",
>> + pcc_subspace->pcc_id, rc);
>> + return rc;
>> + }
>> +
>> + if (status & PCC_STATUS_ERROR) {
>> + cap_status = readw_relaxed(&gen_comm_base-
>>set_caps_status);
>> + rc = ras2_report_cap_error(cap_status);
>> +
>> + status &= ~PCC_STATUS_ERROR;
>> + writew_relaxed(status, &gen_comm_base->status);
>> + return rc;
>> + }
>> +
>> + if (status & PCC_STATUS_CMD_COMPLETE)
>> + return 0;
>> +
>> + return -EIO;
>> +}
>
>Hi, I'm terribly sorry for the late churn
>
>It is our current belief that checking the set_caps_status is not dependent on if
>the PCC_STATUS_ERROR bit is set. It seems to us, that the PCC_STATUS_ERROR
>bit should only be set if there is a problem with the PCC protocol. We've
>interpreted the set_caps_status as a capability specific error reporting
>mechanism. We have tested the following amendment to this flow, and urge you
>to consider this change, or a functionally equivalent one:
Thanks Daniel for the suggestion. I have tested with the changes and will incorporate
in v7.
Thanks,
Shiju
>
>diff --git a/drivers/acpi/ras2.c b/drivers/acpi/ras2.c index
>6bbb0091b4b3..3f73c9ff33a3 100644
>--- a/drivers/acpi/ras2.c
>+++ b/drivers/acpi/ras2.c
>@@ -116,18 +116,20 @@ static int ras2_check_pcc_chan(struct
>ras2_pcc_subspace
>*pcc_subspace)
> }
>
> if (status & PCC_STATUS_ERROR) {
>- cap_status = readw_relaxed(&gen_comm_base->set_caps_status);
>- rc = ras2_report_cap_error(cap_status);
>-
> status &= ~PCC_STATUS_ERROR;
> writew_relaxed(status, &gen_comm_base->status);
>- return rc;
>+ return -EIO;
> }
>
>- if (status & PCC_STATUS_CMD_COMPLETE)
>- return 0;
>
>- return -EIO;
>+ if (!(status & PCC_STATUS_CMD_COMPLETE))
>+ return -EIO;
>+
>+ // Cache, Clear, and Report feature specific status
>+ cap_status = readw_relaxed(&gen_comm_base->set_caps_status);
>+ writew_relaxed(0x0, &gen_comm_base->set_caps_status);
>+ rc = ras2_report_cap_error(cap_status);
>+ return rc;
> }
>
>Thanks again,
>~Daniel
next prev parent reply other threads:[~2025-05-19 12:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-16 13:22 [PATCH v6 0/2] ACPI: Add support for ACPI RAS2 feature table shiju.jose
2025-05-16 13:22 ` [PATCH v6 1/2] ACPI:RAS2: Add ACPI RAS2 driver shiju.jose
2025-05-16 19:04 ` Daniel Ferguson
2025-05-19 12:12 ` Shiju Jose [this message]
2025-05-16 13:22 ` [PATCH v6 2/2] ras: mem: Add memory " shiju.jose
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=a98451bf422e4dcba7bb0075fa892e5b@huawei.com \
--to=shiju.jose@huawei.com \
--cc=Jon.Grimm@amd.com \
--cc=Yazen.Ghannam@amd.com \
--cc=bp@alien8.de \
--cc=danielf@os.amperecomputing.com \
--cc=dave.hansen@linux.intel.com \
--cc=dferguson@amperecomputing.com \
--cc=duenwen@google.com \
--cc=erdemaktas@google.com \
--cc=gthelen@google.com \
--cc=james.morse@arm.com \
--cc=jiaqiyan@google.com \
--cc=jonathan.cameron@huawei.com \
--cc=jthoughton@google.com \
--cc=kangkang.shen@futurewei.com \
--cc=lenb@kernel.org \
--cc=leo.duran@amd.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-edac@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linuxarm@huawei.com \
--cc=mchehab@kernel.org \
--cc=naoya.horiguchi@nec.com \
--cc=nifan.cxl@gmail.com \
--cc=pgonda@google.com \
--cc=prime.zeng@hisilicon.com \
--cc=rafael@kernel.org \
--cc=rientjes@google.com \
--cc=roberto.sassu@huawei.com \
--cc=somasundaram.a@hpe.com \
--cc=tanxiaofei@huawei.com \
--cc=tony.luck@intel.com \
--cc=wanghuiqiang@huawei.com \
--cc=wbs@os.amperecomputing.com \
--cc=wschwartz@amperecomputing.com \
/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 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.