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


Groups > linux.kernel > #1383257 > unrolled thread

[QUEUED v20160420 18/19] intel_th: msu: Release resources on removal

Started byAlexander Shishkin <alexander.shishkin@linux.intel.com>
First post2016-04-20 12:50 +0200
Last post2016-04-20 12:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [QUEUED v20160420 18/19] intel_th: msu: Release resources on removal Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2016-04-20 12:50 +0200

#1383257 — [QUEUED v20160420 18/19] intel_th: msu: Release resources on removal

FromAlexander Shishkin <alexander.shishkin@linux.intel.com>
Date2016-04-20 12:50 +0200
Subject[QUEUED v20160420 18/19] intel_th: msu: Release resources on removal
Message-ID<rpXRM-6vx-15@gated-at.bofh.it>
Do release the resources when msu subdevice gets removed: stop the
capture if it is active (which is still possible even though the
module in pinned) and free the capture buffers.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: Laurent Fert <laurent.fert@intel.com>
---
 drivers/hwtracing/intel_th/msu.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/hwtracing/intel_th/msu.c b/drivers/hwtracing/intel_th/msu.c
index bcc3b47133..0974090abc 100644
--- a/drivers/hwtracing/intel_th/msu.c
+++ b/drivers/hwtracing/intel_th/msu.c
@@ -1492,6 +1492,18 @@ static int intel_th_msc_probe(struct intel_th_device *thdev)
 
 static void intel_th_msc_remove(struct intel_th_device *thdev)
 {
+	struct msc *msc = dev_get_drvdata(&thdev->dev);
+	int ret;
+
+	intel_th_msc_deactivate(thdev);
+
+	/*
+	 * Buffers should not be used at this point except if the
+	 * output character device is still open and the parent
+	 * device gets detached from its bus, which is a FIXME.
+	 */
+	ret = msc_buffer_free_unless_used(msc);
+	WARN_ON_ONCE(ret);
 }
 
 static struct intel_th_driver intel_th_msc_driver = {
-- 
2.8.0.rc3

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web