Hi,
This series fixes a memory leak (first patch) and does some cleanups to
the OPP core.
It is based of pm/bleeding-edge branch. Though not compulsory, but it
would be nice to get queued up for 4.10, of course once they are
reviewed by other OPP guys.
This series is tested for few days by various build and boot bots:
- Kernel CI (Linaro)
- Fengguang Wu's bot (Intel)
--
viresh
Viresh Kumar (10):
PM / OPP: Fix memory leak while adding duplicate OPPs
PM / OPP: Remove useless TODO
PM / OPP: Rename _allocate_opp() to _opp_allocate()
PM / OPP: Error out on failing to add static OPPs for v1 bindings
PM / OPP: Add light weight _opp_free() routine
PM / OPP: Rename and split _dev_pm_opp_remove_table()
PM / OPP: Don't allocate OPP table from _opp_allocate()
PM / OPP: Rename dev_pm_opp_get_suspend_opp() and return OPP rate
PM / OPP: Don't expose srcu_head to register notifiers
PM / OPP: Split out part of _add_opp_table() and _remove_opp_table()
drivers/base/power/opp/core.c | 290 ++++++++++++++++++++++++++----------------
drivers/base/power/opp/of.c | 90 +++++++------
drivers/base/power/opp/opp.h | 11 +-
drivers/cpufreq/cpufreq-dt.c | 7 +-
drivers/devfreq/devfreq.c | 26 +---
include/linux/pm_opp.h | 20 ++-
6 files changed, 249 insertions(+), 195 deletions(-)
--
2.7.1.410.g6faf27b
Hi,
This series fixes a memory leak (first patch) and does some cleanups to
the OPP core.
It is based of pm/bleeding-edge branch.
This series is tested for few days by various build and boot bots:
- Kernel CI (Linaro)
- Fengguang Wu's bot (Intel)
V1->V2:
- 6 out of 10 patches have received Acks from Stephen/MyungJoo.
- dev_pm_opp_get_suspend_opp_freq() return freq in Hz now
- s/opp_table/table in _opp_allocate()
- Improved comment over _opp_add() defining its return types
- opp_rcu_lockdep_assert() added at few places
- Dropped a useless comment
--
viresh
Viresh Kumar (10):
PM / OPP: Fix memory leak while adding duplicate OPPs
PM / OPP: Remove useless TODO
PM / OPP: Rename _allocate_opp() to _opp_allocate()
PM / OPP: Error out on failing to add static OPPs for v1 bindings
PM / OPP: Add light weight _opp_free() routine
PM / OPP: Rename and split _dev_pm_opp_remove_table()
PM / OPP: Don't allocate OPP table from _opp_allocate()
PM / OPP: Rename dev_pm_opp_get_suspend_opp() and return OPP rate
PM / OPP: Don't expose srcu_head to register notifiers
PM / OPP: Split out part of _add_opp_table() and _remove_opp_table()
drivers/base/power/opp/core.c | 294 ++++++++++++++++++++++++++----------------
drivers/base/power/opp/of.c | 89 +++++++------
drivers/base/power/opp/opp.h | 11 +-
drivers/cpufreq/cpufreq-dt.c | 7 +-
drivers/devfreq/devfreq.c | 26 +---
include/linux/pm_opp.h | 20 ++-
6 files changed, 254 insertions(+), 193 deletions(-)
--
2.7.1.410.g6faf27b
Current there is both "EXTCON_USB" and "EXTCON_CHG_USB_SDP" which
both seem to suggest a standard downstream port. But there is no
documentation describing how these relate.
Thus add documentation to describe EXTCON_CHG_USB_SDP should always
appear together with EXTCON_USB, and EXTCON_CHG_USB_ACA would normally
appear with EXTCON_USB_HOST.
Signed-off-by: Baolin Wang <baolin.wang(a)linaro.org>
---
include/linux/extcon.h | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/include/linux/extcon.h b/include/linux/extcon.h
index b871c0c..6498b05 100644
--- a/include/linux/extcon.h
+++ b/include/linux/extcon.h
@@ -46,7 +46,14 @@
#define EXTCON_USB 1
#define EXTCON_USB_HOST 2
-/* Charging external connector */
+/*
+ * Charging external connector
+ *
+ * When one SDP charger connector was reported, we should also report
+ * the USB connector, which means EXTCON_CHG_USB_SDP should always
+ * appear together with EXTCON_USB. The same as ACA charger connector,
+ * EXTCON_CHG_USB_ACA should always appear with EXTCON_USB_HOST.
+ */
#define EXTCON_CHG_USB_SDP 5 /* Standard Downstream Port */
#define EXTCON_CHG_USB_DCP 6 /* Dedicated Charging Port */
#define EXTCON_CHG_USB_CDP 7 /* Charging Downstream Port */
--
1.7.9.5
If a command event is found on the event ring during an interrupt,
we need to stop the command timer with del_timer(). Since del_timer()
can fail if the timer is running and waiting on the xHCI lock, then
it maybe get the wrong timeout command in xhci_handle_command_timeout()
if host fetched a new command and updated the xhci->current_cmd in
handle_cmd_completion(). For this situation, we need a way to signal
to the command timer that everything is fine and it should exit.
We should check if the command timer is pending in xhci_handle_command_timeout()
function, if the command timer is pending, which means current timeout
command has been handled by host and host has fetched new command and
re-added the command timer, then just return and wait for new current
command. If not, it means current command is timeout and need to be
handled.
Signed-off-by: Baolin Wang <baolin.wang(a)linaro.org>
---
Changes since v1:
- Remove the counter and just check if the command timer is pending.
---
drivers/usb/host/xhci-ring.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 9965a4c..3947344 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1269,7 +1269,7 @@ void xhci_handle_command_timeout(unsigned long data)
xhci = (struct xhci_hcd *) data;
spin_lock_irqsave(&xhci->lock, flags);
- if (!xhci->current_cmd) {
+ if (!xhci->current_cmd || timer_pending(&xhci->cmd_timer)) {
spin_unlock_irqrestore(&xhci->lock, flags);
return;
}
--
1.7.9.5