From: Jani Nikula <jani.nikula@linux.intel.com>
To: Nicholas Krause <xerofoify@gmail.com>, airlied@linux.ie
Cc: airlied@redhat.com, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drivers: Change calls to mdelay to msleep in order to stop CPU busy looping in mdfld_dsi_pkg_sender.c
Date: Mon, 17 Nov 2014 10:40:43 +0200 [thread overview]
Message-ID: <87ioieusms.fsf@intel.com> (raw)
In-Reply-To: <1416075673-23281-1-git-send-email-xerofoify@gmail.com>
On Sat, 15 Nov 2014, Nicholas Krause <xerofoify@gmail.com> wrote:
> Changes the calls of mdelay to msleep in the driver file mdfld_dsi_pkg_sender.c
> in order to prevent CPU busy looping in order to save CPU cycles as this is
> considered bad form over sleeping the CPU for high resolution timer function
> calls as this driver needs in order to function properly.
The code paths are called with sender->lock spinlock held.
BR,
Jani.
>
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> ---
> drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c | 15 +++++----------
> 1 file changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c b/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c
> index 87885d8..77c656a 100644
> --- a/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c
> +++ b/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c
> @@ -335,13 +335,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 == DCS_ENTER_SLEEP_MODE)) {
> - /*TODO: replace it with msleep later*/
> - mdelay(120);
> + msleep(120);
> }
>
> if (unlikely(cmd == DCS_EXIT_SLEEP_MODE)) {
> - /*TODO: replace it with msleep later*/
> - mdelay(120);
> + msleep(120);
> }
> return 0;
> }
> @@ -364,15 +362,12 @@ static int send_pkg_done(struct mdfld_dsi_pkg_sender *sender, u8 data_type,
> /*update panel status*/
> if (unlikely(cmd == 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 == 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 == DCS_SOFT_RESET)) {
> - /*TODO: replace it with msleep later*/
> - mdelay(5);
> + msleep(5);
> }
>
> sender->status = MDFLD_DSI_PKG_SENDER_FREE;
> --
> 1.9.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
WARNING: multiple messages have this Message-ID (diff)
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Nicholas Krause <xerofoify@gmail.com>, airlied@linux.ie
Cc: airlied@redhat.com, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drivers: Change calls to mdelay to msleep in order to stop CPU busy looping in mdfld_dsi_pkg_sender.c
Date: Mon, 17 Nov 2014 10:40:43 +0200 [thread overview]
Message-ID: <87ioieusms.fsf@intel.com> (raw)
In-Reply-To: <1416075673-23281-1-git-send-email-xerofoify@gmail.com>
On Sat, 15 Nov 2014, Nicholas Krause <xerofoify@gmail.com> wrote:
> Changes the calls of mdelay to msleep in the driver file mdfld_dsi_pkg_sender.c
> in order to prevent CPU busy looping in order to save CPU cycles as this is
> considered bad form over sleeping the CPU for high resolution timer function
> calls as this driver needs in order to function properly.
The code paths are called with sender->lock spinlock held.
BR,
Jani.
>
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> ---
> drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c | 15 +++++----------
> 1 file changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c b/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c
> index 87885d8..77c656a 100644
> --- a/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c
> +++ b/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c
> @@ -335,13 +335,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 == DCS_ENTER_SLEEP_MODE)) {
> - /*TODO: replace it with msleep later*/
> - mdelay(120);
> + msleep(120);
> }
>
> if (unlikely(cmd == DCS_EXIT_SLEEP_MODE)) {
> - /*TODO: replace it with msleep later*/
> - mdelay(120);
> + msleep(120);
> }
> return 0;
> }
> @@ -364,15 +362,12 @@ static int send_pkg_done(struct mdfld_dsi_pkg_sender *sender, u8 data_type,
> /*update panel status*/
> if (unlikely(cmd == 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 == 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 == DCS_SOFT_RESET)) {
> - /*TODO: replace it with msleep later*/
> - mdelay(5);
> + msleep(5);
> }
>
> sender->status = MDFLD_DSI_PKG_SENDER_FREE;
> --
> 1.9.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Jani Nikula, Intel Open Source Technology Center
next prev parent reply other threads:[~2014-11-17 8:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-15 18:21 [PATCH] drivers: Change calls to mdelay to msleep in order to stop CPU busy looping in mdfld_dsi_pkg_sender.c Nicholas Krause
2014-11-17 8:40 ` Jani Nikula [this message]
2014-11-17 8:40 ` Jani Nikula
2014-11-17 15:38 ` Nick Krause
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=87ioieusms.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=airlied@linux.ie \
--cc=airlied@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=xerofoify@gmail.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.