* [patch] 2.4.25-pre8, 2.6.2-rc2 mca.c - pass irq_safe around
@ 2004-02-06 6:37 Keith Owens
2004-02-10 22:57 ` David Mosberger
2004-02-10 23:05 ` Keith Owens
0 siblings, 2 replies; 3+ messages in thread
From: Keith Owens @ 2004-02-06 6:37 UTC (permalink / raw)
To: linux-ia64
The patch is against 2.4.25-pre8 bk. It also applies to 2.6.2-rc2 bk
(with some fuzz and offsets), after applying my previous 6 patches to
2.6.2-rc2 mca.c.
Patches from Ben Woodward to calculate irq_safe once and pass it
around.
Index: 25-pre8.5/arch/ia64/kernel/mca.c
--- 25-pre8.5/arch/ia64/kernel/mca.c Fri, 06 Feb 2004 17:15:40 +1100 kaos (linux-2.4/s/c/5_mca.c 1.1.3.2.3.1.1.1.1.2.1.1.1.1.1.1.1.5 644)
+++ 25-pre8.6/arch/ia64/kernel/mca.c Fri, 06 Feb 2004 17:29:43 +1100 kaos (linux-2.4/s/c/5_mca.c 1.1.3.2.3.1.1.1.1.2.1.1.1.1.1.1.1.6 644)
@@ -130,7 +130,7 @@ static int cmc_polling_enabled = 1;
*/
static int cpe_poll_enabled = 1;
-extern void salinfo_log_wakeup(int type, u8 *buffer, u64 size);
+extern void salinfo_log_wakeup(int type, u8 *buffer, u64 size, int irqsafe);
static struct tq_struct cmc_disable_tq, cmc_enable_tq;
@@ -201,17 +201,17 @@ ia64_log_init(int sal_info_type)
* Get the current MCA log from SAL and copy it into the OS log buffer.
*
* Inputs : info_type (SAL_INFO_TYPE_{MCA,INIT,CMC,CPE})
+ * irq_safe whether you can use printk at this point
* Outputs : size (total record length)
* *buffer (ptr to error record)
*
*/
static u64
-ia64_log_get(int sal_info_type, u8 **buffer)
+ia64_log_get(int sal_info_type, u8 **buffer, int irq_safe)
{
sal_log_record_header_t *log_buffer;
u64 total_len = 0;
int s;
- int irq_safe = sal_info_type != SAL_INFO_TYPE_MCA && sal_info_type != SAL_INFO_TYPE_INIT;
IA64_LOG_LOCK(sal_info_type);
@@ -252,11 +252,11 @@ ia64_mca_log_sal_error_record(int sal_in
int irq_safe = sal_info_type != SAL_INFO_TYPE_MCA && sal_info_type != SAL_INFO_TYPE_INIT;
static const char * const rec_name[] = { "MCA", "INIT", "CMC", "CPE" };
- size = ia64_log_get(sal_info_type, &buffer);
+ size = ia64_log_get(sal_info_type, &buffer, irq_safe);
if (!size)
return;
- salinfo_log_wakeup(sal_info_type, buffer, size);
+ salinfo_log_wakeup(sal_info_type, buffer, size, irq_safe);
if (irq_safe || called_from_init)
printk(KERN_INFO "CPU %d: SAL log contains %s error record\n",
Index: 25-pre8.5/arch/ia64/kernel/salinfo.c
--- 25-pre8.5/arch/ia64/kernel/salinfo.c Sun, 25 Jan 2004 06:42:02 +1100 kaos (linux-2.4/K/g/22_salinfo.c 1.1.1.1.1.1.1.2 644)
+++ 25-pre8.6/arch/ia64/kernel/salinfo.c Fri, 06 Feb 2004 17:29:43 +1100 kaos (linux-2.4/K/g/22_salinfo.c 1.1.1.1.1.1.1.3 644)
@@ -194,12 +194,12 @@ shift1_data_saved (struct salinfo_data *
* changes.
*/
void
-salinfo_log_wakeup(int type, u8 *buffer, u64 size)
+salinfo_log_wakeup(int type, u8 *buffer, u64 size, int irqsafe)
{
struct salinfo_data *data = salinfo_data + type;
struct salinfo_data_saved *data_saved;
unsigned long flags = 0;
- int i, irqsafe = type != SAL_INFO_TYPE_MCA && type != SAL_INFO_TYPE_INIT;
+ int i;
int saved_size = ARRAY_SIZE(data->data_saved);
BUG_ON(type >= ARRAY_SIZE(salinfo_log_name));
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [patch] 2.4.25-pre8, 2.6.2-rc2 mca.c - pass irq_safe around
2004-02-06 6:37 [patch] 2.4.25-pre8, 2.6.2-rc2 mca.c - pass irq_safe around Keith Owens
@ 2004-02-10 22:57 ` David Mosberger
2004-02-10 23:05 ` Keith Owens
1 sibling, 0 replies; 3+ messages in thread
From: David Mosberger @ 2004-02-10 22:57 UTC (permalink / raw)
To: linux-ia64
>>>>> On Fri, 06 Feb 2004 17:37:03 +1100, Keith Owens <kaos@sgi.com> said:
Keith> The patch is against 2.4.25-pre8 bk. It also applies to
Keith> 2.6.2-rc2 bk (with some fuzz and offsets), after applying my
Keith> previous 6 patches to 2.6.2-rc2 mca.c.
Keith> Patches from Ben Woodward to calculate irq_safe once and pass
Keith> it around.
I applied the patch but I'm wondering what happens if someone adds a
new SAL_INFO_TYPE which isn't irq-safe. Wouldn't it be safer to flip
things around and check sal_info_type against known-to-be-safe values?
--david
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] 2.4.25-pre8, 2.6.2-rc2 mca.c - pass irq_safe around
2004-02-06 6:37 [patch] 2.4.25-pre8, 2.6.2-rc2 mca.c - pass irq_safe around Keith Owens
2004-02-10 22:57 ` David Mosberger
@ 2004-02-10 23:05 ` Keith Owens
1 sibling, 0 replies; 3+ messages in thread
From: Keith Owens @ 2004-02-10 23:05 UTC (permalink / raw)
To: linux-ia64
On Tue, 10 Feb 2004 14:57:17 -0800,
David Mosberger <davidm@napali.hpl.hp.com> wrote:
>>>>>> On Fri, 06 Feb 2004 17:37:03 +1100, Keith Owens <kaos@sgi.com> said:
> Keith> Patches from Ben Woodward to calculate irq_safe once and pass
> Keith> it around.
>
>I applied the patch but I'm wondering what happens if someone adds a
>new SAL_INFO_TYPE which isn't irq-safe. Wouldn't it be safer to flip
>things around and check sal_info_type against known-to-be-safe values?
Adding a new type requires changes all through mca.c and salinfo.c, as
well as user space. The periodic timer in salinfo has to explicitly
scan the irq unsafe entries. We would spot any new unsafe type.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-02-10 23:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-06 6:37 [patch] 2.4.25-pre8, 2.6.2-rc2 mca.c - pass irq_safe around Keith Owens
2004-02-10 22:57 ` David Mosberger
2004-02-10 23:05 ` Keith Owens
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox