diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2019-09-19 23:47:01 -0700 |
|---|---|---|
| committer | Linux Build Service Account <lnxbuild@localhost> | 2019-09-19 23:47:01 -0700 |
| commit | d4009ffcd8674d76a77441c1edaefcb886668fb9 (patch) | |
| tree | 7b2ca75730e4f9de891b22efdbd5babf3e6381b1 /include | |
| parent | 88dccf7d633bf154097ee158ec19965bdc1cc429 (diff) | |
| parent | 36f663352d8e241b313ae19a94c5d30ea077e243 (diff) | |
Merge 36f663352d8e241b313ae19a94c5d30ea077e243 on remote branch
Change-Id: I65222b09858e0e72a2532954573a1d191882e6c3
Diffstat (limited to 'include')
32 files changed, 605 insertions, 94 deletions
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index 09aa521a0085..af2c3d4a6e6f 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h @@ -143,7 +143,7 @@ extern void warn_slowpath_null(const char *file, const int line); #endif #ifndef HAVE_ARCH_BUG_ON -#define BUG_ON(condition) do { if (condition) ; } while (0) +#define BUG_ON(condition) do { if (condition) BUG(); } while (0) #endif #ifndef HAVE_ARCH_WARN_ON diff --git a/include/asm-generic/getorder.h b/include/asm-generic/getorder.h index 65e4468ac53d..52fbf236a90e 100644 --- a/include/asm-generic/getorder.h +++ b/include/asm-generic/getorder.h @@ -6,24 +6,6 @@ #include <linux/compiler.h> #include <linux/log2.h> -/* - * Runtime evaluation of get_order() - */ -static inline __attribute_const__ -int __get_order(unsigned long size) -{ - int order; - - size--; - size >>= PAGE_SHIFT; -#if BITS_PER_LONG == 32 - order = fls(size); -#else - order = fls64(size); -#endif - return order; -} - /** * get_order - Determine the allocation order of a memory size * @size: The size for which to get the order @@ -42,19 +24,27 @@ int __get_order(unsigned long size) * to hold an object of the specified size. * * The result is undefined if the size is 0. - * - * This function may be used to initialise variables with compile time - * evaluations of constants. */ -#define get_order(n) \ -( \ - __builtin_constant_p(n) ? ( \ - ((n) == 0UL) ? BITS_PER_LONG - PAGE_SHIFT : \ - (((n) < (1UL << PAGE_SHIFT)) ? 0 : \ - ilog2((n) - 1) - PAGE_SHIFT + 1) \ - ) : \ - __get_order(n) \ -) +static inline __attribute_const__ int get_order(unsigned long size) +{ + if (__builtin_constant_p(size)) { + if (!size) + return BITS_PER_LONG - PAGE_SHIFT; + + if (size < (1UL << PAGE_SHIFT)) + return 0; + + return ilog2((size) - 1) - PAGE_SHIFT + 1; + } + + size--; + size >>= PAGE_SHIFT; +#if BITS_PER_LONG == 32 + return fls(size); +#else + return fls64(size); +#endif +} #endif /* __ASSEMBLY__ */ diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 3672893b275e..6a30f1e03aa9 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -226,7 +226,10 @@ void acpi_set_irq_model(enum acpi_irq_model_id model, #ifdef CONFIG_X86_IO_APIC extern int acpi_get_override_irq(u32 gsi, int *trigger, int *polarity); #else -#define acpi_get_override_irq(gsi, trigger, polarity) (-1) +static inline int acpi_get_override_irq(u32 gsi, int *trigger, int *polarity) +{ + return -1; +} #endif /* * This function undoes the effect of one call to acpi_register_gsi(). diff --git a/include/linux/ceph/buffer.h b/include/linux/ceph/buffer.h index 07ca15e76100..dada47a4360f 100644 --- a/include/linux/ceph/buffer.h +++ b/include/linux/ceph/buffer.h @@ -29,7 +29,8 @@ static inline struct ceph_buffer *ceph_buffer_get(struct ceph_buffer *b) static inline void ceph_buffer_put(struct ceph_buffer *b) { - kref_put(&b->kref, ceph_buffer_release); + if (b) + kref_put(&b->kref, ceph_buffer_release); } extern int ceph_decode_buffer(struct ceph_buffer **b, void **p, void *end); diff --git a/include/linux/coda.h b/include/linux/coda.h index d30209b9cef8..0ca0c83fdb1c 100644 --- a/include/linux/coda.h +++ b/include/linux/coda.h @@ -58,8 +58,7 @@ Mellon the rights to redistribute these changes without encumbrance. #ifndef _CODA_HEADER_ #define _CODA_HEADER_ -#if defined(__linux__) typedef unsigned long long u_quad_t; -#endif + #include <uapi/linux/coda.h> #endif diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h index 5b8721efa948..fe1466daf291 100644 --- a/include/linux/coda_psdev.h +++ b/include/linux/coda_psdev.h @@ -19,6 +19,17 @@ struct venus_comm { struct mutex vc_mutex; }; +/* messages between coda filesystem in kernel and Venus */ +struct upc_req { + struct list_head uc_chain; + caddr_t uc_data; + u_short uc_flags; + u_short uc_inSize; /* Size is at most 5000 bytes */ + u_short uc_outSize; + u_short uc_opcode; /* copied from data to save lookup */ + int uc_unique; + wait_queue_head_t uc_sleep; /* process' wait queue */ +}; static inline struct venus_comm *coda_vcp(struct super_block *sb) { diff --git a/include/linux/compiler.h b/include/linux/compiler.h index ed772311ec1f..5508011cc0c7 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -52,6 +52,22 @@ extern void __chk_io_ptr(const volatile void __iomem *); #ifdef __KERNEL__ +/* + * Minimal backport of compiler_attributes.h to add support for __copy + * to v4.9.y so that we can use it in init/exit_module to avoid + * -Werror=missing-attributes errors on GCC 9. + */ +#ifndef __has_attribute +# define __has_attribute(x) __GCC4_has_attribute_##x +# define __GCC4_has_attribute___copy__ 0 +#endif + +#if __has_attribute(__copy__) +# define __copy(symbol) __attribute__((__copy__(symbol))) +#else +# define __copy(symbol) +#endif + #ifdef __GNUC__ #include <linux/compiler-gcc.h> #endif diff --git a/include/linux/cred.h b/include/linux/cred.h index 9e120c92551b..d2db1da3036c 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h @@ -153,7 +153,11 @@ struct cred { struct user_struct *user; /* real user ID subscription */ struct user_namespace *user_ns; /* user_ns the caps and keyrings are relative to. */ struct group_info *group_info; /* supplementary groups for euid/fsgid */ - struct rcu_head rcu; /* RCU deletion hook */ + /* RCU deletion */ + union { + int non_rcu; /* Can we skip RCU deletion? */ + struct rcu_head rcu; /* RCU deletion hook */ + }; }; extern void __put_cred(struct cred *); @@ -251,6 +255,7 @@ static inline const struct cred *get_cred(const struct cred *cred) { struct cred *nonconst_cred = (struct cred *) cred; validate_creds(cred); + nonconst_cred->non_rcu = 0; return get_new_cred(nonconst_cred); } diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 638b324f0291..92ad08a29884 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h @@ -97,7 +97,7 @@ struct elevator_type struct module *elevator_owner; /* managed by elevator core */ - char icq_cache_name[ELV_NAME_MAX + 5]; /* elvname + "_io_cq" */ + char icq_cache_name[ELV_NAME_MAX + 6]; /* elvname + "_io_cq" */ struct list_head list; }; diff --git a/include/linux/fs.h b/include/linux/fs.h index 7493e807f073..66360a2f97bc 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -3141,4 +3141,7 @@ static inline bool dir_relax(struct inode *inode) extern bool path_noexec(const struct path *path); extern void inode_nohighmem(struct inode *inode); +int vfs_ioc_setflags_prepare(struct inode *inode, unsigned int oldflags, + unsigned int flags); + #endif /* _LINUX_FS_H */ diff --git a/include/linux/gpio.h b/include/linux/gpio.h index d12b5d566e4b..11555bd821b7 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h @@ -229,30 +229,6 @@ static inline int irq_to_gpio(unsigned irq) return -EINVAL; } -static inline int -gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, - unsigned int gpio_offset, unsigned int pin_offset, - unsigned int npins) -{ - WARN_ON(1); - return -EINVAL; -} - -static inline int -gpiochip_add_pingroup_range(struct gpio_chip *chip, - struct pinctrl_dev *pctldev, - unsigned int gpio_offset, const char *pin_group) -{ - WARN_ON(1); - return -EINVAL; -} - -static inline void -gpiochip_remove_pin_ranges(struct gpio_chip *chip) -{ - WARN_ON(1); -} - static inline int devm_gpio_request(struct device *dev, unsigned gpio, const char *label) { diff --git a/include/linux/hid.h b/include/linux/hid.h index 5f1e901353ed..d16de62231d3 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -378,7 +378,6 @@ struct hid_global { struct hid_local { unsigned usage[HID_MAX_USAGES]; /* usage array */ - u8 usage_size[HID_MAX_USAGES]; /* usage size array */ unsigned collection_index[HID_MAX_USAGES]; /* collection index array */ unsigned usage_index; unsigned usage_minimum; diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h index 63828a5870f1..e578f38480e5 100644 --- a/include/linux/if_pppox.h +++ b/include/linux/if_pppox.h @@ -105,6 +105,9 @@ extern int register_pppox_proto(int proto_num, const struct pppox_proto *pp); extern void unregister_pppox_proto(int proto_num); extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */ extern int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); +extern int pppox_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); + +#define PPPOEIOCSFWD32 _IOW(0xB1 ,0, compat_size_t) /* PPPoX socket states */ enum { diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 49648aa63ee3..2dff3db6e4f3 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -735,8 +735,8 @@ static inline int mmc_boot_partition_access(struct mmc_host *host) static inline bool mmc_card_and_host_support_async_int(struct mmc_host *host) { - return ((host->caps2 & MMC_CAP2_ASYNC_SDIO_IRQ_4BIT_MODE) && - (host->card->cccr.async_intr_sup)); + return (host->card && (host->caps2 & MMC_CAP2_ASYNC_SDIO_IRQ_4BIT_MODE) + && (host->card->cccr.async_intr_sup)); } static inline int mmc_host_uhs(struct mmc_host *host) diff --git a/include/linux/module.h b/include/linux/module.h index dfe5c2e25ba1..d237d0574179 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -127,13 +127,13 @@ extern void cleanup_module(void); #define module_init(initfn) \ static inline initcall_t __maybe_unused __inittest(void) \ { return initfn; } \ - int init_module(void) __attribute__((alias(#initfn))); + int init_module(void) __copy(initfn) __attribute__((alias(#initfn))); /* This is only required if you want to be unloadable. */ #define module_exit(exitfn) \ static inline exitcall_t __maybe_unused __exittest(void) \ { return exitfn; } \ - void cleanup_module(void) __attribute__((alias(#exitfn))); + void cleanup_module(void) __copy(exitfn) __attribute__((alias(#exitfn))); #endif diff --git a/include/linux/qcn_sdio_al.h b/include/linux/qcn_sdio_al.h new file mode 100644 index 000000000000..bee020b0ccb4 --- /dev/null +++ b/include/linux/qcn_sdio_al.h @@ -0,0 +1,296 @@ +/* Copyright (c) 2019 The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef _QCN_SDIO_AL_ +#define _QCN_SDIO_AL_ + + +/** + * ------------------------------------ + * ------- SDIO AL Interface ---------- + * ------------------------------------ + * + * This file contains the proposed SDIO AL (Abstraction Layer) interface. + * Terminologies: + * SDIO AL : SDIO host function-1 driver + * SDIO AL client: Clients of SDIO host function-1 driver. + * WLAN, QMI, DIAG etc. are possible clients. + * Remote SDIO client: SDIO client on device side which implements ADMA + * functionality as function-1 + */ + +enum sdio_al_dma_direction { + SDIO_AL_TX, + SDIO_AL_RX, +}; + +/** + * struct sdio_al_client_handle - unique handler to identify + * each SDIO AL (Abstraction Layer) client + * + * @id: unique id for each client + * @block_size: block size + * @func: pointer to sdio_func data structure, some clients may need this. + * @client_priv: This is client priv that can used by client driver. + */ +struct sdio_al_client_handle { + int id; + struct sdio_al_client_data *client_data; + unsigned int block_size; + struct sdio_func *func; + void *client_priv; +}; + +/** + * struct sdio_al_xfer_result - Completed buffer information + * + * @buf_addr: Address of data buffer + * + * @xfer_len: Transfer data length in bytes + * + * @xfer_status: status of transfer, 0 if successful, + * negative in case of error + */ +struct sdio_al_xfer_result { + void *buf_addr; + size_t xfer_len; + int xfer_status; +}; + +enum sdio_al_lpm_event { + LPM_ENTER, /* SDIO client will be put to LPM mode soon */ + LPM_EXIT, /* SDIO client has exited LPM mode */ +}; + +/** + * sdio_al_client_data - client data of sdio_al + * + * @name: client name, could be one of the following: + * "SDIO_AL_CLIENT_WLAN", + * "SDIO_AL_CLIENT_QMI", + * "SDIO_AL_CLIENT_DIAG", + * "SDIO_AL_CLIENT_TTY" + * + * @probe: This probe function is called by SDIO AL driver when it is ready for + * SDIO traffic. SDIO AL client must wait for this callback before + * initiating any transfer over SDIO transport layer. + * + * @remove: This remove function is called by SDIO AL driver when it isn't ready + * for SDIO traffic. SDIO AL client must stop issuing any transfers + * after getting this callback, ongoing transfers would be errored out + * by SDIO AL. + * + * @lpm_notify_cb: callback to notify SDIO AL clients about Low Power modes. + * + */ +struct sdio_al_client_data { + const char *name; + + int id; + + int mode; + + int (*probe)(struct sdio_al_client_handle *); + + int (*remove)(struct sdio_al_client_handle *); + + void (*lpm_notify_cb)(struct sdio_al_client_handle *, + enum sdio_al_lpm_event event); +}; + +/** + * sdio_al_channel_handle - channel handle of sdio_al + * + * @id: Channel id unique at the AL layer + * + * @client_data: Client to which this channel belongs + * + */ +struct sdio_al_channel_handle { + unsigned int channel_id; + + struct sdio_al_channel_data *channel_data; + void *priv; +}; + +/** + * sdio_al_channel_data - channel data of sdio_al + * + * @name: channel name, could be one of the following: + * "SDIO_AL_WLAN_CH0", + * "SDIO_AL_WLAN_CH1", + * "SDIO_AL_QMI_CH0", + * "SDIO_AL_DIAG_CH0", + * "SDIO_AL_TTY_CH0" + * + * @client_data: The client driver by which this channel is being claimed + * + * @ul_xfer_cb: UL/TX data transfer callback. + * SDIO AL client can queue request using sdio_al_queue_transfer() + * asynchronous API, once request is transported over SDIO + * transport, SDIO AL calls "ul_xfer_cb" to notify the transfer + complete. + * + * @dl_xfer_cb: DL/RX data transfer callback + * Once SDIO AL receives requested data from remote SDIO client + * then SDIO AL invokes "dl_xfer_cb" callback to notify the SDIO + * AL client. + * + * @dl_data_avail_cb: callback to notify SDIO AL client that it can read + * specified bytes of data from remote SDIO client, SDIO AL client + * is then expected call sdio_al_queue_transfer() to read the data. + * This is optional and if client doesn't provide this callback + * then SDIO AL would allocate the buffer and SDIO AL + * client would have to memcpy the buffer in dl_xfer_cb(). + * + */ +struct sdio_al_channel_data { + const char *name; + + struct sdio_al_client_data *client_data; + + void (*ul_xfer_cb)(struct sdio_al_channel_handle *, + struct sdio_al_xfer_result *, void *ctxt); + + void (*dl_xfer_cb)(struct sdio_al_channel_handle *, + struct sdio_al_xfer_result *, void *ctxt); + + void (*dl_data_avail_cb)(struct sdio_al_channel_handle *, + unsigned int len); + + void (*dl_meta_data_cb)(struct sdio_al_channel_handle *, + unsigned int data); +}; + +/** + * sdio_al_is_ready - API Check to know whether the al driver is ready + * This API can be used to deffer the probe incase of early execution. + * + * @return zero on success and negative value on error. + * + */ +int sdio_al_is_ready(void); + +/** + * sdio_al_register_client - register as client of sdio AL (function-1 driver) + * SDIO AL driver would allocate the unique instance of + * "struct sdio_al_client_handle" and returns to client. + * + * @client_data: pointer to SDIO AL client data (struct sdio_al_client_data) + * + * @return valid sdio_al_client_handler ptr on success, negative value on error. + * + */ +struct sdio_al_client_handle *sdio_al_register_client( + struct sdio_al_client_data *client_data); + +/** + * sdio_al_deregister_client - deregisters client from SDIO AL + * (function-1 driver) + * + * @handle: sdio_al client handler + * + */ +void sdio_al_deregister_client(struct sdio_al_client_handle *handle); + +/** + * sdio_al_register_channel - register a channel for a client of SDIO AL + * SDIO AL driver would allocate a unique instance of the "struct + * sdio_al_channel_handle" and returns to the client. + * + * @client_handle: The client to which the channel shall belong + * + * @channel_data: The channel data which contains the details of the channel + * + * @return valid channel handle in success error on success, error pointer on + * failure + */ +struct sdio_al_channel_handle *sdio_al_register_channel( + struct sdio_al_client_handle *client_handle, + struct sdio_al_channel_data *client_data); + +/** + * sdio_al_deregister_channel - deregister a channel for a client of SDIO AL + * + * @ch_handle: The channel handle which needs to deregistered + * + * @return none + */ +void sdio_al_deregister_channel(struct sdio_al_channel_handle *ch_handle); + + +/** + * sdio_al_queue_transfer_async - Queue asynchronous data transfer request + * All transfers are asynchronous transfers, SDIO AL will call + * ul_xfer_cb or dl_xfer_cb callback to nofity completion to SDIO AL client. + * + * @ch_handle: sdio_al channel handle + * + * @dir: Data direction (DMA_TO_DEVICE for TX, DMA_FROM_DEVICE for RX) + * + * @buf: Data buffer + * + * @len: Size in bytes + * + * @priority: set any non-zero value for higher priority, 0 for normal priority + * All SDIO AL clients except WLAN client is expected to use normal + * priority. + * + * @return 0 on success, non-zero in case of error + */ +int sdio_al_queue_transfer_async(struct sdio_al_channel_handle *handle, + enum sdio_al_dma_direction dir, + void *buf, size_t len, int priority, void *ctxt); + +/** + * sdio_al_queue_transfer - Queue synchronous data transfer request + * In constrast to asynchronous transfer API sdio_al_queue_transfer(), this + * API will completely the request synchronously. If there is no outstanding + * request at SDIO AL Layer, request will be immediately initiated on SDIO bus. + * + * @ch_handle: sdio_al channel handle + * + * @dir: Data direction (DMA_TO_DEVICE for TX, DMA_FROM_DEVICE for RX) + * + * @buf: Data buffer + * + * @len: Size in bytes + * + * @priority: set any non-zero value for higher priority, 0 for normal priority + * All SDIO AL clients except WLAN client is expected to use normal + * priority. + * + * @return 0 on success, non-zero in case of error + */ +int sdio_al_queue_transfer(struct sdio_al_channel_handle *ch_handle, + enum sdio_al_dma_direction dir, + void *buf, size_t len, int priority); + + +/** + * sdio_al_meta_transfer - Queue synchronous data transfer request + * In constrast to asynchronous transfer API sdio_al_queue_transfer(), this + * API will completely the request synchronously. If there is no outstanding + * request at SDIO AL Layer, request will be immediately initiated on SDIO bus. + * + * @ch_handle: sdio_al channel handle + * + * @data: Meta data to be transferred + * + * @return 0 on success, non-zero in case of error + */ +int sdio_al_meta_transfer(struct sdio_al_channel_handle *ch_handle, + unsigned int data, unsigned int trans); + +extern void qcn_sdio_client_probe_complete(int id); +int qcn_sdio_card_state(bool enable); +#endif /* _QCN_SDIO_AL_ */ diff --git a/include/linux/qdsp6v2/apr.h b/include/linux/qdsp6v2/apr.h index e7e2a53a70d7..d80320e74661 100644 --- a/include/linux/qdsp6v2/apr.h +++ b/include/linux/qdsp6v2/apr.h @@ -210,4 +210,6 @@ static inline int apr_end_rx_rt(void *handle) int apr_start_rx_rt(void *handle); int apr_end_rx_rt(void *handle); #endif +int apr_dummy_init(void); +void apr_dummy_exit(void); #endif diff --git a/include/linux/qdsp6v2/rtac.h b/include/linux/qdsp6v2/rtac.h index eeea0eb0a837..5bd0923fd72b 100644 --- a/include/linux/qdsp6v2/rtac.h +++ b/include/linux/qdsp6v2/rtac.h @@ -22,7 +22,7 @@ #define RTAC_CVS 1 #define RTAC_VOICE_MODES 2 -#define RTAC_MAX_ACTIVE_DEVICES 4 +#define RTAC_MAX_ACTIVE_DEVICES 6 #define RTAC_MAX_ACTIVE_POPP 8 #define DEFAULT_APP_TYPE 0x00011130 diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index addd03641e1a..0a93e9d1708e 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -852,7 +852,7 @@ static inline void rcu_preempt_sleep_check(void) * read-side critical sections may be preempted and they may also block, but * only when acquiring spinlocks that are subject to priority inheritance. */ -static inline void rcu_read_lock(void) +static __always_inline void rcu_read_lock(void) { __rcu_read_lock(); __acquire(RCU); diff --git a/include/linux/sched.h b/include/linux/sched.h index 2378cbf2612d..a05e1e82ecf3 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -2149,7 +2149,7 @@ extern int arch_task_struct_size __read_mostly; extern void task_numa_fault(int last_node, int node, int pages, int flags); extern pid_t task_numa_group_id(struct task_struct *p); extern void set_numabalancing_state(bool enabled); -extern void task_numa_free(struct task_struct *p); +extern void task_numa_free(struct task_struct *p, bool final); extern bool should_numa_migrate_memory(struct task_struct *p, struct page *page, int src_nid, int dst_cpu); #else @@ -2164,7 +2164,7 @@ static inline pid_t task_numa_group_id(struct task_struct *p) static inline void set_numabalancing_state(bool enabled) { } -static inline void task_numa_free(struct task_struct *p) +static inline void task_numa_free(struct task_struct *p, bool final) { } static inline bool should_numa_migrate_memory(struct task_struct *p, diff --git a/include/linux/siphash.h b/include/linux/siphash.h new file mode 100644 index 000000000000..bf21591a9e5e --- /dev/null +++ b/include/linux/siphash.h @@ -0,0 +1,145 @@ +/* Copyright (C) 2016 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. + * + * This file is provided under a dual BSD/GPLv2 license. + * + * SipHash: a fast short-input PRF + * https://131002.net/siphash/ + * + * This implementation is specifically for SipHash2-4 for a secure PRF + * and HalfSipHash1-3/SipHash1-3 for an insecure PRF only suitable for + * hashtables. + */ + +#ifndef _LINUX_SIPHASH_H +#define _LINUX_SIPHASH_H + +#include <linux/types.h> +#include <linux/kernel.h> + +#define SIPHASH_ALIGNMENT __alignof__(u64) +typedef struct { + u64 key[2]; +} siphash_key_t; + +static inline bool siphash_key_is_zero(const siphash_key_t *key) +{ + return !(key->key[0] | key->key[1]); +} + +u64 __siphash_aligned(const void *data, size_t len, const siphash_key_t *key); +#ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS +u64 __siphash_unaligned(const void *data, size_t len, const siphash_key_t *key); +#endif + +u64 siphash_1u64(const u64 a, const siphash_key_t *key); +u64 siphash_2u64(const u64 a, const u64 b, const siphash_key_t *key); +u64 siphash_3u64(const u64 a, const u64 b, const u64 c, + const siphash_key_t *key); +u64 siphash_4u64(const u64 a, const u64 b, const u64 c, const u64 d, + const siphash_key_t *key); +u64 siphash_1u32(const u32 a, const siphash_key_t *key); +u64 siphash_3u32(const u32 a, const u32 b, const u32 c, + const siphash_key_t *key); + +static inline u64 siphash_2u32(const u32 a, const u32 b, + const siphash_key_t *key) +{ + return siphash_1u64((u64)b << 32 | a, key); +} +static inline u64 siphash_4u32(const u32 a, const u32 b, const u32 c, + const u32 d, const siphash_key_t *key) +{ + return siphash_2u64((u64)b << 32 | a, (u64)d << 32 | c, key); +} + + +static inline u64 ___siphash_aligned(const __le64 *data, size_t len, + const siphash_key_t *key) +{ + if (__builtin_constant_p(len) && len == 4) + return siphash_1u32(le32_to_cpup((const __le32 *)data), key); + if (__builtin_constant_p(len) && len == 8) + return siphash_1u64(le64_to_cpu(data[0]), key); + if (__builtin_constant_p(len) && len == 16) + return siphash_2u64(le64_to_cpu(data[0]), le64_to_cpu(data[1]), + key); + if (__builtin_constant_p(len) && len == 24) + return siphash_3u64(le64_to_cpu(data[0]), le64_to_cpu(data[1]), + le64_to_cpu(data[2]), key); + if (__builtin_constant_p(len) && len == 32) + return siphash_4u64(le64_to_cpu(data[0]), le64_to_cpu(data[1]), + le64_to_cpu(data[2]), le64_to_cpu(data[3]), + key); + return __siphash_aligned(data, len, key); +} + +/** + * siphash - compute 64-bit siphash PRF value + * @data: buffer to hash + * @size: size of @data + * @key: the siphash key + */ +static inline u64 siphash(const void *data, size_t len, + const siphash_key_t *key) +{ +#ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS + if (!IS_ALIGNED((unsigned long)data, SIPHASH_ALIGNMENT)) + return __siphash_unaligned(data, len, key); +#endif + return ___siphash_aligned(data, len, key); +} + +#define HSIPHASH_ALIGNMENT __alignof__(unsigned long) +typedef struct { + unsigned long key[2]; +} hsiphash_key_t; + +u32 __hsiphash_aligned(const void *data, size_t len, + const hsiphash_key_t *key); +#ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS +u32 __hsiphash_unaligned(const void *data, size_t len, + const hsiphash_key_t *key); +#endif + +u32 hsiphash_1u32(const u32 a, const hsiphash_key_t *key); +u32 hsiphash_2u32(const u32 a, const u32 b, const hsiphash_key_t *key); +u32 hsiphash_3u32(const u32 a, const u32 b, const u32 c, + const hsiphash_key_t *key); +u32 hsiphash_4u32(const u32 a, const u32 b, const u32 c, const u32 d, + const hsiphash_key_t *key); + +static inline u32 ___hsiphash_aligned(const __le32 *data, size_t len, + const hsiphash_key_t *key) +{ + if (__builtin_constant_p(len) && len == 4) + return hsiphash_1u32(le32_to_cpu(data[0]), key); + if (__builtin_constant_p(len) && len == 8) + return hsiphash_2u32(le32_to_cpu(data[0]), le32_to_cpu(data[1]), + key); + if (__builtin_constant_p(len) && len == 12) + return hsiphash_3u32(le32_to_cpu(data[0]), le32_to_cpu(data[1]), + le32_to_cpu(data[2]), key); + if (__builtin_constant_p(len) && len == 16) + return hsiphash_4u32(le32_to_cpu(data[0]), le32_to_cpu(data[1]), + le32_to_cpu(data[2]), le32_to_cpu(data[3]), + key); + return __hsiphash_aligned(data, len, key); +} + +/** + * hsiphash - compute 32-bit hsiphash PRF value + * @data: buffer to hash + * @size: size of @data + * @key: the hsiphash key + */ +static inline u32 hsiphash(const void *data, size_t len, + const hsiphash_key_t *key) +{ +#ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS + if (!IS_ALIGNED((unsigned long)data, HSIPHASH_ALIGNMENT)) + return __hsiphash_unaligned(data, len, key); +#endif + return ___hsiphash_aligned(data, len, key); +} + +#endif /* _LINUX_SIPHASH_H */ diff --git a/include/net/cnss2.h b/include/net/cnss2.h index eb6908feb7ef..69b9e5d607ef 100644 --- a/include/net/cnss2.h +++ b/include/net/cnss2.h @@ -202,6 +202,11 @@ extern int cnss_self_recovery(struct device *dev, enum cnss_recovery_reason reason); extern int cnss_force_fw_assert(struct device *dev); extern int cnss_force_collect_rddm(struct device *dev); +extern int cnss_qmi_send_get(struct device *dev); +extern int cnss_qmi_send_put(struct device *dev); +extern int cnss_qmi_send(struct device *dev, int type, void *cmd, + int cmd_len, void *cb_ctx, + int (*cb)(void *ctx, void *event, int event_len)); extern void *cnss_get_virt_ramdump_mem(struct device *dev, unsigned long *size); extern int cnss_get_fw_files_for_target(struct device *dev, struct cnss_fw_files *pfw_files, diff --git a/include/net/ndisc.h b/include/net/ndisc.h index 2d8edaad29cb..da7ffc04ce0c 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h @@ -35,6 +35,7 @@ enum { ND_OPT_ROUTE_INFO = 24, /* RFC4191 */ ND_OPT_RDNSS = 25, /* RFC5006 */ ND_OPT_DNSSL = 31, /* RFC6106 */ + ND_OPT_CAPTIVE_PORTAL = 37, /* RFC7710 */ __ND_OPT_MAX }; diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index fde4068eec0b..636e9e11bd5f 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h @@ -297,6 +297,8 @@ struct nf_conn *nf_ct_tmpl_alloc(struct net *net, gfp_t flags); void nf_ct_tmpl_free(struct nf_conn *tmpl); +u32 nf_ct_get_id(const struct nf_conn *ct); + #define NF_CT_STAT_INC(net, count) __this_cpu_inc((net)->ct.stat->count) #define NF_CT_STAT_INC_ATOMIC(net, count) this_cpu_inc((net)->ct.stat->count) diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index 61c38f87ea07..e6f49f22e006 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h @@ -8,6 +8,7 @@ #include <linux/uidgid.h> #include <net/inet_frag.h> #include <linux/rcupdate.h> +#include <linux/siphash.h> struct tcpm_hash_bucket; struct ctl_table_header; @@ -109,5 +110,6 @@ struct netns_ipv4 { #endif #endif atomic_t rt_genid; + siphash_key_t ip_id_key; }; #endif diff --git a/include/net/tcp.h b/include/net/tcp.h index b9b5bc27b844..e06a10cf943e 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -1461,6 +1461,11 @@ struct sock *tcp_try_fastopen(struct sock *sk, struct sk_buff *skb, void tcp_fastopen_init_key_once(bool publish); #define TCP_FASTOPEN_KEY_LENGTH 16 +static inline void tcp_init_send_head(struct sock *sk) +{ + sk->sk_send_head = NULL; +} + /* Fastopen key context */ struct tcp_fastopen_context { struct crypto_cipher *tfm; @@ -1477,6 +1482,7 @@ static inline void tcp_write_queue_purge(struct sock *sk) sk_wmem_free_skb(sk, skb); sk_mem_reclaim(sk); tcp_clear_all_retrans_hints(tcp_sk(sk)); + tcp_init_send_head(sk); inet_csk(sk)->icsk_backoff = 0; } @@ -1538,9 +1544,25 @@ static inline void tcp_check_send_head(struct sock *sk, struct sk_buff *skb_unli tcp_sk(sk)->highest_sack = NULL; } -static inline void tcp_init_send_head(struct sock *sk) +static inline struct sk_buff *tcp_rtx_queue_head(const struct sock *sk) { - sk->sk_send_head = NULL; + struct sk_buff *skb = tcp_write_queue_head(sk); + + if (skb == tcp_send_head(sk)) + skb = NULL; + + return skb; +} + +static inline struct sk_buff *tcp_rtx_queue_tail(const struct sock *sk) +{ + struct sk_buff *skb = tcp_send_head(sk); + + /* empty retransmit queue, for example due to zero window */ + if (skb == tcp_write_queue_head(sk)) + return NULL; + + return skb ? tcp_write_queue_prev(sk, skb) : tcp_write_queue_tail(sk); } static inline void __tcp_add_write_queue_tail(struct sock *sk, struct sk_buff *skb) diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h index de7e3ee60f0c..e59180264591 100644 --- a/include/scsi/libfcoe.h +++ b/include/scsi/libfcoe.h @@ -236,6 +236,7 @@ struct fcoe_fcf { * @vn_mac: VN_Node assigned MAC address for data */ struct fcoe_rport { + struct fc_rport_priv rdata; unsigned long time; u16 fcoe_len; u16 flags; diff --git a/include/sound/compress_driver.h b/include/sound/compress_driver.h index f4241ca8fdb5..5bb9261ec103 100644 --- a/include/sound/compress_driver.h +++ b/include/sound/compress_driver.h @@ -184,10 +184,7 @@ static inline void snd_compr_drain_notify(struct snd_compr_stream *stream) if (snd_BUG_ON(!stream)) return; - if (stream->direction == SND_COMPRESS_PLAYBACK) - stream->runtime->state = SNDRV_PCM_STATE_SETUP; - else - stream->runtime->state = SNDRV_PCM_STATE_PREPARED; + stream->runtime->state = SNDRV_PCM_STATE_SETUP; wake_up(&stream->runtime->sleep); } diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h index e84cbb11fe7f..b6850fe5465f 100644 --- a/include/trace/events/f2fs.h +++ b/include/trace/events/f2fs.h @@ -1016,8 +1016,8 @@ DECLARE_EVENT_CLASS(f2fs__submit_page_bio, ), TP_fast_assign( - __entry->dev = page->mapping->host->i_sb->s_dev; - __entry->ino = page->mapping->host->i_ino; + __entry->dev = page_file_mapping(page)->host->i_sb->s_dev; + __entry->ino = page_file_mapping(page)->host->i_ino; __entry->index = page->index; __entry->old_blkaddr = fio->old_blkaddr; __entry->new_blkaddr = fio->new_blkaddr; @@ -1204,10 +1204,11 @@ DECLARE_EVENT_CLASS(f2fs__page, ), TP_fast_assign( - __entry->dev = page->mapping->host->i_sb->s_dev; - __entry->ino = page->mapping->host->i_ino; + __entry->dev = page_file_mapping(page)->host->i_sb->s_dev; + __entry->ino = page_file_mapping(page)->host->i_ino; __entry->type = type; - __entry->dir = S_ISDIR(page->mapping->host->i_mode); + __entry->dir = + S_ISDIR(page_file_mapping(page)->host->i_mode); __entry->index = page->index; __entry->dirty = PageDirty(page); __entry->uptodate = PageUptodate(page); diff --git a/include/trace/events/namei.h b/include/trace/events/namei.h new file mode 100644 index 000000000000..e8c3e216a0a7 --- /dev/null +++ b/include/trace/events/namei.h @@ -0,0 +1,42 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM namei + +#if !defined(_TRACE_INODEPATH_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_INODEPATH_H + +#include <linux/types.h> +#include <linux/tracepoint.h> +#include <linux/mm.h> +#include <linux/memcontrol.h> +#include <linux/device.h> +#include <linux/kdev_t.h> + +TRACE_EVENT(inodepath, + TP_PROTO(struct inode *inode, char *path), + + TP_ARGS(inode, path), + + TP_STRUCT__entry( + /* dev_t and ino_t are arch dependent bit width + * so just use 64-bit + */ + __field(unsigned long, ino) + __field(unsigned long, dev) + __string(path, path) + ), + + TP_fast_assign( + __entry->ino = inode->i_ino; + __entry->dev = inode->i_sb->s_dev; + __assign_str(path, path); + ), + + TP_printk("dev %d:%d ino=%lu path=%s", + MAJOR(__entry->dev), MINOR(__entry->dev), + __entry->ino, __get_str(path)) +); +#endif /* _TRACE_INODEPATH_H */ + +/* This part must be outside protection */ +#include <trace/define_trace.h> diff --git a/include/uapi/linux/coda_psdev.h b/include/uapi/linux/coda_psdev.h index 79d05981fc4b..e2c44d2f7d5b 100644 --- a/include/uapi/linux/coda_psdev.h +++ b/include/uapi/linux/coda_psdev.h @@ -6,19 +6,6 @@ #define CODA_PSDEV_MAJOR 67 #define MAX_CODADEVS 5 /* how many do we allow */ - -/* messages between coda filesystem in kernel and Venus */ -struct upc_req { - struct list_head uc_chain; - caddr_t uc_data; - u_short uc_flags; - u_short uc_inSize; /* Size is at most 5000 bytes */ - u_short uc_outSize; - u_short uc_opcode; /* copied from data to save lookup */ - int uc_unique; - wait_queue_head_t uc_sleep; /* process' wait queue */ -}; - #define CODA_REQ_ASYNC 0x1 #define CODA_REQ_READ 0x2 #define CODA_REQ_WRITE 0x4 diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h index d122ea5338d1..c66b52303114 100644 --- a/include/uapi/linux/fs.h +++ b/include/uapi/linux/fs.h @@ -239,6 +239,7 @@ struct fscrypt_key { #define FS_NOCOMP_FL 0x00000400 /* Don't compress */ #define FS_ECOMPR_FL 0x00000800 /* Compression error */ /* End compression flags --- maybe not all used */ +#define FS_ENCRYPT_FL 0x00000800 /* Encrypted file */ #define FS_BTREE_FL 0x00001000 /* btree format dir */ #define FS_INDEX_FL 0x00001000 /* hash-indexed directory */ #define FS_IMAGIC_FL 0x00002000 /* AFS directory */ @@ -249,6 +250,7 @@ struct fscrypt_key { #define FS_EXTENT_FL 0x00080000 /* Extents */ #define FS_DIRECTIO_FL 0x00100000 /* Use direct i/o */ #define FS_NOCOW_FL 0x00800000 /* Do not cow file */ +#define FS_INLINE_DATA_FL 0x10000000 /* Reserved for ext4 */ #define FS_PROJINHERIT_FL 0x20000000 /* Create with parents projid */ #define FS_RESERVED_FL 0x80000000 /* reserved for ext2 lib */ |
