Prepare for running ACPI on !x86 and !ia64
v4 cover Prepare for running ACPI on !x86 and !ia64
Some of the ACPI code is arch-dependent and make the code can't be compiled on !x86 or !ia64, the first two patches just do some rework on the idle_boot_override and _PDC related stuff to make the ACPI code more arch-independent.
The third patch just introduce map_gic_id() for ACPI processor core followed the ACPI 5.0 spec. Last two patches are just some cleanups.
I have compiled the kernel successfully after appling this patch set on x86 and ia64.
Changes for v4:
a) remove preprocessor directives in function bodies;
b) add another two patches for cleanups.
Changes for v3:
Fix the issues pointed out by Lan Tianyu and add the Reviewed-by for first patch.
Changes for v2:
a) add #if defined(CONFIG_X86) || defined(CONFIG_IA64) for idle_boot_override related code;
b) Rebased on 3.14-rc1.
Changes since the RFC version:
a) Remove the RFC tag;
b) Move idle_boot_override out of the arch directory suggested by Alan;
c) Make these 3 patches as a separate patch set since there are not not related to the ARM/ARM64 platform.
Hanjun Guo (5):
ACPI / idle: Make idle_boot_override depend on x86 and ia64 ACPI / processor_core: Rework _PDC related stuff to make it more
arch-independent
ACPI / processor: Introduce map_gic_id() to get apic id from MADT or
_MAT method
ACPI: Move BAD_MADT_ENTRY() to linux/acpi.h
ACPI: Replace printk with pr_* in tables.c
arch/ia64/include/asm/acpi.h | 5 +-- arch/ia64/kernel/acpi.c | 18 ++++++-- arch/x86/include/asm/acpi.h | 19 +-------- arch/x86/kernel/acpi/boot.c | 4 -- arch/x86/kernel/acpi/cstate.c | 29 +++++++++++++ drivers/acpi/processor_core.c | 92 ++++++++++++++++++++++++----------------- drivers/acpi/tables.c | 51 +++++++++-------------- include/linux/acpi.h | 4 ++ 8 files changed, 124 insertions(+), 98 deletions(-)
Signature · 1 line
1.7.9.5
PATCH v4 1/5 ACPI / idle: Make idle_boot_override depend on x86 and ia64
idle_boot_override depends on x86 and ia64 now, and we can not foresee it will be used on ARM or ARM64, so move the code into CONFIG_X86 and CONFIG_IA64 #ifdefs to make processor_core.c can be compiled on ARM64.
--- drivers/acpi/processor_core.c | 47 ++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 19 deletions(-)
drivers/acpi/processor_core.c +28 -19
@@ -19,24 +19,6 @@#define _COMPONENT ACPI_PROCESSOR_COMPONENTACPI_MODULE_NAME ("processor_core" ); -static int __init set_no_mwait (const struct dmi_system_id *id) -{ - printk(KERN_NOTICE PREFIX "%s detected - " - "disabling mwait for CPU C-states\n", id->ident); - boot_option_idle_override =IDLE_NOMWAIT ; -return 0 ; -} - -static struct dmi_system_id processor_idle_dmi_table[]__initdata = { - { - set_no_mwait,"Extensa 5220" , { -DMI_MATCH (DMI_BIOS_VENDOR ,"Phoenix Technologies LTD" ), -DMI_MATCH (DMI_SYS_VENDOR ,"Acer" ), -DMI_MATCH (DMI_PRODUCT_VERSION ,"0100" ), -DMI_MATCH (DMI_BOARD_NAME ,"Columbia" ) },NULL }, - {}, -}; -static int map_lapic_id (struct acpi_subtable_header *entry,u32 acpi_id,int *apic_id) {
@@ -379,13 +361,40 @@ early_init_pdc(acpi_handle handle, u32 lvl, void *context, void **rv)return AE_OK ; } -void __init acpi_early_processor_set_pdc (void ) +#if defined(CONFIG_X86 ) || defined(CONFIG_IA64 ) +static int __init set_no_mwait (const struct dmi_system_id *id) +{ +pr_notice (PREFIX "%s detected - disabling mwait for CPU C-states\n" , + id->ident); + boot_option_idle_override =IDLE_NOMWAIT ; +return 0 ; +} + +static struct dmi_system_id processor_idle_dmi_table[]__initdata = { + { + set_no_mwait,"Extensa 5220" , { +DMI_MATCH (DMI_BIOS_VENDOR ,"Phoenix Technologies LTD" ), +DMI_MATCH (DMI_SYS_VENDOR ,"Acer" ), +DMI_MATCH (DMI_PRODUCT_VERSION ,"0100" ), +DMI_MATCH (DMI_BOARD_NAME ,"Columbia" ) },NULL }, + {}, +}; + +static void __init processor_dmi_check (void ) {/* * Check whether the system is DMI table. If yes, OSPM * should not use mwait for CPU-states. */ dmi_check_system (processor_idle_dmi_table); +} +#else +static inline void processor_dmi_check (void ) {} +#endif + +void __init acpi_early_processor_set_pdc (void ) +{ +processor_dmi_check (); acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
Signature · 1 line
1.7.9.5
PATCH v4 2/5 ACPI / processor_core: Rework _PDC related stuff to make it more arch-independent
In reply to Hanjun Guo_PDC related stuff in processor_core.c is little bit X86/IA64 dependent, rework the code to make it more arch-independent, no functional change in this patch.
--- arch/ia64/include/asm/acpi.h | 5 +---- arch/ia64/kernel/acpi.c | 14 ++++++++++++++ arch/x86/include/asm/acpi.h | 19 +------------------ arch/x86/kernel/acpi/cstate.c | 29 +++++++++++++++++++++++++++++ drivers/acpi/processor_core.c | 19 +------------------ 5 files changed, 46 insertions(+), 40 deletions(-)
arch/ia64/include/asm/acpi.h +1 -4
@@ -152,10 +152,7 @@ extern int __initdata nid_to_pxm_map[MAX_NUMNODES];#endif static inline bool arch_has_acpi_pdc (void ) {return true; } -static inline void arch_acpi_set_pdc_bits (u32 *buf) -{ - buf[2 ] |=ACPI_PDC_EST_CAPABILITY_SMP ; -} +extern void arch_acpi_set_pdc_bits (u32 *buf);#define acpi_unlazy_tlb (x)
arch/ia64/kernel/acpi.c +14 -0
@@ -1014,3 +1014,17 @@ EXPORT_SYMBOL(acpi_unregister_ioapic);* TBD when when IA64 starts to support suspend... */ int acpi_suspend_lowlevel (void ) {return 0 ; } + +void arch_acpi_set_pdc_bits (u32 *buf) +{ +/* Enable coordination with firmware's _TSD info */ + buf[2 ] |=ACPI_PDC_SMP_T_SWCOORD |ACPI_PDC_EST_CAPABILITY_SMP ; +if (boot_option_idle_override ==IDLE_NOMWAIT ) { +/* +* If mwait is disabled for CPU C-states, the C2C3_FFH access +* mode will be disabled in the parameter of _PDC object. +* Of course C1_FFH access mode will also be disabled. +*/ + buf[2 ] &= ~(ACPI_PDC_C_C2C3_FFH |ACPI_PDC_C_C1_FFH ); + } +}
arch/x86/include/asm/acpi.h +1 -18
@@ -147,24 +147,7 @@ static inline bool arch_has_acpi_pdc(void) c->x86_vendor == X86_VENDOR_CENTAUR); } -static inline void arch_acpi_set_pdc_bits (u32 *buf) -{ -struct cpuinfo_x86 *c = &cpu_data (0 ); - - buf[2 ] |=ACPI_PDC_C_CAPABILITY_SMP ; - -if (cpu_has (c,X86_FEATURE_EST )) - buf[2 ] |=ACPI_PDC_EST_CAPABILITY_SWSMP ; - -if (cpu_has (c,X86_FEATURE_ACPI )) - buf[2 ] |=ACPI_PDC_T_FFH ; - -/* -* If mwait/monitor is unsupported, C2/C3_FFH will be disabled -*/ -if (!cpu_has (c,X86_FEATURE_MWAIT )) - buf[2 ] &= ~(ACPI_PDC_C_C2C3_FFH ); -} +extern void arch_acpi_set_pdc_bits (u32 *buf);#else /* !CONFIG_ACPI */
arch/x86/kernel/acpi/cstate.c +29 -0
@@ -16,6 +16,35 @@#include <asm/mwait.h> #include <asm/special_insns.h> +void arch_acpi_set_pdc_bits (u32 *buf) +{ +struct cpuinfo_x86 *c = &cpu_data (0 ); + +/* Enable coordination with firmware's _TSD info */ + buf[2 ] |=ACPI_PDC_SMP_T_SWCOORD |ACPI_PDC_C_CAPABILITY_SMP ; + +if (cpu_has (c,X86_FEATURE_EST )) + buf[2 ] |=ACPI_PDC_EST_CAPABILITY_SWSMP ; + +if (cpu_has (c,X86_FEATURE_ACPI )) + buf[2 ] |=ACPI_PDC_T_FFH ; + +/* +* If mwait/monitor is unsupported, C2/C3_FFH will be disabled +*/ +if (!cpu_has (c,X86_FEATURE_MWAIT )) + buf[2 ] &= ~(ACPI_PDC_C_C2C3_FFH ); + +if (boot_option_idle_override ==IDLE_NOMWAIT ) { +/* +* If mwait is disabled for CPU C-states, the C2C3_FFH access +* mode will be disabled in the parameter of _PDC object. +* Of course C1_FFH access mode will also be disabled. +*/ + buf[2 ] &= ~(ACPI_PDC_C_C2C3_FFH |ACPI_PDC_C_C1_FFH ); + } +} +/* * Initialize bm_flags based on the CPU cache properties * On SMP it depends on cache configuration
drivers/acpi/processor_core.c +1 -18
@@ -255,9 +255,6 @@ static void acpi_set_pdc_bits(u32 *buf) buf[0 ] =ACPI_PDC_REVISION_ID ; buf[1 ] =1 ; -/* Enable coordination with firmware's _TSD info */ - buf[2 ] =ACPI_PDC_SMP_T_SWCOORD ; -/* Twiddle arch-specific bits needed for _PDC */ arch_acpi_set_pdc_bits (buf); }
@@ -282,7 +279,7 @@ static struct acpi_object_list *acpi_processor_alloc_pdc(void)return NULL ; } - buf =kmalloc (12 ,GFP_KERNEL ); + buf =kzalloc (12 ,GFP_KERNEL );if (!buf) {printk (KERN_ERR "Memory allocation error\n" );kfree (obj);
@@ -310,20 +307,6 @@ acpi_processor_eval_pdc(acpi_handle handle, struct acpi_object_list *pdc_in) {acpi_status status =AE_OK ; -if (boot_option_idle_override ==IDLE_NOMWAIT ) { -/* -* If mwait is disabled for CPU C-states, the C2C3_FFH access -* mode will be disabled in the parameter of _PDC object. -* Of course C1_FFH access mode will also be disabled. -*/ -union acpi_object *obj; -u32 *buffer =NULL ; - - obj = pdc_in->pointer; - buffer = (u32 *)(obj->buffer.pointer); - buffer[2 ] &= ~(ACPI_PDC_C_C2C3_FFH |ACPI_PDC_C_C1_FFH ); - - } status =acpi_evaluate_object (handle,"_PDC" , pdc_in,NULL );if (ACPI_FAILURE (status))
Signature · 1 line
1.7.9.5
PATCH v4 3/5 ACPI / processor: Introduce map_gic_id() to get apic id from MADT or _MAT method
In reply to Hanjun GuoGet apic id from MADT or _MAT method is not implemented on arm/arm64, and ACPI 5.0 introduces GIC Structure for it, so this patch introduces map_gic_id() to get apic id followed the ACPI 5.0 spec.
--- drivers/acpi/processor_core.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
drivers/acpi/processor_core.c +26 -0
@@ -71,6 +71,27 @@ static int map_lsapic_id(struct acpi_subtable_header *entry,return 0 ; } +static int map_gic_id (struct acpi_subtable_header *entry, +int device_declaration,u32 acpi_id,int *apic_id) +{ +struct acpi_madt_generic_interrupt *gic = + (struct acpi_madt_generic_interrupt *)entry; + +if (!(gic->flags &ACPI_MADT_ENABLED )) +return -ENODEV ; + +/* In the GIC interrupt model, logical processors are +* required to have a Processor Device object in the DSDT, +* so we should check device_declaration here +*/ +if (device_declaration && (gic->uid == acpi_id)) { + *apic_id = gic->gic_id; +return 0 ; + } + +return -EINVAL ; +} +static int map_madt_entry (int type,u32 acpi_id) {unsigned long madt_end, entry;
@@ -106,6 +127,9 @@ static int map_madt_entry(int type, u32 acpi_id) }else if (header->type ==ACPI_MADT_TYPE_LOCAL_SAPIC ) {if (!map_lsapic_id (header, type, acpi_id, &apic_id))break ; + }else if (header->type ==ACPI_MADT_TYPE_GENERIC_INTERRUPT ) { +if (!map_gic_id (header, type, acpi_id, &apic_id)) +break ; } entry += header->length; }
@@ -136,6 +160,8 @@ static int map_mat_entry(acpi_handle handle, int type, u32 acpi_id)map_lapic_id (header, acpi_id, &apic_id); }else if (header->type ==ACPI_MADT_TYPE_LOCAL_SAPIC ) {map_lsapic_id (header, type, acpi_id, &apic_id); + }else if (header->type ==ACPI_MADT_TYPE_GENERIC_INTERRUPT ) { +map_gic_id (header, type, acpi_id, &apic_id); } exit:
Signature · 1 line
1.7.9.5
PATCH v4 4/5 ACPI: Move BAD_MADT_ENTRY() to linux/acpi.h
In reply to Hanjun GuoBAD_MADT_ENTRY() is arch independent and will be used for all archs which parsing MADT table, so move it to linux/acpi.h to simply the code.
--- arch/ia64/kernel/acpi.c | 4 ---- arch/x86/kernel/acpi/boot.c | 4 ---- include/linux/acpi.h | 4 ++++ 3 files changed, 4 insertions(+), 8 deletions(-)
arch/ia64/kernel/acpi.c +0 -4
@@ -54,10 +54,6 @@#include <asm/sal.h> #include <asm/cyclone.h> -#define BAD_MADT_ENTRY (entry, end) ( \ - (!entry) || (unsigned long)entry + sizeof(*entry) > end || \ - ((struct acpi_subtable_header *)entry)->length < sizeof(*entry)) -#define PREFIX "ACPI: "unsigned int acpi_cpei_override;
arch/x86/kernel/acpi/boot.c +0 -4
@@ -53,10 +53,6 @@ EXPORT_SYMBOL(acpi_disabled);# include <asm/proto.h> #endif /* X86 */ -#define BAD_MADT_ENTRY (entry, end) ( \ - (!entry) || (unsigned long)entry + sizeof(*entry) > end || \ - ((struct acpi_subtable_header *)entry)->length < sizeof(*entry)) -#define PREFIX "ACPI: "int acpi_noirq;/* skip ACPI IRQ initialization */
include/linux/acpi.h +4 -0
@@ -108,6 +108,10 @@ static inline void acpi_initrd_override(void *data, size_t size) }#endif +#define BAD_MADT_ENTRY (entry, end) ( \ + (!entry) || (unsigned long)entry + sizeof(*entry) > end || \ + ((struct acpi_subtable_header *)entry)->length < sizeof(*entry)) +char *__acpi_map_table (unsigned long phys_addr,unsigned long size);void __acpi_unmap_table (char *map,unsigned long size);int early_acpi_boot_init (void );
Signature · 1 line
1.7.9.5
PATCH v4 5/5 ACPI: Replace printk with pr_* in tables.c
In reply to Hanjun GuoThis patch just do some clean up to replace printk with pr_*, no functional change.
--- drivers/acpi/tables.c | 51 +++++++++++++++++++------------------------------ 1 file changed, 20 insertions(+), 31 deletions(-)
drivers/acpi/tables.c +20 -31
@@ -55,8 +55,7 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) {struct acpi_madt_local_apic *p = (struct acpi_madt_local_apic *)header; - printk(KERN_INFO PREFIX -"LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n" , +pr_info (PREFIX "LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n" , p->processor_id, p->id, (p->lapic_flags &ACPI_MADT_ENABLED ) ?"enabled" :"disabled" ); }
@@ -66,8 +65,7 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) {struct acpi_madt_local_x2apic *p = (struct acpi_madt_local_x2apic *)header; - printk(KERN_INFO PREFIX -"X2APIC (apic_id[0x%02x] uid[0x%02x] %s)\n" , +pr_info (PREFIX "X2APIC (apic_id[0x%02x] uid[0x%02x] %s)\n" , p->local_apic_id, p->uid, (p->lapic_flags &ACPI_MADT_ENABLED ) ?"enabled" :"disabled" );
@@ -78,8 +76,7 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) {struct acpi_madt_io_apic *p = (struct acpi_madt_io_apic *)header; - printk(KERN_INFO PREFIX -"IOAPIC (id[0x%02x] address[0x%08x] gsi_base[%d])\n" , +pr_info (PREFIX "IOAPIC (id[0x%02x] address[0x%08x] gsi_base[%d])\n" , p->id, p->address, p->global_irq_base); }break ;
@@ -88,15 +85,13 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) {struct acpi_madt_interrupt_override *p = (struct acpi_madt_interrupt_override *)header; - printk(KERN_INFO PREFIX -"INT_SRC_OVR (bus %d bus_irq %d global_irq %d %s %s)\n" , +pr_info (PREFIX "INT_SRC_OVR (bus %d bus_irq %d global_irq %d %s %s)\n" , p->bus, p->source_irq, p->global_irq, mps_inti_flags_polarity[p->inti_flags &ACPI_MADT_POLARITY_MASK ], mps_inti_flags_trigger[(p->inti_flags &ACPI_MADT_TRIGGER_MASK ) >>2 ]);if (p->inti_flags & ~(ACPI_MADT_POLARITY_MASK |ACPI_MADT_TRIGGER_MASK )) - printk(KERN_INFO PREFIX -"INT_SRC_OVR unexpected reserved flags: 0x%x\n" , +pr_info (PREFIX "INT_SRC_OVR unexpected reserved flags: 0x%x\n" , p->inti_flags & ~(ACPI_MADT_POLARITY_MASK |ACPI_MADT_TRIGGER_MASK ));
@@ -107,8 +102,7 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) {struct acpi_madt_nmi_source *p = (struct acpi_madt_nmi_source *)header; - printk(KERN_INFO PREFIX -"NMI_SRC (%s %s global_irq %d)\n" , +pr_info (PREFIX "NMI_SRC (%s %s global_irq %d)\n" , mps_inti_flags_polarity[p->inti_flags &ACPI_MADT_POLARITY_MASK ], mps_inti_flags_trigger[(p->inti_flags &ACPI_MADT_TRIGGER_MASK ) >>2 ], p->global_irq);
@@ -119,8 +113,7 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) {struct acpi_madt_local_apic_nmi *p = (struct acpi_madt_local_apic_nmi *)header; - printk(KERN_INFO PREFIX -"LAPIC_NMI (acpi_id[0x%02x] %s %s lint[0x%x])\n" , + pr_info(PREFIX "LAPIC_NMI (acpi_id[0x%02x] %s %s lint[0x%x])\n", p->processor_id, mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK ], mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2],
@@ -137,7 +130,7 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) polarity = p->inti_flags &ACPI_MADT_POLARITY_MASK ; trigger = (p->inti_flags &ACPI_MADT_TRIGGER_MASK ) >>2 ; - printk(KERN_INFO PREFIX + pr_info(PREFIX "X2APIC_NMI (uid[0x%02x] %s %s lint[0x%x])\n", p->uid, mps_inti_flags_polarity[polarity],
@@ -150,8 +143,7 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) {struct acpi_madt_local_apic_override *p = (struct acpi_madt_local_apic_override *)header; - printk(KERN_INFO PREFIX -"LAPIC_ADDR_OVR (address[%p])\n" , +pr_info (PREFIX "LAPIC_ADDR_OVR (address[%p])\n" , (void *)(unsigned long )p->address); }break ;
@@ -160,7 +152,7 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) {struct acpi_madt_io_sapic *p = (struct acpi_madt_io_sapic *)header; - printk(KERN_INFO PREFIX +pr_info (PREFIX "IOSAPIC (id[0x%x] address[%p] gsi_base[%d])\n" , p->id, (void *)(unsigned long )p->address, p->global_irq_base);
@@ -171,7 +163,7 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) {struct acpi_madt_local_sapic *p = (struct acpi_madt_local_sapic *)header; - printk(KERN_INFO PREFIX +pr_info (PREFIX "LSAPIC (acpi_id[0x%02x] lsapic_id[0x%02x] lsapic_eid[0x%02x] %s)\n" , p->processor_id, p->id, p->eid, (p->lapic_flags &ACPI_MADT_ENABLED ) ?"enabled" :"disabled" );
@@ -182,7 +174,7 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) {struct acpi_madt_interrupt_source *p = (struct acpi_madt_interrupt_source *)header; - printk(KERN_INFO PREFIX + pr_info(PREFIX "PLAT_INT_SRC (%s %s type[0x%x] id[0x%04x] eid[0x%x] iosapic_vector[0x%x] global_irq[0x%x]\n", mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK], mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2],
@@ -192,8 +184,7 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header)break ;default : - printk(KERN_WARNING PREFIX -"Found unsupported MADT entry (type = 0x%x)\n" , +pr_warn (PREFIX "Found unsupported MADT entry (type = 0x%x)\n" , header->type);break ; }
@@ -225,7 +216,7 @@ acpi_table_parse_entries(char *id,acpi_get_table_with_size (id,0 , &table_header, &tbl_size);if (!table_header) { - printk(KERN_WARNING PREFIX "%4.4s not present\n", id); +pr_warn (PREFIX "%4.4s not present\n" , id);return -ENODEV ; }
@@ -256,8 +247,8 @@ acpi_table_parse_entries(char *id, ((unsigned long )entry + entry->length); }if (max_entries && count > max_entries) { - printk(KERN_WARNING PREFIX "[%4.4s:0x%02x] ignored %i entries of " - "%i found\n", id, entry_id, count - max_entries, count); +pr_warn (PREFIX "[%4.4s:0x%02x] ignored %i entries of %i found\n" , + id, entry_id, count - max_entries, count); }early_acpi_os_unmap_memory ((char *)table_header, tbl_size);
@@ -322,11 +313,9 @@ static void __init check_multiple_madt(void)acpi_get_table_with_size (ACPI_SIG_MADT ,2 , &table, &tbl_size);if (table) { - printk(KERN_WARNING PREFIX -"BIOS bug: multiple APIC/MADT found," - " using %d\n", acpi_apic_instance); - printk(KERN_WARNING PREFIX -"If \"acpi_apic_instance=%d\" works better, " +pr_warn (PREFIX "BIOS bug: multiple APIC/MADT found, using %d\n" , + acpi_apic_instance); +pr_warn (PREFIX "If \"acpi_apic_instance=%d\" works better, " "notify [email protected]\n" , acpi_apic_instance ?0 :2 );early_acpi_os_unmap_memory (table, tbl_size);
@@ -365,7 +354,7 @@ static int __init acpi_parse_apic_instance(char *str) acpi_apic_instance =simple_strtoul (str,NULL ,0 ); - printk(KERN_NOTICE PREFIX "Shall use APIC/MADT table %d\n", +pr_notice (PREFIX "Shall use APIC/MADT table %d\n" , acpi_apic_instance);return 0 ;
Signature · 1 line
1.7.9.5
Re: [PATCH v4 5/5] ACPI: Replace printk with pr_* in tables.c
Quoted 2 lines · Hanjun Guo
This patch just do some clean up to replace printk with pr_*, no functional change.
trivial note:
drivers/acpi/tables.c
Quoted 1 line
drivers/acpi/tables.c +0
-0
[]
drivers/acpi/tables.c void acpi_table_print_madt_entry(struct acpi_subtable_header *header) · line 60
Quoted 9 lines
drivers/acpi/tables.c +1
-2@@ -55,8 +55,7 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) {struct acpi_madt_local_apic *p = (struct acpi_madt_local_apic *)header; - printk(KERN_INFO PREFIX -"LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n" , +pr_info (PREFIX "LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n" , p->processor_id, p->id, (p->lapic_flags &ACPI_MADT_ENABLED ) ?"enabled" :"disabled" );
It'd be nice to realign the additional lines to the open parenthesis, here and everywhere else in this patch
pr_info(PREFIX "LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n", p->processor_id, p->id, (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled");
Re: [PATCH v4 5/5] ACPI: Replace printk with pr_* in tables.c
Quoted 19 lines · Joe Perches
Quoted 2 lines · Hanjun Guo
This patch just do some clean up to replace printk with pr_*, no functional change.
trivial note:
drivers/acpi/tables.c
Quoted 1 line
drivers/acpi/tables.c +0
-0[]
drivers/acpi/tables.c void acpi_table_print_madt_entry(struct acpi_subtable_header *header) · line 60
Quoted 9 lines
drivers/acpi/tables.c +1
-2@@ -55,8 +55,7 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) {struct acpi_madt_local_apic *p = (struct acpi_madt_local_apic *)header; - printk(KERN_INFO PREFIX -"LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n" , +pr_info (PREFIX "LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n" , p->processor_id, p->id, (p->lapic_flags &ACPI_MADT_ENABLED ) ?"enabled" :"disabled" );It'd be nice to realign the additional lines to the open parenthesis, here and everywhere else in this patch
Quoted 3 lines
pr_info(PREFIX "LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n", p->processor_id, p->id, (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled");
Thanks for your comments, will update patch 1/5 and 5/5 follow your suggestion :)
Hanjun
Re: [Linaro-acpi] [PATCH v4 5/5] ACPI: Replace printk with pr_* in tables.c
In reply to Hanjun GuoQuoted 3 lines · Hanjun Guo
This patch just do some clean up to replace printk with pr_*, no functional change.
Any particular reason for choosing just this file in this series ? It seems but off-topic in this series. The printk format is same in almost all other acpi files and it's better to change all or none for consistency.
Quoted 10 lines
Signed-off-by Hanjun Guo <[email protected]>--- drivers/acpi/tables.c | 51 +++++++++++++++++++------------------------------ 1 file changed, 20 insertions(+), 31 deletions(-)drivers/acpi/tables.c +0
-0
drivers/acpi/tables.c void acpi_table_print_madt_entry(struct acpi_subtable_header *header) · line 58
Quoted 6 lines
drivers/acpi/tables.c +1
-2@@ -55,8 +55,7 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) {struct acpi_madt_local_apic *p = (struct acpi_madt_local_apic *)header; - printk(KERN_INFO PREFIX - "LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n", + pr_info(PREFIX "LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n",
You can even get rid of PREFIX by defining pr_fmt instead.
If the intention is to move to pr_* format it's better to have this as separate patch and convert all of them. Based on the grep patterns, regex should to helpful to find and replace them all :)
Regards,
Sudeep
Re: [Linaro-acpi] [PATCH v4 5/5] ACPI: Replace printk with pr_* in tables.c
Quoted 7 lines · Sudeep Holla
Quoted 3 lines · Hanjun Guo
This patch just do some clean up to replace printk with pr_*, no functional change.
Any particular reason for choosing just this file in this series ? It seems but off-topic in this series. The printk format is same in almost all other acpi files and it's better to change all or none for consistency.
Well, it's fine, I can put it into a different branch in any case. :-)
Quoted 5 lines
Quoted 5 lines
Signed-off-by Hanjun Guo <[email protected]>--- drivers/acpi/tables.c | 51 +++++++++++++++++++------------------------------ 1 file changed, 20 insertions(+), 31 deletions(-)
Quoted 13 lines
drivers/acpi/tables.c void acpi_table_print_madt_entry(struct acpi_subtable_header *header) · line 58
Quoted 11 lines
drivers/acpi/tables.c +1
-2@@ -55,8 +55,7 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) {struct acpi_madt_local_apic *p = (struct acpi_madt_local_apic *)header; - printk(KERN_INFO PREFIX - "LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n", + pr_info(PREFIX "LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n",You can even get rid of PREFIX by defining
pr_fmtinstead.
But this is a good point.
Quoted 2 lines
If the intention is to move to pr_* format it's better to have this as separate patch and convert all of them.
Well, not really. One file at a time is OK too.
Thanks!
Signature · 2 lines
I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.
Re: [Linaro-acpi] [PATCH v4 5/5] ACPI: Replace printk with pr_* in tables.c
Quoted 30 lines · Rafael J. Wysocki
Quoted 7 lines · Sudeep Holla
Quoted 3 lines · Hanjun Guo
This patch just do some clean up to replace printk with pr_*, no functional change.
Any particular reason for choosing just this file in this series ? It seems but off-topic in this series. The printk format is same in almost all other acpi files and it's better to change all or none for consistency.
Well, it's fine, I can put it into a different branch in any case. :-)
Quoted 5 lines
Quoted 5 lines
Signed-off-by Hanjun Guo <[email protected]>--- drivers/acpi/tables.c | 51 +++++++++++++++++++------------------------------ 1 file changed, 20 insertions(+), 31 deletions(-)Quoted 13 lines
drivers/acpi/tables.c void acpi_table_print_madt_entry(struct acpi_subtable_header *header) · line 58
Quoted 11 lines
drivers/acpi/tables.c +1
-2@@ -55,8 +55,7 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) {struct acpi_madt_local_apic *p = (struct acpi_madt_local_apic *)header; - printk(KERN_INFO PREFIX - "LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n", + pr_info(PREFIX "LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n",You can even get rid of PREFIX by defining
pr_fmtinstead.
Quoted 7 lines
But this is a good point.
Quoted 2 lines
If the intention is to move to pr_* format it's better to have this as separate patch and convert all of them.
Well, not really. One file at a time is OK too.
No what I meant was to convert all for consistency, not in a single patch. As I was playing with regex for few minutes, with few patterns was able to fix most(not all) of them. It even compiles :) for x86. But turns out to be a big churn :( [43 files changed, 253 insertions(+), 329 deletions(-)]
Regards,
Sudeep
Re: [Linaro-acpi] [PATCH v4 5/5] ACPI: Replace printk with pr_* in tables.c
Quoted 36 lines · Sudeep Holla
Quoted 35 lines · Rafael J. Wysocki
Quoted 7 lines · Sudeep Holla
Quoted 3 lines · Hanjun Guo
This patch just do some clean up to replace printk with pr_*, no functional change.
Any particular reason for choosing just this file in this series ? It seems but off-topic in this series. The printk format is same in almost all other acpi files and it's better to change all or none for consistency.
Well, it's fine, I can put it into a different branch in any case. :-)
Quoted 5 lines
Quoted 5 lines
Signed-off-by Hanjun Guo <[email protected]>--- drivers/acpi/tables.c | 51 +++++++++++++++++++------------------------------ 1 file changed, 20 insertions(+), 31 deletions(-)Quoted 13 lines
drivers/acpi/tables.c void acpi_table_print_madt_entry(struct acpi_subtable_header *header) · line 58
Quoted 11 lines
drivers/acpi/tables.c +1
-2@@ -55,8 +55,7 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) {struct acpi_madt_local_apic *p = (struct acpi_madt_local_apic *)header; - printk(KERN_INFO PREFIX - "LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n", + pr_info(PREFIX "LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n",You can even get rid of PREFIX by defining
pr_fmtinstead.But this is a good point.
Quoted 2 lines
If the intention is to move to pr_* format it's better to have this as separate patch and convert all of them.
Quoted 6 lines
Quoted 2 lines
Well, not really. One file at a time is OK too.
No what I meant was to convert all for consistency, not in a single patch. As I was playing with regex for few minutes, with few patterns was able to fix most(not all) of them. It even compiles :) for x86. But turns out to be a big churn :( [43 files changed, 253 insertions(+), 329 deletions(-)]
Well, precisely. That's why I'd prefer doing that gradually.
That said I'll just drop the patch for now due to the PREFIX thing.
Thanks!
Signature · 2 lines
I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.
Re: [Linaro-acpi] [PATCH v4 5/5] ACPI: Replace printk with pr_* in tables.c
Quoted 8 lines · Rafael J. Wysocki
Quoted 7 lines · Sudeep Holla
Quoted 6 lines · Rafael J. Wysocki
Quoted 5 lines · Sudeep Holla
Quoted 3 lines · Hanjun Guo
This patch just do some clean up to replace printk with pr_*, no functional change.
Any particular reason for choosing just this file in this series ?
Yes, the reason is that I will update this file in my next patch set (ARM64 ACPI core) with
pr_*, in order to keep consistency, I updated them all in this file first.
Quoted 27 lines
Quoted 27 lines
Quoted 27 lines
Quoted 2 lines
It seems but off-topic in this series. The printk format is same in almost all other acpi files and it's better to change all or none for consistency.
Well, it's fine, I can put it into a different branch in any case. :-)
Quoted 5 lines
Quoted 5 lines
Signed-off-by Hanjun Guo <[email protected]>--- drivers/acpi/tables.c | 51 +++++++++++++++++++------------------------------ 1 file changed, 20 insertions(+), 31 deletions(-)Quoted 12 lines
drivers/acpi/tables.c void acpi_table_print_madt_entry(struct acpi_subtable_header *header) · line 58
Quoted 11 lines
drivers/acpi/tables.c +1
-2@@ -55,8 +55,7 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) {struct acpi_madt_local_apic *p = (struct acpi_madt_local_apic *)header; - printk(KERN_INFO PREFIX - "LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n", + pr_info(PREFIX "LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n",You can even get rid of PREFIX by defining
pr_fmtinstead.But this is a good point.
Quoted 2 lines
If the intention is to move to pr_* format it's better to have this as separate patch and convert all of them.
Well, not really. One file at a time is OK too.
Quoted 7 lines
Quoted 4 lines
No what I meant was to convert all for consistency, not in a single patch. As I was playing with regex for few minutes, with few patterns was able to fix most(not all) of them. It even compiles :) for x86. But turns out to be a big churn :( [43 files changed, 253 insertions(+), 329 deletions(-)]
Well, precisely. That's why I'd prefer doing that gradually.
That said I'll just drop the patch for now due to the PREFIX thing.
I will update this patch accordingly and send it out soon.
Thanks
Hanjun