linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ming Qian <ming.qian@nxp.com>
To: Nicolas Dufresne <nicolas@ndufresne.ca>,
	"mchehab@kernel.org" <mchehab@kernel.org>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>
Cc: "hverkuil-cisco@xs4all.nl" <hverkuil-cisco@xs4all.nl>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	dl-linux-imx <linux-imx@nxp.com>,
	Aisheng Dong <aisheng.dong@nxp.com>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: RE: [EXT] Re: [PATCH v9 04/13] media: amphion: add vpu core driver
Date: Fri, 24 Sep 2021 01:52:00 +0000	[thread overview]
Message-ID: <AM6PR04MB6341B2AAA269B1FC2FD191ACE7A49@AM6PR04MB6341.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <d49c5a614fb80f1a7f073e398db72c0d8b63c32b.camel@ndufresne.ca>

> -----Original Message-----
> From: Nicolas Dufresne [mailto:nicolas@ndufresne.ca]
> Sent: Thursday, September 23, 2021 10:27 PM
> To: Ming Qian <ming.qian@nxp.com>; mchehab@kernel.org;
> shawnguo@kernel.org; robh+dt@kernel.org; s.hauer@pengutronix.de
> Cc: hverkuil-cisco@xs4all.nl; kernel@pengutronix.de; festevam@gmail.com;
> dl-linux-imx <linux-imx@nxp.com>; Aisheng Dong <aisheng.dong@nxp.com>;
> linux-media@vger.kernel.org; linux-kernel@vger.kernel.org;
> devicetree@vger.kernel.org; linux-arm-kernel@lists.infradead.org
> Subject: [EXT] Re: [PATCH v9 04/13] media: amphion: add vpu core driver
> 
> Caution: EXT Email
> 
> Le lundi 13 septembre 2021 à 17:11 +0800, Ming Qian a écrit :
> > The vpu supports encoder and decoder.
> > it needs mu core to handle it.
> > core will run either encoder or decoder firmware.
> >
> > This driver is for support the vpu core.
> >
> > Signed-off-by: Ming Qian <ming.qian@nxp.com>
> > Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
> > Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
> > ---
> >  drivers/media/platform/amphion/vpu_codec.h |  68 ++
> >  drivers/media/platform/amphion/vpu_core.c  | 901
> +++++++++++++++++++++
> >  drivers/media/platform/amphion/vpu_core.h  |  16 +
> >  drivers/media/platform/amphion/vpu_dbg.c   | 496 ++++++++++++
> >  drivers/media/platform/amphion/vpu_log.h   |  44 +
> >  drivers/media/platform/amphion/vpu_rpc.c   | 263 ++++++
> >  drivers/media/platform/amphion/vpu_rpc.h   | 463 +++++++++++
> >  7 files changed, 2251 insertions(+)
> >  create mode 100644 drivers/media/platform/amphion/vpu_codec.h
> >  create mode 100644 drivers/media/platform/amphion/vpu_core.c
> >  create mode 100644 drivers/media/platform/amphion/vpu_core.h
> >  create mode 100644 drivers/media/platform/amphion/vpu_dbg.c
> >  create mode 100644 drivers/media/platform/amphion/vpu_log.h
> >  create mode 100644 drivers/media/platform/amphion/vpu_rpc.c
> >  create mode 100644 drivers/media/platform/amphion/vpu_rpc.h
> >
> > +static int vpu_core_remove(struct platform_device *pdev)
> > +{
> > +     struct device *dev = &pdev->dev;
> > +     struct vpu_core *core = platform_get_drvdata(pdev);
> > +     int ret;
> > +
> > +     vpu_core_remove_dbgfs_file(core);
> 
> This crash when the module us unloaded.
> 
> [ 1051.198290] Unable to handle kernel NULL pointer dereference at virtual
> address 00000000000000a0
> [ 1051.207653] Mem abort info:
> [ 1051.222130]   ESR = 0x96000004
> [ 1051.227543]   EC = 0x25: DABT (current EL), IL = 32 bits
> [ 1051.233354]   SET = 0, FnV = 0
> [ 1051.236604]   EA = 0, S1PTW = 0
> [ 1051.239837]   FSC = 0x04: level 0 translation fault
> [ 1051.245175] Data abort info:
> [ 1051.248480]   ISV = 0, ISS = 0x00000004
> [ 1051.253606]   CM = 0, WnR = 0
> [ 1051.257039] user pgtable: 4k pages, 48-bit VAs, pgdp=00000008826b4000
> [ 1051.271756] [00000000000000a0] pgd=0000000000000000,
> p4d=0000000000000000
> [ 1051.286908] Internal error: Oops: 96000004 [#1] PREEMPT SMP
> [ 1051.292536] Modules linked in: amphion_vpu_core(-) v4l2_mem2mem
> videobuf2_vmalloc videobuf2_dma_contig videobuf2_memops videobuf2_v4l2
> videobuf2_common crct10dif_ce imx_sc_wdt imx_sc_thermal imx_sc_key
> rtc_imx_sc
> fsl_imx8_ddr_perf mpl3115 industrialio_triggered_buffer kfifo_buf isl29018
> videodev mc drm fuse ip_tables x_tables ipv6 [last unloaded:
> amphion_vpu_dev]
> [ 1051.324856] CPU: 0 PID: 491 Comm: rmmod Not tainted
> 5.15.0-rc2-imx8qxp+ #2
> [ 1051.331748] Hardware name: Freescale i.MX8QXP MEK (DT)
> [ 1051.336898] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS
> BTYPE=--)
> [ 1051.343875] pc : down_read_interruptible+0xec/0x200
> [ 1051.348772] lr : simple_recursive_removal+0x4c/0x29c
> [ 1051.353752] sp : ffff80001302bbd0
> [ 1051.357069] x29: ffff80001302bbd0 x28: ffff0008073d2300 x27:
> ffff0008073d2358
> [ 1051.364229] x26: 0000000000000000 x25: 00000000000000a0 x24:
> 0000000000000000
> [ 1051.371387] x23: ffff000800145090 x22: 0000000000000000 x21:
> ffff80001258ed3c
> [ 1051.378545] x20: ffff80001258ed40 x19: ffff0008073d2300 x18:
> ffff800012573f54
> [ 1051.385704] x17: 0000000000000000 x16: 000000000000000d x15:
> 0000104ca19aff10
> [ 1051.392863] x14: 00000000000000ad x13: 0000000000000001 x12:
> 0000000000000000
> [ 1051.400023] x11: 0000000000000000 x10: 0000000000000990 x9 :
> ffff80001302b860
> [ 1051.407179] x8 : 0101010101010101 x7 : 7f7f7f7f7f7f7f7f x6 :
> 000000000000126e
> [ 1051.414338] x5 : 0000000000000000 x4 : 0000000000000000 x3 :
> 00000000000000a0
> [ 1051.421496] x2 : 0000000000000001 x1 : 0000000000000000 x0 :
> 00000000000000a0
> [ 1051.428659] Call trace:
> [ 1051.431113]  down_read_interruptible+0xec/0x200
> [ 1051.435655]  debugfs_remove+0x5c/0x80
> [ 1051.439329]  vpu_core_remove_dbgfs_file+0x24/0x50
> [amphion_vpu_core]
> [ 1051.445734]  vpu_core_remove+0x24/0x150 [amphion_vpu_core]
> [ 1051.451261]  platform_remove+0x2c/0x60
> [ 1051.455028]  __device_release_driver+0x188/0x234
> [ 1051.459659]  driver_detach+0xc4/0x150
> [ 1051.463335]  bus_remove_driver+0x60/0xe0
> [ 1051.467270]  driver_unregister+0x34/0x64
> [ 1051.471204]  platform_driver_unregister+0x18/0x24
> [ 1051.475922]  amphion_vpu_core_driver_exit+0x20/0x2c
> [amphion_vpu_core]
> [ 1051.482494]  __arm64_sys_delete_module+0x194/0x25c
> [ 1051.487303]  invoke_syscall+0x48/0x114
> [ 1051.491063]  el0_svc_common.constprop.0+0x44/0xfc
> [ 1051.495781]  do_el0_svc+0x2c/0x94
> [ 1051.499107]  el0_svc+0x28/0x80
> [ 1051.502176]  el0t_64_sync_handler+0xa8/0x130
> [ 1051.506458]  el0t_64_sync+0x1a0/0x1a4
> [ 1051.510141] Code: c8047c62 35ffff84 17fffe63 f9800071 (c85ffc60)
> [ 1051.516247] ---[ end trace 38710d42422128dc ]---
> 
> 
I'm sorry that I didn't test the rmmod in recent version, I'll fix it in the next version.
> 
> 
> > +     ret = pm_runtime_get_sync(dev);
> > +     WARN_ON(ret < 0);
> > +
> > +     vpu_core_shutdown(core);
> > +     pm_runtime_put_sync(dev);
> > +     pm_runtime_disable(dev);
> > +
> > +     vpu_core_unregister(core->parent, core);
> > +     iounmap(core->fw.virt);
> > +     iounmap(core->rpc.virt);
> > +     mutex_destroy(&core->lock);
> > +     mutex_destroy(&core->cmd_lock);
> > +
> > +     return 0;
> > +}
> > +


  reply	other threads:[~2021-09-24  1:52 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13  9:11 [PATCH v9 00/13] amphion video decoder/encoder driver Ming Qian
2021-09-13  9:11 ` [PATCH v9 01/13] dt-bindings: media: amphion: add amphion video codec bindings Ming Qian
2021-09-13  9:11 ` [PATCH v9 02/13] media:Add nt8 and nt10 video format Ming Qian
2021-09-13  9:11 ` [PATCH v9 03/13] media: amphion: add amphion vpu device driver Ming Qian
2021-09-13  9:11 ` [PATCH v9 04/13] media: amphion: add vpu core driver Ming Qian
2021-09-22 13:10   ` Nicolas Dufresne
2021-09-23 10:32     ` [EXT] " Ming Qian
2021-09-23 14:27   ` Nicolas Dufresne
2021-09-24  1:52     ` Ming Qian [this message]
2021-09-13  9:11 ` [PATCH v9 05/13] media: amphion: implement vpu core communication based on mailbox Ming Qian
2021-09-13  9:11 ` [PATCH v9 06/13] media: amphion: add vpu v4l2 m2m support Ming Qian
2021-09-23 14:39   ` Nicolas Dufresne
2021-09-24  1:58     ` [EXT] " Ming Qian
2021-09-13  9:11 ` [PATCH v9 07/13] media: amphion: add v4l2 m2m vpu encoder stateful driver Ming Qian
2021-09-23 14:22   ` Nicolas Dufresne
2021-09-24  1:47     ` [EXT] " Ming Qian
2021-09-13  9:11 ` [PATCH v9 08/13] media: amphion: add v4l2 m2m vpu decoder " Ming Qian
2021-09-13  9:11 ` [PATCH v9 09/13] media: amphion: implement windsor encoder rpc interface Ming Qian
2021-09-13  9:11 ` [PATCH v9 10/13] media: amphion: implement malone decoder " Ming Qian
2021-09-13  9:11 ` [PATCH v9 11/13] ARM64: dts: freescale: imx8q: add imx vpu codec entries Ming Qian
2021-09-22 12:55   ` Nicolas Dufresne
2021-09-23 10:31     ` [EXT] " Ming Qian
2021-09-23 13:27       ` Nicolas Dufresne
2021-09-13  9:11 ` [PATCH v9 12/13] firmware: imx: scu-pd: imx8q: add vpu mu resources Ming Qian
2021-09-13  9:11 ` [PATCH v9 13/13] MAINTAINERS: add AMPHION VPU CODEC V4L2 driver entry Ming Qian
2021-09-22 14:13 ` [PATCH v9 00/13] amphion video decoder/encoder driver Nicolas Dufresne
2021-09-23 10:45   ` [EXT] " Ming Qian
2021-09-23 13:33     ` Nicolas Dufresne
2021-09-24  1:43       ` Ming Qian
2021-10-11  9:12       ` Hans Verkuil

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=AM6PR04MB6341B2AAA269B1FC2FD191ACE7A49@AM6PR04MB6341.eurprd04.prod.outlook.com \
    --to=ming.qian@nxp.com \
    --cc=aisheng.dong@nxp.com \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=nicolas@ndufresne.ca \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).