No conflicts.
Showing the changes to include (8 of 342 files). Show all
Unified · Split
| @@ -20,6 +20,7 @@ · 19 unmodified lines | ||
| 20 | 20 | */ |
| 21 | 21 | |
| 22 | 22 | #include <linux/math.h> |
| 23 | +#include <linux/sched.h> | |
| 23 | 24 | |
| 24 | 25 | extern unsigned long loops_per_jiffy; |
| 25 | 26 | |
| @@ -58,7 +59,18 @@ void calibrate_delay(void); · 32 unmodified lines | ||
| 58 | 59 | void __attribute__((weak)) calibration_delay_done(void); |
| 59 | 60 | void msleep(unsigned int msecs); |
| 60 | 61 | unsigned long msleep_interruptible(unsigned int msecs); |
| 61 | −void usleep_range(unsigned long min, unsigned long max); | |
| 62 | +void usleep_range_state(unsigned long min, unsigned long max, | |
| 63 | + unsigned int state); | |
| 64 | + | |
| 65 | +static inline void usleep_range(unsigned long min, unsigned long max) | |
| 66 | +{ | |
| 67 | + usleep_range_state(min, max, TASK_UNINTERRUPTIBLE); | |
| 68 | +} | |
| 69 | + | |
| 70 | +static inline void usleep_idle_range(unsigned long min, unsigned long max) | |
| 71 | +{ | |
| 72 | + usleep_range_state(min, max, TASK_IDLE); | |
| 73 | +} | |
| 62 | 74 | |
| 63 | 75 | static inline void ssleep(unsigned int seconds) |
| 64 | 76 | { |
| @@ -663,6 +663,19 @@ int mhi_pm_suspend(struct mhi_controller *mhi_cntrl); · 662 unmodified lines | ||
| 663 | 663 | */ |
| 664 | 664 | int mhi_pm_resume(struct mhi_controller *mhi_cntrl); |
| 665 | 665 | |
| 666 | +/** | |
| 667 | + * mhi_pm_resume_force - Force resume MHI from suspended state | |
| 668 | + * @mhi_cntrl: MHI controller | |
| 669 | + * | |
| 670 | + * Resume the device irrespective of its MHI state. As per the MHI spec, devices | |
| 671 | + * has to be in M3 state during resume. But some devices seem to be in a | |
| 672 | + * different MHI state other than M3 but they continue working fine if allowed. | |
| 673 | + * This API is intented to be used for such devices. | |
| 674 | + * | |
| 675 | + * Return: 0 if the resume succeeds, a negative error code otherwise | |
| 676 | + */ | |
| 677 | +int mhi_pm_resume_force(struct mhi_controller *mhi_cntrl); | |
| 678 | + | |
| 666 | 679 | /** |
| 667 | 680 | * mhi_download_rddm_image - Download ramdump image from device for |
| 668 | 681 | * debugging purpose. |
| @@ -51,9 +51,9 @@ · 50 unmodified lines | ||
| 51 | 51 | #define _LINUX_PERCPU_REFCOUNT_H |
| 52 | 52 | |
| 53 | 53 | #include <linux/atomic.h> |
| 54 | −#include <linux/kernel.h> | |
| 55 | 54 | #include <linux/percpu.h> |
| 56 | 55 | #include <linux/rcupdate.h> |
| 56 | +#include <linux/types.h> | |
| 57 | 57 | #include <linux/gfp.h> |
| 58 | 58 | |
| 59 | 59 | struct percpu_ref; |
| @@ -129,7 +129,7 @@ static inline bool pm_runtime_suspended(struct device *dev) · 128 unmodified lines | ||
| 129 | 129 | * pm_runtime_active - Check whether or not a device is runtime-active. |
| 130 | 130 | * @dev: Target device. |
| 131 | 131 | * |
| 132 | − * Return %true if runtime PM is enabled for @dev and its runtime PM status is | |
| 132 | + * Return %true if runtime PM is disabled for @dev or its runtime PM status is | |
| 133 | 133 | * %RPM_ACTIVE, or %false otherwise. |
| 134 | 134 | * |
| 135 | 135 | * Note that the return value of this function can only be trusted if it is |
| @@ -217,6 +217,7 @@ void __wake_up_sync_key(struct wait_queue_head *wq_head, unsigned int mode, void · 216 unmodified lines | ||
| 217 | 217 | void __wake_up_locked_sync_key(struct wait_queue_head *wq_head, unsigned int mode, void *key); |
| 218 | 218 | void __wake_up_locked(struct wait_queue_head *wq_head, unsigned int mode, int nr); |
| 219 | 219 | void __wake_up_sync(struct wait_queue_head *wq_head, unsigned int mode); |
| 220 | +void __wake_up_pollfree(struct wait_queue_head *wq_head); | |
| 220 | 221 | |
| 221 | 222 | #define wake_up(x) __wake_up(x, TASK_NORMAL, 1, NULL) |
| 222 | 223 | #define wake_up_nr(x, nr) __wake_up(x, TASK_NORMAL, nr, NULL) |
| @@ -245,6 +246,31 @@ void __wake_up_sync(struct wait_queue_head *wq_head, unsigned int mode); · 22 unmodified lines | ||
| 245 | 246 | #define wake_up_interruptible_sync_poll_locked(x, m) \ |
| 246 | 247 | __wake_up_locked_sync_key((x), TASK_INTERRUPTIBLE, poll_to_key(m)) |
| 247 | 248 | |
| 249 | +/** | |
| 250 | + * wake_up_pollfree - signal that a polled waitqueue is going away | |
| 251 | + * @wq_head: the wait queue head | |
| 252 | + * | |
| 253 | + * In the very rare cases where a ->poll() implementation uses a waitqueue whose | |
| 254 | + * lifetime is tied to a task rather than to the 'struct file' being polled, | |
| 255 | + * this function must be called before the waitqueue is freed so that | |
| 256 | + * non-blocking polls (e.g. epoll) are notified that the queue is going away. | |
| 257 | + * | |
| 258 | + * The caller must also RCU-delay the freeing of the wait_queue_head, e.g. via | |
| 259 | + * an explicit synchronize_rcu() or call_rcu(), or via SLAB_TYPESAFE_BY_RCU. | |
| 260 | + */ | |
| 261 | +static inline void wake_up_pollfree(struct wait_queue_head *wq_head) | |
| 262 | +{ | |
| 263 | + /* | |
| 264 | + * For performance reasons, we don't always take the queue lock here. | |
| 265 | + * Therefore, we might race with someone removing the last entry from | |
| 266 | + * the queue, and proceed while they still hold the queue lock. | |
| 267 | + * However, rcu_read_lock() is required to be held in such cases, so we | |
| 268 | + * can safely proceed with an RCU-delayed free. | |
| 269 | + */ | |
| 270 | + if (waitqueue_active(wq_head)) | |
| 271 | + __wake_up_pollfree(wq_head); | |
| 272 | +} | |
| 273 | + | |
| 248 | 274 | #define ___wait_cond_timeout(condition) \ |
| 249 | 275 | ({ \ |
| 250 | 276 | bool __cond = (condition); \ |
| @@ -29,7 +29,7 @@ · 28 unmodified lines | ||
| 29 | 29 | #define POLLRDHUP 0x2000 |
| 30 | 30 | #endif |
| 31 | 31 | |
| 32 | −#define POLLFREE (__force __poll_t)0x4000 /* currently only for epoll */ | |
| 32 | +#define POLLFREE (__force __poll_t)0x4000 | |
| 33 | 33 | |
| 34 | 34 | #define POLL_BUSY_LOOP (__force __poll_t)0x8000 |
| 35 | 35 | |
| @@ -136,19 +136,21 @@ struct mptcp_info { · 135 unmodified lines | ||
| 136 | 136 | * MPTCP_EVENT_REMOVED: token, rem_id |
| 137 | 137 | * An address has been lost by the peer. |
| 138 | 138 | * |
| 139 | − * MPTCP_EVENT_SUB_ESTABLISHED: token, family, saddr4 | saddr6, | |
| 140 | − * daddr4 | daddr6, sport, dport, backup, | |
| 141 | − * if_idx [, error] | |
| 139 | + * MPTCP_EVENT_SUB_ESTABLISHED: token, family, loc_id, rem_id, | |
| 140 | + * saddr4 | saddr6, daddr4 | daddr6, sport, | |
| 141 | + * dport, backup, if_idx [, error] | |
| 142 | 142 | * A new subflow has been established. 'error' should not be set. |
| 143 | 143 | * |
| 144 | − * MPTCP_EVENT_SUB_CLOSED: token, family, saddr4 | saddr6, daddr4 | daddr6, | |
| 145 | − * sport, dport, backup, if_idx [, error] | |
| 144 | + * MPTCP_EVENT_SUB_CLOSED: token, family, loc_id, rem_id, saddr4 | saddr6, | |
| 145 | + * daddr4 | daddr6, sport, dport, backup, if_idx | |
| 146 | + * [, error] | |
| 146 | 147 | * A subflow has been closed. An error (copy of sk_err) could be set if an |
| 147 | 148 | * error has been detected for this subflow. |
| 148 | 149 | * |
| 149 | − * MPTCP_EVENT_SUB_PRIORITY: token, family, saddr4 | saddr6, daddr4 | daddr6, | |
| 150 | − * sport, dport, backup, if_idx [, error] | |
| 151 | − * The priority of a subflow has changed. 'error' should not be set. | |
| 150 | + * MPTCP_EVENT_SUB_PRIORITY: token, family, loc_id, rem_id, saddr4 | saddr6, | |
| 151 | + * daddr4 | daddr6, sport, dport, backup, if_idx | |
| 152 | + * [, error] | |
| 153 | + * The priority of a subflow has changed. 'error' should not be set. | |
| 152 | 154 | */ |
| 153 | 155 | enum mptcp_event_type { |
| 154 | 156 | MPTCP_EVENT_UNSPEC = 0, |
| @@ -66,10 +66,17 @@ struct rlimit64 { · 65 unmodified lines | ||
| 66 | 66 | #define _STK_LIM (8*1024*1024) |
| 67 | 67 | |
| 68 | 68 | /* |
| 69 | − * GPG2 wants 64kB of mlocked memory, to make sure pass phrases | |
| 70 | − * and other sensitive information are never written to disk. | |
| 69 | + * Limit the amount of locked memory by some sane default: | |
| 70 | + * root can always increase this limit if needed. | |
| 71 | + * | |
| 72 | + * The main use-cases are (1) preventing sensitive memory | |
| 73 | + * from being swapped; (2) real-time operations; (3) via | |
| 74 | + * IOURING_REGISTER_BUFFERS. | |
| 75 | + * | |
| 76 | + * The first two don't need much. The latter will take as | |
| 77 | + * much as it can get. 8MB is a reasonably sane default. | |
| 71 | 78 | */ |
| 72 | −#define MLOCK_LIMIT ((PAGE_SIZE > 64*1024) ? PAGE_SIZE : 64*1024) | |
| 79 | +#define MLOCK_LIMIT (8*1024*1024) | |
| 73 | 80 | |
| 74 | 81 | /* |
| 75 | 82 | * Due to binary compatibility, the actual resource numbers |