From: Ingo Molnar <mingo@elte.hu>
To: Len Brown <lenb@kernel.org>
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
Len Brown <len.brown@intel.com>,
Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
"H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 03/15] ACPICA: move common private headers under kernel/acpi/acpica/
Date: Fri, 2 Jan 2009 20:14:51 +0100 [thread overview]
Message-ID: <20090102191451.GB14249@elte.hu> (raw)
In-Reply-To: <c6b6f68232ab6da57e764c64b23b4649c4e7c463.1230719801.git.len.brown@intel.com>
* Len Brown <lenb@kernel.org> wrote:
> From: Len Brown <len.brown@intel.com>
>
> Signed-off-by: Len Brown <len.brown@intel.com>
> ---
> kernel/acpi/acpica/dsfield.c | 2 +-
> kernel/acpi/acpica/dsinit.c | 2 +-
> kernel/acpi/acpica/dsmethod.c | 2 +-
> kernel/acpi/acpica/dsmthdat.c | 2 +-
> kernel/acpi/acpica/dsobject.c | 2 +-
> kernel/acpi/acpica/dsopcode.c | 2 +-
> kernel/acpi/acpica/dsutils.c | 2 +-
> kernel/acpi/acpica/dswexec.c | 2 +-
> kernel/acpi/acpica/dswload.c | 2 +-
> kernel/acpi/acpica/dswscope.c | 2 +-
> kernel/acpi/acpica/dswstate.c | 2 +-
> kernel/acpi/acpica/evevent.c | 2 +-
> kernel/acpi/acpica/evgpe.c | 2 +-
> kernel/acpi/acpica/evgpeblk.c | 2 +-
> kernel/acpi/acpica/evmisc.c | 2 +-
> kernel/acpi/acpica/evregion.c | 2 +-
> kernel/acpi/acpica/evrgnini.c | 2 +-
> kernel/acpi/acpica/evsci.c | 2 +-
> kernel/acpi/acpica/evxface.c | 2 +-
> kernel/acpi/acpica/evxfevnt.c | 2 +-
> kernel/acpi/acpica/evxfregn.c | 2 +-
> kernel/acpi/acpica/exconfig.c | 2 +-
> kernel/acpi/acpica/exconvrt.c | 2 +-
> kernel/acpi/acpica/excreate.c | 2 +-
> kernel/acpi/acpica/exdump.c | 2 +-
> kernel/acpi/acpica/exfield.c | 2 +-
>
> [... etc ...]
hm, dunno. Do we really want to introduce 'driver/platform' space items
like this in the core kernel/* ?
If it goes there then IMHO the ACPI code needs to be cleaned up
_significantly_ to not wrap native Linux calls like spinlocks, allocators,
etc.
Random example - i dont think stuff like this is readable [in to-be
kernel/acpi/utilities/utcache.c]:
if (cache->current_depth >= cache->max_depth) {
ACPI_FREE(object);
ACPI_MEM_TRACKING(cache->total_freed++);
}
/* Otherwise put this object back into the cache */
else {
status = acpi_ut_acquire_mutex(ACPI_MTX_CACHES);
if (ACPI_FAILURE(status)) {
return (status);
}
acpi_ut_acquire_mutex() under [to-be] kernel/acpi/utilities/utmutex.c
looks absolutely horrible, redirected after some debugging layer to its
final destination:
./include/acpi/acpiosxf.h:#define acpi_os_acquire_mutex(handle,time)
acpi_os_wait_semaphore (handle, 1, time), which does [kernel/acpi/osl.c]:
/*
* TODO: Support for units > 1?
*/
acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout)
{
acpi_status status = AE_OK;
struct semaphore *sem = (struct semaphore *)handle;
long jiffies;
int ret = 0;
if (!sem || (units < 1))
return AE_BAD_PARAMETER;
if (units > 1)
return AE_SUPPORT;
ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Waiting for semaphore[%p|%d|%d]\n",
handle, units, timeout));
if (timeout == ACPI_WAIT_FOREVER)
jiffies = MAX_SCHEDULE_TIMEOUT;
else
jiffies = msecs_to_jiffies(timeout);
ret = down_timeout(sem, jiffies);
if (ret)
status = AE_TIME;
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,
"Failed to acquire semaphore[%p|%d|%d], %s",
handle, units, timeout,
acpi_format_exception(status)));
} else {
ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,
"Acquired semaphore[%p|%d|%d]", handle,
units, timeout));
}
return status;
}
so it's a glorified down_timeout(). While we have mutex_timeout(). What's
the plan here?
Ingo
next prev parent reply other threads:[~2009-01-02 19:15 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-31 10:51 RFC - ACPI source code re-org Len Brown
2008-12-31 10:51 ` [PATCH 01/15] ACPI: create kernel/acpi/ Len Brown
2008-12-31 10:51 ` [PATCH 02/15] ACPI: delete include/acpi/platform/ Len Brown
2008-12-31 10:51 ` [PATCH 03/15] ACPICA: move common private headers under kernel/acpi/acpica/ Len Brown
2009-01-02 19:14 ` Ingo Molnar [this message]
2009-01-02 20:48 ` Len Brown
2009-01-07 22:10 ` Ingo Molnar
2009-01-08 16:03 ` Christoph Hellwig
2009-01-09 4:34 ` Len Brown
2009-01-11 4:09 ` Ingo Molnar
2009-01-02 21:56 ` Len Brown
2008-12-31 10:51 ` [PATCH 04/15] ACPICA: acdebug.h is private Len Brown
2008-12-31 10:51 ` [PATCH 05/15] ACPICA: delete acdisasm.h Len Brown
2008-12-31 10:51 ` [PATCH 06/15] ACPICA: acdispat.h is private Len Brown
2008-12-31 10:51 ` [PATCH 07/15] ACPICA: acevents.h " Len Brown
2008-12-31 10:51 ` [PATCH 08/15] ACPICA: acinterp.h " Len Brown
2008-12-31 10:51 ` [PATCH 09/15] ACPICA: acnamesp.h " Len Brown
2008-12-31 10:52 ` [PATCH 10/15] ACPICA: acopcode.h " Len Brown
2008-12-31 10:52 ` [PATCH 11/15] ACPICA: acparser.h " Len Brown
2008-12-31 10:52 ` [PATCH 12/15] ACPICA: acpredef.h " Len Brown
2008-12-31 10:52 ` [PATCH 13/15] ACPICA: acresrc.h, amlresrc.h are private Len Brown
2008-12-31 10:52 ` [PATCH 14/15] ACPICA: actables.h is private Len Brown
2008-12-31 10:52 ` [PATCH 15/15] ACPICA: amlcode.h " Len Brown
2008-12-31 13:39 ` [PATCH 01/15] ACPI: create kernel/acpi/ Sam Ravnborg
2008-12-31 14:21 ` Andi Kleen
2008-12-31 15:34 ` Sam Ravnborg
2009-01-02 21:44 ` [incremental-PATCH-for-Sam's-Review] ACPI: use ccflags-y instead of EXTRA_CFLAGS Len Brown
2009-01-02 21:52 ` Sam Ravnborg
2009-01-02 21:56 ` Andi Kleen
2009-01-02 22:01 ` Sam Ravnborg
2009-01-02 22:17 ` Len Brown
2009-01-02 22:46 ` Andi Kleen
2009-01-02 21:30 ` [PATCH 01/15] ACPI: create kernel/acpi/ Len Brown
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=20090102191451.GB14249@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=len.brown@intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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
all inboxes | Powered by JetHome®