diff options
Diffstat (limited to 'include/linux')
136 files changed, 3539 insertions, 1069 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 1151a1dcfe41..7a8f2cd66c8b 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -108,6 +108,10 @@ static inline void acpi_initrd_override(void *data, size_t size) | |||
| 108 | } | 108 | } |
| 109 | #endif | 109 | #endif |
| 110 | 110 | ||
| 111 | #define BAD_MADT_ENTRY(entry, end) ( \ | ||
| 112 | (!entry) || (unsigned long)entry + sizeof(*entry) > end || \ | ||
| 113 | ((struct acpi_subtable_header *)entry)->length < sizeof(*entry)) | ||
| 114 | |||
| 111 | char * __acpi_map_table (unsigned long phys_addr, unsigned long size); | 115 | char * __acpi_map_table (unsigned long phys_addr, unsigned long size); |
| 112 | void __acpi_unmap_table(char *map, unsigned long size); | 116 | void __acpi_unmap_table(char *map, unsigned long size); |
| 113 | int early_acpi_boot_init(void); | 117 | int early_acpi_boot_init(void); |
| @@ -259,14 +263,9 @@ extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d); | |||
| 259 | extern void acpi_osi_setup(char *str); | 263 | extern void acpi_osi_setup(char *str); |
| 260 | 264 | ||
| 261 | #ifdef CONFIG_ACPI_NUMA | 265 | #ifdef CONFIG_ACPI_NUMA |
| 262 | int acpi_get_pxm(acpi_handle handle); | 266 | int acpi_get_node(acpi_handle handle); |
| 263 | int acpi_get_node(acpi_handle *handle); | ||
| 264 | #else | 267 | #else |
| 265 | static inline int acpi_get_pxm(acpi_handle handle) | 268 | static inline int acpi_get_node(acpi_handle handle) |
| 266 | { | ||
| 267 | return 0; | ||
| 268 | } | ||
| 269 | static inline int acpi_get_node(acpi_handle *handle) | ||
| 270 | { | 269 | { |
| 271 | return 0; | 270 | return 0; |
| 272 | } | 271 | } |
diff --git a/include/linux/ahci_platform.h b/include/linux/ahci_platform.h index 73a25005d88a..1f16d502600c 100644 --- a/include/linux/ahci_platform.h +++ b/include/linux/ahci_platform.h | |||
| @@ -19,15 +19,37 @@ | |||
| 19 | 19 | ||
| 20 | struct device; | 20 | struct device; |
| 21 | struct ata_port_info; | 21 | struct ata_port_info; |
| 22 | struct ahci_host_priv; | ||
| 23 | struct platform_device; | ||
| 22 | 24 | ||
| 25 | /* | ||
| 26 | * Note ahci_platform_data is deprecated, it is only kept around for use | ||
| 27 | * by the old da850 and spear13xx ahci code. | ||
| 28 | * New drivers should instead declare their own platform_driver struct, and | ||
| 29 | * use ahci_platform* functions in their own probe, suspend and resume methods. | ||
| 30 | */ | ||
| 23 | struct ahci_platform_data { | 31 | struct ahci_platform_data { |
| 24 | int (*init)(struct device *dev, void __iomem *addr); | 32 | int (*init)(struct device *dev, void __iomem *addr); |
| 25 | void (*exit)(struct device *dev); | 33 | void (*exit)(struct device *dev); |
| 26 | int (*suspend)(struct device *dev); | 34 | int (*suspend)(struct device *dev); |
| 27 | int (*resume)(struct device *dev); | 35 | int (*resume)(struct device *dev); |
| 28 | const struct ata_port_info *ata_port_info; | ||
| 29 | unsigned int force_port_map; | ||
| 30 | unsigned int mask_port_map; | ||
| 31 | }; | 36 | }; |
| 32 | 37 | ||
| 38 | int ahci_platform_enable_clks(struct ahci_host_priv *hpriv); | ||
| 39 | void ahci_platform_disable_clks(struct ahci_host_priv *hpriv); | ||
| 40 | int ahci_platform_enable_resources(struct ahci_host_priv *hpriv); | ||
| 41 | void ahci_platform_disable_resources(struct ahci_host_priv *hpriv); | ||
| 42 | struct ahci_host_priv *ahci_platform_get_resources( | ||
| 43 | struct platform_device *pdev); | ||
| 44 | int ahci_platform_init_host(struct platform_device *pdev, | ||
| 45 | struct ahci_host_priv *hpriv, | ||
| 46 | const struct ata_port_info *pi_template, | ||
| 47 | unsigned int force_port_map, | ||
| 48 | unsigned int mask_port_map); | ||
| 49 | |||
| 50 | int ahci_platform_suspend_host(struct device *dev); | ||
| 51 | int ahci_platform_resume_host(struct device *dev); | ||
| 52 | int ahci_platform_suspend(struct device *dev); | ||
| 53 | int ahci_platform_resume(struct device *dev); | ||
| 54 | |||
| 33 | #endif /* _AHCI_PLATFORM_H */ | 55 | #endif /* _AHCI_PLATFORM_H */ |
diff --git a/include/linux/atmel-ssc.h b/include/linux/atmel-ssc.h index 66a0e5384edd..571a12ebb018 100644 --- a/include/linux/atmel-ssc.h +++ b/include/linux/atmel-ssc.h | |||
| @@ -18,6 +18,7 @@ struct ssc_device { | |||
| 18 | struct clk *clk; | 18 | struct clk *clk; |
| 19 | int user; | 19 | int user; |
| 20 | int irq; | 20 | int irq; |
| 21 | bool clk_from_rk_pin; | ||
| 21 | }; | 22 | }; |
| 22 | 23 | ||
| 23 | struct ssc_device * __must_check ssc_request(unsigned int ssc_num); | 24 | struct ssc_device * __must_check ssc_request(unsigned int ssc_num); |
diff --git a/include/linux/audit.h b/include/linux/audit.h index aa865a9a4c4f..ec1464df4c60 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
| @@ -43,6 +43,7 @@ struct mq_attr; | |||
| 43 | struct mqstat; | 43 | struct mqstat; |
| 44 | struct audit_watch; | 44 | struct audit_watch; |
| 45 | struct audit_tree; | 45 | struct audit_tree; |
| 46 | struct sk_buff; | ||
| 46 | 47 | ||
| 47 | struct audit_krule { | 48 | struct audit_krule { |
| 48 | int vers_ops; | 49 | int vers_ops; |
| @@ -463,7 +464,7 @@ extern int audit_filter_user(int type); | |||
| 463 | extern int audit_filter_type(int type); | 464 | extern int audit_filter_type(int type); |
| 464 | extern int audit_rule_change(int type, __u32 portid, int seq, | 465 | extern int audit_rule_change(int type, __u32 portid, int seq, |
| 465 | void *data, size_t datasz); | 466 | void *data, size_t datasz); |
| 466 | extern int audit_list_rules_send(__u32 portid, int seq); | 467 | extern int audit_list_rules_send(struct sk_buff *request_skb, int seq); |
| 467 | 468 | ||
| 468 | extern u32 audit_enabled; | 469 | extern u32 audit_enabled; |
| 469 | #else /* CONFIG_AUDIT */ | 470 | #else /* CONFIG_AUDIT */ |
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index abc9ca778456..be5fd38bd5a0 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h | |||
| @@ -196,6 +196,21 @@ static inline unsigned long __ffs64(u64 word) | |||
| 196 | 196 | ||
| 197 | #ifdef __KERNEL__ | 197 | #ifdef __KERNEL__ |
| 198 | 198 | ||
| 199 | #ifndef set_mask_bits | ||
| 200 | #define set_mask_bits(ptr, _mask, _bits) \ | ||
| 201 | ({ \ | ||
| 202 | const typeof(*ptr) mask = (_mask), bits = (_bits); \ | ||
| 203 | typeof(*ptr) old, new; \ | ||
| 204 | \ | ||
| 205 | do { \ | ||
| 206 | old = ACCESS_ONCE(*ptr); \ | ||
| 207 | new = (old & ~mask) | bits; \ | ||
| 208 | } while (cmpxchg(ptr, old, new) != old); \ | ||
| 209 | \ | ||
| 210 | new; \ | ||
| 211 | }) | ||
| 212 | #endif | ||
| 213 | |||
| 199 | #ifndef find_last_bit | 214 | #ifndef find_last_bit |
| 200 | /** | 215 | /** |
| 201 | * find_last_bit - find the last set bit in a memory region | 216 | * find_last_bit - find the last set bit in a memory region |
diff --git a/include/linux/blk-iopoll.h b/include/linux/blk-iopoll.h index 308734d3d4a2..77ae77c0b704 100644 --- a/include/linux/blk-iopoll.h +++ b/include/linux/blk-iopoll.h | |||
| @@ -43,6 +43,4 @@ extern void __blk_iopoll_complete(struct blk_iopoll *); | |||
| 43 | extern void blk_iopoll_enable(struct blk_iopoll *); | 43 | extern void blk_iopoll_enable(struct blk_iopoll *); |
| 44 | extern void blk_iopoll_disable(struct blk_iopoll *); | 44 | extern void blk_iopoll_disable(struct blk_iopoll *); |
| 45 | 45 | ||
| 46 | extern int blk_iopoll_enabled; | ||
| 47 | |||
| 48 | #endif | 46 | #endif |
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index 18ba8a627f46..0120451545d8 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h | |||
| @@ -109,7 +109,7 @@ enum { | |||
| 109 | BLK_MQ_F_SHOULD_SORT = 1 << 1, | 109 | BLK_MQ_F_SHOULD_SORT = 1 << 1, |
| 110 | BLK_MQ_F_SHOULD_IPI = 1 << 2, | 110 | BLK_MQ_F_SHOULD_IPI = 1 << 2, |
| 111 | 111 | ||
| 112 | BLK_MQ_S_STOPPED = 1 << 0, | 112 | BLK_MQ_S_STOPPED = 0, |
| 113 | 113 | ||
| 114 | BLK_MQ_MAX_DEPTH = 2048, | 114 | BLK_MQ_MAX_DEPTH = 2048, |
| 115 | }; | 115 | }; |
| @@ -117,12 +117,12 @@ enum { | |||
| 117 | struct request_queue *blk_mq_init_queue(struct blk_mq_reg *, void *); | 117 | struct request_queue *blk_mq_init_queue(struct blk_mq_reg *, void *); |
| 118 | int blk_mq_register_disk(struct gendisk *); | 118 | int blk_mq_register_disk(struct gendisk *); |
| 119 | void blk_mq_unregister_disk(struct gendisk *); | 119 | void blk_mq_unregister_disk(struct gendisk *); |
| 120 | void blk_mq_init_commands(struct request_queue *, void (*init)(void *data, struct blk_mq_hw_ctx *, struct request *, unsigned int), void *data); | 120 | int blk_mq_init_commands(struct request_queue *, int (*init)(void *data, struct blk_mq_hw_ctx *, struct request *, unsigned int), void *data); |
| 121 | void blk_mq_free_commands(struct request_queue *, void (*free)(void *data, struct blk_mq_hw_ctx *, struct request *, unsigned int), void *data); | ||
| 121 | 122 | ||
| 122 | void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule); | 123 | void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule); |
| 123 | 124 | ||
| 124 | void blk_mq_insert_request(struct request_queue *, struct request *, | 125 | void blk_mq_insert_request(struct request *, bool, bool, bool); |
| 125 | bool, bool); | ||
| 126 | void blk_mq_run_queues(struct request_queue *q, bool async); | 126 | void blk_mq_run_queues(struct request_queue *q, bool async); |
| 127 | void blk_mq_free_request(struct request *rq); | 127 | void blk_mq_free_request(struct request *rq); |
| 128 | bool blk_mq_can_queue(struct blk_mq_hw_ctx *); | 128 | bool blk_mq_can_queue(struct blk_mq_hw_ctx *); |
| @@ -134,7 +134,13 @@ struct blk_mq_hw_ctx *blk_mq_map_queue(struct request_queue *, const int ctx_ind | |||
| 134 | struct blk_mq_hw_ctx *blk_mq_alloc_single_hw_queue(struct blk_mq_reg *, unsigned int); | 134 | struct blk_mq_hw_ctx *blk_mq_alloc_single_hw_queue(struct blk_mq_reg *, unsigned int); |
| 135 | void blk_mq_free_single_hw_queue(struct blk_mq_hw_ctx *, unsigned int); | 135 | void blk_mq_free_single_hw_queue(struct blk_mq_hw_ctx *, unsigned int); |
| 136 | 136 | ||
| 137 | void blk_mq_end_io(struct request *rq, int error); | 137 | bool blk_mq_end_io_partial(struct request *rq, int error, |
| 138 | unsigned int nr_bytes); | ||
| 139 | static inline void blk_mq_end_io(struct request *rq, int error) | ||
| 140 | { | ||
| 141 | bool done = !blk_mq_end_io_partial(rq, error, blk_rq_bytes(rq)); | ||
| 142 | BUG_ON(!done); | ||
| 143 | } | ||
| 138 | 144 | ||
| 139 | void blk_mq_complete_request(struct request *rq); | 145 | void blk_mq_complete_request(struct request *rq); |
| 140 | 146 | ||
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 4afa4f8f6090..1e1fa3f93d5f 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -99,6 +99,7 @@ struct request { | |||
| 99 | union { | 99 | union { |
| 100 | struct call_single_data csd; | 100 | struct call_single_data csd; |
| 101 | struct work_struct mq_flush_work; | 101 | struct work_struct mq_flush_work; |
| 102 | unsigned long fifo_time; | ||
| 102 | }; | 103 | }; |
| 103 | 104 | ||
| 104 | struct request_queue *q; | 105 | struct request_queue *q; |
diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h index 2623cffc73a1..25bfb0eff772 100644 --- a/include/linux/ceph/ceph_fs.h +++ b/include/linux/ceph/ceph_fs.h | |||
| @@ -373,8 +373,9 @@ extern const char *ceph_mds_op_name(int op); | |||
| 373 | /* | 373 | /* |
| 374 | * Ceph setxattr request flags. | 374 | * Ceph setxattr request flags. |
| 375 | */ | 375 | */ |
| 376 | #define CEPH_XATTR_CREATE 1 | 376 | #define CEPH_XATTR_CREATE (1 << 0) |
| 377 | #define CEPH_XATTR_REPLACE 2 | 377 | #define CEPH_XATTR_REPLACE (1 << 1) |
| 378 | #define CEPH_XATTR_REMOVE (1 << 31) | ||
| 378 | 379 | ||
| 379 | union ceph_mds_request_args { | 380 | union ceph_mds_request_args { |
| 380 | struct { | 381 | struct { |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 5c097596104b..9450f025fe0c 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
| @@ -166,6 +166,8 @@ struct cgroup { | |||
| 166 | * | 166 | * |
| 167 | * The ID of the root cgroup is always 0, and a new cgroup | 167 | * The ID of the root cgroup is always 0, and a new cgroup |
| 168 | * will be assigned with a smallest available ID. | 168 | * will be assigned with a smallest available ID. |
| 169 | * | ||
| 170 | * Allocating/Removing ID must be protected by cgroup_mutex. | ||
| 169 | */ | 171 | */ |
| 170 | int id; | 172 | int id; |
| 171 | 173 | ||
diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h index 092b64168d7f..4a21a872dbbd 100644 --- a/include/linux/clk/ti.h +++ b/include/linux/clk/ti.h | |||
| @@ -245,6 +245,10 @@ long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate, | |||
| 245 | void omap2_init_clk_clkdm(struct clk_hw *clk); | 245 | void omap2_init_clk_clkdm(struct clk_hw *clk); |
| 246 | unsigned long omap3_clkoutx2_recalc(struct clk_hw *hw, | 246 | unsigned long omap3_clkoutx2_recalc(struct clk_hw *hw, |
| 247 | unsigned long parent_rate); | 247 | unsigned long parent_rate); |
| 248 | int omap3_clkoutx2_set_rate(struct clk_hw *hw, unsigned long rate, | ||
| 249 | unsigned long parent_rate); | ||
| 250 | long omap3_clkoutx2_round_rate(struct clk_hw *hw, unsigned long rate, | ||
| 251 | unsigned long *prate); | ||
| 248 | int omap2_clkops_enable_clkdm(struct clk_hw *hw); | 252 | int omap2_clkops_enable_clkdm(struct clk_hw *hw); |
| 249 | void omap2_clkops_disable_clkdm(struct clk_hw *hw); | 253 | void omap2_clkops_disable_clkdm(struct clk_hw *hw); |
| 250 | int omap2_clk_disable_autoidle_all(void); | 254 | int omap2_clk_disable_autoidle_all(void); |
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index 493aa021c7a9..2e4cb67f6e56 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h | |||
| @@ -62,6 +62,11 @@ enum clock_event_mode { | |||
| 62 | #define CLOCK_EVT_FEAT_DYNIRQ 0x000020 | 62 | #define CLOCK_EVT_FEAT_DYNIRQ 0x000020 |
| 63 | #define CLOCK_EVT_FEAT_PERCPU 0x000040 | 63 | #define CLOCK_EVT_FEAT_PERCPU 0x000040 |
| 64 | 64 | ||
| 65 | /* | ||
| 66 | * Clockevent device is based on a hrtimer for broadcast | ||
| 67 | */ | ||
| 68 | #define CLOCK_EVT_FEAT_HRTIMER 0x000080 | ||
| 69 | |||
| 65 | /** | 70 | /** |
| 66 | * struct clock_event_device - clock event device descriptor | 71 | * struct clock_event_device - clock event device descriptor |
| 67 | * @event_handler: Assigned by the framework to be called by the low | 72 | * @event_handler: Assigned by the framework to be called by the low |
| @@ -83,6 +88,7 @@ enum clock_event_mode { | |||
| 83 | * @name: ptr to clock event name | 88 | * @name: ptr to clock event name |
| 84 | * @rating: variable to rate clock event devices | 89 | * @rating: variable to rate clock event devices |
| 85 | * @irq: IRQ number (only for non CPU local devices) | 90 | * @irq: IRQ number (only for non CPU local devices) |
| 91 | * @bound_on: Bound on CPU | ||
| 86 | * @cpumask: cpumask to indicate for which CPUs this device works | 92 | * @cpumask: cpumask to indicate for which CPUs this device works |
| 87 | * @list: list head for the management code | 93 | * @list: list head for the management code |
| 88 | * @owner: module reference | 94 | * @owner: module reference |
| @@ -113,6 +119,7 @@ struct clock_event_device { | |||
| 113 | const char *name; | 119 | const char *name; |
| 114 | int rating; | 120 | int rating; |
| 115 | int irq; | 121 | int irq; |
| 122 | int bound_on; | ||
| 116 | const struct cpumask *cpumask; | 123 | const struct cpumask *cpumask; |
| 117 | struct list_head list; | 124 | struct list_head list; |
| 118 | struct module *owner; | 125 | struct module *owner; |
| @@ -180,15 +187,17 @@ extern int tick_receive_broadcast(void); | |||
| 180 | #endif | 187 | #endif |
| 181 | 188 | ||
| 182 | #if defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) && defined(CONFIG_TICK_ONESHOT) | 189 | #if defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) && defined(CONFIG_TICK_ONESHOT) |
| 190 | extern void tick_setup_hrtimer_broadcast(void); | ||
| 183 | extern int tick_check_broadcast_expired(void); | 191 | extern int tick_check_broadcast_expired(void); |
| 184 | #else | 192 | #else |
| 185 | static inline int tick_check_broadcast_expired(void) { return 0; } | 193 | static inline int tick_check_broadcast_expired(void) { return 0; } |
| 194 | static inline void tick_setup_hrtimer_broadcast(void) {}; | ||
| 186 | #endif | 195 | #endif |
| 187 | 196 | ||
| 188 | #ifdef CONFIG_GENERIC_CLOCKEVENTS | 197 | #ifdef CONFIG_GENERIC_CLOCKEVENTS |
| 189 | extern void clockevents_notify(unsigned long reason, void *arg); | 198 | extern int clockevents_notify(unsigned long reason, void *arg); |
| 190 | #else | 199 | #else |
| 191 | static inline void clockevents_notify(unsigned long reason, void *arg) {} | 200 | static inline int clockevents_notify(unsigned long reason, void *arg) { return 0; } |
| 192 | #endif | 201 | #endif |
| 193 | 202 | ||
| 194 | #else /* CONFIG_GENERIC_CLOCKEVENTS_BUILD */ | 203 | #else /* CONFIG_GENERIC_CLOCKEVENTS_BUILD */ |
| @@ -196,8 +205,9 @@ static inline void clockevents_notify(unsigned long reason, void *arg) {} | |||
| 196 | static inline void clockevents_suspend(void) {} | 205 | static inline void clockevents_suspend(void) {} |
| 197 | static inline void clockevents_resume(void) {} | 206 | static inline void clockevents_resume(void) {} |
| 198 | 207 | ||
| 199 | static inline void clockevents_notify(unsigned long reason, void *arg) {} | 208 | static inline int clockevents_notify(unsigned long reason, void *arg) { return 0; } |
| 200 | static inline int tick_check_broadcast_expired(void) { return 0; } | 209 | static inline int tick_check_broadcast_expired(void) { return 0; } |
| 210 | static inline void tick_setup_hrtimer_broadcast(void) {}; | ||
| 201 | 211 | ||
| 202 | #endif | 212 | #endif |
| 203 | 213 | ||
diff --git a/include/linux/compat.h b/include/linux/compat.h index 3f448c65511b..e6494261eaff 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/if.h> | 14 | #include <linux/if.h> |
| 15 | #include <linux/fs.h> | 15 | #include <linux/fs.h> |
| 16 | #include <linux/aio_abi.h> /* for aio_context_t */ | 16 | #include <linux/aio_abi.h> /* for aio_context_t */ |
| 17 | #include <linux/unistd.h> | ||
| 17 | 18 | ||
| 18 | #include <asm/compat.h> | 19 | #include <asm/compat.h> |
| 19 | #include <asm/siginfo.h> | 20 | #include <asm/siginfo.h> |
| @@ -27,6 +28,9 @@ | |||
| 27 | #define __SC_DELOUSE(t,v) ((t)(unsigned long)(v)) | 28 | #define __SC_DELOUSE(t,v) ((t)(unsigned long)(v)) |
| 28 | #endif | 29 | #endif |
| 29 | 30 | ||
| 31 | #define COMPAT_SYSCALL_DEFINE0(name) \ | ||
| 32 | asmlinkage long compat_sys_##name(void) | ||
| 33 | |||
| 30 | #define COMPAT_SYSCALL_DEFINE1(name, ...) \ | 34 | #define COMPAT_SYSCALL_DEFINE1(name, ...) \ |
| 31 | COMPAT_SYSCALL_DEFINEx(1, _##name, __VA_ARGS__) | 35 | COMPAT_SYSCALL_DEFINEx(1, _##name, __VA_ARGS__) |
| 32 | #define COMPAT_SYSCALL_DEFINE2(name, ...) \ | 36 | #define COMPAT_SYSCALL_DEFINE2(name, ...) \ |
| @@ -68,6 +72,8 @@ typedef struct compat_sigaltstack { | |||
| 68 | typedef __compat_uid32_t compat_uid_t; | 72 | typedef __compat_uid32_t compat_uid_t; |
| 69 | typedef __compat_gid32_t compat_gid_t; | 73 | typedef __compat_gid32_t compat_gid_t; |
| 70 | 74 | ||
| 75 | typedef compat_ulong_t compat_aio_context_t; | ||
| 76 | |||
| 71 | struct compat_sel_arg_struct; | 77 | struct compat_sel_arg_struct; |
| 72 | struct rusage; | 78 | struct rusage; |
| 73 | 79 | ||
| @@ -141,26 +147,23 @@ struct compat_sigaction { | |||
| 141 | }; | 147 | }; |
| 142 | 148 | ||
| 143 | /* | 149 | /* |
| 144 | * These functions operate strictly on struct compat_time* | ||
| 145 | */ | ||
| 146 | extern int get_compat_timespec(struct timespec *, | ||
| 147 | const struct compat_timespec __user *); | ||
| 148 | extern int put_compat_timespec(const struct timespec *, | ||
| 149 | struct compat_timespec __user *); | ||
| 150 | extern int get_compat_timeval(struct timeval *, | ||
| 151 | const struct compat_timeval __user *); | ||
| 152 | extern int put_compat_timeval(const struct timeval *, | ||
| 153 | struct compat_timeval __user *); | ||
| 154 | /* | ||
| 155 | * These functions operate on 32- or 64-bit specs depending on | 150 | * These functions operate on 32- or 64-bit specs depending on |
| 156 | * COMPAT_USE_64BIT_TIME, hence the void user pointer arguments and the | 151 | * COMPAT_USE_64BIT_TIME, hence the void user pointer arguments. |
| 157 | * naming as compat_get/put_ rather than get/put_compat_. | ||
| 158 | */ | 152 | */ |
| 159 | extern int compat_get_timespec(struct timespec *, const void __user *); | 153 | extern int compat_get_timespec(struct timespec *, const void __user *); |
| 160 | extern int compat_put_timespec(const struct timespec *, void __user *); | 154 | extern int compat_put_timespec(const struct timespec *, void __user *); |
| 161 | extern int compat_get_timeval(struct timeval *, const void __user *); | 155 | extern int compat_get_timeval(struct timeval *, const void __user *); |
| 162 | extern int compat_put_timeval(const struct timeval *, void __user *); | 156 | extern int compat_put_timeval(const struct timeval *, void __user *); |
| 163 | 157 | ||
| 158 | /* | ||
| 159 | * This function convert a timespec if necessary and returns a *user | ||
| 160 | * space* pointer. If no conversion is necessary, it returns the | ||
| 161 | * initial pointer. NULL is a legitimate argument and will always | ||
| 162 | * output NULL. | ||
| 163 | */ | ||
| 164 | extern int compat_convert_timespec(struct timespec __user **, | ||
| 165 | const void __user *); | ||
| 166 | |||
| 164 | struct compat_iovec { | 167 | struct compat_iovec { |
| 165 | compat_uptr_t iov_base; | 168 | compat_uptr_t iov_base; |
| 166 | compat_size_t iov_len; | 169 | compat_size_t iov_len; |
| @@ -318,7 +321,7 @@ asmlinkage long compat_sys_semctl(int semid, int semnum, int cmd, int arg); | |||
| 318 | asmlinkage long compat_sys_msgsnd(int msqid, compat_uptr_t msgp, | 321 | asmlinkage long compat_sys_msgsnd(int msqid, compat_uptr_t msgp, |
| 319 | compat_ssize_t msgsz, int msgflg); | 322 | compat_ssize_t msgsz, int msgflg); |
| 320 | asmlinkage long compat_sys_msgrcv(int msqid, compat_uptr_t msgp, | 323 | asmlinkage long compat_sys_msgrcv(int msqid, compat_uptr_t msgp, |
| 321 | compat_ssize_t msgsz, long msgtyp, int msgflg); | 324 | compat_ssize_t msgsz, compat_long_t msgtyp, int msgflg); |
| 322 | long compat_sys_msgctl(int first, int second, void __user *uptr); | 325 | long compat_sys_msgctl(int first, int second, void __user *uptr); |
| 323 | long compat_sys_shmctl(int first, int second, void __user *uptr); | 326 | long compat_sys_shmctl(int first, int second, void __user *uptr); |
| 324 | long compat_sys_semtimedop(int semid, struct sembuf __user *tsems, | 327 | long compat_sys_semtimedop(int semid, struct sembuf __user *tsems, |
| @@ -337,6 +340,19 @@ asmlinkage ssize_t compat_sys_preadv(compat_ulong_t fd, | |||
| 337 | asmlinkage ssize_t compat_sys_pwritev(compat_ulong_t fd, | 340 | asmlinkage ssize_t compat_sys_pwritev(compat_ulong_t fd, |
| 338 | const struct compat_iovec __user *vec, | 341 | const struct compat_iovec __user *vec, |
| 339 | compat_ulong_t vlen, u32 pos_low, u32 pos_high); | 342 | compat_ulong_t vlen, u32 pos_low, u32 pos_high); |
| 343 | |||
| 344 | #ifdef __ARCH_WANT_COMPAT_SYS_PREADV64 | ||
| 345 | asmlinkage long compat_sys_preadv64(unsigned long fd, | ||
| 346 | const struct compat_iovec __user *vec, | ||
| 347 | unsigned long vlen, loff_t pos); | ||
| 348 | #endif | ||
| 349 | |||
| 350 | #ifdef __ARCH_WANT_COMPAT_SYS_PWRITEV64 | ||
| 351 | asmlinkage long compat_sys_pwritev64(unsigned long fd, | ||
| 352 | const struct compat_iovec __user *vec, | ||
| 353 | unsigned long vlen, loff_t pos); | ||
| 354 | #endif | ||
| 355 | |||
| 340 | asmlinkage long compat_sys_lseek(unsigned int, compat_off_t, unsigned int); | 356 | asmlinkage long compat_sys_lseek(unsigned int, compat_off_t, unsigned int); |
| 341 | 357 | ||
| 342 | asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv, | 358 | asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv, |
| @@ -451,7 +467,7 @@ asmlinkage long compat_sys_timerfd_settime(int ufd, int flags, | |||
| 451 | asmlinkage long compat_sys_timerfd_gettime(int ufd, | 467 | asmlinkage long compat_sys_timerfd_gettime(int ufd, |
| 452 | struct compat_itimerspec __user *otmr); | 468 | struct compat_itimerspec __user *otmr); |
| 453 | 469 | ||
| 454 | asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_page, | 470 | asmlinkage long compat_sys_move_pages(pid_t pid, compat_ulong_t nr_pages, |
| 455 | __u32 __user *pages, | 471 | __u32 __user *pages, |
| 456 | const int __user *nodes, | 472 | const int __user *nodes, |
| 457 | int __user *status, | 473 | int __user *status, |
| @@ -481,20 +497,20 @@ asmlinkage long compat_sys_statfs64(const char __user *pathname, | |||
| 481 | asmlinkage long compat_sys_fstatfs64(unsigned int fd, compat_size_t sz, | 497 | asmlinkage long compat_sys_fstatfs64(unsigned int fd, compat_size_t sz, |
| 482 | struct compat_statfs64 __user *buf); | 498 | struct compat_statfs64 __user *buf); |
| 483 | asmlinkage long compat_sys_fcntl64(unsigned int fd, unsigned int cmd, | 499 | asmlinkage long compat_sys_fcntl64(unsigned int fd, unsigned int cmd, |
| 484 | unsigned long arg); | 500 | compat_ulong_t arg); |
| 485 | asmlinkage long compat_sys_fcntl(unsigned int fd, unsigned int cmd, | 501 | asmlinkage long compat_sys_fcntl(unsigned int fd, unsigned int cmd, |
| 486 | unsigned long arg); | 502 | compat_ulong_t arg); |
| 487 | asmlinkage long compat_sys_io_setup(unsigned nr_reqs, u32 __user *ctx32p); | 503 | asmlinkage long compat_sys_io_setup(unsigned nr_reqs, u32 __user *ctx32p); |
| 488 | asmlinkage long compat_sys_io_getevents(aio_context_t ctx_id, | 504 | asmlinkage long compat_sys_io_getevents(compat_aio_context_t ctx_id, |
| 489 | unsigned long min_nr, | 505 | compat_long_t min_nr, |
| 490 | unsigned long nr, | 506 | compat_long_t nr, |
| 491 | struct io_event __user *events, | 507 | struct io_event __user *events, |
| 492 | struct compat_timespec __user *timeout); | 508 | struct compat_timespec __user *timeout); |
| 493 | asmlinkage long compat_sys_io_submit(aio_context_t ctx_id, int nr, | 509 | asmlinkage long compat_sys_io_submit(compat_aio_context_t ctx_id, int nr, |
| 494 | u32 __user *iocb); | 510 | u32 __user *iocb); |
| 495 | asmlinkage long compat_sys_mount(const char __user *dev_name, | 511 | asmlinkage long compat_sys_mount(const char __user *dev_name, |
| 496 | const char __user *dir_name, | 512 | const char __user *dir_name, |
| 497 | const char __user *type, unsigned long flags, | 513 | const char __user *type, compat_ulong_t flags, |
| 498 | const void __user *data); | 514 | const void __user *data); |
| 499 | asmlinkage long compat_sys_old_readdir(unsigned int fd, | 515 | asmlinkage long compat_sys_old_readdir(unsigned int fd, |
| 500 | struct compat_old_linux_dirent __user *, | 516 | struct compat_old_linux_dirent __user *, |
| @@ -502,9 +518,11 @@ asmlinkage long compat_sys_old_readdir(unsigned int fd, | |||
| 502 | asmlinkage long compat_sys_getdents(unsigned int fd, | 518 | asmlinkage long compat_sys_getdents(unsigned int fd, |
| 503 | struct compat_linux_dirent __user *dirent, | 519 | struct compat_linux_dirent __user *dirent, |
| 504 | unsigned int count); | 520 | unsigned int count); |
| 521 | #ifdef __ARCH_WANT_COMPAT_SYS_GETDENTS64 | ||
| 505 | asmlinkage long compat_sys_getdents64(unsigned int fd, | 522 | asmlinkage long compat_sys_getdents64(unsigned int fd, |
| 506 | struct linux_dirent64 __user *dirent, | 523 | struct linux_dirent64 __user *dirent, |
| 507 | unsigned int count); | 524 | unsigned int count); |
| 525 | #endif | ||
| 508 | asmlinkage long compat_sys_vmsplice(int fd, const struct compat_iovec __user *, | 526 | asmlinkage long compat_sys_vmsplice(int fd, const struct compat_iovec __user *, |
| 509 | unsigned int nr_segs, unsigned int flags); | 527 | unsigned int nr_segs, unsigned int flags); |
| 510 | asmlinkage long compat_sys_open(const char __user *filename, int flags, | 528 | asmlinkage long compat_sys_open(const char __user *filename, int flags, |
| @@ -549,9 +567,9 @@ asmlinkage long compat_sys_sendmmsg(int fd, struct compat_mmsghdr __user *mmsg, | |||
| 549 | unsigned vlen, unsigned int flags); | 567 | unsigned vlen, unsigned int flags); |
| 550 | asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg, | 568 | asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg, |
| 551 | unsigned int flags); | 569 | unsigned int flags); |
| 552 | asmlinkage long compat_sys_recv(int fd, void __user *buf, size_t len, | 570 | asmlinkage long compat_sys_recv(int fd, void __user *buf, compat_size_t len, |
| 553 | unsigned flags); | 571 | unsigned flags); |
| 554 | asmlinkage long compat_sys_recvfrom(int fd, void __user *buf, size_t len, | 572 | asmlinkage long compat_sys_recvfrom(int fd, void __user *buf, compat_size_t len, |
| 555 | unsigned flags, struct sockaddr __user *addr, | 573 | unsigned flags, struct sockaddr __user *addr, |
| 556 | int __user *addrlen); | 574 | int __user *addrlen); |
| 557 | asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg, | 575 | asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg, |
| @@ -615,16 +633,16 @@ asmlinkage long compat_sys_rt_sigqueueinfo(compat_pid_t pid, int sig, | |||
| 615 | struct compat_siginfo __user *uinfo); | 633 | struct compat_siginfo __user *uinfo); |
| 616 | asmlinkage long compat_sys_sysinfo(struct compat_sysinfo __user *info); | 634 | asmlinkage long compat_sys_sysinfo(struct compat_sysinfo __user *info); |
| 617 | asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, | 635 | asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, |
| 618 | unsigned long arg); | 636 | compat_ulong_t arg); |
| 619 | asmlinkage long compat_sys_futex(u32 __user *uaddr, int op, u32 val, | 637 | asmlinkage long compat_sys_futex(u32 __user *uaddr, int op, u32 val, |
| 620 | struct compat_timespec __user *utime, u32 __user *uaddr2, | 638 | struct compat_timespec __user *utime, u32 __user *uaddr2, |
| 621 | u32 val3); | 639 | u32 val3); |
| 622 | asmlinkage long compat_sys_getsockopt(int fd, int level, int optname, | 640 | asmlinkage long compat_sys_getsockopt(int fd, int level, int optname, |
| 623 | char __user *optval, int __user *optlen); | 641 | char __user *optval, int __user *optlen); |
| 624 | asmlinkage long compat_sys_kexec_load(unsigned long entry, | 642 | asmlinkage long compat_sys_kexec_load(compat_ulong_t entry, |
| 625 | unsigned long nr_segments, | 643 | compat_ulong_t nr_segments, |
| 626 | struct compat_kexec_segment __user *, | 644 | struct compat_kexec_segment __user *, |
| 627 | unsigned long flags); | 645 | compat_ulong_t flags); |
| 628 | asmlinkage long compat_sys_mq_getsetattr(mqd_t mqdes, | 646 | asmlinkage long compat_sys_mq_getsetattr(mqd_t mqdes, |
| 629 | const struct compat_mq_attr __user *u_mqstat, | 647 | const struct compat_mq_attr __user *u_mqstat, |
| 630 | struct compat_mq_attr __user *u_omqstat); | 648 | struct compat_mq_attr __user *u_omqstat); |
| @@ -635,11 +653,11 @@ asmlinkage long compat_sys_mq_open(const char __user *u_name, | |||
| 635 | struct compat_mq_attr __user *u_attr); | 653 | struct compat_mq_attr __user *u_attr); |
| 636 | asmlinkage long compat_sys_mq_timedsend(mqd_t mqdes, | 654 | asmlinkage long compat_sys_mq_timedsend(mqd_t mqdes, |
| 637 | const char __user *u_msg_ptr, | 655 | const char __user *u_msg_ptr, |
| 638 | size_t msg_len, unsigned int msg_prio, | 656 | compat_size_t msg_len, unsigned int msg_prio, |
| 639 | const struct compat_timespec __user *u_abs_timeout); | 657 | const struct compat_timespec __user *u_abs_timeout); |
| 640 | asmlinkage ssize_t compat_sys_mq_timedreceive(mqd_t mqdes, | 658 | asmlinkage ssize_t compat_sys_mq_timedreceive(mqd_t mqdes, |
| 641 | char __user *u_msg_ptr, | 659 | char __user *u_msg_ptr, |
| 642 | size_t msg_len, unsigned int __user *u_msg_prio, | 660 | compat_size_t msg_len, unsigned int __user *u_msg_prio, |
| 643 | const struct compat_timespec __user *u_abs_timeout); | 661 | const struct compat_timespec __user *u_abs_timeout); |
| 644 | asmlinkage long compat_sys_socketcall(int call, u32 __user *args); | 662 | asmlinkage long compat_sys_socketcall(int call, u32 __user *args); |
| 645 | asmlinkage long compat_sys_sysctl(struct compat_sysctl_args __user *args); | 663 | asmlinkage long compat_sys_sysctl(struct compat_sysctl_args __user *args); |
| @@ -654,12 +672,12 @@ extern void __user *compat_alloc_user_space(unsigned long len); | |||
| 654 | 672 | ||
| 655 | asmlinkage ssize_t compat_sys_process_vm_readv(compat_pid_t pid, | 673 | asmlinkage ssize_t compat_sys_process_vm_readv(compat_pid_t pid, |
| 656 | const struct compat_iovec __user *lvec, | 674 | const struct compat_iovec __user *lvec, |
| 657 | unsigned long liovcnt, const struct compat_iovec __user *rvec, | 675 | compat_ulong_t liovcnt, const struct compat_iovec __user *rvec, |
| 658 | unsigned long riovcnt, unsigned long flags); | 676 | compat_ulong_t riovcnt, compat_ulong_t flags); |
| 659 | asmlinkage ssize_t compat_sys_process_vm_writev(compat_pid_t pid, | 677 | asmlinkage ssize_t compat_sys_process_vm_writev(compat_pid_t pid, |
| 660 | const struct compat_iovec __user *lvec, | 678 | const struct compat_iovec __user *lvec, |
| 661 | unsigned long liovcnt, const struct compat_iovec __user *rvec, | 679 | compat_ulong_t liovcnt, const struct compat_iovec __user *rvec, |
| 662 | unsigned long riovcnt, unsigned long flags); | 680 | compat_ulong_t riovcnt, compat_ulong_t flags); |
| 663 | 681 | ||
| 664 | asmlinkage long compat_sys_sendfile(int out_fd, int in_fd, | 682 | asmlinkage long compat_sys_sendfile(int out_fd, int in_fd, |
| 665 | compat_off_t __user *offset, compat_size_t count); | 683 | compat_off_t __user *offset, compat_size_t count); |
diff --git a/include/linux/connector.h b/include/linux/connector.h index b2b5a41b6a24..be9c4747d511 100644 --- a/include/linux/connector.h +++ b/include/linux/connector.h | |||
| @@ -71,7 +71,7 @@ struct cn_dev { | |||
| 71 | int cn_add_callback(struct cb_id *id, const char *name, | 71 | int cn_add_callback(struct cb_id *id, const char *name, |
| 72 | void (*callback)(struct cn_msg *, struct netlink_skb_parms *)); | 72 | void (*callback)(struct cn_msg *, struct netlink_skb_parms *)); |
| 73 | void cn_del_callback(struct cb_id *); | 73 | void cn_del_callback(struct cb_id *); |
| 74 | int cn_netlink_send(struct cn_msg *, u32, gfp_t); | 74 | int cn_netlink_send(struct cn_msg *msg, u32 portid, u32 group, gfp_t gfp_mask); |
| 75 | 75 | ||
| 76 | int cn_queue_add_callback(struct cn_queue_dev *dev, const char *name, | 76 | int cn_queue_add_callback(struct cn_queue_dev *dev, const char *name, |
| 77 | struct cb_id *id, | 77 | struct cb_id *id, |
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 03e235ad1bba..03e962e23eaf 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
| @@ -46,13 +46,6 @@ extern ssize_t arch_cpu_release(const char *, size_t); | |||
| 46 | #endif | 46 | #endif |
| 47 | struct notifier_block; | 47 | struct notifier_block; |
| 48 | 48 | ||
| 49 | #ifdef CONFIG_ARCH_HAS_CPU_AUTOPROBE | ||
| 50 | extern int arch_cpu_uevent(struct device *dev, struct kobj_uevent_env *env); | ||
| 51 | extern ssize_t arch_print_cpu_modalias(struct device *dev, | ||
| 52 | struct device_attribute *attr, | ||
| 53 | char *bufptr); | ||
| 54 | #endif | ||
| 55 | |||
| 56 | /* | 49 | /* |
| 57 | * CPU notifier priorities. | 50 | * CPU notifier priorities. |
| 58 | */ | 51 | */ |
diff --git a/include/linux/cpufeature.h b/include/linux/cpufeature.h new file mode 100644 index 000000000000..c4d4eb8ac9fe --- /dev/null +++ b/include/linux/cpufeature.h | |||
| @@ -0,0 +1,60 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2014 Linaro Ltd. <ard.biesheuvel@linaro.org> | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License version 2 as | ||
| 6 | * published by the Free Software Foundation. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef __LINUX_CPUFEATURE_H | ||
| 10 | #define __LINUX_CPUFEATURE_H | ||
| 11 | |||
| 12 | #ifdef CONFIG_GENERIC_CPU_AUTOPROBE | ||
| 13 | |||
| 14 | #include <linux/mod_devicetable.h> | ||
| 15 | #include <asm/cpufeature.h> | ||
| 16 | |||
| 17 | /* | ||
| 18 | * Macros imported from <asm/cpufeature.h>: | ||
| 19 | * - cpu_feature(x) ordinal value of feature called 'x' | ||
| 20 | * - cpu_have_feature(u32 n) whether feature #n is available | ||
| 21 | * - MAX_CPU_FEATURES upper bound for feature ordinal values | ||
| 22 | * Optional: | ||
| 23 | * - CPU_FEATURE_TYPEFMT format string fragment for printing the cpu type | ||
| 24 | * - CPU_FEATURE_TYPEVAL set of values matching the format string above | ||
| 25 | */ | ||
| 26 | |||
| 27 | #ifndef CPU_FEATURE_TYPEFMT | ||
| 28 | #define CPU_FEATURE_TYPEFMT "%s" | ||
| 29 | #endif | ||
| 30 | |||
| 31 | #ifndef CPU_FEATURE_TYPEVAL | ||
| 32 | #define CPU_FEATURE_TYPEVAL ELF_PLATFORM | ||
| 33 | #endif | ||
| 34 | |||
| 35 | /* | ||
| 36 | * Use module_cpu_feature_match(feature, module_init_function) to | ||
| 37 | * declare that | ||
| 38 | * a) the module shall be probed upon discovery of CPU feature 'feature' | ||
| 39 | * (typically at boot time using udev) | ||
| 40 | * b) the module must not be loaded if CPU feature 'feature' is not present | ||
| 41 | * (not even by manual insmod). | ||
| 42 | * | ||
| 43 | * For a list of legal values for 'feature', please consult the file | ||
| 44 | * 'asm/cpufeature.h' of your favorite architecture. | ||
| 45 | */ | ||
| 46 | #define module_cpu_feature_match(x, __init) \ | ||
| 47 | static struct cpu_feature const cpu_feature_match_ ## x[] = \ | ||
| 48 | { { .feature = cpu_feature(x) }, { } }; \ | ||
| 49 | MODULE_DEVICE_TABLE(cpu, cpu_feature_match_ ## x); \ | ||
| 50 | \ | ||
| 51 | static int cpu_feature_match_ ## x ## _init(void) \ | ||
| 52 | { \ | ||
| 53 | if (!cpu_have_feature(cpu_feature(x))) \ | ||
| 54 | return -ENODEV; \ | ||
| 55 | return __init(); \ | ||
| 56 | } \ | ||
| 57 | module_init(cpu_feature_match_ ## x ## _init) | ||
| 58 | |||
| 59 | #endif | ||
| 60 | #endif | ||
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 4d89e0e6f9cc..c48e595f623e 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/completion.h> | 16 | #include <linux/completion.h> |
| 17 | #include <linux/kobject.h> | 17 | #include <linux/kobject.h> |
| 18 | #include <linux/notifier.h> | 18 | #include <linux/notifier.h> |
| 19 | #include <linux/spinlock.h> | ||
| 19 | #include <linux/sysfs.h> | 20 | #include <linux/sysfs.h> |
| 20 | 21 | ||
| 21 | /********************************************************************* | 22 | /********************************************************************* |
| @@ -74,6 +75,8 @@ struct cpufreq_policy { | |||
| 74 | unsigned int max; /* in kHz */ | 75 | unsigned int max; /* in kHz */ |
| 75 | unsigned int cur; /* in kHz, only needed if cpufreq | 76 | unsigned int cur; /* in kHz, only needed if cpufreq |
| 76 | * governors are used */ | 77 | * governors are used */ |
| 78 | unsigned int suspend_freq; /* freq to set during suspend */ | ||
| 79 | |||
| 77 | unsigned int policy; /* see above */ | 80 | unsigned int policy; /* see above */ |
| 78 | struct cpufreq_governor *governor; /* see below */ | 81 | struct cpufreq_governor *governor; /* see below */ |
| 79 | void *governor_data; | 82 | void *governor_data; |
| @@ -83,6 +86,7 @@ struct cpufreq_policy { | |||
| 83 | * called, but you're in IRQ context */ | 86 | * called, but you're in IRQ context */ |
| 84 | 87 | ||
| 85 | struct cpufreq_real_policy user_policy; | 88 | struct cpufreq_real_policy user_policy; |
| 89 | struct cpufreq_frequency_table *freq_table; | ||
| 86 | 90 | ||
| 87 | struct list_head policy_list; | 91 | struct list_head policy_list; |
| 88 | struct kobject kobj; | 92 | struct kobject kobj; |
| @@ -101,6 +105,11 @@ struct cpufreq_policy { | |||
| 101 | * __cpufreq_governor(data, CPUFREQ_GOV_POLICY_EXIT); | 105 | * __cpufreq_governor(data, CPUFREQ_GOV_POLICY_EXIT); |
| 102 | */ | 106 | */ |
| 103 | struct rw_semaphore rwsem; | 107 | struct rw_semaphore rwsem; |
| 108 | |||
| 109 | /* Synchronization for frequency transitions */ | ||
| 110 | bool transition_ongoing; /* Tracks transition status */ | ||
| 111 | spinlock_t transition_lock; | ||
| 112 | wait_queue_head_t transition_wait; | ||
| 104 | }; | 113 | }; |
| 105 | 114 | ||
| 106 | /* Only for ACPI */ | 115 | /* Only for ACPI */ |
| @@ -224,6 +233,7 @@ struct cpufreq_driver { | |||
| 224 | int (*bios_limit) (int cpu, unsigned int *limit); | 233 | int (*bios_limit) (int cpu, unsigned int *limit); |
| 225 | 234 | ||
| 226 | int (*exit) (struct cpufreq_policy *policy); | 235 | int (*exit) (struct cpufreq_policy *policy); |
| 236 | void (*stop_cpu) (struct cpufreq_policy *policy); | ||
| 227 | int (*suspend) (struct cpufreq_policy *policy); | 237 | int (*suspend) (struct cpufreq_policy *policy); |
| 228 | int (*resume) (struct cpufreq_policy *policy); | 238 | int (*resume) (struct cpufreq_policy *policy); |
| 229 | struct freq_attr **attr; | 239 | struct freq_attr **attr; |
| @@ -296,6 +306,15 @@ cpufreq_verify_within_cpu_limits(struct cpufreq_policy *policy) | |||
| 296 | policy->cpuinfo.max_freq); | 306 | policy->cpuinfo.max_freq); |
| 297 | } | 307 | } |
| 298 | 308 | ||
| 309 | #ifdef CONFIG_CPU_FREQ | ||
| 310 | void cpufreq_suspend(void); | ||
| 311 | void cpufreq_resume(void); | ||
| 312 | int cpufreq_generic_suspend(struct cpufreq_policy *policy); | ||
| 313 | #else | ||
| 314 | static inline void cpufreq_suspend(void) {} | ||
| 315 | static inline void cpufreq_resume(void) {} | ||
| 316 | #endif | ||
| 317 | |||
| 299 | /********************************************************************* | 318 | /********************************************************************* |
| 300 | * CPUFREQ NOTIFIER INTERFACE * | 319 | * CPUFREQ NOTIFIER INTERFACE * |
| 301 | *********************************************************************/ | 320 | *********************************************************************/ |
| @@ -306,8 +325,6 @@ cpufreq_verify_within_cpu_limits(struct cpufreq_policy *policy) | |||
| 306 | /* Transition notifiers */ | 325 | /* Transition notifiers */ |
| 307 | #define CPUFREQ_PRECHANGE (0) | 326 | #define CPUFREQ_PRECHANGE (0) |
| 308 | #define CPUFREQ_POSTCHANGE (1) | 327 | #define CPUFREQ_POSTCHANGE (1) |
| 309 | #define CPUFREQ_RESUMECHANGE (8) | ||
| 310 | #define CPUFREQ_SUSPENDCHANGE (9) | ||
| 311 | 328 | ||
| 312 | /* Policy Notifiers */ | 329 | /* Policy Notifiers */ |
| 313 | #define CPUFREQ_ADJUST (0) | 330 | #define CPUFREQ_ADJUST (0) |
| @@ -322,9 +339,9 @@ cpufreq_verify_within_cpu_limits(struct cpufreq_policy *policy) | |||
| 322 | int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list); | 339 | int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list); |
| 323 | int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list); | 340 | int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list); |
| 324 | 341 | ||
| 325 | void cpufreq_notify_transition(struct cpufreq_policy *policy, | 342 | void cpufreq_freq_transition_begin(struct cpufreq_policy *policy, |
| 326 | struct cpufreq_freqs *freqs, unsigned int state); | 343 | struct cpufreq_freqs *freqs); |
| 327 | void cpufreq_notify_post_transition(struct cpufreq_policy *policy, | 344 | void cpufreq_freq_transition_end(struct cpufreq_policy *policy, |
| 328 | struct cpufreq_freqs *freqs, int transition_failed); | 345 | struct cpufreq_freqs *freqs, int transition_failed); |
| 329 | 346 | ||
| 330 | #else /* CONFIG_CPU_FREQ */ | 347 | #else /* CONFIG_CPU_FREQ */ |
| @@ -463,7 +480,6 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy, | |||
| 463 | int cpufreq_frequency_table_get_index(struct cpufreq_policy *policy, | 480 | int cpufreq_frequency_table_get_index(struct cpufreq_policy *policy, |
| 464 | unsigned int freq); | 481 | unsigned int freq); |
| 465 | 482 | ||
| 466 | void cpufreq_frequency_table_update_policy_cpu(struct cpufreq_policy *policy); | ||
| 467 | ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf); | 483 | ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf); |
| 468 | 484 | ||
| 469 | #ifdef CONFIG_CPU_FREQ | 485 | #ifdef CONFIG_CPU_FREQ |
| @@ -490,9 +506,6 @@ struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu); | |||
| 490 | /* the following are really really optional */ | 506 | /* the following are really really optional */ |
| 491 | extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs; | 507 | extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs; |
| 492 | extern struct freq_attr *cpufreq_generic_attr[]; | 508 | extern struct freq_attr *cpufreq_generic_attr[]; |
| 493 | void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table, | ||
| 494 | unsigned int cpu); | ||
| 495 | void cpufreq_frequency_table_put_attr(unsigned int cpu); | ||
| 496 | int cpufreq_table_validate_and_show(struct cpufreq_policy *policy, | 509 | int cpufreq_table_validate_and_show(struct cpufreq_policy *policy, |
| 497 | struct cpufreq_frequency_table *table); | 510 | struct cpufreq_frequency_table *table); |
| 498 | 511 | ||
| @@ -500,10 +513,4 @@ unsigned int cpufreq_generic_get(unsigned int cpu); | |||
| 500 | int cpufreq_generic_init(struct cpufreq_policy *policy, | 513 | int cpufreq_generic_init(struct cpufreq_policy *policy, |
| 501 | struct cpufreq_frequency_table *table, | 514 | struct cpufreq_frequency_table *table, |
| 502 | unsigned int transition_latency); | 515 | unsigned int transition_latency); |
| 503 | static inline int cpufreq_generic_exit(struct cpufreq_policy *policy) | ||
| 504 | { | ||
| 505 | cpufreq_frequency_table_put_attr(policy->cpu); | ||
| 506 | return 0; | ||
| 507 | } | ||
| 508 | |||
| 509 | #endif /* _LINUX_CPUFREQ_H */ | 516 | #endif /* _LINUX_CPUFREQ_H */ |
diff --git a/include/linux/cputime.h b/include/linux/cputime.h new file mode 100644 index 000000000000..f2eb2ee535ca --- /dev/null +++ b/include/linux/cputime.h | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | #ifndef __LINUX_CPUTIME_H | ||
| 2 | #define __LINUX_CPUTIME_H | ||
| 3 | |||
| 4 | #include <asm/cputime.h> | ||
| 5 | |||
| 6 | #ifndef cputime_to_nsecs | ||
| 7 | # define cputime_to_nsecs(__ct) \ | ||
| 8 | (cputime_to_usecs(__ct) * NSEC_PER_USEC) | ||
| 9 | #endif | ||
| 10 | |||
| 11 | #ifndef nsecs_to_cputime | ||
| 12 | # define nsecs_to_cputime(__nsecs) \ | ||
| 13 | usecs_to_cputime((__nsecs) / NSEC_PER_USEC) | ||
| 14 | #endif | ||
| 15 | |||
| 16 | #endif /* __LINUX_CPUTIME_H */ | ||
diff --git a/include/linux/device.h b/include/linux/device.h index 952b01033c32..233bbbeb768d 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -560,6 +560,8 @@ extern int device_create_file(struct device *device, | |||
| 560 | const struct device_attribute *entry); | 560 | const struct device_attribute *entry); |
| 561 | extern void device_remove_file(struct device *dev, | 561 | extern void device_remove_file(struct device *dev, |
| 562 | const struct device_attribute *attr); | 562 | const struct device_attribute *attr); |
| 563 | extern bool device_remove_file_self(struct device *dev, | ||
| 564 | const struct device_attribute *attr); | ||
| 563 | extern int __must_check device_create_bin_file(struct device *dev, | 565 | extern int __must_check device_create_bin_file(struct device *dev, |
| 564 | const struct bin_attribute *attr); | 566 | const struct bin_attribute *attr); |
| 565 | extern void device_remove_bin_file(struct device *dev, | 567 | extern void device_remove_bin_file(struct device *dev, |
| @@ -626,6 +628,7 @@ static inline void *devm_kcalloc(struct device *dev, | |||
| 626 | return devm_kmalloc_array(dev, n, size, flags | __GFP_ZERO); | 628 | return devm_kmalloc_array(dev, n, size, flags | __GFP_ZERO); |
| 627 | } | 629 | } |
| 628 | extern void devm_kfree(struct device *dev, void *p); | 630 | extern void devm_kfree(struct device *dev, void *p); |
| 631 | extern char *devm_kstrdup(struct device *dev, const char *s, gfp_t gfp); | ||
| 629 | 632 | ||
| 630 | void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res); | 633 | void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res); |
| 631 | void __iomem *devm_request_and_ioremap(struct device *dev, | 634 | void __iomem *devm_request_and_ioremap(struct device *dev, |
diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h index dfac5ed31120..f886985a28b2 100644 --- a/include/linux/dma-buf.h +++ b/include/linux/dma-buf.h | |||
| @@ -171,7 +171,7 @@ struct dma_buf *dma_buf_export_named(void *priv, const struct dma_buf_ops *ops, | |||
| 171 | size_t size, int flags, const char *); | 171 | size_t size, int flags, const char *); |
| 172 | 172 | ||
| 173 | #define dma_buf_export(priv, ops, size, flags) \ | 173 | #define dma_buf_export(priv, ops, size, flags) \ |
| 174 | dma_buf_export_named(priv, ops, size, flags, __FILE__) | 174 | dma_buf_export_named(priv, ops, size, flags, KBUILD_MODNAME) |
| 175 | 175 | ||
| 176 | int dma_buf_fd(struct dma_buf *dmabuf, int flags); | 176 | int dma_buf_fd(struct dma_buf *dmabuf, int flags); |
| 177 | struct dma_buf *dma_buf_get(int fd); | 177 | struct dma_buf *dma_buf_get(int fd); |
diff --git a/include/linux/drbd.h b/include/linux/drbd.h index de7d74ab3de6..3dbe9bd57a09 100644 --- a/include/linux/drbd.h +++ b/include/linux/drbd.h | |||
| @@ -327,12 +327,6 @@ enum drbd_state_rv { | |||
| 327 | SS_AFTER_LAST_ERROR = -22, /* Keep this at bottom */ | 327 | SS_AFTER_LAST_ERROR = -22, /* Keep this at bottom */ |
| 328 | }; | 328 | }; |
| 329 | 329 | ||
| 330 | /* from drbd_strings.c */ | ||
| 331 | extern const char *drbd_conn_str(enum drbd_conns); | ||
| 332 | extern const char *drbd_role_str(enum drbd_role); | ||
| 333 | extern const char *drbd_disk_str(enum drbd_disk_state); | ||
| 334 | extern const char *drbd_set_st_err_str(enum drbd_state_rv); | ||
| 335 | |||
| 336 | #define SHARED_SECRET_MAX 64 | 330 | #define SHARED_SECRET_MAX 64 |
| 337 | 331 | ||
| 338 | #define MDF_CONSISTENT (1 << 0) | 332 | #define MDF_CONSISTENT (1 << 0) |
| @@ -382,4 +376,6 @@ enum drbd_timeout_flag { | |||
| 382 | #define DRBD_MD_INDEX_FLEX_EXT -2 | 376 | #define DRBD_MD_INDEX_FLEX_EXT -2 |
| 383 | #define DRBD_MD_INDEX_FLEX_INT -3 | 377 | #define DRBD_MD_INDEX_FLEX_INT -3 |
| 384 | 378 | ||
| 379 | #define DRBD_CPU_MASK_SIZE 32 | ||
| 380 | |||
| 385 | #endif | 381 | #endif |
diff --git a/include/linux/drbd_genl.h b/include/linux/drbd_genl.h index e8c44572b8cb..4193f5f2636c 100644 --- a/include/linux/drbd_genl.h +++ b/include/linux/drbd_genl.h | |||
| @@ -135,7 +135,7 @@ GENL_struct(DRBD_NLA_DISK_CONF, 3, disk_conf, | |||
| 135 | ) | 135 | ) |
| 136 | 136 | ||
| 137 | GENL_struct(DRBD_NLA_RESOURCE_OPTS, 4, res_opts, | 137 | GENL_struct(DRBD_NLA_RESOURCE_OPTS, 4, res_opts, |
| 138 | __str_field_def(1, DRBD_GENLA_F_MANDATORY, cpu_mask, 32) | 138 | __str_field_def(1, DRBD_GENLA_F_MANDATORY, cpu_mask, DRBD_CPU_MASK_SIZE) |
| 139 | __u32_field_def(2, DRBD_GENLA_F_MANDATORY, on_no_data, DRBD_ON_NO_DATA_DEF) | 139 | __u32_field_def(2, DRBD_GENLA_F_MANDATORY, on_no_data, DRBD_ON_NO_DATA_DEF) |
| 140 | ) | 140 | ) |
| 141 | 141 | ||
| @@ -276,9 +276,9 @@ GENL_op( | |||
| 276 | ) | 276 | ) |
| 277 | 277 | ||
| 278 | /* add DRBD minor devices as volumes to resources */ | 278 | /* add DRBD minor devices as volumes to resources */ |
| 279 | GENL_op(DRBD_ADM_NEW_MINOR, 5, GENL_doit(drbd_adm_add_minor), | 279 | GENL_op(DRBD_ADM_NEW_MINOR, 5, GENL_doit(drbd_adm_new_minor), |
| 280 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)) | 280 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)) |
| 281 | GENL_op(DRBD_ADM_DEL_MINOR, 6, GENL_doit(drbd_adm_delete_minor), | 281 | GENL_op(DRBD_ADM_DEL_MINOR, 6, GENL_doit(drbd_adm_del_minor), |
| 282 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)) | 282 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)) |
| 283 | 283 | ||
| 284 | /* add or delete resources */ | 284 | /* add or delete resources */ |
diff --git a/include/linux/efi.h b/include/linux/efi.h index 0a819e7a60c9..6c100ff0cae4 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
| @@ -153,6 +153,102 @@ typedef struct { | |||
| 153 | u8 sets_to_zero; | 153 | u8 sets_to_zero; |
| 154 | } efi_time_cap_t; | 154 | } efi_time_cap_t; |
| 155 | 155 | ||
| 156 | typedef struct { | ||
| 157 | efi_table_hdr_t hdr; | ||
| 158 | u32 raise_tpl; | ||
| 159 | u32 restore_tpl; | ||
| 160 | u32 allocate_pages; | ||
| 161 | u32 free_pages; | ||
| 162 | u32 get_memory_map; | ||
| 163 | u32 allocate_pool; | ||
| 164 | u32 free_pool; | ||
| 165 | u32 create_event; | ||
| 166 | u32 set_timer; | ||
| 167 | u32 wait_for_event; | ||
| 168 | u32 signal_event; | ||
| 169 | u32 close_event; | ||
| 170 | u32 check_event; | ||
| 171 | u32 install_protocol_interface; | ||
| 172 | u32 reinstall_protocol_interface; | ||
| 173 | u32 uninstall_protocol_interface; | ||
| 174 | u32 handle_protocol; | ||
| 175 | u32 __reserved; | ||
| 176 | u32 register_protocol_notify; | ||
| 177 | u32 locate_handle; | ||
| 178 | u32 locate_device_path; | ||
| 179 | u32 install_configuration_table; | ||
| 180 | u32 load_image; | ||
| 181 | u32 start_image; | ||
| 182 | u32 exit; | ||
| 183 | u32 unload_image; | ||
| 184 | u32 exit_boot_services; | ||
| 185 | u32 get_next_monotonic_count; | ||
| 186 | u32 stall; | ||
| 187 | u32 set_watchdog_timer; | ||
| 188 | u32 connect_controller; | ||
| 189 | u32 disconnect_controller; | ||
| 190 | u32 open_protocol; | ||
| 191 | u32 close_protocol; | ||
| 192 | u32 open_protocol_information; | ||
| 193 | u32 protocols_per_handle; | ||
| 194 | u32 locate_handle_buffer; | ||
| 195 | u32 locate_protocol; | ||
| 196 | u32 install_multiple_protocol_interfaces; | ||
| 197 | u32 uninstall_multiple_protocol_interfaces; | ||
| 198 | u32 calculate_crc32; | ||
| 199 | u32 copy_mem; | ||
| 200 | u32 set_mem; | ||
| 201 | u32 create_event_ex; | ||
| 202 | } __packed efi_boot_services_32_t; | ||
| 203 | |||
| 204 | typedef struct { | ||
| 205 | efi_table_hdr_t hdr; | ||
| 206 | u64 raise_tpl; | ||
| 207 | u64 restore_tpl; | ||
| 208 | u64 allocate_pages; | ||
| 209 | u64 free_pages; | ||
| 210 | u64 get_memory_map; | ||
| 211 | u64 allocate_pool; | ||
| 212 | u64 free_pool; | ||
| 213 | u64 create_event; | ||
| 214 | u64 set_timer; | ||
| 215 | u64 wait_for_event; | ||
| 216 | u64 signal_event; | ||
| 217 | u64 close_event; | ||
| 218 | u64 check_event; | ||
| 219 | u64 install_protocol_interface; | ||
| 220 | u64 reinstall_protocol_interface; | ||
| 221 | u64 uninstall_protocol_interface; | ||
| 222 | u64 handle_protocol; | ||
| 223 | u64 __reserved; | ||
| 224 | u64 register_protocol_notify; | ||
| 225 | u64 locate_handle; | ||
| 226 | u64 locate_device_path; | ||
| 227 | u64 install_configuration_table; | ||
| 228 | u64 load_image; | ||
| 229 | u64 start_image; | ||
| 230 | u64 exit; | ||
| 231 | u64 unload_image; | ||
| 232 | u64 exit_boot_services; | ||
| 233 | u64 get_next_monotonic_count; | ||
| 234 | u64 stall; | ||
| 235 | u64 set_watchdog_timer; | ||
| 236 | u64 connect_controller; | ||
| 237 | u64 disconnect_controller; | ||
| 238 | u64 open_protocol; | ||
| 239 | u64 close_protocol; | ||
| 240 | u64 open_protocol_information; | ||
| 241 | u64 protocols_per_handle; | ||
| 242 | u64 locate_handle_buffer; | ||
| 243 | u64 locate_protocol; | ||
| 244 | u64 install_multiple_protocol_interfaces; | ||
| 245 | u64 uninstall_multiple_protocol_interfaces; | ||
| 246 | u64 calculate_crc32; | ||
| 247 | u64 copy_mem; | ||
| 248 | u64 set_mem; | ||
| 249 | u64 create_event_ex; | ||
| 250 | } __packed efi_boot_services_64_t; | ||
| 251 | |||
| 156 | /* | 252 | /* |
| 157 | * EFI Boot Services table | 253 | * EFI Boot Services table |
| 158 | */ | 254 | */ |
| @@ -231,6 +327,15 @@ typedef enum { | |||
| 231 | EfiPciIoAttributeOperationMaximum | 327 | EfiPciIoAttributeOperationMaximum |
| 232 | } EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION; | 328 | } EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION; |
| 233 | 329 | ||
| 330 | typedef struct { | ||
| 331 | u32 read; | ||
| 332 | u32 write; | ||
| 333 | } efi_pci_io_protocol_access_32_t; | ||
| 334 | |||
| 335 | typedef struct { | ||
| 336 | u64 read; | ||
| 337 | u64 write; | ||
| 338 | } efi_pci_io_protocol_access_64_t; | ||
| 234 | 339 | ||
| 235 | typedef struct { | 340 | typedef struct { |
| 236 | void *read; | 341 | void *read; |
| @@ -238,6 +343,46 @@ typedef struct { | |||
| 238 | } efi_pci_io_protocol_access_t; | 343 | } efi_pci_io_protocol_access_t; |
| 239 | 344 | ||
| 240 | typedef struct { | 345 | typedef struct { |
| 346 | u32 poll_mem; | ||
| 347 | u32 poll_io; | ||
| 348 | efi_pci_io_protocol_access_32_t mem; | ||
| 349 | efi_pci_io_protocol_access_32_t io; | ||
| 350 | efi_pci_io_protocol_access_32_t pci; | ||
| 351 | u32 copy_mem; | ||
| 352 | u32 map; | ||
| 353 | u32 unmap; | ||
| 354 | u32 allocate_buffer; | ||
| 355 | u32 free_buffer; | ||
| 356 | u32 flush; | ||
| 357 | u32 get_location; | ||
| 358 | u32 attributes; | ||
| 359 | u32 get_bar_attributes; | ||
| 360 | u32 set_bar_attributes; | ||
| 361 | uint64_t romsize; | ||
| 362 | void *romimage; | ||
| 363 | } efi_pci_io_protocol_32; | ||
| 364 | |||
| 365 | typedef struct { | ||
| 366 | u64 poll_mem; | ||
| 367 | u64 poll_io; | ||
| 368 | efi_pci_io_protocol_access_64_t mem; | ||
| 369 | efi_pci_io_protocol_access_64_t io; | ||
| 370 | efi_pci_io_protocol_access_64_t pci; | ||
| 371 | u64 copy_mem; | ||
| 372 | u64 map; | ||
| 373 | u64 unmap; | ||
| 374 | u64 allocate_buffer; | ||
| 375 | u64 free_buffer; | ||
| 376 | u64 flush; | ||
| 377 | u64 get_location; | ||
| 378 | u64 attributes; | ||
| 379 | u64 get_bar_attributes; | ||
| 380 | u64 set_bar_attributes; | ||
| 381 | uint64_t romsize; | ||
| 382 | void *romimage; | ||
| 383 | } efi_pci_io_protocol_64; | ||
| 384 | |||
| 385 | typedef struct { | ||
| 241 | void *poll_mem; | 386 | void *poll_mem; |
| 242 | void *poll_io; | 387 | void *poll_io; |
| 243 | efi_pci_io_protocol_access_t mem; | 388 | efi_pci_io_protocol_access_t mem; |
| @@ -292,6 +437,42 @@ typedef struct { | |||
| 292 | 437 | ||
| 293 | typedef struct { | 438 | typedef struct { |
| 294 | efi_table_hdr_t hdr; | 439 | efi_table_hdr_t hdr; |
| 440 | u32 get_time; | ||
| 441 | u32 set_time; | ||
| 442 | u32 get_wakeup_time; | ||
| 443 | u32 set_wakeup_time; | ||
| 444 | u32 set_virtual_address_map; | ||
| 445 | u32 convert_pointer; | ||
| 446 | u32 get_variable; | ||
| 447 | u32 get_next_variable; | ||
| 448 | u32 set_variable; | ||
| 449 | u32 get_next_high_mono_count; | ||
| 450 | u32 reset_system; | ||
| 451 | u32 update_capsule; | ||
| 452 | u32 query_capsule_caps; | ||
| 453 | u32 query_variable_info; | ||
| 454 | } efi_runtime_services_32_t; | ||
| 455 | |||
| 456 | typedef struct { | ||
| 457 | efi_table_hdr_t hdr; | ||
| 458 | u64 get_time; | ||
| 459 | u64 set_time; | ||
| 460 | u64 get_wakeup_time; | ||
| 461 | u64 set_wakeup_time; | ||
| 462 | u64 set_virtual_address_map; | ||
| 463 | u64 convert_pointer; | ||
| 464 | u64 get_variable; | ||
| 465 | u64 get_next_variable; | ||
| 466 | u64 set_variable; | ||
| 467 | u64 get_next_high_mono_count; | ||
| 468 | u64 reset_system; | ||
| 469 | u64 update_capsule; | ||
| 470 | u64 query_capsule_caps; | ||
| 471 | u64 query_variable_info; | ||
| 472 | } efi_runtime_services_64_t; | ||
| 473 | |||
| 474 | typedef struct { | ||
| 475 | efi_table_hdr_t hdr; | ||
| 295 | void *get_time; | 476 | void *get_time; |
| 296 | void *set_time; | 477 | void *set_time; |
| 297 | void *get_wakeup_time; | 478 | void *get_wakeup_time; |
| @@ -485,6 +666,38 @@ struct efi_memory_map { | |||
| 485 | 666 | ||
| 486 | typedef struct { | 667 | typedef struct { |
| 487 | u32 revision; | 668 | u32 revision; |
| 669 | u32 parent_handle; | ||
| 670 | u32 system_table; | ||
| 671 | u32 device_handle; | ||
| 672 | u32 file_path; | ||
| 673 | u32 reserved; | ||
| 674 | u32 load_options_size; | ||
| 675 | u32 load_options; | ||
| 676 | u32 image_base; | ||
| 677 | __aligned_u64 image_size; | ||
| 678 | unsigned int image_code_type; | ||
| 679 | unsigned int image_data_type; | ||
| 680 | unsigned long unload; | ||
| 681 | } efi_loaded_image_32_t; | ||
| 682 | |||
| 683 | typedef struct { | ||
| 684 | u32 revision; | ||
| 685 | u64 parent_handle; | ||
| 686 | u64 system_table; | ||
| 687 | u64 device_handle; | ||
| 688 | u64 file_path; | ||
| 689 | u64 reserved; | ||
| 690 | u32 load_options_size; | ||
| 691 | u64 load_options; | ||
| 692 | u64 image_base; | ||
| 693 | __aligned_u64 image_size; | ||
| 694 | unsigned int image_code_type; | ||
| 695 | unsigned int image_data_type; | ||
| 696 | unsigned long unload; | ||
| 697 | } efi_loaded_image_64_t; | ||
| 698 | |||
| 699 | typedef struct { | ||
| 700 | u32 revision; | ||
| 488 | void *parent_handle; | 701 | void *parent_handle; |
| 489 | efi_system_table_t *system_table; | 702 | efi_system_table_t *system_table; |
| 490 | void *device_handle; | 703 | void *device_handle; |
| @@ -511,6 +724,34 @@ typedef struct { | |||
| 511 | efi_char16_t filename[1]; | 724 | efi_char16_t filename[1]; |
| 512 | } efi_file_info_t; | 725 | } efi_file_info_t; |
| 513 | 726 | ||
| 727 | typedef struct { | ||
| 728 | u64 revision; | ||
| 729 | u32 open; | ||
| 730 | u32 close; | ||
| 731 | u32 delete; | ||
| 732 | u32 read; | ||
| 733 | u32 write; | ||
| 734 | u32 get_position; | ||
| 735 | u32 set_position; | ||
| 736 | u32 get_info; | ||
| 737 | u32 set_info; | ||
| 738 | u32 flush; | ||
| 739 | } efi_file_handle_32_t; | ||
| 740 | |||
| 741 | typedef struct { | ||
| 742 | u64 revision; | ||
| 743 | u64 open; | ||
| 744 | u64 close; | ||
| 745 | u64 delete; | ||
| 746 | u64 read; | ||
| 747 | u64 write; | ||
| 748 | u64 get_position; | ||
| 749 | u64 set_position; | ||
| 750 | u64 get_info; | ||
| 751 | u64 set_info; | ||
| 752 | u64 flush; | ||
| 753 | } efi_file_handle_64_t; | ||
| 754 | |||
| 514 | typedef struct _efi_file_handle { | 755 | typedef struct _efi_file_handle { |
| 515 | u64 revision; | 756 | u64 revision; |
| 516 | efi_status_t (*open)(struct _efi_file_handle *, | 757 | efi_status_t (*open)(struct _efi_file_handle *, |
| @@ -573,6 +814,7 @@ extern struct efi { | |||
| 573 | efi_reset_system_t *reset_system; | 814 | efi_reset_system_t *reset_system; |
| 574 | efi_set_virtual_address_map_t *set_virtual_address_map; | 815 | efi_set_virtual_address_map_t *set_virtual_address_map; |
| 575 | struct efi_memory_map *memmap; | 816 | struct efi_memory_map *memmap; |
| 817 | unsigned long flags; | ||
| 576 | } efi; | 818 | } efi; |
| 577 | 819 | ||
| 578 | static inline int | 820 | static inline int |
| @@ -659,18 +901,17 @@ extern int __init efi_setup_pcdp_console(char *); | |||
| 659 | #define EFI_ARCH_1 6 /* First arch-specific bit */ | 901 | #define EFI_ARCH_1 6 /* First arch-specific bit */ |
| 660 | 902 | ||
| 661 | #ifdef CONFIG_EFI | 903 | #ifdef CONFIG_EFI |
| 662 | # ifdef CONFIG_X86 | 904 | /* |
| 663 | extern int efi_enabled(int facility); | 905 | * Test whether the above EFI_* bits are enabled. |
| 664 | # else | 906 | */ |
| 665 | static inline int efi_enabled(int facility) | 907 | static inline bool efi_enabled(int feature) |
| 666 | { | 908 | { |
| 667 | return 1; | 909 | return test_bit(feature, &efi.flags) != 0; |
| 668 | } | 910 | } |
| 669 | # endif | ||
| 670 | #else | 911 | #else |
| 671 | static inline int efi_enabled(int facility) | 912 | static inline bool efi_enabled(int feature) |
| 672 | { | 913 | { |
| 673 | return 0; | 914 | return false; |
| 674 | } | 915 | } |
| 675 | #endif | 916 | #endif |
| 676 | 917 | ||
| @@ -809,6 +1050,17 @@ struct efivar_entry { | |||
| 809 | bool deleting; | 1050 | bool deleting; |
| 810 | }; | 1051 | }; |
| 811 | 1052 | ||
| 1053 | struct efi_simple_text_output_protocol_32 { | ||
| 1054 | u32 reset; | ||
| 1055 | u32 output_string; | ||
| 1056 | u32 test_string; | ||
| 1057 | }; | ||
| 1058 | |||
| 1059 | struct efi_simple_text_output_protocol_64 { | ||
| 1060 | u64 reset; | ||
| 1061 | u64 output_string; | ||
| 1062 | u64 test_string; | ||
| 1063 | }; | ||
| 812 | 1064 | ||
| 813 | struct efi_simple_text_output_protocol { | 1065 | struct efi_simple_text_output_protocol { |
| 814 | void *reset; | 1066 | void *reset; |
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 306dd8cd0b6f..df63bd3a8cf1 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
| @@ -202,17 +202,8 @@ enum { | |||
| 202 | #define rq_end_sector(rq) (blk_rq_pos(rq) + blk_rq_sectors(rq)) | 202 | #define rq_end_sector(rq) (blk_rq_pos(rq) + blk_rq_sectors(rq)) |
| 203 | #define rb_entry_rq(node) rb_entry((node), struct request, rb_node) | 203 | #define rb_entry_rq(node) rb_entry((node), struct request, rb_node) |
| 204 | 204 | ||
| 205 | /* | ||
| 206 | * Hack to reuse the csd.list list_head as the fifo time holder while | ||
| 207 | * the request is in the io scheduler. Saves an unsigned long in rq. | ||
| 208 | */ | ||
| 209 | #define rq_fifo_time(rq) ((unsigned long) (rq)->csd.list.next) | ||
| 210 | #define rq_set_fifo_time(rq,exp) ((rq)->csd.list.next = (void *) (exp)) | ||
| 211 | #define rq_entry_fifo(ptr) list_entry((ptr), struct request, queuelist) | 205 | #define rq_entry_fifo(ptr) list_entry((ptr), struct request, queuelist) |
| 212 | #define rq_fifo_clear(rq) do { \ | 206 | #define rq_fifo_clear(rq) list_del_init(&(rq)->queuelist) |
| 213 | list_del_init(&(rq)->queuelist); \ | ||
| 214 | INIT_LIST_HEAD(&(rq)->csd.list); \ | ||
| 215 | } while (0) | ||
| 216 | 207 | ||
| 217 | #else /* CONFIG_BLOCK */ | 208 | #else /* CONFIG_BLOCK */ |
| 218 | 209 | ||
diff --git a/include/linux/extcon.h b/include/linux/extcon.h index 21c59af1150b..f488145bb2d4 100644 --- a/include/linux/extcon.h +++ b/include/linux/extcon.h | |||
| @@ -240,6 +240,12 @@ extern int extcon_register_notifier(struct extcon_dev *edev, | |||
| 240 | struct notifier_block *nb); | 240 | struct notifier_block *nb); |
| 241 | extern int extcon_unregister_notifier(struct extcon_dev *edev, | 241 | extern int extcon_unregister_notifier(struct extcon_dev *edev, |
| 242 | struct notifier_block *nb); | 242 | struct notifier_block *nb); |
| 243 | |||
| 244 | /* | ||
| 245 | * Following API get the extcon device from devicetree. | ||
| 246 | * This function use phandle of devicetree to get extcon device directly. | ||
| 247 | */ | ||
| 248 | extern struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, int index); | ||
| 243 | #else /* CONFIG_EXTCON */ | 249 | #else /* CONFIG_EXTCON */ |
| 244 | static inline int extcon_dev_register(struct extcon_dev *edev) | 250 | static inline int extcon_dev_register(struct extcon_dev *edev) |
| 245 | { | 251 | { |
| @@ -324,5 +330,11 @@ static inline int extcon_unregister_interest(struct extcon_specific_cable_nb | |||
| 324 | { | 330 | { |
| 325 | return 0; | 331 | return 0; |
| 326 | } | 332 | } |
| 333 | |||
| 334 | static inline struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, | ||
| 335 | int index) | ||
| 336 | { | ||
| 337 | return ERR_PTR(-ENODEV); | ||
| 338 | } | ||
| 327 | #endif /* CONFIG_EXTCON */ | 339 | #endif /* CONFIG_EXTCON */ |
| 328 | #endif /* __LINUX_EXTCON_H__ */ | 340 | #endif /* __LINUX_EXTCON_H__ */ |
diff --git a/include/linux/extcon/of_extcon.h b/include/linux/extcon/of_extcon.h deleted file mode 100644 index 0ebfeff1b55d..000000000000 --- a/include/linux/extcon/of_extcon.h +++ /dev/null | |||
| @@ -1,31 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * OF helpers for External connector (extcon) framework | ||
| 3 | * | ||
| 4 | * Copyright (C) 2013 Texas Instruments, Inc. | ||
| 5 | * Kishon Vijay Abraham I <kishon@ti.com> | ||
| 6 | * | ||
| 7 | * Copyright (C) 2013 Samsung Electronics | ||
| 8 | * Chanwoo Choi <cw00.choi@samsung.com> | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of the GNU General Public License as published by | ||
| 12 | * the Free Software Foundation; either version 2 of the License, or | ||
| 13 | * (at your option) any later version. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #ifndef __LINUX_OF_EXTCON_H | ||
| 17 | #define __LINUX_OF_EXTCON_H | ||
| 18 | |||
| 19 | #include <linux/err.h> | ||
| 20 | |||
| 21 | #if IS_ENABLED(CONFIG_OF_EXTCON) | ||
| 22 | extern struct extcon_dev | ||
| 23 | *of_extcon_get_extcon_dev(struct device *dev, int index); | ||
| 24 | #else | ||
| 25 | static inline struct extcon_dev | ||
| 26 | *of_extcon_get_extcon_dev(struct device *dev, int index) | ||
| 27 | { | ||
| 28 | return ERR_PTR(-ENOSYS); | ||
| 29 | } | ||
| 30 | #endif /* CONFIG_OF_EXTCON */ | ||
| 31 | #endif /* __LINUX_OF_EXTCON_H */ | ||
diff --git a/include/linux/file.h b/include/linux/file.h index cbacf4faf447..4d69123377a2 100644 --- a/include/linux/file.h +++ b/include/linux/file.h | |||
| @@ -28,33 +28,36 @@ static inline void fput_light(struct file *file, int fput_needed) | |||
| 28 | 28 | ||
| 29 | struct fd { | 29 | struct fd { |
| 30 | struct file *file; | 30 | struct file *file; |
| 31 | int need_put; | 31 | unsigned int flags; |
| 32 | }; | 32 | }; |
| 33 | #define FDPUT_FPUT 1 | ||
| 34 | #define FDPUT_POS_UNLOCK 2 | ||
| 33 | 35 | ||
| 34 | static inline void fdput(struct fd fd) | 36 | static inline void fdput(struct fd fd) |
| 35 | { | 37 | { |
| 36 | if (fd.need_put) | 38 | if (fd.flags & FDPUT_FPUT) |
| 37 | fput(fd.file); | 39 | fput(fd.file); |
| 38 | } | 40 | } |
| 39 | 41 | ||
| 40 | extern struct file *fget(unsigned int fd); | 42 | extern struct file *fget(unsigned int fd); |
| 41 | extern struct file *fget_light(unsigned int fd, int *fput_needed); | 43 | extern struct file *fget_raw(unsigned int fd); |
| 44 | extern unsigned long __fdget(unsigned int fd); | ||
| 45 | extern unsigned long __fdget_raw(unsigned int fd); | ||
| 46 | extern unsigned long __fdget_pos(unsigned int fd); | ||
| 42 | 47 | ||
| 43 | static inline struct fd fdget(unsigned int fd) | 48 | static inline struct fd __to_fd(unsigned long v) |
| 44 | { | 49 | { |
| 45 | int b; | 50 | return (struct fd){(struct file *)(v & ~3),v & 3}; |
| 46 | struct file *f = fget_light(fd, &b); | ||
| 47 | return (struct fd){f,b}; | ||
| 48 | } | 51 | } |
| 49 | 52 | ||
| 50 | extern struct file *fget_raw(unsigned int fd); | 53 | static inline struct fd fdget(unsigned int fd) |
| 51 | extern struct file *fget_raw_light(unsigned int fd, int *fput_needed); | 54 | { |
| 55 | return __to_fd(__fdget(fd)); | ||
| 56 | } | ||
| 52 | 57 | ||
| 53 | static inline struct fd fdget_raw(unsigned int fd) | 58 | static inline struct fd fdget_raw(unsigned int fd) |
| 54 | { | 59 | { |
| 55 | int b; | 60 | return __to_fd(__fdget_raw(fd)); |
| 56 | struct file *f = fget_raw_light(fd, &b); | ||
| 57 | return (struct fd){f,b}; | ||
| 58 | } | 61 | } |
| 59 | 62 | ||
| 60 | extern int f_dupfd(unsigned int from, struct file *file, unsigned flags); | 63 | extern int f_dupfd(unsigned int from, struct file *file, unsigned flags); |
diff --git a/include/linux/firewire.h b/include/linux/firewire.h index 5d7782e42b8f..c3683bdf28fe 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h | |||
| @@ -200,6 +200,7 @@ struct fw_device { | |||
| 200 | unsigned irmc:1; | 200 | unsigned irmc:1; |
| 201 | unsigned bc_implemented:2; | 201 | unsigned bc_implemented:2; |
| 202 | 202 | ||
| 203 | work_func_t workfn; | ||
| 203 | struct delayed_work work; | 204 | struct delayed_work work; |
| 204 | struct fw_attribute_group attribute_group; | 205 | struct fw_attribute_group attribute_group; |
| 205 | }; | 206 | }; |
diff --git a/include/linux/fmc-sdb.h b/include/linux/fmc-sdb.h index 1974317a9b3d..599bd6bab56d 100644 --- a/include/linux/fmc-sdb.h +++ b/include/linux/fmc-sdb.h | |||
| @@ -14,6 +14,8 @@ union sdb_record { | |||
| 14 | struct sdb_bridge bridge; | 14 | struct sdb_bridge bridge; |
| 15 | struct sdb_integration integr; | 15 | struct sdb_integration integr; |
| 16 | struct sdb_empty empty; | 16 | struct sdb_empty empty; |
| 17 | struct sdb_synthesis synthesis; | ||
| 18 | struct sdb_repo_url repo_url; | ||
| 17 | }; | 19 | }; |
| 18 | 20 | ||
| 19 | struct fmc_device; | 21 | struct fmc_device; |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 60829565e552..23b2a35d712e 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -123,6 +123,9 @@ typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, | |||
| 123 | /* File is opened with O_PATH; almost nothing can be done with it */ | 123 | /* File is opened with O_PATH; almost nothing can be done with it */ |
| 124 | #define FMODE_PATH ((__force fmode_t)0x4000) | 124 | #define FMODE_PATH ((__force fmode_t)0x4000) |
| 125 | 125 | ||
| 126 | /* File needs atomic accesses to f_pos */ | ||
| 127 | #define FMODE_ATOMIC_POS ((__force fmode_t)0x8000) | ||
| 128 | |||
| 126 | /* File was opened by fanotify and shouldn't generate fanotify events */ | 129 | /* File was opened by fanotify and shouldn't generate fanotify events */ |
| 127 | #define FMODE_NONOTIFY ((__force fmode_t)0x1000000) | 130 | #define FMODE_NONOTIFY ((__force fmode_t)0x1000000) |
| 128 | 131 | ||
| @@ -780,13 +783,14 @@ struct file { | |||
| 780 | const struct file_operations *f_op; | 783 | const struct file_operations *f_op; |
| 781 | 784 | ||
| 782 | /* | 785 | /* |
| 783 | * Protects f_ep_links, f_flags, f_pos vs i_size in lseek SEEK_CUR. | 786 | * Protects f_ep_links, f_flags. |
| 784 | * Must not be taken from IRQ context. | 787 | * Must not be taken from IRQ context. |
| 785 | */ | 788 | */ |
| 786 | spinlock_t f_lock; | 789 | spinlock_t f_lock; |
| 787 | atomic_long_t f_count; | 790 | atomic_long_t f_count; |
| 788 | unsigned int f_flags; | 791 | unsigned int f_flags; |
| 789 | fmode_t f_mode; | 792 | fmode_t f_mode; |
| 793 | struct mutex f_pos_lock; | ||
| 790 | loff_t f_pos; | 794 | loff_t f_pos; |
| 791 | struct fown_struct f_owner; | 795 | struct fown_struct f_owner; |
| 792 | const struct cred *f_cred; | 796 | const struct cred *f_cred; |
| @@ -808,7 +812,7 @@ struct file { | |||
| 808 | #ifdef CONFIG_DEBUG_WRITECOUNT | 812 | #ifdef CONFIG_DEBUG_WRITECOUNT |
| 809 | unsigned long f_mnt_write_state; | 813 | unsigned long f_mnt_write_state; |
| 810 | #endif | 814 | #endif |
| 811 | }; | 815 | } __attribute__((aligned(4))); /* lest something weird decides that 2 is OK */ |
| 812 | 816 | ||
| 813 | struct file_handle { | 817 | struct file_handle { |
| 814 | __u32 handle_bytes; | 818 | __u32 handle_bytes; |
diff --git a/include/linux/fsl_ifc.h b/include/linux/fsl_ifc.h new file mode 100644 index 000000000000..f49ddb1b2273 --- /dev/null +++ b/include/linux/fsl_ifc.h | |||
| @@ -0,0 +1,838 @@ | |||
| 1 | /* Freescale Integrated Flash Controller | ||
| 2 | * | ||
| 3 | * Copyright 2011 Freescale Semiconductor, Inc | ||
| 4 | * | ||
| 5 | * Author: Dipen Dudhat <dipen.dudhat@freescale.com> | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with this program; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 20 | */ | ||
| 21 | |||
| 22 | #ifndef __ASM_FSL_IFC_H | ||
| 23 | #define __ASM_FSL_IFC_H | ||
| 24 | |||
| 25 | #include <linux/compiler.h> | ||
| 26 | #include <linux/types.h> | ||
| 27 | #include <linux/io.h> | ||
| 28 | |||
| 29 | #include <linux/of_platform.h> | ||
| 30 | #include <linux/interrupt.h> | ||
| 31 | |||
| 32 | #define FSL_IFC_BANK_COUNT 4 | ||
| 33 | |||
| 34 | /* | ||
| 35 | * CSPR - Chip Select Property Register | ||
| 36 | */ | ||
| 37 | #define CSPR_BA 0xFFFF0000 | ||
| 38 | #define CSPR_BA_SHIFT 16 | ||
| 39 | #define CSPR_PORT_SIZE 0x00000180 | ||
| 40 | #define CSPR_PORT_SIZE_SHIFT 7 | ||
| 41 | /* Port Size 8 bit */ | ||
| 42 | #define CSPR_PORT_SIZE_8 0x00000080 | ||
| 43 | /* Port Size 16 bit */ | ||
| 44 | #define CSPR_PORT_SIZE_16 0x00000100 | ||
| 45 | /* Port Size 32 bit */ | ||
| 46 | #define CSPR_PORT_SIZE_32 0x00000180 | ||
| 47 | /* Write Protect */ | ||
| 48 | #define CSPR_WP 0x00000040 | ||
| 49 | #define CSPR_WP_SHIFT 6 | ||
| 50 | /* Machine Select */ | ||
| 51 | #define CSPR_MSEL 0x00000006 | ||
| 52 | #define CSPR_MSEL_SHIFT 1 | ||
| 53 | /* NOR */ | ||
| 54 | #define CSPR_MSEL_NOR 0x00000000 | ||
| 55 | /* NAND */ | ||
| 56 | #define CSPR_MSEL_NAND 0x00000002 | ||
| 57 | /* GPCM */ | ||
| 58 | #define CSPR_MSEL_GPCM 0x00000004 | ||
| 59 | /* Bank Valid */ | ||
| 60 | #define CSPR_V 0x00000001 | ||
| 61 | #define CSPR_V_SHIFT 0 | ||
| 62 | |||
| 63 | /* | ||
| 64 | * Address Mask Register | ||
| 65 | */ | ||
| 66 | #define IFC_AMASK_MASK 0xFFFF0000 | ||
| 67 | #define IFC_AMASK_SHIFT 16 | ||
| 68 | #define IFC_AMASK(n) (IFC_AMASK_MASK << \ | ||
| 69 | (__ilog2(n) - IFC_AMASK_SHIFT)) | ||
| 70 | |||
| 71 | /* | ||
| 72 | * Chip Select Option Register IFC_NAND Machine | ||
| 73 | */ | ||
| 74 | /* Enable ECC Encoder */ | ||
| 75 | #define CSOR_NAND_ECC_ENC_EN 0x80000000 | ||
| 76 | #define CSOR_NAND_ECC_MODE_MASK 0x30000000 | ||
| 77 | /* 4 bit correction per 520 Byte sector */ | ||
| 78 | #define CSOR_NAND_ECC_MODE_4 0x00000000 | ||
| 79 | /* 8 bit correction per 528 Byte sector */ | ||
| 80 | #define CSOR_NAND_ECC_MODE_8 0x10000000 | ||
| 81 | /* Enable ECC Decoder */ | ||
| 82 | #define CSOR_NAND_ECC_DEC_EN 0x04000000 | ||
| 83 | /* Row Address Length */ | ||
| 84 | #define CSOR_NAND_RAL_MASK 0x01800000 | ||
| 85 | #define CSOR_NAND_RAL_SHIFT 20 | ||
| 86 | #define CSOR_NAND_RAL_1 0x00000000 | ||
| 87 | #define CSOR_NAND_RAL_2 0x00800000 | ||
| 88 | #define CSOR_NAND_RAL_3 0x01000000 | ||
| 89 | #define CSOR_NAND_RAL_4 0x01800000 | ||
| 90 | /* Page Size 512b, 2k, 4k */ | ||
| 91 | #define CSOR_NAND_PGS_MASK 0x00180000 | ||
| 92 | #define CSOR_NAND_PGS_SHIFT 16 | ||
| 93 | #define CSOR_NAND_PGS_512 0x00000000 | ||
| 94 | #define CSOR_NAND_PGS_2K 0x00080000 | ||
| 95 | #define CSOR_NAND_PGS_4K 0x00100000 | ||
| 96 | #define CSOR_NAND_PGS_8K 0x00180000 | ||
| 97 | /* Spare region Size */ | ||
| 98 | #define CSOR_NAND_SPRZ_MASK 0x0000E000 | ||
| 99 | #define CSOR_NAND_SPRZ_SHIFT 13 | ||
| 100 | #define CSOR_NAND_SPRZ_16 0x00000000 | ||
| 101 | #define CSOR_NAND_SPRZ_64 0x00002000 | ||
| 102 | #define CSOR_NAND_SPRZ_128 0x00004000 | ||
| 103 | #define CSOR_NAND_SPRZ_210 0x00006000 | ||
| 104 | #define CSOR_NAND_SPRZ_218 0x00008000 | ||
| 105 | #define CSOR_NAND_SPRZ_224 0x0000A000 | ||
| 106 | #define CSOR_NAND_SPRZ_CSOR_EXT 0x0000C000 | ||
| 107 | /* Pages Per Block */ | ||
| 108 | #define CSOR_NAND_PB_MASK 0x00000700 | ||
| 109 | #define CSOR_NAND_PB_SHIFT 8 | ||
| 110 | #define CSOR_NAND_PB(n) ((__ilog2(n) - 5) << CSOR_NAND_PB_SHIFT) | ||
| 111 | /* Time for Read Enable High to Output High Impedance */ | ||
| 112 | #define CSOR_NAND_TRHZ_MASK 0x0000001C | ||
| 113 | #define CSOR_NAND_TRHZ_SHIFT 2 | ||
| 114 | #define CSOR_NAND_TRHZ_20 0x00000000 | ||
| 115 | #define CSOR_NAND_TRHZ_40 0x00000004 | ||
| 116 | #define CSOR_NAND_TRHZ_60 0x00000008 | ||
| 117 | #define CSOR_NAND_TRHZ_80 0x0000000C | ||
| 118 | #define CSOR_NAND_TRHZ_100 0x00000010 | ||
| 119 | /* Buffer control disable */ | ||
| 120 | #define CSOR_NAND_BCTLD 0x00000001 | ||
| 121 | |||
| 122 | /* | ||
| 123 | * Chip Select Option Register - NOR Flash Mode | ||
| 124 | */ | ||
| 125 | /* Enable Address shift Mode */ | ||
| 126 | #define CSOR_NOR_ADM_SHFT_MODE_EN 0x80000000 | ||
| 127 | /* Page Read Enable from NOR device */ | ||
| 128 | #define CSOR_NOR_PGRD_EN 0x10000000 | ||
| 129 | /* AVD Toggle Enable during Burst Program */ | ||
| 130 | #define CSOR_NOR_AVD_TGL_PGM_EN 0x01000000 | ||
| 131 | /* Address Data Multiplexing Shift */ | ||
| 132 | #define CSOR_NOR_ADM_MASK 0x0003E000 | ||
| 133 | #define CSOR_NOR_ADM_SHIFT_SHIFT 13 | ||
| 134 | #define CSOR_NOR_ADM_SHIFT(n) ((n) << CSOR_NOR_ADM_SHIFT_SHIFT) | ||
| 135 | /* Type of the NOR device hooked */ | ||
| 136 | #define CSOR_NOR_NOR_MODE_AYSNC_NOR 0x00000000 | ||
| 137 | #define CSOR_NOR_NOR_MODE_AVD_NOR 0x00000020 | ||
| 138 | /* Time for Read Enable High to Output High Impedance */ | ||
| 139 | #define CSOR_NOR_TRHZ_MASK 0x0000001C | ||
| 140 | #define CSOR_NOR_TRHZ_SHIFT 2 | ||
| 141 | #define CSOR_NOR_TRHZ_20 0x00000000 | ||
| 142 | #define CSOR_NOR_TRHZ_40 0x00000004 | ||
| 143 | #define CSOR_NOR_TRHZ_60 0x00000008 | ||
| 144 | #define CSOR_NOR_TRHZ_80 0x0000000C | ||
| 145 | #define CSOR_NOR_TRHZ_100 0x00000010 | ||
| 146 | /* Buffer control disable */ | ||
| 147 | #define CSOR_NOR_BCTLD 0x00000001 | ||
| 148 | |||
| 149 | /* | ||
| 150 | * Chip Select Option Register - GPCM Mode | ||
| 151 | */ | ||
| 152 | /* GPCM Mode - Normal */ | ||
| 153 | #define CSOR_GPCM_GPMODE_NORMAL 0x00000000 | ||
| 154 | /* GPCM Mode - GenericASIC */ | ||
| 155 | #define CSOR_GPCM_GPMODE_ASIC 0x80000000 | ||
| 156 | /* Parity Mode odd/even */ | ||
| 157 | #define CSOR_GPCM_PARITY_EVEN 0x40000000 | ||
| 158 | /* Parity Checking enable/disable */ | ||
| 159 | #define CSOR_GPCM_PAR_EN 0x20000000 | ||
| 160 | /* GPCM Timeout Count */ | ||
| 161 | #define CSOR_GPCM_GPTO_MASK 0x0F000000 | ||
| 162 | #define CSOR_GPCM_GPTO_SHIFT 24 | ||
| 163 | #define CSOR_GPCM_GPTO(n) ((__ilog2(n) - 8) << CSOR_GPCM_GPTO_SHIFT) | ||
| 164 | /* GPCM External Access Termination mode for read access */ | ||
| 165 | #define CSOR_GPCM_RGETA_EXT 0x00080000 | ||
| 166 | /* GPCM External Access Termination mode for write access */ | ||
| 167 | #define CSOR_GPCM_WGETA_EXT 0x00040000 | ||
| 168 | /* Address Data Multiplexing Shift */ | ||
| 169 | #define CSOR_GPCM_ADM_MASK 0x0003E000 | ||
| 170 | #define CSOR_GPCM_ADM_SHIFT_SHIFT 13 | ||
| 171 | #define CSOR_GPCM_ADM_SHIFT(n) ((n) << CSOR_GPCM_ADM_SHIFT_SHIFT) | ||
| 172 | /* Generic ASIC Parity error indication delay */ | ||
| 173 | #define CSOR_GPCM_GAPERRD_MASK 0x00000180 | ||
| 174 | #define CSOR_GPCM_GAPERRD_SHIFT 7 | ||
| 175 | #define CSOR_GPCM_GAPERRD(n) (((n) - 1) << CSOR_GPCM_GAPERRD_SHIFT) | ||
| 176 | /* Time for Read Enable High to Output High Impedance */ | ||
| 177 | #define CSOR_GPCM_TRHZ_MASK 0x0000001C | ||
| 178 | #define CSOR_GPCM_TRHZ_20 0x00000000 | ||
| 179 | #define CSOR_GPCM_TRHZ_40 0x00000004 | ||
| 180 | #define CSOR_GPCM_TRHZ_60 0x00000008 | ||
| 181 | #define CSOR_GPCM_TRHZ_80 0x0000000C | ||
| 182 | #define CSOR_GPCM_TRHZ_100 0x00000010 | ||
| 183 | /* Buffer control disable */ | ||
| 184 | #define CSOR_GPCM_BCTLD 0x00000001 | ||
| 185 | |||
| 186 | /* | ||
| 187 | * Ready Busy Status Register (RB_STAT) | ||
| 188 | */ | ||
| 189 | /* CSn is READY */ | ||
| 190 | #define IFC_RB_STAT_READY_CS0 0x80000000 | ||
| 191 | #define IFC_RB_STAT_READY_CS1 0x40000000 | ||
| 192 | #define IFC_RB_STAT_READY_CS2 0x20000000 | ||
| 193 | #define IFC_RB_STAT_READY_CS3 0x10000000 | ||
| 194 | |||
| 195 | /* | ||
| 196 | * General Control Register (GCR) | ||
| 197 | */ | ||
| 198 | #define IFC_GCR_MASK 0x8000F800 | ||
| 199 | /* reset all IFC hardware */ | ||
| 200 | #define IFC_GCR_SOFT_RST_ALL 0x80000000 | ||
| 201 | /* Turnaroud Time of external buffer */ | ||
| 202 | #define IFC_GCR_TBCTL_TRN_TIME 0x0000F800 | ||
| 203 | #define IFC_GCR_TBCTL_TRN_TIME_SHIFT 11 | ||
| 204 | |||
| 205 | /* | ||
| 206 | * Common Event and Error Status Register (CM_EVTER_STAT) | ||
| 207 | */ | ||
| 208 | /* Chip select error */ | ||
| 209 | #define IFC_CM_EVTER_STAT_CSER 0x80000000 | ||
| 210 | |||
| 211 | /* | ||
| 212 | * Common Event and Error Enable Register (CM_EVTER_EN) | ||
| 213 | */ | ||
| 214 | /* Chip select error checking enable */ | ||
| 215 | #define IFC_CM_EVTER_EN_CSEREN 0x80000000 | ||
| 216 | |||
| 217 | /* | ||
| 218 | * Common Event and Error Interrupt Enable Register (CM_EVTER_INTR_EN) | ||
| 219 | */ | ||
| 220 | /* Chip select error interrupt enable */ | ||
| 221 | #define IFC_CM_EVTER_INTR_EN_CSERIREN 0x80000000 | ||
| 222 | |||
| 223 | /* | ||
| 224 | * Common Transfer Error Attribute Register-0 (CM_ERATTR0) | ||
| 225 | */ | ||
| 226 | /* transaction type of error Read/Write */ | ||
| 227 | #define IFC_CM_ERATTR0_ERTYP_READ 0x80000000 | ||
| 228 | #define IFC_CM_ERATTR0_ERAID 0x0FF00000 | ||
| 229 | #define IFC_CM_ERATTR0_ERAID_SHIFT 20 | ||
| 230 | #define IFC_CM_ERATTR0_ESRCID 0x0000FF00 | ||
| 231 | #define IFC_CM_ERATTR0_ESRCID_SHIFT 8 | ||
| 232 | |||
| 233 | /* | ||
| 234 | * Clock Control Register (CCR) | ||
| 235 | */ | ||
| 236 | #define IFC_CCR_MASK 0x0F0F8800 | ||
| 237 | /* Clock division ratio */ | ||
| 238 | #define IFC_CCR_CLK_DIV_MASK 0x0F000000 | ||
| 239 | #define IFC_CCR_CLK_DIV_SHIFT 24 | ||
| 240 | #define IFC_CCR_CLK_DIV(n) ((n-1) << IFC_CCR_CLK_DIV_SHIFT) | ||
| 241 | /* IFC Clock Delay */ | ||
| 242 | #define IFC_CCR_CLK_DLY_MASK 0x000F0000 | ||
| 243 | #define IFC_CCR_CLK_DLY_SHIFT 16 | ||
| 244 | #define IFC_CCR_CLK_DLY(n) ((n) << IFC_CCR_CLK_DLY_SHIFT) | ||
| 245 | /* Invert IFC clock before sending out */ | ||
| 246 | #define IFC_CCR_INV_CLK_EN 0x00008000 | ||
| 247 | /* Fedback IFC Clock */ | ||
| 248 | #define IFC_CCR_FB_IFC_CLK_SEL 0x00000800 | ||
| 249 | |||
| 250 | /* | ||
| 251 | * Clock Status Register (CSR) | ||
| 252 | */ | ||
| 253 | /* Clk is stable */ | ||
| 254 | #define IFC_CSR_CLK_STAT_STABLE 0x80000000 | ||
| 255 | |||
| 256 | /* | ||
| 257 | * IFC_NAND Machine Specific Registers | ||
| 258 | */ | ||
| 259 | /* | ||
| 260 | * NAND Configuration Register (NCFGR) | ||
| 261 | */ | ||
| 262 | /* Auto Boot Mode */ | ||
| 263 | #define IFC_NAND_NCFGR_BOOT 0x80000000 | ||
| 264 | /* Addressing Mode-ROW0+n/COL0 */ | ||
| 265 | #define IFC_NAND_NCFGR_ADDR_MODE_RC0 0x00000000 | ||
| 266 | /* Addressing Mode-ROW0+n/COL0+n */ | ||
| 267 | #define IFC_NAND_NCFGR_ADDR_MODE_RC1 0x00400000 | ||
| 268 | /* Number of loop iterations of FIR sequences for multi page operations */ | ||
| 269 | #define IFC_NAND_NCFGR_NUM_LOOP_MASK 0x0000F000 | ||
| 270 | #define IFC_NAND_NCFGR_NUM_LOOP_SHIFT 12 | ||
| 271 | #define IFC_NAND_NCFGR_NUM_LOOP(n) ((n) << IFC_NAND_NCFGR_NUM_LOOP_SHIFT) | ||
| 272 | /* Number of wait cycles */ | ||
| 273 | #define IFC_NAND_NCFGR_NUM_WAIT_MASK 0x000000FF | ||
| 274 | #define IFC_NAND_NCFGR_NUM_WAIT_SHIFT 0 | ||
| 275 | |||
| 276 | /* | ||
| 277 | * NAND Flash Command Registers (NAND_FCR0/NAND_FCR1) | ||
| 278 | */ | ||
| 279 | /* General purpose FCM flash command bytes CMD0-CMD7 */ | ||
| 280 | #define IFC_NAND_FCR0_CMD0 0xFF000000 | ||
| 281 | #define IFC_NAND_FCR0_CMD0_SHIFT 24 | ||
| 282 | #define IFC_NAND_FCR0_CMD1 0x00FF0000 | ||
| 283 | #define IFC_NAND_FCR0_CMD1_SHIFT 16 | ||
| 284 | #define IFC_NAND_FCR0_CMD2 0x0000FF00 | ||
| 285 | #define IFC_NAND_FCR0_CMD2_SHIFT 8 | ||
| 286 | #define IFC_NAND_FCR0_CMD3 0x000000FF | ||
| 287 | #define IFC_NAND_FCR0_CMD3_SHIFT 0 | ||
| 288 | #define IFC_NAND_FCR1_CMD4 0xFF000000 | ||
| 289 | #define IFC_NAND_FCR1_CMD4_SHIFT 24 | ||
| 290 | #define IFC_NAND_FCR1_CMD5 0x00FF0000 | ||
| 291 | #define IFC_NAND_FCR1_CMD5_SHIFT 16 | ||
| 292 | #define IFC_NAND_FCR1_CMD6 0x0000FF00 | ||
| 293 | #define IFC_NAND_FCR1_CMD6_SHIFT 8 | ||
| 294 | #define IFC_NAND_FCR1_CMD7 0x000000FF | ||
| 295 | #define IFC_NAND_FCR1_CMD7_SHIFT 0 | ||
| 296 | |||
| 297 | /* | ||
| 298 | * Flash ROW and COL Address Register (ROWn, COLn) | ||
| 299 | */ | ||
| 300 | /* Main/spare region locator */ | ||
| 301 | #define IFC_NAND_COL_MS 0x80000000 | ||
| 302 | /* Column Address */ | ||
| 303 | #define IFC_NAND_COL_CA_MASK 0x00000FFF | ||
| 304 | |||
| 305 | /* | ||
| 306 | * NAND Flash Byte Count Register (NAND_BC) | ||
| 307 | */ | ||
| 308 | /* Byte Count for read/Write */ | ||
| 309 | #define IFC_NAND_BC 0x000001FF | ||
| 310 | |||
| 311 | /* | ||
| 312 | * NAND Flash Instruction Registers (NAND_FIR0/NAND_FIR1/NAND_FIR2) | ||
| 313 | */ | ||
| 314 | /* NAND Machine specific opcodes OP0-OP14*/ | ||
| 315 | #define IFC_NAND_FIR0_OP0 0xFC000000 | ||
| 316 | #define IFC_NAND_FIR0_OP0_SHIFT 26 | ||
| 317 | #define IFC_NAND_FIR0_OP1 0x03F00000 | ||
| 318 | #define IFC_NAND_FIR0_OP1_SHIFT 20 | ||
| 319 | #define IFC_NAND_FIR0_OP2 0x000FC000 | ||
| 320 | #define IFC_NAND_FIR0_OP2_SHIFT 14 | ||
| 321 | #define IFC_NAND_FIR0_OP3 0x00003F00 | ||
| 322 | #define IFC_NAND_FIR0_OP3_SHIFT 8 | ||
| 323 | #define IFC_NAND_FIR0_OP4 0x000000FC | ||
| 324 | #define IFC_NAND_FIR0_OP4_SHIFT 2 | ||
| 325 | #define IFC_NAND_FIR1_OP5 0xFC000000 | ||
| 326 | #define IFC_NAND_FIR1_OP5_SHIFT 26 | ||
| 327 | #define IFC_NAND_FIR1_OP6 0x03F00000 | ||
| 328 | #define IFC_NAND_FIR1_OP6_SHIFT 20 | ||
| 329 | #define IFC_NAND_FIR1_OP7 0x000FC000 | ||
| 330 | #define IFC_NAND_FIR1_OP7_SHIFT 14 | ||
| 331 | #define IFC_NAND_FIR1_OP8 0x00003F00 | ||
| 332 | #define IFC_NAND_FIR1_OP8_SHIFT 8 | ||
| 333 | #define IFC_NAND_FIR1_OP9 0x000000FC | ||
| 334 | #define IFC_NAND_FIR1_OP9_SHIFT 2 | ||
| 335 | #define IFC_NAND_FIR2_OP10 0xFC000000 | ||
| 336 | #define IFC_NAND_FIR2_OP10_SHIFT 26 | ||
| 337 | #define IFC_NAND_FIR2_OP11 0x03F00000 | ||
| 338 | #define IFC_NAND_FIR2_OP11_SHIFT 20 | ||
| 339 | #define IFC_NAND_FIR2_OP12 0x000FC000 | ||
| 340 | #define IFC_NAND_FIR2_OP12_SHIFT 14 | ||
| 341 | #define IFC_NAND_FIR2_OP13 0x00003F00 | ||
| 342 | #define IFC_NAND_FIR2_OP13_SHIFT 8 | ||
| 343 | #define IFC_NAND_FIR2_OP14 0x000000FC | ||
| 344 | #define IFC_NAND_FIR2_OP14_SHIFT 2 | ||
| 345 | |||
| 346 | /* | ||
| 347 | * Instruction opcodes to be programmed | ||
| 348 | * in FIR registers- 6bits | ||
| 349 | */ | ||
| 350 | enum ifc_nand_fir_opcodes { | ||
| 351 | IFC_FIR_OP_NOP, | ||
| 352 | IFC_FIR_OP_CA0, | ||
| 353 | IFC_FIR_OP_CA1, | ||
| 354 | IFC_FIR_OP_CA2, | ||
| 355 | IFC_FIR_OP_CA3, | ||
| 356 | IFC_FIR_OP_RA0, | ||
| 357 | IFC_FIR_OP_RA1, | ||
| 358 | IFC_FIR_OP_RA2, | ||
| 359 | IFC_FIR_OP_RA3, | ||
| 360 | IFC_FIR_OP_CMD0, | ||
| 361 | IFC_FIR_OP_CMD1, | ||
| 362 | IFC_FIR_OP_CMD2, | ||
| 363 | IFC_FIR_OP_CMD3, | ||
| 364 | IFC_FIR_OP_CMD4, | ||
| 365 | IFC_FIR_OP_CMD5, | ||
| 366 | IFC_FIR_OP_CMD6, | ||
| 367 | IFC_FIR_OP_CMD7, | ||
| 368 | IFC_FIR_OP_CW0, | ||
| 369 | IFC_FIR_OP_CW1, | ||
| 370 | IFC_FIR_OP_CW2, | ||
| 371 | IFC_FIR_OP_CW3, | ||
| 372 | IFC_FIR_OP_CW4, | ||
| 373 | IFC_FIR_OP_CW5, | ||
| 374 | IFC_FIR_OP_CW6, | ||
| 375 | IFC_FIR_OP_CW7, | ||
| 376 | IFC_FIR_OP_WBCD, | ||
| 377 | IFC_FIR_OP_RBCD, | ||
| 378 | IFC_FIR_OP_BTRD, | ||
| 379 | IFC_FIR_OP_RDSTAT, | ||
| 380 | IFC_FIR_OP_NWAIT, | ||
| 381 | IFC_FIR_OP_WFR, | ||
| 382 | IFC_FIR_OP_SBRD, | ||
| 383 | IFC_FIR_OP_UA, | ||
| 384 | IFC_FIR_OP_RB, | ||
| 385 | }; | ||
| 386 | |||
| 387 | /* | ||
| 388 | * NAND Chip Select Register (NAND_CSEL) | ||
| 389 | */ | ||
| 390 | #define IFC_NAND_CSEL 0x0C000000 | ||
| 391 | #define IFC_NAND_CSEL_SHIFT 26 | ||
| 392 | #define IFC_NAND_CSEL_CS0 0x00000000 | ||
| 393 | #define IFC_NAND_CSEL_CS1 0x04000000 | ||
| 394 | #define IFC_NAND_CSEL_CS2 0x08000000 | ||
| 395 | #define IFC_NAND_CSEL_CS3 0x0C000000 | ||
| 396 | |||
| 397 | /* | ||
| 398 | * NAND Operation Sequence Start (NANDSEQ_STRT) | ||
| 399 | */ | ||
| 400 | /* NAND Flash Operation Start */ | ||
| 401 | #define IFC_NAND_SEQ_STRT_FIR_STRT 0x80000000 | ||
| 402 | /* Automatic Erase */ | ||
| 403 | #define IFC_NAND_SEQ_STRT_AUTO_ERS 0x00800000 | ||
| 404 | /* Automatic Program */ | ||
| 405 | #define IFC_NAND_SEQ_STRT_AUTO_PGM 0x00100000 | ||
| 406 | /* Automatic Copyback */ | ||
| 407 | #define IFC_NAND_SEQ_STRT_AUTO_CPB 0x00020000 | ||
| 408 | /* Automatic Read Operation */ | ||
| 409 | #define IFC_NAND_SEQ_STRT_AUTO_RD 0x00004000 | ||
| 410 | /* Automatic Status Read */ | ||
| 411 | #define IFC_NAND_SEQ_STRT_AUTO_STAT_RD 0x00000800 | ||
| 412 | |||
| 413 | /* | ||
| 414 | * NAND Event and Error Status Register (NAND_EVTER_STAT) | ||
| 415 | */ | ||
| 416 | /* Operation Complete */ | ||
| 417 | #define IFC_NAND_EVTER_STAT_OPC 0x80000000 | ||
| 418 | /* Flash Timeout Error */ | ||
| 419 | #define IFC_NAND_EVTER_STAT_FTOER 0x08000000 | ||
| 420 | /* Write Protect Error */ | ||
| 421 | #define IFC_NAND_EVTER_STAT_WPER 0x04000000 | ||
| 422 | /* ECC Error */ | ||
| 423 | #define IFC_NAND_EVTER_STAT_ECCER 0x02000000 | ||
| 424 | /* RCW Load Done */ | ||
| 425 | #define IFC_NAND_EVTER_STAT_RCW_DN 0x00008000 | ||
| 426 | /* Boot Loadr Done */ | ||
| 427 | #define IFC_NAND_EVTER_STAT_BOOT_DN 0x00004000 | ||
| 428 | /* Bad Block Indicator search select */ | ||
| 429 | #define IFC_NAND_EVTER_STAT_BBI_SRCH_SE 0x00000800 | ||
| 430 | |||
| 431 | /* | ||
| 432 | * NAND Flash Page Read Completion Event Status Register | ||
| 433 | * (PGRDCMPL_EVT_STAT) | ||
| 434 | */ | ||
| 435 | #define PGRDCMPL_EVT_STAT_MASK 0xFFFF0000 | ||
| 436 | /* Small Page 0-15 Done */ | ||
| 437 | #define PGRDCMPL_EVT_STAT_SECTION_SP(n) (1 << (31 - (n))) | ||
| 438 | /* Large Page(2K) 0-3 Done */ | ||
| 439 | #define PGRDCMPL_EVT_STAT_LP_2K(n) (0xF << (28 - (n)*4)) | ||
| 440 | /* Large Page(4K) 0-1 Done */ | ||
| 441 | #define PGRDCMPL_EVT_STAT_LP_4K(n) (0xFF << (24 - (n)*8)) | ||
| 442 | |||
| 443 | /* | ||
| 444 | * NAND Event and Error Enable Register (NAND_EVTER_EN) | ||
| 445 | */ | ||
| 446 | /* Operation complete event enable */ | ||
| 447 | #define IFC_NAND_EVTER_EN_OPC_EN 0x80000000 | ||
| 448 | /* Page read complete event enable */ | ||
| 449 | #define IFC_NAND_EVTER_EN_PGRDCMPL_EN 0x20000000 | ||
| 450 | /* Flash Timeout error enable */ | ||
| 451 | #define IFC_NAND_EVTER_EN_FTOER_EN 0x08000000 | ||
| 452 | /* Write Protect error enable */ | ||
| 453 | #define IFC_NAND_EVTER_EN_WPER_EN 0x04000000 | ||
| 454 | /* ECC error logging enable */ | ||
| 455 | #define IFC_NAND_EVTER_EN_ECCER_EN 0x02000000 | ||
| 456 | |||
| 457 | /* | ||
| 458 | * NAND Event and Error Interrupt Enable Register (NAND_EVTER_INTR_EN) | ||
| 459 | */ | ||
| 460 | /* Enable interrupt for operation complete */ | ||
| 461 | #define IFC_NAND_EVTER_INTR_OPCIR_EN 0x80000000 | ||
| 462 | /* Enable interrupt for Page read complete */ | ||
| 463 | #define IFC_NAND_EVTER_INTR_PGRDCMPLIR_EN 0x20000000 | ||
| 464 | /* Enable interrupt for Flash timeout error */ | ||
| 465 | #define IFC_NAND_EVTER_INTR_FTOERIR_EN 0x08000000 | ||
| 466 | /* Enable interrupt for Write protect error */ | ||
| 467 | #define IFC_NAND_EVTER_INTR_WPERIR_EN 0x04000000 | ||
| 468 | /* Enable interrupt for ECC error*/ | ||
| 469 | #define IFC_NAND_EVTER_INTR_ECCERIR_EN 0x02000000 | ||
| 470 | |||
| 471 | /* | ||
| 472 | * NAND Transfer Error Attribute Register-0 (NAND_ERATTR0) | ||
| 473 | */ | ||
| 474 | #define IFC_NAND_ERATTR0_MASK 0x0C080000 | ||
| 475 | /* Error on CS0-3 for NAND */ | ||
| 476 | #define IFC_NAND_ERATTR0_ERCS_CS0 0x00000000 | ||
| 477 | #define IFC_NAND_ERATTR0_ERCS_CS1 0x04000000 | ||
| 478 | #define IFC_NAND_ERATTR0_ERCS_CS2 0x08000000 | ||
| 479 | #define IFC_NAND_ERATTR0_ERCS_CS3 0x0C000000 | ||
| 480 | /* Transaction type of error Read/Write */ | ||
| 481 | #define IFC_NAND_ERATTR0_ERTTYPE_READ 0x00080000 | ||
| 482 | |||
| 483 | /* | ||
| 484 | * NAND Flash Status Register (NAND_FSR) | ||
| 485 | */ | ||
| 486 | /* First byte of data read from read status op */ | ||
| 487 | #define IFC_NAND_NFSR_RS0 0xFF000000 | ||
| 488 | /* Second byte of data read from read status op */ | ||
| 489 | #define IFC_NAND_NFSR_RS1 0x00FF0000 | ||
| 490 | |||
| 491 | /* | ||
| 492 | * ECC Error Status Registers (ECCSTAT0-ECCSTAT3) | ||
| 493 | */ | ||
| 494 | /* Number of ECC errors on sector n (n = 0-15) */ | ||
| 495 | #define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR0_MASK 0x0F000000 | ||
| 496 | #define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR0_SHIFT 24 | ||
| 497 | #define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR1_MASK 0x000F0000 | ||
| 498 | #define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR1_SHIFT 16 | ||
| 499 | #define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR2_MASK 0x00000F00 | ||
| 500 | #define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR2_SHIFT 8 | ||
| 501 | #define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR3_MASK 0x0000000F | ||
| 502 | #define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR3_SHIFT 0 | ||
| 503 | #define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR4_MASK 0x0F000000 | ||
| 504 | #define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR4_SHIFT 24 | ||
| 505 | #define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR5_MASK 0x000F0000 | ||
| 506 | #define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR5_SHIFT 16 | ||
| 507 | #define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR6_MASK 0x00000F00 | ||
| 508 | #define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR6_SHIFT 8 | ||
| 509 | #define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR7_MASK 0x0000000F | ||
| 510 | #define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR7_SHIFT 0 | ||
| 511 | #define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR8_MASK 0x0F000000 | ||
| 512 | #define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR8_SHIFT 24 | ||
| 513 | #define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR9_MASK 0x000F0000 | ||
| 514 | #define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR9_SHIFT 16 | ||
| 515 | #define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR10_MASK 0x00000F00 | ||
| 516 | #define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR10_SHIFT 8 | ||
| 517 | #define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR11_MASK 0x0000000F | ||
| 518 | #define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR11_SHIFT 0 | ||
| 519 | #define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR12_MASK 0x0F000000 | ||
| 520 | #define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR12_SHIFT 24 | ||
| 521 | #define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR13_MASK 0x000F0000 | ||
| 522 | #define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR13_SHIFT 16 | ||
| 523 | #define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR14_MASK 0x00000F00 | ||
| 524 | #define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR14_SHIFT 8 | ||
| 525 | #define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR15_MASK 0x0000000F | ||
| 526 | #define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR15_SHIFT 0 | ||
| 527 | |||
| 528 | /* | ||
| 529 | * NAND Control Register (NANDCR) | ||
| 530 | */ | ||
| 531 | #define IFC_NAND_NCR_FTOCNT_MASK 0x1E000000 | ||
| 532 | #define IFC_NAND_NCR_FTOCNT_SHIFT 25 | ||
| 533 | #define IFC_NAND_NCR_FTOCNT(n) ((_ilog2(n) - 8) << IFC_NAND_NCR_FTOCNT_SHIFT) | ||
| 534 | |||
| 535 | /* | ||
| 536 | * NAND_AUTOBOOT_TRGR | ||
| 537 | */ | ||
| 538 | /* Trigger RCW load */ | ||
| 539 | #define IFC_NAND_AUTOBOOT_TRGR_RCW_LD 0x80000000 | ||
| 540 | /* Trigget Auto Boot */ | ||
| 541 | #define IFC_NAND_AUTOBOOT_TRGR_BOOT_LD 0x20000000 | ||
| 542 | |||
| 543 | /* | ||
| 544 | * NAND_MDR | ||
| 545 | */ | ||
| 546 | /* 1st read data byte when opcode SBRD */ | ||
| 547 | #define IFC_NAND_MDR_RDATA0 0xFF000000 | ||
| 548 | /* 2nd read data byte when opcode SBRD */ | ||
| 549 | #define IFC_NAND_MDR_RDATA1 0x00FF0000 | ||
| 550 | |||
| 551 | /* | ||
| 552 | * NOR Machine Specific Registers | ||
| 553 | */ | ||
| 554 | /* | ||
| 555 | * NOR Event and Error Status Register (NOR_EVTER_STAT) | ||
| 556 | */ | ||
| 557 | /* NOR Command Sequence Operation Complete */ | ||
| 558 | #define IFC_NOR_EVTER_STAT_OPC_NOR 0x80000000 | ||
| 559 | /* Write Protect Error */ | ||
| 560 | #define IFC_NOR_EVTER_STAT_WPER 0x04000000 | ||
| 561 | /* Command Sequence Timeout Error */ | ||
| 562 | #define IFC_NOR_EVTER_STAT_STOER 0x01000000 | ||
| 563 | |||
| 564 | /* | ||
| 565 | * NOR Event and Error Enable Register (NOR_EVTER_EN) | ||
| 566 | */ | ||
| 567 | /* NOR Command Seq complete event enable */ | ||
| 568 | #define IFC_NOR_EVTER_EN_OPCEN_NOR 0x80000000 | ||
| 569 | /* Write Protect Error Checking Enable */ | ||
| 570 | #define IFC_NOR_EVTER_EN_WPEREN 0x04000000 | ||
| 571 | /* Timeout Error Enable */ | ||
| 572 | #define IFC_NOR_EVTER_EN_STOEREN 0x01000000 | ||
| 573 | |||
| 574 | /* | ||
| 575 | * NOR Event and Error Interrupt Enable Register (NOR_EVTER_INTR_EN) | ||
| 576 | */ | ||
| 577 | /* Enable interrupt for OPC complete */ | ||
| 578 | #define IFC_NOR_EVTER_INTR_OPCEN_NOR 0x80000000 | ||
| 579 | /* Enable interrupt for write protect error */ | ||
| 580 | #define IFC_NOR_EVTER_INTR_WPEREN 0x04000000 | ||
| 581 | /* Enable interrupt for timeout error */ | ||
| 582 | #define IFC_NOR_EVTER_INTR_STOEREN 0x01000000 | ||
| 583 | |||
| 584 | /* | ||
| 585 | * NOR Transfer Error Attribute Register-0 (NOR_ERATTR0) | ||
| 586 | */ | ||
| 587 | /* Source ID for error transaction */ | ||
| 588 | #define IFC_NOR_ERATTR0_ERSRCID 0xFF000000 | ||
| 589 | /* AXI ID for error transation */ | ||
| 590 | #define IFC_NOR_ERATTR0_ERAID 0x000FF000 | ||
| 591 | /* Chip select corresponds to NOR error */ | ||
| 592 | #define IFC_NOR_ERATTR0_ERCS_CS0 0x00000000 | ||
| 593 | #define IFC_NOR_ERATTR0_ERCS_CS1 0x00000010 | ||
| 594 | #define IFC_NOR_ERATTR0_ERCS_CS2 0x00000020 | ||
| 595 | #define IFC_NOR_ERATTR0_ERCS_CS3 0x00000030 | ||
| 596 | /* Type of transaction read/write */ | ||
| 597 | #define IFC_NOR_ERATTR0_ERTYPE_READ 0x00000001 | ||
| 598 | |||
| 599 | /* | ||
| 600 | * NOR Transfer Error Attribute Register-2 (NOR_ERATTR2) | ||
| 601 | */ | ||
| 602 | #define IFC_NOR_ERATTR2_ER_NUM_PHASE_EXP 0x000F0000 | ||
| 603 | #define IFC_NOR_ERATTR2_ER_NUM_PHASE_PER 0x00000F00 | ||
| 604 | |||
| 605 | /* | ||
| 606 | * NOR Control Register (NORCR) | ||
| 607 | */ | ||
| 608 | #define IFC_NORCR_MASK 0x0F0F0000 | ||
| 609 | /* No. of Address/Data Phase */ | ||
| 610 | #define IFC_NORCR_NUM_PHASE_MASK 0x0F000000 | ||
| 611 | #define IFC_NORCR_NUM_PHASE_SHIFT 24 | ||
| 612 | #define IFC_NORCR_NUM_PHASE(n) ((n-1) << IFC_NORCR_NUM_PHASE_SHIFT) | ||
| 613 | /* Sequence Timeout Count */ | ||
| 614 | #define IFC_NORCR_STOCNT_MASK 0x000F0000 | ||
| 615 | #define IFC_NORCR_STOCNT_SHIFT 16 | ||
| 616 | #define IFC_NORCR_STOCNT(n) ((__ilog2(n) - 8) << IFC_NORCR_STOCNT_SHIFT) | ||
| 617 | |||
| 618 | /* | ||
| 619 | * GPCM Machine specific registers | ||
| 620 | */ | ||
| 621 | /* | ||
| 622 | * GPCM Event and Error Status Register (GPCM_EVTER_STAT) | ||
| 623 | */ | ||
| 624 | /* Timeout error */ | ||
| 625 | #define IFC_GPCM_EVTER_STAT_TOER 0x04000000 | ||
| 626 | /* Parity error */ | ||
| 627 | #define IFC_GPCM_EVTER_STAT_PER 0x01000000 | ||
| 628 | |||
| 629 | /* | ||
| 630 | * GPCM Event and Error Enable Register (GPCM_EVTER_EN) | ||
| 631 | */ | ||
| 632 | /* Timeout error enable */ | ||
| 633 | #define IFC_GPCM_EVTER_EN_TOER_EN 0x04000000 | ||
| 634 | /* Parity error enable */ | ||
| 635 | #define IFC_GPCM_EVTER_EN_PER_EN 0x01000000 | ||
| 636 | |||
| 637 | /* | ||
| 638 | * GPCM Event and Error Interrupt Enable Register (GPCM_EVTER_INTR_EN) | ||
| 639 | */ | ||
| 640 | /* Enable Interrupt for timeout error */ | ||
| 641 | #define IFC_GPCM_EEIER_TOERIR_EN 0x04000000 | ||
| 642 | /* Enable Interrupt for Parity error */ | ||
| 643 | #define IFC_GPCM_EEIER_PERIR_EN 0x01000000 | ||
| 644 | |||
| 645 | /* | ||
| 646 | * GPCM Transfer Error Attribute Register-0 (GPCM_ERATTR0) | ||
| 647 | */ | ||
| 648 | /* Source ID for error transaction */ | ||
| 649 | #define IFC_GPCM_ERATTR0_ERSRCID 0xFF000000 | ||
| 650 | /* AXI ID for error transaction */ | ||
| 651 | #define IFC_GPCM_ERATTR0_ERAID 0x000FF000 | ||
| 652 | /* Chip select corresponds to GPCM error */ | ||
| 653 | #define IFC_GPCM_ERATTR0_ERCS_CS0 0x00000000 | ||
| 654 | #define IFC_GPCM_ERATTR0_ERCS_CS1 0x00000040 | ||
| 655 | #define IFC_GPCM_ERATTR0_ERCS_CS2 0x00000080 | ||
| 656 | #define IFC_GPCM_ERATTR0_ERCS_CS3 0x000000C0 | ||
| 657 | /* Type of transaction read/Write */ | ||
| 658 | #define IFC_GPCM_ERATTR0_ERTYPE_READ 0x00000001 | ||
| 659 | |||
| 660 | /* | ||
| 661 | * GPCM Transfer Error Attribute Register-2 (GPCM_ERATTR2) | ||
| 662 | */ | ||
| 663 | /* On which beat of address/data parity error is observed */ | ||
| 664 | #define IFC_GPCM_ERATTR2_PERR_BEAT 0x00000C00 | ||
| 665 | /* Parity Error on byte */ | ||
| 666 | #define IFC_GPCM_ERATTR2_PERR_BYTE 0x000000F0 | ||
| 667 | /* Parity Error reported in addr or data phase */ | ||
| 668 | #define IFC_GPCM_ERATTR2_PERR_DATA_PHASE 0x00000001 | ||
| 669 | |||
| 670 | /* | ||
| 671 | * GPCM Status Register (GPCM_STAT) | ||
| 672 | */ | ||
| 673 | #define IFC_GPCM_STAT_BSY 0x80000000 /* GPCM is busy */ | ||
| 674 | |||
| 675 | /* | ||
| 676 | * IFC Controller NAND Machine registers | ||
| 677 | */ | ||
| 678 | struct fsl_ifc_nand { | ||
| 679 | __be32 ncfgr; | ||
| 680 | u32 res1[0x4]; | ||
| 681 | __be32 nand_fcr0; | ||
| 682 | __be32 nand_fcr1; | ||
| 683 | u32 res2[0x8]; | ||
| 684 | __be32 row0; | ||
| 685 | u32 res3; | ||
| 686 | __be32 col0; | ||
| 687 | u32 res4; | ||
| 688 | __be32 row1; | ||
| 689 | u32 res5; | ||
| 690 | __be32 col1; | ||
| 691 | u32 res6; | ||
| 692 | __be32 row2; | ||
| 693 | u32 res7; | ||
| 694 | __be32 col2; | ||
| 695 | u32 res8; | ||
| 696 | __be32 row3; | ||
| 697 | u32 res9; | ||
| 698 | __be32 col3; | ||
| 699 | u32 res10[0x24]; | ||
| 700 | __be32 nand_fbcr; | ||
| 701 | u32 res11; | ||
| 702 | __be32 nand_fir0; | ||
| 703 | __be32 nand_fir1; | ||
| 704 | __be32 nand_fir2; | ||
| 705 | u32 res12[0x10]; | ||
| 706 | __be32 nand_csel; | ||
| 707 | u32 res13; | ||
| 708 | __be32 nandseq_strt; | ||
| 709 | u32 res14; | ||
| 710 | __be32 nand_evter_stat; | ||
| 711 | u32 res15; | ||
| 712 | __be32 pgrdcmpl_evt_stat; | ||
| 713 | u32 res16[0x2]; | ||
| 714 | __be32 nand_evter_en; | ||
| 715 | u32 res17[0x2]; | ||
| 716 | __be32 nand_evter_intr_en; | ||
| 717 | u32 res18[0x2]; | ||
| 718 | __be32 nand_erattr0; | ||
| 719 | __be32 nand_erattr1; | ||
| 720 | u32 res19[0x10]; | ||
| 721 | __be32 nand_fsr; | ||
| 722 | u32 res20; | ||
| 723 | __be32 nand_eccstat[4]; | ||
| 724 | u32 res21[0x20]; | ||
| 725 | __be32 nanndcr; | ||
| 726 | u32 res22[0x2]; | ||
| 727 | __be32 nand_autoboot_trgr; | ||
| 728 | u32 res23; | ||
| 729 | __be32 nand_mdr; | ||
| 730 | u32 res24[0x5C]; | ||
| 731 | }; | ||
| 732 | |||
| 733 | /* | ||
| 734 | * IFC controller NOR Machine registers | ||
| 735 | */ | ||
| 736 | struct fsl_ifc_nor { | ||
| 737 | __be32 nor_evter_stat; | ||
| 738 | u32 res1[0x2]; | ||
| 739 | __be32 nor_evter_en; | ||
| 740 | u32 res2[0x2]; | ||
| 741 | __be32 nor_evter_intr_en; | ||
| 742 | u32 res3[0x2]; | ||
| 743 | __be32 nor_erattr0; | ||
| 744 | __be32 nor_erattr1; | ||
| 745 | __be32 nor_erattr2; | ||
| 746 | u32 res4[0x4]; | ||
| 747 | __be32 norcr; | ||
| 748 | u32 res5[0xEF]; | ||
| 749 | }; | ||
| 750 | |||
| 751 | /* | ||
| 752 | * IFC controller GPCM Machine registers | ||
| 753 | */ | ||
| 754 | struct fsl_ifc_gpcm { | ||
| 755 | __be32 gpcm_evter_stat; | ||
| 756 | u32 res1[0x2]; | ||
| 757 | __be32 gpcm_evter_en; | ||
| 758 | u32 res2[0x2]; | ||
| 759 | __be32 gpcm_evter_intr_en; | ||
| 760 | u32 res3[0x2]; | ||
| 761 | __be32 gpcm_erattr0; | ||
| 762 | __be32 gpcm_erattr1; | ||
| 763 | __be32 gpcm_erattr2; | ||
| 764 | __be32 gpcm_stat; | ||
| 765 | u32 res4[0x1F3]; | ||
| 766 | }; | ||
| 767 | |||
| 768 | /* | ||
| 769 | * IFC Controller Registers | ||
| 770 | */ | ||
| 771 | struct fsl_ifc_regs { | ||
| 772 | __be32 ifc_rev; | ||
| 773 | u32 res1[0x2]; | ||
| 774 | struct { | ||
| 775 | __be32 cspr_ext; | ||
| 776 | __be32 cspr; | ||
| 777 | u32 res2; | ||
| 778 | } cspr_cs[FSL_IFC_BANK_COUNT]; | ||
| 779 | u32 res3[0x19]; | ||
| 780 | struct { | ||
| 781 | __be32 amask; | ||
| 782 | u32 res4[0x2]; | ||
| 783 | } amask_cs[FSL_IFC_BANK_COUNT]; | ||
| 784 | u32 res5[0x17]; | ||
| 785 | struct { | ||
| 786 | __be32 csor_ext; | ||
| 787 | __be32 csor; | ||
| 788 | u32 res6; | ||
| 789 | } csor_cs[FSL_IFC_BANK_COUNT]; | ||
| 790 | u32 res7[0x19]; | ||
| 791 | struct { | ||
| 792 | __be32 ftim[4]; | ||
| 793 | u32 res8[0x8]; | ||
| 794 | } ftim_cs[FSL_IFC_BANK_COUNT]; | ||
| 795 | u32 res9[0x60]; | ||
| 796 | __be32 rb_stat; | ||
| 797 | u32 res10[0x2]; | ||
| 798 | __be32 ifc_gcr; | ||
| 799 | u32 res11[0x2]; | ||
| 800 | __be32 cm_evter_stat; | ||
| 801 | u32 res12[0x2]; | ||
| 802 | __be32 cm_evter_en; | ||
| 803 | u32 res13[0x2]; | ||
| 804 | __be32 cm_evter_intr_en; | ||
| 805 | u32 res14[0x2]; | ||
| 806 | __be32 cm_erattr0; | ||
| 807 | __be32 cm_erattr1; | ||
| 808 | u32 res15[0x2]; | ||
| 809 | __be32 ifc_ccr; | ||
| 810 | __be32 ifc_csr; | ||
| 811 | u32 res16[0x2EB]; | ||
| 812 | struct fsl_ifc_nand ifc_nand; | ||
| 813 | struct fsl_ifc_nor ifc_nor; | ||
| 814 | struct fsl_ifc_gpcm ifc_gpcm; | ||
| 815 | }; | ||
| 816 | |||
| 817 | extern unsigned int convert_ifc_address(phys_addr_t addr_base); | ||
| 818 | extern int fsl_ifc_find(phys_addr_t addr_base); | ||
| 819 | |||
| 820 | /* overview of the fsl ifc controller */ | ||
| 821 | |||
| 822 | struct fsl_ifc_ctrl { | ||
| 823 | /* device info */ | ||
| 824 | struct device *dev; | ||
| 825 | struct fsl_ifc_regs __iomem *regs; | ||
| 826 | int irq; | ||
| 827 | int nand_irq; | ||
| 828 | spinlock_t lock; | ||
| 829 | void *nand; | ||
| 830 | |||
| 831 | u32 nand_stat; | ||
| 832 | wait_queue_head_t nand_wait; | ||
| 833 | }; | ||
| 834 | |||
| 835 | extern struct fsl_ifc_ctrl *fsl_ifc_ctrl_dev; | ||
| 836 | |||
| 837 | |||
| 838 | #endif /* __ASM_FSL_IFC_H */ | ||
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index 3d286ff49ab0..64cf3ef50696 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h | |||
| @@ -99,7 +99,7 @@ struct fsnotify_ops { | |||
| 99 | struct fsnotify_mark *inode_mark, | 99 | struct fsnotify_mark *inode_mark, |
| 100 | struct fsnotify_mark *vfsmount_mark, | 100 | struct fsnotify_mark *vfsmount_mark, |
| 101 | u32 mask, void *data, int data_type, | 101 | u32 mask, void *data, int data_type, |
| 102 | const unsigned char *file_name); | 102 | const unsigned char *file_name, u32 cookie); |
| 103 | void (*free_group_priv)(struct fsnotify_group *group); | 103 | void (*free_group_priv)(struct fsnotify_group *group); |
| 104 | void (*freeing_mark)(struct fsnotify_mark *mark, struct fsnotify_group *group); | 104 | void (*freeing_mark)(struct fsnotify_mark *mark, struct fsnotify_group *group); |
| 105 | void (*free_event)(struct fsnotify_event *event); | 105 | void (*free_event)(struct fsnotify_event *event); |
| @@ -160,7 +160,7 @@ struct fsnotify_group { | |||
| 160 | 160 | ||
| 161 | struct fasync_struct *fsn_fa; /* async notification */ | 161 | struct fasync_struct *fsn_fa; /* async notification */ |
| 162 | 162 | ||
| 163 | struct fsnotify_event overflow_event; /* Event we queue when the | 163 | struct fsnotify_event *overflow_event; /* Event we queue when the |
| 164 | * notification list is too | 164 | * notification list is too |
| 165 | * full */ | 165 | * full */ |
| 166 | 166 | ||
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 4e4cc28623ad..4cdb3a17bcb5 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
| @@ -495,10 +495,6 @@ enum { | |||
| 495 | FILTER_TRACE_FN, | 495 | FILTER_TRACE_FN, |
| 496 | }; | 496 | }; |
| 497 | 497 | ||
| 498 | #define EVENT_STORAGE_SIZE 128 | ||
| 499 | extern struct mutex event_storage_mutex; | ||
| 500 | extern char event_storage[EVENT_STORAGE_SIZE]; | ||
| 501 | |||
| 502 | extern int trace_event_raw_init(struct ftrace_event_call *call); | 498 | extern int trace_event_raw_init(struct ftrace_event_call *call); |
| 503 | extern int trace_define_field(struct ftrace_event_call *call, const char *type, | 499 | extern int trace_define_field(struct ftrace_event_call *call, const char *type, |
| 504 | const char *name, int offset, int size, | 500 | const char *name, int offset, int size, |
diff --git a/include/linux/futex.h b/include/linux/futex.h index b0d95cac826e..6435f46d6e13 100644 --- a/include/linux/futex.h +++ b/include/linux/futex.h | |||
| @@ -55,7 +55,11 @@ union futex_key { | |||
| 55 | #ifdef CONFIG_FUTEX | 55 | #ifdef CONFIG_FUTEX |
| 56 | extern void exit_robust_list(struct task_struct *curr); | 56 | extern void exit_robust_list(struct task_struct *curr); |
| 57 | extern void exit_pi_state_list(struct task_struct *curr); | 57 | extern void exit_pi_state_list(struct task_struct *curr); |
| 58 | #ifdef CONFIG_HAVE_FUTEX_CMPXCHG | ||
| 59 | #define futex_cmpxchg_enabled 1 | ||
| 60 | #else | ||
| 58 | extern int futex_cmpxchg_enabled; | 61 | extern int futex_cmpxchg_enabled; |
| 62 | #endif | ||
| 59 | #else | 63 | #else |
| 60 | static inline void exit_robust_list(struct task_struct *curr) | 64 | static inline void exit_robust_list(struct task_struct *curr) |
| 61 | { | 65 | { |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 0437439bc047..39b81dc7d01a 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
| @@ -123,6 +123,10 @@ struct vm_area_struct; | |||
| 123 | __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN | \ | 123 | __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN | \ |
| 124 | __GFP_NO_KSWAPD) | 124 | __GFP_NO_KSWAPD) |
| 125 | 125 | ||
| 126 | /* | ||
| 127 | * GFP_THISNODE does not perform any reclaim, you most likely want to | ||
| 128 | * use __GFP_THISNODE to allocate from a given node without fallback! | ||
| 129 | */ | ||
| 126 | #ifdef CONFIG_NUMA | 130 | #ifdef CONFIG_NUMA |
| 127 | #define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) | 131 | #define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) |
| 128 | #else | 132 | #else |
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 12d5f972f23f..cba442ec3c66 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | 9 | ||
| 10 | 10 | ||
| 11 | extern void synchronize_irq(unsigned int irq); | 11 | extern void synchronize_irq(unsigned int irq); |
| 12 | extern void synchronize_hardirq(unsigned int irq); | ||
| 12 | 13 | ||
| 13 | #if defined(CONFIG_TINY_RCU) | 14 | #if defined(CONFIG_TINY_RCU) |
| 14 | 15 | ||
diff --git a/include/linux/hid-sensor-ids.h b/include/linux/hid-sensor-ids.h index beaf965621c1..537161a997ab 100644 --- a/include/linux/hid-sensor-ids.h +++ b/include/linux/hid-sensor-ids.h | |||
| @@ -33,6 +33,16 @@ | |||
| 33 | #define HID_USAGE_SENSOR_DATA_LIGHT 0x2004d0 | 33 | #define HID_USAGE_SENSOR_DATA_LIGHT 0x2004d0 |
| 34 | #define HID_USAGE_SENSOR_LIGHT_ILLUM 0x2004d1 | 34 | #define HID_USAGE_SENSOR_LIGHT_ILLUM 0x2004d1 |
| 35 | 35 | ||
| 36 | /* PROX (200011) */ | ||
| 37 | #define HID_USAGE_SENSOR_PROX 0x200011 | ||
| 38 | #define HID_USAGE_SENSOR_DATA_PRESENCE 0x2004b0 | ||
| 39 | #define HID_USAGE_SENSOR_HUMAN_PRESENCE 0x2004b1 | ||
| 40 | |||
| 41 | /* Pressure (200031) */ | ||
| 42 | #define HID_USAGE_SENSOR_PRESSURE 0x200031 | ||
| 43 | #define HID_USAGE_SENSOR_DATA_ATMOSPHERIC_PRESSURE 0x200430 | ||
| 44 | #define HID_USAGE_SENSOR_ATMOSPHERIC_PRESSURE 0x200431 | ||
| 45 | |||
| 36 | /* Gyro 3D: (200076) */ | 46 | /* Gyro 3D: (200076) */ |
| 37 | #define HID_USAGE_SENSOR_GYRO_3D 0x200076 | 47 | #define HID_USAGE_SENSOR_GYRO_3D 0x200076 |
| 38 | #define HID_USAGE_SENSOR_DATA_ANGL_VELOCITY 0x200456 | 48 | #define HID_USAGE_SENSOR_DATA_ANGL_VELOCITY 0x200456 |
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index d19a5c2d2270..e7a8d3fa91d5 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
| @@ -96,12 +96,12 @@ enum hrtimer_restart { | |||
| 96 | * @function: timer expiry callback function | 96 | * @function: timer expiry callback function |
| 97 | * @base: pointer to the timer base (per cpu and per clock) | 97 | * @base: pointer to the timer base (per cpu and per clock) |
| 98 | * @state: state information (See bit values above) | 98 | * @state: state information (See bit values above) |
| 99 | * @start_pid: timer statistics field to store the pid of the task which | ||
| 100 | * started the timer | ||
| 99 | * @start_site: timer statistics field to store the site where the timer | 101 | * @start_site: timer statistics field to store the site where the timer |
| 100 | * was started | 102 | * was started |
| 101 | * @start_comm: timer statistics field to store the name of the process which | 103 | * @start_comm: timer statistics field to store the name of the process which |
| 102 | * started the timer | 104 | * started the timer |
| 103 | * @start_pid: timer statistics field to store the pid of the task which | ||
| 104 | * started the timer | ||
| 105 | * | 105 | * |
| 106 | * The hrtimer structure must be initialized by hrtimer_init() | 106 | * The hrtimer structure must be initialized by hrtimer_init() |
| 107 | */ | 107 | */ |
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index db512014e061..b826239bdce0 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h | |||
| @@ -157,46 +157,6 @@ static inline int hpage_nr_pages(struct page *page) | |||
| 157 | return HPAGE_PMD_NR; | 157 | return HPAGE_PMD_NR; |
| 158 | return 1; | 158 | return 1; |
| 159 | } | 159 | } |
| 160 | /* | ||
| 161 | * compound_trans_head() should be used instead of compound_head(), | ||
| 162 | * whenever the "page" passed as parameter could be the tail of a | ||
| 163 | * transparent hugepage that could be undergoing a | ||
| 164 | * __split_huge_page_refcount(). The page structure layout often | ||
| 165 | * changes across releases and it makes extensive use of unions. So if | ||
| 166 | * the page structure layout will change in a way that | ||
| 167 | * page->first_page gets clobbered by __split_huge_page_refcount, the | ||
| 168 | * implementation making use of smp_rmb() will be required. | ||
| 169 | * | ||
| 170 | * Currently we define compound_trans_head as compound_head, because | ||
| 171 | * page->private is in the same union with page->first_page, and | ||
| 172 | * page->private isn't clobbered. However this also means we're | ||
| 173 | * currently leaving dirt into the page->private field of anonymous | ||
| 174 | * pages resulting from a THP split, instead of setting page->private | ||
| 175 | * to zero like for every other page that has PG_private not set. But | ||
| 176 | * anonymous pages don't use page->private so this is not a problem. | ||
| 177 | */ | ||
| 178 | #if 0 | ||
| 179 | /* This will be needed if page->private will be clobbered in split_huge_page */ | ||
| 180 | static inline struct page *compound_trans_head(struct page *page) | ||
| 181 | { | ||
| 182 | if (PageTail(page)) { | ||
| 183 | struct page *head; | ||
| 184 | head = page->first_page; | ||
| 185 | smp_rmb(); | ||
| 186 | /* | ||
| 187 | * head may be a dangling pointer. | ||
| 188 | * __split_huge_page_refcount clears PageTail before | ||
| 189 | * overwriting first_page, so if PageTail is still | ||
| 190 | * there it means the head pointer isn't dangling. | ||
| 191 | */ | ||
| 192 | if (PageTail(page)) | ||
| 193 | return head; | ||
| 194 | } | ||
| 195 | return page; | ||
| 196 | } | ||
| 197 | #else | ||
| 198 | #define compound_trans_head(page) compound_head(page) | ||
| 199 | #endif | ||
| 200 | 160 | ||
| 201 | extern int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, | 161 | extern int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, |
| 202 | unsigned long addr, pmd_t pmd, pmd_t *pmdp); | 162 | unsigned long addr, pmd_t pmd, pmd_t *pmdp); |
| @@ -226,7 +186,6 @@ static inline int split_huge_page(struct page *page) | |||
| 226 | do { } while (0) | 186 | do { } while (0) |
| 227 | #define split_huge_page_pmd_mm(__mm, __address, __pmd) \ | 187 | #define split_huge_page_pmd_mm(__mm, __address, __pmd) \ |
| 228 | do { } while (0) | 188 | do { } while (0) |
| 229 | #define compound_trans_head(page) compound_head(page) | ||
| 230 | static inline int hugepage_madvise(struct vm_area_struct *vma, | 189 | static inline int hugepage_madvise(struct vm_area_struct *vma, |
| 231 | unsigned long *vm_flags, int advice) | 190 | unsigned long *vm_flags, int advice) |
| 232 | { | 191 | { |
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index 344883dce584..ab7359fde987 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h | |||
| @@ -25,328 +25,11 @@ | |||
| 25 | #ifndef _HYPERV_H | 25 | #ifndef _HYPERV_H |
| 26 | #define _HYPERV_H | 26 | #define _HYPERV_H |
| 27 | 27 | ||
| 28 | #include <linux/types.h> | 28 | #include <uapi/linux/hyperv.h> |
| 29 | |||
| 30 | /* | ||
| 31 | * Framework version for util services. | ||
| 32 | */ | ||
| 33 | #define UTIL_FW_MINOR 0 | ||
| 34 | |||
| 35 | #define UTIL_WS2K8_FW_MAJOR 1 | ||
| 36 | #define UTIL_WS2K8_FW_VERSION (UTIL_WS2K8_FW_MAJOR << 16 | UTIL_FW_MINOR) | ||
| 37 | |||
| 38 | #define UTIL_FW_MAJOR 3 | ||
| 39 | #define UTIL_FW_VERSION (UTIL_FW_MAJOR << 16 | UTIL_FW_MINOR) | ||
| 40 | |||
| 41 | |||
| 42 | /* | ||
| 43 | * Implementation of host controlled snapshot of the guest. | ||
| 44 | */ | ||
| 45 | |||
| 46 | #define VSS_OP_REGISTER 128 | ||
| 47 | |||
| 48 | enum hv_vss_op { | ||
| 49 | VSS_OP_CREATE = 0, | ||
| 50 | VSS_OP_DELETE, | ||
| 51 | VSS_OP_HOT_BACKUP, | ||
| 52 | VSS_OP_GET_DM_INFO, | ||
| 53 | VSS_OP_BU_COMPLETE, | ||
| 54 | /* | ||
| 55 | * Following operations are only supported with IC version >= 5.0 | ||
| 56 | */ | ||
| 57 | VSS_OP_FREEZE, /* Freeze the file systems in the VM */ | ||
| 58 | VSS_OP_THAW, /* Unfreeze the file systems */ | ||
| 59 | VSS_OP_AUTO_RECOVER, | ||
| 60 | VSS_OP_COUNT /* Number of operations, must be last */ | ||
| 61 | }; | ||
| 62 | |||
| 63 | |||
| 64 | /* | ||
| 65 | * Header for all VSS messages. | ||
| 66 | */ | ||
| 67 | struct hv_vss_hdr { | ||
| 68 | __u8 operation; | ||
| 69 | __u8 reserved[7]; | ||
| 70 | } __attribute__((packed)); | ||
| 71 | |||
| 72 | |||
| 73 | /* | ||
| 74 | * Flag values for the hv_vss_check_feature. Linux supports only | ||
| 75 | * one value. | ||
| 76 | */ | ||
| 77 | #define VSS_HBU_NO_AUTO_RECOVERY 0x00000005 | ||
| 78 | |||
| 79 | struct hv_vss_check_feature { | ||
| 80 | __u32 flags; | ||
| 81 | } __attribute__((packed)); | ||
| 82 | |||
| 83 | struct hv_vss_check_dm_info { | ||
| 84 | __u32 flags; | ||
| 85 | } __attribute__((packed)); | ||
| 86 | |||
| 87 | struct hv_vss_msg { | ||
| 88 | union { | ||
| 89 | struct hv_vss_hdr vss_hdr; | ||
| 90 | int error; | ||
| 91 | }; | ||
| 92 | union { | ||
| 93 | struct hv_vss_check_feature vss_cf; | ||
| 94 | struct hv_vss_check_dm_info dm_info; | ||
| 95 | }; | ||
| 96 | } __attribute__((packed)); | ||
| 97 | |||
| 98 | /* | ||
| 99 | * An implementation of HyperV key value pair (KVP) functionality for Linux. | ||
| 100 | * | ||
| 101 | * | ||
| 102 | * Copyright (C) 2010, Novell, Inc. | ||
| 103 | * Author : K. Y. Srinivasan <ksrinivasan@novell.com> | ||
| 104 | * | ||
| 105 | */ | ||
| 106 | |||
| 107 | /* | ||
| 108 | * Maximum value size - used for both key names and value data, and includes | ||
| 109 | * any applicable NULL terminators. | ||
| 110 | * | ||
| 111 | * Note: This limit is somewhat arbitrary, but falls easily within what is | ||
| 112 | * supported for all native guests (back to Win 2000) and what is reasonable | ||
| 113 | * for the IC KVP exchange functionality. Note that Windows Me/98/95 are | ||
| 114 | * limited to 255 character key names. | ||
| 115 | * | ||
| 116 | * MSDN recommends not storing data values larger than 2048 bytes in the | ||
| 117 | * registry. | ||
| 118 | * | ||
| 119 | * Note: This value is used in defining the KVP exchange message - this value | ||
| 120 | * cannot be modified without affecting the message size and compatibility. | ||
| 121 | */ | ||
| 122 | |||
| 123 | /* | ||
| 124 | * bytes, including any null terminators | ||
| 125 | */ | ||
| 126 | #define HV_KVP_EXCHANGE_MAX_VALUE_SIZE (2048) | ||
| 127 | |||
| 128 | |||
| 129 | /* | ||
| 130 | * Maximum key size - the registry limit for the length of an entry name | ||
| 131 | * is 256 characters, including the null terminator | ||
| 132 | */ | ||
| 133 | |||
| 134 | #define HV_KVP_EXCHANGE_MAX_KEY_SIZE (512) | ||
| 135 | |||
| 136 | /* | ||
| 137 | * In Linux, we implement the KVP functionality in two components: | ||
| 138 | * 1) The kernel component which is packaged as part of the hv_utils driver | ||
| 139 | * is responsible for communicating with the host and responsible for | ||
| 140 | * implementing the host/guest protocol. 2) A user level daemon that is | ||
| 141 | * responsible for data gathering. | ||
| 142 | * | ||
| 143 | * Host/Guest Protocol: The host iterates over an index and expects the guest | ||
| 144 | * to assign a key name to the index and also return the value corresponding to | ||
| 145 | * the key. The host will have atmost one KVP transaction outstanding at any | ||
| 146 | * given point in time. The host side iteration stops when the guest returns | ||
| 147 | * an error. Microsoft has specified the following mapping of key names to | ||
| 148 | * host specified index: | ||
| 149 | * | ||
| 150 | * Index Key Name | ||
| 151 | * 0 FullyQualifiedDomainName | ||
| 152 | * 1 IntegrationServicesVersion | ||
| 153 | * 2 NetworkAddressIPv4 | ||
| 154 | * 3 NetworkAddressIPv6 | ||
| 155 | * 4 OSBuildNumber | ||
| 156 | * 5 OSName | ||
| 157 | * 6 OSMajorVersion | ||
| 158 | * 7 OSMinorVersion | ||
| 159 | * 8 OSVersion | ||
| 160 | * 9 ProcessorArchitecture | ||
| 161 | * | ||
| 162 | * The Windows host expects the Key Name and Key Value to be encoded in utf16. | ||
| 163 | * | ||
| 164 | * Guest Kernel/KVP Daemon Protocol: As noted earlier, we implement all of the | ||
| 165 | * data gathering functionality in a user mode daemon. The user level daemon | ||
| 166 | * is also responsible for binding the key name to the index as well. The | ||
| 167 | * kernel and user-level daemon communicate using a connector channel. | ||
| 168 | * | ||
| 169 | * The user mode component first registers with the | ||
| 170 | * the kernel component. Subsequently, the kernel component requests, data | ||
| 171 | * for the specified keys. In response to this message the user mode component | ||
| 172 | * fills in the value corresponding to the specified key. We overload the | ||
| 173 | * sequence field in the cn_msg header to define our KVP message types. | ||
| 174 | * | ||
| 175 | * | ||
| 176 | * The kernel component simply acts as a conduit for communication between the | ||
| 177 | * Windows host and the user-level daemon. The kernel component passes up the | ||
| 178 | * index received from the Host to the user-level daemon. If the index is | ||
| 179 | * valid (supported), the corresponding key as well as its | ||
| 180 | * value (both are strings) is returned. If the index is invalid | ||
| 181 | * (not supported), a NULL key string is returned. | ||
| 182 | */ | ||
| 183 | |||
| 184 | |||
| 185 | /* | ||
| 186 | * Registry value types. | ||
| 187 | */ | ||
| 188 | |||
| 189 | #define REG_SZ 1 | ||
| 190 | #define REG_U32 4 | ||
| 191 | #define REG_U64 8 | ||
| 192 | |||
| 193 | /* | ||
| 194 | * As we look at expanding the KVP functionality to include | ||
| 195 | * IP injection functionality, we need to maintain binary | ||
| 196 | * compatibility with older daemons. | ||
| 197 | * | ||
| 198 | * The KVP opcodes are defined by the host and it was unfortunate | ||
| 199 | * that I chose to treat the registration operation as part of the | ||
| 200 | * KVP operations defined by the host. | ||
| 201 | * Here is the level of compatibility | ||
| 202 | * (between the user level daemon and the kernel KVP driver) that we | ||
| 203 | * will implement: | ||
| 204 | * | ||
| 205 | * An older daemon will always be supported on a newer driver. | ||
| 206 | * A given user level daemon will require a minimal version of the | ||
| 207 | * kernel driver. | ||
| 208 | * If we cannot handle the version differences, we will fail gracefully | ||
| 209 | * (this can happen when we have a user level daemon that is more | ||
| 210 | * advanced than the KVP driver. | ||
| 211 | * | ||
| 212 | * We will use values used in this handshake for determining if we have | ||
| 213 | * workable user level daemon and the kernel driver. We begin by taking the | ||
| 214 | * registration opcode out of the KVP opcode namespace. We will however, | ||
| 215 | * maintain compatibility with the existing user-level daemon code. | ||
| 216 | */ | ||
| 217 | |||
| 218 | /* | ||
| 219 | * Daemon code not supporting IP injection (legacy daemon). | ||
| 220 | */ | ||
| 221 | |||
| 222 | #define KVP_OP_REGISTER 4 | ||
| 223 | |||
| 224 | /* | ||
| 225 | * Daemon code supporting IP injection. | ||
| 226 | * The KVP opcode field is used to communicate the | ||
| 227 | * registration information; so define a namespace that | ||
| 228 | * will be distinct from the host defined KVP opcode. | ||
| 229 | */ | ||
| 230 | |||
| 231 | #define KVP_OP_REGISTER1 100 | ||
| 232 | |||
| 233 | enum hv_kvp_exchg_op { | ||
| 234 | KVP_OP_GET = 0, | ||
| 235 | KVP_OP_SET, | ||
| 236 | KVP_OP_DELETE, | ||
| 237 | KVP_OP_ENUMERATE, | ||
| 238 | KVP_OP_GET_IP_INFO, | ||
| 239 | KVP_OP_SET_IP_INFO, | ||
| 240 | KVP_OP_COUNT /* Number of operations, must be last. */ | ||
| 241 | }; | ||
| 242 | |||
| 243 | enum hv_kvp_exchg_pool { | ||
| 244 | KVP_POOL_EXTERNAL = 0, | ||
| 245 | KVP_POOL_GUEST, | ||
| 246 | KVP_POOL_AUTO, | ||
| 247 | KVP_POOL_AUTO_EXTERNAL, | ||
| 248 | KVP_POOL_AUTO_INTERNAL, | ||
| 249 | KVP_POOL_COUNT /* Number of pools, must be last. */ | ||
| 250 | }; | ||
| 251 | |||
| 252 | /* | ||
| 253 | * Some Hyper-V status codes. | ||
| 254 | */ | ||
| 255 | 29 | ||
| 256 | #define HV_S_OK 0x00000000 | 30 | #include <linux/types.h> |
| 257 | #define HV_E_FAIL 0x80004005 | ||
| 258 | #define HV_S_CONT 0x80070103 | ||
| 259 | #define HV_ERROR_NOT_SUPPORTED 0x80070032 | ||
| 260 | #define HV_ERROR_MACHINE_LOCKED 0x800704F7 | ||
| 261 | #define HV_ERROR_DEVICE_NOT_CONNECTED 0x8007048F | ||
| 262 | #define HV_INVALIDARG 0x80070057 | ||
| 263 | #define HV_GUID_NOTFOUND 0x80041002 | ||
| 264 | |||
| 265 | #define ADDR_FAMILY_NONE 0x00 | ||
| 266 | #define ADDR_FAMILY_IPV4 0x01 | ||
| 267 | #define ADDR_FAMILY_IPV6 0x02 | ||
| 268 | |||
| 269 | #define MAX_ADAPTER_ID_SIZE 128 | ||
| 270 | #define MAX_IP_ADDR_SIZE 1024 | ||
| 271 | #define MAX_GATEWAY_SIZE 512 | ||
| 272 | |||
| 273 | |||
| 274 | struct hv_kvp_ipaddr_value { | ||
| 275 | __u16 adapter_id[MAX_ADAPTER_ID_SIZE]; | ||
| 276 | __u8 addr_family; | ||
| 277 | __u8 dhcp_enabled; | ||
| 278 | __u16 ip_addr[MAX_IP_ADDR_SIZE]; | ||
| 279 | __u16 sub_net[MAX_IP_ADDR_SIZE]; | ||
| 280 | __u16 gate_way[MAX_GATEWAY_SIZE]; | ||
| 281 | __u16 dns_addr[MAX_IP_ADDR_SIZE]; | ||
| 282 | } __attribute__((packed)); | ||
| 283 | |||
| 284 | |||
| 285 | struct hv_kvp_hdr { | ||
| 286 | __u8 operation; | ||
| 287 | __u8 pool; | ||
| 288 | __u16 pad; | ||
| 289 | } __attribute__((packed)); | ||
| 290 | |||
| 291 | struct hv_kvp_exchg_msg_value { | ||
| 292 | __u32 value_type; | ||
| 293 | __u32 key_size; | ||
| 294 | __u32 value_size; | ||
| 295 | __u8 key[HV_KVP_EXCHANGE_MAX_KEY_SIZE]; | ||
| 296 | union { | ||
| 297 | __u8 value[HV_KVP_EXCHANGE_MAX_VALUE_SIZE]; | ||
| 298 | __u32 value_u32; | ||
| 299 | __u64 value_u64; | ||
| 300 | }; | ||
| 301 | } __attribute__((packed)); | ||
| 302 | |||
| 303 | struct hv_kvp_msg_enumerate { | ||
| 304 | __u32 index; | ||
| 305 | struct hv_kvp_exchg_msg_value data; | ||
| 306 | } __attribute__((packed)); | ||
| 307 | |||
| 308 | struct hv_kvp_msg_get { | ||
| 309 | struct hv_kvp_exchg_msg_value data; | ||
| 310 | }; | ||
| 311 | |||
| 312 | struct hv_kvp_msg_set { | ||
| 313 | struct hv_kvp_exchg_msg_value data; | ||
| 314 | }; | ||
| 315 | |||
| 316 | struct hv_kvp_msg_delete { | ||
| 317 | __u32 key_size; | ||
| 318 | __u8 key[HV_KVP_EXCHANGE_MAX_KEY_SIZE]; | ||
| 319 | }; | ||
| 320 | |||
| 321 | struct hv_kvp_register { | ||
| 322 | __u8 version[HV_KVP_EXCHANGE_MAX_KEY_SIZE]; | ||
| 323 | }; | ||
| 324 | |||
| 325 | struct hv_kvp_msg { | ||
| 326 | union { | ||
| 327 | struct hv_kvp_hdr kvp_hdr; | ||
| 328 | int error; | ||
| 329 | }; | ||
| 330 | union { | ||
| 331 | struct hv_kvp_msg_get kvp_get; | ||
| 332 | struct hv_kvp_msg_set kvp_set; | ||
| 333 | struct hv_kvp_msg_delete kvp_delete; | ||
| 334 | struct hv_kvp_msg_enumerate kvp_enum_data; | ||
| 335 | struct hv_kvp_ipaddr_value kvp_ip_val; | ||
| 336 | struct hv_kvp_register kvp_register; | ||
| 337 | } body; | ||
| 338 | } __attribute__((packed)); | ||
| 339 | |||
| 340 | struct hv_kvp_ip_msg { | ||
| 341 | __u8 operation; | ||
| 342 | __u8 pool; | ||
| 343 | struct hv_kvp_ipaddr_value kvp_ip_val; | ||
| 344 | } __attribute__((packed)); | ||
| 345 | |||
| 346 | #ifdef __KERNEL__ | ||
| 347 | #include <linux/scatterlist.h> | 31 | #include <linux/scatterlist.h> |
| 348 | #include <linux/list.h> | 32 | #include <linux/list.h> |
| 349 | #include <linux/uuid.h> | ||
| 350 | #include <linux/timer.h> | 33 | #include <linux/timer.h> |
| 351 | #include <linux/workqueue.h> | 34 | #include <linux/workqueue.h> |
| 352 | #include <linux/completion.h> | 35 | #include <linux/completion.h> |
| @@ -354,7 +37,7 @@ struct hv_kvp_ip_msg { | |||
| 354 | #include <linux/mod_devicetable.h> | 37 | #include <linux/mod_devicetable.h> |
| 355 | 38 | ||
| 356 | 39 | ||
| 357 | #define MAX_PAGE_BUFFER_COUNT 19 | 40 | #define MAX_PAGE_BUFFER_COUNT 32 |
| 358 | #define MAX_MULTIPAGE_BUFFER_COUNT 32 /* 128K */ | 41 | #define MAX_MULTIPAGE_BUFFER_COUNT 32 /* 128K */ |
| 359 | 42 | ||
| 360 | #pragma pack(push, 1) | 43 | #pragma pack(push, 1) |
| @@ -1043,6 +726,10 @@ struct vmbus_channel { | |||
| 1043 | * This will be NULL for the primary channel. | 726 | * This will be NULL for the primary channel. |
| 1044 | */ | 727 | */ |
| 1045 | struct vmbus_channel *primary_channel; | 728 | struct vmbus_channel *primary_channel; |
| 729 | /* | ||
| 730 | * Support per-channel state for use by vmbus drivers. | ||
| 731 | */ | ||
| 732 | void *per_channel_state; | ||
| 1046 | }; | 733 | }; |
| 1047 | 734 | ||
| 1048 | static inline void set_channel_read_state(struct vmbus_channel *c, bool state) | 735 | static inline void set_channel_read_state(struct vmbus_channel *c, bool state) |
| @@ -1050,6 +737,16 @@ static inline void set_channel_read_state(struct vmbus_channel *c, bool state) | |||
| 1050 | c->batched_reading = state; | 737 | c->batched_reading = state; |
| 1051 | } | 738 | } |
| 1052 | 739 | ||
| 740 | static inline void set_per_channel_state(struct vmbus_channel *c, void *s) | ||
| 741 | { | ||
| 742 | c->per_channel_state = s; | ||
| 743 | } | ||
| 744 | |||
| 745 | static inline void *get_per_channel_state(struct vmbus_channel *c) | ||
| 746 | { | ||
| 747 | return c->per_channel_state; | ||
| 748 | } | ||
| 749 | |||
| 1053 | void vmbus_onmessage(void *context); | 750 | void vmbus_onmessage(void *context); |
| 1054 | 751 | ||
| 1055 | int vmbus_request_offers(void); | 752 | int vmbus_request_offers(void); |
| @@ -1118,7 +815,7 @@ extern int vmbus_open(struct vmbus_channel *channel, | |||
| 1118 | extern void vmbus_close(struct vmbus_channel *channel); | 815 | extern void vmbus_close(struct vmbus_channel *channel); |
| 1119 | 816 | ||
| 1120 | extern int vmbus_sendpacket(struct vmbus_channel *channel, | 817 | extern int vmbus_sendpacket(struct vmbus_channel *channel, |
| 1121 | const void *buffer, | 818 | void *buffer, |
| 1122 | u32 bufferLen, | 819 | u32 bufferLen, |
| 1123 | u64 requestid, | 820 | u64 requestid, |
| 1124 | enum vmbus_packet_type type, | 821 | enum vmbus_packet_type type, |
| @@ -1352,6 +1049,17 @@ void vmbus_driver_unregister(struct hv_driver *hv_driver); | |||
| 1352 | } | 1049 | } |
| 1353 | 1050 | ||
| 1354 | /* | 1051 | /* |
| 1052 | * Guest File Copy Service | ||
| 1053 | * {34D14BE3-DEE4-41c8-9AE7-6B174977C192} | ||
| 1054 | */ | ||
| 1055 | |||
| 1056 | #define HV_FCOPY_GUID \ | ||
| 1057 | .guid = { \ | ||
| 1058 | 0xE3, 0x4B, 0xD1, 0x34, 0xE4, 0xDE, 0xC8, 0x41, \ | ||
| 1059 | 0x9A, 0xE7, 0x6B, 0x17, 0x49, 0x77, 0xC1, 0x92 \ | ||
| 1060 | } | ||
| 1061 | |||
| 1062 | /* | ||
| 1355 | * Common header for Hyper-V ICs | 1063 | * Common header for Hyper-V ICs |
| 1356 | */ | 1064 | */ |
| 1357 | 1065 | ||
| @@ -1459,11 +1167,12 @@ int hv_vss_init(struct hv_util_service *); | |||
| 1459 | void hv_vss_deinit(void); | 1167 | void hv_vss_deinit(void); |
| 1460 | void hv_vss_onchannelcallback(void *); | 1168 | void hv_vss_onchannelcallback(void *); |
| 1461 | 1169 | ||
| 1170 | extern struct resource hyperv_mmio; | ||
| 1171 | |||
| 1462 | /* | 1172 | /* |
| 1463 | * Negotiated version with the Host. | 1173 | * Negotiated version with the Host. |
| 1464 | */ | 1174 | */ |
| 1465 | 1175 | ||
| 1466 | extern __u32 vmbus_proto_version; | 1176 | extern __u32 vmbus_proto_version; |
| 1467 | 1177 | ||
| 1468 | #endif /* __KERNEL__ */ | ||
| 1469 | #endif /* _HYPERV_H */ | 1178 | #endif /* _HYPERV_H */ |
diff --git a/include/linux/idr.h b/include/linux/idr.h index 871a213a8477..9c95d210458b 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h | |||
| @@ -85,6 +85,7 @@ void idr_remove(struct idr *idp, int id); | |||
| 85 | void idr_free(struct idr *idp, int id); | 85 | void idr_free(struct idr *idp, int id); |
| 86 | void idr_destroy(struct idr *idp); | 86 | void idr_destroy(struct idr *idp); |
| 87 | void idr_init(struct idr *idp); | 87 | void idr_init(struct idr *idp); |
| 88 | bool idr_is_empty(struct idr *idp); | ||
| 88 | 89 | ||
| 89 | /** | 90 | /** |
| 90 | * idr_preload_end - end preload section started with idr_preload() | 91 | * idr_preload_end - end preload section started with idr_preload() |
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 75a8a20c8179..5f2d00e7e488 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h | |||
| @@ -254,12 +254,16 @@ static inline bool iio_channel_has_info(const struct iio_chan_spec *chan, | |||
| 254 | (chan->info_mask_shared_by_all & BIT(type)); | 254 | (chan->info_mask_shared_by_all & BIT(type)); |
| 255 | } | 255 | } |
| 256 | 256 | ||
| 257 | #define IIO_ST(si, rb, sb, sh) \ | 257 | #define IIO_CHAN_SOFT_TIMESTAMP(_si) { \ |
| 258 | { .sign = si, .realbits = rb, .storagebits = sb, .shift = sh } | 258 | .type = IIO_TIMESTAMP, \ |
| 259 | 259 | .channel = -1, \ | |
| 260 | #define IIO_CHAN_SOFT_TIMESTAMP(_si) \ | 260 | .scan_index = _si, \ |
| 261 | { .type = IIO_TIMESTAMP, .channel = -1, \ | 261 | .scan_type = { \ |
| 262 | .scan_index = _si, .scan_type = IIO_ST('s', 64, 64, 0) } | 262 | .sign = 's', \ |
| 263 | .realbits = 64, \ | ||
| 264 | .storagebits = 64, \ | ||
| 265 | }, \ | ||
| 266 | } | ||
| 263 | 267 | ||
| 264 | /** | 268 | /** |
| 265 | * iio_get_time_ns() - utility function to get a time stamp for events etc | 269 | * iio_get_time_ns() - utility function to get a time stamp for events etc |
diff --git a/include/linux/init.h b/include/linux/init.h index e1688802964f..a3ba27076342 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
| @@ -163,6 +163,23 @@ extern bool initcall_debug; | |||
| 163 | 163 | ||
| 164 | #ifndef __ASSEMBLY__ | 164 | #ifndef __ASSEMBLY__ |
| 165 | 165 | ||
| 166 | #ifdef CONFIG_LTO | ||
| 167 | /* Work around a LTO gcc problem: when there is no reference to a variable | ||
| 168 | * in a module it will be moved to the end of the program. This causes | ||
| 169 | * reordering of initcalls which the kernel does not like. | ||
| 170 | * Add a dummy reference function to avoid this. The function is | ||
| 171 | * deleted by the linker. | ||
| 172 | */ | ||
| 173 | #define LTO_REFERENCE_INITCALL(x) \ | ||
| 174 | ; /* yes this is needed */ \ | ||
| 175 | static __used __exit void *reference_##x(void) \ | ||
| 176 | { \ | ||
| 177 | return &x; \ | ||
| 178 | } | ||
| 179 | #else | ||
| 180 | #define LTO_REFERENCE_INITCALL(x) | ||
| 181 | #endif | ||
| 182 | |||
| 166 | /* initcalls are now grouped by functionality into separate | 183 | /* initcalls are now grouped by functionality into separate |
| 167 | * subsections. Ordering inside the subsections is determined | 184 | * subsections. Ordering inside the subsections is determined |
| 168 | * by link order. | 185 | * by link order. |
| @@ -175,7 +192,8 @@ extern bool initcall_debug; | |||
| 175 | 192 | ||
| 176 | #define __define_initcall(fn, id) \ | 193 | #define __define_initcall(fn, id) \ |
| 177 | static initcall_t __initcall_##fn##id __used \ | 194 | static initcall_t __initcall_##fn##id __used \ |
| 178 | __attribute__((__section__(".initcall" #id ".init"))) = fn | 195 | __attribute__((__section__(".initcall" #id ".init"))) = fn; \ |
| 196 | LTO_REFERENCE_INITCALL(__initcall_##fn##id) | ||
| 179 | 197 | ||
| 180 | /* | 198 | /* |
| 181 | * Early initcalls run before initializing SMP. | 199 | * Early initcalls run before initializing SMP. |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index a2678d35b5a2..c7bfac1c4a7b 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
| @@ -188,6 +188,7 @@ extern void disable_irq(unsigned int irq); | |||
| 188 | extern void disable_percpu_irq(unsigned int irq); | 188 | extern void disable_percpu_irq(unsigned int irq); |
| 189 | extern void enable_irq(unsigned int irq); | 189 | extern void enable_irq(unsigned int irq); |
| 190 | extern void enable_percpu_irq(unsigned int irq, unsigned int type); | 190 | extern void enable_percpu_irq(unsigned int irq, unsigned int type); |
| 191 | extern void irq_wake_thread(unsigned int irq, void *dev_id); | ||
| 191 | 192 | ||
| 192 | /* The following three functions are for the core kernel use only. */ | 193 | /* The following three functions are for the core kernel use only. */ |
| 193 | extern void suspend_device_irqs(void); | 194 | extern void suspend_device_irqs(void); |
diff --git a/include/linux/io.h b/include/linux/io.h index f4f42faec686..8a18e75600cc 100644 --- a/include/linux/io.h +++ b/include/linux/io.h | |||
| @@ -24,7 +24,7 @@ | |||
| 24 | 24 | ||
| 25 | struct device; | 25 | struct device; |
| 26 | 26 | ||
| 27 | void __iowrite32_copy(void __iomem *to, const void *from, size_t count); | 27 | __visible void __iowrite32_copy(void __iomem *to, const void *from, size_t count); |
| 28 | void __iowrite64_copy(void __iomem *to, const void *from, size_t count); | 28 | void __iowrite64_copy(void __iomem *to, const void *from, size_t count); |
| 29 | 29 | ||
| 30 | #ifdef CONFIG_MMU | 30 | #ifdef CONFIG_MMU |
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 89b7c24a36e9..5e3a906cc089 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
| @@ -51,7 +51,7 @@ struct resource { | |||
| 51 | 51 | ||
| 52 | #define IORESOURCE_EXCLUSIVE 0x08000000 /* Userland may not map this resource */ | 52 | #define IORESOURCE_EXCLUSIVE 0x08000000 /* Userland may not map this resource */ |
| 53 | #define IORESOURCE_DISABLED 0x10000000 | 53 | #define IORESOURCE_DISABLED 0x10000000 |
| 54 | #define IORESOURCE_UNSET 0x20000000 | 54 | #define IORESOURCE_UNSET 0x20000000 /* No address assigned yet */ |
| 55 | #define IORESOURCE_AUTO 0x40000000 | 55 | #define IORESOURCE_AUTO 0x40000000 |
| 56 | #define IORESOURCE_BUSY 0x80000000 /* Driver has marked this resource busy */ | 56 | #define IORESOURCE_BUSY 0x80000000 /* Driver has marked this resource busy */ |
| 57 | 57 | ||
| @@ -169,6 +169,16 @@ static inline unsigned long resource_type(const struct resource *res) | |||
| 169 | { | 169 | { |
| 170 | return res->flags & IORESOURCE_TYPE_BITS; | 170 | return res->flags & IORESOURCE_TYPE_BITS; |
| 171 | } | 171 | } |
| 172 | /* True iff r1 completely contains r2 */ | ||
| 173 | static inline bool resource_contains(struct resource *r1, struct resource *r2) | ||
| 174 | { | ||
| 175 | if (resource_type(r1) != resource_type(r2)) | ||
| 176 | return false; | ||
| 177 | if (r1->flags & IORESOURCE_UNSET || r2->flags & IORESOURCE_UNSET) | ||
| 178 | return false; | ||
| 179 | return r1->start <= r2->start && r1->end >= r2->end; | ||
| 180 | } | ||
| 181 | |||
| 172 | 182 | ||
| 173 | /* Convenience shorthand with allocation */ | 183 | /* Convenience shorthand with allocation */ |
| 174 | #define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name), 0) | 184 | #define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name), 0) |
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h index e7831d203737..35e7eca4e33b 100644 --- a/include/linux/ipc_namespace.h +++ b/include/linux/ipc_namespace.h | |||
| @@ -118,9 +118,7 @@ extern int mq_init_ns(struct ipc_namespace *ns); | |||
| 118 | * the new maximum will handle anyone else. I may have to revisit this | 118 | * the new maximum will handle anyone else. I may have to revisit this |
| 119 | * in the future. | 119 | * in the future. |
| 120 | */ | 120 | */ |
| 121 | #define MIN_QUEUESMAX 1 | ||
| 122 | #define DFLT_QUEUESMAX 256 | 121 | #define DFLT_QUEUESMAX 256 |
| 123 | #define HARD_QUEUESMAX 1024 | ||
| 124 | #define MIN_MSGMAX 1 | 122 | #define MIN_MSGMAX 1 |
| 125 | #define DFLT_MSG 10U | 123 | #define DFLT_MSG 10U |
| 126 | #define DFLT_MSGMAX 10 | 124 | #define DFLT_MSGMAX 10 |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 7dc10036eff5..d278838908cb 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
| @@ -303,6 +303,10 @@ static inline irq_hw_number_t irqd_to_hwirq(struct irq_data *d) | |||
| 303 | * @irq_pm_shutdown: function called from core code on shutdown once per chip | 303 | * @irq_pm_shutdown: function called from core code on shutdown once per chip |
| 304 | * @irq_calc_mask: Optional function to set irq_data.mask for special cases | 304 | * @irq_calc_mask: Optional function to set irq_data.mask for special cases |
| 305 | * @irq_print_chip: optional to print special chip info in show_interrupts | 305 | * @irq_print_chip: optional to print special chip info in show_interrupts |
| 306 | * @irq_request_resources: optional to request resources before calling | ||
| 307 | * any other callback related to this irq | ||
| 308 | * @irq_release_resources: optional to release resources acquired with | ||
| 309 | * irq_request_resources | ||
| 306 | * @flags: chip specific flags | 310 | * @flags: chip specific flags |
| 307 | */ | 311 | */ |
| 308 | struct irq_chip { | 312 | struct irq_chip { |
| @@ -336,6 +340,8 @@ struct irq_chip { | |||
| 336 | void (*irq_calc_mask)(struct irq_data *data); | 340 | void (*irq_calc_mask)(struct irq_data *data); |
| 337 | 341 | ||
| 338 | void (*irq_print_chip)(struct irq_data *data, struct seq_file *p); | 342 | void (*irq_print_chip)(struct irq_data *data, struct seq_file *p); |
| 343 | int (*irq_request_resources)(struct irq_data *data); | ||
| 344 | void (*irq_release_resources)(struct irq_data *data); | ||
| 339 | 345 | ||
| 340 | unsigned long flags; | 346 | unsigned long flags; |
| 341 | }; | 347 | }; |
| @@ -349,6 +355,8 @@ struct irq_chip { | |||
| 349 | * IRQCHIP_ONOFFLINE_ENABLED: Only call irq_on/off_line callbacks | 355 | * IRQCHIP_ONOFFLINE_ENABLED: Only call irq_on/off_line callbacks |
| 350 | * when irq enabled | 356 | * when irq enabled |
| 351 | * IRQCHIP_SKIP_SET_WAKE: Skip chip.irq_set_wake(), for this irq chip | 357 | * IRQCHIP_SKIP_SET_WAKE: Skip chip.irq_set_wake(), for this irq chip |
| 358 | * IRQCHIP_ONESHOT_SAFE: One shot does not require mask/unmask | ||
| 359 | * IRQCHIP_EOI_THREADED: Chip requires eoi() on unmask in threaded mode | ||
| 352 | */ | 360 | */ |
| 353 | enum { | 361 | enum { |
| 354 | IRQCHIP_SET_TYPE_MASKED = (1 << 0), | 362 | IRQCHIP_SET_TYPE_MASKED = (1 << 0), |
| @@ -357,6 +365,7 @@ enum { | |||
| 357 | IRQCHIP_ONOFFLINE_ENABLED = (1 << 3), | 365 | IRQCHIP_ONOFFLINE_ENABLED = (1 << 3), |
| 358 | IRQCHIP_SKIP_SET_WAKE = (1 << 4), | 366 | IRQCHIP_SKIP_SET_WAKE = (1 << 4), |
| 359 | IRQCHIP_ONESHOT_SAFE = (1 << 5), | 367 | IRQCHIP_ONESHOT_SAFE = (1 << 5), |
| 368 | IRQCHIP_EOI_THREADED = (1 << 6), | ||
| 360 | }; | 369 | }; |
| 361 | 370 | ||
| 362 | /* This include will go away once we isolated irq_desc usage to core code */ | 371 | /* This include will go away once we isolated irq_desc usage to core code */ |
diff --git a/include/linux/irq_work.h b/include/linux/irq_work.h index 66017028dcb3..19ae05d4b8ec 100644 --- a/include/linux/irq_work.h +++ b/include/linux/irq_work.h | |||
| @@ -30,7 +30,9 @@ void init_irq_work(struct irq_work *work, void (*func)(struct irq_work *)) | |||
| 30 | work->func = func; | 30 | work->func = func; |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | void irq_work_queue(struct irq_work *work); | 33 | #define DEFINE_IRQ_WORK(name, _f) struct irq_work name = { .func = (_f), } |
| 34 | |||
| 35 | bool irq_work_queue(struct irq_work *work); | ||
| 34 | void irq_work_run(void); | 36 | void irq_work_run(void); |
| 35 | void irq_work_sync(struct irq_work *work); | 37 | void irq_work_sync(struct irq_work *work); |
| 36 | 38 | ||
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 196d1ea86df0..08fb02477641 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -458,7 +458,7 @@ extern enum system_states { | |||
| 458 | 458 | ||
| 459 | #define TAINT_PROPRIETARY_MODULE 0 | 459 | #define TAINT_PROPRIETARY_MODULE 0 |
| 460 | #define TAINT_FORCED_MODULE 1 | 460 | #define TAINT_FORCED_MODULE 1 |
| 461 | #define TAINT_UNSAFE_SMP 2 | 461 | #define TAINT_CPU_OUT_OF_SPEC 2 |
| 462 | #define TAINT_FORCED_RMMOD 3 | 462 | #define TAINT_FORCED_RMMOD 3 |
| 463 | #define TAINT_MACHINE_CHECK 4 | 463 | #define TAINT_MACHINE_CHECK 4 |
| 464 | #define TAINT_BAD_PAGE 5 | 464 | #define TAINT_BAD_PAGE 5 |
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index 51c72be4a7c3..ecbc52f9ff77 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include <linux/sched.h> | 9 | #include <linux/sched.h> |
| 10 | #include <linux/vtime.h> | 10 | #include <linux/vtime.h> |
| 11 | #include <asm/irq.h> | 11 | #include <asm/irq.h> |
| 12 | #include <asm/cputime.h> | 12 | #include <linux/cputime.h> |
| 13 | 13 | ||
| 14 | /* | 14 | /* |
| 15 | * 'kernel_stat.h' contains the definitions needed for doing | 15 | * 'kernel_stat.h' contains the definitions needed for doing |
| @@ -51,14 +51,8 @@ DECLARE_PER_CPU(struct kernel_cpustat, kernel_cpustat); | |||
| 51 | 51 | ||
| 52 | extern unsigned long long nr_context_switches(void); | 52 | extern unsigned long long nr_context_switches(void); |
| 53 | 53 | ||
| 54 | #include <linux/irq.h> | ||
| 55 | extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu); | 54 | extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu); |
| 56 | 55 | extern void kstat_incr_irq_this_cpu(unsigned int irq); | |
| 57 | #define kstat_incr_irqs_this_cpu(irqno, DESC) \ | ||
| 58 | do { \ | ||
| 59 | __this_cpu_inc(*(DESC)->kstat_irqs); \ | ||
| 60 | __this_cpu_inc(kstat.irqs_sum); \ | ||
| 61 | } while (0) | ||
| 62 | 56 | ||
| 63 | static inline void kstat_incr_softirqs_this_cpu(unsigned int irq) | 57 | static inline void kstat_incr_softirqs_this_cpu(unsigned int irq) |
| 64 | { | 58 | { |
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h index 5be9f0228a3b..b0122dc6f96a 100644 --- a/include/linux/kernfs.h +++ b/include/linux/kernfs.h | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | #include <linux/lockdep.h> | 15 | #include <linux/lockdep.h> |
| 16 | #include <linux/rbtree.h> | 16 | #include <linux/rbtree.h> |
| 17 | #include <linux/atomic.h> | 17 | #include <linux/atomic.h> |
| 18 | #include <linux/completion.h> | 18 | #include <linux/wait.h> |
| 19 | 19 | ||
| 20 | struct file; | 20 | struct file; |
| 21 | struct dentry; | 21 | struct dentry; |
| @@ -35,16 +35,22 @@ enum kernfs_node_type { | |||
| 35 | }; | 35 | }; |
| 36 | 36 | ||
| 37 | #define KERNFS_TYPE_MASK 0x000f | 37 | #define KERNFS_TYPE_MASK 0x000f |
| 38 | #define KERNFS_ACTIVE_REF KERNFS_FILE | ||
| 39 | #define KERNFS_FLAG_MASK ~KERNFS_TYPE_MASK | 38 | #define KERNFS_FLAG_MASK ~KERNFS_TYPE_MASK |
| 40 | 39 | ||
| 41 | enum kernfs_node_flag { | 40 | enum kernfs_node_flag { |
| 42 | KERNFS_REMOVED = 0x0010, | 41 | KERNFS_ACTIVATED = 0x0010, |
| 43 | KERNFS_NS = 0x0020, | 42 | KERNFS_NS = 0x0020, |
| 44 | KERNFS_HAS_SEQ_SHOW = 0x0040, | 43 | KERNFS_HAS_SEQ_SHOW = 0x0040, |
| 45 | KERNFS_HAS_MMAP = 0x0080, | 44 | KERNFS_HAS_MMAP = 0x0080, |
| 46 | KERNFS_LOCKDEP = 0x0100, | 45 | KERNFS_LOCKDEP = 0x0100, |
| 47 | KERNFS_STATIC_NAME = 0x0200, | 46 | KERNFS_STATIC_NAME = 0x0200, |
| 47 | KERNFS_SUICIDAL = 0x0400, | ||
| 48 | KERNFS_SUICIDED = 0x0800, | ||
| 49 | }; | ||
| 50 | |||
| 51 | /* @flags for kernfs_create_root() */ | ||
| 52 | enum kernfs_root_flag { | ||
| 53 | KERNFS_ROOT_CREATE_DEACTIVATED = 0x0001, | ||
| 48 | }; | 54 | }; |
| 49 | 55 | ||
| 50 | /* type-specific structures for kernfs_node union members */ | 56 | /* type-specific structures for kernfs_node union members */ |
| @@ -85,17 +91,17 @@ struct kernfs_node { | |||
| 85 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 91 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
| 86 | struct lockdep_map dep_map; | 92 | struct lockdep_map dep_map; |
| 87 | #endif | 93 | #endif |
| 88 | /* the following two fields are published */ | 94 | /* |
| 95 | * Use kernfs_get_parent() and kernfs_name/path() instead of | ||
| 96 | * accessing the following two fields directly. If the node is | ||
| 97 | * never moved to a different parent, it is safe to access the | ||
| 98 | * parent directly. | ||
| 99 | */ | ||
| 89 | struct kernfs_node *parent; | 100 | struct kernfs_node *parent; |
| 90 | const char *name; | 101 | const char *name; |
| 91 | 102 | ||
| 92 | struct rb_node rb; | 103 | struct rb_node rb; |
| 93 | 104 | ||
| 94 | union { | ||
| 95 | struct completion *completion; | ||
| 96 | struct kernfs_node *removed_list; | ||
| 97 | } u; | ||
| 98 | |||
| 99 | const void *ns; /* namespace tag */ | 105 | const void *ns; /* namespace tag */ |
| 100 | unsigned int hash; /* ns + name hash */ | 106 | unsigned int hash; /* ns + name hash */ |
| 101 | union { | 107 | union { |
| @@ -113,12 +119,16 @@ struct kernfs_node { | |||
| 113 | }; | 119 | }; |
| 114 | 120 | ||
| 115 | /* | 121 | /* |
| 116 | * kernfs_dir_ops may be specified on kernfs_create_root() to support | 122 | * kernfs_syscall_ops may be specified on kernfs_create_root() to support |
| 117 | * directory manipulation syscalls. These optional callbacks are invoked | 123 | * syscalls. These optional callbacks are invoked on the matching syscalls |
| 118 | * on the matching syscalls and can perform any kernfs operations which | 124 | * and can perform any kernfs operations which don't necessarily have to be |
| 119 | * don't necessarily have to be the exact operation requested. | 125 | * the exact operation requested. An active reference is held for each |
| 126 | * kernfs_node parameter. | ||
| 120 | */ | 127 | */ |
| 121 | struct kernfs_dir_ops { | 128 | struct kernfs_syscall_ops { |
| 129 | int (*remount_fs)(struct kernfs_root *root, int *flags, char *data); | ||
| 130 | int (*show_options)(struct seq_file *sf, struct kernfs_root *root); | ||
| 131 | |||
| 122 | int (*mkdir)(struct kernfs_node *parent, const char *name, | 132 | int (*mkdir)(struct kernfs_node *parent, const char *name, |
| 123 | umode_t mode); | 133 | umode_t mode); |
| 124 | int (*rmdir)(struct kernfs_node *kn); | 134 | int (*rmdir)(struct kernfs_node *kn); |
| @@ -129,22 +139,26 @@ struct kernfs_dir_ops { | |||
| 129 | struct kernfs_root { | 139 | struct kernfs_root { |
| 130 | /* published fields */ | 140 | /* published fields */ |
| 131 | struct kernfs_node *kn; | 141 | struct kernfs_node *kn; |
| 142 | unsigned int flags; /* KERNFS_ROOT_* flags */ | ||
| 132 | 143 | ||
| 133 | /* private fields, do not use outside kernfs proper */ | 144 | /* private fields, do not use outside kernfs proper */ |
| 134 | struct ida ino_ida; | 145 | struct ida ino_ida; |
| 135 | struct kernfs_dir_ops *dir_ops; | 146 | struct kernfs_syscall_ops *syscall_ops; |
| 147 | wait_queue_head_t deactivate_waitq; | ||
| 136 | }; | 148 | }; |
| 137 | 149 | ||
| 138 | struct kernfs_open_file { | 150 | struct kernfs_open_file { |
| 139 | /* published fields */ | 151 | /* published fields */ |
| 140 | struct kernfs_node *kn; | 152 | struct kernfs_node *kn; |
| 141 | struct file *file; | 153 | struct file *file; |
| 154 | void *priv; | ||
| 142 | 155 | ||
| 143 | /* private fields, do not use outside kernfs proper */ | 156 | /* private fields, do not use outside kernfs proper */ |
| 144 | struct mutex mutex; | 157 | struct mutex mutex; |
| 145 | int event; | 158 | int event; |
| 146 | struct list_head list; | 159 | struct list_head list; |
| 147 | 160 | ||
| 161 | size_t atomic_write_len; | ||
| 148 | bool mmapped; | 162 | bool mmapped; |
| 149 | const struct vm_operations_struct *vm_ops; | 163 | const struct vm_operations_struct *vm_ops; |
| 150 | }; | 164 | }; |
| @@ -171,9 +185,13 @@ struct kernfs_ops { | |||
| 171 | loff_t off); | 185 | loff_t off); |
| 172 | 186 | ||
| 173 | /* | 187 | /* |
| 174 | * write() is bounced through kernel buffer and a write larger than | 188 | * write() is bounced through kernel buffer. If atomic_write_len |
| 175 | * PAGE_SIZE results in partial operation of PAGE_SIZE. | 189 | * is not set, a write larger than PAGE_SIZE results in partial |
| 190 | * operations of PAGE_SIZE chunks. If atomic_write_len is set, | ||
| 191 | * writes upto the specified size are executed atomically but | ||
| 192 | * larger ones are rejected with -E2BIG. | ||
| 176 | */ | 193 | */ |
| 194 | size_t atomic_write_len; | ||
| 177 | ssize_t (*write)(struct kernfs_open_file *of, char *buf, size_t bytes, | 195 | ssize_t (*write)(struct kernfs_open_file *of, char *buf, size_t bytes, |
| 178 | loff_t off); | 196 | loff_t off); |
| 179 | 197 | ||
| @@ -184,7 +202,7 @@ struct kernfs_ops { | |||
| 184 | #endif | 202 | #endif |
| 185 | }; | 203 | }; |
| 186 | 204 | ||
| 187 | #ifdef CONFIG_SYSFS | 205 | #ifdef CONFIG_KERNFS |
| 188 | 206 | ||
| 189 | static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn) | 207 | static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn) |
| 190 | { | 208 | { |
| @@ -217,13 +235,22 @@ static inline bool kernfs_ns_enabled(struct kernfs_node *kn) | |||
| 217 | return kn->flags & KERNFS_NS; | 235 | return kn->flags & KERNFS_NS; |
| 218 | } | 236 | } |
| 219 | 237 | ||
| 238 | int kernfs_name(struct kernfs_node *kn, char *buf, size_t buflen); | ||
| 239 | char * __must_check kernfs_path(struct kernfs_node *kn, char *buf, | ||
| 240 | size_t buflen); | ||
| 241 | void pr_cont_kernfs_name(struct kernfs_node *kn); | ||
| 242 | void pr_cont_kernfs_path(struct kernfs_node *kn); | ||
| 243 | struct kernfs_node *kernfs_get_parent(struct kernfs_node *kn); | ||
| 220 | struct kernfs_node *kernfs_find_and_get_ns(struct kernfs_node *parent, | 244 | struct kernfs_node *kernfs_find_and_get_ns(struct kernfs_node *parent, |
| 221 | const char *name, const void *ns); | 245 | const char *name, const void *ns); |
| 222 | void kernfs_get(struct kernfs_node *kn); | 246 | void kernfs_get(struct kernfs_node *kn); |
| 223 | void kernfs_put(struct kernfs_node *kn); | 247 | void kernfs_put(struct kernfs_node *kn); |
| 224 | 248 | ||
| 225 | struct kernfs_root *kernfs_create_root(struct kernfs_dir_ops *kdops, | 249 | struct kernfs_node *kernfs_node_from_dentry(struct dentry *dentry); |
| 226 | void *priv); | 250 | struct kernfs_root *kernfs_root_from_sb(struct super_block *sb); |
| 251 | |||
| 252 | struct kernfs_root *kernfs_create_root(struct kernfs_syscall_ops *scops, | ||
| 253 | unsigned int flags, void *priv); | ||
| 227 | void kernfs_destroy_root(struct kernfs_root *root); | 254 | void kernfs_destroy_root(struct kernfs_root *root); |
| 228 | 255 | ||
| 229 | struct kernfs_node *kernfs_create_dir_ns(struct kernfs_node *parent, | 256 | struct kernfs_node *kernfs_create_dir_ns(struct kernfs_node *parent, |
| @@ -239,7 +266,11 @@ struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent, | |||
| 239 | struct kernfs_node *kernfs_create_link(struct kernfs_node *parent, | 266 | struct kernfs_node *kernfs_create_link(struct kernfs_node *parent, |
| 240 | const char *name, | 267 | const char *name, |
| 241 | struct kernfs_node *target); | 268 | struct kernfs_node *target); |
| 269 | void kernfs_activate(struct kernfs_node *kn); | ||
| 242 | void kernfs_remove(struct kernfs_node *kn); | 270 | void kernfs_remove(struct kernfs_node *kn); |
| 271 | void kernfs_break_active_protection(struct kernfs_node *kn); | ||
| 272 | void kernfs_unbreak_active_protection(struct kernfs_node *kn); | ||
| 273 | bool kernfs_remove_self(struct kernfs_node *kn); | ||
| 243 | int kernfs_remove_by_name_ns(struct kernfs_node *parent, const char *name, | 274 | int kernfs_remove_by_name_ns(struct kernfs_node *parent, const char *name, |
| 244 | const void *ns); | 275 | const void *ns); |
| 245 | int kernfs_rename_ns(struct kernfs_node *kn, struct kernfs_node *new_parent, | 276 | int kernfs_rename_ns(struct kernfs_node *kn, struct kernfs_node *new_parent, |
| @@ -249,12 +280,13 @@ void kernfs_notify(struct kernfs_node *kn); | |||
| 249 | 280 | ||
| 250 | const void *kernfs_super_ns(struct super_block *sb); | 281 | const void *kernfs_super_ns(struct super_block *sb); |
| 251 | struct dentry *kernfs_mount_ns(struct file_system_type *fs_type, int flags, | 282 | struct dentry *kernfs_mount_ns(struct file_system_type *fs_type, int flags, |
| 252 | struct kernfs_root *root, const void *ns); | 283 | struct kernfs_root *root, bool *new_sb_created, |
| 284 | const void *ns); | ||
| 253 | void kernfs_kill_sb(struct super_block *sb); | 285 | void kernfs_kill_sb(struct super_block *sb); |
| 254 | 286 | ||
| 255 | void kernfs_init(void); | 287 | void kernfs_init(void); |
| 256 | 288 | ||
| 257 | #else /* CONFIG_SYSFS */ | 289 | #else /* CONFIG_KERNFS */ |
| 258 | 290 | ||
| 259 | static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn) | 291 | static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn) |
| 260 | { return 0; } /* whatever */ | 292 | { return 0; } /* whatever */ |
| @@ -264,6 +296,19 @@ static inline void kernfs_enable_ns(struct kernfs_node *kn) { } | |||
| 264 | static inline bool kernfs_ns_enabled(struct kernfs_node *kn) | 296 | static inline bool kernfs_ns_enabled(struct kernfs_node *kn) |
| 265 | { return false; } | 297 | { return false; } |
| 266 | 298 | ||
| 299 | static inline int kernfs_name(struct kernfs_node *kn, char *buf, size_t buflen) | ||
| 300 | { return -ENOSYS; } | ||
| 301 | |||
| 302 | static inline char * __must_check kernfs_path(struct kernfs_node *kn, char *buf, | ||
| 303 | size_t buflen) | ||
| 304 | { return NULL; } | ||
| 305 | |||
| 306 | static inline void pr_cont_kernfs_name(struct kernfs_node *kn) { } | ||
| 307 | static inline void pr_cont_kernfs_path(struct kernfs_node *kn) { } | ||
| 308 | |||
| 309 | static inline struct kernfs_node *kernfs_get_parent(struct kernfs_node *kn) | ||
| 310 | { return NULL; } | ||
| 311 | |||
| 267 | static inline struct kernfs_node * | 312 | static inline struct kernfs_node * |
| 268 | kernfs_find_and_get_ns(struct kernfs_node *parent, const char *name, | 313 | kernfs_find_and_get_ns(struct kernfs_node *parent, const char *name, |
| 269 | const void *ns) | 314 | const void *ns) |
| @@ -272,8 +317,15 @@ kernfs_find_and_get_ns(struct kernfs_node *parent, const char *name, | |||
| 272 | static inline void kernfs_get(struct kernfs_node *kn) { } | 317 | static inline void kernfs_get(struct kernfs_node *kn) { } |
| 273 | static inline void kernfs_put(struct kernfs_node *kn) { } | 318 | static inline void kernfs_put(struct kernfs_node *kn) { } |
| 274 | 319 | ||
| 320 | static inline struct kernfs_node *kernfs_node_from_dentry(struct dentry *dentry) | ||
| 321 | { return NULL; } | ||
| 322 | |||
| 323 | static inline struct kernfs_root *kernfs_root_from_sb(struct super_block *sb) | ||
| 324 | { return NULL; } | ||
| 325 | |||
| 275 | static inline struct kernfs_root * | 326 | static inline struct kernfs_root * |
| 276 | kernfs_create_root(struct kernfs_dir_ops *kdops, void *priv) | 327 | kernfs_create_root(struct kernfs_syscall_ops *scops, unsigned int flags, |
| 328 | void *priv) | ||
| 277 | { return ERR_PTR(-ENOSYS); } | 329 | { return ERR_PTR(-ENOSYS); } |
| 278 | 330 | ||
| 279 | static inline void kernfs_destroy_root(struct kernfs_root *root) { } | 331 | static inline void kernfs_destroy_root(struct kernfs_root *root) { } |
| @@ -295,8 +347,13 @@ kernfs_create_link(struct kernfs_node *parent, const char *name, | |||
| 295 | struct kernfs_node *target) | 347 | struct kernfs_node *target) |
| 296 | { return ERR_PTR(-ENOSYS); } | 348 | { return ERR_PTR(-ENOSYS); } |
| 297 | 349 | ||
| 350 | static inline void kernfs_activate(struct kernfs_node *kn) { } | ||
| 351 | |||
| 298 | static inline void kernfs_remove(struct kernfs_node *kn) { } | 352 | static inline void kernfs_remove(struct kernfs_node *kn) { } |
| 299 | 353 | ||
| 354 | static inline bool kernfs_remove_self(struct kernfs_node *kn) | ||
| 355 | { return false; } | ||
| 356 | |||
| 300 | static inline int kernfs_remove_by_name_ns(struct kernfs_node *kn, | 357 | static inline int kernfs_remove_by_name_ns(struct kernfs_node *kn, |
| 301 | const char *name, const void *ns) | 358 | const char *name, const void *ns) |
| 302 | { return -ENOSYS; } | 359 | { return -ENOSYS; } |
| @@ -317,14 +374,14 @@ static inline const void *kernfs_super_ns(struct super_block *sb) | |||
| 317 | 374 | ||
| 318 | static inline struct dentry * | 375 | static inline struct dentry * |
| 319 | kernfs_mount_ns(struct file_system_type *fs_type, int flags, | 376 | kernfs_mount_ns(struct file_system_type *fs_type, int flags, |
| 320 | struct kernfs_root *root, const void *ns) | 377 | struct kernfs_root *root, bool *new_sb_created, const void *ns) |
| 321 | { return ERR_PTR(-ENOSYS); } | 378 | { return ERR_PTR(-ENOSYS); } |
| 322 | 379 | ||
| 323 | static inline void kernfs_kill_sb(struct super_block *sb) { } | 380 | static inline void kernfs_kill_sb(struct super_block *sb) { } |
| 324 | 381 | ||
| 325 | static inline void kernfs_init(void) { } | 382 | static inline void kernfs_init(void) { } |
| 326 | 383 | ||
| 327 | #endif /* CONFIG_SYSFS */ | 384 | #endif /* CONFIG_KERNFS */ |
| 328 | 385 | ||
| 329 | static inline struct kernfs_node * | 386 | static inline struct kernfs_node * |
| 330 | kernfs_find_and_get(struct kernfs_node *kn, const char *name) | 387 | kernfs_find_and_get(struct kernfs_node *kn, const char *name) |
| @@ -366,11 +423,18 @@ static inline int kernfs_remove_by_name(struct kernfs_node *parent, | |||
| 366 | return kernfs_remove_by_name_ns(parent, name, NULL); | 423 | return kernfs_remove_by_name_ns(parent, name, NULL); |
| 367 | } | 424 | } |
| 368 | 425 | ||
| 426 | static inline int kernfs_rename(struct kernfs_node *kn, | ||
| 427 | struct kernfs_node *new_parent, | ||
| 428 | const char *new_name) | ||
| 429 | { | ||
| 430 | return kernfs_rename_ns(kn, new_parent, new_name, NULL); | ||
| 431 | } | ||
| 432 | |||
| 369 | static inline struct dentry * | 433 | static inline struct dentry * |
| 370 | kernfs_mount(struct file_system_type *fs_type, int flags, | 434 | kernfs_mount(struct file_system_type *fs_type, int flags, |
| 371 | struct kernfs_root *root) | 435 | struct kernfs_root *root, bool *new_sb_created) |
| 372 | { | 436 | { |
| 373 | return kernfs_mount_ns(fs_type, flags, root, NULL); | 437 | return kernfs_mount_ns(fs_type, flags, root, new_sb_created, NULL); |
| 374 | } | 438 | } |
| 375 | 439 | ||
| 376 | #endif /* __LINUX_KERNFS_H */ | 440 | #endif /* __LINUX_KERNFS_H */ |
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index 6d4066cdb5b5..a75641930049 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
| @@ -127,12 +127,6 @@ extern asmlinkage long sys_kexec_load(unsigned long entry, | |||
| 127 | struct kexec_segment __user *segments, | 127 | struct kexec_segment __user *segments, |
| 128 | unsigned long flags); | 128 | unsigned long flags); |
| 129 | extern int kernel_kexec(void); | 129 | extern int kernel_kexec(void); |
| 130 | #ifdef CONFIG_COMPAT | ||
| 131 | extern asmlinkage long compat_sys_kexec_load(unsigned long entry, | ||
| 132 | unsigned long nr_segments, | ||
| 133 | struct compat_kexec_segment __user *segments, | ||
| 134 | unsigned long flags); | ||
| 135 | #endif | ||
| 136 | extern struct page *kimage_alloc_control_pages(struct kimage *image, | 130 | extern struct page *kimage_alloc_control_pages(struct kimage *image, |
| 137 | unsigned int order); | 131 | unsigned int order); |
| 138 | extern void crash_kexec(struct pt_regs *); | 132 | extern void crash_kexec(struct pt_regs *); |
diff --git a/include/linux/libata.h b/include/linux/libata.h index bec6dbe939a0..1de36be64df4 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -848,7 +848,6 @@ struct ata_port { | |||
| 848 | struct completion park_req_pending; | 848 | struct completion park_req_pending; |
| 849 | 849 | ||
| 850 | pm_message_t pm_mesg; | 850 | pm_message_t pm_mesg; |
| 851 | int *pm_result; | ||
| 852 | enum ata_lpm_policy target_lpm_policy; | 851 | enum ata_lpm_policy target_lpm_policy; |
| 853 | 852 | ||
| 854 | struct timer_list fastdrain_timer; | 853 | struct timer_list fastdrain_timer; |
| @@ -1140,16 +1139,14 @@ extern bool ata_link_offline(struct ata_link *link); | |||
| 1140 | #ifdef CONFIG_PM | 1139 | #ifdef CONFIG_PM |
| 1141 | extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg); | 1140 | extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg); |
| 1142 | extern void ata_host_resume(struct ata_host *host); | 1141 | extern void ata_host_resume(struct ata_host *host); |
| 1143 | extern int ata_sas_port_async_suspend(struct ata_port *ap, int *async); | 1142 | extern void ata_sas_port_suspend(struct ata_port *ap); |
| 1144 | extern int ata_sas_port_async_resume(struct ata_port *ap, int *async); | 1143 | extern void ata_sas_port_resume(struct ata_port *ap); |
| 1145 | #else | 1144 | #else |
| 1146 | static inline int ata_sas_port_async_suspend(struct ata_port *ap, int *async) | 1145 | static inline void ata_sas_port_suspend(struct ata_port *ap) |
| 1147 | { | 1146 | { |
| 1148 | return 0; | ||
| 1149 | } | 1147 | } |
| 1150 | static inline int ata_sas_port_async_resume(struct ata_port *ap, int *async) | 1148 | static inline void ata_sas_port_resume(struct ata_port *ap) |
| 1151 | { | 1149 | { |
| 1152 | return 0; | ||
| 1153 | } | 1150 | } |
| 1154 | #endif | 1151 | #endif |
| 1155 | extern int ata_ratelimit(void); | 1152 | extern int ata_ratelimit(void); |
diff --git a/include/linux/linkage.h b/include/linux/linkage.h index a6a42dd02466..34a513a2727b 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h | |||
| @@ -12,9 +12,9 @@ | |||
| 12 | #endif | 12 | #endif |
| 13 | 13 | ||
| 14 | #ifdef __cplusplus | 14 | #ifdef __cplusplus |
| 15 | #define CPP_ASMLINKAGE extern "C" | 15 | #define CPP_ASMLINKAGE extern "C" __visible |
| 16 | #else | 16 | #else |
| 17 | #define CPP_ASMLINKAGE | 17 | #define CPP_ASMLINKAGE __visible |
| 18 | #endif | 18 | #endif |
| 19 | 19 | ||
| 20 | #ifndef asmlinkage | 20 | #ifndef asmlinkage |
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index 92b1bfc5da60..008388f920d7 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h | |||
| @@ -252,9 +252,9 @@ struct held_lock { | |||
| 252 | unsigned int trylock:1; /* 16 bits */ | 252 | unsigned int trylock:1; /* 16 bits */ |
| 253 | 253 | ||
| 254 | unsigned int read:2; /* see lock_acquire() comment */ | 254 | unsigned int read:2; /* see lock_acquire() comment */ |
| 255 | unsigned int check:2; /* see lock_acquire() comment */ | 255 | unsigned int check:1; /* see lock_acquire() comment */ |
| 256 | unsigned int hardirqs_off:1; | 256 | unsigned int hardirqs_off:1; |
| 257 | unsigned int references:11; /* 32 bits */ | 257 | unsigned int references:12; /* 32 bits */ |
| 258 | }; | 258 | }; |
| 259 | 259 | ||
| 260 | /* | 260 | /* |
| @@ -265,7 +265,7 @@ extern void lockdep_info(void); | |||
| 265 | extern void lockdep_reset(void); | 265 | extern void lockdep_reset(void); |
| 266 | extern void lockdep_reset_lock(struct lockdep_map *lock); | 266 | extern void lockdep_reset_lock(struct lockdep_map *lock); |
| 267 | extern void lockdep_free_key_range(void *start, unsigned long size); | 267 | extern void lockdep_free_key_range(void *start, unsigned long size); |
| 268 | extern void lockdep_sys_exit(void); | 268 | extern asmlinkage void lockdep_sys_exit(void); |
| 269 | 269 | ||
| 270 | extern void lockdep_off(void); | 270 | extern void lockdep_off(void); |
| 271 | extern void lockdep_on(void); | 271 | extern void lockdep_on(void); |
| @@ -303,7 +303,7 @@ extern void lockdep_init_map(struct lockdep_map *lock, const char *name, | |||
| 303 | (lock)->dep_map.key, sub) | 303 | (lock)->dep_map.key, sub) |
| 304 | 304 | ||
| 305 | #define lockdep_set_novalidate_class(lock) \ | 305 | #define lockdep_set_novalidate_class(lock) \ |
| 306 | lockdep_set_class(lock, &__lockdep_no_validate__) | 306 | lockdep_set_class_and_name(lock, &__lockdep_no_validate__, #lock) |
| 307 | /* | 307 | /* |
| 308 | * Compare locking classes | 308 | * Compare locking classes |
| 309 | */ | 309 | */ |
| @@ -326,9 +326,8 @@ static inline int lockdep_match_key(struct lockdep_map *lock, | |||
| 326 | * | 326 | * |
| 327 | * Values for check: | 327 | * Values for check: |
| 328 | * | 328 | * |
| 329 | * 0: disabled | 329 | * 0: simple checks (freeing, held-at-exit-time, etc.) |
| 330 | * 1: simple checks (freeing, held-at-exit-time, etc.) | 330 | * 1: full validation |
| 331 | * 2: full validation | ||
| 332 | */ | 331 | */ |
| 333 | extern void lock_acquire(struct lockdep_map *lock, unsigned int subclass, | 332 | extern void lock_acquire(struct lockdep_map *lock, unsigned int subclass, |
| 334 | int trylock, int read, int check, | 333 | int trylock, int read, int check, |
| @@ -479,15 +478,9 @@ static inline void print_irqtrace_events(struct task_struct *curr) | |||
| 479 | * on the per lock-class debug mode: | 478 | * on the per lock-class debug mode: |
| 480 | */ | 479 | */ |
| 481 | 480 | ||
| 482 | #ifdef CONFIG_PROVE_LOCKING | 481 | #define lock_acquire_exclusive(l, s, t, n, i) lock_acquire(l, s, t, 0, 1, n, i) |
| 483 | #define lock_acquire_exclusive(l, s, t, n, i) lock_acquire(l, s, t, 0, 2, n, i) | 482 | #define lock_acquire_shared(l, s, t, n, i) lock_acquire(l, s, t, 1, 1, n, i) |
| 484 | #define lock_acquire_shared(l, s, t, n, i) lock_acquire(l, s, t, 1, 2, n, i) | 483 | #define lock_acquire_shared_recursive(l, s, t, n, i) lock_acquire(l, s, t, 2, 1, n, i) |
| 485 | #define lock_acquire_shared_recursive(l, s, t, n, i) lock_acquire(l, s, t, 2, 2, n, i) | ||
| 486 | #else | ||
| 487 | #define lock_acquire_exclusive(l, s, t, n, i) lock_acquire(l, s, t, 0, 1, n, i) | ||
| 488 | #define lock_acquire_shared(l, s, t, n, i) lock_acquire(l, s, t, 1, 1, n, i) | ||
| 489 | #define lock_acquire_shared_recursive(l, s, t, n, i) lock_acquire(l, s, t, 2, 1, n, i) | ||
| 490 | #endif | ||
| 491 | 484 | ||
| 492 | #define spin_acquire(l, s, t, i) lock_acquire_exclusive(l, s, t, NULL, i) | 485 | #define spin_acquire(l, s, t, i) lock_acquire_exclusive(l, s, t, NULL, i) |
| 493 | #define spin_acquire_nest(l, s, t, n, i) lock_acquire_exclusive(l, s, t, n, i) | 486 | #define spin_acquire_nest(l, s, t, n, i) lock_acquire_exclusive(l, s, t, n, i) |
| @@ -518,13 +511,13 @@ static inline void print_irqtrace_events(struct task_struct *curr) | |||
| 518 | # define might_lock(lock) \ | 511 | # define might_lock(lock) \ |
| 519 | do { \ | 512 | do { \ |
| 520 | typecheck(struct lockdep_map *, &(lock)->dep_map); \ | 513 | typecheck(struct lockdep_map *, &(lock)->dep_map); \ |
| 521 | lock_acquire(&(lock)->dep_map, 0, 0, 0, 2, NULL, _THIS_IP_); \ | 514 | lock_acquire(&(lock)->dep_map, 0, 0, 0, 1, NULL, _THIS_IP_); \ |
| 522 | lock_release(&(lock)->dep_map, 0, _THIS_IP_); \ | 515 | lock_release(&(lock)->dep_map, 0, _THIS_IP_); \ |
| 523 | } while (0) | 516 | } while (0) |
| 524 | # define might_lock_read(lock) \ | 517 | # define might_lock_read(lock) \ |
| 525 | do { \ | 518 | do { \ |
| 526 | typecheck(struct lockdep_map *, &(lock)->dep_map); \ | 519 | typecheck(struct lockdep_map *, &(lock)->dep_map); \ |
| 527 | lock_acquire(&(lock)->dep_map, 0, 0, 1, 2, NULL, _THIS_IP_); \ | 520 | lock_acquire(&(lock)->dep_map, 0, 0, 1, 1, NULL, _THIS_IP_); \ |
| 528 | lock_release(&(lock)->dep_map, 0, _THIS_IP_); \ | 521 | lock_release(&(lock)->dep_map, 0, _THIS_IP_); \ |
| 529 | } while (0) | 522 | } while (0) |
| 530 | #else | 523 | #else |
diff --git a/include/linux/mcb.h b/include/linux/mcb.h new file mode 100644 index 000000000000..2db284d14064 --- /dev/null +++ b/include/linux/mcb.h | |||
| @@ -0,0 +1,119 @@ | |||
| 1 | /* | ||
| 2 | * MEN Chameleon Bus. | ||
| 3 | * | ||
| 4 | * Copyright (C) 2014 MEN Mikroelektronik GmbH (www.men.de) | ||
| 5 | * Author: Johannes Thumshirn <johannes.thumshirn@men.de> | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify it | ||
| 8 | * under the terms of the GNU General Public License as published by the Free | ||
| 9 | * Software Foundation; version 2 of the License. | ||
| 10 | */ | ||
| 11 | #ifndef _LINUX_MCB_H | ||
| 12 | #define _LINUX_MCB_H | ||
| 13 | |||
| 14 | #include <linux/mod_devicetable.h> | ||
| 15 | #include <linux/device.h> | ||
| 16 | #include <linux/irqreturn.h> | ||
| 17 | |||
| 18 | struct mcb_driver; | ||
| 19 | |||
| 20 | /** | ||
| 21 | * struct mcb_bus - MEN Chameleon Bus | ||
| 22 | * | ||
| 23 | * @dev: pointer to carrier device | ||
| 24 | * @children: the child busses | ||
| 25 | * @bus_nr: mcb bus number | ||
| 26 | */ | ||
| 27 | struct mcb_bus { | ||
| 28 | struct list_head children; | ||
| 29 | struct device dev; | ||
| 30 | int bus_nr; | ||
| 31 | }; | ||
| 32 | #define to_mcb_bus(b) container_of((b), struct mcb_bus, dev) | ||
| 33 | |||
| 34 | /** | ||
| 35 | * struct mcb_device - MEN Chameleon Bus device | ||
| 36 | * | ||
| 37 | * @bus_list: internal list handling for bus code | ||
| 38 | * @dev: device in kernel representation | ||
| 39 | * @bus: mcb bus the device is plugged to | ||
| 40 | * @subordinate: subordinate MCBus in case of bridge | ||
| 41 | * @is_added: flag to check if device is added to bus | ||
| 42 | * @driver: associated mcb_driver | ||
| 43 | * @id: mcb device id | ||
| 44 | * @inst: instance in Chameleon table | ||
| 45 | * @group: group in Chameleon table | ||
| 46 | * @var: variant in Chameleon table | ||
| 47 | * @bar: BAR in Chameleon table | ||
| 48 | * @rev: revision in Chameleon table | ||
| 49 | * @irq: IRQ resource | ||
| 50 | * @memory: memory resource | ||
| 51 | */ | ||
| 52 | struct mcb_device { | ||
| 53 | struct list_head bus_list; | ||
| 54 | struct device dev; | ||
| 55 | struct mcb_bus *bus; | ||
| 56 | struct mcb_bus *subordinate; | ||
| 57 | bool is_added; | ||
| 58 | struct mcb_driver *driver; | ||
| 59 | u16 id; | ||
| 60 | int inst; | ||
| 61 | int group; | ||
| 62 | int var; | ||
| 63 | int bar; | ||
| 64 | int rev; | ||
| 65 | struct resource irq; | ||
| 66 | struct resource mem; | ||
| 67 | }; | ||
| 68 | #define to_mcb_device(x) container_of((x), struct mcb_device, dev) | ||
| 69 | |||
| 70 | /** | ||
| 71 | * struct mcb_driver - MEN Chameleon Bus device driver | ||
| 72 | * | ||
| 73 | * @driver: device_driver | ||
| 74 | * @id_table: mcb id table | ||
| 75 | * @probe: probe callback | ||
| 76 | * @remove: remove callback | ||
| 77 | * @shutdown: shutdown callback | ||
| 78 | */ | ||
| 79 | struct mcb_driver { | ||
| 80 | struct device_driver driver; | ||
| 81 | const struct mcb_device_id *id_table; | ||
| 82 | int (*probe)(struct mcb_device *mdev, const struct mcb_device_id *id); | ||
| 83 | void (*remove)(struct mcb_device *mdev); | ||
| 84 | void (*shutdown)(struct mcb_device *mdev); | ||
| 85 | }; | ||
| 86 | #define to_mcb_driver(x) container_of((x), struct mcb_driver, driver) | ||
| 87 | |||
| 88 | static inline void *mcb_get_drvdata(struct mcb_device *dev) | ||
| 89 | { | ||
| 90 | return dev_get_drvdata(&dev->dev); | ||
| 91 | } | ||
| 92 | |||
| 93 | static inline void mcb_set_drvdata(struct mcb_device *dev, void *data) | ||
| 94 | { | ||
| 95 | dev_set_drvdata(&dev->dev, data); | ||
| 96 | } | ||
| 97 | |||
| 98 | extern int __must_check __mcb_register_driver(struct mcb_driver *drv, | ||
| 99 | struct module *owner, | ||
| 100 | const char *mod_name); | ||
| 101 | #define mcb_register_driver(driver) \ | ||
| 102 | __mcb_register_driver(driver, THIS_MODULE, KBUILD_MODNAME) | ||
| 103 | extern void mcb_unregister_driver(struct mcb_driver *driver); | ||
| 104 | #define module_mcb_driver(__mcb_driver) \ | ||
| 105 | module_driver(__mcb_driver, mcb_register_driver, mcb_unregister_driver); | ||
| 106 | extern void mcb_bus_add_devices(const struct mcb_bus *bus); | ||
| 107 | extern int mcb_device_register(struct mcb_bus *bus, struct mcb_device *dev); | ||
| 108 | extern struct mcb_bus *mcb_alloc_bus(void); | ||
| 109 | extern struct mcb_bus *mcb_bus_get(struct mcb_bus *bus); | ||
| 110 | extern void mcb_bus_put(struct mcb_bus *bus); | ||
| 111 | extern struct mcb_device *mcb_alloc_dev(struct mcb_bus *bus); | ||
| 112 | extern void mcb_free_dev(struct mcb_device *dev); | ||
| 113 | extern void mcb_release_bus(struct mcb_bus *bus); | ||
| 114 | extern struct resource *mcb_request_mem(struct mcb_device *dev, | ||
| 115 | const char *name); | ||
| 116 | extern void mcb_release_mem(struct resource *mem); | ||
| 117 | extern int mcb_get_irq(struct mcb_device *dev); | ||
| 118 | |||
| 119 | #endif /* _LINUX_MCB_H */ | ||
diff --git a/include/linux/mfd/arizona/registers.h b/include/linux/mfd/arizona/registers.h index fdf3aa376eb2..3ddaa634b19d 100644 --- a/include/linux/mfd/arizona/registers.h +++ b/include/linux/mfd/arizona/registers.h | |||
| @@ -1702,9 +1702,9 @@ | |||
| 1702 | /* | 1702 | /* |
| 1703 | * R373 (0x175) - FLL1 Control 5 | 1703 | * R373 (0x175) - FLL1 Control 5 |
| 1704 | */ | 1704 | */ |
| 1705 | #define ARIZONA_FLL1_FRATIO_MASK 0x0700 /* FLL1_FRATIO - [10:8] */ | 1705 | #define ARIZONA_FLL1_FRATIO_MASK 0x0F00 /* FLL1_FRATIO - [11:8] */ |
| 1706 | #define ARIZONA_FLL1_FRATIO_SHIFT 8 /* FLL1_FRATIO - [10:8] */ | 1706 | #define ARIZONA_FLL1_FRATIO_SHIFT 8 /* FLL1_FRATIO - [11:8] */ |
| 1707 | #define ARIZONA_FLL1_FRATIO_WIDTH 3 /* FLL1_FRATIO - [10:8] */ | 1707 | #define ARIZONA_FLL1_FRATIO_WIDTH 4 /* FLL1_FRATIO - [11:8] */ |
| 1708 | #define ARIZONA_FLL1_OUTDIV_MASK 0x000E /* FLL1_OUTDIV - [3:1] */ | 1708 | #define ARIZONA_FLL1_OUTDIV_MASK 0x000E /* FLL1_OUTDIV - [3:1] */ |
| 1709 | #define ARIZONA_FLL1_OUTDIV_SHIFT 1 /* FLL1_OUTDIV - [3:1] */ | 1709 | #define ARIZONA_FLL1_OUTDIV_SHIFT 1 /* FLL1_OUTDIV - [3:1] */ |
| 1710 | #define ARIZONA_FLL1_OUTDIV_WIDTH 3 /* FLL1_OUTDIV - [3:1] */ | 1710 | #define ARIZONA_FLL1_OUTDIV_WIDTH 3 /* FLL1_OUTDIV - [3:1] */ |
diff --git a/include/linux/mfd/max8997-private.h b/include/linux/mfd/max8997-private.h index ad1ae7f345ad..78c76cd4d37b 100644 --- a/include/linux/mfd/max8997-private.h +++ b/include/linux/mfd/max8997-private.h | |||
| @@ -387,7 +387,7 @@ struct max8997_dev { | |||
| 387 | struct i2c_client *muic; /* slave addr 0x4a */ | 387 | struct i2c_client *muic; /* slave addr 0x4a */ |
| 388 | struct mutex iolock; | 388 | struct mutex iolock; |
| 389 | 389 | ||
| 390 | int type; | 390 | unsigned long type; |
| 391 | struct platform_device *battery; /* battery control (not fuel gauge) */ | 391 | struct platform_device *battery; /* battery control (not fuel gauge) */ |
| 392 | 392 | ||
| 393 | int irq; | 393 | int irq; |
diff --git a/include/linux/mfd/max8998-private.h b/include/linux/mfd/max8998-private.h index 4ecb24b4b863..d68ada502ff3 100644 --- a/include/linux/mfd/max8998-private.h +++ b/include/linux/mfd/max8998-private.h | |||
| @@ -163,7 +163,7 @@ struct max8998_dev { | |||
| 163 | int ono; | 163 | int ono; |
| 164 | u8 irq_masks_cur[MAX8998_NUM_IRQ_REGS]; | 164 | u8 irq_masks_cur[MAX8998_NUM_IRQ_REGS]; |
| 165 | u8 irq_masks_cache[MAX8998_NUM_IRQ_REGS]; | 165 | u8 irq_masks_cache[MAX8998_NUM_IRQ_REGS]; |
| 166 | int type; | 166 | unsigned long type; |
| 167 | bool wakeup; | 167 | bool wakeup; |
| 168 | }; | 168 | }; |
| 169 | 169 | ||
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h index 41c9bde410c5..157e32b6ca28 100644 --- a/include/linux/mfd/samsung/core.h +++ b/include/linux/mfd/samsung/core.h | |||
| @@ -18,7 +18,9 @@ enum sec_device_type { | |||
| 18 | S5M8751X, | 18 | S5M8751X, |
| 19 | S5M8763X, | 19 | S5M8763X, |
| 20 | S5M8767X, | 20 | S5M8767X, |
| 21 | S2MPA01, | ||
| 21 | S2MPS11X, | 22 | S2MPS11X, |
| 23 | S2MPS14X, | ||
| 22 | }; | 24 | }; |
| 23 | 25 | ||
| 24 | /** | 26 | /** |
| @@ -50,7 +52,7 @@ struct sec_pmic_dev { | |||
| 50 | struct regmap_irq_chip_data *irq_data; | 52 | struct regmap_irq_chip_data *irq_data; |
| 51 | 53 | ||
| 52 | int ono; | 54 | int ono; |
| 53 | int type; | 55 | unsigned long type; |
| 54 | bool wakeup; | 56 | bool wakeup; |
| 55 | bool wtsr_smpl; | 57 | bool wtsr_smpl; |
| 56 | }; | 58 | }; |
| @@ -92,7 +94,7 @@ struct sec_platform_data { | |||
| 92 | int buck3_default_idx; | 94 | int buck3_default_idx; |
| 93 | int buck4_default_idx; | 95 | int buck4_default_idx; |
| 94 | 96 | ||
| 95 | int buck_ramp_delay; | 97 | int buck_ramp_delay; |
| 96 | 98 | ||
| 97 | int buck2_ramp_delay; | 99 | int buck2_ramp_delay; |
| 98 | int buck34_ramp_delay; | 100 | int buck34_ramp_delay; |
| @@ -100,10 +102,15 @@ struct sec_platform_data { | |||
| 100 | int buck16_ramp_delay; | 102 | int buck16_ramp_delay; |
| 101 | int buck7810_ramp_delay; | 103 | int buck7810_ramp_delay; |
| 102 | int buck9_ramp_delay; | 104 | int buck9_ramp_delay; |
| 103 | 105 | int buck24_ramp_delay; | |
| 104 | bool buck2_ramp_enable; | 106 | int buck3_ramp_delay; |
| 105 | bool buck3_ramp_enable; | 107 | int buck7_ramp_delay; |
| 106 | bool buck4_ramp_enable; | 108 | int buck8910_ramp_delay; |
| 109 | |||
| 110 | bool buck1_ramp_enable; | ||
| 111 | bool buck2_ramp_enable; | ||
| 112 | bool buck3_ramp_enable; | ||
| 113 | bool buck4_ramp_enable; | ||
| 107 | bool buck6_ramp_enable; | 114 | bool buck6_ramp_enable; |
| 108 | 115 | ||
| 109 | int buck2_init; | 116 | int buck2_init; |
| @@ -119,7 +126,8 @@ struct sec_platform_data { | |||
| 119 | struct sec_regulator_data { | 126 | struct sec_regulator_data { |
| 120 | int id; | 127 | int id; |
| 121 | struct regulator_init_data *initdata; | 128 | struct regulator_init_data *initdata; |
| 122 | struct device_node *reg_node; | 129 | struct device_node *reg_node; |
| 130 | int ext_control_gpio; | ||
| 123 | }; | 131 | }; |
| 124 | 132 | ||
| 125 | /* | 133 | /* |
diff --git a/include/linux/mfd/samsung/irq.h b/include/linux/mfd/samsung/irq.h index d43b4f9e7fb2..1224f447356b 100644 --- a/include/linux/mfd/samsung/irq.h +++ b/include/linux/mfd/samsung/irq.h | |||
| @@ -13,6 +13,56 @@ | |||
| 13 | #ifndef __LINUX_MFD_SEC_IRQ_H | 13 | #ifndef __LINUX_MFD_SEC_IRQ_H |
| 14 | #define __LINUX_MFD_SEC_IRQ_H | 14 | #define __LINUX_MFD_SEC_IRQ_H |
| 15 | 15 | ||
| 16 | enum s2mpa01_irq { | ||
| 17 | S2MPA01_IRQ_PWRONF, | ||
| 18 | S2MPA01_IRQ_PWRONR, | ||
| 19 | S2MPA01_IRQ_JIGONBF, | ||
| 20 | S2MPA01_IRQ_JIGONBR, | ||
| 21 | S2MPA01_IRQ_ACOKBF, | ||
| 22 | S2MPA01_IRQ_ACOKBR, | ||
| 23 | S2MPA01_IRQ_PWRON1S, | ||
| 24 | S2MPA01_IRQ_MRB, | ||
| 25 | |||
| 26 | S2MPA01_IRQ_RTC60S, | ||
| 27 | S2MPA01_IRQ_RTCA1, | ||
| 28 | S2MPA01_IRQ_RTCA0, | ||
| 29 | S2MPA01_IRQ_SMPL, | ||
| 30 | S2MPA01_IRQ_RTC1S, | ||
| 31 | S2MPA01_IRQ_WTSR, | ||
| 32 | |||
| 33 | S2MPA01_IRQ_INT120C, | ||
| 34 | S2MPA01_IRQ_INT140C, | ||
| 35 | S2MPA01_IRQ_LDO3_TSD, | ||
| 36 | S2MPA01_IRQ_B16_TSD, | ||
| 37 | S2MPA01_IRQ_B24_TSD, | ||
| 38 | S2MPA01_IRQ_B35_TSD, | ||
| 39 | |||
| 40 | S2MPA01_IRQ_NR, | ||
| 41 | }; | ||
| 42 | |||
| 43 | #define S2MPA01_IRQ_PWRONF_MASK (1 << 0) | ||
| 44 | #define S2MPA01_IRQ_PWRONR_MASK (1 << 1) | ||
| 45 | #define S2MPA01_IRQ_JIGONBF_MASK (1 << 2) | ||
| 46 | #define S2MPA01_IRQ_JIGONBR_MASK (1 << 3) | ||
| 47 | #define S2MPA01_IRQ_ACOKBF_MASK (1 << 4) | ||
| 48 | #define S2MPA01_IRQ_ACOKBR_MASK (1 << 5) | ||
| 49 | #define S2MPA01_IRQ_PWRON1S_MASK (1 << 6) | ||
| 50 | #define S2MPA01_IRQ_MRB_MASK (1 << 7) | ||
| 51 | |||
| 52 | #define S2MPA01_IRQ_RTC60S_MASK (1 << 0) | ||
| 53 | #define S2MPA01_IRQ_RTCA1_MASK (1 << 1) | ||
| 54 | #define S2MPA01_IRQ_RTCA0_MASK (1 << 2) | ||
| 55 | #define S2MPA01_IRQ_SMPL_MASK (1 << 3) | ||
| 56 | #define S2MPA01_IRQ_RTC1S_MASK (1 << 4) | ||
| 57 | #define S2MPA01_IRQ_WTSR_MASK (1 << 5) | ||
| 58 | |||
| 59 | #define S2MPA01_IRQ_INT120C_MASK (1 << 0) | ||
| 60 | #define S2MPA01_IRQ_INT140C_MASK (1 << 1) | ||
| 61 | #define S2MPA01_IRQ_LDO3_TSD_MASK (1 << 2) | ||
| 62 | #define S2MPA01_IRQ_B16_TSD_MASK (1 << 3) | ||
| 63 | #define S2MPA01_IRQ_B24_TSD_MASK (1 << 4) | ||
| 64 | #define S2MPA01_IRQ_B35_TSD_MASK (1 << 5) | ||
| 65 | |||
| 16 | enum s2mps11_irq { | 66 | enum s2mps11_irq { |
| 17 | S2MPS11_IRQ_PWRONF, | 67 | S2MPS11_IRQ_PWRONF, |
| 18 | S2MPS11_IRQ_PWRONR, | 68 | S2MPS11_IRQ_PWRONR, |
| @@ -24,8 +74,8 @@ enum s2mps11_irq { | |||
| 24 | S2MPS11_IRQ_MRB, | 74 | S2MPS11_IRQ_MRB, |
| 25 | 75 | ||
| 26 | S2MPS11_IRQ_RTC60S, | 76 | S2MPS11_IRQ_RTC60S, |
| 77 | S2MPS11_IRQ_RTCA0, | ||
| 27 | S2MPS11_IRQ_RTCA1, | 78 | S2MPS11_IRQ_RTCA1, |
| 28 | S2MPS11_IRQ_RTCA2, | ||
| 29 | S2MPS11_IRQ_SMPL, | 79 | S2MPS11_IRQ_SMPL, |
| 30 | S2MPS11_IRQ_RTC1S, | 80 | S2MPS11_IRQ_RTC1S, |
| 31 | S2MPS11_IRQ_WTSR, | 81 | S2MPS11_IRQ_WTSR, |
| @@ -47,7 +97,7 @@ enum s2mps11_irq { | |||
| 47 | 97 | ||
| 48 | #define S2MPS11_IRQ_RTC60S_MASK (1 << 0) | 98 | #define S2MPS11_IRQ_RTC60S_MASK (1 << 0) |
| 49 | #define S2MPS11_IRQ_RTCA1_MASK (1 << 1) | 99 | #define S2MPS11_IRQ_RTCA1_MASK (1 << 1) |
| 50 | #define S2MPS11_IRQ_RTCA2_MASK (1 << 2) | 100 | #define S2MPS11_IRQ_RTCA0_MASK (1 << 2) |
| 51 | #define S2MPS11_IRQ_SMPL_MASK (1 << 3) | 101 | #define S2MPS11_IRQ_SMPL_MASK (1 << 3) |
| 52 | #define S2MPS11_IRQ_RTC1S_MASK (1 << 4) | 102 | #define S2MPS11_IRQ_RTC1S_MASK (1 << 4) |
| 53 | #define S2MPS11_IRQ_WTSR_MASK (1 << 5) | 103 | #define S2MPS11_IRQ_WTSR_MASK (1 << 5) |
| @@ -55,6 +105,33 @@ enum s2mps11_irq { | |||
| 55 | #define S2MPS11_IRQ_INT120C_MASK (1 << 0) | 105 | #define S2MPS11_IRQ_INT120C_MASK (1 << 0) |
| 56 | #define S2MPS11_IRQ_INT140C_MASK (1 << 1) | 106 | #define S2MPS11_IRQ_INT140C_MASK (1 << 1) |
| 57 | 107 | ||
| 108 | enum s2mps14_irq { | ||
| 109 | S2MPS14_IRQ_PWRONF, | ||
| 110 | S2MPS14_IRQ_PWRONR, | ||
| 111 | S2MPS14_IRQ_JIGONBF, | ||
| 112 | S2MPS14_IRQ_JIGONBR, | ||
| 113 | S2MPS14_IRQ_ACOKBF, | ||
| 114 | S2MPS14_IRQ_ACOKBR, | ||
| 115 | S2MPS14_IRQ_PWRON1S, | ||
| 116 | S2MPS14_IRQ_MRB, | ||
| 117 | |||
| 118 | S2MPS14_IRQ_RTC60S, | ||
| 119 | S2MPS14_IRQ_RTCA1, | ||
| 120 | S2MPS14_IRQ_RTCA0, | ||
| 121 | S2MPS14_IRQ_SMPL, | ||
| 122 | S2MPS14_IRQ_RTC1S, | ||
| 123 | S2MPS14_IRQ_WTSR, | ||
| 124 | |||
| 125 | S2MPS14_IRQ_INT120C, | ||
| 126 | S2MPS14_IRQ_INT140C, | ||
| 127 | S2MPS14_IRQ_TSD, | ||
| 128 | |||
| 129 | S2MPS14_IRQ_NR, | ||
| 130 | }; | ||
| 131 | |||
| 132 | /* Masks for interrupts are the same as in s2mps11 */ | ||
| 133 | #define S2MPS14_IRQ_TSD_MASK (1 << 2) | ||
| 134 | |||
| 58 | enum s5m8767_irq { | 135 | enum s5m8767_irq { |
| 59 | S5M8767_IRQ_PWRR, | 136 | S5M8767_IRQ_PWRR, |
| 60 | S5M8767_IRQ_PWRF, | 137 | S5M8767_IRQ_PWRF, |
diff --git a/include/linux/mfd/samsung/rtc.h b/include/linux/mfd/samsung/rtc.h index 94b7cd6d8891..3e02b768d537 100644 --- a/include/linux/mfd/samsung/rtc.h +++ b/include/linux/mfd/samsung/rtc.h | |||
| @@ -1,12 +1,17 @@ | |||
| 1 | /* rtc.h | 1 | /* rtc.h |
| 2 | * | 2 | * |
| 3 | * Copyright (c) 2011 Samsung Electronics Co., Ltd | 3 | * Copyright (c) 2011-2014 Samsung Electronics Co., Ltd |
| 4 | * http://www.samsung.com | 4 | * http://www.samsung.com |
| 5 | * | 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
| 7 | * under the terms of the GNU General Public License as published by the | 7 | * under the terms of the GNU General Public License as published by the |
| 8 | * Free Software Foundation; either version 2 of the License, or (at your | 8 | * Free Software Foundation; either version 2 of the License, or (at your |
| 9 | * option) any later version. | 9 | * option) any later version. |
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 10 | * | 15 | * |
| 11 | */ | 16 | */ |
| 12 | 17 | ||
| @@ -43,6 +48,39 @@ enum sec_rtc_reg { | |||
| 43 | SEC_RTC_STATUS, | 48 | SEC_RTC_STATUS, |
| 44 | SEC_WTSR_SMPL_CNTL, | 49 | SEC_WTSR_SMPL_CNTL, |
| 45 | SEC_RTC_UDR_CON, | 50 | SEC_RTC_UDR_CON, |
| 51 | |||
| 52 | SEC_RTC_REG_MAX, | ||
| 53 | }; | ||
| 54 | |||
| 55 | enum s2mps_rtc_reg { | ||
| 56 | S2MPS_RTC_CTRL, | ||
| 57 | S2MPS_WTSR_SMPL_CNTL, | ||
| 58 | S2MPS_RTC_UDR_CON, | ||
| 59 | S2MPS_RSVD, | ||
| 60 | S2MPS_RTC_SEC, | ||
| 61 | S2MPS_RTC_MIN, | ||
| 62 | S2MPS_RTC_HOUR, | ||
| 63 | S2MPS_RTC_WEEKDAY, | ||
| 64 | S2MPS_RTC_DATE, | ||
| 65 | S2MPS_RTC_MONTH, | ||
| 66 | S2MPS_RTC_YEAR, | ||
| 67 | S2MPS_ALARM0_SEC, | ||
| 68 | S2MPS_ALARM0_MIN, | ||
| 69 | S2MPS_ALARM0_HOUR, | ||
| 70 | S2MPS_ALARM0_WEEKDAY, | ||
| 71 | S2MPS_ALARM0_DATE, | ||
| 72 | S2MPS_ALARM0_MONTH, | ||
| 73 | S2MPS_ALARM0_YEAR, | ||
| 74 | S2MPS_ALARM1_SEC, | ||
| 75 | S2MPS_ALARM1_MIN, | ||
| 76 | S2MPS_ALARM1_HOUR, | ||
| 77 | S2MPS_ALARM1_WEEKDAY, | ||
| 78 | S2MPS_ALARM1_DATE, | ||
| 79 | S2MPS_ALARM1_MONTH, | ||
| 80 | S2MPS_ALARM1_YEAR, | ||
| 81 | S2MPS_OFFSRC, | ||
| 82 | |||
| 83 | S2MPS_RTC_REG_MAX, | ||
| 46 | }; | 84 | }; |
| 47 | 85 | ||
| 48 | #define RTC_I2C_ADDR (0x0C >> 1) | 86 | #define RTC_I2C_ADDR (0x0C >> 1) |
| @@ -54,6 +92,9 @@ enum sec_rtc_reg { | |||
| 54 | #define ALARM1_STATUS (1 << 2) | 92 | #define ALARM1_STATUS (1 << 2) |
| 55 | #define UPDATE_AD (1 << 0) | 93 | #define UPDATE_AD (1 << 0) |
| 56 | 94 | ||
| 95 | #define S2MPS_ALARM0_STATUS (1 << 2) | ||
| 96 | #define S2MPS_ALARM1_STATUS (1 << 1) | ||
| 97 | |||
| 57 | /* RTC Control Register */ | 98 | /* RTC Control Register */ |
| 58 | #define BCD_EN_SHIFT 0 | 99 | #define BCD_EN_SHIFT 0 |
| 59 | #define BCD_EN_MASK (1 << BCD_EN_SHIFT) | 100 | #define BCD_EN_MASK (1 << BCD_EN_SHIFT) |
| @@ -62,6 +103,10 @@ enum sec_rtc_reg { | |||
| 62 | /* RTC Update Register1 */ | 103 | /* RTC Update Register1 */ |
| 63 | #define RTC_UDR_SHIFT 0 | 104 | #define RTC_UDR_SHIFT 0 |
| 64 | #define RTC_UDR_MASK (1 << RTC_UDR_SHIFT) | 105 | #define RTC_UDR_MASK (1 << RTC_UDR_SHIFT) |
| 106 | #define S2MPS_RTC_WUDR_SHIFT 4 | ||
| 107 | #define S2MPS_RTC_WUDR_MASK (1 << S2MPS_RTC_WUDR_SHIFT) | ||
| 108 | #define S2MPS_RTC_RUDR_SHIFT 0 | ||
| 109 | #define S2MPS_RTC_RUDR_MASK (1 << S2MPS_RTC_RUDR_SHIFT) | ||
| 65 | #define RTC_TCON_SHIFT 1 | 110 | #define RTC_TCON_SHIFT 1 |
| 66 | #define RTC_TCON_MASK (1 << RTC_TCON_SHIFT) | 111 | #define RTC_TCON_MASK (1 << RTC_TCON_SHIFT) |
| 67 | #define RTC_TIME_EN_SHIFT 3 | 112 | #define RTC_TIME_EN_SHIFT 3 |
diff --git a/include/linux/mfd/samsung/s2mpa01.h b/include/linux/mfd/samsung/s2mpa01.h new file mode 100644 index 000000000000..fbc63bc0d6a2 --- /dev/null +++ b/include/linux/mfd/samsung/s2mpa01.h | |||
| @@ -0,0 +1,192 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2013 Samsung Electronics Co., Ltd | ||
| 3 | * http://www.samsung.com | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License as published by the | ||
| 7 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 8 | * option) any later version. | ||
| 9 | * | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef __LINUX_MFD_S2MPA01_H | ||
| 13 | #define __LINUX_MFD_S2MPA01_H | ||
| 14 | |||
| 15 | /* S2MPA01 registers */ | ||
| 16 | enum s2mpa01_reg { | ||
| 17 | S2MPA01_REG_ID, | ||
| 18 | S2MPA01_REG_INT1, | ||
| 19 | S2MPA01_REG_INT2, | ||
| 20 | S2MPA01_REG_INT3, | ||
| 21 | S2MPA01_REG_INT1M, | ||
| 22 | S2MPA01_REG_INT2M, | ||
| 23 | S2MPA01_REG_INT3M, | ||
| 24 | S2MPA01_REG_ST1, | ||
| 25 | S2MPA01_REG_ST2, | ||
| 26 | S2MPA01_REG_PWRONSRC, | ||
| 27 | S2MPA01_REG_OFFSRC, | ||
| 28 | S2MPA01_REG_RTC_BUF, | ||
| 29 | S2MPA01_REG_CTRL1, | ||
| 30 | S2MPA01_REG_ETC_TEST, | ||
| 31 | S2MPA01_REG_RSVD1, | ||
| 32 | S2MPA01_REG_BU_CHG, | ||
| 33 | S2MPA01_REG_RAMP1, | ||
| 34 | S2MPA01_REG_RAMP2, | ||
| 35 | S2MPA01_REG_LDO_DSCH1, | ||
| 36 | S2MPA01_REG_LDO_DSCH2, | ||
| 37 | S2MPA01_REG_LDO_DSCH3, | ||
| 38 | S2MPA01_REG_LDO_DSCH4, | ||
| 39 | S2MPA01_REG_OTP_ADRL, | ||
| 40 | S2MPA01_REG_OTP_ADRH, | ||
| 41 | S2MPA01_REG_OTP_DATA, | ||
| 42 | S2MPA01_REG_MON1SEL, | ||
| 43 | S2MPA01_REG_MON2SEL, | ||
| 44 | S2MPA01_REG_LEE, | ||
| 45 | S2MPA01_REG_RSVD2, | ||
| 46 | S2MPA01_REG_RSVD3, | ||
| 47 | S2MPA01_REG_RSVD4, | ||
| 48 | S2MPA01_REG_RSVD5, | ||
| 49 | S2MPA01_REG_RSVD6, | ||
| 50 | S2MPA01_REG_TOP_RSVD, | ||
| 51 | S2MPA01_REG_DVS_SEL, | ||
| 52 | S2MPA01_REG_DVS_PTR, | ||
| 53 | S2MPA01_REG_DVS_DATA, | ||
| 54 | S2MPA01_REG_RSVD_NO, | ||
| 55 | S2MPA01_REG_UVLO, | ||
| 56 | S2MPA01_REG_LEE_NO, | ||
| 57 | S2MPA01_REG_B1CTRL1, | ||
| 58 | S2MPA01_REG_B1CTRL2, | ||
| 59 | S2MPA01_REG_B2CTRL1, | ||
| 60 | S2MPA01_REG_B2CTRL2, | ||
| 61 | S2MPA01_REG_B3CTRL1, | ||
| 62 | S2MPA01_REG_B3CTRL2, | ||
| 63 | S2MPA01_REG_B4CTRL1, | ||
| 64 | S2MPA01_REG_B4CTRL2, | ||
| 65 | S2MPA01_REG_B5CTRL1, | ||
| 66 | S2MPA01_REG_B5CTRL2, | ||
| 67 | S2MPA01_REG_B5CTRL3, | ||
| 68 | S2MPA01_REG_B5CTRL4, | ||
| 69 | S2MPA01_REG_B5CTRL5, | ||
| 70 | S2MPA01_REG_B5CTRL6, | ||
| 71 | S2MPA01_REG_B6CTRL1, | ||
| 72 | S2MPA01_REG_B6CTRL2, | ||
| 73 | S2MPA01_REG_B7CTRL1, | ||
| 74 | S2MPA01_REG_B7CTRL2, | ||
| 75 | S2MPA01_REG_B8CTRL1, | ||
| 76 | S2MPA01_REG_B8CTRL2, | ||
| 77 | S2MPA01_REG_B9CTRL1, | ||
| 78 | S2MPA01_REG_B9CTRL2, | ||
| 79 | S2MPA01_REG_B10CTRL1, | ||
| 80 | S2MPA01_REG_B10CTRL2, | ||
| 81 | S2MPA01_REG_L1CTRL, | ||
| 82 | S2MPA01_REG_L2CTRL, | ||
| 83 | S2MPA01_REG_L3CTRL, | ||
| 84 | S2MPA01_REG_L4CTRL, | ||
| 85 | S2MPA01_REG_L5CTRL, | ||
| 86 | S2MPA01_REG_L6CTRL, | ||
| 87 | S2MPA01_REG_L7CTRL, | ||
| 88 | S2MPA01_REG_L8CTRL, | ||
| 89 | S2MPA01_REG_L9CTRL, | ||
| 90 | S2MPA01_REG_L10CTRL, | ||
| 91 | S2MPA01_REG_L11CTRL, | ||
| 92 | S2MPA01_REG_L12CTRL, | ||
| 93 | S2MPA01_REG_L13CTRL, | ||
| 94 | S2MPA01_REG_L14CTRL, | ||
| 95 | S2MPA01_REG_L15CTRL, | ||
| 96 | S2MPA01_REG_L16CTRL, | ||
| 97 | S2MPA01_REG_L17CTRL, | ||
| 98 | S2MPA01_REG_L18CTRL, | ||
| 99 | S2MPA01_REG_L19CTRL, | ||
| 100 | S2MPA01_REG_L20CTRL, | ||
| 101 | S2MPA01_REG_L21CTRL, | ||
| 102 | S2MPA01_REG_L22CTRL, | ||
| 103 | S2MPA01_REG_L23CTRL, | ||
| 104 | S2MPA01_REG_L24CTRL, | ||
| 105 | S2MPA01_REG_L25CTRL, | ||
| 106 | S2MPA01_REG_L26CTRL, | ||
| 107 | |||
| 108 | S2MPA01_REG_LDO_OVCB1, | ||
| 109 | S2MPA01_REG_LDO_OVCB2, | ||
| 110 | S2MPA01_REG_LDO_OVCB3, | ||
| 111 | S2MPA01_REG_LDO_OVCB4, | ||
| 112 | |||
| 113 | }; | ||
| 114 | |||
| 115 | /* S2MPA01 regulator ids */ | ||
| 116 | enum s2mpa01_regulators { | ||
| 117 | S2MPA01_LDO1, | ||
| 118 | S2MPA01_LDO2, | ||
| 119 | S2MPA01_LDO3, | ||
| 120 | S2MPA01_LDO4, | ||
| 121 | S2MPA01_LDO5, | ||
| 122 | S2MPA01_LDO6, | ||
| 123 | S2MPA01_LDO7, | ||
| 124 | S2MPA01_LDO8, | ||
| 125 | S2MPA01_LDO9, | ||
| 126 | S2MPA01_LDO10, | ||
| 127 | S2MPA01_LDO11, | ||
| 128 | S2MPA01_LDO12, | ||
| 129 | S2MPA01_LDO13, | ||
| 130 | S2MPA01_LDO14, | ||
| 131 | S2MPA01_LDO15, | ||
| 132 | S2MPA01_LDO16, | ||
| 133 | S2MPA01_LDO17, | ||
| 134 | S2MPA01_LDO18, | ||
| 135 | S2MPA01_LDO19, | ||
| 136 | S2MPA01_LDO20, | ||
| 137 | S2MPA01_LDO21, | ||
| 138 | S2MPA01_LDO22, | ||
| 139 | S2MPA01_LDO23, | ||
| 140 | S2MPA01_LDO24, | ||
| 141 | S2MPA01_LDO25, | ||
| 142 | S2MPA01_LDO26, | ||
| 143 | |||
| 144 | S2MPA01_BUCK1, | ||
| 145 | S2MPA01_BUCK2, | ||
| 146 | S2MPA01_BUCK3, | ||
| 147 | S2MPA01_BUCK4, | ||
| 148 | S2MPA01_BUCK5, | ||
| 149 | S2MPA01_BUCK6, | ||
| 150 | S2MPA01_BUCK7, | ||
| 151 | S2MPA01_BUCK8, | ||
| 152 | S2MPA01_BUCK9, | ||
| 153 | S2MPA01_BUCK10, | ||
| 154 | |||
| 155 | S2MPA01_REGULATOR_MAX, | ||
| 156 | }; | ||
| 157 | |||
| 158 | #define S2MPA01_BUCK_MIN1 600000 | ||
| 159 | #define S2MPA01_BUCK_MIN2 800000 | ||
| 160 | #define S2MPA01_BUCK_MIN3 1000000 | ||
| 161 | #define S2MPA01_BUCK_MIN4 1500000 | ||
| 162 | #define S2MPA01_LDO_MIN 800000 | ||
| 163 | |||
| 164 | #define S2MPA01_BUCK_STEP1 6250 | ||
| 165 | #define S2MPA01_BUCK_STEP2 12500 | ||
| 166 | |||
| 167 | #define S2MPA01_LDO_STEP1 50000 | ||
| 168 | #define S2MPA01_LDO_STEP2 25000 | ||
| 169 | |||
| 170 | #define S2MPA01_LDO_VSEL_MASK 0x3F | ||
| 171 | #define S2MPA01_BUCK_VSEL_MASK 0xFF | ||
| 172 | #define S2MPA01_ENABLE_MASK (0x03 << S2MPA01_ENABLE_SHIFT) | ||
| 173 | #define S2MPA01_ENABLE_SHIFT 0x06 | ||
| 174 | #define S2MPA01_LDO_N_VOLTAGES (S2MPA01_LDO_VSEL_MASK + 1) | ||
| 175 | #define S2MPA01_BUCK_N_VOLTAGES (S2MPA01_BUCK_VSEL_MASK + 1) | ||
| 176 | |||
| 177 | #define S2MPA01_RAMP_DELAY 12500 /* uV/us */ | ||
| 178 | |||
| 179 | #define S2MPA01_BUCK16_RAMP_SHIFT 4 | ||
| 180 | #define S2MPA01_BUCK24_RAMP_SHIFT 6 | ||
| 181 | #define S2MPA01_BUCK3_RAMP_SHIFT 4 | ||
| 182 | #define S2MPA01_BUCK5_RAMP_SHIFT 6 | ||
| 183 | #define S2MPA01_BUCK7_RAMP_SHIFT 2 | ||
| 184 | #define S2MPA01_BUCK8910_RAMP_SHIFT 0 | ||
| 185 | |||
| 186 | #define S2MPA01_BUCK1_RAMP_EN_SHIFT 3 | ||
| 187 | #define S2MPA01_BUCK2_RAMP_EN_SHIFT 2 | ||
| 188 | #define S2MPA01_BUCK3_RAMP_EN_SHIFT 1 | ||
| 189 | #define S2MPA01_BUCK4_RAMP_EN_SHIFT 0 | ||
| 190 | #define S2MPA01_PMIC_EN_SHIFT 6 | ||
| 191 | |||
| 192 | #endif /*__LINUX_MFD_S2MPA01_H */ | ||
diff --git a/include/linux/mfd/samsung/s2mps14.h b/include/linux/mfd/samsung/s2mps14.h new file mode 100644 index 000000000000..4b449b8ac548 --- /dev/null +++ b/include/linux/mfd/samsung/s2mps14.h | |||
| @@ -0,0 +1,154 @@ | |||
| 1 | /* | ||
| 2 | * s2mps14.h | ||
| 3 | * | ||
| 4 | * Copyright (c) 2014 Samsung Electronics Co., Ltd | ||
| 5 | * http://www.samsung.com | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify it | ||
| 8 | * under the terms of the GNU General Public License as published by the | ||
| 9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 10 | * option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef __LINUX_MFD_S2MPS14_H | ||
| 20 | #define __LINUX_MFD_S2MPS14_H | ||
| 21 | |||
| 22 | /* S2MPS14 registers */ | ||
| 23 | enum s2mps14_reg { | ||
| 24 | S2MPS14_REG_ID, | ||
| 25 | S2MPS14_REG_INT1, | ||
| 26 | S2MPS14_REG_INT2, | ||
| 27 | S2MPS14_REG_INT3, | ||
| 28 | S2MPS14_REG_INT1M, | ||
| 29 | S2MPS14_REG_INT2M, | ||
| 30 | S2MPS14_REG_INT3M, | ||
| 31 | S2MPS14_REG_ST1, | ||
| 32 | S2MPS14_REG_ST2, | ||
| 33 | S2MPS14_REG_PWRONSRC, | ||
| 34 | S2MPS14_REG_OFFSRC, | ||
| 35 | S2MPS14_REG_BU_CHG, | ||
| 36 | S2MPS14_REG_RTCCTRL, | ||
| 37 | S2MPS14_REG_CTRL1, | ||
| 38 | S2MPS14_REG_CTRL2, | ||
| 39 | S2MPS14_REG_RSVD1, | ||
| 40 | S2MPS14_REG_RSVD2, | ||
| 41 | S2MPS14_REG_RSVD3, | ||
| 42 | S2MPS14_REG_RSVD4, | ||
| 43 | S2MPS14_REG_RSVD5, | ||
| 44 | S2MPS14_REG_RSVD6, | ||
| 45 | S2MPS14_REG_CTRL3, | ||
| 46 | S2MPS14_REG_RSVD7, | ||
| 47 | S2MPS14_REG_RSVD8, | ||
| 48 | S2MPS14_REG_WRSTBI, | ||
| 49 | S2MPS14_REG_B1CTRL1, | ||
| 50 | S2MPS14_REG_B1CTRL2, | ||
| 51 | S2MPS14_REG_B2CTRL1, | ||
| 52 | S2MPS14_REG_B2CTRL2, | ||
| 53 | S2MPS14_REG_B3CTRL1, | ||
| 54 | S2MPS14_REG_B3CTRL2, | ||
| 55 | S2MPS14_REG_B4CTRL1, | ||
| 56 | S2MPS14_REG_B4CTRL2, | ||
| 57 | S2MPS14_REG_B5CTRL1, | ||
| 58 | S2MPS14_REG_B5CTRL2, | ||
| 59 | S2MPS14_REG_L1CTRL, | ||
| 60 | S2MPS14_REG_L2CTRL, | ||
| 61 | S2MPS14_REG_L3CTRL, | ||
| 62 | S2MPS14_REG_L4CTRL, | ||
| 63 | S2MPS14_REG_L5CTRL, | ||
| 64 | S2MPS14_REG_L6CTRL, | ||
| 65 | S2MPS14_REG_L7CTRL, | ||
| 66 | S2MPS14_REG_L8CTRL, | ||
| 67 | S2MPS14_REG_L9CTRL, | ||
| 68 | S2MPS14_REG_L10CTRL, | ||
| 69 | S2MPS14_REG_L11CTRL, | ||
| 70 | S2MPS14_REG_L12CTRL, | ||
| 71 | S2MPS14_REG_L13CTRL, | ||
| 72 | S2MPS14_REG_L14CTRL, | ||
| 73 | S2MPS14_REG_L15CTRL, | ||
| 74 | S2MPS14_REG_L16CTRL, | ||
| 75 | S2MPS14_REG_L17CTRL, | ||
| 76 | S2MPS14_REG_L18CTRL, | ||
| 77 | S2MPS14_REG_L19CTRL, | ||
| 78 | S2MPS14_REG_L20CTRL, | ||
| 79 | S2MPS14_REG_L21CTRL, | ||
| 80 | S2MPS14_REG_L22CTRL, | ||
| 81 | S2MPS14_REG_L23CTRL, | ||
| 82 | S2MPS14_REG_L24CTRL, | ||
| 83 | S2MPS14_REG_L25CTRL, | ||
| 84 | S2MPS14_REG_LDODSCH1, | ||
| 85 | S2MPS14_REG_LDODSCH2, | ||
| 86 | S2MPS14_REG_LDODSCH3, | ||
| 87 | }; | ||
| 88 | |||
| 89 | /* S2MPS14 regulator ids */ | ||
| 90 | enum s2mps14_regulators { | ||
| 91 | S2MPS14_LDO1, | ||
| 92 | S2MPS14_LDO2, | ||
| 93 | S2MPS14_LDO3, | ||
| 94 | S2MPS14_LDO4, | ||
| 95 | S2MPS14_LDO5, | ||
| 96 | S2MPS14_LDO6, | ||
| 97 | S2MPS14_LDO7, | ||
| 98 | S2MPS14_LDO8, | ||
| 99 | S2MPS14_LDO9, | ||
| 100 | S2MPS14_LDO10, | ||
| 101 | S2MPS14_LDO11, | ||
| 102 | S2MPS14_LDO12, | ||
| 103 | S2MPS14_LDO13, | ||
| 104 | S2MPS14_LDO14, | ||
| 105 | S2MPS14_LDO15, | ||
| 106 | S2MPS14_LDO16, | ||
| 107 | S2MPS14_LDO17, | ||
| 108 | S2MPS14_LDO18, | ||
| 109 | S2MPS14_LDO19, | ||
| 110 | S2MPS14_LDO20, | ||
| 111 | S2MPS14_LDO21, | ||
| 112 | S2MPS14_LDO22, | ||
| 113 | S2MPS14_LDO23, | ||
| 114 | S2MPS14_LDO24, | ||
| 115 | S2MPS14_LDO25, | ||
| 116 | S2MPS14_BUCK1, | ||
| 117 | S2MPS14_BUCK2, | ||
| 118 | S2MPS14_BUCK3, | ||
| 119 | S2MPS14_BUCK4, | ||
| 120 | S2MPS14_BUCK5, | ||
| 121 | |||
| 122 | S2MPS14_REGULATOR_MAX, | ||
| 123 | }; | ||
| 124 | |||
| 125 | /* Regulator constraints for BUCKx */ | ||
| 126 | #define S2MPS14_BUCK1235_MIN_600MV 600000 | ||
| 127 | #define S2MPS14_BUCK4_MIN_1400MV 1400000 | ||
| 128 | #define S2MPS14_BUCK1235_STEP_6_25MV 6250 | ||
| 129 | #define S2MPS14_BUCK4_STEP_12_5MV 12500 | ||
| 130 | #define S2MPS14_BUCK1235_START_SEL 0x20 | ||
| 131 | #define S2MPS14_BUCK4_START_SEL 0x40 | ||
| 132 | /* | ||
| 133 | * Default ramp delay in uv/us. Datasheet says that ramp delay can be | ||
| 134 | * controlled however it does not specify which register is used for that. | ||
| 135 | * Let's assume that default value will be set. | ||
| 136 | */ | ||
| 137 | #define S2MPS14_BUCK_RAMP_DELAY 12500 | ||
| 138 | |||
| 139 | /* Regulator constraints for different types of LDOx */ | ||
| 140 | #define S2MPS14_LDO_MIN_800MV 800000 | ||
| 141 | #define S2MPS14_LDO_MIN_1800MV 1800000 | ||
| 142 | #define S2MPS14_LDO_STEP_12_5MV 12500 | ||
| 143 | #define S2MPS14_LDO_STEP_25MV 25000 | ||
| 144 | |||
| 145 | #define S2MPS14_LDO_VSEL_MASK 0x3F | ||
| 146 | #define S2MPS14_BUCK_VSEL_MASK 0xFF | ||
| 147 | #define S2MPS14_ENABLE_MASK (0x03 << S2MPS14_ENABLE_SHIFT) | ||
| 148 | #define S2MPS14_ENABLE_SHIFT 6 | ||
| 149 | /* On/Off controlled by PWREN */ | ||
| 150 | #define S2MPS14_ENABLE_SUSPEND (0x01 << S2MPS14_ENABLE_SHIFT) | ||
| 151 | #define S2MPS14_LDO_N_VOLTAGES (S2MPS14_LDO_VSEL_MASK + 1) | ||
| 152 | #define S2MPS14_BUCK_N_VOLTAGES (S2MPS14_BUCK_VSEL_MASK + 1) | ||
| 153 | |||
| 154 | #endif /* __LINUX_MFD_S2MPS14_H */ | ||
diff --git a/include/linux/mfd/samsung/s5m8767.h b/include/linux/mfd/samsung/s5m8767.h index 2ab0b0f03641..243b58fec33d 100644 --- a/include/linux/mfd/samsung/s5m8767.h +++ b/include/linux/mfd/samsung/s5m8767.h | |||
| @@ -183,10 +183,17 @@ enum s5m8767_regulators { | |||
| 183 | S5M8767_REG_MAX, | 183 | S5M8767_REG_MAX, |
| 184 | }; | 184 | }; |
| 185 | 185 | ||
| 186 | /* LDO_EN/BUCK_EN field in registers */ | ||
| 186 | #define S5M8767_ENCTRL_SHIFT 6 | 187 | #define S5M8767_ENCTRL_SHIFT 6 |
| 187 | #define S5M8767_ENCTRL_MASK (0x3 << S5M8767_ENCTRL_SHIFT) | 188 | #define S5M8767_ENCTRL_MASK (0x3 << S5M8767_ENCTRL_SHIFT) |
| 188 | 189 | ||
| 189 | /* | 190 | /* |
| 191 | * LDO_EN/BUCK_EN register value for controlling this Buck or LDO | ||
| 192 | * by GPIO (PWREN, BUCKEN). | ||
| 193 | */ | ||
| 194 | #define S5M8767_ENCTRL_USE_GPIO 0x1 | ||
| 195 | |||
| 196 | /* | ||
| 190 | * Values for BUCK_RAMP field in DVS_RAMP register, matching raw values | 197 | * Values for BUCK_RAMP field in DVS_RAMP register, matching raw values |
| 191 | * in mV/us. | 198 | * in mV/us. |
| 192 | */ | 199 | */ |
diff --git a/include/linux/mfd/tps65217.h b/include/linux/mfd/tps65217.h index a5a7f0130e96..54b5458ec084 100644 --- a/include/linux/mfd/tps65217.h +++ b/include/linux/mfd/tps65217.h | |||
| @@ -252,7 +252,7 @@ struct tps65217_board { | |||
| 252 | struct tps65217 { | 252 | struct tps65217 { |
| 253 | struct device *dev; | 253 | struct device *dev; |
| 254 | struct tps65217_board *pdata; | 254 | struct tps65217_board *pdata; |
| 255 | unsigned int id; | 255 | unsigned long id; |
| 256 | struct regulator_desc desc[TPS65217_NUM_REGULATOR]; | 256 | struct regulator_desc desc[TPS65217_NUM_REGULATOR]; |
| 257 | struct regulator_dev *rdev[TPS65217_NUM_REGULATOR]; | 257 | struct regulator_dev *rdev[TPS65217_NUM_REGULATOR]; |
| 258 | struct regmap *regmap; | 258 | struct regmap *regmap; |
| @@ -263,7 +263,7 @@ static inline struct tps65217 *dev_to_tps65217(struct device *dev) | |||
| 263 | return dev_get_drvdata(dev); | 263 | return dev_get_drvdata(dev); |
| 264 | } | 264 | } |
| 265 | 265 | ||
| 266 | static inline int tps65217_chip_id(struct tps65217 *tps65217) | 266 | static inline unsigned long tps65217_chip_id(struct tps65217 *tps65217) |
| 267 | { | 267 | { |
| 268 | return tps65217->id; | 268 | return tps65217->id; |
| 269 | } | 269 | } |
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index 3737f7218f51..2cf1547096d9 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h | |||
| @@ -11,23 +11,23 @@ | |||
| 11 | */ | 11 | */ |
| 12 | 12 | ||
| 13 | #define PSMOUSE_MINOR 1 | 13 | #define PSMOUSE_MINOR 1 |
| 14 | #define MS_BUSMOUSE_MINOR 2 | 14 | #define MS_BUSMOUSE_MINOR 2 /* unused */ |
| 15 | #define ATIXL_BUSMOUSE_MINOR 3 | 15 | #define ATIXL_BUSMOUSE_MINOR 3 /* unused */ |
| 16 | /*#define AMIGAMOUSE_MINOR 4 FIXME OBSOLETE */ | 16 | /*#define AMIGAMOUSE_MINOR 4 FIXME OBSOLETE */ |
| 17 | #define ATARIMOUSE_MINOR 5 | 17 | #define ATARIMOUSE_MINOR 5 /* unused */ |
| 18 | #define SUN_MOUSE_MINOR 6 | 18 | #define SUN_MOUSE_MINOR 6 /* unused */ |
| 19 | #define APOLLO_MOUSE_MINOR 7 | 19 | #define APOLLO_MOUSE_MINOR 7 /* unused */ |
| 20 | #define PC110PAD_MINOR 9 | 20 | #define PC110PAD_MINOR 9 /* unused */ |
| 21 | /*#define ADB_MOUSE_MINOR 10 FIXME OBSOLETE */ | 21 | /*#define ADB_MOUSE_MINOR 10 FIXME OBSOLETE */ |
| 22 | #define WATCHDOG_MINOR 130 /* Watchdog timer */ | 22 | #define WATCHDOG_MINOR 130 /* Watchdog timer */ |
| 23 | #define TEMP_MINOR 131 /* Temperature Sensor */ | 23 | #define TEMP_MINOR 131 /* Temperature Sensor */ |
| 24 | #define RTC_MINOR 135 | 24 | #define RTC_MINOR 135 |
| 25 | #define EFI_RTC_MINOR 136 /* EFI Time services */ | 25 | #define EFI_RTC_MINOR 136 /* EFI Time services */ |
| 26 | #define SUN_OPENPROM_MINOR 139 | 26 | #define SUN_OPENPROM_MINOR 139 |
| 27 | #define DMAPI_MINOR 140 /* DMAPI */ | 27 | #define DMAPI_MINOR 140 /* unused */ |
| 28 | #define NVRAM_MINOR 144 | 28 | #define NVRAM_MINOR 144 |
| 29 | #define SGI_MMTIMER 153 | 29 | #define SGI_MMTIMER 153 |
| 30 | #define STORE_QUEUE_MINOR 155 | 30 | #define STORE_QUEUE_MINOR 155 /* unused */ |
| 31 | #define I2O_MINOR 166 | 31 | #define I2O_MINOR 166 |
| 32 | #define MICROCODE_MINOR 184 | 32 | #define MICROCODE_MINOR 184 |
| 33 | #define VFIO_MINOR 196 | 33 | #define VFIO_MINOR 196 |
diff --git a/include/linux/mm.h b/include/linux/mm.h index f28f46eade6a..2eec61fe75c9 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -175,7 +175,7 @@ extern unsigned int kobjsize(const void *objp); | |||
| 175 | * Special vmas that are non-mergable, non-mlock()able. | 175 | * Special vmas that are non-mergable, non-mlock()able. |
| 176 | * Note: mm/huge_memory.c VM_NO_THP depends on this definition. | 176 | * Note: mm/huge_memory.c VM_NO_THP depends on this definition. |
| 177 | */ | 177 | */ |
| 178 | #define VM_SPECIAL (VM_IO | VM_DONTEXPAND | VM_PFNMAP) | 178 | #define VM_SPECIAL (VM_IO | VM_DONTEXPAND | VM_PFNMAP | VM_MIXEDMAP) |
| 179 | 179 | ||
| 180 | /* | 180 | /* |
| 181 | * mapping from the currently active vm_flags protection bits (the | 181 | * mapping from the currently active vm_flags protection bits (the |
| @@ -399,8 +399,18 @@ static inline void compound_unlock_irqrestore(struct page *page, | |||
| 399 | 399 | ||
| 400 | static inline struct page *compound_head(struct page *page) | 400 | static inline struct page *compound_head(struct page *page) |
| 401 | { | 401 | { |
| 402 | if (unlikely(PageTail(page))) | 402 | if (unlikely(PageTail(page))) { |
| 403 | return page->first_page; | 403 | struct page *head = page->first_page; |
| 404 | |||
| 405 | /* | ||
| 406 | * page->first_page may be a dangling pointer to an old | ||
| 407 | * compound page, so recheck that it is still a tail | ||
| 408 | * page before returning. | ||
| 409 | */ | ||
| 410 | smp_rmb(); | ||
| 411 | if (likely(PageTail(page))) | ||
| 412 | return head; | ||
| 413 | } | ||
| 404 | return page; | 414 | return page; |
| 405 | } | 415 | } |
| 406 | 416 | ||
| @@ -757,7 +767,7 @@ static inline bool __cpupid_match_pid(pid_t task_pid, int cpupid) | |||
| 757 | #ifdef LAST_CPUPID_NOT_IN_PAGE_FLAGS | 767 | #ifdef LAST_CPUPID_NOT_IN_PAGE_FLAGS |
| 758 | static inline int page_cpupid_xchg_last(struct page *page, int cpupid) | 768 | static inline int page_cpupid_xchg_last(struct page *page, int cpupid) |
| 759 | { | 769 | { |
| 760 | return xchg(&page->_last_cpupid, cpupid); | 770 | return xchg(&page->_last_cpupid, cpupid & LAST_CPUPID_MASK); |
| 761 | } | 771 | } |
| 762 | 772 | ||
| 763 | static inline int page_cpupid_last(struct page *page) | 773 | static inline int page_cpupid_last(struct page *page) |
| @@ -766,7 +776,7 @@ static inline int page_cpupid_last(struct page *page) | |||
| 766 | } | 776 | } |
| 767 | static inline void page_cpupid_reset_last(struct page *page) | 777 | static inline void page_cpupid_reset_last(struct page *page) |
| 768 | { | 778 | { |
| 769 | page->_last_cpupid = -1; | 779 | page->_last_cpupid = -1 & LAST_CPUPID_MASK; |
| 770 | } | 780 | } |
| 771 | #else | 781 | #else |
| 772 | static inline int page_cpupid_last(struct page *page) | 782 | static inline int page_cpupid_last(struct page *page) |
| @@ -1477,9 +1487,15 @@ static inline void pgtable_page_dtor(struct page *page) | |||
| 1477 | 1487 | ||
| 1478 | #if USE_SPLIT_PMD_PTLOCKS | 1488 | #if USE_SPLIT_PMD_PTLOCKS |
| 1479 | 1489 | ||
| 1490 | static struct page *pmd_to_page(pmd_t *pmd) | ||
| 1491 | { | ||
| 1492 | unsigned long mask = ~(PTRS_PER_PMD * sizeof(pmd_t) - 1); | ||
| 1493 | return virt_to_page((void *)((unsigned long) pmd & mask)); | ||
| 1494 | } | ||
| 1495 | |||
| 1480 | static inline spinlock_t *pmd_lockptr(struct mm_struct *mm, pmd_t *pmd) | 1496 | static inline spinlock_t *pmd_lockptr(struct mm_struct *mm, pmd_t *pmd) |
| 1481 | { | 1497 | { |
| 1482 | return ptlock_ptr(virt_to_page(pmd)); | 1498 | return ptlock_ptr(pmd_to_page(pmd)); |
| 1483 | } | 1499 | } |
| 1484 | 1500 | ||
| 1485 | static inline bool pgtable_pmd_page_ctor(struct page *page) | 1501 | static inline bool pgtable_pmd_page_ctor(struct page *page) |
| @@ -1498,7 +1514,7 @@ static inline void pgtable_pmd_page_dtor(struct page *page) | |||
| 1498 | ptlock_free(page); | 1514 | ptlock_free(page); |
| 1499 | } | 1515 | } |
| 1500 | 1516 | ||
| 1501 | #define pmd_huge_pte(mm, pmd) (virt_to_page(pmd)->pmd_huge_pte) | 1517 | #define pmd_huge_pte(mm, pmd) (pmd_to_page(pmd)->pmd_huge_pte) |
| 1502 | 1518 | ||
| 1503 | #else | 1519 | #else |
| 1504 | 1520 | ||
| @@ -1740,6 +1756,9 @@ extern void set_mm_exe_file(struct mm_struct *mm, struct file *new_exe_file); | |||
| 1740 | extern struct file *get_mm_exe_file(struct mm_struct *mm); | 1756 | extern struct file *get_mm_exe_file(struct mm_struct *mm); |
| 1741 | 1757 | ||
| 1742 | extern int may_expand_vm(struct mm_struct *mm, unsigned long npages); | 1758 | extern int may_expand_vm(struct mm_struct *mm, unsigned long npages); |
| 1759 | extern struct vm_area_struct *_install_special_mapping(struct mm_struct *mm, | ||
| 1760 | unsigned long addr, unsigned long len, | ||
| 1761 | unsigned long flags, struct page **pages); | ||
| 1743 | extern int install_special_mapping(struct mm_struct *mm, | 1762 | extern int install_special_mapping(struct mm_struct *mm, |
| 1744 | unsigned long addr, unsigned long len, | 1763 | unsigned long addr, unsigned long len, |
| 1745 | unsigned long flags, struct page **pages); | 1764 | unsigned long flags, struct page **pages); |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 5f2052c83154..9b61b9bf81ac 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
| @@ -590,10 +590,10 @@ static inline bool zone_is_empty(struct zone *zone) | |||
| 590 | 590 | ||
| 591 | /* | 591 | /* |
| 592 | * The NUMA zonelists are doubled because we need zonelists that restrict the | 592 | * The NUMA zonelists are doubled because we need zonelists that restrict the |
| 593 | * allocations to a single node for GFP_THISNODE. | 593 | * allocations to a single node for __GFP_THISNODE. |
| 594 | * | 594 | * |
| 595 | * [0] : Zonelist with fallback | 595 | * [0] : Zonelist with fallback |
| 596 | * [1] : No fallback (GFP_THISNODE) | 596 | * [1] : No fallback (__GFP_THISNODE) |
| 597 | */ | 597 | */ |
| 598 | #define MAX_ZONELISTS 2 | 598 | #define MAX_ZONELISTS 2 |
| 599 | 599 | ||
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 45e921401b06..9a165a213d93 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
| @@ -432,6 +432,14 @@ struct spi_device_id { | |||
| 432 | kernel_ulong_t driver_data; /* Data private to the driver */ | 432 | kernel_ulong_t driver_data; /* Data private to the driver */ |
| 433 | }; | 433 | }; |
| 434 | 434 | ||
| 435 | #define SPMI_NAME_SIZE 32 | ||
| 436 | #define SPMI_MODULE_PREFIX "spmi:" | ||
| 437 | |||
| 438 | struct spmi_device_id { | ||
| 439 | char name[SPMI_NAME_SIZE]; | ||
| 440 | kernel_ulong_t driver_data; /* Data private to the driver */ | ||
| 441 | }; | ||
| 442 | |||
| 435 | /* dmi */ | 443 | /* dmi */ |
| 436 | enum dmi_field { | 444 | enum dmi_field { |
| 437 | DMI_NONE, | 445 | DMI_NONE, |
| @@ -564,6 +572,15 @@ struct x86_cpu_id { | |||
| 564 | #define X86_MODEL_ANY 0 | 572 | #define X86_MODEL_ANY 0 |
| 565 | #define X86_FEATURE_ANY 0 /* Same as FPU, you can't test for that */ | 573 | #define X86_FEATURE_ANY 0 /* Same as FPU, you can't test for that */ |
| 566 | 574 | ||
| 575 | /* | ||
| 576 | * Generic table type for matching CPU features. | ||
| 577 | * @feature: the bit number of the feature (0 - 65535) | ||
| 578 | */ | ||
| 579 | |||
| 580 | struct cpu_feature { | ||
| 581 | __u16 feature; | ||
| 582 | }; | ||
| 583 | |||
| 567 | #define IPACK_ANY_FORMAT 0xff | 584 | #define IPACK_ANY_FORMAT 0xff |
| 568 | #define IPACK_ANY_ID (~0) | 585 | #define IPACK_ANY_ID (~0) |
| 569 | struct ipack_device_id { | 586 | struct ipack_device_id { |
| @@ -599,4 +616,9 @@ struct rio_device_id { | |||
| 599 | __u16 asm_did, asm_vid; | 616 | __u16 asm_did, asm_vid; |
| 600 | }; | 617 | }; |
| 601 | 618 | ||
| 619 | struct mcb_device_id { | ||
| 620 | __u16 device; | ||
| 621 | kernel_ulong_t driver_data; | ||
| 622 | }; | ||
| 623 | |||
| 602 | #endif /* LINUX_MOD_DEVICETABLE_H */ | 624 | #endif /* LINUX_MOD_DEVICETABLE_H */ |
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index d3181936c138..11692dea18aa 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h | |||
| @@ -46,6 +46,7 @@ | |||
| 46 | * - detects multi-task circular deadlocks and prints out all affected | 46 | * - detects multi-task circular deadlocks and prints out all affected |
| 47 | * locks and tasks (and only those tasks) | 47 | * locks and tasks (and only those tasks) |
| 48 | */ | 48 | */ |
| 49 | struct optimistic_spin_queue; | ||
| 49 | struct mutex { | 50 | struct mutex { |
| 50 | /* 1: unlocked, 0: locked, negative: locked, possible waiters */ | 51 | /* 1: unlocked, 0: locked, negative: locked, possible waiters */ |
| 51 | atomic_t count; | 52 | atomic_t count; |
| @@ -55,7 +56,7 @@ struct mutex { | |||
| 55 | struct task_struct *owner; | 56 | struct task_struct *owner; |
| 56 | #endif | 57 | #endif |
| 57 | #ifdef CONFIG_MUTEX_SPIN_ON_OWNER | 58 | #ifdef CONFIG_MUTEX_SPIN_ON_OWNER |
| 58 | void *spin_mlock; /* Spinner MCS lock */ | 59 | struct optimistic_spin_queue *osq; /* Spinner MCS lock */ |
| 59 | #endif | 60 | #endif |
| 60 | #ifdef CONFIG_DEBUG_MUTEXES | 61 | #ifdef CONFIG_DEBUG_MUTEXES |
| 61 | const char *name; | 62 | const char *name; |
| @@ -179,4 +180,4 @@ extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock); | |||
| 179 | # define arch_mutex_cpu_relax() cpu_relax() | 180 | # define arch_mutex_cpu_relax() cpu_relax() |
| 180 | #endif | 181 | #endif |
| 181 | 182 | ||
| 182 | #endif | 183 | #endif /* __LINUX_MUTEX_H */ |
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h index 1005ebf17575..5a09a48f2658 100644 --- a/include/linux/netdev_features.h +++ b/include/linux/netdev_features.h | |||
| @@ -163,4 +163,11 @@ enum { | |||
| 163 | /* changeable features with no special hardware requirements */ | 163 | /* changeable features with no special hardware requirements */ |
| 164 | #define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO) | 164 | #define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO) |
| 165 | 165 | ||
| 166 | #define NETIF_F_VLAN_FEATURES (NETIF_F_HW_VLAN_CTAG_FILTER | \ | ||
| 167 | NETIF_F_HW_VLAN_CTAG_RX | \ | ||
| 168 | NETIF_F_HW_VLAN_CTAG_TX | \ | ||
| 169 | NETIF_F_HW_VLAN_STAG_FILTER | \ | ||
| 170 | NETIF_F_HW_VLAN_STAG_RX | \ | ||
| 171 | NETIF_F_HW_VLAN_STAG_TX) | ||
| 172 | |||
| 166 | #endif /* _LINUX_NETDEV_FEATURES_H */ | 173 | #endif /* _LINUX_NETDEV_FEATURES_H */ |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 440a02ee6f92..daafd9561cbc 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -752,6 +752,9 @@ struct netdev_phys_port_id { | |||
| 752 | unsigned char id_len; | 752 | unsigned char id_len; |
| 753 | }; | 753 | }; |
| 754 | 754 | ||
| 755 | typedef u16 (*select_queue_fallback_t)(struct net_device *dev, | ||
| 756 | struct sk_buff *skb); | ||
| 757 | |||
| 755 | /* | 758 | /* |
| 756 | * This structure defines the management hooks for network devices. | 759 | * This structure defines the management hooks for network devices. |
| 757 | * The following hooks can be defined; unless noted otherwise, they are | 760 | * The following hooks can be defined; unless noted otherwise, they are |
| @@ -783,7 +786,7 @@ struct netdev_phys_port_id { | |||
| 783 | * Required can not be NULL. | 786 | * Required can not be NULL. |
| 784 | * | 787 | * |
| 785 | * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb, | 788 | * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb, |
| 786 | * void *accel_priv); | 789 | * void *accel_priv, select_queue_fallback_t fallback); |
| 787 | * Called to decide which queue to when device supports multiple | 790 | * Called to decide which queue to when device supports multiple |
| 788 | * transmit queues. | 791 | * transmit queues. |
| 789 | * | 792 | * |
| @@ -1005,7 +1008,8 @@ struct net_device_ops { | |||
| 1005 | struct net_device *dev); | 1008 | struct net_device *dev); |
| 1006 | u16 (*ndo_select_queue)(struct net_device *dev, | 1009 | u16 (*ndo_select_queue)(struct net_device *dev, |
| 1007 | struct sk_buff *skb, | 1010 | struct sk_buff *skb, |
| 1008 | void *accel_priv); | 1011 | void *accel_priv, |
| 1012 | select_queue_fallback_t fallback); | ||
| 1009 | void (*ndo_change_rx_flags)(struct net_device *dev, | 1013 | void (*ndo_change_rx_flags)(struct net_device *dev, |
| 1010 | int flags); | 1014 | int flags); |
| 1011 | void (*ndo_set_rx_mode)(struct net_device *dev); | 1015 | void (*ndo_set_rx_mode)(struct net_device *dev); |
| @@ -1551,7 +1555,6 @@ static inline void netdev_for_each_tx_queue(struct net_device *dev, | |||
| 1551 | struct netdev_queue *netdev_pick_tx(struct net_device *dev, | 1555 | struct netdev_queue *netdev_pick_tx(struct net_device *dev, |
| 1552 | struct sk_buff *skb, | 1556 | struct sk_buff *skb, |
| 1553 | void *accel_priv); | 1557 | void *accel_priv); |
| 1554 | u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb); | ||
| 1555 | 1558 | ||
| 1556 | /* | 1559 | /* |
| 1557 | * Net namespace inlines | 1560 | * Net namespace inlines |
| @@ -2276,6 +2279,26 @@ static inline void netdev_reset_queue(struct net_device *dev_queue) | |||
| 2276 | } | 2279 | } |
| 2277 | 2280 | ||
| 2278 | /** | 2281 | /** |
| 2282 | * netdev_cap_txqueue - check if selected tx queue exceeds device queues | ||
| 2283 | * @dev: network device | ||
| 2284 | * @queue_index: given tx queue index | ||
| 2285 | * | ||
| 2286 | * Returns 0 if given tx queue index >= number of device tx queues, | ||
| 2287 | * otherwise returns the originally passed tx queue index. | ||
| 2288 | */ | ||
| 2289 | static inline u16 netdev_cap_txqueue(struct net_device *dev, u16 queue_index) | ||
| 2290 | { | ||
| 2291 | if (unlikely(queue_index >= dev->real_num_tx_queues)) { | ||
| 2292 | net_warn_ratelimited("%s selects TX queue %d, but real number of TX queues is %d\n", | ||
| 2293 | dev->name, queue_index, | ||
| 2294 | dev->real_num_tx_queues); | ||
| 2295 | return 0; | ||
| 2296 | } | ||
| 2297 | |||
| 2298 | return queue_index; | ||
| 2299 | } | ||
| 2300 | |||
| 2301 | /** | ||
| 2279 | * netif_running - test if up | 2302 | * netif_running - test if up |
| 2280 | * @dev: network device | 2303 | * @dev: network device |
| 2281 | * | 2304 | * |
| @@ -2991,7 +3014,7 @@ struct sk_buff *skb_gso_segment(struct sk_buff *skb, netdev_features_t features) | |||
| 2991 | { | 3014 | { |
| 2992 | return __skb_gso_segment(skb, features, true); | 3015 | return __skb_gso_segment(skb, features, true); |
| 2993 | } | 3016 | } |
| 2994 | __be16 skb_network_protocol(struct sk_buff *skb); | 3017 | __be16 skb_network_protocol(struct sk_buff *skb, int *depth); |
| 2995 | 3018 | ||
| 2996 | static inline bool can_checksum_protocol(netdev_features_t features, | 3019 | static inline bool can_checksum_protocol(netdev_features_t features, |
| 2997 | __be16 protocol) | 3020 | __be16 protocol) |
| @@ -3068,7 +3091,12 @@ void netdev_change_features(struct net_device *dev); | |||
| 3068 | void netif_stacked_transfer_operstate(const struct net_device *rootdev, | 3091 | void netif_stacked_transfer_operstate(const struct net_device *rootdev, |
| 3069 | struct net_device *dev); | 3092 | struct net_device *dev); |
| 3070 | 3093 | ||
| 3071 | netdev_features_t netif_skb_features(struct sk_buff *skb); | 3094 | netdev_features_t netif_skb_dev_features(struct sk_buff *skb, |
| 3095 | const struct net_device *dev); | ||
| 3096 | static inline netdev_features_t netif_skb_features(struct sk_buff *skb) | ||
| 3097 | { | ||
| 3098 | return netif_skb_dev_features(skb, skb->dev); | ||
| 3099 | } | ||
| 3072 | 3100 | ||
| 3073 | static inline bool net_gso_ok(netdev_features_t features, int gso_type) | 3101 | static inline bool net_gso_ok(netdev_features_t features, int gso_type) |
| 3074 | { | 3102 | { |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index b2fb167b2e6d..5624e4e2763c 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
| @@ -467,9 +467,14 @@ struct nfs_lockt_res { | |||
| 467 | }; | 467 | }; |
| 468 | 468 | ||
| 469 | struct nfs_release_lockowner_args { | 469 | struct nfs_release_lockowner_args { |
| 470 | struct nfs4_sequence_args seq_args; | ||
| 470 | struct nfs_lowner lock_owner; | 471 | struct nfs_lowner lock_owner; |
| 471 | }; | 472 | }; |
| 472 | 473 | ||
| 474 | struct nfs_release_lockowner_res { | ||
| 475 | struct nfs4_sequence_res seq_res; | ||
| 476 | }; | ||
| 477 | |||
| 473 | struct nfs4_delegreturnargs { | 478 | struct nfs4_delegreturnargs { |
| 474 | struct nfs4_sequence_args seq_args; | 479 | struct nfs4_sequence_args seq_args; |
| 475 | const struct nfs_fh *fhandle; | 480 | const struct nfs_fh *fhandle; |
diff --git a/include/linux/nvme.h b/include/linux/nvme.h index 69ae03f6eb15..6b9aafed225f 100644 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h | |||
| @@ -87,6 +87,7 @@ struct nvme_dev { | |||
| 87 | struct list_head namespaces; | 87 | struct list_head namespaces; |
| 88 | struct kref kref; | 88 | struct kref kref; |
| 89 | struct miscdevice miscdev; | 89 | struct miscdevice miscdev; |
| 90 | work_func_t reset_workfn; | ||
| 90 | struct work_struct reset_work; | 91 | struct work_struct reset_work; |
| 91 | char name[12]; | 92 | char name[12]; |
| 92 | char serial[20]; | 93 | char serial[20]; |
diff --git a/include/linux/of.h b/include/linux/of.h index 435cb995904d..919bf211877d 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
| @@ -18,7 +18,7 @@ | |||
| 18 | #include <linux/types.h> | 18 | #include <linux/types.h> |
| 19 | #include <linux/bitops.h> | 19 | #include <linux/bitops.h> |
| 20 | #include <linux/errno.h> | 20 | #include <linux/errno.h> |
| 21 | #include <linux/kref.h> | 21 | #include <linux/kobject.h> |
| 22 | #include <linux/mod_devicetable.h> | 22 | #include <linux/mod_devicetable.h> |
| 23 | #include <linux/spinlock.h> | 23 | #include <linux/spinlock.h> |
| 24 | #include <linux/topology.h> | 24 | #include <linux/topology.h> |
| @@ -37,6 +37,7 @@ struct property { | |||
| 37 | struct property *next; | 37 | struct property *next; |
| 38 | unsigned long _flags; | 38 | unsigned long _flags; |
| 39 | unsigned int unique_id; | 39 | unsigned int unique_id; |
| 40 | struct bin_attribute attr; | ||
| 40 | }; | 41 | }; |
| 41 | 42 | ||
| 42 | #if defined(CONFIG_SPARC) | 43 | #if defined(CONFIG_SPARC) |
| @@ -56,8 +57,7 @@ struct device_node { | |||
| 56 | struct device_node *sibling; | 57 | struct device_node *sibling; |
| 57 | struct device_node *next; /* next device of same type */ | 58 | struct device_node *next; /* next device of same type */ |
| 58 | struct device_node *allnext; /* next in list of all nodes */ | 59 | struct device_node *allnext; /* next in list of all nodes */ |
| 59 | struct proc_dir_entry *pde; /* this node's proc directory */ | 60 | struct kobject kobj; |
| 60 | struct kref kref; | ||
| 61 | unsigned long _flags; | 61 | unsigned long _flags; |
| 62 | void *data; | 62 | void *data; |
| 63 | #if defined(CONFIG_SPARC) | 63 | #if defined(CONFIG_SPARC) |
| @@ -67,13 +67,34 @@ struct device_node { | |||
| 67 | #endif | 67 | #endif |
| 68 | }; | 68 | }; |
| 69 | 69 | ||
| 70 | #define MAX_PHANDLE_ARGS 8 | 70 | #define MAX_PHANDLE_ARGS 16 |
| 71 | struct of_phandle_args { | 71 | struct of_phandle_args { |
| 72 | struct device_node *np; | 72 | struct device_node *np; |
| 73 | int args_count; | 73 | int args_count; |
| 74 | uint32_t args[MAX_PHANDLE_ARGS]; | 74 | uint32_t args[MAX_PHANDLE_ARGS]; |
| 75 | }; | 75 | }; |
| 76 | 76 | ||
| 77 | extern int of_node_add(struct device_node *node); | ||
| 78 | |||
| 79 | /* initialize a node */ | ||
| 80 | extern struct kobj_type of_node_ktype; | ||
| 81 | static inline void of_node_init(struct device_node *node) | ||
| 82 | { | ||
| 83 | kobject_init(&node->kobj, &of_node_ktype); | ||
| 84 | } | ||
| 85 | |||
| 86 | /* true when node is initialized */ | ||
| 87 | static inline int of_node_is_initialized(struct device_node *node) | ||
| 88 | { | ||
| 89 | return node && node->kobj.state_initialized; | ||
| 90 | } | ||
| 91 | |||
| 92 | /* true when node is attached (i.e. present on sysfs) */ | ||
| 93 | static inline int of_node_is_attached(struct device_node *node) | ||
| 94 | { | ||
| 95 | return node && node->kobj.state_in_sysfs; | ||
| 96 | } | ||
| 97 | |||
| 77 | #ifdef CONFIG_OF_DYNAMIC | 98 | #ifdef CONFIG_OF_DYNAMIC |
| 78 | extern struct device_node *of_node_get(struct device_node *node); | 99 | extern struct device_node *of_node_get(struct device_node *node); |
| 79 | extern void of_node_put(struct device_node *node); | 100 | extern void of_node_put(struct device_node *node); |
| @@ -114,6 +135,26 @@ static inline void of_node_set_flag(struct device_node *n, unsigned long flag) | |||
| 114 | set_bit(flag, &n->_flags); | 135 | set_bit(flag, &n->_flags); |
| 115 | } | 136 | } |
| 116 | 137 | ||
| 138 | static inline void of_node_clear_flag(struct device_node *n, unsigned long flag) | ||
| 139 | { | ||
| 140 | clear_bit(flag, &n->_flags); | ||
| 141 | } | ||
| 142 | |||
| 143 | static inline int of_property_check_flag(struct property *p, unsigned long flag) | ||
| 144 | { | ||
| 145 | return test_bit(flag, &p->_flags); | ||
| 146 | } | ||
| 147 | |||
| 148 | static inline void of_property_set_flag(struct property *p, unsigned long flag) | ||
| 149 | { | ||
| 150 | set_bit(flag, &p->_flags); | ||
| 151 | } | ||
| 152 | |||
| 153 | static inline void of_property_clear_flag(struct property *p, unsigned long flag) | ||
| 154 | { | ||
| 155 | clear_bit(flag, &p->_flags); | ||
| 156 | } | ||
| 157 | |||
| 117 | extern struct device_node *of_find_all_nodes(struct device_node *prev); | 158 | extern struct device_node *of_find_all_nodes(struct device_node *prev); |
| 118 | 159 | ||
| 119 | /* | 160 | /* |
| @@ -167,6 +208,8 @@ static inline const char *of_node_full_name(const struct device_node *np) | |||
| 167 | return np ? np->full_name : "<no-node>"; | 208 | return np ? np->full_name : "<no-node>"; |
| 168 | } | 209 | } |
| 169 | 210 | ||
| 211 | #define for_each_of_allnodes(dn) \ | ||
| 212 | for (dn = of_allnodes; dn; dn = dn->allnext) | ||
| 170 | extern struct device_node *of_find_node_by_name(struct device_node *from, | 213 | extern struct device_node *of_find_node_by_name(struct device_node *from, |
| 171 | const char *name); | 214 | const char *name); |
| 172 | extern struct device_node *of_find_node_by_type(struct device_node *from, | 215 | extern struct device_node *of_find_node_by_type(struct device_node *from, |
| @@ -198,6 +241,8 @@ extern struct device_node *of_find_node_with_property( | |||
| 198 | extern struct property *of_find_property(const struct device_node *np, | 241 | extern struct property *of_find_property(const struct device_node *np, |
| 199 | const char *name, | 242 | const char *name, |
| 200 | int *lenp); | 243 | int *lenp); |
| 244 | extern int of_property_count_elems_of_size(const struct device_node *np, | ||
| 245 | const char *propname, int elem_size); | ||
| 201 | extern int of_property_read_u32_index(const struct device_node *np, | 246 | extern int of_property_read_u32_index(const struct device_node *np, |
| 202 | const char *propname, | 247 | const char *propname, |
| 203 | u32 index, u32 *out_value); | 248 | u32 index, u32 *out_value); |
| @@ -390,6 +435,12 @@ static inline struct device_node *of_find_compatible_node( | |||
| 390 | return NULL; | 435 | return NULL; |
| 391 | } | 436 | } |
| 392 | 437 | ||
| 438 | static inline int of_property_count_elems_of_size(const struct device_node *np, | ||
| 439 | const char *propname, int elem_size) | ||
| 440 | { | ||
| 441 | return -ENOSYS; | ||
| 442 | } | ||
| 443 | |||
| 393 | static inline int of_property_read_u32_index(const struct device_node *np, | 444 | static inline int of_property_read_u32_index(const struct device_node *np, |
| 394 | const char *propname, u32 index, u32 *out_value) | 445 | const char *propname, u32 index, u32 *out_value) |
| 395 | { | 446 | { |
| @@ -536,6 +587,74 @@ static inline struct device_node *of_find_matching_node( | |||
| 536 | } | 587 | } |
| 537 | 588 | ||
| 538 | /** | 589 | /** |
| 590 | * of_property_count_u8_elems - Count the number of u8 elements in a property | ||
| 591 | * | ||
| 592 | * @np: device node from which the property value is to be read. | ||
| 593 | * @propname: name of the property to be searched. | ||
| 594 | * | ||
| 595 | * Search for a property in a device node and count the number of u8 elements | ||
| 596 | * in it. Returns number of elements on sucess, -EINVAL if the property does | ||
| 597 | * not exist or its length does not match a multiple of u8 and -ENODATA if the | ||
| 598 | * property does not have a value. | ||
| 599 | */ | ||
| 600 | static inline int of_property_count_u8_elems(const struct device_node *np, | ||
| 601 | const char *propname) | ||
| 602 | { | ||
| 603 | return of_property_count_elems_of_size(np, propname, sizeof(u8)); | ||
| 604 | } | ||
| 605 | |||
| 606 | /** | ||
| 607 | * of_property_count_u16_elems - Count the number of u16 elements in a property | ||
| 608 | * | ||
| 609 | * @np: device node from which the property value is to be read. | ||
| 610 | * @propname: name of the property to be searched. | ||
| 611 | * | ||
| 612 | * Search for a property in a device node and count the number of u16 elements | ||
| 613 | * in it. Returns number of elements on sucess, -EINVAL if the property does | ||
| 614 | * not exist or its length does not match a multiple of u16 and -ENODATA if the | ||
| 615 | * property does not have a value. | ||
| 616 | */ | ||
| 617 | static inline int of_property_count_u16_elems(const struct device_node *np, | ||
| 618 | const char *propname) | ||
| 619 | { | ||
| 620 | return of_property_count_elems_of_size(np, propname, sizeof(u16)); | ||
| 621 | } | ||
| 622 | |||
| 623 | /** | ||
| 624 | * of_property_count_u32_elems - Count the number of u32 elements in a property | ||
| 625 | * | ||
| 626 | * @np: device node from which the property value is to be read. | ||
| 627 | * @propname: name of the property to be searched. | ||
| 628 | * | ||
| 629 | * Search for a property in a device node and count the number of u32 elements | ||
| 630 | * in it. Returns number of elements on sucess, -EINVAL if the property does | ||
| 631 | * not exist or its length does not match a multiple of u32 and -ENODATA if the | ||
| 632 | * property does not have a value. | ||
| 633 | */ | ||
| 634 | static inline int of_property_count_u32_elems(const struct device_node *np, | ||
| 635 | const char *propname) | ||
| 636 | { | ||
| 637 | return of_property_count_elems_of_size(np, propname, sizeof(u32)); | ||
| 638 | } | ||
| 639 | |||
| 640 | /** | ||
| 641 | * of_property_count_u64_elems - Count the number of u64 elements in a property | ||
| 642 | * | ||
| 643 | * @np: device node from which the property value is to be read. | ||
| 644 | * @propname: name of the property to be searched. | ||
| 645 | * | ||
| 646 | * Search for a property in a device node and count the number of u64 elements | ||
| 647 | * in it. Returns number of elements on sucess, -EINVAL if the property does | ||
| 648 | * not exist or its length does not match a multiple of u64 and -ENODATA if the | ||
| 649 | * property does not have a value. | ||
| 650 | */ | ||
| 651 | static inline int of_property_count_u64_elems(const struct device_node *np, | ||
| 652 | const char *propname) | ||
| 653 | { | ||
| 654 | return of_property_count_elems_of_size(np, propname, sizeof(u64)); | ||
| 655 | } | ||
| 656 | |||
| 657 | /** | ||
| 539 | * of_property_read_bool - Findfrom a property | 658 | * of_property_read_bool - Findfrom a property |
| 540 | * @np: device node from which the property value is to be read. | 659 | * @np: device node from which the property value is to be read. |
| 541 | * @propname: name of the property to be searched. | 660 | * @propname: name of the property to be searched. |
| @@ -633,14 +752,4 @@ static inline int of_get_available_child_count(const struct device_node *np) | |||
| 633 | return num; | 752 | return num; |
| 634 | } | 753 | } |
| 635 | 754 | ||
| 636 | #if defined(CONFIG_PROC_FS) && defined(CONFIG_PROC_DEVICETREE) | ||
| 637 | extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *); | ||
| 638 | extern void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop); | ||
| 639 | extern void proc_device_tree_remove_prop(struct proc_dir_entry *pde, | ||
| 640 | struct property *prop); | ||
| 641 | extern void proc_device_tree_update_prop(struct proc_dir_entry *pde, | ||
| 642 | struct property *newprop, | ||
| 643 | struct property *oldprop); | ||
| 644 | #endif | ||
| 645 | |||
| 646 | #endif /* _LINUX_OF_H */ | 755 | #endif /* _LINUX_OF_H */ |
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h index 2b77058a7335..ddd7219af8ac 100644 --- a/include/linux/of_fdt.h +++ b/include/linux/of_fdt.h | |||
| @@ -98,7 +98,10 @@ extern int early_init_dt_scan_chosen(unsigned long node, const char *uname, | |||
| 98 | int depth, void *data); | 98 | int depth, void *data); |
| 99 | extern int early_init_dt_scan_memory(unsigned long node, const char *uname, | 99 | extern int early_init_dt_scan_memory(unsigned long node, const char *uname, |
| 100 | int depth, void *data); | 100 | int depth, void *data); |
| 101 | extern void early_init_fdt_scan_reserved_mem(void); | ||
| 101 | extern void early_init_dt_add_memory_arch(u64 base, u64 size); | 102 | extern void early_init_dt_add_memory_arch(u64 base, u64 size); |
| 103 | extern int early_init_dt_reserve_memory_arch(phys_addr_t base, phys_addr_t size, | ||
| 104 | bool no_map); | ||
| 102 | extern void * early_init_dt_alloc_memory_arch(u64 size, u64 align); | 105 | extern void * early_init_dt_alloc_memory_arch(u64 size, u64 align); |
| 103 | extern u64 dt_mem_next_cell(int s, __be32 **cellp); | 106 | extern u64 dt_mem_next_cell(int s, __be32 **cellp); |
| 104 | 107 | ||
| @@ -118,6 +121,7 @@ extern void unflatten_and_copy_device_tree(void); | |||
| 118 | extern void early_init_devtree(void *); | 121 | extern void early_init_devtree(void *); |
| 119 | extern void early_get_first_memblock_info(void *, phys_addr_t *); | 122 | extern void early_get_first_memblock_info(void *, phys_addr_t *); |
| 120 | #else /* CONFIG_OF_FLATTREE */ | 123 | #else /* CONFIG_OF_FLATTREE */ |
| 124 | static inline void early_init_fdt_scan_reserved_mem(void) {} | ||
| 121 | static inline const char *of_flat_dt_get_machine_name(void) { return NULL; } | 125 | static inline const char *of_flat_dt_get_machine_name(void) { return NULL; } |
| 122 | static inline void unflatten_device_tree(void) {} | 126 | static inline void unflatten_device_tree(void) {} |
| 123 | static inline void unflatten_and_copy_device_tree(void) {} | 127 | static inline void unflatten_and_copy_device_tree(void) {} |
diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h new file mode 100644 index 000000000000..befef42e015b --- /dev/null +++ b/include/linux/of_graph.h | |||
| @@ -0,0 +1,66 @@ | |||
| 1 | /* | ||
| 2 | * OF graph binding parsing helpers | ||
| 3 | * | ||
| 4 | * Copyright (C) 2012 - 2013 Samsung Electronics Co., Ltd. | ||
| 5 | * Author: Sylwester Nawrocki <s.nawrocki@samsung.com> | ||
| 6 | * | ||
| 7 | * Copyright (C) 2012 Renesas Electronics Corp. | ||
| 8 | * Author: Guennadi Liakhovetski <g.liakhovetski@gmx.de> | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of version 2 of the GNU General Public License as | ||
| 12 | * published by the Free Software Foundation. | ||
| 13 | */ | ||
| 14 | #ifndef __LINUX_OF_GRAPH_H | ||
| 15 | #define __LINUX_OF_GRAPH_H | ||
| 16 | |||
| 17 | /** | ||
| 18 | * struct of_endpoint - the OF graph endpoint data structure | ||
| 19 | * @port: identifier (value of reg property) of a port this endpoint belongs to | ||
| 20 | * @id: identifier (value of reg property) of this endpoint | ||
| 21 | * @local_node: pointer to device_node of this endpoint | ||
| 22 | */ | ||
| 23 | struct of_endpoint { | ||
| 24 | unsigned int port; | ||
| 25 | unsigned int id; | ||
| 26 | const struct device_node *local_node; | ||
| 27 | }; | ||
| 28 | |||
| 29 | #ifdef CONFIG_OF | ||
| 30 | int of_graph_parse_endpoint(const struct device_node *node, | ||
| 31 | struct of_endpoint *endpoint); | ||
| 32 | struct device_node *of_graph_get_next_endpoint(const struct device_node *parent, | ||
| 33 | struct device_node *previous); | ||
| 34 | struct device_node *of_graph_get_remote_port_parent( | ||
| 35 | const struct device_node *node); | ||
| 36 | struct device_node *of_graph_get_remote_port(const struct device_node *node); | ||
| 37 | #else | ||
| 38 | |||
| 39 | static inline int of_graph_parse_endpoint(const struct device_node *node, | ||
| 40 | struct of_endpoint *endpoint) | ||
| 41 | { | ||
| 42 | return -ENOSYS; | ||
| 43 | } | ||
| 44 | |||
| 45 | static inline struct device_node *of_graph_get_next_endpoint( | ||
| 46 | const struct device_node *parent, | ||
| 47 | struct device_node *previous) | ||
| 48 | { | ||
| 49 | return NULL; | ||
| 50 | } | ||
| 51 | |||
| 52 | static inline struct device_node *of_graph_get_remote_port_parent( | ||
| 53 | const struct device_node *node) | ||
| 54 | { | ||
| 55 | return NULL; | ||
| 56 | } | ||
| 57 | |||
| 58 | static inline struct device_node *of_graph_get_remote_port( | ||
| 59 | const struct device_node *node) | ||
| 60 | { | ||
| 61 | return NULL; | ||
| 62 | } | ||
| 63 | |||
| 64 | #endif /* CONFIG_OF */ | ||
| 65 | |||
| 66 | #endif /* __LINUX_OF_GRAPH_H */ | ||
diff --git a/include/linux/of_reserved_mem.h b/include/linux/of_reserved_mem.h new file mode 100644 index 000000000000..9b1fbb7f29fc --- /dev/null +++ b/include/linux/of_reserved_mem.h | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | #ifndef __OF_RESERVED_MEM_H | ||
| 2 | #define __OF_RESERVED_MEM_H | ||
| 3 | |||
| 4 | struct device; | ||
| 5 | struct of_phandle_args; | ||
| 6 | struct reserved_mem_ops; | ||
| 7 | |||
| 8 | struct reserved_mem { | ||
| 9 | const char *name; | ||
| 10 | unsigned long fdt_node; | ||
| 11 | const struct reserved_mem_ops *ops; | ||
| 12 | phys_addr_t base; | ||
| 13 | phys_addr_t size; | ||
| 14 | void *priv; | ||
| 15 | }; | ||
| 16 | |||
| 17 | struct reserved_mem_ops { | ||
| 18 | void (*device_init)(struct reserved_mem *rmem, | ||
| 19 | struct device *dev); | ||
| 20 | void (*device_release)(struct reserved_mem *rmem, | ||
| 21 | struct device *dev); | ||
| 22 | }; | ||
| 23 | |||
| 24 | typedef int (*reservedmem_of_init_fn)(struct reserved_mem *rmem, | ||
| 25 | unsigned long node, const char *uname); | ||
| 26 | |||
| 27 | #ifdef CONFIG_OF_RESERVED_MEM | ||
| 28 | void fdt_init_reserved_mem(void); | ||
| 29 | void fdt_reserved_mem_save_node(unsigned long node, const char *uname, | ||
| 30 | phys_addr_t base, phys_addr_t size); | ||
| 31 | |||
| 32 | #define RESERVEDMEM_OF_DECLARE(name, compat, init) \ | ||
| 33 | static const struct of_device_id __reservedmem_of_table_##name \ | ||
| 34 | __used __section(__reservedmem_of_table) \ | ||
| 35 | = { .compatible = compat, \ | ||
| 36 | .data = (init == (reservedmem_of_init_fn)NULL) ? \ | ||
| 37 | init : init } | ||
| 38 | |||
| 39 | #else | ||
| 40 | static inline void fdt_init_reserved_mem(void) { } | ||
| 41 | static inline void fdt_reserved_mem_save_node(unsigned long node, | ||
| 42 | const char *uname, phys_addr_t base, phys_addr_t size) { } | ||
| 43 | |||
| 44 | #define RESERVEDMEM_OF_DECLARE(name, compat, init) \ | ||
| 45 | static const struct of_device_id __reservedmem_of_table_##name \ | ||
| 46 | __attribute__((unused)) \ | ||
| 47 | = { .compatible = compat, \ | ||
| 48 | .data = (init == (reservedmem_of_init_fn)NULL) ? \ | ||
| 49 | init : init } | ||
| 50 | |||
| 51 | #endif | ||
| 52 | |||
| 53 | #endif /* __OF_RESERVED_MEM_H */ | ||
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h index 5a462c4e5009..637a608ded0b 100644 --- a/include/linux/pci-acpi.h +++ b/include/linux/pci-acpi.h | |||
| @@ -59,12 +59,12 @@ static inline void acpi_pci_slot_remove(struct pci_bus *bus) { } | |||
| 59 | void acpiphp_init(void); | 59 | void acpiphp_init(void); |
| 60 | void acpiphp_enumerate_slots(struct pci_bus *bus); | 60 | void acpiphp_enumerate_slots(struct pci_bus *bus); |
| 61 | void acpiphp_remove_slots(struct pci_bus *bus); | 61 | void acpiphp_remove_slots(struct pci_bus *bus); |
| 62 | void acpiphp_check_host_bridge(acpi_handle handle); | 62 | void acpiphp_check_host_bridge(struct acpi_device *adev); |
| 63 | #else | 63 | #else |
| 64 | static inline void acpiphp_init(void) { } | 64 | static inline void acpiphp_init(void) { } |
| 65 | static inline void acpiphp_enumerate_slots(struct pci_bus *bus) { } | 65 | static inline void acpiphp_enumerate_slots(struct pci_bus *bus) { } |
| 66 | static inline void acpiphp_remove_slots(struct pci_bus *bus) { } | 66 | static inline void acpiphp_remove_slots(struct pci_bus *bus) { } |
| 67 | static inline void acpiphp_check_host_bridge(acpi_handle handle) { } | 67 | static inline void acpiphp_check_host_bridge(struct acpi_device *adev) { } |
| 68 | #endif | 68 | #endif |
| 69 | 69 | ||
| 70 | #else /* CONFIG_ACPI */ | 70 | #else /* CONFIG_ACPI */ |
diff --git a/include/linux/pci.h b/include/linux/pci.h index fb57c892b214..aab57b4abe7f 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -29,7 +29,6 @@ | |||
| 29 | #include <linux/atomic.h> | 29 | #include <linux/atomic.h> |
| 30 | #include <linux/device.h> | 30 | #include <linux/device.h> |
| 31 | #include <linux/io.h> | 31 | #include <linux/io.h> |
| 32 | #include <linux/irqreturn.h> | ||
| 33 | #include <uapi/linux/pci.h> | 32 | #include <uapi/linux/pci.h> |
| 34 | 33 | ||
| 35 | #include <linux/pci_ids.h> | 34 | #include <linux/pci_ids.h> |
| @@ -170,6 +169,8 @@ enum pci_dev_flags { | |||
| 170 | PCI_DEV_FLAGS_NO_D3 = (__force pci_dev_flags_t) 2, | 169 | PCI_DEV_FLAGS_NO_D3 = (__force pci_dev_flags_t) 2, |
| 171 | /* Provide indication device is assigned by a Virtual Machine Manager */ | 170 | /* Provide indication device is assigned by a Virtual Machine Manager */ |
| 172 | PCI_DEV_FLAGS_ASSIGNED = (__force pci_dev_flags_t) 4, | 171 | PCI_DEV_FLAGS_ASSIGNED = (__force pci_dev_flags_t) 4, |
| 172 | /* Flag for quirk use to store if quirk-specific ACS is enabled */ | ||
| 173 | PCI_DEV_FLAGS_ACS_ENABLED_QUIRK = (__force pci_dev_flags_t) 8, | ||
| 173 | }; | 174 | }; |
| 174 | 175 | ||
| 175 | enum pci_irq_reroute_variant { | 176 | enum pci_irq_reroute_variant { |
| @@ -461,7 +462,6 @@ struct pci_bus { | |||
| 461 | unsigned int is_added:1; | 462 | unsigned int is_added:1; |
| 462 | }; | 463 | }; |
| 463 | 464 | ||
| 464 | #define pci_bus_b(n) list_entry(n, struct pci_bus, node) | ||
| 465 | #define to_pci_bus(n) container_of(n, struct pci_bus, dev) | 465 | #define to_pci_bus(n) container_of(n, struct pci_bus, dev) |
| 466 | 466 | ||
| 467 | /* | 467 | /* |
| @@ -1066,7 +1066,7 @@ void pci_bus_remove_resources(struct pci_bus *bus); | |||
| 1066 | int __must_check pci_bus_alloc_resource(struct pci_bus *bus, | 1066 | int __must_check pci_bus_alloc_resource(struct pci_bus *bus, |
| 1067 | struct resource *res, resource_size_t size, | 1067 | struct resource *res, resource_size_t size, |
| 1068 | resource_size_t align, resource_size_t min, | 1068 | resource_size_t align, resource_size_t min, |
| 1069 | unsigned int type_mask, | 1069 | unsigned long type_mask, |
| 1070 | resource_size_t (*alignf)(void *, | 1070 | resource_size_t (*alignf)(void *, |
| 1071 | const struct resource *, | 1071 | const struct resource *, |
| 1072 | resource_size_t, | 1072 | resource_size_t, |
| @@ -1169,8 +1169,23 @@ void msi_remove_pci_irq_vectors(struct pci_dev *dev); | |||
| 1169 | void pci_restore_msi_state(struct pci_dev *dev); | 1169 | void pci_restore_msi_state(struct pci_dev *dev); |
| 1170 | int pci_msi_enabled(void); | 1170 | int pci_msi_enabled(void); |
| 1171 | int pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec); | 1171 | int pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec); |
| 1172 | static inline int pci_enable_msi_exact(struct pci_dev *dev, int nvec) | ||
| 1173 | { | ||
| 1174 | int rc = pci_enable_msi_range(dev, nvec, nvec); | ||
| 1175 | if (rc < 0) | ||
| 1176 | return rc; | ||
| 1177 | return 0; | ||
| 1178 | } | ||
| 1172 | int pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries, | 1179 | int pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries, |
| 1173 | int minvec, int maxvec); | 1180 | int minvec, int maxvec); |
| 1181 | static inline int pci_enable_msix_exact(struct pci_dev *dev, | ||
| 1182 | struct msix_entry *entries, int nvec) | ||
| 1183 | { | ||
| 1184 | int rc = pci_enable_msix_range(dev, entries, nvec, nvec); | ||
| 1185 | if (rc < 0) | ||
| 1186 | return rc; | ||
| 1187 | return 0; | ||
| 1188 | } | ||
| 1174 | #else | 1189 | #else |
| 1175 | static inline int pci_msi_vec_count(struct pci_dev *dev) { return -ENOSYS; } | 1190 | static inline int pci_msi_vec_count(struct pci_dev *dev) { return -ENOSYS; } |
| 1176 | static inline int pci_enable_msi_block(struct pci_dev *dev, int nvec) | 1191 | static inline int pci_enable_msi_block(struct pci_dev *dev, int nvec) |
| @@ -1189,9 +1204,14 @@ static inline int pci_msi_enabled(void) { return 0; } | |||
| 1189 | static inline int pci_enable_msi_range(struct pci_dev *dev, int minvec, | 1204 | static inline int pci_enable_msi_range(struct pci_dev *dev, int minvec, |
| 1190 | int maxvec) | 1205 | int maxvec) |
| 1191 | { return -ENOSYS; } | 1206 | { return -ENOSYS; } |
| 1207 | static inline int pci_enable_msi_exact(struct pci_dev *dev, int nvec) | ||
| 1208 | { return -ENOSYS; } | ||
| 1192 | static inline int pci_enable_msix_range(struct pci_dev *dev, | 1209 | static inline int pci_enable_msix_range(struct pci_dev *dev, |
| 1193 | struct msix_entry *entries, int minvec, int maxvec) | 1210 | struct msix_entry *entries, int minvec, int maxvec) |
| 1194 | { return -ENOSYS; } | 1211 | { return -ENOSYS; } |
| 1212 | static inline int pci_enable_msix_exact(struct pci_dev *dev, | ||
| 1213 | struct msix_entry *entries, int nvec) | ||
| 1214 | { return -ENOSYS; } | ||
| 1195 | #endif | 1215 | #endif |
| 1196 | 1216 | ||
| 1197 | #ifdef CONFIG_PCIEPORTBUS | 1217 | #ifdef CONFIG_PCIEPORTBUS |
| @@ -1510,6 +1530,7 @@ enum pci_fixup_pass { | |||
| 1510 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); | 1530 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); |
| 1511 | struct pci_dev *pci_get_dma_source(struct pci_dev *dev); | 1531 | struct pci_dev *pci_get_dma_source(struct pci_dev *dev); |
| 1512 | int pci_dev_specific_acs_enabled(struct pci_dev *dev, u16 acs_flags); | 1532 | int pci_dev_specific_acs_enabled(struct pci_dev *dev, u16 acs_flags); |
| 1533 | void pci_dev_specific_enable_acs(struct pci_dev *dev); | ||
| 1513 | #else | 1534 | #else |
| 1514 | static inline void pci_fixup_device(enum pci_fixup_pass pass, | 1535 | static inline void pci_fixup_device(enum pci_fixup_pass pass, |
| 1515 | struct pci_dev *dev) { } | 1536 | struct pci_dev *dev) { } |
| @@ -1522,6 +1543,7 @@ static inline int pci_dev_specific_acs_enabled(struct pci_dev *dev, | |||
| 1522 | { | 1543 | { |
| 1523 | return -ENOTTY; | 1544 | return -ENOTTY; |
| 1524 | } | 1545 | } |
| 1546 | static inline void pci_dev_specific_enable_acs(struct pci_dev *dev) { } | ||
| 1525 | #endif | 1547 | #endif |
| 1526 | 1548 | ||
| 1527 | void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen); | 1549 | void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen); |
| @@ -1577,7 +1599,6 @@ void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar); | |||
| 1577 | #ifdef CONFIG_PCI_IOV | 1599 | #ifdef CONFIG_PCI_IOV |
| 1578 | int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn); | 1600 | int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn); |
| 1579 | void pci_disable_sriov(struct pci_dev *dev); | 1601 | void pci_disable_sriov(struct pci_dev *dev); |
| 1580 | irqreturn_t pci_sriov_migration(struct pci_dev *dev); | ||
| 1581 | int pci_num_vf(struct pci_dev *dev); | 1602 | int pci_num_vf(struct pci_dev *dev); |
| 1582 | int pci_vfs_assigned(struct pci_dev *dev); | 1603 | int pci_vfs_assigned(struct pci_dev *dev); |
| 1583 | int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs); | 1604 | int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs); |
| @@ -1586,8 +1607,6 @@ int pci_sriov_get_totalvfs(struct pci_dev *dev); | |||
| 1586 | static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) | 1607 | static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) |
| 1587 | { return -ENODEV; } | 1608 | { return -ENODEV; } |
| 1588 | static inline void pci_disable_sriov(struct pci_dev *dev) { } | 1609 | static inline void pci_disable_sriov(struct pci_dev *dev) { } |
| 1589 | static inline irqreturn_t pci_sriov_migration(struct pci_dev *dev) | ||
| 1590 | { return IRQ_NONE; } | ||
| 1591 | static inline int pci_num_vf(struct pci_dev *dev) { return 0; } | 1610 | static inline int pci_num_vf(struct pci_dev *dev) { return 0; } |
| 1592 | static inline int pci_vfs_assigned(struct pci_dev *dev) | 1611 | static inline int pci_vfs_assigned(struct pci_dev *dev) |
| 1593 | { return 0; } | 1612 | { return 0; } |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 97fbecdd7a40..d4de24b4d4c6 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -528,6 +528,8 @@ | |||
| 528 | #define PCI_DEVICE_ID_AMD_15H_NB_F5 0x1605 | 528 | #define PCI_DEVICE_ID_AMD_15H_NB_F5 0x1605 |
| 529 | #define PCI_DEVICE_ID_AMD_16H_NB_F3 0x1533 | 529 | #define PCI_DEVICE_ID_AMD_16H_NB_F3 0x1533 |
| 530 | #define PCI_DEVICE_ID_AMD_16H_NB_F4 0x1534 | 530 | #define PCI_DEVICE_ID_AMD_16H_NB_F4 0x1534 |
| 531 | #define PCI_DEVICE_ID_AMD_16H_M30H_NB_F3 0x1583 | ||
| 532 | #define PCI_DEVICE_ID_AMD_16H_M30H_NB_F4 0x1584 | ||
| 531 | #define PCI_DEVICE_ID_AMD_CNB17H_F3 0x1703 | 533 | #define PCI_DEVICE_ID_AMD_CNB17H_F3 0x1703 |
| 532 | #define PCI_DEVICE_ID_AMD_LANCE 0x2000 | 534 | #define PCI_DEVICE_ID_AMD_LANCE 0x2000 |
| 533 | #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 | 535 | #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 |
| @@ -726,6 +728,7 @@ | |||
| 726 | #define PCI_DEVICE_ID_SI_7018 0x7018 | 728 | #define PCI_DEVICE_ID_SI_7018 0x7018 |
| 727 | 729 | ||
| 728 | #define PCI_VENDOR_ID_HP 0x103c | 730 | #define PCI_VENDOR_ID_HP 0x103c |
| 731 | #define PCI_VENDOR_ID_HP_3PAR 0x1590 | ||
| 729 | #define PCI_DEVICE_ID_HP_VISUALIZE_EG 0x1005 | 732 | #define PCI_DEVICE_ID_HP_VISUALIZE_EG 0x1005 |
| 730 | #define PCI_DEVICE_ID_HP_VISUALIZE_FX6 0x1006 | 733 | #define PCI_DEVICE_ID_HP_VISUALIZE_FX6 0x1006 |
| 731 | #define PCI_DEVICE_ID_HP_VISUALIZE_FX4 0x1008 | 734 | #define PCI_DEVICE_ID_HP_VISUALIZE_FX4 0x1008 |
| @@ -2531,6 +2534,9 @@ | |||
| 2531 | 2534 | ||
| 2532 | #define PCI_VENDOR_ID_INTEL 0x8086 | 2535 | #define PCI_VENDOR_ID_INTEL 0x8086 |
| 2533 | #define PCI_DEVICE_ID_INTEL_EESSC 0x0008 | 2536 | #define PCI_DEVICE_ID_INTEL_EESSC 0x0008 |
| 2537 | #define PCI_DEVICE_ID_INTEL_SNB_IMC 0x0100 | ||
| 2538 | #define PCI_DEVICE_ID_INTEL_IVB_IMC 0x0154 | ||
| 2539 | #define PCI_DEVICE_ID_INTEL_HSW_IMC 0x0c00 | ||
| 2534 | #define PCI_DEVICE_ID_INTEL_PXHD_0 0x0320 | 2540 | #define PCI_DEVICE_ID_INTEL_PXHD_0 0x0320 |
| 2535 | #define PCI_DEVICE_ID_INTEL_PXHD_1 0x0321 | 2541 | #define PCI_DEVICE_ID_INTEL_PXHD_1 0x0321 |
| 2536 | #define PCI_DEVICE_ID_INTEL_PXH_0 0x0329 | 2542 | #define PCI_DEVICE_ID_INTEL_PXH_0 0x0329 |
diff --git a/include/linux/usb/omap_control_usb.h b/include/linux/phy/omap_control_phy.h index 69ae383ee3cc..5450403c7546 100644 --- a/include/linux/usb/omap_control_usb.h +++ b/include/linux/phy/omap_control_phy.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * omap_control_usb.h - Header file for the USB part of control module. | 2 | * omap_control_phy.h - Header file for the PHY part of control module. |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com | 4 | * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com |
| 5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
| @@ -16,10 +16,10 @@ | |||
| 16 | * | 16 | * |
| 17 | */ | 17 | */ |
| 18 | 18 | ||
| 19 | #ifndef __OMAP_CONTROL_USB_H__ | 19 | #ifndef __OMAP_CONTROL_PHY_H__ |
| 20 | #define __OMAP_CONTROL_USB_H__ | 20 | #define __OMAP_CONTROL_PHY_H__ |
| 21 | 21 | ||
| 22 | enum omap_control_usb_type { | 22 | enum omap_control_phy_type { |
| 23 | OMAP_CTRL_TYPE_OTGHS = 1, /* Mailbox OTGHS_CONTROL */ | 23 | OMAP_CTRL_TYPE_OTGHS = 1, /* Mailbox OTGHS_CONTROL */ |
| 24 | OMAP_CTRL_TYPE_USB2, /* USB2_PHY, power down in CONTROL_DEV_CONF */ | 24 | OMAP_CTRL_TYPE_USB2, /* USB2_PHY, power down in CONTROL_DEV_CONF */ |
| 25 | OMAP_CTRL_TYPE_PIPE3, /* PIPE3 PHY, DPLL & seperate Rx/Tx power */ | 25 | OMAP_CTRL_TYPE_PIPE3, /* PIPE3 PHY, DPLL & seperate Rx/Tx power */ |
| @@ -27,7 +27,7 @@ enum omap_control_usb_type { | |||
| 27 | OMAP_CTRL_TYPE_AM437USB2, /* USB2 PHY, power e.g. AM437x */ | 27 | OMAP_CTRL_TYPE_AM437USB2, /* USB2 PHY, power e.g. AM437x */ |
| 28 | }; | 28 | }; |
| 29 | 29 | ||
| 30 | struct omap_control_usb { | 30 | struct omap_control_phy { |
| 31 | struct device *dev; | 31 | struct device *dev; |
| 32 | 32 | ||
| 33 | u32 __iomem *otghs_control; | 33 | u32 __iomem *otghs_control; |
| @@ -36,7 +36,7 @@ struct omap_control_usb { | |||
| 36 | 36 | ||
| 37 | struct clk *sys_clk; | 37 | struct clk *sys_clk; |
| 38 | 38 | ||
| 39 | enum omap_control_usb_type type; | 39 | enum omap_control_phy_type type; |
| 40 | }; | 40 | }; |
| 41 | 41 | ||
| 42 | enum omap_control_usb_mode { | 42 | enum omap_control_usb_mode { |
| @@ -54,14 +54,14 @@ enum omap_control_usb_mode { | |||
| 54 | #define OMAP_CTRL_DEV_SESSEND BIT(3) | 54 | #define OMAP_CTRL_DEV_SESSEND BIT(3) |
| 55 | #define OMAP_CTRL_DEV_IDDIG BIT(4) | 55 | #define OMAP_CTRL_DEV_IDDIG BIT(4) |
| 56 | 56 | ||
| 57 | #define OMAP_CTRL_USB_PWRCTL_CLK_CMD_MASK 0x003FC000 | 57 | #define OMAP_CTRL_PIPE3_PHY_PWRCTL_CLK_CMD_MASK 0x003FC000 |
| 58 | #define OMAP_CTRL_USB_PWRCTL_CLK_CMD_SHIFT 0xE | 58 | #define OMAP_CTRL_PIPE3_PHY_PWRCTL_CLK_CMD_SHIFT 0xE |
| 59 | 59 | ||
| 60 | #define OMAP_CTRL_USB_PWRCTL_CLK_FREQ_MASK 0xFFC00000 | 60 | #define OMAP_CTRL_PIPE3_PHY_PWRCTL_CLK_FREQ_MASK 0xFFC00000 |
| 61 | #define OMAP_CTRL_USB_PWRCTL_CLK_FREQ_SHIFT 0x16 | 61 | #define OMAP_CTRL_PIPE3_PHY_PWRCTL_CLK_FREQ_SHIFT 0x16 |
| 62 | 62 | ||
| 63 | #define OMAP_CTRL_USB3_PHY_TX_RX_POWERON 0x3 | 63 | #define OMAP_CTRL_PIPE3_PHY_TX_RX_POWERON 0x3 |
| 64 | #define OMAP_CTRL_USB3_PHY_TX_RX_POWEROFF 0x0 | 64 | #define OMAP_CTRL_PIPE3_PHY_TX_RX_POWEROFF 0x0 |
| 65 | 65 | ||
| 66 | #define OMAP_CTRL_USB2_PHY_PD BIT(28) | 66 | #define OMAP_CTRL_USB2_PHY_PD BIT(28) |
| 67 | 67 | ||
| @@ -70,13 +70,13 @@ enum omap_control_usb_mode { | |||
| 70 | #define AM437X_CTRL_USB2_OTGVDET_EN BIT(19) | 70 | #define AM437X_CTRL_USB2_OTGVDET_EN BIT(19) |
| 71 | #define AM437X_CTRL_USB2_OTGSESSEND_EN BIT(20) | 71 | #define AM437X_CTRL_USB2_OTGSESSEND_EN BIT(20) |
| 72 | 72 | ||
| 73 | #if IS_ENABLED(CONFIG_OMAP_CONTROL_USB) | 73 | #if IS_ENABLED(CONFIG_OMAP_CONTROL_PHY) |
| 74 | extern void omap_control_usb_phy_power(struct device *dev, int on); | 74 | void omap_control_phy_power(struct device *dev, int on); |
| 75 | extern void omap_control_usb_set_mode(struct device *dev, | 75 | void omap_control_usb_set_mode(struct device *dev, |
| 76 | enum omap_control_usb_mode mode); | 76 | enum omap_control_usb_mode mode); |
| 77 | #else | 77 | #else |
| 78 | 78 | ||
| 79 | static inline void omap_control_usb_phy_power(struct device *dev, int on) | 79 | static inline void omap_control_phy_power(struct device *dev, int on) |
| 80 | { | 80 | { |
| 81 | } | 81 | } |
| 82 | 82 | ||
| @@ -86,4 +86,4 @@ static inline void omap_control_usb_set_mode(struct device *dev, | |||
| 86 | } | 86 | } |
| 87 | #endif | 87 | #endif |
| 88 | 88 | ||
| 89 | #endif /* __OMAP_CONTROL_USB_H__ */ | 89 | #endif /* __OMAP_CONTROL_PHY_H__ */ |
diff --git a/include/linux/usb/omap_usb.h b/include/linux/phy/omap_usb.h index 6ae29360e1d2..dc2c541a619b 100644 --- a/include/linux/usb/omap_usb.h +++ b/include/linux/phy/omap_usb.h | |||
| @@ -34,14 +34,24 @@ struct omap_usb { | |||
| 34 | struct usb_phy phy; | 34 | struct usb_phy phy; |
| 35 | struct phy_companion *comparator; | 35 | struct phy_companion *comparator; |
| 36 | void __iomem *pll_ctrl_base; | 36 | void __iomem *pll_ctrl_base; |
| 37 | void __iomem *phy_base; | ||
| 37 | struct device *dev; | 38 | struct device *dev; |
| 38 | struct device *control_dev; | 39 | struct device *control_dev; |
| 39 | struct clk *wkupclk; | 40 | struct clk *wkupclk; |
| 40 | struct clk *sys_clk; | ||
| 41 | struct clk *optclk; | 41 | struct clk *optclk; |
| 42 | u8 is_suspended:1; | 42 | u8 flags; |
| 43 | }; | 43 | }; |
| 44 | 44 | ||
| 45 | struct usb_phy_data { | ||
| 46 | const char *label; | ||
| 47 | u8 flags; | ||
| 48 | }; | ||
| 49 | |||
| 50 | /* Driver Flags */ | ||
| 51 | #define OMAP_USB2_HAS_START_SRP (1 << 0) | ||
| 52 | #define OMAP_USB2_HAS_SET_VBUS (1 << 1) | ||
| 53 | #define OMAP_USB2_CALIBRATE_FALSE_DISCONNECT (1 << 2) | ||
| 54 | |||
| 45 | #define phy_to_omapusb(x) container_of((x), struct omap_usb, phy) | 55 | #define phy_to_omapusb(x) container_of((x), struct omap_usb, phy) |
| 46 | 56 | ||
| 47 | #if defined(CONFIG_OMAP_USB2) || defined(CONFIG_OMAP_USB2_MODULE) | 57 | #if defined(CONFIG_OMAP_USB2) || defined(CONFIG_OMAP_USB2_MODULE) |
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index 3f83459dbb20..e2f5ca96cddc 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h | |||
| @@ -149,8 +149,11 @@ struct phy *phy_get(struct device *dev, const char *string); | |||
| 149 | struct phy *phy_optional_get(struct device *dev, const char *string); | 149 | struct phy *phy_optional_get(struct device *dev, const char *string); |
| 150 | struct phy *devm_phy_get(struct device *dev, const char *string); | 150 | struct phy *devm_phy_get(struct device *dev, const char *string); |
| 151 | struct phy *devm_phy_optional_get(struct device *dev, const char *string); | 151 | struct phy *devm_phy_optional_get(struct device *dev, const char *string); |
| 152 | struct phy *devm_of_phy_get(struct device *dev, struct device_node *np, | ||
| 153 | const char *con_id); | ||
| 152 | void phy_put(struct phy *phy); | 154 | void phy_put(struct phy *phy); |
| 153 | void devm_phy_put(struct device *dev, struct phy *phy); | 155 | void devm_phy_put(struct device *dev, struct phy *phy); |
| 156 | struct phy *of_phy_get(struct device_node *np, const char *con_id); | ||
| 154 | struct phy *of_phy_simple_xlate(struct device *dev, | 157 | struct phy *of_phy_simple_xlate(struct device *dev, |
| 155 | struct of_phandle_args *args); | 158 | struct of_phandle_args *args); |
| 156 | struct phy *phy_create(struct device *dev, const struct phy_ops *ops, | 159 | struct phy *phy_create(struct device *dev, const struct phy_ops *ops, |
| @@ -251,6 +254,13 @@ static inline struct phy *devm_phy_optional_get(struct device *dev, | |||
| 251 | return ERR_PTR(-ENOSYS); | 254 | return ERR_PTR(-ENOSYS); |
| 252 | } | 255 | } |
| 253 | 256 | ||
| 257 | static inline struct phy *devm_of_phy_get(struct device *dev, | ||
| 258 | struct device_node *np, | ||
| 259 | const char *con_id) | ||
| 260 | { | ||
| 261 | return ERR_PTR(-ENOSYS); | ||
| 262 | } | ||
| 263 | |||
| 254 | static inline void phy_put(struct phy *phy) | 264 | static inline void phy_put(struct phy *phy) |
| 255 | { | 265 | { |
| 256 | } | 266 | } |
| @@ -259,6 +269,11 @@ static inline void devm_phy_put(struct device *dev, struct phy *phy) | |||
| 259 | { | 269 | { |
| 260 | } | 270 | } |
| 261 | 271 | ||
| 272 | static inline struct phy *of_phy_get(struct device_node *np, const char *con_id) | ||
| 273 | { | ||
| 274 | return ERR_PTR(-ENOSYS); | ||
| 275 | } | ||
| 276 | |||
| 262 | static inline struct phy *of_phy_simple_xlate(struct device *dev, | 277 | static inline struct phy *of_phy_simple_xlate(struct device *dev, |
| 263 | struct of_phandle_args *args) | 278 | struct of_phandle_args *args) |
| 264 | { | 279 | { |
diff --git a/include/linux/platform_data/adau1977.h b/include/linux/platform_data/adau1977.h new file mode 100644 index 000000000000..bed11d908f92 --- /dev/null +++ b/include/linux/platform_data/adau1977.h | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | /* | ||
| 2 | * ADAU1977/ADAU1978/ADAU1979 driver | ||
| 3 | * | ||
| 4 | * Copyright 2014 Analog Devices Inc. | ||
| 5 | * Author: Lars-Peter Clausen <lars@metafoo.de> | ||
| 6 | * | ||
| 7 | * Licensed under the GPL-2. | ||
| 8 | */ | ||
| 9 | |||
| 10 | #ifndef __LINUX_PLATFORM_DATA_ADAU1977_H__ | ||
| 11 | #define __LINUX_PLATFORM_DATA_ADAU1977_H__ | ||
| 12 | |||
| 13 | /** | ||
| 14 | * enum adau1977_micbias - ADAU1977 MICBIAS pin voltage setting | ||
| 15 | * @ADAU1977_MICBIAS_5V0: MICBIAS is set to 5.0 V | ||
| 16 | * @ADAU1977_MICBIAS_5V5: MICBIAS is set to 5.5 V | ||
| 17 | * @ADAU1977_MICBIAS_6V0: MICBIAS is set to 6.0 V | ||
| 18 | * @ADAU1977_MICBIAS_6V5: MICBIAS is set to 6.5 V | ||
| 19 | * @ADAU1977_MICBIAS_7V0: MICBIAS is set to 7.0 V | ||
| 20 | * @ADAU1977_MICBIAS_7V5: MICBIAS is set to 7.5 V | ||
| 21 | * @ADAU1977_MICBIAS_8V0: MICBIAS is set to 8.0 V | ||
| 22 | * @ADAU1977_MICBIAS_8V5: MICBIAS is set to 8.5 V | ||
| 23 | * @ADAU1977_MICBIAS_9V0: MICBIAS is set to 9.0 V | ||
| 24 | */ | ||
| 25 | enum adau1977_micbias { | ||
| 26 | ADAU1977_MICBIAS_5V0 = 0x0, | ||
| 27 | ADAU1977_MICBIAS_5V5 = 0x1, | ||
| 28 | ADAU1977_MICBIAS_6V0 = 0x2, | ||
| 29 | ADAU1977_MICBIAS_6V5 = 0x3, | ||
| 30 | ADAU1977_MICBIAS_7V0 = 0x4, | ||
| 31 | ADAU1977_MICBIAS_7V5 = 0x5, | ||
| 32 | ADAU1977_MICBIAS_8V0 = 0x6, | ||
| 33 | ADAU1977_MICBIAS_8V5 = 0x7, | ||
| 34 | ADAU1977_MICBIAS_9V0 = 0x8, | ||
| 35 | }; | ||
| 36 | |||
| 37 | /** | ||
| 38 | * struct adau1977_platform_data - Platform configuration data for the ADAU1977 | ||
| 39 | * @micbias: Specifies the voltage for the MICBIAS pin | ||
| 40 | */ | ||
| 41 | struct adau1977_platform_data { | ||
| 42 | enum adau1977_micbias micbias; | ||
| 43 | }; | ||
| 44 | |||
| 45 | #endif | ||
diff --git a/include/linux/platform_data/asoc-s3c.h b/include/linux/platform_data/asoc-s3c.h index 9efc04dd255a..709c6f7e2f8c 100644 --- a/include/linux/platform_data/asoc-s3c.h +++ b/include/linux/platform_data/asoc-s3c.h | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | /* arch/arm/plat-samsung/include/plat/audio.h | 1 | /* |
| 2 | * | ||
| 3 | * Copyright (c) 2009 Samsung Electronics Co. Ltd | 2 | * Copyright (c) 2009 Samsung Electronics Co. Ltd |
| 4 | * Author: Jaswinder Singh <jassi.brar@samsung.com> | 3 | * Author: Jaswinder Singh <jassi.brar@samsung.com> |
| 5 | * | 4 | * |
diff --git a/include/linux/platform_data/asoc-s3c24xx_simtec.h b/include/linux/platform_data/asoc-s3c24xx_simtec.h index 376af5286a3e..d220e54123aa 100644 --- a/include/linux/platform_data/asoc-s3c24xx_simtec.h +++ b/include/linux/platform_data/asoc-s3c24xx_simtec.h | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | /* arch/arm/plat-samsung/include/plat/audio-simtec.h | 1 | /* |
| 2 | * | ||
| 3 | * Copyright 2008 Simtec Electronics | 2 | * Copyright 2008 Simtec Electronics |
| 4 | * http://armlinux.simtec.co.uk/ | 3 | * http://armlinux.simtec.co.uk/ |
| 5 | * Ben Dooks <ben@simtec.co.uk> | 4 | * Ben Dooks <ben@simtec.co.uk> |
diff --git a/include/linux/platform_data/bt-nokia-h4p.h b/include/linux/platform_data/bt-nokia-h4p.h new file mode 100644 index 000000000000..30d169dfadf3 --- /dev/null +++ b/include/linux/platform_data/bt-nokia-h4p.h | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | /* | ||
| 2 | * This file is part of Nokia H4P bluetooth driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010 Nokia Corporation. | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or | ||
| 7 | * modify it under the terms of the GNU General Public License | ||
| 8 | * version 2 as published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, but | ||
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | * General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program; if not, write to the Free Software | ||
| 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
| 18 | * 02110-1301 USA | ||
| 19 | * | ||
| 20 | */ | ||
| 21 | |||
| 22 | |||
| 23 | /** | ||
| 24 | * struct hci_h4p_platform data - hci_h4p Platform data structure | ||
| 25 | */ | ||
| 26 | struct hci_h4p_platform_data { | ||
| 27 | int chip_type; | ||
| 28 | int bt_sysclk; | ||
| 29 | unsigned int bt_wakeup_gpio; | ||
| 30 | unsigned int host_wakeup_gpio; | ||
| 31 | unsigned int reset_gpio; | ||
| 32 | int reset_gpio_shared; | ||
| 33 | unsigned int uart_irq; | ||
| 34 | phys_addr_t uart_base; | ||
| 35 | const char *uart_iclk; | ||
| 36 | const char *uart_fclk; | ||
| 37 | void (*set_pm_limits)(struct device *dev, bool set); | ||
| 38 | }; | ||
diff --git a/include/linux/platform_data/davinci_asp.h b/include/linux/platform_data/davinci_asp.h index 5245992b0367..85ad68f9206a 100644 --- a/include/linux/platform_data/davinci_asp.h +++ b/include/linux/platform_data/davinci_asp.h | |||
| @@ -18,7 +18,7 @@ | |||
| 18 | 18 | ||
| 19 | #include <linux/genalloc.h> | 19 | #include <linux/genalloc.h> |
| 20 | 20 | ||
| 21 | struct snd_platform_data { | 21 | struct davinci_mcasp_pdata { |
| 22 | u32 tx_dma_offset; | 22 | u32 tx_dma_offset; |
| 23 | u32 rx_dma_offset; | 23 | u32 rx_dma_offset; |
| 24 | int asp_chan_q; /* event queue number for ASP channel */ | 24 | int asp_chan_q; /* event queue number for ASP channel */ |
| @@ -87,6 +87,8 @@ struct snd_platform_data { | |||
| 87 | int tx_dma_channel; | 87 | int tx_dma_channel; |
| 88 | int rx_dma_channel; | 88 | int rx_dma_channel; |
| 89 | }; | 89 | }; |
| 90 | /* TODO: Fix arch/arm/mach-davinci/ users and remove this define */ | ||
| 91 | #define snd_platform_data davinci_mcasp_pdata | ||
| 90 | 92 | ||
| 91 | enum { | 93 | enum { |
| 92 | MCASP_VERSION_1 = 0, /* DM646x */ | 94 | MCASP_VERSION_1 = 0, /* DM646x */ |
diff --git a/include/linux/platform_data/max310x.h b/include/linux/platform_data/max310x.h deleted file mode 100644 index dd11dcd1a184..000000000000 --- a/include/linux/platform_data/max310x.h +++ /dev/null | |||
| @@ -1,64 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Maxim (Dallas) MAX3107/8/9, MAX14830 serial driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2012 Alexander Shiyan <shc_work@mail.ru> | ||
| 5 | * | ||
| 6 | * Based on max3100.c, by Christian Pellegrin <chripell@evolware.org> | ||
| 7 | * Based on max3110.c, by Feng Tang <feng.tang@intel.com> | ||
| 8 | * Based on max3107.c, by Aavamobile | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of the GNU General Public License as published by | ||
| 12 | * the Free Software Foundation; either version 2 of the License, or | ||
| 13 | * (at your option) any later version. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #ifndef _MAX310X_H_ | ||
| 17 | #define _MAX310X_H_ | ||
| 18 | |||
| 19 | /* | ||
| 20 | * Example board initialization data: | ||
| 21 | * | ||
| 22 | * static struct max310x_pdata max3107_pdata = { | ||
| 23 | * .driver_flags = MAX310X_EXT_CLK, | ||
| 24 | * .uart_flags[0] = MAX310X_ECHO_SUPRESS | MAX310X_AUTO_DIR_CTRL, | ||
| 25 | * .frequency = 3686400, | ||
| 26 | * .gpio_base = -1, | ||
| 27 | * }; | ||
| 28 | * | ||
| 29 | * static struct spi_board_info spi_device_max3107[] = { | ||
| 30 | * { | ||
| 31 | * .modalias = "max3107", | ||
| 32 | * .irq = IRQ_EINT3, | ||
| 33 | * .bus_num = 1, | ||
| 34 | * .chip_select = 1, | ||
| 35 | * .platform_data = &max3107_pdata, | ||
| 36 | * }, | ||
| 37 | * }; | ||
| 38 | */ | ||
| 39 | |||
| 40 | #define MAX310X_MAX_UARTS 4 | ||
| 41 | |||
| 42 | /* MAX310X platform data structure */ | ||
| 43 | struct max310x_pdata { | ||
| 44 | /* Flags global to driver */ | ||
| 45 | const u8 driver_flags; | ||
| 46 | #define MAX310X_EXT_CLK (0x00000001) /* External clock enable */ | ||
| 47 | /* Flags global to UART port */ | ||
| 48 | const u8 uart_flags[MAX310X_MAX_UARTS]; | ||
| 49 | #define MAX310X_LOOPBACK (0x00000001) /* Loopback mode enable */ | ||
| 50 | #define MAX310X_ECHO_SUPRESS (0x00000002) /* Enable echo supress */ | ||
| 51 | #define MAX310X_AUTO_DIR_CTRL (0x00000004) /* Enable Auto direction | ||
| 52 | * control (RS-485) | ||
| 53 | */ | ||
| 54 | /* Frequency (extrenal clock or crystal) */ | ||
| 55 | const int frequency; | ||
| 56 | /* GPIO base number (can be negative) */ | ||
| 57 | const int gpio_base; | ||
| 58 | /* Called during startup */ | ||
| 59 | void (*init)(void); | ||
| 60 | /* Called before finish */ | ||
| 61 | void (*exit)(void); | ||
| 62 | }; | ||
| 63 | |||
| 64 | #endif | ||
diff --git a/include/linux/platform_data/serial-imx.h b/include/linux/platform_data/serial-imx.h index 4adec9b154dd..3cc2e3c40914 100644 --- a/include/linux/platform_data/serial-imx.h +++ b/include/linux/platform_data/serial-imx.h | |||
| @@ -23,8 +23,6 @@ | |||
| 23 | #define IMXUART_IRDA (1<<1) | 23 | #define IMXUART_IRDA (1<<1) |
| 24 | 24 | ||
| 25 | struct imxuart_platform_data { | 25 | struct imxuart_platform_data { |
| 26 | int (*init)(struct platform_device *pdev); | ||
| 27 | void (*exit)(struct platform_device *pdev); | ||
| 28 | unsigned int flags; | 26 | unsigned int flags; |
| 29 | void (*irda_enable)(int enable); | 27 | void (*irda_enable)(int enable); |
| 30 | unsigned int irda_inv_rx:1; | 28 | unsigned int irda_inv_rx:1; |
diff --git a/include/linux/platform_data/spi-s3c64xx.h b/include/linux/platform_data/spi-s3c64xx.h index 8447f634c7f5..d3889b98a1a1 100644 --- a/include/linux/platform_data/spi-s3c64xx.h +++ b/include/linux/platform_data/spi-s3c64xx.h | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | /* linux/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h | 1 | /* |
| 2 | * | ||
| 3 | * Copyright (C) 2009 Samsung Electronics Ltd. | 2 | * Copyright (C) 2009 Samsung Electronics Ltd. |
| 4 | * Jaswinder Singh <jassi.brar@samsung.com> | 3 | * Jaswinder Singh <jassi.brar@samsung.com> |
| 5 | * | 4 | * |
| @@ -8,8 +7,8 @@ | |||
| 8 | * published by the Free Software Foundation. | 7 | * published by the Free Software Foundation. |
| 9 | */ | 8 | */ |
| 10 | 9 | ||
| 11 | #ifndef __S3C64XX_PLAT_SPI_H | 10 | #ifndef __SPI_S3C64XX_H |
| 12 | #define __S3C64XX_PLAT_SPI_H | 11 | #define __SPI_S3C64XX_H |
| 13 | 12 | ||
| 14 | #include <linux/dmaengine.h> | 13 | #include <linux/dmaengine.h> |
| 15 | 14 | ||
| @@ -68,4 +67,4 @@ extern int s3c64xx_spi2_cfg_gpio(void); | |||
| 68 | extern struct s3c64xx_spi_info s3c64xx_spi0_pdata; | 67 | extern struct s3c64xx_spi_info s3c64xx_spi0_pdata; |
| 69 | extern struct s3c64xx_spi_info s3c64xx_spi1_pdata; | 68 | extern struct s3c64xx_spi_info s3c64xx_spi1_pdata; |
| 70 | extern struct s3c64xx_spi_info s3c64xx_spi2_pdata; | 69 | extern struct s3c64xx_spi_info s3c64xx_spi2_pdata; |
| 71 | #endif /* __S3C64XX_PLAT_SPI_H */ | 70 | #endif /*__SPI_S3C64XX_H */ |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 8c6583a53a06..d915d0345fa1 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
| @@ -264,9 +264,9 @@ typedef struct pm_message { | |||
| 264 | * registers, so that it is fully operational. | 264 | * registers, so that it is fully operational. |
| 265 | * | 265 | * |
| 266 | * @runtime_idle: Device appears to be inactive and it might be put into a | 266 | * @runtime_idle: Device appears to be inactive and it might be put into a |
| 267 | * low-power state if all of the necessary conditions are satisfied. Check | 267 | * low-power state if all of the necessary conditions are satisfied. |
| 268 | * these conditions and handle the device as appropriate, possibly queueing | 268 | * Check these conditions, and return 0 if it's appropriate to let the PM |
| 269 | * a suspend request for it. The return value is ignored by the PM core. | 269 | * core queue a suspend request for the device. |
| 270 | * | 270 | * |
| 271 | * Refer to Documentation/power/runtime_pm.txt for more information about the | 271 | * Refer to Documentation/power/runtime_pm.txt for more information about the |
| 272 | * role of the above callbacks in device runtime power management. | 272 | * role of the above callbacks in device runtime power management. |
| @@ -352,7 +352,7 @@ const struct dev_pm_ops name = { \ | |||
| 352 | 352 | ||
| 353 | /* | 353 | /* |
| 354 | * Use this for defining a set of PM operations to be used in all situations | 354 | * Use this for defining a set of PM operations to be used in all situations |
| 355 | * (sustem suspend, hibernation or runtime PM). | 355 | * (system suspend, hibernation or runtime PM). |
| 356 | * NOTE: In general, system suspend callbacks, .suspend() and .resume(), should | 356 | * NOTE: In general, system suspend callbacks, .suspend() and .resume(), should |
| 357 | * be different from the corresponding runtime PM callbacks, .runtime_suspend(), | 357 | * be different from the corresponding runtime PM callbacks, .runtime_suspend(), |
| 358 | * and .runtime_resume(), because .runtime_suspend() always works on an already | 358 | * and .runtime_resume(), because .runtime_suspend() always works on an already |
| @@ -379,7 +379,7 @@ const struct dev_pm_ops name = { \ | |||
| 379 | * | 379 | * |
| 380 | * ON No transition. | 380 | * ON No transition. |
| 381 | * | 381 | * |
| 382 | * FREEZE System is going to hibernate, call ->prepare() and ->freeze() | 382 | * FREEZE System is going to hibernate, call ->prepare() and ->freeze() |
| 383 | * for all devices. | 383 | * for all devices. |
| 384 | * | 384 | * |
| 385 | * SUSPEND System is going to suspend, call ->prepare() and ->suspend() | 385 | * SUSPEND System is going to suspend, call ->prepare() and ->suspend() |
| @@ -423,7 +423,7 @@ const struct dev_pm_ops name = { \ | |||
| 423 | 423 | ||
| 424 | #define PM_EVENT_INVALID (-1) | 424 | #define PM_EVENT_INVALID (-1) |
| 425 | #define PM_EVENT_ON 0x0000 | 425 | #define PM_EVENT_ON 0x0000 |
| 426 | #define PM_EVENT_FREEZE 0x0001 | 426 | #define PM_EVENT_FREEZE 0x0001 |
| 427 | #define PM_EVENT_SUSPEND 0x0002 | 427 | #define PM_EVENT_SUSPEND 0x0002 |
| 428 | #define PM_EVENT_HIBERNATE 0x0004 | 428 | #define PM_EVENT_HIBERNATE 0x0004 |
| 429 | #define PM_EVENT_QUIESCE 0x0008 | 429 | #define PM_EVENT_QUIESCE 0x0008 |
| @@ -542,6 +542,8 @@ struct dev_pm_info { | |||
| 542 | unsigned int async_suspend:1; | 542 | unsigned int async_suspend:1; |
| 543 | bool is_prepared:1; /* Owned by the PM core */ | 543 | bool is_prepared:1; /* Owned by the PM core */ |
| 544 | bool is_suspended:1; /* Ditto */ | 544 | bool is_suspended:1; /* Ditto */ |
| 545 | bool is_noirq_suspended:1; | ||
| 546 | bool is_late_suspended:1; | ||
| 545 | bool ignore_children:1; | 547 | bool ignore_children:1; |
| 546 | bool early_init:1; /* Owned by the PM core */ | 548 | bool early_init:1; /* Owned by the PM core */ |
| 547 | spinlock_t lock; | 549 | spinlock_t lock; |
| @@ -582,6 +584,7 @@ struct dev_pm_info { | |||
| 582 | unsigned long accounting_timestamp; | 584 | unsigned long accounting_timestamp; |
| 583 | #endif | 585 | #endif |
| 584 | struct pm_subsys_data *subsys_data; /* Owned by the subsystem. */ | 586 | struct pm_subsys_data *subsys_data; /* Owned by the subsystem. */ |
| 587 | void (*set_latency_tolerance)(struct device *, s32); | ||
| 585 | struct dev_pm_qos *qos; | 588 | struct dev_pm_qos *qos; |
| 586 | }; | 589 | }; |
| 587 | 590 | ||
| @@ -612,11 +615,11 @@ struct dev_pm_domain { | |||
| 612 | * message is implicit: | 615 | * message is implicit: |
| 613 | * | 616 | * |
| 614 | * ON Driver starts working again, responding to hardware events | 617 | * ON Driver starts working again, responding to hardware events |
| 615 | * and software requests. The hardware may have gone through | 618 | * and software requests. The hardware may have gone through |
| 616 | * a power-off reset, or it may have maintained state from the | 619 | * a power-off reset, or it may have maintained state from the |
| 617 | * previous suspend() which the driver will rely on while | 620 | * previous suspend() which the driver will rely on while |
| 618 | * resuming. On most platforms, there are no restrictions on | 621 | * resuming. On most platforms, there are no restrictions on |
| 619 | * availability of resources like clocks during resume(). | 622 | * availability of resources like clocks during resume(). |
| 620 | * | 623 | * |
| 621 | * Other transitions are triggered by messages sent using suspend(). All | 624 | * Other transitions are triggered by messages sent using suspend(). All |
| 622 | * these transitions quiesce the driver, so that I/O queues are inactive. | 625 | * these transitions quiesce the driver, so that I/O queues are inactive. |
| @@ -626,21 +629,21 @@ struct dev_pm_domain { | |||
| 626 | * differ according to the message: | 629 | * differ according to the message: |
| 627 | * | 630 | * |
| 628 | * SUSPEND Quiesce, enter a low power device state appropriate for | 631 | * SUSPEND Quiesce, enter a low power device state appropriate for |
| 629 | * the upcoming system state (such as PCI_D3hot), and enable | 632 | * the upcoming system state (such as PCI_D3hot), and enable |
| 630 | * wakeup events as appropriate. | 633 | * wakeup events as appropriate. |
| 631 | * | 634 | * |
| 632 | * HIBERNATE Enter a low power device state appropriate for the hibernation | 635 | * HIBERNATE Enter a low power device state appropriate for the hibernation |
| 633 | * state (eg. ACPI S4) and enable wakeup events as appropriate. | 636 | * state (eg. ACPI S4) and enable wakeup events as appropriate. |
| 634 | * | 637 | * |
| 635 | * FREEZE Quiesce operations so that a consistent image can be saved; | 638 | * FREEZE Quiesce operations so that a consistent image can be saved; |
| 636 | * but do NOT otherwise enter a low power device state, and do | 639 | * but do NOT otherwise enter a low power device state, and do |
| 637 | * NOT emit system wakeup events. | 640 | * NOT emit system wakeup events. |
| 638 | * | 641 | * |
| 639 | * PRETHAW Quiesce as if for FREEZE; additionally, prepare for restoring | 642 | * PRETHAW Quiesce as if for FREEZE; additionally, prepare for restoring |
| 640 | * the system from a snapshot taken after an earlier FREEZE. | 643 | * the system from a snapshot taken after an earlier FREEZE. |
| 641 | * Some drivers will need to reset their hardware state instead | 644 | * Some drivers will need to reset their hardware state instead |
| 642 | * of preserving it, to ensure that it's never mistaken for the | 645 | * of preserving it, to ensure that it's never mistaken for the |
| 643 | * state which that earlier snapshot had set up. | 646 | * state which that earlier snapshot had set up. |
| 644 | * | 647 | * |
| 645 | * A minimally power-aware driver treats all messages as SUSPEND, fully | 648 | * A minimally power-aware driver treats all messages as SUSPEND, fully |
| 646 | * reinitializes its device during resume() -- whether or not it was reset | 649 | * reinitializes its device during resume() -- whether or not it was reset |
| @@ -717,14 +720,26 @@ static inline void dpm_for_each_dev(void *data, void (*fn)(struct device *, void | |||
| 717 | { | 720 | { |
| 718 | } | 721 | } |
| 719 | 722 | ||
| 720 | #define pm_generic_prepare NULL | 723 | #define pm_generic_prepare NULL |
| 721 | #define pm_generic_suspend NULL | 724 | #define pm_generic_suspend_late NULL |
| 722 | #define pm_generic_resume NULL | 725 | #define pm_generic_suspend_noirq NULL |
| 723 | #define pm_generic_freeze NULL | 726 | #define pm_generic_suspend NULL |
| 724 | #define pm_generic_thaw NULL | 727 | #define pm_generic_resume_early NULL |
| 725 | #define pm_generic_restore NULL | 728 | #define pm_generic_resume_noirq NULL |
| 726 | #define pm_generic_poweroff NULL | 729 | #define pm_generic_resume NULL |
| 727 | #define pm_generic_complete NULL | 730 | #define pm_generic_freeze_noirq NULL |
| 731 | #define pm_generic_freeze_late NULL | ||
| 732 | #define pm_generic_freeze NULL | ||
| 733 | #define pm_generic_thaw_noirq NULL | ||
| 734 | #define pm_generic_thaw_early NULL | ||
| 735 | #define pm_generic_thaw NULL | ||
| 736 | #define pm_generic_restore_noirq NULL | ||
| 737 | #define pm_generic_restore_early NULL | ||
| 738 | #define pm_generic_restore NULL | ||
| 739 | #define pm_generic_poweroff_noirq NULL | ||
| 740 | #define pm_generic_poweroff_late NULL | ||
| 741 | #define pm_generic_poweroff NULL | ||
| 742 | #define pm_generic_complete NULL | ||
| 728 | #endif /* !CONFIG_PM_SLEEP */ | 743 | #endif /* !CONFIG_PM_SLEEP */ |
| 729 | 744 | ||
| 730 | /* How to reorder dpm_list after device_move() */ | 745 | /* How to reorder dpm_list after device_move() */ |
diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h index 5a95013905c8..9ab4bf7c4646 100644 --- a/include/linux/pm_qos.h +++ b/include/linux/pm_qos.h | |||
| @@ -32,7 +32,10 @@ enum pm_qos_flags_status { | |||
| 32 | #define PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC) | 32 | #define PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC) |
| 33 | #define PM_QOS_NETWORK_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC) | 33 | #define PM_QOS_NETWORK_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC) |
| 34 | #define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE 0 | 34 | #define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE 0 |
| 35 | #define PM_QOS_DEV_LAT_DEFAULT_VALUE 0 | 35 | #define PM_QOS_RESUME_LATENCY_DEFAULT_VALUE 0 |
| 36 | #define PM_QOS_LATENCY_TOLERANCE_DEFAULT_VALUE 0 | ||
| 37 | #define PM_QOS_LATENCY_TOLERANCE_NO_CONSTRAINT (-1) | ||
| 38 | #define PM_QOS_LATENCY_ANY ((s32)(~(__u32)0 >> 1)) | ||
| 36 | 39 | ||
| 37 | #define PM_QOS_FLAG_NO_POWER_OFF (1 << 0) | 40 | #define PM_QOS_FLAG_NO_POWER_OFF (1 << 0) |
| 38 | #define PM_QOS_FLAG_REMOTE_WAKEUP (1 << 1) | 41 | #define PM_QOS_FLAG_REMOTE_WAKEUP (1 << 1) |
| @@ -49,7 +52,8 @@ struct pm_qos_flags_request { | |||
| 49 | }; | 52 | }; |
| 50 | 53 | ||
| 51 | enum dev_pm_qos_req_type { | 54 | enum dev_pm_qos_req_type { |
| 52 | DEV_PM_QOS_LATENCY = 1, | 55 | DEV_PM_QOS_RESUME_LATENCY = 1, |
| 56 | DEV_PM_QOS_LATENCY_TOLERANCE, | ||
| 53 | DEV_PM_QOS_FLAGS, | 57 | DEV_PM_QOS_FLAGS, |
| 54 | }; | 58 | }; |
| 55 | 59 | ||
| @@ -77,6 +81,7 @@ struct pm_qos_constraints { | |||
| 77 | struct plist_head list; | 81 | struct plist_head list; |
| 78 | s32 target_value; /* Do not change to 64 bit */ | 82 | s32 target_value; /* Do not change to 64 bit */ |
| 79 | s32 default_value; | 83 | s32 default_value; |
| 84 | s32 no_constraint_value; | ||
| 80 | enum pm_qos_type type; | 85 | enum pm_qos_type type; |
| 81 | struct blocking_notifier_head *notifiers; | 86 | struct blocking_notifier_head *notifiers; |
| 82 | }; | 87 | }; |
| @@ -87,9 +92,11 @@ struct pm_qos_flags { | |||
| 87 | }; | 92 | }; |
| 88 | 93 | ||
| 89 | struct dev_pm_qos { | 94 | struct dev_pm_qos { |
| 90 | struct pm_qos_constraints latency; | 95 | struct pm_qos_constraints resume_latency; |
| 96 | struct pm_qos_constraints latency_tolerance; | ||
| 91 | struct pm_qos_flags flags; | 97 | struct pm_qos_flags flags; |
| 92 | struct dev_pm_qos_request *latency_req; | 98 | struct dev_pm_qos_request *resume_latency_req; |
| 99 | struct dev_pm_qos_request *latency_tolerance_req; | ||
| 93 | struct dev_pm_qos_request *flags_req; | 100 | struct dev_pm_qos_request *flags_req; |
| 94 | }; | 101 | }; |
| 95 | 102 | ||
| @@ -142,7 +149,8 @@ int dev_pm_qos_remove_global_notifier(struct notifier_block *notifier); | |||
| 142 | void dev_pm_qos_constraints_init(struct device *dev); | 149 | void dev_pm_qos_constraints_init(struct device *dev); |
| 143 | void dev_pm_qos_constraints_destroy(struct device *dev); | 150 | void dev_pm_qos_constraints_destroy(struct device *dev); |
| 144 | int dev_pm_qos_add_ancestor_request(struct device *dev, | 151 | int dev_pm_qos_add_ancestor_request(struct device *dev, |
| 145 | struct dev_pm_qos_request *req, s32 value); | 152 | struct dev_pm_qos_request *req, |
| 153 | enum dev_pm_qos_req_type type, s32 value); | ||
| 146 | #else | 154 | #else |
| 147 | static inline enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev, | 155 | static inline enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev, |
| 148 | s32 mask) | 156 | s32 mask) |
| @@ -185,7 +193,9 @@ static inline void dev_pm_qos_constraints_destroy(struct device *dev) | |||
| 185 | dev->power.power_state = PMSG_INVALID; | 193 | dev->power.power_state = PMSG_INVALID; |
| 186 | } | 194 | } |
| 187 | static inline int dev_pm_qos_add_ancestor_request(struct device *dev, | 195 | static inline int dev_pm_qos_add_ancestor_request(struct device *dev, |
| 188 | struct dev_pm_qos_request *req, s32 value) | 196 | struct dev_pm_qos_request *req, |
| 197 | enum dev_pm_qos_req_type type, | ||
| 198 | s32 value) | ||
| 189 | { return 0; } | 199 | { return 0; } |
| 190 | #endif | 200 | #endif |
| 191 | 201 | ||
| @@ -195,10 +205,12 @@ void dev_pm_qos_hide_latency_limit(struct device *dev); | |||
| 195 | int dev_pm_qos_expose_flags(struct device *dev, s32 value); | 205 | int dev_pm_qos_expose_flags(struct device *dev, s32 value); |
| 196 | void dev_pm_qos_hide_flags(struct device *dev); | 206 | void dev_pm_qos_hide_flags(struct device *dev); |
| 197 | int dev_pm_qos_update_flags(struct device *dev, s32 mask, bool set); | 207 | int dev_pm_qos_update_flags(struct device *dev, s32 mask, bool set); |
| 208 | s32 dev_pm_qos_get_user_latency_tolerance(struct device *dev); | ||
| 209 | int dev_pm_qos_update_user_latency_tolerance(struct device *dev, s32 val); | ||
| 198 | 210 | ||
| 199 | static inline s32 dev_pm_qos_requested_latency(struct device *dev) | 211 | static inline s32 dev_pm_qos_requested_resume_latency(struct device *dev) |
| 200 | { | 212 | { |
| 201 | return dev->power.qos->latency_req->data.pnode.prio; | 213 | return dev->power.qos->resume_latency_req->data.pnode.prio; |
| 202 | } | 214 | } |
| 203 | 215 | ||
| 204 | static inline s32 dev_pm_qos_requested_flags(struct device *dev) | 216 | static inline s32 dev_pm_qos_requested_flags(struct device *dev) |
| @@ -214,8 +226,12 @@ static inline int dev_pm_qos_expose_flags(struct device *dev, s32 value) | |||
| 214 | static inline void dev_pm_qos_hide_flags(struct device *dev) {} | 226 | static inline void dev_pm_qos_hide_flags(struct device *dev) {} |
| 215 | static inline int dev_pm_qos_update_flags(struct device *dev, s32 m, bool set) | 227 | static inline int dev_pm_qos_update_flags(struct device *dev, s32 m, bool set) |
| 216 | { return 0; } | 228 | { return 0; } |
| 229 | static inline s32 dev_pm_qos_get_user_latency_tolerance(struct device *dev) | ||
| 230 | { return PM_QOS_LATENCY_TOLERANCE_NO_CONSTRAINT; } | ||
| 231 | static inline int dev_pm_qos_update_user_latency_tolerance(struct device *dev, s32 val) | ||
| 232 | { return 0; } | ||
| 217 | 233 | ||
| 218 | static inline s32 dev_pm_qos_requested_latency(struct device *dev) { return 0; } | 234 | static inline s32 dev_pm_qos_requested_resume_latency(struct device *dev) { return 0; } |
| 219 | static inline s32 dev_pm_qos_requested_flags(struct device *dev) { return 0; } | 235 | static inline s32 dev_pm_qos_requested_flags(struct device *dev) { return 0; } |
| 220 | #endif | 236 | #endif |
| 221 | 237 | ||
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 16c9a62fa1c0..2a5897a4afbc 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
| @@ -26,9 +26,13 @@ | |||
| 26 | #ifdef CONFIG_PM | 26 | #ifdef CONFIG_PM |
| 27 | extern int pm_generic_runtime_suspend(struct device *dev); | 27 | extern int pm_generic_runtime_suspend(struct device *dev); |
| 28 | extern int pm_generic_runtime_resume(struct device *dev); | 28 | extern int pm_generic_runtime_resume(struct device *dev); |
| 29 | extern int pm_runtime_force_suspend(struct device *dev); | ||
| 30 | extern int pm_runtime_force_resume(struct device *dev); | ||
| 29 | #else | 31 | #else |
| 30 | static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } | 32 | static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } |
| 31 | static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } | 33 | static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } |
| 34 | static inline int pm_runtime_force_suspend(struct device *dev) { return 0; } | ||
| 35 | static inline int pm_runtime_force_resume(struct device *dev) { return 0; } | ||
| 32 | #endif | 36 | #endif |
| 33 | 37 | ||
| 34 | #ifdef CONFIG_PM_RUNTIME | 38 | #ifdef CONFIG_PM_RUNTIME |
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index dbaf99084112..8183b46fbaa2 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
| @@ -247,9 +247,10 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
| 247 | * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). | 247 | * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). |
| 248 | */ | 248 | */ |
| 249 | #define list_entry_rcu(ptr, type, member) \ | 249 | #define list_entry_rcu(ptr, type, member) \ |
| 250 | ({typeof (*ptr) __rcu *__ptr = (typeof (*ptr) __rcu __force *)ptr; \ | 250 | ({ \ |
| 251 | container_of((typeof(ptr))rcu_dereference_raw(__ptr), type, member); \ | 251 | typeof(*ptr) __rcu *__ptr = (typeof(*ptr) __rcu __force *)ptr; \ |
| 252 | }) | 252 | container_of((typeof(ptr))rcu_dereference_raw(__ptr), type, member); \ |
| 253 | }) | ||
| 253 | 254 | ||
| 254 | /** | 255 | /** |
| 255 | * Where are list_empty_rcu() and list_first_entry_rcu()? | 256 | * Where are list_empty_rcu() and list_first_entry_rcu()? |
| @@ -285,11 +286,11 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
| 285 | * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). | 286 | * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). |
| 286 | */ | 287 | */ |
| 287 | #define list_first_or_null_rcu(ptr, type, member) \ | 288 | #define list_first_or_null_rcu(ptr, type, member) \ |
| 288 | ({struct list_head *__ptr = (ptr); \ | 289 | ({ \ |
| 289 | struct list_head *__next = ACCESS_ONCE(__ptr->next); \ | 290 | struct list_head *__ptr = (ptr); \ |
| 290 | likely(__ptr != __next) ? \ | 291 | struct list_head *__next = ACCESS_ONCE(__ptr->next); \ |
| 291 | list_entry_rcu(__next, type, member) : NULL; \ | 292 | likely(__ptr != __next) ? list_entry_rcu(__next, type, member) : NULL; \ |
| 292 | }) | 293 | }) |
| 293 | 294 | ||
| 294 | /** | 295 | /** |
| 295 | * list_for_each_entry_rcu - iterate over rcu list of given type | 296 | * list_for_each_entry_rcu - iterate over rcu list of given type |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 72bf3a01a4ee..00a7fd61b3c6 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
| @@ -12,8 +12,8 @@ | |||
| 12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. |
| 13 | * | 13 | * |
| 14 | * You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software | 15 | * along with this program; if not, you can access it online at |
| 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 16 | * http://www.gnu.org/licenses/gpl-2.0.html. |
| 17 | * | 17 | * |
| 18 | * Copyright IBM Corporation, 2001 | 18 | * Copyright IBM Corporation, 2001 |
| 19 | * | 19 | * |
| @@ -44,7 +44,9 @@ | |||
| 44 | #include <linux/debugobjects.h> | 44 | #include <linux/debugobjects.h> |
| 45 | #include <linux/bug.h> | 45 | #include <linux/bug.h> |
| 46 | #include <linux/compiler.h> | 46 | #include <linux/compiler.h> |
| 47 | #include <asm/barrier.h> | ||
| 47 | 48 | ||
| 49 | extern int rcu_expedited; /* for sysctl */ | ||
| 48 | #ifdef CONFIG_RCU_TORTURE_TEST | 50 | #ifdef CONFIG_RCU_TORTURE_TEST |
| 49 | extern int rcutorture_runnable; /* for sysctl */ | 51 | extern int rcutorture_runnable; /* for sysctl */ |
| 50 | #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ | 52 | #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ |
| @@ -314,7 +316,7 @@ static inline bool rcu_lockdep_current_cpu_online(void) | |||
| 314 | 316 | ||
| 315 | static inline void rcu_lock_acquire(struct lockdep_map *map) | 317 | static inline void rcu_lock_acquire(struct lockdep_map *map) |
| 316 | { | 318 | { |
| 317 | lock_acquire(map, 0, 0, 2, 1, NULL, _THIS_IP_); | 319 | lock_acquire(map, 0, 0, 2, 0, NULL, _THIS_IP_); |
| 318 | } | 320 | } |
| 319 | 321 | ||
| 320 | static inline void rcu_lock_release(struct lockdep_map *map) | 322 | static inline void rcu_lock_release(struct lockdep_map *map) |
| @@ -479,11 +481,9 @@ static inline void rcu_preempt_sleep_check(void) | |||
| 479 | do { \ | 481 | do { \ |
| 480 | rcu_preempt_sleep_check(); \ | 482 | rcu_preempt_sleep_check(); \ |
| 481 | rcu_lockdep_assert(!lock_is_held(&rcu_bh_lock_map), \ | 483 | rcu_lockdep_assert(!lock_is_held(&rcu_bh_lock_map), \ |
| 482 | "Illegal context switch in RCU-bh" \ | 484 | "Illegal context switch in RCU-bh read-side critical section"); \ |
| 483 | " read-side critical section"); \ | ||
| 484 | rcu_lockdep_assert(!lock_is_held(&rcu_sched_lock_map), \ | 485 | rcu_lockdep_assert(!lock_is_held(&rcu_sched_lock_map), \ |
| 485 | "Illegal context switch in RCU-sched"\ | 486 | "Illegal context switch in RCU-sched read-side critical section"); \ |
| 486 | " read-side critical section"); \ | ||
| 487 | } while (0) | 487 | } while (0) |
| 488 | 488 | ||
| 489 | #else /* #ifdef CONFIG_PROVE_RCU */ | 489 | #else /* #ifdef CONFIG_PROVE_RCU */ |
| @@ -510,43 +510,40 @@ static inline void rcu_preempt_sleep_check(void) | |||
| 510 | #endif /* #else #ifdef __CHECKER__ */ | 510 | #endif /* #else #ifdef __CHECKER__ */ |
| 511 | 511 | ||
| 512 | #define __rcu_access_pointer(p, space) \ | 512 | #define __rcu_access_pointer(p, space) \ |
| 513 | ({ \ | 513 | ({ \ |
| 514 | typeof(*p) *_________p1 = (typeof(*p)*__force )ACCESS_ONCE(p); \ | 514 | typeof(*p) *_________p1 = (typeof(*p) *__force)ACCESS_ONCE(p); \ |
| 515 | rcu_dereference_sparse(p, space); \ | 515 | rcu_dereference_sparse(p, space); \ |
| 516 | ((typeof(*p) __force __kernel *)(_________p1)); \ | 516 | ((typeof(*p) __force __kernel *)(_________p1)); \ |
| 517 | }) | 517 | }) |
| 518 | #define __rcu_dereference_check(p, c, space) \ | 518 | #define __rcu_dereference_check(p, c, space) \ |
| 519 | ({ \ | 519 | ({ \ |
| 520 | typeof(*p) *_________p1 = (typeof(*p)*__force )ACCESS_ONCE(p); \ | 520 | typeof(*p) *_________p1 = (typeof(*p) *__force)ACCESS_ONCE(p); \ |
| 521 | rcu_lockdep_assert(c, "suspicious rcu_dereference_check()" \ | 521 | rcu_lockdep_assert(c, "suspicious rcu_dereference_check() usage"); \ |
| 522 | " usage"); \ | 522 | rcu_dereference_sparse(p, space); \ |
| 523 | rcu_dereference_sparse(p, space); \ | 523 | smp_read_barrier_depends(); /* Dependency order vs. p above. */ \ |
| 524 | smp_read_barrier_depends(); \ | 524 | ((typeof(*p) __force __kernel *)(_________p1)); \ |
| 525 | ((typeof(*p) __force __kernel *)(_________p1)); \ | 525 | }) |
| 526 | }) | ||
| 527 | #define __rcu_dereference_protected(p, c, space) \ | 526 | #define __rcu_dereference_protected(p, c, space) \ |
| 528 | ({ \ | 527 | ({ \ |
| 529 | rcu_lockdep_assert(c, "suspicious rcu_dereference_protected()" \ | 528 | rcu_lockdep_assert(c, "suspicious rcu_dereference_protected() usage"); \ |
| 530 | " usage"); \ | 529 | rcu_dereference_sparse(p, space); \ |
| 531 | rcu_dereference_sparse(p, space); \ | 530 | ((typeof(*p) __force __kernel *)(p)); \ |
| 532 | ((typeof(*p) __force __kernel *)(p)); \ | 531 | }) |
| 533 | }) | ||
| 534 | 532 | ||
| 535 | #define __rcu_access_index(p, space) \ | 533 | #define __rcu_access_index(p, space) \ |
| 536 | ({ \ | 534 | ({ \ |
| 537 | typeof(p) _________p1 = ACCESS_ONCE(p); \ | 535 | typeof(p) _________p1 = ACCESS_ONCE(p); \ |
| 538 | rcu_dereference_sparse(p, space); \ | 536 | rcu_dereference_sparse(p, space); \ |
| 539 | (_________p1); \ | 537 | (_________p1); \ |
| 540 | }) | 538 | }) |
| 541 | #define __rcu_dereference_index_check(p, c) \ | 539 | #define __rcu_dereference_index_check(p, c) \ |
| 542 | ({ \ | 540 | ({ \ |
| 543 | typeof(p) _________p1 = ACCESS_ONCE(p); \ | 541 | typeof(p) _________p1 = ACCESS_ONCE(p); \ |
| 544 | rcu_lockdep_assert(c, \ | 542 | rcu_lockdep_assert(c, \ |
| 545 | "suspicious rcu_dereference_index_check()" \ | 543 | "suspicious rcu_dereference_index_check() usage"); \ |
| 546 | " usage"); \ | 544 | smp_read_barrier_depends(); /* Dependency order vs. p above. */ \ |
| 547 | smp_read_barrier_depends(); \ | 545 | (_________p1); \ |
| 548 | (_________p1); \ | 546 | }) |
| 549 | }) | ||
| 550 | 547 | ||
| 551 | /** | 548 | /** |
| 552 | * RCU_INITIALIZER() - statically initialize an RCU-protected global variable | 549 | * RCU_INITIALIZER() - statically initialize an RCU-protected global variable |
| @@ -585,12 +582,7 @@ static inline void rcu_preempt_sleep_check(void) | |||
| 585 | * please be careful when making changes to rcu_assign_pointer() and the | 582 | * please be careful when making changes to rcu_assign_pointer() and the |
| 586 | * other macros that it invokes. | 583 | * other macros that it invokes. |
| 587 | */ | 584 | */ |
| 588 | #define rcu_assign_pointer(p, v) \ | 585 | #define rcu_assign_pointer(p, v) smp_store_release(&p, RCU_INITIALIZER(v)) |
| 589 | do { \ | ||
| 590 | smp_wmb(); \ | ||
| 591 | ACCESS_ONCE(p) = RCU_INITIALIZER(v); \ | ||
| 592 | } while (0) | ||
| 593 | |||
| 594 | 586 | ||
| 595 | /** | 587 | /** |
| 596 | * rcu_access_pointer() - fetch RCU pointer with no dereferencing | 588 | * rcu_access_pointer() - fetch RCU pointer with no dereferencing |
| @@ -1015,11 +1007,21 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) | |||
| 1015 | #define kfree_rcu(ptr, rcu_head) \ | 1007 | #define kfree_rcu(ptr, rcu_head) \ |
| 1016 | __kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head)) | 1008 | __kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head)) |
| 1017 | 1009 | ||
| 1018 | #ifdef CONFIG_RCU_NOCB_CPU | 1010 | #if defined(CONFIG_TINY_RCU) || defined(CONFIG_RCU_NOCB_CPU_ALL) |
| 1011 | static inline int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies) | ||
| 1012 | { | ||
| 1013 | *delta_jiffies = ULONG_MAX; | ||
| 1014 | return 0; | ||
| 1015 | } | ||
| 1016 | #endif /* #if defined(CONFIG_TINY_RCU) || defined(CONFIG_RCU_NOCB_CPU_ALL) */ | ||
| 1017 | |||
| 1018 | #if defined(CONFIG_RCU_NOCB_CPU_ALL) | ||
| 1019 | static inline bool rcu_is_nocb_cpu(int cpu) { return true; } | ||
| 1020 | #elif defined(CONFIG_RCU_NOCB_CPU) | ||
| 1019 | bool rcu_is_nocb_cpu(int cpu); | 1021 | bool rcu_is_nocb_cpu(int cpu); |
| 1020 | #else | 1022 | #else |
| 1021 | static inline bool rcu_is_nocb_cpu(int cpu) { return false; } | 1023 | static inline bool rcu_is_nocb_cpu(int cpu) { return false; } |
| 1022 | #endif /* #else #ifdef CONFIG_RCU_NOCB_CPU */ | 1024 | #endif |
| 1023 | 1025 | ||
| 1024 | 1026 | ||
| 1025 | /* Only for use by adaptive-ticks code. */ | 1027 | /* Only for use by adaptive-ticks code. */ |
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index 6f01771b571c..425c659d54e5 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h | |||
| @@ -12,8 +12,8 @@ | |||
| 12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. |
| 13 | * | 13 | * |
| 14 | * You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software | 15 | * along with this program; if not, you can access it online at |
| 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 16 | * http://www.gnu.org/licenses/gpl-2.0.html. |
| 17 | * | 17 | * |
| 18 | * Copyright IBM Corporation, 2008 | 18 | * Copyright IBM Corporation, 2008 |
| 19 | * | 19 | * |
| @@ -27,6 +27,16 @@ | |||
| 27 | 27 | ||
| 28 | #include <linux/cache.h> | 28 | #include <linux/cache.h> |
| 29 | 29 | ||
| 30 | static inline unsigned long get_state_synchronize_rcu(void) | ||
| 31 | { | ||
| 32 | return 0; | ||
| 33 | } | ||
| 34 | |||
| 35 | static inline void cond_synchronize_rcu(unsigned long oldstate) | ||
| 36 | { | ||
| 37 | might_sleep(); | ||
| 38 | } | ||
| 39 | |||
| 30 | static inline void rcu_barrier_bh(void) | 40 | static inline void rcu_barrier_bh(void) |
| 31 | { | 41 | { |
| 32 | wait_rcu_gp(call_rcu_bh); | 42 | wait_rcu_gp(call_rcu_bh); |
| @@ -68,12 +78,6 @@ static inline void kfree_call_rcu(struct rcu_head *head, | |||
| 68 | call_rcu(head, func); | 78 | call_rcu(head, func); |
| 69 | } | 79 | } |
| 70 | 80 | ||
| 71 | static inline int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies) | ||
| 72 | { | ||
| 73 | *delta_jiffies = ULONG_MAX; | ||
| 74 | return 0; | ||
| 75 | } | ||
| 76 | |||
| 77 | static inline void rcu_note_context_switch(int cpu) | 81 | static inline void rcu_note_context_switch(int cpu) |
| 78 | { | 82 | { |
| 79 | rcu_sched_qs(cpu); | 83 | rcu_sched_qs(cpu); |
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 72137ee8c603..a59ca05fd4e3 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
| @@ -12,8 +12,8 @@ | |||
| 12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. |
| 13 | * | 13 | * |
| 14 | * You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software | 15 | * along with this program; if not, you can access it online at |
| 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 16 | * http://www.gnu.org/licenses/gpl-2.0.html. |
| 17 | * | 17 | * |
| 18 | * Copyright IBM Corporation, 2008 | 18 | * Copyright IBM Corporation, 2008 |
| 19 | * | 19 | * |
| @@ -31,7 +31,9 @@ | |||
| 31 | #define __LINUX_RCUTREE_H | 31 | #define __LINUX_RCUTREE_H |
| 32 | 32 | ||
| 33 | void rcu_note_context_switch(int cpu); | 33 | void rcu_note_context_switch(int cpu); |
| 34 | #ifndef CONFIG_RCU_NOCB_CPU_ALL | ||
| 34 | int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies); | 35 | int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies); |
| 36 | #endif /* #ifndef CONFIG_RCU_NOCB_CPU_ALL */ | ||
| 35 | void rcu_cpu_stall_reset(void); | 37 | void rcu_cpu_stall_reset(void); |
| 36 | 38 | ||
| 37 | /* | 39 | /* |
| @@ -74,6 +76,8 @@ static inline void synchronize_rcu_bh_expedited(void) | |||
| 74 | void rcu_barrier(void); | 76 | void rcu_barrier(void); |
| 75 | void rcu_barrier_bh(void); | 77 | void rcu_barrier_bh(void); |
| 76 | void rcu_barrier_sched(void); | 78 | void rcu_barrier_sched(void); |
| 79 | unsigned long get_state_synchronize_rcu(void); | ||
| 80 | void cond_synchronize_rcu(unsigned long oldstate); | ||
| 77 | 81 | ||
| 78 | extern unsigned long rcutorture_testseq; | 82 | extern unsigned long rcutorture_testseq; |
| 79 | extern unsigned long rcutorture_vernum; | 83 | extern unsigned long rcutorture_vernum; |
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index 4149f1a9b003..85691b9b4fa7 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h | |||
| @@ -164,6 +164,9 @@ typedef void (*regmap_unlock)(void *); | |||
| 164 | * @use_single_rw: If set, converts the bulk read and write operations into | 164 | * @use_single_rw: If set, converts the bulk read and write operations into |
| 165 | * a series of single read and write operations. This is useful | 165 | * a series of single read and write operations. This is useful |
| 166 | * for device that does not support bulk read and write. | 166 | * for device that does not support bulk read and write. |
| 167 | * @can_multi_write: If set, the device supports the multi write mode of bulk | ||
| 168 | * write operations, if clear multi write requests will be | ||
| 169 | * split into individual write operations | ||
| 167 | * | 170 | * |
| 168 | * @cache_type: The actual cache type. | 171 | * @cache_type: The actual cache type. |
| 169 | * @reg_defaults_raw: Power on reset values for registers (for use with | 172 | * @reg_defaults_raw: Power on reset values for registers (for use with |
| @@ -215,6 +218,7 @@ struct regmap_config { | |||
| 215 | u8 write_flag_mask; | 218 | u8 write_flag_mask; |
| 216 | 219 | ||
| 217 | bool use_single_rw; | 220 | bool use_single_rw; |
| 221 | bool can_multi_write; | ||
| 218 | 222 | ||
| 219 | enum regmap_endian reg_format_endian; | 223 | enum regmap_endian reg_format_endian; |
| 220 | enum regmap_endian val_format_endian; | 224 | enum regmap_endian val_format_endian; |
| @@ -317,12 +321,16 @@ struct regmap *regmap_init(struct device *dev, | |||
| 317 | const struct regmap_bus *bus, | 321 | const struct regmap_bus *bus, |
| 318 | void *bus_context, | 322 | void *bus_context, |
| 319 | const struct regmap_config *config); | 323 | const struct regmap_config *config); |
| 324 | int regmap_attach_dev(struct device *dev, struct regmap *map, | ||
| 325 | const struct regmap_config *config); | ||
| 320 | struct regmap *regmap_init_i2c(struct i2c_client *i2c, | 326 | struct regmap *regmap_init_i2c(struct i2c_client *i2c, |
| 321 | const struct regmap_config *config); | 327 | const struct regmap_config *config); |
| 322 | struct regmap *regmap_init_spi(struct spi_device *dev, | 328 | struct regmap *regmap_init_spi(struct spi_device *dev, |
| 323 | const struct regmap_config *config); | 329 | const struct regmap_config *config); |
| 324 | struct regmap *regmap_init_spmi(struct spmi_device *dev, | 330 | struct regmap *regmap_init_spmi_base(struct spmi_device *dev, |
| 325 | const struct regmap_config *config); | 331 | const struct regmap_config *config); |
| 332 | struct regmap *regmap_init_spmi_ext(struct spmi_device *dev, | ||
| 333 | const struct regmap_config *config); | ||
| 326 | struct regmap *regmap_init_mmio_clk(struct device *dev, const char *clk_id, | 334 | struct regmap *regmap_init_mmio_clk(struct device *dev, const char *clk_id, |
| 327 | void __iomem *regs, | 335 | void __iomem *regs, |
| 328 | const struct regmap_config *config); | 336 | const struct regmap_config *config); |
| @@ -335,8 +343,10 @@ struct regmap *devm_regmap_init_i2c(struct i2c_client *i2c, | |||
| 335 | const struct regmap_config *config); | 343 | const struct regmap_config *config); |
| 336 | struct regmap *devm_regmap_init_spi(struct spi_device *dev, | 344 | struct regmap *devm_regmap_init_spi(struct spi_device *dev, |
| 337 | const struct regmap_config *config); | 345 | const struct regmap_config *config); |
| 338 | struct regmap *devm_regmap_init_spmi(struct spmi_device *dev, | 346 | struct regmap *devm_regmap_init_spmi_base(struct spmi_device *dev, |
| 339 | const struct regmap_config *config); | 347 | const struct regmap_config *config); |
| 348 | struct regmap *devm_regmap_init_spmi_ext(struct spmi_device *dev, | ||
| 349 | const struct regmap_config *config); | ||
| 340 | struct regmap *devm_regmap_init_mmio_clk(struct device *dev, const char *clk_id, | 350 | struct regmap *devm_regmap_init_mmio_clk(struct device *dev, const char *clk_id, |
| 341 | void __iomem *regs, | 351 | void __iomem *regs, |
| 342 | const struct regmap_config *config); | 352 | const struct regmap_config *config); |
| @@ -386,8 +396,11 @@ int regmap_raw_write(struct regmap *map, unsigned int reg, | |||
| 386 | const void *val, size_t val_len); | 396 | const void *val, size_t val_len); |
| 387 | int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val, | 397 | int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val, |
| 388 | size_t val_count); | 398 | size_t val_count); |
| 389 | int regmap_multi_reg_write(struct regmap *map, struct reg_default *regs, | 399 | int regmap_multi_reg_write(struct regmap *map, const struct reg_default *regs, |
| 390 | int num_regs); | 400 | int num_regs); |
| 401 | int regmap_multi_reg_write_bypassed(struct regmap *map, | ||
| 402 | const struct reg_default *regs, | ||
| 403 | int num_regs); | ||
| 391 | int regmap_raw_write_async(struct regmap *map, unsigned int reg, | 404 | int regmap_raw_write_async(struct regmap *map, unsigned int reg, |
| 392 | const void *val, size_t val_len); | 405 | const void *val, size_t val_len); |
| 393 | int regmap_read(struct regmap *map, unsigned int reg, unsigned int *val); | 406 | int regmap_read(struct regmap *map, unsigned int reg, unsigned int *val); |
| @@ -423,6 +436,8 @@ bool regmap_check_range_table(struct regmap *map, unsigned int reg, | |||
| 423 | 436 | ||
| 424 | int regmap_register_patch(struct regmap *map, const struct reg_default *regs, | 437 | int regmap_register_patch(struct regmap *map, const struct reg_default *regs, |
| 425 | int num_regs); | 438 | int num_regs); |
| 439 | int regmap_parse_val(struct regmap *map, const void *buf, | ||
| 440 | unsigned int *val); | ||
| 426 | 441 | ||
| 427 | static inline bool regmap_reg_in_range(unsigned int reg, | 442 | static inline bool regmap_reg_in_range(unsigned int reg, |
| 428 | const struct regmap_range *range) | 443 | const struct regmap_range *range) |
| @@ -695,6 +710,13 @@ static inline int regmap_register_patch(struct regmap *map, | |||
| 695 | return -EINVAL; | 710 | return -EINVAL; |
| 696 | } | 711 | } |
| 697 | 712 | ||
| 713 | static inline int regmap_parse_val(struct regmap *map, const void *buf, | ||
| 714 | unsigned int *val) | ||
| 715 | { | ||
| 716 | WARN_ONCE(1, "regmap API is disabled"); | ||
| 717 | return -EINVAL; | ||
| 718 | } | ||
| 719 | |||
| 698 | static inline struct regmap *dev_get_regmap(struct device *dev, | 720 | static inline struct regmap *dev_get_regmap(struct device *dev, |
| 699 | const char *name) | 721 | const char *name) |
| 700 | { | 722 | { |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index 9370e65348a4..bbe03a1924c0 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
| @@ -228,10 +228,14 @@ enum regulator_type { | |||
| 228 | * output when using regulator_set_voltage_sel_regmap | 228 | * output when using regulator_set_voltage_sel_regmap |
| 229 | * @enable_reg: Register for control when using regmap enable/disable ops | 229 | * @enable_reg: Register for control when using regmap enable/disable ops |
| 230 | * @enable_mask: Mask for control when using regmap enable/disable ops | 230 | * @enable_mask: Mask for control when using regmap enable/disable ops |
| 231 | * @enable_val: Enabling value for control when using regmap enable/disable ops | ||
| 232 | * @disable_val: Disabling value for control when using regmap enable/disable ops | ||
| 231 | * @enable_is_inverted: A flag to indicate set enable_mask bits to disable | 233 | * @enable_is_inverted: A flag to indicate set enable_mask bits to disable |
| 232 | * when using regulator_enable_regmap and friends APIs. | 234 | * when using regulator_enable_regmap and friends APIs. |
| 233 | * @bypass_reg: Register for control when using regmap set_bypass | 235 | * @bypass_reg: Register for control when using regmap set_bypass |
| 234 | * @bypass_mask: Mask for control when using regmap set_bypass | 236 | * @bypass_mask: Mask for control when using regmap set_bypass |
| 237 | * @bypass_val_on: Enabling value for control when using regmap set_bypass | ||
| 238 | * @bypass_val_off: Disabling value for control when using regmap set_bypass | ||
| 235 | * | 239 | * |
| 236 | * @enable_time: Time taken for initial enable of regulator (in uS). | 240 | * @enable_time: Time taken for initial enable of regulator (in uS). |
| 237 | */ | 241 | */ |
| @@ -263,9 +267,13 @@ struct regulator_desc { | |||
| 263 | unsigned int apply_bit; | 267 | unsigned int apply_bit; |
| 264 | unsigned int enable_reg; | 268 | unsigned int enable_reg; |
| 265 | unsigned int enable_mask; | 269 | unsigned int enable_mask; |
| 270 | unsigned int enable_val; | ||
| 271 | unsigned int disable_val; | ||
| 266 | bool enable_is_inverted; | 272 | bool enable_is_inverted; |
| 267 | unsigned int bypass_reg; | 273 | unsigned int bypass_reg; |
| 268 | unsigned int bypass_mask; | 274 | unsigned int bypass_mask; |
| 275 | unsigned int bypass_val_on; | ||
| 276 | unsigned int bypass_val_off; | ||
| 269 | 277 | ||
| 270 | unsigned int enable_time; | 278 | unsigned int enable_time; |
| 271 | }; | 279 | }; |
diff --git a/include/linux/regulator/pfuze100.h b/include/linux/regulator/pfuze100.h index 65d550bf3954..364f7a7c43db 100644 --- a/include/linux/regulator/pfuze100.h +++ b/include/linux/regulator/pfuze100.h | |||
| @@ -35,6 +35,20 @@ | |||
| 35 | #define PFUZE100_VGEN6 14 | 35 | #define PFUZE100_VGEN6 14 |
| 36 | #define PFUZE100_MAX_REGULATOR 15 | 36 | #define PFUZE100_MAX_REGULATOR 15 |
| 37 | 37 | ||
| 38 | #define PFUZE200_SW1AB 0 | ||
| 39 | #define PFUZE200_SW2 1 | ||
| 40 | #define PFUZE200_SW3A 2 | ||
| 41 | #define PFUZE200_SW3B 3 | ||
| 42 | #define PFUZE200_SWBST 4 | ||
| 43 | #define PFUZE200_VSNVS 5 | ||
| 44 | #define PFUZE200_VREFDDR 6 | ||
| 45 | #define PFUZE200_VGEN1 7 | ||
| 46 | #define PFUZE200_VGEN2 8 | ||
| 47 | #define PFUZE200_VGEN3 9 | ||
| 48 | #define PFUZE200_VGEN4 10 | ||
| 49 | #define PFUZE200_VGEN5 11 | ||
| 50 | #define PFUZE200_VGEN6 12 | ||
| 51 | |||
| 38 | struct regulator_init_data; | 52 | struct regulator_init_data; |
| 39 | 53 | ||
| 40 | struct pfuze_regulator_platform_data { | 54 | struct pfuze_regulator_platform_data { |
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 1da693d51255..b66c2110cb1f 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
| @@ -250,8 +250,7 @@ struct rmap_walk_control { | |||
| 250 | int (*rmap_one)(struct page *page, struct vm_area_struct *vma, | 250 | int (*rmap_one)(struct page *page, struct vm_area_struct *vma, |
| 251 | unsigned long addr, void *arg); | 251 | unsigned long addr, void *arg); |
| 252 | int (*done)(struct page *page); | 252 | int (*done)(struct page *page); |
| 253 | int (*file_nonlinear)(struct page *, struct address_space *, | 253 | int (*file_nonlinear)(struct page *, struct address_space *, void *arg); |
| 254 | struct vm_area_struct *vma); | ||
| 255 | struct anon_vma *(*anon_lock)(struct page *page); | 254 | struct anon_vma *(*anon_lock)(struct page *page); |
| 256 | bool (*invalid_vma)(struct vm_area_struct *vma, void *arg); | 255 | bool (*invalid_vma)(struct vm_area_struct *vma, void *arg); |
| 257 | }; | 256 | }; |
diff --git a/include/linux/sched.h b/include/linux/sched.h index a781dec1cd0b..7cb07fd26680 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -3,6 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | #include <uapi/linux/sched.h> | 4 | #include <uapi/linux/sched.h> |
| 5 | 5 | ||
| 6 | #include <linux/sched/prio.h> | ||
| 7 | |||
| 6 | 8 | ||
| 7 | struct sched_param { | 9 | struct sched_param { |
| 8 | int sched_priority; | 10 | int sched_priority; |
| @@ -27,7 +29,7 @@ struct sched_param { | |||
| 27 | 29 | ||
| 28 | #include <asm/page.h> | 30 | #include <asm/page.h> |
| 29 | #include <asm/ptrace.h> | 31 | #include <asm/ptrace.h> |
| 30 | #include <asm/cputime.h> | 32 | #include <linux/cputime.h> |
| 31 | 33 | ||
| 32 | #include <linux/smp.h> | 34 | #include <linux/smp.h> |
| 33 | #include <linux/sem.h> | 35 | #include <linux/sem.h> |
| @@ -292,10 +294,14 @@ extern int runqueue_is_locked(int cpu); | |||
| 292 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON) | 294 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON) |
| 293 | extern void nohz_balance_enter_idle(int cpu); | 295 | extern void nohz_balance_enter_idle(int cpu); |
| 294 | extern void set_cpu_sd_state_idle(void); | 296 | extern void set_cpu_sd_state_idle(void); |
| 295 | extern int get_nohz_timer_target(void); | 297 | extern int get_nohz_timer_target(int pinned); |
| 296 | #else | 298 | #else |
| 297 | static inline void nohz_balance_enter_idle(int cpu) { } | 299 | static inline void nohz_balance_enter_idle(int cpu) { } |
| 298 | static inline void set_cpu_sd_state_idle(void) { } | 300 | static inline void set_cpu_sd_state_idle(void) { } |
| 301 | static inline int get_nohz_timer_target(int pinned) | ||
| 302 | { | ||
| 303 | return smp_processor_id(); | ||
| 304 | } | ||
| 299 | #endif | 305 | #endif |
| 300 | 306 | ||
| 301 | /* | 307 | /* |
| @@ -1077,6 +1083,7 @@ struct sched_entity { | |||
| 1077 | #endif | 1083 | #endif |
| 1078 | 1084 | ||
| 1079 | #ifdef CONFIG_FAIR_GROUP_SCHED | 1085 | #ifdef CONFIG_FAIR_GROUP_SCHED |
| 1086 | int depth; | ||
| 1080 | struct sched_entity *parent; | 1087 | struct sched_entity *parent; |
| 1081 | /* rq on which this entity is (to be) queued: */ | 1088 | /* rq on which this entity is (to be) queued: */ |
| 1082 | struct cfs_rq *cfs_rq; | 1089 | struct cfs_rq *cfs_rq; |
| @@ -1460,6 +1467,9 @@ struct task_struct { | |||
| 1460 | struct mutex perf_event_mutex; | 1467 | struct mutex perf_event_mutex; |
| 1461 | struct list_head perf_event_list; | 1468 | struct list_head perf_event_list; |
| 1462 | #endif | 1469 | #endif |
| 1470 | #ifdef CONFIG_DEBUG_PREEMPT | ||
| 1471 | unsigned long preempt_disable_ip; | ||
| 1472 | #endif | ||
| 1463 | #ifdef CONFIG_NUMA | 1473 | #ifdef CONFIG_NUMA |
| 1464 | struct mempolicy *mempolicy; /* Protected by alloc_lock */ | 1474 | struct mempolicy *mempolicy; /* Protected by alloc_lock */ |
| 1465 | short il_next; | 1475 | short il_next; |
| @@ -1470,9 +1480,10 @@ struct task_struct { | |||
| 1470 | unsigned int numa_scan_period; | 1480 | unsigned int numa_scan_period; |
| 1471 | unsigned int numa_scan_period_max; | 1481 | unsigned int numa_scan_period_max; |
| 1472 | int numa_preferred_nid; | 1482 | int numa_preferred_nid; |
| 1473 | int numa_migrate_deferred; | ||
| 1474 | unsigned long numa_migrate_retry; | 1483 | unsigned long numa_migrate_retry; |
| 1475 | u64 node_stamp; /* migration stamp */ | 1484 | u64 node_stamp; /* migration stamp */ |
| 1485 | u64 last_task_numa_placement; | ||
| 1486 | u64 last_sum_exec_runtime; | ||
| 1476 | struct callback_head numa_work; | 1487 | struct callback_head numa_work; |
| 1477 | 1488 | ||
| 1478 | struct list_head numa_entry; | 1489 | struct list_head numa_entry; |
| @@ -1483,15 +1494,22 @@ struct task_struct { | |||
| 1483 | * Scheduling placement decisions are made based on the these counts. | 1494 | * Scheduling placement decisions are made based on the these counts. |
| 1484 | * The values remain static for the duration of a PTE scan | 1495 | * The values remain static for the duration of a PTE scan |
| 1485 | */ | 1496 | */ |
| 1486 | unsigned long *numa_faults; | 1497 | unsigned long *numa_faults_memory; |
| 1487 | unsigned long total_numa_faults; | 1498 | unsigned long total_numa_faults; |
| 1488 | 1499 | ||
| 1489 | /* | 1500 | /* |
| 1490 | * numa_faults_buffer records faults per node during the current | 1501 | * numa_faults_buffer records faults per node during the current |
| 1491 | * scan window. When the scan completes, the counts in numa_faults | 1502 | * scan window. When the scan completes, the counts in |
| 1492 | * decay and these values are copied. | 1503 | * numa_faults_memory decay and these values are copied. |
| 1493 | */ | 1504 | */ |
| 1494 | unsigned long *numa_faults_buffer; | 1505 | unsigned long *numa_faults_buffer_memory; |
| 1506 | |||
| 1507 | /* | ||
| 1508 | * Track the nodes the process was running on when a NUMA hinting | ||
| 1509 | * fault was incurred. | ||
| 1510 | */ | ||
| 1511 | unsigned long *numa_faults_cpu; | ||
| 1512 | unsigned long *numa_faults_buffer_cpu; | ||
| 1495 | 1513 | ||
| 1496 | /* | 1514 | /* |
| 1497 | * numa_faults_locality tracks if faults recorded during the last | 1515 | * numa_faults_locality tracks if faults recorded during the last |
| @@ -1596,8 +1614,8 @@ extern void task_numa_fault(int last_node, int node, int pages, int flags); | |||
| 1596 | extern pid_t task_numa_group_id(struct task_struct *p); | 1614 | extern pid_t task_numa_group_id(struct task_struct *p); |
| 1597 | extern void set_numabalancing_state(bool enabled); | 1615 | extern void set_numabalancing_state(bool enabled); |
| 1598 | extern void task_numa_free(struct task_struct *p); | 1616 | extern void task_numa_free(struct task_struct *p); |
| 1599 | 1617 | extern bool should_numa_migrate_memory(struct task_struct *p, struct page *page, | |
| 1600 | extern unsigned int sysctl_numa_balancing_migrate_deferred; | 1618 | int src_nid, int dst_cpu); |
| 1601 | #else | 1619 | #else |
| 1602 | static inline void task_numa_fault(int last_node, int node, int pages, | 1620 | static inline void task_numa_fault(int last_node, int node, int pages, |
| 1603 | int flags) | 1621 | int flags) |
| @@ -1613,6 +1631,11 @@ static inline void set_numabalancing_state(bool enabled) | |||
| 1613 | static inline void task_numa_free(struct task_struct *p) | 1631 | static inline void task_numa_free(struct task_struct *p) |
| 1614 | { | 1632 | { |
| 1615 | } | 1633 | } |
| 1634 | static inline bool should_numa_migrate_memory(struct task_struct *p, | ||
| 1635 | struct page *page, int src_nid, int dst_cpu) | ||
| 1636 | { | ||
| 1637 | return true; | ||
| 1638 | } | ||
| 1616 | #endif | 1639 | #endif |
| 1617 | 1640 | ||
| 1618 | static inline struct pid *task_pid(struct task_struct *task) | 1641 | static inline struct pid *task_pid(struct task_struct *task) |
| @@ -2080,7 +2103,16 @@ static inline void sched_autogroup_exit(struct signal_struct *sig) { } | |||
| 2080 | extern bool yield_to(struct task_struct *p, bool preempt); | 2103 | extern bool yield_to(struct task_struct *p, bool preempt); |
| 2081 | extern void set_user_nice(struct task_struct *p, long nice); | 2104 | extern void set_user_nice(struct task_struct *p, long nice); |
| 2082 | extern int task_prio(const struct task_struct *p); | 2105 | extern int task_prio(const struct task_struct *p); |
| 2083 | extern int task_nice(const struct task_struct *p); | 2106 | /** |
| 2107 | * task_nice - return the nice value of a given task. | ||
| 2108 | * @p: the task in question. | ||
| 2109 | * | ||
| 2110 | * Return: The nice value [ -20 ... 0 ... 19 ]. | ||
| 2111 | */ | ||
| 2112 | static inline int task_nice(const struct task_struct *p) | ||
| 2113 | { | ||
| 2114 | return PRIO_TO_NICE((p)->static_prio); | ||
| 2115 | } | ||
| 2084 | extern int can_nice(const struct task_struct *p, const int nice); | 2116 | extern int can_nice(const struct task_struct *p, const int nice); |
| 2085 | extern int task_curr(const struct task_struct *p); | 2117 | extern int task_curr(const struct task_struct *p); |
| 2086 | extern int idle_cpu(int cpu); | 2118 | extern int idle_cpu(int cpu); |
diff --git a/include/linux/sched/prio.h b/include/linux/sched/prio.h new file mode 100644 index 000000000000..ac322583c820 --- /dev/null +++ b/include/linux/sched/prio.h | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | #ifndef _SCHED_PRIO_H | ||
| 2 | #define _SCHED_PRIO_H | ||
| 3 | |||
| 4 | #define MAX_NICE 19 | ||
| 5 | #define MIN_NICE -20 | ||
| 6 | #define NICE_WIDTH (MAX_NICE - MIN_NICE + 1) | ||
| 7 | |||
| 8 | /* | ||
| 9 | * Priority of a process goes from 0..MAX_PRIO-1, valid RT | ||
| 10 | * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH | ||
| 11 | * tasks are in the range MAX_RT_PRIO..MAX_PRIO-1. Priority | ||
| 12 | * values are inverted: lower p->prio value means higher priority. | ||
| 13 | * | ||
| 14 | * The MAX_USER_RT_PRIO value allows the actual maximum | ||
| 15 | * RT priority to be separate from the value exported to | ||
| 16 | * user-space. This allows kernel threads to set their | ||
| 17 | * priority to a value higher than any user task. Note: | ||
| 18 | * MAX_RT_PRIO must not be smaller than MAX_USER_RT_PRIO. | ||
| 19 | */ | ||
| 20 | |||
| 21 | #define MAX_USER_RT_PRIO 100 | ||
| 22 | #define MAX_RT_PRIO MAX_USER_RT_PRIO | ||
| 23 | |||
| 24 | #define MAX_PRIO (MAX_RT_PRIO + NICE_WIDTH) | ||
| 25 | #define DEFAULT_PRIO (MAX_RT_PRIO + NICE_WIDTH / 2) | ||
| 26 | |||
| 27 | /* | ||
| 28 | * Convert user-nice values [ -20 ... 0 ... 19 ] | ||
| 29 | * to static priority [ MAX_RT_PRIO..MAX_PRIO-1 ], | ||
| 30 | * and back. | ||
| 31 | */ | ||
| 32 | #define NICE_TO_PRIO(nice) ((nice) + DEFAULT_PRIO) | ||
| 33 | #define PRIO_TO_NICE(prio) ((prio) - DEFAULT_PRIO) | ||
| 34 | |||
| 35 | /* | ||
| 36 | * 'User priority' is the nice value converted to something we | ||
| 37 | * can work with better when scaling various scheduler parameters, | ||
| 38 | * it's a [ 0 ... 39 ] range. | ||
| 39 | */ | ||
| 40 | #define USER_PRIO(p) ((p)-MAX_RT_PRIO) | ||
| 41 | #define TASK_USER_PRIO(p) USER_PRIO((p)->static_prio) | ||
| 42 | #define MAX_USER_PRIO (USER_PRIO(MAX_PRIO)) | ||
| 43 | |||
| 44 | #endif /* _SCHED_PRIO_H */ | ||
diff --git a/include/linux/sched/rt.h b/include/linux/sched/rt.h index 34e4ebea8fce..6341f5be6e24 100644 --- a/include/linux/sched/rt.h +++ b/include/linux/sched/rt.h | |||
| @@ -1,24 +1,7 @@ | |||
| 1 | #ifndef _SCHED_RT_H | 1 | #ifndef _SCHED_RT_H |
| 2 | #define _SCHED_RT_H | 2 | #define _SCHED_RT_H |
| 3 | 3 | ||
| 4 | /* | 4 | #include <linux/sched/prio.h> |
| 5 | * Priority of a process goes from 0..MAX_PRIO-1, valid RT | ||
| 6 | * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH | ||
| 7 | * tasks are in the range MAX_RT_PRIO..MAX_PRIO-1. Priority | ||
| 8 | * values are inverted: lower p->prio value means higher priority. | ||
| 9 | * | ||
| 10 | * The MAX_USER_RT_PRIO value allows the actual maximum | ||
| 11 | * RT priority to be separate from the value exported to | ||
| 12 | * user-space. This allows kernel threads to set their | ||
| 13 | * priority to a value higher than any user task. Note: | ||
| 14 | * MAX_RT_PRIO must not be smaller than MAX_USER_RT_PRIO. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #define MAX_USER_RT_PRIO 100 | ||
| 18 | #define MAX_RT_PRIO MAX_USER_RT_PRIO | ||
| 19 | |||
| 20 | #define MAX_PRIO (MAX_RT_PRIO + 40) | ||
| 21 | #define DEFAULT_PRIO (MAX_RT_PRIO + 20) | ||
| 22 | 5 | ||
| 23 | static inline int rt_prio(int prio) | 6 | static inline int rt_prio(int prio) |
| 24 | { | 7 | { |
| @@ -35,6 +18,7 @@ static inline int rt_task(struct task_struct *p) | |||
| 35 | #ifdef CONFIG_RT_MUTEXES | 18 | #ifdef CONFIG_RT_MUTEXES |
| 36 | extern int rt_mutex_getprio(struct task_struct *p); | 19 | extern int rt_mutex_getprio(struct task_struct *p); |
| 37 | extern void rt_mutex_setprio(struct task_struct *p, int prio); | 20 | extern void rt_mutex_setprio(struct task_struct *p, int prio); |
| 21 | extern int rt_mutex_check_prio(struct task_struct *task, int newprio); | ||
| 38 | extern struct task_struct *rt_mutex_get_top_task(struct task_struct *task); | 22 | extern struct task_struct *rt_mutex_get_top_task(struct task_struct *task); |
| 39 | extern void rt_mutex_adjust_pi(struct task_struct *p); | 23 | extern void rt_mutex_adjust_pi(struct task_struct *p); |
| 40 | static inline bool tsk_is_pi_blocked(struct task_struct *tsk) | 24 | static inline bool tsk_is_pi_blocked(struct task_struct *tsk) |
| @@ -46,6 +30,12 @@ static inline int rt_mutex_getprio(struct task_struct *p) | |||
| 46 | { | 30 | { |
| 47 | return p->normal_prio; | 31 | return p->normal_prio; |
| 48 | } | 32 | } |
| 33 | |||
| 34 | static inline int rt_mutex_check_prio(struct task_struct *task, int newprio) | ||
| 35 | { | ||
| 36 | return 0; | ||
| 37 | } | ||
| 38 | |||
| 49 | static inline struct task_struct *rt_mutex_get_top_task(struct task_struct *task) | 39 | static inline struct task_struct *rt_mutex_get_top_task(struct task_struct *task) |
| 50 | { | 40 | { |
| 51 | return NULL; | 41 | return NULL; |
diff --git a/include/linux/security.h b/include/linux/security.h index 5623a7f965b7..2fc42d191f79 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
| @@ -1040,6 +1040,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 1040 | * Allocate a security structure to the xp->security field; the security | 1040 | * Allocate a security structure to the xp->security field; the security |
| 1041 | * field is initialized to NULL when the xfrm_policy is allocated. | 1041 | * field is initialized to NULL when the xfrm_policy is allocated. |
| 1042 | * Return 0 if operation was successful (memory to allocate, legal context) | 1042 | * Return 0 if operation was successful (memory to allocate, legal context) |
| 1043 | * @gfp is to specify the context for the allocation | ||
| 1043 | * @xfrm_policy_clone_security: | 1044 | * @xfrm_policy_clone_security: |
| 1044 | * @old_ctx contains an existing xfrm_sec_ctx. | 1045 | * @old_ctx contains an existing xfrm_sec_ctx. |
| 1045 | * @new_ctxp contains a new xfrm_sec_ctx being cloned from old. | 1046 | * @new_ctxp contains a new xfrm_sec_ctx being cloned from old. |
| @@ -1683,7 +1684,7 @@ struct security_operations { | |||
| 1683 | 1684 | ||
| 1684 | #ifdef CONFIG_SECURITY_NETWORK_XFRM | 1685 | #ifdef CONFIG_SECURITY_NETWORK_XFRM |
| 1685 | int (*xfrm_policy_alloc_security) (struct xfrm_sec_ctx **ctxp, | 1686 | int (*xfrm_policy_alloc_security) (struct xfrm_sec_ctx **ctxp, |
| 1686 | struct xfrm_user_sec_ctx *sec_ctx); | 1687 | struct xfrm_user_sec_ctx *sec_ctx, gfp_t gfp); |
| 1687 | int (*xfrm_policy_clone_security) (struct xfrm_sec_ctx *old_ctx, struct xfrm_sec_ctx **new_ctx); | 1688 | int (*xfrm_policy_clone_security) (struct xfrm_sec_ctx *old_ctx, struct xfrm_sec_ctx **new_ctx); |
| 1688 | void (*xfrm_policy_free_security) (struct xfrm_sec_ctx *ctx); | 1689 | void (*xfrm_policy_free_security) (struct xfrm_sec_ctx *ctx); |
| 1689 | int (*xfrm_policy_delete_security) (struct xfrm_sec_ctx *ctx); | 1690 | int (*xfrm_policy_delete_security) (struct xfrm_sec_ctx *ctx); |
| @@ -2859,7 +2860,8 @@ static inline void security_skb_owned_by(struct sk_buff *skb, struct sock *sk) | |||
| 2859 | 2860 | ||
| 2860 | #ifdef CONFIG_SECURITY_NETWORK_XFRM | 2861 | #ifdef CONFIG_SECURITY_NETWORK_XFRM |
| 2861 | 2862 | ||
| 2862 | int security_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp, struct xfrm_user_sec_ctx *sec_ctx); | 2863 | int security_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp, |
| 2864 | struct xfrm_user_sec_ctx *sec_ctx, gfp_t gfp); | ||
| 2863 | int security_xfrm_policy_clone(struct xfrm_sec_ctx *old_ctx, struct xfrm_sec_ctx **new_ctxp); | 2865 | int security_xfrm_policy_clone(struct xfrm_sec_ctx *old_ctx, struct xfrm_sec_ctx **new_ctxp); |
| 2864 | void security_xfrm_policy_free(struct xfrm_sec_ctx *ctx); | 2866 | void security_xfrm_policy_free(struct xfrm_sec_ctx *ctx); |
| 2865 | int security_xfrm_policy_delete(struct xfrm_sec_ctx *ctx); | 2867 | int security_xfrm_policy_delete(struct xfrm_sec_ctx *ctx); |
| @@ -2877,7 +2879,9 @@ void security_skb_classify_flow(struct sk_buff *skb, struct flowi *fl); | |||
| 2877 | 2879 | ||
| 2878 | #else /* CONFIG_SECURITY_NETWORK_XFRM */ | 2880 | #else /* CONFIG_SECURITY_NETWORK_XFRM */ |
| 2879 | 2881 | ||
| 2880 | static inline int security_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp, struct xfrm_user_sec_ctx *sec_ctx) | 2882 | static inline int security_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp, |
| 2883 | struct xfrm_user_sec_ctx *sec_ctx, | ||
| 2884 | gfp_t gfp) | ||
| 2881 | { | 2885 | { |
| 2882 | return 0; | 2886 | return 0; |
| 2883 | } | 2887 | } |
diff --git a/include/linux/serial_bcm63xx.h b/include/linux/serial_bcm63xx.h index 570e964dc899..a80aa1a5bee2 100644 --- a/include/linux/serial_bcm63xx.h +++ b/include/linux/serial_bcm63xx.h | |||
| @@ -116,4 +116,6 @@ | |||
| 116 | UART_FIFO_PARERR_MASK | \ | 116 | UART_FIFO_PARERR_MASK | \ |
| 117 | UART_FIFO_BRKDET_MASK) | 117 | UART_FIFO_BRKDET_MASK) |
| 118 | 118 | ||
| 119 | #define UART_REG_SIZE 24 | ||
| 120 | |||
| 119 | #endif /* _LINUX_SERIAL_BCM63XX_H */ | 121 | #endif /* _LINUX_SERIAL_BCM63XX_H */ |
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h index 22b3640c9424..6c5e3bb282b0 100644 --- a/include/linux/serial_sci.h +++ b/include/linux/serial_sci.h | |||
| @@ -10,45 +10,59 @@ | |||
| 10 | 10 | ||
| 11 | #define SCIx_NOT_SUPPORTED (-1) | 11 | #define SCIx_NOT_SUPPORTED (-1) |
| 12 | 12 | ||
| 13 | #define SCSCR_TIE (1 << 7) | 13 | /* SCSMR (Serial Mode Register) */ |
| 14 | #define SCSCR_RIE (1 << 6) | 14 | #define SCSMR_CHR (1 << 6) /* 7-bit Character Length */ |
| 15 | #define SCSCR_TE (1 << 5) | 15 | #define SCSMR_PE (1 << 5) /* Parity Enable */ |
| 16 | #define SCSCR_RE (1 << 4) | 16 | #define SCSMR_ODD (1 << 4) /* Odd Parity */ |
| 17 | #define SCSCR_REIE (1 << 3) /* not supported by all parts */ | 17 | #define SCSMR_STOP (1 << 3) /* Stop Bit Length */ |
| 18 | #define SCSCR_TOIE (1 << 2) /* not supported by all parts */ | 18 | #define SCSMR_CKS 0x0003 /* Clock Select */ |
| 19 | #define SCSCR_CKE1 (1 << 1) | 19 | |
| 20 | #define SCSCR_CKE0 (1 << 0) | 20 | /* Serial Control Register (@ = not supported by all parts) */ |
| 21 | 21 | #define SCSCR_TIE (1 << 7) /* Transmit Interrupt Enable */ | |
| 22 | /* SCxSR SCI */ | 22 | #define SCSCR_RIE (1 << 6) /* Receive Interrupt Enable */ |
| 23 | #define SCI_TDRE 0x80 | 23 | #define SCSCR_TE (1 << 5) /* Transmit Enable */ |
| 24 | #define SCI_RDRF 0x40 | 24 | #define SCSCR_RE (1 << 4) /* Receive Enable */ |
| 25 | #define SCI_ORER 0x20 | 25 | #define SCSCR_REIE (1 << 3) /* Receive Error Interrupt Enable @ */ |
| 26 | #define SCI_FER 0x10 | 26 | #define SCSCR_TOIE (1 << 2) /* Timeout Interrupt Enable @ */ |
| 27 | #define SCI_PER 0x08 | 27 | #define SCSCR_CKE1 (1 << 1) /* Clock Enable 1 */ |
| 28 | #define SCI_TEND 0x04 | 28 | #define SCSCR_CKE0 (1 << 0) /* Clock Enable 0 */ |
| 29 | /* SCIFA/SCIFB only */ | ||
| 30 | #define SCSCR_TDRQE (1 << 15) /* Tx Data Transfer Request Enable */ | ||
| 31 | #define SCSCR_RDRQE (1 << 14) /* Rx Data Transfer Request Enable */ | ||
| 32 | |||
| 33 | /* SCxSR (Serial Status Register) on SCI */ | ||
| 34 | #define SCI_TDRE 0x80 /* Transmit Data Register Empty */ | ||
| 35 | #define SCI_RDRF 0x40 /* Receive Data Register Full */ | ||
| 36 | #define SCI_ORER 0x20 /* Overrun Error */ | ||
| 37 | #define SCI_FER 0x10 /* Framing Error */ | ||
| 38 | #define SCI_PER 0x08 /* Parity Error */ | ||
| 39 | #define SCI_TEND 0x04 /* Transmit End */ | ||
| 29 | 40 | ||
| 30 | #define SCI_DEFAULT_ERROR_MASK (SCI_PER | SCI_FER) | 41 | #define SCI_DEFAULT_ERROR_MASK (SCI_PER | SCI_FER) |
| 31 | 42 | ||
| 32 | /* SCxSR SCIF, HSCIF */ | 43 | /* SCxSR (Serial Status Register) on SCIF, HSCIF */ |
| 33 | #define SCIF_ER 0x0080 | 44 | #define SCIF_ER 0x0080 /* Receive Error */ |
| 34 | #define SCIF_TEND 0x0040 | 45 | #define SCIF_TEND 0x0040 /* Transmission End */ |
| 35 | #define SCIF_TDFE 0x0020 | 46 | #define SCIF_TDFE 0x0020 /* Transmit FIFO Data Empty */ |
| 36 | #define SCIF_BRK 0x0010 | 47 | #define SCIF_BRK 0x0010 /* Break Detect */ |
| 37 | #define SCIF_FER 0x0008 | 48 | #define SCIF_FER 0x0008 /* Framing Error */ |
| 38 | #define SCIF_PER 0x0004 | 49 | #define SCIF_PER 0x0004 /* Parity Error */ |
| 39 | #define SCIF_RDF 0x0002 | 50 | #define SCIF_RDF 0x0002 /* Receive FIFO Data Full */ |
| 40 | #define SCIF_DR 0x0001 | 51 | #define SCIF_DR 0x0001 /* Receive Data Ready */ |
| 41 | 52 | ||
| 42 | #define SCIF_DEFAULT_ERROR_MASK (SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK) | 53 | #define SCIF_DEFAULT_ERROR_MASK (SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK) |
| 43 | 54 | ||
| 44 | /* SCSPTR, optional */ | 55 | /* SCFCR (FIFO Control Register) */ |
| 45 | #define SCSPTR_RTSIO (1 << 7) | 56 | #define SCFCR_LOOP (1 << 0) /* Loopback Test */ |
| 46 | #define SCSPTR_CTSIO (1 << 5) | 57 | |
| 47 | #define SCSPTR_SPB2IO (1 << 1) | 58 | /* SCSPTR (Serial Port Register), optional */ |
| 48 | #define SCSPTR_SPB2DT (1 << 0) | 59 | #define SCSPTR_RTSIO (1 << 7) /* Serial Port RTS Pin Input/Output */ |
| 60 | #define SCSPTR_CTSIO (1 << 5) /* Serial Port CTS Pin Input/Output */ | ||
| 61 | #define SCSPTR_SPB2IO (1 << 1) /* Serial Port Break Input/Output */ | ||
| 62 | #define SCSPTR_SPB2DT (1 << 0) /* Serial Port Break Data */ | ||
| 49 | 63 | ||
| 50 | /* HSSRR HSCIF */ | 64 | /* HSSRR HSCIF */ |
| 51 | #define HSCIF_SRE 0x8000 | 65 | #define HSCIF_SRE 0x8000 /* Sampling Rate Register Enable */ |
| 52 | 66 | ||
| 53 | enum { | 67 | enum { |
| 54 | SCIx_PROBE_REGTYPE, | 68 | SCIx_PROBE_REGTYPE, |
| @@ -73,10 +87,19 @@ enum { | |||
| 73 | * Not all registers will exist on all parts. | 87 | * Not all registers will exist on all parts. |
| 74 | */ | 88 | */ |
| 75 | enum { | 89 | enum { |
| 76 | SCSMR, SCBRR, SCSCR, SCxSR, | 90 | SCSMR, /* Serial Mode Register */ |
| 77 | SCFCR, SCFDR, SCxTDR, SCxRDR, | 91 | SCBRR, /* Bit Rate Register */ |
| 78 | SCLSR, SCTFDR, SCRFDR, SCSPTR, | 92 | SCSCR, /* Serial Control Register */ |
| 79 | HSSRR, | 93 | SCxSR, /* Serial Status Register */ |
| 94 | SCFCR, /* FIFO Control Register */ | ||
| 95 | SCFDR, /* FIFO Data Count Register */ | ||
| 96 | SCxTDR, /* Transmit (FIFO) Data Register */ | ||
| 97 | SCxRDR, /* Receive (FIFO) Data Register */ | ||
| 98 | SCLSR, /* Line Status Register */ | ||
| 99 | SCTFDR, /* Transmit FIFO Data Count Register */ | ||
| 100 | SCRFDR, /* Receive FIFO Data Count Register */ | ||
| 101 | SCSPTR, /* Serial Port Register */ | ||
| 102 | HSSRR, /* Sampling Rate Register */ | ||
| 80 | 103 | ||
| 81 | SCIx_NR_REGS, | 104 | SCIx_NR_REGS, |
| 82 | }; | 105 | }; |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index f589c9af8cbf..15ede6a823a6 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -2451,8 +2451,8 @@ int skb_splice_bits(struct sk_buff *skb, unsigned int offset, | |||
| 2451 | unsigned int flags); | 2451 | unsigned int flags); |
| 2452 | void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to); | 2452 | void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to); |
| 2453 | unsigned int skb_zerocopy_headlen(const struct sk_buff *from); | 2453 | unsigned int skb_zerocopy_headlen(const struct sk_buff *from); |
| 2454 | void skb_zerocopy(struct sk_buff *to, const struct sk_buff *from, | 2454 | int skb_zerocopy(struct sk_buff *to, struct sk_buff *from, |
| 2455 | int len, int hlen); | 2455 | int len, int hlen); |
| 2456 | void skb_split(struct sk_buff *skb, struct sk_buff *skb1, const u32 len); | 2456 | void skb_split(struct sk_buff *skb, struct sk_buff *skb1, const u32 len); |
| 2457 | int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen); | 2457 | int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen); |
| 2458 | void skb_scrub_packet(struct sk_buff *skb, bool xnet); | 2458 | void skb_scrub_packet(struct sk_buff *skb, bool xnet); |
| @@ -2725,7 +2725,7 @@ static inline void nf_reset(struct sk_buff *skb) | |||
| 2725 | 2725 | ||
| 2726 | static inline void nf_reset_trace(struct sk_buff *skb) | 2726 | static inline void nf_reset_trace(struct sk_buff *skb) |
| 2727 | { | 2727 | { |
| 2728 | #if IS_ENABLED(CONFIG_NETFILTER_XT_TARGET_TRACE) | 2728 | #if IS_ENABLED(CONFIG_NETFILTER_XT_TARGET_TRACE) || defined(CONFIG_NF_TABLES) |
| 2729 | skb->nf_trace = 0; | 2729 | skb->nf_trace = 0; |
| 2730 | #endif | 2730 | #endif |
| 2731 | } | 2731 | } |
| @@ -2742,6 +2742,9 @@ static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src) | |||
| 2742 | dst->nf_bridge = src->nf_bridge; | 2742 | dst->nf_bridge = src->nf_bridge; |
| 2743 | nf_bridge_get(src->nf_bridge); | 2743 | nf_bridge_get(src->nf_bridge); |
| 2744 | #endif | 2744 | #endif |
| 2745 | #if IS_ENABLED(CONFIG_NETFILTER_XT_TARGET_TRACE) || defined(CONFIG_NF_TABLES) | ||
| 2746 | dst->nf_trace = src->nf_trace; | ||
| 2747 | #endif | ||
| 2745 | } | 2748 | } |
| 2746 | 2749 | ||
| 2747 | static inline void nf_copy(struct sk_buff *dst, const struct sk_buff *src) | 2750 | static inline void nf_copy(struct sk_buff *dst, const struct sk_buff *src) |
| @@ -2916,5 +2919,22 @@ static inline bool skb_head_is_locked(const struct sk_buff *skb) | |||
| 2916 | { | 2919 | { |
| 2917 | return !skb->head_frag || skb_cloned(skb); | 2920 | return !skb->head_frag || skb_cloned(skb); |
| 2918 | } | 2921 | } |
| 2922 | |||
| 2923 | /** | ||
| 2924 | * skb_gso_network_seglen - Return length of individual segments of a gso packet | ||
| 2925 | * | ||
| 2926 | * @skb: GSO skb | ||
| 2927 | * | ||
| 2928 | * skb_gso_network_seglen is used to determine the real size of the | ||
| 2929 | * individual segments, including Layer3 (IP, IPv6) and L4 headers (TCP/UDP). | ||
| 2930 | * | ||
| 2931 | * The MAC/L2 header is not accounted for. | ||
| 2932 | */ | ||
| 2933 | static inline unsigned int skb_gso_network_seglen(const struct sk_buff *skb) | ||
| 2934 | { | ||
| 2935 | unsigned int hdr_len = skb_transport_header(skb) - | ||
| 2936 | skb_network_header(skb); | ||
| 2937 | return hdr_len + skb_gso_transport_seglen(skb); | ||
| 2938 | } | ||
| 2919 | #endif /* __KERNEL__ */ | 2939 | #endif /* __KERNEL__ */ |
| 2920 | #endif /* _LINUX_SKBUFF_H */ | 2940 | #endif /* _LINUX_SKBUFF_H */ |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 9260abdd67df..b5b2df60299e 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
| @@ -410,7 +410,7 @@ static __always_inline void *kmalloc_large(size_t size, gfp_t flags) | |||
| 410 | * | 410 | * |
| 411 | * %GFP_NOWAIT - Allocation will not sleep. | 411 | * %GFP_NOWAIT - Allocation will not sleep. |
| 412 | * | 412 | * |
| 413 | * %GFP_THISNODE - Allocate node-local memory only. | 413 | * %__GFP_THISNODE - Allocate node-local memory only. |
| 414 | * | 414 | * |
| 415 | * %GFP_DMA - Allocation suitable for DMA. | 415 | * %GFP_DMA - Allocation suitable for DMA. |
| 416 | * Should only be used for kmalloc() caches. Otherwise, use a | 416 | * Should only be used for kmalloc() caches. Otherwise, use a |
diff --git a/include/linux/smp.h b/include/linux/smp.h index 6ae004e437ea..633f5edd7470 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
| @@ -17,10 +17,7 @@ extern void cpu_idle(void); | |||
| 17 | 17 | ||
| 18 | typedef void (*smp_call_func_t)(void *info); | 18 | typedef void (*smp_call_func_t)(void *info); |
| 19 | struct call_single_data { | 19 | struct call_single_data { |
| 20 | union { | 20 | struct llist_node llist; |
| 21 | struct list_head list; | ||
| 22 | struct llist_node llist; | ||
| 23 | }; | ||
| 24 | smp_call_func_t func; | 21 | smp_call_func_t func; |
| 25 | void *info; | 22 | void *info; |
| 26 | u16 flags; | 23 | u16 flags; |
| @@ -53,8 +50,7 @@ void on_each_cpu_cond(bool (*cond_func)(int cpu, void *info), | |||
| 53 | smp_call_func_t func, void *info, bool wait, | 50 | smp_call_func_t func, void *info, bool wait, |
| 54 | gfp_t gfp_flags); | 51 | gfp_t gfp_flags); |
| 55 | 52 | ||
| 56 | void __smp_call_function_single(int cpuid, struct call_single_data *data, | 53 | int smp_call_function_single_async(int cpu, struct call_single_data *csd); |
| 57 | int wait); | ||
| 58 | 54 | ||
| 59 | #ifdef CONFIG_SMP | 55 | #ifdef CONFIG_SMP |
| 60 | 56 | ||
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 4203c66d8803..36c86ef51ff3 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
| @@ -24,6 +24,9 @@ | |||
| 24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
| 25 | #include <linux/kthread.h> | 25 | #include <linux/kthread.h> |
| 26 | #include <linux/completion.h> | 26 | #include <linux/completion.h> |
| 27 | #include <linux/scatterlist.h> | ||
| 28 | |||
| 29 | struct dma_chan; | ||
| 27 | 30 | ||
| 28 | /* | 31 | /* |
| 29 | * INTERFACES between SPI master-side drivers and SPI infrastructure. | 32 | * INTERFACES between SPI master-side drivers and SPI infrastructure. |
| @@ -266,6 +269,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
| 266 | * @auto_runtime_pm: the core should ensure a runtime PM reference is held | 269 | * @auto_runtime_pm: the core should ensure a runtime PM reference is held |
| 267 | * while the hardware is prepared, using the parent | 270 | * while the hardware is prepared, using the parent |
| 268 | * device for the spidev | 271 | * device for the spidev |
| 272 | * @max_dma_len: Maximum length of a DMA transfer for the device. | ||
| 269 | * @prepare_transfer_hardware: a message will soon arrive from the queue | 273 | * @prepare_transfer_hardware: a message will soon arrive from the queue |
| 270 | * so the subsystem requests the driver to prepare the transfer hardware | 274 | * so the subsystem requests the driver to prepare the transfer hardware |
| 271 | * by issuing this call | 275 | * by issuing this call |
| @@ -348,6 +352,8 @@ struct spi_master { | |||
| 348 | #define SPI_MASTER_HALF_DUPLEX BIT(0) /* can't do full duplex */ | 352 | #define SPI_MASTER_HALF_DUPLEX BIT(0) /* can't do full duplex */ |
| 349 | #define SPI_MASTER_NO_RX BIT(1) /* can't do buffer read */ | 353 | #define SPI_MASTER_NO_RX BIT(1) /* can't do buffer read */ |
| 350 | #define SPI_MASTER_NO_TX BIT(2) /* can't do buffer write */ | 354 | #define SPI_MASTER_NO_TX BIT(2) /* can't do buffer write */ |
| 355 | #define SPI_MASTER_MUST_RX BIT(3) /* requires rx */ | ||
| 356 | #define SPI_MASTER_MUST_TX BIT(4) /* requires tx */ | ||
| 351 | 357 | ||
| 352 | /* lock and mutex for SPI bus locking */ | 358 | /* lock and mutex for SPI bus locking */ |
| 353 | spinlock_t bus_lock_spinlock; | 359 | spinlock_t bus_lock_spinlock; |
| @@ -390,6 +396,17 @@ struct spi_master { | |||
| 390 | void (*cleanup)(struct spi_device *spi); | 396 | void (*cleanup)(struct spi_device *spi); |
| 391 | 397 | ||
| 392 | /* | 398 | /* |
| 399 | * Used to enable core support for DMA handling, if can_dma() | ||
| 400 | * exists and returns true then the transfer will be mapped | ||
| 401 | * prior to transfer_one() being called. The driver should | ||
| 402 | * not modify or store xfer and dma_tx and dma_rx must be set | ||
| 403 | * while the device is prepared. | ||
| 404 | */ | ||
| 405 | bool (*can_dma)(struct spi_master *master, | ||
| 406 | struct spi_device *spi, | ||
| 407 | struct spi_transfer *xfer); | ||
| 408 | |||
| 409 | /* | ||
| 393 | * These hooks are for drivers that want to use the generic | 410 | * These hooks are for drivers that want to use the generic |
| 394 | * master transfer queueing mechanism. If these are used, the | 411 | * master transfer queueing mechanism. If these are used, the |
| 395 | * transfer() function above must NOT be specified by the driver. | 412 | * transfer() function above must NOT be specified by the driver. |
| @@ -407,7 +424,9 @@ struct spi_master { | |||
| 407 | bool rt; | 424 | bool rt; |
| 408 | bool auto_runtime_pm; | 425 | bool auto_runtime_pm; |
| 409 | bool cur_msg_prepared; | 426 | bool cur_msg_prepared; |
| 427 | bool cur_msg_mapped; | ||
| 410 | struct completion xfer_completion; | 428 | struct completion xfer_completion; |
| 429 | size_t max_dma_len; | ||
| 411 | 430 | ||
| 412 | int (*prepare_transfer_hardware)(struct spi_master *master); | 431 | int (*prepare_transfer_hardware)(struct spi_master *master); |
| 413 | int (*transfer_one_message)(struct spi_master *master, | 432 | int (*transfer_one_message)(struct spi_master *master, |
| @@ -428,6 +447,14 @@ struct spi_master { | |||
| 428 | 447 | ||
| 429 | /* gpio chip select */ | 448 | /* gpio chip select */ |
| 430 | int *cs_gpios; | 449 | int *cs_gpios; |
| 450 | |||
| 451 | /* DMA channels for use with core dmaengine helpers */ | ||
| 452 | struct dma_chan *dma_tx; | ||
| 453 | struct dma_chan *dma_rx; | ||
| 454 | |||
| 455 | /* dummy data for full duplex devices */ | ||
| 456 | void *dummy_rx; | ||
| 457 | void *dummy_tx; | ||
| 431 | }; | 458 | }; |
| 432 | 459 | ||
| 433 | static inline void *spi_master_get_devdata(struct spi_master *master) | 460 | static inline void *spi_master_get_devdata(struct spi_master *master) |
| @@ -512,6 +539,8 @@ extern struct spi_master *spi_busnum_to_master(u16 busnum); | |||
| 512 | * (optionally) changing the chipselect status, then starting | 539 | * (optionally) changing the chipselect status, then starting |
| 513 | * the next transfer or completing this @spi_message. | 540 | * the next transfer or completing this @spi_message. |
| 514 | * @transfer_list: transfers are sequenced through @spi_message.transfers | 541 | * @transfer_list: transfers are sequenced through @spi_message.transfers |
| 542 | * @tx_sg: Scatterlist for transmit, currently not for client use | ||
| 543 | * @rx_sg: Scatterlist for receive, currently not for client use | ||
| 515 | * | 544 | * |
| 516 | * SPI transfers always write the same number of bytes as they read. | 545 | * SPI transfers always write the same number of bytes as they read. |
| 517 | * Protocol drivers should always provide @rx_buf and/or @tx_buf. | 546 | * Protocol drivers should always provide @rx_buf and/or @tx_buf. |
| @@ -579,6 +608,8 @@ struct spi_transfer { | |||
| 579 | 608 | ||
| 580 | dma_addr_t tx_dma; | 609 | dma_addr_t tx_dma; |
| 581 | dma_addr_t rx_dma; | 610 | dma_addr_t rx_dma; |
| 611 | struct sg_table tx_sg; | ||
| 612 | struct sg_table rx_sg; | ||
| 582 | 613 | ||
| 583 | unsigned cs_change:1; | 614 | unsigned cs_change:1; |
| 584 | unsigned tx_nbits:3; | 615 | unsigned tx_nbits:3; |
diff --git a/include/linux/spi/spi_bitbang.h b/include/linux/spi/spi_bitbang.h index daebaba886aa..85578d4be034 100644 --- a/include/linux/spi/spi_bitbang.h +++ b/include/linux/spi/spi_bitbang.h | |||
| @@ -42,6 +42,6 @@ extern int spi_bitbang_setup_transfer(struct spi_device *spi, | |||
| 42 | 42 | ||
| 43 | /* start or stop queue processing */ | 43 | /* start or stop queue processing */ |
| 44 | extern int spi_bitbang_start(struct spi_bitbang *spi); | 44 | extern int spi_bitbang_start(struct spi_bitbang *spi); |
| 45 | extern int spi_bitbang_stop(struct spi_bitbang *spi); | 45 | extern void spi_bitbang_stop(struct spi_bitbang *spi); |
| 46 | 46 | ||
| 47 | #endif /* __SPI_BITBANG_H */ | 47 | #endif /* __SPI_BITBANG_H */ |
diff --git a/include/linux/spmi.h b/include/linux/spmi.h new file mode 100644 index 000000000000..91f5eab9e428 --- /dev/null +++ b/include/linux/spmi.h | |||
| @@ -0,0 +1,191 @@ | |||
| 1 | /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. | ||
| 2 | * | ||
| 3 | * This program is free software; you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License version 2 and | ||
| 5 | * only version 2 as published by the Free Software Foundation. | ||
| 6 | * | ||
| 7 | * This program is distributed in the hope that it will be useful, | ||
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 10 | * GNU General Public License for more details. | ||
| 11 | */ | ||
| 12 | #ifndef _LINUX_SPMI_H | ||
| 13 | #define _LINUX_SPMI_H | ||
| 14 | |||
| 15 | #include <linux/types.h> | ||
| 16 | #include <linux/device.h> | ||
| 17 | #include <linux/mod_devicetable.h> | ||
| 18 | |||
| 19 | /* Maximum slave identifier */ | ||
| 20 | #define SPMI_MAX_SLAVE_ID 16 | ||
| 21 | |||
| 22 | /* SPMI Commands */ | ||
| 23 | #define SPMI_CMD_EXT_WRITE 0x00 | ||
| 24 | #define SPMI_CMD_RESET 0x10 | ||
| 25 | #define SPMI_CMD_SLEEP 0x11 | ||
| 26 | #define SPMI_CMD_SHUTDOWN 0x12 | ||
| 27 | #define SPMI_CMD_WAKEUP 0x13 | ||
| 28 | #define SPMI_CMD_AUTHENTICATE 0x14 | ||
| 29 | #define SPMI_CMD_MSTR_READ 0x15 | ||
| 30 | #define SPMI_CMD_MSTR_WRITE 0x16 | ||
| 31 | #define SPMI_CMD_TRANSFER_BUS_OWNERSHIP 0x1A | ||
| 32 | #define SPMI_CMD_DDB_MASTER_READ 0x1B | ||
| 33 | #define SPMI_CMD_DDB_SLAVE_READ 0x1C | ||
| 34 | #define SPMI_CMD_EXT_READ 0x20 | ||
| 35 | #define SPMI_CMD_EXT_WRITEL 0x30 | ||
| 36 | #define SPMI_CMD_EXT_READL 0x38 | ||
| 37 | #define SPMI_CMD_WRITE 0x40 | ||
| 38 | #define SPMI_CMD_READ 0x60 | ||
| 39 | #define SPMI_CMD_ZERO_WRITE 0x80 | ||
| 40 | |||
| 41 | /** | ||
| 42 | * struct spmi_device - Basic representation of an SPMI device | ||
| 43 | * @dev: Driver model representation of the device. | ||
| 44 | * @ctrl: SPMI controller managing the bus hosting this device. | ||
| 45 | * @usid: This devices' Unique Slave IDentifier. | ||
| 46 | */ | ||
| 47 | struct spmi_device { | ||
| 48 | struct device dev; | ||
| 49 | struct spmi_controller *ctrl; | ||
| 50 | u8 usid; | ||
| 51 | }; | ||
| 52 | |||
| 53 | static inline struct spmi_device *to_spmi_device(struct device *d) | ||
| 54 | { | ||
| 55 | return container_of(d, struct spmi_device, dev); | ||
| 56 | } | ||
| 57 | |||
| 58 | static inline void *spmi_device_get_drvdata(const struct spmi_device *sdev) | ||
| 59 | { | ||
| 60 | return dev_get_drvdata(&sdev->dev); | ||
| 61 | } | ||
| 62 | |||
| 63 | static inline void spmi_device_set_drvdata(struct spmi_device *sdev, void *data) | ||
| 64 | { | ||
| 65 | dev_set_drvdata(&sdev->dev, data); | ||
| 66 | } | ||
| 67 | |||
| 68 | struct spmi_device *spmi_device_alloc(struct spmi_controller *ctrl); | ||
| 69 | |||
| 70 | static inline void spmi_device_put(struct spmi_device *sdev) | ||
| 71 | { | ||
| 72 | if (sdev) | ||
| 73 | put_device(&sdev->dev); | ||
| 74 | } | ||
| 75 | |||
| 76 | int spmi_device_add(struct spmi_device *sdev); | ||
| 77 | |||
| 78 | void spmi_device_remove(struct spmi_device *sdev); | ||
| 79 | |||
| 80 | /** | ||
| 81 | * struct spmi_controller - interface to the SPMI master controller | ||
| 82 | * @dev: Driver model representation of the device. | ||
| 83 | * @nr: board-specific number identifier for this controller/bus | ||
| 84 | * @cmd: sends a non-data command sequence on the SPMI bus. | ||
| 85 | * @read_cmd: sends a register read command sequence on the SPMI bus. | ||
| 86 | * @write_cmd: sends a register write command sequence on the SPMI bus. | ||
| 87 | */ | ||
| 88 | struct spmi_controller { | ||
| 89 | struct device dev; | ||
| 90 | unsigned int nr; | ||
| 91 | int (*cmd)(struct spmi_controller *ctrl, u8 opcode, u8 sid); | ||
| 92 | int (*read_cmd)(struct spmi_controller *ctrl, u8 opcode, | ||
| 93 | u8 sid, u16 addr, u8 *buf, size_t len); | ||
| 94 | int (*write_cmd)(struct spmi_controller *ctrl, u8 opcode, | ||
| 95 | u8 sid, u16 addr, const u8 *buf, size_t len); | ||
| 96 | }; | ||
| 97 | |||
| 98 | static inline struct spmi_controller *to_spmi_controller(struct device *d) | ||
| 99 | { | ||
| 100 | return container_of(d, struct spmi_controller, dev); | ||
| 101 | } | ||
| 102 | |||
| 103 | static inline | ||
| 104 | void *spmi_controller_get_drvdata(const struct spmi_controller *ctrl) | ||
| 105 | { | ||
| 106 | return dev_get_drvdata(&ctrl->dev); | ||
| 107 | } | ||
| 108 | |||
| 109 | static inline void spmi_controller_set_drvdata(struct spmi_controller *ctrl, | ||
| 110 | void *data) | ||
| 111 | { | ||
| 112 | dev_set_drvdata(&ctrl->dev, data); | ||
| 113 | } | ||
| 114 | |||
| 115 | struct spmi_controller *spmi_controller_alloc(struct device *parent, | ||
| 116 | size_t size); | ||
| 117 | |||
| 118 | /** | ||
| 119 | * spmi_controller_put() - decrement controller refcount | ||
| 120 | * @ctrl SPMI controller. | ||
| 121 | */ | ||
| 122 | static inline void spmi_controller_put(struct spmi_controller *ctrl) | ||
| 123 | { | ||
| 124 | if (ctrl) | ||
| 125 | put_device(&ctrl->dev); | ||
| 126 | } | ||
| 127 | |||
| 128 | int spmi_controller_add(struct spmi_controller *ctrl); | ||
| 129 | void spmi_controller_remove(struct spmi_controller *ctrl); | ||
| 130 | |||
| 131 | /** | ||
| 132 | * struct spmi_driver - SPMI slave device driver | ||
| 133 | * @driver: SPMI device drivers should initialize name and owner field of | ||
| 134 | * this structure. | ||
| 135 | * @probe: binds this driver to a SPMI device. | ||
| 136 | * @remove: unbinds this driver from the SPMI device. | ||
| 137 | * @shutdown: standard shutdown callback used during powerdown/halt. | ||
| 138 | * @suspend: standard suspend callback used during system suspend. | ||
| 139 | * @resume: standard resume callback used during system resume. | ||
| 140 | * | ||
| 141 | * If PM runtime support is desired for a slave, a device driver can call | ||
| 142 | * pm_runtime_put() from their probe() routine (and a balancing | ||
| 143 | * pm_runtime_get() in remove()). PM runtime support for a slave is | ||
| 144 | * implemented by issuing a SLEEP command to the slave on runtime_suspend(), | ||
| 145 | * transitioning the slave into the SLEEP state. On runtime_resume(), a WAKEUP | ||
| 146 | * command is sent to the slave to bring it back to ACTIVE. | ||
| 147 | */ | ||
| 148 | struct spmi_driver { | ||
| 149 | struct device_driver driver; | ||
| 150 | int (*probe)(struct spmi_device *sdev); | ||
| 151 | void (*remove)(struct spmi_device *sdev); | ||
| 152 | }; | ||
| 153 | |||
| 154 | static inline struct spmi_driver *to_spmi_driver(struct device_driver *d) | ||
| 155 | { | ||
| 156 | return container_of(d, struct spmi_driver, driver); | ||
| 157 | } | ||
| 158 | |||
| 159 | int spmi_driver_register(struct spmi_driver *sdrv); | ||
| 160 | |||
| 161 | /** | ||
| 162 | * spmi_driver_unregister() - unregister an SPMI client driver | ||
| 163 | * @sdrv: the driver to unregister | ||
| 164 | */ | ||
| 165 | static inline void spmi_driver_unregister(struct spmi_driver *sdrv) | ||
| 166 | { | ||
| 167 | if (sdrv) | ||
| 168 | driver_unregister(&sdrv->driver); | ||
| 169 | } | ||
| 170 | |||
| 171 | #define module_spmi_driver(__spmi_driver) \ | ||
| 172 | module_driver(__spmi_driver, spmi_driver_register, \ | ||
| 173 | spmi_driver_unregister) | ||
| 174 | |||
| 175 | int spmi_register_read(struct spmi_device *sdev, u8 addr, u8 *buf); | ||
| 176 | int spmi_ext_register_read(struct spmi_device *sdev, u8 addr, u8 *buf, | ||
| 177 | size_t len); | ||
| 178 | int spmi_ext_register_readl(struct spmi_device *sdev, u16 addr, u8 *buf, | ||
| 179 | size_t len); | ||
| 180 | int spmi_register_write(struct spmi_device *sdev, u8 addr, u8 data); | ||
| 181 | int spmi_register_zero_write(struct spmi_device *sdev, u8 data); | ||
| 182 | int spmi_ext_register_write(struct spmi_device *sdev, u8 addr, | ||
| 183 | const u8 *buf, size_t len); | ||
| 184 | int spmi_ext_register_writel(struct spmi_device *sdev, u16 addr, | ||
| 185 | const u8 *buf, size_t len); | ||
| 186 | int spmi_command_reset(struct spmi_device *sdev); | ||
| 187 | int spmi_command_sleep(struct spmi_device *sdev); | ||
| 188 | int spmi_command_wakeup(struct spmi_device *sdev); | ||
| 189 | int spmi_command_shutdown(struct spmi_device *sdev); | ||
| 190 | |||
| 191 | #endif | ||
diff --git a/include/linux/srcu.h b/include/linux/srcu.h index 9b058eecd403..a2783cb5d275 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h | |||
| @@ -12,8 +12,8 @@ | |||
| 12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. |
| 13 | * | 13 | * |
| 14 | * You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software | 15 | * along with this program; if not, you can access it online at |
| 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 16 | * http://www.gnu.org/licenses/gpl-2.0.html. |
| 17 | * | 17 | * |
| 18 | * Copyright (C) IBM Corporation, 2006 | 18 | * Copyright (C) IBM Corporation, 2006 |
| 19 | * Copyright (C) Fujitsu, 2012 | 19 | * Copyright (C) Fujitsu, 2012 |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 40ed9e9a77e5..1e67b7a5968c 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -98,6 +98,8 @@ struct sigaltstack; | |||
| 98 | #define __MAP(n,...) __MAP##n(__VA_ARGS__) | 98 | #define __MAP(n,...) __MAP##n(__VA_ARGS__) |
| 99 | 99 | ||
| 100 | #define __SC_DECL(t, a) t a | 100 | #define __SC_DECL(t, a) t a |
| 101 | #define __TYPE_IS_L(t) (__same_type((t)0, 0L)) | ||
| 102 | #define __TYPE_IS_UL(t) (__same_type((t)0, 0UL)) | ||
| 101 | #define __TYPE_IS_LL(t) (__same_type((t)0, 0LL) || __same_type((t)0, 0ULL)) | 103 | #define __TYPE_IS_LL(t) (__same_type((t)0, 0LL) || __same_type((t)0, 0ULL)) |
| 102 | #define __SC_LONG(t, a) __typeof(__builtin_choose_expr(__TYPE_IS_LL(t), 0LL, 0L)) a | 104 | #define __SC_LONG(t, a) __typeof(__builtin_choose_expr(__TYPE_IS_LL(t), 0LL, 0L)) a |
| 103 | #define __SC_CAST(t, a) (t) a | 105 | #define __SC_CAST(t, a) (t) a |
| @@ -281,13 +283,15 @@ asmlinkage long sys_sched_setscheduler(pid_t pid, int policy, | |||
| 281 | asmlinkage long sys_sched_setparam(pid_t pid, | 283 | asmlinkage long sys_sched_setparam(pid_t pid, |
| 282 | struct sched_param __user *param); | 284 | struct sched_param __user *param); |
| 283 | asmlinkage long sys_sched_setattr(pid_t pid, | 285 | asmlinkage long sys_sched_setattr(pid_t pid, |
| 284 | struct sched_attr __user *attr); | 286 | struct sched_attr __user *attr, |
| 287 | unsigned int flags); | ||
| 285 | asmlinkage long sys_sched_getscheduler(pid_t pid); | 288 | asmlinkage long sys_sched_getscheduler(pid_t pid); |
| 286 | asmlinkage long sys_sched_getparam(pid_t pid, | 289 | asmlinkage long sys_sched_getparam(pid_t pid, |
| 287 | struct sched_param __user *param); | 290 | struct sched_param __user *param); |
| 288 | asmlinkage long sys_sched_getattr(pid_t pid, | 291 | asmlinkage long sys_sched_getattr(pid_t pid, |
| 289 | struct sched_attr __user *attr, | 292 | struct sched_attr __user *attr, |
| 290 | unsigned int size); | 293 | unsigned int size, |
| 294 | unsigned int flags); | ||
| 291 | asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len, | 295 | asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len, |
| 292 | unsigned long __user *user_mask_ptr); | 296 | unsigned long __user *user_mask_ptr); |
| 293 | asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len, | 297 | asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len, |
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 30b2ebee6439..e0bf210ddffd 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
| @@ -198,6 +198,7 @@ int __must_check sysfs_chmod_file(struct kobject *kobj, | |||
| 198 | const struct attribute *attr, umode_t mode); | 198 | const struct attribute *attr, umode_t mode); |
| 199 | void sysfs_remove_file_ns(struct kobject *kobj, const struct attribute *attr, | 199 | void sysfs_remove_file_ns(struct kobject *kobj, const struct attribute *attr, |
| 200 | const void *ns); | 200 | const void *ns); |
| 201 | bool sysfs_remove_file_self(struct kobject *kobj, const struct attribute *attr); | ||
| 201 | void sysfs_remove_files(struct kobject *kobj, const struct attribute **attr); | 202 | void sysfs_remove_files(struct kobject *kobj, const struct attribute **attr); |
| 202 | 203 | ||
| 203 | int __must_check sysfs_create_bin_file(struct kobject *kobj, | 204 | int __must_check sysfs_create_bin_file(struct kobject *kobj, |
| @@ -246,6 +247,11 @@ void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); | |||
| 246 | 247 | ||
| 247 | int __must_check sysfs_init(void); | 248 | int __must_check sysfs_init(void); |
| 248 | 249 | ||
| 250 | static inline void sysfs_enable_ns(struct kernfs_node *kn) | ||
| 251 | { | ||
| 252 | return kernfs_enable_ns(kn); | ||
| 253 | } | ||
| 254 | |||
| 249 | #else /* CONFIG_SYSFS */ | 255 | #else /* CONFIG_SYSFS */ |
| 250 | 256 | ||
| 251 | static inline int sysfs_schedule_callback(struct kobject *kobj, | 257 | static inline int sysfs_schedule_callback(struct kobject *kobj, |
| @@ -301,6 +307,12 @@ static inline void sysfs_remove_file_ns(struct kobject *kobj, | |||
| 301 | { | 307 | { |
| 302 | } | 308 | } |
| 303 | 309 | ||
| 310 | static inline bool sysfs_remove_file_self(struct kobject *kobj, | ||
| 311 | const struct attribute *attr) | ||
| 312 | { | ||
| 313 | return false; | ||
| 314 | } | ||
| 315 | |||
| 304 | static inline void sysfs_remove_files(struct kobject *kobj, | 316 | static inline void sysfs_remove_files(struct kobject *kobj, |
| 305 | const struct attribute **attr) | 317 | const struct attribute **attr) |
| 306 | { | 318 | { |
| @@ -418,6 +430,10 @@ static inline int __must_check sysfs_init(void) | |||
| 418 | return 0; | 430 | return 0; |
| 419 | } | 431 | } |
| 420 | 432 | ||
| 433 | static inline void sysfs_enable_ns(struct kernfs_node *kn) | ||
| 434 | { | ||
| 435 | } | ||
| 436 | |||
| 421 | #endif /* CONFIG_SYSFS */ | 437 | #endif /* CONFIG_SYSFS */ |
| 422 | 438 | ||
| 423 | static inline int __must_check sysfs_create_file(struct kobject *kobj, | 439 | static inline int __must_check sysfs_create_file(struct kobject *kobj, |
diff --git a/include/linux/torture.h b/include/linux/torture.h new file mode 100644 index 000000000000..b2e2b468e511 --- /dev/null +++ b/include/linux/torture.h | |||
| @@ -0,0 +1,100 @@ | |||
| 1 | /* | ||
| 2 | * Common functions for in-kernel torture tests. | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License as published by | ||
| 6 | * the Free Software Foundation; either version 2 of the License, or | ||
| 7 | * (at your option) any later version. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program; if not, you can access it online at | ||
| 16 | * http://www.gnu.org/licenses/gpl-2.0.html. | ||
| 17 | * | ||
| 18 | * Copyright IBM Corporation, 2014 | ||
| 19 | * | ||
| 20 | * Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com> | ||
| 21 | */ | ||
| 22 | |||
| 23 | #ifndef __LINUX_TORTURE_H | ||
| 24 | #define __LINUX_TORTURE_H | ||
| 25 | |||
| 26 | #include <linux/types.h> | ||
| 27 | #include <linux/cache.h> | ||
| 28 | #include <linux/spinlock.h> | ||
| 29 | #include <linux/threads.h> | ||
| 30 | #include <linux/cpumask.h> | ||
| 31 | #include <linux/seqlock.h> | ||
| 32 | #include <linux/lockdep.h> | ||
| 33 | #include <linux/completion.h> | ||
| 34 | #include <linux/debugobjects.h> | ||
| 35 | #include <linux/bug.h> | ||
| 36 | #include <linux/compiler.h> | ||
| 37 | |||
| 38 | /* Definitions for a non-string torture-test module parameter. */ | ||
| 39 | #define torture_param(type, name, init, msg) \ | ||
| 40 | static type name = init; \ | ||
| 41 | module_param(name, type, 0444); \ | ||
| 42 | MODULE_PARM_DESC(name, msg); | ||
| 43 | |||
| 44 | #define TORTURE_FLAG "-torture:" | ||
| 45 | #define TOROUT_STRING(s) \ | ||
| 46 | pr_alert("%s" TORTURE_FLAG s "\n", torture_type) | ||
| 47 | #define VERBOSE_TOROUT_STRING(s) \ | ||
| 48 | do { if (verbose) pr_alert("%s" TORTURE_FLAG " %s\n", torture_type, s); } while (0) | ||
| 49 | #define VERBOSE_TOROUT_ERRSTRING(s) \ | ||
| 50 | do { if (verbose) pr_alert("%s" TORTURE_FLAG "!!! %s\n", torture_type, s); } while (0) | ||
| 51 | |||
| 52 | /* Definitions for a non-string torture-test module parameter. */ | ||
| 53 | #define torture_parm(type, name, init, msg) \ | ||
| 54 | static type name = init; \ | ||
| 55 | module_param(name, type, 0444); \ | ||
| 56 | MODULE_PARM_DESC(name, msg); | ||
| 57 | |||
| 58 | /* Definitions for online/offline exerciser. */ | ||
| 59 | int torture_onoff_init(long ooholdoff, long oointerval); | ||
| 60 | char *torture_onoff_stats(char *page); | ||
| 61 | bool torture_onoff_failures(void); | ||
| 62 | |||
| 63 | /* Low-rider random number generator. */ | ||
| 64 | struct torture_random_state { | ||
| 65 | unsigned long trs_state; | ||
| 66 | long trs_count; | ||
| 67 | }; | ||
| 68 | #define DEFINE_TORTURE_RANDOM(name) struct torture_random_state name = { 0, 0 } | ||
| 69 | unsigned long torture_random(struct torture_random_state *trsp); | ||
| 70 | |||
| 71 | /* Task shuffler, which causes CPUs to occasionally go idle. */ | ||
| 72 | void torture_shuffle_task_register(struct task_struct *tp); | ||
| 73 | int torture_shuffle_init(long shuffint); | ||
| 74 | |||
| 75 | /* Test auto-shutdown handling. */ | ||
| 76 | void torture_shutdown_absorb(const char *title); | ||
| 77 | int torture_shutdown_init(int ssecs, void (*cleanup)(void)); | ||
| 78 | |||
| 79 | /* Task stuttering, which forces load/no-load transitions. */ | ||
| 80 | void stutter_wait(const char *title); | ||
| 81 | int torture_stutter_init(int s); | ||
| 82 | |||
| 83 | /* Initialization and cleanup. */ | ||
| 84 | void torture_init_begin(char *ttype, bool v, int *runnable); | ||
| 85 | void torture_init_end(void); | ||
| 86 | bool torture_cleanup(void); | ||
| 87 | bool torture_must_stop(void); | ||
| 88 | bool torture_must_stop_irq(void); | ||
| 89 | void torture_kthread_stopping(char *title); | ||
| 90 | int _torture_create_kthread(int (*fn)(void *arg), void *arg, char *s, char *m, | ||
| 91 | char *f, struct task_struct **tp); | ||
| 92 | void _torture_stop_kthread(char *m, struct task_struct **tp); | ||
| 93 | |||
| 94 | #define torture_create_kthread(n, arg, tp) \ | ||
| 95 | _torture_create_kthread(n, (arg), #n, "Creating " #n " task", \ | ||
| 96 | "Failed to create " #n, &(tp)) | ||
| 97 | #define torture_stop_kthread(n, tp) \ | ||
| 98 | _torture_stop_kthread("Stopping " #n " task", &(tp)) | ||
| 99 | |||
| 100 | #endif /* __LINUX_TORTURE_H */ | ||
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index accc497f8d72..7159a0a933df 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
| @@ -60,6 +60,12 @@ struct tp_module { | |||
| 60 | unsigned int num_tracepoints; | 60 | unsigned int num_tracepoints; |
| 61 | struct tracepoint * const *tracepoints_ptrs; | 61 | struct tracepoint * const *tracepoints_ptrs; |
| 62 | }; | 62 | }; |
| 63 | bool trace_module_has_bad_taint(struct module *mod); | ||
| 64 | #else | ||
| 65 | static inline bool trace_module_has_bad_taint(struct module *mod) | ||
| 66 | { | ||
| 67 | return false; | ||
| 68 | } | ||
| 63 | #endif /* CONFIG_MODULES */ | 69 | #endif /* CONFIG_MODULES */ |
| 64 | 70 | ||
| 65 | struct tracepoint_iter { | 71 | struct tracepoint_iter { |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 90b4fdc8a61f..b90b5c221ff0 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
| @@ -208,7 +208,7 @@ struct tty_port { | |||
| 208 | wait_queue_head_t delta_msr_wait; /* Modem status change */ | 208 | wait_queue_head_t delta_msr_wait; /* Modem status change */ |
| 209 | unsigned long flags; /* TTY flags ASY_*/ | 209 | unsigned long flags; /* TTY flags ASY_*/ |
| 210 | unsigned char console:1, /* port is a console */ | 210 | unsigned char console:1, /* port is a console */ |
| 211 | low_latency:1; /* direct buffer flush */ | 211 | low_latency:1; /* optional: tune for latency */ |
| 212 | struct mutex mutex; /* Locking */ | 212 | struct mutex mutex; /* Locking */ |
| 213 | struct mutex buf_mutex; /* Buffer alloc lock */ | 213 | struct mutex buf_mutex; /* Buffer alloc lock */ |
| 214 | unsigned char *xmit_buf; /* Optional buffer */ | 214 | unsigned char *xmit_buf; /* Optional buffer */ |
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index b8347c207cb8..add26da2faeb 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h | |||
| @@ -126,7 +126,6 @@ | |||
| 126 | 126 | ||
| 127 | #include <linux/fs.h> | 127 | #include <linux/fs.h> |
| 128 | #include <linux/wait.h> | 128 | #include <linux/wait.h> |
| 129 | #include <linux/wait.h> | ||
| 130 | 129 | ||
| 131 | 130 | ||
| 132 | /* | 131 | /* |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 7f6eb859873e..6b7ec376fb4d 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
| @@ -57,6 +57,7 @@ struct ep_device; | |||
| 57 | * @extra: descriptors following this endpoint in the configuration | 57 | * @extra: descriptors following this endpoint in the configuration |
| 58 | * @extralen: how many bytes of "extra" are valid | 58 | * @extralen: how many bytes of "extra" are valid |
| 59 | * @enabled: URBs may be submitted to this endpoint | 59 | * @enabled: URBs may be submitted to this endpoint |
| 60 | * @streams: number of USB-3 streams allocated on the endpoint | ||
| 60 | * | 61 | * |
| 61 | * USB requests are always queued to a given endpoint, identified by a | 62 | * USB requests are always queued to a given endpoint, identified by a |
| 62 | * descriptor within an active interface in a given USB configuration. | 63 | * descriptor within an active interface in a given USB configuration. |
| @@ -71,6 +72,7 @@ struct usb_host_endpoint { | |||
| 71 | unsigned char *extra; /* Extra descriptors */ | 72 | unsigned char *extra; /* Extra descriptors */ |
| 72 | int extralen; | 73 | int extralen; |
| 73 | int enabled; | 74 | int enabled; |
| 75 | int streams; | ||
| 74 | }; | 76 | }; |
| 75 | 77 | ||
| 76 | /* host-side wrapper for one interface setting's parsed descriptors */ | 78 | /* host-side wrapper for one interface setting's parsed descriptors */ |
| @@ -202,6 +204,8 @@ static inline void usb_set_intfdata(struct usb_interface *intf, void *data) | |||
| 202 | struct usb_interface *usb_get_intf(struct usb_interface *intf); | 204 | struct usb_interface *usb_get_intf(struct usb_interface *intf); |
| 203 | void usb_put_intf(struct usb_interface *intf); | 205 | void usb_put_intf(struct usb_interface *intf); |
| 204 | 206 | ||
| 207 | /* Hard limit */ | ||
| 208 | #define USB_MAXENDPOINTS 30 | ||
| 205 | /* this maximum is arbitrary */ | 209 | /* this maximum is arbitrary */ |
| 206 | #define USB_MAXINTERFACES 32 | 210 | #define USB_MAXINTERFACES 32 |
| 207 | #define USB_MAXIADS (USB_MAXINTERFACES/2) | 211 | #define USB_MAXIADS (USB_MAXINTERFACES/2) |
| @@ -366,6 +370,8 @@ struct usb_bus { | |||
| 366 | #endif | 370 | #endif |
| 367 | }; | 371 | }; |
| 368 | 372 | ||
| 373 | struct usb_dev_state; | ||
| 374 | |||
| 369 | /* ----------------------------------------------------------------------- */ | 375 | /* ----------------------------------------------------------------------- */ |
| 370 | 376 | ||
| 371 | struct usb_tt; | 377 | struct usb_tt; |
| @@ -749,6 +755,11 @@ extern struct usb_host_interface *usb_find_alt_setting( | |||
| 749 | unsigned int iface_num, | 755 | unsigned int iface_num, |
| 750 | unsigned int alt_num); | 756 | unsigned int alt_num); |
| 751 | 757 | ||
| 758 | /* port claiming functions */ | ||
| 759 | int usb_hub_claim_port(struct usb_device *hdev, unsigned port1, | ||
| 760 | struct usb_dev_state *owner); | ||
| 761 | int usb_hub_release_port(struct usb_device *hdev, unsigned port1, | ||
| 762 | struct usb_dev_state *owner); | ||
| 752 | 763 | ||
| 753 | /** | 764 | /** |
| 754 | * usb_make_path - returns stable device path in the usb tree | 765 | * usb_make_path - returns stable device path in the usb tree |
| @@ -1666,6 +1677,10 @@ extern void usb_reset_endpoint(struct usb_device *dev, unsigned int epaddr); | |||
| 1666 | /* this request isn't really synchronous, but it belongs with the others */ | 1677 | /* this request isn't really synchronous, but it belongs with the others */ |
| 1667 | extern int usb_driver_set_configuration(struct usb_device *udev, int config); | 1678 | extern int usb_driver_set_configuration(struct usb_device *udev, int config); |
| 1668 | 1679 | ||
| 1680 | /* choose and set configuration for device */ | ||
| 1681 | extern int usb_choose_configuration(struct usb_device *udev); | ||
| 1682 | extern int usb_set_configuration(struct usb_device *dev, int configuration); | ||
| 1683 | |||
| 1669 | /* | 1684 | /* |
| 1670 | * timeouts, in milliseconds, used for sending/receiving control messages | 1685 | * timeouts, in milliseconds, used for sending/receiving control messages |
| 1671 | * they typically complete within a few frames (msec) after they're issued | 1686 | * they typically complete within a few frames (msec) after they're issued |
diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h index c3fa80745996..2c14d9cdd57a 100644 --- a/include/linux/usb/cdc_ncm.h +++ b/include/linux/usb/cdc_ncm.h | |||
| @@ -88,6 +88,7 @@ | |||
| 88 | #define cdc_ncm_data_intf_is_mbim(x) ((x)->desc.bInterfaceProtocol == USB_CDC_MBIM_PROTO_NTB) | 88 | #define cdc_ncm_data_intf_is_mbim(x) ((x)->desc.bInterfaceProtocol == USB_CDC_MBIM_PROTO_NTB) |
| 89 | 89 | ||
| 90 | struct cdc_ncm_ctx { | 90 | struct cdc_ncm_ctx { |
| 91 | struct usb_cdc_ncm_ntb_parameters ncm_parm; | ||
| 91 | struct hrtimer tx_timer; | 92 | struct hrtimer tx_timer; |
| 92 | struct tasklet_struct bh; | 93 | struct tasklet_struct bh; |
| 93 | 94 | ||
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h index 708bd119627f..bbe779f640be 100644 --- a/include/linux/usb/chipidea.h +++ b/include/linux/usb/chipidea.h | |||
| @@ -25,6 +25,7 @@ struct ci_hdrc_platform_data { | |||
| 25 | */ | 25 | */ |
| 26 | #define CI_HDRC_DUAL_ROLE_NOT_OTG BIT(4) | 26 | #define CI_HDRC_DUAL_ROLE_NOT_OTG BIT(4) |
| 27 | #define CI_HDRC_IMX28_WRITE_FIX BIT(5) | 27 | #define CI_HDRC_IMX28_WRITE_FIX BIT(5) |
| 28 | #define CI_HDRC_FORCE_FULLSPEED BIT(6) | ||
| 28 | enum usb_dr_mode dr_mode; | 29 | enum usb_dr_mode dr_mode; |
| 29 | #define CI_HDRC_CONTROLLER_RESET_EVENT 0 | 30 | #define CI_HDRC_CONTROLLER_RESET_EVENT 0 |
| 30 | #define CI_HDRC_CONTROLLER_STOPPED_EVENT 1 | 31 | #define CI_HDRC_CONTROLLER_STOPPED_EVENT 1 |
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index efe8d8a7c7ad..485cd5e2100c 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
| @@ -143,6 +143,7 @@ struct usb_hcd { | |||
| 143 | unsigned authorized_default:1; | 143 | unsigned authorized_default:1; |
| 144 | unsigned has_tt:1; /* Integrated TT in root hub */ | 144 | unsigned has_tt:1; /* Integrated TT in root hub */ |
| 145 | unsigned amd_resume_bug:1; /* AMD remote wakeup quirk */ | 145 | unsigned amd_resume_bug:1; /* AMD remote wakeup quirk */ |
| 146 | unsigned can_do_streams:1; /* HC supports streams */ | ||
| 146 | 147 | ||
| 147 | unsigned int irq; /* irq allocated */ | 148 | unsigned int irq; /* irq allocated */ |
| 148 | void __iomem *regs; /* device memory/io */ | 149 | void __iomem *regs; /* device memory/io */ |
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h index 6c0b1c513db7..353053a33f21 100644 --- a/include/linux/usb/phy.h +++ b/include/linux/usb/phy.h | |||
| @@ -111,6 +111,13 @@ struct usb_phy { | |||
| 111 | int (*set_suspend)(struct usb_phy *x, | 111 | int (*set_suspend)(struct usb_phy *x, |
| 112 | int suspend); | 112 | int suspend); |
| 113 | 113 | ||
| 114 | /* | ||
| 115 | * Set wakeup enable for PHY, in that case, the PHY can be | ||
| 116 | * woken up from suspend status due to external events, | ||
| 117 | * like vbus change, dp/dm change and id. | ||
| 118 | */ | ||
| 119 | int (*set_wakeup)(struct usb_phy *x, bool enabled); | ||
| 120 | |||
| 114 | /* notify phy connect status change */ | 121 | /* notify phy connect status change */ |
| 115 | int (*notify_connect)(struct usb_phy *x, | 122 | int (*notify_connect)(struct usb_phy *x, |
| 116 | enum usb_device_speed speed); | 123 | enum usb_device_speed speed); |
| @@ -265,6 +272,15 @@ usb_phy_set_suspend(struct usb_phy *x, int suspend) | |||
| 265 | } | 272 | } |
| 266 | 273 | ||
| 267 | static inline int | 274 | static inline int |
| 275 | usb_phy_set_wakeup(struct usb_phy *x, bool enabled) | ||
| 276 | { | ||
| 277 | if (x && x->set_wakeup) | ||
| 278 | return x->set_wakeup(x, enabled); | ||
| 279 | else | ||
| 280 | return 0; | ||
| 281 | } | ||
| 282 | |||
| 283 | static inline int | ||
| 268 | usb_phy_notify_connect(struct usb_phy *x, enum usb_device_speed speed) | 284 | usb_phy_notify_connect(struct usb_phy *x, enum usb_device_speed speed) |
| 269 | { | 285 | { |
| 270 | if (x && x->notify_connect) | 286 | if (x && x->notify_connect) |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 704a1ab8240c..9bb547c7bce7 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
| @@ -190,7 +190,8 @@ static inline void usb_set_serial_data(struct usb_serial *serial, void *data) | |||
| 190 | * @num_ports: the number of different ports this device will have. | 190 | * @num_ports: the number of different ports this device will have. |
| 191 | * @bulk_in_size: minimum number of bytes to allocate for bulk-in buffer | 191 | * @bulk_in_size: minimum number of bytes to allocate for bulk-in buffer |
| 192 | * (0 = end-point size) | 192 | * (0 = end-point size) |
| 193 | * @bulk_out_size: bytes to allocate for bulk-out buffer (0 = end-point size) | 193 | * @bulk_out_size: minimum number of bytes to allocate for bulk-out buffer |
| 194 | * (0 = end-point size) | ||
| 194 | * @calc_num_ports: pointer to a function to determine how many ports this | 195 | * @calc_num_ports: pointer to a function to determine how many ports this |
| 195 | * device has dynamically. It will be called after the probe() | 196 | * device has dynamically. It will be called after the probe() |
| 196 | * callback is called, but before attach() | 197 | * callback is called, but before attach() |
diff --git a/include/linux/usb/uas.h b/include/linux/usb/uas.h index 5499ab5c94bd..3fc8e8b9f043 100644 --- a/include/linux/usb/uas.h +++ b/include/linux/usb/uas.h | |||
| @@ -9,7 +9,7 @@ struct iu { | |||
| 9 | __u8 iu_id; | 9 | __u8 iu_id; |
| 10 | __u8 rsvd1; | 10 | __u8 rsvd1; |
| 11 | __be16 tag; | 11 | __be16 tag; |
| 12 | }; | 12 | } __attribute__((__packed__)); |
| 13 | 13 | ||
| 14 | enum { | 14 | enum { |
| 15 | IU_ID_COMMAND = 0x01, | 15 | IU_ID_COMMAND = 0x01, |
| @@ -52,7 +52,7 @@ struct command_iu { | |||
| 52 | __u8 rsvd7; | 52 | __u8 rsvd7; |
| 53 | struct scsi_lun lun; | 53 | struct scsi_lun lun; |
| 54 | __u8 cdb[16]; /* XXX: Overflow-checking tools may misunderstand */ | 54 | __u8 cdb[16]; /* XXX: Overflow-checking tools may misunderstand */ |
| 55 | }; | 55 | } __attribute__((__packed__)); |
| 56 | 56 | ||
| 57 | struct task_mgmt_iu { | 57 | struct task_mgmt_iu { |
| 58 | __u8 iu_id; | 58 | __u8 iu_id; |
| @@ -62,7 +62,7 @@ struct task_mgmt_iu { | |||
| 62 | __u8 rsvd2; | 62 | __u8 rsvd2; |
| 63 | __be16 task_tag; | 63 | __be16 task_tag; |
| 64 | struct scsi_lun lun; | 64 | struct scsi_lun lun; |
| 65 | }; | 65 | } __attribute__((__packed__)); |
| 66 | 66 | ||
| 67 | /* | 67 | /* |
| 68 | * Also used for the Read Ready and Write Ready IUs since they have the | 68 | * Also used for the Read Ready and Write Ready IUs since they have the |
| @@ -77,15 +77,15 @@ struct sense_iu { | |||
| 77 | __u8 rsvd7[7]; | 77 | __u8 rsvd7[7]; |
| 78 | __be16 len; | 78 | __be16 len; |
| 79 | __u8 sense[SCSI_SENSE_BUFFERSIZE]; | 79 | __u8 sense[SCSI_SENSE_BUFFERSIZE]; |
| 80 | }; | 80 | } __attribute__((__packed__)); |
| 81 | 81 | ||
| 82 | struct response_ui { | 82 | struct response_iu { |
| 83 | __u8 iu_id; | 83 | __u8 iu_id; |
| 84 | __u8 rsvd1; | 84 | __u8 rsvd1; |
| 85 | __be16 tag; | 85 | __be16 tag; |
| 86 | __be16 add_response_info; | 86 | __u8 add_response_info[3]; |
| 87 | __u8 response_code; | 87 | __u8 response_code; |
| 88 | }; | 88 | } __attribute__((__packed__)); |
| 89 | 89 | ||
| 90 | struct usb_pipe_usage_descriptor { | 90 | struct usb_pipe_usage_descriptor { |
| 91 | __u8 bLength; | 91 | __u8 bLength; |
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index e303eef94dd5..0662e98fef72 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
| @@ -30,7 +30,7 @@ struct usbnet { | |||
| 30 | struct driver_info *driver_info; | 30 | struct driver_info *driver_info; |
| 31 | const char *driver_name; | 31 | const char *driver_name; |
| 32 | void *driver_priv; | 32 | void *driver_priv; |
| 33 | wait_queue_head_t *wait; | 33 | wait_queue_head_t wait; |
| 34 | struct mutex phy_mutex; | 34 | struct mutex phy_mutex; |
| 35 | unsigned char suspend_count; | 35 | unsigned char suspend_count; |
| 36 | unsigned char pkt_cnt, pkt_err; | 36 | unsigned char pkt_cnt, pkt_err; |
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h index 630356866030..1a64b26046ed 100644 --- a/include/linux/usb_usual.h +++ b/include/linux/usb_usual.h | |||
| @@ -67,8 +67,10 @@ | |||
| 67 | /* Initial READ(10) (and others) must be retried */ \ | 67 | /* Initial READ(10) (and others) must be retried */ \ |
| 68 | US_FLAG(WRITE_CACHE, 0x00200000) \ | 68 | US_FLAG(WRITE_CACHE, 0x00200000) \ |
| 69 | /* Write Cache status is not available */ \ | 69 | /* Write Cache status is not available */ \ |
| 70 | US_FLAG(NEEDS_CAP16, 0x00400000) | 70 | US_FLAG(NEEDS_CAP16, 0x00400000) \ |
| 71 | /* cannot handle READ_CAPACITY_10 */ | 71 | /* cannot handle READ_CAPACITY_10 */ \ |
| 72 | US_FLAG(IGNORE_UAS, 0x00800000) \ | ||
| 73 | /* Device advertises UAS but it is broken */ | ||
| 72 | 74 | ||
| 73 | #define US_FLAG(name, value) US_FL_##name = value , | 75 | #define US_FLAG(name, value) US_FL_##name = value , |
| 74 | enum { US_DO_ALL_FLAGS }; | 76 | enum { US_DO_ALL_FLAGS }; |
diff --git a/include/linux/video_output.h b/include/linux/video_output.h deleted file mode 100644 index ed5cdeb3604d..000000000000 --- a/include/linux/video_output.h +++ /dev/null | |||
| @@ -1,57 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * | ||
| 3 | * Copyright (C) 2006 Luming Yu <luming.yu@intel.com> | ||
| 4 | * | ||
| 5 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or (at | ||
| 10 | * your option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, but | ||
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 15 | * General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License along | ||
| 18 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 19 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | ||
| 20 | * | ||
| 21 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 22 | */ | ||
| 23 | #ifndef _LINUX_VIDEO_OUTPUT_H | ||
| 24 | #define _LINUX_VIDEO_OUTPUT_H | ||
| 25 | #include <linux/device.h> | ||
| 26 | #include <linux/err.h> | ||
| 27 | struct output_device; | ||
| 28 | struct output_properties { | ||
| 29 | int (*set_state)(struct output_device *); | ||
| 30 | int (*get_status)(struct output_device *); | ||
| 31 | }; | ||
| 32 | struct output_device { | ||
| 33 | int request_state; | ||
| 34 | struct output_properties *props; | ||
| 35 | struct device dev; | ||
| 36 | }; | ||
| 37 | #define to_output_device(obj) container_of(obj, struct output_device, dev) | ||
| 38 | #if defined(CONFIG_VIDEO_OUTPUT_CONTROL) || defined(CONFIG_VIDEO_OUTPUT_CONTROL_MODULE) | ||
| 39 | struct output_device *video_output_register(const char *name, | ||
| 40 | struct device *dev, | ||
| 41 | void *devdata, | ||
| 42 | struct output_properties *op); | ||
| 43 | void video_output_unregister(struct output_device *dev); | ||
| 44 | #else | ||
| 45 | static struct output_device *video_output_register(const char *name, | ||
| 46 | struct device *dev, | ||
| 47 | void *devdata, | ||
| 48 | struct output_properties *op) | ||
| 49 | { | ||
| 50 | return ERR_PTR(-ENODEV); | ||
| 51 | } | ||
| 52 | static void video_output_unregister(struct output_device *dev) | ||
| 53 | { | ||
| 54 | return; | ||
| 55 | } | ||
| 56 | #endif | ||
| 57 | #endif | ||
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 594521ba0d43..1b22c42e9c2d 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
| @@ -177,20 +177,10 @@ struct execute_work { | |||
| 177 | #define DECLARE_DEFERRABLE_WORK(n, f) \ | 177 | #define DECLARE_DEFERRABLE_WORK(n, f) \ |
| 178 | struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f, TIMER_DEFERRABLE) | 178 | struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f, TIMER_DEFERRABLE) |
| 179 | 179 | ||
| 180 | /* | ||
| 181 | * initialize a work item's function pointer | ||
| 182 | */ | ||
| 183 | #define PREPARE_WORK(_work, _func) \ | ||
| 184 | do { \ | ||
| 185 | (_work)->func = (_func); \ | ||
| 186 | } while (0) | ||
| 187 | |||
| 188 | #define PREPARE_DELAYED_WORK(_work, _func) \ | ||
| 189 | PREPARE_WORK(&(_work)->work, (_func)) | ||
| 190 | |||
| 191 | #ifdef CONFIG_DEBUG_OBJECTS_WORK | 180 | #ifdef CONFIG_DEBUG_OBJECTS_WORK |
| 192 | extern void __init_work(struct work_struct *work, int onstack); | 181 | extern void __init_work(struct work_struct *work, int onstack); |
| 193 | extern void destroy_work_on_stack(struct work_struct *work); | 182 | extern void destroy_work_on_stack(struct work_struct *work); |
| 183 | extern void destroy_delayed_work_on_stack(struct delayed_work *work); | ||
| 194 | static inline unsigned int work_static(struct work_struct *work) | 184 | static inline unsigned int work_static(struct work_struct *work) |
| 195 | { | 185 | { |
| 196 | return *work_data_bits(work) & WORK_STRUCT_STATIC; | 186 | return *work_data_bits(work) & WORK_STRUCT_STATIC; |
| @@ -198,6 +188,7 @@ static inline unsigned int work_static(struct work_struct *work) | |||
| 198 | #else | 188 | #else |
| 199 | static inline void __init_work(struct work_struct *work, int onstack) { } | 189 | static inline void __init_work(struct work_struct *work, int onstack) { } |
| 200 | static inline void destroy_work_on_stack(struct work_struct *work) { } | 190 | static inline void destroy_work_on_stack(struct work_struct *work) { } |
| 191 | static inline void destroy_delayed_work_on_stack(struct delayed_work *work) { } | ||
| 201 | static inline unsigned int work_static(struct work_struct *work) { return 0; } | 192 | static inline unsigned int work_static(struct work_struct *work) { return 0; } |
| 202 | #endif | 193 | #endif |
| 203 | 194 | ||
| @@ -217,7 +208,7 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; } | |||
| 217 | (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ | 208 | (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ |
| 218 | lockdep_init_map(&(_work)->lockdep_map, #_work, &__key, 0); \ | 209 | lockdep_init_map(&(_work)->lockdep_map, #_work, &__key, 0); \ |
| 219 | INIT_LIST_HEAD(&(_work)->entry); \ | 210 | INIT_LIST_HEAD(&(_work)->entry); \ |
| 220 | PREPARE_WORK((_work), (_func)); \ | 211 | (_work)->func = (_func); \ |
| 221 | } while (0) | 212 | } while (0) |
| 222 | #else | 213 | #else |
| 223 | #define __INIT_WORK(_work, _func, _onstack) \ | 214 | #define __INIT_WORK(_work, _func, _onstack) \ |
| @@ -225,7 +216,7 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; } | |||
| 225 | __init_work((_work), _onstack); \ | 216 | __init_work((_work), _onstack); \ |
| 226 | (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ | 217 | (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ |
| 227 | INIT_LIST_HEAD(&(_work)->entry); \ | 218 | INIT_LIST_HEAD(&(_work)->entry); \ |
| 228 | PREPARE_WORK((_work), (_func)); \ | 219 | (_work)->func = (_func); \ |
| 229 | } while (0) | 220 | } while (0) |
| 230 | #endif | 221 | #endif |
| 231 | 222 | ||
| @@ -295,17 +286,11 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; } | |||
| 295 | * Documentation/workqueue.txt. | 286 | * Documentation/workqueue.txt. |
| 296 | */ | 287 | */ |
| 297 | enum { | 288 | enum { |
| 298 | /* | ||
| 299 | * All wqs are now non-reentrant making the following flag | ||
| 300 | * meaningless. Will be removed. | ||
| 301 | */ | ||
| 302 | WQ_NON_REENTRANT = 1 << 0, /* DEPRECATED */ | ||
| 303 | |||
| 304 | WQ_UNBOUND = 1 << 1, /* not bound to any cpu */ | 289 | WQ_UNBOUND = 1 << 1, /* not bound to any cpu */ |
| 305 | WQ_FREEZABLE = 1 << 2, /* freeze during suspend */ | 290 | WQ_FREEZABLE = 1 << 2, /* freeze during suspend */ |
| 306 | WQ_MEM_RECLAIM = 1 << 3, /* may be used for memory reclaim */ | 291 | WQ_MEM_RECLAIM = 1 << 3, /* may be used for memory reclaim */ |
| 307 | WQ_HIGHPRI = 1 << 4, /* high priority */ | 292 | WQ_HIGHPRI = 1 << 4, /* high priority */ |
| 308 | WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */ | 293 | WQ_CPU_INTENSIVE = 1 << 5, /* cpu intensive workqueue */ |
| 309 | WQ_SYSFS = 1 << 6, /* visible in sysfs, see wq_sysfs_register() */ | 294 | WQ_SYSFS = 1 << 6, /* visible in sysfs, see wq_sysfs_register() */ |
| 310 | 295 | ||
| 311 | /* | 296 | /* |
| @@ -419,10 +404,7 @@ __alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active, | |||
| 419 | static struct lock_class_key __key; \ | 404 | static struct lock_class_key __key; \ |
| 420 | const char *__lock_name; \ | 405 | const char *__lock_name; \ |
| 421 | \ | 406 | \ |
| 422 | if (__builtin_constant_p(fmt)) \ | 407 | __lock_name = #fmt#args; \ |
| 423 | __lock_name = (fmt); \ | ||
| 424 | else \ | ||
| 425 | __lock_name = #fmt; \ | ||
| 426 | \ | 408 | \ |
| 427 | __alloc_workqueue_key((fmt), (flags), (max_active), \ | 409 | __alloc_workqueue_key((fmt), (flags), (max_active), \ |
| 428 | &__key, __lock_name, ##args); \ | 410 | &__key, __lock_name, ##args); \ |
| @@ -605,21 +587,6 @@ static inline bool keventd_up(void) | |||
| 605 | return system_wq != NULL; | 587 | return system_wq != NULL; |
| 606 | } | 588 | } |
| 607 | 589 | ||
| 608 | /* | ||
| 609 | * Like above, but uses del_timer() instead of del_timer_sync(). This means, | ||
| 610 | * if it returns 0 the timer function may be running and the queueing is in | ||
| 611 | * progress. | ||
| 612 | */ | ||
| 613 | static inline bool __deprecated __cancel_delayed_work(struct delayed_work *work) | ||
| 614 | { | ||
| 615 | bool ret; | ||
| 616 | |||
| 617 | ret = del_timer(&work->timer); | ||
| 618 | if (ret) | ||
| 619 | work_clear_pending(&work->work); | ||
| 620 | return ret; | ||
| 621 | } | ||
| 622 | |||
| 623 | /* used to be different but now identical to flush_work(), deprecated */ | 590 | /* used to be different but now identical to flush_work(), deprecated */ |
| 624 | static inline bool __deprecated flush_work_sync(struct work_struct *work) | 591 | static inline bool __deprecated flush_work_sync(struct work_struct *work) |
| 625 | { | 592 | { |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index fc0e4320aa6d..021b8a319b9e 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
| @@ -97,7 +97,7 @@ void writeback_inodes_sb_nr(struct super_block *, unsigned long nr, | |||
| 97 | int try_to_writeback_inodes_sb(struct super_block *, enum wb_reason reason); | 97 | int try_to_writeback_inodes_sb(struct super_block *, enum wb_reason reason); |
| 98 | int try_to_writeback_inodes_sb_nr(struct super_block *, unsigned long nr, | 98 | int try_to_writeback_inodes_sb_nr(struct super_block *, unsigned long nr, |
| 99 | enum wb_reason reason); | 99 | enum wb_reason reason); |
| 100 | void sync_inodes_sb(struct super_block *sb, unsigned long older_than_this); | 100 | void sync_inodes_sb(struct super_block *); |
| 101 | void wakeup_flusher_threads(long nr_pages, enum wb_reason reason); | 101 | void wakeup_flusher_threads(long nr_pages, enum wb_reason reason); |
| 102 | void inode_wait_for_writeback(struct inode *inode); | 102 | void inode_wait_for_writeback(struct inode *inode); |
| 103 | 103 | ||
