diff options
Diffstat (limited to 'include/linux')
161 files changed, 3178 insertions, 1451 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index a5db4aeefa36..c30bac8503bc 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -311,6 +311,7 @@ struct acpi_osc_context { | |||
| 311 | #define OSC_INVALID_REVISION_ERROR 8 | 311 | #define OSC_INVALID_REVISION_ERROR 8 |
| 312 | #define OSC_CAPABILITIES_MASK_ERROR 16 | 312 | #define OSC_CAPABILITIES_MASK_ERROR 16 |
| 313 | 313 | ||
| 314 | acpi_status acpi_str_to_uuid(char *str, u8 *uuid); | ||
| 314 | acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context); | 315 | acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context); |
| 315 | 316 | ||
| 316 | /* platform-wide _OSC bits */ | 317 | /* platform-wide _OSC bits */ |
diff --git a/include/linux/acpi_gpio.h b/include/linux/acpi_gpio.h index 4c120a1e0ca3..d875bc3dba3c 100644 --- a/include/linux/acpi_gpio.h +++ b/include/linux/acpi_gpio.h | |||
| @@ -2,36 +2,35 @@ | |||
| 2 | #define _LINUX_ACPI_GPIO_H_ | 2 | #define _LINUX_ACPI_GPIO_H_ |
| 3 | 3 | ||
| 4 | #include <linux/device.h> | 4 | #include <linux/device.h> |
| 5 | #include <linux/err.h> | ||
| 5 | #include <linux/errno.h> | 6 | #include <linux/errno.h> |
| 6 | #include <linux/gpio.h> | 7 | #include <linux/gpio.h> |
| 8 | #include <linux/gpio/consumer.h> | ||
| 7 | 9 | ||
| 8 | /** | 10 | /** |
| 9 | * struct acpi_gpio_info - ACPI GPIO specific information | 11 | * struct acpi_gpio_info - ACPI GPIO specific information |
| 10 | * @gpioint: if %true this GPIO is of type GpioInt otherwise type is GpioIo | 12 | * @gpioint: if %true this GPIO is of type GpioInt otherwise type is GpioIo |
| 13 | * @active_low: in case of @gpioint, the pin is active low | ||
| 11 | */ | 14 | */ |
| 12 | struct acpi_gpio_info { | 15 | struct acpi_gpio_info { |
| 13 | bool gpioint; | 16 | bool gpioint; |
| 17 | bool active_low; | ||
| 14 | }; | 18 | }; |
| 15 | 19 | ||
| 16 | #ifdef CONFIG_GPIO_ACPI | 20 | #ifdef CONFIG_GPIO_ACPI |
| 17 | 21 | ||
| 18 | int acpi_get_gpio(char *path, int pin); | 22 | struct gpio_desc *acpi_get_gpiod_by_index(struct device *dev, int index, |
| 19 | int acpi_get_gpio_by_index(struct device *dev, int index, | 23 | struct acpi_gpio_info *info); |
| 20 | struct acpi_gpio_info *info); | ||
| 21 | void acpi_gpiochip_request_interrupts(struct gpio_chip *chip); | 24 | void acpi_gpiochip_request_interrupts(struct gpio_chip *chip); |
| 22 | void acpi_gpiochip_free_interrupts(struct gpio_chip *chip); | 25 | void acpi_gpiochip_free_interrupts(struct gpio_chip *chip); |
| 23 | 26 | ||
| 24 | #else /* CONFIG_GPIO_ACPI */ | 27 | #else /* CONFIG_GPIO_ACPI */ |
| 25 | 28 | ||
| 26 | static inline int acpi_get_gpio(char *path, int pin) | 29 | static inline struct gpio_desc * |
| 30 | acpi_get_gpiod_by_index(struct device *dev, int index, | ||
| 31 | struct acpi_gpio_info *info) | ||
| 27 | { | 32 | { |
| 28 | return -ENODEV; | 33 | return ERR_PTR(-ENOSYS); |
| 29 | } | ||
| 30 | |||
| 31 | static inline int acpi_get_gpio_by_index(struct device *dev, int index, | ||
| 32 | struct acpi_gpio_info *info) | ||
| 33 | { | ||
| 34 | return -ENODEV; | ||
| 35 | } | 34 | } |
| 36 | 35 | ||
| 37 | static inline void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) { } | 36 | static inline void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) { } |
| @@ -39,4 +38,14 @@ static inline void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) { } | |||
| 39 | 38 | ||
| 40 | #endif /* CONFIG_GPIO_ACPI */ | 39 | #endif /* CONFIG_GPIO_ACPI */ |
| 41 | 40 | ||
| 41 | static inline int acpi_get_gpio_by_index(struct device *dev, int index, | ||
| 42 | struct acpi_gpio_info *info) | ||
| 43 | { | ||
| 44 | struct gpio_desc *desc = acpi_get_gpiod_by_index(dev, index, info); | ||
| 45 | |||
| 46 | if (IS_ERR(desc)) | ||
| 47 | return PTR_ERR(desc); | ||
| 48 | return desc_to_gpio(desc); | ||
| 49 | } | ||
| 50 | |||
| 42 | #endif /* _LINUX_ACPI_GPIO_H_ */ | 51 | #endif /* _LINUX_ACPI_GPIO_H_ */ |
diff --git a/include/linux/anon_inodes.h b/include/linux/anon_inodes.h index cf573c22b81e..8013a45242fe 100644 --- a/include/linux/anon_inodes.h +++ b/include/linux/anon_inodes.h | |||
| @@ -13,9 +13,6 @@ struct file_operations; | |||
| 13 | struct file *anon_inode_getfile(const char *name, | 13 | struct file *anon_inode_getfile(const char *name, |
| 14 | const struct file_operations *fops, | 14 | const struct file_operations *fops, |
| 15 | void *priv, int flags); | 15 | void *priv, int flags); |
| 16 | struct file *anon_inode_getfile_private(const char *name, | ||
| 17 | const struct file_operations *fops, | ||
| 18 | void *priv, int flags); | ||
| 19 | int anon_inode_getfd(const char *name, const struct file_operations *fops, | 16 | int anon_inode_getfd(const char *name, const struct file_operations *fops, |
| 20 | void *priv, int flags); | 17 | void *priv, int flags); |
| 21 | 18 | ||
diff --git a/include/linux/ata.h b/include/linux/ata.h index bf4c69ca76df..f2f4d8da97c0 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
| @@ -219,6 +219,7 @@ enum { | |||
| 219 | ATA_CMD_IDLE = 0xE3, /* place in idle power mode */ | 219 | ATA_CMD_IDLE = 0xE3, /* place in idle power mode */ |
| 220 | ATA_CMD_EDD = 0x90, /* execute device diagnostic */ | 220 | ATA_CMD_EDD = 0x90, /* execute device diagnostic */ |
| 221 | ATA_CMD_DOWNLOAD_MICRO = 0x92, | 221 | ATA_CMD_DOWNLOAD_MICRO = 0x92, |
| 222 | ATA_CMD_DOWNLOAD_MICRO_DMA = 0x93, | ||
| 222 | ATA_CMD_NOP = 0x00, | 223 | ATA_CMD_NOP = 0x00, |
| 223 | ATA_CMD_FLUSH = 0xE7, | 224 | ATA_CMD_FLUSH = 0xE7, |
| 224 | ATA_CMD_FLUSH_EXT = 0xEA, | 225 | ATA_CMD_FLUSH_EXT = 0xEA, |
| @@ -268,12 +269,15 @@ enum { | |||
| 268 | ATA_CMD_WRITE_LOG_EXT = 0x3F, | 269 | ATA_CMD_WRITE_LOG_EXT = 0x3F, |
| 269 | ATA_CMD_READ_LOG_DMA_EXT = 0x47, | 270 | ATA_CMD_READ_LOG_DMA_EXT = 0x47, |
| 270 | ATA_CMD_WRITE_LOG_DMA_EXT = 0x57, | 271 | ATA_CMD_WRITE_LOG_DMA_EXT = 0x57, |
| 272 | ATA_CMD_TRUSTED_NONDATA = 0x5B, | ||
| 271 | ATA_CMD_TRUSTED_RCV = 0x5C, | 273 | ATA_CMD_TRUSTED_RCV = 0x5C, |
| 272 | ATA_CMD_TRUSTED_RCV_DMA = 0x5D, | 274 | ATA_CMD_TRUSTED_RCV_DMA = 0x5D, |
| 273 | ATA_CMD_TRUSTED_SND = 0x5E, | 275 | ATA_CMD_TRUSTED_SND = 0x5E, |
| 274 | ATA_CMD_TRUSTED_SND_DMA = 0x5F, | 276 | ATA_CMD_TRUSTED_SND_DMA = 0x5F, |
| 275 | ATA_CMD_PMP_READ = 0xE4, | 277 | ATA_CMD_PMP_READ = 0xE4, |
| 278 | ATA_CMD_PMP_READ_DMA = 0xE9, | ||
| 276 | ATA_CMD_PMP_WRITE = 0xE8, | 279 | ATA_CMD_PMP_WRITE = 0xE8, |
| 280 | ATA_CMD_PMP_WRITE_DMA = 0xEB, | ||
| 277 | ATA_CMD_CONF_OVERLAY = 0xB1, | 281 | ATA_CMD_CONF_OVERLAY = 0xB1, |
| 278 | ATA_CMD_SEC_SET_PASS = 0xF1, | 282 | ATA_CMD_SEC_SET_PASS = 0xF1, |
| 279 | ATA_CMD_SEC_UNLOCK = 0xF2, | 283 | ATA_CMD_SEC_UNLOCK = 0xF2, |
| @@ -292,6 +296,9 @@ enum { | |||
| 292 | ATA_CMD_CFA_TRANS_SECT = 0x87, | 296 | ATA_CMD_CFA_TRANS_SECT = 0x87, |
| 293 | ATA_CMD_CFA_ERASE = 0xC0, | 297 | ATA_CMD_CFA_ERASE = 0xC0, |
| 294 | ATA_CMD_CFA_WRITE_MULT_NE = 0xCD, | 298 | ATA_CMD_CFA_WRITE_MULT_NE = 0xCD, |
| 299 | ATA_CMD_REQ_SENSE_DATA = 0x0B, | ||
| 300 | ATA_CMD_SANITIZE_DEVICE = 0xB4, | ||
| 301 | |||
| 295 | /* marked obsolete in the ATA/ATAPI-7 spec */ | 302 | /* marked obsolete in the ATA/ATAPI-7 spec */ |
| 296 | ATA_CMD_RESTORE = 0x10, | 303 | ATA_CMD_RESTORE = 0x10, |
| 297 | 304 | ||
diff --git a/include/linux/atmel_serial.h b/include/linux/atmel_serial.h index be201ca2990c..00beddf6be20 100644 --- a/include/linux/atmel_serial.h +++ b/include/linux/atmel_serial.h | |||
| @@ -125,5 +125,6 @@ | |||
| 125 | #define ATMEL_US_IF 0x4c /* IrDA Filter Register */ | 125 | #define ATMEL_US_IF 0x4c /* IrDA Filter Register */ |
| 126 | 126 | ||
| 127 | #define ATMEL_US_NAME 0xf0 /* Ip Name */ | 127 | #define ATMEL_US_NAME 0xf0 /* Ip Name */ |
| 128 | #define ATMEL_US_VERSION 0xfc /* Ip Version */ | ||
| 128 | 129 | ||
| 129 | #endif | 130 | #endif |
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index e8112ae50531..fd8bf3219ef7 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
| @@ -56,11 +56,12 @@ struct linux_binprm { | |||
| 56 | 56 | ||
| 57 | /* Function parameter for binfmt->coredump */ | 57 | /* Function parameter for binfmt->coredump */ |
| 58 | struct coredump_params { | 58 | struct coredump_params { |
| 59 | siginfo_t *siginfo; | 59 | const siginfo_t *siginfo; |
| 60 | struct pt_regs *regs; | 60 | struct pt_regs *regs; |
| 61 | struct file *file; | 61 | struct file *file; |
| 62 | unsigned long limit; | 62 | unsigned long limit; |
| 63 | unsigned long mm_flags; | 63 | unsigned long mm_flags; |
| 64 | loff_t written; | ||
| 64 | }; | 65 | }; |
| 65 | 66 | ||
| 66 | /* | 67 | /* |
| @@ -99,9 +100,6 @@ extern void setup_new_exec(struct linux_binprm * bprm); | |||
| 99 | extern void would_dump(struct linux_binprm *, struct file *); | 100 | extern void would_dump(struct linux_binprm *, struct file *); |
| 100 | 101 | ||
| 101 | extern int suid_dumpable; | 102 | extern int suid_dumpable; |
| 102 | #define SUID_DUMP_DISABLE 0 /* No setuid dumping */ | ||
| 103 | #define SUID_DUMP_USER 1 /* Dump as user of process */ | ||
| 104 | #define SUID_DUMP_ROOT 2 /* Dump as root */ | ||
| 105 | 103 | ||
| 106 | /* Stack area protections */ | 104 | /* Stack area protections */ |
| 107 | #define EXSTACK_DEFAULT 0 /* Whatever the arch defaults to */ | 105 | #define EXSTACK_DEFAULT 0 /* Whatever the arch defaults to */ |
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index a3b6b82108b9..bd0c4598d03b 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h | |||
| @@ -10,6 +10,14 @@ | |||
| 10 | #define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) | 10 | #define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) |
| 11 | #endif | 11 | #endif |
| 12 | 12 | ||
| 13 | /* | ||
| 14 | * Create a contiguous bitmask starting at bit position @l and ending at | ||
| 15 | * position @h. For example | ||
| 16 | * GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000. | ||
| 17 | */ | ||
| 18 | #define GENMASK(h, l) (((U32_C(1) << ((h) - (l) + 1)) - 1) << (l)) | ||
| 19 | #define GENMASK_ULL(h, l) (((U64_C(1) << ((h) - (l) + 1)) - 1) << (l)) | ||
| 20 | |||
| 13 | extern unsigned int __sw_hweight8(unsigned int w); | 21 | extern unsigned int __sw_hweight8(unsigned int w); |
| 14 | extern unsigned int __sw_hweight16(unsigned int w); | 22 | extern unsigned int __sw_hweight16(unsigned int w); |
| 15 | extern unsigned int __sw_hweight32(unsigned int w); | 23 | extern unsigned int __sw_hweight32(unsigned int w); |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 3561d305b1e0..39c1d9469677 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
| @@ -612,11 +612,6 @@ struct cgroup_subsys { | |||
| 612 | int subsys_id; | 612 | int subsys_id; |
| 613 | int disabled; | 613 | int disabled; |
| 614 | int early_init; | 614 | int early_init; |
| 615 | /* | ||
| 616 | * True if this subsys uses ID. ID is not available before cgroup_init() | ||
| 617 | * (not available in early_init time.) | ||
| 618 | */ | ||
| 619 | bool use_id; | ||
| 620 | 615 | ||
| 621 | /* | 616 | /* |
| 622 | * If %false, this subsystem is properly hierarchical - | 617 | * If %false, this subsystem is properly hierarchical - |
| @@ -642,9 +637,6 @@ struct cgroup_subsys { | |||
| 642 | */ | 637 | */ |
| 643 | struct cgroupfs_root *root; | 638 | struct cgroupfs_root *root; |
| 644 | struct list_head sibling; | 639 | struct list_head sibling; |
| 645 | /* used when use_id == true */ | ||
| 646 | struct idr idr; | ||
| 647 | spinlock_t id_lock; | ||
| 648 | 640 | ||
| 649 | /* list of cftype_sets */ | 641 | /* list of cftype_sets */ |
| 650 | struct list_head cftsets; | 642 | struct list_head cftsets; |
| @@ -875,35 +867,6 @@ int css_scan_tasks(struct cgroup_subsys_state *css, | |||
| 875 | int cgroup_attach_task_all(struct task_struct *from, struct task_struct *); | 867 | int cgroup_attach_task_all(struct task_struct *from, struct task_struct *); |
| 876 | int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from); | 868 | int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from); |
| 877 | 869 | ||
| 878 | /* | ||
| 879 | * CSS ID is ID for cgroup_subsys_state structs under subsys. This only works | ||
| 880 | * if cgroup_subsys.use_id == true. It can be used for looking up and scanning. | ||
| 881 | * CSS ID is assigned at cgroup allocation (create) automatically | ||
| 882 | * and removed when subsys calls free_css_id() function. This is because | ||
| 883 | * the lifetime of cgroup_subsys_state is subsys's matter. | ||
| 884 | * | ||
| 885 | * Looking up and scanning function should be called under rcu_read_lock(). | ||
| 886 | * Taking cgroup_mutex is not necessary for following calls. | ||
| 887 | * But the css returned by this routine can be "not populated yet" or "being | ||
| 888 | * destroyed". The caller should check css and cgroup's status. | ||
| 889 | */ | ||
| 890 | |||
| 891 | /* | ||
| 892 | * Typically Called at ->destroy(), or somewhere the subsys frees | ||
| 893 | * cgroup_subsys_state. | ||
| 894 | */ | ||
| 895 | void free_css_id(struct cgroup_subsys *ss, struct cgroup_subsys_state *css); | ||
| 896 | |||
| 897 | /* Find a cgroup_subsys_state which has given ID */ | ||
| 898 | |||
| 899 | struct cgroup_subsys_state *css_lookup(struct cgroup_subsys *ss, int id); | ||
| 900 | |||
| 901 | /* Returns true if root is ancestor of cg */ | ||
| 902 | bool css_is_ancestor(struct cgroup_subsys_state *cg, | ||
| 903 | const struct cgroup_subsys_state *root); | ||
| 904 | |||
| 905 | /* Get id and depth of css */ | ||
| 906 | unsigned short css_id(struct cgroup_subsys_state *css); | ||
| 907 | struct cgroup_subsys_state *css_from_dir(struct dentry *dentry, | 870 | struct cgroup_subsys_state *css_from_dir(struct dentry *dentry, |
| 908 | struct cgroup_subsys *ss); | 871 | struct cgroup_subsys *ss); |
| 909 | 872 | ||
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 73bdb69f0c08..7e59253b8603 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h | |||
| @@ -472,6 +472,7 @@ void of_clk_del_provider(struct device_node *np); | |||
| 472 | struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec, | 472 | struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec, |
| 473 | void *data); | 473 | void *data); |
| 474 | struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data); | 474 | struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data); |
| 475 | int of_clk_get_parent_count(struct device_node *np); | ||
| 475 | const char *of_clk_get_parent_name(struct device_node *np, int index); | 476 | const char *of_clk_get_parent_name(struct device_node *np, int index); |
| 476 | 477 | ||
| 477 | void of_clk_init(const struct of_device_id *matches); | 478 | void of_clk_init(const struct of_device_id *matches); |
diff --git a/include/linux/clk/mxs.h b/include/linux/clk/mxs.h index 90c30dc3efc7..5138a90e018c 100644 --- a/include/linux/clk/mxs.h +++ b/include/linux/clk/mxs.h | |||
| @@ -9,8 +9,6 @@ | |||
| 9 | #ifndef __LINUX_CLK_MXS_H | 9 | #ifndef __LINUX_CLK_MXS_H |
| 10 | #define __LINUX_CLK_MXS_H | 10 | #define __LINUX_CLK_MXS_H |
| 11 | 11 | ||
| 12 | int mx23_clocks_init(void); | ||
| 13 | int mx28_clocks_init(void); | ||
| 14 | int mxs_saif_clkmux_select(unsigned int clkmux); | 12 | int mxs_saif_clkmux_select(unsigned int clkmux); |
| 15 | 13 | ||
| 16 | #endif | 14 | #endif |
diff --git a/include/linux/clk/sunxi.h b/include/linux/clk/sunxi.h deleted file mode 100644 index e074fdd5a236..000000000000 --- a/include/linux/clk/sunxi.h +++ /dev/null | |||
| @@ -1,22 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2012 Maxime Ripard | ||
| 3 | * | ||
| 4 | * Maxime Ripard <maxime.ripard@free-electrons.com> | ||
| 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 as published by | ||
| 8 | * the Free Software Foundation; either version 2 of the License, or | ||
| 9 | * (at your option) any later version. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #ifndef __LINUX_CLK_SUNXI_H_ | ||
| 18 | #define __LINUX_CLK_SUNXI_H_ | ||
| 19 | |||
| 20 | void __init sunxi_init_clocks(void); | ||
| 21 | |||
| 22 | #endif | ||
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index 0857922e8ad0..493aa021c7a9 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h | |||
| @@ -60,6 +60,7 @@ enum clock_event_mode { | |||
| 60 | * Core shall set the interrupt affinity dynamically in broadcast mode | 60 | * Core shall set the interrupt affinity dynamically in broadcast mode |
| 61 | */ | 61 | */ |
| 62 | #define CLOCK_EVT_FEAT_DYNIRQ 0x000020 | 62 | #define CLOCK_EVT_FEAT_DYNIRQ 0x000020 |
| 63 | #define CLOCK_EVT_FEAT_PERCPU 0x000040 | ||
| 63 | 64 | ||
| 64 | /** | 65 | /** |
| 65 | * struct clock_event_device - clock event device descriptor | 66 | * struct clock_event_device - clock event device descriptor |
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index dbbf8aa7731b..67301a405712 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
| @@ -292,6 +292,8 @@ extern void clocksource_resume(void); | |||
| 292 | extern struct clocksource * __init __weak clocksource_default_clock(void); | 292 | extern struct clocksource * __init __weak clocksource_default_clock(void); |
| 293 | extern void clocksource_mark_unstable(struct clocksource *cs); | 293 | extern void clocksource_mark_unstable(struct clocksource *cs); |
| 294 | 294 | ||
| 295 | extern u64 | ||
| 296 | clocks_calc_max_nsecs(u32 mult, u32 shift, u32 maxadj, u64 mask); | ||
| 295 | extern void | 297 | extern void |
| 296 | clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec); | 298 | clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec); |
| 297 | 299 | ||
diff --git a/include/linux/compat.h b/include/linux/compat.h index 345da00a86e0..eb8a49d75ab3 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
| @@ -41,14 +41,14 @@ | |||
| 41 | COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__) | 41 | COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__) |
| 42 | 42 | ||
| 43 | #define COMPAT_SYSCALL_DEFINEx(x, name, ...) \ | 43 | #define COMPAT_SYSCALL_DEFINEx(x, name, ...) \ |
| 44 | asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\ | 44 | asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))\ |
| 45 | __attribute__((alias(__stringify(compat_SyS##name)))); \ | ||
| 45 | static inline long C_SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__));\ | 46 | static inline long C_SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__));\ |
| 46 | asmlinkage long compat_SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__));\ | 47 | asmlinkage long compat_SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__));\ |
| 47 | asmlinkage long compat_SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__))\ | 48 | asmlinkage long compat_SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__))\ |
| 48 | { \ | 49 | { \ |
| 49 | return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \ | 50 | return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \ |
| 50 | } \ | 51 | } \ |
| 51 | SYSCALL_ALIAS(compat_sys##name, compat_SyS##name); \ | ||
| 52 | static inline long C_SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__)) | 52 | static inline long C_SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__)) |
| 53 | 53 | ||
| 54 | #ifndef compat_user_stack_pointer | 54 | #ifndef compat_user_stack_pointer |
| @@ -362,7 +362,7 @@ long compat_get_bitmap(unsigned long *mask, const compat_ulong_t __user *umask, | |||
| 362 | long compat_put_bitmap(compat_ulong_t __user *umask, unsigned long *mask, | 362 | long compat_put_bitmap(compat_ulong_t __user *umask, unsigned long *mask, |
| 363 | unsigned long bitmap_size); | 363 | unsigned long bitmap_size); |
| 364 | int copy_siginfo_from_user32(siginfo_t *to, struct compat_siginfo __user *from); | 364 | int copy_siginfo_from_user32(siginfo_t *to, struct compat_siginfo __user *from); |
| 365 | int copy_siginfo_to_user32(struct compat_siginfo __user *to, siginfo_t *from); | 365 | int copy_siginfo_to_user32(struct compat_siginfo __user *to, const siginfo_t *from); |
| 366 | int get_compat_sigevent(struct sigevent *event, | 366 | int get_compat_sigevent(struct sigevent *event, |
| 367 | const struct compat_sigevent __user *u_event); | 367 | const struct compat_sigevent __user *u_event); |
| 368 | long compat_sys_rt_tgsigqueueinfo(compat_pid_t tgid, compat_pid_t pid, int sig, | 368 | long compat_sys_rt_tgsigqueueinfo(compat_pid_t tgid, compat_pid_t pid, int sig, |
diff --git a/include/linux/completion.h b/include/linux/completion.h index 3cd574d5b19e..22c33e35bcb2 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | * (C) Copyright 2001 Linus Torvalds | 5 | * (C) Copyright 2001 Linus Torvalds |
| 6 | * | 6 | * |
| 7 | * Atomic wait-for-completion handler data structures. | 7 | * Atomic wait-for-completion handler data structures. |
| 8 | * See kernel/sched/core.c for details. | 8 | * See kernel/sched/completion.c for details. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | #include <linux/wait.h> | 11 | #include <linux/wait.h> |
diff --git a/include/linux/coredump.h b/include/linux/coredump.h index a98f1ca60407..d016a121a8c4 100644 --- a/include/linux/coredump.h +++ b/include/linux/coredump.h | |||
| @@ -10,12 +10,14 @@ | |||
| 10 | * These are the only things you should do on a core-file: use only these | 10 | * These are the only things you should do on a core-file: use only these |
| 11 | * functions to write out all the necessary info. | 11 | * functions to write out all the necessary info. |
| 12 | */ | 12 | */ |
| 13 | extern int dump_write(struct file *file, const void *addr, int nr); | 13 | struct coredump_params; |
| 14 | extern int dump_seek(struct file *file, loff_t off); | 14 | extern int dump_skip(struct coredump_params *cprm, size_t nr); |
| 15 | extern int dump_emit(struct coredump_params *cprm, const void *addr, int nr); | ||
| 16 | extern int dump_align(struct coredump_params *cprm, int align); | ||
| 15 | #ifdef CONFIG_COREDUMP | 17 | #ifdef CONFIG_COREDUMP |
| 16 | extern void do_coredump(siginfo_t *siginfo); | 18 | extern void do_coredump(const siginfo_t *siginfo); |
| 17 | #else | 19 | #else |
| 18 | static inline void do_coredump(siginfo_t *siginfo) {} | 20 | static inline void do_coredump(const siginfo_t *siginfo) {} |
| 19 | #endif | 21 | #endif |
| 20 | 22 | ||
| 21 | #endif /* _LINUX_COREDUMP_H */ | 23 | #endif /* _LINUX_COREDUMP_H */ |
diff --git a/include/linux/cper.h b/include/linux/cper.h index c23049496531..2fc0ec3d89cc 100644 --- a/include/linux/cper.h +++ b/include/linux/cper.h | |||
| @@ -218,8 +218,8 @@ enum { | |||
| 218 | #define CPER_PROC_VALID_IP 0x1000 | 218 | #define CPER_PROC_VALID_IP 0x1000 |
| 219 | 219 | ||
| 220 | #define CPER_MEM_VALID_ERROR_STATUS 0x0001 | 220 | #define CPER_MEM_VALID_ERROR_STATUS 0x0001 |
| 221 | #define CPER_MEM_VALID_PHYSICAL_ADDRESS 0x0002 | 221 | #define CPER_MEM_VALID_PA 0x0002 |
| 222 | #define CPER_MEM_VALID_PHYSICAL_ADDRESS_MASK 0x0004 | 222 | #define CPER_MEM_VALID_PA_MASK 0x0004 |
| 223 | #define CPER_MEM_VALID_NODE 0x0008 | 223 | #define CPER_MEM_VALID_NODE 0x0008 |
| 224 | #define CPER_MEM_VALID_CARD 0x0010 | 224 | #define CPER_MEM_VALID_CARD 0x0010 |
| 225 | #define CPER_MEM_VALID_MODULE 0x0020 | 225 | #define CPER_MEM_VALID_MODULE 0x0020 |
| @@ -232,6 +232,9 @@ enum { | |||
| 232 | #define CPER_MEM_VALID_RESPONDER_ID 0x1000 | 232 | #define CPER_MEM_VALID_RESPONDER_ID 0x1000 |
| 233 | #define CPER_MEM_VALID_TARGET_ID 0x2000 | 233 | #define CPER_MEM_VALID_TARGET_ID 0x2000 |
| 234 | #define CPER_MEM_VALID_ERROR_TYPE 0x4000 | 234 | #define CPER_MEM_VALID_ERROR_TYPE 0x4000 |
| 235 | #define CPER_MEM_VALID_RANK_NUMBER 0x8000 | ||
| 236 | #define CPER_MEM_VALID_CARD_HANDLE 0x10000 | ||
| 237 | #define CPER_MEM_VALID_MODULE_HANDLE 0x20000 | ||
| 235 | 238 | ||
| 236 | #define CPER_PCIE_VALID_PORT_TYPE 0x0001 | 239 | #define CPER_PCIE_VALID_PORT_TYPE 0x0001 |
| 237 | #define CPER_PCIE_VALID_VERSION 0x0002 | 240 | #define CPER_PCIE_VALID_VERSION 0x0002 |
| @@ -347,6 +350,10 @@ struct cper_sec_mem_err { | |||
| 347 | __u64 responder_id; | 350 | __u64 responder_id; |
| 348 | __u64 target_id; | 351 | __u64 target_id; |
| 349 | __u8 error_type; | 352 | __u8 error_type; |
| 353 | __u8 reserved; | ||
| 354 | __u16 rank; | ||
| 355 | __u16 mem_array_handle; /* card handle in UEFI 2.4 */ | ||
| 356 | __u16 mem_dev_handle; /* module handle in UEFI 2.4 */ | ||
| 350 | }; | 357 | }; |
| 351 | 358 | ||
| 352 | struct cper_sec_pcie { | 359 | struct cper_sec_pcie { |
| @@ -389,6 +396,6 @@ struct cper_sec_pcie { | |||
| 389 | 396 | ||
| 390 | u64 cper_next_record_id(void); | 397 | u64 cper_next_record_id(void); |
| 391 | void cper_print_bits(const char *prefix, unsigned int bits, | 398 | void cper_print_bits(const char *prefix, unsigned int bits, |
| 392 | const char *strs[], unsigned int strs_size); | 399 | const char * const strs[], unsigned int strs_size); |
| 393 | 400 | ||
| 394 | #endif | 401 | #endif |
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 801ff9e73679..fbd25c3c2923 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/cpumask.h> | 18 | #include <linux/cpumask.h> |
| 19 | 19 | ||
| 20 | struct device; | 20 | struct device; |
| 21 | struct device_node; | ||
| 21 | 22 | ||
| 22 | struct cpu { | 23 | struct cpu { |
| 23 | int node_id; /* The node which contains the CPU */ | 24 | int node_id; /* The node which contains the CPU */ |
| @@ -29,6 +30,8 @@ extern int register_cpu(struct cpu *cpu, int num); | |||
| 29 | extern struct device *get_cpu_device(unsigned cpu); | 30 | extern struct device *get_cpu_device(unsigned cpu); |
| 30 | extern bool cpu_is_hotpluggable(unsigned cpu); | 31 | extern bool cpu_is_hotpluggable(unsigned cpu); |
| 31 | extern bool arch_match_cpu_phys_id(int cpu, u64 phys_id); | 32 | extern bool arch_match_cpu_phys_id(int cpu, u64 phys_id); |
| 33 | extern bool arch_find_n_match_cpu_physical_id(struct device_node *cpun, | ||
| 34 | int cpu, unsigned int *thread); | ||
| 32 | 35 | ||
| 33 | extern int cpu_add_dev_attr(struct device_attribute *attr); | 36 | extern int cpu_add_dev_attr(struct device_attribute *attr); |
| 34 | extern void cpu_remove_dev_attr(struct device_attribute *attr); | 37 | extern void cpu_remove_dev_attr(struct device_attribute *attr); |
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 59066e0b4ff1..57e87e749a48 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
| @@ -169,13 +169,13 @@ struct dentry_operations { | |||
| 169 | */ | 169 | */ |
| 170 | 170 | ||
| 171 | /* d_flags entries */ | 171 | /* d_flags entries */ |
| 172 | #define DCACHE_OP_HASH 0x0001 | 172 | #define DCACHE_OP_HASH 0x00000001 |
| 173 | #define DCACHE_OP_COMPARE 0x0002 | 173 | #define DCACHE_OP_COMPARE 0x00000002 |
| 174 | #define DCACHE_OP_REVALIDATE 0x0004 | 174 | #define DCACHE_OP_REVALIDATE 0x00000004 |
| 175 | #define DCACHE_OP_DELETE 0x0008 | 175 | #define DCACHE_OP_DELETE 0x00000008 |
| 176 | #define DCACHE_OP_PRUNE 0x0010 | 176 | #define DCACHE_OP_PRUNE 0x00000010 |
| 177 | 177 | ||
| 178 | #define DCACHE_DISCONNECTED 0x0020 | 178 | #define DCACHE_DISCONNECTED 0x00000020 |
| 179 | /* This dentry is possibly not currently connected to the dcache tree, in | 179 | /* This dentry is possibly not currently connected to the dcache tree, in |
| 180 | * which case its parent will either be itself, or will have this flag as | 180 | * which case its parent will either be itself, or will have this flag as |
| 181 | * well. nfsd will not use a dentry with this bit set, but will first | 181 | * well. nfsd will not use a dentry with this bit set, but will first |
| @@ -186,30 +186,38 @@ struct dentry_operations { | |||
| 186 | * dentry into place and return that dentry rather than the passed one, | 186 | * dentry into place and return that dentry rather than the passed one, |
| 187 | * typically using d_splice_alias. */ | 187 | * typically using d_splice_alias. */ |
| 188 | 188 | ||
| 189 | #define DCACHE_REFERENCED 0x0040 /* Recently used, don't discard. */ | 189 | #define DCACHE_REFERENCED 0x00000040 /* Recently used, don't discard. */ |
| 190 | #define DCACHE_RCUACCESS 0x0080 /* Entry has ever been RCU-visible */ | 190 | #define DCACHE_RCUACCESS 0x00000080 /* Entry has ever been RCU-visible */ |
| 191 | 191 | ||
| 192 | #define DCACHE_CANT_MOUNT 0x0100 | 192 | #define DCACHE_CANT_MOUNT 0x00000100 |
| 193 | #define DCACHE_GENOCIDE 0x0200 | 193 | #define DCACHE_GENOCIDE 0x00000200 |
| 194 | #define DCACHE_SHRINK_LIST 0x0400 | 194 | #define DCACHE_SHRINK_LIST 0x00000400 |
| 195 | 195 | ||
| 196 | #define DCACHE_OP_WEAK_REVALIDATE 0x0800 | 196 | #define DCACHE_OP_WEAK_REVALIDATE 0x00000800 |
| 197 | 197 | ||
| 198 | #define DCACHE_NFSFS_RENAMED 0x1000 | 198 | #define DCACHE_NFSFS_RENAMED 0x00001000 |
| 199 | /* this dentry has been "silly renamed" and has to be deleted on the last | 199 | /* this dentry has been "silly renamed" and has to be deleted on the last |
| 200 | * dput() */ | 200 | * dput() */ |
| 201 | #define DCACHE_COOKIE 0x2000 /* For use by dcookie subsystem */ | 201 | #define DCACHE_COOKIE 0x00002000 /* For use by dcookie subsystem */ |
| 202 | #define DCACHE_FSNOTIFY_PARENT_WATCHED 0x4000 | 202 | #define DCACHE_FSNOTIFY_PARENT_WATCHED 0x00004000 |
| 203 | /* Parent inode is watched by some fsnotify listener */ | 203 | /* Parent inode is watched by some fsnotify listener */ |
| 204 | 204 | ||
| 205 | #define DCACHE_MOUNTED 0x10000 /* is a mountpoint */ | 205 | #define DCACHE_DENTRY_KILLED 0x00008000 |
| 206 | #define DCACHE_NEED_AUTOMOUNT 0x20000 /* handle automount on this dir */ | 206 | |
| 207 | #define DCACHE_MANAGE_TRANSIT 0x40000 /* manage transit from this dirent */ | 207 | #define DCACHE_MOUNTED 0x00010000 /* is a mountpoint */ |
| 208 | #define DCACHE_NEED_AUTOMOUNT 0x00020000 /* handle automount on this dir */ | ||
| 209 | #define DCACHE_MANAGE_TRANSIT 0x00040000 /* manage transit from this dirent */ | ||
| 208 | #define DCACHE_MANAGED_DENTRY \ | 210 | #define DCACHE_MANAGED_DENTRY \ |
| 209 | (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT) | 211 | (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT) |
| 210 | 212 | ||
| 211 | #define DCACHE_LRU_LIST 0x80000 | 213 | #define DCACHE_LRU_LIST 0x00080000 |
| 212 | #define DCACHE_DENTRY_KILLED 0x100000 | 214 | |
| 215 | #define DCACHE_ENTRY_TYPE 0x00700000 | ||
| 216 | #define DCACHE_MISS_TYPE 0x00000000 /* Negative dentry */ | ||
| 217 | #define DCACHE_DIRECTORY_TYPE 0x00100000 /* Normal directory */ | ||
| 218 | #define DCACHE_AUTODIR_TYPE 0x00200000 /* Lookupless directory (presumed automount) */ | ||
| 219 | #define DCACHE_SYMLINK_TYPE 0x00300000 /* Symlink */ | ||
| 220 | #define DCACHE_FILE_TYPE 0x00400000 /* Other file type */ | ||
| 213 | 221 | ||
| 214 | extern seqlock_t rename_lock; | 222 | extern seqlock_t rename_lock; |
| 215 | 223 | ||
| @@ -224,6 +232,7 @@ static inline int dname_external(const struct dentry *dentry) | |||
| 224 | extern void d_instantiate(struct dentry *, struct inode *); | 232 | extern void d_instantiate(struct dentry *, struct inode *); |
| 225 | extern struct dentry * d_instantiate_unique(struct dentry *, struct inode *); | 233 | extern struct dentry * d_instantiate_unique(struct dentry *, struct inode *); |
| 226 | extern struct dentry * d_materialise_unique(struct dentry *, struct inode *); | 234 | extern struct dentry * d_materialise_unique(struct dentry *, struct inode *); |
| 235 | extern int d_instantiate_no_diralias(struct dentry *, struct inode *); | ||
| 227 | extern void __d_drop(struct dentry *dentry); | 236 | extern void __d_drop(struct dentry *dentry); |
| 228 | extern void d_drop(struct dentry *dentry); | 237 | extern void d_drop(struct dentry *dentry); |
| 229 | extern void d_delete(struct dentry *); | 238 | extern void d_delete(struct dentry *); |
| @@ -393,6 +402,61 @@ static inline bool d_mountpoint(const struct dentry *dentry) | |||
| 393 | return dentry->d_flags & DCACHE_MOUNTED; | 402 | return dentry->d_flags & DCACHE_MOUNTED; |
| 394 | } | 403 | } |
| 395 | 404 | ||
| 405 | /* | ||
| 406 | * Directory cache entry type accessor functions. | ||
| 407 | */ | ||
| 408 | static inline void __d_set_type(struct dentry *dentry, unsigned type) | ||
| 409 | { | ||
| 410 | dentry->d_flags = (dentry->d_flags & ~DCACHE_ENTRY_TYPE) | type; | ||
| 411 | } | ||
| 412 | |||
| 413 | static inline void __d_clear_type(struct dentry *dentry) | ||
| 414 | { | ||
| 415 | __d_set_type(dentry, DCACHE_MISS_TYPE); | ||
| 416 | } | ||
| 417 | |||
| 418 | static inline void d_set_type(struct dentry *dentry, unsigned type) | ||
| 419 | { | ||
| 420 | spin_lock(&dentry->d_lock); | ||
| 421 | __d_set_type(dentry, type); | ||
| 422 | spin_unlock(&dentry->d_lock); | ||
| 423 | } | ||
| 424 | |||
| 425 | static inline unsigned __d_entry_type(const struct dentry *dentry) | ||
| 426 | { | ||
| 427 | return dentry->d_flags & DCACHE_ENTRY_TYPE; | ||
| 428 | } | ||
| 429 | |||
| 430 | static inline bool d_is_directory(const struct dentry *dentry) | ||
| 431 | { | ||
| 432 | return __d_entry_type(dentry) == DCACHE_DIRECTORY_TYPE; | ||
| 433 | } | ||
| 434 | |||
| 435 | static inline bool d_is_autodir(const struct dentry *dentry) | ||
| 436 | { | ||
| 437 | return __d_entry_type(dentry) == DCACHE_AUTODIR_TYPE; | ||
| 438 | } | ||
| 439 | |||
| 440 | static inline bool d_is_symlink(const struct dentry *dentry) | ||
| 441 | { | ||
| 442 | return __d_entry_type(dentry) == DCACHE_SYMLINK_TYPE; | ||
| 443 | } | ||
| 444 | |||
| 445 | static inline bool d_is_file(const struct dentry *dentry) | ||
| 446 | { | ||
| 447 | return __d_entry_type(dentry) == DCACHE_FILE_TYPE; | ||
| 448 | } | ||
| 449 | |||
| 450 | static inline bool d_is_negative(const struct dentry *dentry) | ||
| 451 | { | ||
| 452 | return __d_entry_type(dentry) == DCACHE_MISS_TYPE; | ||
| 453 | } | ||
| 454 | |||
| 455 | static inline bool d_is_positive(const struct dentry *dentry) | ||
| 456 | { | ||
| 457 | return !d_is_negative(dentry); | ||
| 458 | } | ||
| 459 | |||
| 396 | extern int sysctl_vfs_cache_pressure; | 460 | extern int sysctl_vfs_cache_pressure; |
| 397 | 461 | ||
| 398 | static inline unsigned long vfs_pressure_ratio(unsigned long val) | 462 | static inline unsigned long vfs_pressure_ratio(unsigned long val) |
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index 263489d0788d..4d0b4d1aa132 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h | |||
| @@ -206,6 +206,12 @@ static inline struct dentry *debugfs_create_size_t(const char *name, umode_t mod | |||
| 206 | return ERR_PTR(-ENODEV); | 206 | return ERR_PTR(-ENODEV); |
| 207 | } | 207 | } |
| 208 | 208 | ||
| 209 | static inline struct dentry *debugfs_create_atomic_t(const char *name, umode_t mode, | ||
| 210 | struct dentry *parent, atomic_t *value) | ||
| 211 | { | ||
| 212 | return ERR_PTR(-ENODEV); | ||
| 213 | } | ||
| 214 | |||
| 209 | static inline struct dentry *debugfs_create_bool(const char *name, umode_t mode, | 215 | static inline struct dentry *debugfs_create_bool(const char *name, umode_t mode, |
| 210 | struct dentry *parent, | 216 | struct dentry *parent, |
| 211 | u32 *value) | 217 | u32 *value) |
| @@ -227,6 +233,12 @@ static inline struct dentry *debugfs_create_regset32(const char *name, | |||
| 227 | return ERR_PTR(-ENODEV); | 233 | return ERR_PTR(-ENODEV); |
| 228 | } | 234 | } |
| 229 | 235 | ||
| 236 | static inline int debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs, | ||
| 237 | int nregs, void __iomem *base, char *prefix) | ||
| 238 | { | ||
| 239 | return 0; | ||
| 240 | } | ||
| 241 | |||
| 230 | static inline bool debugfs_initialized(void) | 242 | static inline bool debugfs_initialized(void) |
| 231 | { | 243 | { |
| 232 | return false; | 244 | return false; |
diff --git a/include/linux/device.h b/include/linux/device.h index 2a9d6ed59579..b025925df7f7 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include <linux/atomic.h> | 26 | #include <linux/atomic.h> |
| 27 | #include <linux/ratelimit.h> | 27 | #include <linux/ratelimit.h> |
| 28 | #include <linux/uidgid.h> | 28 | #include <linux/uidgid.h> |
| 29 | #include <linux/gfp.h> | ||
| 29 | #include <asm/device.h> | 30 | #include <asm/device.h> |
| 30 | 31 | ||
| 31 | struct device; | 32 | struct device; |
| @@ -63,9 +64,7 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *); | |||
| 63 | * @name: The name of the bus. | 64 | * @name: The name of the bus. |
| 64 | * @dev_name: Used for subsystems to enumerate devices like ("foo%u", dev->id). | 65 | * @dev_name: Used for subsystems to enumerate devices like ("foo%u", dev->id). |
| 65 | * @dev_root: Default device to use as the parent. | 66 | * @dev_root: Default device to use as the parent. |
| 66 | * @bus_attrs: Default attributes of the bus. | ||
| 67 | * @dev_attrs: Default attributes of the devices on the bus. | 67 | * @dev_attrs: Default attributes of the devices on the bus. |
| 68 | * @drv_attrs: Default attributes of the device drivers on the bus. | ||
| 69 | * @bus_groups: Default attributes of the bus. | 68 | * @bus_groups: Default attributes of the bus. |
| 70 | * @dev_groups: Default attributes of the devices on the bus. | 69 | * @dev_groups: Default attributes of the devices on the bus. |
| 71 | * @drv_groups: Default attributes of the device drivers on the bus. | 70 | * @drv_groups: Default attributes of the device drivers on the bus. |
| @@ -106,9 +105,7 @@ struct bus_type { | |||
| 106 | const char *name; | 105 | const char *name; |
| 107 | const char *dev_name; | 106 | const char *dev_name; |
| 108 | struct device *dev_root; | 107 | struct device *dev_root; |
| 109 | struct bus_attribute *bus_attrs; /* use bus_groups instead */ | ||
| 110 | struct device_attribute *dev_attrs; /* use dev_groups instead */ | 108 | struct device_attribute *dev_attrs; /* use dev_groups instead */ |
| 111 | struct driver_attribute *drv_attrs; /* use drv_groups instead */ | ||
| 112 | const struct attribute_group **bus_groups; | 109 | const struct attribute_group **bus_groups; |
| 113 | const struct attribute_group **dev_groups; | 110 | const struct attribute_group **dev_groups; |
| 114 | const struct attribute_group **drv_groups; | 111 | const struct attribute_group **drv_groups; |
| @@ -329,8 +326,6 @@ int subsys_virtual_register(struct bus_type *subsys, | |||
| 329 | * @owner: The module owner. | 326 | * @owner: The module owner. |
| 330 | * @class_attrs: Default attributes of this class. | 327 | * @class_attrs: Default attributes of this class. |
| 331 | * @dev_groups: Default attributes of the devices that belong to the class. | 328 | * @dev_groups: Default attributes of the devices that belong to the class. |
| 332 | * @dev_attrs: Default attributes of the devices belong to the class. | ||
| 333 | * @dev_bin_attrs: Default binary attributes of the devices belong to the class. | ||
| 334 | * @dev_kobj: The kobject that represents this class and links it into the hierarchy. | 329 | * @dev_kobj: The kobject that represents this class and links it into the hierarchy. |
| 335 | * @dev_uevent: Called when a device is added, removed from this class, or a | 330 | * @dev_uevent: Called when a device is added, removed from this class, or a |
| 336 | * few other things that generate uevents to add the environment | 331 | * few other things that generate uevents to add the environment |
| @@ -358,9 +353,7 @@ struct class { | |||
| 358 | struct module *owner; | 353 | struct module *owner; |
| 359 | 354 | ||
| 360 | struct class_attribute *class_attrs; | 355 | struct class_attribute *class_attrs; |
| 361 | struct device_attribute *dev_attrs; /* use dev_groups instead */ | ||
| 362 | const struct attribute_group **dev_groups; | 356 | const struct attribute_group **dev_groups; |
| 363 | struct bin_attribute *dev_bin_attrs; | ||
| 364 | struct kobject *dev_kobj; | 357 | struct kobject *dev_kobj; |
| 365 | 358 | ||
| 366 | int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env); | 359 | int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env); |
| @@ -427,8 +420,6 @@ struct class_attribute { | |||
| 427 | char *buf); | 420 | char *buf); |
| 428 | ssize_t (*store)(struct class *class, struct class_attribute *attr, | 421 | ssize_t (*store)(struct class *class, struct class_attribute *attr, |
| 429 | const char *buf, size_t count); | 422 | const char *buf, size_t count); |
| 430 | const void *(*namespace)(struct class *class, | ||
| 431 | const struct class_attribute *attr); | ||
| 432 | }; | 423 | }; |
| 433 | 424 | ||
| 434 | #define CLASS_ATTR(_name, _mode, _show, _store) \ | 425 | #define CLASS_ATTR(_name, _mode, _show, _store) \ |
| @@ -438,10 +429,24 @@ struct class_attribute { | |||
| 438 | #define CLASS_ATTR_RO(_name) \ | 429 | #define CLASS_ATTR_RO(_name) \ |
| 439 | struct class_attribute class_attr_##_name = __ATTR_RO(_name) | 430 | struct class_attribute class_attr_##_name = __ATTR_RO(_name) |
| 440 | 431 | ||
| 441 | extern int __must_check class_create_file(struct class *class, | 432 | extern int __must_check class_create_file_ns(struct class *class, |
| 442 | const struct class_attribute *attr); | 433 | const struct class_attribute *attr, |
| 443 | extern void class_remove_file(struct class *class, | 434 | const void *ns); |
| 444 | const struct class_attribute *attr); | 435 | extern void class_remove_file_ns(struct class *class, |
| 436 | const struct class_attribute *attr, | ||
| 437 | const void *ns); | ||
| 438 | |||
| 439 | static inline int __must_check class_create_file(struct class *class, | ||
| 440 | const struct class_attribute *attr) | ||
| 441 | { | ||
| 442 | return class_create_file_ns(class, attr, NULL); | ||
| 443 | } | ||
| 444 | |||
| 445 | static inline void class_remove_file(struct class *class, | ||
| 446 | const struct class_attribute *attr) | ||
| 447 | { | ||
| 448 | return class_remove_file_ns(class, attr, NULL); | ||
| 449 | } | ||
| 445 | 450 | ||
| 446 | /* Simple class attribute that is just a static string */ | 451 | /* Simple class attribute that is just a static string */ |
| 447 | struct class_attribute_string { | 452 | struct class_attribute_string { |
| @@ -602,8 +607,24 @@ extern void devres_close_group(struct device *dev, void *id); | |||
| 602 | extern void devres_remove_group(struct device *dev, void *id); | 607 | extern void devres_remove_group(struct device *dev, void *id); |
| 603 | extern int devres_release_group(struct device *dev, void *id); | 608 | extern int devres_release_group(struct device *dev, void *id); |
| 604 | 609 | ||
| 605 | /* managed kzalloc/kfree for device drivers, no kmalloc, always use kzalloc */ | 610 | /* managed devm_k.alloc/kfree for device drivers */ |
| 606 | extern void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp); | 611 | extern void *devm_kmalloc(struct device *dev, size_t size, gfp_t gfp); |
| 612 | static inline void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp) | ||
| 613 | { | ||
| 614 | return devm_kmalloc(dev, size, gfp | __GFP_ZERO); | ||
| 615 | } | ||
| 616 | static inline void *devm_kmalloc_array(struct device *dev, | ||
| 617 | size_t n, size_t size, gfp_t flags) | ||
| 618 | { | ||
| 619 | if (size != 0 && n > SIZE_MAX / size) | ||
| 620 | return NULL; | ||
| 621 | return devm_kmalloc(dev, n * size, flags); | ||
| 622 | } | ||
| 623 | static inline void *devm_kcalloc(struct device *dev, | ||
| 624 | size_t n, size_t size, gfp_t flags) | ||
| 625 | { | ||
| 626 | return devm_kmalloc_array(dev, n, size, flags | __GFP_ZERO); | ||
| 627 | } | ||
| 607 | extern void devm_kfree(struct device *dev, void *p); | 628 | extern void devm_kfree(struct device *dev, void *p); |
| 608 | 629 | ||
| 609 | void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res); | 630 | void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res); |
| @@ -1149,16 +1170,15 @@ do { \ | |||
| 1149 | #endif | 1170 | #endif |
| 1150 | 1171 | ||
| 1151 | /* | 1172 | /* |
| 1152 | * dev_WARN*() acts like dev_printk(), but with the key difference | 1173 | * dev_WARN*() acts like dev_printk(), but with the key difference of |
| 1153 | * of using a WARN/WARN_ON to get the message out, including the | 1174 | * using WARN/WARN_ONCE to include file/line information and a backtrace. |
| 1154 | * file/line information and a backtrace. | ||
| 1155 | */ | 1175 | */ |
| 1156 | #define dev_WARN(dev, format, arg...) \ | 1176 | #define dev_WARN(dev, format, arg...) \ |
| 1157 | WARN(1, "Device: %s\n" format, dev_driver_string(dev), ## arg); | 1177 | WARN(1, "%s %s: " format, dev_driver_string(dev), dev_name(dev), ## arg); |
| 1158 | 1178 | ||
| 1159 | #define dev_WARN_ONCE(dev, condition, format, arg...) \ | 1179 | #define dev_WARN_ONCE(dev, condition, format, arg...) \ |
| 1160 | WARN_ONCE(condition, "Device %s\n" format, \ | 1180 | WARN_ONCE(condition, "%s %s: " format, \ |
| 1161 | dev_driver_string(dev), ## arg) | 1181 | dev_driver_string(dev), dev_name(dev), ## arg) |
| 1162 | 1182 | ||
| 1163 | /* Create alias, so I can be autoloaded. */ | 1183 | /* Create alias, so I can be autoloaded. */ |
| 1164 | #define MODULE_ALIAS_CHARDEV(major,minor) \ | 1184 | #define MODULE_ALIAS_CHARDEV(major,minor) \ |
diff --git a/include/linux/dmi.h b/include/linux/dmi.h index b6eb7a05d58e..f820f0a336c9 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h | |||
| @@ -99,6 +99,7 @@ extern const char * dmi_get_system_info(int field); | |||
| 99 | extern const struct dmi_device * dmi_find_device(int type, const char *name, | 99 | extern const struct dmi_device * dmi_find_device(int type, const char *name, |
| 100 | const struct dmi_device *from); | 100 | const struct dmi_device *from); |
| 101 | extern void dmi_scan_machine(void); | 101 | extern void dmi_scan_machine(void); |
| 102 | extern void dmi_memdev_walk(void); | ||
| 102 | extern void dmi_set_dump_stack_arch_desc(void); | 103 | extern void dmi_set_dump_stack_arch_desc(void); |
| 103 | extern bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp); | 104 | extern bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp); |
| 104 | extern int dmi_name_in_vendors(const char *str); | 105 | extern int dmi_name_in_vendors(const char *str); |
| @@ -107,6 +108,7 @@ extern int dmi_available; | |||
| 107 | extern int dmi_walk(void (*decode)(const struct dmi_header *, void *), | 108 | extern int dmi_walk(void (*decode)(const struct dmi_header *, void *), |
| 108 | void *private_data); | 109 | void *private_data); |
| 109 | extern bool dmi_match(enum dmi_field f, const char *str); | 110 | extern bool dmi_match(enum dmi_field f, const char *str); |
| 111 | extern void dmi_memdev_name(u16 handle, const char **bank, const char **device); | ||
| 110 | 112 | ||
| 111 | #else | 113 | #else |
| 112 | 114 | ||
| @@ -115,6 +117,7 @@ static inline const char * dmi_get_system_info(int field) { return NULL; } | |||
| 115 | static inline const struct dmi_device * dmi_find_device(int type, const char *name, | 117 | static inline const struct dmi_device * dmi_find_device(int type, const char *name, |
| 116 | const struct dmi_device *from) { return NULL; } | 118 | const struct dmi_device *from) { return NULL; } |
| 117 | static inline void dmi_scan_machine(void) { return; } | 119 | static inline void dmi_scan_machine(void) { return; } |
| 120 | static inline void dmi_memdev_walk(void) { } | ||
| 118 | static inline void dmi_set_dump_stack_arch_desc(void) { } | 121 | static inline void dmi_set_dump_stack_arch_desc(void) { } |
| 119 | static inline bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp) | 122 | static inline bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp) |
| 120 | { | 123 | { |
| @@ -133,6 +136,8 @@ static inline int dmi_walk(void (*decode)(const struct dmi_header *, void *), | |||
| 133 | void *private_data) { return -1; } | 136 | void *private_data) { return -1; } |
| 134 | static inline bool dmi_match(enum dmi_field f, const char *str) | 137 | static inline bool dmi_match(enum dmi_field f, const char *str) |
| 135 | { return false; } | 138 | { return false; } |
| 139 | static inline void dmi_memdev_name(u16 handle, const char **bank, | ||
| 140 | const char **device) { } | ||
| 136 | static inline const struct dmi_system_id * | 141 | static inline const struct dmi_system_id * |
| 137 | dmi_first_match(const struct dmi_system_id *list) { return NULL; } | 142 | dmi_first_match(const struct dmi_system_id *list) { return NULL; } |
| 138 | 143 | ||
diff --git a/include/linux/edac.h b/include/linux/edac.h index 5c6d7fbaf89e..dbdffe8d4469 100644 --- a/include/linux/edac.h +++ b/include/linux/edac.h | |||
| @@ -51,7 +51,7 @@ static inline void opstate_init(void) | |||
| 51 | #define EDAC_MC_LABEL_LEN 31 | 51 | #define EDAC_MC_LABEL_LEN 31 |
| 52 | 52 | ||
| 53 | /* Maximum size of the location string */ | 53 | /* Maximum size of the location string */ |
| 54 | #define LOCATION_SIZE 80 | 54 | #define LOCATION_SIZE 256 |
| 55 | 55 | ||
| 56 | /* Defines the maximum number of labels that can be reported */ | 56 | /* Defines the maximum number of labels that can be reported */ |
| 57 | #define EDAC_MAX_LABELS 8 | 57 | #define EDAC_MAX_LABELS 8 |
diff --git a/include/linux/efi.h b/include/linux/efi.h index 5f8f176154f7..bc5687d0f315 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
| @@ -39,6 +39,8 @@ | |||
| 39 | typedef unsigned long efi_status_t; | 39 | typedef unsigned long efi_status_t; |
| 40 | typedef u8 efi_bool_t; | 40 | typedef u8 efi_bool_t; |
| 41 | typedef u16 efi_char16_t; /* UNICODE character */ | 41 | typedef u16 efi_char16_t; /* UNICODE character */ |
| 42 | typedef u64 efi_physical_addr_t; | ||
| 43 | typedef void *efi_handle_t; | ||
| 42 | 44 | ||
| 43 | 45 | ||
| 44 | typedef struct { | 46 | typedef struct { |
| @@ -96,6 +98,7 @@ typedef struct { | |||
| 96 | #define EFI_MEMORY_DESCRIPTOR_VERSION 1 | 98 | #define EFI_MEMORY_DESCRIPTOR_VERSION 1 |
| 97 | 99 | ||
| 98 | #define EFI_PAGE_SHIFT 12 | 100 | #define EFI_PAGE_SHIFT 12 |
| 101 | #define EFI_PAGE_SIZE (1UL << EFI_PAGE_SHIFT) | ||
| 99 | 102 | ||
| 100 | typedef struct { | 103 | typedef struct { |
| 101 | u32 type; | 104 | u32 type; |
| @@ -157,11 +160,13 @@ typedef struct { | |||
| 157 | efi_table_hdr_t hdr; | 160 | efi_table_hdr_t hdr; |
| 158 | void *raise_tpl; | 161 | void *raise_tpl; |
| 159 | void *restore_tpl; | 162 | void *restore_tpl; |
| 160 | void *allocate_pages; | 163 | efi_status_t (*allocate_pages)(int, int, unsigned long, |
| 161 | void *free_pages; | 164 | efi_physical_addr_t *); |
| 162 | void *get_memory_map; | 165 | efi_status_t (*free_pages)(efi_physical_addr_t, unsigned long); |
| 163 | void *allocate_pool; | 166 | efi_status_t (*get_memory_map)(unsigned long *, void *, unsigned long *, |
| 164 | void *free_pool; | 167 | unsigned long *, u32 *); |
| 168 | efi_status_t (*allocate_pool)(int, unsigned long, void **); | ||
| 169 | efi_status_t (*free_pool)(void *); | ||
| 165 | void *create_event; | 170 | void *create_event; |
| 166 | void *set_timer; | 171 | void *set_timer; |
| 167 | void *wait_for_event; | 172 | void *wait_for_event; |
| @@ -171,7 +176,7 @@ typedef struct { | |||
| 171 | void *install_protocol_interface; | 176 | void *install_protocol_interface; |
| 172 | void *reinstall_protocol_interface; | 177 | void *reinstall_protocol_interface; |
| 173 | void *uninstall_protocol_interface; | 178 | void *uninstall_protocol_interface; |
| 174 | void *handle_protocol; | 179 | efi_status_t (*handle_protocol)(efi_handle_t, efi_guid_t *, void **); |
| 175 | void *__reserved; | 180 | void *__reserved; |
| 176 | void *register_protocol_notify; | 181 | void *register_protocol_notify; |
| 177 | void *locate_handle; | 182 | void *locate_handle; |
| @@ -181,7 +186,7 @@ typedef struct { | |||
| 181 | void *start_image; | 186 | void *start_image; |
| 182 | void *exit; | 187 | void *exit; |
| 183 | void *unload_image; | 188 | void *unload_image; |
| 184 | void *exit_boot_services; | 189 | efi_status_t (*exit_boot_services)(efi_handle_t, unsigned long); |
| 185 | void *get_next_monotonic_count; | 190 | void *get_next_monotonic_count; |
| 186 | void *stall; | 191 | void *stall; |
| 187 | void *set_watchdog_timer; | 192 | void *set_watchdog_timer; |
| @@ -404,6 +409,12 @@ typedef struct { | |||
| 404 | unsigned long table; | 409 | unsigned long table; |
| 405 | } efi_config_table_t; | 410 | } efi_config_table_t; |
| 406 | 411 | ||
| 412 | typedef struct { | ||
| 413 | efi_guid_t guid; | ||
| 414 | const char *name; | ||
| 415 | unsigned long *ptr; | ||
| 416 | } efi_config_table_type_t; | ||
| 417 | |||
| 407 | #define EFI_SYSTEM_TABLE_SIGNATURE ((u64)0x5453595320494249ULL) | 418 | #define EFI_SYSTEM_TABLE_SIGNATURE ((u64)0x5453595320494249ULL) |
| 408 | 419 | ||
| 409 | #define EFI_2_30_SYSTEM_TABLE_REVISION ((2 << 16) | (30)) | 420 | #define EFI_2_30_SYSTEM_TABLE_REVISION ((2 << 16) | (30)) |
| @@ -488,10 +499,6 @@ typedef struct { | |||
| 488 | unsigned long unload; | 499 | unsigned long unload; |
| 489 | } efi_loaded_image_t; | 500 | } efi_loaded_image_t; |
| 490 | 501 | ||
| 491 | typedef struct { | ||
| 492 | u64 revision; | ||
| 493 | void *open_volume; | ||
| 494 | } efi_file_io_interface_t; | ||
| 495 | 502 | ||
| 496 | typedef struct { | 503 | typedef struct { |
| 497 | u64 size; | 504 | u64 size; |
| @@ -504,20 +511,30 @@ typedef struct { | |||
| 504 | efi_char16_t filename[1]; | 511 | efi_char16_t filename[1]; |
| 505 | } efi_file_info_t; | 512 | } efi_file_info_t; |
| 506 | 513 | ||
| 507 | typedef struct { | 514 | typedef struct _efi_file_handle { |
| 508 | u64 revision; | 515 | u64 revision; |
| 509 | void *open; | 516 | efi_status_t (*open)(struct _efi_file_handle *, |
| 510 | void *close; | 517 | struct _efi_file_handle **, |
| 518 | efi_char16_t *, u64, u64); | ||
| 519 | efi_status_t (*close)(struct _efi_file_handle *); | ||
| 511 | void *delete; | 520 | void *delete; |
| 512 | void *read; | 521 | efi_status_t (*read)(struct _efi_file_handle *, unsigned long *, |
| 522 | void *); | ||
| 513 | void *write; | 523 | void *write; |
| 514 | void *get_position; | 524 | void *get_position; |
| 515 | void *set_position; | 525 | void *set_position; |
| 516 | void *get_info; | 526 | efi_status_t (*get_info)(struct _efi_file_handle *, efi_guid_t *, |
| 527 | unsigned long *, void *); | ||
| 517 | void *set_info; | 528 | void *set_info; |
| 518 | void *flush; | 529 | void *flush; |
| 519 | } efi_file_handle_t; | 530 | } efi_file_handle_t; |
| 520 | 531 | ||
| 532 | typedef struct _efi_file_io_interface { | ||
| 533 | u64 revision; | ||
| 534 | int (*open_volume)(struct _efi_file_io_interface *, | ||
| 535 | efi_file_handle_t **); | ||
| 536 | } efi_file_io_interface_t; | ||
| 537 | |||
| 521 | #define EFI_FILE_MODE_READ 0x0000000000000001 | 538 | #define EFI_FILE_MODE_READ 0x0000000000000001 |
| 522 | #define EFI_FILE_MODE_WRITE 0x0000000000000002 | 539 | #define EFI_FILE_MODE_WRITE 0x0000000000000002 |
| 523 | #define EFI_FILE_MODE_CREATE 0x8000000000000000 | 540 | #define EFI_FILE_MODE_CREATE 0x8000000000000000 |
| @@ -552,6 +569,7 @@ extern struct efi { | |||
| 552 | efi_get_next_high_mono_count_t *get_next_high_mono_count; | 569 | efi_get_next_high_mono_count_t *get_next_high_mono_count; |
| 553 | efi_reset_system_t *reset_system; | 570 | efi_reset_system_t *reset_system; |
| 554 | efi_set_virtual_address_map_t *set_virtual_address_map; | 571 | efi_set_virtual_address_map_t *set_virtual_address_map; |
| 572 | struct efi_memory_map *memmap; | ||
| 555 | } efi; | 573 | } efi; |
| 556 | 574 | ||
| 557 | static inline int | 575 | static inline int |
| @@ -587,6 +605,7 @@ static inline efi_status_t efi_query_variable_store(u32 attributes, unsigned lon | |||
| 587 | } | 605 | } |
| 588 | #endif | 606 | #endif |
| 589 | extern void __iomem *efi_lookup_mapped_addr(u64 phys_addr); | 607 | extern void __iomem *efi_lookup_mapped_addr(u64 phys_addr); |
| 608 | extern int efi_config_init(efi_config_table_type_t *arch_tables); | ||
| 590 | extern u64 efi_get_iobase (void); | 609 | extern u64 efi_get_iobase (void); |
| 591 | extern u32 efi_mem_type (unsigned long phys_addr); | 610 | extern u32 efi_mem_type (unsigned long phys_addr); |
| 592 | extern u64 efi_mem_attributes (unsigned long phys_addr); | 611 | extern u64 efi_mem_attributes (unsigned long phys_addr); |
| @@ -784,6 +803,13 @@ struct efivar_entry { | |||
| 784 | struct kobject kobj; | 803 | struct kobject kobj; |
| 785 | }; | 804 | }; |
| 786 | 805 | ||
| 806 | |||
| 807 | struct efi_simple_text_output_protocol { | ||
| 808 | void *reset; | ||
| 809 | efi_status_t (*output_string)(void *, void *); | ||
| 810 | void *test_string; | ||
| 811 | }; | ||
| 812 | |||
| 787 | extern struct list_head efivar_sysfs_list; | 813 | extern struct list_head efivar_sysfs_list; |
| 788 | 814 | ||
| 789 | static inline void | 815 | static inline void |
diff --git a/include/linux/elf.h b/include/linux/elf.h index 40a3c0e01b2b..67a5fa7830c4 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h | |||
| @@ -39,13 +39,13 @@ extern Elf64_Dyn _DYNAMIC []; | |||
| 39 | 39 | ||
| 40 | /* Optional callbacks to write extra ELF notes. */ | 40 | /* Optional callbacks to write extra ELF notes. */ |
| 41 | struct file; | 41 | struct file; |
| 42 | struct coredump_params; | ||
| 42 | 43 | ||
| 43 | #ifndef ARCH_HAVE_EXTRA_ELF_NOTES | 44 | #ifndef ARCH_HAVE_EXTRA_ELF_NOTES |
| 44 | static inline int elf_coredump_extra_notes_size(void) { return 0; } | 45 | static inline int elf_coredump_extra_notes_size(void) { return 0; } |
| 45 | static inline int elf_coredump_extra_notes_write(struct file *file, | 46 | static inline int elf_coredump_extra_notes_write(struct coredump_params *cprm) { return 0; } |
| 46 | loff_t *foffset) { return 0; } | ||
| 47 | #else | 47 | #else |
| 48 | extern int elf_coredump_extra_notes_size(void); | 48 | extern int elf_coredump_extra_notes_size(void); |
| 49 | extern int elf_coredump_extra_notes_write(struct file *file, loff_t *foffset); | 49 | extern int elf_coredump_extra_notes_write(struct coredump_params *cprm); |
| 50 | #endif | 50 | #endif |
| 51 | #endif /* _LINUX_ELF_H */ | 51 | #endif /* _LINUX_ELF_H */ |
diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h index cdd3d13efce7..698d51a0eea3 100644 --- a/include/linux/elfcore.h +++ b/include/linux/elfcore.h | |||
| @@ -6,6 +6,8 @@ | |||
| 6 | #include <asm/elf.h> | 6 | #include <asm/elf.h> |
| 7 | #include <uapi/linux/elfcore.h> | 7 | #include <uapi/linux/elfcore.h> |
| 8 | 8 | ||
| 9 | struct coredump_params; | ||
| 10 | |||
| 9 | static inline void elf_core_copy_regs(elf_gregset_t *elfregs, struct pt_regs *regs) | 11 | static inline void elf_core_copy_regs(elf_gregset_t *elfregs, struct pt_regs *regs) |
| 10 | { | 12 | { |
| 11 | #ifdef ELF_CORE_COPY_REGS | 13 | #ifdef ELF_CORE_COPY_REGS |
| @@ -63,10 +65,9 @@ static inline int elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregse | |||
| 63 | */ | 65 | */ |
| 64 | extern Elf_Half elf_core_extra_phdrs(void); | 66 | extern Elf_Half elf_core_extra_phdrs(void); |
| 65 | extern int | 67 | extern int |
| 66 | elf_core_write_extra_phdrs(struct file *file, loff_t offset, size_t *size, | 68 | elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset); |
| 67 | unsigned long limit); | ||
| 68 | extern int | 69 | extern int |
| 69 | elf_core_write_extra_data(struct file *file, size_t *size, unsigned long limit); | 70 | elf_core_write_extra_data(struct coredump_params *cprm); |
| 70 | extern size_t elf_core_extra_data_size(void); | 71 | extern size_t elf_core_extra_data_size(void); |
| 71 | 72 | ||
| 72 | #endif /* _LINUX_ELFCORE_H */ | 73 | #endif /* _LINUX_ELFCORE_H */ |
diff --git a/include/linux/extcon.h b/include/linux/extcon.h index fcb51c88319f..21c59af1150b 100644 --- a/include/linux/extcon.h +++ b/include/linux/extcon.h | |||
| @@ -51,10 +51,10 @@ | |||
| 51 | enum extcon_cable_name { | 51 | enum extcon_cable_name { |
| 52 | EXTCON_USB = 0, | 52 | EXTCON_USB = 0, |
| 53 | EXTCON_USB_HOST, | 53 | EXTCON_USB_HOST, |
| 54 | EXTCON_TA, /* Travel Adaptor */ | 54 | EXTCON_TA, /* Travel Adaptor */ |
| 55 | EXTCON_FAST_CHARGER, | 55 | EXTCON_FAST_CHARGER, |
| 56 | EXTCON_SLOW_CHARGER, | 56 | EXTCON_SLOW_CHARGER, |
| 57 | EXTCON_CHARGE_DOWNSTREAM, /* Charging an external device */ | 57 | EXTCON_CHARGE_DOWNSTREAM, /* Charging an external device */ |
| 58 | EXTCON_HDMI, | 58 | EXTCON_HDMI, |
| 59 | EXTCON_MHL, | 59 | EXTCON_MHL, |
| 60 | EXTCON_DVI, | 60 | EXTCON_DVI, |
| @@ -76,8 +76,8 @@ struct extcon_cable; | |||
| 76 | 76 | ||
| 77 | /** | 77 | /** |
| 78 | * struct extcon_dev - An extcon device represents one external connector. | 78 | * struct extcon_dev - An extcon device represents one external connector. |
| 79 | * @name: The name of this extcon device. Parent device name is used | 79 | * @name: The name of this extcon device. Parent device name is |
| 80 | * if NULL. | 80 | * used if NULL. |
| 81 | * @supported_cable: Array of supported cable names ending with NULL. | 81 | * @supported_cable: Array of supported cable names ending with NULL. |
| 82 | * If supported_cable is NULL, cable name related APIs | 82 | * If supported_cable is NULL, cable name related APIs |
| 83 | * are disabled. | 83 | * are disabled. |
| @@ -89,21 +89,21 @@ struct extcon_cable; | |||
| 89 | * be attached simulataneously. {0x7, 0} is equivalent to | 89 | * be attached simulataneously. {0x7, 0} is equivalent to |
| 90 | * {0x3, 0x6, 0x5, 0}. If it is {0xFFFFFFFF, 0}, there | 90 | * {0x3, 0x6, 0x5, 0}. If it is {0xFFFFFFFF, 0}, there |
| 91 | * can be no simultaneous connections. | 91 | * can be no simultaneous connections. |
| 92 | * @print_name: An optional callback to override the method to print the | 92 | * @print_name: An optional callback to override the method to print the |
| 93 | * name of the extcon device. | 93 | * name of the extcon device. |
| 94 | * @print_state: An optional callback to override the method to print the | 94 | * @print_state: An optional callback to override the method to print the |
| 95 | * status of the extcon device. | 95 | * status of the extcon device. |
| 96 | * @dev: Device of this extcon. Do not provide at register-time. | 96 | * @dev: Device of this extcon. |
| 97 | * @state: Attach/detach state of this extcon. Do not provide at | 97 | * @state: Attach/detach state of this extcon. Do not provide at |
| 98 | * register-time | 98 | * register-time. |
| 99 | * @nh: Notifier for the state change events from this extcon | 99 | * @nh: Notifier for the state change events from this extcon |
| 100 | * @entry: To support list of extcon devices so that users can search | 100 | * @entry: To support list of extcon devices so that users can search |
| 101 | * for extcon devices based on the extcon name. | 101 | * for extcon devices based on the extcon name. |
| 102 | * @lock: | 102 | * @lock: |
| 103 | * @max_supported: Internal value to store the number of cables. | 103 | * @max_supported: Internal value to store the number of cables. |
| 104 | * @extcon_dev_type: Device_type struct to provide attribute_groups | 104 | * @extcon_dev_type: Device_type struct to provide attribute_groups |
| 105 | * customized for each extcon device. | 105 | * customized for each extcon device. |
| 106 | * @cables: Sysfs subdirectories. Each represents one cable. | 106 | * @cables: Sysfs subdirectories. Each represents one cable. |
| 107 | * | 107 | * |
| 108 | * In most cases, users only need to provide "User initializing data" of | 108 | * In most cases, users only need to provide "User initializing data" of |
| 109 | * this struct when registering an extcon. In some exceptional cases, | 109 | * this struct when registering an extcon. In some exceptional cases, |
| @@ -111,26 +111,27 @@ struct extcon_cable; | |||
| 111 | * are overwritten by register function. | 111 | * are overwritten by register function. |
| 112 | */ | 112 | */ |
| 113 | struct extcon_dev { | 113 | struct extcon_dev { |
| 114 | /* --- Optional user initializing data --- */ | 114 | /* Optional user initializing data */ |
| 115 | const char *name; | 115 | const char *name; |
| 116 | const char **supported_cable; | 116 | const char **supported_cable; |
| 117 | const u32 *mutually_exclusive; | 117 | const u32 *mutually_exclusive; |
| 118 | 118 | ||
| 119 | /* --- Optional callbacks to override class functions --- */ | 119 | /* Optional callbacks to override class functions */ |
| 120 | ssize_t (*print_name)(struct extcon_dev *edev, char *buf); | 120 | ssize_t (*print_name)(struct extcon_dev *edev, char *buf); |
| 121 | ssize_t (*print_state)(struct extcon_dev *edev, char *buf); | 121 | ssize_t (*print_state)(struct extcon_dev *edev, char *buf); |
| 122 | 122 | ||
| 123 | /* --- Internal data. Please do not set. --- */ | 123 | /* Internal data. Please do not set. */ |
| 124 | struct device *dev; | 124 | struct device dev; |
| 125 | u32 state; | ||
| 126 | struct raw_notifier_head nh; | 125 | struct raw_notifier_head nh; |
| 127 | struct list_head entry; | 126 | struct list_head entry; |
| 128 | spinlock_t lock; /* could be called by irq handler */ | ||
| 129 | int max_supported; | 127 | int max_supported; |
| 128 | spinlock_t lock; /* could be called by irq handler */ | ||
| 129 | u32 state; | ||
| 130 | 130 | ||
| 131 | /* /sys/class/extcon/.../cable.n/... */ | 131 | /* /sys/class/extcon/.../cable.n/... */ |
| 132 | struct device_type extcon_dev_type; | 132 | struct device_type extcon_dev_type; |
| 133 | struct extcon_cable *cables; | 133 | struct extcon_cable *cables; |
| 134 | |||
| 134 | /* /sys/class/extcon/.../mutually_exclusive/... */ | 135 | /* /sys/class/extcon/.../mutually_exclusive/... */ |
| 135 | struct attribute_group attr_g_muex; | 136 | struct attribute_group attr_g_muex; |
| 136 | struct attribute **attrs_muex; | 137 | struct attribute **attrs_muex; |
| @@ -138,13 +139,13 @@ struct extcon_dev { | |||
| 138 | }; | 139 | }; |
| 139 | 140 | ||
| 140 | /** | 141 | /** |
| 141 | * struct extcon_cable - An internal data for each cable of extcon device. | 142 | * struct extcon_cable - An internal data for each cable of extcon device. |
| 142 | * @edev: The extcon device | 143 | * @edev: The extcon device |
| 143 | * @cable_index: Index of this cable in the edev | 144 | * @cable_index: Index of this cable in the edev |
| 144 | * @attr_g: Attribute group for the cable | 145 | * @attr_g: Attribute group for the cable |
| 145 | * @attr_name: "name" sysfs entry | 146 | * @attr_name: "name" sysfs entry |
| 146 | * @attr_state: "state" sysfs entry | 147 | * @attr_state: "state" sysfs entry |
| 147 | * @attrs: Array pointing to attr_name and attr_state for attr_g | 148 | * @attrs: Array pointing to attr_name and attr_state for attr_g |
| 148 | */ | 149 | */ |
| 149 | struct extcon_cable { | 150 | struct extcon_cable { |
| 150 | struct extcon_dev *edev; | 151 | struct extcon_dev *edev; |
| @@ -159,11 +160,13 @@ struct extcon_cable { | |||
| 159 | 160 | ||
| 160 | /** | 161 | /** |
| 161 | * struct extcon_specific_cable_nb - An internal data for | 162 | * struct extcon_specific_cable_nb - An internal data for |
| 162 | * extcon_register_interest(). | 163 | * extcon_register_interest(). |
| 163 | * @internal_nb: a notifier block bridging extcon notifier and cable notifier. | 164 | * @internal_nb: A notifier block bridging extcon notifier |
| 164 | * @user_nb: user provided notifier block for events from a specific cable. | 165 | * and cable notifier. |
| 166 | * @user_nb: user provided notifier block for events from | ||
| 167 | * a specific cable. | ||
| 165 | * @cable_index: the target cable. | 168 | * @cable_index: the target cable. |
| 166 | * @edev: the target extcon device. | 169 | * @edev: the target extcon device. |
| 167 | * @previous_value: the saved previous event value. | 170 | * @previous_value: the saved previous event value. |
| 168 | */ | 171 | */ |
| 169 | struct extcon_specific_cable_nb { | 172 | struct extcon_specific_cable_nb { |
| @@ -180,7 +183,7 @@ struct extcon_specific_cable_nb { | |||
| 180 | * Following APIs are for notifiers or configurations. | 183 | * Following APIs are for notifiers or configurations. |
| 181 | * Notifiers are the external port and connection devices. | 184 | * Notifiers are the external port and connection devices. |
| 182 | */ | 185 | */ |
| 183 | extern int extcon_dev_register(struct extcon_dev *edev, struct device *dev); | 186 | extern int extcon_dev_register(struct extcon_dev *edev); |
| 184 | extern void extcon_dev_unregister(struct extcon_dev *edev); | 187 | extern void extcon_dev_unregister(struct extcon_dev *edev); |
| 185 | extern struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name); | 188 | extern struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name); |
| 186 | 189 | ||
| @@ -238,8 +241,7 @@ extern int extcon_register_notifier(struct extcon_dev *edev, | |||
| 238 | extern int extcon_unregister_notifier(struct extcon_dev *edev, | 241 | extern int extcon_unregister_notifier(struct extcon_dev *edev, |
| 239 | struct notifier_block *nb); | 242 | struct notifier_block *nb); |
| 240 | #else /* CONFIG_EXTCON */ | 243 | #else /* CONFIG_EXTCON */ |
| 241 | static inline int extcon_dev_register(struct extcon_dev *edev, | 244 | static inline int extcon_dev_register(struct extcon_dev *edev) |
| 242 | struct device *dev) | ||
| 243 | { | 245 | { |
| 244 | return 0; | 246 | return 0; |
| 245 | } | 247 | } |
diff --git a/include/linux/extcon/extcon-adc-jack.h b/include/linux/extcon/extcon-adc-jack.h index 20e9eef25d4c..9ca958c4e94c 100644 --- a/include/linux/extcon/extcon-adc-jack.h +++ b/include/linux/extcon/extcon-adc-jack.h | |||
| @@ -20,10 +20,10 @@ | |||
| 20 | 20 | ||
| 21 | /** | 21 | /** |
| 22 | * struct adc_jack_cond - condition to use an extcon state | 22 | * struct adc_jack_cond - condition to use an extcon state |
| 23 | * @state - the corresponding extcon state (if 0, this struct denotes | 23 | * @state: the corresponding extcon state (if 0, this struct |
| 24 | * the last adc_jack_cond element among the array) | 24 | * denotes the last adc_jack_cond element among the array) |
| 25 | * @min_adc - min adc value for this condition | 25 | * @min_adc: min adc value for this condition |
| 26 | * @max_adc - max adc value for this condition | 26 | * @max_adc: max adc value for this condition |
| 27 | * | 27 | * |
| 28 | * For example, if { .state = 0x3, .min_adc = 100, .max_adc = 200}, it means | 28 | * For example, if { .state = 0x3, .min_adc = 100, .max_adc = 200}, it means |
| 29 | * that if ADC value is between (inclusive) 100 and 200, than the cable 0 and | 29 | * that if ADC value is between (inclusive) 100 and 200, than the cable 0 and |
| @@ -33,34 +33,34 @@ | |||
| 33 | * because when no adc_jack_cond is met, state = 0 is automatically chosen. | 33 | * because when no adc_jack_cond is met, state = 0 is automatically chosen. |
| 34 | */ | 34 | */ |
| 35 | struct adc_jack_cond { | 35 | struct adc_jack_cond { |
| 36 | u32 state; /* extcon state value. 0 if invalid */ | 36 | u32 state; /* extcon state value. 0 if invalid */ |
| 37 | u32 min_adc; | 37 | u32 min_adc; |
| 38 | u32 max_adc; | 38 | u32 max_adc; |
| 39 | }; | 39 | }; |
| 40 | 40 | ||
| 41 | /** | 41 | /** |
| 42 | * struct adc_jack_pdata - platform data for adc jack device. | 42 | * struct adc_jack_pdata - platform data for adc jack device. |
| 43 | * @name - name of the extcon device. If null, "adc-jack" is used. | 43 | * @name: name of the extcon device. If null, "adc-jack" is used. |
| 44 | * @consumer_channel - Unique name to identify the channel on the consumer | 44 | * @consumer_channel: Unique name to identify the channel on the consumer |
| 45 | * side. This typically describes the channels used within | 45 | * side. This typically describes the channels used within |
| 46 | * the consumer. E.g. 'battery_voltage' | 46 | * the consumer. E.g. 'battery_voltage' |
| 47 | * @cable_names - array of cable names ending with null. | 47 | * @cable_names: array of cable names ending with null. |
| 48 | * @adc_contitions - array of struct adc_jack_cond conditions ending | 48 | * @adc_contitions: array of struct adc_jack_cond conditions ending |
| 49 | * with .state = 0 entry. This describes how to decode | 49 | * with .state = 0 entry. This describes how to decode |
| 50 | * adc values into extcon state. | 50 | * adc values into extcon state. |
| 51 | * @irq_flags - irq flags used for the @irq | 51 | * @irq_flags: irq flags used for the @irq |
| 52 | * @handling_delay_ms - in some devices, we need to read ADC value some | 52 | * @handling_delay_ms: in some devices, we need to read ADC value some |
| 53 | * milli-seconds after the interrupt occurs. You may | 53 | * milli-seconds after the interrupt occurs. You may |
| 54 | * describe such delays with @handling_delay_ms, which | 54 | * describe such delays with @handling_delay_ms, which |
| 55 | * is rounded-off by jiffies. | 55 | * is rounded-off by jiffies. |
| 56 | */ | 56 | */ |
| 57 | struct adc_jack_pdata { | 57 | struct adc_jack_pdata { |
| 58 | const char *name; | 58 | const char *name; |
| 59 | const char *consumer_channel; | 59 | const char *consumer_channel; |
| 60 | /* | 60 | |
| 61 | * The last entry should be NULL | 61 | /* The last entry should be NULL */ |
| 62 | */ | ||
| 63 | const char **cable_names; | 62 | const char **cable_names; |
| 63 | |||
| 64 | /* The last entry's state should be 0 */ | 64 | /* The last entry's state should be 0 */ |
| 65 | struct adc_jack_cond *adc_conditions; | 65 | struct adc_jack_cond *adc_conditions; |
| 66 | 66 | ||
diff --git a/include/linux/extcon/extcon-gpio.h b/include/linux/extcon/extcon-gpio.h index 2d8307f7d67d..4195810f87fe 100644 --- a/include/linux/extcon/extcon-gpio.h +++ b/include/linux/extcon/extcon-gpio.h | |||
| @@ -25,14 +25,17 @@ | |||
| 25 | 25 | ||
| 26 | /** | 26 | /** |
| 27 | * struct gpio_extcon_platform_data - A simple GPIO-controlled extcon device. | 27 | * struct gpio_extcon_platform_data - A simple GPIO-controlled extcon device. |
| 28 | * @name The name of this GPIO extcon device. | 28 | * @name: The name of this GPIO extcon device. |
| 29 | * @gpio Corresponding GPIO. | 29 | * @gpio: Corresponding GPIO. |
| 30 | * @debounce Debounce time for GPIO IRQ in ms. | 30 | * @gpio_active_low: Boolean describing whether gpio active state is 1 or 0 |
| 31 | * @irq_flags IRQ Flags (e.g., IRQF_TRIGGER_LOW). | 31 | * If true, low state of gpio means active. |
| 32 | * @state_on print_state is overriden with state_on if attached. If Null, | 32 | * If false, high state of gpio means active. |
| 33 | * default method of extcon class is used. | 33 | * @debounce: Debounce time for GPIO IRQ in ms. |
| 34 | * @state_off print_state is overriden with state_on if detached. If Null, | 34 | * @irq_flags: IRQ Flags (e.g., IRQF_TRIGGER_LOW). |
| 35 | * default method of extcon class is used. | 35 | * @state_on: print_state is overriden with state_on if attached. |
| 36 | * If NULL, default method of extcon class is used. | ||
| 37 | * @state_off: print_state is overriden with state_on if detached. | ||
| 38 | * If NUll, default method of extcon class is used. | ||
| 36 | * | 39 | * |
| 37 | * Note that in order for state_on or state_off to be valid, both state_on | 40 | * Note that in order for state_on or state_off to be valid, both state_on |
| 38 | * and state_off should be not NULL. If at least one of them is NULL, | 41 | * and state_off should be not NULL. If at least one of them is NULL, |
| @@ -41,6 +44,7 @@ | |||
| 41 | struct gpio_extcon_platform_data { | 44 | struct gpio_extcon_platform_data { |
| 42 | const char *name; | 45 | const char *name; |
| 43 | unsigned gpio; | 46 | unsigned gpio; |
| 47 | bool gpio_active_low; | ||
| 44 | unsigned long debounce; | 48 | unsigned long debounce; |
| 45 | unsigned long irq_flags; | 49 | unsigned long irq_flags; |
| 46 | 50 | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index 3f40547ba191..bf5d574ebdf4 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -623,10 +623,13 @@ static inline int inode_unhashed(struct inode *inode) | |||
| 623 | * 0: the object of the current VFS operation | 623 | * 0: the object of the current VFS operation |
| 624 | * 1: parent | 624 | * 1: parent |
| 625 | * 2: child/target | 625 | * 2: child/target |
| 626 | * 3: quota file | 626 | * 3: xattr |
| 627 | * 4: second non-directory | ||
| 628 | * The last is for certain operations (such as rename) which lock two | ||
| 629 | * non-directories at once. | ||
| 627 | * | 630 | * |
| 628 | * The locking order between these classes is | 631 | * The locking order between these classes is |
| 629 | * parent -> child -> normal -> xattr -> quota | 632 | * parent -> child -> normal -> xattr -> second non-directory |
| 630 | */ | 633 | */ |
| 631 | enum inode_i_mutex_lock_class | 634 | enum inode_i_mutex_lock_class |
| 632 | { | 635 | { |
| @@ -634,9 +637,12 @@ enum inode_i_mutex_lock_class | |||
| 634 | I_MUTEX_PARENT, | 637 | I_MUTEX_PARENT, |
| 635 | I_MUTEX_CHILD, | 638 | I_MUTEX_CHILD, |
| 636 | I_MUTEX_XATTR, | 639 | I_MUTEX_XATTR, |
| 637 | I_MUTEX_QUOTA | 640 | I_MUTEX_NONDIR2 |
| 638 | }; | 641 | }; |
| 639 | 642 | ||
| 643 | void lock_two_nondirectories(struct inode *, struct inode*); | ||
| 644 | void unlock_two_nondirectories(struct inode *, struct inode*); | ||
| 645 | |||
| 640 | /* | 646 | /* |
| 641 | * NOTE: in a 32bit arch with a preemptable kernel and | 647 | * NOTE: in a 32bit arch with a preemptable kernel and |
| 642 | * an UP compile the i_size_read/write must be atomic | 648 | * an UP compile the i_size_read/write must be atomic |
| @@ -764,12 +770,7 @@ static inline int ra_has_index(struct file_ra_state *ra, pgoff_t index) | |||
| 764 | #define FILE_MNT_WRITE_RELEASED 2 | 770 | #define FILE_MNT_WRITE_RELEASED 2 |
| 765 | 771 | ||
| 766 | struct file { | 772 | struct file { |
| 767 | /* | ||
| 768 | * fu_list becomes invalid after file_free is called and queued via | ||
| 769 | * fu_rcuhead for RCU freeing | ||
| 770 | */ | ||
| 771 | union { | 773 | union { |
| 772 | struct list_head fu_list; | ||
| 773 | struct llist_node fu_llist; | 774 | struct llist_node fu_llist; |
| 774 | struct rcu_head fu_rcuhead; | 775 | struct rcu_head fu_rcuhead; |
| 775 | } f_u; | 776 | } f_u; |
| @@ -783,9 +784,6 @@ struct file { | |||
| 783 | * Must not be taken from IRQ context. | 784 | * Must not be taken from IRQ context. |
| 784 | */ | 785 | */ |
| 785 | spinlock_t f_lock; | 786 | spinlock_t f_lock; |
| 786 | #ifdef CONFIG_SMP | ||
| 787 | int f_sb_list_cpu; | ||
| 788 | #endif | ||
| 789 | atomic_long_t f_count; | 787 | atomic_long_t f_count; |
| 790 | unsigned int f_flags; | 788 | unsigned int f_flags; |
| 791 | fmode_t f_mode; | 789 | fmode_t f_mode; |
| @@ -882,6 +880,7 @@ static inline int file_check_writeable(struct file *filp) | |||
| 882 | 880 | ||
| 883 | #define FL_POSIX 1 | 881 | #define FL_POSIX 1 |
| 884 | #define FL_FLOCK 2 | 882 | #define FL_FLOCK 2 |
| 883 | #define FL_DELEG 4 /* NFSv4 delegation */ | ||
| 885 | #define FL_ACCESS 8 /* not trying to lock, just looking */ | 884 | #define FL_ACCESS 8 /* not trying to lock, just looking */ |
| 886 | #define FL_EXISTS 16 /* when unlocking, test for existence */ | 885 | #define FL_EXISTS 16 /* when unlocking, test for existence */ |
| 887 | #define FL_LEASE 32 /* lease held on this file */ | 886 | #define FL_LEASE 32 /* lease held on this file */ |
| @@ -1023,7 +1022,7 @@ extern int vfs_test_lock(struct file *, struct file_lock *); | |||
| 1023 | extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *); | 1022 | extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *); |
| 1024 | extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl); | 1023 | extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl); |
| 1025 | extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); | 1024 | extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); |
| 1026 | extern int __break_lease(struct inode *inode, unsigned int flags); | 1025 | extern int __break_lease(struct inode *inode, unsigned int flags, unsigned int type); |
| 1027 | extern void lease_get_mtime(struct inode *, struct timespec *time); | 1026 | extern void lease_get_mtime(struct inode *, struct timespec *time); |
| 1028 | extern int generic_setlease(struct file *, long, struct file_lock **); | 1027 | extern int generic_setlease(struct file *, long, struct file_lock **); |
| 1029 | extern int vfs_setlease(struct file *, long, struct file_lock **); | 1028 | extern int vfs_setlease(struct file *, long, struct file_lock **); |
| @@ -1132,7 +1131,7 @@ static inline int flock_lock_file_wait(struct file *filp, | |||
| 1132 | return -ENOLCK; | 1131 | return -ENOLCK; |
| 1133 | } | 1132 | } |
| 1134 | 1133 | ||
| 1135 | static inline int __break_lease(struct inode *inode, unsigned int mode) | 1134 | static inline int __break_lease(struct inode *inode, unsigned int mode, unsigned int type) |
| 1136 | { | 1135 | { |
| 1137 | return 0; | 1136 | return 0; |
| 1138 | } | 1137 | } |
| @@ -1264,11 +1263,6 @@ struct super_block { | |||
| 1264 | 1263 | ||
| 1265 | struct list_head s_inodes; /* all inodes */ | 1264 | struct list_head s_inodes; /* all inodes */ |
| 1266 | struct hlist_bl_head s_anon; /* anonymous dentries for (nfs) exporting */ | 1265 | struct hlist_bl_head s_anon; /* anonymous dentries for (nfs) exporting */ |
| 1267 | #ifdef CONFIG_SMP | ||
| 1268 | struct list_head __percpu *s_files; | ||
| 1269 | #else | ||
| 1270 | struct list_head s_files; | ||
| 1271 | #endif | ||
| 1272 | struct list_head s_mounts; /* list of mounts; _not_ for fs use */ | 1266 | struct list_head s_mounts; /* list of mounts; _not_ for fs use */ |
| 1273 | struct block_device *s_bdev; | 1267 | struct block_device *s_bdev; |
| 1274 | struct backing_dev_info *s_bdi; | 1268 | struct backing_dev_info *s_bdi; |
| @@ -1330,6 +1324,7 @@ struct super_block { | |||
| 1330 | */ | 1324 | */ |
| 1331 | struct list_lru s_dentry_lru ____cacheline_aligned_in_smp; | 1325 | struct list_lru s_dentry_lru ____cacheline_aligned_in_smp; |
| 1332 | struct list_lru s_inode_lru ____cacheline_aligned_in_smp; | 1326 | struct list_lru s_inode_lru ____cacheline_aligned_in_smp; |
| 1327 | struct rcu_head rcu; | ||
| 1333 | }; | 1328 | }; |
| 1334 | 1329 | ||
| 1335 | extern struct timespec current_fs_time(struct super_block *sb); | 1330 | extern struct timespec current_fs_time(struct super_block *sb); |
| @@ -1458,10 +1453,10 @@ extern int vfs_create(struct inode *, struct dentry *, umode_t, bool); | |||
| 1458 | extern int vfs_mkdir(struct inode *, struct dentry *, umode_t); | 1453 | extern int vfs_mkdir(struct inode *, struct dentry *, umode_t); |
| 1459 | extern int vfs_mknod(struct inode *, struct dentry *, umode_t, dev_t); | 1454 | extern int vfs_mknod(struct inode *, struct dentry *, umode_t, dev_t); |
| 1460 | extern int vfs_symlink(struct inode *, struct dentry *, const char *); | 1455 | extern int vfs_symlink(struct inode *, struct dentry *, const char *); |
| 1461 | extern int vfs_link(struct dentry *, struct inode *, struct dentry *); | 1456 | extern int vfs_link(struct dentry *, struct inode *, struct dentry *, struct inode **); |
| 1462 | extern int vfs_rmdir(struct inode *, struct dentry *); | 1457 | extern int vfs_rmdir(struct inode *, struct dentry *); |
| 1463 | extern int vfs_unlink(struct inode *, struct dentry *); | 1458 | extern int vfs_unlink(struct inode *, struct dentry *, struct inode **); |
| 1464 | extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); | 1459 | extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *, struct inode **); |
| 1465 | 1460 | ||
| 1466 | /* | 1461 | /* |
| 1467 | * VFS dentry helper functions. | 1462 | * VFS dentry helper functions. |
| @@ -1875,6 +1870,17 @@ extern struct dentry *mount_pseudo(struct file_system_type *, char *, | |||
| 1875 | (((fops) && try_module_get((fops)->owner) ? (fops) : NULL)) | 1870 | (((fops) && try_module_get((fops)->owner) ? (fops) : NULL)) |
| 1876 | #define fops_put(fops) \ | 1871 | #define fops_put(fops) \ |
| 1877 | do { if (fops) module_put((fops)->owner); } while(0) | 1872 | do { if (fops) module_put((fops)->owner); } while(0) |
| 1873 | /* | ||
| 1874 | * This one is to be used *ONLY* from ->open() instances. | ||
| 1875 | * fops must be non-NULL, pinned down *and* module dependencies | ||
| 1876 | * should be sufficient to pin the caller down as well. | ||
| 1877 | */ | ||
| 1878 | #define replace_fops(f, fops) \ | ||
| 1879 | do { \ | ||
| 1880 | struct file *__file = (f); \ | ||
| 1881 | fops_put(__file->f_op); \ | ||
| 1882 | BUG_ON(!(__file->f_op = (fops))); \ | ||
| 1883 | } while(0) | ||
| 1878 | 1884 | ||
| 1879 | extern int register_filesystem(struct file_system_type *); | 1885 | extern int register_filesystem(struct file_system_type *); |
| 1880 | extern int unregister_filesystem(struct file_system_type *); | 1886 | extern int unregister_filesystem(struct file_system_type *); |
| @@ -1899,6 +1905,9 @@ extern bool fs_fully_visible(struct file_system_type *); | |||
| 1899 | 1905 | ||
| 1900 | extern int current_umask(void); | 1906 | extern int current_umask(void); |
| 1901 | 1907 | ||
| 1908 | extern void ihold(struct inode * inode); | ||
| 1909 | extern void iput(struct inode *); | ||
| 1910 | |||
| 1902 | /* /sys/fs */ | 1911 | /* /sys/fs */ |
| 1903 | extern struct kobject *fs_kobj; | 1912 | extern struct kobject *fs_kobj; |
| 1904 | 1913 | ||
| @@ -1955,9 +1964,39 @@ static inline int locks_verify_truncate(struct inode *inode, | |||
| 1955 | static inline int break_lease(struct inode *inode, unsigned int mode) | 1964 | static inline int break_lease(struct inode *inode, unsigned int mode) |
| 1956 | { | 1965 | { |
| 1957 | if (inode->i_flock) | 1966 | if (inode->i_flock) |
| 1958 | return __break_lease(inode, mode); | 1967 | return __break_lease(inode, mode, FL_LEASE); |
| 1959 | return 0; | 1968 | return 0; |
| 1960 | } | 1969 | } |
| 1970 | |||
| 1971 | static inline int break_deleg(struct inode *inode, unsigned int mode) | ||
| 1972 | { | ||
| 1973 | if (inode->i_flock) | ||
| 1974 | return __break_lease(inode, mode, FL_DELEG); | ||
| 1975 | return 0; | ||
| 1976 | } | ||
| 1977 | |||
| 1978 | static inline int try_break_deleg(struct inode *inode, struct inode **delegated_inode) | ||
| 1979 | { | ||
| 1980 | int ret; | ||
| 1981 | |||
| 1982 | ret = break_deleg(inode, O_WRONLY|O_NONBLOCK); | ||
| 1983 | if (ret == -EWOULDBLOCK && delegated_inode) { | ||
| 1984 | *delegated_inode = inode; | ||
| 1985 | ihold(inode); | ||
| 1986 | } | ||
| 1987 | return ret; | ||
| 1988 | } | ||
| 1989 | |||
| 1990 | static inline int break_deleg_wait(struct inode **delegated_inode) | ||
| 1991 | { | ||
| 1992 | int ret; | ||
| 1993 | |||
| 1994 | ret = break_deleg(*delegated_inode, O_WRONLY); | ||
| 1995 | iput(*delegated_inode); | ||
| 1996 | *delegated_inode = NULL; | ||
| 1997 | return ret; | ||
| 1998 | } | ||
| 1999 | |||
| 1961 | #else /* !CONFIG_FILE_LOCKING */ | 2000 | #else /* !CONFIG_FILE_LOCKING */ |
| 1962 | static inline int locks_mandatory_locked(struct inode *inode) | 2001 | static inline int locks_mandatory_locked(struct inode *inode) |
| 1963 | { | 2002 | { |
| @@ -1997,6 +2036,22 @@ static inline int break_lease(struct inode *inode, unsigned int mode) | |||
| 1997 | return 0; | 2036 | return 0; |
| 1998 | } | 2037 | } |
| 1999 | 2038 | ||
| 2039 | static inline int break_deleg(struct inode *inode, unsigned int mode) | ||
| 2040 | { | ||
| 2041 | return 0; | ||
| 2042 | } | ||
| 2043 | |||
| 2044 | static inline int try_break_deleg(struct inode *inode, struct inode **delegated_inode) | ||
| 2045 | { | ||
| 2046 | return 0; | ||
| 2047 | } | ||
| 2048 | |||
| 2049 | static inline int break_deleg_wait(struct inode **delegated_inode) | ||
| 2050 | { | ||
| 2051 | BUG(); | ||
| 2052 | return 0; | ||
| 2053 | } | ||
| 2054 | |||
| 2000 | #endif /* CONFIG_FILE_LOCKING */ | 2055 | #endif /* CONFIG_FILE_LOCKING */ |
| 2001 | 2056 | ||
| 2002 | /* fs/open.c */ | 2057 | /* fs/open.c */ |
| @@ -2223,7 +2278,7 @@ extern void emergency_remount(void); | |||
| 2223 | #ifdef CONFIG_BLOCK | 2278 | #ifdef CONFIG_BLOCK |
| 2224 | extern sector_t bmap(struct inode *, sector_t); | 2279 | extern sector_t bmap(struct inode *, sector_t); |
| 2225 | #endif | 2280 | #endif |
| 2226 | extern int notify_change(struct dentry *, struct iattr *); | 2281 | extern int notify_change(struct dentry *, struct iattr *, struct inode **); |
| 2227 | extern int inode_permission(struct inode *, int); | 2282 | extern int inode_permission(struct inode *, int); |
| 2228 | extern int generic_permission(struct inode *, int); | 2283 | extern int generic_permission(struct inode *, int); |
| 2229 | 2284 | ||
| @@ -2292,6 +2347,11 @@ static inline void allow_write_access(struct file *file) | |||
| 2292 | if (file) | 2347 | if (file) |
| 2293 | atomic_inc(&file_inode(file)->i_writecount); | 2348 | atomic_inc(&file_inode(file)->i_writecount); |
| 2294 | } | 2349 | } |
| 2350 | static inline bool inode_is_open_for_write(const struct inode *inode) | ||
| 2351 | { | ||
| 2352 | return atomic_read(&inode->i_writecount) > 0; | ||
| 2353 | } | ||
| 2354 | |||
| 2295 | #ifdef CONFIG_IMA | 2355 | #ifdef CONFIG_IMA |
| 2296 | static inline void i_readcount_dec(struct inode *inode) | 2356 | static inline void i_readcount_dec(struct inode *inode) |
| 2297 | { | 2357 | { |
| @@ -2332,8 +2392,6 @@ extern loff_t vfs_llseek(struct file *file, loff_t offset, int whence); | |||
| 2332 | extern int inode_init_always(struct super_block *, struct inode *); | 2392 | extern int inode_init_always(struct super_block *, struct inode *); |
| 2333 | extern void inode_init_once(struct inode *); | 2393 | extern void inode_init_once(struct inode *); |
| 2334 | extern void address_space_init_once(struct address_space *mapping); | 2394 | extern void address_space_init_once(struct address_space *mapping); |
| 2335 | extern void ihold(struct inode * inode); | ||
| 2336 | extern void iput(struct inode *); | ||
| 2337 | extern struct inode * igrab(struct inode *); | 2395 | extern struct inode * igrab(struct inode *); |
| 2338 | extern ino_t iunique(struct super_block *, ino_t); | 2396 | extern ino_t iunique(struct super_block *, ino_t); |
| 2339 | extern int inode_needs_sync(struct inode *inode); | 2397 | extern int inode_needs_sync(struct inode *inode); |
| @@ -2502,8 +2560,10 @@ extern int __page_symlink(struct inode *inode, const char *symname, int len, | |||
| 2502 | int nofs); | 2560 | int nofs); |
| 2503 | extern int page_symlink(struct inode *inode, const char *symname, int len); | 2561 | extern int page_symlink(struct inode *inode, const char *symname, int len); |
| 2504 | extern const struct inode_operations page_symlink_inode_operations; | 2562 | extern const struct inode_operations page_symlink_inode_operations; |
| 2563 | extern void kfree_put_link(struct dentry *, struct nameidata *, void *); | ||
| 2505 | extern int generic_readlink(struct dentry *, char __user *, int); | 2564 | extern int generic_readlink(struct dentry *, char __user *, int); |
| 2506 | extern void generic_fillattr(struct inode *, struct kstat *); | 2565 | extern void generic_fillattr(struct inode *, struct kstat *); |
| 2566 | int vfs_getattr_nosec(struct path *path, struct kstat *stat); | ||
| 2507 | extern int vfs_getattr(struct path *, struct kstat *); | 2567 | extern int vfs_getattr(struct path *, struct kstat *); |
| 2508 | void __inode_add_bytes(struct inode *inode, loff_t bytes); | 2568 | void __inode_add_bytes(struct inode *inode, loff_t bytes); |
| 2509 | void inode_add_bytes(struct inode *inode, loff_t bytes); | 2569 | void inode_add_bytes(struct inode *inode, loff_t bytes); |
| @@ -2562,6 +2622,7 @@ extern int simple_write_begin(struct file *file, struct address_space *mapping, | |||
| 2562 | extern int simple_write_end(struct file *file, struct address_space *mapping, | 2622 | extern int simple_write_end(struct file *file, struct address_space *mapping, |
| 2563 | loff_t pos, unsigned len, unsigned copied, | 2623 | loff_t pos, unsigned len, unsigned copied, |
| 2564 | struct page *page, void *fsdata); | 2624 | struct page *page, void *fsdata); |
| 2625 | extern struct inode *alloc_anon_inode(struct super_block *); | ||
| 2565 | 2626 | ||
| 2566 | extern struct dentry *simple_lookup(struct inode *, struct dentry *, unsigned int flags); | 2627 | extern struct dentry *simple_lookup(struct inode *, struct dentry *, unsigned int flags); |
| 2567 | extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); | 2628 | extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); |
diff --git a/include/linux/fscache-cache.h b/include/linux/fscache-cache.h index 7823e9ef995e..771484993ca7 100644 --- a/include/linux/fscache-cache.h +++ b/include/linux/fscache-cache.h | |||
| @@ -308,36 +308,6 @@ struct fscache_cache_ops { | |||
| 308 | void (*dissociate_pages)(struct fscache_cache *cache); | 308 | void (*dissociate_pages)(struct fscache_cache *cache); |
| 309 | }; | 309 | }; |
| 310 | 310 | ||
| 311 | /* | ||
| 312 | * data file or index object cookie | ||
| 313 | * - a file will only appear in one cache | ||
| 314 | * - a request to cache a file may or may not be honoured, subject to | ||
| 315 | * constraints such as disk space | ||
| 316 | * - indices are created on disk just-in-time | ||
| 317 | */ | ||
| 318 | struct fscache_cookie { | ||
| 319 | atomic_t usage; /* number of users of this cookie */ | ||
| 320 | atomic_t n_children; /* number of children of this cookie */ | ||
| 321 | atomic_t n_active; /* number of active users of netfs ptrs */ | ||
| 322 | spinlock_t lock; | ||
| 323 | spinlock_t stores_lock; /* lock on page store tree */ | ||
| 324 | struct hlist_head backing_objects; /* object(s) backing this file/index */ | ||
| 325 | const struct fscache_cookie_def *def; /* definition */ | ||
| 326 | struct fscache_cookie *parent; /* parent of this entry */ | ||
| 327 | void *netfs_data; /* back pointer to netfs */ | ||
| 328 | struct radix_tree_root stores; /* pages to be stored on this cookie */ | ||
| 329 | #define FSCACHE_COOKIE_PENDING_TAG 0 /* pages tag: pending write to cache */ | ||
| 330 | #define FSCACHE_COOKIE_STORING_TAG 1 /* pages tag: writing to cache */ | ||
| 331 | |||
| 332 | unsigned long flags; | ||
| 333 | #define FSCACHE_COOKIE_LOOKING_UP 0 /* T if non-index cookie being looked up still */ | ||
| 334 | #define FSCACHE_COOKIE_NO_DATA_YET 1 /* T if new object with no cached data yet */ | ||
| 335 | #define FSCACHE_COOKIE_UNAVAILABLE 2 /* T if cookie is unavailable (error, etc) */ | ||
| 336 | #define FSCACHE_COOKIE_INVALIDATING 3 /* T if cookie is being invalidated */ | ||
| 337 | #define FSCACHE_COOKIE_RELINQUISHED 4 /* T if cookie has been relinquished */ | ||
| 338 | #define FSCACHE_COOKIE_RETIRED 5 /* T if cookie was retired */ | ||
| 339 | }; | ||
| 340 | |||
| 341 | extern struct fscache_cookie fscache_fsdef_index; | 311 | extern struct fscache_cookie fscache_fsdef_index; |
| 342 | 312 | ||
| 343 | /* | 313 | /* |
| @@ -400,6 +370,7 @@ struct fscache_object { | |||
| 400 | #define FSCACHE_OBJECT_IS_LIVE 3 /* T if object is not withdrawn or relinquished */ | 370 | #define FSCACHE_OBJECT_IS_LIVE 3 /* T if object is not withdrawn or relinquished */ |
| 401 | #define FSCACHE_OBJECT_IS_LOOKED_UP 4 /* T if object has been looked up */ | 371 | #define FSCACHE_OBJECT_IS_LOOKED_UP 4 /* T if object has been looked up */ |
| 402 | #define FSCACHE_OBJECT_IS_AVAILABLE 5 /* T if object has become active */ | 372 | #define FSCACHE_OBJECT_IS_AVAILABLE 5 /* T if object has become active */ |
| 373 | #define FSCACHE_OBJECT_RETIRED 6 /* T if object was retired on relinquishment */ | ||
| 403 | 374 | ||
| 404 | struct list_head cache_link; /* link in cache->object_list */ | 375 | struct list_head cache_link; /* link in cache->object_list */ |
| 405 | struct hlist_node cookie_link; /* link in cookie->backing_objects */ | 376 | struct hlist_node cookie_link; /* link in cookie->backing_objects */ |
| @@ -511,6 +482,11 @@ static inline void fscache_end_io(struct fscache_retrieval *op, | |||
| 511 | op->end_io_func(page, op->context, error); | 482 | op->end_io_func(page, op->context, error); |
| 512 | } | 483 | } |
| 513 | 484 | ||
| 485 | static inline void __fscache_use_cookie(struct fscache_cookie *cookie) | ||
| 486 | { | ||
| 487 | atomic_inc(&cookie->n_active); | ||
| 488 | } | ||
| 489 | |||
| 514 | /** | 490 | /** |
| 515 | * fscache_use_cookie - Request usage of cookie attached to an object | 491 | * fscache_use_cookie - Request usage of cookie attached to an object |
| 516 | * @object: Object description | 492 | * @object: Object description |
| @@ -524,6 +500,16 @@ static inline bool fscache_use_cookie(struct fscache_object *object) | |||
| 524 | return atomic_inc_not_zero(&cookie->n_active) != 0; | 500 | return atomic_inc_not_zero(&cookie->n_active) != 0; |
| 525 | } | 501 | } |
| 526 | 502 | ||
| 503 | static inline bool __fscache_unuse_cookie(struct fscache_cookie *cookie) | ||
| 504 | { | ||
| 505 | return atomic_dec_and_test(&cookie->n_active); | ||
| 506 | } | ||
| 507 | |||
| 508 | static inline void __fscache_wake_unused_cookie(struct fscache_cookie *cookie) | ||
| 509 | { | ||
| 510 | wake_up_atomic_t(&cookie->n_active); | ||
| 511 | } | ||
| 512 | |||
| 527 | /** | 513 | /** |
| 528 | * fscache_unuse_cookie - Cease usage of cookie attached to an object | 514 | * fscache_unuse_cookie - Cease usage of cookie attached to an object |
| 529 | * @object: Object description | 515 | * @object: Object description |
| @@ -534,8 +520,8 @@ static inline bool fscache_use_cookie(struct fscache_object *object) | |||
| 534 | static inline void fscache_unuse_cookie(struct fscache_object *object) | 520 | static inline void fscache_unuse_cookie(struct fscache_object *object) |
| 535 | { | 521 | { |
| 536 | struct fscache_cookie *cookie = object->cookie; | 522 | struct fscache_cookie *cookie = object->cookie; |
| 537 | if (atomic_dec_and_test(&cookie->n_active)) | 523 | if (__fscache_unuse_cookie(cookie)) |
| 538 | wake_up_atomic_t(&cookie->n_active); | 524 | __fscache_wake_unused_cookie(cookie); |
| 539 | } | 525 | } |
| 540 | 526 | ||
| 541 | /* | 527 | /* |
diff --git a/include/linux/fscache.h b/include/linux/fscache.h index 19b46458e4e8..115bb81912cc 100644 --- a/include/linux/fscache.h +++ b/include/linux/fscache.h | |||
| @@ -167,6 +167,42 @@ struct fscache_netfs { | |||
| 167 | }; | 167 | }; |
| 168 | 168 | ||
| 169 | /* | 169 | /* |
| 170 | * data file or index object cookie | ||
| 171 | * - a file will only appear in one cache | ||
| 172 | * - a request to cache a file may or may not be honoured, subject to | ||
| 173 | * constraints such as disk space | ||
| 174 | * - indices are created on disk just-in-time | ||
| 175 | */ | ||
| 176 | struct fscache_cookie { | ||
| 177 | atomic_t usage; /* number of users of this cookie */ | ||
| 178 | atomic_t n_children; /* number of children of this cookie */ | ||
| 179 | atomic_t n_active; /* number of active users of netfs ptrs */ | ||
| 180 | spinlock_t lock; | ||
| 181 | spinlock_t stores_lock; /* lock on page store tree */ | ||
| 182 | struct hlist_head backing_objects; /* object(s) backing this file/index */ | ||
| 183 | const struct fscache_cookie_def *def; /* definition */ | ||
| 184 | struct fscache_cookie *parent; /* parent of this entry */ | ||
| 185 | void *netfs_data; /* back pointer to netfs */ | ||
| 186 | struct radix_tree_root stores; /* pages to be stored on this cookie */ | ||
| 187 | #define FSCACHE_COOKIE_PENDING_TAG 0 /* pages tag: pending write to cache */ | ||
| 188 | #define FSCACHE_COOKIE_STORING_TAG 1 /* pages tag: writing to cache */ | ||
| 189 | |||
| 190 | unsigned long flags; | ||
| 191 | #define FSCACHE_COOKIE_LOOKING_UP 0 /* T if non-index cookie being looked up still */ | ||
| 192 | #define FSCACHE_COOKIE_NO_DATA_YET 1 /* T if new object with no cached data yet */ | ||
| 193 | #define FSCACHE_COOKIE_UNAVAILABLE 2 /* T if cookie is unavailable (error, etc) */ | ||
| 194 | #define FSCACHE_COOKIE_INVALIDATING 3 /* T if cookie is being invalidated */ | ||
| 195 | #define FSCACHE_COOKIE_RELINQUISHED 4 /* T if cookie has been relinquished */ | ||
| 196 | #define FSCACHE_COOKIE_ENABLED 5 /* T if cookie is enabled */ | ||
| 197 | #define FSCACHE_COOKIE_ENABLEMENT_LOCK 6 /* T if cookie is being en/disabled */ | ||
| 198 | }; | ||
| 199 | |||
| 200 | static inline bool fscache_cookie_enabled(struct fscache_cookie *cookie) | ||
| 201 | { | ||
| 202 | return test_bit(FSCACHE_COOKIE_ENABLED, &cookie->flags); | ||
| 203 | } | ||
| 204 | |||
| 205 | /* | ||
| 170 | * slow-path functions for when there is actually caching available, and the | 206 | * slow-path functions for when there is actually caching available, and the |
| 171 | * netfs does actually have a valid token | 207 | * netfs does actually have a valid token |
| 172 | * - these are not to be called directly | 208 | * - these are not to be called directly |
| @@ -181,8 +217,8 @@ extern void __fscache_release_cache_tag(struct fscache_cache_tag *); | |||
| 181 | extern struct fscache_cookie *__fscache_acquire_cookie( | 217 | extern struct fscache_cookie *__fscache_acquire_cookie( |
| 182 | struct fscache_cookie *, | 218 | struct fscache_cookie *, |
| 183 | const struct fscache_cookie_def *, | 219 | const struct fscache_cookie_def *, |
| 184 | void *); | 220 | void *, bool); |
| 185 | extern void __fscache_relinquish_cookie(struct fscache_cookie *, int); | 221 | extern void __fscache_relinquish_cookie(struct fscache_cookie *, bool); |
| 186 | extern int __fscache_check_consistency(struct fscache_cookie *); | 222 | extern int __fscache_check_consistency(struct fscache_cookie *); |
| 187 | extern void __fscache_update_cookie(struct fscache_cookie *); | 223 | extern void __fscache_update_cookie(struct fscache_cookie *); |
| 188 | extern int __fscache_attr_changed(struct fscache_cookie *); | 224 | extern int __fscache_attr_changed(struct fscache_cookie *); |
| @@ -211,6 +247,9 @@ extern void __fscache_uncache_all_inode_pages(struct fscache_cookie *, | |||
| 211 | struct inode *); | 247 | struct inode *); |
| 212 | extern void __fscache_readpages_cancel(struct fscache_cookie *cookie, | 248 | extern void __fscache_readpages_cancel(struct fscache_cookie *cookie, |
| 213 | struct list_head *pages); | 249 | struct list_head *pages); |
| 250 | extern void __fscache_disable_cookie(struct fscache_cookie *, bool); | ||
| 251 | extern void __fscache_enable_cookie(struct fscache_cookie *, | ||
| 252 | bool (*)(void *), void *); | ||
| 214 | 253 | ||
| 215 | /** | 254 | /** |
| 216 | * fscache_register_netfs - Register a filesystem as desiring caching services | 255 | * fscache_register_netfs - Register a filesystem as desiring caching services |
| @@ -289,6 +328,7 @@ void fscache_release_cache_tag(struct fscache_cache_tag *tag) | |||
| 289 | * @def: A description of the cache object, including callback operations | 328 | * @def: A description of the cache object, including callback operations |
| 290 | * @netfs_data: An arbitrary piece of data to be kept in the cookie to | 329 | * @netfs_data: An arbitrary piece of data to be kept in the cookie to |
| 291 | * represent the cache object to the netfs | 330 | * represent the cache object to the netfs |
| 331 | * @enable: Whether or not to enable a data cookie immediately | ||
| 292 | * | 332 | * |
| 293 | * This function is used to inform FS-Cache about part of an index hierarchy | 333 | * This function is used to inform FS-Cache about part of an index hierarchy |
| 294 | * that can be used to locate files. This is done by requesting a cookie for | 334 | * that can be used to locate files. This is done by requesting a cookie for |
| @@ -301,10 +341,12 @@ static inline | |||
| 301 | struct fscache_cookie *fscache_acquire_cookie( | 341 | struct fscache_cookie *fscache_acquire_cookie( |
| 302 | struct fscache_cookie *parent, | 342 | struct fscache_cookie *parent, |
| 303 | const struct fscache_cookie_def *def, | 343 | const struct fscache_cookie_def *def, |
| 304 | void *netfs_data) | 344 | void *netfs_data, |
| 345 | bool enable) | ||
| 305 | { | 346 | { |
| 306 | if (fscache_cookie_valid(parent)) | 347 | if (fscache_cookie_valid(parent) && fscache_cookie_enabled(parent)) |
| 307 | return __fscache_acquire_cookie(parent, def, netfs_data); | 348 | return __fscache_acquire_cookie(parent, def, netfs_data, |
| 349 | enable); | ||
| 308 | else | 350 | else |
| 309 | return NULL; | 351 | return NULL; |
| 310 | } | 352 | } |
| @@ -322,7 +364,7 @@ struct fscache_cookie *fscache_acquire_cookie( | |||
| 322 | * description. | 364 | * description. |
| 323 | */ | 365 | */ |
| 324 | static inline | 366 | static inline |
| 325 | void fscache_relinquish_cookie(struct fscache_cookie *cookie, int retire) | 367 | void fscache_relinquish_cookie(struct fscache_cookie *cookie, bool retire) |
| 326 | { | 368 | { |
| 327 | if (fscache_cookie_valid(cookie)) | 369 | if (fscache_cookie_valid(cookie)) |
| 328 | __fscache_relinquish_cookie(cookie, retire); | 370 | __fscache_relinquish_cookie(cookie, retire); |
| @@ -341,7 +383,7 @@ void fscache_relinquish_cookie(struct fscache_cookie *cookie, int retire) | |||
| 341 | static inline | 383 | static inline |
| 342 | int fscache_check_consistency(struct fscache_cookie *cookie) | 384 | int fscache_check_consistency(struct fscache_cookie *cookie) |
| 343 | { | 385 | { |
| 344 | if (fscache_cookie_valid(cookie)) | 386 | if (fscache_cookie_valid(cookie) && fscache_cookie_enabled(cookie)) |
| 345 | return __fscache_check_consistency(cookie); | 387 | return __fscache_check_consistency(cookie); |
| 346 | else | 388 | else |
| 347 | return 0; | 389 | return 0; |
| @@ -360,7 +402,7 @@ int fscache_check_consistency(struct fscache_cookie *cookie) | |||
| 360 | static inline | 402 | static inline |
| 361 | void fscache_update_cookie(struct fscache_cookie *cookie) | 403 | void fscache_update_cookie(struct fscache_cookie *cookie) |
| 362 | { | 404 | { |
| 363 | if (fscache_cookie_valid(cookie)) | 405 | if (fscache_cookie_valid(cookie) && fscache_cookie_enabled(cookie)) |
| 364 | __fscache_update_cookie(cookie); | 406 | __fscache_update_cookie(cookie); |
| 365 | } | 407 | } |
| 366 | 408 | ||
| @@ -407,7 +449,7 @@ void fscache_unpin_cookie(struct fscache_cookie *cookie) | |||
| 407 | static inline | 449 | static inline |
| 408 | int fscache_attr_changed(struct fscache_cookie *cookie) | 450 | int fscache_attr_changed(struct fscache_cookie *cookie) |
| 409 | { | 451 | { |
| 410 | if (fscache_cookie_valid(cookie)) | 452 | if (fscache_cookie_valid(cookie) && fscache_cookie_enabled(cookie)) |
| 411 | return __fscache_attr_changed(cookie); | 453 | return __fscache_attr_changed(cookie); |
| 412 | else | 454 | else |
| 413 | return -ENOBUFS; | 455 | return -ENOBUFS; |
| @@ -429,7 +471,7 @@ int fscache_attr_changed(struct fscache_cookie *cookie) | |||
| 429 | static inline | 471 | static inline |
| 430 | void fscache_invalidate(struct fscache_cookie *cookie) | 472 | void fscache_invalidate(struct fscache_cookie *cookie) |
| 431 | { | 473 | { |
| 432 | if (fscache_cookie_valid(cookie)) | 474 | if (fscache_cookie_valid(cookie) && fscache_cookie_enabled(cookie)) |
| 433 | __fscache_invalidate(cookie); | 475 | __fscache_invalidate(cookie); |
| 434 | } | 476 | } |
| 435 | 477 | ||
| @@ -503,7 +545,7 @@ int fscache_read_or_alloc_page(struct fscache_cookie *cookie, | |||
| 503 | void *context, | 545 | void *context, |
| 504 | gfp_t gfp) | 546 | gfp_t gfp) |
| 505 | { | 547 | { |
| 506 | if (fscache_cookie_valid(cookie)) | 548 | if (fscache_cookie_valid(cookie) && fscache_cookie_enabled(cookie)) |
| 507 | return __fscache_read_or_alloc_page(cookie, page, end_io_func, | 549 | return __fscache_read_or_alloc_page(cookie, page, end_io_func, |
| 508 | context, gfp); | 550 | context, gfp); |
| 509 | else | 551 | else |
| @@ -554,7 +596,7 @@ int fscache_read_or_alloc_pages(struct fscache_cookie *cookie, | |||
| 554 | void *context, | 596 | void *context, |
| 555 | gfp_t gfp) | 597 | gfp_t gfp) |
| 556 | { | 598 | { |
| 557 | if (fscache_cookie_valid(cookie)) | 599 | if (fscache_cookie_valid(cookie) && fscache_cookie_enabled(cookie)) |
| 558 | return __fscache_read_or_alloc_pages(cookie, mapping, pages, | 600 | return __fscache_read_or_alloc_pages(cookie, mapping, pages, |
| 559 | nr_pages, end_io_func, | 601 | nr_pages, end_io_func, |
| 560 | context, gfp); | 602 | context, gfp); |
| @@ -585,7 +627,7 @@ int fscache_alloc_page(struct fscache_cookie *cookie, | |||
| 585 | struct page *page, | 627 | struct page *page, |
| 586 | gfp_t gfp) | 628 | gfp_t gfp) |
| 587 | { | 629 | { |
| 588 | if (fscache_cookie_valid(cookie)) | 630 | if (fscache_cookie_valid(cookie) && fscache_cookie_enabled(cookie)) |
| 589 | return __fscache_alloc_page(cookie, page, gfp); | 631 | return __fscache_alloc_page(cookie, page, gfp); |
| 590 | else | 632 | else |
| 591 | return -ENOBUFS; | 633 | return -ENOBUFS; |
| @@ -634,7 +676,7 @@ int fscache_write_page(struct fscache_cookie *cookie, | |||
| 634 | struct page *page, | 676 | struct page *page, |
| 635 | gfp_t gfp) | 677 | gfp_t gfp) |
| 636 | { | 678 | { |
| 637 | if (fscache_cookie_valid(cookie)) | 679 | if (fscache_cookie_valid(cookie) && fscache_cookie_enabled(cookie)) |
| 638 | return __fscache_write_page(cookie, page, gfp); | 680 | return __fscache_write_page(cookie, page, gfp); |
| 639 | else | 681 | else |
| 640 | return -ENOBUFS; | 682 | return -ENOBUFS; |
| @@ -744,4 +786,47 @@ void fscache_uncache_all_inode_pages(struct fscache_cookie *cookie, | |||
| 744 | __fscache_uncache_all_inode_pages(cookie, inode); | 786 | __fscache_uncache_all_inode_pages(cookie, inode); |
| 745 | } | 787 | } |
| 746 | 788 | ||
| 789 | /** | ||
| 790 | * fscache_disable_cookie - Disable a cookie | ||
| 791 | * @cookie: The cookie representing the cache object | ||
| 792 | * @invalidate: Invalidate the backing object | ||
| 793 | * | ||
| 794 | * Disable a cookie from accepting further alloc, read, write, invalidate, | ||
| 795 | * update or acquire operations. Outstanding operations can still be waited | ||
| 796 | * upon and pages can still be uncached and the cookie relinquished. | ||
| 797 | * | ||
| 798 | * This will not return until all outstanding operations have completed. | ||
| 799 | * | ||
| 800 | * If @invalidate is set, then the backing object will be invalidated and | ||
| 801 | * detached, otherwise it will just be detached. | ||
| 802 | */ | ||
| 803 | static inline | ||
| 804 | void fscache_disable_cookie(struct fscache_cookie *cookie, bool invalidate) | ||
| 805 | { | ||
| 806 | if (fscache_cookie_valid(cookie) && fscache_cookie_enabled(cookie)) | ||
| 807 | __fscache_disable_cookie(cookie, invalidate); | ||
| 808 | } | ||
| 809 | |||
| 810 | /** | ||
| 811 | * fscache_enable_cookie - Reenable a cookie | ||
| 812 | * @cookie: The cookie representing the cache object | ||
| 813 | * @can_enable: A function to permit enablement once lock is held | ||
| 814 | * @data: Data for can_enable() | ||
| 815 | * | ||
| 816 | * Reenable a previously disabled cookie, allowing it to accept further alloc, | ||
| 817 | * read, write, invalidate, update or acquire operations. An attempt will be | ||
| 818 | * made to immediately reattach the cookie to a backing object. | ||
| 819 | * | ||
| 820 | * The can_enable() function is called (if not NULL) once the enablement lock | ||
| 821 | * is held to rule on whether enablement is still permitted to go ahead. | ||
| 822 | */ | ||
| 823 | static inline | ||
| 824 | void fscache_enable_cookie(struct fscache_cookie *cookie, | ||
| 825 | bool (*can_enable)(void *data), | ||
| 826 | void *data) | ||
| 827 | { | ||
| 828 | if (fscache_cookie_valid(cookie) && !fscache_cookie_enabled(cookie)) | ||
| 829 | __fscache_enable_cookie(cookie, can_enable, data); | ||
| 830 | } | ||
| 831 | |||
| 747 | #endif /* _LINUX_FSCACHE_H */ | 832 | #endif /* _LINUX_FSCACHE_H */ |
diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h index f8d41cb1cbe0..1eda33d7cb10 100644 --- a/include/linux/genalloc.h +++ b/include/linux/genalloc.h | |||
| @@ -94,6 +94,8 @@ static inline int gen_pool_add(struct gen_pool *pool, unsigned long addr, | |||
| 94 | } | 94 | } |
| 95 | extern void gen_pool_destroy(struct gen_pool *); | 95 | extern void gen_pool_destroy(struct gen_pool *); |
| 96 | extern unsigned long gen_pool_alloc(struct gen_pool *, size_t); | 96 | extern unsigned long gen_pool_alloc(struct gen_pool *, size_t); |
| 97 | extern void *gen_pool_dma_alloc(struct gen_pool *pool, size_t size, | ||
| 98 | dma_addr_t *dma); | ||
| 97 | extern void gen_pool_free(struct gen_pool *, unsigned long, size_t); | 99 | extern void gen_pool_free(struct gen_pool *, unsigned long, size_t); |
| 98 | extern void gen_pool_for_each_chunk(struct gen_pool *, | 100 | extern void gen_pool_for_each_chunk(struct gen_pool *, |
| 99 | void (*)(struct gen_pool *, struct gen_pool_chunk *, void *), void *); | 101 | void (*)(struct gen_pool *, struct gen_pool_chunk *, void *), void *); |
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 552e3f46e4a3..13dfd24d01ab 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h | |||
| @@ -16,14 +16,17 @@ | |||
| 16 | #define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW) | 16 | #define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW) |
| 17 | #define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH) | 17 | #define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH) |
| 18 | 18 | ||
| 19 | /* Gpio pin is active-low */ | ||
| 20 | #define GPIOF_ACTIVE_LOW (1 << 2) | ||
| 21 | |||
| 19 | /* Gpio pin is open drain */ | 22 | /* Gpio pin is open drain */ |
| 20 | #define GPIOF_OPEN_DRAIN (1 << 2) | 23 | #define GPIOF_OPEN_DRAIN (1 << 3) |
| 21 | 24 | ||
| 22 | /* Gpio pin is open source */ | 25 | /* Gpio pin is open source */ |
| 23 | #define GPIOF_OPEN_SOURCE (1 << 3) | 26 | #define GPIOF_OPEN_SOURCE (1 << 4) |
| 24 | 27 | ||
| 25 | #define GPIOF_EXPORT (1 << 4) | 28 | #define GPIOF_EXPORT (1 << 5) |
| 26 | #define GPIOF_EXPORT_CHANGEABLE (1 << 5) | 29 | #define GPIOF_EXPORT_CHANGEABLE (1 << 6) |
| 27 | #define GPIOF_EXPORT_DIR_FIXED (GPIOF_EXPORT) | 30 | #define GPIOF_EXPORT_DIR_FIXED (GPIOF_EXPORT) |
| 28 | #define GPIOF_EXPORT_DIR_CHANGEABLE (GPIOF_EXPORT | GPIOF_EXPORT_CHANGEABLE) | 31 | #define GPIOF_EXPORT_DIR_CHANGEABLE (GPIOF_EXPORT | GPIOF_EXPORT_CHANGEABLE) |
| 29 | 32 | ||
| @@ -74,12 +77,22 @@ static inline int irq_to_gpio(unsigned int irq) | |||
| 74 | 77 | ||
| 75 | #endif /* ! CONFIG_ARCH_HAVE_CUSTOM_GPIO_H */ | 78 | #endif /* ! CONFIG_ARCH_HAVE_CUSTOM_GPIO_H */ |
| 76 | 79 | ||
| 80 | /* CONFIG_GPIOLIB: bindings for managed devices that want to request gpios */ | ||
| 81 | |||
| 82 | struct device; | ||
| 83 | |||
| 84 | int devm_gpio_request(struct device *dev, unsigned gpio, const char *label); | ||
| 85 | int devm_gpio_request_one(struct device *dev, unsigned gpio, | ||
| 86 | unsigned long flags, const char *label); | ||
| 87 | void devm_gpio_free(struct device *dev, unsigned int gpio); | ||
| 88 | |||
| 77 | #else /* ! CONFIG_GPIOLIB */ | 89 | #else /* ! CONFIG_GPIOLIB */ |
| 78 | 90 | ||
| 79 | #include <linux/kernel.h> | 91 | #include <linux/kernel.h> |
| 80 | #include <linux/types.h> | 92 | #include <linux/types.h> |
| 81 | #include <linux/errno.h> | 93 | #include <linux/errno.h> |
| 82 | #include <linux/bug.h> | 94 | #include <linux/bug.h> |
| 95 | #include <linux/pinctrl/pinctrl.h> | ||
| 83 | 96 | ||
| 84 | struct device; | 97 | struct device; |
| 85 | struct gpio_chip; | 98 | struct gpio_chip; |
| @@ -204,6 +217,18 @@ static inline int gpio_to_irq(unsigned gpio) | |||
| 204 | return -EINVAL; | 217 | return -EINVAL; |
| 205 | } | 218 | } |
| 206 | 219 | ||
| 220 | static inline int gpio_lock_as_irq(struct gpio_chip *chip, unsigned int offset) | ||
| 221 | { | ||
| 222 | WARN_ON(1); | ||
| 223 | return -EINVAL; | ||
| 224 | } | ||
| 225 | |||
| 226 | static inline void gpio_unlock_as_irq(struct gpio_chip *chip, | ||
| 227 | unsigned int offset) | ||
| 228 | { | ||
| 229 | WARN_ON(1); | ||
| 230 | } | ||
| 231 | |||
| 207 | static inline int irq_to_gpio(unsigned irq) | 232 | static inline int irq_to_gpio(unsigned irq) |
| 208 | { | 233 | { |
| 209 | /* irq can never have been returned from gpio_to_irq() */ | 234 | /* irq can never have been returned from gpio_to_irq() */ |
| @@ -220,20 +245,40 @@ gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, | |||
| 220 | return -EINVAL; | 245 | return -EINVAL; |
| 221 | } | 246 | } |
| 222 | 247 | ||
| 248 | static inline int | ||
| 249 | gpiochip_add_pingroup_range(struct gpio_chip *chip, | ||
| 250 | struct pinctrl_dev *pctldev, | ||
| 251 | unsigned int gpio_offset, const char *pin_group) | ||
| 252 | { | ||
| 253 | WARN_ON(1); | ||
| 254 | return -EINVAL; | ||
| 255 | } | ||
| 256 | |||
| 223 | static inline void | 257 | static inline void |
| 224 | gpiochip_remove_pin_ranges(struct gpio_chip *chip) | 258 | gpiochip_remove_pin_ranges(struct gpio_chip *chip) |
| 225 | { | 259 | { |
| 226 | WARN_ON(1); | 260 | WARN_ON(1); |
| 227 | } | 261 | } |
| 228 | 262 | ||
| 229 | #endif /* ! CONFIG_GPIOLIB */ | 263 | static inline int devm_gpio_request(struct device *dev, unsigned gpio, |
| 264 | const char *label) | ||
| 265 | { | ||
| 266 | WARN_ON(1); | ||
| 267 | return -EINVAL; | ||
| 268 | } | ||
| 230 | 269 | ||
| 231 | struct device; | 270 | static inline int devm_gpio_request_one(struct device *dev, unsigned gpio, |
| 271 | unsigned long flags, const char *label) | ||
| 272 | { | ||
| 273 | WARN_ON(1); | ||
| 274 | return -EINVAL; | ||
| 275 | } | ||
| 232 | 276 | ||
| 233 | /* bindings for managed devices that want to request gpios */ | 277 | static inline void devm_gpio_free(struct device *dev, unsigned int gpio) |
| 234 | int devm_gpio_request(struct device *dev, unsigned gpio, const char *label); | 278 | { |
| 235 | int devm_gpio_request_one(struct device *dev, unsigned gpio, | 279 | WARN_ON(1); |
| 236 | unsigned long flags, const char *label); | 280 | } |
| 237 | void devm_gpio_free(struct device *dev, unsigned int gpio); | 281 | |
| 282 | #endif /* ! CONFIG_GPIOLIB */ | ||
| 238 | 283 | ||
| 239 | #endif /* __LINUX_GPIO_H */ | 284 | #endif /* __LINUX_GPIO_H */ |
diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h new file mode 100644 index 000000000000..4d34dbbbad4d --- /dev/null +++ b/include/linux/gpio/consumer.h | |||
| @@ -0,0 +1,253 @@ | |||
| 1 | #ifndef __LINUX_GPIO_CONSUMER_H | ||
| 2 | #define __LINUX_GPIO_CONSUMER_H | ||
| 3 | |||
| 4 | #include <linux/err.h> | ||
| 5 | #include <linux/kernel.h> | ||
| 6 | |||
| 7 | #ifdef CONFIG_GPIOLIB | ||
| 8 | |||
| 9 | struct device; | ||
| 10 | struct gpio_chip; | ||
| 11 | |||
| 12 | /** | ||
| 13 | * Opaque descriptor for a GPIO. These are obtained using gpiod_get() and are | ||
| 14 | * preferable to the old integer-based handles. | ||
| 15 | * | ||
| 16 | * Contrary to integers, a pointer to a gpio_desc is guaranteed to be valid | ||
| 17 | * until the GPIO is released. | ||
| 18 | */ | ||
| 19 | struct gpio_desc; | ||
| 20 | |||
| 21 | /* Acquire and dispose GPIOs */ | ||
| 22 | struct gpio_desc *__must_check gpiod_get(struct device *dev, | ||
| 23 | const char *con_id); | ||
| 24 | struct gpio_desc *__must_check gpiod_get_index(struct device *dev, | ||
| 25 | const char *con_id, | ||
| 26 | unsigned int idx); | ||
| 27 | void gpiod_put(struct gpio_desc *desc); | ||
| 28 | |||
| 29 | struct gpio_desc *__must_check devm_gpiod_get(struct device *dev, | ||
| 30 | const char *con_id); | ||
| 31 | struct gpio_desc *__must_check devm_gpiod_get_index(struct device *dev, | ||
| 32 | const char *con_id, | ||
| 33 | unsigned int idx); | ||
| 34 | void devm_gpiod_put(struct device *dev, struct gpio_desc *desc); | ||
| 35 | |||
| 36 | int gpiod_get_direction(const struct gpio_desc *desc); | ||
| 37 | int gpiod_direction_input(struct gpio_desc *desc); | ||
| 38 | int gpiod_direction_output(struct gpio_desc *desc, int value); | ||
| 39 | |||
| 40 | /* Value get/set from non-sleeping context */ | ||
| 41 | int gpiod_get_value(const struct gpio_desc *desc); | ||
| 42 | void gpiod_set_value(struct gpio_desc *desc, int value); | ||
| 43 | int gpiod_get_raw_value(const struct gpio_desc *desc); | ||
| 44 | void gpiod_set_raw_value(struct gpio_desc *desc, int value); | ||
| 45 | |||
| 46 | /* Value get/set from sleeping context */ | ||
| 47 | int gpiod_get_value_cansleep(const struct gpio_desc *desc); | ||
| 48 | void gpiod_set_value_cansleep(struct gpio_desc *desc, int value); | ||
| 49 | int gpiod_get_raw_value_cansleep(const struct gpio_desc *desc); | ||
| 50 | void gpiod_set_raw_value_cansleep(struct gpio_desc *desc, int value); | ||
| 51 | |||
| 52 | int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce); | ||
| 53 | |||
| 54 | int gpiod_is_active_low(const struct gpio_desc *desc); | ||
| 55 | int gpiod_cansleep(const struct gpio_desc *desc); | ||
| 56 | |||
| 57 | int gpiod_to_irq(const struct gpio_desc *desc); | ||
| 58 | |||
| 59 | /* Convert between the old gpio_ and new gpiod_ interfaces */ | ||
| 60 | struct gpio_desc *gpio_to_desc(unsigned gpio); | ||
| 61 | int desc_to_gpio(const struct gpio_desc *desc); | ||
| 62 | struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc); | ||
| 63 | |||
| 64 | #else /* CONFIG_GPIOLIB */ | ||
| 65 | |||
| 66 | static inline struct gpio_desc *__must_check gpiod_get(struct device *dev, | ||
| 67 | const char *con_id) | ||
| 68 | { | ||
| 69 | return ERR_PTR(-ENOSYS); | ||
| 70 | } | ||
| 71 | static inline struct gpio_desc *__must_check gpiod_get_index(struct device *dev, | ||
| 72 | const char *con_id, | ||
| 73 | unsigned int idx) | ||
| 74 | { | ||
| 75 | return ERR_PTR(-ENOSYS); | ||
| 76 | } | ||
| 77 | static inline void gpiod_put(struct gpio_desc *desc) | ||
| 78 | { | ||
| 79 | might_sleep(); | ||
| 80 | |||
| 81 | /* GPIO can never have been requested */ | ||
| 82 | WARN_ON(1); | ||
| 83 | } | ||
| 84 | |||
| 85 | static inline struct gpio_desc *__must_check devm_gpiod_get(struct device *dev, | ||
| 86 | const char *con_id) | ||
| 87 | { | ||
| 88 | return ERR_PTR(-ENOSYS); | ||
| 89 | } | ||
| 90 | static inline | ||
| 91 | struct gpio_desc *__must_check devm_gpiod_get_index(struct device *dev, | ||
| 92 | const char *con_id, | ||
| 93 | unsigned int idx) | ||
| 94 | { | ||
| 95 | return ERR_PTR(-ENOSYS); | ||
| 96 | } | ||
| 97 | static inline void devm_gpiod_put(struct device *dev, struct gpio_desc *desc) | ||
| 98 | { | ||
| 99 | might_sleep(); | ||
| 100 | |||
| 101 | /* GPIO can never have been requested */ | ||
| 102 | WARN_ON(1); | ||
| 103 | } | ||
| 104 | |||
| 105 | |||
| 106 | static inline int gpiod_get_direction(const struct gpio_desc *desc) | ||
| 107 | { | ||
| 108 | /* GPIO can never have been requested */ | ||
| 109 | WARN_ON(1); | ||
| 110 | return -ENOSYS; | ||
| 111 | } | ||
| 112 | static inline int gpiod_direction_input(struct gpio_desc *desc) | ||
| 113 | { | ||
| 114 | /* GPIO can never have been requested */ | ||
| 115 | WARN_ON(1); | ||
| 116 | return -ENOSYS; | ||
| 117 | } | ||
| 118 | static inline int gpiod_direction_output(struct gpio_desc *desc, int value) | ||
| 119 | { | ||
| 120 | /* GPIO can never have been requested */ | ||
| 121 | WARN_ON(1); | ||
| 122 | return -ENOSYS; | ||
| 123 | } | ||
| 124 | |||
| 125 | |||
| 126 | static inline int gpiod_get_value(const struct gpio_desc *desc) | ||
| 127 | { | ||
| 128 | /* GPIO can never have been requested */ | ||
| 129 | WARN_ON(1); | ||
| 130 | return 0; | ||
| 131 | } | ||
| 132 | static inline void gpiod_set_value(struct gpio_desc *desc, int value) | ||
| 133 | { | ||
| 134 | /* GPIO can never have been requested */ | ||
| 135 | WARN_ON(1); | ||
| 136 | } | ||
| 137 | static inline int gpiod_get_raw_value(const struct gpio_desc *desc) | ||
| 138 | { | ||
| 139 | /* GPIO can never have been requested */ | ||
| 140 | WARN_ON(1); | ||
| 141 | return 0; | ||
| 142 | } | ||
| 143 | static inline void gpiod_set_raw_value(struct gpio_desc *desc, int value) | ||
| 144 | { | ||
| 145 | /* GPIO can never have been requested */ | ||
| 146 | WARN_ON(1); | ||
| 147 | } | ||
| 148 | |||
| 149 | static inline int gpiod_get_value_cansleep(const struct gpio_desc *desc) | ||
| 150 | { | ||
| 151 | /* GPIO can never have been requested */ | ||
| 152 | WARN_ON(1); | ||
| 153 | return 0; | ||
| 154 | } | ||
| 155 | static inline void gpiod_set_value_cansleep(struct gpio_desc *desc, int value) | ||
| 156 | { | ||
| 157 | /* GPIO can never have been requested */ | ||
| 158 | WARN_ON(1); | ||
| 159 | } | ||
| 160 | static inline int gpiod_get_raw_value_cansleep(const struct gpio_desc *desc) | ||
| 161 | { | ||
| 162 | /* GPIO can never have been requested */ | ||
| 163 | WARN_ON(1); | ||
| 164 | return 0; | ||
| 165 | } | ||
| 166 | static inline void gpiod_set_raw_value_cansleep(struct gpio_desc *desc, | ||
| 167 | int value) | ||
| 168 | { | ||
| 169 | /* GPIO can never have been requested */ | ||
| 170 | WARN_ON(1); | ||
| 171 | } | ||
| 172 | |||
| 173 | static inline int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce) | ||
| 174 | { | ||
| 175 | /* GPIO can never have been requested */ | ||
| 176 | WARN_ON(1); | ||
| 177 | return -ENOSYS; | ||
| 178 | } | ||
| 179 | |||
| 180 | static inline int gpiod_is_active_low(const struct gpio_desc *desc) | ||
| 181 | { | ||
| 182 | /* GPIO can never have been requested */ | ||
| 183 | WARN_ON(1); | ||
| 184 | return 0; | ||
| 185 | } | ||
| 186 | static inline int gpiod_cansleep(const struct gpio_desc *desc) | ||
| 187 | { | ||
| 188 | /* GPIO can never have been requested */ | ||
| 189 | WARN_ON(1); | ||
| 190 | return 0; | ||
| 191 | } | ||
| 192 | |||
| 193 | static inline int gpiod_to_irq(const struct gpio_desc *desc) | ||
| 194 | { | ||
| 195 | /* GPIO can never have been requested */ | ||
| 196 | WARN_ON(1); | ||
| 197 | return -EINVAL; | ||
| 198 | } | ||
| 199 | |||
| 200 | static inline struct gpio_desc *gpio_to_desc(unsigned gpio) | ||
| 201 | { | ||
| 202 | return ERR_PTR(-EINVAL); | ||
| 203 | } | ||
| 204 | static inline int desc_to_gpio(const struct gpio_desc *desc) | ||
| 205 | { | ||
| 206 | /* GPIO can never have been requested */ | ||
| 207 | WARN_ON(1); | ||
| 208 | return -EINVAL; | ||
| 209 | } | ||
| 210 | static inline struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc) | ||
| 211 | { | ||
| 212 | /* GPIO can never have been requested */ | ||
| 213 | WARN_ON(1); | ||
| 214 | return ERR_PTR(-ENODEV); | ||
| 215 | } | ||
| 216 | |||
| 217 | |||
| 218 | #endif /* CONFIG_GPIOLIB */ | ||
| 219 | |||
| 220 | #if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_GPIO_SYSFS) | ||
| 221 | |||
| 222 | int gpiod_export(struct gpio_desc *desc, bool direction_may_change); | ||
| 223 | int gpiod_export_link(struct device *dev, const char *name, | ||
| 224 | struct gpio_desc *desc); | ||
| 225 | int gpiod_sysfs_set_active_low(struct gpio_desc *desc, int value); | ||
| 226 | void gpiod_unexport(struct gpio_desc *desc); | ||
| 227 | |||
| 228 | #else /* CONFIG_GPIOLIB && CONFIG_GPIO_SYSFS */ | ||
| 229 | |||
| 230 | static inline int gpiod_export(struct gpio_desc *desc, | ||
| 231 | bool direction_may_change) | ||
| 232 | { | ||
| 233 | return -ENOSYS; | ||
| 234 | } | ||
| 235 | |||
| 236 | static inline int gpiod_export_link(struct device *dev, const char *name, | ||
| 237 | struct gpio_desc *desc) | ||
| 238 | { | ||
| 239 | return -ENOSYS; | ||
| 240 | } | ||
| 241 | |||
| 242 | static inline int gpiod_sysfs_set_active_low(struct gpio_desc *desc, int value) | ||
| 243 | { | ||
| 244 | return -ENOSYS; | ||
| 245 | } | ||
| 246 | |||
| 247 | static inline void gpiod_unexport(struct gpio_desc *desc) | ||
| 248 | { | ||
| 249 | } | ||
| 250 | |||
| 251 | #endif /* CONFIG_GPIOLIB && CONFIG_GPIO_SYSFS */ | ||
| 252 | |||
| 253 | #endif | ||
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h new file mode 100644 index 000000000000..656a27efb2c8 --- /dev/null +++ b/include/linux/gpio/driver.h | |||
| @@ -0,0 +1,184 @@ | |||
| 1 | #ifndef __LINUX_GPIO_DRIVER_H | ||
| 2 | #define __LINUX_GPIO_DRIVER_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | struct device; | ||
| 7 | struct gpio_desc; | ||
| 8 | struct seq_file; | ||
| 9 | |||
| 10 | /** | ||
| 11 | * struct gpio_chip - abstract a GPIO controller | ||
| 12 | * @label: for diagnostics | ||
| 13 | * @dev: optional device providing the GPIOs | ||
| 14 | * @owner: helps prevent removal of modules exporting active GPIOs | ||
| 15 | * @list: links gpio_chips together for traversal | ||
| 16 | * @request: optional hook for chip-specific activation, such as | ||
| 17 | * enabling module power and clock; may sleep | ||
| 18 | * @free: optional hook for chip-specific deactivation, such as | ||
| 19 | * disabling module power and clock; may sleep | ||
| 20 | * @get_direction: returns direction for signal "offset", 0=out, 1=in, | ||
| 21 | * (same as GPIOF_DIR_XXX), or negative error | ||
| 22 | * @direction_input: configures signal "offset" as input, or returns error | ||
| 23 | * @direction_output: configures signal "offset" as output, or returns error | ||
| 24 | * @get: returns value for signal "offset"; for output signals this | ||
| 25 | * returns either the value actually sensed, or zero | ||
| 26 | * @set: assigns output value for signal "offset" | ||
| 27 | * @set_debounce: optional hook for setting debounce time for specified gpio in | ||
| 28 | * interrupt triggered gpio chips | ||
| 29 | * @to_irq: optional hook supporting non-static gpio_to_irq() mappings; | ||
| 30 | * implementation may not sleep | ||
| 31 | * @dbg_show: optional routine to show contents in debugfs; default code | ||
| 32 | * will be used when this is omitted, but custom code can show extra | ||
| 33 | * state (such as pullup/pulldown configuration). | ||
| 34 | * @base: identifies the first GPIO number handled by this chip; or, if | ||
| 35 | * negative during registration, requests dynamic ID allocation. | ||
| 36 | * @ngpio: the number of GPIOs handled by this controller; the last GPIO | ||
| 37 | * handled is (base + ngpio - 1). | ||
| 38 | * @desc: array of ngpio descriptors. Private. | ||
| 39 | * @can_sleep: flag must be set iff get()/set() methods sleep, as they | ||
| 40 | * must while accessing GPIO expander chips over I2C or SPI | ||
| 41 | * @names: if set, must be an array of strings to use as alternative | ||
| 42 | * names for the GPIOs in this chip. Any entry in the array | ||
| 43 | * may be NULL if there is no alias for the GPIO, however the | ||
| 44 | * array must be @ngpio entries long. A name can include a single printk | ||
| 45 | * format specifier for an unsigned int. It is substituted by the actual | ||
| 46 | * number of the gpio. | ||
| 47 | * | ||
| 48 | * A gpio_chip can help platforms abstract various sources of GPIOs so | ||
| 49 | * they can all be accessed through a common programing interface. | ||
| 50 | * Example sources would be SOC controllers, FPGAs, multifunction | ||
| 51 | * chips, dedicated GPIO expanders, and so on. | ||
| 52 | * | ||
| 53 | * Each chip controls a number of signals, identified in method calls | ||
| 54 | * by "offset" values in the range 0..(@ngpio - 1). When those signals | ||
| 55 | * are referenced through calls like gpio_get_value(gpio), the offset | ||
| 56 | * is calculated by subtracting @base from the gpio number. | ||
| 57 | */ | ||
| 58 | struct gpio_chip { | ||
| 59 | const char *label; | ||
| 60 | struct device *dev; | ||
| 61 | struct module *owner; | ||
| 62 | struct list_head list; | ||
| 63 | |||
| 64 | int (*request)(struct gpio_chip *chip, | ||
| 65 | unsigned offset); | ||
| 66 | void (*free)(struct gpio_chip *chip, | ||
| 67 | unsigned offset); | ||
| 68 | int (*get_direction)(struct gpio_chip *chip, | ||
| 69 | unsigned offset); | ||
| 70 | int (*direction_input)(struct gpio_chip *chip, | ||
| 71 | unsigned offset); | ||
| 72 | int (*direction_output)(struct gpio_chip *chip, | ||
| 73 | unsigned offset, int value); | ||
| 74 | int (*get)(struct gpio_chip *chip, | ||
| 75 | unsigned offset); | ||
| 76 | void (*set)(struct gpio_chip *chip, | ||
| 77 | unsigned offset, int value); | ||
| 78 | int (*set_debounce)(struct gpio_chip *chip, | ||
| 79 | unsigned offset, | ||
| 80 | unsigned debounce); | ||
| 81 | |||
| 82 | int (*to_irq)(struct gpio_chip *chip, | ||
| 83 | unsigned offset); | ||
| 84 | |||
| 85 | void (*dbg_show)(struct seq_file *s, | ||
| 86 | struct gpio_chip *chip); | ||
| 87 | int base; | ||
| 88 | u16 ngpio; | ||
| 89 | struct gpio_desc *desc; | ||
| 90 | const char *const *names; | ||
| 91 | unsigned can_sleep:1; | ||
| 92 | unsigned exported:1; | ||
| 93 | |||
| 94 | #if defined(CONFIG_OF_GPIO) | ||
| 95 | /* | ||
| 96 | * If CONFIG_OF is enabled, then all GPIO controllers described in the | ||
| 97 | * device tree automatically may have an OF translation | ||
| 98 | */ | ||
| 99 | struct device_node *of_node; | ||
| 100 | int of_gpio_n_cells; | ||
| 101 | int (*of_xlate)(struct gpio_chip *gc, | ||
| 102 | const struct of_phandle_args *gpiospec, u32 *flags); | ||
| 103 | #endif | ||
| 104 | #ifdef CONFIG_PINCTRL | ||
| 105 | /* | ||
| 106 | * If CONFIG_PINCTRL is enabled, then gpio controllers can optionally | ||
| 107 | * describe the actual pin range which they serve in an SoC. This | ||
| 108 | * information would be used by pinctrl subsystem to configure | ||
| 109 | * corresponding pins for gpio usage. | ||
| 110 | */ | ||
| 111 | struct list_head pin_ranges; | ||
| 112 | #endif | ||
| 113 | }; | ||
| 114 | |||
| 115 | extern const char *gpiochip_is_requested(struct gpio_chip *chip, | ||
| 116 | unsigned offset); | ||
| 117 | |||
| 118 | /* add/remove chips */ | ||
| 119 | extern int gpiochip_add(struct gpio_chip *chip); | ||
| 120 | extern int __must_check gpiochip_remove(struct gpio_chip *chip); | ||
| 121 | extern struct gpio_chip *gpiochip_find(void *data, | ||
| 122 | int (*match)(struct gpio_chip *chip, void *data)); | ||
| 123 | |||
| 124 | /* lock/unlock as IRQ */ | ||
| 125 | int gpiod_lock_as_irq(struct gpio_desc *desc); | ||
| 126 | void gpiod_unlock_as_irq(struct gpio_desc *desc); | ||
| 127 | |||
| 128 | /** | ||
| 129 | * Lookup table for associating GPIOs to specific devices and functions using | ||
| 130 | * platform data. | ||
| 131 | */ | ||
| 132 | struct gpiod_lookup { | ||
| 133 | struct list_head list; | ||
| 134 | /* | ||
| 135 | * name of the chip the GPIO belongs to | ||
| 136 | */ | ||
| 137 | const char *chip_label; | ||
| 138 | /* | ||
| 139 | * hardware number (i.e. relative to the chip) of the GPIO | ||
| 140 | */ | ||
| 141 | u16 chip_hwnum; | ||
| 142 | /* | ||
| 143 | * name of device that can claim this GPIO | ||
| 144 | */ | ||
| 145 | const char *dev_id; | ||
| 146 | /* | ||
| 147 | * name of the GPIO from the device's point of view | ||
| 148 | */ | ||
| 149 | const char *con_id; | ||
| 150 | /* | ||
| 151 | * index of the GPIO in case several GPIOs share the same name | ||
| 152 | */ | ||
| 153 | unsigned int idx; | ||
| 154 | /* | ||
| 155 | * mask of GPIOF_* values | ||
| 156 | */ | ||
| 157 | unsigned long flags; | ||
| 158 | }; | ||
| 159 | |||
| 160 | /* | ||
| 161 | * Simple definition of a single GPIO under a con_id | ||
| 162 | */ | ||
| 163 | #define GPIO_LOOKUP(_chip_label, _chip_hwnum, _dev_id, _con_id, _flags) \ | ||
| 164 | GPIO_LOOKUP_IDX(_chip_label, _chip_hwnum, _dev_id, _con_id, 0, _flags) | ||
| 165 | |||
| 166 | /* | ||
| 167 | * Use this macro if you need to have several GPIOs under the same con_id. | ||
| 168 | * Each GPIO needs to use a different index and can be accessed using | ||
| 169 | * gpiod_get_index() | ||
| 170 | */ | ||
| 171 | #define GPIO_LOOKUP_IDX(_chip_label, _chip_hwnum, _dev_id, _con_id, _idx, \ | ||
| 172 | _flags) \ | ||
| 173 | { \ | ||
| 174 | .chip_label = _chip_label, \ | ||
| 175 | .chip_hwnum = _chip_hwnum, \ | ||
| 176 | .dev_id = _dev_id, \ | ||
| 177 | .con_id = _con_id, \ | ||
| 178 | .idx = _idx, \ | ||
| 179 | .flags = _flags, \ | ||
| 180 | } | ||
| 181 | |||
| 182 | void gpiod_add_table(struct gpiod_lookup *table, size_t size); | ||
| 183 | |||
| 184 | #endif | ||
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 1e041063b226..d9cf963ac832 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
| @@ -33,7 +33,7 @@ extern void rcu_nmi_exit(void); | |||
| 33 | #define __irq_enter() \ | 33 | #define __irq_enter() \ |
| 34 | do { \ | 34 | do { \ |
| 35 | account_irq_enter_time(current); \ | 35 | account_irq_enter_time(current); \ |
| 36 | add_preempt_count(HARDIRQ_OFFSET); \ | 36 | preempt_count_add(HARDIRQ_OFFSET); \ |
| 37 | trace_hardirq_enter(); \ | 37 | trace_hardirq_enter(); \ |
| 38 | } while (0) | 38 | } while (0) |
| 39 | 39 | ||
| @@ -49,7 +49,7 @@ extern void irq_enter(void); | |||
| 49 | do { \ | 49 | do { \ |
| 50 | trace_hardirq_exit(); \ | 50 | trace_hardirq_exit(); \ |
| 51 | account_irq_exit_time(current); \ | 51 | account_irq_exit_time(current); \ |
| 52 | sub_preempt_count(HARDIRQ_OFFSET); \ | 52 | preempt_count_sub(HARDIRQ_OFFSET); \ |
| 53 | } while (0) | 53 | } while (0) |
| 54 | 54 | ||
| 55 | /* | 55 | /* |
| @@ -62,7 +62,7 @@ extern void irq_exit(void); | |||
| 62 | lockdep_off(); \ | 62 | lockdep_off(); \ |
| 63 | ftrace_nmi_enter(); \ | 63 | ftrace_nmi_enter(); \ |
| 64 | BUG_ON(in_nmi()); \ | 64 | BUG_ON(in_nmi()); \ |
| 65 | add_preempt_count(NMI_OFFSET + HARDIRQ_OFFSET); \ | 65 | preempt_count_add(NMI_OFFSET + HARDIRQ_OFFSET); \ |
| 66 | rcu_nmi_enter(); \ | 66 | rcu_nmi_enter(); \ |
| 67 | trace_hardirq_enter(); \ | 67 | trace_hardirq_enter(); \ |
| 68 | } while (0) | 68 | } while (0) |
| @@ -72,7 +72,7 @@ extern void irq_exit(void); | |||
| 72 | trace_hardirq_exit(); \ | 72 | trace_hardirq_exit(); \ |
| 73 | rcu_nmi_exit(); \ | 73 | rcu_nmi_exit(); \ |
| 74 | BUG_ON(!in_nmi()); \ | 74 | BUG_ON(!in_nmi()); \ |
| 75 | sub_preempt_count(NMI_OFFSET + HARDIRQ_OFFSET); \ | 75 | preempt_count_sub(NMI_OFFSET + HARDIRQ_OFFSET); \ |
| 76 | ftrace_nmi_exit(); \ | 76 | ftrace_nmi_exit(); \ |
| 77 | lockdep_on(); \ | 77 | lockdep_on(); \ |
| 78 | } while (0) | 78 | } while (0) |
diff --git a/include/linux/hashtable.h b/include/linux/hashtable.h index a9df51f5d54c..519b6e2d769e 100644 --- a/include/linux/hashtable.h +++ b/include/linux/hashtable.h | |||
| @@ -174,6 +174,21 @@ static inline void hash_del_rcu(struct hlist_node *node) | |||
| 174 | member) | 174 | member) |
| 175 | 175 | ||
| 176 | /** | 176 | /** |
| 177 | * hash_for_each_possible_rcu_notrace - iterate over all possible objects hashing | ||
| 178 | * to the same bucket in an rcu enabled hashtable in a rcu enabled hashtable | ||
| 179 | * @name: hashtable to iterate | ||
| 180 | * @obj: the type * to use as a loop cursor for each entry | ||
| 181 | * @member: the name of the hlist_node within the struct | ||
| 182 | * @key: the key of the objects to iterate over | ||
| 183 | * | ||
| 184 | * This is the same as hash_for_each_possible_rcu() except that it does | ||
| 185 | * not do any RCU debugging or tracing. | ||
| 186 | */ | ||
| 187 | #define hash_for_each_possible_rcu_notrace(name, obj, member, key) \ | ||
| 188 | hlist_for_each_entry_rcu_notrace(obj, \ | ||
| 189 | &name[hash_min(key, HASH_BITS(name))], member) | ||
| 190 | |||
| 191 | /** | ||
| 177 | * hash_for_each_possible_safe - iterate over all possible objects hashing to the | 192 | * hash_for_each_possible_safe - iterate over all possible objects hashing to the |
| 178 | * same bucket safe against removals | 193 | * same bucket safe against removals |
| 179 | * @name: hashtable to iterate | 194 | * @name: hashtable to iterate |
diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h index 32ba45158d39..a265af294ea4 100644 --- a/include/linux/hid-sensor-hub.h +++ b/include/linux/hid-sensor-hub.h | |||
| @@ -47,11 +47,13 @@ struct hid_sensor_hub_attribute_info { | |||
| 47 | * @hdev: Stores the hid instance. | 47 | * @hdev: Stores the hid instance. |
| 48 | * @vendor_id: Vendor id of hub device. | 48 | * @vendor_id: Vendor id of hub device. |
| 49 | * @product_id: Product id of hub device. | 49 | * @product_id: Product id of hub device. |
| 50 | * @ref_cnt: Number of MFD clients have opened this device | ||
| 50 | */ | 51 | */ |
| 51 | struct hid_sensor_hub_device { | 52 | struct hid_sensor_hub_device { |
| 52 | struct hid_device *hdev; | 53 | struct hid_device *hdev; |
| 53 | u32 vendor_id; | 54 | u32 vendor_id; |
| 54 | u32 product_id; | 55 | u32 product_id; |
| 56 | int ref_cnt; | ||
| 55 | }; | 57 | }; |
| 56 | 58 | ||
| 57 | /** | 59 | /** |
| @@ -74,6 +76,22 @@ struct hid_sensor_hub_callbacks { | |||
| 74 | void *priv); | 76 | void *priv); |
| 75 | }; | 77 | }; |
| 76 | 78 | ||
| 79 | /** | ||
| 80 | * sensor_hub_device_open() - Open hub device | ||
| 81 | * @hsdev: Hub device instance. | ||
| 82 | * | ||
| 83 | * Used to open hid device for sensor hub. | ||
| 84 | */ | ||
| 85 | int sensor_hub_device_open(struct hid_sensor_hub_device *hsdev); | ||
| 86 | |||
| 87 | /** | ||
| 88 | * sensor_hub_device_clode() - Close hub device | ||
| 89 | * @hsdev: Hub device instance. | ||
| 90 | * | ||
| 91 | * Used to clode hid device for sensor hub. | ||
| 92 | */ | ||
| 93 | void sensor_hub_device_close(struct hid_sensor_hub_device *hsdev); | ||
| 94 | |||
| 77 | /* Registration functions */ | 95 | /* Registration functions */ |
| 78 | 96 | ||
| 79 | /** | 97 | /** |
diff --git a/include/linux/hwmon-vid.h b/include/linux/hwmon-vid.h index f346e4d5381c..da0a680e2f6d 100644 --- a/include/linux/hwmon-vid.h +++ b/include/linux/hwmon-vid.h | |||
| @@ -38,7 +38,7 @@ static inline int vid_to_reg(int val, u8 vrm) | |||
| 38 | return ((val >= 1100) && (val <= 1850) ? | 38 | return ((val >= 1100) && (val <= 1850) ? |
| 39 | ((18499 - val * 10) / 25 + 5) / 10 : -1); | 39 | ((18499 - val * 10) / 25 + 5) / 10 : -1); |
| 40 | default: | 40 | default: |
| 41 | return -1; | 41 | return -EINVAL; |
| 42 | } | 42 | } |
| 43 | } | 43 | } |
| 44 | 44 | ||
diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h index b2514f70d591..09354f6c1d63 100644 --- a/include/linux/hwmon.h +++ b/include/linux/hwmon.h | |||
| @@ -15,9 +15,19 @@ | |||
| 15 | #define _HWMON_H_ | 15 | #define _HWMON_H_ |
| 16 | 16 | ||
| 17 | struct device; | 17 | struct device; |
| 18 | struct attribute_group; | ||
| 18 | 19 | ||
| 19 | struct device *hwmon_device_register(struct device *dev); | 20 | struct device *hwmon_device_register(struct device *dev); |
| 21 | struct device * | ||
| 22 | hwmon_device_register_with_groups(struct device *dev, const char *name, | ||
| 23 | void *drvdata, | ||
| 24 | const struct attribute_group **groups); | ||
| 25 | struct device * | ||
| 26 | devm_hwmon_device_register_with_groups(struct device *dev, const char *name, | ||
| 27 | void *drvdata, | ||
| 28 | const struct attribute_group **groups); | ||
| 20 | 29 | ||
| 21 | void hwmon_device_unregister(struct device *dev); | 30 | void hwmon_device_unregister(struct device *dev); |
| 31 | void devm_hwmon_device_unregister(struct device *dev); | ||
| 22 | 32 | ||
| 23 | #endif | 33 | #endif |
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index d98503bde7e9..15da677478dd 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h | |||
| @@ -432,15 +432,6 @@ struct hv_ring_buffer_info { | |||
| 432 | u32 ring_data_startoffset; | 432 | u32 ring_data_startoffset; |
| 433 | }; | 433 | }; |
| 434 | 434 | ||
| 435 | struct hv_ring_buffer_debug_info { | ||
| 436 | u32 current_interrupt_mask; | ||
| 437 | u32 current_read_index; | ||
| 438 | u32 current_write_index; | ||
| 439 | u32 bytes_avail_toread; | ||
| 440 | u32 bytes_avail_towrite; | ||
| 441 | }; | ||
| 442 | |||
| 443 | |||
| 444 | /* | 435 | /* |
| 445 | * | 436 | * |
| 446 | * hv_get_ringbuffer_availbytes() | 437 | * hv_get_ringbuffer_availbytes() |
| @@ -902,23 +893,6 @@ enum vmbus_channel_state { | |||
| 902 | CHANNEL_OPENED_STATE, | 893 | CHANNEL_OPENED_STATE, |
| 903 | }; | 894 | }; |
| 904 | 895 | ||
| 905 | struct vmbus_channel_debug_info { | ||
| 906 | u32 relid; | ||
| 907 | enum vmbus_channel_state state; | ||
| 908 | uuid_le interfacetype; | ||
| 909 | uuid_le interface_instance; | ||
| 910 | u32 monitorid; | ||
| 911 | u32 servermonitor_pending; | ||
| 912 | u32 servermonitor_latency; | ||
| 913 | u32 servermonitor_connectionid; | ||
| 914 | u32 clientmonitor_pending; | ||
| 915 | u32 clientmonitor_latency; | ||
| 916 | u32 clientmonitor_connectionid; | ||
| 917 | |||
| 918 | struct hv_ring_buffer_debug_info inbound; | ||
| 919 | struct hv_ring_buffer_debug_info outbound; | ||
| 920 | }; | ||
| 921 | |||
| 922 | /* | 896 | /* |
| 923 | * Represents each channel msg on the vmbus connection This is a | 897 | * Represents each channel msg on the vmbus connection This is a |
| 924 | * variable-size data structure depending on the msg type itself | 898 | * variable-size data structure depending on the msg type itself |
| @@ -1184,19 +1158,8 @@ extern int vmbus_recvpacket_raw(struct vmbus_channel *channel, | |||
| 1184 | u64 *requestid); | 1158 | u64 *requestid); |
| 1185 | 1159 | ||
| 1186 | 1160 | ||
| 1187 | extern void vmbus_get_debug_info(struct vmbus_channel *channel, | ||
| 1188 | struct vmbus_channel_debug_info *debug); | ||
| 1189 | |||
| 1190 | extern void vmbus_ontimer(unsigned long data); | 1161 | extern void vmbus_ontimer(unsigned long data); |
| 1191 | 1162 | ||
| 1192 | struct hv_dev_port_info { | ||
| 1193 | u32 int_mask; | ||
| 1194 | u32 read_idx; | ||
| 1195 | u32 write_idx; | ||
| 1196 | u32 bytes_avail_toread; | ||
| 1197 | u32 bytes_avail_towrite; | ||
| 1198 | }; | ||
| 1199 | |||
| 1200 | /* Base driver object */ | 1163 | /* Base driver object */ |
| 1201 | struct hv_driver { | 1164 | struct hv_driver { |
| 1202 | const char *name; | 1165 | const char *name; |
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 81cbbdb96aae..673a3ce67f31 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #define __TWL_H_ | 26 | #define __TWL_H_ |
| 27 | 27 | ||
| 28 | #include <linux/types.h> | 28 | #include <linux/types.h> |
| 29 | #include <linux/phy/phy.h> | ||
| 29 | #include <linux/input/matrix_keypad.h> | 30 | #include <linux/input/matrix_keypad.h> |
| 30 | 31 | ||
| 31 | /* | 32 | /* |
| @@ -615,6 +616,7 @@ enum twl4030_usb_mode { | |||
| 615 | struct twl4030_usb_data { | 616 | struct twl4030_usb_data { |
| 616 | enum twl4030_usb_mode usb_mode; | 617 | enum twl4030_usb_mode usb_mode; |
| 617 | unsigned long features; | 618 | unsigned long features; |
| 619 | struct phy_init_data *init_data; | ||
| 618 | 620 | ||
| 619 | int (*phy_init)(struct device *dev); | 621 | int (*phy_init)(struct device *dev); |
| 620 | int (*phy_exit)(struct device *dev); | 622 | int (*phy_exit)(struct device *dev); |
diff --git a/include/linux/ide.h b/include/linux/ide.h index b17974917dbf..46a14229a162 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
| @@ -1514,7 +1514,7 @@ static inline void ide_set_max_pio(ide_drive_t *drive) | |||
| 1514 | 1514 | ||
| 1515 | char *ide_media_string(ide_drive_t *); | 1515 | char *ide_media_string(ide_drive_t *); |
| 1516 | 1516 | ||
| 1517 | extern struct device_attribute ide_dev_attrs[]; | 1517 | extern const struct attribute_group *ide_dev_groups[]; |
| 1518 | extern struct bus_type ide_bus_type; | 1518 | extern struct bus_type ide_bus_type; |
| 1519 | extern struct class *ide_port_class; | 1519 | extern struct class *ide_port_class; |
| 1520 | 1520 | ||
diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h index 2bac0eb8948d..15607b45221a 100644 --- a/include/linux/iio/buffer.h +++ b/include/linux/iio/buffer.h | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #define _IIO_BUFFER_GENERIC_H_ | 11 | #define _IIO_BUFFER_GENERIC_H_ |
| 12 | #include <linux/sysfs.h> | 12 | #include <linux/sysfs.h> |
| 13 | #include <linux/iio/iio.h> | 13 | #include <linux/iio/iio.h> |
| 14 | #include <linux/kref.h> | ||
| 14 | 15 | ||
| 15 | #ifdef CONFIG_IIO_BUFFER | 16 | #ifdef CONFIG_IIO_BUFFER |
| 16 | 17 | ||
| @@ -26,6 +27,8 @@ struct iio_buffer; | |||
| 26 | * @set_bytes_per_datum:set number of bytes per datum | 27 | * @set_bytes_per_datum:set number of bytes per datum |
| 27 | * @get_length: get number of datums in buffer | 28 | * @get_length: get number of datums in buffer |
| 28 | * @set_length: set number of datums in buffer | 29 | * @set_length: set number of datums in buffer |
| 30 | * @release: called when the last reference to the buffer is dropped, | ||
| 31 | * should free all resources allocated by the buffer. | ||
| 29 | * | 32 | * |
| 30 | * The purpose of this structure is to make the buffer element | 33 | * The purpose of this structure is to make the buffer element |
| 31 | * modular as event for a given driver, different usecases may require | 34 | * modular as event for a given driver, different usecases may require |
| @@ -36,7 +39,7 @@ struct iio_buffer; | |||
| 36 | * any of them not existing. | 39 | * any of them not existing. |
| 37 | **/ | 40 | **/ |
| 38 | struct iio_buffer_access_funcs { | 41 | struct iio_buffer_access_funcs { |
| 39 | int (*store_to)(struct iio_buffer *buffer, u8 *data); | 42 | int (*store_to)(struct iio_buffer *buffer, const void *data); |
| 40 | int (*read_first_n)(struct iio_buffer *buffer, | 43 | int (*read_first_n)(struct iio_buffer *buffer, |
| 41 | size_t n, | 44 | size_t n, |
| 42 | char __user *buf); | 45 | char __user *buf); |
| @@ -47,6 +50,8 @@ struct iio_buffer_access_funcs { | |||
| 47 | int (*set_bytes_per_datum)(struct iio_buffer *buffer, size_t bpd); | 50 | int (*set_bytes_per_datum)(struct iio_buffer *buffer, size_t bpd); |
| 48 | int (*get_length)(struct iio_buffer *buffer); | 51 | int (*get_length)(struct iio_buffer *buffer); |
| 49 | int (*set_length)(struct iio_buffer *buffer, int length); | 52 | int (*set_length)(struct iio_buffer *buffer, int length); |
| 53 | |||
| 54 | void (*release)(struct iio_buffer *buffer); | ||
| 50 | }; | 55 | }; |
| 51 | 56 | ||
| 52 | /** | 57 | /** |
| @@ -67,6 +72,7 @@ struct iio_buffer_access_funcs { | |||
| 67 | * @demux_list: [INTERN] list of operations required to demux the scan. | 72 | * @demux_list: [INTERN] list of operations required to demux the scan. |
| 68 | * @demux_bounce: [INTERN] buffer for doing gather from incoming scan. | 73 | * @demux_bounce: [INTERN] buffer for doing gather from incoming scan. |
| 69 | * @buffer_list: [INTERN] entry in the devices list of current buffers. | 74 | * @buffer_list: [INTERN] entry in the devices list of current buffers. |
| 75 | * @ref: [INTERN] reference count of the buffer. | ||
| 70 | */ | 76 | */ |
| 71 | struct iio_buffer { | 77 | struct iio_buffer { |
| 72 | int length; | 78 | int length; |
| @@ -81,8 +87,9 @@ struct iio_buffer { | |||
| 81 | bool stufftoread; | 87 | bool stufftoread; |
| 82 | const struct attribute_group *attrs; | 88 | const struct attribute_group *attrs; |
| 83 | struct list_head demux_list; | 89 | struct list_head demux_list; |
| 84 | unsigned char *demux_bounce; | 90 | void *demux_bounce; |
| 85 | struct list_head buffer_list; | 91 | struct list_head buffer_list; |
| 92 | struct kref ref; | ||
| 86 | }; | 93 | }; |
| 87 | 94 | ||
| 88 | /** | 95 | /** |
| @@ -120,7 +127,32 @@ int iio_scan_mask_set(struct iio_dev *indio_dev, | |||
| 120 | * @indio_dev: iio_dev structure for device. | 127 | * @indio_dev: iio_dev structure for device. |
| 121 | * @data: Full scan. | 128 | * @data: Full scan. |
| 122 | */ | 129 | */ |
| 123 | int iio_push_to_buffers(struct iio_dev *indio_dev, unsigned char *data); | 130 | int iio_push_to_buffers(struct iio_dev *indio_dev, const void *data); |
| 131 | |||
| 132 | /* | ||
| 133 | * iio_push_to_buffers_with_timestamp() - push data and timestamp to buffers | ||
| 134 | * @indio_dev: iio_dev structure for device. | ||
| 135 | * @data: sample data | ||
| 136 | * @timestamp: timestamp for the sample data | ||
| 137 | * | ||
| 138 | * Pushes data to the IIO device's buffers. If timestamps are enabled for the | ||
| 139 | * device the function will store the supplied timestamp as the last element in | ||
| 140 | * the sample data buffer before pushing it to the device buffers. The sample | ||
| 141 | * data buffer needs to be large enough to hold the additional timestamp | ||
| 142 | * (usually the buffer should be indio->scan_bytes bytes large). | ||
| 143 | * | ||
| 144 | * Returns 0 on success, a negative error code otherwise. | ||
| 145 | */ | ||
| 146 | static inline int iio_push_to_buffers_with_timestamp(struct iio_dev *indio_dev, | ||
| 147 | void *data, int64_t timestamp) | ||
| 148 | { | ||
| 149 | if (indio_dev->scan_timestamp) { | ||
| 150 | size_t ts_offset = indio_dev->scan_bytes / sizeof(int64_t) - 1; | ||
| 151 | ((int64_t *)data)[ts_offset] = timestamp; | ||
| 152 | } | ||
| 153 | |||
| 154 | return iio_push_to_buffers(indio_dev, data); | ||
| 155 | } | ||
| 124 | 156 | ||
| 125 | int iio_update_demux(struct iio_dev *indio_dev); | 157 | int iio_update_demux(struct iio_dev *indio_dev); |
| 126 | 158 | ||
| @@ -174,11 +206,27 @@ ssize_t iio_buffer_show_enable(struct device *dev, | |||
| 174 | iio_buffer_show_enable, \ | 206 | iio_buffer_show_enable, \ |
| 175 | iio_buffer_store_enable) | 207 | iio_buffer_store_enable) |
| 176 | 208 | ||
| 177 | int iio_sw_buffer_preenable(struct iio_dev *indio_dev); | ||
| 178 | |||
| 179 | bool iio_validate_scan_mask_onehot(struct iio_dev *indio_dev, | 209 | bool iio_validate_scan_mask_onehot(struct iio_dev *indio_dev, |
| 180 | const unsigned long *mask); | 210 | const unsigned long *mask); |
| 181 | 211 | ||
| 212 | struct iio_buffer *iio_buffer_get(struct iio_buffer *buffer); | ||
| 213 | void iio_buffer_put(struct iio_buffer *buffer); | ||
| 214 | |||
| 215 | /** | ||
| 216 | * iio_device_attach_buffer - Attach a buffer to a IIO device | ||
| 217 | * @indio_dev: The device the buffer should be attached to | ||
| 218 | * @buffer: The buffer to attach to the device | ||
| 219 | * | ||
| 220 | * This function attaches a buffer to a IIO device. The buffer stays attached to | ||
| 221 | * the device until the device is freed. The function should only be called at | ||
| 222 | * most once per device. | ||
| 223 | */ | ||
| 224 | static inline void iio_device_attach_buffer(struct iio_dev *indio_dev, | ||
| 225 | struct iio_buffer *buffer) | ||
| 226 | { | ||
| 227 | indio_dev->buffer = iio_buffer_get(buffer); | ||
| 228 | } | ||
| 229 | |||
| 182 | #else /* CONFIG_IIO_BUFFER */ | 230 | #else /* CONFIG_IIO_BUFFER */ |
| 183 | 231 | ||
| 184 | static inline int iio_buffer_register(struct iio_dev *indio_dev, | 232 | static inline int iio_buffer_register(struct iio_dev *indio_dev, |
| @@ -191,6 +239,9 @@ static inline int iio_buffer_register(struct iio_dev *indio_dev, | |||
| 191 | static inline void iio_buffer_unregister(struct iio_dev *indio_dev) | 239 | static inline void iio_buffer_unregister(struct iio_dev *indio_dev) |
| 192 | {} | 240 | {} |
| 193 | 241 | ||
| 242 | static inline void iio_buffer_get(struct iio_buffer *buffer) {} | ||
| 243 | static inline void iio_buffer_put(struct iio_buffer *buffer) {} | ||
| 244 | |||
| 194 | #endif /* CONFIG_IIO_BUFFER */ | 245 | #endif /* CONFIG_IIO_BUFFER */ |
| 195 | 246 | ||
| 196 | #endif /* _IIO_BUFFER_GENERIC_H_ */ | 247 | #endif /* _IIO_BUFFER_GENERIC_H_ */ |
diff --git a/include/linux/iio/common/st_sensors.h b/include/linux/iio/common/st_sensors.h index e51f65480ea5..3c005eb3a0a4 100644 --- a/include/linux/iio/common/st_sensors.h +++ b/include/linux/iio/common/st_sensors.h | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/irqreturn.h> | 16 | #include <linux/irqreturn.h> |
| 17 | #include <linux/iio/trigger.h> | 17 | #include <linux/iio/trigger.h> |
| 18 | #include <linux/bitops.h> | 18 | #include <linux/bitops.h> |
| 19 | #include <linux/regulator/consumer.h> | ||
| 19 | 20 | ||
| 20 | #include <linux/platform_data/st_sensors_pdata.h> | 21 | #include <linux/platform_data/st_sensors_pdata.h> |
| 21 | 22 | ||
| @@ -184,6 +185,7 @@ struct st_sensors { | |||
| 184 | u8 wai; | 185 | u8 wai; |
| 185 | char sensors_supported[ST_SENSORS_MAX_4WAI][ST_SENSORS_MAX_NAME]; | 186 | char sensors_supported[ST_SENSORS_MAX_4WAI][ST_SENSORS_MAX_NAME]; |
| 186 | struct iio_chan_spec *ch; | 187 | struct iio_chan_spec *ch; |
| 188 | int num_ch; | ||
| 187 | struct st_sensor_odr odr; | 189 | struct st_sensor_odr odr; |
| 188 | struct st_sensor_power pw; | 190 | struct st_sensor_power pw; |
| 189 | struct st_sensor_axis enable_axis; | 191 | struct st_sensor_axis enable_axis; |
| @@ -200,6 +202,8 @@ struct st_sensors { | |||
| 200 | * @trig: The trigger in use by the core driver. | 202 | * @trig: The trigger in use by the core driver. |
| 201 | * @sensor: Pointer to the current sensor struct in use. | 203 | * @sensor: Pointer to the current sensor struct in use. |
| 202 | * @current_fullscale: Maximum range of measure by the sensor. | 204 | * @current_fullscale: Maximum range of measure by the sensor. |
| 205 | * @vdd: Pointer to sensor's Vdd power supply | ||
| 206 | * @vdd_io: Pointer to sensor's Vdd-IO power supply | ||
| 203 | * @enabled: Status of the sensor (false->off, true->on). | 207 | * @enabled: Status of the sensor (false->off, true->on). |
| 204 | * @multiread_bit: Use or not particular bit for [I2C/SPI] multiread. | 208 | * @multiread_bit: Use or not particular bit for [I2C/SPI] multiread. |
| 205 | * @buffer_data: Data used by buffer part. | 209 | * @buffer_data: Data used by buffer part. |
| @@ -215,6 +219,8 @@ struct st_sensor_data { | |||
| 215 | struct iio_trigger *trig; | 219 | struct iio_trigger *trig; |
| 216 | struct st_sensors *sensor; | 220 | struct st_sensors *sensor; |
| 217 | struct st_sensor_fullscale_avl *current_fullscale; | 221 | struct st_sensor_fullscale_avl *current_fullscale; |
| 222 | struct regulator *vdd; | ||
| 223 | struct regulator *vdd_io; | ||
| 218 | 224 | ||
| 219 | bool enabled; | 225 | bool enabled; |
| 220 | bool multiread_bit; | 226 | bool multiread_bit; |
diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h index 833926c91aa8..2752b1fd12be 100644 --- a/include/linux/iio/consumer.h +++ b/include/linux/iio/consumer.h | |||
| @@ -77,7 +77,7 @@ struct iio_cb_buffer; | |||
| 77 | * fail. | 77 | * fail. |
| 78 | */ | 78 | */ |
| 79 | struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev, | 79 | struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev, |
| 80 | int (*cb)(u8 *data, | 80 | int (*cb)(const void *data, |
| 81 | void *private), | 81 | void *private), |
| 82 | void *private); | 82 | void *private); |
| 83 | /** | 83 | /** |
diff --git a/include/linux/iio/events.h b/include/linux/iio/events.h index 13ce220c7003..5dab2c41031f 100644 --- a/include/linux/iio/events.h +++ b/include/linux/iio/events.h | |||
| @@ -26,20 +26,6 @@ struct iio_event_data { | |||
| 26 | 26 | ||
| 27 | #define IIO_GET_EVENT_FD_IOCTL _IOR('i', 0x90, int) | 27 | #define IIO_GET_EVENT_FD_IOCTL _IOR('i', 0x90, int) |
| 28 | 28 | ||
| 29 | enum iio_event_type { | ||
| 30 | IIO_EV_TYPE_THRESH, | ||
| 31 | IIO_EV_TYPE_MAG, | ||
| 32 | IIO_EV_TYPE_ROC, | ||
| 33 | IIO_EV_TYPE_THRESH_ADAPTIVE, | ||
| 34 | IIO_EV_TYPE_MAG_ADAPTIVE, | ||
| 35 | }; | ||
| 36 | |||
| 37 | enum iio_event_direction { | ||
| 38 | IIO_EV_DIR_EITHER, | ||
| 39 | IIO_EV_DIR_RISING, | ||
| 40 | IIO_EV_DIR_FALLING, | ||
| 41 | }; | ||
| 42 | |||
| 43 | /** | 29 | /** |
| 44 | * IIO_EVENT_CODE() - create event identifier | 30 | * IIO_EVENT_CODE() - create event identifier |
| 45 | * @chan_type: Type of the channel. Should be one of enum iio_chan_type. | 31 | * @chan_type: Type of the channel. Should be one of enum iio_chan_type. |
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 2103cc32a5fb..256a90a1bea6 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h | |||
| @@ -36,6 +36,14 @@ enum iio_chan_info_enum { | |||
| 36 | IIO_CHAN_INFO_PHASE, | 36 | IIO_CHAN_INFO_PHASE, |
| 37 | IIO_CHAN_INFO_HARDWAREGAIN, | 37 | IIO_CHAN_INFO_HARDWAREGAIN, |
| 38 | IIO_CHAN_INFO_HYSTERESIS, | 38 | IIO_CHAN_INFO_HYSTERESIS, |
| 39 | IIO_CHAN_INFO_INT_TIME, | ||
| 40 | }; | ||
| 41 | |||
| 42 | enum iio_shared_by { | ||
| 43 | IIO_SEPARATE, | ||
| 44 | IIO_SHARED_BY_TYPE, | ||
| 45 | IIO_SHARED_BY_DIR, | ||
| 46 | IIO_SHARED_BY_ALL | ||
| 39 | }; | 47 | }; |
| 40 | 48 | ||
| 41 | enum iio_endian { | 49 | enum iio_endian { |
| @@ -57,7 +65,7 @@ struct iio_dev; | |||
| 57 | */ | 65 | */ |
| 58 | struct iio_chan_spec_ext_info { | 66 | struct iio_chan_spec_ext_info { |
| 59 | const char *name; | 67 | const char *name; |
| 60 | bool shared; | 68 | enum iio_shared_by shared; |
| 61 | ssize_t (*read)(struct iio_dev *, uintptr_t private, | 69 | ssize_t (*read)(struct iio_dev *, uintptr_t private, |
| 62 | struct iio_chan_spec const *, char *buf); | 70 | struct iio_chan_spec const *, char *buf); |
| 63 | ssize_t (*write)(struct iio_dev *, uintptr_t private, | 71 | ssize_t (*write)(struct iio_dev *, uintptr_t private, |
| @@ -125,12 +133,35 @@ ssize_t iio_enum_write(struct iio_dev *indio_dev, | |||
| 125 | #define IIO_ENUM_AVAILABLE(_name, _e) \ | 133 | #define IIO_ENUM_AVAILABLE(_name, _e) \ |
| 126 | { \ | 134 | { \ |
| 127 | .name = (_name "_available"), \ | 135 | .name = (_name "_available"), \ |
| 128 | .shared = true, \ | 136 | .shared = IIO_SHARED_BY_TYPE, \ |
| 129 | .read = iio_enum_available_read, \ | 137 | .read = iio_enum_available_read, \ |
| 130 | .private = (uintptr_t)(_e), \ | 138 | .private = (uintptr_t)(_e), \ |
| 131 | } | 139 | } |
| 132 | 140 | ||
| 133 | /** | 141 | /** |
| 142 | * struct iio_event_spec - specification for a channel event | ||
| 143 | * @type: Type of the event | ||
| 144 | * @dir: Direction of the event | ||
| 145 | * @mask_separate: Bit mask of enum iio_event_info values. Attributes | ||
| 146 | * set in this mask will be registered per channel. | ||
| 147 | * @mask_shared_by_type: Bit mask of enum iio_event_info values. Attributes | ||
| 148 | * set in this mask will be shared by channel type. | ||
| 149 | * @mask_shared_by_dir: Bit mask of enum iio_event_info values. Attributes | ||
| 150 | * set in this mask will be shared by channel type and | ||
| 151 | * direction. | ||
| 152 | * @mask_shared_by_all: Bit mask of enum iio_event_info values. Attributes | ||
| 153 | * set in this mask will be shared by all channels. | ||
| 154 | */ | ||
| 155 | struct iio_event_spec { | ||
| 156 | enum iio_event_type type; | ||
| 157 | enum iio_event_direction dir; | ||
| 158 | unsigned long mask_separate; | ||
| 159 | unsigned long mask_shared_by_type; | ||
| 160 | unsigned long mask_shared_by_dir; | ||
| 161 | unsigned long mask_shared_by_all; | ||
| 162 | }; | ||
| 163 | |||
| 164 | /** | ||
| 134 | * struct iio_chan_spec - specification of a single channel | 165 | * struct iio_chan_spec - specification of a single channel |
| 135 | * @type: What type of measurement is the channel making. | 166 | * @type: What type of measurement is the channel making. |
| 136 | * @channel: What number do we wish to assign the channel. | 167 | * @channel: What number do we wish to assign the channel. |
| @@ -146,13 +177,18 @@ ssize_t iio_enum_write(struct iio_dev *indio_dev, | |||
| 146 | * shift: Shift right by this before masking out | 177 | * shift: Shift right by this before masking out |
| 147 | * realbits. | 178 | * realbits. |
| 148 | * endianness: little or big endian | 179 | * endianness: little or big endian |
| 149 | * @info_mask: What information is to be exported about this channel. | ||
| 150 | * This includes calibbias, scale etc. | ||
| 151 | * @info_mask_separate: What information is to be exported that is specific to | 180 | * @info_mask_separate: What information is to be exported that is specific to |
| 152 | * this channel. | 181 | * this channel. |
| 153 | * @info_mask_shared_by_type: What information is to be exported that is shared | 182 | * @info_mask_shared_by_type: What information is to be exported that is shared |
| 154 | * by all channels of the same type. | 183 | * by all channels of the same type. |
| 184 | * @info_mask_shared_by_dir: What information is to be exported that is shared | ||
| 185 | * by all channels of the same direction. | ||
| 186 | * @info_mask_shared_by_all: What information is to be exported that is shared | ||
| 187 | * by all channels. | ||
| 155 | * @event_mask: What events can this channel produce. | 188 | * @event_mask: What events can this channel produce. |
| 189 | * @event_spec: Array of events which should be registered for this | ||
| 190 | * channel. | ||
| 191 | * @num_event_specs: Size of the event_spec array. | ||
| 156 | * @ext_info: Array of extended info attributes for this channel. | 192 | * @ext_info: Array of extended info attributes for this channel. |
| 157 | * The array is NULL terminated, the last element should | 193 | * The array is NULL terminated, the last element should |
| 158 | * have its name field set to NULL. | 194 | * have its name field set to NULL. |
| @@ -186,10 +222,13 @@ struct iio_chan_spec { | |||
| 186 | u8 shift; | 222 | u8 shift; |
| 187 | enum iio_endian endianness; | 223 | enum iio_endian endianness; |
| 188 | } scan_type; | 224 | } scan_type; |
| 189 | long info_mask; | ||
| 190 | long info_mask_separate; | 225 | long info_mask_separate; |
| 191 | long info_mask_shared_by_type; | 226 | long info_mask_shared_by_type; |
| 227 | long info_mask_shared_by_dir; | ||
| 228 | long info_mask_shared_by_all; | ||
| 192 | long event_mask; | 229 | long event_mask; |
| 230 | const struct iio_event_spec *event_spec; | ||
| 231 | unsigned int num_event_specs; | ||
| 193 | const struct iio_chan_spec_ext_info *ext_info; | 232 | const struct iio_chan_spec_ext_info *ext_info; |
| 194 | const char *extend_name; | 233 | const char *extend_name; |
| 195 | const char *datasheet_name; | 234 | const char *datasheet_name; |
| @@ -212,7 +251,9 @@ static inline bool iio_channel_has_info(const struct iio_chan_spec *chan, | |||
| 212 | enum iio_chan_info_enum type) | 251 | enum iio_chan_info_enum type) |
| 213 | { | 252 | { |
| 214 | return (chan->info_mask_separate & BIT(type)) | | 253 | return (chan->info_mask_separate & BIT(type)) | |
| 215 | (chan->info_mask_shared_by_type & BIT(type)); | 254 | (chan->info_mask_shared_by_type & BIT(type)) | |
| 255 | (chan->info_mask_shared_by_dir & BIT(type)) | | ||
| 256 | (chan->info_mask_shared_by_all & BIT(type)); | ||
| 216 | } | 257 | } |
| 217 | 258 | ||
| 218 | #define IIO_ST(si, rb, sb, sh) \ | 259 | #define IIO_ST(si, rb, sb, sh) \ |
| @@ -270,6 +311,12 @@ struct iio_dev; | |||
| 270 | * is event dependant. event_code specifies which event. | 311 | * is event dependant. event_code specifies which event. |
| 271 | * @write_event_value: write the value associated with the event. | 312 | * @write_event_value: write the value associated with the event. |
| 272 | * Meaning is event dependent. | 313 | * Meaning is event dependent. |
| 314 | * @read_event_config_new: find out if the event is enabled. New style interface. | ||
| 315 | * @write_event_config_new: set if the event is enabled. New style interface. | ||
| 316 | * @read_event_value_new: read a configuration value associated with the event. | ||
| 317 | * New style interface. | ||
| 318 | * @write_event_value_new: write a configuration value for the event. New style | ||
| 319 | * interface. | ||
| 273 | * @validate_trigger: function to validate the trigger when the | 320 | * @validate_trigger: function to validate the trigger when the |
| 274 | * current trigger gets changed. | 321 | * current trigger gets changed. |
| 275 | * @update_scan_mode: function to configure device and scan buffer when | 322 | * @update_scan_mode: function to configure device and scan buffer when |
| @@ -310,6 +357,30 @@ struct iio_info { | |||
| 310 | int (*write_event_value)(struct iio_dev *indio_dev, | 357 | int (*write_event_value)(struct iio_dev *indio_dev, |
| 311 | u64 event_code, | 358 | u64 event_code, |
| 312 | int val); | 359 | int val); |
| 360 | |||
| 361 | int (*read_event_config_new)(struct iio_dev *indio_dev, | ||
| 362 | const struct iio_chan_spec *chan, | ||
| 363 | enum iio_event_type type, | ||
| 364 | enum iio_event_direction dir); | ||
| 365 | |||
| 366 | int (*write_event_config_new)(struct iio_dev *indio_dev, | ||
| 367 | const struct iio_chan_spec *chan, | ||
| 368 | enum iio_event_type type, | ||
| 369 | enum iio_event_direction dir, | ||
| 370 | int state); | ||
| 371 | |||
| 372 | int (*read_event_value_new)(struct iio_dev *indio_dev, | ||
| 373 | const struct iio_chan_spec *chan, | ||
| 374 | enum iio_event_type type, | ||
| 375 | enum iio_event_direction dir, | ||
| 376 | enum iio_event_info info, int *val, int *val2); | ||
| 377 | |||
| 378 | int (*write_event_value_new)(struct iio_dev *indio_dev, | ||
| 379 | const struct iio_chan_spec *chan, | ||
| 380 | enum iio_event_type type, | ||
| 381 | enum iio_event_direction dir, | ||
| 382 | enum iio_event_info info, int val, int val2); | ||
| 383 | |||
| 313 | int (*validate_trigger)(struct iio_dev *indio_dev, | 384 | int (*validate_trigger)(struct iio_dev *indio_dev, |
| 314 | struct iio_trigger *trig); | 385 | struct iio_trigger *trig); |
| 315 | int (*update_scan_mode)(struct iio_dev *indio_dev, | 386 | int (*update_scan_mode)(struct iio_dev *indio_dev, |
| @@ -457,7 +528,7 @@ static inline void iio_device_put(struct iio_dev *indio_dev) | |||
| 457 | { | 528 | { |
| 458 | if (indio_dev) | 529 | if (indio_dev) |
| 459 | put_device(&indio_dev->dev); | 530 | put_device(&indio_dev->dev); |
| 460 | }; | 531 | } |
| 461 | 532 | ||
| 462 | /** | 533 | /** |
| 463 | * dev_to_iio_dev() - Get IIO device struct from a device struct | 534 | * dev_to_iio_dev() - Get IIO device struct from a device struct |
| @@ -593,7 +664,7 @@ static inline bool iio_buffer_enabled(struct iio_dev *indio_dev) | |||
| 593 | { | 664 | { |
| 594 | return indio_dev->currentmode | 665 | return indio_dev->currentmode |
| 595 | & (INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE); | 666 | & (INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE); |
| 596 | }; | 667 | } |
| 597 | 668 | ||
| 598 | /** | 669 | /** |
| 599 | * iio_get_debugfs_dentry() - helper function to get the debugfs_dentry | 670 | * iio_get_debugfs_dentry() - helper function to get the debugfs_dentry |
| @@ -603,12 +674,12 @@ static inline bool iio_buffer_enabled(struct iio_dev *indio_dev) | |||
| 603 | static inline struct dentry *iio_get_debugfs_dentry(struct iio_dev *indio_dev) | 674 | static inline struct dentry *iio_get_debugfs_dentry(struct iio_dev *indio_dev) |
| 604 | { | 675 | { |
| 605 | return indio_dev->debugfs_dentry; | 676 | return indio_dev->debugfs_dentry; |
| 606 | }; | 677 | } |
| 607 | #else | 678 | #else |
| 608 | static inline struct dentry *iio_get_debugfs_dentry(struct iio_dev *indio_dev) | 679 | static inline struct dentry *iio_get_debugfs_dentry(struct iio_dev *indio_dev) |
| 609 | { | 680 | { |
| 610 | return NULL; | 681 | return NULL; |
| 611 | }; | 682 | } |
| 612 | #endif | 683 | #endif |
| 613 | 684 | ||
| 614 | int iio_str_to_fixpoint(const char *str, int fract_mult, int *integer, | 685 | int iio_str_to_fixpoint(const char *str, int fract_mult, int *integer, |
diff --git a/include/linux/iio/sysfs.h b/include/linux/iio/sysfs.h index 2958c960003a..8a1d18640ab9 100644 --- a/include/linux/iio/sysfs.h +++ b/include/linux/iio/sysfs.h | |||
| @@ -100,6 +100,21 @@ struct iio_const_attr { | |||
| 100 | #define IIO_CONST_ATTR_SAMP_FREQ_AVAIL(_string) \ | 100 | #define IIO_CONST_ATTR_SAMP_FREQ_AVAIL(_string) \ |
| 101 | IIO_CONST_ATTR(sampling_frequency_available, _string) | 101 | IIO_CONST_ATTR(sampling_frequency_available, _string) |
| 102 | 102 | ||
| 103 | /** | ||
| 104 | * IIO_DEV_ATTR_INT_TIME_AVAIL - list available integration times | ||
| 105 | * @_show: output method for the attribute | ||
| 106 | **/ | ||
| 107 | #define IIO_DEV_ATTR_INT_TIME_AVAIL(_show) \ | ||
| 108 | IIO_DEVICE_ATTR(integration_time_available, S_IRUGO, _show, NULL, 0) | ||
| 109 | /** | ||
| 110 | * IIO_CONST_ATTR_INT_TIME_AVAIL - list available integration times | ||
| 111 | * @_string: frequency string for the attribute | ||
| 112 | * | ||
| 113 | * Constant version | ||
| 114 | **/ | ||
| 115 | #define IIO_CONST_ATTR_INT_TIME_AVAIL(_string) \ | ||
| 116 | IIO_CONST_ATTR(integration_time_available, _string) | ||
| 117 | |||
| 103 | #define IIO_DEV_ATTR_TEMP_RAW(_show) \ | 118 | #define IIO_DEV_ATTR_TEMP_RAW(_show) \ |
| 104 | IIO_DEVICE_ATTR(in_temp_raw, S_IRUGO, _show, NULL, 0) | 119 | IIO_DEVICE_ATTR(in_temp_raw, S_IRUGO, _show, NULL, 0) |
| 105 | 120 | ||
diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h index 88bf0f0d27b4..4ac928ee31c5 100644 --- a/include/linux/iio/types.h +++ b/include/linux/iio/types.h | |||
| @@ -54,6 +54,26 @@ enum iio_modifier { | |||
| 54 | IIO_MOD_LIGHT_BLUE, | 54 | IIO_MOD_LIGHT_BLUE, |
| 55 | }; | 55 | }; |
| 56 | 56 | ||
| 57 | enum iio_event_type { | ||
| 58 | IIO_EV_TYPE_THRESH, | ||
| 59 | IIO_EV_TYPE_MAG, | ||
| 60 | IIO_EV_TYPE_ROC, | ||
| 61 | IIO_EV_TYPE_THRESH_ADAPTIVE, | ||
| 62 | IIO_EV_TYPE_MAG_ADAPTIVE, | ||
| 63 | }; | ||
| 64 | |||
| 65 | enum iio_event_info { | ||
| 66 | IIO_EV_INFO_ENABLE, | ||
| 67 | IIO_EV_INFO_VALUE, | ||
| 68 | IIO_EV_INFO_HYSTERESIS, | ||
| 69 | }; | ||
| 70 | |||
| 71 | enum iio_event_direction { | ||
| 72 | IIO_EV_DIR_EITHER, | ||
| 73 | IIO_EV_DIR_RISING, | ||
| 74 | IIO_EV_DIR_FALLING, | ||
| 75 | }; | ||
| 76 | |||
| 57 | #define IIO_VAL_INT 1 | 77 | #define IIO_VAL_INT 1 |
| 58 | #define IIO_VAL_INT_PLUS_MICRO 2 | 78 | #define IIO_VAL_INT_PLUS_MICRO 2 |
| 59 | #define IIO_VAL_INT_PLUS_NANO 3 | 79 | #define IIO_VAL_INT_PLUS_NANO 3 |
diff --git a/include/linux/init.h b/include/linux/init.h index f1c27a71d03c..8e68a64bfe00 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
| @@ -26,8 +26,8 @@ | |||
| 26 | * extern int initialize_foobar_device(int, int, int) __init; | 26 | * extern int initialize_foobar_device(int, int, int) __init; |
| 27 | * | 27 | * |
| 28 | * For initialized data: | 28 | * For initialized data: |
| 29 | * You should insert __initdata between the variable name and equal | 29 | * You should insert __initdata or __initconst between the variable name |
| 30 | * sign followed by value, e.g.: | 30 | * and equal sign followed by value, e.g.: |
| 31 | * | 31 | * |
| 32 | * static int init_variable __initdata = 0; | 32 | * static int init_variable __initdata = 0; |
| 33 | * static const char linux_logo[] __initconst = { 0x32, 0x36, ... }; | 33 | * static const char linux_logo[] __initconst = { 0x32, 0x36, ... }; |
| @@ -35,8 +35,6 @@ | |||
| 35 | * Don't forget to initialize data not at file scope, i.e. within a function, | 35 | * Don't forget to initialize data not at file scope, i.e. within a function, |
| 36 | * as gcc otherwise puts the data into the bss section and not into the init | 36 | * as gcc otherwise puts the data into the bss section and not into the init |
| 37 | * section. | 37 | * section. |
| 38 | * | ||
| 39 | * Also note, that this data cannot be "const". | ||
| 40 | */ | 38 | */ |
| 41 | 39 | ||
| 42 | /* These are for everybody (although not all archs will actually | 40 | /* These are for everybody (although not all archs will actually |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 5e865b554940..c9e831dc80bc 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | #include <linux/atomic.h> | 20 | #include <linux/atomic.h> |
| 21 | #include <asm/ptrace.h> | 21 | #include <asm/ptrace.h> |
| 22 | #include <asm/irq.h> | ||
| 22 | 23 | ||
| 23 | /* | 24 | /* |
| 24 | * These correspond to the IORESOURCE_IRQ_* defines in | 25 | * These correspond to the IORESOURCE_IRQ_* defines in |
| @@ -374,6 +375,16 @@ struct softirq_action | |||
| 374 | 375 | ||
| 375 | asmlinkage void do_softirq(void); | 376 | asmlinkage void do_softirq(void); |
| 376 | asmlinkage void __do_softirq(void); | 377 | asmlinkage void __do_softirq(void); |
| 378 | |||
| 379 | #ifdef __ARCH_HAS_DO_SOFTIRQ | ||
| 380 | void do_softirq_own_stack(void); | ||
| 381 | #else | ||
| 382 | static inline void do_softirq_own_stack(void) | ||
| 383 | { | ||
| 384 | __do_softirq(); | ||
| 385 | } | ||
| 386 | #endif | ||
| 387 | |||
| 377 | extern void open_softirq(int nr, void (*action)(struct softirq_action *)); | 388 | extern void open_softirq(int nr, void (*action)(struct softirq_action *)); |
| 378 | extern void softirq_init(void); | 389 | extern void softirq_init(void); |
| 379 | extern void __raise_softirq_irqoff(unsigned int nr); | 390 | extern void __raise_softirq_irqoff(unsigned int nr); |
diff --git a/include/linux/irqchip/bcm2835.h b/include/linux/irqchip/bcm2835.h deleted file mode 100644 index 48a859bc9dca..000000000000 --- a/include/linux/irqchip/bcm2835.h +++ /dev/null | |||
| @@ -1,29 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2010 Broadcom | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License as published by | ||
| 6 | * the Free Software Foundation; either version 2 of the License, or | ||
| 7 | * (at your option) any later version. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program; if not, write to the Free Software | ||
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef __LINUX_IRQCHIP_BCM2835_H_ | ||
| 20 | #define __LINUX_IRQCHIP_BCM2835_H_ | ||
| 21 | |||
| 22 | #include <asm/exception.h> | ||
| 23 | |||
| 24 | extern void bcm2835_init_irq(void); | ||
| 25 | |||
| 26 | extern asmlinkage void __exception_irq_entry bcm2835_handle_irq( | ||
| 27 | struct pt_regs *regs); | ||
| 28 | |||
| 29 | #endif | ||
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h index e96be7245717..39999775b922 100644 --- a/include/linux/jump_label.h +++ b/include/linux/jump_label.h | |||
| @@ -140,14 +140,14 @@ static __always_inline void jump_label_init(void) | |||
| 140 | 140 | ||
| 141 | static __always_inline bool static_key_false(struct static_key *key) | 141 | static __always_inline bool static_key_false(struct static_key *key) |
| 142 | { | 142 | { |
| 143 | if (unlikely(atomic_read(&key->enabled)) > 0) | 143 | if (unlikely(atomic_read(&key->enabled) > 0)) |
| 144 | return true; | 144 | return true; |
| 145 | return false; | 145 | return false; |
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | static __always_inline bool static_key_true(struct static_key *key) | 148 | static __always_inline bool static_key_true(struct static_key *key) |
| 149 | { | 149 | { |
| 150 | if (likely(atomic_read(&key->enabled)) > 0) | 150 | if (likely(atomic_read(&key->enabled) > 0)) |
| 151 | return true; | 151 | return true; |
| 152 | return false; | 152 | return false; |
| 153 | } | 153 | } |
diff --git a/include/linux/kdb.h b/include/linux/kdb.h index 7f6fe6e015bc..290db1269c4c 100644 --- a/include/linux/kdb.h +++ b/include/linux/kdb.h | |||
| @@ -109,6 +109,7 @@ typedef enum { | |||
| 109 | KDB_REASON_RECURSE, /* Recursive entry to kdb; | 109 | KDB_REASON_RECURSE, /* Recursive entry to kdb; |
| 110 | * regs probably valid */ | 110 | * regs probably valid */ |
| 111 | KDB_REASON_SSTEP, /* Single Step trap. - regs valid */ | 111 | KDB_REASON_SSTEP, /* Single Step trap. - regs valid */ |
| 112 | KDB_REASON_SYSTEM_NMI, /* In NMI due to SYSTEM cmd; regs valid */ | ||
| 112 | } kdb_reason_t; | 113 | } kdb_reason_t; |
| 113 | 114 | ||
| 114 | extern int kdb_trap_printk; | 115 | extern int kdb_trap_printk; |
diff --git a/include/linux/kernel-page-flags.h b/include/linux/kernel-page-flags.h index 546eb6a76934..f65ce09784f1 100644 --- a/include/linux/kernel-page-flags.h +++ b/include/linux/kernel-page-flags.h | |||
| @@ -15,5 +15,6 @@ | |||
| 15 | #define KPF_OWNER_PRIVATE 37 | 15 | #define KPF_OWNER_PRIVATE 37 |
| 16 | #define KPF_ARCH 38 | 16 | #define KPF_ARCH 38 |
| 17 | #define KPF_UNCACHED 39 | 17 | #define KPF_UNCACHED 39 |
| 18 | #define KPF_SOFTDIRTY 40 | ||
| 18 | 19 | ||
| 19 | #endif /* LINUX_KERNEL_PAGE_FLAGS_H */ | 20 | #endif /* LINUX_KERNEL_PAGE_FLAGS_H */ |
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h index c6e091bf39a5..dfb4f2ffdaa2 100644 --- a/include/linux/kgdb.h +++ b/include/linux/kgdb.h | |||
| @@ -310,6 +310,7 @@ extern int | |||
| 310 | kgdb_handle_exception(int ex_vector, int signo, int err_code, | 310 | kgdb_handle_exception(int ex_vector, int signo, int err_code, |
| 311 | struct pt_regs *regs); | 311 | struct pt_regs *regs); |
| 312 | extern int kgdb_nmicallback(int cpu, void *regs); | 312 | extern int kgdb_nmicallback(int cpu, void *regs); |
| 313 | extern int kgdb_nmicallin(int cpu, int trapnr, void *regs, atomic_t *snd_rdy); | ||
| 313 | extern void gdbstub_exit(int status); | 314 | extern void gdbstub_exit(int status); |
| 314 | 315 | ||
| 315 | extern int kgdb_single_step; | 316 | extern int kgdb_single_step; |
diff --git a/include/linux/kobj_completion.h b/include/linux/kobj_completion.h new file mode 100644 index 000000000000..a428f6436063 --- /dev/null +++ b/include/linux/kobj_completion.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | #ifndef _KOBJ_COMPLETION_H_ | ||
| 2 | #define _KOBJ_COMPLETION_H_ | ||
| 3 | |||
| 4 | #include <linux/kobject.h> | ||
| 5 | #include <linux/completion.h> | ||
| 6 | |||
| 7 | struct kobj_completion { | ||
| 8 | struct kobject kc_kobj; | ||
| 9 | struct completion kc_unregister; | ||
| 10 | }; | ||
| 11 | |||
| 12 | #define kobj_to_kobj_completion(kobj) \ | ||
| 13 | container_of(kobj, struct kobj_completion, kc_kobj) | ||
| 14 | |||
| 15 | void kobj_completion_init(struct kobj_completion *kc, struct kobj_type *ktype); | ||
| 16 | void kobj_completion_release(struct kobject *kobj); | ||
| 17 | void kobj_completion_del_and_wait(struct kobj_completion *kc); | ||
| 18 | #endif /* _KOBJ_COMPLETION_H_ */ | ||
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index de6dcbcc6ef7..e7ba650086ce 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
| @@ -107,6 +107,7 @@ extern int __must_check kobject_move(struct kobject *, struct kobject *); | |||
| 107 | extern struct kobject *kobject_get(struct kobject *kobj); | 107 | extern struct kobject *kobject_get(struct kobject *kobj); |
| 108 | extern void kobject_put(struct kobject *kobj); | 108 | extern void kobject_put(struct kobject *kobj); |
| 109 | 109 | ||
| 110 | extern const void *kobject_namespace(struct kobject *kobj); | ||
| 110 | extern char *kobject_get_path(struct kobject *kobj, gfp_t flag); | 111 | extern char *kobject_get_path(struct kobject *kobj, gfp_t flag); |
| 111 | 112 | ||
| 112 | struct kobj_type { | 113 | struct kobj_type { |
diff --git a/include/linux/lglock.h b/include/linux/lglock.h index 0d24e932db0b..96549abe8842 100644 --- a/include/linux/lglock.h +++ b/include/linux/lglock.h | |||
| @@ -25,16 +25,6 @@ | |||
| 25 | #include <linux/cpu.h> | 25 | #include <linux/cpu.h> |
| 26 | #include <linux/notifier.h> | 26 | #include <linux/notifier.h> |
| 27 | 27 | ||
| 28 | /* can make br locks by using local lock for read side, global lock for write */ | ||
| 29 | #define br_lock_init(name) lg_lock_init(name, #name) | ||
| 30 | #define br_read_lock(name) lg_local_lock(name) | ||
| 31 | #define br_read_unlock(name) lg_local_unlock(name) | ||
| 32 | #define br_write_lock(name) lg_global_lock(name) | ||
| 33 | #define br_write_unlock(name) lg_global_unlock(name) | ||
| 34 | |||
| 35 | #define DEFINE_BRLOCK(name) DEFINE_LGLOCK(name) | ||
| 36 | #define DEFINE_STATIC_BRLOCK(name) DEFINE_STATIC_LGLOCK(name) | ||
| 37 | |||
| 38 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 28 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
| 39 | #define LOCKDEP_INIT_MAP lockdep_init_map | 29 | #define LOCKDEP_INIT_MAP lockdep_init_map |
| 40 | #else | 30 | #else |
diff --git a/include/linux/list.h b/include/linux/list.h index f4d8a2f12a33..ef9594171062 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
| @@ -362,6 +362,17 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
| 362 | list_entry((ptr)->next, type, member) | 362 | list_entry((ptr)->next, type, member) |
| 363 | 363 | ||
| 364 | /** | 364 | /** |
| 365 | * list_last_entry - get the last element from a list | ||
| 366 | * @ptr: the list head to take the element from. | ||
| 367 | * @type: the type of the struct this is embedded in. | ||
| 368 | * @member: the name of the list_struct within the struct. | ||
| 369 | * | ||
| 370 | * Note, that list is expected to be not empty. | ||
| 371 | */ | ||
| 372 | #define list_last_entry(ptr, type, member) \ | ||
| 373 | list_entry((ptr)->prev, type, member) | ||
| 374 | |||
| 375 | /** | ||
| 365 | * list_first_entry_or_null - get the first element from a list | 376 | * list_first_entry_or_null - get the first element from a list |
| 366 | * @ptr: the list head to take the element from. | 377 | * @ptr: the list head to take the element from. |
| 367 | * @type: the type of the struct this is embedded in. | 378 | * @type: the type of the struct this is embedded in. |
| @@ -373,6 +384,22 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
| 373 | (!list_empty(ptr) ? list_first_entry(ptr, type, member) : NULL) | 384 | (!list_empty(ptr) ? list_first_entry(ptr, type, member) : NULL) |
| 374 | 385 | ||
| 375 | /** | 386 | /** |
| 387 | * list_next_entry - get the next element in list | ||
| 388 | * @pos: the type * to cursor | ||
| 389 | * @member: the name of the list_struct within the struct. | ||
| 390 | */ | ||
| 391 | #define list_next_entry(pos, member) \ | ||
| 392 | list_entry((pos)->member.next, typeof(*(pos)), member) | ||
| 393 | |||
| 394 | /** | ||
| 395 | * list_prev_entry - get the prev element in list | ||
| 396 | * @pos: the type * to cursor | ||
| 397 | * @member: the name of the list_struct within the struct. | ||
| 398 | */ | ||
| 399 | #define list_prev_entry(pos, member) \ | ||
| 400 | list_entry((pos)->member.prev, typeof(*(pos)), member) | ||
| 401 | |||
| 402 | /** | ||
| 376 | * list_for_each - iterate over a list | 403 | * list_for_each - iterate over a list |
| 377 | * @pos: the &struct list_head to use as a loop cursor. | 404 | * @pos: the &struct list_head to use as a loop cursor. |
| 378 | * @head: the head for your list. | 405 | * @head: the head for your list. |
| @@ -416,9 +443,9 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
| 416 | * @member: the name of the list_struct within the struct. | 443 | * @member: the name of the list_struct within the struct. |
| 417 | */ | 444 | */ |
| 418 | #define list_for_each_entry(pos, head, member) \ | 445 | #define list_for_each_entry(pos, head, member) \ |
| 419 | for (pos = list_entry((head)->next, typeof(*pos), member); \ | 446 | for (pos = list_first_entry(head, typeof(*pos), member); \ |
| 420 | &pos->member != (head); \ | 447 | &pos->member != (head); \ |
| 421 | pos = list_entry(pos->member.next, typeof(*pos), member)) | 448 | pos = list_next_entry(pos, member)) |
| 422 | 449 | ||
| 423 | /** | 450 | /** |
| 424 | * list_for_each_entry_reverse - iterate backwards over list of given type. | 451 | * list_for_each_entry_reverse - iterate backwards over list of given type. |
| @@ -427,9 +454,9 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
| 427 | * @member: the name of the list_struct within the struct. | 454 | * @member: the name of the list_struct within the struct. |
| 428 | */ | 455 | */ |
| 429 | #define list_for_each_entry_reverse(pos, head, member) \ | 456 | #define list_for_each_entry_reverse(pos, head, member) \ |
| 430 | for (pos = list_entry((head)->prev, typeof(*pos), member); \ | 457 | for (pos = list_last_entry(head, typeof(*pos), member); \ |
| 431 | &pos->member != (head); \ | 458 | &pos->member != (head); \ |
| 432 | pos = list_entry(pos->member.prev, typeof(*pos), member)) | 459 | pos = list_prev_entry(pos, member)) |
| 433 | 460 | ||
| 434 | /** | 461 | /** |
| 435 | * list_prepare_entry - prepare a pos entry for use in list_for_each_entry_continue() | 462 | * list_prepare_entry - prepare a pos entry for use in list_for_each_entry_continue() |
| @@ -452,9 +479,9 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
| 452 | * the current position. | 479 | * the current position. |
| 453 | */ | 480 | */ |
| 454 | #define list_for_each_entry_continue(pos, head, member) \ | 481 | #define list_for_each_entry_continue(pos, head, member) \ |
| 455 | for (pos = list_entry(pos->member.next, typeof(*pos), member); \ | 482 | for (pos = list_next_entry(pos, member); \ |
| 456 | &pos->member != (head); \ | 483 | &pos->member != (head); \ |
| 457 | pos = list_entry(pos->member.next, typeof(*pos), member)) | 484 | pos = list_next_entry(pos, member)) |
| 458 | 485 | ||
| 459 | /** | 486 | /** |
| 460 | * list_for_each_entry_continue_reverse - iterate backwards from the given point | 487 | * list_for_each_entry_continue_reverse - iterate backwards from the given point |
| @@ -466,9 +493,9 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
| 466 | * the current position. | 493 | * the current position. |
| 467 | */ | 494 | */ |
| 468 | #define list_for_each_entry_continue_reverse(pos, head, member) \ | 495 | #define list_for_each_entry_continue_reverse(pos, head, member) \ |
| 469 | for (pos = list_entry(pos->member.prev, typeof(*pos), member); \ | 496 | for (pos = list_prev_entry(pos, member); \ |
| 470 | &pos->member != (head); \ | 497 | &pos->member != (head); \ |
| 471 | pos = list_entry(pos->member.prev, typeof(*pos), member)) | 498 | pos = list_prev_entry(pos, member)) |
| 472 | 499 | ||
| 473 | /** | 500 | /** |
| 474 | * list_for_each_entry_from - iterate over list of given type from the current point | 501 | * list_for_each_entry_from - iterate over list of given type from the current point |
| @@ -479,8 +506,8 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
| 479 | * Iterate over list of given type, continuing from current position. | 506 | * Iterate over list of given type, continuing from current position. |
| 480 | */ | 507 | */ |
| 481 | #define list_for_each_entry_from(pos, head, member) \ | 508 | #define list_for_each_entry_from(pos, head, member) \ |
| 482 | for (; &pos->member != (head); \ | 509 | for (; &pos->member != (head); \ |
| 483 | pos = list_entry(pos->member.next, typeof(*pos), member)) | 510 | pos = list_next_entry(pos, member)) |
| 484 | 511 | ||
| 485 | /** | 512 | /** |
| 486 | * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry | 513 | * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry |
| @@ -490,10 +517,10 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
| 490 | * @member: the name of the list_struct within the struct. | 517 | * @member: the name of the list_struct within the struct. |
| 491 | */ | 518 | */ |
| 492 | #define list_for_each_entry_safe(pos, n, head, member) \ | 519 | #define list_for_each_entry_safe(pos, n, head, member) \ |
| 493 | for (pos = list_entry((head)->next, typeof(*pos), member), \ | 520 | for (pos = list_first_entry(head, typeof(*pos), member), \ |
| 494 | n = list_entry(pos->member.next, typeof(*pos), member); \ | 521 | n = list_next_entry(pos, member); \ |
| 495 | &pos->member != (head); \ | 522 | &pos->member != (head); \ |
| 496 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) | 523 | pos = n, n = list_next_entry(n, member)) |
| 497 | 524 | ||
| 498 | /** | 525 | /** |
| 499 | * list_for_each_entry_safe_continue - continue list iteration safe against removal | 526 | * list_for_each_entry_safe_continue - continue list iteration safe against removal |
| @@ -506,10 +533,10 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
| 506 | * safe against removal of list entry. | 533 | * safe against removal of list entry. |
| 507 | */ | 534 | */ |
| 508 | #define list_for_each_entry_safe_continue(pos, n, head, member) \ | 535 | #define list_for_each_entry_safe_continue(pos, n, head, member) \ |
| 509 | for (pos = list_entry(pos->member.next, typeof(*pos), member), \ | 536 | for (pos = list_next_entry(pos, member), \ |
| 510 | n = list_entry(pos->member.next, typeof(*pos), member); \ | 537 | n = list_next_entry(pos, member); \ |
| 511 | &pos->member != (head); \ | 538 | &pos->member != (head); \ |
| 512 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) | 539 | pos = n, n = list_next_entry(n, member)) |
| 513 | 540 | ||
| 514 | /** | 541 | /** |
| 515 | * list_for_each_entry_safe_from - iterate over list from current point safe against removal | 542 | * list_for_each_entry_safe_from - iterate over list from current point safe against removal |
| @@ -522,9 +549,9 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
| 522 | * removal of list entry. | 549 | * removal of list entry. |
| 523 | */ | 550 | */ |
| 524 | #define list_for_each_entry_safe_from(pos, n, head, member) \ | 551 | #define list_for_each_entry_safe_from(pos, n, head, member) \ |
| 525 | for (n = list_entry(pos->member.next, typeof(*pos), member); \ | 552 | for (n = list_next_entry(pos, member); \ |
| 526 | &pos->member != (head); \ | 553 | &pos->member != (head); \ |
| 527 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) | 554 | pos = n, n = list_next_entry(n, member)) |
| 528 | 555 | ||
| 529 | /** | 556 | /** |
| 530 | * list_for_each_entry_safe_reverse - iterate backwards over list safe against removal | 557 | * list_for_each_entry_safe_reverse - iterate backwards over list safe against removal |
| @@ -537,10 +564,10 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
| 537 | * of list entry. | 564 | * of list entry. |
| 538 | */ | 565 | */ |
| 539 | #define list_for_each_entry_safe_reverse(pos, n, head, member) \ | 566 | #define list_for_each_entry_safe_reverse(pos, n, head, member) \ |
| 540 | for (pos = list_entry((head)->prev, typeof(*pos), member), \ | 567 | for (pos = list_last_entry(head, typeof(*pos), member), \ |
| 541 | n = list_entry(pos->member.prev, typeof(*pos), member); \ | 568 | n = list_prev_entry(pos, member); \ |
| 542 | &pos->member != (head); \ | 569 | &pos->member != (head); \ |
| 543 | pos = n, n = list_entry(n->member.prev, typeof(*n), member)) | 570 | pos = n, n = list_prev_entry(n, member)) |
| 544 | 571 | ||
| 545 | /** | 572 | /** |
| 546 | * list_safe_reset_next - reset a stale list_for_each_entry_safe loop | 573 | * list_safe_reset_next - reset a stale list_for_each_entry_safe loop |
| @@ -555,7 +582,7 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
| 555 | * completing the current iteration of the loop body. | 582 | * completing the current iteration of the loop body. |
| 556 | */ | 583 | */ |
| 557 | #define list_safe_reset_next(pos, n, member) \ | 584 | #define list_safe_reset_next(pos, n, member) \ |
| 558 | n = list_entry(pos->member.next, typeof(*pos), member) | 585 | n = list_next_entry(pos, member) |
| 559 | 586 | ||
| 560 | /* | 587 | /* |
| 561 | * Double linked lists with a single pointer list head. | 588 | * Double linked lists with a single pointer list head. |
diff --git a/include/linux/lockref.h b/include/linux/lockref.h index f279ed9a9163..13dfd36a3294 100644 --- a/include/linux/lockref.h +++ b/include/linux/lockref.h | |||
| @@ -36,4 +36,10 @@ extern int lockref_put_or_lock(struct lockref *); | |||
| 36 | extern void lockref_mark_dead(struct lockref *); | 36 | extern void lockref_mark_dead(struct lockref *); |
| 37 | extern int lockref_get_not_dead(struct lockref *); | 37 | extern int lockref_get_not_dead(struct lockref *); |
| 38 | 38 | ||
| 39 | /* Must be called under spinlock for reliable results */ | ||
| 40 | static inline int __lockref_is_dead(const struct lockref *l) | ||
| 41 | { | ||
| 42 | return ((int)l->count < 0); | ||
| 43 | } | ||
| 44 | |||
| 39 | #endif /* __LINUX_LOCKREF_H */ | 45 | #endif /* __LINUX_LOCKREF_H */ |
diff --git a/include/linux/memblock.h b/include/linux/memblock.h index 31e95acddb4d..77c60e52939d 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h | |||
| @@ -35,6 +35,7 @@ struct memblock_type { | |||
| 35 | }; | 35 | }; |
| 36 | 36 | ||
| 37 | struct memblock { | 37 | struct memblock { |
| 38 | bool bottom_up; /* is bottom up direction? */ | ||
| 38 | phys_addr_t current_limit; | 39 | phys_addr_t current_limit; |
| 39 | struct memblock_type memory; | 40 | struct memblock_type memory; |
| 40 | struct memblock_type reserved; | 41 | struct memblock_type reserved; |
| @@ -148,6 +149,29 @@ phys_addr_t memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align, int nid) | |||
| 148 | 149 | ||
| 149 | phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align); | 150 | phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align); |
| 150 | 151 | ||
| 152 | #ifdef CONFIG_MOVABLE_NODE | ||
| 153 | /* | ||
| 154 | * Set the allocation direction to bottom-up or top-down. | ||
| 155 | */ | ||
| 156 | static inline void memblock_set_bottom_up(bool enable) | ||
| 157 | { | ||
| 158 | memblock.bottom_up = enable; | ||
| 159 | } | ||
| 160 | |||
| 161 | /* | ||
| 162 | * Check if the allocation direction is bottom-up or not. | ||
| 163 | * if this is true, that said, memblock will allocate memory | ||
| 164 | * in bottom-up direction. | ||
| 165 | */ | ||
| 166 | static inline bool memblock_bottom_up(void) | ||
| 167 | { | ||
| 168 | return memblock.bottom_up; | ||
| 169 | } | ||
| 170 | #else | ||
| 171 | static inline void memblock_set_bottom_up(bool enable) {} | ||
| 172 | static inline bool memblock_bottom_up(void) { return false; } | ||
| 173 | #endif | ||
| 174 | |||
| 151 | /* Flags for memblock_alloc_base() amd __memblock_alloc_base() */ | 175 | /* Flags for memblock_alloc_base() amd __memblock_alloc_base() */ |
| 152 | #define MEMBLOCK_ALLOC_ANYWHERE (~(phys_addr_t)0) | 176 | #define MEMBLOCK_ALLOC_ANYWHERE (~(phys_addr_t)0) |
| 153 | #define MEMBLOCK_ALLOC_ACCESSIBLE 0 | 177 | #define MEMBLOCK_ALLOC_ACCESSIBLE 0 |
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index dd38e62b84d2..4ca3d951fe91 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
| @@ -94,6 +94,8 @@ extern void __online_page_set_limits(struct page *page); | |||
| 94 | extern void __online_page_increment_counters(struct page *page); | 94 | extern void __online_page_increment_counters(struct page *page); |
| 95 | extern void __online_page_free(struct page *page); | 95 | extern void __online_page_free(struct page *page); |
| 96 | 96 | ||
| 97 | extern int try_online_node(int nid); | ||
| 98 | |||
| 97 | #ifdef CONFIG_MEMORY_HOTREMOVE | 99 | #ifdef CONFIG_MEMORY_HOTREMOVE |
| 98 | extern bool is_pageblock_removable_nolock(struct page *page); | 100 | extern bool is_pageblock_removable_nolock(struct page *page); |
| 99 | extern int arch_remove_memory(u64 start, u64 size); | 101 | extern int arch_remove_memory(u64 start, u64 size); |
| @@ -225,6 +227,11 @@ static inline void register_page_bootmem_info_node(struct pglist_data *pgdat) | |||
| 225 | { | 227 | { |
| 226 | } | 228 | } |
| 227 | 229 | ||
| 230 | static inline int try_online_node(int nid) | ||
| 231 | { | ||
| 232 | return 0; | ||
| 233 | } | ||
| 234 | |||
| 228 | static inline void lock_memory_hotplug(void) {} | 235 | static inline void lock_memory_hotplug(void) {} |
| 229 | static inline void unlock_memory_hotplug(void) {} | 236 | static inline void unlock_memory_hotplug(void) {} |
| 230 | 237 | ||
| @@ -256,14 +263,12 @@ static inline void remove_memory(int nid, u64 start, u64 size) {} | |||
| 256 | 263 | ||
| 257 | extern int walk_memory_range(unsigned long start_pfn, unsigned long end_pfn, | 264 | extern int walk_memory_range(unsigned long start_pfn, unsigned long end_pfn, |
| 258 | void *arg, int (*func)(struct memory_block *, void *)); | 265 | void *arg, int (*func)(struct memory_block *, void *)); |
| 259 | extern int mem_online_node(int nid); | ||
| 260 | extern int add_memory(int nid, u64 start, u64 size); | 266 | extern int add_memory(int nid, u64 start, u64 size); |
| 261 | extern int arch_add_memory(int nid, u64 start, u64 size); | 267 | extern int arch_add_memory(int nid, u64 start, u64 size); |
| 262 | extern int offline_pages(unsigned long start_pfn, unsigned long nr_pages); | 268 | extern int offline_pages(unsigned long start_pfn, unsigned long nr_pages); |
| 263 | extern bool is_memblock_offlined(struct memory_block *mem); | 269 | extern bool is_memblock_offlined(struct memory_block *mem); |
| 264 | extern void remove_memory(int nid, u64 start, u64 size); | 270 | extern void remove_memory(int nid, u64 start, u64 size); |
| 265 | extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn, | 271 | extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn); |
| 266 | int nr_pages); | ||
| 267 | extern void sparse_remove_one_section(struct zone *zone, struct mem_section *ms); | 272 | extern void sparse_remove_one_section(struct zone *zone, struct mem_section *ms); |
| 268 | extern struct page *sparse_decode_mem_map(unsigned long coded_mem_map, | 273 | extern struct page *sparse_decode_mem_map(unsigned long coded_mem_map, |
| 269 | unsigned long pnum); | 274 | unsigned long pnum); |
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index da6716b9e3fe..9fe426b30a41 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
| @@ -136,6 +136,7 @@ struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp, | |||
| 136 | 136 | ||
| 137 | struct mempolicy *get_vma_policy(struct task_struct *tsk, | 137 | struct mempolicy *get_vma_policy(struct task_struct *tsk, |
| 138 | struct vm_area_struct *vma, unsigned long addr); | 138 | struct vm_area_struct *vma, unsigned long addr); |
| 139 | bool vma_policy_mof(struct task_struct *task, struct vm_area_struct *vma); | ||
| 139 | 140 | ||
| 140 | extern void numa_default_policy(void); | 141 | extern void numa_default_policy(void); |
| 141 | extern void numa_policy_init(void); | 142 | extern void numa_policy_init(void); |
| @@ -168,7 +169,7 @@ int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from, | |||
| 168 | extern int mpol_parse_str(char *str, struct mempolicy **mpol); | 169 | extern int mpol_parse_str(char *str, struct mempolicy **mpol); |
| 169 | #endif | 170 | #endif |
| 170 | 171 | ||
| 171 | extern int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol); | 172 | extern void mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol); |
| 172 | 173 | ||
| 173 | /* Check if a vma is migratable */ | 174 | /* Check if a vma is migratable */ |
| 174 | static inline int vma_migratable(struct vm_area_struct *vma) | 175 | static inline int vma_migratable(struct vm_area_struct *vma) |
| @@ -306,9 +307,8 @@ static inline int mpol_parse_str(char *str, struct mempolicy **mpol) | |||
| 306 | } | 307 | } |
| 307 | #endif | 308 | #endif |
| 308 | 309 | ||
| 309 | static inline int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol) | 310 | static inline void mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol) |
| 310 | { | 311 | { |
| 311 | return 0; | ||
| 312 | } | 312 | } |
| 313 | 313 | ||
| 314 | static inline int mpol_misplaced(struct page *page, struct vm_area_struct *vma, | 314 | static inline int mpol_misplaced(struct page *page, struct vm_area_struct *vma, |
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index cebe97ee98b8..7314fc4e6d25 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h | |||
| @@ -59,6 +59,12 @@ struct mfd_cell { | |||
| 59 | * pm_runtime_no_callbacks(). | 59 | * pm_runtime_no_callbacks(). |
| 60 | */ | 60 | */ |
| 61 | bool pm_runtime_no_callbacks; | 61 | bool pm_runtime_no_callbacks; |
| 62 | |||
| 63 | /* A list of regulator supplies that should be mapped to the MFD | ||
| 64 | * device rather than the child device when requested | ||
| 65 | */ | ||
| 66 | const char **parent_supplies; | ||
| 67 | int num_parent_supplies; | ||
| 62 | }; | 68 | }; |
| 63 | 69 | ||
| 64 | /* | 70 | /* |
diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h index ca0790fba2f5..060e11256fbc 100644 --- a/include/linux/mfd/dbx500-prcmu.h +++ b/include/linux/mfd/dbx500-prcmu.h | |||
| @@ -12,6 +12,8 @@ | |||
| 12 | #include <linux/notifier.h> | 12 | #include <linux/notifier.h> |
| 13 | #include <linux/err.h> | 13 | #include <linux/err.h> |
| 14 | 14 | ||
| 15 | #include <dt-bindings/mfd/dbx500-prcmu.h> /* For clock identifiers */ | ||
| 16 | |||
| 15 | /* Offset for the firmware version within the TCPM */ | 17 | /* Offset for the firmware version within the TCPM */ |
| 16 | #define DB8500_PRCMU_FW_VERSION_OFFSET 0xA4 | 18 | #define DB8500_PRCMU_FW_VERSION_OFFSET 0xA4 |
| 17 | #define DBX540_PRCMU_FW_VERSION_OFFSET 0xA8 | 19 | #define DBX540_PRCMU_FW_VERSION_OFFSET 0xA8 |
| @@ -94,74 +96,6 @@ enum prcmu_wakeup_index { | |||
| 94 | #define PRCMU_CLKSRC_ARMCLKFIX 0x46 | 96 | #define PRCMU_CLKSRC_ARMCLKFIX 0x46 |
| 95 | #define PRCMU_CLKSRC_HDMICLK 0x47 | 97 | #define PRCMU_CLKSRC_HDMICLK 0x47 |
| 96 | 98 | ||
| 97 | /* | ||
| 98 | * Clock identifiers. | ||
| 99 | */ | ||
| 100 | enum prcmu_clock { | ||
| 101 | PRCMU_SGACLK, | ||
| 102 | PRCMU_UARTCLK, | ||
| 103 | PRCMU_MSP02CLK, | ||
| 104 | PRCMU_MSP1CLK, | ||
| 105 | PRCMU_I2CCLK, | ||
| 106 | PRCMU_SDMMCCLK, | ||
| 107 | PRCMU_SPARE1CLK, | ||
| 108 | PRCMU_SLIMCLK, | ||
| 109 | PRCMU_PER1CLK, | ||
| 110 | PRCMU_PER2CLK, | ||
| 111 | PRCMU_PER3CLK, | ||
| 112 | PRCMU_PER5CLK, | ||
| 113 | PRCMU_PER6CLK, | ||
| 114 | PRCMU_PER7CLK, | ||
| 115 | PRCMU_LCDCLK, | ||
| 116 | PRCMU_BMLCLK, | ||
| 117 | PRCMU_HSITXCLK, | ||
| 118 | PRCMU_HSIRXCLK, | ||
| 119 | PRCMU_HDMICLK, | ||
| 120 | PRCMU_APEATCLK, | ||
| 121 | PRCMU_APETRACECLK, | ||
| 122 | PRCMU_MCDECLK, | ||
| 123 | PRCMU_IPI2CCLK, | ||
| 124 | PRCMU_DSIALTCLK, | ||
| 125 | PRCMU_DMACLK, | ||
| 126 | PRCMU_B2R2CLK, | ||
| 127 | PRCMU_TVCLK, | ||
| 128 | PRCMU_SSPCLK, | ||
| 129 | PRCMU_RNGCLK, | ||
| 130 | PRCMU_UICCCLK, | ||
| 131 | PRCMU_PWMCLK, | ||
| 132 | PRCMU_IRDACLK, | ||
| 133 | PRCMU_IRRCCLK, | ||
| 134 | PRCMU_SIACLK, | ||
| 135 | PRCMU_SVACLK, | ||
| 136 | PRCMU_ACLK, | ||
| 137 | PRCMU_HVACLK, /* Ux540 only */ | ||
| 138 | PRCMU_G1CLK, /* Ux540 only */ | ||
| 139 | PRCMU_SDMMCHCLK, | ||
| 140 | PRCMU_CAMCLK, | ||
| 141 | PRCMU_BML8580CLK, | ||
| 142 | PRCMU_NUM_REG_CLOCKS, | ||
| 143 | PRCMU_SYSCLK = PRCMU_NUM_REG_CLOCKS, | ||
| 144 | PRCMU_CDCLK, | ||
| 145 | PRCMU_TIMCLK, | ||
| 146 | PRCMU_PLLSOC0, | ||
| 147 | PRCMU_PLLSOC1, | ||
| 148 | PRCMU_ARMSS, | ||
| 149 | PRCMU_PLLDDR, | ||
| 150 | PRCMU_PLLDSI, | ||
| 151 | PRCMU_DSI0CLK, | ||
| 152 | PRCMU_DSI1CLK, | ||
| 153 | PRCMU_DSI0ESCCLK, | ||
| 154 | PRCMU_DSI1ESCCLK, | ||
| 155 | PRCMU_DSI2ESCCLK, | ||
| 156 | /* LCD DSI PLL - Ux540 only */ | ||
| 157 | PRCMU_PLLDSI_LCD, | ||
| 158 | PRCMU_DSI0CLK_LCD, | ||
| 159 | PRCMU_DSI1CLK_LCD, | ||
| 160 | PRCMU_DSI0ESCCLK_LCD, | ||
| 161 | PRCMU_DSI1ESCCLK_LCD, | ||
| 162 | PRCMU_DSI2ESCCLK_LCD, | ||
| 163 | }; | ||
| 164 | |||
| 165 | /** | 99 | /** |
| 166 | * enum prcmu_wdog_id - PRCMU watchdog IDs | 100 | * enum prcmu_wdog_id - PRCMU watchdog IDs |
| 167 | * @PRCMU_WDOG_ALL: use all timers | 101 | * @PRCMU_WDOG_ALL: use all timers |
diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h index 41ed59276c00..67c17b5a6f44 100644 --- a/include/linux/mfd/mc13xxx.h +++ b/include/linux/mfd/mc13xxx.h | |||
| @@ -41,6 +41,13 @@ int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx, | |||
| 41 | unsigned int mode, unsigned int channel, | 41 | unsigned int mode, unsigned int channel, |
| 42 | u8 ato, bool atox, unsigned int *sample); | 42 | u8 ato, bool atox, unsigned int *sample); |
| 43 | 43 | ||
| 44 | #define MC13783_AUDIO_RX0 36 | ||
| 45 | #define MC13783_AUDIO_RX1 37 | ||
| 46 | #define MC13783_AUDIO_TX 38 | ||
| 47 | #define MC13783_SSI_NETWORK 39 | ||
| 48 | #define MC13783_AUDIO_CODEC 40 | ||
| 49 | #define MC13783_AUDIO_DAC 41 | ||
| 50 | |||
| 44 | #define MC13XXX_IRQ_ADCDONE 0 | 51 | #define MC13XXX_IRQ_ADCDONE 0 |
| 45 | #define MC13XXX_IRQ_ADCBISDONE 1 | 52 | #define MC13XXX_IRQ_ADCBISDONE 1 |
| 46 | #define MC13XXX_IRQ_TS 2 | 53 | #define MC13XXX_IRQ_TS 2 |
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h index 378ae8a04c6a..2d0c9071bcfb 100644 --- a/include/linux/mfd/samsung/core.h +++ b/include/linux/mfd/samsung/core.h | |||
| @@ -51,6 +51,7 @@ struct sec_pmic_dev { | |||
| 51 | int ono; | 51 | int ono; |
| 52 | int type; | 52 | int type; |
| 53 | bool wakeup; | 53 | bool wakeup; |
| 54 | bool wtsr_smpl; | ||
| 54 | }; | 55 | }; |
| 55 | 56 | ||
| 56 | int sec_irq_init(struct sec_pmic_dev *sec_pmic); | 57 | int sec_irq_init(struct sec_pmic_dev *sec_pmic); |
diff --git a/include/linux/mfd/samsung/rtc.h b/include/linux/mfd/samsung/rtc.h index 71597e20cddb..94b7cd6d8891 100644 --- a/include/linux/mfd/samsung/rtc.h +++ b/include/linux/mfd/samsung/rtc.h | |||
| @@ -62,6 +62,11 @@ enum sec_rtc_reg { | |||
| 62 | /* RTC Update Register1 */ | 62 | /* RTC Update Register1 */ |
| 63 | #define RTC_UDR_SHIFT 0 | 63 | #define RTC_UDR_SHIFT 0 |
| 64 | #define RTC_UDR_MASK (1 << RTC_UDR_SHIFT) | 64 | #define RTC_UDR_MASK (1 << RTC_UDR_SHIFT) |
| 65 | #define RTC_TCON_SHIFT 1 | ||
| 66 | #define RTC_TCON_MASK (1 << RTC_TCON_SHIFT) | ||
| 67 | #define RTC_TIME_EN_SHIFT 3 | ||
| 68 | #define RTC_TIME_EN_MASK (1 << RTC_TIME_EN_SHIFT) | ||
| 69 | |||
| 65 | /* RTC Hour register */ | 70 | /* RTC Hour register */ |
| 66 | #define HOUR_PM_SHIFT 6 | 71 | #define HOUR_PM_SHIFT 6 |
| 67 | #define HOUR_PM_MASK (1 << HOUR_PM_SHIFT) | 72 | #define HOUR_PM_MASK (1 << HOUR_PM_SHIFT) |
| @@ -69,6 +74,12 @@ enum sec_rtc_reg { | |||
| 69 | #define ALARM_ENABLE_SHIFT 7 | 74 | #define ALARM_ENABLE_SHIFT 7 |
| 70 | #define ALARM_ENABLE_MASK (1 << ALARM_ENABLE_SHIFT) | 75 | #define ALARM_ENABLE_MASK (1 << ALARM_ENABLE_SHIFT) |
| 71 | 76 | ||
| 77 | #define SMPL_ENABLE_SHIFT 7 | ||
| 78 | #define SMPL_ENABLE_MASK (1 << SMPL_ENABLE_SHIFT) | ||
| 79 | |||
| 80 | #define WTSR_ENABLE_SHIFT 6 | ||
| 81 | #define WTSR_ENABLE_MASK (1 << WTSR_ENABLE_SHIFT) | ||
| 82 | |||
| 72 | enum { | 83 | enum { |
| 73 | RTC_SEC = 0, | 84 | RTC_SEC = 0, |
| 74 | RTC_MIN, | 85 | RTC_MIN, |
diff --git a/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h b/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h index b6bdcd66c07d..7086b2248c8f 100644 --- a/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h +++ b/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h | |||
| @@ -363,4 +363,9 @@ | |||
| 363 | #define IMX6Q_GPR13_SATA_TX_LVL_1_240_V (0x1f << 2) | 363 | #define IMX6Q_GPR13_SATA_TX_LVL_1_240_V (0x1f << 2) |
| 364 | #define IMX6Q_GPR13_SATA_MPLL_CLK_EN BIT(1) | 364 | #define IMX6Q_GPR13_SATA_MPLL_CLK_EN BIT(1) |
| 365 | #define IMX6Q_GPR13_SATA_TX_EDGE_RATE BIT(0) | 365 | #define IMX6Q_GPR13_SATA_TX_EDGE_RATE BIT(0) |
| 366 | |||
| 367 | /* For imx6sl iomux gpr register field define */ | ||
| 368 | #define IMX6SL_GPR1_FEC_CLOCK_MUX1_SEL_MASK (0x3 << 17) | ||
| 369 | #define IMX6SL_GPR1_FEC_CLOCK_MUX2_SEL_MASK (0x1 << 14) | ||
| 370 | |||
| 366 | #endif /* __LINUX_IMX6Q_IOMUXC_GPR_H */ | 371 | #endif /* __LINUX_IMX6Q_IOMUXC_GPR_H */ |
diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h index 25f2c611ab01..08cce7f96ab9 100644 --- a/include/linux/mfd/ti_am335x_tscadc.h +++ b/include/linux/mfd/ti_am335x_tscadc.h | |||
| @@ -46,16 +46,24 @@ | |||
| 46 | /* Step Enable */ | 46 | /* Step Enable */ |
| 47 | #define STEPENB_MASK (0x1FFFF << 0) | 47 | #define STEPENB_MASK (0x1FFFF << 0) |
| 48 | #define STEPENB(val) ((val) << 0) | 48 | #define STEPENB(val) ((val) << 0) |
| 49 | #define ENB(val) (1 << (val)) | ||
| 50 | #define STPENB_STEPENB STEPENB(0x1FFFF) | ||
| 51 | #define STPENB_STEPENB_TC STEPENB(0x1FFF) | ||
| 49 | 52 | ||
| 50 | /* IRQ enable */ | 53 | /* IRQ enable */ |
| 51 | #define IRQENB_HW_PEN BIT(0) | 54 | #define IRQENB_HW_PEN BIT(0) |
| 52 | #define IRQENB_FIFO0THRES BIT(2) | 55 | #define IRQENB_FIFO0THRES BIT(2) |
| 56 | #define IRQENB_FIFO0OVRRUN BIT(3) | ||
| 57 | #define IRQENB_FIFO0UNDRFLW BIT(4) | ||
| 53 | #define IRQENB_FIFO1THRES BIT(5) | 58 | #define IRQENB_FIFO1THRES BIT(5) |
| 59 | #define IRQENB_FIFO1OVRRUN BIT(6) | ||
| 60 | #define IRQENB_FIFO1UNDRFLW BIT(7) | ||
| 54 | #define IRQENB_PENUP BIT(9) | 61 | #define IRQENB_PENUP BIT(9) |
| 55 | 62 | ||
| 56 | /* Step Configuration */ | 63 | /* Step Configuration */ |
| 57 | #define STEPCONFIG_MODE_MASK (3 << 0) | 64 | #define STEPCONFIG_MODE_MASK (3 << 0) |
| 58 | #define STEPCONFIG_MODE(val) ((val) << 0) | 65 | #define STEPCONFIG_MODE(val) ((val) << 0) |
| 66 | #define STEPCONFIG_MODE_SWCNT STEPCONFIG_MODE(1) | ||
| 59 | #define STEPCONFIG_MODE_HWSYNC STEPCONFIG_MODE(2) | 67 | #define STEPCONFIG_MODE_HWSYNC STEPCONFIG_MODE(2) |
| 60 | #define STEPCONFIG_AVG_MASK (7 << 2) | 68 | #define STEPCONFIG_AVG_MASK (7 << 2) |
| 61 | #define STEPCONFIG_AVG(val) ((val) << 2) | 69 | #define STEPCONFIG_AVG(val) ((val) << 2) |
| @@ -123,6 +131,7 @@ | |||
| 123 | #define ADC_CLK 3000000 | 131 | #define ADC_CLK 3000000 |
| 124 | #define TOTAL_STEPS 16 | 132 | #define TOTAL_STEPS 16 |
| 125 | #define TOTAL_CHANNELS 8 | 133 | #define TOTAL_CHANNELS 8 |
| 134 | #define FIFO1_THRESHOLD 19 | ||
| 126 | 135 | ||
| 127 | /* | 136 | /* |
| 128 | * ADC runs at 3MHz, and it takes | 137 | * ADC runs at 3MHz, and it takes |
diff --git a/include/linux/migrate.h b/include/linux/migrate.h index 8d3c57fdf221..f5096b58b20d 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h | |||
| @@ -90,11 +90,12 @@ static inline int migrate_huge_page_move_mapping(struct address_space *mapping, | |||
| 90 | #endif /* CONFIG_MIGRATION */ | 90 | #endif /* CONFIG_MIGRATION */ |
| 91 | 91 | ||
| 92 | #ifdef CONFIG_NUMA_BALANCING | 92 | #ifdef CONFIG_NUMA_BALANCING |
| 93 | extern int migrate_misplaced_page(struct page *page, int node); | 93 | extern int migrate_misplaced_page(struct page *page, |
| 94 | extern int migrate_misplaced_page(struct page *page, int node); | 94 | struct vm_area_struct *vma, int node); |
| 95 | extern bool migrate_ratelimited(int node); | 95 | extern bool migrate_ratelimited(int node); |
| 96 | #else | 96 | #else |
| 97 | static inline int migrate_misplaced_page(struct page *page, int node) | 97 | static inline int migrate_misplaced_page(struct page *page, |
| 98 | struct vm_area_struct *vma, int node) | ||
| 98 | { | 99 | { |
| 99 | return -EAGAIN; /* can't migrate now */ | 100 | return -EAGAIN; /* can't migrate now */ |
| 100 | } | 101 | } |
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index cb358355ef43..f7eaf2d60083 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | #define I2O_MINOR 166 | 31 | #define I2O_MINOR 166 |
| 32 | #define MICROCODE_MINOR 184 | 32 | #define MICROCODE_MINOR 184 |
| 33 | #define TUN_MINOR 200 | 33 | #define TUN_MINOR 200 |
| 34 | #define CUSE_MINOR 203 | ||
| 34 | #define MWAVE_MINOR 219 /* ACP/Mwave Modem */ | 35 | #define MWAVE_MINOR 219 /* ACP/Mwave Modem */ |
| 35 | #define MPT_MINOR 220 | 36 | #define MPT_MINOR 220 |
| 36 | #define MPT2SAS_MINOR 221 | 37 | #define MPT2SAS_MINOR 221 |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 8b6e55ee8855..42a35d94b82c 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -50,6 +50,10 @@ extern int sysctl_legacy_va_layout; | |||
| 50 | #include <asm/pgtable.h> | 50 | #include <asm/pgtable.h> |
| 51 | #include <asm/processor.h> | 51 | #include <asm/processor.h> |
| 52 | 52 | ||
| 53 | #ifndef __pa_symbol | ||
| 54 | #define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x), 0)) | ||
| 55 | #endif | ||
| 56 | |||
| 53 | extern unsigned long sysctl_user_reserve_kbytes; | 57 | extern unsigned long sysctl_user_reserve_kbytes; |
| 54 | extern unsigned long sysctl_admin_reserve_kbytes; | 58 | extern unsigned long sysctl_admin_reserve_kbytes; |
| 55 | 59 | ||
| @@ -297,12 +301,26 @@ static inline int put_page_testzero(struct page *page) | |||
| 297 | /* | 301 | /* |
| 298 | * Try to grab a ref unless the page has a refcount of zero, return false if | 302 | * Try to grab a ref unless the page has a refcount of zero, return false if |
| 299 | * that is the case. | 303 | * that is the case. |
| 304 | * This can be called when MMU is off so it must not access | ||
| 305 | * any of the virtual mappings. | ||
| 300 | */ | 306 | */ |
| 301 | static inline int get_page_unless_zero(struct page *page) | 307 | static inline int get_page_unless_zero(struct page *page) |
| 302 | { | 308 | { |
| 303 | return atomic_inc_not_zero(&page->_count); | 309 | return atomic_inc_not_zero(&page->_count); |
| 304 | } | 310 | } |
| 305 | 311 | ||
| 312 | /* | ||
| 313 | * Try to drop a ref unless the page has a refcount of one, return false if | ||
| 314 | * that is the case. | ||
| 315 | * This is to make sure that the refcount won't become zero after this drop. | ||
| 316 | * This can be called when MMU is off so it must not access | ||
| 317 | * any of the virtual mappings. | ||
| 318 | */ | ||
| 319 | static inline int put_page_unless_one(struct page *page) | ||
| 320 | { | ||
| 321 | return atomic_add_unless(&page->_count, -1, 1); | ||
| 322 | } | ||
| 323 | |||
| 306 | extern int page_is_ram(unsigned long pfn); | 324 | extern int page_is_ram(unsigned long pfn); |
| 307 | 325 | ||
| 308 | /* Support for virtually mapped pages */ | 326 | /* Support for virtually mapped pages */ |
| @@ -581,11 +599,11 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma) | |||
| 581 | * sets it, so none of the operations on it need to be atomic. | 599 | * sets it, so none of the operations on it need to be atomic. |
| 582 | */ | 600 | */ |
| 583 | 601 | ||
| 584 | /* Page flags: | [SECTION] | [NODE] | ZONE | [LAST_NID] | ... | FLAGS | */ | 602 | /* Page flags: | [SECTION] | [NODE] | ZONE | [LAST_CPUPID] | ... | FLAGS | */ |
| 585 | #define SECTIONS_PGOFF ((sizeof(unsigned long)*8) - SECTIONS_WIDTH) | 603 | #define SECTIONS_PGOFF ((sizeof(unsigned long)*8) - SECTIONS_WIDTH) |
| 586 | #define NODES_PGOFF (SECTIONS_PGOFF - NODES_WIDTH) | 604 | #define NODES_PGOFF (SECTIONS_PGOFF - NODES_WIDTH) |
| 587 | #define ZONES_PGOFF (NODES_PGOFF - ZONES_WIDTH) | 605 | #define ZONES_PGOFF (NODES_PGOFF - ZONES_WIDTH) |
| 588 | #define LAST_NID_PGOFF (ZONES_PGOFF - LAST_NID_WIDTH) | 606 | #define LAST_CPUPID_PGOFF (ZONES_PGOFF - LAST_CPUPID_WIDTH) |
| 589 | 607 | ||
| 590 | /* | 608 | /* |
| 591 | * Define the bit shifts to access each section. For non-existent | 609 | * Define the bit shifts to access each section. For non-existent |
| @@ -595,7 +613,7 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma) | |||
| 595 | #define SECTIONS_PGSHIFT (SECTIONS_PGOFF * (SECTIONS_WIDTH != 0)) | 613 | #define SECTIONS_PGSHIFT (SECTIONS_PGOFF * (SECTIONS_WIDTH != 0)) |
| 596 | #define NODES_PGSHIFT (NODES_PGOFF * (NODES_WIDTH != 0)) | 614 | #define NODES_PGSHIFT (NODES_PGOFF * (NODES_WIDTH != 0)) |
| 597 | #define ZONES_PGSHIFT (ZONES_PGOFF * (ZONES_WIDTH != 0)) | 615 | #define ZONES_PGSHIFT (ZONES_PGOFF * (ZONES_WIDTH != 0)) |
| 598 | #define LAST_NID_PGSHIFT (LAST_NID_PGOFF * (LAST_NID_WIDTH != 0)) | 616 | #define LAST_CPUPID_PGSHIFT (LAST_CPUPID_PGOFF * (LAST_CPUPID_WIDTH != 0)) |
| 599 | 617 | ||
| 600 | /* NODE:ZONE or SECTION:ZONE is used to ID a zone for the buddy allocator */ | 618 | /* NODE:ZONE or SECTION:ZONE is used to ID a zone for the buddy allocator */ |
| 601 | #ifdef NODE_NOT_IN_PAGE_FLAGS | 619 | #ifdef NODE_NOT_IN_PAGE_FLAGS |
| @@ -617,7 +635,7 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma) | |||
| 617 | #define ZONES_MASK ((1UL << ZONES_WIDTH) - 1) | 635 | #define ZONES_MASK ((1UL << ZONES_WIDTH) - 1) |
| 618 | #define NODES_MASK ((1UL << NODES_WIDTH) - 1) | 636 | #define NODES_MASK ((1UL << NODES_WIDTH) - 1) |
| 619 | #define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1) | 637 | #define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1) |
| 620 | #define LAST_NID_MASK ((1UL << LAST_NID_WIDTH) - 1) | 638 | #define LAST_CPUPID_MASK ((1UL << LAST_CPUPID_WIDTH) - 1) |
| 621 | #define ZONEID_MASK ((1UL << ZONEID_SHIFT) - 1) | 639 | #define ZONEID_MASK ((1UL << ZONEID_SHIFT) - 1) |
| 622 | 640 | ||
| 623 | static inline enum zone_type page_zonenum(const struct page *page) | 641 | static inline enum zone_type page_zonenum(const struct page *page) |
| @@ -661,51 +679,117 @@ static inline int page_to_nid(const struct page *page) | |||
| 661 | #endif | 679 | #endif |
| 662 | 680 | ||
| 663 | #ifdef CONFIG_NUMA_BALANCING | 681 | #ifdef CONFIG_NUMA_BALANCING |
| 664 | #ifdef LAST_NID_NOT_IN_PAGE_FLAGS | 682 | static inline int cpu_pid_to_cpupid(int cpu, int pid) |
| 665 | static inline int page_nid_xchg_last(struct page *page, int nid) | ||
| 666 | { | 683 | { |
| 667 | return xchg(&page->_last_nid, nid); | 684 | return ((cpu & LAST__CPU_MASK) << LAST__PID_SHIFT) | (pid & LAST__PID_MASK); |
| 668 | } | 685 | } |
| 669 | 686 | ||
| 670 | static inline int page_nid_last(struct page *page) | 687 | static inline int cpupid_to_pid(int cpupid) |
| 671 | { | 688 | { |
| 672 | return page->_last_nid; | 689 | return cpupid & LAST__PID_MASK; |
| 673 | } | 690 | } |
| 674 | static inline void page_nid_reset_last(struct page *page) | 691 | |
| 692 | static inline int cpupid_to_cpu(int cpupid) | ||
| 675 | { | 693 | { |
| 676 | page->_last_nid = -1; | 694 | return (cpupid >> LAST__PID_SHIFT) & LAST__CPU_MASK; |
| 677 | } | 695 | } |
| 678 | #else | 696 | |
| 679 | static inline int page_nid_last(struct page *page) | 697 | static inline int cpupid_to_nid(int cpupid) |
| 680 | { | 698 | { |
| 681 | return (page->flags >> LAST_NID_PGSHIFT) & LAST_NID_MASK; | 699 | return cpu_to_node(cpupid_to_cpu(cpupid)); |
| 682 | } | 700 | } |
| 683 | 701 | ||
| 684 | extern int page_nid_xchg_last(struct page *page, int nid); | 702 | static inline bool cpupid_pid_unset(int cpupid) |
| 703 | { | ||
| 704 | return cpupid_to_pid(cpupid) == (-1 & LAST__PID_MASK); | ||
| 705 | } | ||
| 685 | 706 | ||
| 686 | static inline void page_nid_reset_last(struct page *page) | 707 | static inline bool cpupid_cpu_unset(int cpupid) |
| 687 | { | 708 | { |
| 688 | int nid = (1 << LAST_NID_SHIFT) - 1; | 709 | return cpupid_to_cpu(cpupid) == (-1 & LAST__CPU_MASK); |
| 710 | } | ||
| 711 | |||
| 712 | static inline bool __cpupid_match_pid(pid_t task_pid, int cpupid) | ||
| 713 | { | ||
| 714 | return (task_pid & LAST__PID_MASK) == cpupid_to_pid(cpupid); | ||
| 715 | } | ||
| 716 | |||
| 717 | #define cpupid_match_pid(task, cpupid) __cpupid_match_pid(task->pid, cpupid) | ||
| 718 | #ifdef LAST_CPUPID_NOT_IN_PAGE_FLAGS | ||
| 719 | static inline int page_cpupid_xchg_last(struct page *page, int cpupid) | ||
| 720 | { | ||
| 721 | return xchg(&page->_last_cpupid, cpupid); | ||
| 722 | } | ||
| 689 | 723 | ||
| 690 | page->flags &= ~(LAST_NID_MASK << LAST_NID_PGSHIFT); | 724 | static inline int page_cpupid_last(struct page *page) |
| 691 | page->flags |= (nid & LAST_NID_MASK) << LAST_NID_PGSHIFT; | 725 | { |
| 726 | return page->_last_cpupid; | ||
| 727 | } | ||
| 728 | static inline void page_cpupid_reset_last(struct page *page) | ||
| 729 | { | ||
| 730 | page->_last_cpupid = -1; | ||
| 692 | } | 731 | } |
| 693 | #endif /* LAST_NID_NOT_IN_PAGE_FLAGS */ | ||
| 694 | #else | 732 | #else |
| 695 | static inline int page_nid_xchg_last(struct page *page, int nid) | 733 | static inline int page_cpupid_last(struct page *page) |
| 696 | { | 734 | { |
| 697 | return page_to_nid(page); | 735 | return (page->flags >> LAST_CPUPID_PGSHIFT) & LAST_CPUPID_MASK; |
| 698 | } | 736 | } |
| 699 | 737 | ||
| 700 | static inline int page_nid_last(struct page *page) | 738 | extern int page_cpupid_xchg_last(struct page *page, int cpupid); |
| 739 | |||
| 740 | static inline void page_cpupid_reset_last(struct page *page) | ||
| 701 | { | 741 | { |
| 702 | return page_to_nid(page); | 742 | int cpupid = (1 << LAST_CPUPID_SHIFT) - 1; |
| 743 | |||
| 744 | page->flags &= ~(LAST_CPUPID_MASK << LAST_CPUPID_PGSHIFT); | ||
| 745 | page->flags |= (cpupid & LAST_CPUPID_MASK) << LAST_CPUPID_PGSHIFT; | ||
| 746 | } | ||
| 747 | #endif /* LAST_CPUPID_NOT_IN_PAGE_FLAGS */ | ||
| 748 | #else /* !CONFIG_NUMA_BALANCING */ | ||
| 749 | static inline int page_cpupid_xchg_last(struct page *page, int cpupid) | ||
| 750 | { | ||
| 751 | return page_to_nid(page); /* XXX */ | ||
| 703 | } | 752 | } |
| 704 | 753 | ||
| 705 | static inline void page_nid_reset_last(struct page *page) | 754 | static inline int page_cpupid_last(struct page *page) |
| 706 | { | 755 | { |
| 756 | return page_to_nid(page); /* XXX */ | ||
| 707 | } | 757 | } |
| 708 | #endif | 758 | |
| 759 | static inline int cpupid_to_nid(int cpupid) | ||
| 760 | { | ||
| 761 | return -1; | ||
| 762 | } | ||
| 763 | |||
| 764 | static inline int cpupid_to_pid(int cpupid) | ||
| 765 | { | ||
| 766 | return -1; | ||
| 767 | } | ||
| 768 | |||
| 769 | static inline int cpupid_to_cpu(int cpupid) | ||
| 770 | { | ||
| 771 | return -1; | ||
| 772 | } | ||
| 773 | |||
| 774 | static inline int cpu_pid_to_cpupid(int nid, int pid) | ||
| 775 | { | ||
| 776 | return -1; | ||
| 777 | } | ||
| 778 | |||
| 779 | static inline bool cpupid_pid_unset(int cpupid) | ||
| 780 | { | ||
| 781 | return 1; | ||
| 782 | } | ||
| 783 | |||
| 784 | static inline void page_cpupid_reset_last(struct page *page) | ||
| 785 | { | ||
| 786 | } | ||
| 787 | |||
| 788 | static inline bool cpupid_match_pid(struct task_struct *task, int cpupid) | ||
| 789 | { | ||
| 790 | return false; | ||
| 791 | } | ||
| 792 | #endif /* CONFIG_NUMA_BALANCING */ | ||
| 709 | 793 | ||
| 710 | static inline struct zone *page_zone(const struct page *page) | 794 | static inline struct zone *page_zone(const struct page *page) |
| 711 | { | 795 | { |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index d9851eeb6e1d..a3198e5aaf4e 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
| @@ -174,8 +174,8 @@ struct page { | |||
| 174 | void *shadow; | 174 | void *shadow; |
| 175 | #endif | 175 | #endif |
| 176 | 176 | ||
| 177 | #ifdef LAST_NID_NOT_IN_PAGE_FLAGS | 177 | #ifdef LAST_CPUPID_NOT_IN_PAGE_FLAGS |
| 178 | int _last_nid; | 178 | int _last_cpupid; |
| 179 | #endif | 179 | #endif |
| 180 | } | 180 | } |
| 181 | /* | 181 | /* |
| @@ -420,28 +420,15 @@ struct mm_struct { | |||
| 420 | */ | 420 | */ |
| 421 | unsigned long numa_next_scan; | 421 | unsigned long numa_next_scan; |
| 422 | 422 | ||
| 423 | /* numa_next_reset is when the PTE scanner period will be reset */ | ||
| 424 | unsigned long numa_next_reset; | ||
| 425 | |||
| 426 | /* Restart point for scanning and setting pte_numa */ | 423 | /* Restart point for scanning and setting pte_numa */ |
| 427 | unsigned long numa_scan_offset; | 424 | unsigned long numa_scan_offset; |
| 428 | 425 | ||
| 429 | /* numa_scan_seq prevents two threads setting pte_numa */ | 426 | /* numa_scan_seq prevents two threads setting pte_numa */ |
| 430 | int numa_scan_seq; | 427 | int numa_scan_seq; |
| 431 | |||
| 432 | /* | ||
| 433 | * The first node a task was scheduled on. If a task runs on | ||
| 434 | * a different node than Make PTE Scan Go Now. | ||
| 435 | */ | ||
| 436 | int first_nid; | ||
| 437 | #endif | 428 | #endif |
| 438 | struct uprobes_state uprobes_state; | 429 | struct uprobes_state uprobes_state; |
| 439 | }; | 430 | }; |
| 440 | 431 | ||
| 441 | /* first nid will either be a valid NID or one of these values */ | ||
| 442 | #define NUMA_PTE_SCAN_INIT -1 | ||
| 443 | #define NUMA_PTE_SCAN_ACTIVE -2 | ||
| 444 | |||
| 445 | static inline void mm_init_cpumask(struct mm_struct *mm) | 432 | static inline void mm_init_cpumask(struct mm_struct *mm) |
| 446 | { | 433 | { |
| 447 | #ifdef CONFIG_CPUMASK_OFFSTACK | 434 | #ifdef CONFIG_CPUMASK_OFFSTACK |
diff --git a/include/linux/mman.h b/include/linux/mman.h index 92dc257251e4..7f7f8dae4b1d 100644 --- a/include/linux/mman.h +++ b/include/linux/mman.h | |||
| @@ -87,4 +87,6 @@ calc_vm_flag_bits(unsigned long flags) | |||
| 87 | _calc_vm_trans(flags, MAP_DENYWRITE, VM_DENYWRITE ) | | 87 | _calc_vm_trans(flags, MAP_DENYWRITE, VM_DENYWRITE ) | |
| 88 | _calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED ); | 88 | _calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED ); |
| 89 | } | 89 | } |
| 90 | |||
| 91 | unsigned long vm_commit_limit(void); | ||
| 90 | #endif /* _LINUX_MMAN_H */ | 92 | #endif /* _LINUX_MMAN_H */ |
diff --git a/include/linux/mount.h b/include/linux/mount.h index 38cd98f112a0..371d346fa270 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h | |||
| @@ -49,6 +49,8 @@ struct mnt_namespace; | |||
| 49 | 49 | ||
| 50 | #define MNT_LOCK_READONLY 0x400000 | 50 | #define MNT_LOCK_READONLY 0x400000 |
| 51 | #define MNT_LOCKED 0x800000 | 51 | #define MNT_LOCKED 0x800000 |
| 52 | #define MNT_DOOMED 0x1000000 | ||
| 53 | #define MNT_SYNC_UMOUNT 0x2000000 | ||
| 52 | 54 | ||
| 53 | struct vfsmount { | 55 | struct vfsmount { |
| 54 | struct dentry *mnt_root; /* root of the mounted tree */ | 56 | struct dentry *mnt_root; /* root of the mounted tree */ |
diff --git a/include/linux/msg.h b/include/linux/msg.h index 391af8d11cce..e21f9d44307f 100644 --- a/include/linux/msg.h +++ b/include/linux/msg.h | |||
| @@ -6,9 +6,9 @@ | |||
| 6 | 6 | ||
| 7 | /* one msg_msg structure for each message */ | 7 | /* one msg_msg structure for each message */ |
| 8 | struct msg_msg { | 8 | struct msg_msg { |
| 9 | struct list_head m_list; | 9 | struct list_head m_list; |
| 10 | long m_type; | 10 | long m_type; |
| 11 | int m_ts; /* message text size */ | 11 | size_t m_ts; /* message text size */ |
| 12 | struct msg_msgseg* next; | 12 | struct msg_msgseg* next; |
| 13 | void *security; | 13 | void *security; |
| 14 | /* the actual message follows immediately */ | 14 | /* the actual message follows immediately */ |
diff --git a/include/linux/namei.h b/include/linux/namei.h index 8e47bc7a1665..492de72560fa 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
| @@ -16,7 +16,7 @@ struct nameidata { | |||
| 16 | struct path root; | 16 | struct path root; |
| 17 | struct inode *inode; /* path.dentry.d_inode */ | 17 | struct inode *inode; /* path.dentry.d_inode */ |
| 18 | unsigned int flags; | 18 | unsigned int flags; |
| 19 | unsigned seq; | 19 | unsigned seq, m_seq; |
| 20 | int last_type; | 20 | int last_type; |
| 21 | unsigned depth; | 21 | unsigned depth; |
| 22 | char *saved_names[MAX_NESTED_LINKS + 1]; | 22 | char *saved_names[MAX_NESTED_LINKS + 1]; |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 15fa01c9a3bf..8b3de7cc2ffc 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -2925,8 +2925,20 @@ int __init dev_proc_init(void); | |||
| 2925 | #define dev_proc_init() 0 | 2925 | #define dev_proc_init() 0 |
| 2926 | #endif | 2926 | #endif |
| 2927 | 2927 | ||
| 2928 | int netdev_class_create_file(struct class_attribute *class_attr); | 2928 | int netdev_class_create_file_ns(struct class_attribute *class_attr, |
| 2929 | void netdev_class_remove_file(struct class_attribute *class_attr); | 2929 | const void *ns); |
| 2930 | void netdev_class_remove_file_ns(struct class_attribute *class_attr, | ||
| 2931 | const void *ns); | ||
| 2932 | |||
| 2933 | static inline int netdev_class_create_file(struct class_attribute *class_attr) | ||
| 2934 | { | ||
| 2935 | return netdev_class_create_file_ns(class_attr, NULL); | ||
| 2936 | } | ||
| 2937 | |||
| 2938 | static inline void netdev_class_remove_file(struct class_attribute *class_attr) | ||
| 2939 | { | ||
| 2940 | netdev_class_remove_file_ns(class_attr, NULL); | ||
| 2941 | } | ||
| 2930 | 2942 | ||
| 2931 | extern struct kobj_ns_type_operations net_ns_type_operations; | 2943 | extern struct kobj_ns_type_operations net_ns_type_operations; |
| 2932 | 2944 | ||
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index e36dee52f224..c6f41b616965 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
| @@ -395,7 +395,9 @@ enum lock_type4 { | |||
| 395 | #define FATTR4_WORD1_FS_LAYOUT_TYPES (1UL << 30) | 395 | #define FATTR4_WORD1_FS_LAYOUT_TYPES (1UL << 30) |
| 396 | #define FATTR4_WORD2_LAYOUT_BLKSIZE (1UL << 1) | 396 | #define FATTR4_WORD2_LAYOUT_BLKSIZE (1UL << 1) |
| 397 | #define FATTR4_WORD2_MDSTHRESHOLD (1UL << 4) | 397 | #define FATTR4_WORD2_MDSTHRESHOLD (1UL << 4) |
| 398 | #define FATTR4_WORD2_SECURITY_LABEL (1UL << 17) | 398 | #define FATTR4_WORD2_SECURITY_LABEL (1UL << 16) |
| 399 | #define FATTR4_WORD2_CHANGE_SECURITY_LABEL \ | ||
| 400 | (1UL << 17) | ||
| 399 | 401 | ||
| 400 | /* MDS threshold bitmap bits */ | 402 | /* MDS threshold bitmap bits */ |
| 401 | #define THRESHOLD_RD (1UL << 0) | 403 | #define THRESHOLD_RD (1UL << 0) |
| @@ -460,6 +462,7 @@ enum { | |||
| 460 | NFSPROC4_CLNT_FS_LOCATIONS, | 462 | NFSPROC4_CLNT_FS_LOCATIONS, |
| 461 | NFSPROC4_CLNT_RELEASE_LOCKOWNER, | 463 | NFSPROC4_CLNT_RELEASE_LOCKOWNER, |
| 462 | NFSPROC4_CLNT_SECINFO, | 464 | NFSPROC4_CLNT_SECINFO, |
| 465 | NFSPROC4_CLNT_FSID_PRESENT, | ||
| 463 | 466 | ||
| 464 | /* nfs41 */ | 467 | /* nfs41 */ |
| 465 | NFSPROC4_CLNT_EXCHANGE_ID, | 468 | NFSPROC4_CLNT_EXCHANGE_ID, |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 3ea4cde8701c..14a48207a304 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
| @@ -269,9 +269,13 @@ static inline int NFS_STALE(const struct inode *inode) | |||
| 269 | return test_bit(NFS_INO_STALE, &NFS_I(inode)->flags); | 269 | return test_bit(NFS_INO_STALE, &NFS_I(inode)->flags); |
| 270 | } | 270 | } |
| 271 | 271 | ||
| 272 | static inline int NFS_FSCACHE(const struct inode *inode) | 272 | static inline struct fscache_cookie *nfs_i_fscache(struct inode *inode) |
| 273 | { | 273 | { |
| 274 | return test_bit(NFS_INO_FSCACHE, &NFS_I(inode)->flags); | 274 | #ifdef CONFIG_NFS_FSCACHE |
| 275 | return NFS_I(inode)->fscache; | ||
| 276 | #else | ||
| 277 | return NULL; | ||
| 278 | #endif | ||
| 275 | } | 279 | } |
| 276 | 280 | ||
| 277 | static inline __u64 NFS_FILEID(const struct inode *inode) | 281 | static inline __u64 NFS_FILEID(const struct inode *inode) |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index b8cedced50c9..1150ea41b626 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
| @@ -41,6 +41,7 @@ struct nfs_client { | |||
| 41 | #define NFS_CS_DISCRTRY 1 /* - disconnect on RPC retry */ | 41 | #define NFS_CS_DISCRTRY 1 /* - disconnect on RPC retry */ |
| 42 | #define NFS_CS_MIGRATION 2 /* - transparent state migr */ | 42 | #define NFS_CS_MIGRATION 2 /* - transparent state migr */ |
| 43 | #define NFS_CS_INFINITE_SLOTS 3 /* - don't limit TCP slots */ | 43 | #define NFS_CS_INFINITE_SLOTS 3 /* - don't limit TCP slots */ |
| 44 | #define NFS_CS_NO_RETRANS_TIMEOUT 4 /* - Disable retransmit timeouts */ | ||
| 44 | struct sockaddr_storage cl_addr; /* server identifier */ | 45 | struct sockaddr_storage cl_addr; /* server identifier */ |
| 45 | size_t cl_addrlen; | 46 | size_t cl_addrlen; |
| 46 | char * cl_hostname; /* hostname of server */ | 47 | char * cl_hostname; /* hostname of server */ |
| @@ -78,6 +79,7 @@ struct nfs_client { | |||
| 78 | char cl_ipaddr[48]; | 79 | char cl_ipaddr[48]; |
| 79 | u32 cl_cb_ident; /* v4.0 callback identifier */ | 80 | u32 cl_cb_ident; /* v4.0 callback identifier */ |
| 80 | const struct nfs4_minor_version_ops *cl_mvops; | 81 | const struct nfs4_minor_version_ops *cl_mvops; |
| 82 | unsigned long cl_mig_gen; | ||
| 81 | 83 | ||
| 82 | /* NFSv4.0 transport blocking */ | 84 | /* NFSv4.0 transport blocking */ |
| 83 | struct nfs4_slot_table *cl_slot_tbl; | 85 | struct nfs4_slot_table *cl_slot_tbl; |
| @@ -147,7 +149,9 @@ struct nfs_server { | |||
| 147 | __u64 maxfilesize; /* maximum file size */ | 149 | __u64 maxfilesize; /* maximum file size */ |
| 148 | struct timespec time_delta; /* smallest time granularity */ | 150 | struct timespec time_delta; /* smallest time granularity */ |
| 149 | unsigned long mount_time; /* when this fs was mounted */ | 151 | unsigned long mount_time; /* when this fs was mounted */ |
| 152 | struct super_block *super; /* VFS super block */ | ||
| 150 | dev_t s_dev; /* superblock dev numbers */ | 153 | dev_t s_dev; /* superblock dev numbers */ |
| 154 | struct nfs_auth_info auth_info; /* parsed auth flavors */ | ||
| 151 | 155 | ||
| 152 | #ifdef CONFIG_NFS_FSCACHE | 156 | #ifdef CONFIG_NFS_FSCACHE |
| 153 | struct nfs_fscache_key *fscache_key; /* unique key for superblock */ | 157 | struct nfs_fscache_key *fscache_key; /* unique key for superblock */ |
| @@ -187,6 +191,12 @@ struct nfs_server { | |||
| 187 | struct list_head state_owners_lru; | 191 | struct list_head state_owners_lru; |
| 188 | struct list_head layouts; | 192 | struct list_head layouts; |
| 189 | struct list_head delegations; | 193 | struct list_head delegations; |
| 194 | |||
| 195 | unsigned long mig_gen; | ||
| 196 | unsigned long mig_status; | ||
| 197 | #define NFS_MIG_IN_TRANSITION (1) | ||
| 198 | #define NFS_MIG_FAILED (2) | ||
| 199 | |||
| 190 | void (*destroy)(struct nfs_server *); | 200 | void (*destroy)(struct nfs_server *); |
| 191 | 201 | ||
| 192 | atomic_t active; /* Keep trace of any activity to this server */ | 202 | atomic_t active; /* Keep trace of any activity to this server */ |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 49f52c8f4422..3ccfcecf8999 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
| @@ -591,6 +591,13 @@ struct nfs_renameres { | |||
| 591 | struct nfs_fattr *new_fattr; | 591 | struct nfs_fattr *new_fattr; |
| 592 | }; | 592 | }; |
| 593 | 593 | ||
| 594 | /* parsed sec= options */ | ||
| 595 | #define NFS_AUTH_INFO_MAX_FLAVORS 12 /* see fs/nfs/super.c */ | ||
| 596 | struct nfs_auth_info { | ||
| 597 | unsigned int flavor_len; | ||
| 598 | rpc_authflavor_t flavors[NFS_AUTH_INFO_MAX_FLAVORS]; | ||
| 599 | }; | ||
| 600 | |||
| 594 | /* | 601 | /* |
| 595 | * Argument struct for decode_entry function | 602 | * Argument struct for decode_entry function |
| 596 | */ | 603 | */ |
| @@ -1053,14 +1060,18 @@ struct nfs4_fs_locations { | |||
| 1053 | struct nfs4_fs_locations_arg { | 1060 | struct nfs4_fs_locations_arg { |
| 1054 | struct nfs4_sequence_args seq_args; | 1061 | struct nfs4_sequence_args seq_args; |
| 1055 | const struct nfs_fh *dir_fh; | 1062 | const struct nfs_fh *dir_fh; |
| 1063 | const struct nfs_fh *fh; | ||
| 1056 | const struct qstr *name; | 1064 | const struct qstr *name; |
| 1057 | struct page *page; | 1065 | struct page *page; |
| 1058 | const u32 *bitmask; | 1066 | const u32 *bitmask; |
| 1067 | clientid4 clientid; | ||
| 1068 | unsigned char migration:1, renew:1; | ||
| 1059 | }; | 1069 | }; |
| 1060 | 1070 | ||
| 1061 | struct nfs4_fs_locations_res { | 1071 | struct nfs4_fs_locations_res { |
| 1062 | struct nfs4_sequence_res seq_res; | 1072 | struct nfs4_sequence_res seq_res; |
| 1063 | struct nfs4_fs_locations *fs_locations; | 1073 | struct nfs4_fs_locations *fs_locations; |
| 1074 | unsigned char migration:1, renew:1; | ||
| 1064 | }; | 1075 | }; |
| 1065 | 1076 | ||
| 1066 | struct nfs4_secinfo4 { | 1077 | struct nfs4_secinfo4 { |
| @@ -1084,6 +1095,19 @@ struct nfs4_secinfo_res { | |||
| 1084 | struct nfs4_secinfo_flavors *flavors; | 1095 | struct nfs4_secinfo_flavors *flavors; |
| 1085 | }; | 1096 | }; |
| 1086 | 1097 | ||
| 1098 | struct nfs4_fsid_present_arg { | ||
| 1099 | struct nfs4_sequence_args seq_args; | ||
| 1100 | const struct nfs_fh *fh; | ||
| 1101 | clientid4 clientid; | ||
| 1102 | unsigned char renew:1; | ||
| 1103 | }; | ||
| 1104 | |||
| 1105 | struct nfs4_fsid_present_res { | ||
| 1106 | struct nfs4_sequence_res seq_res; | ||
| 1107 | struct nfs_fh *fh; | ||
| 1108 | unsigned char renew:1; | ||
| 1109 | }; | ||
| 1110 | |||
| 1087 | #endif /* CONFIG_NFS_V4 */ | 1111 | #endif /* CONFIG_NFS_V4 */ |
| 1088 | 1112 | ||
| 1089 | struct nfstime4 { | 1113 | struct nfstime4 { |
diff --git a/include/linux/of.h b/include/linux/of.h index f95aee391e30..276c546980d8 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
| @@ -136,7 +136,9 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size) | |||
| 136 | return of_read_number(cell, size); | 136 | return of_read_number(cell, size); |
| 137 | } | 137 | } |
| 138 | 138 | ||
| 139 | #if defined(CONFIG_SPARC) | ||
| 139 | #include <asm/prom.h> | 140 | #include <asm/prom.h> |
| 141 | #endif | ||
| 140 | 142 | ||
| 141 | /* Default #address and #size cells. Allow arch asm/prom.h to override */ | 143 | /* Default #address and #size cells. Allow arch asm/prom.h to override */ |
| 142 | #if !defined(OF_ROOT_NODE_ADDR_CELLS_DEFAULT) | 144 | #if !defined(OF_ROOT_NODE_ADDR_CELLS_DEFAULT) |
| @@ -226,6 +228,19 @@ static inline int of_get_child_count(const struct device_node *np) | |||
| 226 | return num; | 228 | return num; |
| 227 | } | 229 | } |
| 228 | 230 | ||
| 231 | static inline int of_get_available_child_count(const struct device_node *np) | ||
| 232 | { | ||
| 233 | struct device_node *child; | ||
| 234 | int num = 0; | ||
| 235 | |||
| 236 | for_each_available_child_of_node(np, child) | ||
| 237 | num++; | ||
| 238 | |||
| 239 | return num; | ||
| 240 | } | ||
| 241 | |||
| 242 | /* cache lookup */ | ||
| 243 | extern struct device_node *of_find_next_cache_node(const struct device_node *); | ||
| 229 | extern struct device_node *of_find_node_with_property( | 244 | extern struct device_node *of_find_node_with_property( |
| 230 | struct device_node *from, const char *prop_name); | 245 | struct device_node *from, const char *prop_name); |
| 231 | #define for_each_node_with_property(dn, prop_name) \ | 246 | #define for_each_node_with_property(dn, prop_name) \ |
| @@ -275,6 +290,7 @@ extern int of_n_size_cells(struct device_node *np); | |||
| 275 | extern const struct of_device_id *of_match_node( | 290 | extern const struct of_device_id *of_match_node( |
| 276 | const struct of_device_id *matches, const struct device_node *node); | 291 | const struct of_device_id *matches, const struct device_node *node); |
| 277 | extern int of_modalias_node(struct device_node *node, char *modalias, int len); | 292 | extern int of_modalias_node(struct device_node *node, char *modalias, int len); |
| 293 | extern void of_print_phandle_args(const char *msg, const struct of_phandle_args *args); | ||
| 278 | extern struct device_node *of_parse_phandle(const struct device_node *np, | 294 | extern struct device_node *of_parse_phandle(const struct device_node *np, |
| 279 | const char *phandle_name, | 295 | const char *phandle_name, |
| 280 | int index); | 296 | int index); |
| @@ -364,6 +380,9 @@ static inline bool of_have_populated_dt(void) | |||
| 364 | #define for_each_child_of_node(parent, child) \ | 380 | #define for_each_child_of_node(parent, child) \ |
| 365 | while (0) | 381 | while (0) |
| 366 | 382 | ||
| 383 | #define for_each_available_child_of_node(parent, child) \ | ||
| 384 | while (0) | ||
| 385 | |||
| 367 | static inline struct device_node *of_get_child_by_name( | 386 | static inline struct device_node *of_get_child_by_name( |
| 368 | const struct device_node *node, | 387 | const struct device_node *node, |
| 369 | const char *name) | 388 | const char *name) |
| @@ -376,6 +395,11 @@ static inline int of_get_child_count(const struct device_node *np) | |||
| 376 | return 0; | 395 | return 0; |
| 377 | } | 396 | } |
| 378 | 397 | ||
| 398 | static inline int of_get_available_child_count(const struct device_node *np) | ||
| 399 | { | ||
| 400 | return 0; | ||
| 401 | } | ||
| 402 | |||
| 379 | static inline int of_device_is_compatible(const struct device_node *device, | 403 | static inline int of_device_is_compatible(const struct device_node *device, |
| 380 | const char *name) | 404 | const char *name) |
| 381 | { | 405 | { |
| @@ -534,13 +558,10 @@ static inline const char *of_prop_next_string(struct property *prop, | |||
| 534 | #define of_match_node(_matches, _node) NULL | 558 | #define of_match_node(_matches, _node) NULL |
| 535 | #endif /* CONFIG_OF */ | 559 | #endif /* CONFIG_OF */ |
| 536 | 560 | ||
| 537 | #ifndef of_node_to_nid | 561 | #if defined(CONFIG_OF) && defined(CONFIG_NUMA) |
| 538 | static inline int of_node_to_nid(struct device_node *np) | 562 | extern int of_node_to_nid(struct device_node *np); |
| 539 | { | 563 | #else |
| 540 | return numa_node_id(); | 564 | static inline int of_node_to_nid(struct device_node *device) { return 0; } |
| 541 | } | ||
| 542 | |||
| 543 | #define of_node_to_nid of_node_to_nid | ||
| 544 | #endif | 565 | #endif |
| 545 | 566 | ||
| 546 | /** | 567 | /** |
diff --git a/include/linux/of_address.h b/include/linux/of_address.h index 4c2e6f26432c..5f6ed6b182b8 100644 --- a/include/linux/of_address.h +++ b/include/linux/of_address.h | |||
| @@ -34,6 +34,10 @@ static inline void of_pci_range_to_resource(struct of_pci_range *range, | |||
| 34 | res->name = np->full_name; | 34 | res->name = np->full_name; |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | /* Translate a DMA address from device space to CPU space */ | ||
| 38 | extern u64 of_translate_dma_address(struct device_node *dev, | ||
| 39 | const __be32 *in_addr); | ||
| 40 | |||
| 37 | #ifdef CONFIG_OF_ADDRESS | 41 | #ifdef CONFIG_OF_ADDRESS |
| 38 | extern u64 of_translate_address(struct device_node *np, const __be32 *addr); | 42 | extern u64 of_translate_address(struct device_node *np, const __be32 *addr); |
| 39 | extern bool of_can_translate_address(struct device_node *dev); | 43 | extern bool of_can_translate_address(struct device_node *dev); |
| @@ -52,10 +56,7 @@ extern void __iomem *of_iomap(struct device_node *device, int index); | |||
| 52 | extern const __be32 *of_get_address(struct device_node *dev, int index, | 56 | extern const __be32 *of_get_address(struct device_node *dev, int index, |
| 53 | u64 *size, unsigned int *flags); | 57 | u64 *size, unsigned int *flags); |
| 54 | 58 | ||
| 55 | #ifndef pci_address_to_pio | 59 | extern unsigned long pci_address_to_pio(phys_addr_t addr); |
| 56 | static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; } | ||
| 57 | #define pci_address_to_pio pci_address_to_pio | ||
| 58 | #endif | ||
| 59 | 60 | ||
| 60 | extern int of_pci_range_parser_init(struct of_pci_range_parser *parser, | 61 | extern int of_pci_range_parser_init(struct of_pci_range_parser *parser, |
| 61 | struct device_node *node); | 62 | struct device_node *node); |
| @@ -63,13 +64,6 @@ extern struct of_pci_range *of_pci_range_parser_one( | |||
| 63 | struct of_pci_range_parser *parser, | 64 | struct of_pci_range_parser *parser, |
| 64 | struct of_pci_range *range); | 65 | struct of_pci_range *range); |
| 65 | #else /* CONFIG_OF_ADDRESS */ | 66 | #else /* CONFIG_OF_ADDRESS */ |
| 66 | #ifndef of_address_to_resource | ||
| 67 | static inline int of_address_to_resource(struct device_node *dev, int index, | ||
| 68 | struct resource *r) | ||
| 69 | { | ||
| 70 | return -EINVAL; | ||
| 71 | } | ||
| 72 | #endif | ||
| 73 | static inline struct device_node *of_find_matching_node_by_address( | 67 | static inline struct device_node *of_find_matching_node_by_address( |
| 74 | struct device_node *from, | 68 | struct device_node *from, |
| 75 | const struct of_device_id *matches, | 69 | const struct of_device_id *matches, |
| @@ -77,12 +71,7 @@ static inline struct device_node *of_find_matching_node_by_address( | |||
| 77 | { | 71 | { |
| 78 | return NULL; | 72 | return NULL; |
| 79 | } | 73 | } |
| 80 | #ifndef of_iomap | 74 | |
| 81 | static inline void __iomem *of_iomap(struct device_node *device, int index) | ||
| 82 | { | ||
| 83 | return NULL; | ||
| 84 | } | ||
| 85 | #endif | ||
| 86 | static inline const __be32 *of_get_address(struct device_node *dev, int index, | 75 | static inline const __be32 *of_get_address(struct device_node *dev, int index, |
| 87 | u64 *size, unsigned int *flags) | 76 | u64 *size, unsigned int *flags) |
| 88 | { | 77 | { |
| @@ -103,6 +92,22 @@ static inline struct of_pci_range *of_pci_range_parser_one( | |||
| 103 | } | 92 | } |
| 104 | #endif /* CONFIG_OF_ADDRESS */ | 93 | #endif /* CONFIG_OF_ADDRESS */ |
| 105 | 94 | ||
| 95 | #ifdef CONFIG_OF | ||
| 96 | extern int of_address_to_resource(struct device_node *dev, int index, | ||
| 97 | struct resource *r); | ||
| 98 | void __iomem *of_iomap(struct device_node *node, int index); | ||
| 99 | #else | ||
| 100 | static inline int of_address_to_resource(struct device_node *dev, int index, | ||
| 101 | struct resource *r) | ||
| 102 | { | ||
| 103 | return -EINVAL; | ||
| 104 | } | ||
| 105 | |||
| 106 | static inline void __iomem *of_iomap(struct device_node *device, int index) | ||
| 107 | { | ||
| 108 | return NULL; | ||
| 109 | } | ||
| 110 | #endif | ||
| 106 | 111 | ||
| 107 | #if defined(CONFIG_OF_ADDRESS) && defined(CONFIG_PCI) | 112 | #if defined(CONFIG_OF_ADDRESS) && defined(CONFIG_PCI) |
| 108 | extern const __be32 *of_get_pci_address(struct device_node *dev, int bar_no, | 113 | extern const __be32 *of_get_pci_address(struct device_node *dev, int bar_no, |
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h index a478c62a2aab..0beaee9dac1f 100644 --- a/include/linux/of_fdt.h +++ b/include/linux/of_fdt.h | |||
| @@ -96,31 +96,30 @@ extern int of_scan_flat_dt_by_path(const char *path, | |||
| 96 | 96 | ||
| 97 | extern int early_init_dt_scan_chosen(unsigned long node, const char *uname, | 97 | extern int early_init_dt_scan_chosen(unsigned long node, const char *uname, |
| 98 | int depth, void *data); | 98 | int depth, void *data); |
| 99 | extern void early_init_dt_check_for_initrd(unsigned long node); | ||
| 100 | extern int early_init_dt_scan_memory(unsigned long node, const char *uname, | 99 | extern int early_init_dt_scan_memory(unsigned long node, const char *uname, |
| 101 | int depth, void *data); | 100 | int depth, void *data); |
| 102 | extern void early_init_dt_add_memory_arch(u64 base, u64 size); | 101 | extern void early_init_dt_add_memory_arch(u64 base, u64 size); |
| 103 | extern void * early_init_dt_alloc_memory_arch(u64 size, u64 align); | 102 | extern void * early_init_dt_alloc_memory_arch(u64 size, u64 align); |
| 104 | extern u64 dt_mem_next_cell(int s, __be32 **cellp); | 103 | extern u64 dt_mem_next_cell(int s, __be32 **cellp); |
| 105 | 104 | ||
| 106 | /* | ||
| 107 | * If BLK_DEV_INITRD, the fdt early init code will call this function, | ||
| 108 | * to be provided by the arch code. start and end are specified as | ||
| 109 | * physical addresses. | ||
| 110 | */ | ||
| 111 | #ifdef CONFIG_BLK_DEV_INITRD | ||
| 112 | extern void early_init_dt_setup_initrd_arch(u64 start, u64 end); | ||
| 113 | #endif | ||
| 114 | |||
| 115 | /* Early flat tree scan hooks */ | 105 | /* Early flat tree scan hooks */ |
| 116 | extern int early_init_dt_scan_root(unsigned long node, const char *uname, | 106 | extern int early_init_dt_scan_root(unsigned long node, const char *uname, |
| 117 | int depth, void *data); | 107 | int depth, void *data); |
| 118 | 108 | ||
| 109 | extern bool early_init_dt_scan(void *params); | ||
| 110 | |||
| 111 | extern const char *of_flat_dt_get_machine_name(void); | ||
| 112 | extern const void *of_flat_dt_match_machine(const void *default_match, | ||
| 113 | const void * (*get_next_compat)(const char * const**)); | ||
| 114 | |||
| 119 | /* Other Prototypes */ | 115 | /* Other Prototypes */ |
| 120 | extern void unflatten_device_tree(void); | 116 | extern void unflatten_device_tree(void); |
| 117 | extern void unflatten_and_copy_device_tree(void); | ||
| 121 | extern void early_init_devtree(void *); | 118 | extern void early_init_devtree(void *); |
| 122 | #else /* CONFIG_OF_FLATTREE */ | 119 | #else /* CONFIG_OF_FLATTREE */ |
| 120 | static inline const char *of_flat_dt_get_machine_name(void) { return NULL; } | ||
| 123 | static inline void unflatten_device_tree(void) {} | 121 | static inline void unflatten_device_tree(void) {} |
| 122 | static inline void unflatten_and_copy_device_tree(void) {} | ||
| 124 | #endif /* CONFIG_OF_FLATTREE */ | 123 | #endif /* CONFIG_OF_FLATTREE */ |
| 125 | 124 | ||
| 126 | #endif /* __ASSEMBLY__ */ | 125 | #endif /* __ASSEMBLY__ */ |
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h index a83dc6f5008e..f14123a5a9df 100644 --- a/include/linux/of_gpio.h +++ b/include/linux/of_gpio.h | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/errno.h> | 19 | #include <linux/errno.h> |
| 20 | #include <linux/gpio.h> | 20 | #include <linux/gpio.h> |
| 21 | #include <linux/of.h> | 21 | #include <linux/of.h> |
| 22 | #include <linux/gpio/consumer.h> | ||
| 22 | 23 | ||
| 23 | struct device_node; | 24 | struct device_node; |
| 24 | 25 | ||
| @@ -47,7 +48,7 @@ static inline struct of_mm_gpio_chip *to_of_mm_gpio_chip(struct gpio_chip *gc) | |||
| 47 | return container_of(gc, struct of_mm_gpio_chip, gc); | 48 | return container_of(gc, struct of_mm_gpio_chip, gc); |
| 48 | } | 49 | } |
| 49 | 50 | ||
| 50 | extern int of_get_named_gpio_flags(struct device_node *np, | 51 | extern struct gpio_desc *of_get_named_gpiod_flags(struct device_node *np, |
| 51 | const char *list_name, int index, enum of_gpio_flags *flags); | 52 | const char *list_name, int index, enum of_gpio_flags *flags); |
| 52 | 53 | ||
| 53 | extern int of_mm_gpiochip_add(struct device_node *np, | 54 | extern int of_mm_gpiochip_add(struct device_node *np, |
| @@ -62,10 +63,10 @@ extern int of_gpio_simple_xlate(struct gpio_chip *gc, | |||
| 62 | #else /* CONFIG_OF_GPIO */ | 63 | #else /* CONFIG_OF_GPIO */ |
| 63 | 64 | ||
| 64 | /* Drivers may not strictly depend on the GPIO support, so let them link. */ | 65 | /* Drivers may not strictly depend on the GPIO support, so let them link. */ |
| 65 | static inline int of_get_named_gpio_flags(struct device_node *np, | 66 | static inline struct gpio_desc *of_get_named_gpiod_flags(struct device_node *np, |
| 66 | const char *list_name, int index, enum of_gpio_flags *flags) | 67 | const char *list_name, int index, enum of_gpio_flags *flags) |
| 67 | { | 68 | { |
| 68 | return -ENOSYS; | 69 | return ERR_PTR(-ENOSYS); |
| 69 | } | 70 | } |
| 70 | 71 | ||
| 71 | static inline int of_gpio_simple_xlate(struct gpio_chip *gc, | 72 | static inline int of_gpio_simple_xlate(struct gpio_chip *gc, |
| @@ -80,6 +81,18 @@ static inline void of_gpiochip_remove(struct gpio_chip *gc) { } | |||
| 80 | 81 | ||
| 81 | #endif /* CONFIG_OF_GPIO */ | 82 | #endif /* CONFIG_OF_GPIO */ |
| 82 | 83 | ||
| 84 | static inline int of_get_named_gpio_flags(struct device_node *np, | ||
| 85 | const char *list_name, int index, enum of_gpio_flags *flags) | ||
| 86 | { | ||
| 87 | struct gpio_desc *desc; | ||
| 88 | desc = of_get_named_gpiod_flags(np, list_name, index, flags); | ||
| 89 | |||
| 90 | if (IS_ERR(desc)) | ||
| 91 | return PTR_ERR(desc); | ||
| 92 | else | ||
| 93 | return desc_to_gpio(desc); | ||
| 94 | } | ||
| 95 | |||
| 83 | /** | 96 | /** |
| 84 | * of_gpio_named_count() - Count GPIOs for a device | 97 | * of_gpio_named_count() - Count GPIOs for a device |
| 85 | * @np: device node to count GPIOs for | 98 | * @np: device node to count GPIOs for |
| @@ -117,15 +130,21 @@ static inline int of_gpio_count(struct device_node *np) | |||
| 117 | } | 130 | } |
| 118 | 131 | ||
| 119 | /** | 132 | /** |
| 120 | * of_get_gpio_flags() - Get a GPIO number and flags to use with GPIO API | 133 | * of_get_gpiod_flags() - Get a GPIO descriptor and flags to use with GPIO API |
| 121 | * @np: device node to get GPIO from | 134 | * @np: device node to get GPIO from |
| 122 | * @index: index of the GPIO | 135 | * @index: index of the GPIO |
| 123 | * @flags: a flags pointer to fill in | 136 | * @flags: a flags pointer to fill in |
| 124 | * | 137 | * |
| 125 | * Returns GPIO number to use with Linux generic GPIO API, or one of the errno | 138 | * Returns GPIO descriptor to use with Linux generic GPIO API, or a errno |
| 126 | * value on the error condition. If @flags is not NULL the function also fills | 139 | * value on the error condition. If @flags is not NULL the function also fills |
| 127 | * in flags for the GPIO. | 140 | * in flags for the GPIO. |
| 128 | */ | 141 | */ |
| 142 | static inline struct gpio_desc *of_get_gpiod_flags(struct device_node *np, | ||
| 143 | int index, enum of_gpio_flags *flags) | ||
| 144 | { | ||
| 145 | return of_get_named_gpiod_flags(np, "gpios", index, flags); | ||
| 146 | } | ||
| 147 | |||
| 129 | static inline int of_get_gpio_flags(struct device_node *np, int index, | 148 | static inline int of_get_gpio_flags(struct device_node *np, int index, |
| 130 | enum of_gpio_flags *flags) | 149 | enum of_gpio_flags *flags) |
| 131 | { | 150 | { |
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h index fcd63baee5f2..3f23b4472c31 100644 --- a/include/linux/of_irq.h +++ b/include/linux/of_irq.h | |||
| @@ -8,22 +8,6 @@ | |||
| 8 | #include <linux/ioport.h> | 8 | #include <linux/ioport.h> |
| 9 | #include <linux/of.h> | 9 | #include <linux/of.h> |
| 10 | 10 | ||
| 11 | /** | ||
| 12 | * of_irq - container for device_node/irq_specifier pair for an irq controller | ||
| 13 | * @controller: pointer to interrupt controller device tree node | ||
| 14 | * @size: size of interrupt specifier | ||
| 15 | * @specifier: array of cells @size long specifing the specific interrupt | ||
| 16 | * | ||
| 17 | * This structure is returned when an interrupt is mapped. The controller | ||
| 18 | * field needs to be put() after use | ||
| 19 | */ | ||
| 20 | #define OF_MAX_IRQ_SPEC 4 /* We handle specifiers of at most 4 cells */ | ||
| 21 | struct of_irq { | ||
| 22 | struct device_node *controller; /* Interrupt controller node */ | ||
| 23 | u32 size; /* Specifier size */ | ||
| 24 | u32 specifier[OF_MAX_IRQ_SPEC]; /* Specifier copy */ | ||
| 25 | }; | ||
| 26 | |||
| 27 | typedef int (*of_irq_init_cb_t)(struct device_node *, struct device_node *); | 11 | typedef int (*of_irq_init_cb_t)(struct device_node *, struct device_node *); |
| 28 | 12 | ||
| 29 | /* | 13 | /* |
| @@ -35,35 +19,38 @@ typedef int (*of_irq_init_cb_t)(struct device_node *, struct device_node *); | |||
| 35 | #if defined(CONFIG_PPC32) && defined(CONFIG_PPC_PMAC) | 19 | #if defined(CONFIG_PPC32) && defined(CONFIG_PPC_PMAC) |
| 36 | extern unsigned int of_irq_workarounds; | 20 | extern unsigned int of_irq_workarounds; |
| 37 | extern struct device_node *of_irq_dflt_pic; | 21 | extern struct device_node *of_irq_dflt_pic; |
| 38 | extern int of_irq_map_oldworld(struct device_node *device, int index, | 22 | extern int of_irq_parse_oldworld(struct device_node *device, int index, |
| 39 | struct of_irq *out_irq); | 23 | struct of_phandle_args *out_irq); |
| 40 | #else /* CONFIG_PPC32 && CONFIG_PPC_PMAC */ | 24 | #else /* CONFIG_PPC32 && CONFIG_PPC_PMAC */ |
| 41 | #define of_irq_workarounds (0) | 25 | #define of_irq_workarounds (0) |
| 42 | #define of_irq_dflt_pic (NULL) | 26 | #define of_irq_dflt_pic (NULL) |
| 43 | static inline int of_irq_map_oldworld(struct device_node *device, int index, | 27 | static inline int of_irq_parse_oldworld(struct device_node *device, int index, |
| 44 | struct of_irq *out_irq) | 28 | struct of_phandle_args *out_irq) |
| 45 | { | 29 | { |
| 46 | return -EINVAL; | 30 | return -EINVAL; |
| 47 | } | 31 | } |
| 48 | #endif /* CONFIG_PPC32 && CONFIG_PPC_PMAC */ | 32 | #endif /* CONFIG_PPC32 && CONFIG_PPC_PMAC */ |
| 49 | 33 | ||
| 50 | 34 | extern int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq); | |
| 51 | extern int of_irq_map_raw(struct device_node *parent, const __be32 *intspec, | 35 | extern int of_irq_parse_one(struct device_node *device, int index, |
| 52 | u32 ointsize, const __be32 *addr, | 36 | struct of_phandle_args *out_irq); |
| 53 | struct of_irq *out_irq); | 37 | extern unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data); |
| 54 | extern int of_irq_map_one(struct device_node *device, int index, | ||
| 55 | struct of_irq *out_irq); | ||
| 56 | extern unsigned int irq_create_of_mapping(struct device_node *controller, | ||
| 57 | const u32 *intspec, | ||
| 58 | unsigned int intsize); | ||
| 59 | extern int of_irq_to_resource(struct device_node *dev, int index, | 38 | extern int of_irq_to_resource(struct device_node *dev, int index, |
| 60 | struct resource *r); | 39 | struct resource *r); |
| 61 | extern int of_irq_count(struct device_node *dev); | ||
| 62 | extern int of_irq_to_resource_table(struct device_node *dev, | 40 | extern int of_irq_to_resource_table(struct device_node *dev, |
| 63 | struct resource *res, int nr_irqs); | 41 | struct resource *res, int nr_irqs); |
| 64 | 42 | ||
| 65 | extern void of_irq_init(const struct of_device_id *matches); | 43 | extern void of_irq_init(const struct of_device_id *matches); |
| 66 | 44 | ||
| 45 | #ifdef CONFIG_OF_IRQ | ||
| 46 | extern int of_irq_count(struct device_node *dev); | ||
| 47 | #else | ||
| 48 | static inline int of_irq_count(struct device_node *dev) | ||
| 49 | { | ||
| 50 | return 0; | ||
| 51 | } | ||
| 52 | #endif | ||
| 53 | |||
| 67 | #if defined(CONFIG_OF) | 54 | #if defined(CONFIG_OF) |
| 68 | /* | 55 | /* |
| 69 | * irq_of_parse_and_map() is used by all OF enabled platforms; but SPARC | 56 | * irq_of_parse_and_map() is used by all OF enabled platforms; but SPARC |
diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h index fd9c408631a0..1a1f5ffd5288 100644 --- a/include/linux/of_pci.h +++ b/include/linux/of_pci.h | |||
| @@ -5,8 +5,9 @@ | |||
| 5 | #include <linux/msi.h> | 5 | #include <linux/msi.h> |
| 6 | 6 | ||
| 7 | struct pci_dev; | 7 | struct pci_dev; |
| 8 | struct of_irq; | 8 | struct of_phandle_args; |
| 9 | int of_irq_map_pci(const struct pci_dev *pdev, struct of_irq *out_irq); | 9 | int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq); |
| 10 | int of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin); | ||
| 10 | 11 | ||
| 11 | struct device_node; | 12 | struct device_node; |
| 12 | struct device_node *of_pci_find_child_device(struct device_node *parent, | 13 | struct device_node *of_pci_find_child_device(struct device_node *parent, |
diff --git a/include/linux/oom.h b/include/linux/oom.h index da60007075b5..4cd62677feb9 100644 --- a/include/linux/oom.h +++ b/include/linux/oom.h | |||
| @@ -82,6 +82,11 @@ static inline void oom_killer_enable(void) | |||
| 82 | oom_killer_disabled = false; | 82 | oom_killer_disabled = false; |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | static inline bool oom_gfp_allowed(gfp_t gfp_mask) | ||
| 86 | { | ||
| 87 | return (gfp_mask & __GFP_FS) && !(gfp_mask & __GFP_NORETRY); | ||
| 88 | } | ||
| 89 | |||
| 85 | extern struct task_struct *find_lock_task_mm(struct task_struct *p); | 90 | extern struct task_struct *find_lock_task_mm(struct task_struct *p); |
| 86 | 91 | ||
| 87 | /* sysctls */ | 92 | /* sysctls */ |
diff --git a/include/linux/page-flags-layout.h b/include/linux/page-flags-layout.h index 93506a114034..da523661500a 100644 --- a/include/linux/page-flags-layout.h +++ b/include/linux/page-flags-layout.h | |||
| @@ -38,10 +38,10 @@ | |||
| 38 | * The last is when there is insufficient space in page->flags and a separate | 38 | * The last is when there is insufficient space in page->flags and a separate |
| 39 | * lookup is necessary. | 39 | * lookup is necessary. |
| 40 | * | 40 | * |
| 41 | * No sparsemem or sparsemem vmemmap: | NODE | ZONE | ... | FLAGS | | 41 | * No sparsemem or sparsemem vmemmap: | NODE | ZONE | ... | FLAGS | |
| 42 | * " plus space for last_nid: | NODE | ZONE | LAST_NID ... | FLAGS | | 42 | * " plus space for last_cpupid: | NODE | ZONE | LAST_CPUPID ... | FLAGS | |
| 43 | * classic sparse with space for node:| SECTION | NODE | ZONE | ... | FLAGS | | 43 | * classic sparse with space for node:| SECTION | NODE | ZONE | ... | FLAGS | |
| 44 | * " plus space for last_nid: | SECTION | NODE | ZONE | LAST_NID ... | FLAGS | | 44 | * " plus space for last_cpupid: | SECTION | NODE | ZONE | LAST_CPUPID ... | FLAGS | |
| 45 | * classic sparse no space for node: | SECTION | ZONE | ... | FLAGS | | 45 | * classic sparse no space for node: | SECTION | ZONE | ... | FLAGS | |
| 46 | */ | 46 | */ |
| 47 | #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) | 47 | #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) |
| @@ -62,15 +62,21 @@ | |||
| 62 | #endif | 62 | #endif |
| 63 | 63 | ||
| 64 | #ifdef CONFIG_NUMA_BALANCING | 64 | #ifdef CONFIG_NUMA_BALANCING |
| 65 | #define LAST_NID_SHIFT NODES_SHIFT | 65 | #define LAST__PID_SHIFT 8 |
| 66 | #define LAST__PID_MASK ((1 << LAST__PID_SHIFT)-1) | ||
| 67 | |||
| 68 | #define LAST__CPU_SHIFT NR_CPUS_BITS | ||
| 69 | #define LAST__CPU_MASK ((1 << LAST__CPU_SHIFT)-1) | ||
| 70 | |||
| 71 | #define LAST_CPUPID_SHIFT (LAST__PID_SHIFT+LAST__CPU_SHIFT) | ||
| 66 | #else | 72 | #else |
| 67 | #define LAST_NID_SHIFT 0 | 73 | #define LAST_CPUPID_SHIFT 0 |
| 68 | #endif | 74 | #endif |
| 69 | 75 | ||
| 70 | #if SECTIONS_WIDTH+ZONES_WIDTH+NODES_SHIFT+LAST_NID_SHIFT <= BITS_PER_LONG - NR_PAGEFLAGS | 76 | #if SECTIONS_WIDTH+ZONES_WIDTH+NODES_SHIFT+LAST_CPUPID_SHIFT <= BITS_PER_LONG - NR_PAGEFLAGS |
| 71 | #define LAST_NID_WIDTH LAST_NID_SHIFT | 77 | #define LAST_CPUPID_WIDTH LAST_CPUPID_SHIFT |
| 72 | #else | 78 | #else |
| 73 | #define LAST_NID_WIDTH 0 | 79 | #define LAST_CPUPID_WIDTH 0 |
| 74 | #endif | 80 | #endif |
| 75 | 81 | ||
| 76 | /* | 82 | /* |
| @@ -81,8 +87,8 @@ | |||
| 81 | #define NODE_NOT_IN_PAGE_FLAGS | 87 | #define NODE_NOT_IN_PAGE_FLAGS |
| 82 | #endif | 88 | #endif |
| 83 | 89 | ||
| 84 | #if defined(CONFIG_NUMA_BALANCING) && LAST_NID_WIDTH == 0 | 90 | #if defined(CONFIG_NUMA_BALANCING) && LAST_CPUPID_WIDTH == 0 |
| 85 | #define LAST_NID_NOT_IN_PAGE_FLAGS | 91 | #define LAST_CPUPID_NOT_IN_PAGE_FLAGS |
| 86 | #endif | 92 | #endif |
| 87 | 93 | ||
| 88 | #endif /* _LINUX_PAGE_FLAGS_LAYOUT */ | 94 | #endif /* _LINUX_PAGE_FLAGS_LAYOUT */ |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 6d53675c2b54..98ada58f9942 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
| @@ -329,7 +329,9 @@ static inline void set_page_writeback(struct page *page) | |||
| 329 | * System with lots of page flags available. This allows separate | 329 | * System with lots of page flags available. This allows separate |
| 330 | * flags for PageHead() and PageTail() checks of compound pages so that bit | 330 | * flags for PageHead() and PageTail() checks of compound pages so that bit |
| 331 | * tests can be used in performance sensitive paths. PageCompound is | 331 | * tests can be used in performance sensitive paths. PageCompound is |
| 332 | * generally not used in hot code paths. | 332 | * generally not used in hot code paths except arch/powerpc/mm/init_64.c |
| 333 | * and arch/powerpc/kvm/book3s_64_vio_hv.c which use it to detect huge pages | ||
| 334 | * and avoid handling those in real mode. | ||
| 333 | */ | 335 | */ |
| 334 | __PAGEFLAG(Head, head) CLEARPAGEFLAG(Head, head) | 336 | __PAGEFLAG(Head, head) CLEARPAGEFLAG(Head, head) |
| 335 | __PAGEFLAG(Tail, tail) | 337 | __PAGEFLAG(Tail, tail) |
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index c74088ab103b..9e4761caa80c 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
| @@ -375,22 +375,6 @@ do { \ | |||
| 375 | # define this_cpu_or(pcp, val) __pcpu_size_call(this_cpu_or_, (pcp), (val)) | 375 | # define this_cpu_or(pcp, val) __pcpu_size_call(this_cpu_or_, (pcp), (val)) |
| 376 | #endif | 376 | #endif |
| 377 | 377 | ||
| 378 | #ifndef this_cpu_xor | ||
| 379 | # ifndef this_cpu_xor_1 | ||
| 380 | # define this_cpu_xor_1(pcp, val) _this_cpu_generic_to_op((pcp), (val), ^=) | ||
| 381 | # endif | ||
| 382 | # ifndef this_cpu_xor_2 | ||
| 383 | # define this_cpu_xor_2(pcp, val) _this_cpu_generic_to_op((pcp), (val), ^=) | ||
| 384 | # endif | ||
| 385 | # ifndef this_cpu_xor_4 | ||
| 386 | # define this_cpu_xor_4(pcp, val) _this_cpu_generic_to_op((pcp), (val), ^=) | ||
| 387 | # endif | ||
| 388 | # ifndef this_cpu_xor_8 | ||
| 389 | # define this_cpu_xor_8(pcp, val) _this_cpu_generic_to_op((pcp), (val), ^=) | ||
| 390 | # endif | ||
| 391 | # define this_cpu_xor(pcp, val) __pcpu_size_call(this_cpu_or_, (pcp), (val)) | ||
| 392 | #endif | ||
| 393 | |||
| 394 | #define _this_cpu_generic_add_return(pcp, val) \ | 378 | #define _this_cpu_generic_add_return(pcp, val) \ |
| 395 | ({ \ | 379 | ({ \ |
| 396 | typeof(pcp) ret__; \ | 380 | typeof(pcp) ret__; \ |
| @@ -629,22 +613,6 @@ do { \ | |||
| 629 | # define __this_cpu_or(pcp, val) __pcpu_size_call(__this_cpu_or_, (pcp), (val)) | 613 | # define __this_cpu_or(pcp, val) __pcpu_size_call(__this_cpu_or_, (pcp), (val)) |
| 630 | #endif | 614 | #endif |
| 631 | 615 | ||
| 632 | #ifndef __this_cpu_xor | ||
| 633 | # ifndef __this_cpu_xor_1 | ||
| 634 | # define __this_cpu_xor_1(pcp, val) __this_cpu_generic_to_op((pcp), (val), ^=) | ||
| 635 | # endif | ||
| 636 | # ifndef __this_cpu_xor_2 | ||
| 637 | # define __this_cpu_xor_2(pcp, val) __this_cpu_generic_to_op((pcp), (val), ^=) | ||
| 638 | # endif | ||
| 639 | # ifndef __this_cpu_xor_4 | ||
| 640 | # define __this_cpu_xor_4(pcp, val) __this_cpu_generic_to_op((pcp), (val), ^=) | ||
| 641 | # endif | ||
| 642 | # ifndef __this_cpu_xor_8 | ||
| 643 | # define __this_cpu_xor_8(pcp, val) __this_cpu_generic_to_op((pcp), (val), ^=) | ||
| 644 | # endif | ||
| 645 | # define __this_cpu_xor(pcp, val) __pcpu_size_call(__this_cpu_xor_, (pcp), (val)) | ||
| 646 | #endif | ||
| 647 | |||
| 648 | #define __this_cpu_generic_add_return(pcp, val) \ | 616 | #define __this_cpu_generic_add_return(pcp, val) \ |
| 649 | ({ \ | 617 | ({ \ |
| 650 | __this_cpu_add(pcp, val); \ | 618 | __this_cpu_add(pcp, val); \ |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index c8ba627c1d60..2e069d1288df 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -584,6 +584,10 @@ struct perf_sample_data { | |||
| 584 | struct perf_regs_user regs_user; | 584 | struct perf_regs_user regs_user; |
| 585 | u64 stack_user_size; | 585 | u64 stack_user_size; |
| 586 | u64 weight; | 586 | u64 weight; |
| 587 | /* | ||
| 588 | * Transaction flags for abort events: | ||
| 589 | */ | ||
| 590 | u64 txn; | ||
| 587 | }; | 591 | }; |
| 588 | 592 | ||
| 589 | static inline void perf_sample_data_init(struct perf_sample_data *data, | 593 | static inline void perf_sample_data_init(struct perf_sample_data *data, |
| @@ -599,6 +603,7 @@ static inline void perf_sample_data_init(struct perf_sample_data *data, | |||
| 599 | data->stack_user_size = 0; | 603 | data->stack_user_size = 0; |
| 600 | data->weight = 0; | 604 | data->weight = 0; |
| 601 | data->data_src.val = 0; | 605 | data->data_src.val = 0; |
| 606 | data->txn = 0; | ||
| 602 | } | 607 | } |
| 603 | 608 | ||
| 604 | extern void perf_output_sample(struct perf_output_handle *handle, | 609 | extern void perf_output_sample(struct perf_output_handle *handle, |
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h new file mode 100644 index 000000000000..6d722695e027 --- /dev/null +++ b/include/linux/phy/phy.h | |||
| @@ -0,0 +1,270 @@ | |||
| 1 | /* | ||
| 2 | * phy.h -- generic phy header file | ||
| 3 | * | ||
| 4 | * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com | ||
| 5 | * | ||
| 6 | * Author: Kishon Vijay Abraham I <kishon@ti.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 as published by | ||
| 10 | * the Free Software Foundation; either version 2 of the License, or | ||
| 11 | * (at your option) any later version. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __DRIVERS_PHY_H | ||
| 15 | #define __DRIVERS_PHY_H | ||
| 16 | |||
| 17 | #include <linux/err.h> | ||
| 18 | #include <linux/of.h> | ||
| 19 | #include <linux/device.h> | ||
| 20 | #include <linux/pm_runtime.h> | ||
| 21 | |||
| 22 | struct phy; | ||
| 23 | |||
| 24 | /** | ||
| 25 | * struct phy_ops - set of function pointers for performing phy operations | ||
| 26 | * @init: operation to be performed for initializing phy | ||
| 27 | * @exit: operation to be performed while exiting | ||
| 28 | * @power_on: powering on the phy | ||
| 29 | * @power_off: powering off the phy | ||
| 30 | * @owner: the module owner containing the ops | ||
| 31 | */ | ||
| 32 | struct phy_ops { | ||
| 33 | int (*init)(struct phy *phy); | ||
| 34 | int (*exit)(struct phy *phy); | ||
| 35 | int (*power_on)(struct phy *phy); | ||
| 36 | int (*power_off)(struct phy *phy); | ||
| 37 | struct module *owner; | ||
| 38 | }; | ||
| 39 | |||
| 40 | /** | ||
| 41 | * struct phy - represents the phy device | ||
| 42 | * @dev: phy device | ||
| 43 | * @id: id of the phy device | ||
| 44 | * @ops: function pointers for performing phy operations | ||
| 45 | * @init_data: list of PHY consumers (non-dt only) | ||
| 46 | * @mutex: mutex to protect phy_ops | ||
| 47 | * @init_count: used to protect when the PHY is used by multiple consumers | ||
| 48 | * @power_count: used to protect when the PHY is used by multiple consumers | ||
| 49 | */ | ||
| 50 | struct phy { | ||
| 51 | struct device dev; | ||
| 52 | int id; | ||
| 53 | const struct phy_ops *ops; | ||
| 54 | struct phy_init_data *init_data; | ||
| 55 | struct mutex mutex; | ||
| 56 | int init_count; | ||
| 57 | int power_count; | ||
| 58 | }; | ||
| 59 | |||
| 60 | /** | ||
| 61 | * struct phy_provider - represents the phy provider | ||
| 62 | * @dev: phy provider device | ||
| 63 | * @owner: the module owner having of_xlate | ||
| 64 | * @of_xlate: function pointer to obtain phy instance from phy pointer | ||
| 65 | * @list: to maintain a linked list of PHY providers | ||
| 66 | */ | ||
| 67 | struct phy_provider { | ||
| 68 | struct device *dev; | ||
| 69 | struct module *owner; | ||
| 70 | struct list_head list; | ||
| 71 | struct phy * (*of_xlate)(struct device *dev, | ||
| 72 | struct of_phandle_args *args); | ||
| 73 | }; | ||
| 74 | |||
| 75 | /** | ||
| 76 | * struct phy_consumer - represents the phy consumer | ||
| 77 | * @dev_name: the device name of the controller that will use this PHY device | ||
| 78 | * @port: name given to the consumer port | ||
| 79 | */ | ||
| 80 | struct phy_consumer { | ||
| 81 | const char *dev_name; | ||
| 82 | const char *port; | ||
| 83 | }; | ||
| 84 | |||
| 85 | /** | ||
| 86 | * struct phy_init_data - contains the list of PHY consumers | ||
| 87 | * @num_consumers: number of consumers for this PHY device | ||
| 88 | * @consumers: list of PHY consumers | ||
| 89 | */ | ||
| 90 | struct phy_init_data { | ||
| 91 | unsigned int num_consumers; | ||
| 92 | struct phy_consumer *consumers; | ||
| 93 | }; | ||
| 94 | |||
| 95 | #define PHY_CONSUMER(_dev_name, _port) \ | ||
| 96 | { \ | ||
| 97 | .dev_name = _dev_name, \ | ||
| 98 | .port = _port, \ | ||
| 99 | } | ||
| 100 | |||
| 101 | #define to_phy(dev) (container_of((dev), struct phy, dev)) | ||
| 102 | |||
| 103 | #define of_phy_provider_register(dev, xlate) \ | ||
| 104 | __of_phy_provider_register((dev), THIS_MODULE, (xlate)) | ||
| 105 | |||
| 106 | #define devm_of_phy_provider_register(dev, xlate) \ | ||
| 107 | __devm_of_phy_provider_register((dev), THIS_MODULE, (xlate)) | ||
| 108 | |||
| 109 | static inline void phy_set_drvdata(struct phy *phy, void *data) | ||
| 110 | { | ||
| 111 | dev_set_drvdata(&phy->dev, data); | ||
| 112 | } | ||
| 113 | |||
| 114 | static inline void *phy_get_drvdata(struct phy *phy) | ||
| 115 | { | ||
| 116 | return dev_get_drvdata(&phy->dev); | ||
| 117 | } | ||
| 118 | |||
| 119 | #if IS_ENABLED(CONFIG_GENERIC_PHY) | ||
| 120 | int phy_pm_runtime_get(struct phy *phy); | ||
| 121 | int phy_pm_runtime_get_sync(struct phy *phy); | ||
| 122 | int phy_pm_runtime_put(struct phy *phy); | ||
| 123 | int phy_pm_runtime_put_sync(struct phy *phy); | ||
| 124 | void phy_pm_runtime_allow(struct phy *phy); | ||
| 125 | void phy_pm_runtime_forbid(struct phy *phy); | ||
| 126 | int phy_init(struct phy *phy); | ||
| 127 | int phy_exit(struct phy *phy); | ||
| 128 | int phy_power_on(struct phy *phy); | ||
| 129 | int phy_power_off(struct phy *phy); | ||
| 130 | struct phy *phy_get(struct device *dev, const char *string); | ||
| 131 | struct phy *devm_phy_get(struct device *dev, const char *string); | ||
| 132 | void phy_put(struct phy *phy); | ||
| 133 | void devm_phy_put(struct device *dev, struct phy *phy); | ||
| 134 | struct phy *of_phy_simple_xlate(struct device *dev, | ||
| 135 | struct of_phandle_args *args); | ||
| 136 | struct phy *phy_create(struct device *dev, const struct phy_ops *ops, | ||
| 137 | struct phy_init_data *init_data); | ||
| 138 | struct phy *devm_phy_create(struct device *dev, | ||
| 139 | const struct phy_ops *ops, struct phy_init_data *init_data); | ||
| 140 | void phy_destroy(struct phy *phy); | ||
| 141 | void devm_phy_destroy(struct device *dev, struct phy *phy); | ||
| 142 | struct phy_provider *__of_phy_provider_register(struct device *dev, | ||
| 143 | struct module *owner, struct phy * (*of_xlate)(struct device *dev, | ||
| 144 | struct of_phandle_args *args)); | ||
| 145 | struct phy_provider *__devm_of_phy_provider_register(struct device *dev, | ||
| 146 | struct module *owner, struct phy * (*of_xlate)(struct device *dev, | ||
| 147 | struct of_phandle_args *args)); | ||
| 148 | void of_phy_provider_unregister(struct phy_provider *phy_provider); | ||
| 149 | void devm_of_phy_provider_unregister(struct device *dev, | ||
| 150 | struct phy_provider *phy_provider); | ||
| 151 | #else | ||
| 152 | static inline int phy_pm_runtime_get(struct phy *phy) | ||
| 153 | { | ||
| 154 | return -ENOSYS; | ||
| 155 | } | ||
| 156 | |||
| 157 | static inline int phy_pm_runtime_get_sync(struct phy *phy) | ||
| 158 | { | ||
| 159 | return -ENOSYS; | ||
| 160 | } | ||
| 161 | |||
| 162 | static inline int phy_pm_runtime_put(struct phy *phy) | ||
| 163 | { | ||
| 164 | return -ENOSYS; | ||
| 165 | } | ||
| 166 | |||
| 167 | static inline int phy_pm_runtime_put_sync(struct phy *phy) | ||
| 168 | { | ||
| 169 | return -ENOSYS; | ||
| 170 | } | ||
| 171 | |||
| 172 | static inline void phy_pm_runtime_allow(struct phy *phy) | ||
| 173 | { | ||
| 174 | return; | ||
| 175 | } | ||
| 176 | |||
| 177 | static inline void phy_pm_runtime_forbid(struct phy *phy) | ||
| 178 | { | ||
| 179 | return; | ||
| 180 | } | ||
| 181 | |||
| 182 | static inline int phy_init(struct phy *phy) | ||
| 183 | { | ||
| 184 | return -ENOSYS; | ||
| 185 | } | ||
| 186 | |||
| 187 | static inline int phy_exit(struct phy *phy) | ||
| 188 | { | ||
| 189 | return -ENOSYS; | ||
| 190 | } | ||
| 191 | |||
| 192 | static inline int phy_power_on(struct phy *phy) | ||
| 193 | { | ||
| 194 | return -ENOSYS; | ||
| 195 | } | ||
| 196 | |||
| 197 | static inline int phy_power_off(struct phy *phy) | ||
| 198 | { | ||
| 199 | return -ENOSYS; | ||
| 200 | } | ||
| 201 | |||
| 202 | static inline struct phy *phy_get(struct device *dev, const char *string) | ||
| 203 | { | ||
| 204 | return ERR_PTR(-ENOSYS); | ||
| 205 | } | ||
| 206 | |||
| 207 | static inline struct phy *devm_phy_get(struct device *dev, const char *string) | ||
| 208 | { | ||
| 209 | return ERR_PTR(-ENOSYS); | ||
| 210 | } | ||
| 211 | |||
| 212 | static inline void phy_put(struct phy *phy) | ||
| 213 | { | ||
| 214 | } | ||
| 215 | |||
| 216 | static inline void devm_phy_put(struct device *dev, struct phy *phy) | ||
| 217 | { | ||
| 218 | } | ||
| 219 | |||
| 220 | static inline struct phy *of_phy_simple_xlate(struct device *dev, | ||
| 221 | struct of_phandle_args *args) | ||
| 222 | { | ||
| 223 | return ERR_PTR(-ENOSYS); | ||
| 224 | } | ||
| 225 | |||
| 226 | static inline struct phy *phy_create(struct device *dev, | ||
| 227 | const struct phy_ops *ops, struct phy_init_data *init_data) | ||
| 228 | { | ||
| 229 | return ERR_PTR(-ENOSYS); | ||
| 230 | } | ||
| 231 | |||
| 232 | static inline struct phy *devm_phy_create(struct device *dev, | ||
| 233 | const struct phy_ops *ops, struct phy_init_data *init_data) | ||
| 234 | { | ||
| 235 | return ERR_PTR(-ENOSYS); | ||
| 236 | } | ||
| 237 | |||
| 238 | static inline void phy_destroy(struct phy *phy) | ||
| 239 | { | ||
| 240 | } | ||
| 241 | |||
| 242 | static inline void devm_phy_destroy(struct device *dev, struct phy *phy) | ||
| 243 | { | ||
| 244 | } | ||
| 245 | |||
| 246 | static inline struct phy_provider *__of_phy_provider_register( | ||
| 247 | struct device *dev, struct module *owner, struct phy * (*of_xlate)( | ||
| 248 | struct device *dev, struct of_phandle_args *args)) | ||
| 249 | { | ||
| 250 | return ERR_PTR(-ENOSYS); | ||
| 251 | } | ||
| 252 | |||
| 253 | static inline struct phy_provider *__devm_of_phy_provider_register(struct device | ||
| 254 | *dev, struct module *owner, struct phy * (*of_xlate)(struct device *dev, | ||
| 255 | struct of_phandle_args *args)) | ||
| 256 | { | ||
| 257 | return ERR_PTR(-ENOSYS); | ||
| 258 | } | ||
| 259 | |||
| 260 | static inline void of_phy_provider_unregister(struct phy_provider *phy_provider) | ||
| 261 | { | ||
| 262 | } | ||
| 263 | |||
| 264 | static inline void devm_of_phy_provider_unregister(struct device *dev, | ||
| 265 | struct phy_provider *phy_provider) | ||
| 266 | { | ||
| 267 | } | ||
| 268 | #endif | ||
| 269 | |||
| 270 | #endif /* __DRIVERS_PHY_H */ | ||
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h index e2772666f004..7246ef3d4455 100644 --- a/include/linux/pid_namespace.h +++ b/include/linux/pid_namespace.h | |||
| @@ -23,6 +23,7 @@ struct bsd_acct_struct; | |||
| 23 | struct pid_namespace { | 23 | struct pid_namespace { |
| 24 | struct kref kref; | 24 | struct kref kref; |
| 25 | struct pidmap pidmap[PIDMAP_ENTRIES]; | 25 | struct pidmap pidmap[PIDMAP_ENTRIES]; |
| 26 | struct rcu_head rcu; | ||
| 26 | int last_pid; | 27 | int last_pid; |
| 27 | unsigned int nr_hashed; | 28 | unsigned int nr_hashed; |
| 28 | struct task_struct *child_reaper; | 29 | struct task_struct *child_reaper; |
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index 5979147d2bda..fefb88663975 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h | |||
| @@ -144,6 +144,9 @@ extern struct pinctrl_dev *pinctrl_find_and_add_gpio_range(const char *devname, | |||
| 144 | extern struct pinctrl_gpio_range * | 144 | extern struct pinctrl_gpio_range * |
| 145 | pinctrl_find_gpio_range_from_pin(struct pinctrl_dev *pctldev, | 145 | pinctrl_find_gpio_range_from_pin(struct pinctrl_dev *pctldev, |
| 146 | unsigned int pin); | 146 | unsigned int pin); |
| 147 | extern int pinctrl_get_group_pins(struct pinctrl_dev *pctldev, | ||
| 148 | const char *pin_group, const unsigned **pins, | ||
| 149 | unsigned *num_pins); | ||
| 147 | 150 | ||
| 148 | #ifdef CONFIG_OF | 151 | #ifdef CONFIG_OF |
| 149 | extern struct pinctrl_dev *of_pinctrl_get(struct device_node *np); | 152 | extern struct pinctrl_dev *of_pinctrl_get(struct device_node *np); |
diff --git a/include/linux/platform_data/clk-nomadik.h b/include/linux/platform_data/clk-nomadik.h deleted file mode 100644 index 5713c87b2477..000000000000 --- a/include/linux/platform_data/clk-nomadik.h +++ /dev/null | |||
| @@ -1,2 +0,0 @@ | |||
| 1 | /* Minimal platform data header */ | ||
| 2 | void nomadik_clk_init(void); | ||
diff --git a/include/linux/platform_data/clk-ux500.h b/include/linux/platform_data/clk-ux500.h index 9d98f3aaa16c..97baf831e071 100644 --- a/include/linux/platform_data/clk-ux500.h +++ b/include/linux/platform_data/clk-ux500.h | |||
| @@ -10,6 +10,9 @@ | |||
| 10 | #ifndef __CLK_UX500_H | 10 | #ifndef __CLK_UX500_H |
| 11 | #define __CLK_UX500_H | 11 | #define __CLK_UX500_H |
| 12 | 12 | ||
| 13 | void u8500_of_clk_init(u32 clkrst1_base, u32 clkrst2_base, u32 clkrst3_base, | ||
| 14 | u32 clkrst5_base, u32 clkrst6_base); | ||
| 15 | |||
| 13 | void u8500_clk_init(u32 clkrst1_base, u32 clkrst2_base, u32 clkrst3_base, | 16 | void u8500_clk_init(u32 clkrst1_base, u32 clkrst2_base, u32 clkrst3_base, |
| 14 | u32 clkrst5_base, u32 clkrst6_base); | 17 | u32 clkrst5_base, u32 clkrst6_base); |
| 15 | void u9540_clk_init(u32 clkrst1_base, u32 clkrst2_base, u32 clkrst3_base, | 18 | void u9540_clk_init(u32 clkrst1_base, u32 clkrst2_base, u32 clkrst3_base, |
diff --git a/include/linux/platform_data/davinci_asp.h b/include/linux/platform_data/davinci_asp.h index 8db5ae03b6e3..689a856b86f9 100644 --- a/include/linux/platform_data/davinci_asp.h +++ b/include/linux/platform_data/davinci_asp.h | |||
| @@ -84,6 +84,8 @@ struct snd_platform_data { | |||
| 84 | u8 version; | 84 | u8 version; |
| 85 | u8 txnumevt; | 85 | u8 txnumevt; |
| 86 | u8 rxnumevt; | 86 | u8 rxnumevt; |
| 87 | int tx_dma_channel; | ||
| 88 | int rx_dma_channel; | ||
| 87 | }; | 89 | }; |
| 88 | 90 | ||
| 89 | enum { | 91 | enum { |
diff --git a/include/linux/platform_data/dma-s3c24xx.h b/include/linux/platform_data/dma-s3c24xx.h new file mode 100644 index 000000000000..89ba1b0c90e4 --- /dev/null +++ b/include/linux/platform_data/dma-s3c24xx.h | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | /* | ||
| 2 | * S3C24XX DMA handling | ||
| 3 | * | ||
| 4 | * Copyright (c) 2013 Heiko Stuebner <heiko@sntech.de> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify it | ||
| 7 | * under the terms of the GNU General Public License as published by the Free | ||
| 8 | * Software Foundation; either version 2 of the License, or (at your option) | ||
| 9 | * any later version. | ||
| 10 | */ | ||
| 11 | |||
| 12 | /* Helper to encode the source selection constraints for early s3c socs. */ | ||
| 13 | #define S3C24XX_DMA_CHANREQ(src, chan) ((BIT(3) | src) << chan * 4) | ||
| 14 | |||
| 15 | enum s3c24xx_dma_bus { | ||
| 16 | S3C24XX_DMA_APB, | ||
| 17 | S3C24XX_DMA_AHB, | ||
| 18 | }; | ||
| 19 | |||
| 20 | /** | ||
| 21 | * @bus: on which bus does the peripheral reside - AHB or APB. | ||
| 22 | * @handshake: is a handshake with the peripheral necessary | ||
| 23 | * @chansel: channel selection information, depending on variant; reqsel for | ||
| 24 | * s3c2443 and later and channel-selection map for earlier SoCs | ||
| 25 | * see CHANSEL doc in s3c2443-dma.c | ||
| 26 | */ | ||
| 27 | struct s3c24xx_dma_channel { | ||
| 28 | enum s3c24xx_dma_bus bus; | ||
| 29 | bool handshake; | ||
| 30 | u16 chansel; | ||
| 31 | }; | ||
| 32 | |||
| 33 | /** | ||
| 34 | * struct s3c24xx_dma_platdata - platform specific settings | ||
| 35 | * @num_phy_channels: number of physical channels | ||
| 36 | * @channels: array of virtual channel descriptions | ||
| 37 | * @num_channels: number of virtual channels | ||
| 38 | */ | ||
| 39 | struct s3c24xx_dma_platdata { | ||
| 40 | int num_phy_channels; | ||
| 41 | struct s3c24xx_dma_channel *channels; | ||
| 42 | int num_channels; | ||
| 43 | }; | ||
| 44 | |||
| 45 | struct dma_chan; | ||
| 46 | bool s3c24xx_dma_filter(struct dma_chan *chan, void *param); | ||
diff --git a/include/linux/platform_data/gpio-davinci.h b/include/linux/platform_data/gpio-davinci.h new file mode 100644 index 000000000000..6efd20264585 --- /dev/null +++ b/include/linux/platform_data/gpio-davinci.h | |||
| @@ -0,0 +1,60 @@ | |||
| 1 | /* | ||
| 2 | * DaVinci GPIO Platform Related Defines | ||
| 3 | * | ||
| 4 | * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or | ||
| 7 | * modify it under the terms of the GNU General Public License as | ||
| 8 | * published by the Free Software Foundation version 2. | ||
| 9 | * | ||
| 10 | * This program is distributed "as is" WITHOUT ANY WARRANTY of any | ||
| 11 | * kind, whether express or implied; without even the implied warranty | ||
| 12 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #ifndef __DAVINCI_GPIO_PLATFORM_H | ||
| 17 | #define __DAVINCI_GPIO_PLATFORM_H | ||
| 18 | |||
| 19 | #include <linux/io.h> | ||
| 20 | #include <linux/spinlock.h> | ||
| 21 | |||
| 22 | #include <asm-generic/gpio.h> | ||
| 23 | |||
| 24 | enum davinci_gpio_type { | ||
| 25 | GPIO_TYPE_TNETV107X = 0, | ||
| 26 | }; | ||
| 27 | |||
| 28 | struct davinci_gpio_platform_data { | ||
| 29 | u32 ngpio; | ||
| 30 | u32 gpio_unbanked; | ||
| 31 | u32 intc_irq_num; | ||
| 32 | }; | ||
| 33 | |||
| 34 | |||
| 35 | struct davinci_gpio_controller { | ||
| 36 | struct gpio_chip chip; | ||
| 37 | int irq_base; | ||
| 38 | /* Serialize access to GPIO registers */ | ||
| 39 | spinlock_t lock; | ||
| 40 | void __iomem *regs; | ||
| 41 | void __iomem *set_data; | ||
| 42 | void __iomem *clr_data; | ||
| 43 | void __iomem *in_data; | ||
| 44 | int gpio_unbanked; | ||
| 45 | unsigned gpio_irq; | ||
| 46 | }; | ||
| 47 | |||
| 48 | /* | ||
| 49 | * basic gpio routines | ||
| 50 | */ | ||
| 51 | #define GPIO(X) (X) /* 0 <= X <= (DAVINCI_N_GPIO - 1) */ | ||
| 52 | |||
| 53 | /* Convert GPIO signal to GPIO pin number */ | ||
| 54 | #define GPIO_TO_PIN(bank, gpio) (16 * (bank) + (gpio)) | ||
| 55 | |||
| 56 | static inline u32 __gpio_mask(unsigned gpio) | ||
| 57 | { | ||
| 58 | return 1 << (gpio % 32); | ||
| 59 | } | ||
| 60 | #endif | ||
diff --git a/include/linux/platform_data/leds-lp55xx.h b/include/linux/platform_data/leds-lp55xx.h index 51a2ff579d60..624ff9edad6f 100644 --- a/include/linux/platform_data/leds-lp55xx.h +++ b/include/linux/platform_data/leds-lp55xx.h | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | 22 | ||
| 23 | struct lp55xx_led_config { | 23 | struct lp55xx_led_config { |
| 24 | const char *name; | 24 | const char *name; |
| 25 | const char *default_trigger; | ||
| 25 | u8 chan_nr; | 26 | u8 chan_nr; |
| 26 | u8 led_current; /* mA x10, 0 if led is not connected */ | 27 | u8 led_current; /* mA x10, 0 if led is not connected */ |
| 27 | u8 max_current; | 28 | u8 max_current; |
| @@ -66,10 +67,8 @@ struct lp55xx_platform_data { | |||
| 66 | /* Clock configuration */ | 67 | /* Clock configuration */ |
| 67 | u8 clock_mode; | 68 | u8 clock_mode; |
| 68 | 69 | ||
| 69 | /* Platform specific functions */ | 70 | /* optional enable GPIO */ |
| 70 | int (*setup_resources)(void); | 71 | int enable_gpio; |
| 71 | void (*release_resources)(void); | ||
| 72 | void (*enable)(bool state); | ||
| 73 | 72 | ||
| 74 | /* Predefined pattern data */ | 73 | /* Predefined pattern data */ |
| 75 | struct lp55xx_predef_pattern *patterns; | 74 | struct lp55xx_predef_pattern *patterns; |
diff --git a/include/linux/platform_data/leds-pca9685.h b/include/linux/platform_data/leds-pca9685.h new file mode 100644 index 000000000000..778e9e4249cc --- /dev/null +++ b/include/linux/platform_data/leds-pca9685.h | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2013 Maximilian Güntner <maximilian.guentner@gmail.com> | ||
| 3 | * | ||
| 4 | * This file is subject to the terms and conditions of version 2 of | ||
| 5 | * the GNU General Public License. See the file COPYING in the main | ||
| 6 | * directory of this archive for more details. | ||
| 7 | * | ||
| 8 | * Based on leds-pca963x.h by Peter Meerwald <p.meerwald@bct-electronic.com> | ||
| 9 | * | ||
| 10 | * LED driver for the NXP PCA9685 PWM chip | ||
| 11 | * | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __LINUX_PCA9685_H | ||
| 15 | #define __LINUX_PCA9685_H | ||
| 16 | |||
| 17 | #include <linux/leds.h> | ||
| 18 | |||
| 19 | enum pca9685_outdrv { | ||
| 20 | PCA9685_OPEN_DRAIN, | ||
| 21 | PCA9685_TOTEM_POLE, | ||
| 22 | }; | ||
| 23 | |||
| 24 | enum pca9685_inverted { | ||
| 25 | PCA9685_NOT_INVERTED, | ||
| 26 | PCA9685_INVERTED, | ||
| 27 | }; | ||
| 28 | |||
| 29 | struct pca9685_platform_data { | ||
| 30 | struct led_platform_data leds; | ||
| 31 | enum pca9685_outdrv outdrv; | ||
| 32 | enum pca9685_inverted inverted; | ||
| 33 | }; | ||
| 34 | |||
| 35 | #endif /* __LINUX_PCA9685_H */ | ||
diff --git a/include/linux/platform_data/lm3630_bl.h b/include/linux/platform_data/lm3630_bl.h deleted file mode 100644 index 9176dd3f2d63..000000000000 --- a/include/linux/platform_data/lm3630_bl.h +++ /dev/null | |||
| @@ -1,57 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Simple driver for Texas Instruments LM3630 LED Flash driver chip | ||
| 3 | * Copyright (C) 2012 Texas Instruments | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License version 2 as | ||
| 7 | * published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __LINUX_LM3630_H | ||
| 12 | #define __LINUX_LM3630_H | ||
| 13 | |||
| 14 | #define LM3630_NAME "lm3630_bl" | ||
| 15 | |||
| 16 | enum lm3630_pwm_ctrl { | ||
| 17 | PWM_CTRL_DISABLE = 0, | ||
| 18 | PWM_CTRL_BANK_A, | ||
| 19 | PWM_CTRL_BANK_B, | ||
| 20 | PWM_CTRL_BANK_ALL, | ||
| 21 | }; | ||
| 22 | |||
| 23 | enum lm3630_pwm_active { | ||
| 24 | PWM_ACTIVE_HIGH = 0, | ||
| 25 | PWM_ACTIVE_LOW, | ||
| 26 | }; | ||
| 27 | |||
| 28 | enum lm3630_bank_a_ctrl { | ||
| 29 | BANK_A_CTRL_DISABLE = 0x0, | ||
| 30 | BANK_A_CTRL_LED1 = 0x4, | ||
| 31 | BANK_A_CTRL_LED2 = 0x1, | ||
| 32 | BANK_A_CTRL_ALL = 0x5, | ||
| 33 | }; | ||
| 34 | |||
| 35 | enum lm3630_bank_b_ctrl { | ||
| 36 | BANK_B_CTRL_DISABLE = 0, | ||
| 37 | BANK_B_CTRL_LED2, | ||
| 38 | }; | ||
| 39 | |||
| 40 | struct lm3630_platform_data { | ||
| 41 | |||
| 42 | /* maximum brightness */ | ||
| 43 | int max_brt_led1; | ||
| 44 | int max_brt_led2; | ||
| 45 | |||
| 46 | /* initial on brightness */ | ||
| 47 | int init_brt_led1; | ||
| 48 | int init_brt_led2; | ||
| 49 | enum lm3630_pwm_ctrl pwm_ctrl; | ||
| 50 | enum lm3630_pwm_active pwm_active; | ||
| 51 | enum lm3630_bank_a_ctrl bank_a_ctrl; | ||
| 52 | enum lm3630_bank_b_ctrl bank_b_ctrl; | ||
| 53 | unsigned int pwm_period; | ||
| 54 | void (*pwm_set_intensity) (int brightness, int max_brightness); | ||
| 55 | }; | ||
| 56 | |||
| 57 | #endif /* __LINUX_LM3630_H */ | ||
diff --git a/include/linux/platform_data/lm3630a_bl.h b/include/linux/platform_data/lm3630a_bl.h new file mode 100644 index 000000000000..7538e38e270b --- /dev/null +++ b/include/linux/platform_data/lm3630a_bl.h | |||
| @@ -0,0 +1,65 @@ | |||
| 1 | /* | ||
| 2 | * Simple driver for Texas Instruments LM3630A LED Flash driver chip | ||
| 3 | * Copyright (C) 2012 Texas Instruments | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License version 2 as | ||
| 7 | * published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __LINUX_LM3630A_H | ||
| 12 | #define __LINUX_LM3630A_H | ||
| 13 | |||
| 14 | #define LM3630A_NAME "lm3630a_bl" | ||
| 15 | |||
| 16 | enum lm3630a_pwm_ctrl { | ||
| 17 | LM3630A_PWM_DISABLE = 0x00, | ||
| 18 | LM3630A_PWM_BANK_A, | ||
| 19 | LM3630A_PWM_BANK_B, | ||
| 20 | LM3630A_PWM_BANK_ALL, | ||
| 21 | LM3630A_PWM_BANK_A_ACT_LOW = 0x05, | ||
| 22 | LM3630A_PWM_BANK_B_ACT_LOW, | ||
| 23 | LM3630A_PWM_BANK_ALL_ACT_LOW, | ||
| 24 | }; | ||
| 25 | |||
| 26 | enum lm3630a_leda_ctrl { | ||
| 27 | LM3630A_LEDA_DISABLE = 0x00, | ||
| 28 | LM3630A_LEDA_ENABLE = 0x04, | ||
| 29 | LM3630A_LEDA_ENABLE_LINEAR = 0x14, | ||
| 30 | }; | ||
| 31 | |||
| 32 | enum lm3630a_ledb_ctrl { | ||
| 33 | LM3630A_LEDB_DISABLE = 0x00, | ||
| 34 | LM3630A_LEDB_ON_A = 0x01, | ||
| 35 | LM3630A_LEDB_ENABLE = 0x02, | ||
| 36 | LM3630A_LEDB_ENABLE_LINEAR = 0x0A, | ||
| 37 | }; | ||
| 38 | |||
| 39 | #define LM3630A_MAX_BRIGHTNESS 255 | ||
| 40 | /* | ||
| 41 | *@leda_init_brt : led a init brightness. 4~255 | ||
| 42 | *@leda_max_brt : led a max brightness. 4~255 | ||
| 43 | *@leda_ctrl : led a disable, enable linear, enable exponential | ||
| 44 | *@ledb_init_brt : led b init brightness. 4~255 | ||
| 45 | *@ledb_max_brt : led b max brightness. 4~255 | ||
| 46 | *@ledb_ctrl : led b disable, enable linear, enable exponential | ||
| 47 | *@pwm_period : pwm period | ||
| 48 | *@pwm_ctrl : pwm disable, bank a or b, active high or low | ||
| 49 | */ | ||
| 50 | struct lm3630a_platform_data { | ||
| 51 | |||
| 52 | /* led a config. */ | ||
| 53 | int leda_init_brt; | ||
| 54 | int leda_max_brt; | ||
| 55 | enum lm3630a_leda_ctrl leda_ctrl; | ||
| 56 | /* led b config. */ | ||
| 57 | int ledb_init_brt; | ||
| 58 | int ledb_max_brt; | ||
| 59 | enum lm3630a_ledb_ctrl ledb_ctrl; | ||
| 60 | /* pwm config. */ | ||
| 61 | unsigned int pwm_period; | ||
| 62 | enum lm3630a_pwm_ctrl pwm_ctrl; | ||
| 63 | }; | ||
| 64 | |||
| 65 | #endif /* __LINUX_LM3630A_H */ | ||
diff --git a/include/linux/platform_data/lp855x.h b/include/linux/platform_data/lp855x.h index ea3200527dd3..1b2ba24e4e03 100644 --- a/include/linux/platform_data/lp855x.h +++ b/include/linux/platform_data/lp855x.h | |||
| @@ -40,6 +40,17 @@ | |||
| 40 | #define LP8553_PWM_CONFIG LP8550_PWM_CONFIG | 40 | #define LP8553_PWM_CONFIG LP8550_PWM_CONFIG |
| 41 | #define LP8553_I2C_CONFIG LP8550_I2C_CONFIG | 41 | #define LP8553_I2C_CONFIG LP8550_I2C_CONFIG |
| 42 | 42 | ||
| 43 | /* CONFIG register - LP8555 */ | ||
| 44 | #define LP8555_PWM_STANDBY BIT(7) | ||
| 45 | #define LP8555_PWM_FILTER BIT(6) | ||
| 46 | #define LP8555_RELOAD_EPROM BIT(3) /* use it if EPROMs should be reset | ||
| 47 | when the backlight turns on */ | ||
| 48 | #define LP8555_OFF_OPENLEDS BIT(2) | ||
| 49 | #define LP8555_PWM_CONFIG LP8555_PWM_ONLY | ||
| 50 | #define LP8555_I2C_CONFIG LP8555_I2C_ONLY | ||
| 51 | #define LP8555_COMB1_CONFIG LP8555_COMBINED1 | ||
| 52 | #define LP8555_COMB2_CONFIG LP8555_COMBINED2 | ||
| 53 | |||
| 43 | /* DEVICE CONTROL register - LP8556 */ | 54 | /* DEVICE CONTROL register - LP8556 */ |
| 44 | #define LP8556_PWM_CONFIG (LP8556_PWM_ONLY << BRT_MODE_SHFT) | 55 | #define LP8556_PWM_CONFIG (LP8556_PWM_ONLY << BRT_MODE_SHFT) |
| 45 | #define LP8556_COMB1_CONFIG (LP8556_COMBINED1 << BRT_MODE_SHFT) | 56 | #define LP8556_COMB1_CONFIG (LP8556_COMBINED1 << BRT_MODE_SHFT) |
| @@ -65,6 +76,7 @@ enum lp855x_chip_id { | |||
| 65 | LP8551, | 76 | LP8551, |
| 66 | LP8552, | 77 | LP8552, |
| 67 | LP8553, | 78 | LP8553, |
| 79 | LP8555, | ||
| 68 | LP8556, | 80 | LP8556, |
| 69 | LP8557, | 81 | LP8557, |
| 70 | }; | 82 | }; |
| @@ -89,6 +101,13 @@ enum lp8553_brighntess_source { | |||
| 89 | LP8553_I2C_ONLY = LP8550_I2C_ONLY, | 101 | LP8553_I2C_ONLY = LP8550_I2C_ONLY, |
| 90 | }; | 102 | }; |
| 91 | 103 | ||
| 104 | enum lp8555_brightness_source { | ||
| 105 | LP8555_PWM_ONLY, | ||
| 106 | LP8555_I2C_ONLY, | ||
| 107 | LP8555_COMBINED1, /* Brightness register with shaped PWM */ | ||
| 108 | LP8555_COMBINED2, /* PWM with shaped brightness register */ | ||
| 109 | }; | ||
| 110 | |||
| 92 | enum lp8556_brightness_source { | 111 | enum lp8556_brightness_source { |
| 93 | LP8556_PWM_ONLY, | 112 | LP8556_PWM_ONLY, |
| 94 | LP8556_COMBINED1, /* pwm + i2c before the shaper block */ | 113 | LP8556_COMBINED1, /* pwm + i2c before the shaper block */ |
diff --git a/include/linux/platform_data/mipi-csis.h b/include/linux/platform_data/mipi-csis.h index bf34e17cee7f..c2fd9024717c 100644 --- a/include/linux/platform_data/mipi-csis.h +++ b/include/linux/platform_data/mipi-csis.h | |||
| @@ -25,13 +25,4 @@ struct s5p_platform_mipi_csis { | |||
| 25 | u8 hs_settle; | 25 | u8 hs_settle; |
| 26 | }; | 26 | }; |
| 27 | 27 | ||
| 28 | /** | ||
| 29 | * s5p_csis_phy_enable - global MIPI-CSI receiver D-PHY control | ||
| 30 | * @id: MIPI-CSIS harware instance index (0...1) | ||
| 31 | * @on: true to enable D-PHY and deassert its reset | ||
| 32 | * false to disable D-PHY | ||
| 33 | * @return: 0 on success, or negative error code on failure | ||
| 34 | */ | ||
| 35 | int s5p_csis_phy_enable(int id, bool on); | ||
| 36 | |||
| 37 | #endif /* __PLAT_SAMSUNG_MIPI_CSIS_H_ */ | 28 | #endif /* __PLAT_SAMSUNG_MIPI_CSIS_H_ */ |
diff --git a/include/linux/platform_data/pinctrl-adi2.h b/include/linux/platform_data/pinctrl-adi2.h new file mode 100644 index 000000000000..8f91300617ec --- /dev/null +++ b/include/linux/platform_data/pinctrl-adi2.h | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | /* | ||
| 2 | * Pinctrl Driver for ADI GPIO2 controller | ||
| 3 | * | ||
| 4 | * Copyright 2007-2013 Analog Devices Inc. | ||
| 5 | * | ||
| 6 | * Licensed under the GPLv2 or later | ||
| 7 | */ | ||
| 8 | |||
| 9 | |||
| 10 | #ifndef PINCTRL_ADI2_H | ||
| 11 | #define PINCTRL_ADI2_H | ||
| 12 | |||
| 13 | #include <linux/io.h> | ||
| 14 | #include <linux/platform_device.h> | ||
| 15 | |||
| 16 | /** | ||
| 17 | * struct adi_pinctrl_gpio_platform_data - Pinctrl gpio platform data | ||
| 18 | * for ADI GPIO2 device. | ||
| 19 | * | ||
| 20 | * @port_gpio_base: Optional global GPIO index of the GPIO bank. | ||
| 21 | * 0 means driver decides. | ||
| 22 | * @port_pin_base: Pin index of the pin controller device. | ||
| 23 | * @port_width: PIN number of the GPIO bank device | ||
| 24 | * @pint_id: GPIO PINT device id that this GPIO bank should map to. | ||
| 25 | * @pint_assign: The 32-bit GPIO PINT registers can be divided into 2 parts. A | ||
| 26 | * GPIO bank can be mapped into either low 16 bits[0] or high 16 | ||
| 27 | * bits[1] of each PINT register. | ||
| 28 | * @pint_map: GIOP bank mapping code in PINT device | ||
| 29 | */ | ||
| 30 | struct adi_pinctrl_gpio_platform_data { | ||
| 31 | unsigned int port_gpio_base; | ||
| 32 | unsigned int port_pin_base; | ||
| 33 | unsigned int port_width; | ||
| 34 | u8 pinctrl_id; | ||
| 35 | u8 pint_id; | ||
| 36 | bool pint_assign; | ||
| 37 | u8 pint_map; | ||
| 38 | }; | ||
| 39 | |||
| 40 | #endif | ||
diff --git a/include/linux/platform_data/pinctrl-single.h b/include/linux/platform_data/pinctrl-single.h new file mode 100644 index 000000000000..72eacda9b360 --- /dev/null +++ b/include/linux/platform_data/pinctrl-single.h | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | /** | ||
| 2 | * irq: optional wake-up interrupt | ||
| 3 | * rearm: optional soc specific rearm function | ||
| 4 | * | ||
| 5 | * Note that the irq and rearm setup should come from device | ||
| 6 | * tree except for omap where there are still some dependencies | ||
| 7 | * to the legacy PRM code. | ||
| 8 | */ | ||
| 9 | struct pcs_pdata { | ||
| 10 | int irq; | ||
| 11 | void (*rearm)(void); | ||
| 12 | }; | ||
diff --git a/include/linux/platform_data/usb-ehci-s5p.h b/include/linux/platform_data/usb-ehci-s5p.h deleted file mode 100644 index 5f28cae18582..000000000000 --- a/include/linux/platform_data/usb-ehci-s5p.h +++ /dev/null | |||
| @@ -1,21 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2011 Samsung Electronics Co.Ltd | ||
| 3 | * Author: Joonyoung Shim <jy0922.shim@samsung.com> | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License as published by the | ||
| 7 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 8 | * option) any later version. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __PLAT_SAMSUNG_EHCI_H | ||
| 12 | #define __PLAT_SAMSUNG_EHCI_H __FILE__ | ||
| 13 | |||
| 14 | struct s5p_ehci_platdata { | ||
| 15 | int (*phy_init)(struct platform_device *pdev, int type); | ||
| 16 | int (*phy_exit)(struct platform_device *pdev, int type); | ||
| 17 | }; | ||
| 18 | |||
| 19 | extern void s5p_ehci_set_platdata(struct s5p_ehci_platdata *pd); | ||
| 20 | |||
| 21 | #endif /* __PLAT_SAMSUNG_EHCI_H */ | ||
diff --git a/include/linux/platform_data/usb-ohci-exynos.h b/include/linux/platform_data/usb-ohci-exynos.h deleted file mode 100644 index c256c595be5e..000000000000 --- a/include/linux/platform_data/usb-ohci-exynos.h +++ /dev/null | |||
| @@ -1,21 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2011 Samsung Electronics Co.Ltd | ||
| 3 | * http://www.samsung.com/ | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License as published by the | ||
| 7 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 8 | * option) any later version. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __MACH_EXYNOS_OHCI_H | ||
| 12 | #define __MACH_EXYNOS_OHCI_H | ||
| 13 | |||
| 14 | struct exynos4_ohci_platdata { | ||
| 15 | int (*phy_init)(struct platform_device *pdev, int type); | ||
| 16 | int (*phy_exit)(struct platform_device *pdev, int type); | ||
| 17 | }; | ||
| 18 | |||
| 19 | extern void exynos4_ohci_set_platdata(struct exynos4_ohci_platdata *pd); | ||
| 20 | |||
| 21 | #endif /* __MACH_EXYNOS_OHCI_H */ | ||
diff --git a/include/linux/platform_data/usb-rcar-gen2-phy.h b/include/linux/platform_data/usb-rcar-gen2-phy.h new file mode 100644 index 000000000000..dd3ba46c0d90 --- /dev/null +++ b/include/linux/platform_data/usb-rcar-gen2-phy.h | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2013 Renesas Solutions Corp. | ||
| 3 | * Copyright (C) 2013 Cogent Embedded, Inc. | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License version 2 as | ||
| 7 | * published by the Free Software Foundation. | ||
| 8 | */ | ||
| 9 | |||
| 10 | #ifndef __USB_RCAR_GEN2_PHY_H | ||
| 11 | #define __USB_RCAR_GEN2_PHY_H | ||
| 12 | |||
| 13 | #include <linux/types.h> | ||
| 14 | |||
| 15 | struct rcar_gen2_phy_platform_data { | ||
| 16 | /* USB channel 0 configuration */ | ||
| 17 | bool chan0_pci:1; /* true: PCI USB host 0, false: USBHS */ | ||
| 18 | /* USB channel 2 configuration */ | ||
| 19 | bool chan2_pci:1; /* true: PCI USB host 2, false: USBSS */ | ||
| 20 | }; | ||
| 21 | |||
| 22 | #endif | ||
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index ce8e4ffd78c7..16f6654082dd 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
| @@ -178,6 +178,7 @@ struct platform_driver { | |||
| 178 | int (*resume)(struct platform_device *); | 178 | int (*resume)(struct platform_device *); |
| 179 | struct device_driver driver; | 179 | struct device_driver driver; |
| 180 | const struct platform_device_id *id_table; | 180 | const struct platform_device_id *id_table; |
| 181 | bool prevent_deferred_probe; | ||
| 181 | }; | 182 | }; |
| 182 | 183 | ||
| 183 | #define to_platform_driver(drv) (container_of((drv), struct platform_driver, \ | 184 | #define to_platform_driver(drv) (container_of((drv), struct platform_driver, \ |
diff --git a/include/linux/preempt.h b/include/linux/preempt.h index f5d4723cdb3d..a3d9dc8c2c00 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h | |||
| @@ -6,106 +6,95 @@ | |||
| 6 | * preempt_count (used for kernel preemption, interrupt count, etc.) | 6 | * preempt_count (used for kernel preemption, interrupt count, etc.) |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #include <linux/thread_info.h> | ||
| 10 | #include <linux/linkage.h> | 9 | #include <linux/linkage.h> |
| 11 | #include <linux/list.h> | 10 | #include <linux/list.h> |
| 12 | 11 | ||
| 13 | #if defined(CONFIG_DEBUG_PREEMPT) || defined(CONFIG_PREEMPT_TRACER) | 12 | /* |
| 14 | extern void add_preempt_count(int val); | 13 | * We use the MSB mostly because its available; see <linux/preempt_mask.h> for |
| 15 | extern void sub_preempt_count(int val); | 14 | * the other bits -- can't include that header due to inclusion hell. |
| 16 | #else | 15 | */ |
| 17 | # define add_preempt_count(val) do { preempt_count() += (val); } while (0) | 16 | #define PREEMPT_NEED_RESCHED 0x80000000 |
| 18 | # define sub_preempt_count(val) do { preempt_count() -= (val); } while (0) | ||
| 19 | #endif | ||
| 20 | |||
| 21 | #define inc_preempt_count() add_preempt_count(1) | ||
| 22 | #define dec_preempt_count() sub_preempt_count(1) | ||
| 23 | |||
| 24 | #define preempt_count() (current_thread_info()->preempt_count) | ||
| 25 | |||
| 26 | #ifdef CONFIG_PREEMPT | ||
| 27 | |||
| 28 | asmlinkage void preempt_schedule(void); | ||
| 29 | |||
| 30 | #define preempt_check_resched() \ | ||
| 31 | do { \ | ||
| 32 | if (unlikely(test_thread_flag(TIF_NEED_RESCHED))) \ | ||
| 33 | preempt_schedule(); \ | ||
| 34 | } while (0) | ||
| 35 | |||
| 36 | #ifdef CONFIG_CONTEXT_TRACKING | ||
| 37 | 17 | ||
| 38 | void preempt_schedule_context(void); | 18 | #include <asm/preempt.h> |
| 39 | 19 | ||
| 40 | #define preempt_check_resched_context() \ | 20 | #if defined(CONFIG_DEBUG_PREEMPT) || defined(CONFIG_PREEMPT_TRACER) |
| 41 | do { \ | 21 | extern void preempt_count_add(int val); |
| 42 | if (unlikely(test_thread_flag(TIF_NEED_RESCHED))) \ | 22 | extern void preempt_count_sub(int val); |
| 43 | preempt_schedule_context(); \ | 23 | #define preempt_count_dec_and_test() ({ preempt_count_sub(1); should_resched(); }) |
| 44 | } while (0) | ||
| 45 | #else | 24 | #else |
| 25 | #define preempt_count_add(val) __preempt_count_add(val) | ||
| 26 | #define preempt_count_sub(val) __preempt_count_sub(val) | ||
| 27 | #define preempt_count_dec_and_test() __preempt_count_dec_and_test() | ||
| 28 | #endif | ||
| 46 | 29 | ||
| 47 | #define preempt_check_resched_context() preempt_check_resched() | 30 | #define __preempt_count_inc() __preempt_count_add(1) |
| 48 | 31 | #define __preempt_count_dec() __preempt_count_sub(1) | |
| 49 | #endif /* CONFIG_CONTEXT_TRACKING */ | ||
| 50 | |||
| 51 | #else /* !CONFIG_PREEMPT */ | ||
| 52 | |||
| 53 | #define preempt_check_resched() do { } while (0) | ||
| 54 | #define preempt_check_resched_context() do { } while (0) | ||
| 55 | |||
| 56 | #endif /* CONFIG_PREEMPT */ | ||
| 57 | 32 | ||
| 33 | #define preempt_count_inc() preempt_count_add(1) | ||
| 34 | #define preempt_count_dec() preempt_count_sub(1) | ||
| 58 | 35 | ||
| 59 | #ifdef CONFIG_PREEMPT_COUNT | 36 | #ifdef CONFIG_PREEMPT_COUNT |
| 60 | 37 | ||
| 61 | #define preempt_disable() \ | 38 | #define preempt_disable() \ |
| 62 | do { \ | 39 | do { \ |
| 63 | inc_preempt_count(); \ | 40 | preempt_count_inc(); \ |
| 64 | barrier(); \ | 41 | barrier(); \ |
| 65 | } while (0) | 42 | } while (0) |
| 66 | 43 | ||
| 67 | #define sched_preempt_enable_no_resched() \ | 44 | #define sched_preempt_enable_no_resched() \ |
| 68 | do { \ | 45 | do { \ |
| 69 | barrier(); \ | 46 | barrier(); \ |
| 70 | dec_preempt_count(); \ | 47 | preempt_count_dec(); \ |
| 71 | } while (0) | 48 | } while (0) |
| 72 | 49 | ||
| 73 | #define preempt_enable_no_resched() sched_preempt_enable_no_resched() | 50 | #define preempt_enable_no_resched() sched_preempt_enable_no_resched() |
| 74 | 51 | ||
| 52 | #ifdef CONFIG_PREEMPT | ||
| 75 | #define preempt_enable() \ | 53 | #define preempt_enable() \ |
| 76 | do { \ | 54 | do { \ |
| 77 | preempt_enable_no_resched(); \ | ||
| 78 | barrier(); \ | 55 | barrier(); \ |
| 79 | preempt_check_resched(); \ | 56 | if (unlikely(preempt_count_dec_and_test())) \ |
| 57 | __preempt_schedule(); \ | ||
| 58 | } while (0) | ||
| 59 | |||
| 60 | #define preempt_check_resched() \ | ||
| 61 | do { \ | ||
| 62 | if (should_resched()) \ | ||
| 63 | __preempt_schedule(); \ | ||
| 80 | } while (0) | 64 | } while (0) |
| 81 | 65 | ||
| 82 | /* For debugging and tracer internals only! */ | 66 | #else |
| 83 | #define add_preempt_count_notrace(val) \ | 67 | #define preempt_enable() preempt_enable_no_resched() |
| 84 | do { preempt_count() += (val); } while (0) | 68 | #define preempt_check_resched() do { } while (0) |
| 85 | #define sub_preempt_count_notrace(val) \ | 69 | #endif |
| 86 | do { preempt_count() -= (val); } while (0) | ||
| 87 | #define inc_preempt_count_notrace() add_preempt_count_notrace(1) | ||
| 88 | #define dec_preempt_count_notrace() sub_preempt_count_notrace(1) | ||
| 89 | 70 | ||
| 90 | #define preempt_disable_notrace() \ | 71 | #define preempt_disable_notrace() \ |
| 91 | do { \ | 72 | do { \ |
| 92 | inc_preempt_count_notrace(); \ | 73 | __preempt_count_inc(); \ |
| 93 | barrier(); \ | 74 | barrier(); \ |
| 94 | } while (0) | 75 | } while (0) |
| 95 | 76 | ||
| 96 | #define preempt_enable_no_resched_notrace() \ | 77 | #define preempt_enable_no_resched_notrace() \ |
| 97 | do { \ | 78 | do { \ |
| 98 | barrier(); \ | 79 | barrier(); \ |
| 99 | dec_preempt_count_notrace(); \ | 80 | __preempt_count_dec(); \ |
| 100 | } while (0) | 81 | } while (0) |
| 101 | 82 | ||
| 102 | /* preempt_check_resched is OK to trace */ | 83 | #ifdef CONFIG_PREEMPT |
| 84 | |||
| 85 | #ifndef CONFIG_CONTEXT_TRACKING | ||
| 86 | #define __preempt_schedule_context() __preempt_schedule() | ||
| 87 | #endif | ||
| 88 | |||
| 103 | #define preempt_enable_notrace() \ | 89 | #define preempt_enable_notrace() \ |
| 104 | do { \ | 90 | do { \ |
| 105 | preempt_enable_no_resched_notrace(); \ | ||
| 106 | barrier(); \ | 91 | barrier(); \ |
| 107 | preempt_check_resched_context(); \ | 92 | if (unlikely(__preempt_count_dec_and_test())) \ |
| 93 | __preempt_schedule_context(); \ | ||
| 108 | } while (0) | 94 | } while (0) |
| 95 | #else | ||
| 96 | #define preempt_enable_notrace() preempt_enable_no_resched_notrace() | ||
| 97 | #endif | ||
| 109 | 98 | ||
| 110 | #else /* !CONFIG_PREEMPT_COUNT */ | 99 | #else /* !CONFIG_PREEMPT_COUNT */ |
| 111 | 100 | ||
| @@ -115,10 +104,11 @@ do { \ | |||
| 115 | * that can cause faults and scheduling migrate into our preempt-protected | 104 | * that can cause faults and scheduling migrate into our preempt-protected |
| 116 | * region. | 105 | * region. |
| 117 | */ | 106 | */ |
| 118 | #define preempt_disable() barrier() | 107 | #define preempt_disable() barrier() |
| 119 | #define sched_preempt_enable_no_resched() barrier() | 108 | #define sched_preempt_enable_no_resched() barrier() |
| 120 | #define preempt_enable_no_resched() barrier() | 109 | #define preempt_enable_no_resched() barrier() |
| 121 | #define preempt_enable() barrier() | 110 | #define preempt_enable() barrier() |
| 111 | #define preempt_check_resched() do { } while (0) | ||
| 122 | 112 | ||
| 123 | #define preempt_disable_notrace() barrier() | 113 | #define preempt_disable_notrace() barrier() |
| 124 | #define preempt_enable_no_resched_notrace() barrier() | 114 | #define preempt_enable_no_resched_notrace() barrier() |
diff --git a/include/linux/printk.h b/include/linux/printk.h index e6131a782481..694925837a16 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h | |||
| @@ -233,6 +233,8 @@ extern asmlinkage void dump_stack(void) __cold; | |||
| 233 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | 233 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
| 234 | #endif | 234 | #endif |
| 235 | 235 | ||
| 236 | #include <linux/dynamic_debug.h> | ||
| 237 | |||
| 236 | /* If you are writing a driver, please use dev_dbg instead */ | 238 | /* If you are writing a driver, please use dev_dbg instead */ |
| 237 | #if defined(CONFIG_DYNAMIC_DEBUG) | 239 | #if defined(CONFIG_DYNAMIC_DEBUG) |
| 238 | /* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */ | 240 | /* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */ |
| @@ -343,7 +345,19 @@ extern asmlinkage void dump_stack(void) __cold; | |||
| 343 | #endif | 345 | #endif |
| 344 | 346 | ||
| 345 | /* If you are writing a driver, please use dev_dbg instead */ | 347 | /* If you are writing a driver, please use dev_dbg instead */ |
| 346 | #if defined(DEBUG) | 348 | #if defined(CONFIG_DYNAMIC_DEBUG) |
| 349 | /* descriptor check is first to prevent flooding with "callbacks suppressed" */ | ||
| 350 | #define pr_debug_ratelimited(fmt, ...) \ | ||
| 351 | do { \ | ||
| 352 | static DEFINE_RATELIMIT_STATE(_rs, \ | ||
| 353 | DEFAULT_RATELIMIT_INTERVAL, \ | ||
| 354 | DEFAULT_RATELIMIT_BURST); \ | ||
| 355 | DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ | ||
| 356 | if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT) && \ | ||
| 357 | __ratelimit(&_rs)) \ | ||
| 358 | __dynamic_pr_debug(&descriptor, fmt, ##__VA_ARGS__); \ | ||
| 359 | } while (0) | ||
| 360 | #elif defined(DEBUG) | ||
| 347 | #define pr_debug_ratelimited(fmt, ...) \ | 361 | #define pr_debug_ratelimited(fmt, ...) \ |
| 348 | printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | 362 | printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
| 349 | #else | 363 | #else |
diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h index aa870a4ddf54..57e75ae9910f 100644 --- a/include/linux/rbtree.h +++ b/include/linux/rbtree.h | |||
| @@ -85,6 +85,11 @@ static inline void rb_link_node(struct rb_node * node, struct rb_node * parent, | |||
| 85 | *rb_link = node; | 85 | *rb_link = node; |
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | #define rb_entry_safe(ptr, type, member) \ | ||
| 89 | ({ typeof(ptr) ____ptr = (ptr); \ | ||
| 90 | ____ptr ? rb_entry(____ptr, type, member) : NULL; \ | ||
| 91 | }) | ||
| 92 | |||
| 88 | /** | 93 | /** |
| 89 | * rbtree_postorder_for_each_entry_safe - iterate over rb_root in post order of | 94 | * rbtree_postorder_for_each_entry_safe - iterate over rb_root in post order of |
| 90 | * given type safe against removal of rb_node entry | 95 | * given type safe against removal of rb_node entry |
| @@ -95,12 +100,9 @@ static inline void rb_link_node(struct rb_node * node, struct rb_node * parent, | |||
| 95 | * @field: the name of the rb_node field within 'type'. | 100 | * @field: the name of the rb_node field within 'type'. |
| 96 | */ | 101 | */ |
| 97 | #define rbtree_postorder_for_each_entry_safe(pos, n, root, field) \ | 102 | #define rbtree_postorder_for_each_entry_safe(pos, n, root, field) \ |
| 98 | for (pos = rb_entry(rb_first_postorder(root), typeof(*pos), field),\ | 103 | for (pos = rb_entry_safe(rb_first_postorder(root), typeof(*pos), field); \ |
| 99 | n = rb_entry(rb_next_postorder(&pos->field), \ | 104 | pos && ({ n = rb_entry_safe(rb_next_postorder(&pos->field), \ |
| 100 | typeof(*pos), field); \ | 105 | typeof(*pos), field); 1; }); \ |
| 101 | &pos->field; \ | 106 | pos = n) |
| 102 | pos = n, \ | ||
| 103 | n = rb_entry(rb_next_postorder(&pos->field), \ | ||
| 104 | typeof(*pos), field)) | ||
| 105 | 107 | ||
| 106 | #endif /* _LINUX_RBTREE_H */ | 108 | #endif /* _LINUX_RBTREE_H */ |
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index 4106721c4e5e..45a0a9e81478 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
| @@ -19,6 +19,21 @@ | |||
| 19 | */ | 19 | */ |
| 20 | 20 | ||
| 21 | /* | 21 | /* |
| 22 | * INIT_LIST_HEAD_RCU - Initialize a list_head visible to RCU readers | ||
| 23 | * @list: list to be initialized | ||
| 24 | * | ||
| 25 | * You should instead use INIT_LIST_HEAD() for normal initialization and | ||
| 26 | * cleanup tasks, when readers have no access to the list being initialized. | ||
| 27 | * However, if the list being initialized is visible to readers, you | ||
| 28 | * need to keep the compiler from being too mischievous. | ||
| 29 | */ | ||
| 30 | static inline void INIT_LIST_HEAD_RCU(struct list_head *list) | ||
| 31 | { | ||
| 32 | ACCESS_ONCE(list->next) = list; | ||
| 33 | ACCESS_ONCE(list->prev) = list; | ||
| 34 | } | ||
| 35 | |||
| 36 | /* | ||
| 22 | * return the ->next pointer of a list_head in an rcu safe | 37 | * return the ->next pointer of a list_head in an rcu safe |
| 23 | * way, we must not access it directly | 38 | * way, we must not access it directly |
| 24 | */ | 39 | */ |
| @@ -191,9 +206,13 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
| 191 | if (list_empty(list)) | 206 | if (list_empty(list)) |
| 192 | return; | 207 | return; |
| 193 | 208 | ||
| 194 | /* "first" and "last" tracking list, so initialize it. */ | 209 | /* |
| 210 | * "first" and "last" tracking list, so initialize it. RCU readers | ||
| 211 | * have access to this list, so we must use INIT_LIST_HEAD_RCU() | ||
| 212 | * instead of INIT_LIST_HEAD(). | ||
| 213 | */ | ||
| 195 | 214 | ||
| 196 | INIT_LIST_HEAD(list); | 215 | INIT_LIST_HEAD_RCU(list); |
| 197 | 216 | ||
| 198 | /* | 217 | /* |
| 199 | * At this point, the list body still points to the source list. | 218 | * At this point, the list body still points to the source list. |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index f1f1bc39346b..39cbb889e20d 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
| @@ -261,6 +261,10 @@ static inline void rcu_user_hooks_switch(struct task_struct *prev, | |||
| 261 | rcu_irq_exit(); \ | 261 | rcu_irq_exit(); \ |
| 262 | } while (0) | 262 | } while (0) |
| 263 | 263 | ||
| 264 | #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) | ||
| 265 | extern bool __rcu_is_watching(void); | ||
| 266 | #endif /* #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) */ | ||
| 267 | |||
| 264 | /* | 268 | /* |
| 265 | * Infrastructure to implement the synchronize_() primitives in | 269 | * Infrastructure to implement the synchronize_() primitives in |
| 266 | * TREE_RCU and rcu_barrier_() primitives in TINY_RCU. | 270 | * TREE_RCU and rcu_barrier_() primitives in TINY_RCU. |
| @@ -297,10 +301,6 @@ static inline void destroy_rcu_head_on_stack(struct rcu_head *head) | |||
| 297 | } | 301 | } |
| 298 | #endif /* #else !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ | 302 | #endif /* #else !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ |
| 299 | 303 | ||
| 300 | #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_SMP) | ||
| 301 | extern int rcu_is_cpu_idle(void); | ||
| 302 | #endif /* #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_SMP) */ | ||
| 303 | |||
| 304 | #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PROVE_RCU) | 304 | #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PROVE_RCU) |
| 305 | bool rcu_lockdep_current_cpu_online(void); | 305 | bool rcu_lockdep_current_cpu_online(void); |
| 306 | #else /* #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PROVE_RCU) */ | 306 | #else /* #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PROVE_RCU) */ |
| @@ -351,7 +351,7 @@ static inline int rcu_read_lock_held(void) | |||
| 351 | { | 351 | { |
| 352 | if (!debug_lockdep_rcu_enabled()) | 352 | if (!debug_lockdep_rcu_enabled()) |
| 353 | return 1; | 353 | return 1; |
| 354 | if (rcu_is_cpu_idle()) | 354 | if (!rcu_is_watching()) |
| 355 | return 0; | 355 | return 0; |
| 356 | if (!rcu_lockdep_current_cpu_online()) | 356 | if (!rcu_lockdep_current_cpu_online()) |
| 357 | return 0; | 357 | return 0; |
| @@ -402,7 +402,7 @@ static inline int rcu_read_lock_sched_held(void) | |||
| 402 | 402 | ||
| 403 | if (!debug_lockdep_rcu_enabled()) | 403 | if (!debug_lockdep_rcu_enabled()) |
| 404 | return 1; | 404 | return 1; |
| 405 | if (rcu_is_cpu_idle()) | 405 | if (!rcu_is_watching()) |
| 406 | return 0; | 406 | return 0; |
| 407 | if (!rcu_lockdep_current_cpu_online()) | 407 | if (!rcu_lockdep_current_cpu_online()) |
| 408 | return 0; | 408 | return 0; |
| @@ -771,7 +771,7 @@ static inline void rcu_read_lock(void) | |||
| 771 | __rcu_read_lock(); | 771 | __rcu_read_lock(); |
| 772 | __acquire(RCU); | 772 | __acquire(RCU); |
| 773 | rcu_lock_acquire(&rcu_lock_map); | 773 | rcu_lock_acquire(&rcu_lock_map); |
| 774 | rcu_lockdep_assert(!rcu_is_cpu_idle(), | 774 | rcu_lockdep_assert(rcu_is_watching(), |
| 775 | "rcu_read_lock() used illegally while idle"); | 775 | "rcu_read_lock() used illegally while idle"); |
| 776 | } | 776 | } |
| 777 | 777 | ||
| @@ -792,7 +792,7 @@ static inline void rcu_read_lock(void) | |||
| 792 | */ | 792 | */ |
| 793 | static inline void rcu_read_unlock(void) | 793 | static inline void rcu_read_unlock(void) |
| 794 | { | 794 | { |
| 795 | rcu_lockdep_assert(!rcu_is_cpu_idle(), | 795 | rcu_lockdep_assert(rcu_is_watching(), |
| 796 | "rcu_read_unlock() used illegally while idle"); | 796 | "rcu_read_unlock() used illegally while idle"); |
| 797 | rcu_lock_release(&rcu_lock_map); | 797 | rcu_lock_release(&rcu_lock_map); |
| 798 | __release(RCU); | 798 | __release(RCU); |
| @@ -821,7 +821,7 @@ static inline void rcu_read_lock_bh(void) | |||
| 821 | local_bh_disable(); | 821 | local_bh_disable(); |
| 822 | __acquire(RCU_BH); | 822 | __acquire(RCU_BH); |
| 823 | rcu_lock_acquire(&rcu_bh_lock_map); | 823 | rcu_lock_acquire(&rcu_bh_lock_map); |
| 824 | rcu_lockdep_assert(!rcu_is_cpu_idle(), | 824 | rcu_lockdep_assert(rcu_is_watching(), |
| 825 | "rcu_read_lock_bh() used illegally while idle"); | 825 | "rcu_read_lock_bh() used illegally while idle"); |
| 826 | } | 826 | } |
| 827 | 827 | ||
| @@ -832,7 +832,7 @@ static inline void rcu_read_lock_bh(void) | |||
| 832 | */ | 832 | */ |
| 833 | static inline void rcu_read_unlock_bh(void) | 833 | static inline void rcu_read_unlock_bh(void) |
| 834 | { | 834 | { |
| 835 | rcu_lockdep_assert(!rcu_is_cpu_idle(), | 835 | rcu_lockdep_assert(rcu_is_watching(), |
| 836 | "rcu_read_unlock_bh() used illegally while idle"); | 836 | "rcu_read_unlock_bh() used illegally while idle"); |
| 837 | rcu_lock_release(&rcu_bh_lock_map); | 837 | rcu_lock_release(&rcu_bh_lock_map); |
| 838 | __release(RCU_BH); | 838 | __release(RCU_BH); |
| @@ -857,7 +857,7 @@ static inline void rcu_read_lock_sched(void) | |||
| 857 | preempt_disable(); | 857 | preempt_disable(); |
| 858 | __acquire(RCU_SCHED); | 858 | __acquire(RCU_SCHED); |
| 859 | rcu_lock_acquire(&rcu_sched_lock_map); | 859 | rcu_lock_acquire(&rcu_sched_lock_map); |
| 860 | rcu_lockdep_assert(!rcu_is_cpu_idle(), | 860 | rcu_lockdep_assert(rcu_is_watching(), |
| 861 | "rcu_read_lock_sched() used illegally while idle"); | 861 | "rcu_read_lock_sched() used illegally while idle"); |
| 862 | } | 862 | } |
| 863 | 863 | ||
| @@ -875,7 +875,7 @@ static inline notrace void rcu_read_lock_sched_notrace(void) | |||
| 875 | */ | 875 | */ |
| 876 | static inline void rcu_read_unlock_sched(void) | 876 | static inline void rcu_read_unlock_sched(void) |
| 877 | { | 877 | { |
| 878 | rcu_lockdep_assert(!rcu_is_cpu_idle(), | 878 | rcu_lockdep_assert(rcu_is_watching(), |
| 879 | "rcu_read_unlock_sched() used illegally while idle"); | 879 | "rcu_read_unlock_sched() used illegally while idle"); |
| 880 | rcu_lock_release(&rcu_sched_lock_map); | 880 | rcu_lock_release(&rcu_sched_lock_map); |
| 881 | __release(RCU_SCHED); | 881 | __release(RCU_SCHED); |
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index e31005ee339e..09ebcbe9fd78 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h | |||
| @@ -132,4 +132,21 @@ static inline void rcu_scheduler_starting(void) | |||
| 132 | } | 132 | } |
| 133 | #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | 133 | #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ |
| 134 | 134 | ||
| 135 | #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) | ||
| 136 | |||
| 137 | static inline bool rcu_is_watching(void) | ||
| 138 | { | ||
| 139 | return __rcu_is_watching(); | ||
| 140 | } | ||
| 141 | |||
| 142 | #else /* defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) */ | ||
| 143 | |||
| 144 | static inline bool rcu_is_watching(void) | ||
| 145 | { | ||
| 146 | return true; | ||
| 147 | } | ||
| 148 | |||
| 149 | |||
| 150 | #endif /* #else defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) */ | ||
| 151 | |||
| 135 | #endif /* __LINUX_RCUTINY_H */ | 152 | #endif /* __LINUX_RCUTINY_H */ |
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 226169d1bd2b..4b9c81548742 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
| @@ -90,4 +90,6 @@ extern void exit_rcu(void); | |||
| 90 | extern void rcu_scheduler_starting(void); | 90 | extern void rcu_scheduler_starting(void); |
| 91 | extern int rcu_scheduler_active __read_mostly; | 91 | extern int rcu_scheduler_active __read_mostly; |
| 92 | 92 | ||
| 93 | extern bool rcu_is_watching(void); | ||
| 94 | |||
| 93 | #endif /* __LINUX_RCUTREE_H */ | 95 | #endif /* __LINUX_RCUTREE_H */ |
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index a10380bfbeac..e55907804d39 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h | |||
| @@ -23,6 +23,7 @@ struct device; | |||
| 23 | struct i2c_client; | 23 | struct i2c_client; |
| 24 | struct irq_domain; | 24 | struct irq_domain; |
| 25 | struct spi_device; | 25 | struct spi_device; |
| 26 | struct spmi_device; | ||
| 26 | struct regmap; | 27 | struct regmap; |
| 27 | struct regmap_range_cfg; | 28 | struct regmap_range_cfg; |
| 28 | struct regmap_field; | 29 | struct regmap_field; |
| @@ -70,6 +71,8 @@ struct regmap_range { | |||
| 70 | unsigned int range_max; | 71 | unsigned int range_max; |
| 71 | }; | 72 | }; |
| 72 | 73 | ||
| 74 | #define regmap_reg_range(low, high) { .range_min = low, .range_max = high, } | ||
| 75 | |||
| 73 | /* | 76 | /* |
| 74 | * A table of ranges including some yes ranges and some no ranges. | 77 | * A table of ranges including some yes ranges and some no ranges. |
| 75 | * If a register belongs to a no_range, the corresponding check function | 78 | * If a register belongs to a no_range, the corresponding check function |
| @@ -318,6 +321,8 @@ struct regmap *regmap_init_i2c(struct i2c_client *i2c, | |||
| 318 | const struct regmap_config *config); | 321 | const struct regmap_config *config); |
| 319 | struct regmap *regmap_init_spi(struct spi_device *dev, | 322 | struct regmap *regmap_init_spi(struct spi_device *dev, |
| 320 | const struct regmap_config *config); | 323 | const struct regmap_config *config); |
| 324 | struct regmap *regmap_init_spmi(struct spmi_device *dev, | ||
| 325 | const struct regmap_config *config); | ||
| 321 | struct regmap *regmap_init_mmio_clk(struct device *dev, const char *clk_id, | 326 | struct regmap *regmap_init_mmio_clk(struct device *dev, const char *clk_id, |
| 322 | void __iomem *regs, | 327 | void __iomem *regs, |
| 323 | const struct regmap_config *config); | 328 | const struct regmap_config *config); |
| @@ -330,6 +335,8 @@ struct regmap *devm_regmap_init_i2c(struct i2c_client *i2c, | |||
| 330 | const struct regmap_config *config); | 335 | const struct regmap_config *config); |
| 331 | struct regmap *devm_regmap_init_spi(struct spi_device *dev, | 336 | struct regmap *devm_regmap_init_spi(struct spi_device *dev, |
| 332 | const struct regmap_config *config); | 337 | const struct regmap_config *config); |
| 338 | struct regmap *devm_regmap_init_spmi(struct spmi_device *dev, | ||
| 339 | const struct regmap_config *config); | ||
| 333 | struct regmap *devm_regmap_init_mmio_clk(struct device *dev, const char *clk_id, | 340 | struct regmap *devm_regmap_init_mmio_clk(struct device *dev, const char *clk_id, |
| 334 | void __iomem *regs, | 341 | void __iomem *regs, |
| 335 | const struct regmap_config *config); | 342 | const struct regmap_config *config); |
| @@ -374,10 +381,13 @@ int regmap_reinit_cache(struct regmap *map, | |||
| 374 | const struct regmap_config *config); | 381 | const struct regmap_config *config); |
| 375 | struct regmap *dev_get_regmap(struct device *dev, const char *name); | 382 | struct regmap *dev_get_regmap(struct device *dev, const char *name); |
| 376 | int regmap_write(struct regmap *map, unsigned int reg, unsigned int val); | 383 | int regmap_write(struct regmap *map, unsigned int reg, unsigned int val); |
| 384 | int regmap_write_async(struct regmap *map, unsigned int reg, unsigned int val); | ||
| 377 | int regmap_raw_write(struct regmap *map, unsigned int reg, | 385 | int regmap_raw_write(struct regmap *map, unsigned int reg, |
| 378 | const void *val, size_t val_len); | 386 | const void *val, size_t val_len); |
| 379 | int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val, | 387 | int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val, |
| 380 | size_t val_count); | 388 | size_t val_count); |
| 389 | int regmap_multi_reg_write(struct regmap *map, struct reg_default *regs, | ||
| 390 | int num_regs); | ||
| 381 | int regmap_raw_write_async(struct regmap *map, unsigned int reg, | 391 | int regmap_raw_write_async(struct regmap *map, unsigned int reg, |
| 382 | const void *val, size_t val_len); | 392 | const void *val, size_t val_len); |
| 383 | int regmap_read(struct regmap *map, unsigned int reg, unsigned int *val); | 393 | int regmap_read(struct regmap *map, unsigned int reg, unsigned int *val); |
| @@ -387,9 +397,14 @@ int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val, | |||
| 387 | size_t val_count); | 397 | size_t val_count); |
| 388 | int regmap_update_bits(struct regmap *map, unsigned int reg, | 398 | int regmap_update_bits(struct regmap *map, unsigned int reg, |
| 389 | unsigned int mask, unsigned int val); | 399 | unsigned int mask, unsigned int val); |
| 400 | int regmap_update_bits_async(struct regmap *map, unsigned int reg, | ||
| 401 | unsigned int mask, unsigned int val); | ||
| 390 | int regmap_update_bits_check(struct regmap *map, unsigned int reg, | 402 | int regmap_update_bits_check(struct regmap *map, unsigned int reg, |
| 391 | unsigned int mask, unsigned int val, | 403 | unsigned int mask, unsigned int val, |
| 392 | bool *change); | 404 | bool *change); |
| 405 | int regmap_update_bits_check_async(struct regmap *map, unsigned int reg, | ||
| 406 | unsigned int mask, unsigned int val, | ||
| 407 | bool *change); | ||
| 393 | int regmap_get_val_bytes(struct regmap *map); | 408 | int regmap_get_val_bytes(struct regmap *map); |
| 394 | int regmap_async_complete(struct regmap *map); | 409 | int regmap_async_complete(struct regmap *map); |
| 395 | bool regmap_can_raw_write(struct regmap *map); | 410 | bool regmap_can_raw_write(struct regmap *map); |
| @@ -425,11 +440,15 @@ bool regmap_reg_in_ranges(unsigned int reg, | |||
| 425 | * @reg: Offset of the register within the regmap bank | 440 | * @reg: Offset of the register within the regmap bank |
| 426 | * @lsb: lsb of the register field. | 441 | * @lsb: lsb of the register field. |
| 427 | * @reg: msb of the register field. | 442 | * @reg: msb of the register field. |
| 443 | * @id_size: port size if it has some ports | ||
| 444 | * @id_offset: address offset for each ports | ||
| 428 | */ | 445 | */ |
| 429 | struct reg_field { | 446 | struct reg_field { |
| 430 | unsigned int reg; | 447 | unsigned int reg; |
| 431 | unsigned int lsb; | 448 | unsigned int lsb; |
| 432 | unsigned int msb; | 449 | unsigned int msb; |
| 450 | unsigned int id_size; | ||
| 451 | unsigned int id_offset; | ||
| 433 | }; | 452 | }; |
| 434 | 453 | ||
| 435 | #define REG_FIELD(_reg, _lsb, _msb) { \ | 454 | #define REG_FIELD(_reg, _lsb, _msb) { \ |
| @@ -448,6 +467,15 @@ void devm_regmap_field_free(struct device *dev, struct regmap_field *field); | |||
| 448 | 467 | ||
| 449 | int regmap_field_read(struct regmap_field *field, unsigned int *val); | 468 | int regmap_field_read(struct regmap_field *field, unsigned int *val); |
| 450 | int regmap_field_write(struct regmap_field *field, unsigned int val); | 469 | int regmap_field_write(struct regmap_field *field, unsigned int val); |
| 470 | int regmap_field_update_bits(struct regmap_field *field, | ||
| 471 | unsigned int mask, unsigned int val); | ||
| 472 | |||
| 473 | int regmap_fields_write(struct regmap_field *field, unsigned int id, | ||
| 474 | unsigned int val); | ||
| 475 | int regmap_fields_read(struct regmap_field *field, unsigned int id, | ||
| 476 | unsigned int *val); | ||
| 477 | int regmap_fields_update_bits(struct regmap_field *field, unsigned int id, | ||
| 478 | unsigned int mask, unsigned int val); | ||
| 451 | 479 | ||
| 452 | /** | 480 | /** |
| 453 | * Description of an IRQ for the generic regmap irq_chip. | 481 | * Description of an IRQ for the generic regmap irq_chip. |
| @@ -527,6 +555,13 @@ static inline int regmap_write(struct regmap *map, unsigned int reg, | |||
| 527 | return -EINVAL; | 555 | return -EINVAL; |
| 528 | } | 556 | } |
| 529 | 557 | ||
| 558 | static inline int regmap_write_async(struct regmap *map, unsigned int reg, | ||
| 559 | unsigned int val) | ||
| 560 | { | ||
| 561 | WARN_ONCE(1, "regmap API is disabled"); | ||
| 562 | return -EINVAL; | ||
| 563 | } | ||
| 564 | |||
| 530 | static inline int regmap_raw_write(struct regmap *map, unsigned int reg, | 565 | static inline int regmap_raw_write(struct regmap *map, unsigned int reg, |
| 531 | const void *val, size_t val_len) | 566 | const void *val, size_t val_len) |
| 532 | { | 567 | { |
| @@ -576,6 +611,14 @@ static inline int regmap_update_bits(struct regmap *map, unsigned int reg, | |||
| 576 | return -EINVAL; | 611 | return -EINVAL; |
| 577 | } | 612 | } |
| 578 | 613 | ||
| 614 | static inline int regmap_update_bits_async(struct regmap *map, | ||
| 615 | unsigned int reg, | ||
| 616 | unsigned int mask, unsigned int val) | ||
| 617 | { | ||
| 618 | WARN_ONCE(1, "regmap API is disabled"); | ||
| 619 | return -EINVAL; | ||
| 620 | } | ||
| 621 | |||
| 579 | static inline int regmap_update_bits_check(struct regmap *map, | 622 | static inline int regmap_update_bits_check(struct regmap *map, |
| 580 | unsigned int reg, | 623 | unsigned int reg, |
| 581 | unsigned int mask, unsigned int val, | 624 | unsigned int mask, unsigned int val, |
| @@ -585,6 +628,16 @@ static inline int regmap_update_bits_check(struct regmap *map, | |||
| 585 | return -EINVAL; | 628 | return -EINVAL; |
| 586 | } | 629 | } |
| 587 | 630 | ||
| 631 | static inline int regmap_update_bits_check_async(struct regmap *map, | ||
| 632 | unsigned int reg, | ||
| 633 | unsigned int mask, | ||
| 634 | unsigned int val, | ||
| 635 | bool *change) | ||
| 636 | { | ||
| 637 | WARN_ONCE(1, "regmap API is disabled"); | ||
| 638 | return -EINVAL; | ||
| 639 | } | ||
| 640 | |||
| 588 | static inline int regmap_get_val_bytes(struct regmap *map) | 641 | static inline int regmap_get_val_bytes(struct regmap *map) |
| 589 | { | 642 | { |
| 590 | WARN_ONCE(1, "regmap API is disabled"); | 643 | WARN_ONCE(1, "regmap API is disabled"); |
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index 27be915caa96..e530681bea70 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
| @@ -146,6 +146,32 @@ struct regulator *__must_check devm_regulator_get_optional(struct device *dev, | |||
| 146 | void regulator_put(struct regulator *regulator); | 146 | void regulator_put(struct regulator *regulator); |
| 147 | void devm_regulator_put(struct regulator *regulator); | 147 | void devm_regulator_put(struct regulator *regulator); |
| 148 | 148 | ||
| 149 | int regulator_register_supply_alias(struct device *dev, const char *id, | ||
| 150 | struct device *alias_dev, | ||
| 151 | const char *alias_id); | ||
| 152 | void regulator_unregister_supply_alias(struct device *dev, const char *id); | ||
| 153 | |||
| 154 | int regulator_bulk_register_supply_alias(struct device *dev, const char **id, | ||
| 155 | struct device *alias_dev, | ||
| 156 | const char **alias_id, int num_id); | ||
| 157 | void regulator_bulk_unregister_supply_alias(struct device *dev, | ||
| 158 | const char **id, int num_id); | ||
| 159 | |||
| 160 | int devm_regulator_register_supply_alias(struct device *dev, const char *id, | ||
| 161 | struct device *alias_dev, | ||
| 162 | const char *alias_id); | ||
| 163 | void devm_regulator_unregister_supply_alias(struct device *dev, | ||
| 164 | const char *id); | ||
| 165 | |||
| 166 | int devm_regulator_bulk_register_supply_alias(struct device *dev, | ||
| 167 | const char **id, | ||
| 168 | struct device *alias_dev, | ||
| 169 | const char **alias_id, | ||
| 170 | int num_id); | ||
| 171 | void devm_regulator_bulk_unregister_supply_alias(struct device *dev, | ||
| 172 | const char **id, | ||
| 173 | int num_id); | ||
| 174 | |||
| 149 | /* regulator output control and status */ | 175 | /* regulator output control and status */ |
| 150 | int __must_check regulator_enable(struct regulator *regulator); | 176 | int __must_check regulator_enable(struct regulator *regulator); |
| 151 | int regulator_disable(struct regulator *regulator); | 177 | int regulator_disable(struct regulator *regulator); |
| @@ -250,6 +276,59 @@ static inline void devm_regulator_put(struct regulator *regulator) | |||
| 250 | { | 276 | { |
| 251 | } | 277 | } |
| 252 | 278 | ||
| 279 | static inline int regulator_register_supply_alias(struct device *dev, | ||
| 280 | const char *id, | ||
| 281 | struct device *alias_dev, | ||
| 282 | const char *alias_id) | ||
| 283 | { | ||
| 284 | return 0; | ||
| 285 | } | ||
| 286 | |||
| 287 | static inline void regulator_unregister_supply_alias(struct device *dev, | ||
| 288 | const char *id) | ||
| 289 | { | ||
| 290 | } | ||
| 291 | |||
| 292 | static inline int regulator_bulk_register_supply_alias(struct device *dev, | ||
| 293 | const char **id, | ||
| 294 | struct device *alias_dev, | ||
| 295 | const char **alias_id, | ||
| 296 | int num_id) | ||
| 297 | { | ||
| 298 | return 0; | ||
| 299 | } | ||
| 300 | |||
| 301 | static inline void regulator_bulk_unregister_supply_alias(struct device *dev, | ||
| 302 | const char **id, | ||
| 303 | int num_id) | ||
| 304 | { | ||
| 305 | } | ||
| 306 | |||
| 307 | static inline int devm_regulator_register_supply_alias(struct device *dev, | ||
| 308 | const char *id, | ||
| 309 | struct device *alias_dev, | ||
| 310 | const char *alias_id) | ||
| 311 | { | ||
| 312 | return 0; | ||
| 313 | } | ||
| 314 | |||
| 315 | static inline void devm_regulator_unregister_supply_alias(struct device *dev, | ||
| 316 | const char *id) | ||
| 317 | { | ||
| 318 | } | ||
| 319 | |||
| 320 | static inline int devm_regulator_bulk_register_supply_alias( | ||
| 321 | struct device *dev, const char **id, struct device *alias_dev, | ||
| 322 | const char **alias_id, int num_id) | ||
| 323 | { | ||
| 324 | return 0; | ||
| 325 | } | ||
| 326 | |||
| 327 | static inline void devm_regulator_bulk_unregister_supply_alias( | ||
| 328 | struct device *dev, const char **id, int num_id) | ||
| 329 | { | ||
| 330 | } | ||
| 331 | |||
| 253 | static inline int regulator_enable(struct regulator *regulator) | 332 | static inline int regulator_enable(struct regulator *regulator) |
| 254 | { | 333 | { |
| 255 | return 0; | 334 | return 0; |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index 9bdad43ad228..9370e65348a4 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
| @@ -46,19 +46,26 @@ enum regulator_status { | |||
| 46 | * regulator_list_linear_range(). | 46 | * regulator_list_linear_range(). |
| 47 | * | 47 | * |
| 48 | * @min_uV: Lowest voltage in range | 48 | * @min_uV: Lowest voltage in range |
| 49 | * @max_uV: Highest voltage in range | ||
| 50 | * @min_sel: Lowest selector for range | 49 | * @min_sel: Lowest selector for range |
| 51 | * @max_sel: Highest selector for range | 50 | * @max_sel: Highest selector for range |
| 52 | * @uV_step: Step size | 51 | * @uV_step: Step size |
| 53 | */ | 52 | */ |
| 54 | struct regulator_linear_range { | 53 | struct regulator_linear_range { |
| 55 | unsigned int min_uV; | 54 | unsigned int min_uV; |
| 56 | unsigned int max_uV; | ||
| 57 | unsigned int min_sel; | 55 | unsigned int min_sel; |
| 58 | unsigned int max_sel; | 56 | unsigned int max_sel; |
| 59 | unsigned int uV_step; | 57 | unsigned int uV_step; |
| 60 | }; | 58 | }; |
| 61 | 59 | ||
| 60 | /* Initialize struct regulator_linear_range */ | ||
| 61 | #define REGULATOR_LINEAR_RANGE(_min_uV, _min_sel, _max_sel, _step_uV) \ | ||
| 62 | { \ | ||
| 63 | .min_uV = _min_uV, \ | ||
| 64 | .min_sel = _min_sel, \ | ||
| 65 | .max_sel = _max_sel, \ | ||
| 66 | .uV_step = _step_uV, \ | ||
| 67 | } | ||
| 68 | |||
| 62 | /** | 69 | /** |
| 63 | * struct regulator_ops - regulator operations. | 70 | * struct regulator_ops - regulator operations. |
| 64 | * | 71 | * |
| @@ -209,6 +216,7 @@ enum regulator_type { | |||
| 209 | * @min_uV: Voltage given by the lowest selector (if linear mapping) | 216 | * @min_uV: Voltage given by the lowest selector (if linear mapping) |
| 210 | * @uV_step: Voltage increase with each selector (if linear mapping) | 217 | * @uV_step: Voltage increase with each selector (if linear mapping) |
| 211 | * @linear_min_sel: Minimal selector for starting linear mapping | 218 | * @linear_min_sel: Minimal selector for starting linear mapping |
| 219 | * @fixed_uV: Fixed voltage of rails. | ||
| 212 | * @ramp_delay: Time to settle down after voltage change (unit: uV/us) | 220 | * @ramp_delay: Time to settle down after voltage change (unit: uV/us) |
| 213 | * @volt_table: Voltage mapping table (if table based mapping) | 221 | * @volt_table: Voltage mapping table (if table based mapping) |
| 214 | * | 222 | * |
| @@ -241,6 +249,7 @@ struct regulator_desc { | |||
| 241 | unsigned int min_uV; | 249 | unsigned int min_uV; |
| 242 | unsigned int uV_step; | 250 | unsigned int uV_step; |
| 243 | unsigned int linear_min_sel; | 251 | unsigned int linear_min_sel; |
| 252 | int fixed_uV; | ||
| 244 | unsigned int ramp_delay; | 253 | unsigned int ramp_delay; |
| 245 | 254 | ||
| 246 | const struct regulator_linear_range *linear_ranges; | 255 | const struct regulator_linear_range *linear_ranges; |
| @@ -336,7 +345,12 @@ struct regulator_dev { | |||
| 336 | struct regulator_dev * | 345 | struct regulator_dev * |
| 337 | regulator_register(const struct regulator_desc *regulator_desc, | 346 | regulator_register(const struct regulator_desc *regulator_desc, |
| 338 | const struct regulator_config *config); | 347 | const struct regulator_config *config); |
| 348 | struct regulator_dev * | ||
| 349 | devm_regulator_register(struct device *dev, | ||
| 350 | const struct regulator_desc *regulator_desc, | ||
| 351 | const struct regulator_config *config); | ||
| 339 | void regulator_unregister(struct regulator_dev *rdev); | 352 | void regulator_unregister(struct regulator_dev *rdev); |
| 353 | void devm_regulator_unregister(struct device *dev, struct regulator_dev *rdev); | ||
| 340 | 354 | ||
| 341 | int regulator_notifier_call_chain(struct regulator_dev *rdev, | 355 | int regulator_notifier_call_chain(struct regulator_dev *rdev, |
| 342 | unsigned long event, void *data); | 356 | unsigned long event, void *data); |
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h index 999b20ce06cf..730e638c5589 100644 --- a/include/linux/regulator/machine.h +++ b/include/linux/regulator/machine.h | |||
| @@ -95,6 +95,7 @@ struct regulator_state { | |||
| 95 | * @initial_state: Suspend state to set by default. | 95 | * @initial_state: Suspend state to set by default. |
| 96 | * @initial_mode: Mode to set at startup. | 96 | * @initial_mode: Mode to set at startup. |
| 97 | * @ramp_delay: Time to settle down after voltage change (unit: uV/us) | 97 | * @ramp_delay: Time to settle down after voltage change (unit: uV/us) |
| 98 | * @enable_time: Turn-on time of the rails (unit: microseconds) | ||
| 98 | */ | 99 | */ |
| 99 | struct regulation_constraints { | 100 | struct regulation_constraints { |
| 100 | 101 | ||
| @@ -129,6 +130,7 @@ struct regulation_constraints { | |||
| 129 | unsigned int initial_mode; | 130 | unsigned int initial_mode; |
| 130 | 131 | ||
| 131 | unsigned int ramp_delay; | 132 | unsigned int ramp_delay; |
| 133 | unsigned int enable_time; | ||
| 132 | 134 | ||
| 133 | /* constraint flags */ | 135 | /* constraint flags */ |
| 134 | unsigned always_on:1; /* regulator never off when system is on */ | 136 | unsigned always_on:1; /* regulator never off when system is on */ |
| @@ -193,15 +195,10 @@ int regulator_suspend_finish(void); | |||
| 193 | 195 | ||
| 194 | #ifdef CONFIG_REGULATOR | 196 | #ifdef CONFIG_REGULATOR |
| 195 | void regulator_has_full_constraints(void); | 197 | void regulator_has_full_constraints(void); |
| 196 | void regulator_use_dummy_regulator(void); | ||
| 197 | #else | 198 | #else |
| 198 | static inline void regulator_has_full_constraints(void) | 199 | static inline void regulator_has_full_constraints(void) |
| 199 | { | 200 | { |
| 200 | } | 201 | } |
| 201 | |||
| 202 | static inline void regulator_use_dummy_regulator(void) | ||
| 203 | { | ||
| 204 | } | ||
| 205 | #endif | 202 | #endif |
| 206 | 203 | ||
| 207 | #endif | 204 | #endif |
diff --git a/include/linux/sched.h b/include/linux/sched.h index e27baeeda3f4..f7efc8604652 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -22,6 +22,7 @@ struct sched_param { | |||
| 22 | #include <linux/errno.h> | 22 | #include <linux/errno.h> |
| 23 | #include <linux/nodemask.h> | 23 | #include <linux/nodemask.h> |
| 24 | #include <linux/mm_types.h> | 24 | #include <linux/mm_types.h> |
| 25 | #include <linux/preempt.h> | ||
| 25 | 26 | ||
| 26 | #include <asm/page.h> | 27 | #include <asm/page.h> |
| 27 | #include <asm/ptrace.h> | 28 | #include <asm/ptrace.h> |
| @@ -322,6 +323,10 @@ static inline void arch_pick_mmap_layout(struct mm_struct *mm) {} | |||
| 322 | extern void set_dumpable(struct mm_struct *mm, int value); | 323 | extern void set_dumpable(struct mm_struct *mm, int value); |
| 323 | extern int get_dumpable(struct mm_struct *mm); | 324 | extern int get_dumpable(struct mm_struct *mm); |
| 324 | 325 | ||
| 326 | #define SUID_DUMP_DISABLE 0 /* No setuid dumping */ | ||
| 327 | #define SUID_DUMP_USER 1 /* Dump as user of process */ | ||
| 328 | #define SUID_DUMP_ROOT 2 /* Dump as root */ | ||
| 329 | |||
| 325 | /* mm flags */ | 330 | /* mm flags */ |
| 326 | /* dumpable bits */ | 331 | /* dumpable bits */ |
| 327 | #define MMF_DUMPABLE 0 /* core dump is permitted */ | 332 | #define MMF_DUMPABLE 0 /* core dump is permitted */ |
| @@ -427,6 +432,14 @@ struct task_cputime { | |||
| 427 | .sum_exec_runtime = 0, \ | 432 | .sum_exec_runtime = 0, \ |
| 428 | } | 433 | } |
| 429 | 434 | ||
| 435 | #define PREEMPT_ENABLED (PREEMPT_NEED_RESCHED) | ||
| 436 | |||
| 437 | #ifdef CONFIG_PREEMPT_COUNT | ||
| 438 | #define PREEMPT_DISABLED (1 + PREEMPT_ENABLED) | ||
| 439 | #else | ||
| 440 | #define PREEMPT_DISABLED PREEMPT_ENABLED | ||
| 441 | #endif | ||
| 442 | |||
| 430 | /* | 443 | /* |
| 431 | * Disable preemption until the scheduler is running. | 444 | * Disable preemption until the scheduler is running. |
| 432 | * Reset by start_kernel()->sched_init()->init_idle(). | 445 | * Reset by start_kernel()->sched_init()->init_idle(). |
| @@ -434,7 +447,7 @@ struct task_cputime { | |||
| 434 | * We include PREEMPT_ACTIVE to avoid cond_resched() from working | 447 | * We include PREEMPT_ACTIVE to avoid cond_resched() from working |
| 435 | * before the scheduler is active -- see should_resched(). | 448 | * before the scheduler is active -- see should_resched(). |
| 436 | */ | 449 | */ |
| 437 | #define INIT_PREEMPT_COUNT (1 + PREEMPT_ACTIVE) | 450 | #define INIT_PREEMPT_COUNT (PREEMPT_DISABLED + PREEMPT_ACTIVE) |
| 438 | 451 | ||
| 439 | /** | 452 | /** |
| 440 | * struct thread_group_cputimer - thread group interval timer counts | 453 | * struct thread_group_cputimer - thread group interval timer counts |
| @@ -768,6 +781,7 @@ enum cpu_idle_type { | |||
| 768 | #define SD_ASYM_PACKING 0x0800 /* Place busy groups earlier in the domain */ | 781 | #define SD_ASYM_PACKING 0x0800 /* Place busy groups earlier in the domain */ |
| 769 | #define SD_PREFER_SIBLING 0x1000 /* Prefer to place tasks in a sibling domain */ | 782 | #define SD_PREFER_SIBLING 0x1000 /* Prefer to place tasks in a sibling domain */ |
| 770 | #define SD_OVERLAP 0x2000 /* sched_domains of this level overlap */ | 783 | #define SD_OVERLAP 0x2000 /* sched_domains of this level overlap */ |
| 784 | #define SD_NUMA 0x4000 /* cross-node balancing */ | ||
| 771 | 785 | ||
| 772 | extern int __weak arch_sd_sibiling_asym_packing(void); | 786 | extern int __weak arch_sd_sibiling_asym_packing(void); |
| 773 | 787 | ||
| @@ -811,6 +825,10 @@ struct sched_domain { | |||
| 811 | 825 | ||
| 812 | u64 last_update; | 826 | u64 last_update; |
| 813 | 827 | ||
| 828 | /* idle_balance() stats */ | ||
| 829 | u64 max_newidle_lb_cost; | ||
| 830 | unsigned long next_decay_max_lb_cost; | ||
| 831 | |||
| 814 | #ifdef CONFIG_SCHEDSTATS | 832 | #ifdef CONFIG_SCHEDSTATS |
| 815 | /* load_balance() stats */ | 833 | /* load_balance() stats */ |
| 816 | unsigned int lb_count[CPU_MAX_IDLE_TYPES]; | 834 | unsigned int lb_count[CPU_MAX_IDLE_TYPES]; |
| @@ -1029,6 +1047,8 @@ struct task_struct { | |||
| 1029 | struct task_struct *last_wakee; | 1047 | struct task_struct *last_wakee; |
| 1030 | unsigned long wakee_flips; | 1048 | unsigned long wakee_flips; |
| 1031 | unsigned long wakee_flip_decay_ts; | 1049 | unsigned long wakee_flip_decay_ts; |
| 1050 | |||
| 1051 | int wake_cpu; | ||
| 1032 | #endif | 1052 | #endif |
| 1033 | int on_rq; | 1053 | int on_rq; |
| 1034 | 1054 | ||
| @@ -1046,15 +1066,6 @@ struct task_struct { | |||
| 1046 | struct hlist_head preempt_notifiers; | 1066 | struct hlist_head preempt_notifiers; |
| 1047 | #endif | 1067 | #endif |
| 1048 | 1068 | ||
| 1049 | /* | ||
| 1050 | * fpu_counter contains the number of consecutive context switches | ||
| 1051 | * that the FPU is used. If this is over a threshold, the lazy fpu | ||
| 1052 | * saving becomes unlazy to save the trap. This is an unsigned char | ||
| 1053 | * so that after 256 times the counter wraps and the behavior turns | ||
| 1054 | * lazy again; this to deal with bursty apps that only use FPU for | ||
| 1055 | * a short time | ||
| 1056 | */ | ||
| 1057 | unsigned char fpu_counter; | ||
| 1058 | #ifdef CONFIG_BLK_DEV_IO_TRACE | 1069 | #ifdef CONFIG_BLK_DEV_IO_TRACE |
| 1059 | unsigned int btrace_seq; | 1070 | unsigned int btrace_seq; |
| 1060 | #endif | 1071 | #endif |
| @@ -1324,10 +1335,41 @@ struct task_struct { | |||
| 1324 | #endif | 1335 | #endif |
| 1325 | #ifdef CONFIG_NUMA_BALANCING | 1336 | #ifdef CONFIG_NUMA_BALANCING |
| 1326 | int numa_scan_seq; | 1337 | int numa_scan_seq; |
| 1327 | int numa_migrate_seq; | ||
| 1328 | unsigned int numa_scan_period; | 1338 | unsigned int numa_scan_period; |
| 1339 | unsigned int numa_scan_period_max; | ||
| 1340 | int numa_preferred_nid; | ||
| 1341 | int numa_migrate_deferred; | ||
| 1342 | unsigned long numa_migrate_retry; | ||
| 1329 | u64 node_stamp; /* migration stamp */ | 1343 | u64 node_stamp; /* migration stamp */ |
| 1330 | struct callback_head numa_work; | 1344 | struct callback_head numa_work; |
| 1345 | |||
| 1346 | struct list_head numa_entry; | ||
| 1347 | struct numa_group *numa_group; | ||
| 1348 | |||
| 1349 | /* | ||
| 1350 | * Exponential decaying average of faults on a per-node basis. | ||
| 1351 | * Scheduling placement decisions are made based on the these counts. | ||
| 1352 | * The values remain static for the duration of a PTE scan | ||
| 1353 | */ | ||
| 1354 | unsigned long *numa_faults; | ||
| 1355 | unsigned long total_numa_faults; | ||
| 1356 | |||
| 1357 | /* | ||
| 1358 | * numa_faults_buffer records faults per node during the current | ||
| 1359 | * scan window. When the scan completes, the counts in numa_faults | ||
| 1360 | * decay and these values are copied. | ||
| 1361 | */ | ||
| 1362 | unsigned long *numa_faults_buffer; | ||
| 1363 | |||
| 1364 | /* | ||
| 1365 | * numa_faults_locality tracks if faults recorded during the last | ||
| 1366 | * scan window were remote/local. The task scan period is adapted | ||
| 1367 | * based on the locality of the faults with different weights | ||
| 1368 | * depending on whether they were shared or private faults | ||
| 1369 | */ | ||
| 1370 | unsigned long numa_faults_locality[2]; | ||
| 1371 | |||
| 1372 | unsigned long numa_pages_migrated; | ||
| 1331 | #endif /* CONFIG_NUMA_BALANCING */ | 1373 | #endif /* CONFIG_NUMA_BALANCING */ |
| 1332 | 1374 | ||
| 1333 | struct rcu_head rcu; | 1375 | struct rcu_head rcu; |
| @@ -1412,16 +1454,33 @@ struct task_struct { | |||
| 1412 | /* Future-safe accessor for struct task_struct's cpus_allowed. */ | 1454 | /* Future-safe accessor for struct task_struct's cpus_allowed. */ |
| 1413 | #define tsk_cpus_allowed(tsk) (&(tsk)->cpus_allowed) | 1455 | #define tsk_cpus_allowed(tsk) (&(tsk)->cpus_allowed) |
| 1414 | 1456 | ||
| 1457 | #define TNF_MIGRATED 0x01 | ||
| 1458 | #define TNF_NO_GROUP 0x02 | ||
| 1459 | #define TNF_SHARED 0x04 | ||
| 1460 | #define TNF_FAULT_LOCAL 0x08 | ||
| 1461 | |||
| 1415 | #ifdef CONFIG_NUMA_BALANCING | 1462 | #ifdef CONFIG_NUMA_BALANCING |
| 1416 | extern void task_numa_fault(int node, int pages, bool migrated); | 1463 | extern void task_numa_fault(int last_node, int node, int pages, int flags); |
| 1464 | extern pid_t task_numa_group_id(struct task_struct *p); | ||
| 1417 | extern void set_numabalancing_state(bool enabled); | 1465 | extern void set_numabalancing_state(bool enabled); |
| 1466 | extern void task_numa_free(struct task_struct *p); | ||
| 1467 | |||
| 1468 | extern unsigned int sysctl_numa_balancing_migrate_deferred; | ||
| 1418 | #else | 1469 | #else |
| 1419 | static inline void task_numa_fault(int node, int pages, bool migrated) | 1470 | static inline void task_numa_fault(int last_node, int node, int pages, |
| 1471 | int flags) | ||
| 1472 | { | ||
| 1473 | } | ||
| 1474 | static inline pid_t task_numa_group_id(struct task_struct *p) | ||
| 1420 | { | 1475 | { |
| 1476 | return 0; | ||
| 1421 | } | 1477 | } |
| 1422 | static inline void set_numabalancing_state(bool enabled) | 1478 | static inline void set_numabalancing_state(bool enabled) |
| 1423 | { | 1479 | { |
| 1424 | } | 1480 | } |
| 1481 | static inline void task_numa_free(struct task_struct *p) | ||
| 1482 | { | ||
| 1483 | } | ||
| 1425 | #endif | 1484 | #endif |
| 1426 | 1485 | ||
| 1427 | static inline struct pid *task_pid(struct task_struct *task) | 1486 | static inline struct pid *task_pid(struct task_struct *task) |
| @@ -1974,7 +2033,7 @@ extern void wake_up_new_task(struct task_struct *tsk); | |||
| 1974 | #else | 2033 | #else |
| 1975 | static inline void kick_process(struct task_struct *tsk) { } | 2034 | static inline void kick_process(struct task_struct *tsk) { } |
| 1976 | #endif | 2035 | #endif |
| 1977 | extern void sched_fork(struct task_struct *p); | 2036 | extern void sched_fork(unsigned long clone_flags, struct task_struct *p); |
| 1978 | extern void sched_dead(struct task_struct *p); | 2037 | extern void sched_dead(struct task_struct *p); |
| 1979 | 2038 | ||
| 1980 | extern void proc_caches_init(void); | 2039 | extern void proc_caches_init(void); |
| @@ -2401,11 +2460,6 @@ static inline int signal_pending_state(long state, struct task_struct *p) | |||
| 2401 | return (state & TASK_INTERRUPTIBLE) || __fatal_signal_pending(p); | 2460 | return (state & TASK_INTERRUPTIBLE) || __fatal_signal_pending(p); |
| 2402 | } | 2461 | } |
| 2403 | 2462 | ||
| 2404 | static inline int need_resched(void) | ||
| 2405 | { | ||
| 2406 | return unlikely(test_thread_flag(TIF_NEED_RESCHED)); | ||
| 2407 | } | ||
| 2408 | |||
| 2409 | /* | 2463 | /* |
| 2410 | * cond_resched() and cond_resched_lock(): latency reduction via | 2464 | * cond_resched() and cond_resched_lock(): latency reduction via |
| 2411 | * explicit rescheduling in places that are safe. The return | 2465 | * explicit rescheduling in places that are safe. The return |
| @@ -2474,36 +2528,105 @@ static inline int tsk_is_polling(struct task_struct *p) | |||
| 2474 | { | 2528 | { |
| 2475 | return task_thread_info(p)->status & TS_POLLING; | 2529 | return task_thread_info(p)->status & TS_POLLING; |
| 2476 | } | 2530 | } |
| 2477 | static inline void current_set_polling(void) | 2531 | static inline void __current_set_polling(void) |
| 2478 | { | 2532 | { |
| 2479 | current_thread_info()->status |= TS_POLLING; | 2533 | current_thread_info()->status |= TS_POLLING; |
| 2480 | } | 2534 | } |
| 2481 | 2535 | ||
| 2482 | static inline void current_clr_polling(void) | 2536 | static inline bool __must_check current_set_polling_and_test(void) |
| 2537 | { | ||
| 2538 | __current_set_polling(); | ||
| 2539 | |||
| 2540 | /* | ||
| 2541 | * Polling state must be visible before we test NEED_RESCHED, | ||
| 2542 | * paired by resched_task() | ||
| 2543 | */ | ||
| 2544 | smp_mb(); | ||
| 2545 | |||
| 2546 | return unlikely(tif_need_resched()); | ||
| 2547 | } | ||
| 2548 | |||
| 2549 | static inline void __current_clr_polling(void) | ||
| 2483 | { | 2550 | { |
| 2484 | current_thread_info()->status &= ~TS_POLLING; | 2551 | current_thread_info()->status &= ~TS_POLLING; |
| 2485 | smp_mb__after_clear_bit(); | 2552 | } |
| 2553 | |||
| 2554 | static inline bool __must_check current_clr_polling_and_test(void) | ||
| 2555 | { | ||
| 2556 | __current_clr_polling(); | ||
| 2557 | |||
| 2558 | /* | ||
| 2559 | * Polling state must be visible before we test NEED_RESCHED, | ||
| 2560 | * paired by resched_task() | ||
| 2561 | */ | ||
| 2562 | smp_mb(); | ||
| 2563 | |||
| 2564 | return unlikely(tif_need_resched()); | ||
| 2486 | } | 2565 | } |
| 2487 | #elif defined(TIF_POLLING_NRFLAG) | 2566 | #elif defined(TIF_POLLING_NRFLAG) |
| 2488 | static inline int tsk_is_polling(struct task_struct *p) | 2567 | static inline int tsk_is_polling(struct task_struct *p) |
| 2489 | { | 2568 | { |
| 2490 | return test_tsk_thread_flag(p, TIF_POLLING_NRFLAG); | 2569 | return test_tsk_thread_flag(p, TIF_POLLING_NRFLAG); |
| 2491 | } | 2570 | } |
| 2492 | static inline void current_set_polling(void) | 2571 | |
| 2572 | static inline void __current_set_polling(void) | ||
| 2493 | { | 2573 | { |
| 2494 | set_thread_flag(TIF_POLLING_NRFLAG); | 2574 | set_thread_flag(TIF_POLLING_NRFLAG); |
| 2495 | } | 2575 | } |
| 2496 | 2576 | ||
| 2497 | static inline void current_clr_polling(void) | 2577 | static inline bool __must_check current_set_polling_and_test(void) |
| 2578 | { | ||
| 2579 | __current_set_polling(); | ||
| 2580 | |||
| 2581 | /* | ||
| 2582 | * Polling state must be visible before we test NEED_RESCHED, | ||
| 2583 | * paired by resched_task() | ||
| 2584 | * | ||
| 2585 | * XXX: assumes set/clear bit are identical barrier wise. | ||
| 2586 | */ | ||
| 2587 | smp_mb__after_clear_bit(); | ||
| 2588 | |||
| 2589 | return unlikely(tif_need_resched()); | ||
| 2590 | } | ||
| 2591 | |||
| 2592 | static inline void __current_clr_polling(void) | ||
| 2498 | { | 2593 | { |
| 2499 | clear_thread_flag(TIF_POLLING_NRFLAG); | 2594 | clear_thread_flag(TIF_POLLING_NRFLAG); |
| 2500 | } | 2595 | } |
| 2596 | |||
| 2597 | static inline bool __must_check current_clr_polling_and_test(void) | ||
| 2598 | { | ||
| 2599 | __current_clr_polling(); | ||
| 2600 | |||
| 2601 | /* | ||
| 2602 | * Polling state must be visible before we test NEED_RESCHED, | ||
| 2603 | * paired by resched_task() | ||
| 2604 | */ | ||
| 2605 | smp_mb__after_clear_bit(); | ||
| 2606 | |||
| 2607 | return unlikely(tif_need_resched()); | ||
| 2608 | } | ||
| 2609 | |||
| 2501 | #else | 2610 | #else |
| 2502 | static inline int tsk_is_polling(struct task_struct *p) { return 0; } | 2611 | static inline int tsk_is_polling(struct task_struct *p) { return 0; } |
| 2503 | static inline void current_set_polling(void) { } | 2612 | static inline void __current_set_polling(void) { } |
| 2504 | static inline void current_clr_polling(void) { } | 2613 | static inline void __current_clr_polling(void) { } |
| 2614 | |||
| 2615 | static inline bool __must_check current_set_polling_and_test(void) | ||
| 2616 | { | ||
| 2617 | return unlikely(tif_need_resched()); | ||
| 2618 | } | ||
| 2619 | static inline bool __must_check current_clr_polling_and_test(void) | ||
| 2620 | { | ||
| 2621 | return unlikely(tif_need_resched()); | ||
| 2622 | } | ||
| 2505 | #endif | 2623 | #endif |
| 2506 | 2624 | ||
| 2625 | static __always_inline bool need_resched(void) | ||
| 2626 | { | ||
| 2627 | return unlikely(tif_need_resched()); | ||
| 2628 | } | ||
| 2629 | |||
| 2507 | /* | 2630 | /* |
| 2508 | * Thread group CPU time accounting. | 2631 | * Thread group CPU time accounting. |
| 2509 | */ | 2632 | */ |
| @@ -2545,6 +2668,11 @@ static inline unsigned int task_cpu(const struct task_struct *p) | |||
| 2545 | return task_thread_info(p)->cpu; | 2668 | return task_thread_info(p)->cpu; |
| 2546 | } | 2669 | } |
| 2547 | 2670 | ||
| 2671 | static inline int task_node(const struct task_struct *p) | ||
| 2672 | { | ||
| 2673 | return cpu_to_node(task_cpu(p)); | ||
| 2674 | } | ||
| 2675 | |||
| 2548 | extern void set_task_cpu(struct task_struct *p, unsigned int cpu); | 2676 | extern void set_task_cpu(struct task_struct *p, unsigned int cpu); |
| 2549 | 2677 | ||
| 2550 | #else | 2678 | #else |
diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h index bf8086b2506e..10d16c4fbe89 100644 --- a/include/linux/sched/sysctl.h +++ b/include/linux/sched/sysctl.h | |||
| @@ -47,7 +47,6 @@ extern enum sched_tunable_scaling sysctl_sched_tunable_scaling; | |||
| 47 | extern unsigned int sysctl_numa_balancing_scan_delay; | 47 | extern unsigned int sysctl_numa_balancing_scan_delay; |
| 48 | extern unsigned int sysctl_numa_balancing_scan_period_min; | 48 | extern unsigned int sysctl_numa_balancing_scan_period_min; |
| 49 | extern unsigned int sysctl_numa_balancing_scan_period_max; | 49 | extern unsigned int sysctl_numa_balancing_scan_period_max; |
| 50 | extern unsigned int sysctl_numa_balancing_scan_period_reset; | ||
| 51 | extern unsigned int sysctl_numa_balancing_scan_size; | 50 | extern unsigned int sysctl_numa_balancing_scan_size; |
| 52 | extern unsigned int sysctl_numa_balancing_settle_count; | 51 | extern unsigned int sysctl_numa_balancing_settle_count; |
| 53 | 52 | ||
diff --git a/include/linux/sched_clock.h b/include/linux/sched_clock.h index fa7922c80a41..cddf0c2940b6 100644 --- a/include/linux/sched_clock.h +++ b/include/linux/sched_clock.h | |||
| @@ -15,7 +15,7 @@ static inline void sched_clock_postinit(void) { } | |||
| 15 | #endif | 15 | #endif |
| 16 | 16 | ||
| 17 | extern void setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate); | 17 | extern void setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate); |
| 18 | 18 | extern void sched_clock_register(u64 (*read)(void), int bits, | |
| 19 | extern unsigned long long (*sched_clock_func)(void); | 19 | unsigned long rate); |
| 20 | 20 | ||
| 21 | #endif | 21 | #endif |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index b98291ac7f14..f729be981da0 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
| @@ -66,7 +66,6 @@ struct uart_ops { | |||
| 66 | void (*set_ldisc)(struct uart_port *, int new); | 66 | void (*set_ldisc)(struct uart_port *, int new); |
| 67 | void (*pm)(struct uart_port *, unsigned int state, | 67 | void (*pm)(struct uart_port *, unsigned int state, |
| 68 | unsigned int oldstate); | 68 | unsigned int oldstate); |
| 69 | int (*set_wake)(struct uart_port *, unsigned int state); | ||
| 70 | 69 | ||
| 71 | /* | 70 | /* |
| 72 | * Return a string describing the type of the port | 71 | * Return a string describing the type of the port |
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h index d34049712a4d..50fe651da965 100644 --- a/include/linux/serial_sci.h +++ b/include/linux/serial_sci.h | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | #include <linux/sh_dma.h> | 5 | #include <linux/sh_dma.h> |
| 6 | 6 | ||
| 7 | /* | 7 | /* |
| 8 | * Generic header for SuperH (H)SCI(F) (used by sh/sh64/h8300 and related parts) | 8 | * Generic header for SuperH (H)SCI(F) (used by sh/sh64 and related parts) |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | #define SCIx_NOT_SUPPORTED (-1) | 11 | #define SCIx_NOT_SUPPORTED (-1) |
diff --git a/include/linux/sfi.h b/include/linux/sfi.h index fe817918b30e..d9b436f09925 100644 --- a/include/linux/sfi.h +++ b/include/linux/sfi.h | |||
| @@ -59,6 +59,9 @@ | |||
| 59 | #ifndef _LINUX_SFI_H | 59 | #ifndef _LINUX_SFI_H |
| 60 | #define _LINUX_SFI_H | 60 | #define _LINUX_SFI_H |
| 61 | 61 | ||
| 62 | #include <linux/init.h> | ||
| 63 | #include <linux/types.h> | ||
| 64 | |||
| 62 | /* Table signatures reserved by the SFI specification */ | 65 | /* Table signatures reserved by the SFI specification */ |
| 63 | #define SFI_SIG_SYST "SYST" | 66 | #define SFI_SIG_SYST "SYST" |
| 64 | #define SFI_SIG_FREQ "FREQ" | 67 | #define SFI_SIG_FREQ "FREQ" |
diff --git a/include/linux/spi/rspi.h b/include/linux/spi/rspi.h index 900f0e328235..a25bd6f65e7f 100644 --- a/include/linux/spi/rspi.h +++ b/include/linux/spi/rspi.h | |||
| @@ -26,6 +26,8 @@ struct rspi_plat_data { | |||
| 26 | unsigned int dma_rx_id; | 26 | unsigned int dma_rx_id; |
| 27 | 27 | ||
| 28 | unsigned dma_width_16bit:1; /* DMAC read/write width = 16-bit */ | 28 | unsigned dma_width_16bit:1; /* DMAC read/write width = 16-bit */ |
| 29 | |||
| 30 | u16 num_chipselect; | ||
| 29 | }; | 31 | }; |
| 30 | 32 | ||
| 31 | #endif | 33 | #endif |
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 887116dbce2c..8c62ba74dd91 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include <linux/mod_devicetable.h> | 23 | #include <linux/mod_devicetable.h> |
| 24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
| 25 | #include <linux/kthread.h> | 25 | #include <linux/kthread.h> |
| 26 | #include <linux/completion.h> | ||
| 26 | 27 | ||
| 27 | /* | 28 | /* |
| 28 | * INTERFACES between SPI master-side drivers and SPI infrastructure. | 29 | * INTERFACES between SPI master-side drivers and SPI infrastructure. |
| @@ -150,8 +151,7 @@ static inline void *spi_get_drvdata(struct spi_device *spi) | |||
| 150 | } | 151 | } |
| 151 | 152 | ||
| 152 | struct spi_message; | 153 | struct spi_message; |
| 153 | 154 | struct spi_transfer; | |
| 154 | |||
| 155 | 155 | ||
| 156 | /** | 156 | /** |
| 157 | * struct spi_driver - Host side "protocol" driver | 157 | * struct spi_driver - Host side "protocol" driver |
| @@ -257,6 +257,9 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
| 257 | * @queue_lock: spinlock to syncronise access to message queue | 257 | * @queue_lock: spinlock to syncronise access to message queue |
| 258 | * @queue: message queue | 258 | * @queue: message queue |
| 259 | * @cur_msg: the currently in-flight message | 259 | * @cur_msg: the currently in-flight message |
| 260 | * @cur_msg_prepared: spi_prepare_message was called for the currently | ||
| 261 | * in-flight message | ||
| 262 | * @xfer_completion: used by core tranfer_one_message() | ||
| 260 | * @busy: message pump is busy | 263 | * @busy: message pump is busy |
| 261 | * @running: message pump is running | 264 | * @running: message pump is running |
| 262 | * @rt: whether this queue is set to run as a realtime task | 265 | * @rt: whether this queue is set to run as a realtime task |
| @@ -274,6 +277,16 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
| 274 | * @unprepare_transfer_hardware: there are currently no more messages on the | 277 | * @unprepare_transfer_hardware: there are currently no more messages on the |
| 275 | * queue so the subsystem notifies the driver that it may relax the | 278 | * queue so the subsystem notifies the driver that it may relax the |
| 276 | * hardware by issuing this call | 279 | * hardware by issuing this call |
| 280 | * @set_cs: assert or deassert chip select, true to assert. May be called | ||
| 281 | * from interrupt context. | ||
| 282 | * @prepare_message: set up the controller to transfer a single message, | ||
| 283 | * for example doing DMA mapping. Called from threaded | ||
| 284 | * context. | ||
| 285 | * @transfer_one: transfer a single spi_transfer. When the | ||
| 286 | * driver is finished with this transfer it must call | ||
| 287 | * spi_finalize_current_transfer() so the subsystem can issue | ||
| 288 | * the next transfer | ||
| 289 | * @unprepare_message: undo any work done by prepare_message(). | ||
| 277 | * @cs_gpios: Array of GPIOs to use as chip select lines; one per CS | 290 | * @cs_gpios: Array of GPIOs to use as chip select lines; one per CS |
| 278 | * number. Any individual value may be -ENOENT for CS lines that | 291 | * number. Any individual value may be -ENOENT for CS lines that |
| 279 | * are not GPIOs (driven by the SPI controller itself). | 292 | * are not GPIOs (driven by the SPI controller itself). |
| @@ -388,11 +401,25 @@ struct spi_master { | |||
| 388 | bool running; | 401 | bool running; |
| 389 | bool rt; | 402 | bool rt; |
| 390 | bool auto_runtime_pm; | 403 | bool auto_runtime_pm; |
| 404 | bool cur_msg_prepared; | ||
| 405 | struct completion xfer_completion; | ||
| 391 | 406 | ||
| 392 | int (*prepare_transfer_hardware)(struct spi_master *master); | 407 | int (*prepare_transfer_hardware)(struct spi_master *master); |
| 393 | int (*transfer_one_message)(struct spi_master *master, | 408 | int (*transfer_one_message)(struct spi_master *master, |
| 394 | struct spi_message *mesg); | 409 | struct spi_message *mesg); |
| 395 | int (*unprepare_transfer_hardware)(struct spi_master *master); | 410 | int (*unprepare_transfer_hardware)(struct spi_master *master); |
| 411 | int (*prepare_message)(struct spi_master *master, | ||
| 412 | struct spi_message *message); | ||
| 413 | int (*unprepare_message)(struct spi_master *master, | ||
| 414 | struct spi_message *message); | ||
| 415 | |||
| 416 | /* | ||
| 417 | * These hooks are for drivers that use a generic implementation | ||
| 418 | * of transfer_one_message() provied by the core. | ||
| 419 | */ | ||
| 420 | void (*set_cs)(struct spi_device *spi, bool enable); | ||
| 421 | int (*transfer_one)(struct spi_master *master, struct spi_device *spi, | ||
| 422 | struct spi_transfer *transfer); | ||
| 396 | 423 | ||
| 397 | /* gpio chip select */ | 424 | /* gpio chip select */ |
| 398 | int *cs_gpios; | 425 | int *cs_gpios; |
| @@ -428,12 +455,15 @@ extern int spi_master_resume(struct spi_master *master); | |||
| 428 | /* Calls the driver make to interact with the message queue */ | 455 | /* Calls the driver make to interact with the message queue */ |
| 429 | extern struct spi_message *spi_get_next_queued_message(struct spi_master *master); | 456 | extern struct spi_message *spi_get_next_queued_message(struct spi_master *master); |
| 430 | extern void spi_finalize_current_message(struct spi_master *master); | 457 | extern void spi_finalize_current_message(struct spi_master *master); |
| 458 | extern void spi_finalize_current_transfer(struct spi_master *master); | ||
| 431 | 459 | ||
| 432 | /* the spi driver core manages memory for the spi_master classdev */ | 460 | /* the spi driver core manages memory for the spi_master classdev */ |
| 433 | extern struct spi_master * | 461 | extern struct spi_master * |
| 434 | spi_alloc_master(struct device *host, unsigned size); | 462 | spi_alloc_master(struct device *host, unsigned size); |
| 435 | 463 | ||
| 436 | extern int spi_register_master(struct spi_master *master); | 464 | extern int spi_register_master(struct spi_master *master); |
| 465 | extern int devm_spi_register_master(struct device *dev, | ||
| 466 | struct spi_master *master); | ||
| 437 | extern void spi_unregister_master(struct spi_master *master); | 467 | extern void spi_unregister_master(struct spi_master *master); |
| 438 | 468 | ||
| 439 | extern struct spi_master *spi_busnum_to_master(u16 busnum); | 469 | extern struct spi_master *spi_busnum_to_master(u16 busnum); |
| @@ -823,6 +853,33 @@ static inline ssize_t spi_w8r16(struct spi_device *spi, u8 cmd) | |||
| 823 | return (status < 0) ? status : result; | 853 | return (status < 0) ? status : result; |
| 824 | } | 854 | } |
| 825 | 855 | ||
| 856 | /** | ||
| 857 | * spi_w8r16be - SPI synchronous 8 bit write followed by 16 bit big-endian read | ||
| 858 | * @spi: device with which data will be exchanged | ||
| 859 | * @cmd: command to be written before data is read back | ||
| 860 | * Context: can sleep | ||
| 861 | * | ||
| 862 | * This returns the (unsigned) sixteen bit number returned by the device in cpu | ||
| 863 | * endianness, or else a negative error code. Callable only from contexts that | ||
| 864 | * can sleep. | ||
| 865 | * | ||
| 866 | * This function is similar to spi_w8r16, with the exception that it will | ||
| 867 | * convert the read 16 bit data word from big-endian to native endianness. | ||
| 868 | * | ||
| 869 | */ | ||
| 870 | static inline ssize_t spi_w8r16be(struct spi_device *spi, u8 cmd) | ||
| 871 | |||
| 872 | { | ||
| 873 | ssize_t status; | ||
| 874 | __be16 result; | ||
| 875 | |||
| 876 | status = spi_write_then_read(spi, &cmd, 1, &result, 2); | ||
| 877 | if (status < 0) | ||
| 878 | return status; | ||
| 879 | |||
| 880 | return be16_to_cpu(result); | ||
| 881 | } | ||
| 882 | |||
| 826 | /*---------------------------------------------------------------------------*/ | 883 | /*---------------------------------------------------------------------------*/ |
| 827 | 884 | ||
| 828 | /* | 885 | /* |
diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h index 3b5e910d14ca..d2abbdb8c6aa 100644 --- a/include/linux/stop_machine.h +++ b/include/linux/stop_machine.h | |||
| @@ -28,6 +28,7 @@ struct cpu_stop_work { | |||
| 28 | }; | 28 | }; |
| 29 | 29 | ||
| 30 | int stop_one_cpu(unsigned int cpu, cpu_stop_fn_t fn, void *arg); | 30 | int stop_one_cpu(unsigned int cpu, cpu_stop_fn_t fn, void *arg); |
| 31 | int stop_two_cpus(unsigned int cpu1, unsigned int cpu2, cpu_stop_fn_t fn, void *arg); | ||
| 31 | void stop_one_cpu_nowait(unsigned int cpu, cpu_stop_fn_t fn, void *arg, | 32 | void stop_one_cpu_nowait(unsigned int cpu, cpu_stop_fn_t fn, void *arg, |
| 32 | struct cpu_stop_work *work_buf); | 33 | struct cpu_stop_work *work_buf); |
| 33 | int stop_cpus(const struct cpumask *cpumask, cpu_stop_fn_t fn, void *arg); | 34 | int stop_cpus(const struct cpumask *cpumask, cpu_stop_fn_t fn, void *arg); |
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 6740801aa71a..8af2804bab16 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
| @@ -49,6 +49,7 @@ struct rpc_clnt { | |||
| 49 | 49 | ||
| 50 | unsigned int cl_softrtry : 1,/* soft timeouts */ | 50 | unsigned int cl_softrtry : 1,/* soft timeouts */ |
| 51 | cl_discrtry : 1,/* disconnect before retry */ | 51 | cl_discrtry : 1,/* disconnect before retry */ |
| 52 | cl_noretranstimeo: 1,/* No retransmit timeouts */ | ||
| 52 | cl_autobind : 1,/* use getport() */ | 53 | cl_autobind : 1,/* use getport() */ |
| 53 | cl_chatty : 1;/* be verbose */ | 54 | cl_chatty : 1;/* be verbose */ |
| 54 | 55 | ||
| @@ -126,6 +127,7 @@ struct rpc_create_args { | |||
| 126 | #define RPC_CLNT_CREATE_QUIET (1UL << 6) | 127 | #define RPC_CLNT_CREATE_QUIET (1UL << 6) |
| 127 | #define RPC_CLNT_CREATE_INFINITE_SLOTS (1UL << 7) | 128 | #define RPC_CLNT_CREATE_INFINITE_SLOTS (1UL << 7) |
| 128 | #define RPC_CLNT_CREATE_NO_IDLE_TIMEOUT (1UL << 8) | 129 | #define RPC_CLNT_CREATE_NO_IDLE_TIMEOUT (1UL << 8) |
| 130 | #define RPC_CLNT_CREATE_NO_RETRANS_TIMEOUT (1UL << 9) | ||
| 129 | 131 | ||
| 130 | struct rpc_clnt *rpc_create(struct rpc_create_args *args); | 132 | struct rpc_clnt *rpc_create(struct rpc_create_args *args); |
| 131 | struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, | 133 | struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, |
| @@ -134,6 +136,10 @@ void rpc_task_reset_client(struct rpc_task *task, struct rpc_clnt *clnt); | |||
| 134 | struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); | 136 | struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); |
| 135 | struct rpc_clnt *rpc_clone_client_set_auth(struct rpc_clnt *, | 137 | struct rpc_clnt *rpc_clone_client_set_auth(struct rpc_clnt *, |
| 136 | rpc_authflavor_t); | 138 | rpc_authflavor_t); |
| 139 | int rpc_switch_client_transport(struct rpc_clnt *, | ||
| 140 | struct xprt_create *, | ||
| 141 | const struct rpc_timeout *); | ||
| 142 | |||
| 137 | void rpc_shutdown_client(struct rpc_clnt *); | 143 | void rpc_shutdown_client(struct rpc_clnt *); |
| 138 | void rpc_release_client(struct rpc_clnt *); | 144 | void rpc_release_client(struct rpc_clnt *); |
| 139 | void rpc_task_release_client(struct rpc_task *); | 145 | void rpc_task_release_client(struct rpc_task *); |
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 096ee58be11a..3a847de83fab 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
| @@ -122,6 +122,7 @@ struct rpc_task_setup { | |||
| 122 | #define RPC_TASK_SENT 0x0800 /* message was sent */ | 122 | #define RPC_TASK_SENT 0x0800 /* message was sent */ |
| 123 | #define RPC_TASK_TIMEOUT 0x1000 /* fail with ETIMEDOUT on timeout */ | 123 | #define RPC_TASK_TIMEOUT 0x1000 /* fail with ETIMEDOUT on timeout */ |
| 124 | #define RPC_TASK_NOCONNECT 0x2000 /* return ENOTCONN if not connected */ | 124 | #define RPC_TASK_NOCONNECT 0x2000 /* return ENOTCONN if not connected */ |
| 125 | #define RPC_TASK_NO_RETRANS_TIMEOUT 0x4000 /* wait forever for a reply */ | ||
| 125 | 126 | ||
| 126 | #define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC) | 127 | #define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC) |
| 127 | #define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER) | 128 | #define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER) |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index cec7b9b5e1bf..8097b9df6773 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
| @@ -288,7 +288,7 @@ int xprt_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task); | |||
| 288 | int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); | 288 | int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); |
| 289 | void xprt_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task); | 289 | void xprt_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task); |
| 290 | void xprt_lock_and_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task); | 290 | void xprt_lock_and_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task); |
| 291 | int xprt_prepare_transmit(struct rpc_task *task); | 291 | bool xprt_prepare_transmit(struct rpc_task *task); |
| 292 | void xprt_transmit(struct rpc_task *task); | 292 | void xprt_transmit(struct rpc_task *task); |
| 293 | void xprt_end_transmit(struct rpc_task *task); | 293 | void xprt_end_transmit(struct rpc_task *task); |
| 294 | int xprt_adjust_timeout(struct rpc_rqst *req); | 294 | int xprt_adjust_timeout(struct rpc_rqst *req); |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 7fac04e7ff6e..c27f846f6b71 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -184,7 +184,8 @@ extern struct trace_event_functions exit_syscall_print_funcs; | |||
| 184 | 184 | ||
| 185 | #define __PROTECT(...) asmlinkage_protect(__VA_ARGS__) | 185 | #define __PROTECT(...) asmlinkage_protect(__VA_ARGS__) |
| 186 | #define __SYSCALL_DEFINEx(x, name, ...) \ | 186 | #define __SYSCALL_DEFINEx(x, name, ...) \ |
| 187 | asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \ | 187 | asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \ |
| 188 | __attribute__((alias(__stringify(SyS##name)))); \ | ||
| 188 | static inline long SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \ | 189 | static inline long SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \ |
| 189 | asmlinkage long SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \ | 190 | asmlinkage long SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \ |
| 190 | asmlinkage long SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \ | 191 | asmlinkage long SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \ |
| @@ -194,7 +195,6 @@ extern struct trace_event_functions exit_syscall_print_funcs; | |||
| 194 | __PROTECT(x, ret,__MAP(x,__SC_ARGS,__VA_ARGS__)); \ | 195 | __PROTECT(x, ret,__MAP(x,__SC_ARGS,__VA_ARGS__)); \ |
| 195 | return ret; \ | 196 | return ret; \ |
| 196 | } \ | 197 | } \ |
| 197 | SYSCALL_ALIAS(sys##name, SyS##name); \ | ||
| 198 | static inline long SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__)) | 198 | static inline long SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__)) |
| 199 | 199 | ||
| 200 | asmlinkage long sys_time(time_t __user *tloc); | 200 | asmlinkage long sys_time(time_t __user *tloc); |
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 11baec7c9b26..6695040a0317 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
| @@ -173,7 +173,6 @@ struct bin_attribute bin_attr_##_name = __BIN_ATTR_RW(_name, _size) | |||
| 173 | struct sysfs_ops { | 173 | struct sysfs_ops { |
| 174 | ssize_t (*show)(struct kobject *, struct attribute *, char *); | 174 | ssize_t (*show)(struct kobject *, struct attribute *, char *); |
| 175 | ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t); | 175 | ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t); |
| 176 | const void *(*namespace)(struct kobject *, const struct attribute *); | ||
| 177 | }; | 176 | }; |
| 178 | 177 | ||
| 179 | struct sysfs_dirent; | 178 | struct sysfs_dirent; |
| @@ -183,19 +182,23 @@ struct sysfs_dirent; | |||
| 183 | int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *), | 182 | int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *), |
| 184 | void *data, struct module *owner); | 183 | void *data, struct module *owner); |
| 185 | 184 | ||
| 186 | int __must_check sysfs_create_dir(struct kobject *kobj); | 185 | int __must_check sysfs_create_dir_ns(struct kobject *kobj, const void *ns); |
| 187 | void sysfs_remove_dir(struct kobject *kobj); | 186 | void sysfs_remove_dir(struct kobject *kobj); |
| 188 | int __must_check sysfs_rename_dir(struct kobject *kobj, const char *new_name); | 187 | int __must_check sysfs_rename_dir_ns(struct kobject *kobj, const char *new_name, |
| 189 | int __must_check sysfs_move_dir(struct kobject *kobj, | 188 | const void *new_ns); |
| 190 | struct kobject *new_parent_kobj); | 189 | int __must_check sysfs_move_dir_ns(struct kobject *kobj, |
| 191 | 190 | struct kobject *new_parent_kobj, | |
| 192 | int __must_check sysfs_create_file(struct kobject *kobj, | 191 | const void *new_ns); |
| 193 | const struct attribute *attr); | 192 | |
| 193 | int __must_check sysfs_create_file_ns(struct kobject *kobj, | ||
| 194 | const struct attribute *attr, | ||
| 195 | const void *ns); | ||
| 194 | int __must_check sysfs_create_files(struct kobject *kobj, | 196 | int __must_check sysfs_create_files(struct kobject *kobj, |
| 195 | const struct attribute **attr); | 197 | const struct attribute **attr); |
| 196 | int __must_check sysfs_chmod_file(struct kobject *kobj, | 198 | int __must_check sysfs_chmod_file(struct kobject *kobj, |
| 197 | const struct attribute *attr, umode_t mode); | 199 | const struct attribute *attr, umode_t mode); |
| 198 | void sysfs_remove_file(struct kobject *kobj, const struct attribute *attr); | 200 | void sysfs_remove_file_ns(struct kobject *kobj, const struct attribute *attr, |
| 201 | const void *ns); | ||
| 199 | void sysfs_remove_files(struct kobject *kobj, const struct attribute **attr); | 202 | void sysfs_remove_files(struct kobject *kobj, const struct attribute **attr); |
| 200 | 203 | ||
| 201 | int __must_check sysfs_create_bin_file(struct kobject *kobj, | 204 | int __must_check sysfs_create_bin_file(struct kobject *kobj, |
| @@ -210,8 +213,9 @@ int __must_check sysfs_create_link_nowarn(struct kobject *kobj, | |||
| 210 | const char *name); | 213 | const char *name); |
| 211 | void sysfs_remove_link(struct kobject *kobj, const char *name); | 214 | void sysfs_remove_link(struct kobject *kobj, const char *name); |
| 212 | 215 | ||
| 213 | int sysfs_rename_link(struct kobject *kobj, struct kobject *target, | 216 | int sysfs_rename_link_ns(struct kobject *kobj, struct kobject *target, |
| 214 | const char *old_name, const char *new_name); | 217 | const char *old_name, const char *new_name, |
| 218 | const void *new_ns); | ||
| 215 | 219 | ||
| 216 | void sysfs_delete_link(struct kobject *dir, struct kobject *targ, | 220 | void sysfs_delete_link(struct kobject *dir, struct kobject *targ, |
| 217 | const char *name); | 221 | const char *name); |
| @@ -241,9 +245,9 @@ void sysfs_remove_link_from_group(struct kobject *kobj, const char *group_name, | |||
| 241 | 245 | ||
| 242 | void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); | 246 | void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); |
| 243 | void sysfs_notify_dirent(struct sysfs_dirent *sd); | 247 | void sysfs_notify_dirent(struct sysfs_dirent *sd); |
| 244 | struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd, | 248 | struct sysfs_dirent *sysfs_get_dirent_ns(struct sysfs_dirent *parent_sd, |
| 245 | const void *ns, | 249 | const unsigned char *name, |
| 246 | const unsigned char *name); | 250 | const void *ns); |
| 247 | struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd); | 251 | struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd); |
| 248 | void sysfs_put(struct sysfs_dirent *sd); | 252 | void sysfs_put(struct sysfs_dirent *sd); |
| 249 | 253 | ||
| @@ -257,7 +261,7 @@ static inline int sysfs_schedule_callback(struct kobject *kobj, | |||
| 257 | return -ENOSYS; | 261 | return -ENOSYS; |
| 258 | } | 262 | } |
| 259 | 263 | ||
| 260 | static inline int sysfs_create_dir(struct kobject *kobj) | 264 | static inline int sysfs_create_dir_ns(struct kobject *kobj, const void *ns) |
| 261 | { | 265 | { |
| 262 | return 0; | 266 | return 0; |
| 263 | } | 267 | } |
| @@ -266,19 +270,22 @@ static inline void sysfs_remove_dir(struct kobject *kobj) | |||
| 266 | { | 270 | { |
| 267 | } | 271 | } |
| 268 | 272 | ||
| 269 | static inline int sysfs_rename_dir(struct kobject *kobj, const char *new_name) | 273 | static inline int sysfs_rename_dir_ns(struct kobject *kobj, |
| 274 | const char *new_name, const void *new_ns) | ||
| 270 | { | 275 | { |
| 271 | return 0; | 276 | return 0; |
| 272 | } | 277 | } |
| 273 | 278 | ||
| 274 | static inline int sysfs_move_dir(struct kobject *kobj, | 279 | static inline int sysfs_move_dir_ns(struct kobject *kobj, |
| 275 | struct kobject *new_parent_kobj) | 280 | struct kobject *new_parent_kobj, |
| 281 | const void *new_ns) | ||
| 276 | { | 282 | { |
| 277 | return 0; | 283 | return 0; |
| 278 | } | 284 | } |
| 279 | 285 | ||
| 280 | static inline int sysfs_create_file(struct kobject *kobj, | 286 | static inline int sysfs_create_file_ns(struct kobject *kobj, |
| 281 | const struct attribute *attr) | 287 | const struct attribute *attr, |
| 288 | const void *ns) | ||
| 282 | { | 289 | { |
| 283 | return 0; | 290 | return 0; |
| 284 | } | 291 | } |
| @@ -295,8 +302,9 @@ static inline int sysfs_chmod_file(struct kobject *kobj, | |||
| 295 | return 0; | 302 | return 0; |
| 296 | } | 303 | } |
| 297 | 304 | ||
| 298 | static inline void sysfs_remove_file(struct kobject *kobj, | 305 | static inline void sysfs_remove_file_ns(struct kobject *kobj, |
| 299 | const struct attribute *attr) | 306 | const struct attribute *attr, |
| 307 | const void *ns) | ||
| 300 | { | 308 | { |
| 301 | } | 309 | } |
| 302 | 310 | ||
| @@ -333,8 +341,9 @@ static inline void sysfs_remove_link(struct kobject *kobj, const char *name) | |||
| 333 | { | 341 | { |
| 334 | } | 342 | } |
| 335 | 343 | ||
| 336 | static inline int sysfs_rename_link(struct kobject *k, struct kobject *t, | 344 | static inline int sysfs_rename_link_ns(struct kobject *k, struct kobject *t, |
| 337 | const char *old_name, const char *new_name) | 345 | const char *old_name, |
| 346 | const char *new_name, const void *ns) | ||
| 338 | { | 347 | { |
| 339 | return 0; | 348 | return 0; |
| 340 | } | 349 | } |
| @@ -413,10 +422,9 @@ static inline void sysfs_notify(struct kobject *kobj, const char *dir, | |||
| 413 | static inline void sysfs_notify_dirent(struct sysfs_dirent *sd) | 422 | static inline void sysfs_notify_dirent(struct sysfs_dirent *sd) |
| 414 | { | 423 | { |
| 415 | } | 424 | } |
| 416 | static inline | 425 | static inline struct sysfs_dirent * |
| 417 | struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd, | 426 | sysfs_get_dirent_ns(struct sysfs_dirent *parent_sd, const unsigned char *name, |
| 418 | const void *ns, | 427 | const void *ns) |
| 419 | const unsigned char *name) | ||
| 420 | { | 428 | { |
| 421 | return NULL; | 429 | return NULL; |
| 422 | } | 430 | } |
| @@ -435,4 +443,28 @@ static inline int __must_check sysfs_init(void) | |||
| 435 | 443 | ||
| 436 | #endif /* CONFIG_SYSFS */ | 444 | #endif /* CONFIG_SYSFS */ |
| 437 | 445 | ||
| 446 | static inline int __must_check sysfs_create_file(struct kobject *kobj, | ||
| 447 | const struct attribute *attr) | ||
| 448 | { | ||
| 449 | return sysfs_create_file_ns(kobj, attr, NULL); | ||
| 450 | } | ||
| 451 | |||
| 452 | static inline void sysfs_remove_file(struct kobject *kobj, | ||
| 453 | const struct attribute *attr) | ||
| 454 | { | ||
| 455 | return sysfs_remove_file_ns(kobj, attr, NULL); | ||
| 456 | } | ||
| 457 | |||
| 458 | static inline int sysfs_rename_link(struct kobject *kobj, struct kobject *target, | ||
| 459 | const char *old_name, const char *new_name) | ||
| 460 | { | ||
| 461 | return sysfs_rename_link_ns(kobj, target, old_name, new_name, NULL); | ||
| 462 | } | ||
| 463 | |||
| 464 | static inline struct sysfs_dirent * | ||
| 465 | sysfs_get_dirent(struct sysfs_dirent *parent_sd, const unsigned char *name) | ||
| 466 | { | ||
| 467 | return sysfs_get_dirent_ns(parent_sd, name, NULL); | ||
| 468 | } | ||
| 469 | |||
| 438 | #endif /* _SYSFS_H_ */ | 470 | #endif /* _SYSFS_H_ */ |
diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h index 7faf933cced7..387fa7d05c98 100644 --- a/include/linux/sysrq.h +++ b/include/linux/sysrq.h | |||
| @@ -17,9 +17,6 @@ | |||
| 17 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
| 18 | #include <linux/types.h> | 18 | #include <linux/types.h> |
| 19 | 19 | ||
| 20 | /* Enable/disable SYSRQ support by default (0==no, 1==yes). */ | ||
| 21 | #define SYSRQ_DEFAULT_ENABLE 1 | ||
| 22 | |||
| 23 | /* Possible values of bitmask for enabling sysrq functions */ | 20 | /* Possible values of bitmask for enabling sysrq functions */ |
| 24 | /* 0x0001 is reserved for enable everything */ | 21 | /* 0x0001 is reserved for enable everything */ |
| 25 | #define SYSRQ_ENABLE_LOG 0x0002 | 22 | #define SYSRQ_ENABLE_LOG 0x0002 |
diff --git a/include/linux/tegra-powergate.h b/include/linux/tegra-powergate.h index 55c29a8d5015..c98cfa406952 100644 --- a/include/linux/tegra-powergate.h +++ b/include/linux/tegra-powergate.h | |||
| @@ -34,8 +34,15 @@ struct clk; | |||
| 34 | #define TEGRA_POWERGATE_CPU3 11 | 34 | #define TEGRA_POWERGATE_CPU3 11 |
| 35 | #define TEGRA_POWERGATE_CELP 12 | 35 | #define TEGRA_POWERGATE_CELP 12 |
| 36 | #define TEGRA_POWERGATE_3D1 13 | 36 | #define TEGRA_POWERGATE_3D1 13 |
| 37 | #define TEGRA_POWERGATE_CPU0 14 | ||
| 38 | #define TEGRA_POWERGATE_C0NC 15 | ||
| 39 | #define TEGRA_POWERGATE_C1NC 16 | ||
| 40 | #define TEGRA_POWERGATE_DIS 18 | ||
| 41 | #define TEGRA_POWERGATE_DISB 19 | ||
| 42 | #define TEGRA_POWERGATE_XUSBA 20 | ||
| 43 | #define TEGRA_POWERGATE_XUSBB 21 | ||
| 44 | #define TEGRA_POWERGATE_XUSBC 22 | ||
| 37 | 45 | ||
| 38 | #define TEGRA_POWERGATE_CPU0 TEGRA_POWERGATE_CPU | ||
| 39 | #define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D | 46 | #define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D |
| 40 | 47 | ||
| 41 | int tegra_powergate_is_powered(int id); | 48 | int tegra_powergate_is_powered(int id); |
diff --git a/include/linux/thinkpad_acpi.h b/include/linux/thinkpad_acpi.h new file mode 100644 index 000000000000..361de59a2285 --- /dev/null +++ b/include/linux/thinkpad_acpi.h | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | #ifndef __THINKPAD_ACPI_H__ | ||
| 2 | #define __THINKPAD_ACPI_H__ | ||
| 3 | |||
| 4 | /* These two functions return 0 if success, or negative error code | ||
| 5 | (e g -ENODEV if no led present) */ | ||
| 6 | |||
| 7 | enum { | ||
| 8 | TPACPI_LED_MUTE, | ||
| 9 | TPACPI_LED_MICMUTE, | ||
| 10 | TPACPI_LED_MAX, | ||
| 11 | }; | ||
| 12 | |||
| 13 | int tpacpi_led_set(int whichled, bool on); | ||
| 14 | |||
| 15 | #endif | ||
diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h index e7e04736802f..fddbe2023a5d 100644 --- a/include/linux/thread_info.h +++ b/include/linux/thread_info.h | |||
| @@ -104,8 +104,21 @@ static inline int test_ti_thread_flag(struct thread_info *ti, int flag) | |||
| 104 | #define test_thread_flag(flag) \ | 104 | #define test_thread_flag(flag) \ |
| 105 | test_ti_thread_flag(current_thread_info(), flag) | 105 | test_ti_thread_flag(current_thread_info(), flag) |
| 106 | 106 | ||
| 107 | #define set_need_resched() set_thread_flag(TIF_NEED_RESCHED) | 107 | static inline __deprecated void set_need_resched(void) |
| 108 | #define clear_need_resched() clear_thread_flag(TIF_NEED_RESCHED) | 108 | { |
| 109 | /* | ||
| 110 | * Use of this function in deprecated. | ||
| 111 | * | ||
| 112 | * As of this writing there are only a few users in the DRM tree left | ||
| 113 | * all of which are wrong and can be removed without causing too much | ||
| 114 | * grief. | ||
| 115 | * | ||
| 116 | * The DRM people are aware and are working on removing the last few | ||
| 117 | * instances. | ||
| 118 | */ | ||
| 119 | } | ||
| 120 | |||
| 121 | #define tif_need_resched() test_thread_flag(TIF_NEED_RESCHED) | ||
| 109 | 122 | ||
| 110 | #if defined TIF_RESTORE_SIGMASK && !defined HAVE_SET_RESTORE_SIGMASK | 123 | #if defined TIF_RESTORE_SIGMASK && !defined HAVE_SET_RESTORE_SIGMASK |
| 111 | /* | 124 | /* |
diff --git a/include/linux/topology.h b/include/linux/topology.h index d3cf0d6e7712..12ae6ce997d6 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
| @@ -106,6 +106,8 @@ int arch_update_cpu_topology(void); | |||
| 106 | .last_balance = jiffies, \ | 106 | .last_balance = jiffies, \ |
| 107 | .balance_interval = 1, \ | 107 | .balance_interval = 1, \ |
| 108 | .smt_gain = 1178, /* 15% */ \ | 108 | .smt_gain = 1178, /* 15% */ \ |
| 109 | .max_newidle_lb_cost = 0, \ | ||
| 110 | .next_decay_max_lb_cost = jiffies, \ | ||
| 109 | } | 111 | } |
| 110 | #endif | 112 | #endif |
| 111 | #endif /* CONFIG_SCHED_SMT */ | 113 | #endif /* CONFIG_SCHED_SMT */ |
| @@ -135,6 +137,8 @@ int arch_update_cpu_topology(void); | |||
| 135 | , \ | 137 | , \ |
| 136 | .last_balance = jiffies, \ | 138 | .last_balance = jiffies, \ |
| 137 | .balance_interval = 1, \ | 139 | .balance_interval = 1, \ |
| 140 | .max_newidle_lb_cost = 0, \ | ||
| 141 | .next_decay_max_lb_cost = jiffies, \ | ||
| 138 | } | 142 | } |
| 139 | #endif | 143 | #endif |
| 140 | #endif /* CONFIG_SCHED_MC */ | 144 | #endif /* CONFIG_SCHED_MC */ |
| @@ -166,6 +170,8 @@ int arch_update_cpu_topology(void); | |||
| 166 | , \ | 170 | , \ |
| 167 | .last_balance = jiffies, \ | 171 | .last_balance = jiffies, \ |
| 168 | .balance_interval = 1, \ | 172 | .balance_interval = 1, \ |
| 173 | .max_newidle_lb_cost = 0, \ | ||
| 174 | .next_decay_max_lb_cost = jiffies, \ | ||
| 169 | } | 175 | } |
| 170 | #endif | 176 | #endif |
| 171 | 177 | ||
diff --git a/include/linux/tty.h b/include/linux/tty.h index 64f864651d86..97d660ed70c1 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
| @@ -180,7 +180,6 @@ struct tty_port_operations { | |||
| 180 | IFF the port was initialized. Do not use to free resources. Called | 180 | IFF the port was initialized. Do not use to free resources. Called |
| 181 | under the port mutex to serialize against activate/shutdowns */ | 181 | under the port mutex to serialize against activate/shutdowns */ |
| 182 | void (*shutdown)(struct tty_port *port); | 182 | void (*shutdown)(struct tty_port *port); |
| 183 | void (*drop)(struct tty_port *port); | ||
| 184 | /* Called under the port mutex from tty_port_open, serialized using | 183 | /* Called under the port mutex from tty_port_open, serialized using |
| 185 | the port mutex */ | 184 | the port mutex */ |
| 186 | /* FIXME: long term getting the tty argument *out* of this would be | 185 | /* FIXME: long term getting the tty argument *out* of this would be |
| @@ -672,31 +671,17 @@ static inline void tty_wait_until_sent_from_close(struct tty_struct *tty, | |||
| 672 | #define wait_event_interruptible_tty(tty, wq, condition) \ | 671 | #define wait_event_interruptible_tty(tty, wq, condition) \ |
| 673 | ({ \ | 672 | ({ \ |
| 674 | int __ret = 0; \ | 673 | int __ret = 0; \ |
| 675 | if (!(condition)) { \ | 674 | if (!(condition)) \ |
| 676 | __wait_event_interruptible_tty(tty, wq, condition, __ret); \ | 675 | __ret = __wait_event_interruptible_tty(tty, wq, \ |
| 677 | } \ | 676 | condition); \ |
| 678 | __ret; \ | 677 | __ret; \ |
| 679 | }) | 678 | }) |
| 680 | 679 | ||
| 681 | #define __wait_event_interruptible_tty(tty, wq, condition, ret) \ | 680 | #define __wait_event_interruptible_tty(tty, wq, condition) \ |
| 682 | do { \ | 681 | ___wait_event(wq, condition, TASK_INTERRUPTIBLE, 0, 0, \ |
| 683 | DEFINE_WAIT(__wait); \ | 682 | tty_unlock(tty); \ |
| 684 | \ | ||
| 685 | for (;;) { \ | ||
| 686 | prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE); \ | ||
| 687 | if (condition) \ | ||
| 688 | break; \ | ||
| 689 | if (!signal_pending(current)) { \ | ||
| 690 | tty_unlock(tty); \ | ||
| 691 | schedule(); \ | 683 | schedule(); \ |
| 692 | tty_lock(tty); \ | 684 | tty_lock(tty)) |
| 693 | continue; \ | ||
| 694 | } \ | ||
| 695 | ret = -ERESTARTSYS; \ | ||
| 696 | break; \ | ||
| 697 | } \ | ||
| 698 | finish_wait(&wq, &__wait); \ | ||
| 699 | } while (0) | ||
| 700 | 685 | ||
| 701 | #ifdef CONFIG_PROC_FS | 686 | #ifdef CONFIG_PROC_FS |
| 702 | extern void proc_tty_register_driver(struct tty_driver *); | 687 | extern void proc_tty_register_driver(struct tty_driver *); |
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h index 5ca0951e1855..9d8cf056e661 100644 --- a/include/linux/uaccess.h +++ b/include/linux/uaccess.h | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | */ | 15 | */ |
| 16 | static inline void pagefault_disable(void) | 16 | static inline void pagefault_disable(void) |
| 17 | { | 17 | { |
| 18 | inc_preempt_count(); | 18 | preempt_count_inc(); |
| 19 | /* | 19 | /* |
| 20 | * make sure to have issued the store before a pagefault | 20 | * make sure to have issued the store before a pagefault |
| 21 | * can hit. | 21 | * can hit. |
| @@ -30,11 +30,7 @@ static inline void pagefault_enable(void) | |||
| 30 | * the pagefault handler again. | 30 | * the pagefault handler again. |
| 31 | */ | 31 | */ |
| 32 | barrier(); | 32 | barrier(); |
| 33 | dec_preempt_count(); | 33 | preempt_count_dec(); |
| 34 | /* | ||
| 35 | * make sure we do.. | ||
| 36 | */ | ||
| 37 | barrier(); | ||
| 38 | preempt_check_resched(); | 34 | preempt_check_resched(); |
| 39 | } | 35 | } |
| 40 | 36 | ||
diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h index 06f28beed7c2..319eae70fe84 100644 --- a/include/linux/uprobes.h +++ b/include/linux/uprobes.h | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | struct vm_area_struct; | 30 | struct vm_area_struct; |
| 31 | struct mm_struct; | 31 | struct mm_struct; |
| 32 | struct inode; | 32 | struct inode; |
| 33 | struct notifier_block; | ||
| 33 | 34 | ||
| 34 | #ifdef CONFIG_ARCH_SUPPORTS_UPROBES | 35 | #ifdef CONFIG_ARCH_SUPPORTS_UPROBES |
| 35 | # include <asm/uprobes.h> | 36 | # include <asm/uprobes.h> |
| @@ -108,6 +109,7 @@ extern int __weak set_swbp(struct arch_uprobe *aup, struct mm_struct *mm, unsign | |||
| 108 | extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); | 109 | extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); |
| 109 | extern bool __weak is_swbp_insn(uprobe_opcode_t *insn); | 110 | extern bool __weak is_swbp_insn(uprobe_opcode_t *insn); |
| 110 | extern bool __weak is_trap_insn(uprobe_opcode_t *insn); | 111 | extern bool __weak is_trap_insn(uprobe_opcode_t *insn); |
| 112 | extern int uprobe_write_opcode(struct mm_struct *mm, unsigned long vaddr, uprobe_opcode_t); | ||
| 111 | extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); | 113 | extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); |
| 112 | extern int uprobe_apply(struct inode *inode, loff_t offset, struct uprobe_consumer *uc, bool); | 114 | extern int uprobe_apply(struct inode *inode, loff_t offset, struct uprobe_consumer *uc, bool); |
| 113 | extern void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); | 115 | extern void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); |
| @@ -117,14 +119,21 @@ extern void uprobe_start_dup_mmap(void); | |||
| 117 | extern void uprobe_end_dup_mmap(void); | 119 | extern void uprobe_end_dup_mmap(void); |
| 118 | extern void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm); | 120 | extern void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm); |
| 119 | extern void uprobe_free_utask(struct task_struct *t); | 121 | extern void uprobe_free_utask(struct task_struct *t); |
| 120 | extern void uprobe_copy_process(struct task_struct *t); | 122 | extern void uprobe_copy_process(struct task_struct *t, unsigned long flags); |
| 121 | extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs); | 123 | extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs); |
| 122 | extern int uprobe_post_sstep_notifier(struct pt_regs *regs); | 124 | extern int uprobe_post_sstep_notifier(struct pt_regs *regs); |
| 123 | extern int uprobe_pre_sstep_notifier(struct pt_regs *regs); | 125 | extern int uprobe_pre_sstep_notifier(struct pt_regs *regs); |
| 124 | extern void uprobe_notify_resume(struct pt_regs *regs); | 126 | extern void uprobe_notify_resume(struct pt_regs *regs); |
| 125 | extern bool uprobe_deny_signal(void); | 127 | extern bool uprobe_deny_signal(void); |
| 126 | extern bool __weak arch_uprobe_skip_sstep(struct arch_uprobe *aup, struct pt_regs *regs); | 128 | extern bool arch_uprobe_skip_sstep(struct arch_uprobe *aup, struct pt_regs *regs); |
| 127 | extern void uprobe_clear_state(struct mm_struct *mm); | 129 | extern void uprobe_clear_state(struct mm_struct *mm); |
| 130 | extern int arch_uprobe_analyze_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long addr); | ||
| 131 | extern int arch_uprobe_pre_xol(struct arch_uprobe *aup, struct pt_regs *regs); | ||
| 132 | extern int arch_uprobe_post_xol(struct arch_uprobe *aup, struct pt_regs *regs); | ||
| 133 | extern bool arch_uprobe_xol_was_trapped(struct task_struct *tsk); | ||
| 134 | extern int arch_uprobe_exception_notify(struct notifier_block *self, unsigned long val, void *data); | ||
| 135 | extern void arch_uprobe_abort_xol(struct arch_uprobe *aup, struct pt_regs *regs); | ||
| 136 | extern unsigned long arch_uretprobe_hijack_return_addr(unsigned long trampoline_vaddr, struct pt_regs *regs); | ||
| 128 | #else /* !CONFIG_UPROBES */ | 137 | #else /* !CONFIG_UPROBES */ |
| 129 | struct uprobes_state { | 138 | struct uprobes_state { |
| 130 | }; | 139 | }; |
| @@ -174,7 +183,7 @@ static inline unsigned long uprobe_get_swbp_addr(struct pt_regs *regs) | |||
| 174 | static inline void uprobe_free_utask(struct task_struct *t) | 183 | static inline void uprobe_free_utask(struct task_struct *t) |
| 175 | { | 184 | { |
| 176 | } | 185 | } |
| 177 | static inline void uprobe_copy_process(struct task_struct *t) | 186 | static inline void uprobe_copy_process(struct task_struct *t, unsigned long flags) |
| 178 | { | 187 | { |
| 179 | } | 188 | } |
| 180 | static inline void uprobe_clear_state(struct mm_struct *mm) | 189 | static inline void uprobe_clear_state(struct mm_struct *mm) |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 001629cd1a97..7454865ad148 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
| @@ -475,7 +475,8 @@ struct usb3_lpm_parameters { | |||
| 475 | * @lpm_capable: device supports LPM | 475 | * @lpm_capable: device supports LPM |
| 476 | * @usb2_hw_lpm_capable: device can perform USB2 hardware LPM | 476 | * @usb2_hw_lpm_capable: device can perform USB2 hardware LPM |
| 477 | * @usb2_hw_lpm_besl_capable: device can perform USB2 hardware BESL LPM | 477 | * @usb2_hw_lpm_besl_capable: device can perform USB2 hardware BESL LPM |
| 478 | * @usb2_hw_lpm_enabled: USB2 hardware LPM enabled | 478 | * @usb2_hw_lpm_enabled: USB2 hardware LPM is enabled |
| 479 | * @usb2_hw_lpm_allowed: Userspace allows USB 2.0 LPM to be enabled | ||
| 479 | * @usb3_lpm_enabled: USB3 hardware LPM enabled | 480 | * @usb3_lpm_enabled: USB3 hardware LPM enabled |
| 480 | * @string_langid: language ID for strings | 481 | * @string_langid: language ID for strings |
| 481 | * @product: iProduct string, if present (static) | 482 | * @product: iProduct string, if present (static) |
| @@ -548,6 +549,7 @@ struct usb_device { | |||
| 548 | unsigned usb2_hw_lpm_capable:1; | 549 | unsigned usb2_hw_lpm_capable:1; |
| 549 | unsigned usb2_hw_lpm_besl_capable:1; | 550 | unsigned usb2_hw_lpm_besl_capable:1; |
| 550 | unsigned usb2_hw_lpm_enabled:1; | 551 | unsigned usb2_hw_lpm_enabled:1; |
| 552 | unsigned usb2_hw_lpm_allowed:1; | ||
| 551 | unsigned usb3_lpm_enabled:1; | 553 | unsigned usb3_lpm_enabled:1; |
| 552 | int string_langid; | 554 | int string_langid; |
| 553 | 555 | ||
| @@ -702,7 +704,7 @@ extern int usb_alloc_streams(struct usb_interface *interface, | |||
| 702 | unsigned int num_streams, gfp_t mem_flags); | 704 | unsigned int num_streams, gfp_t mem_flags); |
| 703 | 705 | ||
| 704 | /* Reverts a group of bulk endpoints back to not using stream IDs. */ | 706 | /* Reverts a group of bulk endpoints back to not using stream IDs. */ |
| 705 | extern void usb_free_streams(struct usb_interface *interface, | 707 | extern int usb_free_streams(struct usb_interface *interface, |
| 706 | struct usb_host_endpoint **eps, unsigned int num_eps, | 708 | struct usb_host_endpoint **eps, unsigned int num_eps, |
| 707 | gfp_t mem_flags); | 709 | gfp_t mem_flags); |
| 708 | 710 | ||
| @@ -1209,11 +1211,13 @@ struct usb_anchor { | |||
| 1209 | struct list_head urb_list; | 1211 | struct list_head urb_list; |
| 1210 | wait_queue_head_t wait; | 1212 | wait_queue_head_t wait; |
| 1211 | spinlock_t lock; | 1213 | spinlock_t lock; |
| 1214 | atomic_t suspend_wakeups; | ||
| 1212 | unsigned int poisoned:1; | 1215 | unsigned int poisoned:1; |
| 1213 | }; | 1216 | }; |
| 1214 | 1217 | ||
| 1215 | static inline void init_usb_anchor(struct usb_anchor *anchor) | 1218 | static inline void init_usb_anchor(struct usb_anchor *anchor) |
| 1216 | { | 1219 | { |
| 1220 | memset(anchor, 0, sizeof(*anchor)); | ||
| 1217 | INIT_LIST_HEAD(&anchor->urb_list); | 1221 | INIT_LIST_HEAD(&anchor->urb_list); |
| 1218 | init_waitqueue_head(&anchor->wait); | 1222 | init_waitqueue_head(&anchor->wait); |
| 1219 | spin_lock_init(&anchor->lock); | 1223 | spin_lock_init(&anchor->lock); |
| @@ -1574,6 +1578,8 @@ extern void usb_kill_anchored_urbs(struct usb_anchor *anchor); | |||
| 1574 | extern void usb_poison_anchored_urbs(struct usb_anchor *anchor); | 1578 | extern void usb_poison_anchored_urbs(struct usb_anchor *anchor); |
| 1575 | extern void usb_unpoison_anchored_urbs(struct usb_anchor *anchor); | 1579 | extern void usb_unpoison_anchored_urbs(struct usb_anchor *anchor); |
| 1576 | extern void usb_unlink_anchored_urbs(struct usb_anchor *anchor); | 1580 | extern void usb_unlink_anchored_urbs(struct usb_anchor *anchor); |
| 1581 | extern void usb_anchor_suspend_wakeups(struct usb_anchor *anchor); | ||
| 1582 | extern void usb_anchor_resume_wakeups(struct usb_anchor *anchor); | ||
| 1577 | extern void usb_anchor_urb(struct urb *urb, struct usb_anchor *anchor); | 1583 | extern void usb_anchor_urb(struct urb *urb, struct usb_anchor *anchor); |
| 1578 | extern void usb_unanchor_urb(struct urb *urb); | 1584 | extern void usb_unanchor_urb(struct urb *urb); |
| 1579 | extern int usb_wait_anchor_empty_timeout(struct usb_anchor *anchor, | 1585 | extern int usb_wait_anchor_empty_timeout(struct usb_anchor *anchor, |
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 75efc45eaa2f..b8aba196f7f1 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
| @@ -73,6 +73,7 @@ struct giveback_urb_bh { | |||
| 73 | spinlock_t lock; | 73 | spinlock_t lock; |
| 74 | struct list_head head; | 74 | struct list_head head; |
| 75 | struct tasklet_struct bh; | 75 | struct tasklet_struct bh; |
| 76 | struct usb_host_endpoint *completing_ep; | ||
| 76 | }; | 77 | }; |
| 77 | 78 | ||
| 78 | struct usb_hcd { | 79 | struct usb_hcd { |
| @@ -140,6 +141,7 @@ struct usb_hcd { | |||
| 140 | unsigned wireless:1; /* Wireless USB HCD */ | 141 | unsigned wireless:1; /* Wireless USB HCD */ |
| 141 | unsigned authorized_default:1; | 142 | unsigned authorized_default:1; |
| 142 | unsigned has_tt:1; /* Integrated TT in root hub */ | 143 | unsigned has_tt:1; /* Integrated TT in root hub */ |
| 144 | unsigned amd_resume_bug:1; /* AMD remote wakeup quirk */ | ||
| 143 | 145 | ||
| 144 | unsigned int irq; /* irq allocated */ | 146 | unsigned int irq; /* irq allocated */ |
| 145 | void __iomem *regs; /* device memory/io */ | 147 | void __iomem *regs; /* device memory/io */ |
| @@ -378,6 +380,12 @@ static inline int hcd_giveback_urb_in_bh(struct usb_hcd *hcd) | |||
| 378 | return hcd->driver->flags & HCD_BH; | 380 | return hcd->driver->flags & HCD_BH; |
| 379 | } | 381 | } |
| 380 | 382 | ||
| 383 | static inline bool hcd_periodic_completion_in_progress(struct usb_hcd *hcd, | ||
| 384 | struct usb_host_endpoint *ep) | ||
| 385 | { | ||
| 386 | return hcd->high_prio_bh.completing_ep == ep; | ||
| 387 | } | ||
| 388 | |||
| 381 | extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); | 389 | extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); |
| 382 | extern int usb_hcd_check_unlink_urb(struct usb_hcd *hcd, struct urb *urb, | 390 | extern int usb_hcd_check_unlink_urb(struct usb_hcd *hcd, struct urb *urb, |
| 383 | int status); | 391 | int status); |
| @@ -428,6 +436,8 @@ extern int usb_hcd_pci_probe(struct pci_dev *dev, | |||
| 428 | extern void usb_hcd_pci_remove(struct pci_dev *dev); | 436 | extern void usb_hcd_pci_remove(struct pci_dev *dev); |
| 429 | extern void usb_hcd_pci_shutdown(struct pci_dev *dev); | 437 | extern void usb_hcd_pci_shutdown(struct pci_dev *dev); |
| 430 | 438 | ||
| 439 | extern int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *dev); | ||
| 440 | |||
| 431 | #ifdef CONFIG_PM | 441 | #ifdef CONFIG_PM |
| 432 | extern const struct dev_pm_ops usb_hcd_pci_pm_ops; | 442 | extern const struct dev_pm_ops usb_hcd_pci_pm_ops; |
| 433 | #endif | 443 | #endif |
| @@ -496,6 +506,7 @@ struct usb_tt { | |||
| 496 | struct usb_device *hub; /* upstream highspeed hub */ | 506 | struct usb_device *hub; /* upstream highspeed hub */ |
| 497 | int multi; /* true means one TT per port */ | 507 | int multi; /* true means one TT per port */ |
| 498 | unsigned think_time; /* think time in ns */ | 508 | unsigned think_time; /* think time in ns */ |
| 509 | void *hcpriv; /* HCD private data */ | ||
| 499 | 510 | ||
| 500 | /* for control/bulk error recovery (CLEAR_TT_BUFFER) */ | 511 | /* for control/bulk error recovery (CLEAR_TT_BUFFER) */ |
| 501 | spinlock_t lock; | 512 | spinlock_t lock; |
| @@ -554,9 +565,8 @@ extern void usb_ep0_reinit(struct usb_device *); | |||
| 554 | * of (7/6 * 8 * bytecount) = 9.33 * bytecount */ | 565 | * of (7/6 * 8 * bytecount) = 9.33 * bytecount */ |
| 555 | /* bytecount = data payload byte count */ | 566 | /* bytecount = data payload byte count */ |
| 556 | 567 | ||
| 557 | #define NS_TO_US(ns) ((ns + 500L) / 1000L) | 568 | #define NS_TO_US(ns) DIV_ROUND_UP(ns, 1000L) |
| 558 | /* convert & round nanoseconds to microseconds */ | 569 | /* convert nanoseconds to microseconds, rounding up */ |
| 559 | |||
| 560 | 570 | ||
| 561 | /* | 571 | /* |
| 562 | * Full/low speed bandwidth allocation constants/support. | 572 | * Full/low speed bandwidth allocation constants/support. |
diff --git a/include/linux/usb/intel_mid_otg.h b/include/linux/usb/intel_mid_otg.h deleted file mode 100644 index 756cf5543ffd..000000000000 --- a/include/linux/usb/intel_mid_otg.h +++ /dev/null | |||
| @@ -1,180 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Intel MID (Langwell/Penwell) USB OTG Transceiver driver | ||
| 3 | * Copyright (C) 2008 - 2010, Intel Corporation. | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms and conditions of the GNU General Public License, | ||
| 7 | * version 2, as published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 12 | * more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License along with | ||
| 15 | * this program; if not, write to the Free Software Foundation, Inc., | ||
| 16 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 17 | * | ||
| 18 | */ | ||
| 19 | |||
| 20 | #ifndef __INTEL_MID_OTG_H | ||
| 21 | #define __INTEL_MID_OTG_H | ||
| 22 | |||
| 23 | #include <linux/pm.h> | ||
| 24 | #include <linux/usb/otg.h> | ||
| 25 | #include <linux/notifier.h> | ||
| 26 | |||
| 27 | struct intel_mid_otg_xceiv; | ||
| 28 | |||
| 29 | /* This is a common data structure for Intel MID platform to | ||
| 30 | * save values of the OTG state machine */ | ||
| 31 | struct otg_hsm { | ||
| 32 | /* Input */ | ||
| 33 | int a_bus_resume; | ||
| 34 | int a_bus_suspend; | ||
| 35 | int a_conn; | ||
| 36 | int a_sess_vld; | ||
| 37 | int a_srp_det; | ||
| 38 | int a_vbus_vld; | ||
| 39 | int b_bus_resume; | ||
| 40 | int b_bus_suspend; | ||
| 41 | int b_conn; | ||
| 42 | int b_se0_srp; | ||
| 43 | int b_ssend_srp; | ||
| 44 | int b_sess_end; | ||
| 45 | int b_sess_vld; | ||
| 46 | int id; | ||
| 47 | /* id values */ | ||
| 48 | #define ID_B 0x05 | ||
| 49 | #define ID_A 0x04 | ||
| 50 | #define ID_ACA_C 0x03 | ||
| 51 | #define ID_ACA_B 0x02 | ||
| 52 | #define ID_ACA_A 0x01 | ||
| 53 | int power_up; | ||
| 54 | int adp_change; | ||
| 55 | int test_device; | ||
| 56 | |||
| 57 | /* Internal variables */ | ||
| 58 | int a_set_b_hnp_en; | ||
| 59 | int b_srp_done; | ||
| 60 | int b_hnp_enable; | ||
| 61 | int hnp_poll_enable; | ||
| 62 | |||
| 63 | /* Timeout indicator for timers */ | ||
| 64 | int a_wait_vrise_tmout; | ||
| 65 | int a_wait_bcon_tmout; | ||
| 66 | int a_aidl_bdis_tmout; | ||
| 67 | int a_bidl_adis_tmout; | ||
| 68 | int a_bidl_adis_tmr; | ||
| 69 | int a_wait_vfall_tmout; | ||
| 70 | int b_ase0_brst_tmout; | ||
| 71 | int b_bus_suspend_tmout; | ||
| 72 | int b_srp_init_tmout; | ||
| 73 | int b_srp_fail_tmout; | ||
| 74 | int b_srp_fail_tmr; | ||
| 75 | int b_adp_sense_tmout; | ||
| 76 | |||
| 77 | /* Informative variables */ | ||
| 78 | int a_bus_drop; | ||
| 79 | int a_bus_req; | ||
| 80 | int a_clr_err; | ||
| 81 | int b_bus_req; | ||
| 82 | int a_suspend_req; | ||
| 83 | int b_bus_suspend_vld; | ||
| 84 | |||
| 85 | /* Output */ | ||
| 86 | int drv_vbus; | ||
| 87 | int loc_conn; | ||
| 88 | int loc_sof; | ||
| 89 | |||
| 90 | /* Others */ | ||
| 91 | int vbus_srp_up; | ||
| 92 | }; | ||
| 93 | |||
| 94 | /* must provide ULPI access function to read/write registers implemented in | ||
| 95 | * ULPI address space */ | ||
| 96 | struct iotg_ulpi_access_ops { | ||
| 97 | int (*read)(struct intel_mid_otg_xceiv *iotg, u8 reg, u8 *val); | ||
| 98 | int (*write)(struct intel_mid_otg_xceiv *iotg, u8 reg, u8 val); | ||
| 99 | }; | ||
| 100 | |||
| 101 | #define OTG_A_DEVICE 0x0 | ||
| 102 | #define OTG_B_DEVICE 0x1 | ||
| 103 | |||
| 104 | /* | ||
| 105 | * the Intel MID (Langwell/Penwell) otg transceiver driver needs to interact | ||
| 106 | * with device and host drivers to implement the USB OTG related feature. More | ||
| 107 | * function members are added based on usb_phy data structure for this | ||
| 108 | * purpose. | ||
| 109 | */ | ||
| 110 | struct intel_mid_otg_xceiv { | ||
| 111 | struct usb_phy otg; | ||
| 112 | struct otg_hsm hsm; | ||
| 113 | |||
| 114 | /* base address */ | ||
| 115 | void __iomem *base; | ||
| 116 | |||
| 117 | /* ops to access ulpi */ | ||
| 118 | struct iotg_ulpi_access_ops ulpi_ops; | ||
| 119 | |||
| 120 | /* atomic notifier for interrupt context */ | ||
| 121 | struct atomic_notifier_head iotg_notifier; | ||
| 122 | |||
| 123 | /* start/stop USB Host function */ | ||
| 124 | int (*start_host)(struct intel_mid_otg_xceiv *iotg); | ||
| 125 | int (*stop_host)(struct intel_mid_otg_xceiv *iotg); | ||
| 126 | |||
| 127 | /* start/stop USB Peripheral function */ | ||
| 128 | int (*start_peripheral)(struct intel_mid_otg_xceiv *iotg); | ||
| 129 | int (*stop_peripheral)(struct intel_mid_otg_xceiv *iotg); | ||
| 130 | |||
| 131 | /* start/stop ADP sense/probe function */ | ||
| 132 | int (*set_adp_probe)(struct intel_mid_otg_xceiv *iotg, | ||
| 133 | bool enabled, int dev); | ||
| 134 | int (*set_adp_sense)(struct intel_mid_otg_xceiv *iotg, | ||
| 135 | bool enabled); | ||
| 136 | |||
| 137 | #ifdef CONFIG_PM | ||
| 138 | /* suspend/resume USB host function */ | ||
| 139 | int (*suspend_host)(struct intel_mid_otg_xceiv *iotg, | ||
| 140 | pm_message_t message); | ||
| 141 | int (*resume_host)(struct intel_mid_otg_xceiv *iotg); | ||
| 142 | |||
| 143 | int (*suspend_peripheral)(struct intel_mid_otg_xceiv *iotg, | ||
| 144 | pm_message_t message); | ||
| 145 | int (*resume_peripheral)(struct intel_mid_otg_xceiv *iotg); | ||
| 146 | #endif | ||
| 147 | |||
| 148 | }; | ||
| 149 | static inline | ||
| 150 | struct intel_mid_otg_xceiv *otg_to_mid_xceiv(struct usb_phy *otg) | ||
| 151 | { | ||
| 152 | return container_of(otg, struct intel_mid_otg_xceiv, otg); | ||
| 153 | } | ||
| 154 | |||
| 155 | #define MID_OTG_NOTIFY_CONNECT 0x0001 | ||
| 156 | #define MID_OTG_NOTIFY_DISCONN 0x0002 | ||
| 157 | #define MID_OTG_NOTIFY_HSUSPEND 0x0003 | ||
| 158 | #define MID_OTG_NOTIFY_HRESUME 0x0004 | ||
| 159 | #define MID_OTG_NOTIFY_CSUSPEND 0x0005 | ||
| 160 | #define MID_OTG_NOTIFY_CRESUME 0x0006 | ||
| 161 | #define MID_OTG_NOTIFY_HOSTADD 0x0007 | ||
| 162 | #define MID_OTG_NOTIFY_HOSTREMOVE 0x0008 | ||
| 163 | #define MID_OTG_NOTIFY_CLIENTADD 0x0009 | ||
| 164 | #define MID_OTG_NOTIFY_CLIENTREMOVE 0x000a | ||
| 165 | |||
| 166 | static inline int | ||
| 167 | intel_mid_otg_register_notifier(struct intel_mid_otg_xceiv *iotg, | ||
| 168 | struct notifier_block *nb) | ||
| 169 | { | ||
| 170 | return atomic_notifier_chain_register(&iotg->iotg_notifier, nb); | ||
| 171 | } | ||
| 172 | |||
| 173 | static inline void | ||
| 174 | intel_mid_otg_unregister_notifier(struct intel_mid_otg_xceiv *iotg, | ||
| 175 | struct notifier_block *nb) | ||
| 176 | { | ||
| 177 | atomic_notifier_chain_unregister(&iotg->iotg_notifier, nb); | ||
| 178 | } | ||
| 179 | |||
| 180 | #endif /* __INTEL_MID_OTG_H */ | ||
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h index 053c26841cc3..eb505250940a 100644 --- a/include/linux/usb/musb.h +++ b/include/linux/usb/musb.h | |||
| @@ -99,8 +99,6 @@ struct musb_hdrc_platform_data { | |||
| 99 | /* MUSB_HOST, MUSB_PERIPHERAL, or MUSB_OTG */ | 99 | /* MUSB_HOST, MUSB_PERIPHERAL, or MUSB_OTG */ |
| 100 | u8 mode; | 100 | u8 mode; |
| 101 | 101 | ||
| 102 | u8 has_mailbox:1; | ||
| 103 | |||
| 104 | /* for clk_get() */ | 102 | /* for clk_get() */ |
| 105 | const char *clock; | 103 | const char *clock; |
| 106 | 104 | ||
diff --git a/include/linux/usb/omap_control_usb.h b/include/linux/usb/omap_control_usb.h index 27b5b8c931b0..596b01918813 100644 --- a/include/linux/usb/omap_control_usb.h +++ b/include/linux/usb/omap_control_usb.h | |||
| @@ -19,20 +19,23 @@ | |||
| 19 | #ifndef __OMAP_CONTROL_USB_H__ | 19 | #ifndef __OMAP_CONTROL_USB_H__ |
| 20 | #define __OMAP_CONTROL_USB_H__ | 20 | #define __OMAP_CONTROL_USB_H__ |
| 21 | 21 | ||
| 22 | enum omap_control_usb_type { | ||
| 23 | OMAP_CTRL_TYPE_OTGHS = 1, /* Mailbox OTGHS_CONTROL */ | ||
| 24 | OMAP_CTRL_TYPE_USB2, /* USB2_PHY, power down in CONTROL_DEV_CONF */ | ||
| 25 | OMAP_CTRL_TYPE_PIPE3, /* PIPE3 PHY, DPLL & seperate Rx/Tx power */ | ||
| 26 | OMAP_CTRL_TYPE_DRA7USB2, /* USB2 PHY, power and power_aux e.g. DRA7 */ | ||
| 27 | }; | ||
| 28 | |||
| 22 | struct omap_control_usb { | 29 | struct omap_control_usb { |
| 23 | struct device *dev; | 30 | struct device *dev; |
| 24 | 31 | ||
| 25 | u32 __iomem *dev_conf; | ||
| 26 | u32 __iomem *otghs_control; | 32 | u32 __iomem *otghs_control; |
| 27 | u32 __iomem *phy_power; | 33 | u32 __iomem *power; |
| 34 | u32 __iomem *power_aux; | ||
| 28 | 35 | ||
| 29 | struct clk *sys_clk; | 36 | struct clk *sys_clk; |
| 30 | 37 | ||
| 31 | u32 type; | 38 | enum omap_control_usb_type type; |
| 32 | }; | ||
| 33 | |||
| 34 | struct omap_control_usb_platform_data { | ||
| 35 | u8 type; | ||
| 36 | }; | 39 | }; |
| 37 | 40 | ||
| 38 | enum omap_control_usb_mode { | 41 | enum omap_control_usb_mode { |
| @@ -42,10 +45,6 @@ enum omap_control_usb_mode { | |||
| 42 | USB_MODE_DISCONNECT, | 45 | USB_MODE_DISCONNECT, |
| 43 | }; | 46 | }; |
| 44 | 47 | ||
| 45 | /* To differentiate ctrl module IP having either mailbox or USB3 PHY power */ | ||
| 46 | #define OMAP_CTRL_DEV_TYPE1 0x1 | ||
| 47 | #define OMAP_CTRL_DEV_TYPE2 0x2 | ||
| 48 | |||
| 49 | #define OMAP_CTRL_DEV_PHY_PD BIT(0) | 48 | #define OMAP_CTRL_DEV_PHY_PD BIT(0) |
| 50 | 49 | ||
| 51 | #define OMAP_CTRL_DEV_AVALID BIT(0) | 50 | #define OMAP_CTRL_DEV_AVALID BIT(0) |
| @@ -63,26 +62,18 @@ enum omap_control_usb_mode { | |||
| 63 | #define OMAP_CTRL_USB3_PHY_TX_RX_POWERON 0x3 | 62 | #define OMAP_CTRL_USB3_PHY_TX_RX_POWERON 0x3 |
| 64 | #define OMAP_CTRL_USB3_PHY_TX_RX_POWEROFF 0x0 | 63 | #define OMAP_CTRL_USB3_PHY_TX_RX_POWEROFF 0x0 |
| 65 | 64 | ||
| 65 | #define OMAP_CTRL_USB2_PHY_PD BIT(28) | ||
| 66 | |||
| 66 | #if IS_ENABLED(CONFIG_OMAP_CONTROL_USB) | 67 | #if IS_ENABLED(CONFIG_OMAP_CONTROL_USB) |
| 67 | extern struct device *omap_get_control_dev(void); | ||
| 68 | extern void omap_control_usb_phy_power(struct device *dev, int on); | 68 | extern void omap_control_usb_phy_power(struct device *dev, int on); |
| 69 | extern void omap_control_usb3_phy_power(struct device *dev, bool on); | ||
| 70 | extern void omap_control_usb_set_mode(struct device *dev, | 69 | extern void omap_control_usb_set_mode(struct device *dev, |
| 71 | enum omap_control_usb_mode mode); | 70 | enum omap_control_usb_mode mode); |
| 72 | #else | 71 | #else |
| 73 | static inline struct device *omap_get_control_dev(void) | ||
| 74 | { | ||
| 75 | return ERR_PTR(-ENODEV); | ||
| 76 | } | ||
| 77 | 72 | ||
| 78 | static inline void omap_control_usb_phy_power(struct device *dev, int on) | 73 | static inline void omap_control_usb_phy_power(struct device *dev, int on) |
| 79 | { | 74 | { |
| 80 | } | 75 | } |
| 81 | 76 | ||
| 82 | static inline void omap_control_usb3_phy_power(struct device *dev, int on) | ||
| 83 | { | ||
| 84 | } | ||
| 85 | |||
| 86 | static inline void omap_control_usb_set_mode(struct device *dev, | 77 | static inline void omap_control_usb_set_mode(struct device *dev, |
| 87 | enum omap_control_usb_mode mode) | 78 | enum omap_control_usb_mode mode) |
| 88 | { | 79 | { |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index d528b8045150..704a1ab8240c 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
| @@ -320,6 +320,8 @@ extern struct usb_serial_port *usb_serial_port_get_by_minor(unsigned int minor); | |||
| 320 | extern void usb_serial_put(struct usb_serial *serial); | 320 | extern void usb_serial_put(struct usb_serial *serial); |
| 321 | extern int usb_serial_generic_open(struct tty_struct *tty, | 321 | extern int usb_serial_generic_open(struct tty_struct *tty, |
| 322 | struct usb_serial_port *port); | 322 | struct usb_serial_port *port); |
| 323 | extern int usb_serial_generic_write_start(struct usb_serial_port *port, | ||
| 324 | gfp_t mem_flags); | ||
| 323 | extern int usb_serial_generic_write(struct tty_struct *tty, | 325 | extern int usb_serial_generic_write(struct tty_struct *tty, |
| 324 | struct usb_serial_port *port, const unsigned char *buf, int count); | 326 | struct usb_serial_port *port, const unsigned char *buf, int count); |
| 325 | extern void usb_serial_generic_close(struct usb_serial_port *port); | 327 | extern void usb_serial_generic_close(struct usb_serial_port *port); |
diff --git a/include/linux/usb/usb_phy_gen_xceiv.h b/include/linux/usb/usb_phy_gen_xceiv.h index 11d85b9c1b08..cc8d818a83be 100644 --- a/include/linux/usb/usb_phy_gen_xceiv.h +++ b/include/linux/usb/usb_phy_gen_xceiv.h | |||
| @@ -9,7 +9,8 @@ struct usb_phy_gen_xceiv_platform_data { | |||
| 9 | 9 | ||
| 10 | /* if set fails with -EPROBE_DEFER if can't get regulator */ | 10 | /* if set fails with -EPROBE_DEFER if can't get regulator */ |
| 11 | unsigned int needs_vcc:1; | 11 | unsigned int needs_vcc:1; |
| 12 | unsigned int needs_reset:1; | 12 | unsigned int needs_reset:1; /* deprecated */ |
| 13 | int gpio_reset; | ||
| 13 | }; | 14 | }; |
| 14 | 15 | ||
| 15 | #if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE)) | 16 | #if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE)) |
diff --git a/include/linux/usb/wusb-wa.h b/include/linux/usb/wusb-wa.h index 4ff744e2b678..c1257130769b 100644 --- a/include/linux/usb/wusb-wa.h +++ b/include/linux/usb/wusb-wa.h | |||
| @@ -142,7 +142,7 @@ enum wa_notif_type { | |||
| 142 | struct wa_notif_hdr { | 142 | struct wa_notif_hdr { |
| 143 | u8 bLength; | 143 | u8 bLength; |
| 144 | u8 bNotifyType; /* enum wa_notif_type */ | 144 | u8 bNotifyType; /* enum wa_notif_type */ |
| 145 | } __attribute__((packed)); | 145 | } __packed; |
| 146 | 146 | ||
| 147 | /** | 147 | /** |
| 148 | * HWA DN Received notification [(WUSB] section 8.5.4.2) | 148 | * HWA DN Received notification [(WUSB] section 8.5.4.2) |
| @@ -158,7 +158,7 @@ struct hwa_notif_dn { | |||
| 158 | u8 bSourceDeviceAddr; /* from errata 2005/07 */ | 158 | u8 bSourceDeviceAddr; /* from errata 2005/07 */ |
| 159 | u8 bmAttributes; | 159 | u8 bmAttributes; |
| 160 | struct wusb_dn_hdr dndata[]; | 160 | struct wusb_dn_hdr dndata[]; |
| 161 | } __attribute__((packed)); | 161 | } __packed; |
| 162 | 162 | ||
| 163 | /* [WUSB] section 8.3.3 */ | 163 | /* [WUSB] section 8.3.3 */ |
| 164 | enum wa_xfer_type { | 164 | enum wa_xfer_type { |
| @@ -167,6 +167,8 @@ enum wa_xfer_type { | |||
| 167 | WA_XFER_TYPE_ISO = 0x82, | 167 | WA_XFER_TYPE_ISO = 0x82, |
| 168 | WA_XFER_RESULT = 0x83, | 168 | WA_XFER_RESULT = 0x83, |
| 169 | WA_XFER_ABORT = 0x84, | 169 | WA_XFER_ABORT = 0x84, |
| 170 | WA_XFER_ISO_PACKET_INFO = 0xA0, | ||
| 171 | WA_XFER_ISO_PACKET_STATUS = 0xA1, | ||
| 170 | }; | 172 | }; |
| 171 | 173 | ||
| 172 | /* [WUSB] section 8.3.3 */ | 174 | /* [WUSB] section 8.3.3 */ |
| @@ -177,28 +179,47 @@ struct wa_xfer_hdr { | |||
| 177 | __le32 dwTransferID; /* Host-assigned ID */ | 179 | __le32 dwTransferID; /* Host-assigned ID */ |
| 178 | __le32 dwTransferLength; /* Length of data to xfer */ | 180 | __le32 dwTransferLength; /* Length of data to xfer */ |
| 179 | u8 bTransferSegment; | 181 | u8 bTransferSegment; |
| 180 | } __attribute__((packed)); | 182 | } __packed; |
| 181 | 183 | ||
| 182 | struct wa_xfer_ctl { | 184 | struct wa_xfer_ctl { |
| 183 | struct wa_xfer_hdr hdr; | 185 | struct wa_xfer_hdr hdr; |
| 184 | u8 bmAttribute; | 186 | u8 bmAttribute; |
| 185 | __le16 wReserved; | 187 | __le16 wReserved; |
| 186 | struct usb_ctrlrequest baSetupData; | 188 | struct usb_ctrlrequest baSetupData; |
| 187 | } __attribute__((packed)); | 189 | } __packed; |
| 188 | 190 | ||
| 189 | struct wa_xfer_bi { | 191 | struct wa_xfer_bi { |
| 190 | struct wa_xfer_hdr hdr; | 192 | struct wa_xfer_hdr hdr; |
| 191 | u8 bReserved; | 193 | u8 bReserved; |
| 192 | __le16 wReserved; | 194 | __le16 wReserved; |
| 193 | } __attribute__((packed)); | 195 | } __packed; |
| 194 | 196 | ||
| 197 | /* [WUSB] section 8.5.5 */ | ||
| 195 | struct wa_xfer_hwaiso { | 198 | struct wa_xfer_hwaiso { |
| 196 | struct wa_xfer_hdr hdr; | 199 | struct wa_xfer_hdr hdr; |
| 197 | u8 bReserved; | 200 | u8 bReserved; |
| 198 | __le16 wPresentationTime; | 201 | __le16 wPresentationTime; |
| 199 | __le32 dwNumOfPackets; | 202 | __le32 dwNumOfPackets; |
| 200 | /* FIXME: u8 pktdata[]? */ | 203 | } __packed; |
| 201 | } __attribute__((packed)); | 204 | |
| 205 | struct wa_xfer_packet_info_hwaiso { | ||
| 206 | __le16 wLength; | ||
| 207 | u8 bPacketType; | ||
| 208 | u8 bReserved; | ||
| 209 | __le16 PacketLength[0]; | ||
| 210 | } __packed; | ||
| 211 | |||
| 212 | struct wa_xfer_packet_status_len_hwaiso { | ||
| 213 | __le16 PacketLength; | ||
| 214 | __le16 PacketStatus; | ||
| 215 | } __packed; | ||
| 216 | |||
| 217 | struct wa_xfer_packet_status_hwaiso { | ||
| 218 | __le16 wLength; | ||
| 219 | u8 bPacketType; | ||
| 220 | u8 bReserved; | ||
| 221 | struct wa_xfer_packet_status_len_hwaiso PacketStatus[0]; | ||
| 222 | } __packed; | ||
| 202 | 223 | ||
| 203 | /* [WUSB] section 8.3.3.5 */ | 224 | /* [WUSB] section 8.3.3.5 */ |
| 204 | struct wa_xfer_abort { | 225 | struct wa_xfer_abort { |
| @@ -206,7 +227,7 @@ struct wa_xfer_abort { | |||
| 206 | u8 bRequestType; | 227 | u8 bRequestType; |
| 207 | __le16 wRPipe; /* RPipe index */ | 228 | __le16 wRPipe; /* RPipe index */ |
| 208 | __le32 dwTransferID; /* Host-assigned ID */ | 229 | __le32 dwTransferID; /* Host-assigned ID */ |
| 209 | } __attribute__((packed)); | 230 | } __packed; |
| 210 | 231 | ||
| 211 | /** | 232 | /** |
| 212 | * WA Transfer Complete notification ([WUSB] section 8.3.3.3) | 233 | * WA Transfer Complete notification ([WUSB] section 8.3.3.3) |
| @@ -216,7 +237,7 @@ struct wa_notif_xfer { | |||
| 216 | struct wa_notif_hdr hdr; | 237 | struct wa_notif_hdr hdr; |
| 217 | u8 bEndpoint; | 238 | u8 bEndpoint; |
| 218 | u8 Reserved; | 239 | u8 Reserved; |
| 219 | } __attribute__((packed)); | 240 | } __packed; |
| 220 | 241 | ||
| 221 | /** Transfer result basic codes [WUSB] table 8-15 */ | 242 | /** Transfer result basic codes [WUSB] table 8-15 */ |
| 222 | enum { | 243 | enum { |
| @@ -243,7 +264,7 @@ struct wa_xfer_result { | |||
| 243 | u8 bTransferSegment; | 264 | u8 bTransferSegment; |
| 244 | u8 bTransferStatus; | 265 | u8 bTransferStatus; |
| 245 | __le32 dwNumOfPackets; | 266 | __le32 dwNumOfPackets; |
| 246 | } __attribute__((packed)); | 267 | } __packed; |
| 247 | 268 | ||
| 248 | /** | 269 | /** |
| 249 | * Wire Adapter Class Descriptor ([WUSB] section 8.5.2.7). | 270 | * Wire Adapter Class Descriptor ([WUSB] section 8.5.2.7). |
| @@ -258,16 +279,16 @@ struct wa_xfer_result { | |||
| 258 | struct usb_wa_descriptor { | 279 | struct usb_wa_descriptor { |
| 259 | u8 bLength; | 280 | u8 bLength; |
| 260 | u8 bDescriptorType; | 281 | u8 bDescriptorType; |
| 261 | u16 bcdWAVersion; | 282 | __le16 bcdWAVersion; |
| 262 | u8 bNumPorts; /* don't use!! */ | 283 | u8 bNumPorts; /* don't use!! */ |
| 263 | u8 bmAttributes; /* Reserved == 0 */ | 284 | u8 bmAttributes; /* Reserved == 0 */ |
| 264 | u16 wNumRPipes; | 285 | __le16 wNumRPipes; |
| 265 | u16 wRPipeMaxBlock; | 286 | __le16 wRPipeMaxBlock; |
| 266 | u8 bRPipeBlockSize; | 287 | u8 bRPipeBlockSize; |
| 267 | u8 bPwrOn2PwrGood; | 288 | u8 bPwrOn2PwrGood; |
| 268 | u8 bNumMMCIEs; | 289 | u8 bNumMMCIEs; |
| 269 | u8 DeviceRemovable; /* FIXME: in DWA this is up to 16 bytes */ | 290 | u8 DeviceRemovable; /* FIXME: in DWA this is up to 16 bytes */ |
| 270 | } __attribute__((packed)); | 291 | } __packed; |
| 271 | 292 | ||
| 272 | /** | 293 | /** |
| 273 | * HWA Device Information Buffer (WUSB1.0[T8.54]) | 294 | * HWA Device Information Buffer (WUSB1.0[T8.54]) |
| @@ -277,6 +298,6 @@ struct hwa_dev_info { | |||
| 277 | u8 bDeviceAddress; | 298 | u8 bDeviceAddress; |
| 278 | __le16 wPHYRates; | 299 | __le16 wPHYRates; |
| 279 | u8 bmDeviceAttribute; | 300 | u8 bmDeviceAttribute; |
| 280 | } __attribute__((packed)); | 301 | } __packed; |
| 281 | 302 | ||
| 282 | #endif /* #ifndef __LINUX_USB_WUSB_WA_H */ | 303 | #endif /* #ifndef __LINUX_USB_WUSB_WA_H */ |
diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h index 1855f0a22add..c557c6d096de 100644 --- a/include/linux/vm_event_item.h +++ b/include/linux/vm_event_item.h | |||
| @@ -39,6 +39,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, | |||
| 39 | PAGEOUTRUN, ALLOCSTALL, PGROTATED, | 39 | PAGEOUTRUN, ALLOCSTALL, PGROTATED, |
| 40 | #ifdef CONFIG_NUMA_BALANCING | 40 | #ifdef CONFIG_NUMA_BALANCING |
| 41 | NUMA_PTE_UPDATES, | 41 | NUMA_PTE_UPDATES, |
| 42 | NUMA_HUGE_PTE_UPDATES, | ||
| 42 | NUMA_HINT_FAULTS, | 43 | NUMA_HINT_FAULTS, |
| 43 | NUMA_HINT_FAULTS_LOCAL, | 44 | NUMA_HINT_FAULTS_LOCAL, |
| 44 | NUMA_PAGE_MIGRATE, | 45 | NUMA_PAGE_MIGRATE, |
diff --git a/include/linux/wait.h b/include/linux/wait.h index a67fc1635592..61939ba30aa0 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
| @@ -1,7 +1,8 @@ | |||
| 1 | #ifndef _LINUX_WAIT_H | 1 | #ifndef _LINUX_WAIT_H |
| 2 | #define _LINUX_WAIT_H | 2 | #define _LINUX_WAIT_H |
| 3 | 3 | /* | |
| 4 | 4 | * Linux wait queue related types and methods | |
| 5 | */ | ||
| 5 | #include <linux/list.h> | 6 | #include <linux/list.h> |
| 6 | #include <linux/stddef.h> | 7 | #include <linux/stddef.h> |
| 7 | #include <linux/spinlock.h> | 8 | #include <linux/spinlock.h> |
| @@ -13,27 +14,27 @@ typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int flags, v | |||
| 13 | 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); |
| 14 | 15 | ||
| 15 | struct __wait_queue { | 16 | struct __wait_queue { |
| 16 | unsigned int flags; | 17 | unsigned int flags; |
| 17 | #define WQ_FLAG_EXCLUSIVE 0x01 | 18 | #define WQ_FLAG_EXCLUSIVE 0x01 |
| 18 | void *private; | 19 | void *private; |
| 19 | wait_queue_func_t func; | 20 | wait_queue_func_t func; |
| 20 | struct list_head task_list; | 21 | struct list_head task_list; |
| 21 | }; | 22 | }; |
| 22 | 23 | ||
| 23 | struct wait_bit_key { | 24 | struct wait_bit_key { |
| 24 | void *flags; | 25 | void *flags; |
| 25 | int bit_nr; | 26 | int bit_nr; |
| 26 | #define WAIT_ATOMIC_T_BIT_NR -1 | 27 | #define WAIT_ATOMIC_T_BIT_NR -1 |
| 27 | }; | 28 | }; |
| 28 | 29 | ||
| 29 | struct wait_bit_queue { | 30 | struct wait_bit_queue { |
| 30 | struct wait_bit_key key; | 31 | struct wait_bit_key key; |
| 31 | wait_queue_t wait; | 32 | wait_queue_t wait; |
| 32 | }; | 33 | }; |
| 33 | 34 | ||
| 34 | struct __wait_queue_head { | 35 | struct __wait_queue_head { |
| 35 | spinlock_t lock; | 36 | spinlock_t lock; |
| 36 | struct list_head task_list; | 37 | struct list_head task_list; |
| 37 | }; | 38 | }; |
| 38 | typedef struct __wait_queue_head wait_queue_head_t; | 39 | typedef struct __wait_queue_head wait_queue_head_t; |
| 39 | 40 | ||
| @@ -84,17 +85,17 @@ extern void __init_waitqueue_head(wait_queue_head_t *q, const char *name, struct | |||
| 84 | 85 | ||
| 85 | static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p) | 86 | static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p) |
| 86 | { | 87 | { |
| 87 | q->flags = 0; | 88 | q->flags = 0; |
| 88 | q->private = p; | 89 | q->private = p; |
| 89 | q->func = default_wake_function; | 90 | q->func = default_wake_function; |
| 90 | } | 91 | } |
| 91 | 92 | ||
| 92 | static inline void init_waitqueue_func_entry(wait_queue_t *q, | 93 | static inline void |
| 93 | wait_queue_func_t func) | 94 | init_waitqueue_func_entry(wait_queue_t *q, wait_queue_func_t func) |
| 94 | { | 95 | { |
| 95 | q->flags = 0; | 96 | q->flags = 0; |
| 96 | q->private = NULL; | 97 | q->private = NULL; |
| 97 | q->func = func; | 98 | q->func = func; |
| 98 | } | 99 | } |
| 99 | 100 | ||
| 100 | static inline int waitqueue_active(wait_queue_head_t *q) | 101 | static inline int waitqueue_active(wait_queue_head_t *q) |
| @@ -114,8 +115,8 @@ static inline void __add_wait_queue(wait_queue_head_t *head, wait_queue_t *new) | |||
| 114 | /* | 115 | /* |
| 115 | * Used for wake-one threads: | 116 | * Used for wake-one threads: |
| 116 | */ | 117 | */ |
| 117 | static inline void __add_wait_queue_exclusive(wait_queue_head_t *q, | 118 | static inline void |
| 118 | wait_queue_t *wait) | 119 | __add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t *wait) |
| 119 | { | 120 | { |
| 120 | wait->flags |= WQ_FLAG_EXCLUSIVE; | 121 | wait->flags |= WQ_FLAG_EXCLUSIVE; |
| 121 | __add_wait_queue(q, wait); | 122 | __add_wait_queue(q, wait); |
| @@ -127,23 +128,22 @@ static inline void __add_wait_queue_tail(wait_queue_head_t *head, | |||
| 127 | list_add_tail(&new->task_list, &head->task_list); | 128 | list_add_tail(&new->task_list, &head->task_list); |
| 128 | } | 129 | } |
| 129 | 130 | ||
| 130 | static inline void __add_wait_queue_tail_exclusive(wait_queue_head_t *q, | 131 | static inline void |
| 131 | wait_queue_t *wait) | 132 | __add_wait_queue_tail_exclusive(wait_queue_head_t *q, wait_queue_t *wait) |
| 132 | { | 133 | { |
| 133 | wait->flags |= WQ_FLAG_EXCLUSIVE; | 134 | wait->flags |= WQ_FLAG_EXCLUSIVE; |
| 134 | __add_wait_queue_tail(q, wait); | 135 | __add_wait_queue_tail(q, wait); |
| 135 | } | 136 | } |
| 136 | 137 | ||
| 137 | static inline void __remove_wait_queue(wait_queue_head_t *head, | 138 | static inline void |
| 138 | wait_queue_t *old) | 139 | __remove_wait_queue(wait_queue_head_t *head, wait_queue_t *old) |
| 139 | { | 140 | { |
| 140 | list_del(&old->task_list); | 141 | list_del(&old->task_list); |
| 141 | } | 142 | } |
| 142 | 143 | ||
| 143 | void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key); | 144 | void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key); |
| 144 | void __wake_up_locked_key(wait_queue_head_t *q, unsigned int mode, void *key); | 145 | void __wake_up_locked_key(wait_queue_head_t *q, unsigned int mode, void *key); |
| 145 | void __wake_up_sync_key(wait_queue_head_t *q, unsigned int mode, int nr, | 146 | void __wake_up_sync_key(wait_queue_head_t *q, unsigned int mode, int nr, void *key); |
| 146 | void *key); | ||
| 147 | void __wake_up_locked(wait_queue_head_t *q, unsigned int mode, int nr); | 147 | void __wake_up_locked(wait_queue_head_t *q, unsigned int mode, int nr); |
| 148 | void __wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr); | 148 | void __wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr); |
| 149 | void __wake_up_bit(wait_queue_head_t *, void *, int); | 149 | void __wake_up_bit(wait_queue_head_t *, void *, int); |
| @@ -170,27 +170,64 @@ wait_queue_head_t *bit_waitqueue(void *, int); | |||
| 170 | /* | 170 | /* |
| 171 | * Wakeup macros to be used to report events to the targets. | 171 | * Wakeup macros to be used to report events to the targets. |
| 172 | */ | 172 | */ |
| 173 | #define wake_up_poll(x, m) \ | 173 | #define wake_up_poll(x, m) \ |
| 174 | __wake_up(x, TASK_NORMAL, 1, (void *) (m)) | 174 | __wake_up(x, TASK_NORMAL, 1, (void *) (m)) |
| 175 | #define wake_up_locked_poll(x, m) \ | 175 | #define wake_up_locked_poll(x, m) \ |
| 176 | __wake_up_locked_key((x), TASK_NORMAL, (void *) (m)) | 176 | __wake_up_locked_key((x), TASK_NORMAL, (void *) (m)) |
| 177 | #define wake_up_interruptible_poll(x, m) \ | 177 | #define wake_up_interruptible_poll(x, m) \ |
| 178 | __wake_up(x, TASK_INTERRUPTIBLE, 1, (void *) (m)) | 178 | __wake_up(x, TASK_INTERRUPTIBLE, 1, (void *) (m)) |
| 179 | #define wake_up_interruptible_sync_poll(x, m) \ | 179 | #define wake_up_interruptible_sync_poll(x, m) \ |
| 180 | __wake_up_sync_key((x), TASK_INTERRUPTIBLE, 1, (void *) (m)) | 180 | __wake_up_sync_key((x), TASK_INTERRUPTIBLE, 1, (void *) (m)) |
| 181 | 181 | ||
| 182 | #define __wait_event(wq, condition) \ | 182 | #define ___wait_cond_timeout(condition) \ |
| 183 | do { \ | 183 | ({ \ |
| 184 | DEFINE_WAIT(__wait); \ | 184 | bool __cond = (condition); \ |
| 185 | if (__cond && !__ret) \ | ||
| 186 | __ret = 1; \ | ||
| 187 | __cond || !__ret; \ | ||
| 188 | }) | ||
| 189 | |||
| 190 | #define ___wait_is_interruptible(state) \ | ||
| 191 | (!__builtin_constant_p(state) || \ | ||
| 192 | state == TASK_INTERRUPTIBLE || state == TASK_KILLABLE) \ | ||
| 193 | |||
| 194 | #define ___wait_event(wq, condition, state, exclusive, ret, cmd) \ | ||
| 195 | ({ \ | ||
| 196 | __label__ __out; \ | ||
| 197 | wait_queue_t __wait; \ | ||
| 198 | long __ret = ret; \ | ||
| 199 | \ | ||
| 200 | INIT_LIST_HEAD(&__wait.task_list); \ | ||
| 201 | if (exclusive) \ | ||
| 202 | __wait.flags = WQ_FLAG_EXCLUSIVE; \ | ||
| 203 | else \ | ||
| 204 | __wait.flags = 0; \ | ||
| 185 | \ | 205 | \ |
| 186 | for (;;) { \ | 206 | for (;;) { \ |
| 187 | prepare_to_wait(&wq, &__wait, TASK_UNINTERRUPTIBLE); \ | 207 | long __int = prepare_to_wait_event(&wq, &__wait, state);\ |
| 208 | \ | ||
| 188 | if (condition) \ | 209 | if (condition) \ |
| 189 | break; \ | 210 | break; \ |
| 190 | schedule(); \ | 211 | \ |
| 212 | if (___wait_is_interruptible(state) && __int) { \ | ||
| 213 | __ret = __int; \ | ||
| 214 | if (exclusive) { \ | ||
| 215 | abort_exclusive_wait(&wq, &__wait, \ | ||
| 216 | state, NULL); \ | ||
| 217 | goto __out; \ | ||
| 218 | } \ | ||
| 219 | break; \ | ||
| 220 | } \ | ||
| 221 | \ | ||
| 222 | cmd; \ | ||
| 191 | } \ | 223 | } \ |
| 192 | finish_wait(&wq, &__wait); \ | 224 | finish_wait(&wq, &__wait); \ |
| 193 | } while (0) | 225 | __out: __ret; \ |
| 226 | }) | ||
| 227 | |||
| 228 | #define __wait_event(wq, condition) \ | ||
| 229 | (void)___wait_event(wq, condition, TASK_UNINTERRUPTIBLE, 0, 0, \ | ||
| 230 | schedule()) | ||
| 194 | 231 | ||
| 195 | /** | 232 | /** |
| 196 | * wait_event - sleep until a condition gets true | 233 | * wait_event - sleep until a condition gets true |
| @@ -204,29 +241,17 @@ do { \ | |||
| 204 | * wake_up() has to be called after changing any variable that could | 241 | * wake_up() has to be called after changing any variable that could |
| 205 | * change the result of the wait condition. | 242 | * change the result of the wait condition. |
| 206 | */ | 243 | */ |
| 207 | #define wait_event(wq, condition) \ | 244 | #define wait_event(wq, condition) \ |
| 208 | do { \ | 245 | do { \ |
| 209 | if (condition) \ | 246 | if (condition) \ |
| 210 | break; \ | 247 | break; \ |
| 211 | __wait_event(wq, condition); \ | 248 | __wait_event(wq, condition); \ |
| 212 | } while (0) | 249 | } while (0) |
| 213 | 250 | ||
| 214 | #define __wait_event_timeout(wq, condition, ret) \ | 251 | #define __wait_event_timeout(wq, condition, timeout) \ |
| 215 | do { \ | 252 | ___wait_event(wq, ___wait_cond_timeout(condition), \ |
| 216 | DEFINE_WAIT(__wait); \ | 253 | TASK_UNINTERRUPTIBLE, 0, timeout, \ |
| 217 | \ | 254 | __ret = schedule_timeout(__ret)) |
| 218 | for (;;) { \ | ||
| 219 | prepare_to_wait(&wq, &__wait, TASK_UNINTERRUPTIBLE); \ | ||
| 220 | if (condition) \ | ||
| 221 | break; \ | ||
| 222 | ret = schedule_timeout(ret); \ | ||
| 223 | if (!ret) \ | ||
| 224 | break; \ | ||
| 225 | } \ | ||
| 226 | if (!ret && (condition)) \ | ||
| 227 | ret = 1; \ | ||
| 228 | finish_wait(&wq, &__wait); \ | ||
| 229 | } while (0) | ||
| 230 | 255 | ||
| 231 | /** | 256 | /** |
| 232 | * wait_event_timeout - sleep until a condition gets true or a timeout elapses | 257 | * wait_event_timeout - sleep until a condition gets true or a timeout elapses |
| @@ -248,28 +273,14 @@ do { \ | |||
| 248 | #define wait_event_timeout(wq, condition, timeout) \ | 273 | #define wait_event_timeout(wq, condition, timeout) \ |
| 249 | ({ \ | 274 | ({ \ |
| 250 | long __ret = timeout; \ | 275 | long __ret = timeout; \ |
| 251 | if (!(condition)) \ | 276 | if (!___wait_cond_timeout(condition)) \ |
| 252 | __wait_event_timeout(wq, condition, __ret); \ | 277 | __ret = __wait_event_timeout(wq, condition, timeout); \ |
| 253 | __ret; \ | 278 | __ret; \ |
| 254 | }) | 279 | }) |
| 255 | 280 | ||
| 256 | #define __wait_event_interruptible(wq, condition, ret) \ | 281 | #define __wait_event_interruptible(wq, condition) \ |
| 257 | do { \ | 282 | ___wait_event(wq, condition, TASK_INTERRUPTIBLE, 0, 0, \ |
| 258 | DEFINE_WAIT(__wait); \ | 283 | schedule()) |
| 259 | \ | ||
| 260 | for (;;) { \ | ||
| 261 | prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE); \ | ||
| 262 | if (condition) \ | ||
| 263 | break; \ | ||
| 264 | if (!signal_pending(current)) { \ | ||
| 265 | schedule(); \ | ||
| 266 | continue; \ | ||
| 267 | } \ | ||
| 268 | ret = -ERESTARTSYS; \ | ||
| 269 | break; \ | ||
| 270 | } \ | ||
| 271 | finish_wait(&wq, &__wait); \ | ||
| 272 | } while (0) | ||
| 273 | 284 | ||
| 274 | /** | 285 | /** |
| 275 | * wait_event_interruptible - sleep until a condition gets true | 286 | * wait_event_interruptible - sleep until a condition gets true |
| @@ -290,31 +301,14 @@ do { \ | |||
| 290 | ({ \ | 301 | ({ \ |
| 291 | int __ret = 0; \ | 302 | int __ret = 0; \ |
| 292 | if (!(condition)) \ | 303 | if (!(condition)) \ |
| 293 | __wait_event_interruptible(wq, condition, __ret); \ | 304 | __ret = __wait_event_interruptible(wq, condition); \ |
| 294 | __ret; \ | 305 | __ret; \ |
| 295 | }) | 306 | }) |
| 296 | 307 | ||
| 297 | #define __wait_event_interruptible_timeout(wq, condition, ret) \ | 308 | #define __wait_event_interruptible_timeout(wq, condition, timeout) \ |
| 298 | do { \ | 309 | ___wait_event(wq, ___wait_cond_timeout(condition), \ |
| 299 | DEFINE_WAIT(__wait); \ | 310 | TASK_INTERRUPTIBLE, 0, timeout, \ |
| 300 | \ | 311 | __ret = schedule_timeout(__ret)) |
| 301 | for (;;) { \ | ||
| 302 | prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE); \ | ||
| 303 | if (condition) \ | ||
| 304 | break; \ | ||
| 305 | if (!signal_pending(current)) { \ | ||
| 306 | ret = schedule_timeout(ret); \ | ||
| 307 | if (!ret) \ | ||
| 308 | break; \ | ||
| 309 | continue; \ | ||
| 310 | } \ | ||
| 311 | ret = -ERESTARTSYS; \ | ||
| 312 | break; \ | ||
| 313 | } \ | ||
| 314 | if (!ret && (condition)) \ | ||
| 315 | ret = 1; \ | ||
| 316 | finish_wait(&wq, &__wait); \ | ||
| 317 | } while (0) | ||
| 318 | 312 | ||
| 319 | /** | 313 | /** |
| 320 | * wait_event_interruptible_timeout - sleep until a condition gets true or a timeout elapses | 314 | * wait_event_interruptible_timeout - sleep until a condition gets true or a timeout elapses |
| @@ -337,15 +331,15 @@ do { \ | |||
| 337 | #define wait_event_interruptible_timeout(wq, condition, timeout) \ | 331 | #define wait_event_interruptible_timeout(wq, condition, timeout) \ |
| 338 | ({ \ | 332 | ({ \ |
| 339 | long __ret = timeout; \ | 333 | long __ret = timeout; \ |
| 340 | if (!(condition)) \ | 334 | if (!___wait_cond_timeout(condition)) \ |
| 341 | __wait_event_interruptible_timeout(wq, condition, __ret); \ | 335 | __ret = __wait_event_interruptible_timeout(wq, \ |
| 336 | condition, timeout); \ | ||
| 342 | __ret; \ | 337 | __ret; \ |
| 343 | }) | 338 | }) |
| 344 | 339 | ||
| 345 | #define __wait_event_hrtimeout(wq, condition, timeout, state) \ | 340 | #define __wait_event_hrtimeout(wq, condition, timeout, state) \ |
| 346 | ({ \ | 341 | ({ \ |
| 347 | int __ret = 0; \ | 342 | int __ret = 0; \ |
| 348 | DEFINE_WAIT(__wait); \ | ||
| 349 | struct hrtimer_sleeper __t; \ | 343 | struct hrtimer_sleeper __t; \ |
| 350 | \ | 344 | \ |
| 351 | hrtimer_init_on_stack(&__t.timer, CLOCK_MONOTONIC, \ | 345 | hrtimer_init_on_stack(&__t.timer, CLOCK_MONOTONIC, \ |
| @@ -356,25 +350,15 @@ do { \ | |||
| 356 | current->timer_slack_ns, \ | 350 | current->timer_slack_ns, \ |
| 357 | HRTIMER_MODE_REL); \ | 351 | HRTIMER_MODE_REL); \ |
| 358 | \ | 352 | \ |
| 359 | for (;;) { \ | 353 | __ret = ___wait_event(wq, condition, state, 0, 0, \ |
| 360 | prepare_to_wait(&wq, &__wait, state); \ | ||
| 361 | if (condition) \ | ||
| 362 | break; \ | ||
| 363 | if (state == TASK_INTERRUPTIBLE && \ | ||
| 364 | signal_pending(current)) { \ | ||
| 365 | __ret = -ERESTARTSYS; \ | ||
| 366 | break; \ | ||
| 367 | } \ | ||
| 368 | if (!__t.task) { \ | 354 | if (!__t.task) { \ |
| 369 | __ret = -ETIME; \ | 355 | __ret = -ETIME; \ |
| 370 | break; \ | 356 | break; \ |
| 371 | } \ | 357 | } \ |
| 372 | schedule(); \ | 358 | schedule()); \ |
| 373 | } \ | ||
| 374 | \ | 359 | \ |
| 375 | hrtimer_cancel(&__t.timer); \ | 360 | hrtimer_cancel(&__t.timer); \ |
| 376 | destroy_hrtimer_on_stack(&__t.timer); \ | 361 | destroy_hrtimer_on_stack(&__t.timer); \ |
| 377 | finish_wait(&wq, &__wait); \ | ||
| 378 | __ret; \ | 362 | __ret; \ |
| 379 | }) | 363 | }) |
| 380 | 364 | ||
| @@ -428,33 +412,15 @@ do { \ | |||
| 428 | __ret; \ | 412 | __ret; \ |
| 429 | }) | 413 | }) |
| 430 | 414 | ||
| 431 | #define __wait_event_interruptible_exclusive(wq, condition, ret) \ | 415 | #define __wait_event_interruptible_exclusive(wq, condition) \ |
| 432 | do { \ | 416 | ___wait_event(wq, condition, TASK_INTERRUPTIBLE, 1, 0, \ |
| 433 | DEFINE_WAIT(__wait); \ | 417 | schedule()) |
| 434 | \ | ||
| 435 | for (;;) { \ | ||
| 436 | prepare_to_wait_exclusive(&wq, &__wait, \ | ||
| 437 | TASK_INTERRUPTIBLE); \ | ||
| 438 | if (condition) { \ | ||
| 439 | finish_wait(&wq, &__wait); \ | ||
| 440 | break; \ | ||
| 441 | } \ | ||
| 442 | if (!signal_pending(current)) { \ | ||
| 443 | schedule(); \ | ||
| 444 | continue; \ | ||
| 445 | } \ | ||
| 446 | ret = -ERESTARTSYS; \ | ||
| 447 | abort_exclusive_wait(&wq, &__wait, \ | ||
| 448 | TASK_INTERRUPTIBLE, NULL); \ | ||
| 449 | break; \ | ||
| 450 | } \ | ||
| 451 | } while (0) | ||
| 452 | 418 | ||
| 453 | #define wait_event_interruptible_exclusive(wq, condition) \ | 419 | #define wait_event_interruptible_exclusive(wq, condition) \ |
| 454 | ({ \ | 420 | ({ \ |
| 455 | int __ret = 0; \ | 421 | int __ret = 0; \ |
| 456 | if (!(condition)) \ | 422 | if (!(condition)) \ |
| 457 | __wait_event_interruptible_exclusive(wq, condition, __ret);\ | 423 | __ret = __wait_event_interruptible_exclusive(wq, condition);\ |
| 458 | __ret; \ | 424 | __ret; \ |
| 459 | }) | 425 | }) |
| 460 | 426 | ||
| @@ -606,24 +572,8 @@ do { \ | |||
| 606 | ? 0 : __wait_event_interruptible_locked(wq, condition, 1, 1)) | 572 | ? 0 : __wait_event_interruptible_locked(wq, condition, 1, 1)) |
| 607 | 573 | ||
| 608 | 574 | ||
| 609 | 575 | #define __wait_event_killable(wq, condition) \ | |
| 610 | #define __wait_event_killable(wq, condition, ret) \ | 576 | ___wait_event(wq, condition, TASK_KILLABLE, 0, 0, schedule()) |
| 611 | do { \ | ||
| 612 | DEFINE_WAIT(__wait); \ | ||
| 613 | \ | ||
| 614 | for (;;) { \ | ||
| 615 | prepare_to_wait(&wq, &__wait, TASK_KILLABLE); \ | ||
| 616 | if (condition) \ | ||
| 617 | break; \ | ||
| 618 | if (!fatal_signal_pending(current)) { \ | ||
| 619 | schedule(); \ | ||
| 620 | continue; \ | ||
| 621 | } \ | ||
| 622 | ret = -ERESTARTSYS; \ | ||
| 623 | break; \ | ||
| 624 | } \ | ||
| 625 | finish_wait(&wq, &__wait); \ | ||
| 626 | } while (0) | ||
| 627 | 577 | ||
| 628 | /** | 578 | /** |
| 629 | * wait_event_killable - sleep until a condition gets true | 579 | * wait_event_killable - sleep until a condition gets true |
| @@ -644,26 +594,17 @@ do { \ | |||
| 644 | ({ \ | 594 | ({ \ |
| 645 | int __ret = 0; \ | 595 | int __ret = 0; \ |
| 646 | if (!(condition)) \ | 596 | if (!(condition)) \ |
| 647 | __wait_event_killable(wq, condition, __ret); \ | 597 | __ret = __wait_event_killable(wq, condition); \ |
| 648 | __ret; \ | 598 | __ret; \ |
| 649 | }) | 599 | }) |
| 650 | 600 | ||
| 651 | 601 | ||
| 652 | #define __wait_event_lock_irq(wq, condition, lock, cmd) \ | 602 | #define __wait_event_lock_irq(wq, condition, lock, cmd) \ |
| 653 | do { \ | 603 | (void)___wait_event(wq, condition, TASK_UNINTERRUPTIBLE, 0, 0, \ |
| 654 | DEFINE_WAIT(__wait); \ | 604 | spin_unlock_irq(&lock); \ |
| 655 | \ | 605 | cmd; \ |
| 656 | for (;;) { \ | 606 | schedule(); \ |
| 657 | prepare_to_wait(&wq, &__wait, TASK_UNINTERRUPTIBLE); \ | 607 | spin_lock_irq(&lock)) |
| 658 | if (condition) \ | ||
| 659 | break; \ | ||
| 660 | spin_unlock_irq(&lock); \ | ||
| 661 | cmd; \ | ||
| 662 | schedule(); \ | ||
| 663 | spin_lock_irq(&lock); \ | ||
| 664 | } \ | ||
| 665 | finish_wait(&wq, &__wait); \ | ||
| 666 | } while (0) | ||
| 667 | 608 | ||
| 668 | /** | 609 | /** |
| 669 | * wait_event_lock_irq_cmd - sleep until a condition gets true. The | 610 | * wait_event_lock_irq_cmd - sleep until a condition gets true. The |
| @@ -723,26 +664,12 @@ do { \ | |||
| 723 | } while (0) | 664 | } while (0) |
| 724 | 665 | ||
| 725 | 666 | ||
| 726 | #define __wait_event_interruptible_lock_irq(wq, condition, \ | 667 | #define __wait_event_interruptible_lock_irq(wq, condition, lock, cmd) \ |
| 727 | lock, ret, cmd) \ | 668 | ___wait_event(wq, condition, TASK_INTERRUPTIBLE, 0, 0, \ |
| 728 | do { \ | 669 | spin_unlock_irq(&lock); \ |
| 729 | DEFINE_WAIT(__wait); \ | 670 | cmd; \ |
| 730 | \ | 671 | schedule(); \ |
| 731 | for (;;) { \ | 672 | spin_lock_irq(&lock)) |
| 732 | prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE); \ | ||
| 733 | if (condition) \ | ||
| 734 | break; \ | ||
| 735 | if (signal_pending(current)) { \ | ||
| 736 | ret = -ERESTARTSYS; \ | ||
| 737 | break; \ | ||
| 738 | } \ | ||
| 739 | spin_unlock_irq(&lock); \ | ||
| 740 | cmd; \ | ||
| 741 | schedule(); \ | ||
| 742 | spin_lock_irq(&lock); \ | ||
| 743 | } \ | ||
| 744 | finish_wait(&wq, &__wait); \ | ||
| 745 | } while (0) | ||
| 746 | 673 | ||
| 747 | /** | 674 | /** |
| 748 | * wait_event_interruptible_lock_irq_cmd - sleep until a condition gets true. | 675 | * wait_event_interruptible_lock_irq_cmd - sleep until a condition gets true. |
| @@ -772,10 +699,9 @@ do { \ | |||
| 772 | #define wait_event_interruptible_lock_irq_cmd(wq, condition, lock, cmd) \ | 699 | #define wait_event_interruptible_lock_irq_cmd(wq, condition, lock, cmd) \ |
| 773 | ({ \ | 700 | ({ \ |
| 774 | int __ret = 0; \ | 701 | int __ret = 0; \ |
| 775 | \ | ||
| 776 | if (!(condition)) \ | 702 | if (!(condition)) \ |
| 777 | __wait_event_interruptible_lock_irq(wq, condition, \ | 703 | __ret = __wait_event_interruptible_lock_irq(wq, \ |
| 778 | lock, __ret, cmd); \ | 704 | condition, lock, cmd); \ |
| 779 | __ret; \ | 705 | __ret; \ |
| 780 | }) | 706 | }) |
| 781 | 707 | ||
| @@ -804,39 +730,24 @@ do { \ | |||
| 804 | #define wait_event_interruptible_lock_irq(wq, condition, lock) \ | 730 | #define wait_event_interruptible_lock_irq(wq, condition, lock) \ |
| 805 | ({ \ | 731 | ({ \ |
| 806 | int __ret = 0; \ | 732 | int __ret = 0; \ |
| 807 | \ | ||
| 808 | if (!(condition)) \ | 733 | if (!(condition)) \ |
| 809 | __wait_event_interruptible_lock_irq(wq, condition, \ | 734 | __ret = __wait_event_interruptible_lock_irq(wq, \ |
| 810 | lock, __ret, ); \ | 735 | condition, lock,); \ |
| 811 | __ret; \ | 736 | __ret; \ |
| 812 | }) | 737 | }) |
| 813 | 738 | ||
| 814 | #define __wait_event_interruptible_lock_irq_timeout(wq, condition, \ | 739 | #define __wait_event_interruptible_lock_irq_timeout(wq, condition, \ |
| 815 | lock, ret) \ | 740 | lock, timeout) \ |
| 816 | do { \ | 741 | ___wait_event(wq, ___wait_cond_timeout(condition), \ |
| 817 | DEFINE_WAIT(__wait); \ | 742 | TASK_INTERRUPTIBLE, 0, timeout, \ |
| 818 | \ | 743 | spin_unlock_irq(&lock); \ |
| 819 | for (;;) { \ | 744 | __ret = schedule_timeout(__ret); \ |
| 820 | prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE); \ | 745 | spin_lock_irq(&lock)); |
| 821 | if (condition) \ | ||
| 822 | break; \ | ||
| 823 | if (signal_pending(current)) { \ | ||
| 824 | ret = -ERESTARTSYS; \ | ||
| 825 | break; \ | ||
| 826 | } \ | ||
| 827 | spin_unlock_irq(&lock); \ | ||
| 828 | ret = schedule_timeout(ret); \ | ||
| 829 | spin_lock_irq(&lock); \ | ||
| 830 | if (!ret) \ | ||
| 831 | break; \ | ||
| 832 | } \ | ||
| 833 | finish_wait(&wq, &__wait); \ | ||
| 834 | } while (0) | ||
| 835 | 746 | ||
| 836 | /** | 747 | /** |
| 837 | * wait_event_interruptible_lock_irq_timeout - sleep until a condition gets true or a timeout elapses. | 748 | * wait_event_interruptible_lock_irq_timeout - sleep until a condition gets |
| 838 | * The condition is checked under the lock. This is expected | 749 | * true or a timeout elapses. The condition is checked under |
| 839 | * to be called with the lock taken. | 750 | * the lock. This is expected to be called with the lock taken. |
| 840 | * @wq: the waitqueue to wait on | 751 | * @wq: the waitqueue to wait on |
| 841 | * @condition: a C expression for the event to wait for | 752 | * @condition: a C expression for the event to wait for |
| 842 | * @lock: a locked spinlock_t, which will be released before schedule() | 753 | * @lock: a locked spinlock_t, which will be released before schedule() |
| @@ -860,11 +771,10 @@ do { \ | |||
| 860 | #define wait_event_interruptible_lock_irq_timeout(wq, condition, lock, \ | 771 | #define wait_event_interruptible_lock_irq_timeout(wq, condition, lock, \ |
| 861 | timeout) \ | 772 | timeout) \ |
| 862 | ({ \ | 773 | ({ \ |
| 863 | int __ret = timeout; \ | 774 | long __ret = timeout; \ |
| 864 | \ | 775 | if (!___wait_cond_timeout(condition)) \ |
| 865 | if (!(condition)) \ | 776 | __ret = __wait_event_interruptible_lock_irq_timeout( \ |
| 866 | __wait_event_interruptible_lock_irq_timeout( \ | 777 | wq, condition, lock, timeout); \ |
| 867 | wq, condition, lock, __ret); \ | ||
| 868 | __ret; \ | 778 | __ret; \ |
| 869 | }) | 779 | }) |
| 870 | 780 | ||
| @@ -875,20 +785,18 @@ do { \ | |||
| 875 | * We plan to remove these interfaces. | 785 | * We plan to remove these interfaces. |
| 876 | */ | 786 | */ |
| 877 | extern void sleep_on(wait_queue_head_t *q); | 787 | extern void sleep_on(wait_queue_head_t *q); |
| 878 | extern long sleep_on_timeout(wait_queue_head_t *q, | 788 | extern long sleep_on_timeout(wait_queue_head_t *q, signed long timeout); |
| 879 | signed long timeout); | ||
| 880 | extern void interruptible_sleep_on(wait_queue_head_t *q); | 789 | extern void interruptible_sleep_on(wait_queue_head_t *q); |
| 881 | extern long interruptible_sleep_on_timeout(wait_queue_head_t *q, | 790 | extern long interruptible_sleep_on_timeout(wait_queue_head_t *q, signed long timeout); |
| 882 | signed long timeout); | ||
| 883 | 791 | ||
| 884 | /* | 792 | /* |
| 885 | * Waitqueues which are removed from the waitqueue_head at wakeup time | 793 | * Waitqueues which are removed from the waitqueue_head at wakeup time |
| 886 | */ | 794 | */ |
| 887 | void prepare_to_wait(wait_queue_head_t *q, wait_queue_t *wait, int state); | 795 | void prepare_to_wait(wait_queue_head_t *q, wait_queue_t *wait, int state); |
| 888 | void prepare_to_wait_exclusive(wait_queue_head_t *q, wait_queue_t *wait, int state); | 796 | void prepare_to_wait_exclusive(wait_queue_head_t *q, wait_queue_t *wait, int state); |
| 797 | long prepare_to_wait_event(wait_queue_head_t *q, wait_queue_t *wait, int state); | ||
| 889 | void finish_wait(wait_queue_head_t *q, wait_queue_t *wait); | 798 | void finish_wait(wait_queue_head_t *q, wait_queue_t *wait); |
| 890 | void abort_exclusive_wait(wait_queue_head_t *q, wait_queue_t *wait, | 799 | void abort_exclusive_wait(wait_queue_head_t *q, wait_queue_t *wait, unsigned int mode, void *key); |
| 891 | unsigned int mode, void *key); | ||
| 892 | int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key); | 800 | int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key); |
| 893 | int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key); | 801 | int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key); |
| 894 | 802 | ||
| @@ -934,8 +842,8 @@ int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key); | |||
| 934 | * One uses wait_on_bit() where one is waiting for the bit to clear, | 842 | * One uses wait_on_bit() where one is waiting for the bit to clear, |
| 935 | * but has no intention of setting it. | 843 | * but has no intention of setting it. |
| 936 | */ | 844 | */ |
| 937 | static inline int wait_on_bit(void *word, int bit, | 845 | static inline int |
| 938 | int (*action)(void *), unsigned mode) | 846 | wait_on_bit(void *word, int bit, int (*action)(void *), unsigned mode) |
| 939 | { | 847 | { |
| 940 | if (!test_bit(bit, word)) | 848 | if (!test_bit(bit, word)) |
| 941 | return 0; | 849 | return 0; |
| @@ -958,8 +866,8 @@ static inline int wait_on_bit(void *word, int bit, | |||
| 958 | * One uses wait_on_bit_lock() where one is waiting for the bit to | 866 | * One uses wait_on_bit_lock() where one is waiting for the bit to |
| 959 | * clear with the intention of setting it, and when done, clearing it. | 867 | * clear with the intention of setting it, and when done, clearing it. |
| 960 | */ | 868 | */ |
| 961 | static inline int wait_on_bit_lock(void *word, int bit, | 869 | static inline int |
| 962 | int (*action)(void *), unsigned mode) | 870 | wait_on_bit_lock(void *word, int bit, int (*action)(void *), unsigned mode) |
| 963 | { | 871 | { |
| 964 | if (!test_and_set_bit(bit, word)) | 872 | if (!test_and_set_bit(bit, word)) |
| 965 | return 0; | 873 | return 0; |
| @@ -983,5 +891,5 @@ int wait_on_atomic_t(atomic_t *val, int (*action)(atomic_t *), unsigned mode) | |||
| 983 | return 0; | 891 | return 0; |
| 984 | return out_of_line_wait_on_atomic_t(val, action, mode); | 892 | return out_of_line_wait_on_atomic_t(val, action, mode); |
| 985 | } | 893 | } |
| 986 | 894 | ||
| 987 | #endif | 895 | #endif /* _LINUX_WAIT_H */ |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 021b8a319b9e..fc0e4320aa6d 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
| @@ -97,7 +97,7 @@ void writeback_inodes_sb_nr(struct super_block *, unsigned long nr, | |||
| 97 | int try_to_writeback_inodes_sb(struct super_block *, enum wb_reason reason); | 97 | int try_to_writeback_inodes_sb(struct super_block *, enum wb_reason reason); |
| 98 | int try_to_writeback_inodes_sb_nr(struct super_block *, unsigned long nr, | 98 | int try_to_writeback_inodes_sb_nr(struct super_block *, unsigned long nr, |
| 99 | enum wb_reason reason); | 99 | enum wb_reason reason); |
| 100 | void sync_inodes_sb(struct super_block *); | 100 | void sync_inodes_sb(struct super_block *sb, unsigned long older_than_this); |
| 101 | void wakeup_flusher_threads(long nr_pages, enum wb_reason reason); | 101 | void wakeup_flusher_threads(long nr_pages, enum wb_reason reason); |
| 102 | void inode_wait_for_writeback(struct inode *inode); | 102 | void inode_wait_for_writeback(struct inode *inode); |
| 103 | 103 | ||
