mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
ANDROID: PCI/PM: Use usleep_range for d3hot_delay
This patch implements a vendor hook that changes d3hot_delay to use usleep_range() instead of msleep() to reduce the resume time from 20ms to 10ms. The call sequence is as follows: pci_pm_resume_noirq() pci_pm_default_resume_early() pci_power_up() pci_raw_set_power_state() --> msleep(10) The default d3hot_delay is 10ms. Using msleep for delays less than 20ms could result in delays up to 20ms. Reference: Documentation/timers/timers-howto.rst Using usleep_range() results in the delay being closer to 10ms and this reduces the resume time. Bug: 194231641 Change-Id: If3e4dcfb99edad302371273933fa6784854cf892 Signed-off-by: Sajid Dalvi <sdalvi@google.com>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
609fa1be7a
commit
53ff5efb2c
@@ -74,6 +74,7 @@
|
|||||||
#include <trace/hooks/sound.h>
|
#include <trace/hooks/sound.h>
|
||||||
#include <trace/hooks/snd_compr.h>
|
#include <trace/hooks/snd_compr.h>
|
||||||
#include <trace/hooks/gup.h>
|
#include <trace/hooks/gup.h>
|
||||||
|
#include <trace/hooks/pci.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Export tracepoints that act as a bare tracehook (ie: have no trace event
|
* Export tracepoints that act as a bare tracehook (ie: have no trace event
|
||||||
@@ -395,3 +396,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_load_avg);
|
|||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_remove_entity_load_avg);
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_remove_entity_load_avg);
|
||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_blocked_fair);
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_blocked_fair);
|
||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_rt_rq_load_avg);
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_rt_rq_load_avg);
|
||||||
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_pci_d3_sleep);
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
#include <linux/vmalloc.h>
|
#include <linux/vmalloc.h>
|
||||||
#include <asm/dma.h>
|
#include <asm/dma.h>
|
||||||
#include <linux/aer.h>
|
#include <linux/aer.h>
|
||||||
|
#include <trace/hooks/pci.h>
|
||||||
#include "pci.h"
|
#include "pci.h"
|
||||||
|
|
||||||
DEFINE_MUTEX(pci_slot_mutex);
|
DEFINE_MUTEX(pci_slot_mutex);
|
||||||
@@ -68,8 +69,11 @@ static void pci_dev_d3_sleep(struct pci_dev *dev)
|
|||||||
if (delay < pci_pm_d3hot_delay)
|
if (delay < pci_pm_d3hot_delay)
|
||||||
delay = pci_pm_d3hot_delay;
|
delay = pci_pm_d3hot_delay;
|
||||||
|
|
||||||
if (delay)
|
if (delay) {
|
||||||
msleep(delay);
|
trace_android_rvh_pci_d3_sleep(dev, &delay);
|
||||||
|
if (delay)
|
||||||
|
msleep(delay);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PCI_DOMAINS
|
#ifdef CONFIG_PCI_DOMAINS
|
||||||
|
|||||||
21
include/trace/hooks/pci.h
Normal file
21
include/trace/hooks/pci.h
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/* SPDX-License-Identifier: GPL-2.0 */
|
||||||
|
#undef TRACE_SYSTEM
|
||||||
|
#define TRACE_SYSTEM pci
|
||||||
|
#define TRACE_INCLUDE_PATH trace/hooks
|
||||||
|
|
||||||
|
#if !defined(_TRACE_HOOK_PCI_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||||
|
#define _TRACE_HOOK_PCI_H
|
||||||
|
#include <trace/hooks/vendor_hooks.h>
|
||||||
|
/*
|
||||||
|
* Following tracepoints are not exported in tracefs and provide a
|
||||||
|
* mechanism for vendor modules to hook and extend functionality
|
||||||
|
*/
|
||||||
|
|
||||||
|
DECLARE_RESTRICTED_HOOK(android_rvh_pci_d3_sleep,
|
||||||
|
TP_PROTO(struct pci_dev *dev, unsigned int *delay),
|
||||||
|
TP_ARGS(dev, delay), 1);
|
||||||
|
|
||||||
|
#endif /* _TRACE_HOOK_PCI_H */
|
||||||
|
|
||||||
|
/* This part must be outside protection */
|
||||||
|
#include <trace/define_trace.h>
|
||||||
Reference in New Issue
Block a user