From: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
To: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/2] accel/qaic: Implement quirk for SOC_HW_VERSION
Date: Mon, 11 Dec 2023 12:21:15 +0100 [thread overview]
Message-ID: <afbdf7d3-6fe8-43ee-9a1f-237f00f94b85@linux.intel.com> (raw)
In-Reply-To: <20231208163101.1295769-3-quic_jhugo@quicinc.com>
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
On 08.12.2023 17:31, Jeffrey Hugo wrote:
> The SOC_HW_VERSION register in the BHI space is not correctly initialized
> by the device and in many cases contains uninitialized data. The register
> could contain 0xFFFFFFFF which is a special value to indicate a link
> error in PCIe, therefore if observed, we could incorrectly think the
> device is down.
>
> Intercept reads for this register, and provide the correct value - every
> production instance would read 0x60110200 if the device was operating as
> intended.
>
> Fixes: a36bf7af868b ("accel/qaic: Add MHI controller")
> Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
> Reviewed-by: Pranjal Ramajor Asha Kanojiya <quic_pkanojiy@quicinc.com>
> ---
> drivers/accel/qaic/mhi_controller.c | 15 ++++++++++++++-
> 1 file changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/accel/qaic/mhi_controller.c b/drivers/accel/qaic/mhi_controller.c
> index 5036e58e7235..1405623b03e4 100644
> --- a/drivers/accel/qaic/mhi_controller.c
> +++ b/drivers/accel/qaic/mhi_controller.c
> @@ -404,8 +404,21 @@ static struct mhi_controller_config aic100_config = {
>
> static int mhi_read_reg(struct mhi_controller *mhi_cntrl, void __iomem *addr, u32 *out)
> {
> - u32 tmp = readl_relaxed(addr);
> + u32 tmp;
>
> + /*
> + * SOC_HW_VERSION quirk
> + * The SOC_HW_VERSION register (offset 0x224) is not reliable and
> + * may contain uninitialized values, including 0xFFFFFFFF. This could
> + * cause a false positive link down error. Instead, intercept any
> + * reads and provide the correct value of the register.
> + */
> + if (addr - mhi_cntrl->regs == 0x224) {
> + *out = 0x60110200;
> + return 0;
> + }
> +
> + tmp = readl_relaxed(addr);
> if (tmp == U32_MAX)
> return -EIO;
>
next prev parent reply other threads:[~2023-12-11 11:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-08 16:30 [PATCH 0/2] qaic fixes for 6.7 Jeffrey Hugo
2023-12-08 16:31 ` [PATCH 1/2] accel/qaic: Fix GEM import path code Jeffrey Hugo
2023-12-11 11:13 ` Jacek Lawrynowicz
2023-12-08 16:31 ` [PATCH 2/2] accel/qaic: Implement quirk for SOC_HW_VERSION Jeffrey Hugo
2023-12-11 11:21 ` Jacek Lawrynowicz [this message]
2023-12-15 17:43 ` [PATCH 0/2] qaic fixes for 6.7 Jeffrey Hugo
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=afbdf7d3-6fe8-43ee-9a1f-237f00f94b85@linux.intel.com \
--to=jacek.lawrynowicz@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).