Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1524046 > unrolled thread

[V2 PATCH] edac: mpc85xx: implement "remove" for mpc85xx_pci_err_driver

Started by<yanjiang.jin@windriver.com>
First post2016-11-17 04:00 +0100
Last post2016-11-17 11:30 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [V2 PATCH] edac: mpc85xx: implement "remove" for mpc85xx_pci_err_driver <yanjiang.jin@windriver.com> - 2016-11-17 04:00 +0100
    [PATCH] edac: mpc85xx: implement "remove" for mpc85xx_pci_err_driver <yanjiang.jin@windriver.com> - 2016-11-17 04:00 +0100
      Re: [PATCH] edac: mpc85xx: implement "remove" for  mpc85xx_pci_err_driver Borislav Petkov <bp@alien8.de> - 2016-11-17 11:30 +0100

#1524046 — [V2 PATCH] edac: mpc85xx: implement "remove" for mpc85xx_pci_err_driver

From<yanjiang.jin@windriver.com>
Date2016-11-17 04:00 +0100
Subject[V2 PATCH] edac: mpc85xx: implement "remove" for mpc85xx_pci_err_driver
Message-ID<sEl5D-33A-13@gated-at.bofh.it>
From: Yanjiang Jin <yanjiang.jin@windriver.com>

Tested on a T4240QDS board.

V1->V2: According to Boris's suggestion, remove all hex addresses and offsets
        in Call Trace messages, so that it is recognizable by others.

Yanjiang Jin (1):
  edac: mpc85xx: implement "remove" for mpc85xx_pci_err_driver

 drivers/edac/mpc85xx_edac.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

-- 
1.9.1

[toc] | [next] | [standalone]


#1524047 — [PATCH] edac: mpc85xx: implement "remove" for mpc85xx_pci_err_driver

From<yanjiang.jin@windriver.com>
Date2016-11-17 04:00 +0100
Subject[PATCH] edac: mpc85xx: implement "remove" for mpc85xx_pci_err_driver
Message-ID<sEl5D-33A-11@gated-at.bofh.it>
In reply to#1524046
From: Yanjiang Jin <yanjiang.jin@windriver.com>

Tested on a T4240QDS board.

If we execute the below steps without this patch:

1. modprobe mpc85xx_edac [The first insmod, everything is well.]
2. modprobe -r mpc85xx_edac
3. modprobe mpc85xx_edac [insmod again, error happens.]

We would get the error messages as below:

BUG: recent printk recursion!
Oops: Kernel access of bad area, sig: 11 [#48]
Modules linked in: mpc85xx_edac edac_core softdog [last unloaded: mpc85xx_edac]
CPU: 5 PID: 14773 Comm: modprobe Tainted: G D C 4.8.3-rt2

 .vsnprintf
 .vscnprintf
 .vprintk_emit
 .printk
 .edac_pci_add_device
 .mpc85xx_pci_err_probe
 .platform_drv_probe
 .driver_probe_device
 .__driver_attach
 .bus_for_each_dev
 .driver_attach
 .bus_add_driver
 .driver_register
 .__platform_register_drivers
 .mpc85xx_mc_init
 .do_one_initcall
 .do_init_module
 .load_module
 .SyS_finit_module
 system_call

Signed-off-by: Yanjiang Jin <yanjiang.jin@windriver.com>
---
 drivers/edac/mpc85xx_edac.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c
index ff05675..c626021 100644
--- a/drivers/edac/mpc85xx_edac.c
+++ b/drivers/edac/mpc85xx_edac.c
@@ -300,6 +300,22 @@ static int mpc85xx_pci_err_probe(struct platform_device *op)
 	return res;
 }
 
+static int mpc85xx_pci_err_remove(struct platform_device *op)
+{
+	struct edac_pci_ctl_info *pci = dev_get_drvdata(&op->dev);
+	struct mpc85xx_pci_pdata *pdata = pci->pvt_info;
+
+	edac_dbg(0, "\n");
+
+	out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_ADDR, orig_pci_err_cap_dr);
+	out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_EN, orig_pci_err_en);
+
+	edac_pci_del_device(&op->dev);
+	edac_pci_free_ctl_info(pci);
+
+	return 0;
+}
+
 static const struct platform_device_id mpc85xx_pci_err_match[] = {
 	{
 		.name = "mpc85xx-pci-edac"
@@ -309,6 +325,7 @@ static int mpc85xx_pci_err_probe(struct platform_device *op)
 
 static struct platform_driver mpc85xx_pci_err_driver = {
 	.probe = mpc85xx_pci_err_probe,
+	.remove = mpc85xx_pci_err_remove,
 	.id_table = mpc85xx_pci_err_match,
 	.driver = {
 		.name = "mpc85xx_pci_err",
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1524237 — Re: [PATCH] edac: mpc85xx: implement "remove" for mpc85xx_pci_err_driver

FromBorislav Petkov <bp@alien8.de>
Date2016-11-17 11:30 +0100
SubjectRe: [PATCH] edac: mpc85xx: implement "remove" for mpc85xx_pci_err_driver
Message-ID<sEs77-7Sn-13@gated-at.bofh.it>
In reply to#1524047
On Thu, Nov 17, 2016 at 10:56:20AM +0800, yanjiang.jin@windriver.com wrote:
> From: Yanjiang Jin <yanjiang.jin@windriver.com>
> 
> Tested on a T4240QDS board.
> 
> If we execute the below steps without this patch:
> 
> 1. modprobe mpc85xx_edac [The first insmod, everything is well.]
> 2. modprobe -r mpc85xx_edac
> 3. modprobe mpc85xx_edac [insmod again, error happens.]
> 
> We would get the error messages as below:
> 
> BUG: recent printk recursion!
> Oops: Kernel access of bad area, sig: 11 [#48]
> Modules linked in: mpc85xx_edac edac_core softdog [last unloaded: mpc85xx_edac]
> CPU: 5 PID: 14773 Comm: modprobe Tainted: G D C 4.8.3-rt2
> 
>  .vsnprintf
>  .vscnprintf
>  .vprintk_emit
>  .printk
>  .edac_pci_add_device
>  .mpc85xx_pci_err_probe
>  .platform_drv_probe
>  .driver_probe_device
>  .__driver_attach
>  .bus_for_each_dev
>  .driver_attach
>  .bus_add_driver
>  .driver_register
>  .__platform_register_drivers
>  .mpc85xx_mc_init
>  .do_one_initcall
>  .do_init_module
>  .load_module
>  .SyS_finit_module
>  system_call
> 
> Signed-off-by: Yanjiang Jin <yanjiang.jin@windriver.com>
> ---
>  drivers/edac/mpc85xx_edac.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)

Applied, thanks.

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web