soc: driver updates for 6.19

This is the first half of the driver changes:
 
  - A treewide interface change to the "syscore" operations for
    power management, as a preparation for future Tegra specific
    changes.
 
  - Reset controller updates with added drivers for LAN969x, eic770
    and RZ/G3S SoCs.
 
  - Protection of system controller registers on Renesas and Google SoCs,
    to prevent trivially triggering a system crash from e.g. debugfs
    access.
 
  - soc_device identification updates on Nvidia, Exynos and Mediatek
 
  - debugfs support in the ST STM32 firewall driver
 
  - Minor updates for SoC drivers on AMD/Xilinx, Renesas,  Allwinner, TI
 
  - Cleanups for memory controller support on Nvidia and Renesas
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmky/8gACgkQmmx57+YA
 GNlqohAApPTLM6Q4gf1cIcsTVaP0uxx9CBgupCGuT5ORrOMKBghVWjTOTSxeEAab
 UQF465QwYUUu602GH34UmRaY9CKW2bMIsfmkgmxNB4Y4Qd7yCgQNJ/h/TnN0rBH+
 qTeEsRH/hax4miSNsh0oOZfVkZkg+23VF02d1VL0CcaX7y4oT45RPBQugrNx/gNS
 fHfVwgIq8vJ8WyrmM1h2nv1i1vgSzEy50B3kY674BBw83FcJTafNLvD7N5DSgD1H
 /I/2xeyEpb+oL1VfeHcXZaX/jf04O+cmvSzBi+MOH1tI3MpdxJib1vEYBdggoOWN
 K/FFGgsOY+DNmJPpSnPTTu8UpzksS8SxGBP7M9Q8roKZwA2c9wLotxySvjki5yv8
 2zvabRdzbrSaoYwsH9QnZdQ2hVkJ9W8MESu8PevD3yMNuFUzledPDWW0N1SbGm78
 0ZdB6NPdaBZYHMNMRdFhN8P275/Mx5e0XWN9oYMQqjPooH7YkyT7hJWz6ao2PCJP
 8mDmnW1RzL+LWf7mJ25ZEtS+YjmKA/PVmogRrGurKCadvdxXqCF09KNljICHhmmu
 t0KB4dqw02OXLPvBk21qCi0zL56w1JDgqtS8suFvDYo9sCceeAbAcmpyoUOFj2N+
 Upn976tb4iqFrr9mFswpmCJWPpqJkU+A+KnKsIRPU7N4kSrP35I=
 =HvlN
 -----END PGP SIGNATURE-----

Merge tag 'soc-drivers-6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull SoC driver updates from Arnd Bergmann:
 "This is the first half of the driver changes:

   - A treewide interface change to the "syscore" operations for power
     management, as a preparation for future Tegra specific changes

   - Reset controller updates with added drivers for LAN969x, eic770 and
     RZ/G3S SoCs

   - Protection of system controller registers on Renesas and Google
     SoCs, to prevent trivially triggering a system crash from e.g.
     debugfs access

   - soc_device identification updates on Nvidia, Exynos and Mediatek

   - debugfs support in the ST STM32 firewall driver

   - Minor updates for SoC drivers on AMD/Xilinx, Renesas, Allwinner, TI

   - Cleanups for memory controller support on Nvidia and Renesas"

* tag 'soc-drivers-6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (114 commits)
  memory: tegra186-emc: Fix missing put_bpmp
  Documentation: reset: Remove reset_controller_add_lookup()
  reset: fix BIT macro reference
  reset: rzg2l-usbphy-ctrl: Fix a NULL vs IS_ERR() bug in probe
  reset: th1520: Support reset controllers in more subsystems
  reset: th1520: Prepare for supporting multiple controllers
  dt-bindings: reset: thead,th1520-reset: Add controllers for more subsys
  dt-bindings: reset: thead,th1520-reset: Remove non-VO-subsystem resets
  reset: remove legacy reset lookup code
  clk: davinci: psc: drop unused reset lookup
  reset: rzg2l-usbphy-ctrl: Add support for RZ/G3S SoC
  reset: rzg2l-usbphy-ctrl: Add support for USB PWRRDY
  dt-bindings: reset: renesas,rzg2l-usbphy-ctrl: Document RZ/G3S support
  reset: eswin: Add eic7700 reset driver
  dt-bindings: reset: eswin: Documentation for eic7700 SoC
  reset: sparx5: add LAN969x support
  dt-bindings: reset: microchip: Add LAN969x support
  soc: rockchip: grf: Add select correct PWM implementation on RK3368
  soc/tegra: pmc: Add USB wake events for Tegra234
  amba: tegra-ahb: Fix device leak on SMMU enable
  ...
This commit is contained in:
Linus Torvalds 2025-12-05 17:29:04 -08:00
commit 208eed95fc
188 changed files with 5897 additions and 1291 deletions

View File

@ -33,14 +33,18 @@ select:
properties:
compatible:
contains:
const: st,stm32mp25-rifsc
enum:
- st,stm32mp21-rifsc
- st,stm32mp25-rifsc
required:
- compatible
properties:
compatible:
items:
- const: st,stm32mp25-rifsc
- enum:
- st,stm32mp21-rifsc
- st,stm32mp25-rifsc
- const: simple-bus
reg:

View File

@ -21,6 +21,7 @@ properties:
compatible:
enum:
- qcom,ipq5424-llcc
- qcom,kaanapali-llcc
- qcom,qcs615-llcc
- qcom,qcs8300-llcc
- qcom,qdu1000-llcc
@ -272,6 +273,7 @@ allOf:
compatible:
contains:
enum:
- qcom,kaanapali-llcc
- qcom,sm8450-llcc
- qcom,sm8550-llcc
- qcom,sm8650-llcc

View File

@ -23,6 +23,7 @@ properties:
- enum:
- qcom,scm-apq8064
- qcom,scm-apq8084
- qcom,scm-glymur
- qcom,scm-ipq4019
- qcom,scm-ipq5018
- qcom,scm-ipq5332
@ -31,6 +32,7 @@ properties:
- qcom,scm-ipq806x
- qcom,scm-ipq8074
- qcom,scm-ipq9574
- qcom,scm-kaanapali
- qcom,scm-mdm9607
- qcom,scm-milos
- qcom,scm-msm8226
@ -202,6 +204,7 @@ allOf:
compatible:
contains:
enum:
- qcom,scm-kaanapali
- qcom,scm-milos
- qcom,scm-sm8450
- qcom,scm-sm8550

View File

@ -20,12 +20,14 @@ properties:
- samsung,exynos5433-chipid
- samsung,exynos7-chipid
- samsung,exynos7870-chipid
- samsung,exynos8890-chipid
- const: samsung,exynos4210-chipid
- items:
- enum:
- samsung,exynos2200-chipid
- samsung,exynos7885-chipid
- samsung,exynos8895-chipid
- samsung,exynos9610-chipid
- samsung,exynos9810-chipid
- samsung,exynos990-chipid
- samsung,exynosautov9-chipid

View File

@ -0,0 +1,42 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/reset/eswin,eic7700-reset.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: ESWIN EIC7700 SoC reset controller
maintainers:
- Yifeng Huang <huangyifeng@eswincomputing.com>
- Xuyang Dong <dongxuyang@eswincomputing.com>
description:
The system reset controller can be used to reset various peripheral
controllers in ESWIN eic7700 SoC.
properties:
compatible:
const: eswin,eic7700-reset
reg:
maxItems: 1
'#reset-cells':
const: 1
required:
- compatible
- reg
- '#reset-cells'
additionalProperties: false
examples:
- |
#include <dt-bindings/reset/eswin,eic7700-reset.h>
reset-controller@51828300 {
compatible = "eswin,eic7700-reset";
reg = <0x51828300 0x200>;
#reset-cells = <1>;
};

View File

@ -20,9 +20,14 @@ properties:
pattern: "^reset-controller@[0-9a-f]+$"
compatible:
enum:
oneOf:
- enum:
- microchip,sparx5-switch-reset
- microchip,lan966x-switch-reset
- items:
- enum:
- microchip,lan9691-switch-reset
- const: microchip,lan966x-switch-reset
reg:
items:

View File

@ -15,12 +15,14 @@ description:
properties:
compatible:
items:
oneOf:
- items:
- enum:
- renesas,r9a07g043-usbphy-ctrl # RZ/G2UL and RZ/Five
- renesas,r9a07g044-usbphy-ctrl # RZ/G2{L,LC}
- renesas,r9a07g054-usbphy-ctrl # RZ/V2L
- const: renesas,rzg2l-usbphy-ctrl
- const: renesas,r9a08g045-usbphy-ctrl # RZ/G3S
reg:
maxItems: 1
@ -48,6 +50,20 @@ properties:
$ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false
renesas,sysc-pwrrdy:
description:
The system controller PWRRDY indicates to the USB PHY if the power supply
is ready. PWRRDY needs to be set during power-on before applying any
other settings. It also needs to be set before powering off the USB.
$ref: /schemas/types.yaml#/definitions/phandle-array
items:
- items:
- description:
System controller phandle required by USB PHY CTRL driver to set
PWRRDY
- description: Register offset associated with PWRRDY
- description: Register bitmask associated with PWRRDY
required:
- compatible
- reg
@ -57,6 +73,19 @@ required:
- '#reset-cells'
- regulator-vbus
allOf:
- if:
properties:
compatible:
contains:
const: renesas,r9a08g045-usbphy-ctrl
then:
required:
- renesas,sysc-pwrrdy
else:
properties:
renesas,sysc-pwrrdy: false
additionalProperties: false
examples:

View File

@ -16,7 +16,13 @@ maintainers:
properties:
compatible:
enum:
- thead,th1520-reset
- thead,th1520-reset # Reset controller for VO subsystem
- thead,th1520-reset-ao
- thead,th1520-reset-ap
- thead,th1520-reset-dsp
- thead,th1520-reset-misc
- thead,th1520-reset-vi
- thead,th1520-reset-vp
reg:
maxItems: 1

View File

@ -52,6 +52,7 @@ properties:
- items:
- enum:
- mediatek,mt8188-pwrap
- mediatek,mt8189-pwrap
- const: mediatek,mt8195-pwrap
- const: syscon

View File

@ -25,6 +25,8 @@ properties:
compatible:
items:
- enum:
- qcom,glymur-aoss-qmp
- qcom,kaanapali-aoss-qmp
- qcom,milos-aoss-qmp
- qcom,qcs615-aoss-qmp
- qcom,qcs8300-aoss-qmp

View File

@ -55,6 +55,7 @@ properties:
- samsung,exynos2200-pmu
- samsung,exynos7870-pmu
- samsung,exynos7885-pmu
- samsung,exynos8890-pmu
- samsung,exynos8895-pmu
- samsung,exynos9810-pmu
- samsung,exynos990-pmu
@ -172,6 +173,7 @@ allOf:
- samsung,exynos5250-pmu
- samsung,exynos5420-pmu
- samsung,exynos5433-pmu
- samsung,exynos7870-pmu
then:
properties:
mipi-phy: true

View File

@ -15,7 +15,9 @@ properties:
- items:
- enum:
- google,gs101-apm-sysreg
- google,gs101-hsi0-sysreg
- google,gs101-hsi2-sysreg
- google,gs101-misc-sysreg
- google,gs101-peric0-sysreg
- google,gs101-peric1-sysreg
- samsung,exynos2200-cmgp-sysreg
@ -26,10 +28,14 @@ properties:
- samsung,exynos3-sysreg
- samsung,exynos4-sysreg
- samsung,exynos5-sysreg
- samsung,exynos7870-cam0-sysreg
- samsung,exynos7870-disp-sysreg
- samsung,exynos8895-fsys0-sysreg
- samsung,exynos8895-fsys1-sysreg
- samsung,exynos8895-peric0-sysreg
- samsung,exynos8895-peric1-sysreg
- samsung,exynos990-peric0-sysreg
- samsung,exynos990-peric1-sysreg
- samsung,exynosautov920-hsi2-sysreg
- samsung,exynosautov920-peric0-sysreg
- samsung,exynosautov920-peric1-sysreg
@ -73,6 +79,9 @@ properties:
clocks:
maxItems: 1
power-domains:
maxItems: 1
required:
- compatible
- reg
@ -83,7 +92,9 @@ allOf:
compatible:
contains:
enum:
- google,gs101-hsi0-sysreg
- google,gs101-hsi2-sysreg
- google,gs101-misc-sysreg
- google,gs101-peric0-sysreg
- google,gs101-peric1-sysreg
- samsung,exynos850-cmgp-sysreg
@ -93,6 +104,8 @@ allOf:
- samsung,exynos8895-fsys1-sysreg
- samsung,exynos8895-peric0-sysreg
- samsung,exynos8895-peric1-sysreg
- samsung,exynos990-peric0-sysreg
- samsung,exynos990-peric1-sysreg
then:
required:
- clocks
@ -100,6 +113,16 @@ allOf:
properties:
clocks: false
- if:
properties:
compatible:
not:
contains:
pattern: "^google,gs101-[^-]+-sysreg$"
then:
properties:
power-domains: false
additionalProperties: false
examples:

View File

@ -218,4 +218,3 @@ devm_reset_controller_register().
reset_controller_register
reset_controller_unregister
devm_reset_controller_register
reset_controller_add_lookup

View File

@ -10679,6 +10679,7 @@ F: Documentation/devicetree/bindings/clock/google,gs101-clock.yaml
F: Documentation/devicetree/bindings/soc/google/google,gs101-pmu-intr-gen.yaml
F: arch/arm64/boot/dts/exynos/google/
F: drivers/clk/samsung/clk-gs101.c
F: drivers/soc/samsung/gs101-pmu.c
F: drivers/phy/samsung/phy-gs101-ufs.c
F: include/dt-bindings/clock/google,gs101.h
K: [gG]oogle.?[tT]ensor

View File

