lkml.org 
[lkml]   [2012]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1 2/3] DCA, x86: restart DCA operations in unregister_dca_provider()
Date
When deregistering a DCA device, function unregister_dca_provider() will
notify clients by DCA_PROVIDER_REMOVE to stop DCA operations at beginning.
Currently DCA operations won't be restarted by unregister_dca_provider()
even if there are still DCA devices left. This may cause trouble to systems
with multiple DCA devices/IOHs. So restart DCA operations if there are
still DCA devices left after removing a DCA device.

Signed-off-by: Jiang Liu <liuj97@gmail.com>
---
drivers/dca/dca-core.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/dca/dca-core.c b/drivers/dca/dca-core.c
index 075c4bd..f8cfa58 100644
--- a/drivers/dca/dca-core.c
+++ b/drivers/dca/dca-core.c
@@ -414,6 +414,7 @@ void unregister_dca_provider(struct dca_provider *dca, struct device *dev)
unsigned long flags;
struct pci_bus *pci_rc;
struct dca_domain *domain;
+ bool restart = false;

blocking_notifier_call_chain(&dca_provider_chain,
DCA_PROVIDER_REMOVE, NULL);
@@ -427,9 +428,20 @@ void unregister_dca_provider(struct dca_provider *dca, struct device *dev)
if (list_empty(&domain->dca_providers))
dca_free_domain(domain);

+ if (!list_empty(&dca_domains))
+ restart = true;
+
raw_spin_unlock_irqrestore(&dca_lock, flags);

dca_sysfs_remove_provider(dca);
+
+ /*
+ * Notify DCA clients to restart DCA operations if there are still
+ * DCA devices left.
+ */
+ if (restart)
+ blocking_notifier_call_chain(&dca_provider_chain,
+ DCA_PROVIDER_ADD, NULL);
}
EXPORT_SYMBOL_GPL(unregister_dca_provider);

--
1.7.5.4


\
 
 \ /
  Last update: 2012-04-23 16:41    [W:0.032 / U:14.328 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site