Linux-Amlogic Archive on lore.kernel.org
 help / Atom feed
* Re: Kernel segmentation fault unbinding eMMC on AML-S905X-CC
       [not found] <5c3744c0.1c69fb81.93dc1.2aff@mx.google.com>
@ 2019-01-10 14:08 ` Remi Pommarel
  2019-01-10 16:43   ` Elie Roudninski
  0 siblings, 1 reply; 4+ messages in thread
From: Remi Pommarel @ 2019-01-10 14:08 UTC (permalink / raw)
  To: Elie Roudninski; +Cc: linux-amlogic, linux-mmc

On Wed, Jan 09, 2019 at 10:48:50PM +0000, Elie Roudninski wrote:
...

> [  444.060161] Call trace:
> [  444.062580]  queued_spin_lock_slowpath+0x228/0x2d0
> [  444.067322]  meson_mmc_irq+0x290/0x2a0
> [  444.071032]  __free_irq+0x184/0x318
> [  444.074480]  free_irq+0x40/0x80
> [  444.077586]  devm_irq_release+0x24/0x30
> [  444.081382]  release_nodes+0x1e0/0x2e0
> [  444.085089]  devres_release_all+0x60/0x88
> [  444.089057]  device_release_driver_internal+0x1c8/0x248
> [  444.094231]  device_release_driver+0x28/0x38
> [  444.098459]  unbind_store+0xdc/0x148
> [  444.101994]  drv_attr_store+0x40/0x58
> [  444.105627]  sysfs_kf_write+0x5c/0x78
> [  444.109240]  kernfs_fop_write+0xe8/0x1e0
> [  444.113126]  __vfs_write+0x60/0x190
> [  444.116570]  vfs_write+0xac/0x1b0
> [  444.119848]  ksys_write+0x6c/0xd0
> [  444.123125]  __arm64_sys_write+0x24/0x30
> [  444.127015]  el0_svc_common+0x94/0xe8
> [  444.130629]  el0_svc_handler+0x38/0x80
> [  444.134340]  el0_svc+0x8/0xc
> [  444.137187] Code: d37c0401 910020c0 8b010041 f865d8e5 (f8256826)
> [  444.143223] ---[ end trace 62541ec2ffe020f2 ]---
> Segmentation fault

...

Here are my two cents on this.

The irq that is being freed was allocated through device management
(i.e. with devm_request_threaded_irq()). So this irq will be released
after meson_mmc_remove() completion, thus after that mmc_free_host()
has been called. Because this irq has been registered with IRQF_SHARED
and if you have CONFIG_DEBUG_SHIRQ (do you ?) the irq handler will be
called while the irq is freed.

So meson_mmc_irq could be called after mmc_free_host() has freed the
meson_host pointer causing it to dereference an invalid pointer.

So if you have CONFIG_DEBUG_SHIRQ could you please test the following
patch:

------------------------------- 8< ----------------------------------
diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
index c2690c1a50ff..3a9679531520 100644
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -179,6 +179,8 @@ struct meson_host {
 	struct sd_emmc_desc *descs;
 	dma_addr_t descs_dma_addr;
 
+	int irq;
+
 	bool vqmmc_enabled;
 };
 
@@ -1231,7 +1233,7 @@ static int meson_mmc_probe(struct platform_device *pdev)
 	struct resource *res;
 	struct meson_host *host;
 	struct mmc_host *mmc;
-	int ret, irq;
+	int ret;
 
 	mmc = mmc_alloc_host(sizeof(struct meson_host), &pdev->dev);
 	if (!mmc)
@@ -1276,8 +1278,8 @@ static int meson_mmc_probe(struct platform_device *pdev)
 		goto free_host;
 	}
 
