From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org,
linux-rt-users <linux-rt-users@vger.kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Carsten Emde <C.Emde@osadl.org>, John Kacur <jkacur@redhat.com>,
Clark Williams <williams@redhat.com>,
stable-rt@vger.kernel.org
Subject: [PATCH RT 11/12 rc3] ACPI: Convert embedded controller lock to raw spinlock
Date: Mon, 05 Dec 2011 18:00:57 -0500 [thread overview]
Message-ID: <20111205230307.697516028@goodmis.org> (raw)
In-Reply-To: 20111205230046.736851081@goodmis.org
[-- Attachment #1: Type: text/plain, Size: 3654 bytes --]
From: Clark Williams <williams@redhat.com>
Was seeing multiple "scheduling while atomic" backtraces on the
3.2-rc2-rt5 realtime kernel. This patch converts the spinlock in
the ACPI embedded controller structure (curr_lock) to be a raw
spinlock.
Signed-off-by: Clark Williams <williams@redhat.com>
Link: http://lkml.kernel.org/r/20111203093537.7d805f64@redhat.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable-rt@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
drivers/acpi/ec.c | 22 +++++++++++-----------
drivers/acpi/internal.h | 2 +-
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index b19a18d..5812e01 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -152,10 +152,10 @@ static int ec_transaction_done(struct acpi_ec *ec)
{
unsigned long flags;
int ret = 0;
- spin_lock_irqsave(&ec->curr_lock, flags);
+ raw_spin_lock_irqsave(&ec->curr_lock, flags);
if (!ec->curr || ec->curr->done)
ret = 1;
- spin_unlock_irqrestore(&ec->curr_lock, flags);
+ raw_spin_unlock_irqrestore(&ec->curr_lock, flags);
return ret;
}
@@ -169,7 +169,7 @@ static void start_transaction(struct acpi_ec *ec)
static void advance_transaction(struct acpi_ec *ec, u8 status)
{
unsigned long flags;
- spin_lock_irqsave(&ec->curr_lock, flags);
+ raw_spin_lock_irqsave(&ec->curr_lock, flags);
if (!ec->curr)
goto unlock;
if (ec->curr->wlen > ec->curr->wi) {
@@ -194,7 +194,7 @@ err:
if (in_interrupt())
++ec->curr->irq_count;
unlock:
- spin_unlock_irqrestore(&ec->curr_lock, flags);
+ raw_spin_unlock_irqrestore(&ec->curr_lock, flags);
}
static int acpi_ec_sync_query(struct acpi_ec *ec);
@@ -232,9 +232,9 @@ static int ec_poll(struct acpi_ec *ec)
if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF)
break;
pr_debug(PREFIX "controller reset, restart transaction\n");
- spin_lock_irqsave(&ec->curr_lock, flags);
+ raw_spin_lock_irqsave(&ec->curr_lock, flags);
start_transaction(ec);
- spin_unlock_irqrestore(&ec->curr_lock, flags);
+ raw_spin_unlock_irqrestore(&ec->curr_lock, flags);
}
return -ETIME;
}
@@ -247,17 +247,17 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec,
if (EC_FLAGS_MSI)
udelay(ACPI_EC_MSI_UDELAY);
/* start transaction */
- spin_lock_irqsave(&ec->curr_lock, tmp);
+ raw_spin_lock_irqsave(&ec->curr_lock, tmp);
/* following two actions should be kept atomic */
ec->curr = t;
start_transaction(ec);
if (ec->curr->command == ACPI_EC_COMMAND_QUERY)
clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags);
- spin_unlock_irqrestore(&ec->curr_lock, tmp);
+ raw_spin_unlock_irqrestore(&ec->curr_lock, tmp);
ret = ec_poll(ec);
- spin_lock_irqsave(&ec->curr_lock, tmp);
+ raw_spin_lock_irqsave(&ec->curr_lock, tmp);
ec->curr = NULL;
- spin_unlock_irqrestore(&ec->curr_lock, tmp);
+ raw_spin_unlock_irqrestore(&ec->curr_lock, tmp);
return ret;
}
@@ -678,7 +678,7 @@ static struct acpi_ec *make_acpi_ec(void)
mutex_init(&ec->lock);
init_waitqueue_head(&ec->wait);
INIT_LIST_HEAD(&ec->list);
- spin_lock_init(&ec->curr_lock);
+ raw_spin_lock_init(&ec->curr_lock);
return ec;
}
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h
index ca75b9c..68ed95f 100644
--- a/drivers/acpi/internal.h
+++ b/drivers/acpi/internal.h
@@ -62,7 +62,7 @@ struct acpi_ec {
wait_queue_head_t wait;
struct list_head list;
struct transaction *curr;
- spinlock_t curr_lock;
+ raw_spinlock_t curr_lock;
};
extern struct acpi_ec *first_ec;
--
1.7.7.1
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2011-12-05 23:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-05 23:00 [PATCH RT 00/12 rc3] [ANNOUNCE] 3.0.12-rt30-rc3 Steven Rostedt
2011-12-05 23:00 ` [PATCH RT 01/12 rc3] tasklet/rt: Prevent tasklets from going into infinite spin in RT Steven Rostedt
2011-12-05 23:00 ` [PATCH RT 02/12 rc3] genirq: fix regression in irqfixup, irqpoll Steven Rostedt
2011-12-05 23:00 ` [PATCH RT 03/12 rc3] intel-iommu: Fix AB-BA lockdep report Steven Rostedt
2011-12-05 23:00 ` [PATCH RT 04/12 rc3] KVM: Sanitize cpuid Steven Rostedt
2011-12-05 23:00 ` [PATCH RT 05/12 rc3] KVM: fix XSAVE bit scanning (now properly) Steven Rostedt
2011-12-05 23:00 ` [PATCH RT 06/12 rc3] wait: Provide __wake_up_all_locked Steven Rostedt
2011-12-05 23:00 ` [PATCH RT 07/12 rc3] pci: Use __wake_up_all_locked pci_unblock_user_cfg_access() Steven Rostedt
2011-12-05 23:00 ` [PATCH RT 08/12 rc3] acpi: Make gbl_[hardware|gpe]_lock raw Steven Rostedt
2011-12-05 23:00 ` [PATCH RT 09/12 rc3] slab, lockdep: Fix silly bug Steven Rostedt
2011-12-05 23:00 ` [PATCH RT 10/12 rc3] slab, lockdep: Annotate all slab caches Steven Rostedt
2011-12-05 23:00 ` Steven Rostedt [this message]
2011-12-05 23:00 ` [PATCH RT 12/12 rc3] Linux v3.0.12-rt30-rc3 Steven Rostedt
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=20111205230307.697516028@goodmis.org \
--to=rostedt@goodmis.org \
--cc=C.Emde@osadl.org \
--cc=jkacur@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=stable-rt@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=williams@redhat.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.