Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PM / shmobile: Don't include SH7372's INTCS in syscore suspend/resume

Since the SH7372's INTCS in included into syscore suspend/resume,
which causes the chip to be accessed when PM domains have been
turned off during system suspend, the A4R domain containing the
INTCS has to stay on during system sleep, which is suboptimal
from the power consumption point of view.

For this reason, add a new INTC flag, skip_syscore_suspend, to mark
the INTCS for intc_suspend() and intc_resume(), so that they don't
touch it. This allows the A4R domain to be turned off during
system suspend and the INTCS state is resrored during system
resume by the A4R's "power on" code.

Suggested-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Magnus Damm <damm@opensource.se>

+11
+1
arch/arm/mach-shmobile/intc-sh7372.c
··· 535 535 static struct intc_desc intcs_desc __initdata = { 536 536 .name = "sh7372-intcs", 537 537 .force_enable = ENABLED_INTCS, 538 + .skip_syscore_suspend = true, 538 539 .resource = intcs_resources, 539 540 .num_resources = ARRAY_SIZE(intcs_resources), 540 541 .hw = INTC_HW_DESC(intcs_vectors, intcs_groups, intcs_mask_registers,
+8
drivers/sh/intc/core.c
··· 354 354 if (desc->force_enable) 355 355 intc_enable_disable_enum(desc, d, desc->force_enable, 1); 356 356 357 + d->skip_suspend = desc->skip_syscore_suspend; 358 + 357 359 nr_intc_controllers++; 358 360 359 361 return 0; ··· 388 386 list_for_each_entry(d, &intc_list, list) { 389 387 int irq; 390 388 389 + if (d->skip_suspend) 390 + continue; 391 + 391 392 /* enable wakeup irqs belonging to this intc controller */ 392 393 for_each_active_irq(irq) { 393 394 struct irq_data *data; ··· 413 408 414 409 list_for_each_entry(d, &intc_list, list) { 415 410 int irq; 411 + 412 + if (d->skip_suspend) 413 + continue; 416 414 417 415 for_each_active_irq(irq) { 418 416 struct irq_data *data;
+1
drivers/sh/intc/internals.h
··· 67 67 struct intc_window *window; 68 68 unsigned int nr_windows; 69 69 struct irq_chip chip; 70 + bool skip_suspend; 70 71 }; 71 72 72 73
+1
include/linux/sh_intc.h
··· 95 95 unsigned int num_resources; 96 96 intc_enum force_enable; 97 97 intc_enum force_disable; 98 + bool skip_syscore_suspend; 98 99 struct intc_hw_desc hw; 99 100 }; 100 101