-	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0) {
+	host->irq = platform_get_irq(pdev, 0);
+	if (host->irq <= 0) {
 		dev_err(&pdev->dev, "failed to get interrupt resource.\n");
 		ret = -EINVAL;
 		goto free_host;
@@ -1331,9 +1333,8 @@ static int meson_mmc_probe(struct platform_device *pdev)
 	writel(IRQ_CRC_ERR | IRQ_TIMEOUTS | IRQ_END_OF_CHAIN,
 	       host->regs + SD_EMMC_IRQ_EN);
 
-	ret = devm_request_threaded_irq(&pdev->dev, irq, meson_mmc_irq,
-					meson_mmc_irq_thread, IRQF_SHARED,
-					NULL, host);
+	ret = request_threaded_irq(host->irq, meson_mmc_irq,
+			meson_mmc_irq_thread, IRQF_SHARED, NULL, host);
 	if (ret)
 		goto err_init_clk;
 
@@ -1387,6 +1388,7 @@ static int meson_mmc_remove(struct platform_device *pdev)
 
 	/* disable interrupts */
 	writel(0, host->regs + SD_EMMC_IRQ_EN);
+	free_irq(host->irq, host);
 
 	dma_free_coherent(host->dev, SD_EMMC_DESC_BUF_LEN,
 			  host->descs, host->descs_dma_addr);
------------------------------- 8< ----------------------------------

This basically freed the irq in the meson_mmc_remove() so the
meson_mmc_irq() is called before mmc_free_host().

-- 
Rémi Pommarel

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Kernel segmentation fault unbinding eMMC on AML-S905X-CC
  2019-01-10 14:08 ` Kernel segmentation fault unbinding eMMC on AML-S905X-CC Remi Pommarel
@ 2019-01-10 16:43   ` Elie Roudninski
  2019-01-10 18:42     ` Remi Pommarel
  0 siblings, 1 reply; 4+ messages in thread
From: Elie Roudninski @ 2019-01-10 16:43 UTC (permalink / raw)
  To: Remi Pommarel; +Cc: linux-amlogic, linux-mmc

On Thu, Jan 10, 2019 at 1:59 PM Remi Pommarel <repk@triplefau.lt> wrote:
>
> On Wed, Jan 09, 2019 at 10:48:50PM +0000, Elie Roudninski wrote:
> ...
>
> > [  444.060161] Call trace:
> > [  444.062580]  queued_spin_lock_slowpath+0x228/0x2d0
> > [  444.067322]  meson_mmc_irq+0x290/0x2a0
> > [  444.071032]  __free_irq+0x184/0x318
> > [  444.074480]  free_irq+0x40/0x80
> > [  444.077586]  devm_irq_release+0x24/0x30
> > [  444.081382]  release_nodes+0x1e0/0x2e0
> > [  444.085089]  devres_release_all+0x60/0x88
> > [  444.089057]  device_release_driver_internal+0x1c8/0x248
> > [  444.094231]  device_release_driver+0x28/0x38
> > [  444.098459]  unbind_store+0xdc/0x148
> > [  444.101994]  drv_attr_store+0x40/0x58
> > [  444.105627]  sysfs_kf_write+0x5c/0x78
> > [  444.109240]  kernfs_fop_write+0xe8/0x1e0
> > [  444.113126]  __vfs_write+0x60/0x190
> > [  444.116570]  vfs_write+0xac/0x1b0
> > [  444.119848]  ksys_write+0x6c/0xd0
> > [  444.123125]  __arm64_sys_write+0x24/0x30
> > [  444.127015]  el0_svc_common+0x94/0xe8
> > [  444.130629]  el0_svc_handler+0x38/0x80
> > [  444.134340]  el0_svc+0x8/0xc
> > [  444.137187] Code: d37c0401 910020c0 8b010041 f865d8e5 (f8256826)
> > [  444.143223] ---[ end trace 62541ec2ffe020f2 ]---
> > Segmentation fault
>
> ...
>
> Here are my two cents on this.
>
> The irq that is being freed was allocated through device management
> (i.e. with devm_request_threaded_irq()). So this irq will be released
> after meson_mmc_remove() completion, thus after that mmc_free_host()
> has been called. Because this irq has been registered with IRQF_SHARED
> and if you have CONFIG_DEBUG_SHIRQ (do you ?) the irq handler will be
Yes, you are right. I have CONFIG_DEBUG_SHIRQ enabled.
> called while the irq is freed.
>
> So meson_mmc_irq could be called after mmc_free_host() has freed the
> meson_host pointer causing it to dereference an invalid pointer.
>
> So if you have CONFIG_DEBUG_SHIRQ could you please test the following
> patch:
>
> ------------------------------- 8< ----------------------------------
> diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
> index c2690c1a50ff..3a9679531520 100644
> --- a/drivers/mmc/host/meson-gx-mmc.c
> +++ b/drivers/mmc/host/meson-gx-mmc.c
> @@ -179,6 +179,8 @@ struct meson_host {
>         struct sd_emmc_desc *descs;
>         dma_addr_t descs_dma_addr;
>
> +       int irq;
> +
>         bool vqmmc_enabled;
>  };
>
> @@ -1231,7 +1233,7 @@ static int meson_mmc_probe(struct platform_device *pdev)
>         struct resource *res;
>         struct meson_host *host;
>         struct mmc_host *mmc;
> -       int ret, irq;
> +       int ret;
>
>         mmc = mmc_alloc_host(sizeof(struct meson_host), &pdev->dev);
>         if (!mmc)
> @@ -1276,8 +1278,8 @@ static int meson_mmc_probe(struct platform_device *pdev)
>                 goto free_host;
>         }
>
> -       irq = platform_get_irq(pdev, 0);
> -       if (irq <= 0) {
> +       host->irq = platform_get_irq(pdev, 0);
> +       if (host->irq <= 0) {
>                 dev_err(&pdev->dev, "failed to get interrupt resource.\n");
>                 ret = -EINVAL;
>                 goto free_host;
> @@ -1331,9 +1333,8 @@ static int meson_mmc_probe(struct platform_device *pdev)
>         writel(IRQ_CRC_ERR | IRQ_TIMEOUTS | IRQ_END_OF_CHAIN,
>                host->regs + SD_EMMC_IRQ_EN);
>
> -       ret = devm_request_threaded_irq(&pdev->dev, irq, meson_mmc_irq,
> -                                       meson_mmc_irq_thread, IRQF_SHARED,
> -                                       NULL, host);
> +       ret = request_threaded_irq(host->irq, meson_mmc_irq,
> +                       meson_mmc_irq_thread, IRQF_SHARED, NULL, host);
>         if (ret)
>                 goto err_init_clk;
>
> @@ -1387,6 +1388,7 @@ static int meson_mmc_remove(struct platform_device *pdev)
>
>         /* disable interrupts */
>         writel(0, host->regs + SD_EMMC_IRQ_EN);
> +       free_irq(host->irq, host);
>
>         dma_free_coherent(host->dev, SD_EMMC_DESC_BUF_LEN,
>                           host->descs, host->descs_dma_addr);
> ------------------------------- 8< ----------------------------------
>
> This basically freed the irq in the meson_mmc_remove() so the
> meson_mmc_irq() is called before mmc_free_host().
Hello and thank you for looking into this!

Your patch seems to work. I still got a stacktrace but not a segfault
anymore, and it appears to be related to something else:
[  148.133895] WARNING: CPU: 1 PID: 580 at
drivers/mmc/host/meson-gx-mmc.c:1027 meson_mmc_irq+0x210/0x2a0
[  148.137535] Modules linked in: cfg80211 rfkill 8021q garp mrp stp
llc dw_hdmi_cec meson_dw_hdmi dw_hdmi meson_drm dwmac_generic
drm_kms_helper dwmac_meson8b drm crct10dif_ce stmmac_platform stmmac
drm_panel_orientation_quirks meson_ir ptp syscopyarea rc_core
sysfillrect sysimgblt fb_sys_fops pps_core meson_canvas meson_gxbb_wdt
[  148.166345] CPU: 1 PID: 580 Comm: bash Tainted: G        W
4.20.0_2 #1
[  148.173498] Hardware name: amlogic p212/p212, BIOS
2019.01-rc2-00176-gf97c49d6a2 01/10/2019
[  148.181780] pstate: 60400085 (nZCv daIf +PAN -UAO)
[  148.186527] pc : meson_mmc_irq+0x210/0x2a0
[  148.190586] lr : __free_irq+0x184/0x318
[  148.194370] sp : ffff0000108efac0
[  148.197647] x29: ffff0000108efac0 x28: ffff800005cfb600
[  148.202908] x27: 0000000000000000 x26: 0000000000000000
[  148.208169] x25: 0000000000000000 x24: ffff8000105e8228
[  148.213431] x23: 0000000000000013 x22: ffff8000105e8358
[  148.218692] x21: ffff800005e61f00 x20: ffff8000105e8200
[  148.223953] x19: ffff800005e61f00 x18: 0000000000000000
[  148.229214] x17: 0000000000000000 x16: 0000000000000000
[  148.234476] x15: ffffffffffffffff x14: 6d6d2e3030303437
[  148.239737] x13: 3030642f6270612e x12: 0000000000000040
[  148.244998] x11: 0000000000000228 x10: 0000000000000040
[  148.250259] x9 : ffff000009fa9de8 x8 : ffff000009fa9de0
[  148.255521] x7 : ffff800007e7e050 x6 : 0000000000000000
[  148.260782] x5 : ffff800007e7df90 x4 : 0000000000000000
[  148.266043] x3 : 0000000000000000 x2 : ffff000008b90080
[  148.271304] x1 : ffff800005e61f00 x0 : 0000000000000000
[  148.276566] Call trace:
[  148.278984]  meson_mmc_irq+0x210/0x2a0
[  148.282692]  __free_irq+0x184/0x318
[  148.286142]  free_irq+0x40/0x80
[  148.289247]  meson_mmc_remove+0x48/0x190
[  148.293130]  platform_drv_remove+0x30/0x50
[  148.297190]  device_release_driver_internal+0x1b0/0x248
[  148.302357]  device_release_driver+0x28/0x38
[  148.306583]  unbind_store+0xdc/0x148
[  148.310119]  drv_attr_store+0x40/0x58
[  148.313743]  sysfs_kf_write+0x5c/0x78
[  148.317364]  kernfs_fop_write+0xe8/0x1e0
[  148.321247]  __vfs_write+0x60/0x190
[  148.324695]  vfs_write+0xac/0x1b0
[  148.327972]  ksys_write+0x6c/0xd0
[  148.331250]  __arm64_sys_write+0x24/0x30
[  148.335133]  el0_svc_common+0x94/0xe8
[  148.338754]  el0_svc_handler+0x38/0x80
[  148.342463]  el0_svc+0x8/0xc
[  148.345308] ---[ end trace eb849c1a635abc72 ]---
[  148.350408] meson-gx-mmc d0074000.mmc: Dropping the link to regulator.3
[  148.356575] meson-gx-mmc d0074000.mmc: Dropping the link to regulator.1

Moreover when I bind the eMMC after the unbind, Linux detects it
properly, its a huge improvement!
Thank you very much!

I don't know if jbrunet's patch about removing the "non-removable"
property should allow Linux to detects it automatically when plugged
without unbind/bind, but this part is not working.

Regards,

Elie
>
> --
> Rémi Pommarel

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Kernel segmentation fault unbinding eMMC on AML-S905X-CC
  2019-01-10 16:43   ` Elie Roudninski
@ 2019-01-10 18:42     ` Remi Pommarel
  0 siblings, 0 replies; 4+ messages in thread
From: Remi Pommarel @ 2019-01-10 18:42 UTC (permalink / raw)
  To: Elie Roudninski; +Cc: linux-amlogic, linux-mmc

On Thu, Jan 10, 2019 at 04:43:31PM +0000, Elie Roudninski wrote:
[ ... ]
> Your patch seems to work. I still got a stacktrace but not a segfault
> anymore, and it appears to be related to something else:
> [  148.133895] WARNING: CPU: 1 PID: 580 at
> drivers/mmc/host/meson-gx-mmc.c:1027 meson_mmc_irq+0x210/0x2a0
> [  148.137535] Modules linked in: cfg80211 rfkill 8021q garp mrp stp
> llc dw_hdmi_cec meson_dw_hdmi dw_hdmi meson_drm dwmac_generic
> drm_kms_helper dwmac_meson8b drm crct10dif_ce stmmac_platform stmmac
> drm_panel_orientation_quirks meson_ir ptp syscopyarea rc_core
> sysfillrect sysimgblt fb_sys_fops pps_core meson_canvas meson_gxbb_wdt
> [  148.166345] CPU: 1 PID: 580 Comm: bash Tainted: G        W
> 4.20.0_2 #1
> [  148.173498] Hardware name: amlogic p212/p212, BIOS
> 2019.01-rc2-00176-gf97c49d6a2 01/10/2019
> [  148.181780] pstate: 60400085 (nZCv daIf +PAN -UAO)
> [  148.186527] pc : meson_mmc_irq+0x210/0x2a0
> [  148.190586] lr : __free_irq+0x184/0x318
> [  148.194370] sp : ffff0000108efac0
> [  148.197647] x29: ffff0000108efac0 x28: ffff800005cfb600
> [  148.202908] x27: 0000000000000000 x26: 0000000000000000
> [  148.208169] x25: 0000000000000000 x24: ffff8000105e8228
> [  148.213431] x23: 0000000000000013 x22: ffff8000105e8358
> [  148.218692] x21: ffff800005e61f00 x20: ffff8000105e8200
> [  148.223953] x19: ffff800005e61f00 x18: 0000000000000000
> [  148.229214] x17: 0000000000000000 x16: 0000000000000000
> [  148.234476] x15: ffffffffffffffff x14: 6d6d2e3030303437
> [  148.239737] x13: 3030642f6270612e x12: 0000000000000040
> [  148.244998] x11: 0000000000000228 x10: 0000000000000040
> [  148.250259] x9 : ffff000009fa9de8 x8 : ffff000009fa9de0
> [  148.255521] x7 : ffff800007e7e050 x6 : 0000000000000000
> [  148.260782] x5 : ffff800007e7df90 x4 : 0000000000000000
> [  148.266043] x3 : 0000000000000000 x2 : ffff000008b90080
> [  148.271304] x1 : ffff800005e61f00 x0 : 0000000000000000
> [  148.276566] Call trace:
> [  148.278984]  meson_mmc_irq+0x210/0x2a0
> [  148.282692]  __free_irq+0x184/0x318
> [  148.286142]  free_irq+0x40/0x80
> [  148.289247]  meson_mmc_remove+0x48/0x190
> [  148.293130]  platform_drv_remove+0x30/0x50
> [  148.297190]  device_release_driver_internal+0x1b0/0x248
> [  148.302357]  device_release_driver+0x28/0x38
> [  148.306583]  unbind_store+0xdc/0x148
> [  148.310119]  drv_attr_store+0x40/0x58
> [  148.313743]  sysfs_kf_write+0x5c/0x78
> [  148.317364]  kernfs_fop_write+0xe8/0x1e0
> [  148.321247]  __vfs_write+0x60/0x190
> [  148.324695]  vfs_write+0xac/0x1b0
> [  148.327972]  ksys_write+0x6c/0xd0
> [  148.331250]  __arm64_sys_write+0x24/0x30
> [  148.335133]  el0_svc_common+0x94/0xe8
> [  148.338754]  el0_svc_handler+0x38/0x80
> [  148.342463]  el0_svc+0x8/0xc
> [  148.345308] ---[ end trace eb849c1a635abc72 ]---
> [  148.350408] meson-gx-mmc d0074000.mmc: Dropping the link to regulator.3
> [  148.356575] meson-gx-mmc d0074000.mmc: Dropping the link to regulator.1
> 

Yes should be fixed in 4.21 by https://lkml.org/lkml/2018/12/6/748.

> Moreover when I bind the eMMC after the unbind, Linux detects it
> properly, its a huge improvement!
> Thank you very much!
> 

Good, so I have submitted a slightly modified version of this patch
https://patchwork.kernel.org/patch/10756449/.

-- 
Remi

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Kernel segmentation fault unbinding eMMC on AML-S905X-CC
@ 2019-01-09 22:48 Elie Roudninski
  0 siblings, 0 replies; 4+ messages in thread
From: Elie Roudninski @ 2019-01-09 22:48 UTC (permalink / raw)
  To: linux-amlogic, linux-mmc

Hello everyone,

I am the owner of an AML-S905X-CC ARM board, also called "Le Potato"
with a full GNU/Linux system running on an SD card using kernel 4.20.
I also bought an eMMC 5.x module on loverpi:
https://www.loverpi.com/collections/libre-computer-project/products/libre-computer-board-emmc-5-x-module?variant=4173557729

I tried to use the eMMC module in order to put the system on it. Once
the system is booted from SD card, i plugged the eMMC module and tried
to detect it using the same command used by lc_redetect_emmc script
provided by libre computer:
> $ echo -n d0074000.mmc > /sys/bus/platform/drivers/meson-gx-mmc/unbind
> $ echo -n d0074000.mmc > /sys/bus/platform/drivers/meson-gx-mmc/bind

On the first command (the unbind) i get a kernel segfault:
------------------------------ 8< ---------------------------
[  443.872211] Unable to handle kernel paging request at virtual
address fffe0000138a03c8
[  443.874469] Mem abort info:
[  443.877228]   ESR = 0x96000044
[  443.880246]   Exception class = DABT (current EL), IL = 32 bits
[  443.886109]   SET = 0, FnV = 0
[  443.889128]   EA = 0, S1PTW = 0
[  443.892232] Data abort info:
[  443.895079]   ISV = 0, ISS = 0x00000044
[  443.898874]   CM = 0, WnR = 1
[  443.901807] [fffe0000138a03c8] address between user and kernel address ranges
[  443.908882] Internal error: Oops: 96000044 [#1] SMP
[  443.913711] Modules linked in: cfg80211 rfkill 8021q garp mrp stp
llc dw_hdmi_cec meson_dw_hdmi dw_hdmi meson_drm drm_kms_helper
dwmac_generic drm dwmac_meson8b stmmac_platform
drm_panel_orientation_quirks crc32_ce stmmac syscopyarea crct10dif_ce
sysfi
llrect sysimgblt ptp fb_sys_fops pps_core meson_ir rc_core meson_gxbb_wdt
[  443.942176] CPU: 0 PID: 467 Comm: bash Tainted: G        W
4.19.13_1 #1
[  443.949416] Hardware name: amlogic p212/p212, BIOS
2019.01-rc2-00176-gf97c49d6a2 01/02/2019
[  443.957699] pstate: 00400085 (nzcv daIf +PAN -UAO)
[  443.962450] pc : queued_spin_lock_slowpath+0x228/0x2d0
[  443.967533] lr : meson_mmc_irq+0x290/0x2a0
[  443.971583] sp : ffff00000fb0fa00
[  443.974860] x29: ffff00000fb0fa00 x28: ffff8000105ef118
[  443.980121] x27: ffff8000105ef118 x26: 0000000000000000
[  443.985382] x25: 0000000000000000 x24: ffff800010633728
[  443.990643] x23: 0000000000000013 x22: ffff800010633858
[  443.995905] x21: ffff800005fab800 x20: 000000006b6b6b6b
[  444.001166] x19: ffff800005fab820 x18: 0000000000000000
[  444.006427] x17: 0000000000000000 x16: 0000000000000000
[  444.011688] x15: ffffffffffffffff x14: 6d6d2e3030303437
[  444.016950] x13: ff00000000000000 x12: 0000000000000040
[  444.022211] x11: 0000000000000228 x10: 0000000000000020
[  444.027472] x9 : 0000000000000000 x8 : 0000000000040000
[  444.032734] x7 : ffff000009f24460 x6 : ffff80007fc7de80
[  444.037995] x5 : ffff000009f42518 x4 : ffff80007fc7de80
[  444.043256] x3 : ffff000009f236c8 x2 : ffff00000995de80
[  444.048517] x1 : ffff00000995deb0 x0 : ffff80007fc7de88
[  444.053781] Process bash (pid: 467, stack limit = 0x0000000086539f6f)
[  444.060161] Call trace:
[  444.062580]  queued_spin_lock_slowpath+0x228/0x2d0
[  444.067322]  meson_mmc_irq+0x290/0x2a0
[  444.071032]  __free_irq+0x184/0x318
[  444.074480]  free_irq+0x40/0x80
[  444.077586]  devm_irq_release+0x24/0x30
[  444.081382]  release_nodes+0x1e0/0x2e0
[  444.085089]  devres_release_all+0x60/0x88
[  444.089057]  device_release_driver_internal+0x1c8/0x248
[  444.094231]  device_release_driver+0x28/0x38
[  444.098459]  unbind_store+0xdc/0x148
[  444.101994]  drv_attr_store+0x40/0x58
[  444.105627]  sysfs_kf_write+0x5c/0x78
[  444.109240]  kernfs_fop_write+0xe8/0x1e0
[  444.113126]  __vfs_write+0x60/0x190
[  444.116570]  vfs_write+0xac/0x1b0
[  444.119848]  ksys_write+0x6c/0xd0
[  444.123125]  __arm64_sys_write+0x24/0x30
[  444.127015]  el0_svc_common+0x94/0xe8
[  444.130629]  el0_svc_handler+0x38/0x80
[  444.134340]  el0_svc+0x8/0xc
[  444.137187] Code: d37c0401 910020c0 8b010041 f865d8e5 (f8256826)
[  444.143223] ---[ end trace 62541ec2ffe020f2 ]---
Segmentation fault
------------------------------ 8< ---------------------------

I also tried this patch https://patchwork.kernel.org/cover/10739097/
as advised by narmstrong without any luck.
I also tried only removing the "non-removable" property also without luck.

With or without those patches, when i plug the eMMC nothing happened,
nothing in dmesg or any mmc device appearing in /dev

It must also be noted that the eMMC is shipped with a system that work
properly so some working code must exist somewhere :)

Regards,

Elie

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <5c3744c0.1c69fb81.93dc1.2aff@mx.google.com>
2019-01-10 14:08 ` Kernel segmentation fault unbinding eMMC on AML-S905X-CC Remi Pommarel
2019-01-10 16:43   ` Elie Roudninski
2019-01-10 18:42     ` Remi Pommarel
2019-01-09 22:48 Elie Roudninski

Linux-Amlogic Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-amlogic/0 linux-amlogic/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-amlogic linux-amlogic/ https://lore.kernel.org/linux-amlogic \
		linux-amlogic@lists.infradead.org linux-amlogic@archiver.kernel.org
	public-inbox-index linux-amlogic


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-amlogic


AGPL code for this site: git clone https://public-inbox.org/ public-inbox