From: Andreas Helbech Kleist <andreaskleist@gmail.com>
To: bingbu.cao@intel.com, linux-media@vger.kernel.org,
sakari.ailus@linux.intel.com, laurent.pinchart@ideasonboard.com,
andriy.shevchenko@linux.intel.com, hdegoede@redhat.com
Cc: ilpo.jarvinen@linux.intel.com, claus.stovgaard@gmail.com,
tomi.valkeinen@ideasonboard.com, tfiga@chromium.org,
senozhatsky@chromium.org, bingbu.cao@linux.intel.com,
tian.shu.qiu@intel.com, hongju.wang@intel.com
Subject: Re: [PATCH v3 10/17] media: intel/ipu6: add input system driver
Date: Wed, 07 Feb 2024 10:36:15 +0100 [thread overview]
Message-ID: <f3fe18c6857982d8ff862566bc7d6511225d9193.camel@gmail.com> (raw)
In-Reply-To: <20240111065531.2418836-11-bingbu.cao@intel.com>
Hi Bingbu,
Thank you for the patch series, I haven't had a chance to look at v3 in
detail yet, so this is just a small comment from my testing on v2 +
IPU4 hacks, which I can see is also here in v3.
On Thu, 2024-01-11 at 14:55 +0800, bingbu.cao@intel.com wrote:
> From: Bingbu Cao <bingbu.cao@intel.com>
>
> Input system driver do basic isys hardware setup and irq handling
> and work with fwnode and v4l2 to register the ISYS v4l2 devices.
>
> Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> drivers/media/pci/intel/ipu6/ipu6-isys.c | 1353 ++++++++++++++++++++++
> drivers/media/pci/intel/ipu6/ipu6-isys.h | 207 ++++
> 2 files changed, 1560 insertions(+)
> create mode 100644 drivers/media/pci/intel/ipu6/ipu6-isys.c
> create mode 100644 drivers/media/pci/intel/ipu6/ipu6-isys.h
>
> diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys.c b/drivers/media/pci/intel/ipu6/ipu6-isys.c
...
> +static void isys_unregister_devices(struct ipu6_isys *isys)
> +{
> + isys_unregister_video_devices(isys);
> + isys_csi2_unregister_subdevices(isys);
> + v4l2_device_unregister(&isys->v4l2_dev);
> + media_device_unregister(&isys->media_dev);
> + media_device_cleanup(&isys->media_dev);
> +}
...
> +static void isys_remove(struct auxiliary_device *auxdev)
> +{
> + struct ipu6_bus_device *adev = auxdev_to_adev(auxdev);
> + struct ipu6_isys *isys = dev_get_drvdata(&auxdev->dev);
> + struct ipu6_device *isp = adev->isp;
> + struct isys_fw_msgs *fwmsg, *safe;
> + unsigned int i;
> +
> + list_for_each_entry_safe(fwmsg, safe, &isys->framebuflist, head)
> + dma_free_attrs(&auxdev->dev, sizeof(struct isys_fw_msgs),
> + fwmsg, fwmsg->dma_addr, 0);
> +
> + list_for_each_entry_safe(fwmsg, safe, &isys->framebuflist_fw, head)
> + dma_free_attrs(&auxdev->dev, sizeof(struct isys_fw_msgs),
> + fwmsg, fwmsg->dma_addr, 0);
I experienced a crash in ipu6_get_fw_msg_buf when unbinding the PCI
driver while streaming.
It happens because the above two lists are still used at this point. I
believe it is safe to free the fw msgs after the
isys_unregister_devices(isys) call below.
> +
> + isys_unregister_devices(isys);
> + isys_notifier_cleanup(isys);
> +
> + cpu_latency_qos_remove_request(&isys->pm_qos);
> +
> + if (!isp->secure_mode) {
> + ipu6_cpd_free_pkg_dir(adev);
> + ipu6_buttress_unmap_fw_image(adev, &adev->fw_sgt);
> + release_firmware(adev->fw);
> + }
> +
> + for (i = 0; i < IPU6_ISYS_MAX_STREAMS; i++)
> + mutex_destroy(&isys->streams[i].mutex);
> +
> + isys_iwake_watermark_cleanup(isys);
> + mutex_destroy(&isys->stream_mutex);
> + mutex_destroy(&isys->mutex);
> +}
/Andreas
next prev parent reply other threads:[~2024-02-07 9:36 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-11 6:55 [PATCH v3 00/15] Intel IPU6 and IPU6 input system drivers bingbu.cao
2024-01-11 6:55 ` [PATCH v3 01/17] media: intel/ipu6: add Intel IPU6 PCI device driver bingbu.cao
2024-01-15 13:36 ` Hans de Goede
2024-01-15 13:45 ` Sakari Ailus
2024-01-11 6:55 ` [PATCH v3 02/17] media: intel/ipu6: add IPU auxiliary devices bingbu.cao
2024-01-11 6:55 ` [PATCH v3 03/17] media: intel/ipu6: add IPU6 buttress interface driver bingbu.cao
2024-01-11 6:55 ` [PATCH v3 04/17] media: intel/ipu6: CPD parsing for get firmware components bingbu.cao
2024-01-11 6:55 ` [PATCH v3 05/17] media: intel/ipu6: add IPU6 DMA mapping API and MMU table bingbu.cao
2024-01-11 6:55 ` [PATCH v3 06/17] media: intel/ipu6: add syscom interfaces between firmware and driver bingbu.cao
2024-01-11 6:55 ` [PATCH v3 07/17] media: intel/ipu6: input system ABI " bingbu.cao
2024-01-15 12:17 ` Sakari Ailus
2024-01-11 6:55 ` [PATCH v3 08/17] media: intel/ipu6: add IPU6 CSI2 receiver v4l2 sub-device bingbu.cao
2024-01-11 6:55 ` [PATCH v3 09/17] media: intel/ipu6: add the CSI2 DPHY implementation bingbu.cao
2024-01-11 6:55 ` [PATCH v3 10/17] media: intel/ipu6: add input system driver bingbu.cao
2024-01-11 14:05 ` Sakari Ailus
2024-02-07 9:36 ` Andreas Helbech Kleist [this message]
2024-02-12 18:31 ` Sakari Ailus
2024-02-15 6:43 ` Andreas Helbech Kleist
2024-02-15 8:06 ` Sakari Ailus
2024-01-11 6:55 ` [PATCH v3 11/17] media: intel/ipu6: input system video capture nodes bingbu.cao
2024-03-08 9:58 ` Andreas Helbech Kleist
2024-01-11 6:55 ` [PATCH v3 12/17] media: add Kconfig and Makefile for IPU6 bingbu.cao
2024-01-11 6:55 ` [PATCH v3 13/17] MAINTAINERS: add maintainers for Intel IPU6 input system driver bingbu.cao
2024-01-11 6:55 ` [PATCH v3 14/17] Documentation: add Intel IPU6 ISYS driver admin-guide doc bingbu.cao
2024-01-11 6:55 ` [PATCH v3 15/17] Documentation: add documentation of Intel IPU6 driver and hardware overview bingbu.cao
2024-01-11 6:55 ` [PATCH v3 16/17] media: ipu6/isys: support line-based metadata capture support bingbu.cao
2024-01-11 12:52 ` Sakari Ailus
2024-01-11 21:20 ` kernel test robot
2024-01-12 3:31 ` kernel test robot
2024-01-11 6:55 ` [PATCH v3 17/17] media: ipu6/isys: support new v4l2 subdev state APIs bingbu.cao
2024-01-11 12:37 ` Sakari Ailus
2024-01-16 16:12 ` [PATCH v3 00/15] Intel IPU6 and IPU6 input system drivers Hans de Goede
2024-01-16 16:18 ` Laurent Pinchart
2024-01-16 16:38 ` Hans de Goede
2024-01-16 16:42 ` Laurent Pinchart
2024-01-16 16:43 ` Hans de Goede
2024-01-16 16:54 ` Sakari Ailus
2024-01-16 16:57 ` Hans de Goede
2024-01-16 17:48 ` Laurent Pinchart
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=f3fe18c6857982d8ff862566bc7d6511225d9193.camel@gmail.com \
--to=andreaskleist@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bingbu.cao@intel.com \
--cc=bingbu.cao@linux.intel.com \
--cc=claus.stovgaard@gmail.com \
--cc=hdegoede@redhat.com \
--cc=hongju.wang@intel.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=senozhatsky@chromium.org \
--cc=tfiga@chromium.org \
--cc=tian.shu.qiu@intel.com \
--cc=tomi.valkeinen@ideasonboard.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