@ -215,7 +215,7 @@ static const struct of_device_id exynos_dt_mcpm_match[] = {
{},
};
static void exynos_mcpm_setup_entry_point(void)
static void exynos_mcpm_setup_entry_point(void *data)
{
/*
* U-Boot SPL is hardcoded to jump to the start of ns_sram_base_addr
@ -228,10 +228,14 @@ static void exynos_mcpm_setup_entry_point(void)
__raw_writel(__pa_symbol(mcpm_entry_point), ns_sram_base_addr + 8);
}
static struct syscore_ops exynos_mcpm_syscore_ops = {
static const struct syscore_ops exynos_mcpm_syscore_ops = {
.resume = exynos_mcpm_setup_entry_point,
};
static struct syscore exynos_mcpm_syscore = {
.ops = &exynos_mcpm_syscore_ops,
};
static int __init exynos_mcpm_init(void)
{
struct device_node *node;
@ -300,9 +304,9 @@ static int __init exynos_mcpm_init(void)
pmu_raw_writel(value, EXYNOS_COMMON_OPTION(i));
}
exynos_mcpm_setup_entry_point();
exynos_mcpm_setup_entry_point(NULL);
register_syscore_ops(&exynos_mcpm_syscore_ops);
register_syscore(&exynos_mcpm_syscore);
return ret;
}

View File

@ -53,9 +53,9 @@ struct exynos_pm_data {
void (*pm_prepare)(void);
void (*pm_resume_prepare)(void);
void (*pm_resume)(void);
int (*pm_suspend)(void);
int (*cpu_suspend)(unsigned long);
const struct syscore_ops *syscore_ops;
};
/* Used only on Exynos542x/5800 */
@ -376,7 +376,7 @@ static void exynos5420_pm_prepare(void)
}
static int exynos_pm_suspend(void)
static int exynos_pm_suspend(void *data)
{
exynos_pm_central_suspend();
@ -390,7 +390,7 @@ static int exynos_pm_suspend(void)
return 0;
}
static int exynos5420_pm_suspend(void)
static int exynos5420_pm_suspend(void *data)
{
u32 this_cluster;
@ -408,7 +408,7 @@ static int exynos5420_pm_suspend(void)
return 0;
}
static void exynos_pm_resume(void)
static void exynos_pm_resume(void *data)
{
u32 cpuid = read_cpuid_part();
@ -429,7 +429,7 @@ static void exynos_pm_resume(void)
exynos_set_delayed_reset_assertion(true);
}
static void exynos3250_pm_resume(void)
static void exynos3250_pm_resume(void *data)
{
u32 cpuid = read_cpuid_part();
@ -473,7 +473,7 @@ static void exynos5420_prepare_pm_resume(void)
}
}
static void exynos5420_pm_resume(void)
static void exynos5420_pm_resume(void *data)
{
unsigned long tmp;
@ -596,41 +596,52 @@ static const struct platform_suspend_ops exynos_suspend_ops = {
.valid = suspend_valid_only_mem,
};
static const struct syscore_ops exynos3250_syscore_ops = {
.suspend = exynos_pm_suspend,
.resume = exynos3250_pm_resume,
};
static const struct exynos_pm_data exynos3250_pm_data = {
.wkup_irq = exynos3250_wkup_irq,
.wake_disable_mask = ((0xFF << 8) | (0x1F << 1)),
.pm_suspend = exynos_pm_suspend,
.pm_resume = exynos3250_pm_resume,
.pm_prepare = exynos3250_pm_prepare,
.cpu_suspend = exynos3250_cpu_suspend,
.syscore_ops = &exynos3250_syscore_ops,
};
static const struct syscore_ops exynos_syscore_ops = {
.suspend = exynos_pm_suspend,
.resume = exynos_pm_resume,
};
static const struct exynos_pm_data exynos4_pm_data = {
.wkup_irq = exynos4_wkup_irq,
.wake_disable_mask = ((0xFF << 8) | (0x1F << 1)),
.pm_suspend = exynos_pm_suspend,
.pm_resume = exynos_pm_resume,
.pm_prepare = exynos_pm_prepare,
.cpu_suspend = exynos_cpu_suspend,
.syscore_ops = &exynos_syscore_ops,
};
static const struct exynos_pm_data exynos5250_pm_data = {
.wkup_irq = exynos5250_wkup_irq,
.wake_disable_mask = ((0xFF << 8) | (0x1F << 1)),
.pm_suspend = exynos_pm_suspend,
.pm_resume = exynos_pm_resume,
.pm_prepare = exynos_pm_prepare,
.cpu_suspend = exynos_cpu_suspend,
.syscore_ops = &exynos_syscore_ops,
};
static const struct syscore_ops exynos5420_syscore_ops = {
.resume = exynos5420_pm_resume,
.suspend = exynos5420_pm_suspend,
};
static const struct exynos_pm_data exynos5420_pm_data = {
.wkup_irq = exynos5250_wkup_irq,
.wake_disable_mask = (0x7F << 7) | (0x1F << 1),
.pm_resume_prepare = exynos5420_prepare_pm_resume,
.pm_resume = exynos5420_pm_resume,
.pm_suspend = exynos5420_pm_suspend,
.pm_prepare = exynos5420_pm_prepare,
.cpu_suspend = exynos5420_cpu_suspend,
.syscore_ops = &exynos5420_syscore_ops,
};
static const struct of_device_id exynos_pmu_of_device_ids[] __initconst = {
@ -656,7 +667,7 @@ static const struct of_device_id exynos_pmu_of_device_ids[] __initconst = {
{ /*sentinel*/ },
};
static struct syscore_ops exynos_pm_syscore_ops;
static struct syscore exynos_pm_syscore;
void __init exynos_pm_init(void)
{
@ -684,10 +695,9 @@ void __init exynos_pm_init(void)
tmp |= pm_data->wake_disable_mask;
pmu_raw_writel(tmp, S5P_WAKEUP_MASK);
exynos_pm_syscore_ops.suspend = pm_data->pm_suspend;
exynos_pm_syscore_ops.resume = pm_data->pm_resume;
exynos_pm_syscore.ops = pm_data->syscore_ops;
register_syscore_ops(&exynos_pm_syscore_ops);
register_syscore(&exynos_pm_syscore);
suspend_set_ops(&exynos_suspend_ops);
/*

View File

@ -34,9 +34,9 @@ extern void __init pxa27x_map_io(void);
extern void __init pxa3xx_init_irq(void);
extern void __init pxa3xx_map_io(void);
extern struct syscore_ops pxa_irq_syscore_ops;
extern struct syscore_ops pxa2xx_mfp_syscore_ops;
extern struct syscore_ops pxa3xx_mfp_syscore_ops;
extern struct syscore pxa_irq_syscore;
extern struct syscore pxa2xx_mfp_syscore;
extern struct syscore pxa3xx_mfp_syscore;
void __init pxa_set_ffuart_info(void *info);
void __init pxa_set_btuart_info(void *info);

View File

@ -178,7 +178,7 @@ void __init pxa_init_irq(int irq_nr, int (*fn)(struct irq_data *, unsigned int))
static unsigned long saved_icmr[MAX_INTERNAL_IRQS/32];
static unsigned long saved_ipr[MAX_INTERNAL_IRQS];
static int pxa_irq_suspend(void)
static int pxa_irq_suspend(void *data)
{
int i;
@ -197,7 +197,7 @@ static int pxa_irq_suspend(void)
return 0;
}
static void pxa_irq_resume(void)
static void pxa_irq_resume(void *data)
{
int i;
@ -219,11 +219,15 @@ static void pxa_irq_resume(void)
#define pxa_irq_resume NULL
#endif
struct syscore_ops pxa_irq_syscore_ops = {
static const struct syscore_ops pxa_irq_syscore_ops = {
.suspend = pxa_irq_suspend,
.resume = pxa_irq_resume,
};
struct syscore pxa_irq_syscore = {
.ops = &pxa_irq_syscore_ops,
};
#ifdef CONFIG_OF
static const struct of_device_id intc_ids[] __initconst = {
{ .compatible = "marvell,pxa-intc", },

View File

@ -346,7 +346,7 @@ static unsigned long saved_gpdr[4];
static unsigned long saved_gplr[4];
static unsigned long saved_pgsr[4];
static int pxa2xx_mfp_suspend(void)
static int pxa2xx_mfp_suspend(void *data)
{
int i;
@ -385,7 +385,7 @@ static int pxa2xx_mfp_suspend(void)
return 0;
}
static void pxa2xx_mfp_resume(void)
static void pxa2xx_mfp_resume(void *data)
{
int i;
@ -404,11 +404,15 @@ static void pxa2xx_mfp_resume(void)
#define pxa2xx_mfp_resume NULL
#endif
struct syscore_ops pxa2xx_mfp_syscore_ops = {
static const struct syscore_ops pxa2xx_mfp_syscore_ops = {
.suspend = pxa2xx_mfp_suspend,
.resume = pxa2xx_mfp_resume,
};
struct syscore pxa2xx_mfp_syscore = {
.ops = &pxa2xx_mfp_syscore_ops,
};
static int __init pxa2xx_mfp_init(void)
{
int i;

View File

@ -27,13 +27,13 @@
* a pull-down mode if they're an active low chip select, and we're
* just entering standby.
*/
static int pxa3xx_mfp_suspend(void)
static int pxa3xx_mfp_suspend(void *data)
{
mfp_config_lpm();
return 0;
}
static void pxa3xx_mfp_resume(void)
static void pxa3xx_mfp_resume(void *data)
{
mfp_config_run();
@ -49,7 +49,11 @@ static void pxa3xx_mfp_resume(void)
#define pxa3xx_mfp_resume NULL
#endif
struct syscore_ops pxa3xx_mfp_syscore_ops = {
static const struct syscore_ops pxa3xx_mfp_syscore_ops = {
.suspend = pxa3xx_mfp_suspend,
.resume = pxa3xx_mfp_resume,
};
struct syscore pxa3xx_mfp_syscore = {
.ops = &pxa3xx_mfp_syscore_ops,
};

View File

@ -235,8 +235,8 @@ static int __init pxa25x_init(void)
pxa25x_init_pm();
register_syscore_ops(&pxa_irq_syscore_ops);
register_syscore_ops(&pxa2xx_mfp_syscore_ops);
register_syscore(&pxa_irq_syscore);
register_syscore(&pxa2xx_mfp_syscore);
if (!of_have_populated_dt()) {
software_node_register(&pxa2xx_gpiochip_node);

View File

@ -337,8 +337,8 @@ static int __init pxa27x_init(void)
pxa27x_init_pm();
register_syscore_ops(&pxa_irq_syscore_ops);
register_syscore_ops(&pxa2xx_mfp_syscore_ops);
register_syscore(&pxa_irq_syscore);
register_syscore(&pxa2xx_mfp_syscore);
if (!of_have_populated_dt()) {
software_node_register(&pxa2xx_gpiochip_node);

View File

@ -424,8 +424,8 @@ static int __init pxa3xx_init(void)
if (cpu_is_pxa320())
enable_irq_wake(IRQ_WAKEUP1);
register_syscore_ops(&pxa_irq_syscore_ops);
register_syscore_ops(&pxa3xx_mfp_syscore_ops);
register_syscore(&pxa_irq_syscore);
register_syscore(&pxa3xx_mfp_syscore);
}
return ret;

View File

@ -18,7 +18,7 @@ static unsigned long msc[2];
static unsigned long sxcnfg, memclkcfg;
static unsigned long csadrcfg[4];
static int pxa3xx_smemc_suspend(void)
static int pxa3xx_smemc_suspend(void *data)
{
msc[0] = __raw_readl(MSC0);
msc[1] = __raw_readl(MSC1);
@ -32,7 +32,7 @@ static int pxa3xx_smemc_suspend(void)
return 0;
}
static void pxa3xx_smemc_resume(void)
static void pxa3xx_smemc_resume(void *data)
{
__raw_writel(msc[0], MSC0);
__raw_writel(msc[1], MSC1);
@ -46,11 +46,15 @@ static void pxa3xx_smemc_resume(void)
__raw_writel(0x2, CSMSADRCFG);
}
static struct syscore_ops smemc_syscore_ops = {
static const struct syscore_ops smemc_syscore_ops = {
.suspend = pxa3xx_smemc_suspend,
.resume = pxa3xx_smemc_resume,
};
static struct syscore smemc_syscore = {
.ops = &smemc_syscore_ops,
};
static int __init smemc_init(void)
{
if (cpu_is_pxa3xx()) {
@ -64,7 +68,7 @@ static int __init smemc_init(void)
*/
__raw_writel(0x2, CSMSADRCFG);
register_syscore_ops(&smemc_syscore_ops);
register_syscore(&smemc_syscore);
}
return 0;

View File

@ -58,7 +58,7 @@ static struct irq_grp_save {
static u32 irq_uart_mask[SERIAL_SAMSUNG_UARTS];
static int s3c64xx_irq_pm_suspend(void)
static int s3c64xx_irq_pm_suspend(void *data)
{
struct irq_grp_save *grp = eint_grp_save;
int i;
@ -79,7 +79,7 @@ static int s3c64xx_irq_pm_suspend(void)
return 0;
}
static void s3c64xx_irq_pm_resume(void)
static void s3c64xx_irq_pm_resume(void *data)
{
struct irq_grp_save *grp = eint_grp_save;
int i;
@ -100,18 +100,22 @@ static void s3c64xx_irq_pm_resume(void)
S3C_PMDBG("%s: IRQ configuration restored\n", __func__);
}
static struct syscore_ops s3c64xx_irq_syscore_ops = {
static const struct syscore_ops s3c64xx_irq_syscore_ops = {
.suspend = s3c64xx_irq_pm_suspend,
.resume = s3c64xx_irq_pm_resume,
};
static struct syscore s3c64xx_irq_syscore = {
.ops = &s3c64xx_irq_syscore_ops,
};
static __init int s3c64xx_syscore_init(void)
{
/* Appropriate drivers (pinctrl, uart) handle this when using DT. */
if (of_have_populated_dt() || !soc_is_s3c64xx())
return 0;
register_syscore_ops(&s3c64xx_irq_syscore_ops);
register_syscore(&s3c64xx_irq_syscore);
return 0;
}

View File

@ -195,20 +195,24 @@ static const struct platform_suspend_ops s5pv210_suspend_ops = {
/*
* Syscore operations used to delay restore of certain registers.
*/
static void s5pv210_pm_resume(void)
static void s5pv210_pm_resume(void *data)
{
s3c_pm_do_restore_core(s5pv210_core_save, ARRAY_SIZE(s5pv210_core_save));
}
static struct syscore_ops s5pv210_pm_syscore_ops = {
static const struct syscore_ops s5pv210_pm_syscore_ops = {
.resume = s5pv210_pm_resume,
};
static struct syscore s5pv210_pm_syscore = {
.ops = &s5pv210_pm_syscore_ops,
};
/*
* Initialization entry point.
*/
void __init s5pv210_pm_init(void)
{
register_syscore_ops(&s5pv210_pm_syscore_ops);
register_syscore(&s5pv210_pm_syscore);
suspend_set_ops(&s5pv210_suspend_ops);
}

View File

@ -63,13 +63,13 @@ static void __init ap_map_io(void)
#ifdef CONFIG_PM
static unsigned long ic_irq_enable;
static int irq_suspend(void)
static int irq_suspend(void *data)
{
ic_irq_enable = readl(VA_IC_BASE + IRQ_ENABLE);
return 0;
}
static void irq_resume(void)
static void irq_resume(void *data)
{
/* disable all irq sources */
cm_clear_irqs();
@ -83,14 +83,18 @@ static void irq_resume(void)
#define irq_resume NULL
#endif
static struct syscore_ops irq_syscore_ops = {
static const struct syscore_ops irq_syscore_ops = {
.suspend = irq_suspend,
.resume = irq_resume,
};
static struct syscore irq_syscore = {
.ops = &irq_syscore_ops,
};
static int __init irq_syscore_init(void)
{
register_syscore_ops(&irq_syscore_ops);
register_syscore(&irq_syscore);
return 0;
}

View File

@ -256,7 +256,7 @@ static int b15_rac_dead_cpu(unsigned int cpu)
return 0;
}
static int b15_rac_suspend(void)
static int b15_rac_suspend(void *data)
{
/* Suspend the read-ahead cache oeprations, forcing our cache
* implementation to fallback to the regular ARMv7 calls.
@ -271,7 +271,7 @@ static int b15_rac_suspend(void)
return 0;
}
static void b15_rac_resume(void)
static void b15_rac_resume(void *data)
{
/* Coming out of a S3 suspend/resume cycle, the read-ahead cache
* register RAC_CONFIG0_REG will be restored to its default value, make
@ -282,11 +282,15 @@ static void b15_rac_resume(void)
clear_bit(RAC_SUSPENDED, &b15_rac_flags);
}
static struct syscore_ops b15_rac_syscore_ops = {
static const struct syscore_ops b15_rac_syscore_ops = {
.suspend = b15_rac_suspend,
.resume = b15_rac_resume,
};
static struct syscore b15_rac_syscore = {
.ops = &b15_rac_syscore_ops,
};
static int __init b15_rac_init(void)
{
struct device_node *dn, *cpu_dn;
@ -347,7 +351,7 @@ static int __init b15_rac_init(void)
}
if (IS_ENABLED(CONFIG_PM_SLEEP))
register_syscore_ops(&b15_rac_syscore_ops);
register_syscore(&b15_rac_syscore);
spin_lock(&rac_lock);
reg = __raw_readl(b15_rac_base + RAC_CONFIG0_REG);

View File

@ -535,28 +535,32 @@ int hibernate_resume_nonboot_cpu_disable(void)
*/
#ifdef CONFIG_PM
static int loongson_ipi_suspend(void)
static int loongson_ipi_suspend(void *data)
{
return 0;
}
static void loongson_ipi_resume(void)
static void loongson_ipi_resume(void *data)
{
iocsr_write32(0xffffffff, LOONGARCH_IOCSR_IPI_EN);
}
static struct syscore_ops loongson_ipi_syscore_ops = {
static const struct syscore_ops loongson_ipi_syscore_ops = {
.resume = loongson_ipi_resume,
.suspend = loongson_ipi_suspend,
};
static struct syscore loongson_ipi_syscore = {
.ops = &loongson_ipi_syscore_ops,
};
/*
* Enable boot cpu ipi before enabling nonboot cpus
* during syscore_resume.
*/
static int __init ipi_pm_init(void)
{
register_syscore_ops(&loongson_ipi_syscore_ops);
register_syscore(&loongson_ipi_syscore);
return 0;
}

View File

@ -982,7 +982,7 @@ u32 au1xxx_dbdma_put_dscr(u32 chanid, au1x_ddma_desc_t *dscr)
static unsigned long alchemy_dbdma_pm_data[NUM_DBDMA_CHANS + 1][6];
static int alchemy_dbdma_suspend(void)
static int alchemy_dbdma_suspend(void *data)
{
int i;
void __iomem *addr;
@ -1019,7 +1019,7 @@ static int alchemy_dbdma_suspend(void)
return 0;
}
static void alchemy_dbdma_resume(void)
static void alchemy_dbdma_resume(void *data)
{
int i;
void __iomem *addr;
@ -1044,11 +1044,15 @@ static void alchemy_dbdma_resume(void)
}
}
static struct syscore_ops alchemy_dbdma_syscore_ops = {
static const struct syscore_ops alchemy_dbdma_syscore_ops = {
.suspend = alchemy_dbdma_suspend,
.resume = alchemy_dbdma_resume,
};
static struct syscore alchemy_dbdma_syscore = {
.ops = &alchemy_dbdma_syscore_ops,
};
static int __init dbdma_setup(unsigned int irq, dbdev_tab_t *idtable)
{
int ret;
@ -1071,7 +1075,7 @@ static int __init dbdma_setup(unsigned int irq, dbdev_tab_t *idtable)
printk(KERN_ERR "Cannot grab DBDMA interrupt!\n");
else {
dbdma_initialized = 1;
register_syscore_ops(&alchemy_dbdma_syscore_ops);
register_syscore(&alchemy_dbdma_syscore);
}
return ret;

View File

@ -758,7 +758,7 @@ static inline void alchemy_ic_resume_one(void __iomem *base, unsigned long *d)
wmb();
}
static int alchemy_ic_suspend(void)
static int alchemy_ic_suspend(void *data)
{
alchemy_ic_suspend_one((void __iomem *)KSEG1ADDR(AU1000_IC0_PHYS_ADDR),
alchemy_gpic_pmdata);
@ -767,7 +767,7 @@ static int alchemy_ic_suspend(void)
return 0;
}
static void alchemy_ic_resume(void)
static void alchemy_ic_resume(void *data)
{
alchemy_ic_resume_one((void __iomem *)KSEG1ADDR(AU1000_IC1_PHYS_ADDR),
&alchemy_gpic_pmdata[7]);
@ -775,7 +775,7 @@ static void alchemy_ic_resume(void)
alchemy_gpic_pmdata);
}
static int alchemy_gpic_suspend(void)
static int alchemy_gpic_suspend(void *data)
{
void __iomem *base = (void __iomem *)KSEG1ADDR(AU1300_GPIC_PHYS_ADDR);
int i;
@ -806,7 +806,7 @@ static int alchemy_gpic_suspend(void)
return 0;
}
static void alchemy_gpic_resume(void)
static void alchemy_gpic_resume(void *data)
{
void __iomem *base = (void __iomem *)KSEG1ADDR(AU1300_GPIC_PHYS_ADDR);
int i;
@ -837,16 +837,24 @@ static void alchemy_gpic_resume(void)
wmb();
}
static struct syscore_ops alchemy_ic_pmops = {
static const struct syscore_ops alchemy_ic_pmops = {
.suspend = alchemy_ic_suspend,
.resume = alchemy_ic_resume,
};
static struct syscore_ops alchemy_gpic_pmops = {
static struct syscore alchemy_ic_pm = {
.ops = &alchemy_ic_pmops,
};
static const struct syscore_ops alchemy_gpic_pmops = {
.suspend = alchemy_gpic_suspend,
.resume = alchemy_gpic_resume,
};
static struct syscore alchemy_gpic_pm = {
.ops = &alchemy_gpic_pmops,
};
/******************************************************************************/
/* create chained handlers for the 4 IC requests to the MIPS IRQ ctrl */
@ -880,7 +888,7 @@ static void __init au1000_init_irq(struct alchemy_irqmap *map)
ic_init((void __iomem *)KSEG1ADDR(AU1000_IC0_PHYS_ADDR));
ic_init((void __iomem *)KSEG1ADDR(AU1000_IC1_PHYS_ADDR));
register_syscore_ops(&alchemy_ic_pmops);
register_syscore(&alchemy_ic_pm);
mips_cpu_irq_init();
/* register all 64 possible IC0+IC1 irq sources as type "none".
@ -925,7 +933,7 @@ static void __init alchemy_gpic_init_irq(const struct alchemy_irqmap *dints)
int i;
void __iomem *bank_base;
register_syscore_ops(&alchemy_gpic_pmops);
register_syscore(&alchemy_gpic_pm);
mips_cpu_irq_init();
/* disable & ack all possible interrupt sources */

View File

@ -580,22 +580,26 @@ static void alchemy_usb_pm(int susp)
}
}
static int alchemy_usb_suspend(void)
static int alchemy_usb_suspend(void *data)
{
alchemy_usb_pm(1);
return 0;
}
static void alchemy_usb_resume(void)
static void alchemy_usb_resume(void *data)
{
alchemy_usb_pm(0);
}
static struct syscore_ops alchemy_usb_pm_ops = {
static const struct syscore_ops alchemy_usb_pm_syscore_ops = {
.suspend = alchemy_usb_suspend,
.resume = alchemy_usb_resume,
};
static struct syscore alchemy_usb_pm_syscore = {
.ops = &alchemy_usb_pm_syscore_ops,
};
static int __init alchemy_usb_init(void)
{
int ret = 0;
@ -620,7 +624,7 @@ static int __init alchemy_usb_init(void)
}
if (!ret)
register_syscore_ops(&alchemy_usb_pm_ops);
register_syscore(&alchemy_usb_pm_syscore);
return ret;
}

View File

@ -304,7 +304,7 @@ static int alchemy_pci_def_idsel(unsigned int devsel, int assert)
}
/* save PCI controller register contents. */
static int alchemy_pci_suspend(void)
static int alchemy_pci_suspend(void *data)
{
struct alchemy_pci_context *ctx = __alchemy_pci_ctx;
if (!ctx)
@ -326,7 +326,7 @@ static int alchemy_pci_suspend(void)
return 0;
}
static void alchemy_pci_resume(void)
static void alchemy_pci_resume(void *data)
{
struct alchemy_pci_context *ctx = __alchemy_pci_ctx;
if (!ctx)
@ -354,11 +354,15 @@ static void alchemy_pci_resume(void)
alchemy_pci_wired_entry(ctx); /* install it */
}
static struct syscore_ops alchemy_pci_pmops = {
static const struct syscore_ops alchemy_pci_syscore_ops = {
.suspend = alchemy_pci_suspend,
.resume = alchemy_pci_resume,
};
static struct syscore alchemy_pci_syscore = {
.ops = &alchemy_pci_syscore_ops,
};
static int alchemy_pci_probe(struct platform_device *pdev)
{
struct alchemy_pci_platdata *pd = pdev->dev.platform_data;
@ -478,7 +482,7 @@ static int alchemy_pci_probe(struct platform_device *pdev)
__alchemy_pci_ctx = ctx;
platform_set_drvdata(pdev, ctx);
register_syscore_ops(&alchemy_pci_pmops);
register_syscore(&alchemy_pci_syscore);
register_pci_controller(&ctx->alchemy_pci_ctrl);
dev_info(&pdev->dev, "PCI controller at %ld MHz\n",

View File

@ -726,7 +726,7 @@ static inline void crash_register_spus(struct list_head *list)
}
#endif
static void spu_shutdown(void)
static void spu_shutdown(void *data)
{
struct spu *spu;
@ -738,10 +738,14 @@ static void spu_shutdown(void)
mutex_unlock(&spu_full_list_mutex);
}
static struct syscore_ops spu_syscore_ops = {
static const struct syscore_ops spu_syscore_ops = {
.shutdown = spu_shutdown,
};
static struct syscore spu_syscore = {
.ops = &spu_syscore_ops,
};
static int __init init_spu_base(void)
{
int i, ret = 0;
@ -774,7 +778,7 @@ static int __init init_spu_base(void)
crash_register_spus(&spu_full_list);
mutex_unlock(&spu_full_list_mutex);
spu_add_dev_attr(&dev_attr_stat);
register_syscore_ops(&spu_syscore_ops);
register_syscore(&spu_syscore);
spu_init_affinity();

View File

@ -600,7 +600,7 @@ static int pmacpic_find_viaint(void)
return viaint;
}
static int pmacpic_suspend(void)
static int pmacpic_suspend(void *data)
{
int viaint = pmacpic_find_viaint();
@ -621,7 +621,7 @@ static int pmacpic_suspend(void)
return 0;
}
static void pmacpic_resume(void)
static void pmacpic_resume(void *data)
{
int i;
@ -634,15 +634,19 @@ static void pmacpic_resume(void)
pmac_unmask_irq(irq_get_irq_data(i));
}
static struct syscore_ops pmacpic_syscore_ops = {
static const struct syscore_ops pmacpic_syscore_ops = {
.suspend = pmacpic_suspend,
.resume = pmacpic_resume,
};
static struct syscore pmacpic_syscore = {
.ops = &pmacpic_syscore_ops,
};
static int __init init_pmacpic_syscore(void)
{
if (pmac_irq_hw[0])
register_syscore_ops(&pmacpic_syscore_ops);
register_syscore(&pmacpic_syscore);
return 0;
}

View File

@ -350,7 +350,7 @@ static int fsl_lbc_ctrl_probe(struct platform_device *dev)
#ifdef CONFIG_SUSPEND
/* save lbc registers */
static int fsl_lbc_syscore_suspend(void)
static int fsl_lbc_syscore_suspend(void *data)
{
struct fsl_lbc_ctrl *ctrl;
struct fsl_lbc_regs __iomem *lbc;
@ -374,7 +374,7 @@ static int fsl_lbc_syscore_suspend(void)
}
/* restore lbc registers */
static void fsl_lbc_syscore_resume(void)
static void fsl_lbc_syscore_resume(void *data)
{
struct fsl_lbc_ctrl *ctrl;
struct fsl_lbc_regs __iomem *lbc;
@ -408,10 +408,14 @@ static const struct of_device_id fsl_lbc_match[] = {
};
#ifdef CONFIG_SUSPEND
static struct syscore_ops lbc_syscore_pm_ops = {
static const struct syscore_ops lbc_syscore_pm_ops = {
.suspend = fsl_lbc_syscore_suspend,
.resume = fsl_lbc_syscore_resume,
};
static struct syscore lbc_syscore_pm = {
.ops = &lbc_syscore_pm_ops,
};
#endif
static struct platform_driver fsl_lbc_ctrl_driver = {
@ -425,7 +429,7 @@ static struct platform_driver fsl_lbc_ctrl_driver = {
static int __init fsl_lbc_init(void)
{
#ifdef CONFIG_SUSPEND
register_syscore_ops(&lbc_syscore_pm_ops);
register_syscore(&lbc_syscore_pm);
#endif
return platform_driver_register(&fsl_lbc_ctrl_driver);
}

View File

@ -1258,7 +1258,7 @@ static void fsl_pci_syscore_do_suspend(struct pci_controller *hose)
send_pme_turnoff_message(hose);
}
static int fsl_pci_syscore_suspend(void)
static int fsl_pci_syscore_suspend(void *data)
{
struct pci_controller *hose, *tmp;
@ -1291,7 +1291,7 @@ static void fsl_pci_syscore_do_resume(struct pci_controller *hose)
setup_pci_atmu(hose);
}
static void fsl_pci_syscore_resume(void)
static void fsl_pci_syscore_resume(void *data)
{
struct pci_controller *hose, *tmp;
@ -1299,10 +1299,14 @@ static void fsl_pci_syscore_resume(void)
fsl_pci_syscore_do_resume(hose);
}
static struct syscore_ops pci_syscore_pm_ops = {
static const struct syscore_ops pci_syscore_pm_ops = {
.suspend = fsl_pci_syscore_suspend,
.resume = fsl_pci_syscore_resume,
};
static struct syscore pci_syscore_pm = {
.ops = &pci_syscore_pm_ops,
};
#endif
void fsl_pcibios_fixup_phb(struct pci_controller *phb)
@ -1359,7 +1363,7 @@ static struct platform_driver fsl_pci_driver = {
static int __init fsl_pci_init(void)
{
#ifdef CONFIG_PM_SLEEP
register_syscore_ops(&pci_syscore_pm_ops);
register_syscore(&pci_syscore_pm);
#endif
return platform_driver_register(&fsl_pci_driver);
}

View File

@ -817,7 +817,7 @@ static struct {
u32 sercr;
} ipic_saved_state;
static int ipic_suspend(void)
static int ipic_suspend(void *data)
{
struct ipic *ipic = primary_ipic;
@ -848,7 +848,7 @@ static int ipic_suspend(void)
return 0;
}
static void ipic_resume(void)
static void ipic_resume(void *data)
{
struct ipic *ipic = primary_ipic;
@ -870,18 +870,22 @@ static void ipic_resume(void)
#define ipic_resume NULL
#endif
static struct syscore_ops ipic_syscore_ops = {
static const struct syscore_ops ipic_syscore_ops = {
.suspend = ipic_suspend,
.resume = ipic_resume,
};
static struct syscore ipic_syscore = {
.ops = &ipic_syscore_ops,
};
static int __init init_ipic_syscore(void)
{
if (!primary_ipic || !primary_ipic->regs)
return -ENODEV;
printk(KERN_DEBUG "Registering ipic system core operations\n");
register_syscore_ops(&ipic_syscore_ops);
register_syscore(&ipic_syscore);
return 0;
}

View File

@ -1944,7 +1944,7 @@ static void mpic_suspend_one(struct mpic *mpic)
}
}
static int mpic_suspend(void)
static int mpic_suspend(void *data)
{
struct mpic *mpic = mpics;
@ -1986,7 +1986,7 @@ static void mpic_resume_one(struct mpic *mpic)
} /* end for loop */
}
static void mpic_resume(void)
static void mpic_resume(void *data)
{
struct mpic *mpic = mpics;
@ -1996,19 +1996,23 @@ static void mpic_resume(void)
}
}
static struct syscore_ops mpic_syscore_ops = {
static const struct syscore_ops mpic_syscore_ops = {
.resume = mpic_resume,
.suspend = mpic_suspend,
};
static struct syscore mpic_syscore = {
.ops = &mpic_syscore_ops,
};
static int mpic_init_sys(void)
{
int rc;
register_syscore_ops(&mpic_syscore_ops);
register_syscore(&mpic_syscore);
rc = subsys_system_register(&mpic_subsys, NULL);
if (rc) {
unregister_syscore_ops(&mpic_syscore_ops);
unregister_syscore(&mpic_syscore);
pr_err("mpic: Failed to register subsystem!\n");
return rc;
}

View File

@ -519,7 +519,7 @@ static void __init timer_group_init(struct device_node *np)
kfree(priv);
}
static void mpic_timer_resume(void)
static void mpic_timer_resume(void *data)
{
struct timer_group_priv *priv;
@ -535,10 +535,14 @@ static const struct of_device_id mpic_timer_ids[] = {
{},
};
static struct syscore_ops mpic_timer_syscore_ops = {
static const struct syscore_ops mpic_timer_syscore_ops = {
.resume = mpic_timer_resume,
};
static struct syscore mpic_timer_syscore = {
.ops = &mpic_timer_syscore_ops,
};
static int __init mpic_timer_init(void)
{
struct device_node *np = NULL;
@ -546,7 +550,7 @@ static int __init mpic_timer_init(void)
for_each_matching_node(np, mpic_timer_ids)
timer_group_init(np);
register_syscore_ops(&mpic_timer_syscore_ops);
register_syscore(&mpic_timer_syscore);
if (list_empty(&timer_group_list))
return -ENODEV;

View File

@ -857,7 +857,7 @@ static int __init pmb_debugfs_init(void)
subsys_initcall(pmb_debugfs_init);
#ifdef CONFIG_PM
static void pmb_syscore_resume(void)
static void pmb_syscore_resume(void *data)
{
struct pmb_entry *pmbe;
int i;
@ -874,13 +874,17 @@ static void pmb_syscore_resume(void)
read_unlock(&pmb_rwlock);
}
static struct syscore_ops pmb_syscore_ops = {
static const struct syscore_ops pmb_syscore_ops = {
.resume = pmb_syscore_resume,
};
static struct syscore pmb_syscore = {
.ops = &pmb_syscore_ops,
};
static int __init pmb_sysdev_init(void)
{
register_syscore_ops(&pmb_syscore_ops);
register_syscore(&pmb_syscore);
return 0;
}
subsys_initcall(pmb_sysdev_init);

View File

@ -1718,26 +1718,30 @@ static int x86_pmu_amd_ibs_starting_cpu(unsigned int cpu)
#ifdef CONFIG_PM
static int perf_ibs_suspend(void)
static int perf_ibs_suspend(void *data)
{
clear_APIC_ibs();
return 0;
}
static void perf_ibs_resume(void)
static void perf_ibs_resume(void *data)
{
ibs_eilvt_setup();
setup_APIC_ibs();
}
static struct syscore_ops perf_ibs_syscore_ops = {
static const struct syscore_ops perf_ibs_syscore_ops = {
.resume = perf_ibs_resume,
.suspend = perf_ibs_suspend,
};
static struct syscore perf_ibs_syscore = {
.ops = &perf_ibs_syscore_ops,
};
static void perf_ibs_pm_init(void)
{
register_syscore_ops(&perf_ibs_syscore_ops);
register_syscore(&perf_ibs_syscore);
}
#else

View File

@ -351,7 +351,7 @@ static int __init hv_pci_init(void)
return 1;
}
static int hv_suspend(void)
static int hv_suspend(void *data)
{
union hv_x64_msr_hypercall_contents hypercall_msr;
int ret;
@ -378,7 +378,7 @@ static int hv_suspend(void)
return ret;
}
static void hv_resume(void)
static void hv_resume(void *data)
{
union hv_x64_msr_hypercall_contents hypercall_msr;
int ret;
@ -405,11 +405,15 @@ static void hv_resume(void)
}
/* Note: when the ops are called, only CPU0 is online and IRQs are disabled. */
static struct syscore_ops hv_syscore_ops = {
static const struct syscore_ops hv_syscore_ops = {
.suspend = hv_suspend,
.resume = hv_resume,
};
static struct syscore hv_syscore = {
.ops = &hv_syscore_ops,
};
static void (* __initdata old_setup_percpu_clockev)(void);
static void __init hv_stimer_setup_percpu_clockev(void)
@ -569,7 +573,7 @@ void __init hyperv_init(void)
x86_init.pci.arch_init = hv_pci_init;
register_syscore_ops(&hv_syscore_ops);
register_syscore(&hv_syscore);
if (ms_hyperv.priv_high & HV_ACCESS_PARTITION_ID)
hv_get_partition_id();

View File

@ -591,7 +591,7 @@ static void gart_fixup_northbridges(void)
}
}
static void gart_resume(void)
static void gart_resume(void *data)
{
pr_info("PCI-DMA: Resuming GART IOMMU\n");
@ -600,11 +600,15 @@ static void gart_resume(void)
enable_gart_translations();
}
static struct syscore_ops gart_syscore_ops = {
static const struct syscore_ops gart_syscore_ops = {
.resume = gart_resume,
};
static struct syscore gart_syscore = {
.ops = &gart_syscore_ops,
};
/*
* Private Northbridge GATT initialization in case we cannot use the
* AGP driver for some reason.
@ -650,7 +654,7 @@ static __init int init_amd_gatt(struct agp_kern_info *info)
agp_gatt_table = gatt;
register_syscore_ops(&gart_syscore_ops);
register_syscore(&gart_syscore);
flush_gart();

View File

@ -2385,7 +2385,7 @@ static struct {
unsigned int apic_cmci;
} apic_pm_state;
static int lapic_suspend(void)
static int lapic_suspend(void *data)
{
unsigned long flags;
int maxlvt;
@ -2433,7 +2433,7 @@ static int lapic_suspend(void)
return 0;
}
static void lapic_resume(void)
static void lapic_resume(void *data)
{
unsigned int l, h;
unsigned long flags;
@ -2508,11 +2508,15 @@ static void lapic_resume(void)
* are needed on every CPU up until machine_halt/restart/poweroff.
*/
static struct syscore_ops lapic_syscore_ops = {
static const struct syscore_ops lapic_syscore_ops = {
.resume = lapic_resume,
.suspend = lapic_suspend,
};
static struct syscore lapic_syscore = {
.ops = &lapic_syscore_ops,
};
static void apic_pm_activate(void)
{
apic_pm_state.active = 1;
@ -2522,7 +2526,7 @@ static int __init init_lapic_sysfs(void)
{
/* XXX: remove suspend/resume procs if !apic_pm_state.active? */
if (boot_cpu_has(X86_FEATURE_APIC))
register_syscore_ops(&lapic_syscore_ops);
register_syscore(&lapic_syscore);
return 0;
}

View File

@ -2308,7 +2308,12 @@ static void resume_ioapic_id(int ioapic_idx)
}
}
static void ioapic_resume(void)
static int ioapic_suspend(void *data)
{
return save_ioapic_entries();
}
static void ioapic_resume(void *data)
{
int ioapic_idx;
@ -2318,14 +2323,18 @@ static void ioapic_resume(void)
restore_ioapic_entries();
}
static struct syscore_ops ioapic_syscore_ops = {
.suspend = save_ioapic_entries,
static const struct syscore_ops ioapic_syscore_ops = {
.suspend = ioapic_suspend,
.resume = ioapic_resume,
};
static struct syscore ioapic_syscore = {
.ops = &ioapic_syscore_ops,
};
static int __init ioapic_init_ops(void)
{
register_syscore_ops(&ioapic_syscore_ops);
register_syscore(&ioapic_syscore);
return 0;
}

View File

@ -37,7 +37,7 @@ static DEFINE_PER_CPU_SHARED_ALIGNED(struct aperfmperf, cpu_samples) = {
.seq = SEQCNT_ZERO(cpu_samples.seq)
};
static void init_counter_refs(void)
static void init_counter_refs(void *data)
{
u64 aperf, mperf;
@ -289,16 +289,20 @@ static bool __init intel_set_max_freq_ratio(void)
}
#ifdef CONFIG_PM_SLEEP
static struct syscore_ops freq_invariance_syscore_ops = {
static const struct syscore_ops freq_invariance_syscore_ops = {
.resume = init_counter_refs,
};
static void register_freq_invariance_syscore_ops(void)
static struct syscore freq_invariance_syscore = {
.ops = &freq_invariance_syscore_ops,
};
static void register_freq_invariance_syscore(void)
{
register_syscore_ops(&freq_invariance_syscore_ops);
register_syscore(&freq_invariance_syscore);
}
#else
static inline void register_freq_invariance_syscore_ops(void) {}
static inline void register_freq_invariance_syscore(void) {}
#endif
static void freq_invariance_enable(void)
@ -308,7 +312,7 @@ static void freq_invariance_enable(void)
return;
}
static_branch_enable_cpuslocked(&arch_scale_freq_key);
register_freq_invariance_syscore_ops();
register_freq_invariance_syscore();
pr_info("Estimated ratio of average max frequency by base frequency (times 1024): %llu\n", arch_max_freq_ratio);
}
@ -535,7 +539,7 @@ static int __init bp_init_aperfmperf(void)
if (!cpu_feature_enabled(X86_FEATURE_APERFMPERF))
return 0;
init_counter_refs();
init_counter_refs(NULL);
bp_init_freq_invariance();
return 0;
}
@ -544,5 +548,5 @@ early_initcall(bp_init_aperfmperf);
void ap_init_aperfmperf(void)
{
if (cpu_feature_enabled(X86_FEATURE_APERFMPERF))
init_counter_refs();
init_counter_refs(NULL);
}

View File

@ -75,7 +75,7 @@ static u8 energ_perf_values[] = {
[EPB_INDEX_POWERSAVE] = ENERGY_PERF_BIAS_POWERSAVE,
};
static int intel_epb_save(void)
static int intel_epb_save(void *data)
{
u64 epb;
@ -89,7 +89,7 @@ static int intel_epb_save(void)
return 0;
}
static void intel_epb_restore(void)
static void intel_epb_restore(void *data)
{
u64 val = this_cpu_read(saved_epb);
u64 epb;
@ -114,11 +114,15 @@ static void intel_epb_restore(void)
wrmsrq(MSR_IA32_ENERGY_PERF_BIAS, (epb & ~EPB_MASK) | val);
}
static struct syscore_ops intel_epb_syscore_ops = {
static const struct syscore_ops intel_epb_syscore_ops = {
.suspend = intel_epb_save,
.resume = intel_epb_restore,
};
static struct syscore intel_epb_syscore = {
.ops = &intel_epb_syscore_ops,
};
static const char * const energy_perf_strings[] = {
[EPB_INDEX_PERFORMANCE] = "performance",
[EPB_INDEX_BALANCE_PERFORMANCE] = "balance-performance",
@ -185,7 +189,7 @@ static int intel_epb_online(unsigned int cpu)
{
struct device *cpu_dev = get_cpu_device(cpu);
intel_epb_restore();
intel_epb_restore(NULL);
if (!cpuhp_tasks_frozen)
sysfs_merge_group(&cpu_dev->kobj, &intel_epb_attr_group);
@ -199,7 +203,7 @@ static int intel_epb_offline(unsigned int cpu)
if (!cpuhp_tasks_frozen)
sysfs_unmerge_group(&cpu_dev->kobj, &intel_epb_attr_group);
intel_epb_save();
intel_epb_save(NULL);
return 0;
}
@ -230,7 +234,7 @@ static __init int intel_epb_init(void)
if (ret < 0)
goto err_out_online;
register_syscore_ops(&intel_epb_syscore_ops);
register_syscore(&intel_epb_syscore);
return 0;
err_out_online:

View File

@ -2439,13 +2439,13 @@ static void vendor_disable_error_reporting(void)
mce_disable_error_reporting();
}
static int mce_syscore_suspend(void)
static int mce_syscore_suspend(void *data)
{
vendor_disable_error_reporting();
return 0;
}
static void mce_syscore_shutdown(void)
static void mce_syscore_shutdown(void *data)
{
vendor_disable_error_reporting();
}
@ -2455,7 +2455,7 @@ static void mce_syscore_shutdown(void)
* Only one CPU is active at this time, the others get re-added later using
* CPU hotplug:
*/
static void mce_syscore_resume(void)
static void mce_syscore_resume(void *data)
{
__mcheck_cpu_init_generic();
__mcheck_cpu_init_vendor(raw_cpu_ptr(&cpu_info));
@ -2463,12 +2463,16 @@ static void mce_syscore_resume(void)
cr4_set_bits(X86_CR4_MCE);
}
static struct syscore_ops mce_syscore_ops = {
static const struct syscore_ops mce_syscore_ops = {
.suspend = mce_syscore_suspend,
.shutdown = mce_syscore_shutdown,
.resume = mce_syscore_resume,
};
static struct syscore mce_syscore = {
.ops = &mce_syscore_ops,
};
/*
* mce_device: Sysfs support
*/
@ -2869,7 +2873,7 @@ static __init int mcheck_init_device(void)
if (err < 0)
goto err_out_online;
register_syscore_ops(&mce_syscore_ops);
register_syscore(&mce_syscore);
return 0;

View File

@ -823,8 +823,17 @@ void microcode_bsp_resume(void)
reload_early_microcode(cpu);
}
static struct syscore_ops mc_syscore_ops = {
.resume = microcode_bsp_resume,
static void microcode_bsp_syscore_resume(void *data)
{
microcode_bsp_resume();
}
static const struct syscore_ops mc_syscore_ops = {
.resume = microcode_bsp_syscore_resume,
};
static struct syscore mc_syscore = {
.ops = &mc_syscore_ops,
};
static int mc_cpu_online(unsigned int cpu)
@ -903,7 +912,7 @@ static int __init microcode_init(void)
}
}
register_syscore_ops(&mc_syscore_ops);
register_syscore(&mc_syscore);
cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "x86/microcode:online",
mc_cpu_online, mc_cpu_down_prep);

View File

@ -41,7 +41,7 @@ struct mtrr_value {
static struct mtrr_value *mtrr_value;
static int mtrr_save(void)
static int mtrr_save(void *data)
{
int i;
@ -56,7 +56,7 @@ static int mtrr_save(void)
return 0;
}
static void mtrr_restore(void)
static void mtrr_restore(void *data)
{
int i;
@ -69,11 +69,15 @@ static void mtrr_restore(void)
}
}
static struct syscore_ops mtrr_syscore_ops = {
static const struct syscore_ops mtrr_syscore_ops = {
.suspend = mtrr_save,
.resume = mtrr_restore,
};
static struct syscore mtrr_syscore = {
.ops = &mtrr_syscore_ops,
};
void mtrr_register_syscore(void)
{
mtrr_value = kcalloc(num_var_ranges, sizeof(*mtrr_value), GFP_KERNEL);
@ -86,5 +90,5 @@ void mtrr_register_syscore(void)
* TBD: is there any system with such CPU which supports
* suspend/resume? If no, we should remove the code.
*/
register_syscore_ops(&mtrr_syscore_ops);
register_syscore(&mtrr_syscore);
}

View File

@ -86,15 +86,19 @@ static int umwait_cpu_offline(unsigned int cpu)
* trust the firmware nor does it matter if the same value is written
* again.
*/
static void umwait_syscore_resume(void)
static void umwait_syscore_resume(void *data)
{
umwait_update_control_msr(NULL);
}
static struct syscore_ops umwait_syscore_ops = {
static const struct syscore_ops umwait_syscore_ops = {
.resume = umwait_syscore_resume,
};
static struct syscore umwait_syscore = {
.ops = &umwait_syscore_ops,
};
/* sysfs interface */
/*
@ -226,7 +230,7 @@ static int __init umwait_init(void)
return ret;
}
register_syscore_ops(&umwait_syscore_ops);
register_syscore(&umwait_syscore);
/*
* Add umwait control interface. Ignore failure, so at least the

View File

@ -19,7 +19,7 @@
* in asm/dma.h.
*/
static void i8237A_resume(void)
static void i8237A_resume(void *data)
{
unsigned long flags;
int i;
@ -41,10 +41,14 @@ static void i8237A_resume(void)
release_dma_lock(flags);
}
static struct syscore_ops i8237_syscore_ops = {
static const struct syscore_ops i8237_syscore_ops = {
.resume = i8237A_resume,
};
static struct syscore i8237_syscore = {
.ops = &i8237_syscore_ops,
};
static int __init i8237A_init_ops(void)
{
/*
@ -70,7 +74,7 @@ static int __init i8237A_init_ops(void)
if (x86_pnpbios_disabled() && dmi_get_bios_year() >= 2017)
return -ENODEV;
register_syscore_ops(&i8237_syscore_ops);
register_syscore(&i8237_syscore);
return 0;
}
device_initcall(i8237A_init_ops);

View File

@ -247,19 +247,19 @@ static void save_ELCR(char *trigger)
trigger[1] = inb(PIC_ELCR2) & 0xDE;
}
static void i8259A_resume(void)
static void i8259A_resume(void *data)
{
init_8259A(i8259A_auto_eoi);
restore_ELCR(irq_trigger);
}
static int i8259A_suspend(void)
static int i8259A_suspend(void *data)
{
save_ELCR(irq_trigger);
return 0;
}
static void i8259A_shutdown(void)
static void i8259A_shutdown(void *data)
{
/* Put the i8259A into a quiescent state that
* the kernel initialization code can get it
@ -269,12 +269,16 @@ static void i8259A_shutdown(void)
outb(0xff, PIC_SLAVE_IMR); /* mask all of 8259A-2 */
}
static struct syscore_ops i8259_syscore_ops = {
static const struct syscore_ops i8259_syscore_ops = {
.suspend = i8259A_suspend,
.resume = i8259A_resume,
.shutdown = i8259A_shutdown,
};
static struct syscore i8259_syscore = {
.ops = &i8259_syscore_ops,
};
static void mask_8259A(void)
{
unsigned long flags;
@ -444,7 +448,7 @@ EXPORT_SYMBOL(legacy_pic);
static int __init i8259A_init_ops(void)
{
if (legacy_pic == &default_legacy_pic)
register_syscore_ops(&i8259_syscore_ops);
register_syscore(&i8259_syscore);
return 0;
}

View File

@ -721,7 +721,7 @@ static int kvm_cpu_down_prepare(unsigned int cpu)
#endif
static int kvm_suspend(void)
static int kvm_suspend(void *data)
{
u64 val = 0;
@ -735,7 +735,7 @@ static int kvm_suspend(void)
return 0;
}
static void kvm_resume(void)
static void kvm_resume(void *data)
{
kvm_cpu_online(raw_smp_processor_id());
@ -745,11 +745,15 @@ static void kvm_resume(void)
#endif
}
static struct syscore_ops kvm_syscore_ops = {
static const struct syscore_ops kvm_syscore_ops = {
.suspend = kvm_suspend,
.resume = kvm_resume,
};
static struct syscore kvm_syscore = {
.ops = &kvm_syscore_ops,
};
static void kvm_pv_guest_cpu_reboot(void *unused)
{
kvm_guest_cpu_offline(true);
@ -859,7 +863,7 @@ static void __init kvm_guest_init(void)
machine_ops.crash_shutdown = kvm_crash_shutdown;
#endif
register_syscore_ops(&kvm_syscore_ops);
register_syscore(&kvm_syscore);
/*
* Hard lockup detection is enabled by default. Disable it, as guests

View File

@ -761,7 +761,7 @@ static int acpi_pci_link_resume(struct acpi_pci_link *link)
return 0;
}
static void irqrouter_resume(void)
static void irqrouter_resume(void *data)
{
struct acpi_pci_link *link;
@ -888,10 +888,14 @@ static int __init acpi_irq_balance_set(char *str)
__setup("acpi_irq_balance", acpi_irq_balance_set);
static struct syscore_ops irqrouter_syscore_ops = {
static const struct syscore_ops irqrouter_syscore_ops = {
.resume = irqrouter_resume,
};
static struct syscore irqrouter_syscore = {
.ops = &irqrouter_syscore_ops,
};
void __init acpi_pci_link_init(void)
{
if (acpi_noirq)
@ -904,6 +908,6 @@ void __init acpi_pci_link_init(void)
else
acpi_irq_balance = 0;
}
register_syscore_ops(&irqrouter_syscore_ops);
register_syscore(&irqrouter_syscore);
acpi_scan_add_handler(&pci_link_handler);
}

View File

@ -884,13 +884,13 @@ bool acpi_s2idle_wakeup(void)
#ifdef CONFIG_PM_SLEEP
static u32 saved_bm_rld;
static int acpi_save_bm_rld(void)
static int acpi_save_bm_rld(void *data)
{
acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_RLD, &saved_bm_rld);
return 0;
}
static void acpi_restore_bm_rld(void)
static void acpi_restore_bm_rld(void *data)
{
u32 resumed_bm_rld = 0;
@ -901,14 +901,18 @@ static void acpi_restore_bm_rld(void)
acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, saved_bm_rld);
}
static struct syscore_ops acpi_sleep_syscore_ops = {
static const struct syscore_ops acpi_sleep_syscore_ops = {
.suspend = acpi_save_bm_rld,
.resume = acpi_restore_bm_rld,
};
static struct syscore acpi_sleep_syscore = {
.ops = &acpi_sleep_syscore_ops,
};
static void acpi_sleep_syscore_init(void)
{
register_syscore_ops(&acpi_sleep_syscore_ops);
register_syscore(&acpi_sleep_syscore);
}
#else
static inline void acpi_sleep_syscore_init(void) {}

View File

@ -144,6 +144,7 @@ int tegra_ahb_enable_smmu(struct device_node *dn)
if (!dev)
return -EPROBE_DEFER;
ahb = dev_get_drvdata(dev);
put_device(dev);
val = gizmo_readl(ahb, AHB_ARBITRATION_XBAR_CTRL);
val |= AHB_ARBITRATION_XBAR_CTRL_SMMU_INIT_DONE;
gizmo_writel(ahb, val, AHB_ARBITRATION_XBAR_CTRL);

View File

@ -1576,16 +1576,20 @@ static int fw_pm_notify(struct notifier_block *notify_block,
}
/* stop caching firmware once syscore_suspend is reached */
static int fw_suspend(void)
static int fw_suspend(void *data)
{
fw_cache.state = FW_LOADER_NO_CACHE;
return 0;
}
static struct syscore_ops fw_syscore_ops = {
static const struct syscore_ops fw_syscore_ops = {
.suspend = fw_suspend,
};
static struct syscore fw_syscore = {
.ops = &fw_syscore_ops,
};
static int __init register_fw_pm_ops(void)
{
int ret;
@ -1601,14 +1605,14 @@ static int __init register_fw_pm_ops(void)
if (ret)
return ret;
register_syscore_ops(&fw_syscore_ops);
register_syscore(&fw_syscore);
return ret;
}
static inline void unregister_fw_pm_ops(void)
{
unregister_syscore_ops(&fw_syscore_ops);
unregister_syscore(&fw_syscore);
unregister_pm_notifier(&fw_cache.pm_notify);
}
#else

View File

@ -11,32 +11,32 @@
#include <linux/suspend.h>
#include <trace/events/power.h>
static LIST_HEAD(syscore_ops_list);
static DEFINE_MUTEX(syscore_ops_lock);
static LIST_HEAD(syscore_list);
static DEFINE_MUTEX(syscore_lock);
/**
* register_syscore_ops - Register a set of system core operations.
* @ops: System core operations to register.
* register_syscore - Register a set of system core operations.
* @syscore: System core operations to register.
*/
void register_syscore_ops(struct syscore_ops *ops)
void register_syscore(struct syscore *syscore)
{
mutex_lock(&syscore_ops_lock);
list_add_tail(&ops->node, &syscore_ops_list);
mutex_unlock(&syscore_ops_lock);
mutex_lock(&syscore_lock);
list_add_tail(&syscore->node, &syscore_list);
mutex_unlock(&syscore_lock);
}
EXPORT_SYMBOL_GPL(register_syscore_ops);
EXPORT_SYMBOL_GPL(register_syscore);
/**
* unregister_syscore_ops - Unregister a set of system core operations.
* @ops: System core operations to unregister.
* unregister_syscore - Unregister a set of system core operations.
* @syscore: System core operations to unregister.
*/
void unregister_syscore_ops(struct syscore_ops *ops)
void unregister_syscore(struct syscore *syscore)
{
mutex_lock(&syscore_ops_lock);
list_del(&ops->node);
mutex_unlock(&syscore_ops_lock);
mutex_lock(&syscore_lock);
list_del(&syscore->node);
mutex_unlock(&syscore_lock);
}
EXPORT_SYMBOL_GPL(unregister_syscore_ops);
EXPORT_SYMBOL_GPL(unregister_syscore);
#ifdef CONFIG_PM_SLEEP
/**
@ -46,7 +46,7 @@ EXPORT_SYMBOL_GPL(unregister_syscore_ops);
*/
int syscore_suspend(void)
{
struct syscore_ops *ops;
struct syscore *syscore;
int ret = 0;
trace_suspend_resume(TPS("syscore_suspend"), 0, true);
@ -59,25 +59,27 @@ int syscore_suspend(void)
WARN_ONCE(!irqs_disabled(),
"Interrupts enabled before system core suspend.\n");
list_for_each_entry_reverse(ops, &syscore_ops_list, node)
if (ops->suspend) {
pm_pr_dbg("Calling %pS\n", ops->suspend);
ret = ops->suspend();
list_for_each_entry_reverse(syscore, &syscore_list, node)
if (syscore->ops->suspend) {
pm_pr_dbg("Calling %pS\n", syscore->ops->suspend);
ret = syscore->ops->suspend(syscore->data);
if (ret)
goto err_out;
WARN_ONCE(!irqs_disabled(),
"Interrupts enabled after %pS\n", ops->suspend);
"Interrupts enabled after %pS\n",
syscore->ops->suspend);
}
trace_suspend_resume(TPS("syscore_suspend"), 0, false);
return 0;
err_out:
pr_err("PM: System core suspend callback %pS failed.\n", ops->suspend);
pr_err("PM: System core suspend callback %pS failed.\n",
syscore->ops->suspend);
list_for_each_entry_continue(ops, &syscore_ops_list, node)
if (ops->resume)
ops->resume();
list_for_each_entry_continue(syscore, &syscore_list, node)
if (syscore->ops->resume)
syscore->ops->resume(syscore->data);
return ret;
}
@ -90,18 +92,19 @@ EXPORT_SYMBOL_GPL(syscore_suspend);
*/
void syscore_resume(void)
{
struct syscore_ops *ops;
struct syscore *syscore;
trace_suspend_resume(TPS("syscore_resume"), 0, true);
WARN_ONCE(!irqs_disabled(),
"Interrupts enabled before system core resume.\n");
list_for_each_entry(ops, &syscore_ops_list, node)
if (ops->resume) {
pm_pr_dbg("Calling %pS\n", ops->resume);
ops->resume();
list_for_each_entry(syscore, &syscore_list, node)
if (syscore->ops->resume) {
pm_pr_dbg("Calling %pS\n", syscore->ops->resume);
syscore->ops->resume(syscore->data);
WARN_ONCE(!irqs_disabled(),
"Interrupts enabled after %pS\n", ops->resume);
"Interrupts enabled after %pS\n",
syscore->ops->resume);
}
trace_suspend_resume(TPS("syscore_resume"), 0, false);
}
@ -113,16 +116,17 @@ EXPORT_SYMBOL_GPL(syscore_resume);
*/
void syscore_shutdown(void)
{
struct syscore_ops *ops;
struct syscore *syscore;
mutex_lock(&syscore_ops_lock);
mutex_lock(&syscore_lock);
list_for_each_entry_reverse(ops, &syscore_ops_list, node)
if (ops->shutdown) {
list_for_each_entry_reverse(syscore, &syscore_list, node)
if (syscore->ops->shutdown) {
if (initcall_debug)
pr_info("PM: Calling %pS\n", ops->shutdown);
ops->shutdown();
pr_info("PM: Calling %pS\n",
syscore->ops->shutdown);
syscore->ops->shutdown(syscore->data);
}
mutex_unlock(&syscore_ops_lock);
mutex_unlock(&syscore_lock);
}

View File

@ -1006,7 +1006,7 @@ static __init int mvebu_mbus_debugfs_init(void)
}
fs_initcall(mvebu_mbus_debugfs_init);
static int mvebu_mbus_suspend(void)
static int mvebu_mbus_suspend(void *data)
{
struct mvebu_mbus_state *s = &mbus_state;
int win;
@ -1040,7 +1040,7 @@ static int mvebu_mbus_suspend(void)
return 0;
}
static void mvebu_mbus_resume(void)
static void mvebu_mbus_resume(void *data)
{
struct mvebu_mbus_state *s = &mbus_state;
int win;
@ -1069,11 +1069,15 @@ static void mvebu_mbus_resume(void)
}
}
static struct syscore_ops mvebu_mbus_syscore_ops = {
static const struct syscore_ops mvebu_mbus_syscore_ops = {
.suspend = mvebu_mbus_suspend,
.resume = mvebu_mbus_resume,
};
static struct syscore mvebu_mbus_syscore = {
.ops = &mvebu_mbus_syscore_ops,
};
static int __init mvebu_mbus_common_init(struct mvebu_mbus_state *mbus,
phys_addr_t mbuswins_phys_base,
size_t mbuswins_size,
@ -1118,7 +1122,7 @@ static int __init mvebu_mbus_common_init(struct mvebu_mbus_state *mbus,
writel(UNIT_SYNC_BARRIER_ALL,
mbus->mbuswins_base + UNIT_SYNC_BARRIER_OFF);
register_syscore_ops(&mvebu_mbus_syscore_ops);
register_syscore(&mvebu_mbus_syscore);
return 0;
}

View File

@ -5,6 +5,7 @@
#include <linux/bitfield.h>
#include <linux/bits.h>
#include <linux/debugfs.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/init.h>
@ -25,6 +26,8 @@
#define RIFSC_RISC_PRIVCFGR0 0x30
#define RIFSC_RISC_PER0_CIDCFGR 0x100
#define RIFSC_RISC_PER0_SEMCR 0x104
#define RIFSC_RISC_REG0_ACFGR 0x900
#define RIFSC_RISC_REG3_AADDR 0x924
#define RIFSC_RISC_HWCFGR2 0xFEC
/*
@ -70,6 +73,565 @@
#define RIF_CID0 0x0
#define RIF_CID1 0x1
#if defined(CONFIG_DEBUG_FS)
#define RIFSC_RISUP_ENTRIES 128
#define RIFSC_RIMU_ENTRIES 16
#define RIFSC_RISAL_SUBREGIONS 2
#define RIFSC_RISAL_GRANULARITY 8
#define RIFSC_RIMC_ATTR0 0xC10
#define RIFSC_RIMC_CIDSEL BIT(2)
#define RIFSC_RIMC_MCID_MASK GENMASK(6, 4)
#define RIFSC_RIMC_MSEC BIT(8)
#define RIFSC_RIMC_MPRIV BIT(9)
#define RIFSC_RISC_SRCID_MASK GENMASK(6, 4)
#define RIFSC_RISC_SRPRIV BIT(9)
#define RIFSC_RISC_SRSEC BIT(8)
#define RIFSC_RISC_SRRLOCK BIT(1)
#define RIFSC_RISC_SREN BIT(0)
#define RIFSC_RISC_SRLENGTH_MASK GENMASK(27, 16)
#define RIFSC_RISC_SRSTART_MASK GENMASK(10, 0)
static const char *stm32mp21_rifsc_rimu_names[RIFSC_RIMU_ENTRIES] = {
"ETR",
"SDMMC1",
"SDMMC2",
"SDMMC3",
"OTG_HS",
"USBH",
"ETH1",
"ETH2",
"RESERVED",
"RESERVED",
"DCMIPP",
"LTDC_L1/L2",
"LTDC_L3",
"RESERVED",
"RESERVED",
"RESERVED",
};
static const char *stm32mp25_rifsc_rimu_names[RIFSC_RIMU_ENTRIES] = {
"ETR",
"SDMMC1",
"SDMMC2",
"SDMMC3",
"USB3DR",
"USBH",
"ETH1",
"ETH2",
"PCIE",
"GPU",
"DMCIPP",
"LTDC_L0/L1",
"LTDC_L2",
"LTDC_ROT",
"VDEC",
"VENC"
};
static const char *stm32mp21_rifsc_risup_names[RIFSC_RISUP_ENTRIES] = {
"TIM1",
"TIM2",
"TIM3",
"TIM4",
"TIM5",
"TIM6",
"TIM7",
"TIM8",
"TIM10",
"TIM11",
"TIM12",
"TIM13",
"TIM14",
"TIM15",
"TIM16",
"TIM17",
"RESERVED",
"LPTIM1",
"LPTIM2",
"LPTIM3",
"LPTIM4",
"LPTIM5",
"SPI1",
"SPI2",
"SPI3",
"SPI4",
"SPI5",
"SPI6",
"RESERVED",
"RESERVED",
"SPDIFRX",
"USART1",
"USART2",
"USART3",
"UART4",
"UART5",
"USART6",
"UART7",
"RESERVED",
"RESERVED",
"LPUART1",
"I2C1",
"I2C2",
"I2C3",
"RESERVED",
"RESERVED",
"RESERVED",
"RESERVED",
"RESERVED",
"SAI1",
"SAI2",
"SAI3",
"SAI4",
"RESERVED",
"MDF1",
"RESERVED",
"FDCAN",
"HDP",
"ADC1",
"ADC2",
"ETH1",
"ETH2",
"RESERVED",
"USBH",
"RESERVED",
"RESERVED",
"OTG_HS",
"DDRPERFM",
"RESERVED",
"RESERVED",
"RESERVED",
"RESERVED",
"RESERVED",
"STGEN",
"OCTOSPI1",
"RESERVED",
"SDMMC1",
"SDMMC2",
"SDMMC3",
"RESERVED",
"LTDC_CMN",
"RESERVED",
"RESERVED",
"RESERVED",
"RESERVED",
"RESERVED",
"CSI",
"DCMIPP",
"DCMI_PSSI",
"RESERVED",
"RESERVED",
"RESERVED",
"RNG1",
"RNG2",
"PKA",
"SAES",
"HASH1",
"HASH2",
"CRYP1",
"CRYP2",
"IWDG1",
"IWDG2",
"IWDG3",
"IWDG4",
"WWDG1",
"RESERVED",
"VREFBUF",
"DTS",
"RAMCFG",
"CRC",
"SERC",
"RESERVED",
"RESERVED",
"RESERVED",
"I3C1",
"I3C2",
"I3C3",
"RESERVED",
"ICACHE_DCACHE",
"LTDC_L1L2",
"LTDC_L3",
"RESERVED",
"RESERVED",
"RESERVED",
"RESERVED",
"OTFDEC1",
"RESERVED",
"IAC",
};
static const char *stm32mp25_rifsc_risup_names[RIFSC_RISUP_ENTRIES] = {
"TIM1",
"TIM2",
"TIM3",
"TIM4",
"TIM5",
"TIM6",
"TIM7",
"TIM8",
"TIM10",
"TIM11",
"TIM12",
"TIM13",
"TIM14",
"TIM15",
"TIM16",
"TIM17",
"TIM20",
"LPTIM1",
"LPTIM2",
"LPTIM3",
"LPTIM4",
"LPTIM5",
"SPI1",
"SPI2",
"SPI3",
"SPI4",
"SPI5",
"SPI6",
"SPI7",
"SPI8",
"SPDIFRX",
"USART1",
"USART2",
"USART3",
"UART4",
"UART5",
"USART6",
"UART7",
"UART8",
"UART9",
"LPUART1",
"I2C1",
"I2C2",
"I2C3",
"I2C4",
"I2C5",
"I2C6",
"I2C7",
"I2C8",
"SAI1",
"SAI2",
"SAI3",
"SAI4",
"RESERVED",
"MDF1",
"ADF1",
"FDCAN",
"HDP",
"ADC12",
"ADC3",
"ETH1",
"ETH2",
"RESERVED",
"USBH",
"RESERVED",
"RESERVED",
"USB3DR",
"COMBOPHY",
"PCIE",
"UCPD1",
"ETHSW_DEIP",
"ETHSW_ACM_CF",
"ETHSW_ACM_MSGBU",
"STGEN",
"OCTOSPI1",
"OCTOSPI2",
"SDMMC1",
"SDMMC2",
"SDMMC3",
"GPU",
"LTDC_CMN",
"DSI_CMN",
"RESERVED",
"RESERVED",
"LVDS",
"RESERVED",
"CSI",
"DCMIPP",
"DCMI_PSSI",
"VDEC",
"VENC",
"RESERVED",
"RNG",
"PKA",
"SAES",
"HASH",
"CRYP1",
"CRYP2",
"IWDG1",
"IWDG2",
"IWDG3",
"IWDG4",
"IWDG5",
"WWDG1",
"WWDG2",
"RESERVED",
"VREFBUF",
"DTS",
"RAMCFG",
"CRC",
"SERC",
"OCTOSPIM",
"GICV2M",
"RESERVED",
"I3C1",
"I3C2",
"I3C3",
"I3C4",
"ICACHE_DCACHE",
"LTDC_L0L1",
"LTDC_L2",
"LTDC_ROT",
"DSI_TRIG",
"DSI_RDFIFO",
"RESERVED",
"OTFDEC1",
"OTFDEC2",
"IAC",
};
struct rifsc_risup_debug_data {
char dev_name[15];
u8 dev_cid;
u8 dev_sem_cids;
u8 dev_id;
bool dev_cid_filt_en;
bool dev_sem_en;
bool dev_priv;
bool dev_sec;
};
struct rifsc_rimu_debug_data {
char m_name[11];
u8 m_cid;
bool cidsel;
bool m_sec;
bool m_priv;
};
struct rifsc_subreg_debug_data {
bool sr_sec;
bool sr_priv;
u8 sr_cid;
bool sr_rlock;
bool sr_enable;
u16 sr_start;
u16 sr_length;
};
struct stm32_rifsc_resources_names {
const char **device_names;
const char **initiator_names;
};
struct rifsc_dbg_private {
const struct stm32_rifsc_resources_names *res_names;
void __iomem *mmio;
unsigned int nb_risup;
unsigned int nb_rimu;
unsigned int nb_risal;
};
static const struct stm32_rifsc_resources_names rifsc_mp21_res_names = {
.device_names = stm32mp21_rifsc_risup_names,
.initiator_names = stm32mp21_rifsc_rimu_names,
};
static const struct stm32_rifsc_resources_names rifsc_mp25_res_names = {
.device_names = stm32mp25_rifsc_risup_names,
.initiator_names = stm32mp25_rifsc_rimu_names,
};
static void stm32_rifsc_fill_rimu_dbg_entry(struct rifsc_dbg_private *rifsc,
struct rifsc_rimu_debug_data *dbg_entry, int i)
{
const struct stm32_rifsc_resources_names *dbg_names = rifsc->res_names;
u32 rimc_attr = readl_relaxed(rifsc->mmio + RIFSC_RIMC_ATTR0 + 0x4 * i);
snprintf(dbg_entry->m_name, sizeof(dbg_entry->m_name), "%s", dbg_names->initiator_names[i]);
dbg_entry->m_cid = FIELD_GET(RIFSC_RIMC_MCID_MASK, rimc_attr);
dbg_entry->cidsel = rimc_attr & RIFSC_RIMC_CIDSEL;
dbg_entry->m_sec = rimc_attr & RIFSC_RIMC_MSEC;
dbg_entry->m_priv = rimc_attr & RIFSC_RIMC_MPRIV;
}
static void stm32_rifsc_fill_dev_dbg_entry(struct rifsc_dbg_private *rifsc,
struct rifsc_risup_debug_data *dbg_entry, int i)
{
const struct stm32_rifsc_resources_names *dbg_names = rifsc->res_names;
u32 cid_cfgr, sec_cfgr, priv_cfgr;
u8 reg_id = i / IDS_PER_RISC_SEC_PRIV_REGS;
u8 reg_offset = i % IDS_PER_RISC_SEC_PRIV_REGS;
cid_cfgr = readl_relaxed(rifsc->mmio + RIFSC_RISC_PER0_CIDCFGR + 0x8 * i);
sec_cfgr = readl_relaxed(rifsc->mmio + RIFSC_RISC_SECCFGR0 + 0x4 * reg_id);
priv_cfgr = readl_relaxed(rifsc->mmio + RIFSC_RISC_PRIVCFGR0 + 0x4 * reg_id);
snprintf(dbg_entry->dev_name, sizeof(dbg_entry->dev_name), "%s",
dbg_names->device_names[i]);
dbg_entry->dev_id = i;
dbg_entry->dev_cid_filt_en = cid_cfgr & CIDCFGR_CFEN;
dbg_entry->dev_sem_en = cid_cfgr & CIDCFGR_SEMEN;
dbg_entry->dev_cid = FIELD_GET(RIFSC_RISC_SCID_MASK, cid_cfgr);
dbg_entry->dev_sem_cids = FIELD_GET(RIFSC_RISC_SEMWL_MASK, cid_cfgr);
dbg_entry->dev_sec = sec_cfgr & BIT(reg_offset) ? true : false;
dbg_entry->dev_priv = priv_cfgr & BIT(reg_offset) ? true : false;
}
static void stm32_rifsc_fill_subreg_dbg_entry(struct rifsc_dbg_private *rifsc,
struct rifsc_subreg_debug_data *dbg_entry, int i,
int j)
{
u32 risc_xcfgr = readl_relaxed(rifsc->mmio + RIFSC_RISC_REG0_ACFGR + 0x10 * i + 0x8 * j);
u32 risc_xaddr;
dbg_entry->sr_sec = risc_xcfgr & RIFSC_RISC_SRSEC;
dbg_entry->sr_priv = risc_xcfgr & RIFSC_RISC_SRPRIV;
dbg_entry->sr_cid = FIELD_GET(RIFSC_RISC_SRCID_MASK, risc_xcfgr);
dbg_entry->sr_rlock = risc_xcfgr & RIFSC_RISC_SRRLOCK;
dbg_entry->sr_enable = risc_xcfgr & RIFSC_RISC_SREN;
if (i == 2) {
risc_xaddr = readl_relaxed(rifsc->mmio + RIFSC_RISC_REG3_AADDR + 0x8 * j);
dbg_entry->sr_length = FIELD_GET(RIFSC_RISC_SRLENGTH_MASK, risc_xaddr);
dbg_entry->sr_start = FIELD_GET(RIFSC_RISC_SRSTART_MASK, risc_xaddr);
} else {
dbg_entry->sr_start = 0;
dbg_entry->sr_length = U16_MAX;
}
}
static int stm32_rifsc_conf_dump_show(struct seq_file *s, void *data)
{
struct rifsc_dbg_private *rifsc = (struct rifsc_dbg_private *)s->private;
int i, j;
seq_puts(s, "\n=============================================\n");
seq_puts(s, " RIFSC dump\n");
seq_puts(s, "=============================================\n\n");
seq_puts(s, "\n=============================================\n");
seq_puts(s, " RISUP dump\n");
seq_puts(s, "=============================================\n");
seq_printf(s, "\n| %-15s |", "Peripheral name");
seq_puts(s, "| Firewall ID |");
seq_puts(s, "| N/SECURE |");
seq_puts(s, "| N/PRIVILEGED |");
seq_puts(s, "| CID filtering |");
seq_puts(s, "| Semaphore mode |");
seq_puts(s, "| SCID |");
seq_printf(s, "| %7s |\n", "SEMWL");
for (i = 0; i < RIFSC_RISUP_ENTRIES && i < rifsc->nb_risup; i++) {
struct rifsc_risup_debug_data d_dbg_entry;
stm32_rifsc_fill_dev_dbg_entry(rifsc, &d_dbg_entry, i);
seq_printf(s, "| %-15s |", d_dbg_entry.dev_name);
seq_printf(s, "| %-11d |", d_dbg_entry.dev_id);
seq_printf(s, "| %-8s |", d_dbg_entry.dev_sec ? "SEC" : "NSEC");
seq_printf(s, "| %-12s |", d_dbg_entry.dev_priv ? "PRIV" : "NPRIV");
seq_printf(s, "| %-13s |", str_enabled_disabled(d_dbg_entry.dev_cid_filt_en));
seq_printf(s, "| %-14s |", str_enabled_disabled(d_dbg_entry.dev_sem_en));
seq_printf(s, "| %-4d |", d_dbg_entry.dev_cid);
seq_printf(s, "| %#-7x |\n", d_dbg_entry.dev_sem_cids);
}
seq_puts(s, "\n=============================================\n");
seq_puts(s, " RIMU dump\n");
seq_puts(s, "=============================================\n");
seq_puts(s, "| RIMU's name |");
seq_puts(s, "| CIDSEL |");
seq_puts(s, "| MCID |");
seq_puts(s, "| N/SECURE |");
seq_puts(s, "| N/PRIVILEGED |\n");
for (i = 0; i < RIFSC_RIMU_ENTRIES && rifsc->nb_rimu; i++) {
struct rifsc_rimu_debug_data m_dbg_entry;
stm32_rifsc_fill_rimu_dbg_entry(rifsc, &m_dbg_entry, i);
seq_printf(s, "| %-11s |", m_dbg_entry.m_name);
seq_printf(s, "| %-6s |", m_dbg_entry.cidsel ? "CIDSEL" : "");
seq_printf(s, "| %-4d |", m_dbg_entry.m_cid);
seq_printf(s, "| %-8s |", m_dbg_entry.m_sec ? "SEC" : "NSEC");
seq_printf(s, "| %-12s |\n", m_dbg_entry.m_priv ? "PRIV" : "NPRIV");
}
if (rifsc->nb_risal > 0) {
seq_puts(s, "\n=============================================\n");
seq_puts(s, " RISAL dump\n");
seq_puts(s, "=============================================\n");
seq_puts(s, "| Memory |");
seq_puts(s, "| Subreg. |");
seq_puts(s, "| N/SECURE |");
seq_puts(s, "| N/PRIVILEGED |");
seq_puts(s, "| Subreg. CID |");
seq_puts(s, "| Resource lock |");
seq_puts(s, "| Subreg. enable |");
seq_puts(s, "| Subreg. start |");
seq_puts(s, "| Subreg. end |\n");
for (i = 0; i < rifsc->nb_risal; i++) {
for (j = 0; j < RIFSC_RISAL_SUBREGIONS; j++) {
struct rifsc_subreg_debug_data sr_dbg_entry;
stm32_rifsc_fill_subreg_dbg_entry(rifsc, &sr_dbg_entry, i, j);
seq_printf(s, "| LPSRAM%1d |", i + 1);
seq_printf(s, "| %1s |", (j == 0) ? "A" : "B");
seq_printf(s, "| %-8s |", sr_dbg_entry.sr_sec ? "SEC" : "NSEC");
seq_printf(s, "| %-12s |", sr_dbg_entry.sr_priv ? "PRIV" : "NPRIV");
seq_printf(s, "| 0x%-9x |", sr_dbg_entry.sr_cid);
seq_printf(s, "| %-13s |",
sr_dbg_entry.sr_rlock ? "locked (1)" : "unlocked (0)");
seq_printf(s, "| %-14s |",
str_enabled_disabled(sr_dbg_entry.sr_enable));
seq_printf(s, "| 0x%-11x |", sr_dbg_entry.sr_start);
seq_printf(s, "| 0x%-11x |\n", sr_dbg_entry.sr_start +
sr_dbg_entry.sr_length - 1);
}
}
}
return 0;
}
DEFINE_SHOW_ATTRIBUTE(stm32_rifsc_conf_dump);
static int stm32_rifsc_register_debugfs(struct stm32_firewall_controller *rifsc_controller,
u32 nb_risup, u32 nb_rimu, u32 nb_risal)
{
struct rifsc_dbg_private *rifsc_priv;
struct dentry *root = NULL;
rifsc_priv = devm_kzalloc(rifsc_controller->dev, sizeof(*rifsc_priv), GFP_KERNEL);
if (!rifsc_priv)
return -ENOMEM;
rifsc_priv->mmio = rifsc_controller->mmio;
rifsc_priv->nb_risup = nb_risup;
rifsc_priv->nb_rimu = nb_rimu;
rifsc_priv->nb_risal = nb_risal;
rifsc_priv->res_names = of_device_get_match_data(rifsc_controller->dev);
root = debugfs_lookup("stm32_firewall", NULL);
if (!root)
root = debugfs_create_dir("stm32_firewall", NULL);
if (IS_ERR(root))
return PTR_ERR(root);
debugfs_create_file("rifsc", 0444, root, rifsc_priv, &stm32_rifsc_conf_dump_fops);
return 0;
}
#endif /* defined(CONFIG_DEBUG_FS) */
static bool stm32_rifsc_is_semaphore_available(void __iomem *addr)
{
return !(readl(addr) & SEMCR_MUTEX);
@ -207,9 +769,19 @@ static int stm32_rifsc_probe(struct platform_device *pdev)
rifsc_controller->release_access = stm32_rifsc_release_access;
/* Get number of RIFSC entries*/
nb_risup = readl(rifsc_controller->mmio + RIFSC_RISC_HWCFGR2) & HWCFGR2_CONF1_MASK;
nb_rimu = readl(rifsc_controller->mmio + RIFSC_RISC_HWCFGR2) & HWCFGR2_CONF2_MASK;
nb_risal = readl(rifsc_controller->mmio + RIFSC_RISC_HWCFGR2) & HWCFGR2_CONF3_MASK;
nb_risup = FIELD_GET(HWCFGR2_CONF1_MASK,
readl(rifsc_controller->mmio + RIFSC_RISC_HWCFGR2));
nb_rimu = FIELD_GET(HWCFGR2_CONF2_MASK,
readl(rifsc_controller->mmio + RIFSC_RISC_HWCFGR2));
nb_risal = FIELD_GET(HWCFGR2_CONF3_MASK,
readl(rifsc_controller->mmio + RIFSC_RISC_HWCFGR2));
/*
* On STM32MP21, RIFSC_RISC_HWCFGR2 shows an incorrect number of RISAL (NUM_RISAL is 3
* instead of 0). A software workaround is implemented using the st,mem-map property in the
* device tree. This property is absent or left empty if there is no RISAL.
*/
if (of_device_is_compatible(np, "st,stm32mp21-rifsc"))
nb_risal = 0;
rifsc_controller->max_entries = nb_risup + nb_rimu + nb_risal;
platform_set_drvdata(pdev, rifsc_controller);
@ -228,12 +800,29 @@ static int stm32_rifsc_probe(struct platform_device *pdev)
return rc;
}
#if defined(CONFIG_DEBUG_FS)
rc = stm32_rifsc_register_debugfs(rifsc_controller, nb_risup, nb_rimu, nb_risal);
if (rc)
return dev_err_probe(rifsc_controller->dev, rc, "Failed creating debugfs entry\n");
#endif
/* Populate all allowed nodes */
return of_platform_populate(np, NULL, NULL, &pdev->dev);
}
static const struct of_device_id stm32_rifsc_of_match[] = {
{ .compatible = "st,stm32mp25-rifsc" },
{
.compatible = "st,stm32mp25-rifsc",
#if defined(CONFIG_DEBUG_FS)
.data = &rifsc_mp25_res_names,
#endif
},
{
.compatible = "st,stm32mp21-rifsc",
#if defined(CONFIG_DEBUG_FS)
.data = &rifsc_mp21_res_names,
#endif
},
{}
};
MODULE_DEVICE_TABLE(of, stm32_rifsc_of_match);

View File

@ -373,7 +373,6 @@ static int sunxi_rsb_read(struct sunxi_rsb *rsb, u8 rtaddr, u8 addr,
unlock:
mutex_unlock(&rsb->lock);
pm_runtime_mark_last_busy(rsb->dev);
pm_runtime_put_autosuspend(rsb->dev);
return ret;
@ -417,7 +416,6 @@ static int sunxi_rsb_write(struct sunxi_rsb *rsb, u8 rtaddr, u8 addr,
mutex_unlock(&rsb->lock);
pm_runtime_mark_last_busy(rsb->dev);
pm_runtime_put_autosuspend(rsb->dev);
return ret;

View File

@ -48,6 +48,7 @@ enum sysc_soc {
SOC_UNKNOWN,
SOC_2420,
SOC_2430,
SOC_AM33,
SOC_3430,
SOC_AM35,
SOC_3630,
@ -2912,6 +2913,7 @@ static void ti_sysc_idle(struct work_struct *work)
static const struct soc_device_attribute sysc_soc_match[] = {
SOC_FLAG("OMAP242*", SOC_2420),
SOC_FLAG("OMAP243*", SOC_2430),
SOC_FLAG("AM33*", SOC_AM33),
SOC_FLAG("AM35*", SOC_AM35),
SOC_FLAG("OMAP3[45]*", SOC_3430),
SOC_FLAG("OMAP3[67]*", SOC_3630),
@ -3117,10 +3119,15 @@ static int sysc_check_active_timer(struct sysc *ddata)
* can be dropped if we stop supporting old beagleboard revisions
* A to B4 at some point.
*/
if (sysc_soc->soc == SOC_3430 || sysc_soc->soc == SOC_AM35)
switch (sysc_soc->soc) {
case SOC_AM33:
case SOC_3430:
case SOC_AM35:
error = -ENXIO;
else
break;
default:
error = -EBUSY;
}
if ((ddata->cfg.quirks & SYSC_QUIRK_NO_RESET_ON_INIT) &&
(ddata->cfg.quirks & SYSC_QUIRK_NO_IDLE))

View File

@ -115,7 +115,7 @@ struct pmc_data *pmc_data_allocate(unsigned int ncore, unsigned int nsystem,
/* Address in SECURAM that say if we suspend to backup mode. */
static void __iomem *at91_pmc_backup_suspend;
static int at91_pmc_suspend(void)
static int at91_pmc_suspend(void *data)
{
unsigned int backup;
@ -129,7 +129,7 @@ static int at91_pmc_suspend(void)
return clk_save_context();
}
static void at91_pmc_resume(void)
static void at91_pmc_resume(void *data)
{
unsigned int backup;
@ -143,11 +143,15 @@ static void at91_pmc_resume(void)
clk_restore_context();
}
static struct syscore_ops pmc_syscore_ops = {
static const struct syscore_ops pmc_syscore_ops = {
.suspend = at91_pmc_suspend,
.resume = at91_pmc_resume,
};
static struct syscore pmc_syscore = {
.ops = &pmc_syscore_ops,
};
static const struct of_device_id pmc_dt_ids[] = {
{ .compatible = "atmel,sama5d2-pmc" },
{ .compatible = "microchip,sama7g5-pmc", },
@ -185,7 +189,7 @@ static int __init pmc_register_ops(void)
return -ENOMEM;
}
register_syscore_ops(&pmc_syscore_ops);
register_syscore(&pmc_syscore);
return 0;
}

View File

@ -6,7 +6,6 @@
*/
#include <linux/clk-provider.h>
#include <linux/reset-controller.h>
#include <linux/clk.h>
#include <linux/clkdev.h>
#include <linux/init.h>
@ -66,14 +65,8 @@ LPSC_CLKDEV3(ecap_clkdev, "fck", "ecap.0",
"fck", "ecap.1",
"fck", "ecap.2");
static struct reset_control_lookup da850_psc0_reset_lookup_table[] = {
RESET_LOOKUP("da850-psc0", 15, "davinci-rproc.0", NULL),
};
static int da850_psc0_init(struct device *dev, void __iomem *base)
{
reset_controller_add_lookup(da850_psc0_reset_lookup_table,
ARRAY_SIZE(da850_psc0_reset_lookup_table));
return davinci_psc_register_clocks(dev, da850_psc0_info, 16, base);
}

View File

@ -139,7 +139,7 @@ static struct clk * __init vf610_get_fixed_clock(
return clk;
};
static int vf610_clk_suspend(void)
static int vf610_clk_suspend(void *data)
{
int i;
@ -156,7 +156,7 @@ static int vf610_clk_suspend(void)
return 0;
}
static void vf610_clk_resume(void)
static void vf610_clk_resume(void *data)
{
int i;
@ -171,11 +171,15 @@ static void vf610_clk_resume(void)
writel_relaxed(ccgr[i], CCM_CCGRx(i));
}
static struct syscore_ops vf610_clk_syscore_ops = {
static const struct syscore_ops vf610_clk_syscore_ops = {
.suspend = vf610_clk_suspend,
.resume = vf610_clk_resume,
};
static struct syscore vf610_clk_syscore = {
.ops = &vf610_clk_syscore_ops,
};
static void __init vf610_clocks_init(struct device_node *ccm_node)
{
struct device_node *np;
@ -462,7 +466,7 @@ static void __init vf610_clocks_init(struct device_node *ccm_node)
for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
clk_prepare_enable(clk[clks_init_on[i]]);
register_syscore_ops(&vf610_clk_syscore_ops);
register_syscore(&vf610_clk_syscore);
/* Add the clocks to provider list */
clk_data.clks = clk;

View File

@ -268,6 +268,6 @@ static void __init jz4725b_cgu_init(struct device_node *np)
if (retval)
pr_err("%s: failed to register CGU Clocks\n", __func__);
ingenic_cgu_register_syscore_ops(cgu);
ingenic_cgu_register_syscore(cgu);
}
CLK_OF_DECLARE_DRIVER(jz4725b_cgu, "ingenic,jz4725b-cgu", jz4725b_cgu_init);

View File

@ -266,6 +266,6 @@ static void __init jz4740_cgu_init(struct device_node *np)
if (retval)
pr_err("%s: failed to register CGU Clocks\n", __func__);
ingenic_cgu_register_syscore_ops(cgu);
ingenic_cgu_register_syscore(cgu);
}
CLK_OF_DECLARE_DRIVER(jz4740_cgu, "ingenic,jz4740-cgu", jz4740_cgu_init);

View File

@ -337,7 +337,7 @@ static void __init jz4755_cgu_init(struct device_node *np)
if (retval)
pr_err("%s: failed to register CGU Clocks\n", __func__);
ingenic_cgu_register_syscore_ops(cgu);
ingenic_cgu_register_syscore(cgu);
}
/*
* CGU has some children devices, this is useful for probing children devices

View File

@ -436,7 +436,7 @@ static void __init jz4760_cgu_init(struct device_node *np)
if (retval)
pr_err("%s: failed to register CGU Clocks\n", __func__);
ingenic_cgu_register_syscore_ops(cgu);
ingenic_cgu_register_syscore(cgu);
}
/* We only probe via devicetree, no need for a platform driver */

View File

@ -456,7 +456,7 @@ static void __init jz4770_cgu_init(struct device_node *np)
if (retval)
pr_err("%s: failed to register CGU Clocks\n", __func__);
ingenic_cgu_register_syscore_ops(cgu);
ingenic_cgu_register_syscore(cgu);
}
/* We only probe via devicetree, no need for a platform driver */

View File

@ -803,6 +803,6 @@ static void __init jz4780_cgu_init(struct device_node *np)
return;
}
ingenic_cgu_register_syscore_ops(cgu);
ingenic_cgu_register_syscore(cgu);
}
CLK_OF_DECLARE_DRIVER(jz4780_cgu, "ingenic,jz4780-cgu", jz4780_cgu_init);

View File

@ -15,7 +15,7 @@
static void __iomem * __maybe_unused ingenic_cgu_base;
static int __maybe_unused ingenic_cgu_pm_suspend(void)
static int __maybe_unused ingenic_cgu_pm_suspend(void *data)
{
u32 val = readl(ingenic_cgu_base + CGU_REG_LCR);
@ -24,22 +24,26 @@ static int __maybe_unused ingenic_cgu_pm_suspend(void)
return 0;
}
static void __maybe_unused ingenic_cgu_pm_resume(void)
static void __maybe_unused ingenic_cgu_pm_resume(void *data)
{
u32 val = readl(ingenic_cgu_base + CGU_REG_LCR);
writel(val & ~LCR_LOW_POWER_MODE, ingenic_cgu_base + CGU_REG_LCR);
}
static struct syscore_ops __maybe_unused ingenic_cgu_pm_ops = {
static const struct syscore_ops __maybe_unused ingenic_cgu_pm_ops = {
.suspend = ingenic_cgu_pm_suspend,
.resume = ingenic_cgu_pm_resume,
};
void ingenic_cgu_register_syscore_ops(struct ingenic_cgu *cgu)
static struct syscore __maybe_unused ingenic_cgu_pm = {
.ops = &ingenic_cgu_pm_ops,
};
void ingenic_cgu_register_syscore(struct ingenic_cgu *cgu)
{
if (IS_ENABLED(CONFIG_PM_SLEEP)) {
ingenic_cgu_base = cgu->base;
register_syscore_ops(&ingenic_cgu_pm_ops);
register_syscore(&ingenic_cgu_pm);
}
}

View File

@ -7,6 +7,6 @@
struct ingenic_cgu;
void ingenic_cgu_register_syscore_ops(struct ingenic_cgu *cgu);
void ingenic_cgu_register_syscore(struct ingenic_cgu *cgu);
#endif /* DRIVERS_CLK_INGENIC_PM_H */

View File

@ -455,7 +455,7 @@ static int __init ingenic_tcu_probe(struct device_node *np)
return ret;
}
static int __maybe_unused tcu_pm_suspend(void)
static int __maybe_unused tcu_pm_suspend(void *data)
{
struct ingenic_tcu *tcu = ingenic_tcu;
@ -465,7 +465,7 @@ static int __maybe_unused tcu_pm_suspend(void)
return 0;
}
static void __maybe_unused tcu_pm_resume(void)
static void __maybe_unused tcu_pm_resume(void *data)
{
struct ingenic_tcu *tcu = ingenic_tcu;
@ -473,11 +473,15 @@ static void __maybe_unused tcu_pm_resume(void)
clk_enable(tcu->clk);
}
static struct syscore_ops __maybe_unused tcu_pm_ops = {
static const struct syscore_ops __maybe_unused tcu_pm_ops = {
.suspend = tcu_pm_suspend,
.resume = tcu_pm_resume,
};
static struct syscore __maybe_unused tcu_pm = {
.ops = &tcu_pm_ops,
};
static void __init ingenic_tcu_init(struct device_node *np)
{
int ret = ingenic_tcu_probe(np);
@ -486,7 +490,7 @@ static void __init ingenic_tcu_init(struct device_node *np)
pr_crit("Failed to initialize TCU clocks: %d\n", ret);
if (IS_ENABLED(CONFIG_PM_SLEEP))
register_syscore_ops(&tcu_pm_ops);
register_syscore(&tcu_pm);
}
CLK_OF_DECLARE_DRIVER(jz4740_cgu, "ingenic,jz4740-tcu", ingenic_tcu_init);

View File

@ -556,7 +556,7 @@ static void __init x1000_cgu_init(struct device_node *np)
return;
}
ingenic_cgu_register_syscore_ops(cgu);
ingenic_cgu_register_syscore(cgu);
}
/*
* CGU has some children devices, this is useful for probing children devices

View File

@ -463,7 +463,7 @@ static void __init x1830_cgu_init(struct device_node *np)
return;
}
ingenic_cgu_register_syscore_ops(cgu);
ingenic_cgu_register_syscore(cgu);
}
/*
* CGU has some children devices, this is useful for probing children devices

View File

@ -215,22 +215,26 @@ static struct clk *clk_gating_get_src(
return ERR_PTR(-ENODEV);
}
static int mvebu_clk_gating_suspend(void)
static int mvebu_clk_gating_suspend(void *data)
{
ctrl->saved_reg = readl(ctrl->base);
return 0;
}
static void mvebu_clk_gating_resume(void)
static void mvebu_clk_gating_resume(void *data)
{
writel(ctrl->saved_reg, ctrl->base);
}
static struct syscore_ops clk_gate_syscore_ops = {
static const struct syscore_ops clk_gate_syscore_ops = {
.suspend = mvebu_clk_gating_suspend,
.resume = mvebu_clk_gating_resume,
};
static struct syscore clk_gate_syscore = {
.ops = &clk_gate_syscore_ops,
};
void __init mvebu_clk_gating_setup(struct device_node *np,
const struct clk_gating_soc_desc *desc)
{
@ -284,7 +288,7 @@ void __init mvebu_clk_gating_setup(struct device_node *np,
of_clk_add_provider(np, clk_gating_get_src, ctrl);
register_syscore_ops(&clk_gate_syscore_ops);
register_syscore(&clk_gate_syscore);
return;
gates_out:

View File

@ -871,7 +871,7 @@ static const int rk3288_saved_cru_reg_ids[] = {
static u32 rk3288_saved_cru_regs[ARRAY_SIZE(rk3288_saved_cru_reg_ids)];
static int rk3288_clk_suspend(void)
static int rk3288_clk_suspend(void *data)
{
int i, reg_id;
@ -906,7 +906,7 @@ static int rk3288_clk_suspend(void)
return 0;
}
static void rk3288_clk_resume(void)
static void rk3288_clk_resume(void *data)
{
int i, reg_id;
@ -923,11 +923,15 @@ static void rk3288_clk_shutdown(void)
writel_relaxed(0xf3030000, rk3288_cru_base + RK3288_MODE_CON);
}
static struct syscore_ops rk3288_clk_syscore_ops = {
static const struct syscore_ops rk3288_clk_syscore_ops = {
.suspend = rk3288_clk_suspend,
.resume = rk3288_clk_resume,
};
static struct syscore rk3288_clk_syscore = {
.ops = &rk3288_clk_syscore_ops,
};
static void __init rk3288_common_init(struct device_node *np,
enum rk3288_variant soc)
{
@ -976,7 +980,7 @@ static void __init rk3288_common_init(struct device_node *np,
rockchip_register_restart_notifier(ctx, RK3288_GLB_SRST_FST,
rk3288_clk_shutdown);
register_syscore_ops(&rk3288_clk_syscore_ops);
register_syscore(&rk3288_clk_syscore);
rockchip_clk_of_add_provider(np, ctx);
}

View File

@ -36,7 +36,7 @@ static unsigned long reg_save[][2] = {
{ASS_CLK_GATE, 0},
};
static int s5pv210_audss_clk_suspend(void)
static int s5pv210_audss_clk_suspend(void *data)
{
int i;
@ -46,7 +46,7 @@ static int s5pv210_audss_clk_suspend(void)
return 0;
}
static void s5pv210_audss_clk_resume(void)
static void s5pv210_audss_clk_resume(void *data)
{
int i;
@ -54,10 +54,14 @@ static void s5pv210_audss_clk_resume(void)
writel(reg_save[i][1], reg_base + reg_save[i][0]);
}
static struct syscore_ops s5pv210_audss_clk_syscore_ops = {
static const struct syscore_ops s5pv210_audss_clk_syscore_ops = {
.suspend = s5pv210_audss_clk_suspend,
.resume = s5pv210_audss_clk_resume,
};
static struct syscore s5pv210_audss_clk_syscore = {
.ops = &s5pv210_audss_clk_syscore_ops,
};
#endif /* CONFIG_PM_SLEEP */
/* register s5pv210_audss clocks */
@ -175,7 +179,7 @@ static int s5pv210_audss_clk_probe(struct platform_device *pdev)
}
#ifdef CONFIG_PM_SLEEP
register_syscore_ops(&s5pv210_audss_clk_syscore_ops);
register_syscore(&s5pv210_audss_clk_syscore);
#endif
return 0;

View File

@ -271,7 +271,7 @@ void __init samsung_clk_of_register_fixed_ext(struct samsung_clk_provider *ctx,
}
#ifdef CONFIG_PM_SLEEP
static int samsung_clk_suspend(void)
static int samsung_clk_suspend(void *data)
{
struct samsung_clock_reg_cache *reg_cache;
@ -284,7 +284,7 @@ static int samsung_clk_suspend(void)
return 0;
}
static void samsung_clk_resume(void)
static void samsung_clk_resume(void *data)
{
struct samsung_clock_reg_cache *reg_cache;
@ -293,11 +293,15 @@ static void samsung_clk_resume(void)
reg_cache->rd_num);
}
static struct syscore_ops samsung_clk_syscore_ops = {
static const struct syscore_ops samsung_clk_syscore_ops = {
.suspend = samsung_clk_suspend,
.resume = samsung_clk_resume,
};
static struct syscore samsung_clk_syscore = {
.ops = &samsung_clk_syscore_ops,
};
void samsung_clk_extended_sleep_init(void __iomem *reg_base,
const unsigned long *rdump,
unsigned long nr_rdump,
@ -316,7 +320,7 @@ void samsung_clk_extended_sleep_init(void __iomem *reg_base,
panic("could not allocate register dump storage.\n");
if (list_empty(&clock_reg_cache_list))
register_syscore_ops(&samsung_clk_syscore_ops);
register_syscore(&samsung_clk_syscore);
reg_cache->reg_base = reg_base;
reg_cache->rd_num = nr_rdump;

View File

@ -3444,7 +3444,7 @@ static void tegra210_disable_cpu_clock(u32 cpu)
static u32 spare_reg_ctx, misc_clk_enb_ctx, clk_msk_arm_ctx;
static u32 cpu_softrst_ctx[3];
static int tegra210_clk_suspend(void)
static int tegra210_clk_suspend(void *data)
{
unsigned int i;
@ -3465,7 +3465,7 @@ static int tegra210_clk_suspend(void)
return 0;
}
static void tegra210_clk_resume(void)
static void tegra210_clk_resume(void *data)
{
unsigned int i;
@ -3523,13 +3523,17 @@ static void tegra210_cpu_clock_resume(void)
}
#endif
static struct syscore_ops tegra_clk_syscore_ops = {
static const struct syscore_ops tegra_clk_syscore_ops = {
#ifdef CONFIG_PM_SLEEP
.suspend = tegra210_clk_suspend,
.resume = tegra210_clk_resume,
#endif
};
static struct syscore tegra_clk_syscore = {
.ops = &tegra_clk_syscore_ops,
};
static struct tegra_cpu_car_ops tegra210_cpu_car_ops = {
.wait_for_reset = tegra210_wait_cpu_in_reset,
.disable_clock = tegra210_disable_cpu_clock,
@ -3813,6 +3817,6 @@ static void __init tegra210_clock_init(struct device_node *np)
tegra_cpu_car_ops = &tegra210_cpu_car_ops;
register_syscore_ops(&tegra_clk_syscore_ops);
register_syscore(&tegra_clk_syscore);
}
CLK_OF_DECLARE(tegra210, "nvidia,tegra210-car", tegra210_clock_init);

View File

@ -207,14 +207,14 @@ static int armada_370_xp_timer_dying_cpu(unsigned int cpu)
static u32 timer0_ctrl_reg, timer0_local_ctrl_reg;
static int armada_370_xp_timer_suspend(void)
static int armada_370_xp_timer_suspend(void *data)
{
timer0_ctrl_reg = readl(timer_base + TIMER_CTRL_OFF);
timer0_local_ctrl_reg = readl(local_base + TIMER_CTRL_OFF);
return 0;
}
static void armada_370_xp_timer_resume(void)
static void armada_370_xp_timer_resume(void *data)
{
writel(0xffffffff, timer_base + TIMER0_VAL_OFF);
writel(0xffffffff, timer_base + TIMER0_RELOAD_OFF);
@ -222,11 +222,15 @@ static void armada_370_xp_timer_resume(void)
writel(timer0_local_ctrl_reg, local_base + TIMER_CTRL_OFF);
}
static struct syscore_ops armada_370_xp_timer_syscore_ops = {
static const struct syscore_ops armada_370_xp_timer_syscore_ops = {
.suspend = armada_370_xp_timer_suspend,
.resume = armada_370_xp_timer_resume,
};
static struct syscore armada_370_xp_timer_syscore = {
.ops = &armada_370_xp_timer_syscore_ops,
};
static unsigned long armada_370_delay_timer_read(void)
{
return ~readl(timer_base + TIMER0_VAL_OFF);
@ -324,7 +328,7 @@ static int __init armada_370_xp_timer_common_init(struct device_node *np)
return res;
}
register_syscore_ops(&armada_370_xp_timer_syscore_ops);
register_syscore(&armada_370_xp_timer_syscore);
return 0;
}

View File

@ -177,26 +177,30 @@ static void psci_idle_syscore_switch(bool suspend)
}
}
static int psci_idle_syscore_suspend(void)
static int psci_idle_syscore_suspend(void *data)
{
psci_idle_syscore_switch(true);
return 0;
}
static void psci_idle_syscore_resume(void)
static void psci_idle_syscore_resume(void *data)
{
psci_idle_syscore_switch(false);
}
static struct syscore_ops psci_idle_syscore_ops = {
static const struct syscore_ops psci_idle_syscore_ops = {
.suspend = psci_idle_syscore_suspend,
.resume = psci_idle_syscore_resume,
};
static struct syscore psci_idle_syscore = {
.ops = &psci_idle_syscore_ops,
};
static void psci_idle_init_syscore(void)
{
if (psci_cpuidle_use_syscore)
register_syscore_ops(&psci_idle_syscore_ops);
register_syscore(&psci_idle_syscore);
}
static void psci_idle_init_cpuhp(void)

View File

@ -203,6 +203,18 @@ int imx_scu_enable_general_irq_channel(struct device *dev)
struct mbox_chan *ch;
int ret = 0, i = 0;
if (!of_parse_phandle_with_args(dev->of_node, "mboxes",
"#mbox-cells", 0, &spec)) {
i = of_alias_get_id(spec.np, "mu");
of_node_put(spec.np);
}
/* use mu1 as general mu irq channel if failed */
if (i < 0)
i = 1;
mu_resource_id = IMX_SC_R_MU_0A + i;
ret = imx_scu_get_handle(&imx_sc_irq_ipc_handle);
if (ret)
return ret;
@ -214,27 +226,16 @@ int imx_scu_enable_general_irq_channel(struct device *dev)
cl->dev = dev;
cl->rx_callback = imx_scu_irq_callback;
INIT_WORK(&imx_sc_irq_work, imx_scu_irq_work_handler);
/* SCU general IRQ uses general interrupt channel 3 */
ch = mbox_request_channel_byname(cl, "gip3");
if (IS_ERR(ch)) {
ret = PTR_ERR(ch);
dev_err(dev, "failed to request mbox chan gip3, ret %d\n", ret);
devm_kfree(dev, cl);
return ret;
goto free_cl;
}
INIT_WORK(&imx_sc_irq_work, imx_scu_irq_work_handler);
if (!of_parse_phandle_with_args(dev->of_node, "mboxes",
"#mbox-cells", 0, &spec))
i = of_alias_get_id(spec.np, "mu");
/* use mu1 as general mu irq channel if failed */
if (i < 0)
i = 1;
mu_resource_id = IMX_SC_R_MU_0A + i;
/* Create directory under /sysfs/firmware */
wakeup_obj = kobject_create_and_add("scu_wakeup_source", firmware_kobj);
if (!wakeup_obj) {
@ -253,7 +254,8 @@ int imx_scu_enable_general_irq_channel(struct device *dev)
free_ch:
mbox_free_channel(ch);
free_cl:
devm_kfree(dev, cl);
return ret;
}
EXPORT_SYMBOL(imx_scu_enable_general_irq_channel);

View File

@ -73,9 +73,9 @@ static int imx_sc_linux_errmap[IMX_SC_ERR_LAST] = {
-EACCES, /* IMX_SC_ERR_NOACCESS */
-EACCES, /* IMX_SC_ERR_LOCKED */
-ERANGE, /* IMX_SC_ERR_UNAVAILABLE */
-EEXIST, /* IMX_SC_ERR_NOTFOUND */
-EPERM, /* IMX_SC_ERR_NOPOWER */
-EPIPE, /* IMX_SC_ERR_IPC */
-ENOENT, /* IMX_SC_ERR_NOTFOUND */
-ENODEV, /* IMX_SC_ERR_NOPOWER */
-ECOMM, /* IMX_SC_ERR_IPC */
-EBUSY, /* IMX_SC_ERR_BUSY */
-EIO, /* IMX_SC_ERR_FAIL */
};
@ -324,7 +324,9 @@ static int imx_scu_probe(struct platform_device *pdev)
}
sc_ipc->dev = dev;
mutex_init(&sc_ipc->lock);
ret = devm_mutex_init(dev, &sc_ipc->lock);
if (ret)
return ret;
init_completion(&sc_ipc->done);
imx_sc_ipc_handle = sc_ipc;
@ -352,6 +354,7 @@ static struct platform_driver imx_scu_driver = {
.driver = {
.name = "imx-scu",
.of_match_table = imx_scu_match,
.suppress_bind_attrs = true,
},
.probe = imx_scu_probe,
};

View File

@ -398,6 +398,9 @@ static void ti_sci_put_one_xfer(struct ti_sci_xfers_info *minfo,
static inline int ti_sci_do_xfer(struct ti_sci_info *info,
struct ti_sci_xfer *xfer)
{
struct ti_sci_msg_hdr *hdr = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
bool response_expected = !!(hdr->flags & (TI_SCI_FLAG_REQ_ACK_ON_PROCESSED |
TI_SCI_FLAG_REQ_ACK_ON_RECEIVED));
int ret;
int timeout;
struct device *dev = info->dev;
@ -409,12 +412,12 @@ static inline int ti_sci_do_xfer(struct ti_sci_info *info,
ret = 0;
if (system_state <= SYSTEM_RUNNING) {
if (response_expected && system_state <= SYSTEM_RUNNING) {
/* And we wait for the response. */
timeout = msecs_to_jiffies(info->desc->max_rx_timeout_ms);
if (!wait_for_completion_timeout(&xfer->done, timeout))
ret = -ETIMEDOUT;
} else {
} else if (response_expected) {
/*
* If we are !running, we cannot use wait_for_completion_timeout
* during noirq phase, so we must manually poll the completion.
@ -1670,6 +1673,9 @@ static int ti_sci_cmd_clk_get_freq(const struct ti_sci_handle *handle,
static int ti_sci_cmd_prepare_sleep(const struct ti_sci_handle *handle, u8 mode,
u32 ctx_lo, u32 ctx_hi, u32 debug_flags)
{
u32 msg_flags = mode == TISCI_MSG_VALUE_SLEEP_MODE_PARTIAL_IO ?
TI_SCI_FLAG_REQ_GENERIC_NORESPONSE :
TI_SCI_FLAG_REQ_ACK_ON_PROCESSED;
struct ti_sci_info *info;
struct ti_sci_msg_req_prepare_sleep *req;
struct ti_sci_msg_hdr *resp;
@ -1686,7 +1692,7 @@ static int ti_sci_cmd_prepare_sleep(const struct ti_sci_handle *handle, u8 mode,
dev = info->dev;
xfer = ti_sci_get_one_xfer(info, TI_SCI_MSG_PREPARE_SLEEP,
TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
msg_flags,
sizeof(*req), sizeof(*resp));
if (IS_ERR(xfer)) {
ret = PTR_ERR(xfer);
@ -1706,12 +1712,13 @@ static int ti_sci_cmd_prepare_sleep(const struct ti_sci_handle *handle, u8 mode,
goto fail;
}
if (msg_flags == TI_SCI_FLAG_REQ_ACK_ON_PROCESSED) {
resp = (struct ti_sci_msg_hdr *)xfer->xfer_buf;
if (!ti_sci_is_response_ack(resp)) {
dev_err(dev, "Failed to prepare sleep\n");
ret = -ENODEV;
}
}
fail:
ti_sci_put_one_xfer(&info->minfo, xfer);
@ -3664,6 +3671,78 @@ devm_ti_sci_get_resource(const struct ti_sci_handle *handle, struct device *dev,
}
EXPORT_SYMBOL_GPL(devm_ti_sci_get_resource);
/*
* Iterate all device nodes that have a wakeup-source property and check if one
* of the possible phandles points to a Partial-IO system state. If it
* does resolve the device node to an actual device and check if wakeup is
* enabled.
*/
static bool ti_sci_partial_io_wakeup_enabled(struct ti_sci_info *info)
{
struct device_node *wakeup_node = NULL;
for_each_node_with_property(wakeup_node, "wakeup-source") {
struct of_phandle_iterator it;
int err;
of_for_each_phandle(&it, err, wakeup_node, "wakeup-source", NULL, 0) {
struct platform_device *pdev;
bool may_wakeup;
/*
* Continue if idle-state-name is not off-wake. Return
* value is the index of the string which should be 0 if
* off-wake is present.
*/
if (of_property_match_string(it.node, "idle-state-name", "off-wake"))
continue;
pdev = of_find_device_by_node(wakeup_node);
if (!pdev)
continue;
may_wakeup = device_may_wakeup(&pdev->dev);
put_device(&pdev->dev);
if (may_wakeup) {
dev_dbg(info->dev, "%pOF identified as wakeup source for Partial-IO\n",
wakeup_node);
of_node_put(it.node);
of_node_put(wakeup_node);
return true;
}
}
}
return false;
}
static int ti_sci_sys_off_handler(struct sys_off_data *data)
{
struct ti_sci_info *info = data->cb_data;
const struct ti_sci_handle *handle = &info->handle;
bool enter_partial_io = ti_sci_partial_io_wakeup_enabled(info);
int ret;
if (!enter_partial_io)
return NOTIFY_DONE;
dev_info(info->dev, "Entering Partial-IO because a powered wakeup-enabled device was found.\n");
ret = ti_sci_cmd_prepare_sleep(handle, TISCI_MSG_VALUE_SLEEP_MODE_PARTIAL_IO, 0, 0, 0);
if (ret) {
dev_err(info->dev,
"Failed to enter Partial-IO %pe, trying to do an emergency restart\n",
ERR_PTR(ret));
emergency_restart();
}
mdelay(5000);
emergency_restart();
return NOTIFY_DONE;
}
static int tisci_reboot_handler(struct sys_off_data *data)
{
struct ti_sci_info *info = data->cb_data;
@ -3706,7 +3785,7 @@ static int ti_sci_prepare_system_suspend(struct ti_sci_info *info)
}
}
static int __maybe_unused ti_sci_suspend(struct device *dev)
static int ti_sci_suspend(struct device *dev)
{
struct ti_sci_info *info = dev_get_drvdata(dev);
struct device *cpu_dev, *cpu_dev_max = NULL;
@ -3746,19 +3825,21 @@ static int __maybe_unused ti_sci_suspend(struct device *dev)
return 0;
}
static int __maybe_unused ti_sci_suspend_noirq(struct device *dev)
static int ti_sci_suspend_noirq(struct device *dev)
{
struct ti_sci_info *info = dev_get_drvdata(dev);
int ret = 0;
if (info->fw_caps & MSG_FLAG_CAPS_IO_ISOLATION) {
ret = ti_sci_cmd_set_io_isolation(&info->handle, TISCI_MSG_VALUE_IO_ENABLE);
if (ret)
return ret;
}
return 0;
}
static int __maybe_unused ti_sci_resume_noirq(struct device *dev)
static int ti_sci_resume_noirq(struct device *dev)
{
struct ti_sci_info *info = dev_get_drvdata(dev);
int ret = 0;
@ -3767,9 +3848,11 @@ static int __maybe_unused ti_sci_resume_noirq(struct device *dev)
u8 pin;
u8 mode;
if (info->fw_caps & MSG_FLAG_CAPS_IO_ISOLATION) {
ret = ti_sci_cmd_set_io_isolation(&info->handle, TISCI_MSG_VALUE_IO_DISABLE);
if (ret)
return ret;
}
ret = ti_sci_msg_cmd_lpm_wake_reason(&info->handle, &source, &time, &pin, &mode);
/* Do not fail to resume on error as the wake reason is not critical */
@ -3780,7 +3863,7 @@ static int __maybe_unused ti_sci_resume_noirq(struct device *dev)
return 0;
}
static void __maybe_unused ti_sci_pm_complete(struct device *dev)
static void ti_sci_pm_complete(struct device *dev)
{
struct ti_sci_info *info = dev_get_drvdata(dev);
@ -3791,12 +3874,10 @@ static void __maybe_unused ti_sci_pm_complete(struct device *dev)
}
static const struct dev_pm_ops ti_sci_pm_ops = {
#ifdef CONFIG_PM_SLEEP
.suspend = ti_sci_suspend,
.suspend_noirq = ti_sci_suspend_noirq,
.resume_noirq = ti_sci_resume_noirq,
.complete = ti_sci_pm_complete,
#endif
.suspend = pm_sleep_ptr(ti_sci_suspend),
.suspend_noirq = pm_sleep_ptr(ti_sci_suspend_noirq),
.resume_noirq = pm_sleep_ptr(ti_sci_resume_noirq),
.complete = pm_sleep_ptr(ti_sci_pm_complete),
};
/* Description for K2G */
@ -3928,11 +4009,12 @@ static int ti_sci_probe(struct platform_device *pdev)
}
ti_sci_msg_cmd_query_fw_caps(&info->handle, &info->fw_caps);
dev_dbg(dev, "Detected firmware capabilities: %s%s%s%s\n",
dev_dbg(dev, "Detected firmware capabilities: %s%s%s%s%s\n",
info->fw_caps & MSG_FLAG_CAPS_GENERIC ? "Generic" : "",
info->fw_caps & MSG_FLAG_CAPS_LPM_PARTIAL_IO ? " Partial-IO" : "",
info->fw_caps & MSG_FLAG_CAPS_LPM_DM_MANAGED ? " DM-Managed" : "",
info->fw_caps & MSG_FLAG_CAPS_LPM_ABORT ? " LPM-Abort" : ""
info->fw_caps & MSG_FLAG_CAPS_LPM_ABORT ? " LPM-Abort" : "",
info->fw_caps & MSG_FLAG_CAPS_IO_ISOLATION ? " IO-Isolation" : ""
);
ti_sci_setup_ops(info);
@ -3943,6 +4025,19 @@ static int ti_sci_probe(struct platform_device *pdev)
goto out;
}
if (info->fw_caps & MSG_FLAG_CAPS_LPM_PARTIAL_IO) {
ret = devm_register_sys_off_handler(dev,
SYS_OFF_MODE_POWER_OFF,
SYS_OFF_PRIO_FIRMWARE,
ti_sci_sys_off_handler,
info);
if (ret) {
dev_err(dev, "Failed to register sys_off_handler %pe\n",
ERR_PTR(ret));
goto out;
}
}
dev_info(dev, "ABI: %d.%d (firmware rev 0x%04x '%s')\n",
info->handle.version.abi_major, info->handle.version.abi_minor,
info->handle.version.firmware_revision,
@ -3952,7 +4047,13 @@ static int ti_sci_probe(struct platform_device *pdev)
list_add_tail(&info->node, &ti_sci_list);
mutex_unlock(&ti_sci_list_mutex);
return of_platform_populate(dev->of_node, NULL, NULL, dev);
ret = of_platform_populate(dev->of_node, NULL, NULL, dev);
if (ret) {
dev_err(dev, "platform_populate failed %pe\n", ERR_PTR(ret));
goto out;
}
return 0;
out:
if (!IS_ERR(info->chan_tx))
mbox_free_channel(info->chan_tx);

View File

@ -149,6 +149,7 @@ struct ti_sci_msg_req_reboot {
* MSG_FLAG_CAPS_LPM_PARTIAL_IO: Partial IO in LPM
* MSG_FLAG_CAPS_LPM_DM_MANAGED: LPM can be managed by DM
* MSG_FLAG_CAPS_LPM_ABORT: Abort entry to LPM
* MSG_FLAG_CAPS_IO_ISOLATION: IO Isolation support
*
* Response to a generic message with message type TI_SCI_MSG_QUERY_FW_CAPS
* providing currently available SOC/firmware capabilities. SoC that don't
@ -160,6 +161,7 @@ struct ti_sci_msg_resp_query_fw_caps {
#define MSG_FLAG_CAPS_LPM_PARTIAL_IO TI_SCI_MSG_FLAG(4)
#define MSG_FLAG_CAPS_LPM_DM_MANAGED TI_SCI_MSG_FLAG(5)
#define MSG_FLAG_CAPS_LPM_ABORT TI_SCI_MSG_FLAG(9)
#define MSG_FLAG_CAPS_IO_ISOLATION TI_SCI_MSG_FLAG(7)
#define MSG_MASK_CAPS_LPM GENMASK_ULL(4, 1)
u64 fw_caps;
} __packed;
@ -595,6 +597,11 @@ struct ti_sci_msg_resp_get_clock_freq {
struct ti_sci_msg_req_prepare_sleep {
struct ti_sci_msg_hdr hdr;
/*
* When sending prepare_sleep with MODE_PARTIAL_IO no response will be sent,
* no further steps are required.
*/
#define TISCI_MSG_VALUE_SLEEP_MODE_PARTIAL_IO 0x03
#define TISCI_MSG_VALUE_SLEEP_MODE_DM_MANAGED 0xfd
u8 mode;
u32 ctx_lo;

View File

@ -3,6 +3,7 @@
* Xilinx Zynq MPSoC Firmware layer for debugfs APIs
*
* Copyright (C) 2014-2018 Xilinx, Inc.
* Copyright (C) 2022 - 2025 Advanced Micro Devices, Inc.
*
* Michal Simek <michal.simek@amd.com>
* Davorin Mista <davorin.mista@aggios.com>
@ -38,6 +39,7 @@ static struct pm_api_info pm_api_list[] = {
PM_API(PM_RELEASE_NODE),
PM_API(PM_SET_REQUIREMENT),
PM_API(PM_GET_API_VERSION),
PM_API(PM_GET_NODE_STATUS),
PM_API(PM_REGISTER_NOTIFIER),
PM_API(PM_RESET_ASSERT),
PM_API(PM_RESET_GET_STATUS),
@ -167,6 +169,17 @@ static int process_api_request(u32 pm_id, u64 *pm_api_arg, u32 *pm_api_ret)
pm_api_arg[3] ? pm_api_arg[3] :
ZYNQMP_PM_REQUEST_ACK_BLOCKING);
break;
case PM_GET_NODE_STATUS:
ret = zynqmp_pm_get_node_status(pm_api_arg[0],
&pm_api_ret[0],
&pm_api_ret[1],
&pm_api_ret[2]);
if (!ret)
sprintf(debugfs_buf,
"GET_NODE_STATUS:\n\tNodeId: %llu\n\tStatus: %u\n\tRequirements: %u\n\tUsage: %u\n",
pm_api_arg[0], pm_api_ret[0],
pm_api_ret[1], pm_api_ret[2]);
break;
case PM_REGISTER_NOTIFIER:
ret = zynqmp_pm_register_notifier(pm_api_arg[0],
pm_api_arg[1] ?

View File

@ -3,7 +3,7 @@
* Xilinx Zynq MPSoC Firmware layer
*
* Copyright (C) 2014-2022 Xilinx, Inc.
* Copyright (C) 2022 - 2024, Advanced Micro Devices, Inc.
* Copyright (C) 2022 - 2025 Advanced Micro Devices, Inc.
*
* Michal Simek <michal.simek@amd.com>
* Davorin Mista <davorin.mista@aggios.com>
@ -72,6 +72,15 @@ struct pm_api_feature_data {
struct hlist_node hentry;
};
struct platform_fw_data {
/*
* Family code for platform.
*/
const u32 family_code;
};
static struct platform_fw_data *active_platform_fw_data;
static const struct mfd_cell firmware_devs[] = {
{
.name = "zynqmp_power_controller",
@ -464,8 +473,6 @@ int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 *ret_payload, u32 num_args, ...)
static u32 pm_api_version;
static u32 pm_tz_version;
static u32 pm_family_code;
static u32 pm_sub_family_code;
int zynqmp_pm_register_sgi(u32 sgi_num, u32 reset)
{
@ -532,32 +539,18 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_get_chipid);
/**
* zynqmp_pm_get_family_info() - Get family info of platform
* @family: Returned family code value
* @subfamily: Returned sub-family code value
*
* Return: Returns status, either success or error+reason
*/
int zynqmp_pm_get_family_info(u32 *family, u32 *subfamily)
int zynqmp_pm_get_family_info(u32 *family)
{
u32 ret_payload[PAYLOAD_ARG_CNT];
u32 idcode;
int ret;
if (!active_platform_fw_data)
return -ENODEV;
/* Check is family or sub-family code already received */
if (pm_family_code && pm_sub_family_code) {
*family = pm_family_code;
*subfamily = pm_sub_family_code;
return 0;
}
if (!family)
return -EINVAL;
ret = zynqmp_pm_invoke_fn(PM_GET_CHIPID, ret_payload, 0);
if (ret < 0)
return ret;
idcode = ret_payload[1];
pm_family_code = FIELD_GET(FAMILY_CODE_MASK, idcode);
pm_sub_family_code = FIELD_GET(SUB_FAMILY_CODE_MASK, idcode);
*family = pm_family_code;
*subfamily = pm_sub_family_code;
*family = active_platform_fw_data->family_code;
return 0;
}
@ -1238,8 +1231,13 @@ int zynqmp_pm_pinctrl_set_config(const u32 pin, const u32 param,
u32 value)
{
int ret;
u32 pm_family_code;
if (pm_family_code == ZYNQMP_FAMILY_CODE &&
ret = zynqmp_pm_get_family_info(&pm_family_code);
if (ret)
return ret;
if (pm_family_code == PM_ZYNQMP_FAMILY_CODE &&
param == PM_PINCTRL_CONFIG_TRI_STATE) {
ret = zynqmp_pm_feature(PM_PINCTRL_CONFIG_PARAM_SET);
if (ret < PM_PINCTRL_PARAM_SET_VERSION) {
@ -1413,6 +1411,45 @@ int zynqmp_pm_set_tcm_config(u32 node_id, enum rpu_tcm_comb tcm_mode)
}
EXPORT_SYMBOL_GPL(zynqmp_pm_set_tcm_config);
/**
* zynqmp_pm_get_node_status - PM call to request a node's current power state
* @node: ID of the component or sub-system in question
* @status: Current operating state of the requested node
* @requirements: Current requirements asserted on the node,
* used for slave nodes only.
* @usage: Usage information, used for slave nodes only:
* PM_USAGE_NO_MASTER - No master is currently using
* the node
* PM_USAGE_CURRENT_MASTER - Only requesting master is
* currently using the node
* PM_USAGE_OTHER_MASTER - Only other masters are
* currently using the node
* PM_USAGE_BOTH_MASTERS - Both the current and at least
* one other master is currently
* using the node
*
* Return: Returns status, either success or error+reason
*/
int zynqmp_pm_get_node_status(const u32 node, u32 *const status,
u32 *const requirements, u32 *const usage)
{
u32 ret_payload[PAYLOAD_ARG_CNT];
int ret;
if (!status || !requirements || !usage)
return -EINVAL;
ret = zynqmp_pm_invoke_fn(PM_GET_NODE_STATUS, ret_payload, 1, node);
if (ret_payload[0] == XST_PM_SUCCESS) {
*status = ret_payload[1];
*requirements = ret_payload[2];
*usage = ret_payload[3];
}
return ret;
}
EXPORT_SYMBOL_GPL(zynqmp_pm_get_node_status);
/**
* zynqmp_pm_force_pwrdwn - PM call to request for another PU or subsystem to
* be powered down forcefully
@ -2007,12 +2044,18 @@ static int zynqmp_firmware_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct zynqmp_devinfo *devinfo;
u32 pm_family_code;
int ret;
ret = get_set_conduit_method(dev->of_node);
if (ret)
return ret;
/* Get platform-specific firmware data from device tree match */
active_platform_fw_data = (struct platform_fw_data *)device_get_match_data(dev);
if (!active_platform_fw_data)
return -EINVAL;
/* Get SiP SVC version number */
ret = zynqmp_pm_get_sip_svc_version(&sip_svc_version);
if (ret)
@ -2045,8 +2088,8 @@ static int zynqmp_firmware_probe(struct platform_device *pdev)
pr_info("%s Platform Management API v%d.%d\n", __func__,
pm_api_version >> 16, pm_api_version & 0xFFFF);
/* Get the Family code and sub family code of platform */
ret = zynqmp_pm_get_family_info(&pm_family_code, &pm_sub_family_code);
/* Get the Family code of platform */
ret = zynqmp_pm_get_family_info(&pm_family_code);
if (ret < 0)
return ret;
@ -2073,7 +2116,7 @@ static int zynqmp_firmware_probe(struct platform_device *pdev)
zynqmp_pm_api_debugfs_init();
if (pm_family_code == VERSAL_FAMILY_CODE) {
if (pm_family_code != PM_ZYNQMP_FAMILY_CODE) {
em_dev = platform_device_register_data(&pdev->dev, "xlnx_event_manager",
-1, NULL, 0);
if (IS_ERR(em_dev))
@ -2113,9 +2156,22 @@ static void zynqmp_firmware_sync_state(struct device *dev)
dev_warn(dev, "failed to release power management to firmware\n");
}
static const struct platform_fw_data platform_fw_data_versal = {
.family_code = PM_VERSAL_FAMILY_CODE,
};
static const struct platform_fw_data platform_fw_data_versal_net = {
.family_code = PM_VERSAL_NET_FAMILY_CODE,
};
static const struct platform_fw_data platform_fw_data_zynqmp = {
.family_code = PM_ZYNQMP_FAMILY_CODE,
};
static const struct of_device_id zynqmp_firmware_of_match[] = {
{.compatible = "xlnx,zynqmp-firmware"},
{.compatible = "xlnx,versal-firmware"},
{.compatible = "xlnx,zynqmp-firmware", .data = &platform_fw_data_zynqmp},
{.compatible = "xlnx,versal-firmware", .data = &platform_fw_data_versal},
{.compatible = "xlnx,versal-net-firmware", .data = &platform_fw_data_versal_net},
{},
};
MODULE_DEVICE_TABLE(of, zynqmp_firmware_of_match);

View File

@ -667,7 +667,7 @@ static const struct dev_pm_ops mxc_gpio_dev_pm_ops = {
RUNTIME_PM_OPS(mxc_gpio_runtime_suspend, mxc_gpio_runtime_resume, NULL)
};
static int mxc_gpio_syscore_suspend(void)
static int mxc_gpio_syscore_suspend(void *data)
{
struct mxc_gpio_port *port;
int ret;
@ -684,7 +684,7 @@ static int mxc_gpio_syscore_suspend(void)
return 0;
}
static void mxc_gpio_syscore_resume(void)
static void mxc_gpio_syscore_resume(void *data)
{
struct mxc_gpio_port *port;
int ret;
@ -701,11 +701,15 @@ static void mxc_gpio_syscore_resume(void)
}
}
static struct syscore_ops mxc_gpio_syscore_ops = {
static const struct syscore_ops mxc_gpio_syscore_ops = {
.suspend = mxc_gpio_syscore_suspend,
.resume = mxc_gpio_syscore_resume,
};
static struct syscore mxc_gpio_syscore = {
.ops = &mxc_gpio_syscore_ops,
};
static struct platform_driver mxc_gpio_driver = {
.driver = {
.name = "gpio-mxc",
@ -718,7 +722,7 @@ static struct platform_driver mxc_gpio_driver = {
static int __init gpio_mxc_init(void)
{
register_syscore_ops(&mxc_gpio_syscore_ops);
register_syscore(&mxc_gpio_syscore);
return platform_driver_register(&mxc_gpio_driver);
}

View File

@ -747,7 +747,7 @@ static int __init pxa_gpio_dt_init(void)
device_initcall(pxa_gpio_dt_init);
#ifdef CONFIG_PM
static int pxa_gpio_suspend(void)
static int pxa_gpio_suspend(void *data)
{
struct pxa_gpio_chip *pchip = pxa_gpio_chip;
struct pxa_gpio_bank *c;
@ -768,7 +768,7 @@ static int pxa_gpio_suspend(void)
return 0;
}
static void pxa_gpio_resume(void)
static void pxa_gpio_resume(void *data)
{
struct pxa_gpio_chip *pchip = pxa_gpio_chip;
struct pxa_gpio_bank *c;
@ -792,14 +792,18 @@ static void pxa_gpio_resume(void)
#define pxa_gpio_resume NULL
#endif
static struct syscore_ops pxa_gpio_syscore_ops = {
static const struct syscore_ops pxa_gpio_syscore_ops = {
.suspend = pxa_gpio_suspend,
.resume = pxa_gpio_resume,
};
static struct syscore pxa_gpio_syscore = {
.ops = &pxa_gpio_syscore_ops,
};
static int __init pxa_gpio_sysinit(void)
{
register_syscore_ops(&pxa_gpio_syscore_ops);
register_syscore(&pxa_gpio_syscore);
return 0;
}
postcore_initcall(pxa_gpio_sysinit);

View File

@ -256,7 +256,7 @@ static void sa1100_gpio_handler(struct irq_desc *desc)
} while (mask);
}
static int sa1100_gpio_suspend(void)
static int sa1100_gpio_suspend(void *data)
{
struct sa1100_gpio_chip *sgc = &sa1100_gpio_chip;
@ -275,19 +275,23 @@ static int sa1100_gpio_suspend(void)
return 0;
}
static void sa1100_gpio_resume(void)
static void sa1100_gpio_resume(void *data)
{
sa1100_update_edge_regs(&sa1100_gpio_chip);
}
static struct syscore_ops sa1100_gpio_syscore_ops = {
static const struct syscore_ops sa1100_gpio_syscore_ops = {
.suspend = sa1100_gpio_suspend,
.resume = sa1100_gpio_resume,
};
static struct syscore sa1100_gpio_syscore = {
.ops = &sa1100_gpio_syscore_ops,
};
static int __init sa1100_gpio_init_devicefs(void)
{
register_syscore_ops(&sa1100_gpio_syscore_ops);
register_syscore(&sa1100_gpio_syscore);
return 0;
}

View File

@ -2801,7 +2801,7 @@ static void hv_crash_handler(struct pt_regs *regs)
hv_synic_disable_regs(cpu);
};
static int hv_synic_suspend(void)
static int hv_synic_suspend(void *data)
{
/*
* When we reach here, all the non-boot CPUs have been offlined.
@ -2828,7 +2828,7 @@ static int hv_synic_suspend(void)
return 0;
}
static void hv_synic_resume(void)
static void hv_synic_resume(void *data)
{
hv_synic_enable_regs(0);
@ -2840,11 +2840,15 @@ static void hv_synic_resume(void)
}
/* The callbacks run only on CPU0, with irqs_disabled. */
static struct syscore_ops hv_synic_syscore_ops = {
static const struct syscore_ops hv_synic_syscore_ops = {
.suspend = hv_synic_suspend,
.resume = hv_synic_resume,
};
static struct syscore hv_synic_syscore = {
.ops = &hv_synic_syscore_ops,
};
static int __init hv_acpi_init(void)
{
int ret;
@ -2887,7 +2891,7 @@ static int __init hv_acpi_init(void)
hv_setup_kexec_handler(hv_kexec_handler);
hv_setup_crash_handler(hv_crash_handler);
register_syscore_ops(&hv_synic_syscore_ops);
register_syscore(&hv_synic_syscore);
return 0;
@ -2901,7 +2905,7 @@ static void __exit vmbus_exit(void)
{
int cpu;
unregister_syscore_ops(&hv_synic_syscore_ops);
unregister_syscore(&hv_synic_syscore);
hv_remove_kexec_handler();
hv_remove_crash_handler();

View File

@ -3033,7 +3033,7 @@ static void disable_iommus(void)
* disable suspend until real resume implemented
*/
static void amd_iommu_resume(void)
static void amd_iommu_resume(void *data)
{
struct amd_iommu *iommu;
@ -3047,7 +3047,7 @@ static void amd_iommu_resume(void)
amd_iommu_enable_interrupts();
}
static int amd_iommu_suspend(void)
static int amd_iommu_suspend(void *data)
{
/* disable IOMMUs to go out of the way for BIOS */
disable_iommus();
@ -3055,11 +3055,15 @@ static int amd_iommu_suspend(void)
return 0;
}
static struct syscore_ops amd_iommu_syscore_ops = {
static const struct syscore_ops amd_iommu_syscore_ops = {
.suspend = amd_iommu_suspend,
.resume = amd_iommu_resume,
};
static struct syscore amd_iommu_syscore = {
.ops = &amd_iommu_syscore_ops,
};
static void __init free_iommu_resources(void)
{
free_iommu_all();
@ -3404,7 +3408,7 @@ static int __init state_next(void)
init_state = IOMMU_ENABLED;
break;
case IOMMU_ENABLED:
register_syscore_ops(&amd_iommu_syscore_ops);
register_syscore(&amd_iommu_syscore);
iommu_snp_enable();
ret = amd_iommu_init_pci();
init_state = ret ? IOMMU_INIT_ERROR : IOMMU_PCI_INIT;
@ -3507,12 +3511,12 @@ int __init amd_iommu_enable(void)
void amd_iommu_disable(void)
{
amd_iommu_suspend();
amd_iommu_suspend(NULL);
}
int amd_iommu_reenable(int mode)
{
amd_iommu_resume();
amd_iommu_resume(NULL);
return 0;
}

View File

@ -1825,7 +1825,7 @@ static void iommu_flush_all(void)
}
}
static int iommu_suspend(void)
static int iommu_suspend(void *data)
{
struct dmar_drhd_unit *drhd;
struct intel_iommu *iommu = NULL;
@ -1852,7 +1852,7 @@ static int iommu_suspend(void)
return 0;
}
static void iommu_resume(void)
static void iommu_resume(void *data)
{
struct dmar_drhd_unit *drhd;
struct intel_iommu *iommu = NULL;
@ -1883,14 +1883,18 @@ static void iommu_resume(void)
}
}
static struct syscore_ops iommu_syscore_ops = {
static const struct syscore_ops iommu_syscore_ops = {
.resume = iommu_resume,
.suspend = iommu_suspend,
};
static struct syscore iommu_syscore = {
.ops = &iommu_syscore_ops,
};
static void __init init_iommu_pm_ops(void)
{
register_syscore_ops(&iommu_syscore_ops);
register_syscore(&iommu_syscore);
}
#else

View File

@ -200,12 +200,13 @@ static void __init combiner_init(void __iomem *combiner_base,
/**
* combiner_suspend - save interrupt combiner state before suspend
* @data: syscore context
*
* Save the interrupt enable set register for all combiner groups since
* the state is lost when the system enters into a sleep state.
*
*/
static int combiner_suspend(void)
static int combiner_suspend(void *data)
{
int i;
@ -218,12 +219,13 @@ static int combiner_suspend(void)
/**
* combiner_resume - restore interrupt combiner state after resume
* @data: syscore context
*
* Restore the interrupt enable set register for all combiner groups since
* the state is lost when the system enters into a sleep state on suspend.
*
*/
static void combiner_resume(void)
static void combiner_resume(void *data)
{
int i;
@ -240,11 +242,15 @@ static void combiner_resume(void)
#define combiner_resume NULL
#endif
static struct syscore_ops combiner_syscore_ops = {
static const struct syscore_ops combiner_syscore_ops = {
.suspend = combiner_suspend,
.resume = combiner_resume,
};
static struct syscore combiner_syscore = {
.ops = &combiner_syscore_ops,
};
static int __init combiner_of_init(struct device_node *np,
struct device_node *parent)
{
@ -264,7 +270,7 @@ static int __init combiner_of_init(struct device_node *np,
combiner_init(combiner_base, np);
register_syscore_ops(&combiner_syscore_ops);
register_syscore(&combiner_syscore);
return 0;
}

View File

@ -726,7 +726,7 @@ static void __exception_irq_entry mpic_handle_irq(struct pt_regs *regs)
} while (1);
}
static int mpic_suspend(void)
static int mpic_suspend(void *data)
{
struct mpic *mpic = mpic_data;
@ -735,7 +735,7 @@ static int mpic_suspend(void)
return 0;
}
static void mpic_resume(void)
static void mpic_resume(void *data)
{
struct mpic *mpic = mpic_data;
bool src0, src1;
@ -788,11 +788,15 @@ static void mpic_resume(void)
mpic_ipi_resume(mpic);
}
static struct syscore_ops mpic_syscore_ops = {
static const struct syscore_ops mpic_syscore_ops = {
.suspend = mpic_suspend,
.resume = mpic_resume,
};
static struct syscore mpic_syscore = {
.ops = &mpic_syscore_ops,
};
static int __init mpic_map_region(struct device_node *np, int index,
void __iomem **base, phys_addr_t *phys_base)
{
@ -905,7 +909,7 @@ static int __init mpic_of_init(struct device_node *node, struct device_node *par
mpic_handle_cascade_irq, mpic);
}
register_syscore_ops(&mpic_syscore_ops);
register_syscore(&mpic_syscore);
return 0;
}

View File

@ -285,7 +285,7 @@ static int bcm7038_l1_init_one(struct device_node *dn, unsigned int idx,
static LIST_HEAD(bcm7038_l1_intcs_list);
static DEFINE_RAW_SPINLOCK(bcm7038_l1_intcs_lock);
static int bcm7038_l1_suspend(void)
static int bcm7038_l1_suspend(void *data)
{
struct bcm7038_l1_chip *intc;
int boot_cpu, word;
@ -311,7 +311,7 @@ static int bcm7038_l1_suspend(void)
return 0;
}
static void bcm7038_l1_resume(void)
static void bcm7038_l1_resume(void *data)
{
struct bcm7038_l1_chip *intc;
int boot_cpu, word;
@ -332,11 +332,15 @@ static void bcm7038_l1_resume(void)
}
}
static struct syscore_ops bcm7038_l1_syscore_ops = {
static const struct syscore_ops bcm7038_l1_syscore_ops = {
.suspend = bcm7038_l1_suspend,
.resume = bcm7038_l1_resume,
};
static struct syscore bcm7038_l1_syscore = {
.ops = &bcm7038_l1_syscore_ops,
};
static int bcm7038_l1_set_wake(struct irq_data *d, unsigned int on)
{
struct bcm7038_l1_chip *intc = irq_data_get_irq_chip_data(d);
@ -424,7 +428,7 @@ static int bcm7038_l1_probe(struct platform_device *pdev, struct device_node *pa
raw_spin_unlock(&bcm7038_l1_intcs_lock);
if (list_is_singular(&bcm7038_l1_intcs_list))
register_syscore_ops(&bcm7038_l1_syscore_ops);
register_syscore(&bcm7038_l1_syscore);
#endif
pr_info("registered BCM7038 L1 intc (%pOF, IRQs: %d)\n",

Some files were not shown because too many files have changed in this diff Show More