From: Timur Tabi <timur@freescale.com>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: linuxppc-dev@ozlabs.org,
Andrew Morton <akpm@linux-foundation.org>,
York Sun <yorksun@freescale.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] Driver for Freescale 8610 and 5121 DIU
Date: Mon, 14 Apr 2008 09:49:36 -0500 [thread overview]
Message-ID: <48036F00.6080200@freescale.com> (raw)
In-Reply-To: <4803690A.3080105@gmail.com>
Jiri Slaby wrote:
> On 04/14/2008 04:12 PM, Timur Tabi wrote:
>> Unfortunately, the author of the patch, York, is out this week, so I'll have to
>> take care of this. It'd be easier to modify rh_alloc() so that it doesn't
>> sleep, so that's what I'm going to do.
>
> Anyway, why do you need the spin lock there (and not mutex)?
I don't know. A spinlock just seemed obvious. Why would I prefer a mutex?
We need a mutual exclusion device in order to prevent multiple threads from
opening the DIU driver simultaneously. When the driver is opened the first
time, it needs to initialize the hardware. The hardware can't be initialized
unless we allocate a buffer first.
Now, we could pre-allocate the buffer, but then this would be a permanent 5MB
(8MB if we eliminate rh_alloc) allocation of physically contiguous memory. I'm
assuming that this would be a bad thing. It wouldn't eliminate the spinlock,
but at least we wouldn't be calling kmalloc().
I open to suggestion for improvements. I'm still going to post the rh_alloc
atomic patch, because I think it makes sense anyway. This should fix the
sleep-within-spinlock problem, but it does not fix the kmalloc-5MB-in-spinlock
problem.
--
Timur Tabi
Linux kernel developer at Freescale
next prev parent reply other threads:[~2008-04-14 14:49 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-12 21:43 Driver for Freescale Display Interface Unit (A LCD controller) York Sun
2008-03-12 21:43 ` [PATCH 1/2] Driver for Freescale 8610 and 5121 DIU York Sun
2008-03-12 21:43 ` [PATCH 2/2] Add DIU platform code for MPC8610HPCD York Sun
2008-04-14 14:18 ` Arnd Bergmann
2008-03-12 22:20 ` [PATCH 1/2] Driver for Freescale 8610 and 5121 DIU Jiri Slaby
2008-04-11 21:45 ` Jiri Slaby
2008-04-12 5:18 ` Andrew Morton
2008-04-14 13:39 ` Timur Tabi
2008-04-14 13:43 ` Jiri Slaby
2008-04-14 13:45 ` Timur Tabi
2008-04-14 13:54 ` Jiri Slaby
2008-04-14 14:12 ` Timur Tabi
2008-04-14 14:24 ` Jiri Slaby
2008-04-14 14:49 ` Timur Tabi [this message]
2008-04-14 15:43 ` Jiri Slaby
2008-04-14 15:46 ` Timur Tabi
2008-04-14 19:03 ` Andrew Morton
2008-03-13 0:10 ` Stephen Rothwell
2008-03-13 10:17 ` Driver for Freescale Display Interface Unit (A LCD controller) Geert Uytterhoeven
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=48036F00.6080200@freescale.com \
--to=timur@freescale.com \
--cc=akpm@linux-foundation.org \
--cc=jirislaby@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=yorksun@freescale.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;
as well as URLs for NNTP newsgroup(s).