diff options
Diffstat (limited to 'include/linux')
129 files changed, 2782 insertions, 846 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 407a12f663eb..6bff83b1f298 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/errno.h> | 28 | #include <linux/errno.h> |
29 | #include <linux/ioport.h> /* for struct resource */ | 29 | #include <linux/ioport.h> /* for struct resource */ |
30 | #include <linux/device.h> | 30 | #include <linux/device.h> |
31 | #include <linux/property.h> | ||
31 | 32 | ||
32 | #ifndef _LINUX | 33 | #ifndef _LINUX |
33 | #define _LINUX | 34 | #define _LINUX |
@@ -123,6 +124,10 @@ int acpi_numa_init (void); | |||
123 | 124 | ||
124 | int acpi_table_init (void); | 125 | int acpi_table_init (void); |
125 | int acpi_table_parse(char *id, acpi_tbl_table_handler handler); | 126 | int acpi_table_parse(char *id, acpi_tbl_table_handler handler); |
127 | int __init acpi_parse_entries(char *id, unsigned long table_size, | ||
128 | acpi_tbl_entry_handler handler, | ||
129 | struct acpi_table_header *table_header, | ||
130 | int entry_id, unsigned int max_entries); | ||
126 | int __init acpi_table_parse_entries(char *id, unsigned long table_size, | 131 | int __init acpi_table_parse_entries(char *id, unsigned long table_size, |
127 | int entry_id, | 132 | int entry_id, |
128 | acpi_tbl_entry_handler handler, | 133 | acpi_tbl_entry_handler handler, |
@@ -423,14 +428,11 @@ extern int acpi_nvs_for_each_region(int (*func)(__u64, __u64, void *), | |||
423 | const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids, | 428 | const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids, |
424 | const struct device *dev); | 429 | const struct device *dev); |
425 | 430 | ||
426 | static inline bool acpi_driver_match_device(struct device *dev, | 431 | extern bool acpi_driver_match_device(struct device *dev, |
427 | const struct device_driver *drv) | 432 | const struct device_driver *drv); |
428 | { | ||
429 | return !!acpi_match_device(drv->acpi_match_table, dev); | ||
430 | } | ||
431 | |||
432 | int acpi_device_uevent_modalias(struct device *, struct kobj_uevent_env *); | 433 | int acpi_device_uevent_modalias(struct device *, struct kobj_uevent_env *); |
433 | int acpi_device_modalias(struct device *, char *, int); | 434 | int acpi_device_modalias(struct device *, char *, int); |
435 | void acpi_walk_dep_device_list(acpi_handle handle); | ||
434 | 436 | ||
435 | struct platform_device *acpi_create_platform_device(struct acpi_device *); | 437 | struct platform_device *acpi_create_platform_device(struct acpi_device *); |
436 | #define ACPI_PTR(_ptr) (_ptr) | 438 | #define ACPI_PTR(_ptr) (_ptr) |
@@ -443,6 +445,23 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *); | |||
443 | #define ACPI_COMPANION_SET(dev, adev) do { } while (0) | 445 | #define ACPI_COMPANION_SET(dev, adev) do { } while (0) |
444 | #define ACPI_HANDLE(dev) (NULL) | 446 | #define ACPI_HANDLE(dev) (NULL) |
445 | 447 | ||
448 | struct fwnode_handle; | ||
449 | |||
450 | static inline bool is_acpi_node(struct fwnode_handle *fwnode) | ||
451 | { | ||
452 | return false; | ||
453 | } | ||
454 | |||
455 | static inline struct acpi_device *acpi_node(struct fwnode_handle *fwnode) | ||
456 | { | ||
457 | return NULL; | ||
458 | } | ||
459 | |||
460 | static inline struct fwnode_handle *acpi_fwnode_handle(struct acpi_device *adev) | ||
461 | { | ||
462 | return NULL; | ||
463 | } | ||
464 | |||
446 | static inline const char *acpi_dev_name(struct acpi_device *adev) | 465 | static inline const char *acpi_dev_name(struct acpi_device *adev) |
447 | { | 466 | { |
448 | return NULL; | 467 | return NULL; |
@@ -553,16 +572,26 @@ static inline void arch_reserve_mem_area(acpi_physical_address addr, | |||
553 | #define acpi_os_set_prepare_sleep(func, pm1a_ctrl, pm1b_ctrl) do { } while (0) | 572 | #define acpi_os_set_prepare_sleep(func, pm1a_ctrl, pm1b_ctrl) do { } while (0) |
554 | #endif | 573 | #endif |
555 | 574 | ||
556 | #if defined(CONFIG_ACPI) && defined(CONFIG_PM_RUNTIME) | 575 | #if defined(CONFIG_ACPI) && defined(CONFIG_PM) |
557 | int acpi_dev_runtime_suspend(struct device *dev); | 576 | int acpi_dev_runtime_suspend(struct device *dev); |
558 | int acpi_dev_runtime_resume(struct device *dev); | 577 | int acpi_dev_runtime_resume(struct device *dev); |
559 | int acpi_subsys_runtime_suspend(struct device *dev); | 578 | int acpi_subsys_runtime_suspend(struct device *dev); |
560 | int acpi_subsys_runtime_resume(struct device *dev); | 579 | int acpi_subsys_runtime_resume(struct device *dev); |
580 | struct acpi_device *acpi_dev_pm_get_node(struct device *dev); | ||
581 | int acpi_dev_pm_attach(struct device *dev, bool power_on); | ||
561 | #else | 582 | #else |
562 | static inline int acpi_dev_runtime_suspend(struct device *dev) { return 0; } | 583 | static inline int acpi_dev_runtime_suspend(struct device *dev) { return 0; } |
563 | static inline int acpi_dev_runtime_resume(struct device *dev) { return 0; } | 584 | static inline int acpi_dev_runtime_resume(struct device *dev) { return 0; } |
564 | static inline int acpi_subsys_runtime_suspend(struct device *dev) { return 0; } | 585 | static inline int acpi_subsys_runtime_suspend(struct device *dev) { return 0; } |
565 | static inline int acpi_subsys_runtime_resume(struct device *dev) { return 0; } | 586 | static inline int acpi_subsys_runtime_resume(struct device *dev) { return 0; } |
587 | static inline struct acpi_device *acpi_dev_pm_get_node(struct device *dev) | ||
588 | { | ||
589 | return NULL; | ||
590 | } | ||
591 | static inline int acpi_dev_pm_attach(struct device *dev, bool power_on) | ||
592 | { | ||
593 | return -ENODEV; | ||
594 | } | ||
566 | #endif | 595 | #endif |
567 | 596 | ||
568 | #if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP) | 597 | #if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP) |
@@ -585,20 +614,6 @@ static inline int acpi_subsys_suspend(struct device *dev) { return 0; } | |||
585 | static inline int acpi_subsys_freeze(struct device *dev) { return 0; } | 614 | static inline int acpi_subsys_freeze(struct device *dev) { return 0; } |
586 | #endif | 615 | #endif |
587 | 616 | ||
588 | #if defined(CONFIG_ACPI) && defined(CONFIG_PM) | ||
589 | struct acpi_device *acpi_dev_pm_get_node(struct device *dev); | ||
590 | int acpi_dev_pm_attach(struct device *dev, bool power_on); | ||
591 | #else | ||
592 | static inline struct acpi_device *acpi_dev_pm_get_node(struct device *dev) | ||
593 | { | ||
594 | return NULL; | ||
595 | } | ||
596 | static inline int acpi_dev_pm_attach(struct device *dev, bool power_on) | ||
597 | { | ||
598 | return -ENODEV; | ||
599 | } | ||
600 | #endif | ||
601 | |||
602 | #ifdef CONFIG_ACPI | 617 | #ifdef CONFIG_ACPI |
603 | __printf(3, 4) | 618 | __printf(3, 4) |
604 | void acpi_handle_printk(const char *level, acpi_handle handle, | 619 | void acpi_handle_printk(const char *level, acpi_handle handle, |
@@ -659,4 +674,114 @@ do { \ | |||
659 | #endif | 674 | #endif |
660 | #endif | 675 | #endif |
661 | 676 | ||
677 | struct acpi_gpio_params { | ||
678 | unsigned int crs_entry_index; | ||
679 | unsigned int line_index; | ||
680 | bool active_low; | ||
681 | }; | ||
682 | |||
683 | struct acpi_gpio_mapping { | ||
684 | const char *name; | ||
685 | const struct acpi_gpio_params *data; | ||
686 | unsigned int size; | ||
687 | }; | ||
688 | |||
689 | #if defined(CONFIG_ACPI) && defined(CONFIG_GPIOLIB) | ||
690 | int acpi_dev_add_driver_gpios(struct acpi_device *adev, | ||
691 | const struct acpi_gpio_mapping *gpios); | ||
692 | |||
693 | static inline void acpi_dev_remove_driver_gpios(struct acpi_device *adev) | ||
694 | { | ||
695 | if (adev) | ||
696 | adev->driver_gpios = NULL; | ||
697 | } | ||
698 | #else | ||
699 | static inline int acpi_dev_add_driver_gpios(struct acpi_device *adev, | ||
700 | const struct acpi_gpio_mapping *gpios) | ||
701 | { | ||
702 | return -ENXIO; | ||
703 | } | ||
704 | static inline void acpi_dev_remove_driver_gpios(struct acpi_device *adev) {} | ||
705 | #endif | ||
706 | |||
707 | /* Device properties */ | ||
708 | |||
709 | #define MAX_ACPI_REFERENCE_ARGS 8 | ||
710 | struct acpi_reference_args { | ||
711 | struct acpi_device *adev; | ||
712 | size_t nargs; | ||
713 | u64 args[MAX_ACPI_REFERENCE_ARGS]; | ||
714 | }; | ||
715 | |||
716 | #ifdef CONFIG_ACPI | ||
717 | int acpi_dev_get_property(struct acpi_device *adev, const char *name, | ||
718 | acpi_object_type type, const union acpi_object **obj); | ||
719 | int acpi_dev_get_property_array(struct acpi_device *adev, const char *name, | ||
720 | acpi_object_type type, | ||
721 | const union acpi_object **obj); | ||
722 | int acpi_dev_get_property_reference(struct acpi_device *adev, | ||
723 | const char *name, size_t index, | ||
724 | struct acpi_reference_args *args); | ||
725 | |||
726 | int acpi_dev_prop_get(struct acpi_device *adev, const char *propname, | ||
727 | void **valptr); | ||
728 | int acpi_dev_prop_read_single(struct acpi_device *adev, const char *propname, | ||
729 | enum dev_prop_type proptype, void *val); | ||
730 | int acpi_dev_prop_read(struct acpi_device *adev, const char *propname, | ||
731 | enum dev_prop_type proptype, void *val, size_t nval); | ||
732 | |||
733 | struct acpi_device *acpi_get_next_child(struct device *dev, | ||
734 | struct acpi_device *child); | ||
735 | #else | ||
736 | static inline int acpi_dev_get_property(struct acpi_device *adev, | ||
737 | const char *name, acpi_object_type type, | ||
738 | const union acpi_object **obj) | ||
739 | { | ||
740 | return -ENXIO; | ||
741 | } | ||
742 | static inline int acpi_dev_get_property_array(struct acpi_device *adev, | ||
743 | const char *name, | ||
744 | acpi_object_type type, | ||
745 | const union acpi_object **obj) | ||
746 | { | ||
747 | return -ENXIO; | ||
748 | } | ||
749 | static inline int acpi_dev_get_property_reference(struct acpi_device *adev, | ||
750 | const char *name, const char *cells_name, | ||
751 | size_t index, struct acpi_reference_args *args) | ||
752 | { | ||
753 | return -ENXIO; | ||
754 | } | ||
755 | |||
756 | static inline int acpi_dev_prop_get(struct acpi_device *adev, | ||
757 | const char *propname, | ||
758 | void **valptr) | ||
759 | { | ||
760 | return -ENXIO; | ||
761 | } | ||
762 | |||
763 | static inline int acpi_dev_prop_read_single(struct acpi_device *adev, | ||
764 | const char *propname, | ||
765 | enum dev_prop_type proptype, | ||
766 | void *val) | ||
767 | { | ||
768 | return -ENXIO; | ||
769 | } | ||
770 | |||
771 | static inline int acpi_dev_prop_read(struct acpi_device *adev, | ||
772 | const char *propname, | ||
773 | enum dev_prop_type proptype, | ||
774 | void *val, size_t nval) | ||
775 | { | ||
776 | return -ENXIO; | ||
777 | } | ||
778 | |||
779 | static inline struct acpi_device *acpi_get_next_child(struct device *dev, | ||
780 | struct acpi_device *child) | ||
781 | { | ||
782 | return NULL; | ||
783 | } | ||
784 | |||
785 | #endif | ||
786 | |||
662 | #endif /*_LINUX_ACPI_H*/ | 787 | #endif /*_LINUX_ACPI_H*/ |
diff --git a/include/linux/atmel-mci.h b/include/linux/atmel-mci.h index 91b77f8d495d..9177947bf032 100644 --- a/include/linux/atmel-mci.h +++ b/include/linux/atmel-mci.h | |||
@@ -11,6 +11,7 @@ | |||
11 | * @detect_pin: GPIO pin wired to the card detect switch | 11 | * @detect_pin: GPIO pin wired to the card detect switch |
12 | * @wp_pin: GPIO pin wired to the write protect sensor | 12 | * @wp_pin: GPIO pin wired to the write protect sensor |
13 | * @detect_is_active_high: The state of the detect pin when it is active | 13 | * @detect_is_active_high: The state of the detect pin when it is active |
14 | * @non_removable: The slot is not removable, only detect once | ||
14 | * | 15 | * |
15 | * If a given slot is not present on the board, @bus_width should be | 16 | * If a given slot is not present on the board, @bus_width should be |
16 | * set to 0. The other fields are ignored in this case. | 17 | * set to 0. The other fields are ignored in this case. |
@@ -26,6 +27,7 @@ struct mci_slot_pdata { | |||
26 | int detect_pin; | 27 | int detect_pin; |
27 | int wp_pin; | 28 | int wp_pin; |
28 | bool detect_is_active_high; | 29 | bool detect_is_active_high; |
30 | bool non_removable; | ||
29 | }; | 31 | }; |
30 | 32 | ||
31 | /** | 33 | /** |
diff --git a/include/linux/audit.h b/include/linux/audit.h index e58fe7df8b9c..0c04917c2f12 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -130,6 +130,7 @@ extern void audit_putname(struct filename *name); | |||
130 | #define AUDIT_INODE_HIDDEN 2 /* audit record should be hidden */ | 130 | #define AUDIT_INODE_HIDDEN 2 /* audit record should be hidden */ |
131 | extern void __audit_inode(struct filename *name, const struct dentry *dentry, | 131 | extern void __audit_inode(struct filename *name, const struct dentry *dentry, |
132 | unsigned int flags); | 132 | unsigned int flags); |
133 | extern void __audit_file(const struct file *); | ||
133 | extern void __audit_inode_child(const struct inode *parent, | 134 | extern void __audit_inode_child(const struct inode *parent, |
134 | const struct dentry *dentry, | 135 | const struct dentry *dentry, |
135 | const unsigned char type); | 136 | const unsigned char type); |
@@ -183,6 +184,11 @@ static inline void audit_inode(struct filename *name, | |||
183 | __audit_inode(name, dentry, flags); | 184 | __audit_inode(name, dentry, flags); |
184 | } | 185 | } |
185 | } | 186 | } |
187 | static inline void audit_file(struct file *file) | ||
188 | { | ||
189 | if (unlikely(!audit_dummy_context())) | ||
190 | __audit_file(file); | ||
191 | } | ||
186 | static inline void audit_inode_parent_hidden(struct filename *name, | 192 | static inline void audit_inode_parent_hidden(struct filename *name, |
187 | const struct dentry *dentry) | 193 | const struct dentry *dentry) |
188 | { | 194 | { |
@@ -357,6 +363,9 @@ static inline void audit_inode(struct filename *name, | |||
357 | const struct dentry *dentry, | 363 | const struct dentry *dentry, |
358 | unsigned int parent) | 364 | unsigned int parent) |
359 | { } | 365 | { } |
366 | static inline void audit_file(struct file *file) | ||
367 | { | ||
368 | } | ||
360 | static inline void audit_inode_parent_hidden(struct filename *name, | 369 | static inline void audit_inode_parent_hidden(struct filename *name, |
361 | const struct dentry *dentry) | 370 | const struct dentry *dentry) |
362 | { } | 371 | { } |
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index c9be1589415a..15f7034aa377 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h | |||
@@ -167,6 +167,23 @@ struct request *blk_mq_alloc_request(struct request_queue *q, int rw, | |||
167 | gfp_t gfp, bool reserved); | 167 | gfp_t gfp, bool reserved); |
168 | struct request *blk_mq_tag_to_rq(struct blk_mq_tags *tags, unsigned int tag); | 168 | struct request *blk_mq_tag_to_rq(struct blk_mq_tags *tags, unsigned int tag); |
169 | 169 | ||
170 | enum { | ||
171 | BLK_MQ_UNIQUE_TAG_BITS = 16, | ||
172 | BLK_MQ_UNIQUE_TAG_MASK = (1 << BLK_MQ_UNIQUE_TAG_BITS) - 1, | ||
173 | }; | ||
174 | |||
175 | u32 blk_mq_unique_tag(struct request *rq); | ||
176 | |||
177 | static inline u16 blk_mq_unique_tag_to_hwq(u32 unique_tag) | ||
178 | { | ||
179 | return unique_tag >> BLK_MQ_UNIQUE_TAG_BITS; | ||
180 | } | ||
181 | |||
182 | static inline u16 blk_mq_unique_tag_to_tag(u32 unique_tag) | ||
183 | { | ||
184 | return unique_tag & BLK_MQ_UNIQUE_TAG_MASK; | ||
185 | } | ||
186 | |||
170 | struct blk_mq_hw_ctx *blk_mq_map_queue(struct request_queue *, const int ctx_index); | 187 | struct blk_mq_hw_ctx *blk_mq_map_queue(struct request_queue *, const int ctx_index); |
171 | struct blk_mq_hw_ctx *blk_mq_alloc_single_hw_queue(struct blk_mq_tag_set *, unsigned int, int); | 188 | struct blk_mq_hw_ctx *blk_mq_alloc_single_hw_queue(struct blk_mq_tag_set *, unsigned int, int); |
172 | 189 | ||
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index aac0f9ea952a..0495e3854247 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -398,7 +398,7 @@ struct request_queue { | |||
398 | */ | 398 | */ |
399 | struct kobject mq_kobj; | 399 | struct kobject mq_kobj; |
400 | 400 | ||
401 | #ifdef CONFIG_PM_RUNTIME | 401 | #ifdef CONFIG_PM |
402 | struct device *dev; | 402 | struct device *dev; |
403 | int rpm_status; | 403 | int rpm_status; |
404 | unsigned int nr_pending; | 404 | unsigned int nr_pending; |
@@ -1057,7 +1057,7 @@ extern void blk_put_queue(struct request_queue *); | |||
1057 | /* | 1057 | /* |
1058 | * block layer runtime pm functions | 1058 | * block layer runtime pm functions |
1059 | */ | 1059 | */ |
1060 | #ifdef CONFIG_PM_RUNTIME | 1060 | #ifdef CONFIG_PM |
1061 | extern void blk_pm_runtime_init(struct request_queue *q, struct device *dev); | 1061 | extern void blk_pm_runtime_init(struct request_queue *q, struct device *dev); |
1062 | extern int blk_pre_runtime_suspend(struct request_queue *q); | 1062 | extern int blk_pre_runtime_suspend(struct request_queue *q); |
1063 | extern void blk_post_runtime_suspend(struct request_queue *q, int err); | 1063 | extern void blk_post_runtime_suspend(struct request_queue *q, int err); |
@@ -1136,7 +1136,6 @@ static inline bool blk_needs_flush_plug(struct task_struct *tsk) | |||
1136 | /* | 1136 | /* |
1137 | * tag stuff | 1137 | * tag stuff |
1138 | */ | 1138 | */ |
1139 | #define blk_rq_tagged(rq) ((rq)->cmd_flags & REQ_QUEUED) | ||
1140 | extern int blk_queue_start_tag(struct request_queue *, struct request *); | 1139 | extern int blk_queue_start_tag(struct request_queue *, struct request *); |
1141 | extern struct request *blk_queue_find_tag(struct request_queue *, int); | 1140 | extern struct request *blk_queue_find_tag(struct request_queue *, int); |
1142 | extern void blk_queue_end_tag(struct request_queue *, struct request *); | 1141 | extern void blk_queue_end_tag(struct request_queue *, struct request *); |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 1d5196889048..641e56494a92 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -113,6 +113,19 @@ static inline void css_get(struct cgroup_subsys_state *css) | |||
113 | } | 113 | } |
114 | 114 | ||
115 | /** | 115 | /** |
116 | * css_get_many - obtain references on the specified css | ||
117 | * @css: target css | ||
118 | * @n: number of references to get | ||
119 | * | ||
120 | * The caller must already have a reference. | ||
121 | */ | ||
122 | static inline void css_get_many(struct cgroup_subsys_state *css, unsigned int n) | ||
123 | { | ||
124 | if (!(css->flags & CSS_NO_REF)) | ||
125 | percpu_ref_get_many(&css->refcnt, n); | ||
126 | } | ||
127 | |||
128 | /** | ||
116 | * css_tryget - try to obtain a reference on the specified css | 129 | * css_tryget - try to obtain a reference on the specified css |
117 | * @css: target css | 130 | * @css: target css |
118 | * | 131 | * |
@@ -159,6 +172,19 @@ static inline void css_put(struct cgroup_subsys_state *css) | |||
159 | percpu_ref_put(&css->refcnt); | 172 | percpu_ref_put(&css->refcnt); |
160 | } | 173 | } |
161 | 174 | ||
175 | /** | ||
176 | * css_put_many - put css references | ||
177 | * @css: target css | ||
178 | * @n: number of references to put | ||
179 | * | ||
180 | * Put references obtained via css_get() and css_tryget_online(). | ||
181 | */ | ||
182 | static inline void css_put_many(struct cgroup_subsys_state *css, unsigned int n) | ||
183 | { | ||
184 | if (!(css->flags & CSS_NO_REF)) | ||
185 | percpu_ref_put_many(&css->refcnt, n); | ||
186 | } | ||
187 | |||
162 | /* bits in struct cgroup flags field */ | 188 | /* bits in struct cgroup flags field */ |
163 | enum { | 189 | enum { |
164 | /* Control Group requires release notifications to userspace */ | 190 | /* Control Group requires release notifications to userspace */ |
@@ -367,8 +393,8 @@ struct css_set { | |||
367 | * struct cftype: handler definitions for cgroup control files | 393 | * struct cftype: handler definitions for cgroup control files |
368 | * | 394 | * |
369 | * When reading/writing to a file: | 395 | * When reading/writing to a file: |
370 | * - the cgroup to use is file->f_dentry->d_parent->d_fsdata | 396 | * - the cgroup to use is file->f_path.dentry->d_parent->d_fsdata |
371 | * - the 'cftype' of the file is file->f_dentry->d_fsdata | 397 | * - the 'cftype' of the file is file->f_path.dentry->d_fsdata |
372 | */ | 398 | */ |
373 | 399 | ||
374 | /* cftype->flags */ | 400 | /* cftype->flags */ |
diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h index f75acbf70e96..74e5341463c9 100644 --- a/include/linux/clk/ti.h +++ b/include/linux/clk/ti.h | |||
@@ -254,13 +254,26 @@ extern const struct clk_ops ti_clk_mux_ops; | |||
254 | void omap2_init_clk_hw_omap_clocks(struct clk *clk); | 254 | void omap2_init_clk_hw_omap_clocks(struct clk *clk); |
255 | int omap3_noncore_dpll_enable(struct clk_hw *hw); | 255 | int omap3_noncore_dpll_enable(struct clk_hw *hw); |
256 | void omap3_noncore_dpll_disable(struct clk_hw *hw); | 256 | void omap3_noncore_dpll_disable(struct clk_hw *hw); |
257 | int omap3_noncore_dpll_set_parent(struct clk_hw *hw, u8 index); | ||
257 | int omap3_noncore_dpll_set_rate(struct clk_hw *hw, unsigned long rate, | 258 | int omap3_noncore_dpll_set_rate(struct clk_hw *hw, unsigned long rate, |
258 | unsigned long parent_rate); | 259 | unsigned long parent_rate); |
260 | int omap3_noncore_dpll_set_rate_and_parent(struct clk_hw *hw, | ||
261 | unsigned long rate, | ||
262 | unsigned long parent_rate, | ||
263 | u8 index); | ||
264 | long omap3_noncore_dpll_determine_rate(struct clk_hw *hw, | ||
265 | unsigned long rate, | ||
266 | unsigned long *best_parent_rate, | ||
267 | struct clk **best_parent_clk); | ||
259 | unsigned long omap4_dpll_regm4xen_recalc(struct clk_hw *hw, | 268 | unsigned long omap4_dpll_regm4xen_recalc(struct clk_hw *hw, |
260 | unsigned long parent_rate); | 269 | unsigned long parent_rate); |
261 | long omap4_dpll_regm4xen_round_rate(struct clk_hw *hw, | 270 | long omap4_dpll_regm4xen_round_rate(struct clk_hw *hw, |
262 | unsigned long target_rate, | 271 | unsigned long target_rate, |
263 | unsigned long *parent_rate); | 272 | unsigned long *parent_rate); |
273 | long omap4_dpll_regm4xen_determine_rate(struct clk_hw *hw, | ||
274 | unsigned long rate, | ||
275 | unsigned long *best_parent_rate, | ||
276 | struct clk **best_parent_clk); | ||
264 | u8 omap2_init_dpll_parent(struct clk_hw *hw); | 277 | u8 omap2_init_dpll_parent(struct clk_hw *hw); |
265 | unsigned long omap3_dpll_recalc(struct clk_hw *hw, unsigned long parent_rate); | 278 | unsigned long omap3_dpll_recalc(struct clk_hw *hw, unsigned long parent_rate); |
266 | long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate, | 279 | long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate, |
@@ -278,6 +291,8 @@ int omap2_clk_disable_autoidle_all(void); | |||
278 | void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks); | 291 | void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks); |
279 | int omap3_dpll4_set_rate(struct clk_hw *clk, unsigned long rate, | 292 | int omap3_dpll4_set_rate(struct clk_hw *clk, unsigned long rate, |
280 | unsigned long parent_rate); | 293 | unsigned long parent_rate); |
294 | int omap3_dpll4_set_rate_and_parent(struct clk_hw *hw, unsigned long rate, | ||
295 | unsigned long parent_rate, u8 index); | ||
281 | int omap2_dflt_clk_enable(struct clk_hw *hw); | 296 | int omap2_dflt_clk_enable(struct clk_hw *hw); |
282 | void omap2_dflt_clk_disable(struct clk_hw *hw); | 297 | void omap2_dflt_clk_disable(struct clk_hw *hw); |
283 | int omap2_dflt_clk_is_enabled(struct clk_hw *hw); | 298 | int omap2_dflt_clk_is_enabled(struct clk_hw *hw); |
diff --git a/include/linux/compaction.h b/include/linux/compaction.h index 60bdf8dc02a3..3238ffa33f68 100644 --- a/include/linux/compaction.h +++ b/include/linux/compaction.h | |||
@@ -33,10 +33,11 @@ extern int fragmentation_index(struct zone *zone, unsigned int order); | |||
33 | extern unsigned long try_to_compact_pages(struct zonelist *zonelist, | 33 | extern unsigned long try_to_compact_pages(struct zonelist *zonelist, |
34 | int order, gfp_t gfp_mask, nodemask_t *mask, | 34 | int order, gfp_t gfp_mask, nodemask_t *mask, |
35 | enum migrate_mode mode, int *contended, | 35 | enum migrate_mode mode, int *contended, |
36 | struct zone **candidate_zone); | 36 | int alloc_flags, int classzone_idx); |
37 | extern void compact_pgdat(pg_data_t *pgdat, int order); | 37 | extern void compact_pgdat(pg_data_t *pgdat, int order); |
38 | extern void reset_isolation_suitable(pg_data_t *pgdat); | 38 | extern void reset_isolation_suitable(pg_data_t *pgdat); |
39 | extern unsigned long compaction_suitable(struct zone *zone, int order); | 39 | extern unsigned long compaction_suitable(struct zone *zone, int order, |
40 | int alloc_flags, int classzone_idx); | ||
40 | 41 | ||
41 | /* Do not skip compaction more than 64 times */ | 42 | /* Do not skip compaction more than 64 times */ |
42 | #define COMPACT_MAX_DEFER_SHIFT 6 | 43 | #define COMPACT_MAX_DEFER_SHIFT 6 |
@@ -103,7 +104,7 @@ static inline bool compaction_restarting(struct zone *zone, int order) | |||
103 | static inline unsigned long try_to_compact_pages(struct zonelist *zonelist, | 104 | static inline unsigned long try_to_compact_pages(struct zonelist *zonelist, |
104 | int order, gfp_t gfp_mask, nodemask_t *nodemask, | 105 | int order, gfp_t gfp_mask, nodemask_t *nodemask, |
105 | enum migrate_mode mode, int *contended, | 106 | enum migrate_mode mode, int *contended, |
106 | struct zone **candidate_zone) | 107 | int alloc_flags, int classzone_idx) |
107 | { | 108 | { |
108 | return COMPACT_CONTINUE; | 109 | return COMPACT_CONTINUE; |
109 | } | 110 | } |
@@ -116,7 +117,8 @@ static inline void reset_isolation_suitable(pg_data_t *pgdat) | |||
116 | { | 117 | { |
117 | } | 118 | } |
118 | 119 | ||
119 | static inline unsigned long compaction_suitable(struct zone *zone, int order) | 120 | static inline unsigned long compaction_suitable(struct zone *zone, int order, |
121 | int alloc_flags, int classzone_idx) | ||
120 | { | 122 | { |
121 | return COMPACT_SKIPPED; | 123 | return COMPACT_SKIPPED; |
122 | } | 124 | } |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 503b085b7832..4d078cebafd2 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -217,26 +217,26 @@ __ATTR(_name, 0644, show_##_name, store_##_name) | |||
217 | 217 | ||
218 | 218 | ||
219 | struct cpufreq_driver { | 219 | struct cpufreq_driver { |
220 | char name[CPUFREQ_NAME_LEN]; | 220 | char name[CPUFREQ_NAME_LEN]; |
221 | u8 flags; | 221 | u8 flags; |
222 | void *driver_data; | 222 | void *driver_data; |
223 | 223 | ||
224 | /* needed by all drivers */ | 224 | /* needed by all drivers */ |
225 | int (*init) (struct cpufreq_policy *policy); | 225 | int (*init)(struct cpufreq_policy *policy); |
226 | int (*verify) (struct cpufreq_policy *policy); | 226 | int (*verify)(struct cpufreq_policy *policy); |
227 | 227 | ||
228 | /* define one out of two */ | 228 | /* define one out of two */ |
229 | int (*setpolicy) (struct cpufreq_policy *policy); | 229 | int (*setpolicy)(struct cpufreq_policy *policy); |
230 | 230 | ||
231 | /* | 231 | /* |
232 | * On failure, should always restore frequency to policy->restore_freq | 232 | * On failure, should always restore frequency to policy->restore_freq |
233 | * (i.e. old freq). | 233 | * (i.e. old freq). |
234 | */ | 234 | */ |
235 | int (*target) (struct cpufreq_policy *policy, /* Deprecated */ | 235 | int (*target)(struct cpufreq_policy *policy, |
236 | unsigned int target_freq, | 236 | unsigned int target_freq, |
237 | unsigned int relation); | 237 | unsigned int relation); /* Deprecated */ |
238 | int (*target_index) (struct cpufreq_policy *policy, | 238 | int (*target_index)(struct cpufreq_policy *policy, |
239 | unsigned int index); | 239 | unsigned int index); |
240 | /* | 240 | /* |
241 | * Only for drivers with target_index() and CPUFREQ_ASYNC_NOTIFICATION | 241 | * Only for drivers with target_index() and CPUFREQ_ASYNC_NOTIFICATION |
242 | * unset. | 242 | * unset. |
@@ -252,27 +252,31 @@ struct cpufreq_driver { | |||
252 | * wish to switch to intermediate frequency for some target frequency. | 252 | * wish to switch to intermediate frequency for some target frequency. |
253 | * In that case core will directly call ->target_index(). | 253 | * In that case core will directly call ->target_index(). |
254 | */ | 254 | */ |
255 | unsigned int (*get_intermediate)(struct cpufreq_policy *policy, | 255 | unsigned int (*get_intermediate)(struct cpufreq_policy *policy, |
256 | unsigned int index); | 256 | unsigned int index); |
257 | int (*target_intermediate)(struct cpufreq_policy *policy, | 257 | int (*target_intermediate)(struct cpufreq_policy *policy, |
258 | unsigned int index); | 258 | unsigned int index); |
259 | 259 | ||
260 | /* should be defined, if possible */ | 260 | /* should be defined, if possible */ |
261 | unsigned int (*get) (unsigned int cpu); | 261 | unsigned int (*get)(unsigned int cpu); |
262 | 262 | ||
263 | /* optional */ | 263 | /* optional */ |
264 | int (*bios_limit) (int cpu, unsigned int *limit); | 264 | int (*bios_limit)(int cpu, unsigned int *limit); |
265 | |||
266 | int (*exit)(struct cpufreq_policy *policy); | ||
267 | void (*stop_cpu)(struct cpufreq_policy *policy); | ||
268 | int (*suspend)(struct cpufreq_policy *policy); | ||
269 | int (*resume)(struct cpufreq_policy *policy); | ||
270 | |||
271 | /* Will be called after the driver is fully initialized */ | ||
272 | void (*ready)(struct cpufreq_policy *policy); | ||
265 | 273 | ||
266 | int (*exit) (struct cpufreq_policy *policy); | 274 | struct freq_attr **attr; |
267 | void (*stop_cpu) (struct cpufreq_policy *policy); | ||
268 | int (*suspend) (struct cpufreq_policy *policy); | ||
269 | int (*resume) (struct cpufreq_policy *policy); | ||
270 | struct freq_attr **attr; | ||
271 | 275 | ||
272 | /* platform specific boost support code */ | 276 | /* platform specific boost support code */ |
273 | bool boost_supported; | 277 | bool boost_supported; |
274 | bool boost_enabled; | 278 | bool boost_enabled; |
275 | int (*set_boost) (int state); | 279 | int (*set_boost)(int state); |
276 | }; | 280 | }; |
277 | 281 | ||
278 | /* flags */ | 282 | /* flags */ |
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 25e0df6155a4..a07e087f54b2 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h | |||
@@ -53,7 +53,7 @@ struct cpuidle_state { | |||
53 | }; | 53 | }; |
54 | 54 | ||
55 | /* Idle State Flags */ | 55 | /* Idle State Flags */ |
56 | #define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */ | 56 | #define CPUIDLE_FLAG_TIME_INVALID (0x01) /* is residency time measurable? */ |
57 | #define CPUIDLE_FLAG_COUPLED (0x02) /* state applies to multiple cpus */ | 57 | #define CPUIDLE_FLAG_COUPLED (0x02) /* state applies to multiple cpus */ |
58 | #define CPUIDLE_FLAG_TIMER_STOP (0x04) /* timer is stopped on this state */ | 58 | #define CPUIDLE_FLAG_TIMER_STOP (0x04) /* timer is stopped on this state */ |
59 | 59 | ||
@@ -90,7 +90,7 @@ DECLARE_PER_CPU(struct cpuidle_device, cpuidle_dev); | |||
90 | * cpuidle_get_last_residency - retrieves the last state's residency time | 90 | * cpuidle_get_last_residency - retrieves the last state's residency time |
91 | * @dev: the target CPU | 91 | * @dev: the target CPU |
92 | * | 92 | * |
93 | * NOTE: this value is invalid if CPUIDLE_FLAG_TIME_VALID isn't set | 93 | * NOTE: this value is invalid if CPUIDLE_FLAG_TIME_INVALID is set |
94 | */ | 94 | */ |
95 | static inline int cpuidle_get_last_residency(struct cpuidle_device *dev) | 95 | static inline int cpuidle_get_last_residency(struct cpuidle_device *dev) |
96 | { | 96 | { |
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index b2a2a08523bf..5a813988e6d4 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
@@ -124,15 +124,15 @@ struct dentry { | |||
124 | void *d_fsdata; /* fs-specific data */ | 124 | void *d_fsdata; /* fs-specific data */ |
125 | 125 | ||
126 | struct list_head d_lru; /* LRU list */ | 126 | struct list_head d_lru; /* LRU list */ |
127 | struct list_head d_child; /* child of parent list */ | ||
128 | struct list_head d_subdirs; /* our children */ | ||
127 | /* | 129 | /* |
128 | * d_child and d_rcu can share memory | 130 | * d_alias and d_rcu can share memory |
129 | */ | 131 | */ |
130 | union { | 132 | union { |
131 | struct list_head d_child; /* child of parent list */ | 133 | struct hlist_node d_alias; /* inode alias list */ |
132 | struct rcu_head d_rcu; | 134 | struct rcu_head d_rcu; |
133 | } d_u; | 135 | } d_u; |
134 | struct list_head d_subdirs; /* our children */ | ||
135 | struct hlist_node d_alias; /* inode alias list */ | ||
136 | }; | 136 | }; |
137 | 137 | ||
138 | /* | 138 | /* |
@@ -230,7 +230,6 @@ extern seqlock_t rename_lock; | |||
230 | */ | 230 | */ |
231 | extern void d_instantiate(struct dentry *, struct inode *); | 231 | extern void d_instantiate(struct dentry *, struct inode *); |
232 | extern struct dentry * d_instantiate_unique(struct dentry *, struct inode *); | 232 | extern struct dentry * d_instantiate_unique(struct dentry *, struct inode *); |
233 | extern struct dentry * d_materialise_unique(struct dentry *, struct inode *); | ||
234 | extern int d_instantiate_no_diralias(struct dentry *, struct inode *); | 233 | extern int d_instantiate_no_diralias(struct dentry *, struct inode *); |
235 | extern void __d_drop(struct dentry *dentry); | 234 | extern void __d_drop(struct dentry *dentry); |
236 | extern void d_drop(struct dentry *dentry); | 235 | extern void d_drop(struct dentry *dentry); |
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index 4d0b4d1aa132..d84f8c254a87 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h | |||
@@ -92,8 +92,8 @@ struct dentry *debugfs_create_regset32(const char *name, umode_t mode, | |||
92 | struct dentry *parent, | 92 | struct dentry *parent, |
93 | struct debugfs_regset32 *regset); | 93 | struct debugfs_regset32 *regset); |
94 | 94 | ||
95 | int debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs, | 95 | void debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs, |
96 | int nregs, void __iomem *base, char *prefix); | 96 | int nregs, void __iomem *base, char *prefix); |
97 | 97 | ||
98 | struct dentry *debugfs_create_u32_array(const char *name, umode_t mode, | 98 | struct dentry *debugfs_create_u32_array(const char *name, umode_t mode, |
99 | struct dentry *parent, | 99 | struct dentry *parent, |
@@ -233,10 +233,9 @@ static inline struct dentry *debugfs_create_regset32(const char *name, | |||
233 | return ERR_PTR(-ENODEV); | 233 | return ERR_PTR(-ENODEV); |
234 | } | 234 | } |
235 | 235 | ||
236 | static inline int debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs, | 236 | static inline void debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs, |
237 | int nregs, void __iomem *base, char *prefix) | 237 | int nregs, void __iomem *base, char *prefix) |
238 | { | 238 | { |
239 | return 0; | ||
240 | } | 239 | } |
241 | 240 | ||
242 | static inline bool debugfs_initialized(void) | 241 | static inline bool debugfs_initialized(void) |
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index e1707de043ae..ca6d2acc5eb7 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -64,6 +64,7 @@ typedef int (*dm_request_endio_fn) (struct dm_target *ti, | |||
64 | union map_info *map_context); | 64 | union map_info *map_context); |
65 | 65 | ||
66 | typedef void (*dm_presuspend_fn) (struct dm_target *ti); | 66 | typedef void (*dm_presuspend_fn) (struct dm_target *ti); |
67 | typedef void (*dm_presuspend_undo_fn) (struct dm_target *ti); | ||
67 | typedef void (*dm_postsuspend_fn) (struct dm_target *ti); | 68 | typedef void (*dm_postsuspend_fn) (struct dm_target *ti); |
68 | typedef int (*dm_preresume_fn) (struct dm_target *ti); | 69 | typedef int (*dm_preresume_fn) (struct dm_target *ti); |
69 | typedef void (*dm_resume_fn) (struct dm_target *ti); | 70 | typedef void (*dm_resume_fn) (struct dm_target *ti); |
@@ -145,6 +146,7 @@ struct target_type { | |||
145 | dm_endio_fn end_io; | 146 | dm_endio_fn end_io; |
146 | dm_request_endio_fn rq_end_io; | 147 | dm_request_endio_fn rq_end_io; |
147 | dm_presuspend_fn presuspend; | 148 | dm_presuspend_fn presuspend; |
149 | dm_presuspend_undo_fn presuspend_undo; | ||
148 | dm_postsuspend_fn postsuspend; | 150 | dm_postsuspend_fn postsuspend; |
149 | dm_preresume_fn preresume; | 151 | dm_preresume_fn preresume; |
150 | dm_resume_fn resume; | 152 | dm_resume_fn resume; |
diff --git a/include/linux/edac.h b/include/linux/edac.h index e1e68da6f35c..da3b72e95db3 100644 --- a/include/linux/edac.h +++ b/include/linux/edac.h | |||
@@ -194,7 +194,8 @@ static inline char *mc_event_error_type(const unsigned int err_type) | |||
194 | * @MEM_DDR3: DDR3 RAM | 194 | * @MEM_DDR3: DDR3 RAM |
195 | * @MEM_RDDR3: Registered DDR3 RAM | 195 | * @MEM_RDDR3: Registered DDR3 RAM |
196 | * This is a variant of the DDR3 memories. | 196 | * This is a variant of the DDR3 memories. |
197 | * @MEM_DDR4: DDR4 RAM | 197 | * @MEM_LRDDR3 Load-Reduced DDR3 memory. |
198 | * @MEM_DDR4: Unbuffered DDR4 RAM | ||
198 | * @MEM_RDDR4: Registered DDR4 RAM | 199 | * @MEM_RDDR4: Registered DDR4 RAM |
199 | * This is a variant of the DDR4 memories. | 200 | * This is a variant of the DDR4 memories. |
200 | */ | 201 | */ |
@@ -216,6 +217,7 @@ enum mem_type { | |||
216 | MEM_XDR, | 217 | MEM_XDR, |
217 | MEM_DDR3, | 218 | MEM_DDR3, |
218 | MEM_RDDR3, | 219 | MEM_RDDR3, |
220 | MEM_LRDDR3, | ||
219 | MEM_DDR4, | 221 | MEM_DDR4, |
220 | MEM_RDDR4, | 222 | MEM_RDDR4, |
221 | }; | 223 | }; |
diff --git a/include/linux/eeprom_93cx6.h b/include/linux/eeprom_93cx6.h index e50f98b0297a..eb0b1988050a 100644 --- a/include/linux/eeprom_93cx6.h +++ b/include/linux/eeprom_93cx6.h | |||
@@ -75,6 +75,10 @@ extern void eeprom_93cx6_read(struct eeprom_93cx6 *eeprom, | |||
75 | const u8 word, u16 *data); | 75 | const u8 word, u16 *data); |
76 | extern void eeprom_93cx6_multiread(struct eeprom_93cx6 *eeprom, | 76 | extern void eeprom_93cx6_multiread(struct eeprom_93cx6 *eeprom, |
77 | const u8 word, __le16 *data, const u16 words); | 77 | const u8 word, __le16 *data, const u16 words); |
78 | extern void eeprom_93cx6_readb(struct eeprom_93cx6 *eeprom, | ||
79 | const u8 byte, u8 *data); | ||
80 | extern void eeprom_93cx6_multireadb(struct eeprom_93cx6 *eeprom, | ||
81 | const u8 byte, u8 *data, const u16 bytes); | ||
78 | 82 | ||
79 | extern void eeprom_93cx6_wren(struct eeprom_93cx6 *eeprom, bool enable); | 83 | extern void eeprom_93cx6_wren(struct eeprom_93cx6 *eeprom, bool enable); |
80 | 84 | ||
diff --git a/include/linux/efi.h b/include/linux/efi.h index 0949f9c7e872..0238d612750e 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
@@ -547,6 +547,9 @@ void efi_native_runtime_setup(void); | |||
547 | #define SMBIOS_TABLE_GUID \ | 547 | #define SMBIOS_TABLE_GUID \ |
548 | EFI_GUID( 0xeb9d2d31, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d ) | 548 | EFI_GUID( 0xeb9d2d31, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d ) |
549 | 549 | ||
550 | #define SMBIOS3_TABLE_GUID \ | ||
551 | EFI_GUID( 0xf2fd1544, 0x9794, 0x4a2c, 0x99, 0x2e, 0xe5, 0xbb, 0xcf, 0x20, 0xe3, 0x94 ) | ||
552 | |||
550 | #define SAL_SYSTEM_TABLE_GUID \ | 553 | #define SAL_SYSTEM_TABLE_GUID \ |
551 | EFI_GUID( 0xeb9d2d32, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d ) | 554 | EFI_GUID( 0xeb9d2d32, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d ) |
552 | 555 | ||
@@ -810,7 +813,8 @@ extern struct efi { | |||
810 | unsigned long mps; /* MPS table */ | 813 | unsigned long mps; /* MPS table */ |
811 | unsigned long acpi; /* ACPI table (IA64 ext 0.71) */ | 814 | unsigned long acpi; /* ACPI table (IA64 ext 0.71) */ |
812 | unsigned long acpi20; /* ACPI table (ACPI 2.0) */ | 815 | unsigned long acpi20; /* ACPI table (ACPI 2.0) */ |
813 | unsigned long smbios; /* SM BIOS table */ | 816 | unsigned long smbios; /* SMBIOS table (32 bit entry point) */ |
817 | unsigned long smbios3; /* SMBIOS table (64 bit entry point) */ | ||
814 | unsigned long sal_systab; /* SAL system table */ | 818 | unsigned long sal_systab; /* SAL system table */ |
815 | unsigned long boot_info; /* boot info table */ | 819 | unsigned long boot_info; /* boot info table */ |
816 | unsigned long hcdp; /* HCDP table */ | 820 | unsigned long hcdp; /* HCDP table */ |
diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h index 860313a33a43..87f14e90e984 100644 --- a/include/linux/f2fs_fs.h +++ b/include/linux/f2fs_fs.h | |||
@@ -33,7 +33,8 @@ | |||
33 | #define F2FS_META_INO(sbi) (sbi->meta_ino_num) | 33 | #define F2FS_META_INO(sbi) (sbi->meta_ino_num) |
34 | 34 | ||
35 | /* This flag is used by node and meta inodes, and by recovery */ | 35 | /* This flag is used by node and meta inodes, and by recovery */ |
36 | #define GFP_F2FS_ZERO (GFP_NOFS | __GFP_ZERO) | 36 | #define GFP_F2FS_ZERO (GFP_NOFS | __GFP_ZERO) |
37 | #define GFP_F2FS_HIGH_ZERO (GFP_NOFS | __GFP_ZERO | __GFP_HIGHMEM) | ||
37 | 38 | ||
38 | /* | 39 | /* |
39 | * For further optimization on multi-head logs, on-disk layout supports maximum | 40 | * For further optimization on multi-head logs, on-disk layout supports maximum |
@@ -170,14 +171,12 @@ struct f2fs_extent { | |||
170 | 171 | ||
171 | #define F2FS_INLINE_XATTR 0x01 /* file inline xattr flag */ | 172 | #define F2FS_INLINE_XATTR 0x01 /* file inline xattr flag */ |
172 | #define F2FS_INLINE_DATA 0x02 /* file inline data flag */ | 173 | #define F2FS_INLINE_DATA 0x02 /* file inline data flag */ |
174 | #define F2FS_INLINE_DENTRY 0x04 /* file inline dentry flag */ | ||
175 | #define F2FS_DATA_EXIST 0x08 /* file inline data exist flag */ | ||
173 | 176 | ||
174 | #define MAX_INLINE_DATA (sizeof(__le32) * (DEF_ADDRS_PER_INODE - \ | 177 | #define MAX_INLINE_DATA (sizeof(__le32) * (DEF_ADDRS_PER_INODE - \ |
175 | F2FS_INLINE_XATTR_ADDRS - 1)) | 178 | F2FS_INLINE_XATTR_ADDRS - 1)) |
176 | 179 | ||
177 | #define INLINE_DATA_OFFSET (PAGE_CACHE_SIZE - sizeof(struct node_footer) -\ | ||
178 | sizeof(__le32) * (DEF_ADDRS_PER_INODE + \ | ||
179 | DEF_NIDS_PER_INODE - 1)) | ||
180 | |||
181 | struct f2fs_inode { | 180 | struct f2fs_inode { |
182 | __le16 i_mode; /* file mode */ | 181 | __le16 i_mode; /* file mode */ |
183 | __u8 i_advise; /* file hints */ | 182 | __u8 i_advise; /* file hints */ |
@@ -435,6 +434,24 @@ struct f2fs_dentry_block { | |||
435 | __u8 filename[NR_DENTRY_IN_BLOCK][F2FS_SLOT_LEN]; | 434 | __u8 filename[NR_DENTRY_IN_BLOCK][F2FS_SLOT_LEN]; |
436 | } __packed; | 435 | } __packed; |
437 | 436 | ||
437 | /* for inline dir */ | ||
438 | #define NR_INLINE_DENTRY (MAX_INLINE_DATA * BITS_PER_BYTE / \ | ||
439 | ((SIZE_OF_DIR_ENTRY + F2FS_SLOT_LEN) * \ | ||
440 | BITS_PER_BYTE + 1)) | ||
441 | #define INLINE_DENTRY_BITMAP_SIZE ((NR_INLINE_DENTRY + \ | ||
442 | BITS_PER_BYTE - 1) / BITS_PER_BYTE) | ||
443 | #define INLINE_RESERVED_SIZE (MAX_INLINE_DATA - \ | ||
444 | ((SIZE_OF_DIR_ENTRY + F2FS_SLOT_LEN) * \ | ||
445 | NR_INLINE_DENTRY + INLINE_DENTRY_BITMAP_SIZE)) | ||
446 | |||
447 | /* inline directory entry structure */ | ||
448 | struct f2fs_inline_dentry { | ||
449 | __u8 dentry_bitmap[INLINE_DENTRY_BITMAP_SIZE]; | ||
450 | __u8 reserved[INLINE_RESERVED_SIZE]; | ||
451 | struct f2fs_dir_entry dentry[NR_INLINE_DENTRY]; | ||
452 | __u8 filename[NR_INLINE_DENTRY][F2FS_SLOT_LEN]; | ||
453 | } __packed; | ||
454 | |||
438 | /* file types used in inode_info->flags */ | 455 | /* file types used in inode_info->flags */ |
439 | enum { | 456 | enum { |
440 | F2FS_FT_UNKNOWN, | 457 | F2FS_FT_UNKNOWN, |
diff --git a/include/linux/file.h b/include/linux/file.h index 4d69123377a2..f87d30882a24 100644 --- a/include/linux/file.h +++ b/include/linux/file.h | |||
@@ -66,7 +66,6 @@ extern void set_close_on_exec(unsigned int fd, int flag); | |||
66 | extern bool get_close_on_exec(unsigned int fd); | 66 | extern bool get_close_on_exec(unsigned int fd); |
67 | extern void put_filp(struct file *); | 67 | extern void put_filp(struct file *); |
68 | extern int get_unused_fd_flags(unsigned flags); | 68 | extern int get_unused_fd_flags(unsigned flags); |
69 | #define get_unused_fd() get_unused_fd_flags(0) | ||
70 | extern void put_unused_fd(unsigned int fd); | 69 | extern void put_unused_fd(unsigned int fd); |
71 | 70 | ||
72 | extern void fd_install(unsigned int fd, struct file *file); | 71 | extern void fd_install(unsigned int fd, struct file *file); |
diff --git a/include/linux/freezer.h b/include/linux/freezer.h index 7fd81b8c4897..6b7fd9cf5ea2 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h | |||
@@ -246,15 +246,6 @@ static inline int freezable_schedule_hrtimeout_range(ktime_t *expires, | |||
246 | * defined in <linux/wait.h> | 246 | * defined in <linux/wait.h> |
247 | */ | 247 | */ |
248 | 248 | ||
249 | #define wait_event_freezekillable(wq, condition) \ | ||
250 | ({ \ | ||
251 | int __retval; \ | ||
252 | freezer_do_not_count(); \ | ||
253 | __retval = wait_event_killable(wq, (condition)); \ | ||
254 | freezer_count(); \ | ||
255 | __retval; \ | ||
256 | }) | ||
257 | |||
258 | /* DO NOT ADD ANY NEW CALLERS OF THIS FUNCTION */ | 249 | /* DO NOT ADD ANY NEW CALLERS OF THIS FUNCTION */ |
259 | #define wait_event_freezekillable_unsafe(wq, condition) \ | 250 | #define wait_event_freezekillable_unsafe(wq, condition) \ |
260 | ({ \ | 251 | ({ \ |
@@ -265,35 +256,6 @@ static inline int freezable_schedule_hrtimeout_range(ktime_t *expires, | |||
265 | __retval; \ | 256 | __retval; \ |
266 | }) | 257 | }) |
267 | 258 | ||
268 | #define wait_event_freezable(wq, condition) \ | ||
269 | ({ \ | ||
270 | int __retval; \ | ||
271 | freezer_do_not_count(); \ | ||
272 | __retval = wait_event_interruptible(wq, (condition)); \ | ||
273 | freezer_count(); \ | ||
274 | __retval; \ | ||
275 | }) | ||
276 | |||
277 | #define wait_event_freezable_timeout(wq, condition, timeout) \ | ||
278 | ({ \ | ||
279 | long __retval = timeout; \ | ||
280 | freezer_do_not_count(); \ | ||
281 | __retval = wait_event_interruptible_timeout(wq, (condition), \ | ||
282 | __retval); \ | ||
283 | freezer_count(); \ | ||
284 | __retval; \ | ||
285 | }) | ||
286 | |||
287 | #define wait_event_freezable_exclusive(wq, condition) \ | ||
288 | ({ \ | ||
289 | int __retval; \ | ||
290 | freezer_do_not_count(); \ | ||
291 | __retval = wait_event_interruptible_exclusive(wq, condition); \ | ||
292 | freezer_count(); \ | ||
293 | __retval; \ | ||
294 | }) | ||
295 | |||
296 | |||
297 | #else /* !CONFIG_FREEZER */ | 259 | #else /* !CONFIG_FREEZER */ |
298 | static inline bool frozen(struct task_struct *p) { return false; } | 260 | static inline bool frozen(struct task_struct *p) { return false; } |
299 | static inline bool freezing(struct task_struct *p) { return false; } | 261 | static inline bool freezing(struct task_struct *p) { return false; } |
@@ -331,18 +293,6 @@ static inline void set_freezable(void) {} | |||
331 | #define freezable_schedule_hrtimeout_range(expires, delta, mode) \ | 293 | #define freezable_schedule_hrtimeout_range(expires, delta, mode) \ |
332 | schedule_hrtimeout_range(expires, delta, mode) | 294 | schedule_hrtimeout_range(expires, delta, mode) |
333 | 295 | ||
334 | #define wait_event_freezable(wq, condition) \ | ||
335 | wait_event_interruptible(wq, condition) | ||
336 | |||
337 | #define wait_event_freezable_timeout(wq, condition, timeout) \ | ||
338 | wait_event_interruptible_timeout(wq, condition, timeout) | ||
339 | |||
340 | #define wait_event_freezable_exclusive(wq, condition) \ | ||
341 | wait_event_interruptible_exclusive(wq, condition) | ||
342 | |||
343 | #define wait_event_freezekillable(wq, condition) \ | ||
344 | wait_event_killable(wq, condition) | ||
345 | |||
346 | #define wait_event_freezekillable_unsafe(wq, condition) \ | 296 | #define wait_event_freezekillable_unsafe(wq, condition) \ |
347 | wait_event_killable(wq, condition) | 297 | wait_event_killable(wq, condition) |
348 | 298 | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index 9ab779e8a63c..bb29b02d9bb6 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -606,9 +606,6 @@ struct inode { | |||
606 | const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ | 606 | const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ |
607 | struct file_lock *i_flock; | 607 | struct file_lock *i_flock; |
608 | struct address_space i_data; | 608 | struct address_space i_data; |
609 | #ifdef CONFIG_QUOTA | ||
610 | struct dquot *i_dquot[MAXQUOTAS]; | ||
611 | #endif | ||
612 | struct list_head i_devices; | 609 | struct list_head i_devices; |
613 | union { | 610 | union { |
614 | struct pipe_inode_info *i_pipe; | 611 | struct pipe_inode_info *i_pipe; |
@@ -789,7 +786,6 @@ struct file { | |||
789 | struct rcu_head fu_rcuhead; | 786 | struct rcu_head fu_rcuhead; |
790 | } f_u; | 787 | } f_u; |
791 | struct path f_path; | 788 | struct path f_path; |
792 | #define f_dentry f_path.dentry | ||
793 | struct inode *f_inode; /* cached value */ | 789 | struct inode *f_inode; /* cached value */ |
794 | const struct file_operations *f_op; | 790 | const struct file_operations *f_op; |
795 | 791 | ||
@@ -1224,6 +1220,7 @@ struct super_block { | |||
1224 | struct backing_dev_info *s_bdi; | 1220 | struct backing_dev_info *s_bdi; |
1225 | struct mtd_info *s_mtd; | 1221 | struct mtd_info *s_mtd; |
1226 | struct hlist_node s_instances; | 1222 | struct hlist_node s_instances; |
1223 | unsigned int s_quota_types; /* Bitmask of supported quota types */ | ||
1227 | struct quota_info s_dquot; /* Diskquota specific options */ | 1224 | struct quota_info s_dquot; /* Diskquota specific options */ |
1228 | 1225 | ||
1229 | struct sb_writers s_writers; | 1226 | struct sb_writers s_writers; |
@@ -1467,7 +1464,10 @@ int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags); | |||
1467 | * This allows the kernel to read directories into kernel space or | 1464 | * This allows the kernel to read directories into kernel space or |
1468 | * to have different dirent layouts depending on the binary type. | 1465 | * to have different dirent layouts depending on the binary type. |
1469 | */ | 1466 | */ |
1470 | typedef int (*filldir_t)(void *, const char *, int, loff_t, u64, unsigned); | 1467 | struct dir_context; |
1468 | typedef int (*filldir_t)(struct dir_context *, const char *, int, loff_t, u64, | ||
1469 | unsigned); | ||
1470 | |||
1471 | struct dir_context { | 1471 | struct dir_context { |
1472 | const filldir_t actor; | 1472 | const filldir_t actor; |
1473 | loff_t pos; | 1473 | loff_t pos; |
@@ -1513,7 +1513,7 @@ struct file_operations { | |||
1513 | int (*setlease)(struct file *, long, struct file_lock **, void **); | 1513 | int (*setlease)(struct file *, long, struct file_lock **, void **); |
1514 | long (*fallocate)(struct file *file, int mode, loff_t offset, | 1514 | long (*fallocate)(struct file *file, int mode, loff_t offset, |
1515 | loff_t len); | 1515 | loff_t len); |
1516 | int (*show_fdinfo)(struct seq_file *m, struct file *f); | 1516 | void (*show_fdinfo)(struct seq_file *m, struct file *f); |
1517 | }; | 1517 | }; |
1518 | 1518 | ||
1519 | struct inode_operations { | 1519 | struct inode_operations { |
@@ -1577,7 +1577,9 @@ struct super_operations { | |||
1577 | void (*evict_inode) (struct inode *); | 1577 | void (*evict_inode) (struct inode *); |
1578 | void (*put_super) (struct super_block *); | 1578 | void (*put_super) (struct super_block *); |
1579 | int (*sync_fs)(struct super_block *sb, int wait); | 1579 | int (*sync_fs)(struct super_block *sb, int wait); |
1580 | int (*freeze_super) (struct super_block *); | ||
1580 | int (*freeze_fs) (struct super_block *); | 1581 | int (*freeze_fs) (struct super_block *); |
1582 | int (*thaw_super) (struct super_block *); | ||
1581 | int (*unfreeze_fs) (struct super_block *); | 1583 | int (*unfreeze_fs) (struct super_block *); |
1582 | int (*statfs) (struct dentry *, struct kstatfs *); | 1584 | int (*statfs) (struct dentry *, struct kstatfs *); |
1583 | int (*remount_fs) (struct super_block *, int *, char *); | 1585 | int (*remount_fs) (struct super_block *, int *, char *); |
@@ -1590,6 +1592,7 @@ struct super_operations { | |||
1590 | #ifdef CONFIG_QUOTA | 1592 | #ifdef CONFIG_QUOTA |
1591 | ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); | 1593 | ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); |
1592 | ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); | 1594 | ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); |
1595 | struct dquot **(*get_dquots)(struct inode *); | ||
1593 | #endif | 1596 | #endif |
1594 | int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t); | 1597 | int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t); |
1595 | long (*nr_cached_objects)(struct super_block *, int); | 1598 | long (*nr_cached_objects)(struct super_block *, int); |
@@ -2786,6 +2789,11 @@ static inline void inode_has_no_xattr(struct inode *inode) | |||
2786 | inode->i_flags |= S_NOSEC; | 2789 | inode->i_flags |= S_NOSEC; |
2787 | } | 2790 | } |
2788 | 2791 | ||
2792 | static inline bool is_root_inode(struct inode *inode) | ||
2793 | { | ||
2794 | return inode == inode->i_sb->s_root->d_inode; | ||
2795 | } | ||
2796 | |||
2789 | static inline bool dir_emit(struct dir_context *ctx, | 2797 | static inline bool dir_emit(struct dir_context *ctx, |
2790 | const char *name, int namelen, | 2798 | const char *name, int namelen, |
2791 | u64 ino, unsigned type) | 2799 | u64 ino, unsigned type) |
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 662697babd48..ed501953f0b2 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -61,6 +61,11 @@ ftrace_func_t ftrace_ops_get_func(struct ftrace_ops *ops); | |||
61 | /* | 61 | /* |
62 | * FTRACE_OPS_FL_* bits denote the state of ftrace_ops struct and are | 62 | * FTRACE_OPS_FL_* bits denote the state of ftrace_ops struct and are |
63 | * set in the flags member. | 63 | * set in the flags member. |
64 | * CONTROL, SAVE_REGS, SAVE_REGS_IF_SUPPORTED, RECURSION_SAFE, STUB and | ||
65 | * IPMODIFY are a kind of attribute flags which can be set only before | ||
66 | * registering the ftrace_ops, and can not be modified while registered. | ||
67 | * Changing those attribute flags after regsitering ftrace_ops will | ||
68 | * cause unexpected results. | ||
64 | * | 69 | * |
65 | * ENABLED - set/unset when ftrace_ops is registered/unregistered | 70 | * ENABLED - set/unset when ftrace_ops is registered/unregistered |
66 | * DYNAMIC - set when ftrace_ops is registered to denote dynamically | 71 | * DYNAMIC - set when ftrace_ops is registered to denote dynamically |
@@ -94,6 +99,17 @@ ftrace_func_t ftrace_ops_get_func(struct ftrace_ops *ops); | |||
94 | * ADDING - The ops is in the process of being added. | 99 | * ADDING - The ops is in the process of being added. |
95 | * REMOVING - The ops is in the process of being removed. | 100 | * REMOVING - The ops is in the process of being removed. |
96 | * MODIFYING - The ops is in the process of changing its filter functions. | 101 | * MODIFYING - The ops is in the process of changing its filter functions. |
102 | * ALLOC_TRAMP - A dynamic trampoline was allocated by the core code. | ||
103 | * The arch specific code sets this flag when it allocated a | ||
104 | * trampoline. This lets the arch know that it can update the | ||
105 | * trampoline in case the callback function changes. | ||
106 | * The ftrace_ops trampoline can be set by the ftrace users, and | ||
107 | * in such cases the arch must not modify it. Only the arch ftrace | ||
108 | * core code should set this flag. | ||
109 | * IPMODIFY - The ops can modify the IP register. This can only be set with | ||
110 | * SAVE_REGS. If another ops with this flag set is already registered | ||
111 | * for any of the functions that this ops will be registered for, then | ||
112 | * this ops will fail to register or set_filter_ip. | ||
97 | */ | 113 | */ |
98 | enum { | 114 | enum { |
99 | FTRACE_OPS_FL_ENABLED = 1 << 0, | 115 | FTRACE_OPS_FL_ENABLED = 1 << 0, |
@@ -108,6 +124,8 @@ enum { | |||
108 | FTRACE_OPS_FL_ADDING = 1 << 9, | 124 | FTRACE_OPS_FL_ADDING = 1 << 9, |
109 | FTRACE_OPS_FL_REMOVING = 1 << 10, | 125 | FTRACE_OPS_FL_REMOVING = 1 << 10, |
110 | FTRACE_OPS_FL_MODIFYING = 1 << 11, | 126 | FTRACE_OPS_FL_MODIFYING = 1 << 11, |
127 | FTRACE_OPS_FL_ALLOC_TRAMP = 1 << 12, | ||
128 | FTRACE_OPS_FL_IPMODIFY = 1 << 13, | ||
111 | }; | 129 | }; |
112 | 130 | ||
113 | #ifdef CONFIG_DYNAMIC_FTRACE | 131 | #ifdef CONFIG_DYNAMIC_FTRACE |
@@ -142,6 +160,7 @@ struct ftrace_ops { | |||
142 | struct ftrace_ops_hash *func_hash; | 160 | struct ftrace_ops_hash *func_hash; |
143 | struct ftrace_ops_hash old_hash; | 161 | struct ftrace_ops_hash old_hash; |
144 | unsigned long trampoline; | 162 | unsigned long trampoline; |
163 | unsigned long trampoline_size; | ||
145 | #endif | 164 | #endif |
146 | }; | 165 | }; |
147 | 166 | ||
@@ -255,7 +274,9 @@ struct ftrace_func_command { | |||
255 | int ftrace_arch_code_modify_prepare(void); | 274 | int ftrace_arch_code_modify_prepare(void); |
256 | int ftrace_arch_code_modify_post_process(void); | 275 | int ftrace_arch_code_modify_post_process(void); |
257 | 276 | ||
258 | void ftrace_bug(int err, unsigned long ip); | 277 | struct dyn_ftrace; |
278 | |||
279 | void ftrace_bug(int err, struct dyn_ftrace *rec); | ||
259 | 280 | ||
260 | struct seq_file; | 281 | struct seq_file; |
261 | 282 | ||
@@ -287,6 +308,8 @@ extern int ftrace_text_reserved(const void *start, const void *end); | |||
287 | 308 | ||
288 | extern int ftrace_nr_registered_ops(void); | 309 | extern int ftrace_nr_registered_ops(void); |
289 | 310 | ||
311 | bool is_ftrace_trampoline(unsigned long addr); | ||
312 | |||
290 | /* | 313 | /* |
291 | * The dyn_ftrace record's flags field is split into two parts. | 314 | * The dyn_ftrace record's flags field is split into two parts. |
292 | * the first part which is '0-FTRACE_REF_MAX' is a counter of | 315 | * the first part which is '0-FTRACE_REF_MAX' is a counter of |
@@ -297,6 +320,7 @@ extern int ftrace_nr_registered_ops(void); | |||
297 | * ENABLED - the function is being traced | 320 | * ENABLED - the function is being traced |
298 | * REGS - the record wants the function to save regs | 321 | * REGS - the record wants the function to save regs |
299 | * REGS_EN - the function is set up to save regs. | 322 | * REGS_EN - the function is set up to save regs. |
323 | * IPMODIFY - the record allows for the IP address to be changed. | ||
300 | * | 324 | * |
301 | * When a new ftrace_ops is registered and wants a function to save | 325 | * When a new ftrace_ops is registered and wants a function to save |
302 | * pt_regs, the rec->flag REGS is set. When the function has been | 326 | * pt_regs, the rec->flag REGS is set. When the function has been |
@@ -310,10 +334,11 @@ enum { | |||
310 | FTRACE_FL_REGS_EN = (1UL << 29), | 334 | FTRACE_FL_REGS_EN = (1UL << 29), |
311 | FTRACE_FL_TRAMP = (1UL << 28), | 335 | FTRACE_FL_TRAMP = (1UL << 28), |
312 | FTRACE_FL_TRAMP_EN = (1UL << 27), | 336 | FTRACE_FL_TRAMP_EN = (1UL << 27), |
337 | FTRACE_FL_IPMODIFY = (1UL << 26), | ||
313 | }; | 338 | }; |
314 | 339 | ||
315 | #define FTRACE_REF_MAX_SHIFT 27 | 340 | #define FTRACE_REF_MAX_SHIFT 26 |
316 | #define FTRACE_FL_BITS 5 | 341 | #define FTRACE_FL_BITS 6 |
317 | #define FTRACE_FL_MASKED_BITS ((1UL << FTRACE_FL_BITS) - 1) | 342 | #define FTRACE_FL_MASKED_BITS ((1UL << FTRACE_FL_BITS) - 1) |
318 | #define FTRACE_FL_MASK (FTRACE_FL_MASKED_BITS << FTRACE_REF_MAX_SHIFT) | 343 | #define FTRACE_FL_MASK (FTRACE_FL_MASKED_BITS << FTRACE_REF_MAX_SHIFT) |
319 | #define FTRACE_REF_MAX ((1UL << FTRACE_REF_MAX_SHIFT) - 1) | 344 | #define FTRACE_REF_MAX ((1UL << FTRACE_REF_MAX_SHIFT) - 1) |
@@ -586,6 +611,11 @@ static inline ssize_t ftrace_notrace_write(struct file *file, const char __user | |||
586 | size_t cnt, loff_t *ppos) { return -ENODEV; } | 611 | size_t cnt, loff_t *ppos) { return -ENODEV; } |
587 | static inline int | 612 | static inline int |
588 | ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; } | 613 | ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; } |
614 | |||
615 | static inline bool is_ftrace_trampoline(unsigned long addr) | ||
616 | { | ||
617 | return false; | ||
618 | } | ||
589 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 619 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
590 | 620 | ||
591 | /* totally disable ftrace - can not re-enable after this */ | 621 | /* totally disable ftrace - can not re-enable after this */ |
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 28672e87e910..0bebb5c348b8 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -138,6 +138,17 @@ enum print_line_t { | |||
138 | TRACE_TYPE_NO_CONSUME = 3 /* Handled but ask to not consume */ | 138 | TRACE_TYPE_NO_CONSUME = 3 /* Handled but ask to not consume */ |
139 | }; | 139 | }; |
140 | 140 | ||
141 | /* | ||
142 | * Several functions return TRACE_TYPE_PARTIAL_LINE if the trace_seq | ||
143 | * overflowed, and TRACE_TYPE_HANDLED otherwise. This helper function | ||
144 | * simplifies those functions and keeps them in sync. | ||
145 | */ | ||
146 | static inline enum print_line_t trace_handle_return(struct trace_seq *s) | ||
147 | { | ||
148 | return trace_seq_has_overflowed(s) ? | ||
149 | TRACE_TYPE_PARTIAL_LINE : TRACE_TYPE_HANDLED; | ||
150 | } | ||
151 | |||
141 | void tracing_generic_entry_update(struct trace_entry *entry, | 152 | void tracing_generic_entry_update(struct trace_entry *entry, |
142 | unsigned long flags, | 153 | unsigned long flags, |
143 | int pc); | 154 | int pc); |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 41b30fd4d041..07d2699cdb51 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -381,8 +381,8 @@ extern void free_kmem_pages(unsigned long addr, unsigned int order); | |||
381 | 381 | ||
382 | void page_alloc_init(void); | 382 | void page_alloc_init(void); |
383 | void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp); | 383 | void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp); |
384 | void drain_all_pages(void); | 384 | void drain_all_pages(struct zone *zone); |
385 | void drain_local_pages(void *dummy); | 385 | void drain_local_pages(struct zone *zone); |
386 | 386 | ||
387 | /* | 387 | /* |
388 | * gfp_allowed_mask is set to GFP_BOOT_MASK during early boot to restrict what | 388 | * gfp_allowed_mask is set to GFP_BOOT_MASK during early boot to restrict what |
diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h index 12f146fa6604..00b1b70d68ba 100644 --- a/include/linux/gpio/consumer.h +++ b/include/linux/gpio/consumer.h | |||
@@ -94,6 +94,13 @@ int gpiod_to_irq(const struct gpio_desc *desc); | |||
94 | struct gpio_desc *gpio_to_desc(unsigned gpio); | 94 | struct gpio_desc *gpio_to_desc(unsigned gpio); |
95 | int desc_to_gpio(const struct gpio_desc *desc); | 95 | int desc_to_gpio(const struct gpio_desc *desc); |
96 | 96 | ||
97 | /* Child properties interface */ | ||
98 | struct fwnode_handle; | ||
99 | |||
100 | struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode, | ||
101 | const char *propname); | ||
102 | struct gpio_desc *devm_get_gpiod_from_child(struct device *dev, | ||
103 | struct fwnode_handle *child); | ||
97 | #else /* CONFIG_GPIOLIB */ | 104 | #else /* CONFIG_GPIOLIB */ |
98 | 105 | ||
99 | static inline struct gpio_desc *__must_check __gpiod_get(struct device *dev, | 106 | static inline struct gpio_desc *__must_check __gpiod_get(struct device *dev, |
diff --git a/include/linux/gpio_keys.h b/include/linux/gpio_keys.h index 8b622468952c..ee2d8c6f9130 100644 --- a/include/linux/gpio_keys.h +++ b/include/linux/gpio_keys.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _GPIO_KEYS_H | 2 | #define _GPIO_KEYS_H |
3 | 3 | ||
4 | struct device; | 4 | struct device; |
5 | struct gpio_desc; | ||
5 | 6 | ||
6 | /** | 7 | /** |
7 | * struct gpio_keys_button - configuration parameters | 8 | * struct gpio_keys_button - configuration parameters |
@@ -17,6 +18,7 @@ struct device; | |||
17 | * disable button via sysfs | 18 | * disable button via sysfs |
18 | * @value: axis value for %EV_ABS | 19 | * @value: axis value for %EV_ABS |
19 | * @irq: Irq number in case of interrupt keys | 20 | * @irq: Irq number in case of interrupt keys |
21 | * @gpiod: GPIO descriptor | ||
20 | */ | 22 | */ |
21 | struct gpio_keys_button { | 23 | struct gpio_keys_button { |
22 | unsigned int code; | 24 | unsigned int code; |
@@ -29,6 +31,7 @@ struct gpio_keys_button { | |||
29 | bool can_disable; | 31 | bool can_disable; |
30 | int value; | 32 | int value; |
31 | unsigned int irq; | 33 | unsigned int irq; |
34 | struct gpio_desc *gpiod; | ||
32 | }; | 35 | }; |
33 | 36 | ||
34 | /** | 37 | /** |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 6e6d338641fe..cdd149ca5cc0 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -311,7 +311,8 @@ static inline struct hstate *hstate_sizelog(int page_size_log) | |||
311 | { | 311 | { |
312 | if (!page_size_log) | 312 | if (!page_size_log) |
313 | return &default_hstate; | 313 | return &default_hstate; |
314 | return size_to_hstate(1 << page_size_log); | 314 | |
315 | return size_to_hstate(1UL << page_size_log); | ||
315 | } | 316 | } |
316 | 317 | ||
317 | static inline struct hstate *hstate_vma(struct vm_area_struct *vma) | 318 | static inline struct hstate *hstate_vma(struct vm_area_struct *vma) |
diff --git a/include/linux/hugetlb_cgroup.h b/include/linux/hugetlb_cgroup.h index 0129f89cf98d..bcc853eccc85 100644 --- a/include/linux/hugetlb_cgroup.h +++ b/include/linux/hugetlb_cgroup.h | |||
@@ -16,7 +16,6 @@ | |||
16 | #define _LINUX_HUGETLB_CGROUP_H | 16 | #define _LINUX_HUGETLB_CGROUP_H |
17 | 17 | ||
18 | #include <linux/mmdebug.h> | 18 | #include <linux/mmdebug.h> |
19 | #include <linux/res_counter.h> | ||
20 | 19 | ||
21 | struct hugetlb_cgroup; | 20 | struct hugetlb_cgroup; |
22 | /* | 21 | /* |
diff --git a/include/linux/i2c/pmbus.h b/include/linux/i2c/pmbus.h index 69280db02c41..ee3c2aba2a8e 100644 --- a/include/linux/i2c/pmbus.h +++ b/include/linux/i2c/pmbus.h | |||
@@ -40,6 +40,10 @@ | |||
40 | 40 | ||
41 | struct pmbus_platform_data { | 41 | struct pmbus_platform_data { |
42 | u32 flags; /* Device specific flags */ | 42 | u32 flags; /* Device specific flags */ |
43 | |||
44 | /* regulator support */ | ||
45 | int num_regulators; | ||
46 | struct regulator_init_data *reg_init_data; | ||
43 | }; | 47 | }; |
44 | 48 | ||
45 | #endif /* _PMBUS_H_ */ | 49 | #endif /* _PMBUS_H_ */ |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 77fc43f8fb72..3037fc085e8e 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -102,7 +102,7 @@ extern struct group_info init_groups; | |||
102 | #define INIT_IDS | 102 | #define INIT_IDS |
103 | #endif | 103 | #endif |
104 | 104 | ||
105 | #ifdef CONFIG_TREE_PREEMPT_RCU | 105 | #ifdef CONFIG_PREEMPT_RCU |
106 | #define INIT_TASK_RCU_TREE_PREEMPT() \ | 106 | #define INIT_TASK_RCU_TREE_PREEMPT() \ |
107 | .rcu_blocked_node = NULL, | 107 | .rcu_blocked_node = NULL, |
108 | #else | 108 | #else |
@@ -166,6 +166,15 @@ extern struct task_group root_task_group; | |||
166 | # define INIT_RT_MUTEXES(tsk) | 166 | # define INIT_RT_MUTEXES(tsk) |
167 | #endif | 167 | #endif |
168 | 168 | ||
169 | #ifdef CONFIG_NUMA_BALANCING | ||
170 | # define INIT_NUMA_BALANCING(tsk) \ | ||
171 | .numa_preferred_nid = -1, \ | ||
172 | .numa_group = NULL, \ | ||
173 | .numa_faults = NULL, | ||
174 | #else | ||
175 | # define INIT_NUMA_BALANCING(tsk) | ||
176 | #endif | ||
177 | |||
169 | /* | 178 | /* |
170 | * INIT_TASK is used to set up the first task table, touch at | 179 | * INIT_TASK is used to set up the first task table, touch at |
171 | * your own risk!. Base=0, limit=0x1fffff (=2MB) | 180 | * your own risk!. Base=0, limit=0x1fffff (=2MB) |
@@ -237,6 +246,7 @@ extern struct task_group root_task_group; | |||
237 | INIT_CPUSET_SEQ(tsk) \ | 246 | INIT_CPUSET_SEQ(tsk) \ |
238 | INIT_RT_MUTEXES(tsk) \ | 247 | INIT_RT_MUTEXES(tsk) \ |
239 | INIT_VTIME(tsk) \ | 248 | INIT_VTIME(tsk) \ |
249 | INIT_NUMA_BALANCING(tsk) \ | ||
240 | } | 250 | } |
241 | 251 | ||
242 | 252 | ||
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index e6a7c9ff72f2..b29a5982e1c3 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/errno.h> | 22 | #include <linux/errno.h> |
23 | #include <linux/err.h> | 23 | #include <linux/err.h> |
24 | #include <linux/types.h> | 24 | #include <linux/types.h> |
25 | #include <linux/scatterlist.h> | ||
25 | #include <trace/events/iommu.h> | 26 | #include <trace/events/iommu.h> |
26 | 27 | ||
27 | #define IOMMU_READ (1 << 0) | 28 | #define IOMMU_READ (1 << 0) |
@@ -97,6 +98,8 @@ enum iommu_attr { | |||
97 | * @detach_dev: detach device from an iommu domain | 98 | * @detach_dev: detach device from an iommu domain |
98 | * @map: map a physically contiguous memory region to an iommu domain | 99 | * @map: map a physically contiguous memory region to an iommu domain |
99 | * @unmap: unmap a physically contiguous memory region from an iommu domain | 100 | * @unmap: unmap a physically contiguous memory region from an iommu domain |
101 | * @map_sg: map a scatter-gather list of physically contiguous memory chunks | ||
102 | * to an iommu domain | ||
100 | * @iova_to_phys: translate iova to physical address | 103 | * @iova_to_phys: translate iova to physical address |
101 | * @add_device: add device to iommu grouping | 104 | * @add_device: add device to iommu grouping |
102 | * @remove_device: remove device from iommu grouping | 105 | * @remove_device: remove device from iommu grouping |
@@ -114,6 +117,8 @@ struct iommu_ops { | |||
114 | phys_addr_t paddr, size_t size, int prot); | 117 | phys_addr_t paddr, size_t size, int prot); |
115 | size_t (*unmap)(struct iommu_domain *domain, unsigned long iova, | 118 | size_t (*unmap)(struct iommu_domain *domain, unsigned long iova, |
116 | size_t size); | 119 | size_t size); |
120 | size_t (*map_sg)(struct iommu_domain *domain, unsigned long iova, | ||
121 | struct scatterlist *sg, unsigned int nents, int prot); | ||
117 | phys_addr_t (*iova_to_phys)(struct iommu_domain *domain, dma_addr_t iova); | 122 | phys_addr_t (*iova_to_phys)(struct iommu_domain *domain, dma_addr_t iova); |
118 | int (*add_device)(struct device *dev); | 123 | int (*add_device)(struct device *dev); |
119 | void (*remove_device)(struct device *dev); | 124 | void (*remove_device)(struct device *dev); |
@@ -156,6 +161,9 @@ extern int iommu_map(struct iommu_domain *domain, unsigned long iova, | |||
156 | phys_addr_t paddr, size_t size, int prot); | 161 | phys_addr_t paddr, size_t size, int prot); |
157 | extern size_t iommu_unmap(struct iommu_domain *domain, unsigned long iova, | 162 | extern size_t iommu_unmap(struct iommu_domain *domain, unsigned long iova, |
158 | size_t size); | 163 | size_t size); |
164 | extern size_t default_iommu_map_sg(struct iommu_domain *domain, unsigned long iova, | ||
165 | struct scatterlist *sg,unsigned int nents, | ||
166 | int prot); | ||
159 | extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_addr_t iova); | 167 | extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_addr_t iova); |
160 | extern void iommu_set_fault_handler(struct iommu_domain *domain, | 168 | extern void iommu_set_fault_handler(struct iommu_domain *domain, |
161 | iommu_fault_handler_t handler, void *token); | 169 | iommu_fault_handler_t handler, void *token); |
@@ -241,6 +249,13 @@ static inline int report_iommu_fault(struct iommu_domain *domain, | |||
241 | return ret; | 249 | return ret; |
242 | } | 250 | } |
243 | 251 | ||
252 | static inline size_t iommu_map_sg(struct iommu_domain *domain, | ||
253 | unsigned long iova, struct scatterlist *sg, | ||
254 | unsigned int nents, int prot) | ||
255 | { | ||
256 | return domain->ops->map_sg(domain, iova, sg, nents, prot); | ||
257 | } | ||
258 | |||
244 | #else /* CONFIG_IOMMU_API */ | 259 | #else /* CONFIG_IOMMU_API */ |
245 | 260 | ||
246 | struct iommu_ops {}; | 261 | struct iommu_ops {}; |
@@ -293,6 +308,13 @@ static inline int iommu_unmap(struct iommu_domain *domain, unsigned long iova, | |||
293 | return -ENODEV; | 308 | return -ENODEV; |
294 | } | 309 | } |
295 | 310 | ||
311 | static inline size_t iommu_map_sg(struct iommu_domain *domain, | ||
312 | unsigned long iova, struct scatterlist *sg, | ||
313 | unsigned int nents, int prot) | ||
314 | { | ||
315 | return -ENODEV; | ||
316 | } | ||
317 | |||
296 | static inline int iommu_domain_window_enable(struct iommu_domain *domain, | 318 | static inline int iommu_domain_window_enable(struct iommu_domain *domain, |
297 | u32 wnd_nr, phys_addr_t paddr, | 319 | u32 wnd_nr, phys_addr_t paddr, |
298 | u64 size, int prot) | 320 | u64 size, int prot) |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 03f48d936f66..d09ec7a1243e 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -15,11 +15,13 @@ | |||
15 | #include <linux/spinlock.h> | 15 | #include <linux/spinlock.h> |
16 | #include <linux/cpumask.h> | 16 | #include <linux/cpumask.h> |
17 | #include <linux/gfp.h> | 17 | #include <linux/gfp.h> |
18 | #include <linux/irqhandler.h> | ||
18 | #include <linux/irqreturn.h> | 19 | #include <linux/irqreturn.h> |
19 | #include <linux/irqnr.h> | 20 | #include <linux/irqnr.h> |
20 | #include <linux/errno.h> | 21 | #include <linux/errno.h> |
21 | #include <linux/topology.h> | 22 | #include <linux/topology.h> |
22 | #include <linux/wait.h> | 23 | #include <linux/wait.h> |
24 | #include <linux/io.h> | ||
23 | 25 | ||
24 | #include <asm/irq.h> | 26 | #include <asm/irq.h> |
25 | #include <asm/ptrace.h> | 27 | #include <asm/ptrace.h> |
@@ -27,11 +29,7 @@ | |||
27 | 29 | ||
28 | struct seq_file; | 30 | struct seq_file; |
29 | struct module; | 31 | struct module; |
30 | struct irq_desc; | 32 | struct msi_msg; |
31 | struct irq_data; | ||
32 | typedef void (*irq_flow_handler_t)(unsigned int irq, | ||
33 | struct irq_desc *desc); | ||
34 | typedef void (*irq_preflow_handler_t)(struct irq_data *data); | ||
35 | 33 | ||
36 | /* | 34 | /* |
37 | * IRQ line status. | 35 | * IRQ line status. |
@@ -113,10 +111,14 @@ enum { | |||
113 | * | 111 | * |
114 | * IRQ_SET_MASK_OK - OK, core updates irq_data.affinity | 112 | * IRQ_SET_MASK_OK - OK, core updates irq_data.affinity |
115 | * IRQ_SET_MASK_NOCPY - OK, chip did update irq_data.affinity | 113 | * IRQ_SET_MASK_NOCPY - OK, chip did update irq_data.affinity |
114 | * IRQ_SET_MASK_OK_DONE - Same as IRQ_SET_MASK_OK for core. Special code to | ||
115 | * support stacked irqchips, which indicates skipping | ||
116 | * all descendent irqchips. | ||
116 | */ | 117 | */ |
117 | enum { | 118 | enum { |
118 | IRQ_SET_MASK_OK = 0, | 119 | IRQ_SET_MASK_OK = 0, |
119 | IRQ_SET_MASK_OK_NOCOPY, | 120 | IRQ_SET_MASK_OK_NOCOPY, |
121 | IRQ_SET_MASK_OK_DONE, | ||
120 | }; | 122 | }; |
121 | 123 | ||
122 | struct msi_desc; | 124 | struct msi_desc; |
@@ -133,6 +135,8 @@ struct irq_domain; | |||
133 | * @chip: low level interrupt hardware access | 135 | * @chip: low level interrupt hardware access |
134 | * @domain: Interrupt translation domain; responsible for mapping | 136 | * @domain: Interrupt translation domain; responsible for mapping |
135 | * between hwirq number and linux irq number. | 137 | * between hwirq number and linux irq number. |
138 | * @parent_data: pointer to parent struct irq_data to support hierarchy | ||
139 | * irq_domain | ||
136 | * @handler_data: per-IRQ data for the irq_chip methods | 140 | * @handler_data: per-IRQ data for the irq_chip methods |
137 | * @chip_data: platform-specific per-chip private data for the chip | 141 | * @chip_data: platform-specific per-chip private data for the chip |
138 | * methods, to allow shared chip implementations | 142 | * methods, to allow shared chip implementations |
@@ -151,6 +155,9 @@ struct irq_data { | |||
151 | unsigned int state_use_accessors; | 155 | unsigned int state_use_accessors; |
152 | struct irq_chip *chip; | 156 | struct irq_chip *chip; |
153 | struct irq_domain *domain; | 157 | struct irq_domain *domain; |
158 | #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY | ||
159 | struct irq_data *parent_data; | ||
160 | #endif | ||
154 | void *handler_data; | 161 | void *handler_data; |
155 | void *chip_data; | 162 | void *chip_data; |
156 | struct msi_desc *msi_desc; | 163 | struct msi_desc *msi_desc; |
@@ -315,6 +322,8 @@ static inline irq_hw_number_t irqd_to_hwirq(struct irq_data *d) | |||
315 | * any other callback related to this irq | 322 | * any other callback related to this irq |
316 | * @irq_release_resources: optional to release resources acquired with | 323 | * @irq_release_resources: optional to release resources acquired with |
317 | * irq_request_resources | 324 | * irq_request_resources |
325 | * @irq_compose_msi_msg: optional to compose message content for MSI | ||
326 | * @irq_write_msi_msg: optional to write message content for MSI | ||
318 | * @flags: chip specific flags | 327 | * @flags: chip specific flags |
319 | */ | 328 | */ |
320 | struct irq_chip { | 329 | struct irq_chip { |
@@ -351,6 +360,9 @@ struct irq_chip { | |||
351 | int (*irq_request_resources)(struct irq_data *data); | 360 | int (*irq_request_resources)(struct irq_data *data); |
352 | void (*irq_release_resources)(struct irq_data *data); | 361 | void (*irq_release_resources)(struct irq_data *data); |
353 | 362 | ||
363 | void (*irq_compose_msi_msg)(struct irq_data *data, struct msi_msg *msg); | ||
364 | void (*irq_write_msi_msg)(struct irq_data *data, struct msi_msg *msg); | ||
365 | |||
354 | unsigned long flags; | 366 | unsigned long flags; |
355 | }; | 367 | }; |
356 | 368 | ||
@@ -438,6 +450,18 @@ extern void handle_percpu_devid_irq(unsigned int irq, struct irq_desc *desc); | |||
438 | extern void handle_bad_irq(unsigned int irq, struct irq_desc *desc); | 450 | extern void handle_bad_irq(unsigned int irq, struct irq_desc *desc); |
439 | extern void handle_nested_irq(unsigned int irq); | 451 | extern void handle_nested_irq(unsigned int irq); |
440 | 452 | ||
453 | extern int irq_chip_compose_msi_msg(struct irq_data *data, struct msi_msg *msg); | ||
454 | #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY | ||
455 | extern void irq_chip_ack_parent(struct irq_data *data); | ||
456 | extern int irq_chip_retrigger_hierarchy(struct irq_data *data); | ||
457 | extern void irq_chip_mask_parent(struct irq_data *data); | ||
458 | extern void irq_chip_unmask_parent(struct irq_data *data); | ||
459 | extern void irq_chip_eoi_parent(struct irq_data *data); | ||
460 | extern int irq_chip_set_affinity_parent(struct irq_data *data, | ||
461 | const struct cpumask *dest, | ||
462 | bool force); | ||
463 | #endif | ||
464 | |||
441 | /* Handling of unhandled and spurious interrupts: */ | 465 | /* Handling of unhandled and spurious interrupts: */ |
442 | extern void note_interrupt(unsigned int irq, struct irq_desc *desc, | 466 | extern void note_interrupt(unsigned int irq, struct irq_desc *desc, |
443 | irqreturn_t action_ret); | 467 | irqreturn_t action_ret); |
@@ -639,13 +663,6 @@ void arch_teardown_hwirq(unsigned int irq); | |||
639 | void irq_init_desc(unsigned int irq); | 663 | void irq_init_desc(unsigned int irq); |
640 | #endif | 664 | #endif |
641 | 665 | ||
642 | #ifndef irq_reg_writel | ||
643 | # define irq_reg_writel(val, addr) writel(val, addr) | ||
644 | #endif | ||
645 | #ifndef irq_reg_readl | ||
646 | # define irq_reg_readl(addr) readl(addr) | ||
647 | #endif | ||
648 | |||
649 | /** | 666 | /** |
650 | * struct irq_chip_regs - register offsets for struct irq_gci | 667 | * struct irq_chip_regs - register offsets for struct irq_gci |
651 | * @enable: Enable register offset to reg_base | 668 | * @enable: Enable register offset to reg_base |
@@ -692,6 +709,8 @@ struct irq_chip_type { | |||
692 | * struct irq_chip_generic - Generic irq chip data structure | 709 | * struct irq_chip_generic - Generic irq chip data structure |
693 | * @lock: Lock to protect register and cache data access | 710 | * @lock: Lock to protect register and cache data access |
694 | * @reg_base: Register base address (virtual) | 711 | * @reg_base: Register base address (virtual) |
712 | * @reg_readl: Alternate I/O accessor (defaults to readl if NULL) | ||
713 | * @reg_writel: Alternate I/O accessor (defaults to writel if NULL) | ||
695 | * @irq_base: Interrupt base nr for this chip | 714 | * @irq_base: Interrupt base nr for this chip |
696 | * @irq_cnt: Number of interrupts handled by this chip | 715 | * @irq_cnt: Number of interrupts handled by this chip |
697 | * @mask_cache: Cached mask register shared between all chip types | 716 | * @mask_cache: Cached mask register shared between all chip types |
@@ -716,6 +735,8 @@ struct irq_chip_type { | |||
716 | struct irq_chip_generic { | 735 | struct irq_chip_generic { |
717 | raw_spinlock_t lock; | 736 | raw_spinlock_t lock; |
718 | void __iomem *reg_base; | 737 | void __iomem *reg_base; |
738 | u32 (*reg_readl)(void __iomem *addr); | ||
739 | void (*reg_writel)(u32 val, void __iomem *addr); | ||
719 | unsigned int irq_base; | 740 | unsigned int irq_base; |
720 | unsigned int irq_cnt; | 741 | unsigned int irq_cnt; |
721 | u32 mask_cache; | 742 | u32 mask_cache; |
@@ -740,12 +761,14 @@ struct irq_chip_generic { | |||
740 | * the parent irq. Usually GPIO implementations | 761 | * the parent irq. Usually GPIO implementations |
741 | * @IRQ_GC_MASK_CACHE_PER_TYPE: Mask cache is chip type private | 762 | * @IRQ_GC_MASK_CACHE_PER_TYPE: Mask cache is chip type private |
742 | * @IRQ_GC_NO_MASK: Do not calculate irq_data->mask | 763 | * @IRQ_GC_NO_MASK: Do not calculate irq_data->mask |
764 | * @IRQ_GC_BE_IO: Use big-endian register accesses (default: LE) | ||
743 | */ | 765 | */ |
744 | enum irq_gc_flags { | 766 | enum irq_gc_flags { |
745 | IRQ_GC_INIT_MASK_CACHE = 1 << 0, | 767 | IRQ_GC_INIT_MASK_CACHE = 1 << 0, |
746 | IRQ_GC_INIT_NESTED_LOCK = 1 << 1, | 768 | IRQ_GC_INIT_NESTED_LOCK = 1 << 1, |
747 | IRQ_GC_MASK_CACHE_PER_TYPE = 1 << 2, | 769 | IRQ_GC_MASK_CACHE_PER_TYPE = 1 << 2, |
748 | IRQ_GC_NO_MASK = 1 << 3, | 770 | IRQ_GC_NO_MASK = 1 << 3, |
771 | IRQ_GC_BE_IO = 1 << 4, | ||
749 | }; | 772 | }; |
750 | 773 | ||
751 | /* | 774 | /* |
@@ -821,4 +844,22 @@ static inline void irq_gc_lock(struct irq_chip_generic *gc) { } | |||
821 | static inline void irq_gc_unlock(struct irq_chip_generic *gc) { } | 844 | static inline void irq_gc_unlock(struct irq_chip_generic *gc) { } |
822 | #endif | 845 | #endif |
823 | 846 | ||
847 | static inline void irq_reg_writel(struct irq_chip_generic *gc, | ||
848 | u32 val, int reg_offset) | ||
849 | { | ||
850 | if (gc->reg_writel) | ||
851 | gc->reg_writel(val, gc->reg_base + reg_offset); | ||
852 | else | ||
853 | writel(val, gc->reg_base + reg_offset); | ||
854 | } | ||
855 | |||
856 | static inline u32 irq_reg_readl(struct irq_chip_generic *gc, | ||
857 | int reg_offset) | ||
858 | { | ||
859 | if (gc->reg_readl) | ||
860 | return gc->reg_readl(gc->reg_base + reg_offset); | ||
861 | else | ||
862 | return readl(gc->reg_base + reg_offset); | ||
863 | } | ||
864 | |||
824 | #endif /* _LINUX_IRQ_H */ | 865 | #endif /* _LINUX_IRQ_H */ |
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index b0f9d16e48f6..676d7306a360 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h | |||
@@ -33,11 +33,14 @@ | |||
33 | #define _LINUX_IRQDOMAIN_H | 33 | #define _LINUX_IRQDOMAIN_H |
34 | 34 | ||
35 | #include <linux/types.h> | 35 | #include <linux/types.h> |
36 | #include <linux/irqhandler.h> | ||
36 | #include <linux/radix-tree.h> | 37 | #include <linux/radix-tree.h> |
37 | 38 | ||
38 | struct device_node; | 39 | struct device_node; |
39 | struct irq_domain; | 40 | struct irq_domain; |
40 | struct of_device_id; | 41 | struct of_device_id; |
42 | struct irq_chip; | ||
43 | struct irq_data; | ||
41 | 44 | ||
42 | /* Number of irqs reserved for a legacy isa controller */ | 45 | /* Number of irqs reserved for a legacy isa controller */ |
43 | #define NUM_ISA_INTERRUPTS 16 | 46 | #define NUM_ISA_INTERRUPTS 16 |
@@ -64,6 +67,16 @@ struct irq_domain_ops { | |||
64 | int (*xlate)(struct irq_domain *d, struct device_node *node, | 67 | int (*xlate)(struct irq_domain *d, struct device_node *node, |
65 | const u32 *intspec, unsigned int intsize, | 68 | const u32 *intspec, unsigned int intsize, |
66 | unsigned long *out_hwirq, unsigned int *out_type); | 69 | unsigned long *out_hwirq, unsigned int *out_type); |
70 | |||
71 | #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY | ||
72 | /* extended V2 interfaces to support hierarchy irq_domains */ | ||
73 | int (*alloc)(struct irq_domain *d, unsigned int virq, | ||
74 | unsigned int nr_irqs, void *arg); | ||
75 | void (*free)(struct irq_domain *d, unsigned int virq, | ||
76 | unsigned int nr_irqs); | ||
77 | void (*activate)(struct irq_domain *d, struct irq_data *irq_data); | ||
78 | void (*deactivate)(struct irq_domain *d, struct irq_data *irq_data); | ||
79 | #endif | ||
67 | }; | 80 | }; |
68 | 81 | ||
69 | extern struct irq_domain_ops irq_generic_chip_ops; | 82 | extern struct irq_domain_ops irq_generic_chip_ops; |
@@ -77,6 +90,7 @@ struct irq_domain_chip_generic; | |||
77 | * @ops: pointer to irq_domain methods | 90 | * @ops: pointer to irq_domain methods |
78 | * @host_data: private data pointer for use by owner. Not touched by irq_domain | 91 | * @host_data: private data pointer for use by owner. Not touched by irq_domain |
79 | * core code. | 92 | * core code. |
93 | * @flags: host per irq_domain flags | ||
80 | * | 94 | * |
81 | * Optional elements | 95 | * Optional elements |
82 | * @of_node: Pointer to device tree nodes associated with the irq_domain. Used | 96 | * @of_node: Pointer to device tree nodes associated with the irq_domain. Used |
@@ -84,6 +98,7 @@ struct irq_domain_chip_generic; | |||
84 | * @gc: Pointer to a list of generic chips. There is a helper function for | 98 | * @gc: Pointer to a list of generic chips. There is a helper function for |
85 | * setting up one or more generic chips for interrupt controllers | 99 | * setting up one or more generic chips for interrupt controllers |
86 | * drivers using the generic chip library which uses this pointer. | 100 | * drivers using the generic chip library which uses this pointer. |
101 | * @parent: Pointer to parent irq_domain to support hierarchy irq_domains | ||
87 | * | 102 | * |
88 | * Revmap data, used internally by irq_domain | 103 | * Revmap data, used internally by irq_domain |
89 | * @revmap_direct_max_irq: The largest hwirq that can be set for controllers that | 104 | * @revmap_direct_max_irq: The largest hwirq that can be set for controllers that |
@@ -97,10 +112,14 @@ struct irq_domain { | |||
97 | const char *name; | 112 | const char *name; |
98 | const struct irq_domain_ops *ops; | 113 | const struct irq_domain_ops *ops; |
99 | void *host_data; | 114 | void *host_data; |
115 | unsigned int flags; | ||
100 | 116 | ||
101 | /* Optional data */ | 117 | /* Optional data */ |
102 | struct device_node *of_node; | 118 | struct device_node *of_node; |
103 | struct irq_domain_chip_generic *gc; | 119 | struct irq_domain_chip_generic *gc; |
120 | #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY | ||
121 | struct irq_domain *parent; | ||
122 | #endif | ||
104 | 123 | ||
105 | /* reverse map data. The linear map gets appended to the irq_domain */ | 124 | /* reverse map data. The linear map gets appended to the irq_domain */ |
106 | irq_hw_number_t hwirq_max; | 125 | irq_hw_number_t hwirq_max; |
@@ -110,6 +129,22 @@ struct irq_domain { | |||
110 | unsigned int linear_revmap[]; | 129 | unsigned int linear_revmap[]; |
111 | }; | 130 | }; |
112 | 131 | ||
132 | /* Irq domain flags */ | ||
133 | enum { | ||
134 | /* Irq domain is hierarchical */ | ||
135 | IRQ_DOMAIN_FLAG_HIERARCHY = (1 << 0), | ||
136 | |||
137 | /* Core calls alloc/free recursive through the domain hierarchy. */ | ||
138 | IRQ_DOMAIN_FLAG_AUTO_RECURSIVE = (1 << 1), | ||
139 | |||
140 | /* | ||
141 | * Flags starting from IRQ_DOMAIN_FLAG_NONCORE are reserved | ||
142 | * for implementation specific purposes and ignored by the | ||
143 | * core code. | ||
144 | */ | ||
145 | IRQ_DOMAIN_FLAG_NONCORE = (1 << 16), | ||
146 | }; | ||
147 | |||
113 | #ifdef CONFIG_IRQ_DOMAIN | 148 | #ifdef CONFIG_IRQ_DOMAIN |
114 | struct irq_domain *__irq_domain_add(struct device_node *of_node, int size, | 149 | struct irq_domain *__irq_domain_add(struct device_node *of_node, int size, |
115 | irq_hw_number_t hwirq_max, int direct_max, | 150 | irq_hw_number_t hwirq_max, int direct_max, |
@@ -220,8 +255,74 @@ int irq_domain_xlate_onetwocell(struct irq_domain *d, struct device_node *ctrlr, | |||
220 | const u32 *intspec, unsigned int intsize, | 255 | const u32 *intspec, unsigned int intsize, |
221 | irq_hw_number_t *out_hwirq, unsigned int *out_type); | 256 | irq_hw_number_t *out_hwirq, unsigned int *out_type); |
222 | 257 | ||
258 | /* V2 interfaces to support hierarchy IRQ domains. */ | ||
259 | extern struct irq_data *irq_domain_get_irq_data(struct irq_domain *domain, | ||
260 | unsigned int virq); | ||
261 | #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY | ||
262 | extern struct irq_domain *irq_domain_add_hierarchy(struct irq_domain *parent, | ||
263 | unsigned int flags, unsigned int size, | ||
264 | struct device_node *node, | ||
265 | const struct irq_domain_ops *ops, void *host_data); | ||
266 | extern int __irq_domain_alloc_irqs(struct irq_domain *domain, int irq_base, | ||
267 | unsigned int nr_irqs, int node, void *arg, | ||
268 | bool realloc); | ||
269 | extern void irq_domain_free_irqs(unsigned int virq, unsigned int nr_irqs); | ||
270 | extern void irq_domain_activate_irq(struct irq_data *irq_data); | ||
271 | extern void irq_domain_deactivate_irq(struct irq_data *irq_data); | ||
272 | |||
273 | static inline int irq_domain_alloc_irqs(struct irq_domain *domain, | ||
274 | unsigned int nr_irqs, int node, void *arg) | ||
275 | { | ||
276 | return __irq_domain_alloc_irqs(domain, -1, nr_irqs, node, arg, false); | ||
277 | } | ||
278 | |||
279 | extern int irq_domain_set_hwirq_and_chip(struct irq_domain *domain, | ||
280 | unsigned int virq, | ||
281 | irq_hw_number_t hwirq, | ||
282 | struct irq_chip *chip, | ||
283 | void *chip_data); | ||
284 | extern void irq_domain_set_info(struct irq_domain *domain, unsigned int virq, | ||
285 | irq_hw_number_t hwirq, struct irq_chip *chip, | ||
286 | void *chip_data, irq_flow_handler_t handler, | ||
287 | void *handler_data, const char *handler_name); | ||
288 | extern void irq_domain_reset_irq_data(struct irq_data *irq_data); | ||
289 | extern void irq_domain_free_irqs_common(struct irq_domain *domain, | ||
290 | unsigned int virq, | ||
291 | unsigned int nr_irqs); | ||
292 | extern void irq_domain_free_irqs_top(struct irq_domain *domain, | ||
293 | unsigned int virq, unsigned int nr_irqs); | ||
294 | |||
295 | extern int irq_domain_alloc_irqs_parent(struct irq_domain *domain, | ||
296 | unsigned int irq_base, | ||
297 | unsigned int nr_irqs, void *arg); | ||
298 | |||
299 | extern void irq_domain_free_irqs_parent(struct irq_domain *domain, | ||
300 | unsigned int irq_base, | ||
301 | unsigned int nr_irqs); | ||
302 | |||
303 | static inline bool irq_domain_is_hierarchy(struct irq_domain *domain) | ||
304 | { | ||
305 | return domain->flags & IRQ_DOMAIN_FLAG_HIERARCHY; | ||
306 | } | ||
307 | #else /* CONFIG_IRQ_DOMAIN_HIERARCHY */ | ||
308 | static inline void irq_domain_activate_irq(struct irq_data *data) { } | ||
309 | static inline void irq_domain_deactivate_irq(struct irq_data *data) { } | ||
310 | static inline int irq_domain_alloc_irqs(struct irq_domain *domain, | ||
311 | unsigned int nr_irqs, int node, void *arg) | ||
312 | { | ||
313 | return -1; | ||
314 | } | ||
315 | |||
316 | static inline bool irq_domain_is_hierarchy(struct irq_domain *domain) | ||
317 | { | ||
318 | return false; | ||
319 | } | ||
320 | #endif /* CONFIG_IRQ_DOMAIN_HIERARCHY */ | ||
321 | |||
223 | #else /* CONFIG_IRQ_DOMAIN */ | 322 | #else /* CONFIG_IRQ_DOMAIN */ |
224 | static inline void irq_dispose_mapping(unsigned int virq) { } | 323 | static inline void irq_dispose_mapping(unsigned int virq) { } |
324 | static inline void irq_domain_activate_irq(struct irq_data *data) { } | ||
325 | static inline void irq_domain_deactivate_irq(struct irq_data *data) { } | ||
225 | #endif /* !CONFIG_IRQ_DOMAIN */ | 326 | #endif /* !CONFIG_IRQ_DOMAIN */ |
226 | 327 | ||
227 | #endif /* _LINUX_IRQDOMAIN_H */ | 328 | #endif /* _LINUX_IRQDOMAIN_H */ |
diff --git a/include/linux/irqhandler.h b/include/linux/irqhandler.h new file mode 100644 index 000000000000..62d543004197 --- /dev/null +++ b/include/linux/irqhandler.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef _LINUX_IRQHANDLER_H | ||
2 | #define _LINUX_IRQHANDLER_H | ||
3 | |||
4 | /* | ||
5 | * Interrupt flow handler typedefs are defined here to avoid circular | ||
6 | * include dependencies. | ||
7 | */ | ||
8 | |||
9 | struct irq_desc; | ||
10 | struct irq_data; | ||
11 | typedef void (*irq_flow_handler_t)(unsigned int irq, struct irq_desc *desc); | ||
12 | typedef void (*irq_preflow_handler_t)(struct irq_data *data); | ||
13 | |||
14 | #endif | ||
diff --git a/include/linux/kern_levels.h b/include/linux/kern_levels.h index 866caaa9e2bb..c2ce155d83cc 100644 --- a/include/linux/kern_levels.h +++ b/include/linux/kern_levels.h | |||
@@ -22,4 +22,17 @@ | |||
22 | */ | 22 | */ |
23 | #define KERN_CONT "" | 23 | #define KERN_CONT "" |
24 | 24 | ||
25 | /* integer equivalents of KERN_<LEVEL> */ | ||
26 | #define LOGLEVEL_SCHED -2 /* Deferred messages from sched code | ||
27 | * are set to this special level */ | ||
28 | #define LOGLEVEL_DEFAULT -1 /* default (or last) loglevel */ | ||
29 | #define LOGLEVEL_EMERG 0 /* system is unusable */ | ||
30 | #define LOGLEVEL_ALERT 1 /* action must be taken immediately */ | ||
31 | #define LOGLEVEL_CRIT 2 /* critical conditions */ | ||
32 | #define LOGLEVEL_ERR 3 /* error conditions */ | ||
33 | #define LOGLEVEL_WARNING 4 /* warning conditions */ | ||
34 | #define LOGLEVEL_NOTICE 5 /* normal but significant condition */ | ||
35 | #define LOGLEVEL_INFO 6 /* informational */ | ||
36 | #define LOGLEVEL_DEBUG 7 /* debug-level messages */ | ||
37 | |||
25 | #endif | 38 | #endif |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 3d770f5564b8..233ea8107038 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -162,6 +162,7 @@ extern int _cond_resched(void); | |||
162 | #endif | 162 | #endif |
163 | 163 | ||
164 | #ifdef CONFIG_DEBUG_ATOMIC_SLEEP | 164 | #ifdef CONFIG_DEBUG_ATOMIC_SLEEP |
165 | void ___might_sleep(const char *file, int line, int preempt_offset); | ||
165 | void __might_sleep(const char *file, int line, int preempt_offset); | 166 | void __might_sleep(const char *file, int line, int preempt_offset); |
166 | /** | 167 | /** |
167 | * might_sleep - annotation for functions that can sleep | 168 | * might_sleep - annotation for functions that can sleep |
@@ -175,10 +176,14 @@ extern int _cond_resched(void); | |||
175 | */ | 176 | */ |
176 | # define might_sleep() \ | 177 | # define might_sleep() \ |
177 | do { __might_sleep(__FILE__, __LINE__, 0); might_resched(); } while (0) | 178 | do { __might_sleep(__FILE__, __LINE__, 0); might_resched(); } while (0) |
179 | # define sched_annotate_sleep() __set_current_state(TASK_RUNNING) | ||
178 | #else | 180 | #else |
181 | static inline void ___might_sleep(const char *file, int line, | ||
182 | int preempt_offset) { } | ||
179 | static inline void __might_sleep(const char *file, int line, | 183 | static inline void __might_sleep(const char *file, int line, |
180 | int preempt_offset) { } | 184 | int preempt_offset) { } |
181 | # define might_sleep() do { might_resched(); } while (0) | 185 | # define might_sleep() do { might_resched(); } while (0) |
186 | # define sched_annotate_sleep() do { } while (0) | ||
182 | #endif | 187 | #endif |
183 | 188 | ||
184 | #define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0) | 189 | #define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0) |
@@ -422,6 +427,7 @@ extern int panic_timeout; | |||
422 | extern int panic_on_oops; | 427 | extern int panic_on_oops; |
423 | extern int panic_on_unrecovered_nmi; | 428 | extern int panic_on_unrecovered_nmi; |
424 | extern int panic_on_io_nmi; | 429 | extern int panic_on_io_nmi; |
430 | extern int panic_on_warn; | ||
425 | extern int sysctl_panic_on_stackoverflow; | 431 | extern int sysctl_panic_on_stackoverflow; |
426 | /* | 432 | /* |
427 | * Only to be used by arch init code. If the user over-wrote the default | 433 | * Only to be used by arch init code. If the user over-wrote the default |
diff --git a/include/linux/leds.h b/include/linux/leds.h index a57611d0c94e..361101fef270 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h | |||
@@ -261,6 +261,7 @@ struct gpio_led { | |||
261 | unsigned retain_state_suspended : 1; | 261 | unsigned retain_state_suspended : 1; |
262 | unsigned default_state : 2; | 262 | unsigned default_state : 2; |
263 | /* default_state should be one of LEDS_GPIO_DEFSTATE_(ON|OFF|KEEP) */ | 263 | /* default_state should be one of LEDS_GPIO_DEFSTATE_(ON|OFF|KEEP) */ |
264 | struct gpio_desc *gpiod; | ||
264 | }; | 265 | }; |
265 | #define LEDS_GPIO_DEFSTATE_OFF 0 | 266 | #define LEDS_GPIO_DEFSTATE_OFF 0 |
266 | #define LEDS_GPIO_DEFSTATE_ON 1 | 267 | #define LEDS_GPIO_DEFSTATE_ON 1 |
@@ -273,7 +274,7 @@ struct gpio_led_platform_data { | |||
273 | #define GPIO_LED_NO_BLINK_LOW 0 /* No blink GPIO state low */ | 274 | #define GPIO_LED_NO_BLINK_LOW 0 /* No blink GPIO state low */ |
274 | #define GPIO_LED_NO_BLINK_HIGH 1 /* No blink GPIO state high */ | 275 | #define GPIO_LED_NO_BLINK_HIGH 1 /* No blink GPIO state high */ |
275 | #define GPIO_LED_BLINK 2 /* Please, blink */ | 276 | #define GPIO_LED_BLINK 2 /* Please, blink */ |
276 | int (*gpio_blink_set)(unsigned gpio, int state, | 277 | int (*gpio_blink_set)(struct gpio_desc *desc, int state, |
277 | unsigned long *delay_on, | 278 | unsigned long *delay_on, |
278 | unsigned long *delay_off); | 279 | unsigned long *delay_off); |
279 | }; | 280 | }; |
diff --git a/include/linux/libata.h b/include/linux/libata.h index bd5fefeaf548..bfbc817c34ee 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -1191,9 +1191,9 @@ extern void ata_scsi_unlock_native_capacity(struct scsi_device *sdev); | |||
1191 | extern int ata_scsi_slave_config(struct scsi_device *sdev); | 1191 | extern int ata_scsi_slave_config(struct scsi_device *sdev); |
1192 | extern void ata_scsi_slave_destroy(struct scsi_device *sdev); | 1192 | extern void ata_scsi_slave_destroy(struct scsi_device *sdev); |
1193 | extern int ata_scsi_change_queue_depth(struct scsi_device *sdev, | 1193 | extern int ata_scsi_change_queue_depth(struct scsi_device *sdev, |
1194 | int queue_depth, int reason); | 1194 | int queue_depth); |
1195 | extern int __ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev, | 1195 | extern int __ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev, |
1196 | int queue_depth, int reason); | 1196 | int queue_depth); |
1197 | extern struct ata_device *ata_dev_pair(struct ata_device *adev); | 1197 | extern struct ata_device *ata_dev_pair(struct ata_device *adev); |
1198 | extern int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev); | 1198 | extern int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev); |
1199 | extern void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap); | 1199 | extern void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap); |
diff --git a/include/linux/lockd/debug.h b/include/linux/lockd/debug.h index 257d3779f2ab..0ca8109934e4 100644 --- a/include/linux/lockd/debug.h +++ b/include/linux/lockd/debug.h | |||
@@ -17,12 +17,8 @@ | |||
17 | * Enable lockd debugging. | 17 | * Enable lockd debugging. |
18 | * Requires RPC_DEBUG. | 18 | * Requires RPC_DEBUG. |
19 | */ | 19 | */ |
20 | #ifdef RPC_DEBUG | ||
21 | # define LOCKD_DEBUG 1 | ||
22 | #endif | ||
23 | |||
24 | #undef ifdebug | 20 | #undef ifdebug |
25 | #if defined(RPC_DEBUG) && defined(LOCKD_DEBUG) | 21 | #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) |
26 | # define ifdebug(flag) if (unlikely(nlm_debug & NLMDBG_##flag)) | 22 | # define ifdebug(flag) if (unlikely(nlm_debug & NLMDBG_##flag)) |
27 | #else | 23 | #else |
28 | # define ifdebug(flag) if (0) | 24 | # define ifdebug(flag) if (0) |
diff --git a/include/linux/mbus.h b/include/linux/mbus.h index 550c88fb0267..611b69fa8594 100644 --- a/include/linux/mbus.h +++ b/include/linux/mbus.h | |||
@@ -61,6 +61,7 @@ static inline const struct mbus_dram_target_info *mv_mbus_dram_info(void) | |||
61 | } | 61 | } |
62 | #endif | 62 | #endif |
63 | 63 | ||
64 | int mvebu_mbus_save_cpu_target(u32 *store_addr); | ||
64 | void mvebu_mbus_get_pcie_mem_aperture(struct resource *res); | 65 | void mvebu_mbus_get_pcie_mem_aperture(struct resource *res); |
65 | void mvebu_mbus_get_pcie_io_aperture(struct resource *res); | 66 | void mvebu_mbus_get_pcie_io_aperture(struct resource *res); |
66 | int mvebu_mbus_add_window_remap_by_id(unsigned int target, | 67 | int mvebu_mbus_add_window_remap_by_id(unsigned int target, |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 6b75640ef5ab..6ea9f919e888 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -25,7 +25,6 @@ | |||
25 | #include <linux/jump_label.h> | 25 | #include <linux/jump_label.h> |
26 | 26 | ||
27 | struct mem_cgroup; | 27 | struct mem_cgroup; |
28 | struct page_cgroup; | ||
29 | struct page; | 28 | struct page; |
30 | struct mm_struct; | 29 | struct mm_struct; |
31 | struct kmem_cache; | 30 | struct kmem_cache; |
@@ -68,10 +67,9 @@ void mem_cgroup_migrate(struct page *oldpage, struct page *newpage, | |||
68 | struct lruvec *mem_cgroup_zone_lruvec(struct zone *, struct mem_cgroup *); | 67 | struct lruvec *mem_cgroup_zone_lruvec(struct zone *, struct mem_cgroup *); |
69 | struct lruvec *mem_cgroup_page_lruvec(struct page *, struct zone *); | 68 | struct lruvec *mem_cgroup_page_lruvec(struct page *, struct zone *); |
70 | 69 | ||
71 | bool __mem_cgroup_same_or_subtree(const struct mem_cgroup *root_memcg, | 70 | bool mem_cgroup_is_descendant(struct mem_cgroup *memcg, |
72 | struct mem_cgroup *memcg); | 71 | struct mem_cgroup *root); |
73 | bool task_in_mem_cgroup(struct task_struct *task, | 72 | bool task_in_mem_cgroup(struct task_struct *task, struct mem_cgroup *memcg); |
74 | const struct mem_cgroup *memcg); | ||
75 | 73 | ||
76 | extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); | 74 | extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); |
77 | extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); | 75 | extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); |
@@ -79,15 +77,16 @@ extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); | |||
79 | extern struct mem_cgroup *parent_mem_cgroup(struct mem_cgroup *memcg); | 77 | extern struct mem_cgroup *parent_mem_cgroup(struct mem_cgroup *memcg); |
80 | extern struct mem_cgroup *mem_cgroup_from_css(struct cgroup_subsys_state *css); | 78 | extern struct mem_cgroup *mem_cgroup_from_css(struct cgroup_subsys_state *css); |
81 | 79 | ||
82 | static inline | 80 | static inline bool mm_match_cgroup(struct mm_struct *mm, |
83 | bool mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *memcg) | 81 | struct mem_cgroup *memcg) |
84 | { | 82 | { |
85 | struct mem_cgroup *task_memcg; | 83 | struct mem_cgroup *task_memcg; |
86 | bool match; | 84 | bool match = false; |
87 | 85 | ||
88 | rcu_read_lock(); | 86 | rcu_read_lock(); |
89 | task_memcg = mem_cgroup_from_task(rcu_dereference(mm->owner)); | 87 | task_memcg = mem_cgroup_from_task(rcu_dereference(mm->owner)); |
90 | match = __mem_cgroup_same_or_subtree(memcg, task_memcg); | 88 | if (task_memcg) |
89 | match = mem_cgroup_is_descendant(task_memcg, memcg); | ||
91 | rcu_read_unlock(); | 90 | rcu_read_unlock(); |
92 | return match; | 91 | return match; |
93 | } | 92 | } |
@@ -141,8 +140,8 @@ static inline bool mem_cgroup_disabled(void) | |||
141 | 140 | ||
142 | struct mem_cgroup *mem_cgroup_begin_page_stat(struct page *page, bool *locked, | 141 | struct mem_cgroup *mem_cgroup_begin_page_stat(struct page *page, bool *locked, |
143 | unsigned long *flags); | 142 | unsigned long *flags); |
144 | void mem_cgroup_end_page_stat(struct mem_cgroup *memcg, bool locked, | 143 | void mem_cgroup_end_page_stat(struct mem_cgroup *memcg, bool *locked, |
145 | unsigned long flags); | 144 | unsigned long *flags); |
146 | void mem_cgroup_update_page_stat(struct mem_cgroup *memcg, | 145 | void mem_cgroup_update_page_stat(struct mem_cgroup *memcg, |
147 | enum mem_cgroup_stat_index idx, int val); | 146 | enum mem_cgroup_stat_index idx, int val); |
148 | 147 | ||
@@ -174,10 +173,6 @@ static inline void mem_cgroup_count_vm_event(struct mm_struct *mm, | |||
174 | void mem_cgroup_split_huge_fixup(struct page *head); | 173 | void mem_cgroup_split_huge_fixup(struct page *head); |
175 | #endif | 174 | #endif |
176 | 175 | ||
177 | #ifdef CONFIG_DEBUG_VM | ||
178 | bool mem_cgroup_bad_page_check(struct page *page); | ||
179 | void mem_cgroup_print_bad_page(struct page *page); | ||
180 | #endif | ||
181 | #else /* CONFIG_MEMCG */ | 176 | #else /* CONFIG_MEMCG */ |
182 | struct mem_cgroup; | 177 | struct mem_cgroup; |
183 | 178 | ||
@@ -297,7 +292,7 @@ static inline struct mem_cgroup *mem_cgroup_begin_page_stat(struct page *page, | |||
297 | } | 292 | } |
298 | 293 | ||
299 | static inline void mem_cgroup_end_page_stat(struct mem_cgroup *memcg, | 294 | static inline void mem_cgroup_end_page_stat(struct mem_cgroup *memcg, |
300 | bool locked, unsigned long flags) | 295 | bool *locked, unsigned long *flags) |
301 | { | 296 | { |
302 | } | 297 | } |
303 | 298 | ||
@@ -347,19 +342,6 @@ void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx) | |||
347 | } | 342 | } |
348 | #endif /* CONFIG_MEMCG */ | 343 | #endif /* CONFIG_MEMCG */ |
349 | 344 | ||
350 | #if !defined(CONFIG_MEMCG) || !defined(CONFIG_DEBUG_VM) | ||
351 | static inline bool | ||
352 | mem_cgroup_bad_page_check(struct page *page) | ||
353 | { | ||
354 | return false; | ||
355 | } | ||
356 | |||
357 | static inline void | ||
358 | mem_cgroup_print_bad_page(struct page *page) | ||
359 | { | ||
360 | } | ||
361 | #endif | ||
362 | |||
363 | enum { | 345 | enum { |
364 | UNDER_LIMIT, | 346 | UNDER_LIMIT, |
365 | SOFT_LIMIT, | 347 | SOFT_LIMIT, |
@@ -447,9 +429,8 @@ memcg_kmem_newpage_charge(gfp_t gfp, struct mem_cgroup **memcg, int order) | |||
447 | /* | 429 | /* |
448 | * __GFP_NOFAIL allocations will move on even if charging is not | 430 | * __GFP_NOFAIL allocations will move on even if charging is not |
449 | * possible. Therefore we don't even try, and have this allocation | 431 | * possible. Therefore we don't even try, and have this allocation |
450 | * unaccounted. We could in theory charge it with | 432 | * unaccounted. We could in theory charge it forcibly, but we hope |
451 | * res_counter_charge_nofail, but we hope those allocations are rare, | 433 | * those allocations are rare, and won't be worth the trouble. |
452 | * and won't be worth the trouble. | ||
453 | */ | 434 | */ |
454 | if (gfp & __GFP_NOFAIL) | 435 | if (gfp & __GFP_NOFAIL) |
455 | return true; | 436 | return true; |
@@ -467,8 +448,6 @@ memcg_kmem_newpage_charge(gfp_t gfp, struct mem_cgroup **memcg, int order) | |||
467 | * memcg_kmem_uncharge_pages: uncharge pages from memcg | 448 | * memcg_kmem_uncharge_pages: uncharge pages from memcg |
468 | * @page: pointer to struct page being freed | 449 | * @page: pointer to struct page being freed |
469 | * @order: allocation order. | 450 | * @order: allocation order. |
470 | * | ||
471 | * there is no need to specify memcg here, since it is embedded in page_cgroup | ||
472 | */ | 451 | */ |
473 | static inline void | 452 | static inline void |
474 | memcg_kmem_uncharge_pages(struct page *page, int order) | 453 | memcg_kmem_uncharge_pages(struct page *page, int order) |
@@ -485,8 +464,7 @@ memcg_kmem_uncharge_pages(struct page *page, int order) | |||
485 | * | 464 | * |
486 | * Needs to be called after memcg_kmem_newpage_charge, regardless of success or | 465 | * Needs to be called after memcg_kmem_newpage_charge, regardless of success or |
487 | * failure of the allocation. if @page is NULL, this function will revert the | 466 | * failure of the allocation. if @page is NULL, this function will revert the |
488 | * charges. Otherwise, it will commit the memcg given by @memcg to the | 467 | * charges. Otherwise, it will commit @page to @memcg. |
489 | * corresponding page_cgroup. | ||
490 | */ | 468 | */ |
491 | static inline void | 469 | static inline void |
492 | memcg_kmem_commit_charge(struct page *page, struct mem_cgroup *memcg, int order) | 470 | memcg_kmem_commit_charge(struct page *page, struct mem_cgroup *memcg, int order) |
diff --git a/include/linux/mfd/abx500/ab8500-sysctrl.h b/include/linux/mfd/abx500/ab8500-sysctrl.h index adba89d9c660..689312745b2f 100644 --- a/include/linux/mfd/abx500/ab8500-sysctrl.h +++ b/include/linux/mfd/abx500/ab8500-sysctrl.h | |||
@@ -12,7 +12,6 @@ | |||
12 | 12 | ||
13 | int ab8500_sysctrl_read(u16 reg, u8 *value); | 13 | int ab8500_sysctrl_read(u16 reg, u8 *value); |
14 | int ab8500_sysctrl_write(u16 reg, u8 mask, u8 value); | 14 | int ab8500_sysctrl_write(u16 reg, u8 mask, u8 value); |
15 | void ab8500_restart(char mode, const char *cmd); | ||
16 | 15 | ||
17 | #else | 16 | #else |
18 | 17 | ||
diff --git a/include/linux/mfd/arizona/registers.h b/include/linux/mfd/arizona/registers.h index c0b075f6bc35..aacc10d7789c 100644 --- a/include/linux/mfd/arizona/registers.h +++ b/include/linux/mfd/arizona/registers.h | |||
@@ -125,6 +125,8 @@ | |||
125 | #define ARIZONA_MIC_BIAS_CTRL_1 0x218 | 125 | #define ARIZONA_MIC_BIAS_CTRL_1 0x218 |
126 | #define ARIZONA_MIC_BIAS_CTRL_2 0x219 | 126 | #define ARIZONA_MIC_BIAS_CTRL_2 0x219 |
127 | #define ARIZONA_MIC_BIAS_CTRL_3 0x21A | 127 | #define ARIZONA_MIC_BIAS_CTRL_3 0x21A |
128 | #define ARIZONA_HP_CTRL_1L 0x225 | ||
129 | #define ARIZONA_HP_CTRL_1R 0x226 | ||
128 | #define ARIZONA_ACCESSORY_DETECT_MODE_1 0x293 | 130 | #define ARIZONA_ACCESSORY_DETECT_MODE_1 0x293 |
129 | #define ARIZONA_HEADPHONE_DETECT_1 0x29B | 131 | #define ARIZONA_HEADPHONE_DETECT_1 0x29B |
130 | #define ARIZONA_HEADPHONE_DETECT_2 0x29C | 132 | #define ARIZONA_HEADPHONE_DETECT_2 0x29C |
@@ -279,8 +281,16 @@ | |||
279 | #define ARIZONA_AIF2_FRAME_CTRL_2 0x548 | 281 | #define ARIZONA_AIF2_FRAME_CTRL_2 0x548 |
280 | #define ARIZONA_AIF2_FRAME_CTRL_3 0x549 | 282 | #define ARIZONA_AIF2_FRAME_CTRL_3 0x549 |
281 | #define ARIZONA_AIF2_FRAME_CTRL_4 0x54A | 283 | #define ARIZONA_AIF2_FRAME_CTRL_4 0x54A |
284 | #define ARIZONA_AIF2_FRAME_CTRL_5 0x54B | ||
285 | #define ARIZONA_AIF2_FRAME_CTRL_6 0x54C | ||
286 | #define ARIZONA_AIF2_FRAME_CTRL_7 0x54D | ||
287 | #define ARIZONA_AIF2_FRAME_CTRL_8 0x54E | ||
282 | #define ARIZONA_AIF2_FRAME_CTRL_11 0x551 | 288 | #define ARIZONA_AIF2_FRAME_CTRL_11 0x551 |
283 | #define ARIZONA_AIF2_FRAME_CTRL_12 0x552 | 289 | #define ARIZONA_AIF2_FRAME_CTRL_12 0x552 |
290 | #define ARIZONA_AIF2_FRAME_CTRL_13 0x553 | ||
291 | #define ARIZONA_AIF2_FRAME_CTRL_14 0x554 | ||
292 | #define ARIZONA_AIF2_FRAME_CTRL_15 0x555 | ||
293 | #define ARIZONA_AIF2_FRAME_CTRL_16 0x556 | ||
284 | #define ARIZONA_AIF2_TX_ENABLES 0x559 | 294 | #define ARIZONA_AIF2_TX_ENABLES 0x559 |
285 | #define ARIZONA_AIF2_RX_ENABLES 0x55A | 295 | #define ARIZONA_AIF2_RX_ENABLES 0x55A |
286 | #define ARIZONA_AIF2_FORCE_WRITE 0x55B | 296 | #define ARIZONA_AIF2_FORCE_WRITE 0x55B |
@@ -2245,6 +2255,46 @@ | |||
2245 | #define ARIZONA_MICB3_ENA_WIDTH 1 /* MICB3_ENA */ | 2255 | #define ARIZONA_MICB3_ENA_WIDTH 1 /* MICB3_ENA */ |
2246 | 2256 | ||
2247 | /* | 2257 | /* |
2258 | * R549 (0x225) - HP Ctrl 1L | ||
2259 | */ | ||
2260 | #define ARIZONA_RMV_SHRT_HP1L 0x4000 /* RMV_SHRT_HP1L */ | ||
2261 | #define ARIZONA_RMV_SHRT_HP1L_MASK 0x4000 /* RMV_SHRT_HP1L */ | ||
2262 | #define ARIZONA_RMV_SHRT_HP1L_SHIFT 14 /* RMV_SHRT_HP1L */ | ||
2263 | #define ARIZONA_RMV_SHRT_HP1L_WIDTH 1 /* RMV_SHRT_HP1L */ | ||
2264 | #define ARIZONA_HP1L_FLWR 0x0004 /* HP1L_FLWR */ | ||
2265 | #define ARIZONA_HP1L_FLWR_MASK 0x0004 /* HP1L_FLWR */ | ||
2266 | #define ARIZONA_HP1L_FLWR_SHIFT 2 /* HP1L_FLWR */ | ||
2267 | #define ARIZONA_HP1L_FLWR_WIDTH 1 /* HP1L_FLWR */ | ||
2268 | #define ARIZONA_HP1L_SHRTI 0x0002 /* HP1L_SHRTI */ | ||
2269 | #define ARIZONA_HP1L_SHRTI_MASK 0x0002 /* HP1L_SHRTI */ | ||
2270 | #define ARIZONA_HP1L_SHRTI_SHIFT 1 /* HP1L_SHRTI */ | ||
2271 | #define ARIZONA_HP1L_SHRTI_WIDTH 1 /* HP1L_SHRTI */ | ||
2272 | #define ARIZONA_HP1L_SHRTO 0x0001 /* HP1L_SHRTO */ | ||
2273 | #define ARIZONA_HP1L_SHRTO_MASK 0x0001 /* HP1L_SHRTO */ | ||
2274 | #define ARIZONA_HP1L_SHRTO_SHIFT 0 /* HP1L_SHRTO */ | ||
2275 | #define ARIZONA_HP1L_SHRTO_WIDTH 1 /* HP1L_SHRTO */ | ||
2276 | |||
2277 | /* | ||
2278 | * R550 (0x226) - HP Ctrl 1R | ||
2279 | */ | ||
2280 | #define ARIZONA_RMV_SHRT_HP1R 0x4000 /* RMV_SHRT_HP1R */ | ||
2281 | #define ARIZONA_RMV_SHRT_HP1R_MASK 0x4000 /* RMV_SHRT_HP1R */ | ||
2282 | #define ARIZONA_RMV_SHRT_HP1R_SHIFT 14 /* RMV_SHRT_HP1R */ | ||
2283 | #define ARIZONA_RMV_SHRT_HP1R_WIDTH 1 /* RMV_SHRT_HP1R */ | ||
2284 | #define ARIZONA_HP1R_FLWR 0x0004 /* HP1R_FLWR */ | ||
2285 | #define ARIZONA_HP1R_FLWR_MASK 0x0004 /* HP1R_FLWR */ | ||
2286 | #define ARIZONA_HP1R_FLWR_SHIFT 2 /* HP1R_FLWR */ | ||
2287 | #define ARIZONA_HP1R_FLWR_WIDTH 1 /* HP1R_FLWR */ | ||
2288 | #define ARIZONA_HP1R_SHRTI 0x0002 /* HP1R_SHRTI */ | ||
2289 | #define ARIZONA_HP1R_SHRTI_MASK 0x0002 /* HP1R_SHRTI */ | ||
2290 | #define ARIZONA_HP1R_SHRTI_SHIFT 1 /* HP1R_SHRTI */ | ||
2291 | #define ARIZONA_HP1R_SHRTI_WIDTH 1 /* HP1R_SHRTI */ | ||
2292 | #define ARIZONA_HP1R_SHRTO 0x0001 /* HP1R_SHRTO */ | ||
2293 | #define ARIZONA_HP1R_SHRTO_MASK 0x0001 /* HP1R_SHRTO */ | ||
2294 | #define ARIZONA_HP1R_SHRTO_SHIFT 0 /* HP1R_SHRTO */ | ||
2295 | #define ARIZONA_HP1R_SHRTO_WIDTH 1 /* HP1R_SHRTO */ | ||
2296 | |||
2297 | /* | ||
2248 | * R659 (0x293) - Accessory Detect Mode 1 | 2298 | * R659 (0x293) - Accessory Detect Mode 1 |
2249 | */ | 2299 | */ |
2250 | #define ARIZONA_ACCDET_SRC 0x2000 /* ACCDET_SRC */ | 2300 | #define ARIZONA_ACCDET_SRC 0x2000 /* ACCDET_SRC */ |
diff --git a/include/linux/mfd/atmel-hlcdc.h b/include/linux/mfd/atmel-hlcdc.h new file mode 100644 index 000000000000..1279ab1644b5 --- /dev/null +++ b/include/linux/mfd/atmel-hlcdc.h | |||
@@ -0,0 +1,85 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2014 Free Electrons | ||
3 | * Copyright (C) 2014 Atmel | ||
4 | * | ||
5 | * Author: Boris BREZILLON <boris.brezillon@free-electrons.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 version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
14 | * more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along with | ||
17 | * this program. If not, see <http://www.gnu.org/licenses/>. | ||
18 | */ | ||
19 | |||
20 | #ifndef __LINUX_MFD_HLCDC_H | ||
21 | #define __LINUX_MFD_HLCDC_H | ||
22 | |||
23 | #include <linux/clk.h> | ||
24 | #include <linux/regmap.h> | ||
25 | |||
26 | #define ATMEL_HLCDC_CFG(i) ((i) * 0x4) | ||
27 | #define ATMEL_HLCDC_SIG_CFG LCDCFG(5) | ||
28 | #define ATMEL_HLCDC_HSPOL BIT(0) | ||
29 | #define ATMEL_HLCDC_VSPOL BIT(1) | ||
30 | #define ATMEL_HLCDC_VSPDLYS BIT(2) | ||
31 | #define ATMEL_HLCDC_VSPDLYE BIT(3) | ||
32 | #define ATMEL_HLCDC_DISPPOL BIT(4) | ||
33 | #define ATMEL_HLCDC_DITHER BIT(6) | ||
34 | #define ATMEL_HLCDC_DISPDLY BIT(7) | ||
35 | #define ATMEL_HLCDC_MODE_MASK GENMASK(9, 8) | ||
36 | #define ATMEL_HLCDC_PP BIT(10) | ||
37 | #define ATMEL_HLCDC_VSPSU BIT(12) | ||
38 | #define ATMEL_HLCDC_VSPHO BIT(13) | ||
39 | #define ATMEL_HLCDC_GUARDTIME_MASK GENMASK(20, 16) | ||
40 | |||
41 | #define ATMEL_HLCDC_EN 0x20 | ||
42 | #define ATMEL_HLCDC_DIS 0x24 | ||
43 | #define ATMEL_HLCDC_SR 0x28 | ||
44 | #define ATMEL_HLCDC_IER 0x2c | ||
45 | #define ATMEL_HLCDC_IDR 0x30 | ||
46 | #define ATMEL_HLCDC_IMR 0x34 | ||
47 | #define ATMEL_HLCDC_ISR 0x38 | ||
48 | |||
49 | #define ATMEL_HLCDC_CLKPOL BIT(0) | ||
50 | #define ATMEL_HLCDC_CLKSEL BIT(2) | ||
51 | #define ATMEL_HLCDC_CLKPWMSEL BIT(3) | ||
52 | #define ATMEL_HLCDC_CGDIS(i) BIT(8 + (i)) | ||
53 | #define ATMEL_HLCDC_CLKDIV_SHFT 16 | ||
54 | #define ATMEL_HLCDC_CLKDIV_MASK GENMASK(23, 16) | ||
55 | #define ATMEL_HLCDC_CLKDIV(div) ((div - 2) << ATMEL_HLCDC_CLKDIV_SHFT) | ||
56 | |||
57 | #define ATMEL_HLCDC_PIXEL_CLK BIT(0) | ||
58 | #define ATMEL_HLCDC_SYNC BIT(1) | ||
59 | #define ATMEL_HLCDC_DISP BIT(2) | ||
60 | #define ATMEL_HLCDC_PWM BIT(3) | ||
61 | #define ATMEL_HLCDC_SIP BIT(4) | ||
62 | |||
63 | #define ATMEL_HLCDC_SOF BIT(0) | ||
64 | #define ATMEL_HLCDC_SYNCDIS BIT(1) | ||
65 | #define ATMEL_HLCDC_FIFOERR BIT(4) | ||
66 | #define ATMEL_HLCDC_LAYER_STATUS(x) BIT((x) + 8) | ||
67 | |||
68 | /** | ||
69 | * Structure shared by the MFD device and its subdevices. | ||
70 | * | ||
71 | * @regmap: register map used to access HLCDC IP registers | ||
72 | * @periph_clk: the hlcdc peripheral clock | ||
73 | * @sys_clk: the hlcdc system clock | ||
74 | * @slow_clk: the system slow clk | ||
75 | * @irq: the hlcdc irq | ||
76 | */ | ||
77 | struct atmel_hlcdc { | ||
78 | struct regmap *regmap; | ||
79 | struct clk *periph_clk; | ||
80 | struct clk *sys_clk; | ||
81 | struct clk *slow_clk; | ||
82 | int irq; | ||
83 | }; | ||
84 | |||
85 | #endif /* __LINUX_MFD_HLCDC_H */ | ||
diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h index d0e31a2287ac..81589d176ae8 100644 --- a/include/linux/mfd/axp20x.h +++ b/include/linux/mfd/axp20x.h | |||
@@ -14,6 +14,8 @@ | |||
14 | enum { | 14 | enum { |
15 | AXP202_ID = 0, | 15 | AXP202_ID = 0, |
16 | AXP209_ID, | 16 | AXP209_ID, |
17 | AXP288_ID, | ||
18 | NR_AXP20X_VARIANTS, | ||
17 | }; | 19 | }; |
18 | 20 | ||
19 | #define AXP20X_DATACACHE(m) (0x04 + (m)) | 21 | #define AXP20X_DATACACHE(m) (0x04 + (m)) |
@@ -49,11 +51,13 @@ enum { | |||
49 | #define AXP20X_IRQ3_EN 0x42 | 51 | #define AXP20X_IRQ3_EN 0x42 |
50 | #define AXP20X_IRQ4_EN 0x43 | 52 | #define AXP20X_IRQ4_EN 0x43 |
51 | #define AXP20X_IRQ5_EN 0x44 | 53 | #define AXP20X_IRQ5_EN 0x44 |
54 | #define AXP20X_IRQ6_EN 0x45 | ||
52 | #define AXP20X_IRQ1_STATE 0x48 | 55 | #define AXP20X_IRQ1_STATE 0x48 |
53 | #define AXP20X_IRQ2_STATE 0x49 | 56 | #define AXP20X_IRQ2_STATE 0x49 |
54 | #define AXP20X_IRQ3_STATE 0x4a | 57 | #define AXP20X_IRQ3_STATE 0x4a |
55 | #define AXP20X_IRQ4_STATE 0x4b | 58 | #define AXP20X_IRQ4_STATE 0x4b |
56 | #define AXP20X_IRQ5_STATE 0x4c | 59 | #define AXP20X_IRQ5_STATE 0x4c |
60 | #define AXP20X_IRQ6_STATE 0x4d | ||
57 | 61 | ||
58 | /* ADC */ | 62 | /* ADC */ |
59 | #define AXP20X_ACIN_V_ADC_H 0x56 | 63 | #define AXP20X_ACIN_V_ADC_H 0x56 |
@@ -116,6 +120,15 @@ enum { | |||
116 | #define AXP20X_CC_CTRL 0xb8 | 120 | #define AXP20X_CC_CTRL 0xb8 |
117 | #define AXP20X_FG_RES 0xb9 | 121 | #define AXP20X_FG_RES 0xb9 |
118 | 122 | ||
123 | /* AXP288 specific registers */ | ||
124 | #define AXP288_PMIC_ADC_H 0x56 | ||
125 | #define AXP288_PMIC_ADC_L 0x57 | ||
126 | #define AXP288_ADC_TS_PIN_CTRL 0x84 | ||
127 | |||
128 | #define AXP288_PMIC_ADC_EN 0x84 | ||
129 | #define AXP288_FG_TUNE5 0xed | ||
130 | |||
131 | |||
119 | /* Regulators IDs */ | 132 | /* Regulators IDs */ |
120 | enum { | 133 | enum { |
121 | AXP20X_LDO1 = 0, | 134 | AXP20X_LDO1 = 0, |
@@ -169,12 +182,58 @@ enum { | |||
169 | AXP20X_IRQ_GPIO0_INPUT, | 182 | AXP20X_IRQ_GPIO0_INPUT, |
170 | }; | 183 | }; |
171 | 184 | ||
185 | enum axp288_irqs { | ||
186 | AXP288_IRQ_VBUS_FALL = 2, | ||
187 | AXP288_IRQ_VBUS_RISE, | ||
188 | AXP288_IRQ_OV, | ||
189 | AXP288_IRQ_FALLING_ALT, | ||
190 | AXP288_IRQ_RISING_ALT, | ||
191 | AXP288_IRQ_OV_ALT, | ||
192 | AXP288_IRQ_DONE = 10, | ||
193 | AXP288_IRQ_CHARGING, | ||
194 | AXP288_IRQ_SAFE_QUIT, | ||
195 | AXP288_IRQ_SAFE_ENTER, | ||
196 | AXP288_IRQ_ABSENT, | ||
197 | AXP288_IRQ_APPEND, | ||
198 | AXP288_IRQ_QWBTU, | ||
199 | AXP288_IRQ_WBTU, | ||
200 | AXP288_IRQ_QWBTO, | ||
201 | AXP288_IRQ_WBTO, | ||
202 | AXP288_IRQ_QCBTU, | ||
203 | AXP288_IRQ_CBTU, | ||
204 | AXP288_IRQ_QCBTO, | ||
205 | AXP288_IRQ_CBTO, | ||
206 | AXP288_IRQ_WL2, | ||
207 | AXP288_IRQ_WL1, | ||
208 | AXP288_IRQ_GPADC, | ||
209 | AXP288_IRQ_OT = 31, | ||
210 | AXP288_IRQ_GPIO0, | ||
211 | AXP288_IRQ_GPIO1, | ||
212 | AXP288_IRQ_POKO, | ||
213 | AXP288_IRQ_POKL, | ||
214 | AXP288_IRQ_POKS, | ||
215 | AXP288_IRQ_POKN, | ||
216 | AXP288_IRQ_POKP, | ||
217 | AXP288_IRQ_TIMER, | ||
218 | AXP288_IRQ_MV_CHNG, | ||
219 | AXP288_IRQ_BC_USB_CHNG, | ||
220 | }; | ||
221 | |||
222 | #define AXP288_TS_ADC_H 0x58 | ||
223 | #define AXP288_TS_ADC_L 0x59 | ||
224 | #define AXP288_GP_ADC_H 0x5a | ||
225 | #define AXP288_GP_ADC_L 0x5b | ||
226 | |||
172 | struct axp20x_dev { | 227 | struct axp20x_dev { |
173 | struct device *dev; | 228 | struct device *dev; |
174 | struct i2c_client *i2c_client; | 229 | struct i2c_client *i2c_client; |
175 | struct regmap *regmap; | 230 | struct regmap *regmap; |
176 | struct regmap_irq_chip_data *regmap_irqc; | 231 | struct regmap_irq_chip_data *regmap_irqc; |
177 | long variant; | 232 | long variant; |
233 | int nr_cells; | ||
234 | struct mfd_cell *cells; | ||
235 | const struct regmap_config *regmap_cfg; | ||
236 | const struct regmap_irq_chip *regmap_irq_chip; | ||
178 | }; | 237 | }; |
179 | 238 | ||
180 | #endif /* __LINUX_MFD_AXP20X_H */ | 239 | #endif /* __LINUX_MFD_AXP20X_H */ |
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index 73e1709d4c09..a76bc100bf97 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h | |||
@@ -111,6 +111,13 @@ extern int mfd_add_devices(struct device *parent, int id, | |||
111 | struct resource *mem_base, | 111 | struct resource *mem_base, |
112 | int irq_base, struct irq_domain *irq_domain); | 112 | int irq_base, struct irq_domain *irq_domain); |
113 | 113 | ||
114 | static inline int mfd_add_hotplug_devices(struct device *parent, | ||
115 | const struct mfd_cell *cells, int n_devs) | ||
116 | { | ||
117 | return mfd_add_devices(parent, PLATFORM_DEVID_AUTO, cells, n_devs, | ||
118 | NULL, 0, NULL); | ||
119 | } | ||
120 | |||
114 | extern void mfd_remove_devices(struct device *parent); | 121 | extern void mfd_remove_devices(struct device *parent); |
115 | 122 | ||
116 | #endif | 123 | #endif |
diff --git a/include/linux/mfd/dln2.h b/include/linux/mfd/dln2.h new file mode 100644 index 000000000000..004b24576da8 --- /dev/null +++ b/include/linux/mfd/dln2.h | |||
@@ -0,0 +1,103 @@ | |||
1 | #ifndef __LINUX_USB_DLN2_H | ||
2 | #define __LINUX_USB_DLN2_H | ||
3 | |||
4 | #define DLN2_CMD(cmd, id) ((cmd) | ((id) << 8)) | ||
5 | |||
6 | struct dln2_platform_data { | ||
7 | u16 handle; /* sub-driver handle (internally used only) */ | ||
8 | u8 port; /* I2C/SPI port */ | ||
9 | }; | ||
10 | |||
11 | /** | ||
12 | * dln2_event_cb_t - event callback function signature | ||
13 | * | ||
14 | * @pdev - the sub-device that registered this callback | ||
15 | * @echo - the echo header field received in the message | ||
16 | * @data - the data payload | ||
17 | * @len - the data payload length | ||
18 | * | ||
19 | * The callback function is called in interrupt context and the data payload is | ||
20 | * only valid during the call. If the user needs later access of the data, it | ||
21 | * must copy it. | ||
22 | */ | ||
23 | |||
24 | typedef void (*dln2_event_cb_t)(struct platform_device *pdev, u16 echo, | ||
25 | const void *data, int len); | ||
26 | |||
27 | /** | ||
28 | * dl2n_register_event_cb - register a callback function for an event | ||
29 | * | ||
30 | * @pdev - the sub-device that registers the callback | ||
31 | * @event - the event for which to register a callback | ||
32 | * @event_cb - the callback function | ||
33 | * | ||
34 | * @return 0 in case of success, negative value in case of error | ||
35 | */ | ||
36 | int dln2_register_event_cb(struct platform_device *pdev, u16 event, | ||
37 | dln2_event_cb_t event_cb); | ||
38 | |||
39 | /** | ||
40 | * dln2_unregister_event_cb - unregister the callback function for an event | ||
41 | * | ||
42 | * @pdev - the sub-device that registered the callback | ||
43 | * @event - the event for which to register a callback | ||
44 | */ | ||
45 | void dln2_unregister_event_cb(struct platform_device *pdev, u16 event); | ||
46 | |||
47 | /** | ||
48 | * dln2_transfer - issue a DLN2 command and wait for a response and the | ||
49 | * associated data | ||
50 | * | ||
51 | * @pdev - the sub-device which is issuing this transfer | ||
52 | * @cmd - the command to be sent to the device | ||
53 | * @obuf - the buffer to be sent to the device; it can be NULL if the user | ||
54 | * doesn't need to transmit data with this command | ||
55 | * @obuf_len - the size of the buffer to be sent to the device | ||
56 | * @ibuf - any data associated with the response will be copied here; it can be | ||
57 | * NULL if the user doesn't need the response data | ||
58 | * @ibuf_len - must be initialized to the input buffer size; it will be modified | ||
59 | * to indicate the actual data transferred; | ||
60 | * | ||
61 | * @return 0 for success, negative value for errors | ||
62 | */ | ||
63 | int dln2_transfer(struct platform_device *pdev, u16 cmd, | ||
64 | const void *obuf, unsigned obuf_len, | ||
65 | void *ibuf, unsigned *ibuf_len); | ||
66 | |||
67 | /** | ||
68 | * dln2_transfer_rx - variant of @dln2_transfer() where TX buffer is not needed | ||
69 | * | ||
70 | * @pdev - the sub-device which is issuing this transfer | ||
71 | * @cmd - the command to be sent to the device | ||
72 | * @ibuf - any data associated with the response will be copied here; it can be | ||
73 | * NULL if the user doesn't need the response data | ||
74 | * @ibuf_len - must be initialized to the input buffer size; it will be modified | ||
75 | * to indicate the actual data transferred; | ||
76 | * | ||
77 | * @return 0 for success, negative value for errors | ||
78 | */ | ||
79 | |||
80 | static inline int dln2_transfer_rx(struct platform_device *pdev, u16 cmd, | ||
81 | void *ibuf, unsigned *ibuf_len) | ||
82 | { | ||
83 | return dln2_transfer(pdev, cmd, NULL, 0, ibuf, ibuf_len); | ||
84 | } | ||
85 | |||
86 | /** | ||
87 | * dln2_transfer_tx - variant of @dln2_transfer() where RX buffer is not needed | ||
88 | * | ||
89 | * @pdev - the sub-device which is issuing this transfer | ||
90 | * @cmd - the command to be sent to the device | ||
91 | * @obuf - the buffer to be sent to the device; it can be NULL if the | ||
92 | * user doesn't need to transmit data with this command | ||
93 | * @obuf_len - the size of the buffer to be sent to the device | ||
94 | * | ||
95 | * @return 0 for success, negative value for errors | ||
96 | */ | ||
97 | static inline int dln2_transfer_tx(struct platform_device *pdev, u16 cmd, | ||
98 | const void *obuf, unsigned obuf_len) | ||
99 | { | ||
100 | return dln2_transfer(pdev, cmd, obuf, obuf_len, NULL, NULL); | ||
101 | } | ||
102 | |||
103 | #endif | ||
diff --git a/include/linux/mfd/max77686.h b/include/linux/mfd/max77686.h index 7e6dc4b2b795..553f7d09258a 100644 --- a/include/linux/mfd/max77686.h +++ b/include/linux/mfd/max77686.h | |||
@@ -131,13 +131,6 @@ enum max77686_opmode { | |||
131 | MAX77686_OPMODE_STANDBY, | 131 | MAX77686_OPMODE_STANDBY, |
132 | }; | 132 | }; |
133 | 133 | ||
134 | enum max77802_opmode { | ||
135 | MAX77802_OPMODE_OFF, | ||
136 | MAX77802_OPMODE_STANDBY, | ||
137 | MAX77802_OPMODE_LP, | ||
138 | MAX77802_OPMODE_NORMAL, | ||
139 | }; | ||
140 | |||
141 | struct max77686_opmode_data { | 134 | struct max77686_opmode_data { |
142 | int id; | 135 | int id; |
143 | int mode; | 136 | int mode; |
diff --git a/include/linux/mfd/max77693-private.h b/include/linux/mfd/max77693-private.h index 582e67f34054..08dae01258b9 100644 --- a/include/linux/mfd/max77693-private.h +++ b/include/linux/mfd/max77693-private.h | |||
@@ -26,7 +26,6 @@ | |||
26 | 26 | ||
27 | #include <linux/i2c.h> | 27 | #include <linux/i2c.h> |
28 | 28 | ||
29 | #define MAX77693_NUM_IRQ_MUIC_REGS 3 | ||
30 | #define MAX77693_REG_INVALID (0xff) | 29 | #define MAX77693_REG_INVALID (0xff) |
31 | 30 | ||
32 | /* Slave addr = 0xCC: PMIC, Charger, Flash LED */ | 31 | /* Slave addr = 0xCC: PMIC, Charger, Flash LED */ |
diff --git a/include/linux/mfd/rtsx_pci.h b/include/linux/mfd/rtsx_pci.h index 74346d5e7899..0c12628e91c6 100644 --- a/include/linux/mfd/rtsx_pci.h +++ b/include/linux/mfd/rtsx_pci.h | |||
@@ -558,6 +558,7 @@ | |||
558 | #define SD_SAMPLE_POINT_CTL 0xFDA7 | 558 | #define SD_SAMPLE_POINT_CTL 0xFDA7 |
559 | #define SD_PUSH_POINT_CTL 0xFDA8 | 559 | #define SD_PUSH_POINT_CTL 0xFDA8 |
560 | #define SD_CMD0 0xFDA9 | 560 | #define SD_CMD0 0xFDA9 |
561 | #define SD_CMD_START 0x40 | ||
561 | #define SD_CMD1 0xFDAA | 562 | #define SD_CMD1 0xFDAA |
562 | #define SD_CMD2 0xFDAB | 563 | #define SD_CMD2 0xFDAB |
563 | #define SD_CMD3 0xFDAC | 564 | #define SD_CMD3 0xFDAC |
@@ -707,6 +708,14 @@ | |||
707 | #define PM_CTRL1 0xFF44 | 708 | #define PM_CTRL1 0xFF44 |
708 | #define PM_CTRL2 0xFF45 | 709 | #define PM_CTRL2 0xFF45 |
709 | #define PM_CTRL3 0xFF46 | 710 | #define PM_CTRL3 0xFF46 |
711 | #define SDIO_SEND_PME_EN 0x80 | ||
712 | #define FORCE_RC_MODE_ON 0x40 | ||
713 | #define FORCE_RX50_LINK_ON 0x20 | ||
714 | #define D3_DELINK_MODE_EN 0x10 | ||
715 | #define USE_PESRTB_CTL_DELINK 0x08 | ||
716 | #define DELAY_PIN_WAKE 0x04 | ||
717 | #define RESET_PIN_WAKE 0x02 | ||
718 | #define PM_WAKE_EN 0x01 | ||
710 | #define PM_CTRL4 0xFF47 | 719 | #define PM_CTRL4 0xFF47 |
711 | 720 | ||
712 | /* Memory mapping */ | 721 | /* Memory mapping */ |
@@ -752,6 +761,14 @@ | |||
752 | #define PHY_DUM_REG 0x1F | 761 | #define PHY_DUM_REG 0x1F |
753 | 762 | ||
754 | #define LCTLR 0x80 | 763 | #define LCTLR 0x80 |
764 | #define LCTLR_EXT_SYNC 0x80 | ||
765 | #define LCTLR_COMMON_CLOCK_CFG 0x40 | ||
766 | #define LCTLR_RETRAIN_LINK 0x20 | ||
767 | #define LCTLR_LINK_DISABLE 0x10 | ||
768 | #define LCTLR_RCB 0x08 | ||
769 | #define LCTLR_RESERVED 0x04 | ||
770 | #define LCTLR_ASPM_CTL_MASK 0x03 | ||
771 | |||
755 | #define PCR_SETTING_REG1 0x724 | 772 | #define PCR_SETTING_REG1 0x724 |
756 | #define PCR_SETTING_REG2 0x814 | 773 | #define PCR_SETTING_REG2 0x814 |
757 | #define PCR_SETTING_REG3 0x747 | 774 | #define PCR_SETTING_REG3 0x747 |
@@ -967,4 +984,24 @@ static inline u8 *rtsx_pci_get_cmd_data(struct rtsx_pcr *pcr) | |||
967 | return (u8 *)(pcr->host_cmds_ptr); | 984 | return (u8 *)(pcr->host_cmds_ptr); |
968 | } | 985 | } |
969 | 986 | ||
987 | static inline int rtsx_pci_update_cfg_byte(struct rtsx_pcr *pcr, int addr, | ||
988 | u8 mask, u8 append) | ||
989 | { | ||
990 | int err; | ||
991 | u8 val; | ||
992 | |||
993 | err = pci_read_config_byte(pcr->pci, addr, &val); | ||
994 | if (err < 0) | ||
995 | return err; | ||
996 | return pci_write_config_byte(pcr->pci, addr, (val & mask) | append); | ||
997 | } | ||
998 | |||
999 | static inline void rtsx_pci_write_be32(struct rtsx_pcr *pcr, u16 reg, u32 val) | ||
1000 | { | ||
1001 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, reg, 0xFF, val >> 24); | ||
1002 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, reg + 1, 0xFF, val >> 16); | ||
1003 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, reg + 2, 0xFF, val >> 8); | ||
1004 | rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, reg + 3, 0xFF, val); | ||
1005 | } | ||
1006 | |||
970 | #endif | 1007 | #endif |
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h index 1825edacbda7..3fdb7cfbffb3 100644 --- a/include/linux/mfd/samsung/core.h +++ b/include/linux/mfd/samsung/core.h | |||
@@ -28,6 +28,7 @@ | |||
28 | #define MIN_800_MV 800000 | 28 | #define MIN_800_MV 800000 |
29 | #define MIN_750_MV 750000 | 29 | #define MIN_750_MV 750000 |
30 | #define MIN_600_MV 600000 | 30 | #define MIN_600_MV 600000 |
31 | #define MIN_500_MV 500000 | ||
31 | 32 | ||
32 | /* Macros to represent steps for LDO/BUCK */ | 33 | /* Macros to represent steps for LDO/BUCK */ |
33 | #define STEP_50_MV 50000 | 34 | #define STEP_50_MV 50000 |
@@ -41,6 +42,7 @@ enum sec_device_type { | |||
41 | S5M8767X, | 42 | S5M8767X, |
42 | S2MPA01, | 43 | S2MPA01, |
43 | S2MPS11X, | 44 | S2MPS11X, |
45 | S2MPS13X, | ||
44 | S2MPS14X, | 46 | S2MPS14X, |
45 | S2MPU02, | 47 | S2MPU02, |
46 | }; | 48 | }; |
diff --git a/include/linux/mfd/samsung/s2mps13.h b/include/linux/mfd/samsung/s2mps13.h new file mode 100644 index 000000000000..ce5dda8958fe --- /dev/null +++ b/include/linux/mfd/samsung/s2mps13.h | |||
@@ -0,0 +1,186 @@ | |||
1 | /* | ||
2 | * s2mps13.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_S2MPS13_H | ||
20 | #define __LINUX_MFD_S2MPS13_H | ||
21 | |||
22 | /* S2MPS13 registers */ | ||
23 | enum s2mps13_reg { | ||
24 | S2MPS13_REG_ID, | ||
25 | S2MPS13_REG_INT1, | ||
26 | S2MPS13_REG_INT2, | ||
27 | S2MPS13_REG_INT3, | ||
28 | S2MPS13_REG_INT1M, | ||
29 | S2MPS13_REG_INT2M, | ||
30 | S2MPS13_REG_INT3M, | ||
31 | S2MPS13_REG_ST1, | ||
32 | S2MPS13_REG_ST2, | ||
33 | S2MPS13_REG_PWRONSRC, | ||
34 | S2MPS13_REG_OFFSRC, | ||
35 | S2MPS13_REG_BU_CHG, | ||
36 | S2MPS13_REG_RTCCTRL, | ||
37 | S2MPS13_REG_CTRL1, | ||
38 | S2MPS13_REG_CTRL2, | ||
39 | S2MPS13_REG_RSVD1, | ||
40 | S2MPS13_REG_RSVD2, | ||
41 | S2MPS13_REG_RSVD3, | ||
42 | S2MPS13_REG_RSVD4, | ||
43 | S2MPS13_REG_RSVD5, | ||
44 | S2MPS13_REG_RSVD6, | ||
45 | S2MPS13_REG_CTRL3, | ||
46 | S2MPS13_REG_RSVD7, | ||
47 | S2MPS13_REG_RSVD8, | ||
48 | S2MPS13_REG_WRSTBI, | ||
49 | S2MPS13_REG_B1CTRL, | ||
50 | S2MPS13_REG_B1OUT, | ||
51 | S2MPS13_REG_B2CTRL, | ||
52 | S2MPS13_REG_B2OUT, | ||
53 | S2MPS13_REG_B3CTRL, | ||
54 | S2MPS13_REG_B3OUT, | ||
55 | S2MPS13_REG_B4CTRL, | ||
56 | S2MPS13_REG_B4OUT, | ||
57 | S2MPS13_REG_B5CTRL, | ||
58 | S2MPS13_REG_B5OUT, | ||
59 | S2MPS13_REG_B6CTRL, | ||
60 | S2MPS13_REG_B6OUT, | ||
61 | S2MPS13_REG_B7CTRL, | ||
62 | S2MPS13_REG_B7OUT, | ||
63 | S2MPS13_REG_B8CTRL, | ||
64 | S2MPS13_REG_B8OUT, | ||
65 | S2MPS13_REG_B9CTRL, | ||
66 | S2MPS13_REG_B9OUT, | ||
67 | S2MPS13_REG_B10CTRL, | ||
68 | S2MPS13_REG_B10OUT, | ||
69 | S2MPS13_REG_BB1CTRL, | ||
70 | S2MPS13_REG_BB1OUT, | ||
71 | S2MPS13_REG_BUCK_RAMP1, | ||
72 | S2MPS13_REG_BUCK_RAMP2, | ||
73 | S2MPS13_REG_LDO_DVS1, | ||
74 | S2MPS13_REG_LDO_DVS2, | ||
75 | S2MPS13_REG_LDO_DVS3, | ||
76 | S2MPS13_REG_B6OUT2, | ||
77 | S2MPS13_REG_L1CTRL, | ||
78 | S2MPS13_REG_L2CTRL, | ||
79 | S2MPS13_REG_L3CTRL, | ||
80 | S2MPS13_REG_L4CTRL, | ||
81 | S2MPS13_REG_L5CTRL, | ||
82 | S2MPS13_REG_L6CTRL, | ||
83 | S2MPS13_REG_L7CTRL, | ||
84 | S2MPS13_REG_L8CTRL, | ||
85 | S2MPS13_REG_L9CTRL, | ||
86 | S2MPS13_REG_L10CTRL, | ||
87 | S2MPS13_REG_L11CTRL, | ||
88 | S2MPS13_REG_L12CTRL, | ||
89 | S2MPS13_REG_L13CTRL, | ||
90 | S2MPS13_REG_L14CTRL, | ||
91 | S2MPS13_REG_L15CTRL, | ||
92 | S2MPS13_REG_L16CTRL, | ||
93 | S2MPS13_REG_L17CTRL, | ||
94 | S2MPS13_REG_L18CTRL, | ||
95 | S2MPS13_REG_L19CTRL, | ||
96 | S2MPS13_REG_L20CTRL, | ||
97 | S2MPS13_REG_L21CTRL, | ||
98 | S2MPS13_REG_L22CTRL, | ||
99 | S2MPS13_REG_L23CTRL, | ||
100 | S2MPS13_REG_L24CTRL, | ||
101 | S2MPS13_REG_L25CTRL, | ||
102 | S2MPS13_REG_L26CTRL, | ||
103 | S2MPS13_REG_L27CTRL, | ||
104 | S2MPS13_REG_L28CTRL, | ||
105 | S2MPS13_REG_L30CTRL, | ||
106 | S2MPS13_REG_L31CTRL, | ||
107 | S2MPS13_REG_L32CTRL, | ||
108 | S2MPS13_REG_L33CTRL, | ||
109 | S2MPS13_REG_L34CTRL, | ||
110 | S2MPS13_REG_L35CTRL, | ||
111 | S2MPS13_REG_L36CTRL, | ||
112 | S2MPS13_REG_L37CTRL, | ||
113 | S2MPS13_REG_L38CTRL, | ||
114 | S2MPS13_REG_L39CTRL, | ||
115 | S2MPS13_REG_L40CTRL, | ||
116 | S2MPS13_REG_LDODSCH1, | ||
117 | S2MPS13_REG_LDODSCH2, | ||
118 | S2MPS13_REG_LDODSCH3, | ||
119 | S2MPS13_REG_LDODSCH4, | ||
120 | S2MPS13_REG_LDODSCH5, | ||
121 | }; | ||
122 | |||
123 | /* regulator ids */ | ||
124 | enum s2mps13_regulators { | ||
125 | S2MPS13_LDO1, | ||
126 | S2MPS13_LDO2, | ||
127 | S2MPS13_LDO3, | ||
128 | S2MPS13_LDO4, | ||
129 | S2MPS13_LDO5, | ||
130 | S2MPS13_LDO6, | ||
131 | S2MPS13_LDO7, | ||
132 | S2MPS13_LDO8, | ||
133 | S2MPS13_LDO9, | ||
134 | S2MPS13_LDO10, | ||
135 | S2MPS13_LDO11, | ||
136 | S2MPS13_LDO12, | ||
137 | S2MPS13_LDO13, | ||
138 | S2MPS13_LDO14, | ||
139 | S2MPS13_LDO15, | ||
140 | S2MPS13_LDO16, | ||
141 | S2MPS13_LDO17, | ||
142 | S2MPS13_LDO18, | ||
143 | S2MPS13_LDO19, | ||
144 | S2MPS13_LDO20, | ||
145 | S2MPS13_LDO21, | ||
146 | S2MPS13_LDO22, | ||
147 | S2MPS13_LDO23, | ||
148 | S2MPS13_LDO24, | ||
149 | S2MPS13_LDO25, | ||
150 | S2MPS13_LDO26, | ||
151 | S2MPS13_LDO27, | ||
152 | S2MPS13_LDO28, | ||
153 | S2MPS13_LDO29, | ||
154 | S2MPS13_LDO30, | ||
155 | S2MPS13_LDO31, | ||
156 | S2MPS13_LDO32, | ||
157 | S2MPS13_LDO33, | ||
158 | S2MPS13_LDO34, | ||
159 | S2MPS13_LDO35, | ||
160 | S2MPS13_LDO36, | ||
161 | S2MPS13_LDO37, | ||
162 | S2MPS13_LDO38, | ||
163 | S2MPS13_LDO39, | ||
164 | S2MPS13_LDO40, | ||
165 | S2MPS13_BUCK1, | ||
166 | S2MPS13_BUCK2, | ||
167 | S2MPS13_BUCK3, | ||
168 | S2MPS13_BUCK4, | ||
169 | S2MPS13_BUCK5, | ||
170 | S2MPS13_BUCK6, | ||
171 | S2MPS13_BUCK7, | ||
172 | S2MPS13_BUCK8, | ||
173 | S2MPS13_BUCK9, | ||
174 | S2MPS13_BUCK10, | ||
175 | |||
176 | S2MPS13_REGULATOR_MAX, | ||
177 | }; | ||
178 | |||
179 | /* | ||
180 | * Default ramp delay in uv/us. Datasheet says that ramp delay can be | ||
181 | * controlled however it does not specify which register is used for that. | ||
182 | * Let's assume that default value will be set. | ||
183 | */ | ||
184 | #define S2MPS13_BUCK_RAMP_DELAY 12500 | ||
185 | |||
186 | #endif /* __LINUX_MFD_S2MPS13_H */ | ||
diff --git a/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h b/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h index ff44374a1a4e..c877cad61a13 100644 --- a/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h +++ b/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h | |||
@@ -395,4 +395,43 @@ | |||
395 | #define IMX6SL_GPR1_FEC_CLOCK_MUX1_SEL_MASK (0x3 << 17) | 395 | #define IMX6SL_GPR1_FEC_CLOCK_MUX1_SEL_MASK (0x3 << 17) |
396 | #define IMX6SL_GPR1_FEC_CLOCK_MUX2_SEL_MASK (0x1 << 14) | 396 | #define IMX6SL_GPR1_FEC_CLOCK_MUX2_SEL_MASK (0x1 << 14) |
397 | 397 | ||
398 | /* For imx6sx iomux gpr register field define */ | ||
399 | #define IMX6SX_GPR1_VDEC_SW_RST_MASK (0x1 << 20) | ||
400 | #define IMX6SX_GPR1_VDEC_SW_RST_RESET (0x1 << 20) | ||
401 | #define IMX6SX_GPR1_VDEC_SW_RST_RELEASE (0x0 << 20) | ||
402 | #define IMX6SX_GPR1_VADC_SW_RST_MASK (0x1 << 19) | ||
403 | #define IMX6SX_GPR1_VADC_SW_RST_RESET (0x1 << 19) | ||
404 | #define IMX6SX_GPR1_VADC_SW_RST_RELEASE (0x0 << 19) | ||
405 | #define IMX6SX_GPR1_FEC_CLOCK_MUX_SEL_MASK (0x3 << 13) | ||
406 | #define IMX6SX_GPR1_FEC_CLOCK_PAD_DIR_MASK (0x3 << 17) | ||
407 | #define IMX6SX_GPR1_FEC_CLOCK_MUX_SEL_EXT (0x3 << 13) | ||
408 | |||
409 | #define IMX6SX_GPR4_FEC_ENET1_STOP_REQ (0x1 << 3) | ||
410 | #define IMX6SX_GPR4_FEC_ENET2_STOP_REQ (0x1 << 4) | ||
411 | |||
412 | #define IMX6SX_GPR5_DISP_MUX_LDB_CTRL_MASK (0x1 << 3) | ||
413 | #define IMX6SX_GPR5_DISP_MUX_LDB_CTRL_LCDIF1 (0x0 << 3) | ||
414 | #define IMX6SX_GPR5_DISP_MUX_LDB_CTRL_LCDIF2 (0x1 << 3) | ||
415 | |||
416 | #define IMX6SX_GPR5_CSI2_MUX_CTRL_MASK (0x3 << 27) | ||
417 | #define IMX6SX_GPR5_CSI2_MUX_CTRL_EXT_PIN (0x0 << 27) | ||
418 | #define IMX6SX_GPR5_CSI2_MUX_CTRL_CVD (0x1 << 27) | ||
419 | #define IMX6SX_GPR5_CSI2_MUX_CTRL_VDAC_TO_CSI (0x2 << 27) | ||
420 | #define IMX6SX_GPR5_CSI2_MUX_CTRL_GND (0x3 << 27) | ||
421 | #define IMX6SX_GPR5_VADC_TO_CSI_CAPTURE_EN_MASK (0x1 << 26) | ||
422 | #define IMX6SX_GPR5_VADC_TO_CSI_CAPTURE_EN_ENABLE (0x1 << 26) | ||
423 | #define IMX6SX_GPR5_VADC_TO_CSI_CAPTURE_EN_DISABLE (0x0 << 26) | ||
424 | #define IMX6SX_GPR5_CSI1_MUX_CTRL_MASK (0x3 << 4) | ||
425 | #define IMX6SX_GPR5_CSI1_MUX_CTRL_EXT_PIN (0x0 << 4) | ||
426 | #define IMX6SX_GPR5_CSI1_MUX_CTRL_CVD (0x1 << 4) | ||
427 | #define IMX6SX_GPR5_CSI1_MUX_CTRL_VDAC_TO_CSI (0x2 << 4) | ||
428 | #define IMX6SX_GPR5_CSI1_MUX_CTRL_GND (0x3 << 4) | ||
429 | |||
430 | #define IMX6SX_GPR5_DISP_MUX_DCIC2_LCDIF2 (0x0 << 2) | ||
431 | #define IMX6SX_GPR5_DISP_MUX_DCIC2_LVDS (0x1 << 2) | ||
432 | #define IMX6SX_GPR5_DISP_MUX_DCIC2_MASK (0x1 << 2) | ||
433 | #define IMX6SX_GPR5_DISP_MUX_DCIC1_LCDIF1 (0x0 << 1) | ||
434 | #define IMX6SX_GPR5_DISP_MUX_DCIC1_LVDS (0x1 << 1) | ||
435 | #define IMX6SX_GPR5_DISP_MUX_DCIC1_MASK (0x1 << 1) | ||
436 | |||
398 | #endif /* __LINUX_IMX6Q_IOMUXC_GPR_H */ | 437 | #endif /* __LINUX_IMX6Q_IOMUXC_GPR_H */ |
diff --git a/include/linux/mfd/tc3589x.h b/include/linux/mfd/tc3589x.h index e6088c2e2092..e1c12d84c26a 100644 --- a/include/linux/mfd/tc3589x.h +++ b/include/linux/mfd/tc3589x.h | |||
@@ -164,13 +164,10 @@ struct tc3589x_keypad_platform_data { | |||
164 | 164 | ||
165 | /** | 165 | /** |
166 | * struct tc3589x_gpio_platform_data - TC3589x GPIO platform data | 166 | * struct tc3589x_gpio_platform_data - TC3589x GPIO platform data |
167 | * @gpio_base: first gpio number assigned to TC3589x. A maximum of | ||
168 | * %TC3589x_NR_GPIOS GPIOs will be allocated. | ||
169 | * @setup: callback for board-specific initialization | 167 | * @setup: callback for board-specific initialization |
170 | * @remove: callback for board-specific teardown | 168 | * @remove: callback for board-specific teardown |
171 | */ | 169 | */ |
172 | struct tc3589x_gpio_platform_data { | 170 | struct tc3589x_gpio_platform_data { |
173 | int gpio_base; | ||
174 | void (*setup)(struct tc3589x *tc3589x, unsigned gpio_base); | 171 | void (*setup)(struct tc3589x *tc3589x, unsigned gpio_base); |
175 | void (*remove)(struct tc3589x *tc3589x, unsigned gpio_base); | 172 | void (*remove)(struct tc3589x *tc3589x, unsigned gpio_base); |
176 | }; | 173 | }; |
@@ -178,18 +175,13 @@ struct tc3589x_gpio_platform_data { | |||
178 | /** | 175 | /** |
179 | * struct tc3589x_platform_data - TC3589x platform data | 176 | * struct tc3589x_platform_data - TC3589x platform data |
180 | * @block: bitmask of blocks to enable (use TC3589x_BLOCK_*) | 177 | * @block: bitmask of blocks to enable (use TC3589x_BLOCK_*) |
181 | * @irq_base: base IRQ number. %TC3589x_NR_IRQS irqs will be used. | ||
182 | * @gpio: GPIO-specific platform data | 178 | * @gpio: GPIO-specific platform data |
183 | * @keypad: keypad-specific platform data | 179 | * @keypad: keypad-specific platform data |
184 | */ | 180 | */ |
185 | struct tc3589x_platform_data { | 181 | struct tc3589x_platform_data { |
186 | unsigned int block; | 182 | unsigned int block; |
187 | int irq_base; | ||
188 | struct tc3589x_gpio_platform_data *gpio; | 183 | struct tc3589x_gpio_platform_data *gpio; |
189 | const struct tc3589x_keypad_platform_data *keypad; | 184 | const struct tc3589x_keypad_platform_data *keypad; |
190 | }; | 185 | }; |
191 | 186 | ||
192 | #define TC3589x_NR_GPIOS 24 | ||
193 | #define TC3589x_NR_IRQS TC3589x_INT_GPIO(TC3589x_NR_GPIOS) | ||
194 | |||
195 | #endif | 187 | #endif |
diff --git a/include/linux/mm.h b/include/linux/mm.h index b46461116cd2..f7606d3a0915 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -128,6 +128,7 @@ extern unsigned int kobjsize(const void *objp); | |||
128 | #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ | 128 | #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ |
129 | #define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ | 129 | #define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ |
130 | #define VM_ARCH_1 0x01000000 /* Architecture-specific flag */ | 130 | #define VM_ARCH_1 0x01000000 /* Architecture-specific flag */ |
131 | #define VM_ARCH_2 0x02000000 | ||
131 | #define VM_DONTDUMP 0x04000000 /* Do not include in the core dump */ | 132 | #define VM_DONTDUMP 0x04000000 /* Do not include in the core dump */ |
132 | 133 | ||
133 | #ifdef CONFIG_MEM_SOFT_DIRTY | 134 | #ifdef CONFIG_MEM_SOFT_DIRTY |
@@ -155,6 +156,11 @@ extern unsigned int kobjsize(const void *objp); | |||
155 | # define VM_MAPPED_COPY VM_ARCH_1 /* T if mapped copy of data (nommu mmap) */ | 156 | # define VM_MAPPED_COPY VM_ARCH_1 /* T if mapped copy of data (nommu mmap) */ |
156 | #endif | 157 | #endif |
157 | 158 | ||
159 | #if defined(CONFIG_X86) | ||
160 | /* MPX specific bounds table or bounds directory */ | ||
161 | # define VM_MPX VM_ARCH_2 | ||
162 | #endif | ||
163 | |||
158 | #ifndef VM_GROWSUP | 164 | #ifndef VM_GROWSUP |
159 | # define VM_GROWSUP VM_NONE | 165 | # define VM_GROWSUP VM_NONE |
160 | #endif | 166 | #endif |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 6e0b286649f1..bf9f57529dcf 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #define AT_VECTOR_SIZE (2*(AT_VECTOR_SIZE_ARCH + AT_VECTOR_SIZE_BASE + 1)) | 22 | #define AT_VECTOR_SIZE (2*(AT_VECTOR_SIZE_ARCH + AT_VECTOR_SIZE_BASE + 1)) |
23 | 23 | ||
24 | struct address_space; | 24 | struct address_space; |
25 | struct mem_cgroup; | ||
25 | 26 | ||
26 | #define USE_SPLIT_PTE_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS) | 27 | #define USE_SPLIT_PTE_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS) |
27 | #define USE_SPLIT_PMD_PTLOCKS (USE_SPLIT_PTE_PTLOCKS && \ | 28 | #define USE_SPLIT_PMD_PTLOCKS (USE_SPLIT_PTE_PTLOCKS && \ |
@@ -167,6 +168,10 @@ struct page { | |||
167 | struct page *first_page; /* Compound tail pages */ | 168 | struct page *first_page; /* Compound tail pages */ |
168 | }; | 169 | }; |
169 | 170 | ||
171 | #ifdef CONFIG_MEMCG | ||
172 | struct mem_cgroup *mem_cgroup; | ||
173 | #endif | ||
174 | |||
170 | /* | 175 | /* |
171 | * On machines where all RAM is mapped into kernel address space, | 176 | * On machines where all RAM is mapped into kernel address space, |
172 | * we can simply calculate the virtual address. On machines with | 177 | * we can simply calculate the virtual address. On machines with |
@@ -454,6 +459,10 @@ struct mm_struct { | |||
454 | bool tlb_flush_pending; | 459 | bool tlb_flush_pending; |
455 | #endif | 460 | #endif |
456 | struct uprobes_state uprobes_state; | 461 | struct uprobes_state uprobes_state; |
462 | #ifdef CONFIG_X86_INTEL_MPX | ||
463 | /* address of the bounds directory */ | ||
464 | void __user *bd_addr; | ||
465 | #endif | ||
457 | }; | 466 | }; |
458 | 467 | ||
459 | static inline void mm_init_cpumask(struct mm_struct *mm) | 468 | static inline void mm_init_cpumask(struct mm_struct *mm) |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index b0692d28f8e6..4d69c00497bd 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
@@ -88,6 +88,9 @@ struct mmc_ext_csd { | |||
88 | unsigned int data_tag_unit_size; /* DATA TAG UNIT size */ | 88 | unsigned int data_tag_unit_size; /* DATA TAG UNIT size */ |
89 | unsigned int boot_ro_lock; /* ro lock support */ | 89 | unsigned int boot_ro_lock; /* ro lock support */ |
90 | bool boot_ro_lockable; | 90 | bool boot_ro_lockable; |
91 | bool ffu_capable; /* Firmware upgrade support */ | ||
92 | #define MMC_FIRMWARE_LEN 8 | ||
93 | u8 fwrev[MMC_FIRMWARE_LEN]; /* FW version */ | ||
91 | u8 raw_exception_status; /* 54 */ | 94 | u8 raw_exception_status; /* 54 */ |
92 | u8 raw_partition_support; /* 160 */ | 95 | u8 raw_partition_support; /* 160 */ |
93 | u8 raw_rpmb_size_mult; /* 168 */ | 96 | u8 raw_rpmb_size_mult; /* 168 */ |
@@ -509,24 +512,8 @@ static inline int mmc_card_broken_irq_polling(const struct mmc_card *c) | |||
509 | 512 | ||
510 | #define mmc_dev_to_card(d) container_of(d, struct mmc_card, dev) | 513 | #define mmc_dev_to_card(d) container_of(d, struct mmc_card, dev) |
511 | 514 | ||
512 | #define mmc_list_to_card(l) container_of(l, struct mmc_card, node) | 515 | extern int mmc_register_driver(struct device_driver *); |
513 | #define mmc_get_drvdata(c) dev_get_drvdata(&(c)->dev) | 516 | extern void mmc_unregister_driver(struct device_driver *); |
514 | #define mmc_set_drvdata(c,d) dev_set_drvdata(&(c)->dev, d) | ||
515 | |||
516 | /* | ||
517 | * MMC device driver (e.g., Flash card, I/O card...) | ||
518 | */ | ||
519 | struct mmc_driver { | ||
520 | struct device_driver drv; | ||
521 | int (*probe)(struct mmc_card *); | ||
522 | void (*remove)(struct mmc_card *); | ||
523 | int (*suspend)(struct mmc_card *); | ||
524 | int (*resume)(struct mmc_card *); | ||
525 | void (*shutdown)(struct mmc_card *); | ||
526 | }; | ||
527 | |||
528 | extern int mmc_register_driver(struct mmc_driver *); | ||
529 | extern void mmc_unregister_driver(struct mmc_driver *); | ||
530 | 517 | ||
531 | extern void mmc_fixup_device(struct mmc_card *card, | 518 | extern void mmc_fixup_device(struct mmc_card *card, |
532 | const struct mmc_fixup *table); | 519 | const struct mmc_fixup *table); |
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index f206e29f94d7..cb2b0400d284 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h | |||
@@ -154,7 +154,8 @@ extern void mmc_start_bkops(struct mmc_card *card, bool from_exception); | |||
154 | extern int __mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int, bool, | 154 | extern int __mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int, bool, |
155 | bool, bool); | 155 | bool, bool); |
156 | extern int mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int); | 156 | extern int mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int); |
157 | extern int mmc_send_ext_csd(struct mmc_card *card, u8 *ext_csd); | 157 | extern int mmc_send_tuning(struct mmc_host *host); |
158 | extern int mmc_get_ext_csd(struct mmc_card *card, u8 **new_ext_csd); | ||
158 | 159 | ||
159 | #define MMC_ERASE_ARG 0x00000000 | 160 | #define MMC_ERASE_ARG 0x00000000 |
160 | #define MMC_SECURE_ERASE_ARG 0x80000000 | 161 | #define MMC_SECURE_ERASE_ARG 0x80000000 |
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h index 001366927cf4..42b724e8d503 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h | |||
@@ -54,6 +54,7 @@ struct mmc_data; | |||
54 | * transfer is in progress. | 54 | * transfer is in progress. |
55 | * @use_dma: Whether DMA channel is initialized or not. | 55 | * @use_dma: Whether DMA channel is initialized or not. |
56 | * @using_dma: Whether DMA is in use for the current transfer. | 56 | * @using_dma: Whether DMA is in use for the current transfer. |
57 | * @dma_64bit_address: Whether DMA supports 64-bit address mode or not. | ||
57 | * @sg_dma: Bus address of DMA buffer. | 58 | * @sg_dma: Bus address of DMA buffer. |
58 | * @sg_cpu: Virtual address of DMA buffer. | 59 | * @sg_cpu: Virtual address of DMA buffer. |
59 | * @dma_ops: Pointer to platform-specific DMA callbacks. | 60 | * @dma_ops: Pointer to platform-specific DMA callbacks. |
@@ -96,6 +97,7 @@ struct mmc_data; | |||
96 | * @quirks: Set of quirks that apply to specific versions of the IP. | 97 | * @quirks: Set of quirks that apply to specific versions of the IP. |
97 | * @irq_flags: The flags to be passed to request_irq. | 98 | * @irq_flags: The flags to be passed to request_irq. |
98 | * @irq: The irq value to be passed to request_irq. | 99 | * @irq: The irq value to be passed to request_irq. |
100 | * @sdio_id0: Number of slot0 in the SDIO interrupt registers. | ||
99 | * | 101 | * |
100 | * Locking | 102 | * Locking |
101 | * ======= | 103 | * ======= |
@@ -135,11 +137,11 @@ struct dw_mci { | |||
135 | struct mmc_command stop_abort; | 137 | struct mmc_command stop_abort; |
136 | unsigned int prev_blksz; | 138 | unsigned int prev_blksz; |
137 | unsigned char timing; | 139 | unsigned char timing; |
138 | struct workqueue_struct *card_workqueue; | ||
139 | 140 | ||
140 | /* DMA interface members*/ | 141 | /* DMA interface members*/ |
141 | int use_dma; | 142 | int use_dma; |
142 | int using_dma; | 143 | int using_dma; |
144 | int dma_64bit_address; | ||
143 | 145 | ||
144 | dma_addr_t sg_dma; | 146 | dma_addr_t sg_dma; |
145 | void *sg_cpu; | 147 | void *sg_cpu; |
@@ -154,7 +156,6 @@ struct dw_mci { | |||
154 | u32 stop_cmdr; | 156 | u32 stop_cmdr; |
155 | u32 dir_status; | 157 | u32 dir_status; |
156 | struct tasklet_struct tasklet; | 158 | struct tasklet_struct tasklet; |
157 | struct work_struct card_work; | ||
158 | unsigned long pending_events; | 159 | unsigned long pending_events; |
159 | unsigned long completed_events; | 160 | unsigned long completed_events; |
160 | enum dw_mci_state state; | 161 | enum dw_mci_state state; |
@@ -193,6 +194,8 @@ struct dw_mci { | |||
193 | bool vqmmc_enabled; | 194 | bool vqmmc_enabled; |
194 | unsigned long irq_flags; /* IRQ flags */ | 195 | unsigned long irq_flags; /* IRQ flags */ |
195 | int irq; | 196 | int irq; |
197 | |||
198 | int sdio_id0; | ||
196 | }; | 199 | }; |
197 | 200 | ||
198 | /* DMA ops for Internal/External DMAC interface */ | 201 | /* DMA ops for Internal/External DMAC interface */ |
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index df0c15396bbf..9f322706f7cb 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -289,6 +289,7 @@ struct mmc_host { | |||
289 | #define MMC_CAP2_HS400_1_2V (1 << 16) /* Can support HS400 1.2V */ | 289 | #define MMC_CAP2_HS400_1_2V (1 << 16) /* Can support HS400 1.2V */ |
290 | #define MMC_CAP2_HS400 (MMC_CAP2_HS400_1_8V | \ | 290 | #define MMC_CAP2_HS400 (MMC_CAP2_HS400_1_8V | \ |
291 | MMC_CAP2_HS400_1_2V) | 291 | MMC_CAP2_HS400_1_2V) |
292 | #define MMC_CAP2_HSX00_1_2V (MMC_CAP2_HS200_1_2V_SDR | MMC_CAP2_HS400_1_2V) | ||
292 | #define MMC_CAP2_SDIO_IRQ_NOTHREAD (1 << 17) | 293 | #define MMC_CAP2_SDIO_IRQ_NOTHREAD (1 << 17) |
293 | 294 | ||
294 | mmc_pm_flag_t pm_caps; /* supported pm features */ | 295 | mmc_pm_flag_t pm_caps; /* supported pm features */ |
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 1cd00b3a75b9..49ad7a943638 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
@@ -296,6 +296,7 @@ struct _mmc_csd { | |||
296 | #define EXT_CSD_SANITIZE_START 165 /* W */ | 296 | #define EXT_CSD_SANITIZE_START 165 /* W */ |
297 | #define EXT_CSD_WR_REL_PARAM 166 /* RO */ | 297 | #define EXT_CSD_WR_REL_PARAM 166 /* RO */ |
298 | #define EXT_CSD_RPMB_MULT 168 /* RO */ | 298 | #define EXT_CSD_RPMB_MULT 168 /* RO */ |
299 | #define EXT_CSD_FW_CONFIG 169 /* R/W */ | ||
299 | #define EXT_CSD_BOOT_WP 173 /* R/W */ | 300 | #define EXT_CSD_BOOT_WP 173 /* R/W */ |
300 | #define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ | 301 | #define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ |
301 | #define EXT_CSD_PART_CONFIG 179 /* R/W */ | 302 | #define EXT_CSD_PART_CONFIG 179 /* R/W */ |
@@ -332,6 +333,8 @@ struct _mmc_csd { | |||
332 | #define EXT_CSD_GENERIC_CMD6_TIME 248 /* RO */ | 333 | #define EXT_CSD_GENERIC_CMD6_TIME 248 /* RO */ |
333 | #define EXT_CSD_CACHE_SIZE 249 /* RO, 4 bytes */ | 334 | #define EXT_CSD_CACHE_SIZE 249 /* RO, 4 bytes */ |
334 | #define EXT_CSD_PWR_CL_DDR_200_360 253 /* RO */ | 335 | #define EXT_CSD_PWR_CL_DDR_200_360 253 /* RO */ |
336 | #define EXT_CSD_FIRMWARE_VERSION 254 /* RO, 8 bytes */ | ||
337 | #define EXT_CSD_SUPPORTED_MODE 493 /* RO */ | ||
335 | #define EXT_CSD_TAG_UNIT_SIZE 498 /* RO */ | 338 | #define EXT_CSD_TAG_UNIT_SIZE 498 /* RO */ |
336 | #define EXT_CSD_DATA_TAG_SUPPORT 499 /* RO */ | 339 | #define EXT_CSD_DATA_TAG_SUPPORT 499 /* RO */ |
337 | #define EXT_CSD_MAX_PACKED_WRITES 500 /* RO */ | 340 | #define EXT_CSD_MAX_PACKED_WRITES 500 /* RO */ |
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index dba793e3a331..375af80bde7d 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h | |||
@@ -100,6 +100,12 @@ struct sdhci_host { | |||
100 | #define SDHCI_QUIRK2_BROKEN_DDR50 (1<<7) | 100 | #define SDHCI_QUIRK2_BROKEN_DDR50 (1<<7) |
101 | /* Stop command (CMD12) can set Transfer Complete when not using MMC_RSP_BUSY */ | 101 | /* Stop command (CMD12) can set Transfer Complete when not using MMC_RSP_BUSY */ |
102 | #define SDHCI_QUIRK2_STOP_WITH_TC (1<<8) | 102 | #define SDHCI_QUIRK2_STOP_WITH_TC (1<<8) |
103 | /* Controller does not support 64-bit DMA */ | ||
104 | #define SDHCI_QUIRK2_BROKEN_64_BIT_DMA (1<<9) | ||
105 | /* need clear transfer mode register before send cmd */ | ||
106 | #define SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD (1<<10) | ||
107 | /* Capability register bit-63 indicates HS400 support */ | ||
108 | #define SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400 (1<<11) | ||
103 | 109 | ||
104 | int irq; /* Device IRQ */ | 110 | int irq; /* Device IRQ */ |
105 | void __iomem *ioaddr; /* Mapped address */ | 111 | void __iomem *ioaddr; /* Mapped address */ |
@@ -130,6 +136,7 @@ struct sdhci_host { | |||
130 | #define SDHCI_SDIO_IRQ_ENABLED (1<<9) /* SDIO irq enabled */ | 136 | #define SDHCI_SDIO_IRQ_ENABLED (1<<9) /* SDIO irq enabled */ |
131 | #define SDHCI_SDR104_NEEDS_TUNING (1<<10) /* SDR104/HS200 needs tuning */ | 137 | #define SDHCI_SDR104_NEEDS_TUNING (1<<10) /* SDR104/HS200 needs tuning */ |
132 | #define SDHCI_USING_RETUNING_TIMER (1<<11) /* Host is using a retuning timer for the card */ | 138 | #define SDHCI_USING_RETUNING_TIMER (1<<11) /* Host is using a retuning timer for the card */ |
139 | #define SDHCI_USE_64_BIT_DMA (1<<12) /* Use 64-bit DMA */ | ||
133 | 140 | ||
134 | unsigned int version; /* SDHCI spec. version */ | 141 | unsigned int version; /* SDHCI spec. version */ |
135 | 142 | ||
@@ -155,12 +162,19 @@ struct sdhci_host { | |||
155 | 162 | ||
156 | int sg_count; /* Mapped sg entries */ | 163 | int sg_count; /* Mapped sg entries */ |
157 | 164 | ||
158 | u8 *adma_desc; /* ADMA descriptor table */ | 165 | void *adma_table; /* ADMA descriptor table */ |
159 | u8 *align_buffer; /* Bounce buffer */ | 166 | void *align_buffer; /* Bounce buffer */ |
167 | |||
168 | size_t adma_table_sz; /* ADMA descriptor table size */ | ||
169 | size_t align_buffer_sz; /* Bounce buffer size */ | ||
160 | 170 | ||
161 | dma_addr_t adma_addr; /* Mapped ADMA descr. table */ | 171 | dma_addr_t adma_addr; /* Mapped ADMA descr. table */ |
162 | dma_addr_t align_addr; /* Mapped bounce buffer */ | 172 | dma_addr_t align_addr; /* Mapped bounce buffer */ |
163 | 173 | ||
174 | unsigned int desc_sz; /* ADMA descriptor size */ | ||
175 | unsigned int align_sz; /* ADMA alignment */ | ||
176 | unsigned int align_mask; /* ADMA alignment mask */ | ||
177 | |||
164 | struct tasklet_struct finish_tasklet; /* Tasklet structures */ | 178 | struct tasklet_struct finish_tasklet; /* Tasklet structures */ |
165 | 179 | ||
166 | struct timer_list timer; /* Timer for timeouts */ | 180 | struct timer_list timer; /* Timer for timeouts */ |
diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h index 50f0bc952328..aab032a6ae61 100644 --- a/include/linux/mmc/sdio_func.h +++ b/include/linux/mmc/sdio_func.h | |||
@@ -84,8 +84,6 @@ struct sdio_driver { | |||
84 | struct device_driver drv; | 84 | struct device_driver drv; |
85 | }; | 85 | }; |
86 | 86 | ||
87 | #define to_sdio_driver(d) container_of(d, struct sdio_driver, drv) | ||
88 | |||
89 | /** | 87 | /** |
90 | * SDIO_DEVICE - macro used to describe a specific SDIO device | 88 | * SDIO_DEVICE - macro used to describe a specific SDIO device |
91 | * @vend: the 16 bit manufacturer code | 89 | * @vend: the 16 bit manufacturer code |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index ffe66e381c04..3879d7664dfc 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -722,9 +722,6 @@ typedef struct pglist_data { | |||
722 | int nr_zones; | 722 | int nr_zones; |
723 | #ifdef CONFIG_FLAT_NODE_MEM_MAP /* means !SPARSEMEM */ | 723 | #ifdef CONFIG_FLAT_NODE_MEM_MAP /* means !SPARSEMEM */ |
724 | struct page *node_mem_map; | 724 | struct page *node_mem_map; |
725 | #ifdef CONFIG_MEMCG | ||
726 | struct page_cgroup *node_page_cgroup; | ||
727 | #endif | ||
728 | #endif | 725 | #endif |
729 | #ifndef CONFIG_NO_BOOTMEM | 726 | #ifndef CONFIG_NO_BOOTMEM |
730 | struct bootmem_data *bdata; | 727 | struct bootmem_data *bdata; |
@@ -1078,7 +1075,6 @@ static inline unsigned long early_pfn_to_nid(unsigned long pfn) | |||
1078 | #define SECTION_ALIGN_DOWN(pfn) ((pfn) & PAGE_SECTION_MASK) | 1075 | #define SECTION_ALIGN_DOWN(pfn) ((pfn) & PAGE_SECTION_MASK) |
1079 | 1076 | ||
1080 | struct page; | 1077 | struct page; |
1081 | struct page_cgroup; | ||
1082 | struct mem_section { | 1078 | struct mem_section { |
1083 | /* | 1079 | /* |
1084 | * This is, logically, a pointer to an array of struct | 1080 | * This is, logically, a pointer to an array of struct |
@@ -1096,14 +1092,6 @@ struct mem_section { | |||
1096 | 1092 | ||
1097 | /* See declaration of similar field in struct zone */ | 1093 | /* See declaration of similar field in struct zone */ |
1098 | unsigned long *pageblock_flags; | 1094 | unsigned long *pageblock_flags; |
1099 | #ifdef CONFIG_MEMCG | ||
1100 | /* | ||
1101 | * If !SPARSEMEM, pgdat doesn't have page_cgroup pointer. We use | ||
1102 | * section. (see memcontrol.h/page_cgroup.h about this.) | ||
1103 | */ | ||
1104 | struct page_cgroup *page_cgroup; | ||
1105 | unsigned long pad; | ||
1106 | #endif | ||
1107 | /* | 1095 | /* |
1108 | * WARNING: mem_section must be a power-of-2 in size for the | 1096 | * WARNING: mem_section must be a power-of-2 in size for the |
1109 | * calculation and use of SECTION_ROOT_MASK to make sense. | 1097 | * calculation and use of SECTION_ROOT_MASK to make sense. |
diff --git a/include/linux/msi.h b/include/linux/msi.h index 44f4746d033b..8ac4a68ffae2 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h | |||
@@ -10,17 +10,12 @@ struct msi_msg { | |||
10 | u32 data; /* 16 bits of msi message data */ | 10 | u32 data; /* 16 bits of msi message data */ |
11 | }; | 11 | }; |
12 | 12 | ||
13 | extern int pci_msi_ignore_mask; | ||
13 | /* Helper functions */ | 14 | /* Helper functions */ |
14 | struct irq_data; | 15 | struct irq_data; |
15 | struct msi_desc; | 16 | struct msi_desc; |
16 | void mask_msi_irq(struct irq_data *data); | ||
17 | void unmask_msi_irq(struct irq_data *data); | ||
18 | void __read_msi_msg(struct msi_desc *entry, struct msi_msg *msg); | ||
19 | void __get_cached_msi_msg(struct msi_desc *entry, struct msi_msg *msg); | 17 | void __get_cached_msi_msg(struct msi_desc *entry, struct msi_msg *msg); |
20 | void __write_msi_msg(struct msi_desc *entry, struct msi_msg *msg); | ||
21 | void read_msi_msg(unsigned int irq, struct msi_msg *msg); | ||
22 | void get_cached_msi_msg(unsigned int irq, struct msi_msg *msg); | 18 | void get_cached_msi_msg(unsigned int irq, struct msi_msg *msg); |
23 | void write_msi_msg(unsigned int irq, struct msi_msg *msg); | ||
24 | 19 | ||
25 | struct msi_desc { | 20 | struct msi_desc { |
26 | struct { | 21 | struct { |
@@ -48,6 +43,52 @@ struct msi_desc { | |||
48 | struct msi_msg msg; | 43 | struct msi_msg msg; |
49 | }; | 44 | }; |
50 | 45 | ||
46 | /* Helpers to hide struct msi_desc implementation details */ | ||
47 | #define msi_desc_to_dev(desc) (&(desc)->dev.dev) | ||
48 | #define dev_to_msi_list(dev) (&to_pci_dev((dev))->msi_list) | ||
49 | #define first_msi_entry(dev) \ | ||
50 | list_first_entry(dev_to_msi_list((dev)), struct msi_desc, list) | ||
51 | #define for_each_msi_entry(desc, dev) \ | ||
52 | list_for_each_entry((desc), dev_to_msi_list((dev)), list) | ||
53 | |||
54 | #ifdef CONFIG_PCI_MSI | ||
55 | #define first_pci_msi_entry(pdev) first_msi_entry(&(pdev)->dev) | ||
56 | #define for_each_pci_msi_entry(desc, pdev) \ | ||
57 | for_each_msi_entry((desc), &(pdev)->dev) | ||
58 | |||
59 | static inline struct pci_dev *msi_desc_to_pci_dev(struct msi_desc *desc) | ||
60 | { | ||
61 | return desc->dev; | ||
62 | } | ||
63 | #endif /* CONFIG_PCI_MSI */ | ||
64 | |||
65 | void __pci_read_msi_msg(struct msi_desc *entry, struct msi_msg *msg); | ||
66 | void __pci_write_msi_msg(struct msi_desc *entry, struct msi_msg *msg); | ||
67 | void pci_write_msi_msg(unsigned int irq, struct msi_msg *msg); | ||
68 | |||
69 | u32 __pci_msix_desc_mask_irq(struct msi_desc *desc, u32 flag); | ||
70 | u32 __pci_msi_desc_mask_irq(struct msi_desc *desc, u32 mask, u32 flag); | ||
71 | void pci_msi_mask_irq(struct irq_data *data); | ||
72 | void pci_msi_unmask_irq(struct irq_data *data); | ||
73 | |||
74 | /* Conversion helpers. Should be removed after merging */ | ||
75 | static inline void __write_msi_msg(struct msi_desc *entry, struct msi_msg *msg) | ||
76 | { | ||
77 | __pci_write_msi_msg(entry, msg); | ||
78 | } | ||
79 | static inline void write_msi_msg(int irq, struct msi_msg *msg) | ||
80 | { | ||
81 | pci_write_msi_msg(irq, msg); | ||
82 | } | ||
83 | static inline void mask_msi_irq(struct irq_data *data) | ||
84 | { | ||
85 | pci_msi_mask_irq(data); | ||
86 | } | ||
87 | static inline void unmask_msi_irq(struct irq_data *data) | ||
88 | { | ||
89 | pci_msi_unmask_irq(data); | ||
90 | } | ||
91 | |||
51 | /* | 92 | /* |
52 | * The arch hooks to setup up msi irqs. Those functions are | 93 | * The arch hooks to setup up msi irqs. Those functions are |
53 | * implemented as weak symbols so that they /can/ be overriden by | 94 | * implemented as weak symbols so that they /can/ be overriden by |
@@ -61,18 +102,142 @@ void arch_restore_msi_irqs(struct pci_dev *dev); | |||
61 | 102 | ||
62 | void default_teardown_msi_irqs(struct pci_dev *dev); | 103 | void default_teardown_msi_irqs(struct pci_dev *dev); |
63 | void default_restore_msi_irqs(struct pci_dev *dev); | 104 | void default_restore_msi_irqs(struct pci_dev *dev); |
64 | u32 default_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag); | ||
65 | u32 default_msix_mask_irq(struct msi_desc *desc, u32 flag); | ||
66 | 105 | ||
67 | struct msi_chip { | 106 | struct msi_controller { |
68 | struct module *owner; | 107 | struct module *owner; |
69 | struct device *dev; | 108 | struct device *dev; |
70 | struct device_node *of_node; | 109 | struct device_node *of_node; |
71 | struct list_head list; | 110 | struct list_head list; |
111 | #ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN | ||
112 | struct irq_domain *domain; | ||
113 | #endif | ||
72 | 114 | ||
73 | int (*setup_irq)(struct msi_chip *chip, struct pci_dev *dev, | 115 | int (*setup_irq)(struct msi_controller *chip, struct pci_dev *dev, |
74 | struct msi_desc *desc); | 116 | struct msi_desc *desc); |
75 | void (*teardown_irq)(struct msi_chip *chip, unsigned int irq); | 117 | void (*teardown_irq)(struct msi_controller *chip, unsigned int irq); |
118 | }; | ||
119 | |||
120 | #ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN | ||
121 | |||
122 | #include <linux/irqhandler.h> | ||
123 | #include <asm/msi.h> | ||
124 | |||
125 | struct irq_domain; | ||
126 | struct irq_chip; | ||
127 | struct device_node; | ||
128 | struct msi_domain_info; | ||
129 | |||
130 | /** | ||
131 | * struct msi_domain_ops - MSI interrupt domain callbacks | ||
132 | * @get_hwirq: Retrieve the resulting hw irq number | ||
133 | * @msi_init: Domain specific init function for MSI interrupts | ||
134 | * @msi_free: Domain specific function to free a MSI interrupts | ||
135 | * @msi_check: Callback for verification of the domain/info/dev data | ||
136 | * @msi_prepare: Prepare the allocation of the interrupts in the domain | ||
137 | * @msi_finish: Optional callbacl to finalize the allocation | ||
138 | * @set_desc: Set the msi descriptor for an interrupt | ||
139 | * @handle_error: Optional error handler if the allocation fails | ||
140 | * | ||
141 | * @get_hwirq, @msi_init and @msi_free are callbacks used by | ||
142 | * msi_create_irq_domain() and related interfaces | ||
143 | * | ||
144 | * @msi_check, @msi_prepare, @msi_finish, @set_desc and @handle_error | ||
145 | * are callbacks used by msi_irq_domain_alloc_irqs() and related | ||
146 | * interfaces which are based on msi_desc. | ||
147 | */ | ||
148 | struct msi_domain_ops { | ||
149 | irq_hw_number_t (*get_hwirq)(struct msi_domain_info *info, | ||
150 | msi_alloc_info_t *arg); | ||
151 | int (*msi_init)(struct irq_domain *domain, | ||
152 | struct msi_domain_info *info, | ||
153 | unsigned int virq, irq_hw_number_t hwirq, | ||
154 | msi_alloc_info_t *arg); | ||
155 | void (*msi_free)(struct irq_domain *domain, | ||
156 | struct msi_domain_info *info, | ||
157 | unsigned int virq); | ||
158 | int (*msi_check)(struct irq_domain *domain, | ||
159 | struct msi_domain_info *info, | ||
160 | struct device *dev); | ||
161 | int (*msi_prepare)(struct irq_domain *domain, | ||
162 | struct device *dev, int nvec, | ||
163 | msi_alloc_info_t *arg); | ||
164 | void (*msi_finish)(msi_alloc_info_t *arg, int retval); | ||
165 | void (*set_desc)(msi_alloc_info_t *arg, | ||
166 | struct msi_desc *desc); | ||
167 | int (*handle_error)(struct irq_domain *domain, | ||
168 | struct msi_desc *desc, int error); | ||
169 | }; | ||
170 | |||
171 | /** | ||
172 | * struct msi_domain_info - MSI interrupt domain data | ||
173 | * @flags: Flags to decribe features and capabilities | ||
174 | * @ops: The callback data structure | ||
175 | * @chip: Optional: associated interrupt chip | ||
176 | * @chip_data: Optional: associated interrupt chip data | ||
177 | * @handler: Optional: associated interrupt flow handler | ||
178 | * @handler_data: Optional: associated interrupt flow handler data | ||
179 | * @handler_name: Optional: associated interrupt flow handler name | ||
180 | * @data: Optional: domain specific data | ||
181 | */ | ||
182 | struct msi_domain_info { | ||
183 | u32 flags; | ||
184 | struct msi_domain_ops *ops; | ||
185 | struct irq_chip *chip; | ||
186 | void *chip_data; | ||
187 | irq_flow_handler_t handler; | ||
188 | void *handler_data; | ||
189 | const char *handler_name; | ||
190 | void *data; | ||
191 | }; | ||
192 | |||
193 | /* Flags for msi_domain_info */ | ||
194 | enum { | ||
195 | /* | ||
196 | * Init non implemented ops callbacks with default MSI domain | ||
197 | * callbacks. | ||
198 | */ | ||
199 | MSI_FLAG_USE_DEF_DOM_OPS = (1 << 0), | ||
200 | /* | ||
201 | * Init non implemented chip callbacks with default MSI chip | ||
202 | * callbacks. | ||
203 | */ | ||
204 | MSI_FLAG_USE_DEF_CHIP_OPS = (1 << 1), | ||
205 | /* Build identity map between hwirq and irq */ | ||
206 | MSI_FLAG_IDENTITY_MAP = (1 << 2), | ||
207 | /* Support multiple PCI MSI interrupts */ | ||
208 | MSI_FLAG_MULTI_PCI_MSI = (1 << 3), | ||
209 | /* Support PCI MSIX interrupts */ | ||
210 | MSI_FLAG_PCI_MSIX = (1 << 4), | ||
76 | }; | 211 | }; |
77 | 212 | ||
213 | int msi_domain_set_affinity(struct irq_data *data, const struct cpumask *mask, | ||
214 | bool force); | ||
215 | |||
216 | struct irq_domain *msi_create_irq_domain(struct device_node *of_node, | ||
217 | struct msi_domain_info *info, | ||
218 | struct irq_domain *parent); | ||
219 | int msi_domain_alloc_irqs(struct irq_domain *domain, struct device *dev, | ||
220 | int nvec); | ||
221 | void msi_domain_free_irqs(struct irq_domain *domain, struct device *dev); | ||
222 | struct msi_domain_info *msi_get_domain_info(struct irq_domain *domain); | ||
223 | |||
224 | #endif /* CONFIG_GENERIC_MSI_IRQ_DOMAIN */ | ||
225 | |||
226 | #ifdef CONFIG_PCI_MSI_IRQ_DOMAIN | ||
227 | void pci_msi_domain_write_msg(struct irq_data *irq_data, struct msi_msg *msg); | ||
228 | struct irq_domain *pci_msi_create_irq_domain(struct device_node *node, | ||
229 | struct msi_domain_info *info, | ||
230 | struct irq_domain *parent); | ||
231 | int pci_msi_domain_alloc_irqs(struct irq_domain *domain, struct pci_dev *dev, | ||
232 | int nvec, int type); | ||
233 | void pci_msi_domain_free_irqs(struct irq_domain *domain, struct pci_dev *dev); | ||
234 | struct irq_domain *pci_msi_create_default_irq_domain(struct device_node *node, | ||
235 | struct msi_domain_info *info, struct irq_domain *parent); | ||
236 | |||
237 | irq_hw_number_t pci_msi_domain_calc_hwirq(struct pci_dev *dev, | ||
238 | struct msi_desc *desc); | ||
239 | int pci_msi_domain_check_cap(struct irq_domain *domain, | ||
240 | struct msi_domain_info *info, struct device *dev); | ||
241 | #endif /* CONFIG_PCI_MSI_IRQ_DOMAIN */ | ||
242 | |||
78 | #endif /* LINUX_MSI_H */ | 243 | #endif /* LINUX_MSI_H */ |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 356acc2846fd..022b761dbf0a 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -490,6 +490,8 @@ enum { | |||
490 | 490 | ||
491 | /* nfs42 */ | 491 | /* nfs42 */ |
492 | NFSPROC4_CLNT_SEEK, | 492 | NFSPROC4_CLNT_SEEK, |
493 | NFSPROC4_CLNT_ALLOCATE, | ||
494 | NFSPROC4_CLNT_DEALLOCATE, | ||
493 | }; | 495 | }; |
494 | 496 | ||
495 | /* nfs41 types */ | 497 | /* nfs41 types */ |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index c72d1ad41ad4..6d627b92df53 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -163,7 +163,7 @@ struct nfs_inode { | |||
163 | */ | 163 | */ |
164 | __be32 cookieverf[2]; | 164 | __be32 cookieverf[2]; |
165 | 165 | ||
166 | unsigned long npages; | 166 | unsigned long nrequests; |
167 | struct nfs_mds_commit_info commit_info; | 167 | struct nfs_mds_commit_info commit_info; |
168 | 168 | ||
169 | /* Open contexts for shared mmap writes */ | 169 | /* Open contexts for shared mmap writes */ |
@@ -520,7 +520,7 @@ extern void nfs_commit_free(struct nfs_commit_data *data); | |||
520 | static inline int | 520 | static inline int |
521 | nfs_have_writebacks(struct inode *inode) | 521 | nfs_have_writebacks(struct inode *inode) |
522 | { | 522 | { |
523 | return NFS_I(inode)->npages != 0; | 523 | return NFS_I(inode)->nrequests != 0; |
524 | } | 524 | } |
525 | 525 | ||
526 | /* | 526 | /* |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index a32ba0d7a98f..1e37fbb78f7a 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
@@ -231,5 +231,7 @@ struct nfs_server { | |||
231 | #define NFS_CAP_ATOMIC_OPEN_V1 (1U << 17) | 231 | #define NFS_CAP_ATOMIC_OPEN_V1 (1U << 17) |
232 | #define NFS_CAP_SECURITY_LABEL (1U << 18) | 232 | #define NFS_CAP_SECURITY_LABEL (1U << 18) |
233 | #define NFS_CAP_SEEK (1U << 19) | 233 | #define NFS_CAP_SEEK (1U << 19) |
234 | #define NFS_CAP_ALLOCATE (1U << 20) | ||
235 | #define NFS_CAP_DEALLOCATE (1U << 21) | ||
234 | 236 | ||
235 | #endif | 237 | #endif |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 47ebb4fafd87..467c84efb596 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -1243,6 +1243,20 @@ nfs_free_pnfs_ds_cinfo(struct pnfs_ds_commit_info *cinfo) | |||
1243 | #endif /* CONFIG_NFS_V4_1 */ | 1243 | #endif /* CONFIG_NFS_V4_1 */ |
1244 | 1244 | ||
1245 | #ifdef CONFIG_NFS_V4_2 | 1245 | #ifdef CONFIG_NFS_V4_2 |
1246 | struct nfs42_falloc_args { | ||
1247 | struct nfs4_sequence_args seq_args; | ||
1248 | |||
1249 | struct nfs_fh *falloc_fh; | ||
1250 | nfs4_stateid falloc_stateid; | ||
1251 | u64 falloc_offset; | ||
1252 | u64 falloc_length; | ||
1253 | }; | ||
1254 | |||
1255 | struct nfs42_falloc_res { | ||
1256 | struct nfs4_sequence_res seq_res; | ||
1257 | unsigned int status; | ||
1258 | }; | ||
1259 | |||
1246 | struct nfs42_seek_args { | 1260 | struct nfs42_seek_args { |
1247 | struct nfs4_sequence_args seq_args; | 1261 | struct nfs4_sequence_args seq_args; |
1248 | 1262 | ||
diff --git a/include/linux/of.h b/include/linux/of.h index 29f0adc5f3e4..1a66b8881c01 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/spinlock.h> | 23 | #include <linux/spinlock.h> |
24 | #include <linux/topology.h> | 24 | #include <linux/topology.h> |
25 | #include <linux/notifier.h> | 25 | #include <linux/notifier.h> |
26 | #include <linux/property.h> | ||
26 | 27 | ||
27 | #include <asm/byteorder.h> | 28 | #include <asm/byteorder.h> |
28 | #include <asm/errno.h> | 29 | #include <asm/errno.h> |
@@ -49,6 +50,7 @@ struct device_node { | |||
49 | const char *type; | 50 | const char *type; |
50 | phandle phandle; | 51 | phandle phandle; |
51 | const char *full_name; | 52 | const char *full_name; |
53 | struct fwnode_handle fwnode; | ||
52 | 54 | ||
53 | struct property *properties; | 55 | struct property *properties; |
54 | struct property *deadprops; /* removed properties */ | 56 | struct property *deadprops; /* removed properties */ |
@@ -79,6 +81,7 @@ extern struct kobj_type of_node_ktype; | |||
79 | static inline void of_node_init(struct device_node *node) | 81 | static inline void of_node_init(struct device_node *node) |
80 | { | 82 | { |
81 | kobject_init(&node->kobj, &of_node_ktype); | 83 | kobject_init(&node->kobj, &of_node_ktype); |
84 | node->fwnode.type = FWNODE_OF; | ||
82 | } | 85 | } |
83 | 86 | ||
84 | /* true when node is initialized */ | 87 | /* true when node is initialized */ |
@@ -114,6 +117,16 @@ extern struct device_node *of_aliases; | |||
114 | extern struct device_node *of_stdout; | 117 | extern struct device_node *of_stdout; |
115 | extern raw_spinlock_t devtree_lock; | 118 | extern raw_spinlock_t devtree_lock; |
116 | 119 | ||
120 | static inline bool is_of_node(struct fwnode_handle *fwnode) | ||
121 | { | ||
122 | return fwnode && fwnode->type == FWNODE_OF; | ||
123 | } | ||
124 | |||
125 | static inline struct device_node *of_node(struct fwnode_handle *fwnode) | ||
126 | { | ||
127 | return fwnode ? container_of(fwnode, struct device_node, fwnode) : NULL; | ||
128 | } | ||
129 | |||
117 | static inline bool of_have_populated_dt(void) | 130 | static inline bool of_have_populated_dt(void) |
118 | { | 131 | { |
119 | return of_allnodes != NULL; | 132 | return of_allnodes != NULL; |
@@ -263,6 +276,10 @@ extern int of_property_read_u32_array(const struct device_node *np, | |||
263 | size_t sz); | 276 | size_t sz); |
264 | extern int of_property_read_u64(const struct device_node *np, | 277 | extern int of_property_read_u64(const struct device_node *np, |
265 | const char *propname, u64 *out_value); | 278 | const char *propname, u64 *out_value); |
279 | extern int of_property_read_u64_array(const struct device_node *np, | ||
280 | const char *propname, | ||
281 | u64 *out_values, | ||
282 | size_t sz); | ||
266 | 283 | ||
267 | extern int of_property_read_string(struct device_node *np, | 284 | extern int of_property_read_string(struct device_node *np, |
268 | const char *propname, | 285 | const char *propname, |
@@ -355,6 +372,16 @@ bool of_console_check(struct device_node *dn, char *name, int index); | |||
355 | 372 | ||
356 | #else /* CONFIG_OF */ | 373 | #else /* CONFIG_OF */ |
357 | 374 | ||
375 | static inline bool is_of_node(struct fwnode_handle *fwnode) | ||
376 | { | ||
377 | return false; | ||
378 | } | ||
379 | |||
380 | static inline struct device_node *of_node(struct fwnode_handle *fwnode) | ||
381 | { | ||
382 | return NULL; | ||
383 | } | ||
384 | |||
358 | static inline const char* of_node_full_name(const struct device_node *np) | 385 | static inline const char* of_node_full_name(const struct device_node *np) |
359 | { | 386 | { |
360 | return "<no-node>"; | 387 | return "<no-node>"; |
@@ -477,6 +504,13 @@ static inline int of_property_read_u32_array(const struct device_node *np, | |||
477 | return -ENOSYS; | 504 | return -ENOSYS; |
478 | } | 505 | } |
479 | 506 | ||
507 | static inline int of_property_read_u64_array(const struct device_node *np, | ||
508 | const char *propname, | ||
509 | u64 *out_values, size_t sz) | ||
510 | { | ||
511 | return -ENOSYS; | ||
512 | } | ||
513 | |||
480 | static inline int of_property_read_string(struct device_node *np, | 514 | static inline int of_property_read_string(struct device_node *np, |
481 | const char *propname, | 515 | const char *propname, |
482 | const char **out_string) | 516 | const char **out_string) |
@@ -922,4 +956,15 @@ static inline int of_changeset_update_property(struct of_changeset *ocs, | |||
922 | /* CONFIG_OF_RESOLVE api */ | 956 | /* CONFIG_OF_RESOLVE api */ |
923 | extern int of_resolve_phandles(struct device_node *tree); | 957 | extern int of_resolve_phandles(struct device_node *tree); |
924 | 958 | ||
959 | /** | ||
960 | * of_device_is_system_power_controller - Tells if system-power-controller is found for device_node | ||
961 | * @np: Pointer to the given device_node | ||
962 | * | ||
963 | * return true if present false otherwise | ||
964 | */ | ||
965 | static inline bool of_device_is_system_power_controller(const struct device_node *np) | ||
966 | { | ||
967 | return of_property_read_bool(np, "system-power-controller"); | ||
968 | } | ||
969 | |||
925 | #endif /* _LINUX_OF_H */ | 970 | #endif /* _LINUX_OF_H */ |
diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h index 1fd207e7a847..ce0e5abeb454 100644 --- a/include/linux/of_pci.h +++ b/include/linux/of_pci.h | |||
@@ -59,13 +59,13 @@ int of_pci_get_host_bridge_resources(struct device_node *dev, | |||
59 | #endif | 59 | #endif |
60 | 60 | ||
61 | #if defined(CONFIG_OF) && defined(CONFIG_PCI_MSI) | 61 | #if defined(CONFIG_OF) && defined(CONFIG_PCI_MSI) |
62 | int of_pci_msi_chip_add(struct msi_chip *chip); | 62 | int of_pci_msi_chip_add(struct msi_controller *chip); |
63 | void of_pci_msi_chip_remove(struct msi_chip *chip); | 63 | void of_pci_msi_chip_remove(struct msi_controller *chip); |
64 | struct msi_chip *of_pci_find_msi_chip_by_node(struct device_node *of_node); | 64 | struct msi_controller *of_pci_find_msi_chip_by_node(struct device_node *of_node); |
65 | #else | 65 | #else |
66 | static inline int of_pci_msi_chip_add(struct msi_chip *chip) { return -EINVAL; } | 66 | static inline int of_pci_msi_chip_add(struct msi_controller *chip) { return -EINVAL; } |
67 | static inline void of_pci_msi_chip_remove(struct msi_chip *chip) { } | 67 | static inline void of_pci_msi_chip_remove(struct msi_controller *chip) { } |
68 | static inline struct msi_chip * | 68 | static inline struct msi_controller * |
69 | of_pci_find_msi_chip_by_node(struct device_node *of_node) { return NULL; } | 69 | of_pci_find_msi_chip_by_node(struct device_node *of_node) { return NULL; } |
70 | #endif | 70 | #endif |
71 | 71 | ||
diff --git a/include/linux/omap-gpmc.h b/include/linux/omap-gpmc.h new file mode 100644 index 000000000000..c2080eebbb47 --- /dev/null +++ b/include/linux/omap-gpmc.h | |||
@@ -0,0 +1,199 @@ | |||
1 | /* | ||
2 | * OMAP GPMC (General Purpose Memory Controller) defines | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms of the GNU General Public License as published by the | ||
6 | * Free Software Foundation; either version 2 of the License, or (at your | ||
7 | * option) any later version. | ||
8 | */ | ||
9 | |||
10 | /* Maximum Number of Chip Selects */ | ||
11 | #define GPMC_CS_NUM 8 | ||
12 | |||
13 | #define GPMC_CONFIG_WP 0x00000005 | ||
14 | |||
15 | #define GPMC_IRQ_FIFOEVENTENABLE 0x01 | ||
16 | #define GPMC_IRQ_COUNT_EVENT 0x02 | ||
17 | |||
18 | #define GPMC_BURST_4 4 /* 4 word burst */ | ||
19 | #define GPMC_BURST_8 8 /* 8 word burst */ | ||
20 | #define GPMC_BURST_16 16 /* 16 word burst */ | ||
21 | #define GPMC_DEVWIDTH_8BIT 1 /* 8-bit device width */ | ||
22 | #define GPMC_DEVWIDTH_16BIT 2 /* 16-bit device width */ | ||
23 | #define GPMC_MUX_AAD 1 /* Addr-Addr-Data multiplex */ | ||
24 | #define GPMC_MUX_AD 2 /* Addr-Data multiplex */ | ||
25 | |||
26 | /* bool type time settings */ | ||
27 | struct gpmc_bool_timings { | ||
28 | bool cycle2cyclediffcsen; | ||
29 | bool cycle2cyclesamecsen; | ||
30 | bool we_extra_delay; | ||
31 | bool oe_extra_delay; | ||
32 | bool adv_extra_delay; | ||
33 | bool cs_extra_delay; | ||
34 | bool time_para_granularity; | ||
35 | }; | ||
36 | |||
37 | /* | ||
38 | * Note that all values in this struct are in nanoseconds except sync_clk | ||
39 | * (which is in picoseconds), while the register values are in gpmc_fck cycles. | ||
40 | */ | ||
41 | struct gpmc_timings { | ||
42 | /* Minimum clock period for synchronous mode (in picoseconds) */ | ||
43 | u32 sync_clk; | ||
44 | |||
45 | /* Chip-select signal timings corresponding to GPMC_CS_CONFIG2 */ | ||
46 | u32 cs_on; /* Assertion time */ | ||
47 | u32 cs_rd_off; /* Read deassertion time */ | ||
48 | u32 cs_wr_off; /* Write deassertion time */ | ||
49 | |||
50 | /* ADV signal timings corresponding to GPMC_CONFIG3 */ | ||
51 | u32 adv_on; /* Assertion time */ | ||
52 | u32 adv_rd_off; /* Read deassertion time */ | ||
53 | u32 adv_wr_off; /* Write deassertion time */ | ||
54 | |||
55 | /* WE signals timings corresponding to GPMC_CONFIG4 */ | ||
56 | u32 we_on; /* WE assertion time */ | ||
57 | u32 we_off; /* WE deassertion time */ | ||
58 | |||
59 | /* OE signals timings corresponding to GPMC_CONFIG4 */ | ||
60 | u32 oe_on; /* OE assertion time */ | ||
61 | u32 oe_off; /* OE deassertion time */ | ||
62 | |||
63 | /* Access time and cycle time timings corresponding to GPMC_CONFIG5 */ | ||
64 | u32 page_burst_access; /* Multiple access word delay */ | ||
65 | u32 access; /* Start-cycle to first data valid delay */ | ||
66 | u32 rd_cycle; /* Total read cycle time */ | ||
67 | u32 wr_cycle; /* Total write cycle time */ | ||
68 | |||
69 | u32 bus_turnaround; | ||
70 | u32 cycle2cycle_delay; | ||
71 | |||
72 | u32 wait_monitoring; | ||
73 | u32 clk_activation; | ||
74 | |||
75 | /* The following are only on OMAP3430 */ | ||
76 | u32 wr_access; /* WRACCESSTIME */ | ||
77 | u32 wr_data_mux_bus; /* WRDATAONADMUXBUS */ | ||
78 | |||
79 | struct gpmc_bool_timings bool_timings; | ||
80 | }; | ||
81 | |||
82 | /* Device timings in picoseconds */ | ||
83 | struct gpmc_device_timings { | ||
84 | u32 t_ceasu; /* address setup to CS valid */ | ||
85 | u32 t_avdasu; /* address setup to ADV valid */ | ||
86 | /* XXX: try to combine t_avdp_r & t_avdp_w. Issue is | ||
87 | * of tusb using these timings even for sync whilst | ||
88 | * ideally for adv_rd/(wr)_off it should have considered | ||
89 | * t_avdh instead. This indirectly necessitates r/w | ||
90 | * variations of t_avdp as it is possible to have one | ||
91 | * sync & other async | ||
92 | */ | ||
93 | u32 t_avdp_r; /* ADV low time (what about t_cer ?) */ | ||
94 | u32 t_avdp_w; | ||
95 | u32 t_aavdh; /* address hold time */ | ||
96 | u32 t_oeasu; /* address setup to OE valid */ | ||
97 | u32 t_aa; /* access time from ADV assertion */ | ||
98 | u32 t_iaa; /* initial access time */ | ||
99 | u32 t_oe; /* access time from OE assertion */ | ||
100 | u32 t_ce; /* access time from CS asertion */ | ||
101 | u32 t_rd_cycle; /* read cycle time */ | ||
102 | u32 t_cez_r; /* read CS deassertion to high Z */ | ||
103 | u32 t_cez_w; /* write CS deassertion to high Z */ | ||
104 | u32 t_oez; /* OE deassertion to high Z */ | ||
105 | u32 t_weasu; /* address setup to WE valid */ | ||
106 | u32 t_wpl; /* write assertion time */ | ||
107 | u32 t_wph; /* write deassertion time */ | ||
108 | u32 t_wr_cycle; /* write cycle time */ | ||
109 | |||
110 | u32 clk; | ||
111 | u32 t_bacc; /* burst access valid clock to output delay */ | ||
112 | u32 t_ces; /* CS setup time to clk */ | ||
113 | u32 t_avds; /* ADV setup time to clk */ | ||
114 | u32 t_avdh; /* ADV hold time from clk */ | ||
115 | u32 t_ach; /* address hold time from clk */ | ||
116 | u32 t_rdyo; /* clk to ready valid */ | ||
117 | |||
118 | u32 t_ce_rdyz; /* XXX: description ?, or use t_cez instead */ | ||
119 | u32 t_ce_avd; /* CS on to ADV on delay */ | ||
120 | |||
121 | /* XXX: check the possibility of combining | ||
122 | * cyc_aavhd_oe & cyc_aavdh_we | ||
123 | */ | ||
124 | u8 cyc_aavdh_oe;/* read address hold time in cycles */ | ||
125 | u8 cyc_aavdh_we;/* write address hold time in cycles */ | ||
126 | u8 cyc_oe; /* access time from OE assertion in cycles */ | ||
127 | u8 cyc_wpl; /* write deassertion time in cycles */ | ||
128 | u32 cyc_iaa; /* initial access time in cycles */ | ||
129 | |||
130 | /* extra delays */ | ||
131 | bool ce_xdelay; | ||
132 | bool avd_xdelay; | ||
133 | bool oe_xdelay; | ||
134 | bool we_xdelay; | ||
135 | }; | ||
136 | |||
137 | struct gpmc_settings { | ||
138 | bool burst_wrap; /* enables wrap bursting */ | ||
139 | bool burst_read; /* enables read page/burst mode */ | ||
140 | bool burst_write; /* enables write page/burst mode */ | ||
141 | bool device_nand; /* device is NAND */ | ||
142 | bool sync_read; /* enables synchronous reads */ | ||
143 | bool sync_write; /* enables synchronous writes */ | ||
144 | bool wait_on_read; /* monitor wait on reads */ | ||
145 | bool wait_on_write; /* monitor wait on writes */ | ||
146 | u32 burst_len; /* page/burst length */ | ||
147 | u32 device_width; /* device bus width (8 or 16 bit) */ | ||
148 | u32 mux_add_data; /* multiplex address & data */ | ||
149 | u32 wait_pin; /* wait-pin to be used */ | ||
150 | }; | ||
151 | |||
152 | extern int gpmc_calc_timings(struct gpmc_timings *gpmc_t, | ||
153 | struct gpmc_settings *gpmc_s, | ||
154 | struct gpmc_device_timings *dev_t); | ||
155 | |||
156 | struct gpmc_nand_regs; | ||
157 | struct device_node; | ||
158 | |||
159 | extern void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs); | ||
160 | extern int gpmc_get_client_irq(unsigned irq_config); | ||
161 | |||
162 | extern unsigned int gpmc_ticks_to_ns(unsigned int ticks); | ||
163 | |||
164 | extern void gpmc_cs_write_reg(int cs, int idx, u32 val); | ||
165 | extern int gpmc_calc_divider(unsigned int sync_clk); | ||
166 | extern int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t); | ||
167 | extern int gpmc_cs_program_settings(int cs, struct gpmc_settings *p); | ||
168 | extern int gpmc_cs_request(int cs, unsigned long size, unsigned long *base); | ||
169 | extern void gpmc_cs_free(int cs); | ||
170 | extern int gpmc_configure(int cmd, int wval); | ||
171 | extern void gpmc_read_settings_dt(struct device_node *np, | ||
172 | struct gpmc_settings *p); | ||
173 | |||
174 | extern void omap3_gpmc_save_context(void); | ||
175 | extern void omap3_gpmc_restore_context(void); | ||
176 | |||
177 | struct gpmc_timings; | ||
178 | struct omap_nand_platform_data; | ||
179 | struct omap_onenand_platform_data; | ||
180 | |||
181 | #if IS_ENABLED(CONFIG_MTD_NAND_OMAP2) | ||
182 | extern int gpmc_nand_init(struct omap_nand_platform_data *d, | ||
183 | struct gpmc_timings *gpmc_t); | ||
184 | #else | ||
185 | static inline int gpmc_nand_init(struct omap_nand_platform_data *d, | ||
186 | struct gpmc_timings *gpmc_t) | ||
187 | { | ||
188 | return 0; | ||
189 | } | ||
190 | #endif | ||
191 | |||
192 | #if IS_ENABLED(CONFIG_MTD_ONENAND_OMAP2) | ||
193 | extern void gpmc_onenand_init(struct omap_onenand_platform_data *d); | ||
194 | #else | ||
195 | #define board_onenand_data NULL | ||
196 | static inline void gpmc_onenand_init(struct omap_onenand_platform_data *d) | ||
197 | { | ||
198 | } | ||
199 | #endif | ||
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h deleted file mode 100644 index 5c831f1eca79..000000000000 --- a/include/linux/page_cgroup.h +++ /dev/null | |||
@@ -1,105 +0,0 @@ | |||
1 | #ifndef __LINUX_PAGE_CGROUP_H | ||
2 | #define __LINUX_PAGE_CGROUP_H | ||
3 | |||
4 | enum { | ||
5 | /* flags for mem_cgroup */ | ||
6 | PCG_USED = 0x01, /* This page is charged to a memcg */ | ||
7 | PCG_MEM = 0x02, /* This page holds a memory charge */ | ||
8 | PCG_MEMSW = 0x04, /* This page holds a memory+swap charge */ | ||
9 | }; | ||
10 | |||
11 | struct pglist_data; | ||
12 | |||
13 | #ifdef CONFIG_MEMCG | ||
14 | struct mem_cgroup; | ||
15 | |||
16 | /* | ||
17 | * Page Cgroup can be considered as an extended mem_map. | ||
18 | * A page_cgroup page is associated with every page descriptor. The | ||
19 | * page_cgroup helps us identify information about the cgroup | ||
20 | * All page cgroups are allocated at boot or memory hotplug event, | ||
21 | * then the page cgroup for pfn always exists. | ||
22 | */ | ||
23 | struct page_cgroup { | ||
24 | unsigned long flags; | ||
25 | struct mem_cgroup *mem_cgroup; | ||
26 | }; | ||
27 | |||
28 | extern void pgdat_page_cgroup_init(struct pglist_data *pgdat); | ||
29 | |||
30 | #ifdef CONFIG_SPARSEMEM | ||
31 | static inline void page_cgroup_init_flatmem(void) | ||
32 | { | ||
33 | } | ||
34 | extern void page_cgroup_init(void); | ||
35 | #else | ||
36 | extern void page_cgroup_init_flatmem(void); | ||
37 | static inline void page_cgroup_init(void) | ||
38 | { | ||
39 | } | ||
40 | #endif | ||
41 | |||
42 | struct page_cgroup *lookup_page_cgroup(struct page *page); | ||
43 | |||
44 | static inline int PageCgroupUsed(struct page_cgroup *pc) | ||
45 | { | ||
46 | return !!(pc->flags & PCG_USED); | ||
47 | } | ||
48 | #else /* !CONFIG_MEMCG */ | ||
49 | struct page_cgroup; | ||
50 | |||
51 | static inline void pgdat_page_cgroup_init(struct pglist_data *pgdat) | ||
52 | { | ||
53 | } | ||
54 | |||
55 | static inline struct page_cgroup *lookup_page_cgroup(struct page *page) | ||
56 | { | ||
57 | return NULL; | ||
58 | } | ||
59 | |||
60 | static inline void page_cgroup_init(void) | ||
61 | { | ||
62 | } | ||
63 | |||
64 | static inline void page_cgroup_init_flatmem(void) | ||
65 | { | ||
66 | } | ||
67 | #endif /* CONFIG_MEMCG */ | ||
68 | |||
69 | #include <linux/swap.h> | ||
70 | |||
71 | #ifdef CONFIG_MEMCG_SWAP | ||
72 | extern unsigned short swap_cgroup_cmpxchg(swp_entry_t ent, | ||
73 | unsigned short old, unsigned short new); | ||
74 | extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id); | ||
75 | extern unsigned short lookup_swap_cgroup_id(swp_entry_t ent); | ||
76 | extern int swap_cgroup_swapon(int type, unsigned long max_pages); | ||
77 | extern void swap_cgroup_swapoff(int type); | ||
78 | #else | ||
79 | |||
80 | static inline | ||
81 | unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id) | ||
82 | { | ||
83 | return 0; | ||
84 | } | ||
85 | |||
86 | static inline | ||
87 | unsigned short lookup_swap_cgroup_id(swp_entry_t ent) | ||
88 | { | ||
89 | return 0; | ||
90 | } | ||
91 | |||
92 | static inline int | ||
93 | swap_cgroup_swapon(int type, unsigned long max_pages) | ||
94 | { | ||
95 | return 0; | ||
96 | } | ||
97 | |||
98 | static inline void swap_cgroup_swapoff(int type) | ||
99 | { | ||
100 | return; | ||
101 | } | ||
102 | |||
103 | #endif /* CONFIG_MEMCG_SWAP */ | ||
104 | |||
105 | #endif /* __LINUX_PAGE_CGROUP_H */ | ||
diff --git a/include/linux/page_counter.h b/include/linux/page_counter.h new file mode 100644 index 000000000000..955421575d16 --- /dev/null +++ b/include/linux/page_counter.h | |||
@@ -0,0 +1,51 @@ | |||
1 | #ifndef _LINUX_PAGE_COUNTER_H | ||
2 | #define _LINUX_PAGE_COUNTER_H | ||
3 | |||
4 | #include <linux/atomic.h> | ||
5 | #include <linux/kernel.h> | ||
6 | #include <asm/page.h> | ||
7 | |||
8 | struct page_counter { | ||
9 | atomic_long_t count; | ||
10 | unsigned long limit; | ||
11 | struct page_counter *parent; | ||
12 | |||
13 | /* legacy */ | ||
14 | unsigned long watermark; | ||
15 | unsigned long failcnt; | ||
16 | }; | ||
17 | |||
18 | #if BITS_PER_LONG == 32 | ||
19 | #define PAGE_COUNTER_MAX LONG_MAX | ||
20 | #else | ||
21 | #define PAGE_COUNTER_MAX (LONG_MAX / PAGE_SIZE) | ||
22 | #endif | ||
23 | |||
24 | static inline void page_counter_init(struct page_counter *counter, | ||
25 | struct page_counter *parent) | ||
26 | { | ||
27 | atomic_long_set(&counter->count, 0); | ||
28 | counter->limit = PAGE_COUNTER_MAX; | ||
29 | counter->parent = parent; | ||
30 | } | ||
31 | |||
32 | static inline unsigned long page_counter_read(struct page_counter *counter) | ||
33 | { | ||
34 | return atomic_long_read(&counter->count); | ||
35 | } | ||
36 | |||
37 | void page_counter_cancel(struct page_counter *counter, unsigned long nr_pages); | ||
38 | void page_counter_charge(struct page_counter *counter, unsigned long nr_pages); | ||
39 | int page_counter_try_charge(struct page_counter *counter, | ||
40 | unsigned long nr_pages, | ||
41 | struct page_counter **fail); | ||
42 | void page_counter_uncharge(struct page_counter *counter, unsigned long nr_pages); | ||
43 | int page_counter_limit(struct page_counter *counter, unsigned long limit); | ||
44 | int page_counter_memparse(const char *buf, unsigned long *nr_pages); | ||
45 | |||
46 | static inline void page_counter_reset_watermark(struct page_counter *counter) | ||
47 | { | ||
48 | counter->watermark = page_counter_read(counter); | ||
49 | } | ||
50 | |||
51 | #endif /* _LINUX_PAGE_COUNTER_H */ | ||
diff --git a/include/linux/pci.h b/include/linux/pci.h index 4c8ac5fcc224..a523cee3abb5 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -450,7 +450,7 @@ struct pci_bus { | |||
450 | struct resource busn_res; /* bus numbers routed to this bus */ | 450 | struct resource busn_res; /* bus numbers routed to this bus */ |
451 | 451 | ||
452 | struct pci_ops *ops; /* configuration access functions */ | 452 | struct pci_ops *ops; /* configuration access functions */ |
453 | struct msi_chip *msi; /* MSI controller */ | 453 | struct msi_controller *msi; /* MSI controller */ |
454 | void *sysdata; /* hook for sys-specific extension */ | 454 | void *sysdata; /* hook for sys-specific extension */ |
455 | struct proc_dir_entry *procdir; /* directory entry in /proc/bus/pci */ | 455 | struct proc_dir_entry *procdir; /* directory entry in /proc/bus/pci */ |
456 | 456 | ||
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h index 2706ee9a4327..8c7895061121 100644 --- a/include/linux/pci_hotplug.h +++ b/include/linux/pci_hotplug.h | |||
@@ -109,7 +109,6 @@ struct hotplug_slot { | |||
109 | struct list_head slot_list; | 109 | struct list_head slot_list; |
110 | struct pci_slot *pci_slot; | 110 | struct pci_slot *pci_slot; |
111 | }; | 111 | }; |
112 | #define to_hotplug_slot(n) container_of(n, struct hotplug_slot, kobj) | ||
113 | 112 | ||
114 | static inline const char *hotplug_slot_name(const struct hotplug_slot *slot) | 113 | static inline const char *hotplug_slot_name(const struct hotplug_slot *slot) |
115 | { | 114 | { |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 1fa99a301817..97fb9f69aaed 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -522,6 +522,8 @@ | |||
522 | #define PCI_DEVICE_ID_AMD_15H_M10H_F3 0x1403 | 522 | #define PCI_DEVICE_ID_AMD_15H_M10H_F3 0x1403 |
523 | #define PCI_DEVICE_ID_AMD_15H_M30H_NB_F3 0x141d | 523 | #define PCI_DEVICE_ID_AMD_15H_M30H_NB_F3 0x141d |
524 | #define PCI_DEVICE_ID_AMD_15H_M30H_NB_F4 0x141e | 524 | #define PCI_DEVICE_ID_AMD_15H_M30H_NB_F4 0x141e |
525 | #define PCI_DEVICE_ID_AMD_15H_M60H_NB_F3 0x1573 | ||
526 | #define PCI_DEVICE_ID_AMD_15H_M60H_NB_F4 0x1574 | ||
525 | #define PCI_DEVICE_ID_AMD_15H_NB_F0 0x1600 | 527 | #define PCI_DEVICE_ID_AMD_15H_NB_F0 0x1600 |
526 | #define PCI_DEVICE_ID_AMD_15H_NB_F1 0x1601 | 528 | #define PCI_DEVICE_ID_AMD_15H_NB_F1 0x1601 |
527 | #define PCI_DEVICE_ID_AMD_15H_NB_F2 0x1602 | 529 | #define PCI_DEVICE_ID_AMD_15H_NB_F2 0x1602 |
diff --git a/include/linux/percpu-refcount.h b/include/linux/percpu-refcount.h index 51ce60c35f4c..530b249f7ea4 100644 --- a/include/linux/percpu-refcount.h +++ b/include/linux/percpu-refcount.h | |||
@@ -147,28 +147,42 @@ static inline bool __ref_is_percpu(struct percpu_ref *ref, | |||
147 | } | 147 | } |
148 | 148 | ||
149 | /** | 149 | /** |
150 | * percpu_ref_get - increment a percpu refcount | 150 | * percpu_ref_get_many - increment a percpu refcount |
151 | * @ref: percpu_ref to get | 151 | * @ref: percpu_ref to get |
152 | * @nr: number of references to get | ||
152 | * | 153 | * |
153 | * Analagous to atomic_long_inc(). | 154 | * Analogous to atomic_long_add(). |
154 | * | 155 | * |
155 | * This function is safe to call as long as @ref is between init and exit. | 156 | * This function is safe to call as long as @ref is between init and exit. |
156 | */ | 157 | */ |
157 | static inline void percpu_ref_get(struct percpu_ref *ref) | 158 | static inline void percpu_ref_get_many(struct percpu_ref *ref, unsigned long nr) |
158 | { | 159 | { |
159 | unsigned long __percpu *percpu_count; | 160 | unsigned long __percpu *percpu_count; |
160 | 161 | ||
161 | rcu_read_lock_sched(); | 162 | rcu_read_lock_sched(); |
162 | 163 | ||
163 | if (__ref_is_percpu(ref, &percpu_count)) | 164 | if (__ref_is_percpu(ref, &percpu_count)) |
164 | this_cpu_inc(*percpu_count); | 165 | this_cpu_add(*percpu_count, nr); |
165 | else | 166 | else |
166 | atomic_long_inc(&ref->count); | 167 | atomic_long_add(nr, &ref->count); |
167 | 168 | ||
168 | rcu_read_unlock_sched(); | 169 | rcu_read_unlock_sched(); |
169 | } | 170 | } |
170 | 171 | ||
171 | /** | 172 | /** |
173 | * percpu_ref_get - increment a percpu refcount | ||
174 | * @ref: percpu_ref to get | ||
175 | * | ||
176 | * Analagous to atomic_long_inc(). | ||
177 | * | ||
178 | * This function is safe to call as long as @ref is between init and exit. | ||
179 | */ | ||
180 | static inline void percpu_ref_get(struct percpu_ref *ref) | ||
181 | { | ||
182 | percpu_ref_get_many(ref, 1); | ||
183 | } | ||
184 | |||
185 | /** | ||
172 | * percpu_ref_tryget - try to increment a percpu refcount | 186 | * percpu_ref_tryget - try to increment a percpu refcount |
173 | * @ref: percpu_ref to try-get | 187 | * @ref: percpu_ref to try-get |
174 | * | 188 | * |
@@ -231,29 +245,44 @@ static inline bool percpu_ref_tryget_live(struct percpu_ref *ref) | |||
231 | } | 245 | } |
232 | 246 | ||
233 | /** | 247 | /** |
234 | * percpu_ref_put - decrement a percpu refcount | 248 | * percpu_ref_put_many - decrement a percpu refcount |
235 | * @ref: percpu_ref to put | 249 | * @ref: percpu_ref to put |
250 | * @nr: number of references to put | ||
236 | * | 251 | * |
237 | * Decrement the refcount, and if 0, call the release function (which was passed | 252 | * Decrement the refcount, and if 0, call the release function (which was passed |
238 | * to percpu_ref_init()) | 253 | * to percpu_ref_init()) |
239 | * | 254 | * |
240 | * This function is safe to call as long as @ref is between init and exit. | 255 | * This function is safe to call as long as @ref is between init and exit. |
241 | */ | 256 | */ |
242 | static inline void percpu_ref_put(struct percpu_ref *ref) | 257 | static inline void percpu_ref_put_many(struct percpu_ref *ref, unsigned long nr) |
243 | { | 258 | { |
244 | unsigned long __percpu *percpu_count; | 259 | unsigned long __percpu *percpu_count; |
245 | 260 | ||
246 | rcu_read_lock_sched(); | 261 | rcu_read_lock_sched(); |
247 | 262 | ||
248 | if (__ref_is_percpu(ref, &percpu_count)) | 263 | if (__ref_is_percpu(ref, &percpu_count)) |
249 | this_cpu_dec(*percpu_count); | 264 | this_cpu_sub(*percpu_count, nr); |
250 | else if (unlikely(atomic_long_dec_and_test(&ref->count))) | 265 | else if (unlikely(atomic_long_sub_and_test(nr, &ref->count))) |
251 | ref->release(ref); | 266 | ref->release(ref); |
252 | 267 | ||
253 | rcu_read_unlock_sched(); | 268 | rcu_read_unlock_sched(); |
254 | } | 269 | } |
255 | 270 | ||
256 | /** | 271 | /** |
272 | * percpu_ref_put - decrement a percpu refcount | ||
273 | * @ref: percpu_ref to put | ||
274 | * | ||
275 | * Decrement the refcount, and if 0, call the release function (which was passed | ||
276 | * to percpu_ref_init()) | ||
277 | * | ||
278 | * This function is safe to call as long as @ref is between init and exit. | ||
279 | */ | ||
280 | static inline void percpu_ref_put(struct percpu_ref *ref) | ||
281 | { | ||
282 | percpu_ref_put_many(ref, 1); | ||
283 | } | ||
284 | |||
285 | /** | ||
257 | * percpu_ref_is_zero - test whether a percpu refcount reached zero | 286 | * percpu_ref_is_zero - test whether a percpu refcount reached zero |
258 | * @ref: percpu_ref to test | 287 | * @ref: percpu_ref to test |
259 | * | 288 | * |
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index a3aa63e47637..caebf2a758dc 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/preempt.h> | 5 | #include <linux/preempt.h> |
6 | #include <linux/smp.h> | 6 | #include <linux/smp.h> |
7 | #include <linux/cpumask.h> | 7 | #include <linux/cpumask.h> |
8 | #include <linux/printk.h> | ||
8 | #include <linux/pfn.h> | 9 | #include <linux/pfn.h> |
9 | #include <linux/init.h> | 10 | #include <linux/init.h> |
10 | 11 | ||
@@ -134,4 +135,7 @@ extern phys_addr_t per_cpu_ptr_to_phys(void *addr); | |||
134 | (typeof(type) __percpu *)__alloc_percpu(sizeof(type), \ | 135 | (typeof(type) __percpu *)__alloc_percpu(sizeof(type), \ |
135 | __alignof__(type)) | 136 | __alignof__(type)) |
136 | 137 | ||
138 | /* To avoid include hell, as printk can not declare this, we declare it here */ | ||
139 | DECLARE_PER_CPU(printk_func_t, printk_func); | ||
140 | |||
137 | #endif /* __LINUX_PERCPU_H */ | 141 | #endif /* __LINUX_PERCPU_H */ |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 893a0d07986f..486e84ccb1f9 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -79,7 +79,7 @@ struct perf_branch_stack { | |||
79 | struct perf_branch_entry entries[0]; | 79 | struct perf_branch_entry entries[0]; |
80 | }; | 80 | }; |
81 | 81 | ||
82 | struct perf_regs_user { | 82 | struct perf_regs { |
83 | __u64 abi; | 83 | __u64 abi; |
84 | struct pt_regs *regs; | 84 | struct pt_regs *regs; |
85 | }; | 85 | }; |
@@ -580,34 +580,40 @@ extern u64 perf_event_read_value(struct perf_event *event, | |||
580 | 580 | ||
581 | 581 | ||
582 | struct perf_sample_data { | 582 | struct perf_sample_data { |
583 | u64 type; | 583 | /* |
584 | * Fields set by perf_sample_data_init(), group so as to | ||
585 | * minimize the cachelines touched. | ||
586 | */ | ||
587 | u64 addr; | ||
588 | struct perf_raw_record *raw; | ||
589 | struct perf_branch_stack *br_stack; | ||
590 | u64 period; | ||
591 | u64 weight; | ||
592 | u64 txn; | ||
593 | union perf_mem_data_src data_src; | ||
584 | 594 | ||
595 | /* | ||
596 | * The other fields, optionally {set,used} by | ||
597 | * perf_{prepare,output}_sample(). | ||
598 | */ | ||
599 | u64 type; | ||
585 | u64 ip; | 600 | u64 ip; |
586 | struct { | 601 | struct { |
587 | u32 pid; | 602 | u32 pid; |
588 | u32 tid; | 603 | u32 tid; |
589 | } tid_entry; | 604 | } tid_entry; |
590 | u64 time; | 605 | u64 time; |
591 | u64 addr; | ||
592 | u64 id; | 606 | u64 id; |
593 | u64 stream_id; | 607 | u64 stream_id; |
594 | struct { | 608 | struct { |
595 | u32 cpu; | 609 | u32 cpu; |
596 | u32 reserved; | 610 | u32 reserved; |
597 | } cpu_entry; | 611 | } cpu_entry; |
598 | u64 period; | ||
599 | union perf_mem_data_src data_src; | ||
600 | struct perf_callchain_entry *callchain; | 612 | struct perf_callchain_entry *callchain; |
601 | struct perf_raw_record *raw; | 613 | struct perf_regs regs_user; |
602 | struct perf_branch_stack *br_stack; | 614 | struct perf_regs regs_intr; |
603 | struct perf_regs_user regs_user; | ||
604 | u64 stack_user_size; | 615 | u64 stack_user_size; |
605 | u64 weight; | 616 | } ____cacheline_aligned; |
606 | /* | ||
607 | * Transaction flags for abort events: | ||
608 | */ | ||
609 | u64 txn; | ||
610 | }; | ||
611 | 617 | ||
612 | /* default value for data source */ | 618 | /* default value for data source */ |
613 | #define PERF_MEM_NA (PERF_MEM_S(OP, NA) |\ | 619 | #define PERF_MEM_NA (PERF_MEM_S(OP, NA) |\ |
@@ -624,9 +630,6 @@ static inline void perf_sample_data_init(struct perf_sample_data *data, | |||
624 | data->raw = NULL; | 630 | data->raw = NULL; |
625 | data->br_stack = NULL; | 631 | data->br_stack = NULL; |
626 | data->period = period; | 632 | data->period = period; |
627 | data->regs_user.abi = PERF_SAMPLE_REGS_ABI_NONE; | ||
628 | data->regs_user.regs = NULL; | ||
629 | data->stack_user_size = 0; | ||
630 | data->weight = 0; | 633 | data->weight = 0; |
631 | data->data_src.val = PERF_MEM_NA; | 634 | data->data_src.val = PERF_MEM_NA; |
632 | data->txn = 0; | 635 | data->txn = 0; |
diff --git a/include/linux/platform_data/hsmmc-omap.h b/include/linux/platform_data/hsmmc-omap.h new file mode 100644 index 000000000000..67bbcf0785f6 --- /dev/null +++ b/include/linux/platform_data/hsmmc-omap.h | |||
@@ -0,0 +1,90 @@ | |||
1 | /* | ||
2 | * MMC definitions for OMAP2 | ||
3 | * | ||
4 | * Copyright (C) 2006 Nokia Corporation | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | /* | ||
12 | * struct omap_hsmmc_dev_attr.flags possibilities | ||
13 | * | ||
14 | * OMAP_HSMMC_SUPPORTS_DUAL_VOLT: Some HSMMC controller instances can | ||
15 | * operate with either 1.8Vdc or 3.0Vdc card voltages; this flag | ||
16 | * should be set if this is the case. See for example Section 22.5.3 | ||
17 | * "MMC/SD/SDIO1 Bus Voltage Selection" of the OMAP34xx Multimedia | ||
18 | * Device Silicon Revision 3.1.x Revision ZR (July 2011) (SWPU223R). | ||
19 | * | ||
20 | * OMAP_HSMMC_BROKEN_MULTIBLOCK_READ: Multiple-block read transfers | ||
21 | * don't work correctly on some MMC controller instances on some | ||
22 | * OMAP3 SoCs; this flag should be set if this is the case. See | ||
23 | * for example Advisory 2.1.1.128 "MMC: Multiple Block Read | ||
24 | * Operation Issue" in _OMAP3530/3525/3515/3503 Silicon Errata_ | ||
25 | * Revision F (October 2010) (SPRZ278F). | ||
26 | */ | ||
27 | #define OMAP_HSMMC_SUPPORTS_DUAL_VOLT BIT(0) | ||
28 | #define OMAP_HSMMC_BROKEN_MULTIBLOCK_READ BIT(1) | ||
29 | #define OMAP_HSMMC_SWAKEUP_MISSING BIT(2) | ||
30 | |||
31 | struct omap_hsmmc_dev_attr { | ||
32 | u8 flags; | ||
33 | }; | ||
34 | |||
35 | struct mmc_card; | ||
36 | |||
37 | struct omap_hsmmc_platform_data { | ||
38 | /* back-link to device */ | ||
39 | struct device *dev; | ||
40 | |||
41 | /* set if your board has components or wiring that limits the | ||
42 | * maximum frequency on the MMC bus */ | ||
43 | unsigned int max_freq; | ||
44 | |||
45 | /* Integrating attributes from the omap_hwmod layer */ | ||
46 | u8 controller_flags; | ||
47 | |||
48 | /* Register offset deviation */ | ||
49 | u16 reg_offset; | ||
50 | |||
51 | /* | ||
52 | * 4/8 wires and any additional host capabilities | ||
53 | * need to OR'd all capabilities (ref. linux/mmc/host.h) | ||
54 | */ | ||
55 | u32 caps; /* Used for the MMC driver on 2430 and later */ | ||
56 | u32 pm_caps; /* PM capabilities of the mmc */ | ||
57 | |||
58 | /* switch pin can be for card detect (default) or card cover */ | ||
59 | unsigned cover:1; | ||
60 | |||
61 | /* use the internal clock */ | ||
62 | unsigned internal_clock:1; | ||
63 | |||
64 | /* nonremovable e.g. eMMC */ | ||
65 | unsigned nonremovable:1; | ||
66 | |||
67 | /* eMMC does not handle power off when not in sleep state */ | ||
68 | unsigned no_regulator_off_init:1; | ||
69 | |||
70 | /* we can put the features above into this variable */ | ||
71 | #define HSMMC_HAS_PBIAS (1 << 0) | ||
72 | #define HSMMC_HAS_UPDATED_RESET (1 << 1) | ||
73 | #define HSMMC_HAS_HSPE_SUPPORT (1 << 2) | ||
74 | unsigned features; | ||
75 | |||
76 | int switch_pin; /* gpio (card detect) */ | ||
77 | int gpio_wp; /* gpio (write protect) */ | ||
78 | |||
79 | int (*set_power)(struct device *dev, int power_on, int vdd); | ||
80 | void (*remux)(struct device *dev, int power_on); | ||
81 | /* Call back before enabling / disabling regulators */ | ||
82 | void (*before_set_reg)(struct device *dev, int power_on, int vdd); | ||
83 | /* Call back after enabling / disabling regulators */ | ||
84 | void (*after_set_reg)(struct device *dev, int power_on, int vdd); | ||
85 | /* if we have special card, init it using this callback */ | ||
86 | void (*init_card)(struct mmc_card *card); | ||
87 | |||
88 | const char *name; | ||
89 | u32 ocr_mask; | ||
90 | }; | ||
diff --git a/include/linux/platform_data/lp855x.h b/include/linux/platform_data/lp855x.h index 1b2ba24e4e03..9c7fd1efe495 100644 --- a/include/linux/platform_data/lp855x.h +++ b/include/linux/platform_data/lp855x.h | |||
@@ -136,6 +136,7 @@ struct lp855x_rom_data { | |||
136 | Only valid when mode is PWM_BASED. | 136 | Only valid when mode is PWM_BASED. |
137 | * @size_program : total size of lp855x_rom_data | 137 | * @size_program : total size of lp855x_rom_data |
138 | * @rom_data : list of new eeprom/eprom registers | 138 | * @rom_data : list of new eeprom/eprom registers |
139 | * @supply : regulator that supplies 3V input | ||
139 | */ | 140 | */ |
140 | struct lp855x_platform_data { | 141 | struct lp855x_platform_data { |
141 | const char *name; | 142 | const char *name; |
@@ -144,6 +145,7 @@ struct lp855x_platform_data { | |||
144 | unsigned int period_ns; | 145 | unsigned int period_ns; |
145 | int size_program; | 146 | int size_program; |
146 | struct lp855x_rom_data *rom_data; | 147 | struct lp855x_rom_data *rom_data; |
148 | struct regulator *supply; | ||
147 | }; | 149 | }; |
148 | 150 | ||
149 | #endif | 151 | #endif |
diff --git a/include/linux/platform_data/mmc-atmel-mci.h b/include/linux/platform_data/mmc-atmel-mci.h new file mode 100644 index 000000000000..399a2d5a14bd --- /dev/null +++ b/include/linux/platform_data/mmc-atmel-mci.h | |||
@@ -0,0 +1,22 @@ | |||
1 | #ifndef __MMC_ATMEL_MCI_H | ||
2 | #define __MMC_ATMEL_MCI_H | ||
3 | |||
4 | #include <linux/platform_data/dma-atmel.h> | ||
5 | #include <linux/platform_data/dma-dw.h> | ||
6 | |||
7 | /** | ||
8 | * struct mci_dma_data - DMA data for MCI interface | ||
9 | */ | ||
10 | struct mci_dma_data { | ||
11 | #ifdef CONFIG_ARM | ||
12 | struct at_dma_slave sdata; | ||
13 | #else | ||
14 | struct dw_dma_slave sdata; | ||
15 | #endif | ||
16 | }; | ||
17 | |||
18 | /* accessor macros */ | ||
19 | #define slave_data_ptr(s) (&(s)->sdata) | ||
20 | #define find_slave_dev(s) ((s)->sdata.dma_dev) | ||
21 | |||
22 | #endif /* __MMC_ATMEL_MCI_H */ | ||
diff --git a/include/linux/platform_data/mmc-omap.h b/include/linux/platform_data/mmc-omap.h index 51e70cf25cbc..5c188f4e9bec 100644 --- a/include/linux/platform_data/mmc-omap.h +++ b/include/linux/platform_data/mmc-omap.h | |||
@@ -10,32 +10,8 @@ | |||
10 | 10 | ||
11 | #define OMAP_MMC_MAX_SLOTS 2 | 11 | #define OMAP_MMC_MAX_SLOTS 2 |
12 | 12 | ||
13 | /* | ||
14 | * struct omap_mmc_dev_attr.flags possibilities | ||
15 | * | ||
16 | * OMAP_HSMMC_SUPPORTS_DUAL_VOLT: Some HSMMC controller instances can | ||
17 | * operate with either 1.8Vdc or 3.0Vdc card voltages; this flag | ||
18 | * should be set if this is the case. See for example Section 22.5.3 | ||
19 | * "MMC/SD/SDIO1 Bus Voltage Selection" of the OMAP34xx Multimedia | ||
20 | * Device Silicon Revision 3.1.x Revision ZR (July 2011) (SWPU223R). | ||
21 | * | ||
22 | * OMAP_HSMMC_BROKEN_MULTIBLOCK_READ: Multiple-block read transfers | ||
23 | * don't work correctly on some MMC controller instances on some | ||
24 | * OMAP3 SoCs; this flag should be set if this is the case. See | ||
25 | * for example Advisory 2.1.1.128 "MMC: Multiple Block Read | ||
26 | * Operation Issue" in _OMAP3530/3525/3515/3503 Silicon Errata_ | ||
27 | * Revision F (October 2010) (SPRZ278F). | ||
28 | */ | ||
29 | #define OMAP_HSMMC_SUPPORTS_DUAL_VOLT BIT(0) | ||
30 | #define OMAP_HSMMC_BROKEN_MULTIBLOCK_READ BIT(1) | ||
31 | #define OMAP_HSMMC_SWAKEUP_MISSING BIT(2) | ||
32 | |||
33 | struct mmc_card; | 13 | struct mmc_card; |
34 | 14 | ||
35 | struct omap_mmc_dev_attr { | ||
36 | u8 flags; | ||
37 | }; | ||
38 | |||
39 | struct omap_mmc_platform_data { | 15 | struct omap_mmc_platform_data { |
40 | /* back-link to device */ | 16 | /* back-link to device */ |
41 | struct device *dev; | 17 | struct device *dev; |
@@ -106,9 +82,6 @@ struct omap_mmc_platform_data { | |||
106 | unsigned vcc_aux_disable_is_sleep:1; | 82 | unsigned vcc_aux_disable_is_sleep:1; |
107 | 83 | ||
108 | /* we can put the features above into this variable */ | 84 | /* we can put the features above into this variable */ |
109 | #define HSMMC_HAS_PBIAS (1 << 0) | ||
110 | #define HSMMC_HAS_UPDATED_RESET (1 << 1) | ||
111 | #define HSMMC_HAS_HSPE_SUPPORT (1 << 2) | ||
112 | #define MMC_OMAP7XX (1 << 3) | 85 | #define MMC_OMAP7XX (1 << 3) |
113 | #define MMC_OMAP15XX (1 << 4) | 86 | #define MMC_OMAP15XX (1 << 4) |
114 | #define MMC_OMAP16XX (1 << 5) | 87 | #define MMC_OMAP16XX (1 << 5) |
diff --git a/include/linux/platform_data/pxa_sdhci.h b/include/linux/platform_data/pxa_sdhci.h index 27d3156d093a..9e20c2fb4ffd 100644 --- a/include/linux/platform_data/pxa_sdhci.h +++ b/include/linux/platform_data/pxa_sdhci.h | |||
@@ -55,9 +55,4 @@ struct sdhci_pxa_platdata { | |||
55 | unsigned int quirks2; | 55 | unsigned int quirks2; |
56 | unsigned int pm_caps; | 56 | unsigned int pm_caps; |
57 | }; | 57 | }; |
58 | |||
59 | struct sdhci_pxa { | ||
60 | u8 clk_enable; | ||
61 | u8 power_mode; | ||
62 | }; | ||
63 | #endif /* _PXA_SDHCI_H_ */ | 58 | #endif /* _PXA_SDHCI_H_ */ |
diff --git a/include/linux/platform_data/serial-omap.h b/include/linux/platform_data/serial-omap.h index c860c1b314c0..d09275f3cde3 100644 --- a/include/linux/platform_data/serial-omap.h +++ b/include/linux/platform_data/serial-omap.h | |||
@@ -38,9 +38,6 @@ struct omap_uart_port_info { | |||
38 | unsigned int dma_rx_timeout; | 38 | unsigned int dma_rx_timeout; |
39 | unsigned int autosuspend_timeout; | 39 | unsigned int autosuspend_timeout; |
40 | unsigned int dma_rx_poll_rate; | 40 | unsigned int dma_rx_poll_rate; |
41 | int DTR_gpio; | ||
42 | int DTR_inverted; | ||
43 | int DTR_present; | ||
44 | 41 | ||
45 | int (*get_context_loss_count)(struct device *); | 42 | int (*get_context_loss_count)(struct device *); |
46 | void (*enable_wakeup)(struct device *, bool); | 43 | void (*enable_wakeup)(struct device *, bool); |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 383fd68aaee1..66a656eb335b 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -342,7 +342,7 @@ struct dev_pm_ops { | |||
342 | #define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) | 342 | #define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) |
343 | #endif | 343 | #endif |
344 | 344 | ||
345 | #ifdef CONFIG_PM_RUNTIME | 345 | #ifdef CONFIG_PM |
346 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ | 346 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ |
347 | .runtime_suspend = suspend_fn, \ | 347 | .runtime_suspend = suspend_fn, \ |
348 | .runtime_resume = resume_fn, \ | 348 | .runtime_resume = resume_fn, \ |
@@ -351,14 +351,7 @@ struct dev_pm_ops { | |||
351 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) | 351 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) |
352 | #endif | 352 | #endif |
353 | 353 | ||
354 | #ifdef CONFIG_PM | 354 | #define SET_PM_RUNTIME_PM_OPS SET_RUNTIME_PM_OPS |
355 | #define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ | ||
356 | .runtime_suspend = suspend_fn, \ | ||
357 | .runtime_resume = resume_fn, \ | ||
358 | .runtime_idle = idle_fn, | ||
359 | #else | ||
360 | #define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) | ||
361 | #endif | ||
362 | 355 | ||
363 | /* | 356 | /* |
364 | * Use this if you want to use the same suspend and resume callbacks for suspend | 357 | * Use this if you want to use the same suspend and resume callbacks for suspend |
@@ -538,11 +531,7 @@ enum rpm_request { | |||
538 | }; | 531 | }; |
539 | 532 | ||
540 | struct wakeup_source; | 533 | struct wakeup_source; |
541 | 534 | struct pm_domain_data; | |
542 | struct pm_domain_data { | ||
543 | struct list_head list_node; | ||
544 | struct device *dev; | ||
545 | }; | ||
546 | 535 | ||
547 | struct pm_subsys_data { | 536 | struct pm_subsys_data { |
548 | spinlock_t lock; | 537 | spinlock_t lock; |
@@ -576,7 +565,7 @@ struct dev_pm_info { | |||
576 | #else | 565 | #else |
577 | unsigned int should_wakeup:1; | 566 | unsigned int should_wakeup:1; |
578 | #endif | 567 | #endif |
579 | #ifdef CONFIG_PM_RUNTIME | 568 | #ifdef CONFIG_PM |
580 | struct timer_list suspend_timer; | 569 | struct timer_list suspend_timer; |
581 | unsigned long timer_expires; | 570 | unsigned long timer_expires; |
582 | struct work_struct work; | 571 | struct work_struct work; |
diff --git a/include/linux/pm_clock.h b/include/linux/pm_clock.h index 8348866e7b05..0b0039634410 100644 --- a/include/linux/pm_clock.h +++ b/include/linux/pm_clock.h | |||
@@ -18,6 +18,8 @@ struct pm_clk_notifier_block { | |||
18 | char *con_ids[]; | 18 | char *con_ids[]; |
19 | }; | 19 | }; |
20 | 20 | ||
21 | struct clk; | ||
22 | |||
21 | #ifdef CONFIG_PM_CLK | 23 | #ifdef CONFIG_PM_CLK |
22 | static inline bool pm_clk_no_clocks(struct device *dev) | 24 | static inline bool pm_clk_no_clocks(struct device *dev) |
23 | { | 25 | { |
@@ -29,6 +31,7 @@ extern void pm_clk_init(struct device *dev); | |||
29 | extern int pm_clk_create(struct device *dev); | 31 | extern int pm_clk_create(struct device *dev); |
30 | extern void pm_clk_destroy(struct device *dev); | 32 | extern void pm_clk_destroy(struct device *dev); |
31 | extern int pm_clk_add(struct device *dev, const char *con_id); | 33 | extern int pm_clk_add(struct device *dev, const char *con_id); |
34 | extern int pm_clk_add_clk(struct device *dev, struct clk *clk); | ||
32 | extern void pm_clk_remove(struct device *dev, const char *con_id); | 35 | extern void pm_clk_remove(struct device *dev, const char *con_id); |
33 | extern int pm_clk_suspend(struct device *dev); | 36 | extern int pm_clk_suspend(struct device *dev); |
34 | extern int pm_clk_resume(struct device *dev); | 37 | extern int pm_clk_resume(struct device *dev); |
@@ -51,6 +54,11 @@ static inline int pm_clk_add(struct device *dev, const char *con_id) | |||
51 | { | 54 | { |
52 | return -EINVAL; | 55 | return -EINVAL; |
53 | } | 56 | } |
57 | |||
58 | static inline int pm_clk_add_clk(struct device *dev, struct clk *clk) | ||
59 | { | ||
60 | return -EINVAL; | ||
61 | } | ||
54 | static inline void pm_clk_remove(struct device *dev, const char *con_id) | 62 | static inline void pm_clk_remove(struct device *dev, const char *con_id) |
55 | { | 63 | { |
56 | } | 64 | } |
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 2e0e06daf8c0..6cd20d5e651b 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h | |||
@@ -17,6 +17,9 @@ | |||
17 | #include <linux/notifier.h> | 17 | #include <linux/notifier.h> |
18 | #include <linux/cpuidle.h> | 18 | #include <linux/cpuidle.h> |
19 | 19 | ||
20 | /* Defines used for the flags field in the struct generic_pm_domain */ | ||
21 | #define GENPD_FLAG_PM_CLK (1U << 0) /* PM domain uses PM clk */ | ||
22 | |||
20 | enum gpd_status { | 23 | enum gpd_status { |
21 | GPD_STATE_ACTIVE = 0, /* PM domain is active */ | 24 | GPD_STATE_ACTIVE = 0, /* PM domain is active */ |
22 | GPD_STATE_WAIT_MASTER, /* PM domain's master is being waited for */ | 25 | GPD_STATE_WAIT_MASTER, /* PM domain's master is being waited for */ |
@@ -76,6 +79,7 @@ struct generic_pm_domain { | |||
76 | struct device *dev); | 79 | struct device *dev); |
77 | void (*detach_dev)(struct generic_pm_domain *domain, | 80 | void (*detach_dev)(struct generic_pm_domain *domain, |
78 | struct device *dev); | 81 | struct device *dev); |
82 | unsigned int flags; /* Bit field of configs for genpd */ | ||
79 | }; | 83 | }; |
80 | 84 | ||
81 | static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd) | 85 | static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd) |
@@ -100,6 +104,11 @@ struct gpd_timing_data { | |||
100 | bool cached_stop_ok; | 104 | bool cached_stop_ok; |
101 | }; | 105 | }; |
102 | 106 | ||
107 | struct pm_domain_data { | ||
108 | struct list_head list_node; | ||
109 | struct device *dev; | ||
110 | }; | ||
111 | |||
103 | struct generic_pm_domain_data { | 112 | struct generic_pm_domain_data { |
104 | struct pm_domain_data base; | 113 | struct pm_domain_data base; |
105 | struct gpd_timing_data td; | 114 | struct gpd_timing_data td; |
@@ -147,6 +156,7 @@ extern void pm_genpd_init(struct generic_pm_domain *genpd, | |||
147 | 156 | ||
148 | extern int pm_genpd_poweron(struct generic_pm_domain *genpd); | 157 | extern int pm_genpd_poweron(struct generic_pm_domain *genpd); |
149 | extern int pm_genpd_name_poweron(const char *domain_name); | 158 | extern int pm_genpd_name_poweron(const char *domain_name); |
159 | extern void pm_genpd_poweroff_unused(void); | ||
150 | 160 | ||
151 | extern struct dev_power_governor simple_qos_governor; | 161 | extern struct dev_power_governor simple_qos_governor; |
152 | extern struct dev_power_governor pm_domain_always_on_gov; | 162 | extern struct dev_power_governor pm_domain_always_on_gov; |
@@ -221,6 +231,7 @@ static inline int pm_genpd_name_poweron(const char *domain_name) | |||
221 | { | 231 | { |
222 | return -ENOSYS; | 232 | return -ENOSYS; |
223 | } | 233 | } |
234 | static inline void pm_genpd_poweroff_unused(void) {} | ||
224 | #define simple_qos_governor NULL | 235 | #define simple_qos_governor NULL |
225 | #define pm_domain_always_on_gov NULL | 236 | #define pm_domain_always_on_gov NULL |
226 | #endif | 237 | #endif |
@@ -237,12 +248,6 @@ static inline int pm_genpd_name_add_device(const char *domain_name, | |||
237 | return __pm_genpd_name_add_device(domain_name, dev, NULL); | 248 | return __pm_genpd_name_add_device(domain_name, dev, NULL); |
238 | } | 249 | } |
239 | 250 | ||
240 | #ifdef CONFIG_PM_GENERIC_DOMAINS_RUNTIME | ||
241 | extern void pm_genpd_poweroff_unused(void); | ||
242 | #else | ||
243 | static inline void pm_genpd_poweroff_unused(void) {} | ||
244 | #endif | ||
245 | |||
246 | #ifdef CONFIG_PM_GENERIC_DOMAINS_SLEEP | 251 | #ifdef CONFIG_PM_GENERIC_DOMAINS_SLEEP |
247 | extern void pm_genpd_syscore_poweroff(struct device *dev); | 252 | extern void pm_genpd_syscore_poweroff(struct device *dev); |
248 | extern void pm_genpd_syscore_poweron(struct device *dev); | 253 | extern void pm_genpd_syscore_poweron(struct device *dev); |
diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index 0330217abfad..cec2d4540914 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h | |||
@@ -21,7 +21,7 @@ struct dev_pm_opp; | |||
21 | struct device; | 21 | struct device; |
22 | 22 | ||
23 | enum dev_pm_opp_event { | 23 | enum dev_pm_opp_event { |
24 | OPP_EVENT_ADD, OPP_EVENT_ENABLE, OPP_EVENT_DISABLE, | 24 | OPP_EVENT_ADD, OPP_EVENT_REMOVE, OPP_EVENT_ENABLE, OPP_EVENT_DISABLE, |
25 | }; | 25 | }; |
26 | 26 | ||
27 | #if defined(CONFIG_PM_OPP) | 27 | #if defined(CONFIG_PM_OPP) |
@@ -44,6 +44,7 @@ struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev, | |||
44 | 44 | ||
45 | int dev_pm_opp_add(struct device *dev, unsigned long freq, | 45 | int dev_pm_opp_add(struct device *dev, unsigned long freq, |
46 | unsigned long u_volt); | 46 | unsigned long u_volt); |
47 | void dev_pm_opp_remove(struct device *dev, unsigned long freq); | ||
47 | 48 | ||
48 | int dev_pm_opp_enable(struct device *dev, unsigned long freq); | 49 | int dev_pm_opp_enable(struct device *dev, unsigned long freq); |
49 | 50 | ||
@@ -90,6 +91,10 @@ static inline int dev_pm_opp_add(struct device *dev, unsigned long freq, | |||
90 | return -EINVAL; | 91 | return -EINVAL; |
91 | } | 92 | } |
92 | 93 | ||
94 | static inline void dev_pm_opp_remove(struct device *dev, unsigned long freq) | ||
95 | { | ||
96 | } | ||
97 | |||
93 | static inline int dev_pm_opp_enable(struct device *dev, unsigned long freq) | 98 | static inline int dev_pm_opp_enable(struct device *dev, unsigned long freq) |
94 | { | 99 | { |
95 | return 0; | 100 | return 0; |
@@ -109,11 +114,16 @@ static inline struct srcu_notifier_head *dev_pm_opp_get_notifier( | |||
109 | 114 | ||
110 | #if defined(CONFIG_PM_OPP) && defined(CONFIG_OF) | 115 | #if defined(CONFIG_PM_OPP) && defined(CONFIG_OF) |
111 | int of_init_opp_table(struct device *dev); | 116 | int of_init_opp_table(struct device *dev); |
117 | void of_free_opp_table(struct device *dev); | ||
112 | #else | 118 | #else |
113 | static inline int of_init_opp_table(struct device *dev) | 119 | static inline int of_init_opp_table(struct device *dev) |
114 | { | 120 | { |
115 | return -EINVAL; | 121 | return -EINVAL; |
116 | } | 122 | } |
123 | |||
124 | static inline void of_free_opp_table(struct device *dev) | ||
125 | { | ||
126 | } | ||
117 | #endif | 127 | #endif |
118 | 128 | ||
119 | #endif /* __LINUX_OPP_H__ */ | 129 | #endif /* __LINUX_OPP_H__ */ |
diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h index 636e82834506..7b3ae0cffc05 100644 --- a/include/linux/pm_qos.h +++ b/include/linux/pm_qos.h | |||
@@ -154,6 +154,23 @@ void dev_pm_qos_constraints_destroy(struct device *dev); | |||
154 | int dev_pm_qos_add_ancestor_request(struct device *dev, | 154 | int dev_pm_qos_add_ancestor_request(struct device *dev, |
155 | struct dev_pm_qos_request *req, | 155 | struct dev_pm_qos_request *req, |
156 | enum dev_pm_qos_req_type type, s32 value); | 156 | enum dev_pm_qos_req_type type, s32 value); |
157 | int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value); | ||
158 | void dev_pm_qos_hide_latency_limit(struct device *dev); | ||
159 | int dev_pm_qos_expose_flags(struct device *dev, s32 value); | ||
160 | void dev_pm_qos_hide_flags(struct device *dev); | ||
161 | int dev_pm_qos_update_flags(struct device *dev, s32 mask, bool set); | ||
162 | s32 dev_pm_qos_get_user_latency_tolerance(struct device *dev); | ||
163 | int dev_pm_qos_update_user_latency_tolerance(struct device *dev, s32 val); | ||
164 | |||
165 | static inline s32 dev_pm_qos_requested_resume_latency(struct device *dev) | ||
166 | { | ||
167 | return dev->power.qos->resume_latency_req->data.pnode.prio; | ||
168 | } | ||
169 | |||
170 | static inline s32 dev_pm_qos_requested_flags(struct device *dev) | ||
171 | { | ||
172 | return dev->power.qos->flags_req->data.flr.flags; | ||
173 | } | ||
157 | #else | 174 | #else |
158 | static inline enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev, | 175 | static inline enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev, |
159 | s32 mask) | 176 | s32 mask) |
@@ -200,27 +217,6 @@ static inline int dev_pm_qos_add_ancestor_request(struct device *dev, | |||
200 | enum dev_pm_qos_req_type type, | 217 | enum dev_pm_qos_req_type type, |
201 | s32 value) | 218 | s32 value) |
202 | { return 0; } | 219 | { return 0; } |
203 | #endif | ||
204 | |||
205 | #ifdef CONFIG_PM_RUNTIME | ||
206 | int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value); | ||
207 | void dev_pm_qos_hide_latency_limit(struct device *dev); | ||
208 | int dev_pm_qos_expose_flags(struct device *dev, s32 value); | ||
209 | void dev_pm_qos_hide_flags(struct device *dev); | ||
210 | int dev_pm_qos_update_flags(struct device *dev, s32 mask, bool set); | ||
211 | s32 dev_pm_qos_get_user_latency_tolerance(struct device *dev); | ||
212 | int dev_pm_qos_update_user_latency_tolerance(struct device *dev, s32 val); | ||
213 | |||
214 | static inline s32 dev_pm_qos_requested_resume_latency(struct device *dev) | ||
215 | { | ||
216 | return dev->power.qos->resume_latency_req->data.pnode.prio; | ||
217 | } | ||
218 | |||
219 | static inline s32 dev_pm_qos_requested_flags(struct device *dev) | ||
220 | { | ||
221 | return dev->power.qos->flags_req->data.flr.flags; | ||
222 | } | ||
223 | #else | ||
224 | static inline int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value) | 220 | static inline int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value) |
225 | { return 0; } | 221 | { return 0; } |
226 | static inline void dev_pm_qos_hide_latency_limit(struct device *dev) {} | 222 | static inline void dev_pm_qos_hide_latency_limit(struct device *dev) {} |
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 367f49b9a1c9..eda4feede048 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
@@ -35,16 +35,6 @@ extern int pm_generic_runtime_suspend(struct device *dev); | |||
35 | extern int pm_generic_runtime_resume(struct device *dev); | 35 | extern int pm_generic_runtime_resume(struct device *dev); |
36 | extern int pm_runtime_force_suspend(struct device *dev); | 36 | extern int pm_runtime_force_suspend(struct device *dev); |
37 | extern int pm_runtime_force_resume(struct device *dev); | 37 | extern int pm_runtime_force_resume(struct device *dev); |
38 | #else | ||
39 | static inline bool queue_pm_work(struct work_struct *work) { return false; } | ||
40 | |||
41 | static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } | ||
42 | static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } | ||
43 | static inline int pm_runtime_force_suspend(struct device *dev) { return 0; } | ||
44 | static inline int pm_runtime_force_resume(struct device *dev) { return 0; } | ||
45 | #endif | ||
46 | |||
47 | #ifdef CONFIG_PM_RUNTIME | ||
48 | 38 | ||
49 | extern int __pm_runtime_idle(struct device *dev, int rpmflags); | 39 | extern int __pm_runtime_idle(struct device *dev, int rpmflags); |
50 | extern int __pm_runtime_suspend(struct device *dev, int rpmflags); | 40 | extern int __pm_runtime_suspend(struct device *dev, int rpmflags); |
@@ -128,7 +118,14 @@ static inline void pm_runtime_mark_last_busy(struct device *dev) | |||
128 | ACCESS_ONCE(dev->power.last_busy) = jiffies; | 118 | ACCESS_ONCE(dev->power.last_busy) = jiffies; |
129 | } | 119 | } |
130 | 120 | ||
131 | #else /* !CONFIG_PM_RUNTIME */ | 121 | #else /* !CONFIG_PM */ |
122 | |||
123 | static inline bool queue_pm_work(struct work_struct *work) { return false; } | ||
124 | |||
125 | static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } | ||
126 | static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } | ||
127 | static inline int pm_runtime_force_suspend(struct device *dev) { return 0; } | ||
128 | static inline int pm_runtime_force_resume(struct device *dev) { return 0; } | ||
132 | 129 | ||
133 | static inline int __pm_runtime_idle(struct device *dev, int rpmflags) | 130 | static inline int __pm_runtime_idle(struct device *dev, int rpmflags) |
134 | { | 131 | { |
@@ -179,7 +176,7 @@ static inline unsigned long pm_runtime_autosuspend_expiration( | |||
179 | static inline void pm_runtime_set_memalloc_noio(struct device *dev, | 176 | static inline void pm_runtime_set_memalloc_noio(struct device *dev, |
180 | bool enable){} | 177 | bool enable){} |
181 | 178 | ||
182 | #endif /* !CONFIG_PM_RUNTIME */ | 179 | #endif /* !CONFIG_PM */ |
183 | 180 | ||
184 | static inline int pm_runtime_idle(struct device *dev) | 181 | static inline int pm_runtime_idle(struct device *dev) |
185 | { | 182 | { |
diff --git a/include/linux/printk.h b/include/linux/printk.h index d78125f73ac4..c8f170324e64 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h | |||
@@ -118,12 +118,13 @@ int no_printk(const char *fmt, ...) | |||
118 | #ifdef CONFIG_EARLY_PRINTK | 118 | #ifdef CONFIG_EARLY_PRINTK |
119 | extern asmlinkage __printf(1, 2) | 119 | extern asmlinkage __printf(1, 2) |
120 | void early_printk(const char *fmt, ...); | 120 | void early_printk(const char *fmt, ...); |
121 | void early_vprintk(const char *fmt, va_list ap); | ||
122 | #else | 121 | #else |
123 | static inline __printf(1, 2) __cold | 122 | static inline __printf(1, 2) __cold |
124 | void early_printk(const char *s, ...) { } | 123 | void early_printk(const char *s, ...) { } |
125 | #endif | 124 | #endif |
126 | 125 | ||
126 | typedef int(*printk_func_t)(const char *fmt, va_list args); | ||
127 | |||
127 | #ifdef CONFIG_PRINTK | 128 | #ifdef CONFIG_PRINTK |
128 | asmlinkage __printf(5, 0) | 129 | asmlinkage __printf(5, 0) |
129 | int vprintk_emit(int facility, int level, | 130 | int vprintk_emit(int facility, int level, |
diff --git a/include/linux/property.h b/include/linux/property.h new file mode 100644 index 000000000000..a6a3d98bd7e9 --- /dev/null +++ b/include/linux/property.h | |||
@@ -0,0 +1,143 @@ | |||
1 | /* | ||
2 | * property.h - Unified device property interface. | ||
3 | * | ||
4 | * Copyright (C) 2014, Intel Corporation | ||
5 | * Authors: Rafael J. Wysocki <rafael.j.wysocki@intel.com> | ||
6 | * Mika Westerberg <mika.westerberg@linux.intel.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef _LINUX_PROPERTY_H_ | ||
14 | #define _LINUX_PROPERTY_H_ | ||
15 | |||
16 | #include <linux/types.h> | ||
17 | |||
18 | struct device; | ||
19 | |||
20 | enum dev_prop_type { | ||
21 | DEV_PROP_U8, | ||
22 | DEV_PROP_U16, | ||
23 | DEV_PROP_U32, | ||
24 | DEV_PROP_U64, | ||
25 | DEV_PROP_STRING, | ||
26 | DEV_PROP_MAX, | ||
27 | }; | ||
28 | |||
29 | bool device_property_present(struct device *dev, const char *propname); | ||
30 | int device_property_read_u8_array(struct device *dev, const char *propname, | ||
31 | u8 *val, size_t nval); | ||
32 | int device_property_read_u16_array(struct device *dev, const char *propname, | ||
33 | u16 *val, size_t nval); | ||
34 | int device_property_read_u32_array(struct device *dev, const char *propname, | ||
35 | u32 *val, size_t nval); | ||
36 | int device_property_read_u64_array(struct device *dev, const char *propname, | ||
37 | u64 *val, size_t nval); | ||
38 | int device_property_read_string_array(struct device *dev, const char *propname, | ||
39 | const char **val, size_t nval); | ||
40 | int device_property_read_string(struct device *dev, const char *propname, | ||
41 | const char **val); | ||
42 | |||
43 | enum fwnode_type { | ||
44 | FWNODE_INVALID = 0, | ||
45 | FWNODE_OF, | ||
46 | FWNODE_ACPI, | ||
47 | }; | ||
48 | |||
49 | struct fwnode_handle { | ||
50 | enum fwnode_type type; | ||
51 | }; | ||
52 | |||
53 | bool fwnode_property_present(struct fwnode_handle *fwnode, const char *propname); | ||
54 | int fwnode_property_read_u8_array(struct fwnode_handle *fwnode, | ||
55 | const char *propname, u8 *val, | ||
56 | size_t nval); | ||
57 | int fwnode_property_read_u16_array(struct fwnode_handle *fwnode, | ||
58 | const char *propname, u16 *val, | ||
59 | size_t nval); | ||
60 | int fwnode_property_read_u32_array(struct fwnode_handle *fwnode, | ||
61 | const char *propname, u32 *val, | ||
62 | size_t nval); | ||
63 | int fwnode_property_read_u64_array(struct fwnode_handle *fwnode, | ||
64 | const char *propname, u64 *val, | ||
65 | size_t nval); | ||
66 | int fwnode_property_read_string_array(struct fwnode_handle *fwnode, | ||
67 | const char *propname, const char **val, | ||
68 | size_t nval); | ||
69 | int fwnode_property_read_string(struct fwnode_handle *fwnode, | ||
70 | const char *propname, const char **val); | ||
71 | |||
72 | struct fwnode_handle *device_get_next_child_node(struct device *dev, | ||
73 | struct fwnode_handle *child); | ||
74 | |||
75 | #define device_for_each_child_node(dev, child) \ | ||
76 | for (child = device_get_next_child_node(dev, NULL); child; \ | ||
77 | child = device_get_next_child_node(dev, child)) | ||
78 | |||
79 | void fwnode_handle_put(struct fwnode_handle *fwnode); | ||
80 | |||
81 | unsigned int device_get_child_node_count(struct device *dev); | ||
82 | |||
83 | static inline bool device_property_read_bool(struct device *dev, | ||
84 | const char *propname) | ||
85 | { | ||
86 | return device_property_present(dev, propname); | ||
87 | } | ||
88 | |||
89 | static inline int device_property_read_u8(struct device *dev, | ||
90 | const char *propname, u8 *val) | ||
91 | { | ||
92 | return device_property_read_u8_array(dev, propname, val, 1); | ||
93 | } | ||
94 | |||
95 | static inline int device_property_read_u16(struct device *dev, | ||
96 | const char *propname, u16 *val) | ||
97 | { | ||
98 | return device_property_read_u16_array(dev, propname, val, 1); | ||
99 | } | ||
100 | |||
101 | static inline int device_property_read_u32(struct device *dev, | ||
102 | const char *propname, u32 *val) | ||
103 | { | ||
104 | return device_property_read_u32_array(dev, propname, val, 1); | ||
105 | } | ||
106 | |||
107 | static inline int device_property_read_u64(struct device *dev, | ||
108 | const char *propname, u64 *val) | ||
109 | { | ||
110 | return device_property_read_u64_array(dev, propname, val, 1); | ||
111 | } | ||
112 | |||
113 | static inline bool fwnode_property_read_bool(struct fwnode_handle *fwnode, | ||
114 | const char *propname) | ||
115 | { | ||
116 | return fwnode_property_present(fwnode, propname); | ||
117 | } | ||
118 | |||
119 | static inline int fwnode_property_read_u8(struct fwnode_handle *fwnode, | ||
120 | const char *propname, u8 *val) | ||
121 | { | ||
122 | return fwnode_property_read_u8_array(fwnode, propname, val, 1); | ||
123 | } | ||
124 | |||
125 | static inline int fwnode_property_read_u16(struct fwnode_handle *fwnode, | ||
126 | const char *propname, u16 *val) | ||
127 | { | ||
128 | return fwnode_property_read_u16_array(fwnode, propname, val, 1); | ||
129 | } | ||
130 | |||
131 | static inline int fwnode_property_read_u32(struct fwnode_handle *fwnode, | ||
132 | const char *propname, u32 *val) | ||
133 | { | ||
134 | return fwnode_property_read_u32_array(fwnode, propname, val, 1); | ||
135 | } | ||
136 | |||
137 | static inline int fwnode_property_read_u64(struct fwnode_handle *fwnode, | ||
138 | const char *propname, u64 *val) | ||
139 | { | ||
140 | return fwnode_property_read_u64_array(fwnode, propname, val, 1); | ||
141 | } | ||
142 | |||
143 | #endif /* _LINUX_PROPERTY_H_ */ | ||
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index cc79eff4a1ad..987a73a40ef8 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -52,7 +52,7 @@ extern void ptrace_notify(int exit_code); | |||
52 | extern void __ptrace_link(struct task_struct *child, | 52 | extern void __ptrace_link(struct task_struct *child, |
53 | struct task_struct *new_parent); | 53 | struct task_struct *new_parent); |
54 | extern void __ptrace_unlink(struct task_struct *child); | 54 | extern void __ptrace_unlink(struct task_struct *child); |
55 | extern void exit_ptrace(struct task_struct *tracer); | 55 | extern void exit_ptrace(struct task_struct *tracer, struct list_head *dead); |
56 | #define PTRACE_MODE_READ 0x01 | 56 | #define PTRACE_MODE_READ 0x01 |
57 | #define PTRACE_MODE_ATTACH 0x02 | 57 | #define PTRACE_MODE_ATTACH 0x02 |
58 | #define PTRACE_MODE_NOAUDIT 0x04 | 58 | #define PTRACE_MODE_NOAUDIT 0x04 |
diff --git a/include/linux/quota.h b/include/linux/quota.h index 80d345a3524c..50978b781a19 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
@@ -56,6 +56,11 @@ enum quota_type { | |||
56 | PRJQUOTA = 2, /* element used for project quotas */ | 56 | PRJQUOTA = 2, /* element used for project quotas */ |
57 | }; | 57 | }; |
58 | 58 | ||
59 | /* Masks for quota types when used as a bitmask */ | ||
60 | #define QTYPE_MASK_USR (1 << USRQUOTA) | ||
61 | #define QTYPE_MASK_GRP (1 << GRPQUOTA) | ||
62 | #define QTYPE_MASK_PRJ (1 << PRJQUOTA) | ||
63 | |||
59 | typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */ | 64 | typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */ |
60 | typedef long long qsize_t; /* Type in which we store sizes */ | 65 | typedef long long qsize_t; /* Type in which we store sizes */ |
61 | 66 | ||
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index 1d3eee594cd6..f23538a6e411 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h | |||
@@ -64,10 +64,10 @@ void dquot_destroy(struct dquot *dquot); | |||
64 | int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags); | 64 | int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags); |
65 | void __dquot_free_space(struct inode *inode, qsize_t number, int flags); | 65 | void __dquot_free_space(struct inode *inode, qsize_t number, int flags); |
66 | 66 | ||
67 | int dquot_alloc_inode(const struct inode *inode); | 67 | int dquot_alloc_inode(struct inode *inode); |
68 | 68 | ||
69 | int dquot_claim_space_nodirty(struct inode *inode, qsize_t number); | 69 | int dquot_claim_space_nodirty(struct inode *inode, qsize_t number); |
70 | void dquot_free_inode(const struct inode *inode); | 70 | void dquot_free_inode(struct inode *inode); |
71 | void dquot_reclaim_space_nodirty(struct inode *inode, qsize_t number); | 71 | void dquot_reclaim_space_nodirty(struct inode *inode, qsize_t number); |
72 | 72 | ||
73 | int dquot_disable(struct super_block *sb, int type, unsigned int flags); | 73 | int dquot_disable(struct super_block *sb, int type, unsigned int flags); |
@@ -213,12 +213,12 @@ static inline void dquot_drop(struct inode *inode) | |||
213 | { | 213 | { |
214 | } | 214 | } |
215 | 215 | ||
216 | static inline int dquot_alloc_inode(const struct inode *inode) | 216 | static inline int dquot_alloc_inode(struct inode *inode) |
217 | { | 217 | { |
218 | return 0; | 218 | return 0; |
219 | } | 219 | } |
220 | 220 | ||
221 | static inline void dquot_free_inode(const struct inode *inode) | 221 | static inline void dquot_free_inode(struct inode *inode) |
222 | { | 222 | { |
223 | } | 223 | } |
224 | 224 | ||
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 53ff1a752d7e..ed4f5939a452 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -57,7 +57,7 @@ enum rcutorture_type { | |||
57 | INVALID_RCU_FLAVOR | 57 | INVALID_RCU_FLAVOR |
58 | }; | 58 | }; |
59 | 59 | ||
60 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) | 60 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU) |
61 | void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags, | 61 | void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags, |
62 | unsigned long *gpnum, unsigned long *completed); | 62 | unsigned long *gpnum, unsigned long *completed); |
63 | void rcutorture_record_test_transition(void); | 63 | void rcutorture_record_test_transition(void); |
@@ -260,7 +260,7 @@ static inline int rcu_preempt_depth(void) | |||
260 | void rcu_init(void); | 260 | void rcu_init(void); |
261 | void rcu_sched_qs(void); | 261 | void rcu_sched_qs(void); |
262 | void rcu_bh_qs(void); | 262 | void rcu_bh_qs(void); |
263 | void rcu_check_callbacks(int cpu, int user); | 263 | void rcu_check_callbacks(int user); |
264 | struct notifier_block; | 264 | struct notifier_block; |
265 | void rcu_idle_enter(void); | 265 | void rcu_idle_enter(void); |
266 | void rcu_idle_exit(void); | 266 | void rcu_idle_exit(void); |
@@ -348,8 +348,8 @@ extern struct srcu_struct tasks_rcu_exit_srcu; | |||
348 | */ | 348 | */ |
349 | #define cond_resched_rcu_qs() \ | 349 | #define cond_resched_rcu_qs() \ |
350 | do { \ | 350 | do { \ |
351 | rcu_note_voluntary_context_switch(current); \ | 351 | if (!cond_resched()) \ |
352 | cond_resched(); \ | 352 | rcu_note_voluntary_context_switch(current); \ |
353 | } while (0) | 353 | } while (0) |
354 | 354 | ||
355 | #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) | 355 | #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) |
@@ -365,7 +365,7 @@ typedef void call_rcu_func_t(struct rcu_head *head, | |||
365 | void (*func)(struct rcu_head *head)); | 365 | void (*func)(struct rcu_head *head)); |
366 | void wait_rcu_gp(call_rcu_func_t crf); | 366 | void wait_rcu_gp(call_rcu_func_t crf); |
367 | 367 | ||
368 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) | 368 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU) |
369 | #include <linux/rcutree.h> | 369 | #include <linux/rcutree.h> |
370 | #elif defined(CONFIG_TINY_RCU) | 370 | #elif defined(CONFIG_TINY_RCU) |
371 | #include <linux/rcutiny.h> | 371 | #include <linux/rcutiny.h> |
@@ -867,7 +867,7 @@ static inline void rcu_preempt_sleep_check(void) | |||
867 | * | 867 | * |
868 | * In non-preemptible RCU implementations (TREE_RCU and TINY_RCU), | 868 | * In non-preemptible RCU implementations (TREE_RCU and TINY_RCU), |
869 | * it is illegal to block while in an RCU read-side critical section. | 869 | * it is illegal to block while in an RCU read-side critical section. |
870 | * In preemptible RCU implementations (TREE_PREEMPT_RCU) in CONFIG_PREEMPT | 870 | * In preemptible RCU implementations (PREEMPT_RCU) in CONFIG_PREEMPT |
871 | * kernel builds, RCU read-side critical sections may be preempted, | 871 | * kernel builds, RCU read-side critical sections may be preempted, |
872 | * but explicit blocking is illegal. Finally, in preemptible RCU | 872 | * but explicit blocking is illegal. Finally, in preemptible RCU |
873 | * implementations in real-time (with -rt patchset) kernel builds, RCU | 873 | * implementations in real-time (with -rt patchset) kernel builds, RCU |
@@ -902,7 +902,9 @@ static inline void rcu_read_lock(void) | |||
902 | * Unfortunately, this function acquires the scheduler's runqueue and | 902 | * Unfortunately, this function acquires the scheduler's runqueue and |
903 | * priority-inheritance spinlocks. This means that deadlock could result | 903 | * priority-inheritance spinlocks. This means that deadlock could result |
904 | * if the caller of rcu_read_unlock() already holds one of these locks or | 904 | * if the caller of rcu_read_unlock() already holds one of these locks or |
905 | * any lock that is ever acquired while holding them. | 905 | * any lock that is ever acquired while holding them; or any lock which |
906 | * can be taken from interrupt context because rcu_boost()->rt_mutex_lock() | ||
907 | * does not disable irqs while taking ->wait_lock. | ||
906 | * | 908 | * |
907 | * That said, RCU readers are never priority boosted unless they were | 909 | * That said, RCU readers are never priority boosted unless they were |
908 | * preempted. Therefore, one way to avoid deadlock is to make sure | 910 | * preempted. Therefore, one way to avoid deadlock is to make sure |
@@ -1062,6 +1064,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) | |||
1062 | */ | 1064 | */ |
1063 | #define RCU_INIT_POINTER(p, v) \ | 1065 | #define RCU_INIT_POINTER(p, v) \ |
1064 | do { \ | 1066 | do { \ |
1067 | rcu_dereference_sparse(p, __rcu); \ | ||
1065 | p = RCU_INITIALIZER(v); \ | 1068 | p = RCU_INITIALIZER(v); \ |
1066 | } while (0) | 1069 | } while (0) |
1067 | 1070 | ||
@@ -1118,7 +1121,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) | |||
1118 | __kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head)) | 1121 | __kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head)) |
1119 | 1122 | ||
1120 | #if defined(CONFIG_TINY_RCU) || defined(CONFIG_RCU_NOCB_CPU_ALL) | 1123 | #if defined(CONFIG_TINY_RCU) || defined(CONFIG_RCU_NOCB_CPU_ALL) |
1121 | static inline int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies) | 1124 | static inline int rcu_needs_cpu(unsigned long *delta_jiffies) |
1122 | { | 1125 | { |
1123 | *delta_jiffies = ULONG_MAX; | 1126 | *delta_jiffies = ULONG_MAX; |
1124 | return 0; | 1127 | return 0; |
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index 38cc5b1e252d..0e5366200154 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h | |||
@@ -78,7 +78,7 @@ static inline void kfree_call_rcu(struct rcu_head *head, | |||
78 | call_rcu(head, func); | 78 | call_rcu(head, func); |
79 | } | 79 | } |
80 | 80 | ||
81 | static inline void rcu_note_context_switch(int cpu) | 81 | static inline void rcu_note_context_switch(void) |
82 | { | 82 | { |
83 | rcu_sched_qs(); | 83 | rcu_sched_qs(); |
84 | } | 84 | } |
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 3e2f5d432743..52953790dcca 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
@@ -30,9 +30,9 @@ | |||
30 | #ifndef __LINUX_RCUTREE_H | 30 | #ifndef __LINUX_RCUTREE_H |
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(void); |
34 | #ifndef CONFIG_RCU_NOCB_CPU_ALL | 34 | #ifndef CONFIG_RCU_NOCB_CPU_ALL |
35 | int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies); | 35 | int rcu_needs_cpu(unsigned long *delta_jiffies); |
36 | #endif /* #ifndef CONFIG_RCU_NOCB_CPU_ALL */ | 36 | #endif /* #ifndef CONFIG_RCU_NOCB_CPU_ALL */ |
37 | void rcu_cpu_stall_reset(void); | 37 | void rcu_cpu_stall_reset(void); |
38 | 38 | ||
@@ -43,7 +43,7 @@ void rcu_cpu_stall_reset(void); | |||
43 | */ | 43 | */ |
44 | static inline void rcu_virt_note_context_switch(int cpu) | 44 | static inline void rcu_virt_note_context_switch(int cpu) |
45 | { | 45 | { |
46 | rcu_note_context_switch(cpu); | 46 | rcu_note_context_switch(); |
47 | } | 47 | } |
48 | 48 | ||
49 | void synchronize_rcu_bh(void); | 49 | void synchronize_rcu_bh(void); |
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index c5ed83f49c4e..4419b99d8d6e 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h | |||
@@ -27,6 +27,7 @@ struct spmi_device; | |||
27 | struct regmap; | 27 | struct regmap; |
28 | struct regmap_range_cfg; | 28 | struct regmap_range_cfg; |
29 | struct regmap_field; | 29 | struct regmap_field; |
30 | struct snd_ac97; | ||
30 | 31 | ||
31 | /* An enum of all the supported cache types */ | 32 | /* An enum of all the supported cache types */ |
32 | enum regcache_type { | 33 | enum regcache_type { |
@@ -340,6 +341,8 @@ struct regmap *regmap_init_spmi_ext(struct spmi_device *dev, | |||
340 | struct regmap *regmap_init_mmio_clk(struct device *dev, const char *clk_id, | 341 | struct regmap *regmap_init_mmio_clk(struct device *dev, const char *clk_id, |
341 | void __iomem *regs, | 342 | void __iomem *regs, |
342 | const struct regmap_config *config); | 343 | const struct regmap_config *config); |
344 | struct regmap *regmap_init_ac97(struct snd_ac97 *ac97, | ||
345 | const struct regmap_config *config); | ||
343 | 346 | ||
344 | struct regmap *devm_regmap_init(struct device *dev, | 347 | struct regmap *devm_regmap_init(struct device *dev, |
345 | const struct regmap_bus *bus, | 348 | const struct regmap_bus *bus, |
@@ -356,6 +359,10 @@ struct regmap *devm_regmap_init_spmi_ext(struct spmi_device *dev, | |||
356 | struct regmap *devm_regmap_init_mmio_clk(struct device *dev, const char *clk_id, | 359 | struct regmap *devm_regmap_init_mmio_clk(struct device *dev, const char *clk_id, |
357 | void __iomem *regs, | 360 | void __iomem *regs, |
358 | const struct regmap_config *config); | 361 | const struct regmap_config *config); |
362 | struct regmap *devm_regmap_init_ac97(struct snd_ac97 *ac97, | ||
363 | const struct regmap_config *config); | ||
364 | |||
365 | bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg); | ||
359 | 366 | ||
360 | /** | 367 | /** |
361 | * regmap_init_mmio(): Initialise register map | 368 | * regmap_init_mmio(): Initialise register map |
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index f540b1496e2f..d17e1ff7ad01 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
@@ -101,6 +101,8 @@ struct regmap; | |||
101 | * Data passed is "struct pre_voltage_change_data" | 101 | * Data passed is "struct pre_voltage_change_data" |
102 | * ABORT_VOLTAGE_CHANGE Regulator voltage change failed for some reason. | 102 | * ABORT_VOLTAGE_CHANGE Regulator voltage change failed for some reason. |
103 | * Data passed is old voltage cast to (void *). | 103 | * Data passed is old voltage cast to (void *). |
104 | * PRE_DISABLE Regulator is about to be disabled | ||
105 | * ABORT_DISABLE Regulator disable failed for some reason | ||
104 | * | 106 | * |
105 | * NOTE: These events can be OR'ed together when passed into handler. | 107 | * NOTE: These events can be OR'ed together when passed into handler. |
106 | */ | 108 | */ |
@@ -115,6 +117,8 @@ struct regmap; | |||
115 | #define REGULATOR_EVENT_DISABLE 0x80 | 117 | #define REGULATOR_EVENT_DISABLE 0x80 |
116 | #define REGULATOR_EVENT_PRE_VOLTAGE_CHANGE 0x100 | 118 | #define REGULATOR_EVENT_PRE_VOLTAGE_CHANGE 0x100 |
117 | #define REGULATOR_EVENT_ABORT_VOLTAGE_CHANGE 0x200 | 119 | #define REGULATOR_EVENT_ABORT_VOLTAGE_CHANGE 0x200 |
120 | #define REGULATOR_EVENT_PRE_DISABLE 0x400 | ||
121 | #define REGULATOR_EVENT_ABORT_DISABLE 0x800 | ||
118 | 122 | ||
119 | /** | 123 | /** |
120 | * struct pre_voltage_change_data - Data sent with PRE_VOLTAGE_CHANGE event | 124 | * struct pre_voltage_change_data - Data sent with PRE_VOLTAGE_CHANGE event |
@@ -284,7 +288,7 @@ devm_regulator_get(struct device *dev, const char *id) | |||
284 | static inline struct regulator *__must_check | 288 | static inline struct regulator *__must_check |
285 | regulator_get_exclusive(struct device *dev, const char *id) | 289 | regulator_get_exclusive(struct device *dev, const char *id) |
286 | { | 290 | { |
287 | return NULL; | 291 | return ERR_PTR(-ENODEV); |
288 | } | 292 | } |
289 | 293 | ||
290 | static inline struct regulator *__must_check | 294 | static inline struct regulator *__must_check |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index fc0ee0ce8325..5f1e9ca47417 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
@@ -243,6 +243,8 @@ enum regulator_type { | |||
243 | * | 243 | * |
244 | * @enable_time: Time taken for initial enable of regulator (in uS). | 244 | * @enable_time: Time taken for initial enable of regulator (in uS). |
245 | * @off_on_delay: guard time (in uS), before re-enabling a regulator | 245 | * @off_on_delay: guard time (in uS), before re-enabling a regulator |
246 | * | ||
247 | * @of_map_mode: Maps a hardware mode defined in a DeviceTree to a standard mode | ||
246 | */ | 248 | */ |
247 | struct regulator_desc { | 249 | struct regulator_desc { |
248 | const char *name; | 250 | const char *name; |
@@ -285,6 +287,8 @@ struct regulator_desc { | |||
285 | unsigned int enable_time; | 287 | unsigned int enable_time; |
286 | 288 | ||
287 | unsigned int off_on_delay; | 289 | unsigned int off_on_delay; |
290 | |||
291 | unsigned int (*of_map_mode)(unsigned int mode); | ||
288 | }; | 292 | }; |
289 | 293 | ||
290 | /** | 294 | /** |
@@ -301,6 +305,9 @@ struct regulator_desc { | |||
301 | * NULL). | 305 | * NULL). |
302 | * @regmap: regmap to use for core regmap helpers if dev_get_regulator() is | 306 | * @regmap: regmap to use for core regmap helpers if dev_get_regulator() is |
303 | * insufficient. | 307 | * insufficient. |
308 | * @ena_gpio_initialized: GPIO controlling regulator enable was properly | ||
309 | * initialized, meaning that >= 0 is a valid gpio | ||
310 | * identifier and < 0 is a non existent gpio. | ||
304 | * @ena_gpio: GPIO controlling regulator enable. | 311 | * @ena_gpio: GPIO controlling regulator enable. |
305 | * @ena_gpio_invert: Sense for GPIO enable control. | 312 | * @ena_gpio_invert: Sense for GPIO enable control. |
306 | * @ena_gpio_flags: Flags to use when calling gpio_request_one() | 313 | * @ena_gpio_flags: Flags to use when calling gpio_request_one() |
@@ -312,6 +319,7 @@ struct regulator_config { | |||
312 | struct device_node *of_node; | 319 | struct device_node *of_node; |
313 | struct regmap *regmap; | 320 | struct regmap *regmap; |
314 | 321 | ||
322 | bool ena_gpio_initialized; | ||
315 | int ena_gpio; | 323 | int ena_gpio; |
316 | unsigned int ena_gpio_invert:1; | 324 | unsigned int ena_gpio_invert:1; |
317 | unsigned int ena_gpio_flags; | 325 | unsigned int ena_gpio_flags; |
diff --git a/include/linux/regulator/of_regulator.h b/include/linux/regulator/of_regulator.h index f9217965aaa3..763953f7e3b8 100644 --- a/include/linux/regulator/of_regulator.h +++ b/include/linux/regulator/of_regulator.h | |||
@@ -6,24 +6,29 @@ | |||
6 | #ifndef __LINUX_OF_REG_H | 6 | #ifndef __LINUX_OF_REG_H |
7 | #define __LINUX_OF_REG_H | 7 | #define __LINUX_OF_REG_H |
8 | 8 | ||
9 | struct regulator_desc; | ||
10 | |||
9 | struct of_regulator_match { | 11 | struct of_regulator_match { |
10 | const char *name; | 12 | const char *name; |
11 | void *driver_data; | 13 | void *driver_data; |
12 | struct regulator_init_data *init_data; | 14 | struct regulator_init_data *init_data; |
13 | struct device_node *of_node; | 15 | struct device_node *of_node; |
16 | const struct regulator_desc *desc; | ||
14 | }; | 17 | }; |
15 | 18 | ||
16 | #if defined(CONFIG_OF) | 19 | #if defined(CONFIG_OF) |
17 | extern struct regulator_init_data | 20 | extern struct regulator_init_data |
18 | *of_get_regulator_init_data(struct device *dev, | 21 | *of_get_regulator_init_data(struct device *dev, |
19 | struct device_node *node); | 22 | struct device_node *node, |
23 | const struct regulator_desc *desc); | ||
20 | extern int of_regulator_match(struct device *dev, struct device_node *node, | 24 | extern int of_regulator_match(struct device *dev, struct device_node *node, |
21 | struct of_regulator_match *matches, | 25 | struct of_regulator_match *matches, |
22 | unsigned int num_matches); | 26 | unsigned int num_matches); |
23 | #else | 27 | #else |
24 | static inline struct regulator_init_data | 28 | static inline struct regulator_init_data |
25 | *of_get_regulator_init_data(struct device *dev, | 29 | *of_get_regulator_init_data(struct device *dev, |
26 | struct device_node *node) | 30 | struct device_node *node, |
31 | const struct regulator_desc *desc) | ||
27 | { | 32 | { |
28 | return NULL; | 33 | return NULL; |
29 | } | 34 | } |
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h deleted file mode 100644 index 56b7bc32db4f..000000000000 --- a/include/linux/res_counter.h +++ /dev/null | |||
@@ -1,223 +0,0 @@ | |||
1 | #ifndef __RES_COUNTER_H__ | ||
2 | #define __RES_COUNTER_H__ | ||
3 | |||
4 | /* | ||
5 | * Resource Counters | ||
6 | * Contain common data types and routines for resource accounting | ||
7 | * | ||
8 | * Copyright 2007 OpenVZ SWsoft Inc | ||
9 | * | ||
10 | * Author: Pavel Emelianov <xemul@openvz.org> | ||
11 | * | ||
12 | * See Documentation/cgroups/resource_counter.txt for more | ||
13 | * info about what this counter is. | ||
14 | */ | ||
15 | |||
16 | #include <linux/spinlock.h> | ||
17 | #include <linux/errno.h> | ||
18 | |||
19 | /* | ||
20 | * The core object. the cgroup that wishes to account for some | ||
21 | * resource may include this counter into its structures and use | ||
22 | * the helpers described beyond | ||
23 | */ | ||
24 | |||
25 | struct res_counter { | ||
26 | /* | ||
27 | * the current resource consumption level | ||
28 | */ | ||
29 | unsigned long long usage; | ||
30 | /* | ||
31 | * the maximal value of the usage from the counter creation | ||
32 | */ | ||
33 | unsigned long long max_usage; | ||
34 | /* | ||
35 | * the limit that usage cannot exceed | ||
36 | */ | ||
37 | unsigned long long limit; | ||
38 | /* | ||
39 | * the limit that usage can be exceed | ||
40 | */ | ||
41 | unsigned long long soft_limit; | ||
42 | /* | ||
43 | * the number of unsuccessful attempts to consume the resource | ||
44 | */ | ||
45 | unsigned long long failcnt; | ||
46 | /* | ||
47 | * the lock to protect all of the above. | ||
48 | * the routines below consider this to be IRQ-safe | ||
49 | */ | ||
50 | spinlock_t lock; | ||
51 | /* | ||
52 | * Parent counter, used for hierarchial resource accounting | ||
53 | */ | ||
54 | struct res_counter *parent; | ||
55 | }; | ||
56 | |||
57 | #define RES_COUNTER_MAX ULLONG_MAX | ||
58 | |||
59 | /** | ||
60 | * Helpers to interact with userspace | ||
61 | * res_counter_read_u64() - returns the value of the specified member. | ||
62 | * res_counter_read/_write - put/get the specified fields from the | ||
63 | * res_counter struct to/from the user | ||
64 | * | ||
65 | * @counter: the counter in question | ||
66 | * @member: the field to work with (see RES_xxx below) | ||
67 | * @buf: the buffer to opeate on,... | ||
68 | * @nbytes: its size... | ||
69 | * @pos: and the offset. | ||
70 | */ | ||
71 | |||
72 | u64 res_counter_read_u64(struct res_counter *counter, int member); | ||
73 | |||
74 | ssize_t res_counter_read(struct res_counter *counter, int member, | ||
75 | const char __user *buf, size_t nbytes, loff_t *pos, | ||
76 | int (*read_strategy)(unsigned long long val, char *s)); | ||
77 | |||
78 | int res_counter_memparse_write_strategy(const char *buf, | ||
79 | unsigned long long *res); | ||
80 | |||
81 | /* | ||
82 | * the field descriptors. one for each member of res_counter | ||
83 | */ | ||
84 | |||
85 | enum { | ||
86 | RES_USAGE, | ||
87 | RES_MAX_USAGE, | ||
88 | RES_LIMIT, | ||
89 | RES_FAILCNT, | ||
90 | RES_SOFT_LIMIT, | ||
91 | }; | ||
92 | |||
93 | /* | ||
94 | * helpers for accounting | ||
95 | */ | ||
96 | |||
97 | void res_counter_init(struct res_counter *counter, struct res_counter *parent); | ||
98 | |||
99 | /* | ||
100 | * charge - try to consume more resource. | ||
101 | * | ||
102 | * @counter: the counter | ||
103 | * @val: the amount of the resource. each controller defines its own | ||
104 | * units, e.g. numbers, bytes, Kbytes, etc | ||
105 | * | ||
106 | * returns 0 on success and <0 if the counter->usage will exceed the | ||
107 | * counter->limit | ||
108 | * | ||
109 | * charge_nofail works the same, except that it charges the resource | ||
110 | * counter unconditionally, and returns < 0 if the after the current | ||
111 | * charge we are over limit. | ||
112 | */ | ||
113 | |||
114 | int __must_check res_counter_charge(struct res_counter *counter, | ||
115 | unsigned long val, struct res_counter **limit_fail_at); | ||
116 | int res_counter_charge_nofail(struct res_counter *counter, | ||
117 | unsigned long val, struct res_counter **limit_fail_at); | ||
118 | |||
119 | /* | ||
120 | * uncharge - tell that some portion of the resource is released | ||
121 | * | ||
122 | * @counter: the counter | ||
123 | * @val: the amount of the resource | ||
124 | * | ||
125 | * these calls check for usage underflow and show a warning on the console | ||
126 | * | ||
127 | * returns the total charges still present in @counter. | ||
128 | */ | ||
129 | |||
130 | u64 res_counter_uncharge(struct res_counter *counter, unsigned long val); | ||
131 | |||
132 | u64 res_counter_uncharge_until(struct res_counter *counter, | ||
133 | struct res_counter *top, | ||
134 | unsigned long val); | ||
135 | /** | ||
136 | * res_counter_margin - calculate chargeable space of a counter | ||
137 | * @cnt: the counter | ||
138 | * | ||
139 | * Returns the difference between the hard limit and the current usage | ||
140 | * of resource counter @cnt. | ||
141 | */ | ||
142 | static inline unsigned long long res_counter_margin(struct res_counter *cnt) | ||
143 | { | ||
144 | unsigned long long margin; | ||
145 | unsigned long flags; | ||
146 | |||
147 | spin_lock_irqsave(&cnt->lock, flags); | ||
148 | if (cnt->limit > cnt->usage) | ||
149 | margin = cnt->limit - cnt->usage; | ||
150 | else | ||
151 | margin = 0; | ||
152 | spin_unlock_irqrestore(&cnt->lock, flags); | ||
153 | return margin; | ||
154 | } | ||
155 | |||
156 | /** | ||
157 | * Get the difference between the usage and the soft limit | ||
158 | * @cnt: The counter | ||
159 | * | ||
160 | * Returns 0 if usage is less than or equal to soft limit | ||
161 | * The difference between usage and soft limit, otherwise. | ||
162 | */ | ||
163 | static inline unsigned long long | ||
164 | res_counter_soft_limit_excess(struct res_counter *cnt) | ||
165 | { | ||
166 | unsigned long long excess; | ||
167 | unsigned long flags; | ||
168 | |||
169 | spin_lock_irqsave(&cnt->lock, flags); | ||
170 | if (cnt->usage <= cnt->soft_limit) | ||
171 | excess = 0; | ||
172 | else | ||
173 | excess = cnt->usage - cnt->soft_limit; | ||
174 | spin_unlock_irqrestore(&cnt->lock, flags); | ||
175 | return excess; | ||
176 | } | ||
177 | |||
178 | static inline void res_counter_reset_max(struct res_counter *cnt) | ||
179 | { | ||
180 | unsigned long flags; | ||
181 | |||
182 | spin_lock_irqsave(&cnt->lock, flags); | ||
183 | cnt->max_usage = cnt->usage; | ||
184 | spin_unlock_irqrestore(&cnt->lock, flags); | ||
185 | } | ||
186 | |||
187 | static inline void res_counter_reset_failcnt(struct res_counter *cnt) | ||
188 | { | ||
189 | unsigned long flags; | ||
190 | |||
191 | spin_lock_irqsave(&cnt->lock, flags); | ||
192 | cnt->failcnt = 0; | ||
193 | spin_unlock_irqrestore(&cnt->lock, flags); | ||
194 | } | ||
195 | |||
196 | static inline int res_counter_set_limit(struct res_counter *cnt, | ||
197 | unsigned long long limit) | ||
198 | { | ||
199 | unsigned long flags; | ||
200 | int ret = -EBUSY; | ||
201 | |||
202 | spin_lock_irqsave(&cnt->lock, flags); | ||
203 | if (cnt->usage <= limit) { | ||
204 | cnt->limit = limit; | ||
205 | ret = 0; | ||
206 | } | ||
207 | spin_unlock_irqrestore(&cnt->lock, flags); | ||
208 | return ret; | ||
209 | } | ||
210 | |||
211 | static inline int | ||
212 | res_counter_set_soft_limit(struct res_counter *cnt, | ||
213 | unsigned long long soft_limit) | ||
214 | { | ||
215 | unsigned long flags; | ||
216 | |||
217 | spin_lock_irqsave(&cnt->lock, flags); | ||
218 | cnt->soft_limit = soft_limit; | ||
219 | spin_unlock_irqrestore(&cnt->lock, flags); | ||
220 | return 0; | ||
221 | } | ||
222 | |||
223 | #endif | ||
diff --git a/include/linux/reset-controller.h b/include/linux/reset-controller.h index 41a4695fde08..ce6b962ffed4 100644 --- a/include/linux/reset-controller.h +++ b/include/linux/reset-controller.h | |||
@@ -12,11 +12,13 @@ struct reset_controller_dev; | |||
12 | * things to reset the device | 12 | * things to reset the device |
13 | * @assert: manually assert the reset line, if supported | 13 | * @assert: manually assert the reset line, if supported |
14 | * @deassert: manually deassert the reset line, if supported | 14 | * @deassert: manually deassert the reset line, if supported |
15 | * @status: return the status of the reset line, if supported | ||
15 | */ | 16 | */ |
16 | struct reset_control_ops { | 17 | struct reset_control_ops { |
17 | int (*reset)(struct reset_controller_dev *rcdev, unsigned long id); | 18 | int (*reset)(struct reset_controller_dev *rcdev, unsigned long id); |
18 | int (*assert)(struct reset_controller_dev *rcdev, unsigned long id); | 19 | int (*assert)(struct reset_controller_dev *rcdev, unsigned long id); |
19 | int (*deassert)(struct reset_controller_dev *rcdev, unsigned long id); | 20 | int (*deassert)(struct reset_controller_dev *rcdev, unsigned long id); |
21 | int (*status)(struct reset_controller_dev *rcdev, unsigned long id); | ||
20 | }; | 22 | }; |
21 | 23 | ||
22 | struct module; | 24 | struct module; |
diff --git a/include/linux/reset.h b/include/linux/reset.h index 349f150ae12c..da5602bd77d7 100644 --- a/include/linux/reset.h +++ b/include/linux/reset.h | |||
@@ -10,6 +10,7 @@ struct reset_control; | |||
10 | int reset_control_reset(struct reset_control *rstc); | 10 | int reset_control_reset(struct reset_control *rstc); |
11 | int reset_control_assert(struct reset_control *rstc); | 11 | int reset_control_assert(struct reset_control *rstc); |
12 | int reset_control_deassert(struct reset_control *rstc); | 12 | int reset_control_deassert(struct reset_control *rstc); |
13 | int reset_control_status(struct reset_control *rstc); | ||
13 | 14 | ||
14 | struct reset_control *reset_control_get(struct device *dev, const char *id); | 15 | struct reset_control *reset_control_get(struct device *dev, const char *id); |
15 | void reset_control_put(struct reset_control *rstc); | 16 | void reset_control_put(struct reset_control *rstc); |
@@ -57,6 +58,12 @@ static inline int reset_control_deassert(struct reset_control *rstc) | |||
57 | return 0; | 58 | return 0; |
58 | } | 59 | } |
59 | 60 | ||
61 | static inline int reset_control_status(struct reset_control *rstc) | ||
62 | { | ||
63 | WARN_ON(1); | ||
64 | return 0; | ||
65 | } | ||
66 | |||
60 | static inline void reset_control_put(struct reset_control *rstc) | 67 | static inline void reset_control_put(struct reset_control *rstc) |
61 | { | 68 | { |
62 | WARN_ON(1); | 69 | WARN_ON(1); |
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index c2c28975293c..6d6be09a2fe5 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h | |||
@@ -19,11 +19,28 @@ | |||
19 | extern int rtc_month_days(unsigned int month, unsigned int year); | 19 | extern int rtc_month_days(unsigned int month, unsigned int year); |
20 | extern int rtc_year_days(unsigned int day, unsigned int month, unsigned int year); | 20 | extern int rtc_year_days(unsigned int day, unsigned int month, unsigned int year); |
21 | extern int rtc_valid_tm(struct rtc_time *tm); | 21 | extern int rtc_valid_tm(struct rtc_time *tm); |
22 | extern int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time); | 22 | extern time64_t rtc_tm_to_time64(struct rtc_time *tm); |
23 | extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm); | 23 | extern void rtc_time64_to_tm(time64_t time, struct rtc_time *tm); |
24 | ktime_t rtc_tm_to_ktime(struct rtc_time tm); | 24 | ktime_t rtc_tm_to_ktime(struct rtc_time tm); |
25 | struct rtc_time rtc_ktime_to_tm(ktime_t kt); | 25 | struct rtc_time rtc_ktime_to_tm(ktime_t kt); |
26 | 26 | ||
27 | /** | ||
28 | * Deprecated. Use rtc_time64_to_tm(). | ||
29 | */ | ||
30 | static inline void rtc_time_to_tm(unsigned long time, struct rtc_time *tm) | ||
31 | { | ||
32 | rtc_time64_to_tm(time, tm); | ||
33 | } | ||
34 | |||
35 | /** | ||
36 | * Deprecated. Use rtc_tm_to_time64(). | ||
37 | */ | ||
38 | static inline int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time) | ||
39 | { | ||
40 | *time = rtc_tm_to_time64(tm); | ||
41 | |||
42 | return 0; | ||
43 | } | ||
27 | 44 | ||
28 | #include <linux/device.h> | 45 | #include <linux/device.h> |
29 | #include <linux/seq_file.h> | 46 | #include <linux/seq_file.h> |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 5e344bbe63ec..55f5ee7cc3d3 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -243,6 +243,43 @@ extern char ___assert_task_state[1 - 2*!!( | |||
243 | ((task->state & TASK_UNINTERRUPTIBLE) != 0 && \ | 243 | ((task->state & TASK_UNINTERRUPTIBLE) != 0 && \ |
244 | (task->flags & PF_FROZEN) == 0) | 244 | (task->flags & PF_FROZEN) == 0) |
245 | 245 | ||
246 | #ifdef CONFIG_DEBUG_ATOMIC_SLEEP | ||
247 | |||
248 | #define __set_task_state(tsk, state_value) \ | ||
249 | do { \ | ||
250 | (tsk)->task_state_change = _THIS_IP_; \ | ||
251 | (tsk)->state = (state_value); \ | ||
252 | } while (0) | ||
253 | #define set_task_state(tsk, state_value) \ | ||
254 | do { \ | ||
255 | (tsk)->task_state_change = _THIS_IP_; \ | ||
256 | set_mb((tsk)->state, (state_value)); \ | ||
257 | } while (0) | ||
258 | |||
259 | /* | ||
260 | * set_current_state() includes a barrier so that the write of current->state | ||
261 | * is correctly serialised wrt the caller's subsequent test of whether to | ||
262 | * actually sleep: | ||
263 | * | ||
264 | * set_current_state(TASK_UNINTERRUPTIBLE); | ||
265 | * if (do_i_need_to_sleep()) | ||
266 | * schedule(); | ||
267 | * | ||
268 | * If the caller does not need such serialisation then use __set_current_state() | ||
269 | */ | ||
270 | #define __set_current_state(state_value) \ | ||
271 | do { \ | ||
272 | current->task_state_change = _THIS_IP_; \ | ||
273 | current->state = (state_value); \ | ||
274 | } while (0) | ||
275 | #define set_current_state(state_value) \ | ||
276 | do { \ | ||
277 | current->task_state_change = _THIS_IP_; \ | ||
278 | set_mb(current->state, (state_value)); \ | ||
279 | } while (0) | ||
280 | |||
281 | #else | ||
282 | |||
246 | #define __set_task_state(tsk, state_value) \ | 283 | #define __set_task_state(tsk, state_value) \ |
247 | do { (tsk)->state = (state_value); } while (0) | 284 | do { (tsk)->state = (state_value); } while (0) |
248 | #define set_task_state(tsk, state_value) \ | 285 | #define set_task_state(tsk, state_value) \ |
@@ -259,11 +296,13 @@ extern char ___assert_task_state[1 - 2*!!( | |||
259 | * | 296 | * |
260 | * If the caller does not need such serialisation then use __set_current_state() | 297 | * If the caller does not need such serialisation then use __set_current_state() |
261 | */ | 298 | */ |
262 | #define __set_current_state(state_value) \ | 299 | #define __set_current_state(state_value) \ |
263 | do { current->state = (state_value); } while (0) | 300 | do { current->state = (state_value); } while (0) |
264 | #define set_current_state(state_value) \ | 301 | #define set_current_state(state_value) \ |
265 | set_mb(current->state, (state_value)) | 302 | set_mb(current->state, (state_value)) |
266 | 303 | ||
304 | #endif | ||
305 | |||
267 | /* Task command name length */ | 306 | /* Task command name length */ |
268 | #define TASK_COMM_LEN 16 | 307 | #define TASK_COMM_LEN 16 |
269 | 308 | ||
@@ -1278,9 +1317,9 @@ struct task_struct { | |||
1278 | union rcu_special rcu_read_unlock_special; | 1317 | union rcu_special rcu_read_unlock_special; |
1279 | struct list_head rcu_node_entry; | 1318 | struct list_head rcu_node_entry; |
1280 | #endif /* #ifdef CONFIG_PREEMPT_RCU */ | 1319 | #endif /* #ifdef CONFIG_PREEMPT_RCU */ |
1281 | #ifdef CONFIG_TREE_PREEMPT_RCU | 1320 | #ifdef CONFIG_PREEMPT_RCU |
1282 | struct rcu_node *rcu_blocked_node; | 1321 | struct rcu_node *rcu_blocked_node; |
1283 | #endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ | 1322 | #endif /* #ifdef CONFIG_PREEMPT_RCU */ |
1284 | #ifdef CONFIG_TASKS_RCU | 1323 | #ifdef CONFIG_TASKS_RCU |
1285 | unsigned long rcu_tasks_nvcsw; | 1324 | unsigned long rcu_tasks_nvcsw; |
1286 | bool rcu_tasks_holdout; | 1325 | bool rcu_tasks_holdout; |
@@ -1558,28 +1597,23 @@ struct task_struct { | |||
1558 | struct numa_group *numa_group; | 1597 | struct numa_group *numa_group; |
1559 | 1598 | ||
1560 | /* | 1599 | /* |
1561 | * Exponential decaying average of faults on a per-node basis. | 1600 | * numa_faults is an array split into four regions: |
1562 | * Scheduling placement decisions are made based on the these counts. | 1601 | * faults_memory, faults_cpu, faults_memory_buffer, faults_cpu_buffer |
1563 | * The values remain static for the duration of a PTE scan | 1602 | * in this precise order. |
1603 | * | ||
1604 | * faults_memory: Exponential decaying average of faults on a per-node | ||
1605 | * basis. Scheduling placement decisions are made based on these | ||
1606 | * counts. The values remain static for the duration of a PTE scan. | ||
1607 | * faults_cpu: Track the nodes the process was running on when a NUMA | ||
1608 | * hinting fault was incurred. | ||
1609 | * faults_memory_buffer and faults_cpu_buffer: Record faults per node | ||
1610 | * during the current scan window. When the scan completes, the counts | ||
1611 | * in faults_memory and faults_cpu decay and these values are copied. | ||
1564 | */ | 1612 | */ |
1565 | unsigned long *numa_faults_memory; | 1613 | unsigned long *numa_faults; |
1566 | unsigned long total_numa_faults; | 1614 | unsigned long total_numa_faults; |
1567 | 1615 | ||
1568 | /* | 1616 | /* |
1569 | * numa_faults_buffer records faults per node during the current | ||
1570 | * scan window. When the scan completes, the counts in | ||
1571 | * numa_faults_memory decay and these values are copied. | ||
1572 | */ | ||
1573 | unsigned long *numa_faults_buffer_memory; | ||
1574 | |||
1575 | /* | ||
1576 | * Track the nodes the process was running on when a NUMA hinting | ||
1577 | * fault was incurred. | ||
1578 | */ | ||
1579 | unsigned long *numa_faults_cpu; | ||
1580 | unsigned long *numa_faults_buffer_cpu; | ||
1581 | |||
1582 | /* | ||
1583 | * numa_faults_locality tracks if faults recorded during the last | 1617 | * numa_faults_locality tracks if faults recorded during the last |
1584 | * scan window were remote/local. The task scan period is adapted | 1618 | * scan window were remote/local. The task scan period is adapted |
1585 | * based on the locality of the faults with different weights | 1619 | * based on the locality of the faults with different weights |
@@ -1661,6 +1695,9 @@ struct task_struct { | |||
1661 | unsigned int sequential_io; | 1695 | unsigned int sequential_io; |
1662 | unsigned int sequential_io_avg; | 1696 | unsigned int sequential_io_avg; |
1663 | #endif | 1697 | #endif |
1698 | #ifdef CONFIG_DEBUG_ATOMIC_SLEEP | ||
1699 | unsigned long task_state_change; | ||
1700 | #endif | ||
1664 | }; | 1701 | }; |
1665 | 1702 | ||
1666 | /* Future-safe accessor for struct task_struct's cpus_allowed. */ | 1703 | /* Future-safe accessor for struct task_struct's cpus_allowed. */ |
@@ -2052,6 +2089,10 @@ static inline void tsk_restore_flags(struct task_struct *task, | |||
2052 | task->flags |= orig_flags & flags; | 2089 | task->flags |= orig_flags & flags; |
2053 | } | 2090 | } |
2054 | 2091 | ||
2092 | extern int cpuset_cpumask_can_shrink(const struct cpumask *cur, | ||
2093 | const struct cpumask *trial); | ||
2094 | extern int task_can_attach(struct task_struct *p, | ||
2095 | const struct cpumask *cs_cpus_allowed); | ||
2055 | #ifdef CONFIG_SMP | 2096 | #ifdef CONFIG_SMP |
2056 | extern void do_set_cpus_allowed(struct task_struct *p, | 2097 | extern void do_set_cpus_allowed(struct task_struct *p, |
2057 | const struct cpumask *new_mask); | 2098 | const struct cpumask *new_mask); |
@@ -2760,7 +2801,7 @@ static inline int signal_pending_state(long state, struct task_struct *p) | |||
2760 | extern int _cond_resched(void); | 2801 | extern int _cond_resched(void); |
2761 | 2802 | ||
2762 | #define cond_resched() ({ \ | 2803 | #define cond_resched() ({ \ |
2763 | __might_sleep(__FILE__, __LINE__, 0); \ | 2804 | ___might_sleep(__FILE__, __LINE__, 0); \ |
2764 | _cond_resched(); \ | 2805 | _cond_resched(); \ |
2765 | }) | 2806 | }) |
2766 | 2807 | ||
@@ -2773,14 +2814,14 @@ extern int __cond_resched_lock(spinlock_t *lock); | |||
2773 | #endif | 2814 | #endif |
2774 | 2815 | ||
2775 | #define cond_resched_lock(lock) ({ \ | 2816 | #define cond_resched_lock(lock) ({ \ |
2776 | __might_sleep(__FILE__, __LINE__, PREEMPT_LOCK_OFFSET); \ | 2817 | ___might_sleep(__FILE__, __LINE__, PREEMPT_LOCK_OFFSET);\ |
2777 | __cond_resched_lock(lock); \ | 2818 | __cond_resched_lock(lock); \ |
2778 | }) | 2819 | }) |
2779 | 2820 | ||
2780 | extern int __cond_resched_softirq(void); | 2821 | extern int __cond_resched_softirq(void); |
2781 | 2822 | ||
2782 | #define cond_resched_softirq() ({ \ | 2823 | #define cond_resched_softirq() ({ \ |
2783 | __might_sleep(__FILE__, __LINE__, SOFTIRQ_DISABLE_OFFSET); \ | 2824 | ___might_sleep(__FILE__, __LINE__, SOFTIRQ_DISABLE_OFFSET); \ |
2784 | __cond_resched_softirq(); \ | 2825 | __cond_resched_softirq(); \ |
2785 | }) | 2826 | }) |
2786 | 2827 | ||
diff --git a/include/linux/seq_buf.h b/include/linux/seq_buf.h new file mode 100644 index 000000000000..9aafe0e24c68 --- /dev/null +++ b/include/linux/seq_buf.h | |||
@@ -0,0 +1,136 @@ | |||
1 | #ifndef _LINUX_SEQ_BUF_H | ||
2 | #define _LINUX_SEQ_BUF_H | ||
3 | |||
4 | #include <linux/fs.h> | ||
5 | |||
6 | /* | ||
7 | * Trace sequences are used to allow a function to call several other functions | ||
8 | * to create a string of data to use. | ||
9 | */ | ||
10 | |||
11 | /** | ||
12 | * seq_buf - seq buffer structure | ||
13 | * @buffer: pointer to the buffer | ||
14 | * @size: size of the buffer | ||
15 | * @len: the amount of data inside the buffer | ||
16 | * @readpos: The next position to read in the buffer. | ||
17 | */ | ||
18 | struct seq_buf { | ||
19 | char *buffer; | ||
20 | size_t size; | ||
21 | size_t len; | ||
22 | loff_t readpos; | ||
23 | }; | ||
24 | |||
25 | static inline void seq_buf_clear(struct seq_buf *s) | ||
26 | { | ||
27 | s->len = 0; | ||
28 | s->readpos = 0; | ||
29 | } | ||
30 | |||
31 | static inline void | ||
32 | seq_buf_init(struct seq_buf *s, unsigned char *buf, unsigned int size) | ||
33 | { | ||
34 | s->buffer = buf; | ||
35 | s->size = size; | ||
36 | seq_buf_clear(s); | ||
37 | } | ||
38 | |||
39 | /* | ||
40 | * seq_buf have a buffer that might overflow. When this happens | ||
41 | * the len and size are set to be equal. | ||
42 | */ | ||
43 | static inline bool | ||
44 | seq_buf_has_overflowed(struct seq_buf *s) | ||
45 | { | ||
46 | return s->len > s->size; | ||
47 | } | ||
48 | |||
49 | static inline void | ||
50 | seq_buf_set_overflow(struct seq_buf *s) | ||
51 | { | ||
52 | s->len = s->size + 1; | ||
53 | } | ||
54 | |||
55 | /* | ||
56 | * How much buffer is left on the seq_buf? | ||
57 | */ | ||
58 | static inline unsigned int | ||
59 | seq_buf_buffer_left(struct seq_buf *s) | ||
60 | { | ||
61 | if (seq_buf_has_overflowed(s)) | ||
62 | return 0; | ||
63 | |||
64 | return s->size - s->len; | ||
65 | } | ||
66 | |||
67 | /* How much buffer was written? */ | ||
68 | static inline unsigned int seq_buf_used(struct seq_buf *s) | ||
69 | { | ||
70 | return min(s->len, s->size); | ||
71 | } | ||
72 | |||
73 | /** | ||
74 | * seq_buf_get_buf - get buffer to write arbitrary data to | ||
75 | * @s: the seq_buf handle | ||
76 | * @bufp: the beginning of the buffer is stored here | ||
77 | * | ||
78 | * Return the number of bytes available in the buffer, or zero if | ||
79 | * there's no space. | ||
80 | */ | ||
81 | static inline size_t seq_buf_get_buf(struct seq_buf *s, char **bufp) | ||
82 | { | ||
83 | WARN_ON(s->len > s->size + 1); | ||
84 | |||
85 | if (s->len < s->size) { | ||
86 | *bufp = s->buffer + s->len; | ||
87 | return s->size - s->len; | ||
88 | } | ||
89 | |||
90 | *bufp = NULL; | ||
91 | return 0; | ||
92 | } | ||
93 | |||
94 | /** | ||
95 | * seq_buf_commit - commit data to the buffer | ||
96 | * @s: the seq_buf handle | ||
97 | * @num: the number of bytes to commit | ||
98 | * | ||
99 | * Commit @num bytes of data written to a buffer previously acquired | ||
100 | * by seq_buf_get. To signal an error condition, or that the data | ||
101 | * didn't fit in the available space, pass a negative @num value. | ||
102 | */ | ||
103 | static inline void seq_buf_commit(struct seq_buf *s, int num) | ||
104 | { | ||
105 | if (num < 0) { | ||
106 | seq_buf_set_overflow(s); | ||
107 | } else { | ||
108 | /* num must be negative on overflow */ | ||
109 | BUG_ON(s->len + num > s->size); | ||
110 | s->len += num; | ||
111 | } | ||
112 | } | ||
113 | |||
114 | extern __printf(2, 3) | ||
115 | int seq_buf_printf(struct seq_buf *s, const char *fmt, ...); | ||
116 | extern __printf(2, 0) | ||
117 | int seq_buf_vprintf(struct seq_buf *s, const char *fmt, va_list args); | ||
118 | extern int seq_buf_print_seq(struct seq_file *m, struct seq_buf *s); | ||
119 | extern int seq_buf_to_user(struct seq_buf *s, char __user *ubuf, | ||
120 | int cnt); | ||
121 | extern int seq_buf_puts(struct seq_buf *s, const char *str); | ||
122 | extern int seq_buf_putc(struct seq_buf *s, unsigned char c); | ||
123 | extern int seq_buf_putmem(struct seq_buf *s, const void *mem, unsigned int len); | ||
124 | extern int seq_buf_putmem_hex(struct seq_buf *s, const void *mem, | ||
125 | unsigned int len); | ||
126 | extern int seq_buf_path(struct seq_buf *s, const struct path *path, const char *esc); | ||
127 | |||
128 | extern int seq_buf_bitmask(struct seq_buf *s, const unsigned long *maskp, | ||
129 | int nmaskbits); | ||
130 | |||
131 | #ifdef CONFIG_BINARY_PRINTF | ||
132 | extern int | ||
133 | seq_buf_bprintf(struct seq_buf *s, const char *fmt, const u32 *binary); | ||
134 | #endif | ||
135 | |||
136 | #endif /* _LINUX_SEQ_BUF_H */ | ||
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 52e0097f61f0..cf6a9daaaf6d 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
@@ -43,6 +43,21 @@ struct seq_operations { | |||
43 | #define SEQ_SKIP 1 | 43 | #define SEQ_SKIP 1 |
44 | 44 | ||
45 | /** | 45 | /** |
46 | * seq_has_overflowed - check if the buffer has overflowed | ||
47 | * @m: the seq_file handle | ||
48 | * | ||
49 | * seq_files have a buffer which may overflow. When this happens a larger | ||
50 | * buffer is reallocated and all the data will be printed again. | ||
51 | * The overflow state is true when m->count == m->size. | ||
52 | * | ||
53 | * Returns true if the buffer received more than it can hold. | ||
54 | */ | ||
55 | static inline bool seq_has_overflowed(struct seq_file *m) | ||
56 | { | ||
57 | return m->count == m->size; | ||
58 | } | ||
59 | |||
60 | /** | ||
46 | * seq_get_buf - get buffer to write arbitrary data to | 61 | * seq_get_buf - get buffer to write arbitrary data to |
47 | * @m: the seq_file handle | 62 | * @m: the seq_file handle |
48 | * @bufp: the beginning of the buffer is stored here | 63 | * @bufp: the beginning of the buffer is stored here |
diff --git a/include/linux/slab.h b/include/linux/slab.h index c265bec6a57d..8a2457d42fc8 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -513,10 +513,6 @@ struct memcg_cache_params { | |||
513 | 513 | ||
514 | int memcg_update_all_caches(int num_memcgs); | 514 | int memcg_update_all_caches(int num_memcgs); |
515 | 515 | ||
516 | struct seq_file; | ||
517 | int cache_show(struct kmem_cache *s, struct seq_file *m); | ||
518 | void print_slabinfo_header(struct seq_file *m); | ||
519 | |||
520 | /** | 516 | /** |
521 | * kmalloc_array - allocate memory for an array. | 517 | * kmalloc_array - allocate memory for an array. |
522 | * @n: number of elements. | 518 | * @n: number of elements. |
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index 8e030075fe79..a7cbb570cc5c 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
@@ -53,7 +53,7 @@ struct rpc_cred { | |||
53 | struct rcu_head cr_rcu; | 53 | struct rcu_head cr_rcu; |
54 | struct rpc_auth * cr_auth; | 54 | struct rpc_auth * cr_auth; |
55 | const struct rpc_credops *cr_ops; | 55 | const struct rpc_credops *cr_ops; |
56 | #ifdef RPC_DEBUG | 56 | #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) |
57 | unsigned long cr_magic; /* 0x0f4aa4f0 */ | 57 | unsigned long cr_magic; /* 0x0f4aa4f0 */ |
58 | #endif | 58 | #endif |
59 | unsigned long cr_expire; /* when to gc */ | 59 | unsigned long cr_expire; /* when to gc */ |
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 70736b98c721..d86acc63b25f 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
@@ -63,6 +63,9 @@ struct rpc_clnt { | |||
63 | struct rpc_rtt cl_rtt_default; | 63 | struct rpc_rtt cl_rtt_default; |
64 | struct rpc_timeout cl_timeout_default; | 64 | struct rpc_timeout cl_timeout_default; |
65 | const struct rpc_program *cl_program; | 65 | const struct rpc_program *cl_program; |
66 | #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) | ||
67 | struct dentry *cl_debugfs; /* debugfs directory */ | ||
68 | #endif | ||
66 | }; | 69 | }; |
67 | 70 | ||
68 | /* | 71 | /* |
@@ -176,5 +179,6 @@ size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); | |||
176 | const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); | 179 | const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); |
177 | int rpc_localaddr(struct rpc_clnt *, struct sockaddr *, size_t); | 180 | int rpc_localaddr(struct rpc_clnt *, struct sockaddr *, size_t); |
178 | 181 | ||
182 | const char *rpc_proc_name(const struct rpc_task *task); | ||
179 | #endif /* __KERNEL__ */ | 183 | #endif /* __KERNEL__ */ |
180 | #endif /* _LINUX_SUNRPC_CLNT_H */ | 184 | #endif /* _LINUX_SUNRPC_CLNT_H */ |
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h index 9385bd74c860..c57d8ea0716c 100644 --- a/include/linux/sunrpc/debug.h +++ b/include/linux/sunrpc/debug.h | |||
@@ -10,22 +10,10 @@ | |||
10 | 10 | ||
11 | #include <uapi/linux/sunrpc/debug.h> | 11 | #include <uapi/linux/sunrpc/debug.h> |
12 | 12 | ||
13 | |||
14 | /* | ||
15 | * Enable RPC debugging/profiling. | ||
16 | */ | ||
17 | #ifdef CONFIG_SUNRPC_DEBUG | ||
18 | #define RPC_DEBUG | ||
19 | #endif | ||
20 | #ifdef CONFIG_TRACEPOINTS | ||
21 | #define RPC_TRACEPOINTS | ||
22 | #endif | ||
23 | /* #define RPC_PROFILE */ | ||
24 | |||
25 | /* | 13 | /* |
26 | * Debugging macros etc | 14 | * Debugging macros etc |
27 | */ | 15 | */ |
28 | #ifdef RPC_DEBUG | 16 | #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) |
29 | extern unsigned int rpc_debug; | 17 | extern unsigned int rpc_debug; |
30 | extern unsigned int nfs_debug; | 18 | extern unsigned int nfs_debug; |
31 | extern unsigned int nfsd_debug; | 19 | extern unsigned int nfsd_debug; |
@@ -36,7 +24,7 @@ extern unsigned int nlm_debug; | |||
36 | #define dprintk_rcu(args...) dfprintk_rcu(FACILITY, ## args) | 24 | #define dprintk_rcu(args...) dfprintk_rcu(FACILITY, ## args) |
37 | 25 | ||
38 | #undef ifdebug | 26 | #undef ifdebug |
39 | #ifdef RPC_DEBUG | 27 | #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) |
40 | # define ifdebug(fac) if (unlikely(rpc_debug & RPCDBG_##fac)) | 28 | # define ifdebug(fac) if (unlikely(rpc_debug & RPCDBG_##fac)) |
41 | 29 | ||
42 | # define dfprintk(fac, args...) \ | 30 | # define dfprintk(fac, args...) \ |
@@ -65,9 +53,55 @@ extern unsigned int nlm_debug; | |||
65 | /* | 53 | /* |
66 | * Sysctl interface for RPC debugging | 54 | * Sysctl interface for RPC debugging |
67 | */ | 55 | */ |
68 | #ifdef RPC_DEBUG | 56 | |
57 | struct rpc_clnt; | ||
58 | struct rpc_xprt; | ||
59 | |||
60 | #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) | ||
69 | void rpc_register_sysctl(void); | 61 | void rpc_register_sysctl(void); |
70 | void rpc_unregister_sysctl(void); | 62 | void rpc_unregister_sysctl(void); |
63 | int sunrpc_debugfs_init(void); | ||
64 | void sunrpc_debugfs_exit(void); | ||
65 | int rpc_clnt_debugfs_register(struct rpc_clnt *); | ||
66 | void rpc_clnt_debugfs_unregister(struct rpc_clnt *); | ||
67 | int rpc_xprt_debugfs_register(struct rpc_xprt *); | ||
68 | void rpc_xprt_debugfs_unregister(struct rpc_xprt *); | ||
69 | #else | ||
70 | static inline int | ||
71 | sunrpc_debugfs_init(void) | ||
72 | { | ||
73 | return 0; | ||
74 | } | ||
75 | |||
76 | static inline void | ||
77 | sunrpc_debugfs_exit(void) | ||
78 | { | ||
79 | return; | ||
80 | } | ||
81 | |||
82 | static inline int | ||
83 | rpc_clnt_debugfs_register(struct rpc_clnt *clnt) | ||
84 | { | ||
85 | return 0; | ||
86 | } | ||
87 | |||
88 | static inline void | ||
89 | rpc_clnt_debugfs_unregister(struct rpc_clnt *clnt) | ||
90 | { | ||
91 | return; | ||
92 | } | ||
93 | |||
94 | static inline int | ||
95 | rpc_xprt_debugfs_register(struct rpc_xprt *xprt) | ||
96 | { | ||
97 | return 0; | ||
98 | } | ||
99 | |||
100 | static inline void | ||
101 | rpc_xprt_debugfs_unregister(struct rpc_xprt *xprt) | ||
102 | { | ||
103 | return; | ||
104 | } | ||
71 | #endif | 105 | #endif |
72 | 106 | ||
73 | #endif /* _LINUX_SUNRPC_DEBUG_H_ */ | 107 | #endif /* _LINUX_SUNRPC_DEBUG_H_ */ |
diff --git a/include/linux/sunrpc/metrics.h b/include/linux/sunrpc/metrics.h index 1565bbe86d51..eecb5a71e6c0 100644 --- a/include/linux/sunrpc/metrics.h +++ b/include/linux/sunrpc/metrics.h | |||
@@ -27,10 +27,13 @@ | |||
27 | 27 | ||
28 | #include <linux/seq_file.h> | 28 | #include <linux/seq_file.h> |
29 | #include <linux/ktime.h> | 29 | #include <linux/ktime.h> |
30 | #include <linux/spinlock.h> | ||
30 | 31 | ||
31 | #define RPC_IOSTATS_VERS "1.0" | 32 | #define RPC_IOSTATS_VERS "1.0" |
32 | 33 | ||
33 | struct rpc_iostats { | 34 | struct rpc_iostats { |
35 | spinlock_t om_lock; | ||
36 | |||
34 | /* | 37 | /* |
35 | * These counters give an idea about how many request | 38 | * These counters give an idea about how many request |
36 | * transmissions are required, on average, to complete that | 39 | * transmissions are required, on average, to complete that |
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 1a8959944c5f..5f1e6bd4c316 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
@@ -79,7 +79,7 @@ struct rpc_task { | |||
79 | unsigned short tk_flags; /* misc flags */ | 79 | unsigned short tk_flags; /* misc flags */ |
80 | unsigned short tk_timeouts; /* maj timeouts */ | 80 | unsigned short tk_timeouts; /* maj timeouts */ |
81 | 81 | ||
82 | #if defined(RPC_DEBUG) || defined(RPC_TRACEPOINTS) | 82 | #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) || IS_ENABLED(CONFIG_TRACEPOINTS) |
83 | unsigned short tk_pid; /* debugging aid */ | 83 | unsigned short tk_pid; /* debugging aid */ |
84 | #endif | 84 | #endif |
85 | unsigned char tk_priority : 2,/* Task priority */ | 85 | unsigned char tk_priority : 2,/* Task priority */ |
@@ -187,7 +187,7 @@ struct rpc_wait_queue { | |||
187 | unsigned char nr; /* # tasks remaining for cookie */ | 187 | unsigned char nr; /* # tasks remaining for cookie */ |
188 | unsigned short qlen; /* total # tasks waiting in queue */ | 188 | unsigned short qlen; /* total # tasks waiting in queue */ |
189 | struct rpc_timer timer_list; | 189 | struct rpc_timer timer_list; |
190 | #if defined(RPC_DEBUG) || defined(RPC_TRACEPOINTS) | 190 | #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) || IS_ENABLED(CONFIG_TRACEPOINTS) |
191 | const char * name; | 191 | const char * name; |
192 | #endif | 192 | #endif |
193 | }; | 193 | }; |
@@ -237,7 +237,7 @@ void rpc_free(void *); | |||
237 | int rpciod_up(void); | 237 | int rpciod_up(void); |
238 | void rpciod_down(void); | 238 | void rpciod_down(void); |
239 | int __rpc_wait_for_completion_task(struct rpc_task *task, wait_bit_action_f *); | 239 | int __rpc_wait_for_completion_task(struct rpc_task *task, wait_bit_action_f *); |
240 | #ifdef RPC_DEBUG | 240 | #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) |
241 | struct net; | 241 | struct net; |
242 | void rpc_show_tasks(struct net *); | 242 | void rpc_show_tasks(struct net *); |
243 | #endif | 243 | #endif |
@@ -251,7 +251,7 @@ static inline int rpc_wait_for_completion_task(struct rpc_task *task) | |||
251 | return __rpc_wait_for_completion_task(task, NULL); | 251 | return __rpc_wait_for_completion_task(task, NULL); |
252 | } | 252 | } |
253 | 253 | ||
254 | #if defined(RPC_DEBUG) || defined (RPC_TRACEPOINTS) | 254 | #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) || IS_ENABLED(CONFIG_TRACEPOINTS) |
255 | static inline const char * rpc_qname(const struct rpc_wait_queue *q) | 255 | static inline const char * rpc_qname(const struct rpc_wait_queue *q) |
256 | { | 256 | { |
257 | return ((q && q->name) ? q->name : "unknown"); | 257 | return ((q && q->name) ? q->name : "unknown"); |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index cf391eef2e6d..9d27ac45b909 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -239,6 +239,9 @@ struct rpc_xprt { | |||
239 | struct net *xprt_net; | 239 | struct net *xprt_net; |
240 | const char *servername; | 240 | const char *servername; |
241 | const char *address_strings[RPC_DISPLAY_MAX]; | 241 | const char *address_strings[RPC_DISPLAY_MAX]; |
242 | #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) | ||
243 | struct dentry *debugfs; /* debugfs directory */ | ||
244 | #endif | ||
242 | }; | 245 | }; |
243 | 246 | ||
244 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) | 247 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) |
diff --git a/include/linux/sunrpc/xprtsock.h b/include/linux/sunrpc/xprtsock.h index 1ad36cc25b2e..7591788e9fbf 100644 --- a/include/linux/sunrpc/xprtsock.h +++ b/include/linux/sunrpc/xprtsock.h | |||
@@ -17,6 +17,65 @@ void cleanup_socket_xprt(void); | |||
17 | #define RPC_DEF_MIN_RESVPORT (665U) | 17 | #define RPC_DEF_MIN_RESVPORT (665U) |
18 | #define RPC_DEF_MAX_RESVPORT (1023U) | 18 | #define RPC_DEF_MAX_RESVPORT (1023U) |
19 | 19 | ||
20 | struct sock_xprt { | ||
21 | struct rpc_xprt xprt; | ||
22 | |||
23 | /* | ||
24 | * Network layer | ||
25 | */ | ||
26 | struct socket * sock; | ||
27 | struct sock * inet; | ||
28 | |||
29 | /* | ||
30 | * State of TCP reply receive | ||
31 | */ | ||
32 | __be32 tcp_fraghdr, | ||
33 | tcp_xid, | ||
34 | tcp_calldir; | ||
35 | |||
36 | u32 tcp_offset, | ||
37 | tcp_reclen; | ||
38 | |||
39 | unsigned long tcp_copied, | ||
40 | tcp_flags; | ||
41 | |||
42 | /* | ||
43 | * Connection of transports | ||
44 | */ | ||
45 | struct delayed_work connect_worker; | ||
46 | struct sockaddr_storage srcaddr; | ||
47 | unsigned short srcport; | ||
48 | |||
49 | /* | ||
50 | * UDP socket buffer size parameters | ||
51 | */ | ||
52 | size_t rcvsize, | ||
53 | sndsize; | ||
54 | |||
55 | /* | ||
56 | * Saved socket callback addresses | ||
57 | */ | ||
58 | void (*old_data_ready)(struct sock *); | ||
59 | void (*old_state_change)(struct sock *); | ||
60 | void (*old_write_space)(struct sock *); | ||
61 | void (*old_error_report)(struct sock *); | ||
62 | }; | ||
63 | |||
64 | /* | ||
65 | * TCP receive state flags | ||
66 | */ | ||
67 | #define TCP_RCV_LAST_FRAG (1UL << 0) | ||
68 | #define TCP_RCV_COPY_FRAGHDR (1UL << 1) | ||
69 | #define TCP_RCV_COPY_XID (1UL << 2) | ||
70 | #define TCP_RCV_COPY_DATA (1UL << 3) | ||
71 | #define TCP_RCV_READ_CALLDIR (1UL << 4) | ||
72 | #define TCP_RCV_COPY_CALLDIR (1UL << 5) | ||
73 | |||
74 | /* | ||
75 | * TCP RPC flags | ||
76 | */ | ||
77 | #define TCP_RPC_REPLY (1UL << 6) | ||
78 | |||
20 | #endif /* __KERNEL__ */ | 79 | #endif /* __KERNEL__ */ |
21 | 80 | ||
22 | #endif /* _LINUX_SUNRPC_XPRTSOCK_H */ | 81 | #endif /* _LINUX_SUNRPC_XPRTSOCK_H */ |
diff --git a/include/linux/swap_cgroup.h b/include/linux/swap_cgroup.h new file mode 100644 index 000000000000..145306bdc92f --- /dev/null +++ b/include/linux/swap_cgroup.h | |||
@@ -0,0 +1,42 @@ | |||
1 | #ifndef __LINUX_SWAP_CGROUP_H | ||
2 | #define __LINUX_SWAP_CGROUP_H | ||
3 | |||
4 | #include <linux/swap.h> | ||
5 | |||
6 | #ifdef CONFIG_MEMCG_SWAP | ||
7 | |||
8 | extern unsigned short swap_cgroup_cmpxchg(swp_entry_t ent, | ||
9 | unsigned short old, unsigned short new); | ||
10 | extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id); | ||
11 | extern unsigned short lookup_swap_cgroup_id(swp_entry_t ent); | ||
12 | extern int swap_cgroup_swapon(int type, unsigned long max_pages); | ||
13 | extern void swap_cgroup_swapoff(int type); | ||
14 | |||
15 | #else | ||
16 | |||
17 | static inline | ||
18 | unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id) | ||
19 | { | ||
20 | return 0; | ||
21 | } | ||
22 | |||
23 | static inline | ||
24 | unsigned short lookup_swap_cgroup_id(swp_entry_t ent) | ||
25 | { | ||
26 | return 0; | ||
27 | } | ||
28 | |||
29 | static inline int | ||
30 | swap_cgroup_swapon(int type, unsigned long max_pages) | ||
31 | { | ||
32 | return 0; | ||
33 | } | ||
34 | |||
35 | static inline void swap_cgroup_swapoff(int type) | ||
36 | { | ||
37 | return; | ||
38 | } | ||
39 | |||
40 | #endif /* CONFIG_MEMCG_SWAP */ | ||
41 | |||
42 | #endif /* __LINUX_SWAP_CGROUP_H */ | ||
diff --git a/include/linux/syslog.h b/include/linux/syslog.h index 98a3153c0f96..4b7b875a7ce1 100644 --- a/include/linux/syslog.h +++ b/include/linux/syslog.h | |||
@@ -49,4 +49,13 @@ | |||
49 | 49 | ||
50 | int do_syslog(int type, char __user *buf, int count, bool from_file); | 50 | int do_syslog(int type, char __user *buf, int count, bool from_file); |
51 | 51 | ||
52 | #ifdef CONFIG_PRINTK | ||
53 | int check_syslog_permissions(int type, bool from_file); | ||
54 | #else | ||
55 | static inline int check_syslog_permissions(int type, bool from_file) | ||
56 | { | ||
57 | return 0; | ||
58 | } | ||
59 | #endif | ||
60 | |||
52 | #endif /* _LINUX_SYSLOG_H */ | 61 | #endif /* _LINUX_SYSLOG_H */ |
diff --git a/include/linux/time.h b/include/linux/time.h index 8c42cf8d2444..203c2ad40d71 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -39,9 +39,20 @@ static inline int timeval_compare(const struct timeval *lhs, const struct timeva | |||
39 | return lhs->tv_usec - rhs->tv_usec; | 39 | return lhs->tv_usec - rhs->tv_usec; |
40 | } | 40 | } |
41 | 41 | ||
42 | extern unsigned long mktime(const unsigned int year, const unsigned int mon, | 42 | extern time64_t mktime64(const unsigned int year, const unsigned int mon, |
43 | const unsigned int day, const unsigned int hour, | 43 | const unsigned int day, const unsigned int hour, |
44 | const unsigned int min, const unsigned int sec); | 44 | const unsigned int min, const unsigned int sec); |
45 | |||
46 | /** | ||
47 | * Deprecated. Use mktime64(). | ||
48 | */ | ||
49 | static inline unsigned long mktime(const unsigned int year, | ||
50 | const unsigned int mon, const unsigned int day, | ||
51 | const unsigned int hour, const unsigned int min, | ||
52 | const unsigned int sec) | ||
53 | { | ||
54 | return mktime64(year, mon, day, hour, min, sec); | ||
55 | } | ||
45 | 56 | ||
46 | extern void set_normalized_timespec(struct timespec *ts, time_t sec, s64 nsec); | 57 | extern void set_normalized_timespec(struct timespec *ts, time_t sec, s64 nsec); |
47 | 58 | ||
diff --git a/include/linux/timekeeper_internal.h b/include/linux/timekeeper_internal.h index 95640dcd1899..05af9a334893 100644 --- a/include/linux/timekeeper_internal.h +++ b/include/linux/timekeeper_internal.h | |||
@@ -42,6 +42,7 @@ struct tk_read_base { | |||
42 | * struct timekeeper - Structure holding internal timekeeping values. | 42 | * struct timekeeper - Structure holding internal timekeeping values. |
43 | * @tkr: The readout base structure | 43 | * @tkr: The readout base structure |
44 | * @xtime_sec: Current CLOCK_REALTIME time in seconds | 44 | * @xtime_sec: Current CLOCK_REALTIME time in seconds |
45 | * @ktime_sec: Current CLOCK_MONOTONIC time in seconds | ||
45 | * @wall_to_monotonic: CLOCK_REALTIME to CLOCK_MONOTONIC offset | 46 | * @wall_to_monotonic: CLOCK_REALTIME to CLOCK_MONOTONIC offset |
46 | * @offs_real: Offset clock monotonic -> clock realtime | 47 | * @offs_real: Offset clock monotonic -> clock realtime |
47 | * @offs_boot: Offset clock monotonic -> clock boottime | 48 | * @offs_boot: Offset clock monotonic -> clock boottime |
@@ -77,6 +78,7 @@ struct tk_read_base { | |||
77 | struct timekeeper { | 78 | struct timekeeper { |
78 | struct tk_read_base tkr; | 79 | struct tk_read_base tkr; |
79 | u64 xtime_sec; | 80 | u64 xtime_sec; |
81 | unsigned long ktime_sec; | ||
80 | struct timespec64 wall_to_monotonic; | 82 | struct timespec64 wall_to_monotonic; |
81 | ktime_t offs_real; | 83 | ktime_t offs_real; |
82 | ktime_t offs_boot; | 84 | ktime_t offs_boot; |
diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h index 1caa6b04fdc5..9b63d13ba82b 100644 --- a/include/linux/timekeeping.h +++ b/include/linux/timekeeping.h | |||
@@ -10,7 +10,7 @@ extern int timekeeping_suspended; | |||
10 | * Get and set timeofday | 10 | * Get and set timeofday |
11 | */ | 11 | */ |
12 | extern void do_gettimeofday(struct timeval *tv); | 12 | extern void do_gettimeofday(struct timeval *tv); |
13 | extern int do_settimeofday(const struct timespec *tv); | 13 | extern int do_settimeofday64(const struct timespec64 *ts); |
14 | extern int do_sys_settimeofday(const struct timespec *tv, | 14 | extern int do_sys_settimeofday(const struct timespec *tv, |
15 | const struct timezone *tz); | 15 | const struct timezone *tz); |
16 | 16 | ||
@@ -25,14 +25,24 @@ struct timespec __current_kernel_time(void); | |||
25 | /* | 25 | /* |
26 | * timespec based interfaces | 26 | * timespec based interfaces |
27 | */ | 27 | */ |
28 | struct timespec get_monotonic_coarse(void); | 28 | struct timespec64 get_monotonic_coarse64(void); |
29 | extern void getrawmonotonic(struct timespec *ts); | 29 | extern void getrawmonotonic64(struct timespec64 *ts); |
30 | extern void ktime_get_ts64(struct timespec64 *ts); | 30 | extern void ktime_get_ts64(struct timespec64 *ts); |
31 | extern time64_t ktime_get_seconds(void); | ||
32 | extern time64_t ktime_get_real_seconds(void); | ||
31 | 33 | ||
32 | extern int __getnstimeofday64(struct timespec64 *tv); | 34 | extern int __getnstimeofday64(struct timespec64 *tv); |
33 | extern void getnstimeofday64(struct timespec64 *tv); | 35 | extern void getnstimeofday64(struct timespec64 *tv); |
34 | 36 | ||
35 | #if BITS_PER_LONG == 64 | 37 | #if BITS_PER_LONG == 64 |
38 | /** | ||
39 | * Deprecated. Use do_settimeofday64(). | ||
40 | */ | ||
41 | static inline int do_settimeofday(const struct timespec *ts) | ||
42 | { | ||
43 | return do_settimeofday64(ts); | ||
44 | } | ||
45 | |||
36 | static inline int __getnstimeofday(struct timespec *ts) | 46 | static inline int __getnstimeofday(struct timespec *ts) |
37 | { | 47 | { |
38 | return __getnstimeofday64(ts); | 48 | return __getnstimeofday64(ts); |
@@ -53,7 +63,27 @@ static inline void ktime_get_real_ts(struct timespec *ts) | |||
53 | getnstimeofday64(ts); | 63 | getnstimeofday64(ts); |
54 | } | 64 | } |
55 | 65 | ||
66 | static inline void getrawmonotonic(struct timespec *ts) | ||
67 | { | ||
68 | getrawmonotonic64(ts); | ||
69 | } | ||
70 | |||
71 | static inline struct timespec get_monotonic_coarse(void) | ||
72 | { | ||
73 | return get_monotonic_coarse64(); | ||
74 | } | ||
56 | #else | 75 | #else |
76 | /** | ||
77 | * Deprecated. Use do_settimeofday64(). | ||
78 | */ | ||
79 | static inline int do_settimeofday(const struct timespec *ts) | ||
80 | { | ||
81 | struct timespec64 ts64; | ||
82 | |||
83 | ts64 = timespec_to_timespec64(*ts); | ||
84 | return do_settimeofday64(&ts64); | ||
85 | } | ||
86 | |||
57 | static inline int __getnstimeofday(struct timespec *ts) | 87 | static inline int __getnstimeofday(struct timespec *ts) |
58 | { | 88 | { |
59 | struct timespec64 ts64; | 89 | struct timespec64 ts64; |
@@ -86,6 +116,19 @@ static inline void ktime_get_real_ts(struct timespec *ts) | |||
86 | getnstimeofday64(&ts64); | 116 | getnstimeofday64(&ts64); |
87 | *ts = timespec64_to_timespec(ts64); | 117 | *ts = timespec64_to_timespec(ts64); |
88 | } | 118 | } |
119 | |||
120 | static inline void getrawmonotonic(struct timespec *ts) | ||
121 | { | ||
122 | struct timespec64 ts64; | ||
123 | |||
124 | getrawmonotonic64(&ts64); | ||
125 | *ts = timespec64_to_timespec(ts64); | ||
126 | } | ||
127 | |||
128 | static inline struct timespec get_monotonic_coarse(void) | ||
129 | { | ||
130 | return timespec64_to_timespec(get_monotonic_coarse64()); | ||
131 | } | ||
89 | #endif | 132 | #endif |
90 | 133 | ||
91 | extern void getboottime(struct timespec *ts); | 134 | extern void getboottime(struct timespec *ts); |
@@ -182,7 +225,7 @@ static inline void timekeeping_clocktai(struct timespec *ts) | |||
182 | /* | 225 | /* |
183 | * RTC specific | 226 | * RTC specific |
184 | */ | 227 | */ |
185 | extern void timekeeping_inject_sleeptime(struct timespec *delta); | 228 | extern void timekeeping_inject_sleeptime64(struct timespec64 *delta); |
186 | 229 | ||
187 | /* | 230 | /* |
188 | * PPS accessor | 231 | * PPS accessor |
diff --git a/include/linux/trace_seq.h b/include/linux/trace_seq.h index ea6c9dea79e3..cfaf5a1d4bad 100644 --- a/include/linux/trace_seq.h +++ b/include/linux/trace_seq.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef _LINUX_TRACE_SEQ_H | 1 | #ifndef _LINUX_TRACE_SEQ_H |
2 | #define _LINUX_TRACE_SEQ_H | 2 | #define _LINUX_TRACE_SEQ_H |
3 | 3 | ||
4 | #include <linux/fs.h> | 4 | #include <linux/seq_buf.h> |
5 | 5 | ||
6 | #include <asm/page.h> | 6 | #include <asm/page.h> |
7 | 7 | ||
@@ -12,20 +12,36 @@ | |||
12 | 12 | ||
13 | struct trace_seq { | 13 | struct trace_seq { |
14 | unsigned char buffer[PAGE_SIZE]; | 14 | unsigned char buffer[PAGE_SIZE]; |
15 | unsigned int len; | 15 | struct seq_buf seq; |
16 | unsigned int readpos; | ||
17 | int full; | 16 | int full; |
18 | }; | 17 | }; |
19 | 18 | ||
20 | static inline void | 19 | static inline void |
21 | trace_seq_init(struct trace_seq *s) | 20 | trace_seq_init(struct trace_seq *s) |
22 | { | 21 | { |
23 | s->len = 0; | 22 | seq_buf_init(&s->seq, s->buffer, PAGE_SIZE); |
24 | s->readpos = 0; | ||
25 | s->full = 0; | 23 | s->full = 0; |
26 | } | 24 | } |
27 | 25 | ||
28 | /** | 26 | /** |
27 | * trace_seq_used - amount of actual data written to buffer | ||
28 | * @s: trace sequence descriptor | ||
29 | * | ||
30 | * Returns the amount of data written to the buffer. | ||
31 | * | ||
32 | * IMPORTANT! | ||
33 | * | ||
34 | * Use this instead of @s->seq.len if you need to pass the amount | ||
35 | * of data from the buffer to another buffer (userspace, or what not). | ||
36 | * The @s->seq.len on overflow is bigger than the buffer size and | ||
37 | * using it can cause access to undefined memory. | ||
38 | */ | ||
39 | static inline int trace_seq_used(struct trace_seq *s) | ||
40 | { | ||
41 | return seq_buf_used(&s->seq); | ||
42 | } | ||
43 | |||
44 | /** | ||
29 | * trace_seq_buffer_ptr - return pointer to next location in buffer | 45 | * trace_seq_buffer_ptr - return pointer to next location in buffer |
30 | * @s: trace sequence descriptor | 46 | * @s: trace sequence descriptor |
31 | * | 47 | * |
@@ -37,7 +53,19 @@ trace_seq_init(struct trace_seq *s) | |||
37 | static inline unsigned char * | 53 | static inline unsigned char * |
38 | trace_seq_buffer_ptr(struct trace_seq *s) | 54 | trace_seq_buffer_ptr(struct trace_seq *s) |
39 | { | 55 | { |
40 | return s->buffer + s->len; | 56 | return s->buffer + seq_buf_used(&s->seq); |
57 | } | ||
58 | |||
59 | /** | ||
60 | * trace_seq_has_overflowed - return true if the trace_seq took too much | ||
61 | * @s: trace sequence descriptor | ||
62 | * | ||
63 | * Returns true if too much data was added to the trace_seq and it is | ||
64 | * now full and will not take anymore. | ||
65 | */ | ||
66 | static inline bool trace_seq_has_overflowed(struct trace_seq *s) | ||
67 | { | ||
68 | return s->full || seq_buf_has_overflowed(&s->seq); | ||
41 | } | 69 | } |
42 | 70 | ||
43 | /* | 71 | /* |
@@ -45,40 +73,37 @@ trace_seq_buffer_ptr(struct trace_seq *s) | |||
45 | */ | 73 | */ |
46 | #ifdef CONFIG_TRACING | 74 | #ifdef CONFIG_TRACING |
47 | extern __printf(2, 3) | 75 | extern __printf(2, 3) |
48 | int trace_seq_printf(struct trace_seq *s, const char *fmt, ...); | 76 | void trace_seq_printf(struct trace_seq *s, const char *fmt, ...); |
49 | extern __printf(2, 0) | 77 | extern __printf(2, 0) |
50 | int trace_seq_vprintf(struct trace_seq *s, const char *fmt, va_list args); | 78 | void trace_seq_vprintf(struct trace_seq *s, const char *fmt, va_list args); |
51 | extern int | 79 | extern void |
52 | trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary); | 80 | trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary); |
53 | extern int trace_print_seq(struct seq_file *m, struct trace_seq *s); | 81 | extern int trace_print_seq(struct seq_file *m, struct trace_seq *s); |
54 | extern int trace_seq_to_user(struct trace_seq *s, char __user *ubuf, | 82 | extern int trace_seq_to_user(struct trace_seq *s, char __user *ubuf, |
55 | int cnt); | 83 | int cnt); |
56 | extern int trace_seq_puts(struct trace_seq *s, const char *str); | 84 | extern void trace_seq_puts(struct trace_seq *s, const char *str); |
57 | extern int trace_seq_putc(struct trace_seq *s, unsigned char c); | 85 | extern void trace_seq_putc(struct trace_seq *s, unsigned char c); |
58 | extern int trace_seq_putmem(struct trace_seq *s, const void *mem, unsigned int len); | 86 | extern void trace_seq_putmem(struct trace_seq *s, const void *mem, unsigned int len); |
59 | extern int trace_seq_putmem_hex(struct trace_seq *s, const void *mem, | 87 | extern void trace_seq_putmem_hex(struct trace_seq *s, const void *mem, |
60 | unsigned int len); | 88 | unsigned int len); |
61 | extern int trace_seq_path(struct trace_seq *s, const struct path *path); | 89 | extern int trace_seq_path(struct trace_seq *s, const struct path *path); |
62 | 90 | ||
63 | extern int trace_seq_bitmask(struct trace_seq *s, const unsigned long *maskp, | 91 | extern void trace_seq_bitmask(struct trace_seq *s, const unsigned long *maskp, |
64 | int nmaskbits); | 92 | int nmaskbits); |
65 | 93 | ||
66 | #else /* CONFIG_TRACING */ | 94 | #else /* CONFIG_TRACING */ |
67 | static inline int trace_seq_printf(struct trace_seq *s, const char *fmt, ...) | 95 | static inline void trace_seq_printf(struct trace_seq *s, const char *fmt, ...) |
68 | { | 96 | { |
69 | return 0; | ||
70 | } | 97 | } |
71 | static inline int | 98 | static inline void |
72 | trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary) | 99 | trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary) |
73 | { | 100 | { |
74 | return 0; | ||
75 | } | 101 | } |
76 | 102 | ||
77 | static inline int | 103 | static inline void |
78 | trace_seq_bitmask(struct trace_seq *s, const unsigned long *maskp, | 104 | trace_seq_bitmask(struct trace_seq *s, const unsigned long *maskp, |
79 | int nmaskbits) | 105 | int nmaskbits) |
80 | { | 106 | { |
81 | return 0; | ||
82 | } | 107 | } |
83 | 108 | ||
84 | static inline int trace_print_seq(struct seq_file *m, struct trace_seq *s) | 109 | static inline int trace_print_seq(struct seq_file *m, struct trace_seq *s) |
@@ -90,23 +115,19 @@ static inline int trace_seq_to_user(struct trace_seq *s, char __user *ubuf, | |||
90 | { | 115 | { |
91 | return 0; | 116 | return 0; |
92 | } | 117 | } |
93 | static inline int trace_seq_puts(struct trace_seq *s, const char *str) | 118 | static inline void trace_seq_puts(struct trace_seq *s, const char *str) |
94 | { | 119 | { |
95 | return 0; | ||
96 | } | 120 | } |
97 | static inline int trace_seq_putc(struct trace_seq *s, unsigned char c) | 121 | static inline void trace_seq_putc(struct trace_seq *s, unsigned char c) |
98 | { | 122 | { |
99 | return 0; | ||
100 | } | 123 | } |
101 | static inline int | 124 | static inline void |
102 | trace_seq_putmem(struct trace_seq *s, const void *mem, unsigned int len) | 125 | trace_seq_putmem(struct trace_seq *s, const void *mem, unsigned int len) |
103 | { | 126 | { |
104 | return 0; | ||
105 | } | 127 | } |
106 | static inline int trace_seq_putmem_hex(struct trace_seq *s, const void *mem, | 128 | static inline void trace_seq_putmem_hex(struct trace_seq *s, const void *mem, |
107 | unsigned int len) | 129 | unsigned int len) |
108 | { | 130 | { |
109 | return 0; | ||
110 | } | 131 | } |
111 | static inline int trace_seq_path(struct trace_seq *s, const struct path *path) | 132 | static inline int trace_seq_path(struct trace_seq *s, const struct path *path) |
112 | { | 133 | { |
diff --git a/include/linux/uio.h b/include/linux/uio.h index 9b1581414cd4..bd8569a14c4a 100644 --- a/include/linux/uio.h +++ b/include/linux/uio.h | |||
@@ -31,6 +31,7 @@ struct iov_iter { | |||
31 | size_t count; | 31 | size_t count; |
32 | union { | 32 | union { |
33 | const struct iovec *iov; | 33 | const struct iovec *iov; |
34 | const struct kvec *kvec; | ||
34 | const struct bio_vec *bvec; | 35 | const struct bio_vec *bvec; |
35 | }; | 36 | }; |
36 | unsigned long nr_segs; | 37 | unsigned long nr_segs; |
@@ -82,10 +83,13 @@ size_t copy_page_from_iter(struct page *page, size_t offset, size_t bytes, | |||
82 | struct iov_iter *i); | 83 | struct iov_iter *i); |
83 | size_t copy_to_iter(void *addr, size_t bytes, struct iov_iter *i); | 84 | size_t copy_to_iter(void *addr, size_t bytes, struct iov_iter *i); |
84 | size_t copy_from_iter(void *addr, size_t bytes, struct iov_iter *i); | 85 | size_t copy_from_iter(void *addr, size_t bytes, struct iov_iter *i); |
86 | size_t copy_from_iter_nocache(void *addr, size_t bytes, struct iov_iter *i); | ||
85 | size_t iov_iter_zero(size_t bytes, struct iov_iter *); | 87 | size_t iov_iter_zero(size_t bytes, struct iov_iter *); |
86 | unsigned long iov_iter_alignment(const struct iov_iter *i); | 88 | unsigned long iov_iter_alignment(const struct iov_iter *i); |
87 | void iov_iter_init(struct iov_iter *i, int direction, const struct iovec *iov, | 89 | void iov_iter_init(struct iov_iter *i, int direction, const struct iovec *iov, |
88 | unsigned long nr_segs, size_t count); | 90 | unsigned long nr_segs, size_t count); |
91 | void iov_iter_kvec(struct iov_iter *i, int direction, const struct kvec *iov, | ||
92 | unsigned long nr_segs, size_t count); | ||
89 | ssize_t iov_iter_get_pages(struct iov_iter *i, struct page **pages, | 93 | ssize_t iov_iter_get_pages(struct iov_iter *i, struct page **pages, |
90 | size_t maxsize, unsigned maxpages, size_t *start); | 94 | size_t maxsize, unsigned maxpages, size_t *start); |
91 | ssize_t iov_iter_get_pages_alloc(struct iov_iter *i, struct page ***pages, | 95 | ssize_t iov_iter_get_pages_alloc(struct iov_iter *i, struct page ***pages, |
@@ -123,6 +127,8 @@ static inline void iov_iter_reexpand(struct iov_iter *i, size_t count) | |||
123 | { | 127 | { |
124 | i->count = count; | 128 | i->count = count; |
125 | } | 129 | } |
130 | size_t csum_and_copy_to_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i); | ||
131 | size_t csum_and_copy_from_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i); | ||
126 | 132 | ||
127 | int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len); | 133 | int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len); |
128 | int memcpy_toiovec(struct iovec *iov, unsigned char *kdata, int len); | 134 | int memcpy_toiovec(struct iovec *iov, unsigned char *kdata, int len); |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 447a7e2fc19b..f89c24a03bd9 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -637,7 +637,7 @@ static inline bool usb_acpi_power_manageable(struct usb_device *hdev, int index) | |||
637 | #endif | 637 | #endif |
638 | 638 | ||
639 | /* USB autosuspend and autoresume */ | 639 | /* USB autosuspend and autoresume */ |
640 | #ifdef CONFIG_PM_RUNTIME | 640 | #ifdef CONFIG_PM |
641 | extern void usb_enable_autosuspend(struct usb_device *udev); | 641 | extern void usb_enable_autosuspend(struct usb_device *udev); |
642 | extern void usb_disable_autosuspend(struct usb_device *udev); | 642 | extern void usb_disable_autosuspend(struct usb_device *udev); |
643 | 643 | ||
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index cd96a2bc3388..668898e29d0e 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
@@ -93,7 +93,7 @@ struct usb_hcd { | |||
93 | 93 | ||
94 | struct timer_list rh_timer; /* drives root-hub polling */ | 94 | struct timer_list rh_timer; /* drives root-hub polling */ |
95 | struct urb *status_urb; /* the current status urb */ | 95 | struct urb *status_urb; /* the current status urb */ |
96 | #ifdef CONFIG_PM_RUNTIME | 96 | #ifdef CONFIG_PM |
97 | struct work_struct wakeup_work; /* for remote wakeup */ | 97 | struct work_struct wakeup_work; /* for remote wakeup */ |
98 | #endif | 98 | #endif |
99 | 99 | ||
@@ -625,16 +625,13 @@ extern int usb_find_interface_driver(struct usb_device *dev, | |||
625 | extern void usb_root_hub_lost_power(struct usb_device *rhdev); | 625 | extern void usb_root_hub_lost_power(struct usb_device *rhdev); |
626 | extern int hcd_bus_suspend(struct usb_device *rhdev, pm_message_t msg); | 626 | extern int hcd_bus_suspend(struct usb_device *rhdev, pm_message_t msg); |
627 | extern int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg); | 627 | extern int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg); |
628 | #endif /* CONFIG_PM */ | ||
629 | |||
630 | #ifdef CONFIG_PM_RUNTIME | ||
631 | extern void usb_hcd_resume_root_hub(struct usb_hcd *hcd); | 628 | extern void usb_hcd_resume_root_hub(struct usb_hcd *hcd); |
632 | #else | 629 | #else |
633 | static inline void usb_hcd_resume_root_hub(struct usb_hcd *hcd) | 630 | static inline void usb_hcd_resume_root_hub(struct usb_hcd *hcd) |
634 | { | 631 | { |
635 | return; | 632 | return; |
636 | } | 633 | } |
637 | #endif /* CONFIG_PM_RUNTIME */ | 634 | #endif /* CONFIG_PM */ |
638 | 635 | ||
639 | /*-------------------------------------------------------------------------*/ | 636 | /*-------------------------------------------------------------------------*/ |
640 | 637 | ||
diff --git a/include/linux/vexpress.h b/include/linux/vexpress.h index a4c9547aae64..f8e76e08ebe4 100644 --- a/include/linux/vexpress.h +++ b/include/linux/vexpress.h | |||
@@ -15,8 +15,6 @@ | |||
15 | #define _LINUX_VEXPRESS_H | 15 | #define _LINUX_VEXPRESS_H |
16 | 16 | ||
17 | #include <linux/device.h> | 17 | #include <linux/device.h> |
18 | #include <linux/platform_device.h> | ||
19 | #include <linux/reboot.h> | ||
20 | #include <linux/regmap.h> | 18 | #include <linux/regmap.h> |
21 | 19 | ||
22 | #define VEXPRESS_SITE_MB 0 | 20 | #define VEXPRESS_SITE_MB 0 |
@@ -24,13 +22,6 @@ | |||
24 | #define VEXPRESS_SITE_DB2 2 | 22 | #define VEXPRESS_SITE_DB2 2 |
25 | #define VEXPRESS_SITE_MASTER 0xf | 23 | #define VEXPRESS_SITE_MASTER 0xf |
26 | 24 | ||
27 | #define VEXPRESS_RES_FUNC(_site, _func) \ | ||
28 | { \ | ||
29 | .start = (_site), \ | ||
30 | .end = (_func), \ | ||
31 | .flags = IORESOURCE_BUS, \ | ||
32 | } | ||
33 | |||
34 | /* Config infrastructure */ | 25 | /* Config infrastructure */ |
35 | 26 | ||
36 | void vexpress_config_set_master(u32 site); | 27 | void vexpress_config_set_master(u32 site); |
@@ -58,16 +49,6 @@ struct regmap *devm_regmap_init_vexpress_config(struct device *dev); | |||
58 | 49 | ||
59 | /* Platform control */ | 50 | /* Platform control */ |
60 | 51 | ||
61 | unsigned int vexpress_get_mci_cardin(struct device *dev); | ||
62 | u32 vexpress_get_procid(int site); | ||
63 | void *vexpress_get_24mhz_clock_base(void); | ||
64 | void vexpress_flags_set(u32 data); | 52 | void vexpress_flags_set(u32 data); |
65 | 53 | ||
66 | void vexpress_sysreg_early_init(void __iomem *base); | ||
67 | int vexpress_syscfg_device_register(struct platform_device *pdev); | ||
68 | |||
69 | /* Clocks */ | ||
70 | |||
71 | void vexpress_clk_init(void __iomem *sp810_base); | ||
72 | |||
73 | #endif | 54 | #endif |
diff --git a/include/linux/wait.h b/include/linux/wait.h index e4a8eb9312ea..2232ed16635a 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
@@ -13,9 +13,12 @@ typedef struct __wait_queue wait_queue_t; | |||
13 | typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int flags, void *key); | 13 | typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int flags, void *key); |
14 | int default_wake_function(wait_queue_t *wait, unsigned mode, int flags, void *key); | 14 | int default_wake_function(wait_queue_t *wait, unsigned mode, int flags, void *key); |
15 | 15 | ||
16 | /* __wait_queue::flags */ | ||
17 | #define WQ_FLAG_EXCLUSIVE 0x01 | ||
18 | #define WQ_FLAG_WOKEN 0x02 | ||
19 | |||
16 | struct __wait_queue { | 20 | struct __wait_queue { |
17 | unsigned int flags; | 21 | unsigned int flags; |
18 | #define WQ_FLAG_EXCLUSIVE 0x01 | ||
19 | void *private; | 22 | void *private; |
20 | wait_queue_func_t func; | 23 | wait_queue_func_t func; |
21 | struct list_head task_list; | 24 | struct list_head task_list; |
@@ -258,11 +261,37 @@ __out: __ret; \ | |||
258 | */ | 261 | */ |
259 | #define wait_event(wq, condition) \ | 262 | #define wait_event(wq, condition) \ |
260 | do { \ | 263 | do { \ |
264 | might_sleep(); \ | ||
261 | if (condition) \ | 265 | if (condition) \ |
262 | break; \ | 266 | break; \ |
263 | __wait_event(wq, condition); \ | 267 | __wait_event(wq, condition); \ |
264 | } while (0) | 268 | } while (0) |
265 | 269 | ||
270 | #define __wait_event_freezable(wq, condition) \ | ||
271 | ___wait_event(wq, condition, TASK_INTERRUPTIBLE, 0, 0, \ | ||
272 | schedule(); try_to_freeze()) | ||
273 | |||
274 | /** | ||
275 | * wait_event - sleep (or freeze) until a condition gets true | ||
276 | * @wq: the waitqueue to wait on | ||
277 | * @condition: a C expression for the event to wait for | ||
278 | * | ||
279 | * The process is put to sleep (TASK_INTERRUPTIBLE -- so as not to contribute | ||
280 | * to system load) until the @condition evaluates to true. The | ||
281 | * @condition is checked each time the waitqueue @wq is woken up. | ||
282 | * | ||
283 | * wake_up() has to be called after changing any variable that could | ||
284 | * change the result of the wait condition. | ||
285 | */ | ||
286 | #define wait_event_freezable(wq, condition) \ | ||
287 | ({ \ | ||
288 | int __ret = 0; \ | ||
289 | might_sleep(); \ | ||
290 | if (!(condition)) \ | ||
291 | __ret = __wait_event_freezable(wq, condition); \ | ||
292 | __ret; \ | ||
293 | }) | ||
294 | |||
266 | #define __wait_event_timeout(wq, condition, timeout) \ | 295 | #define __wait_event_timeout(wq, condition, timeout) \ |
267 | ___wait_event(wq, ___wait_cond_timeout(condition), \ | 296 | ___wait_event(wq, ___wait_cond_timeout(condition), \ |
268 | TASK_UNINTERRUPTIBLE, 0, timeout, \ | 297 | TASK_UNINTERRUPTIBLE, 0, timeout, \ |
@@ -290,11 +319,30 @@ do { \ | |||
290 | #define wait_event_timeout(wq, condition, timeout) \ | 319 | #define wait_event_timeout(wq, condition, timeout) \ |
291 | ({ \ | 320 | ({ \ |
292 | long __ret = timeout; \ | 321 | long __ret = timeout; \ |
322 | might_sleep(); \ | ||
293 | if (!___wait_cond_timeout(condition)) \ | 323 | if (!___wait_cond_timeout(condition)) \ |
294 | __ret = __wait_event_timeout(wq, condition, timeout); \ | 324 | __ret = __wait_event_timeout(wq, condition, timeout); \ |
295 | __ret; \ | 325 | __ret; \ |
296 | }) | 326 | }) |
297 | 327 | ||
328 | #define __wait_event_freezable_timeout(wq, condition, timeout) \ | ||
329 | ___wait_event(wq, ___wait_cond_timeout(condition), \ | ||
330 | TASK_INTERRUPTIBLE, 0, timeout, \ | ||
331 | __ret = schedule_timeout(__ret); try_to_freeze()) | ||
332 | |||
333 | /* | ||
334 | * like wait_event_timeout() -- except it uses TASK_INTERRUPTIBLE to avoid | ||
335 | * increasing load and is freezable. | ||
336 | */ | ||
337 | #define wait_event_freezable_timeout(wq, condition, timeout) \ | ||
338 | ({ \ | ||
339 | long __ret = timeout; \ | ||
340 | might_sleep(); \ | ||
341 | if (!___wait_cond_timeout(condition)) \ | ||
342 | __ret = __wait_event_freezable_timeout(wq, condition, timeout); \ | ||
343 | __ret; \ | ||
344 | }) | ||
345 | |||
298 | #define __wait_event_cmd(wq, condition, cmd1, cmd2) \ | 346 | #define __wait_event_cmd(wq, condition, cmd1, cmd2) \ |
299 | (void)___wait_event(wq, condition, TASK_UNINTERRUPTIBLE, 0, 0, \ | 347 | (void)___wait_event(wq, condition, TASK_UNINTERRUPTIBLE, 0, 0, \ |
300 | cmd1; schedule(); cmd2) | 348 | cmd1; schedule(); cmd2) |
@@ -315,6 +363,7 @@ do { \ | |||
315 | */ | 363 | */ |
316 | #define wait_event_cmd(wq, condition, cmd1, cmd2) \ | 364 | #define wait_event_cmd(wq, condition, cmd1, cmd2) \ |
317 | do { \ | 365 | do { \ |
366 | might_sleep(); \ | ||
318 | if (condition) \ | 367 | if (condition) \ |
319 | break; \ | 368 | break; \ |
320 | __wait_event_cmd(wq, condition, cmd1, cmd2); \ | 369 | __wait_event_cmd(wq, condition, cmd1, cmd2); \ |
@@ -342,6 +391,7 @@ do { \ | |||
342 | #define wait_event_interruptible(wq, condition) \ | 391 | #define wait_event_interruptible(wq, condition) \ |
343 | ({ \ | 392 | ({ \ |
344 | int __ret = 0; \ | 393 | int __ret = 0; \ |
394 | might_sleep(); \ | ||
345 | if (!(condition)) \ | 395 | if (!(condition)) \ |
346 | __ret = __wait_event_interruptible(wq, condition); \ | 396 | __ret = __wait_event_interruptible(wq, condition); \ |
347 | __ret; \ | 397 | __ret; \ |
@@ -375,6 +425,7 @@ do { \ | |||
375 | #define wait_event_interruptible_timeout(wq, condition, timeout) \ | 425 | #define wait_event_interruptible_timeout(wq, condition, timeout) \ |
376 | ({ \ | 426 | ({ \ |
377 | long __ret = timeout; \ | 427 | long __ret = timeout; \ |
428 | might_sleep(); \ | ||
378 | if (!___wait_cond_timeout(condition)) \ | 429 | if (!___wait_cond_timeout(condition)) \ |
379 | __ret = __wait_event_interruptible_timeout(wq, \ | 430 | __ret = __wait_event_interruptible_timeout(wq, \ |
380 | condition, timeout); \ | 431 | condition, timeout); \ |
@@ -425,6 +476,7 @@ do { \ | |||
425 | #define wait_event_hrtimeout(wq, condition, timeout) \ | 476 | #define wait_event_hrtimeout(wq, condition, timeout) \ |
426 | ({ \ | 477 | ({ \ |
427 | int __ret = 0; \ | 478 | int __ret = 0; \ |
479 | might_sleep(); \ | ||
428 | if (!(condition)) \ | 480 | if (!(condition)) \ |
429 | __ret = __wait_event_hrtimeout(wq, condition, timeout, \ | 481 | __ret = __wait_event_hrtimeout(wq, condition, timeout, \ |
430 | TASK_UNINTERRUPTIBLE); \ | 482 | TASK_UNINTERRUPTIBLE); \ |
@@ -450,6 +502,7 @@ do { \ | |||
450 | #define wait_event_interruptible_hrtimeout(wq, condition, timeout) \ | 502 | #define wait_event_interruptible_hrtimeout(wq, condition, timeout) \ |
451 | ({ \ | 503 | ({ \ |
452 | long __ret = 0; \ | 504 | long __ret = 0; \ |
505 | might_sleep(); \ | ||
453 | if (!(condition)) \ | 506 | if (!(condition)) \ |
454 | __ret = __wait_event_hrtimeout(wq, condition, timeout, \ | 507 | __ret = __wait_event_hrtimeout(wq, condition, timeout, \ |
455 | TASK_INTERRUPTIBLE); \ | 508 | TASK_INTERRUPTIBLE); \ |
@@ -463,12 +516,27 @@ do { \ | |||
463 | #define wait_event_interruptible_exclusive(wq, condition) \ | 516 | #define wait_event_interruptible_exclusive(wq, condition) \ |
464 | ({ \ | 517 | ({ \ |
465 | int __ret = 0; \ | 518 | int __ret = 0; \ |
519 | might_sleep(); \ | ||
466 | if (!(condition)) \ | 520 | if (!(condition)) \ |
467 | __ret = __wait_event_interruptible_exclusive(wq, condition);\ | 521 | __ret = __wait_event_interruptible_exclusive(wq, condition);\ |
468 | __ret; \ | 522 | __ret; \ |
469 | }) | 523 | }) |
470 | 524 | ||
471 | 525 | ||
526 | #define __wait_event_freezable_exclusive(wq, condition) \ | ||
527 | ___wait_event(wq, condition, TASK_INTERRUPTIBLE, 1, 0, \ | ||
528 | schedule(); try_to_freeze()) | ||
529 | |||
530 | #define wait_event_freezable_exclusive(wq, condition) \ | ||
531 | ({ \ | ||
532 | int __ret = 0; \ | ||
533 | might_sleep(); \ | ||
534 | if (!(condition)) \ | ||
535 | __ret = __wait_event_freezable_exclusive(wq, condition);\ | ||
536 | __ret; \ | ||
537 | }) | ||
538 | |||
539 | |||
472 | #define __wait_event_interruptible_locked(wq, condition, exclusive, irq) \ | 540 | #define __wait_event_interruptible_locked(wq, condition, exclusive, irq) \ |
473 | ({ \ | 541 | ({ \ |
474 | int __ret = 0; \ | 542 | int __ret = 0; \ |
@@ -637,6 +705,7 @@ do { \ | |||
637 | #define wait_event_killable(wq, condition) \ | 705 | #define wait_event_killable(wq, condition) \ |
638 | ({ \ | 706 | ({ \ |
639 | int __ret = 0; \ | 707 | int __ret = 0; \ |
708 | might_sleep(); \ | ||
640 | if (!(condition)) \ | 709 | if (!(condition)) \ |
641 | __ret = __wait_event_killable(wq, condition); \ | 710 | __ret = __wait_event_killable(wq, condition); \ |
642 | __ret; \ | 711 | __ret; \ |
@@ -830,6 +899,8 @@ void prepare_to_wait_exclusive(wait_queue_head_t *q, wait_queue_t *wait, int sta | |||
830 | long prepare_to_wait_event(wait_queue_head_t *q, wait_queue_t *wait, int state); | 899 | long prepare_to_wait_event(wait_queue_head_t *q, wait_queue_t *wait, int state); |
831 | void finish_wait(wait_queue_head_t *q, wait_queue_t *wait); | 900 | void finish_wait(wait_queue_head_t *q, wait_queue_t *wait); |
832 | void abort_exclusive_wait(wait_queue_head_t *q, wait_queue_t *wait, unsigned int mode, void *key); | 901 | void abort_exclusive_wait(wait_queue_head_t *q, wait_queue_t *wait, unsigned int mode, void *key); |
902 | long wait_woken(wait_queue_t *wait, unsigned mode, long timeout); | ||
903 | int woken_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key); | ||
833 | int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key); | 904 | int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key); |
834 | int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key); | 905 | int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key); |
835 | 906 | ||
@@ -886,6 +957,7 @@ extern int bit_wait_io_timeout(struct wait_bit_key *); | |||
886 | static inline int | 957 | static inline int |
887 | wait_on_bit(void *word, int bit, unsigned mode) | 958 | wait_on_bit(void *word, int bit, unsigned mode) |
888 | { | 959 | { |
960 | might_sleep(); | ||
889 | if (!test_bit(bit, word)) | 961 | if (!test_bit(bit, word)) |
890 | return 0; | 962 | return 0; |
891 | return out_of_line_wait_on_bit(word, bit, | 963 | return out_of_line_wait_on_bit(word, bit, |
@@ -910,6 +982,7 @@ wait_on_bit(void *word, int bit, unsigned mode) | |||
910 | static inline int | 982 | static inline int |
911 | wait_on_bit_io(void *word, int bit, unsigned mode) | 983 | wait_on_bit_io(void *word, int bit, unsigned mode) |
912 | { | 984 | { |
985 | might_sleep(); | ||
913 | if (!test_bit(bit, word)) | 986 | if (!test_bit(bit, word)) |
914 | return 0; | 987 | return 0; |
915 | return out_of_line_wait_on_bit(word, bit, | 988 | return out_of_line_wait_on_bit(word, bit, |
@@ -936,6 +1009,7 @@ wait_on_bit_io(void *word, int bit, unsigned mode) | |||
936 | static inline int | 1009 | static inline int |
937 | wait_on_bit_action(void *word, int bit, wait_bit_action_f *action, unsigned mode) | 1010 | wait_on_bit_action(void *word, int bit, wait_bit_action_f *action, unsigned mode) |
938 | { | 1011 | { |
1012 | might_sleep(); | ||
939 | if (!test_bit(bit, word)) | 1013 | if (!test_bit(bit, word)) |
940 | return 0; | 1014 | return 0; |
941 | return out_of_line_wait_on_bit(word, bit, action, mode); | 1015 | return out_of_line_wait_on_bit(word, bit, action, mode); |
@@ -963,6 +1037,7 @@ wait_on_bit_action(void *word, int bit, wait_bit_action_f *action, unsigned mode | |||
963 | static inline int | 1037 | static inline int |
964 | wait_on_bit_lock(void *word, int bit, unsigned mode) | 1038 | wait_on_bit_lock(void *word, int bit, unsigned mode) |
965 | { | 1039 | { |
1040 | might_sleep(); | ||
966 | if (!test_and_set_bit(bit, word)) | 1041 | if (!test_and_set_bit(bit, word)) |
967 | return 0; | 1042 | return 0; |
968 | return out_of_line_wait_on_bit_lock(word, bit, bit_wait, mode); | 1043 | return out_of_line_wait_on_bit_lock(word, bit, bit_wait, mode); |
@@ -986,6 +1061,7 @@ wait_on_bit_lock(void *word, int bit, unsigned mode) | |||
986 | static inline int | 1061 | static inline int |
987 | wait_on_bit_lock_io(void *word, int bit, unsigned mode) | 1062 | wait_on_bit_lock_io(void *word, int bit, unsigned mode) |
988 | { | 1063 | { |
1064 | might_sleep(); | ||
989 | if (!test_and_set_bit(bit, word)) | 1065 | if (!test_and_set_bit(bit, word)) |
990 | return 0; | 1066 | return 0; |
991 | return out_of_line_wait_on_bit_lock(word, bit, bit_wait_io, mode); | 1067 | return out_of_line_wait_on_bit_lock(word, bit, bit_wait_io, mode); |
@@ -1011,6 +1087,7 @@ wait_on_bit_lock_io(void *word, int bit, unsigned mode) | |||
1011 | static inline int | 1087 | static inline int |
1012 | wait_on_bit_lock_action(void *word, int bit, wait_bit_action_f *action, unsigned mode) | 1088 | wait_on_bit_lock_action(void *word, int bit, wait_bit_action_f *action, unsigned mode) |
1013 | { | 1089 | { |
1090 | might_sleep(); | ||
1014 | if (!test_and_set_bit(bit, word)) | 1091 | if (!test_and_set_bit(bit, word)) |
1015 | return 0; | 1092 | return 0; |
1016 | return out_of_line_wait_on_bit_lock(word, bit, action, mode); | 1093 | return out_of_line_wait_on_bit_lock(word, bit, action, mode); |
@@ -1029,6 +1106,7 @@ wait_on_bit_lock_action(void *word, int bit, wait_bit_action_f *action, unsigned | |||
1029 | static inline | 1106 | static inline |
1030 | int wait_on_atomic_t(atomic_t *val, int (*action)(atomic_t *), unsigned mode) | 1107 | int wait_on_atomic_t(atomic_t *val, int (*action)(atomic_t *), unsigned mode) |
1031 | { | 1108 | { |
1109 | might_sleep(); | ||
1032 | if (atomic_read(val) == 0) | 1110 | if (atomic_read(val) == 0) |
1033 | return 0; | 1111 | return 0; |
1034 | return out_of_line_wait_on_atomic_t(val, action, mode); | 1112 | return out_of_line_wait_on_atomic_t(val, action, mode); |