From: Alexander Shishkin <alexander.shishkin@linux.intel.com>
To: Greg KH <greg@kroah.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>,
Chunyan Zhang <zhang.chunyan@linaro.org>,
laurent.fert@intel.com, yann.fouassier@intel.com,
linux-kernel@vger.kernel.org,
Alexander Shishkin <alexander.shishkin@linux.intel.com>
Subject: [QUEUED v20160420 18/19] intel_th: msu: Release resources on removal
Date: Wed, 20 Apr 2016 13:43:31 +0300 [thread overview]
Message-ID: <1461149012-26954-19-git-send-email-alexander.shishkin@linux.intel.com> (raw)
In-Reply-To: <1461149012-26954-1-git-send-email-alexander.shishkin@linux.intel.com>
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
next prev parent reply other threads:[~2016-04-20 10:45 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-20 10:43 [QUEUED v20160420 00/19] stm class/intel_th: Patches in my queue Alexander Shishkin
2016-04-20 10:43 ` [QUEUED v20160420 01/19] MAINTAINERS: Add a git tree for the stm class Alexander Shishkin
2016-04-20 10:43 ` [QUEUED v20160420 02/19] stm class: Fix integer boundary checks for master range Alexander Shishkin
2016-04-20 10:43 ` [QUEUED v20160420 03/19] stm class: dummy_stm: Make nr_dummies parameter read-only Alexander Shishkin
2016-04-20 10:43 ` [QUEUED v20160420 04/19] stm class: stm_heartbeat: Make nr_devs " Alexander Shishkin
2016-04-20 10:43 ` [QUEUED v20160420 05/19] stm class: Remove a pointless line Alexander Shishkin
2016-04-20 10:43 ` [QUEUED v20160420 06/19] stm class: Do not leak the chrdev in error path Alexander Shishkin
2016-04-20 10:43 ` [QUEUED v20160420 07/19] stm class: Fix stm device initialization order Alexander Shishkin
2016-04-20 10:43 ` [QUEUED v20160420 08/19] stm class: Remove unnecessary pointer increment Alexander Shishkin
2016-04-20 10:43 ` [QUEUED v20160420 09/19] intel_th: pti: Do remove sysfs group on device removal Alexander Shishkin
2016-04-20 10:43 ` [QUEUED v20160420 10/19] intel_th: msu: Handle kstrndup() failure Alexander Shishkin
2016-04-20 10:43 ` [QUEUED v20160420 11/19] intel_th: Allow subdevice drivers to bring in own attribute groups Alexander Shishkin
2016-04-20 10:43 ` [QUEUED v20160420 12/19] intel_th: msu: Create sysfs attributes using core driver's facility Alexander Shishkin
2016-04-20 10:43 ` [QUEUED v20160420 13/19] intel_th: pti: " Alexander Shishkin
2016-04-20 10:43 ` [QUEUED v20160420 14/19] intel_th: Fix activating a subdevice without a driver Alexander Shishkin
2016-04-20 10:43 ` [QUEUED v20160420 15/19] intel_th: msu: Serialize enabling/disabling Alexander Shishkin
2016-04-20 10:43 ` [QUEUED v20160420 16/19] intel_th: Hold output driver module reference while capture is active Alexander Shishkin
2016-04-20 10:43 ` [QUEUED v20160420 17/19] intel_th: msu: Set fops::owner to prevent module from unloading Alexander Shishkin
2016-04-20 10:43 ` Alexander Shishkin [this message]
2016-04-20 10:43 ` [QUEUED v20160420 19/19] intel_th: pci: Add Broxton-M SOC support Alexander Shishkin
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=1461149012-26954-19-git-send-email-alexander.shishkin@linux.intel.com \
--to=alexander.shishkin@linux.intel.com \
--cc=greg@kroah.com \
--cc=laurent.fert@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=yann.fouassier@intel.com \
--cc=zhang.chunyan@linaro.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
all inboxes | Powered by JetHome®