* [PATCH] drm/bridge: nwl-dsi: fix packet read ISR handling
@ 2023-03-18 22:36 Kevin Groeneveld
2023-03-20 10:44 ` Neil Armstrong
0 siblings, 1 reply; 3+ messages in thread
From: Kevin Groeneveld @ 2023-03-18 22:36 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, David Airlie, Daniel Vetter,
dri-devel, linux-kernel
Cc: Kevin Groeneveld
In some cases the NWL_DSI_RX_PKT_PAYLOAD_DATA_RCVD interrupt flag is not
set along with NWL_DSI_RX_PKT_HDR_RCVD when the initial interrupt fires.
Since the NWL_DSI_RX_PKT_PAYLOAD_DATA_RCVD_MASK was not set then the ISR
does not fire again when NWL_DSI_RX_PKT_PAYLOAD_DATA_RCVD is finally set
and the read times out.
Also the read packet handling checks for NWL_DSI_DPHY_DIRECTION which is
not always set when the ISR for reading the payload runs. Instead it seems
better to check xfer->direction is DSI_PACKET_RECEIVE (more similar to the
send packet case).
The above two changes were required to perform a successful DCS read from
a display with a Chipone ICNL9707 driver IC.
Signed-off-by: Kevin Groeneveld <kgroeneveld@lenbrook.com>
---
drivers/gpu/drm/bridge/nwl-dsi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c
index 6dc2a4e191d7..241568a17f60 100644
--- a/drivers/gpu/drm/bridge/nwl-dsi.c
+++ b/drivers/gpu/drm/bridge/nwl-dsi.c
@@ -334,6 +334,7 @@ static int nwl_dsi_init_interrupts(struct nwl_dsi *dsi)
{
u32 irq_enable = ~(u32)(NWL_DSI_TX_PKT_DONE_MASK |
NWL_DSI_RX_PKT_HDR_RCVD_MASK |
+ NWL_DSI_RX_PKT_PAYLOAD_DATA_RCVD_MASK |
NWL_DSI_TX_FIFO_OVFLW_MASK |
NWL_DSI_HS_TX_TIMEOUT_MASK);
@@ -489,7 +490,7 @@ static void nwl_dsi_finish_transmission(struct nwl_dsi *dsi, u32 status)
status & NWL_DSI_TX_PKT_DONE) {
xfer->status = xfer->tx_len;
end_packet = true;
- } else if (status & NWL_DSI_DPHY_DIRECTION &&
+ } else if (xfer->direction == DSI_PACKET_RECEIVE &&
((status & (NWL_DSI_RX_PKT_HDR_RCVD |
NWL_DSI_RX_PKT_PAYLOAD_DATA_RCVD)))) {
end_packet = nwl_dsi_read_packet(dsi, status);
--
2.34.1
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] drm/bridge: nwl-dsi: fix packet read ISR handling
2023-03-18 22:36 [PATCH] drm/bridge: nwl-dsi: fix packet read ISR handling Kevin Groeneveld
@ 2023-03-20 10:44 ` Neil Armstrong
2023-03-20 18:51 ` Kevin Groeneveld
0 siblings, 1 reply; 3+ messages in thread
From: Neil Armstrong @ 2023-03-20 10:44 UTC (permalink / raw)
To: Kevin Groeneveld, Andrzej Hajda, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, David Airlie, Daniel Vetter,
dri-devel, linux-kernel
Hi,
On 18/03/2023 23:36, Kevin Groeneveld wrote:
> In some cases the NWL_DSI_RX_PKT_PAYLOAD_DATA_RCVD interrupt flag is not
> set along with NWL_DSI_RX_PKT_HDR_RCVD when the initial interrupt fires.
> Since the NWL_DSI_RX_PKT_PAYLOAD_DATA_RCVD_MASK was not set then the ISR
> does not fire again when NWL_DSI_RX_PKT_PAYLOAD_DATA_RCVD is finally set
> and the read times out.
>
> Also the read packet handling checks for NWL_DSI_DPHY_DIRECTION which is
> not always set when the ISR for reading the payload runs. Instead it seems
> better to check xfer->direction is DSI_PACKET_RECEIVE (more similar to the
> send packet case).
>
> The above two changes were required to perform a successful DCS read from
> a display with a Chipone ICNL9707 driver IC.
>
> Signed-off-by: Kevin Groeneveld <kgroeneveld@lenbrook.com>
Thanks for the patch, can you provide a Fixes tag ?
Neil
> ---
> drivers/gpu/drm/bridge/nwl-dsi.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c
> index 6dc2a4e191d7..241568a17f60 100644
> --- a/drivers/gpu/drm/bridge/nwl-dsi.c
> +++ b/drivers/gpu/drm/bridge/nwl-dsi.c
> @@ -334,6 +334,7 @@ static int nwl_dsi_init_interrupts(struct nwl_dsi *dsi)
> {
> u32 irq_enable = ~(u32)(NWL_DSI_TX_PKT_DONE_MASK |
> NWL_DSI_RX_PKT_HDR_RCVD_MASK |
> + NWL_DSI_RX_PKT_PAYLOAD_DATA_RCVD_MASK |
> NWL_DSI_TX_FIFO_OVFLW_MASK |
> NWL_DSI_HS_TX_TIMEOUT_MASK);
>
> @@ -489,7 +490,7 @@ static void nwl_dsi_finish_transmission(struct nwl_dsi *dsi, u32 status)
> status & NWL_DSI_TX_PKT_DONE) {
> xfer->status = xfer->tx_len;
> end_packet = true;
> - } else if (status & NWL_DSI_DPHY_DIRECTION &&
> + } else if (xfer->direction == DSI_PACKET_RECEIVE &&
> ((status & (NWL_DSI_RX_PKT_HDR_RCVD |
> NWL_DSI_RX_PKT_PAYLOAD_DATA_RCVD)))) {
> end_packet = nwl_dsi_read_packet(dsi, status);
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] drm/bridge: nwl-dsi: fix packet read ISR handling
2023-03-20 10:44 ` Neil Armstrong
@ 2023-03-20 18:51 ` Kevin Groeneveld
0 siblings, 0 replies; 3+ messages in thread
From: Kevin Groeneveld @ 2023-03-20 18:51 UTC (permalink / raw)
To: neil.armstrong, Andrzej Hajda, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, David Airlie, Daniel Vetter,
dri-devel, linux-kernel
Hi Neil,
On 2023-03-20 06:44, Neil Armstrong wrote:
> Thanks for the patch, can you provide a Fixes tag ?
>
> Neil
As with my other recent patch I did not think of adding a fixes tag as
this bug is not a regressions but has existed since the first commit of
the driver. If there should be a fixes tags then it would be:
Fixes: 44cfc6233447 ("drm/bridge: Add NWL MIPI DSI host controller support")
Kevin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-03-20 19:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-18 22:36 [PATCH] drm/bridge: nwl-dsi: fix packet read ISR handling Kevin Groeneveld
2023-03-20 10:44 ` Neil Armstrong
2023-03-20 18:51 ` Kevin Groeneveld
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®