From: Paul Mundt <lethal@linux-sh.org>
To: linux-fbdev@vger.kernel.org
Subject: Re: [PATCH] fb: only enable console lock in fb for VGA console
Date: Sun, 30 Sep 2012 12:17:26 +0000 [thread overview]
Message-ID: <20120930121725.GA21682@linux-sh.org> (raw)
In-Reply-To: <CAGA24M+PmObK3ZJWvtNhBzxO4WkGk_xyveQiZNtZe7xGdHrbFw@mail.gmail.com>
On Sat, Sep 29, 2012 at 01:29:17PM +0800, Jun Nie wrote:
> diff --git a/drivers/video/s3fb.c b/drivers/video/s3fb.c
> index 1d00736..7759c82 100644
> --- a/drivers/video/s3fb.c
> +++ b/drivers/video/s3fb.c
> @@ -1445,12 +1444,12 @@ static int s3_pci_suspend(struct pci_dev* dev,
> pm_message_t state)
>
> dev_info(info->device, "suspend\n");
>
> - console_lock();
> + fb_fb_console_lock();
> mutex_lock(&(par->open_lock));
>
Compiling is overrated anyways.
> diff --git a/drivers/video/tmiofb.c b/drivers/video/tmiofb.c
> index 8e4a446..e266b6b 100644
> --- a/drivers/video/tmiofb.c
> +++ b/drivers/video/tmiofb.c
> @@ -959,7 +958,7 @@ static int tmiofb_suspend(struct platform_device
> *dev, pm_message_t state)
> if (cell->suspend)
> retval = cell->suspend(dev);
>
> - console_unlock();
> + fb_fb_console_unlock();
>
> return retval;
> }
> @@ -986,7 +985,7 @@ static int tmiofb_resume(struct platform_device *dev)
>
> fb_set_suspend(info, 0);
> out:
> - console_unlock();
> + fb_fb_console_unlock();
> return retval;
> }
> #else
Here too.
Turning locks in to no-ops without auditing every single driver's use of
said lock and converting to something to protect the work being done
under lock suggests that this conversion is more mechanical than thought
out beyond your specific use case.
While you've obviously identified a problem that's worth pursuing, it's
going to take a bit more work than mechanical conversion, and it's going
to have to be something that's moved towards incrementally. If you
haven't even compile tested the impacted drivers, it suggests you haven't
spent a great deal of time thinking about what they are doing under said
lock, either..
next prev parent reply other threads:[~2012-09-30 12:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-29 5:29 [PATCH] fb: only enable console lock in fb for VGA console Jun Nie
2012-09-29 5:58 ` Benjamin Herrenschmidt
2012-09-29 6:03 ` Jun Nie
2012-09-29 7:37 ` Geert Uytterhoeven
2012-09-29 8:11 ` Jun Nie
2012-09-29 10:43 ` Benjamin Herrenschmidt
2012-09-29 10:46 ` Jun Nie
2012-09-30 12:17 ` Paul Mundt [this message]
2012-10-09 10:13 ` Jun Nie
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=20120930121725.GA21682@linux-sh.org \
--to=lethal@linux-sh.org \
--cc=linux-fbdev@vger.kernel.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).