* [PATCH] drm: gma500: Replace 120ms mdelay calls in mdfld_dsi_pkg_sender.c
@ 2018-10-01 15:36 Phillip Potter
2018-10-02 7:52 ` Patrik Jakobsson
0 siblings, 1 reply; 4+ messages in thread
From: Phillip Potter @ 2018-10-01 15:36 UTC (permalink / raw)
To: patrik.r.jakobsson; +Cc: dri-devel
Replace all 120ms mdelay macro calls with msleep function calls. As msleep is
not suitable for < 20ms sleeps, also remove comment from mdelay(5) call.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
---
diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c b/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c
index c50534c923df..a9c4116aad8a 100644
--- a/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c
+++ b/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c
@@ -322,13 +322,11 @@ static int send_pkg_prepare(struct mdfld_dsi_pkg_sender *sender, u8 data_type,
/*wait for 120 milliseconds in case exit_sleep_mode just be sent*/
if (unlikely(cmd == MIPI_DCS_ENTER_SLEEP_MODE)) {
- /*TODO: replace it with msleep later*/
- mdelay(120);
+ msleep(120);
}
if (unlikely(cmd == MIPI_DCS_EXIT_SLEEP_MODE)) {
- /*TODO: replace it with msleep later*/
- mdelay(120);
+ msleep(120);
}
return 0;
}
@@ -351,14 +349,11 @@ static int send_pkg_done(struct mdfld_dsi_pkg_sender *sender, u8 data_type,
/*update panel status*/
if (unlikely(cmd == MIPI_DCS_ENTER_SLEEP_MODE)) {
sender->panel_mode |= MDFLD_DSI_PANEL_MODE_SLEEP;
- /*TODO: replace it with msleep later*/
- mdelay(120);
+ msleep(120);
} else if (unlikely(cmd == MIPI_DCS_EXIT_SLEEP_MODE)) {
sender->panel_mode &= ~MDFLD_DSI_PANEL_MODE_SLEEP;
- /*TODO: replace it with msleep later*/
- mdelay(120);
+ msleep(120);
} else if (unlikely(cmd == MIPI_DCS_SOFT_RESET)) {
- /*TODO: replace it with msleep later*/
mdelay(5);
}
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm: gma500: Replace 120ms mdelay calls in mdfld_dsi_pkg_sender.c
2018-10-01 15:36 [PATCH] drm: gma500: Replace 120ms mdelay calls in mdfld_dsi_pkg_sender.c Phillip Potter
@ 2018-10-02 7:52 ` Patrik Jakobsson
2018-10-02 8:23 ` Phillip Potter
0 siblings, 1 reply; 4+ messages in thread
From: Patrik Jakobsson @ 2018-10-02 7:52 UTC (permalink / raw)
To: phil; +Cc: dri-devel
On Mon, Oct 1, 2018 at 5:36 PM Phillip Potter <phil@philpotter.co.uk> wrote:
>
> Replace all 120ms mdelay macro calls with msleep function calls. As msleep is
> not suitable for < 20ms sleeps, also remove comment from mdelay(5) call.
>
> Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
> ---
> diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c b/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c
> index c50534c923df..a9c4116aad8a 100644
> --- a/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c
> +++ b/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c
> @@ -322,13 +322,11 @@ static int send_pkg_prepare(struct mdfld_dsi_pkg_sender *sender, u8 data_type,
>
> /*wait for 120 milliseconds in case exit_sleep_mode just be sent*/
> if (unlikely(cmd == MIPI_DCS_ENTER_SLEEP_MODE)) {
> - /*TODO: replace it with msleep later*/
> - mdelay(120);
> + msleep(120);
Hi Phillip,
This is executed while holding a spinlock so we cannot sleep here.
This is true for send_pkg_done() as well.
- Patrik
> }
>
> if (unlikely(cmd == MIPI_DCS_EXIT_SLEEP_MODE)) {
> - /*TODO: replace it with msleep later*/
> - mdelay(120);
> + msleep(120);
> }
> return 0;
> }
> @@ -351,14 +349,11 @@ static int send_pkg_done(struct mdfld_dsi_pkg_sender *sender, u8 data_type,
> /*update panel status*/
> if (unlikely(cmd == MIPI_DCS_ENTER_SLEEP_MODE)) {
> sender->panel_mode |= MDFLD_DSI_PANEL_MODE_SLEEP;
> - /*TODO: replace it with msleep later*/
> - mdelay(120);
> + msleep(120);
> } else if (unlikely(cmd == MIPI_DCS_EXIT_SLEEP_MODE)) {
> sender->panel_mode &= ~MDFLD_DSI_PANEL_MODE_SLEEP;
> - /*TODO: replace it with msleep later*/
> - mdelay(120);
> + msleep(120);
> } else if (unlikely(cmd == MIPI_DCS_SOFT_RESET)) {
> - /*TODO: replace it with msleep later*/
> mdelay(5);
> }
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm: gma500: Replace 120ms mdelay calls in mdfld_dsi_pkg_sender.c
2018-10-02 7:52 ` Patrik Jakobsson
@ 2018-10-02 8:23 ` Phillip Potter
2018-10-02 10:42 ` Patrik Jakobsson
0 siblings, 1 reply; 4+ messages in thread
From: Phillip Potter @ 2018-10-02 8:23 UTC (permalink / raw)
To: Patrik Jakobsson; +Cc: dri-devel
On Tue, Oct 02, 2018 at 09:52:51AM +0200, Patrik Jakobsson wrote:
> Hi Phillip,
> This is executed while holding a spinlock so we cannot sleep here.
> This is true for send_pkg_done() as well.
>
> - Patrik
Dear Patrik,
Oops, sorry. I'll try and be more observant in future. Just picked up on these whilst grepping the source :-)
Regards,
Phil
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm: gma500: Replace 120ms mdelay calls in mdfld_dsi_pkg_sender.c
2018-10-02 8:23 ` Phillip Potter
@ 2018-10-02 10:42 ` Patrik Jakobsson
0 siblings, 0 replies; 4+ messages in thread
From: Patrik Jakobsson @ 2018-10-02 10:42 UTC (permalink / raw)
To: Phillip Potter; +Cc: dri-devel
On Tue, Oct 2, 2018 at 10:23 AM Phillip Potter <phil@philpotter.co.uk> wrote:
>
> On Tue, Oct 02, 2018 at 09:52:51AM +0200, Patrik Jakobsson wrote:
> > Hi Phillip,
> > This is executed while holding a spinlock so we cannot sleep here.
> > This is true for send_pkg_done() as well.
> >
> > - Patrik
>
> Dear Patrik,
>
> Oops, sorry. I'll try and be more observant in future. Just picked up on these whilst grepping the source :-)
No worries, the comments are a bit misleading.
-Patrik
>
> Regards,
> Phil
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-10-02 10:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-01 15:36 [PATCH] drm: gma500: Replace 120ms mdelay calls in mdfld_dsi_pkg_sender.c Phillip Potter
2018-10-02 7:52 ` Patrik Jakobsson
2018-10-02 8:23 ` Phillip Potter
2018-10-02 10:42 ` Patrik Jakobsson
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.