* [PATCH v2] iommu/fsl: Really fix init section(s) content
@ 2015-03-25 5:28 Emil Medve
[not found] ` <1427261328-23798-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-08-18 9:32 ` Joerg Roedel
0 siblings, 2 replies; 5+ messages in thread
From: Emil Medve @ 2015-03-25 5:28 UTC (permalink / raw)
To: iommu, joro; +Cc: Emil Medve, stable
'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
---
drivers/iommu/fsl_pamu.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
index abeedc9..2570f2a 100644
--- a/drivers/iommu/fsl_pamu.c
+++ b/drivers/iommu/fsl_pamu.c
@@ -41,7 +41,6 @@ struct pamu_isr_data {
static struct paace *ppaact;
static struct paace *spaact;
-static struct ome *omt __initdata;
/*
* Table for matching compatible strings, for device tree
@@ -50,7 +49,7 @@ static struct ome *omt __initdata;
* SOCs. For the older SOCs "fsl,qoriq-device-config-1.0"
* string would be used.
*/
-static const struct of_device_id guts_device_ids[] __initconst = {
+static const struct of_device_id guts_device_ids[] = {
{ .compatible = "fsl,qoriq-device-config-1.0", },
{ .compatible = "fsl,qoriq-device-config-2.0", },
{}
@@ -599,7 +598,7 @@ found_cpu_node:
* Memory accesses to QMAN and BMAN private memory need not be coherent, so
* clear the PAACE entry coherency attribute for them.
*/
-static void __init setup_qbman_paace(struct paace *ppaace, int paace_type)
+static void setup_qbman_paace(struct paace *ppaace, int paace_type)
{
switch (paace_type) {
case QMAN_PAACE:
@@ -629,7 +628,7 @@ static void __init setup_qbman_paace(struct paace *ppaace, int paace_type)
* this table to translate device transaction to appropriate corenet
* transaction.
*/
-static void __init setup_omt(struct ome *omt)
+static void setup_omt(struct ome *omt)
{
struct ome *ome;
@@ -666,7 +665,7 @@ static void __init setup_omt(struct ome *omt)
* Get the maximum number of PAACT table entries
* and subwindows supported by PAMU
*/
-static void __init get_pamu_cap_values(unsigned long pamu_reg_base)
+static void get_pamu_cap_values(unsigned long pamu_reg_base)
{
u32 pc_val;
@@ -676,9 +675,9 @@ static void __init get_pamu_cap_values(unsigned long pamu_reg_base)
}
/* Setup PAMU registers pointing to PAACT, SPAACT and OMT */
-static int __init setup_one_pamu(unsigned long pamu_reg_base, unsigned long pamu_reg_size,
- phys_addr_t ppaact_phys, phys_addr_t spaact_phys,
- phys_addr_t omt_phys)
+static int setup_one_pamu(unsigned long pamu_reg_base, unsigned long pamu_reg_size,
+ phys_addr_t ppaact_phys, phys_addr_t spaact_phys,
+ phys_addr_t omt_phys)
{
u32 *pc;
struct pamu_mmap_regs *pamu_regs;
@@ -720,7 +719,7 @@ static int __init setup_one_pamu(unsigned long pamu_reg_base, unsigned long pamu
}
/* Enable all device LIODNS */
-static void __init setup_liodns(void)
+static void setup_liodns(void)
{
int i, len;
struct paace *ppaace;
@@ -846,7 +845,7 @@ struct ccsr_law {
/*
* Create a coherence subdomain for a given memory block.
*/
-static int __init create_csd(phys_addr_t phys, size_t size, u32 csd_port_id)
+static int create_csd(phys_addr_t phys, size_t size, u32 csd_port_id)
{
struct device_node *np;
const __be32 *iprop;
@@ -988,7 +987,7 @@ error:
static const struct {
u32 svr;
u32 port_id;
-} port_id_map[] __initconst = {
+} port_id_map[] = {
{(SVR_P2040 << 8) | 0x10, 0xFF000000}, /* P2040 1.0 */
{(SVR_P2040 << 8) | 0x11, 0xFF000000}, /* P2040 1.1 */
{(SVR_P2041 << 8) | 0x10, 0xFF000000}, /* P2041 1.0 */
@@ -1006,7 +1005,7 @@ static const struct {
#define SVR_SECURITY 0x80000 /* The Security (E) bit */
-static int __init fsl_pamu_probe(struct platform_device *pdev)
+static int fsl_pamu_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
void __iomem *pamu_regs = NULL;
@@ -1022,6 +1021,7 @@ static int __init fsl_pamu_probe(struct platform_device *pdev)
int irq;
phys_addr_t ppaact_phys;
phys_addr_t spaact_phys;
+ struct ome *omt;
phys_addr_t omt_phys;
size_t mem_size = 0;
unsigned int order = 0;
@@ -1200,7 +1200,7 @@ error:
return ret;
}
-static struct platform_driver fsl_of_pamu_driver __initdata = {
+static struct platform_driver fsl_of_pamu_driver = {
.driver = {
.name = "fsl-of-pamu",
},
--
2.3.3
^ permalink raw reply related [flat|nested] 5+ messages in thread[parent not found: <1427261328-23798-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>]
* RE: [PATCH v2] iommu/fsl: Really fix init section(s) content [not found] ` <1427261328-23798-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org> @ 2015-08-03 12:29 ` Varun Sethi 2015-08-17 14:58 ` Madalin-Cristian Bucur 0 siblings, 1 reply; 5+ messages in thread From: Varun Sethi @ 2015-08-03 12:29 UTC (permalink / raw) To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org Cc: Medve Emilian-EMMEDVE1, stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Madalin-Cristian Bucur Hi Joerg, This patch doesn't seem to be applied to the PAMU driver. Regards Varun > -----Original Message----- > From: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org [mailto:iommu- > bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org] On Behalf Of Emil Medve > Sent: Wednesday, March 25, 2015 10:59 AM > To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org > Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; Medve Emilian-EMMEDVE1 > Subject: [PATCH v2] 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-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org> > Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org> > Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > --- > drivers/iommu/fsl_pamu.c | 26 +++++++++++++------------- > 1 file changed, 13 insertions(+), 13 deletions(-) > > diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index > abeedc9..2570f2a 100644 > --- a/drivers/iommu/fsl_pamu.c > +++ b/drivers/iommu/fsl_pamu.c > @@ -41,7 +41,6 @@ struct pamu_isr_data { > > static struct paace *ppaact; > static struct paace *spaact; > -static struct ome *omt __initdata; > > /* > * Table for matching compatible strings, for device tree @@ -50,7 +49,7 @@ > static struct ome *omt __initdata; > * SOCs. For the older SOCs "fsl,qoriq-device-config-1.0" > * string would be used. > */ > -static const struct of_device_id guts_device_ids[] __initconst = { > +static const struct of_device_id guts_device_ids[] = { > { .compatible = "fsl,qoriq-device-config-1.0", }, > { .compatible = "fsl,qoriq-device-config-2.0", }, > {} > @@ -599,7 +598,7 @@ found_cpu_node: > * Memory accesses to QMAN and BMAN private memory need not be > coherent, so > * clear the PAACE entry coherency attribute for them. > */ > -static void __init setup_qbman_paace(struct paace *ppaace, int > paace_type) > +static void setup_qbman_paace(struct paace *ppaace, int paace_type) > { > switch (paace_type) { > case QMAN_PAACE: > @@ -629,7 +628,7 @@ static void __init setup_qbman_paace(struct paace > *ppaace, int paace_type) > * this table to translate device transaction to appropriate corenet > * transaction. > */ > -static void __init setup_omt(struct ome *omt) > +static void setup_omt(struct ome *omt) > { > struct ome *ome; > > @@ -666,7 +665,7 @@ static void __init setup_omt(struct ome *omt) > * Get the maximum number of PAACT table entries > * and subwindows supported by PAMU > */ > -static void __init get_pamu_cap_values(unsigned long pamu_reg_base) > +static void get_pamu_cap_values(unsigned long pamu_reg_base) > { > u32 pc_val; > > @@ -676,9 +675,9 @@ static void __init get_pamu_cap_values(unsigned > long pamu_reg_base) } > > /* Setup PAMU registers pointing to PAACT, SPAACT and OMT */ -static int > __init setup_one_pamu(unsigned long pamu_reg_base, unsigned long > pamu_reg_size, > - phys_addr_t ppaact_phys, phys_addr_t > spaact_phys, > - phys_addr_t omt_phys) > +static int setup_one_pamu(unsigned long pamu_reg_base, unsigned long > pamu_reg_size, > + phys_addr_t ppaact_phys, phys_addr_t > spaact_phys, > + phys_addr_t omt_phys) > { > u32 *pc; > struct pamu_mmap_regs *pamu_regs; > @@ -720,7 +719,7 @@ static int __init setup_one_pamu(unsigned long > pamu_reg_base, unsigned long pamu } > > /* Enable all device LIODNS */ > -static void __init setup_liodns(void) > +static void setup_liodns(void) > { > int i, len; > struct paace *ppaace; > @@ -846,7 +845,7 @@ struct ccsr_law { > /* > * Create a coherence subdomain for a given memory block. > */ > -static int __init create_csd(phys_addr_t phys, size_t size, u32 csd_port_id) > +static int create_csd(phys_addr_t phys, size_t size, u32 csd_port_id) > { > struct device_node *np; > const __be32 *iprop; > @@ -988,7 +987,7 @@ error: > static const struct { > u32 svr; > u32 port_id; > -} port_id_map[] __initconst = { > +} port_id_map[] = { > {(SVR_P2040 << 8) | 0x10, 0xFF000000}, /* P2040 1.0 */ > {(SVR_P2040 << 8) | 0x11, 0xFF000000}, /* P2040 1.1 */ > {(SVR_P2041 << 8) | 0x10, 0xFF000000}, /* P2041 1.0 */ > @@ -1006,7 +1005,7 @@ static const struct { > > #define SVR_SECURITY 0x80000 /* The Security (E) bit */ > > -static int __init fsl_pamu_probe(struct platform_device *pdev) > +static int fsl_pamu_probe(struct platform_device *pdev) > { > struct device *dev = &pdev->dev; > void __iomem *pamu_regs = NULL; > @@ -1022,6 +1021,7 @@ static int __init fsl_pamu_probe(struct > platform_device *pdev) > int irq; > phys_addr_t ppaact_phys; > phys_addr_t spaact_phys; > + struct ome *omt; > phys_addr_t omt_phys; > size_t mem_size = 0; > unsigned int order = 0; > @@ -1200,7 +1200,7 @@ error: > return ret; > } > > -static struct platform_driver fsl_of_pamu_driver __initdata = { > +static struct platform_driver fsl_of_pamu_driver = { > .driver = { > .name = "fsl-of-pamu", > }, > -- > 2.3.3 > _______________________________________________ > iommu mailing list > iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org > https://lists.linuxfoundation.org/mailman/listinfo/iommu ^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH v2] iommu/fsl: Really fix init section(s) content 2015-08-03 12:29 ` Varun Sethi @ 2015-08-17 14:58 ` Madalin-Cristian Bucur [not found] ` <BL2PR03MB545DF3C789C02ED38841F77E6790-AZ66ij2kwaa1tTsckATbNOO6mTEJWrR4XA4E9RH9d+qIuWR1G4zioA@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Madalin-Cristian Bucur @ 2015-08-17 14:58 UTC (permalink / raw) To: joro@8bytes.org, iommu@lists.linux-foundation.org, Varun Sethi Cc: stable@vger.kernel.org Patch working on all tested platforms: B4860QDS, P2041RDB, P3041DS, P4080DS, P5020DS, P5040DS, T1024RDB, T1040RDB, T2080RDB, T4240QDS. Tested-by: Madalin Bucur <Madalin.Bucur@freescale.com> > -----Original Message----- > From: Sethi Varun-B16395 > Sent: Monday, August 03, 2015 3:29 PM > To: iommu@lists.linux-foundation.org; joro@8bytes.org > Cc: stable@vger.kernel.org; Medve Emilian-EMMEDVE1; Bucur Madalin- > Cristian-B32716 > Subject: RE: [PATCH v2] iommu/fsl: Really fix init section(s) content > > Hi Joerg, > This patch doesn't seem to be applied to the PAMU driver. > > Regards > Varun > > > -----Original Message----- > > From: iommu-bounces@lists.linux-foundation.org [mailto:iommu- > > bounces@lists.linux-foundation.org] On Behalf Of Emil Medve > > Sent: Wednesday, March 25, 2015 10:59 AM > > To: iommu@lists.linux-foundation.org; joro@8bytes.org > > Cc: stable@vger.kernel.org; Medve Emilian-EMMEDVE1 > > Subject: [PATCH v2] 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 > > --- > > drivers/iommu/fsl_pamu.c | 26 +++++++++++++------------- > > 1 file changed, 13 insertions(+), 13 deletions(-) > > > > diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index > > abeedc9..2570f2a 100644 > > --- a/drivers/iommu/fsl_pamu.c > > +++ b/drivers/iommu/fsl_pamu.c > > @@ -41,7 +41,6 @@ struct pamu_isr_data { > > > > static struct paace *ppaact; > > static struct paace *spaact; > > -static struct ome *omt __initdata; > > > > /* > > * Table for matching compatible strings, for device tree @@ -50,7 +49,7 > @@ > > static struct ome *omt __initdata; > > * SOCs. For the older SOCs "fsl,qoriq-device-config-1.0" > > * string would be used. > > */ > > -static const struct of_device_id guts_device_ids[] __initconst = { > > +static const struct of_device_id guts_device_ids[] = { > > { .compatible = "fsl,qoriq-device-config-1.0", }, > > { .compatible = "fsl,qoriq-device-config-2.0", }, > > {} > > @@ -599,7 +598,7 @@ found_cpu_node: > > * Memory accesses to QMAN and BMAN private memory need not be > > coherent, so > > * clear the PAACE entry coherency attribute for them. > > */ > > -static void __init setup_qbman_paace(struct paace *ppaace, int > > paace_type) > > +static void setup_qbman_paace(struct paace *ppaace, int paace_type) > > { > > switch (paace_type) { > > case QMAN_PAACE: > > @@ -629,7 +628,7 @@ static void __init setup_qbman_paace(struct paace > > *ppaace, int paace_type) > > * this table to translate device transaction to appropriate corenet > > * transaction. > > */ > > -static void __init setup_omt(struct ome *omt) > > +static void setup_omt(struct ome *omt) > > { > > struct ome *ome; > > > > @@ -666,7 +665,7 @@ static void __init setup_omt(struct ome *omt) > > * Get the maximum number of PAACT table entries > > * and subwindows supported by PAMU > > */ > > -static void __init get_pamu_cap_values(unsigned long pamu_reg_base) > > +static void get_pamu_cap_values(unsigned long pamu_reg_base) > > { > > u32 pc_val; > > > > @@ -676,9 +675,9 @@ static void __init get_pamu_cap_values(unsigned > > long pamu_reg_base) } > > > > /* Setup PAMU registers pointing to PAACT, SPAACT and OMT */ -static int > > __init setup_one_pamu(unsigned long pamu_reg_base, unsigned long > > pamu_reg_size, > > - phys_addr_t ppaact_phys, phys_addr_t > > spaact_phys, > > - phys_addr_t omt_phys) > > +static int setup_one_pamu(unsigned long pamu_reg_base, unsigned long > > pamu_reg_size, > > + phys_addr_t ppaact_phys, phys_addr_t > > spaact_phys, > > + phys_addr_t omt_phys) > > { > > u32 *pc; > > struct pamu_mmap_regs *pamu_regs; > > @@ -720,7 +719,7 @@ static int __init setup_one_pamu(unsigned long > > pamu_reg_base, unsigned long pamu } > > > > /* Enable all device LIODNS */ > > -static void __init setup_liodns(void) > > +static void setup_liodns(void) > > { > > int i, len; > > struct paace *ppaace; > > @@ -846,7 +845,7 @@ struct ccsr_law { > > /* > > * Create a coherence subdomain for a given memory block. > > */ > > -static int __init create_csd(phys_addr_t phys, size_t size, u32 csd_port_id) > > +static int create_csd(phys_addr_t phys, size_t size, u32 csd_port_id) > > { > > struct device_node *np; > > const __be32 *iprop; > > @@ -988,7 +987,7 @@ error: > > static const struct { > > u32 svr; > > u32 port_id; > > -} port_id_map[] __initconst = { > > +} port_id_map[] = { > > {(SVR_P2040 << 8) | 0x10, 0xFF000000}, /* P2040 1.0 */ > > {(SVR_P2040 << 8) | 0x11, 0xFF000000}, /* P2040 1.1 */ > > {(SVR_P2041 << 8) | 0x10, 0xFF000000}, /* P2041 1.0 */ > > @@ -1006,7 +1005,7 @@ static const struct { > > > > #define SVR_SECURITY 0x80000 /* The Security (E) bit */ > > > > -static int __init fsl_pamu_probe(struct platform_device *pdev) > > +static int fsl_pamu_probe(struct platform_device *pdev) > > { > > struct device *dev = &pdev->dev; > > void __iomem *pamu_regs = NULL; > > @@ -1022,6 +1021,7 @@ static int __init fsl_pamu_probe(struct > > platform_device *pdev) > > int irq; > > phys_addr_t ppaact_phys; > > phys_addr_t spaact_phys; > > + struct ome *omt; > > phys_addr_t omt_phys; > > size_t mem_size = 0; > > unsigned int order = 0; > > @@ -1200,7 +1200,7 @@ error: > > return ret; > > } > > > > -static struct platform_driver fsl_of_pamu_driver __initdata = { > > +static struct platform_driver fsl_of_pamu_driver = { > > .driver = { > > .name = "fsl-of-pamu", > > }, > > -- > > 2.3.3 > > _______________________________________________ > > iommu mailing list > > iommu@lists.linux-foundation.org > > https://lists.linuxfoundation.org/mailman/listinfo/iommu ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <BL2PR03MB545DF3C789C02ED38841F77E6790-AZ66ij2kwaa1tTsckATbNOO6mTEJWrR4XA4E9RH9d+qIuWR1G4zioA@public.gmane.org>]
* RE: [PATCH v2] iommu/fsl: Really fix init section(s) content [not found] ` <BL2PR03MB545DF3C789C02ED38841F77E6790-AZ66ij2kwaa1tTsckATbNOO6mTEJWrR4XA4E9RH9d+qIuWR1G4zioA@public.gmane.org> @ 2015-08-17 15:24 ` Varun Sethi 0 siblings, 0 replies; 5+ messages in thread From: Varun Sethi @ 2015-08-17 15:24 UTC (permalink / raw) To: Madalin-Cristian Bucur, joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, Varun Sethi Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org [-- Attachment #1.1: Type: text/plain, Size: 8043 bytes --] Thanks Madalin. Joerg, Can you please pick this patch. Regards Varun -------- Original message -------- From: Bucur Madalin-Cristian-B32716 Date:08/17/2015 8:28 PM (GMT+05:30) To: joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org,iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,Sethi Varun-B16395 Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Subject: RE: [PATCH v2] iommu/fsl: Really fix init section(s) content Patch working on all tested platforms: B4860QDS, P2041RDB, P3041DS, P4080DS, P5020DS, P5040DS, T1024RDB, T1040RDB, T2080RDB, T4240QDS. Tested-by: Madalin Bucur <Madalin.Bucur-KZfg59tc24xl57MIdRCFDg@public.gmane.org> > -----Original Message----- > From: Sethi Varun-B16395 > Sent: Monday, August 03, 2015 3:29 PM > To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org > Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; Medve Emilian-EMMEDVE1; Bucur Madalin- > Cristian-B32716 > Subject: RE: [PATCH v2] iommu/fsl: Really fix init section(s) content > > Hi Joerg, > This patch doesn't seem to be applied to the PAMU driver. > > Regards > Varun > > > -----Original Message----- > > From: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org [mailto:iommu- > > bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org] On Behalf Of Emil Medve > > Sent: Wednesday, March 25, 2015 10:59 AM > > To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org > > Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; Medve Emilian-EMMEDVE1 > > Subject: [PATCH v2] 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-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org> > > Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org> > > Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > > --- > > drivers/iommu/fsl_pamu.c | 26 +++++++++++++------------- > > 1 file changed, 13 insertions(+), 13 deletions(-) > > > > diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index > > abeedc9..2570f2a 100644 > > --- a/drivers/iommu/fsl_pamu.c > > +++ b/drivers/iommu/fsl_pamu.c > > @@ -41,7 +41,6 @@ struct pamu_isr_data { > > > > static struct paace *ppaact; > > static struct paace *spaact; > > -static struct ome *omt __initdata; > > > > /* > > * Table for matching compatible strings, for device tree @@ -50,7 +49,7 > @@ > > static struct ome *omt __initdata; > > * SOCs. For the older SOCs "fsl,qoriq-device-config-1.0" > > * string would be used. > > */ > > -static const struct of_device_id guts_device_ids[] __initconst = { > > +static const struct of_device_id guts_device_ids[] = { > > { .compatible = "fsl,qoriq-device-config-1.0", }, > > { .compatible = "fsl,qoriq-device-config-2.0", }, > > {} > > @@ -599,7 +598,7 @@ found_cpu_node: > > * Memory accesses to QMAN and BMAN private memory need not be > > coherent, so > > * clear the PAACE entry coherency attribute for them. > > */ > > -static void __init setup_qbman_paace(struct paace *ppaace, int > > paace_type) > > +static void setup_qbman_paace(struct paace *ppaace, int paace_type) > > { > > switch (paace_type) { > > case QMAN_PAACE: > > @@ -629,7 +628,7 @@ static void __init setup_qbman_paace(struct paace > > *ppaace, int paace_type) > > * this table to translate device transaction to appropriate corenet > > * transaction. > > */ > > -static void __init setup_omt(struct ome *omt) > > +static void setup_omt(struct ome *omt) > > { > > struct ome *ome; > > > > @@ -666,7 +665,7 @@ static void __init setup_omt(struct ome *omt) > > * Get the maximum number of PAACT table entries > > * and subwindows supported by PAMU > > */ > > -static void __init get_pamu_cap_values(unsigned long pamu_reg_base) > > +static void get_pamu_cap_values(unsigned long pamu_reg_base) > > { > > u32 pc_val; > > > > @@ -676,9 +675,9 @@ static void __init get_pamu_cap_values(unsigned > > long pamu_reg_base) } > > > > /* Setup PAMU registers pointing to PAACT, SPAACT and OMT */ -static int > > __init setup_one_pamu(unsigned long pamu_reg_base, unsigned long > > pamu_reg_size, > > - phys_addr_t ppaact_phys, phys_addr_t > > spaact_phys, > > - phys_addr_t omt_phys) > > +static int setup_one_pamu(unsigned long pamu_reg_base, unsigned long > > pamu_reg_size, > > + phys_addr_t ppaact_phys, phys_addr_t > > spaact_phys, > > + phys_addr_t omt_phys) > > { > > u32 *pc; > > struct pamu_mmap_regs *pamu_regs; > > @@ -720,7 +719,7 @@ static int __init setup_one_pamu(unsigned long > > pamu_reg_base, unsigned long pamu } > > > > /* Enable all device LIODNS */ > > -static void __init setup_liodns(void) > > +static void setup_liodns(void) > > { > > int i, len; > > struct paace *ppaace; > > @@ -846,7 +845,7 @@ struct ccsr_law { > > /* > > * Create a coherence subdomain for a given memory block. > > */ > > -static int __init create_csd(phys_addr_t phys, size_t size, u32 csd_port_id) > > +static int create_csd(phys_addr_t phys, size_t size, u32 csd_port_id) > > { > > struct device_node *np; > > const __be32 *iprop; > > @@ -988,7 +987,7 @@ error: > > static const struct { > > u32 svr; > > u32 port_id; > > -} port_id_map[] __initconst = { > > +} port_id_map[] = { > > {(SVR_P2040 << 8) | 0x10, 0xFF000000}, /* P2040 1.0 */ > > {(SVR_P2040 << 8) | 0x11, 0xFF000000}, /* P2040 1.1 */ > > {(SVR_P2041 << 8) | 0x10, 0xFF000000}, /* P2041 1.0 */ > > @@ -1006,7 +1005,7 @@ static const struct { > > > > #define SVR_SECURITY 0x80000 /* The Security (E) bit */ > > > > -static int __init fsl_pamu_probe(struct platform_device *pdev) > > +static int fsl_pamu_probe(struct platform_device *pdev) > > { > > struct device *dev = &pdev->dev; > > void __iomem *pamu_regs = NULL; > > @@ -1022,6 +1021,7 @@ static int __init fsl_pamu_probe(struct > > platform_device *pdev) > > int irq; > > phys_addr_t ppaact_phys; > > phys_addr_t spaact_phys; > > + struct ome *omt; > > phys_addr_t omt_phys; > > size_t mem_size = 0; > > unsigned int order = 0; > > @@ -1200,7 +1200,7 @@ error: > > return ret; > > } > > > > -static struct platform_driver fsl_of_pamu_driver __initdata = { > > +static struct platform_driver fsl_of_pamu_driver = { > > .driver = { > > .name = "fsl-of-pamu", > > }, > > -- > > 2.3.3 > > _______________________________________________ > > iommu mailing list > > iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org > > https://lists.linuxfoundation.org/mailman/listinfo/iommu [-- Attachment #1.2: Type: text/html, Size: 12290 bytes --] [-- Attachment #2: Type: text/plain, Size: 0 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] iommu/fsl: Really fix init section(s) content 2015-03-25 5:28 [PATCH v2] iommu/fsl: Really fix init section(s) content Emil Medve [not found] ` <1427261328-23798-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org> @ 2015-08-18 9:32 ` Joerg Roedel 1 sibling, 0 replies; 5+ messages in thread From: Joerg Roedel @ 2015-08-18 9:32 UTC (permalink / raw) To: Emil Medve; +Cc: iommu, stable On Wed, Mar 25, 2015 at 12:28:48AM -0500, Emil Medve wrote: > drivers/iommu/fsl_pamu.c | 26 +++++++++++++------------- > 1 file changed, 13 insertions(+), 13 deletions(-) Applied. ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-08-18 9:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-25 5:28 [PATCH v2] iommu/fsl: Really fix init section(s) content Emil Medve
[not found] ` <1427261328-23798-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-08-03 12:29 ` Varun Sethi
2015-08-17 14:58 ` Madalin-Cristian Bucur
[not found] ` <BL2PR03MB545DF3C789C02ED38841F77E6790-AZ66ij2kwaa1tTsckATbNOO6mTEJWrR4XA4E9RH9d+qIuWR1G4zioA@public.gmane.org>
2015-08-17 15:24 ` Varun Sethi
2015-08-18 9:32 ` Joerg Roedel
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox