aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorEmil Medve <Emilian.Medve@Freescale.com>2015-03-25 01:28:48 -0400
committerJoerg Roedel <jroedel@suse.de>2015-08-18 05:30:46 -0400
commit57fb907da89977640ef183556a621336c1348fa0 (patch)
treec7d0eb1305ac72cca0f8c3d80d014b9027557e70 /drivers/iommu
parentbc465aa9d045feb0e13b4a8f32cc33c1943f62d6 (diff)
iommu/fsl: Really fix init section(s) content
'0f1fb99 iommu/fsl: Fix section mismatch' was intended to address the modpost warning and the potential crash. Crash which is actually easy to trigger with a 'unbind' followed by a 'bind' sequence. The fix is wrong as fsl_of_pamu_driver.driver gets added by bus_add_driver() to a couple of klist(s) which become invalid/corrupted as soon as the init sections are freed. Depending on when/how the init sections storage is reused various/random errors and crashes will happen 'cd70d46 iommu/fsl: Various cleanups' contains annotations that go further down the wrong path laid by '0f1fb99 iommu/fsl: Fix section mismatch' Now remove all the incorrect annotations from the above mentioned patches (not exactly a revert) and those previously existing in the code, This fixes the modpost warning(s), the unbind/bind sequence crashes and the random errors/crashes Fixes: 0f1fb99b62ce ("iommu/fsl: Fix section mismatch") Fixes: cd70d4659ff3 ("iommu/fsl: Various cleanups") Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com> Acked-by: Varun Sethi <Varun.Sethi@freescale.com> Cc: stable@vger.kernel.org Tested-by: Madalin Bucur <Madalin.Bucur@freescale.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/fsl_pamu.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
index abeedc9a78c2..2570f2a25dc4 100644
--- a/drivers/iommu/fsl_pamu.c
+++ b/drivers/iommu/fsl_pamu.c
@@ -41,7 +41,6 @@ struct pamu_isr_data {
41 41
42static struct paace *ppaact; 42static struct paace *ppaact;
43static struct paace *spaact; 43static struct paace *spaact;
44static struct ome *omt __initdata;
45 44
46/* 45/*
47 * Table for matching compatible strings, for device tree 46 * Table for matching compatible strings, for device tree
@@ -50,7 +49,7 @@ static struct ome *omt __initdata;
50 * SOCs. For the older SOCs "fsl,qoriq-device-config-1.0" 49 * SOCs. For the older SOCs "fsl,qoriq-device-config-1.0"
51 * string would be used. 50 * string would be used.
52 */ 51 */
53static const struct of_device_id guts_device_ids[] __initconst = { 52static const struct of_device_id guts_device_ids[] = {
54 { .compatible = "fsl,qoriq-device-config-1.0", }, 53 { .compatible = "fsl,qoriq-device-config-1.0", },
55 { .compatible = "fsl,qoriq-device-config-2.0", }, 54 { .compatible = "fsl,qoriq-device-config-2.0", },
56 {} 55 {}
@@ -599,7 +598,7 @@ found_cpu_node:
599 * Memory accesses to QMAN and BMAN private memory need not be coherent, so 598 * Memory accesses to QMAN and BMAN private memory need not be coherent, so
600 * clear the PAACE entry coherency attribute for them. 599 * clear the PAACE entry coherency attribute for them.
601 */ 600 */
602static void __init setup_qbman_paace(struct paace *ppaace, int paace_type) 601static void setup_qbman_paace(struct paace *ppaace, int paace_type)
603{ 602{
604 switch (paace_type) { 603 switch (paace_type) {
605 case QMAN_PAACE: 604 case QMAN_PAACE:
@@ -629,7 +628,7 @@ static void __init setup_qbman_paace(struct paace *ppaace, int paace_type)
629 * this table to translate device transaction to appropriate corenet 628 * this table to translate device transaction to appropriate corenet
630 * transaction. 629 * transaction.
631 */ 630 */
632static void __init setup_omt(struct ome *omt) 631static void setup_omt(struct ome *omt)
633{ 632{
634 struct ome *ome; 633 struct ome *ome;
635 634
@@ -666,7 +665,7 @@ static void __init setup_omt(struct ome *omt)
666 * Get the maximum number of PAACT table entries 665 * Get the maximum number of PAACT table entries
667 * and subwindows supported by PAMU 666 * and subwindows supported by PAMU
668 */ 667 */
669static void __init get_pamu_cap_values(unsigned long pamu_reg_base) 668static void get_pamu_cap_values(unsigned long pamu_reg_base)
670{ 669{
671 u32 pc_val; 670 u32 pc_val;
672 671
@@ -676,9 +675,9 @@ static void __init get_pamu_cap_values(unsigned long pamu_reg_base)
676} 675}
677 676
678/* Setup PAMU registers pointing to PAACT, SPAACT and OMT */ 677/* Setup PAMU registers pointing to PAACT, SPAACT and OMT */
679static int __init setup_one_pamu(unsigned long pamu_reg_base, unsigned long pamu_reg_size, 678static int setup_one_pamu(unsigned long pamu_reg_base, unsigned long pamu_reg_size,
680 phys_addr_t ppaact_phys, phys_addr_t spaact_phys, 679 phys_addr_t ppaact_phys, phys_addr_t spaact_phys,
681 phys_addr_t omt_phys) 680 phys_addr_t omt_phys)
682{ 681{
683 u32 *pc; 682 u32 *pc;
684 struct pamu_mmap_regs *pamu_regs; 683 struct pamu_mmap_regs *pamu_regs;
@@ -720,7 +719,7 @@ static int __init setup_one_pamu(unsigned long pamu_reg_base, unsigned long pamu
720} 719}
721 720
722/* Enable all device LIODNS */ 721/* Enable all device LIODNS */
723static void __init setup_liodns(void) 722static void setup_liodns(void)
724{ 723{
725 int i, len; 724 int i, len;
726 struct paace *ppaace; 725 struct paace *ppaace;
@@ -846,7 +845,7 @@ struct ccsr_law {
846/* 845/*
847 * Create a coherence subdomain for a given memory block. 846 * Create a coherence subdomain for a given memory block.
848 */ 847 */
849static int __init create_csd(phys_addr_t phys, size_t size, u32 csd_port_id) 848static int create_csd(phys_addr_t phys, size_t size, u32 csd_port_id)
850{ 849{
851 struct device_node *np; 850 struct device_node *np;
852 const __be32 *iprop; 851 const __be32 *iprop;
@@ -988,7 +987,7 @@ error:
988static const struct { 987static const struct {
989 u32 svr; 988 u32 svr;
990 u32 port_id; 989 u32 port_id;
991} port_id_map[] __initconst = { 990} port_id_map[] = {
992 {(SVR_P2040 << 8) | 0x10, 0xFF000000}, /* P2040 1.0 */ 991 {(SVR_P2040 << 8) | 0x10, 0xFF000000}, /* P2040 1.0 */
993 {(SVR_P2040 << 8) | 0x11, 0xFF000000}, /* P2040 1.1 */ 992 {(SVR_P2040 << 8) | 0x11, 0xFF000000}, /* P2040 1.1 */
994 {(SVR_P2041 << 8) | 0x10, 0xFF000000}, /* P2041 1.0 */ 993 {(SVR_P2041 << 8) | 0x10, 0xFF000000}, /* P2041 1.0 */
@@ -1006,7 +1005,7 @@ static const struct {
1006 1005
1007#define SVR_SECURITY 0x80000 /* The Security (E) bit */ 1006#define SVR_SECURITY 0x80000 /* The Security (E) bit */
1008 1007
1009static int __init fsl_pamu_probe(struct platform_device *pdev) 1008static int fsl_pamu_probe(struct platform_device *pdev)
1010{ 1009{
1011 struct device *dev = &pdev->dev; 1010 struct device *dev = &pdev->dev;
1012 void __iomem *pamu_regs = NULL; 1011 void __iomem *pamu_regs = NULL;
@@ -1022,6 +1021,7 @@ static int __init fsl_pamu_probe(struct platform_device *pdev)
1022 int irq; 1021 int irq;
1023 phys_addr_t ppaact_phys; 1022 phys_addr_t ppaact_phys;
1024 phys_addr_t spaact_phys; 1023 phys_addr_t spaact_phys;
1024 struct ome *omt;
1025 phys_addr_t omt_phys; 1025 phys_addr_t omt_phys;
1026 size_t mem_size = 0; 1026 size_t mem_size = 0;
1027 unsigned int order = 0; 1027 unsigned int order = 0;
@@ -1200,7 +1200,7 @@ error:
1200 return ret; 1200 return ret;
1201} 1201}
1202 1202
1203static struct platform_driver fsl_of_pamu_driver __initdata = { 1203static struct platform_driver fsl_of_pamu_driver = {
1204 .driver = { 1204 .driver = {
1205 .name = "fsl-of-pamu", 1205 .name = "fsl-of-pamu",
1206 }, 1206 },