diff options
Diffstat (limited to 'include')
228 files changed, 3591 insertions, 1329 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index e65278f560c..22ba56e834e 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -437,11 +437,9 @@ void acpi_remove_dir(struct acpi_device *);   */  struct acpi_bus_type {  	struct list_head list; -	struct bus_type *bus; -	/* For general devices under the bus */ +	const char *name; +	bool (*match)(struct device *dev);  	int (*find_device) (struct device *, acpi_handle *); -	/* For bridges, such as PCI root bridge, IDE controller */ -	int (*find_bridge) (struct device *, acpi_handle *);  	void (*setup)(struct device *);  	void (*cleanup)(struct device *);  }; diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 555d0337ad9..b327b5a9296 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h @@ -235,6 +235,9 @@ extern void acpi_processor_unregister_performance(struct           if a _PPC object exists, rmmod is disallowed then */  int acpi_processor_notify_smm(struct module *calling_module); +/* parsing the _P* objects. */ +extern int acpi_processor_get_performance_info(struct acpi_processor *pr); +  /* for communication between multiple parts of the processor kernel module */  DECLARE_PER_CPU(struct acpi_processor *, processors);  extern struct acpi_processor_errata errata; diff --git a/include/asm-generic/atomic.h b/include/asm-generic/atomic.h index 1ced6413ea0..33bd2de3bc1 100644 --- a/include/asm-generic/atomic.h +++ b/include/asm-generic/atomic.h @@ -136,12 +136,6 @@ static inline void atomic_dec(atomic_t *v)  #define atomic_xchg(ptr, v)		(xchg(&(ptr)->counter, (v)))  #define atomic_cmpxchg(v, old, new)	(cmpxchg(&((v)->counter), (old), (new))) -#define cmpxchg_local(ptr, o, n)				  	       \ -	((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\ -			(unsigned long)(n), sizeof(*(ptr)))) - -#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) -  static inline int __atomic_add_unless(atomic_t *v, int a, int u)  {    int c, old; diff --git a/include/asm-generic/cmpxchg.h b/include/asm-generic/cmpxchg.h index 14883026015..811fb1e9b06 100644 --- a/include/asm-generic/cmpxchg.h +++ b/include/asm-generic/cmpxchg.h @@ -92,6 +92,16 @@ unsigned long __xchg(unsigned long x, volatile void *ptr, int size)   */  #include <asm-generic/cmpxchg-local.h> +#ifndef cmpxchg_local +#define cmpxchg_local(ptr, o, n)				  	       \ +	((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\ +			(unsigned long)(n), sizeof(*(ptr)))) +#endif + +#ifndef cmpxchg64_local +#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) +#endif +  #define cmpxchg(ptr, o, n)	cmpxchg_local((ptr), (o), (n))  #define cmpxchg64(ptr, o, n)	cmpxchg64_local((ptr), (o), (n)) diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h new file mode 100644 index 00000000000..d06079c774a --- /dev/null +++ b/include/asm-generic/hugetlb.h @@ -0,0 +1,40 @@ +#ifndef _ASM_GENERIC_HUGETLB_H +#define _ASM_GENERIC_HUGETLB_H + +static inline pte_t mk_huge_pte(struct page *page, pgprot_t pgprot) +{ +	return mk_pte(page, pgprot); +} + +static inline int huge_pte_write(pte_t pte) +{ +	return pte_write(pte); +} + +static inline int huge_pte_dirty(pte_t pte) +{ +	return pte_dirty(pte); +} + +static inline pte_t huge_pte_mkwrite(pte_t pte) +{ +	return pte_mkwrite(pte); +} + +static inline pte_t huge_pte_mkdirty(pte_t pte) +{ +	return pte_mkdirty(pte); +} + +static inline pte_t huge_pte_modify(pte_t pte, pgprot_t newprot) +{ +	return pte_modify(pte, newprot); +} + +static inline void huge_pte_clear(struct mm_struct *mm, unsigned long addr, +				  pte_t *ptep) +{ +	pte_clear(mm, addr, ptep); +} + +#endif /* _ASM_GENERIC_HUGETLB_H */ diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index bfd87685fc1..a59ff51b016 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h @@ -7,6 +7,16 @@  #include <linux/mm_types.h>  #include <linux/bug.h> +/* + * On almost all architectures and configurations, 0 can be used as the + * upper ceiling to free_pgtables(): on many architectures it has the same + * effect as using TASK_SIZE.  However, there is one configuration which + * must impose a more careful limit, to avoid freeing kernel pgtables. + */ +#ifndef USER_PGTABLES_CEILING +#define USER_PGTABLES_CEILING	0UL +#endif +  #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS  extern int ptep_set_access_flags(struct vm_area_struct *vma,  				 unsigned long address, pte_t *ptep, diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h index 25f01d0bc14..b1b1fa6ffff 100644 --- a/include/asm-generic/tlb.h +++ b/include/asm-generic/tlb.h @@ -99,7 +99,12 @@ struct mmu_gather {  	unsigned int		need_flush : 1,	/* Did free PTEs */  				fast_mode  : 1; /* No batching   */ -	unsigned int		fullmm; +	/* we are in the middle of an operation to clear +	 * a full mm and can make some optimizations */ +	unsigned int		fullmm : 1, +	/* we have performed an operation which +	 * requires a complete flush of the tlb */ +				need_flush_all : 1;  	struct mmu_gather_batch *active;  	struct mmu_gather_batch	local; diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 8839b3a2466..e3e0d651c6c 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -443,12 +443,12 @@ struct drm_crtc {   * @dpms: set power state (see drm_crtc_funcs above)   * @save: save connector state   * @restore: restore connector state - * @reset: reset connector after state has been invalidate (e.g. resume) + * @reset: reset connector after state has been invalidated (e.g. resume)   * @detect: is this connector active?   * @fill_modes: fill mode list for this connector - * @set_property: property for this connector may need update + * @set_property: property for this connector may need an update   * @destroy: make object go away - * @force: notify the driver the connector is forced on + * @force: notify the driver that the connector is forced on   *   * Each CRTC may have one or more connectors attached to it.  The functions   * below allow the core DRM code to control connectors, enumerate available modes, diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h index a386b0b654c..918e8fe2f5e 100644 --- a/include/drm/drm_pciids.h +++ b/include/drm/drm_pciids.h @@ -581,7 +581,11 @@  	{0x1002, 0x9908, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \  	{0x1002, 0x9909, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \  	{0x1002, 0x990A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ -	{0x1002, 0x990F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ +	{0x1002, 0x990B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ +	{0x1002, 0x990C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ +	{0x1002, 0x990D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ +	{0x1002, 0x990E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ +	{0x1002, 0x990F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \  	{0x1002, 0x9910, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \  	{0x1002, 0x9913, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \  	{0x1002, 0x9917, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ @@ -592,6 +596,13 @@  	{0x1002, 0x9992, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \  	{0x1002, 0x9993, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \  	{0x1002, 0x9994, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ +	{0x1002, 0x9995, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ +	{0x1002, 0x9996, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ +	{0x1002, 0x9997, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ +	{0x1002, 0x9998, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ +	{0x1002, 0x9999, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ +	{0x1002, 0x999A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ +	{0x1002, 0x999B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \  	{0x1002, 0x99A0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \  	{0x1002, 0x99A2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \  	{0x1002, 0x99A4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ diff --git a/include/linux/acpi.h b/include/linux/acpi.h index bcbdd7484e5..03053aca5b3 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -152,15 +152,6 @@ void acpi_penalize_isa_irq(int irq, int active);  void acpi_pci_irq_disable (struct pci_dev *dev); -struct acpi_pci_driver { -	struct list_head node; -	int (*add)(struct acpi_pci_root *root); -	void (*remove)(struct acpi_pci_root *root); -}; - -int acpi_pci_register_driver(struct acpi_pci_driver *driver); -void acpi_pci_unregister_driver(struct acpi_pci_driver *driver); -  extern int ec_read(u8 addr, u8 *val);  extern int ec_write(u8 addr, u8 val);  extern int ec_transaction(u8 command, diff --git a/include/linux/amba/serial.h b/include/linux/amba/serial.h index f612c783170..62d9303c283 100644 --- a/include/linux/amba/serial.h +++ b/include/linux/amba/serial.h @@ -203,6 +203,9 @@ struct amba_pl011_data {  	bool (*dma_filter)(struct dma_chan *chan, void *filter_param);  	void *dma_rx_param;  	void *dma_tx_param; +	bool dma_rx_poll_enable; +	unsigned int dma_rx_poll_rate; +	unsigned int dma_rx_poll_timeout;          void (*init) (void);  	void (*exit) (void);  }; diff --git a/include/linux/async.h b/include/linux/async.h index a2e3f18b2ad..6b0226bdaad 100644 --- a/include/linux/async.h +++ b/include/linux/async.h @@ -16,9 +16,8 @@  #include <linux/list.h>  typedef u64 async_cookie_t; -typedef void (async_func_ptr) (void *data, async_cookie_t cookie); +typedef void (*async_func_t) (void *data, async_cookie_t cookie);  struct async_domain { -	struct list_head node;  	struct list_head pending;  	unsigned registered:1;  }; @@ -27,8 +26,7 @@ struct async_domain {   * domain participates in global async_synchronize_full   */  #define ASYNC_DOMAIN(_name) \ -	struct async_domain _name = { .node = LIST_HEAD_INIT(_name.node), \ -				      .pending = LIST_HEAD_INIT(_name.pending), \ +	struct async_domain _name = { .pending = LIST_HEAD_INIT(_name.pending),	\  				      .registered = 1 }  /* @@ -36,12 +34,11 @@ struct async_domain {   * complete, this domain does not participate in async_synchronize_full   */  #define ASYNC_DOMAIN_EXCLUSIVE(_name) \ -	struct async_domain _name = { .node = LIST_HEAD_INIT(_name.node), \ -				      .pending = LIST_HEAD_INIT(_name.pending), \ +	struct async_domain _name = { .pending = LIST_HEAD_INIT(_name.pending), \  				      .registered = 0 } -extern async_cookie_t async_schedule(async_func_ptr *ptr, void *data); -extern async_cookie_t async_schedule_domain(async_func_ptr *ptr, void *data, +extern async_cookie_t async_schedule(async_func_t func, void *data); +extern async_cookie_t async_schedule_domain(async_func_t func, void *data,  					    struct async_domain *domain);  void async_unregister_domain(struct async_domain *domain);  extern void async_synchronize_full(void); diff --git a/include/linux/ata.h b/include/linux/ata.h index 8f7a3d68371..ee0bd952405 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h @@ -954,7 +954,7 @@ static inline int atapi_cdb_len(const u16 *dev_id)  	}  } -static inline bool atapi_command_packet_set(const u16 *dev_id) +static inline int atapi_command_packet_set(const u16 *dev_id)  {  	return (dev_id[ATA_ID_CONFIG] >> 8) & 0x1f;  } diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index cdf11191e64..22990cf4439 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -111,12 +111,13 @@ struct bio {  #define BIO_FS_INTEGRITY 9	/* fs owns integrity data, not block layer */  #define BIO_QUIET	10	/* Make BIO Quiet */  #define BIO_MAPPED_INTEGRITY 11/* integrity metadata has been remapped */ +#define BIO_SNAP_STABLE	12	/* bio data must be snapshotted during write */  /*   * Flags starting here get preserved by bio_reset() - this includes   * BIO_POOL_IDX()   */ -#define BIO_RESET_BITS	12 +#define BIO_RESET_BITS	13  #define bio_flagged(bio, flag)	((bio)->bi_flags & (1 << (flag))) diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index 0ea61e07a91..7c2e030e72f 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h @@ -12,7 +12,6 @@  struct blk_trace {  	int trace_state; -	bool rq_based;  	struct rchan *rchan;  	unsigned long __percpu *sequence;  	unsigned char __percpu *msg_data; diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index cdc3bab0183..5f0b0e1f7c0 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h @@ -44,7 +44,6 @@ extern unsigned long init_bootmem_node(pg_data_t *pgdat,  				       unsigned long endpfn);  extern unsigned long init_bootmem(unsigned long addr, unsigned long memend); -extern unsigned long free_low_memory_core_early(int nodeid);  extern unsigned long free_all_bootmem_node(pg_data_t *pgdat);  extern unsigned long free_all_bootmem(void); diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 5afc4f94d11..4c16c4a88d4 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -181,6 +181,7 @@ void ll_rw_block(int, int, struct buffer_head * bh[]);  int sync_dirty_buffer(struct buffer_head *bh);  int __sync_dirty_buffer(struct buffer_head *bh, int rw);  void write_dirty_buffer(struct buffer_head *bh, int rw); +int _submit_bh(int rw, struct buffer_head *bh, unsigned long bio_flags);  int submit_bh(int, struct buffer_head *);  void write_boundary_block(struct block_device *bdev,  			sector_t bblock, unsigned blocksize); diff --git a/include/linux/capability.h b/include/linux/capability.h index 98503b79236..d9a4f7f40f3 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h @@ -35,6 +35,7 @@ struct cpu_vfs_cap_data {  #define _KERNEL_CAP_T_SIZE     (sizeof(kernel_cap_t)) +struct file;  struct inode;  struct dentry;  struct user_namespace; @@ -211,6 +212,7 @@ extern bool capable(int cap);  extern bool ns_capable(struct user_namespace *ns, int cap);  extern bool nsown_capable(int cap);  extern bool inode_capable(const struct inode *inode, int cap); +extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap);  /* audit system wants to get cap info from files as well */  extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps); diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 900af5964f5..646ab9d15e4 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -19,6 +19,7 @@  #include <linux/idr.h>  #include <linux/workqueue.h>  #include <linux/xattr.h> +#include <linux/fs.h>  #ifdef CONFIG_CGROUPS @@ -30,10 +31,6 @@ struct css_id;  extern int cgroup_init_early(void);  extern int cgroup_init(void); -extern void cgroup_lock(void); -extern int cgroup_lock_is_held(void); -extern bool cgroup_lock_live_group(struct cgroup *cgrp); -extern void cgroup_unlock(void);  extern void cgroup_fork(struct task_struct *p);  extern void cgroup_post_fork(struct task_struct *p);  extern void cgroup_exit(struct task_struct *p, int run_callbacks); @@ -44,14 +41,25 @@ extern void cgroup_unload_subsys(struct cgroup_subsys *ss);  extern const struct file_operations proc_cgroup_operations; -/* Define the enumeration of all builtin cgroup subsystems */ +/* + * Define the enumeration of all cgroup subsystems. + * + * We define ids for builtin subsystems and then modular ones. + */  #define SUBSYS(_x) _x ## _subsys_id, -#define IS_SUBSYS_ENABLED(option) IS_ENABLED(option)  enum cgroup_subsys_id { +#define IS_SUBSYS_ENABLED(option) IS_BUILTIN(option)  #include <linux/cgroup_subsys.h> +#undef IS_SUBSYS_ENABLED +	CGROUP_BUILTIN_SUBSYS_COUNT, + +	__CGROUP_SUBSYS_TEMP_PLACEHOLDER = CGROUP_BUILTIN_SUBSYS_COUNT - 1, + +#define IS_SUBSYS_ENABLED(option) IS_MODULE(option) +#include <linux/cgroup_subsys.h> +#undef IS_SUBSYS_ENABLED  	CGROUP_SUBSYS_COUNT,  }; -#undef IS_SUBSYS_ENABLED  #undef SUBSYS  /* Per-subsystem/per-cgroup state maintained by the system. */ @@ -148,6 +156,13 @@ enum {  	 * specified at mount time and thus is implemented here.  	 */  	CGRP_CPUSET_CLONE_CHILDREN, +	/* see the comment above CGRP_ROOT_SANE_BEHAVIOR for details */ +	CGRP_SANE_BEHAVIOR, +}; + +struct cgroup_name { +	struct rcu_head rcu_head; +	char name[];  };  struct cgroup { @@ -172,11 +187,23 @@ struct cgroup {  	struct cgroup *parent;		/* my parent */  	struct dentry *dentry;		/* cgroup fs entry, RCU protected */ +	/* +	 * This is a copy of dentry->d_name, and it's needed because +	 * we can't use dentry->d_name in cgroup_path(). +	 * +	 * You must acquire rcu_read_lock() to access cgrp->name, and +	 * the only place that can change it is rename(), which is +	 * protected by parent dir's i_mutex. +	 * +	 * Normally you should use cgroup_name() wrapper rather than +	 * access it directly. +	 */ +	struct cgroup_name __rcu *name; +  	/* Private pointers for each registered subsystem */  	struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT];  	struct cgroupfs_root *root; -	struct cgroup *top_cgroup;  	/*  	 * List of cg_cgroup_links pointing at css_sets with @@ -213,6 +240,96 @@ struct cgroup {  	struct simple_xattrs xattrs;  }; +#define MAX_CGROUP_ROOT_NAMELEN 64 + +/* cgroupfs_root->flags */ +enum { +	/* +	 * Unfortunately, cgroup core and various controllers are riddled +	 * with idiosyncrasies and pointless options.  The following flag, +	 * when set, will force sane behavior - some options are forced on, +	 * others are disallowed, and some controllers will change their +	 * hierarchical or other behaviors. +	 * +	 * The set of behaviors affected by this flag are still being +	 * determined and developed and the mount option for this flag is +	 * prefixed with __DEVEL__.  The prefix will be dropped once we +	 * reach the point where all behaviors are compatible with the +	 * planned unified hierarchy, which will automatically turn on this +	 * flag. +	 * +	 * The followings are the behaviors currently affected this flag. +	 * +	 * - Mount options "noprefix" and "clone_children" are disallowed. +	 *   Also, cgroupfs file cgroup.clone_children is not created. +	 * +	 * - When mounting an existing superblock, mount options should +	 *   match. +	 * +	 * - Remount is disallowed. +	 * +	 * - memcg: use_hierarchy is on by default and the cgroup file for +	 *   the flag is not created. +	 * +	 * The followings are planned changes. +	 * +	 * - release_agent will be disallowed once replacement notification +	 *   mechanism is implemented. +	 */ +	CGRP_ROOT_SANE_BEHAVIOR	= (1 << 0), + +	CGRP_ROOT_NOPREFIX	= (1 << 1), /* mounted subsystems have no named prefix */ +	CGRP_ROOT_XATTR		= (1 << 2), /* supports extended attributes */ +}; + +/* + * A cgroupfs_root represents the root of a cgroup hierarchy, and may be + * associated with a superblock to form an active hierarchy.  This is + * internal to cgroup core.  Don't access directly from controllers. + */ +struct cgroupfs_root { +	struct super_block *sb; + +	/* +	 * The bitmask of subsystems intended to be attached to this +	 * hierarchy +	 */ +	unsigned long subsys_mask; + +	/* Unique id for this hierarchy. */ +	int hierarchy_id; + +	/* The bitmask of subsystems currently attached to this hierarchy */ +	unsigned long actual_subsys_mask; + +	/* A list running through the attached subsystems */ +	struct list_head subsys_list; + +	/* The root cgroup for this hierarchy */ +	struct cgroup top_cgroup; + +	/* Tracks how many cgroups are currently defined in hierarchy.*/ +	int number_of_cgroups; + +	/* A list running through the active hierarchies */ +	struct list_head root_list; + +	/* All cgroups on this root, cgroup_mutex protected */ +	struct list_head allcg_list; + +	/* Hierarchy-specific flags */ +	unsigned long flags; + +	/* IDs for cgroups in this hierarchy */ +	struct ida cgroup_ida; + +	/* The path to use for release notifications. */ +	char release_agent_path[PATH_MAX]; + +	/* The name for this hierarchy - may be empty */ +	char name[MAX_CGROUP_ROOT_NAMELEN]; +}; +  /*   * A css_set is a structure holding pointers to a set of   * cgroup_subsys_state objects. This saves space in the task struct @@ -278,6 +395,7 @@ struct cgroup_map_cb {  /* cftype->flags */  #define CFTYPE_ONLY_ON_ROOT	(1U << 0)	/* only create on root cg */  #define CFTYPE_NOT_ON_ROOT	(1U << 1)	/* don't create on root cg */ +#define CFTYPE_INSANE		(1U << 2)	/* don't create if sane_behavior */  #define MAX_CFTYPE_NAME		64 @@ -304,9 +422,6 @@ struct cftype {  	/* CFTYPE_* flags */  	unsigned int flags; -	/* file xattrs */ -	struct simple_xattrs xattrs; -  	int (*open)(struct inode *inode, struct file *file);  	ssize_t (*read)(struct cgroup *cgrp, struct cftype *cft,  			struct file *file, @@ -404,18 +519,31 @@ struct cgroup_scanner {  	void *data;  }; +/* + * See the comment above CGRP_ROOT_SANE_BEHAVIOR for details.  This + * function can be called as long as @cgrp is accessible. + */ +static inline bool cgroup_sane_behavior(const struct cgroup *cgrp) +{ +	return cgrp->root->flags & CGRP_ROOT_SANE_BEHAVIOR; +} + +/* Caller should hold rcu_read_lock() */ +static inline const char *cgroup_name(const struct cgroup *cgrp) +{ +	return rcu_dereference(cgrp->name)->name; +} +  int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);  int cgroup_rm_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);  int cgroup_is_removed(const struct cgroup *cgrp); +bool cgroup_is_descendant(struct cgroup *cgrp, struct cgroup *ancestor);  int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen);  int cgroup_task_count(const struct cgroup *cgrp); -/* Return true if cgrp is a descendant of the task's cgroup */ -int cgroup_is_descendant(const struct cgroup *cgrp, struct task_struct *task); -  /*   * Control Group taskset, used to pass around set of tasks to cgroup_subsys   * methods. @@ -458,7 +586,6 @@ struct cgroup_subsys {  	void (*bind)(struct cgroup *root);  	int subsys_id; -	int active;  	int disabled;  	int early_init;  	/* @@ -523,10 +650,16 @@ static inline struct cgroup_subsys_state *cgroup_subsys_state(   * rcu_dereference_check() conditions, such as locks used during the   * cgroup_subsys::attach() methods.   */ +#ifdef CONFIG_PROVE_RCU +extern struct mutex cgroup_mutex;  #define task_subsys_state_check(task, subsys_id, __c)			\ -	rcu_dereference_check(task->cgroups->subsys[subsys_id],		\ -			      lockdep_is_held(&task->alloc_lock) ||	\ -			      cgroup_lock_is_held() || (__c)) +	rcu_dereference_check((task)->cgroups->subsys[(subsys_id)],	\ +			      lockdep_is_held(&(task)->alloc_lock) ||	\ +			      lockdep_is_held(&cgroup_mutex) || (__c)) +#else +#define task_subsys_state_check(task, subsys_id, __c)			\ +	rcu_dereference((task)->cgroups->subsys[(subsys_id)]) +#endif  static inline struct cgroup_subsys_state *  task_subsys_state(struct task_struct *task, int subsys_id) @@ -661,8 +794,8 @@ struct task_struct *cgroup_iter_next(struct cgroup *cgrp,  					struct cgroup_iter *it);  void cgroup_iter_end(struct cgroup *cgrp, struct cgroup_iter *it);  int cgroup_scan_tasks(struct cgroup_scanner *scan); -int cgroup_attach_task(struct cgroup *, struct task_struct *);  int cgroup_attach_task_all(struct task_struct *from, struct task_struct *); +int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from);  /*   * CSS ID is ID for cgroup_subsys_state structs under subsys. This only works @@ -687,13 +820,6 @@ void free_css_id(struct cgroup_subsys *ss, struct cgroup_subsys_state *css);  struct cgroup_subsys_state *css_lookup(struct cgroup_subsys *ss, int id); -/* - * Get a cgroup whose id is greater than or equal to id under tree of root. - * Returning a cgroup_subsys_state or NULL. - */ -struct cgroup_subsys_state *css_get_next(struct cgroup_subsys *ss, int id, -		struct cgroup_subsys_state *root, int *foundid); -  /* Returns true if root is ancestor of cg */  bool css_is_ancestor(struct cgroup_subsys_state *cg,  		     const struct cgroup_subsys_state *root); diff --git a/include/linux/clk-private.h b/include/linux/clk-private.h index 9c7f5807824..dd7adff76e8 100644 --- a/include/linux/clk-private.h +++ b/include/linux/clk-private.h @@ -152,7 +152,7 @@ struct clk {  		},						\  		.reg = _reg,					\  		.shift = _shift,				\ -		.width = _width,				\ +		.mask = BIT(_width) - 1,			\  		.flags = _mux_flags,				\  		.lock = _lock,					\  	};							\ diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 7f197d7addb..11860985fec 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -45,6 +45,14 @@ struct clk_hw;   * 		undo any work done in the @prepare callback. Called with   * 		prepare_lock held.   * + * @is_prepared: Queries the hardware to determine if the clock is prepared. + *		This function is allowed to sleep. Optional, if this op is not + *		set then the prepare count will be used. + * + * @unprepare_unused: Unprepare the clock atomically.  Only called from + *		clk_disable_unused for prepare clocks with special needs. + *		Called with prepare mutex held. This function may sleep. + *   * @enable:	Enable the clock atomically. This must not return until the   * 		clock is generating a valid clock signal, usable by consumer   * 		devices. Called with enable_lock held. This function must not @@ -108,6 +116,8 @@ struct clk_hw;  struct clk_ops {  	int		(*prepare)(struct clk_hw *hw);  	void		(*unprepare)(struct clk_hw *hw); +	int		(*is_prepared)(struct clk_hw *hw); +	void		(*unprepare_unused)(struct clk_hw *hw);  	int		(*enable)(struct clk_hw *hw);  	void		(*disable)(struct clk_hw *hw);  	int		(*is_enabled)(struct clk_hw *hw); @@ -239,9 +249,14 @@ struct clk_div_table {   * CLK_DIVIDER_ONE_BASED - by default the divisor is the value read from the   * 	register plus one.  If CLK_DIVIDER_ONE_BASED is set then the divider is   * 	the raw value read from the register, with the value of zero considered - * 	invalid + *	invalid, unless CLK_DIVIDER_ALLOW_ZERO is set.   * CLK_DIVIDER_POWER_OF_TWO - clock divisor is 2 raised to the value read from   * 	the hardware register + * CLK_DIVIDER_ALLOW_ZERO - Allow zero divisors.  For dividers which have + *	CLK_DIVIDER_ONE_BASED set, it is possible to end up with a zero divisor. + *	Some hardware implementations gracefully handle this case and allow a + *	zero divisor by not modifying their input clock + *	(divide by one / bypass).   */  struct clk_divider {  	struct clk_hw	hw; @@ -255,6 +270,7 @@ struct clk_divider {  #define CLK_DIVIDER_ONE_BASED		BIT(0)  #define CLK_DIVIDER_POWER_OF_TWO	BIT(1) +#define CLK_DIVIDER_ALLOW_ZERO		BIT(2)  extern const struct clk_ops clk_divider_ops;  struct clk *clk_register_divider(struct device *dev, const char *name, @@ -274,7 +290,7 @@ struct clk *clk_register_divider_table(struct device *dev, const char *name,   * @reg:	register controlling multiplexer   * @shift:	shift to multiplexer bit field   * @width:	width of mutliplexer bit field - * @num_clks:	number of parent clocks + * @flags:	hardware-specific flags   * @lock:	register lock   *   * Clock with multiple selectable parents.  Implements .get_parent, .set_parent @@ -287,8 +303,9 @@ struct clk *clk_register_divider_table(struct device *dev, const char *name,  struct clk_mux {  	struct clk_hw	hw;  	void __iomem	*reg; +	u32		*table; +	u32		mask;  	u8		shift; -	u8		width;  	u8		flags;  	spinlock_t	*lock;  }; @@ -297,11 +314,19 @@ struct clk_mux {  #define CLK_MUX_INDEX_BIT		BIT(1)  extern const struct clk_ops clk_mux_ops; +  struct clk *clk_register_mux(struct device *dev, const char *name,  		const char **parent_names, u8 num_parents, unsigned long flags,  		void __iomem *reg, u8 shift, u8 width,  		u8 clk_mux_flags, spinlock_t *lock); +struct clk *clk_register_mux_table(struct device *dev, const char *name, +		const char **parent_names, u8 num_parents, unsigned long flags, +		void __iomem *reg, u8 shift, u32 mask, +		u8 clk_mux_flags, u32 *table, spinlock_t *lock); + +void of_fixed_factor_clk_setup(struct device_node *node); +  /**   * struct clk_fixed_factor - fixed multiplier and divider clock   * @@ -325,6 +350,37 @@ struct clk *clk_register_fixed_factor(struct device *dev, const char *name,  		const char *parent_name, unsigned long flags,  		unsigned int mult, unsigned int div); +/*** + * struct clk_composite - aggregate clock of mux, divider and gate clocks + * + * @hw:		handle between common and hardware-specific interfaces + * @mux_hw:	handle between composite and hardware-specific mux clock + * @rate_hw:	handle between composite and hardware-specific rate clock + * @gate_hw:	handle between composite and hardware-specific gate clock + * @mux_ops:	clock ops for mux + * @rate_ops:	clock ops for rate + * @gate_ops:	clock ops for gate + */ +struct clk_composite { +	struct clk_hw	hw; +	struct clk_ops	ops; + +	struct clk_hw	*mux_hw; +	struct clk_hw	*rate_hw; +	struct clk_hw	*gate_hw; + +	const struct clk_ops	*mux_ops; +	const struct clk_ops	*rate_ops; +	const struct clk_ops	*gate_ops; +}; + +struct clk *clk_register_composite(struct device *dev, const char *name, +		const char **parent_names, int num_parents, +		struct clk_hw *mux_hw, const struct clk_ops *mux_ops, +		struct clk_hw *rate_hw, const struct clk_ops *rate_ops, +		struct clk_hw *gate_hw, const struct clk_ops *gate_ops, +		unsigned long flags); +  /**   * clk_register - allocate a new clock, register it and return an opaque cookie   * @dev: device that is registering this clock @@ -351,6 +407,7 @@ unsigned int __clk_get_enable_count(struct clk *clk);  unsigned int __clk_get_prepare_count(struct clk *clk);  unsigned long __clk_get_rate(struct clk *clk);  unsigned long __clk_get_flags(struct clk *clk); +bool __clk_is_prepared(struct clk *clk);  bool __clk_is_enabled(struct clk *clk);  struct clk *__clk_lookup(const char *name); diff --git a/include/linux/clk.h b/include/linux/clk.h index b3ac22d0fc1..9a6d04524b1 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -28,16 +28,16 @@ struct clk;   * PRE_RATE_CHANGE - called immediately before the clk rate is changed,   *     to indicate that the rate change will proceed.  Drivers must   *     immediately terminate any operations that will be affected by the - *     rate change.  Callbacks may either return NOTIFY_DONE or - *     NOTIFY_STOP. + *     rate change.  Callbacks may either return NOTIFY_DONE, NOTIFY_OK, + *     NOTIFY_STOP or NOTIFY_BAD.   *   * ABORT_RATE_CHANGE: called if the rate change failed for some reason   *     after PRE_RATE_CHANGE.  In this case, all registered notifiers on   *     the clk will be called with ABORT_RATE_CHANGE. Callbacks must - *     always return NOTIFY_DONE. + *     always return NOTIFY_DONE or NOTIFY_OK.   *   * POST_RATE_CHANGE - called after the clk rate change has successfully - *     completed.  Callbacks must always return NOTIFY_DONE. + *     completed.  Callbacks must always return NOTIFY_DONE or NOTIFY_OK.   *   */  #define PRE_RATE_CHANGE			BIT(0) diff --git a/include/linux/clk/sunxi.h b/include/linux/clk/sunxi.h new file mode 100644 index 00000000000..e074fdd5a23 --- /dev/null +++ b/include/linux/clk/sunxi.h @@ -0,0 +1,22 @@ +/* + * Copyright 2012 Maxime Ripard + * + * Maxime Ripard <maxime.ripard@free-electrons.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * 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 __LINUX_CLK_SUNXI_H_ +#define __LINUX_CLK_SUNXI_H_ + +void __init sunxi_init_clocks(void); + +#endif diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index 66346521cb6..464e229e7d8 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h @@ -55,6 +55,11 @@ enum clock_event_nofitiers {  #define CLOCK_EVT_FEAT_C3STOP		0x000008  #define CLOCK_EVT_FEAT_DUMMY		0x000010 +/* + * Core shall set the interrupt affinity dynamically in broadcast mode + */ +#define CLOCK_EVT_FEAT_DYNIRQ		0x000020 +  /**   * struct clock_event_device - clock event device descriptor   * @event_handler:	Assigned by the framework to be called by the low @@ -170,6 +175,12 @@ extern void tick_broadcast(const struct cpumask *mask);  extern int tick_receive_broadcast(void);  #endif +#if defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) && defined(CONFIG_TICK_ONESHOT) +extern int tick_check_broadcast_expired(void); +#else +static inline int tick_check_broadcast_expired(void) { return 0; } +#endif +  #ifdef CONFIG_GENERIC_CLOCKEVENTS  extern void clockevents_notify(unsigned long reason, void *arg);  #else @@ -182,6 +193,7 @@ static inline void clockevents_suspend(void) {}  static inline void clockevents_resume(void) {}  #define clockevents_notify(reason, arg) do { } while (0) +static inline int tick_check_broadcast_expired(void) { return 0; }  #endif diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 27cfda427dd..aa7032c7238 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h @@ -206,6 +206,7 @@ struct clocksource {  #define CLOCK_SOURCE_WATCHDOG			0x10  #define CLOCK_SOURCE_VALID_FOR_HRES		0x20  #define CLOCK_SOURCE_UNSTABLE			0x40 +#define CLOCK_SOURCE_SUSPEND_NONSTOP		0x80  /* simplify initialization of mask field */  #define CLOCKSOURCE_MASK(bits) (cycle_t)((bits) < 64 ? ((1ULL<<(bits))-1) : -1) diff --git a/include/linux/compat.h b/include/linux/compat.h index 76a87fb57ac..377cd8c3395 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -141,11 +141,11 @@ typedef struct {  } compat_sigset_t;  struct compat_sigaction { -#ifndef __ARCH_HAS_ODD_SIGACTION +#ifndef __ARCH_HAS_IRIX_SIGACTION  	compat_uptr_t			sa_handler;  	compat_ulong_t			sa_flags;  #else -	compat_ulong_t			sa_flags; +	compat_uint_t			sa_flags;  	compat_uptr_t			sa_handler;  #endif  #ifdef __ARCH_HAS_SA_RESTORER diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 68b162d9225..842de225055 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h @@ -13,7 +13,7 @@  #define __must_check 		__attribute__((warn_unused_result))  #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) -#if GCC_VERSION >= 40100 +#if GCC_VERSION >= 40100 && GCC_VERSION < 40600  # define __compiletime_object_size(obj) __builtin_object_size(obj, 0)  #endif diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 10b8f23fab0..92669cd182a 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -351,4 +351,10 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);   */  #define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) +/* Ignore/forbid kprobes attach on very low level functions marked by this attribute: */ +#ifdef CONFIG_KPROBES +# define __kprobes	__attribute__((__section__(".kprobes.text"))) +#else +# define __kprobes +#endif  #endif /* __LINUX_COMPILER_H */ diff --git a/include/linux/console.h b/include/linux/console.h index 29680a8cda9..73bab0f58af 100644 --- a/include/linux/console.h +++ b/include/linux/console.h @@ -141,6 +141,7 @@ struct console {  	for (con = console_drivers; con != NULL; con = con->next)  extern int console_set_on_cmdline; +extern struct console *early_console;  extern int add_preferred_console(char *name, int idx, char *options);  extern int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, char *options); diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h index b28d161c109..365f4a61bf0 100644 --- a/include/linux/context_tracking.h +++ b/include/linux/context_tracking.h @@ -1,9 +1,9 @@  #ifndef _LINUX_CONTEXT_TRACKING_H  #define _LINUX_CONTEXT_TRACKING_H -#ifdef CONFIG_CONTEXT_TRACKING  #include <linux/sched.h>  #include <linux/percpu.h> +#include <asm/ptrace.h>  struct context_tracking {  	/* @@ -13,12 +13,13 @@ struct context_tracking {  	 * may be further optimized using static keys.  	 */  	bool active; -	enum { +	enum ctx_state {  		IN_KERNEL = 0,  		IN_USER,  	} state;  }; +#ifdef CONFIG_CONTEXT_TRACKING  DECLARE_PER_CPU(struct context_tracking, context_tracking);  static inline bool context_tracking_in_user(void) @@ -33,12 +34,31 @@ static inline bool context_tracking_active(void)  extern void user_enter(void);  extern void user_exit(void); + +static inline enum ctx_state exception_enter(void) +{ +	enum ctx_state prev_ctx; + +	prev_ctx = this_cpu_read(context_tracking.state); +	user_exit(); + +	return prev_ctx; +} + +static inline void exception_exit(enum ctx_state prev_ctx) +{ +	if (prev_ctx == IN_USER) +		user_enter(); +} +  extern void context_tracking_task_switch(struct task_struct *prev,  					 struct task_struct *next);  #else  static inline bool context_tracking_in_user(void) { return false; }  static inline void user_enter(void) { }  static inline void user_exit(void) { } +static inline enum ctx_state exception_enter(void) { return 0; } +static inline void exception_exit(enum ctx_state prev_ctx) { }  static inline void context_tracking_task_switch(struct task_struct *prev,  						struct task_struct *next) { }  #endif /* !CONFIG_CONTEXT_TRACKING */ diff --git a/include/linux/cpu.h b/include/linux/cpu.h index ce7a074f251..c6f6e0839b6 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -212,4 +212,20 @@ static inline int disable_nonboot_cpus(void) { return 0; }  static inline void enable_nonboot_cpus(void) {}  #endif /* !CONFIG_PM_SLEEP_SMP */ +enum cpuhp_state { +	CPUHP_OFFLINE, +	CPUHP_ONLINE, +}; + +void cpu_startup_entry(enum cpuhp_state state); +void cpu_idle(void); + +void cpu_idle_poll_ctrl(bool enable); + +void arch_cpu_idle(void); +void arch_cpu_idle_prepare(void); +void arch_cpu_idle_enter(void); +void arch_cpu_idle_exit(void); +void arch_cpu_idle_dead(void); +  #endif /* _LINUX_CPU_H_ */ diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 032560295fc..d08e4d2a9b9 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h @@ -591,6 +591,21 @@ static inline int cpulist_scnprintf(char *buf, int len,  }  /** + * cpumask_parse - extract a cpumask from from a string + * @buf: the buffer to extract from + * @dstp: the cpumask to set. + * + * Returns -errno, or 0 for success. + */ +static inline int cpumask_parse(const char *buf, struct cpumask *dstp) +{ +	char *nl = strchr(buf, '\n'); +	int len = nl ? nl - buf : strlen(buf); + +	return bitmap_parse(buf, len, cpumask_bits(dstp), nr_cpumask_bits); +} + +/**   * cpulist_parse - extract a cpumask from a user string of ranges   * @buf: the buffer to extract from   * @dstp: the cpumask to set. diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index 8c8a60d2940..ccd1de8ad82 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h @@ -11,7 +11,6 @@  #include <linux/sched.h>  #include <linux/cpumask.h>  #include <linux/nodemask.h> -#include <linux/cgroup.h>  #include <linux/mm.h>  #ifdef CONFIG_CPUSETS diff --git a/include/linux/ctype.h b/include/linux/ctype.h index 8acfe312f94..653589e3e30 100644 --- a/include/linux/ctype.h +++ b/include/linux/ctype.h @@ -61,4 +61,10 @@ static inline char _tolower(const char c)  	return c | 0x20;  } +/* Fast check for octal digit */ +static inline int isodigit(const char c) +{ +	return c >= '0' && c <= '7'; +} +  #endif diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h index a975de1ff59..21ca773f77b 100644 --- a/include/linux/debug_locks.h +++ b/include/linux/debug_locks.h @@ -27,7 +27,7 @@ extern int debug_locks_off(void);  									\  	if (!oops_in_progress && unlikely(c)) {				\  		if (debug_locks_off() && !debug_locks_silent)		\ -			WARN_ON(1);					\ +			WARN(1, "DEBUG_LOCKS_WARN_ON(%s)", #c);		\  		__ret = 1;						\  	}								\  	__ret;								\ @@ -51,7 +51,7 @@ struct task_struct;  extern void debug_show_all_locks(void);  extern void debug_show_held_locks(struct task_struct *task);  extern void debug_check_no_locks_freed(const void *from, unsigned long len); -extern void debug_check_no_locks_held(void); +extern void debug_check_no_locks_held(struct task_struct *task);  #else  static inline void debug_show_all_locks(void)  { @@ -67,7 +67,7 @@ debug_check_no_locks_freed(const void *from, unsigned long len)  }  static inline void -debug_check_no_locks_held(void) +debug_check_no_locks_held(struct task_struct *task)  {  }  #endif diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h index e83ef39b3be..fe8c4476f7e 100644 --- a/include/linux/devfreq.h +++ b/include/linux/devfreq.h @@ -213,7 +213,7 @@ struct devfreq_simple_ondemand_data {  #endif  #else /* !CONFIG_PM_DEVFREQ */ -static struct devfreq *devfreq_add_device(struct device *dev, +static inline struct devfreq *devfreq_add_device(struct device *dev,  					  struct devfreq_dev_profile *profile,  					  const char *governor_name,  					  void *data) @@ -221,34 +221,34 @@ static struct devfreq *devfreq_add_device(struct device *dev,  	return NULL;  } -static int devfreq_remove_device(struct devfreq *devfreq) +static inline int devfreq_remove_device(struct devfreq *devfreq)  {  	return 0;  } -static int devfreq_suspend_device(struct devfreq *devfreq) +static inline int devfreq_suspend_device(struct devfreq *devfreq)  {  	return 0;  } -static int devfreq_resume_device(struct devfreq *devfreq) +static inline int devfreq_resume_device(struct devfreq *devfreq)  {  	return 0;  } -static struct opp *devfreq_recommended_opp(struct device *dev, +static inline struct opp *devfreq_recommended_opp(struct device *dev,  					   unsigned long *freq, u32 flags)  { -	return -EINVAL; +	return ERR_PTR(-EINVAL);  } -static int devfreq_register_opp_notifier(struct device *dev, +static inline int devfreq_register_opp_notifier(struct device *dev,  					 struct devfreq *devfreq)  {  	return -EINVAL;  } -static int devfreq_unregister_opp_notifier(struct device *dev, +static inline int devfreq_unregister_opp_notifier(struct device *dev,  					   struct devfreq *devfreq)  {  	return -EINVAL; diff --git a/include/linux/device.h b/include/linux/device.h index 9d6464ea99c..711793b145f 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -25,6 +25,7 @@  #include <linux/pm.h>  #include <linux/atomic.h>  #include <linux/ratelimit.h> +#include <linux/uidgid.h>  #include <asm/device.h>  struct device; @@ -111,17 +112,11 @@ struct bus_type {  	struct iommu_ops *iommu_ops;  	struct subsys_private *p; +	struct lock_class_key lock_key;  }; -/* This is a #define to keep the compiler from merging different - * instances of the __key variable */ -#define bus_register(subsys)			\ -({						\ -	static struct lock_class_key __key;	\ -	__bus_register(subsys, &__key);	\ -}) -extern int __must_check __bus_register(struct bus_type *bus, -				       struct lock_class_key *key); +extern int __must_check bus_register(struct bus_type *bus); +  extern void bus_unregister(struct bus_type *bus);  extern int __must_check bus_rescan_devices(struct bus_type *bus); @@ -302,6 +297,8 @@ void subsys_interface_unregister(struct subsys_interface *sif);  int subsys_system_register(struct bus_type *subsys,  			   const struct attribute_group **groups); +int subsys_virtual_register(struct bus_type *subsys, +			    const struct attribute_group **groups);  /**   * struct class - device classes @@ -471,7 +468,8 @@ struct device_type {  	const char *name;  	const struct attribute_group **groups;  	int (*uevent)(struct device *dev, struct kobj_uevent_env *env); -	char *(*devnode)(struct device *dev, umode_t *mode); +	char *(*devnode)(struct device *dev, umode_t *mode, +			 kuid_t *uid, kgid_t *gid);  	void (*release)(struct device *dev);  	const struct dev_pm_ops *pm; @@ -849,7 +847,8 @@ extern int device_rename(struct device *dev, const char *new_name);  extern int device_move(struct device *dev, struct device *new_parent,  		       enum dpm_order dpm_order);  extern const char *device_get_devnode(struct device *dev, -				      umode_t *mode, const char **tmp); +				      umode_t *mode, kuid_t *uid, kgid_t *gid, +				      const char **tmp);  extern void *dev_get_drvdata(const struct device *dev);  extern int dev_set_drvdata(struct device *dev, void *data); diff --git a/include/linux/ecryptfs.h b/include/linux/ecryptfs.h index 2224a8c0cb6..8d5ab998a22 100644 --- a/include/linux/ecryptfs.h +++ b/include/linux/ecryptfs.h @@ -6,9 +6,8 @@  #define ECRYPTFS_VERSION_MINOR 0x04  #define ECRYPTFS_SUPPORTED_FILE_VERSION 0x03  /* These flags indicate which features are supported by the kernel - * module; userspace tools such as the mount helper read - * ECRYPTFS_VERSIONING_MASK from a sysfs handle in order to determine - * how to behave. */ + * module; userspace tools such as the mount helper read the feature + * bits from a sysfs handle in order to determine how to behave. */  #define ECRYPTFS_VERSIONING_PASSPHRASE            0x00000001  #define ECRYPTFS_VERSIONING_PUBKEY                0x00000002  #define ECRYPTFS_VERSIONING_PLAINTEXT_PASSTHROUGH 0x00000004 @@ -19,13 +18,6 @@  #define ECRYPTFS_VERSIONING_HMAC                  0x00000080  #define ECRYPTFS_VERSIONING_FILENAME_ENCRYPTION   0x00000100  #define ECRYPTFS_VERSIONING_GCM                   0x00000200 -#define ECRYPTFS_VERSIONING_MASK (ECRYPTFS_VERSIONING_PASSPHRASE \ -				  | ECRYPTFS_VERSIONING_PLAINTEXT_PASSTHROUGH \ -				  | ECRYPTFS_VERSIONING_PUBKEY \ -				  | ECRYPTFS_VERSIONING_XATTR \ -				  | ECRYPTFS_VERSIONING_MULTKEY \ -				  | ECRYPTFS_VERSIONING_DEVMISC \ -				  | ECRYPTFS_VERSIONING_FILENAME_ENCRYPTION)  #define ECRYPTFS_MAX_PASSWORD_LENGTH 64  #define ECRYPTFS_MAX_PASSPHRASE_BYTES ECRYPTFS_MAX_PASSWORD_LENGTH  #define ECRYPTFS_SALT_SIZE 8 diff --git a/include/linux/edac.h b/include/linux/edac.h index 4fd4999ccb5..0b763276f61 100644 --- a/include/linux/edac.h +++ b/include/linux/edac.h @@ -561,7 +561,6 @@ struct csrow_info {  	u32 ue_count;		/* Uncorrectable Errors for this csrow */  	u32 ce_count;		/* Correctable Errors for this csrow */ -	u32 nr_pages;		/* combined pages count of all channels */  	struct mem_ctl_info *mci;	/* the parent */ @@ -676,11 +675,11 @@ struct mem_ctl_info {  	 * sees memory sticks ("dimms"), and the ones that sees memory ranks.  	 * All old memory controllers enumerate memories per rank, but most  	 * of the recent drivers enumerate memories per DIMM, instead. -	 * When the memory controller is per rank, mem_is_per_rank is true. +	 * When the memory controller is per rank, csbased is true.  	 */  	unsigned n_layers;  	struct edac_mc_layer *layers; -	bool mem_is_per_rank; +	bool csbased;  	/*  	 * DIMM info. Will eventually remove the entire csrows_info some day @@ -741,8 +740,6 @@ struct mem_ctl_info {  	u32 fake_inject_ue;  	u16 fake_inject_count;  #endif -	__u8 csbased : 1,	/* csrow-based memory controller */ -	     __resv  : 7;  };  #endif diff --git a/include/linux/efi.h b/include/linux/efi.h index 9bf2f1fcae2..3d7df3d32c6 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -333,6 +333,7 @@ typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules,  					      unsigned long count,  					      u64 *max_size,  					      int *reset_type); +typedef efi_status_t efi_query_variable_store_t(u32 attributes, unsigned long size);  /*   *  EFI Configuration Table and GUID definitions @@ -575,9 +576,15 @@ extern void efi_enter_virtual_mode (void);	/* switch EFI to virtual mode, if pos  #ifdef CONFIG_X86  extern void efi_late_init(void);  extern void efi_free_boot_services(void); +extern efi_status_t efi_query_variable_store(u32 attributes, unsigned long size);  #else  static inline void efi_late_init(void) {}  static inline void efi_free_boot_services(void) {} + +static inline efi_status_t efi_query_variable_store(u32 attributes, unsigned long size) +{ +	return EFI_SUCCESS; +}  #endif  extern void __iomem *efi_lookup_mapped_addr(u64 phys_addr);  extern u64 efi_get_iobase (void); @@ -731,7 +738,7 @@ struct efivar_operations {  	efi_get_variable_t *get_variable;  	efi_get_next_variable_t *get_next_variable;  	efi_set_variable_t *set_variable; -	efi_query_variable_info_t *query_variable_info; +	efi_query_variable_store_t *query_variable_store;  };  struct efivars { diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h index 5b9b5b31718..41b223a59a6 100644 --- a/include/linux/exportfs.h +++ b/include/linux/exportfs.h @@ -85,6 +85,17 @@ enum fid_type {  	FILEID_NILFS_WITH_PARENT = 0x62,  	/* +	 * 32 bit generation number, 40 bit i_pos. +	 */ +	FILEID_FAT_WITHOUT_PARENT = 0x71, + +	/* +	 * 32 bit generation number, 40 bit i_pos, +	 * 32 bit parent generation number, 40 bit parent i_pos +	 */ +	FILEID_FAT_WITH_PARENT = 0x72, + +	/*  	 * Filesystems must not use 0xff file ID.  	 */  	FILEID_INVALID = 0xff, diff --git a/include/linux/freezer.h b/include/linux/freezer.h index 043a5cf8b5b..e70df40d84f 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h @@ -3,7 +3,6 @@  #ifndef FREEZER_H_INCLUDED  #define FREEZER_H_INCLUDED -#include <linux/debug_locks.h>  #include <linux/sched.h>  #include <linux/wait.h>  #include <linux/atomic.h> @@ -49,8 +48,6 @@ extern void thaw_kernel_threads(void);  static inline bool try_to_freeze(void)  { -	if (!(current->flags & PF_NOFREEZE)) -		debug_check_no_locks_held();  	might_sleep();  	if (likely(!freezing(current)))  		return false; diff --git a/include/linux/fs.h b/include/linux/fs.h index 74a907b8b95..2c28271ab9d 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1825,6 +1825,8 @@ struct file_system_type {  	struct lock_class_key i_mutex_dir_key;  }; +#define MODULE_ALIAS_FS(NAME) MODULE_ALIAS("fs-" NAME) +  extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags,  	void *data, int (*fill_super)(struct super_block *, void *, int));  extern struct dentry *mount_bdev(struct file_system_type *fs_type, diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h index 729eded4b24..2b93a9a5a1e 100644 --- a/include/linux/fs_struct.h +++ b/include/linux/fs_struct.h @@ -50,4 +50,6 @@ static inline void get_fs_root_and_pwd(struct fs_struct *fs, struct path *root,  	spin_unlock(&fs->lock);  } +extern bool current_chrooted(void); +  #endif /* _LINUX_FS_STRUCT_H */ diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index d5b0910d496..4b2ee8d12f5 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h @@ -157,7 +157,6 @@ struct fsnotify_group {  		struct inotify_group_private_data {  			spinlock_t	idr_lock;  			struct idr      idr; -			u32             last_wd;  			struct user_struct      *user;  		} inotify_data;  #endif diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index e5ca8ef50e9..f83e17a40e8 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h @@ -89,6 +89,7 @@ typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip,   *            that the call back has its own recursion protection. If it does   *            not set this, then the ftrace infrastructure will add recursion   *            protection for the caller. + * STUB   - The ftrace_ops is just a place holder.   */  enum {  	FTRACE_OPS_FL_ENABLED			= 1 << 0, @@ -98,6 +99,7 @@ enum {  	FTRACE_OPS_FL_SAVE_REGS			= 1 << 4,  	FTRACE_OPS_FL_SAVE_REGS_IF_SUPPORTED	= 1 << 5,  	FTRACE_OPS_FL_RECURSION_SAFE		= 1 << 6, +	FTRACE_OPS_FL_STUB			= 1 << 7,  };  struct ftrace_ops { @@ -259,8 +261,10 @@ struct ftrace_probe_ops {  	void			(*func)(unsigned long ip,  					unsigned long parent_ip,  					void **data); -	int			(*callback)(unsigned long ip, void **data); -	void			(*free)(void **data); +	int			(*init)(struct ftrace_probe_ops *ops, +					unsigned long ip, void **data); +	void			(*free)(struct ftrace_probe_ops *ops, +					unsigned long ip, void **data);  	int			(*print)(struct seq_file *m,  					 unsigned long ip,  					 struct ftrace_probe_ops *ops, @@ -394,7 +398,6 @@ ssize_t ftrace_filter_write(struct file *file, const char __user *ubuf,  			    size_t cnt, loff_t *ppos);  ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf,  			     size_t cnt, loff_t *ppos); -loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int whence);  int ftrace_regex_release(struct inode *inode, struct file *file);  void __init @@ -567,6 +570,8 @@ static inline int  ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; }  #endif /* CONFIG_DYNAMIC_FTRACE */ +loff_t ftrace_filter_lseek(struct file *file, loff_t offset, int whence); +  /* totally disable ftrace - can not re-enable after this */  void ftrace_kill(void); diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 13a54d0bdfa..34e00fb49be 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h @@ -8,6 +8,7 @@  #include <linux/perf_event.h>  struct trace_array; +struct trace_buffer;  struct tracer;  struct dentry; @@ -38,6 +39,12 @@ const char *ftrace_print_symbols_seq_u64(struct trace_seq *p,  const char *ftrace_print_hex_seq(struct trace_seq *p,  				 const unsigned char *buf, int len); +struct trace_iterator; +struct trace_event; + +int ftrace_raw_output_prep(struct trace_iterator *iter, +			   struct trace_event *event); +  /*   * The trace entry - the most basic unit of tracing. This is what   * is printed in the end as a single line in the trace output, such as: @@ -61,6 +68,7 @@ struct trace_entry {  struct trace_iterator {  	struct trace_array	*tr;  	struct tracer		*trace; +	struct trace_buffer	*trace_buffer;  	void			*private;  	int			cpu_file;  	struct mutex		mutex; @@ -95,8 +103,6 @@ enum trace_iter_flags {  }; -struct trace_event; -  typedef enum print_line_t (*trace_print_func)(struct trace_iterator *iter,  				      int flags, struct trace_event *event); @@ -128,6 +134,13 @@ enum print_line_t {  void tracing_generic_entry_update(struct trace_entry *entry,  				  unsigned long flags,  				  int pc); +struct ftrace_event_file; + +struct ring_buffer_event * +trace_event_buffer_lock_reserve(struct ring_buffer **current_buffer, +				struct ftrace_event_file *ftrace_file, +				int type, unsigned long len, +				unsigned long flags, int pc);  struct ring_buffer_event *  trace_current_buffer_lock_reserve(struct ring_buffer **current_buffer,  				  int type, unsigned long len, @@ -182,53 +195,49 @@ extern int ftrace_event_reg(struct ftrace_event_call *event,  			    enum trace_reg type, void *data);  enum { -	TRACE_EVENT_FL_ENABLED_BIT,  	TRACE_EVENT_FL_FILTERED_BIT, -	TRACE_EVENT_FL_RECORDED_CMD_BIT,  	TRACE_EVENT_FL_CAP_ANY_BIT,  	TRACE_EVENT_FL_NO_SET_FILTER_BIT,  	TRACE_EVENT_FL_IGNORE_ENABLE_BIT, +	TRACE_EVENT_FL_WAS_ENABLED_BIT,  }; +/* + * Event flags: + *  FILTERED	  - The event has a filter attached + *  CAP_ANY	  - Any user can enable for perf + *  NO_SET_FILTER - Set when filter has error and is to be ignored + *  IGNORE_ENABLE - For ftrace internal events, do not enable with debugfs file + *  WAS_ENABLED   - Set and stays set when an event was ever enabled + *                    (used for module unloading, if a module event is enabled, + *                     it is best to clear the buffers that used it). + */  enum { -	TRACE_EVENT_FL_ENABLED		= (1 << TRACE_EVENT_FL_ENABLED_BIT),  	TRACE_EVENT_FL_FILTERED		= (1 << TRACE_EVENT_FL_FILTERED_BIT), -	TRACE_EVENT_FL_RECORDED_CMD	= (1 << TRACE_EVENT_FL_RECORDED_CMD_BIT),  	TRACE_EVENT_FL_CAP_ANY		= (1 << TRACE_EVENT_FL_CAP_ANY_BIT),  	TRACE_EVENT_FL_NO_SET_FILTER	= (1 << TRACE_EVENT_FL_NO_SET_FILTER_BIT),  	TRACE_EVENT_FL_IGNORE_ENABLE	= (1 << TRACE_EVENT_FL_IGNORE_ENABLE_BIT), +	TRACE_EVENT_FL_WAS_ENABLED	= (1 << TRACE_EVENT_FL_WAS_ENABLED_BIT),  };  struct ftrace_event_call {  	struct list_head	list;  	struct ftrace_event_class *class;  	char			*name; -	struct dentry		*dir;  	struct trace_event	event;  	const char		*print_fmt;  	struct event_filter	*filter; +	struct list_head	*files;  	void			*mod;  	void			*data; -  	/* -	 * 32 bit flags: -	 *   bit 1:		enabled -	 *   bit 2:		filter_active -	 *   bit 3:		enabled cmd record -	 *   bit 4:		allow trace by non root (cap any) -	 *   bit 5:		failed to apply filter -	 *   bit 6:		ftrace internal event (do not enable) -	 * -	 * Changes to flags must hold the event_mutex. -	 * -	 * Note: Reads of flags do not hold the event_mutex since -	 * they occur in critical sections. But the way flags -	 * is currently used, these changes do no affect the code -	 * except that when a change is made, it may have a slight -	 * delay in propagating the changes to other CPUs due to -	 * caching and such. +	 *   bit 0:		filter_active +	 *   bit 1:		allow trace by non root (cap any) +	 *   bit 2:		failed to apply filter +	 *   bit 3:		ftrace internal event (do not enable) +	 *   bit 4:		Event was enabled by module  	 */ -	unsigned int		flags; +	int			flags; /* static flags of different events */  #ifdef CONFIG_PERF_EVENTS  	int				perf_refcount; @@ -236,6 +245,56 @@ struct ftrace_event_call {  #endif  }; +struct trace_array; +struct ftrace_subsystem_dir; + +enum { +	FTRACE_EVENT_FL_ENABLED_BIT, +	FTRACE_EVENT_FL_RECORDED_CMD_BIT, +	FTRACE_EVENT_FL_SOFT_MODE_BIT, +	FTRACE_EVENT_FL_SOFT_DISABLED_BIT, +}; + +/* + * Ftrace event file flags: + *  ENABLED	  - The event is enabled + *  RECORDED_CMD  - The comms should be recorded at sched_switch + *  SOFT_MODE     - The event is enabled/disabled by SOFT_DISABLED + *  SOFT_DISABLED - When set, do not trace the event (even though its + *                   tracepoint may be enabled) + */ +enum { +	FTRACE_EVENT_FL_ENABLED		= (1 << FTRACE_EVENT_FL_ENABLED_BIT), +	FTRACE_EVENT_FL_RECORDED_CMD	= (1 << FTRACE_EVENT_FL_RECORDED_CMD_BIT), +	FTRACE_EVENT_FL_SOFT_MODE	= (1 << FTRACE_EVENT_FL_SOFT_MODE_BIT), +	FTRACE_EVENT_FL_SOFT_DISABLED	= (1 << FTRACE_EVENT_FL_SOFT_DISABLED_BIT), +}; + +struct ftrace_event_file { +	struct list_head		list; +	struct ftrace_event_call	*event_call; +	struct dentry			*dir; +	struct trace_array		*tr; +	struct ftrace_subsystem_dir	*system; + +	/* +	 * 32 bit flags: +	 *   bit 0:		enabled +	 *   bit 1:		enabled cmd record +	 *   bit 2:		enable/disable with the soft disable bit +	 *   bit 3:		soft disabled +	 * +	 * Note: The bits must be set atomically to prevent races +	 * from other writers. Reads of flags do not need to be in +	 * sync as they occur in critical sections. But the way flags +	 * is currently used, these changes do not affect the code +	 * except that when a change is made, it may have a slight +	 * delay in propagating the changes to other CPUs due to +	 * caching and such. Which is mostly OK ;-) +	 */ +	unsigned long		flags; +}; +  #define __TRACE_EVENT_FLAGS(name, value)				\  	static int __init trace_init_flags_##name(void)			\  	{								\ @@ -274,7 +333,7 @@ extern int trace_define_field(struct ftrace_event_call *call, const char *type,  extern int trace_add_event_call(struct ftrace_event_call *call);  extern void trace_remove_event_call(struct ftrace_event_call *call); -#define is_signed_type(type)	(((type)(-1)) < (type)0) +#define is_signed_type(type)	(((type)(-1)) < (type)1)  int trace_set_clr_event(const char *system, const char *event, int set); diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h index dd7c569aaca..661d374aeb2 100644 --- a/include/linux/genalloc.h +++ b/include/linux/genalloc.h @@ -29,6 +29,10 @@  #ifndef __GENALLOC_H__  #define __GENALLOC_H__ + +struct device; +struct device_node; +  /**   * Allocation callback function type definition   * @map: Pointer to bitmap @@ -105,4 +109,18 @@ extern unsigned long gen_pool_first_fit(unsigned long *map, unsigned long size,  extern unsigned long gen_pool_best_fit(unsigned long *map, unsigned long size,  		unsigned long start, unsigned int nr, void *data); +extern struct gen_pool *devm_gen_pool_create(struct device *dev, +		int min_alloc_order, int nid); +extern struct gen_pool *dev_get_gen_pool(struct device *dev); + +#ifdef CONFIG_OF +extern struct gen_pool *of_get_named_gen_pool(struct device_node *np, +	const char *propname, int index); +#else +static inline struct gen_pool *of_get_named_gen_pool(struct device_node *np, +	const char *propname, int index) +{ +	return NULL; +} +#endif  #endif /* __GENALLOC_H__ */ diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 29eb805ea4a..c1d6555d256 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h @@ -118,10 +118,8 @@  #ifdef CONFIG_PREEMPT_COUNT  # define preemptible()	(preempt_count() == 0 && !irqs_disabled()) -# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)  #else  # define preemptible()	0 -# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET  #endif  #if defined(CONFIG_SMP) || defined(CONFIG_GENERIC_HARDIRQS) diff --git a/include/linux/hash.h b/include/linux/hash.h index 61c97ae22e0..f09a0ae4d85 100644 --- a/include/linux/hash.h +++ b/include/linux/hash.h @@ -15,6 +15,7 @@   */  #include <asm/types.h> +#include <linux/compiler.h>  /* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */  #define GOLDEN_RATIO_PRIME_32 0x9e370001UL @@ -31,7 +32,7 @@  #error Wordsize not 32 or 64  #endif -static inline u64 hash_64(u64 val, unsigned int bits) +static __always_inline u64 hash_64(u64 val, unsigned int bits)  {  	u64 hash = val; diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index cc07d2777bb..d19a5c2d227 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -157,6 +157,7 @@ enum  hrtimer_base_type {  	HRTIMER_BASE_MONOTONIC,  	HRTIMER_BASE_REALTIME,  	HRTIMER_BASE_BOOTTIME, +	HRTIMER_BASE_TAI,  	HRTIMER_MAX_CLOCK_BASES,  }; @@ -327,7 +328,9 @@ extern ktime_t ktime_get(void);  extern ktime_t ktime_get_real(void);  extern ktime_t ktime_get_boottime(void);  extern ktime_t ktime_get_monotonic_offset(void); -extern ktime_t ktime_get_update_offsets(ktime_t *offs_real, ktime_t *offs_boot); +extern ktime_t ktime_get_clocktai(void); +extern ktime_t ktime_get_update_offsets(ktime_t *offs_real, ktime_t *offs_boot, +					 ktime_t *offs_tai);  DECLARE_PER_CPU(struct tick_device, tick_cpu_device); diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index ee1c244a62a..528454c2caa 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -99,7 +99,11 @@ extern int copy_pte_range(struct mm_struct *dst_mm, struct mm_struct *src_mm,  extern int handle_pte_fault(struct mm_struct *mm,  			    struct vm_area_struct *vma, unsigned long address,  			    pte_t *pte, pmd_t *pmd, unsigned int flags); -extern int split_huge_page(struct page *page); +extern int split_huge_page_to_list(struct page *page, struct list_head *list); +static inline int split_huge_page(struct page *page) +{ +	return split_huge_page_to_list(page, NULL); +}  extern void __split_huge_page_pmd(struct vm_area_struct *vma,  		unsigned long address, pmd_t *pmd);  #define split_huge_page_pmd(__vma, __address, __pmd)			\ @@ -186,6 +190,11 @@ extern int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vm  #define transparent_hugepage_enabled(__vma) 0  #define transparent_hugepage_flags 0UL +static inline int +split_huge_page_to_list(struct page *page, struct list_head *list) +{ +	return 0; +}  static inline int split_huge_page(struct page *page)  {  	return 0; diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 16e4e9a643f..3a62df310f2 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -58,6 +58,7 @@ void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma,  int hugetlb_prefault(struct address_space *, struct vm_area_struct *);  void hugetlb_report_meminfo(struct seq_file *);  int hugetlb_report_node_meminfo(int, char *); +void hugetlb_show_meminfo(void);  unsigned long hugetlb_total_pages(void);  int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,  			unsigned long address, unsigned int flags); @@ -114,6 +115,9 @@ static inline void hugetlb_report_meminfo(struct seq_file *m)  {  }  #define hugetlb_report_node_meminfo(n, buf)	0 +static inline void hugetlb_show_meminfo(void) +{ +}  #define follow_huge_pmd(mm, addr, pmd, write)	NULL  #define follow_huge_pud(mm, addr, pud, write)	NULL  #define prepare_hugepage_range(file, addr, len)	(-EINVAL) diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index df77ba9a816..c2559847d7e 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h @@ -27,6 +27,63 @@  #include <linux/types.h> + +/* + * Implementation of host controlled snapshot of the guest. + */ + +#define VSS_OP_REGISTER 128 + +enum hv_vss_op { +	VSS_OP_CREATE = 0, +	VSS_OP_DELETE, +	VSS_OP_HOT_BACKUP, +	VSS_OP_GET_DM_INFO, +	VSS_OP_BU_COMPLETE, +	/* +	 * Following operations are only supported with IC version >= 5.0 +	 */ +	VSS_OP_FREEZE, /* Freeze the file systems in the VM */ +	VSS_OP_THAW, /* Unfreeze the file systems */ +	VSS_OP_AUTO_RECOVER, +	VSS_OP_COUNT /* Number of operations, must be last */ +}; + + +/* + * Header for all VSS messages. + */ +struct hv_vss_hdr { +	__u8 operation; +	__u8 reserved[7]; +} __attribute__((packed)); + + +/* + * Flag values for the hv_vss_check_feature. Linux supports only + * one value. + */ +#define VSS_HBU_NO_AUTO_RECOVERY	0x00000005 + +struct hv_vss_check_feature { +	__u32 flags; +} __attribute__((packed)); + +struct hv_vss_check_dm_info { +	__u32 flags; +} __attribute__((packed)); + +struct hv_vss_msg { +	union { +		struct hv_vss_hdr vss_hdr; +		int error; +	}; +	union { +		struct hv_vss_check_feature vss_cf; +		struct hv_vss_check_dm_info dm_info; +	}; +} __attribute__((packed)); +  /*   * An implementation of HyperV key value pair (KVP) functionality for Linux.   * @@ -1253,6 +1310,25 @@ void vmbus_driver_unregister(struct hv_driver *hv_driver);  		}  /* + * VSS (Backup/Restore) GUID + */ +#define HV_VSS_GUID \ +	.guid = { \ +			0x29, 0x2e, 0xfa, 0x35, 0x23, 0xea, 0x36, 0x42, \ +			0x96, 0xae, 0x3a, 0x6e, 0xba, 0xcb, 0xa4,  0x40 \ +		} +/* + * Synthetic Video GUID + * {DA0A7802-E377-4aac-8E77-0558EB1073F8} + */ +#define HV_SYNTHVID_GUID \ +	.guid = { \ +			0x02, 0x78, 0x0a, 0xda, 0x77, 0xe3, 0xac, 0x4a, \ +			0x8e, 0x77, 0x05, 0x58, 0xeb, 0x10, 0x73, 0xf8 \ +		} + + +/*   * Common header for Hyper-V ICs   */ @@ -1356,6 +1432,10 @@ int hv_kvp_init(struct hv_util_service *);  void hv_kvp_deinit(void);  void hv_kvp_onchannelcallback(void *); +int hv_vss_init(struct hv_util_service *); +void hv_vss_deinit(void); +void hv_vss_onchannelcallback(void *); +  /*   * Negotiated version with the Host.   */ diff --git a/include/linux/i2c/atmel_mxt_ts.h b/include/linux/i2c/atmel_mxt_ts.h index f027f7a6351..99e379b7439 100644 --- a/include/linux/i2c/atmel_mxt_ts.h +++ b/include/linux/i2c/atmel_mxt_ts.h @@ -15,6 +15,9 @@  #include <linux/types.h> +/* For key_map array */ +#define MXT_NUM_GPIO		4 +  /* Orient */  #define MXT_NORMAL		0x0  #define MXT_DIAGONAL		0x1 @@ -39,6 +42,8 @@ struct mxt_platform_data {  	unsigned int voltage;  	unsigned char orient;  	unsigned long irqflags; +	bool is_tp; +	const unsigned int key_map[MXT_NUM_GPIO];  };  #endif /* __LINUX_ATMEL_MXT_TS_H */ diff --git a/include/linux/idr.h b/include/linux/idr.h index a6f38b5c34e..a470ac3ef49 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h @@ -42,6 +42,7 @@ struct idr {  	struct idr_layer	*id_free;  	int			layers;	/* only valid w/o concurrent changes */  	int			id_free_cnt; +	int			cur;	/* current pos for cyclic allocation */  	spinlock_t		lock;  }; @@ -73,10 +74,9 @@ struct idr {   */  void *idr_find_slowpath(struct idr *idp, int id); -int idr_pre_get(struct idr *idp, gfp_t gfp_mask); -int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id);  void idr_preload(gfp_t gfp_mask);  int idr_alloc(struct idr *idp, void *ptr, int start, int end, gfp_t gfp_mask); +int idr_alloc_cyclic(struct idr *idr, void *ptr, int start, int end, gfp_t gfp_mask);  int idr_for_each(struct idr *idp,  		 int (*fn)(int id, void *p, void *data), void *data);  void *idr_get_next(struct idr *idp, int *nextid); @@ -99,7 +99,7 @@ static inline void idr_preload_end(void)  /**   * idr_find - return pointer for given id - * @idp: idr handle + * @idr: idr handle   * @id: lookup key   *   * Return the pointer given the id it has been registered with.  A %NULL @@ -120,19 +120,6 @@ static inline void *idr_find(struct idr *idr, int id)  }  /** - * idr_get_new - allocate new idr entry - * @idp: idr handle - * @ptr: pointer you want associated with the id - * @id: pointer to the allocated handle - * - * Simple wrapper around idr_get_new_above() w/ @starting_id of zero. - */ -static inline int idr_get_new(struct idr *idp, void *ptr, int *id) -{ -	return idr_get_new_above(idp, ptr, 0, id); -} - -/**   * idr_for_each_entry - iterate over an idr's elements of a given type   * @idp:     idr handle   * @entry:   the type * to use as cursor @@ -143,7 +130,56 @@ static inline int idr_get_new(struct idr *idp, void *ptr, int *id)  	     entry != NULL;                                             \  	     ++id, entry = (typeof(entry))idr_get_next((idp), &(id))) -void __idr_remove_all(struct idr *idp);	/* don't use */ +/* + * Don't use the following functions.  These exist only to suppress + * deprecated warnings on EXPORT_SYMBOL()s. + */ +int __idr_pre_get(struct idr *idp, gfp_t gfp_mask); +int __idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); +void __idr_remove_all(struct idr *idp); + +/** + * idr_pre_get - reserve resources for idr allocation + * @idp:	idr handle + * @gfp_mask:	memory allocation flags + * + * Part of old alloc interface.  This is going away.  Use + * idr_preload[_end]() and idr_alloc() instead. + */ +static inline int __deprecated idr_pre_get(struct idr *idp, gfp_t gfp_mask) +{ +	return __idr_pre_get(idp, gfp_mask); +} + +/** + * idr_get_new_above - allocate new idr entry above or equal to a start id + * @idp: idr handle + * @ptr: pointer you want associated with the id + * @starting_id: id to start search at + * @id: pointer to the allocated handle + * + * Part of old alloc interface.  This is going away.  Use + * idr_preload[_end]() and idr_alloc() instead. + */ +static inline int __deprecated idr_get_new_above(struct idr *idp, void *ptr, +						 int starting_id, int *id) +{ +	return __idr_get_new_above(idp, ptr, starting_id, id); +} + +/** + * idr_get_new - allocate new idr entry + * @idp: idr handle + * @ptr: pointer you want associated with the id + * @id: pointer to the allocated handle + * + * Part of old alloc interface.  This is going away.  Use + * idr_preload[_end]() and idr_alloc() instead. + */ +static inline int __deprecated idr_get_new(struct idr *idp, void *ptr, int *id) +{ +	return __idr_get_new_above(idp, ptr, 0, id); +}  /**   * idr_remove_all - remove all ids from the given idr tree diff --git a/include/linux/iio/adc/ad_sigma_delta.h b/include/linux/iio/adc/ad_sigma_delta.h index 2e4eab9868a..e7fdec4db9d 100644 --- a/include/linux/iio/adc/ad_sigma_delta.h +++ b/include/linux/iio/adc/ad_sigma_delta.h @@ -133,9 +133,9 @@ int ad_sd_validate_trigger(struct iio_dev *indio_dev, struct iio_trigger *trig);  		.channel2 = (_channel2), \  		.address = (_address), \  		.extend_name = (_extend_name), \ -		.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ -			IIO_CHAN_INFO_SCALE_SHARED_BIT | \ -			IIO_CHAN_INFO_OFFSET_SEPARATE_BIT, \ +		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ +			BIT(IIO_CHAN_INFO_OFFSET), \ +		.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \  		.scan_index = (_si), \  		.scan_type = { \  			.sign = 'u', \ diff --git a/include/linux/iio/common/st_sensors.h b/include/linux/iio/common/st_sensors.h index 1f86a97ab2e..172c5b23cb8 100644 --- a/include/linux/iio/common/st_sensors.h +++ b/include/linux/iio/common/st_sensors.h @@ -15,6 +15,7 @@  #include <linux/spi/spi.h>  #include <linux/irqreturn.h>  #include <linux/iio/trigger.h> +#include <linux/bitops.h>  #define ST_SENSORS_TX_MAX_LENGTH		2  #define ST_SENSORS_RX_MAX_LENGTH		6 @@ -45,8 +46,8 @@  { \  	.type = device_type, \  	.modified = 1, \ -	.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ -			IIO_CHAN_INFO_SCALE_SEPARATE_BIT, \ +	.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ +			BIT(IIO_CHAN_INFO_SCALE), \  	.scan_index = index, \  	.channel2 = mod, \  	.address = addr, \ @@ -227,14 +228,17 @@ struct st_sensor_data {  };  #ifdef CONFIG_IIO_BUFFER +irqreturn_t st_sensors_trigger_handler(int irq, void *p); + +int st_sensors_get_buffer_element(struct iio_dev *indio_dev, u8 *buf); +#endif + +#ifdef CONFIG_IIO_TRIGGER  int st_sensors_allocate_trigger(struct iio_dev *indio_dev,  				const struct iio_trigger_ops *trigger_ops);  void st_sensors_deallocate_trigger(struct iio_dev *indio_dev); -irqreturn_t st_sensors_trigger_handler(int irq, void *p); - -int st_sensors_get_buffer_element(struct iio_dev *indio_dev, u8 *buf);  #else  static inline int st_sensors_allocate_trigger(struct iio_dev *indio_dev,  				const struct iio_trigger_ops *trigger_ops) diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index da8c776ba0b..8d171f42763 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h @@ -38,76 +38,6 @@ enum iio_chan_info_enum {  	IIO_CHAN_INFO_HYSTERESIS,  }; -#define IIO_CHAN_INFO_SHARED_BIT(type) BIT(type*2) -#define IIO_CHAN_INFO_SEPARATE_BIT(type) BIT(type*2 + 1) -#define IIO_CHAN_INFO_BITS(type) (IIO_CHAN_INFO_SHARED_BIT(type) | \ -				    IIO_CHAN_INFO_SEPARATE_BIT(type)) - -#define IIO_CHAN_INFO_RAW_SEPARATE_BIT			\ -	IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_RAW) -#define IIO_CHAN_INFO_PROCESSED_SEPARATE_BIT			\ -	IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_PROCESSED) -#define IIO_CHAN_INFO_SCALE_SEPARATE_BIT		\ -	IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_SCALE) -#define IIO_CHAN_INFO_SCALE_SHARED_BIT			\ -	IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_SCALE) -#define IIO_CHAN_INFO_OFFSET_SEPARATE_BIT			\ -	IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_OFFSET) -#define IIO_CHAN_INFO_OFFSET_SHARED_BIT			\ -	IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_OFFSET) -#define IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT			\ -	IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_CALIBSCALE) -#define IIO_CHAN_INFO_CALIBSCALE_SHARED_BIT			\ -	IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_CALIBSCALE) -#define IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT			\ -	IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_CALIBBIAS) -#define IIO_CHAN_INFO_CALIBBIAS_SHARED_BIT			\ -	IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_CALIBBIAS) -#define IIO_CHAN_INFO_PEAK_SEPARATE_BIT			\ -	IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_PEAK) -#define IIO_CHAN_INFO_PEAK_SHARED_BIT			\ -	IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_PEAK) -#define IIO_CHAN_INFO_PEAKSCALE_SEPARATE_BIT			\ -	IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_PEAKSCALE) -#define IIO_CHAN_INFO_PEAKSCALE_SHARED_BIT			\ -	IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_PEAKSCALE) -#define IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW_SEPARATE_BIT	\ -	IIO_CHAN_INFO_SEPARATE_BIT(				\ -		IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW) -#define IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW_SHARED_BIT	\ -	IIO_CHAN_INFO_SHARED_BIT(				\ -		IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW) -#define IIO_CHAN_INFO_AVERAGE_RAW_SEPARATE_BIT			\ -	IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_AVERAGE_RAW) -#define IIO_CHAN_INFO_AVERAGE_RAW_SHARED_BIT			\ -	IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_AVERAGE_RAW) -#define IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY_SHARED_BIT \ -	IIO_CHAN_INFO_SHARED_BIT(			       \ -		IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY) -#define IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY_SEPARATE_BIT \ -	IIO_CHAN_INFO_SEPARATE_BIT(			       \ -		IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY) -#define IIO_CHAN_INFO_SAMP_FREQ_SEPARATE_BIT		\ -	IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_SAMP_FREQ) -#define IIO_CHAN_INFO_SAMP_FREQ_SHARED_BIT			\ -	IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_SAMP_FREQ) -#define IIO_CHAN_INFO_FREQUENCY_SEPARATE_BIT			\ -	IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_FREQUENCY) -#define IIO_CHAN_INFO_FREQUENCY_SHARED_BIT			\ -	IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_FREQUENCY) -#define IIO_CHAN_INFO_PHASE_SEPARATE_BIT			\ -	IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_PHASE) -#define IIO_CHAN_INFO_PHASE_SHARED_BIT			\ -	IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_PHASE) -#define IIO_CHAN_INFO_HARDWAREGAIN_SEPARATE_BIT			\ -	IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_HARDWAREGAIN) -#define IIO_CHAN_INFO_HARDWAREGAIN_SHARED_BIT			\ -	IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_HARDWAREGAIN) -#define IIO_CHAN_INFO_HYSTERESIS_SEPARATE_BIT			\ -	IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_HYSTERESIS) -#define IIO_CHAN_INFO_HYSTERESIS_SHARED_BIT			\ -	IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_HYSTERESIS) -  enum iio_endian {  	IIO_CPU,  	IIO_BE, @@ -218,6 +148,10 @@ ssize_t iio_enum_write(struct iio_dev *indio_dev,   *			endianness:	little or big endian   * @info_mask:		What information is to be exported about this channel.   *			This includes calibbias, scale etc. + * @info_mask_separate: What information is to be exported that is specific to + *			this channel. + * @info_mask_shared_by_type: What information is to be exported that is shared +*			by all channels of the same type.   * @event_mask:		What events can this channel produce.   * @ext_info:		Array of extended info attributes for this channel.   *			The array is NULL terminated, the last element should @@ -253,6 +187,8 @@ struct iio_chan_spec {  		enum iio_endian endianness;  	} scan_type;  	long			info_mask; +	long			info_mask_separate; +	long			info_mask_shared_by_type;  	long			event_mask;  	const struct iio_chan_spec_ext_info *ext_info;  	const char		*extend_name; @@ -275,7 +211,8 @@ struct iio_chan_spec {  static inline bool iio_channel_has_info(const struct iio_chan_spec *chan,  	enum iio_chan_info_enum type)  { -	return chan->info_mask & IIO_CHAN_INFO_BITS(type); +	return (chan->info_mask_separate & type) | +	       (chan->info_mask_shared_by_type & type);  }  #define IIO_ST(si, rb, sb, sh)						\ diff --git a/include/linux/iio/imu/adis.h b/include/linux/iio/imu/adis.h index ff781dca2e9..b665dc7f017 100644 --- a/include/linux/iio/imu/adis.h +++ b/include/linux/iio/imu/adis.h @@ -162,8 +162,8 @@ int adis_single_conversion(struct iio_dev *indio_dev,  	.indexed = 1, \  	.channel = (chan), \  	.extend_name = name, \ -	.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ -		IIO_CHAN_INFO_SCALE_SEPARATE_BIT, \ +	.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ +		BIT(IIO_CHAN_INFO_SCALE), \  	.address = (addr), \  	.scan_index = (si), \  	.scan_type = { \ @@ -184,9 +184,9 @@ int adis_single_conversion(struct iio_dev *indio_dev,  	.type = IIO_TEMP, \  	.indexed = 1, \  	.channel = 0, \ -	.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ -		IIO_CHAN_INFO_SCALE_SEPARATE_BIT | \ -		IIO_CHAN_INFO_OFFSET_SEPARATE_BIT, \ +	.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ +		BIT(IIO_CHAN_INFO_SCALE) | \ +		BIT(IIO_CHAN_INFO_OFFSET), \  	.address = (addr), \  	.scan_index = (si), \  	.scan_type = { \ @@ -197,13 +197,13 @@ int adis_single_conversion(struct iio_dev *indio_dev,  	}, \  } -#define ADIS_MOD_CHAN(_type, mod, addr, si, info, bits) { \ +#define ADIS_MOD_CHAN(_type, mod, addr, si, info_sep, bits) { \  	.type = (_type), \  	.modified = 1, \  	.channel2 = IIO_MOD_ ## mod, \ -	.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ -		 IIO_CHAN_INFO_SCALE_SHARED_BIT | \ -		 info, \ +	.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ +		 info_sep, \ +	.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \  	.address = (addr), \  	.scan_index = (si), \  	.scan_type = { \ @@ -214,17 +214,17 @@ int adis_single_conversion(struct iio_dev *indio_dev,  	}, \  } -#define ADIS_ACCEL_CHAN(mod, addr, si, info, bits) \ -	ADIS_MOD_CHAN(IIO_ACCEL, mod, addr, si, info, bits) +#define ADIS_ACCEL_CHAN(mod, addr, si, info_sep, bits) \ +	ADIS_MOD_CHAN(IIO_ACCEL, mod, addr, si, info_sep, bits) -#define ADIS_GYRO_CHAN(mod, addr, si, info, bits) \ -	ADIS_MOD_CHAN(IIO_ANGL_VEL, mod, addr, si, info, bits) +#define ADIS_GYRO_CHAN(mod, addr, si, info_sep, bits) \ +	ADIS_MOD_CHAN(IIO_ANGL_VEL, mod, addr, si, info_sep, bits) -#define ADIS_INCLI_CHAN(mod, addr, si, info, bits) \ -	ADIS_MOD_CHAN(IIO_INCLI, mod, addr, si, info, bits) +#define ADIS_INCLI_CHAN(mod, addr, si, info_sep, bits) \ +	ADIS_MOD_CHAN(IIO_INCLI, mod, addr, si, info_sep, bits) -#define ADIS_ROT_CHAN(mod, addr, si, info, bits) \ -	ADIS_MOD_CHAN(IIO_ROT, mod, addr, si, info, bits) +#define ADIS_ROT_CHAN(mod, addr, si, info_sep, bits) \ +	ADIS_MOD_CHAN(IIO_ROT, mod, addr, si, info_sep, bits)  #ifdef CONFIG_IIO_ADIS_LIB_BUFFER diff --git a/include/linux/iio/trigger.h b/include/linux/iio/trigger.h index c66e0a96f6e..3869c525b05 100644 --- a/include/linux/iio/trigger.h +++ b/include/linux/iio/trigger.h @@ -44,7 +44,6 @@ struct iio_trigger_ops {   * @id:			[INTERN] unique id number   * @name:		[DRIVER] unique name   * @dev:		[DRIVER] associated device (if relevant) - * @private_data:	[DRIVER] device specific data   * @list:		[INTERN] used in maintenance of global trigger list   * @alloc_list:		[DRIVER] used for driver specific trigger list   * @use_count:		use count for the trigger @@ -60,7 +59,6 @@ struct iio_trigger {  	const char			*name;  	struct device			dev; -	void				*private_data;  	struct list_head		list;  	struct list_head		alloc_list;  	int use_count; @@ -92,6 +90,30 @@ static inline void iio_trigger_get(struct iio_trigger *trig)  }  /** + * iio_device_set_drvdata() - Set trigger driver data + * @trig: IIO trigger structure + * @data: Driver specific data + * + * Allows to attach an arbitrary pointer to an IIO trigger, which can later be + * retrieved by iio_trigger_get_drvdata(). + */ +static inline void iio_trigger_set_drvdata(struct iio_trigger *trig, void *data) +{ +	dev_set_drvdata(&trig->dev, data); +} + +/** + * iio_trigger_get_drvdata() - Get trigger driver data + * @trig: IIO trigger structure + * + * Returns the data previously set with iio_trigger_set_drvdata() + */ +static inline void *iio_trigger_get_drvdata(struct iio_trigger *trig) +{ +	return dev_get_drvdata(&trig->dev); +} + +/**   * iio_trigger_register() - register a trigger with the IIO core   * @trig_info:	trigger to be registered   **/ diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 85ac9b9b72a..89b7c24a36e 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h @@ -192,6 +192,10 @@ extern struct resource * __request_region(struct resource *,  extern int __check_region(struct resource *, resource_size_t, resource_size_t);  extern void __release_region(struct resource *, resource_size_t,  				resource_size_t); +#ifdef CONFIG_MEMORY_HOTREMOVE +extern int release_mem_region_adjustable(struct resource *, resource_size_t, +				resource_size_t); +#endif  static inline int __deprecated check_region(resource_size_t s,  						resource_size_t n) diff --git a/include/linux/ipack.h b/include/linux/ipack.h index fea12cbb2ae..1888e06ddf6 100644 --- a/include/linux/ipack.h +++ b/include/linux/ipack.h @@ -207,19 +207,41 @@ int ipack_driver_register(struct ipack_driver *edrv, struct module *owner,  void ipack_driver_unregister(struct ipack_driver *edrv);  /** - *	ipack_device_register -- register an IPack device with the kernel - *	@dev: the new device to register. + *	ipack_device_init -- initialize an IPack device + * @dev: the new device to initialize.   * - *	Register a new IPack device ("module" in IndustryPack jargon). The call - *	is done by the carrier driver.  The carrier should populate the fields - *	bus and slot as well as the region array of @dev prior to calling this - *	function.  The rest of the fields will be allocated and populated - *	during registration. + * Initialize a new IPack device ("module" in IndustryPack jargon). The call + * is done by the carrier driver.  The carrier should populate the fields + * bus and slot as well as the region array of @dev prior to calling this + * function.  The rest of the fields will be allocated and populated + * during initalization.   * - *	Return zero on success or error code on failure. + * Return zero on success or error code on failure. + * + * NOTE: _Never_ directly free @dev after calling this function, even + * if it returned an error! Always use ipack_put_device() to give up the + * reference initialized in this function instead. + */ +int ipack_device_init(struct ipack_device *dev); + +/** + *	ipack_device_add -- Add an IPack device + * @dev: the new device to add. + * + * Add a new IPack device. The call is done by the carrier driver + * after calling ipack_device_init(). + * + * Return zero on success or error code on failure. + * + * NOTE: _Never_ directly free @dev after calling this function, even + * if it returned an error! Always use ipack_put_device() to give up the + * reference initialized in this function instead.   */ -int ipack_device_register(struct ipack_device *dev); -void ipack_device_unregister(struct ipack_device *dev); +int ipack_device_add(struct ipack_device *dev); +void ipack_device_del(struct ipack_device *dev); + +void ipack_get_device(struct ipack_device *dev); +void ipack_put_device(struct ipack_device *dev);  /**   * DEFINE_IPACK_DEVICE_TABLE - macro used to describe a IndustryPack table diff --git a/include/linux/irq_work.h b/include/linux/irq_work.h index f5dbce50466..66017028dcb 100644 --- a/include/linux/irq_work.h +++ b/include/linux/irq_work.h @@ -37,7 +37,7 @@ void irq_work_sync(struct irq_work *work);  #ifdef CONFIG_IRQ_WORK  bool irq_work_needs_cpu(void);  #else -static bool irq_work_needs_cpu(void) { return false; } +static inline bool irq_work_needs_cpu(void) { return false; }  #endif  #endif /* _LINUX_IRQ_WORK_H */ diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index 82ed068b1eb..8fb8edf1241 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h @@ -75,7 +75,6 @@ extern int register_refined_jiffies(long clock_tick_rate);   */  extern u64 __jiffy_data jiffies_64;  extern unsigned long volatile __jiffy_data jiffies; -extern seqlock_t jiffies_lock;  #if (BITS_PER_LONG < 64)  u64 get_jiffies_64(void); diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 80d36874689..2dac79c3919 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -390,7 +390,6 @@ extern struct pid *session_of_pgrp(struct pid *pgrp);  unsigned long int_sqrt(unsigned long);  extern void bust_spinlocks(int yes); -extern void wake_up_klogd(void);  extern int oops_in_progress;		/* If set, an oops, panic(), BUG() or die() is in progress */  extern int panic_timeout;  extern int panic_on_oops; @@ -487,6 +486,8 @@ enum ftrace_dump_mode {  void tracing_on(void);  void tracing_off(void);  int tracing_is_on(void); +void tracing_snapshot(void); +void tracing_snapshot_alloc(void);  extern void tracing_start(void);  extern void tracing_stop(void); @@ -516,10 +517,32 @@ do {									\   *   * This is intended as a debugging tool for the developer only.   * Please refrain from leaving trace_printks scattered around in - * your code. + * your code. (Extra memory is used for special buffers that are + * allocated when trace_printk() is used) + * + * A little optization trick is done here. If there's only one + * argument, there's no need to scan the string for printf formats. + * The trace_puts() will suffice. But how can we take advantage of + * using trace_puts() when trace_printk() has only one argument? + * By stringifying the args and checking the size we can tell + * whether or not there are args. __stringify((__VA_ARGS__)) will + * turn into "()\0" with a size of 3 when there are no args, anything + * else will be bigger. All we need to do is define a string to this, + * and then take its size and compare to 3. If it's bigger, use + * do_trace_printk() otherwise, optimize it to trace_puts(). Then just + * let gcc optimize the rest.   */ -#define trace_printk(fmt, args...)					\ +#define trace_printk(fmt, ...)				\ +do {							\ +	char _______STR[] = __stringify((__VA_ARGS__));	\ +	if (sizeof(_______STR) > 3)			\ +		do_trace_printk(fmt, ##__VA_ARGS__);	\ +	else						\ +		trace_puts(fmt);			\ +} while (0) + +#define do_trace_printk(fmt, args...)					\  do {									\  	static const char *trace_printk_fmt				\  		__attribute__((section("__trace_printk_fmt"))) =	\ @@ -539,7 +562,45 @@ int __trace_bprintk(unsigned long ip, const char *fmt, ...);  extern __printf(2, 3)  int __trace_printk(unsigned long ip, const char *fmt, ...); -extern void trace_dump_stack(void); +/** + * trace_puts - write a string into the ftrace buffer + * @str: the string to record + * + * Note: __trace_bputs is an internal function for trace_puts and + *       the @ip is passed in via the trace_puts macro. + * + * This is similar to trace_printk() but is made for those really fast + * paths that a developer wants the least amount of "Heisenbug" affects, + * where the processing of the print format is still too much. + * + * This function allows a kernel developer to debug fast path sections + * that printk is not appropriate for. By scattering in various + * printk like tracing in the code, a developer can quickly see + * where problems are occurring. + * + * This is intended as a debugging tool for the developer only. + * Please refrain from leaving trace_puts scattered around in + * your code. (Extra memory is used for special buffers that are + * allocated when trace_puts() is used) + * + * Returns: 0 if nothing was written, positive # if string was. + *  (1 when __trace_bputs is used, strlen(str) when __trace_puts is used) + */ + +extern int __trace_bputs(unsigned long ip, const char *str); +extern int __trace_puts(unsigned long ip, const char *str, int size); +#define trace_puts(str) ({						\ +	static const char *trace_printk_fmt				\ +		__attribute__((section("__trace_printk_fmt"))) =	\ +		__builtin_constant_p(str) ? str : NULL;			\ +									\ +	if (__builtin_constant_p(str))					\ +		__trace_bputs(_THIS_IP_, trace_printk_fmt);		\ +	else								\ +		__trace_puts(_THIS_IP_, str, strlen(str));		\ +}) + +extern void trace_dump_stack(int skip);  /*   * The double __builtin_constant_p is because gcc will give us an error @@ -574,6 +635,8 @@ static inline void trace_dump_stack(void) { }  static inline void tracing_on(void) { }  static inline void tracing_off(void) { }  static inline int tracing_is_on(void) { return 0; } +static inline void tracing_snapshot(void) { } +static inline void tracing_snapshot_alloc(void) { }  static inline __printf(1, 2)  int trace_printk(const char *fmt, ...) diff --git a/include/linux/kexec.h b/include/linux/kexec.h index d2e6927bbaa..d78d28a733b 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h @@ -200,6 +200,8 @@ extern size_t vmcoreinfo_max_size;  int __init parse_crashkernel(char *cmdline, unsigned long long system_ram,  		unsigned long long *crash_size, unsigned long long *crash_base); +int parse_crashkernel_high(char *cmdline, unsigned long long system_ram, +		unsigned long long *crash_size, unsigned long long *crash_base);  int parse_crashkernel_low(char *cmdline, unsigned long long system_ram,  		unsigned long long *crash_size, unsigned long long *crash_base);  int crash_shrink_memory(unsigned long new_size); diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 4b6ef4d33cc..ca1d27a0d6a 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h @@ -29,6 +29,7 @@   *		<jkenisto@us.ibm.com>  and Prasanna S Panchamukhi   *		<prasanna@in.ibm.com> added function-return probes.   */ +#include <linux/compiler.h>	/* for __kprobes */  #include <linux/linkage.h>  #include <linux/list.h>  #include <linux/notifier.h> @@ -49,16 +50,11 @@  #define KPROBE_REENTER		0x00000004  #define KPROBE_HIT_SSDONE	0x00000008 -/* Attach to insert probes on any functions which should be ignored*/ -#define __kprobes	__attribute__((__section__(".kprobes.text"))) -  #else /* CONFIG_KPROBES */  typedef int kprobe_opcode_t;  struct arch_specific_insn {  	int dummy;  }; -#define __kprobes -  #endif /* CONFIG_KPROBES */  struct kprobe; diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index cad77fe09d7..c1395825192 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -518,7 +518,7 @@ int kvm_write_guest(struct kvm *kvm, gpa_t gpa, const void *data,  int kvm_write_guest_cached(struct kvm *kvm, struct gfn_to_hva_cache *ghc,  			   void *data, unsigned long len);  int kvm_gfn_to_hva_cache_init(struct kvm *kvm, struct gfn_to_hva_cache *ghc, -			      gpa_t gpa); +			      gpa_t gpa, unsigned long len);  int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, int offset, int len);  int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len);  struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn); diff --git a/include/linux/kvm_types.h b/include/linux/kvm_types.h index fa7cc7244cb..b0bcce0ddc9 100644 --- a/include/linux/kvm_types.h +++ b/include/linux/kvm_types.h @@ -71,6 +71,7 @@ struct gfn_to_hva_cache {  	u64 generation;  	gpa_t gpa;  	unsigned long hva; +	unsigned long len;  	struct kvm_memory_slot *memslot;  }; diff --git a/include/linux/libata.h b/include/linux/libata.h index 91c9d109e5f..eae7a053dc5 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -398,6 +398,7 @@ enum {  	ATA_HORKAGE_NOSETXFER	= (1 << 14),	/* skip SETXFER, SATA only */  	ATA_HORKAGE_BROKEN_FPDMA_AA	= (1 << 15),	/* skip AA */  	ATA_HORKAGE_DUMP_ID	= (1 << 16),	/* dump IDENTIFY data */ +	ATA_HORKAGE_MAX_SEC_LBA48 = (1 << 17),	/* Set max sects to 65535 */  	 /* DMA mask for user DMA control: User visible values; DO NOT  	    renumber */ diff --git a/include/linux/list.h b/include/linux/list.h index d991cc147c9..6a1f8df9144 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -667,7 +667,9 @@ static inline void hlist_move_list(struct hlist_head *old,  	     pos = n)  #define hlist_entry_safe(ptr, type, member) \ -	(ptr) ? hlist_entry(ptr, type, member) : NULL +	({ typeof(ptr) ____ptr = (ptr); \ +	   ____ptr ? hlist_entry(____ptr, type, member) : NULL; \ +	})  /**   * hlist_for_each_entry	- iterate over list of given type diff --git a/include/linux/list_bl.h b/include/linux/list_bl.h index 31f9d75adc5..2eb88556c5c 100644 --- a/include/linux/list_bl.h +++ b/include/linux/list_bl.h @@ -125,6 +125,11 @@ static inline void hlist_bl_unlock(struct hlist_bl_head *b)  	__bit_spin_unlock(0, (unsigned long *)b);  } +static inline bool hlist_bl_is_locked(struct hlist_bl_head *b) +{ +	return bit_spin_is_locked(0, (unsigned long *)b); +} +  /**   * hlist_bl_for_each_entry	- iterate over list of given type   * @tpos:	the type * to use as a loop cursor. diff --git a/include/linux/math64.h b/include/linux/math64.h index b8ba8554472..931a619407b 100644 --- a/include/linux/math64.h +++ b/include/linux/math64.h @@ -30,6 +30,15 @@ static inline s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder)  }  /** + * div64_u64_rem - unsigned 64bit divide with 64bit divisor + */ +static inline u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) +{ +	*remainder = dividend % divisor; +	return dividend / divisor; +} + +/**   * div64_u64 - unsigned 64bit divide with 64bit divisor   */  static inline u64 div64_u64(u64 dividend, u64 divisor) @@ -61,8 +70,16 @@ static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder)  extern s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder);  #endif +#ifndef div64_u64_rem +extern u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder); +#endif +  #ifndef div64_u64 -extern u64 div64_u64(u64 dividend, u64 divisor); +static inline u64 div64_u64(u64 dividend, u64 divisor) +{ +	u64 remainder; +	return div64_u64_rem(dividend, divisor, &remainder); +}  #endif  #ifndef div64_s64 diff --git a/include/linux/mei_cl_bus.h b/include/linux/mei_cl_bus.h new file mode 100644 index 00000000000..d14af7b722e --- /dev/null +++ b/include/linux/mei_cl_bus.h @@ -0,0 +1,44 @@ +#ifndef _LINUX_MEI_CL_BUS_H +#define _LINUX_MEI_CL_BUS_H + +#include <linux/device.h> +#include <linux/uuid.h> + +struct mei_cl_device; + +struct mei_cl_driver { +	struct device_driver driver; +	const char *name; + +	const struct mei_cl_device_id *id_table; + +	int (*probe)(struct mei_cl_device *dev, +		     const struct mei_cl_device_id *id); +	int (*remove)(struct mei_cl_device *dev); +}; + +int __mei_cl_driver_register(struct mei_cl_driver *driver, +				struct module *owner); +#define mei_cl_driver_register(driver)             \ +	__mei_cl_driver_register(driver, THIS_MODULE) + +void mei_cl_driver_unregister(struct mei_cl_driver *driver); + +int mei_cl_send(struct mei_cl_device *device, u8 *buf, size_t length); +int mei_cl_recv(struct mei_cl_device *device, u8 *buf, size_t length); + +typedef void (*mei_cl_event_cb_t)(struct mei_cl_device *device, +			       u32 events, void *context); +int mei_cl_register_event_cb(struct mei_cl_device *device, +			  mei_cl_event_cb_t read_cb, void *context); + +#define MEI_CL_EVENT_RX 0 +#define MEI_CL_EVENT_TX 1 + +void *mei_cl_get_drvdata(const struct mei_cl_device *device); +void mei_cl_set_drvdata(struct mei_cl_device *device, void *data); + +int mei_cl_enable_device(struct mei_cl_device *device); +int mei_cl_disable_device(struct mei_cl_device *device); + +#endif /* _LINUX_MEI_CL_BUS_H */ diff --git a/include/linux/memory.h b/include/linux/memory.h index 45e93b46887..73817af8b48 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h @@ -18,6 +18,7 @@  #include <linux/node.h>  #include <linux/compiler.h>  #include <linux/mutex.h> +#include <linux/notifier.h>  #define MIN_MEMORY_BLOCK_SIZE     (1UL << SECTION_SIZE_BITS) @@ -114,9 +115,10 @@ extern void unregister_memory_notifier(struct notifier_block *nb);  extern int register_memory_isolate_notifier(struct notifier_block *nb);  extern void unregister_memory_isolate_notifier(struct notifier_block *nb);  extern int register_new_memory(int, struct mem_section *); +#ifdef CONFIG_MEMORY_HOTREMOVE  extern int unregister_memory_section(struct mem_section *); +#endif  extern int memory_dev_init(void); -extern int remove_memory_block(unsigned long, struct mem_section *, int);  extern int memory_notify(unsigned long val, void *v);  extern int memory_isolate_notify(unsigned long val, void *v);  extern struct memory_block *find_memory_block_hinted(struct mem_section *, @@ -127,13 +129,18 @@ enum mem_add_context { BOOT, HOTPLUG };  #endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */  #ifdef CONFIG_MEMORY_HOTPLUG -#define hotplug_memory_notifier(fn, pri) {			\ +#define hotplug_memory_notifier(fn, pri) ({		\  	static __meminitdata struct notifier_block fn##_mem_nb =\ -		{ .notifier_call = fn, .priority = pri };	\ +		{ .notifier_call = fn, .priority = pri };\  	register_memory_notifier(&fn##_mem_nb);			\ -} +}) +#define register_hotmemory_notifier(nb)		register_memory_notifier(nb) +#define unregister_hotmemory_notifier(nb) 	unregister_memory_notifier(nb)  #else -#define hotplug_memory_notifier(fn, pri) do { } while (0) +#define hotplug_memory_notifier(fn, pri)	(0) +/* These aren't inline functions due to a GCC bug. */ +#define register_hotmemory_notifier(nb)    ({ (void)(nb); 0; }) +#define unregister_hotmemory_notifier(nb)  ({ (void)(nb); })  #endif  /* diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index b6a3be7d47b..3e622c61092 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h @@ -97,13 +97,13 @@ extern void __online_page_free(struct page *page);  #ifdef CONFIG_MEMORY_HOTREMOVE  extern bool is_pageblock_removable_nolock(struct page *page);  extern int arch_remove_memory(u64 start, u64 size); +extern int __remove_pages(struct zone *zone, unsigned long start_pfn, +	unsigned long nr_pages);  #endif /* CONFIG_MEMORY_HOTREMOVE */  /* reasonably generic interface to expand the physical pages in a zone  */  extern int __add_pages(int nid, struct zone *zone, unsigned long start_pfn,  	unsigned long nr_pages); -extern int __remove_pages(struct zone *zone, unsigned long start_pfn, -	unsigned long nr_pages);  #ifdef CONFIG_NUMA  extern int memory_add_physaddr_to_nid(u64 start); diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h index 9db0bda446a..84f449475c2 100644 --- a/include/linux/mfd/abx500/ab8500.h +++ b/include/linux/mfd/abx500/ab8500.h @@ -364,8 +364,7 @@ struct ab8500 {  	const int *irq_reg_offset;  }; -struct regulator_reg_init; -struct regulator_init_data; +struct ab8500_regulator_platform_data;  struct ab8500_gpio_platform_data;  struct ab8500_codec_platform_data;  struct ab8500_sysctrl_platform_data; @@ -375,19 +374,13 @@ struct ab8500_sysctrl_platform_data;   * @irq_base: start of AB8500 IRQs, AB8500_NR_IRQS will be used   * @pm_power_off: Should machine pm power off hook be registered or not   * @init: board-specific initialization after detection of ab8500 - * @num_regulator_reg_init: number of regulator init registers - * @regulator_reg_init: regulator init registers - * @num_regulator: number of regulators   * @regulator: machine-specific constraints for regulators   */  struct ab8500_platform_data {  	int irq_base;  	bool pm_power_off;  	void (*init) (struct ab8500 *); -	int num_regulator_reg_init; -	struct ab8500_regulator_reg_init *regulator_reg_init; -	int num_regulator; -	struct regulator_init_data *regulator; +	struct ab8500_regulator_platform_data *regulator;  	struct abx500_gpio_platform_data *gpio;  	struct ab8500_codec_platform_data *codec;  	struct ab8500_sysctrl_platform_data *sysctrl; diff --git a/include/linux/mfd/arizona/core.h b/include/linux/mfd/arizona/core.h index a710255528d..cc281368dc5 100644 --- a/include/linux/mfd/arizona/core.h +++ b/include/linux/mfd/arizona/core.h @@ -100,6 +100,9 @@ struct arizona {  	struct regmap_irq_chip_data *aod_irq_chip;  	struct regmap_irq_chip_data *irq_chip; +	bool hpdet_magic; +	unsigned int hp_ena; +  	struct mutex clk_lock;  	int clk32k_ref; diff --git a/include/linux/mfd/arizona/pdata.h b/include/linux/mfd/arizona/pdata.h index 455c51d22d6..a0f940987a3 100644 --- a/include/linux/mfd/arizona/pdata.h +++ b/include/linux/mfd/arizona/pdata.h @@ -86,6 +86,11 @@ struct arizona_micd_config {  	bool gpio;  }; +struct arizona_micd_range { +	int max;  /** Ohms */ +	int key;  /** Key to report to input layer */ +}; +  struct arizona_pdata {  	int reset;      /** GPIO controlling /RESET, if any */  	int ldoena;     /** GPIO controlling LODENA, if any */ @@ -117,12 +122,21 @@ struct arizona_pdata {  	/** GPIO5 is used for jack detection */  	bool jd_gpio5; +	/** Internal pull on GPIO5 is disabled when used for jack detection */ +	bool jd_gpio5_nopull; +  	/** Use the headphone detect circuit to identify the accessory */  	bool hpdet_acc_id; +	/** Check for line output with HPDET method */ +	bool hpdet_acc_id_line; +  	/** GPIO used for mic isolation with HPDET */  	int hpdet_id_gpio; +	/** Extra debounce timeout used during initial mic detection (ms) */ +	int micd_detect_debounce; +  	/** GPIO for mic detection polarity */  	int micd_pol_gpio; @@ -135,9 +149,16 @@ struct arizona_pdata {  	/** Mic detect debounce level */  	int micd_dbtime; +	/** Mic detect timeout (ms) */ +	int micd_timeout; +  	/** Force MICBIAS on for mic detect */  	bool micd_force_micbias; +	/** Mic detect level parameters */ +	const struct arizona_micd_range *micd_ranges; +	int num_micd_ranges; +  	/** Headset polarity configurations */  	struct arizona_micd_config *micd_configs;  	int num_micd_configs; diff --git a/include/linux/mfd/arizona/registers.h b/include/linux/mfd/arizona/registers.h index 34035513606..f43aa7c8d04 100644 --- a/include/linux/mfd/arizona/registers.h +++ b/include/linux/mfd/arizona/registers.h @@ -124,6 +124,10 @@  #define ARIZONA_MIC_DETECT_1                     0x2A3  #define ARIZONA_MIC_DETECT_2                     0x2A4  #define ARIZONA_MIC_DETECT_3                     0x2A5 +#define ARIZONA_MIC_DETECT_LEVEL_1		 0x2A6 +#define ARIZONA_MIC_DETECT_LEVEL_2		 0x2A7 +#define ARIZONA_MIC_DETECT_LEVEL_3		 0x2A8 +#define ARIZONA_MIC_DETECT_LEVEL_4		 0x2A9  #define ARIZONA_MIC_NOISE_MIX_CONTROL_1          0x2C3  #define ARIZONA_ISOLATION_CONTROL                0x2CB  #define ARIZONA_JACK_DETECT_ANALOGUE             0x2D3 diff --git a/include/linux/mfd/max77693-private.h b/include/linux/mfd/max77693-private.h index 5b18ecde69b..1aa4f13cdfa 100644 --- a/include/linux/mfd/max77693-private.h +++ b/include/linux/mfd/max77693-private.h @@ -106,6 +106,29 @@ enum max77693_muic_reg {  	MAX77693_MUIC_REG_END,  }; +/* MAX77693 INTMASK1~2 Register */ +#define INTMASK1_ADC1K_SHIFT		3 +#define INTMASK1_ADCERR_SHIFT		2 +#define INTMASK1_ADCLOW_SHIFT		1 +#define INTMASK1_ADC_SHIFT		0 +#define INTMASK1_ADC1K_MASK		(1 << INTMASK1_ADC1K_SHIFT) +#define INTMASK1_ADCERR_MASK		(1 << INTMASK1_ADCERR_SHIFT) +#define INTMASK1_ADCLOW_MASK		(1 << INTMASK1_ADCLOW_SHIFT) +#define INTMASK1_ADC_MASK		(1 << INTMASK1_ADC_SHIFT) + +#define INTMASK2_VIDRM_SHIFT		5 +#define INTMASK2_VBVOLT_SHIFT		4 +#define INTMASK2_DXOVP_SHIFT		3 +#define INTMASK2_DCDTMR_SHIFT		2 +#define INTMASK2_CHGDETRUN_SHIFT	1 +#define INTMASK2_CHGTYP_SHIFT		0 +#define INTMASK2_VIDRM_MASK		(1 << INTMASK2_VIDRM_SHIFT) +#define INTMASK2_VBVOLT_MASK		(1 << INTMASK2_VBVOLT_SHIFT) +#define INTMASK2_DXOVP_MASK		(1 << INTMASK2_DXOVP_SHIFT) +#define INTMASK2_DCDTMR_MASK		(1 << INTMASK2_DCDTMR_SHIFT) +#define INTMASK2_CHGDETRUN_MASK		(1 << INTMASK2_CHGDETRUN_SHIFT) +#define INTMASK2_CHGTYP_MASK		(1 << INTMASK2_CHGTYP_SHIFT) +  /* MAX77693 MUIC - STATUS1~3 Register */  #define STATUS1_ADC_SHIFT		(0)  #define STATUS1_ADCLOW_SHIFT		(5) diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h index a4d13d7cd00..ecddc5173c7 100644 --- a/include/linux/mfd/palmas.h +++ b/include/linux/mfd/palmas.h @@ -109,19 +109,6 @@ struct palmas_reg_init {  	 */  	int mode_sleep; -	/* tstep is the timestep loaded to the TSTEP register -	 * -	 * For SMPS -	 * -	 * 0: Jump (no slope control) -	 * 1: 10mV/us -	 * 2: 5mV/us -	 * 3: 2.5mV/us -	 * -	 * For LDO unused -	 */ -	int tstep; -  	/* voltage_sel is the bitfield loaded onto the SMPSX_VOLTAGE  	 * register. Set this is the default voltage set in OTP needs  	 * to be overridden. @@ -154,6 +141,12 @@ enum palmas_regulators {  	PALMAS_REG_LDO9,  	PALMAS_REG_LDOLN,  	PALMAS_REG_LDOUSB, +	/* External regulators */ +	PALMAS_REG_REGEN1, +	PALMAS_REG_REGEN2, +	PALMAS_REG_REGEN3, +	PALMAS_REG_SYSEN1, +	PALMAS_REG_SYSEN2,  	/* Total number of regulators */  	PALMAS_NUM_REGS,  }; @@ -171,6 +164,9 @@ struct palmas_pmic_platform_data {  	/* use LDO6 for vibrator control */  	int ldo6_vibrator; + +	/* Enable tracking mode of LDO8 */ +	bool enable_ldo8_tracking;  };  struct palmas_usb_platform_data { @@ -221,6 +217,7 @@ struct palmas_clk_platform_data {  };  struct palmas_platform_data { +	int irq_flags;  	int gpio_base;  	/* bit value to be loaded to the POWER_CTRL register */ @@ -330,6 +327,8 @@ struct palmas_pmic {  	int smps457;  	int range[PALMAS_REG_SMPS10]; +	unsigned int ramp_delay[PALMAS_REG_SMPS10]; +	unsigned int current_reg_mode[PALMAS_REG_SMPS10];  };  struct palmas_resource { diff --git a/include/linux/mfd/tps65217.h b/include/linux/mfd/tps65217.h index 290762f9393..29eab2bd3df 100644 --- a/include/linux/mfd/tps65217.h +++ b/include/linux/mfd/tps65217.h @@ -228,6 +228,7 @@ enum tps65217_bl_fdim {  struct tps65217_bl_pdata {  	enum tps65217_bl_isel isel;  	enum tps65217_bl_fdim fdim; +	int dft_brightness;  };  /** diff --git a/include/linux/mfd/tps65912.h b/include/linux/mfd/tps65912.h index aaceab402ec..6d309032dc0 100644 --- a/include/linux/mfd/tps65912.h +++ b/include/linux/mfd/tps65912.h @@ -323,5 +323,6 @@ int tps65912_device_init(struct tps65912 *tps65912);  void tps65912_device_exit(struct tps65912 *tps65912);  int tps65912_irq_init(struct tps65912 *tps65912, int irq,  			struct tps65912_platform_data *pdata); +int tps65912_irq_exit(struct tps65912 *tps65912);  #endif /*  __LINUX_MFD_TPS65912_H */ diff --git a/include/linux/mfd/wm831x/auxadc.h b/include/linux/mfd/wm831x/auxadc.h index b132067e9e9..867aa23f937 100644 --- a/include/linux/mfd/wm831x/auxadc.h +++ b/include/linux/mfd/wm831x/auxadc.h @@ -15,6 +15,8 @@  #ifndef __MFD_WM831X_AUXADC_H__  #define __MFD_WM831X_AUXADC_H__ +struct wm831x; +  /*   * R16429 (0x402D) - AuxADC Data   */ diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h index 4a3b83a7761..76c22648436 100644 --- a/include/linux/mfd/wm831x/core.h +++ b/include/linux/mfd/wm831x/core.h @@ -20,6 +20,7 @@  #include <linux/irqdomain.h>  #include <linux/list.h>  #include <linux/regmap.h> +#include <linux/mfd/wm831x/auxadc.h>  /*   * Register values. @@ -355,7 +356,6 @@ enum wm831x_parent {  };  struct wm831x; -enum wm831x_auxadc;  typedef int (*wm831x_auxadc_read_fn)(struct wm831x *wm831x,  				     enum wm831x_auxadc input); diff --git a/include/linux/mm.h b/include/linux/mm.h index 7acc9dc73c9..c05d7cfbb6b 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -44,6 +44,9 @@ extern int sysctl_legacy_va_layout;  #include <asm/pgtable.h>  #include <asm/processor.h> +extern unsigned long sysctl_user_reserve_kbytes; +extern unsigned long sysctl_admin_reserve_kbytes; +  #define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n))  /* to align the pointer to the (next) page boundary */ @@ -87,7 +90,6 @@ extern unsigned int kobjsize(const void *objp);  #define VM_PFNMAP	0x00000400	/* Page-ranges managed without "struct page", just pure PFN */  #define VM_DENYWRITE	0x00000800	/* ETXTBSY on write attempts.. */ -#define VM_POPULATE     0x00001000  #define VM_LOCKED	0x00002000  #define VM_IO           0x00004000	/* Memory mapped I/O or similar */ @@ -900,7 +902,8 @@ extern void pagefault_out_of_memory(void);   * Flags passed to show_mem() and show_free_areas() to suppress output in   * various contexts.   */ -#define SHOW_MEM_FILTER_NODES	(0x0001u)	/* filter disallowed nodes */ +#define SHOW_MEM_FILTER_NODES		(0x0001u)	/* disallowed nodes */ +#define SHOW_MEM_FILTER_PAGE_COUNT	(0x0002u)	/* page type count */  extern void show_free_areas(unsigned int flags);  extern bool skip_free_areas_node(unsigned int flags, int nid); @@ -1295,6 +1298,61 @@ extern void free_area_init_node(int nid, unsigned long * zones_size,  		unsigned long zone_start_pfn, unsigned long *zholes_size);  extern void free_initmem(void); +/* + * Free reserved pages within range [PAGE_ALIGN(start), end & PAGE_MASK) + * into the buddy system. The freed pages will be poisoned with pattern + * "poison" if it's non-zero. + * Return pages freed into the buddy system. + */ +extern unsigned long free_reserved_area(unsigned long start, unsigned long end, +					int poison, char *s); +#ifdef	CONFIG_HIGHMEM +/* + * Free a highmem page into the buddy system, adjusting totalhigh_pages + * and totalram_pages. + */ +extern void free_highmem_page(struct page *page); +#endif + +static inline void adjust_managed_page_count(struct page *page, long count) +{ +	totalram_pages += count; +} + +/* Free the reserved page into the buddy system, so it gets managed. */ +static inline void __free_reserved_page(struct page *page) +{ +	ClearPageReserved(page); +	init_page_count(page); +	__free_page(page); +} + +static inline void free_reserved_page(struct page *page) +{ +	__free_reserved_page(page); +	adjust_managed_page_count(page, 1); +} + +static inline void mark_page_reserved(struct page *page) +{ +	SetPageReserved(page); +	adjust_managed_page_count(page, -1); +} + +/* + * Default method to free all the __init memory into the buddy system. + * The freed pages will be poisoned with pattern "poison" if it is + * non-zero. Return pages freed into the buddy system. + */ +static inline unsigned long free_initmem_default(int poison) +{ +	extern char __init_begin[], __init_end[]; + +	return free_reserved_area(PAGE_ALIGN((unsigned long)&__init_begin) , +				  ((unsigned long)&__init_end) & PAGE_MASK, +				  poison, "unused kernel"); +} +  #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP  /*   * With CONFIG_HAVE_MEMBLOCK_NODE_MAP set, an architecture may initialise its @@ -1612,6 +1670,8 @@ int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr,  			unsigned long pfn);  int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr,  			unsigned long pfn); +int vm_iomap_memory(struct vm_area_struct *vma, phys_addr_t start, unsigned long len); +  struct page *follow_page_mask(struct vm_area_struct *vma,  			      unsigned long address, unsigned int foll_flags, @@ -1674,8 +1734,12 @@ int in_gate_area_no_mm(unsigned long addr);  #define in_gate_area(mm, addr) ({(void)mm; in_gate_area_no_mm(addr);})  #endif	/* __HAVE_ARCH_GATE_AREA */ +#ifdef CONFIG_SYSCTL +extern int sysctl_drop_caches;  int drop_caches_sysctl_handler(struct ctl_table *, int,  					void __user *, size_t *, loff_t *); +#endif +  unsigned long shrink_slab(struct shrink_control *shrink,  			  unsigned long nr_pages_scanned,  			  unsigned long lru_pages); @@ -1703,12 +1767,12 @@ pte_t *vmemmap_pte_populate(pmd_t *pmd, unsigned long addr, int node);  void *vmemmap_alloc_block(unsigned long size, int node);  void *vmemmap_alloc_block_buf(unsigned long size, int node);  void vmemmap_verify(pte_t *, int, unsigned long, unsigned long); -int vmemmap_populate_basepages(struct page *start_page, -						unsigned long pages, int node); -int vmemmap_populate(struct page *start_page, unsigned long pages, int node); +int vmemmap_populate_basepages(unsigned long start, unsigned long end, +			       int node); +int vmemmap_populate(unsigned long start, unsigned long end, int node);  void vmemmap_populate_print_last(void);  #ifdef CONFIG_MEMORY_HOTPLUG -void vmemmap_free(struct page *memmap, unsigned long nr_pages); +void vmemmap_free(unsigned long start, unsigned long end);  #endif  void register_page_bootmem_memmap(unsigned long section_nr, struct page *map,  				  unsigned long size); @@ -1755,5 +1819,11 @@ static inline unsigned int debug_guardpage_minorder(void) { return 0; }  static inline bool page_is_guard(struct page *page) { return false; }  #endif /* CONFIG_DEBUG_PAGEALLOC */ +#if MAX_NUMNODES > 1 +void __init setup_nr_node_ids(void); +#else +static inline void setup_nr_node_ids(void) {} +#endif +  #endif /* __KERNEL__ */  #endif /* _LINUX_MM_H */ diff --git a/include/linux/mman.h b/include/linux/mman.h index 61c7a87e5d2..9aa863da287 100644 --- a/include/linux/mman.h +++ b/include/linux/mman.h @@ -79,8 +79,6 @@ calc_vm_flag_bits(unsigned long flags)  {  	return _calc_vm_trans(flags, MAP_GROWSDOWN,  VM_GROWSDOWN ) |  	       _calc_vm_trans(flags, MAP_DENYWRITE,  VM_DENYWRITE ) | -	       ((flags & MAP_LOCKED) ? (VM_LOCKED | VM_POPULATE) : 0) | -	       (((flags & (MAP_POPULATE | MAP_NONBLOCK)) == MAP_POPULATE) ? -							VM_POPULATE : 0); +	       _calc_vm_trans(flags, MAP_LOCKED,     VM_LOCKED    );  }  #endif /* _LINUX_MMAN_H */ diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 2570216b844..5c76737d836 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -527,7 +527,7 @@ static inline int zone_is_oom_locked(const struct zone *zone)  	return test_bit(ZONE_OOM_LOCKED, &zone->flags);  } -static inline unsigned zone_end_pfn(const struct zone *zone) +static inline unsigned long zone_end_pfn(const struct zone *zone)  {  	return zone->zone_start_pfn + zone->spanned_pages;  } diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 779cf7c4a3d..b508016fb76 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h @@ -9,6 +9,7 @@  #ifdef __KERNEL__  #include <linux/types.h> +#include <linux/uuid.h>  typedef unsigned long kernel_ulong_t;  #endif @@ -568,4 +569,12 @@ struct ipack_device_id {  	__u32 device;			/* Device ID or IPACK_ANY_ID */  }; +#define MEI_CL_MODULE_PREFIX "mei:" +#define MEI_CL_NAME_SIZE 32 + +struct mei_cl_device_id { +	char name[MEI_CL_NAME_SIZE]; +	kernel_ulong_t driver_info; +}; +  #endif /* LINUX_MOD_DEVICETABLE_H */ diff --git a/include/linux/mount.h b/include/linux/mount.h index d7029f4a191..73005f9957e 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h @@ -47,6 +47,8 @@ struct mnt_namespace;  #define MNT_INTERNAL	0x4000 +#define MNT_LOCK_READONLY	0x400000 +  struct vfsmount {  	struct dentry *mnt_root;	/* root of the mounted tree */  	struct super_block *mnt_sb;	/* pointer to superblock */ diff --git a/include/linux/msi.h b/include/linux/msi.h index ce93a341337..20c2d6dd5d2 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -13,14 +13,14 @@ struct msi_msg {  /* Helper functions */  struct irq_data;  struct msi_desc; -extern void mask_msi_irq(struct irq_data *data); -extern void unmask_msi_irq(struct irq_data *data); -extern void __read_msi_msg(struct msi_desc *entry, struct msi_msg *msg); -extern void __get_cached_msi_msg(struct msi_desc *entry, struct msi_msg *msg); -extern void __write_msi_msg(struct msi_desc *entry, struct msi_msg *msg); -extern void read_msi_msg(unsigned int irq, struct msi_msg *msg); -extern void get_cached_msi_msg(unsigned int irq, struct msi_msg *msg); -extern void write_msi_msg(unsigned int irq, struct msi_msg *msg); +void mask_msi_irq(struct irq_data *data); +void unmask_msi_irq(struct irq_data *data); +void __read_msi_msg(struct msi_desc *entry, struct msi_msg *msg); +void __get_cached_msi_msg(struct msi_desc *entry, struct msi_msg *msg); +void __write_msi_msg(struct msi_desc *entry, struct msi_msg *msg); +void read_msi_msg(unsigned int irq, struct msi_msg *msg); +void get_cached_msi_msg(unsigned int irq, struct msi_msg *msg); +void write_msi_msg(unsigned int irq, struct msi_msg *msg);  struct msi_desc {  	struct { @@ -54,9 +54,8 @@ struct msi_desc {   */  int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc);  void arch_teardown_msi_irq(unsigned int irq); -extern int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type); -extern void arch_teardown_msi_irqs(struct pci_dev *dev); -extern int arch_msi_check_device(struct pci_dev* dev, int nvec, int type); - +int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type); +void arch_teardown_msi_irqs(struct pci_dev *dev); +int arch_msi_check_device(struct pci_dev* dev, int nvec, int type);  #endif /* LINUX_MSI_H */ diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 7ccb3c59ed6..ef52d9c9145 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h @@ -187,6 +187,13 @@ typedef enum {   * This happens with the Renesas AG-AND chips, possibly others.   */  #define BBT_AUTO_REFRESH	0x00000080 +/* + * Chip requires ready check on read (for auto-incremented sequential read). + * True only for small page devices; large page devices do not support + * autoincrement. + */ +#define NAND_NEED_READRDY	0x00000100 +  /* Chip does not allow subpage writes */  #define NAND_NO_SUBPAGE_WRITE	0x00000200 diff --git a/include/linux/mutex.h b/include/linux/mutex.h index 9121595a8eb..433da8a1a42 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h @@ -53,6 +53,9 @@ struct mutex {  #if defined(CONFIG_DEBUG_MUTEXES) || defined(CONFIG_SMP)  	struct task_struct	*owner;  #endif +#ifdef CONFIG_MUTEX_SPIN_ON_OWNER +	void			*spin_mlock;	/* Spinner MCS lock */ +#endif  #ifdef CONFIG_DEBUG_MUTEXES  	const char 		*name;  	void			*magic; diff --git a/include/linux/mxsfb.h b/include/linux/mxsfb.h index f14943d5531..f80af867434 100644 --- a/include/linux/mxsfb.h +++ b/include/linux/mxsfb.h @@ -24,8 +24,8 @@  #define STMLCDIF_18BIT 2 /** pixel data bus to the display is of 18 bit width */  #define STMLCDIF_24BIT 3 /** pixel data bus to the display is of 24 bit width */ -#define FB_SYNC_DATA_ENABLE_HIGH_ACT	(1 << 6) -#define FB_SYNC_DOTCLK_FAILING_ACT	(1 << 7) /* failing/negtive edge sampling */ +#define MXSFB_SYNC_DATA_ENABLE_HIGH_ACT	(1 << 6) +#define MXSFB_SYNC_DOTCLK_FAILING_ACT	(1 << 7) /* failing/negtive edge sampling */  struct mxsfb_platform_data {  	struct fb_videomode *mode_list; @@ -44,6 +44,9 @@ struct mxsfb_platform_data {  				 * allocated. If specified,fb_size must also be specified.  				 * fb_phys must be unused by Linux.  				 */ +	u32 sync;		/* sync mask, contains MXSFB specifics not +				 * carried in fb_info->var.sync +				 */  };  #endif /* __LINUX_MXSFB_H */ diff --git a/include/linux/net.h b/include/linux/net.h index aa1673160a4..99c9f0c103c 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -240,8 +240,8 @@ do {								\  #define net_dbg_ratelimited(fmt, ...)				\  	net_ratelimited_function(pr_debug, fmt, ##__VA_ARGS__) -#define net_random()		random32() -#define net_srandom(seed)	srandom32((__force u32)seed) +#define net_random()		prandom_u32() +#define net_srandom(seed)	prandom_seed((__force u32)(seed))  extern int   	     kernel_sendmsg(struct socket *sock, struct msghdr *msg,  				    struct kvec *vec, size_t num, size_t len); diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index b3d00fa4b31..6151e903eef 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -210,9 +210,9 @@ struct netdev_hw_addr {  #define NETDEV_HW_ADDR_T_SLAVE		3  #define NETDEV_HW_ADDR_T_UNICAST	4  #define NETDEV_HW_ADDR_T_MULTICAST	5 -	bool			synced;  	bool			global_use;  	int			refcount; +	int			synced;  	struct rcu_head		rcu_head;  }; @@ -895,7 +895,7 @@ struct netdev_fcoe_hbainfo {   *   * int (*ndo_bridge_setlink)(struct net_device *dev, struct nlmsghdr *nlh)   * int (*ndo_bridge_getlink)(struct sk_buff *skb, u32 pid, u32 seq, - *			     struct net_device *dev) + *			     struct net_device *dev, u32 filter_mask)   *   * int (*ndo_change_carrier)(struct net_device *dev, bool new_carrier);   *	Called to change device carrier. Soft-devices (like dummy, team, etc) diff --git a/include/linux/netfilter/ipset/ip_set_ahash.h b/include/linux/netfilter/ipset/ip_set_ahash.h index ef9acd3c845..0214c4c146f 100644 --- a/include/linux/netfilter/ipset/ip_set_ahash.h +++ b/include/linux/netfilter/ipset/ip_set_ahash.h @@ -291,6 +291,7 @@ ip_set_hash_destroy(struct ip_set *set)  #define type_pf_data_tlist	TOKEN(TYPE, PF, _data_tlist)  #define type_pf_data_next	TOKEN(TYPE, PF, _data_next)  #define type_pf_data_flags	TOKEN(TYPE, PF, _data_flags) +#define type_pf_data_reset_flags TOKEN(TYPE, PF, _data_reset_flags)  #ifdef IP_SET_HASH_WITH_NETS  #define type_pf_data_match	TOKEN(TYPE, PF, _data_match)  #else @@ -385,9 +386,9 @@ type_pf_resize(struct ip_set *set, bool retried)  	struct ip_set_hash *h = set->data;  	struct htable *t, *orig = h->table;  	u8 htable_bits = orig->htable_bits; -	const struct type_pf_elem *data; +	struct type_pf_elem *data;  	struct hbucket *n, *m; -	u32 i, j; +	u32 i, j, flags = 0;  	int ret;  retry: @@ -412,9 +413,16 @@ retry:  		n = hbucket(orig, i);  		for (j = 0; j < n->pos; j++) {  			data = ahash_data(n, j); +#ifdef IP_SET_HASH_WITH_NETS +			flags = 0; +			type_pf_data_reset_flags(data, &flags); +#endif  			m = hbucket(t, HKEY(data, h->initval, htable_bits)); -			ret = type_pf_elem_add(m, data, AHASH_MAX(h), 0); +			ret = type_pf_elem_add(m, data, AHASH_MAX(h), flags);  			if (ret < 0) { +#ifdef IP_SET_HASH_WITH_NETS +				type_pf_data_flags(data, flags); +#endif  				read_unlock_bh(&set->lock);  				ahash_destroy(t);  				if (ret == -EAGAIN) @@ -836,9 +844,9 @@ type_pf_tresize(struct ip_set *set, bool retried)  	struct ip_set_hash *h = set->data;  	struct htable *t, *orig = h->table;  	u8 htable_bits = orig->htable_bits; -	const struct type_pf_elem *data; +	struct type_pf_elem *data;  	struct hbucket *n, *m; -	u32 i, j; +	u32 i, j, flags = 0;  	int ret;  	/* Try to cleanup once */ @@ -854,6 +862,8 @@ type_pf_tresize(struct ip_set *set, bool retried)  retry:  	ret = 0;  	htable_bits++; +	pr_debug("attempt to resize set %s from %u to %u, t %p\n", +		 set->name, orig->htable_bits, htable_bits, orig);  	if (!htable_bits) {  		/* In case we have plenty of memory :-) */  		pr_warning("Cannot increase the hashsize of set %s further\n", @@ -871,10 +881,17 @@ retry:  		n = hbucket(orig, i);  		for (j = 0; j < n->pos; j++) {  			data = ahash_tdata(n, j); +#ifdef IP_SET_HASH_WITH_NETS +			flags = 0; +			type_pf_data_reset_flags(data, &flags); +#endif  			m = hbucket(t, HKEY(data, h->initval, htable_bits)); -			ret = type_pf_elem_tadd(m, data, AHASH_MAX(h), 0, -						type_pf_data_timeout(data)); +			ret = type_pf_elem_tadd(m, data, AHASH_MAX(h), flags, +				ip_set_timeout_get(type_pf_data_timeout(data)));  			if (ret < 0) { +#ifdef IP_SET_HASH_WITH_NETS +				type_pf_data_flags(data, flags); +#endif  				read_unlock_bh(&set->lock);  				ahash_destroy(t);  				if (ret == -EAGAIN) @@ -1185,6 +1202,7 @@ type_pf_gc_init(struct ip_set *set)  #undef type_pf_data_tlist  #undef type_pf_data_next  #undef type_pf_data_flags +#undef type_pf_data_reset_flags  #undef type_pf_data_match  #undef type_pf_elem diff --git a/include/linux/notifier.h b/include/linux/notifier.h index d65746efc95..d14a4c36246 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h @@ -47,8 +47,11 @@   * runtime initialization.   */ +typedef	int (*notifier_fn_t)(struct notifier_block *nb, +			unsigned long action, void *data); +  struct notifier_block { -	int (*notifier_call)(struct notifier_block *, unsigned long, void *); +	notifier_fn_t notifier_call;  	struct notifier_block __rcu *next;  	int priority;  }; diff --git a/include/linux/nvme.h b/include/linux/nvme.h index c25cccaa555..4fa3b0b9b07 100644 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h @@ -137,6 +137,34 @@ enum {  	NVME_LBAF_RP_DEGRADED	= 3,  }; +struct nvme_smart_log { +	__u8			critical_warning; +	__u8			temperature[2]; +	__u8			avail_spare; +	__u8			spare_thresh; +	__u8			percent_used; +	__u8			rsvd6[26]; +	__u8			data_units_read[16]; +	__u8			data_units_written[16]; +	__u8			host_reads[16]; +	__u8			host_writes[16]; +	__u8			ctrl_busy_time[16]; +	__u8			power_cycles[16]; +	__u8			power_on_hours[16]; +	__u8			unsafe_shutdowns[16]; +	__u8			media_errors[16]; +	__u8			num_err_log_entries[16]; +	__u8			rsvd192[320]; +}; + +enum { +	NVME_SMART_CRIT_SPARE		= 1 << 0, +	NVME_SMART_CRIT_TEMPERATURE	= 1 << 1, +	NVME_SMART_CRIT_RELIABILITY	= 1 << 2, +	NVME_SMART_CRIT_MEDIA		= 1 << 3, +	NVME_SMART_CRIT_VOLATILE_MEMORY	= 1 << 4, +}; +  struct nvme_lba_range_type {  	__u8			type;  	__u8			attributes; diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 0e38e13eb24..e3dea75a078 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -149,7 +149,7 @@ static inline int page_cache_get_speculative(struct page *page)  {  	VM_BUG_ON(in_interrupt()); -#if !defined(CONFIG_SMP) && defined(CONFIG_TREE_RCU) +#ifdef CONFIG_TINY_RCU  # ifdef CONFIG_PREEMPT_COUNT  	VM_BUG_ON(!in_atomic());  # endif diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h index 9a22b5efb38..81b31613eb2 100644 --- a/include/linux/pci-acpi.h +++ b/include/linux/pci-acpi.h @@ -41,8 +41,37 @@ static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus)  	return DEVICE_ACPI_HANDLE(dev);  } + +void acpi_pci_add_bus(struct pci_bus *bus); +void acpi_pci_remove_bus(struct pci_bus *bus); + +#ifdef	CONFIG_ACPI_PCI_SLOT +void acpi_pci_slot_init(void); +void acpi_pci_slot_enumerate(struct pci_bus *bus, acpi_handle handle); +void acpi_pci_slot_remove(struct pci_bus *bus); +#else +static inline void acpi_pci_slot_init(void) { } +static inline void acpi_pci_slot_enumerate(struct pci_bus *bus, +					   acpi_handle handle) { } +static inline void acpi_pci_slot_remove(struct pci_bus *bus) { }  #endif +#ifdef	CONFIG_HOTPLUG_PCI_ACPI +void acpiphp_init(void); +void acpiphp_enumerate_slots(struct pci_bus *bus, acpi_handle handle); +void acpiphp_remove_slots(struct pci_bus *bus); +#else +static inline void acpiphp_init(void) { } +static inline void acpiphp_enumerate_slots(struct pci_bus *bus, +					   acpi_handle handle) { } +static inline void acpiphp_remove_slots(struct pci_bus *bus) { } +#endif + +#else	/* CONFIG_ACPI */ +static inline void acpi_pci_add_bus(struct pci_bus *bus) { } +static inline void acpi_pci_remove_bus(struct pci_bus *bus) { } +#endif	/* CONFIG_ACPI */ +  #ifdef CONFIG_ACPI_APEI  extern bool aer_acpi_firmware_first(void);  #else diff --git a/include/linux/pci-aspm.h b/include/linux/pci-aspm.h index c8320144fe7..8af4610c2e4 100644 --- a/include/linux/pci-aspm.h +++ b/include/linux/pci-aspm.h @@ -23,14 +23,14 @@  #define PCIE_LINK_STATE_CLKPM	4  #ifdef CONFIG_PCIEASPM -extern void pcie_aspm_init_link_state(struct pci_dev *pdev); -extern void pcie_aspm_exit_link_state(struct pci_dev *pdev); -extern void pcie_aspm_pm_state_change(struct pci_dev *pdev); -extern void pcie_aspm_powersave_config_link(struct pci_dev *pdev); -extern void pci_disable_link_state(struct pci_dev *pdev, int state); -extern void pci_disable_link_state_locked(struct pci_dev *pdev, int state); -extern void pcie_clear_aspm(struct pci_bus *bus); -extern void pcie_no_aspm(void); +void pcie_aspm_init_link_state(struct pci_dev *pdev); +void pcie_aspm_exit_link_state(struct pci_dev *pdev); +void pcie_aspm_pm_state_change(struct pci_dev *pdev); +void pcie_aspm_powersave_config_link(struct pci_dev *pdev); +void pci_disable_link_state(struct pci_dev *pdev, int state); +void pci_disable_link_state_locked(struct pci_dev *pdev, int state); +void pcie_clear_aspm(struct pci_bus *bus); +void pcie_no_aspm(void);  #else  static inline void pcie_aspm_init_link_state(struct pci_dev *pdev)  { @@ -56,8 +56,8 @@ static inline void pcie_no_aspm(void)  #endif  #ifdef CONFIG_PCIEASPM_DEBUG /* this depends on CONFIG_PCIEASPM */ -extern void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev); -extern void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev); +void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev); +void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev);  #else  static inline void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev)  { diff --git a/include/linux/pci-ats.h b/include/linux/pci-ats.h index 7ef68724f0f..68bcefd7fca 100644 --- a/include/linux/pci-ats.h +++ b/include/linux/pci-ats.h @@ -14,9 +14,9 @@ struct pci_ats {  #ifdef CONFIG_PCI_ATS -extern int pci_enable_ats(struct pci_dev *dev, int ps); -extern void pci_disable_ats(struct pci_dev *dev); -extern int pci_ats_queue_depth(struct pci_dev *dev); +int pci_enable_ats(struct pci_dev *dev, int ps); +void pci_disable_ats(struct pci_dev *dev); +int pci_ats_queue_depth(struct pci_dev *dev);  /**   * pci_ats_enabled - query the ATS status @@ -54,12 +54,12 @@ static inline int pci_ats_enabled(struct pci_dev *dev)  #ifdef CONFIG_PCI_PRI -extern int  pci_enable_pri(struct pci_dev *pdev, u32 reqs); -extern void pci_disable_pri(struct pci_dev *pdev); -extern bool pci_pri_enabled(struct pci_dev *pdev); -extern int  pci_reset_pri(struct pci_dev *pdev); -extern bool pci_pri_stopped(struct pci_dev *pdev); -extern int  pci_pri_status(struct pci_dev *pdev); +int pci_enable_pri(struct pci_dev *pdev, u32 reqs); +void pci_disable_pri(struct pci_dev *pdev); +bool pci_pri_enabled(struct pci_dev *pdev); +int pci_reset_pri(struct pci_dev *pdev); +bool pci_pri_stopped(struct pci_dev *pdev); +int pci_pri_status(struct pci_dev *pdev);  #else /* CONFIG_PCI_PRI */ @@ -95,10 +95,10 @@ static inline int pci_pri_status(struct pci_dev *pdev)  #ifdef CONFIG_PCI_PASID -extern int pci_enable_pasid(struct pci_dev *pdev, int features); -extern void pci_disable_pasid(struct pci_dev *pdev); -extern int pci_pasid_features(struct pci_dev *pdev); -extern int pci_max_pasids(struct pci_dev *pdev); +int pci_enable_pasid(struct pci_dev *pdev, int features); +void pci_disable_pasid(struct pci_dev *pdev); +int pci_pasid_features(struct pci_dev *pdev); +int pci_max_pasids(struct pci_dev *pdev);  #else  /* CONFIG_PCI_PASID */ diff --git a/include/linux/pci.h b/include/linux/pci.h index 2461033a798..e73dfa308b8 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -35,6 +35,21 @@  /* Include the ID list */  #include <linux/pci_ids.h> +/* + * The PCI interface treats multi-function devices as independent + * devices.  The slot/function address of each device is encoded + * in a single byte as follows: + * + *	7:3 = slot + *	2:0 = function + * PCI_DEVFN(), PCI_SLOT(), and PCI_FUNC() are defined uapi/linux/pci.h + * In the interest of not exposing interfaces to user-space unnecessarily, + * the following kernel only defines are being added here. + */ +#define PCI_DEVID(bus, devfn)  ((((u16)bus) << 8) | devfn) +/* return bus from PCI devid = ((u16)bus_number) << 8) | devfn */ +#define PCI_BUS_NUM(x) (((x) >> 8) & 0xff) +  /* pci_slot represents a physical slot */  struct pci_slot {  	struct pci_bus *bus;		/* The bus this slot is on */ @@ -232,6 +247,8 @@ struct pci_dev {  	u8		revision;	/* PCI revision, low byte of class word */  	u8		hdr_type;	/* PCI header type (`multi' flag masked out) */  	u8		pcie_cap;	/* PCI-E capability offset */ +	u8		msi_cap;	/* MSI capability offset */ +	u8		msix_cap;	/* MSI-X capability offset */  	u8		pcie_mpss:3;	/* PCI-E Max Payload Size Supported */  	u8		rom_base_reg;	/* which config register controls the ROM */  	u8		pin;  		/* which interrupt pin this device uses */ @@ -249,8 +266,7 @@ struct pci_dev {  	pci_power_t     current_state;  /* Current operating state. In ACPI-speak,  					   this is D0-D3, D0 being fully functional,  					   and D3 being off. */ -	int		pm_cap;		/* PM capability offset in the -					   configuration space */ +	u8		pm_cap;		/* PM capability offset */  	unsigned int	pme_support:5;	/* Bitmask of states from which PME#  					   can be generated */  	unsigned int	pme_interrupt:1; @@ -348,7 +364,7 @@ static inline struct pci_dev *pci_physfn(struct pci_dev *dev)  	return dev;  } -extern struct pci_dev *alloc_pci_dev(void); +struct pci_dev *alloc_pci_dev(void);  #define	to_pci_dev(n) container_of(n, struct pci_dev, dev)  #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) @@ -504,10 +520,10 @@ struct pci_ops {   * ACPI needs to be able to access PCI config space before we've done a   * PCI bus scan and created pci_bus structures.   */ -extern int raw_pci_read(unsigned int domain, unsigned int bus, -			unsigned int devfn, int reg, int len, u32 *val); -extern int raw_pci_write(unsigned int domain, unsigned int bus, -			unsigned int devfn, int reg, int len, u32 val); +int raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn, +		 int reg, int len, u32 *val); +int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn, +		  int reg, int len, u32 val);  struct pci_bus_region {  	resource_size_t start; @@ -658,7 +674,7 @@ struct pci_driver {  /* these external functions are only available when PCI support is enabled */  #ifdef CONFIG_PCI -extern void pcie_bus_configure_settings(struct pci_bus *bus, u8 smpss); +void pcie_bus_configure_settings(struct pci_bus *bus, u8 smpss);  enum pcie_bus_config_types {  	PCIE_BUS_TUNE_OFF, @@ -675,9 +691,11 @@ extern struct bus_type pci_bus_type;   * code, or pci core code. */  extern struct list_head pci_root_buses;	/* list of all known PCI buses */  /* Some device drivers need know if pci is initiated */ -extern int no_pci_devices(void); +int no_pci_devices(void);  void pcibios_resource_survey_bus(struct pci_bus *bus); +void pcibios_add_bus(struct pci_bus *bus); +void pcibios_remove_bus(struct pci_bus *bus);  void pcibios_fixup_bus(struct pci_bus *);  int __must_check pcibios_enable_device(struct pci_dev *, int mask);  /* Architecture specific versions may override this (weak) */ @@ -699,7 +717,7 @@ void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,  void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,  			     struct pci_bus_region *region);  void pcibios_scan_specific_bus(int busn); -extern struct pci_bus *pci_find_bus(int domain, int busnr); +struct pci_bus *pci_find_bus(int domain, int busnr);  void pci_bus_add_devices(const struct pci_bus *bus);  struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus,  				      struct pci_ops *ops, void *sysdata); @@ -732,14 +750,14 @@ struct resource *pci_find_parent_resource(const struct pci_dev *dev,  u8 pci_swizzle_interrupt_pin(const struct pci_dev *dev, u8 pin);  int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge);  u8 pci_common_swizzle(struct pci_dev *dev, u8 *pinp); -extern struct pci_dev *pci_dev_get(struct pci_dev *dev); -extern void pci_dev_put(struct pci_dev *dev); -extern void pci_remove_bus(struct pci_bus *b); -extern void pci_stop_and_remove_bus_device(struct pci_dev *dev); +struct pci_dev *pci_dev_get(struct pci_dev *dev); +void pci_dev_put(struct pci_dev *dev); +void pci_remove_bus(struct pci_bus *b); +void pci_stop_and_remove_bus_device(struct pci_dev *dev);  void pci_stop_root_bus(struct pci_bus *bus);  void pci_remove_root_bus(struct pci_bus *bus);  void pci_setup_cardbus(struct pci_bus *bus); -extern void pci_sort_breadthfirst(void); +void pci_sort_breadthfirst(void);  #define dev_is_pci(d) ((d)->bus == &pci_bus_type)  #define dev_is_pf(d) ((dev_is_pci(d) ? to_pci_dev(d)->is_physfn : false))  #define dev_num_vf(d) ((dev_is_pci(d) ? pci_num_vf(to_pci_dev(d)) : 0)) @@ -916,6 +934,7 @@ void pci_disable_rom(struct pci_dev *pdev);  void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size);  void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom);  size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem *rom, size_t size); +void __iomem __must_check *pci_platform_rom(struct pci_dev *pdev, size_t *size);  /* Power management related routines */  int pci_save_state(struct pci_dev *dev); @@ -1141,18 +1160,17 @@ static inline int pci_msi_enabled(void)  	return 0;  }  #else -extern int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec); -extern int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec); -extern void pci_msi_shutdown(struct pci_dev *dev); -extern void pci_disable_msi(struct pci_dev *dev); -extern int pci_msix_table_size(struct pci_dev *dev); -extern int pci_enable_msix(struct pci_dev *dev, -	struct msix_entry *entries, int nvec); -extern void pci_msix_shutdown(struct pci_dev *dev); -extern void pci_disable_msix(struct pci_dev *dev); -extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); -extern void pci_restore_msi_state(struct pci_dev *dev); -extern int pci_msi_enabled(void); +int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec); +int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec); +void pci_msi_shutdown(struct pci_dev *dev); +void pci_disable_msi(struct pci_dev *dev); +int pci_msix_table_size(struct pci_dev *dev); +int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec); +void pci_msix_shutdown(struct pci_dev *dev); +void pci_disable_msix(struct pci_dev *dev); +void msi_remove_pci_irq_vectors(struct pci_dev *dev); +void pci_restore_msi_state(struct pci_dev *dev); +int pci_msi_enabled(void);  #endif  #ifdef CONFIG_PCIEPORTBUS @@ -1167,8 +1185,8 @@ extern bool pcie_ports_auto;  static inline int pcie_aspm_enabled(void) { return 0; }  static inline bool pcie_aspm_support_enabled(void) { return false; }  #else -extern int pcie_aspm_enabled(void); -extern bool pcie_aspm_support_enabled(void); +int pcie_aspm_enabled(void); +bool pcie_aspm_support_enabled(void);  #endif  #ifdef CONFIG_PCIEAER @@ -1186,8 +1204,8 @@ static inline void pcie_set_ecrc_checking(struct pci_dev *dev)  }  static inline void pcie_ecrc_get_policy(char *str) {};  #else -extern void pcie_set_ecrc_checking(struct pci_dev *dev); -extern void pcie_ecrc_get_policy(char *str); +void pcie_set_ecrc_checking(struct pci_dev *dev); +void pcie_ecrc_get_policy(char *str);  #endif  #define pci_enable_msi(pdev)	pci_enable_msi_block(pdev, 1) @@ -1198,9 +1216,9 @@ int  ht_create_irq(struct pci_dev *dev, int idx);  void ht_destroy_irq(unsigned int irq);  #endif /* CONFIG_HT_IRQ */ -extern void pci_cfg_access_lock(struct pci_dev *dev); -extern bool pci_cfg_access_trylock(struct pci_dev *dev); -extern void pci_cfg_access_unlock(struct pci_dev *dev); +void pci_cfg_access_lock(struct pci_dev *dev); +bool pci_cfg_access_trylock(struct pci_dev *dev); +void pci_cfg_access_unlock(struct pci_dev *dev);  /*   * PCI domain support.  Sometimes called PCI segment (eg by ACPI), @@ -1225,7 +1243,7 @@ static inline int pci_proc_domain(struct pci_bus *bus)  /* some architectures require additional setup to direct VGA traffic */  typedef int (*arch_set_vga_state_t)(struct pci_dev *pdev, bool decode,  		      unsigned int command_bits, u32 flags); -extern void pci_register_set_vga_state(arch_set_vga_state_t func); +void pci_register_set_vga_state(arch_set_vga_state_t func);  #else /* CONFIG_PCI is not enabled */ @@ -1627,8 +1645,8 @@ int pcibios_set_pcie_reset_state(struct pci_dev *dev,  int pcibios_add_device(struct pci_dev *dev);  #ifdef CONFIG_PCI_MMCONFIG -extern void __init pci_mmcfg_early_init(void); -extern void __init pci_mmcfg_late_init(void); +void __init pci_mmcfg_early_init(void); +void __init pci_mmcfg_late_init(void);  #else  static inline void pci_mmcfg_early_init(void) { }  static inline void pci_mmcfg_late_init(void) { } @@ -1639,12 +1657,12 @@ int pci_ext_cfg_avail(void);  void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar);  #ifdef CONFIG_PCI_IOV -extern int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn); -extern void pci_disable_sriov(struct pci_dev *dev); -extern irqreturn_t pci_sriov_migration(struct pci_dev *dev); -extern int pci_num_vf(struct pci_dev *dev); -extern int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs); -extern int pci_sriov_get_totalvfs(struct pci_dev *dev); +int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn); +void pci_disable_sriov(struct pci_dev *dev); +irqreturn_t pci_sriov_migration(struct pci_dev *dev); +int pci_num_vf(struct pci_dev *dev); +int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs); +int pci_sriov_get_totalvfs(struct pci_dev *dev);  #else  static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)  { @@ -1672,8 +1690,8 @@ static inline int pci_sriov_get_totalvfs(struct pci_dev *dev)  #endif  #if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) -extern void pci_hp_create_module_link(struct pci_slot *pci_slot); -extern void pci_hp_remove_module_link(struct pci_slot *pci_slot); +void pci_hp_create_module_link(struct pci_slot *pci_slot); +void pci_hp_remove_module_link(struct pci_slot *pci_slot);  #endif  /** @@ -1817,13 +1835,13 @@ int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off,  /* PCI <-> OF binding helpers */  #ifdef CONFIG_OF  struct device_node; -extern void pci_set_of_node(struct pci_dev *dev); -extern void pci_release_of_node(struct pci_dev *dev); -extern void pci_set_bus_of_node(struct pci_bus *bus); -extern void pci_release_bus_of_node(struct pci_bus *bus); +void pci_set_of_node(struct pci_dev *dev); +void pci_release_of_node(struct pci_dev *dev); +void pci_set_bus_of_node(struct pci_bus *bus); +void pci_release_bus_of_node(struct pci_bus *bus);  /* Arch may override this (weak) */ -extern struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus); +struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus);  static inline struct device_node *  pci_device_to_OF_node(const struct pci_dev *pdev) diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h index 45fc162cbdc..8db71dcd633 100644 --- a/include/linux/pci_hotplug.h +++ b/include/linux/pci_hotplug.h @@ -125,12 +125,12 @@ static inline const char *hotplug_slot_name(const struct hotplug_slot *slot)  	return pci_slot_name(slot->pci_slot);  } -extern int __pci_hp_register(struct hotplug_slot *slot, struct pci_bus *pbus, -			     int nr, const char *name, -			     struct module *owner, const char *mod_name); -extern int pci_hp_deregister(struct hotplug_slot *slot); -extern int __must_check pci_hp_change_slot_info	(struct hotplug_slot *slot, -						 struct hotplug_slot_info *info); +int __pci_hp_register(struct hotplug_slot *slot, struct pci_bus *pbus, int nr, +		      const char *name, struct module *owner, +		      const char *mod_name); +int pci_hp_deregister(struct hotplug_slot *slot); +int __must_check pci_hp_change_slot_info(struct hotplug_slot *slot, +					 struct hotplug_slot_info *info);  /* use a define to avoid include chaining to get THIS_MODULE & friends */  #define pci_hp_register(slot, pbus, devnr, name) \ diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index f11c1c2609d..2b85c521f73 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -524,6 +524,8 @@  #define PCI_DEVICE_ID_AMD_15H_NB_F3	0x1603  #define PCI_DEVICE_ID_AMD_15H_NB_F4	0x1604  #define PCI_DEVICE_ID_AMD_15H_NB_F5	0x1605 +#define PCI_DEVICE_ID_AMD_16H_NB_F3	0x1533 +#define PCI_DEVICE_ID_AMD_16H_NB_F4	0x1534  #define PCI_DEVICE_ID_AMD_CNB17H_F3	0x1703  #define PCI_DEVICE_ID_AMD_LANCE		0x2000  #define PCI_DEVICE_ID_AMD_LANCE_HOME	0x2001 @@ -1604,6 +1606,7 @@  #define PCI_SUBDEVICE_ID_KEYSPAN_SX2	0x5334  #define PCI_VENDOR_ID_MARVELL		0x11ab +#define PCI_VENDOR_ID_MARVELL_EXT	0x1b4b  #define PCI_DEVICE_ID_MARVELL_GT64111	0x4146  #define PCI_DEVICE_ID_MARVELL_GT64260	0x6430  #define PCI_DEVICE_ID_MARVELL_MV64360	0x6460 diff --git a/include/linux/pcieport_if.h b/include/linux/pcieport_if.h index e6f91b1406d..9572669eea9 100644 --- a/include/linux/pcieport_if.h +++ b/include/linux/pcieport_if.h @@ -62,7 +62,7 @@ struct pcie_port_service_driver {  #define to_service_driver(d) \  	container_of(d, struct pcie_port_service_driver, driver) -extern int pcie_port_service_register(struct pcie_port_service_driver *new); -extern void pcie_port_service_unregister(struct pcie_port_service_driver *new); +int pcie_port_service_register(struct pcie_port_service_driver *new); +void pcie_port_service_unregister(struct pcie_port_service_driver *new);  #endif /* _PCIEPORT_IF_H_ */ diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index e47ee462c2f..e0373d26c24 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -21,7 +21,6 @@   */  #ifdef CONFIG_PERF_EVENTS -# include <linux/cgroup.h>  # include <asm/perf_event.h>  # include <asm/local64.h>  #endif @@ -128,6 +127,7 @@ struct hw_perf_event {  			int		event_base_rdpmc;  			int		idx;  			int		last_cpu; +			int		flags;  			struct hw_perf_event_extra extra_reg;  			struct hw_perf_event_extra branch_reg; @@ -299,22 +299,7 @@ struct swevent_hlist {  #define PERF_ATTACH_GROUP	0x02  #define PERF_ATTACH_TASK	0x04 -#ifdef CONFIG_CGROUP_PERF -/* - * perf_cgroup_info keeps track of time_enabled for a cgroup. - * This is a per-cpu dynamically allocated data structure. - */ -struct perf_cgroup_info { -	u64				time; -	u64				timestamp; -}; - -struct perf_cgroup { -	struct				cgroup_subsys_state css; -	struct				perf_cgroup_info *info;	/* timing info, one per cpu */ -}; -#endif - +struct perf_cgroup;  struct ring_buffer;  /** @@ -583,11 +568,13 @@ struct perf_sample_data {  		u32	reserved;  	}				cpu_entry;  	u64				period; +	union  perf_mem_data_src	data_src;  	struct perf_callchain_entry	*callchain;  	struct perf_raw_record		*raw;  	struct perf_branch_stack	*br_stack;  	struct perf_regs_user		regs_user;  	u64				stack_user_size; +	u64				weight;  };  static inline void perf_sample_data_init(struct perf_sample_data *data, @@ -601,6 +588,8 @@ static inline void perf_sample_data_init(struct perf_sample_data *data,  	data->regs_user.abi = PERF_SAMPLE_REGS_ABI_NONE;  	data->regs_user.regs = NULL;  	data->stack_user_size = 0; +	data->weight = 0; +	data->data_src.val = 0;  }  extern void perf_output_sample(struct perf_output_handle *handle, @@ -799,6 +788,12 @@ static inline int __perf_event_disable(void *info)			{ return -1; }  static inline void perf_event_task_tick(void)				{ }  #endif +#if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_CPU_SUP_INTEL) +extern void perf_restore_debug_store(void); +#else +static inline void perf_restore_debug_store(void)			{ } +#endif +  #define perf_output_put(handle, x) perf_output_copy((handle), &(x), sizeof(x))  /* @@ -825,6 +820,7 @@ do {									\  struct perf_pmu_events_attr {  	struct device_attribute attr;  	u64 id; +	const char *event_str;  };  #define PMU_EVENT_ATTR(_name, _var, _id, _show)				\ diff --git a/include/linux/pinctrl/pinconf.h b/include/linux/pinctrl/pinconf.h index e7a720104a4..1ad4f31ef6b 100644 --- a/include/linux/pinctrl/pinconf.h +++ b/include/linux/pinctrl/pinconf.h @@ -14,6 +14,8 @@  #ifdef CONFIG_PINCONF +#include <linux/pinctrl/machine.h> +  struct pinctrl_dev;  struct seq_file; @@ -28,6 +30,7 @@ struct seq_file;   * @pin_config_set: configure an individual pin   * @pin_config_group_get: get configurations for an entire pin group   * @pin_config_group_set: configure all pins in a group + * @pin_config_group_dbg_set: optional debugfs to modify a pin configuration   * @pin_config_dbg_show: optional debugfs display hook that will provide   *	per-device info for a certain pin in debugfs   * @pin_config_group_dbg_show: optional debugfs display hook that will provide @@ -51,6 +54,9 @@ struct pinconf_ops {  	int (*pin_config_group_set) (struct pinctrl_dev *pctldev,  				     unsigned selector,  				     unsigned long config); +	int (*pin_config_dbg_parse_modify) (struct pinctrl_dev *pctldev, +					   const char *arg, +					   unsigned long *config);  	void (*pin_config_dbg_show) (struct pinctrl_dev *pctldev,  				     struct seq_file *s,  				     unsigned offset); diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index 778804df293..2c2a9e8d857 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h @@ -118,9 +118,9 @@ struct pinctrl_desc {  	const char *name;  	struct pinctrl_pin_desc const *pins;  	unsigned int npins; -	struct pinctrl_ops *pctlops; -	struct pinmux_ops *pmxops; -	struct pinconf_ops *confops; +	const struct pinctrl_ops *pctlops; +	const struct pinmux_ops *pmxops; +	const struct pinconf_ops *confops;  	struct module *owner;  }; diff --git a/include/linux/platform_data/coda.h b/include/linux/platform_data/coda.h new file mode 100644 index 00000000000..6ad4410d9e2 --- /dev/null +++ b/include/linux/platform_data/coda.h @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2013 Philipp Zabel, Pengutronix + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ +#ifndef PLATFORM_CODA_H +#define PLATFORM_CODA_H + +struct device; + +struct coda_platform_data { +	struct device *iram_dev; +}; + +#endif diff --git a/include/linux/platform_data/dwc3-omap.h b/include/linux/platform_data/dwc3-omap.h index ada401244e0..1d36ca874cc 100644 --- a/include/linux/platform_data/dwc3-omap.h +++ b/include/linux/platform_data/dwc3-omap.h @@ -41,7 +41,3 @@ enum dwc3_omap_utmi_mode {  	DWC3_OMAP_UTMI_MODE_HW,  	DWC3_OMAP_UTMI_MODE_SW,  }; - -struct dwc3_omap_data { -	enum dwc3_omap_utmi_mode	utmi_mode; -}; diff --git a/include/linux/platform_data/emif_plat.h b/include/linux/platform_data/emif_plat.h index 03378ca8406..5c19a2a647c 100644 --- a/include/linux/platform_data/emif_plat.h +++ b/include/linux/platform_data/emif_plat.h @@ -40,6 +40,7 @@  /* Custom config requests */  #define EMIF_CUSTOM_CONFIG_LPMODE			0x00000001  #define EMIF_CUSTOM_CONFIG_TEMP_ALERT_POLL_INTERVAL	0x00000002 +#define EMIF_CUSTOM_CONFIG_EXTENDED_TEMP_PART		0x00000004  #ifndef __ASSEMBLY__  /** diff --git a/include/linux/platform_data/lp855x.h b/include/linux/platform_data/lp855x.h index 20ee8b221db..ea3200527dd 100644 --- a/include/linux/platform_data/lp855x.h +++ b/include/linux/platform_data/lp855x.h @@ -69,11 +69,6 @@ enum lp855x_chip_id {  	LP8557,  }; -enum lp855x_brightness_ctrl_mode { -	PWM_BASED = 1, -	REGISTER_BASED, -}; -  enum lp8550_brighntess_source {  	LP8550_PWM_ONLY,  	LP8550_I2C_ONLY = 2, @@ -116,24 +111,18 @@ struct lp855x_rom_data {  /**   * struct lp855x_platform_data   * @name : Backlight driver name. If it is not defined, default name is set. - * @mode : brightness control by pwm or lp855x register   * @device_control : value of DEVICE CONTROL register   * @initial_brightness : initial value of backlight brightness   * @period_ns : platform specific pwm period value. unit is nano.  		Only valid when mode is PWM_BASED. - * @load_new_rom_data : -	0 : use default configuration data -	1 : update values of eeprom or eprom registers on loading driver   * @size_program : total size of lp855x_rom_data   * @rom_data : list of new eeprom/eprom registers   */  struct lp855x_platform_data { -	char *name; -	enum lp855x_brightness_ctrl_mode mode; +	const char *name;  	u8 device_control; -	int initial_brightness; +	u8 initial_brightness;  	unsigned int period_ns; -	u8 load_new_rom_data;  	int size_program;  	struct lp855x_rom_data *rom_data;  }; diff --git a/include/linux/platform_data/mv_usb.h b/include/linux/platform_data/mv_usb.h index 944b01dd103..98b7925f1a2 100644 --- a/include/linux/platform_data/mv_usb.h +++ b/include/linux/platform_data/mv_usb.h @@ -34,8 +34,6 @@ struct mv_usb_addon_irq {  };  struct mv_usb_platform_data { -	unsigned int		clknum; -	char			**clkname;  	struct mv_usb_addon_irq	*id;	/* Only valid for OTG. ID pin change*/  	struct mv_usb_addon_irq	*vbus;	/* valid for OTG/UDC. VBUS change*/ diff --git a/include/linux/platform_data/ntc_thermistor.h b/include/linux/platform_data/ntc_thermistor.h index 88734e871e3..c7285b57546 100644 --- a/include/linux/platform_data/ntc_thermistor.h +++ b/include/linux/platform_data/ntc_thermistor.h @@ -21,6 +21,8 @@  #ifndef _LINUX_NTC_H  #define _LINUX_NTC_H +struct iio_channel; +  enum ntc_thermistor_type {  	TYPE_NCPXXWB473,  	TYPE_NCPXXWL333, @@ -39,13 +41,17 @@ struct ntc_thermistor_platform_data {  	 * described at Documentation/hwmon/ntc_thermistor  	 *  	 * pullup/down_ohm: 0 for infinite / not-connected +	 * +	 * chan: iio_channel pointer to communicate with the ADC which the +	 * thermistor is using for conversion of the analog values.  	 */ -	int (*read_uV)(void); -	unsigned int pullup_uV; +	int (*read_uv)(struct ntc_thermistor_platform_data *); +	unsigned int pullup_uv;  	unsigned int pullup_ohm;  	unsigned int pulldown_ohm;  	enum { NTC_CONNECTED_POSITIVE, NTC_CONNECTED_GROUND } connect; +	struct iio_channel *chan;  	int (*read_ohm)(void);  }; diff --git a/include/linux/platform_data/serial-sccnxp.h b/include/linux/platform_data/serial-sccnxp.h index 215574d1e81..bdc510d0324 100644 --- a/include/linux/platform_data/serial-sccnxp.h +++ b/include/linux/platform_data/serial-sccnxp.h @@ -86,10 +86,6 @@ struct sccnxp_pdata {  	const u32		mctrl_cfg[SCCNXP_MAX_UARTS];  	/* Timer value for polling mode (usecs) */  	const unsigned int	poll_time_us; -	/* Called during startup */ -	void (*init)(void); -	/* Called before finish */ -	void (*exit)(void);  };  #endif diff --git a/include/linux/platform_data/si5351.h b/include/linux/platform_data/si5351.h new file mode 100644 index 00000000000..92dabcaf649 --- /dev/null +++ b/include/linux/platform_data/si5351.h @@ -0,0 +1,114 @@ +/* + * Si5351A/B/C programmable clock generator platform_data. + */ + +#ifndef __LINUX_PLATFORM_DATA_SI5351_H__ +#define __LINUX_PLATFORM_DATA_SI5351_H__ + +struct clk; + +/** + * enum si5351_variant - SiLabs Si5351 chip variant + * @SI5351_VARIANT_A: Si5351A (8 output clocks, XTAL input) + * @SI5351_VARIANT_A3: Si5351A MSOP10 (3 output clocks, XTAL input) + * @SI5351_VARIANT_B: Si5351B (8 output clocks, XTAL/VXCO input) + * @SI5351_VARIANT_C: Si5351C (8 output clocks, XTAL/CLKIN input) + */ +enum si5351_variant { +	SI5351_VARIANT_A = 1, +	SI5351_VARIANT_A3 = 2, +	SI5351_VARIANT_B = 3, +	SI5351_VARIANT_C = 4, +}; + +/** + * enum si5351_pll_src - Si5351 pll clock source + * @SI5351_PLL_SRC_DEFAULT: default, do not change eeprom config + * @SI5351_PLL_SRC_XTAL: pll source clock is XTAL input + * @SI5351_PLL_SRC_CLKIN: pll source clock is CLKIN input (Si5351C only) + */ +enum si5351_pll_src { +	SI5351_PLL_SRC_DEFAULT = 0, +	SI5351_PLL_SRC_XTAL = 1, +	SI5351_PLL_SRC_CLKIN = 2, +}; + +/** + * enum si5351_multisynth_src - Si5351 multisynth clock source + * @SI5351_MULTISYNTH_SRC_DEFAULT: default, do not change eeprom config + * @SI5351_MULTISYNTH_SRC_VCO0: multisynth source clock is VCO0 + * @SI5351_MULTISYNTH_SRC_VCO1: multisynth source clock is VCO1/VXCO + */ +enum si5351_multisynth_src { +	SI5351_MULTISYNTH_SRC_DEFAULT = 0, +	SI5351_MULTISYNTH_SRC_VCO0 = 1, +	SI5351_MULTISYNTH_SRC_VCO1 = 2, +}; + +/** + * enum si5351_clkout_src - Si5351 clock output clock source + * @SI5351_CLKOUT_SRC_DEFAULT: default, do not change eeprom config + * @SI5351_CLKOUT_SRC_MSYNTH_N: clkout N source clock is multisynth N + * @SI5351_CLKOUT_SRC_MSYNTH_0_4: clkout N source clock is multisynth 0 (N<4) + *                                or 4 (N>=4) + * @SI5351_CLKOUT_SRC_XTAL: clkout N source clock is XTAL + * @SI5351_CLKOUT_SRC_CLKIN: clkout N source clock is CLKIN (Si5351C only) + */ +enum si5351_clkout_src { +	SI5351_CLKOUT_SRC_DEFAULT = 0, +	SI5351_CLKOUT_SRC_MSYNTH_N = 1, +	SI5351_CLKOUT_SRC_MSYNTH_0_4 = 2, +	SI5351_CLKOUT_SRC_XTAL = 3, +	SI5351_CLKOUT_SRC_CLKIN = 4, +}; + +/** + * enum si5351_drive_strength - Si5351 clock output drive strength + * @SI5351_DRIVE_DEFAULT: default, do not change eeprom config + * @SI5351_DRIVE_2MA: 2mA clock output drive strength + * @SI5351_DRIVE_4MA: 4mA clock output drive strength + * @SI5351_DRIVE_6MA: 6mA clock output drive strength + * @SI5351_DRIVE_8MA: 8mA clock output drive strength + */ +enum si5351_drive_strength { +	SI5351_DRIVE_DEFAULT = 0, +	SI5351_DRIVE_2MA = 2, +	SI5351_DRIVE_4MA = 4, +	SI5351_DRIVE_6MA = 6, +	SI5351_DRIVE_8MA = 8, +}; + +/** + * struct si5351_clkout_config - Si5351 clock output configuration + * @clkout: clkout number + * @multisynth_src: multisynth source clock + * @clkout_src: clkout source clock + * @pll_master: if true, clkout can also change pll rate + * @drive: output drive strength + * @rate: initial clkout rate, or default if 0 + */ +struct si5351_clkout_config { +	enum si5351_multisynth_src multisynth_src; +	enum si5351_clkout_src clkout_src; +	enum si5351_drive_strength drive; +	bool pll_master; +	unsigned long rate; +}; + +/** + * struct si5351_platform_data - Platform data for the Si5351 clock driver + * @variant: Si5351 chip variant + * @clk_xtal: xtal input clock + * @clk_clkin: clkin input clock + * @pll_src: array of pll source clock setting + * @clkout: array of clkout configuration + */ +struct si5351_platform_data { +	enum si5351_variant variant; +	struct clk *clk_xtal; +	struct clk *clk_clkin; +	enum si5351_pll_src pll_src[2]; +	struct si5351_clkout_config clkout[8]; +}; + +#endif diff --git a/include/linux/platform_data/spi-s3c64xx.h b/include/linux/platform_data/spi-s3c64xx.h index ceba18d23a5..8447f634c7f 100644 --- a/include/linux/platform_data/spi-s3c64xx.h +++ b/include/linux/platform_data/spi-s3c64xx.h @@ -11,6 +11,8 @@  #ifndef __S3C64XX_PLAT_SPI_H  #define __S3C64XX_PLAT_SPI_H +#include <linux/dmaengine.h> +  struct platform_device;  /** @@ -38,6 +40,7 @@ struct s3c64xx_spi_info {  	int src_clk_nr;  	int num_cs;  	int (*cfg_gpio)(void); +	dma_filter_fn filter;  };  /** diff --git a/include/linux/platform_data/video-vt8500lcdfb.h b/include/linux/platform_data/video-vt8500lcdfb.h deleted file mode 100644 index 7f399c370fe..00000000000 --- a/include/linux/platform_data/video-vt8500lcdfb.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - *  VT8500/WM8505 Frame Buffer platform data definitions - * - *  Copyright (C) 2010 Ed Spiridonov <edo.rus@gmail.com> - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * 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 _VT8500FB_H -#define _VT8500FB_H - -#include <linux/fb.h> - -struct vt8500fb_platform_data { -	struct fb_videomode	mode; -	u32			xres_virtual; -	u32			yres_virtual; -	u32			bpp; -	unsigned long		video_mem_phys; -	void			*video_mem_virt; -	unsigned long		video_mem_len; -}; - -#endif /* _VT8500FB_H */ diff --git a/include/linux/platform_data/video_s3c.h b/include/linux/platform_data/video_s3c.h new file mode 100644 index 00000000000..48883995f47 --- /dev/null +++ b/include/linux/platform_data/video_s3c.h @@ -0,0 +1,54 @@ +#ifndef __PLATFORM_DATA_VIDEO_S3C +#define __PLATFORM_DATA_VIDEO_S3C + +/* S3C_FB_MAX_WIN + * Set to the maximum number of windows that any of the supported hardware + * can use. Since the platform data uses this for an array size, having it + * set to the maximum of any version of the hardware can do is safe. + */ +#define S3C_FB_MAX_WIN	(5) + +/** + * struct s3c_fb_pd_win - per window setup data + * @xres     : The window X size. + * @yres     : The window Y size. + * @virtual_x: The virtual X size. + * @virtual_y: The virtual Y size. + */ +struct s3c_fb_pd_win { +	unsigned short		default_bpp; +	unsigned short		max_bpp; +	unsigned short		xres; +	unsigned short		yres; +	unsigned short		virtual_x; +	unsigned short		virtual_y; +}; + +/** + * struct s3c_fb_platdata -  S3C driver platform specific information + * @setup_gpio: Setup the external GPIO pins to the right state to transfer + *		the data from the display system to the connected display + *		device. + * @vidcon0: The base vidcon0 values to control the panel data format. + * @vidcon1: The base vidcon1 values to control the panel data output. + * @vtiming: Video timing when connected to a RGB type panel. + * @win: The setup data for each hardware window, or NULL for unused. + * @display_mode: The LCD output display mode. + * + * The platform data supplies the video driver with all the information + * it requires to work with the display(s) attached to the machine. It + * controls the initial mode, the number of display windows (0 is always + * the base framebuffer) that are initialised etc. + * + */ +struct s3c_fb_platdata { +	void	(*setup_gpio)(void); + +	struct s3c_fb_pd_win	*win[S3C_FB_MAX_WIN]; +	struct fb_videomode     *vtiming; + +	u32			 vidcon0; +	u32			 vidcon1; +}; + +#endif diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index c082c71f722..9abf1db6aea 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h @@ -20,12 +20,12 @@  struct mfd_cell;  struct platform_device { -	const char	* name; +	const char	*name;  	int		id;  	bool		id_auto;  	struct device	dev;  	u32		num_resources; -	struct resource	* resource; +	struct resource	*resource;  	const struct platform_device_id	*id_entry; @@ -47,9 +47,12 @@ extern struct bus_type platform_bus_type;  extern struct device platform_bus;  extern void arch_setup_pdev_archdata(struct platform_device *); -extern struct resource *platform_get_resource(struct platform_device *, unsigned int, unsigned int); +extern struct resource *platform_get_resource(struct platform_device *, +					      unsigned int, unsigned int);  extern int platform_get_irq(struct platform_device *, unsigned int); -extern struct resource *platform_get_resource_byname(struct platform_device *, unsigned int, const char *); +extern struct resource *platform_get_resource_byname(struct platform_device *, +						     unsigned int, +						     const char *);  extern int platform_get_irq_byname(struct platform_device *, const char *);  extern int platform_add_devices(struct platform_device **, int); @@ -161,7 +164,8 @@ extern struct platform_device *platform_device_alloc(const char *name, int id);  extern int platform_device_add_resources(struct platform_device *pdev,  					 const struct resource *res,  					 unsigned int num); -extern int platform_device_add_data(struct platform_device *pdev, const void *data, size_t size); +extern int platform_device_add_data(struct platform_device *pdev, +				    const void *data, size_t size);  extern int platform_device_add(struct platform_device *pdev);  extern void platform_device_del(struct platform_device *pdev);  extern void platform_device_put(struct platform_device *pdev); @@ -190,7 +194,8 @@ static inline void *platform_get_drvdata(const struct platform_device *pdev)  	return dev_get_drvdata(&pdev->dev);  } -static inline void platform_set_drvdata(struct platform_device *pdev, void *data) +static inline void platform_set_drvdata(struct platform_device *pdev, +					void *data)  {  	dev_set_drvdata(&pdev->dev, data);  } @@ -222,10 +227,10 @@ static void __exit __platform_driver##_exit(void) \  } \  module_exit(__platform_driver##_exit); -extern struct platform_device *platform_create_bundle(struct platform_driver *driver, -					int (*probe)(struct platform_device *), -					struct resource *res, unsigned int n_res, -					const void *data, size_t size); +extern struct platform_device *platform_create_bundle( +	struct platform_driver *driver, int (*probe)(struct platform_device *), +	struct resource *res, unsigned int n_res, +	const void *data, size_t size);  /* early platform driver interface */  struct early_platform_driver { diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h index 042058fdb0a..60bac697a91 100644 --- a/include/linux/posix-timers.h +++ b/include/linux/posix-timers.h @@ -55,6 +55,7 @@ struct cpu_timer_list {  /* POSIX.1b interval timer structure. */  struct k_itimer {  	struct list_head list;		/* free/ allocate list */ +	struct hlist_node t_hash;  	spinlock_t it_lock;  	clockid_t it_clock;		/* which timer type */  	timer_t it_id;			/* timer id */ diff --git a/include/linux/preempt.h b/include/linux/preempt.h index 5a710b9c578..87a03c746f1 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -93,14 +93,20 @@ do { \  #else /* !CONFIG_PREEMPT_COUNT */ -#define preempt_disable()		do { } while (0) -#define sched_preempt_enable_no_resched()	do { } while (0) -#define preempt_enable_no_resched()	do { } while (0) -#define preempt_enable()		do { } while (0) +/* + * Even if we don't have any preemption, we need preempt disable/enable + * to be barriers, so that we don't have things like get_user/put_user + * that can cause faults and scheduling migrate into our preempt-protected + * region. + */ +#define preempt_disable()		barrier() +#define sched_preempt_enable_no_resched()	barrier() +#define preempt_enable_no_resched()	barrier() +#define preempt_enable()		barrier() -#define preempt_disable_notrace()		do { } while (0) -#define preempt_enable_no_resched_notrace()	do { } while (0) -#define preempt_enable_notrace()		do { } while (0) +#define preempt_disable_notrace()		barrier() +#define preempt_enable_no_resched_notrace()	barrier() +#define preempt_enable_notrace()		barrier()  #endif /* CONFIG_PREEMPT_COUNT */ diff --git a/include/linux/printk.h b/include/linux/printk.h index 1249a54d17e..4890fe62c01 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -1,6 +1,7 @@  #ifndef __KERNEL_PRINTK__  #define __KERNEL_PRINTK__ +#include <stdarg.h>  #include <linux/init.h>  #include <linux/kern_levels.h> @@ -95,8 +96,14 @@ int no_printk(const char *fmt, ...)  	return 0;  } +#ifdef CONFIG_EARLY_PRINTK  extern asmlinkage __printf(1, 2)  void early_printk(const char *fmt, ...); +void early_vprintk(const char *fmt, va_list ap); +#else +static inline __printf(1, 2) __cold +void early_printk(const char *s, ...) { } +#endif  #ifdef CONFIG_PRINTK  asmlinkage __printf(5, 0) @@ -134,6 +141,8 @@ extern int printk_delay_msec;  extern int dmesg_restrict;  extern int kptr_restrict; +extern void wake_up_klogd(void); +  void log_buf_kexec_setup(void);  void __init setup_log_buf(int early);  #else @@ -162,6 +171,10 @@ static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies,  	return false;  } +static inline void wake_up_klogd(void) +{ +} +  static inline void log_buf_kexec_setup(void)  {  } diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 8307f2f94d8..94dfb2aa553 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -117,6 +117,7 @@ struct proc_dir_entry *proc_create_data(const char *name, umode_t mode,  				const struct file_operations *proc_fops,  				void *data);  extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent); +extern int remove_proc_subtree(const char *name, struct proc_dir_entry *parent);  struct pid_namespace; @@ -202,6 +203,7 @@ static inline struct proc_dir_entry *proc_create_data(const char *name,  	return NULL;  }  #define remove_proc_entry(name, parent) do {} while (0) +#define remove_proc_subtree(name, parent) do {} while (0)  static inline struct proc_dir_entry *proc_symlink(const char *name,  		struct proc_dir_entry *parent,const char *dest) {return NULL;} diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h index 5bf5500db83..69e37c2d1ea 100644 --- a/include/linux/ramfs.h +++ b/include/linux/ramfs.h @@ -6,7 +6,13 @@ struct inode *ramfs_get_inode(struct super_block *sb, const struct inode *dir,  extern struct dentry *ramfs_mount(struct file_system_type *fs_type,  	 int flags, const char *dev_name, void *data); -#ifndef CONFIG_MMU +#ifdef CONFIG_MMU +static inline int +ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize) +{ +	return 0; +} +#else  extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize);  extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file,  						   unsigned long addr, diff --git a/include/linux/rculist_bl.h b/include/linux/rculist_bl.h index cf1244fbf3b..4f216c59e7d 100644 --- a/include/linux/rculist_bl.h +++ b/include/linux/rculist_bl.h @@ -20,7 +20,7 @@ static inline void hlist_bl_set_first_rcu(struct hlist_bl_head *h,  static inline struct hlist_bl_node *hlist_bl_first_rcu(struct hlist_bl_head *h)  {  	return (struct hlist_bl_node *) -		((unsigned long)rcu_dereference(h->first) & ~LIST_BL_LOCKMASK); +		((unsigned long)rcu_dereference_check(h->first, hlist_bl_is_locked(h)) & ~LIST_BL_LOCKMASK);  }  /** diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index b758ce17b30..9ed2c9a4de4 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -80,6 +80,7 @@ extern void do_trace_rcu_torture_read(char *rcutorturename,  #define UINT_CMP_LT(a, b)	(UINT_MAX / 2 < (a) - (b))  #define ULONG_CMP_GE(a, b)	(ULONG_MAX / 2 >= (a) - (b))  #define ULONG_CMP_LT(a, b)	(ULONG_MAX / 2 < (a) - (b)) +#define ulong2long(a)		(*(long *)(&(a)))  /* Exported common interfaces */ diff --git a/include/linux/regmap.h b/include/linux/regmap.h index bf77dfdabef..02d84e24b7c 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h @@ -389,6 +389,7 @@ int regmap_update_bits_check(struct regmap *map, unsigned int reg,  			     bool *change);  int regmap_get_val_bytes(struct regmap *map);  int regmap_async_complete(struct regmap *map); +bool regmap_can_raw_write(struct regmap *map);  int regcache_sync(struct regmap *map);  int regcache_sync_region(struct regmap *map, unsigned int min, diff --git a/include/linux/regulator/ab8500.h b/include/linux/regulator/ab8500.h index 7bd73bbdfd1..7c5ff0c5577 100644 --- a/include/linux/regulator/ab8500.h +++ b/include/linux/regulator/ab8500.h @@ -5,11 +5,14 @@   *   * Authors: Sundar Iyer <sundar.iyer@stericsson.com> for ST-Ericsson   *          Bengt Jonsson <bengt.g.jonsson@stericsson.com> for ST-Ericsson + *          Daniel Willerud <daniel.willerud@stericsson.com> for ST-Ericsson   */  #ifndef __LINUX_MFD_AB8500_REGULATOR_H  #define __LINUX_MFD_AB8500_REGULATOR_H +#include <linux/platform_device.h> +  /* AB8500 regulators */  enum ab8500_regulator_id {  	AB8500_LDO_AUX1, @@ -17,7 +20,6 @@ enum ab8500_regulator_id {  	AB8500_LDO_AUX3,  	AB8500_LDO_INTCORE,  	AB8500_LDO_TVOUT, -	AB8500_LDO_USB,  	AB8500_LDO_AUDIO,  	AB8500_LDO_ANAMIC1,  	AB8500_LDO_ANAMIC2, @@ -26,7 +28,28 @@ enum ab8500_regulator_id {  	AB8500_NUM_REGULATORS,  }; -/* AB9450 regulators */ +/* AB8505 regulators */ +enum ab8505_regulator_id { +	AB8505_LDO_AUX1, +	AB8505_LDO_AUX2, +	AB8505_LDO_AUX3, +	AB8505_LDO_AUX4, +	AB8505_LDO_AUX5, +	AB8505_LDO_AUX6, +	AB8505_LDO_INTCORE, +	AB8505_LDO_ADC, +	AB8505_LDO_USB, +	AB8505_LDO_AUDIO, +	AB8505_LDO_ANAMIC1, +	AB8505_LDO_ANAMIC2, +	AB8505_LDO_AUX8, +	AB8505_LDO_ANA, +	AB8505_SYSCLKREQ_2, +	AB8505_SYSCLKREQ_4, +	AB8505_NUM_REGULATORS, +}; + +/* AB9540 regulators */  enum ab9540_regulator_id {  	AB9540_LDO_AUX1,  	AB9540_LDO_AUX2, @@ -45,16 +68,39 @@ enum ab9540_regulator_id {  	AB9540_NUM_REGULATORS,  }; -/* AB8500 and AB9540 register initialization */ +/* AB8540 regulators */ +enum ab8540_regulator_id { +	AB8540_LDO_AUX1, +	AB8540_LDO_AUX2, +	AB8540_LDO_AUX3, +	AB8540_LDO_AUX4, +	AB8540_LDO_AUX5, +	AB8540_LDO_AUX6, +	AB8540_LDO_INTCORE, +	AB8540_LDO_TVOUT, +	AB8540_LDO_AUDIO, +	AB8540_LDO_ANAMIC1, +	AB8540_LDO_ANAMIC2, +	AB8540_LDO_DMIC, +	AB8540_LDO_ANA, +	AB8540_LDO_SDIO, +	AB8540_SYSCLKREQ_2, +	AB8540_SYSCLKREQ_4, +	AB8540_NUM_REGULATORS, +}; + +/* AB8500, AB8505, and AB9540 register initialization */  struct ab8500_regulator_reg_init {  	int id; +	u8 mask;  	u8 value;  }; -#define INIT_REGULATOR_REGISTER(_id, _value)	\ -	{					\ -		.id = _id,			\ -		.value = _value,		\ +#define INIT_REGULATOR_REGISTER(_id, _mask, _value)	\ +	{						\ +		.id = _id,				\ +		.mask = _mask,				\ +		.value = _value,			\  	}  /* AB8500 registers */ @@ -86,10 +132,58 @@ enum ab8500_regulator_reg {  	AB8500_REGUCTRL2SPARE,  	AB8500_REGUCTRLDISCH,  	AB8500_REGUCTRLDISCH2, -	AB8500_VSMPS1SEL1,  	AB8500_NUM_REGULATOR_REGISTERS,  }; +/* AB8505 registers */ +enum ab8505_regulator_reg { +	AB8505_REGUREQUESTCTRL1, +	AB8505_REGUREQUESTCTRL2, +	AB8505_REGUREQUESTCTRL3, +	AB8505_REGUREQUESTCTRL4, +	AB8505_REGUSYSCLKREQ1HPVALID1, +	AB8505_REGUSYSCLKREQ1HPVALID2, +	AB8505_REGUHWHPREQ1VALID1, +	AB8505_REGUHWHPREQ1VALID2, +	AB8505_REGUHWHPREQ2VALID1, +	AB8505_REGUHWHPREQ2VALID2, +	AB8505_REGUSWHPREQVALID1, +	AB8505_REGUSWHPREQVALID2, +	AB8505_REGUSYSCLKREQVALID1, +	AB8505_REGUSYSCLKREQVALID2, +	AB8505_REGUVAUX4REQVALID, +	AB8505_REGUMISC1, +	AB8505_VAUDIOSUPPLY, +	AB8505_REGUCTRL1VAMIC, +	AB8505_VSMPSAREGU, +	AB8505_VSMPSBREGU, +	AB8505_VSAFEREGU, /* NOTE! PRCMU register */ +	AB8505_VPLLVANAREGU, +	AB8505_EXTSUPPLYREGU, +	AB8505_VAUX12REGU, +	AB8505_VRF1VAUX3REGU, +	AB8505_VSMPSASEL1, +	AB8505_VSMPSASEL2, +	AB8505_VSMPSASEL3, +	AB8505_VSMPSBSEL1, +	AB8505_VSMPSBSEL2, +	AB8505_VSMPSBSEL3, +	AB8505_VSAFESEL1, /* NOTE! PRCMU register */ +	AB8505_VSAFESEL2, /* NOTE! PRCMU register */ +	AB8505_VSAFESEL3, /* NOTE! PRCMU register */ +	AB8505_VAUX1SEL, +	AB8505_VAUX2SEL, +	AB8505_VRF1VAUX3SEL, +	AB8505_VAUX4REQCTRL, +	AB8505_VAUX4REGU, +	AB8505_VAUX4SEL, +	AB8505_REGUCTRLDISCH, +	AB8505_REGUCTRLDISCH2, +	AB8505_REGUCTRLDISCH3, +	AB8505_CTRLVAUX5, +	AB8505_CTRLVAUX6, +	AB8505_NUM_REGULATOR_REGISTERS, +};  /* AB9540 registers */  enum ab9540_regulator_reg { @@ -139,4 +233,111 @@ enum ab9540_regulator_reg {  	AB9540_NUM_REGULATOR_REGISTERS,  }; +/* AB8540 registers */ +enum ab8540_regulator_reg { +	AB8540_REGUREQUESTCTRL1, +	AB8540_REGUREQUESTCTRL2, +	AB8540_REGUREQUESTCTRL3, +	AB8540_REGUREQUESTCTRL4, +	AB8540_REGUSYSCLKREQ1HPVALID1, +	AB8540_REGUSYSCLKREQ1HPVALID2, +	AB8540_REGUHWHPREQ1VALID1, +	AB8540_REGUHWHPREQ1VALID2, +	AB8540_REGUHWHPREQ2VALID1, +	AB8540_REGUHWHPREQ2VALID2, +	AB8540_REGUSWHPREQVALID1, +	AB8540_REGUSWHPREQVALID2, +	AB8540_REGUSYSCLKREQVALID1, +	AB8540_REGUSYSCLKREQVALID2, +	AB8540_REGUVAUX4REQVALID, +	AB8540_REGUVAUX5REQVALID, +	AB8540_REGUVAUX6REQVALID, +	AB8540_REGUVCLKBREQVALID, +	AB8540_REGUVRF1REQVALID, +	AB8540_REGUMISC1, +	AB8540_VAUDIOSUPPLY, +	AB8540_REGUCTRL1VAMIC, +	AB8540_VHSIC, +	AB8540_VSDIO, +	AB8540_VSMPS1REGU, +	AB8540_VSMPS2REGU, +	AB8540_VSMPS3REGU, +	AB8540_VPLLVANAREGU, +	AB8540_EXTSUPPLYREGU, +	AB8540_VAUX12REGU, +	AB8540_VRF1VAUX3REGU, +	AB8540_VSMPS1SEL1, +	AB8540_VSMPS1SEL2, +	AB8540_VSMPS1SEL3, +	AB8540_VSMPS2SEL1, +	AB8540_VSMPS2SEL2, +	AB8540_VSMPS2SEL3, +	AB8540_VSMPS3SEL1, +	AB8540_VSMPS3SEL2, +	AB8540_VAUX1SEL, +	AB8540_VAUX2SEL, +	AB8540_VRF1VAUX3SEL, +	AB8540_REGUCTRL2SPARE, +	AB8540_VAUX4REQCTRL, +	AB8540_VAUX4REGU, +	AB8540_VAUX4SEL, +	AB8540_VAUX5REQCTRL, +	AB8540_VAUX5REGU, +	AB8540_VAUX5SEL, +	AB8540_VAUX6REQCTRL, +	AB8540_VAUX6REGU, +	AB8540_VAUX6SEL, +	AB8540_VCLKBREQCTRL, +	AB8540_VCLKBREGU, +	AB8540_VCLKBSEL, +	AB8540_VRF1REQCTRL, +	AB8540_REGUCTRLDISCH, +	AB8540_REGUCTRLDISCH2, +	AB8540_REGUCTRLDISCH3, +	AB8540_REGUCTRLDISCH4, +	AB8540_VSIMSYSCLKCTRL, +	AB8540_VANAVPLLSEL, +	AB8540_NUM_REGULATOR_REGISTERS, +}; + +/* AB8500 external regulators */ +struct ab8500_ext_regulator_cfg { +	bool hwreq; /* requires hw mode or high power mode */ +}; + +enum ab8500_ext_regulator_id { +	AB8500_EXT_SUPPLY1, +	AB8500_EXT_SUPPLY2, +	AB8500_EXT_SUPPLY3, +	AB8500_NUM_EXT_REGULATORS, +}; + +/* AB8500 regulator platform data */ +struct ab8500_regulator_platform_data { +	int num_reg_init; +	struct ab8500_regulator_reg_init *reg_init; +	int num_regulator; +	struct regulator_init_data *regulator; +	int num_ext_regulator; +	struct regulator_init_data *ext_regulator; +}; + +#ifdef CONFIG_REGULATOR_AB8500_DEBUG +int ab8500_regulator_debug_init(struct platform_device *pdev); +int ab8500_regulator_debug_exit(struct platform_device *pdev); +#else +static inline int ab8500_regulator_debug_init(struct platform_device *pdev) +{ +	return 0; +} +static inline int ab8500_regulator_debug_exit(struct platform_device *pdev) +{ +	return 0; +} +#endif + +/* AB8500 external regulator functions. */ +int ab8500_ext_regulator_init(struct platform_device *pdev); +void ab8500_ext_regulator_exit(struct platform_device *pdev); +  #endif diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index 7bc732ce6e5..145022a8308 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h @@ -141,18 +141,18 @@ void regulator_put(struct regulator *regulator);  void devm_regulator_put(struct regulator *regulator);  /* regulator output control and status */ -int regulator_enable(struct regulator *regulator); +int __must_check regulator_enable(struct regulator *regulator);  int regulator_disable(struct regulator *regulator);  int regulator_force_disable(struct regulator *regulator);  int regulator_is_enabled(struct regulator *regulator);  int regulator_disable_deferred(struct regulator *regulator, int ms); -int regulator_bulk_get(struct device *dev, int num_consumers, -		       struct regulator_bulk_data *consumers); -int devm_regulator_bulk_get(struct device *dev, int num_consumers, -			    struct regulator_bulk_data *consumers); -int regulator_bulk_enable(int num_consumers, -			  struct regulator_bulk_data *consumers); +int __must_check regulator_bulk_get(struct device *dev, int num_consumers, +				    struct regulator_bulk_data *consumers); +int __must_check devm_regulator_bulk_get(struct device *dev, int num_consumers, +					 struct regulator_bulk_data *consumers); +int __must_check regulator_bulk_enable(int num_consumers, +				       struct regulator_bulk_data *consumers);  int regulator_bulk_disable(int num_consumers,  			   struct regulator_bulk_data *consumers);  int regulator_bulk_force_disable(int num_consumers, diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index 23070fd8387..6700cc94bdd 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h @@ -22,6 +22,7 @@  struct regmap;  struct regulator_dev;  struct regulator_init_data; +struct regulator_enable_gpio;  enum regulator_status {  	REGULATOR_STATUS_OFF, @@ -199,6 +200,10 @@ enum regulator_type {   *                output when using regulator_set_voltage_sel_regmap   * @enable_reg: Register for control when using regmap enable/disable ops   * @enable_mask: Mask for control when using regmap enable/disable ops + * @enable_is_inverted: A flag to indicate set enable_mask bits to disable + *                      when using regulator_enable_regmap and friends APIs. + * @bypass_reg: Register for control when using regmap set_bypass + * @bypass_mask: Mask for control when using regmap set_bypass   *   * @enable_time: Time taken for initial enable of regulator (in uS).   */ @@ -226,6 +231,7 @@ struct regulator_desc {  	unsigned int apply_bit;  	unsigned int enable_reg;  	unsigned int enable_mask; +	bool enable_is_inverted;  	unsigned int bypass_reg;  	unsigned int bypass_mask; @@ -300,8 +306,7 @@ struct regulator_dev {  	struct dentry *debugfs; -	int ena_gpio; -	unsigned int ena_gpio_invert:1; +	struct regulator_enable_gpio *ena_pin;  	unsigned int ena_gpio_state:1;  }; @@ -327,6 +332,8 @@ int regulator_map_voltage_linear(struct regulator_dev *rdev,  				  int min_uV, int max_uV);  int regulator_map_voltage_iterate(struct regulator_dev *rdev,  				  int min_uV, int max_uV); +int regulator_map_voltage_ascend(struct regulator_dev *rdev, +				  int min_uV, int max_uV);  int regulator_get_voltage_sel_regmap(struct regulator_dev *rdev);  int regulator_set_voltage_sel_regmap(struct regulator_dev *rdev, unsigned sel);  int regulator_is_enabled_regmap(struct regulator_dev *rdev); diff --git a/include/linux/regulator/max8952.h b/include/linux/regulator/max8952.h index 45e42855ad0..4dbb63a1d4a 100644 --- a/include/linux/regulator/max8952.h +++ b/include/linux/regulator/max8952.h @@ -122,13 +122,13 @@ struct max8952_platform_data {  	int gpio_vid1;  	int gpio_en; -	u8 default_mode; -	u8 dvs_mode[MAX8952_NUM_DVS_MODE]; /* MAX8952_DVS_MODEx_XXXXmV */ +	u32 default_mode; +	u32 dvs_mode[MAX8952_NUM_DVS_MODE]; /* MAX8952_DVS_MODEx_XXXXmV */ -	u8 sync_freq; -	u8 ramp_speed; +	u32 sync_freq; +	u32 ramp_speed; -	struct regulator_init_data reg_data; +	struct regulator_init_data *reg_data;  }; diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h index 5ae8456d967..96a509b6be0 100644 --- a/include/linux/res_counter.h +++ b/include/linux/res_counter.h @@ -13,7 +13,8 @@   * info about what this counter is.   */ -#include <linux/cgroup.h> +#include <linux/spinlock.h> +#include <linux/errno.h>  /*   * The core object. the cgroup that wishes to account for some diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h index 1342e69542f..d69cf637a15 100644 --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h @@ -4,6 +4,7 @@  #include <linux/kmemcheck.h>  #include <linux/mm.h>  #include <linux/seq_file.h> +#include <linux/poll.h>  struct ring_buffer;  struct ring_buffer_iter; @@ -96,6 +97,11 @@ __ring_buffer_alloc(unsigned long size, unsigned flags, struct lock_class_key *k  	__ring_buffer_alloc((size), (flags), &__key);	\  }) +void ring_buffer_wait(struct ring_buffer *buffer, int cpu); +int ring_buffer_poll_wait(struct ring_buffer *buffer, int cpu, +			  struct file *filp, poll_table *poll_table); + +  #define RING_BUFFER_ALL_CPUS -1  void ring_buffer_free(struct ring_buffer *buffer); diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 580b24c8b8c..c2c28975293 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h @@ -133,7 +133,13 @@ extern struct rtc_device *rtc_device_register(const char *name,  					struct device *dev,  					const struct rtc_class_ops *ops,  					struct module *owner); +extern struct rtc_device *devm_rtc_device_register(struct device *dev, +					const char *name, +					const struct rtc_class_ops *ops, +					struct module *owner);  extern void rtc_device_unregister(struct rtc_device *rtc); +extern void devm_rtc_device_unregister(struct device *dev, +					struct rtc_device *rtc);  extern int rtc_read_time(struct rtc_device *rtc, struct rtc_time *tm);  extern int rtc_set_time(struct rtc_device *rtc, struct rtc_time *tm); diff --git a/include/linux/sched.h b/include/linux/sched.h index d35d2b6ddbf..54ddcb82cdd 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -127,18 +127,6 @@ extern void proc_sched_show_task(struct task_struct *p, struct seq_file *m);  extern void proc_sched_set_task(struct task_struct *p);  extern void  print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq); -#else -static inline void -proc_sched_show_task(struct task_struct *p, struct seq_file *m) -{ -} -static inline void proc_sched_set_task(struct task_struct *p) -{ -} -static inline void -print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) -{ -}  #endif  /* @@ -163,9 +151,10 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)  #define TASK_DEAD		64  #define TASK_WAKEKILL		128  #define TASK_WAKING		256 -#define TASK_STATE_MAX		512 +#define TASK_PARKED		512 +#define TASK_STATE_MAX		1024 -#define TASK_STATE_TO_CHAR_STR "RSDTtZXxKW" +#define TASK_STATE_TO_CHAR_STR "RSDTtZXxKWP"  extern char ___assert_task_state[1 - 2*!!(  		sizeof(TASK_STATE_TO_CHAR_STR)-1 != ilog2(TASK_STATE_MAX)+1)]; @@ -320,7 +309,6 @@ extern signed long schedule_timeout_killable(signed long timeout);  extern signed long schedule_timeout_uninterruptible(signed long timeout);  asmlinkage void schedule(void);  extern void schedule_preempt_disabled(void); -extern int mutex_spin_on_owner(struct mutex *lock, struct task_struct *owner);  struct nsproxy;  struct user_namespace; @@ -526,7 +514,8 @@ struct signal_struct {  	unsigned int		has_child_subreaper:1;  	/* POSIX.1b Interval Timers */ -	struct list_head posix_timers; +	int			posix_timer_id; +	struct list_head	posix_timers;  	/* ITIMER_REAL timer for the process */  	struct hrtimer real_timer; @@ -570,7 +559,7 @@ struct signal_struct {  	cputime_t utime, stime, cutime, cstime;  	cputime_t gtime;  	cputime_t cgtime; -#ifndef CONFIG_VIRT_CPU_ACCOUNTING +#ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE  	struct cputime prev_cputime;  #endif  	unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; @@ -768,31 +757,6 @@ enum cpu_idle_type {  };  /* - * Increase resolution of nice-level calculations for 64-bit architectures. - * The extra resolution improves shares distribution and load balancing of - * low-weight task groups (eg. nice +19 on an autogroup), deeper taskgroup - * hierarchies, especially on larger systems. This is not a user-visible change - * and does not change the user-interface for setting shares/weights. - * - * We increase resolution only if we have enough bits to allow this increased - * resolution (i.e. BITS_PER_LONG > 32). The costs for increasing resolution - * when BITS_PER_LONG <= 32 are pretty high and the returns do not justify the - * increased costs. - */ -#if 0 /* BITS_PER_LONG > 32 -- currently broken: it increases power usage under light load  */ -# define SCHED_LOAD_RESOLUTION	10 -# define scale_load(w)		((w) << SCHED_LOAD_RESOLUTION) -# define scale_load_down(w)	((w) >> SCHED_LOAD_RESOLUTION) -#else -# define SCHED_LOAD_RESOLUTION	0 -# define scale_load(w)		(w) -# define scale_load_down(w)	(w) -#endif - -#define SCHED_LOAD_SHIFT	(10 + SCHED_LOAD_RESOLUTION) -#define SCHED_LOAD_SCALE	(1L << SCHED_LOAD_SHIFT) - -/*   * Increase resolution of cpu_power calculations   */  #define SCHED_POWER_SHIFT	10 @@ -817,62 +781,6 @@ enum cpu_idle_type {  extern int __weak arch_sd_sibiling_asym_packing(void); -struct sched_group_power { -	atomic_t ref; -	/* -	 * CPU power of this group, SCHED_LOAD_SCALE being max power for a -	 * single CPU. -	 */ -	unsigned int power, power_orig; -	unsigned long next_update; -	/* -	 * Number of busy cpus in this group. -	 */ -	atomic_t nr_busy_cpus; - -	unsigned long cpumask[0]; /* iteration mask */ -}; - -struct sched_group { -	struct sched_group *next;	/* Must be a circular list */ -	atomic_t ref; - -	unsigned int group_weight; -	struct sched_group_power *sgp; - -	/* -	 * The CPUs this group covers. -	 * -	 * NOTE: this field is variable length. (Allocated dynamically -	 * by attaching extra space to the end of the structure, -	 * depending on how many CPUs the kernel has booted up with) -	 */ -	unsigned long cpumask[0]; -}; - -static inline struct cpumask *sched_group_cpus(struct sched_group *sg) -{ -	return to_cpumask(sg->cpumask); -} - -/* - * cpumask masking which cpus in the group are allowed to iterate up the domain - * tree. - */ -static inline struct cpumask *sched_group_mask(struct sched_group *sg) -{ -	return to_cpumask(sg->sgp->cpumask); -} - -/** - * group_first_cpu - Returns the first cpu in the cpumask of a sched_group. - * @group: The group whose first cpu is to be returned. - */ -static inline unsigned int group_first_cpu(struct sched_group *group) -{ -	return cpumask_first(sched_group_cpus(group)); -} -  struct sched_domain_attr {  	int relax_domain_level;  }; @@ -883,6 +791,8 @@ struct sched_domain_attr {  extern int sched_domain_level_max; +struct sched_group; +  struct sched_domain {  	/* These fields must be setup */  	struct sched_domain *parent;	/* top domain must be null terminated */ @@ -899,6 +809,8 @@ struct sched_domain {  	unsigned int wake_idx;  	unsigned int forkexec_idx;  	unsigned int smt_gain; + +	int nohz_idle;			/* NOHZ IDLE status */  	int flags;			/* See SD_* */  	int level; @@ -971,18 +883,6 @@ extern void partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],  cpumask_var_t *alloc_sched_domains(unsigned int ndoms);  void free_sched_domains(cpumask_var_t doms[], unsigned int ndoms); -/* Test a flag in parent sched domain */ -static inline int test_sd_parent(struct sched_domain *sd, int flag) -{ -	if (sd->parent && (sd->parent->flags & flag)) -		return 1; - -	return 0; -} - -unsigned long default_scale_freq_power(struct sched_domain *sd, int cpu); -unsigned long default_scale_smt_power(struct sched_domain *sd, int cpu); -  bool cpus_share_cache(int this_cpu, int that_cpu);  #else /* CONFIG_SMP */ @@ -1017,72 +917,6 @@ struct mempolicy;  struct pipe_inode_info;  struct uts_namespace; -struct rq; -struct sched_domain; - -/* - * wake flags - */ -#define WF_SYNC		0x01		/* waker goes to sleep after wakup */ -#define WF_FORK		0x02		/* child wakeup after fork */ -#define WF_MIGRATED	0x04		/* internal use, task got migrated */ - -#define ENQUEUE_WAKEUP		1 -#define ENQUEUE_HEAD		2 -#ifdef CONFIG_SMP -#define ENQUEUE_WAKING		4	/* sched_class::task_waking was called */ -#else -#define ENQUEUE_WAKING		0 -#endif - -#define DEQUEUE_SLEEP		1 - -struct sched_class { -	const struct sched_class *next; - -	void (*enqueue_task) (struct rq *rq, struct task_struct *p, int flags); -	void (*dequeue_task) (struct rq *rq, struct task_struct *p, int flags); -	void (*yield_task) (struct rq *rq); -	bool (*yield_to_task) (struct rq *rq, struct task_struct *p, bool preempt); - -	void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int flags); - -	struct task_struct * (*pick_next_task) (struct rq *rq); -	void (*put_prev_task) (struct rq *rq, struct task_struct *p); - -#ifdef CONFIG_SMP -	int  (*select_task_rq)(struct task_struct *p, int sd_flag, int flags); -	void (*migrate_task_rq)(struct task_struct *p, int next_cpu); - -	void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); -	void (*post_schedule) (struct rq *this_rq); -	void (*task_waking) (struct task_struct *task); -	void (*task_woken) (struct rq *this_rq, struct task_struct *task); - -	void (*set_cpus_allowed)(struct task_struct *p, -				 const struct cpumask *newmask); - -	void (*rq_online)(struct rq *rq); -	void (*rq_offline)(struct rq *rq); -#endif - -	void (*set_curr_task) (struct rq *rq); -	void (*task_tick) (struct rq *rq, struct task_struct *p, int queued); -	void (*task_fork) (struct task_struct *p); - -	void (*switched_from) (struct rq *this_rq, struct task_struct *task); -	void (*switched_to) (struct rq *this_rq, struct task_struct *task); -	void (*prio_changed) (struct rq *this_rq, struct task_struct *task, -			     int oldprio); - -	unsigned int (*get_rr_interval) (struct rq *rq, -					 struct task_struct *task); - -#ifdef CONFIG_FAIR_GROUP_SCHED -	void (*task_move_group) (struct task_struct *p, int on_rq); -#endif -}; -  struct load_weight {  	unsigned long weight, inv_weight;  }; @@ -1274,8 +1108,10 @@ struct task_struct {  	int exit_code, exit_signal;  	int pdeath_signal;  /*  The signal sent when the parent dies  */  	unsigned int jobctl;	/* JOBCTL_*, siglock protected */ -	/* ??? */ + +	/* Used for emulating ABI behavior of previous Linux versions */  	unsigned int personality; +  	unsigned did_exec:1;  	unsigned in_execve:1;	/* Tell the LSMs that the process is doing an  				 * execve */ @@ -1327,7 +1163,7 @@ struct task_struct {  	cputime_t utime, stime, utimescaled, stimescaled;  	cputime_t gtime; -#ifndef CONFIG_VIRT_CPU_ACCOUNTING +#ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE  	struct cputime prev_cputime;  #endif  #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN @@ -1793,7 +1629,7 @@ extern void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut,  #define PF_SWAPWRITE	0x00800000	/* Allowed to write to swap */  #define PF_SPREAD_PAGE	0x01000000	/* Spread page cache over cpuset */  #define PF_SPREAD_SLAB	0x02000000	/* Spread some slab caches over cpuset */ -#define PF_THREAD_BOUND	0x04000000	/* Thread bound to specific cpu */ +#define PF_NO_SETAFFINITY 0x04000000	/* Userland is not allowed to meddle with cpus_allowed */  #define PF_MCE_EARLY    0x08000000      /* Early kill for mce process policy */  #define PF_MEMPOLICY	0x10000000	/* Non-default NUMA mempolicy */  #define PF_MUTEX_TESTER	0x20000000	/* Thread belongs to the rt mutex tester */ @@ -2622,6 +2458,47 @@ static inline int spin_needbreak(spinlock_t *lock)  }  /* + * Idle thread specific functions to determine the need_resched + * polling state. We have two versions, one based on TS_POLLING in + * thread_info.status and one based on TIF_POLLING_NRFLAG in + * thread_info.flags + */ +#ifdef TS_POLLING +static inline int tsk_is_polling(struct task_struct *p) +{ +	return task_thread_info(p)->status & TS_POLLING; +} +static inline void current_set_polling(void) +{ +	current_thread_info()->status |= TS_POLLING; +} + +static inline void current_clr_polling(void) +{ +	current_thread_info()->status &= ~TS_POLLING; +	smp_mb__after_clear_bit(); +} +#elif defined(TIF_POLLING_NRFLAG) +static inline int tsk_is_polling(struct task_struct *p) +{ +	return test_tsk_thread_flag(p, TIF_POLLING_NRFLAG); +} +static inline void current_set_polling(void) +{ +	set_thread_flag(TIF_POLLING_NRFLAG); +} + +static inline void current_clr_polling(void) +{ +	clear_thread_flag(TIF_POLLING_NRFLAG); +} +#else +static inline int tsk_is_polling(struct task_struct *p) { return 0; } +static inline void current_set_polling(void) { } +static inline void current_clr_polling(void) { } +#endif + +/*   * Thread group CPU time accounting.   */  void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times); @@ -2681,28 +2558,7 @@ extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask);  extern long sched_getaffinity(pid_t pid, struct cpumask *mask);  #ifdef CONFIG_CGROUP_SCHED -  extern struct task_group root_task_group; - -extern struct task_group *sched_create_group(struct task_group *parent); -extern void sched_online_group(struct task_group *tg, -			       struct task_group *parent); -extern void sched_destroy_group(struct task_group *tg); -extern void sched_offline_group(struct task_group *tg); -extern void sched_move_task(struct task_struct *tsk); -#ifdef CONFIG_FAIR_GROUP_SCHED -extern int sched_group_set_shares(struct task_group *tg, unsigned long shares); -extern unsigned long sched_group_shares(struct task_group *tg); -#endif -#ifdef CONFIG_RT_GROUP_SCHED -extern int sched_group_set_rt_runtime(struct task_group *tg, -				      long rt_runtime_us); -extern long sched_group_rt_runtime(struct task_group *tg); -extern int sched_group_set_rt_period(struct task_group *tg, -				      long rt_period_us); -extern long sched_group_rt_period(struct task_group *tg); -extern int sched_rt_can_attach(struct task_group *tg, struct task_struct *tsk); -#endif  #endif /* CONFIG_CGROUP_SCHED */  extern int task_can_switch_user(struct user_struct *up, diff --git a/include/linux/security.h b/include/linux/security.h index eee7478cda7..032c366ef1c 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -1012,6 +1012,10 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)   *	This hook can be used by the module to update any security state   *	associated with the TUN device's security structure.   *	@security pointer to the TUN devices's security structure. + * @skb_owned_by: + *	This hook sets the packet's owning sock. + *	@skb is the packet. + *	@sk the sock which owns the packet.   *   * Security hooks for XFRM operations.   * @@ -1638,6 +1642,7 @@ struct security_operations {  	int (*tun_dev_attach_queue) (void *security);  	int (*tun_dev_attach) (struct sock *sk, void *security);  	int (*tun_dev_open) (void *security); +	void (*skb_owned_by) (struct sk_buff *skb, struct sock *sk);  #endif	/* CONFIG_SECURITY_NETWORK */  #ifdef CONFIG_SECURITY_NETWORK_XFRM @@ -2588,6 +2593,8 @@ int security_tun_dev_attach_queue(void *security);  int security_tun_dev_attach(struct sock *sk, void *security);  int security_tun_dev_open(void *security); +void security_skb_owned_by(struct sk_buff *skb, struct sock *sk); +  #else	/* CONFIG_SECURITY_NETWORK */  static inline int security_unix_stream_connect(struct sock *sock,  					       struct sock *other, @@ -2779,6 +2786,11 @@ static inline int security_tun_dev_open(void *security)  {  	return 0;  } + +static inline void security_skb_owned_by(struct sk_buff *skb, struct sock *sk) +{ +} +  #endif	/* CONFIG_SECURITY_NETWORK */  #ifdef CONFIG_SECURITY_NETWORK_XFRM diff --git a/include/linux/serial_s3c.h b/include/linux/serial_s3c.h new file mode 100644 index 00000000000..907d9d1d56c --- /dev/null +++ b/include/linux/serial_s3c.h @@ -0,0 +1,260 @@ +/* + *  Internal header file for Samsung S3C2410 serial ports (UART0-2) + * + *  Copyright (C) 2002 Shane Nay (shane@minirl.com) + * + *  Additional defines, Copyright 2003 Simtec Electronics (linux@simtec.co.uk) + * + *  Adapted from: + * + *  Internal header file for MX1ADS serial ports (UART1 & 2) + * + *  Copyright (C) 2002 Shane Nay (shane@minirl.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA +*/ + +#ifndef __ASM_ARM_REGS_SERIAL_H +#define __ASM_ARM_REGS_SERIAL_H + +#define S3C2410_URXH	  (0x24) +#define S3C2410_UTXH	  (0x20) +#define S3C2410_ULCON	  (0x00) +#define S3C2410_UCON	  (0x04) +#define S3C2410_UFCON	  (0x08) +#define S3C2410_UMCON	  (0x0C) +#define S3C2410_UBRDIV	  (0x28) +#define S3C2410_UTRSTAT	  (0x10) +#define S3C2410_UERSTAT	  (0x14) +#define S3C2410_UFSTAT	  (0x18) +#define S3C2410_UMSTAT	  (0x1C) + +#define S3C2410_LCON_CFGMASK	  ((0xF<<3)|(0x3)) + +#define S3C2410_LCON_CS5	  (0x0) +#define S3C2410_LCON_CS6	  (0x1) +#define S3C2410_LCON_CS7	  (0x2) +#define S3C2410_LCON_CS8	  (0x3) +#define S3C2410_LCON_CSMASK	  (0x3) + +#define S3C2410_LCON_PNONE	  (0x0) +#define S3C2410_LCON_PEVEN	  (0x5 << 3) +#define S3C2410_LCON_PODD	  (0x4 << 3) +#define S3C2410_LCON_PMASK	  (0x7 << 3) + +#define S3C2410_LCON_STOPB	  (1<<2) +#define S3C2410_LCON_IRM          (1<<6) + +#define S3C2440_UCON_CLKMASK	  (3<<10) +#define S3C2440_UCON_CLKSHIFT	  (10) +#define S3C2440_UCON_PCLK	  (0<<10) +#define S3C2440_UCON_UCLK	  (1<<10) +#define S3C2440_UCON_PCLK2	  (2<<10) +#define S3C2440_UCON_FCLK	  (3<<10) +#define S3C2443_UCON_EPLL	  (3<<10) + +#define S3C6400_UCON_CLKMASK	(3<<10) +#define S3C6400_UCON_CLKSHIFT	(10) +#define S3C6400_UCON_PCLK	(0<<10) +#define S3C6400_UCON_PCLK2	(2<<10) +#define S3C6400_UCON_UCLK0	(1<<10) +#define S3C6400_UCON_UCLK1	(3<<10) + +#define S3C2440_UCON2_FCLK_EN	  (1<<15) +#define S3C2440_UCON0_DIVMASK	  (15 << 12) +#define S3C2440_UCON1_DIVMASK	  (15 << 12) +#define S3C2440_UCON2_DIVMASK	  (7 << 12) +#define S3C2440_UCON_DIVSHIFT	  (12) + +#define S3C2412_UCON_CLKMASK	(3<<10) +#define S3C2412_UCON_CLKSHIFT	(10) +#define S3C2412_UCON_UCLK	(1<<10) +#define S3C2412_UCON_USYSCLK	(3<<10) +#define S3C2412_UCON_PCLK	(0<<10) +#define S3C2412_UCON_PCLK2	(2<<10) + +#define S3C2410_UCON_CLKMASK	(1 << 10) +#define S3C2410_UCON_CLKSHIFT	(10) +#define S3C2410_UCON_UCLK	  (1<<10) +#define S3C2410_UCON_SBREAK	  (1<<4) + +#define S3C2410_UCON_TXILEVEL	  (1<<9) +#define S3C2410_UCON_RXILEVEL	  (1<<8) +#define S3C2410_UCON_TXIRQMODE	  (1<<2) +#define S3C2410_UCON_RXIRQMODE	  (1<<0) +#define S3C2410_UCON_RXFIFO_TOI	  (1<<7) +#define S3C2443_UCON_RXERR_IRQEN  (1<<6) +#define S3C2443_UCON_LOOPBACK	  (1<<5) + +#define S3C2410_UCON_DEFAULT	  (S3C2410_UCON_TXILEVEL  | \ +				   S3C2410_UCON_RXILEVEL  | \ +				   S3C2410_UCON_TXIRQMODE | \ +				   S3C2410_UCON_RXIRQMODE | \ +				   S3C2410_UCON_RXFIFO_TOI) + +#define S3C2410_UFCON_FIFOMODE	  (1<<0) +#define S3C2410_UFCON_TXTRIG0	  (0<<6) +#define S3C2410_UFCON_RXTRIG8	  (1<<4) +#define S3C2410_UFCON_RXTRIG12	  (2<<4) + +/* S3C2440 FIFO trigger levels */ +#define S3C2440_UFCON_RXTRIG1	  (0<<4) +#define S3C2440_UFCON_RXTRIG8	  (1<<4) +#define S3C2440_UFCON_RXTRIG16	  (2<<4) +#define S3C2440_UFCON_RXTRIG32	  (3<<4) + +#define S3C2440_UFCON_TXTRIG0	  (0<<6) +#define S3C2440_UFCON_TXTRIG16	  (1<<6) +#define S3C2440_UFCON_TXTRIG32	  (2<<6) +#define S3C2440_UFCON_TXTRIG48	  (3<<6) + +#define S3C2410_UFCON_RESETBOTH	  (3<<1) +#define S3C2410_UFCON_RESETTX	  (1<<2) +#define S3C2410_UFCON_RESETRX	  (1<<1) + +#define S3C2410_UFCON_DEFAULT	  (S3C2410_UFCON_FIFOMODE | \ +				   S3C2410_UFCON_TXTRIG0  | \ +				   S3C2410_UFCON_RXTRIG8 ) + +#define	S3C2410_UMCOM_AFC	  (1<<4) +#define	S3C2410_UMCOM_RTS_LOW	  (1<<0) + +#define S3C2412_UMCON_AFC_63	(0<<5)		/* same as s3c2443 */ +#define S3C2412_UMCON_AFC_56	(1<<5) +#define S3C2412_UMCON_AFC_48	(2<<5) +#define S3C2412_UMCON_AFC_40	(3<<5) +#define S3C2412_UMCON_AFC_32	(4<<5) +#define S3C2412_UMCON_AFC_24	(5<<5) +#define S3C2412_UMCON_AFC_16	(6<<5) +#define S3C2412_UMCON_AFC_8	(7<<5) + +#define S3C2410_UFSTAT_TXFULL	  (1<<9) +#define S3C2410_UFSTAT_RXFULL	  (1<<8) +#define S3C2410_UFSTAT_TXMASK	  (15<<4) +#define S3C2410_UFSTAT_TXSHIFT	  (4) +#define S3C2410_UFSTAT_RXMASK	  (15<<0) +#define S3C2410_UFSTAT_RXSHIFT	  (0) + +/* UFSTAT S3C2443 same as S3C2440 */ +#define S3C2440_UFSTAT_TXFULL	  (1<<14) +#define S3C2440_UFSTAT_RXFULL	  (1<<6) +#define S3C2440_UFSTAT_TXSHIFT	  (8) +#define S3C2440_UFSTAT_RXSHIFT	  (0) +#define S3C2440_UFSTAT_TXMASK	  (63<<8) +#define S3C2440_UFSTAT_RXMASK	  (63) + +#define S3C2410_UTRSTAT_TXE	  (1<<2) +#define S3C2410_UTRSTAT_TXFE	  (1<<1) +#define S3C2410_UTRSTAT_RXDR	  (1<<0) + +#define S3C2410_UERSTAT_OVERRUN	  (1<<0) +#define S3C2410_UERSTAT_FRAME	  (1<<2) +#define S3C2410_UERSTAT_BREAK	  (1<<3) +#define S3C2443_UERSTAT_PARITY	  (1<<1) + +#define S3C2410_UERSTAT_ANY	  (S3C2410_UERSTAT_OVERRUN | \ +				   S3C2410_UERSTAT_FRAME | \ +				   S3C2410_UERSTAT_BREAK) + +#define S3C2410_UMSTAT_CTS	  (1<<0) +#define S3C2410_UMSTAT_DeltaCTS	  (1<<2) + +#define S3C2443_DIVSLOT		  (0x2C) + +/* S3C64XX interrupt registers. */ +#define S3C64XX_UINTP		0x30 +#define S3C64XX_UINTSP		0x34 +#define S3C64XX_UINTM		0x38 + +#define S3C64XX_UINTM_RXD	(0) +#define S3C64XX_UINTM_TXD	(2) +#define S3C64XX_UINTM_RXD_MSK	(1 << S3C64XX_UINTM_RXD) +#define S3C64XX_UINTM_TXD_MSK	(1 << S3C64XX_UINTM_TXD) + +/* Following are specific to S5PV210 */ +#define S5PV210_UCON_CLKMASK	(1<<10) +#define S5PV210_UCON_CLKSHIFT	(10) +#define S5PV210_UCON_PCLK	(0<<10) +#define S5PV210_UCON_UCLK	(1<<10) + +#define S5PV210_UFCON_TXTRIG0	(0<<8) +#define S5PV210_UFCON_TXTRIG4	(1<<8) +#define S5PV210_UFCON_TXTRIG8	(2<<8) +#define S5PV210_UFCON_TXTRIG16	(3<<8) +#define S5PV210_UFCON_TXTRIG32	(4<<8) +#define S5PV210_UFCON_TXTRIG64	(5<<8) +#define S5PV210_UFCON_TXTRIG128 (6<<8) +#define S5PV210_UFCON_TXTRIG256 (7<<8) + +#define S5PV210_UFCON_RXTRIG1	(0<<4) +#define S5PV210_UFCON_RXTRIG4	(1<<4) +#define S5PV210_UFCON_RXTRIG8	(2<<4) +#define S5PV210_UFCON_RXTRIG16	(3<<4) +#define S5PV210_UFCON_RXTRIG32	(4<<4) +#define S5PV210_UFCON_RXTRIG64	(5<<4) +#define S5PV210_UFCON_RXTRIG128	(6<<4) +#define S5PV210_UFCON_RXTRIG256	(7<<4) + +#define S5PV210_UFSTAT_TXFULL	(1<<24) +#define S5PV210_UFSTAT_RXFULL	(1<<8) +#define S5PV210_UFSTAT_TXMASK	(255<<16) +#define S5PV210_UFSTAT_TXSHIFT	(16) +#define S5PV210_UFSTAT_RXMASK	(255<<0) +#define S5PV210_UFSTAT_RXSHIFT	(0) + +#define S3C2410_UCON_CLKSEL0	(1 << 0) +#define S3C2410_UCON_CLKSEL1	(1 << 1) +#define S3C2410_UCON_CLKSEL2	(1 << 2) +#define S3C2410_UCON_CLKSEL3	(1 << 3) + +/* Default values for s5pv210 UCON and UFCON uart registers */ +#define S5PV210_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\ +				 S3C2410_UCON_RXILEVEL |	\ +				 S3C2410_UCON_TXIRQMODE |	\ +				 S3C2410_UCON_RXIRQMODE |	\ +				 S3C2410_UCON_RXFIFO_TOI |	\ +				 S3C2443_UCON_RXERR_IRQEN) + +#define S5PV210_UFCON_DEFAULT	(S3C2410_UFCON_FIFOMODE |	\ +				 S5PV210_UFCON_TXTRIG4 |	\ +				 S5PV210_UFCON_RXTRIG4) + +#ifndef __ASSEMBLY__ + +/* configuration structure for per-machine configurations for the + * serial port + * + * the pointer is setup by the machine specific initialisation from the + * arch/arm/mach-s3c2410/ directory. +*/ + +struct s3c2410_uartcfg { +	unsigned char	   hwport;	 /* hardware port number */ +	unsigned char	   unused; +	unsigned short	   flags; +	upf_t		   uart_flags;	 /* default uart flags */ +	unsigned int	   clk_sel; + +	unsigned int	   has_fracval; + +	unsigned long	   ucon;	 /* value of ucon for port */ +	unsigned long	   ulcon;	 /* value of ulcon for port */ +	unsigned long	   ufcon;	 /* value of ufcon for port */ +}; + +#endif /* __ASSEMBLY__ */ + +#endif /* __ASM_ARM_REGS_SERIAL_H */ + diff --git a/include/linux/signal.h b/include/linux/signal.h index a2dcb94ea49..9475c5cb28b 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h @@ -250,11 +250,11 @@ extern int show_unhandled_signals;  extern int sigsuspend(sigset_t *);  struct sigaction { -#ifndef __ARCH_HAS_ODD_SIGACTION +#ifndef __ARCH_HAS_IRIX_SIGACTION  	__sighandler_t	sa_handler;  	unsigned long	sa_flags;  #else -	unsigned long	sa_flags; +	unsigned int	sa_flags;  	__sighandler_t	sa_handler;  #endif  #ifdef __ARCH_HAS_SA_RESTORER diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 821c7f45d2a..b8292d8cc9f 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -500,7 +500,7 @@ struct sk_buff {  	union {  		__u32		mark;  		__u32		dropcount; -		__u32		avail_size; +		__u32		reserved_tailroom;  	};  	sk_buff_data_t		inner_transport_header; @@ -1288,11 +1288,13 @@ static inline void __skb_fill_page_desc(struct sk_buff *skb, int i,  	 * do not lose pfmemalloc information as the pages would not be  	 * allocated using __GFP_MEMALLOC.  	 */ -	if (page->pfmemalloc && !page->mapping) -		skb->pfmemalloc	= true;  	frag->page.p		  = page;  	frag->page_offset	  = off;  	skb_frag_size_set(frag, size); + +	page = compound_head(page); +	if (page->pfmemalloc && !page->mapping) +		skb->pfmemalloc	= true;  }  /** @@ -1447,7 +1449,10 @@ static inline int skb_tailroom(const struct sk_buff *skb)   */  static inline int skb_availroom(const struct sk_buff *skb)  { -	return skb_is_nonlinear(skb) ? 0 : skb->avail_size - skb->len; +	if (skb_is_nonlinear(skb)) +		return 0; + +	return skb->end - skb->tail - skb->reserved_tailroom;  }  /** @@ -2638,6 +2643,13 @@ static inline void nf_reset(struct sk_buff *skb)  #endif  } +static inline void nf_reset_trace(struct sk_buff *skb) +{ +#if IS_ENABLED(CONFIG_NETFILTER_XT_TARGET_TRACE) +	skb->nf_trace = 0; +#endif +} +  /* Note: This doesn't put any conntrack and bridge info in dst. */  static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src)  { diff --git a/include/linux/smpboot.h b/include/linux/smpboot.h index c65dee05991..13e92967955 100644 --- a/include/linux/smpboot.h +++ b/include/linux/smpboot.h @@ -24,6 +24,9 @@ struct smpboot_thread_data;   *			parked (cpu offline)   * @unpark:		Optional unpark function, called when the thread is   *			unparked (cpu online) + * @pre_unpark:		Optional unpark function, called before the thread is + *			unparked (cpu online). This is not guaranteed to be + *			called on the target cpu of the thread. Careful!   * @selfparking:	Thread is not parked by the park function.   * @thread_comm:	The base name of the thread   */ @@ -37,6 +40,7 @@ struct smp_hotplug_thread {  	void				(*cleanup)(unsigned int cpu, bool online);  	void				(*park)(unsigned int cpu);  	void				(*unpark)(unsigned int cpu); +	void				(*pre_unpark)(unsigned int cpu);  	bool				selfparking;  	const char			*thread_comm;  }; diff --git a/include/linux/spi/spi-tegra.h b/include/linux/spi/spi-tegra.h deleted file mode 100644 index 786932c62ed..00000000000 --- a/include/linux/spi/spi-tegra.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * spi-tegra.h: SPI interface for Nvidia Tegra20 SLINK controller. - * - * Copyright (C) 2011 NVIDIA Corporation - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * 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. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA. - */ - -#ifndef _LINUX_SPI_TEGRA_H -#define _LINUX_SPI_TEGRA_H - -struct tegra_spi_platform_data { -	int dma_req_sel; -	unsigned int spi_max_frequency; -}; - -/* - * Controller data from device to pass some info like - * hw based chip select can be used or not and if yes - * then CS hold and setup time. - */ -struct tegra_spi_device_controller_data { -	bool is_hw_based_cs; -	int cs_setup_clk_count; -	int cs_hold_clk_count; -}; - -#endif /* _LINUX_SPI_TEGRA_H */ diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 38c2b925923..733eb5ee31c 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -228,6 +228,11 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)   *	every chipselect is connected to a slave.   * @dma_alignment: SPI controller constraint on DMA buffers alignment.   * @mode_bits: flags understood by this controller driver + * @bits_per_word_mask: A mask indicating which values of bits_per_word are + *	supported by the driver. Bit n indicates that a bits_per_word n+1 is + *	suported. If set, the SPI core will reject any transfer with an + *	unsupported bits_per_word. If not set, this value is simply ignored, + *	and it's up to the individual driver to perform any validation.   * @flags: other constraints relevant to this driver   * @bus_lock_spinlock: spinlock for SPI bus locking   * @bus_lock_mutex: mutex for SPI bus locking @@ -301,6 +306,9 @@ struct spi_master {  	/* spi_device.mode flags understood by this controller driver */  	u16			mode_bits; +	/* bitmask of supported bits_per_word for transfers */ +	u32			bits_per_word_mask; +  	/* other constraints relevant to this driver */  	u16			flags;  #define SPI_MASTER_HALF_DUPLEX	BIT(0)		/* can't do full duplex */ diff --git a/include/linux/spinlock_up.h b/include/linux/spinlock_up.h index a26e2fb604e..e2369c167db 100644 --- a/include/linux/spinlock_up.h +++ b/include/linux/spinlock_up.h @@ -16,7 +16,10 @@   * In the debug case, 1 means unlocked, 0 means locked. (the values   * are inverted, to catch initialization bugs)   * - * No atomicity anywhere, we are on UP. + * No atomicity anywhere, we are on UP. However, we still need + * the compiler barriers, because we do not want the compiler to + * move potentially faulting instructions (notably user accesses) + * into the locked sequence, resulting in non-atomic execution.   */  #ifdef CONFIG_DEBUG_SPINLOCK @@ -25,6 +28,7 @@  static inline void arch_spin_lock(arch_spinlock_t *lock)  {  	lock->slock = 0; +	barrier();  }  static inline void @@ -32,6 +36,7 @@ arch_spin_lock_flags(arch_spinlock_t *lock, unsigned long flags)  {  	local_irq_save(flags);  	lock->slock = 0; +	barrier();  }  static inline int arch_spin_trylock(arch_spinlock_t *lock) @@ -39,32 +44,34 @@ static inline int arch_spin_trylock(arch_spinlock_t *lock)  	char oldval = lock->slock;  	lock->slock = 0; +	barrier();  	return oldval > 0;  }  static inline void arch_spin_unlock(arch_spinlock_t *lock)  { +	barrier();  	lock->slock = 1;  }  /*   * Read-write spinlocks. No debug version.   */ -#define arch_read_lock(lock)		do { (void)(lock); } while (0) -#define arch_write_lock(lock)		do { (void)(lock); } while (0) -#define arch_read_trylock(lock)	({ (void)(lock); 1; }) -#define arch_write_trylock(lock)	({ (void)(lock); 1; }) -#define arch_read_unlock(lock)		do { (void)(lock); } while (0) -#define arch_write_unlock(lock)	do { (void)(lock); } while (0) +#define arch_read_lock(lock)		do { barrier(); (void)(lock); } while (0) +#define arch_write_lock(lock)		do { barrier(); (void)(lock); } while (0) +#define arch_read_trylock(lock)	({ barrier(); (void)(lock); 1; }) +#define arch_write_trylock(lock)	({ barrier(); (void)(lock); 1; }) +#define arch_read_unlock(lock)		do { barrier(); (void)(lock); } while (0) +#define arch_write_unlock(lock)	do { barrier(); (void)(lock); } while (0)  #else /* DEBUG_SPINLOCK */  #define arch_spin_is_locked(lock)	((void)(lock), 0)  /* for sched.c and kernel_lock.c: */ -# define arch_spin_lock(lock)		do { (void)(lock); } while (0) -# define arch_spin_lock_flags(lock, flags)	do { (void)(lock); } while (0) -# define arch_spin_unlock(lock)	do { (void)(lock); } while (0) -# define arch_spin_trylock(lock)	({ (void)(lock); 1; }) +# define arch_spin_lock(lock)		do { barrier(); (void)(lock); } while (0) +# define arch_spin_lock_flags(lock, flags)	do { barrier(); (void)(lock); } while (0) +# define arch_spin_unlock(lock)	do { barrier(); (void)(lock); } while (0) +# define arch_spin_trylock(lock)	({ barrier(); (void)(lock); 1; })  #endif /* DEBUG_SPINLOCK */  #define arch_spin_is_contended(lock)	(((void)(lock), 0)) diff --git a/include/linux/ssb/ssb_driver_chipcommon.h b/include/linux/ssb/ssb_driver_chipcommon.h index 9e492be5244..6fcfe99bd99 100644 --- a/include/linux/ssb/ssb_driver_chipcommon.h +++ b/include/linux/ssb/ssb_driver_chipcommon.h @@ -219,6 +219,7 @@  #define SSB_CHIPCO_PMU_CTL			0x0600 /* PMU control */  #define  SSB_CHIPCO_PMU_CTL_ILP_DIV		0xFFFF0000 /* ILP div mask */  #define  SSB_CHIPCO_PMU_CTL_ILP_DIV_SHIFT	16 +#define  SSB_CHIPCO_PMU_CTL_PLL_UPD		0x00000400  #define  SSB_CHIPCO_PMU_CTL_NOILPONW		0x00000200 /* No ILP on wait */  #define  SSB_CHIPCO_PMU_CTL_HTREQEN		0x00000100 /* HT req enable */  #define  SSB_CHIPCO_PMU_CTL_ALPREQEN		0x00000080 /* ALP req enable */ @@ -667,5 +668,6 @@ enum ssb_pmu_ldo_volt_id {  void ssb_pmu_set_ldo_voltage(struct ssb_chipcommon *cc,  			     enum ssb_pmu_ldo_volt_id id, u32 voltage);  void ssb_pmu_set_ldo_paref(struct ssb_chipcommon *cc, bool on); +void ssb_pmu_spuravoid_pllupdate(struct ssb_chipcommon *cc, int spuravoid);  #endif /* LINUX_SSB_CHIPCO_H_ */ diff --git a/include/linux/ssbi.h b/include/linux/ssbi.h new file mode 100644 index 00000000000..44ef5da2147 --- /dev/null +++ b/include/linux/ssbi.h @@ -0,0 +1,38 @@ +/* Copyright (C) 2010 Google, Inc. + * Copyright (c) 2011, Code Aurora Forum. All rights reserved. + * Author: Dima Zavin <dima@android.com> + * + * 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 _LINUX_SSBI_H +#define _LINUX_SSBI_H + +#include <linux/types.h> + +struct ssbi_slave_info { +	const char	*name; +	void		*platform_data; +}; + +enum ssbi_controller_type { +	MSM_SBI_CTRL_SSBI = 0, +	MSM_SBI_CTRL_SSBI2, +	MSM_SBI_CTRL_PMIC_ARBITER, +}; + +struct ssbi_platform_data { +	struct ssbi_slave_info	slave; +	enum ssbi_controller_type controller_type; +}; + +int ssbi_write(struct device *dev, u16 addr, u8 *buf, int len); +int ssbi_read(struct device *dev, u16 addr, u8 *buf, int len); +#endif diff --git a/include/linux/swap.h b/include/linux/swap.h index 2818a123f3e..1701ce4be74 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -236,7 +236,7 @@ extern unsigned long nr_free_pagecache_pages(void);  extern void __lru_cache_add(struct page *, enum lru_list lru);  extern void lru_cache_add_lru(struct page *, enum lru_list lru);  extern void lru_add_page_tail(struct page *page, struct page *page_tail, -			      struct lruvec *lruvec); +			 struct lruvec *lruvec, struct list_head *head);  extern void activate_page(struct page *);  extern void mark_page_accessed(struct page *);  extern void lru_add_drain(void); @@ -330,6 +330,9 @@ static inline void mem_cgroup_uncharge_swap(swp_entry_t ent)  /* linux/mm/page_io.c */  extern int swap_readpage(struct page *);  extern int swap_writepage(struct page *page, struct writeback_control *wbc); +extern void end_swap_bio_write(struct bio *bio, int err); +extern int __swap_writepage(struct page *page, struct writeback_control *wbc, +	void (*end_write_func)(struct bio *, int));  extern int swap_set_page_dirty(struct page *page);  extern void end_swap_bio_read(struct bio *bio, int err); @@ -343,8 +346,9 @@ extern struct address_space swapper_spaces[];  #define swap_address_space(entry) (&swapper_spaces[swp_type(entry)])  extern unsigned long total_swapcache_pages(void);  extern void show_swap_cache_info(void); -extern int add_to_swap(struct page *); +extern int add_to_swap(struct page *, struct list_head *list);  extern int add_to_swap_cache(struct page *, swp_entry_t, gfp_t); +extern int __add_to_swap_cache(struct page *page, swp_entry_t entry);  extern void __delete_from_swap_cache(struct page *);  extern void delete_from_swap_cache(struct page *);  extern void free_page_and_swap_cache(struct page *); @@ -461,7 +465,7 @@ static inline struct page *lookup_swap_cache(swp_entry_t swp)  	return NULL;  } -static inline int add_to_swap(struct page *page) +static inline int add_to_swap(struct page *page, struct list_head *list)  {  	return 0;  } diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index 2de42f9401d..a5ffd32642f 100644 --- a/include/linux/swiotlb.h +++ b/include/linux/swiotlb.h @@ -25,6 +25,7 @@ extern int swiotlb_force;  extern void swiotlb_init(int verbose);  int swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose);  extern unsigned long swiotlb_nr_tbl(void); +unsigned long swiotlb_size_or_default(void);  extern int swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs);  /* diff --git a/include/linux/thermal.h b/include/linux/thermal.h index f0bd7f90a90..e3c0ae9bb1f 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -44,7 +44,7 @@  /* Adding event notification support elements */  #define THERMAL_GENL_FAMILY_NAME                "thermal_event"  #define THERMAL_GENL_VERSION                    0x01 -#define THERMAL_GENL_MCAST_GROUP_NAME           "thermal_mc_group" +#define THERMAL_GENL_MCAST_GROUP_NAME           "thermal_mc_grp"  /* Default Thermal Governor */  #if defined(CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE) diff --git a/include/linux/time.h b/include/linux/time.h index d4835dfdf25..22d81b3c955 100644 --- a/include/linux/time.h +++ b/include/linux/time.h @@ -181,6 +181,9 @@ extern struct timespec timespec_trunc(struct timespec t, unsigned gran);  extern int timekeeping_valid_for_hres(void);  extern u64 timekeeping_max_deferment(void);  extern int timekeeping_inject_offset(struct timespec *ts); +extern s32 timekeeping_get_tai_offset(void); +extern void timekeeping_set_tai_offset(s32 tai_offset); +extern void timekeeping_clocktai(struct timespec *ts);  struct tms;  extern void do_sys_times(struct tms *); diff --git a/include/linux/timekeeper_internal.h b/include/linux/timekeeper_internal.h index e1d558e237e..c1825eb436e 100644 --- a/include/linux/timekeeper_internal.h +++ b/include/linux/timekeeper_internal.h @@ -20,6 +20,8 @@ struct timekeeper {  	u32			shift;  	/* Number of clock cycles in one NTP interval. */  	cycle_t			cycle_interval; +	/* Last cycle value (also stored in clock->cycle_last) */ +	cycle_t			cycle_last;  	/* Number of clock shifted nano seconds in one NTP interval. */  	u64			xtime_interval;  	/* shifted nano seconds left over when rounding cycle_interval */ @@ -62,8 +64,11 @@ struct timekeeper {  	ktime_t			offs_boot;  	/* The raw monotonic time for the CLOCK_MONOTONIC_RAW posix clock. */  	struct timespec		raw_time; -	/* Seqlock for all timekeeper values */ -	seqlock_t		lock; +	/* The current UTC to TAI offset in seconds */ +	s32			tai_offset; +	/* Offset clock monotonic -> clock tai */ +	ktime_t			offs_tai; +  };  static inline struct timespec tk_xtime(struct timekeeper *tk) diff --git a/include/linux/timex.h b/include/linux/timex.h index 5ec87c60b97..b3726e61368 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h @@ -125,9 +125,6 @@  extern unsigned long tick_usec;		/* USER_HZ period (usec) */  extern unsigned long tick_nsec;		/* SHIFTED_HZ period (nsec) */ -extern void ntp_init(void); -extern void ntp_clear(void); -  /* Required to safely shift negative values */  #define shift_right(x, s) ({	\  	__typeof__(x) __x = (x);	\ @@ -140,10 +137,6 @@ extern void ntp_clear(void);  #define NTP_INTERVAL_FREQ  (HZ)  #define NTP_INTERVAL_LENGTH (NSEC_PER_SEC/NTP_INTERVAL_FREQ) -/* Returns how long ticks are at present, in ns / 2^NTP_SCALE_SHIFT. */ -extern u64 ntp_tick_length(void); - -extern int second_overflow(unsigned long secs);  extern int do_adjtimex(struct timex *);  extern void hardpps(const struct timespec *, const struct timespec *); diff --git a/include/linux/trace_clock.h b/include/linux/trace_clock.h index d563f37e1a1..1d7ca273927 100644 --- a/include/linux/trace_clock.h +++ b/include/linux/trace_clock.h @@ -16,6 +16,7 @@  extern u64 notrace trace_clock_local(void);  extern u64 notrace trace_clock(void); +extern u64 notrace trace_clock_jiffies(void);  extern u64 notrace trace_clock_global(void);  extern u64 notrace trace_clock_counter(void); diff --git a/include/linux/tty.h b/include/linux/tty.h index c75d886b030..367a9dfc4ea 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -255,9 +255,9 @@ struct tty_struct {  	int count;  	struct winsize winsize;		/* termios mutex */  	unsigned char stopped:1, hw_stopped:1, flow_stopped:1, packet:1; -	unsigned char warned:1;  	unsigned char ctrl_status;	/* ctrl_lock */  	unsigned int receive_room;	/* Bytes free for queue */ +	int flow_change;  	struct tty_struct *link;  	struct fasync_struct *fasync; @@ -315,9 +315,25 @@ 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 		21	/* ->hangup() in progress */ +#define TTY_LDISC_HALTED	22	/* Line discipline is halted */  #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) +/* Values for tty->flow_change */ +#define TTY_THROTTLE_SAFE 1 +#define TTY_UNTHROTTLE_SAFE 2 + +static inline void __tty_set_flow_change(struct tty_struct *tty, int val) +{ +	tty->flow_change = val; +} + +static inline void tty_set_flow_change(struct tty_struct *tty, int val) +{ +	tty->flow_change = val; +	smp_mb(); +} +  #ifdef CONFIG_TTY  extern void console_init(void);  extern void tty_kref_put(struct tty_struct *tty); @@ -400,6 +416,8 @@ extern int tty_write_room(struct tty_struct *tty);  extern void tty_driver_flush_buffer(struct tty_struct *tty);  extern void tty_throttle(struct tty_struct *tty);  extern void tty_unthrottle(struct tty_struct *tty); +extern int tty_throttle_safe(struct tty_struct *tty); +extern int tty_unthrottle_safe(struct tty_struct *tty);  extern int tty_do_resize(struct tty_struct *tty, struct winsize *ws);  extern void tty_driver_remove_tty(struct tty_driver *driver,  				  struct tty_struct *tty); @@ -419,13 +437,28 @@ extern void tty_flush_to_ldisc(struct tty_struct *tty);  extern void tty_buffer_free_all(struct tty_port *port);  extern void tty_buffer_flush(struct tty_struct *tty);  extern void tty_buffer_init(struct tty_port *port); -extern speed_t tty_get_baud_rate(struct tty_struct *tty);  extern speed_t tty_termios_baud_rate(struct ktermios *termios);  extern speed_t tty_termios_input_baud_rate(struct ktermios *termios);  extern void tty_termios_encode_baud_rate(struct ktermios *termios,  						speed_t ibaud, speed_t obaud);  extern void tty_encode_baud_rate(struct tty_struct *tty,  						speed_t ibaud, speed_t obaud); + +/** + *	tty_get_baud_rate	-	get tty bit rates + *	@tty: tty to query + * + *	Returns the baud rate as an integer for this terminal. The + *	termios lock must be held by the caller and the terminal bit + *	flags may be updated. + * + *	Locking: none + */ +static inline speed_t tty_get_baud_rate(struct tty_struct *tty) +{ +	return tty_termios_baud_rate(&tty->termios); +} +  extern void tty_termios_copy_hw(struct ktermios *new, struct ktermios *old);  extern int tty_termios_hw_change(struct ktermios *a, struct ktermios *b);  extern int tty_set_termios(struct tty_struct *tty, struct ktermios *kt); @@ -502,6 +535,8 @@ extern int tty_port_carrier_raised(struct tty_port *port);  extern void tty_port_raise_dtr_rts(struct tty_port *port);  extern void tty_port_lower_dtr_rts(struct tty_port *port);  extern void tty_port_hangup(struct tty_port *port); +extern void tty_port_tty_hangup(struct tty_port *port, bool check_clocal); +extern void tty_port_tty_wakeup(struct tty_port *port);  extern int tty_port_block_til_ready(struct tty_port *port,  				struct tty_struct *tty, struct file *filp);  extern int tty_port_close_start(struct tty_port *port, @@ -526,8 +561,6 @@ extern void tty_ldisc_release(struct tty_struct *tty, struct tty_struct *o_tty);  extern void tty_ldisc_init(struct tty_struct *tty);  extern void tty_ldisc_deinit(struct tty_struct *tty);  extern void tty_ldisc_begin(void); -/* This last one is just for the tty layer internals and shouldn't be used elsewhere */ -extern void tty_ldisc_enable(struct tty_struct *tty);  /* n_tty.c */ diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index 455a0d7bf22..58390c73df8 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h @@ -9,89 +9,89 @@   *   * int	(*open)(struct tty_struct *);   * - * 	This function is called when the line discipline is associated - * 	with the tty.  The line discipline can use this as an - * 	opportunity to initialize any state needed by the ldisc routines. - *  + *	This function is called when the line discipline is associated + *	with the tty.  The line discipline can use this as an + *	opportunity to initialize any state needed by the ldisc routines. + *   * void	(*close)(struct tty_struct *);   *   *	This function is called when the line discipline is being - * 	shutdown, either because the tty is being closed or because - * 	the tty is being changed to use a new line discipline - *  + *	shutdown, either because the tty is being closed or because + *	the tty is being changed to use a new line discipline + *   * void	(*flush_buffer)(struct tty_struct *tty);   * - * 	This function instructs the line discipline to clear its - * 	buffers of any input characters it may have queued to be - * 	delivered to the user mode process. - *  + *	This function instructs the line discipline to clear its + *	buffers of any input characters it may have queued to be + *	delivered to the user mode process. + *   * ssize_t (*chars_in_buffer)(struct tty_struct *tty);   * - * 	This function returns the number of input characters the line + *	This function returns the number of input characters the line   *	discipline may have queued up to be delivered to the user mode   *	process. - *  + *   * ssize_t (*read)(struct tty_struct * tty, struct file * file,   *		   unsigned char * buf, size_t nr);   * - * 	This function is called when the user requests to read from - * 	the tty.  The line discipline will return whatever characters - * 	it has buffered up for the user.  If this function is not - * 	defined, the user will receive an EIO error. - *  + *	This function is called when the user requests to read from + *	the tty.  The line discipline will return whatever characters + *	it has buffered up for the user.  If this function is not + *	defined, the user will receive an EIO error. + *   * ssize_t (*write)(struct tty_struct * tty, struct file * file, - * 		    const unsigned char * buf, size_t nr); + *		    const unsigned char * buf, size_t nr); + * + *	This function is called when the user requests to write to the + *	tty.  The line discipline will deliver the characters to the + *	low-level tty device for transmission, optionally performing + *	some processing on the characters first.  If this function is + *	not defined, the user will receive an EIO error.   * - * 	This function is called when the user requests to write to the - * 	tty.  The line discipline will deliver the characters to the - * 	low-level tty device for transmission, optionally performing - * 	some processing on the characters first.  If this function is - * 	not defined, the user will receive an EIO error. - *    * int	(*ioctl)(struct tty_struct * tty, struct file * file, - * 		 unsigned int cmd, unsigned long arg); + *		 unsigned int cmd, unsigned long arg);   *   *	This function is called when the user requests an ioctl which - * 	is not handled by the tty layer or the low-level tty driver. - * 	It is intended for ioctls which affect line discpline - * 	operation.  Note that the search order for ioctls is (1) tty - * 	layer, (2) tty low-level driver, (3) line discpline.  So a - * 	low-level driver can "grab" an ioctl request before the line - * 	discpline has a chance to see it. - *  + *	is not handled by the tty layer or the low-level tty driver. + *	It is intended for ioctls which affect line discpline + *	operation.  Note that the search order for ioctls is (1) tty + *	layer, (2) tty low-level driver, (3) line discpline.  So a + *	low-level driver can "grab" an ioctl request before the line + *	discpline has a chance to see it. + *   * long	(*compat_ioctl)(struct tty_struct * tty, struct file * file, - * 		        unsigned int cmd, unsigned long arg); + *		        unsigned int cmd, unsigned long arg);   * - *      Process ioctl calls from 32-bit process on 64-bit system + *	Process ioctl calls from 32-bit process on 64-bit system   *   * void	(*set_termios)(struct tty_struct *tty, struct ktermios * old);   * - * 	This function notifies the line discpline that a change has - * 	been made to the termios structure. - *  + *	This function notifies the line discpline that a change has + *	been made to the termios structure. + *   * int	(*poll)(struct tty_struct * tty, struct file * file, - * 		  poll_table *wait); + *		  poll_table *wait);   * - * 	This function is called when a user attempts to select/poll on a - * 	tty device.  It is solely the responsibility of the line - * 	discipline to handle poll requests. + *	This function is called when a user attempts to select/poll on a + *	tty device.  It is solely the responsibility of the line + *	discipline to handle poll requests.   *   * void	(*receive_buf)(struct tty_struct *, const unsigned char *cp, - * 		       char *fp, int count); + *		       char *fp, int count); + * + *	This function is called by the low-level tty driver to send + *	characters received by the hardware to the line discpline for + *	processing.  <cp> is a pointer to the buffer of input + *	character received by the device.  <fp> is a pointer to a + *	pointer of flag bytes which indicate whether a character was + *	received with a parity error, etc.   * - * 	This function is called by the low-level tty driver to send - * 	characters received by the hardware to the line discpline for - * 	processing.  <cp> is a pointer to the buffer of input - * 	character received by the device.  <fp> is a pointer to a - * 	pointer of flag bytes which indicate whether a character was - * 	received with a parity error, etc. - *    * void	(*write_wakeup)(struct tty_struct *);   * - * 	This function is called by the low-level tty driver to signal - * 	that line discpline should try to send more characters to the - * 	low-level driver for transmission.  If the line discpline does - * 	not have any more data to send, it can just return. + *	This function is called by the low-level tty driver to signal + *	that line discpline should try to send more characters to the + *	low-level driver for transmission.  If the line discpline does + *	not have any more data to send, it can just return.   *   * int (*hangup)(struct tty_struct *)   * @@ -115,7 +115,7 @@ struct tty_ldisc_ops {  	char	*name;  	int	num;  	int	flags; -	 +  	/*  	 * The following routines are called from above.  	 */ @@ -123,19 +123,19 @@ struct tty_ldisc_ops {  	void	(*close)(struct tty_struct *);  	void	(*flush_buffer)(struct tty_struct *tty);  	ssize_t	(*chars_in_buffer)(struct tty_struct *tty); -	ssize_t	(*read)(struct tty_struct * tty, struct file * file, -			unsigned char __user * buf, size_t nr); -	ssize_t	(*write)(struct tty_struct * tty, struct file * file, -			 const unsigned char * buf, size_t nr);	 -	int	(*ioctl)(struct tty_struct * tty, struct file * file, +	ssize_t	(*read)(struct tty_struct *tty, struct file *file, +			unsigned char __user *buf, size_t nr); +	ssize_t	(*write)(struct tty_struct *tty, struct file *file, +			 const unsigned char *buf, size_t nr); +	int	(*ioctl)(struct tty_struct *tty, struct file *file,  			 unsigned int cmd, unsigned long arg); -	long	(*compat_ioctl)(struct tty_struct * tty, struct file * file, +	long	(*compat_ioctl)(struct tty_struct *tty, struct file *file,  				unsigned int cmd, unsigned long arg); -	void	(*set_termios)(struct tty_struct *tty, struct ktermios * old); +	void	(*set_termios)(struct tty_struct *tty, struct ktermios *old);  	unsigned int (*poll)(struct tty_struct *, struct file *,  			     struct poll_table_struct *);  	int	(*hangup)(struct tty_struct *tty); -	 +  	/*  	 * The following routines are called from below.  	 */ @@ -145,7 +145,7 @@ struct tty_ldisc_ops {  	void	(*dcd_change)(struct tty_struct *, unsigned int);  	struct  module *owner; -	 +  	int refcount;  }; diff --git a/include/linux/ucs2_string.h b/include/linux/ucs2_string.h new file mode 100644 index 00000000000..cbb20afdbc0 --- /dev/null +++ b/include/linux/ucs2_string.h @@ -0,0 +1,14 @@ +#ifndef _LINUX_UCS2_STRING_H_ +#define _LINUX_UCS2_STRING_H_ + +#include <linux/types.h>	/* for size_t */ +#include <linux/stddef.h>	/* for NULL */ + +typedef u16 ucs2_char_t; + +unsigned long ucs2_strnlen(const ucs2_char_t *s, size_t maxlength); +unsigned long ucs2_strlen(const ucs2_char_t *s); +unsigned long ucs2_strsize(const ucs2_char_t *data, unsigned long maxlength); +int ucs2_strncmp(const ucs2_char_t *a, const ucs2_char_t *b, size_t len); + +#endif /* _LINUX_UCS2_STRING_H_ */ diff --git a/include/linux/udp.h b/include/linux/udp.h index 9d81de123c9..42278bbf7a8 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h @@ -68,6 +68,7 @@ struct udp_sock {  	 * For encapsulation sockets.  	 */  	int (*encap_rcv)(struct sock *sk, struct sk_buff *skb); +	void (*encap_destroy)(struct sock *sk);  };  static inline struct udp_sock *udp_sk(const struct sock *sk) diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h index 02b83db8e2c..06f28beed7c 100644 --- a/include/linux/uprobes.h +++ b/include/linux/uprobes.h @@ -38,6 +38,8 @@ struct inode;  #define UPROBE_HANDLER_REMOVE		1  #define UPROBE_HANDLER_MASK		1 +#define MAX_URETPROBE_DEPTH		64 +  enum uprobe_filter_ctx {  	UPROBE_FILTER_REGISTER,  	UPROBE_FILTER_UNREGISTER, @@ -46,6 +48,9 @@ enum uprobe_filter_ctx {  struct uprobe_consumer {  	int (*handler)(struct uprobe_consumer *self, struct pt_regs *regs); +	int (*ret_handler)(struct uprobe_consumer *self, +				unsigned long func, +				struct pt_regs *regs);  	bool (*filter)(struct uprobe_consumer *self,  				enum uprobe_filter_ctx ctx,  				struct mm_struct *mm); @@ -68,6 +73,8 @@ struct uprobe_task {  	enum uprobe_task_state		state;  	struct arch_uprobe_task		autask; +	struct return_instance		*return_instances; +	unsigned int			depth;  	struct uprobe			*active_uprobe;  	unsigned long			xol_vaddr; @@ -100,6 +107,7 @@ struct uprobes_state {  extern int __weak set_swbp(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr);  extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr);  extern bool __weak is_swbp_insn(uprobe_opcode_t *insn); +extern bool __weak is_trap_insn(uprobe_opcode_t *insn);  extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc);  extern int uprobe_apply(struct inode *inode, loff_t offset, struct uprobe_consumer *uc, bool);  extern void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); diff --git a/include/linux/usb.h b/include/linux/usb.h index 4d22d0f6167..a0bee5a28d1 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -469,14 +469,12 @@ struct usb3_lpm_parameters {   * @lpm_capable: device supports LPM   * @usb2_hw_lpm_capable: device can perform USB2 hardware LPM   * @usb2_hw_lpm_enabled: USB2 hardware LPM enabled + * @usb3_lpm_enabled: USB3 hardware LPM enabled   * @string_langid: language ID for strings   * @product: iProduct string, if present (static)   * @manufacturer: iManufacturer string, if present (static)   * @serial: iSerialNumber string, if present (static)   * @filelist: usbfs files that are open to this device - * @usb_classdev: USB class device that was created for usbfs device - *	access from userspace - * @usbfs_dentry: usbfs dentry entry for the device   * @maxchild: number of ports if hub   * @quirks: quirks of the whole device   * @urbnum: number of URBs submitted for the whole device @@ -619,7 +617,7 @@ static inline bool usb_acpi_power_manageable(struct usb_device *hdev, int index)  #endif  /* USB autosuspend and autoresume */ -#ifdef CONFIG_USB_SUSPEND +#ifdef CONFIG_PM_RUNTIME  extern void usb_enable_autosuspend(struct usb_device *udev);  extern void usb_disable_autosuspend(struct usb_device *udev); @@ -978,7 +976,12 @@ struct usbdrv_wrap {   *	the "usbfs" filesystem.  This lets devices provide ways to   *	expose information to user space regardless of where they   *	do (or don't) show up otherwise in the filesystem. - * @suspend: Called when the device is going to be suspended by the system. + * @suspend: Called when the device is going to be suspended by the + *	system either from system sleep or runtime suspend context. The + *	return value will be ignored in system sleep context, so do NOT + *	try to continue using the device if suspend fails in this case. + *	Instead, let the resume or reset-resume routine recover from + *	the failure.   * @resume: Called when the device is being resumed by the system.   * @reset_resume: Called when the suspended device has been reset instead   *	of being resumed. diff --git a/include/linux/usb/cdc-wdm.h b/include/linux/usb/cdc-wdm.h index 719c332620f..0b3f4295c02 100644 --- a/include/linux/usb/cdc-wdm.h +++ b/include/linux/usb/cdc-wdm.h @@ -11,6 +11,8 @@  #ifndef __LINUX_USB_CDC_WDM_H  #define __LINUX_USB_CDC_WDM_H +#include <uapi/linux/usb/cdc-wdm.h> +  extern struct usb_driver *usb_cdc_wdm_register(struct usb_interface *intf,  					struct usb_endpoint_descriptor *ep,  					int bufsize, diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h index 3b8f9d4fc3f..cc25b70af33 100644 --- a/include/linux/usb/cdc_ncm.h +++ b/include/linux/usb/cdc_ncm.h @@ -127,6 +127,7 @@ struct cdc_ncm_ctx {  	u16 connected;  }; +extern u8 cdc_ncm_select_altsetting(struct usbnet *dev, struct usb_interface *intf);  extern int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting);  extern void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf);  extern struct sk_buff *cdc_ncm_fill_tx_frame(struct cdc_ncm_ctx *ctx, struct sk_buff *skb, __le32 sign); diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index 9c210f2283d..27603bcbb9b 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h @@ -43,4 +43,13 @@   */  extern const char *usb_speed_string(enum usb_device_speed speed); + +/** + * usb_state_string - Returns human readable name for the state. + * @state: The state to return a human-readable name for. If it's not + *	any of the states devices in usb_device_state_string enum, + *	the string UNKNOWN will be returned. + */ +extern const char *usb_state_string(enum usb_device_state state); +  #endif /* __LINUX_USB_CH9_H */ diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index 3c671c1b37f..5e61589fc16 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h @@ -39,6 +39,7 @@  #include <linux/usb/ch9.h>  #include <linux/usb/gadget.h>  #include <linux/log2.h> +#include <linux/configfs.h>  /*   * USB function drivers should return USB_GADGET_DELAYED_STATUS if they @@ -60,7 +61,7 @@ struct usb_configuration;   * @name: For diagnostics, identifies the function.   * @strings: tables of strings, keyed by identifiers assigned during bind()   *	and by language IDs provided in control requests - * @descriptors: Table of full (or low) speed descriptors, using interface and + * @fs_descriptors: Table of full (or low) speed descriptors, using interface and   *	string identifiers assigned during @bind().  If this pointer is null,   *	the function will not be available at full speed (or at low speed).   * @hs_descriptors: Table of high speed descriptors, using interface and @@ -290,6 +291,7 @@ enum {   *	after function notifications   * @resume: Notifies configuration when the host restarts USB traffic,   *	before function notifications + * @gadget_driver: Gadget driver controlling this driver   *   * Devices default to reporting self powered operation.  Devices which rely   * on bus powered operation should report this in their @bind method. @@ -463,6 +465,8 @@ struct usb_function_driver {  };  struct usb_function_instance { +	struct config_group group; +	struct list_head cfs_list;  	struct usb_function_driver *fd;  	void (*free_func_inst)(struct usb_function_instance *inst);  }; diff --git a/include/linux/usb/dwc3-omap.h b/include/linux/usb/dwc3-omap.h index 51eae14477f..5615f4d8272 100644 --- a/include/linux/usb/dwc3-omap.h +++ b/include/linux/usb/dwc3-omap.h @@ -19,11 +19,11 @@ enum omap_dwc3_vbus_id_status {  };  #if (defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_DWC3_MODULE)) -extern void dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status); +extern int dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status);  #else -static inline void dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status) +static inline int dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status)  { -	return; +	return -ENODEV;  }  #endif diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 2e297e80d59..c454a88abf2 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -482,6 +482,7 @@ struct usb_gadget_ops {   * @speed: Speed of current connection to USB host.   * @max_speed: Maximal speed the UDC can handle.  UDC must support this   *      and all slower speeds. + * @state: the state we are now (attached, suspended, configured, etc)   * @sg_supported: true if we can handle scatter-gather   * @is_otg: True if the USB device port uses a Mini-AB jack, so that the   *	gadget driver must provide a USB OTG descriptor. @@ -525,6 +526,7 @@ struct usb_gadget {  	struct list_head		ep_list;	/* of usb_ep */  	enum usb_device_speed		speed;  	enum usb_device_speed		max_speed; +	enum usb_device_state		state;  	unsigned			sg_supported:1;  	unsigned			is_otg:1;  	unsigned			is_a_peripheral:1; @@ -872,6 +874,8 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver);   */  int usb_gadget_unregister_driver(struct usb_gadget_driver *driver); +extern int usb_add_gadget_udc_release(struct device *parent, +		struct usb_gadget *gadget, void (*release)(struct device *dev));  extern int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget);  extern void usb_del_gadget_udc(struct usb_gadget *gadget);  extern int udc_attach_driver(const char *name, @@ -959,6 +963,13 @@ extern void usb_gadget_unmap_request(struct usb_gadget *gadget,  /*-------------------------------------------------------------------------*/ +/* utility to set gadget state properly */ + +extern void usb_gadget_set_state(struct usb_gadget *gadget, +		enum usb_device_state state); + +/*-------------------------------------------------------------------------*/ +  /* utility wrapping a simple endpoint selection policy */  extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *, diff --git a/include/linux/usb/gadget_configfs.h b/include/linux/usb/gadget_configfs.h new file mode 100644 index 00000000000..d74c0ae989d --- /dev/null +++ b/include/linux/usb/gadget_configfs.h @@ -0,0 +1,110 @@ +#ifndef __GADGET_CONFIGFS__ +#define __GADGET_CONFIGFS__ + +#include <linux/configfs.h> + +int check_user_usb_string(const char *name, +		struct usb_gadget_strings *stringtab_dev); + +#define GS_STRINGS_W(__struct, __name)	\ +	static ssize_t __struct##_##__name##_store(struct __struct *gs, \ +		const char *page, size_t len)		\ +{							\ +	int ret;					\ +							\ +	ret = usb_string_copy(page, &gs->__name);	\ +	if (ret)					\ +		return ret;				\ +	return len;					\ +} + +#define GS_STRINGS_R(__struct, __name)	\ +	static ssize_t __struct##_##__name##_show(struct __struct *gs, \ +			char *page)	\ +{	\ +	return sprintf(page, "%s\n", gs->__name ?: "");	\ +} + +#define GS_STRING_ITEM_ATTR(struct_name, name)	\ +	static struct struct_name##_attribute struct_name##_##name = \ +		__CONFIGFS_ATTR(name,  S_IRUGO | S_IWUSR,		\ +				struct_name##_##name##_show,		\ +				struct_name##_##name##_store) + +#define GS_STRINGS_RW(struct_name, _name)	\ +	GS_STRINGS_R(struct_name, _name)	\ +	GS_STRINGS_W(struct_name, _name)	\ +	GS_STRING_ITEM_ATTR(struct_name, _name) + +#define USB_CONFIG_STRING_RW_OPS(struct_in)				\ +	CONFIGFS_ATTR_OPS(struct_in);					\ +									\ +static struct configfs_item_operations struct_in##_langid_item_ops = {	\ +	.release                = struct_in##_attr_release,		\ +	.show_attribute         = struct_in##_attr_show,		\ +	.store_attribute        = struct_in##_attr_store,		\ +};									\ +									\ +static struct config_item_type struct_in##_langid_type = {		\ +	.ct_item_ops	= &struct_in##_langid_item_ops,			\ +	.ct_attrs	= struct_in##_langid_attrs,			\ +	.ct_owner	= THIS_MODULE,					\ +} + +#define USB_CONFIG_STRINGS_LANG(struct_in, struct_member)	\ +	static struct config_group *struct_in##_strings_make(		\ +			struct config_group *group,			\ +			const char *name)				\ +	{								\ +	struct struct_member *gi;					\ +	struct struct_in *gs;						\ +	struct struct_in *new;						\ +	int langs = 0;							\ +	int ret;							\ +									\ +	new = kzalloc(sizeof(*new), GFP_KERNEL);			\ +	if (!new)							\ +		return ERR_PTR(-ENOMEM);				\ +									\ +	ret = check_user_usb_string(name, &new->stringtab_dev);		\ +	if (ret)							\ +		goto err;						\ +	config_group_init_type_name(&new->group, name,			\ +			&struct_in##_langid_type);			\ +									\ +	gi = container_of(group, struct struct_member, strings_group);	\ +	ret = -EEXIST;							\ +	list_for_each_entry(gs, &gi->string_list, list) {		\ +		if (gs->stringtab_dev.language == new->stringtab_dev.language) \ +			goto err;					\ +		langs++;						\ +	}								\ +	ret = -EOVERFLOW;						\ +	if (langs >= MAX_USB_STRING_LANGS)				\ +		goto err;						\ +									\ +	list_add_tail(&new->list, &gi->string_list);			\ +	return &new->group;						\ +err:									\ +	kfree(new);							\ +	return ERR_PTR(ret);						\ +}									\ +									\ +static void struct_in##_strings_drop(					\ +		struct config_group *group,				\ +		struct config_item *item)				\ +{									\ +	config_item_put(item);						\ +}									\ +									\ +static struct configfs_group_operations struct_in##_strings_ops = {	\ +	.make_group     = &struct_in##_strings_make,			\ +	.drop_item      = &struct_in##_strings_drop,			\ +};									\ +									\ +static struct config_item_type struct_in##_strings_type = {		\ +	.ct_group_ops   = &struct_in##_strings_ops,			\ +	.ct_owner       = THIS_MODULE,					\ +} + +#endif diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 0a78df5f6cf..f5f5c7dfda9 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h @@ -84,7 +84,7 @@ struct usb_hcd {  	struct timer_list	rh_timer;	/* drives root-hub polling */  	struct urb		*status_urb;	/* the current status urb */ -#ifdef CONFIG_USB_SUSPEND +#ifdef CONFIG_PM_RUNTIME  	struct work_struct	wakeup_work;	/* for remote wakeup */  #endif @@ -357,6 +357,7 @@ struct hc_driver {  		 */  	int	(*disable_usb3_lpm_timeout)(struct usb_hcd *,  			struct usb_device *, enum usb3_link_state state); +	int	(*find_raw_port_number)(struct usb_hcd *, int);  };  extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); @@ -396,6 +397,7 @@ extern int usb_hcd_is_primary_hcd(struct usb_hcd *hcd);  extern int usb_add_hcd(struct usb_hcd *hcd,  		unsigned int irqnum, unsigned long irqflags);  extern void usb_remove_hcd(struct usb_hcd *hcd); +extern int usb_hcd_find_raw_port_number(struct usb_hcd *hcd, int port1);  struct platform_device;  extern void usb_hcd_platform_shutdown(struct platform_device *dev); @@ -591,14 +593,14 @@ extern int hcd_bus_suspend(struct usb_device *rhdev, pm_message_t msg);  extern int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg);  #endif /* CONFIG_PM */ -#ifdef CONFIG_USB_SUSPEND +#ifdef CONFIG_PM_RUNTIME  extern void usb_hcd_resume_root_hub(struct usb_hcd *hcd);  #else  static inline void usb_hcd_resume_root_hub(struct usb_hcd *hcd)  {  	return;  } -#endif /* CONFIG_USB_SUSPEND */ +#endif /* CONFIG_PM_RUNTIME */  /*-------------------------------------------------------------------------*/ diff --git a/include/linux/usb/musb-ux500.h b/include/linux/usb/musb-ux500.h new file mode 100644 index 00000000000..1e2c7130f6e --- /dev/null +++ b/include/linux/usb/musb-ux500.h @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2013 ST-Ericsson AB + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * 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 __MUSB_UX500_H__ +#define __MUSB_UX500_H__ + +enum ux500_musb_vbus_id_status { +	UX500_MUSB_NONE = 0, +	UX500_MUSB_VBUS, +	UX500_MUSB_ID, +	UX500_MUSB_CHARGER, +	UX500_MUSB_ENUMERATED, +	UX500_MUSB_RIDA, +	UX500_MUSB_RIDB, +	UX500_MUSB_RIDC, +	UX500_MUSB_PREPARE, +	UX500_MUSB_CLEAN, +}; + +#endif	/* __MUSB_UX500_H__ */ diff --git a/include/linux/usb/nop-usb-xceiv.h b/include/linux/usb/nop-usb-xceiv.h index 28884c71741..148d35171aa 100644 --- a/include/linux/usb/nop-usb-xceiv.h +++ b/include/linux/usb/nop-usb-xceiv.h @@ -5,6 +5,11 @@  struct nop_usb_xceiv_platform_data {  	enum usb_phy_type type; +	unsigned long clk_rate; + +	/* if set fails with -EPROBE_DEFER if can't get regulator */ +	unsigned int needs_vcc:1; +	unsigned int needs_reset:1;  };  #if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE)) diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index e8a5fe87c6b..291e01ba32e 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h @@ -36,14 +36,7 @@ struct usb_otg {  }; -#ifdef CONFIG_USB_OTG_UTILS -extern const char *otg_state_string(enum usb_otg_state state); -#else -static inline const char *otg_state_string(enum usb_otg_state state) -{ -	return NULL; -} -#endif +extern const char *usb_otg_state_string(enum usb_otg_state state);  /* Context: can sleep */  static inline int diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h index 15847cbdb51..6b5978f5763 100644 --- a/include/linux/usb/phy.h +++ b/include/linux/usb/phy.h @@ -91,6 +91,9 @@ struct usb_phy {  	int	(*init)(struct usb_phy *x);  	void	(*shutdown)(struct usb_phy *x); +	/* enable/disable VBUS */ +	int	(*set_vbus)(struct usb_phy *x, int on); +  	/* effective for B devices, ignored for A-peripheral */  	int	(*set_power)(struct usb_phy *x,  				unsigned mA); @@ -160,8 +163,26 @@ usb_phy_shutdown(struct usb_phy *x)  		x->shutdown(x);  } +static inline int +usb_phy_vbus_on(struct usb_phy *x) +{ +	if (!x->set_vbus) +		return 0; + +	return x->set_vbus(x, true); +} + +static inline int +usb_phy_vbus_off(struct usb_phy *x) +{ +	if (!x->set_vbus) +		return 0; + +	return x->set_vbus(x, false); +} +  /* for usb host and peripheral controller drivers */ -#ifdef CONFIG_USB_OTG_UTILS +#if IS_ENABLED(CONFIG_USB_PHY)  extern struct usb_phy *usb_get_phy(enum usb_phy_type type);  extern struct usb_phy *devm_usb_get_phy(struct device *dev,  	enum usb_phy_type type); @@ -176,29 +197,29 @@ extern int usb_bind_phy(const char *dev_name, u8 index,  #else  static inline struct usb_phy *usb_get_phy(enum usb_phy_type type)  { -	return NULL; +	return ERR_PTR(-ENXIO);  }  static inline struct usb_phy *devm_usb_get_phy(struct device *dev,  	enum usb_phy_type type)  { -	return NULL; +	return ERR_PTR(-ENXIO);  }  static inline struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index)  { -	return NULL; +	return ERR_PTR(-ENXIO);  }  static inline struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index)  { -	return NULL; +	return ERR_PTR(-ENXIO);  }  static inline struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev,  	const char *phandle, u8 index)  { -	return NULL; +	return ERR_PTR(-ENXIO);  }  static inline void usb_put_phy(struct usb_phy *x) diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h index c5d36c65c33..e452ba6ec6b 100644 --- a/include/linux/usb/renesas_usbhs.h +++ b/include/linux/usb/renesas_usbhs.h @@ -62,14 +62,14 @@ struct renesas_usbhs_platform_callback {  	 * Hardware exit function for platform.  	 * it is called when driver was removed  	 */ -	void (*hardware_exit)(struct platform_device *pdev); +	int (*hardware_exit)(struct platform_device *pdev);  	/*  	 * option:  	 *  	 * for board specific clock control  	 */ -	void (*power_ctrl)(struct platform_device *pdev, +	int (*power_ctrl)(struct platform_device *pdev,  			   void __iomem *base, int enable);  	/* @@ -77,7 +77,7 @@ struct renesas_usbhs_platform_callback {  	 *  	 * Phy reset for platform  	 */ -	void (*phy_reset)(struct platform_device *pdev); +	int (*phy_reset)(struct platform_device *pdev);  	/*  	 * get USB ID function diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index ef9be7e1e19..b9b0f7b4e43 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h @@ -15,6 +15,7 @@  #include <linux/kref.h>  #include <linux/mutex.h> +#include <linux/serial.h>  #include <linux/sysrq.h>  #include <linux/kfifo.h> @@ -61,6 +62,7 @@   * @bulk_out_buffers: pointers to the bulk out buffers for this port   * @write_urbs: pointers to the bulk out urbs for this port   * @write_urbs_free: status bitmap the for bulk out urbs + * @icount: interrupt counters   * @tx_bytes: number of bytes currently in host stack queues   * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this   *	port. @@ -108,6 +110,7 @@ struct usb_serial_port {  	unsigned long		write_urbs_free;  	__u8			bulk_out_endpointAddress; +	struct async_icount	icount;  	int			tx_bytes;  	unsigned long		flags; @@ -270,6 +273,7 @@ struct usb_serial_driver {  	int  (*tiocmget)(struct tty_struct *tty);  	int  (*tiocmset)(struct tty_struct *tty,  			 unsigned int set, unsigned int clear); +	int  (*tiocmiwait)(struct tty_struct *tty, unsigned long arg);  	int  (*get_icount)(struct tty_struct *tty,  			struct serial_icounter_struct *icount);  	/* Called by the tty layer for port level work. There may or may not @@ -327,8 +331,10 @@ extern void usb_serial_generic_read_bulk_callback(struct urb *urb);  extern void usb_serial_generic_write_bulk_callback(struct urb *urb);  extern void usb_serial_generic_throttle(struct tty_struct *tty);  extern void usb_serial_generic_unthrottle(struct tty_struct *tty); -extern void usb_serial_generic_disconnect(struct usb_serial *serial); -extern void usb_serial_generic_release(struct usb_serial *serial); +extern int usb_serial_generic_tiocmiwait(struct tty_struct *tty, +							unsigned long arg); +extern int usb_serial_generic_get_icount(struct tty_struct *tty, +					struct serial_icounter_struct *icount);  extern int usb_serial_generic_register(void);  extern void usb_serial_generic_deregister(void);  extern int usb_serial_generic_submit_read_urbs(struct usb_serial_port *port, diff --git a/include/linux/usb/tegra_usb_phy.h b/include/linux/usb/tegra_usb_phy.h index 9ebebe90692..1b7519a8c0b 100644 --- a/include/linux/usb/tegra_usb_phy.h +++ b/include/linux/usb/tegra_usb_phy.h @@ -61,10 +61,14 @@ struct tegra_usb_phy {  	struct device *dev;  	bool is_legacy_phy;  	bool is_ulpi_phy; +	void (*set_pts)(struct usb_phy *x, u8 pts_val); +	void (*set_phcd)(struct usb_phy *x, bool enable);  };  struct tegra_usb_phy *tegra_usb_phy_open(struct device *dev, int instance, -	void __iomem *regs, void *config, enum tegra_usb_phy_mode phy_mode); +	void __iomem *regs, void *config, enum tegra_usb_phy_mode phy_mode, +	void (*set_pts)(struct usb_phy *x, u8 pts_val), +	void (*set_phcd)(struct usb_phy *x, bool enable));  void tegra_usb_phy_preresume(struct usb_phy *phy); @@ -75,8 +79,4 @@ void tegra_ehci_phy_restore_start(struct usb_phy *phy,  void tegra_ehci_phy_restore_end(struct usb_phy *phy); -void tegra_ehci_set_pts(struct usb_phy *x, u8 pts_val); - -void tegra_ehci_set_phcd(struct usb_phy *x, bool enable); -  #endif /* __TEGRA_USB_PHY_H */ diff --git a/include/linux/usb/ulpi.h b/include/linux/usb/ulpi.h index 6f033a415ec..5c295c26ad3 100644 --- a/include/linux/usb/ulpi.h +++ b/include/linux/usb/ulpi.h @@ -181,8 +181,16 @@  /*-------------------------------------------------------------------------*/ +#if IS_ENABLED(CONFIG_USB_ULPI)  struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops,  					unsigned int flags); +#else +static inline struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops, +					      unsigned int flags) +{ +	return NULL; +} +#endif  #ifdef CONFIG_USB_ULPI_VIEWPORT  /* access ops for controllers with a viewport register */ diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h index 4ce00932493..b6b215f13b4 100644 --- a/include/linux/user_namespace.h +++ b/include/linux/user_namespace.h @@ -26,6 +26,8 @@ struct user_namespace {  	kuid_t			owner;  	kgid_t			group;  	unsigned int		proc_inum; +	bool			may_mount_sysfs; +	bool			may_mount_proc;  };  extern struct user_namespace init_user_ns; @@ -82,4 +84,6 @@ static inline void put_user_ns(struct user_namespace *ns)  #endif +void update_mnt_policy(struct user_namespace *userns); +  #endif /* _LINUX_USER_H */ diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 6071e911c7f..7d5773a99f2 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -3,7 +3,9 @@  #include <linux/spinlock.h>  #include <linux/init.h> +#include <linux/list.h>  #include <asm/page.h>		/* pgprot_t */ +#include <linux/rbtree.h>  struct vm_area_struct;		/* vma defining user mapping in mm_types.h */ @@ -35,6 +37,17 @@ struct vm_struct {  	const void		*caller;  }; +struct vmap_area { +	unsigned long va_start; +	unsigned long va_end; +	unsigned long flags; +	struct rb_node rb_node;         /* address sorted rbtree */ +	struct list_head list;          /* address sorted list */ +	struct list_head purge_list;    /* "lazy purge" list */ +	struct vm_struct *vm; +	struct rcu_head rcu_head; +}; +  /*   *	Highlevel APIs for driver use   */ @@ -130,8 +143,7 @@ extern long vwrite(char *buf, char *addr, unsigned long count);  /*   *	Internals.  Dont't use..   */ -extern rwlock_t vmlist_lock; -extern struct vm_struct *vmlist; +extern struct list_head vmap_area_list;  extern __init void vm_area_add_early(struct vm_struct *vm);  extern __init void vm_area_register_early(struct vm_struct *vm, size_t align); @@ -158,4 +170,22 @@ pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms)  # endif  #endif +struct vmalloc_info { +	unsigned long   used; +	unsigned long   largest_chunk; +}; + +#ifdef CONFIG_MMU +#define VMALLOC_TOTAL (VMALLOC_END - VMALLOC_START) +extern void get_vmalloc_info(struct vmalloc_info *vmi); +#else + +#define VMALLOC_TOTAL 0UL +#define get_vmalloc_info(vmi)			\ +do {						\ +	(vmi)->used = 0;			\ +	(vmi)->largest_chunk = 0;		\ +} while (0) +#endif +  #endif /* _LINUX_VMALLOC_H */ diff --git a/include/linux/vmpressure.h b/include/linux/vmpressure.h new file mode 100644 index 00000000000..76be077340e --- /dev/null +++ b/include/linux/vmpressure.h @@ -0,0 +1,47 @@ +#ifndef __LINUX_VMPRESSURE_H +#define __LINUX_VMPRESSURE_H + +#include <linux/mutex.h> +#include <linux/list.h> +#include <linux/workqueue.h> +#include <linux/gfp.h> +#include <linux/types.h> +#include <linux/cgroup.h> + +struct vmpressure { +	unsigned long scanned; +	unsigned long reclaimed; +	/* The lock is used to keep the scanned/reclaimed above in sync. */ +	struct mutex sr_lock; + +	/* The list of vmpressure_event structs. */ +	struct list_head events; +	/* Have to grab the lock on events traversal or modifications. */ +	struct mutex events_lock; + +	struct work_struct work; +}; + +struct mem_cgroup; + +#ifdef CONFIG_MEMCG +extern void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, +		       unsigned long scanned, unsigned long reclaimed); +extern void vmpressure_prio(gfp_t gfp, struct mem_cgroup *memcg, int prio); + +extern void vmpressure_init(struct vmpressure *vmpr); +extern struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg); +extern struct cgroup_subsys_state *vmpressure_to_css(struct vmpressure *vmpr); +extern struct vmpressure *css_to_vmpressure(struct cgroup_subsys_state *css); +extern int vmpressure_register_event(struct cgroup *cg, struct cftype *cft, +				     struct eventfd_ctx *eventfd, +				     const char *args); +extern void vmpressure_unregister_event(struct cgroup *cg, struct cftype *cft, +					struct eventfd_ctx *eventfd); +#else +static inline void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, +			      unsigned long scanned, unsigned long reclaimed) {} +static inline void vmpressure_prio(gfp_t gfp, struct mem_cgroup *memcg, +				   int prio) {} +#endif /* CONFIG_MEMCG */ +#endif /* __LINUX_VMPRESSURE_H */ diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index 5fd71a7d0df..c586679b6fe 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h @@ -48,13 +48,8 @@ static inline void count_vm_events(enum vm_event_item item, long delta)  }  extern void all_vm_events(unsigned long *); -#ifdef CONFIG_HOTPLUG +  extern void vm_events_fold_cpu(int cpu); -#else -static inline void vm_events_fold_cpu(int cpu) -{ -} -#endif  #else diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 8afab27cdbc..71797563937 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h @@ -11,6 +11,7 @@  #include <linux/lockdep.h>  #include <linux/threads.h>  #include <linux/atomic.h> +#include <linux/cpumask.h>  struct workqueue_struct; @@ -68,7 +69,7 @@ enum {  				  WORK_STRUCT_COLOR_BITS,  	/* data contains off-queue information when !WORK_STRUCT_PWQ */ -	WORK_OFFQ_FLAG_BASE	= WORK_STRUCT_FLAG_BITS, +	WORK_OFFQ_FLAG_BASE	= WORK_STRUCT_COLOR_SHIFT,  	WORK_OFFQ_CANCELING	= (1 << WORK_OFFQ_FLAG_BASE), @@ -115,6 +116,20 @@ struct delayed_work {  	int cpu;  }; +/* + * A struct for workqueue attributes.  This can be used to change + * attributes of an unbound workqueue. + * + * Unlike other fields, ->no_numa isn't a property of a worker_pool.  It + * only modifies how apply_workqueue_attrs() select pools and thus doesn't + * participate in pool hash calculations or equality comparisons. + */ +struct workqueue_attrs { +	int			nice;		/* nice level */ +	cpumask_var_t		cpumask;	/* allowed CPUs */ +	bool			no_numa;	/* disable NUMA affinity */ +}; +  static inline struct delayed_work *to_delayed_work(struct work_struct *work)  {  	return container_of(work, struct delayed_work, work); @@ -283,9 +298,10 @@ enum {  	WQ_MEM_RECLAIM		= 1 << 3, /* may be used for memory reclaim */  	WQ_HIGHPRI		= 1 << 4, /* high priority */  	WQ_CPU_INTENSIVE	= 1 << 5, /* cpu instensive workqueue */ +	WQ_SYSFS		= 1 << 6, /* visible in sysfs, see wq_sysfs_register() */ -	WQ_DRAINING		= 1 << 6, /* internal: workqueue is draining */ -	WQ_RESCUER		= 1 << 7, /* internal: workqueue has rescuer */ +	__WQ_DRAINING		= 1 << 16, /* internal: workqueue is draining */ +	__WQ_ORDERED		= 1 << 17, /* internal: workqueue is ordered */  	WQ_MAX_ACTIVE		= 512,	  /* I like 512, better ideas? */  	WQ_MAX_UNBOUND_PER_CPU	= 4,	  /* 4 * #cpus for unbound wq */ @@ -388,7 +404,7 @@ __alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active,   * Pointer to the allocated workqueue on success, %NULL on failure.   */  #define alloc_ordered_workqueue(fmt, flags, args...)			\ -	alloc_workqueue(fmt, WQ_UNBOUND | (flags), 1, ##args) +	alloc_workqueue(fmt, WQ_UNBOUND | __WQ_ORDERED | (flags), 1, ##args)  #define create_workqueue(name)						\  	alloc_workqueue((name), WQ_MEM_RECLAIM, 1) @@ -399,30 +415,23 @@ __alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active,  extern void destroy_workqueue(struct workqueue_struct *wq); +struct workqueue_attrs *alloc_workqueue_attrs(gfp_t gfp_mask); +void free_workqueue_attrs(struct workqueue_attrs *attrs); +int apply_workqueue_attrs(struct workqueue_struct *wq, +			  const struct workqueue_attrs *attrs); +  extern bool queue_work_on(int cpu, struct workqueue_struct *wq,  			struct work_struct *work); -extern bool queue_work(struct workqueue_struct *wq, struct work_struct *work);  extern bool queue_delayed_work_on(int cpu, struct workqueue_struct *wq,  			struct delayed_work *work, unsigned long delay); -extern bool queue_delayed_work(struct workqueue_struct *wq, -			struct delayed_work *work, unsigned long delay);  extern bool mod_delayed_work_on(int cpu, struct workqueue_struct *wq,  			struct delayed_work *dwork, unsigned long delay); -extern bool mod_delayed_work(struct workqueue_struct *wq, -			struct delayed_work *dwork, unsigned long delay);  extern void flush_workqueue(struct workqueue_struct *wq);  extern void drain_workqueue(struct workqueue_struct *wq);  extern void flush_scheduled_work(void); -extern bool schedule_work_on(int cpu, struct work_struct *work); -extern bool schedule_work(struct work_struct *work); -extern bool schedule_delayed_work_on(int cpu, struct delayed_work *work, -				     unsigned long delay); -extern bool schedule_delayed_work(struct delayed_work *work, -				  unsigned long delay);  extern int schedule_on_each_cpu(work_func_t func); -extern int keventd_up(void);  int execute_in_process_context(work_func_t fn, struct execute_work *); @@ -435,9 +444,121 @@ extern bool cancel_delayed_work_sync(struct delayed_work *dwork);  extern void workqueue_set_max_active(struct workqueue_struct *wq,  				     int max_active); -extern bool workqueue_congested(unsigned int cpu, struct workqueue_struct *wq); +extern bool current_is_workqueue_rescuer(void); +extern bool workqueue_congested(int cpu, struct workqueue_struct *wq);  extern unsigned int work_busy(struct work_struct *work); +/** + * queue_work - queue work on a workqueue + * @wq: workqueue to use + * @work: work to queue + * + * Returns %false if @work was already on a queue, %true otherwise. + * + * We queue the work to the CPU on which it was submitted, but if the CPU dies + * it can be processed by another CPU. + */ +static inline bool queue_work(struct workqueue_struct *wq, +			      struct work_struct *work) +{ +	return queue_work_on(WORK_CPU_UNBOUND, wq, work); +} + +/** + * queue_delayed_work - queue work on a workqueue after delay + * @wq: workqueue to use + * @dwork: delayable work to queue + * @delay: number of jiffies to wait before queueing + * + * Equivalent to queue_delayed_work_on() but tries to use the local CPU. + */ +static inline bool queue_delayed_work(struct workqueue_struct *wq, +				      struct delayed_work *dwork, +				      unsigned long delay) +{ +	return queue_delayed_work_on(WORK_CPU_UNBOUND, wq, dwork, delay); +} + +/** + * mod_delayed_work - modify delay of or queue a delayed work + * @wq: workqueue to use + * @dwork: work to queue + * @delay: number of jiffies to wait before queueing + * + * mod_delayed_work_on() on local CPU. + */ +static inline bool mod_delayed_work(struct workqueue_struct *wq, +				    struct delayed_work *dwork, +				    unsigned long delay) +{ +	return mod_delayed_work_on(WORK_CPU_UNBOUND, wq, dwork, delay); +} + +/** + * schedule_work_on - put work task on a specific cpu + * @cpu: cpu to put the work task on + * @work: job to be done + * + * This puts a job on a specific cpu + */ +static inline bool schedule_work_on(int cpu, struct work_struct *work) +{ +	return queue_work_on(cpu, system_wq, work); +} + +/** + * schedule_work - put work task in global workqueue + * @work: job to be done + * + * Returns %false if @work was already on the kernel-global workqueue and + * %true otherwise. + * + * This puts a job in the kernel-global workqueue if it was not already + * queued and leaves it in the same position on the kernel-global + * workqueue otherwise. + */ +static inline bool schedule_work(struct work_struct *work) +{ +	return queue_work(system_wq, work); +} + +/** + * schedule_delayed_work_on - queue work in global workqueue on CPU after delay + * @cpu: cpu to use + * @dwork: job to be done + * @delay: number of jiffies to wait + * + * After waiting for a given time this puts a job in the kernel-global + * workqueue on the specified CPU. + */ +static inline bool schedule_delayed_work_on(int cpu, struct delayed_work *dwork, +					    unsigned long delay) +{ +	return queue_delayed_work_on(cpu, system_wq, dwork, delay); +} + +/** + * schedule_delayed_work - put work task in global workqueue after delay + * @dwork: job to be done + * @delay: number of jiffies to wait or 0 for immediate execution + * + * After waiting for a given time this puts a job in the kernel-global + * workqueue. + */ +static inline bool schedule_delayed_work(struct delayed_work *dwork, +					 unsigned long delay) +{ +	return queue_delayed_work(system_wq, dwork, delay); +} + +/** + * keventd_up - is workqueue initialized yet? + */ +static inline bool keventd_up(void) +{ +	return system_wq != NULL; +} +  /*   * Like above, but uses del_timer() instead of del_timer_sync(). This means,   * if it returns 0 the timer function may be running and the queueing is in @@ -466,12 +587,12 @@ static inline bool __deprecated flush_delayed_work_sync(struct delayed_work *dwo  }  #ifndef CONFIG_SMP -static inline long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg) +static inline long work_on_cpu(int cpu, long (*fn)(void *), void *arg)  {  	return fn(arg);  }  #else -long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg); +long work_on_cpu(int cpu, long (*fn)(void *), void *arg);  #endif /* CONFIG_SMP */  #ifdef CONFIG_FREEZER @@ -480,4 +601,11 @@ extern bool freeze_workqueues_busy(void);  extern void thaw_workqueues(void);  #endif /* CONFIG_FREEZER */ +#ifdef CONFIG_SYSFS +int workqueue_sysfs_register(struct workqueue_struct *wq); +#else	/* CONFIG_SYSFS */ +static inline int workqueue_sysfs_register(struct workqueue_struct *wq) +{ return 0; } +#endif	/* CONFIG_SYSFS */ +  #endif diff --git a/include/net/addrconf.h b/include/net/addrconf.h index 40be2a0d8ae..84a6440f1f1 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h @@ -199,6 +199,7 @@ extern bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev,  /* Device notifier */  extern int register_inet6addr_notifier(struct notifier_block *nb);  extern int unregister_inet6addr_notifier(struct notifier_block *nb); +extern int inet6addr_notifier_call_chain(unsigned long val, void *v);  extern void inet6_netconf_notify_devconf(struct net *net, int type, int ifindex,  					 struct ipv6_devconf *devconf); diff --git a/include/net/dst.h b/include/net/dst.h index 853cda11e51..1f8fd109e22 100644 --- a/include/net/dst.h +++ b/include/net/dst.h @@ -413,13 +413,15 @@ static inline int dst_neigh_output(struct dst_entry *dst, struct neighbour *n,  static inline struct neighbour *dst_neigh_lookup(const struct dst_entry *dst, const void *daddr)  { -	return dst->ops->neigh_lookup(dst, NULL, daddr); +	struct neighbour *n = dst->ops->neigh_lookup(dst, NULL, daddr); +	return IS_ERR(n) ? NULL : n;  }  static inline struct neighbour *dst_neigh_lookup_skb(const struct dst_entry *dst,  						     struct sk_buff *skb)  { -	return dst->ops->neigh_lookup(dst, skb, NULL); +	struct neighbour *n =  dst->ops->neigh_lookup(dst, skb, NULL); +	return IS_ERR(n) ? NULL : n;  }  static inline void dst_link_failure(struct sk_buff *skb) diff --git a/include/net/flow_keys.h b/include/net/flow_keys.h index 80461c1ae9e..bb8271d487b 100644 --- a/include/net/flow_keys.h +++ b/include/net/flow_keys.h @@ -9,6 +9,7 @@ struct flow_keys {  		__be32 ports;  		__be16 port16[2];  	}; +	u16 thoff;  	u8 ip_proto;  }; diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h index 76c3fe5ecc2..0a1dcc2fa2f 100644 --- a/include/net/inet_frag.h +++ b/include/net/inet_frag.h @@ -43,6 +43,13 @@ struct inet_frag_queue {  #define INETFRAGS_HASHSZ		64 +/* averaged: + * max_depth = default ipfrag_high_thresh / INETFRAGS_HASHSZ / + *	       rounded up (SKB_TRUELEN(0) + sizeof(struct ipq or + *	       struct frag_queue)) + */ +#define INETFRAGS_MAXDEPTH		128 +  struct inet_frags {  	struct hlist_head	hash[INETFRAGS_HASHSZ];  	/* This rwlock is a global lock (seperate per IPv4, IPv6 and @@ -76,6 +83,8 @@ int inet_frag_evictor(struct netns_frags *nf, struct inet_frags *f, bool force);  struct inet_frag_queue *inet_frag_find(struct netns_frags *nf,  		struct inet_frags *f, void *key, unsigned int hash)  	__releases(&f->lock); +void inet_frag_maybe_warn_overflow(struct inet_frag_queue *q, +				   const char *prefix);  static inline void inet_frag_put(struct inet_frag_queue *q, struct inet_frags *f)  { diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index 9497be1ad4c..e49db91593a 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h @@ -152,18 +152,16 @@ struct fib_result_nl {  };  #ifdef CONFIG_IP_ROUTE_MULTIPATH -  #define FIB_RES_NH(res)		((res).fi->fib_nh[(res).nh_sel]) - -#define FIB_TABLE_HASHSZ 2 -  #else /* CONFIG_IP_ROUTE_MULTIPATH */ -  #define FIB_RES_NH(res)		((res).fi->fib_nh[0]) +#endif /* CONFIG_IP_ROUTE_MULTIPATH */ +#ifdef CONFIG_IP_MULTIPLE_TABLES  #define FIB_TABLE_HASHSZ 256 - -#endif /* CONFIG_IP_ROUTE_MULTIPATH */ +#else +#define FIB_TABLE_HASHSZ 2 +#endif  extern __be32 fib_info_update_nh_saddr(struct net *net, struct fib_nh *nh); diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 68c69d54d39..fce8e6b66d5 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h @@ -976,6 +976,7 @@ struct netns_ipvs {  	int			sysctl_sync_retries;  	int			sysctl_nat_icmp_send;  	int			sysctl_pmtu_disc; +	int			sysctl_backup_only;  	/* ip_vs_lblc */  	int			sysctl_lblc_expiration; @@ -1067,6 +1068,12 @@ static inline int sysctl_pmtu_disc(struct netns_ipvs *ipvs)  	return ipvs->sysctl_pmtu_disc;  } +static inline int sysctl_backup_only(struct netns_ipvs *ipvs) +{ +	return ipvs->sync_state & IP_VS_STATE_BACKUP && +	       ipvs->sysctl_backup_only; +} +  #else  static inline int sysctl_sync_threshold(struct netns_ipvs *ipvs) @@ -1114,6 +1121,11 @@ static inline int sysctl_pmtu_disc(struct netns_ipvs *ipvs)  	return 1;  } +static inline int sysctl_backup_only(struct netns_ipvs *ipvs) +{ +	return 0; +} +  #endif  /* diff --git a/include/net/ipip.h b/include/net/ipip.h index fd19625ff99..982141c1520 100644 --- a/include/net/ipip.h +++ b/include/net/ipip.h @@ -77,15 +77,11 @@ static inline void tunnel_ip_select_ident(struct sk_buff *skb,  {  	struct iphdr *iph = ip_hdr(skb); -	if (iph->frag_off & htons(IP_DF)) -		iph->id	= 0; -	else { -		/* Use inner packet iph-id if possible. */ -		if (skb->protocol == htons(ETH_P_IP) && old_iph->id) -			iph->id	= old_iph->id; -		else -			__ip_select_ident(iph, dst, -					  (skb_shinfo(skb)->gso_segs ?: 1) - 1); -	} +	/* Use inner packet iph-id if possible. */ +	if (skb->protocol == htons(ETH_P_IP) && old_iph->id) +		iph->id	= old_iph->id; +	else +		__ip_select_ident(iph, dst, +				  (skb_shinfo(skb)->gso_segs ?: 1) - 1);  }  #endif diff --git a/include/net/irda/irlmp.h b/include/net/irda/irlmp.h index f74109144d3..f132924cc9d 100644 --- a/include/net/irda/irlmp.h +++ b/include/net/irda/irlmp.h @@ -256,7 +256,8 @@ static inline __u32 irlmp_get_daddr(const struct lsap_cb *self)  	return (self && self->lap) ? self->lap->daddr : 0;  } -extern const char *irlmp_reasons[]; +const char *irlmp_reason_str(LM_REASON reason); +  extern int sysctl_discovery_timeout;  extern int sysctl_discovery_slots;  extern int sysctl_discovery; diff --git a/include/net/iucv/af_iucv.h b/include/net/iucv/af_iucv.h index cc7c1973238..714cc9a54a4 100644 --- a/include/net/iucv/af_iucv.h +++ b/include/net/iucv/af_iucv.h @@ -130,6 +130,14 @@ struct iucv_sock {  					       enum iucv_tx_notify n);  }; +struct iucv_skb_cb { +	u32	class;		/* target class of message */ +	u32	tag;		/* tag associated with message */ +	u32	offset;		/* offset for skb receival */ +}; + +#define IUCV_SKB_CB(__skb)	((struct iucv_skb_cb *)&((__skb)->cb[0])) +  /* iucv socket options (SOL_IUCV) */  #define SO_IPRMDATA_MSG	0x0080		/* send/recv IPRM_DATA msgs */  #define SO_MSGLIMIT	0x1000		/* get/set IUCV MSGLIMIT */ diff --git a/include/net/scm.h b/include/net/scm.h index 975cca01048..b1170810568 100644 --- a/include/net/scm.h +++ b/include/net/scm.h @@ -56,8 +56,8 @@ static __inline__ void scm_set_cred(struct scm_cookie *scm,  	scm->pid  = get_pid(pid);  	scm->cred = cred ? get_cred(cred) : NULL;  	scm->creds.pid = pid_vnr(pid); -	scm->creds.uid = cred ? cred->euid : INVALID_UID; -	scm->creds.gid = cred ? cred->egid : INVALID_GID; +	scm->creds.uid = cred ? cred->uid : INVALID_UID; +	scm->creds.gid = cred ? cred->gid : INVALID_GID;  }  static __inline__ void scm_destroy_cred(struct scm_cookie *scm) diff --git a/include/net/tcp.h b/include/net/tcp.h index 23f2e98d4b6..cf0694d4ad6 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -1045,6 +1045,10 @@ static inline bool tcp_prequeue(struct sock *sk, struct sk_buff *skb)  	if (sysctl_tcp_low_latency || !tp->ucopy.task)  		return false; +	if (skb->len <= tcp_hdrlen(skb) && +	    skb_queue_len(&tp->ucopy.prequeue) == 0) +		return false; +  	__skb_queue_tail(&tp->ucopy.prequeue, skb);  	tp->ucopy.memory += skb->truesize;  	if (tp->ucopy.memory > sk->sk_rcvbuf) { diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index 3bbbd78e143..2d56e428506 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h @@ -65,6 +65,18 @@ struct pcmcia_driver {  int pcmcia_register_driver(struct pcmcia_driver *driver);  void pcmcia_unregister_driver(struct pcmcia_driver *driver); +/** + * module_pcmcia_driver() - Helper macro for registering a pcmcia driver + * @__pcmcia_driver: pcmcia_driver struct + * + * Helper macro for pcmcia drivers which do not do anything special in module + * init/exit. This eliminates a lot of boilerplate. Each module may only use + * this macro once, and calling it replaces module_init() and module_exit(). + */ +#define module_pcmcia_driver(__pcmcia_driver) \ +	module_driver(__pcmcia_driver, pcmcia_register_driver, \ +			pcmcia_unregister_driver) +  /* for struct resource * array embedded in struct pcmcia_device */  enum {  	PCMCIA_IOPORT_0, diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index 399162b50a8..e1379b4e8fa 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h @@ -1074,7 +1074,8 @@ void fc_rport_terminate_io(struct fc_rport *);  /*   * DISCOVERY LAYER   *****************************/ -int fc_disc_init(struct fc_lport *); +void fc_disc_init(struct fc_lport *); +void fc_disc_config(struct fc_lport *, void *);  static inline struct fc_lport *fc_disc_lport(struct fc_disc *disc)  { diff --git a/include/sound/max98090.h b/include/sound/max98090.h index 95efb13f847..95efb13f847 100755..100644 --- a/include/sound/max98090.h +++ b/include/sound/max98090.h diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index e1ef63d4a5c..44a30b10868 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h @@ -488,6 +488,7 @@ struct snd_soc_dapm_path {  	/* status */  	u32 connect:1;	/* source and sink widgets are connected */  	u32 walked:1;	/* path has been walked */ +	u32 walking:1;  /* path is in the process of being walked */  	u32 weak:1;	/* path ignored for power management */  	int (*connected)(struct snd_soc_dapm_widget *source, diff --git a/include/trace/events/block.h b/include/trace/events/block.h index 9961726523d..9c1467357b0 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h @@ -257,6 +257,7 @@ TRACE_EVENT(block_bio_bounce,  /**   * block_bio_complete - completed all work on the block operation + * @q: queue holding the block operation   * @bio: block operation completed   * @error: io error value   * @@ -265,9 +266,9 @@ TRACE_EVENT(block_bio_bounce,   */  TRACE_EVENT(block_bio_complete, -	TP_PROTO(struct bio *bio, int error), +	TP_PROTO(struct request_queue *q, struct bio *bio, int error), -	TP_ARGS(bio, error), +	TP_ARGS(q, bio, error),  	TP_STRUCT__entry(  		__field( dev_t,		dev		) @@ -278,8 +279,7 @@ TRACE_EVENT(block_bio_complete,  	),  	TP_fast_assign( -		__entry->dev		= bio->bi_bdev ? -					  bio->bi_bdev->bd_dev : 0; +		__entry->dev		= bio->bi_bdev->bd_dev;  		__entry->sector		= bio->bi_sector;  		__entry->nr_sector	= bio->bi_size >> 9;  		__entry->error		= error; diff --git a/include/trace/events/filemap.h b/include/trace/events/filemap.h new file mode 100644 index 00000000000..0421f49a20f --- /dev/null +++ b/include/trace/events/filemap.h @@ -0,0 +1,58 @@ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM filemap + +#if !defined(_TRACE_FILEMAP_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_FILEMAP_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> + +DECLARE_EVENT_CLASS(mm_filemap_op_page_cache, + +	TP_PROTO(struct page *page), + +	TP_ARGS(page), + +	TP_STRUCT__entry( +		__field(struct page *, page) +		__field(unsigned long, i_ino) +		__field(unsigned long, index) +		__field(dev_t, s_dev) +	), + +	TP_fast_assign( +		__entry->page = page; +		__entry->i_ino = page->mapping->host->i_ino; +		__entry->index = page->index; +		if (page->mapping->host->i_sb) +			__entry->s_dev = page->mapping->host->i_sb->s_dev; +		else +			__entry->s_dev = page->mapping->host->i_rdev; +	), + +	TP_printk("dev %d:%d ino %lx page=%p pfn=%lu ofs=%lu", +		MAJOR(__entry->s_dev), MINOR(__entry->s_dev), +		__entry->i_ino, +		__entry->page, +		page_to_pfn(__entry->page), +		__entry->index << PAGE_SHIFT) +); + +DEFINE_EVENT(mm_filemap_op_page_cache, mm_filemap_delete_from_page_cache, +	TP_PROTO(struct page *page), +	TP_ARGS(page) +	); + +DEFINE_EVENT(mm_filemap_op_page_cache, mm_filemap_add_to_page_cache, +	TP_PROTO(struct page *page), +	TP_ARGS(page) +	); + +#endif /* _TRACE_FILEMAP_H */ + +/* This part must be outside protection */ +#include <trace/define_trace.h> diff --git a/include/trace/events/printk.h b/include/trace/events/printk.h index 94ec79cc011..c008bc99f9f 100644 --- a/include/trace/events/printk.h +++ b/include/trace/events/printk.h @@ -6,31 +6,18 @@  #include <linux/tracepoint.h> -TRACE_EVENT_CONDITION(console, -	TP_PROTO(const char *log_buf, unsigned start, unsigned end, -		 unsigned log_buf_len), +TRACE_EVENT(console, +	TP_PROTO(const char *text, size_t len), -	TP_ARGS(log_buf, start, end, log_buf_len), - -	TP_CONDITION(start != end), +	TP_ARGS(text, len),  	TP_STRUCT__entry( -		__dynamic_array(char, msg, end - start + 1) +		__dynamic_array(char, msg, len + 1)  	),  	TP_fast_assign( -		if ((start & (log_buf_len - 1)) > (end & (log_buf_len - 1))) { -			memcpy(__get_dynamic_array(msg), -			       log_buf + (start & (log_buf_len - 1)), -			       log_buf_len - (start & (log_buf_len - 1))); -			memcpy((char *)__get_dynamic_array(msg) + -			       log_buf_len - (start & (log_buf_len - 1)), -			       log_buf, end & (log_buf_len - 1)); -		} else -			memcpy(__get_dynamic_array(msg), -			       log_buf + (start & (log_buf_len - 1)), -			       end - start); -		((char *)__get_dynamic_array(msg))[end - start] = 0; +		memcpy(__get_dynamic_array(msg), text, len); +		((char *)__get_dynamic_array(msg))[len] = 0;  	),  	TP_printk("%s", __get_str(msg)) diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h index 1918e832da4..59ebcc89f14 100644 --- a/include/trace/events/rcu.h +++ b/include/trace/events/rcu.h @@ -72,6 +72,58 @@ TRACE_EVENT(rcu_grace_period,  );  /* + * Tracepoint for future grace-period events, including those for no-callbacks + * CPUs.  The caller should pull the data from the rcu_node structure, + * other than rcuname, which comes from the rcu_state structure, and event, + * which is one of the following: + * + * "Startleaf": Request a nocb grace period based on leaf-node data. + * "Startedleaf": Leaf-node start proved sufficient. + * "Startedleafroot": Leaf-node start proved sufficient after checking root. + * "Startedroot": Requested a nocb grace period based on root-node data. + * "StartWait": Start waiting for the requested grace period. + * "ResumeWait": Resume waiting after signal. + * "EndWait": Complete wait. + * "Cleanup": Clean up rcu_node structure after previous GP. + * "CleanupMore": Clean up, and another no-CB GP is needed. + */ +TRACE_EVENT(rcu_future_grace_period, + +	TP_PROTO(char *rcuname, unsigned long gpnum, unsigned long completed, +		 unsigned long c, u8 level, int grplo, int grphi, +		 char *gpevent), + +	TP_ARGS(rcuname, gpnum, completed, c, level, grplo, grphi, gpevent), + +	TP_STRUCT__entry( +		__field(char *, rcuname) +		__field(unsigned long, gpnum) +		__field(unsigned long, completed) +		__field(unsigned long, c) +		__field(u8, level) +		__field(int, grplo) +		__field(int, grphi) +		__field(char *, gpevent) +	), + +	TP_fast_assign( +		__entry->rcuname = rcuname; +		__entry->gpnum = gpnum; +		__entry->completed = completed; +		__entry->c = c; +		__entry->level = level; +		__entry->grplo = grplo; +		__entry->grphi = grphi; +		__entry->gpevent = gpevent; +	), + +	TP_printk("%s %lu %lu %lu %u %d %d %s", +		  __entry->rcuname, __entry->gpnum, __entry->completed, +		  __entry->c, __entry->level, __entry->grplo, __entry->grphi, +		  __entry->gpevent) +); + +/*   * Tracepoint for grace-period-initialization events.  These are   * distinguished by the type of RCU, the new grace-period number, the   * rcu_node structure level, the starting and ending CPU covered by the @@ -601,6 +653,9 @@ TRACE_EVENT(rcu_barrier,  #define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0)  #define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, \  				    qsmask) do { } while (0) +#define trace_rcu_future_grace_period(rcuname, gpnum, completed, c, \ +				      level, grplo, grphi, event) \ +				      do { } while (0)  #define trace_rcu_preempt_task(rcuname, pid, gpnum) do { } while (0)  #define trace_rcu_unlock_preempted_task(rcuname, gpnum, pid) do { } while (0)  #define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, \ diff --git a/include/trace/events/regmap.h b/include/trace/events/regmap.h index 41a7dbd570e..a43a2f67bd8 100644 --- a/include/trace/events/regmap.h +++ b/include/trace/events/regmap.h @@ -175,6 +175,54 @@ DEFINE_EVENT(regmap_bool, regmap_cache_bypass,  ); +DECLARE_EVENT_CLASS(regmap_async, + +	TP_PROTO(struct device *dev), + +	TP_ARGS(dev), + +	TP_STRUCT__entry( +		__string(	name,		dev_name(dev)	) +	), + +	TP_fast_assign( +		__assign_str(name, dev_name(dev)); +	), + +	TP_printk("%s", __get_str(name)) +); + +DEFINE_EVENT(regmap_block, regmap_async_write_start, + +	TP_PROTO(struct device *dev, unsigned int reg, int count), + +	TP_ARGS(dev, reg, count) +); + +DEFINE_EVENT(regmap_async, regmap_async_io_complete, + +	TP_PROTO(struct device *dev), + +	TP_ARGS(dev) + +); + +DEFINE_EVENT(regmap_async, regmap_async_complete_start, + +	TP_PROTO(struct device *dev), + +	TP_ARGS(dev) + +); + +DEFINE_EVENT(regmap_async, regmap_async_complete_done, + +	TP_PROTO(struct device *dev), + +	TP_ARGS(dev) + +); +  #endif /* _TRACE_REGMAP_H */  /* This part must be outside protection */ diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index 5a8671e8a67..e5586caff67 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h @@ -147,7 +147,7 @@ TRACE_EVENT(sched_switch,  		  __print_flags(__entry->prev_state & (TASK_STATE_MAX-1), "|",  				{ 1, "S"} , { 2, "D" }, { 4, "T" }, { 8, "t" },  				{ 16, "Z" }, { 32, "X" }, { 64, "x" }, -				{ 128, "W" }) : "R", +				{ 128, "K" }, { 256, "W" }, { 512, "P" }) : "R",  		__entry->prev_state & TASK_STATE_MAX ? "+" : "",  		__entry->next_comm, __entry->next_pid, __entry->next_prio)  ); diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 40dc5e8fe34..19edd7facaa 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h @@ -227,29 +227,18 @@ static notrace enum print_line_t					\  ftrace_raw_output_##call(struct trace_iterator *iter, int flags,	\  			 struct trace_event *trace_event)		\  {									\ -	struct ftrace_event_call *event;				\  	struct trace_seq *s = &iter->seq;				\ +	struct trace_seq __maybe_unused *p = &iter->tmp_seq;		\  	struct ftrace_raw_##call *field;				\ -	struct trace_entry *entry;					\ -	struct trace_seq *p = &iter->tmp_seq;				\  	int ret;							\  									\ -	event = container_of(trace_event, struct ftrace_event_call,	\ -			     event);					\ -									\ -	entry = iter->ent;						\ -									\ -	if (entry->type != event->event.type) {				\ -		WARN_ON_ONCE(1);					\ -		return TRACE_TYPE_UNHANDLED;				\ -	}								\ -									\ -	field = (typeof(field))entry;					\ +	field = (typeof(field))iter->ent;				\  									\ -	trace_seq_init(p);						\ -	ret = trace_seq_printf(s, "%s: ", event->name);			\ +	ret = ftrace_raw_output_prep(iter, trace_event);		\  	if (ret)							\ -		ret = trace_seq_printf(s, print);			\ +		return ret;						\ +									\ +	ret = trace_seq_printf(s, print);				\  	if (!ret)							\  		return TRACE_TYPE_PARTIAL_LINE;				\  									\ @@ -335,7 +324,7 @@ static struct trace_event_functions ftrace_event_type_funcs_##call = {	\  #undef DECLARE_EVENT_CLASS  #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, func, print)	\ -static int notrace							\ +static int notrace __init						\  ftrace_define_fields_##call(struct ftrace_event_call *event_call)	\  {									\  	struct ftrace_raw_##call field;					\ @@ -414,7 +403,8 @@ static inline notrace int ftrace_get_offsets_##call(			\   *   * static void ftrace_raw_event_<call>(void *__data, proto)   * { - *	struct ftrace_event_call *event_call = __data; + *	struct ftrace_event_file *ftrace_file = __data; + *	struct ftrace_event_call *event_call = ftrace_file->event_call;   *	struct ftrace_data_offsets_<call> __maybe_unused __data_offsets;   *	struct ring_buffer_event *event;   *	struct ftrace_raw_<call> *entry; <-- defined in stage 1 @@ -423,12 +413,16 @@ static inline notrace int ftrace_get_offsets_##call(			\   *	int __data_size;   *	int pc;   * + *	if (test_bit(FTRACE_EVENT_FL_SOFT_DISABLED_BIT, + *		     &ftrace_file->flags)) + *		return; + *   *	local_save_flags(irq_flags);   *	pc = preempt_count();   *   *	__data_size = ftrace_get_offsets_<call>(&__data_offsets, args);   * - *	event = trace_current_buffer_lock_reserve(&buffer, + *	event = trace_event_buffer_lock_reserve(&buffer, ftrace_file,   *				  event_<call>->event.type,   *				  sizeof(*entry) + __data_size,   *				  irq_flags, pc); @@ -440,7 +434,7 @@ static inline notrace int ftrace_get_offsets_##call(			\   *			   __array macros.   *   *	if (!filter_current_check_discard(buffer, event_call, entry, event)) - *		trace_current_buffer_unlock_commit(buffer, + *		trace_nowake_buffer_unlock_commit(buffer,   *						   event, irq_flags, pc);   * }   * @@ -518,7 +512,8 @@ static inline notrace int ftrace_get_offsets_##call(			\  static notrace void							\  ftrace_raw_event_##call(void *__data, proto)				\  {									\ -	struct ftrace_event_call *event_call = __data;			\ +	struct ftrace_event_file *ftrace_file = __data;			\ +	struct ftrace_event_call *event_call = ftrace_file->event_call;	\  	struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\  	struct ring_buffer_event *event;				\  	struct ftrace_raw_##call *entry;				\ @@ -527,12 +522,16 @@ ftrace_raw_event_##call(void *__data, proto)				\  	int __data_size;						\  	int pc;								\  									\ +	if (test_bit(FTRACE_EVENT_FL_SOFT_DISABLED_BIT,			\ +		     &ftrace_file->flags))				\ +		return;							\ +									\  	local_save_flags(irq_flags);					\  	pc = preempt_count();						\  									\  	__data_size = ftrace_get_offsets_##call(&__data_offsets, args); \  									\ -	event = trace_current_buffer_lock_reserve(&buffer,		\ +	event = trace_event_buffer_lock_reserve(&buffer, ftrace_file,	\  				 event_call->event.type,		\  				 sizeof(*entry) + __data_size,		\  				 irq_flags, pc);			\ @@ -581,7 +580,7 @@ static inline void ftrace_test_probe_##call(void)			\  #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print)	\  _TRACE_PERF_PROTO(call, PARAMS(proto));					\  static const char print_fmt_##call[] = print;				\ -static struct ftrace_event_class __used event_class_##call = {		\ +static struct ftrace_event_class __used __refdata event_class_##call = { \  	.system			= __stringify(TRACE_SYSTEM),		\  	.define_fields		= ftrace_define_fields_##call,		\  	.fields			= LIST_HEAD_INIT(event_class_##call.fields),\ @@ -705,5 +704,3 @@ static inline void perf_test_probe_##call(void)				\  #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)  #endif /* CONFIG_PERF_EVENTS */ -#undef _TRACE_PROFILE_INIT - diff --git a/include/uapi/linux/acct.h b/include/uapi/linux/acct.h index 11b6ca3e087..df2f9a0bba6 100644 --- a/include/uapi/linux/acct.h +++ b/include/uapi/linux/acct.h @@ -107,10 +107,12 @@ struct acct_v3  #define ACORE		0x08	/* ... dumped core */  #define AXSIG		0x10	/* ... was killed by a signal */ -#ifdef __BIG_ENDIAN +#if defined(__BYTE_ORDER) ? __BYTE_ORDER == __BIG_ENDIAN : defined(__BIG_ENDIAN)  #define ACCT_BYTEORDER	0x80	/* accounting file is big endian */ -#else +#elif defined(__BYTE_ORDER) ? __BYTE_ORDER == __LITTLE_ENDIAN : defined(__LITTLE_ENDIAN)  #define ACCT_BYTEORDER	0x00	/* accounting file is little endian */ +#else +#error unspecified endianness  #endif  #ifndef __KERNEL__ diff --git a/include/uapi/linux/aio_abi.h b/include/uapi/linux/aio_abi.h index 86fa7a71336..bb2554f7fbd 100644 --- a/include/uapi/linux/aio_abi.h +++ b/include/uapi/linux/aio_abi.h @@ -62,9 +62,9 @@ struct io_event {  	__s64		res2;		/* secondary result */  }; -#if defined(__LITTLE_ENDIAN) +#if defined(__BYTE_ORDER) ? __BYTE_ORDER == __LITTLE_ENDIAN : defined(__LITTLE_ENDIAN)  #define PADDED(x,y)	x, y -#elif defined(__BIG_ENDIAN) +#elif defined(__BYTE_ORDER) ? __BYTE_ORDER == __BIG_ENDIAN : defined(__BIG_ENDIAN)  #define PADDED(x,y)	y, x  #else  #error edit for your odd byteorder. diff --git a/include/uapi/linux/connector.h b/include/uapi/linux/connector.h index 8761a0349c7..4cb283505e4 100644 --- a/include/uapi/linux/connector.h +++ b/include/uapi/linux/connector.h @@ -44,8 +44,11 @@  #define CN_VAL_DRBD			0x1  #define CN_KVP_IDX			0x9	/* HyperV KVP */  #define CN_KVP_VAL			0x1	/* queries from the kernel */ +#define CN_VSS_IDX			0xA     /* HyperV VSS */ +#define CN_VSS_VAL			0x1     /* queries from the kernel */ -#define CN_NETLINK_USERS		10	/* Highest index + 1 */ + +#define CN_NETLINK_USERS		11	/* Highest index + 1 */  /*   * Maximum connector's message size. diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h index c7fc1e6517c..a4ed56cf0ea 100644 --- a/include/uapi/linux/fs.h +++ b/include/uapi/linux/fs.h @@ -88,7 +88,6 @@ struct inodes_stat_t {  #define MS_STRICTATIME	(1<<24) /* Always perform atime updates */  /* These sb flags are internal to the kernel */ -#define MS_SNAP_STABLE	(1<<27) /* Snapshot pages during writeback, if needed */  #define MS_NOSEC	(1<<28)  #define MS_BORN		(1<<29)  #define MS_ACTIVE	(1<<30) diff --git a/include/uapi/linux/fuse.h b/include/uapi/linux/fuse.h index 4c43b444879..706d035fa74 100644 --- a/include/uapi/linux/fuse.h +++ b/include/uapi/linux/fuse.h @@ -95,15 +95,10 @@  #ifndef _LINUX_FUSE_H  #define _LINUX_FUSE_H -#ifdef __linux__ +#ifdef __KERNEL__  #include <linux/types.h>  #else  #include <stdint.h> -#define __u64 uint64_t -#define __s64 int64_t -#define __u32 uint32_t -#define __s32 int32_t -#define __u16 uint16_t  #endif  /* @@ -139,42 +134,42 @@     userspace works under 64bit kernels */  struct fuse_attr { -	__u64	ino; -	__u64	size; -	__u64	blocks; -	__u64	atime; -	__u64	mtime; -	__u64	ctime; -	__u32	atimensec; -	__u32	mtimensec; -	__u32	ctimensec; -	__u32	mode; -	__u32	nlink; -	__u32	uid; -	__u32	gid; -	__u32	rdev; -	__u32	blksize; -	__u32	padding; +	uint64_t	ino; +	uint64_t	size; +	uint64_t	blocks; +	uint64_t	atime; +	uint64_t	mtime; +	uint64_t	ctime; +	uint32_t	atimensec; +	uint32_t	mtimensec; +	uint32_t	ctimensec; +	uint32_t	mode; +	uint32_t	nlink; +	uint32_t	uid; +	uint32_t	gid; +	uint32_t	rdev; +	uint32_t	blksize; +	uint32_t	padding;  };  struct fuse_kstatfs { -	__u64	blocks; -	__u64	bfree; -	__u64	bavail; -	__u64	files; -	__u64	ffree; -	__u32	bsize; -	__u32	namelen; -	__u32	frsize; -	__u32	padding; -	__u32	spare[6]; +	uint64_t	blocks; +	uint64_t	bfree; +	uint64_t	bavail; +	uint64_t	files; +	uint64_t	ffree; +	uint32_t	bsize; +	uint32_t	namelen; +	uint32_t	frsize; +	uint32_t	padding; +	uint32_t	spare[6];  };  struct fuse_file_lock { -	__u64	start; -	__u64	end; -	__u32	type; -	__u32	pid; /* tgid */ +	uint64_t	start; +	uint64_t	end; +	uint32_t	type; +	uint32_t	pid; /* tgid */  };  /** @@ -364,143 +359,143 @@ enum fuse_notify_code {  #define FUSE_COMPAT_ENTRY_OUT_SIZE 120  struct fuse_entry_out { -	__u64	nodeid;		/* Inode ID */ -	__u64	generation;	/* Inode generation: nodeid:gen must -				   be unique for the fs's lifetime */ -	__u64	entry_valid;	/* Cache timeout for the name */ -	__u64	attr_valid;	/* Cache timeout for the attributes */ -	__u32	entry_valid_nsec; -	__u32	attr_valid_nsec; +	uint64_t	nodeid;		/* Inode ID */ +	uint64_t	generation;	/* Inode generation: nodeid:gen must +					   be unique for the fs's lifetime */ +	uint64_t	entry_valid;	/* Cache timeout for the name */ +	uint64_t	attr_valid;	/* Cache timeout for the attributes */ +	uint32_t	entry_valid_nsec; +	uint32_t	attr_valid_nsec;  	struct fuse_attr attr;  };  struct fuse_forget_in { -	__u64	nlookup; +	uint64_t	nlookup;  };  struct fuse_forget_one { -	__u64	nodeid; -	__u64	nlookup; +	uint64_t	nodeid; +	uint64_t	nlookup;  };  struct fuse_batch_forget_in { -	__u32	count; -	__u32	dummy; +	uint32_t	count; +	uint32_t	dummy;  };  struct fuse_getattr_in { -	__u32	getattr_flags; -	__u32	dummy; -	__u64	fh; +	uint32_t	getattr_flags; +	uint32_t	dummy; +	uint64_t	fh;  };  #define FUSE_COMPAT_ATTR_OUT_SIZE 96  struct fuse_attr_out { -	__u64	attr_valid;	/* Cache timeout for the attributes */ -	__u32	attr_valid_nsec; -	__u32	dummy; +	uint64_t	attr_valid;	/* Cache timeout for the attributes */ +	uint32_t	attr_valid_nsec; +	uint32_t	dummy;  	struct fuse_attr attr;  };  #define FUSE_COMPAT_MKNOD_IN_SIZE 8  struct fuse_mknod_in { -	__u32	mode; -	__u32	rdev; -	__u32	umask; -	__u32	padding; +	uint32_t	mode; +	uint32_t	rdev; +	uint32_t	umask; +	uint32_t	padding;  };  struct fuse_mkdir_in { -	__u32	mode; -	__u32	umask; +	uint32_t	mode; +	uint32_t	umask;  };  struct fuse_rename_in { -	__u64	newdir; +	uint64_t	newdir;  };  struct fuse_link_in { -	__u64	oldnodeid; +	uint64_t	oldnodeid;  };  struct fuse_setattr_in { -	__u32	valid; -	__u32	padding; -	__u64	fh; -	__u64	size; -	__u64	lock_owner; -	__u64	atime; -	__u64	mtime; -	__u64	unused2; -	__u32	atimensec; -	__u32	mtimensec; -	__u32	unused3; -	__u32	mode; -	__u32	unused4; -	__u32	uid; -	__u32	gid; -	__u32	unused5; +	uint32_t	valid; +	uint32_t	padding; +	uint64_t	fh; +	uint64_t	size; +	uint64_t	lock_owner; +	uint64_t	atime; +	uint64_t	mtime; +	uint64_t	unused2; +	uint32_t	atimensec; +	uint32_t	mtimensec; +	uint32_t	unused3; +	uint32_t	mode; +	uint32_t	unused4; +	uint32_t	uid; +	uint32_t	gid; +	uint32_t	unused5;  };  struct fuse_open_in { -	__u32	flags; -	__u32	unused; +	uint32_t	flags; +	uint32_t	unused;  };  struct fuse_create_in { -	__u32	flags; -	__u32	mode; -	__u32	umask; -	__u32	padding; +	uint32_t	flags; +	uint32_t	mode; +	uint32_t	umask; +	uint32_t	padding;  };  struct fuse_open_out { -	__u64	fh; -	__u32	open_flags; -	__u32	padding; +	uint64_t	fh; +	uint32_t	open_flags; +	uint32_t	padding;  };  struct fuse_release_in { -	__u64	fh; -	__u32	flags; -	__u32	release_flags; -	__u64	lock_owner; +	uint64_t	fh; +	uint32_t	flags; +	uint32_t	release_flags; +	uint64_t	lock_owner;  };  struct fuse_flush_in { -	__u64	fh; -	__u32	unused; -	__u32	padding; -	__u64	lock_owner; +	uint64_t	fh; +	uint32_t	unused; +	uint32_t	padding; +	uint64_t	lock_owner;  };  struct fuse_read_in { -	__u64	fh; -	__u64	offset; -	__u32	size; -	__u32	read_flags; -	__u64	lock_owner; -	__u32	flags; -	__u32	padding; +	uint64_t	fh; +	uint64_t	offset; +	uint32_t	size; +	uint32_t	read_flags; +	uint64_t	lock_owner; +	uint32_t	flags; +	uint32_t	padding;  };  #define FUSE_COMPAT_WRITE_IN_SIZE 24  struct fuse_write_in { -	__u64	fh; -	__u64	offset; -	__u32	size; -	__u32	write_flags; -	__u64	lock_owner; -	__u32	flags; -	__u32	padding; +	uint64_t	fh; +	uint64_t	offset; +	uint32_t	size; +	uint32_t	write_flags; +	uint64_t	lock_owner; +	uint32_t	flags; +	uint32_t	padding;  };  struct fuse_write_out { -	__u32	size; -	__u32	padding; +	uint32_t	size; +	uint32_t	padding;  };  #define FUSE_COMPAT_STATFS_SIZE 48 @@ -510,32 +505,32 @@ struct fuse_statfs_out {  };  struct fuse_fsync_in { -	__u64	fh; -	__u32	fsync_flags; -	__u32	padding; +	uint64_t	fh; +	uint32_t	fsync_flags; +	uint32_t	padding;  };  struct fuse_setxattr_in { -	__u32	size; -	__u32	flags; +	uint32_t	size; +	uint32_t	flags;  };  struct fuse_getxattr_in { -	__u32	size; -	__u32	padding; +	uint32_t	size; +	uint32_t	padding;  };  struct fuse_getxattr_out { -	__u32	size; -	__u32	padding; +	uint32_t	size; +	uint32_t	padding;  };  struct fuse_lk_in { -	__u64	fh; -	__u64	owner; +	uint64_t	fh; +	uint64_t	owner;  	struct fuse_file_lock lk; -	__u32	lk_flags; -	__u32	padding; +	uint32_t	lk_flags; +	uint32_t	padding;  };  struct fuse_lk_out { @@ -543,134 +538,135 @@ struct fuse_lk_out {  };  struct fuse_access_in { -	__u32	mask; -	__u32	padding; +	uint32_t	mask; +	uint32_t	padding;  };  struct fuse_init_in { -	__u32	major; -	__u32	minor; -	__u32	max_readahead; -	__u32	flags; +	uint32_t	major; +	uint32_t	minor; +	uint32_t	max_readahead; +	uint32_t	flags;  };  struct fuse_init_out { -	__u32	major; -	__u32	minor; -	__u32	max_readahead; -	__u32	flags; -	__u16   max_background; -	__u16   congestion_threshold; -	__u32	max_write; +	uint32_t	major; +	uint32_t	minor; +	uint32_t	max_readahead; +	uint32_t	flags; +	uint16_t	max_background; +	uint16_t	congestion_threshold; +	uint32_t	max_write;  };  #define CUSE_INIT_INFO_MAX 4096  struct cuse_init_in { -	__u32	major; -	__u32	minor; -	__u32	unused; -	__u32	flags; +	uint32_t	major; +	uint32_t	minor; +	uint32_t	unused; +	uint32_t	flags;  };  struct cuse_init_out { -	__u32	major; -	__u32	minor; -	__u32	unused; -	__u32	flags; -	__u32	max_read; -	__u32	max_write; -	__u32	dev_major;		/* chardev major */ -	__u32	dev_minor;		/* chardev minor */ -	__u32	spare[10]; +	uint32_t	major; +	uint32_t	minor; +	uint32_t	unused; +	uint32_t	flags; +	uint32_t	max_read; +	uint32_t	max_write; +	uint32_t	dev_major;		/* chardev major */ +	uint32_t	dev_minor;		/* chardev minor */ +	uint32_t	spare[10];  };  struct fuse_interrupt_in { -	__u64	unique; +	uint64_t	unique;  };  struct fuse_bmap_in { -	__u64	block; -	__u32	blocksize; -	__u32	padding; +	uint64_t	block; +	uint32_t	blocksize; +	uint32_t	padding;  };  struct fuse_bmap_out { -	__u64	block; +	uint64_t	block;  };  struct fuse_ioctl_in { -	__u64	fh; -	__u32	flags; -	__u32	cmd; -	__u64	arg; -	__u32	in_size; -	__u32	out_size; +	uint64_t	fh; +	uint32_t	flags; +	uint32_t	cmd; +	uint64_t	arg; +	uint32_t	in_size; +	uint32_t	out_size;  };  struct fuse_ioctl_iovec { -	__u64	base; -	__u64	len; +	uint64_t	base; +	uint64_t	len;  };  struct fuse_ioctl_out { -	__s32	result; -	__u32	flags; -	__u32	in_iovs; -	__u32	out_iovs; +	int32_t		result; +	uint32_t	flags; +	uint32_t	in_iovs; +	uint32_t	out_iovs;  };  struct fuse_poll_in { -	__u64	fh; -	__u64	kh; -	__u32	flags; -	__u32   events; +	uint64_t	fh; +	uint64_t	kh; +	uint32_t	flags; +	uint32_t	events;  };  struct fuse_poll_out { -	__u32	revents; -	__u32	padding; +	uint32_t	revents; +	uint32_t	padding;  };  struct fuse_notify_poll_wakeup_out { -	__u64	kh; +	uint64_t	kh;  };  struct fuse_fallocate_in { -	__u64	fh; -	__u64	offset; -	__u64	length; -	__u32	mode; -	__u32	padding; +	uint64_t	fh; +	uint64_t	offset; +	uint64_t	length; +	uint32_t	mode; +	uint32_t	padding;  };  struct fuse_in_header { -	__u32	len; -	__u32	opcode; -	__u64	unique; -	__u64	nodeid; -	__u32	uid; -	__u32	gid; -	__u32	pid; -	__u32	padding; +	uint32_t	len; +	uint32_t	opcode; +	uint64_t	unique; +	uint64_t	nodeid; +	uint32_t	uid; +	uint32_t	gid; +	uint32_t	pid; +	uint32_t	padding;  };  struct fuse_out_header { -	__u32	len; -	__s32	error; -	__u64	unique; +	uint32_t	len; +	int32_t		error; +	uint64_t	unique;  };  struct fuse_dirent { -	__u64	ino; -	__u64	off; -	__u32	namelen; -	__u32	type; +	uint64_t	ino; +	uint64_t	off; +	uint32_t	namelen; +	uint32_t	type;  	char name[];  };  #define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name) -#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1)) +#define FUSE_DIRENT_ALIGN(x) \ +	(((x) + sizeof(uint64_t) - 1) & ~(sizeof(uint64_t) - 1))  #define FUSE_DIRENT_SIZE(d) \  	FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) @@ -685,47 +681,47 @@ struct fuse_direntplus {  	FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET_DIRENTPLUS + (d)->dirent.namelen)  struct fuse_notify_inval_inode_out { -	__u64	ino; -	__s64	off; -	__s64	len; +	uint64_t	ino; +	int64_t		off; +	int64_t		len;  };  struct fuse_notify_inval_entry_out { -	__u64	parent; -	__u32	namelen; -	__u32	padding; +	uint64_t	parent; +	uint32_t	namelen; +	uint32_t	padding;  };  struct fuse_notify_delete_out { -	__u64	parent; -	__u64	child; -	__u32	namelen; -	__u32	padding; +	uint64_t	parent; +	uint64_t	child; +	uint32_t	namelen; +	uint32_t	padding;  };  struct fuse_notify_store_out { -	__u64	nodeid; -	__u64	offset; -	__u32	size; -	__u32	padding; +	uint64_t	nodeid; +	uint64_t	offset; +	uint32_t	size; +	uint32_t	padding;  };  struct fuse_notify_retrieve_out { -	__u64	notify_unique; -	__u64	nodeid; -	__u64	offset; -	__u32	size; -	__u32	padding; +	uint64_t	notify_unique; +	uint64_t	nodeid; +	uint64_t	offset; +	uint32_t	size; +	uint32_t	padding;  };  /* Matches the size of fuse_write_in */  struct fuse_notify_retrieve_in { -	__u64	dummy1; -	__u64	offset; -	__u32	size; -	__u32	dummy2; -	__u64	dummy3; -	__u64	dummy4; +	uint64_t	dummy1; +	uint64_t	offset; +	uint32_t	size; +	uint32_t	dummy2; +	uint64_t	dummy3; +	uint64_t	dummy4;  };  #endif /* _LINUX_FUSE_H */ diff --git a/include/uapi/linux/packet_diag.h b/include/uapi/linux/packet_diag.h index 93f5fa94a43..afafd703ad9 100644 --- a/include/uapi/linux/packet_diag.h +++ b/include/uapi/linux/packet_diag.h @@ -33,9 +33,11 @@ enum {  	PACKET_DIAG_TX_RING,  	PACKET_DIAG_FANOUT, -	PACKET_DIAG_MAX, +	__PACKET_DIAG_MAX,  }; +#define PACKET_DIAG_MAX (__PACKET_DIAG_MAX - 1) +  struct packet_diag_info {  	__u32	pdi_index;  	__u32	pdi_version; diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h index ebfadc56d1b..864e324da80 100644 --- a/include/uapi/linux/pci_regs.h +++ b/include/uapi/linux/pci_regs.h @@ -292,12 +292,12 @@  /* Message Signalled Interrupts registers */ -#define PCI_MSI_FLAGS		2	/* Various flags */ -#define  PCI_MSI_FLAGS_64BIT	0x80	/* 64-bit addresses allowed */ -#define  PCI_MSI_FLAGS_QSIZE	0x70	/* Message queue size configured */ -#define  PCI_MSI_FLAGS_QMASK	0x0e	/* Maximum queue size available */ -#define  PCI_MSI_FLAGS_ENABLE	0x01	/* MSI feature enabled */ -#define  PCI_MSI_FLAGS_MASKBIT	0x100	/* 64-bit mask bits allowed */ +#define PCI_MSI_FLAGS		2	/* Message Control */ +#define  PCI_MSI_FLAGS_ENABLE	0x0001	/* MSI feature enabled */ +#define  PCI_MSI_FLAGS_QMASK	0x000e	/* Maximum queue size available */ +#define  PCI_MSI_FLAGS_QSIZE	0x0070	/* Message queue size configured */ +#define  PCI_MSI_FLAGS_64BIT	0x0080	/* 64-bit addresses allowed */ +#define  PCI_MSI_FLAGS_MASKBIT	0x0100	/* Per-vector masking capable */  #define PCI_MSI_RFU		3	/* Rest of capability flags */  #define PCI_MSI_ADDRESS_LO	4	/* Lower 32 bits */  #define PCI_MSI_ADDRESS_HI	8	/* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */ @@ -309,13 +309,17 @@  #define PCI_MSI_PENDING_64	20	/* Pending intrs for 64-bit devices */  /* MSI-X registers */ -#define PCI_MSIX_FLAGS		2 -#define  PCI_MSIX_FLAGS_QSIZE	0x7FF -#define  PCI_MSIX_FLAGS_ENABLE	(1 << 15) -#define  PCI_MSIX_FLAGS_MASKALL	(1 << 14) -#define PCI_MSIX_TABLE		4 -#define PCI_MSIX_PBA		8 -#define  PCI_MSIX_FLAGS_BIRMASK	(7 << 0) +#define PCI_MSIX_FLAGS		2	/* Message Control */ +#define  PCI_MSIX_FLAGS_QSIZE	0x07FF	/* Table size */ +#define  PCI_MSIX_FLAGS_MASKALL	0x4000	/* Mask all vectors for this function */ +#define  PCI_MSIX_FLAGS_ENABLE	0x8000	/* MSI-X enable */ +#define PCI_MSIX_TABLE		4	/* Table offset */ +#define  PCI_MSIX_TABLE_BIR	0x00000007 /* BAR index */ +#define  PCI_MSIX_TABLE_OFFSET	0xfffffff8 /* Offset into specified BAR */ +#define PCI_MSIX_PBA		8	/* Pending Bit Array offset */ +#define  PCI_MSIX_PBA_BIR	0x00000007 /* BAR index */ +#define  PCI_MSIX_PBA_OFFSET	0xfffffff8 /* Offset into specified BAR */ +#define  PCI_MSIX_FLAGS_BIRMASK	(7 << 0)   /* deprecated */  #define PCI_CAP_MSIX_SIZEOF	12	/* size of MSIX registers */  /* MSI-X entry's format */ diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h index 9fa9c622a7f..fb104e51496 100644 --- a/include/uapi/linux/perf_event.h +++ b/include/uapi/linux/perf_event.h @@ -132,8 +132,10 @@ enum perf_event_sample_format {  	PERF_SAMPLE_BRANCH_STACK		= 1U << 11,  	PERF_SAMPLE_REGS_USER			= 1U << 12,  	PERF_SAMPLE_STACK_USER			= 1U << 13, +	PERF_SAMPLE_WEIGHT			= 1U << 14, +	PERF_SAMPLE_DATA_SRC			= 1U << 15, -	PERF_SAMPLE_MAX = 1U << 14,		/* non-ABI */ +	PERF_SAMPLE_MAX = 1U << 16,		/* non-ABI */  };  /* @@ -443,6 +445,7 @@ struct perf_event_mmap_page {  #define PERF_RECORD_MISC_GUEST_KERNEL		(4 << 0)  #define PERF_RECORD_MISC_GUEST_USER		(5 << 0) +#define PERF_RECORD_MISC_MMAP_DATA		(1 << 13)  /*   * Indicates that the content of PERF_SAMPLE_IP points to   * the actual instruction that triggered the event. See also @@ -588,6 +591,9 @@ enum perf_event_type {  	 * 	{ u64			size;  	 * 	  char			data[size];  	 * 	  u64			dyn_size; } && PERF_SAMPLE_STACK_USER +	 * +	 *	{ u64			weight;   } && PERF_SAMPLE_WEIGHT +	 *	{ u64			data_src;     } && PERF_SAMPLE_DATA_SRC  	 * };  	 */  	PERF_RECORD_SAMPLE			= 9, @@ -613,4 +619,67 @@ enum perf_callchain_context {  #define PERF_FLAG_FD_OUTPUT		(1U << 1)  #define PERF_FLAG_PID_CGROUP		(1U << 2) /* pid=cgroup id, per-cpu mode only */ +union perf_mem_data_src { +	__u64 val; +	struct { +		__u64   mem_op:5,	/* type of opcode */ +			mem_lvl:14,	/* memory hierarchy level */ +			mem_snoop:5,	/* snoop mode */ +			mem_lock:2,	/* lock instr */ +			mem_dtlb:7,	/* tlb access */ +			mem_rsvd:31; +	}; +}; + +/* type of opcode (load/store/prefetch,code) */ +#define PERF_MEM_OP_NA		0x01 /* not available */ +#define PERF_MEM_OP_LOAD	0x02 /* load instruction */ +#define PERF_MEM_OP_STORE	0x04 /* store instruction */ +#define PERF_MEM_OP_PFETCH	0x08 /* prefetch */ +#define PERF_MEM_OP_EXEC	0x10 /* code (execution) */ +#define PERF_MEM_OP_SHIFT	0 + +/* memory hierarchy (memory level, hit or miss) */ +#define PERF_MEM_LVL_NA		0x01  /* not available */ +#define PERF_MEM_LVL_HIT	0x02  /* hit level */ +#define PERF_MEM_LVL_MISS	0x04  /* miss level  */ +#define PERF_MEM_LVL_L1		0x08  /* L1 */ +#define PERF_MEM_LVL_LFB	0x10  /* Line Fill Buffer */ +#define PERF_MEM_LVL_L2		0x20  /* L2 */ +#define PERF_MEM_LVL_L3		0x40  /* L3 */ +#define PERF_MEM_LVL_LOC_RAM	0x80  /* Local DRAM */ +#define PERF_MEM_LVL_REM_RAM1	0x100 /* Remote DRAM (1 hop) */ +#define PERF_MEM_LVL_REM_RAM2	0x200 /* Remote DRAM (2 hops) */ +#define PERF_MEM_LVL_REM_CCE1	0x400 /* Remote Cache (1 hop) */ +#define PERF_MEM_LVL_REM_CCE2	0x800 /* Remote Cache (2 hops) */ +#define PERF_MEM_LVL_IO		0x1000 /* I/O memory */ +#define PERF_MEM_LVL_UNC	0x2000 /* Uncached memory */ +#define PERF_MEM_LVL_SHIFT	5 + +/* snoop mode */ +#define PERF_MEM_SNOOP_NA	0x01 /* not available */ +#define PERF_MEM_SNOOP_NONE	0x02 /* no snoop */ +#define PERF_MEM_SNOOP_HIT	0x04 /* snoop hit */ +#define PERF_MEM_SNOOP_MISS	0x08 /* snoop miss */ +#define PERF_MEM_SNOOP_HITM	0x10 /* snoop hit modified */ +#define PERF_MEM_SNOOP_SHIFT	19 + +/* locked instruction */ +#define PERF_MEM_LOCK_NA	0x01 /* not available */ +#define PERF_MEM_LOCK_LOCKED	0x02 /* locked transaction */ +#define PERF_MEM_LOCK_SHIFT	24 + +/* TLB access */ +#define PERF_MEM_TLB_NA		0x01 /* not available */ +#define PERF_MEM_TLB_HIT	0x02 /* hit level */ +#define PERF_MEM_TLB_MISS	0x04 /* miss level */ +#define PERF_MEM_TLB_L1		0x08 /* L1 */ +#define PERF_MEM_TLB_L2		0x10 /* L2 */ +#define PERF_MEM_TLB_WK		0x20 /* Hardware Walker*/ +#define PERF_MEM_TLB_OS		0x40 /* OS fault handler */ +#define PERF_MEM_TLB_SHIFT	26 + +#define PERF_MEM_S(a, s) \ +	(((u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT) +  #endif /* _UAPI_LINUX_PERF_EVENT_H */ diff --git a/include/uapi/linux/raid/md_p.h b/include/uapi/linux/raid/md_p.h index ee753536ab7..fe1a5406d4d 100644 --- a/include/uapi/linux/raid/md_p.h +++ b/include/uapi/linux/raid/md_p.h @@ -145,16 +145,18 @@ typedef struct mdp_superblock_s {  	__u32 failed_disks;	/*  4 Number of failed disks		      */  	__u32 spare_disks;	/*  5 Number of spare disks		      */  	__u32 sb_csum;		/*  6 checksum of the whole superblock        */ -#ifdef __BIG_ENDIAN +#if defined(__BYTE_ORDER) ? __BYTE_ORDER == __BIG_ENDIAN : defined(__BIG_ENDIAN)  	__u32 events_hi;	/*  7 high-order of superblock update count   */  	__u32 events_lo;	/*  8 low-order of superblock update count    */  	__u32 cp_events_hi;	/*  9 high-order of checkpoint update count   */  	__u32 cp_events_lo;	/* 10 low-order of checkpoint update count    */ -#else +#elif defined(__BYTE_ORDER) ? __BYTE_ORDER == __LITTLE_ENDIAN : defined(__LITTLE_ENDIAN)  	__u32 events_lo;	/*  7 low-order of superblock update count    */  	__u32 events_hi;	/*  8 high-order of superblock update count   */  	__u32 cp_events_lo;	/*  9 low-order of checkpoint update count    */  	__u32 cp_events_hi;	/* 10 high-order of checkpoint update count   */ +#else +#error unspecified endianness  #endif  	__u32 recovery_cp;	/* 11 recovery checkpoint sector count	      */  	/* There are only valid for minor_version > 90 */ diff --git a/include/uapi/linux/serial_core.h b/include/uapi/linux/serial_core.h index b6a23a483d7..74c2bf7211f 100644 --- a/include/uapi/linux/serial_core.h +++ b/include/uapi/linux/serial_core.h @@ -51,7 +51,10 @@  #define PORT_8250_CIR	23	/* CIR infrared port, has its own driver */  #define PORT_XR17V35X	24	/* Exar XR17V35x UARTs */  #define PORT_BRCM_TRUMANAGE	25 -#define PORT_MAX_8250	25	/* max port ID */ +#define PORT_ALTR_16550_F32 26	/* Altera 16550 UART with 32 FIFOs */ +#define PORT_ALTR_16550_F64 27	/* Altera 16550 UART with 64 FIFOs */ +#define PORT_ALTR_16550_F128 28 /* Altera 16550 UART with 128 FIFOs */ +#define PORT_MAX_8250	28	/* max port ID */  /*   * ARM specific type numbers.  These are not currently guaranteed diff --git a/include/uapi/linux/time.h b/include/uapi/linux/time.h index 0d3c0edc3ed..e75e1b6ff27 100644 --- a/include/uapi/linux/time.h +++ b/include/uapi/linux/time.h @@ -54,11 +54,9 @@ struct itimerval {  #define CLOCK_BOOTTIME			7  #define CLOCK_REALTIME_ALARM		8  #define CLOCK_BOOTTIME_ALARM		9 +#define CLOCK_SGI_CYCLE			10	/* Hardware specific */ +#define CLOCK_TAI			11 -/* - * The IDs of various hardware clocks: - */ -#define CLOCK_SGI_CYCLE			10  #define MAX_CLOCKS			16  #define CLOCKS_MASK			(CLOCK_REALTIME | CLOCK_MONOTONIC)  #define CLOCKS_MONO			CLOCK_MONOTONIC diff --git a/include/uapi/linux/unix_diag.h b/include/uapi/linux/unix_diag.h index b8a24941db2..b9e2a6a7446 100644 --- a/include/uapi/linux/unix_diag.h +++ b/include/uapi/linux/unix_diag.h @@ -39,9 +39,11 @@ enum {  	UNIX_DIAG_MEMINFO,  	UNIX_DIAG_SHUTDOWN, -	UNIX_DIAG_MAX, +	__UNIX_DIAG_MAX,  }; +#define UNIX_DIAG_MAX (__UNIX_DIAG_MAX - 1) +  struct unix_diag_vfs {  	__u32	udiag_vfs_ino;  	__u32	udiag_vfs_dev; diff --git a/include/uapi/linux/usb/cdc-wdm.h b/include/uapi/linux/usb/cdc-wdm.h new file mode 100644 index 00000000000..f03134feebd --- /dev/null +++ b/include/uapi/linux/usb/cdc-wdm.h @@ -0,0 +1,21 @@ +/* + * USB CDC Device Management userspace API definitions + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + */ + +#ifndef _UAPI__LINUX_USB_CDC_WDM_H +#define _UAPI__LINUX_USB_CDC_WDM_H + +/* + * This IOCTL is used to retrieve the wMaxCommand for the device, + * defining the message limit for both reading and writing. + * + * For CDC WDM functions this will be the wMaxCommand field of the + * Device Management Functional Descriptor. + */ +#define IOCTL_WDM_MAX_COMMAND _IOR('H', 0xA0, __u16) + +#endif /* _UAPI__LINUX_USB_CDC_WDM_H */ diff --git a/include/uapi/linux/usb/ch9.h b/include/uapi/linux/usb/ch9.h index f738e25377f..aa33fd1b2d4 100644 --- a/include/uapi/linux/usb/ch9.h +++ b/include/uapi/linux/usb/ch9.h @@ -138,7 +138,7 @@  /*   * New Feature Selectors as added by USB 3.0 - * See USB 3.0 spec Table 9-6 + * See USB 3.0 spec Table 9-7   */  #define USB_DEVICE_U1_ENABLE	48	/* dev may initiate U1 transition */  #define USB_DEVICE_U2_ENABLE	49	/* dev may initiate U2 transition */ @@ -147,7 +147,7 @@  #define USB_INTR_FUNC_SUSPEND_OPT_MASK	0xFF00  /* - * Suspend Options, Table 9-7 USB 3.0 spec + * Suspend Options, Table 9-8 USB 3.0 spec   */  #define USB_INTRF_FUNC_SUSPEND_LP	(1 << (8 + 0))  #define USB_INTRF_FUNC_SUSPEND_RW	(1 << (8 + 1)) diff --git a/include/video/atmel_lcdc.h b/include/video/atmel_lcdc.h index 28447f1594f..8deb22672ad 100644 --- a/include/video/atmel_lcdc.h +++ b/include/video/atmel_lcdc.h @@ -30,7 +30,6 @@   */  #define ATMEL_LCDC_WIRING_BGR	0  #define ATMEL_LCDC_WIRING_RGB	1 -#define ATMEL_LCDC_WIRING_RGB555	2   /* LCD Controller info data structure, stored in device platform_data */ @@ -62,6 +61,7 @@ struct atmel_lcdfb_info {  	void (*atmel_lcdfb_power_control)(int on);  	struct fb_monspecs	*default_monspecs;  	u32			pseudo_palette[16]; +	bool			have_intensity_bit;  };  #define ATMEL_LCDC_DMABADDR1	0x00 diff --git a/include/video/auo_k190xfb.h b/include/video/auo_k190xfb.h index 609efe8c686..ac329ee1d75 100644 --- a/include/video/auo_k190xfb.h +++ b/include/video/auo_k190xfb.h @@ -22,6 +22,8 @@   */  #define AUOK190X_RESOLUTION_800_600		0  #define AUOK190X_RESOLUTION_1024_768		1 +#define AUOK190X_RESOLUTION_600_800		4 +#define AUOK190X_RESOLUTION_768_1024		5  /*   * struct used by auok190x. board specific stuff comes from *board @@ -98,7 +100,6 @@ struct auok190x_board {  	int gpio_nbusy;  	int resolution; -	int rotation;  	int quirks;  	int fps;  }; diff --git a/include/video/display_timing.h b/include/video/display_timing.h index 71e9a383a98..5d0259b08e0 100644 --- a/include/video/display_timing.h +++ b/include/video/display_timing.h @@ -12,19 +12,22 @@  #include <linux/bitops.h>  #include <linux/types.h> -/* VESA display monitor timing parameters */ -#define VESA_DMT_HSYNC_LOW		BIT(0) -#define VESA_DMT_HSYNC_HIGH		BIT(1) -#define VESA_DMT_VSYNC_LOW		BIT(2) -#define VESA_DMT_VSYNC_HIGH		BIT(3) +enum display_flags { +	DISPLAY_FLAGS_HSYNC_LOW		= BIT(0), +	DISPLAY_FLAGS_HSYNC_HIGH	= BIT(1), +	DISPLAY_FLAGS_VSYNC_LOW		= BIT(2), +	DISPLAY_FLAGS_VSYNC_HIGH	= BIT(3), -/* display specific flags */ -#define DISPLAY_FLAGS_DE_LOW		BIT(0)	/* data enable flag */ -#define DISPLAY_FLAGS_DE_HIGH		BIT(1) -#define DISPLAY_FLAGS_PIXDATA_POSEDGE	BIT(2)	/* drive data on pos. edge */ -#define DISPLAY_FLAGS_PIXDATA_NEGEDGE	BIT(3)	/* drive data on neg. edge */ -#define DISPLAY_FLAGS_INTERLACED	BIT(4) -#define DISPLAY_FLAGS_DOUBLESCAN	BIT(5) +	/* data enable flag */ +	DISPLAY_FLAGS_DE_LOW		= BIT(4), +	DISPLAY_FLAGS_DE_HIGH		= BIT(5), +	/* drive data on pos. edge */ +	DISPLAY_FLAGS_PIXDATA_POSEDGE	= BIT(6), +	/* drive data on neg. edge */ +	DISPLAY_FLAGS_PIXDATA_NEGEDGE	= BIT(7), +	DISPLAY_FLAGS_INTERLACED	= BIT(8), +	DISPLAY_FLAGS_DOUBLESCAN	= BIT(9), +};  /*   * A single signal can be specified via a range of minimal and maximal values @@ -36,12 +39,6 @@ struct timing_entry {  	u32 max;  }; -enum timing_entry_index { -	TE_MIN = 0, -	TE_TYP = 1, -	TE_MAX = 2, -}; -  /*   * Single "mode" entry. This describes one set of signal timings a display can   * have in one setting. This struct can later be converted to struct videomode @@ -72,8 +69,7 @@ struct display_timing {  	struct timing_entry vback_porch;	/* ver. back porch */  	struct timing_entry vsync_len;		/* ver. sync len */ -	unsigned int dmt_flags;			/* VESA DMT flags */ -	unsigned int data_flags;		/* video data flags */ +	enum display_flags flags;		/* display flags */  };  /* @@ -89,25 +85,6 @@ struct display_timings {  	struct display_timing **timings;  }; -/* get value specified by index from struct timing_entry */ -static inline u32 display_timing_get_value(const struct timing_entry *te, -					   enum timing_entry_index index) -{ -	switch (index) { -	case TE_MIN: -		return te->min; -		break; -	case TE_TYP: -		return te->typ; -		break; -	case TE_MAX: -		return te->max; -		break; -	default: -		return te->typ; -	} -} -  /* get one entry from struct display_timings */  static inline struct display_timing *display_timings_get(const struct  							 display_timings *disp, diff --git a/include/video/platform_lcd.h b/include/video/platform_lcd.h index ad3bdfe743b..23864b28414 100644 --- a/include/video/platform_lcd.h +++ b/include/video/platform_lcd.h @@ -15,6 +15,7 @@ struct plat_lcd_data;  struct fb_info;  struct plat_lcd_data { +	int	(*probe)(struct plat_lcd_data *);  	void	(*set_power)(struct plat_lcd_data *, unsigned int power);  	int	(*match_fb)(struct plat_lcd_data *, struct fb_info *);  }; diff --git a/include/video/videomode.h b/include/video/videomode.h index a42156234dd..3f1049d870d 100644 --- a/include/video/videomode.h +++ b/include/video/videomode.h @@ -29,20 +29,30 @@ struct videomode {  	u32 vback_porch;  	u32 vsync_len; -	unsigned int dmt_flags;	/* VESA DMT flags */ -	unsigned int data_flags; /* video data flags */ +	enum display_flags flags; /* display flags */  };  /**   * videomode_from_timing - convert display timing to videomode + * @dt: display_timing structure + * @vm: return value + * + * DESCRIPTION: + * This function converts a struct display_timing to a struct videomode. + */ +void videomode_from_timing(const struct display_timing *dt, +			  struct videomode *vm); + +/** + * videomode_from_timings - convert one display timings entry to videomode   * @disp: structure with all possible timing entries   * @vm: return value   * @index: index into the list of display timings in devicetree   *   * DESCRIPTION: - * This function converts a struct display_timing to a struct videomode. + * This function converts one struct display_timing entry to a struct videomode.   */ -int videomode_from_timing(const struct display_timings *disp, +int videomode_from_timings(const struct display_timings *disp,  			  struct videomode *vm, unsigned int index);  #endif diff --git a/include/xen/events.h b/include/xen/events.h index c6bfe01acf6..b2b27c6a0f7 100644 --- a/include/xen/events.h +++ b/include/xen/events.h @@ -90,8 +90,7 @@ int xen_bind_pirq_gsi_to_irq(unsigned gsi,  int xen_allocate_pirq_msi(struct pci_dev *dev, struct msi_desc *msidesc);  /* Bind an PSI pirq to an irq. */  int xen_bind_pirq_msi_to_irq(struct pci_dev *dev, struct msi_desc *msidesc, -			     int pirq, int vector, const char *name, -			     domid_t domid); +			     int pirq, const char *name, domid_t domid);  #endif  /* De-allocates the above mentioned physical interrupt. */ diff --git a/include/xen/interface/io/blkif.h b/include/xen/interface/io/blkif.h index 01c3d62436e..ffd4652de91 100644 --- a/include/xen/interface/io/blkif.h +++ b/include/xen/interface/io/blkif.h @@ -138,11 +138,21 @@ struct blkif_request_discard {  	uint8_t        _pad3;  } __attribute__((__packed__)); +struct blkif_request_other { +	uint8_t      _pad1; +	blkif_vdev_t _pad2;        /* only for read/write requests         */ +#ifdef CONFIG_X86_64 +	uint32_t     _pad3;        /* offsetof(blkif_req..,u.other.id)==8*/ +#endif +	uint64_t     id;           /* private guest value, echoed in resp  */ +} __attribute__((__packed__)); +  struct blkif_request {  	uint8_t        operation;    /* BLKIF_OP_???                         */  	union {  		struct blkif_request_rw rw;  		struct blkif_request_discard discard; +		struct blkif_request_other other;  	} u;  } __attribute__((__packed__)); diff --git a/include/xen/interface/physdev.h b/include/xen/interface/physdev.h index 1844d31f455..7000bb1f6e9 100644 --- a/include/xen/interface/physdev.h +++ b/include/xen/interface/physdev.h @@ -251,6 +251,12 @@ struct physdev_pci_device_add {  #define PHYSDEVOP_pci_device_remove     26  #define PHYSDEVOP_restore_msi_ext       27 +/* + * Dom0 should use these two to announce MMIO resources assigned to + * MSI-X capable devices won't (prepare) or may (release) change. + */ +#define PHYSDEVOP_prepare_msix          30 +#define PHYSDEVOP_release_msix          31  struct physdev_pci_device {      /* IN */      uint16_t seg;  |