Re: [PATCH] irqflags: fix (at least latent) code generation issue

From: Jan Beulich
Date: Fri Nov 28 2014 - 12:10:38 EST


>>> On 10.11.14 at 13:13, <mingo@xxxxxxxxxx> wrote:
> * Jan Beulich <JBeulich@xxxxxxxx> wrote:
>> @@ -131,7 +131,7 @@
>> } while (0)
>>
>>
>> -#else /* !CONFIG_TRACE_IRQFLAGS_SUPPORT */
>> +#else /* !CONFIG_TRACE_IRQFLAGS */
>>
>> #define local_irq_enable() do { raw_local_irq_enable(); } while (0)
>> #define local_irq_disable() do { raw_local_irq_disable(); } while (0)
>> @@ -145,6 +145,6 @@
>> #define irqs_disabled_flags(flags) (raw_irqs_disabled_flags(flags))
>> #define safe_halt() do { raw_safe_halt(); } while (0)
>>
>> -#endif /* CONFIG_TRACE_IRQFLAGS_SUPPORT */
>> +#endif /* CONFIG_TRACE_IRQFLAGS */
>
> So this breaks a couple of non-x86 architectures, such as MIPS:
>
> /home/mingo/tip/include/acpi/platform/aclinuxex.h: In function
> 'acpi_os_allocate':
> /home/mingo/tip/include/acpi/platform/aclinuxex.h:86: error: implicit
> declaration of function 'arch_irqs_disabled'

Now that I finally found time to look into this a little, I wonder what
you expect: Code in linux/irqflags.h ahead of the above conditional
uses arch_irqs_disable():

#define raw_irqs_disabled() (arch_irqs_disabled())

so it would seem to me that architectures are required to have the
latter available. And in fact it would seem very logical to me if pieces
like the definition of irqs_disabled() would be pulled out of that
conditional, as their behavior shouldn't (for this one) or already
doesn't (for e.g. irqs_disabled_flags() and local_save_flags()) differ
between the two cases. Would, short of adding arch_irqs_disabled()
for all architectures currently lacking it, uniformly using the definition
from the #if portion of the conditional be an acceptable thing? If not,
do you have any other suggestion on how to resolve this?

Jan

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/