mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-11 13:27:06 +09:00
Merge tag 'v4.9.207' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into odroidg12-4.9.y
This is the 4.9.207 stable release
This commit is contained in:
@@ -77,7 +77,7 @@ static inline bool has_acpi_companion(struct device *dev)
|
||||
static inline void acpi_preset_companion(struct device *dev,
|
||||
struct acpi_device *parent, u64 addr)
|
||||
{
|
||||
ACPI_COMPANION_SET(dev, acpi_find_child_device(parent, addr, NULL));
|
||||
ACPI_COMPANION_SET(dev, acpi_find_child_device(parent, addr, false));
|
||||
}
|
||||
|
||||
static inline const char *acpi_dev_name(struct acpi_device *adev)
|
||||
|
||||
@@ -107,7 +107,7 @@ static __inline__ struct elapaarp *aarp_hdr(struct sk_buff *skb)
|
||||
#define AARP_RESOLVE_TIME (10 * HZ)
|
||||
|
||||
extern struct datalink_proto *ddp_dl, *aarp_dl;
|
||||
extern void aarp_proto_init(void);
|
||||
extern int aarp_proto_init(void);
|
||||
|
||||
/* Inter module exports */
|
||||
|
||||
|
||||
@@ -618,8 +618,7 @@ static inline unsigned int dma_get_max_seg_size(struct device *dev)
|
||||
return SZ_64K;
|
||||
}
|
||||
|
||||
static inline unsigned int dma_set_max_seg_size(struct device *dev,
|
||||
unsigned int size)
|
||||
static inline int dma_set_max_seg_size(struct device *dev, unsigned int size)
|
||||
{
|
||||
if (dev->dma_parms) {
|
||||
dev->dma_parms->max_segment_size = size;
|
||||
|
||||
@@ -1560,7 +1560,7 @@ static inline int jbd2_space_needed(journal_t *journal)
|
||||
static inline unsigned long jbd2_log_space_left(journal_t *journal)
|
||||
{
|
||||
/* Allow for rounding errors */
|
||||
unsigned long free = journal->j_free - 32;
|
||||
long free = journal->j_free - 32;
|
||||
|
||||
if (journal->j_committing_transaction) {
|
||||
unsigned long committing = atomic_read(&journal->
|
||||
@@ -1569,7 +1569,7 @@ static inline unsigned long jbd2_log_space_left(journal_t *journal)
|
||||
/* Transaction + control blocks */
|
||||
free -= committing + (committing >> JBD2_CONTROL_BLOCKS_SHIFT);
|
||||
}
|
||||
return free;
|
||||
return max_t(long, free, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -392,7 +392,7 @@ static inline struct device_node *mtd_get_of_node(struct mtd_info *mtd)
|
||||
return mtd->dev.of_node;
|
||||
}
|
||||
|
||||
static inline int mtd_oobavail(struct mtd_info *mtd, struct mtd_oob_ops *ops)
|
||||
static inline u32 mtd_oobavail(struct mtd_info *mtd, struct mtd_oob_ops *ops)
|
||||
{
|
||||
return ops->mode == MTD_OPS_AUTO_OOB ? mtd->oobavail : mtd->oobsize;
|
||||
}
|
||||
|
||||
@@ -1730,6 +1730,11 @@ struct net_device {
|
||||
unsigned char if_port;
|
||||
unsigned char dma;
|
||||
|
||||
/* Note : dev->mtu is often read without holding a lock.
|
||||
* Writers usually hold RTNL.
|
||||
* It is recommended to use READ_ONCE() to annotate the reads,
|
||||
* and to use WRITE_ONCE() to annotate the writes.
|
||||
*/
|
||||
unsigned int mtu;
|
||||
unsigned short type;
|
||||
unsigned short hard_header_len;
|
||||
|
||||
@@ -54,6 +54,16 @@ static inline struct dquot *dqgrab(struct dquot *dquot)
|
||||
atomic_inc(&dquot->dq_count);
|
||||
return dquot;
|
||||
}
|
||||
|
||||
static inline bool dquot_is_busy(struct dquot *dquot)
|
||||
{
|
||||
if (test_bit(DQ_MOD_B, &dquot->dq_flags))
|
||||
return true;
|
||||
if (atomic_read(&dquot->dq_count) > 1)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void dqput(struct dquot *dquot);
|
||||
int dquot_scan_active(struct super_block *sb,
|
||||
int (*fn)(struct dquot *dquot, unsigned long priv),
|
||||
|
||||
@@ -479,7 +479,7 @@ static inline unsigned int regulator_get_mode(struct regulator *regulator)
|
||||
|
||||
static inline int regulator_set_load(struct regulator *regulator, int load_uA)
|
||||
{
|
||||
return REGULATOR_MODE_NORMAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int regulator_allow_bypass(struct regulator *regulator,
|
||||
|
||||
@@ -162,6 +162,7 @@ struct uart_port {
|
||||
struct console *cons; /* struct console, if any */
|
||||
#if defined(CONFIG_SERIAL_CORE_CONSOLE) || defined(SUPPORT_SYSRQ)
|
||||
unsigned long sysrq; /* sysrq timeout */
|
||||
unsigned int sysrq_ch; /* char for sysrq */
|
||||
#endif
|
||||
|
||||
/* flags must be updated while holding port mutex */
|
||||
@@ -476,8 +477,42 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
static inline int
|
||||
uart_prepare_sysrq_char(struct uart_port *port, unsigned int ch)
|
||||
{
|
||||
if (port->sysrq) {
|
||||
if (ch && time_before(jiffies, port->sysrq)) {
|
||||
port->sysrq_ch = ch;
|
||||
port->sysrq = 0;
|
||||
return 1;
|
||||
}
|
||||
port->sysrq = 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
static inline void
|
||||
uart_unlock_and_check_sysrq(struct uart_port *port, unsigned long irqflags)
|
||||
{
|
||||
int sysrq_ch;
|
||||
|
||||
sysrq_ch = port->sysrq_ch;
|
||||
port->sysrq_ch = 0;
|
||||
|
||||
spin_unlock_irqrestore(&port->lock, irqflags);
|
||||
|
||||
if (sysrq_ch)
|
||||
handle_sysrq(sysrq_ch);
|
||||
}
|
||||
#else
|
||||
#define uart_handle_sysrq_char(port,ch) ({ (void)port; 0; })
|
||||
static inline int
|
||||
uart_handle_sysrq_char(struct uart_port *port, unsigned int ch) { return 0; }
|
||||
static inline int
|
||||
uart_prepare_sysrq_char(struct uart_port *port, unsigned int ch) { return 0; }
|
||||
static inline void
|
||||
uart_unlock_and_check_sysrq(struct uart_port *port, unsigned long irqflags)
|
||||
{
|
||||
spin_unlock_irqrestore(&port->lock, irqflags);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
@@ -275,4 +275,16 @@ static __always_inline void timespec_add_ns(struct timespec *a, u64 ns)
|
||||
a->tv_nsec = ns;
|
||||
}
|
||||
|
||||
/**
|
||||
* time_between32 - check if a 32-bit timestamp is within a given time range
|
||||
* @t: the time which may be within [l,h]
|
||||
* @l: the lower bound of the range
|
||||
* @h: the higher bound of the range
|
||||
*
|
||||
* time_before32(t, l, h) returns true if @l <= @t <= @h. All operands are
|
||||
* treated as 32-bit integers.
|
||||
*
|
||||
* Equivalent to !(time_before32(@t, @l) || time_after32(@t, @h)).
|
||||
*/
|
||||
#define time_between32(t, l, h) ((u32)(h) - (u32)(l) >= (u32)(t) - (u32)(l))
|
||||
#endif
|
||||
|
||||
@@ -356,6 +356,7 @@ struct tty_file_private {
|
||||
#define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */
|
||||
#define TTY_HUPPED 18 /* Post driver->hangup() */
|
||||
#define TTY_HUPPING 19 /* Hangup in progress */
|
||||
#define TTY_LDISC_CHANGING 20 /* Change pending - non-block IO */
|
||||
#define TTY_LDISC_HALTED 22 /* Line discipline is halted */
|
||||
|
||||
/* Values for tty->flow_change */
|
||||
@@ -373,6 +374,12 @@ static inline void tty_set_flow_change(struct tty_struct *tty, int val)
|
||||
smp_mb();
|
||||
}
|
||||
|
||||
static inline bool tty_io_nonblock(struct tty_struct *tty, struct file *file)
|
||||
{
|
||||
return file->f_flags & O_NONBLOCK ||
|
||||
test_bit(TTY_LDISC_CHANGING, &tty->flags);
|
||||
}
|
||||
|
||||
static inline bool tty_io_error(struct tty_struct *tty)
|
||||
{
|
||||
return test_bit(TTY_IO_ERROR, &tty->flags);
|
||||
|
||||
@@ -138,7 +138,7 @@ do { \
|
||||
_FP_FRAC_ADDI_##wc(X, _FP_WORK_ROUND); \
|
||||
} while (0)
|
||||
|
||||
#define _FP_ROUND_ZERO(wc, X) 0
|
||||
#define _FP_ROUND_ZERO(wc, X) (void)0
|
||||
|
||||
#define _FP_ROUND_PINF(wc, X) \
|
||||
do { \
|
||||
|
||||
@@ -621,4 +621,9 @@ extern int sysctl_icmp_msgs_burst;
|
||||
int ip_misc_proc_init(void);
|
||||
#endif
|
||||
|
||||
static inline bool inetdev_valid_mtu(unsigned int mtu)
|
||||
{
|
||||
return likely(mtu >= IPV4_MIN_MTU);
|
||||
}
|
||||
|
||||
#endif /* _IP_H */
|
||||
|
||||
@@ -507,19 +507,27 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb);
|
||||
*/
|
||||
static inline void tcp_synq_overflow(const struct sock *sk)
|
||||
{
|
||||
unsigned long last_overflow = tcp_sk(sk)->rx_opt.ts_recent_stamp;
|
||||
unsigned long last_overflow = READ_ONCE(tcp_sk(sk)->rx_opt.ts_recent_stamp);
|
||||
unsigned long now = jiffies;
|
||||
|
||||
if (time_after(now, last_overflow + HZ))
|
||||
tcp_sk(sk)->rx_opt.ts_recent_stamp = now;
|
||||
if (!time_between32(now, last_overflow, last_overflow + HZ))
|
||||
WRITE_ONCE(tcp_sk(sk)->rx_opt.ts_recent_stamp, now);
|
||||
}
|
||||
|
||||
/* syncookies: no recent synqueue overflow on this listening socket? */
|
||||
static inline bool tcp_synq_no_recent_overflow(const struct sock *sk)
|
||||
{
|
||||
unsigned long last_overflow = tcp_sk(sk)->rx_opt.ts_recent_stamp;
|
||||
unsigned long last_overflow = READ_ONCE(tcp_sk(sk)->rx_opt.ts_recent_stamp);
|
||||
|
||||
return time_after(jiffies, last_overflow + TCP_SYNCOOKIE_VALID);
|
||||
/* If last_overflow <= jiffies <= last_overflow + TCP_SYNCOOKIE_VALID,
|
||||
* then we're under synflood. However, we have to use
|
||||
* 'last_overflow - HZ' as lower bound. That's because a concurrent
|
||||
* tcp_synq_overflow() could update .ts_recent_stamp after we read
|
||||
* jiffies but before we store .ts_recent_stamp into last_overflow,
|
||||
* which could lead to rejecting a valid syncookie.
|
||||
*/
|
||||
return !time_between32(jiffies, last_overflow - HZ,
|
||||
last_overflow + TCP_SYNCOOKIE_VALID);
|
||||
}
|
||||
|
||||
static inline u32 tcp_cookie_time(void)
|
||||
|
||||
Reference in New Issue
Block a user