lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1552474956-25513-2-git-send-email-spujar@nvidia.com>
Date:   Wed, 13 Mar 2019 16:32:33 +0530
From:   Sameer Pujar <spujar@...dia.com>
To:     <tglx@...utronix.de>, <jason@...edaemon.net>,
        <marc.zyngier@....com>, <will.deacon@....com>,
        <catalin.marinas@....com>, <heiko@...ech.de>,
        <horms+renesas@...ge.net.au>, <maxime.ripard@...tlin.com>,
        <andy.gross@...aro.org>, <olof@...om.net>,
        <bjorn.andersson@...aro.org>, <jagan@...rulasolutions.com>,
        <enric.balletbo@...labora.com>, <stefan.wahren@...e.com>,
        <ezequiel@...labora.com>, <marc.w.gonzalez@...e.fr>,
        <christoffer.dall@....com>, <drjones@...hat.com>,
        <julien.thierry@....com>
CC:     <treding@...dia.com>, <jonathanh@...dia.com>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>, Sameer Pujar <spujar@...dia.com>
Subject: [PATCH 2/5] irqchip/gic: allow gic-pm driver to be used as module

In order to use irq-gic-pm driver as module following changes are made.

1. config ARM_GIC_PM is changed to tristate to allow it to be built as
   module.

2. following functions are exported from irq-gic driver.
   * gic_of_init_child()
   * gic_cpu_save()
   * gic_dist_save()
   * gic_cpu_restore()
   * gic_dist_restore()

3. MODULE_LICENSE is added to make sure driver load is successful, else
   it fails to resolve required symbols. The 'builtin_platform_driver' is
   replaced with 'module_platform_driver' to allow driver removal, else it
   complains that device or resource is busy.

Signed-off-by: Sameer Pujar <spujar@...dia.com>
---
 drivers/irqchip/Kconfig      | 2 +-
 drivers/irqchip/irq-gic-pm.c | 3 ++-
 drivers/irqchip/irq-gic.c    | 6 ++++++
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig
index 5438abb..8b5ce12 100644
--- a/drivers/irqchip/Kconfig
+++ b/drivers/irqchip/Kconfig
@@ -12,7 +12,7 @@ config ARM_GIC
 	select GENERIC_IRQ_EFFECTIVE_AFF_MASK
 
 config ARM_GIC_PM
-	bool
+	tristate "ARM GIC with PM support"
 	depends on PM
 	select ARM_GIC
 	select PM_CLK
diff --git a/drivers/irqchip/irq-gic-pm.c b/drivers/irqchip/irq-gic-pm.c
index 56a785f..cde9714 100644
--- a/drivers/irqchip/irq-gic-pm.c
+++ b/drivers/irqchip/irq-gic-pm.c
@@ -195,4 +195,5 @@ static struct platform_driver gic_driver = {
 	}
 };
 
-builtin_platform_driver(gic_driver);
+module_platform_driver(gic_driver);
+MODULE_LICENSE("GPL v2");
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index f88018b..b3ad7ed 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -600,6 +600,7 @@ void gic_dist_save(struct gic_chip_data *gic)
 		gic->saved_spi_active[i] =
 			readl_relaxed(dist_base + GIC_DIST_ACTIVE_SET + i * 4);
 }
+EXPORT_SYMBOL_GPL(gic_dist_save);
 
 /*
  * Restores the GIC distributor registers during resume or when coming out of
@@ -653,6 +654,7 @@ void gic_dist_restore(struct gic_chip_data *gic)
 
 	writel_relaxed(GICD_ENABLE, dist_base + GIC_DIST_CTRL);
 }
+EXPORT_SYMBOL_GPL(gic_dist_restore);
 
 void gic_cpu_save(struct gic_chip_data *gic)
 {
@@ -683,6 +685,7 @@ void gic_cpu_save(struct gic_chip_data *gic)
 		ptr[i] = readl_relaxed(dist_base + GIC_DIST_CONFIG + i * 4);
 
 }
+EXPORT_SYMBOL_GPL(gic_cpu_save);
 
 void gic_cpu_restore(struct gic_chip_data *gic)
 {
@@ -725,6 +728,7 @@ void gic_cpu_restore(struct gic_chip_data *gic)
 	writel_relaxed(GICC_INT_PRI_THRESHOLD, cpu_base + GIC_CPU_PRIMASK);
 	gic_cpu_if_up(gic);
 }
+EXPORT_SYMBOL_GPL(gic_cpu_restore);
 
 static int gic_notifier(struct notifier_block *self, unsigned long cmd,	void *v)
 {
@@ -1410,6 +1414,7 @@ int gic_of_init_child(struct device *dev, struct gic_chip_data **gic, int irq)
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(gic_of_init_child);
 
 static void __init gic_of_setup_kvm_info(struct device_node *node)
 {
@@ -1496,6 +1501,7 @@ int gic_of_init_child(struct device *dev, struct gic_chip_data **gic, int irq)
 {
 	return -ENOTSUPP;
 }
+EXPORT_SYMBOL_GPL(gic_of_init_child);
 #endif
 
 #ifdef CONFIG_ACPI
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