From: Manivannan Sadhasivam <mani@kernel.org>
To: Jeffrey Hugo <quic_jhugo@quicinc.com>
Cc: mani@kernel.org, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org, mhi@lists.linux.dev
Subject: Re: [PATCH v2 0/2] Add MHI quirk for QAIC
Date: Thu, 8 Jun 2023 17:29:28 +0530 [thread overview]
Message-ID: <20230608115928.GA5672@thinkpad> (raw)
In-Reply-To: <20230519163902.4170-1-quic_jhugo@quicinc.com>
On Fri, May 19, 2023 at 10:39:00AM -0600, Jeffrey Hugo wrote:
> With the QAIC driver in -next, I'd like to suggest some MHI changes that
> specific to AIC100 devices, but perhaps provide a framework for other
> device oddities.
>
> AIC100 devices technically violate the MHI spec in two ways. Sadly, these
> issues comes from the device hardware, so host SW needs to work around
> them.
>
> Thie first issue, presented in this series, has to do with the
> SOC_HW_VERSION register. This register is suposed to be initialized by the
> hardware prior to the MHI being accessable by the host to contain a
> version string for the SoC of the device. This could be used by the host
> MHI controller software to identify and handle version to version changes.
> The AIC100 hardware does not initialize this register, and thus it
> contains garbage.
>
> This would not be much of a problem normally - the QAIC driver would just
> never use it. However the MHI stack uses this register as part of the init
> sequence and if the controller reports that the register is inaccessable
> then the init sequence fails. On some AIC100 cards, the garbage value
> ends up being 0xFFFFFFFF which is PCIe spec defined to be a special value
> indicating the access failed. The MHI controller cannot tell if that
> value is a PCIe link issue, or just garbage.
>
> QAIC needs a way to tell MHI not to use this register. Other buses have a
> quirk mechanism - a way to describe oddities in a particular
> implementation that have some kind of workaround. Since this seems to be
> the first need for such a thing in MHI, introduce a quirk framework.
>
> The second issue AIC100 has involves the PK Hash registers. A solution for
> this is expected to be proposed in the near future and is anticipated to
> make use of the quirk framework proposed here. With PK Hash, there are two
> oddities to handle. AIC100 does not initialize these registers until the
> SBL is running, which is later than the spec indicates, and in practice
> is after MHI reads/caches them. Also, AIC100 does not have enough
> registers defined to fully report the 5 PK Hash slots, so a custom
> reporting format is defined by the device.
>
Looking at the two issues you reported above, it looks to me that they can be
handled inside the aic100 mhi_controller driver itself. Since the MHI stack
exports the read_reg callback to controller drivers, if some registers are not
supported by the device, then the callback can provide some fixed dummy data
emulating the register until the issue is fixed in the device (if at all).
Quirk framework could be useful if the device misbehaves against the protocol
itself but for the register issues like this, I think the controller driver can
handle itself.
What do you think?
- Mani
> v2:
> -Fix build error
> -Fix typo in commit text
>
> Jeffrey Hugo (2):
> bus: mhi: host: Add quirk framework and initial quirk
> accel/qaic: Add MHI_QUIRK_SOC_HW_VERSION_UNRELIABLE
>
> drivers/accel/qaic/mhi_controller.c | 1 +
> drivers/bus/mhi/host/init.c | 13 +++++++++----
> include/linux/mhi.h | 18 ++++++++++++++++++
> 3 files changed, 28 insertions(+), 4 deletions(-)
>
> --
> 2.40.1
>
>
--
மணிவண்ணன் சதாசிவம்
next prev parent reply other threads:[~2023-06-08 11:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-19 16:39 [PATCH v2 0/2] Add MHI quirk for QAIC Jeffrey Hugo
2023-05-19 16:39 ` [PATCH v2 1/2] bus: mhi: host: Add quirk framework and initial quirk Jeffrey Hugo
2023-05-19 16:39 ` [PATCH v2 2/2] accel/qaic: Add MHI_QUIRK_SOC_HW_VERSION_UNRELIABLE Jeffrey Hugo
2023-06-08 11:59 ` Manivannan Sadhasivam [this message]
2023-06-26 17:15 ` [PATCH v2 0/2] Add MHI quirk for QAIC Jeffrey Hugo
2023-08-02 11:20 ` Manivannan Sadhasivam
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=20230608115928.GA5672@thinkpad \
--to=mani@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhi@lists.linux.dev \
--cc=quic_jhugo@quicinc.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox