mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jason-JH Lin (林睿祥)" <Jason-JH.Lin@mediatek.com>
To: "jassisinghbrar@gmail.com" <jassisinghbrar@gmail.com>,
	"angelogioacchino.delregno@collabora.com"
	<angelogioacchino.delregno@collabora.com>,
	"chunkuang.hu@kernel.org" <chunkuang.hu@kernel.org>
Cc: "linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"Nancy Lin (林欣螢)" <Nancy.Lin@mediatek.com>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Singo Chang (張興國)" <Singo.Chang@mediatek.com>,
	Project_Global_Chrome_Upstream_Group
	<Project_Global_Chrome_Upstream_Group@mediatek.com>
Subject: Re: [PATCH] mailbox: mtk-cmdq: Add unregister mailbox controller in cmdq_remove()
Date: Wed, 19 Jun 2024 16:06:02 +0000	[thread overview]
Message-ID: <1bfddfa4c7afed4af6a461780304e1f0e37d8471.camel@mediatek.com> (raw)
In-Reply-To: <a681e496-4979-4f4a-9f79-9636d9496fa3@collabora.com>

Hi Angelo,

[snip]

> > I found that the series of "Move pm_runimte_get and put to
> > mbox_chan_ops API" can not fix this unbind crash issue.
> > 
> > It seems they are 2 different issues.
> > 
> > So I think calling devm_mbox_controller_unregister() in
> > cmdq_remove()
> > can ensure the CMDQ device is not removed and be paired to
> > cmdq_probe().
> > 
> 
> Can you please paste the stack trace of that warning that you're
> seeing when
> calling cmdq_remove()?
> 
I added dump_stack() to the first line of cmdq_remove() and reproduced
the crash issue.

Here is the log:
[  191.058651] CPU: 4 PID: 4408 Comm: bash Not tainted 6.6.32-02970-g5212e5e959db-dirty #1 ba5ec8409e01b005e537787edcf4515f18ba6ad7[  191.070213] Hardware name: Google Rauru board (DT)
[  191.074997] Call trace:
[  191.077435]  dump_backtrace+0xe8/0x110
[  191.081184]  show_stack+0x1c/0x40
[  191.084494]  dump_stack_lvl+0x80/0xa8
[  191.088155]  dump_stack+0x14/0x28
[  191.091466]  cmdq_remove+0x1c/0x60
[  191.094867]  platform_remove+0x3c/0x78
[  191.098616]  device_remove+0x4c/0x78
[  191.102188]  device_release_driver_internal+0xc4/0x140
[  191.107320]  device_driver_detach+0x1c/0x30
[  191.111498]  unbind_store+0x74/0xc0
[  191.114980]  drv_attr_store+0x28/0x40
[  191.118635]  sysfs_kf_write+0x40/0x58
[  191.122293]  kernfs_fop_write_iter+0xf0/0x190
[  191.126644]  vfs_write+0x234/0x320
[  191.130046]  ksys_write+0x7c/0xf0
[  191.133357]  __arm64_sys_write+0x20/0x30
[  191.137277]  invoke_syscall+0x70/0xf8
[  191.140939]  el0_svc_common+0x8c/0xf0
[  191.144598]  do_el0_svc+0x24/0x38
[  191.147911]  el0_svc+0x34/0x98
[  191.150964]  el0t_64_sync_handler+0x40/0xe8
[  191.155144]  el0t_64_sync+0x180/0x188
[  191.158975] ------------[ cut here ]------------
[  191.163584] WARNING: CPU: 4 PID: 4408 at drivers/mailbox/mtk-cmdq-
mailbox.c:534 cmdq_mbox_shutdown+0x190/0x1b0
[  191.173583] Modules linked in: dm_integrity async_xor xor xor_neon
async_tx lz4 lz4_compress zstd zstd_compress zram zsmalloc uinput
rfcomm veth fuse uvcvideo videobuf2_vmalloc uvc mediatek_cpufreq_hw
mtk_jpeg videobuf2_dma_contig videobuf2_memops mtk_jpeg_enc_hw
mtk_jpeg_dec_hw v4l2_mem2mem videobuf2_v4l2 videobuf2_common
ip6table_nat xt_MASQUERADE xt_cgroup 8021q mt7921e mt7921_common
mt792x_lib mt76_connac_lib mt76 mac80211 ax88796b iio_trig_sysfs
algif_hash algif_skcipher cros_ec_light_prox cros_ec_sensors af_alg
cros_ec_sensors_core cfg80211 industrialio_triggered_buffer kfifo_buf
asix phylink cros_ec_sensorhub usbnet mii btusb btmtk btbcm btintel
btrtl bluetooth ecdh_generic ecc joydev
[  191.234890] CPU: 4 PID: 4408 Comm: bash Not tainted 6.6.32-02970-
g5212e5e959db-dirty #1 ba5ec8409e01b005e537787edcf4515f18ba6ad7
[  191.246442] Hardware name: Google Rauru board (DT)
[  191.251225] pstate: 23400009 (nzCv daif +PAN -UAO +TCO +DIT -SSBS
BTYPE=--)
[  191.258178] pc : cmdq_mbox_shutdown+0x190/0x1b0
[  191.262707] lr : cmdq_mbox_shutdown+0x4c/0x1b0
[  191.267148] sp : ffffffc086f73a70
[  191.270456] x29: ffffffc086f73a90 x28: ffffff80f9282e80 x27:
0000000000000000
[  191.277586] x26: 0000000000000000 x25: 0000000000000000 x24:
0000000000000000
[  191.284716] x23: ffffff808089c800 x22: ffffffd6426d11c7 x21:
0000000000000000
[  191.291845] x20: ffffff808089c880 x19: ffffff80802d7480 x18:
00000000000001b7
[  191.298975] x17: 000000000000000e x16: 00000000000001b7 x15:
0000000000000004
[  191.306104] x14: fffffffffffffffe x13: 0000000000080800 x12:
0000000000000001
[  191.313234] x11: 00000000fffffff3 x10: dead000000000122 x9 :
0000000100000000
[  191.320363] x8 : 0000000100000000 x7 : 7f7f7f7f7f7f7f7f x6 :
fefefefefefefeff
[  191.327493] x5 : 0000000000000008 x4 : ffffffd64268784d x3 :
ffffff8083fa09c0
[  191.334621] x2 : ffffffd6426d11c7 x1 : 0000000000000000 x0 :
00000000fffffff3
[  191.341749] Call trace:
[  191.344189]  cmdq_mbox_shutdown+0x190/0x1b0
[  191.348370]  mbox_free_channel+0x40/0xa8
[  191.352290]  mbox_controller_unregister+0x8c/0xe0
[  191.356991]  __devm_mbox_controller_unregister+0x18/0x28
[  191.362300]  release_nodes+0x5c/0x90
[  191.365875]  devres_release_all+0x8c/0xd8
[  191.369883]  device_unbind_cleanup+0x1c/0x70
[  191.374146]  device_release_driver_internal+0xe4/0x140
[  191.379277]  device_driver_detach+0x1c/0x30
[  191.383454]  unbind_store+0x74/0xc0
[  191.386937]  drv_attr_store+0x28/0x40
[  191.390593]  sysfs_kf_write+0x40/0x58
[  191.394249]  kernfs_fop_write_iter+0xf0/0x190
[  191.398599]  vfs_write+0x234/0x320
[  191.401999]  ksys_write+0x7c/0xf0
[  191.405311]  __arm64_sys_write+0x20/0x30
[  191.409231]  invoke_syscall+0x70/0xf8
[  191.412892]  el0_svc_common+0x8c/0xf0
[  191.416552]  do_el0_svc+0x24/0x38
[  191.419865]  el0_svc+0x34/0x98
[  191.422916]  el0t_64_sync_handler+0x40/0xe8
[  191.427097]  el0t_64_sync+0x180/0x188
[  191.430751] ---[ end trace 0000000000000000 ]---

Regards,
Jason-JH Lin

> I'm not convinced that this is the best solution - it might be, but I
> have
> a hunch that there might be a better way to address this issue.
> 
> Thanks!
> Angelo

  reply	other threads:[~2024-06-19 16:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-13 15:06 Jason-JH.Lin
2024-06-13 15:10 ` AngeloGioacchino Del Regno
2024-06-13 16:53   ` Jason-JH Lin (林睿祥)
2024-06-18  3:28     ` Jason-JH Lin (林睿祥)
2024-06-18 11:47       ` AngeloGioacchino Del Regno
2024-06-19 16:06         ` Jason-JH Lin (林睿祥) [this message]
2024-07-17  3:44         ` Jason-JH Lin (林睿祥)
2024-07-17 13:28           ` AngeloGioacchino Del Regno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1bfddfa4c7afed4af6a461780304e1f0e37d8471.camel@mediatek.com \
    --to=jason-jh.lin@mediatek.com \
    --cc=Nancy.Lin@mediatek.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=Singo.Chang@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=chunkuang.hu@kernel.org \
    --cc=jassisinghbrar@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®