diff options
| author | Jiri Kosina <jkosina@suse.cz> | 2013-03-09 04:58:13 -0500 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2013-03-09 05:01:06 -0500 |
| commit | 83a44ac8bf4a8e6cbbf0c00ff281a482778f708a (patch) | |
| tree | 325be1e4d52372db888396549908f25c5370caee /include | |
| parent | 4ba25d3f87fe3ed6634f61da2a6904e2dfd09192 (diff) | |
| parent | d381f45c890a3fb136afb0dc1cbe025e066cb981 (diff) | |
HID: Merge branch 'master' into for-3.10/hid-driver-transport-cleanups
Sync with Linus' tree. This is necessary to resolve build conflict
caused by dcd9006b1b053c7b ("HID: logitech-dj: do not directly call
hid_output_raw_report() during probe") which issues direct call to
usbhid_submit_report(), but that is gone in this branch and
hid_hw_request() has to be used instead.
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'include')
292 files changed, 6549 insertions, 2013 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 227ba7dc293d..22ba56e834e2 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
| @@ -323,6 +323,15 @@ struct acpi_eject_event { | |||
| 323 | u32 event; | 323 | u32 event; |
| 324 | }; | 324 | }; |
| 325 | 325 | ||
| 326 | struct acpi_hp_work { | ||
| 327 | struct work_struct work; | ||
| 328 | acpi_handle handle; | ||
| 329 | u32 type; | ||
| 330 | void *context; | ||
| 331 | }; | ||
| 332 | void alloc_acpi_hp_work(acpi_handle handle, u32 type, void *context, | ||
| 333 | void (*func)(struct work_struct *work)); | ||
| 334 | |||
| 326 | extern struct kobject *acpi_kobj; | 335 | extern struct kobject *acpi_kobj; |
| 327 | extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int); | 336 | extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int); |
| 328 | void acpi_bus_private_data_handler(acpi_handle, void *); | 337 | void acpi_bus_private_data_handler(acpi_handle, void *); |
| @@ -428,11 +437,9 @@ void acpi_remove_dir(struct acpi_device *); | |||
| 428 | */ | 437 | */ |
| 429 | struct acpi_bus_type { | 438 | struct acpi_bus_type { |
| 430 | struct list_head list; | 439 | struct list_head list; |
| 431 | struct bus_type *bus; | 440 | const char *name; |
| 432 | /* For general devices under the bus */ | 441 | bool (*match)(struct device *dev); |
| 433 | int (*find_device) (struct device *, acpi_handle *); | 442 | int (*find_device) (struct device *, acpi_handle *); |
| 434 | /* For bridges, such as PCI root bridge, IDE controller */ | ||
| 435 | int (*find_bridge) (struct device *, acpi_handle *); | ||
| 436 | void (*setup)(struct device *); | 443 | void (*setup)(struct device *); |
| 437 | void (*cleanup)(struct device *); | 444 | void (*cleanup)(struct device *); |
| 438 | }; | 445 | }; |
| @@ -454,7 +461,6 @@ struct acpi_pci_root { | |||
| 454 | /* helper */ | 461 | /* helper */ |
| 455 | acpi_handle acpi_get_child(acpi_handle, u64); | 462 | acpi_handle acpi_get_child(acpi_handle, u64); |
| 456 | int acpi_is_root_bridge(acpi_handle); | 463 | int acpi_is_root_bridge(acpi_handle); |
| 457 | acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); | ||
| 458 | struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle); | 464 | struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle); |
| 459 | #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)ACPI_HANDLE(dev)) | 465 | #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)ACPI_HANDLE(dev)) |
| 460 | 466 | ||
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index 8b1d7a6a9695..627749af0ba7 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h | |||
| @@ -90,11 +90,6 @@ int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *triggering, | |||
| 90 | int *polarity, char **name); | 90 | int *polarity, char **name); |
| 91 | int acpi_pci_link_free_irq(acpi_handle handle); | 91 | int acpi_pci_link_free_irq(acpi_handle handle); |
| 92 | 92 | ||
| 93 | /* ACPI PCI Interrupt Routing (pci_irq.c) */ | ||
| 94 | |||
| 95 | int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus); | ||
| 96 | void acpi_pci_irq_del_prt(int segment, int bus); | ||
| 97 | |||
| 98 | /* ACPI PCI Device Binding (pci_bind.c) */ | 93 | /* ACPI PCI Device Binding (pci_bind.c) */ |
| 99 | 94 | ||
| 100 | struct pci_bus; | 95 | struct pci_bus; |
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 7d2a9eaab9eb..5b3d2bd4813a 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h | |||
| @@ -194,8 +194,6 @@ void acpi_os_fixed_event_count(u32 fixed_event_number); | |||
| 194 | /* | 194 | /* |
| 195 | * Threads and Scheduling | 195 | * Threads and Scheduling |
| 196 | */ | 196 | */ |
| 197 | extern struct workqueue_struct *kacpi_hotplug_wq; | ||
| 198 | |||
| 199 | acpi_thread_id acpi_os_get_thread_id(void); | 197 | acpi_thread_id acpi_os_get_thread_id(void); |
| 200 | 198 | ||
| 201 | acpi_status | 199 | acpi_status |
diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h new file mode 100644 index 000000000000..720446cb243e --- /dev/null +++ b/include/acpi/ghes.h | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | #include <acpi/apei.h> | ||
| 2 | #include <acpi/hed.h> | ||
| 3 | |||
| 4 | /* | ||
| 5 | * One struct ghes is created for each generic hardware error source. | ||
| 6 | * It provides the context for APEI hardware error timer/IRQ/SCI/NMI | ||
| 7 | * handler. | ||
| 8 | * | ||
| 9 | * estatus: memory buffer for error status block, allocated during | ||
| 10 | * HEST parsing. | ||
| 11 | */ | ||
| 12 | #define GHES_TO_CLEAR 0x0001 | ||
| 13 | #define GHES_EXITING 0x0002 | ||
| 14 | |||
| 15 | struct ghes { | ||
| 16 | struct acpi_hest_generic *generic; | ||
| 17 | struct acpi_hest_generic_status *estatus; | ||
| 18 | u64 buffer_paddr; | ||
| 19 | unsigned long flags; | ||
| 20 | union { | ||
| 21 | struct list_head list; | ||
| 22 | struct timer_list timer; | ||
| 23 | unsigned int irq; | ||
| 24 | }; | ||
| 25 | }; | ||
| 26 | |||
| 27 | struct ghes_estatus_node { | ||
| 28 | struct llist_node llnode; | ||
| 29 | struct acpi_hest_generic *generic; | ||
| 30 | struct ghes *ghes; | ||
| 31 | }; | ||
| 32 | |||
| 33 | struct ghes_estatus_cache { | ||
| 34 | u32 estatus_len; | ||
| 35 | atomic_t count; | ||
| 36 | struct acpi_hest_generic *generic; | ||
| 37 | unsigned long long time_in; | ||
| 38 | struct rcu_head rcu; | ||
| 39 | }; | ||
| 40 | |||
| 41 | enum { | ||
| 42 | GHES_SEV_NO = 0x0, | ||
| 43 | GHES_SEV_CORRECTED = 0x1, | ||
| 44 | GHES_SEV_RECOVERABLE = 0x2, | ||
| 45 | GHES_SEV_PANIC = 0x3, | ||
| 46 | }; | ||
| 47 | |||
| 48 | /* From drivers/edac/ghes_edac.c */ | ||
| 49 | |||
| 50 | #ifdef CONFIG_EDAC_GHES | ||
| 51 | void ghes_edac_report_mem_error(struct ghes *ghes, int sev, | ||
| 52 | struct cper_sec_mem_err *mem_err); | ||
| 53 | |||
| 54 | int ghes_edac_register(struct ghes *ghes, struct device *dev); | ||
| 55 | |||
| 56 | void ghes_edac_unregister(struct ghes *ghes); | ||
| 57 | |||
| 58 | #else | ||
| 59 | static inline void ghes_edac_report_mem_error(struct ghes *ghes, int sev, | ||
| 60 | struct cper_sec_mem_err *mem_err) | ||
| 61 | { | ||
| 62 | } | ||
| 63 | |||
| 64 | static inline int ghes_edac_register(struct ghes *ghes, struct device *dev) | ||
| 65 | { | ||
| 66 | return 0; | ||
| 67 | } | ||
| 68 | |||
| 69 | static inline void ghes_edac_unregister(struct ghes *ghes) | ||
| 70 | { | ||
| 71 | } | ||
| 72 | #endif | ||
diff --git a/include/asm-generic/checksum.h b/include/asm-generic/checksum.h index c084767c88bc..59811df58c5b 100644 --- a/include/asm-generic/checksum.h +++ b/include/asm-generic/checksum.h | |||
| @@ -38,12 +38,15 @@ extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst, | |||
| 38 | csum_partial_copy((src), (dst), (len), (sum)) | 38 | csum_partial_copy((src), (dst), (len), (sum)) |
| 39 | #endif | 39 | #endif |
| 40 | 40 | ||
| 41 | #ifndef ip_fast_csum | ||
| 41 | /* | 42 | /* |
| 42 | * This is a version of ip_compute_csum() optimized for IP headers, | 43 | * This is a version of ip_compute_csum() optimized for IP headers, |
| 43 | * which always checksum on 4 octet boundaries. | 44 | * which always checksum on 4 octet boundaries. |
| 44 | */ | 45 | */ |
| 45 | extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl); | 46 | extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl); |
| 47 | #endif | ||
| 46 | 48 | ||
| 49 | #ifndef csum_fold | ||
| 47 | /* | 50 | /* |
| 48 | * Fold a partial checksum | 51 | * Fold a partial checksum |
| 49 | */ | 52 | */ |
| @@ -54,6 +57,7 @@ static inline __sum16 csum_fold(__wsum csum) | |||
| 54 | sum = (sum & 0xffff) + (sum >> 16); | 57 | sum = (sum & 0xffff) + (sum >> 16); |
| 55 | return (__force __sum16)~sum; | 58 | return (__force __sum16)~sum; |
| 56 | } | 59 | } |
| 60 | #endif | ||
| 57 | 61 | ||
| 58 | #ifndef csum_tcpudp_nofold | 62 | #ifndef csum_tcpudp_nofold |
| 59 | /* | 63 | /* |
diff --git a/include/asm-generic/cmpxchg-local.h b/include/asm-generic/cmpxchg-local.h index 2533fddd34a6..d8d4c898c1bb 100644 --- a/include/asm-generic/cmpxchg-local.h +++ b/include/asm-generic/cmpxchg-local.h | |||
| @@ -21,7 +21,7 @@ static inline unsigned long __cmpxchg_local_generic(volatile void *ptr, | |||
| 21 | if (size == 8 && sizeof(unsigned long) != 8) | 21 | if (size == 8 && sizeof(unsigned long) != 8) |
| 22 | wrong_size_cmpxchg(ptr); | 22 | wrong_size_cmpxchg(ptr); |
| 23 | 23 | ||
| 24 | local_irq_save(flags); | 24 | raw_local_irq_save(flags); |
| 25 | switch (size) { | 25 | switch (size) { |
| 26 | case 1: prev = *(u8 *)ptr; | 26 | case 1: prev = *(u8 *)ptr; |
| 27 | if (prev == old) | 27 | if (prev == old) |
| @@ -42,7 +42,7 @@ static inline unsigned long __cmpxchg_local_generic(volatile void *ptr, | |||
| 42 | default: | 42 | default: |
| 43 | wrong_size_cmpxchg(ptr); | 43 | wrong_size_cmpxchg(ptr); |
| 44 | } | 44 | } |
| 45 | local_irq_restore(flags); | 45 | raw_local_irq_restore(flags); |
| 46 | return prev; | 46 | return prev; |
| 47 | } | 47 | } |
| 48 | 48 | ||
| @@ -55,11 +55,11 @@ static inline u64 __cmpxchg64_local_generic(volatile void *ptr, | |||
| 55 | u64 prev; | 55 | u64 prev; |
| 56 | unsigned long flags; | 56 | unsigned long flags; |
| 57 | 57 | ||
| 58 | local_irq_save(flags); | 58 | raw_local_irq_save(flags); |
| 59 | prev = *(u64 *)ptr; | 59 | prev = *(u64 *)ptr; |
| 60 | if (prev == old) | 60 | if (prev == old) |
| 61 | *(u64 *)ptr = new; | 61 | *(u64 *)ptr = new; |
| 62 | local_irq_restore(flags); | 62 | raw_local_irq_restore(flags); |
| 63 | return prev; | 63 | return prev; |
| 64 | } | 64 | } |
| 65 | 65 | ||
diff --git a/include/asm-generic/cputime_nsecs.h b/include/asm-generic/cputime_nsecs.h index b6485cafb7bd..a8ece9a33aef 100644 --- a/include/asm-generic/cputime_nsecs.h +++ b/include/asm-generic/cputime_nsecs.h | |||
| @@ -76,7 +76,7 @@ static inline void cputime_to_timespec(const cputime_t ct, struct timespec *val) | |||
| 76 | /* | 76 | /* |
| 77 | * Convert cputime <-> timeval (msec) | 77 | * Convert cputime <-> timeval (msec) |
| 78 | */ | 78 | */ |
| 79 | static inline cputime_t timeval_to_cputime(struct timeval *val) | 79 | static inline cputime_t timeval_to_cputime(const struct timeval *val) |
| 80 | { | 80 | { |
| 81 | u64 ret = val->tv_sec * NSEC_PER_SEC + val->tv_usec * NSEC_PER_USEC; | 81 | u64 ret = val->tv_sec * NSEC_PER_SEC + val->tv_usec * NSEC_PER_USEC; |
| 82 | return (__force cputime_t) ret; | 82 | return (__force cputime_t) ret; |
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index 20ca7663975f..bde646995d10 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h | |||
| @@ -47,12 +47,14 @@ struct gpio; | |||
| 47 | struct seq_file; | 47 | struct seq_file; |
| 48 | struct module; | 48 | struct module; |
| 49 | struct device_node; | 49 | struct device_node; |
| 50 | struct gpio_desc; | ||
| 50 | 51 | ||
| 51 | /** | 52 | /** |
| 52 | * struct gpio_chip - abstract a GPIO controller | 53 | * struct gpio_chip - abstract a GPIO controller |
| 53 | * @label: for diagnostics | 54 | * @label: for diagnostics |
| 54 | * @dev: optional device providing the GPIOs | 55 | * @dev: optional device providing the GPIOs |
| 55 | * @owner: helps prevent removal of modules exporting active GPIOs | 56 | * @owner: helps prevent removal of modules exporting active GPIOs |
| 57 | * @list: links gpio_chips together for traversal | ||
| 56 | * @request: optional hook for chip-specific activation, such as | 58 | * @request: optional hook for chip-specific activation, such as |
| 57 | * enabling module power and clock; may sleep | 59 | * enabling module power and clock; may sleep |
| 58 | * @free: optional hook for chip-specific deactivation, such as | 60 | * @free: optional hook for chip-specific deactivation, such as |
| @@ -75,6 +77,7 @@ struct device_node; | |||
| 75 | * negative during registration, requests dynamic ID allocation. | 77 | * negative during registration, requests dynamic ID allocation. |
| 76 | * @ngpio: the number of GPIOs handled by this controller; the last GPIO | 78 | * @ngpio: the number of GPIOs handled by this controller; the last GPIO |
| 77 | * handled is (base + ngpio - 1). | 79 | * handled is (base + ngpio - 1). |
| 80 | * @desc: array of ngpio descriptors. Private. | ||
| 78 | * @can_sleep: flag must be set iff get()/set() methods sleep, as they | 81 | * @can_sleep: flag must be set iff get()/set() methods sleep, as they |
| 79 | * must while accessing GPIO expander chips over I2C or SPI | 82 | * must while accessing GPIO expander chips over I2C or SPI |
| 80 | * @names: if set, must be an array of strings to use as alternative | 83 | * @names: if set, must be an array of strings to use as alternative |
| @@ -98,6 +101,7 @@ struct gpio_chip { | |||
| 98 | const char *label; | 101 | const char *label; |
| 99 | struct device *dev; | 102 | struct device *dev; |
| 100 | struct module *owner; | 103 | struct module *owner; |
| 104 | struct list_head list; | ||
| 101 | 105 | ||
| 102 | int (*request)(struct gpio_chip *chip, | 106 | int (*request)(struct gpio_chip *chip, |
| 103 | unsigned offset); | 107 | unsigned offset); |
| @@ -124,6 +128,7 @@ struct gpio_chip { | |||
| 124 | struct gpio_chip *chip); | 128 | struct gpio_chip *chip); |
| 125 | int base; | 129 | int base; |
| 126 | u16 ngpio; | 130 | u16 ngpio; |
| 131 | struct gpio_desc *desc; | ||
| 127 | const char *const *names; | 132 | const char *const *names; |
| 128 | unsigned can_sleep:1; | 133 | unsigned can_sleep:1; |
| 129 | unsigned exported:1; | 134 | unsigned exported:1; |
| @@ -152,7 +157,6 @@ struct gpio_chip { | |||
| 152 | extern const char *gpiochip_is_requested(struct gpio_chip *chip, | 157 | extern const char *gpiochip_is_requested(struct gpio_chip *chip, |
| 153 | unsigned offset); | 158 | unsigned offset); |
| 154 | extern struct gpio_chip *gpio_to_chip(unsigned gpio); | 159 | extern struct gpio_chip *gpio_to_chip(unsigned gpio); |
| 155 | extern int __must_check gpiochip_reserve(int start, int ngpio); | ||
| 156 | 160 | ||
| 157 | /* add/remove chips */ | 161 | /* add/remove chips */ |
| 158 | extern int gpiochip_add(struct gpio_chip *chip); | 162 | extern int gpiochip_add(struct gpio_chip *chip); |
| @@ -192,12 +196,6 @@ extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *labe | |||
| 192 | extern int gpio_request_array(const struct gpio *array, size_t num); | 196 | extern int gpio_request_array(const struct gpio *array, size_t num); |
| 193 | extern void gpio_free_array(const struct gpio *array, size_t num); | 197 | extern void gpio_free_array(const struct gpio *array, size_t num); |
| 194 | 198 | ||
| 195 | /* bindings for managed devices that want to request gpios */ | ||
| 196 | int devm_gpio_request(struct device *dev, unsigned gpio, const char *label); | ||
| 197 | int devm_gpio_request_one(struct device *dev, unsigned gpio, | ||
| 198 | unsigned long flags, const char *label); | ||
| 199 | void devm_gpio_free(struct device *dev, unsigned int gpio); | ||
| 200 | |||
| 201 | #ifdef CONFIG_GPIO_SYSFS | 199 | #ifdef CONFIG_GPIO_SYSFS |
| 202 | 200 | ||
| 203 | /* | 201 | /* |
| @@ -212,6 +210,43 @@ extern void gpio_unexport(unsigned gpio); | |||
| 212 | 210 | ||
| 213 | #endif /* CONFIG_GPIO_SYSFS */ | 211 | #endif /* CONFIG_GPIO_SYSFS */ |
| 214 | 212 | ||
| 213 | #ifdef CONFIG_PINCTRL | ||
| 214 | |||
| 215 | /** | ||
| 216 | * struct gpio_pin_range - pin range controlled by a gpio chip | ||
| 217 | * @head: list for maintaining set of pin ranges, used internally | ||
| 218 | * @pctldev: pinctrl device which handles corresponding pins | ||
| 219 | * @range: actual range of pins controlled by a gpio controller | ||
| 220 | */ | ||
| 221 | |||
| 222 | struct gpio_pin_range { | ||
| 223 | struct list_head node; | ||
| 224 | struct pinctrl_dev *pctldev; | ||
| 225 | struct pinctrl_gpio_range range; | ||
| 226 | }; | ||
| 227 | |||
| 228 | int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, | ||
| 229 | unsigned int gpio_offset, unsigned int pin_offset, | ||
| 230 | unsigned int npins); | ||
| 231 | void gpiochip_remove_pin_ranges(struct gpio_chip *chip); | ||
| 232 | |||
| 233 | #else | ||
| 234 | |||
| 235 | static inline int | ||
| 236 | gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, | ||
| 237 | unsigned int gpio_offset, unsigned int pin_offset, | ||
| 238 | unsigned int npins) | ||
| 239 | { | ||
| 240 | return 0; | ||
| 241 | } | ||
| 242 | |||
| 243 | static inline void | ||
| 244 | gpiochip_remove_pin_ranges(struct gpio_chip *chip) | ||
| 245 | { | ||
| 246 | } | ||
| 247 | |||
| 248 | #endif /* CONFIG_PINCTRL */ | ||
| 249 | |||
| 215 | #else /* !CONFIG_GPIOLIB */ | 250 | #else /* !CONFIG_GPIOLIB */ |
| 216 | 251 | ||
| 217 | static inline bool gpio_is_valid(int number) | 252 | static inline bool gpio_is_valid(int number) |
| @@ -270,41 +305,4 @@ static inline void gpio_unexport(unsigned gpio) | |||
| 270 | } | 305 | } |
| 271 | #endif /* CONFIG_GPIO_SYSFS */ | 306 | #endif /* CONFIG_GPIO_SYSFS */ |
| 272 | 307 | ||
| 273 | #ifdef CONFIG_PINCTRL | ||
| 274 | |||
| 275 | /** | ||
| 276 | * struct gpio_pin_range - pin range controlled by a gpio chip | ||
| 277 | * @head: list for maintaining set of pin ranges, used internally | ||
| 278 | * @pctldev: pinctrl device which handles corresponding pins | ||
| 279 | * @range: actual range of pins controlled by a gpio controller | ||
| 280 | */ | ||
| 281 | |||
| 282 | struct gpio_pin_range { | ||
| 283 | struct list_head node; | ||
| 284 | struct pinctrl_dev *pctldev; | ||
| 285 | struct pinctrl_gpio_range range; | ||
| 286 | }; | ||
| 287 | |||
| 288 | int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, | ||
| 289 | unsigned int gpio_offset, unsigned int pin_offset, | ||
| 290 | unsigned int npins); | ||
| 291 | void gpiochip_remove_pin_ranges(struct gpio_chip *chip); | ||
| 292 | |||
| 293 | #else | ||
| 294 | |||
| 295 | static inline int | ||
| 296 | gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, | ||
| 297 | unsigned int gpio_offset, unsigned int pin_offset, | ||
| 298 | unsigned int npins) | ||
| 299 | { | ||
| 300 | return 0; | ||
| 301 | } | ||
| 302 | |||
| 303 | static inline void | ||
| 304 | gpiochip_remove_pin_ranges(struct gpio_chip *chip) | ||
| 305 | { | ||
| 306 | } | ||
| 307 | |||
| 308 | #endif /* CONFIG_PINCTRL */ | ||
| 309 | |||
| 310 | #endif /* _ASM_GENERIC_GPIO_H */ | 308 | #endif /* _ASM_GENERIC_GPIO_H */ |
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index 33bbbae4ddc6..ac9da00e9f2c 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h | |||
| @@ -53,8 +53,18 @@ static inline u32 __raw_readl(const volatile void __iomem *addr) | |||
| 53 | #endif | 53 | #endif |
| 54 | 54 | ||
| 55 | #define readb __raw_readb | 55 | #define readb __raw_readb |
| 56 | #define readw(addr) __le16_to_cpu(__raw_readw(addr)) | 56 | |
| 57 | #define readl(addr) __le32_to_cpu(__raw_readl(addr)) | 57 | #define readw readw |
| 58 | static inline u16 readw(const volatile void __iomem *addr) | ||
| 59 | { | ||
| 60 | return __le16_to_cpu(__raw_readw(addr)); | ||
| 61 | } | ||
| 62 | |||
| 63 | #define readl readl | ||
| 64 | static inline u32 readl(const volatile void __iomem *addr) | ||
| 65 | { | ||
| 66 | return __le32_to_cpu(__raw_readl(addr)); | ||
| 67 | } | ||
| 58 | 68 | ||
| 59 | #ifndef __raw_writeb | 69 | #ifndef __raw_writeb |
| 60 | static inline void __raw_writeb(u8 b, volatile void __iomem *addr) | 70 | static inline void __raw_writeb(u8 b, volatile void __iomem *addr) |
| @@ -89,7 +99,11 @@ static inline u64 __raw_readq(const volatile void __iomem *addr) | |||
| 89 | } | 99 | } |
| 90 | #endif | 100 | #endif |
| 91 | 101 | ||
| 92 | #define readq(addr) __le64_to_cpu(__raw_readq(addr)) | 102 | #define readq readq |
| 103 | static inline u64 readq(const volatile void __iomem *addr) | ||
| 104 | { | ||
| 105 | return __le64_to_cpu(__raw_readq(addr)); | ||
| 106 | } | ||
| 93 | 107 | ||
| 94 | #ifndef __raw_writeq | 108 | #ifndef __raw_writeq |
| 95 | static inline void __raw_writeq(u64 b, volatile void __iomem *addr) | 109 | static inline void __raw_writeq(u64 b, volatile void __iomem *addr) |
| @@ -225,15 +239,15 @@ static inline void outsl(unsigned long addr, const void *buffer, int count) | |||
| 225 | #ifndef CONFIG_GENERIC_IOMAP | 239 | #ifndef CONFIG_GENERIC_IOMAP |
| 226 | #define ioread8(addr) readb(addr) | 240 | #define ioread8(addr) readb(addr) |
| 227 | #define ioread16(addr) readw(addr) | 241 | #define ioread16(addr) readw(addr) |
| 228 | #define ioread16be(addr) be16_to_cpu(ioread16(addr)) | 242 | #define ioread16be(addr) __be16_to_cpu(__raw_readw(addr)) |
| 229 | #define ioread32(addr) readl(addr) | 243 | #define ioread32(addr) readl(addr) |
| 230 | #define ioread32be(addr) be32_to_cpu(ioread32(addr)) | 244 | #define ioread32be(addr) __be32_to_cpu(__raw_readl(addr)) |
| 231 | 245 | ||
| 232 | #define iowrite8(v, addr) writeb((v), (addr)) | 246 | #define iowrite8(v, addr) writeb((v), (addr)) |
| 233 | #define iowrite16(v, addr) writew((v), (addr)) | 247 | #define iowrite16(v, addr) writew((v), (addr)) |
| 234 | #define iowrite16be(v, addr) iowrite16(be16_to_cpu(v), (addr)) | 248 | #define iowrite16be(v, addr) __raw_writew(__cpu_to_be16(v), addr) |
| 235 | #define iowrite32(v, addr) writel((v), (addr)) | 249 | #define iowrite32(v, addr) writel((v), (addr)) |
| 236 | #define iowrite32be(v, addr) iowrite32(be32_to_cpu(v), (addr)) | 250 | #define iowrite32be(v, addr) __raw_writel(__cpu_to_be32(v), addr) |
| 237 | 251 | ||
| 238 | #define ioread8_rep(p, dst, count) \ | 252 | #define ioread8_rep(p, dst, count) \ |
| 239 | insb((unsigned long) (p), (dst), (count)) | 253 | insb((unsigned long) (p), (dst), (count)) |
| @@ -332,6 +346,7 @@ extern void ioport_unmap(void __iomem *p); | |||
| 332 | #define xlate_dev_kmem_ptr(p) p | 346 | #define xlate_dev_kmem_ptr(p) p |
| 333 | #define xlate_dev_mem_ptr(p) __va(p) | 347 | #define xlate_dev_mem_ptr(p) __va(p) |
| 334 | 348 | ||
| 349 | #ifdef CONFIG_VIRT_TO_BUS | ||
| 335 | #ifndef virt_to_bus | 350 | #ifndef virt_to_bus |
| 336 | static inline unsigned long virt_to_bus(volatile void *address) | 351 | static inline unsigned long virt_to_bus(volatile void *address) |
| 337 | { | 352 | { |
| @@ -343,6 +358,7 @@ static inline void *bus_to_virt(unsigned long address) | |||
| 343 | return (void *) address; | 358 | return (void *) address; |
| 344 | } | 359 | } |
| 345 | #endif | 360 | #endif |
| 361 | #endif | ||
| 346 | 362 | ||
| 347 | #ifndef memset_io | 363 | #ifndef memset_io |
| 348 | #define memset_io(a, b, c) memset(__io_virt(a), (b), (c)) | 364 | #define memset_io(a, b, c) memset(__io_virt(a), (b), (c)) |
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 5cf680a98f9b..bfd87685fc1f 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
| @@ -197,16 +197,6 @@ static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b) | |||
| 197 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ | 197 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ |
| 198 | #endif | 198 | #endif |
| 199 | 199 | ||
| 200 | #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_DIRTY | ||
| 201 | #define page_test_and_clear_dirty(pfn, mapped) (0) | ||
| 202 | #endif | ||
| 203 | |||
| 204 | #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_DIRTY | ||
| 205 | #define pte_maybe_dirty(pte) pte_dirty(pte) | ||
| 206 | #else | ||
| 207 | #define pte_maybe_dirty(pte) (1) | ||
| 208 | #endif | ||
| 209 | |||
| 210 | #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_YOUNG | 200 | #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_YOUNG |
| 211 | #define page_test_and_clear_young(pfn) (0) | 201 | #define page_test_and_clear_young(pfn) (0) |
| 212 | #endif | 202 | #endif |
diff --git a/include/asm-generic/syscalls.h b/include/asm-generic/syscalls.h index 1db51b8524e9..1f74be5113b2 100644 --- a/include/asm-generic/syscalls.h +++ b/include/asm-generic/syscalls.h | |||
| @@ -21,24 +21,8 @@ asmlinkage long sys_mmap(unsigned long addr, unsigned long len, | |||
| 21 | unsigned long fd, off_t pgoff); | 21 | unsigned long fd, off_t pgoff); |
| 22 | #endif | 22 | #endif |
| 23 | 23 | ||
| 24 | #ifndef CONFIG_GENERIC_SIGALTSTACK | ||
| 25 | #ifndef sys_sigaltstack | ||
| 26 | asmlinkage long sys_sigaltstack(const stack_t __user *, stack_t __user *, | ||
| 27 | struct pt_regs *); | ||
| 28 | #endif | ||
| 29 | #endif | ||
| 30 | |||
| 31 | #ifndef sys_rt_sigreturn | 24 | #ifndef sys_rt_sigreturn |
| 32 | asmlinkage long sys_rt_sigreturn(struct pt_regs *regs); | 25 | asmlinkage long sys_rt_sigreturn(struct pt_regs *regs); |
| 33 | #endif | 26 | #endif |
| 34 | 27 | ||
| 35 | #ifndef sys_rt_sigsuspend | ||
| 36 | asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize); | ||
| 37 | #endif | ||
| 38 | |||
| 39 | #ifndef sys_rt_sigaction | ||
| 40 | asmlinkage long sys_rt_sigaction(int sig, const struct sigaction __user *act, | ||
| 41 | struct sigaction __user *oact, size_t sigsetsize); | ||
| 42 | #endif | ||
| 43 | |||
| 44 | #endif /* __ASM_GENERIC_SYSCALLS_H */ | 28 | #endif /* __ASM_GENERIC_SYSCALLS_H */ |
diff --git a/include/asm-generic/uaccess.h b/include/asm-generic/uaccess.h index 9788568f7978..c184aa8ec8cd 100644 --- a/include/asm-generic/uaccess.h +++ b/include/asm-generic/uaccess.h | |||
| @@ -7,7 +7,6 @@ | |||
| 7 | * address space, e.g. all NOMMU machines. | 7 | * address space, e.g. all NOMMU machines. |
| 8 | */ | 8 | */ |
| 9 | #include <linux/sched.h> | 9 | #include <linux/sched.h> |
| 10 | #include <linux/mm.h> | ||
| 11 | #include <linux/string.h> | 10 | #include <linux/string.h> |
| 12 | 11 | ||
| 13 | #include <asm/segment.h> | 12 | #include <asm/segment.h> |
| @@ -32,7 +31,9 @@ static inline void set_fs(mm_segment_t fs) | |||
| 32 | } | 31 | } |
| 33 | #endif | 32 | #endif |
| 34 | 33 | ||
| 34 | #ifndef segment_eq | ||
| 35 | #define segment_eq(a, b) ((a).seg == (b).seg) | 35 | #define segment_eq(a, b) ((a).seg == (b).seg) |
| 36 | #endif | ||
| 36 | 37 | ||
| 37 | #define VERIFY_READ 0 | 38 | #define VERIFY_READ 0 |
| 38 | #define VERIFY_WRITE 1 | 39 | #define VERIFY_WRITE 1 |
| @@ -168,12 +169,18 @@ static inline __must_check long __copy_to_user(void __user *to, | |||
| 168 | -EFAULT; \ | 169 | -EFAULT; \ |
| 169 | }) | 170 | }) |
| 170 | 171 | ||
| 172 | #ifndef __put_user_fn | ||
| 173 | |||
| 171 | static inline int __put_user_fn(size_t size, void __user *ptr, void *x) | 174 | static inline int __put_user_fn(size_t size, void __user *ptr, void *x) |
| 172 | { | 175 | { |
| 173 | size = __copy_to_user(ptr, x, size); | 176 | size = __copy_to_user(ptr, x, size); |
| 174 | return size ? -EFAULT : size; | 177 | return size ? -EFAULT : size; |
| 175 | } | 178 | } |
| 176 | 179 | ||
| 180 | #define __put_user_fn(sz, u, k) __put_user_fn(sz, u, k) | ||
| 181 | |||
| 182 | #endif | ||
| 183 | |||
| 177 | extern int __put_user_bad(void) __attribute__((noreturn)); | 184 | extern int __put_user_bad(void) __attribute__((noreturn)); |
| 178 | 185 | ||
| 179 | #define __get_user(x, ptr) \ | 186 | #define __get_user(x, ptr) \ |
| @@ -224,12 +231,17 @@ extern int __put_user_bad(void) __attribute__((noreturn)); | |||
| 224 | -EFAULT; \ | 231 | -EFAULT; \ |
| 225 | }) | 232 | }) |
| 226 | 233 | ||
| 234 | #ifndef __get_user_fn | ||
| 227 | static inline int __get_user_fn(size_t size, const void __user *ptr, void *x) | 235 | static inline int __get_user_fn(size_t size, const void __user *ptr, void *x) |
| 228 | { | 236 | { |
| 229 | size = __copy_from_user(x, ptr, size); | 237 | size = __copy_from_user(x, ptr, size); |
| 230 | return size ? -EFAULT : size; | 238 | return size ? -EFAULT : size; |
| 231 | } | 239 | } |
| 232 | 240 | ||
| 241 | #define __get_user_fn(sz, u, k) __get_user_fn(sz, u, k) | ||
| 242 | |||
| 243 | #endif | ||
| 244 | |||
| 233 | extern int __get_user_bad(void) __attribute__((noreturn)); | 245 | extern int __get_user_bad(void) __attribute__((noreturn)); |
| 234 | 246 | ||
| 235 | #ifndef __copy_from_user_inatomic | 247 | #ifndef __copy_from_user_inatomic |
diff --git a/include/asm-generic/unistd.h b/include/asm-generic/unistd.h index a36991ab334e..4077b5d9ff81 100644 --- a/include/asm-generic/unistd.h +++ b/include/asm-generic/unistd.h | |||
| @@ -9,9 +9,6 @@ | |||
| 9 | #define __ARCH_WANT_STAT64 | 9 | #define __ARCH_WANT_STAT64 |
| 10 | #define __ARCH_WANT_SYS_LLSEEK | 10 | #define __ARCH_WANT_SYS_LLSEEK |
| 11 | #endif | 11 | #endif |
| 12 | #define __ARCH_WANT_SYS_RT_SIGACTION | ||
| 13 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND | ||
| 14 | #define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND | ||
| 15 | 12 | ||
| 16 | /* | 13 | /* |
| 17 | * "Conditional" syscalls | 14 | * "Conditional" syscalls |
| @@ -20,5 +17,12 @@ | |||
| 20 | * but it doesn't work on all toolchains, so we just do it by hand | 17 | * but it doesn't work on all toolchains, so we just do it by hand |
| 21 | */ | 18 | */ |
| 22 | #ifndef cond_syscall | 19 | #ifndef cond_syscall |
| 23 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") | 20 | #ifdef CONFIG_SYMBOL_PREFIX |
| 21 | #define __SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX | ||
| 22 | #else | ||
| 23 | #define __SYMBOL_PREFIX | ||
| 24 | #endif | ||
| 25 | #define cond_syscall(x) asm(".weak\t" __SYMBOL_PREFIX #x "\n\t" \ | ||
| 26 | ".set\t" __SYMBOL_PREFIX #x "," \ | ||
| 27 | __SYMBOL_PREFIX "sys_ni_syscall") | ||
| 24 | #endif | 28 | #endif |
diff --git a/include/clocksource/metag_generic.h b/include/clocksource/metag_generic.h new file mode 100644 index 000000000000..ac17e7d06cfb --- /dev/null +++ b/include/clocksource/metag_generic.h | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2013 Imaginaton Technologies Ltd. | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License version 2 as | ||
| 6 | * published by the Free Software Foundation. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | #ifndef __CLKSOURCE_METAG_GENERIC_H | ||
| 17 | #define __CLKSOURCE_METAG_GENERIC_H | ||
| 18 | |||
| 19 | extern int metag_generic_timer_init(void); | ||
| 20 | |||
| 21 | #endif /* __CLKSOURCE_METAG_GENERIC_H */ | ||
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index fad21c927a38..2d94d7413d71 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
| @@ -85,6 +85,9 @@ struct module; | |||
| 85 | struct drm_file; | 85 | struct drm_file; |
| 86 | struct drm_device; | 86 | struct drm_device; |
| 87 | 87 | ||
| 88 | struct device_node; | ||
| 89 | struct videomode; | ||
| 90 | |||
| 88 | #include <drm/drm_os_linux.h> | 91 | #include <drm/drm_os_linux.h> |
| 89 | #include <drm/drm_hashtab.h> | 92 | #include <drm/drm_hashtab.h> |
| 90 | #include <drm/drm_mm.h> | 93 | #include <drm/drm_mm.h> |
| @@ -446,7 +449,15 @@ struct drm_file { | |||
| 446 | int is_master; /* this file private is a master for a minor */ | 449 | int is_master; /* this file private is a master for a minor */ |
| 447 | struct drm_master *master; /* master this node is currently associated with | 450 | struct drm_master *master; /* master this node is currently associated with |
| 448 | N.B. not always minor->master */ | 451 | N.B. not always minor->master */ |
| 452 | |||
| 453 | /** | ||
| 454 | * fbs - List of framebuffers associated with this file. | ||
| 455 | * | ||
| 456 | * Protected by fbs_lock. Note that the fbs list holds a reference on | ||
| 457 | * the fb object to prevent it from untimely disappearing. | ||
| 458 | */ | ||
| 449 | struct list_head fbs; | 459 | struct list_head fbs; |
| 460 | struct mutex fbs_lock; | ||
| 450 | 461 | ||
| 451 | wait_queue_head_t event_wait; | 462 | wait_queue_head_t event_wait; |
| 452 | struct list_head event_list; | 463 | struct list_head event_list; |
| @@ -919,6 +930,14 @@ struct drm_driver { | |||
| 919 | /* import dmabuf -> GEM */ | 930 | /* import dmabuf -> GEM */ |
| 920 | struct drm_gem_object * (*gem_prime_import)(struct drm_device *dev, | 931 | struct drm_gem_object * (*gem_prime_import)(struct drm_device *dev, |
| 921 | struct dma_buf *dma_buf); | 932 | struct dma_buf *dma_buf); |
| 933 | /* low-level interface used by drm_gem_prime_{import,export} */ | ||
| 934 | int (*gem_prime_pin)(struct drm_gem_object *obj); | ||
| 935 | struct sg_table *(*gem_prime_get_sg_table)(struct drm_gem_object *obj); | ||
| 936 | struct drm_gem_object *(*gem_prime_import_sg_table)( | ||
| 937 | struct drm_device *dev, size_t size, | ||
| 938 | struct sg_table *sgt); | ||
| 939 | void *(*gem_prime_vmap)(struct drm_gem_object *obj); | ||
| 940 | void (*gem_prime_vunmap)(struct drm_gem_object *obj, void *vaddr); | ||
| 922 | 941 | ||
| 923 | /* vga arb irq handler */ | 942 | /* vga arb irq handler */ |
| 924 | void (*vgaarb_irq)(struct drm_device *dev, bool state); | 943 | void (*vgaarb_irq)(struct drm_device *dev, bool state); |
| @@ -1276,6 +1295,11 @@ static inline int drm_device_is_unplugged(struct drm_device *dev) | |||
| 1276 | return ret; | 1295 | return ret; |
| 1277 | } | 1296 | } |
| 1278 | 1297 | ||
| 1298 | static inline bool drm_modeset_is_locked(struct drm_device *dev) | ||
| 1299 | { | ||
| 1300 | return mutex_is_locked(&dev->mode_config.mutex); | ||
| 1301 | } | ||
| 1302 | |||
| 1279 | /******************************************************************/ | 1303 | /******************************************************************/ |
| 1280 | /** \name Internal function definitions */ | 1304 | /** \name Internal function definitions */ |
| 1281 | /*@{*/ | 1305 | /*@{*/ |
| @@ -1456,6 +1480,12 @@ extern struct drm_display_mode * | |||
| 1456 | drm_mode_create_from_cmdline_mode(struct drm_device *dev, | 1480 | drm_mode_create_from_cmdline_mode(struct drm_device *dev, |
| 1457 | struct drm_cmdline_mode *cmd); | 1481 | struct drm_cmdline_mode *cmd); |
| 1458 | 1482 | ||
| 1483 | extern int drm_display_mode_from_videomode(const struct videomode *vm, | ||
| 1484 | struct drm_display_mode *dmode); | ||
| 1485 | extern int of_get_drm_display_mode(struct device_node *np, | ||
| 1486 | struct drm_display_mode *dmode, | ||
| 1487 | int index); | ||
| 1488 | |||
| 1459 | /* Modesetting support */ | 1489 | /* Modesetting support */ |
| 1460 | extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc); | 1490 | extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc); |
| 1461 | extern void drm_vblank_post_modeset(struct drm_device *dev, int crtc); | 1491 | extern void drm_vblank_post_modeset(struct drm_device *dev, int crtc); |
| @@ -1540,9 +1570,13 @@ extern int drm_clients_info(struct seq_file *m, void* data); | |||
| 1540 | extern int drm_gem_name_info(struct seq_file *m, void *data); | 1570 | extern int drm_gem_name_info(struct seq_file *m, void *data); |
| 1541 | 1571 | ||
| 1542 | 1572 | ||
| 1573 | extern struct dma_buf *drm_gem_prime_export(struct drm_device *dev, | ||
| 1574 | struct drm_gem_object *obj, int flags); | ||
| 1543 | extern int drm_gem_prime_handle_to_fd(struct drm_device *dev, | 1575 | extern int drm_gem_prime_handle_to_fd(struct drm_device *dev, |
| 1544 | struct drm_file *file_priv, uint32_t handle, uint32_t flags, | 1576 | struct drm_file *file_priv, uint32_t handle, uint32_t flags, |
| 1545 | int *prime_fd); | 1577 | int *prime_fd); |
| 1578 | extern struct drm_gem_object *drm_gem_prime_import(struct drm_device *dev, | ||
| 1579 | struct dma_buf *dma_buf); | ||
| 1546 | extern int drm_gem_prime_fd_to_handle(struct drm_device *dev, | 1580 | extern int drm_gem_prime_fd_to_handle(struct drm_device *dev, |
| 1547 | struct drm_file *file_priv, int prime_fd, uint32_t *handle); | 1581 | struct drm_file *file_priv, int prime_fd, uint32_t *handle); |
| 1548 | 1582 | ||
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 00d78b5161c0..e3e0d651c6ca 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
| @@ -38,7 +38,8 @@ struct drm_device; | |||
| 38 | struct drm_mode_set; | 38 | struct drm_mode_set; |
| 39 | struct drm_framebuffer; | 39 | struct drm_framebuffer; |
| 40 | struct drm_object_properties; | 40 | struct drm_object_properties; |
| 41 | 41 | struct drm_file; | |
| 42 | struct drm_clip_rect; | ||
| 42 | 43 | ||
| 43 | #define DRM_MODE_OBJECT_CRTC 0xcccccccc | 44 | #define DRM_MODE_OBJECT_CRTC 0xcccccccc |
| 44 | #define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0 | 45 | #define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0 |
| @@ -254,6 +255,10 @@ struct drm_framebuffer { | |||
| 254 | * userspace perspective. | 255 | * userspace perspective. |
| 255 | */ | 256 | */ |
| 256 | struct kref refcount; | 257 | struct kref refcount; |
| 258 | /* | ||
| 259 | * Place on the dev->mode_config.fb_list, access protected by | ||
| 260 | * dev->mode_config.fb_lock. | ||
| 261 | */ | ||
| 257 | struct list_head head; | 262 | struct list_head head; |
| 258 | struct drm_mode_object base; | 263 | struct drm_mode_object base; |
| 259 | const struct drm_framebuffer_funcs *funcs; | 264 | const struct drm_framebuffer_funcs *funcs; |
| @@ -390,6 +395,15 @@ struct drm_crtc { | |||
| 390 | struct drm_device *dev; | 395 | struct drm_device *dev; |
| 391 | struct list_head head; | 396 | struct list_head head; |
| 392 | 397 | ||
| 398 | /** | ||
| 399 | * crtc mutex | ||
| 400 | * | ||
| 401 | * This provides a read lock for the overall crtc state (mode, dpms | ||
| 402 | * state, ...) and a write lock for everything which can be update | ||
| 403 | * without a full modeset (fb, cursor data, ...) | ||
| 404 | */ | ||
| 405 | struct mutex mutex; | ||
| 406 | |||
| 393 | struct drm_mode_object base; | 407 | struct drm_mode_object base; |
| 394 | 408 | ||
| 395 | /* framebuffer the connector is currently bound to */ | 409 | /* framebuffer the connector is currently bound to */ |
| @@ -429,12 +443,12 @@ struct drm_crtc { | |||
| 429 | * @dpms: set power state (see drm_crtc_funcs above) | 443 | * @dpms: set power state (see drm_crtc_funcs above) |
| 430 | * @save: save connector state | 444 | * @save: save connector state |
| 431 | * @restore: restore connector state | 445 | * @restore: restore connector state |
| 432 | * @reset: reset connector after state has been invalidate (e.g. resume) | 446 | * @reset: reset connector after state has been invalidated (e.g. resume) |
| 433 | * @detect: is this connector active? | 447 | * @detect: is this connector active? |
| 434 | * @fill_modes: fill mode list for this connector | 448 | * @fill_modes: fill mode list for this connector |
| 435 | * @set_property: property for this connector may need update | 449 | * @set_property: property for this connector may need an update |
| 436 | * @destroy: make object go away | 450 | * @destroy: make object go away |
| 437 | * @force: notify the driver the connector is forced on | 451 | * @force: notify the driver that the connector is forced on |
| 438 | * | 452 | * |
| 439 | * Each CRTC may have one or more connectors attached to it. The functions | 453 | * Each CRTC may have one or more connectors attached to it. The functions |
| 440 | * below allow the core DRM code to control connectors, enumerate available modes, | 454 | * below allow the core DRM code to control connectors, enumerate available modes, |
| @@ -771,8 +785,18 @@ struct drm_mode_config { | |||
| 771 | struct mutex idr_mutex; /* for IDR management */ | 785 | struct mutex idr_mutex; /* for IDR management */ |
| 772 | struct idr crtc_idr; /* use this idr for all IDs, fb, crtc, connector, modes - just makes life easier */ | 786 | struct idr crtc_idr; /* use this idr for all IDs, fb, crtc, connector, modes - just makes life easier */ |
| 773 | /* this is limited to one for now */ | 787 | /* this is limited to one for now */ |
| 788 | |||
| 789 | |||
| 790 | /** | ||
| 791 | * fb_lock - mutex to protect fb state | ||
| 792 | * | ||
| 793 | * Besides the global fb list his also protects the fbs list in the | ||
| 794 | * file_priv | ||
| 795 | */ | ||
| 796 | struct mutex fb_lock; | ||
| 774 | int num_fb; | 797 | int num_fb; |
| 775 | struct list_head fb_list; | 798 | struct list_head fb_list; |
| 799 | |||
| 776 | int num_connector; | 800 | int num_connector; |
| 777 | struct list_head connector_list; | 801 | struct list_head connector_list; |
| 778 | int num_encoder; | 802 | int num_encoder; |
| @@ -842,6 +866,10 @@ struct drm_prop_enum_list { | |||
| 842 | char *name; | 866 | char *name; |
| 843 | }; | 867 | }; |
| 844 | 868 | ||
| 869 | extern void drm_modeset_lock_all(struct drm_device *dev); | ||
| 870 | extern void drm_modeset_unlock_all(struct drm_device *dev); | ||
| 871 | extern void drm_warn_on_modeset_not_all_locked(struct drm_device *dev); | ||
| 872 | |||
| 845 | extern int drm_crtc_init(struct drm_device *dev, | 873 | extern int drm_crtc_init(struct drm_device *dev, |
| 846 | struct drm_crtc *crtc, | 874 | struct drm_crtc *crtc, |
| 847 | const struct drm_crtc_funcs *funcs); | 875 | const struct drm_crtc_funcs *funcs); |
| @@ -932,10 +960,13 @@ extern void drm_framebuffer_set_object(struct drm_device *dev, | |||
| 932 | extern int drm_framebuffer_init(struct drm_device *dev, | 960 | extern int drm_framebuffer_init(struct drm_device *dev, |
| 933 | struct drm_framebuffer *fb, | 961 | struct drm_framebuffer *fb, |
| 934 | const struct drm_framebuffer_funcs *funcs); | 962 | const struct drm_framebuffer_funcs *funcs); |
| 963 | extern struct drm_framebuffer *drm_framebuffer_lookup(struct drm_device *dev, | ||
| 964 | uint32_t id); | ||
| 935 | extern void drm_framebuffer_unreference(struct drm_framebuffer *fb); | 965 | extern void drm_framebuffer_unreference(struct drm_framebuffer *fb); |
| 936 | extern void drm_framebuffer_reference(struct drm_framebuffer *fb); | 966 | extern void drm_framebuffer_reference(struct drm_framebuffer *fb); |
| 937 | extern void drm_framebuffer_remove(struct drm_framebuffer *fb); | 967 | extern void drm_framebuffer_remove(struct drm_framebuffer *fb); |
| 938 | extern void drm_framebuffer_cleanup(struct drm_framebuffer *fb); | 968 | extern void drm_framebuffer_cleanup(struct drm_framebuffer *fb); |
| 969 | extern void drm_framebuffer_unregister_private(struct drm_framebuffer *fb); | ||
| 939 | extern int drmfb_probe(struct drm_device *dev, struct drm_crtc *crtc); | 970 | extern int drmfb_probe(struct drm_device *dev, struct drm_crtc *crtc); |
| 940 | extern int drmfb_remove(struct drm_device *dev, struct drm_framebuffer *fb); | 971 | extern int drmfb_remove(struct drm_device *dev, struct drm_framebuffer *fb); |
| 941 | extern void drm_crtc_probe_connector_modes(struct drm_device *dev, int maxX, int maxY); | 972 | extern void drm_crtc_probe_connector_modes(struct drm_device *dev, int maxX, int maxY); |
| @@ -985,6 +1016,7 @@ extern int drm_mode_getcrtc(struct drm_device *dev, | |||
| 985 | void *data, struct drm_file *file_priv); | 1016 | void *data, struct drm_file *file_priv); |
| 986 | extern int drm_mode_getconnector(struct drm_device *dev, | 1017 | extern int drm_mode_getconnector(struct drm_device *dev, |
| 987 | void *data, struct drm_file *file_priv); | 1018 | void *data, struct drm_file *file_priv); |
| 1019 | extern int drm_mode_set_config_internal(struct drm_mode_set *set); | ||
| 988 | extern int drm_mode_setcrtc(struct drm_device *dev, | 1020 | extern int drm_mode_setcrtc(struct drm_device *dev, |
| 989 | void *data, struct drm_file *file_priv); | 1021 | void *data, struct drm_file *file_priv); |
| 990 | extern int drm_mode_getplane(struct drm_device *dev, | 1022 | extern int drm_mode_getplane(struct drm_device *dev, |
| @@ -1030,9 +1062,10 @@ extern int drm_mode_gamma_get_ioctl(struct drm_device *dev, | |||
| 1030 | extern int drm_mode_gamma_set_ioctl(struct drm_device *dev, | 1062 | extern int drm_mode_gamma_set_ioctl(struct drm_device *dev, |
| 1031 | void *data, struct drm_file *file_priv); | 1063 | void *data, struct drm_file *file_priv); |
| 1032 | extern u8 *drm_find_cea_extension(struct edid *edid); | 1064 | extern u8 *drm_find_cea_extension(struct edid *edid); |
| 1033 | extern u8 drm_match_cea_mode(struct drm_display_mode *to_match); | 1065 | extern u8 drm_match_cea_mode(const struct drm_display_mode *to_match); |
| 1034 | extern bool drm_detect_hdmi_monitor(struct edid *edid); | 1066 | extern bool drm_detect_hdmi_monitor(struct edid *edid); |
| 1035 | extern bool drm_detect_monitor_audio(struct edid *edid); | 1067 | extern bool drm_detect_monitor_audio(struct edid *edid); |
| 1068 | extern bool drm_rgb_quant_range_selectable(struct edid *edid); | ||
| 1036 | extern int drm_mode_page_flip_ioctl(struct drm_device *dev, | 1069 | extern int drm_mode_page_flip_ioctl(struct drm_device *dev, |
| 1037 | void *data, struct drm_file *file_priv); | 1070 | void *data, struct drm_file *file_priv); |
| 1038 | extern struct drm_display_mode *drm_cvt_mode(struct drm_device *dev, | 1071 | extern struct drm_display_mode *drm_cvt_mode(struct drm_device *dev, |
| @@ -1047,7 +1080,6 @@ extern struct drm_display_mode *drm_gtf_mode_complex(struct drm_device *dev, | |||
| 1047 | int GTF_2C, int GTF_K, int GTF_2J); | 1080 | int GTF_2C, int GTF_K, int GTF_2J); |
| 1048 | extern int drm_add_modes_noedid(struct drm_connector *connector, | 1081 | extern int drm_add_modes_noedid(struct drm_connector *connector, |
| 1049 | int hdisplay, int vdisplay); | 1082 | int hdisplay, int vdisplay); |
| 1050 | extern uint8_t drm_mode_cea_vic(const struct drm_display_mode *mode); | ||
| 1051 | 1083 | ||
| 1052 | extern int drm_edid_header_is_valid(const u8 *raw_edid); | 1084 | extern int drm_edid_header_is_valid(const u8 *raw_edid); |
| 1053 | extern bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid); | 1085 | extern bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid); |
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index 0cac551c5347..5da1b4ae7d84 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h | |||
| @@ -247,6 +247,8 @@ struct edid { | |||
| 247 | struct drm_encoder; | 247 | struct drm_encoder; |
| 248 | struct drm_connector; | 248 | struct drm_connector; |
| 249 | struct drm_display_mode; | 249 | struct drm_display_mode; |
| 250 | struct hdmi_avi_infoframe; | ||
| 251 | |||
| 250 | void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid); | 252 | void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid); |
| 251 | int drm_av_sync_delay(struct drm_connector *connector, | 253 | int drm_av_sync_delay(struct drm_connector *connector, |
| 252 | struct drm_display_mode *mode); | 254 | struct drm_display_mode *mode); |
| @@ -254,4 +256,8 @@ struct drm_connector *drm_select_eld(struct drm_encoder *encoder, | |||
| 254 | struct drm_display_mode *mode); | 256 | struct drm_display_mode *mode); |
| 255 | int drm_load_edid_firmware(struct drm_connector *connector); | 257 | int drm_load_edid_firmware(struct drm_connector *connector); |
| 256 | 258 | ||
| 259 | int | ||
| 260 | drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, | ||
| 261 | const struct drm_display_mode *mode); | ||
| 262 | |||
| 257 | #endif /* __DRM_EDID_H__ */ | 263 | #endif /* __DRM_EDID_H__ */ |
diff --git a/include/drm/drm_encoder_slave.h b/include/drm/drm_encoder_slave.h index b0c11a7809bb..8b9cc3671858 100644 --- a/include/drm/drm_encoder_slave.h +++ b/include/drm/drm_encoder_slave.h | |||
| @@ -159,4 +159,24 @@ static inline void drm_i2c_encoder_unregister(struct drm_i2c_encoder_driver *dri | |||
| 159 | 159 | ||
| 160 | void drm_i2c_encoder_destroy(struct drm_encoder *encoder); | 160 | void drm_i2c_encoder_destroy(struct drm_encoder *encoder); |
| 161 | 161 | ||
| 162 | |||
| 163 | /* | ||
| 164 | * Wrapper fxns which can be plugged in to drm_encoder_helper_funcs: | ||
| 165 | */ | ||
| 166 | |||
| 167 | void drm_i2c_encoder_dpms(struct drm_encoder *encoder, int mode); | ||
| 168 | bool drm_i2c_encoder_mode_fixup(struct drm_encoder *encoder, | ||
| 169 | const struct drm_display_mode *mode, | ||
| 170 | struct drm_display_mode *adjusted_mode); | ||
| 171 | void drm_i2c_encoder_prepare(struct drm_encoder *encoder); | ||
| 172 | void drm_i2c_encoder_commit(struct drm_encoder *encoder); | ||
| 173 | void drm_i2c_encoder_mode_set(struct drm_encoder *encoder, | ||
| 174 | struct drm_display_mode *mode, | ||
| 175 | struct drm_display_mode *adjusted_mode); | ||
| 176 | enum drm_connector_status drm_i2c_encoder_detect(struct drm_encoder *encoder, | ||
| 177 | struct drm_connector *connector); | ||
| 178 | void drm_i2c_encoder_save(struct drm_encoder *encoder); | ||
| 179 | void drm_i2c_encoder_restore(struct drm_encoder *encoder); | ||
| 180 | |||
| 181 | |||
| 162 | #endif | 182 | #endif |
diff --git a/include/drm/drm_fb_cma_helper.h b/include/drm/drm_fb_cma_helper.h index 76c709837543..4a3fc244301c 100644 --- a/include/drm/drm_fb_cma_helper.h +++ b/include/drm/drm_fb_cma_helper.h | |||
| @@ -23,5 +23,10 @@ struct drm_framebuffer *drm_fb_cma_create(struct drm_device *dev, | |||
| 23 | struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb, | 23 | struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb, |
| 24 | unsigned int plane); | 24 | unsigned int plane); |
| 25 | 25 | ||
| 26 | #ifdef CONFIG_DEBUG_FS | ||
| 27 | void drm_fb_cma_describe(struct drm_framebuffer *fb, struct seq_file *m); | ||
| 28 | int drm_fb_cma_debugfs_show(struct seq_file *m, void *arg); | ||
| 29 | #endif | ||
| 30 | |||
| 26 | #endif | 31 | #endif |
| 27 | 32 | ||
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h index 5120b01c2eeb..c09511625a11 100644 --- a/include/drm/drm_fb_helper.h +++ b/include/drm/drm_fb_helper.h | |||
| @@ -48,6 +48,18 @@ struct drm_fb_helper_surface_size { | |||
| 48 | u32 surface_depth; | 48 | u32 surface_depth; |
| 49 | }; | 49 | }; |
| 50 | 50 | ||
| 51 | /** | ||
| 52 | * struct drm_fb_helper_funcs - driver callbacks for the fbdev emulation library | ||
| 53 | * @gamma_set: - Set the given gamma lut register on the given crtc. | ||
| 54 | * @gamma_get: - Read the given gamma lut register on the given crtc, used to | ||
| 55 | * save the current lut when force-restoring the fbdev for e.g. | ||
| 56 | * kdbg. | ||
| 57 | * @fb_probe: - Driver callback to allocate and initialize the fbdev info | ||
| 58 | * structure. Futhermore it also needs to allocate the drm | ||
| 59 | * framebuffer used to back the fbdev. | ||
| 60 | * | ||
| 61 | * Driver callbacks used by the fbdev emulation helper library. | ||
| 62 | */ | ||
| 51 | struct drm_fb_helper_funcs { | 63 | struct drm_fb_helper_funcs { |
| 52 | void (*gamma_set)(struct drm_crtc *crtc, u16 red, u16 green, | 64 | void (*gamma_set)(struct drm_crtc *crtc, u16 red, u16 green, |
| 53 | u16 blue, int regno); | 65 | u16 blue, int regno); |
| @@ -65,9 +77,7 @@ struct drm_fb_helper_connector { | |||
| 65 | 77 | ||
| 66 | struct drm_fb_helper { | 78 | struct drm_fb_helper { |
| 67 | struct drm_framebuffer *fb; | 79 | struct drm_framebuffer *fb; |
| 68 | struct drm_framebuffer *saved_fb; | ||
| 69 | struct drm_device *dev; | 80 | struct drm_device *dev; |
| 70 | struct drm_display_mode *mode; | ||
| 71 | int crtc_count; | 81 | int crtc_count; |
| 72 | struct drm_fb_helper_crtc *crtc_info; | 82 | struct drm_fb_helper_crtc *crtc_info; |
| 73 | int connector_count; | 83 | int connector_count; |
| @@ -82,9 +92,6 @@ struct drm_fb_helper { | |||
| 82 | bool delayed_hotplug; | 92 | bool delayed_hotplug; |
| 83 | }; | 93 | }; |
| 84 | 94 | ||
| 85 | int drm_fb_helper_single_fb_probe(struct drm_fb_helper *helper, | ||
| 86 | int preferred_bpp); | ||
| 87 | |||
| 88 | int drm_fb_helper_init(struct drm_device *dev, | 95 | int drm_fb_helper_init(struct drm_device *dev, |
| 89 | struct drm_fb_helper *helper, int crtc_count, | 96 | struct drm_fb_helper *helper, int crtc_count, |
| 90 | int max_conn); | 97 | int max_conn); |
| @@ -103,7 +110,6 @@ int drm_fb_helper_setcolreg(unsigned regno, | |||
| 103 | struct fb_info *info); | 110 | struct fb_info *info); |
| 104 | 111 | ||
| 105 | bool drm_fb_helper_restore_fbdev_mode(struct drm_fb_helper *fb_helper); | 112 | bool drm_fb_helper_restore_fbdev_mode(struct drm_fb_helper *fb_helper); |
| 106 | void drm_fb_helper_restore(void); | ||
| 107 | void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper, | 113 | void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper, |
| 108 | uint32_t fb_width, uint32_t fb_height); | 114 | uint32_t fb_width, uint32_t fb_height); |
| 109 | void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch, | 115 | void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch, |
diff --git a/include/drm/drm_gem_cma_helper.h b/include/drm/drm_gem_cma_helper.h index f0f6b1af25ad..63397ced9254 100644 --- a/include/drm/drm_gem_cma_helper.h +++ b/include/drm/drm_gem_cma_helper.h | |||
| @@ -41,4 +41,8 @@ struct drm_gem_cma_object *drm_gem_cma_create(struct drm_device *drm, | |||
| 41 | 41 | ||
| 42 | extern const struct vm_operations_struct drm_gem_cma_vm_ops; | 42 | extern const struct vm_operations_struct drm_gem_cma_vm_ops; |
| 43 | 43 | ||
| 44 | #ifdef CONFIG_DEBUG_FS | ||
| 45 | void drm_gem_cma_describe(struct drm_gem_cma_object *obj, struct seq_file *m); | ||
| 46 | #endif | ||
| 47 | |||
| 44 | #endif /* __DRM_GEM_CMA_HELPER_H__ */ | 48 | #endif /* __DRM_GEM_CMA_HELPER_H__ */ |
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h index 3527fb3f75bb..88591ef8fa24 100644 --- a/include/drm/drm_mm.h +++ b/include/drm/drm_mm.h | |||
| @@ -89,6 +89,29 @@ static inline bool drm_mm_initialized(struct drm_mm *mm) | |||
| 89 | { | 89 | { |
| 90 | return mm->hole_stack.next; | 90 | return mm->hole_stack.next; |
| 91 | } | 91 | } |
| 92 | |||
| 93 | static inline unsigned long __drm_mm_hole_node_start(struct drm_mm_node *hole_node) | ||
| 94 | { | ||
| 95 | return hole_node->start + hole_node->size; | ||
| 96 | } | ||
| 97 | |||
| 98 | static inline unsigned long drm_mm_hole_node_start(struct drm_mm_node *hole_node) | ||
| 99 | { | ||
| 100 | BUG_ON(!hole_node->hole_follows); | ||
| 101 | return __drm_mm_hole_node_start(hole_node); | ||
| 102 | } | ||
| 103 | |||
| 104 | static inline unsigned long __drm_mm_hole_node_end(struct drm_mm_node *hole_node) | ||
| 105 | { | ||
| 106 | return list_entry(hole_node->node_list.next, | ||
| 107 | struct drm_mm_node, node_list)->start; | ||
| 108 | } | ||
| 109 | |||
| 110 | static inline unsigned long drm_mm_hole_node_end(struct drm_mm_node *hole_node) | ||
| 111 | { | ||
| 112 | return __drm_mm_hole_node_end(hole_node); | ||
| 113 | } | ||
| 114 | |||
| 92 | #define drm_mm_for_each_node(entry, mm) list_for_each_entry(entry, \ | 115 | #define drm_mm_for_each_node(entry, mm) list_for_each_entry(entry, \ |
| 93 | &(mm)->head_node.node_list, \ | 116 | &(mm)->head_node.node_list, \ |
| 94 | node_list) | 117 | node_list) |
| @@ -99,9 +122,26 @@ static inline bool drm_mm_initialized(struct drm_mm *mm) | |||
| 99 | entry != NULL; entry = next, \ | 122 | entry != NULL; entry = next, \ |
| 100 | next = entry ? list_entry(entry->node_list.next, \ | 123 | next = entry ? list_entry(entry->node_list.next, \ |
| 101 | struct drm_mm_node, node_list) : NULL) \ | 124 | struct drm_mm_node, node_list) : NULL) \ |
| 125 | |||
| 126 | /* Note that we need to unroll list_for_each_entry in order to inline | ||
| 127 | * setting hole_start and hole_end on each iteration and keep the | ||
| 128 | * macro sane. | ||
| 129 | */ | ||
| 130 | #define drm_mm_for_each_hole(entry, mm, hole_start, hole_end) \ | ||
| 131 | for (entry = list_entry((mm)->hole_stack.next, struct drm_mm_node, hole_stack); \ | ||
| 132 | &entry->hole_stack != &(mm)->hole_stack ? \ | ||
| 133 | hole_start = drm_mm_hole_node_start(entry), \ | ||
| 134 | hole_end = drm_mm_hole_node_end(entry), \ | ||
| 135 | 1 : 0; \ | ||
| 136 | entry = list_entry(entry->hole_stack.next, struct drm_mm_node, hole_stack)) | ||
| 137 | |||
| 102 | /* | 138 | /* |
| 103 | * Basic range manager support (drm_mm.c) | 139 | * Basic range manager support (drm_mm.c) |
| 104 | */ | 140 | */ |
| 141 | extern struct drm_mm_node *drm_mm_create_block(struct drm_mm *mm, | ||
| 142 | unsigned long start, | ||
| 143 | unsigned long size, | ||
| 144 | bool atomic); | ||
| 105 | extern struct drm_mm_node *drm_mm_get_block_generic(struct drm_mm_node *node, | 145 | extern struct drm_mm_node *drm_mm_get_block_generic(struct drm_mm_node *node, |
| 106 | unsigned long size, | 146 | unsigned long size, |
| 107 | unsigned alignment, | 147 | unsigned alignment, |
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h index c5c35e629426..a386b0b654cc 100644 --- a/include/drm/drm_pciids.h +++ b/include/drm/drm_pciids.h | |||
| @@ -139,6 +139,19 @@ | |||
| 139 | {0x1002, 0x5e4c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ | 139 | {0x1002, 0x5e4c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ |
| 140 | {0x1002, 0x5e4d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ | 140 | {0x1002, 0x5e4d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ |
| 141 | {0x1002, 0x5e4f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ | 141 | {0x1002, 0x5e4f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ |
| 142 | {0x1002, 0x6600, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 143 | {0x1002, 0x6601, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 144 | {0x1002, 0x6602, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 145 | {0x1002, 0x6603, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 146 | {0x1002, 0x6606, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 147 | {0x1002, 0x6607, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 148 | {0x1002, 0x6610, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_NEW_MEMMAP}, \ | ||
| 149 | {0x1002, 0x6611, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_NEW_MEMMAP}, \ | ||
| 150 | {0x1002, 0x6613, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_NEW_MEMMAP}, \ | ||
| 151 | {0x1002, 0x6620, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 152 | {0x1002, 0x6621, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 153 | {0x1002, 0x6623, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 154 | {0x1002, 0x6631, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_NEW_MEMMAP}, \ | ||
| 142 | {0x1002, 0x6700, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAYMAN|RADEON_NEW_MEMMAP}, \ | 155 | {0x1002, 0x6700, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAYMAN|RADEON_NEW_MEMMAP}, \ |
| 143 | {0x1002, 0x6701, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAYMAN|RADEON_NEW_MEMMAP}, \ | 156 | {0x1002, 0x6701, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAYMAN|RADEON_NEW_MEMMAP}, \ |
| 144 | {0x1002, 0x6702, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAYMAN|RADEON_NEW_MEMMAP}, \ | 157 | {0x1002, 0x6702, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAYMAN|RADEON_NEW_MEMMAP}, \ |
diff --git a/include/drm/intel-gtt.h b/include/drm/intel-gtt.h index 6eb76a1f11ab..b08bdade6002 100644 --- a/include/drm/intel-gtt.h +++ b/include/drm/intel-gtt.h | |||
| @@ -3,26 +3,8 @@ | |||
| 3 | #ifndef _DRM_INTEL_GTT_H | 3 | #ifndef _DRM_INTEL_GTT_H |
| 4 | #define _DRM_INTEL_GTT_H | 4 | #define _DRM_INTEL_GTT_H |
| 5 | 5 | ||
| 6 | struct intel_gtt { | 6 | void intel_gtt_get(size_t *gtt_total, size_t *stolen_size, |
| 7 | /* Size of memory reserved for graphics by the BIOS */ | 7 | phys_addr_t *mappable_base, unsigned long *mappable_end); |
| 8 | unsigned int stolen_size; | ||
| 9 | /* Total number of gtt entries. */ | ||
| 10 | unsigned int gtt_total_entries; | ||
| 11 | /* Part of the gtt that is mappable by the cpu, for those chips where | ||
| 12 | * this is not the full gtt. */ | ||
| 13 | unsigned int gtt_mappable_entries; | ||
| 14 | /* Whether i915 needs to use the dmar apis or not. */ | ||
| 15 | unsigned int needs_dmar : 1; | ||
| 16 | /* Whether we idle the gpu before mapping/unmapping */ | ||
| 17 | unsigned int do_idle_maps : 1; | ||
| 18 | /* Share the scratch page dma with ppgtts. */ | ||
| 19 | dma_addr_t scratch_page_dma; | ||
| 20 | struct page *scratch_page; | ||
| 21 | /* for ppgtt PDE access */ | ||
| 22 | u32 __iomem *gtt; | ||
| 23 | /* needed for ioremap in drm/i915 */ | ||
| 24 | phys_addr_t gma_bus_addr; | ||
| 25 | } *intel_gtt_get(void); | ||
| 26 | 8 | ||
| 27 | int intel_gmch_probe(struct pci_dev *bridge_pdev, struct pci_dev *gpu_pdev, | 9 | int intel_gmch_probe(struct pci_dev *bridge_pdev, struct pci_dev *gpu_pdev, |
| 28 | struct agp_bridge_data *bridge); | 10 | struct agp_bridge_data *bridge); |
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index e3a43a47d78c..0fbd046e7c93 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h | |||
| @@ -790,16 +790,7 @@ extern void ttm_mem_io_unlock(struct ttm_mem_type_manager *man); | |||
| 790 | * to make room for a buffer already reserved. (Buffers are reserved before | 790 | * to make room for a buffer already reserved. (Buffers are reserved before |
| 791 | * they are evicted). The following algorithm prevents such deadlocks from | 791 | * they are evicted). The following algorithm prevents such deadlocks from |
| 792 | * occurring: | 792 | * occurring: |
| 793 | * 1) Buffers are reserved with the lru spinlock held. Upon successful | 793 | * Processes attempting to reserve multiple buffers other than for eviction, |
| 794 | * reservation they are removed from the lru list. This stops a reserved buffer | ||
| 795 | * from being evicted. However the lru spinlock is released between the time | ||
| 796 | * a buffer is selected for eviction and the time it is reserved. | ||
| 797 | * Therefore a check is made when a buffer is reserved for eviction, that it | ||
| 798 | * is still the first buffer in the lru list, before it is removed from the | ||
| 799 | * list. @check_lru == 1 forces this check. If it fails, the function returns | ||
| 800 | * -EINVAL, and the caller should then choose a new buffer to evict and repeat | ||
| 801 | * the procedure. | ||
| 802 | * 2) Processes attempting to reserve multiple buffers other than for eviction, | ||
| 803 | * (typically execbuf), should first obtain a unique 32-bit | 794 | * (typically execbuf), should first obtain a unique 32-bit |
| 804 | * validation sequence number, | 795 | * validation sequence number, |
| 805 | * and call this function with @use_sequence == 1 and @sequence == the unique | 796 | * and call this function with @use_sequence == 1 and @sequence == the unique |
| @@ -830,9 +821,39 @@ extern int ttm_bo_reserve(struct ttm_buffer_object *bo, | |||
| 830 | bool interruptible, | 821 | bool interruptible, |
| 831 | bool no_wait, bool use_sequence, uint32_t sequence); | 822 | bool no_wait, bool use_sequence, uint32_t sequence); |
| 832 | 823 | ||
| 824 | /** | ||
| 825 | * ttm_bo_reserve_slowpath_nolru: | ||
| 826 | * @bo: A pointer to a struct ttm_buffer_object. | ||
| 827 | * @interruptible: Sleep interruptible if waiting. | ||
| 828 | * @sequence: Set (@bo)->sequence to this value after lock | ||
| 829 | * | ||
| 830 | * This is called after ttm_bo_reserve returns -EAGAIN and we backed off | ||
| 831 | * from all our other reservations. Because there are no other reservations | ||
| 832 | * held by us, this function cannot deadlock any more. | ||
| 833 | * | ||
| 834 | * Will not remove reserved buffers from the lru lists. | ||
| 835 | * Otherwise identical to ttm_bo_reserve_slowpath. | ||
| 836 | */ | ||
| 837 | extern int ttm_bo_reserve_slowpath_nolru(struct ttm_buffer_object *bo, | ||
| 838 | bool interruptible, | ||
| 839 | uint32_t sequence); | ||
| 840 | |||
| 833 | 841 | ||
| 834 | /** | 842 | /** |
| 835 | * ttm_bo_reserve_locked: | 843 | * ttm_bo_reserve_slowpath: |
| 844 | * @bo: A pointer to a struct ttm_buffer_object. | ||
| 845 | * @interruptible: Sleep interruptible if waiting. | ||
| 846 | * @sequence: Set (@bo)->sequence to this value after lock | ||
| 847 | * | ||
| 848 | * This is called after ttm_bo_reserve returns -EAGAIN and we backed off | ||
| 849 | * from all our other reservations. Because there are no other reservations | ||
| 850 | * held by us, this function cannot deadlock any more. | ||
| 851 | */ | ||
| 852 | extern int ttm_bo_reserve_slowpath(struct ttm_buffer_object *bo, | ||
| 853 | bool interruptible, uint32_t sequence); | ||
| 854 | |||
| 855 | /** | ||
| 856 | * ttm_bo_reserve_nolru: | ||
| 836 | * | 857 | * |
| 837 | * @bo: A pointer to a struct ttm_buffer_object. | 858 | * @bo: A pointer to a struct ttm_buffer_object. |
| 838 | * @interruptible: Sleep interruptible if waiting. | 859 | * @interruptible: Sleep interruptible if waiting. |
| @@ -840,9 +861,7 @@ extern int ttm_bo_reserve(struct ttm_buffer_object *bo, | |||
| 840 | * @use_sequence: If @bo is already reserved, Only sleep waiting for | 861 | * @use_sequence: If @bo is already reserved, Only sleep waiting for |
| 841 | * it to become unreserved if @sequence < (@bo)->sequence. | 862 | * it to become unreserved if @sequence < (@bo)->sequence. |
| 842 | * | 863 | * |
| 843 | * Must be called with struct ttm_bo_global::lru_lock held, | 864 | * Will not remove reserved buffers from the lru lists. |
| 844 | * and will not remove reserved buffers from the lru lists. | ||
| 845 | * The function may release the LRU spinlock if it needs to sleep. | ||
| 846 | * Otherwise identical to ttm_bo_reserve. | 865 | * Otherwise identical to ttm_bo_reserve. |
| 847 | * | 866 | * |
| 848 | * Returns: | 867 | * Returns: |
| @@ -855,7 +874,7 @@ extern int ttm_bo_reserve(struct ttm_buffer_object *bo, | |||
| 855 | * -EDEADLK: Bo already reserved using @sequence. This error code will only | 874 | * -EDEADLK: Bo already reserved using @sequence. This error code will only |
| 856 | * be returned if @use_sequence is set to true. | 875 | * be returned if @use_sequence is set to true. |
| 857 | */ | 876 | */ |
| 858 | extern int ttm_bo_reserve_locked(struct ttm_buffer_object *bo, | 877 | extern int ttm_bo_reserve_nolru(struct ttm_buffer_object *bo, |
| 859 | bool interruptible, | 878 | bool interruptible, |
| 860 | bool no_wait, bool use_sequence, | 879 | bool no_wait, bool use_sequence, |
| 861 | uint32_t sequence); | 880 | uint32_t sequence); |
| @@ -879,18 +898,6 @@ extern void ttm_bo_unreserve(struct ttm_buffer_object *bo); | |||
| 879 | */ | 898 | */ |
| 880 | extern void ttm_bo_unreserve_locked(struct ttm_buffer_object *bo); | 899 | extern void ttm_bo_unreserve_locked(struct ttm_buffer_object *bo); |
| 881 | 900 | ||
| 882 | /** | ||
| 883 | * ttm_bo_wait_unreserved | ||
| 884 | * | ||
| 885 | * @bo: A pointer to a struct ttm_buffer_object. | ||
| 886 | * | ||
| 887 | * Wait for a struct ttm_buffer_object to become unreserved. | ||
| 888 | * This is typically used in the execbuf code to relax cpu-usage when | ||
| 889 | * a potential deadlock condition backoff. | ||
| 890 | */ | ||
| 891 | extern int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo, | ||
| 892 | bool interruptible); | ||
| 893 | |||
| 894 | /* | 901 | /* |
| 895 | * ttm_bo_util.c | 902 | * ttm_bo_util.c |
| 896 | */ | 903 | */ |
diff --git a/include/linux/acpi_gpio.h b/include/linux/acpi_gpio.h index 91615a389b65..b76ebd08ff8e 100644 --- a/include/linux/acpi_gpio.h +++ b/include/linux/acpi_gpio.h | |||
| @@ -2,10 +2,12 @@ | |||
| 2 | #define _LINUX_ACPI_GPIO_H_ | 2 | #define _LINUX_ACPI_GPIO_H_ |
| 3 | 3 | ||
| 4 | #include <linux/errno.h> | 4 | #include <linux/errno.h> |
| 5 | #include <linux/gpio.h> | ||
| 5 | 6 | ||
| 6 | #ifdef CONFIG_GPIO_ACPI | 7 | #ifdef CONFIG_GPIO_ACPI |
| 7 | 8 | ||
| 8 | int acpi_get_gpio(char *path, int pin); | 9 | int acpi_get_gpio(char *path, int pin); |
| 10 | void acpi_gpiochip_request_interrupts(struct gpio_chip *chip); | ||
| 9 | 11 | ||
| 10 | #else /* CONFIG_GPIO_ACPI */ | 12 | #else /* CONFIG_GPIO_ACPI */ |
| 11 | 13 | ||
| @@ -14,6 +16,8 @@ static inline int acpi_get_gpio(char *path, int pin) | |||
| 14 | return -ENODEV; | 16 | return -ENODEV; |
| 15 | } | 17 | } |
| 16 | 18 | ||
| 19 | static inline void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) { } | ||
| 20 | |||
| 17 | #endif /* CONFIG_GPIO_ACPI */ | 21 | #endif /* CONFIG_GPIO_ACPI */ |
| 18 | 22 | ||
| 19 | #endif /* _LINUX_ACPI_GPIO_H_ */ | 23 | #endif /* _LINUX_ACPI_GPIO_H_ */ |
diff --git a/include/linux/amba/pl080.h b/include/linux/amba/pl080.h new file mode 100644 index 000000000000..3e7b62fbefbd --- /dev/null +++ b/include/linux/amba/pl080.h | |||
| @@ -0,0 +1,146 @@ | |||
| 1 | /* include/linux/amba/pl080.h | ||
| 2 | * | ||
| 3 | * Copyright 2008 Openmoko, Inc. | ||
| 4 | * Copyright 2008 Simtec Electronics | ||
| 5 | * http://armlinux.simtec.co.uk/ | ||
| 6 | * Ben Dooks <ben@simtec.co.uk> | ||
| 7 | * | ||
| 8 | * ARM PrimeCell PL080 DMA controller | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of the GNU General Public License version 2 as | ||
| 12 | * published by the Free Software Foundation. | ||
| 13 | */ | ||
| 14 | |||
| 15 | /* Note, there are some Samsung updates to this controller block which | ||
| 16 | * make it not entierly compatible with the PL080 specification from | ||
| 17 | * ARM. When in doubt, check the Samsung documentation first. | ||
| 18 | * | ||
| 19 | * The Samsung defines are PL080S, and add an extra control register, | ||
| 20 | * the ability to move more than 2^11 counts of data and some extra | ||
| 21 | * OneNAND features. | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef ASM_PL080_H | ||
| 25 | #define ASM_PL080_H | ||
| 26 | |||
| 27 | #define PL080_INT_STATUS (0x00) | ||
| 28 | #define PL080_TC_STATUS (0x04) | ||
| 29 | #define PL080_TC_CLEAR (0x08) | ||
| 30 | #define PL080_ERR_STATUS (0x0C) | ||
| 31 | #define PL080_ERR_CLEAR (0x10) | ||
| 32 | #define PL080_RAW_TC_STATUS (0x14) | ||
| 33 | #define PL080_RAW_ERR_STATUS (0x18) | ||
| 34 | #define PL080_EN_CHAN (0x1c) | ||
| 35 | #define PL080_SOFT_BREQ (0x20) | ||
| 36 | #define PL080_SOFT_SREQ (0x24) | ||
| 37 | #define PL080_SOFT_LBREQ (0x28) | ||
| 38 | #define PL080_SOFT_LSREQ (0x2C) | ||
| 39 | |||
| 40 | #define PL080_CONFIG (0x30) | ||
| 41 | #define PL080_CONFIG_M2_BE (1 << 2) | ||
| 42 | #define PL080_CONFIG_M1_BE (1 << 1) | ||
| 43 | #define PL080_CONFIG_ENABLE (1 << 0) | ||
| 44 | |||
| 45 | #define PL080_SYNC (0x34) | ||
| 46 | |||
| 47 | /* Per channel configuration registers */ | ||
| 48 | |||
| 49 | #define PL080_Cx_STRIDE (0x20) | ||
| 50 | #define PL080_Cx_BASE(x) ((0x100 + (x * 0x20))) | ||
| 51 | #define PL080_Cx_SRC_ADDR(x) ((0x100 + (x * 0x20))) | ||
| 52 | #define PL080_Cx_DST_ADDR(x) ((0x104 + (x * 0x20))) | ||
| 53 | #define PL080_Cx_LLI(x) ((0x108 + (x * 0x20))) | ||
| 54 | #define PL080_Cx_CONTROL(x) ((0x10C + (x * 0x20))) | ||
| 55 | #define PL080_Cx_CONFIG(x) ((0x110 + (x * 0x20))) | ||
| 56 | #define PL080S_Cx_CONTROL2(x) ((0x110 + (x * 0x20))) | ||
| 57 | #define PL080S_Cx_CONFIG(x) ((0x114 + (x * 0x20))) | ||
| 58 | |||
| 59 | #define PL080_CH_SRC_ADDR (0x00) | ||
| 60 | #define PL080_CH_DST_ADDR (0x04) | ||
| 61 | #define PL080_CH_LLI (0x08) | ||
| 62 | #define PL080_CH_CONTROL (0x0C) | ||
| 63 | #define PL080_CH_CONFIG (0x10) | ||
| 64 | #define PL080S_CH_CONTROL2 (0x10) | ||
| 65 | #define PL080S_CH_CONFIG (0x14) | ||
| 66 | |||
| 67 | #define PL080_LLI_ADDR_MASK (0x3fffffff << 2) | ||
| 68 | #define PL080_LLI_ADDR_SHIFT (2) | ||
| 69 | #define PL080_LLI_LM_AHB2 (1 << 0) | ||
| 70 | |||
| 71 | #define PL080_CONTROL_TC_IRQ_EN (1 << 31) | ||
| 72 | #define PL080_CONTROL_PROT_MASK (0x7 << 28) | ||
| 73 | #define PL080_CONTROL_PROT_SHIFT (28) | ||
| 74 | #define PL080_CONTROL_PROT_CACHE (1 << 30) | ||
| 75 | #define PL080_CONTROL_PROT_BUFF (1 << 29) | ||
| 76 | #define PL080_CONTROL_PROT_SYS (1 << 28) | ||
| 77 | #define PL080_CONTROL_DST_INCR (1 << 27) | ||
| 78 | #define PL080_CONTROL_SRC_INCR (1 << 26) | ||
| 79 | #define PL080_CONTROL_DST_AHB2 (1 << 25) | ||
| 80 | #define PL080_CONTROL_SRC_AHB2 (1 << 24) | ||
| 81 | #define PL080_CONTROL_DWIDTH_MASK (0x7 << 21) | ||
| 82 | #define PL080_CONTROL_DWIDTH_SHIFT (21) | ||
| 83 | #define PL080_CONTROL_SWIDTH_MASK (0x7 << 18) | ||
| 84 | #define PL080_CONTROL_SWIDTH_SHIFT (18) | ||
| 85 | #define PL080_CONTROL_DB_SIZE_MASK (0x7 << 15) | ||
| 86 | #define PL080_CONTROL_DB_SIZE_SHIFT (15) | ||
| 87 | #define PL080_CONTROL_SB_SIZE_MASK (0x7 << 12) | ||
| 88 | #define PL080_CONTROL_SB_SIZE_SHIFT (12) | ||
| 89 | #define PL080_CONTROL_TRANSFER_SIZE_MASK (0xfff << 0) | ||
| 90 | #define PL080_CONTROL_TRANSFER_SIZE_SHIFT (0) | ||
| 91 | |||
| 92 | #define PL080_BSIZE_1 (0x0) | ||
| 93 | #define PL080_BSIZE_4 (0x1) | ||
| 94 | #define PL080_BSIZE_8 (0x2) | ||
| 95 | #define PL080_BSIZE_16 (0x3) | ||
| 96 | #define PL080_BSIZE_32 (0x4) | ||
| 97 | #define PL080_BSIZE_64 (0x5) | ||
| 98 | #define PL080_BSIZE_128 (0x6) | ||
| 99 | #define PL080_BSIZE_256 (0x7) | ||
| 100 | |||
| 101 | #define PL080_WIDTH_8BIT (0x0) | ||
| 102 | #define PL080_WIDTH_16BIT (0x1) | ||
| 103 | #define PL080_WIDTH_32BIT (0x2) | ||
| 104 | |||
| 105 | #define PL080N_CONFIG_ITPROT (1 << 20) | ||
| 106 | #define PL080N_CONFIG_SECPROT (1 << 19) | ||
| 107 | #define PL080_CONFIG_HALT (1 << 18) | ||
| 108 | #define PL080_CONFIG_ACTIVE (1 << 17) /* RO */ | ||
| 109 | #define PL080_CONFIG_LOCK (1 << 16) | ||
| 110 | #define PL080_CONFIG_TC_IRQ_MASK (1 << 15) | ||
| 111 | #define PL080_CONFIG_ERR_IRQ_MASK (1 << 14) | ||
| 112 | #define PL080_CONFIG_FLOW_CONTROL_MASK (0x7 << 11) | ||
| 113 | #define PL080_CONFIG_FLOW_CONTROL_SHIFT (11) | ||
| 114 | #define PL080_CONFIG_DST_SEL_MASK (0xf << 6) | ||
| 115 | #define PL080_CONFIG_DST_SEL_SHIFT (6) | ||
| 116 | #define PL080_CONFIG_SRC_SEL_MASK (0xf << 1) | ||
| 117 | #define PL080_CONFIG_SRC_SEL_SHIFT (1) | ||
| 118 | #define PL080_CONFIG_ENABLE (1 << 0) | ||
| 119 | |||
| 120 | #define PL080_FLOW_MEM2MEM (0x0) | ||
| 121 | #define PL080_FLOW_MEM2PER (0x1) | ||
| 122 | #define PL080_FLOW_PER2MEM (0x2) | ||
| 123 | #define PL080_FLOW_SRC2DST (0x3) | ||
| 124 | #define PL080_FLOW_SRC2DST_DST (0x4) | ||
| 125 | #define PL080_FLOW_MEM2PER_PER (0x5) | ||
| 126 | #define PL080_FLOW_PER2MEM_PER (0x6) | ||
| 127 | #define PL080_FLOW_SRC2DST_SRC (0x7) | ||
| 128 | |||
| 129 | /* DMA linked list chain structure */ | ||
| 130 | |||
| 131 | struct pl080_lli { | ||
| 132 | u32 src_addr; | ||
| 133 | u32 dst_addr; | ||
| 134 | u32 next_lli; | ||
| 135 | u32 control0; | ||
| 136 | }; | ||
| 137 | |||
| 138 | struct pl080s_lli { | ||
| 139 | u32 src_addr; | ||
| 140 | u32 dst_addr; | ||
| 141 | u32 next_lli; | ||
| 142 | u32 control0; | ||
| 143 | u32 control1; | ||
| 144 | }; | ||
| 145 | |||
| 146 | #endif /* ASM_PL080_H */ | ||
diff --git a/include/linux/bcm47xx_wdt.h b/include/linux/bcm47xx_wdt.h index e5dfc256485b..b708786d4cbf 100644 --- a/include/linux/bcm47xx_wdt.h +++ b/include/linux/bcm47xx_wdt.h | |||
| @@ -1,7 +1,10 @@ | |||
| 1 | #ifndef LINUX_BCM47XX_WDT_H_ | 1 | #ifndef LINUX_BCM47XX_WDT_H_ |
| 2 | #define LINUX_BCM47XX_WDT_H_ | 2 | #define LINUX_BCM47XX_WDT_H_ |
| 3 | 3 | ||
| 4 | #include <linux/notifier.h> | ||
| 5 | #include <linux/timer.h> | ||
| 4 | #include <linux/types.h> | 6 | #include <linux/types.h> |
| 7 | #include <linux/watchdog.h> | ||
| 5 | 8 | ||
| 6 | 9 | ||
| 7 | struct bcm47xx_wdt { | 10 | struct bcm47xx_wdt { |
| @@ -10,6 +13,12 @@ struct bcm47xx_wdt { | |||
| 10 | u32 max_timer_ms; | 13 | u32 max_timer_ms; |
| 11 | 14 | ||
| 12 | void *driver_data; | 15 | void *driver_data; |
| 16 | |||
| 17 | struct watchdog_device wdd; | ||
| 18 | struct notifier_block notifier; | ||
| 19 | |||
| 20 | struct timer_list soft_timer; | ||
| 21 | atomic_t soft_ticks; | ||
| 13 | }; | 22 | }; |
| 14 | 23 | ||
| 15 | static inline void *bcm47xx_wdt_get_drvdata(struct bcm47xx_wdt *wdt) | 24 | static inline void *bcm47xx_wdt_get_drvdata(struct bcm47xx_wdt *wdt) |
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h index 1d002b58b60b..8390c474f69a 100644 --- a/include/linux/bcma/bcma_driver_chipcommon.h +++ b/include/linux/bcma/bcma_driver_chipcommon.h | |||
| @@ -528,6 +528,7 @@ struct bcma_sflash { | |||
| 528 | u32 size; | 528 | u32 size; |
| 529 | 529 | ||
| 530 | struct mtd_info *mtd; | 530 | struct mtd_info *mtd; |
| 531 | void *priv; | ||
| 531 | }; | 532 | }; |
| 532 | #endif | 533 | #endif |
| 533 | 534 | ||
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index 0530b9860359..c3a09149f793 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
| @@ -111,7 +111,6 @@ extern int suid_dumpable; | |||
| 111 | extern int setup_arg_pages(struct linux_binprm * bprm, | 111 | extern int setup_arg_pages(struct linux_binprm * bprm, |
| 112 | unsigned long stack_top, | 112 | unsigned long stack_top, |
| 113 | int executable_stack); | 113 | int executable_stack); |
| 114 | extern int bprm_mm_init(struct linux_binprm *bprm); | ||
| 115 | extern int bprm_change_interp(char *interp, struct linux_binprm *bprm); | 114 | extern int bprm_change_interp(char *interp, struct linux_binprm *bprm); |
| 116 | extern int copy_strings_kernel(int argc, const char *const *argv, | 115 | extern int copy_strings_kernel(int argc, const char *const *argv, |
| 117 | struct linux_binprm *bprm); | 116 | struct linux_binprm *bprm); |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index f94bc83011ed..78feda9bbae2 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/gfp.h> | 19 | #include <linux/gfp.h> |
| 20 | #include <linux/bsg.h> | 20 | #include <linux/bsg.h> |
| 21 | #include <linux/smp.h> | 21 | #include <linux/smp.h> |
| 22 | #include <linux/rcupdate.h> | ||
| 22 | 23 | ||
| 23 | #include <asm/scatterlist.h> | 24 | #include <asm/scatterlist.h> |
| 24 | 25 | ||
| @@ -437,6 +438,7 @@ struct request_queue { | |||
| 437 | /* Throttle data */ | 438 | /* Throttle data */ |
| 438 | struct throtl_data *td; | 439 | struct throtl_data *td; |
| 439 | #endif | 440 | #endif |
| 441 | struct rcu_head rcu_head; | ||
| 440 | }; | 442 | }; |
| 441 | 443 | ||
| 442 | #define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ | 444 | #define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ |
| @@ -974,7 +976,6 @@ struct blk_plug { | |||
| 974 | unsigned long magic; /* detect uninitialized use-cases */ | 976 | unsigned long magic; /* detect uninitialized use-cases */ |
| 975 | struct list_head list; /* requests */ | 977 | struct list_head list; /* requests */ |
| 976 | struct list_head cb_list; /* md requires an unplug callback */ | 978 | struct list_head cb_list; /* md requires an unplug callback */ |
| 977 | unsigned int should_sort; /* list to be sorted before flushing? */ | ||
| 978 | }; | 979 | }; |
| 979 | #define BLK_MAX_REQUEST_COUNT 16 | 980 | #define BLK_MAX_REQUEST_COUNT 16 |
| 980 | 981 | ||
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index 7c2e030e72f1..0ea61e07a91c 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | struct blk_trace { | 13 | struct blk_trace { |
| 14 | int trace_state; | 14 | int trace_state; |
| 15 | bool rq_based; | ||
| 15 | struct rchan *rchan; | 16 | struct rchan *rchan; |
| 16 | unsigned long __percpu *sequence; | 17 | unsigned long __percpu *sequence; |
| 17 | unsigned char __percpu *msg_data; | 18 | unsigned char __percpu *msg_data; |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 3f778c27f825..cdc3bab01832 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
| @@ -53,6 +53,7 @@ extern void free_bootmem_node(pg_data_t *pgdat, | |||
| 53 | unsigned long size); | 53 | unsigned long size); |
| 54 | extern void free_bootmem(unsigned long physaddr, unsigned long size); | 54 | extern void free_bootmem(unsigned long physaddr, unsigned long size); |
| 55 | extern void free_bootmem_late(unsigned long physaddr, unsigned long size); | 55 | extern void free_bootmem_late(unsigned long physaddr, unsigned long size); |
| 56 | extern void __free_pages_bootmem(struct page *page, unsigned int order); | ||
| 56 | 57 | ||
| 57 | /* | 58 | /* |
| 58 | * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, | 59 | * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, |
| @@ -99,6 +100,9 @@ void *___alloc_bootmem_node_nopanic(pg_data_t *pgdat, | |||
| 99 | extern void *__alloc_bootmem_low(unsigned long size, | 100 | extern void *__alloc_bootmem_low(unsigned long size, |
| 100 | unsigned long align, | 101 | unsigned long align, |
| 101 | unsigned long goal); | 102 | unsigned long goal); |
| 103 | void *__alloc_bootmem_low_nopanic(unsigned long size, | ||
| 104 | unsigned long align, | ||
| 105 | unsigned long goal); | ||
| 102 | extern void *__alloc_bootmem_low_node(pg_data_t *pgdat, | 106 | extern void *__alloc_bootmem_low_node(pg_data_t *pgdat, |
| 103 | unsigned long size, | 107 | unsigned long size, |
| 104 | unsigned long align, | 108 | unsigned long align, |
| @@ -132,6 +136,8 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat, | |||
| 132 | 136 | ||
| 133 | #define alloc_bootmem_low(x) \ | 137 | #define alloc_bootmem_low(x) \ |
| 134 | __alloc_bootmem_low(x, SMP_CACHE_BYTES, 0) | 138 | __alloc_bootmem_low(x, SMP_CACHE_BYTES, 0) |
| 139 | #define alloc_bootmem_low_pages_nopanic(x) \ | ||
| 140 | __alloc_bootmem_low_nopanic(x, PAGE_SIZE, 0) | ||
| 135 | #define alloc_bootmem_low_pages(x) \ | 141 | #define alloc_bootmem_low_pages(x) \ |
| 136 | __alloc_bootmem_low(x, PAGE_SIZE, 0) | 142 | __alloc_bootmem_low(x, PAGE_SIZE, 0) |
| 137 | #define alloc_bootmem_low_pages_node(pgdat, x) \ | 143 | #define alloc_bootmem_low_pages_node(pgdat, x) \ |
diff --git a/include/linux/btrfs.h b/include/linux/btrfs.h new file mode 100644 index 000000000000..22d799147db2 --- /dev/null +++ b/include/linux/btrfs.h | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #ifndef _LINUX_BTRFS_H | ||
| 2 | #define _LINUX_BTRFS_H | ||
| 3 | |||
| 4 | #include <uapi/linux/btrfs.h> | ||
| 5 | |||
| 6 | #endif /* _LINUX_BTRFS_H */ | ||
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 458f497738a4..5afc4f94d110 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
| @@ -126,7 +126,6 @@ BUFFER_FNS(Write_EIO, write_io_error) | |||
| 126 | BUFFER_FNS(Unwritten, unwritten) | 126 | BUFFER_FNS(Unwritten, unwritten) |
| 127 | 127 | ||
| 128 | #define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK) | 128 | #define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK) |
| 129 | #define touch_buffer(bh) mark_page_accessed(bh->b_page) | ||
| 130 | 129 | ||
| 131 | /* If we *know* page->private refers to buffer_heads */ | 130 | /* If we *know* page->private refers to buffer_heads */ |
| 132 | #define page_buffers(page) \ | 131 | #define page_buffers(page) \ |
| @@ -142,6 +141,7 @@ BUFFER_FNS(Unwritten, unwritten) | |||
| 142 | 141 | ||
| 143 | void mark_buffer_dirty(struct buffer_head *bh); | 142 | void mark_buffer_dirty(struct buffer_head *bh); |
| 144 | void init_buffer(struct buffer_head *, bh_end_io_t *, void *); | 143 | void init_buffer(struct buffer_head *, bh_end_io_t *, void *); |
| 144 | void touch_buffer(struct buffer_head *bh); | ||
| 145 | void set_bh_page(struct buffer_head *bh, | 145 | void set_bh_page(struct buffer_head *bh, |
| 146 | struct page *page, unsigned long offset); | 146 | struct page *page, unsigned long offset); |
| 147 | int try_to_free_buffers(struct page *); | 147 | int try_to_free_buffers(struct page *); |
diff --git a/include/linux/ceph/ceph_features.h b/include/linux/ceph/ceph_features.h index dad579b0c0e6..76554cecaab2 100644 --- a/include/linux/ceph/ceph_features.h +++ b/include/linux/ceph/ceph_features.h | |||
| @@ -12,16 +12,46 @@ | |||
| 12 | #define CEPH_FEATURE_MONNAMES (1<<5) | 12 | #define CEPH_FEATURE_MONNAMES (1<<5) |
| 13 | #define CEPH_FEATURE_RECONNECT_SEQ (1<<6) | 13 | #define CEPH_FEATURE_RECONNECT_SEQ (1<<6) |
| 14 | #define CEPH_FEATURE_DIRLAYOUTHASH (1<<7) | 14 | #define CEPH_FEATURE_DIRLAYOUTHASH (1<<7) |
| 15 | /* bits 8-17 defined by user-space; not supported yet here */ | 15 | #define CEPH_FEATURE_OBJECTLOCATOR (1<<8) |
| 16 | #define CEPH_FEATURE_PGID64 (1<<9) | ||
| 17 | #define CEPH_FEATURE_INCSUBOSDMAP (1<<10) | ||
| 18 | #define CEPH_FEATURE_PGPOOL3 (1<<11) | ||
| 19 | #define CEPH_FEATURE_OSDREPLYMUX (1<<12) | ||
| 20 | #define CEPH_FEATURE_OSDENC (1<<13) | ||
| 21 | #define CEPH_FEATURE_OMAP (1<<14) | ||
| 22 | #define CEPH_FEATURE_MONENC (1<<15) | ||
| 23 | #define CEPH_FEATURE_QUERY_T (1<<16) | ||
| 24 | #define CEPH_FEATURE_INDEP_PG_MAP (1<<17) | ||
| 16 | #define CEPH_FEATURE_CRUSH_TUNABLES (1<<18) | 25 | #define CEPH_FEATURE_CRUSH_TUNABLES (1<<18) |
| 26 | #define CEPH_FEATURE_CHUNKY_SCRUB (1<<19) | ||
| 27 | #define CEPH_FEATURE_MON_NULLROUTE (1<<20) | ||
| 28 | #define CEPH_FEATURE_MON_GV (1<<21) | ||
| 29 | #define CEPH_FEATURE_BACKFILL_RESERVATION (1<<22) | ||
| 30 | #define CEPH_FEATURE_MSG_AUTH (1<<23) | ||
| 31 | #define CEPH_FEATURE_RECOVERY_RESERVATION (1<<24) | ||
| 32 | #define CEPH_FEATURE_CRUSH_TUNABLES2 (1<<25) | ||
| 33 | #define CEPH_FEATURE_CREATEPOOLID (1<<26) | ||
| 34 | #define CEPH_FEATURE_REPLY_CREATE_INODE (1<<27) | ||
| 35 | #define CEPH_FEATURE_OSD_HBMSGS (1<<28) | ||
| 36 | #define CEPH_FEATURE_MDSENC (1<<29) | ||
| 37 | #define CEPH_FEATURE_OSDHASHPSPOOL (1<<30) | ||
| 17 | 38 | ||
| 18 | /* | 39 | /* |
| 19 | * Features supported. | 40 | * Features supported. |
| 20 | */ | 41 | */ |
| 21 | #define CEPH_FEATURES_SUPPORTED_DEFAULT \ | 42 | #define CEPH_FEATURES_SUPPORTED_DEFAULT \ |
| 22 | (CEPH_FEATURE_NOSRCADDR | \ | 43 | (CEPH_FEATURE_NOSRCADDR | \ |
| 23 | CEPH_FEATURE_CRUSH_TUNABLES) | 44 | CEPH_FEATURE_PGID64 | \ |
| 45 | CEPH_FEATURE_PGPOOL3 | \ | ||
| 46 | CEPH_FEATURE_OSDENC | \ | ||
| 47 | CEPH_FEATURE_CRUSH_TUNABLES | \ | ||
| 48 | CEPH_FEATURE_CRUSH_TUNABLES2 | \ | ||
| 49 | CEPH_FEATURE_REPLY_CREATE_INODE | \ | ||
| 50 | CEPH_FEATURE_OSDHASHPSPOOL) | ||
| 24 | 51 | ||
| 25 | #define CEPH_FEATURES_REQUIRED_DEFAULT \ | 52 | #define CEPH_FEATURES_REQUIRED_DEFAULT \ |
| 26 | (CEPH_FEATURE_NOSRCADDR) | 53 | (CEPH_FEATURE_NOSRCADDR | \ |
| 54 | CEPH_FEATURE_PGID64 | \ | ||
| 55 | CEPH_FEATURE_PGPOOL3 | \ | ||
| 56 | CEPH_FEATURE_OSDENC) | ||
| 27 | #endif | 57 | #endif |
diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h index cf6f4d998a76..2ad7b860f062 100644 --- a/include/linux/ceph/ceph_fs.h +++ b/include/linux/ceph/ceph_fs.h | |||
| @@ -21,16 +21,14 @@ | |||
| 21 | * internal cluster protocols separately from the public, | 21 | * internal cluster protocols separately from the public, |
| 22 | * client-facing protocol. | 22 | * client-facing protocol. |
| 23 | */ | 23 | */ |
| 24 | #define CEPH_OSD_PROTOCOL 8 /* cluster internal */ | ||
| 25 | #define CEPH_MDS_PROTOCOL 12 /* cluster internal */ | ||
| 26 | #define CEPH_MON_PROTOCOL 5 /* cluster internal */ | ||
| 27 | #define CEPH_OSDC_PROTOCOL 24 /* server/client */ | 24 | #define CEPH_OSDC_PROTOCOL 24 /* server/client */ |
| 28 | #define CEPH_MDSC_PROTOCOL 32 /* server/client */ | 25 | #define CEPH_MDSC_PROTOCOL 32 /* server/client */ |
| 29 | #define CEPH_MONC_PROTOCOL 15 /* server/client */ | 26 | #define CEPH_MONC_PROTOCOL 15 /* server/client */ |
| 30 | 27 | ||
| 31 | 28 | ||
| 32 | #define CEPH_INO_ROOT 1 | 29 | #define CEPH_INO_ROOT 1 |
| 33 | #define CEPH_INO_CEPH 2 /* hidden .ceph dir */ | 30 | #define CEPH_INO_CEPH 2 /* hidden .ceph dir */ |
| 31 | #define CEPH_INO_DOTDOT 3 /* used by ceph fuse for parent (..) */ | ||
| 34 | 32 | ||
| 35 | /* arbitrary limit on max # of monitors (cluster of 3 is typical) */ | 33 | /* arbitrary limit on max # of monitors (cluster of 3 is typical) */ |
| 36 | #define CEPH_MAX_MON 31 | 34 | #define CEPH_MAX_MON 31 |
| @@ -51,7 +49,7 @@ struct ceph_file_layout { | |||
| 51 | __le32 fl_object_stripe_unit; /* UNUSED. for per-object parity, if any */ | 49 | __le32 fl_object_stripe_unit; /* UNUSED. for per-object parity, if any */ |
| 52 | 50 | ||
| 53 | /* object -> pg layout */ | 51 | /* object -> pg layout */ |
| 54 | __le32 fl_unused; /* unused; used to be preferred primary (-1) */ | 52 | __le32 fl_unused; /* unused; used to be preferred primary for pg (-1 for none) */ |
| 55 | __le32 fl_pg_pool; /* namespace, crush ruleset, rep level */ | 53 | __le32 fl_pg_pool; /* namespace, crush ruleset, rep level */ |
| 56 | } __attribute__ ((packed)); | 54 | } __attribute__ ((packed)); |
| 57 | 55 | ||
| @@ -101,6 +99,8 @@ struct ceph_dir_layout { | |||
| 101 | #define CEPH_MSG_MON_SUBSCRIBE_ACK 16 | 99 | #define CEPH_MSG_MON_SUBSCRIBE_ACK 16 |
| 102 | #define CEPH_MSG_AUTH 17 | 100 | #define CEPH_MSG_AUTH 17 |
| 103 | #define CEPH_MSG_AUTH_REPLY 18 | 101 | #define CEPH_MSG_AUTH_REPLY 18 |
| 102 | #define CEPH_MSG_MON_GET_VERSION 19 | ||
| 103 | #define CEPH_MSG_MON_GET_VERSION_REPLY 20 | ||
| 104 | 104 | ||
| 105 | /* client <-> mds */ | 105 | /* client <-> mds */ |
| 106 | #define CEPH_MSG_MDS_MAP 21 | 106 | #define CEPH_MSG_MDS_MAP 21 |
| @@ -221,6 +221,11 @@ struct ceph_mon_subscribe_ack { | |||
| 221 | } __attribute__ ((packed)); | 221 | } __attribute__ ((packed)); |
| 222 | 222 | ||
| 223 | /* | 223 | /* |
| 224 | * mdsmap flags | ||
| 225 | */ | ||
| 226 | #define CEPH_MDSMAP_DOWN (1<<0) /* cluster deliberately down */ | ||
| 227 | |||
| 228 | /* | ||
| 224 | * mds states | 229 | * mds states |
| 225 | * > 0 -> in | 230 | * > 0 -> in |
| 226 | * <= 0 -> out | 231 | * <= 0 -> out |
| @@ -233,6 +238,7 @@ struct ceph_mon_subscribe_ack { | |||
| 233 | #define CEPH_MDS_STATE_CREATING -6 /* up, creating MDS instance. */ | 238 | #define CEPH_MDS_STATE_CREATING -6 /* up, creating MDS instance. */ |
| 234 | #define CEPH_MDS_STATE_STARTING -7 /* up, starting previously stopped mds */ | 239 | #define CEPH_MDS_STATE_STARTING -7 /* up, starting previously stopped mds */ |
| 235 | #define CEPH_MDS_STATE_STANDBY_REPLAY -8 /* up, tailing active node's journal */ | 240 | #define CEPH_MDS_STATE_STANDBY_REPLAY -8 /* up, tailing active node's journal */ |
| 241 | #define CEPH_MDS_STATE_REPLAYONCE -9 /* up, replaying an active node's journal */ | ||
| 236 | 242 | ||
| 237 | #define CEPH_MDS_STATE_REPLAY 8 /* up, replaying journal. */ | 243 | #define CEPH_MDS_STATE_REPLAY 8 /* up, replaying journal. */ |
| 238 | #define CEPH_MDS_STATE_RESOLVE 9 /* up, disambiguating distributed | 244 | #define CEPH_MDS_STATE_RESOLVE 9 /* up, disambiguating distributed |
| @@ -264,6 +270,7 @@ extern const char *ceph_mds_state_name(int s); | |||
| 264 | #define CEPH_LOCK_IXATTR 2048 | 270 | #define CEPH_LOCK_IXATTR 2048 |
| 265 | #define CEPH_LOCK_IFLOCK 4096 /* advisory file locks */ | 271 | #define CEPH_LOCK_IFLOCK 4096 /* advisory file locks */ |
| 266 | #define CEPH_LOCK_INO 8192 /* immutable inode bits; not a lock */ | 272 | #define CEPH_LOCK_INO 8192 /* immutable inode bits; not a lock */ |
| 273 | #define CEPH_LOCK_IPOLICY 16384 /* policy lock on dirs. MDS internal */ | ||
| 267 | 274 | ||
| 268 | /* client_session ops */ | 275 | /* client_session ops */ |
| 269 | enum { | 276 | enum { |
| @@ -338,6 +345,12 @@ extern const char *ceph_mds_op_name(int op); | |||
| 338 | #define CEPH_SETATTR_SIZE 32 | 345 | #define CEPH_SETATTR_SIZE 32 |
| 339 | #define CEPH_SETATTR_CTIME 64 | 346 | #define CEPH_SETATTR_CTIME 64 |
| 340 | 347 | ||
| 348 | /* | ||
| 349 | * Ceph setxattr request flags. | ||
| 350 | */ | ||
| 351 | #define CEPH_XATTR_CREATE 1 | ||
| 352 | #define CEPH_XATTR_REPLACE 2 | ||
| 353 | |||
| 341 | union ceph_mds_request_args { | 354 | union ceph_mds_request_args { |
| 342 | struct { | 355 | struct { |
| 343 | __le32 mask; /* CEPH_CAP_* */ | 356 | __le32 mask; /* CEPH_CAP_* */ |
| @@ -522,14 +535,17 @@ int ceph_flags_to_mode(int flags); | |||
| 522 | #define CEPH_CAP_GWREXTEND 64 /* (file) client can extend EOF */ | 535 | #define CEPH_CAP_GWREXTEND 64 /* (file) client can extend EOF */ |
| 523 | #define CEPH_CAP_GLAZYIO 128 /* (file) client can perform lazy io */ | 536 | #define CEPH_CAP_GLAZYIO 128 /* (file) client can perform lazy io */ |
| 524 | 537 | ||
| 538 | #define CEPH_CAP_SIMPLE_BITS 2 | ||
| 539 | #define CEPH_CAP_FILE_BITS 8 | ||
| 540 | |||
| 525 | /* per-lock shift */ | 541 | /* per-lock shift */ |
| 526 | #define CEPH_CAP_SAUTH 2 | 542 | #define CEPH_CAP_SAUTH 2 |
| 527 | #define CEPH_CAP_SLINK 4 | 543 | #define CEPH_CAP_SLINK 4 |
| 528 | #define CEPH_CAP_SXATTR 6 | 544 | #define CEPH_CAP_SXATTR 6 |
| 529 | #define CEPH_CAP_SFILE 8 | 545 | #define CEPH_CAP_SFILE 8 |
| 530 | #define CEPH_CAP_SFLOCK 20 | 546 | #define CEPH_CAP_SFLOCK 20 |
| 531 | 547 | ||
| 532 | #define CEPH_CAP_BITS 22 | 548 | #define CEPH_CAP_BITS 22 |
| 533 | 549 | ||
| 534 | /* composed values */ | 550 | /* composed values */ |
| 535 | #define CEPH_CAP_AUTH_SHARED (CEPH_CAP_GSHARED << CEPH_CAP_SAUTH) | 551 | #define CEPH_CAP_AUTH_SHARED (CEPH_CAP_GSHARED << CEPH_CAP_SAUTH) |
diff --git a/include/linux/ceph/decode.h b/include/linux/ceph/decode.h index 63d092822bad..360d9d08ca9e 100644 --- a/include/linux/ceph/decode.h +++ b/include/linux/ceph/decode.h | |||
| @@ -52,10 +52,10 @@ static inline int ceph_has_room(void **p, void *end, size_t n) | |||
| 52 | return end >= *p && n <= end - *p; | 52 | return end >= *p && n <= end - *p; |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | #define ceph_decode_need(p, end, n, bad) \ | 55 | #define ceph_decode_need(p, end, n, bad) \ |
| 56 | do { \ | 56 | do { \ |
| 57 | if (!likely(ceph_has_room(p, end, n))) \ | 57 | if (!likely(ceph_has_room(p, end, n))) \ |
| 58 | goto bad; \ | 58 | goto bad; \ |
| 59 | } while (0) | 59 | } while (0) |
| 60 | 60 | ||
| 61 | #define ceph_decode_64_safe(p, end, v, bad) \ | 61 | #define ceph_decode_64_safe(p, end, v, bad) \ |
| @@ -99,8 +99,8 @@ static inline int ceph_has_room(void **p, void *end, size_t n) | |||
| 99 | * | 99 | * |
| 100 | * There are two possible failures: | 100 | * There are two possible failures: |
| 101 | * - converting the string would require accessing memory at or | 101 | * - converting the string would require accessing memory at or |
| 102 | * beyond the "end" pointer provided (-E | 102 | * beyond the "end" pointer provided (-ERANGE) |
| 103 | * - memory could not be allocated for the result | 103 | * - memory could not be allocated for the result (-ENOMEM) |
| 104 | */ | 104 | */ |
| 105 | static inline char *ceph_extract_encoded_string(void **p, void *end, | 105 | static inline char *ceph_extract_encoded_string(void **p, void *end, |
| 106 | size_t *lenp, gfp_t gfp) | 106 | size_t *lenp, gfp_t gfp) |
| @@ -217,10 +217,10 @@ static inline void ceph_encode_string(void **p, void *end, | |||
| 217 | *p += len; | 217 | *p += len; |
| 218 | } | 218 | } |
| 219 | 219 | ||
| 220 | #define ceph_encode_need(p, end, n, bad) \ | 220 | #define ceph_encode_need(p, end, n, bad) \ |
| 221 | do { \ | 221 | do { \ |
| 222 | if (!likely(ceph_has_room(p, end, n))) \ | 222 | if (!likely(ceph_has_room(p, end, n))) \ |
| 223 | goto bad; \ | 223 | goto bad; \ |
| 224 | } while (0) | 224 | } while (0) |
| 225 | 225 | ||
| 226 | #define ceph_encode_64_safe(p, end, v, bad) \ | 226 | #define ceph_encode_64_safe(p, end, v, bad) \ |
| @@ -231,12 +231,17 @@ static inline void ceph_encode_string(void **p, void *end, | |||
| 231 | #define ceph_encode_32_safe(p, end, v, bad) \ | 231 | #define ceph_encode_32_safe(p, end, v, bad) \ |
| 232 | do { \ | 232 | do { \ |
| 233 | ceph_encode_need(p, end, sizeof(u32), bad); \ | 233 | ceph_encode_need(p, end, sizeof(u32), bad); \ |
| 234 | ceph_encode_32(p, v); \ | 234 | ceph_encode_32(p, v); \ |
| 235 | } while (0) | 235 | } while (0) |
| 236 | #define ceph_encode_16_safe(p, end, v, bad) \ | 236 | #define ceph_encode_16_safe(p, end, v, bad) \ |
| 237 | do { \ | 237 | do { \ |
| 238 | ceph_encode_need(p, end, sizeof(u16), bad); \ | 238 | ceph_encode_need(p, end, sizeof(u16), bad); \ |
| 239 | ceph_encode_16(p, v); \ | 239 | ceph_encode_16(p, v); \ |
| 240 | } while (0) | ||
| 241 | #define ceph_encode_8_safe(p, end, v, bad) \ | ||
| 242 | do { \ | ||
| 243 | ceph_encode_need(p, end, sizeof(u8), bad); \ | ||
| 244 | ceph_encode_8(p, v); \ | ||
| 240 | } while (0) | 245 | } while (0) |
| 241 | 246 | ||
| 242 | #define ceph_encode_copy_safe(p, end, pv, n, bad) \ | 247 | #define ceph_encode_copy_safe(p, end, pv, n, bad) \ |
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h index 084d3c622b12..29818fc3fa49 100644 --- a/include/linux/ceph/libceph.h +++ b/include/linux/ceph/libceph.h | |||
| @@ -193,6 +193,8 @@ static inline int calc_pages_for(u64 off, u64 len) | |||
| 193 | } | 193 | } |
| 194 | 194 | ||
| 195 | /* ceph_common.c */ | 195 | /* ceph_common.c */ |
| 196 | extern bool libceph_compatible(void *data); | ||
| 197 | |||
| 196 | extern const char *ceph_msg_type_name(int type); | 198 | extern const char *ceph_msg_type_name(int type); |
| 197 | extern int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid); | 199 | extern int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid); |
| 198 | extern struct kmem_cache *ceph_inode_cachep; | 200 | extern struct kmem_cache *ceph_inode_cachep; |
| @@ -220,7 +222,7 @@ extern int ceph_open_session(struct ceph_client *client); | |||
| 220 | /* pagevec.c */ | 222 | /* pagevec.c */ |
| 221 | extern void ceph_release_page_vector(struct page **pages, int num_pages); | 223 | extern void ceph_release_page_vector(struct page **pages, int num_pages); |
| 222 | 224 | ||
| 223 | extern struct page **ceph_get_direct_page_vector(const char __user *data, | 225 | extern struct page **ceph_get_direct_page_vector(const void __user *data, |
| 224 | int num_pages, | 226 | int num_pages, |
| 225 | bool write_page); | 227 | bool write_page); |
| 226 | extern void ceph_put_page_vector(struct page **pages, int num_pages, | 228 | extern void ceph_put_page_vector(struct page **pages, int num_pages, |
| @@ -228,15 +230,15 @@ extern void ceph_put_page_vector(struct page **pages, int num_pages, | |||
| 228 | extern void ceph_release_page_vector(struct page **pages, int num_pages); | 230 | extern void ceph_release_page_vector(struct page **pages, int num_pages); |
| 229 | extern struct page **ceph_alloc_page_vector(int num_pages, gfp_t flags); | 231 | extern struct page **ceph_alloc_page_vector(int num_pages, gfp_t flags); |
| 230 | extern int ceph_copy_user_to_page_vector(struct page **pages, | 232 | extern int ceph_copy_user_to_page_vector(struct page **pages, |
| 231 | const char __user *data, | 233 | const void __user *data, |
| 232 | loff_t off, size_t len); | 234 | loff_t off, size_t len); |
| 233 | extern int ceph_copy_to_page_vector(struct page **pages, | 235 | extern void ceph_copy_to_page_vector(struct page **pages, |
| 234 | const char *data, | 236 | const void *data, |
| 235 | loff_t off, size_t len); | 237 | loff_t off, size_t len); |
| 236 | extern int ceph_copy_from_page_vector(struct page **pages, | 238 | extern void ceph_copy_from_page_vector(struct page **pages, |
| 237 | char *data, | 239 | void *data, |
| 238 | loff_t off, size_t len); | 240 | loff_t off, size_t len); |
| 239 | extern int ceph_copy_page_vector_to_user(struct page **pages, char __user *data, | 241 | extern int ceph_copy_page_vector_to_user(struct page **pages, void __user *data, |
| 240 | loff_t off, size_t len); | 242 | loff_t off, size_t len); |
| 241 | extern void ceph_zero_page_vector_range(int off, int len, struct page **pages); | 243 | extern void ceph_zero_page_vector_range(int off, int len, struct page **pages); |
| 242 | 244 | ||
diff --git a/include/linux/ceph/mdsmap.h b/include/linux/ceph/mdsmap.h index cb15b5d867c7..87ed09f54800 100644 --- a/include/linux/ceph/mdsmap.h +++ b/include/linux/ceph/mdsmap.h | |||
| @@ -29,8 +29,8 @@ struct ceph_mdsmap { | |||
| 29 | 29 | ||
| 30 | /* which object pools file data can be stored in */ | 30 | /* which object pools file data can be stored in */ |
| 31 | int m_num_data_pg_pools; | 31 | int m_num_data_pg_pools; |
| 32 | u32 *m_data_pg_pools; | 32 | u64 *m_data_pg_pools; |
| 33 | u32 m_cas_pg_pool; | 33 | u64 m_cas_pg_pool; |
| 34 | }; | 34 | }; |
| 35 | 35 | ||
| 36 | static inline struct ceph_entity_addr * | 36 | static inline struct ceph_entity_addr * |
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h index 14ba5ee738a9..60903e0f665c 100644 --- a/include/linux/ceph/messenger.h +++ b/include/linux/ceph/messenger.h | |||
| @@ -83,9 +83,11 @@ struct ceph_msg { | |||
| 83 | struct list_head list_head; | 83 | struct list_head list_head; |
| 84 | 84 | ||
| 85 | struct kref kref; | 85 | struct kref kref; |
| 86 | #ifdef CONFIG_BLOCK | ||
| 86 | struct bio *bio; /* instead of pages/pagelist */ | 87 | struct bio *bio; /* instead of pages/pagelist */ |
| 87 | struct bio *bio_iter; /* bio iterator */ | 88 | struct bio *bio_iter; /* bio iterator */ |
| 88 | int bio_seg; /* current bio segment */ | 89 | int bio_seg; /* current bio segment */ |
| 90 | #endif /* CONFIG_BLOCK */ | ||
| 89 | struct ceph_pagelist *trail; /* the trailing part of the data */ | 91 | struct ceph_pagelist *trail; /* the trailing part of the data */ |
| 90 | bool front_is_vmalloc; | 92 | bool front_is_vmalloc; |
| 91 | bool more_to_follow; | 93 | bool more_to_follow; |
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h index d9b880e977e6..1dd5d466b6f9 100644 --- a/include/linux/ceph/osd_client.h +++ b/include/linux/ceph/osd_client.h | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <linux/ceph/osdmap.h> | 10 | #include <linux/ceph/osdmap.h> |
| 11 | #include <linux/ceph/messenger.h> | 11 | #include <linux/ceph/messenger.h> |
| 12 | #include <linux/ceph/auth.h> | 12 | #include <linux/ceph/auth.h> |
| 13 | #include <linux/ceph/pagelist.h> | ||
| 13 | 14 | ||
| 14 | /* | 15 | /* |
| 15 | * Maximum object name size | 16 | * Maximum object name size |
| @@ -22,7 +23,6 @@ struct ceph_snap_context; | |||
| 22 | struct ceph_osd_request; | 23 | struct ceph_osd_request; |
| 23 | struct ceph_osd_client; | 24 | struct ceph_osd_client; |
| 24 | struct ceph_authorizer; | 25 | struct ceph_authorizer; |
| 25 | struct ceph_pagelist; | ||
| 26 | 26 | ||
| 27 | /* | 27 | /* |
| 28 | * completion callback for async writepages | 28 | * completion callback for async writepages |
| @@ -47,6 +47,9 @@ struct ceph_osd { | |||
| 47 | struct list_head o_keepalive_item; | 47 | struct list_head o_keepalive_item; |
| 48 | }; | 48 | }; |
| 49 | 49 | ||
| 50 | |||
| 51 | #define CEPH_OSD_MAX_OP 10 | ||
| 52 | |||
| 50 | /* an in-flight request */ | 53 | /* an in-flight request */ |
| 51 | struct ceph_osd_request { | 54 | struct ceph_osd_request { |
| 52 | u64 r_tid; /* unique for this client */ | 55 | u64 r_tid; /* unique for this client */ |
| @@ -63,9 +66,23 @@ struct ceph_osd_request { | |||
| 63 | struct ceph_connection *r_con_filling_msg; | 66 | struct ceph_connection *r_con_filling_msg; |
| 64 | 67 | ||
| 65 | struct ceph_msg *r_request, *r_reply; | 68 | struct ceph_msg *r_request, *r_reply; |
| 66 | int r_result; | ||
| 67 | int r_flags; /* any additional flags for the osd */ | 69 | int r_flags; /* any additional flags for the osd */ |
| 68 | u32 r_sent; /* >0 if r_request is sending/sent */ | 70 | u32 r_sent; /* >0 if r_request is sending/sent */ |
| 71 | int r_num_ops; | ||
| 72 | |||
| 73 | /* encoded message content */ | ||
| 74 | struct ceph_osd_op *r_request_ops; | ||
| 75 | /* these are updated on each send */ | ||
| 76 | __le32 *r_request_osdmap_epoch; | ||
| 77 | __le32 *r_request_flags; | ||
| 78 | __le64 *r_request_pool; | ||
| 79 | void *r_request_pgid; | ||
| 80 | __le32 *r_request_attempts; | ||
| 81 | struct ceph_eversion *r_request_reassert_version; | ||
| 82 | |||
| 83 | int r_result; | ||
| 84 | int r_reply_op_len[CEPH_OSD_MAX_OP]; | ||
| 85 | s32 r_reply_op_result[CEPH_OSD_MAX_OP]; | ||
| 69 | int r_got_reply; | 86 | int r_got_reply; |
| 70 | int r_linger; | 87 | int r_linger; |
| 71 | 88 | ||
| @@ -82,6 +99,7 @@ struct ceph_osd_request { | |||
| 82 | 99 | ||
| 83 | char r_oid[MAX_OBJ_NAME_SIZE]; /* object name */ | 100 | char r_oid[MAX_OBJ_NAME_SIZE]; /* object name */ |
| 84 | int r_oid_len; | 101 | int r_oid_len; |
| 102 | u64 r_snapid; | ||
| 85 | unsigned long r_stamp; /* send OR check time */ | 103 | unsigned long r_stamp; /* send OR check time */ |
| 86 | 104 | ||
| 87 | struct ceph_file_layout r_file_layout; | 105 | struct ceph_file_layout r_file_layout; |
| @@ -95,7 +113,7 @@ struct ceph_osd_request { | |||
| 95 | struct bio *r_bio; /* instead of pages */ | 113 | struct bio *r_bio; /* instead of pages */ |
| 96 | #endif | 114 | #endif |
| 97 | 115 | ||
| 98 | struct ceph_pagelist *r_trail; /* trailing part of the data */ | 116 | struct ceph_pagelist r_trail; /* trailing part of the data */ |
| 99 | }; | 117 | }; |
| 100 | 118 | ||
| 101 | struct ceph_osd_event { | 119 | struct ceph_osd_event { |
| @@ -107,7 +125,6 @@ struct ceph_osd_event { | |||
| 107 | struct rb_node node; | 125 | struct rb_node node; |
| 108 | struct list_head osd_node; | 126 | struct list_head osd_node; |
| 109 | struct kref kref; | 127 | struct kref kref; |
| 110 | struct completion completion; | ||
| 111 | }; | 128 | }; |
| 112 | 129 | ||
| 113 | struct ceph_osd_event_work { | 130 | struct ceph_osd_event_work { |
| @@ -157,7 +174,7 @@ struct ceph_osd_client { | |||
| 157 | 174 | ||
| 158 | struct ceph_osd_req_op { | 175 | struct ceph_osd_req_op { |
| 159 | u16 op; /* CEPH_OSD_OP_* */ | 176 | u16 op; /* CEPH_OSD_OP_* */ |
| 160 | u32 flags; /* CEPH_OSD_FLAG_* */ | 177 | u32 payload_len; |
| 161 | union { | 178 | union { |
| 162 | struct { | 179 | struct { |
| 163 | u64 offset, length; | 180 | u64 offset, length; |
| @@ -166,23 +183,24 @@ struct ceph_osd_req_op { | |||
| 166 | } extent; | 183 | } extent; |
| 167 | struct { | 184 | struct { |
| 168 | const char *name; | 185 | const char *name; |
| 169 | u32 name_len; | ||
| 170 | const char *val; | 186 | const char *val; |
| 187 | u32 name_len; | ||
| 171 | u32 value_len; | 188 | u32 value_len; |
| 172 | __u8 cmp_op; /* CEPH_OSD_CMPXATTR_OP_* */ | 189 | __u8 cmp_op; /* CEPH_OSD_CMPXATTR_OP_* */ |
| 173 | __u8 cmp_mode; /* CEPH_OSD_CMPXATTR_MODE_* */ | 190 | __u8 cmp_mode; /* CEPH_OSD_CMPXATTR_MODE_* */ |
| 174 | } xattr; | 191 | } xattr; |
| 175 | struct { | 192 | struct { |
| 176 | const char *class_name; | 193 | const char *class_name; |
| 177 | __u8 class_len; | ||
| 178 | const char *method_name; | 194 | const char *method_name; |
| 179 | __u8 method_len; | ||
| 180 | __u8 argc; | ||
| 181 | const char *indata; | 195 | const char *indata; |
| 182 | u32 indata_len; | 196 | u32 indata_len; |
| 197 | __u8 class_len; | ||
| 198 | __u8 method_len; | ||
| 199 | __u8 argc; | ||
| 183 | } cls; | 200 | } cls; |
| 184 | struct { | 201 | struct { |
| 185 | u64 cookie, count; | 202 | u64 cookie; |
| 203 | u64 count; | ||
| 186 | } pgls; | 204 | } pgls; |
| 187 | struct { | 205 | struct { |
| 188 | u64 snapid; | 206 | u64 snapid; |
| @@ -190,12 +208,11 @@ struct ceph_osd_req_op { | |||
| 190 | struct { | 208 | struct { |
| 191 | u64 cookie; | 209 | u64 cookie; |
| 192 | u64 ver; | 210 | u64 ver; |
| 193 | __u8 flag; | ||
| 194 | u32 prot_ver; | 211 | u32 prot_ver; |
| 195 | u32 timeout; | 212 | u32 timeout; |
| 213 | __u8 flag; | ||
| 196 | } watch; | 214 | } watch; |
| 197 | }; | 215 | }; |
| 198 | u32 payload_len; | ||
| 199 | }; | 216 | }; |
| 200 | 217 | ||
| 201 | extern int ceph_osdc_init(struct ceph_osd_client *osdc, | 218 | extern int ceph_osdc_init(struct ceph_osd_client *osdc, |
| @@ -207,29 +224,19 @@ extern void ceph_osdc_handle_reply(struct ceph_osd_client *osdc, | |||
| 207 | extern void ceph_osdc_handle_map(struct ceph_osd_client *osdc, | 224 | extern void ceph_osdc_handle_map(struct ceph_osd_client *osdc, |
| 208 | struct ceph_msg *msg); | 225 | struct ceph_msg *msg); |
| 209 | 226 | ||
| 210 | extern int ceph_calc_raw_layout(struct ceph_osd_client *osdc, | ||
| 211 | struct ceph_file_layout *layout, | ||
| 212 | u64 snapid, | ||
| 213 | u64 off, u64 *plen, u64 *bno, | ||
| 214 | struct ceph_osd_request *req, | ||
| 215 | struct ceph_osd_req_op *op); | ||
| 216 | |||
| 217 | extern struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc, | 227 | extern struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc, |
| 218 | int flags, | ||
| 219 | struct ceph_snap_context *snapc, | 228 | struct ceph_snap_context *snapc, |
| 220 | struct ceph_osd_req_op *ops, | 229 | unsigned int num_op, |
| 221 | bool use_mempool, | 230 | bool use_mempool, |
| 222 | gfp_t gfp_flags, | 231 | gfp_t gfp_flags); |
| 223 | struct page **pages, | ||
| 224 | struct bio *bio); | ||
| 225 | 232 | ||
| 226 | extern void ceph_osdc_build_request(struct ceph_osd_request *req, | 233 | extern void ceph_osdc_build_request(struct ceph_osd_request *req, |
| 227 | u64 off, u64 *plen, | 234 | u64 off, u64 len, |
| 235 | unsigned int num_op, | ||
| 228 | struct ceph_osd_req_op *src_ops, | 236 | struct ceph_osd_req_op *src_ops, |
| 229 | struct ceph_snap_context *snapc, | 237 | struct ceph_snap_context *snapc, |
| 230 | struct timespec *mtime, | 238 | u64 snap_id, |
| 231 | const char *oid, | 239 | struct timespec *mtime); |
| 232 | int oid_len); | ||
| 233 | 240 | ||
| 234 | extern struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *, | 241 | extern struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *, |
| 235 | struct ceph_file_layout *layout, | 242 | struct ceph_file_layout *layout, |
| @@ -239,8 +246,7 @@ extern struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *, | |||
| 239 | int do_sync, u32 truncate_seq, | 246 | int do_sync, u32 truncate_seq, |
| 240 | u64 truncate_size, | 247 | u64 truncate_size, |
| 241 | struct timespec *mtime, | 248 | struct timespec *mtime, |
| 242 | bool use_mempool, int num_reply, | 249 | bool use_mempool, int page_align); |
| 243 | int page_align); | ||
| 244 | 250 | ||
| 245 | extern void ceph_osdc_set_request_linger(struct ceph_osd_client *osdc, | 251 | extern void ceph_osdc_set_request_linger(struct ceph_osd_client *osdc, |
| 246 | struct ceph_osd_request *req); | 252 | struct ceph_osd_request *req); |
| @@ -279,17 +285,13 @@ extern int ceph_osdc_writepages(struct ceph_osd_client *osdc, | |||
| 279 | u64 off, u64 len, | 285 | u64 off, u64 len, |
| 280 | u32 truncate_seq, u64 truncate_size, | 286 | u32 truncate_seq, u64 truncate_size, |
| 281 | struct timespec *mtime, | 287 | struct timespec *mtime, |
| 282 | struct page **pages, int nr_pages, | 288 | struct page **pages, int nr_pages); |
| 283 | int flags, int do_sync, bool nofail); | ||
| 284 | 289 | ||
| 285 | /* watch/notify events */ | 290 | /* watch/notify events */ |
| 286 | extern int ceph_osdc_create_event(struct ceph_osd_client *osdc, | 291 | extern int ceph_osdc_create_event(struct ceph_osd_client *osdc, |
| 287 | void (*event_cb)(u64, u64, u8, void *), | 292 | void (*event_cb)(u64, u64, u8, void *), |
| 288 | int one_shot, void *data, | 293 | void *data, struct ceph_osd_event **pevent); |
| 289 | struct ceph_osd_event **pevent); | ||
| 290 | extern void ceph_osdc_cancel_event(struct ceph_osd_event *event); | 294 | extern void ceph_osdc_cancel_event(struct ceph_osd_event *event); |
| 291 | extern int ceph_osdc_wait_event(struct ceph_osd_event *event, | ||
| 292 | unsigned long timeout); | ||
| 293 | extern void ceph_osdc_put_event(struct ceph_osd_event *event); | 295 | extern void ceph_osdc_put_event(struct ceph_osd_event *event); |
| 294 | #endif | 296 | #endif |
| 295 | 297 | ||
diff --git a/include/linux/ceph/osdmap.h b/include/linux/ceph/osdmap.h index 10a417f9f76f..c819190d1642 100644 --- a/include/linux/ceph/osdmap.h +++ b/include/linux/ceph/osdmap.h | |||
| @@ -18,14 +18,31 @@ | |||
| 18 | * The map can be updated either via an incremental map (diff) describing | 18 | * The map can be updated either via an incremental map (diff) describing |
| 19 | * the change between two successive epochs, or as a fully encoded map. | 19 | * the change between two successive epochs, or as a fully encoded map. |
| 20 | */ | 20 | */ |
| 21 | struct ceph_pg { | ||
| 22 | uint64_t pool; | ||
| 23 | uint32_t seed; | ||
| 24 | }; | ||
| 25 | |||
| 26 | #define CEPH_POOL_FLAG_HASHPSPOOL 1 | ||
| 27 | |||
| 21 | struct ceph_pg_pool_info { | 28 | struct ceph_pg_pool_info { |
| 22 | struct rb_node node; | 29 | struct rb_node node; |
| 23 | int id; | 30 | s64 id; |
| 24 | struct ceph_pg_pool v; | 31 | u8 type; |
| 25 | int pg_num_mask, pgp_num_mask, lpg_num_mask, lpgp_num_mask; | 32 | u8 size; |
| 33 | u8 crush_ruleset; | ||
| 34 | u8 object_hash; | ||
| 35 | u32 pg_num, pgp_num; | ||
| 36 | int pg_num_mask, pgp_num_mask; | ||
| 37 | u64 flags; | ||
| 26 | char *name; | 38 | char *name; |
| 27 | }; | 39 | }; |
| 28 | 40 | ||
| 41 | struct ceph_object_locator { | ||
| 42 | uint64_t pool; | ||
| 43 | char *key; | ||
| 44 | }; | ||
| 45 | |||
| 29 | struct ceph_pg_mapping { | 46 | struct ceph_pg_mapping { |
| 30 | struct rb_node node; | 47 | struct rb_node node; |
| 31 | struct ceph_pg pgid; | 48 | struct ceph_pg pgid; |
| @@ -110,15 +127,16 @@ extern void ceph_osdmap_destroy(struct ceph_osdmap *map); | |||
| 110 | 127 | ||
| 111 | /* calculate mapping of a file extent to an object */ | 128 | /* calculate mapping of a file extent to an object */ |
| 112 | extern int ceph_calc_file_object_mapping(struct ceph_file_layout *layout, | 129 | extern int ceph_calc_file_object_mapping(struct ceph_file_layout *layout, |
| 113 | u64 off, u64 *plen, | 130 | u64 off, u64 len, |
| 114 | u64 *bno, u64 *oxoff, u64 *oxlen); | 131 | u64 *bno, u64 *oxoff, u64 *oxlen); |
| 115 | 132 | ||
| 116 | /* calculate mapping of object to a placement group */ | 133 | /* calculate mapping of object to a placement group */ |
| 117 | extern int ceph_calc_object_layout(struct ceph_object_layout *ol, | 134 | extern int ceph_calc_object_layout(struct ceph_pg *pg, |
| 118 | const char *oid, | 135 | const char *oid, |
| 119 | struct ceph_file_layout *fl, | 136 | struct ceph_file_layout *fl, |
| 120 | struct ceph_osdmap *osdmap); | 137 | struct ceph_osdmap *osdmap); |
| 121 | extern int ceph_calc_pg_acting(struct ceph_osdmap *osdmap, struct ceph_pg pgid, | 138 | extern int ceph_calc_pg_acting(struct ceph_osdmap *osdmap, |
| 139 | struct ceph_pg pgid, | ||
| 122 | int *acting); | 140 | int *acting); |
| 123 | extern int ceph_calc_pg_primary(struct ceph_osdmap *osdmap, | 141 | extern int ceph_calc_pg_primary(struct ceph_osdmap *osdmap, |
| 124 | struct ceph_pg pgid); | 142 | struct ceph_pg pgid); |
diff --git a/include/linux/ceph/rados.h b/include/linux/ceph/rados.h index 2c04afeead1c..68c96a508ac2 100644 --- a/include/linux/ceph/rados.h +++ b/include/linux/ceph/rados.h | |||
| @@ -9,14 +9,6 @@ | |||
| 9 | #include <linux/ceph/msgr.h> | 9 | #include <linux/ceph/msgr.h> |
| 10 | 10 | ||
| 11 | /* | 11 | /* |
| 12 | * osdmap encoding versions | ||
| 13 | */ | ||
| 14 | #define CEPH_OSDMAP_INC_VERSION 5 | ||
| 15 | #define CEPH_OSDMAP_INC_VERSION_EXT 6 | ||
| 16 | #define CEPH_OSDMAP_VERSION 5 | ||
| 17 | #define CEPH_OSDMAP_VERSION_EXT 6 | ||
| 18 | |||
| 19 | /* | ||
| 20 | * fs id | 12 | * fs id |
| 21 | */ | 13 | */ |
| 22 | struct ceph_fsid { | 14 | struct ceph_fsid { |
| @@ -64,7 +56,7 @@ struct ceph_timespec { | |||
| 64 | * placement group. | 56 | * placement group. |
| 65 | * we encode this into one __le64. | 57 | * we encode this into one __le64. |
| 66 | */ | 58 | */ |
| 67 | struct ceph_pg { | 59 | struct ceph_pg_v1 { |
| 68 | __le16 preferred; /* preferred primary osd */ | 60 | __le16 preferred; /* preferred primary osd */ |
| 69 | __le16 ps; /* placement seed */ | 61 | __le16 ps; /* placement seed */ |
| 70 | __le32 pool; /* object pool */ | 62 | __le32 pool; /* object pool */ |
| @@ -91,21 +83,6 @@ struct ceph_pg { | |||
| 91 | 83 | ||
| 92 | #define CEPH_PG_TYPE_REP 1 | 84 | #define CEPH_PG_TYPE_REP 1 |
| 93 | #define CEPH_PG_TYPE_RAID4 2 | 85 | #define CEPH_PG_TYPE_RAID4 2 |
| 94 | #define CEPH_PG_POOL_VERSION 2 | ||
| 95 | struct ceph_pg_pool { | ||
| 96 | __u8 type; /* CEPH_PG_TYPE_* */ | ||
| 97 | __u8 size; /* number of osds in each pg */ | ||
| 98 | __u8 crush_ruleset; /* crush placement rule */ | ||
| 99 | __u8 object_hash; /* hash mapping object name to ps */ | ||
| 100 | __le32 pg_num, pgp_num; /* number of pg's */ | ||
| 101 | __le32 lpg_num, lpgp_num; /* number of localized pg's */ | ||
| 102 | __le32 last_change; /* most recent epoch changed */ | ||
| 103 | __le64 snap_seq; /* seq for per-pool snapshot */ | ||
| 104 | __le32 snap_epoch; /* epoch of last snap */ | ||
| 105 | __le32 num_snaps; | ||
| 106 | __le32 num_removed_snap_intervals; /* if non-empty, NO per-pool snaps */ | ||
| 107 | __le64 auid; /* who owns the pg */ | ||
| 108 | } __attribute__ ((packed)); | ||
| 109 | 86 | ||
| 110 | /* | 87 | /* |
| 111 | * stable_mod func is used to control number of placement groups. | 88 | * stable_mod func is used to control number of placement groups. |
| @@ -128,7 +105,7 @@ static inline int ceph_stable_mod(int x, int b, int bmask) | |||
| 128 | * object layout - how a given object should be stored. | 105 | * object layout - how a given object should be stored. |
| 129 | */ | 106 | */ |
| 130 | struct ceph_object_layout { | 107 | struct ceph_object_layout { |
| 131 | struct ceph_pg ol_pgid; /* raw pg, with _full_ ps precision. */ | 108 | struct ceph_pg_v1 ol_pgid; /* raw pg, with _full_ ps precision. */ |
| 132 | __le32 ol_stripe_unit; /* for per-object parity, if any */ | 109 | __le32 ol_stripe_unit; /* for per-object parity, if any */ |
| 133 | } __attribute__ ((packed)); | 110 | } __attribute__ ((packed)); |
| 134 | 111 | ||
| @@ -145,8 +122,12 @@ struct ceph_eversion { | |||
| 145 | */ | 122 | */ |
| 146 | 123 | ||
| 147 | /* status bits */ | 124 | /* status bits */ |
| 148 | #define CEPH_OSD_EXISTS 1 | 125 | #define CEPH_OSD_EXISTS (1<<0) |
| 149 | #define CEPH_OSD_UP 2 | 126 | #define CEPH_OSD_UP (1<<1) |
| 127 | #define CEPH_OSD_AUTOOUT (1<<2) /* osd was automatically marked out */ | ||
| 128 | #define CEPH_OSD_NEW (1<<3) /* osd is new, never marked in */ | ||
| 129 | |||
| 130 | extern const char *ceph_osd_state_name(int s); | ||
| 150 | 131 | ||
| 151 | /* osd weights. fixed point value: 0x10000 == 1.0 ("in"), 0 == "out" */ | 132 | /* osd weights. fixed point value: 0x10000 == 1.0 ("in"), 0 == "out" */ |
| 152 | #define CEPH_OSD_IN 0x10000 | 133 | #define CEPH_OSD_IN 0x10000 |
| @@ -161,9 +142,25 @@ struct ceph_eversion { | |||
| 161 | #define CEPH_OSDMAP_PAUSERD (1<<2) /* pause all reads */ | 142 | #define CEPH_OSDMAP_PAUSERD (1<<2) /* pause all reads */ |
| 162 | #define CEPH_OSDMAP_PAUSEWR (1<<3) /* pause all writes */ | 143 | #define CEPH_OSDMAP_PAUSEWR (1<<3) /* pause all writes */ |
| 163 | #define CEPH_OSDMAP_PAUSEREC (1<<4) /* pause recovery */ | 144 | #define CEPH_OSDMAP_PAUSEREC (1<<4) /* pause recovery */ |
| 145 | #define CEPH_OSDMAP_NOUP (1<<5) /* block osd boot */ | ||
| 146 | #define CEPH_OSDMAP_NODOWN (1<<6) /* block osd mark-down/failure */ | ||
| 147 | #define CEPH_OSDMAP_NOOUT (1<<7) /* block osd auto mark-out */ | ||
| 148 | #define CEPH_OSDMAP_NOIN (1<<8) /* block osd auto mark-in */ | ||
| 149 | #define CEPH_OSDMAP_NOBACKFILL (1<<9) /* block osd backfill */ | ||
| 150 | #define CEPH_OSDMAP_NORECOVER (1<<10) /* block osd recovery and backfill */ | ||
| 151 | |||
| 152 | /* | ||
| 153 | * The error code to return when an OSD can't handle a write | ||
| 154 | * because it is too large. | ||
| 155 | */ | ||
| 156 | #define OSD_WRITETOOBIG EMSGSIZE | ||
| 164 | 157 | ||
| 165 | /* | 158 | /* |
| 166 | * osd ops | 159 | * osd ops |
| 160 | * | ||
| 161 | * WARNING: do not use these op codes directly. Use the helpers | ||
| 162 | * defined below instead. In certain cases, op code behavior was | ||
| 163 | * redefined, resulting in special-cases in the helpers. | ||
| 167 | */ | 164 | */ |
| 168 | #define CEPH_OSD_OP_MODE 0xf000 | 165 | #define CEPH_OSD_OP_MODE 0xf000 |
| 169 | #define CEPH_OSD_OP_MODE_RD 0x1000 | 166 | #define CEPH_OSD_OP_MODE_RD 0x1000 |
| @@ -177,6 +174,7 @@ struct ceph_eversion { | |||
| 177 | #define CEPH_OSD_OP_TYPE_ATTR 0x0300 | 174 | #define CEPH_OSD_OP_TYPE_ATTR 0x0300 |
| 178 | #define CEPH_OSD_OP_TYPE_EXEC 0x0400 | 175 | #define CEPH_OSD_OP_TYPE_EXEC 0x0400 |
| 179 | #define CEPH_OSD_OP_TYPE_PG 0x0500 | 176 | #define CEPH_OSD_OP_TYPE_PG 0x0500 |
| 177 | #define CEPH_OSD_OP_TYPE_MULTI 0x0600 /* multiobject */ | ||
| 180 | 178 | ||
| 181 | enum { | 179 | enum { |
| 182 | /** data **/ | 180 | /** data **/ |
| @@ -217,6 +215,23 @@ enum { | |||
| 217 | 215 | ||
| 218 | CEPH_OSD_OP_WATCH = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_DATA | 15, | 216 | CEPH_OSD_OP_WATCH = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_DATA | 15, |
| 219 | 217 | ||
| 218 | /* omap */ | ||
| 219 | CEPH_OSD_OP_OMAPGETKEYS = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_DATA | 17, | ||
| 220 | CEPH_OSD_OP_OMAPGETVALS = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_DATA | 18, | ||
| 221 | CEPH_OSD_OP_OMAPGETHEADER = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_DATA | 19, | ||
| 222 | CEPH_OSD_OP_OMAPGETVALSBYKEYS = | ||
| 223 | CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_DATA | 20, | ||
| 224 | CEPH_OSD_OP_OMAPSETVALS = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_DATA | 21, | ||
| 225 | CEPH_OSD_OP_OMAPSETHEADER = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_DATA | 22, | ||
| 226 | CEPH_OSD_OP_OMAPCLEAR = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_DATA | 23, | ||
| 227 | CEPH_OSD_OP_OMAPRMKEYS = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_DATA | 24, | ||
| 228 | CEPH_OSD_OP_OMAP_CMP = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_DATA | 25, | ||
| 229 | |||
| 230 | /** multi **/ | ||
| 231 | CEPH_OSD_OP_CLONERANGE = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_MULTI | 1, | ||
| 232 | CEPH_OSD_OP_ASSERT_SRC_VERSION = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_MULTI | 2, | ||
| 233 | CEPH_OSD_OP_SRC_CMPXATTR = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_MULTI | 3, | ||
| 234 | |||
| 220 | /** attrs **/ | 235 | /** attrs **/ |
| 221 | /* read */ | 236 | /* read */ |
| 222 | CEPH_OSD_OP_GETXATTR = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_ATTR | 1, | 237 | CEPH_OSD_OP_GETXATTR = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_ATTR | 1, |
| @@ -238,6 +253,7 @@ enum { | |||
| 238 | CEPH_OSD_OP_SCRUB_RESERVE = CEPH_OSD_OP_MODE_SUB | 6, | 253 | CEPH_OSD_OP_SCRUB_RESERVE = CEPH_OSD_OP_MODE_SUB | 6, |
| 239 | CEPH_OSD_OP_SCRUB_UNRESERVE = CEPH_OSD_OP_MODE_SUB | 7, | 254 | CEPH_OSD_OP_SCRUB_UNRESERVE = CEPH_OSD_OP_MODE_SUB | 7, |
| 240 | CEPH_OSD_OP_SCRUB_STOP = CEPH_OSD_OP_MODE_SUB | 8, | 255 | CEPH_OSD_OP_SCRUB_STOP = CEPH_OSD_OP_MODE_SUB | 8, |
| 256 | CEPH_OSD_OP_SCRUB_MAP = CEPH_OSD_OP_MODE_SUB | 9, | ||
| 241 | 257 | ||
| 242 | /** lock **/ | 258 | /** lock **/ |
| 243 | CEPH_OSD_OP_WRLOCK = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_LOCK | 1, | 259 | CEPH_OSD_OP_WRLOCK = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_LOCK | 1, |
| @@ -248,10 +264,12 @@ enum { | |||
| 248 | CEPH_OSD_OP_DNLOCK = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_LOCK | 6, | 264 | CEPH_OSD_OP_DNLOCK = CEPH_OSD_OP_MODE_WR | CEPH_OSD_OP_TYPE_LOCK | 6, |
| 249 | 265 | ||
| 250 | /** exec **/ | 266 | /** exec **/ |
| 267 | /* note: the RD bit here is wrong; see special-case below in helper */ | ||
| 251 | CEPH_OSD_OP_CALL = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_EXEC | 1, | 268 | CEPH_OSD_OP_CALL = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_EXEC | 1, |
| 252 | 269 | ||
| 253 | /** pg **/ | 270 | /** pg **/ |
| 254 | CEPH_OSD_OP_PGLS = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_PG | 1, | 271 | CEPH_OSD_OP_PGLS = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_PG | 1, |
| 272 | CEPH_OSD_OP_PGLS_FILTER = CEPH_OSD_OP_MODE_RD | CEPH_OSD_OP_TYPE_PG | 2, | ||
| 255 | }; | 273 | }; |
| 256 | 274 | ||
| 257 | static inline int ceph_osd_op_type_lock(int op) | 275 | static inline int ceph_osd_op_type_lock(int op) |
| @@ -274,6 +292,10 @@ static inline int ceph_osd_op_type_pg(int op) | |||
| 274 | { | 292 | { |
| 275 | return (op & CEPH_OSD_OP_TYPE) == CEPH_OSD_OP_TYPE_PG; | 293 | return (op & CEPH_OSD_OP_TYPE) == CEPH_OSD_OP_TYPE_PG; |
| 276 | } | 294 | } |
| 295 | static inline int ceph_osd_op_type_multi(int op) | ||
| 296 | { | ||
| 297 | return (op & CEPH_OSD_OP_TYPE) == CEPH_OSD_OP_TYPE_MULTI; | ||
| 298 | } | ||
| 277 | 299 | ||
| 278 | static inline int ceph_osd_op_mode_subop(int op) | 300 | static inline int ceph_osd_op_mode_subop(int op) |
| 279 | { | 301 | { |
| @@ -281,11 +303,12 @@ static inline int ceph_osd_op_mode_subop(int op) | |||
| 281 | } | 303 | } |
| 282 | static inline int ceph_osd_op_mode_read(int op) | 304 | static inline int ceph_osd_op_mode_read(int op) |
| 283 | { | 305 | { |
| 284 | return (op & CEPH_OSD_OP_MODE) == CEPH_OSD_OP_MODE_RD; | 306 | return (op & CEPH_OSD_OP_MODE_RD) && |
| 307 | op != CEPH_OSD_OP_CALL; | ||
| 285 | } | 308 | } |
| 286 | static inline int ceph_osd_op_mode_modify(int op) | 309 | static inline int ceph_osd_op_mode_modify(int op) |
| 287 | { | 310 | { |
| 288 | return (op & CEPH_OSD_OP_MODE) == CEPH_OSD_OP_MODE_WR; | 311 | return op & CEPH_OSD_OP_MODE_WR; |
| 289 | } | 312 | } |
| 290 | 313 | ||
| 291 | /* | 314 | /* |
| @@ -294,34 +317,38 @@ static inline int ceph_osd_op_mode_modify(int op) | |||
| 294 | */ | 317 | */ |
| 295 | #define CEPH_OSD_TMAP_HDR 'h' | 318 | #define CEPH_OSD_TMAP_HDR 'h' |
| 296 | #define CEPH_OSD_TMAP_SET 's' | 319 | #define CEPH_OSD_TMAP_SET 's' |
| 320 | #define CEPH_OSD_TMAP_CREATE 'c' /* create key */ | ||
| 297 | #define CEPH_OSD_TMAP_RM 'r' | 321 | #define CEPH_OSD_TMAP_RM 'r' |
| 322 | #define CEPH_OSD_TMAP_RMSLOPPY 'R' | ||
| 298 | 323 | ||
| 299 | extern const char *ceph_osd_op_name(int op); | 324 | extern const char *ceph_osd_op_name(int op); |
| 300 | 325 | ||
| 301 | |||
| 302 | /* | 326 | /* |
| 303 | * osd op flags | 327 | * osd op flags |
| 304 | * | 328 | * |
| 305 | * An op may be READ, WRITE, or READ|WRITE. | 329 | * An op may be READ, WRITE, or READ|WRITE. |
| 306 | */ | 330 | */ |
| 307 | enum { | 331 | enum { |
| 308 | CEPH_OSD_FLAG_ACK = 1, /* want (or is) "ack" ack */ | 332 | CEPH_OSD_FLAG_ACK = 0x0001, /* want (or is) "ack" ack */ |
| 309 | CEPH_OSD_FLAG_ONNVRAM = 2, /* want (or is) "onnvram" ack */ | 333 | CEPH_OSD_FLAG_ONNVRAM = 0x0002, /* want (or is) "onnvram" ack */ |
| 310 | CEPH_OSD_FLAG_ONDISK = 4, /* want (or is) "ondisk" ack */ | 334 | CEPH_OSD_FLAG_ONDISK = 0x0004, /* want (or is) "ondisk" ack */ |
| 311 | CEPH_OSD_FLAG_RETRY = 8, /* resend attempt */ | 335 | CEPH_OSD_FLAG_RETRY = 0x0008, /* resend attempt */ |
| 312 | CEPH_OSD_FLAG_READ = 16, /* op may read */ | 336 | CEPH_OSD_FLAG_READ = 0x0010, /* op may read */ |
| 313 | CEPH_OSD_FLAG_WRITE = 32, /* op may write */ | 337 | CEPH_OSD_FLAG_WRITE = 0x0020, /* op may write */ |
| 314 | CEPH_OSD_FLAG_ORDERSNAP = 64, /* EOLDSNAP if snapc is out of order */ | 338 | CEPH_OSD_FLAG_ORDERSNAP = 0x0040, /* EOLDSNAP if snapc is out of order */ |
| 315 | CEPH_OSD_FLAG_PEERSTAT = 128, /* msg includes osd_peer_stat */ | 339 | CEPH_OSD_FLAG_PEERSTAT_OLD = 0x0080, /* DEPRECATED msg includes osd_peer_stat */ |
| 316 | CEPH_OSD_FLAG_BALANCE_READS = 256, | 340 | CEPH_OSD_FLAG_BALANCE_READS = 0x0100, |
| 317 | CEPH_OSD_FLAG_PARALLELEXEC = 512, /* execute op in parallel */ | 341 | CEPH_OSD_FLAG_PARALLELEXEC = 0x0200, /* execute op in parallel */ |
| 318 | CEPH_OSD_FLAG_PGOP = 1024, /* pg op, no object */ | 342 | CEPH_OSD_FLAG_PGOP = 0x0400, /* pg op, no object */ |
| 319 | CEPH_OSD_FLAG_EXEC = 2048, /* op may exec */ | 343 | CEPH_OSD_FLAG_EXEC = 0x0800, /* op may exec */ |
| 320 | CEPH_OSD_FLAG_EXEC_PUBLIC = 4096, /* op may exec (public) */ | 344 | CEPH_OSD_FLAG_EXEC_PUBLIC = 0x1000, /* DEPRECATED op may exec (public) */ |
| 345 | CEPH_OSD_FLAG_LOCALIZE_READS = 0x2000, /* read from nearby replica, if any */ | ||
| 346 | CEPH_OSD_FLAG_RWORDERED = 0x4000, /* order wrt concurrent reads */ | ||
| 321 | }; | 347 | }; |
| 322 | 348 | ||
| 323 | enum { | 349 | enum { |
| 324 | CEPH_OSD_OP_FLAG_EXCL = 1, /* EXCL object create */ | 350 | CEPH_OSD_OP_FLAG_EXCL = 1, /* EXCL object create */ |
| 351 | CEPH_OSD_OP_FLAG_FAILOK = 2, /* continue despite failure */ | ||
| 325 | }; | 352 | }; |
| 326 | 353 | ||
| 327 | #define EOLDSNAPC ERESTART /* ORDERSNAP flag set; writer has old snapc*/ | 354 | #define EOLDSNAPC ERESTART /* ORDERSNAP flag set; writer has old snapc*/ |
| @@ -381,48 +408,13 @@ struct ceph_osd_op { | |||
| 381 | __le64 ver; | 408 | __le64 ver; |
| 382 | __u8 flag; /* 0 = unwatch, 1 = watch */ | 409 | __u8 flag; /* 0 = unwatch, 1 = watch */ |
| 383 | } __attribute__ ((packed)) watch; | 410 | } __attribute__ ((packed)) watch; |
| 384 | }; | 411 | struct { |
| 412 | __le64 offset, length; | ||
| 413 | __le64 src_offset; | ||
| 414 | } __attribute__ ((packed)) clonerange; | ||
| 415 | }; | ||
| 385 | __le32 payload_len; | 416 | __le32 payload_len; |
| 386 | } __attribute__ ((packed)); | 417 | } __attribute__ ((packed)); |
| 387 | 418 | ||
| 388 | /* | ||
| 389 | * osd request message header. each request may include multiple | ||
| 390 | * ceph_osd_op object operations. | ||
| 391 | */ | ||
| 392 | struct ceph_osd_request_head { | ||
| 393 | __le32 client_inc; /* client incarnation */ | ||
| 394 | struct ceph_object_layout layout; /* pgid */ | ||
| 395 | __le32 osdmap_epoch; /* client's osdmap epoch */ | ||
| 396 | |||
| 397 | __le32 flags; | ||
| 398 | |||
| 399 | struct ceph_timespec mtime; /* for mutations only */ | ||
| 400 | struct ceph_eversion reassert_version; /* if we are replaying op */ | ||
| 401 | |||
| 402 | __le32 object_len; /* length of object name */ | ||
| 403 | |||
| 404 | __le64 snapid; /* snapid to read */ | ||
| 405 | __le64 snap_seq; /* writer's snap context */ | ||
| 406 | __le32 num_snaps; | ||
| 407 | |||
| 408 | __le16 num_ops; | ||
| 409 | struct ceph_osd_op ops[]; /* followed by ops[], obj, ticket, snaps */ | ||
| 410 | } __attribute__ ((packed)); | ||
| 411 | |||
| 412 | struct ceph_osd_reply_head { | ||
| 413 | __le32 client_inc; /* client incarnation */ | ||
| 414 | __le32 flags; | ||
| 415 | struct ceph_object_layout layout; | ||
| 416 | __le32 osdmap_epoch; | ||
| 417 | struct ceph_eversion reassert_version; /* for replaying uncommitted */ | ||
| 418 | |||
| 419 | __le32 result; /* result code */ | ||
| 420 | |||
| 421 | __le32 object_len; /* length of object name */ | ||
| 422 | __le32 num_ops; | ||
| 423 | struct ceph_osd_op ops[0]; /* ops[], object */ | ||
| 424 | } __attribute__ ((packed)); | ||
| 425 | |||
| 426 | |||
| 427 | 419 | ||
| 428 | #endif | 420 | #endif |
diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h index 8031d6eef102..5b8721efa948 100644 --- a/include/linux/coda_psdev.h +++ b/include/linux/coda_psdev.h | |||
| @@ -34,7 +34,7 @@ int venus_lookup(struct super_block *sb, struct CodaFid *fid, | |||
| 34 | const char *name, int length, int *type, | 34 | const char *name, int length, int *type, |
| 35 | struct CodaFid *resfid); | 35 | struct CodaFid *resfid); |
| 36 | int venus_close(struct super_block *sb, struct CodaFid *fid, int flags, | 36 | int venus_close(struct super_block *sb, struct CodaFid *fid, int flags, |
| 37 | vuid_t uid); | 37 | kuid_t uid); |
| 38 | int venus_open(struct super_block *sb, struct CodaFid *fid, int flags, | 38 | int venus_open(struct super_block *sb, struct CodaFid *fid, int flags, |
| 39 | struct file **f); | 39 | struct file **f); |
| 40 | int venus_mkdir(struct super_block *sb, struct CodaFid *dirfid, | 40 | int venus_mkdir(struct super_block *sb, struct CodaFid *dirfid, |
diff --git a/include/linux/compaction.h b/include/linux/compaction.h index cc7bddeaf553..091d72e70d8a 100644 --- a/include/linux/compaction.h +++ b/include/linux/compaction.h | |||
| @@ -23,7 +23,7 @@ extern int fragmentation_index(struct zone *zone, unsigned int order); | |||
| 23 | extern unsigned long try_to_compact_pages(struct zonelist *zonelist, | 23 | extern unsigned long try_to_compact_pages(struct zonelist *zonelist, |
| 24 | int order, gfp_t gfp_mask, nodemask_t *mask, | 24 | int order, gfp_t gfp_mask, nodemask_t *mask, |
| 25 | bool sync, bool *contended); | 25 | bool sync, bool *contended); |
| 26 | extern int compact_pgdat(pg_data_t *pgdat, int order); | 26 | extern void compact_pgdat(pg_data_t *pgdat, int order); |
| 27 | extern void reset_isolation_suitable(pg_data_t *pgdat); | 27 | extern void reset_isolation_suitable(pg_data_t *pgdat); |
| 28 | extern unsigned long compaction_suitable(struct zone *zone, int order); | 28 | extern unsigned long compaction_suitable(struct zone *zone, int order); |
| 29 | 29 | ||
| @@ -80,9 +80,8 @@ static inline unsigned long try_to_compact_pages(struct zonelist *zonelist, | |||
| 80 | return COMPACT_CONTINUE; | 80 | return COMPACT_CONTINUE; |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | static inline int compact_pgdat(pg_data_t *pgdat, int order) | 83 | static inline void compact_pgdat(pg_data_t *pgdat, int order) |
| 84 | { | 84 | { |
| 85 | return COMPACT_CONTINUE; | ||
| 86 | } | 85 | } |
| 87 | 86 | ||
| 88 | static inline void reset_isolation_suitable(pg_data_t *pgdat) | 87 | static inline void reset_isolation_suitable(pg_data_t *pgdat) |
diff --git a/include/linux/compat.h b/include/linux/compat.h index dec7e2d18875..76a87fb57ac2 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
| @@ -68,7 +68,6 @@ | |||
| 68 | #ifndef compat_user_stack_pointer | 68 | #ifndef compat_user_stack_pointer |
| 69 | #define compat_user_stack_pointer() current_user_stack_pointer() | 69 | #define compat_user_stack_pointer() current_user_stack_pointer() |
| 70 | #endif | 70 | #endif |
| 71 | #ifdef CONFIG_GENERIC_SIGALTSTACK | ||
| 72 | #ifndef compat_sigaltstack /* we'll need that for MIPS */ | 71 | #ifndef compat_sigaltstack /* we'll need that for MIPS */ |
| 73 | typedef struct compat_sigaltstack { | 72 | typedef struct compat_sigaltstack { |
| 74 | compat_uptr_t ss_sp; | 73 | compat_uptr_t ss_sp; |
| @@ -76,7 +75,6 @@ typedef struct compat_sigaltstack { | |||
| 76 | compat_size_t ss_size; | 75 | compat_size_t ss_size; |
| 77 | } compat_stack_t; | 76 | } compat_stack_t; |
| 78 | #endif | 77 | #endif |
| 79 | #endif | ||
| 80 | 78 | ||
| 81 | #define compat_jiffies_to_clock_t(x) \ | 79 | #define compat_jiffies_to_clock_t(x) \ |
| 82 | (((unsigned long)(x) * COMPAT_USER_HZ) / HZ) | 80 | (((unsigned long)(x) * COMPAT_USER_HZ) / HZ) |
| @@ -142,6 +140,20 @@ typedef struct { | |||
| 142 | compat_sigset_word sig[_COMPAT_NSIG_WORDS]; | 140 | compat_sigset_word sig[_COMPAT_NSIG_WORDS]; |
| 143 | } compat_sigset_t; | 141 | } compat_sigset_t; |
| 144 | 142 | ||
| 143 | struct compat_sigaction { | ||
| 144 | #ifndef __ARCH_HAS_ODD_SIGACTION | ||
| 145 | compat_uptr_t sa_handler; | ||
| 146 | compat_ulong_t sa_flags; | ||
| 147 | #else | ||
| 148 | compat_ulong_t sa_flags; | ||
| 149 | compat_uptr_t sa_handler; | ||
| 150 | #endif | ||
| 151 | #ifdef __ARCH_HAS_SA_RESTORER | ||
| 152 | compat_uptr_t sa_restorer; | ||
| 153 | #endif | ||
| 154 | compat_sigset_t sa_mask __packed; | ||
| 155 | }; | ||
| 156 | |||
| 145 | /* | 157 | /* |
| 146 | * These functions operate strictly on struct compat_time* | 158 | * These functions operate strictly on struct compat_time* |
| 147 | */ | 159 | */ |
| @@ -283,6 +295,15 @@ struct compat_robust_list_head { | |||
| 283 | compat_uptr_t list_op_pending; | 295 | compat_uptr_t list_op_pending; |
| 284 | }; | 296 | }; |
| 285 | 297 | ||
| 298 | #ifdef CONFIG_COMPAT_OLD_SIGACTION | ||
| 299 | struct compat_old_sigaction { | ||
| 300 | compat_uptr_t sa_handler; | ||
| 301 | compat_old_sigset_t sa_mask; | ||
| 302 | compat_ulong_t sa_flags; | ||
| 303 | compat_uptr_t sa_restorer; | ||
| 304 | }; | ||
| 305 | #endif | ||
| 306 | |||
| 286 | struct compat_statfs; | 307 | struct compat_statfs; |
| 287 | struct compat_statfs64; | 308 | struct compat_statfs64; |
| 288 | struct compat_old_linux_dirent; | 309 | struct compat_old_linux_dirent; |
| @@ -338,6 +359,7 @@ asmlinkage ssize_t compat_sys_preadv(unsigned long fd, | |||
| 338 | asmlinkage ssize_t compat_sys_pwritev(unsigned long fd, | 359 | asmlinkage ssize_t compat_sys_pwritev(unsigned long fd, |
| 339 | const struct compat_iovec __user *vec, | 360 | const struct compat_iovec __user *vec, |
| 340 | unsigned long vlen, u32 pos_low, u32 pos_high); | 361 | unsigned long vlen, u32 pos_low, u32 pos_high); |
| 362 | asmlinkage long comat_sys_lseek(unsigned int, compat_off_t, unsigned int); | ||
| 341 | 363 | ||
| 342 | asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv, | 364 | asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv, |
| 343 | const compat_uptr_t __user *envp); | 365 | const compat_uptr_t __user *envp); |
| @@ -367,6 +389,11 @@ int get_compat_sigevent(struct sigevent *event, | |||
| 367 | const struct compat_sigevent __user *u_event); | 389 | const struct compat_sigevent __user *u_event); |
| 368 | long compat_sys_rt_tgsigqueueinfo(compat_pid_t tgid, compat_pid_t pid, int sig, | 390 | long compat_sys_rt_tgsigqueueinfo(compat_pid_t tgid, compat_pid_t pid, int sig, |
| 369 | struct compat_siginfo __user *uinfo); | 391 | struct compat_siginfo __user *uinfo); |
| 392 | #ifdef CONFIG_COMPAT_OLD_SIGACTION | ||
| 393 | asmlinkage long compat_sys_sigaction(int sig, | ||
| 394 | const struct compat_old_sigaction __user *act, | ||
| 395 | struct compat_old_sigaction __user *oact); | ||
| 396 | #endif | ||
| 370 | 397 | ||
| 371 | static inline int compat_timeval_compare(struct compat_timeval *lhs, | 398 | static inline int compat_timeval_compare(struct compat_timeval *lhs, |
| 372 | struct compat_timeval *rhs) | 399 | struct compat_timeval *rhs) |
| @@ -401,7 +428,8 @@ asmlinkage long compat_sys_settimeofday(struct compat_timeval __user *tv, | |||
| 401 | asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); | 428 | asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); |
| 402 | 429 | ||
| 403 | extern int compat_printk(const char *fmt, ...); | 430 | extern int compat_printk(const char *fmt, ...); |
| 404 | extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat); | 431 | extern void sigset_from_compat(sigset_t *set, const compat_sigset_t *compat); |
| 432 | extern void sigset_to_compat(compat_sigset_t *compat, const sigset_t *set); | ||
| 405 | 433 | ||
| 406 | asmlinkage long compat_sys_migrate_pages(compat_pid_t pid, | 434 | asmlinkage long compat_sys_migrate_pages(compat_pid_t pid, |
| 407 | compat_ulong_t maxnode, const compat_ulong_t __user *old_nodes, | 435 | compat_ulong_t maxnode, const compat_ulong_t __user *old_nodes, |
| @@ -503,11 +531,13 @@ asmlinkage long compat_sys_vmsplice(int fd, const struct compat_iovec __user *, | |||
| 503 | unsigned int nr_segs, unsigned int flags); | 531 | unsigned int nr_segs, unsigned int flags); |
| 504 | asmlinkage long compat_sys_open(const char __user *filename, int flags, | 532 | asmlinkage long compat_sys_open(const char __user *filename, int flags, |
| 505 | umode_t mode); | 533 | umode_t mode); |
| 506 | asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, | 534 | asmlinkage long compat_sys_openat(int dfd, const char __user *filename, |
| 507 | int flags, umode_t mode); | 535 | int flags, umode_t mode); |
| 508 | asmlinkage long compat_sys_open_by_handle_at(int mountdirfd, | 536 | asmlinkage long compat_sys_open_by_handle_at(int mountdirfd, |
| 509 | struct file_handle __user *handle, | 537 | struct file_handle __user *handle, |
| 510 | int flags); | 538 | int flags); |
| 539 | asmlinkage long compat_sys_truncate(const char __user *, compat_off_t); | ||
| 540 | asmlinkage long compat_sys_ftruncate(unsigned int, compat_ulong_t); | ||
| 511 | asmlinkage long compat_sys_pselect6(int n, compat_ulong_t __user *inp, | 541 | asmlinkage long compat_sys_pselect6(int n, compat_ulong_t __user *inp, |
| 512 | compat_ulong_t __user *outp, | 542 | compat_ulong_t __user *outp, |
| 513 | compat_ulong_t __user *exp, | 543 | compat_ulong_t __user *exp, |
| @@ -592,6 +622,19 @@ asmlinkage long compat_sys_rt_sigtimedwait(compat_sigset_t __user *uthese, | |||
| 592 | struct compat_timespec __user *uts, compat_size_t sigsetsize); | 622 | struct compat_timespec __user *uts, compat_size_t sigsetsize); |
| 593 | asmlinkage long compat_sys_rt_sigsuspend(compat_sigset_t __user *unewset, | 623 | asmlinkage long compat_sys_rt_sigsuspend(compat_sigset_t __user *unewset, |
| 594 | compat_size_t sigsetsize); | 624 | compat_size_t sigsetsize); |
| 625 | asmlinkage long compat_sys_rt_sigprocmask(int how, compat_sigset_t __user *set, | ||
| 626 | compat_sigset_t __user *oset, | ||
| 627 | compat_size_t sigsetsize); | ||
| 628 | asmlinkage long compat_sys_rt_sigpending(compat_sigset_t __user *uset, | ||
| 629 | compat_size_t sigsetsize); | ||
| 630 | #ifndef CONFIG_ODD_RT_SIGACTION | ||
| 631 | asmlinkage long compat_sys_rt_sigaction(int, | ||
| 632 | const struct compat_sigaction __user *, | ||
| 633 | struct compat_sigaction __user *, | ||
| 634 | compat_size_t); | ||
| 635 | #endif | ||
| 636 | asmlinkage long compat_sys_rt_sigqueueinfo(compat_pid_t pid, int sig, | ||
| 637 | struct compat_siginfo __user *uinfo); | ||
| 595 | asmlinkage long compat_sys_sysinfo(struct compat_sysinfo __user *info); | 638 | asmlinkage long compat_sys_sysinfo(struct compat_sysinfo __user *info); |
| 596 | asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, | 639 | asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, |
| 597 | unsigned long arg); | 640 | unsigned long arg); |
| @@ -642,13 +685,11 @@ asmlinkage ssize_t compat_sys_process_vm_writev(compat_pid_t pid, | |||
| 642 | 685 | ||
| 643 | asmlinkage long compat_sys_sendfile(int out_fd, int in_fd, | 686 | asmlinkage long compat_sys_sendfile(int out_fd, int in_fd, |
| 644 | compat_off_t __user *offset, compat_size_t count); | 687 | compat_off_t __user *offset, compat_size_t count); |
| 645 | #ifdef CONFIG_GENERIC_SIGALTSTACK | ||
| 646 | asmlinkage long compat_sys_sigaltstack(const compat_stack_t __user *uss_ptr, | 688 | asmlinkage long compat_sys_sigaltstack(const compat_stack_t __user *uss_ptr, |
| 647 | compat_stack_t __user *uoss_ptr); | 689 | compat_stack_t __user *uoss_ptr); |
| 648 | 690 | ||
| 649 | int compat_restore_altstack(const compat_stack_t __user *uss); | 691 | int compat_restore_altstack(const compat_stack_t __user *uss); |
| 650 | int __compat_save_altstack(compat_stack_t __user *, unsigned long); | 692 | int __compat_save_altstack(compat_stack_t __user *, unsigned long); |
| 651 | #endif | ||
| 652 | 693 | ||
| 653 | asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid, | 694 | asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid, |
| 654 | struct compat_timespec __user *interval); | 695 | struct compat_timespec __user *interval); |
diff --git a/include/linux/completion.h b/include/linux/completion.h index 51494e6b5548..33f0280fd533 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h | |||
| @@ -77,10 +77,13 @@ static inline void init_completion(struct completion *x) | |||
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | extern void wait_for_completion(struct completion *); | 79 | extern void wait_for_completion(struct completion *); |
| 80 | extern void wait_for_completion_io(struct completion *); | ||
| 80 | extern int wait_for_completion_interruptible(struct completion *x); | 81 | extern int wait_for_completion_interruptible(struct completion *x); |
| 81 | extern int wait_for_completion_killable(struct completion *x); | 82 | extern int wait_for_completion_killable(struct completion *x); |
| 82 | extern unsigned long wait_for_completion_timeout(struct completion *x, | 83 | extern unsigned long wait_for_completion_timeout(struct completion *x, |
| 83 | unsigned long timeout); | 84 | unsigned long timeout); |
| 85 | extern unsigned long wait_for_completion_io_timeout(struct completion *x, | ||
| 86 | unsigned long timeout); | ||
| 84 | extern long wait_for_completion_interruptible_timeout( | 87 | extern long wait_for_completion_interruptible_timeout( |
| 85 | struct completion *x, unsigned long timeout); | 88 | struct completion *x, unsigned long timeout); |
| 86 | extern long wait_for_completion_killable_timeout( | 89 | extern long wait_for_completion_killable_timeout( |
diff --git a/include/linux/console.h b/include/linux/console.h index 3b709da1786e..29680a8cda99 100644 --- a/include/linux/console.h +++ b/include/linux/console.h | |||
| @@ -77,7 +77,9 @@ extern const struct consw prom_con; /* SPARC PROM console */ | |||
| 77 | int con_is_bound(const struct consw *csw); | 77 | int con_is_bound(const struct consw *csw); |
| 78 | int register_con_driver(const struct consw *csw, int first, int last); | 78 | int register_con_driver(const struct consw *csw, int first, int last); |
| 79 | int unregister_con_driver(const struct consw *csw); | 79 | int unregister_con_driver(const struct consw *csw); |
| 80 | int do_unregister_con_driver(const struct consw *csw); | ||
| 80 | int take_over_console(const struct consw *sw, int first, int last, int deflt); | 81 | int take_over_console(const struct consw *sw, int first, int last, int deflt); |
| 82 | int do_take_over_console(const struct consw *sw, int first, int last, int deflt); | ||
| 81 | void give_up_console(const struct consw *sw); | 83 | void give_up_console(const struct consw *sw); |
| 82 | #ifdef CONFIG_HW_CONSOLE | 84 | #ifdef CONFIG_HW_CONSOLE |
| 83 | int con_debug_enter(struct vc_data *vc); | 85 | int con_debug_enter(struct vc_data *vc); |
diff --git a/include/linux/crush/crush.h b/include/linux/crush/crush.h index 25baa287cff7..6a1101f24cfb 100644 --- a/include/linux/crush/crush.h +++ b/include/linux/crush/crush.h | |||
| @@ -162,6 +162,8 @@ struct crush_map { | |||
| 162 | __u32 choose_local_fallback_tries; | 162 | __u32 choose_local_fallback_tries; |
| 163 | /* choose attempts before giving up */ | 163 | /* choose attempts before giving up */ |
| 164 | __u32 choose_total_tries; | 164 | __u32 choose_total_tries; |
| 165 | /* attempt chooseleaf inner descent once; on failure retry outer descent */ | ||
| 166 | __u32 chooseleaf_descend_once; | ||
| 165 | }; | 167 | }; |
| 166 | 168 | ||
| 167 | 169 | ||
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index c1754b59ddd3..1a6bb81f0fe5 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
| @@ -145,6 +145,7 @@ enum dentry_d_lock_class | |||
| 145 | 145 | ||
| 146 | struct dentry_operations { | 146 | struct dentry_operations { |
| 147 | int (*d_revalidate)(struct dentry *, unsigned int); | 147 | int (*d_revalidate)(struct dentry *, unsigned int); |
| 148 | int (*d_weak_revalidate)(struct dentry *, unsigned int); | ||
| 148 | int (*d_hash)(const struct dentry *, const struct inode *, | 149 | int (*d_hash)(const struct dentry *, const struct inode *, |
| 149 | struct qstr *); | 150 | struct qstr *); |
| 150 | int (*d_compare)(const struct dentry *, const struct inode *, | 151 | int (*d_compare)(const struct dentry *, const struct inode *, |
| @@ -192,6 +193,8 @@ struct dentry_operations { | |||
| 192 | #define DCACHE_GENOCIDE 0x0200 | 193 | #define DCACHE_GENOCIDE 0x0200 |
| 193 | #define DCACHE_SHRINK_LIST 0x0400 | 194 | #define DCACHE_SHRINK_LIST 0x0400 |
| 194 | 195 | ||
| 196 | #define DCACHE_OP_WEAK_REVALIDATE 0x0800 | ||
| 197 | |||
| 195 | #define DCACHE_NFSFS_RENAMED 0x1000 | 198 | #define DCACHE_NFSFS_RENAMED 0x1000 |
| 196 | /* 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 |
| 197 | * dput() */ | 200 | * dput() */ |
| @@ -293,9 +296,9 @@ extern void d_move(struct dentry *, struct dentry *); | |||
| 293 | extern struct dentry *d_ancestor(struct dentry *, struct dentry *); | 296 | extern struct dentry *d_ancestor(struct dentry *, struct dentry *); |
| 294 | 297 | ||
| 295 | /* appendix may either be NULL or be used for transname suffixes */ | 298 | /* appendix may either be NULL or be used for transname suffixes */ |
| 296 | extern struct dentry *d_lookup(struct dentry *, struct qstr *); | 299 | extern struct dentry *d_lookup(const struct dentry *, const struct qstr *); |
| 297 | extern struct dentry *d_hash_and_lookup(struct dentry *, struct qstr *); | 300 | extern struct dentry *d_hash_and_lookup(struct dentry *, struct qstr *); |
| 298 | extern struct dentry *__d_lookup(struct dentry *, struct qstr *); | 301 | extern struct dentry *__d_lookup(const struct dentry *, const struct qstr *); |
| 299 | extern struct dentry *__d_lookup_rcu(const struct dentry *parent, | 302 | extern struct dentry *__d_lookup_rcu(const struct dentry *parent, |
| 300 | const struct qstr *name, | 303 | const struct qstr *name, |
| 301 | unsigned *seq, struct inode *inode); | 304 | unsigned *seq, struct inode *inode); |
| @@ -333,7 +336,6 @@ extern char *dynamic_dname(struct dentry *, char *, int, const char *, ...); | |||
| 333 | extern char *__d_path(const struct path *, const struct path *, char *, int); | 336 | extern char *__d_path(const struct path *, const struct path *, char *, int); |
| 334 | extern char *d_absolute_path(const struct path *, char *, int); | 337 | extern char *d_absolute_path(const struct path *, char *, int); |
| 335 | extern char *d_path(const struct path *, char *, int); | 338 | extern char *d_path(const struct path *, char *, int); |
| 336 | extern char *d_path_with_unreachable(const struct path *, char *, int); | ||
| 337 | extern char *dentry_path_raw(struct dentry *, char *, int); | 339 | extern char *dentry_path_raw(struct dentry *, char *, int); |
| 338 | extern char *dentry_path(struct dentry *, char *, int); | 340 | extern char *dentry_path(struct dentry *, char *, int); |
| 339 | 341 | ||
diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h index 3bd46f766751..a975de1ff59f 100644 --- a/include/linux/debug_locks.h +++ b/include/linux/debug_locks.h | |||
| @@ -51,7 +51,7 @@ struct task_struct; | |||
| 51 | extern void debug_show_all_locks(void); | 51 | extern void debug_show_all_locks(void); |
| 52 | extern void debug_show_held_locks(struct task_struct *task); | 52 | extern void debug_show_held_locks(struct task_struct *task); |
| 53 | extern void debug_check_no_locks_freed(const void *from, unsigned long len); | 53 | extern void debug_check_no_locks_freed(const void *from, unsigned long len); |
| 54 | extern void debug_check_no_locks_held(struct task_struct *task); | 54 | extern void debug_check_no_locks_held(void); |
| 55 | #else | 55 | #else |
| 56 | static inline void debug_show_all_locks(void) | 56 | static inline void debug_show_all_locks(void) |
| 57 | { | 57 | { |
| @@ -67,7 +67,7 @@ debug_check_no_locks_freed(const void *from, unsigned long len) | |||
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | static inline void | 69 | static inline void |
| 70 | debug_check_no_locks_held(struct task_struct *task) | 70 | debug_check_no_locks_held(void) |
| 71 | { | 71 | { |
| 72 | } | 72 | } |
| 73 | #endif | 73 | #endif |
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index bf6afa2fc432..1e483fa7afb4 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
| @@ -68,8 +68,8 @@ typedef void (*dm_postsuspend_fn) (struct dm_target *ti); | |||
| 68 | typedef int (*dm_preresume_fn) (struct dm_target *ti); | 68 | typedef int (*dm_preresume_fn) (struct dm_target *ti); |
| 69 | typedef void (*dm_resume_fn) (struct dm_target *ti); | 69 | typedef void (*dm_resume_fn) (struct dm_target *ti); |
| 70 | 70 | ||
| 71 | typedef int (*dm_status_fn) (struct dm_target *ti, status_type_t status_type, | 71 | typedef void (*dm_status_fn) (struct dm_target *ti, status_type_t status_type, |
| 72 | unsigned status_flags, char *result, unsigned maxlen); | 72 | unsigned status_flags, char *result, unsigned maxlen); |
| 73 | 73 | ||
| 74 | typedef int (*dm_message_fn) (struct dm_target *ti, unsigned argc, char **argv); | 74 | typedef int (*dm_message_fn) (struct dm_target *ti, unsigned argc, char **argv); |
| 75 | 75 | ||
| @@ -175,6 +175,14 @@ struct target_type { | |||
| 175 | #define DM_TARGET_IMMUTABLE 0x00000004 | 175 | #define DM_TARGET_IMMUTABLE 0x00000004 |
| 176 | #define dm_target_is_immutable(type) ((type)->features & DM_TARGET_IMMUTABLE) | 176 | #define dm_target_is_immutable(type) ((type)->features & DM_TARGET_IMMUTABLE) |
| 177 | 177 | ||
| 178 | /* | ||
| 179 | * Some targets need to be sent the same WRITE bio severals times so | ||
| 180 | * that they can send copies of it to different devices. This function | ||
| 181 | * examines any supplied bio and returns the number of copies of it the | ||
| 182 | * target requires. | ||
| 183 | */ | ||
| 184 | typedef unsigned (*dm_num_write_bios_fn) (struct dm_target *ti, struct bio *bio); | ||
| 185 | |||
| 178 | struct dm_target { | 186 | struct dm_target { |
| 179 | struct dm_table *table; | 187 | struct dm_table *table; |
| 180 | struct target_type *type; | 188 | struct target_type *type; |
| @@ -187,26 +195,26 @@ struct dm_target { | |||
| 187 | uint32_t max_io_len; | 195 | uint32_t max_io_len; |
| 188 | 196 | ||
| 189 | /* | 197 | /* |
| 190 | * A number of zero-length barrier requests that will be submitted | 198 | * A number of zero-length barrier bios that will be submitted |
| 191 | * to the target for the purpose of flushing cache. | 199 | * to the target for the purpose of flushing cache. |
| 192 | * | 200 | * |
| 193 | * The request number can be accessed with dm_bio_get_target_request_nr. | 201 | * The bio number can be accessed with dm_bio_get_target_bio_nr. |
| 194 | * It is a responsibility of the target driver to remap these requests | 202 | * It is a responsibility of the target driver to remap these bios |
| 195 | * to the real underlying devices. | 203 | * to the real underlying devices. |
| 196 | */ | 204 | */ |
| 197 | unsigned num_flush_requests; | 205 | unsigned num_flush_bios; |
| 198 | 206 | ||
| 199 | /* | 207 | /* |
| 200 | * The number of discard requests that will be submitted to the target. | 208 | * The number of discard bios that will be submitted to the target. |
| 201 | * The request number can be accessed with dm_bio_get_target_request_nr. | 209 | * The bio number can be accessed with dm_bio_get_target_bio_nr. |
| 202 | */ | 210 | */ |
| 203 | unsigned num_discard_requests; | 211 | unsigned num_discard_bios; |
| 204 | 212 | ||
| 205 | /* | 213 | /* |
| 206 | * The number of WRITE SAME requests that will be submitted to the target. | 214 | * The number of WRITE SAME bios that will be submitted to the target. |
| 207 | * The request number can be accessed with dm_bio_get_target_request_nr. | 215 | * The bio number can be accessed with dm_bio_get_target_bio_nr. |
| 208 | */ | 216 | */ |
| 209 | unsigned num_write_same_requests; | 217 | unsigned num_write_same_bios; |
| 210 | 218 | ||
| 211 | /* | 219 | /* |
| 212 | * The minimum number of extra bytes allocated in each bio for the | 220 | * The minimum number of extra bytes allocated in each bio for the |
| @@ -214,6 +222,13 @@ struct dm_target { | |||
| 214 | */ | 222 | */ |
| 215 | unsigned per_bio_data_size; | 223 | unsigned per_bio_data_size; |
| 216 | 224 | ||
| 225 | /* | ||
| 226 | * If defined, this function is called to find out how many | ||
| 227 | * duplicate bios should be sent to the target when writing | ||
| 228 | * data. | ||
| 229 | */ | ||
| 230 | dm_num_write_bios_fn num_write_bios; | ||
| 231 | |||
| 217 | /* target specific data */ | 232 | /* target specific data */ |
| 218 | void *private; | 233 | void *private; |
| 219 | 234 | ||
| @@ -233,10 +248,10 @@ struct dm_target { | |||
| 233 | bool discards_supported:1; | 248 | bool discards_supported:1; |
| 234 | 249 | ||
| 235 | /* | 250 | /* |
| 236 | * Set if the target required discard request to be split | 251 | * Set if the target required discard bios to be split |
| 237 | * on max_io_len boundary. | 252 | * on max_io_len boundary. |
| 238 | */ | 253 | */ |
| 239 | bool split_discard_requests:1; | 254 | bool split_discard_bios:1; |
| 240 | 255 | ||
| 241 | /* | 256 | /* |
| 242 | * Set if this target does not return zeroes on discarded blocks. | 257 | * Set if this target does not return zeroes on discarded blocks. |
| @@ -261,7 +276,7 @@ struct dm_target_io { | |||
| 261 | struct dm_io *io; | 276 | struct dm_io *io; |
| 262 | struct dm_target *ti; | 277 | struct dm_target *ti; |
| 263 | union map_info info; | 278 | union map_info info; |
| 264 | unsigned target_request_nr; | 279 | unsigned target_bio_nr; |
| 265 | struct bio clone; | 280 | struct bio clone; |
| 266 | }; | 281 | }; |
| 267 | 282 | ||
| @@ -275,9 +290,9 @@ static inline struct bio *dm_bio_from_per_bio_data(void *data, size_t data_size) | |||
| 275 | return (struct bio *)((char *)data + data_size + offsetof(struct dm_target_io, clone)); | 290 | return (struct bio *)((char *)data + data_size + offsetof(struct dm_target_io, clone)); |
| 276 | } | 291 | } |
| 277 | 292 | ||
| 278 | static inline unsigned dm_bio_get_target_request_nr(const struct bio *bio) | 293 | static inline unsigned dm_bio_get_target_bio_nr(const struct bio *bio) |
| 279 | { | 294 | { |
| 280 | return container_of(bio, struct dm_target_io, clone)->target_request_nr; | 295 | return container_of(bio, struct dm_target_io, clone)->target_bio_nr; |
| 281 | } | 296 | } |
| 282 | 297 | ||
| 283 | int dm_register_target(struct target_type *t); | 298 | int dm_register_target(struct target_type *t); |
diff --git a/include/linux/dm-kcopyd.h b/include/linux/dm-kcopyd.h index 47d9d376e4e7..f486d636b82e 100644 --- a/include/linux/dm-kcopyd.h +++ b/include/linux/dm-kcopyd.h | |||
| @@ -21,11 +21,34 @@ | |||
| 21 | 21 | ||
| 22 | #define DM_KCOPYD_IGNORE_ERROR 1 | 22 | #define DM_KCOPYD_IGNORE_ERROR 1 |
| 23 | 23 | ||
| 24 | struct dm_kcopyd_throttle { | ||
| 25 | unsigned throttle; | ||
| 26 | unsigned num_io_jobs; | ||
| 27 | unsigned io_period; | ||
| 28 | unsigned total_period; | ||
| 29 | unsigned last_jiffies; | ||
| 30 | }; | ||
| 31 | |||
| 32 | /* | ||
| 33 | * kcopyd clients that want to support throttling must pass an initialised | ||
| 34 | * dm_kcopyd_throttle struct into dm_kcopyd_client_create(). | ||
| 35 | * Two or more clients may share the same instance of this struct between | ||
| 36 | * them if they wish to be throttled as a group. | ||
| 37 | * | ||
| 38 | * This macro also creates a corresponding module parameter to configure | ||
| 39 | * the amount of throttling. | ||
| 40 | */ | ||
| 41 | #define DECLARE_DM_KCOPYD_THROTTLE_WITH_MODULE_PARM(name, description) \ | ||
| 42 | static struct dm_kcopyd_throttle dm_kcopyd_throttle = { 100, 0, 0, 0, 0 }; \ | ||
| 43 | module_param_named(name, dm_kcopyd_throttle.throttle, uint, 0644); \ | ||
| 44 | MODULE_PARM_DESC(name, description) | ||
| 45 | |||
| 24 | /* | 46 | /* |
| 25 | * To use kcopyd you must first create a dm_kcopyd_client object. | 47 | * To use kcopyd you must first create a dm_kcopyd_client object. |
| 48 | * throttle can be NULL if you don't want any throttling. | ||
| 26 | */ | 49 | */ |
| 27 | struct dm_kcopyd_client; | 50 | struct dm_kcopyd_client; |
| 28 | struct dm_kcopyd_client *dm_kcopyd_client_create(void); | 51 | struct dm_kcopyd_client *dm_kcopyd_client_create(struct dm_kcopyd_throttle *throttle); |
| 29 | void dm_kcopyd_client_destroy(struct dm_kcopyd_client *kc); | 52 | void dm_kcopyd_client_destroy(struct dm_kcopyd_client *kc); |
| 30 | 53 | ||
| 31 | /* | 54 | /* |
diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h index 3d754a394e92..9978b614a1aa 100644 --- a/include/linux/dma-buf.h +++ b/include/linux/dma-buf.h | |||
| @@ -119,8 +119,10 @@ struct dma_buf { | |||
| 119 | struct file *file; | 119 | struct file *file; |
| 120 | struct list_head attachments; | 120 | struct list_head attachments; |
| 121 | const struct dma_buf_ops *ops; | 121 | const struct dma_buf_ops *ops; |
| 122 | /* mutex to serialize list manipulation and attach/detach */ | 122 | /* mutex to serialize list manipulation, attach/detach and vmap/unmap */ |
| 123 | struct mutex lock; | 123 | struct mutex lock; |
| 124 | unsigned vmapping_counter; | ||
| 125 | void *vmap_ptr; | ||
| 124 | void *priv; | 126 | void *priv; |
| 125 | }; | 127 | }; |
| 126 | 128 | ||
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index d3201e438d16..91ac8da25020 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
| @@ -608,7 +608,10 @@ static inline int dmaengine_device_control(struct dma_chan *chan, | |||
| 608 | enum dma_ctrl_cmd cmd, | 608 | enum dma_ctrl_cmd cmd, |
| 609 | unsigned long arg) | 609 | unsigned long arg) |
| 610 | { | 610 | { |
| 611 | return chan->device->device_control(chan, cmd, arg); | 611 | if (chan->device->device_control) |
| 612 | return chan->device->device_control(chan, cmd, arg); | ||
| 613 | |||
| 614 | return -ENOSYS; | ||
| 612 | } | 615 | } |
| 613 | 616 | ||
| 614 | static inline int dmaengine_slave_config(struct dma_chan *chan, | 617 | static inline int dmaengine_slave_config(struct dma_chan *chan, |
| @@ -618,6 +621,11 @@ static inline int dmaengine_slave_config(struct dma_chan *chan, | |||
| 618 | (unsigned long)config); | 621 | (unsigned long)config); |
| 619 | } | 622 | } |
| 620 | 623 | ||
| 624 | static inline bool is_slave_direction(enum dma_transfer_direction direction) | ||
| 625 | { | ||
| 626 | return (direction == DMA_MEM_TO_DEV) || (direction == DMA_DEV_TO_MEM); | ||
| 627 | } | ||
| 628 | |||
| 621 | static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single( | 629 | static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single( |
| 622 | struct dma_chan *chan, dma_addr_t buf, size_t len, | 630 | struct dma_chan *chan, dma_addr_t buf, size_t len, |
| 623 | enum dma_transfer_direction dir, unsigned long flags) | 631 | enum dma_transfer_direction dir, unsigned long flags) |
| @@ -660,6 +668,13 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_cyclic( | |||
| 660 | period_len, dir, flags, NULL); | 668 | period_len, dir, flags, NULL); |
| 661 | } | 669 | } |
| 662 | 670 | ||
| 671 | static inline struct dma_async_tx_descriptor *dmaengine_prep_interleaved_dma( | ||
| 672 | struct dma_chan *chan, struct dma_interleaved_template *xt, | ||
| 673 | unsigned long flags) | ||
| 674 | { | ||
| 675 | return chan->device->device_prep_interleaved_dma(chan, xt, flags); | ||
| 676 | } | ||
| 677 | |||
| 663 | static inline int dmaengine_terminate_all(struct dma_chan *chan) | 678 | static inline int dmaengine_terminate_all(struct dma_chan *chan) |
| 664 | { | 679 | { |
| 665 | return dmaengine_device_control(chan, DMA_TERMINATE_ALL, 0); | 680 | return dmaengine_device_control(chan, DMA_TERMINATE_ALL, 0); |
| @@ -849,20 +864,6 @@ static inline bool async_tx_test_ack(struct dma_async_tx_descriptor *tx) | |||
| 849 | return (tx->flags & DMA_CTRL_ACK) == DMA_CTRL_ACK; | 864 | return (tx->flags & DMA_CTRL_ACK) == DMA_CTRL_ACK; |
| 850 | } | 865 | } |
| 851 | 866 | ||
| 852 | #define first_dma_cap(mask) __first_dma_cap(&(mask)) | ||
| 853 | static inline int __first_dma_cap(const dma_cap_mask_t *srcp) | ||
| 854 | { | ||
| 855 | return min_t(int, DMA_TX_TYPE_END, | ||
| 856 | find_first_bit(srcp->bits, DMA_TX_TYPE_END)); | ||
| 857 | } | ||
| 858 | |||
| 859 | #define next_dma_cap(n, mask) __next_dma_cap((n), &(mask)) | ||
| 860 | static inline int __next_dma_cap(int n, const dma_cap_mask_t *srcp) | ||
| 861 | { | ||
| 862 | return min_t(int, DMA_TX_TYPE_END, | ||
| 863 | find_next_bit(srcp->bits, DMA_TX_TYPE_END, n+1)); | ||
| 864 | } | ||
| 865 | |||
| 866 | #define dma_cap_set(tx, mask) __dma_cap_set((tx), &(mask)) | 867 | #define dma_cap_set(tx, mask) __dma_cap_set((tx), &(mask)) |
| 867 | static inline void | 868 | static inline void |
| 868 | __dma_cap_set(enum dma_transaction_type tx_type, dma_cap_mask_t *dstp) | 869 | __dma_cap_set(enum dma_transaction_type tx_type, dma_cap_mask_t *dstp) |
| @@ -891,9 +892,7 @@ __dma_has_cap(enum dma_transaction_type tx_type, dma_cap_mask_t *srcp) | |||
| 891 | } | 892 | } |
| 892 | 893 | ||
| 893 | #define for_each_dma_cap_mask(cap, mask) \ | 894 | #define for_each_dma_cap_mask(cap, mask) \ |
| 894 | for ((cap) = first_dma_cap(mask); \ | 895 | for_each_set_bit(cap, mask.bits, DMA_TX_TYPE_END) |
| 895 | (cap) < DMA_TX_TYPE_END; \ | ||
| 896 | (cap) = next_dma_cap((cap), (mask))) | ||
| 897 | 896 | ||
| 898 | /** | 897 | /** |
| 899 | * dma_async_issue_pending - flush pending transactions to HW | 898 | * dma_async_issue_pending - flush pending transactions to HW |
| @@ -907,8 +906,6 @@ static inline void dma_async_issue_pending(struct dma_chan *chan) | |||
| 907 | chan->device->device_issue_pending(chan); | 906 | chan->device->device_issue_pending(chan); |
| 908 | } | 907 | } |
| 909 | 908 | ||
| 910 | #define dma_async_memcpy_issue_pending(chan) dma_async_issue_pending(chan) | ||
| 911 | |||
| 912 | /** | 909 | /** |
| 913 | * dma_async_is_tx_complete - poll for transaction completion | 910 | * dma_async_is_tx_complete - poll for transaction completion |
| 914 | * @chan: DMA channel | 911 | * @chan: DMA channel |
| @@ -934,16 +931,13 @@ static inline enum dma_status dma_async_is_tx_complete(struct dma_chan *chan, | |||
| 934 | return status; | 931 | return status; |
| 935 | } | 932 | } |
| 936 | 933 | ||
| 937 | #define dma_async_memcpy_complete(chan, cookie, last, used)\ | ||
| 938 | dma_async_is_tx_complete(chan, cookie, last, used) | ||
| 939 | |||
| 940 | /** | 934 | /** |
| 941 | * dma_async_is_complete - test a cookie against chan state | 935 | * dma_async_is_complete - test a cookie against chan state |
| 942 | * @cookie: transaction identifier to test status of | 936 | * @cookie: transaction identifier to test status of |
| 943 | * @last_complete: last know completed transaction | 937 | * @last_complete: last know completed transaction |
| 944 | * @last_used: last cookie value handed out | 938 | * @last_used: last cookie value handed out |
| 945 | * | 939 | * |
| 946 | * dma_async_is_complete() is used in dma_async_memcpy_complete() | 940 | * dma_async_is_complete() is used in dma_async_is_tx_complete() |
| 947 | * the test logic is separated for lightweight testing of multiple cookies | 941 | * the test logic is separated for lightweight testing of multiple cookies |
| 948 | */ | 942 | */ |
| 949 | static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie, | 943 | static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie, |
| @@ -974,6 +968,7 @@ enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie); | |||
| 974 | enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx); | 968 | enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx); |
| 975 | void dma_issue_pending_all(void); | 969 | void dma_issue_pending_all(void); |
| 976 | struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, dma_filter_fn fn, void *fn_param); | 970 | struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, dma_filter_fn fn, void *fn_param); |
| 971 | struct dma_chan *dma_request_slave_channel(struct device *dev, char *name); | ||
| 977 | void dma_release_channel(struct dma_chan *chan); | 972 | void dma_release_channel(struct dma_chan *chan); |
| 978 | #else | 973 | #else |
| 979 | static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx) | 974 | static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx) |
| @@ -988,6 +983,11 @@ static inline struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, | |||
| 988 | { | 983 | { |
| 989 | return NULL; | 984 | return NULL; |
| 990 | } | 985 | } |
| 986 | static inline struct dma_chan *dma_request_slave_channel(struct device *dev, | ||
| 987 | char *name) | ||
| 988 | { | ||
| 989 | return NULL; | ||
| 990 | } | ||
| 991 | static inline void dma_release_channel(struct dma_chan *chan) | 991 | static inline void dma_release_channel(struct dma_chan *chan) |
| 992 | { | 992 | { |
| 993 | } | 993 | } |
| @@ -1001,6 +1001,22 @@ void dma_run_dependencies(struct dma_async_tx_descriptor *tx); | |||
| 1001 | struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type); | 1001 | struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type); |
| 1002 | struct dma_chan *net_dma_find_channel(void); | 1002 | struct dma_chan *net_dma_find_channel(void); |
| 1003 | #define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y) | 1003 | #define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y) |
| 1004 | #define dma_request_slave_channel_compat(mask, x, y, dev, name) \ | ||
| 1005 | __dma_request_slave_channel_compat(&(mask), x, y, dev, name) | ||
| 1006 | |||
| 1007 | static inline struct dma_chan | ||
| 1008 | *__dma_request_slave_channel_compat(dma_cap_mask_t *mask, dma_filter_fn fn, | ||
| 1009 | void *fn_param, struct device *dev, | ||
| 1010 | char *name) | ||
| 1011 | { | ||
| 1012 | struct dma_chan *chan; | ||
| 1013 | |||
| 1014 | chan = dma_request_slave_channel(dev, name); | ||
| 1015 | if (chan) | ||
| 1016 | return chan; | ||
| 1017 | |||
| 1018 | return __dma_request_channel(mask, fn, fn_param); | ||
| 1019 | } | ||
| 1004 | 1020 | ||
| 1005 | /* --- Helper iov-locking functions --- */ | 1021 | /* --- Helper iov-locking functions --- */ |
| 1006 | 1022 | ||
diff --git a/include/linux/dw_dmac.h b/include/linux/dw_dmac.h index e1c8c9e919ac..481ab2345d6b 100644 --- a/include/linux/dw_dmac.h +++ b/include/linux/dw_dmac.h | |||
| @@ -15,14 +15,37 @@ | |||
| 15 | #include <linux/dmaengine.h> | 15 | #include <linux/dmaengine.h> |
| 16 | 16 | ||
| 17 | /** | 17 | /** |
| 18 | * struct dw_dma_slave - Controller-specific information about a slave | ||
| 19 | * | ||
| 20 | * @dma_dev: required DMA master device. Depricated. | ||
| 21 | * @bus_id: name of this device channel, not just a device name since | ||
| 22 | * devices may have more than one channel e.g. "foo_tx" | ||
| 23 | * @cfg_hi: Platform-specific initializer for the CFG_HI register | ||
| 24 | * @cfg_lo: Platform-specific initializer for the CFG_LO register | ||
| 25 | * @src_master: src master for transfers on allocated channel. | ||
| 26 | * @dst_master: dest master for transfers on allocated channel. | ||
| 27 | */ | ||
| 28 | struct dw_dma_slave { | ||
| 29 | struct device *dma_dev; | ||
| 30 | u32 cfg_hi; | ||
| 31 | u32 cfg_lo; | ||
| 32 | u8 src_master; | ||
| 33 | u8 dst_master; | ||
| 34 | }; | ||
| 35 | |||
| 36 | /** | ||
| 18 | * struct dw_dma_platform_data - Controller configuration parameters | 37 | * struct dw_dma_platform_data - Controller configuration parameters |
| 19 | * @nr_channels: Number of channels supported by hardware (max 8) | 38 | * @nr_channels: Number of channels supported by hardware (max 8) |
| 20 | * @is_private: The device channels should be marked as private and not for | 39 | * @is_private: The device channels should be marked as private and not for |
| 21 | * by the general purpose DMA channel allocator. | 40 | * by the general purpose DMA channel allocator. |
| 41 | * @chan_allocation_order: Allocate channels starting from 0 or 7 | ||
| 42 | * @chan_priority: Set channel priority increasing from 0 to 7 or 7 to 0. | ||
| 22 | * @block_size: Maximum block size supported by the controller | 43 | * @block_size: Maximum block size supported by the controller |
| 23 | * @nr_masters: Number of AHB masters supported by the controller | 44 | * @nr_masters: Number of AHB masters supported by the controller |
| 24 | * @data_width: Maximum data width supported by hardware per AHB master | 45 | * @data_width: Maximum data width supported by hardware per AHB master |
| 25 | * (0 - 8bits, 1 - 16bits, ..., 5 - 256bits) | 46 | * (0 - 8bits, 1 - 16bits, ..., 5 - 256bits) |
| 47 | * @sd: slave specific data. Used for configuring channels | ||
| 48 | * @sd_count: count of slave data structures passed. | ||
| 26 | */ | 49 | */ |
| 27 | struct dw_dma_platform_data { | 50 | struct dw_dma_platform_data { |
| 28 | unsigned int nr_channels; | 51 | unsigned int nr_channels; |
| @@ -50,23 +73,6 @@ enum dw_dma_msize { | |||
| 50 | DW_DMA_MSIZE_256, | 73 | DW_DMA_MSIZE_256, |
| 51 | }; | 74 | }; |
| 52 | 75 | ||
| 53 | /** | ||
| 54 | * struct dw_dma_slave - Controller-specific information about a slave | ||
| 55 | * | ||
| 56 | * @dma_dev: required DMA master device | ||
| 57 | * @cfg_hi: Platform-specific initializer for the CFG_HI register | ||
| 58 | * @cfg_lo: Platform-specific initializer for the CFG_LO register | ||
| 59 | * @src_master: src master for transfers on allocated channel. | ||
| 60 | * @dst_master: dest master for transfers on allocated channel. | ||
| 61 | */ | ||
| 62 | struct dw_dma_slave { | ||
| 63 | struct device *dma_dev; | ||
| 64 | u32 cfg_hi; | ||
| 65 | u32 cfg_lo; | ||
| 66 | u8 src_master; | ||
| 67 | u8 dst_master; | ||
| 68 | }; | ||
| 69 | |||
| 70 | /* Platform-configurable bits in CFG_HI */ | 76 | /* Platform-configurable bits in CFG_HI */ |
| 71 | #define DWC_CFGH_FCMODE (1 << 0) | 77 | #define DWC_CFGH_FCMODE (1 << 0) |
| 72 | #define DWC_CFGH_FIFO_MODE (1 << 1) | 78 | #define DWC_CFGH_FIFO_MODE (1 << 1) |
diff --git a/include/linux/ecryptfs.h b/include/linux/ecryptfs.h index 2224a8c0cb64..8d5ab998a222 100644 --- a/include/linux/ecryptfs.h +++ b/include/linux/ecryptfs.h | |||
| @@ -6,9 +6,8 @@ | |||
| 6 | #define ECRYPTFS_VERSION_MINOR 0x04 | 6 | #define ECRYPTFS_VERSION_MINOR 0x04 |
| 7 | #define ECRYPTFS_SUPPORTED_FILE_VERSION 0x03 | 7 | #define ECRYPTFS_SUPPORTED_FILE_VERSION 0x03 |
| 8 | /* These flags indicate which features are supported by the kernel | 8 | /* These flags indicate which features are supported by the kernel |
| 9 | * module; userspace tools such as the mount helper read | 9 | * module; userspace tools such as the mount helper read the feature |
| 10 | * ECRYPTFS_VERSIONING_MASK from a sysfs handle in order to determine | 10 | * bits from a sysfs handle in order to determine how to behave. */ |
| 11 | * how to behave. */ | ||
| 12 | #define ECRYPTFS_VERSIONING_PASSPHRASE 0x00000001 | 11 | #define ECRYPTFS_VERSIONING_PASSPHRASE 0x00000001 |
| 13 | #define ECRYPTFS_VERSIONING_PUBKEY 0x00000002 | 12 | #define ECRYPTFS_VERSIONING_PUBKEY 0x00000002 |
| 14 | #define ECRYPTFS_VERSIONING_PLAINTEXT_PASSTHROUGH 0x00000004 | 13 | #define ECRYPTFS_VERSIONING_PLAINTEXT_PASSTHROUGH 0x00000004 |
| @@ -19,13 +18,6 @@ | |||
| 19 | #define ECRYPTFS_VERSIONING_HMAC 0x00000080 | 18 | #define ECRYPTFS_VERSIONING_HMAC 0x00000080 |
| 20 | #define ECRYPTFS_VERSIONING_FILENAME_ENCRYPTION 0x00000100 | 19 | #define ECRYPTFS_VERSIONING_FILENAME_ENCRYPTION 0x00000100 |
| 21 | #define ECRYPTFS_VERSIONING_GCM 0x00000200 | 20 | #define ECRYPTFS_VERSIONING_GCM 0x00000200 |
| 22 | #define ECRYPTFS_VERSIONING_MASK (ECRYPTFS_VERSIONING_PASSPHRASE \ | ||
| 23 | | ECRYPTFS_VERSIONING_PLAINTEXT_PASSTHROUGH \ | ||
| 24 | | ECRYPTFS_VERSIONING_PUBKEY \ | ||
| 25 | | ECRYPTFS_VERSIONING_XATTR \ | ||
| 26 | | ECRYPTFS_VERSIONING_MULTKEY \ | ||
| 27 | | ECRYPTFS_VERSIONING_DEVMISC \ | ||
| 28 | | ECRYPTFS_VERSIONING_FILENAME_ENCRYPTION) | ||
| 29 | #define ECRYPTFS_MAX_PASSWORD_LENGTH 64 | 21 | #define ECRYPTFS_MAX_PASSWORD_LENGTH 64 |
| 30 | #define ECRYPTFS_MAX_PASSPHRASE_BYTES ECRYPTFS_MAX_PASSWORD_LENGTH | 22 | #define ECRYPTFS_MAX_PASSPHRASE_BYTES ECRYPTFS_MAX_PASSWORD_LENGTH |
| 31 | #define ECRYPTFS_SALT_SIZE 8 | 23 | #define ECRYPTFS_SALT_SIZE 8 |
diff --git a/include/linux/edac.h b/include/linux/edac.h index 1b8c02b36f76..4fd4999ccb5b 100644 --- a/include/linux/edac.h +++ b/include/linux/edac.h | |||
| @@ -14,7 +14,6 @@ | |||
| 14 | 14 | ||
| 15 | #include <linux/atomic.h> | 15 | #include <linux/atomic.h> |
| 16 | #include <linux/device.h> | 16 | #include <linux/device.h> |
| 17 | #include <linux/kobject.h> | ||
| 18 | #include <linux/completion.h> | 17 | #include <linux/completion.h> |
| 19 | #include <linux/workqueue.h> | 18 | #include <linux/workqueue.h> |
| 20 | #include <linux/debugfs.h> | 19 | #include <linux/debugfs.h> |
| @@ -48,8 +47,17 @@ static inline void opstate_init(void) | |||
| 48 | return; | 47 | return; |
| 49 | } | 48 | } |
| 50 | 49 | ||
| 50 | /* Max length of a DIMM label*/ | ||
| 51 | #define EDAC_MC_LABEL_LEN 31 | 51 | #define EDAC_MC_LABEL_LEN 31 |
| 52 | #define MC_PROC_NAME_MAX_LEN 7 | 52 | |
| 53 | /* Maximum size of the location string */ | ||
| 54 | #define LOCATION_SIZE 80 | ||
| 55 | |||
| 56 | /* Defines the maximum number of labels that can be reported */ | ||
| 57 | #define EDAC_MAX_LABELS 8 | ||
| 58 | |||
| 59 | /* String used to join two or more labels */ | ||
| 60 | #define OTHER_LABEL " or " | ||
| 53 | 61 | ||
| 54 | /** | 62 | /** |
| 55 | * enum dev_type - describe the type of memory DRAM chips used at the stick | 63 | * enum dev_type - describe the type of memory DRAM chips used at the stick |
| @@ -101,8 +109,24 @@ enum hw_event_mc_err_type { | |||
| 101 | HW_EVENT_ERR_CORRECTED, | 109 | HW_EVENT_ERR_CORRECTED, |
| 102 | HW_EVENT_ERR_UNCORRECTED, | 110 | HW_EVENT_ERR_UNCORRECTED, |
| 103 | HW_EVENT_ERR_FATAL, | 111 | HW_EVENT_ERR_FATAL, |
| 112 | HW_EVENT_ERR_INFO, | ||
| 104 | }; | 113 | }; |
| 105 | 114 | ||
| 115 | static inline char *mc_event_error_type(const unsigned int err_type) | ||
| 116 | { | ||
| 117 | switch (err_type) { | ||
| 118 | case HW_EVENT_ERR_CORRECTED: | ||
| 119 | return "Corrected"; | ||
| 120 | case HW_EVENT_ERR_UNCORRECTED: | ||
| 121 | return "Uncorrected"; | ||
| 122 | case HW_EVENT_ERR_FATAL: | ||
| 123 | return "Fatal"; | ||
| 124 | default: | ||
| 125 | case HW_EVENT_ERR_INFO: | ||
| 126 | return "Info"; | ||
| 127 | } | ||
| 128 | } | ||
| 129 | |||
| 106 | /** | 130 | /** |
| 107 | * enum mem_type - memory types. For a more detailed reference, please see | 131 | * enum mem_type - memory types. For a more detailed reference, please see |
| 108 | * http://en.wikipedia.org/wiki/DRAM | 132 | * http://en.wikipedia.org/wiki/DRAM |
| @@ -376,6 +400,9 @@ enum scrub_type { | |||
| 376 | * @EDAC_MC_LAYER_CHANNEL: memory layer is named "channel" | 400 | * @EDAC_MC_LAYER_CHANNEL: memory layer is named "channel" |
| 377 | * @EDAC_MC_LAYER_SLOT: memory layer is named "slot" | 401 | * @EDAC_MC_LAYER_SLOT: memory layer is named "slot" |
| 378 | * @EDAC_MC_LAYER_CHIP_SELECT: memory layer is named "chip select" | 402 | * @EDAC_MC_LAYER_CHIP_SELECT: memory layer is named "chip select" |
| 403 | * @EDAC_MC_LAYER_ALL_MEM: memory layout is unknown. All memory is mapped | ||
| 404 | * as a single memory area. This is used when | ||
| 405 | * retrieving errors from a firmware driven driver. | ||
| 379 | * | 406 | * |
| 380 | * This enum is used by the drivers to tell edac_mc_sysfs what name should | 407 | * This enum is used by the drivers to tell edac_mc_sysfs what name should |
| 381 | * be used when describing a memory stick location. | 408 | * be used when describing a memory stick location. |
| @@ -385,6 +412,7 @@ enum edac_mc_layer_type { | |||
| 385 | EDAC_MC_LAYER_CHANNEL, | 412 | EDAC_MC_LAYER_CHANNEL, |
| 386 | EDAC_MC_LAYER_SLOT, | 413 | EDAC_MC_LAYER_SLOT, |
| 387 | EDAC_MC_LAYER_CHIP_SELECT, | 414 | EDAC_MC_LAYER_CHIP_SELECT, |
| 415 | EDAC_MC_LAYER_ALL_MEM, | ||
| 388 | }; | 416 | }; |
| 389 | 417 | ||
| 390 | /** | 418 | /** |
| @@ -551,6 +579,46 @@ struct errcount_attribute_data { | |||
| 551 | int layer0, layer1, layer2; | 579 | int layer0, layer1, layer2; |
| 552 | }; | 580 | }; |
| 553 | 581 | ||
| 582 | /** | ||
| 583 | * edac_raw_error_desc - Raw error report structure | ||
| 584 | * @grain: minimum granularity for an error report, in bytes | ||
| 585 | * @error_count: number of errors of the same type | ||
| 586 | * @top_layer: top layer of the error (layer[0]) | ||
| 587 | * @mid_layer: middle layer of the error (layer[1]) | ||
| 588 | * @low_layer: low layer of the error (layer[2]) | ||
| 589 | * @page_frame_number: page where the error happened | ||
| 590 | * @offset_in_page: page offset | ||
| 591 | * @syndrome: syndrome of the error (or 0 if unknown or if | ||
| 592 | * the syndrome is not applicable) | ||
| 593 | * @msg: error message | ||
| 594 | * @location: location of the error | ||
| 595 | * @label: label of the affected DIMM(s) | ||
| 596 | * @other_detail: other driver-specific detail about the error | ||
| 597 | * @enable_per_layer_report: if false, the error affects all layers | ||
| 598 | * (typically, a memory controller error) | ||
| 599 | */ | ||
| 600 | struct edac_raw_error_desc { | ||
| 601 | /* | ||
| 602 | * NOTE: everything before grain won't be cleaned by | ||
| 603 | * edac_raw_error_desc_clean() | ||
| 604 | */ | ||
| 605 | char location[LOCATION_SIZE]; | ||
| 606 | char label[(EDAC_MC_LABEL_LEN + 1 + sizeof(OTHER_LABEL)) * EDAC_MAX_LABELS]; | ||
| 607 | long grain; | ||
| 608 | |||
| 609 | /* the vars below and grain will be cleaned on every new error report */ | ||
| 610 | u16 error_count; | ||
| 611 | int top_layer; | ||
| 612 | int mid_layer; | ||
| 613 | int low_layer; | ||
| 614 | unsigned long page_frame_number; | ||
| 615 | unsigned long offset_in_page; | ||
| 616 | unsigned long syndrome; | ||
| 617 | const char *msg; | ||
| 618 | const char *other_detail; | ||
| 619 | bool enable_per_layer_report; | ||
| 620 | }; | ||
| 621 | |||
| 554 | /* MEMORY controller information structure | 622 | /* MEMORY controller information structure |
| 555 | */ | 623 | */ |
| 556 | struct mem_ctl_info { | 624 | struct mem_ctl_info { |
| @@ -630,7 +698,6 @@ struct mem_ctl_info { | |||
| 630 | const char *mod_ver; | 698 | const char *mod_ver; |
| 631 | const char *ctl_name; | 699 | const char *ctl_name; |
| 632 | const char *dev_name; | 700 | const char *dev_name; |
| 633 | char proc_name[MC_PROC_NAME_MAX_LEN + 1]; | ||
| 634 | void *pvt_info; | 701 | void *pvt_info; |
| 635 | unsigned long start_time; /* mci load start time (in jiffies) */ | 702 | unsigned long start_time; /* mci load start time (in jiffies) */ |
| 636 | 703 | ||
| @@ -659,6 +726,12 @@ struct mem_ctl_info { | |||
| 659 | /* work struct for this MC */ | 726 | /* work struct for this MC */ |
| 660 | struct delayed_work work; | 727 | struct delayed_work work; |
| 661 | 728 | ||
| 729 | /* | ||
| 730 | * Used to report an error - by being at the global struct | ||
| 731 | * makes the memory allocated by the EDAC core | ||
| 732 | */ | ||
| 733 | struct edac_raw_error_desc error_desc; | ||
| 734 | |||
| 662 | /* the internal state of this controller instance */ | 735 | /* the internal state of this controller instance */ |
| 663 | int op_state; | 736 | int op_state; |
| 664 | 737 | ||
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 186620631750..acd0312d46fb 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #define _LINUX_ELEVATOR_H | 2 | #define _LINUX_ELEVATOR_H |
| 3 | 3 | ||
| 4 | #include <linux/percpu.h> | 4 | #include <linux/percpu.h> |
| 5 | #include <linux/hashtable.h> | ||
| 5 | 6 | ||
| 6 | #ifdef CONFIG_BLOCK | 7 | #ifdef CONFIG_BLOCK |
| 7 | 8 | ||
| @@ -96,6 +97,8 @@ struct elevator_type | |||
| 96 | struct list_head list; | 97 | struct list_head list; |
| 97 | }; | 98 | }; |
| 98 | 99 | ||
| 100 | #define ELV_HASH_BITS 6 | ||
| 101 | |||
| 99 | /* | 102 | /* |
| 100 | * each queue has an elevator_queue associated with it | 103 | * each queue has an elevator_queue associated with it |
| 101 | */ | 104 | */ |
| @@ -105,8 +108,8 @@ struct elevator_queue | |||
| 105 | void *elevator_data; | 108 | void *elevator_data; |
| 106 | struct kobject kobj; | 109 | struct kobject kobj; |
| 107 | struct mutex sysfs_lock; | 110 | struct mutex sysfs_lock; |
| 108 | struct hlist_head *hash; | ||
| 109 | unsigned int registered:1; | 111 | unsigned int registered:1; |
| 112 | DECLARE_HASHTABLE(hash, ELV_HASH_BITS); | ||
| 110 | }; | 113 | }; |
| 111 | 114 | ||
| 112 | /* | 115 | /* |
diff --git a/include/linux/elf.h b/include/linux/elf.h index 8c9048e33463..40a3c0e01b2b 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h | |||
| @@ -10,6 +10,10 @@ | |||
| 10 | Override in asm/elf.h as needed. */ | 10 | Override in asm/elf.h as needed. */ |
| 11 | # define elf_read_implies_exec(ex, have_pt_gnu_stack) 0 | 11 | # define elf_read_implies_exec(ex, have_pt_gnu_stack) 0 |
| 12 | #endif | 12 | #endif |
| 13 | #ifndef SET_PERSONALITY | ||
| 14 | #define SET_PERSONALITY(ex) \ | ||
| 15 | set_personality(PER_LINUX | (current->personality & (~PER_MASK))) | ||
| 16 | #endif | ||
| 13 | 17 | ||
| 14 | #if ELF_CLASS == ELFCLASS32 | 18 | #if ELF_CLASS == ELFCLASS32 |
| 15 | 19 | ||
diff --git a/include/linux/eventfd.h b/include/linux/eventfd.h index 3c3ef19a625a..cf5d2af61b81 100644 --- a/include/linux/eventfd.h +++ b/include/linux/eventfd.h | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | #include <linux/wait.h> | 13 | #include <linux/wait.h> |
| 14 | 14 | ||
| 15 | /* | 15 | /* |
| 16 | * CAREFUL: Check include/asm-generic/fcntl.h when defining | 16 | * CAREFUL: Check include/uapi/asm-generic/fcntl.h when defining |
| 17 | * new flags, since they might collide with O_* ones. We want | 17 | * new flags, since they might collide with O_* ones. We want |
| 18 | * to re-use O_* flags that couldn't possibly have a meaning | 18 | * to re-use O_* flags that couldn't possibly have a meaning |
| 19 | * from eventfd, in order to leave a free define-space for | 19 | * from eventfd, in order to leave a free define-space for |
diff --git a/include/linux/fb.h b/include/linux/fb.h index c7a95714b1fe..58b98606ac26 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
| @@ -19,6 +19,8 @@ struct vm_area_struct; | |||
| 19 | struct fb_info; | 19 | struct fb_info; |
| 20 | struct device; | 20 | struct device; |
| 21 | struct file; | 21 | struct file; |
| 22 | struct videomode; | ||
| 23 | struct device_node; | ||
| 22 | 24 | ||
| 23 | /* Definitions below are used in the parsed monitor specs */ | 25 | /* Definitions below are used in the parsed monitor specs */ |
| 24 | #define FB_DPMS_ACTIVE_OFF 1 | 26 | #define FB_DPMS_ACTIVE_OFF 1 |
| @@ -714,6 +716,12 @@ extern void fb_destroy_modedb(struct fb_videomode *modedb); | |||
| 714 | extern int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb); | 716 | extern int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb); |
| 715 | extern unsigned char *fb_ddc_read(struct i2c_adapter *adapter); | 717 | extern unsigned char *fb_ddc_read(struct i2c_adapter *adapter); |
| 716 | 718 | ||
| 719 | extern int of_get_fb_videomode(struct device_node *np, | ||
| 720 | struct fb_videomode *fb, | ||
| 721 | int index); | ||
| 722 | extern int fb_videomode_from_videomode(const struct videomode *vm, | ||
| 723 | struct fb_videomode *fbmode); | ||
| 724 | |||
| 717 | /* drivers/video/modedb.c */ | 725 | /* drivers/video/modedb.c */ |
| 718 | #define VESA_MODEDB_SIZE 34 | 726 | #define VESA_MODEDB_SIZE 34 |
| 719 | extern void fb_var_to_videomode(struct fb_videomode *mode, | 727 | extern void fb_var_to_videomode(struct fb_videomode *mode, |
diff --git a/include/linux/firmware-map.h b/include/linux/firmware-map.h index 43fe52fcef0f..71d4fa721db9 100644 --- a/include/linux/firmware-map.h +++ b/include/linux/firmware-map.h | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | 25 | ||
| 26 | int firmware_map_add_early(u64 start, u64 end, const char *type); | 26 | int firmware_map_add_early(u64 start, u64 end, const char *type); |
| 27 | int firmware_map_add_hotplug(u64 start, u64 end, const char *type); | 27 | int firmware_map_add_hotplug(u64 start, u64 end, const char *type); |
| 28 | int firmware_map_remove(u64 start, u64 end, const char *type); | ||
| 28 | 29 | ||
| 29 | #else /* CONFIG_FIRMWARE_MEMMAP */ | 30 | #else /* CONFIG_FIRMWARE_MEMMAP */ |
| 30 | 31 | ||
| @@ -38,6 +39,11 @@ static inline int firmware_map_add_hotplug(u64 start, u64 end, const char *type) | |||
| 38 | return 0; | 39 | return 0; |
| 39 | } | 40 | } |
| 40 | 41 | ||
| 42 | static inline int firmware_map_remove(u64 start, u64 end, const char *type) | ||
| 43 | { | ||
| 44 | return 0; | ||
| 45 | } | ||
| 46 | |||
| 41 | #endif /* CONFIG_FIRMWARE_MEMMAP */ | 47 | #endif /* CONFIG_FIRMWARE_MEMMAP */ |
| 42 | 48 | ||
| 43 | #endif /* _LINUX_FIRMWARE_MAP_H */ | 49 | #endif /* _LINUX_FIRMWARE_MAP_H */ |
diff --git a/include/linux/freezer.h b/include/linux/freezer.h index e70df40d84f6..043a5cf8b5ba 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | #ifndef FREEZER_H_INCLUDED | 3 | #ifndef FREEZER_H_INCLUDED |
| 4 | #define FREEZER_H_INCLUDED | 4 | #define FREEZER_H_INCLUDED |
| 5 | 5 | ||
| 6 | #include <linux/debug_locks.h> | ||
| 6 | #include <linux/sched.h> | 7 | #include <linux/sched.h> |
| 7 | #include <linux/wait.h> | 8 | #include <linux/wait.h> |
| 8 | #include <linux/atomic.h> | 9 | #include <linux/atomic.h> |
| @@ -48,6 +49,8 @@ extern void thaw_kernel_threads(void); | |||
| 48 | 49 | ||
| 49 | static inline bool try_to_freeze(void) | 50 | static inline bool try_to_freeze(void) |
| 50 | { | 51 | { |
| 52 | if (!(current->flags & PF_NOFREEZE)) | ||
| 53 | debug_check_no_locks_held(); | ||
| 51 | might_sleep(); | 54 | might_sleep(); |
| 52 | if (likely(!freezing(current))) | 55 | if (likely(!freezing(current))) |
| 53 | return false; | 56 | return false; |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 7d2e893ec3d1..74a907b8b950 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -769,7 +769,7 @@ struct file { | |||
| 769 | } f_u; | 769 | } f_u; |
| 770 | struct path f_path; | 770 | struct path f_path; |
| 771 | #define f_dentry f_path.dentry | 771 | #define f_dentry f_path.dentry |
| 772 | #define f_vfsmnt f_path.mnt | 772 | struct inode *f_inode; /* cached value */ |
| 773 | const struct file_operations *f_op; | 773 | const struct file_operations *f_op; |
| 774 | 774 | ||
| 775 | /* | 775 | /* |
| @@ -1807,7 +1807,6 @@ struct file_system_type { | |||
| 1807 | #define FS_HAS_SUBTYPE 4 | 1807 | #define FS_HAS_SUBTYPE 4 |
| 1808 | #define FS_USERNS_MOUNT 8 /* Can be mounted by userns root */ | 1808 | #define FS_USERNS_MOUNT 8 /* Can be mounted by userns root */ |
| 1809 | #define FS_USERNS_DEV_MOUNT 16 /* A userns mount does not imply MNT_NODEV */ | 1809 | #define FS_USERNS_DEV_MOUNT 16 /* A userns mount does not imply MNT_NODEV */ |
| 1810 | #define FS_REVAL_DOT 16384 /* Check the paths ".", ".." for staleness */ | ||
| 1811 | #define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move() during rename() internally. */ | 1810 | #define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move() during rename() internally. */ |
| 1812 | struct dentry *(*mount) (struct file_system_type *, int, | 1811 | struct dentry *(*mount) (struct file_system_type *, int, |
| 1813 | const char *, void *); | 1812 | const char *, void *); |
| @@ -2217,6 +2216,11 @@ static inline bool execute_ok(struct inode *inode) | |||
| 2217 | return (inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode); | 2216 | return (inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode); |
| 2218 | } | 2217 | } |
| 2219 | 2218 | ||
| 2219 | static inline struct inode *file_inode(struct file *f) | ||
| 2220 | { | ||
| 2221 | return f->f_inode; | ||
| 2222 | } | ||
| 2223 | |||
| 2220 | /* | 2224 | /* |
| 2221 | * get_write_access() gets write permission for a file. | 2225 | * get_write_access() gets write permission for a file. |
| 2222 | * put_write_access() releases this write permission. | 2226 | * put_write_access() releases this write permission. |
| @@ -2239,7 +2243,7 @@ static inline int get_write_access(struct inode *inode) | |||
| 2239 | } | 2243 | } |
| 2240 | static inline int deny_write_access(struct file *file) | 2244 | static inline int deny_write_access(struct file *file) |
| 2241 | { | 2245 | { |
| 2242 | struct inode *inode = file->f_path.dentry->d_inode; | 2246 | struct inode *inode = file_inode(file); |
| 2243 | return atomic_dec_unless_positive(&inode->i_writecount) ? 0 : -ETXTBSY; | 2247 | return atomic_dec_unless_positive(&inode->i_writecount) ? 0 : -ETXTBSY; |
| 2244 | } | 2248 | } |
| 2245 | static inline void put_write_access(struct inode * inode) | 2249 | static inline void put_write_access(struct inode * inode) |
| @@ -2249,7 +2253,7 @@ static inline void put_write_access(struct inode * inode) | |||
| 2249 | static inline void allow_write_access(struct file *file) | 2253 | static inline void allow_write_access(struct file *file) |
| 2250 | { | 2254 | { |
| 2251 | if (file) | 2255 | if (file) |
| 2252 | atomic_inc(&file->f_path.dentry->d_inode->i_writecount); | 2256 | atomic_inc(&file_inode(file)->i_writecount); |
| 2253 | } | 2257 | } |
| 2254 | #ifdef CONFIG_IMA | 2258 | #ifdef CONFIG_IMA |
| 2255 | static inline void i_readcount_dec(struct inode *inode) | 2259 | static inline void i_readcount_dec(struct inode *inode) |
| @@ -2274,6 +2278,7 @@ static inline void i_readcount_inc(struct inode *inode) | |||
| 2274 | extern int do_pipe_flags(int *, int); | 2278 | extern int do_pipe_flags(int *, int); |
| 2275 | 2279 | ||
| 2276 | extern int kernel_read(struct file *, loff_t, char *, unsigned long); | 2280 | extern int kernel_read(struct file *, loff_t, char *, unsigned long); |
| 2281 | extern ssize_t kernel_write(struct file *, const char *, size_t, loff_t); | ||
| 2277 | extern struct file * open_exec(const char *); | 2282 | extern struct file * open_exec(const char *); |
| 2278 | 2283 | ||
| 2279 | /* fs/dcache.c -- generic fs support functions */ | 2284 | /* fs/dcache.c -- generic fs support functions */ |
| @@ -2463,7 +2468,7 @@ extern int page_symlink(struct inode *inode, const char *symname, int len); | |||
| 2463 | extern const struct inode_operations page_symlink_inode_operations; | 2468 | extern const struct inode_operations page_symlink_inode_operations; |
| 2464 | extern int generic_readlink(struct dentry *, char __user *, int); | 2469 | extern int generic_readlink(struct dentry *, char __user *, int); |
| 2465 | extern void generic_fillattr(struct inode *, struct kstat *); | 2470 | extern void generic_fillattr(struct inode *, struct kstat *); |
| 2466 | extern int vfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); | 2471 | extern int vfs_getattr(struct path *, struct kstat *); |
| 2467 | void __inode_add_bytes(struct inode *inode, loff_t bytes); | 2472 | void __inode_add_bytes(struct inode *inode, loff_t bytes); |
| 2468 | void inode_add_bytes(struct inode *inode, loff_t bytes); | 2473 | void inode_add_bytes(struct inode *inode, loff_t bytes); |
| 2469 | void inode_sub_bytes(struct inode *inode, loff_t bytes); | 2474 | void inode_sub_bytes(struct inode *inode, loff_t bytes); |
diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h index d0ae3a84bcfb..729eded4b24f 100644 --- a/include/linux/fs_struct.h +++ b/include/linux/fs_struct.h | |||
| @@ -17,8 +17,8 @@ struct fs_struct { | |||
| 17 | extern struct kmem_cache *fs_cachep; | 17 | extern struct kmem_cache *fs_cachep; |
| 18 | 18 | ||
| 19 | extern void exit_fs(struct task_struct *); | 19 | extern void exit_fs(struct task_struct *); |
| 20 | extern void set_fs_root(struct fs_struct *, struct path *); | 20 | extern void set_fs_root(struct fs_struct *, const struct path *); |
| 21 | extern void set_fs_pwd(struct fs_struct *, struct path *); | 21 | extern void set_fs_pwd(struct fs_struct *, const struct path *); |
| 22 | extern struct fs_struct *copy_fs_struct(struct fs_struct *); | 22 | extern struct fs_struct *copy_fs_struct(struct fs_struct *); |
| 23 | extern void free_fs_struct(struct fs_struct *); | 23 | extern void free_fs_struct(struct fs_struct *); |
| 24 | extern int unshare_fs_struct(void); | 24 | extern int unshare_fs_struct(void); |
diff --git a/include/linux/fsl/bestcomm/ata.h b/include/linux/fsl/bestcomm/ata.h new file mode 100644 index 000000000000..0b2371811334 --- /dev/null +++ b/include/linux/fsl/bestcomm/ata.h | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | /* | ||
| 2 | * Header for Bestcomm ATA task driver | ||
| 3 | * | ||
| 4 | * | ||
| 5 | * Copyright (C) 2006 Freescale - John Rigby | ||
| 6 | * Copyright (C) 2006 Sylvain Munaut <tnt@246tNt.com> | ||
| 7 | * | ||
| 8 | * This file is licensed under the terms of the GNU General Public License | ||
| 9 | * version 2. This program is licensed "as is" without any warranty of any | ||
| 10 | * kind, whether express or implied. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef __BESTCOMM_ATA_H__ | ||
| 14 | #define __BESTCOMM_ATA_H__ | ||
| 15 | |||
| 16 | |||
| 17 | struct bcom_ata_bd { | ||
| 18 | u32 status; | ||
| 19 | u32 src_pa; | ||
| 20 | u32 dst_pa; | ||
| 21 | }; | ||
| 22 | |||
| 23 | extern struct bcom_task * bcom_ata_init(int queue_len, int maxbufsize); | ||
| 24 | extern void bcom_ata_rx_prepare(struct bcom_task *tsk); | ||
| 25 | extern void bcom_ata_tx_prepare(struct bcom_task *tsk); | ||
| 26 | extern void bcom_ata_reset_bd(struct bcom_task *tsk); | ||
| 27 | extern void bcom_ata_release(struct bcom_task *tsk); | ||
| 28 | |||
| 29 | #endif /* __BESTCOMM_ATA_H__ */ | ||
| 30 | |||
diff --git a/include/linux/fsl/bestcomm/bestcomm.h b/include/linux/fsl/bestcomm/bestcomm.h new file mode 100644 index 000000000000..a0e2e6b19b57 --- /dev/null +++ b/include/linux/fsl/bestcomm/bestcomm.h | |||
| @@ -0,0 +1,213 @@ | |||
| 1 | /* | ||
| 2 | * Public header for the MPC52xx processor BestComm driver | ||
| 3 | * | ||
| 4 | * | ||
| 5 | * Copyright (C) 2006 Sylvain Munaut <tnt@246tNt.com> | ||
| 6 | * Copyright (C) 2005 Varma Electronics Oy, | ||
| 7 | * ( by Andrey Volkov <avolkov@varma-el.com> ) | ||
| 8 | * Copyright (C) 2003-2004 MontaVista, Software, Inc. | ||
| 9 | * ( by Dale Farnsworth <dfarnsworth@mvista.com> ) | ||
| 10 | * | ||
| 11 | * This file is licensed under the terms of the GNU General Public License | ||
| 12 | * version 2. This program is licensed "as is" without any warranty of any | ||
| 13 | * kind, whether express or implied. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #ifndef __BESTCOMM_H__ | ||
| 17 | #define __BESTCOMM_H__ | ||
| 18 | |||
| 19 | /** | ||
| 20 | * struct bcom_bd - Structure describing a generic BestComm buffer descriptor | ||
| 21 | * @status: The current status of this buffer. Exact meaning depends on the | ||
| 22 | * task type | ||
| 23 | * @data: An array of u32 extra data. Size of array is task dependent. | ||
| 24 | * | ||
| 25 | * Note: Don't dereference a bcom_bd pointer as an array. The size of the | ||
| 26 | * bcom_bd is variable. Use bcom_get_bd() instead. | ||
| 27 | */ | ||
| 28 | struct bcom_bd { | ||
| 29 | u32 status; | ||
| 30 | u32 data[0]; /* variable payload size */ | ||
| 31 | }; | ||
| 32 | |||
| 33 | /* ======================================================================== */ | ||
| 34 | /* Generic task management */ | ||
| 35 | /* ======================================================================== */ | ||
| 36 | |||
| 37 | /** | ||
| 38 | * struct bcom_task - Structure describing a loaded BestComm task | ||
| 39 | * | ||
| 40 | * This structure is never built by the driver it self. It's built and | ||
| 41 | * filled the intermediate layer of the BestComm API, the task dependent | ||
| 42 | * support code. | ||
| 43 | * | ||
| 44 | * Most likely you don't need to poke around inside this structure. The | ||
| 45 | * fields are exposed in the header just for the sake of inline functions | ||
| 46 | */ | ||
| 47 | struct bcom_task { | ||
| 48 | unsigned int tasknum; | ||
| 49 | unsigned int flags; | ||
| 50 | int irq; | ||
| 51 | |||
| 52 | struct bcom_bd *bd; | ||
| 53 | phys_addr_t bd_pa; | ||
| 54 | void **cookie; | ||
| 55 | unsigned short index; | ||
| 56 | unsigned short outdex; | ||
| 57 | unsigned int num_bd; | ||
| 58 | unsigned int bd_size; | ||
| 59 | |||
| 60 | void* priv; | ||
| 61 | }; | ||
| 62 | |||
| 63 | #define BCOM_FLAGS_NONE 0x00000000ul | ||
| 64 | #define BCOM_FLAGS_ENABLE_TASK (1ul << 0) | ||
| 65 | |||
| 66 | /** | ||
| 67 | * bcom_enable - Enable a BestComm task | ||
| 68 | * @tsk: The BestComm task structure | ||
| 69 | * | ||
| 70 | * This function makes sure the given task is enabled and can be run | ||
| 71 | * by the BestComm engine as needed | ||
| 72 | */ | ||
| 73 | extern void bcom_enable(struct bcom_task *tsk); | ||
| 74 | |||
| 75 | /** | ||
| 76 | * bcom_disable - Disable a BestComm task | ||
| 77 | * @tsk: The BestComm task structure | ||
| 78 | * | ||
| 79 | * This function disable a given task, making sure it's not executed | ||
| 80 | * by the BestComm engine. | ||
| 81 | */ | ||
| 82 | extern void bcom_disable(struct bcom_task *tsk); | ||
| 83 | |||
| 84 | |||
| 85 | /** | ||
| 86 | * bcom_get_task_irq - Returns the irq number of a BestComm task | ||
| 87 | * @tsk: The BestComm task structure | ||
| 88 | */ | ||
| 89 | static inline int | ||
| 90 | bcom_get_task_irq(struct bcom_task *tsk) { | ||
| 91 | return tsk->irq; | ||
| 92 | } | ||
| 93 | |||
| 94 | /* ======================================================================== */ | ||
| 95 | /* BD based tasks helpers */ | ||
| 96 | /* ======================================================================== */ | ||
| 97 | |||
| 98 | #define BCOM_BD_READY 0x40000000ul | ||
| 99 | |||
| 100 | /** _bcom_next_index - Get next input index. | ||
| 101 | * @tsk: pointer to task structure | ||
| 102 | * | ||
| 103 | * Support function; Device drivers should not call this | ||
| 104 | */ | ||
| 105 | static inline int | ||
| 106 | _bcom_next_index(struct bcom_task *tsk) | ||
| 107 | { | ||
| 108 | return ((tsk->index + 1) == tsk->num_bd) ? 0 : tsk->index + 1; | ||
| 109 | } | ||
| 110 | |||
| 111 | /** _bcom_next_outdex - Get next output index. | ||
| 112 | * @tsk: pointer to task structure | ||
| 113 | * | ||
| 114 | * Support function; Device drivers should not call this | ||
| 115 | */ | ||
| 116 | static inline int | ||
| 117 | _bcom_next_outdex(struct bcom_task *tsk) | ||
| 118 | { | ||
| 119 | return ((tsk->outdex + 1) == tsk->num_bd) ? 0 : tsk->outdex + 1; | ||
| 120 | } | ||
| 121 | |||
| 122 | /** | ||
| 123 | * bcom_queue_empty - Checks if a BestComm task BD queue is empty | ||
| 124 | * @tsk: The BestComm task structure | ||
| 125 | */ | ||
| 126 | static inline int | ||
| 127 | bcom_queue_empty(struct bcom_task *tsk) | ||
| 128 | { | ||
| 129 | return tsk->index == tsk->outdex; | ||
| 130 | } | ||
| 131 | |||
| 132 | /** | ||
| 133 | * bcom_queue_full - Checks if a BestComm task BD queue is full | ||
| 134 | * @tsk: The BestComm task structure | ||
| 135 | */ | ||
| 136 | static inline int | ||
| 137 | bcom_queue_full(struct bcom_task *tsk) | ||
| 138 | { | ||
| 139 | return tsk->outdex == _bcom_next_index(tsk); | ||
| 140 | } | ||
| 141 | |||
| 142 | /** | ||
| 143 | * bcom_get_bd - Get a BD from the queue | ||
| 144 | * @tsk: The BestComm task structure | ||
| 145 | * index: Index of the BD to fetch | ||
| 146 | */ | ||
| 147 | static inline struct bcom_bd | ||
| 148 | *bcom_get_bd(struct bcom_task *tsk, unsigned int index) | ||
| 149 | { | ||
| 150 | /* A cast to (void*) so the address can be incremented by the | ||
| 151 | * real size instead of by sizeof(struct bcom_bd) */ | ||
| 152 | return ((void *)tsk->bd) + (index * tsk->bd_size); | ||
| 153 | } | ||
| 154 | |||
| 155 | /** | ||
| 156 | * bcom_buffer_done - Checks if a BestComm | ||
| 157 | * @tsk: The BestComm task structure | ||
| 158 | */ | ||
| 159 | static inline int | ||
| 160 | bcom_buffer_done(struct bcom_task *tsk) | ||
| 161 | { | ||
| 162 | struct bcom_bd *bd; | ||
| 163 | if (bcom_queue_empty(tsk)) | ||
| 164 | return 0; | ||
| 165 | |||
| 166 | bd = bcom_get_bd(tsk, tsk->outdex); | ||
| 167 | return !(bd->status & BCOM_BD_READY); | ||
| 168 | } | ||
| 169 | |||
| 170 | /** | ||
| 171 | * bcom_prepare_next_buffer - clear status of next available buffer. | ||
| 172 | * @tsk: The BestComm task structure | ||
| 173 | * | ||
| 174 | * Returns pointer to next buffer descriptor | ||
| 175 | */ | ||
| 176 | static inline struct bcom_bd * | ||
| 177 | bcom_prepare_next_buffer(struct bcom_task *tsk) | ||
| 178 | { | ||
| 179 | struct bcom_bd *bd; | ||
| 180 | |||
| 181 | bd = bcom_get_bd(tsk, tsk->index); | ||
| 182 | bd->status = 0; /* cleanup last status */ | ||
| 183 | return bd; | ||
| 184 | } | ||
| 185 | |||
| 186 | static inline void | ||
| 187 | bcom_submit_next_buffer(struct bcom_task *tsk, void *cookie) | ||
| 188 | { | ||
| 189 | struct bcom_bd *bd = bcom_get_bd(tsk, tsk->index); | ||
| 190 | |||
| 191 | tsk->cookie[tsk->index] = cookie; | ||
| 192 | mb(); /* ensure the bd is really up-to-date */ | ||
| 193 | bd->status |= BCOM_BD_READY; | ||
| 194 | tsk->index = _bcom_next_index(tsk); | ||
| 195 | if (tsk->flags & BCOM_FLAGS_ENABLE_TASK) | ||
| 196 | bcom_enable(tsk); | ||
| 197 | } | ||
| 198 | |||
| 199 | static inline void * | ||
| 200 | bcom_retrieve_buffer(struct bcom_task *tsk, u32 *p_status, struct bcom_bd **p_bd) | ||
| 201 | { | ||
| 202 | void *cookie = tsk->cookie[tsk->outdex]; | ||
| 203 | struct bcom_bd *bd = bcom_get_bd(tsk, tsk->outdex); | ||
| 204 | |||
| 205 | if (p_status) | ||
| 206 | *p_status = bd->status; | ||
| 207 | if (p_bd) | ||
| 208 | *p_bd = bd; | ||
| 209 | tsk->outdex = _bcom_next_outdex(tsk); | ||
| 210 | return cookie; | ||
| 211 | } | ||
| 212 | |||
| 213 | #endif /* __BESTCOMM_H__ */ | ||
diff --git a/include/linux/fsl/bestcomm/bestcomm_priv.h b/include/linux/fsl/bestcomm/bestcomm_priv.h new file mode 100644 index 000000000000..3b52f3ffbdf8 --- /dev/null +++ b/include/linux/fsl/bestcomm/bestcomm_priv.h | |||
| @@ -0,0 +1,350 @@ | |||
| 1 | /* | ||
| 2 | * Private header for the MPC52xx processor BestComm driver | ||
| 3 | * | ||
| 4 | * By private, we mean that driver should not use it directly. It's meant | ||
| 5 | * to be used by the BestComm engine driver itself and by the intermediate | ||
| 6 | * layer between the core and the drivers. | ||
| 7 | * | ||
| 8 | * Copyright (C) 2006 Sylvain Munaut <tnt@246tNt.com> | ||
| 9 | * Copyright (C) 2005 Varma Electronics Oy, | ||
| 10 | * ( by Andrey Volkov <avolkov@varma-el.com> ) | ||
| 11 | * Copyright (C) 2003-2004 MontaVista, Software, Inc. | ||
| 12 | * ( by Dale Farnsworth <dfarnsworth@mvista.com> ) | ||
| 13 | * | ||
| 14 | * This file is licensed under the terms of the GNU General Public License | ||
| 15 | * version 2. This program is licensed "as is" without any warranty of any | ||
| 16 | * kind, whether express or implied. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef __BESTCOMM_PRIV_H__ | ||
| 20 | #define __BESTCOMM_PRIV_H__ | ||
| 21 | |||
| 22 | #include <linux/spinlock.h> | ||
| 23 | #include <linux/of.h> | ||
| 24 | #include <asm/io.h> | ||
| 25 | #include <asm/mpc52xx.h> | ||
| 26 | |||
| 27 | #include "sram.h" | ||
| 28 | |||
| 29 | |||
| 30 | /* ======================================================================== */ | ||
| 31 | /* Engine related stuff */ | ||
| 32 | /* ======================================================================== */ | ||
| 33 | |||
| 34 | /* Zones sizes and needed alignments */ | ||
| 35 | #define BCOM_MAX_TASKS 16 | ||
| 36 | #define BCOM_MAX_VAR 24 | ||
| 37 | #define BCOM_MAX_INC 8 | ||
| 38 | #define BCOM_MAX_FDT 64 | ||
| 39 | #define BCOM_MAX_CTX 20 | ||
| 40 | #define BCOM_CTX_SIZE (BCOM_MAX_CTX * sizeof(u32)) | ||
| 41 | #define BCOM_CTX_ALIGN 0x100 | ||
| 42 | #define BCOM_VAR_SIZE (BCOM_MAX_VAR * sizeof(u32)) | ||
| 43 | #define BCOM_INC_SIZE (BCOM_MAX_INC * sizeof(u32)) | ||
| 44 | #define BCOM_VAR_ALIGN 0x80 | ||
| 45 | #define BCOM_FDT_SIZE (BCOM_MAX_FDT * sizeof(u32)) | ||
| 46 | #define BCOM_FDT_ALIGN 0x100 | ||
| 47 | |||
| 48 | /** | ||
| 49 | * struct bcom_tdt - Task Descriptor Table Entry | ||
| 50 | * | ||
| 51 | */ | ||
| 52 | struct bcom_tdt { | ||
| 53 | u32 start; | ||
| 54 | u32 stop; | ||
| 55 | u32 var; | ||
| 56 | u32 fdt; | ||
| 57 | u32 exec_status; /* used internally by BestComm engine */ | ||
| 58 | u32 mvtp; /* used internally by BestComm engine */ | ||
| 59 | u32 context; | ||
| 60 | u32 litbase; | ||
| 61 | }; | ||
| 62 | |||
| 63 | /** | ||
| 64 | * struct bcom_engine | ||
| 65 | * | ||
| 66 | * This holds all info needed globaly to handle the engine | ||
| 67 | */ | ||
| 68 | struct bcom_engine { | ||
| 69 | struct device_node *ofnode; | ||
| 70 | struct mpc52xx_sdma __iomem *regs; | ||
| 71 | phys_addr_t regs_base; | ||
| 72 | |||
| 73 | struct bcom_tdt *tdt; | ||
| 74 | u32 *ctx; | ||
| 75 | u32 *var; | ||
| 76 | u32 *fdt; | ||
| 77 | |||
| 78 | spinlock_t lock; | ||
| 79 | }; | ||
| 80 | |||
| 81 | extern struct bcom_engine *bcom_eng; | ||
| 82 | |||
| 83 | |||
| 84 | /* ======================================================================== */ | ||
| 85 | /* Tasks related stuff */ | ||
| 86 | /* ======================================================================== */ | ||
| 87 | |||
| 88 | /* Tasks image header */ | ||
| 89 | #define BCOM_TASK_MAGIC 0x4243544B /* 'BCTK' */ | ||
| 90 | |||
| 91 | struct bcom_task_header { | ||
| 92 | u32 magic; | ||
| 93 | u8 desc_size; /* the size fields */ | ||
| 94 | u8 var_size; /* are given in number */ | ||
| 95 | u8 inc_size; /* of 32-bits words */ | ||
| 96 | u8 first_var; | ||
| 97 | u8 reserved[8]; | ||
| 98 | }; | ||
| 99 | |||
| 100 | /* Descriptors structure & co */ | ||
| 101 | #define BCOM_DESC_NOP 0x000001f8 | ||
| 102 | #define BCOM_LCD_MASK 0x80000000 | ||
| 103 | #define BCOM_DRD_EXTENDED 0x40000000 | ||
| 104 | #define BCOM_DRD_INITIATOR_SHIFT 21 | ||
| 105 | |||
| 106 | /* Tasks pragma */ | ||
| 107 | #define BCOM_PRAGMA_BIT_RSV 7 /* reserved pragma bit */ | ||
| 108 | #define BCOM_PRAGMA_BIT_PRECISE_INC 6 /* increment 0=when possible, */ | ||
| 109 | /* 1=iter end */ | ||
| 110 | #define BCOM_PRAGMA_BIT_RST_ERROR_NO 5 /* don't reset errors on */ | ||
| 111 | /* task enable */ | ||
| 112 | #define BCOM_PRAGMA_BIT_PACK 4 /* pack data enable */ | ||
| 113 | #define BCOM_PRAGMA_BIT_INTEGER 3 /* data alignment */ | ||
| 114 | /* 0=frac(msb), 1=int(lsb) */ | ||
| 115 | #define BCOM_PRAGMA_BIT_SPECREAD 2 /* XLB speculative read */ | ||
| 116 | #define BCOM_PRAGMA_BIT_CW 1 /* write line buffer enable */ | ||
| 117 | #define BCOM_PRAGMA_BIT_RL 0 /* read line buffer enable */ | ||
| 118 | |||
| 119 | /* Looks like XLB speculative read generates XLB errors when a buffer | ||
| 120 | * is at the end of the physical memory. i.e. when accessing the | ||
| 121 | * lasts words, the engine tries to prefetch the next but there is no | ||
| 122 | * next ... | ||
| 123 | */ | ||
| 124 | #define BCOM_STD_PRAGMA ((0 << BCOM_PRAGMA_BIT_RSV) | \ | ||
| 125 | (0 << BCOM_PRAGMA_BIT_PRECISE_INC) | \ | ||
| 126 | (0 << BCOM_PRAGMA_BIT_RST_ERROR_NO) | \ | ||
| 127 | (0 << BCOM_PRAGMA_BIT_PACK) | \ | ||
| 128 | (0 << BCOM_PRAGMA_BIT_INTEGER) | \ | ||
| 129 | (0 << BCOM_PRAGMA_BIT_SPECREAD) | \ | ||
| 130 | (1 << BCOM_PRAGMA_BIT_CW) | \ | ||
| 131 | (1 << BCOM_PRAGMA_BIT_RL)) | ||
| 132 | |||
| 133 | #define BCOM_PCI_PRAGMA ((0 << BCOM_PRAGMA_BIT_RSV) | \ | ||
| 134 | (0 << BCOM_PRAGMA_BIT_PRECISE_INC) | \ | ||
| 135 | (0 << BCOM_PRAGMA_BIT_RST_ERROR_NO) | \ | ||
| 136 | (0 << BCOM_PRAGMA_BIT_PACK) | \ | ||
| 137 | (1 << BCOM_PRAGMA_BIT_INTEGER) | \ | ||
| 138 | (0 << BCOM_PRAGMA_BIT_SPECREAD) | \ | ||
| 139 | (1 << BCOM_PRAGMA_BIT_CW) | \ | ||
| 140 | (1 << BCOM_PRAGMA_BIT_RL)) | ||
| 141 | |||
| 142 | #define BCOM_ATA_PRAGMA BCOM_STD_PRAGMA | ||
| 143 | #define BCOM_CRC16_DP_0_PRAGMA BCOM_STD_PRAGMA | ||
| 144 | #define BCOM_CRC16_DP_1_PRAGMA BCOM_STD_PRAGMA | ||
| 145 | #define BCOM_FEC_RX_BD_PRAGMA BCOM_STD_PRAGMA | ||
| 146 | #define BCOM_FEC_TX_BD_PRAGMA BCOM_STD_PRAGMA | ||
| 147 | #define BCOM_GEN_DP_0_PRAGMA BCOM_STD_PRAGMA | ||
| 148 | #define BCOM_GEN_DP_1_PRAGMA BCOM_STD_PRAGMA | ||
| 149 | #define BCOM_GEN_DP_2_PRAGMA BCOM_STD_PRAGMA | ||
| 150 | #define BCOM_GEN_DP_3_PRAGMA BCOM_STD_PRAGMA | ||
| 151 | #define BCOM_GEN_DP_BD_0_PRAGMA BCOM_STD_PRAGMA | ||
| 152 | #define BCOM_GEN_DP_BD_1_PRAGMA BCOM_STD_PRAGMA | ||
| 153 | #define BCOM_GEN_RX_BD_PRAGMA BCOM_STD_PRAGMA | ||
| 154 | #define BCOM_GEN_TX_BD_PRAGMA BCOM_STD_PRAGMA | ||
| 155 | #define BCOM_GEN_LPC_PRAGMA BCOM_STD_PRAGMA | ||
| 156 | #define BCOM_PCI_RX_PRAGMA BCOM_PCI_PRAGMA | ||
| 157 | #define BCOM_PCI_TX_PRAGMA BCOM_PCI_PRAGMA | ||
| 158 | |||
| 159 | /* Initiators number */ | ||
| 160 | #define BCOM_INITIATOR_ALWAYS 0 | ||
| 161 | #define BCOM_INITIATOR_SCTMR_0 1 | ||
| 162 | #define BCOM_INITIATOR_SCTMR_1 2 | ||
| 163 | #define BCOM_INITIATOR_FEC_RX 3 | ||
| 164 | #define BCOM_INITIATOR_FEC_TX 4 | ||
| 165 | #define BCOM_INITIATOR_ATA_RX 5 | ||
| 166 | #define BCOM_INITIATOR_ATA_TX 6 | ||
| 167 | #define BCOM_INITIATOR_SCPCI_RX 7 | ||
| 168 | #define BCOM_INITIATOR_SCPCI_TX 8 | ||
| 169 | #define BCOM_INITIATOR_PSC3_RX 9 | ||
| 170 | #define BCOM_INITIATOR_PSC3_TX 10 | ||
| 171 | #define BCOM_INITIATOR_PSC2_RX 11 | ||
| 172 | #define BCOM_INITIATOR_PSC2_TX 12 | ||
| 173 | #define BCOM_INITIATOR_PSC1_RX 13 | ||
| 174 | #define BCOM_INITIATOR_PSC1_TX 14 | ||
| 175 | #define BCOM_INITIATOR_SCTMR_2 15 | ||
| 176 | #define BCOM_INITIATOR_SCLPC 16 | ||
| 177 | #define BCOM_INITIATOR_PSC5_RX 17 | ||
| 178 | #define BCOM_INITIATOR_PSC5_TX 18 | ||
| 179 | #define BCOM_INITIATOR_PSC4_RX 19 | ||
| 180 | #define BCOM_INITIATOR_PSC4_TX 20 | ||
| 181 | #define BCOM_INITIATOR_I2C2_RX 21 | ||
| 182 | #define BCOM_INITIATOR_I2C2_TX 22 | ||
| 183 | #define BCOM_INITIATOR_I2C1_RX 23 | ||
| 184 | #define BCOM_INITIATOR_I2C1_TX 24 | ||
| 185 | #define BCOM_INITIATOR_PSC6_RX 25 | ||
| 186 | #define BCOM_INITIATOR_PSC6_TX 26 | ||
| 187 | #define BCOM_INITIATOR_IRDA_RX 25 | ||
| 188 | #define BCOM_INITIATOR_IRDA_TX 26 | ||
| 189 | #define BCOM_INITIATOR_SCTMR_3 27 | ||
| 190 | #define BCOM_INITIATOR_SCTMR_4 28 | ||
| 191 | #define BCOM_INITIATOR_SCTMR_5 29 | ||
| 192 | #define BCOM_INITIATOR_SCTMR_6 30 | ||
| 193 | #define BCOM_INITIATOR_SCTMR_7 31 | ||
| 194 | |||
| 195 | /* Initiators priorities */ | ||
| 196 | #define BCOM_IPR_ALWAYS 7 | ||
| 197 | #define BCOM_IPR_SCTMR_0 2 | ||
| 198 | #define BCOM_IPR_SCTMR_1 2 | ||
| 199 | #define BCOM_IPR_FEC_RX 6 | ||
| 200 | #define BCOM_IPR_FEC_TX 5 | ||
| 201 | #define BCOM_IPR_ATA_RX 7 | ||
| 202 | #define BCOM_IPR_ATA_TX 7 | ||
| 203 | #define BCOM_IPR_SCPCI_RX 2 | ||
| 204 | #define BCOM_IPR_SCPCI_TX 2 | ||
| 205 | #define BCOM_IPR_PSC3_RX 2 | ||
| 206 | #define BCOM_IPR_PSC3_TX 2 | ||
| 207 | #define BCOM_IPR_PSC2_RX 2 | ||
| 208 | #define BCOM_IPR_PSC2_TX 2 | ||
| 209 | #define BCOM_IPR_PSC1_RX 2 | ||
| 210 | #define BCOM_IPR_PSC1_TX 2 | ||
| 211 | #define BCOM_IPR_SCTMR_2 2 | ||
| 212 | #define BCOM_IPR_SCLPC 2 | ||
| 213 | #define BCOM_IPR_PSC5_RX 2 | ||
| 214 | #define BCOM_IPR_PSC5_TX 2 | ||
| 215 | #define BCOM_IPR_PSC4_RX 2 | ||
| 216 | #define BCOM_IPR_PSC4_TX 2 | ||
| 217 | #define BCOM_IPR_I2C2_RX 2 | ||
| 218 | #define BCOM_IPR_I2C2_TX 2 | ||
| 219 | #define BCOM_IPR_I2C1_RX 2 | ||
| 220 | #define BCOM_IPR_I2C1_TX 2 | ||
| 221 | #define BCOM_IPR_PSC6_RX 2 | ||
| 222 | #define BCOM_IPR_PSC6_TX 2 | ||
| 223 | #define BCOM_IPR_IRDA_RX 2 | ||
| 224 | #define BCOM_IPR_IRDA_TX 2 | ||
| 225 | #define BCOM_IPR_SCTMR_3 2 | ||
| 226 | #define BCOM_IPR_SCTMR_4 2 | ||
| 227 | #define BCOM_IPR_SCTMR_5 2 | ||
| 228 | #define BCOM_IPR_SCTMR_6 2 | ||
| 229 | #define BCOM_IPR_SCTMR_7 2 | ||
| 230 | |||
| 231 | |||
| 232 | /* ======================================================================== */ | ||
| 233 | /* API */ | ||
| 234 | /* ======================================================================== */ | ||
| 235 | |||
| 236 | extern struct bcom_task *bcom_task_alloc(int bd_count, int bd_size, int priv_size); | ||
| 237 | extern void bcom_task_free(struct bcom_task *tsk); | ||
| 238 | extern int bcom_load_image(int task, u32 *task_image); | ||
| 239 | extern void bcom_set_initiator(int task, int initiator); | ||
| 240 | |||
| 241 | |||
| 242 | #define TASK_ENABLE 0x8000 | ||
| 243 | |||
| 244 | /** | ||
| 245 | * bcom_disable_prefetch - Hook to disable bus prefetching | ||
| 246 | * | ||
| 247 | * ATA DMA and the original MPC5200 need this due to silicon bugs. At the | ||
| 248 | * moment disabling prefetch is a one-way street. There is no mechanism | ||
| 249 | * in place to turn prefetch back on after it has been disabled. There is | ||
| 250 | * no reason it couldn't be done, it would just be more complex to implement. | ||
| 251 | */ | ||
| 252 | static inline void bcom_disable_prefetch(void) | ||
| 253 | { | ||
| 254 | u16 regval; | ||
| 255 | |||
| 256 | regval = in_be16(&bcom_eng->regs->PtdCntrl); | ||
| 257 | out_be16(&bcom_eng->regs->PtdCntrl, regval | 1); | ||
| 258 | }; | ||
| 259 | |||
| 260 | static inline void | ||
| 261 | bcom_enable_task(int task) | ||
| 262 | { | ||
| 263 | u16 reg; | ||
| 264 | reg = in_be16(&bcom_eng->regs->tcr[task]); | ||
| 265 | out_be16(&bcom_eng->regs->tcr[task], reg | TASK_ENABLE); | ||
| 266 | } | ||
| 267 | |||
| 268 | static inline void | ||
| 269 | bcom_disable_task(int task) | ||
| 270 | { | ||
| 271 | u16 reg = in_be16(&bcom_eng->regs->tcr[task]); | ||
| 272 | out_be16(&bcom_eng->regs->tcr[task], reg & ~TASK_ENABLE); | ||
| 273 | } | ||
| 274 | |||
| 275 | |||
| 276 | static inline u32 * | ||
| 277 | bcom_task_desc(int task) | ||
| 278 | { | ||
| 279 | return bcom_sram_pa2va(bcom_eng->tdt[task].start); | ||
| 280 | } | ||
| 281 | |||
| 282 | static inline int | ||
| 283 | bcom_task_num_descs(int task) | ||
| 284 | { | ||
| 285 | return (bcom_eng->tdt[task].stop - bcom_eng->tdt[task].start)/sizeof(u32) + 1; | ||
| 286 | } | ||
| 287 | |||
| 288 | static inline u32 * | ||
| 289 | bcom_task_var(int task) | ||
| 290 | { | ||
| 291 | return bcom_sram_pa2va(bcom_eng->tdt[task].var); | ||
| 292 | } | ||
| 293 | |||
| 294 | static inline u32 * | ||
| 295 | bcom_task_inc(int task) | ||
| 296 | { | ||
| 297 | return &bcom_task_var(task)[BCOM_MAX_VAR]; | ||
| 298 | } | ||
| 299 | |||
| 300 | |||
| 301 | static inline int | ||
| 302 | bcom_drd_is_extended(u32 desc) | ||
| 303 | { | ||
| 304 | return (desc) & BCOM_DRD_EXTENDED; | ||
| 305 | } | ||
| 306 | |||
| 307 | static inline int | ||
| 308 | bcom_desc_is_drd(u32 desc) | ||
| 309 | { | ||
| 310 | return !(desc & BCOM_LCD_MASK) && desc != BCOM_DESC_NOP; | ||
| 311 | } | ||
| 312 | |||
| 313 | static inline int | ||
| 314 | bcom_desc_initiator(u32 desc) | ||
| 315 | { | ||
| 316 | return (desc >> BCOM_DRD_INITIATOR_SHIFT) & 0x1f; | ||
| 317 | } | ||
| 318 | |||
| 319 | static inline void | ||
| 320 | bcom_set_desc_initiator(u32 *desc, int initiator) | ||
| 321 | { | ||
| 322 | *desc = (*desc & ~(0x1f << BCOM_DRD_INITIATOR_SHIFT)) | | ||
| 323 | ((initiator & 0x1f) << BCOM_DRD_INITIATOR_SHIFT); | ||
| 324 | } | ||
| 325 | |||
| 326 | |||
| 327 | static inline void | ||
| 328 | bcom_set_task_pragma(int task, int pragma) | ||
| 329 | { | ||
| 330 | u32 *fdt = &bcom_eng->tdt[task].fdt; | ||
| 331 | *fdt = (*fdt & ~0xff) | pragma; | ||
| 332 | } | ||
| 333 | |||
| 334 | static inline void | ||
| 335 | bcom_set_task_auto_start(int task, int next_task) | ||
| 336 | { | ||
| 337 | u16 __iomem *tcr = &bcom_eng->regs->tcr[task]; | ||
| 338 | out_be16(tcr, (in_be16(tcr) & ~0xff) | 0x00c0 | next_task); | ||
| 339 | } | ||
| 340 | |||
| 341 | static inline void | ||
| 342 | bcom_set_tcr_initiator(int task, int initiator) | ||
| 343 | { | ||
| 344 | u16 __iomem *tcr = &bcom_eng->regs->tcr[task]; | ||
| 345 | out_be16(tcr, (in_be16(tcr) & ~0x1f00) | ((initiator & 0x1f) << 8)); | ||
| 346 | } | ||
| 347 | |||
| 348 | |||
| 349 | #endif /* __BESTCOMM_PRIV_H__ */ | ||
| 350 | |||
diff --git a/include/linux/fsl/bestcomm/fec.h b/include/linux/fsl/bestcomm/fec.h new file mode 100644 index 000000000000..ee565d94d503 --- /dev/null +++ b/include/linux/fsl/bestcomm/fec.h | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | /* | ||
| 2 | * Header for Bestcomm FEC tasks driver | ||
| 3 | * | ||
| 4 | * | ||
| 5 | * Copyright (C) 2006-2007 Sylvain Munaut <tnt@246tNt.com> | ||
| 6 | * Copyright (C) 2003-2004 MontaVista, Software, Inc. | ||
| 7 | * ( by Dale Farnsworth <dfarnsworth@mvista.com> ) | ||
| 8 | * | ||
| 9 | * This file is licensed under the terms of the GNU General Public License | ||
| 10 | * version 2. This program is licensed "as is" without any warranty of any | ||
| 11 | * kind, whether express or implied. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __BESTCOMM_FEC_H__ | ||
| 15 | #define __BESTCOMM_FEC_H__ | ||
| 16 | |||
| 17 | |||
| 18 | struct bcom_fec_bd { | ||
| 19 | u32 status; | ||
| 20 | u32 skb_pa; | ||
| 21 | }; | ||
| 22 | |||
| 23 | #define BCOM_FEC_TX_BD_TFD 0x08000000ul /* transmit frame done */ | ||
| 24 | #define BCOM_FEC_TX_BD_TC 0x04000000ul /* transmit CRC */ | ||
| 25 | #define BCOM_FEC_TX_BD_ABC 0x02000000ul /* append bad CRC */ | ||
| 26 | |||
| 27 | #define BCOM_FEC_RX_BD_L 0x08000000ul /* buffer is last in frame */ | ||
| 28 | #define BCOM_FEC_RX_BD_BC 0x00800000ul /* DA is broadcast */ | ||
| 29 | #define BCOM_FEC_RX_BD_MC 0x00400000ul /* DA is multicast and not broadcast */ | ||
| 30 | #define BCOM_FEC_RX_BD_LG 0x00200000ul /* Rx frame length violation */ | ||
| 31 | #define BCOM_FEC_RX_BD_NO 0x00100000ul /* Rx non-octet aligned frame */ | ||
| 32 | #define BCOM_FEC_RX_BD_CR 0x00040000ul /* Rx CRC error */ | ||
| 33 | #define BCOM_FEC_RX_BD_OV 0x00020000ul /* overrun */ | ||
| 34 | #define BCOM_FEC_RX_BD_TR 0x00010000ul /* Rx frame truncated */ | ||
| 35 | #define BCOM_FEC_RX_BD_LEN_MASK 0x000007fful /* mask for length of received frame */ | ||
| 36 | #define BCOM_FEC_RX_BD_ERRORS (BCOM_FEC_RX_BD_LG | BCOM_FEC_RX_BD_NO | \ | ||
| 37 | BCOM_FEC_RX_BD_CR | BCOM_FEC_RX_BD_OV | BCOM_FEC_RX_BD_TR) | ||
| 38 | |||
| 39 | |||
| 40 | extern struct bcom_task * | ||
| 41 | bcom_fec_rx_init(int queue_len, phys_addr_t fifo, int maxbufsize); | ||
| 42 | |||
| 43 | extern int | ||
| 44 | bcom_fec_rx_reset(struct bcom_task *tsk); | ||
| 45 | |||
| 46 | extern void | ||
| 47 | bcom_fec_rx_release(struct bcom_task *tsk); | ||
| 48 | |||
| 49 | |||
| 50 | extern struct bcom_task * | ||
| 51 | bcom_fec_tx_init(int queue_len, phys_addr_t fifo); | ||
| 52 | |||
| 53 | extern int | ||
| 54 | bcom_fec_tx_reset(struct bcom_task *tsk); | ||
| 55 | |||
| 56 | extern void | ||
| 57 | bcom_fec_tx_release(struct bcom_task *tsk); | ||
| 58 | |||
| 59 | |||
| 60 | #endif /* __BESTCOMM_FEC_H__ */ | ||
| 61 | |||
diff --git a/include/linux/fsl/bestcomm/gen_bd.h b/include/linux/fsl/bestcomm/gen_bd.h new file mode 100644 index 000000000000..de47260e69da --- /dev/null +++ b/include/linux/fsl/bestcomm/gen_bd.h | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | /* | ||
| 2 | * Header for Bestcomm General Buffer Descriptor tasks driver | ||
| 3 | * | ||
| 4 | * | ||
| 5 | * Copyright (C) 2007 Sylvain Munaut <tnt@246tNt.com> | ||
| 6 | * Copyright (C) 2006 AppSpec Computer Technologies Corp. | ||
| 7 | * Jeff Gibbons <jeff.gibbons@appspec.com> | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify it | ||
| 10 | * under the terms of the GNU General Public License version 2 as published | ||
| 11 | * by the Free Software Foundation. | ||
| 12 | * | ||
| 13 | * | ||
| 14 | */ | ||
| 15 | |||
| 16 | #ifndef __BESTCOMM_GEN_BD_H__ | ||
| 17 | #define __BESTCOMM_GEN_BD_H__ | ||
| 18 | |||
| 19 | struct bcom_gen_bd { | ||
| 20 | u32 status; | ||
| 21 | u32 buf_pa; | ||
| 22 | }; | ||
| 23 | |||
| 24 | |||
| 25 | extern struct bcom_task * | ||
| 26 | bcom_gen_bd_rx_init(int queue_len, phys_addr_t fifo, | ||
| 27 | int initiator, int ipr, int maxbufsize); | ||
| 28 | |||
| 29 | extern int | ||
| 30 | bcom_gen_bd_rx_reset(struct bcom_task *tsk); | ||
| 31 | |||
| 32 | extern void | ||
| 33 | bcom_gen_bd_rx_release(struct bcom_task *tsk); | ||
| 34 | |||
| 35 | |||
| 36 | extern struct bcom_task * | ||
| 37 | bcom_gen_bd_tx_init(int queue_len, phys_addr_t fifo, | ||
| 38 | int initiator, int ipr); | ||
| 39 | |||
| 40 | extern int | ||
| 41 | bcom_gen_bd_tx_reset(struct bcom_task *tsk); | ||
| 42 | |||
| 43 | extern void | ||
| 44 | bcom_gen_bd_tx_release(struct bcom_task *tsk); | ||
| 45 | |||
| 46 | |||
| 47 | /* PSC support utility wrappers */ | ||
| 48 | struct bcom_task * bcom_psc_gen_bd_rx_init(unsigned psc_num, int queue_len, | ||
| 49 | phys_addr_t fifo, int maxbufsize); | ||
| 50 | struct bcom_task * bcom_psc_gen_bd_tx_init(unsigned psc_num, int queue_len, | ||
| 51 | phys_addr_t fifo); | ||
| 52 | #endif /* __BESTCOMM_GEN_BD_H__ */ | ||
| 53 | |||
diff --git a/include/linux/fsl/bestcomm/sram.h b/include/linux/fsl/bestcomm/sram.h new file mode 100644 index 000000000000..b6d668963cce --- /dev/null +++ b/include/linux/fsl/bestcomm/sram.h | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | /* | ||
| 2 | * Handling of a sram zone for bestcomm | ||
| 3 | * | ||
| 4 | * | ||
| 5 | * Copyright (C) 2007 Sylvain Munaut <tnt@246tNt.com> | ||
| 6 | * | ||
| 7 | * This file is licensed under the terms of the GNU General Public License | ||
| 8 | * version 2. This program is licensed "as is" without any warranty of any | ||
| 9 | * kind, whether express or implied. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef __BESTCOMM_SRAM_H__ | ||
| 13 | #define __BESTCOMM_SRAM_H__ | ||
| 14 | |||
| 15 | #include <asm/rheap.h> | ||
| 16 | #include <asm/mmu.h> | ||
| 17 | #include <linux/spinlock.h> | ||
| 18 | |||
| 19 | |||
| 20 | /* Structure used internally */ | ||
| 21 | /* The internals are here for the inline functions | ||
| 22 | * sake, certainly not for the user to mess with ! | ||
| 23 | */ | ||
| 24 | struct bcom_sram { | ||
| 25 | phys_addr_t base_phys; | ||
| 26 | void *base_virt; | ||
| 27 | unsigned int size; | ||
| 28 | rh_info_t *rh; | ||
| 29 | spinlock_t lock; | ||
| 30 | }; | ||
| 31 | |||
| 32 | extern struct bcom_sram *bcom_sram; | ||
| 33 | |||
| 34 | |||
| 35 | /* Public API */ | ||
| 36 | extern int bcom_sram_init(struct device_node *sram_node, char *owner); | ||
| 37 | extern void bcom_sram_cleanup(void); | ||
| 38 | |||
| 39 | extern void* bcom_sram_alloc(int size, int align, phys_addr_t *phys); | ||
| 40 | extern void bcom_sram_free(void *ptr); | ||
| 41 | |||
| 42 | static inline phys_addr_t bcom_sram_va2pa(void *va) { | ||
| 43 | return bcom_sram->base_phys + | ||
| 44 | (unsigned long)(va - bcom_sram->base_virt); | ||
| 45 | } | ||
| 46 | |||
| 47 | static inline void *bcom_sram_pa2va(phys_addr_t pa) { | ||
| 48 | return bcom_sram->base_virt + | ||
| 49 | (unsigned long)(pa - bcom_sram->base_phys); | ||
| 50 | } | ||
| 51 | |||
| 52 | |||
| 53 | #endif /* __BESTCOMM_SRAM_H__ */ | ||
| 54 | |||
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index 0fbfb4646d1b..a78680a92dba 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
| @@ -244,7 +244,7 @@ static inline void fsnotify_open(struct file *file) | |||
| 244 | static inline void fsnotify_close(struct file *file) | 244 | static inline void fsnotify_close(struct file *file) |
| 245 | { | 245 | { |
| 246 | struct path *path = &file->f_path; | 246 | struct path *path = &file->f_path; |
| 247 | struct inode *inode = file->f_path.dentry->d_inode; | 247 | struct inode *inode = file_inode(file); |
| 248 | fmode_t mode = file->f_mode; | 248 | fmode_t mode = file->f_mode; |
| 249 | __u32 mask = (mode & FMODE_WRITE) ? FS_CLOSE_WRITE : FS_CLOSE_NOWRITE; | 249 | __u32 mask = (mode & FMODE_WRITE) ? FS_CLOSE_WRITE : FS_CLOSE_NOWRITE; |
| 250 | 250 | ||
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 79b8bba19363..9f3c275e053e 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
| @@ -231,6 +231,12 @@ static inline void part_pack_uuid(const u8 *uuid_str, u8 *to) | |||
| 231 | } | 231 | } |
| 232 | } | 232 | } |
| 233 | 233 | ||
| 234 | static inline int blk_part_pack_uuid(const u8 *uuid_str, u8 *to) | ||
| 235 | { | ||
| 236 | part_pack_uuid(uuid_str, to); | ||
| 237 | return 0; | ||
| 238 | } | ||
| 239 | |||
| 234 | static inline int disk_max_parts(struct gendisk *disk) | 240 | static inline int disk_max_parts(struct gendisk *disk) |
| 235 | { | 241 | { |
| 236 | if (disk->flags & GENHD_FL_EXT_DEVT) | 242 | if (disk->flags & GENHD_FL_EXT_DEVT) |
| @@ -718,6 +724,10 @@ static inline dev_t blk_lookup_devt(const char *name, int partno) | |||
| 718 | return devt; | 724 | return devt; |
| 719 | } | 725 | } |
| 720 | 726 | ||
| 727 | static inline int blk_part_pack_uuid(const u8 *uuid_str, u8 *to) | ||
| 728 | { | ||
| 729 | return -EINVAL; | ||
| 730 | } | ||
| 721 | #endif /* CONFIG_BLOCK */ | 731 | #endif /* CONFIG_BLOCK */ |
| 722 | 732 | ||
| 723 | #endif /* _LINUX_GENHD_H */ | 733 | #endif /* _LINUX_GENHD_H */ |
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index bfe665621536..f6c7ae3e223b 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h | |||
| @@ -94,24 +94,12 @@ static inline int gpio_request(unsigned gpio, const char *label) | |||
| 94 | return -ENOSYS; | 94 | return -ENOSYS; |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | static inline int devm_gpio_request(struct device *dev, unsigned gpio, | ||
| 98 | const char *label) | ||
| 99 | { | ||
| 100 | return -ENOSYS; | ||
| 101 | } | ||
| 102 | |||
| 103 | static inline int gpio_request_one(unsigned gpio, | 97 | static inline int gpio_request_one(unsigned gpio, |
| 104 | unsigned long flags, const char *label) | 98 | unsigned long flags, const char *label) |
| 105 | { | 99 | { |
| 106 | return -ENOSYS; | 100 | return -ENOSYS; |
| 107 | } | 101 | } |
| 108 | 102 | ||
| 109 | static inline int devm_gpio_request_one(struct device *dev, unsigned gpio, | ||
| 110 | unsigned long flags, const char *label) | ||
| 111 | { | ||
| 112 | return -ENOSYS; | ||
| 113 | } | ||
| 114 | |||
| 115 | static inline int gpio_request_array(const struct gpio *array, size_t num) | 103 | static inline int gpio_request_array(const struct gpio *array, size_t num) |
| 116 | { | 104 | { |
| 117 | return -ENOSYS; | 105 | return -ENOSYS; |
| @@ -125,14 +113,6 @@ static inline void gpio_free(unsigned gpio) | |||
| 125 | WARN_ON(1); | 113 | WARN_ON(1); |
| 126 | } | 114 | } |
| 127 | 115 | ||
| 128 | static inline void devm_gpio_free(struct device *dev, unsigned gpio) | ||
| 129 | { | ||
| 130 | might_sleep(); | ||
| 131 | |||
| 132 | /* GPIO can never have been requested */ | ||
| 133 | WARN_ON(1); | ||
| 134 | } | ||
| 135 | |||
| 136 | static inline void gpio_free_array(const struct gpio *array, size_t num) | 116 | static inline void gpio_free_array(const struct gpio *array, size_t num) |
| 137 | { | 117 | { |
| 138 | might_sleep(); | 118 | might_sleep(); |
| @@ -248,4 +228,12 @@ gpiochip_remove_pin_ranges(struct gpio_chip *chip) | |||
| 248 | 228 | ||
| 249 | #endif /* ! CONFIG_GENERIC_GPIO */ | 229 | #endif /* ! CONFIG_GENERIC_GPIO */ |
| 250 | 230 | ||
| 231 | struct device; | ||
| 232 | |||
| 233 | /* bindings for managed devices that want to request gpios */ | ||
| 234 | int devm_gpio_request(struct device *dev, unsigned gpio, const char *label); | ||
| 235 | int devm_gpio_request_one(struct device *dev, unsigned gpio, | ||
| 236 | unsigned long flags, const char *label); | ||
| 237 | void devm_gpio_free(struct device *dev, unsigned int gpio); | ||
| 238 | |||
| 251 | #endif /* __LINUX_GPIO_H */ | 239 | #endif /* __LINUX_GPIO_H */ |
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 29eb805ea4a6..c1d6555d2567 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
| @@ -118,10 +118,8 @@ | |||
| 118 | 118 | ||
| 119 | #ifdef CONFIG_PREEMPT_COUNT | 119 | #ifdef CONFIG_PREEMPT_COUNT |
| 120 | # define preemptible() (preempt_count() == 0 && !irqs_disabled()) | 120 | # define preemptible() (preempt_count() == 0 && !irqs_disabled()) |
| 121 | # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1) | ||
| 122 | #else | 121 | #else |
| 123 | # define preemptible() 0 | 122 | # define preemptible() 0 |
| 124 | # define IRQ_EXIT_OFFSET HARDIRQ_OFFSET | ||
| 125 | #endif | 123 | #endif |
| 126 | 124 | ||
| 127 | #if defined(CONFIG_SMP) || defined(CONFIG_GENERIC_HARDIRQS) | 125 | #if defined(CONFIG_SMP) || defined(CONFIG_GENERIC_HARDIRQS) |
diff --git a/include/linux/hashtable.h b/include/linux/hashtable.h index 227c62424f3c..a9df51f5d54c 100644 --- a/include/linux/hashtable.h +++ b/include/linux/hashtable.h | |||
| @@ -115,51 +115,50 @@ static inline void hash_del_rcu(struct hlist_node *node) | |||
| 115 | * hash_for_each - iterate over a hashtable | 115 | * hash_for_each - iterate over a hashtable |
| 116 | * @name: hashtable to iterate | 116 | * @name: hashtable to iterate |
| 117 | * @bkt: integer to use as bucket loop cursor | 117 | * @bkt: integer to use as bucket loop cursor |
| 118 | * @node: the &struct list_head to use as a loop cursor for each entry | ||
| 119 | * @obj: the type * to use as a loop cursor for each entry | 118 | * @obj: the type * to use as a loop cursor for each entry |
| 120 | * @member: the name of the hlist_node within the struct | 119 | * @member: the name of the hlist_node within the struct |
| 121 | */ | 120 | */ |
| 122 | #define hash_for_each(name, bkt, node, obj, member) \ | 121 | #define hash_for_each(name, bkt, obj, member) \ |
| 123 | for ((bkt) = 0, node = NULL; node == NULL && (bkt) < HASH_SIZE(name); (bkt)++)\ | 122 | for ((bkt) = 0, obj = NULL; obj == NULL && (bkt) < HASH_SIZE(name);\ |
| 124 | hlist_for_each_entry(obj, node, &name[bkt], member) | 123 | (bkt)++)\ |
| 124 | hlist_for_each_entry(obj, &name[bkt], member) | ||
| 125 | 125 | ||
| 126 | /** | 126 | /** |
| 127 | * hash_for_each_rcu - iterate over a rcu enabled hashtable | 127 | * hash_for_each_rcu - iterate over a rcu enabled hashtable |
| 128 | * @name: hashtable to iterate | 128 | * @name: hashtable to iterate |
| 129 | * @bkt: integer to use as bucket loop cursor | 129 | * @bkt: integer to use as bucket loop cursor |
| 130 | * @node: the &struct list_head to use as a loop cursor for each entry | ||
| 131 | * @obj: the type * to use as a loop cursor for each entry | 130 | * @obj: the type * to use as a loop cursor for each entry |
| 132 | * @member: the name of the hlist_node within the struct | 131 | * @member: the name of the hlist_node within the struct |
| 133 | */ | 132 | */ |
| 134 | #define hash_for_each_rcu(name, bkt, node, obj, member) \ | 133 | #define hash_for_each_rcu(name, bkt, obj, member) \ |
| 135 | for ((bkt) = 0, node = NULL; node == NULL && (bkt) < HASH_SIZE(name); (bkt)++)\ | 134 | for ((bkt) = 0, obj = NULL; obj == NULL && (bkt) < HASH_SIZE(name);\ |
| 136 | hlist_for_each_entry_rcu(obj, node, &name[bkt], member) | 135 | (bkt)++)\ |
| 136 | hlist_for_each_entry_rcu(obj, &name[bkt], member) | ||
| 137 | 137 | ||
| 138 | /** | 138 | /** |
| 139 | * hash_for_each_safe - iterate over a hashtable safe against removal of | 139 | * hash_for_each_safe - iterate over a hashtable safe against removal of |
| 140 | * hash entry | 140 | * hash entry |
| 141 | * @name: hashtable to iterate | 141 | * @name: hashtable to iterate |
| 142 | * @bkt: integer to use as bucket loop cursor | 142 | * @bkt: integer to use as bucket loop cursor |
| 143 | * @node: the &struct list_head to use as a loop cursor for each entry | ||
| 144 | * @tmp: a &struct used for temporary storage | 143 | * @tmp: a &struct used for temporary storage |
| 145 | * @obj: the type * to use as a loop cursor for each entry | 144 | * @obj: the type * to use as a loop cursor for each entry |
| 146 | * @member: the name of the hlist_node within the struct | 145 | * @member: the name of the hlist_node within the struct |
| 147 | */ | 146 | */ |
| 148 | #define hash_for_each_safe(name, bkt, node, tmp, obj, member) \ | 147 | #define hash_for_each_safe(name, bkt, tmp, obj, member) \ |
| 149 | for ((bkt) = 0, node = NULL; node == NULL && (bkt) < HASH_SIZE(name); (bkt)++)\ | 148 | for ((bkt) = 0, obj = NULL; obj == NULL && (bkt) < HASH_SIZE(name);\ |
| 150 | hlist_for_each_entry_safe(obj, node, tmp, &name[bkt], member) | 149 | (bkt)++)\ |
| 150 | hlist_for_each_entry_safe(obj, tmp, &name[bkt], member) | ||
| 151 | 151 | ||
| 152 | /** | 152 | /** |
| 153 | * hash_for_each_possible - iterate over all possible objects hashing to the | 153 | * hash_for_each_possible - iterate over all possible objects hashing to the |
| 154 | * same bucket | 154 | * same bucket |
| 155 | * @name: hashtable to iterate | 155 | * @name: hashtable to iterate |
| 156 | * @obj: the type * to use as a loop cursor for each entry | 156 | * @obj: the type * to use as a loop cursor for each entry |
| 157 | * @node: the &struct list_head to use as a loop cursor for each entry | ||
| 158 | * @member: the name of the hlist_node within the struct | 157 | * @member: the name of the hlist_node within the struct |
| 159 | * @key: the key of the objects to iterate over | 158 | * @key: the key of the objects to iterate over |
| 160 | */ | 159 | */ |
| 161 | #define hash_for_each_possible(name, obj, node, member, key) \ | 160 | #define hash_for_each_possible(name, obj, member, key) \ |
| 162 | hlist_for_each_entry(obj, node, &name[hash_min(key, HASH_BITS(name))], member) | 161 | hlist_for_each_entry(obj, &name[hash_min(key, HASH_BITS(name))], member) |
| 163 | 162 | ||
| 164 | /** | 163 | /** |
| 165 | * hash_for_each_possible_rcu - iterate over all possible objects hashing to the | 164 | * hash_for_each_possible_rcu - iterate over all possible objects hashing to the |
| @@ -167,25 +166,24 @@ static inline void hash_del_rcu(struct hlist_node *node) | |||
| 167 | * in a rcu enabled hashtable | 166 | * in a rcu enabled hashtable |
| 168 | * @name: hashtable to iterate | 167 | * @name: hashtable to iterate |
| 169 | * @obj: the type * to use as a loop cursor for each entry | 168 | * @obj: the type * to use as a loop cursor for each entry |
| 170 | * @node: the &struct list_head to use as a loop cursor for each entry | ||
| 171 | * @member: the name of the hlist_node within the struct | 169 | * @member: the name of the hlist_node within the struct |
| 172 | * @key: the key of the objects to iterate over | 170 | * @key: the key of the objects to iterate over |
| 173 | */ | 171 | */ |
| 174 | #define hash_for_each_possible_rcu(name, obj, node, member, key) \ | 172 | #define hash_for_each_possible_rcu(name, obj, member, key) \ |
| 175 | hlist_for_each_entry_rcu(obj, node, &name[hash_min(key, HASH_BITS(name))], member) | 173 | hlist_for_each_entry_rcu(obj, &name[hash_min(key, HASH_BITS(name))],\ |
| 174 | member) | ||
| 176 | 175 | ||
| 177 | /** | 176 | /** |
| 178 | * hash_for_each_possible_safe - iterate over all possible objects hashing to the | 177 | * hash_for_each_possible_safe - iterate over all possible objects hashing to the |
| 179 | * same bucket safe against removals | 178 | * same bucket safe against removals |
| 180 | * @name: hashtable to iterate | 179 | * @name: hashtable to iterate |
| 181 | * @obj: the type * to use as a loop cursor for each entry | 180 | * @obj: the type * to use as a loop cursor for each entry |
| 182 | * @node: the &struct list_head to use as a loop cursor for each entry | ||
| 183 | * @tmp: a &struct used for temporary storage | 181 | * @tmp: a &struct used for temporary storage |
| 184 | * @member: the name of the hlist_node within the struct | 182 | * @member: the name of the hlist_node within the struct |
| 185 | * @key: the key of the objects to iterate over | 183 | * @key: the key of the objects to iterate over |
| 186 | */ | 184 | */ |
| 187 | #define hash_for_each_possible_safe(name, obj, node, tmp, member, key) \ | 185 | #define hash_for_each_possible_safe(name, obj, tmp, member, key) \ |
| 188 | hlist_for_each_entry_safe(obj, node, tmp, \ | 186 | hlist_for_each_entry_safe(obj, tmp,\ |
| 189 | &name[hash_min(key, HASH_BITS(name))], member) | 187 | &name[hash_min(key, HASH_BITS(name))], member) |
| 190 | 188 | ||
| 191 | 189 | ||
diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h new file mode 100644 index 000000000000..3b589440ecfe --- /dev/null +++ b/include/linux/hdmi.h | |||
| @@ -0,0 +1,231 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2012 Avionic Design GmbH | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License version 2 as | ||
| 6 | * published by the Free Software Foundation. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef __LINUX_HDMI_H_ | ||
| 10 | #define __LINUX_HDMI_H_ | ||
| 11 | |||
| 12 | #include <linux/types.h> | ||
| 13 | |||
| 14 | enum hdmi_infoframe_type { | ||
| 15 | HDMI_INFOFRAME_TYPE_VENDOR = 0x81, | ||
| 16 | HDMI_INFOFRAME_TYPE_AVI = 0x82, | ||
| 17 | HDMI_INFOFRAME_TYPE_SPD = 0x83, | ||
| 18 | HDMI_INFOFRAME_TYPE_AUDIO = 0x84, | ||
| 19 | }; | ||
| 20 | |||
| 21 | #define HDMI_INFOFRAME_HEADER_SIZE 4 | ||
| 22 | #define HDMI_AVI_INFOFRAME_SIZE 13 | ||
| 23 | #define HDMI_SPD_INFOFRAME_SIZE 25 | ||
| 24 | #define HDMI_AUDIO_INFOFRAME_SIZE 10 | ||
| 25 | |||
| 26 | enum hdmi_colorspace { | ||
| 27 | HDMI_COLORSPACE_RGB, | ||
| 28 | HDMI_COLORSPACE_YUV422, | ||
| 29 | HDMI_COLORSPACE_YUV444, | ||
| 30 | }; | ||
| 31 | |||
| 32 | enum hdmi_scan_mode { | ||
| 33 | HDMI_SCAN_MODE_NONE, | ||
| 34 | HDMI_SCAN_MODE_OVERSCAN, | ||
| 35 | HDMI_SCAN_MODE_UNDERSCAN, | ||
| 36 | }; | ||
| 37 | |||
| 38 | enum hdmi_colorimetry { | ||
| 39 | HDMI_COLORIMETRY_NONE, | ||
| 40 | HDMI_COLORIMETRY_ITU_601, | ||
| 41 | HDMI_COLORIMETRY_ITU_709, | ||
| 42 | HDMI_COLORIMETRY_EXTENDED, | ||
| 43 | }; | ||
| 44 | |||
| 45 | enum hdmi_picture_aspect { | ||
| 46 | HDMI_PICTURE_ASPECT_NONE, | ||
| 47 | HDMI_PICTURE_ASPECT_4_3, | ||
| 48 | HDMI_PICTURE_ASPECT_16_9, | ||
| 49 | }; | ||
| 50 | |||
| 51 | enum hdmi_active_aspect { | ||
| 52 | HDMI_ACTIVE_ASPECT_16_9_TOP = 2, | ||
| 53 | HDMI_ACTIVE_ASPECT_14_9_TOP = 3, | ||
| 54 | HDMI_ACTIVE_ASPECT_16_9_CENTER = 4, | ||
| 55 | HDMI_ACTIVE_ASPECT_PICTURE = 8, | ||
| 56 | HDMI_ACTIVE_ASPECT_4_3 = 9, | ||
| 57 | HDMI_ACTIVE_ASPECT_16_9 = 10, | ||
| 58 | HDMI_ACTIVE_ASPECT_14_9 = 11, | ||
| 59 | HDMI_ACTIVE_ASPECT_4_3_SP_14_9 = 13, | ||
| 60 | HDMI_ACTIVE_ASPECT_16_9_SP_14_9 = 14, | ||
| 61 | HDMI_ACTIVE_ASPECT_16_9_SP_4_3 = 15, | ||
| 62 | }; | ||
| 63 | |||
| 64 | enum hdmi_extended_colorimetry { | ||
| 65 | HDMI_EXTENDED_COLORIMETRY_XV_YCC_601, | ||
| 66 | HDMI_EXTENDED_COLORIMETRY_XV_YCC_709, | ||
| 67 | HDMI_EXTENDED_COLORIMETRY_S_YCC_601, | ||
| 68 | HDMI_EXTENDED_COLORIMETRY_ADOBE_YCC_601, | ||
| 69 | HDMI_EXTENDED_COLORIMETRY_ADOBE_RGB, | ||
| 70 | }; | ||
| 71 | |||
| 72 | enum hdmi_quantization_range { | ||
| 73 | HDMI_QUANTIZATION_RANGE_DEFAULT, | ||
| 74 | HDMI_QUANTIZATION_RANGE_LIMITED, | ||
| 75 | HDMI_QUANTIZATION_RANGE_FULL, | ||
| 76 | }; | ||
| 77 | |||
| 78 | /* non-uniform picture scaling */ | ||
| 79 | enum hdmi_nups { | ||
| 80 | HDMI_NUPS_UNKNOWN, | ||
| 81 | HDMI_NUPS_HORIZONTAL, | ||
| 82 | HDMI_NUPS_VERTICAL, | ||
| 83 | HDMI_NUPS_BOTH, | ||
| 84 | }; | ||
| 85 | |||
| 86 | enum hdmi_ycc_quantization_range { | ||
| 87 | HDMI_YCC_QUANTIZATION_RANGE_LIMITED, | ||
| 88 | HDMI_YCC_QUANTIZATION_RANGE_FULL, | ||
| 89 | }; | ||
| 90 | |||
| 91 | enum hdmi_content_type { | ||
| 92 | HDMI_CONTENT_TYPE_NONE, | ||
| 93 | HDMI_CONTENT_TYPE_PHOTO, | ||
| 94 | HDMI_CONTENT_TYPE_CINEMA, | ||
| 95 | HDMI_CONTENT_TYPE_GAME, | ||
| 96 | }; | ||
| 97 | |||
| 98 | struct hdmi_avi_infoframe { | ||
| 99 | enum hdmi_infoframe_type type; | ||
| 100 | unsigned char version; | ||
| 101 | unsigned char length; | ||
| 102 | enum hdmi_colorspace colorspace; | ||
| 103 | bool active_info_valid; | ||
| 104 | bool horizontal_bar_valid; | ||
| 105 | bool vertical_bar_valid; | ||
| 106 | enum hdmi_scan_mode scan_mode; | ||
| 107 | enum hdmi_colorimetry colorimetry; | ||
| 108 | enum hdmi_picture_aspect picture_aspect; | ||
| 109 | enum hdmi_active_aspect active_aspect; | ||
| 110 | bool itc; | ||
| 111 | enum hdmi_extended_colorimetry extended_colorimetry; | ||
| 112 | enum hdmi_quantization_range quantization_range; | ||
| 113 | enum hdmi_nups nups; | ||
| 114 | unsigned char video_code; | ||
| 115 | enum hdmi_ycc_quantization_range ycc_quantization_range; | ||
| 116 | enum hdmi_content_type content_type; | ||
| 117 | unsigned char pixel_repeat; | ||
| 118 | unsigned short top_bar; | ||
| 119 | unsigned short bottom_bar; | ||
| 120 | unsigned short left_bar; | ||
| 121 | unsigned short right_bar; | ||
| 122 | }; | ||
| 123 | |||
| 124 | int hdmi_avi_infoframe_init(struct hdmi_avi_infoframe *frame); | ||
| 125 | ssize_t hdmi_avi_infoframe_pack(struct hdmi_avi_infoframe *frame, void *buffer, | ||
| 126 | size_t size); | ||
| 127 | |||
| 128 | enum hdmi_spd_sdi { | ||
| 129 | HDMI_SPD_SDI_UNKNOWN, | ||
| 130 | HDMI_SPD_SDI_DSTB, | ||
| 131 | HDMI_SPD_SDI_DVDP, | ||
| 132 | HDMI_SPD_SDI_DVHS, | ||
| 133 | HDMI_SPD_SDI_HDDVR, | ||
| 134 | HDMI_SPD_SDI_DVC, | ||
| 135 | HDMI_SPD_SDI_DSC, | ||
| 136 | HDMI_SPD_SDI_VCD, | ||
| 137 | HDMI_SPD_SDI_GAME, | ||
| 138 | HDMI_SPD_SDI_PC, | ||
| 139 | HDMI_SPD_SDI_BD, | ||
| 140 | HDMI_SPD_SDI_SACD, | ||
| 141 | HDMI_SPD_SDI_HDDVD, | ||
| 142 | HDMI_SPD_SDI_PMP, | ||
| 143 | }; | ||
| 144 | |||
| 145 | struct hdmi_spd_infoframe { | ||
| 146 | enum hdmi_infoframe_type type; | ||
| 147 | unsigned char version; | ||
| 148 | unsigned char length; | ||
| 149 | char vendor[8]; | ||
| 150 | char product[16]; | ||
| 151 | enum hdmi_spd_sdi sdi; | ||
| 152 | }; | ||
| 153 | |||
| 154 | int hdmi_spd_infoframe_init(struct hdmi_spd_infoframe *frame, | ||
| 155 | const char *vendor, const char *product); | ||
| 156 | ssize_t hdmi_spd_infoframe_pack(struct hdmi_spd_infoframe *frame, void *buffer, | ||
| 157 | size_t size); | ||
| 158 | |||
| 159 | enum hdmi_audio_coding_type { | ||
| 160 | HDMI_AUDIO_CODING_TYPE_STREAM, | ||
| 161 | HDMI_AUDIO_CODING_TYPE_PCM, | ||
| 162 | HDMI_AUDIO_CODING_TYPE_AC3, | ||
| 163 | HDMI_AUDIO_CODING_TYPE_MPEG1, | ||
| 164 | HDMI_AUDIO_CODING_TYPE_MP3, | ||
| 165 | HDMI_AUDIO_CODING_TYPE_MPEG2, | ||
| 166 | HDMI_AUDIO_CODING_TYPE_AAC_LC, | ||
| 167 | HDMI_AUDIO_CODING_TYPE_DTS, | ||
| 168 | HDMI_AUDIO_CODING_TYPE_ATRAC, | ||
| 169 | HDMI_AUDIO_CODING_TYPE_DSD, | ||
| 170 | HDMI_AUDIO_CODING_TYPE_EAC3, | ||
| 171 | HDMI_AUDIO_CODING_TYPE_DTS_HD, | ||
| 172 | HDMI_AUDIO_CODING_TYPE_MLP, | ||
| 173 | HDMI_AUDIO_CODING_TYPE_DST, | ||
| 174 | HDMI_AUDIO_CODING_TYPE_WMA_PRO, | ||
| 175 | }; | ||
| 176 | |||
| 177 | enum hdmi_audio_sample_size { | ||
| 178 | HDMI_AUDIO_SAMPLE_SIZE_STREAM, | ||
| 179 | HDMI_AUDIO_SAMPLE_SIZE_16, | ||
| 180 | HDMI_AUDIO_SAMPLE_SIZE_20, | ||
| 181 | HDMI_AUDIO_SAMPLE_SIZE_24, | ||
| 182 | }; | ||
| 183 | |||
| 184 | enum hdmi_audio_sample_frequency { | ||
| 185 | HDMI_AUDIO_SAMPLE_FREQUENCY_STREAM, | ||
| 186 | HDMI_AUDIO_SAMPLE_FREQUENCY_32000, | ||
| 187 | HDMI_AUDIO_SAMPLE_FREQUENCY_44100, | ||
| 188 | HDMI_AUDIO_SAMPLE_FREQUENCY_48000, | ||
| 189 | HDMI_AUDIO_SAMPLE_FREQUENCY_88200, | ||
| 190 | HDMI_AUDIO_SAMPLE_FREQUENCY_96000, | ||
| 191 | HDMI_AUDIO_SAMPLE_FREQUENCY_176400, | ||
| 192 | HDMI_AUDIO_SAMPLE_FREQUENCY_192000, | ||
| 193 | }; | ||
| 194 | |||
| 195 | enum hdmi_audio_coding_type_ext { | ||
| 196 | HDMI_AUDIO_CODING_TYPE_EXT_STREAM, | ||
| 197 | HDMI_AUDIO_CODING_TYPE_EXT_HE_AAC, | ||
| 198 | HDMI_AUDIO_CODING_TYPE_EXT_HE_AAC_V2, | ||
| 199 | HDMI_AUDIO_CODING_TYPE_EXT_MPEG_SURROUND, | ||
| 200 | }; | ||
| 201 | |||
| 202 | struct hdmi_audio_infoframe { | ||
| 203 | enum hdmi_infoframe_type type; | ||
| 204 | unsigned char version; | ||
| 205 | unsigned char length; | ||
| 206 | unsigned char channels; | ||
| 207 | enum hdmi_audio_coding_type coding_type; | ||
| 208 | enum hdmi_audio_sample_size sample_size; | ||
| 209 | enum hdmi_audio_sample_frequency sample_frequency; | ||
| 210 | enum hdmi_audio_coding_type_ext coding_type_ext; | ||
| 211 | unsigned char channel_allocation; | ||
| 212 | unsigned char level_shift_value; | ||
| 213 | bool downmix_inhibit; | ||
| 214 | |||
| 215 | }; | ||
| 216 | |||
| 217 | int hdmi_audio_infoframe_init(struct hdmi_audio_infoframe *frame); | ||
| 218 | ssize_t hdmi_audio_infoframe_pack(struct hdmi_audio_infoframe *frame, | ||
| 219 | void *buffer, size_t size); | ||
| 220 | |||
| 221 | struct hdmi_vendor_infoframe { | ||
| 222 | enum hdmi_infoframe_type type; | ||
| 223 | unsigned char version; | ||
| 224 | unsigned char length; | ||
| 225 | u8 data[27]; | ||
| 226 | }; | ||
| 227 | |||
| 228 | ssize_t hdmi_vendor_infoframe_pack(struct hdmi_vendor_infoframe *frame, | ||
| 229 | void *buffer, size_t size); | ||
| 230 | |||
| 231 | #endif /* _DRM_HDMI_H */ | ||
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index ef788b5b4a35..7fb31da45d03 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h | |||
| @@ -219,12 +219,6 @@ static inline void zero_user(struct page *page, | |||
| 219 | zero_user_segments(page, start, start + size, 0, 0); | 219 | zero_user_segments(page, start, start + size, 0, 0); |
| 220 | } | 220 | } |
| 221 | 221 | ||
| 222 | static inline void __deprecated memclear_highpage_flush(struct page *page, | ||
| 223 | unsigned int offset, unsigned int size) | ||
| 224 | { | ||
| 225 | zero_user(page, offset, size); | ||
| 226 | } | ||
| 227 | |||
| 228 | #ifndef __HAVE_ARCH_COPY_USER_HIGHPAGE | 222 | #ifndef __HAVE_ARCH_COPY_USER_HIGHPAGE |
| 229 | 223 | ||
| 230 | static inline void copy_user_highpage(struct page *to, struct page *from, | 224 | static inline void copy_user_highpage(struct page *to, struct page *from, |
diff --git a/include/linux/hsi/hsi.h b/include/linux/hsi/hsi.h index 56fae865e272..0dca785288cf 100644 --- a/include/linux/hsi/hsi.h +++ b/include/linux/hsi/hsi.h | |||
| @@ -121,9 +121,9 @@ static inline int hsi_register_board_info(struct hsi_board_info const *info, | |||
| 121 | * @device: Driver model representation of the device | 121 | * @device: Driver model representation of the device |
| 122 | * @tx_cfg: HSI TX configuration | 122 | * @tx_cfg: HSI TX configuration |
| 123 | * @rx_cfg: HSI RX configuration | 123 | * @rx_cfg: HSI RX configuration |
| 124 | * @e_handler: Callback for handling port events (RX Wake High/Low) | 124 | * e_handler: Callback for handling port events (RX Wake High/Low) |
| 125 | * @pclaimed: Keeps tracks if the clients claimed its associated HSI port | 125 | * pclaimed: Keeps tracks if the clients claimed its associated HSI port |
| 126 | * @nb: Notifier block for port events | 126 | * nb: Notifier block for port events |
| 127 | */ | 127 | */ |
| 128 | struct hsi_client { | 128 | struct hsi_client { |
| 129 | struct device device; | 129 | struct device device; |
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index 1d76f8ca90f0..ee1c244a62a1 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h | |||
| @@ -113,7 +113,7 @@ extern void __split_huge_page_pmd(struct vm_area_struct *vma, | |||
| 113 | do { \ | 113 | do { \ |
| 114 | pmd_t *____pmd = (__pmd); \ | 114 | pmd_t *____pmd = (__pmd); \ |
| 115 | anon_vma_lock_write(__anon_vma); \ | 115 | anon_vma_lock_write(__anon_vma); \ |
| 116 | anon_vma_unlock(__anon_vma); \ | 116 | anon_vma_unlock_write(__anon_vma); \ |
| 117 | BUG_ON(pmd_trans_splitting(*____pmd) || \ | 117 | BUG_ON(pmd_trans_splitting(*____pmd) || \ |
| 118 | pmd_trans_huge(*____pmd)); \ | 118 | pmd_trans_huge(*____pmd)); \ |
| 119 | } while (0) | 119 | } while (0) |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 0c80d3f57a5b..16e4e9a643fb 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
| @@ -43,9 +43,9 @@ int hugetlb_mempolicy_sysctl_handler(struct ctl_table *, int, | |||
| 43 | #endif | 43 | #endif |
| 44 | 44 | ||
| 45 | int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); | 45 | int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); |
| 46 | int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, | 46 | long follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, |
| 47 | struct page **, struct vm_area_struct **, | 47 | struct page **, struct vm_area_struct **, |
| 48 | unsigned long *, int *, int, unsigned int flags); | 48 | unsigned long *, unsigned long *, long, unsigned int); |
| 49 | void unmap_hugepage_range(struct vm_area_struct *, | 49 | void unmap_hugepage_range(struct vm_area_struct *, |
| 50 | unsigned long, unsigned long, struct page *); | 50 | unsigned long, unsigned long, struct page *); |
| 51 | void __unmap_hugepage_range_final(struct mmu_gather *tlb, | 51 | void __unmap_hugepage_range_final(struct mmu_gather *tlb, |
| @@ -281,7 +281,7 @@ static inline struct hstate *hstate_inode(struct inode *i) | |||
| 281 | 281 | ||
| 282 | static inline struct hstate *hstate_file(struct file *f) | 282 | static inline struct hstate *hstate_file(struct file *f) |
| 283 | { | 283 | { |
| 284 | return hstate_inode(f->f_dentry->d_inode); | 284 | return hstate_inode(file_inode(f)); |
| 285 | } | 285 | } |
| 286 | 286 | ||
| 287 | static inline struct hstate *hstate_vma(struct vm_area_struct *vma) | 287 | static inline struct hstate *hstate_vma(struct vm_area_struct *vma) |
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 1ff54b114efc..488debbef895 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
| @@ -39,51 +39,55 @@ | |||
| 39 | * address each module uses within a given i2c slave. | 39 | * address each module uses within a given i2c slave. |
| 40 | */ | 40 | */ |
| 41 | 41 | ||
| 42 | /* Module IDs for similar functionalities found in twl4030/twl6030 */ | ||
| 43 | enum twl_module_ids { | ||
| 44 | TWL_MODULE_USB, | ||
| 45 | TWL_MODULE_PIH, | ||
| 46 | TWL_MODULE_MAIN_CHARGE, | ||
| 47 | TWL_MODULE_PM_MASTER, | ||
| 48 | TWL_MODULE_PM_RECEIVER, | ||
| 49 | |||
| 50 | TWL_MODULE_RTC, | ||
| 51 | TWL_MODULE_PWM, | ||
| 52 | TWL_MODULE_LED, | ||
| 53 | TWL_MODULE_SECURED_REG, | ||
| 54 | |||
| 55 | TWL_MODULE_LAST, | ||
| 56 | }; | ||
| 57 | |||
| 58 | /* Modules only available in twl4030 series */ | ||
| 42 | enum twl4030_module_ids { | 59 | enum twl4030_module_ids { |
| 43 | TWL4030_MODULE_USB = 0, /* Slave 0 (i2c address 0x48) */ | 60 | TWL4030_MODULE_AUDIO_VOICE = TWL_MODULE_LAST, |
| 44 | TWL4030_MODULE_AUDIO_VOICE, /* Slave 1 (i2c address 0x49) */ | ||
| 45 | TWL4030_MODULE_GPIO, | 61 | TWL4030_MODULE_GPIO, |
| 46 | TWL4030_MODULE_INTBR, | 62 | TWL4030_MODULE_INTBR, |
| 47 | TWL4030_MODULE_PIH, | ||
| 48 | |||
| 49 | TWL4030_MODULE_TEST, | 63 | TWL4030_MODULE_TEST, |
| 50 | TWL4030_MODULE_KEYPAD, /* Slave 2 (i2c address 0x4a) */ | 64 | TWL4030_MODULE_KEYPAD, |
| 65 | |||
| 51 | TWL4030_MODULE_MADC, | 66 | TWL4030_MODULE_MADC, |
| 52 | TWL4030_MODULE_INTERRUPTS, | 67 | TWL4030_MODULE_INTERRUPTS, |
| 53 | TWL4030_MODULE_LED, | ||
| 54 | |||
| 55 | TWL4030_MODULE_MAIN_CHARGE, | ||
| 56 | TWL4030_MODULE_PRECHARGE, | 68 | TWL4030_MODULE_PRECHARGE, |
| 57 | TWL4030_MODULE_PWM0, | 69 | TWL4030_MODULE_BACKUP, |
| 58 | TWL4030_MODULE_PWM1, | 70 | TWL4030_MODULE_INT, |
| 59 | TWL4030_MODULE_PWMA, | ||
| 60 | 71 | ||
| 61 | TWL4030_MODULE_PWMB, | ||
| 62 | TWL5031_MODULE_ACCESSORY, | 72 | TWL5031_MODULE_ACCESSORY, |
| 63 | TWL5031_MODULE_INTERRUPTS, | 73 | TWL5031_MODULE_INTERRUPTS, |
| 64 | TWL4030_MODULE_BACKUP, /* Slave 3 (i2c address 0x4b) */ | ||
| 65 | TWL4030_MODULE_INT, | ||
| 66 | 74 | ||
| 67 | TWL4030_MODULE_PM_MASTER, | ||
| 68 | TWL4030_MODULE_PM_RECEIVER, | ||
| 69 | TWL4030_MODULE_RTC, | ||
| 70 | TWL4030_MODULE_SECURED_REG, | ||
| 71 | TWL4030_MODULE_LAST, | 75 | TWL4030_MODULE_LAST, |
| 72 | }; | 76 | }; |
| 73 | 77 | ||
| 74 | /* Similar functionalities implemented in TWL4030/6030 */ | 78 | /* Modules only available in twl6030 series */ |
| 75 | #define TWL_MODULE_USB TWL4030_MODULE_USB | 79 | enum twl6030_module_ids { |
| 76 | #define TWL_MODULE_PIH TWL4030_MODULE_PIH | 80 | TWL6030_MODULE_ID0 = TWL_MODULE_LAST, |
| 77 | #define TWL_MODULE_MAIN_CHARGE TWL4030_MODULE_MAIN_CHARGE | 81 | TWL6030_MODULE_ID1, |
| 78 | #define TWL_MODULE_PM_MASTER TWL4030_MODULE_PM_MASTER | 82 | TWL6030_MODULE_ID2, |
| 79 | #define TWL_MODULE_PM_RECEIVER TWL4030_MODULE_PM_RECEIVER | 83 | TWL6030_MODULE_GPADC, |
| 80 | #define TWL_MODULE_RTC TWL4030_MODULE_RTC | 84 | TWL6030_MODULE_GASGAUGE, |
| 81 | #define TWL_MODULE_PWM TWL4030_MODULE_PWM0 | 85 | |
| 82 | #define TWL_MODULE_LED TWL4030_MODULE_LED | 86 | TWL6030_MODULE_LAST, |
| 87 | }; | ||
| 83 | 88 | ||
| 84 | #define TWL6030_MODULE_ID0 13 | 89 | /* Until the clients has been converted to use TWL_MODULE_LED */ |
| 85 | #define TWL6030_MODULE_ID1 14 | 90 | #define TWL4030_MODULE_LED TWL_MODULE_LED |
| 86 | #define TWL6030_MODULE_ID2 15 | ||
| 87 | 91 | ||
| 88 | #define GPIO_INTR_OFFSET 0 | 92 | #define GPIO_INTR_OFFSET 0 |
| 89 | #define KEYPAD_INTR_OFFSET 1 | 93 | #define KEYPAD_INTR_OFFSET 1 |
| @@ -171,20 +175,22 @@ TWL_CLASS_IS(4030, TWL4030_CLASS_ID) | |||
| 171 | TWL_CLASS_IS(6030, TWL6030_CLASS_ID) | 175 | TWL_CLASS_IS(6030, TWL6030_CLASS_ID) |
| 172 | 176 | ||
| 173 | /* | 177 | /* |
| 174 | * Read and write single 8-bit registers | ||
| 175 | */ | ||
| 176 | int twl_i2c_write_u8(u8 mod_no, u8 val, u8 reg); | ||
| 177 | int twl_i2c_read_u8(u8 mod_no, u8 *val, u8 reg); | ||
| 178 | |||
| 179 | /* | ||
| 180 | * Read and write several 8-bit registers at once. | 178 | * Read and write several 8-bit registers at once. |
| 181 | * | ||
| 182 | * IMPORTANT: For twl_i2c_write(), allocate num_bytes + 1 | ||
| 183 | * for the value, and populate your data starting at offset 1. | ||
| 184 | */ | 179 | */ |
| 185 | int twl_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); | 180 | int twl_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); |
| 186 | int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); | 181 | int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); |
| 187 | 182 | ||
| 183 | /* | ||
| 184 | * Read and write single 8-bit registers | ||
| 185 | */ | ||
| 186 | static inline int twl_i2c_write_u8(u8 mod_no, u8 val, u8 reg) { | ||
| 187 | return twl_i2c_write(mod_no, &val, reg, 1); | ||
| 188 | } | ||
| 189 | |||
| 190 | static inline int twl_i2c_read_u8(u8 mod_no, u8 *val, u8 reg) { | ||
| 191 | return twl_i2c_read(mod_no, val, reg, 1); | ||
| 192 | } | ||
| 193 | |||
| 188 | int twl_get_type(void); | 194 | int twl_get_type(void); |
| 189 | int twl_get_version(void); | 195 | int twl_get_version(void); |
| 190 | int twl_get_hfclk_rate(void); | 196 | int twl_get_hfclk_rate(void); |
diff --git a/include/linux/idr.h b/include/linux/idr.h index de7e190f1af4..a6f38b5c34e4 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h | |||
| @@ -17,69 +17,40 @@ | |||
| 17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
| 18 | #include <linux/rcupdate.h> | 18 | #include <linux/rcupdate.h> |
| 19 | 19 | ||
| 20 | #if BITS_PER_LONG == 32 | 20 | /* |
| 21 | # define IDR_BITS 5 | 21 | * We want shallower trees and thus more bits covered at each layer. 8 |
| 22 | # define IDR_FULL 0xfffffffful | 22 | * bits gives us large enough first layer for most use cases and maximum |
| 23 | /* We can only use two of the bits in the top level because there is | 23 | * tree depth of 4. Each idr_layer is slightly larger than 2k on 64bit and |
| 24 | only one possible bit in the top level (5 bits * 7 levels = 35 | 24 | * 1k on 32bit. |
| 25 | bits, but you only use 31 bits in the id). */ | 25 | */ |
| 26 | # define TOP_LEVEL_FULL (IDR_FULL >> 30) | 26 | #define IDR_BITS 8 |
| 27 | #elif BITS_PER_LONG == 64 | ||
| 28 | # define IDR_BITS 6 | ||
| 29 | # define IDR_FULL 0xfffffffffffffffful | ||
| 30 | /* We can only use two of the bits in the top level because there is | ||
| 31 | only one possible bit in the top level (6 bits * 6 levels = 36 | ||
| 32 | bits, but you only use 31 bits in the id). */ | ||
| 33 | # define TOP_LEVEL_FULL (IDR_FULL >> 62) | ||
| 34 | #else | ||
| 35 | # error "BITS_PER_LONG is not 32 or 64" | ||
| 36 | #endif | ||
| 37 | |||
| 38 | #define IDR_SIZE (1 << IDR_BITS) | 27 | #define IDR_SIZE (1 << IDR_BITS) |
| 39 | #define IDR_MASK ((1 << IDR_BITS)-1) | 28 | #define IDR_MASK ((1 << IDR_BITS)-1) |
| 40 | 29 | ||
| 41 | #define MAX_IDR_SHIFT (sizeof(int)*8 - 1) | ||
| 42 | #define MAX_IDR_BIT (1U << MAX_IDR_SHIFT) | ||
| 43 | #define MAX_IDR_MASK (MAX_IDR_BIT - 1) | ||
| 44 | |||
| 45 | /* Leave the possibility of an incomplete final layer */ | ||
| 46 | #define MAX_IDR_LEVEL ((MAX_IDR_SHIFT + IDR_BITS - 1) / IDR_BITS) | ||
| 47 | |||
| 48 | /* Number of id_layer structs to leave in free list */ | ||
| 49 | #define MAX_IDR_FREE (MAX_IDR_LEVEL * 2) | ||
| 50 | |||
| 51 | struct idr_layer { | 30 | struct idr_layer { |
| 52 | unsigned long bitmap; /* A zero bit means "space here" */ | 31 | int prefix; /* the ID prefix of this idr_layer */ |
| 32 | DECLARE_BITMAP(bitmap, IDR_SIZE); /* A zero bit means "space here" */ | ||
| 53 | struct idr_layer __rcu *ary[1<<IDR_BITS]; | 33 | struct idr_layer __rcu *ary[1<<IDR_BITS]; |
| 54 | int count; /* When zero, we can release it */ | 34 | int count; /* When zero, we can release it */ |
| 55 | int layer; /* distance from leaf */ | 35 | int layer; /* distance from leaf */ |
| 56 | struct rcu_head rcu_head; | 36 | struct rcu_head rcu_head; |
| 57 | }; | 37 | }; |
| 58 | 38 | ||
| 59 | struct idr { | 39 | struct idr { |
| 60 | struct idr_layer __rcu *top; | 40 | struct idr_layer __rcu *hint; /* the last layer allocated from */ |
| 61 | struct idr_layer *id_free; | 41 | struct idr_layer __rcu *top; |
| 62 | int layers; /* only valid without concurrent changes */ | 42 | struct idr_layer *id_free; |
| 63 | int id_free_cnt; | 43 | int layers; /* only valid w/o concurrent changes */ |
| 64 | spinlock_t lock; | 44 | int id_free_cnt; |
| 45 | spinlock_t lock; | ||
| 65 | }; | 46 | }; |
| 66 | 47 | ||
| 67 | #define IDR_INIT(name) \ | 48 | #define IDR_INIT(name) \ |
| 68 | { \ | 49 | { \ |
| 69 | .top = NULL, \ | 50 | .lock = __SPIN_LOCK_UNLOCKED(name.lock), \ |
| 70 | .id_free = NULL, \ | ||
| 71 | .layers = 0, \ | ||
| 72 | .id_free_cnt = 0, \ | ||
| 73 | .lock = __SPIN_LOCK_UNLOCKED(name.lock), \ | ||
| 74 | } | 51 | } |
| 75 | #define DEFINE_IDR(name) struct idr name = IDR_INIT(name) | 52 | #define DEFINE_IDR(name) struct idr name = IDR_INIT(name) |
| 76 | 53 | ||
| 77 | /* Actions to be taken after a call to _idr_sub_alloc */ | ||
| 78 | #define IDR_NEED_TO_GROW -2 | ||
| 79 | #define IDR_NOMORE_SPACE -3 | ||
| 80 | |||
| 81 | #define _idr_rc_to_errno(rc) ((rc) == -1 ? -EAGAIN : -ENOSPC) | ||
| 82 | |||
| 83 | /** | 54 | /** |
| 84 | * DOC: idr sync | 55 | * DOC: idr sync |
| 85 | * idr synchronization (stolen from radix-tree.h) | 56 | * idr synchronization (stolen from radix-tree.h) |
| @@ -101,19 +72,90 @@ struct idr { | |||
| 101 | * This is what we export. | 72 | * This is what we export. |
| 102 | */ | 73 | */ |
| 103 | 74 | ||
| 104 | void *idr_find(struct idr *idp, int id); | 75 | void *idr_find_slowpath(struct idr *idp, int id); |
| 105 | int idr_pre_get(struct idr *idp, gfp_t gfp_mask); | 76 | int idr_pre_get(struct idr *idp, gfp_t gfp_mask); |
| 106 | int idr_get_new(struct idr *idp, void *ptr, int *id); | ||
| 107 | int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); | 77 | int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); |
| 78 | void idr_preload(gfp_t gfp_mask); | ||
| 79 | int idr_alloc(struct idr *idp, void *ptr, int start, int end, gfp_t gfp_mask); | ||
| 108 | int idr_for_each(struct idr *idp, | 80 | int idr_for_each(struct idr *idp, |
| 109 | int (*fn)(int id, void *p, void *data), void *data); | 81 | int (*fn)(int id, void *p, void *data), void *data); |
| 110 | void *idr_get_next(struct idr *idp, int *nextid); | 82 | void *idr_get_next(struct idr *idp, int *nextid); |
| 111 | void *idr_replace(struct idr *idp, void *ptr, int id); | 83 | void *idr_replace(struct idr *idp, void *ptr, int id); |
| 112 | void idr_remove(struct idr *idp, int id); | 84 | void idr_remove(struct idr *idp, int id); |
| 113 | void idr_remove_all(struct idr *idp); | 85 | void idr_free(struct idr *idp, int id); |
| 114 | void idr_destroy(struct idr *idp); | 86 | void idr_destroy(struct idr *idp); |
| 115 | void idr_init(struct idr *idp); | 87 | void idr_init(struct idr *idp); |
| 116 | 88 | ||
| 89 | /** | ||
| 90 | * idr_preload_end - end preload section started with idr_preload() | ||
| 91 | * | ||
| 92 | * Each idr_preload() should be matched with an invocation of this | ||
| 93 | * function. See idr_preload() for details. | ||
| 94 | */ | ||
| 95 | static inline void idr_preload_end(void) | ||
| 96 | { | ||
| 97 | preempt_enable(); | ||
| 98 | } | ||
| 99 | |||
| 100 | /** | ||
| 101 | * idr_find - return pointer for given id | ||
| 102 | * @idp: idr handle | ||
| 103 | * @id: lookup key | ||
| 104 | * | ||
| 105 | * Return the pointer given the id it has been registered with. A %NULL | ||
| 106 | * return indicates that @id is not valid or you passed %NULL in | ||
| 107 | * idr_get_new(). | ||
| 108 | * | ||
| 109 | * This function can be called under rcu_read_lock(), given that the leaf | ||
| 110 | * pointers lifetimes are correctly managed. | ||
| 111 | */ | ||
| 112 | static inline void *idr_find(struct idr *idr, int id) | ||
| 113 | { | ||
| 114 | struct idr_layer *hint = rcu_dereference_raw(idr->hint); | ||
| 115 | |||
| 116 | if (hint && (id & ~IDR_MASK) == hint->prefix) | ||
| 117 | return rcu_dereference_raw(hint->ary[id & IDR_MASK]); | ||
| 118 | |||
| 119 | return idr_find_slowpath(idr, id); | ||
| 120 | } | ||
| 121 | |||
| 122 | /** | ||
| 123 | * idr_get_new - allocate new idr entry | ||
| 124 | * @idp: idr handle | ||
| 125 | * @ptr: pointer you want associated with the id | ||
| 126 | * @id: pointer to the allocated handle | ||
| 127 | * | ||
| 128 | * Simple wrapper around idr_get_new_above() w/ @starting_id of zero. | ||
| 129 | */ | ||
| 130 | static inline int idr_get_new(struct idr *idp, void *ptr, int *id) | ||
| 131 | { | ||
| 132 | return idr_get_new_above(idp, ptr, 0, id); | ||
| 133 | } | ||
| 134 | |||
| 135 | /** | ||
| 136 | * idr_for_each_entry - iterate over an idr's elements of a given type | ||
| 137 | * @idp: idr handle | ||
| 138 | * @entry: the type * to use as cursor | ||
| 139 | * @id: id entry's key | ||
| 140 | */ | ||
| 141 | #define idr_for_each_entry(idp, entry, id) \ | ||
| 142 | for (id = 0, entry = (typeof(entry))idr_get_next((idp), &(id)); \ | ||
| 143 | entry != NULL; \ | ||
| 144 | ++id, entry = (typeof(entry))idr_get_next((idp), &(id))) | ||
| 145 | |||
| 146 | void __idr_remove_all(struct idr *idp); /* don't use */ | ||
| 147 | |||
| 148 | /** | ||
| 149 | * idr_remove_all - remove all ids from the given idr tree | ||
| 150 | * @idp: idr handle | ||
| 151 | * | ||
| 152 | * If you're trying to destroy @idp, calling idr_destroy() is enough. | ||
| 153 | * This is going away. Don't use. | ||
| 154 | */ | ||
| 155 | static inline void __deprecated idr_remove_all(struct idr *idp) | ||
| 156 | { | ||
| 157 | __idr_remove_all(idp); | ||
| 158 | } | ||
| 117 | 159 | ||
| 118 | /* | 160 | /* |
| 119 | * IDA - IDR based id allocator, use when translation from id to | 161 | * IDA - IDR based id allocator, use when translation from id to |
| @@ -136,12 +178,11 @@ struct ida { | |||
| 136 | struct ida_bitmap *free_bitmap; | 178 | struct ida_bitmap *free_bitmap; |
| 137 | }; | 179 | }; |
| 138 | 180 | ||
| 139 | #define IDA_INIT(name) { .idr = IDR_INIT(name), .free_bitmap = NULL, } | 181 | #define IDA_INIT(name) { .idr = IDR_INIT((name).idr), .free_bitmap = NULL, } |
| 140 | #define DEFINE_IDA(name) struct ida name = IDA_INIT(name) | 182 | #define DEFINE_IDA(name) struct ida name = IDA_INIT(name) |
| 141 | 183 | ||
| 142 | int ida_pre_get(struct ida *ida, gfp_t gfp_mask); | 184 | int ida_pre_get(struct ida *ida, gfp_t gfp_mask); |
| 143 | int ida_get_new_above(struct ida *ida, int starting_id, int *p_id); | 185 | int ida_get_new_above(struct ida *ida, int starting_id, int *p_id); |
| 144 | int ida_get_new(struct ida *ida, int *p_id); | ||
| 145 | void ida_remove(struct ida *ida, int id); | 186 | void ida_remove(struct ida *ida, int id); |
| 146 | void ida_destroy(struct ida *ida); | 187 | void ida_destroy(struct ida *ida); |
| 147 | void ida_init(struct ida *ida); | 188 | void ida_init(struct ida *ida); |
| @@ -150,17 +191,18 @@ int ida_simple_get(struct ida *ida, unsigned int start, unsigned int end, | |||
| 150 | gfp_t gfp_mask); | 191 | gfp_t gfp_mask); |
| 151 | void ida_simple_remove(struct ida *ida, unsigned int id); | 192 | void ida_simple_remove(struct ida *ida, unsigned int id); |
| 152 | 193 | ||
| 153 | void __init idr_init_cache(void); | ||
| 154 | |||
| 155 | /** | 194 | /** |
| 156 | * idr_for_each_entry - iterate over an idr's elements of a given type | 195 | * ida_get_new - allocate new ID |
| 157 | * @idp: idr handle | 196 | * @ida: idr handle |
| 158 | * @entry: the type * to use as cursor | 197 | * @p_id: pointer to the allocated handle |
| 159 | * @id: id entry's key | 198 | * |
| 199 | * Simple wrapper around ida_get_new_above() w/ @starting_id of zero. | ||
| 160 | */ | 200 | */ |
| 161 | #define idr_for_each_entry(idp, entry, id) \ | 201 | static inline int ida_get_new(struct ida *ida, int *p_id) |
| 162 | for (id = 0, entry = (typeof(entry))idr_get_next((idp), &(id)); \ | 202 | { |
| 163 | entry != NULL; \ | 203 | return ida_get_new_above(ida, 0, p_id); |
| 164 | ++id, entry = (typeof(entry))idr_get_next((idp), &(id))) | 204 | } |
| 205 | |||
| 206 | void __init idr_init_cache(void); | ||
| 165 | 207 | ||
| 166 | #endif /* __IDR_H__ */ | 208 | #endif /* __IDR_H__ */ |
diff --git a/include/linux/if_team.h b/include/linux/if_team.h index 4648d8021244..cfd21e3d5506 100644 --- a/include/linux/if_team.h +++ b/include/linux/if_team.h | |||
| @@ -216,11 +216,10 @@ static inline struct hlist_head *team_port_index_hash(struct team *team, | |||
| 216 | static inline struct team_port *team_get_port_by_index(struct team *team, | 216 | static inline struct team_port *team_get_port_by_index(struct team *team, |
| 217 | int port_index) | 217 | int port_index) |
| 218 | { | 218 | { |
| 219 | struct hlist_node *p; | ||
| 220 | struct team_port *port; | 219 | struct team_port *port; |
| 221 | struct hlist_head *head = team_port_index_hash(team, port_index); | 220 | struct hlist_head *head = team_port_index_hash(team, port_index); |
| 222 | 221 | ||
| 223 | hlist_for_each_entry(port, p, head, hlist) | 222 | hlist_for_each_entry(port, head, hlist) |
| 224 | if (port->index == port_index) | 223 | if (port->index == port_index) |
| 225 | return port; | 224 | return port; |
| 226 | return NULL; | 225 | return NULL; |
| @@ -228,11 +227,10 @@ static inline struct team_port *team_get_port_by_index(struct team *team, | |||
| 228 | static inline struct team_port *team_get_port_by_index_rcu(struct team *team, | 227 | static inline struct team_port *team_get_port_by_index_rcu(struct team *team, |
| 229 | int port_index) | 228 | int port_index) |
| 230 | { | 229 | { |
| 231 | struct hlist_node *p; | ||
| 232 | struct team_port *port; | 230 | struct team_port *port; |
| 233 | struct hlist_head *head = team_port_index_hash(team, port_index); | 231 | struct hlist_head *head = team_port_index_hash(team, port_index); |
| 234 | 232 | ||
| 235 | hlist_for_each_entry_rcu(port, p, head, hlist) | 233 | hlist_for_each_entry_rcu(port, head, hlist) |
| 236 | if (port->index == port_index) | 234 | if (port->index == port_index) |
| 237 | return port; | 235 | return port; |
| 238 | return NULL; | 236 | return NULL; |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index d06cc5c8f58c..218a3b686d90 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
| @@ -331,7 +331,7 @@ static inline void vlan_set_encap_proto(struct sk_buff *skb, | |||
| 331 | struct vlan_hdr *vhdr) | 331 | struct vlan_hdr *vhdr) |
| 332 | { | 332 | { |
| 333 | __be16 proto; | 333 | __be16 proto; |
| 334 | unsigned char *rawp; | 334 | unsigned short *rawp; |
| 335 | 335 | ||
| 336 | /* | 336 | /* |
| 337 | * Was a VLAN packet, grab the encapsulated protocol, which the layer | 337 | * Was a VLAN packet, grab the encapsulated protocol, which the layer |
| @@ -344,8 +344,8 @@ static inline void vlan_set_encap_proto(struct sk_buff *skb, | |||
| 344 | return; | 344 | return; |
| 345 | } | 345 | } |
| 346 | 346 | ||
| 347 | rawp = skb->data; | 347 | rawp = (unsigned short *)(vhdr + 1); |
| 348 | if (*(unsigned short *) rawp == 0xFFFF) | 348 | if (*rawp == 0xFFFF) |
| 349 | /* | 349 | /* |
| 350 | * This is a magic hack to spot IPX packets. Older Novell | 350 | * This is a magic hack to spot IPX packets. Older Novell |
| 351 | * breaks the protocol design and runs IPX over 802.3 without | 351 | * breaks the protocol design and runs IPX over 802.3 without |
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index f3b99e1c1042..ba3b8a98a049 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h | |||
| @@ -58,8 +58,10 @@ struct iommu_domain { | |||
| 58 | #define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */ | 58 | #define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */ |
| 59 | 59 | ||
| 60 | enum iommu_attr { | 60 | enum iommu_attr { |
| 61 | DOMAIN_ATTR_MAX, | ||
| 62 | DOMAIN_ATTR_GEOMETRY, | 61 | DOMAIN_ATTR_GEOMETRY, |
| 62 | DOMAIN_ATTR_PAGING, | ||
| 63 | DOMAIN_ATTR_WINDOWS, | ||
| 64 | DOMAIN_ATTR_MAX, | ||
| 63 | }; | 65 | }; |
| 64 | 66 | ||
| 65 | #ifdef CONFIG_IOMMU_API | 67 | #ifdef CONFIG_IOMMU_API |
| @@ -100,6 +102,16 @@ struct iommu_ops { | |||
| 100 | enum iommu_attr attr, void *data); | 102 | enum iommu_attr attr, void *data); |
| 101 | int (*domain_set_attr)(struct iommu_domain *domain, | 103 | int (*domain_set_attr)(struct iommu_domain *domain, |
| 102 | enum iommu_attr attr, void *data); | 104 | enum iommu_attr attr, void *data); |
| 105 | |||
| 106 | /* Window handling functions */ | ||
| 107 | int (*domain_window_enable)(struct iommu_domain *domain, u32 wnd_nr, | ||
| 108 | phys_addr_t paddr, u64 size); | ||
| 109 | void (*domain_window_disable)(struct iommu_domain *domain, u32 wnd_nr); | ||
| 110 | /* Set the numer of window per domain */ | ||
| 111 | int (*domain_set_windows)(struct iommu_domain *domain, u32 w_count); | ||
| 112 | /* Get the numer of window per domain */ | ||
| 113 | u32 (*domain_get_windows)(struct iommu_domain *domain); | ||
| 114 | |||
| 103 | unsigned long pgsize_bitmap; | 115 | unsigned long pgsize_bitmap; |
| 104 | }; | 116 | }; |
| 105 | 117 | ||
| @@ -157,6 +169,10 @@ extern int iommu_domain_get_attr(struct iommu_domain *domain, enum iommu_attr, | |||
| 157 | extern int iommu_domain_set_attr(struct iommu_domain *domain, enum iommu_attr, | 169 | extern int iommu_domain_set_attr(struct iommu_domain *domain, enum iommu_attr, |
| 158 | void *data); | 170 | void *data); |
| 159 | 171 | ||
| 172 | /* Window handling function prototypes */ | ||
| 173 | extern int iommu_domain_window_enable(struct iommu_domain *domain, u32 wnd_nr, | ||
| 174 | phys_addr_t offset, u64 size); | ||
| 175 | extern void iommu_domain_window_disable(struct iommu_domain *domain, u32 wnd_nr); | ||
| 160 | /** | 176 | /** |
| 161 | * report_iommu_fault() - report about an IOMMU fault to the IOMMU framework | 177 | * report_iommu_fault() - report about an IOMMU fault to the IOMMU framework |
| 162 | * @domain: the iommu domain where the fault has happened | 178 | * @domain: the iommu domain where the fault has happened |
| @@ -239,6 +255,18 @@ static inline int iommu_unmap(struct iommu_domain *domain, unsigned long iova, | |||
| 239 | return -ENODEV; | 255 | return -ENODEV; |
| 240 | } | 256 | } |
| 241 | 257 | ||
| 258 | static inline int iommu_domain_window_enable(struct iommu_domain *domain, | ||
| 259 | u32 wnd_nr, phys_addr_t paddr, | ||
| 260 | u64 size) | ||
| 261 | { | ||
| 262 | return -ENODEV; | ||
| 263 | } | ||
| 264 | |||
| 265 | static inline void iommu_domain_window_disable(struct iommu_domain *domain, | ||
| 266 | u32 wnd_nr) | ||
| 267 | { | ||
| 268 | } | ||
| 269 | |||
| 242 | static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, | 270 | static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, |
| 243 | unsigned long iova) | 271 | unsigned long iova) |
| 244 | { | 272 | { |
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h index 1487e7906bbd..1f9f56e28851 100644 --- a/include/linux/ipmi.h +++ b/include/linux/ipmi.h | |||
| @@ -35,10 +35,6 @@ | |||
| 35 | 35 | ||
| 36 | #include <uapi/linux/ipmi.h> | 36 | #include <uapi/linux/ipmi.h> |
| 37 | 37 | ||
| 38 | |||
| 39 | /* | ||
| 40 | * The in-kernel interface. | ||
| 41 | */ | ||
| 42 | #include <linux/list.h> | 38 | #include <linux/list.h> |
| 43 | #include <linux/proc_fs.h> | 39 | #include <linux/proc_fs.h> |
| 44 | 40 | ||
diff --git a/include/linux/irqchip/metag-ext.h b/include/linux/irqchip/metag-ext.h new file mode 100644 index 000000000000..697af0fe7c5a --- /dev/null +++ b/include/linux/irqchip/metag-ext.h | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2012 Imagination Technologies | ||
| 3 | */ | ||
| 4 | |||
| 5 | #ifndef _LINUX_IRQCHIP_METAG_EXT_H_ | ||
| 6 | #define _LINUX_IRQCHIP_METAG_EXT_H_ | ||
| 7 | |||
| 8 | struct irq_data; | ||
| 9 | struct platform_device; | ||
| 10 | |||
| 11 | /* called from core irq code at init */ | ||
| 12 | int init_external_IRQ(void); | ||
| 13 | |||
| 14 | /* | ||
| 15 | * called from SoC init_irq() callback to dynamically indicate the lack of | ||
| 16 | * HWMASKEXT registers. | ||
| 17 | */ | ||
| 18 | void meta_intc_no_mask(void); | ||
| 19 | |||
| 20 | /* | ||
| 21 | * These allow SoCs to specialise the interrupt controller from their init_irq | ||
| 22 | * callbacks. | ||
| 23 | */ | ||
| 24 | |||
| 25 | extern struct irq_chip meta_intc_edge_chip; | ||
| 26 | extern struct irq_chip meta_intc_level_chip; | ||
| 27 | |||
| 28 | /* this should be called in the mask callback */ | ||
| 29 | void meta_intc_mask_irq_simple(struct irq_data *data); | ||
| 30 | /* this should be called in the unmask callback */ | ||
| 31 | void meta_intc_unmask_irq_simple(struct irq_data *data); | ||
| 32 | |||
| 33 | #endif /* _LINUX_IRQCHIP_METAG_EXT_H_ */ | ||
diff --git a/include/linux/irqchip/metag.h b/include/linux/irqchip/metag.h new file mode 100644 index 000000000000..4ebdfb3101ab --- /dev/null +++ b/include/linux/irqchip/metag.h | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2011 Imagination Technologies | ||
| 3 | */ | ||
| 4 | |||
| 5 | #ifndef _LINUX_IRQCHIP_METAG_H_ | ||
| 6 | #define _LINUX_IRQCHIP_METAG_H_ | ||
| 7 | |||
| 8 | #include <linux/errno.h> | ||
| 9 | |||
| 10 | #ifdef CONFIG_METAG_PERFCOUNTER_IRQS | ||
| 11 | extern int init_internal_IRQ(void); | ||
| 12 | extern int internal_irq_map(unsigned int hw); | ||
| 13 | #else | ||
| 14 | static inline int init_internal_IRQ(void) | ||
| 15 | { | ||
| 16 | return 0; | ||
| 17 | } | ||
| 18 | static inline int internal_irq_map(unsigned int hw) | ||
| 19 | { | ||
| 20 | return -EINVAL; | ||
| 21 | } | ||
| 22 | #endif | ||
| 23 | |||
| 24 | #endif /* _LINUX_IRQCHIP_METAG_H_ */ | ||
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index e30b66346942..50e5a5e6a712 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
| @@ -20,7 +20,6 @@ | |||
| 20 | #ifndef __KERNEL__ | 20 | #ifndef __KERNEL__ |
| 21 | #include "jfs_compat.h" | 21 | #include "jfs_compat.h" |
| 22 | #define JBD2_DEBUG | 22 | #define JBD2_DEBUG |
| 23 | #define jfs_debug jbd_debug | ||
| 24 | #else | 23 | #else |
| 25 | 24 | ||
| 26 | #include <linux/types.h> | 25 | #include <linux/types.h> |
| @@ -57,7 +56,7 @@ | |||
| 57 | * CONFIG_JBD2_DEBUG is on. | 56 | * CONFIG_JBD2_DEBUG is on. |
| 58 | */ | 57 | */ |
| 59 | #define JBD2_EXPENSIVE_CHECKING | 58 | #define JBD2_EXPENSIVE_CHECKING |
| 60 | extern u8 jbd2_journal_enable_debug; | 59 | extern ushort jbd2_journal_enable_debug; |
| 61 | 60 | ||
| 62 | #define jbd_debug(n, f, a...) \ | 61 | #define jbd_debug(n, f, a...) \ |
| 63 | do { \ | 62 | do { \ |
| @@ -397,35 +396,18 @@ struct jbd2_journal_handle | |||
| 397 | int h_err; | 396 | int h_err; |
| 398 | 397 | ||
| 399 | /* Flags [no locking] */ | 398 | /* Flags [no locking] */ |
| 400 | unsigned int h_sync:1; /* sync-on-close */ | 399 | unsigned int h_sync: 1; /* sync-on-close */ |
| 401 | unsigned int h_jdata:1; /* force data journaling */ | 400 | unsigned int h_jdata: 1; /* force data journaling */ |
| 402 | unsigned int h_aborted:1; /* fatal error on handle */ | 401 | unsigned int h_aborted: 1; /* fatal error on handle */ |
| 403 | unsigned int h_cowing:1; /* COWing block to snapshot */ | 402 | unsigned int h_type: 8; /* for handle statistics */ |
| 404 | 403 | unsigned int h_line_no: 16; /* for handle statistics */ | |
| 405 | /* Number of buffers requested by user: | ||
| 406 | * (before adding the COW credits factor) */ | ||
| 407 | unsigned int h_base_credits:14; | ||
| 408 | |||
| 409 | /* Number of buffers the user is allowed to dirty: | ||
| 410 | * (counts only buffers dirtied when !h_cowing) */ | ||
| 411 | unsigned int h_user_credits:14; | ||
| 412 | 404 | ||
| 405 | unsigned long h_start_jiffies; | ||
| 406 | unsigned int h_requested_credits; | ||
| 413 | 407 | ||
| 414 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 408 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
| 415 | struct lockdep_map h_lockdep_map; | 409 | struct lockdep_map h_lockdep_map; |
| 416 | #endif | 410 | #endif |
| 417 | |||
| 418 | #ifdef CONFIG_JBD2_DEBUG | ||
| 419 | /* COW debugging counters: */ | ||
| 420 | unsigned int h_cow_moved; /* blocks moved to snapshot */ | ||
| 421 | unsigned int h_cow_copied; /* blocks copied to snapshot */ | ||
| 422 | unsigned int h_cow_ok_jh; /* blocks already COWed during current | ||
| 423 | transaction */ | ||
| 424 | unsigned int h_cow_ok_bitmap; /* blocks not set in COW bitmap */ | ||
| 425 | unsigned int h_cow_ok_mapped;/* blocks already mapped in snapshot */ | ||
| 426 | unsigned int h_cow_bitmaps; /* COW bitmaps created */ | ||
| 427 | unsigned int h_cow_excluded; /* blocks set in exclude bitmap */ | ||
| 428 | #endif | ||
| 429 | }; | 411 | }; |
| 430 | 412 | ||
| 431 | 413 | ||
| @@ -581,6 +563,11 @@ struct transaction_s | |||
| 581 | unsigned long t_start; | 563 | unsigned long t_start; |
| 582 | 564 | ||
| 583 | /* | 565 | /* |
| 566 | * When commit was requested | ||
| 567 | */ | ||
| 568 | unsigned long t_requested; | ||
| 569 | |||
| 570 | /* | ||
| 584 | * Checkpointing stats [j_checkpoint_sem] | 571 | * Checkpointing stats [j_checkpoint_sem] |
| 585 | */ | 572 | */ |
| 586 | struct transaction_chp_stats_s t_chp_stats; | 573 | struct transaction_chp_stats_s t_chp_stats; |
| @@ -637,6 +624,7 @@ struct transaction_s | |||
| 637 | 624 | ||
| 638 | struct transaction_run_stats_s { | 625 | struct transaction_run_stats_s { |
| 639 | unsigned long rs_wait; | 626 | unsigned long rs_wait; |
| 627 | unsigned long rs_request_delay; | ||
| 640 | unsigned long rs_running; | 628 | unsigned long rs_running; |
| 641 | unsigned long rs_locked; | 629 | unsigned long rs_locked; |
| 642 | unsigned long rs_flushing; | 630 | unsigned long rs_flushing; |
| @@ -649,6 +637,7 @@ struct transaction_run_stats_s { | |||
| 649 | 637 | ||
| 650 | struct transaction_stats_s { | 638 | struct transaction_stats_s { |
| 651 | unsigned long ts_tid; | 639 | unsigned long ts_tid; |
| 640 | unsigned long ts_requested; | ||
| 652 | struct transaction_run_stats_s run; | 641 | struct transaction_run_stats_s run; |
| 653 | }; | 642 | }; |
| 654 | 643 | ||
| @@ -1086,7 +1075,8 @@ static inline handle_t *journal_current_handle(void) | |||
| 1086 | */ | 1075 | */ |
| 1087 | 1076 | ||
| 1088 | extern handle_t *jbd2_journal_start(journal_t *, int nblocks); | 1077 | extern handle_t *jbd2_journal_start(journal_t *, int nblocks); |
| 1089 | extern handle_t *jbd2__journal_start(journal_t *, int nblocks, gfp_t gfp_mask); | 1078 | extern handle_t *jbd2__journal_start(journal_t *, int nblocks, gfp_t gfp_mask, |
| 1079 | unsigned int type, unsigned int line_no); | ||
| 1090 | extern int jbd2_journal_restart(handle_t *, int nblocks); | 1080 | extern int jbd2_journal_restart(handle_t *, int nblocks); |
| 1091 | extern int jbd2__journal_restart(handle_t *, int nblocks, gfp_t gfp_mask); | 1081 | extern int jbd2__journal_restart(handle_t *, int nblocks, gfp_t gfp_mask); |
| 1092 | extern int jbd2_journal_extend (handle_t *, int nblocks); | 1082 | extern int jbd2_journal_extend (handle_t *, int nblocks); |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index c566927efcbd..80d36874689b 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -398,7 +398,11 @@ extern int panic_on_unrecovered_nmi; | |||
| 398 | extern int panic_on_io_nmi; | 398 | extern int panic_on_io_nmi; |
| 399 | extern int sysctl_panic_on_stackoverflow; | 399 | extern int sysctl_panic_on_stackoverflow; |
| 400 | extern const char *print_tainted(void); | 400 | extern const char *print_tainted(void); |
| 401 | extern void add_taint(unsigned flag); | 401 | enum lockdep_ok { |
| 402 | LOCKDEP_STILL_OK, | ||
| 403 | LOCKDEP_NOW_UNRELIABLE | ||
| 404 | }; | ||
| 405 | extern void add_taint(unsigned flag, enum lockdep_ok); | ||
| 402 | extern int test_taint(unsigned flag); | 406 | extern int test_taint(unsigned flag); |
| 403 | extern unsigned long get_taint(void); | 407 | extern unsigned long get_taint(void); |
| 404 | extern int root_mountflags; | 408 | extern int root_mountflags; |
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index d0b8458a703a..d2e6927bbaae 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
| @@ -191,6 +191,7 @@ extern struct kimage *kexec_crash_image; | |||
| 191 | /* Location of a reserved region to hold the crash kernel. | 191 | /* Location of a reserved region to hold the crash kernel. |
| 192 | */ | 192 | */ |
| 193 | extern struct resource crashk_res; | 193 | extern struct resource crashk_res; |
| 194 | extern struct resource crashk_low_res; | ||
| 194 | typedef u32 note_buf_t[KEXEC_NOTE_BYTES/4]; | 195 | typedef u32 note_buf_t[KEXEC_NOTE_BYTES/4]; |
| 195 | extern note_buf_t __percpu *crash_notes; | 196 | extern note_buf_t __percpu *crash_notes; |
| 196 | extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4]; | 197 | extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4]; |
| @@ -199,6 +200,8 @@ extern size_t vmcoreinfo_max_size; | |||
| 199 | 200 | ||
| 200 | int __init parse_crashkernel(char *cmdline, unsigned long long system_ram, | 201 | int __init parse_crashkernel(char *cmdline, unsigned long long system_ram, |
| 201 | unsigned long long *crash_size, unsigned long long *crash_base); | 202 | unsigned long long *crash_size, unsigned long long *crash_base); |
| 203 | int parse_crashkernel_low(char *cmdline, unsigned long long system_ram, | ||
| 204 | unsigned long long *crash_size, unsigned long long *crash_base); | ||
| 202 | int crash_shrink_memory(unsigned long new_size); | 205 | int crash_shrink_memory(unsigned long new_size); |
| 203 | size_t crash_get_memory_size(void); | 206 | size_t crash_get_memory_size(void); |
| 204 | void crash_free_reserved_phys_range(unsigned long begin, unsigned long end); | 207 | void crash_free_reserved_phys_range(unsigned long begin, unsigned long end); |
diff --git a/include/linux/ksm.h b/include/linux/ksm.h index 3319a6967626..45c9b6a17bcb 100644 --- a/include/linux/ksm.h +++ b/include/linux/ksm.h | |||
| @@ -16,9 +16,6 @@ | |||
| 16 | struct stable_node; | 16 | struct stable_node; |
| 17 | struct mem_cgroup; | 17 | struct mem_cgroup; |
| 18 | 18 | ||
| 19 | struct page *ksm_does_need_to_copy(struct page *page, | ||
| 20 | struct vm_area_struct *vma, unsigned long address); | ||
| 21 | |||
| 22 | #ifdef CONFIG_KSM | 19 | #ifdef CONFIG_KSM |
| 23 | int ksm_madvise(struct vm_area_struct *vma, unsigned long start, | 20 | int ksm_madvise(struct vm_area_struct *vma, unsigned long start, |
| 24 | unsigned long end, int advice, unsigned long *vm_flags); | 21 | unsigned long end, int advice, unsigned long *vm_flags); |
| @@ -73,15 +70,8 @@ static inline void set_page_stable_node(struct page *page, | |||
| 73 | * We'd like to make this conditional on vma->vm_flags & VM_MERGEABLE, | 70 | * We'd like to make this conditional on vma->vm_flags & VM_MERGEABLE, |
| 74 | * but what if the vma was unmerged while the page was swapped out? | 71 | * but what if the vma was unmerged while the page was swapped out? |
| 75 | */ | 72 | */ |
| 76 | static inline int ksm_might_need_to_copy(struct page *page, | 73 | struct page *ksm_might_need_to_copy(struct page *page, |
| 77 | struct vm_area_struct *vma, unsigned long address) | 74 | struct vm_area_struct *vma, unsigned long address); |
| 78 | { | ||
| 79 | struct anon_vma *anon_vma = page_anon_vma(page); | ||
| 80 | |||
| 81 | return anon_vma && | ||
| 82 | (anon_vma->root != vma->anon_vma->root || | ||
| 83 | page->index != linear_page_index(vma, address)); | ||
| 84 | } | ||
| 85 | 75 | ||
| 86 | int page_referenced_ksm(struct page *page, | 76 | int page_referenced_ksm(struct page *page, |
| 87 | struct mem_cgroup *memcg, unsigned long *vm_flags); | 77 | struct mem_cgroup *memcg, unsigned long *vm_flags); |
| @@ -113,10 +103,10 @@ static inline int ksm_madvise(struct vm_area_struct *vma, unsigned long start, | |||
| 113 | return 0; | 103 | return 0; |
| 114 | } | 104 | } |
| 115 | 105 | ||
| 116 | static inline int ksm_might_need_to_copy(struct page *page, | 106 | static inline struct page *ksm_might_need_to_copy(struct page *page, |
| 117 | struct vm_area_struct *vma, unsigned long address) | 107 | struct vm_area_struct *vma, unsigned long address) |
| 118 | { | 108 | { |
| 119 | return 0; | 109 | return page; |
| 120 | } | 110 | } |
| 121 | 111 | ||
| 122 | static inline int page_referenced_ksm(struct page *page, | 112 | static inline int page_referenced_ksm(struct page *page, |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index b7996a768eb2..cad77fe09d77 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
| @@ -123,6 +123,8 @@ static inline bool is_error_page(struct page *page) | |||
| 123 | #define KVM_REQ_WATCHDOG 18 | 123 | #define KVM_REQ_WATCHDOG 18 |
| 124 | #define KVM_REQ_MASTERCLOCK_UPDATE 19 | 124 | #define KVM_REQ_MASTERCLOCK_UPDATE 19 |
| 125 | #define KVM_REQ_MCLOCK_INPROGRESS 20 | 125 | #define KVM_REQ_MCLOCK_INPROGRESS 20 |
| 126 | #define KVM_REQ_EPR_EXIT 21 | ||
| 127 | #define KVM_REQ_EOIBITMAP 22 | ||
| 126 | 128 | ||
| 127 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 | 129 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 |
| 128 | #define KVM_IRQFD_RESAMPLE_IRQ_SOURCE_ID 1 | 130 | #define KVM_IRQFD_RESAMPLE_IRQ_SOURCE_ID 1 |
| @@ -267,12 +269,11 @@ static inline int kvm_vcpu_exiting_guest_mode(struct kvm_vcpu *vcpu) | |||
| 267 | struct kvm_memory_slot { | 269 | struct kvm_memory_slot { |
| 268 | gfn_t base_gfn; | 270 | gfn_t base_gfn; |
| 269 | unsigned long npages; | 271 | unsigned long npages; |
| 270 | unsigned long flags; | ||
| 271 | unsigned long *dirty_bitmap; | 272 | unsigned long *dirty_bitmap; |
| 272 | struct kvm_arch_memory_slot arch; | 273 | struct kvm_arch_memory_slot arch; |
| 273 | unsigned long userspace_addr; | 274 | unsigned long userspace_addr; |
| 274 | int user_alloc; | 275 | u32 flags; |
| 275 | int id; | 276 | short id; |
| 276 | }; | 277 | }; |
| 277 | 278 | ||
| 278 | static inline unsigned long kvm_dirty_bitmap_bytes(struct kvm_memory_slot *memslot) | 279 | static inline unsigned long kvm_dirty_bitmap_bytes(struct kvm_memory_slot *memslot) |
| @@ -314,8 +315,12 @@ struct kvm_irq_routing_table {}; | |||
| 314 | 315 | ||
| 315 | #endif | 316 | #endif |
| 316 | 317 | ||
| 318 | #ifndef KVM_PRIVATE_MEM_SLOTS | ||
| 319 | #define KVM_PRIVATE_MEM_SLOTS 0 | ||
| 320 | #endif | ||
| 321 | |||
| 317 | #ifndef KVM_MEM_SLOTS_NUM | 322 | #ifndef KVM_MEM_SLOTS_NUM |
| 318 | #define KVM_MEM_SLOTS_NUM (KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS) | 323 | #define KVM_MEM_SLOTS_NUM (KVM_USER_MEM_SLOTS + KVM_PRIVATE_MEM_SLOTS) |
| 319 | #endif | 324 | #endif |
| 320 | 325 | ||
| 321 | /* | 326 | /* |
| @@ -327,7 +332,7 @@ struct kvm_memslots { | |||
| 327 | u64 generation; | 332 | u64 generation; |
| 328 | struct kvm_memory_slot memslots[KVM_MEM_SLOTS_NUM]; | 333 | struct kvm_memory_slot memslots[KVM_MEM_SLOTS_NUM]; |
| 329 | /* The mapping table from slot id to the index in memslots[]. */ | 334 | /* The mapping table from slot id to the index in memslots[]. */ |
| 330 | int id_to_index[KVM_MEM_SLOTS_NUM]; | 335 | short id_to_index[KVM_MEM_SLOTS_NUM]; |
| 331 | }; | 336 | }; |
| 332 | 337 | ||
| 333 | struct kvm { | 338 | struct kvm { |
| @@ -425,7 +430,8 @@ void kvm_exit(void); | |||
| 425 | 430 | ||
| 426 | void kvm_get_kvm(struct kvm *kvm); | 431 | void kvm_get_kvm(struct kvm *kvm); |
| 427 | void kvm_put_kvm(struct kvm *kvm); | 432 | void kvm_put_kvm(struct kvm *kvm); |
| 428 | void update_memslots(struct kvm_memslots *slots, struct kvm_memory_slot *new); | 433 | void update_memslots(struct kvm_memslots *slots, struct kvm_memory_slot *new, |
| 434 | u64 last_generation); | ||
| 429 | 435 | ||
| 430 | static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm) | 436 | static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm) |
| 431 | { | 437 | { |
| @@ -448,10 +454,10 @@ id_to_memslot(struct kvm_memslots *slots, int id) | |||
| 448 | 454 | ||
| 449 | int kvm_set_memory_region(struct kvm *kvm, | 455 | int kvm_set_memory_region(struct kvm *kvm, |
| 450 | struct kvm_userspace_memory_region *mem, | 456 | struct kvm_userspace_memory_region *mem, |
| 451 | int user_alloc); | 457 | bool user_alloc); |
| 452 | int __kvm_set_memory_region(struct kvm *kvm, | 458 | int __kvm_set_memory_region(struct kvm *kvm, |
| 453 | struct kvm_userspace_memory_region *mem, | 459 | struct kvm_userspace_memory_region *mem, |
| 454 | int user_alloc); | 460 | bool user_alloc); |
| 455 | void kvm_arch_free_memslot(struct kvm_memory_slot *free, | 461 | void kvm_arch_free_memslot(struct kvm_memory_slot *free, |
| 456 | struct kvm_memory_slot *dont); | 462 | struct kvm_memory_slot *dont); |
| 457 | int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages); | 463 | int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages); |
| @@ -459,11 +465,11 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm, | |||
| 459 | struct kvm_memory_slot *memslot, | 465 | struct kvm_memory_slot *memslot, |
| 460 | struct kvm_memory_slot old, | 466 | struct kvm_memory_slot old, |
| 461 | struct kvm_userspace_memory_region *mem, | 467 | struct kvm_userspace_memory_region *mem, |
| 462 | int user_alloc); | 468 | bool user_alloc); |
| 463 | void kvm_arch_commit_memory_region(struct kvm *kvm, | 469 | void kvm_arch_commit_memory_region(struct kvm *kvm, |
| 464 | struct kvm_userspace_memory_region *mem, | 470 | struct kvm_userspace_memory_region *mem, |
| 465 | struct kvm_memory_slot old, | 471 | struct kvm_memory_slot old, |
| 466 | int user_alloc); | 472 | bool user_alloc); |
| 467 | bool kvm_largepages_enabled(void); | 473 | bool kvm_largepages_enabled(void); |
| 468 | void kvm_disable_largepages(void); | 474 | void kvm_disable_largepages(void); |
| 469 | /* flush all memory translations */ | 475 | /* flush all memory translations */ |
| @@ -533,6 +539,7 @@ void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); | |||
| 533 | void kvm_flush_remote_tlbs(struct kvm *kvm); | 539 | void kvm_flush_remote_tlbs(struct kvm *kvm); |
| 534 | void kvm_reload_remote_mmus(struct kvm *kvm); | 540 | void kvm_reload_remote_mmus(struct kvm *kvm); |
| 535 | void kvm_make_mclock_inprogress_request(struct kvm *kvm); | 541 | void kvm_make_mclock_inprogress_request(struct kvm *kvm); |
| 542 | void kvm_make_update_eoibitmap_request(struct kvm *kvm); | ||
| 536 | 543 | ||
| 537 | long kvm_arch_dev_ioctl(struct file *filp, | 544 | long kvm_arch_dev_ioctl(struct file *filp, |
| 538 | unsigned int ioctl, unsigned long arg); | 545 | unsigned int ioctl, unsigned long arg); |
| @@ -550,7 +557,7 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, | |||
| 550 | int kvm_vm_ioctl_set_memory_region(struct kvm *kvm, | 557 | int kvm_vm_ioctl_set_memory_region(struct kvm *kvm, |
| 551 | struct | 558 | struct |
| 552 | kvm_userspace_memory_region *mem, | 559 | kvm_userspace_memory_region *mem, |
| 553 | int user_alloc); | 560 | bool user_alloc); |
| 554 | int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_level); | 561 | int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_level); |
| 555 | long kvm_arch_vm_ioctl(struct file *filp, | 562 | long kvm_arch_vm_ioctl(struct file *filp, |
| 556 | unsigned int ioctl, unsigned long arg); | 563 | unsigned int ioctl, unsigned long arg); |
| @@ -686,6 +693,7 @@ int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level); | |||
| 686 | int kvm_set_irq_inatomic(struct kvm *kvm, int irq_source_id, u32 irq, int level); | 693 | int kvm_set_irq_inatomic(struct kvm *kvm, int irq_source_id, u32 irq, int level); |
| 687 | int kvm_set_msi(struct kvm_kernel_irq_routing_entry *irq_entry, struct kvm *kvm, | 694 | int kvm_set_msi(struct kvm_kernel_irq_routing_entry *irq_entry, struct kvm *kvm, |
| 688 | int irq_source_id, int level); | 695 | int irq_source_id, int level); |
| 696 | bool kvm_irq_has_notifier(struct kvm *kvm, unsigned irqchip, unsigned pin); | ||
| 689 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); | 697 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); |
| 690 | void kvm_register_irq_ack_notifier(struct kvm *kvm, | 698 | void kvm_register_irq_ack_notifier(struct kvm *kvm, |
| 691 | struct kvm_irq_ack_notifier *kian); | 699 | struct kvm_irq_ack_notifier *kian); |
diff --git a/include/linux/leds-lp5521.h b/include/linux/leds-lp5521.h deleted file mode 100644 index 3f071ec019b2..000000000000 --- a/include/linux/leds-lp5521.h +++ /dev/null | |||
| @@ -1,73 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * LP5521 LED chip driver. | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010 Nokia Corporation | ||
| 5 | * | ||
| 6 | * Contact: Samu Onkalo <samu.p.onkalo@nokia.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or | ||
| 9 | * modify it under the terms of the GNU General Public License | ||
| 10 | * version 2 as published by the Free Software Foundation. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, but | ||
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 15 | * General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with this program; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
| 20 | * 02110-1301 USA | ||
| 21 | */ | ||
| 22 | |||
| 23 | #ifndef __LINUX_LP5521_H | ||
| 24 | #define __LINUX_LP5521_H | ||
| 25 | |||
| 26 | /* See Documentation/leds/leds-lp5521.txt */ | ||
| 27 | |||
| 28 | struct lp5521_led_config { | ||
| 29 | char *name; | ||
| 30 | u8 chan_nr; | ||
| 31 | u8 led_current; /* mA x10, 0 if led is not connected */ | ||
| 32 | u8 max_current; | ||
| 33 | }; | ||
| 34 | |||
| 35 | struct lp5521_led_pattern { | ||
| 36 | u8 *r; | ||
| 37 | u8 *g; | ||
| 38 | u8 *b; | ||
| 39 | u8 size_r; | ||
| 40 | u8 size_g; | ||
| 41 | u8 size_b; | ||
| 42 | }; | ||
| 43 | |||
| 44 | #define LP5521_CLOCK_AUTO 0 | ||
| 45 | #define LP5521_CLOCK_INT 1 | ||
| 46 | #define LP5521_CLOCK_EXT 2 | ||
| 47 | |||
| 48 | /* Bits in CONFIG register */ | ||
| 49 | #define LP5521_PWM_HF 0x40 /* PWM: 0 = 256Hz, 1 = 558Hz */ | ||
| 50 | #define LP5521_PWRSAVE_EN 0x20 /* 1 = Power save mode */ | ||
| 51 | #define LP5521_CP_MODE_OFF 0 /* Charge pump (CP) off */ | ||
| 52 | #define LP5521_CP_MODE_BYPASS 8 /* CP forced to bypass mode */ | ||
| 53 | #define LP5521_CP_MODE_1X5 0x10 /* CP forced to 1.5x mode */ | ||
| 54 | #define LP5521_CP_MODE_AUTO 0x18 /* Automatic mode selection */ | ||
| 55 | #define LP5521_R_TO_BATT 4 /* R out: 0 = CP, 1 = Vbat */ | ||
| 56 | #define LP5521_CLK_SRC_EXT 0 /* Ext-clk source (CLK_32K) */ | ||
| 57 | #define LP5521_CLK_INT 1 /* Internal clock */ | ||
| 58 | #define LP5521_CLK_AUTO 2 /* Automatic clock selection */ | ||
| 59 | |||
| 60 | struct lp5521_platform_data { | ||
| 61 | struct lp5521_led_config *led_config; | ||
| 62 | u8 num_channels; | ||
| 63 | u8 clock_mode; | ||
| 64 | int (*setup_resources)(void); | ||
| 65 | void (*release_resources)(void); | ||
| 66 | void (*enable)(bool state); | ||
| 67 | const char *label; | ||
| 68 | u8 update_config; | ||
| 69 | struct lp5521_led_pattern *patterns; | ||
| 70 | int num_patterns; | ||
| 71 | }; | ||
| 72 | |||
| 73 | #endif /* __LINUX_LP5521_H */ | ||
diff --git a/include/linux/leds-lp5523.h b/include/linux/leds-lp5523.h deleted file mode 100644 index 727877fb406d..000000000000 --- a/include/linux/leds-lp5523.h +++ /dev/null | |||
| @@ -1,49 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * LP5523 LED Driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010 Nokia Corporation | ||
| 5 | * | ||
| 6 | * Contact: Samu Onkalo <samu.p.onkalo@nokia.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or | ||
| 9 | * modify it under the terms of the GNU General Public License | ||
| 10 | * version 2 as published by the Free Software Foundation. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, but | ||
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 15 | * General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with this program; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
| 20 | * 02110-1301 USA | ||
| 21 | */ | ||
| 22 | |||
| 23 | #ifndef __LINUX_LP5523_H | ||
| 24 | #define __LINUX_LP5523_H | ||
| 25 | |||
| 26 | /* See Documentation/leds/leds-lp5523.txt */ | ||
| 27 | |||
| 28 | struct lp5523_led_config { | ||
| 29 | const char *name; | ||
| 30 | u8 chan_nr; | ||
| 31 | u8 led_current; /* mA x10, 0 if led is not connected */ | ||
| 32 | u8 max_current; | ||
| 33 | }; | ||
| 34 | |||
| 35 | #define LP5523_CLOCK_AUTO 0 | ||
| 36 | #define LP5523_CLOCK_INT 1 | ||
| 37 | #define LP5523_CLOCK_EXT 2 | ||
| 38 | |||
| 39 | struct lp5523_platform_data { | ||
| 40 | struct lp5523_led_config *led_config; | ||
| 41 | u8 num_channels; | ||
| 42 | u8 clock_mode; | ||
| 43 | int (*setup_resources)(void); | ||
| 44 | void (*release_resources)(void); | ||
| 45 | void (*enable)(bool state); | ||
| 46 | const char *label; | ||
| 47 | }; | ||
| 48 | |||
| 49 | #endif /* __LINUX_LP5523_H */ | ||
diff --git a/include/linux/leds_pwm.h b/include/linux/leds_pwm.h index 33a071167489..a65e9646e4b1 100644 --- a/include/linux/leds_pwm.h +++ b/include/linux/leds_pwm.h | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | struct led_pwm { | 7 | struct led_pwm { |
| 8 | const char *name; | 8 | const char *name; |
| 9 | const char *default_trigger; | 9 | const char *default_trigger; |
| 10 | unsigned pwm_id; | 10 | unsigned pwm_id __deprecated; |
| 11 | u8 active_low; | 11 | u8 active_low; |
| 12 | unsigned max_brightness; | 12 | unsigned max_brightness; |
| 13 | unsigned pwm_period_ns; | 13 | unsigned pwm_period_ns; |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 649e5f86b5f0..91c9d109e5f1 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -620,6 +620,9 @@ struct ata_device { | |||
| 620 | union acpi_object *gtf_cache; | 620 | union acpi_object *gtf_cache; |
| 621 | unsigned int gtf_filter; | 621 | unsigned int gtf_filter; |
| 622 | #endif | 622 | #endif |
| 623 | #ifdef CONFIG_SATA_ZPODD | ||
| 624 | void *zpodd; | ||
| 625 | #endif | ||
| 623 | struct device tdev; | 626 | struct device tdev; |
| 624 | /* n_sector is CLEAR_BEGIN, read comment above CLEAR_BEGIN */ | 627 | /* n_sector is CLEAR_BEGIN, read comment above CLEAR_BEGIN */ |
| 625 | u64 n_sectors; /* size of device, if ATA */ | 628 | u64 n_sectors; /* size of device, if ATA */ |
diff --git a/include/linux/list.h b/include/linux/list.h index cc6d2aa6b415..d991cc147c98 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
| @@ -666,54 +666,49 @@ static inline void hlist_move_list(struct hlist_head *old, | |||
| 666 | for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \ | 666 | for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \ |
| 667 | pos = n) | 667 | pos = n) |
| 668 | 668 | ||
| 669 | #define hlist_entry_safe(ptr, type, member) \ | ||
| 670 | (ptr) ? hlist_entry(ptr, type, member) : NULL | ||
| 671 | |||
| 669 | /** | 672 | /** |
| 670 | * hlist_for_each_entry - iterate over list of given type | 673 | * hlist_for_each_entry - iterate over list of given type |
| 671 | * @tpos: the type * to use as a loop cursor. | 674 | * @pos: the type * to use as a loop cursor. |
| 672 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
| 673 | * @head: the head for your list. | 675 | * @head: the head for your list. |
| 674 | * @member: the name of the hlist_node within the struct. | 676 | * @member: the name of the hlist_node within the struct. |
| 675 | */ | 677 | */ |
| 676 | #define hlist_for_each_entry(tpos, pos, head, member) \ | 678 | #define hlist_for_each_entry(pos, head, member) \ |
| 677 | for (pos = (head)->first; \ | 679 | for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member);\ |
| 678 | pos && \ | 680 | pos; \ |
| 679 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ | 681 | pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member)) |
| 680 | pos = pos->next) | ||
| 681 | 682 | ||
| 682 | /** | 683 | /** |
| 683 | * hlist_for_each_entry_continue - iterate over a hlist continuing after current point | 684 | * hlist_for_each_entry_continue - iterate over a hlist continuing after current point |
| 684 | * @tpos: the type * to use as a loop cursor. | 685 | * @pos: the type * to use as a loop cursor. |
| 685 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
| 686 | * @member: the name of the hlist_node within the struct. | 686 | * @member: the name of the hlist_node within the struct. |
| 687 | */ | 687 | */ |
| 688 | #define hlist_for_each_entry_continue(tpos, pos, member) \ | 688 | #define hlist_for_each_entry_continue(pos, member) \ |
| 689 | for (pos = (pos)->next; \ | 689 | for (pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member);\ |
| 690 | pos && \ | 690 | pos; \ |
| 691 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ | 691 | pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member)) |
| 692 | pos = pos->next) | ||
| 693 | 692 | ||
| 694 | /** | 693 | /** |
| 695 | * hlist_for_each_entry_from - iterate over a hlist continuing from current point | 694 | * hlist_for_each_entry_from - iterate over a hlist continuing from current point |
| 696 | * @tpos: the type * to use as a loop cursor. | 695 | * @pos: the type * to use as a loop cursor. |
| 697 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
| 698 | * @member: the name of the hlist_node within the struct. | 696 | * @member: the name of the hlist_node within the struct. |
| 699 | */ | 697 | */ |
| 700 | #define hlist_for_each_entry_from(tpos, pos, member) \ | 698 | #define hlist_for_each_entry_from(pos, member) \ |
| 701 | for (; pos && \ | 699 | for (; pos; \ |
| 702 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ | 700 | pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member)) |
| 703 | pos = pos->next) | ||
| 704 | 701 | ||
| 705 | /** | 702 | /** |
| 706 | * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry | 703 | * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry |
| 707 | * @tpos: the type * to use as a loop cursor. | 704 | * @pos: the type * to use as a loop cursor. |
| 708 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
| 709 | * @n: another &struct hlist_node to use as temporary storage | 705 | * @n: another &struct hlist_node to use as temporary storage |
| 710 | * @head: the head for your list. | 706 | * @head: the head for your list. |
| 711 | * @member: the name of the hlist_node within the struct. | 707 | * @member: the name of the hlist_node within the struct. |
| 712 | */ | 708 | */ |
| 713 | #define hlist_for_each_entry_safe(tpos, pos, n, head, member) \ | 709 | #define hlist_for_each_entry_safe(pos, n, head, member) \ |
| 714 | for (pos = (head)->first; \ | 710 | for (pos = hlist_entry_safe((head)->first, typeof(*pos), member);\ |
| 715 | pos && ({ n = pos->next; 1; }) && \ | 711 | pos && ({ n = pos->member.next; 1; }); \ |
| 716 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ | 712 | pos = hlist_entry_safe(n, typeof(*pos), member)) |
| 717 | pos = n) | ||
| 718 | 713 | ||
| 719 | #endif | 714 | #endif |
diff --git a/include/linux/llist.h b/include/linux/llist.h index d0ab98f73d38..a5199f6d0e82 100644 --- a/include/linux/llist.h +++ b/include/linux/llist.h | |||
| @@ -125,31 +125,6 @@ static inline void init_llist_head(struct llist_head *list) | |||
| 125 | (pos) = llist_entry((pos)->member.next, typeof(*(pos)), member)) | 125 | (pos) = llist_entry((pos)->member.next, typeof(*(pos)), member)) |
| 126 | 126 | ||
| 127 | /** | 127 | /** |
| 128 | * llist_for_each_entry_safe - iterate safely against remove over some entries | ||
| 129 | * of lock-less list of given type. | ||
| 130 | * @pos: the type * to use as a loop cursor. | ||
| 131 | * @n: another type * to use as a temporary storage. | ||
| 132 | * @node: the fist entry of deleted list entries. | ||
| 133 | * @member: the name of the llist_node with the struct. | ||
| 134 | * | ||
| 135 | * In general, some entries of the lock-less list can be traversed | ||
| 136 | * safely only after being removed from list, so start with an entry | ||
| 137 | * instead of list head. This variant allows removal of entries | ||
| 138 | * as we iterate. | ||
| 139 | * | ||
| 140 | * If being used on entries deleted from lock-less list directly, the | ||
| 141 | * traverse order is from the newest to the oldest added entry. If | ||
| 142 | * you want to traverse from the oldest to the newest, you must | ||
| 143 | * reverse the order by yourself before traversing. | ||
| 144 | */ | ||
| 145 | #define llist_for_each_entry_safe(pos, n, node, member) \ | ||
| 146 | for ((pos) = llist_entry((node), typeof(*(pos)), member), \ | ||
| 147 | (n) = (pos)->member.next; \ | ||
| 148 | &(pos)->member != NULL; \ | ||
| 149 | (pos) = llist_entry(n, typeof(*(pos)), member), \ | ||
| 150 | (n) = (&(pos)->member != NULL) ? (pos)->member.next : NULL) | ||
| 151 | |||
| 152 | /** | ||
| 153 | * llist_empty - tests whether a lock-less list is empty | 128 | * llist_empty - tests whether a lock-less list is empty |
| 154 | * @head: the list to test | 129 | * @head: the list to test |
| 155 | * | 130 | * |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index f5a051a79273..dcaad79f54ed 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
| @@ -212,7 +212,8 @@ int nlmclnt_block(struct nlm_wait *block, struct nlm_rqst *req, long timeout) | |||
| 212 | __be32 nlmclnt_grant(const struct sockaddr *addr, | 212 | __be32 nlmclnt_grant(const struct sockaddr *addr, |
| 213 | const struct nlm_lock *lock); | 213 | const struct nlm_lock *lock); |
| 214 | void nlmclnt_recovery(struct nlm_host *); | 214 | void nlmclnt_recovery(struct nlm_host *); |
| 215 | int nlmclnt_reclaim(struct nlm_host *, struct file_lock *); | 215 | int nlmclnt_reclaim(struct nlm_host *, struct file_lock *, |
| 216 | struct nlm_rqst *); | ||
| 216 | void nlmclnt_next_cookie(struct nlm_cookie *); | 217 | void nlmclnt_next_cookie(struct nlm_cookie *); |
| 217 | 218 | ||
| 218 | /* | 219 | /* |
| @@ -291,7 +292,7 @@ int nlmsvc_unlock_all_by_ip(struct sockaddr *server_addr); | |||
| 291 | 292 | ||
| 292 | static inline struct inode *nlmsvc_file_inode(struct nlm_file *file) | 293 | static inline struct inode *nlmsvc_file_inode(struct nlm_file *file) |
| 293 | { | 294 | { |
| 294 | return file->f_file->f_path.dentry->d_inode; | 295 | return file_inode(file->f_file); |
| 295 | } | 296 | } |
| 296 | 297 | ||
| 297 | static inline int __nlm_privileged_request4(const struct sockaddr *sap) | 298 | static inline int __nlm_privileged_request4(const struct sockaddr *sap) |
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index bfe88c4aa251..f1e877b79ed8 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h | |||
| @@ -412,7 +412,7 @@ struct lock_class_key { }; | |||
| 412 | 412 | ||
| 413 | #define lockdep_depth(tsk) (0) | 413 | #define lockdep_depth(tsk) (0) |
| 414 | 414 | ||
| 415 | #define lockdep_assert_held(l) do { } while (0) | 415 | #define lockdep_assert_held(l) do { (void)(l); } while (0) |
| 416 | 416 | ||
| 417 | #define lockdep_recursing(tsk) (0) | 417 | #define lockdep_recursing(tsk) (0) |
| 418 | 418 | ||
diff --git a/include/linux/lzo.h b/include/linux/lzo.h index d793497ec1ca..a0848d9377e5 100644 --- a/include/linux/lzo.h +++ b/include/linux/lzo.h | |||
| @@ -4,28 +4,28 @@ | |||
| 4 | * LZO Public Kernel Interface | 4 | * LZO Public Kernel Interface |
| 5 | * A mini subset of the LZO real-time data compression library | 5 | * A mini subset of the LZO real-time data compression library |
| 6 | * | 6 | * |
| 7 | * Copyright (C) 1996-2005 Markus F.X.J. Oberhumer <markus@oberhumer.com> | 7 | * Copyright (C) 1996-2012 Markus F.X.J. Oberhumer <markus@oberhumer.com> |
| 8 | * | 8 | * |
| 9 | * The full LZO package can be found at: | 9 | * The full LZO package can be found at: |
| 10 | * http://www.oberhumer.com/opensource/lzo/ | 10 | * http://www.oberhumer.com/opensource/lzo/ |
| 11 | * | 11 | * |
| 12 | * Changed for kernel use by: | 12 | * Changed for Linux kernel use by: |
| 13 | * Nitin Gupta <nitingupta910@gmail.com> | 13 | * Nitin Gupta <nitingupta910@gmail.com> |
| 14 | * Richard Purdie <rpurdie@openedhand.com> | 14 | * Richard Purdie <rpurdie@openedhand.com> |
| 15 | */ | 15 | */ |
| 16 | 16 | ||
| 17 | #define LZO1X_MEM_COMPRESS (16384 * sizeof(unsigned char *)) | 17 | #define LZO1X_1_MEM_COMPRESS (8192 * sizeof(unsigned short)) |
| 18 | #define LZO1X_1_MEM_COMPRESS LZO1X_MEM_COMPRESS | 18 | #define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS |
| 19 | 19 | ||
| 20 | #define lzo1x_worst_compress(x) ((x) + ((x) / 16) + 64 + 3) | 20 | #define lzo1x_worst_compress(x) ((x) + ((x) / 16) + 64 + 3) |
| 21 | 21 | ||
| 22 | /* This requires 'workmem' of size LZO1X_1_MEM_COMPRESS */ | 22 | /* This requires 'wrkmem' of size LZO1X_1_MEM_COMPRESS */ |
| 23 | int lzo1x_1_compress(const unsigned char *src, size_t src_len, | 23 | int lzo1x_1_compress(const unsigned char *src, size_t src_len, |
| 24 | unsigned char *dst, size_t *dst_len, void *wrkmem); | 24 | unsigned char *dst, size_t *dst_len, void *wrkmem); |
| 25 | 25 | ||
| 26 | /* safe decompression with overrun testing */ | 26 | /* safe decompression with overrun testing */ |
| 27 | int lzo1x_decompress_safe(const unsigned char *src, size_t src_len, | 27 | int lzo1x_decompress_safe(const unsigned char *src, size_t src_len, |
| 28 | unsigned char *dst, size_t *dst_len); | 28 | unsigned char *dst, size_t *dst_len); |
| 29 | 29 | ||
| 30 | /* | 30 | /* |
| 31 | * Return values (< 0 = Error) | 31 | * Return values (< 0 = Error) |
| @@ -40,5 +40,6 @@ int lzo1x_decompress_safe(const unsigned char *src, size_t src_len, | |||
| 40 | #define LZO_E_EOF_NOT_FOUND (-7) | 40 | #define LZO_E_EOF_NOT_FOUND (-7) |
| 41 | #define LZO_E_INPUT_NOT_CONSUMED (-8) | 41 | #define LZO_E_INPUT_NOT_CONSUMED (-8) |
| 42 | #define LZO_E_NOT_YET_IMPLEMENTED (-9) | 42 | #define LZO_E_NOT_YET_IMPLEMENTED (-9) |
| 43 | #define LZO_E_INVALID_ARGUMENT (-10) | ||
| 43 | 44 | ||
| 44 | #endif | 45 | #endif |
diff --git a/include/linux/memblock.h b/include/linux/memblock.h index d452ee191066..f388203db7e8 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h | |||
| @@ -155,6 +155,7 @@ phys_addr_t memblock_alloc_base(phys_addr_t size, phys_addr_t align, | |||
| 155 | phys_addr_t __memblock_alloc_base(phys_addr_t size, phys_addr_t align, | 155 | phys_addr_t __memblock_alloc_base(phys_addr_t size, phys_addr_t align, |
| 156 | phys_addr_t max_addr); | 156 | phys_addr_t max_addr); |
| 157 | phys_addr_t memblock_phys_mem_size(void); | 157 | phys_addr_t memblock_phys_mem_size(void); |
| 158 | phys_addr_t memblock_mem_size(unsigned long limit_pfn); | ||
| 158 | phys_addr_t memblock_start_of_DRAM(void); | 159 | phys_addr_t memblock_start_of_DRAM(void); |
| 159 | phys_addr_t memblock_end_of_DRAM(void); | 160 | phys_addr_t memblock_end_of_DRAM(void); |
| 160 | void memblock_enforce_memory_limit(phys_addr_t memory_limit); | 161 | void memblock_enforce_memory_limit(phys_addr_t memory_limit); |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 28bd5fa2ff2e..d6183f06d8c1 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
| @@ -116,7 +116,6 @@ void mem_cgroup_iter_break(struct mem_cgroup *, struct mem_cgroup *); | |||
| 116 | * For memory reclaim. | 116 | * For memory reclaim. |
| 117 | */ | 117 | */ |
| 118 | int mem_cgroup_inactive_anon_is_low(struct lruvec *lruvec); | 118 | int mem_cgroup_inactive_anon_is_low(struct lruvec *lruvec); |
| 119 | int mem_cgroup_inactive_file_is_low(struct lruvec *lruvec); | ||
| 120 | int mem_cgroup_select_victim_node(struct mem_cgroup *memcg); | 119 | int mem_cgroup_select_victim_node(struct mem_cgroup *memcg); |
| 121 | unsigned long mem_cgroup_get_lru_size(struct lruvec *lruvec, enum lru_list); | 120 | unsigned long mem_cgroup_get_lru_size(struct lruvec *lruvec, enum lru_list); |
| 122 | void mem_cgroup_update_lru_size(struct lruvec *, enum lru_list, int); | 121 | void mem_cgroup_update_lru_size(struct lruvec *, enum lru_list, int); |
| @@ -321,12 +320,6 @@ mem_cgroup_inactive_anon_is_low(struct lruvec *lruvec) | |||
| 321 | return 1; | 320 | return 1; |
| 322 | } | 321 | } |
| 323 | 322 | ||
| 324 | static inline int | ||
| 325 | mem_cgroup_inactive_file_is_low(struct lruvec *lruvec) | ||
| 326 | { | ||
| 327 | return 1; | ||
| 328 | } | ||
| 329 | |||
| 330 | static inline unsigned long | 323 | static inline unsigned long |
| 331 | mem_cgroup_get_lru_size(struct lruvec *lruvec, enum lru_list lru) | 324 | mem_cgroup_get_lru_size(struct lruvec *lruvec, enum lru_list lru) |
| 332 | { | 325 | { |
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 4a45c4e50025..b6a3be7d47bf 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
| @@ -96,6 +96,7 @@ extern void __online_page_free(struct page *page); | |||
| 96 | 96 | ||
| 97 | #ifdef CONFIG_MEMORY_HOTREMOVE | 97 | #ifdef CONFIG_MEMORY_HOTREMOVE |
| 98 | extern bool is_pageblock_removable_nolock(struct page *page); | 98 | extern bool is_pageblock_removable_nolock(struct page *page); |
| 99 | extern int arch_remove_memory(u64 start, u64 size); | ||
| 99 | #endif /* CONFIG_MEMORY_HOTREMOVE */ | 100 | #endif /* CONFIG_MEMORY_HOTREMOVE */ |
| 100 | 101 | ||
| 101 | /* reasonably generic interface to expand the physical pages in a zone */ | 102 | /* reasonably generic interface to expand the physical pages in a zone */ |
| @@ -173,17 +174,16 @@ static inline void arch_refresh_nodedata(int nid, pg_data_t *pgdat) | |||
| 173 | #endif /* CONFIG_NUMA */ | 174 | #endif /* CONFIG_NUMA */ |
| 174 | #endif /* CONFIG_HAVE_ARCH_NODEDATA_EXTENSION */ | 175 | #endif /* CONFIG_HAVE_ARCH_NODEDATA_EXTENSION */ |
| 175 | 176 | ||
| 176 | #ifdef CONFIG_SPARSEMEM_VMEMMAP | 177 | #ifdef CONFIG_HAVE_BOOTMEM_INFO_NODE |
| 178 | extern void register_page_bootmem_info_node(struct pglist_data *pgdat); | ||
| 179 | #else | ||
| 177 | static inline void register_page_bootmem_info_node(struct pglist_data *pgdat) | 180 | static inline void register_page_bootmem_info_node(struct pglist_data *pgdat) |
| 178 | { | 181 | { |
| 179 | } | 182 | } |
| 180 | static inline void put_page_bootmem(struct page *page) | ||
| 181 | { | ||
| 182 | } | ||
| 183 | #else | ||
| 184 | extern void register_page_bootmem_info_node(struct pglist_data *pgdat); | ||
| 185 | extern void put_page_bootmem(struct page *page); | ||
| 186 | #endif | 183 | #endif |
| 184 | extern void put_page_bootmem(struct page *page); | ||
| 185 | extern void get_page_bootmem(unsigned long ingo, struct page *page, | ||
| 186 | unsigned long type); | ||
| 187 | 187 | ||
| 188 | /* | 188 | /* |
| 189 | * Lock for memory hotplug guarantees 1) all callbacks for memory hotplug | 189 | * Lock for memory hotplug guarantees 1) all callbacks for memory hotplug |
| @@ -233,6 +233,7 @@ static inline void unlock_memory_hotplug(void) {} | |||
| 233 | #ifdef CONFIG_MEMORY_HOTREMOVE | 233 | #ifdef CONFIG_MEMORY_HOTREMOVE |
| 234 | 234 | ||
| 235 | extern int is_mem_section_removable(unsigned long pfn, unsigned long nr_pages); | 235 | extern int is_mem_section_removable(unsigned long pfn, unsigned long nr_pages); |
| 236 | extern void try_offline_node(int nid); | ||
| 236 | 237 | ||
| 237 | #else | 238 | #else |
| 238 | static inline int is_mem_section_removable(unsigned long pfn, | 239 | static inline int is_mem_section_removable(unsigned long pfn, |
| @@ -240,6 +241,8 @@ static inline int is_mem_section_removable(unsigned long pfn, | |||
| 240 | { | 241 | { |
| 241 | return 0; | 242 | return 0; |
| 242 | } | 243 | } |
| 244 | |||
| 245 | static inline void try_offline_node(int nid) {} | ||
| 243 | #endif /* CONFIG_MEMORY_HOTREMOVE */ | 246 | #endif /* CONFIG_MEMORY_HOTREMOVE */ |
| 244 | 247 | ||
| 245 | extern int mem_online_node(int nid); | 248 | extern int mem_online_node(int nid); |
| @@ -247,7 +250,8 @@ extern int add_memory(int nid, u64 start, u64 size); | |||
| 247 | extern int arch_add_memory(int nid, u64 start, u64 size); | 250 | extern int arch_add_memory(int nid, u64 start, u64 size); |
| 248 | extern int offline_pages(unsigned long start_pfn, unsigned long nr_pages); | 251 | extern int offline_pages(unsigned long start_pfn, unsigned long nr_pages); |
| 249 | extern int offline_memory_block(struct memory_block *mem); | 252 | extern int offline_memory_block(struct memory_block *mem); |
| 250 | extern int remove_memory(u64 start, u64 size); | 253 | extern bool is_memblock_offlined(struct memory_block *mem); |
| 254 | extern int remove_memory(int nid, u64 start, u64 size); | ||
| 251 | extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn, | 255 | extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn, |
| 252 | int nr_pages); | 256 | int nr_pages); |
| 253 | extern void sparse_remove_one_section(struct zone *zone, struct mem_section *ms); | 257 | extern void sparse_remove_one_section(struct zone *zone, struct mem_section *ms); |
diff --git a/include/linux/mfd/88pm80x.h b/include/linux/mfd/88pm80x.h index 478672ed0c3d..e94537befabd 100644 --- a/include/linux/mfd/88pm80x.h +++ b/include/linux/mfd/88pm80x.h | |||
| @@ -365,5 +365,5 @@ static inline int pm80x_dev_resume(struct device *dev) | |||
| 365 | 365 | ||
| 366 | extern int pm80x_init(struct i2c_client *client, | 366 | extern int pm80x_init(struct i2c_client *client, |
| 367 | const struct i2c_device_id *id); | 367 | const struct i2c_device_id *id); |
| 368 | extern int pm80x_deinit(struct i2c_client *client); | 368 | extern int pm80x_deinit(void); |
| 369 | #endif /* __LINUX_MFD_88PM80X_H */ | 369 | #endif /* __LINUX_MFD_88PM80X_H */ |
diff --git a/include/linux/mfd/abx500.h b/include/linux/mfd/abx500.h index 80e3b8683a84..9ead60bc66b7 100644 --- a/include/linux/mfd/abx500.h +++ b/include/linux/mfd/abx500.h | |||
| @@ -311,6 +311,7 @@ int abx500_mask_and_set_register_interruptible(struct device *dev, u8 bank, | |||
| 311 | int abx500_get_chip_id(struct device *dev); | 311 | int abx500_get_chip_id(struct device *dev); |
| 312 | int abx500_event_registers_startup_state_get(struct device *dev, u8 *event); | 312 | int abx500_event_registers_startup_state_get(struct device *dev, u8 *event); |
| 313 | int abx500_startup_irq_enabled(struct device *dev, unsigned int irq); | 313 | int abx500_startup_irq_enabled(struct device *dev, unsigned int irq); |
| 314 | void abx500_dump_all_banks(void); | ||
| 314 | 315 | ||
| 315 | struct abx500_ops { | 316 | struct abx500_ops { |
| 316 | int (*get_chip_id) (struct device *); | 317 | int (*get_chip_id) (struct device *); |
| @@ -321,6 +322,7 @@ struct abx500_ops { | |||
| 321 | int (*mask_and_set_register) (struct device *, u8, u8, u8, u8); | 322 | int (*mask_and_set_register) (struct device *, u8, u8, u8, u8); |
| 322 | int (*event_registers_startup_state_get) (struct device *, u8 *); | 323 | int (*event_registers_startup_state_get) (struct device *, u8 *); |
| 323 | int (*startup_irq_enabled) (struct device *, unsigned int); | 324 | int (*startup_irq_enabled) (struct device *, unsigned int); |
| 325 | void (*dump_all_banks) (struct device *); | ||
| 324 | }; | 326 | }; |
| 325 | 327 | ||
| 326 | int abx500_register_ops(struct device *core_dev, struct abx500_ops *ops); | 328 | int abx500_register_ops(struct device *core_dev, struct abx500_ops *ops); |
diff --git a/include/linux/mfd/abx500/ab8500-sysctrl.h b/include/linux/mfd/abx500/ab8500-sysctrl.h index 10eb50973c39..ebf12e793db9 100644 --- a/include/linux/mfd/abx500/ab8500-sysctrl.h +++ b/include/linux/mfd/abx500/ab8500-sysctrl.h | |||
| @@ -37,6 +37,11 @@ static inline int ab8500_sysctrl_clear(u16 reg, u8 bits) | |||
| 37 | return ab8500_sysctrl_write(reg, bits, 0); | 37 | return ab8500_sysctrl_write(reg, bits, 0); |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | /* Configuration data for SysClkReq1RfClkBuf - SysClkReq8RfClkBuf */ | ||
| 41 | struct ab8500_sysctrl_platform_data { | ||
| 42 | u8 initial_req_buf_config[8]; | ||
| 43 | }; | ||
| 44 | |||
| 40 | /* Registers */ | 45 | /* Registers */ |
| 41 | #define AB8500_TURNONSTATUS 0x100 | 46 | #define AB8500_TURNONSTATUS 0x100 |
| 42 | #define AB8500_RESETSTATUS 0x101 | 47 | #define AB8500_RESETSTATUS 0x101 |
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h index fc0534483c72..9db0bda446a0 100644 --- a/include/linux/mfd/abx500/ab8500.h +++ b/include/linux/mfd/abx500/ab8500.h | |||
| @@ -368,10 +368,12 @@ struct regulator_reg_init; | |||
| 368 | struct regulator_init_data; | 368 | struct regulator_init_data; |
| 369 | struct ab8500_gpio_platform_data; | 369 | struct ab8500_gpio_platform_data; |
| 370 | struct ab8500_codec_platform_data; | 370 | struct ab8500_codec_platform_data; |
| 371 | struct ab8500_sysctrl_platform_data; | ||
| 371 | 372 | ||
| 372 | /** | 373 | /** |
| 373 | * struct ab8500_platform_data - AB8500 platform data | 374 | * struct ab8500_platform_data - AB8500 platform data |
| 374 | * @irq_base: start of AB8500 IRQs, AB8500_NR_IRQS will be used | 375 | * @irq_base: start of AB8500 IRQs, AB8500_NR_IRQS will be used |
| 376 | * @pm_power_off: Should machine pm power off hook be registered or not | ||
| 375 | * @init: board-specific initialization after detection of ab8500 | 377 | * @init: board-specific initialization after detection of ab8500 |
| 376 | * @num_regulator_reg_init: number of regulator init registers | 378 | * @num_regulator_reg_init: number of regulator init registers |
| 377 | * @regulator_reg_init: regulator init registers | 379 | * @regulator_reg_init: regulator init registers |
| @@ -380,6 +382,7 @@ struct ab8500_codec_platform_data; | |||
| 380 | */ | 382 | */ |
| 381 | struct ab8500_platform_data { | 383 | struct ab8500_platform_data { |
| 382 | int irq_base; | 384 | int irq_base; |
| 385 | bool pm_power_off; | ||
| 383 | void (*init) (struct ab8500 *); | 386 | void (*init) (struct ab8500 *); |
| 384 | int num_regulator_reg_init; | 387 | int num_regulator_reg_init; |
| 385 | struct ab8500_regulator_reg_init *regulator_reg_init; | 388 | struct ab8500_regulator_reg_init *regulator_reg_init; |
| @@ -387,6 +390,7 @@ struct ab8500_platform_data { | |||
| 387 | struct regulator_init_data *regulator; | 390 | struct regulator_init_data *regulator; |
| 388 | struct abx500_gpio_platform_data *gpio; | 391 | struct abx500_gpio_platform_data *gpio; |
| 389 | struct ab8500_codec_platform_data *codec; | 392 | struct ab8500_codec_platform_data *codec; |
| 393 | struct ab8500_sysctrl_platform_data *sysctrl; | ||
| 390 | }; | 394 | }; |
| 391 | 395 | ||
| 392 | extern int ab8500_init(struct ab8500 *ab8500, | 396 | extern int ab8500_init(struct ab8500 *ab8500, |
| @@ -508,4 +512,12 @@ static inline int is_ab9540_2p0_or_earlier(struct ab8500 *ab) | |||
| 508 | return (is_ab9540(ab) && (ab->chip_id < AB8500_CUT2P0)); | 512 | return (is_ab9540(ab) && (ab->chip_id < AB8500_CUT2P0)); |
| 509 | } | 513 | } |
| 510 | 514 | ||
| 515 | #ifdef CONFIG_AB8500_DEBUG | ||
| 516 | void ab8500_dump_all_banks(struct device *dev); | ||
| 517 | void ab8500_debug_register_interrupt(int line); | ||
| 518 | #else | ||
| 519 | static inline void ab8500_dump_all_banks(struct device *dev) {} | ||
| 520 | static inline void ab8500_debug_register_interrupt(int line) {} | ||
| 521 | #endif | ||
| 522 | |||
| 511 | #endif /* MFD_AB8500_H */ | 523 | #endif /* MFD_AB8500_H */ |
diff --git a/include/linux/mfd/arizona/pdata.h b/include/linux/mfd/arizona/pdata.h index 96d64f2b8d78..455c51d22d6b 100644 --- a/include/linux/mfd/arizona/pdata.h +++ b/include/linux/mfd/arizona/pdata.h | |||
| @@ -56,6 +56,8 @@ | |||
| 56 | #define ARIZONA_DMIC_MICBIAS2 2 | 56 | #define ARIZONA_DMIC_MICBIAS2 2 |
| 57 | #define ARIZONA_DMIC_MICBIAS3 3 | 57 | #define ARIZONA_DMIC_MICBIAS3 3 |
| 58 | 58 | ||
| 59 | #define ARIZONA_MAX_MICBIAS 3 | ||
| 60 | |||
| 59 | #define ARIZONA_INMODE_DIFF 0 | 61 | #define ARIZONA_INMODE_DIFF 0 |
| 60 | #define ARIZONA_INMODE_SE 1 | 62 | #define ARIZONA_INMODE_SE 1 |
| 61 | #define ARIZONA_INMODE_DMIC 2 | 63 | #define ARIZONA_INMODE_DMIC 2 |
| @@ -71,6 +73,13 @@ | |||
| 71 | 73 | ||
| 72 | struct regulator_init_data; | 74 | struct regulator_init_data; |
| 73 | 75 | ||
| 76 | struct arizona_micbias { | ||
| 77 | int mV; /** Regulated voltage */ | ||
| 78 | unsigned int ext_cap:1; /** External capacitor fitted */ | ||
| 79 | unsigned int discharge:1; /** Actively discharge */ | ||
| 80 | unsigned int fast_start:1; /** Enable aggressive startup ramp rate */ | ||
| 81 | }; | ||
| 82 | |||
| 74 | struct arizona_micd_config { | 83 | struct arizona_micd_config { |
| 75 | unsigned int src; | 84 | unsigned int src; |
| 76 | unsigned int bias; | 85 | unsigned int bias; |
| @@ -136,6 +145,9 @@ struct arizona_pdata { | |||
| 136 | /** Reference voltage for DMIC inputs */ | 145 | /** Reference voltage for DMIC inputs */ |
| 137 | int dmic_ref[ARIZONA_MAX_INPUT]; | 146 | int dmic_ref[ARIZONA_MAX_INPUT]; |
| 138 | 147 | ||
| 148 | /** MICBIAS configurations */ | ||
| 149 | struct arizona_micbias micbias[ARIZONA_MAX_MICBIAS]; | ||
| 150 | |||
| 139 | /** Mode of input structures */ | 151 | /** Mode of input structures */ |
| 140 | int inmode[ARIZONA_MAX_INPUT]; | 152 | int inmode[ARIZONA_MAX_INPUT]; |
| 141 | 153 | ||
diff --git a/include/linux/mfd/arizona/registers.h b/include/linux/mfd/arizona/registers.h index 188d89abd963..340355136069 100644 --- a/include/linux/mfd/arizona/registers.h +++ b/include/linux/mfd/arizona/registers.h | |||
| @@ -984,18 +984,34 @@ | |||
| 984 | #define ARIZONA_DSP1_STATUS_1 0x1104 | 984 | #define ARIZONA_DSP1_STATUS_1 0x1104 |
| 985 | #define ARIZONA_DSP1_STATUS_2 0x1105 | 985 | #define ARIZONA_DSP1_STATUS_2 0x1105 |
| 986 | #define ARIZONA_DSP1_STATUS_3 0x1106 | 986 | #define ARIZONA_DSP1_STATUS_3 0x1106 |
| 987 | #define ARIZONA_DSP1_SCRATCH_0 0x1140 | ||
| 988 | #define ARIZONA_DSP1_SCRATCH_1 0x1141 | ||
| 989 | #define ARIZONA_DSP1_SCRATCH_2 0x1142 | ||
| 990 | #define ARIZONA_DSP1_SCRATCH_3 0x1143 | ||
| 987 | #define ARIZONA_DSP2_CONTROL_1 0x1200 | 991 | #define ARIZONA_DSP2_CONTROL_1 0x1200 |
| 988 | #define ARIZONA_DSP2_CLOCKING_1 0x1201 | 992 | #define ARIZONA_DSP2_CLOCKING_1 0x1201 |
| 989 | #define ARIZONA_DSP2_STATUS_1 0x1204 | 993 | #define ARIZONA_DSP2_STATUS_1 0x1204 |
| 990 | #define ARIZONA_DSP2_STATUS_2 0x1205 | 994 | #define ARIZONA_DSP2_STATUS_2 0x1205 |
| 995 | #define ARIZONA_DSP2_SCRATCH_0 0x1240 | ||
| 996 | #define ARIZONA_DSP2_SCRATCH_1 0x1241 | ||
| 997 | #define ARIZONA_DSP2_SCRATCH_2 0x1242 | ||
| 998 | #define ARIZONA_DSP2_SCRATCH_3 0x1243 | ||
| 991 | #define ARIZONA_DSP3_CONTROL_1 0x1300 | 999 | #define ARIZONA_DSP3_CONTROL_1 0x1300 |
| 992 | #define ARIZONA_DSP3_CLOCKING_1 0x1301 | 1000 | #define ARIZONA_DSP3_CLOCKING_1 0x1301 |
| 993 | #define ARIZONA_DSP3_STATUS_1 0x1304 | 1001 | #define ARIZONA_DSP3_STATUS_1 0x1304 |
| 994 | #define ARIZONA_DSP3_STATUS_2 0x1305 | 1002 | #define ARIZONA_DSP3_STATUS_2 0x1305 |
| 1003 | #define ARIZONA_DSP3_SCRATCH_0 0x1340 | ||
| 1004 | #define ARIZONA_DSP3_SCRATCH_1 0x1341 | ||
| 1005 | #define ARIZONA_DSP3_SCRATCH_2 0x1342 | ||
| 1006 | #define ARIZONA_DSP3_SCRATCH_3 0x1343 | ||
| 995 | #define ARIZONA_DSP4_CONTROL_1 0x1400 | 1007 | #define ARIZONA_DSP4_CONTROL_1 0x1400 |
| 996 | #define ARIZONA_DSP4_CLOCKING_1 0x1401 | 1008 | #define ARIZONA_DSP4_CLOCKING_1 0x1401 |
| 997 | #define ARIZONA_DSP4_STATUS_1 0x1404 | 1009 | #define ARIZONA_DSP4_STATUS_1 0x1404 |
| 998 | #define ARIZONA_DSP4_STATUS_2 0x1405 | 1010 | #define ARIZONA_DSP4_STATUS_2 0x1405 |
| 1011 | #define ARIZONA_DSP4_SCRATCH_0 0x1440 | ||
| 1012 | #define ARIZONA_DSP4_SCRATCH_1 0x1441 | ||
| 1013 | #define ARIZONA_DSP4_SCRATCH_2 0x1442 | ||
| 1014 | #define ARIZONA_DSP4_SCRATCH_3 0x1443 | ||
| 999 | 1015 | ||
| 1000 | /* | 1016 | /* |
| 1001 | * Field Definitions. | 1017 | * Field Definitions. |
diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h index f8bac7cfc25f..3abcca91eecd 100644 --- a/include/linux/mfd/dbx500-prcmu.h +++ b/include/linux/mfd/dbx500-prcmu.h | |||
| @@ -151,6 +151,18 @@ enum prcmu_clock { | |||
| 151 | }; | 151 | }; |
| 152 | 152 | ||
| 153 | /** | 153 | /** |
| 154 | * enum prcmu_wdog_id - PRCMU watchdog IDs | ||
| 155 | * @PRCMU_WDOG_ALL: use all timers | ||
| 156 | * @PRCMU_WDOG_CPU1: use first CPU timer only | ||
| 157 | * @PRCMU_WDOG_CPU2: use second CPU timer conly | ||
| 158 | */ | ||
| 159 | enum prcmu_wdog_id { | ||
| 160 | PRCMU_WDOG_ALL = 0x00, | ||
| 161 | PRCMU_WDOG_CPU1 = 0x01, | ||
| 162 | PRCMU_WDOG_CPU2 = 0x02, | ||
| 163 | }; | ||
| 164 | |||
| 165 | /** | ||
| 154 | * enum ape_opp - APE OPP states definition | 166 | * enum ape_opp - APE OPP states definition |
| 155 | * @APE_OPP_INIT: | 167 | * @APE_OPP_INIT: |
| 156 | * @APE_NO_CHANGE: The APE operating point is unchanged | 168 | * @APE_NO_CHANGE: The APE operating point is unchanged |
diff --git a/include/linux/mfd/lp8788.h b/include/linux/mfd/lp8788.h index 2a32b16f79cb..786bf6679a28 100644 --- a/include/linux/mfd/lp8788.h +++ b/include/linux/mfd/lp8788.h | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | #include <linux/gpio.h> | 17 | #include <linux/gpio.h> |
| 18 | #include <linux/irqdomain.h> | 18 | #include <linux/irqdomain.h> |
| 19 | #include <linux/pwm.h> | ||
| 19 | #include <linux/regmap.h> | 20 | #include <linux/regmap.h> |
| 20 | 21 | ||
| 21 | #define LP8788_DEV_BUCK "lp8788-buck" | 22 | #define LP8788_DEV_BUCK "lp8788-buck" |
| @@ -124,11 +125,6 @@ enum lp8788_bl_ramp_step { | |||
| 124 | LP8788_RAMP_65538us, | 125 | LP8788_RAMP_65538us, |
| 125 | }; | 126 | }; |
| 126 | 127 | ||
| 127 | enum lp8788_bl_pwm_polarity { | ||
| 128 | LP8788_PWM_ACTIVE_HIGH, | ||
| 129 | LP8788_PWM_ACTIVE_LOW, | ||
| 130 | }; | ||
| 131 | |||
| 132 | enum lp8788_isink_scale { | 128 | enum lp8788_isink_scale { |
| 133 | LP8788_ISINK_SCALE_100mA, | 129 | LP8788_ISINK_SCALE_100mA, |
| 134 | LP8788_ISINK_SCALE_120mA, | 130 | LP8788_ISINK_SCALE_120mA, |
| @@ -229,16 +225,6 @@ struct lp8788_charger_platform_data { | |||
| 229 | }; | 225 | }; |
| 230 | 226 | ||
| 231 | /* | 227 | /* |
| 232 | * struct lp8788_bl_pwm_data | ||
| 233 | * @pwm_set_intensity : set duty of pwm | ||
| 234 | * @pwm_get_intensity : get current duty of pwm | ||
| 235 | */ | ||
| 236 | struct lp8788_bl_pwm_data { | ||
| 237 | void (*pwm_set_intensity) (int brightness, int max_brightness); | ||
| 238 | int (*pwm_get_intensity) (int max_brightness); | ||
| 239 | }; | ||
| 240 | |||
| 241 | /* | ||
| 242 | * struct lp8788_backlight_platform_data | 228 | * struct lp8788_backlight_platform_data |
| 243 | * @name : backlight driver name. (default: "lcd-backlight") | 229 | * @name : backlight driver name. (default: "lcd-backlight") |
| 244 | * @initial_brightness : initial value of backlight brightness | 230 | * @initial_brightness : initial value of backlight brightness |
| @@ -248,8 +234,8 @@ struct lp8788_bl_pwm_data { | |||
| 248 | * @rise_time : brightness ramp up step time | 234 | * @rise_time : brightness ramp up step time |
| 249 | * @fall_time : brightness ramp down step time | 235 | * @fall_time : brightness ramp down step time |
| 250 | * @pwm_pol : pwm polarity setting when bl_mode is pwm based | 236 | * @pwm_pol : pwm polarity setting when bl_mode is pwm based |
| 251 | * @pwm_data : platform specific pwm generation functions | 237 | * @period_ns : platform specific pwm period value. unit is nano. |
| 252 | * only valid when bl_mode is pwm based | 238 | Only valid when bl_mode is LP8788_BL_COMB_PWM_BASED |
| 253 | */ | 239 | */ |
| 254 | struct lp8788_backlight_platform_data { | 240 | struct lp8788_backlight_platform_data { |
| 255 | char *name; | 241 | char *name; |
| @@ -259,8 +245,8 @@ struct lp8788_backlight_platform_data { | |||
| 259 | enum lp8788_bl_full_scale_current full_scale; | 245 | enum lp8788_bl_full_scale_current full_scale; |
| 260 | enum lp8788_bl_ramp_step rise_time; | 246 | enum lp8788_bl_ramp_step rise_time; |
| 261 | enum lp8788_bl_ramp_step fall_time; | 247 | enum lp8788_bl_ramp_step fall_time; |
| 262 | enum lp8788_bl_pwm_polarity pwm_pol; | 248 | enum pwm_polarity pwm_pol; |
| 263 | struct lp8788_bl_pwm_data pwm_data; | 249 | unsigned int period_ns; |
| 264 | }; | 250 | }; |
| 265 | 251 | ||
| 266 | /* | 252 | /* |
diff --git a/include/linux/mfd/max8925.h b/include/linux/mfd/max8925.h index 74d8e2969630..ce8502e9e7dc 100644 --- a/include/linux/mfd/max8925.h +++ b/include/linux/mfd/max8925.h | |||
| @@ -190,6 +190,8 @@ enum { | |||
| 190 | MAX8925_NR_IRQS, | 190 | MAX8925_NR_IRQS, |
| 191 | }; | 191 | }; |
| 192 | 192 | ||
| 193 | |||
| 194 | |||
| 193 | struct max8925_chip { | 195 | struct max8925_chip { |
| 194 | struct device *dev; | 196 | struct device *dev; |
| 195 | struct i2c_client *i2c; | 197 | struct i2c_client *i2c; |
| @@ -201,7 +203,6 @@ struct max8925_chip { | |||
| 201 | int irq_base; | 203 | int irq_base; |
| 202 | int core_irq; | 204 | int core_irq; |
| 203 | int tsc_irq; | 205 | int tsc_irq; |
| 204 | |||
| 205 | unsigned int wakeup_flag; | 206 | unsigned int wakeup_flag; |
| 206 | }; | 207 | }; |
| 207 | 208 | ||
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h index 29f6616e12f0..a4d13d7cd001 100644 --- a/include/linux/mfd/palmas.h +++ b/include/linux/mfd/palmas.h | |||
| @@ -2789,4 +2789,56 @@ enum usb_irq_events { | |||
| 2789 | #define PALMAS_GPADC_TRIM15 0xE | 2789 | #define PALMAS_GPADC_TRIM15 0xE |
| 2790 | #define PALMAS_GPADC_TRIM16 0xF | 2790 | #define PALMAS_GPADC_TRIM16 0xF |
| 2791 | 2791 | ||
| 2792 | static inline int palmas_read(struct palmas *palmas, unsigned int base, | ||
| 2793 | unsigned int reg, unsigned int *val) | ||
| 2794 | { | ||
| 2795 | unsigned int addr = PALMAS_BASE_TO_REG(base, reg); | ||
| 2796 | int slave_id = PALMAS_BASE_TO_SLAVE(base); | ||
| 2797 | |||
| 2798 | return regmap_read(palmas->regmap[slave_id], addr, val); | ||
| 2799 | } | ||
| 2800 | |||
| 2801 | static inline int palmas_write(struct palmas *palmas, unsigned int base, | ||
| 2802 | unsigned int reg, unsigned int value) | ||
| 2803 | { | ||
| 2804 | unsigned int addr = PALMAS_BASE_TO_REG(base, reg); | ||
| 2805 | int slave_id = PALMAS_BASE_TO_SLAVE(base); | ||
| 2806 | |||
| 2807 | return regmap_write(palmas->regmap[slave_id], addr, value); | ||
| 2808 | } | ||
| 2809 | |||
| 2810 | static inline int palmas_bulk_write(struct palmas *palmas, unsigned int base, | ||
| 2811 | unsigned int reg, const void *val, size_t val_count) | ||
| 2812 | { | ||
| 2813 | unsigned int addr = PALMAS_BASE_TO_REG(base, reg); | ||
| 2814 | int slave_id = PALMAS_BASE_TO_SLAVE(base); | ||
| 2815 | |||
| 2816 | return regmap_bulk_write(palmas->regmap[slave_id], addr, | ||
| 2817 | val, val_count); | ||
| 2818 | } | ||
| 2819 | |||
| 2820 | static inline int palmas_bulk_read(struct palmas *palmas, unsigned int base, | ||
| 2821 | unsigned int reg, void *val, size_t val_count) | ||
| 2822 | { | ||
| 2823 | unsigned int addr = PALMAS_BASE_TO_REG(base, reg); | ||
| 2824 | int slave_id = PALMAS_BASE_TO_SLAVE(base); | ||
| 2825 | |||
| 2826 | return regmap_bulk_read(palmas->regmap[slave_id], addr, | ||
| 2827 | val, val_count); | ||
| 2828 | } | ||
| 2829 | |||
| 2830 | static inline int palmas_update_bits(struct palmas *palmas, unsigned int base, | ||
| 2831 | unsigned int reg, unsigned int mask, unsigned int val) | ||
| 2832 | { | ||
| 2833 | unsigned int addr = PALMAS_BASE_TO_REG(base, reg); | ||
| 2834 | int slave_id = PALMAS_BASE_TO_SLAVE(base); | ||
| 2835 | |||
| 2836 | return regmap_update_bits(palmas->regmap[slave_id], addr, mask, val); | ||
| 2837 | } | ||
| 2838 | |||
| 2839 | static inline int palmas_irq_get_virq(struct palmas *palmas, int irq) | ||
| 2840 | { | ||
| 2841 | return regmap_irq_get_virq(palmas->irq_data, irq); | ||
| 2842 | } | ||
| 2843 | |||
| 2792 | #endif /* __LINUX_MFD_PALMAS_H */ | 2844 | #endif /* __LINUX_MFD_PALMAS_H */ |
diff --git a/include/linux/mfd/rtsx_pci.h b/include/linux/mfd/rtsx_pci.h index 4b117a3f54d4..26ea7f1b7caf 100644 --- a/include/linux/mfd/rtsx_pci.h +++ b/include/linux/mfd/rtsx_pci.h | |||
| @@ -465,7 +465,7 @@ | |||
| 465 | #define SD_RSP_TYPE_R6 0x01 | 465 | #define SD_RSP_TYPE_R6 0x01 |
| 466 | #define SD_RSP_TYPE_R7 0x01 | 466 | #define SD_RSP_TYPE_R7 0x01 |
| 467 | 467 | ||
| 468 | /* SD_CONFIURE3 */ | 468 | /* SD_CONFIGURE3 */ |
| 469 | #define SD_RSP_80CLK_TIMEOUT_EN 0x01 | 469 | #define SD_RSP_80CLK_TIMEOUT_EN 0x01 |
| 470 | 470 | ||
| 471 | /* Card Transfer Reset Register */ | 471 | /* Card Transfer Reset Register */ |
| @@ -581,8 +581,11 @@ | |||
| 581 | #define CARD_GPIO_DIR 0xFD57 | 581 | #define CARD_GPIO_DIR 0xFD57 |
| 582 | #define CARD_GPIO 0xFD58 | 582 | #define CARD_GPIO 0xFD58 |
| 583 | #define CARD_DATA_SOURCE 0xFD5B | 583 | #define CARD_DATA_SOURCE 0xFD5B |
| 584 | #define SD30_CLK_DRIVE_SEL 0xFD5A | ||
| 584 | #define CARD_SELECT 0xFD5C | 585 | #define CARD_SELECT 0xFD5C |
| 585 | #define SD30_DRIVE_SEL 0xFD5E | 586 | #define SD30_DRIVE_SEL 0xFD5E |
| 587 | #define SD30_CMD_DRIVE_SEL 0xFD5E | ||
| 588 | #define SD30_DAT_DRIVE_SEL 0xFD5F | ||
| 586 | #define CARD_CLK_EN 0xFD69 | 589 | #define CARD_CLK_EN 0xFD69 |
| 587 | #define SDIO_CTRL 0xFD6B | 590 | #define SDIO_CTRL 0xFD6B |
| 588 | #define CD_PAD_CTL 0xFD73 | 591 | #define CD_PAD_CTL 0xFD73 |
| @@ -655,6 +658,8 @@ | |||
| 655 | #define MSGTXDATA3 0xFE47 | 658 | #define MSGTXDATA3 0xFE47 |
| 656 | #define MSGTXCTL 0xFE48 | 659 | #define MSGTXCTL 0xFE48 |
| 657 | #define PETXCFG 0xFE49 | 660 | #define PETXCFG 0xFE49 |
| 661 | #define LTR_CTL 0xFE4A | ||
| 662 | #define OBFF_CFG 0xFE4C | ||
| 658 | 663 | ||
| 659 | #define CDRESUMECTL 0xFE52 | 664 | #define CDRESUMECTL 0xFE52 |
| 660 | #define WAKE_SEL_CTL 0xFE54 | 665 | #define WAKE_SEL_CTL 0xFE54 |
| @@ -735,6 +740,7 @@ struct rtsx_pcr { | |||
| 735 | 740 | ||
| 736 | unsigned int card_inserted; | 741 | unsigned int card_inserted; |
| 737 | unsigned int card_removed; | 742 | unsigned int card_removed; |
| 743 | unsigned int card_exist; | ||
| 738 | 744 | ||
| 739 | struct delayed_work carddet_work; | 745 | struct delayed_work carddet_work; |
| 740 | struct delayed_work idle_work; | 746 | struct delayed_work idle_work; |
| @@ -799,6 +805,7 @@ int rtsx_pci_switch_clock(struct rtsx_pcr *pcr, unsigned int card_clock, | |||
| 799 | u8 ssc_depth, bool initial_mode, bool double_clk, bool vpclk); | 805 | u8 ssc_depth, bool initial_mode, bool double_clk, bool vpclk); |
| 800 | int rtsx_pci_card_power_on(struct rtsx_pcr *pcr, int card); | 806 | int rtsx_pci_card_power_on(struct rtsx_pcr *pcr, int card); |
| 801 | int rtsx_pci_card_power_off(struct rtsx_pcr *pcr, int card); | 807 | int rtsx_pci_card_power_off(struct rtsx_pcr *pcr, int card); |
| 808 | int rtsx_pci_card_exclusive_check(struct rtsx_pcr *pcr, int card); | ||
| 802 | int rtsx_pci_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage); | 809 | int rtsx_pci_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage); |
| 803 | unsigned int rtsx_pci_card_exist(struct rtsx_pcr *pcr); | 810 | unsigned int rtsx_pci_card_exist(struct rtsx_pcr *pcr); |
| 804 | void rtsx_pci_complete_unfinished_transfer(struct rtsx_pcr *pcr); | 811 | void rtsx_pci_complete_unfinished_transfer(struct rtsx_pcr *pcr); |
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index d83af39815ab..99bf3e665997 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h | |||
| @@ -65,12 +65,6 @@ | |||
| 65 | */ | 65 | */ |
| 66 | #define TMIO_MMC_SDIO_IRQ (1 << 2) | 66 | #define TMIO_MMC_SDIO_IRQ (1 << 2) |
| 67 | /* | 67 | /* |
| 68 | * Some platforms can detect card insertion events with controller powered | ||
| 69 | * down, using a GPIO IRQ, in which case they have to fill in cd_irq, cd_gpio, | ||
| 70 | * and cd_flags fields of struct tmio_mmc_data. | ||
| 71 | */ | ||
| 72 | #define TMIO_MMC_HAS_COLD_CD (1 << 3) | ||
| 73 | /* | ||
| 74 | * Some controllers require waiting for the SD bus to become | 68 | * Some controllers require waiting for the SD bus to become |
| 75 | * idle before writing to some registers. | 69 | * idle before writing to some registers. |
| 76 | */ | 70 | */ |
| @@ -117,18 +111,6 @@ struct tmio_mmc_data { | |||
| 117 | }; | 111 | }; |
| 118 | 112 | ||
| 119 | /* | 113 | /* |
| 120 | * This function is deprecated and will be removed soon. Please, convert your | ||
| 121 | * platform to use drivers/mmc/core/cd-gpio.c | ||
| 122 | */ | ||
| 123 | #include <linux/mmc/host.h> | ||
| 124 | static inline void tmio_mmc_cd_wakeup(struct tmio_mmc_data *pdata) | ||
| 125 | { | ||
| 126 | if (pdata) | ||
| 127 | mmc_detect_change(dev_get_drvdata(pdata->dev), | ||
| 128 | msecs_to_jiffies(100)); | ||
| 129 | } | ||
| 130 | |||
| 131 | /* | ||
| 132 | * data for the NAND controller | 114 | * data for the NAND controller |
| 133 | */ | 115 | */ |
| 134 | struct tmio_nand_data { | 116 | struct tmio_nand_data { |
diff --git a/include/linux/migrate.h b/include/linux/migrate.h index 1e9f627967a3..a405d3dc0f61 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h | |||
| @@ -40,11 +40,9 @@ extern void putback_movable_pages(struct list_head *l); | |||
| 40 | extern int migrate_page(struct address_space *, | 40 | extern int migrate_page(struct address_space *, |
| 41 | struct page *, struct page *, enum migrate_mode); | 41 | struct page *, struct page *, enum migrate_mode); |
| 42 | extern int migrate_pages(struct list_head *l, new_page_t x, | 42 | extern int migrate_pages(struct list_head *l, new_page_t x, |
| 43 | unsigned long private, bool offlining, | 43 | unsigned long private, enum migrate_mode mode, int reason); |
| 44 | enum migrate_mode mode, int reason); | ||
| 45 | extern int migrate_huge_page(struct page *, new_page_t x, | 44 | extern int migrate_huge_page(struct page *, new_page_t x, |
| 46 | unsigned long private, bool offlining, | 45 | unsigned long private, enum migrate_mode mode); |
| 47 | enum migrate_mode mode); | ||
| 48 | 46 | ||
| 49 | extern int fail_migrate_page(struct address_space *, | 47 | extern int fail_migrate_page(struct address_space *, |
| 50 | struct page *, struct page *); | 48 | struct page *, struct page *); |
| @@ -62,11 +60,11 @@ extern int migrate_huge_page_move_mapping(struct address_space *mapping, | |||
| 62 | static inline void putback_lru_pages(struct list_head *l) {} | 60 | static inline void putback_lru_pages(struct list_head *l) {} |
| 63 | static inline void putback_movable_pages(struct list_head *l) {} | 61 | static inline void putback_movable_pages(struct list_head *l) {} |
| 64 | static inline int migrate_pages(struct list_head *l, new_page_t x, | 62 | static inline int migrate_pages(struct list_head *l, new_page_t x, |
| 65 | unsigned long private, bool offlining, | 63 | unsigned long private, enum migrate_mode mode, int reason) |
| 66 | enum migrate_mode mode, int reason) { return -ENOSYS; } | 64 | { return -ENOSYS; } |
| 67 | static inline int migrate_huge_page(struct page *page, new_page_t x, | 65 | static inline int migrate_huge_page(struct page *page, new_page_t x, |
| 68 | unsigned long private, bool offlining, | 66 | unsigned long private, enum migrate_mode mode) |
| 69 | enum migrate_mode mode) { return -ENOSYS; } | 67 | { return -ENOSYS; } |
| 70 | 68 | ||
| 71 | static inline int migrate_prep(void) { return -ENOSYS; } | 69 | static inline int migrate_prep(void) { return -ENOSYS; } |
| 72 | static inline int migrate_prep_local(void) { return -ENOSYS; } | 70 | static inline int migrate_prep_local(void) { return -ENOSYS; } |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 6d48fce06b4a..811f91cf5e8c 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
| @@ -171,6 +171,7 @@ enum { | |||
| 171 | #define MLX4_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90) | 171 | #define MLX4_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90) |
| 172 | 172 | ||
| 173 | enum { | 173 | enum { |
| 174 | MLX4_BMME_FLAG_WIN_TYPE_2B = 1 << 1, | ||
| 174 | MLX4_BMME_FLAG_LOCAL_INV = 1 << 6, | 175 | MLX4_BMME_FLAG_LOCAL_INV = 1 << 6, |
| 175 | MLX4_BMME_FLAG_REMOTE_INV = 1 << 7, | 176 | MLX4_BMME_FLAG_REMOTE_INV = 1 << 7, |
| 176 | MLX4_BMME_FLAG_TYPE_2_WIN = 1 << 9, | 177 | MLX4_BMME_FLAG_TYPE_2_WIN = 1 << 9, |
| @@ -238,7 +239,8 @@ enum { | |||
| 238 | MLX4_PERM_LOCAL_WRITE = 1 << 11, | 239 | MLX4_PERM_LOCAL_WRITE = 1 << 11, |
| 239 | MLX4_PERM_REMOTE_READ = 1 << 12, | 240 | MLX4_PERM_REMOTE_READ = 1 << 12, |
| 240 | MLX4_PERM_REMOTE_WRITE = 1 << 13, | 241 | MLX4_PERM_REMOTE_WRITE = 1 << 13, |
| 241 | MLX4_PERM_ATOMIC = 1 << 14 | 242 | MLX4_PERM_ATOMIC = 1 << 14, |
| 243 | MLX4_PERM_BIND_MW = 1 << 15, | ||
| 242 | }; | 244 | }; |
| 243 | 245 | ||
| 244 | enum { | 246 | enum { |
| @@ -504,6 +506,18 @@ struct mlx4_mr { | |||
| 504 | int enabled; | 506 | int enabled; |
| 505 | }; | 507 | }; |
| 506 | 508 | ||
| 509 | enum mlx4_mw_type { | ||
| 510 | MLX4_MW_TYPE_1 = 1, | ||
| 511 | MLX4_MW_TYPE_2 = 2, | ||
| 512 | }; | ||
| 513 | |||
| 514 | struct mlx4_mw { | ||
| 515 | u32 key; | ||
| 516 | u32 pd; | ||
| 517 | enum mlx4_mw_type type; | ||
| 518 | int enabled; | ||
| 519 | }; | ||
| 520 | |||
| 507 | struct mlx4_fmr { | 521 | struct mlx4_fmr { |
| 508 | struct mlx4_mr mr; | 522 | struct mlx4_mr mr; |
| 509 | struct mlx4_mpt_entry *mpt; | 523 | struct mlx4_mpt_entry *mpt; |
| @@ -802,8 +816,12 @@ u64 mlx4_mtt_addr(struct mlx4_dev *dev, struct mlx4_mtt *mtt); | |||
| 802 | 816 | ||
| 803 | int mlx4_mr_alloc(struct mlx4_dev *dev, u32 pd, u64 iova, u64 size, u32 access, | 817 | int mlx4_mr_alloc(struct mlx4_dev *dev, u32 pd, u64 iova, u64 size, u32 access, |
| 804 | int npages, int page_shift, struct mlx4_mr *mr); | 818 | int npages, int page_shift, struct mlx4_mr *mr); |
| 805 | void mlx4_mr_free(struct mlx4_dev *dev, struct mlx4_mr *mr); | 819 | int mlx4_mr_free(struct mlx4_dev *dev, struct mlx4_mr *mr); |
| 806 | int mlx4_mr_enable(struct mlx4_dev *dev, struct mlx4_mr *mr); | 820 | int mlx4_mr_enable(struct mlx4_dev *dev, struct mlx4_mr *mr); |
| 821 | int mlx4_mw_alloc(struct mlx4_dev *dev, u32 pd, enum mlx4_mw_type type, | ||
| 822 | struct mlx4_mw *mw); | ||
| 823 | void mlx4_mw_free(struct mlx4_dev *dev, struct mlx4_mw *mw); | ||
| 824 | int mlx4_mw_enable(struct mlx4_dev *dev, struct mlx4_mw *mw); | ||
| 807 | int mlx4_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt, | 825 | int mlx4_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt, |
| 808 | int start_index, int npages, u64 *page_list); | 826 | int start_index, int npages, u64 *page_list); |
| 809 | int mlx4_buf_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt, | 827 | int mlx4_buf_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt, |
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h index 4b4ad6ffef92..67f46ad6920a 100644 --- a/include/linux/mlx4/qp.h +++ b/include/linux/mlx4/qp.h | |||
| @@ -265,6 +265,11 @@ struct mlx4_wqe_lso_seg { | |||
| 265 | __be32 header[0]; | 265 | __be32 header[0]; |
| 266 | }; | 266 | }; |
| 267 | 267 | ||
| 268 | enum mlx4_wqe_bind_seg_flags2 { | ||
| 269 | MLX4_WQE_BIND_ZERO_BASED = (1 << 30), | ||
| 270 | MLX4_WQE_BIND_TYPE_2 = (1 << 31), | ||
| 271 | }; | ||
| 272 | |||
| 268 | struct mlx4_wqe_bind_seg { | 273 | struct mlx4_wqe_bind_seg { |
| 269 | __be32 flags1; | 274 | __be32 flags1; |
| 270 | __be32 flags2; | 275 | __be32 flags2; |
| @@ -277,9 +282,9 @@ struct mlx4_wqe_bind_seg { | |||
| 277 | enum { | 282 | enum { |
| 278 | MLX4_WQE_FMR_PERM_LOCAL_READ = 1 << 27, | 283 | MLX4_WQE_FMR_PERM_LOCAL_READ = 1 << 27, |
| 279 | MLX4_WQE_FMR_PERM_LOCAL_WRITE = 1 << 28, | 284 | MLX4_WQE_FMR_PERM_LOCAL_WRITE = 1 << 28, |
| 280 | MLX4_WQE_FMR_PERM_REMOTE_READ = 1 << 29, | 285 | MLX4_WQE_FMR_AND_BIND_PERM_REMOTE_READ = 1 << 29, |
| 281 | MLX4_WQE_FMR_PERM_REMOTE_WRITE = 1 << 30, | 286 | MLX4_WQE_FMR_AND_BIND_PERM_REMOTE_WRITE = 1 << 30, |
| 282 | MLX4_WQE_FMR_PERM_ATOMIC = 1 << 31 | 287 | MLX4_WQE_FMR_AND_BIND_PERM_ATOMIC = 1 << 31 |
| 283 | }; | 288 | }; |
| 284 | 289 | ||
| 285 | struct mlx4_wqe_fmr_seg { | 290 | struct mlx4_wqe_fmr_seg { |
| @@ -304,12 +309,10 @@ struct mlx4_wqe_fmr_ext_seg { | |||
| 304 | }; | 309 | }; |
| 305 | 310 | ||
| 306 | struct mlx4_wqe_local_inval_seg { | 311 | struct mlx4_wqe_local_inval_seg { |
| 307 | __be32 flags; | 312 | u64 reserved1; |
| 308 | u32 reserved1; | ||
| 309 | __be32 mem_key; | 313 | __be32 mem_key; |
| 310 | u32 reserved2[2]; | 314 | u32 reserved2; |
| 311 | __be32 guest_id; | 315 | u64 reserved3[2]; |
| 312 | __be64 pa; | ||
| 313 | }; | 316 | }; |
| 314 | 317 | ||
| 315 | struct mlx4_wqe_raddr_seg { | 318 | struct mlx4_wqe_raddr_seg { |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 66e2f7c61e5c..7acc9dc73c9f 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -87,6 +87,7 @@ extern unsigned int kobjsize(const void *objp); | |||
| 87 | #define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */ | 87 | #define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */ |
| 88 | #define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */ | 88 | #define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */ |
| 89 | 89 | ||
| 90 | #define VM_POPULATE 0x00001000 | ||
| 90 | #define VM_LOCKED 0x00002000 | 91 | #define VM_LOCKED 0x00002000 |
| 91 | #define VM_IO 0x00004000 /* Memory mapped I/O or similar */ | 92 | #define VM_IO 0x00004000 /* Memory mapped I/O or similar */ |
| 92 | 93 | ||
| @@ -114,6 +115,8 @@ extern unsigned int kobjsize(const void *objp); | |||
| 114 | # define VM_SAO VM_ARCH_1 /* Strong Access Ordering (powerpc) */ | 115 | # define VM_SAO VM_ARCH_1 /* Strong Access Ordering (powerpc) */ |
| 115 | #elif defined(CONFIG_PARISC) | 116 | #elif defined(CONFIG_PARISC) |
| 116 | # define VM_GROWSUP VM_ARCH_1 | 117 | # define VM_GROWSUP VM_ARCH_1 |
| 118 | #elif defined(CONFIG_METAG) | ||
| 119 | # define VM_GROWSUP VM_ARCH_1 | ||
| 117 | #elif defined(CONFIG_IA64) | 120 | #elif defined(CONFIG_IA64) |
| 118 | # define VM_GROWSUP VM_ARCH_1 | 121 | # define VM_GROWSUP VM_ARCH_1 |
| 119 | #elif !defined(CONFIG_MMU) | 122 | #elif !defined(CONFIG_MMU) |
| @@ -366,7 +369,7 @@ static inline struct page *compound_head(struct page *page) | |||
| 366 | * both from it and to it can be tracked, using atomic_inc_and_test | 369 | * both from it and to it can be tracked, using atomic_inc_and_test |
| 367 | * and atomic_add_negative(-1). | 370 | * and atomic_add_negative(-1). |
| 368 | */ | 371 | */ |
| 369 | static inline void reset_page_mapcount(struct page *page) | 372 | static inline void page_mapcount_reset(struct page *page) |
| 370 | { | 373 | { |
| 371 | atomic_set(&(page)->_mapcount, -1); | 374 | atomic_set(&(page)->_mapcount, -1); |
| 372 | } | 375 | } |
| @@ -580,50 +583,11 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma) | |||
| 580 | * sets it, so none of the operations on it need to be atomic. | 583 | * sets it, so none of the operations on it need to be atomic. |
| 581 | */ | 584 | */ |
| 582 | 585 | ||
| 583 | 586 | /* Page flags: | [SECTION] | [NODE] | ZONE | [LAST_NID] | ... | FLAGS | */ | |
| 584 | /* | ||
| 585 | * page->flags layout: | ||
| 586 | * | ||
| 587 | * There are three possibilities for how page->flags get | ||
| 588 | * laid out. The first is for the normal case, without | ||
| 589 | * sparsemem. The second is for sparsemem when there is | ||
| 590 | * plenty of space for node and section. The last is when | ||
| 591 | * we have run out of space and have to fall back to an | ||
| 592 | * alternate (slower) way of determining the node. | ||
| 593 | * | ||
| 594 | * No sparsemem or sparsemem vmemmap: | NODE | ZONE | ... | FLAGS | | ||
| 595 | * classic sparse with space for node:| SECTION | NODE | ZONE | ... | FLAGS | | ||
| 596 | * classic sparse no space for node: | SECTION | ZONE | ... | FLAGS | | ||
| 597 | */ | ||
| 598 | #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) | ||
| 599 | #define SECTIONS_WIDTH SECTIONS_SHIFT | ||
| 600 | #else | ||
| 601 | #define SECTIONS_WIDTH 0 | ||
| 602 | #endif | ||
| 603 | |||
| 604 | #define ZONES_WIDTH ZONES_SHIFT | ||
| 605 | |||
| 606 | #if SECTIONS_WIDTH+ZONES_WIDTH+NODES_SHIFT <= BITS_PER_LONG - NR_PAGEFLAGS | ||
| 607 | #define NODES_WIDTH NODES_SHIFT | ||
| 608 | #else | ||
| 609 | #ifdef CONFIG_SPARSEMEM_VMEMMAP | ||
| 610 | #error "Vmemmap: No space for nodes field in page flags" | ||
| 611 | #endif | ||
| 612 | #define NODES_WIDTH 0 | ||
| 613 | #endif | ||
| 614 | |||
| 615 | /* Page flags: | [SECTION] | [NODE] | ZONE | ... | FLAGS | */ | ||
| 616 | #define SECTIONS_PGOFF ((sizeof(unsigned long)*8) - SECTIONS_WIDTH) | 587 | #define SECTIONS_PGOFF ((sizeof(unsigned long)*8) - SECTIONS_WIDTH) |
| 617 | #define NODES_PGOFF (SECTIONS_PGOFF - NODES_WIDTH) | 588 | #define NODES_PGOFF (SECTIONS_PGOFF - NODES_WIDTH) |
| 618 | #define ZONES_PGOFF (NODES_PGOFF - ZONES_WIDTH) | 589 | #define ZONES_PGOFF (NODES_PGOFF - ZONES_WIDTH) |
| 619 | 590 | #define LAST_NID_PGOFF (ZONES_PGOFF - LAST_NID_WIDTH) | |
| 620 | /* | ||
| 621 | * We are going to use the flags for the page to node mapping if its in | ||
| 622 | * there. This includes the case where there is no node, so it is implicit. | ||
| 623 | */ | ||
| 624 | #if !(NODES_WIDTH > 0 || NODES_SHIFT == 0) | ||
| 625 | #define NODE_NOT_IN_PAGE_FLAGS | ||
| 626 | #endif | ||
| 627 | 591 | ||
| 628 | /* | 592 | /* |
| 629 | * Define the bit shifts to access each section. For non-existent | 593 | * Define the bit shifts to access each section. For non-existent |
| @@ -633,6 +597,7 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma) | |||
| 633 | #define SECTIONS_PGSHIFT (SECTIONS_PGOFF * (SECTIONS_WIDTH != 0)) | 597 | #define SECTIONS_PGSHIFT (SECTIONS_PGOFF * (SECTIONS_WIDTH != 0)) |
| 634 | #define NODES_PGSHIFT (NODES_PGOFF * (NODES_WIDTH != 0)) | 598 | #define NODES_PGSHIFT (NODES_PGOFF * (NODES_WIDTH != 0)) |
| 635 | #define ZONES_PGSHIFT (ZONES_PGOFF * (ZONES_WIDTH != 0)) | 599 | #define ZONES_PGSHIFT (ZONES_PGOFF * (ZONES_WIDTH != 0)) |
| 600 | #define LAST_NID_PGSHIFT (LAST_NID_PGOFF * (LAST_NID_WIDTH != 0)) | ||
| 636 | 601 | ||
| 637 | /* NODE:ZONE or SECTION:ZONE is used to ID a zone for the buddy allocator */ | 602 | /* NODE:ZONE or SECTION:ZONE is used to ID a zone for the buddy allocator */ |
| 638 | #ifdef NODE_NOT_IN_PAGE_FLAGS | 603 | #ifdef NODE_NOT_IN_PAGE_FLAGS |
| @@ -654,6 +619,7 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma) | |||
| 654 | #define ZONES_MASK ((1UL << ZONES_WIDTH) - 1) | 619 | #define ZONES_MASK ((1UL << ZONES_WIDTH) - 1) |
| 655 | #define NODES_MASK ((1UL << NODES_WIDTH) - 1) | 620 | #define NODES_MASK ((1UL << NODES_WIDTH) - 1) |
| 656 | #define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1) | 621 | #define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1) |
| 622 | #define LAST_NID_MASK ((1UL << LAST_NID_WIDTH) - 1) | ||
| 657 | #define ZONEID_MASK ((1UL << ZONEID_SHIFT) - 1) | 623 | #define ZONEID_MASK ((1UL << ZONEID_SHIFT) - 1) |
| 658 | 624 | ||
| 659 | static inline enum zone_type page_zonenum(const struct page *page) | 625 | static inline enum zone_type page_zonenum(const struct page *page) |
| @@ -661,6 +627,10 @@ static inline enum zone_type page_zonenum(const struct page *page) | |||
| 661 | return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK; | 627 | return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK; |
| 662 | } | 628 | } |
| 663 | 629 | ||
| 630 | #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) | ||
| 631 | #define SECTION_IN_PAGE_FLAGS | ||
| 632 | #endif | ||
| 633 | |||
| 664 | /* | 634 | /* |
| 665 | * The identification function is only used by the buddy allocator for | 635 | * The identification function is only used by the buddy allocator for |
| 666 | * determining if two pages could be buddies. We are not really | 636 | * determining if two pages could be buddies. We are not really |
| @@ -693,31 +663,48 @@ static inline int page_to_nid(const struct page *page) | |||
| 693 | #endif | 663 | #endif |
| 694 | 664 | ||
| 695 | #ifdef CONFIG_NUMA_BALANCING | 665 | #ifdef CONFIG_NUMA_BALANCING |
| 696 | static inline int page_xchg_last_nid(struct page *page, int nid) | 666 | #ifdef LAST_NID_NOT_IN_PAGE_FLAGS |
| 667 | static inline int page_nid_xchg_last(struct page *page, int nid) | ||
| 697 | { | 668 | { |
| 698 | return xchg(&page->_last_nid, nid); | 669 | return xchg(&page->_last_nid, nid); |
| 699 | } | 670 | } |
| 700 | 671 | ||
| 701 | static inline int page_last_nid(struct page *page) | 672 | static inline int page_nid_last(struct page *page) |
| 702 | { | 673 | { |
| 703 | return page->_last_nid; | 674 | return page->_last_nid; |
| 704 | } | 675 | } |
| 705 | static inline void reset_page_last_nid(struct page *page) | 676 | static inline void page_nid_reset_last(struct page *page) |
| 706 | { | 677 | { |
| 707 | page->_last_nid = -1; | 678 | page->_last_nid = -1; |
| 708 | } | 679 | } |
| 709 | #else | 680 | #else |
| 710 | static inline int page_xchg_last_nid(struct page *page, int nid) | 681 | static inline int page_nid_last(struct page *page) |
| 682 | { | ||
| 683 | return (page->flags >> LAST_NID_PGSHIFT) & LAST_NID_MASK; | ||
| 684 | } | ||
| 685 | |||
| 686 | extern int page_nid_xchg_last(struct page *page, int nid); | ||
| 687 | |||
| 688 | static inline void page_nid_reset_last(struct page *page) | ||
| 689 | { | ||
| 690 | int nid = (1 << LAST_NID_SHIFT) - 1; | ||
| 691 | |||
| 692 | page->flags &= ~(LAST_NID_MASK << LAST_NID_PGSHIFT); | ||
| 693 | page->flags |= (nid & LAST_NID_MASK) << LAST_NID_PGSHIFT; | ||
| 694 | } | ||
| 695 | #endif /* LAST_NID_NOT_IN_PAGE_FLAGS */ | ||
| 696 | #else | ||
| 697 | static inline int page_nid_xchg_last(struct page *page, int nid) | ||
| 711 | { | 698 | { |
| 712 | return page_to_nid(page); | 699 | return page_to_nid(page); |
| 713 | } | 700 | } |
| 714 | 701 | ||
| 715 | static inline int page_last_nid(struct page *page) | 702 | static inline int page_nid_last(struct page *page) |
| 716 | { | 703 | { |
| 717 | return page_to_nid(page); | 704 | return page_to_nid(page); |
| 718 | } | 705 | } |
| 719 | 706 | ||
| 720 | static inline void reset_page_last_nid(struct page *page) | 707 | static inline void page_nid_reset_last(struct page *page) |
| 721 | { | 708 | { |
| 722 | } | 709 | } |
| 723 | #endif | 710 | #endif |
| @@ -727,7 +714,7 @@ static inline struct zone *page_zone(const struct page *page) | |||
| 727 | return &NODE_DATA(page_to_nid(page))->node_zones[page_zonenum(page)]; | 714 | return &NODE_DATA(page_to_nid(page))->node_zones[page_zonenum(page)]; |
| 728 | } | 715 | } |
| 729 | 716 | ||
| 730 | #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) | 717 | #ifdef SECTION_IN_PAGE_FLAGS |
| 731 | static inline void set_page_section(struct page *page, unsigned long section) | 718 | static inline void set_page_section(struct page *page, unsigned long section) |
| 732 | { | 719 | { |
| 733 | page->flags &= ~(SECTIONS_MASK << SECTIONS_PGSHIFT); | 720 | page->flags &= ~(SECTIONS_MASK << SECTIONS_PGSHIFT); |
| @@ -757,7 +744,7 @@ static inline void set_page_links(struct page *page, enum zone_type zone, | |||
| 757 | { | 744 | { |
| 758 | set_page_zone(page, zone); | 745 | set_page_zone(page, zone); |
| 759 | set_page_node(page, node); | 746 | set_page_node(page, node); |
| 760 | #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) | 747 | #ifdef SECTION_IN_PAGE_FLAGS |
| 761 | set_page_section(page, pfn_to_section_nr(pfn)); | 748 | set_page_section(page, pfn_to_section_nr(pfn)); |
| 762 | #endif | 749 | #endif |
| 763 | } | 750 | } |
| @@ -817,18 +804,7 @@ void page_address_init(void); | |||
| 817 | #define PAGE_MAPPING_KSM 2 | 804 | #define PAGE_MAPPING_KSM 2 |
| 818 | #define PAGE_MAPPING_FLAGS (PAGE_MAPPING_ANON | PAGE_MAPPING_KSM) | 805 | #define PAGE_MAPPING_FLAGS (PAGE_MAPPING_ANON | PAGE_MAPPING_KSM) |
| 819 | 806 | ||
| 820 | extern struct address_space swapper_space; | 807 | extern struct address_space *page_mapping(struct page *page); |
| 821 | static inline struct address_space *page_mapping(struct page *page) | ||
| 822 | { | ||
| 823 | struct address_space *mapping = page->mapping; | ||
| 824 | |||
| 825 | VM_BUG_ON(PageSlab(page)); | ||
| 826 | if (unlikely(PageSwapCache(page))) | ||
| 827 | mapping = &swapper_space; | ||
| 828 | else if ((unsigned long)mapping & PAGE_MAPPING_ANON) | ||
| 829 | mapping = NULL; | ||
| 830 | return mapping; | ||
| 831 | } | ||
| 832 | 808 | ||
| 833 | /* Neutral page->mapping pointer to address_space or anon_vma or other */ | 809 | /* Neutral page->mapping pointer to address_space or anon_vma or other */ |
| 834 | static inline void *page_rmapping(struct page *page) | 810 | static inline void *page_rmapping(struct page *page) |
| @@ -1035,18 +1011,18 @@ static inline int fixup_user_fault(struct task_struct *tsk, | |||
| 1035 | } | 1011 | } |
| 1036 | #endif | 1012 | #endif |
| 1037 | 1013 | ||
| 1038 | extern int make_pages_present(unsigned long addr, unsigned long end); | ||
| 1039 | extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); | 1014 | extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); |
| 1040 | extern int access_remote_vm(struct mm_struct *mm, unsigned long addr, | 1015 | extern int access_remote_vm(struct mm_struct *mm, unsigned long addr, |
| 1041 | void *buf, int len, int write); | 1016 | void *buf, int len, int write); |
| 1042 | 1017 | ||
| 1043 | int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, | 1018 | long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, |
| 1044 | unsigned long start, int len, unsigned int foll_flags, | 1019 | unsigned long start, unsigned long nr_pages, |
| 1045 | struct page **pages, struct vm_area_struct **vmas, | 1020 | unsigned int foll_flags, struct page **pages, |
| 1046 | int *nonblocking); | 1021 | struct vm_area_struct **vmas, int *nonblocking); |
| 1047 | int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, | 1022 | long get_user_pages(struct task_struct *tsk, struct mm_struct *mm, |
| 1048 | unsigned long start, int nr_pages, int write, int force, | 1023 | unsigned long start, unsigned long nr_pages, |
| 1049 | struct page **pages, struct vm_area_struct **vmas); | 1024 | int write, int force, struct page **pages, |
| 1025 | struct vm_area_struct **vmas); | ||
| 1050 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, | 1026 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, |
| 1051 | struct page **pages); | 1027 | struct page **pages); |
| 1052 | struct kvec; | 1028 | struct kvec; |
| @@ -1386,7 +1362,6 @@ extern void __init mmap_init(void); | |||
| 1386 | extern void show_mem(unsigned int flags); | 1362 | extern void show_mem(unsigned int flags); |
| 1387 | extern void si_meminfo(struct sysinfo * val); | 1363 | extern void si_meminfo(struct sysinfo * val); |
| 1388 | extern void si_meminfo_node(struct sysinfo *val, int nid); | 1364 | extern void si_meminfo_node(struct sysinfo *val, int nid); |
| 1389 | extern int after_bootmem; | ||
| 1390 | 1365 | ||
| 1391 | extern __printf(3, 4) | 1366 | extern __printf(3, 4) |
| 1392 | void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...); | 1367 | void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...); |
| @@ -1396,6 +1371,9 @@ extern void setup_per_cpu_pageset(void); | |||
| 1396 | extern void zone_pcp_update(struct zone *zone); | 1371 | extern void zone_pcp_update(struct zone *zone); |
| 1397 | extern void zone_pcp_reset(struct zone *zone); | 1372 | extern void zone_pcp_reset(struct zone *zone); |
| 1398 | 1373 | ||
| 1374 | /* page_alloc.c */ | ||
| 1375 | extern int min_free_kbytes; | ||
| 1376 | |||
| 1399 | /* nommu.c */ | 1377 | /* nommu.c */ |
| 1400 | extern atomic_long_t mmap_pages_allocated; | 1378 | extern atomic_long_t mmap_pages_allocated; |
| 1401 | extern int nommu_shrink_inode_mappings(struct inode *, size_t, size_t); | 1379 | extern int nommu_shrink_inode_mappings(struct inode *, size_t, size_t); |
| @@ -1473,13 +1451,24 @@ extern int install_special_mapping(struct mm_struct *mm, | |||
| 1473 | extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); | 1451 | extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); |
| 1474 | 1452 | ||
| 1475 | extern unsigned long mmap_region(struct file *file, unsigned long addr, | 1453 | extern unsigned long mmap_region(struct file *file, unsigned long addr, |
| 1476 | unsigned long len, unsigned long flags, | 1454 | unsigned long len, vm_flags_t vm_flags, unsigned long pgoff); |
| 1477 | vm_flags_t vm_flags, unsigned long pgoff); | 1455 | extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, |
| 1478 | extern unsigned long do_mmap_pgoff(struct file *, unsigned long, | 1456 | unsigned long len, unsigned long prot, unsigned long flags, |
| 1479 | unsigned long, unsigned long, | 1457 | unsigned long pgoff, unsigned long *populate); |
| 1480 | unsigned long, unsigned long); | ||
| 1481 | extern int do_munmap(struct mm_struct *, unsigned long, size_t); | 1458 | extern int do_munmap(struct mm_struct *, unsigned long, size_t); |
| 1482 | 1459 | ||
| 1460 | #ifdef CONFIG_MMU | ||
| 1461 | extern int __mm_populate(unsigned long addr, unsigned long len, | ||
| 1462 | int ignore_errors); | ||
| 1463 | static inline void mm_populate(unsigned long addr, unsigned long len) | ||
| 1464 | { | ||
| 1465 | /* Ignore errors */ | ||
| 1466 | (void) __mm_populate(addr, len, 1); | ||
| 1467 | } | ||
| 1468 | #else | ||
| 1469 | static inline void mm_populate(unsigned long addr, unsigned long len) {} | ||
| 1470 | #endif | ||
| 1471 | |||
| 1483 | /* These take the mm semaphore themselves */ | 1472 | /* These take the mm semaphore themselves */ |
| 1484 | extern unsigned long vm_brk(unsigned long, unsigned long); | 1473 | extern unsigned long vm_brk(unsigned long, unsigned long); |
| 1485 | extern int vm_munmap(unsigned long, size_t); | 1474 | extern int vm_munmap(unsigned long, size_t); |
| @@ -1624,8 +1613,17 @@ int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr, | |||
| 1624 | int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr, | 1613 | int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr, |
| 1625 | unsigned long pfn); | 1614 | unsigned long pfn); |
| 1626 | 1615 | ||
| 1627 | struct page *follow_page(struct vm_area_struct *, unsigned long address, | 1616 | struct page *follow_page_mask(struct vm_area_struct *vma, |
| 1628 | unsigned int foll_flags); | 1617 | unsigned long address, unsigned int foll_flags, |
| 1618 | unsigned int *page_mask); | ||
| 1619 | |||
| 1620 | static inline struct page *follow_page(struct vm_area_struct *vma, | ||
| 1621 | unsigned long address, unsigned int foll_flags) | ||
| 1622 | { | ||
| 1623 | unsigned int unused_page_mask; | ||
| 1624 | return follow_page_mask(vma, address, foll_flags, &unused_page_mask); | ||
| 1625 | } | ||
| 1626 | |||
| 1629 | #define FOLL_WRITE 0x01 /* check pte is writable */ | 1627 | #define FOLL_WRITE 0x01 /* check pte is writable */ |
| 1630 | #define FOLL_TOUCH 0x02 /* mark page accessed */ | 1628 | #define FOLL_TOUCH 0x02 /* mark page accessed */ |
| 1631 | #define FOLL_GET 0x04 /* do get_page on page */ | 1629 | #define FOLL_GET 0x04 /* do get_page on page */ |
| @@ -1637,6 +1635,7 @@ struct page *follow_page(struct vm_area_struct *, unsigned long address, | |||
| 1637 | #define FOLL_SPLIT 0x80 /* don't return transhuge pages, split them */ | 1635 | #define FOLL_SPLIT 0x80 /* don't return transhuge pages, split them */ |
| 1638 | #define FOLL_HWPOISON 0x100 /* check page is hwpoisoned */ | 1636 | #define FOLL_HWPOISON 0x100 /* check page is hwpoisoned */ |
| 1639 | #define FOLL_NUMA 0x200 /* force NUMA hinting page fault */ | 1637 | #define FOLL_NUMA 0x200 /* force NUMA hinting page fault */ |
| 1638 | #define FOLL_MIGRATION 0x400 /* wait for page to replace migration entry */ | ||
| 1640 | 1639 | ||
| 1641 | typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr, | 1640 | typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr, |
| 1642 | void *data); | 1641 | void *data); |
| @@ -1708,7 +1707,11 @@ int vmemmap_populate_basepages(struct page *start_page, | |||
| 1708 | unsigned long pages, int node); | 1707 | unsigned long pages, int node); |
| 1709 | int vmemmap_populate(struct page *start_page, unsigned long pages, int node); | 1708 | int vmemmap_populate(struct page *start_page, unsigned long pages, int node); |
| 1710 | void vmemmap_populate_print_last(void); | 1709 | void vmemmap_populate_print_last(void); |
| 1711 | 1710 | #ifdef CONFIG_MEMORY_HOTPLUG | |
| 1711 | void vmemmap_free(struct page *memmap, unsigned long nr_pages); | ||
| 1712 | #endif | ||
| 1713 | void register_page_bootmem_memmap(unsigned long section_nr, struct page *map, | ||
| 1714 | unsigned long size); | ||
| 1712 | 1715 | ||
| 1713 | enum mf_flags { | 1716 | enum mf_flags { |
| 1714 | MF_COUNT_INCREASED = 1 << 0, | 1717 | MF_COUNT_INCREASED = 1 << 0, |
| @@ -1721,7 +1724,7 @@ extern int unpoison_memory(unsigned long pfn); | |||
| 1721 | extern int sysctl_memory_failure_early_kill; | 1724 | extern int sysctl_memory_failure_early_kill; |
| 1722 | extern int sysctl_memory_failure_recovery; | 1725 | extern int sysctl_memory_failure_recovery; |
| 1723 | extern void shake_page(struct page *p, int access); | 1726 | extern void shake_page(struct page *p, int access); |
| 1724 | extern atomic_long_t mce_bad_pages; | 1727 | extern atomic_long_t num_poisoned_pages; |
| 1725 | extern int soft_offline_page(struct page *page, int flags); | 1728 | extern int soft_offline_page(struct page *page, int flags); |
| 1726 | 1729 | ||
| 1727 | extern void dump_page(struct page *page); | 1730 | extern void dump_page(struct page *page); |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index f8f5162a3571..ace9a5f01c64 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/cpumask.h> | 12 | #include <linux/cpumask.h> |
| 13 | #include <linux/page-debug-flags.h> | 13 | #include <linux/page-debug-flags.h> |
| 14 | #include <linux/uprobes.h> | 14 | #include <linux/uprobes.h> |
| 15 | #include <linux/page-flags-layout.h> | ||
| 15 | #include <asm/page.h> | 16 | #include <asm/page.h> |
| 16 | #include <asm/mmu.h> | 17 | #include <asm/mmu.h> |
| 17 | 18 | ||
| @@ -173,7 +174,7 @@ struct page { | |||
| 173 | void *shadow; | 174 | void *shadow; |
| 174 | #endif | 175 | #endif |
| 175 | 176 | ||
| 176 | #ifdef CONFIG_NUMA_BALANCING | 177 | #ifdef LAST_NID_NOT_IN_PAGE_FLAGS |
| 177 | int _last_nid; | 178 | int _last_nid; |
| 178 | #endif | 179 | #endif |
| 179 | } | 180 | } |
| @@ -414,9 +415,9 @@ struct mm_struct { | |||
| 414 | #endif | 415 | #endif |
| 415 | #ifdef CONFIG_NUMA_BALANCING | 416 | #ifdef CONFIG_NUMA_BALANCING |
| 416 | /* | 417 | /* |
| 417 | * numa_next_scan is the next time when the PTEs will me marked | 418 | * numa_next_scan is the next time that the PTEs will be marked |
| 418 | * pte_numa to gather statistics and migrate pages to new nodes | 419 | * pte_numa. NUMA hinting faults will gather statistics and migrate |
| 419 | * if necessary | 420 | * pages to new nodes if necessary. |
| 420 | */ | 421 | */ |
| 421 | unsigned long numa_next_scan; | 422 | unsigned long numa_next_scan; |
| 422 | 423 | ||
diff --git a/include/linux/mman.h b/include/linux/mman.h index 9aa863da287f..61c7a87e5d2b 100644 --- a/include/linux/mman.h +++ b/include/linux/mman.h | |||
| @@ -79,6 +79,8 @@ calc_vm_flag_bits(unsigned long flags) | |||
| 79 | { | 79 | { |
| 80 | return _calc_vm_trans(flags, MAP_GROWSDOWN, VM_GROWSDOWN ) | | 80 | return _calc_vm_trans(flags, MAP_GROWSDOWN, VM_GROWSDOWN ) | |
| 81 | _calc_vm_trans(flags, MAP_DENYWRITE, VM_DENYWRITE ) | | 81 | _calc_vm_trans(flags, MAP_DENYWRITE, VM_DENYWRITE ) | |
| 82 | _calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED ); | 82 | ((flags & MAP_LOCKED) ? (VM_LOCKED | VM_POPULATE) : 0) | |
| 83 | (((flags & (MAP_POPULATE | MAP_NONBLOCK)) == MAP_POPULATE) ? | ||
| 84 | VM_POPULATE : 0); | ||
| 83 | } | 85 | } |
| 84 | #endif /* _LINUX_MMAN_H */ | 86 | #endif /* _LINUX_MMAN_H */ |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 5c69315d60cc..61b2c30c903b 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
| @@ -53,6 +53,9 @@ struct mmc_ext_csd { | |||
| 53 | u8 part_config; | 53 | u8 part_config; |
| 54 | u8 cache_ctrl; | 54 | u8 cache_ctrl; |
| 55 | u8 rst_n_function; | 55 | u8 rst_n_function; |
| 56 | u8 max_packed_writes; | ||
| 57 | u8 max_packed_reads; | ||
| 58 | u8 packed_event_en; | ||
| 56 | unsigned int part_time; /* Units: ms */ | 59 | unsigned int part_time; /* Units: ms */ |
| 57 | unsigned int sa_timeout; /* Units: 100ns */ | 60 | unsigned int sa_timeout; /* Units: 100ns */ |
| 58 | unsigned int generic_cmd6_time; /* Units: 10ms */ | 61 | unsigned int generic_cmd6_time; /* Units: 10ms */ |
| @@ -83,7 +86,7 @@ struct mmc_ext_csd { | |||
| 83 | unsigned int data_tag_unit_size; /* DATA TAG UNIT size */ | 86 | unsigned int data_tag_unit_size; /* DATA TAG UNIT size */ |
| 84 | unsigned int boot_ro_lock; /* ro lock support */ | 87 | unsigned int boot_ro_lock; /* ro lock support */ |
| 85 | bool boot_ro_lockable; | 88 | bool boot_ro_lockable; |
| 86 | u8 raw_exception_status; /* 53 */ | 89 | u8 raw_exception_status; /* 54 */ |
| 87 | u8 raw_partition_support; /* 160 */ | 90 | u8 raw_partition_support; /* 160 */ |
| 88 | u8 raw_rpmb_size_mult; /* 168 */ | 91 | u8 raw_rpmb_size_mult; /* 168 */ |
| 89 | u8 raw_erased_mem_count; /* 181 */ | 92 | u8 raw_erased_mem_count; /* 181 */ |
| @@ -187,6 +190,18 @@ struct sdio_func_tuple; | |||
| 187 | 190 | ||
| 188 | #define SDIO_MAX_FUNCS 7 | 191 | #define SDIO_MAX_FUNCS 7 |
| 189 | 192 | ||
| 193 | enum mmc_blk_status { | ||
| 194 | MMC_BLK_SUCCESS = 0, | ||
| 195 | MMC_BLK_PARTIAL, | ||
| 196 | MMC_BLK_CMD_ERR, | ||
| 197 | MMC_BLK_RETRY, | ||
| 198 | MMC_BLK_ABORT, | ||
| 199 | MMC_BLK_DATA_ERR, | ||
| 200 | MMC_BLK_ECC_ERR, | ||
| 201 | MMC_BLK_NOMEDIUM, | ||
| 202 | MMC_BLK_NEW_REQUEST, | ||
| 203 | }; | ||
| 204 | |||
| 190 | /* The number of MMC physical partitions. These consist of: | 205 | /* The number of MMC physical partitions. These consist of: |
| 191 | * boot partitions (2), general purpose partitions (4) in MMC v4.4. | 206 | * boot partitions (2), general purpose partitions (4) in MMC v4.4. |
| 192 | */ | 207 | */ |
| @@ -295,6 +310,11 @@ static inline void mmc_part_add(struct mmc_card *card, unsigned int size, | |||
| 295 | card->nr_parts++; | 310 | card->nr_parts++; |
| 296 | } | 311 | } |
| 297 | 312 | ||
| 313 | static inline bool mmc_large_sector(struct mmc_card *card) | ||
| 314 | { | ||
| 315 | return card->ext_csd.data_sector_size == 4096; | ||
| 316 | } | ||
| 317 | |||
| 298 | /* | 318 | /* |
| 299 | * The world is not perfect and supplies us with broken mmc/sdio devices. | 319 | * The world is not perfect and supplies us with broken mmc/sdio devices. |
| 300 | * For at least some of these bugs we need a work-around. | 320 | * For at least some of these bugs we need a work-around. |
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index 5bf7c2274fcb..39613b9a6fc5 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h | |||
| @@ -18,6 +18,9 @@ struct mmc_request; | |||
| 18 | struct mmc_command { | 18 | struct mmc_command { |
| 19 | u32 opcode; | 19 | u32 opcode; |
| 20 | u32 arg; | 20 | u32 arg; |
| 21 | #define MMC_CMD23_ARG_REL_WR (1 << 31) | ||
| 22 | #define MMC_CMD23_ARG_PACKED ((0 << 31) | (1 << 30)) | ||
| 23 | #define MMC_CMD23_ARG_TAG_REQ (1 << 29) | ||
| 21 | u32 resp[4]; | 24 | u32 resp[4]; |
| 22 | unsigned int flags; /* expected response type */ | 25 | unsigned int flags; /* expected response type */ |
| 23 | #define MMC_RSP_PRESENT (1 << 0) | 26 | #define MMC_RSP_PRESENT (1 << 0) |
| @@ -120,6 +123,7 @@ struct mmc_data { | |||
| 120 | s32 host_cookie; /* host private data */ | 123 | s32 host_cookie; /* host private data */ |
| 121 | }; | 124 | }; |
| 122 | 125 | ||
| 126 | struct mmc_host; | ||
| 123 | struct mmc_request { | 127 | struct mmc_request { |
| 124 | struct mmc_command *sbc; /* SET_BLOCK_COUNT for multiblock */ | 128 | struct mmc_command *sbc; /* SET_BLOCK_COUNT for multiblock */ |
| 125 | struct mmc_command *cmd; | 129 | struct mmc_command *cmd; |
| @@ -128,9 +132,9 @@ struct mmc_request { | |||
| 128 | 132 | ||
| 129 | struct completion completion; | 133 | struct completion completion; |
| 130 | void (*done)(struct mmc_request *);/* completion function */ | 134 | void (*done)(struct mmc_request *);/* completion function */ |
| 135 | struct mmc_host *host; | ||
| 131 | }; | 136 | }; |
| 132 | 137 | ||
| 133 | struct mmc_host; | ||
| 134 | struct mmc_card; | 138 | struct mmc_card; |
| 135 | struct mmc_async_req; | 139 | struct mmc_async_req; |
| 136 | 140 | ||
| @@ -147,6 +151,7 @@ extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *, | |||
| 147 | extern void mmc_start_bkops(struct mmc_card *card, bool from_exception); | 151 | extern void mmc_start_bkops(struct mmc_card *card, bool from_exception); |
| 148 | extern int __mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int, bool); | 152 | extern int __mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int, bool); |
| 149 | extern int mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int); | 153 | extern int mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int); |
| 154 | extern int mmc_send_ext_csd(struct mmc_card *card, u8 *ext_csd); | ||
| 150 | 155 | ||
| 151 | #define MMC_ERASE_ARG 0x00000000 | 156 | #define MMC_ERASE_ARG 0x00000000 |
| 152 | #define MMC_SECURE_ERASE_ARG 0x80000000 | 157 | #define MMC_SECURE_ERASE_ARG 0x80000000 |
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h index 34be4f47293c..198f0fa44e9f 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h | |||
| @@ -209,8 +209,10 @@ struct dw_mci_dma_ops { | |||
| 209 | #define DW_MCI_QUIRK_HIGHSPEED BIT(2) | 209 | #define DW_MCI_QUIRK_HIGHSPEED BIT(2) |
| 210 | /* Unreliable card detection */ | 210 | /* Unreliable card detection */ |
| 211 | #define DW_MCI_QUIRK_BROKEN_CARD_DETECTION BIT(3) | 211 | #define DW_MCI_QUIRK_BROKEN_CARD_DETECTION BIT(3) |
| 212 | /* Write Protect detection not available */ | 212 | |
| 213 | #define DW_MCI_QUIRK_NO_WRITE_PROTECT BIT(4) | 213 | /* Slot level quirks */ |
| 214 | /* This slot has no write protect */ | ||
| 215 | #define DW_MCI_SLOT_QUIRK_NO_WRITE_PROTECT BIT(0) | ||
| 214 | 216 | ||
| 215 | struct dma_pdata; | 217 | struct dma_pdata; |
| 216 | 218 | ||
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 61a10c17aabd..d6f20cc6415e 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
| @@ -131,9 +131,11 @@ struct mmc_host_ops { | |||
| 131 | 131 | ||
| 132 | int (*start_signal_voltage_switch)(struct mmc_host *host, struct mmc_ios *ios); | 132 | int (*start_signal_voltage_switch)(struct mmc_host *host, struct mmc_ios *ios); |
| 133 | 133 | ||
| 134 | /* Check if the card is pulling dat[0:3] low */ | ||
| 135 | int (*card_busy)(struct mmc_host *host); | ||
| 136 | |||
| 134 | /* The tuning command opcode value is different for SD and eMMC cards */ | 137 | /* The tuning command opcode value is different for SD and eMMC cards */ |
| 135 | int (*execute_tuning)(struct mmc_host *host, u32 opcode); | 138 | int (*execute_tuning)(struct mmc_host *host, u32 opcode); |
| 136 | void (*enable_preset_value)(struct mmc_host *host, bool enable); | ||
| 137 | int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv); | 139 | int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv); |
| 138 | void (*hw_reset)(struct mmc_host *host); | 140 | void (*hw_reset)(struct mmc_host *host); |
| 139 | void (*card_event)(struct mmc_host *host); | 141 | void (*card_event)(struct mmc_host *host); |
| @@ -170,6 +172,22 @@ struct mmc_slot { | |||
| 170 | void *handler_priv; | 172 | void *handler_priv; |
| 171 | }; | 173 | }; |
| 172 | 174 | ||
| 175 | /** | ||
| 176 | * mmc_context_info - synchronization details for mmc context | ||
| 177 | * @is_done_rcv wake up reason was done request | ||
| 178 | * @is_new_req wake up reason was new request | ||
| 179 | * @is_waiting_last_req mmc context waiting for single running request | ||
| 180 | * @wait wait queue | ||
| 181 | * @lock lock to protect data fields | ||
| 182 | */ | ||
| 183 | struct mmc_context_info { | ||
| 184 | bool is_done_rcv; | ||
| 185 | bool is_new_req; | ||
| 186 | bool is_waiting_last_req; | ||
| 187 | wait_queue_head_t wait; | ||
| 188 | spinlock_t lock; | ||
| 189 | }; | ||
| 190 | |||
| 173 | struct regulator; | 191 | struct regulator; |
| 174 | 192 | ||
| 175 | struct mmc_supply { | 193 | struct mmc_supply { |
| @@ -258,6 +276,10 @@ struct mmc_host { | |||
| 258 | #define MMC_CAP2_HC_ERASE_SZ (1 << 9) /* High-capacity erase size */ | 276 | #define MMC_CAP2_HC_ERASE_SZ (1 << 9) /* High-capacity erase size */ |
| 259 | #define MMC_CAP2_CD_ACTIVE_HIGH (1 << 10) /* Card-detect signal active high */ | 277 | #define MMC_CAP2_CD_ACTIVE_HIGH (1 << 10) /* Card-detect signal active high */ |
| 260 | #define MMC_CAP2_RO_ACTIVE_HIGH (1 << 11) /* Write-protect signal active high */ | 278 | #define MMC_CAP2_RO_ACTIVE_HIGH (1 << 11) /* Write-protect signal active high */ |
| 279 | #define MMC_CAP2_PACKED_RD (1 << 12) /* Allow packed read */ | ||
| 280 | #define MMC_CAP2_PACKED_WR (1 << 13) /* Allow packed write */ | ||
| 281 | #define MMC_CAP2_PACKED_CMD (MMC_CAP2_PACKED_RD | \ | ||
| 282 | MMC_CAP2_PACKED_WR) | ||
| 261 | 283 | ||
| 262 | mmc_pm_flag_t pm_caps; /* supported pm features */ | 284 | mmc_pm_flag_t pm_caps; /* supported pm features */ |
| 263 | 285 | ||
| @@ -331,6 +353,7 @@ struct mmc_host { | |||
| 331 | struct dentry *debugfs_root; | 353 | struct dentry *debugfs_root; |
| 332 | 354 | ||
| 333 | struct mmc_async_req *areq; /* active async req */ | 355 | struct mmc_async_req *areq; /* active async req */ |
| 356 | struct mmc_context_info context_info; /* async synchronization info */ | ||
| 334 | 357 | ||
| 335 | #ifdef CONFIG_FAIL_MMC_REQUEST | 358 | #ifdef CONFIG_FAIL_MMC_REQUEST |
| 336 | struct fault_attr fail_mmc_request; | 359 | struct fault_attr fail_mmc_request; |
| @@ -341,10 +364,11 @@ struct mmc_host { | |||
| 341 | unsigned long private[0] ____cacheline_aligned; | 364 | unsigned long private[0] ____cacheline_aligned; |
| 342 | }; | 365 | }; |
| 343 | 366 | ||
| 344 | extern struct mmc_host *mmc_alloc_host(int extra, struct device *); | 367 | struct mmc_host *mmc_alloc_host(int extra, struct device *); |
| 345 | extern int mmc_add_host(struct mmc_host *); | 368 | int mmc_add_host(struct mmc_host *); |
| 346 | extern void mmc_remove_host(struct mmc_host *); | 369 | void mmc_remove_host(struct mmc_host *); |
| 347 | extern void mmc_free_host(struct mmc_host *); | 370 | void mmc_free_host(struct mmc_host *); |
| 371 | void mmc_of_parse(struct mmc_host *host); | ||
| 348 | 372 | ||
| 349 | static inline void *mmc_priv(struct mmc_host *host) | 373 | static inline void *mmc_priv(struct mmc_host *host) |
| 350 | { | 374 | { |
| @@ -357,16 +381,16 @@ static inline void *mmc_priv(struct mmc_host *host) | |||
| 357 | #define mmc_classdev(x) (&(x)->class_dev) | 381 | #define mmc_classdev(x) (&(x)->class_dev) |
| 358 | #define mmc_hostname(x) (dev_name(&(x)->class_dev)) | 382 | #define mmc_hostname(x) (dev_name(&(x)->class_dev)) |
| 359 | 383 | ||
| 360 | extern int mmc_suspend_host(struct mmc_host *); | 384 | int mmc_suspend_host(struct mmc_host *); |
| 361 | extern int mmc_resume_host(struct mmc_host *); | 385 | int mmc_resume_host(struct mmc_host *); |
| 362 | 386 | ||
| 363 | extern int mmc_power_save_host(struct mmc_host *host); | 387 | int mmc_power_save_host(struct mmc_host *host); |
| 364 | extern int mmc_power_restore_host(struct mmc_host *host); | 388 | int mmc_power_restore_host(struct mmc_host *host); |
| 365 | 389 | ||
| 366 | extern void mmc_detect_change(struct mmc_host *, unsigned long delay); | 390 | void mmc_detect_change(struct mmc_host *, unsigned long delay); |
| 367 | extern void mmc_request_done(struct mmc_host *, struct mmc_request *); | 391 | void mmc_request_done(struct mmc_host *, struct mmc_request *); |
| 368 | 392 | ||
| 369 | extern int mmc_cache_ctrl(struct mmc_host *, u8); | 393 | int mmc_cache_ctrl(struct mmc_host *, u8); |
| 370 | 394 | ||
| 371 | static inline void mmc_signal_sdio_irq(struct mmc_host *host) | 395 | static inline void mmc_signal_sdio_irq(struct mmc_host *host) |
| 372 | { | 396 | { |
| @@ -434,6 +458,19 @@ static inline int mmc_boot_partition_access(struct mmc_host *host) | |||
| 434 | return !(host->caps2 & MMC_CAP2_BOOTPART_NOACC); | 458 | return !(host->caps2 & MMC_CAP2_BOOTPART_NOACC); |
| 435 | } | 459 | } |
| 436 | 460 | ||
| 461 | static inline int mmc_host_uhs(struct mmc_host *host) | ||
| 462 | { | ||
| 463 | return host->caps & | ||
| 464 | (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 | | ||
| 465 | MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_SDR104 | | ||
| 466 | MMC_CAP_UHS_DDR50); | ||
| 467 | } | ||
| 468 | |||
| 469 | static inline int mmc_host_packed_wr(struct mmc_host *host) | ||
| 470 | { | ||
| 471 | return host->caps2 & MMC_CAP2_PACKED_WR; | ||
| 472 | } | ||
| 473 | |||
| 437 | #ifdef CONFIG_MMC_CLKGATE | 474 | #ifdef CONFIG_MMC_CLKGATE |
| 438 | void mmc_host_clk_hold(struct mmc_host *host); | 475 | void mmc_host_clk_hold(struct mmc_host *host); |
| 439 | void mmc_host_clk_release(struct mmc_host *host); | 476 | void mmc_host_clk_release(struct mmc_host *host); |
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 94d532e41c61..50bcde3677ca 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
| @@ -139,7 +139,7 @@ static inline bool mmc_op_multi(u32 opcode) | |||
| 139 | #define R1_CURRENT_STATE(x) ((x & 0x00001E00) >> 9) /* sx, b (4 bits) */ | 139 | #define R1_CURRENT_STATE(x) ((x & 0x00001E00) >> 9) /* sx, b (4 bits) */ |
| 140 | #define R1_READY_FOR_DATA (1 << 8) /* sx, a */ | 140 | #define R1_READY_FOR_DATA (1 << 8) /* sx, a */ |
| 141 | #define R1_SWITCH_ERROR (1 << 7) /* sx, c */ | 141 | #define R1_SWITCH_ERROR (1 << 7) /* sx, c */ |
| 142 | #define R1_EXCEPTION_EVENT (1 << 6) /* sx, a */ | 142 | #define R1_EXCEPTION_EVENT (1 << 6) /* sr, a */ |
| 143 | #define R1_APP_CMD (1 << 5) /* sr, c */ | 143 | #define R1_APP_CMD (1 << 5) /* sr, c */ |
| 144 | 144 | ||
| 145 | #define R1_STATE_IDLE 0 | 145 | #define R1_STATE_IDLE 0 |
| @@ -275,7 +275,10 @@ struct _mmc_csd { | |||
| 275 | #define EXT_CSD_FLUSH_CACHE 32 /* W */ | 275 | #define EXT_CSD_FLUSH_CACHE 32 /* W */ |
| 276 | #define EXT_CSD_CACHE_CTRL 33 /* R/W */ | 276 | #define EXT_CSD_CACHE_CTRL 33 /* R/W */ |
| 277 | #define EXT_CSD_POWER_OFF_NOTIFICATION 34 /* R/W */ | 277 | #define EXT_CSD_POWER_OFF_NOTIFICATION 34 /* R/W */ |
| 278 | #define EXT_CSD_EXP_EVENTS_STATUS 54 /* RO */ | 278 | #define EXT_CSD_PACKED_FAILURE_INDEX 35 /* RO */ |
| 279 | #define EXT_CSD_PACKED_CMD_STATUS 36 /* RO */ | ||
| 280 | #define EXT_CSD_EXP_EVENTS_STATUS 54 /* RO, 2 bytes */ | ||
| 281 | #define EXT_CSD_EXP_EVENTS_CTRL 56 /* R/W, 2 bytes */ | ||
| 279 | #define EXT_CSD_DATA_SECTOR_SIZE 61 /* R */ | 282 | #define EXT_CSD_DATA_SECTOR_SIZE 61 /* R */ |
| 280 | #define EXT_CSD_GP_SIZE_MULT 143 /* R/W */ | 283 | #define EXT_CSD_GP_SIZE_MULT 143 /* R/W */ |
| 281 | #define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ | 284 | #define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ |
| @@ -324,6 +327,8 @@ struct _mmc_csd { | |||
| 324 | #define EXT_CSD_CACHE_SIZE 249 /* RO, 4 bytes */ | 327 | #define EXT_CSD_CACHE_SIZE 249 /* RO, 4 bytes */ |
| 325 | #define EXT_CSD_TAG_UNIT_SIZE 498 /* RO */ | 328 | #define EXT_CSD_TAG_UNIT_SIZE 498 /* RO */ |
| 326 | #define EXT_CSD_DATA_TAG_SUPPORT 499 /* RO */ | 329 | #define EXT_CSD_DATA_TAG_SUPPORT 499 /* RO */ |
| 330 | #define EXT_CSD_MAX_PACKED_WRITES 500 /* RO */ | ||
| 331 | #define EXT_CSD_MAX_PACKED_READS 501 /* RO */ | ||
| 327 | #define EXT_CSD_BKOPS_SUPPORT 502 /* RO */ | 332 | #define EXT_CSD_BKOPS_SUPPORT 502 /* RO */ |
| 328 | #define EXT_CSD_HPI_FEATURES 503 /* RO */ | 333 | #define EXT_CSD_HPI_FEATURES 503 /* RO */ |
| 329 | 334 | ||
| @@ -385,6 +390,9 @@ struct _mmc_csd { | |||
| 385 | #define EXT_CSD_PWR_CL_4BIT_MASK 0x0F /* 8 bit PWR CLS */ | 390 | #define EXT_CSD_PWR_CL_4BIT_MASK 0x0F /* 8 bit PWR CLS */ |
| 386 | #define EXT_CSD_PWR_CL_8BIT_SHIFT 4 | 391 | #define EXT_CSD_PWR_CL_8BIT_SHIFT 4 |
| 387 | #define EXT_CSD_PWR_CL_4BIT_SHIFT 0 | 392 | #define EXT_CSD_PWR_CL_4BIT_SHIFT 0 |
| 393 | |||
| 394 | #define EXT_CSD_PACKED_EVENT_EN BIT(3) | ||
| 395 | |||
| 388 | /* | 396 | /* |
| 389 | * EXCEPTION_EVENT_STATUS field | 397 | * EXCEPTION_EVENT_STATUS field |
| 390 | */ | 398 | */ |
| @@ -393,6 +401,9 @@ struct _mmc_csd { | |||
| 393 | #define EXT_CSD_SYSPOOL_EXHAUSTED BIT(2) | 401 | #define EXT_CSD_SYSPOOL_EXHAUSTED BIT(2) |
| 394 | #define EXT_CSD_PACKED_FAILURE BIT(3) | 402 | #define EXT_CSD_PACKED_FAILURE BIT(3) |
| 395 | 403 | ||
| 404 | #define EXT_CSD_PACKED_GENERIC_ERROR BIT(0) | ||
| 405 | #define EXT_CSD_PACKED_INDEXED_ERROR BIT(1) | ||
| 406 | |||
| 396 | /* | 407 | /* |
| 397 | * BKOPS status level | 408 | * BKOPS status level |
| 398 | */ | 409 | */ |
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index 4bbc3301fbbf..b838ffc49e4a 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h | |||
| @@ -94,6 +94,7 @@ struct sdhci_host { | |||
| 94 | #define SDHCI_QUIRK2_HOST_NO_CMD23 (1<<1) | 94 | #define SDHCI_QUIRK2_HOST_NO_CMD23 (1<<1) |
| 95 | /* The system physically doesn't support 1.8v, even if the host does */ | 95 | /* The system physically doesn't support 1.8v, even if the host does */ |
| 96 | #define SDHCI_QUIRK2_NO_1_8_V (1<<2) | 96 | #define SDHCI_QUIRK2_NO_1_8_V (1<<2) |
| 97 | #define SDHCI_QUIRK2_PRESET_VALUE_BROKEN (1<<3) | ||
| 97 | 98 | ||
| 98 | int irq; /* Device IRQ */ | 99 | int irq; /* Device IRQ */ |
| 99 | void __iomem *ioaddr; /* Mapped address */ | 100 | void __iomem *ioaddr; /* Mapped address */ |
diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h index b65679ffa880..b76bcf0621f6 100644 --- a/include/linux/mmc/sh_mobile_sdhi.h +++ b/include/linux/mmc/sh_mobile_sdhi.h | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | 5 | ||
| 6 | struct platform_device; | 6 | struct platform_device; |
| 7 | struct tmio_mmc_data; | ||
| 8 | 7 | ||
| 9 | #define SH_MOBILE_SDHI_IRQ_CARD_DETECT "card_detect" | 8 | #define SH_MOBILE_SDHI_IRQ_CARD_DETECT "card_detect" |
| 10 | #define SH_MOBILE_SDHI_IRQ_SDCARD "sdcard" | 9 | #define SH_MOBILE_SDHI_IRQ_SDCARD "sdcard" |
| @@ -26,7 +25,6 @@ struct sh_mobile_sdhi_info { | |||
| 26 | unsigned long tmio_caps2; | 25 | unsigned long tmio_caps2; |
| 27 | u32 tmio_ocr_mask; /* available MMC voltages */ | 26 | u32 tmio_ocr_mask; /* available MMC voltages */ |
| 28 | unsigned int cd_gpio; | 27 | unsigned int cd_gpio; |
| 29 | struct tmio_mmc_data *pdata; | ||
| 30 | void (*set_pwr)(struct platform_device *pdev, int state); | 28 | void (*set_pwr)(struct platform_device *pdev, int state); |
| 31 | int (*get_cd)(struct platform_device *pdev); | 29 | int (*get_cd)(struct platform_device *pdev); |
| 32 | 30 | ||
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 73b64a38b984..ede274957e05 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | #include <linux/seqlock.h> | 15 | #include <linux/seqlock.h> |
| 16 | #include <linux/nodemask.h> | 16 | #include <linux/nodemask.h> |
| 17 | #include <linux/pageblock-flags.h> | 17 | #include <linux/pageblock-flags.h> |
| 18 | #include <generated/bounds.h> | 18 | #include <linux/page-flags-layout.h> |
| 19 | #include <linux/atomic.h> | 19 | #include <linux/atomic.h> |
| 20 | #include <asm/page.h> | 20 | #include <asm/page.h> |
| 21 | 21 | ||
| @@ -57,7 +57,9 @@ enum { | |||
| 57 | */ | 57 | */ |
| 58 | MIGRATE_CMA, | 58 | MIGRATE_CMA, |
| 59 | #endif | 59 | #endif |
| 60 | #ifdef CONFIG_MEMORY_ISOLATION | ||
| 60 | MIGRATE_ISOLATE, /* can't allocate from here */ | 61 | MIGRATE_ISOLATE, /* can't allocate from here */ |
| 62 | #endif | ||
| 61 | MIGRATE_TYPES | 63 | MIGRATE_TYPES |
| 62 | }; | 64 | }; |
| 63 | 65 | ||
| @@ -308,24 +310,6 @@ enum zone_type { | |||
| 308 | 310 | ||
| 309 | #ifndef __GENERATING_BOUNDS_H | 311 | #ifndef __GENERATING_BOUNDS_H |
| 310 | 312 | ||
| 311 | /* | ||
| 312 | * When a memory allocation must conform to specific limitations (such | ||
| 313 | * as being suitable for DMA) the caller will pass in hints to the | ||
| 314 | * allocator in the gfp_mask, in the zone modifier bits. These bits | ||
| 315 | * are used to select a priority ordered list of memory zones which | ||
| 316 | * match the requested limits. See gfp_zone() in include/linux/gfp.h | ||
| 317 | */ | ||
| 318 | |||
| 319 | #if MAX_NR_ZONES < 2 | ||
| 320 | #define ZONES_SHIFT 0 | ||
| 321 | #elif MAX_NR_ZONES <= 2 | ||
| 322 | #define ZONES_SHIFT 1 | ||
| 323 | #elif MAX_NR_ZONES <= 4 | ||
| 324 | #define ZONES_SHIFT 2 | ||
| 325 | #else | ||
| 326 | #error ZONES_SHIFT -- too many zones configured adjust calculation | ||
| 327 | #endif | ||
| 328 | |||
| 329 | struct zone { | 313 | struct zone { |
| 330 | /* Fields commonly accessed by the page allocator */ | 314 | /* Fields commonly accessed by the page allocator */ |
| 331 | 315 | ||
| @@ -543,6 +527,26 @@ static inline int zone_is_oom_locked(const struct zone *zone) | |||
| 543 | return test_bit(ZONE_OOM_LOCKED, &zone->flags); | 527 | return test_bit(ZONE_OOM_LOCKED, &zone->flags); |
| 544 | } | 528 | } |
| 545 | 529 | ||
| 530 | static inline unsigned zone_end_pfn(const struct zone *zone) | ||
| 531 | { | ||
| 532 | return zone->zone_start_pfn + zone->spanned_pages; | ||
| 533 | } | ||
| 534 | |||
| 535 | static inline bool zone_spans_pfn(const struct zone *zone, unsigned long pfn) | ||
| 536 | { | ||
| 537 | return zone->zone_start_pfn <= pfn && pfn < zone_end_pfn(zone); | ||
| 538 | } | ||
| 539 | |||
| 540 | static inline bool zone_is_initialized(struct zone *zone) | ||
| 541 | { | ||
| 542 | return !!zone->wait_table; | ||
| 543 | } | ||
| 544 | |||
| 545 | static inline bool zone_is_empty(struct zone *zone) | ||
| 546 | { | ||
| 547 | return zone->spanned_pages == 0; | ||
| 548 | } | ||
| 549 | |||
| 546 | /* | 550 | /* |
| 547 | * The "priority" of VM scanning is how much of the queues we will scan in one | 551 | * The "priority" of VM scanning is how much of the queues we will scan in one |
| 548 | * go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the | 552 | * go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the |
| @@ -752,11 +756,17 @@ typedef struct pglist_data { | |||
| 752 | #define nid_page_nr(nid, pagenr) pgdat_page_nr(NODE_DATA(nid),(pagenr)) | 756 | #define nid_page_nr(nid, pagenr) pgdat_page_nr(NODE_DATA(nid),(pagenr)) |
| 753 | 757 | ||
| 754 | #define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) | 758 | #define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) |
| 759 | #define node_end_pfn(nid) pgdat_end_pfn(NODE_DATA(nid)) | ||
| 755 | 760 | ||
| 756 | #define node_end_pfn(nid) ({\ | 761 | static inline unsigned long pgdat_end_pfn(pg_data_t *pgdat) |
| 757 | pg_data_t *__pgdat = NODE_DATA(nid);\ | 762 | { |
| 758 | __pgdat->node_start_pfn + __pgdat->node_spanned_pages;\ | 763 | return pgdat->node_start_pfn + pgdat->node_spanned_pages; |
| 759 | }) | 764 | } |
| 765 | |||
| 766 | static inline bool pgdat_is_empty(pg_data_t *pgdat) | ||
| 767 | { | ||
| 768 | return !pgdat->node_start_pfn && !pgdat->node_spanned_pages; | ||
| 769 | } | ||
| 760 | 770 | ||
| 761 | #include <linux/memory_hotplug.h> | 771 | #include <linux/memory_hotplug.h> |
| 762 | 772 | ||
| @@ -1053,8 +1063,6 @@ static inline unsigned long early_pfn_to_nid(unsigned long pfn) | |||
| 1053 | * PA_SECTION_SHIFT physical address to/from section number | 1063 | * PA_SECTION_SHIFT physical address to/from section number |
| 1054 | * PFN_SECTION_SHIFT pfn to/from section number | 1064 | * PFN_SECTION_SHIFT pfn to/from section number |
| 1055 | */ | 1065 | */ |
| 1056 | #define SECTIONS_SHIFT (MAX_PHYSMEM_BITS - SECTION_SIZE_BITS) | ||
| 1057 | |||
| 1058 | #define PA_SECTION_SHIFT (SECTION_SIZE_BITS) | 1066 | #define PA_SECTION_SHIFT (SECTION_SIZE_BITS) |
| 1059 | #define PFN_SECTION_SHIFT (SECTION_SIZE_BITS - PAGE_SHIFT) | 1067 | #define PFN_SECTION_SHIFT (SECTION_SIZE_BITS - PAGE_SHIFT) |
| 1060 | 1068 | ||
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index fed3def62818..779cf7c4a3d1 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
| @@ -33,8 +33,7 @@ struct ieee1394_device_id { | |||
| 33 | __u32 model_id; | 33 | __u32 model_id; |
| 34 | __u32 specifier_id; | 34 | __u32 specifier_id; |
| 35 | __u32 version; | 35 | __u32 version; |
| 36 | kernel_ulong_t driver_data | 36 | kernel_ulong_t driver_data; |
| 37 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
| 38 | }; | 37 | }; |
| 39 | 38 | ||
| 40 | 39 | ||
| @@ -148,8 +147,7 @@ struct hid_device_id { | |||
| 148 | __u16 group; | 147 | __u16 group; |
| 149 | __u32 vendor; | 148 | __u32 vendor; |
| 150 | __u32 product; | 149 | __u32 product; |
| 151 | kernel_ulong_t driver_data | 150 | kernel_ulong_t driver_data; |
| 152 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
| 153 | }; | 151 | }; |
| 154 | 152 | ||
| 155 | /* s390 CCW devices */ | 153 | /* s390 CCW devices */ |
| @@ -173,8 +171,6 @@ struct ccw_device_id { | |||
| 173 | struct ap_device_id { | 171 | struct ap_device_id { |
| 174 | __u16 match_flags; /* which fields to match against */ | 172 | __u16 match_flags; /* which fields to match against */ |
| 175 | __u8 dev_type; /* device type */ | 173 | __u8 dev_type; /* device type */ |
| 176 | __u8 pad1; | ||
| 177 | __u32 pad2; | ||
| 178 | kernel_ulong_t driver_info; | 174 | kernel_ulong_t driver_info; |
| 179 | }; | 175 | }; |
| 180 | 176 | ||
| @@ -184,13 +180,10 @@ struct ap_device_id { | |||
| 184 | struct css_device_id { | 180 | struct css_device_id { |
| 185 | __u8 match_flags; | 181 | __u8 match_flags; |
| 186 | __u8 type; /* subchannel type */ | 182 | __u8 type; /* subchannel type */ |
| 187 | __u16 pad2; | ||
| 188 | __u32 pad3; | ||
| 189 | kernel_ulong_t driver_data; | 183 | kernel_ulong_t driver_data; |
| 190 | }; | 184 | }; |
| 191 | 185 | ||
| 192 | #define ACPI_ID_LEN 16 /* only 9 bytes needed here, 16 bytes are used */ | 186 | #define ACPI_ID_LEN 9 |
| 193 | /* to workaround crosscompile issues */ | ||
| 194 | 187 | ||
| 195 | struct acpi_device_id { | 188 | struct acpi_device_id { |
| 196 | __u8 id[ACPI_ID_LEN]; | 189 | __u8 id[ACPI_ID_LEN]; |
| @@ -231,11 +224,7 @@ struct of_device_id | |||
| 231 | char name[32]; | 224 | char name[32]; |
| 232 | char type[32]; | 225 | char type[32]; |
| 233 | char compatible[128]; | 226 | char compatible[128]; |
| 234 | #ifdef __KERNEL__ | ||
| 235 | const void *data; | 227 | const void *data; |
| 236 | #else | ||
| 237 | kernel_ulong_t data; | ||
| 238 | #endif | ||
| 239 | }; | 228 | }; |
| 240 | 229 | ||
| 241 | /* VIO */ | 230 | /* VIO */ |
| @@ -260,24 +249,14 @@ struct pcmcia_device_id { | |||
| 260 | /* for pseudo multi-function devices */ | 249 | /* for pseudo multi-function devices */ |
| 261 | __u8 device_no; | 250 | __u8 device_no; |
| 262 | 251 | ||
| 263 | __u32 prod_id_hash[4] | 252 | __u32 prod_id_hash[4]; |
| 264 | __attribute__((aligned(sizeof(__u32)))); | ||
| 265 | 253 | ||
| 266 | /* not matched against in kernelspace*/ | 254 | /* not matched against in kernelspace*/ |
| 267 | #ifdef __KERNEL__ | ||
| 268 | const char * prod_id[4]; | 255 | const char * prod_id[4]; |
| 269 | #else | ||
| 270 | kernel_ulong_t prod_id[4] | ||
| 271 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
| 272 | #endif | ||
| 273 | 256 | ||
| 274 | /* not matched against */ | 257 | /* not matched against */ |
| 275 | kernel_ulong_t driver_info; | 258 | kernel_ulong_t driver_info; |
| 276 | #ifdef __KERNEL__ | ||
| 277 | char * cisfile; | 259 | char * cisfile; |
| 278 | #else | ||
| 279 | kernel_ulong_t cisfile; | ||
| 280 | #endif | ||
| 281 | }; | 260 | }; |
| 282 | 261 | ||
| 283 | #define PCMCIA_DEV_ID_MATCH_MANF_ID 0x0001 | 262 | #define PCMCIA_DEV_ID_MATCH_MANF_ID 0x0001 |
| @@ -373,8 +352,7 @@ struct sdio_device_id { | |||
| 373 | __u8 class; /* Standard interface or SDIO_ANY_ID */ | 352 | __u8 class; /* Standard interface or SDIO_ANY_ID */ |
| 374 | __u16 vendor; /* Vendor or SDIO_ANY_ID */ | 353 | __u16 vendor; /* Vendor or SDIO_ANY_ID */ |
| 375 | __u16 device; /* Device ID or SDIO_ANY_ID */ | 354 | __u16 device; /* Device ID or SDIO_ANY_ID */ |
| 376 | kernel_ulong_t driver_data /* Data private to the driver */ | 355 | kernel_ulong_t driver_data; /* Data private to the driver */ |
| 377 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
| 378 | }; | 356 | }; |
| 379 | 357 | ||
| 380 | /* SSB core, see drivers/ssb/ */ | 358 | /* SSB core, see drivers/ssb/ */ |
| @@ -420,8 +398,7 @@ struct virtio_device_id { | |||
| 420 | */ | 398 | */ |
| 421 | struct hv_vmbus_device_id { | 399 | struct hv_vmbus_device_id { |
| 422 | __u8 guid[16]; | 400 | __u8 guid[16]; |
| 423 | kernel_ulong_t driver_data /* Data private to the driver */ | 401 | kernel_ulong_t driver_data; /* Data private to the driver */ |
| 424 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
| 425 | }; | 402 | }; |
| 426 | 403 | ||
| 427 | /* rpmsg */ | 404 | /* rpmsg */ |
| @@ -440,8 +417,7 @@ struct rpmsg_device_id { | |||
| 440 | 417 | ||
| 441 | struct i2c_device_id { | 418 | struct i2c_device_id { |
| 442 | char name[I2C_NAME_SIZE]; | 419 | char name[I2C_NAME_SIZE]; |
| 443 | kernel_ulong_t driver_data /* Data private to the driver */ | 420 | kernel_ulong_t driver_data; /* Data private to the driver */ |
| 444 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
| 445 | }; | 421 | }; |
| 446 | 422 | ||
| 447 | /* spi */ | 423 | /* spi */ |
| @@ -451,8 +427,7 @@ struct i2c_device_id { | |||
| 451 | 427 | ||
| 452 | struct spi_device_id { | 428 | struct spi_device_id { |
| 453 | char name[SPI_NAME_SIZE]; | 429 | char name[SPI_NAME_SIZE]; |
| 454 | kernel_ulong_t driver_data /* Data private to the driver */ | 430 | kernel_ulong_t driver_data; /* Data private to the driver */ |
| 455 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
| 456 | }; | 431 | }; |
| 457 | 432 | ||
| 458 | /* dmi */ | 433 | /* dmi */ |
| @@ -484,15 +459,6 @@ struct dmi_strmatch { | |||
| 484 | char substr[79]; | 459 | char substr[79]; |
| 485 | }; | 460 | }; |
| 486 | 461 | ||
| 487 | #ifndef __KERNEL__ | ||
| 488 | struct dmi_system_id { | ||
| 489 | kernel_ulong_t callback; | ||
| 490 | kernel_ulong_t ident; | ||
| 491 | struct dmi_strmatch matches[4]; | ||
| 492 | kernel_ulong_t driver_data | ||
| 493 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
| 494 | }; | ||
| 495 | #else | ||
| 496 | struct dmi_system_id { | 462 | struct dmi_system_id { |
| 497 | int (*callback)(const struct dmi_system_id *); | 463 | int (*callback)(const struct dmi_system_id *); |
| 498 | const char *ident; | 464 | const char *ident; |
| @@ -506,7 +472,6 @@ struct dmi_system_id { | |||
| 506 | * error: storage size of '__mod_dmi_device_table' isn't known | 472 | * error: storage size of '__mod_dmi_device_table' isn't known |
| 507 | */ | 473 | */ |
| 508 | #define dmi_device_id dmi_system_id | 474 | #define dmi_device_id dmi_system_id |
| 509 | #endif | ||
| 510 | 475 | ||
| 511 | #define DMI_MATCH(a, b) { a, b } | 476 | #define DMI_MATCH(a, b) { a, b } |
| 512 | 477 | ||
| @@ -515,8 +480,7 @@ struct dmi_system_id { | |||
| 515 | 480 | ||
| 516 | struct platform_device_id { | 481 | struct platform_device_id { |
| 517 | char name[PLATFORM_NAME_SIZE]; | 482 | char name[PLATFORM_NAME_SIZE]; |
| 518 | kernel_ulong_t driver_data | 483 | kernel_ulong_t driver_data; |
| 519 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
| 520 | }; | 484 | }; |
| 521 | 485 | ||
| 522 | #define MDIO_MODULE_PREFIX "mdio:" | 486 | #define MDIO_MODULE_PREFIX "mdio:" |
| @@ -572,11 +536,7 @@ struct isapnp_device_id { | |||
| 572 | struct amba_id { | 536 | struct amba_id { |
| 573 | unsigned int id; | 537 | unsigned int id; |
| 574 | unsigned int mask; | 538 | unsigned int mask; |
| 575 | #ifndef __KERNEL__ | ||
| 576 | kernel_ulong_t data; | ||
| 577 | #else | ||
| 578 | void *data; | 539 | void *data; |
| 579 | #endif | ||
| 580 | }; | 540 | }; |
| 581 | 541 | ||
| 582 | /* | 542 | /* |
diff --git a/include/linux/module.h b/include/linux/module.h index 1375ee3f03aa..ead1b5719a12 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
| @@ -396,13 +396,13 @@ bool is_module_address(unsigned long addr); | |||
| 396 | bool is_module_percpu_address(unsigned long addr); | 396 | bool is_module_percpu_address(unsigned long addr); |
| 397 | bool is_module_text_address(unsigned long addr); | 397 | bool is_module_text_address(unsigned long addr); |
| 398 | 398 | ||
| 399 | static inline int within_module_core(unsigned long addr, struct module *mod) | 399 | static inline int within_module_core(unsigned long addr, const struct module *mod) |
| 400 | { | 400 | { |
| 401 | return (unsigned long)mod->module_core <= addr && | 401 | return (unsigned long)mod->module_core <= addr && |
| 402 | addr < (unsigned long)mod->module_core + mod->core_size; | 402 | addr < (unsigned long)mod->module_core + mod->core_size; |
| 403 | } | 403 | } |
| 404 | 404 | ||
| 405 | static inline int within_module_init(unsigned long addr, struct module *mod) | 405 | static inline int within_module_init(unsigned long addr, const struct module *mod) |
| 406 | { | 406 | { |
| 407 | return (unsigned long)mod->module_init <= addr && | 407 | return (unsigned long)mod->module_init <= addr && |
| 408 | addr < (unsigned long)mod->module_init + mod->init_size; | 408 | addr < (unsigned long)mod->module_init + mod->init_size; |
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h index f6eb4332ac92..4b02512e421c 100644 --- a/include/linux/mtd/map.h +++ b/include/linux/mtd/map.h | |||
| @@ -245,6 +245,7 @@ struct map_info { | |||
| 245 | unsigned long pfow_base; | 245 | unsigned long pfow_base; |
| 246 | unsigned long map_priv_1; | 246 | unsigned long map_priv_1; |
| 247 | unsigned long map_priv_2; | 247 | unsigned long map_priv_2; |
| 248 | struct device_node *device_node; | ||
| 248 | void *fldrv_priv; | 249 | void *fldrv_priv; |
| 249 | struct mtd_chip_driver *fldrv; | 250 | struct mtd_chip_driver *fldrv; |
| 250 | }; | 251 | }; |
| @@ -328,7 +329,7 @@ static inline int map_word_bitsset(struct map_info *map, map_word val1, map_word | |||
| 328 | 329 | ||
| 329 | static inline map_word map_word_load(struct map_info *map, const void *ptr) | 330 | static inline map_word map_word_load(struct map_info *map, const void *ptr) |
| 330 | { | 331 | { |
| 331 | map_word r = {{0} }; | 332 | map_word r; |
| 332 | 333 | ||
| 333 | if (map_bankwidth_is_1(map)) | 334 | if (map_bankwidth_is_1(map)) |
| 334 | r.x[0] = *(unsigned char *)ptr; | 335 | r.x[0] = *(unsigned char *)ptr; |
| @@ -342,6 +343,8 @@ static inline map_word map_word_load(struct map_info *map, const void *ptr) | |||
| 342 | #endif | 343 | #endif |
| 343 | else if (map_bankwidth_is_large(map)) | 344 | else if (map_bankwidth_is_large(map)) |
| 344 | memcpy(r.x, ptr, map->bankwidth); | 345 | memcpy(r.x, ptr, map->bankwidth); |
| 346 | else | ||
| 347 | BUG(); | ||
| 345 | 348 | ||
| 346 | return r; | 349 | return r; |
| 347 | } | 350 | } |
| @@ -391,7 +394,7 @@ static inline map_word map_word_ff(struct map_info *map) | |||
| 391 | 394 | ||
| 392 | static inline map_word inline_map_read(struct map_info *map, unsigned long ofs) | 395 | static inline map_word inline_map_read(struct map_info *map, unsigned long ofs) |
| 393 | { | 396 | { |
| 394 | map_word uninitialized_var(r); | 397 | map_word r; |
| 395 | 398 | ||
| 396 | if (map_bankwidth_is_1(map)) | 399 | if (map_bankwidth_is_1(map)) |
| 397 | r.x[0] = __raw_readb(map->virt + ofs); | 400 | r.x[0] = __raw_readb(map->virt + ofs); |
| @@ -425,6 +428,8 @@ static inline void inline_map_write(struct map_info *map, const map_word datum, | |||
| 425 | #endif | 428 | #endif |
| 426 | else if (map_bankwidth_is_large(map)) | 429 | else if (map_bankwidth_is_large(map)) |
| 427 | memcpy_toio(map->virt+ofs, datum.x, map->bankwidth); | 430 | memcpy_toio(map->virt+ofs, datum.x, map->bankwidth); |
| 431 | else | ||
| 432 | BUG(); | ||
| 428 | mb(); | 433 | mb(); |
| 429 | } | 434 | } |
| 430 | 435 | ||
diff --git a/include/linux/netfilter/ipset/ip_set_ahash.h b/include/linux/netfilter/ipset/ip_set_ahash.h index ef9acd3c8450..01d25e6fc792 100644 --- a/include/linux/netfilter/ipset/ip_set_ahash.h +++ b/include/linux/netfilter/ipset/ip_set_ahash.h | |||
| @@ -854,6 +854,8 @@ type_pf_tresize(struct ip_set *set, bool retried) | |||
| 854 | retry: | 854 | retry: |
| 855 | ret = 0; | 855 | ret = 0; |
| 856 | htable_bits++; | 856 | htable_bits++; |
| 857 | pr_debug("attempt to resize set %s from %u to %u, t %p\n", | ||
| 858 | set->name, orig->htable_bits, htable_bits, orig); | ||
| 857 | if (!htable_bits) { | 859 | if (!htable_bits) { |
| 858 | /* In case we have plenty of memory :-) */ | 860 | /* In case we have plenty of memory :-) */ |
| 859 | pr_warning("Cannot increase the hashsize of set %s further\n", | 861 | pr_warning("Cannot increase the hashsize of set %s further\n", |
| @@ -873,7 +875,7 @@ retry: | |||
| 873 | data = ahash_tdata(n, j); | 875 | data = ahash_tdata(n, j); |
| 874 | m = hbucket(t, HKEY(data, h->initval, htable_bits)); | 876 | m = hbucket(t, HKEY(data, h->initval, htable_bits)); |
| 875 | ret = type_pf_elem_tadd(m, data, AHASH_MAX(h), 0, | 877 | ret = type_pf_elem_tadd(m, data, AHASH_MAX(h), 0, |
| 876 | type_pf_data_timeout(data)); | 878 | ip_set_timeout_get(type_pf_data_timeout(data))); |
| 877 | if (ret < 0) { | 879 | if (ret < 0) { |
| 878 | read_unlock_bh(&set->lock); | 880 | read_unlock_bh(&set->lock); |
| 879 | ahash_destroy(t); | 881 | ahash_destroy(t); |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index e111fa419a4e..7b8fc73810ad 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #define _LINUX_NFS4_H | 13 | #define _LINUX_NFS4_H |
| 14 | 14 | ||
| 15 | #include <linux/list.h> | 15 | #include <linux/list.h> |
| 16 | #include <linux/uidgid.h> | ||
| 16 | #include <uapi/linux/nfs4.h> | 17 | #include <uapi/linux/nfs4.h> |
| 17 | 18 | ||
| 18 | struct nfs4_ace { | 19 | struct nfs4_ace { |
| @@ -20,7 +21,10 @@ struct nfs4_ace { | |||
| 20 | uint32_t flag; | 21 | uint32_t flag; |
| 21 | uint32_t access_mask; | 22 | uint32_t access_mask; |
| 22 | int whotype; | 23 | int whotype; |
| 23 | uid_t who; | 24 | union { |
| 25 | kuid_t who_uid; | ||
| 26 | kgid_t who_gid; | ||
| 27 | }; | ||
| 24 | }; | 28 | }; |
| 25 | 29 | ||
| 26 | struct nfs4_acl { | 30 | struct nfs4_acl { |
diff --git a/include/linux/nfs_idmap.h b/include/linux/nfs_idmap.h index 2dcef3ab58b6..0f4b79da6584 100644 --- a/include/linux/nfs_idmap.h +++ b/include/linux/nfs_idmap.h | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #ifndef NFS_IDMAP_H | 36 | #ifndef NFS_IDMAP_H |
| 37 | #define NFS_IDMAP_H | 37 | #define NFS_IDMAP_H |
| 38 | 38 | ||
| 39 | #include <linux/uidgid.h> | ||
| 39 | #include <uapi/linux/nfs_idmap.h> | 40 | #include <uapi/linux/nfs_idmap.h> |
| 40 | 41 | ||
| 41 | 42 | ||
| @@ -67,10 +68,10 @@ void nfs_fattr_init_names(struct nfs_fattr *fattr, | |||
| 67 | void nfs_fattr_free_names(struct nfs_fattr *); | 68 | void nfs_fattr_free_names(struct nfs_fattr *); |
| 68 | void nfs_fattr_map_and_free_names(struct nfs_server *, struct nfs_fattr *); | 69 | void nfs_fattr_map_and_free_names(struct nfs_server *, struct nfs_fattr *); |
| 69 | 70 | ||
| 70 | int nfs_map_name_to_uid(const struct nfs_server *, const char *, size_t, __u32 *); | 71 | int nfs_map_name_to_uid(const struct nfs_server *, const char *, size_t, kuid_t *); |
| 71 | int nfs_map_group_to_gid(const struct nfs_server *, const char *, size_t, __u32 *); | 72 | int nfs_map_group_to_gid(const struct nfs_server *, const char *, size_t, kgid_t *); |
| 72 | int nfs_map_uid_to_name(const struct nfs_server *, __u32, char *, size_t); | 73 | int nfs_map_uid_to_name(const struct nfs_server *, kuid_t, char *, size_t); |
| 73 | int nfs_map_gid_to_group(const struct nfs_server *, __u32, char *, size_t); | 74 | int nfs_map_gid_to_group(const struct nfs_server *, kgid_t, char *, size_t); |
| 74 | 75 | ||
| 75 | extern unsigned int nfs_idmap_cache_timeout; | 76 | extern unsigned int nfs_idmap_cache_timeout; |
| 76 | #endif /* NFS_IDMAP_H */ | 77 | #endif /* NFS_IDMAP_H */ |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 29adb12c7ecf..4b993d358dad 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
| @@ -48,8 +48,8 @@ struct nfs_fattr { | |||
| 48 | unsigned int valid; /* which fields are valid */ | 48 | unsigned int valid; /* which fields are valid */ |
| 49 | umode_t mode; | 49 | umode_t mode; |
| 50 | __u32 nlink; | 50 | __u32 nlink; |
| 51 | __u32 uid; | 51 | kuid_t uid; |
| 52 | __u32 gid; | 52 | kgid_t gid; |
| 53 | dev_t rdev; | 53 | dev_t rdev; |
| 54 | __u64 size; | 54 | __u64 size; |
| 55 | union { | 55 | union { |
| @@ -233,6 +233,7 @@ struct nfs4_layoutget_args { | |||
| 233 | struct inode *inode; | 233 | struct inode *inode; |
| 234 | struct nfs_open_context *ctx; | 234 | struct nfs_open_context *ctx; |
| 235 | nfs4_stateid stateid; | 235 | nfs4_stateid stateid; |
| 236 | unsigned long timestamp; | ||
| 236 | struct nfs4_layoutdriver_data layout; | 237 | struct nfs4_layoutdriver_data layout; |
| 237 | }; | 238 | }; |
| 238 | 239 | ||
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h index 24c139288db4..7898c997dfea 100644 --- a/include/linux/nfsd/export.h +++ b/include/linux/nfsd/export.h | |||
| @@ -49,8 +49,8 @@ struct svc_export { | |||
| 49 | struct auth_domain * ex_client; | 49 | struct auth_domain * ex_client; |
| 50 | int ex_flags; | 50 | int ex_flags; |
| 51 | struct path ex_path; | 51 | struct path ex_path; |
| 52 | uid_t ex_anon_uid; | 52 | kuid_t ex_anon_uid; |
| 53 | gid_t ex_anon_gid; | 53 | kgid_t ex_anon_gid; |
| 54 | int ex_fsid; | 54 | int ex_fsid; |
| 55 | unsigned char * ex_uuid; /* 16 byte fsid */ | 55 | unsigned char * ex_uuid; /* 16 byte fsid */ |
| 56 | struct nfsd4_fs_locations ex_fslocs; | 56 | struct nfsd4_fs_locations ex_fslocs; |
diff --git a/include/linux/of_dma.h b/include/linux/of_dma.h new file mode 100644 index 000000000000..d15073e080dd --- /dev/null +++ b/include/linux/of_dma.h | |||
| @@ -0,0 +1,74 @@ | |||
| 1 | /* | ||
| 2 | * OF helpers for DMA request / controller | ||
| 3 | * | ||
| 4 | * Based on of_gpio.h | ||
| 5 | * | ||
| 6 | * Copyright (C) 2012 Texas Instruments Incorporated - http://www.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 version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef __LINUX_OF_DMA_H | ||
| 14 | #define __LINUX_OF_DMA_H | ||
| 15 | |||
| 16 | #include <linux/of.h> | ||
| 17 | #include <linux/dmaengine.h> | ||
| 18 | |||
| 19 | struct device_node; | ||
| 20 | |||
| 21 | struct of_dma { | ||
| 22 | struct list_head of_dma_controllers; | ||
| 23 | struct device_node *of_node; | ||
| 24 | int of_dma_nbcells; | ||
| 25 | struct dma_chan *(*of_dma_xlate) | ||
| 26 | (struct of_phandle_args *, struct of_dma *); | ||
| 27 | void *of_dma_data; | ||
| 28 | int use_count; | ||
| 29 | }; | ||
| 30 | |||
| 31 | struct of_dma_filter_info { | ||
| 32 | dma_cap_mask_t dma_cap; | ||
| 33 | dma_filter_fn filter_fn; | ||
| 34 | }; | ||
| 35 | |||
| 36 | #ifdef CONFIG_OF | ||
| 37 | extern int of_dma_controller_register(struct device_node *np, | ||
| 38 | struct dma_chan *(*of_dma_xlate) | ||
| 39 | (struct of_phandle_args *, struct of_dma *), | ||
| 40 | void *data); | ||
| 41 | extern int of_dma_controller_free(struct device_node *np); | ||
| 42 | extern struct dma_chan *of_dma_request_slave_channel(struct device_node *np, | ||
| 43 | char *name); | ||
| 44 | extern struct dma_chan *of_dma_simple_xlate(struct of_phandle_args *dma_spec, | ||
| 45 | struct of_dma *ofdma); | ||
| 46 | #else | ||
| 47 | static inline int of_dma_controller_register(struct device_node *np, | ||
| 48 | struct dma_chan *(*of_dma_xlate) | ||
| 49 | (struct of_phandle_args *, struct of_dma *), | ||
| 50 | void *data) | ||
| 51 | { | ||
| 52 | return -ENODEV; | ||
| 53 | } | ||
| 54 | |||
| 55 | static inline int of_dma_controller_free(struct device_node *np) | ||
| 56 | { | ||
| 57 | return -ENODEV; | ||
| 58 | } | ||
| 59 | |||
| 60 | static inline struct dma_chan *of_dma_request_slave_channel(struct device_node *np, | ||
| 61 | char *name) | ||
| 62 | { | ||
| 63 | return NULL; | ||
| 64 | } | ||
| 65 | |||
| 66 | static inline struct dma_chan *of_dma_simple_xlate(struct of_phandle_args *dma_spec, | ||
| 67 | struct of_dma *ofdma) | ||
| 68 | { | ||
| 69 | return NULL; | ||
| 70 | } | ||
| 71 | |||
| 72 | #endif | ||
| 73 | |||
| 74 | #endif /* __LINUX_OF_DMA_H */ | ||
diff --git a/include/linux/opp.h b/include/linux/opp.h index 214e0ebcb84d..3aca2b8def33 100644 --- a/include/linux/opp.h +++ b/include/linux/opp.h | |||
| @@ -47,15 +47,6 @@ int opp_enable(struct device *dev, unsigned long freq); | |||
| 47 | int opp_disable(struct device *dev, unsigned long freq); | 47 | int opp_disable(struct device *dev, unsigned long freq); |
| 48 | 48 | ||
| 49 | struct srcu_notifier_head *opp_get_notifier(struct device *dev); | 49 | struct srcu_notifier_head *opp_get_notifier(struct device *dev); |
| 50 | |||
| 51 | #ifdef CONFIG_OF | ||
| 52 | int of_init_opp_table(struct device *dev); | ||
| 53 | #else | ||
| 54 | static inline int of_init_opp_table(struct device *dev) | ||
| 55 | { | ||
| 56 | return -EINVAL; | ||
| 57 | } | ||
| 58 | #endif /* CONFIG_OF */ | ||
| 59 | #else | 50 | #else |
| 60 | static inline unsigned long opp_get_voltage(struct opp *opp) | 51 | static inline unsigned long opp_get_voltage(struct opp *opp) |
| 61 | { | 52 | { |
| @@ -112,6 +103,15 @@ static inline struct srcu_notifier_head *opp_get_notifier(struct device *dev) | |||
| 112 | } | 103 | } |
| 113 | #endif /* CONFIG_PM_OPP */ | 104 | #endif /* CONFIG_PM_OPP */ |
| 114 | 105 | ||
| 106 | #if defined(CONFIG_PM_OPP) && defined(CONFIG_OF) | ||
| 107 | int of_init_opp_table(struct device *dev); | ||
| 108 | #else | ||
| 109 | static inline int of_init_opp_table(struct device *dev) | ||
| 110 | { | ||
| 111 | return -EINVAL; | ||
| 112 | } | ||
| 113 | #endif | ||
| 114 | |||
| 115 | #if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP) | 115 | #if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP) |
| 116 | int opp_init_cpufreq_table(struct device *dev, | 116 | int opp_init_cpufreq_table(struct device *dev, |
| 117 | struct cpufreq_frequency_table **table); | 117 | struct cpufreq_frequency_table **table); |
diff --git a/include/linux/page-flags-layout.h b/include/linux/page-flags-layout.h new file mode 100644 index 000000000000..93506a114034 --- /dev/null +++ b/include/linux/page-flags-layout.h | |||
| @@ -0,0 +1,88 @@ | |||
| 1 | #ifndef PAGE_FLAGS_LAYOUT_H | ||
| 2 | #define PAGE_FLAGS_LAYOUT_H | ||
| 3 | |||
| 4 | #include <linux/numa.h> | ||
| 5 | #include <generated/bounds.h> | ||
| 6 | |||
| 7 | /* | ||
| 8 | * When a memory allocation must conform to specific limitations (such | ||
| 9 | * as being suitable for DMA) the caller will pass in hints to the | ||
| 10 | * allocator in the gfp_mask, in the zone modifier bits. These bits | ||
| 11 | * are used to select a priority ordered list of memory zones which | ||
| 12 | * match the requested limits. See gfp_zone() in include/linux/gfp.h | ||
| 13 | */ | ||
| 14 | #if MAX_NR_ZONES < 2 | ||
| 15 | #define ZONES_SHIFT 0 | ||
| 16 | #elif MAX_NR_ZONES <= 2 | ||
| 17 | #define ZONES_SHIFT 1 | ||
| 18 | #elif MAX_NR_ZONES <= 4 | ||
| 19 | #define ZONES_SHIFT 2 | ||
| 20 | #else | ||
| 21 | #error ZONES_SHIFT -- too many zones configured adjust calculation | ||
| 22 | #endif | ||
| 23 | |||
| 24 | #ifdef CONFIG_SPARSEMEM | ||
| 25 | #include <asm/sparsemem.h> | ||
| 26 | |||
| 27 | /* SECTION_SHIFT #bits space required to store a section # */ | ||
| 28 | #define SECTIONS_SHIFT (MAX_PHYSMEM_BITS - SECTION_SIZE_BITS) | ||
| 29 | |||
| 30 | #endif /* CONFIG_SPARSEMEM */ | ||
| 31 | |||
| 32 | /* | ||
| 33 | * page->flags layout: | ||
| 34 | * | ||
| 35 | * There are five possibilities for how page->flags get laid out. The first | ||
| 36 | * pair is for the normal case without sparsemem. The second pair is for | ||
| 37 | * sparsemem when there is plenty of space for node and section information. | ||
| 38 | * The last is when there is insufficient space in page->flags and a separate | ||
| 39 | * lookup is necessary. | ||
| 40 | * | ||
| 41 | * No sparsemem or sparsemem vmemmap: | NODE | ZONE | ... | FLAGS | | ||
| 42 | * " plus space for last_nid: | NODE | ZONE | LAST_NID ... | FLAGS | | ||
| 43 | * classic sparse with space for node:| SECTION | NODE | ZONE | ... | FLAGS | | ||
| 44 | * " plus space for last_nid: | SECTION | NODE | ZONE | LAST_NID ... | FLAGS | | ||
| 45 | * classic sparse no space for node: | SECTION | ZONE | ... | FLAGS | | ||
| 46 | */ | ||
| 47 | #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) | ||
| 48 | #define SECTIONS_WIDTH SECTIONS_SHIFT | ||
| 49 | #else | ||
| 50 | #define SECTIONS_WIDTH 0 | ||
| 51 | #endif | ||
| 52 | |||
| 53 | #define ZONES_WIDTH ZONES_SHIFT | ||
| 54 | |||
| 55 | #if SECTIONS_WIDTH+ZONES_WIDTH+NODES_SHIFT <= BITS_PER_LONG - NR_PAGEFLAGS | ||
| 56 | #define NODES_WIDTH NODES_SHIFT | ||
| 57 | #else | ||
| 58 | #ifdef CONFIG_SPARSEMEM_VMEMMAP | ||
| 59 | #error "Vmemmap: No space for nodes field in page flags" | ||
| 60 | #endif | ||
| 61 | #define NODES_WIDTH 0 | ||
| 62 | #endif | ||
| 63 | |||
| 64 | #ifdef CONFIG_NUMA_BALANCING | ||
| 65 | #define LAST_NID_SHIFT NODES_SHIFT | ||
| 66 | #else | ||
| 67 | #define LAST_NID_SHIFT 0 | ||
| 68 | #endif | ||
| 69 | |||
| 70 | #if SECTIONS_WIDTH+ZONES_WIDTH+NODES_SHIFT+LAST_NID_SHIFT <= BITS_PER_LONG - NR_PAGEFLAGS | ||
| 71 | #define LAST_NID_WIDTH LAST_NID_SHIFT | ||
| 72 | #else | ||
| 73 | #define LAST_NID_WIDTH 0 | ||
| 74 | #endif | ||
| 75 | |||
| 76 | /* | ||
| 77 | * We are going to use the flags for the page to node mapping if its in | ||
| 78 | * there. This includes the case where there is no node, so it is implicit. | ||
| 79 | */ | ||
| 80 | #if !(NODES_WIDTH > 0 || NODES_SHIFT == 0) | ||
| 81 | #define NODE_NOT_IN_PAGE_FLAGS | ||
| 82 | #endif | ||
| 83 | |||
| 84 | #if defined(CONFIG_NUMA_BALANCING) && LAST_NID_WIDTH == 0 | ||
| 85 | #define LAST_NID_NOT_IN_PAGE_FLAGS | ||
| 86 | #endif | ||
| 87 | |||
| 88 | #endif /* _LINUX_PAGE_FLAGS_LAYOUT */ | ||
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 70473da47b3f..6d53675c2b54 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
| @@ -303,21 +303,13 @@ static inline void __SetPageUptodate(struct page *page) | |||
| 303 | 303 | ||
| 304 | static inline void SetPageUptodate(struct page *page) | 304 | static inline void SetPageUptodate(struct page *page) |
| 305 | { | 305 | { |
| 306 | #ifdef CONFIG_S390 | ||
| 307 | if (!test_and_set_bit(PG_uptodate, &page->flags)) | ||
| 308 | page_set_storage_key(page_to_phys(page), PAGE_DEFAULT_KEY, 0); | ||
| 309 | #else | ||
| 310 | /* | 306 | /* |
| 311 | * Memory barrier must be issued before setting the PG_uptodate bit, | 307 | * Memory barrier must be issued before setting the PG_uptodate bit, |
| 312 | * so that all previous stores issued in order to bring the page | 308 | * so that all previous stores issued in order to bring the page |
| 313 | * uptodate are actually visible before PageUptodate becomes true. | 309 | * uptodate are actually visible before PageUptodate becomes true. |
| 314 | * | ||
| 315 | * s390 doesn't need an explicit smp_wmb here because the test and | ||
| 316 | * set bit already provides full barriers. | ||
| 317 | */ | 310 | */ |
| 318 | smp_wmb(); | 311 | smp_wmb(); |
| 319 | set_bit(PG_uptodate, &(page)->flags); | 312 | set_bit(PG_uptodate, &(page)->flags); |
| 320 | #endif | ||
| 321 | } | 313 | } |
| 322 | 314 | ||
| 323 | CLEARPAGEFLAG(Uptodate, uptodate) | 315 | CLEARPAGEFLAG(Uptodate, uptodate) |
diff --git a/include/linux/page-isolation.h b/include/linux/page-isolation.h index a92061e08d48..3fff8e774067 100644 --- a/include/linux/page-isolation.h +++ b/include/linux/page-isolation.h | |||
| @@ -1,6 +1,25 @@ | |||
| 1 | #ifndef __LINUX_PAGEISOLATION_H | 1 | #ifndef __LINUX_PAGEISOLATION_H |
| 2 | #define __LINUX_PAGEISOLATION_H | 2 | #define __LINUX_PAGEISOLATION_H |
| 3 | 3 | ||
| 4 | #ifdef CONFIG_MEMORY_ISOLATION | ||
| 5 | static inline bool is_migrate_isolate_page(struct page *page) | ||
| 6 | { | ||
| 7 | return get_pageblock_migratetype(page) == MIGRATE_ISOLATE; | ||
| 8 | } | ||
| 9 | static inline bool is_migrate_isolate(int migratetype) | ||
| 10 | { | ||
| 11 | return migratetype == MIGRATE_ISOLATE; | ||
| 12 | } | ||
| 13 | #else | ||
| 14 | static inline bool is_migrate_isolate_page(struct page *page) | ||
| 15 | { | ||
| 16 | return false; | ||
| 17 | } | ||
| 18 | static inline bool is_migrate_isolate(int migratetype) | ||
| 19 | { | ||
| 20 | return false; | ||
| 21 | } | ||
| 22 | #endif | ||
| 4 | 23 | ||
| 5 | bool has_unmovable_pages(struct zone *zone, struct page *page, int count, | 24 | bool has_unmovable_pages(struct zone *zone, struct page *page, int count, |
| 6 | bool skip_hwpoisoned_pages); | 25 | bool skip_hwpoisoned_pages); |
diff --git a/include/linux/path.h b/include/linux/path.h index edc98dec6266..d1372186f431 100644 --- a/include/linux/path.h +++ b/include/linux/path.h | |||
| @@ -9,8 +9,8 @@ struct path { | |||
| 9 | struct dentry *dentry; | 9 | struct dentry *dentry; |
| 10 | }; | 10 | }; |
| 11 | 11 | ||
| 12 | extern void path_get(struct path *); | 12 | extern void path_get(const struct path *); |
| 13 | extern void path_put(struct path *); | 13 | extern void path_put(const struct path *); |
| 14 | 14 | ||
| 15 | static inline int path_equal(const struct path *path1, const struct path *path2) | 15 | static inline int path_equal(const struct path *path1, const struct path *path2) |
| 16 | { | 16 | { |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 6fa4dd2a3b9e..2461033a7987 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -286,6 +286,7 @@ struct pci_dev { | |||
| 286 | unsigned int irq; | 286 | unsigned int irq; |
| 287 | struct resource resource[DEVICE_COUNT_RESOURCE]; /* I/O and memory regions + expansion ROMs */ | 287 | struct resource resource[DEVICE_COUNT_RESOURCE]; /* I/O and memory regions + expansion ROMs */ |
| 288 | 288 | ||
| 289 | bool match_driver; /* Skip attaching driver */ | ||
| 289 | /* These fields are used by common fixups */ | 290 | /* These fields are used by common fixups */ |
| 290 | unsigned int transparent:1; /* Transparent PCI bridge */ | 291 | unsigned int transparent:1; /* Transparent PCI bridge */ |
| 291 | unsigned int multifunction:1;/* Part of multi-function device */ | 292 | unsigned int multifunction:1;/* Part of multi-function device */ |
| @@ -378,6 +379,8 @@ void pci_set_host_bridge_release(struct pci_host_bridge *bridge, | |||
| 378 | void (*release_fn)(struct pci_host_bridge *), | 379 | void (*release_fn)(struct pci_host_bridge *), |
| 379 | void *release_data); | 380 | void *release_data); |
| 380 | 381 | ||
| 382 | int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge); | ||
| 383 | |||
| 381 | /* | 384 | /* |
| 382 | * The first PCI_BRIDGE_RESOURCE_NUM PCI bus resources (those that correspond | 385 | * The first PCI_BRIDGE_RESOURCE_NUM PCI bus resources (those that correspond |
| 383 | * to P2P or CardBus bridge windows) go in a table. Additional ones (for | 386 | * to P2P or CardBus bridge windows) go in a table. Additional ones (for |
| @@ -674,6 +677,7 @@ extern struct list_head pci_root_buses; /* list of all known PCI buses */ | |||
| 674 | /* Some device drivers need know if pci is initiated */ | 677 | /* Some device drivers need know if pci is initiated */ |
| 675 | extern int no_pci_devices(void); | 678 | extern int no_pci_devices(void); |
| 676 | 679 | ||
| 680 | void pcibios_resource_survey_bus(struct pci_bus *bus); | ||
| 677 | void pcibios_fixup_bus(struct pci_bus *); | 681 | void pcibios_fixup_bus(struct pci_bus *); |
| 678 | int __must_check pcibios_enable_device(struct pci_dev *, int mask); | 682 | int __must_check pcibios_enable_device(struct pci_dev *, int mask); |
| 679 | /* Architecture specific versions may override this (weak) */ | 683 | /* Architecture specific versions may override this (weak) */ |
| @@ -1700,12 +1704,21 @@ static inline bool pci_is_pcie(struct pci_dev *dev) | |||
| 1700 | } | 1704 | } |
| 1701 | 1705 | ||
| 1702 | /** | 1706 | /** |
| 1707 | * pcie_caps_reg - get the PCIe Capabilities Register | ||
| 1708 | * @dev: PCI device | ||
| 1709 | */ | ||
| 1710 | static inline u16 pcie_caps_reg(const struct pci_dev *dev) | ||
| 1711 | { | ||
| 1712 | return dev->pcie_flags_reg; | ||
| 1713 | } | ||
| 1714 | |||
| 1715 | /** | ||
| 1703 | * pci_pcie_type - get the PCIe device/port type | 1716 | * pci_pcie_type - get the PCIe device/port type |
| 1704 | * @dev: PCI device | 1717 | * @dev: PCI device |
| 1705 | */ | 1718 | */ |
| 1706 | static inline int pci_pcie_type(const struct pci_dev *dev) | 1719 | static inline int pci_pcie_type(const struct pci_dev *dev) |
| 1707 | { | 1720 | { |
| 1708 | return (dev->pcie_flags_reg & PCI_EXP_FLAGS_TYPE) >> 4; | 1721 | return (pcie_caps_reg(dev) & PCI_EXP_FLAGS_TYPE) >> 4; |
| 1709 | } | 1722 | } |
| 1710 | 1723 | ||
| 1711 | void pci_request_acs(void); | 1724 | void pci_request_acs(void); |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 31717bd287fd..f11c1c2609d5 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -2802,6 +2802,7 @@ | |||
| 2802 | #define PCI_DEVICE_ID_INTEL_JAKETOWN_UBOX 0x3ce0 | 2802 | #define PCI_DEVICE_ID_INTEL_JAKETOWN_UBOX 0x3ce0 |
| 2803 | #define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f | 2803 | #define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f |
| 2804 | #define PCI_DEVICE_ID_INTEL_5100_16 0x65f0 | 2804 | #define PCI_DEVICE_ID_INTEL_5100_16 0x65f0 |
| 2805 | #define PCI_DEVICE_ID_INTEL_5100_19 0x65f3 | ||
| 2805 | #define PCI_DEVICE_ID_INTEL_5100_21 0x65f5 | 2806 | #define PCI_DEVICE_ID_INTEL_5100_21 0x65f5 |
| 2806 | #define PCI_DEVICE_ID_INTEL_5100_22 0x65f6 | 2807 | #define PCI_DEVICE_ID_INTEL_5100_22 0x65f6 |
| 2807 | #define PCI_DEVICE_ID_INTEL_5400_ERR 0x4030 | 2808 | #define PCI_DEVICE_ID_INTEL_5400_ERR 0x4030 |
diff --git a/include/linux/pid.h b/include/linux/pid.h index 2381c973d897..a089a3c447fc 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h | |||
| @@ -176,9 +176,8 @@ pid_t pid_vnr(struct pid *pid); | |||
| 176 | 176 | ||
| 177 | #define do_each_pid_task(pid, type, task) \ | 177 | #define do_each_pid_task(pid, type, task) \ |
| 178 | do { \ | 178 | do { \ |
| 179 | struct hlist_node *pos___; \ | ||
| 180 | if ((pid) != NULL) \ | 179 | if ((pid) != NULL) \ |
| 181 | hlist_for_each_entry_rcu((task), pos___, \ | 180 | hlist_for_each_entry_rcu((task), \ |
| 182 | &(pid)->tasks[type], pids[type].node) { | 181 | &(pid)->tasks[type], pids[type].node) { |
| 183 | 182 | ||
| 184 | /* | 183 | /* |
diff --git a/include/linux/platform_data/dma-ste-dma40.h b/include/linux/platform_data/dma-ste-dma40.h index 9ff93b065686..4b781014b0a0 100644 --- a/include/linux/platform_data/dma-ste-dma40.h +++ b/include/linux/platform_data/dma-ste-dma40.h | |||
| @@ -147,6 +147,16 @@ struct stedma40_chan_cfg { | |||
| 147 | * @memcpy_conf_log: default configuration of logical channel memcpy | 147 | * @memcpy_conf_log: default configuration of logical channel memcpy |
| 148 | * @disabled_channels: A vector, ending with -1, that marks physical channels | 148 | * @disabled_channels: A vector, ending with -1, that marks physical channels |
| 149 | * that are for different reasons not available for the driver. | 149 | * that are for different reasons not available for the driver. |
| 150 | * @soft_lli_chans: A vector, that marks physical channels will use LLI by SW | ||
| 151 | * which avoids HW bug that exists in some versions of the controller. | ||
| 152 | * SoftLLI introduces relink overhead that could impact performace for | ||
| 153 | * certain use cases. | ||
| 154 | * @num_of_soft_lli_chans: The number of channels that needs to be configured | ||
| 155 | * to use SoftLLI. | ||
| 156 | * @use_esram_lcla: flag for mapping the lcla into esram region | ||
| 157 | * @num_of_phy_chans: The number of physical channels implemented in HW. | ||
| 158 | * 0 means reading the number of channels from DMA HW but this is only valid | ||
| 159 | * for 'multiple of 4' channels, like 8. | ||
| 150 | */ | 160 | */ |
| 151 | struct stedma40_platform_data { | 161 | struct stedma40_platform_data { |
| 152 | u32 dev_len; | 162 | u32 dev_len; |
| @@ -157,7 +167,10 @@ struct stedma40_platform_data { | |||
| 157 | struct stedma40_chan_cfg *memcpy_conf_phy; | 167 | struct stedma40_chan_cfg *memcpy_conf_phy; |
| 158 | struct stedma40_chan_cfg *memcpy_conf_log; | 168 | struct stedma40_chan_cfg *memcpy_conf_log; |
| 159 | int disabled_channels[STEDMA40_MAX_PHYS]; | 169 | int disabled_channels[STEDMA40_MAX_PHYS]; |
| 170 | int *soft_lli_chans; | ||
| 171 | int num_of_soft_lli_chans; | ||
| 160 | bool use_esram_lcla; | 172 | bool use_esram_lcla; |
| 173 | int num_of_phy_chans; | ||
| 161 | }; | 174 | }; |
| 162 | 175 | ||
| 163 | #ifdef CONFIG_STE_DMA40 | 176 | #ifdef CONFIG_STE_DMA40 |
diff --git a/include/linux/platform_data/elm.h b/include/linux/platform_data/elm.h new file mode 100644 index 000000000000..1bd5244d1dcd --- /dev/null +++ b/include/linux/platform_data/elm.h | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | /* | ||
| 2 | * BCH Error Location Module | ||
| 3 | * | ||
| 4 | * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.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 | |||
| 18 | #ifndef __ELM_H | ||
| 19 | #define __ELM_H | ||
| 20 | |||
| 21 | enum bch_ecc { | ||
| 22 | BCH4_ECC = 0, | ||
| 23 | BCH8_ECC, | ||
| 24 | }; | ||
| 25 | |||
| 26 | /* ELM support 8 error syndrome process */ | ||
| 27 | #define ERROR_VECTOR_MAX 8 | ||
| 28 | |||
| 29 | #define BCH8_ECC_OOB_BYTES 13 | ||
| 30 | #define BCH4_ECC_OOB_BYTES 7 | ||
| 31 | /* RBL requires 14 byte even though BCH8 uses only 13 byte */ | ||
| 32 | #define BCH8_SIZE (BCH8_ECC_OOB_BYTES + 1) | ||
| 33 | /* Uses 1 extra byte to handle erased pages */ | ||
| 34 | #define BCH4_SIZE (BCH4_ECC_OOB_BYTES + 1) | ||
| 35 | |||
| 36 | /** | ||
| 37 | * struct elm_errorvec - error vector for elm | ||
| 38 | * @error_reported: set true for vectors error is reported | ||
| 39 | * @error_uncorrectable: number of uncorrectable errors | ||
| 40 | * @error_count: number of correctable errors in the sector | ||
| 41 | * @error_loc: buffer for error location | ||
| 42 | * | ||
| 43 | */ | ||
| 44 | struct elm_errorvec { | ||
| 45 | bool error_reported; | ||
| 46 | bool error_uncorrectable; | ||
| 47 | int error_count; | ||
| 48 | int error_loc[ERROR_VECTOR_MAX]; | ||
| 49 | }; | ||
| 50 | |||
| 51 | void elm_decode_bch_error_page(struct device *dev, u8 *ecc_calc, | ||
| 52 | struct elm_errorvec *err_vec); | ||
| 53 | void elm_config(struct device *dev, enum bch_ecc bch_type); | ||
| 54 | #endif /* __ELM_H */ | ||
diff --git a/include/linux/platform_data/exynos_thermal.h b/include/linux/platform_data/exynos_thermal.h index a7bdb2f63b73..da7e6274b175 100644 --- a/include/linux/platform_data/exynos_thermal.h +++ b/include/linux/platform_data/exynos_thermal.h | |||
| @@ -53,6 +53,8 @@ struct freq_clip_table { | |||
| 53 | * struct exynos_tmu_platform_data | 53 | * struct exynos_tmu_platform_data |
| 54 | * @threshold: basic temperature for generating interrupt | 54 | * @threshold: basic temperature for generating interrupt |
| 55 | * 25 <= threshold <= 125 [unit: degree Celsius] | 55 | * 25 <= threshold <= 125 [unit: degree Celsius] |
| 56 | * @threshold_falling: differntial value for setting threshold | ||
| 57 | * of temperature falling interrupt. | ||
| 56 | * @trigger_levels: array for each interrupt levels | 58 | * @trigger_levels: array for each interrupt levels |
| 57 | * [unit: degree Celsius] | 59 | * [unit: degree Celsius] |
| 58 | * 0: temperature for trigger_level0 interrupt | 60 | * 0: temperature for trigger_level0 interrupt |
| @@ -97,6 +99,7 @@ struct freq_clip_table { | |||
| 97 | */ | 99 | */ |
| 98 | struct exynos_tmu_platform_data { | 100 | struct exynos_tmu_platform_data { |
| 99 | u8 threshold; | 101 | u8 threshold; |
| 102 | u8 threshold_falling; | ||
| 100 | u8 trigger_levels[4]; | 103 | u8 trigger_levels[4]; |
| 101 | bool trigger_level0_en; | 104 | bool trigger_level0_en; |
| 102 | bool trigger_level1_en; | 105 | bool trigger_level1_en; |
diff --git a/include/linux/platform_data/leds-lp55xx.h b/include/linux/platform_data/leds-lp55xx.h new file mode 100644 index 000000000000..1509570d5a3f --- /dev/null +++ b/include/linux/platform_data/leds-lp55xx.h | |||
| @@ -0,0 +1,87 @@ | |||
| 1 | /* | ||
| 2 | * LP55XX Platform Data Header | ||
| 3 | * | ||
| 4 | * Copyright (C) 2012 Texas Instruments | ||
| 5 | * | ||
| 6 | * Author: Milo(Woogyom) Kim <milo.kim@ti.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or | ||
| 9 | * modify it under the terms of the GNU General Public License | ||
| 10 | * version 2 as published by the Free Software Foundation. | ||
| 11 | * | ||
| 12 | * Derived from leds-lp5521.h, leds-lp5523.h | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef _LEDS_LP55XX_H | ||
| 16 | #define _LEDS_LP55XX_H | ||
| 17 | |||
| 18 | /* Clock configuration */ | ||
| 19 | #define LP55XX_CLOCK_AUTO 0 | ||
| 20 | #define LP55XX_CLOCK_INT 1 | ||
| 21 | #define LP55XX_CLOCK_EXT 2 | ||
| 22 | |||
| 23 | /* Bits in LP5521 CONFIG register. 'update_config' in lp55xx_platform_data */ | ||
| 24 | #define LP5521_PWM_HF 0x40 /* PWM: 0 = 256Hz, 1 = 558Hz */ | ||
| 25 | #define LP5521_PWRSAVE_EN 0x20 /* 1 = Power save mode */ | ||
| 26 | #define LP5521_CP_MODE_OFF 0 /* Charge pump (CP) off */ | ||
| 27 | #define LP5521_CP_MODE_BYPASS 8 /* CP forced to bypass mode */ | ||
| 28 | #define LP5521_CP_MODE_1X5 0x10 /* CP forced to 1.5x mode */ | ||
| 29 | #define LP5521_CP_MODE_AUTO 0x18 /* Automatic mode selection */ | ||
| 30 | #define LP5521_R_TO_BATT 4 /* R out: 0 = CP, 1 = Vbat */ | ||
| 31 | #define LP5521_CLK_SRC_EXT 0 /* Ext-clk source (CLK_32K) */ | ||
| 32 | #define LP5521_CLK_INT 1 /* Internal clock */ | ||
| 33 | #define LP5521_CLK_AUTO 2 /* Automatic clock selection */ | ||
| 34 | |||
| 35 | struct lp55xx_led_config { | ||
| 36 | const char *name; | ||
| 37 | u8 chan_nr; | ||
| 38 | u8 led_current; /* mA x10, 0 if led is not connected */ | ||
| 39 | u8 max_current; | ||
| 40 | }; | ||
| 41 | |||
| 42 | struct lp55xx_predef_pattern { | ||
| 43 | u8 *r; | ||
| 44 | u8 *g; | ||
| 45 | u8 *b; | ||
| 46 | u8 size_r; | ||
| 47 | u8 size_g; | ||
| 48 | u8 size_b; | ||
| 49 | }; | ||
| 50 | |||
| 51 | /* | ||
| 52 | * struct lp55xx_platform_data | ||
| 53 | * @led_config : Configurable led class device | ||
| 54 | * @num_channels : Number of LED channels | ||
| 55 | * @label : Used for naming LEDs | ||
| 56 | * @clock_mode : Input clock mode. LP55XX_CLOCK_AUTO or _INT or _EXT | ||
| 57 | * @setup_resources : Platform specific function before enabling the chip | ||
| 58 | * @release_resources : Platform specific function after disabling the chip | ||
| 59 | * @enable : EN pin control by platform side | ||
| 60 | * @patterns : Predefined pattern data for RGB channels | ||
| 61 | * @num_patterns : Number of patterns | ||
| 62 | * @update_config : Value of CONFIG register | ||
| 63 | */ | ||
| 64 | struct lp55xx_platform_data { | ||
| 65 | |||
| 66 | /* LED channel configuration */ | ||
| 67 | struct lp55xx_led_config *led_config; | ||
| 68 | u8 num_channels; | ||
| 69 | const char *label; | ||
| 70 | |||
| 71 | /* Clock configuration */ | ||
| 72 | u8 clock_mode; | ||
| 73 | |||
| 74 | /* Platform specific functions */ | ||
| 75 | int (*setup_resources)(void); | ||
| 76 | void (*release_resources)(void); | ||
| 77 | void (*enable)(bool state); | ||
| 78 | |||
| 79 | /* Predefined pattern data */ | ||
| 80 | struct lp55xx_predef_pattern *patterns; | ||
| 81 | unsigned int num_patterns; | ||
| 82 | |||
| 83 | /* _CONFIG register */ | ||
| 84 | u8 update_config; | ||
| 85 | }; | ||
| 86 | |||
| 87 | #endif /* _LEDS_LP55XX_H */ | ||
diff --git a/include/linux/platform_data/mmc-esdhc-imx.h b/include/linux/platform_data/mmc-esdhc-imx.h index aaf97481f413..b4a0521ce411 100644 --- a/include/linux/platform_data/mmc-esdhc-imx.h +++ b/include/linux/platform_data/mmc-esdhc-imx.h | |||
| @@ -39,5 +39,6 @@ struct esdhc_platform_data { | |||
| 39 | unsigned int cd_gpio; | 39 | unsigned int cd_gpio; |
| 40 | enum wp_types wp_type; | 40 | enum wp_types wp_type; |
| 41 | enum cd_types cd_type; | 41 | enum cd_types cd_type; |
| 42 | int max_bus_width; | ||
| 42 | }; | 43 | }; |
| 43 | #endif /* __ASM_ARCH_IMX_ESDHC_H */ | 44 | #endif /* __ASM_ARCH_IMX_ESDHC_H */ |
diff --git a/include/linux/platform_data/mmc-sdhci-tegra.h b/include/linux/platform_data/mmc-sdhci-tegra.h deleted file mode 100644 index 8f8430697686..000000000000 --- a/include/linux/platform_data/mmc-sdhci-tegra.h +++ /dev/null | |||
| @@ -1,28 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2009 Palm, Inc. | ||
| 3 | * Author: Yvonne Yip <y@palm.com> | ||
| 4 | * | ||
| 5 | * This software is licensed under the terms of the GNU General Public | ||
| 6 | * License version 2, as published by the Free Software Foundation, and | ||
| 7 | * may be copied, distributed, and modified under those terms. | ||
| 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 | */ | ||
| 15 | #ifndef __PLATFORM_DATA_TEGRA_SDHCI_H | ||
| 16 | #define __PLATFORM_DATA_TEGRA_SDHCI_H | ||
| 17 | |||
| 18 | #include <linux/mmc/host.h> | ||
| 19 | |||
| 20 | struct tegra_sdhci_platform_data { | ||
| 21 | int cd_gpio; | ||
| 22 | int wp_gpio; | ||
| 23 | int power_gpio; | ||
| 24 | int is_8bit; | ||
| 25 | int pm_flags; | ||
| 26 | }; | ||
| 27 | |||
| 28 | #endif | ||
diff --git a/include/linux/platform_data/sh_ipmmu.h b/include/linux/platform_data/sh_ipmmu.h new file mode 100644 index 000000000000..39f7405cdac5 --- /dev/null +++ b/include/linux/platform_data/sh_ipmmu.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | /* sh_ipmmu.h | ||
| 2 | * | ||
| 3 | * Copyright (C) 2012 Hideki EIRAKU | ||
| 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 as published by | ||
| 7 | * the Free Software Foundation; version 2 of the License. | ||
| 8 | */ | ||
| 9 | |||
| 10 | #ifndef __SH_IPMMU_H__ | ||
| 11 | #define __SH_IPMMU_H__ | ||
| 12 | |||
| 13 | struct shmobile_ipmmu_platform_data { | ||
| 14 | const char * const *dev_names; | ||
| 15 | unsigned int num_dev_names; | ||
| 16 | }; | ||
| 17 | |||
| 18 | #endif /* __SH_IPMMU_H__ */ | ||
diff --git a/include/linux/platform_data/usb-omap.h b/include/linux/platform_data/usb-omap.h index e697c85ad3bc..fa579b4c666b 100644 --- a/include/linux/platform_data/usb-omap.h +++ b/include/linux/platform_data/usb-omap.h | |||
| @@ -55,6 +55,7 @@ struct ohci_hcd_omap_platform_data { | |||
| 55 | }; | 55 | }; |
| 56 | 56 | ||
| 57 | struct usbhs_omap_platform_data { | 57 | struct usbhs_omap_platform_data { |
| 58 | int nports; | ||
| 58 | enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS]; | 59 | enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS]; |
| 59 | int reset_gpio_port[OMAP3_HS_USB_PORTS]; | 60 | int reset_gpio_port[OMAP3_HS_USB_PORTS]; |
| 60 | struct regulator *regulator[OMAP3_HS_USB_PORTS]; | 61 | struct regulator *regulator[OMAP3_HS_USB_PORTS]; |
diff --git a/include/linux/platform_data/ux500_wdt.h b/include/linux/platform_data/ux500_wdt.h new file mode 100644 index 000000000000..1689ff4c3bfd --- /dev/null +++ b/include/linux/platform_data/ux500_wdt.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) ST Ericsson SA 2011 | ||
| 3 | * | ||
| 4 | * License Terms: GNU General Public License v2 | ||
| 5 | * | ||
| 6 | * STE Ux500 Watchdog platform data | ||
| 7 | */ | ||
| 8 | #ifndef __UX500_WDT_H | ||
| 9 | #define __UX500_WDT_H | ||
| 10 | |||
| 11 | /** | ||
| 12 | * struct ux500_wdt_data | ||
| 13 | */ | ||
| 14 | struct ux500_wdt_data { | ||
| 15 | unsigned int timeout; | ||
| 16 | bool has_28_bits_resolution; | ||
| 17 | }; | ||
| 18 | |||
| 19 | #endif /* __UX500_WDT_H */ | ||
diff --git a/include/linux/pm.h b/include/linux/pm.h index 97bcf23e045a..e5d7230332a4 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
| @@ -537,6 +537,7 @@ struct dev_pm_info { | |||
| 537 | unsigned int irq_safe:1; | 537 | unsigned int irq_safe:1; |
| 538 | unsigned int use_autosuspend:1; | 538 | unsigned int use_autosuspend:1; |
| 539 | unsigned int timer_autosuspends:1; | 539 | unsigned int timer_autosuspends:1; |
| 540 | unsigned int memalloc_noio:1; | ||
| 540 | enum rpm_request request; | 541 | enum rpm_request request; |
| 541 | enum rpm_status runtime_status; | 542 | enum rpm_status runtime_status; |
| 542 | int runtime_error; | 543 | int runtime_error; |
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index c785c215abfc..7d7e09efff9b 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
| @@ -47,6 +47,7 @@ extern void pm_runtime_set_autosuspend_delay(struct device *dev, int delay); | |||
| 47 | extern unsigned long pm_runtime_autosuspend_expiration(struct device *dev); | 47 | extern unsigned long pm_runtime_autosuspend_expiration(struct device *dev); |
| 48 | extern void pm_runtime_update_max_time_suspended(struct device *dev, | 48 | extern void pm_runtime_update_max_time_suspended(struct device *dev, |
| 49 | s64 delta_ns); | 49 | s64 delta_ns); |
| 50 | extern void pm_runtime_set_memalloc_noio(struct device *dev, bool enable); | ||
| 50 | 51 | ||
| 51 | static inline bool pm_children_suspended(struct device *dev) | 52 | static inline bool pm_children_suspended(struct device *dev) |
| 52 | { | 53 | { |
| @@ -156,6 +157,8 @@ static inline void pm_runtime_set_autosuspend_delay(struct device *dev, | |||
| 156 | int delay) {} | 157 | int delay) {} |
| 157 | static inline unsigned long pm_runtime_autosuspend_expiration( | 158 | static inline unsigned long pm_runtime_autosuspend_expiration( |
| 158 | struct device *dev) { return 0; } | 159 | struct device *dev) { return 0; } |
| 160 | static inline void pm_runtime_set_memalloc_noio(struct device *dev, | ||
| 161 | bool enable){} | ||
| 159 | 162 | ||
| 160 | #endif /* !CONFIG_PM_RUNTIME */ | 163 | #endif /* !CONFIG_PM_RUNTIME */ |
| 161 | 164 | ||
diff --git a/include/linux/pwm.h b/include/linux/pwm.h index 6d661f32e0e4..a4df2042b79c 100644 --- a/include/linux/pwm.h +++ b/include/linux/pwm.h | |||
| @@ -146,6 +146,8 @@ struct pwm_ops { | |||
| 146 | * @base: number of first PWM controlled by this chip | 146 | * @base: number of first PWM controlled by this chip |
| 147 | * @npwm: number of PWMs controlled by this chip | 147 | * @npwm: number of PWMs controlled by this chip |
| 148 | * @pwms: array of PWM devices allocated by the framework | 148 | * @pwms: array of PWM devices allocated by the framework |
| 149 | * @can_sleep: must be true if the .config(), .enable() or .disable() | ||
| 150 | * operations may sleep | ||
| 149 | */ | 151 | */ |
| 150 | struct pwm_chip { | 152 | struct pwm_chip { |
| 151 | struct device *dev; | 153 | struct device *dev; |
| @@ -159,6 +161,7 @@ struct pwm_chip { | |||
| 159 | struct pwm_device * (*of_xlate)(struct pwm_chip *pc, | 161 | struct pwm_device * (*of_xlate)(struct pwm_chip *pc, |
| 160 | const struct of_phandle_args *args); | 162 | const struct of_phandle_args *args); |
| 161 | unsigned int of_pwm_n_cells; | 163 | unsigned int of_pwm_n_cells; |
| 164 | bool can_sleep; | ||
| 162 | }; | 165 | }; |
| 163 | 166 | ||
| 164 | #if IS_ENABLED(CONFIG_PWM) | 167 | #if IS_ENABLED(CONFIG_PWM) |
| @@ -174,11 +177,16 @@ struct pwm_device *pwm_request_from_chip(struct pwm_chip *chip, | |||
| 174 | struct pwm_device *of_pwm_xlate_with_flags(struct pwm_chip *pc, | 177 | struct pwm_device *of_pwm_xlate_with_flags(struct pwm_chip *pc, |
| 175 | const struct of_phandle_args *args); | 178 | const struct of_phandle_args *args); |
| 176 | 179 | ||
| 177 | struct pwm_device *pwm_get(struct device *dev, const char *consumer); | 180 | struct pwm_device *pwm_get(struct device *dev, const char *con_id); |
| 181 | struct pwm_device *of_pwm_get(struct device_node *np, const char *con_id); | ||
| 178 | void pwm_put(struct pwm_device *pwm); | 182 | void pwm_put(struct pwm_device *pwm); |
| 179 | 183 | ||
| 180 | struct pwm_device *devm_pwm_get(struct device *dev, const char *consumer); | 184 | struct pwm_device *devm_pwm_get(struct device *dev, const char *con_id); |
| 185 | struct pwm_device *devm_of_pwm_get(struct device *dev, struct device_node *np, | ||
| 186 | const char *con_id); | ||
| 181 | void devm_pwm_put(struct device *dev, struct pwm_device *pwm); | 187 | void devm_pwm_put(struct device *dev, struct pwm_device *pwm); |
| 188 | |||
| 189 | bool pwm_can_sleep(struct pwm_device *pwm); | ||
| 182 | #else | 190 | #else |
| 183 | static inline int pwm_set_chip_data(struct pwm_device *pwm, void *data) | 191 | static inline int pwm_set_chip_data(struct pwm_device *pwm, void *data) |
| 184 | { | 192 | { |
| @@ -213,6 +221,12 @@ static inline struct pwm_device *pwm_get(struct device *dev, | |||
| 213 | return ERR_PTR(-ENODEV); | 221 | return ERR_PTR(-ENODEV); |
| 214 | } | 222 | } |
| 215 | 223 | ||
| 224 | static inline struct pwm_device *of_pwm_get(struct device_node *np, | ||
| 225 | const char *con_id) | ||
| 226 | { | ||
| 227 | return ERR_PTR(-ENODEV); | ||
| 228 | } | ||
| 229 | |||
| 216 | static inline void pwm_put(struct pwm_device *pwm) | 230 | static inline void pwm_put(struct pwm_device *pwm) |
| 217 | { | 231 | { |
| 218 | } | 232 | } |
| @@ -223,9 +237,21 @@ static inline struct pwm_device *devm_pwm_get(struct device *dev, | |||
| 223 | return ERR_PTR(-ENODEV); | 237 | return ERR_PTR(-ENODEV); |
| 224 | } | 238 | } |
| 225 | 239 | ||
| 240 | static inline struct pwm_device *devm_of_pwm_get(struct device *dev, | ||
| 241 | struct device_node *np, | ||
| 242 | const char *con_id) | ||
| 243 | { | ||
| 244 | return ERR_PTR(-ENODEV); | ||
| 245 | } | ||
| 246 | |||
| 226 | static inline void devm_pwm_put(struct device *dev, struct pwm_device *pwm) | 247 | static inline void devm_pwm_put(struct device *dev, struct pwm_device *pwm) |
| 227 | { | 248 | { |
| 228 | } | 249 | } |
| 250 | |||
| 251 | static inline bool pwm_can_sleep(struct pwm_device *pwm) | ||
| 252 | { | ||
| 253 | return false; | ||
| 254 | } | ||
| 229 | #endif | 255 | #endif |
| 230 | 256 | ||
| 231 | struct pwm_lookup { | 257 | struct pwm_lookup { |
diff --git a/include/linux/quota.h b/include/linux/quota.h index 58fdef125252..d13371134c59 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
| @@ -405,6 +405,7 @@ struct quota_module_name { | |||
| 405 | #define INIT_QUOTA_MODULE_NAMES {\ | 405 | #define INIT_QUOTA_MODULE_NAMES {\ |
| 406 | {QFMT_VFS_OLD, "quota_v1"},\ | 406 | {QFMT_VFS_OLD, "quota_v1"},\ |
| 407 | {QFMT_VFS_V0, "quota_v2"},\ | 407 | {QFMT_VFS_V0, "quota_v2"},\ |
| 408 | {QFMT_VFS_V1, "quota_v2"},\ | ||
| 408 | {0, NULL}} | 409 | {0, NULL}} |
| 409 | 410 | ||
| 410 | #endif /* _QUOTA_ */ | 411 | #endif /* _QUOTA_ */ |
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index c92dd28eaa6c..8089e35d47ac 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
| @@ -445,8 +445,7 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
| 445 | 445 | ||
| 446 | /** | 446 | /** |
| 447 | * hlist_for_each_entry_rcu - iterate over rcu list of given type | 447 | * hlist_for_each_entry_rcu - iterate over rcu list of given type |
| 448 | * @tpos: the type * to use as a loop cursor. | 448 | * @pos: the type * to use as a loop cursor. |
| 449 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
| 450 | * @head: the head for your list. | 449 | * @head: the head for your list. |
| 451 | * @member: the name of the hlist_node within the struct. | 450 | * @member: the name of the hlist_node within the struct. |
| 452 | * | 451 | * |
| @@ -454,16 +453,16 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
| 454 | * the _rcu list-mutation primitives such as hlist_add_head_rcu() | 453 | * the _rcu list-mutation primitives such as hlist_add_head_rcu() |
| 455 | * as long as the traversal is guarded by rcu_read_lock(). | 454 | * as long as the traversal is guarded by rcu_read_lock(). |
| 456 | */ | 455 | */ |
| 457 | #define hlist_for_each_entry_rcu(tpos, pos, head, member) \ | 456 | #define hlist_for_each_entry_rcu(pos, head, member) \ |
| 458 | for (pos = rcu_dereference_raw(hlist_first_rcu(head)); \ | 457 | for (pos = hlist_entry_safe (rcu_dereference_raw(hlist_first_rcu(head)),\ |
| 459 | pos && \ | 458 | typeof(*(pos)), member); \ |
| 460 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ | 459 | pos; \ |
| 461 | pos = rcu_dereference_raw(hlist_next_rcu(pos))) | 460 | pos = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu(\ |
| 461 | &(pos)->member)), typeof(*(pos)), member)) | ||
| 462 | 462 | ||
| 463 | /** | 463 | /** |
| 464 | * hlist_for_each_entry_rcu_bh - iterate over rcu list of given type | 464 | * hlist_for_each_entry_rcu_bh - iterate over rcu list of given type |
| 465 | * @tpos: the type * to use as a loop cursor. | 465 | * @pos: the type * to use as a loop cursor. |
| 466 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
| 467 | * @head: the head for your list. | 466 | * @head: the head for your list. |
| 468 | * @member: the name of the hlist_node within the struct. | 467 | * @member: the name of the hlist_node within the struct. |
| 469 | * | 468 | * |
| @@ -471,35 +470,36 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
| 471 | * the _rcu list-mutation primitives such as hlist_add_head_rcu() | 470 | * the _rcu list-mutation primitives such as hlist_add_head_rcu() |
| 472 | * as long as the traversal is guarded by rcu_read_lock(). | 471 | * as long as the traversal is guarded by rcu_read_lock(). |
| 473 | */ | 472 | */ |
| 474 | #define hlist_for_each_entry_rcu_bh(tpos, pos, head, member) \ | 473 | #define hlist_for_each_entry_rcu_bh(pos, head, member) \ |
| 475 | for (pos = rcu_dereference_bh((head)->first); \ | 474 | for (pos = hlist_entry_safe(rcu_dereference_bh(hlist_first_rcu(head)),\ |
| 476 | pos && \ | 475 | typeof(*(pos)), member); \ |
| 477 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ | 476 | pos; \ |
| 478 | pos = rcu_dereference_bh(pos->next)) | 477 | pos = hlist_entry_safe(rcu_dereference_bh(hlist_next_rcu(\ |
| 478 | &(pos)->member)), typeof(*(pos)), member)) | ||
| 479 | 479 | ||
| 480 | /** | 480 | /** |
| 481 | * hlist_for_each_entry_continue_rcu - iterate over a hlist continuing after current point | 481 | * hlist_for_each_entry_continue_rcu - iterate over a hlist continuing after current point |
| 482 | * @tpos: the type * to use as a loop cursor. | 482 | * @pos: the type * to use as a loop cursor. |
| 483 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
| 484 | * @member: the name of the hlist_node within the struct. | 483 | * @member: the name of the hlist_node within the struct. |
| 485 | */ | 484 | */ |
| 486 | #define hlist_for_each_entry_continue_rcu(tpos, pos, member) \ | 485 | #define hlist_for_each_entry_continue_rcu(pos, member) \ |
| 487 | for (pos = rcu_dereference((pos)->next); \ | 486 | for (pos = hlist_entry_safe(rcu_dereference((pos)->member.next),\ |
| 488 | pos && \ | 487 | typeof(*(pos)), member); \ |
| 489 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ | 488 | pos; \ |
| 490 | pos = rcu_dereference(pos->next)) | 489 | pos = hlist_entry_safe(rcu_dereference((pos)->member.next),\ |
| 490 | typeof(*(pos)), member)) | ||
| 491 | 491 | ||
| 492 | /** | 492 | /** |
| 493 | * hlist_for_each_entry_continue_rcu_bh - iterate over a hlist continuing after current point | 493 | * hlist_for_each_entry_continue_rcu_bh - iterate over a hlist continuing after current point |
| 494 | * @tpos: the type * to use as a loop cursor. | 494 | * @pos: the type * to use as a loop cursor. |
| 495 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
| 496 | * @member: the name of the hlist_node within the struct. | 495 | * @member: the name of the hlist_node within the struct. |
| 497 | */ | 496 | */ |
| 498 | #define hlist_for_each_entry_continue_rcu_bh(tpos, pos, member) \ | 497 | #define hlist_for_each_entry_continue_rcu_bh(pos, member) \ |
| 499 | for (pos = rcu_dereference_bh((pos)->next); \ | 498 | for (pos = hlist_entry_safe(rcu_dereference_bh((pos)->member.next),\ |
| 500 | pos && \ | 499 | typeof(*(pos)), member); \ |
| 501 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ | 500 | pos; \ |
| 502 | pos = rcu_dereference_bh(pos->next)) | 501 | pos = hlist_entry_safe(rcu_dereference_bh((pos)->member.next),\ |
| 502 | typeof(*(pos)), member)) | ||
| 503 | 503 | ||
| 504 | 504 | ||
| 505 | #endif /* __KERNEL__ */ | 505 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index 23070fd83872..7df93f52db08 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
| @@ -199,6 +199,8 @@ enum regulator_type { | |||
| 199 | * output when using regulator_set_voltage_sel_regmap | 199 | * output when using regulator_set_voltage_sel_regmap |
| 200 | * @enable_reg: Register for control when using regmap enable/disable ops | 200 | * @enable_reg: Register for control when using regmap enable/disable ops |
| 201 | * @enable_mask: Mask for control when using regmap enable/disable ops | 201 | * @enable_mask: Mask for control when using regmap enable/disable ops |
| 202 | * @bypass_reg: Register for control when using regmap set_bypass | ||
| 203 | * @bypass_mask: Mask for control when using regmap set_bypass | ||
| 202 | * | 204 | * |
| 203 | * @enable_time: Time taken for initial enable of regulator (in uS). | 205 | * @enable_time: Time taken for initial enable of regulator (in uS). |
| 204 | */ | 206 | */ |
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index c20635c527a9..6dacb93a6d94 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
| @@ -123,7 +123,7 @@ static inline void anon_vma_lock_write(struct anon_vma *anon_vma) | |||
| 123 | down_write(&anon_vma->root->rwsem); | 123 | down_write(&anon_vma->root->rwsem); |
| 124 | } | 124 | } |
| 125 | 125 | ||
| 126 | static inline void anon_vma_unlock(struct anon_vma *anon_vma) | 126 | static inline void anon_vma_unlock_write(struct anon_vma *anon_vma) |
| 127 | { | 127 | { |
| 128 | up_write(&anon_vma->root->rwsem); | 128 | up_write(&anon_vma->root->rwsem); |
| 129 | } | 129 | } |
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index 4bd6c06eb28e..2d8bdaef9611 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h | |||
| @@ -231,6 +231,41 @@ size_t sg_copy_to_buffer(struct scatterlist *sgl, unsigned int nents, | |||
| 231 | */ | 231 | */ |
| 232 | #define SG_MAX_SINGLE_ALLOC (PAGE_SIZE / sizeof(struct scatterlist)) | 232 | #define SG_MAX_SINGLE_ALLOC (PAGE_SIZE / sizeof(struct scatterlist)) |
| 233 | 233 | ||
| 234 | /* | ||
| 235 | * sg page iterator | ||
| 236 | * | ||
| 237 | * Iterates over sg entries page-by-page. On each successful iteration, | ||
| 238 | * @piter->page points to the current page, @piter->sg to the sg holding this | ||
| 239 | * page and @piter->sg_pgoffset to the page's page offset within the sg. The | ||
| 240 | * iteration will stop either when a maximum number of sg entries was reached | ||
| 241 | * or a terminating sg (sg_last(sg) == true) was reached. | ||
| 242 | */ | ||
| 243 | struct sg_page_iter { | ||
| 244 | struct page *page; /* current page */ | ||
| 245 | struct scatterlist *sg; /* sg holding the page */ | ||
| 246 | unsigned int sg_pgoffset; /* page offset within the sg */ | ||
| 247 | |||
| 248 | /* these are internal states, keep away */ | ||
| 249 | unsigned int __nents; /* remaining sg entries */ | ||
| 250 | int __pg_advance; /* nr pages to advance at the | ||
| 251 | * next step */ | ||
| 252 | }; | ||
| 253 | |||
| 254 | bool __sg_page_iter_next(struct sg_page_iter *piter); | ||
| 255 | void __sg_page_iter_start(struct sg_page_iter *piter, | ||
| 256 | struct scatterlist *sglist, unsigned int nents, | ||
| 257 | unsigned long pgoffset); | ||
| 258 | |||
| 259 | /** | ||
| 260 | * for_each_sg_page - iterate over the pages of the given sg list | ||
| 261 | * @sglist: sglist to iterate over | ||
| 262 | * @piter: page iterator to hold current page, sg, sg_pgoffset | ||
| 263 | * @nents: maximum number of sg entries to iterate over | ||
| 264 | * @pgoffset: starting page offset | ||
| 265 | */ | ||
| 266 | #define for_each_sg_page(sglist, piter, nents, pgoffset) \ | ||
| 267 | for (__sg_page_iter_start((piter), (sglist), (nents), (pgoffset)); \ | ||
| 268 | __sg_page_iter_next(piter);) | ||
| 234 | 269 | ||
| 235 | /* | 270 | /* |
| 236 | * Mapping sg iterator | 271 | * Mapping sg iterator |
| @@ -258,11 +293,11 @@ struct sg_mapping_iter { | |||
| 258 | void *addr; /* pointer to the mapped area */ | 293 | void *addr; /* pointer to the mapped area */ |
| 259 | size_t length; /* length of the mapped area */ | 294 | size_t length; /* length of the mapped area */ |
| 260 | size_t consumed; /* number of consumed bytes */ | 295 | size_t consumed; /* number of consumed bytes */ |
| 296 | struct sg_page_iter piter; /* page iterator */ | ||
| 261 | 297 | ||
| 262 | /* these are internal states, keep away */ | 298 | /* these are internal states, keep away */ |
| 263 | struct scatterlist *__sg; /* current entry */ | 299 | unsigned int __offset; /* offset within page */ |
| 264 | unsigned int __nents; /* nr of remaining entries */ | 300 | unsigned int __remaining; /* remaining bytes on page */ |
| 265 | unsigned int __offset; /* offset within sg */ | ||
| 266 | unsigned int __flags; | 301 | unsigned int __flags; |
| 267 | }; | 302 | }; |
| 268 | 303 | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index e4112aad2964..d35d2b6ddbfb 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -51,6 +51,7 @@ struct sched_param { | |||
| 51 | #include <linux/cred.h> | 51 | #include <linux/cred.h> |
| 52 | #include <linux/llist.h> | 52 | #include <linux/llist.h> |
| 53 | #include <linux/uidgid.h> | 53 | #include <linux/uidgid.h> |
| 54 | #include <linux/gfp.h> | ||
| 54 | 55 | ||
| 55 | #include <asm/processor.h> | 56 | #include <asm/processor.h> |
| 56 | 57 | ||
| @@ -98,7 +99,6 @@ extern int nr_threads; | |||
| 98 | DECLARE_PER_CPU(unsigned long, process_counts); | 99 | DECLARE_PER_CPU(unsigned long, process_counts); |
| 99 | extern int nr_processes(void); | 100 | extern int nr_processes(void); |
| 100 | extern unsigned long nr_running(void); | 101 | extern unsigned long nr_running(void); |
| 101 | extern unsigned long nr_uninterruptible(void); | ||
| 102 | extern unsigned long nr_iowait(void); | 102 | extern unsigned long nr_iowait(void); |
| 103 | extern unsigned long nr_iowait_cpu(int cpu); | 103 | extern unsigned long nr_iowait_cpu(int cpu); |
| 104 | extern unsigned long this_cpu_load(void); | 104 | extern unsigned long this_cpu_load(void); |
| @@ -346,11 +346,6 @@ static inline void arch_pick_mmap_layout(struct mm_struct *mm) {} | |||
| 346 | extern void set_dumpable(struct mm_struct *mm, int value); | 346 | extern void set_dumpable(struct mm_struct *mm, int value); |
| 347 | extern int get_dumpable(struct mm_struct *mm); | 347 | extern int get_dumpable(struct mm_struct *mm); |
| 348 | 348 | ||
| 349 | /* get/set_dumpable() values */ | ||
| 350 | #define SUID_DUMPABLE_DISABLED 0 | ||
| 351 | #define SUID_DUMPABLE_ENABLED 1 | ||
| 352 | #define SUID_DUMPABLE_SAFE 2 | ||
| 353 | |||
| 354 | /* mm flags */ | 349 | /* mm flags */ |
| 355 | /* dumpable bits */ | 350 | /* dumpable bits */ |
| 356 | #define MMF_DUMPABLE 0 /* core dump is permitted */ | 351 | #define MMF_DUMPABLE 0 /* core dump is permitted */ |
| @@ -1791,6 +1786,7 @@ extern void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut, | |||
| 1791 | #define PF_FROZEN 0x00010000 /* frozen for system suspend */ | 1786 | #define PF_FROZEN 0x00010000 /* frozen for system suspend */ |
| 1792 | #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ | 1787 | #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ |
| 1793 | #define PF_KSWAPD 0x00040000 /* I am kswapd */ | 1788 | #define PF_KSWAPD 0x00040000 /* I am kswapd */ |
| 1789 | #define PF_MEMALLOC_NOIO 0x00080000 /* Allocating memory without IO involved */ | ||
| 1794 | #define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ | 1790 | #define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ |
| 1795 | #define PF_KTHREAD 0x00200000 /* I am a kernel thread */ | 1791 | #define PF_KTHREAD 0x00200000 /* I am a kernel thread */ |
| 1796 | #define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */ | 1792 | #define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */ |
| @@ -1828,6 +1824,26 @@ extern void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut, | |||
| 1828 | #define tsk_used_math(p) ((p)->flags & PF_USED_MATH) | 1824 | #define tsk_used_math(p) ((p)->flags & PF_USED_MATH) |
| 1829 | #define used_math() tsk_used_math(current) | 1825 | #define used_math() tsk_used_math(current) |
| 1830 | 1826 | ||
| 1827 | /* __GFP_IO isn't allowed if PF_MEMALLOC_NOIO is set in current->flags */ | ||
| 1828 | static inline gfp_t memalloc_noio_flags(gfp_t flags) | ||
| 1829 | { | ||
| 1830 | if (unlikely(current->flags & PF_MEMALLOC_NOIO)) | ||
| 1831 | flags &= ~__GFP_IO; | ||
| 1832 | return flags; | ||
| 1833 | } | ||
| 1834 | |||
| 1835 | static inline unsigned int memalloc_noio_save(void) | ||
| 1836 | { | ||
| 1837 | unsigned int flags = current->flags & PF_MEMALLOC_NOIO; | ||
| 1838 | current->flags |= PF_MEMALLOC_NOIO; | ||
| 1839 | return flags; | ||
| 1840 | } | ||
| 1841 | |||
| 1842 | static inline void memalloc_noio_restore(unsigned int flags) | ||
| 1843 | { | ||
| 1844 | current->flags = (current->flags & ~PF_MEMALLOC_NOIO) | flags; | ||
| 1845 | } | ||
| 1846 | |||
| 1831 | /* | 1847 | /* |
| 1832 | * task->jobctl flags | 1848 | * task->jobctl flags |
| 1833 | */ | 1849 | */ |
| @@ -2160,7 +2176,6 @@ extern struct sigqueue *sigqueue_alloc(void); | |||
| 2160 | extern void sigqueue_free(struct sigqueue *); | 2176 | extern void sigqueue_free(struct sigqueue *); |
| 2161 | extern int send_sigqueue(struct sigqueue *, struct task_struct *, int group); | 2177 | extern int send_sigqueue(struct sigqueue *, struct task_struct *, int group); |
| 2162 | extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *); | 2178 | extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *); |
| 2163 | extern int do_sigaltstack(const stack_t __user *, stack_t __user *, unsigned long); | ||
| 2164 | 2179 | ||
| 2165 | static inline void restore_saved_sigmask(void) | 2180 | static inline void restore_saved_sigmask(void) |
| 2166 | { | 2181 | { |
| @@ -2206,6 +2221,17 @@ static inline int sas_ss_flags(unsigned long sp) | |||
| 2206 | : on_sig_stack(sp) ? SS_ONSTACK : 0); | 2221 | : on_sig_stack(sp) ? SS_ONSTACK : 0); |
| 2207 | } | 2222 | } |
| 2208 | 2223 | ||
| 2224 | static inline unsigned long sigsp(unsigned long sp, struct ksignal *ksig) | ||
| 2225 | { | ||
| 2226 | if (unlikely((ksig->ka.sa.sa_flags & SA_ONSTACK)) && ! sas_ss_flags(sp)) | ||
| 2227 | #ifdef CONFIG_STACK_GROWSUP | ||
| 2228 | return current->sas_ss_sp; | ||
| 2229 | #else | ||
| 2230 | return current->sas_ss_sp + current->sas_ss_size; | ||
| 2231 | #endif | ||
| 2232 | return sp; | ||
| 2233 | } | ||
| 2234 | |||
| 2209 | /* | 2235 | /* |
| 2210 | * Routines for handling mm_structs | 2236 | * Routines for handling mm_structs |
| 2211 | */ | 2237 | */ |
diff --git a/include/linux/sched/rt.h b/include/linux/sched/rt.h index 94e19ea28fc3..440434df3627 100644 --- a/include/linux/sched/rt.h +++ b/include/linux/sched/rt.h | |||
| @@ -55,4 +55,10 @@ static inline bool tsk_is_pi_blocked(struct task_struct *tsk) | |||
| 55 | extern void normalize_rt_tasks(void); | 55 | extern void normalize_rt_tasks(void); |
| 56 | 56 | ||
| 57 | 57 | ||
| 58 | /* | ||
| 59 | * default timeslice is 100 msecs (used only for SCHED_RR tasks). | ||
| 60 | * Timeslices get refilled after they expire. | ||
| 61 | */ | ||
| 62 | #define RR_TIMESLICE (100 * HZ / 1000) | ||
| 63 | |||
| 58 | #endif /* _SCHED_RT_H */ | 64 | #endif /* _SCHED_RT_H */ |
diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h index d2bb0ae979d0..bf8086b2506e 100644 --- a/include/linux/sched/sysctl.h +++ b/include/linux/sched/sysctl.h | |||
| @@ -91,12 +91,6 @@ extern unsigned int sysctl_sched_cfs_bandwidth_slice; | |||
| 91 | extern unsigned int sysctl_sched_autogroup_enabled; | 91 | extern unsigned int sysctl_sched_autogroup_enabled; |
| 92 | #endif | 92 | #endif |
| 93 | 93 | ||
| 94 | /* | ||
| 95 | * default timeslice is 100 msecs (used only for SCHED_RR tasks). | ||
| 96 | * Timeslices get refilled after they expire. | ||
| 97 | */ | ||
| 98 | #define RR_TIMESLICE (100 * HZ / 1000) | ||
| 99 | |||
| 100 | extern int sched_rr_timeslice; | 94 | extern int sched_rr_timeslice; |
| 101 | 95 | ||
| 102 | extern int sched_rr_handler(struct ctl_table *table, int write, | 96 | extern int sched_rr_handler(struct ctl_table *table, int write, |
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index 600060e25ec6..18299057402f 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h | |||
| @@ -30,92 +30,12 @@ | |||
| 30 | #include <linux/preempt.h> | 30 | #include <linux/preempt.h> |
| 31 | #include <asm/processor.h> | 31 | #include <asm/processor.h> |
| 32 | 32 | ||
| 33 | typedef struct { | ||
| 34 | unsigned sequence; | ||
| 35 | spinlock_t lock; | ||
| 36 | } seqlock_t; | ||
| 37 | |||
| 38 | /* | ||
| 39 | * These macros triggered gcc-3.x compile-time problems. We think these are | ||
| 40 | * OK now. Be cautious. | ||
| 41 | */ | ||
| 42 | #define __SEQLOCK_UNLOCKED(lockname) \ | ||
| 43 | { 0, __SPIN_LOCK_UNLOCKED(lockname) } | ||
| 44 | |||
| 45 | #define seqlock_init(x) \ | ||
| 46 | do { \ | ||
| 47 | (x)->sequence = 0; \ | ||
| 48 | spin_lock_init(&(x)->lock); \ | ||
| 49 | } while (0) | ||
| 50 | |||
| 51 | #define DEFINE_SEQLOCK(x) \ | ||
| 52 | seqlock_t x = __SEQLOCK_UNLOCKED(x) | ||
| 53 | |||
| 54 | /* Lock out other writers and update the count. | ||
| 55 | * Acts like a normal spin_lock/unlock. | ||
| 56 | * Don't need preempt_disable() because that is in the spin_lock already. | ||
| 57 | */ | ||
| 58 | static inline void write_seqlock(seqlock_t *sl) | ||
| 59 | { | ||
| 60 | spin_lock(&sl->lock); | ||
| 61 | ++sl->sequence; | ||
| 62 | smp_wmb(); | ||
| 63 | } | ||
| 64 | |||
| 65 | static inline void write_sequnlock(seqlock_t *sl) | ||
| 66 | { | ||
| 67 | smp_wmb(); | ||
| 68 | sl->sequence++; | ||
| 69 | spin_unlock(&sl->lock); | ||
| 70 | } | ||
| 71 | |||
| 72 | static inline int write_tryseqlock(seqlock_t *sl) | ||
| 73 | { | ||
| 74 | int ret = spin_trylock(&sl->lock); | ||
| 75 | |||
| 76 | if (ret) { | ||
| 77 | ++sl->sequence; | ||
| 78 | smp_wmb(); | ||
| 79 | } | ||
| 80 | return ret; | ||
| 81 | } | ||
| 82 | |||
| 83 | /* Start of read calculation -- fetch last complete writer token */ | ||
| 84 | static __always_inline unsigned read_seqbegin(const seqlock_t *sl) | ||
| 85 | { | ||
| 86 | unsigned ret; | ||
| 87 | |||
| 88 | repeat: | ||
| 89 | ret = ACCESS_ONCE(sl->sequence); | ||
| 90 | if (unlikely(ret & 1)) { | ||
| 91 | cpu_relax(); | ||
| 92 | goto repeat; | ||
| 93 | } | ||
| 94 | smp_rmb(); | ||
| 95 | |||
| 96 | return ret; | ||
| 97 | } | ||
| 98 | |||
| 99 | /* | ||
| 100 | * Test if reader processed invalid data. | ||
| 101 | * | ||
| 102 | * If sequence value changed then writer changed data while in section. | ||
| 103 | */ | ||
| 104 | static __always_inline int read_seqretry(const seqlock_t *sl, unsigned start) | ||
| 105 | { | ||
| 106 | smp_rmb(); | ||
| 107 | |||
| 108 | return unlikely(sl->sequence != start); | ||
| 109 | } | ||
| 110 | |||
| 111 | |||
| 112 | /* | 33 | /* |
| 113 | * Version using sequence counter only. | 34 | * Version using sequence counter only. |
| 114 | * This can be used when code has its own mutex protecting the | 35 | * This can be used when code has its own mutex protecting the |
| 115 | * updating starting before the write_seqcountbeqin() and ending | 36 | * updating starting before the write_seqcountbeqin() and ending |
| 116 | * after the write_seqcount_end(). | 37 | * after the write_seqcount_end(). |
| 117 | */ | 38 | */ |
| 118 | |||
| 119 | typedef struct seqcount { | 39 | typedef struct seqcount { |
| 120 | unsigned sequence; | 40 | unsigned sequence; |
| 121 | } seqcount_t; | 41 | } seqcount_t; |
| @@ -218,7 +138,6 @@ static inline int __read_seqcount_retry(const seqcount_t *s, unsigned start) | |||
| 218 | static inline int read_seqcount_retry(const seqcount_t *s, unsigned start) | 138 | static inline int read_seqcount_retry(const seqcount_t *s, unsigned start) |
| 219 | { | 139 | { |
| 220 | smp_rmb(); | 140 | smp_rmb(); |
| 221 | |||
| 222 | return __read_seqcount_retry(s, start); | 141 | return __read_seqcount_retry(s, start); |
| 223 | } | 142 | } |
| 224 | 143 | ||
| @@ -252,31 +171,101 @@ static inline void write_seqcount_barrier(seqcount_t *s) | |||
| 252 | s->sequence+=2; | 171 | s->sequence+=2; |
| 253 | } | 172 | } |
| 254 | 173 | ||
| 174 | typedef struct { | ||
| 175 | struct seqcount seqcount; | ||
| 176 | spinlock_t lock; | ||
| 177 | } seqlock_t; | ||
| 178 | |||
| 255 | /* | 179 | /* |
| 256 | * Possible sw/hw IRQ protected versions of the interfaces. | 180 | * These macros triggered gcc-3.x compile-time problems. We think these are |
| 181 | * OK now. Be cautious. | ||
| 257 | */ | 182 | */ |
| 258 | #define write_seqlock_irqsave(lock, flags) \ | 183 | #define __SEQLOCK_UNLOCKED(lockname) \ |
| 259 | do { local_irq_save(flags); write_seqlock(lock); } while (0) | 184 | { \ |
| 260 | #define write_seqlock_irq(lock) \ | 185 | .seqcount = SEQCNT_ZERO, \ |
| 261 | do { local_irq_disable(); write_seqlock(lock); } while (0) | 186 | .lock = __SPIN_LOCK_UNLOCKED(lockname) \ |
| 262 | #define write_seqlock_bh(lock) \ | 187 | } |
| 263 | do { local_bh_disable(); write_seqlock(lock); } while (0) | 188 | |
| 189 | #define seqlock_init(x) \ | ||
| 190 | do { \ | ||
| 191 | seqcount_init(&(x)->seqcount); \ | ||
| 192 | spin_lock_init(&(x)->lock); \ | ||
| 193 | } while (0) | ||
| 264 | 194 | ||
| 265 | #define write_sequnlock_irqrestore(lock, flags) \ | 195 | #define DEFINE_SEQLOCK(x) \ |
| 266 | do { write_sequnlock(lock); local_irq_restore(flags); } while(0) | 196 | seqlock_t x = __SEQLOCK_UNLOCKED(x) |
| 267 | #define write_sequnlock_irq(lock) \ | ||
| 268 | do { write_sequnlock(lock); local_irq_enable(); } while(0) | ||
| 269 | #define write_sequnlock_bh(lock) \ | ||
| 270 | do { write_sequnlock(lock); local_bh_enable(); } while(0) | ||
| 271 | 197 | ||
| 272 | #define read_seqbegin_irqsave(lock, flags) \ | 198 | /* |
| 273 | ({ local_irq_save(flags); read_seqbegin(lock); }) | 199 | * Read side functions for starting and finalizing a read side section. |
| 200 | */ | ||
| 201 | static inline unsigned read_seqbegin(const seqlock_t *sl) | ||
| 202 | { | ||
| 203 | return read_seqcount_begin(&sl->seqcount); | ||
| 204 | } | ||
| 274 | 205 | ||
| 275 | #define read_seqretry_irqrestore(lock, iv, flags) \ | 206 | static inline unsigned read_seqretry(const seqlock_t *sl, unsigned start) |
| 276 | ({ \ | 207 | { |
| 277 | int ret = read_seqretry(lock, iv); \ | 208 | return read_seqcount_retry(&sl->seqcount, start); |
| 278 | local_irq_restore(flags); \ | 209 | } |
| 279 | ret; \ | 210 | |
| 280 | }) | 211 | /* |
| 212 | * Lock out other writers and update the count. | ||
| 213 | * Acts like a normal spin_lock/unlock. | ||
| 214 | * Don't need preempt_disable() because that is in the spin_lock already. | ||
| 215 | */ | ||
| 216 | static inline void write_seqlock(seqlock_t *sl) | ||
| 217 | { | ||
| 218 | spin_lock(&sl->lock); | ||
| 219 | write_seqcount_begin(&sl->seqcount); | ||
| 220 | } | ||
| 221 | |||
| 222 | static inline void write_sequnlock(seqlock_t *sl) | ||
| 223 | { | ||
| 224 | write_seqcount_end(&sl->seqcount); | ||
| 225 | spin_unlock(&sl->lock); | ||
| 226 | } | ||
| 227 | |||
| 228 | static inline void write_seqlock_bh(seqlock_t *sl) | ||
| 229 | { | ||
| 230 | spin_lock_bh(&sl->lock); | ||
| 231 | write_seqcount_begin(&sl->seqcount); | ||
| 232 | } | ||
| 233 | |||
| 234 | static inline void write_sequnlock_bh(seqlock_t *sl) | ||
| 235 | { | ||
| 236 | write_seqcount_end(&sl->seqcount); | ||
| 237 | spin_unlock_bh(&sl->lock); | ||
| 238 | } | ||
| 239 | |||
| 240 | static inline void write_seqlock_irq(seqlock_t *sl) | ||
| 241 | { | ||
| 242 | spin_lock_irq(&sl->lock); | ||
| 243 | write_seqcount_begin(&sl->seqcount); | ||
| 244 | } | ||
| 245 | |||
| 246 | static inline void write_sequnlock_irq(seqlock_t *sl) | ||
| 247 | { | ||
| 248 | write_seqcount_end(&sl->seqcount); | ||
| 249 | spin_unlock_irq(&sl->lock); | ||
| 250 | } | ||
| 251 | |||
| 252 | static inline unsigned long __write_seqlock_irqsave(seqlock_t *sl) | ||
| 253 | { | ||
| 254 | unsigned long flags; | ||
| 255 | |||
| 256 | spin_lock_irqsave(&sl->lock, flags); | ||
| 257 | write_seqcount_begin(&sl->seqcount); | ||
| 258 | return flags; | ||
| 259 | } | ||
| 260 | |||
| 261 | #define write_seqlock_irqsave(lock, flags) \ | ||
| 262 | do { flags = __write_seqlock_irqsave(lock); } while (0) | ||
| 263 | |||
| 264 | static inline void | ||
| 265 | write_sequnlock_irqrestore(seqlock_t *sl, unsigned long flags) | ||
| 266 | { | ||
| 267 | write_seqcount_end(&sl->seqcount); | ||
| 268 | spin_unlock_irqrestore(&sl->lock, flags); | ||
| 269 | } | ||
| 281 | 270 | ||
| 282 | #endif /* __LINUX_SEQLOCK_H */ | 271 | #endif /* __LINUX_SEQLOCK_H */ |
diff --git a/include/linux/signal.h b/include/linux/signal.h index 0a89ffc48466..a2dcb94ea49d 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h | |||
| @@ -241,9 +241,6 @@ extern int do_send_sig_info(int sig, struct siginfo *info, | |||
| 241 | struct task_struct *p, bool group); | 241 | struct task_struct *p, bool group); |
| 242 | extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p); | 242 | extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p); |
| 243 | extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *); | 243 | extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *); |
| 244 | extern long do_rt_tgsigqueueinfo(pid_t tgid, pid_t pid, int sig, | ||
| 245 | siginfo_t *info); | ||
| 246 | extern long do_sigpending(void __user *, unsigned long); | ||
| 247 | extern int do_sigtimedwait(const sigset_t *, siginfo_t *, | 244 | extern int do_sigtimedwait(const sigset_t *, siginfo_t *, |
| 248 | const struct timespec *); | 245 | const struct timespec *); |
| 249 | extern int sigprocmask(int, sigset_t *, sigset_t *); | 246 | extern int sigprocmask(int, sigset_t *, sigset_t *); |
| @@ -252,10 +249,59 @@ extern void __set_current_blocked(const sigset_t *); | |||
| 252 | extern int show_unhandled_signals; | 249 | extern int show_unhandled_signals; |
| 253 | extern int sigsuspend(sigset_t *); | 250 | extern int sigsuspend(sigset_t *); |
| 254 | 251 | ||
| 252 | struct sigaction { | ||
| 253 | #ifndef __ARCH_HAS_ODD_SIGACTION | ||
| 254 | __sighandler_t sa_handler; | ||
| 255 | unsigned long sa_flags; | ||
| 256 | #else | ||
| 257 | unsigned long sa_flags; | ||
| 258 | __sighandler_t sa_handler; | ||
| 259 | #endif | ||
| 260 | #ifdef __ARCH_HAS_SA_RESTORER | ||
| 261 | __sigrestore_t sa_restorer; | ||
| 262 | #endif | ||
| 263 | sigset_t sa_mask; /* mask last for extensibility */ | ||
| 264 | }; | ||
| 265 | |||
| 266 | struct k_sigaction { | ||
| 267 | struct sigaction sa; | ||
| 268 | #ifdef __ARCH_HAS_KA_RESTORER | ||
| 269 | __sigrestore_t ka_restorer; | ||
| 270 | #endif | ||
| 271 | }; | ||
| 272 | |||
| 273 | #ifdef CONFIG_OLD_SIGACTION | ||
| 274 | struct old_sigaction { | ||
| 275 | __sighandler_t sa_handler; | ||
| 276 | old_sigset_t sa_mask; | ||
| 277 | unsigned long sa_flags; | ||
| 278 | __sigrestore_t sa_restorer; | ||
| 279 | }; | ||
| 280 | #endif | ||
| 281 | |||
| 282 | struct ksignal { | ||
| 283 | struct k_sigaction ka; | ||
| 284 | siginfo_t info; | ||
| 285 | int sig; | ||
| 286 | }; | ||
| 287 | |||
| 255 | extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); | 288 | extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); |
| 289 | extern void signal_setup_done(int failed, struct ksignal *ksig, int stepping); | ||
| 256 | extern void signal_delivered(int sig, siginfo_t *info, struct k_sigaction *ka, struct pt_regs *regs, int stepping); | 290 | extern void signal_delivered(int sig, siginfo_t *info, struct k_sigaction *ka, struct pt_regs *regs, int stepping); |
| 257 | extern void exit_signals(struct task_struct *tsk); | 291 | extern void exit_signals(struct task_struct *tsk); |
| 258 | 292 | ||
| 293 | /* | ||
| 294 | * Eventually that'll replace get_signal_to_deliver(); macro for now, | ||
| 295 | * to avoid nastiness with include order. | ||
| 296 | */ | ||
| 297 | #define get_signal(ksig) \ | ||
| 298 | ({ \ | ||
| 299 | struct ksignal *p = (ksig); \ | ||
| 300 | p->sig = get_signal_to_deliver(&p->info, &p->ka, \ | ||
| 301 | signal_pt_regs(), NULL);\ | ||
| 302 | p->sig > 0; \ | ||
| 303 | }) | ||
| 304 | |||
| 259 | extern struct kmem_cache *sighand_cachep; | 305 | extern struct kmem_cache *sighand_cachep; |
| 260 | 306 | ||
| 261 | int unhandled_signal(struct task_struct *tsk, int sig); | 307 | int unhandled_signal(struct task_struct *tsk, int sig); |
diff --git a/include/linux/smpboot.h b/include/linux/smpboot.h index c65dee059913..13e929679550 100644 --- a/include/linux/smpboot.h +++ b/include/linux/smpboot.h | |||
| @@ -24,6 +24,9 @@ struct smpboot_thread_data; | |||
| 24 | * parked (cpu offline) | 24 | * parked (cpu offline) |
| 25 | * @unpark: Optional unpark function, called when the thread is | 25 | * @unpark: Optional unpark function, called when the thread is |
| 26 | * unparked (cpu online) | 26 | * unparked (cpu online) |
| 27 | * @pre_unpark: Optional unpark function, called before the thread is | ||
| 28 | * unparked (cpu online). This is not guaranteed to be | ||
| 29 | * called on the target cpu of the thread. Careful! | ||
| 27 | * @selfparking: Thread is not parked by the park function. | 30 | * @selfparking: Thread is not parked by the park function. |
| 28 | * @thread_comm: The base name of the thread | 31 | * @thread_comm: The base name of the thread |
| 29 | */ | 32 | */ |
| @@ -37,6 +40,7 @@ struct smp_hotplug_thread { | |||
| 37 | void (*cleanup)(unsigned int cpu, bool online); | 40 | void (*cleanup)(unsigned int cpu, bool online); |
| 38 | void (*park)(unsigned int cpu); | 41 | void (*park)(unsigned int cpu); |
| 39 | void (*unpark)(unsigned int cpu); | 42 | void (*unpark)(unsigned int cpu); |
| 43 | void (*pre_unpark)(unsigned int cpu); | ||
| 40 | bool selfparking; | 44 | bool selfparking; |
| 41 | const char *thread_comm; | 45 | const char *thread_comm; |
| 42 | }; | 46 | }; |
diff --git a/include/linux/stmp3xxx_rtc_wdt.h b/include/linux/stmp3xxx_rtc_wdt.h new file mode 100644 index 000000000000..1dd12c96231b --- /dev/null +++ b/include/linux/stmp3xxx_rtc_wdt.h | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | /* | ||
| 2 | * stmp3xxx_rtc_wdt.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2011 Wolfram Sang, Pengutronix e.K. | ||
| 5 | * | ||
| 6 | * This file is released under the GPLv2. | ||
| 7 | */ | ||
| 8 | #ifndef __LINUX_STMP3XXX_RTC_WDT_H | ||
| 9 | #define __LINUX_STMP3XXX_RTC_WDT_H | ||
| 10 | |||
| 11 | struct stmp3xxx_wdt_pdata { | ||
| 12 | void (*wdt_set_timeout)(struct device *dev, u32 timeout); | ||
| 13 | }; | ||
| 14 | |||
| 15 | #endif /* __LINUX_STMP3XXX_RTC_WDT_H */ | ||
diff --git a/include/linux/sunrpc/addr.h b/include/linux/sunrpc/addr.h new file mode 100644 index 000000000000..07d8e53bedfc --- /dev/null +++ b/include/linux/sunrpc/addr.h | |||
| @@ -0,0 +1,170 @@ | |||
| 1 | /* | ||
| 2 | * linux/include/linux/sunrpc/addr.h | ||
| 3 | * | ||
| 4 | * Various routines for copying and comparing sockaddrs and for | ||
| 5 | * converting them to and from presentation format. | ||
| 6 | */ | ||
| 7 | #ifndef _LINUX_SUNRPC_ADDR_H | ||
| 8 | #define _LINUX_SUNRPC_ADDR_H | ||
| 9 | |||
| 10 | #include <linux/socket.h> | ||
| 11 | #include <linux/in.h> | ||
| 12 | #include <linux/in6.h> | ||
| 13 | #include <net/ipv6.h> | ||
| 14 | |||
| 15 | size_t rpc_ntop(const struct sockaddr *, char *, const size_t); | ||
| 16 | size_t rpc_pton(struct net *, const char *, const size_t, | ||
| 17 | struct sockaddr *, const size_t); | ||
| 18 | char * rpc_sockaddr2uaddr(const struct sockaddr *, gfp_t); | ||
| 19 | size_t rpc_uaddr2sockaddr(struct net *, const char *, const size_t, | ||
| 20 | struct sockaddr *, const size_t); | ||
| 21 | |||
| 22 | static inline unsigned short rpc_get_port(const struct sockaddr *sap) | ||
| 23 | { | ||
| 24 | switch (sap->sa_family) { | ||
| 25 | case AF_INET: | ||
| 26 | return ntohs(((struct sockaddr_in *)sap)->sin_port); | ||
| 27 | case AF_INET6: | ||
| 28 | return ntohs(((struct sockaddr_in6 *)sap)->sin6_port); | ||
| 29 | } | ||
| 30 | return 0; | ||
| 31 | } | ||
| 32 | |||
| 33 | static inline void rpc_set_port(struct sockaddr *sap, | ||
| 34 | const unsigned short port) | ||
| 35 | { | ||
| 36 | switch (sap->sa_family) { | ||
| 37 | case AF_INET: | ||
| 38 | ((struct sockaddr_in *)sap)->sin_port = htons(port); | ||
| 39 | break; | ||
| 40 | case AF_INET6: | ||
| 41 | ((struct sockaddr_in6 *)sap)->sin6_port = htons(port); | ||
| 42 | break; | ||
| 43 | } | ||
| 44 | } | ||
| 45 | |||
| 46 | #define IPV6_SCOPE_DELIMITER '%' | ||
| 47 | #define IPV6_SCOPE_ID_LEN sizeof("%nnnnnnnnnn") | ||
| 48 | |||
| 49 | static inline bool __rpc_cmp_addr4(const struct sockaddr *sap1, | ||
| 50 | const struct sockaddr *sap2) | ||
| 51 | { | ||
| 52 | const struct sockaddr_in *sin1 = (const struct sockaddr_in *)sap1; | ||
| 53 | const struct sockaddr_in *sin2 = (const struct sockaddr_in *)sap2; | ||
| 54 | |||
| 55 | return sin1->sin_addr.s_addr == sin2->sin_addr.s_addr; | ||
| 56 | } | ||
| 57 | |||
| 58 | static inline bool __rpc_copy_addr4(struct sockaddr *dst, | ||
| 59 | const struct sockaddr *src) | ||
| 60 | { | ||
| 61 | const struct sockaddr_in *ssin = (struct sockaddr_in *) src; | ||
| 62 | struct sockaddr_in *dsin = (struct sockaddr_in *) dst; | ||
| 63 | |||
| 64 | dsin->sin_family = ssin->sin_family; | ||
| 65 | dsin->sin_addr.s_addr = ssin->sin_addr.s_addr; | ||
| 66 | return true; | ||
| 67 | } | ||
| 68 | |||
| 69 | #if IS_ENABLED(CONFIG_IPV6) | ||
| 70 | static inline bool __rpc_cmp_addr6(const struct sockaddr *sap1, | ||
| 71 | const struct sockaddr *sap2) | ||
| 72 | { | ||
| 73 | const struct sockaddr_in6 *sin1 = (const struct sockaddr_in6 *)sap1; | ||
| 74 | const struct sockaddr_in6 *sin2 = (const struct sockaddr_in6 *)sap2; | ||
| 75 | |||
| 76 | if (!ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr)) | ||
| 77 | return false; | ||
| 78 | else if (ipv6_addr_type(&sin1->sin6_addr) & IPV6_ADDR_LINKLOCAL) | ||
| 79 | return sin1->sin6_scope_id == sin2->sin6_scope_id; | ||
| 80 | |||
| 81 | return true; | ||
| 82 | } | ||
| 83 | |||
| 84 | static inline bool __rpc_copy_addr6(struct sockaddr *dst, | ||
| 85 | const struct sockaddr *src) | ||
| 86 | { | ||
| 87 | const struct sockaddr_in6 *ssin6 = (const struct sockaddr_in6 *) src; | ||
| 88 | struct sockaddr_in6 *dsin6 = (struct sockaddr_in6 *) dst; | ||
| 89 | |||
| 90 | dsin6->sin6_family = ssin6->sin6_family; | ||
| 91 | dsin6->sin6_addr = ssin6->sin6_addr; | ||
| 92 | dsin6->sin6_scope_id = ssin6->sin6_scope_id; | ||
| 93 | return true; | ||
| 94 | } | ||
| 95 | #else /* !(IS_ENABLED(CONFIG_IPV6) */ | ||
| 96 | static inline bool __rpc_cmp_addr6(const struct sockaddr *sap1, | ||
| 97 | const struct sockaddr *sap2) | ||
| 98 | { | ||
| 99 | return false; | ||
| 100 | } | ||
| 101 | |||
| 102 | static inline bool __rpc_copy_addr6(struct sockaddr *dst, | ||
| 103 | const struct sockaddr *src) | ||
| 104 | { | ||
| 105 | return false; | ||
| 106 | } | ||
| 107 | #endif /* !(IS_ENABLED(CONFIG_IPV6) */ | ||
| 108 | |||
| 109 | /** | ||
| 110 | * rpc_cmp_addr - compare the address portion of two sockaddrs. | ||
| 111 | * @sap1: first sockaddr | ||
| 112 | * @sap2: second sockaddr | ||
| 113 | * | ||
| 114 | * Just compares the family and address portion. Ignores port, but | ||
| 115 | * compares the scope if it's a link-local address. | ||
| 116 | * | ||
| 117 | * Returns true if the addrs are equal, false if they aren't. | ||
| 118 | */ | ||
| 119 | static inline bool rpc_cmp_addr(const struct sockaddr *sap1, | ||
| 120 | const struct sockaddr *sap2) | ||
| 121 | { | ||
| 122 | if (sap1->sa_family == sap2->sa_family) { | ||
| 123 | switch (sap1->sa_family) { | ||
| 124 | case AF_INET: | ||
| 125 | return __rpc_cmp_addr4(sap1, sap2); | ||
| 126 | case AF_INET6: | ||
| 127 | return __rpc_cmp_addr6(sap1, sap2); | ||
| 128 | } | ||
| 129 | } | ||
| 130 | return false; | ||
| 131 | } | ||
| 132 | |||
| 133 | /** | ||
| 134 | * rpc_copy_addr - copy the address portion of one sockaddr to another | ||
| 135 | * @dst: destination sockaddr | ||
| 136 | * @src: source sockaddr | ||
| 137 | * | ||
| 138 | * Just copies the address portion and family. Ignores port, scope, etc. | ||
| 139 | * Caller is responsible for making certain that dst is large enough to hold | ||
| 140 | * the address in src. Returns true if address family is supported. Returns | ||
| 141 | * false otherwise. | ||
| 142 | */ | ||
| 143 | static inline bool rpc_copy_addr(struct sockaddr *dst, | ||
| 144 | const struct sockaddr *src) | ||
| 145 | { | ||
| 146 | switch (src->sa_family) { | ||
| 147 | case AF_INET: | ||
| 148 | return __rpc_copy_addr4(dst, src); | ||
| 149 | case AF_INET6: | ||
| 150 | return __rpc_copy_addr6(dst, src); | ||
| 151 | } | ||
| 152 | return false; | ||
| 153 | } | ||
| 154 | |||
| 155 | /** | ||
| 156 | * rpc_get_scope_id - return scopeid for a given sockaddr | ||
| 157 | * @sa: sockaddr to get scopeid from | ||
| 158 | * | ||
| 159 | * Returns the value of the sin6_scope_id for AF_INET6 addrs, or 0 if | ||
| 160 | * not an AF_INET6 address. | ||
| 161 | */ | ||
| 162 | static inline u32 rpc_get_scope_id(const struct sockaddr *sa) | ||
| 163 | { | ||
| 164 | if (sa->sa_family != AF_INET6) | ||
| 165 | return 0; | ||
| 166 | |||
| 167 | return ((struct sockaddr_in6 *) sa)->sin6_scope_id; | ||
| 168 | } | ||
| 169 | |||
| 170 | #endif /* _LINUX_SUNRPC_ADDR_H */ | ||
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index f25ba922baaf..58fda1c3c783 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
| @@ -17,14 +17,15 @@ | |||
| 17 | 17 | ||
| 18 | #include <linux/atomic.h> | 18 | #include <linux/atomic.h> |
| 19 | #include <linux/rcupdate.h> | 19 | #include <linux/rcupdate.h> |
| 20 | #include <linux/uidgid.h> | ||
| 20 | 21 | ||
| 21 | /* size of the nodename buffer */ | 22 | /* size of the nodename buffer */ |
| 22 | #define UNX_MAXNODENAME 32 | 23 | #define UNX_MAXNODENAME 32 |
| 23 | 24 | ||
| 24 | /* Work around the lack of a VFS credential */ | 25 | /* Work around the lack of a VFS credential */ |
| 25 | struct auth_cred { | 26 | struct auth_cred { |
| 26 | uid_t uid; | 27 | kuid_t uid; |
| 27 | gid_t gid; | 28 | kgid_t gid; |
| 28 | struct group_info *group_info; | 29 | struct group_info *group_info; |
| 29 | const char *principal; | 30 | const char *principal; |
| 30 | unsigned char machine_cred : 1; | 31 | unsigned char machine_cred : 1; |
| @@ -48,7 +49,7 @@ struct rpc_cred { | |||
| 48 | unsigned long cr_flags; /* various flags */ | 49 | unsigned long cr_flags; /* various flags */ |
| 49 | atomic_t cr_count; /* ref count */ | 50 | atomic_t cr_count; /* ref count */ |
| 50 | 51 | ||
| 51 | uid_t cr_uid; | 52 | kuid_t cr_uid; |
| 52 | 53 | ||
| 53 | /* per-flavor data */ | 54 | /* per-flavor data */ |
| 54 | }; | 55 | }; |
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index 5dc9ee4d616e..303399b1ba59 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h | |||
| @@ -83,6 +83,10 @@ struct cache_detail { | |||
| 83 | int (*cache_upcall)(struct cache_detail *, | 83 | int (*cache_upcall)(struct cache_detail *, |
| 84 | struct cache_head *); | 84 | struct cache_head *); |
| 85 | 85 | ||
| 86 | void (*cache_request)(struct cache_detail *cd, | ||
| 87 | struct cache_head *ch, | ||
| 88 | char **bpp, int *blen); | ||
| 89 | |||
| 86 | int (*cache_parse)(struct cache_detail *, | 90 | int (*cache_parse)(struct cache_detail *, |
| 87 | char *buf, int len); | 91 | char *buf, int len); |
| 88 | 92 | ||
| @@ -157,11 +161,7 @@ sunrpc_cache_update(struct cache_detail *detail, | |||
| 157 | struct cache_head *new, struct cache_head *old, int hash); | 161 | struct cache_head *new, struct cache_head *old, int hash); |
| 158 | 162 | ||
| 159 | extern int | 163 | extern int |
| 160 | sunrpc_cache_pipe_upcall(struct cache_detail *detail, struct cache_head *h, | 164 | sunrpc_cache_pipe_upcall(struct cache_detail *detail, struct cache_head *h); |
| 161 | void (*cache_request)(struct cache_detail *, | ||
| 162 | struct cache_head *, | ||
| 163 | char **, | ||
| 164 | int *)); | ||
| 165 | 165 | ||
| 166 | 166 | ||
| 167 | extern void cache_clean_deferred(void *owner); | 167 | extern void cache_clean_deferred(void *owner); |
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 34206b84d8da..2cf4ffaa3cd4 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
| @@ -160,162 +160,11 @@ void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); | |||
| 160 | int rpc_protocol(struct rpc_clnt *); | 160 | int rpc_protocol(struct rpc_clnt *); |
| 161 | struct net * rpc_net_ns(struct rpc_clnt *); | 161 | struct net * rpc_net_ns(struct rpc_clnt *); |
| 162 | size_t rpc_max_payload(struct rpc_clnt *); | 162 | size_t rpc_max_payload(struct rpc_clnt *); |
| 163 | unsigned long rpc_get_timeout(struct rpc_clnt *clnt); | ||
| 163 | void rpc_force_rebind(struct rpc_clnt *); | 164 | void rpc_force_rebind(struct rpc_clnt *); |
| 164 | size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); | 165 | size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); |
| 165 | const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); | 166 | const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); |
| 166 | int rpc_localaddr(struct rpc_clnt *, struct sockaddr *, size_t); | 167 | int rpc_localaddr(struct rpc_clnt *, struct sockaddr *, size_t); |
| 167 | 168 | ||
| 168 | size_t rpc_ntop(const struct sockaddr *, char *, const size_t); | ||
| 169 | size_t rpc_pton(struct net *, const char *, const size_t, | ||
| 170 | struct sockaddr *, const size_t); | ||
| 171 | char * rpc_sockaddr2uaddr(const struct sockaddr *, gfp_t); | ||
| 172 | size_t rpc_uaddr2sockaddr(struct net *, const char *, const size_t, | ||
| 173 | struct sockaddr *, const size_t); | ||
| 174 | |||
| 175 | static inline unsigned short rpc_get_port(const struct sockaddr *sap) | ||
| 176 | { | ||
| 177 | switch (sap->sa_family) { | ||
| 178 | case AF_INET: | ||
| 179 | return ntohs(((struct sockaddr_in *)sap)->sin_port); | ||
| 180 | case AF_INET6: | ||
| 181 | return ntohs(((struct sockaddr_in6 *)sap)->sin6_port); | ||
| 182 | } | ||
| 183 | return 0; | ||
| 184 | } | ||
| 185 | |||
| 186 | static inline void rpc_set_port(struct sockaddr *sap, | ||
| 187 | const unsigned short port) | ||
| 188 | { | ||
| 189 | switch (sap->sa_family) { | ||
| 190 | case AF_INET: | ||
| 191 | ((struct sockaddr_in *)sap)->sin_port = htons(port); | ||
| 192 | break; | ||
| 193 | case AF_INET6: | ||
| 194 | ((struct sockaddr_in6 *)sap)->sin6_port = htons(port); | ||
| 195 | break; | ||
| 196 | } | ||
| 197 | } | ||
| 198 | |||
| 199 | #define IPV6_SCOPE_DELIMITER '%' | ||
| 200 | #define IPV6_SCOPE_ID_LEN sizeof("%nnnnnnnnnn") | ||
| 201 | |||
| 202 | static inline bool __rpc_cmp_addr4(const struct sockaddr *sap1, | ||
| 203 | const struct sockaddr *sap2) | ||
| 204 | { | ||
| 205 | const struct sockaddr_in *sin1 = (const struct sockaddr_in *)sap1; | ||
| 206 | const struct sockaddr_in *sin2 = (const struct sockaddr_in *)sap2; | ||
| 207 | |||
| 208 | return sin1->sin_addr.s_addr == sin2->sin_addr.s_addr; | ||
| 209 | } | ||
| 210 | |||
| 211 | static inline bool __rpc_copy_addr4(struct sockaddr *dst, | ||
| 212 | const struct sockaddr *src) | ||
| 213 | { | ||
| 214 | const struct sockaddr_in *ssin = (struct sockaddr_in *) src; | ||
| 215 | struct sockaddr_in *dsin = (struct sockaddr_in *) dst; | ||
| 216 | |||
| 217 | dsin->sin_family = ssin->sin_family; | ||
| 218 | dsin->sin_addr.s_addr = ssin->sin_addr.s_addr; | ||
| 219 | return true; | ||
| 220 | } | ||
| 221 | |||
| 222 | #if IS_ENABLED(CONFIG_IPV6) | ||
| 223 | static inline bool __rpc_cmp_addr6(const struct sockaddr *sap1, | ||
| 224 | const struct sockaddr *sap2) | ||
| 225 | { | ||
| 226 | const struct sockaddr_in6 *sin1 = (const struct sockaddr_in6 *)sap1; | ||
| 227 | const struct sockaddr_in6 *sin2 = (const struct sockaddr_in6 *)sap2; | ||
| 228 | |||
| 229 | if (!ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr)) | ||
| 230 | return false; | ||
| 231 | else if (ipv6_addr_type(&sin1->sin6_addr) & IPV6_ADDR_LINKLOCAL) | ||
| 232 | return sin1->sin6_scope_id == sin2->sin6_scope_id; | ||
| 233 | |||
| 234 | return true; | ||
| 235 | } | ||
| 236 | |||
| 237 | static inline bool __rpc_copy_addr6(struct sockaddr *dst, | ||
| 238 | const struct sockaddr *src) | ||
| 239 | { | ||
| 240 | const struct sockaddr_in6 *ssin6 = (const struct sockaddr_in6 *) src; | ||
| 241 | struct sockaddr_in6 *dsin6 = (struct sockaddr_in6 *) dst; | ||
| 242 | |||
| 243 | dsin6->sin6_family = ssin6->sin6_family; | ||
| 244 | dsin6->sin6_addr = ssin6->sin6_addr; | ||
| 245 | return true; | ||
| 246 | } | ||
| 247 | #else /* !(IS_ENABLED(CONFIG_IPV6) */ | ||
| 248 | static inline bool __rpc_cmp_addr6(const struct sockaddr *sap1, | ||
| 249 | const struct sockaddr *sap2) | ||
| 250 | { | ||
| 251 | return false; | ||
| 252 | } | ||
| 253 | |||
| 254 | static inline bool __rpc_copy_addr6(struct sockaddr *dst, | ||
| 255 | const struct sockaddr *src) | ||
| 256 | { | ||
| 257 | return false; | ||
| 258 | } | ||
| 259 | #endif /* !(IS_ENABLED(CONFIG_IPV6) */ | ||
| 260 | |||
| 261 | /** | ||
| 262 | * rpc_cmp_addr - compare the address portion of two sockaddrs. | ||
| 263 | * @sap1: first sockaddr | ||
| 264 | * @sap2: second sockaddr | ||
| 265 | * | ||
| 266 | * Just compares the family and address portion. Ignores port, scope, etc. | ||
| 267 | * Returns true if the addrs are equal, false if they aren't. | ||
| 268 | */ | ||
| 269 | static inline bool rpc_cmp_addr(const struct sockaddr *sap1, | ||
| 270 | const struct sockaddr *sap2) | ||
| 271 | { | ||
| 272 | if (sap1->sa_family == sap2->sa_family) { | ||
| 273 | switch (sap1->sa_family) { | ||
| 274 | case AF_INET: | ||
| 275 | return __rpc_cmp_addr4(sap1, sap2); | ||
| 276 | case AF_INET6: | ||
| 277 | return __rpc_cmp_addr6(sap1, sap2); | ||
| 278 | } | ||
| 279 | } | ||
| 280 | return false; | ||
| 281 | } | ||
| 282 | |||
| 283 | /** | ||
| 284 | * rpc_copy_addr - copy the address portion of one sockaddr to another | ||
| 285 | * @dst: destination sockaddr | ||
| 286 | * @src: source sockaddr | ||
| 287 | * | ||
| 288 | * Just copies the address portion and family. Ignores port, scope, etc. | ||
| 289 | * Caller is responsible for making certain that dst is large enough to hold | ||
| 290 | * the address in src. Returns true if address family is supported. Returns | ||
| 291 | * false otherwise. | ||
| 292 | */ | ||
| 293 | static inline bool rpc_copy_addr(struct sockaddr *dst, | ||
| 294 | const struct sockaddr *src) | ||
| 295 | { | ||
| 296 | switch (src->sa_family) { | ||
| 297 | case AF_INET: | ||
| 298 | return __rpc_copy_addr4(dst, src); | ||
| 299 | case AF_INET6: | ||
| 300 | return __rpc_copy_addr6(dst, src); | ||
| 301 | } | ||
| 302 | return false; | ||
| 303 | } | ||
| 304 | |||
| 305 | /** | ||
| 306 | * rpc_get_scope_id - return scopeid for a given sockaddr | ||
| 307 | * @sa: sockaddr to get scopeid from | ||
| 308 | * | ||
| 309 | * Returns the value of the sin6_scope_id for AF_INET6 addrs, or 0 if | ||
| 310 | * not an AF_INET6 address. | ||
| 311 | */ | ||
| 312 | static inline u32 rpc_get_scope_id(const struct sockaddr *sa) | ||
| 313 | { | ||
| 314 | if (sa->sa_family != AF_INET6) | ||
| 315 | return 0; | ||
| 316 | |||
| 317 | return ((struct sockaddr_in6 *) sa)->sin6_scope_id; | ||
| 318 | } | ||
| 319 | |||
| 320 | #endif /* __KERNEL__ */ | 169 | #endif /* __KERNEL__ */ |
| 321 | #endif /* _LINUX_SUNRPC_CLNT_H */ | 170 | #endif /* _LINUX_SUNRPC_CLNT_H */ |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 676ddf53b3ee..1f0216b9a6c9 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
| @@ -50,6 +50,7 @@ struct svc_pool { | |||
| 50 | unsigned int sp_nrthreads; /* # of threads in pool */ | 50 | unsigned int sp_nrthreads; /* # of threads in pool */ |
| 51 | struct list_head sp_all_threads; /* all server threads */ | 51 | struct list_head sp_all_threads; /* all server threads */ |
| 52 | struct svc_pool_stats sp_stats; /* statistics on pool operation */ | 52 | struct svc_pool_stats sp_stats; /* statistics on pool operation */ |
| 53 | int sp_task_pending;/* has pending task */ | ||
| 53 | } ____cacheline_aligned_in_smp; | 54 | } ____cacheline_aligned_in_smp; |
| 54 | 55 | ||
| 55 | /* | 56 | /* |
diff --git a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h index dd74084a9799..ff374ab30839 100644 --- a/include/linux/sunrpc/svcauth.h +++ b/include/linux/sunrpc/svcauth.h | |||
| @@ -18,8 +18,8 @@ | |||
| 18 | #include <linux/cred.h> | 18 | #include <linux/cred.h> |
| 19 | 19 | ||
| 20 | struct svc_cred { | 20 | struct svc_cred { |
| 21 | uid_t cr_uid; | 21 | kuid_t cr_uid; |
| 22 | gid_t cr_gid; | 22 | kgid_t cr_gid; |
| 23 | struct group_info *cr_group_info; | 23 | struct group_info *cr_group_info; |
| 24 | u32 cr_flavor; /* pseudoflavor */ | 24 | u32 cr_flavor; /* pseudoflavor */ |
| 25 | char *cr_principal; /* for gss */ | 25 | char *cr_principal; /* for gss */ |
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index 63988990bd36..15f9204ee70b 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
| @@ -56,7 +56,7 @@ struct xdr_buf { | |||
| 56 | struct kvec head[1], /* RPC header + non-page data */ | 56 | struct kvec head[1], /* RPC header + non-page data */ |
| 57 | tail[1]; /* Appended after page data */ | 57 | tail[1]; /* Appended after page data */ |
| 58 | 58 | ||
| 59 | struct page ** pages; /* Array of contiguous pages */ | 59 | struct page ** pages; /* Array of pages */ |
| 60 | unsigned int page_base, /* Start of page data */ | 60 | unsigned int page_base, /* Start of page data */ |
| 61 | page_len, /* Length of page data */ | 61 | page_len, /* Length of page data */ |
| 62 | flags; /* Flags for data disposition */ | 62 | flags; /* Flags for data disposition */ |
| @@ -152,6 +152,7 @@ xdr_adjust_iovec(struct kvec *iov, __be32 *p) | |||
| 152 | extern void xdr_shift_buf(struct xdr_buf *, size_t); | 152 | extern void xdr_shift_buf(struct xdr_buf *, size_t); |
| 153 | extern void xdr_buf_from_iov(struct kvec *, struct xdr_buf *); | 153 | extern void xdr_buf_from_iov(struct kvec *, struct xdr_buf *); |
| 154 | extern int xdr_buf_subsegment(struct xdr_buf *, struct xdr_buf *, unsigned int, unsigned int); | 154 | extern int xdr_buf_subsegment(struct xdr_buf *, struct xdr_buf *, unsigned int, unsigned int); |
| 155 | extern void xdr_buf_trim(struct xdr_buf *, unsigned int); | ||
| 155 | extern int xdr_buf_read_netobj(struct xdr_buf *, struct xdr_netobj *, unsigned int); | 156 | extern int xdr_buf_read_netobj(struct xdr_buf *, struct xdr_netobj *, unsigned int); |
| 156 | extern int read_bytes_from_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int); | 157 | extern int read_bytes_from_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int); |
| 157 | extern int write_bytes_to_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int); | 158 | extern int write_bytes_to_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int); |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 68df9c17fbbb..2818a123f3ea 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | #include <linux/memcontrol.h> | 8 | #include <linux/memcontrol.h> |
| 9 | #include <linux/sched.h> | 9 | #include <linux/sched.h> |
| 10 | #include <linux/node.h> | 10 | #include <linux/node.h> |
| 11 | 11 | #include <linux/fs.h> | |
| 12 | #include <linux/atomic.h> | 12 | #include <linux/atomic.h> |
| 13 | #include <asm/page.h> | 13 | #include <asm/page.h> |
| 14 | 14 | ||
| @@ -156,7 +156,7 @@ enum { | |||
| 156 | SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */ | 156 | SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */ |
| 157 | }; | 157 | }; |
| 158 | 158 | ||
| 159 | #define SWAP_CLUSTER_MAX 32 | 159 | #define SWAP_CLUSTER_MAX 32UL |
| 160 | #define COMPACT_CLUSTER_MAX SWAP_CLUSTER_MAX | 160 | #define COMPACT_CLUSTER_MAX SWAP_CLUSTER_MAX |
| 161 | 161 | ||
| 162 | /* | 162 | /* |
| @@ -202,6 +202,18 @@ struct swap_info_struct { | |||
| 202 | unsigned long *frontswap_map; /* frontswap in-use, one bit per page */ | 202 | unsigned long *frontswap_map; /* frontswap in-use, one bit per page */ |
| 203 | atomic_t frontswap_pages; /* frontswap pages in-use counter */ | 203 | atomic_t frontswap_pages; /* frontswap pages in-use counter */ |
| 204 | #endif | 204 | #endif |
| 205 | spinlock_t lock; /* | ||
| 206 | * protect map scan related fields like | ||
| 207 | * swap_map, lowest_bit, highest_bit, | ||
| 208 | * inuse_pages, cluster_next, | ||
| 209 | * cluster_nr, lowest_alloc and | ||
| 210 | * highest_alloc. other fields are only | ||
| 211 | * changed at swapon/swapoff, so are | ||
| 212 | * protected by swap_lock. changing | ||
| 213 | * flags need hold this lock and | ||
| 214 | * swap_lock. If both locks need hold, | ||
| 215 | * hold swap_lock first. | ||
| 216 | */ | ||
| 205 | }; | 217 | }; |
| 206 | 218 | ||
| 207 | struct swap_list_t { | 219 | struct swap_list_t { |
| @@ -209,15 +221,12 @@ struct swap_list_t { | |||
| 209 | int next; /* swapfile to be used next */ | 221 | int next; /* swapfile to be used next */ |
| 210 | }; | 222 | }; |
| 211 | 223 | ||
| 212 | /* Swap 50% full? Release swapcache more aggressively.. */ | ||
| 213 | #define vm_swap_full() (nr_swap_pages*2 < total_swap_pages) | ||
| 214 | |||
| 215 | /* linux/mm/page_alloc.c */ | 224 | /* linux/mm/page_alloc.c */ |
| 216 | extern unsigned long totalram_pages; | 225 | extern unsigned long totalram_pages; |
| 217 | extern unsigned long totalreserve_pages; | 226 | extern unsigned long totalreserve_pages; |
| 218 | extern unsigned long dirty_balance_reserve; | 227 | extern unsigned long dirty_balance_reserve; |
| 219 | extern unsigned int nr_free_buffer_pages(void); | 228 | extern unsigned long nr_free_buffer_pages(void); |
| 220 | extern unsigned int nr_free_pagecache_pages(void); | 229 | extern unsigned long nr_free_pagecache_pages(void); |
| 221 | 230 | ||
| 222 | /* Definition of global_page_state not available yet */ | 231 | /* Definition of global_page_state not available yet */ |
| 223 | #define nr_free_pages() global_page_state(NR_FREE_PAGES) | 232 | #define nr_free_pages() global_page_state(NR_FREE_PAGES) |
| @@ -266,7 +275,7 @@ extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem, | |||
| 266 | extern unsigned long shrink_all_memory(unsigned long nr_pages); | 275 | extern unsigned long shrink_all_memory(unsigned long nr_pages); |
| 267 | extern int vm_swappiness; | 276 | extern int vm_swappiness; |
| 268 | extern int remove_mapping(struct address_space *mapping, struct page *page); | 277 | extern int remove_mapping(struct address_space *mapping, struct page *page); |
| 269 | extern long vm_total_pages; | 278 | extern unsigned long vm_total_pages; |
| 270 | 279 | ||
| 271 | #ifdef CONFIG_NUMA | 280 | #ifdef CONFIG_NUMA |
| 272 | extern int zone_reclaim_mode; | 281 | extern int zone_reclaim_mode; |
| @@ -330,8 +339,9 @@ int generic_swapfile_activate(struct swap_info_struct *, struct file *, | |||
| 330 | sector_t *); | 339 | sector_t *); |
| 331 | 340 | ||
| 332 | /* linux/mm/swap_state.c */ | 341 | /* linux/mm/swap_state.c */ |
| 333 | extern struct address_space swapper_space; | 342 | extern struct address_space swapper_spaces[]; |
| 334 | #define total_swapcache_pages swapper_space.nrpages | 343 | #define swap_address_space(entry) (&swapper_spaces[swp_type(entry)]) |
| 344 | extern unsigned long total_swapcache_pages(void); | ||
| 335 | extern void show_swap_cache_info(void); | 345 | extern void show_swap_cache_info(void); |
| 336 | extern int add_to_swap(struct page *); | 346 | extern int add_to_swap(struct page *); |
| 337 | extern int add_to_swap_cache(struct page *, swp_entry_t, gfp_t); | 347 | extern int add_to_swap_cache(struct page *, swp_entry_t, gfp_t); |
| @@ -346,8 +356,20 @@ extern struct page *swapin_readahead(swp_entry_t, gfp_t, | |||
| 346 | struct vm_area_struct *vma, unsigned long addr); | 356 | struct vm_area_struct *vma, unsigned long addr); |
| 347 | 357 | ||
| 348 | /* linux/mm/swapfile.c */ | 358 | /* linux/mm/swapfile.c */ |
| 349 | extern long nr_swap_pages; | 359 | extern atomic_long_t nr_swap_pages; |
| 350 | extern long total_swap_pages; | 360 | extern long total_swap_pages; |
| 361 | |||
| 362 | /* Swap 50% full? Release swapcache more aggressively.. */ | ||
| 363 | static inline bool vm_swap_full(void) | ||
| 364 | { | ||
| 365 | return atomic_long_read(&nr_swap_pages) * 2 < total_swap_pages; | ||
| 366 | } | ||
| 367 | |||
| 368 | static inline long get_nr_swap_pages(void) | ||
| 369 | { | ||
| 370 | return atomic_long_read(&nr_swap_pages); | ||
| 371 | } | ||
| 372 | |||
| 351 | extern void si_swapinfo(struct sysinfo *); | 373 | extern void si_swapinfo(struct sysinfo *); |
| 352 | extern swp_entry_t get_swap_page(void); | 374 | extern swp_entry_t get_swap_page(void); |
| 353 | extern swp_entry_t get_swap_page_of_type(int); | 375 | extern swp_entry_t get_swap_page_of_type(int); |
| @@ -380,9 +402,10 @@ mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout) | |||
| 380 | 402 | ||
| 381 | #else /* CONFIG_SWAP */ | 403 | #else /* CONFIG_SWAP */ |
| 382 | 404 | ||
| 383 | #define nr_swap_pages 0L | 405 | #define get_nr_swap_pages() 0L |
| 384 | #define total_swap_pages 0L | 406 | #define total_swap_pages 0L |
| 385 | #define total_swapcache_pages 0UL | 407 | #define total_swapcache_pages() 0UL |
| 408 | #define vm_swap_full() 0 | ||
| 386 | 409 | ||
| 387 | #define si_swapinfo(val) \ | 410 | #define si_swapinfo(val) \ |
| 388 | do { (val)->freeswap = (val)->totalswap = 0; } while (0) | 411 | do { (val)->freeswap = (val)->totalswap = 0; } while (0) |
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index 071d62c214a6..2de42f9401d2 100644 --- a/include/linux/swiotlb.h +++ b/include/linux/swiotlb.h | |||
| @@ -23,7 +23,7 @@ extern int swiotlb_force; | |||
| 23 | #define IO_TLB_SHIFT 11 | 23 | #define IO_TLB_SHIFT 11 |
| 24 | 24 | ||
| 25 | extern void swiotlb_init(int verbose); | 25 | extern void swiotlb_init(int verbose); |
| 26 | extern void swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose); | 26 | int swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose); |
| 27 | extern unsigned long swiotlb_nr_tbl(void); | 27 | extern unsigned long swiotlb_nr_tbl(void); |
| 28 | extern int swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs); | 28 | extern int swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs); |
| 29 | 29 | ||
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 45e2db270255..313a8e0a6553 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -68,11 +68,11 @@ struct sigaltstack; | |||
| 68 | #include <linux/types.h> | 68 | #include <linux/types.h> |
| 69 | #include <linux/aio_abi.h> | 69 | #include <linux/aio_abi.h> |
| 70 | #include <linux/capability.h> | 70 | #include <linux/capability.h> |
| 71 | #include <linux/signal.h> | ||
| 71 | #include <linux/list.h> | 72 | #include <linux/list.h> |
| 72 | #include <linux/bug.h> | 73 | #include <linux/bug.h> |
| 73 | #include <linux/sem.h> | 74 | #include <linux/sem.h> |
| 74 | #include <asm/siginfo.h> | 75 | #include <asm/siginfo.h> |
| 75 | #include <asm/signal.h> | ||
| 76 | #include <linux/unistd.h> | 76 | #include <linux/unistd.h> |
| 77 | #include <linux/quota.h> | 77 | #include <linux/quota.h> |
| 78 | #include <linux/key.h> | 78 | #include <linux/key.h> |
| @@ -300,10 +300,8 @@ asmlinkage long sys_personality(unsigned int personality); | |||
| 300 | asmlinkage long sys_sigpending(old_sigset_t __user *set); | 300 | asmlinkage long sys_sigpending(old_sigset_t __user *set); |
| 301 | asmlinkage long sys_sigprocmask(int how, old_sigset_t __user *set, | 301 | asmlinkage long sys_sigprocmask(int how, old_sigset_t __user *set, |
| 302 | old_sigset_t __user *oset); | 302 | old_sigset_t __user *oset); |
| 303 | #ifdef CONFIG_GENERIC_SIGALTSTACK | ||
| 304 | asmlinkage long sys_sigaltstack(const struct sigaltstack __user *uss, | 303 | asmlinkage long sys_sigaltstack(const struct sigaltstack __user *uss, |
| 305 | struct sigaltstack __user *uoss); | 304 | struct sigaltstack __user *uoss); |
| 306 | #endif | ||
| 307 | 305 | ||
| 308 | asmlinkage long sys_getitimer(int which, struct itimerval __user *value); | 306 | asmlinkage long sys_getitimer(int which, struct itimerval __user *value); |
| 309 | asmlinkage long sys_setitimer(int which, | 307 | asmlinkage long sys_setitimer(int which, |
| @@ -377,6 +375,27 @@ asmlinkage long sys_init_module(void __user *umod, unsigned long len, | |||
| 377 | asmlinkage long sys_delete_module(const char __user *name_user, | 375 | asmlinkage long sys_delete_module(const char __user *name_user, |
| 378 | unsigned int flags); | 376 | unsigned int flags); |
| 379 | 377 | ||
| 378 | #ifdef CONFIG_OLD_SIGSUSPEND | ||
| 379 | asmlinkage long sys_sigsuspend(old_sigset_t mask); | ||
| 380 | #endif | ||
| 381 | |||
| 382 | #ifdef CONFIG_OLD_SIGSUSPEND3 | ||
| 383 | asmlinkage long sys_sigsuspend(int unused1, int unused2, old_sigset_t mask); | ||
| 384 | #endif | ||
| 385 | |||
| 386 | asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize); | ||
| 387 | |||
| 388 | #ifdef CONFIG_OLD_SIGACTION | ||
| 389 | asmlinkage long sys_sigaction(int, const struct old_sigaction __user *, | ||
| 390 | struct old_sigaction __user *); | ||
| 391 | #endif | ||
| 392 | |||
| 393 | #ifndef CONFIG_ODD_RT_SIGACTION | ||
| 394 | asmlinkage long sys_rt_sigaction(int, | ||
| 395 | const struct sigaction __user *, | ||
| 396 | struct sigaction __user *, | ||
| 397 | size_t); | ||
| 398 | #endif | ||
| 380 | asmlinkage long sys_rt_sigprocmask(int how, sigset_t __user *set, | 399 | asmlinkage long sys_rt_sigprocmask(int how, sigset_t __user *set, |
| 381 | sigset_t __user *oset, size_t sigsetsize); | 400 | sigset_t __user *oset, size_t sigsetsize); |
| 382 | asmlinkage long sys_rt_sigpending(sigset_t __user *set, size_t sigsetsize); | 401 | asmlinkage long sys_rt_sigpending(sigset_t __user *set, size_t sigsetsize); |
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index fe82022478e7..f0bd7f90a90d 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h | |||
| @@ -74,6 +74,8 @@ enum thermal_trend { | |||
| 74 | THERMAL_TREND_STABLE, /* temperature is stable */ | 74 | THERMAL_TREND_STABLE, /* temperature is stable */ |
| 75 | THERMAL_TREND_RAISING, /* temperature is raising */ | 75 | THERMAL_TREND_RAISING, /* temperature is raising */ |
| 76 | THERMAL_TREND_DROPPING, /* temperature is dropping */ | 76 | THERMAL_TREND_DROPPING, /* temperature is dropping */ |
| 77 | THERMAL_TREND_RAISE_FULL, /* apply highest cooling action */ | ||
| 78 | THERMAL_TREND_DROP_FULL, /* apply lowest cooling action */ | ||
| 77 | }; | 79 | }; |
| 78 | 80 | ||
| 79 | /* Events supported by Thermal Netlink */ | 81 | /* Events supported by Thermal Netlink */ |
| @@ -121,6 +123,7 @@ struct thermal_zone_device_ops { | |||
| 121 | int (*set_trip_hyst) (struct thermal_zone_device *, int, | 123 | int (*set_trip_hyst) (struct thermal_zone_device *, int, |
| 122 | unsigned long); | 124 | unsigned long); |
| 123 | int (*get_crit_temp) (struct thermal_zone_device *, unsigned long *); | 125 | int (*get_crit_temp) (struct thermal_zone_device *, unsigned long *); |
| 126 | int (*set_emul_temp) (struct thermal_zone_device *, unsigned long); | ||
| 124 | int (*get_trend) (struct thermal_zone_device *, int, | 127 | int (*get_trend) (struct thermal_zone_device *, int, |
| 125 | enum thermal_trend *); | 128 | enum thermal_trend *); |
| 126 | int (*notify) (struct thermal_zone_device *, int, | 129 | int (*notify) (struct thermal_zone_device *, int, |
| @@ -163,6 +166,7 @@ struct thermal_zone_device { | |||
| 163 | int polling_delay; | 166 | int polling_delay; |
| 164 | int temperature; | 167 | int temperature; |
| 165 | int last_temperature; | 168 | int last_temperature; |
| 169 | int emul_temperature; | ||
| 166 | int passive; | 170 | int passive; |
| 167 | unsigned int forced_passive; | 171 | unsigned int forced_passive; |
| 168 | const struct thermal_zone_device_ops *ops; | 172 | const struct thermal_zone_device_ops *ops; |
| @@ -244,9 +248,11 @@ int thermal_register_governor(struct thermal_governor *); | |||
| 244 | void thermal_unregister_governor(struct thermal_governor *); | 248 | void thermal_unregister_governor(struct thermal_governor *); |
| 245 | 249 | ||
| 246 | #ifdef CONFIG_NET | 250 | #ifdef CONFIG_NET |
| 247 | extern int thermal_generate_netlink_event(u32 orig, enum events event); | 251 | extern int thermal_generate_netlink_event(struct thermal_zone_device *tz, |
| 252 | enum events event); | ||
| 248 | #else | 253 | #else |
| 249 | static inline int thermal_generate_netlink_event(u32 orig, enum events event) | 254 | static int thermal_generate_netlink_event(struct thermal_zone_device *tz, |
| 255 | enum events event) | ||
| 250 | { | 256 | { |
| 251 | return 0; | 257 | return 0; |
| 252 | } | 258 | } |
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h index b9bd2e6c73cc..4ce009324933 100644 --- a/include/linux/user_namespace.h +++ b/include/linux/user_namespace.h | |||
| @@ -21,7 +21,7 @@ struct user_namespace { | |||
| 21 | struct uid_gid_map uid_map; | 21 | struct uid_gid_map uid_map; |
| 22 | struct uid_gid_map gid_map; | 22 | struct uid_gid_map gid_map; |
| 23 | struct uid_gid_map projid_map; | 23 | struct uid_gid_map projid_map; |
| 24 | struct kref kref; | 24 | atomic_t count; |
| 25 | struct user_namespace *parent; | 25 | struct user_namespace *parent; |
| 26 | kuid_t owner; | 26 | kuid_t owner; |
| 27 | kgid_t group; | 27 | kgid_t group; |
| @@ -35,18 +35,18 @@ extern struct user_namespace init_user_ns; | |||
| 35 | static inline struct user_namespace *get_user_ns(struct user_namespace *ns) | 35 | static inline struct user_namespace *get_user_ns(struct user_namespace *ns) |
| 36 | { | 36 | { |
| 37 | if (ns) | 37 | if (ns) |
| 38 | kref_get(&ns->kref); | 38 | atomic_inc(&ns->count); |
| 39 | return ns; | 39 | return ns; |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | extern int create_user_ns(struct cred *new); | 42 | extern int create_user_ns(struct cred *new); |
| 43 | extern int unshare_userns(unsigned long unshare_flags, struct cred **new_cred); | 43 | extern int unshare_userns(unsigned long unshare_flags, struct cred **new_cred); |
| 44 | extern void free_user_ns(struct kref *kref); | 44 | extern void free_user_ns(struct user_namespace *ns); |
| 45 | 45 | ||
| 46 | static inline void put_user_ns(struct user_namespace *ns) | 46 | static inline void put_user_ns(struct user_namespace *ns) |
| 47 | { | 47 | { |
| 48 | if (ns) | 48 | if (ns && atomic_dec_and_test(&ns->count)) |
| 49 | kref_put(&ns->kref, free_user_ns); | 49 | free_user_ns(ns); |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | struct seq_operations; | 52 | struct seq_operations; |
diff --git a/include/linux/vexpress.h b/include/linux/vexpress.h index c52215ff4245..75818744ab59 100644 --- a/include/linux/vexpress.h +++ b/include/linux/vexpress.h | |||
| @@ -27,6 +27,14 @@ | |||
| 27 | #define VEXPRESS_GPIO_MMC_CARDIN 0 | 27 | #define VEXPRESS_GPIO_MMC_CARDIN 0 |
| 28 | #define VEXPRESS_GPIO_MMC_WPROT 1 | 28 | #define VEXPRESS_GPIO_MMC_WPROT 1 |
| 29 | #define VEXPRESS_GPIO_FLASH_WPn 2 | 29 | #define VEXPRESS_GPIO_FLASH_WPn 2 |
| 30 | #define VEXPRESS_GPIO_LED0 3 | ||
| 31 | #define VEXPRESS_GPIO_LED1 4 | ||
| 32 | #define VEXPRESS_GPIO_LED2 5 | ||
| 33 | #define VEXPRESS_GPIO_LED3 6 | ||
| 34 | #define VEXPRESS_GPIO_LED4 7 | ||
| 35 | #define VEXPRESS_GPIO_LED5 8 | ||
| 36 | #define VEXPRESS_GPIO_LED6 9 | ||
| 37 | #define VEXPRESS_GPIO_LED7 10 | ||
| 30 | 38 | ||
| 31 | #define VEXPRESS_RES_FUNC(_site, _func) \ | 39 | #define VEXPRESS_RES_FUNC(_site, _func) \ |
| 32 | { \ | 40 | { \ |
diff --git a/include/linux/virtio.h b/include/linux/virtio.h index cf8adb1f5b2c..ff6714e6d0f5 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h | |||
| @@ -78,7 +78,7 @@ struct virtio_device { | |||
| 78 | int index; | 78 | int index; |
| 79 | struct device dev; | 79 | struct device dev; |
| 80 | struct virtio_device_id id; | 80 | struct virtio_device_id id; |
| 81 | struct virtio_config_ops *config; | 81 | const struct virtio_config_ops *config; |
| 82 | struct list_head vqs; | 82 | struct list_head vqs; |
| 83 | /* Note that this is a Linux set_bit-style bitmap. */ | 83 | /* Note that this is a Linux set_bit-style bitmap. */ |
| 84 | unsigned long features[1]; | 84 | unsigned long features[1]; |
| @@ -126,4 +126,13 @@ static inline struct virtio_driver *drv_to_virtio(struct device_driver *drv) | |||
| 126 | 126 | ||
| 127 | int register_virtio_driver(struct virtio_driver *drv); | 127 | int register_virtio_driver(struct virtio_driver *drv); |
| 128 | void unregister_virtio_driver(struct virtio_driver *drv); | 128 | void unregister_virtio_driver(struct virtio_driver *drv); |
| 129 | |||
| 130 | /* module_virtio_driver() - Helper macro for drivers that don't do | ||
| 131 | * anything special in module init/exit. This eliminates a lot of | ||
| 132 | * boilerplate. Each module may only use this macro once, and | ||
| 133 | * calling it replaces module_init() and module_exit() | ||
| 134 | */ | ||
| 135 | #define module_virtio_driver(__virtio_driver) \ | ||
| 136 | module_driver(__virtio_driver, register_virtio_driver, \ | ||
| 137 | unregister_virtio_driver) | ||
| 129 | #endif /* _LINUX_VIRTIO_H */ | 138 | #endif /* _LINUX_VIRTIO_H */ |
diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h index fce0a2799d43..bd6cf61142be 100644 --- a/include/linux/vm_event_item.h +++ b/include/linux/vm_event_item.h | |||
| @@ -36,7 +36,6 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, | |||
| 36 | #endif | 36 | #endif |
| 37 | PGINODESTEAL, SLABS_SCANNED, KSWAPD_INODESTEAL, | 37 | PGINODESTEAL, SLABS_SCANNED, KSWAPD_INODESTEAL, |
| 38 | KSWAPD_LOW_WMARK_HIT_QUICKLY, KSWAPD_HIGH_WMARK_HIT_QUICKLY, | 38 | KSWAPD_LOW_WMARK_HIT_QUICKLY, KSWAPD_HIGH_WMARK_HIT_QUICKLY, |
| 39 | KSWAPD_SKIP_CONGESTION_WAIT, | ||
| 40 | PAGEOUTRUN, ALLOCSTALL, PGROTATED, | 39 | PAGEOUTRUN, ALLOCSTALL, PGROTATED, |
| 41 | #ifdef CONFIG_NUMA_BALANCING | 40 | #ifdef CONFIG_NUMA_BALANCING |
| 42 | NUMA_PTE_UPDATES, | 41 | NUMA_PTE_UPDATES, |
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index a13291f7da88..5fd71a7d0dfd 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
| @@ -85,7 +85,7 @@ static inline void vm_events_fold_cpu(int cpu) | |||
| 85 | #define count_vm_numa_events(x, y) count_vm_events(x, y) | 85 | #define count_vm_numa_events(x, y) count_vm_events(x, y) |
| 86 | #else | 86 | #else |
| 87 | #define count_vm_numa_event(x) do {} while (0) | 87 | #define count_vm_numa_event(x) do {} while (0) |
| 88 | #define count_vm_numa_events(x, y) do {} while (0) | 88 | #define count_vm_numa_events(x, y) do { (void)(y); } while (0) |
| 89 | #endif /* CONFIG_NUMA_BALANCING */ | 89 | #endif /* CONFIG_NUMA_BALANCING */ |
| 90 | 90 | ||
| 91 | #define __count_zone_vm_events(item, zone, delta) \ | 91 | #define __count_zone_vm_events(item, zone, delta) \ |
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index 50ae7d0c279e..e8d65718560b 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
| @@ -47,6 +47,7 @@ int con_set_cmap(unsigned char __user *cmap); | |||
| 47 | int con_get_cmap(unsigned char __user *cmap); | 47 | int con_get_cmap(unsigned char __user *cmap); |
| 48 | void scrollback(struct vc_data *vc, int lines); | 48 | void scrollback(struct vc_data *vc, int lines); |
| 49 | void scrollfront(struct vc_data *vc, int lines); | 49 | void scrollfront(struct vc_data *vc, int lines); |
| 50 | void clear_buffer_attributes(struct vc_data *vc); | ||
| 50 | void update_region(struct vc_data *vc, unsigned long start, int count); | 51 | void update_region(struct vc_data *vc, unsigned long start, int count); |
| 51 | void redraw_screen(struct vc_data *vc, int is_switch); | 52 | void redraw_screen(struct vc_data *vc, int is_switch); |
| 52 | #define update_screen(x) redraw_screen(x, 0) | 53 | #define update_screen(x) redraw_screen(x, 0) |
| @@ -130,6 +131,8 @@ void vt_event_post(unsigned int event, unsigned int old, unsigned int new); | |||
| 130 | int vt_waitactive(int n); | 131 | int vt_waitactive(int n); |
| 131 | void change_console(struct vc_data *new_vc); | 132 | void change_console(struct vc_data *new_vc); |
| 132 | void reset_vc(struct vc_data *vc); | 133 | void reset_vc(struct vc_data *vc); |
| 134 | extern int do_unbind_con_driver(const struct consw *csw, int first, int last, | ||
| 135 | int deflt); | ||
| 133 | extern int unbind_con_driver(const struct consw *csw, int first, int last, | 136 | extern int unbind_con_driver(const struct consw *csw, int first, int last, |
| 134 | int deflt); | 137 | int deflt); |
| 135 | int vty_init(const struct file_operations *console_fops); | 138 | int vty_init(const struct file_operations *console_fops); |
diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h index 3a9df2f43be6..2a3038ee17a3 100644 --- a/include/linux/watchdog.h +++ b/include/linux/watchdog.h | |||
| @@ -118,6 +118,13 @@ static inline void watchdog_set_nowayout(struct watchdog_device *wdd, bool noway | |||
| 118 | set_bit(WDOG_NO_WAY_OUT, &wdd->status); | 118 | set_bit(WDOG_NO_WAY_OUT, &wdd->status); |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | /* Use the following function to check if a timeout value is invalid */ | ||
| 122 | static inline bool watchdog_timeout_invalid(struct watchdog_device *wdd, unsigned int t) | ||
| 123 | { | ||
| 124 | return ((wdd->max_timeout != 0) && | ||
| 125 | (t < wdd->min_timeout || t > wdd->max_timeout)); | ||
| 126 | } | ||
| 127 | |||
| 121 | /* Use the following functions to manipulate watchdog driver specific data */ | 128 | /* Use the following functions to manipulate watchdog driver specific data */ |
| 122 | static inline void watchdog_set_drvdata(struct watchdog_device *wdd, void *data) | 129 | static inline void watchdog_set_drvdata(struct watchdog_device *wdd, void *data) |
| 123 | { | 130 | { |
| @@ -130,6 +137,8 @@ static inline void *watchdog_get_drvdata(struct watchdog_device *wdd) | |||
| 130 | } | 137 | } |
| 131 | 138 | ||
| 132 | /* drivers/watchdog/watchdog_core.c */ | 139 | /* drivers/watchdog/watchdog_core.c */ |
| 140 | extern int watchdog_init_timeout(struct watchdog_device *wdd, | ||
| 141 | unsigned int timeout_parm, struct device *dev); | ||
| 133 | extern int watchdog_register_device(struct watchdog_device *); | 142 | extern int watchdog_register_device(struct watchdog_device *); |
| 134 | extern void watchdog_unregister_device(struct watchdog_device *); | 143 | extern void watchdog_unregister_device(struct watchdog_device *); |
| 135 | 144 | ||
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index b82a83aba311..9a9367c0c076 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
| @@ -87,9 +87,9 @@ int inode_wait(void *); | |||
| 87 | void writeback_inodes_sb(struct super_block *, enum wb_reason reason); | 87 | void writeback_inodes_sb(struct super_block *, enum wb_reason reason); |
| 88 | void writeback_inodes_sb_nr(struct super_block *, unsigned long nr, | 88 | void writeback_inodes_sb_nr(struct super_block *, unsigned long nr, |
| 89 | enum wb_reason reason); | 89 | enum wb_reason reason); |
| 90 | int writeback_inodes_sb_if_idle(struct super_block *, enum wb_reason reason); | 90 | int try_to_writeback_inodes_sb(struct super_block *, enum wb_reason reason); |
| 91 | int writeback_inodes_sb_nr_if_idle(struct super_block *, unsigned long nr, | 91 | int try_to_writeback_inodes_sb_nr(struct super_block *, unsigned long nr, |
| 92 | enum wb_reason reason); | 92 | enum wb_reason reason); |
| 93 | void sync_inodes_sb(struct super_block *); | 93 | void sync_inodes_sb(struct super_block *); |
| 94 | long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages, | 94 | long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages, |
| 95 | enum wb_reason reason); | 95 | enum wb_reason reason); |
diff --git a/include/media/adv7343.h b/include/media/adv7343.h index d6f8a4e1a1fc..944757be49bb 100644 --- a/include/media/adv7343.h +++ b/include/media/adv7343.h | |||
| @@ -20,4 +20,56 @@ | |||
| 20 | #define ADV7343_COMPONENT_ID (1) | 20 | #define ADV7343_COMPONENT_ID (1) |
| 21 | #define ADV7343_SVIDEO_ID (2) | 21 | #define ADV7343_SVIDEO_ID (2) |
| 22 | 22 | ||
| 23 | /** | ||
| 24 | * adv7343_power_mode - power mode configuration. | ||
| 25 | * @sleep_mode: on enable the current consumption is reduced to micro ampere | ||
| 26 | * level. All DACs and the internal PLL circuit are disabled. | ||
| 27 | * Registers can be read from and written in sleep mode. | ||
| 28 | * @pll_control: PLL and oversampling control. This control allows internal | ||
| 29 | * PLL 1 circuit to be powered down and the oversampling to be | ||
| 30 | * switched off. | ||
| 31 | * @dac_1: power on/off DAC 1. | ||
| 32 | * @dac_2: power on/off DAC 2. | ||
| 33 | * @dac_3: power on/off DAC 3. | ||
| 34 | * @dac_4: power on/off DAC 4. | ||
| 35 | * @dac_5: power on/off DAC 5. | ||
| 36 | * @dac_6: power on/off DAC 6. | ||
| 37 | * | ||
| 38 | * Power mode register (Register 0x0), for more info refer REGISTER MAP ACCESS | ||
| 39 | * section of datasheet[1], table 17 page no 30. | ||
| 40 | * | ||
| 41 | * [1] http://www.analog.com/static/imported-files/data_sheets/ADV7342_7343.pdf | ||
| 42 | */ | ||
| 43 | struct adv7343_power_mode { | ||
| 44 | bool sleep_mode; | ||
| 45 | bool pll_control; | ||
| 46 | bool dac_1; | ||
| 47 | bool dac_2; | ||
| 48 | bool dac_3; | ||
| 49 | bool dac_4; | ||
| 50 | bool dac_5; | ||
| 51 | bool dac_6; | ||
| 52 | }; | ||
| 53 | |||
| 54 | /** | ||
| 55 | * struct adv7343_sd_config - SD Only Output Configuration. | ||
| 56 | * @sd_dac_out1: Configure SD DAC Output 1. | ||
| 57 | * @sd_dac_out2: Configure SD DAC Output 2. | ||
| 58 | */ | ||
| 59 | struct adv7343_sd_config { | ||
| 60 | /* SD only Output Configuration */ | ||
| 61 | bool sd_dac_out1; | ||
| 62 | bool sd_dac_out2; | ||
| 63 | }; | ||
| 64 | |||
| 65 | /** | ||
| 66 | * struct adv7343_platform_data - Platform data values and access functions. | ||
| 67 | * @mode_config: Configuration for power mode. | ||
| 68 | * @sd_config: SD Only Configuration. | ||
| 69 | */ | ||
| 70 | struct adv7343_platform_data { | ||
| 71 | struct adv7343_power_mode mode_config; | ||
| 72 | struct adv7343_sd_config sd_config; | ||
| 73 | }; | ||
| 74 | |||
| 23 | #endif /* End of #ifndef ADV7343_H */ | 75 | #endif /* End of #ifndef ADV7343_H */ |
diff --git a/include/media/blackfin/bfin_capture.h b/include/media/blackfin/bfin_capture.h index 2038a8a3f8aa..56b9ce4472fc 100644 --- a/include/media/blackfin/bfin_capture.h +++ b/include/media/blackfin/bfin_capture.h | |||
| @@ -9,6 +9,7 @@ struct ppi_info; | |||
| 9 | struct bcap_route { | 9 | struct bcap_route { |
| 10 | u32 input; | 10 | u32 input; |
| 11 | u32 output; | 11 | u32 output; |
| 12 | u32 ppi_control; | ||
| 12 | }; | 13 | }; |
| 13 | 14 | ||
| 14 | struct bfin_capture_config { | 15 | struct bfin_capture_config { |
| @@ -30,8 +31,8 @@ struct bfin_capture_config { | |||
| 30 | unsigned long ppi_control; | 31 | unsigned long ppi_control; |
| 31 | /* ppi interrupt mask */ | 32 | /* ppi interrupt mask */ |
| 32 | u32 int_mask; | 33 | u32 int_mask; |
| 33 | /* horizontal blanking clocks */ | 34 | /* horizontal blanking pixels */ |
| 34 | int blank_clocks; | 35 | int blank_pixels; |
| 35 | }; | 36 | }; |
| 36 | 37 | ||
| 37 | #endif | 38 | #endif |
diff --git a/include/media/blackfin/ppi.h b/include/media/blackfin/ppi.h index 8f72f8a0b3d0..d0697f4edf87 100644 --- a/include/media/blackfin/ppi.h +++ b/include/media/blackfin/ppi.h | |||
| @@ -21,22 +21,42 @@ | |||
| 21 | #define _PPI_H_ | 21 | #define _PPI_H_ |
| 22 | 22 | ||
| 23 | #include <linux/interrupt.h> | 23 | #include <linux/interrupt.h> |
| 24 | #include <asm/blackfin.h> | ||
| 25 | #include <asm/bfin_ppi.h> | ||
| 24 | 26 | ||
| 27 | /* EPPI */ | ||
| 25 | #ifdef EPPI_EN | 28 | #ifdef EPPI_EN |
| 26 | #define PORT_EN EPPI_EN | 29 | #define PORT_EN EPPI_EN |
| 30 | #define PORT_DIR EPPI_DIR | ||
| 27 | #define DMA32 0 | 31 | #define DMA32 0 |
| 28 | #define PACK_EN PACKEN | 32 | #define PACK_EN PACKEN |
| 29 | #endif | 33 | #endif |
| 30 | 34 | ||
| 35 | /* EPPI3 */ | ||
| 36 | #ifdef EPPI0_CTL2 | ||
| 37 | #define PORT_EN EPPI_CTL_EN | ||
| 38 | #define PORT_DIR EPPI_CTL_DIR | ||
| 39 | #define PACK_EN EPPI_CTL_PACKEN | ||
| 40 | #define DMA32 0 | ||
| 41 | #define DLEN_8 EPPI_CTL_DLEN08 | ||
| 42 | #define DLEN_16 EPPI_CTL_DLEN16 | ||
| 43 | #endif | ||
| 44 | |||
| 31 | struct ppi_if; | 45 | struct ppi_if; |
| 32 | 46 | ||
| 33 | struct ppi_params { | 47 | struct ppi_params { |
| 34 | int width; | 48 | u32 width; /* width in pixels */ |
| 35 | int height; | 49 | u32 height; /* height in lines */ |
| 36 | int bpp; | 50 | u32 hdelay; /* delay after the HSYNC in pixels */ |
| 37 | unsigned long ppi_control; | 51 | u32 vdelay; /* delay after the VSYNC in lines */ |
| 38 | u32 int_mask; | 52 | u32 line; /* total pixels per line */ |
| 39 | int blank_clocks; | 53 | u32 frame; /* total lines per frame */ |
| 54 | u32 hsync; /* HSYNC length in pixels */ | ||
| 55 | u32 vsync; /* VSYNC length in lines */ | ||
| 56 | int bpp; /* bits per pixel */ | ||
| 57 | int dlen; /* data length for ppi in bits */ | ||
| 58 | u32 ppi_control; /* ppi configuration */ | ||
| 59 | u32 int_mask; /* interrupt mask */ | ||
| 40 | }; | 60 | }; |
| 41 | 61 | ||
| 42 | struct ppi_ops { | 62 | struct ppi_ops { |
| @@ -51,6 +71,7 @@ struct ppi_ops { | |||
| 51 | enum ppi_type { | 71 | enum ppi_type { |
| 52 | PPI_TYPE_PPI, | 72 | PPI_TYPE_PPI, |
| 53 | PPI_TYPE_EPPI, | 73 | PPI_TYPE_EPPI, |
| 74 | PPI_TYPE_EPPI3, | ||
| 54 | }; | 75 | }; |
| 55 | 76 | ||
| 56 | struct ppi_info { | 77 | struct ppi_info { |
| @@ -65,7 +86,8 @@ struct ppi_if { | |||
| 65 | unsigned long ppi_control; | 86 | unsigned long ppi_control; |
| 66 | const struct ppi_ops *ops; | 87 | const struct ppi_ops *ops; |
| 67 | const struct ppi_info *info; | 88 | const struct ppi_info *info; |
| 68 | bool err_int; | 89 | bool err_int; /* if we need request error interrupt */ |
| 90 | bool err; /* if ppi has fifo error */ | ||
| 69 | void *priv; | 91 | void *priv; |
| 70 | }; | 92 | }; |
| 71 | 93 | ||
diff --git a/include/media/davinci/vpbe_osd.h b/include/media/davinci/vpbe_osd.h index 5ab0d8d41f68..42628fcfe1bd 100644 --- a/include/media/davinci/vpbe_osd.h +++ b/include/media/davinci/vpbe_osd.h | |||
| @@ -26,7 +26,9 @@ | |||
| 26 | 26 | ||
| 27 | #include <media/davinci/vpbe_types.h> | 27 | #include <media/davinci/vpbe_types.h> |
| 28 | 28 | ||
| 29 | #define VPBE_OSD_SUBDEV_NAME "vpbe-osd" | 29 | #define DM644X_VPBE_OSD_SUBDEV_NAME "dm644x,vpbe-osd" |
| 30 | #define DM365_VPBE_OSD_SUBDEV_NAME "dm365,vpbe-osd" | ||
| 31 | #define DM355_VPBE_OSD_SUBDEV_NAME "dm355,vpbe-osd" | ||
| 30 | 32 | ||
| 31 | /** | 33 | /** |
| 32 | * enum osd_layer | 34 | * enum osd_layer |
| @@ -387,7 +389,6 @@ struct osd_state { | |||
| 387 | }; | 389 | }; |
| 388 | 390 | ||
| 389 | struct osd_platform_data { | 391 | struct osd_platform_data { |
| 390 | enum vpbe_version vpbe_type; | ||
| 391 | int field_inv_wa_enable; | 392 | int field_inv_wa_enable; |
| 392 | }; | 393 | }; |
| 393 | 394 | ||
diff --git a/include/media/davinci/vpbe_venc.h b/include/media/davinci/vpbe_venc.h index cc78c2eb16da..476fafc2f522 100644 --- a/include/media/davinci/vpbe_venc.h +++ b/include/media/davinci/vpbe_venc.h | |||
| @@ -20,7 +20,9 @@ | |||
| 20 | #include <media/v4l2-subdev.h> | 20 | #include <media/v4l2-subdev.h> |
| 21 | #include <media/davinci/vpbe_types.h> | 21 | #include <media/davinci/vpbe_types.h> |
| 22 | 22 | ||
| 23 | #define VPBE_VENC_SUBDEV_NAME "vpbe-venc" | 23 | #define DM644X_VPBE_VENC_SUBDEV_NAME "dm644x,vpbe-venc" |
| 24 | #define DM365_VPBE_VENC_SUBDEV_NAME "dm365,vpbe-venc" | ||
| 25 | #define DM355_VPBE_VENC_SUBDEV_NAME "dm355,vpbe-venc" | ||
| 24 | 26 | ||
| 25 | /* venc events */ | 27 | /* venc events */ |
| 26 | #define VENC_END_OF_FRAME BIT(0) | 28 | #define VENC_END_OF_FRAME BIT(0) |
| @@ -28,7 +30,6 @@ | |||
| 28 | #define VENC_SECOND_FIELD BIT(2) | 30 | #define VENC_SECOND_FIELD BIT(2) |
| 29 | 31 | ||
| 30 | struct venc_platform_data { | 32 | struct venc_platform_data { |
| 31 | enum vpbe_version venc_type; | ||
| 32 | int (*setup_pinmux)(enum v4l2_mbus_pixelcode if_type, | 33 | int (*setup_pinmux)(enum v4l2_mbus_pixelcode if_type, |
| 33 | int field); | 34 | int field); |
| 34 | int (*setup_clock)(enum vpbe_enc_timings_type type, | 35 | int (*setup_clock)(enum vpbe_enc_timings_type type, |
diff --git a/include/media/davinci/vpss.h b/include/media/davinci/vpss.h index b586495bcd53..153473daaa32 100644 --- a/include/media/davinci/vpss.h +++ b/include/media/davinci/vpss.h | |||
| @@ -105,4 +105,20 @@ enum vpss_wbl_sel { | |||
| 105 | }; | 105 | }; |
| 106 | /* clear wbl overflow flag for DM6446 */ | 106 | /* clear wbl overflow flag for DM6446 */ |
| 107 | int vpss_clear_wbl_overflow(enum vpss_wbl_sel wbl_sel); | 107 | int vpss_clear_wbl_overflow(enum vpss_wbl_sel wbl_sel); |
| 108 | |||
| 109 | /* set sync polarity*/ | ||
| 110 | void vpss_set_sync_pol(struct vpss_sync_pol sync); | ||
| 111 | /* set the PG_FRAME_SIZE register */ | ||
| 112 | void vpss_set_pg_frame_size(struct vpss_pg_frame_size frame_size); | ||
| 113 | /* | ||
| 114 | * vpss_check_and_clear_interrupt - check and clear interrupt | ||
| 115 | * @irq - common enumerator for IRQ | ||
| 116 | * | ||
| 117 | * Following return values used:- | ||
| 118 | * 0 - interrupt occurred and cleared | ||
| 119 | * 1 - interrupt not occurred | ||
| 120 | * 2 - interrupt status not available | ||
| 121 | */ | ||
| 122 | int vpss_dma_complete_interrupt(void); | ||
| 123 | |||
| 108 | #endif | 124 | #endif |
diff --git a/include/media/ov7670.h b/include/media/ov7670.h index b133bc123031..1913d5123072 100644 --- a/include/media/ov7670.h +++ b/include/media/ov7670.h | |||
| @@ -15,6 +15,8 @@ struct ov7670_config { | |||
| 15 | int min_height; /* Filter out smaller sizes */ | 15 | int min_height; /* Filter out smaller sizes */ |
| 16 | int clock_speed; /* External clock speed (MHz) */ | 16 | int clock_speed; /* External clock speed (MHz) */ |
| 17 | bool use_smbus; /* Use smbus I/O instead of I2C */ | 17 | bool use_smbus; /* Use smbus I/O instead of I2C */ |
| 18 | bool pll_bypass; /* Choose whether to bypass the PLL */ | ||
| 19 | bool pclk_hb_disable; /* Disable toggling pixclk during horizontal blanking */ | ||
| 18 | }; | 20 | }; |
| 19 | 21 | ||
| 20 | #endif | 22 | #endif |
diff --git a/include/media/ov9650.h b/include/media/ov9650.h new file mode 100644 index 000000000000..d630cf9e028d --- /dev/null +++ b/include/media/ov9650.h | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | /* | ||
| 2 | * OV9650/OV9652 camera sensors driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2013 Sylwester Nawrocki <sylvester.nawrocki@gmail.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 version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | #ifndef OV9650_H_ | ||
| 11 | #define OV9650_H_ | ||
| 12 | |||
| 13 | /** | ||
| 14 | * struct ov9650_platform_data - ov9650 driver platform data | ||
| 15 | * @mclk_frequency: the sensor's master clock frequency in Hz | ||
| 16 | * @gpio_pwdn: number of a GPIO connected to OV965X PWDN pin | ||
| 17 | * @gpio_reset: number of a GPIO connected to OV965X RESET pin | ||
| 18 | * | ||
| 19 | * If any of @gpio_pwdn or @gpio_reset are unused then they should be | ||
| 20 | * set to a negative value. @mclk_frequency must always be specified. | ||
| 21 | */ | ||
| 22 | struct ov9650_platform_data { | ||
| 23 | unsigned long mclk_frequency; | ||
| 24 | int gpio_pwdn; | ||
| 25 | int gpio_reset; | ||
| 26 | }; | ||
| 27 | #endif /* OV9650_H_ */ | ||
diff --git a/include/media/rc-map.h b/include/media/rc-map.h index 74f55a3f14eb..f74ee6f89711 100644 --- a/include/media/rc-map.h +++ b/include/media/rc-map.h | |||
| @@ -182,6 +182,7 @@ void rc_map_init(void); | |||
| 182 | #define RC_MAP_TEVII_NEC "rc-tevii-nec" | 182 | #define RC_MAP_TEVII_NEC "rc-tevii-nec" |
| 183 | #define RC_MAP_TIVO "rc-tivo" | 183 | #define RC_MAP_TIVO "rc-tivo" |
| 184 | #define RC_MAP_TOTAL_MEDIA_IN_HAND "rc-total-media-in-hand" | 184 | #define RC_MAP_TOTAL_MEDIA_IN_HAND "rc-total-media-in-hand" |
| 185 | #define RC_MAP_TOTAL_MEDIA_IN_HAND_02 "rc-total-media-in-hand-02" | ||
| 185 | #define RC_MAP_TREKSTOR "rc-trekstor" | 186 | #define RC_MAP_TREKSTOR "rc-trekstor" |
| 186 | #define RC_MAP_TT_1500 "rc-tt-1500" | 187 | #define RC_MAP_TT_1500 "rc-tt-1500" |
| 187 | #define RC_MAP_TWINHAN_VP1027_DVBS "rc-twinhan1027" | 188 | #define RC_MAP_TWINHAN_VP1027_DVBS "rc-twinhan1027" |
diff --git a/include/media/s5c73m3.h b/include/media/s5c73m3.h new file mode 100644 index 000000000000..ccb9e5448762 --- /dev/null +++ b/include/media/s5c73m3.h | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | /* | ||
| 2 | * Samsung LSI S5C73M3 8M pixel camera driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2012, Samsung Electronics, Co., Ltd. | ||
| 5 | * Sylwester Nawrocki <s.nawrocki@samsung.com> | ||
| 6 | * Andrzej Hajda <a.hajda@samsung.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or | ||
| 9 | * modify it under the terms of the GNU General Public License | ||
| 10 | * version 2 as published by the Free Software Foundation. | ||
| 11 | * | ||
| 12 | * This program is free software; you can redistribute it and/or modify | ||
| 13 | * it under the terms of the GNU General Public License as published by | ||
| 14 | * the Free Software Foundation; either version 2 of the License, or | ||
| 15 | * (at your option) any later version. | ||
| 16 | */ | ||
| 17 | #ifndef MEDIA_S5C73M3__ | ||
| 18 | #define MEDIA_S5C73M3__ | ||
| 19 | |||
| 20 | #include <linux/videodev2.h> | ||
| 21 | #include <media/v4l2-mediabus.h> | ||
| 22 | |||
| 23 | /** | ||
| 24 | * struct s5c73m3_gpio - data structure describing a GPIO | ||
| 25 | * @gpio: GPIO number | ||
| 26 | * @level: indicates active state of the @gpio | ||
| 27 | */ | ||
| 28 | struct s5c73m3_gpio { | ||
| 29 | int gpio; | ||
| 30 | int level; | ||
| 31 | }; | ||
| 32 | |||
| 33 | /** | ||
| 34 | * struct s5c73m3_platform_data - s5c73m3 driver platform data | ||
| 35 | * @mclk_frequency: sensor's master clock frequency in Hz | ||
| 36 | * @gpio_reset: GPIO driving RESET pin | ||
| 37 | * @gpio_stby: GPIO driving STBY pin | ||
| 38 | * @nlanes: maximum number of MIPI-CSI lanes used | ||
| 39 | * @horiz_flip: default horizontal image flip value, non zero to enable | ||
| 40 | * @vert_flip: default vertical image flip value, non zero to enable | ||
| 41 | */ | ||
| 42 | |||
| 43 | struct s5c73m3_platform_data { | ||
| 44 | unsigned long mclk_frequency; | ||
| 45 | |||
| 46 | struct s5c73m3_gpio gpio_reset; | ||
| 47 | struct s5c73m3_gpio gpio_stby; | ||
| 48 | |||
| 49 | enum v4l2_mbus_type bus_type; | ||
| 50 | u8 nlanes; | ||
| 51 | u8 horiz_flip; | ||
| 52 | u8 vert_flip; | ||
| 53 | }; | ||
| 54 | |||
| 55 | #endif /* MEDIA_S5C73M3__ */ | ||
diff --git a/include/media/s5p_fimc.h b/include/media/s5p_fimc.h index eaea62a382f8..28f3590aa031 100644 --- a/include/media/s5p_fimc.h +++ b/include/media/s5p_fimc.h | |||
| @@ -1,8 +1,8 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Samsung S5P SoC camera interface driver header | 2 | * Samsung S5P/Exynos4 SoC series camera interface driver header |
| 3 | * | 3 | * |
| 4 | * Copyright (c) 2010 Samsung Electronics Co., Ltd | 4 | * Copyright (C) 2010 - 2013 Samsung Electronics Co., Ltd. |
| 5 | * Author: Sylwester Nawrocki, <s.nawrocki@samsung.com> | 5 | * Sylwester Nawrocki <s.nawrocki@samsung.com> |
| 6 | * | 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License version 2 as | 8 | * it under the terms of the GNU General Public License version 2 as |
| @@ -14,45 +14,58 @@ | |||
| 14 | 14 | ||
| 15 | #include <media/media-entity.h> | 15 | #include <media/media-entity.h> |
| 16 | 16 | ||
| 17 | enum cam_bus_type { | 17 | /* |
| 18 | FIMC_ITU_601 = 1, | 18 | * Enumeration of the FIMC data bus types. |
| 19 | FIMC_ITU_656, | 19 | */ |
| 20 | FIMC_MIPI_CSI2, | 20 | enum fimc_bus_type { |
| 21 | FIMC_LCD_WB, /* FIFO link from LCD mixer */ | 21 | /* Camera parallel bus */ |
| 22 | FIMC_BUS_TYPE_ITU_601 = 1, | ||
| 23 | /* Camera parallel bus with embedded synchronization */ | ||
| 24 | FIMC_BUS_TYPE_ITU_656, | ||
| 25 | /* Camera MIPI-CSI2 serial bus */ | ||
| 26 | FIMC_BUS_TYPE_MIPI_CSI2, | ||
| 27 | /* FIFO link from LCD controller (WriteBack A) */ | ||
| 28 | FIMC_BUS_TYPE_LCD_WRITEBACK_A, | ||
| 29 | /* FIFO link from LCD controller (WriteBack B) */ | ||
| 30 | FIMC_BUS_TYPE_LCD_WRITEBACK_B, | ||
| 31 | /* FIFO link from FIMC-IS */ | ||
| 32 | FIMC_BUS_TYPE_ISP_WRITEBACK = FIMC_BUS_TYPE_LCD_WRITEBACK_B, | ||
| 22 | }; | 33 | }; |
| 23 | 34 | ||
| 24 | struct i2c_board_info; | 35 | struct i2c_board_info; |
| 25 | 36 | ||
| 26 | /** | 37 | /** |
| 27 | * struct s5p_fimc_isp_info - image sensor information required for host | 38 | * struct fimc_source_info - video source description required for the host |
| 28 | * interace configuration. | 39 | * interface configuration |
| 29 | * | 40 | * |
| 30 | * @board_info: pointer to I2C subdevice's board info | 41 | * @board_info: pointer to I2C subdevice's board info |
| 31 | * @clk_frequency: frequency of the clock the host interface provides to sensor | 42 | * @clk_frequency: frequency of the clock the host interface provides to sensor |
| 32 | * @bus_type: determines bus type, MIPI, ITU-R BT.601 etc. | 43 | * @fimc_bus_type: FIMC camera input type |
| 44 | * @sensor_bus_type: image sensor bus type, MIPI, ITU-R BT.601 etc. | ||
| 45 | * @flags: the parallel sensor bus flags defining signals polarity (V4L2_MBUS_*) | ||
| 33 | * @i2c_bus_num: i2c control bus id the sensor is attached to | 46 | * @i2c_bus_num: i2c control bus id the sensor is attached to |
| 34 | * @mux_id: FIMC camera interface multiplexer index (separate for MIPI and ITU) | 47 | * @mux_id: FIMC camera interface multiplexer index (separate for MIPI and ITU) |
| 35 | * @clk_id: index of the SoC peripheral clock for sensors | 48 | * @clk_id: index of the SoC peripheral clock for sensors |
| 36 | * @flags: the parallel bus flags defining signals polarity (V4L2_MBUS_*) | ||
| 37 | */ | 49 | */ |
| 38 | struct s5p_fimc_isp_info { | 50 | struct fimc_source_info { |
| 39 | struct i2c_board_info *board_info; | 51 | struct i2c_board_info *board_info; |
| 40 | unsigned long clk_frequency; | 52 | unsigned long clk_frequency; |
| 41 | enum cam_bus_type bus_type; | 53 | enum fimc_bus_type fimc_bus_type; |
| 54 | enum fimc_bus_type sensor_bus_type; | ||
| 55 | u16 flags; | ||
| 42 | u16 i2c_bus_num; | 56 | u16 i2c_bus_num; |
| 43 | u16 mux_id; | 57 | u16 mux_id; |
| 44 | u16 flags; | ||
| 45 | u8 clk_id; | 58 | u8 clk_id; |
| 46 | }; | 59 | }; |
| 47 | 60 | ||
| 48 | /** | 61 | /** |
| 49 | * struct s5p_platform_fimc - camera host interface platform data | 62 | * struct s5p_platform_fimc - camera host interface platform data |
| 50 | * | 63 | * |
| 51 | * @isp_info: properties of camera sensor required for host interface setup | 64 | * @source_info: properties of an image source for the host interface setup |
| 52 | * @num_clients: the number of attached image sensors | 65 | * @num_clients: the number of attached image sources |
| 53 | */ | 66 | */ |
| 54 | struct s5p_platform_fimc { | 67 | struct s5p_platform_fimc { |
| 55 | struct s5p_fimc_isp_info *isp_info; | 68 | struct fimc_source_info *source_info; |
| 56 | int num_clients; | 69 | int num_clients; |
| 57 | }; | 70 | }; |
| 58 | 71 | ||
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index 6442edc2a151..2cc70cf318bf 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h | |||
| @@ -23,11 +23,11 @@ | |||
| 23 | #include <media/v4l2-device.h> | 23 | #include <media/v4l2-device.h> |
| 24 | 24 | ||
| 25 | struct file; | 25 | struct file; |
| 26 | struct soc_camera_link; | 26 | struct soc_camera_desc; |
| 27 | 27 | ||
| 28 | struct soc_camera_device { | 28 | struct soc_camera_device { |
| 29 | struct list_head list; /* list of all registered devices */ | 29 | struct list_head list; /* list of all registered devices */ |
| 30 | struct soc_camera_link *link; | 30 | struct soc_camera_desc *sdesc; |
| 31 | struct device *pdev; /* Platform device */ | 31 | struct device *pdev; /* Platform device */ |
| 32 | struct device *parent; /* Camera host device */ | 32 | struct device *parent; /* Camera host device */ |
| 33 | struct device *control; /* E.g., the i2c client */ | 33 | struct device *control; /* E.g., the i2c client */ |
| @@ -46,9 +46,8 @@ struct soc_camera_device { | |||
| 46 | int num_user_formats; | 46 | int num_user_formats; |
| 47 | enum v4l2_field field; /* Preserve field over close() */ | 47 | enum v4l2_field field; /* Preserve field over close() */ |
| 48 | void *host_priv; /* Per-device host private data */ | 48 | void *host_priv; /* Per-device host private data */ |
| 49 | /* soc_camera.c private count. Only accessed with .video_lock held */ | 49 | /* soc_camera.c private count. Only accessed with .host_lock held */ |
| 50 | int use_count; | 50 | int use_count; |
| 51 | struct mutex video_lock; /* Protects device data */ | ||
| 52 | struct file *streamer; /* stream owner */ | 51 | struct file *streamer; /* stream owner */ |
| 53 | union { | 52 | union { |
| 54 | struct videobuf_queue vb_vidq; | 53 | struct videobuf_queue vb_vidq; |
| @@ -62,7 +61,7 @@ struct soc_camera_device { | |||
| 62 | struct soc_camera_host { | 61 | struct soc_camera_host { |
| 63 | struct v4l2_device v4l2_dev; | 62 | struct v4l2_device v4l2_dev; |
| 64 | struct list_head list; | 63 | struct list_head list; |
| 65 | struct mutex host_lock; /* Protect during probing */ | 64 | struct mutex host_lock; /* Protect pipeline modifications */ |
| 66 | unsigned char nr; /* Host number */ | 65 | unsigned char nr; /* Host number */ |
| 67 | u32 capabilities; | 66 | u32 capabilities; |
| 68 | void *priv; | 67 | void *priv; |
| @@ -117,26 +116,72 @@ struct soc_camera_host_ops { | |||
| 117 | struct i2c_board_info; | 116 | struct i2c_board_info; |
| 118 | struct regulator_bulk_data; | 117 | struct regulator_bulk_data; |
| 119 | 118 | ||
| 120 | struct soc_camera_link { | 119 | struct soc_camera_subdev_desc { |
| 121 | /* Camera bus id, used to match a camera and a bus */ | ||
| 122 | int bus_id; | ||
| 123 | /* Per camera SOCAM_SENSOR_* bus flags */ | 120 | /* Per camera SOCAM_SENSOR_* bus flags */ |
| 124 | unsigned long flags; | 121 | unsigned long flags; |
| 125 | int i2c_adapter_id; | 122 | |
| 126 | struct i2c_board_info *board_info; | 123 | /* sensor driver private platform data */ |
| 127 | const char *module_name; | 124 | void *drv_priv; |
| 128 | void *priv; | ||
| 129 | 125 | ||
| 130 | /* Optional regulators that have to be managed on power on/off events */ | 126 | /* Optional regulators that have to be managed on power on/off events */ |
| 131 | struct regulator_bulk_data *regulators; | 127 | struct regulator_bulk_data *regulators; |
| 132 | int num_regulators; | 128 | int num_regulators; |
| 133 | 129 | ||
| 130 | /* Optional callbacks to power on or off and reset the sensor */ | ||
| 131 | int (*power)(struct device *, int); | ||
| 132 | int (*reset)(struct device *); | ||
| 133 | |||
| 134 | /* | ||
| 135 | * some platforms may support different data widths than the sensors | ||
| 136 | * native ones due to different data line routing. Let the board code | ||
| 137 | * overwrite the width flags. | ||
| 138 | */ | ||
| 139 | int (*set_bus_param)(struct soc_camera_subdev_desc *, unsigned long flags); | ||
| 140 | unsigned long (*query_bus_param)(struct soc_camera_subdev_desc *); | ||
| 141 | void (*free_bus)(struct soc_camera_subdev_desc *); | ||
| 142 | }; | ||
| 143 | |||
| 144 | struct soc_camera_host_desc { | ||
| 145 | /* Camera bus id, used to match a camera and a bus */ | ||
| 146 | int bus_id; | ||
| 147 | int i2c_adapter_id; | ||
| 148 | struct i2c_board_info *board_info; | ||
| 149 | const char *module_name; | ||
| 150 | |||
| 134 | /* | 151 | /* |
| 135 | * For non-I2C devices platform has to provide methods to add a device | 152 | * For non-I2C devices platform has to provide methods to add a device |
| 136 | * to the system and to remove it | 153 | * to the system and to remove it |
| 137 | */ | 154 | */ |
| 138 | int (*add_device)(struct soc_camera_device *); | 155 | int (*add_device)(struct soc_camera_device *); |
| 139 | void (*del_device)(struct soc_camera_device *); | 156 | void (*del_device)(struct soc_camera_device *); |
| 157 | }; | ||
| 158 | |||
| 159 | /* | ||
| 160 | * This MUST be kept binary-identical to struct soc_camera_link below, until | ||
| 161 | * it is completely replaced by this one, after which we can split it into its | ||
| 162 | * two components. | ||
| 163 | */ | ||
| 164 | struct soc_camera_desc { | ||
| 165 | struct soc_camera_subdev_desc subdev_desc; | ||
| 166 | struct soc_camera_host_desc host_desc; | ||
| 167 | }; | ||
| 168 | |||
| 169 | /* Prepare to replace this struct: don't change its layout any more! */ | ||
| 170 | struct soc_camera_link { | ||
| 171 | /* | ||
| 172 | * Subdevice part - keep at top and compatible to | ||
| 173 | * struct soc_camera_subdev_desc | ||
| 174 | */ | ||
| 175 | |||
| 176 | /* Per camera SOCAM_SENSOR_* bus flags */ | ||
| 177 | unsigned long flags; | ||
| 178 | |||
| 179 | void *priv; | ||
| 180 | |||
| 181 | /* Optional regulators that have to be managed on power on/off events */ | ||
| 182 | struct regulator_bulk_data *regulators; | ||
| 183 | int num_regulators; | ||
| 184 | |||
| 140 | /* Optional callbacks to power on or off and reset the sensor */ | 185 | /* Optional callbacks to power on or off and reset the sensor */ |
| 141 | int (*power)(struct device *, int); | 186 | int (*power)(struct device *, int); |
| 142 | int (*reset)(struct device *); | 187 | int (*reset)(struct device *); |
| @@ -148,6 +193,24 @@ struct soc_camera_link { | |||
| 148 | int (*set_bus_param)(struct soc_camera_link *, unsigned long flags); | 193 | int (*set_bus_param)(struct soc_camera_link *, unsigned long flags); |
| 149 | unsigned long (*query_bus_param)(struct soc_camera_link *); | 194 | unsigned long (*query_bus_param)(struct soc_camera_link *); |
| 150 | void (*free_bus)(struct soc_camera_link *); | 195 | void (*free_bus)(struct soc_camera_link *); |
| 196 | |||
| 197 | /* | ||
| 198 | * Host part - keep at bottom and compatible to | ||
| 199 | * struct soc_camera_host_desc | ||
| 200 | */ | ||
| 201 | |||
| 202 | /* Camera bus id, used to match a camera and a bus */ | ||
| 203 | int bus_id; | ||
| 204 | int i2c_adapter_id; | ||
| 205 | struct i2c_board_info *board_info; | ||
| 206 | const char *module_name; | ||
| 207 | |||
| 208 | /* | ||
| 209 | * For non-I2C devices platform has to provide methods to add a device | ||
| 210 | * to the system and to remove it | ||
| 211 | */ | ||
| 212 | int (*add_device)(struct soc_camera_device *); | ||
| 213 | void (*del_device)(struct soc_camera_device *); | ||
| 151 | }; | 214 | }; |
| 152 | 215 | ||
| 153 | static inline struct soc_camera_host *to_soc_camera_host( | 216 | static inline struct soc_camera_host *to_soc_camera_host( |
| @@ -158,10 +221,10 @@ static inline struct soc_camera_host *to_soc_camera_host( | |||
| 158 | return container_of(v4l2_dev, struct soc_camera_host, v4l2_dev); | 221 | return container_of(v4l2_dev, struct soc_camera_host, v4l2_dev); |
| 159 | } | 222 | } |
| 160 | 223 | ||
| 161 | static inline struct soc_camera_link *to_soc_camera_link( | 224 | static inline struct soc_camera_desc *to_soc_camera_desc( |
| 162 | const struct soc_camera_device *icd) | 225 | const struct soc_camera_device *icd) |
| 163 | { | 226 | { |
| 164 | return icd->link; | 227 | return icd->sdesc; |
| 165 | } | 228 | } |
| 166 | 229 | ||
| 167 | static inline struct device *to_soc_camera_control( | 230 | static inline struct device *to_soc_camera_control( |
| @@ -251,19 +314,17 @@ static inline void soc_camera_limit_side(int *start, int *length, | |||
| 251 | *start = start_min + length_max - *length; | 314 | *start = start_min + length_max - *length; |
| 252 | } | 315 | } |
| 253 | 316 | ||
| 254 | unsigned long soc_camera_apply_sensor_flags(struct soc_camera_link *icl, | 317 | unsigned long soc_camera_apply_board_flags(struct soc_camera_subdev_desc *ssdd, |
| 255 | unsigned long flags); | ||
| 256 | unsigned long soc_camera_apply_board_flags(struct soc_camera_link *icl, | ||
| 257 | const struct v4l2_mbus_config *cfg); | 318 | const struct v4l2_mbus_config *cfg); |
| 258 | 319 | ||
| 259 | int soc_camera_power_on(struct device *dev, struct soc_camera_link *icl); | 320 | int soc_camera_power_on(struct device *dev, struct soc_camera_subdev_desc *ssdd); |
| 260 | int soc_camera_power_off(struct device *dev, struct soc_camera_link *icl); | 321 | int soc_camera_power_off(struct device *dev, struct soc_camera_subdev_desc *ssdd); |
| 261 | 322 | ||
| 262 | static inline int soc_camera_set_power(struct device *dev, | 323 | static inline int soc_camera_set_power(struct device *dev, |
| 263 | struct soc_camera_link *icl, bool on) | 324 | struct soc_camera_subdev_desc *ssdd, bool on) |
| 264 | { | 325 | { |
| 265 | return on ? soc_camera_power_on(dev, icl) | 326 | return on ? soc_camera_power_on(dev, ssdd) |
| 266 | : soc_camera_power_off(dev, icl); | 327 | : soc_camera_power_off(dev, ssdd); |
| 267 | } | 328 | } |
| 268 | 329 | ||
| 269 | /* This is only temporary here - until v4l2-subdev begins to link to video_device */ | 330 | /* This is only temporary here - until v4l2-subdev begins to link to video_device */ |
| @@ -275,7 +336,7 @@ static inline struct video_device *soc_camera_i2c_to_vdev(const struct i2c_clien | |||
| 275 | return icd ? icd->vdev : NULL; | 336 | return icd ? icd->vdev : NULL; |
| 276 | } | 337 | } |
| 277 | 338 | ||
| 278 | static inline struct soc_camera_link *soc_camera_i2c_to_link(const struct i2c_client *client) | 339 | static inline struct soc_camera_subdev_desc *soc_camera_i2c_to_desc(const struct i2c_client *client) |
| 279 | { | 340 | { |
| 280 | return client->dev.platform_data; | 341 | return client->dev.platform_data; |
| 281 | } | 342 | } |
diff --git a/include/media/soc_camera_platform.h b/include/media/soc_camera_platform.h index 8aa4200a0b1d..1e5065dab430 100644 --- a/include/media/soc_camera_platform.h +++ b/include/media/soc_camera_platform.h | |||
| @@ -38,10 +38,12 @@ static inline int soc_camera_platform_add(struct soc_camera_device *icd, | |||
| 38 | void (*release)(struct device *dev), | 38 | void (*release)(struct device *dev), |
| 39 | int id) | 39 | int id) |
| 40 | { | 40 | { |
| 41 | struct soc_camera_platform_info *info = plink->priv; | 41 | struct soc_camera_subdev_desc *ssdd = |
| 42 | (struct soc_camera_subdev_desc *)plink; | ||
| 43 | struct soc_camera_platform_info *info = ssdd->drv_priv; | ||
| 42 | int ret; | 44 | int ret; |
| 43 | 45 | ||
| 44 | if (icd->link != plink) | 46 | if (&icd->sdesc->subdev_desc != ssdd) |
| 45 | return -ENODEV; | 47 | return -ENODEV; |
| 46 | 48 | ||
| 47 | if (*pdev) | 49 | if (*pdev) |
| @@ -70,7 +72,9 @@ static inline void soc_camera_platform_del(const struct soc_camera_device *icd, | |||
| 70 | struct platform_device *pdev, | 72 | struct platform_device *pdev, |
| 71 | const struct soc_camera_link *plink) | 73 | const struct soc_camera_link *plink) |
| 72 | { | 74 | { |
| 73 | if (icd->link != plink || !pdev) | 75 | const struct soc_camera_subdev_desc *ssdd = |
| 76 | (const struct soc_camera_subdev_desc *)plink; | ||
| 77 | if (&icd->sdesc->subdev_desc != ssdd || !pdev) | ||
| 74 | return; | 78 | return; |
| 75 | 79 | ||
| 76 | platform_device_unregister(pdev); | 80 | platform_device_unregister(pdev); |
diff --git a/include/media/tvp514x.h b/include/media/tvp514x.h index 74387e83f5b9..86ed7e806830 100644 --- a/include/media/tvp514x.h +++ b/include/media/tvp514x.h | |||
| @@ -96,12 +96,9 @@ enum tvp514x_output { | |||
| 96 | 96 | ||
| 97 | /** | 97 | /** |
| 98 | * struct tvp514x_platform_data - Platform data values and access functions. | 98 | * struct tvp514x_platform_data - Platform data values and access functions. |
| 99 | * @power_set: Power state access function, zero is off, non-zero is on. | ||
| 100 | * @ifparm: Interface parameters access function. | ||
| 101 | * @priv_data_set: Device private data (pointer) access function. | ||
| 102 | * @clk_polarity: Clock polarity of the current interface. | 99 | * @clk_polarity: Clock polarity of the current interface. |
| 103 | * @ hs_polarity: HSYNC Polarity configuration for current interface. | 100 | * @hs_polarity: HSYNC Polarity configuration for current interface. |
| 104 | * @ vs_polarity: VSYNC Polarity configuration for current interface. | 101 | * @vs_polarity: VSYNC Polarity configuration for current interface. |
| 105 | */ | 102 | */ |
| 106 | struct tvp514x_platform_data { | 103 | struct tvp514x_platform_data { |
| 107 | /* Interface control params */ | 104 | /* Interface control params */ |
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index 1a0b2db4c5d3..ec7c9c00b256 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
| @@ -225,4 +225,6 @@ bool v4l2_detect_gtf(unsigned frame_height, unsigned hfreq, unsigned vsync, | |||
| 225 | 225 | ||
| 226 | struct v4l2_fract v4l2_calc_aspect_ratio(u8 hor_landscape, u8 vert_portrait); | 226 | struct v4l2_fract v4l2_calc_aspect_ratio(u8 hor_landscape, u8 vert_portrait); |
| 227 | 227 | ||
| 228 | void v4l2_get_timestamp(struct timeval *tv); | ||
| 229 | |||
| 228 | #endif /* V4L2_COMMON_H_ */ | 230 | #endif /* V4L2_COMMON_H_ */ |
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index 96509119f28f..f00d42bc01a6 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h | |||
| @@ -53,6 +53,8 @@ struct v4l2_ctrl_ops { | |||
| 53 | int (*s_ctrl)(struct v4l2_ctrl *ctrl); | 53 | int (*s_ctrl)(struct v4l2_ctrl *ctrl); |
| 54 | }; | 54 | }; |
| 55 | 55 | ||
| 56 | typedef void (*v4l2_ctrl_notify_fnc)(struct v4l2_ctrl *ctrl, void *priv); | ||
| 57 | |||
| 56 | /** struct v4l2_ctrl - The control structure. | 58 | /** struct v4l2_ctrl - The control structure. |
| 57 | * @node: The list node. | 59 | * @node: The list node. |
| 58 | * @ev_subs: The list of control event subscriptions. | 60 | * @ev_subs: The list of control event subscriptions. |
| @@ -72,6 +74,8 @@ struct v4l2_ctrl_ops { | |||
| 72 | * set this flag directly. | 74 | * set this flag directly. |
| 73 | * @has_volatiles: If set, then one or more members of the cluster are volatile. | 75 | * @has_volatiles: If set, then one or more members of the cluster are volatile. |
| 74 | * Drivers should never touch this flag. | 76 | * Drivers should never touch this flag. |
| 77 | * @call_notify: If set, then call the handler's notify function whenever the | ||
| 78 | * control's value changes. | ||
| 75 | * @manual_mode_value: If the is_auto flag is set, then this is the value | 79 | * @manual_mode_value: If the is_auto flag is set, then this is the value |
| 76 | * of the auto control that determines if that control is in | 80 | * of the auto control that determines if that control is in |
| 77 | * manual mode. So if the value of the auto control equals this | 81 | * manual mode. So if the value of the auto control equals this |
| @@ -119,6 +123,7 @@ struct v4l2_ctrl { | |||
| 119 | unsigned int is_private:1; | 123 | unsigned int is_private:1; |
| 120 | unsigned int is_auto:1; | 124 | unsigned int is_auto:1; |
| 121 | unsigned int has_volatiles:1; | 125 | unsigned int has_volatiles:1; |
| 126 | unsigned int call_notify:1; | ||
| 122 | unsigned int manual_mode_value:8; | 127 | unsigned int manual_mode_value:8; |
| 123 | 128 | ||
| 124 | const struct v4l2_ctrl_ops *ops; | 129 | const struct v4l2_ctrl_ops *ops; |
| @@ -177,6 +182,10 @@ struct v4l2_ctrl_ref { | |||
| 177 | * control is needed multiple times, so this is a simple | 182 | * control is needed multiple times, so this is a simple |
| 178 | * optimization. | 183 | * optimization. |
| 179 | * @buckets: Buckets for the hashing. Allows for quick control lookup. | 184 | * @buckets: Buckets for the hashing. Allows for quick control lookup. |
| 185 | * @notify: A notify callback that is called whenever the control changes value. | ||
| 186 | * Note that the handler's lock is held when the notify function | ||
| 187 | * is called! | ||
| 188 | * @notify_priv: Passed as argument to the v4l2_ctrl notify callback. | ||
| 180 | * @nr_of_buckets: Total number of buckets in the array. | 189 | * @nr_of_buckets: Total number of buckets in the array. |
| 181 | * @error: The error code of the first failed control addition. | 190 | * @error: The error code of the first failed control addition. |
| 182 | */ | 191 | */ |
| @@ -187,6 +196,8 @@ struct v4l2_ctrl_handler { | |||
| 187 | struct list_head ctrl_refs; | 196 | struct list_head ctrl_refs; |
| 188 | struct v4l2_ctrl_ref *cached; | 197 | struct v4l2_ctrl_ref *cached; |
| 189 | struct v4l2_ctrl_ref **buckets; | 198 | struct v4l2_ctrl_ref **buckets; |
| 199 | v4l2_ctrl_notify_fnc notify; | ||
| 200 | void *notify_priv; | ||
| 190 | u16 nr_of_buckets; | 201 | u16 nr_of_buckets; |
| 191 | int error; | 202 | int error; |
| 192 | }; | 203 | }; |
| @@ -507,6 +518,26 @@ void v4l2_ctrl_activate(struct v4l2_ctrl *ctrl, bool active); | |||
| 507 | */ | 518 | */ |
| 508 | void v4l2_ctrl_grab(struct v4l2_ctrl *ctrl, bool grabbed); | 519 | void v4l2_ctrl_grab(struct v4l2_ctrl *ctrl, bool grabbed); |
| 509 | 520 | ||
| 521 | /** v4l2_ctrl_modify_range() - Update the range of a control. | ||
| 522 | * @ctrl: The control to update. | ||
| 523 | * @min: The control's minimum value. | ||
| 524 | * @max: The control's maximum value. | ||
| 525 | * @step: The control's step value | ||
| 526 | * @def: The control's default value. | ||
| 527 | * | ||
| 528 | * Update the range of a control on the fly. This works for control types | ||
| 529 | * INTEGER, BOOLEAN, MENU, INTEGER MENU and BITMASK. For menu controls the | ||
| 530 | * @step value is interpreted as a menu_skip_mask. | ||
| 531 | * | ||
| 532 | * An error is returned if one of the range arguments is invalid for this | ||
| 533 | * control type. | ||
| 534 | * | ||
| 535 | * This function assumes that the control handler is not locked and will | ||
| 536 | * take the lock itself. | ||
| 537 | */ | ||
| 538 | int v4l2_ctrl_modify_range(struct v4l2_ctrl *ctrl, | ||
| 539 | s32 min, s32 max, u32 step, s32 def); | ||
| 540 | |||
| 510 | /** v4l2_ctrl_lock() - Helper function to lock the handler | 541 | /** v4l2_ctrl_lock() - Helper function to lock the handler |
| 511 | * associated with the control. | 542 | * associated with the control. |
| 512 | * @ctrl: The control to lock. | 543 | * @ctrl: The control to lock. |
| @@ -525,6 +556,20 @@ static inline void v4l2_ctrl_unlock(struct v4l2_ctrl *ctrl) | |||
| 525 | mutex_unlock(ctrl->handler->lock); | 556 | mutex_unlock(ctrl->handler->lock); |
| 526 | } | 557 | } |
| 527 | 558 | ||
| 559 | /** v4l2_ctrl_notify() - Function to set a notify callback for a control. | ||
| 560 | * @ctrl: The control. | ||
| 561 | * @notify: The callback function. | ||
| 562 | * @priv: The callback private handle, passed as argument to the callback. | ||
| 563 | * | ||
| 564 | * This function sets a callback function for the control. If @ctrl is NULL, | ||
| 565 | * then it will do nothing. If @notify is NULL, then the notify callback will | ||
| 566 | * be removed. | ||
| 567 | * | ||
| 568 | * There can be only one notify. If another already exists, then a WARN_ON | ||
| 569 | * will be issued and the function will do nothing. | ||
| 570 | */ | ||
| 571 | void v4l2_ctrl_notify(struct v4l2_ctrl *ctrl, v4l2_ctrl_notify_fnc notify, void *priv); | ||
| 572 | |||
| 528 | /** v4l2_ctrl_g_ctrl() - Helper function to get the control's value from within a driver. | 573 | /** v4l2_ctrl_g_ctrl() - Helper function to get the control's value from within a driver. |
| 529 | * @ctrl: The control. | 574 | * @ctrl: The control. |
| 530 | * | 575 | * |
| @@ -609,4 +654,12 @@ int v4l2_subdev_s_ext_ctrls(struct v4l2_subdev *sd, struct v4l2_ext_controls *cs | |||
| 609 | int v4l2_subdev_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl); | 654 | int v4l2_subdev_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl); |
| 610 | int v4l2_subdev_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl); | 655 | int v4l2_subdev_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl); |
| 611 | 656 | ||
| 657 | /* Can be used as a subscribe_event function that just subscribes control | ||
| 658 | events. */ | ||
| 659 | int v4l2_ctrl_subdev_subscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh, | ||
| 660 | struct v4l2_event_subscription *sub); | ||
| 661 | |||
| 662 | /* Log all controls owned by subdev's control handler. */ | ||
| 663 | int v4l2_ctrl_subdev_log_status(struct v4l2_subdev *sd); | ||
| 664 | |||
| 612 | #endif | 665 | #endif |
diff --git a/include/media/v4l2-event.h b/include/media/v4l2-event.h index eff85f934b24..be05d019de25 100644 --- a/include/media/v4l2-event.h +++ b/include/media/v4l2-event.h | |||
| @@ -64,6 +64,7 @@ | |||
| 64 | */ | 64 | */ |
| 65 | 65 | ||
| 66 | struct v4l2_fh; | 66 | struct v4l2_fh; |
| 67 | struct v4l2_subdev; | ||
| 67 | struct v4l2_subscribed_event; | 68 | struct v4l2_subscribed_event; |
| 68 | struct video_device; | 69 | struct video_device; |
| 69 | 70 | ||
| @@ -129,5 +130,6 @@ int v4l2_event_subscribe(struct v4l2_fh *fh, | |||
| 129 | int v4l2_event_unsubscribe(struct v4l2_fh *fh, | 130 | int v4l2_event_unsubscribe(struct v4l2_fh *fh, |
| 130 | const struct v4l2_event_subscription *sub); | 131 | const struct v4l2_event_subscription *sub); |
| 131 | void v4l2_event_unsubscribe_all(struct v4l2_fh *fh); | 132 | void v4l2_event_unsubscribe_all(struct v4l2_fh *fh); |
| 132 | 133 | int v4l2_event_subdev_unsubscribe(struct v4l2_subdev *sd, struct v4l2_fh *fh, | |
| 134 | struct v4l2_event_subscription *sub); | ||
| 133 | #endif /* V4L2_EVENT_H */ | 135 | #endif /* V4L2_EVENT_H */ |
diff --git a/include/media/v4l2-image-sizes.h b/include/media/v4l2-image-sizes.h new file mode 100644 index 000000000000..10daf92ff1ab --- /dev/null +++ b/include/media/v4l2-image-sizes.h | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | /* | ||
| 2 | * Standard image size definitions | ||
| 3 | * | ||
| 4 | * Copyright (C) 2013, Sylwester Nawrocki <sylvester.nawrocki@gmail.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 version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | #ifndef _IMAGE_SIZES_H | ||
| 11 | #define _IMAGE_SIZES_H | ||
| 12 | |||
| 13 | #define CIF_WIDTH 352 | ||
| 14 | #define CIF_HEIGHT 288 | ||
| 15 | |||
| 16 | #define QCIF_WIDTH 176 | ||
| 17 | #define QCIF_HEIGHT 144 | ||
| 18 | |||
| 19 | #define QQCIF_WIDTH 88 | ||
| 20 | #define QQCIF_HEIGHT 72 | ||
| 21 | |||
| 22 | #define QQVGA_WIDTH 160 | ||
| 23 | #define QQVGA_HEIGHT 120 | ||
| 24 | |||
| 25 | #define QVGA_WIDTH 320 | ||
| 26 | #define QVGA_HEIGHT 240 | ||
| 27 | |||
| 28 | #define SXGA_WIDTH 1280 | ||
| 29 | #define SXGA_HEIGHT 1024 | ||
| 30 | |||
| 31 | #define VGA_WIDTH 640 | ||
| 32 | #define VGA_HEIGHT 480 | ||
| 33 | |||
| 34 | #endif /* _IMAGE_SIZES_H */ | ||
diff --git a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h index 7e82d2b193d5..d3eef01da648 100644 --- a/include/media/v4l2-mem2mem.h +++ b/include/media/v4l2-mem2mem.h | |||
| @@ -125,7 +125,7 @@ unsigned int v4l2_m2m_poll(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, | |||
| 125 | int v4l2_m2m_mmap(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, | 125 | int v4l2_m2m_mmap(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, |
| 126 | struct vm_area_struct *vma); | 126 | struct vm_area_struct *vma); |
| 127 | 127 | ||
| 128 | struct v4l2_m2m_dev *v4l2_m2m_init(struct v4l2_m2m_ops *m2m_ops); | 128 | struct v4l2_m2m_dev *v4l2_m2m_init(const struct v4l2_m2m_ops *m2m_ops); |
| 129 | void v4l2_m2m_release(struct v4l2_m2m_dev *m2m_dev); | 129 | void v4l2_m2m_release(struct v4l2_m2m_dev *m2m_dev); |
| 130 | 130 | ||
| 131 | struct v4l2_m2m_ctx *v4l2_m2m_ctx_init(struct v4l2_m2m_dev *m2m_dev, | 131 | struct v4l2_m2m_ctx *v4l2_m2m_ctx_init(struct v4l2_m2m_dev *m2m_dev, |
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h index 7184853ca360..27dfe85772b1 100644 --- a/include/net/9p/9p.h +++ b/include/net/9p/9p.h | |||
| @@ -407,17 +407,17 @@ struct p9_wstat { | |||
| 407 | char *gid; | 407 | char *gid; |
| 408 | char *muid; | 408 | char *muid; |
| 409 | char *extension; /* 9p2000.u extensions */ | 409 | char *extension; /* 9p2000.u extensions */ |
| 410 | u32 n_uid; /* 9p2000.u extensions */ | 410 | kuid_t n_uid; /* 9p2000.u extensions */ |
| 411 | u32 n_gid; /* 9p2000.u extensions */ | 411 | kgid_t n_gid; /* 9p2000.u extensions */ |
| 412 | u32 n_muid; /* 9p2000.u extensions */ | 412 | kuid_t n_muid; /* 9p2000.u extensions */ |
| 413 | }; | 413 | }; |
| 414 | 414 | ||
| 415 | struct p9_stat_dotl { | 415 | struct p9_stat_dotl { |
| 416 | u64 st_result_mask; | 416 | u64 st_result_mask; |
| 417 | struct p9_qid qid; | 417 | struct p9_qid qid; |
| 418 | u32 st_mode; | 418 | u32 st_mode; |
| 419 | u32 st_uid; | 419 | kuid_t st_uid; |
| 420 | u32 st_gid; | 420 | kgid_t st_gid; |
| 421 | u64 st_nlink; | 421 | u64 st_nlink; |
| 422 | u64 st_rdev; | 422 | u64 st_rdev; |
| 423 | u64 st_size; | 423 | u64 st_size; |
| @@ -471,8 +471,8 @@ struct p9_stat_dotl { | |||
| 471 | struct p9_iattr_dotl { | 471 | struct p9_iattr_dotl { |
| 472 | u32 valid; | 472 | u32 valid; |
| 473 | u32 mode; | 473 | u32 mode; |
| 474 | u32 uid; | 474 | kuid_t uid; |
| 475 | u32 gid; | 475 | kgid_t gid; |
| 476 | u64 size; | 476 | u64 size; |
| 477 | u64 atime_sec; | 477 | u64 atime_sec; |
| 478 | u64 atime_nsec; | 478 | u64 atime_nsec; |
diff --git a/include/net/9p/client.h b/include/net/9p/client.h index fc9b90b0c052..4c7c01a73911 100644 --- a/include/net/9p/client.h +++ b/include/net/9p/client.h | |||
| @@ -187,12 +187,12 @@ struct p9_fid { | |||
| 187 | int mode; | 187 | int mode; |
| 188 | struct p9_qid qid; | 188 | struct p9_qid qid; |
| 189 | u32 iounit; | 189 | u32 iounit; |
| 190 | uid_t uid; | 190 | kuid_t uid; |
| 191 | 191 | ||
| 192 | void *rdir; | 192 | void *rdir; |
| 193 | 193 | ||
| 194 | struct list_head flist; | 194 | struct list_head flist; |
| 195 | struct list_head dlist; /* list of all fids attached to a dentry */ | 195 | struct hlist_node dlist; /* list of all fids attached to a dentry */ |
| 196 | }; | 196 | }; |
| 197 | 197 | ||
| 198 | /** | 198 | /** |
| @@ -220,17 +220,17 @@ void p9_client_destroy(struct p9_client *clnt); | |||
| 220 | void p9_client_disconnect(struct p9_client *clnt); | 220 | void p9_client_disconnect(struct p9_client *clnt); |
| 221 | void p9_client_begin_disconnect(struct p9_client *clnt); | 221 | void p9_client_begin_disconnect(struct p9_client *clnt); |
| 222 | struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid, | 222 | struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid, |
| 223 | char *uname, u32 n_uname, char *aname); | 223 | char *uname, kuid_t n_uname, char *aname); |
| 224 | struct p9_fid *p9_client_walk(struct p9_fid *oldfid, uint16_t nwname, | 224 | struct p9_fid *p9_client_walk(struct p9_fid *oldfid, uint16_t nwname, |
| 225 | char **wnames, int clone); | 225 | char **wnames, int clone); |
| 226 | int p9_client_open(struct p9_fid *fid, int mode); | 226 | int p9_client_open(struct p9_fid *fid, int mode); |
| 227 | int p9_client_fcreate(struct p9_fid *fid, char *name, u32 perm, int mode, | 227 | int p9_client_fcreate(struct p9_fid *fid, char *name, u32 perm, int mode, |
| 228 | char *extension); | 228 | char *extension); |
| 229 | int p9_client_link(struct p9_fid *fid, struct p9_fid *oldfid, char *newname); | 229 | int p9_client_link(struct p9_fid *fid, struct p9_fid *oldfid, char *newname); |
| 230 | int p9_client_symlink(struct p9_fid *fid, char *name, char *symname, gid_t gid, | 230 | int p9_client_symlink(struct p9_fid *fid, char *name, char *symname, kgid_t gid, |
| 231 | struct p9_qid *qid); | 231 | struct p9_qid *qid); |
| 232 | int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode, | 232 | int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode, |
| 233 | gid_t gid, struct p9_qid *qid); | 233 | kgid_t gid, struct p9_qid *qid); |
| 234 | int p9_client_clunk(struct p9_fid *fid); | 234 | int p9_client_clunk(struct p9_fid *fid); |
| 235 | int p9_client_fsync(struct p9_fid *fid, int datasync); | 235 | int p9_client_fsync(struct p9_fid *fid, int datasync); |
| 236 | int p9_client_remove(struct p9_fid *fid); | 236 | int p9_client_remove(struct p9_fid *fid); |
| @@ -250,9 +250,9 @@ struct p9_stat_dotl *p9_client_getattr_dotl(struct p9_fid *fid, | |||
| 250 | u64 request_mask); | 250 | u64 request_mask); |
| 251 | 251 | ||
| 252 | int p9_client_mknod_dotl(struct p9_fid *oldfid, char *name, int mode, | 252 | int p9_client_mknod_dotl(struct p9_fid *oldfid, char *name, int mode, |
| 253 | dev_t rdev, gid_t gid, struct p9_qid *); | 253 | dev_t rdev, kgid_t gid, struct p9_qid *); |
| 254 | int p9_client_mkdir_dotl(struct p9_fid *fid, char *name, int mode, | 254 | int p9_client_mkdir_dotl(struct p9_fid *fid, char *name, int mode, |
| 255 | gid_t gid, struct p9_qid *); | 255 | kgid_t gid, struct p9_qid *); |
| 256 | int p9_client_lock_dotl(struct p9_fid *fid, struct p9_flock *flock, u8 *status); | 256 | int p9_client_lock_dotl(struct p9_fid *fid, struct p9_flock *flock, u8 *status); |
| 257 | int p9_client_getlock_dotl(struct p9_fid *fid, struct p9_getlock *fl); | 257 | int p9_client_getlock_dotl(struct p9_fid *fid, struct p9_getlock *fl); |
| 258 | struct p9_req_t *p9_tag_lookup(struct p9_client *, u16); | 258 | struct p9_req_t *p9_tag_lookup(struct p9_client *, u16); |
diff --git a/include/net/ax25.h b/include/net/ax25.h index 53539acbd81a..89ed9ac5701f 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h | |||
| @@ -161,8 +161,8 @@ typedef struct ax25_uid_assoc { | |||
| 161 | ax25_address call; | 161 | ax25_address call; |
| 162 | } ax25_uid_assoc; | 162 | } ax25_uid_assoc; |
| 163 | 163 | ||
| 164 | #define ax25_uid_for_each(__ax25, node, list) \ | 164 | #define ax25_uid_for_each(__ax25, list) \ |
| 165 | hlist_for_each_entry(__ax25, node, list, uid_node) | 165 | hlist_for_each_entry(__ax25, list, uid_node) |
| 166 | 166 | ||
| 167 | #define ax25_uid_hold(ax25) \ | 167 | #define ax25_uid_hold(ax25) \ |
| 168 | atomic_inc(&((ax25)->refcount)) | 168 | atomic_inc(&((ax25)->refcount)) |
| @@ -247,8 +247,8 @@ typedef struct ax25_cb { | |||
| 247 | 247 | ||
| 248 | #define ax25_sk(__sk) ((ax25_cb *)(__sk)->sk_protinfo) | 248 | #define ax25_sk(__sk) ((ax25_cb *)(__sk)->sk_protinfo) |
| 249 | 249 | ||
| 250 | #define ax25_for_each(__ax25, node, list) \ | 250 | #define ax25_for_each(__ax25, list) \ |
| 251 | hlist_for_each_entry(__ax25, node, list, ax25_node) | 251 | hlist_for_each_entry(__ax25, list, ax25_node) |
| 252 | 252 | ||
| 253 | #define ax25_cb_hold(__ax25) \ | 253 | #define ax25_cb_hold(__ax25) \ |
| 254 | atomic_inc(&((__ax25)->refcount)) | 254 | atomic_inc(&((__ax25)->refcount)) |
diff --git a/include/net/icmp.h b/include/net/icmp.h index 9ac2524d1402..081439fd070e 100644 --- a/include/net/icmp.h +++ b/include/net/icmp.h | |||
| @@ -41,6 +41,7 @@ struct net; | |||
| 41 | 41 | ||
| 42 | extern void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info); | 42 | extern void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info); |
| 43 | extern int icmp_rcv(struct sk_buff *skb); | 43 | extern int icmp_rcv(struct sk_buff *skb); |
| 44 | extern void icmp_err(struct sk_buff *, u32 info); | ||
| 44 | extern int icmp_init(void); | 45 | extern int icmp_init(void); |
| 45 | extern void icmp_out_count(struct net *net, unsigned char type); | 46 | extern void icmp_out_count(struct net *net, unsigned char type); |
| 46 | 47 | ||
diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h index 7ca75cbbf75e..fd4ee016ba5c 100644 --- a/include/net/inet6_hashtables.h +++ b/include/net/inet6_hashtables.h | |||
| @@ -28,16 +28,16 @@ | |||
| 28 | 28 | ||
| 29 | struct inet_hashinfo; | 29 | struct inet_hashinfo; |
| 30 | 30 | ||
| 31 | /* I have no idea if this is a good hash for v6 or not. -DaveM */ | ||
| 32 | static inline unsigned int inet6_ehashfn(struct net *net, | 31 | static inline unsigned int inet6_ehashfn(struct net *net, |
| 33 | const struct in6_addr *laddr, const u16 lport, | 32 | const struct in6_addr *laddr, const u16 lport, |
| 34 | const struct in6_addr *faddr, const __be16 fport) | 33 | const struct in6_addr *faddr, const __be16 fport) |
| 35 | { | 34 | { |
| 36 | u32 ports = (lport ^ (__force u16)fport); | 35 | u32 ports = (((u32)lport) << 16) | (__force u32)fport; |
| 37 | 36 | ||
| 38 | return jhash_3words((__force u32)laddr->s6_addr32[3], | 37 | return jhash_3words((__force u32)laddr->s6_addr32[3], |
| 39 | (__force u32)faddr->s6_addr32[3], | 38 | ipv6_addr_jhash(faddr), |
| 40 | ports, inet_ehash_secret + net_hash_mix(net)); | 39 | ports, |
| 40 | inet_ehash_secret + net_hash_mix(net)); | ||
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | static inline int inet6_sk_ehashfn(const struct sock *sk) | 43 | static inline int inet6_sk_ehashfn(const struct sock *sk) |
diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h index 3f237db0a426..76c3fe5ecc2e 100644 --- a/include/net/inet_frag.h +++ b/include/net/inet_frag.h | |||
| @@ -114,7 +114,13 @@ static inline void init_frag_mem_limit(struct netns_frags *nf) | |||
| 114 | 114 | ||
| 115 | static inline int sum_frag_mem_limit(struct netns_frags *nf) | 115 | static inline int sum_frag_mem_limit(struct netns_frags *nf) |
| 116 | { | 116 | { |
| 117 | return percpu_counter_sum_positive(&nf->mem); | 117 | int res; |
| 118 | |||
| 119 | local_bh_disable(); | ||
| 120 | res = percpu_counter_sum_positive(&nf->mem); | ||
| 121 | local_bh_enable(); | ||
| 122 | |||
| 123 | return res; | ||
| 118 | } | 124 | } |
| 119 | 125 | ||
| 120 | static inline void inet_frag_lru_move(struct inet_frag_queue *q) | 126 | static inline void inet_frag_lru_move(struct inet_frag_queue *q) |
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index 7b2ae9d37076..ef83d9e844b5 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h | |||
| @@ -94,8 +94,8 @@ static inline struct net *ib_net(struct inet_bind_bucket *ib) | |||
| 94 | return read_pnet(&ib->ib_net); | 94 | return read_pnet(&ib->ib_net); |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | #define inet_bind_bucket_for_each(tb, pos, head) \ | 97 | #define inet_bind_bucket_for_each(tb, head) \ |
| 98 | hlist_for_each_entry(tb, pos, head, node) | 98 | hlist_for_each_entry(tb, head, node) |
| 99 | 99 | ||
| 100 | struct inet_bind_hashbucket { | 100 | struct inet_bind_hashbucket { |
| 101 | spinlock_t lock; | 101 | spinlock_t lock; |
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index a4196cbc84ec..7235ae73a1e8 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h | |||
| @@ -203,6 +203,7 @@ static inline void inet_sk_copy_descendant(struct sock *sk_to, | |||
| 203 | extern int inet_sk_rebuild_header(struct sock *sk); | 203 | extern int inet_sk_rebuild_header(struct sock *sk); |
| 204 | 204 | ||
| 205 | extern u32 inet_ehash_secret; | 205 | extern u32 inet_ehash_secret; |
| 206 | extern u32 ipv6_hash_secret; | ||
| 206 | extern void build_ehash_secret(void); | 207 | extern void build_ehash_secret(void); |
| 207 | 208 | ||
| 208 | static inline unsigned int inet_ehashfn(struct net *net, | 209 | static inline unsigned int inet_ehashfn(struct net *net, |
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h index 7d658d577368..f908dfc06505 100644 --- a/include/net/inet_timewait_sock.h +++ b/include/net/inet_timewait_sock.h | |||
| @@ -178,11 +178,11 @@ static inline int inet_twsk_del_dead_node(struct inet_timewait_sock *tw) | |||
| 178 | #define inet_twsk_for_each(tw, node, head) \ | 178 | #define inet_twsk_for_each(tw, node, head) \ |
| 179 | hlist_nulls_for_each_entry(tw, node, head, tw_node) | 179 | hlist_nulls_for_each_entry(tw, node, head, tw_node) |
| 180 | 180 | ||
| 181 | #define inet_twsk_for_each_inmate(tw, node, jail) \ | 181 | #define inet_twsk_for_each_inmate(tw, jail) \ |
| 182 | hlist_for_each_entry(tw, node, jail, tw_death_node) | 182 | hlist_for_each_entry(tw, jail, tw_death_node) |
| 183 | 183 | ||
| 184 | #define inet_twsk_for_each_inmate_safe(tw, node, safe, jail) \ | 184 | #define inet_twsk_for_each_inmate_safe(tw, safe, jail) \ |
| 185 | hlist_for_each_entry_safe(tw, node, safe, jail, tw_death_node) | 185 | hlist_for_each_entry_safe(tw, safe, jail, tw_death_node) |
| 186 | 186 | ||
| 187 | static inline struct inet_timewait_sock *inet_twsk(const struct sock *sk) | 187 | static inline struct inet_timewait_sock *inet_twsk(const struct sock *sk) |
| 188 | { | 188 | { |
diff --git a/include/net/ipip.h b/include/net/ipip.h index 21947cf4fa46..fd19625ff99d 100644 --- a/include/net/ipip.h +++ b/include/net/ipip.h | |||
| @@ -71,4 +71,21 @@ static inline void iptunnel_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 71 | } | 71 | } |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | static inline void tunnel_ip_select_ident(struct sk_buff *skb, | ||
| 75 | const struct iphdr *old_iph, | ||
| 76 | struct dst_entry *dst) | ||
| 77 | { | ||
| 78 | struct iphdr *iph = ip_hdr(skb); | ||
| 79 | |||
| 80 | if (iph->frag_off & htons(IP_DF)) | ||
| 81 | iph->id = 0; | ||
| 82 | else { | ||
| 83 | /* Use inner packet iph-id if possible. */ | ||
| 84 | if (skb->protocol == htons(ETH_P_IP) && old_iph->id) | ||
| 85 | iph->id = old_iph->id; | ||
| 86 | else | ||
| 87 | __ip_select_ident(iph, dst, | ||
| 88 | (skb_shinfo(skb)->gso_segs ?: 1) - 1); | ||
| 89 | } | ||
| 90 | } | ||
| 74 | #endif | 91 | #endif |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 851d5412a299..64d12e77719a 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | #include <linux/ipv6.h> | 16 | #include <linux/ipv6.h> |
| 17 | #include <linux/hardirq.h> | 17 | #include <linux/hardirq.h> |
| 18 | #include <linux/jhash.h> | ||
| 18 | #include <net/if_inet6.h> | 19 | #include <net/if_inet6.h> |
| 19 | #include <net/ndisc.h> | 20 | #include <net/ndisc.h> |
| 20 | #include <net/flow.h> | 21 | #include <net/flow.h> |
| @@ -514,6 +515,17 @@ static inline u32 ipv6_addr_hash(const struct in6_addr *a) | |||
| 514 | #endif | 515 | #endif |
| 515 | } | 516 | } |
| 516 | 517 | ||
| 518 | /* more secured version of ipv6_addr_hash() */ | ||
| 519 | static inline u32 ipv6_addr_jhash(const struct in6_addr *a) | ||
| 520 | { | ||
| 521 | u32 v = (__force u32)a->s6_addr32[0] ^ (__force u32)a->s6_addr32[1]; | ||
| 522 | |||
| 523 | return jhash_3words(v, | ||
| 524 | (__force u32)a->s6_addr32[2], | ||
| 525 | (__force u32)a->s6_addr32[3], | ||
| 526 | ipv6_hash_secret); | ||
| 527 | } | ||
| 528 | |||
| 517 | static inline bool ipv6_addr_loopback(const struct in6_addr *a) | 529 | static inline bool ipv6_addr_loopback(const struct in6_addr *a) |
| 518 | { | 530 | { |
| 519 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 | 531 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 |
diff --git a/include/net/netrom.h b/include/net/netrom.h index f0793c1cb5f8..121dcf854db5 100644 --- a/include/net/netrom.h +++ b/include/net/netrom.h | |||
| @@ -154,17 +154,17 @@ static __inline__ void nr_node_unlock(struct nr_node *nr_node) | |||
| 154 | nr_node_put(nr_node); | 154 | nr_node_put(nr_node); |
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | #define nr_neigh_for_each(__nr_neigh, node, list) \ | 157 | #define nr_neigh_for_each(__nr_neigh, list) \ |
| 158 | hlist_for_each_entry(__nr_neigh, node, list, neigh_node) | 158 | hlist_for_each_entry(__nr_neigh, list, neigh_node) |
| 159 | 159 | ||
| 160 | #define nr_neigh_for_each_safe(__nr_neigh, node, node2, list) \ | 160 | #define nr_neigh_for_each_safe(__nr_neigh, node2, list) \ |
| 161 | hlist_for_each_entry_safe(__nr_neigh, node, node2, list, neigh_node) | 161 | hlist_for_each_entry_safe(__nr_neigh, node2, list, neigh_node) |
| 162 | 162 | ||
| 163 | #define nr_node_for_each(__nr_node, node, list) \ | 163 | #define nr_node_for_each(__nr_node, list) \ |
| 164 | hlist_for_each_entry(__nr_node, node, list, node_node) | 164 | hlist_for_each_entry(__nr_node, list, node_node) |
| 165 | 165 | ||
| 166 | #define nr_node_for_each_safe(__nr_node, node, node2, list) \ | 166 | #define nr_node_for_each_safe(__nr_node, node2, list) \ |
| 167 | hlist_for_each_entry_safe(__nr_node, node, node2, list, node_node) | 167 | hlist_for_each_entry_safe(__nr_node, node2, list, node_node) |
| 168 | 168 | ||
| 169 | 169 | ||
| 170 | /*********************************************************************/ | 170 | /*********************************************************************/ |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 2761c905504e..f10818fc8804 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
| @@ -339,11 +339,10 @@ static inline struct Qdisc_class_common * | |||
| 339 | qdisc_class_find(const struct Qdisc_class_hash *hash, u32 id) | 339 | qdisc_class_find(const struct Qdisc_class_hash *hash, u32 id) |
| 340 | { | 340 | { |
| 341 | struct Qdisc_class_common *cl; | 341 | struct Qdisc_class_common *cl; |
| 342 | struct hlist_node *n; | ||
| 343 | unsigned int h; | 342 | unsigned int h; |
| 344 | 343 | ||
| 345 | h = qdisc_class_hash(id, hash->hashmask); | 344 | h = qdisc_class_hash(id, hash->hashmask); |
| 346 | hlist_for_each_entry(cl, n, &hash->hash[h], hnode) { | 345 | hlist_for_each_entry(cl, &hash->hash[h], hnode) { |
| 347 | if (cl->classid == id) | 346 | if (cl->classid == id) |
| 348 | return cl; | 347 | return cl; |
| 349 | } | 348 | } |
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 7fdf298a47ef..df85a0c0f2d5 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
| @@ -675,8 +675,8 @@ static inline int sctp_vtag_hashfn(__u16 lport, __u16 rport, __u32 vtag) | |||
| 675 | return h & (sctp_assoc_hashsize - 1); | 675 | return h & (sctp_assoc_hashsize - 1); |
| 676 | } | 676 | } |
| 677 | 677 | ||
| 678 | #define sctp_for_each_hentry(epb, node, head) \ | 678 | #define sctp_for_each_hentry(epb, head) \ |
| 679 | hlist_for_each_entry(epb, node, head, node) | 679 | hlist_for_each_entry(epb, head, node) |
| 680 | 680 | ||
| 681 | /* Is a socket of this style? */ | 681 | /* Is a socket of this style? */ |
| 682 | #define sctp_style(sk, style) __sctp_style((sk), (SCTP_SOCKET_##style)) | 682 | #define sctp_style(sk, style) __sctp_style((sk), (SCTP_SOCKET_##style)) |
diff --git a/include/net/sock.h b/include/net/sock.h index a66caa223d18..14f6e9d19dc7 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
| @@ -606,24 +606,23 @@ static inline void sk_add_bind_node(struct sock *sk, | |||
| 606 | hlist_add_head(&sk->sk_bind_node, list); | 606 | hlist_add_head(&sk->sk_bind_node, list); |
| 607 | } | 607 | } |
| 608 | 608 | ||
| 609 | #define sk_for_each(__sk, node, list) \ | 609 | #define sk_for_each(__sk, list) \ |
| 610 | hlist_for_each_entry(__sk, node, list, sk_node) | 610 | hlist_for_each_entry(__sk, list, sk_node) |
| 611 | #define sk_for_each_rcu(__sk, node, list) \ | 611 | #define sk_for_each_rcu(__sk, list) \ |
| 612 | hlist_for_each_entry_rcu(__sk, node, list, sk_node) | 612 | hlist_for_each_entry_rcu(__sk, list, sk_node) |
| 613 | #define sk_nulls_for_each(__sk, node, list) \ | 613 | #define sk_nulls_for_each(__sk, node, list) \ |
| 614 | hlist_nulls_for_each_entry(__sk, node, list, sk_nulls_node) | 614 | hlist_nulls_for_each_entry(__sk, node, list, sk_nulls_node) |
| 615 | #define sk_nulls_for_each_rcu(__sk, node, list) \ | 615 | #define sk_nulls_for_each_rcu(__sk, node, list) \ |
| 616 | hlist_nulls_for_each_entry_rcu(__sk, node, list, sk_nulls_node) | 616 | hlist_nulls_for_each_entry_rcu(__sk, node, list, sk_nulls_node) |
| 617 | #define sk_for_each_from(__sk, node) \ | 617 | #define sk_for_each_from(__sk) \ |
| 618 | if (__sk && ({ node = &(__sk)->sk_node; 1; })) \ | 618 | hlist_for_each_entry_from(__sk, sk_node) |
| 619 | hlist_for_each_entry_from(__sk, node, sk_node) | ||
| 620 | #define sk_nulls_for_each_from(__sk, node) \ | 619 | #define sk_nulls_for_each_from(__sk, node) \ |
| 621 | if (__sk && ({ node = &(__sk)->sk_nulls_node; 1; })) \ | 620 | if (__sk && ({ node = &(__sk)->sk_nulls_node; 1; })) \ |
| 622 | hlist_nulls_for_each_entry_from(__sk, node, sk_nulls_node) | 621 | hlist_nulls_for_each_entry_from(__sk, node, sk_nulls_node) |
| 623 | #define sk_for_each_safe(__sk, node, tmp, list) \ | 622 | #define sk_for_each_safe(__sk, tmp, list) \ |
| 624 | hlist_for_each_entry_safe(__sk, node, tmp, list, sk_node) | 623 | hlist_for_each_entry_safe(__sk, tmp, list, sk_node) |
| 625 | #define sk_for_each_bound(__sk, node, list) \ | 624 | #define sk_for_each_bound(__sk, list) \ |
| 626 | hlist_for_each_entry(__sk, node, list, sk_bind_node) | 625 | hlist_for_each_entry(__sk, list, sk_bind_node) |
| 627 | 626 | ||
| 628 | static inline struct user_namespace *sk_user_ns(struct sock *sk) | 627 | static inline struct user_namespace *sk_user_ns(struct sock *sk) |
| 629 | { | 628 | { |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 23f2e98d4b65..cf0694d4ad60 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
| @@ -1045,6 +1045,10 @@ static inline bool tcp_prequeue(struct sock *sk, struct sk_buff *skb) | |||
| 1045 | if (sysctl_tcp_low_latency || !tp->ucopy.task) | 1045 | if (sysctl_tcp_low_latency || !tp->ucopy.task) |
| 1046 | return false; | 1046 | return false; |
| 1047 | 1047 | ||
| 1048 | if (skb->len <= tcp_hdrlen(skb) && | ||
| 1049 | skb_queue_len(&tp->ucopy.prequeue) == 0) | ||
| 1050 | return false; | ||
| 1051 | |||
| 1048 | __skb_queue_tail(&tp->ucopy.prequeue, skb); | 1052 | __skb_queue_tail(&tp->ucopy.prequeue, skb); |
| 1049 | tp->ucopy.memory += skb->truesize; | 1053 | tp->ucopy.memory += skb->truesize; |
| 1050 | if (tp->ucopy.memory > sk->sk_rcvbuf) { | 1054 | if (tp->ucopy.memory > sk->sk_rcvbuf) { |
diff --git a/include/ras/ras_event.h b/include/ras/ras_event.h index 260470e72483..21cdb0b7b0fb 100644 --- a/include/ras/ras_event.h +++ b/include/ras/ras_event.h | |||
| @@ -78,9 +78,7 @@ TRACE_EVENT(mc_event, | |||
| 78 | 78 | ||
| 79 | TP_printk("%d %s error%s:%s%s on %s (mc:%d location:%d:%d:%d address:0x%08lx grain:%d syndrome:0x%08lx%s%s)", | 79 | TP_printk("%d %s error%s:%s%s on %s (mc:%d location:%d:%d:%d address:0x%08lx grain:%d syndrome:0x%08lx%s%s)", |
| 80 | __entry->error_count, | 80 | __entry->error_count, |
| 81 | (__entry->error_type == HW_EVENT_ERR_CORRECTED) ? "Corrected" : | 81 | mc_event_error_type(__entry->error_type), |
| 82 | ((__entry->error_type == HW_EVENT_ERR_FATAL) ? | ||
| 83 | "Fatal" : "Uncorrected"), | ||
| 84 | __entry->error_count > 1 ? "s" : "", | 82 | __entry->error_count > 1 ? "s" : "", |
| 85 | ((char *)__get_str(msg))[0] ? " " : "", | 83 | ((char *)__get_str(msg))[0] ? " " : "", |
| 86 | __get_str(msg), | 84 | __get_str(msg), |
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 46bc045bbe15..98cc4b29fc5b 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
| @@ -115,6 +115,8 @@ enum ib_device_cap_flags { | |||
| 115 | IB_DEVICE_XRC = (1<<20), | 115 | IB_DEVICE_XRC = (1<<20), |
| 116 | IB_DEVICE_MEM_MGT_EXTENSIONS = (1<<21), | 116 | IB_DEVICE_MEM_MGT_EXTENSIONS = (1<<21), |
| 117 | IB_DEVICE_BLOCK_MULTICAST_LOOPBACK = (1<<22), | 117 | IB_DEVICE_BLOCK_MULTICAST_LOOPBACK = (1<<22), |
| 118 | IB_DEVICE_MEM_WINDOW_TYPE_2A = (1<<23), | ||
| 119 | IB_DEVICE_MEM_WINDOW_TYPE_2B = (1<<24) | ||
| 118 | }; | 120 | }; |
| 119 | 121 | ||
| 120 | enum ib_atomic_cap { | 122 | enum ib_atomic_cap { |
| @@ -715,6 +717,11 @@ enum ib_mig_state { | |||
| 715 | IB_MIG_ARMED | 717 | IB_MIG_ARMED |
| 716 | }; | 718 | }; |
| 717 | 719 | ||
| 720 | enum ib_mw_type { | ||
| 721 | IB_MW_TYPE_1 = 1, | ||
| 722 | IB_MW_TYPE_2 = 2 | ||
| 723 | }; | ||
| 724 | |||
| 718 | struct ib_qp_attr { | 725 | struct ib_qp_attr { |
| 719 | enum ib_qp_state qp_state; | 726 | enum ib_qp_state qp_state; |
| 720 | enum ib_qp_state cur_qp_state; | 727 | enum ib_qp_state cur_qp_state; |
| @@ -758,6 +765,7 @@ enum ib_wr_opcode { | |||
| 758 | IB_WR_FAST_REG_MR, | 765 | IB_WR_FAST_REG_MR, |
| 759 | IB_WR_MASKED_ATOMIC_CMP_AND_SWP, | 766 | IB_WR_MASKED_ATOMIC_CMP_AND_SWP, |
| 760 | IB_WR_MASKED_ATOMIC_FETCH_AND_ADD, | 767 | IB_WR_MASKED_ATOMIC_FETCH_AND_ADD, |
| 768 | IB_WR_BIND_MW, | ||
| 761 | }; | 769 | }; |
| 762 | 770 | ||
| 763 | enum ib_send_flags { | 771 | enum ib_send_flags { |
| @@ -780,6 +788,23 @@ struct ib_fast_reg_page_list { | |||
| 780 | unsigned int max_page_list_len; | 788 | unsigned int max_page_list_len; |
| 781 | }; | 789 | }; |
| 782 | 790 | ||
| 791 | /** | ||
| 792 | * struct ib_mw_bind_info - Parameters for a memory window bind operation. | ||
| 793 | * @mr: A memory region to bind the memory window to. | ||
| 794 | * @addr: The address where the memory window should begin. | ||
| 795 | * @length: The length of the memory window, in bytes. | ||
| 796 | * @mw_access_flags: Access flags from enum ib_access_flags for the window. | ||
| 797 | * | ||
| 798 | * This struct contains the shared parameters for type 1 and type 2 | ||
| 799 | * memory window bind operations. | ||
| 800 | */ | ||
| 801 | struct ib_mw_bind_info { | ||
| 802 | struct ib_mr *mr; | ||
| 803 | u64 addr; | ||
| 804 | u64 length; | ||
| 805 | int mw_access_flags; | ||
| 806 | }; | ||
| 807 | |||
| 783 | struct ib_send_wr { | 808 | struct ib_send_wr { |
| 784 | struct ib_send_wr *next; | 809 | struct ib_send_wr *next; |
| 785 | u64 wr_id; | 810 | u64 wr_id; |
| @@ -823,6 +848,12 @@ struct ib_send_wr { | |||
| 823 | int access_flags; | 848 | int access_flags; |
| 824 | u32 rkey; | 849 | u32 rkey; |
| 825 | } fast_reg; | 850 | } fast_reg; |
| 851 | struct { | ||
| 852 | struct ib_mw *mw; | ||
| 853 | /* The new rkey for the memory window. */ | ||
| 854 | u32 rkey; | ||
| 855 | struct ib_mw_bind_info bind_info; | ||
| 856 | } bind_mw; | ||
| 826 | } wr; | 857 | } wr; |
| 827 | u32 xrc_remote_srq_num; /* XRC TGT QPs only */ | 858 | u32 xrc_remote_srq_num; /* XRC TGT QPs only */ |
| 828 | }; | 859 | }; |
| @@ -839,7 +870,8 @@ enum ib_access_flags { | |||
| 839 | IB_ACCESS_REMOTE_WRITE = (1<<1), | 870 | IB_ACCESS_REMOTE_WRITE = (1<<1), |
| 840 | IB_ACCESS_REMOTE_READ = (1<<2), | 871 | IB_ACCESS_REMOTE_READ = (1<<2), |
| 841 | IB_ACCESS_REMOTE_ATOMIC = (1<<3), | 872 | IB_ACCESS_REMOTE_ATOMIC = (1<<3), |
| 842 | IB_ACCESS_MW_BIND = (1<<4) | 873 | IB_ACCESS_MW_BIND = (1<<4), |
| 874 | IB_ZERO_BASED = (1<<5) | ||
| 843 | }; | 875 | }; |
| 844 | 876 | ||
| 845 | struct ib_phys_buf { | 877 | struct ib_phys_buf { |
| @@ -862,13 +894,16 @@ enum ib_mr_rereg_flags { | |||
| 862 | IB_MR_REREG_ACCESS = (1<<2) | 894 | IB_MR_REREG_ACCESS = (1<<2) |
| 863 | }; | 895 | }; |
| 864 | 896 | ||
| 897 | /** | ||
| 898 | * struct ib_mw_bind - Parameters for a type 1 memory window bind operation. | ||
| 899 | * @wr_id: Work request id. | ||
| 900 | * @send_flags: Flags from ib_send_flags enum. | ||
| 901 | * @bind_info: More parameters of the bind operation. | ||
| 902 | */ | ||
| 865 | struct ib_mw_bind { | 903 | struct ib_mw_bind { |
| 866 | struct ib_mr *mr; | 904 | u64 wr_id; |
| 867 | u64 wr_id; | 905 | int send_flags; |
| 868 | u64 addr; | 906 | struct ib_mw_bind_info bind_info; |
| 869 | u32 length; | ||
| 870 | int send_flags; | ||
| 871 | int mw_access_flags; | ||
| 872 | }; | 907 | }; |
| 873 | 908 | ||
| 874 | struct ib_fmr_attr { | 909 | struct ib_fmr_attr { |
| @@ -991,6 +1026,7 @@ struct ib_mw { | |||
| 991 | struct ib_pd *pd; | 1026 | struct ib_pd *pd; |
| 992 | struct ib_uobject *uobject; | 1027 | struct ib_uobject *uobject; |
| 993 | u32 rkey; | 1028 | u32 rkey; |
| 1029 | enum ib_mw_type type; | ||
| 994 | }; | 1030 | }; |
| 995 | 1031 | ||
| 996 | struct ib_fmr { | 1032 | struct ib_fmr { |
| @@ -1202,7 +1238,8 @@ struct ib_device { | |||
| 1202 | int num_phys_buf, | 1238 | int num_phys_buf, |
| 1203 | int mr_access_flags, | 1239 | int mr_access_flags, |
| 1204 | u64 *iova_start); | 1240 | u64 *iova_start); |
| 1205 | struct ib_mw * (*alloc_mw)(struct ib_pd *pd); | 1241 | struct ib_mw * (*alloc_mw)(struct ib_pd *pd, |
| 1242 | enum ib_mw_type type); | ||
| 1206 | int (*bind_mw)(struct ib_qp *qp, | 1243 | int (*bind_mw)(struct ib_qp *qp, |
| 1207 | struct ib_mw *mw, | 1244 | struct ib_mw *mw, |
| 1208 | struct ib_mw_bind *mw_bind); | 1245 | struct ib_mw_bind *mw_bind); |
| @@ -2019,6 +2056,8 @@ int ib_query_mr(struct ib_mr *mr, struct ib_mr_attr *mr_attr); | |||
| 2019 | * ib_dereg_mr - Deregisters a memory region and removes it from the | 2056 | * ib_dereg_mr - Deregisters a memory region and removes it from the |
| 2020 | * HCA translation table. | 2057 | * HCA translation table. |
| 2021 | * @mr: The memory region to deregister. | 2058 | * @mr: The memory region to deregister. |
| 2059 | * | ||
| 2060 | * This function can fail, if the memory region has memory windows bound to it. | ||
| 2022 | */ | 2061 | */ |
| 2023 | int ib_dereg_mr(struct ib_mr *mr); | 2062 | int ib_dereg_mr(struct ib_mr *mr); |
| 2024 | 2063 | ||
| @@ -2071,10 +2110,22 @@ static inline void ib_update_fast_reg_key(struct ib_mr *mr, u8 newkey) | |||
| 2071 | } | 2110 | } |
| 2072 | 2111 | ||
| 2073 | /** | 2112 | /** |
| 2113 | * ib_inc_rkey - increments the key portion of the given rkey. Can be used | ||
| 2114 | * for calculating a new rkey for type 2 memory windows. | ||
| 2115 | * @rkey - the rkey to increment. | ||
| 2116 | */ | ||
| 2117 | static inline u32 ib_inc_rkey(u32 rkey) | ||
| 2118 | { | ||
| 2119 | const u32 mask = 0x000000ff; | ||
| 2120 | return ((rkey + 1) & mask) | (rkey & ~mask); | ||
| 2121 | } | ||
| 2122 | |||
| 2123 | /** | ||
| 2074 | * ib_alloc_mw - Allocates a memory window. | 2124 | * ib_alloc_mw - Allocates a memory window. |
| 2075 | * @pd: The protection domain associated with the memory window. | 2125 | * @pd: The protection domain associated with the memory window. |
| 2126 | * @type: The type of the memory window (1 or 2). | ||
| 2076 | */ | 2127 | */ |
| 2077 | struct ib_mw *ib_alloc_mw(struct ib_pd *pd); | 2128 | struct ib_mw *ib_alloc_mw(struct ib_pd *pd, enum ib_mw_type type); |
| 2078 | 2129 | ||
| 2079 | /** | 2130 | /** |
| 2080 | * ib_bind_mw - Posts a work request to the send queue of the specified | 2131 | * ib_bind_mw - Posts a work request to the send queue of the specified |
| @@ -2084,6 +2135,10 @@ struct ib_mw *ib_alloc_mw(struct ib_pd *pd); | |||
| 2084 | * @mw: The memory window to bind. | 2135 | * @mw: The memory window to bind. |
| 2085 | * @mw_bind: Specifies information about the memory window, including | 2136 | * @mw_bind: Specifies information about the memory window, including |
| 2086 | * its address range, remote access rights, and associated memory region. | 2137 | * its address range, remote access rights, and associated memory region. |
| 2138 | * | ||
| 2139 | * If there is no immediate error, the function will update the rkey member | ||
| 2140 | * of the mw parameter to its new value. The bind operation can still fail | ||
| 2141 | * asynchronously. | ||
| 2087 | */ | 2142 | */ |
| 2088 | static inline int ib_bind_mw(struct ib_qp *qp, | 2143 | static inline int ib_bind_mw(struct ib_qp *qp, |
| 2089 | struct ib_mw *mw, | 2144 | struct ib_mw *mw, |
diff --git a/include/scsi/Kbuild b/include/scsi/Kbuild index f2b94918994d..562ff9d591b8 100644 --- a/include/scsi/Kbuild +++ b/include/scsi/Kbuild | |||
| @@ -1,4 +1 @@ | |||
| 1 | header-y += scsi_netlink.h | ||
| 2 | header-y += scsi_netlink_fc.h | ||
| 3 | header-y += scsi_bsg_fc.h | ||
| 4 | header-y += fc/ | header-y += fc/ | |
diff --git a/include/scsi/fc/Kbuild b/include/scsi/fc/Kbuild index 56603813c6cd..e69de29bb2d1 100644 --- a/include/scsi/fc/Kbuild +++ b/include/scsi/fc/Kbuild | |||
| @@ -1,4 +0,0 @@ | |||
| 1 | header-y += fc_els.h | ||
| 2 | header-y += fc_fs.h | ||
| 3 | header-y += fc_gs.h | ||
| 4 | header-y += fc_ns.h | ||
diff --git a/include/scsi/fcoe_sysfs.h b/include/scsi/fcoe_sysfs.h index 604cb9bb3e76..7e2314870341 100644 --- a/include/scsi/fcoe_sysfs.h +++ b/include/scsi/fcoe_sysfs.h | |||
| @@ -34,7 +34,8 @@ struct fcoe_sysfs_function_template { | |||
| 34 | void (*get_fcoe_ctlr_symb_err)(struct fcoe_ctlr_device *); | 34 | void (*get_fcoe_ctlr_symb_err)(struct fcoe_ctlr_device *); |
| 35 | void (*get_fcoe_ctlr_err_block)(struct fcoe_ctlr_device *); | 35 | void (*get_fcoe_ctlr_err_block)(struct fcoe_ctlr_device *); |
| 36 | void (*get_fcoe_ctlr_fcs_error)(struct fcoe_ctlr_device *); | 36 | void (*get_fcoe_ctlr_fcs_error)(struct fcoe_ctlr_device *); |
| 37 | void (*get_fcoe_ctlr_mode)(struct fcoe_ctlr_device *); | 37 | void (*set_fcoe_ctlr_mode)(struct fcoe_ctlr_device *); |
| 38 | int (*set_fcoe_ctlr_enabled)(struct fcoe_ctlr_device *); | ||
| 38 | void (*get_fcoe_fcf_selected)(struct fcoe_fcf_device *); | 39 | void (*get_fcoe_fcf_selected)(struct fcoe_fcf_device *); |
| 39 | void (*get_fcoe_fcf_vlan_id)(struct fcoe_fcf_device *); | 40 | void (*get_fcoe_fcf_vlan_id)(struct fcoe_fcf_device *); |
| 40 | }; | 41 | }; |
| @@ -48,6 +49,12 @@ enum fip_conn_type { | |||
| 48 | FIP_CONN_TYPE_VN2VN, | 49 | FIP_CONN_TYPE_VN2VN, |
| 49 | }; | 50 | }; |
| 50 | 51 | ||
| 52 | enum ctlr_enabled_state { | ||
| 53 | FCOE_CTLR_ENABLED, | ||
| 54 | FCOE_CTLR_DISABLED, | ||
| 55 | FCOE_CTLR_UNUSED, | ||
| 56 | }; | ||
| 57 | |||
| 51 | struct fcoe_ctlr_device { | 58 | struct fcoe_ctlr_device { |
| 52 | u32 id; | 59 | u32 id; |
| 53 | 60 | ||
| @@ -64,6 +71,8 @@ struct fcoe_ctlr_device { | |||
| 64 | int fcf_dev_loss_tmo; | 71 | int fcf_dev_loss_tmo; |
| 65 | enum fip_conn_type mode; | 72 | enum fip_conn_type mode; |
| 66 | 73 | ||
| 74 | enum ctlr_enabled_state enabled; | ||
| 75 | |||
| 67 | /* expected in host order for displaying */ | 76 | /* expected in host order for displaying */ |
| 68 | struct fcoe_fc_els_lesb lesb; | 77 | struct fcoe_fc_els_lesb lesb; |
| 69 | }; | 78 | }; |
diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h index 8742d853a3b8..4427393115ea 100644 --- a/include/scsi/libfcoe.h +++ b/include/scsi/libfcoe.h | |||
| @@ -260,6 +260,9 @@ void __fcoe_get_lesb(struct fc_lport *lport, struct fc_els_lesb *fc_lesb, | |||
| 260 | struct net_device *netdev); | 260 | struct net_device *netdev); |
| 261 | void fcoe_wwn_to_str(u64 wwn, char *buf, int len); | 261 | void fcoe_wwn_to_str(u64 wwn, char *buf, int len); |
| 262 | int fcoe_validate_vport_create(struct fc_vport *vport); | 262 | int fcoe_validate_vport_create(struct fc_vport *vport); |
| 263 | int fcoe_link_speed_update(struct fc_lport *); | ||
| 264 | void fcoe_get_lesb(struct fc_lport *, struct fc_els_lesb *); | ||
| 265 | void fcoe_ctlr_get_lesb(struct fcoe_ctlr_device *ctlr_dev); | ||
| 263 | 266 | ||
| 264 | /** | 267 | /** |
| 265 | * is_fip_mode() - returns true if FIP mode selected. | 268 | * is_fip_mode() - returns true if FIP mode selected. |
| @@ -289,8 +292,11 @@ static inline bool is_fip_mode(struct fcoe_ctlr *fip) | |||
| 289 | * @attached: whether this transport is already attached | 292 | * @attached: whether this transport is already attached |
| 290 | * @list: list linkage to all attached transports | 293 | * @list: list linkage to all attached transports |
| 291 | * @match: handler to allow the transport driver to match up a given netdev | 294 | * @match: handler to allow the transport driver to match up a given netdev |
| 295 | * @alloc: handler to allocate per-instance FCoE structures | ||
| 296 | * (no discovery or login) | ||
| 292 | * @create: handler to sysfs entry of create for FCoE instances | 297 | * @create: handler to sysfs entry of create for FCoE instances |
| 293 | * @destroy: handler to sysfs entry of destroy for FCoE instances | 298 | * @destroy: handler to delete per-instance FCoE structures |
| 299 | * (frees all memory) | ||
| 294 | * @enable: handler to sysfs entry of enable for FCoE instances | 300 | * @enable: handler to sysfs entry of enable for FCoE instances |
| 295 | * @disable: handler to sysfs entry of disable for FCoE instances | 301 | * @disable: handler to sysfs entry of disable for FCoE instances |
| 296 | */ | 302 | */ |
| @@ -299,6 +305,7 @@ struct fcoe_transport { | |||
| 299 | bool attached; | 305 | bool attached; |
| 300 | struct list_head list; | 306 | struct list_head list; |
| 301 | bool (*match) (struct net_device *device); | 307 | bool (*match) (struct net_device *device); |
| 308 | int (*alloc) (struct net_device *device); | ||
| 302 | int (*create) (struct net_device *device, enum fip_state fip_mode); | 309 | int (*create) (struct net_device *device, enum fip_state fip_mode); |
| 303 | int (*destroy) (struct net_device *device); | 310 | int (*destroy) (struct net_device *device); |
| 304 | int (*enable) (struct net_device *device); | 311 | int (*enable) (struct net_device *device); |
| @@ -347,7 +354,20 @@ struct fcoe_port { | |||
| 347 | struct timer_list timer; | 354 | struct timer_list timer; |
| 348 | struct work_struct destroy_work; | 355 | struct work_struct destroy_work; |
| 349 | u8 data_src_addr[ETH_ALEN]; | 356 | u8 data_src_addr[ETH_ALEN]; |
| 357 | struct net_device * (*get_netdev)(const struct fc_lport *lport); | ||
| 350 | }; | 358 | }; |
| 359 | |||
| 360 | /** | ||
| 361 | * fcoe_get_netdev() - Return the net device associated with a local port | ||
| 362 | * @lport: The local port to get the net device from | ||
| 363 | */ | ||
| 364 | static inline struct net_device *fcoe_get_netdev(const struct fc_lport *lport) | ||
| 365 | { | ||
| 366 | struct fcoe_port *port = ((struct fcoe_port *)lport_priv(lport)); | ||
| 367 | |||
| 368 | return (port->get_netdev) ? port->get_netdev(lport) : NULL; | ||
| 369 | } | ||
| 370 | |||
| 351 | void fcoe_clean_pending_queue(struct fc_lport *); | 371 | void fcoe_clean_pending_queue(struct fc_lport *); |
| 352 | void fcoe_check_wait_queue(struct fc_lport *lport, struct sk_buff *skb); | 372 | void fcoe_check_wait_queue(struct fc_lport *lport, struct sk_buff *skb); |
| 353 | void fcoe_queue_timer(ulong lport); | 373 | void fcoe_queue_timer(ulong lport); |
| @@ -356,7 +376,7 @@ int fcoe_get_paged_crc_eof(struct sk_buff *skb, int tlen, | |||
| 356 | 376 | ||
| 357 | /* FCoE Sysfs helpers */ | 377 | /* FCoE Sysfs helpers */ |
| 358 | void fcoe_fcf_get_selected(struct fcoe_fcf_device *); | 378 | void fcoe_fcf_get_selected(struct fcoe_fcf_device *); |
| 359 | void fcoe_ctlr_get_fip_mode(struct fcoe_ctlr_device *); | 379 | void fcoe_ctlr_set_fip_mode(struct fcoe_ctlr_device *); |
| 360 | 380 | ||
| 361 | /** | 381 | /** |
| 362 | * struct netdev_list | 382 | * struct netdev_list |
| @@ -372,4 +392,12 @@ struct fcoe_netdev_mapping { | |||
| 372 | int fcoe_transport_attach(struct fcoe_transport *ft); | 392 | int fcoe_transport_attach(struct fcoe_transport *ft); |
| 373 | int fcoe_transport_detach(struct fcoe_transport *ft); | 393 | int fcoe_transport_detach(struct fcoe_transport *ft); |
| 374 | 394 | ||
| 395 | /* sysfs store handler for ctrl_control interface */ | ||
| 396 | ssize_t fcoe_ctlr_create_store(struct bus_type *bus, | ||
| 397 | const char *buf, size_t count); | ||
| 398 | ssize_t fcoe_ctlr_destroy_store(struct bus_type *bus, | ||
| 399 | const char *buf, size_t count); | ||
| 400 | |||
| 375 | #endif /* _LIBFCOE_H */ | 401 | #endif /* _LIBFCOE_H */ |
| 402 | |||
| 403 | |||
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index e65c62e82c5a..a7f9cba275e9 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
| @@ -157,10 +157,11 @@ struct scsi_device { | |||
| 157 | unsigned no_read_capacity_16:1; /* Avoid READ_CAPACITY_16 cmds */ | 157 | unsigned no_read_capacity_16:1; /* Avoid READ_CAPACITY_16 cmds */ |
| 158 | unsigned try_rc_10_first:1; /* Try READ_CAPACACITY_10 first */ | 158 | unsigned try_rc_10_first:1; /* Try READ_CAPACACITY_10 first */ |
| 159 | unsigned is_visible:1; /* is the device visible in sysfs */ | 159 | unsigned is_visible:1; /* is the device visible in sysfs */ |
| 160 | unsigned can_power_off:1; /* Device supports runtime power off */ | ||
| 161 | unsigned wce_default_on:1; /* Cache is ON by default */ | 160 | unsigned wce_default_on:1; /* Cache is ON by default */ |
| 162 | unsigned no_dif:1; /* T10 PI (DIF) should be disabled */ | 161 | unsigned no_dif:1; /* T10 PI (DIF) should be disabled */ |
| 163 | 162 | ||
| 163 | atomic_t disk_events_disable_depth; /* disable depth for disk events */ | ||
| 164 | |||
| 164 | DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */ | 165 | DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */ |
| 165 | struct list_head event_list; /* asserted events */ | 166 | struct list_head event_list; /* asserted events */ |
| 166 | struct work_struct event_work; | 167 | struct work_struct event_work; |
| @@ -397,6 +398,8 @@ extern int scsi_execute_req(struct scsi_device *sdev, const unsigned char *cmd, | |||
| 397 | int data_direction, void *buffer, unsigned bufflen, | 398 | int data_direction, void *buffer, unsigned bufflen, |
| 398 | struct scsi_sense_hdr *, int timeout, int retries, | 399 | struct scsi_sense_hdr *, int timeout, int retries, |
| 399 | int *resid); | 400 | int *resid); |
| 401 | extern void sdev_disable_disk_events(struct scsi_device *sdev); | ||
| 402 | extern void sdev_enable_disk_events(struct scsi_device *sdev); | ||
| 400 | 403 | ||
| 401 | #ifdef CONFIG_PM_RUNTIME | 404 | #ifdef CONFIG_PM_RUNTIME |
| 402 | extern int scsi_autopm_get_device(struct scsi_device *); | 405 | extern int scsi_autopm_get_device(struct scsi_device *); |
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 49084807eb6b..2b6956e9853d 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
| @@ -873,7 +873,7 @@ static inline unsigned int scsi_host_dif_capable(struct Scsi_Host *shost, unsign | |||
| 873 | SHOST_DIF_TYPE2_PROTECTION, | 873 | SHOST_DIF_TYPE2_PROTECTION, |
| 874 | SHOST_DIF_TYPE3_PROTECTION }; | 874 | SHOST_DIF_TYPE3_PROTECTION }; |
| 875 | 875 | ||
| 876 | if (target_type > SHOST_DIF_TYPE3_PROTECTION) | 876 | if (target_type >= ARRAY_SIZE(cap)) |
| 877 | return 0; | 877 | return 0; |
| 878 | 878 | ||
| 879 | return shost->prot_capabilities & cap[target_type] ? target_type : 0; | 879 | return shost->prot_capabilities & cap[target_type] ? target_type : 0; |
| @@ -887,7 +887,7 @@ static inline unsigned int scsi_host_dix_capable(struct Scsi_Host *shost, unsign | |||
| 887 | SHOST_DIX_TYPE2_PROTECTION, | 887 | SHOST_DIX_TYPE2_PROTECTION, |
| 888 | SHOST_DIX_TYPE3_PROTECTION }; | 888 | SHOST_DIX_TYPE3_PROTECTION }; |
| 889 | 889 | ||
| 890 | if (target_type > SHOST_DIX_TYPE3_PROTECTION) | 890 | if (target_type >= ARRAY_SIZE(cap)) |
| 891 | return 0; | 891 | return 0; |
| 892 | 892 | ||
| 893 | return shost->prot_capabilities & cap[target_type]; | 893 | return shost->prot_capabilities & cap[target_type]; |
diff --git a/include/sound/aess.h b/include/sound/aess.h new file mode 100644 index 000000000000..cee0d09fadbd --- /dev/null +++ b/include/sound/aess.h | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | /* | ||
| 2 | * AESS IP block reset | ||
| 3 | * | ||
| 4 | * Copyright (C) 2012 Texas Instruments, Inc. | ||
| 5 | * Paul Walmsley | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or | ||
| 8 | * modify it under the terms of the GNU General Public License as | ||
| 9 | * published by the Free Software Foundation version 2. | ||
| 10 | * | ||
| 11 | * This program is distributed "as is" WITHOUT ANY WARRANTY of any | ||
| 12 | * kind, whether express or implied; without even the implied warranty | ||
| 13 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with this program; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
| 19 | * 02110-1301 USA | ||
| 20 | */ | ||
| 21 | #ifndef __SOUND_AESS_H__ | ||
| 22 | #define __SOUND_AESS_H__ | ||
| 23 | |||
| 24 | #include <linux/kernel.h> | ||
| 25 | #include <linux/io.h> | ||
| 26 | |||
| 27 | /* | ||
| 28 | * AESS_AUTO_GATING_ENABLE_OFFSET: offset in bytes of the AESS IP | ||
| 29 | * block's AESS_AUTO_GATING_ENABLE__1 register from the IP block's | ||
| 30 | * base address | ||
| 31 | */ | ||
| 32 | #define AESS_AUTO_GATING_ENABLE_OFFSET 0x07c | ||
| 33 | |||
| 34 | /* Register bitfields in the AESS_AUTO_GATING_ENABLE__1 register */ | ||
| 35 | #define AESS_AUTO_GATING_ENABLE_SHIFT 0 | ||
| 36 | |||
| 37 | /** | ||
| 38 | * aess_enable_autogating - enable AESS internal autogating | ||
| 39 | * @oh: struct omap_hwmod * | ||
| 40 | * | ||
| 41 | * Enable internal autogating on the AESS. This allows the AESS to | ||
| 42 | * indicate that it is idle to the OMAP PRCM. Returns 0. | ||
| 43 | */ | ||
| 44 | static inline void aess_enable_autogating(void __iomem *base) | ||
| 45 | { | ||
| 46 | u32 v; | ||
| 47 | |||
| 48 | /* Set AESS_AUTO_GATING_ENABLE__1.ENABLE to allow idle entry */ | ||
| 49 | v = 1 << AESS_AUTO_GATING_ENABLE_SHIFT; | ||
| 50 | writel(v, base + AESS_AUTO_GATING_ENABLE_OFFSET); | ||
| 51 | } | ||
| 52 | |||
| 53 | #endif /* __SOUND_AESS_H__ */ | ||
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h index 507910992c59..b128c20770bc 100644 --- a/include/target/target_core_backend.h +++ b/include/target/target_core_backend.h | |||
| @@ -35,6 +35,7 @@ struct se_subsystem_api { | |||
| 35 | u32 (*get_device_type)(struct se_device *); | 35 | u32 (*get_device_type)(struct se_device *); |
| 36 | sector_t (*get_blocks)(struct se_device *); | 36 | sector_t (*get_blocks)(struct se_device *); |
| 37 | unsigned char *(*get_sense_buffer)(struct se_cmd *); | 37 | unsigned char *(*get_sense_buffer)(struct se_cmd *); |
| 38 | bool (*get_write_cache)(struct se_device *); | ||
| 38 | }; | 39 | }; |
| 39 | 40 | ||
| 40 | struct sbc_ops { | 41 | struct sbc_ops { |
| @@ -52,11 +53,13 @@ void target_complete_cmd(struct se_cmd *, u8); | |||
| 52 | 53 | ||
| 53 | sense_reason_t spc_parse_cdb(struct se_cmd *cmd, unsigned int *size); | 54 | sense_reason_t spc_parse_cdb(struct se_cmd *cmd, unsigned int *size); |
| 54 | sense_reason_t spc_emulate_report_luns(struct se_cmd *cmd); | 55 | sense_reason_t spc_emulate_report_luns(struct se_cmd *cmd); |
| 55 | sector_t spc_get_write_same_sectors(struct se_cmd *cmd); | 56 | sense_reason_t spc_emulate_inquiry_std(struct se_cmd *, unsigned char *); |
| 57 | sense_reason_t spc_emulate_evpd_83(struct se_cmd *, unsigned char *); | ||
| 56 | 58 | ||
| 57 | sense_reason_t sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops); | 59 | sense_reason_t sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops); |
| 58 | u32 sbc_get_device_rev(struct se_device *dev); | 60 | u32 sbc_get_device_rev(struct se_device *dev); |
| 59 | u32 sbc_get_device_type(struct se_device *dev); | 61 | u32 sbc_get_device_type(struct se_device *dev); |
| 62 | sector_t sbc_get_write_same_sectors(struct se_cmd *cmd); | ||
| 60 | 63 | ||
| 61 | void transport_set_vpd_proto_id(struct t10_vpd *, unsigned char *); | 64 | void transport_set_vpd_proto_id(struct t10_vpd *, unsigned char *); |
| 62 | int transport_set_vpd_assoc(struct t10_vpd *, unsigned char *); | 65 | int transport_set_vpd_assoc(struct t10_vpd *, unsigned char *); |
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 663e34a5383f..c4af592f7057 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h | |||
| @@ -44,7 +44,7 @@ | |||
| 44 | /* Used by core_alua_store_tg_pt_gp_info() and target_core_alua_tg_pt_gp_show_attr_members() */ | 44 | /* Used by core_alua_store_tg_pt_gp_info() and target_core_alua_tg_pt_gp_show_attr_members() */ |
| 45 | #define TG_PT_GROUP_NAME_BUF 256 | 45 | #define TG_PT_GROUP_NAME_BUF 256 |
| 46 | /* Used to parse VPD into struct t10_vpd */ | 46 | /* Used to parse VPD into struct t10_vpd */ |
| 47 | #define VPD_TMP_BUF_SIZE 128 | 47 | #define VPD_TMP_BUF_SIZE 254 |
| 48 | /* Used by transport_generic_cmd_sequencer() */ | 48 | /* Used by transport_generic_cmd_sequencer() */ |
| 49 | #define READ_BLOCK_LEN 6 | 49 | #define READ_BLOCK_LEN 6 |
| 50 | #define READ_CAP_LEN 8 | 50 | #define READ_CAP_LEN 8 |
| @@ -75,6 +75,8 @@ | |||
| 75 | #define DA_MAX_WRITE_SAME_LEN 0 | 75 | #define DA_MAX_WRITE_SAME_LEN 0 |
| 76 | /* Default max transfer length */ | 76 | /* Default max transfer length */ |
| 77 | #define DA_FABRIC_MAX_SECTORS 8192 | 77 | #define DA_FABRIC_MAX_SECTORS 8192 |
| 78 | /* Use a model alias based on the configfs backend device name */ | ||
| 79 | #define DA_EMULATE_MODEL_ALIAS 0 | ||
| 78 | /* Emulation for Direct Page Out */ | 80 | /* Emulation for Direct Page Out */ |
| 79 | #define DA_EMULATE_DPO 0 | 81 | #define DA_EMULATE_DPO 0 |
| 80 | /* Emulation for Forced Unit Access WRITEs */ | 82 | /* Emulation for Forced Unit Access WRITEs */ |
| @@ -193,6 +195,7 @@ enum tcm_sense_reason_table { | |||
| 193 | TCM_RESERVATION_CONFLICT = R(0x10), | 195 | TCM_RESERVATION_CONFLICT = R(0x10), |
| 194 | TCM_ADDRESS_OUT_OF_RANGE = R(0x11), | 196 | TCM_ADDRESS_OUT_OF_RANGE = R(0x11), |
| 195 | TCM_OUT_OF_RESOURCES = R(0x12), | 197 | TCM_OUT_OF_RESOURCES = R(0x12), |
| 198 | TCM_PARAMETER_LIST_LENGTH_ERROR = R(0x13), | ||
| 196 | #undef R | 199 | #undef R |
| 197 | }; | 200 | }; |
| 198 | 201 | ||
| @@ -211,7 +214,6 @@ enum tcm_tmreq_table { | |||
| 211 | TMR_LUN_RESET = 5, | 214 | TMR_LUN_RESET = 5, |
| 212 | TMR_TARGET_WARM_RESET = 6, | 215 | TMR_TARGET_WARM_RESET = 6, |
| 213 | TMR_TARGET_COLD_RESET = 7, | 216 | TMR_TARGET_COLD_RESET = 7, |
| 214 | TMR_FABRIC_TMR = 255, | ||
| 215 | }; | 217 | }; |
| 216 | 218 | ||
| 217 | /* fabric independent task management response values */ | 219 | /* fabric independent task management response values */ |
| @@ -592,6 +594,7 @@ struct se_dev_entry { | |||
| 592 | }; | 594 | }; |
| 593 | 595 | ||
| 594 | struct se_dev_attrib { | 596 | struct se_dev_attrib { |
| 597 | int emulate_model_alias; | ||
| 595 | int emulate_dpo; | 598 | int emulate_dpo; |
| 596 | int emulate_fua_write; | 599 | int emulate_fua_write; |
| 597 | int emulate_fua_read; | 600 | int emulate_fua_read; |
diff --git a/include/trace/events/block.h b/include/trace/events/block.h index 05c5e61f0a7c..9961726523d0 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h | |||
| @@ -6,10 +6,61 @@ | |||
| 6 | 6 | ||
| 7 | #include <linux/blktrace_api.h> | 7 | #include <linux/blktrace_api.h> |
| 8 | #include <linux/blkdev.h> | 8 | #include <linux/blkdev.h> |
| 9 | #include <linux/buffer_head.h> | ||
| 9 | #include <linux/tracepoint.h> | 10 | #include <linux/tracepoint.h> |
| 10 | 11 | ||
| 11 | #define RWBS_LEN 8 | 12 | #define RWBS_LEN 8 |
| 12 | 13 | ||
| 14 | DECLARE_EVENT_CLASS(block_buffer, | ||
| 15 | |||
| 16 | TP_PROTO(struct buffer_head *bh), | ||
| 17 | |||
| 18 | TP_ARGS(bh), | ||
| 19 | |||
| 20 | TP_STRUCT__entry ( | ||
| 21 | __field( dev_t, dev ) | ||
| 22 | __field( sector_t, sector ) | ||
| 23 | __field( size_t, size ) | ||
| 24 | ), | ||
| 25 | |||
| 26 | TP_fast_assign( | ||
| 27 | __entry->dev = bh->b_bdev->bd_dev; | ||
| 28 | __entry->sector = bh->b_blocknr; | ||
| 29 | __entry->size = bh->b_size; | ||
| 30 | ), | ||
| 31 | |||
| 32 | TP_printk("%d,%d sector=%llu size=%zu", | ||
| 33 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
| 34 | (unsigned long long)__entry->sector, __entry->size | ||
| 35 | ) | ||
| 36 | ); | ||
| 37 | |||
| 38 | /** | ||
| 39 | * block_touch_buffer - mark a buffer accessed | ||
| 40 | * @bh: buffer_head being touched | ||
| 41 | * | ||
| 42 | * Called from touch_buffer(). | ||
| 43 | */ | ||
| 44 | DEFINE_EVENT(block_buffer, block_touch_buffer, | ||
| 45 | |||
| 46 | TP_PROTO(struct buffer_head *bh), | ||
| 47 | |||
| 48 | TP_ARGS(bh) | ||
| 49 | ); | ||
| 50 | |||
| 51 | /** | ||
| 52 | * block_dirty_buffer - mark a buffer dirty | ||
| 53 | * @bh: buffer_head being dirtied | ||
| 54 | * | ||
| 55 | * Called from mark_buffer_dirty(). | ||
| 56 | */ | ||
| 57 | DEFINE_EVENT(block_buffer, block_dirty_buffer, | ||
| 58 | |||
| 59 | TP_PROTO(struct buffer_head *bh), | ||
| 60 | |||
| 61 | TP_ARGS(bh) | ||
| 62 | ); | ||
| 63 | |||
| 13 | DECLARE_EVENT_CLASS(block_rq_with_error, | 64 | DECLARE_EVENT_CLASS(block_rq_with_error, |
| 14 | 65 | ||
| 15 | TP_PROTO(struct request_queue *q, struct request *rq), | 66 | TP_PROTO(struct request_queue *q, struct request *rq), |
| @@ -206,7 +257,6 @@ TRACE_EVENT(block_bio_bounce, | |||
| 206 | 257 | ||
| 207 | /** | 258 | /** |
| 208 | * block_bio_complete - completed all work on the block operation | 259 | * block_bio_complete - completed all work on the block operation |
| 209 | * @q: queue holding the block operation | ||
| 210 | * @bio: block operation completed | 260 | * @bio: block operation completed |
| 211 | * @error: io error value | 261 | * @error: io error value |
| 212 | * | 262 | * |
| @@ -215,9 +265,9 @@ TRACE_EVENT(block_bio_bounce, | |||
| 215 | */ | 265 | */ |
| 216 | TRACE_EVENT(block_bio_complete, | 266 | TRACE_EVENT(block_bio_complete, |
| 217 | 267 | ||
| 218 | TP_PROTO(struct request_queue *q, struct bio *bio, int error), | 268 | TP_PROTO(struct bio *bio, int error), |
| 219 | 269 | ||
| 220 | TP_ARGS(q, bio, error), | 270 | TP_ARGS(bio, error), |
| 221 | 271 | ||
| 222 | TP_STRUCT__entry( | 272 | TP_STRUCT__entry( |
| 223 | __field( dev_t, dev ) | 273 | __field( dev_t, dev ) |
| @@ -228,7 +278,8 @@ TRACE_EVENT(block_bio_complete, | |||
| 228 | ), | 278 | ), |
| 229 | 279 | ||
| 230 | TP_fast_assign( | 280 | TP_fast_assign( |
| 231 | __entry->dev = bio->bi_bdev->bd_dev; | 281 | __entry->dev = bio->bi_bdev ? |
| 282 | bio->bi_bdev->bd_dev : 0; | ||
| 232 | __entry->sector = bio->bi_sector; | 283 | __entry->sector = bio->bi_sector; |
| 233 | __entry->nr_sector = bio->bi_size >> 9; | 284 | __entry->nr_sector = bio->bi_size >> 9; |
| 234 | __entry->error = error; | 285 | __entry->error = error; |
| @@ -241,11 +292,11 @@ TRACE_EVENT(block_bio_complete, | |||
| 241 | __entry->nr_sector, __entry->error) | 292 | __entry->nr_sector, __entry->error) |
| 242 | ); | 293 | ); |
| 243 | 294 | ||
| 244 | DECLARE_EVENT_CLASS(block_bio, | 295 | DECLARE_EVENT_CLASS(block_bio_merge, |
| 245 | 296 | ||
| 246 | TP_PROTO(struct request_queue *q, struct bio *bio), | 297 | TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio), |
| 247 | 298 | ||
| 248 | TP_ARGS(q, bio), | 299 | TP_ARGS(q, rq, bio), |
| 249 | 300 | ||
| 250 | TP_STRUCT__entry( | 301 | TP_STRUCT__entry( |
| 251 | __field( dev_t, dev ) | 302 | __field( dev_t, dev ) |
| @@ -272,31 +323,33 @@ DECLARE_EVENT_CLASS(block_bio, | |||
| 272 | /** | 323 | /** |
| 273 | * block_bio_backmerge - merging block operation to the end of an existing operation | 324 | * block_bio_backmerge - merging block operation to the end of an existing operation |
| 274 | * @q: queue holding operation | 325 | * @q: queue holding operation |
| 326 | * @rq: request bio is being merged into | ||
| 275 | * @bio: new block operation to merge | 327 | * @bio: new block operation to merge |
| 276 | * | 328 | * |
| 277 | * Merging block request @bio to the end of an existing block request | 329 | * Merging block request @bio to the end of an existing block request |
| 278 | * in queue @q. | 330 | * in queue @q. |
| 279 | */ | 331 | */ |
| 280 | DEFINE_EVENT(block_bio, block_bio_backmerge, | 332 | DEFINE_EVENT(block_bio_merge, block_bio_backmerge, |
| 281 | 333 | ||
| 282 | TP_PROTO(struct request_queue *q, struct bio *bio), | 334 | TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio), |
| 283 | 335 | ||
| 284 | TP_ARGS(q, bio) | 336 | TP_ARGS(q, rq, bio) |
| 285 | ); | 337 | ); |
| 286 | 338 | ||
| 287 | /** | 339 | /** |
| 288 | * block_bio_frontmerge - merging block operation to the beginning of an existing operation | 340 | * block_bio_frontmerge - merging block operation to the beginning of an existing operation |
| 289 | * @q: queue holding operation | 341 | * @q: queue holding operation |
| 342 | * @rq: request bio is being merged into | ||
| 290 | * @bio: new block operation to merge | 343 | * @bio: new block operation to merge |
| 291 | * | 344 | * |
| 292 | * Merging block IO operation @bio to the beginning of an existing block | 345 | * Merging block IO operation @bio to the beginning of an existing block |
| 293 | * operation in queue @q. | 346 | * operation in queue @q. |
| 294 | */ | 347 | */ |
| 295 | DEFINE_EVENT(block_bio, block_bio_frontmerge, | 348 | DEFINE_EVENT(block_bio_merge, block_bio_frontmerge, |
| 296 | 349 | ||
| 297 | TP_PROTO(struct request_queue *q, struct bio *bio), | 350 | TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio), |
| 298 | 351 | ||
| 299 | TP_ARGS(q, bio) | 352 | TP_ARGS(q, rq, bio) |
| 300 | ); | 353 | ); |
| 301 | 354 | ||
| 302 | /** | 355 | /** |
| @@ -306,11 +359,32 @@ DEFINE_EVENT(block_bio, block_bio_frontmerge, | |||
| 306 | * | 359 | * |
| 307 | * About to place the block IO operation @bio into queue @q. | 360 | * About to place the block IO operation @bio into queue @q. |
| 308 | */ | 361 | */ |
| 309 | DEFINE_EVENT(block_bio, block_bio_queue, | 362 | TRACE_EVENT(block_bio_queue, |
| 310 | 363 | ||
| 311 | TP_PROTO(struct request_queue *q, struct bio *bio), | 364 | TP_PROTO(struct request_queue *q, struct bio *bio), |
| 312 | 365 | ||
| 313 | TP_ARGS(q, bio) | 366 | TP_ARGS(q, bio), |
| 367 | |||
| 368 | TP_STRUCT__entry( | ||
| 369 | __field( dev_t, dev ) | ||
| 370 | __field( sector_t, sector ) | ||
| 371 | __field( unsigned int, nr_sector ) | ||
| 372 | __array( char, rwbs, RWBS_LEN ) | ||
| 373 | __array( char, comm, TASK_COMM_LEN ) | ||
| 374 | ), | ||
| 375 | |||
| 376 | TP_fast_assign( | ||
| 377 | __entry->dev = bio->bi_bdev->bd_dev; | ||
| 378 | __entry->sector = bio->bi_sector; | ||
| 379 | __entry->nr_sector = bio->bi_size >> 9; | ||
| 380 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); | ||
| 381 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
| 382 | ), | ||
| 383 | |||
| 384 | TP_printk("%d,%d %s %llu + %u [%s]", | ||
| 385 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, | ||
| 386 | (unsigned long long)__entry->sector, | ||
| 387 | __entry->nr_sector, __entry->comm) | ||
| 314 | ); | 388 | ); |
| 315 | 389 | ||
| 316 | DECLARE_EVENT_CLASS(block_get_rq, | 390 | DECLARE_EVENT_CLASS(block_get_rq, |
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h index 7e8c36bc7082..4ee471003859 100644 --- a/include/trace/events/ext4.h +++ b/include/trace/events/ext4.h | |||
| @@ -1324,6 +1324,31 @@ TRACE_EVENT(ext4_fallocate_exit, | |||
| 1324 | __entry->ret) | 1324 | __entry->ret) |
| 1325 | ); | 1325 | ); |
| 1326 | 1326 | ||
| 1327 | TRACE_EVENT(ext4_punch_hole, | ||
| 1328 | TP_PROTO(struct inode *inode, loff_t offset, loff_t len), | ||
| 1329 | |||
| 1330 | TP_ARGS(inode, offset, len), | ||
| 1331 | |||
| 1332 | TP_STRUCT__entry( | ||
| 1333 | __field( dev_t, dev ) | ||
| 1334 | __field( ino_t, ino ) | ||
| 1335 | __field( loff_t, offset ) | ||
| 1336 | __field( loff_t, len ) | ||
| 1337 | ), | ||
| 1338 | |||
| 1339 | TP_fast_assign( | ||
| 1340 | __entry->dev = inode->i_sb->s_dev; | ||
| 1341 | __entry->ino = inode->i_ino; | ||
| 1342 | __entry->offset = offset; | ||
| 1343 | __entry->len = len; | ||
| 1344 | ), | ||
| 1345 | |||
| 1346 | TP_printk("dev %d,%d ino %lu offset %lld len %lld", | ||
| 1347 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
| 1348 | (unsigned long) __entry->ino, | ||
| 1349 | __entry->offset, __entry->len) | ||
| 1350 | ); | ||
| 1351 | |||
| 1327 | TRACE_EVENT(ext4_unlink_enter, | 1352 | TRACE_EVENT(ext4_unlink_enter, |
| 1328 | TP_PROTO(struct inode *parent, struct dentry *dentry), | 1353 | TP_PROTO(struct inode *parent, struct dentry *dentry), |
| 1329 | 1354 | ||
| @@ -2068,103 +2093,210 @@ TRACE_EVENT(ext4_ext_remove_space_done, | |||
| 2068 | ); | 2093 | ); |
| 2069 | 2094 | ||
| 2070 | TRACE_EVENT(ext4_es_insert_extent, | 2095 | TRACE_EVENT(ext4_es_insert_extent, |
| 2071 | TP_PROTO(struct inode *inode, ext4_lblk_t start, ext4_lblk_t len), | 2096 | TP_PROTO(struct inode *inode, struct extent_status *es), |
| 2072 | 2097 | ||
| 2073 | TP_ARGS(inode, start, len), | 2098 | TP_ARGS(inode, es), |
| 2074 | 2099 | ||
| 2075 | TP_STRUCT__entry( | 2100 | TP_STRUCT__entry( |
| 2076 | __field( dev_t, dev ) | 2101 | __field( dev_t, dev ) |
| 2077 | __field( ino_t, ino ) | 2102 | __field( ino_t, ino ) |
| 2078 | __field( loff_t, start ) | 2103 | __field( ext4_lblk_t, lblk ) |
| 2079 | __field( loff_t, len ) | 2104 | __field( ext4_lblk_t, len ) |
| 2105 | __field( ext4_fsblk_t, pblk ) | ||
| 2106 | __field( unsigned long long, status ) | ||
| 2080 | ), | 2107 | ), |
| 2081 | 2108 | ||
| 2082 | TP_fast_assign( | 2109 | TP_fast_assign( |
| 2083 | __entry->dev = inode->i_sb->s_dev; | 2110 | __entry->dev = inode->i_sb->s_dev; |
| 2084 | __entry->ino = inode->i_ino; | 2111 | __entry->ino = inode->i_ino; |
| 2085 | __entry->start = start; | 2112 | __entry->lblk = es->es_lblk; |
| 2086 | __entry->len = len; | 2113 | __entry->len = es->es_len; |
| 2114 | __entry->pblk = ext4_es_pblock(es); | ||
| 2115 | __entry->status = ext4_es_status(es); | ||
| 2087 | ), | 2116 | ), |
| 2088 | 2117 | ||
| 2089 | TP_printk("dev %d,%d ino %lu es [%lld/%lld)", | 2118 | TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %llx", |
| 2090 | MAJOR(__entry->dev), MINOR(__entry->dev), | 2119 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2091 | (unsigned long) __entry->ino, | 2120 | (unsigned long) __entry->ino, |
| 2092 | __entry->start, __entry->len) | 2121 | __entry->lblk, __entry->len, |
| 2122 | __entry->pblk, __entry->status) | ||
| 2093 | ); | 2123 | ); |
| 2094 | 2124 | ||
| 2095 | TRACE_EVENT(ext4_es_remove_extent, | 2125 | TRACE_EVENT(ext4_es_remove_extent, |
| 2096 | TP_PROTO(struct inode *inode, ext4_lblk_t start, ext4_lblk_t len), | 2126 | TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_lblk_t len), |
| 2097 | 2127 | ||
| 2098 | TP_ARGS(inode, start, len), | 2128 | TP_ARGS(inode, lblk, len), |
| 2099 | 2129 | ||
| 2100 | TP_STRUCT__entry( | 2130 | TP_STRUCT__entry( |
| 2101 | __field( dev_t, dev ) | 2131 | __field( dev_t, dev ) |
| 2102 | __field( ino_t, ino ) | 2132 | __field( ino_t, ino ) |
| 2103 | __field( loff_t, start ) | 2133 | __field( loff_t, lblk ) |
| 2104 | __field( loff_t, len ) | 2134 | __field( loff_t, len ) |
| 2105 | ), | 2135 | ), |
| 2106 | 2136 | ||
| 2107 | TP_fast_assign( | 2137 | TP_fast_assign( |
| 2108 | __entry->dev = inode->i_sb->s_dev; | 2138 | __entry->dev = inode->i_sb->s_dev; |
| 2109 | __entry->ino = inode->i_ino; | 2139 | __entry->ino = inode->i_ino; |
| 2110 | __entry->start = start; | 2140 | __entry->lblk = lblk; |
| 2111 | __entry->len = len; | 2141 | __entry->len = len; |
| 2112 | ), | 2142 | ), |
| 2113 | 2143 | ||
| 2114 | TP_printk("dev %d,%d ino %lu es [%lld/%lld)", | 2144 | TP_printk("dev %d,%d ino %lu es [%lld/%lld)", |
| 2115 | MAJOR(__entry->dev), MINOR(__entry->dev), | 2145 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2116 | (unsigned long) __entry->ino, | 2146 | (unsigned long) __entry->ino, |
| 2117 | __entry->start, __entry->len) | 2147 | __entry->lblk, __entry->len) |
| 2118 | ); | 2148 | ); |
| 2119 | 2149 | ||
| 2120 | TRACE_EVENT(ext4_es_find_extent_enter, | 2150 | TRACE_EVENT(ext4_es_find_delayed_extent_enter, |
| 2121 | TP_PROTO(struct inode *inode, ext4_lblk_t start), | 2151 | TP_PROTO(struct inode *inode, ext4_lblk_t lblk), |
| 2122 | 2152 | ||
| 2123 | TP_ARGS(inode, start), | 2153 | TP_ARGS(inode, lblk), |
| 2124 | 2154 | ||
| 2125 | TP_STRUCT__entry( | 2155 | TP_STRUCT__entry( |
| 2126 | __field( dev_t, dev ) | 2156 | __field( dev_t, dev ) |
| 2127 | __field( ino_t, ino ) | 2157 | __field( ino_t, ino ) |
| 2128 | __field( ext4_lblk_t, start ) | 2158 | __field( ext4_lblk_t, lblk ) |
| 2129 | ), | 2159 | ), |
| 2130 | 2160 | ||
| 2131 | TP_fast_assign( | 2161 | TP_fast_assign( |
| 2132 | __entry->dev = inode->i_sb->s_dev; | 2162 | __entry->dev = inode->i_sb->s_dev; |
| 2133 | __entry->ino = inode->i_ino; | 2163 | __entry->ino = inode->i_ino; |
| 2134 | __entry->start = start; | 2164 | __entry->lblk = lblk; |
| 2135 | ), | 2165 | ), |
| 2136 | 2166 | ||
| 2137 | TP_printk("dev %d,%d ino %lu start %u", | 2167 | TP_printk("dev %d,%d ino %lu lblk %u", |
| 2138 | MAJOR(__entry->dev), MINOR(__entry->dev), | 2168 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2139 | (unsigned long) __entry->ino, __entry->start) | 2169 | (unsigned long) __entry->ino, __entry->lblk) |
| 2140 | ); | 2170 | ); |
| 2141 | 2171 | ||
| 2142 | TRACE_EVENT(ext4_es_find_extent_exit, | 2172 | TRACE_EVENT(ext4_es_find_delayed_extent_exit, |
| 2143 | TP_PROTO(struct inode *inode, struct extent_status *es, | 2173 | TP_PROTO(struct inode *inode, struct extent_status *es), |
| 2144 | ext4_lblk_t ret), | ||
| 2145 | 2174 | ||
| 2146 | TP_ARGS(inode, es, ret), | 2175 | TP_ARGS(inode, es), |
| 2147 | 2176 | ||
| 2148 | TP_STRUCT__entry( | 2177 | TP_STRUCT__entry( |
| 2149 | __field( dev_t, dev ) | 2178 | __field( dev_t, dev ) |
| 2150 | __field( ino_t, ino ) | 2179 | __field( ino_t, ino ) |
| 2151 | __field( ext4_lblk_t, start ) | 2180 | __field( ext4_lblk_t, lblk ) |
| 2152 | __field( ext4_lblk_t, len ) | 2181 | __field( ext4_lblk_t, len ) |
| 2153 | __field( ext4_lblk_t, ret ) | 2182 | __field( ext4_fsblk_t, pblk ) |
| 2183 | __field( unsigned long long, status ) | ||
| 2154 | ), | 2184 | ), |
| 2155 | 2185 | ||
| 2156 | TP_fast_assign( | 2186 | TP_fast_assign( |
| 2157 | __entry->dev = inode->i_sb->s_dev; | 2187 | __entry->dev = inode->i_sb->s_dev; |
| 2158 | __entry->ino = inode->i_ino; | 2188 | __entry->ino = inode->i_ino; |
| 2159 | __entry->start = es->start; | 2189 | __entry->lblk = es->es_lblk; |
| 2160 | __entry->len = es->len; | 2190 | __entry->len = es->es_len; |
| 2161 | __entry->ret = ret; | 2191 | __entry->pblk = ext4_es_pblock(es); |
| 2192 | __entry->status = ext4_es_status(es); | ||
| 2162 | ), | 2193 | ), |
| 2163 | 2194 | ||
| 2164 | TP_printk("dev %d,%d ino %lu es [%u/%u) ret %u", | 2195 | TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %llx", |
| 2165 | MAJOR(__entry->dev), MINOR(__entry->dev), | 2196 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2166 | (unsigned long) __entry->ino, | 2197 | (unsigned long) __entry->ino, |
| 2167 | __entry->start, __entry->len, __entry->ret) | 2198 | __entry->lblk, __entry->len, |
| 2199 | __entry->pblk, __entry->status) | ||
| 2200 | ); | ||
| 2201 | |||
| 2202 | TRACE_EVENT(ext4_es_lookup_extent_enter, | ||
| 2203 | TP_PROTO(struct inode *inode, ext4_lblk_t lblk), | ||
| 2204 | |||
| 2205 | TP_ARGS(inode, lblk), | ||
| 2206 | |||
| 2207 | TP_STRUCT__entry( | ||
| 2208 | __field( dev_t, dev ) | ||
| 2209 | __field( ino_t, ino ) | ||
| 2210 | __field( ext4_lblk_t, lblk ) | ||
| 2211 | ), | ||
| 2212 | |||
| 2213 | TP_fast_assign( | ||
| 2214 | __entry->dev = inode->i_sb->s_dev; | ||
| 2215 | __entry->ino = inode->i_ino; | ||
| 2216 | __entry->lblk = lblk; | ||
| 2217 | ), | ||
| 2218 | |||
| 2219 | TP_printk("dev %d,%d ino %lu lblk %u", | ||
| 2220 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
| 2221 | (unsigned long) __entry->ino, __entry->lblk) | ||
| 2222 | ); | ||
| 2223 | |||
| 2224 | TRACE_EVENT(ext4_es_lookup_extent_exit, | ||
| 2225 | TP_PROTO(struct inode *inode, struct extent_status *es, | ||
| 2226 | int found), | ||
| 2227 | |||
| 2228 | TP_ARGS(inode, es, found), | ||
| 2229 | |||
| 2230 | TP_STRUCT__entry( | ||
| 2231 | __field( dev_t, dev ) | ||
| 2232 | __field( ino_t, ino ) | ||
| 2233 | __field( ext4_lblk_t, lblk ) | ||
| 2234 | __field( ext4_lblk_t, len ) | ||
| 2235 | __field( ext4_fsblk_t, pblk ) | ||
| 2236 | __field( unsigned long long, status ) | ||
| 2237 | __field( int, found ) | ||
| 2238 | ), | ||
| 2239 | |||
| 2240 | TP_fast_assign( | ||
| 2241 | __entry->dev = inode->i_sb->s_dev; | ||
| 2242 | __entry->ino = inode->i_ino; | ||
| 2243 | __entry->lblk = es->es_lblk; | ||
| 2244 | __entry->len = es->es_len; | ||
| 2245 | __entry->pblk = ext4_es_pblock(es); | ||
| 2246 | __entry->status = ext4_es_status(es); | ||
| 2247 | __entry->found = found; | ||
| 2248 | ), | ||
| 2249 | |||
| 2250 | TP_printk("dev %d,%d ino %lu found %d [%u/%u) %llu %llx", | ||
| 2251 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
| 2252 | (unsigned long) __entry->ino, __entry->found, | ||
| 2253 | __entry->lblk, __entry->len, | ||
| 2254 | __entry->found ? __entry->pblk : 0, | ||
| 2255 | __entry->found ? __entry->status : 0) | ||
| 2256 | ); | ||
| 2257 | |||
| 2258 | TRACE_EVENT(ext4_es_shrink_enter, | ||
| 2259 | TP_PROTO(struct super_block *sb, int nr_to_scan, int cache_cnt), | ||
| 2260 | |||
| 2261 | TP_ARGS(sb, nr_to_scan, cache_cnt), | ||
| 2262 | |||
| 2263 | TP_STRUCT__entry( | ||
| 2264 | __field( dev_t, dev ) | ||
| 2265 | __field( int, nr_to_scan ) | ||
| 2266 | __field( int, cache_cnt ) | ||
| 2267 | ), | ||
| 2268 | |||
| 2269 | TP_fast_assign( | ||
| 2270 | __entry->dev = sb->s_dev; | ||
| 2271 | __entry->nr_to_scan = nr_to_scan; | ||
| 2272 | __entry->cache_cnt = cache_cnt; | ||
| 2273 | ), | ||
| 2274 | |||
| 2275 | TP_printk("dev %d,%d nr_to_scan %d cache_cnt %d", | ||
| 2276 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
| 2277 | __entry->nr_to_scan, __entry->cache_cnt) | ||
| 2278 | ); | ||
| 2279 | |||
| 2280 | TRACE_EVENT(ext4_es_shrink_exit, | ||
| 2281 | TP_PROTO(struct super_block *sb, int shrunk_nr, int cache_cnt), | ||
| 2282 | |||
| 2283 | TP_ARGS(sb, shrunk_nr, cache_cnt), | ||
| 2284 | |||
| 2285 | TP_STRUCT__entry( | ||
| 2286 | __field( dev_t, dev ) | ||
| 2287 | __field( int, shrunk_nr ) | ||
| 2288 | __field( int, cache_cnt ) | ||
| 2289 | ), | ||
| 2290 | |||
| 2291 | TP_fast_assign( | ||
| 2292 | __entry->dev = sb->s_dev; | ||
| 2293 | __entry->shrunk_nr = shrunk_nr; | ||
| 2294 | __entry->cache_cnt = cache_cnt; | ||
| 2295 | ), | ||
| 2296 | |||
| 2297 | TP_printk("dev %d,%d shrunk_nr %d cache_cnt %d", | ||
| 2298 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
| 2299 | __entry->shrunk_nr, __entry->cache_cnt) | ||
| 2168 | ); | 2300 | ); |
| 2169 | 2301 | ||
| 2170 | #endif /* _TRACE_EXT4_H */ | 2302 | #endif /* _TRACE_EXT4_H */ |
diff --git a/include/trace/events/jbd2.h b/include/trace/events/jbd2.h index 127993dbf322..070df49e4a1d 100644 --- a/include/trace/events/jbd2.h +++ b/include/trace/events/jbd2.h | |||
| @@ -132,6 +132,104 @@ TRACE_EVENT(jbd2_submit_inode_data, | |||
| 132 | (unsigned long) __entry->ino) | 132 | (unsigned long) __entry->ino) |
| 133 | ); | 133 | ); |
| 134 | 134 | ||
| 135 | TRACE_EVENT(jbd2_handle_start, | ||
| 136 | TP_PROTO(dev_t dev, unsigned long tid, unsigned int type, | ||
| 137 | unsigned int line_no, int requested_blocks), | ||
| 138 | |||
| 139 | TP_ARGS(dev, tid, type, line_no, requested_blocks), | ||
| 140 | |||
| 141 | TP_STRUCT__entry( | ||
| 142 | __field( dev_t, dev ) | ||
| 143 | __field( unsigned long, tid ) | ||
| 144 | __field( unsigned int, type ) | ||
| 145 | __field( unsigned int, line_no ) | ||
| 146 | __field( int, requested_blocks) | ||
| 147 | ), | ||
| 148 | |||
| 149 | TP_fast_assign( | ||
| 150 | __entry->dev = dev; | ||
| 151 | __entry->tid = tid; | ||
| 152 | __entry->type = type; | ||
| 153 | __entry->line_no = line_no; | ||
| 154 | __entry->requested_blocks = requested_blocks; | ||
| 155 | ), | ||
| 156 | |||
| 157 | TP_printk("dev %d,%d tid %lu type %u line_no %u " | ||
| 158 | "requested_blocks %d", | ||
| 159 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, | ||
| 160 | __entry->type, __entry->line_no, __entry->requested_blocks) | ||
| 161 | ); | ||
| 162 | |||
| 163 | TRACE_EVENT(jbd2_handle_extend, | ||
| 164 | TP_PROTO(dev_t dev, unsigned long tid, unsigned int type, | ||
| 165 | unsigned int line_no, int buffer_credits, | ||
| 166 | int requested_blocks), | ||
| 167 | |||
| 168 | TP_ARGS(dev, tid, type, line_no, buffer_credits, requested_blocks), | ||
| 169 | |||
| 170 | TP_STRUCT__entry( | ||
| 171 | __field( dev_t, dev ) | ||
| 172 | __field( unsigned long, tid ) | ||
| 173 | __field( unsigned int, type ) | ||
| 174 | __field( unsigned int, line_no ) | ||
| 175 | __field( int, buffer_credits ) | ||
| 176 | __field( int, requested_blocks) | ||
| 177 | ), | ||
| 178 | |||
| 179 | TP_fast_assign( | ||
| 180 | __entry->dev = dev; | ||
| 181 | __entry->tid = tid; | ||
| 182 | __entry->type = type; | ||
| 183 | __entry->line_no = line_no; | ||
| 184 | __entry->buffer_credits = buffer_credits; | ||
| 185 | __entry->requested_blocks = requested_blocks; | ||
| 186 | ), | ||
| 187 | |||
| 188 | TP_printk("dev %d,%d tid %lu type %u line_no %u " | ||
| 189 | "buffer_credits %d requested_blocks %d", | ||
| 190 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, | ||
| 191 | __entry->type, __entry->line_no, __entry->buffer_credits, | ||
| 192 | __entry->requested_blocks) | ||
| 193 | ); | ||
| 194 | |||
| 195 | TRACE_EVENT(jbd2_handle_stats, | ||
| 196 | TP_PROTO(dev_t dev, unsigned long tid, unsigned int type, | ||
| 197 | unsigned int line_no, int interval, int sync, | ||
| 198 | int requested_blocks, int dirtied_blocks), | ||
| 199 | |||
| 200 | TP_ARGS(dev, tid, type, line_no, interval, sync, | ||
| 201 | requested_blocks, dirtied_blocks), | ||
| 202 | |||
| 203 | TP_STRUCT__entry( | ||
| 204 | __field( dev_t, dev ) | ||
| 205 | __field( unsigned long, tid ) | ||
| 206 | __field( unsigned int, type ) | ||
| 207 | __field( unsigned int, line_no ) | ||
| 208 | __field( int, interval ) | ||
| 209 | __field( int, sync ) | ||
| 210 | __field( int, requested_blocks) | ||
| 211 | __field( int, dirtied_blocks ) | ||
| 212 | ), | ||
| 213 | |||
| 214 | TP_fast_assign( | ||
| 215 | __entry->dev = dev; | ||
| 216 | __entry->tid = tid; | ||
| 217 | __entry->type = type; | ||
| 218 | __entry->line_no = line_no; | ||
| 219 | __entry->interval = interval; | ||
| 220 | __entry->sync = sync; | ||
| 221 | __entry->requested_blocks = requested_blocks; | ||
| 222 | __entry->dirtied_blocks = dirtied_blocks; | ||
| 223 | ), | ||
| 224 | |||
| 225 | TP_printk("dev %d,%d tid %lu type %u line_no %u interval %d " | ||
| 226 | "sync %d requested_blocks %d dirtied_blocks %d", | ||
| 227 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, | ||
| 228 | __entry->type, __entry->line_no, __entry->interval, | ||
| 229 | __entry->sync, __entry->requested_blocks, | ||
| 230 | __entry->dirtied_blocks) | ||
| 231 | ); | ||
| 232 | |||
| 135 | TRACE_EVENT(jbd2_run_stats, | 233 | TRACE_EVENT(jbd2_run_stats, |
| 136 | TP_PROTO(dev_t dev, unsigned long tid, | 234 | TP_PROTO(dev_t dev, unsigned long tid, |
| 137 | struct transaction_run_stats_s *stats), | 235 | struct transaction_run_stats_s *stats), |
| @@ -142,6 +240,7 @@ TRACE_EVENT(jbd2_run_stats, | |||
| 142 | __field( dev_t, dev ) | 240 | __field( dev_t, dev ) |
| 143 | __field( unsigned long, tid ) | 241 | __field( unsigned long, tid ) |
| 144 | __field( unsigned long, wait ) | 242 | __field( unsigned long, wait ) |
| 243 | __field( unsigned long, request_delay ) | ||
| 145 | __field( unsigned long, running ) | 244 | __field( unsigned long, running ) |
| 146 | __field( unsigned long, locked ) | 245 | __field( unsigned long, locked ) |
| 147 | __field( unsigned long, flushing ) | 246 | __field( unsigned long, flushing ) |
| @@ -155,6 +254,7 @@ TRACE_EVENT(jbd2_run_stats, | |||
| 155 | __entry->dev = dev; | 254 | __entry->dev = dev; |
| 156 | __entry->tid = tid; | 255 | __entry->tid = tid; |
| 157 | __entry->wait = stats->rs_wait; | 256 | __entry->wait = stats->rs_wait; |
| 257 | __entry->request_delay = stats->rs_request_delay; | ||
| 158 | __entry->running = stats->rs_running; | 258 | __entry->running = stats->rs_running; |
| 159 | __entry->locked = stats->rs_locked; | 259 | __entry->locked = stats->rs_locked; |
| 160 | __entry->flushing = stats->rs_flushing; | 260 | __entry->flushing = stats->rs_flushing; |
| @@ -164,10 +264,12 @@ TRACE_EVENT(jbd2_run_stats, | |||
| 164 | __entry->blocks_logged = stats->rs_blocks_logged; | 264 | __entry->blocks_logged = stats->rs_blocks_logged; |
| 165 | ), | 265 | ), |
| 166 | 266 | ||
| 167 | TP_printk("dev %d,%d tid %lu wait %u running %u locked %u flushing %u " | 267 | TP_printk("dev %d,%d tid %lu wait %u request_delay %u running %u " |
| 168 | "logging %u handle_count %u blocks %u blocks_logged %u", | 268 | "locked %u flushing %u logging %u handle_count %u " |
| 269 | "blocks %u blocks_logged %u", | ||
| 169 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, | 270 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid, |
| 170 | jiffies_to_msecs(__entry->wait), | 271 | jiffies_to_msecs(__entry->wait), |
| 272 | jiffies_to_msecs(__entry->request_delay), | ||
| 171 | jiffies_to_msecs(__entry->running), | 273 | jiffies_to_msecs(__entry->running), |
| 172 | jiffies_to_msecs(__entry->locked), | 274 | jiffies_to_msecs(__entry->locked), |
| 173 | jiffies_to_msecs(__entry->flushing), | 275 | jiffies_to_msecs(__entry->flushing), |
diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h index 7ef9e759f499..19911dddaeb7 100644 --- a/include/trace/events/kvm.h +++ b/include/trace/events/kvm.h | |||
| @@ -14,7 +14,7 @@ | |||
| 14 | ERSN(SHUTDOWN), ERSN(FAIL_ENTRY), ERSN(INTR), ERSN(SET_TPR), \ | 14 | ERSN(SHUTDOWN), ERSN(FAIL_ENTRY), ERSN(INTR), ERSN(SET_TPR), \ |
| 15 | ERSN(TPR_ACCESS), ERSN(S390_SIEIC), ERSN(S390_RESET), ERSN(DCR),\ | 15 | ERSN(TPR_ACCESS), ERSN(S390_SIEIC), ERSN(S390_RESET), ERSN(DCR),\ |
| 16 | ERSN(NMI), ERSN(INTERNAL_ERROR), ERSN(OSI), ERSN(PAPR_HCALL), \ | 16 | ERSN(NMI), ERSN(INTERNAL_ERROR), ERSN(OSI), ERSN(PAPR_HCALL), \ |
| 17 | ERSN(S390_UCONTROL) | 17 | ERSN(S390_UCONTROL), ERSN(WATCHDOG), ERSN(S390_TSCH) |
| 18 | 18 | ||
| 19 | TRACE_EVENT(kvm_userspace_exit, | 19 | TRACE_EVENT(kvm_userspace_exit, |
| 20 | TP_PROTO(__u32 reason, int errno), | 20 | TP_PROTO(__u32 reason, int errno), |
diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h index b453d92c2253..6a16fd2e70ed 100644 --- a/include/trace/events/writeback.h +++ b/include/trace/events/writeback.h | |||
| @@ -32,6 +32,115 @@ | |||
| 32 | 32 | ||
| 33 | struct wb_writeback_work; | 33 | struct wb_writeback_work; |
| 34 | 34 | ||
| 35 | TRACE_EVENT(writeback_dirty_page, | ||
| 36 | |||
| 37 | TP_PROTO(struct page *page, struct address_space *mapping), | ||
| 38 | |||
| 39 | TP_ARGS(page, mapping), | ||
| 40 | |||
| 41 | TP_STRUCT__entry ( | ||
| 42 | __array(char, name, 32) | ||
| 43 | __field(unsigned long, ino) | ||
| 44 | __field(pgoff_t, index) | ||
| 45 | ), | ||
| 46 | |||
| 47 | TP_fast_assign( | ||
| 48 | strncpy(__entry->name, | ||
| 49 | mapping ? dev_name(mapping->backing_dev_info->dev) : "(unknown)", 32); | ||
| 50 | __entry->ino = mapping ? mapping->host->i_ino : 0; | ||
| 51 | __entry->index = page->index; | ||
| 52 | ), | ||
| 53 | |||
| 54 | TP_printk("bdi %s: ino=%lu index=%lu", | ||
| 55 | __entry->name, | ||
| 56 | __entry->ino, | ||
| 57 | __entry->index | ||
| 58 | ) | ||
| 59 | ); | ||
| 60 | |||
| 61 | DECLARE_EVENT_CLASS(writeback_dirty_inode_template, | ||
| 62 | |||
| 63 | TP_PROTO(struct inode *inode, int flags), | ||
| 64 | |||
| 65 | TP_ARGS(inode, flags), | ||
| 66 | |||
| 67 | TP_STRUCT__entry ( | ||
| 68 | __array(char, name, 32) | ||
| 69 | __field(unsigned long, ino) | ||
| 70 | __field(unsigned long, flags) | ||
| 71 | ), | ||
| 72 | |||
| 73 | TP_fast_assign( | ||
| 74 | struct backing_dev_info *bdi = inode->i_mapping->backing_dev_info; | ||
| 75 | |||
| 76 | /* may be called for files on pseudo FSes w/ unregistered bdi */ | ||
| 77 | strncpy(__entry->name, | ||
| 78 | bdi->dev ? dev_name(bdi->dev) : "(unknown)", 32); | ||
| 79 | __entry->ino = inode->i_ino; | ||
| 80 | __entry->flags = flags; | ||
| 81 | ), | ||
| 82 | |||
| 83 | TP_printk("bdi %s: ino=%lu flags=%s", | ||
| 84 | __entry->name, | ||
| 85 | __entry->ino, | ||
| 86 | show_inode_state(__entry->flags) | ||
| 87 | ) | ||
| 88 | ); | ||
| 89 | |||
| 90 | DEFINE_EVENT(writeback_dirty_inode_template, writeback_dirty_inode_start, | ||
| 91 | |||
| 92 | TP_PROTO(struct inode *inode, int flags), | ||
| 93 | |||
| 94 | TP_ARGS(inode, flags) | ||
| 95 | ); | ||
| 96 | |||
| 97 | DEFINE_EVENT(writeback_dirty_inode_template, writeback_dirty_inode, | ||
| 98 | |||
| 99 | TP_PROTO(struct inode *inode, int flags), | ||
| 100 | |||
| 101 | TP_ARGS(inode, flags) | ||
| 102 | ); | ||
| 103 | |||
| 104 | DECLARE_EVENT_CLASS(writeback_write_inode_template, | ||
| 105 | |||
| 106 | TP_PROTO(struct inode *inode, struct writeback_control *wbc), | ||
| 107 | |||
| 108 | TP_ARGS(inode, wbc), | ||
| 109 | |||
| 110 | TP_STRUCT__entry ( | ||
| 111 | __array(char, name, 32) | ||
| 112 | __field(unsigned long, ino) | ||
| 113 | __field(int, sync_mode) | ||
| 114 | ), | ||
| 115 | |||
| 116 | TP_fast_assign( | ||
| 117 | strncpy(__entry->name, | ||
| 118 | dev_name(inode->i_mapping->backing_dev_info->dev), 32); | ||
| 119 | __entry->ino = inode->i_ino; | ||
| 120 | __entry->sync_mode = wbc->sync_mode; | ||
| 121 | ), | ||
| 122 | |||
| 123 | TP_printk("bdi %s: ino=%lu sync_mode=%d", | ||
| 124 | __entry->name, | ||
| 125 | __entry->ino, | ||
| 126 | __entry->sync_mode | ||
| 127 | ) | ||
| 128 | ); | ||
| 129 | |||
| 130 | DEFINE_EVENT(writeback_write_inode_template, writeback_write_inode_start, | ||
| 131 | |||
| 132 | TP_PROTO(struct inode *inode, struct writeback_control *wbc), | ||
| 133 | |||
| 134 | TP_ARGS(inode, wbc) | ||
| 135 | ); | ||
| 136 | |||
| 137 | DEFINE_EVENT(writeback_write_inode_template, writeback_write_inode, | ||
| 138 | |||
| 139 | TP_PROTO(struct inode *inode, struct writeback_control *wbc), | ||
| 140 | |||
| 141 | TP_ARGS(inode, wbc) | ||
| 142 | ); | ||
| 143 | |||
| 35 | DECLARE_EVENT_CLASS(writeback_work_class, | 144 | DECLARE_EVENT_CLASS(writeback_work_class, |
| 36 | TP_PROTO(struct backing_dev_info *bdi, struct wb_writeback_work *work), | 145 | TP_PROTO(struct backing_dev_info *bdi, struct wb_writeback_work *work), |
| 37 | TP_ARGS(bdi, work), | 146 | TP_ARGS(bdi, work), |
| @@ -479,6 +588,13 @@ DECLARE_EVENT_CLASS(writeback_single_inode_template, | |||
| 479 | ) | 588 | ) |
| 480 | ); | 589 | ); |
| 481 | 590 | ||
| 591 | DEFINE_EVENT(writeback_single_inode_template, writeback_single_inode_start, | ||
| 592 | TP_PROTO(struct inode *inode, | ||
| 593 | struct writeback_control *wbc, | ||
| 594 | unsigned long nr_to_write), | ||
| 595 | TP_ARGS(inode, wbc, nr_to_write) | ||
| 596 | ); | ||
| 597 | |||
| 482 | DEFINE_EVENT(writeback_single_inode_template, writeback_single_inode, | 598 | DEFINE_EVENT(writeback_single_inode_template, writeback_single_inode, |
| 483 | TP_PROTO(struct inode *inode, | 599 | TP_PROTO(struct inode *inode, |
| 484 | struct writeback_control *wbc, | 600 | struct writeback_control *wbc, |
diff --git a/include/uapi/asm-generic/signal.h b/include/uapi/asm-generic/signal.h index 6fae30fd16ab..9df61f1edb0f 100644 --- a/include/uapi/asm-generic/signal.h +++ b/include/uapi/asm-generic/signal.h | |||
| @@ -93,6 +93,11 @@ typedef unsigned long old_sigset_t; | |||
| 93 | 93 | ||
| 94 | #include <asm-generic/signal-defs.h> | 94 | #include <asm-generic/signal-defs.h> |
| 95 | 95 | ||
| 96 | #ifdef SA_RESTORER | ||
| 97 | #define __ARCH_HAS_SA_RESTORER | ||
| 98 | #endif | ||
| 99 | |||
| 100 | #ifndef __KERNEL__ | ||
| 96 | struct sigaction { | 101 | struct sigaction { |
| 97 | __sighandler_t sa_handler; | 102 | __sighandler_t sa_handler; |
| 98 | unsigned long sa_flags; | 103 | unsigned long sa_flags; |
| @@ -101,10 +106,7 @@ struct sigaction { | |||
| 101 | #endif | 106 | #endif |
| 102 | sigset_t sa_mask; /* mask last for extensibility */ | 107 | sigset_t sa_mask; /* mask last for extensibility */ |
| 103 | }; | 108 | }; |
| 104 | 109 | #endif | |
| 105 | struct k_sigaction { | ||
| 106 | struct sigaction sa; | ||
| 107 | }; | ||
| 108 | 110 | ||
| 109 | typedef struct sigaltstack { | 111 | typedef struct sigaltstack { |
| 110 | void __user *ss_sp; | 112 | void __user *ss_sp; |
diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h index 2c531f478410..0cc74c4403e4 100644 --- a/include/uapi/asm-generic/unistd.h +++ b/include/uapi/asm-generic/unistd.h | |||
| @@ -402,9 +402,9 @@ __SC_COMP(__NR_rt_sigsuspend, sys_rt_sigsuspend, compat_sys_rt_sigsuspend) | |||
| 402 | #define __NR_rt_sigaction 134 | 402 | #define __NR_rt_sigaction 134 |
| 403 | __SC_COMP(__NR_rt_sigaction, sys_rt_sigaction, compat_sys_rt_sigaction) | 403 | __SC_COMP(__NR_rt_sigaction, sys_rt_sigaction, compat_sys_rt_sigaction) |
| 404 | #define __NR_rt_sigprocmask 135 | 404 | #define __NR_rt_sigprocmask 135 |
| 405 | __SYSCALL(__NR_rt_sigprocmask, sys_rt_sigprocmask) | 405 | __SC_COMP(__NR_rt_sigprocmask, sys_rt_sigprocmask, compat_sys_rt_sigprocmask) |
| 406 | #define __NR_rt_sigpending 136 | 406 | #define __NR_rt_sigpending 136 |
| 407 | __SYSCALL(__NR_rt_sigpending, sys_rt_sigpending) | 407 | __SC_COMP(__NR_rt_sigpending, sys_rt_sigpending, compat_sys_rt_sigpending) |
| 408 | #define __NR_rt_sigtimedwait 137 | 408 | #define __NR_rt_sigtimedwait 137 |
| 409 | __SC_COMP(__NR_rt_sigtimedwait, sys_rt_sigtimedwait, \ | 409 | __SC_COMP(__NR_rt_sigtimedwait, sys_rt_sigtimedwait, \ |
| 410 | compat_sys_rt_sigtimedwait) | 410 | compat_sys_rt_sigtimedwait) |
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h index c4d2e9c74002..07d59419fe6b 100644 --- a/include/uapi/drm/i915_drm.h +++ b/include/uapi/drm/i915_drm.h | |||
| @@ -308,6 +308,8 @@ typedef struct drm_i915_irq_wait { | |||
| 308 | #define I915_PARAM_RSVD_FOR_FUTURE_USE 22 | 308 | #define I915_PARAM_RSVD_FOR_FUTURE_USE 22 |
| 309 | #define I915_PARAM_HAS_SECURE_BATCHES 23 | 309 | #define I915_PARAM_HAS_SECURE_BATCHES 23 |
| 310 | #define I915_PARAM_HAS_PINNED_BATCHES 24 | 310 | #define I915_PARAM_HAS_PINNED_BATCHES 24 |
| 311 | #define I915_PARAM_HAS_EXEC_NO_RELOC 25 | ||
| 312 | #define I915_PARAM_HAS_EXEC_HANDLE_LUT 26 | ||
| 311 | 313 | ||
| 312 | typedef struct drm_i915_getparam { | 314 | typedef struct drm_i915_getparam { |
| 313 | int param; | 315 | int param; |
| @@ -628,7 +630,11 @@ struct drm_i915_gem_exec_object2 { | |||
| 628 | __u64 offset; | 630 | __u64 offset; |
| 629 | 631 | ||
| 630 | #define EXEC_OBJECT_NEEDS_FENCE (1<<0) | 632 | #define EXEC_OBJECT_NEEDS_FENCE (1<<0) |
| 633 | #define EXEC_OBJECT_NEEDS_GTT (1<<1) | ||
| 634 | #define EXEC_OBJECT_WRITE (1<<2) | ||
| 635 | #define __EXEC_OBJECT_UNKNOWN_FLAGS -(EXEC_OBJECT_WRITE<<1) | ||
| 631 | __u64 flags; | 636 | __u64 flags; |
| 637 | |||
| 632 | __u64 rsvd1; | 638 | __u64 rsvd1; |
| 633 | __u64 rsvd2; | 639 | __u64 rsvd2; |
| 634 | }; | 640 | }; |
| @@ -687,6 +693,20 @@ struct drm_i915_gem_execbuffer2 { | |||
| 687 | */ | 693 | */ |
| 688 | #define I915_EXEC_IS_PINNED (1<<10) | 694 | #define I915_EXEC_IS_PINNED (1<<10) |
| 689 | 695 | ||
| 696 | /** Provide a hint to the kernel that the command stream and auxilliary | ||
| 697 | * state buffers already holds the correct presumed addresses and so the | ||
| 698 | * relocation process may be skipped if no buffers need to be moved in | ||
| 699 | * preparation for the execbuffer. | ||
| 700 | */ | ||
| 701 | #define I915_EXEC_NO_RELOC (1<<11) | ||
| 702 | |||
| 703 | /** Use the reloc.handle as an index into the exec object array rather | ||
| 704 | * than as the per-file handle. | ||
| 705 | */ | ||
| 706 | #define I915_EXEC_HANDLE_LUT (1<<12) | ||
| 707 | |||
| 708 | #define __I915_EXEC_UNKNOWN_FLAGS -(I915_EXEC_HANDLE_LUT<<1) | ||
| 709 | |||
| 690 | #define I915_EXEC_CONTEXT_ID_MASK (0xffffffff) | 710 | #define I915_EXEC_CONTEXT_ID_MASK (0xffffffff) |
| 691 | #define i915_execbuffer2_set_context_id(eb2, context) \ | 711 | #define i915_execbuffer2_set_context_id(eb2, context) \ |
| 692 | (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK | 712 | (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK |
diff --git a/include/uapi/drm/omap_drm.h b/include/uapi/drm/omap_drm.h new file mode 100644 index 000000000000..1d0b1172664e --- /dev/null +++ b/include/uapi/drm/omap_drm.h | |||
| @@ -0,0 +1,123 @@ | |||
| 1 | /* | ||
| 2 | * include/uapi/drm/omap_drm.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2011 Texas Instruments | ||
| 5 | * Author: Rob Clark <rob@ti.com> | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify it | ||
| 8 | * under the terms of the GNU General Public License version 2 as published by | ||
| 9 | * the Free Software Foundation. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 14 | * more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License along with | ||
| 17 | * this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 18 | */ | ||
| 19 | |||
| 20 | #ifndef __OMAP_DRM_H__ | ||
| 21 | #define __OMAP_DRM_H__ | ||
| 22 | |||
| 23 | #include <drm/drm.h> | ||
| 24 | |||
| 25 | /* Please note that modifications to all structs defined here are | ||
| 26 | * subject to backwards-compatibility constraints. | ||
| 27 | */ | ||
| 28 | |||
| 29 | #define OMAP_PARAM_CHIPSET_ID 1 /* ie. 0x3430, 0x4430, etc */ | ||
| 30 | |||
| 31 | struct drm_omap_param { | ||
| 32 | uint64_t param; /* in */ | ||
| 33 | uint64_t value; /* in (set_param), out (get_param) */ | ||
| 34 | }; | ||
| 35 | |||
| 36 | #define OMAP_BO_SCANOUT 0x00000001 /* scanout capable (phys contiguous) */ | ||
| 37 | #define OMAP_BO_CACHE_MASK 0x00000006 /* cache type mask, see cache modes */ | ||
| 38 | #define OMAP_BO_TILED_MASK 0x00000f00 /* tiled mapping mask, see tiled modes */ | ||
| 39 | |||
| 40 | /* cache modes */ | ||
| 41 | #define OMAP_BO_CACHED 0x00000000 /* default */ | ||
| 42 | #define OMAP_BO_WC 0x00000002 /* write-combine */ | ||
| 43 | #define OMAP_BO_UNCACHED 0x00000004 /* strongly-ordered (uncached) */ | ||
| 44 | |||
| 45 | /* tiled modes */ | ||
| 46 | #define OMAP_BO_TILED_8 0x00000100 | ||
| 47 | #define OMAP_BO_TILED_16 0x00000200 | ||
| 48 | #define OMAP_BO_TILED_32 0x00000300 | ||
| 49 | #define OMAP_BO_TILED (OMAP_BO_TILED_8 | OMAP_BO_TILED_16 | OMAP_BO_TILED_32) | ||
| 50 | |||
| 51 | union omap_gem_size { | ||
| 52 | uint32_t bytes; /* (for non-tiled formats) */ | ||
| 53 | struct { | ||
| 54 | uint16_t width; | ||
| 55 | uint16_t height; | ||
| 56 | } tiled; /* (for tiled formats) */ | ||
| 57 | }; | ||
| 58 | |||
| 59 | struct drm_omap_gem_new { | ||
| 60 | union omap_gem_size size; /* in */ | ||
| 61 | uint32_t flags; /* in */ | ||
| 62 | uint32_t handle; /* out */ | ||
| 63 | uint32_t __pad; | ||
| 64 | }; | ||
| 65 | |||
| 66 | /* mask of operations: */ | ||
| 67 | enum omap_gem_op { | ||
| 68 | OMAP_GEM_READ = 0x01, | ||
| 69 | OMAP_GEM_WRITE = 0x02, | ||
| 70 | }; | ||
| 71 | |||
| 72 | struct drm_omap_gem_cpu_prep { | ||
| 73 | uint32_t handle; /* buffer handle (in) */ | ||
| 74 | uint32_t op; /* mask of omap_gem_op (in) */ | ||
| 75 | }; | ||
| 76 | |||
| 77 | struct drm_omap_gem_cpu_fini { | ||
| 78 | uint32_t handle; /* buffer handle (in) */ | ||
| 79 | uint32_t op; /* mask of omap_gem_op (in) */ | ||
| 80 | /* TODO maybe here we pass down info about what regions are touched | ||
| 81 | * by sw so we can be clever about cache ops? For now a placeholder, | ||
| 82 | * set to zero and we just do full buffer flush.. | ||
| 83 | */ | ||
| 84 | uint32_t nregions; | ||
| 85 | uint32_t __pad; | ||
| 86 | }; | ||
| 87 | |||
| 88 | struct drm_omap_gem_info { | ||
| 89 | uint32_t handle; /* buffer handle (in) */ | ||
| 90 | uint32_t pad; | ||
| 91 | uint64_t offset; /* mmap offset (out) */ | ||
| 92 | /* note: in case of tiled buffers, the user virtual size can be | ||
| 93 | * different from the physical size (ie. how many pages are needed | ||
| 94 | * to back the object) which is returned in DRM_IOCTL_GEM_OPEN.. | ||
| 95 | * This size here is the one that should be used if you want to | ||
| 96 | * mmap() the buffer: | ||
| 97 | */ | ||
| 98 | uint32_t size; /* virtual size for mmap'ing (out) */ | ||
| 99 | uint32_t __pad; | ||
| 100 | }; | ||
| 101 | |||
| 102 | #define DRM_OMAP_GET_PARAM 0x00 | ||
| 103 | #define DRM_OMAP_SET_PARAM 0x01 | ||
| 104 | /* placeholder for plugin-api | ||
| 105 | #define DRM_OMAP_GET_BASE 0x02 | ||
| 106 | */ | ||
| 107 | #define DRM_OMAP_GEM_NEW 0x03 | ||
| 108 | #define DRM_OMAP_GEM_CPU_PREP 0x04 | ||
| 109 | #define DRM_OMAP_GEM_CPU_FINI 0x05 | ||
| 110 | #define DRM_OMAP_GEM_INFO 0x06 | ||
| 111 | #define DRM_OMAP_NUM_IOCTLS 0x07 | ||
| 112 | |||
| 113 | #define DRM_IOCTL_OMAP_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_OMAP_GET_PARAM, struct drm_omap_param) | ||
| 114 | #define DRM_IOCTL_OMAP_SET_PARAM DRM_IOW (DRM_COMMAND_BASE + DRM_OMAP_SET_PARAM, struct drm_omap_param) | ||
| 115 | /* placeholder for plugin-api | ||
| 116 | #define DRM_IOCTL_OMAP_GET_BASE DRM_IOWR(DRM_COMMAND_BASE + DRM_OMAP_GET_BASE, struct drm_omap_get_base) | ||
| 117 | */ | ||
| 118 | #define DRM_IOCTL_OMAP_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_OMAP_GEM_NEW, struct drm_omap_gem_new) | ||
| 119 | #define DRM_IOCTL_OMAP_GEM_CPU_PREP DRM_IOW (DRM_COMMAND_BASE + DRM_OMAP_GEM_CPU_PREP, struct drm_omap_gem_cpu_prep) | ||
| 120 | #define DRM_IOCTL_OMAP_GEM_CPU_FINI DRM_IOW (DRM_COMMAND_BASE + DRM_OMAP_GEM_CPU_FINI, struct drm_omap_gem_cpu_fini) | ||
| 121 | #define DRM_IOCTL_OMAP_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_OMAP_GEM_INFO, struct drm_omap_gem_info) | ||
| 122 | |||
| 123 | #endif /* __OMAP_DRM_H__ */ | ||
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild index 4e67194fd2c3..5c8a1d25e21c 100644 --- a/include/uapi/linux/Kbuild +++ b/include/uapi/linux/Kbuild | |||
| @@ -68,6 +68,7 @@ header-y += blkpg.h | |||
| 68 | header-y += blktrace_api.h | 68 | header-y += blktrace_api.h |
| 69 | header-y += bpqether.h | 69 | header-y += bpqether.h |
| 70 | header-y += bsg.h | 70 | header-y += bsg.h |
| 71 | header-y += btrfs.h | ||
| 71 | header-y += can.h | 72 | header-y += can.h |
| 72 | header-y += capability.h | 73 | header-y += capability.h |
| 73 | header-y += capi.h | 74 | header-y += capi.h |
diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h new file mode 100644 index 000000000000..fa3a5f9338fc --- /dev/null +++ b/include/uapi/linux/btrfs.h | |||
| @@ -0,0 +1,514 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2007 Oracle. All rights reserved. | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or | ||
| 5 | * modify it under the terms of the GNU General Public | ||
| 6 | * License v2 as published by the Free Software Foundation. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 11 | * General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public | ||
| 14 | * License along with this program; if not, write to the | ||
| 15 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
| 16 | * Boston, MA 021110-1307, USA. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef _UAPI_LINUX_BTRFS_H | ||
| 20 | #define _UAPI_LINUX_BTRFS_H | ||
| 21 | #include <linux/types.h> | ||
| 22 | #include <linux/ioctl.h> | ||
| 23 | |||
| 24 | #define BTRFS_IOCTL_MAGIC 0x94 | ||
| 25 | #define BTRFS_VOL_NAME_MAX 255 | ||
| 26 | |||
| 27 | /* this should be 4k */ | ||
| 28 | #define BTRFS_PATH_NAME_MAX 4087 | ||
| 29 | struct btrfs_ioctl_vol_args { | ||
| 30 | __s64 fd; | ||
| 31 | char name[BTRFS_PATH_NAME_MAX + 1]; | ||
| 32 | }; | ||
| 33 | |||
| 34 | #define BTRFS_DEVICE_PATH_NAME_MAX 1024 | ||
| 35 | |||
| 36 | #define BTRFS_SUBVOL_CREATE_ASYNC (1ULL << 0) | ||
| 37 | #define BTRFS_SUBVOL_RDONLY (1ULL << 1) | ||
| 38 | #define BTRFS_SUBVOL_QGROUP_INHERIT (1ULL << 2) | ||
| 39 | #define BTRFS_FSID_SIZE 16 | ||
| 40 | #define BTRFS_UUID_SIZE 16 | ||
| 41 | |||
| 42 | #define BTRFS_QGROUP_INHERIT_SET_LIMITS (1ULL << 0) | ||
| 43 | |||
| 44 | struct btrfs_qgroup_limit { | ||
| 45 | __u64 flags; | ||
| 46 | __u64 max_rfer; | ||
| 47 | __u64 max_excl; | ||
| 48 | __u64 rsv_rfer; | ||
| 49 | __u64 rsv_excl; | ||
| 50 | }; | ||
| 51 | |||
| 52 | struct btrfs_qgroup_inherit { | ||
| 53 | __u64 flags; | ||
| 54 | __u64 num_qgroups; | ||
| 55 | __u64 num_ref_copies; | ||
| 56 | __u64 num_excl_copies; | ||
| 57 | struct btrfs_qgroup_limit lim; | ||
| 58 | __u64 qgroups[0]; | ||
| 59 | }; | ||
| 60 | |||
| 61 | struct btrfs_ioctl_qgroup_limit_args { | ||
| 62 | __u64 qgroupid; | ||
| 63 | struct btrfs_qgroup_limit lim; | ||
| 64 | }; | ||
| 65 | |||
| 66 | #define BTRFS_SUBVOL_NAME_MAX 4039 | ||
| 67 | struct btrfs_ioctl_vol_args_v2 { | ||
| 68 | __s64 fd; | ||
| 69 | __u64 transid; | ||
| 70 | __u64 flags; | ||
| 71 | union { | ||
| 72 | struct { | ||
| 73 | __u64 size; | ||
| 74 | struct btrfs_qgroup_inherit __user *qgroup_inherit; | ||
| 75 | }; | ||
| 76 | __u64 unused[4]; | ||
| 77 | }; | ||
| 78 | char name[BTRFS_SUBVOL_NAME_MAX + 1]; | ||
| 79 | }; | ||
| 80 | |||
| 81 | /* | ||
| 82 | * structure to report errors and progress to userspace, either as a | ||
| 83 | * result of a finished scrub, a canceled scrub or a progress inquiry | ||
| 84 | */ | ||
| 85 | struct btrfs_scrub_progress { | ||
| 86 | __u64 data_extents_scrubbed; /* # of data extents scrubbed */ | ||
| 87 | __u64 tree_extents_scrubbed; /* # of tree extents scrubbed */ | ||
| 88 | __u64 data_bytes_scrubbed; /* # of data bytes scrubbed */ | ||
| 89 | __u64 tree_bytes_scrubbed; /* # of tree bytes scrubbed */ | ||
| 90 | __u64 read_errors; /* # of read errors encountered (EIO) */ | ||
| 91 | __u64 csum_errors; /* # of failed csum checks */ | ||
| 92 | __u64 verify_errors; /* # of occurences, where the metadata | ||
| 93 | * of a tree block did not match the | ||
| 94 | * expected values, like generation or | ||
| 95 | * logical */ | ||
| 96 | __u64 no_csum; /* # of 4k data block for which no csum | ||
| 97 | * is present, probably the result of | ||
| 98 | * data written with nodatasum */ | ||
| 99 | __u64 csum_discards; /* # of csum for which no data was found | ||
| 100 | * in the extent tree. */ | ||
| 101 | __u64 super_errors; /* # of bad super blocks encountered */ | ||
| 102 | __u64 malloc_errors; /* # of internal kmalloc errors. These | ||
| 103 | * will likely cause an incomplete | ||
| 104 | * scrub */ | ||
| 105 | __u64 uncorrectable_errors; /* # of errors where either no intact | ||
| 106 | * copy was found or the writeback | ||
| 107 | * failed */ | ||
| 108 | __u64 corrected_errors; /* # of errors corrected */ | ||
| 109 | __u64 last_physical; /* last physical address scrubbed. In | ||
| 110 | * case a scrub was aborted, this can | ||
| 111 | * be used to restart the scrub */ | ||
| 112 | __u64 unverified_errors; /* # of occurences where a read for a | ||
| 113 | * full (64k) bio failed, but the re- | ||
| 114 | * check succeeded for each 4k piece. | ||
| 115 | * Intermittent error. */ | ||
| 116 | }; | ||
| 117 | |||
| 118 | #define BTRFS_SCRUB_READONLY 1 | ||
| 119 | struct btrfs_ioctl_scrub_args { | ||
| 120 | __u64 devid; /* in */ | ||
| 121 | __u64 start; /* in */ | ||
| 122 | __u64 end; /* in */ | ||
| 123 | __u64 flags; /* in */ | ||
| 124 | struct btrfs_scrub_progress progress; /* out */ | ||
| 125 | /* pad to 1k */ | ||
| 126 | __u64 unused[(1024-32-sizeof(struct btrfs_scrub_progress))/8]; | ||
| 127 | }; | ||
| 128 | |||
| 129 | #define BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_ALWAYS 0 | ||
| 130 | #define BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_AVOID 1 | ||
| 131 | struct btrfs_ioctl_dev_replace_start_params { | ||
| 132 | __u64 srcdevid; /* in, if 0, use srcdev_name instead */ | ||
| 133 | __u64 cont_reading_from_srcdev_mode; /* in, see #define | ||
| 134 | * above */ | ||
| 135 | __u8 srcdev_name[BTRFS_DEVICE_PATH_NAME_MAX + 1]; /* in */ | ||
| 136 | __u8 tgtdev_name[BTRFS_DEVICE_PATH_NAME_MAX + 1]; /* in */ | ||
| 137 | }; | ||
| 138 | |||
| 139 | #define BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED 0 | ||
| 140 | #define BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED 1 | ||
| 141 | #define BTRFS_IOCTL_DEV_REPLACE_STATE_FINISHED 2 | ||
| 142 | #define BTRFS_IOCTL_DEV_REPLACE_STATE_CANCELED 3 | ||
| 143 | #define BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED 4 | ||
| 144 | struct btrfs_ioctl_dev_replace_status_params { | ||
| 145 | __u64 replace_state; /* out, see #define above */ | ||
| 146 | __u64 progress_1000; /* out, 0 <= x <= 1000 */ | ||
| 147 | __u64 time_started; /* out, seconds since 1-Jan-1970 */ | ||
| 148 | __u64 time_stopped; /* out, seconds since 1-Jan-1970 */ | ||
| 149 | __u64 num_write_errors; /* out */ | ||
| 150 | __u64 num_uncorrectable_read_errors; /* out */ | ||
| 151 | }; | ||
| 152 | |||
| 153 | #define BTRFS_IOCTL_DEV_REPLACE_CMD_START 0 | ||
| 154 | #define BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS 1 | ||
| 155 | #define BTRFS_IOCTL_DEV_REPLACE_CMD_CANCEL 2 | ||
| 156 | #define BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR 0 | ||
| 157 | #define BTRFS_IOCTL_DEV_REPLACE_RESULT_NOT_STARTED 1 | ||
| 158 | #define BTRFS_IOCTL_DEV_REPLACE_RESULT_ALREADY_STARTED 2 | ||
| 159 | struct btrfs_ioctl_dev_replace_args { | ||
| 160 | __u64 cmd; /* in */ | ||
| 161 | __u64 result; /* out */ | ||
| 162 | |||
| 163 | union { | ||
| 164 | struct btrfs_ioctl_dev_replace_start_params start; | ||
| 165 | struct btrfs_ioctl_dev_replace_status_params status; | ||
| 166 | }; /* in/out */ | ||
| 167 | |||
| 168 | __u64 spare[64]; | ||
| 169 | }; | ||
| 170 | |||
| 171 | struct btrfs_ioctl_dev_info_args { | ||
| 172 | __u64 devid; /* in/out */ | ||
| 173 | __u8 uuid[BTRFS_UUID_SIZE]; /* in/out */ | ||
| 174 | __u64 bytes_used; /* out */ | ||
| 175 | __u64 total_bytes; /* out */ | ||
| 176 | __u64 unused[379]; /* pad to 4k */ | ||
| 177 | __u8 path[BTRFS_DEVICE_PATH_NAME_MAX]; /* out */ | ||
| 178 | }; | ||
| 179 | |||
| 180 | struct btrfs_ioctl_fs_info_args { | ||
| 181 | __u64 max_id; /* out */ | ||
| 182 | __u64 num_devices; /* out */ | ||
| 183 | __u8 fsid[BTRFS_FSID_SIZE]; /* out */ | ||
| 184 | __u64 reserved[124]; /* pad to 1k */ | ||
| 185 | }; | ||
| 186 | |||
| 187 | /* balance control ioctl modes */ | ||
| 188 | #define BTRFS_BALANCE_CTL_PAUSE 1 | ||
| 189 | #define BTRFS_BALANCE_CTL_CANCEL 2 | ||
| 190 | |||
| 191 | /* | ||
| 192 | * this is packed, because it should be exactly the same as its disk | ||
| 193 | * byte order counterpart (struct btrfs_disk_balance_args) | ||
| 194 | */ | ||
| 195 | struct btrfs_balance_args { | ||
| 196 | __u64 profiles; | ||
| 197 | __u64 usage; | ||
| 198 | __u64 devid; | ||
| 199 | __u64 pstart; | ||
| 200 | __u64 pend; | ||
| 201 | __u64 vstart; | ||
| 202 | __u64 vend; | ||
| 203 | |||
| 204 | __u64 target; | ||
| 205 | |||
| 206 | __u64 flags; | ||
| 207 | |||
| 208 | __u64 unused[8]; | ||
| 209 | } __attribute__ ((__packed__)); | ||
| 210 | |||
| 211 | /* report balance progress to userspace */ | ||
| 212 | struct btrfs_balance_progress { | ||
| 213 | __u64 expected; /* estimated # of chunks that will be | ||
| 214 | * relocated to fulfill the request */ | ||
| 215 | __u64 considered; /* # of chunks we have considered so far */ | ||
| 216 | __u64 completed; /* # of chunks relocated so far */ | ||
| 217 | }; | ||
| 218 | |||
| 219 | #define BTRFS_BALANCE_STATE_RUNNING (1ULL << 0) | ||
| 220 | #define BTRFS_BALANCE_STATE_PAUSE_REQ (1ULL << 1) | ||
| 221 | #define BTRFS_BALANCE_STATE_CANCEL_REQ (1ULL << 2) | ||
| 222 | |||
| 223 | struct btrfs_ioctl_balance_args { | ||
| 224 | __u64 flags; /* in/out */ | ||
| 225 | __u64 state; /* out */ | ||
| 226 | |||
| 227 | struct btrfs_balance_args data; /* in/out */ | ||
| 228 | struct btrfs_balance_args meta; /* in/out */ | ||
| 229 | struct btrfs_balance_args sys; /* in/out */ | ||
| 230 | |||
| 231 | struct btrfs_balance_progress stat; /* out */ | ||
| 232 | |||
| 233 | __u64 unused[72]; /* pad to 1k */ | ||
| 234 | }; | ||
| 235 | |||
| 236 | #define BTRFS_INO_LOOKUP_PATH_MAX 4080 | ||
| 237 | struct btrfs_ioctl_ino_lookup_args { | ||
| 238 | __u64 treeid; | ||
| 239 | __u64 objectid; | ||
| 240 | char name[BTRFS_INO_LOOKUP_PATH_MAX]; | ||
| 241 | }; | ||
| 242 | |||
| 243 | struct btrfs_ioctl_search_key { | ||
| 244 | /* which root are we searching. 0 is the tree of tree roots */ | ||
| 245 | __u64 tree_id; | ||
| 246 | |||
| 247 | /* keys returned will be >= min and <= max */ | ||
| 248 | __u64 min_objectid; | ||
| 249 | __u64 max_objectid; | ||
| 250 | |||
| 251 | /* keys returned will be >= min and <= max */ | ||
| 252 | __u64 min_offset; | ||
| 253 | __u64 max_offset; | ||
| 254 | |||
| 255 | /* max and min transids to search for */ | ||
| 256 | __u64 min_transid; | ||
| 257 | __u64 max_transid; | ||
| 258 | |||
| 259 | /* keys returned will be >= min and <= max */ | ||
| 260 | __u32 min_type; | ||
| 261 | __u32 max_type; | ||
| 262 | |||
| 263 | /* | ||
| 264 | * how many items did userland ask for, and how many are we | ||
| 265 | * returning | ||
| 266 | */ | ||
| 267 | __u32 nr_items; | ||
| 268 | |||
| 269 | /* align to 64 bits */ | ||
| 270 | __u32 unused; | ||
| 271 | |||
| 272 | /* some extra for later */ | ||
| 273 | __u64 unused1; | ||
| 274 | __u64 unused2; | ||
| 275 | __u64 unused3; | ||
| 276 | __u64 unused4; | ||
| 277 | }; | ||
| 278 | |||
| 279 | struct btrfs_ioctl_search_header { | ||
| 280 | __u64 transid; | ||
| 281 | __u64 objectid; | ||
| 282 | __u64 offset; | ||
| 283 | __u32 type; | ||
| 284 | __u32 len; | ||
| 285 | }; | ||
| 286 | |||
| 287 | #define BTRFS_SEARCH_ARGS_BUFSIZE (4096 - sizeof(struct btrfs_ioctl_search_key)) | ||
| 288 | /* | ||
| 289 | * the buf is an array of search headers where | ||
| 290 | * each header is followed by the actual item | ||
| 291 | * the type field is expanded to 32 bits for alignment | ||
| 292 | */ | ||
| 293 | struct btrfs_ioctl_search_args { | ||
| 294 | struct btrfs_ioctl_search_key key; | ||
| 295 | char buf[BTRFS_SEARCH_ARGS_BUFSIZE]; | ||
| 296 | }; | ||
| 297 | |||
| 298 | struct btrfs_ioctl_clone_range_args { | ||
| 299 | __s64 src_fd; | ||
| 300 | __u64 src_offset, src_length; | ||
| 301 | __u64 dest_offset; | ||
| 302 | }; | ||
| 303 | |||
| 304 | /* flags for the defrag range ioctl */ | ||
| 305 | #define BTRFS_DEFRAG_RANGE_COMPRESS 1 | ||
| 306 | #define BTRFS_DEFRAG_RANGE_START_IO 2 | ||
| 307 | |||
| 308 | struct btrfs_ioctl_space_info { | ||
| 309 | __u64 flags; | ||
| 310 | __u64 total_bytes; | ||
| 311 | __u64 used_bytes; | ||
| 312 | }; | ||
| 313 | |||
| 314 | struct btrfs_ioctl_space_args { | ||
| 315 | __u64 space_slots; | ||
| 316 | __u64 total_spaces; | ||
| 317 | struct btrfs_ioctl_space_info spaces[0]; | ||
| 318 | }; | ||
| 319 | |||
| 320 | struct btrfs_data_container { | ||
| 321 | __u32 bytes_left; /* out -- bytes not needed to deliver output */ | ||
| 322 | __u32 bytes_missing; /* out -- additional bytes needed for result */ | ||
| 323 | __u32 elem_cnt; /* out */ | ||
| 324 | __u32 elem_missed; /* out */ | ||
| 325 | __u64 val[0]; /* out */ | ||
| 326 | }; | ||
| 327 | |||
| 328 | struct btrfs_ioctl_ino_path_args { | ||
| 329 | __u64 inum; /* in */ | ||
| 330 | __u64 size; /* in */ | ||
| 331 | __u64 reserved[4]; | ||
| 332 | /* struct btrfs_data_container *fspath; out */ | ||
| 333 | __u64 fspath; /* out */ | ||
| 334 | }; | ||
| 335 | |||
| 336 | struct btrfs_ioctl_logical_ino_args { | ||
| 337 | __u64 logical; /* in */ | ||
| 338 | __u64 size; /* in */ | ||
| 339 | __u64 reserved[4]; | ||
| 340 | /* struct btrfs_data_container *inodes; out */ | ||
| 341 | __u64 inodes; | ||
| 342 | }; | ||
| 343 | |||
| 344 | enum btrfs_dev_stat_values { | ||
| 345 | /* disk I/O failure stats */ | ||
| 346 | BTRFS_DEV_STAT_WRITE_ERRS, /* EIO or EREMOTEIO from lower layers */ | ||
| 347 | BTRFS_DEV_STAT_READ_ERRS, /* EIO or EREMOTEIO from lower layers */ | ||
| 348 | BTRFS_DEV_STAT_FLUSH_ERRS, /* EIO or EREMOTEIO from lower layers */ | ||
| 349 | |||
| 350 | /* stats for indirect indications for I/O failures */ | ||
| 351 | BTRFS_DEV_STAT_CORRUPTION_ERRS, /* checksum error, bytenr error or | ||
| 352 | * contents is illegal: this is an | ||
| 353 | * indication that the block was damaged | ||
| 354 | * during read or write, or written to | ||
| 355 | * wrong location or read from wrong | ||
| 356 | * location */ | ||
| 357 | BTRFS_DEV_STAT_GENERATION_ERRS, /* an indication that blocks have not | ||
| 358 | * been written */ | ||
| 359 | |||
| 360 | BTRFS_DEV_STAT_VALUES_MAX | ||
| 361 | }; | ||
| 362 | |||
| 363 | /* Reset statistics after reading; needs SYS_ADMIN capability */ | ||
| 364 | #define BTRFS_DEV_STATS_RESET (1ULL << 0) | ||
| 365 | |||
| 366 | struct btrfs_ioctl_get_dev_stats { | ||
| 367 | __u64 devid; /* in */ | ||
| 368 | __u64 nr_items; /* in/out */ | ||
| 369 | __u64 flags; /* in/out */ | ||
| 370 | |||
| 371 | /* out values: */ | ||
| 372 | __u64 values[BTRFS_DEV_STAT_VALUES_MAX]; | ||
| 373 | |||
| 374 | __u64 unused[128 - 2 - BTRFS_DEV_STAT_VALUES_MAX]; /* pad to 1k */ | ||
| 375 | }; | ||
| 376 | |||
| 377 | #define BTRFS_QUOTA_CTL_ENABLE 1 | ||
| 378 | #define BTRFS_QUOTA_CTL_DISABLE 2 | ||
| 379 | #define BTRFS_QUOTA_CTL_RESCAN 3 | ||
| 380 | struct btrfs_ioctl_quota_ctl_args { | ||
| 381 | __u64 cmd; | ||
| 382 | __u64 status; | ||
| 383 | }; | ||
| 384 | |||
| 385 | struct btrfs_ioctl_qgroup_assign_args { | ||
| 386 | __u64 assign; | ||
| 387 | __u64 src; | ||
| 388 | __u64 dst; | ||
| 389 | }; | ||
| 390 | |||
| 391 | struct btrfs_ioctl_qgroup_create_args { | ||
| 392 | __u64 create; | ||
| 393 | __u64 qgroupid; | ||
| 394 | }; | ||
| 395 | struct btrfs_ioctl_timespec { | ||
| 396 | __u64 sec; | ||
| 397 | __u32 nsec; | ||
| 398 | }; | ||
| 399 | |||
| 400 | struct btrfs_ioctl_received_subvol_args { | ||
| 401 | char uuid[BTRFS_UUID_SIZE]; /* in */ | ||
| 402 | __u64 stransid; /* in */ | ||
| 403 | __u64 rtransid; /* out */ | ||
| 404 | struct btrfs_ioctl_timespec stime; /* in */ | ||
| 405 | struct btrfs_ioctl_timespec rtime; /* out */ | ||
| 406 | __u64 flags; /* in */ | ||
| 407 | __u64 reserved[16]; /* in */ | ||
| 408 | }; | ||
| 409 | |||
| 410 | /* | ||
| 411 | * Caller doesn't want file data in the send stream, even if the | ||
| 412 | * search of clone sources doesn't find an extent. UPDATE_EXTENT | ||
| 413 | * commands will be sent instead of WRITE commands. | ||
| 414 | */ | ||
| 415 | #define BTRFS_SEND_FLAG_NO_FILE_DATA 0x1 | ||
| 416 | |||
| 417 | struct btrfs_ioctl_send_args { | ||
| 418 | __s64 send_fd; /* in */ | ||
| 419 | __u64 clone_sources_count; /* in */ | ||
| 420 | __u64 __user *clone_sources; /* in */ | ||
| 421 | __u64 parent_root; /* in */ | ||
| 422 | __u64 flags; /* in */ | ||
| 423 | __u64 reserved[4]; /* in */ | ||
| 424 | }; | ||
| 425 | |||
| 426 | #define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \ | ||
| 427 | struct btrfs_ioctl_vol_args) | ||
| 428 | #define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \ | ||
| 429 | struct btrfs_ioctl_vol_args) | ||
| 430 | #define BTRFS_IOC_RESIZE _IOW(BTRFS_IOCTL_MAGIC, 3, \ | ||
| 431 | struct btrfs_ioctl_vol_args) | ||
| 432 | #define BTRFS_IOC_SCAN_DEV _IOW(BTRFS_IOCTL_MAGIC, 4, \ | ||
| 433 | struct btrfs_ioctl_vol_args) | ||
| 434 | /* trans start and trans end are dangerous, and only for | ||
| 435 | * use by applications that know how to avoid the | ||
| 436 | * resulting deadlocks | ||
| 437 | */ | ||
| 438 | #define BTRFS_IOC_TRANS_START _IO(BTRFS_IOCTL_MAGIC, 6) | ||
| 439 | #define BTRFS_IOC_TRANS_END _IO(BTRFS_IOCTL_MAGIC, 7) | ||
| 440 | #define BTRFS_IOC_SYNC _IO(BTRFS_IOCTL_MAGIC, 8) | ||
| 441 | |||
| 442 | #define BTRFS_IOC_CLONE _IOW(BTRFS_IOCTL_MAGIC, 9, int) | ||
| 443 | #define BTRFS_IOC_ADD_DEV _IOW(BTRFS_IOCTL_MAGIC, 10, \ | ||
| 444 | struct btrfs_ioctl_vol_args) | ||
| 445 | #define BTRFS_IOC_RM_DEV _IOW(BTRFS_IOCTL_MAGIC, 11, \ | ||
| 446 | struct btrfs_ioctl_vol_args) | ||
| 447 | #define BTRFS_IOC_BALANCE _IOW(BTRFS_IOCTL_MAGIC, 12, \ | ||
| 448 | struct btrfs_ioctl_vol_args) | ||
| 449 | |||
| 450 | #define BTRFS_IOC_CLONE_RANGE _IOW(BTRFS_IOCTL_MAGIC, 13, \ | ||
| 451 | struct btrfs_ioctl_clone_range_args) | ||
| 452 | |||
| 453 | #define BTRFS_IOC_SUBVOL_CREATE _IOW(BTRFS_IOCTL_MAGIC, 14, \ | ||
| 454 | struct btrfs_ioctl_vol_args) | ||
| 455 | #define BTRFS_IOC_SNAP_DESTROY _IOW(BTRFS_IOCTL_MAGIC, 15, \ | ||
| 456 | struct btrfs_ioctl_vol_args) | ||
| 457 | #define BTRFS_IOC_DEFRAG_RANGE _IOW(BTRFS_IOCTL_MAGIC, 16, \ | ||
| 458 | struct btrfs_ioctl_defrag_range_args) | ||
| 459 | #define BTRFS_IOC_TREE_SEARCH _IOWR(BTRFS_IOCTL_MAGIC, 17, \ | ||
| 460 | struct btrfs_ioctl_search_args) | ||
| 461 | #define BTRFS_IOC_INO_LOOKUP _IOWR(BTRFS_IOCTL_MAGIC, 18, \ | ||
| 462 | struct btrfs_ioctl_ino_lookup_args) | ||
| 463 | #define BTRFS_IOC_DEFAULT_SUBVOL _IOW(BTRFS_IOCTL_MAGIC, 19, u64) | ||
| 464 | #define BTRFS_IOC_SPACE_INFO _IOWR(BTRFS_IOCTL_MAGIC, 20, \ | ||
| 465 | struct btrfs_ioctl_space_args) | ||
| 466 | #define BTRFS_IOC_START_SYNC _IOR(BTRFS_IOCTL_MAGIC, 24, __u64) | ||
| 467 | #define BTRFS_IOC_WAIT_SYNC _IOW(BTRFS_IOCTL_MAGIC, 22, __u64) | ||
| 468 | #define BTRFS_IOC_SNAP_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 23, \ | ||
| 469 | struct btrfs_ioctl_vol_args_v2) | ||
| 470 | #define BTRFS_IOC_SUBVOL_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 24, \ | ||
| 471 | struct btrfs_ioctl_vol_args_v2) | ||
| 472 | #define BTRFS_IOC_SUBVOL_GETFLAGS _IOR(BTRFS_IOCTL_MAGIC, 25, __u64) | ||
| 473 | #define BTRFS_IOC_SUBVOL_SETFLAGS _IOW(BTRFS_IOCTL_MAGIC, 26, __u64) | ||
| 474 | #define BTRFS_IOC_SCRUB _IOWR(BTRFS_IOCTL_MAGIC, 27, \ | ||
| 475 | struct btrfs_ioctl_scrub_args) | ||
| 476 | #define BTRFS_IOC_SCRUB_CANCEL _IO(BTRFS_IOCTL_MAGIC, 28) | ||
| 477 | #define BTRFS_IOC_SCRUB_PROGRESS _IOWR(BTRFS_IOCTL_MAGIC, 29, \ | ||
| 478 | struct btrfs_ioctl_scrub_args) | ||
| 479 | #define BTRFS_IOC_DEV_INFO _IOWR(BTRFS_IOCTL_MAGIC, 30, \ | ||
| 480 | struct btrfs_ioctl_dev_info_args) | ||
| 481 | #define BTRFS_IOC_FS_INFO _IOR(BTRFS_IOCTL_MAGIC, 31, \ | ||
| 482 | struct btrfs_ioctl_fs_info_args) | ||
| 483 | #define BTRFS_IOC_BALANCE_V2 _IOWR(BTRFS_IOCTL_MAGIC, 32, \ | ||
| 484 | struct btrfs_ioctl_balance_args) | ||
| 485 | #define BTRFS_IOC_BALANCE_CTL _IOW(BTRFS_IOCTL_MAGIC, 33, int) | ||
| 486 | #define BTRFS_IOC_BALANCE_PROGRESS _IOR(BTRFS_IOCTL_MAGIC, 34, \ | ||
| 487 | struct btrfs_ioctl_balance_args) | ||
| 488 | #define BTRFS_IOC_INO_PATHS _IOWR(BTRFS_IOCTL_MAGIC, 35, \ | ||
| 489 | struct btrfs_ioctl_ino_path_args) | ||
| 490 | #define BTRFS_IOC_LOGICAL_INO _IOWR(BTRFS_IOCTL_MAGIC, 36, \ | ||
| 491 | struct btrfs_ioctl_ino_path_args) | ||
| 492 | #define BTRFS_IOC_SET_RECEIVED_SUBVOL _IOWR(BTRFS_IOCTL_MAGIC, 37, \ | ||
| 493 | struct btrfs_ioctl_received_subvol_args) | ||
| 494 | #define BTRFS_IOC_SEND _IOW(BTRFS_IOCTL_MAGIC, 38, struct btrfs_ioctl_send_args) | ||
| 495 | #define BTRFS_IOC_DEVICES_READY _IOR(BTRFS_IOCTL_MAGIC, 39, \ | ||
| 496 | struct btrfs_ioctl_vol_args) | ||
| 497 | #define BTRFS_IOC_QUOTA_CTL _IOWR(BTRFS_IOCTL_MAGIC, 40, \ | ||
| 498 | struct btrfs_ioctl_quota_ctl_args) | ||
| 499 | #define BTRFS_IOC_QGROUP_ASSIGN _IOW(BTRFS_IOCTL_MAGIC, 41, \ | ||
| 500 | struct btrfs_ioctl_qgroup_assign_args) | ||
| 501 | #define BTRFS_IOC_QGROUP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 42, \ | ||
| 502 | struct btrfs_ioctl_qgroup_create_args) | ||
| 503 | #define BTRFS_IOC_QGROUP_LIMIT _IOR(BTRFS_IOCTL_MAGIC, 43, \ | ||
| 504 | struct btrfs_ioctl_qgroup_limit_args) | ||
| 505 | #define BTRFS_IOC_GET_FSLABEL _IOR(BTRFS_IOCTL_MAGIC, 49, \ | ||
| 506 | char[BTRFS_LABEL_SIZE]) | ||
| 507 | #define BTRFS_IOC_SET_FSLABEL _IOW(BTRFS_IOCTL_MAGIC, 50, \ | ||
| 508 | char[BTRFS_LABEL_SIZE]) | ||
| 509 | #define BTRFS_IOC_GET_DEV_STATS _IOWR(BTRFS_IOCTL_MAGIC, 52, \ | ||
| 510 | struct btrfs_ioctl_get_dev_stats) | ||
| 511 | #define BTRFS_IOC_DEV_REPLACE _IOWR(BTRFS_IOCTL_MAGIC, 53, \ | ||
| 512 | struct btrfs_ioctl_dev_replace_args) | ||
| 513 | |||
| 514 | #endif /* _UAPI_LINUX_BTRFS_H */ | ||
diff --git a/include/uapi/linux/cdrom.h b/include/uapi/linux/cdrom.h index 898b866b300c..bd17ad5aa06d 100644 --- a/include/uapi/linux/cdrom.h +++ b/include/uapi/linux/cdrom.h | |||
| @@ -908,5 +908,39 @@ struct mode_page_header { | |||
| 908 | __be16 desc_length; | 908 | __be16 desc_length; |
| 909 | }; | 909 | }; |
| 910 | 910 | ||
| 911 | /* removable medium feature descriptor */ | ||
| 912 | struct rm_feature_desc { | ||
| 913 | __be16 feature_code; | ||
| 914 | #if defined(__BIG_ENDIAN_BITFIELD) | ||
| 915 | __u8 reserved1:2; | ||
| 916 | __u8 feature_version:4; | ||
| 917 | __u8 persistent:1; | ||
| 918 | __u8 curr:1; | ||
| 919 | #elif defined(__LITTLE_ENDIAN_BITFIELD) | ||
| 920 | __u8 curr:1; | ||
| 921 | __u8 persistent:1; | ||
| 922 | __u8 feature_version:4; | ||
| 923 | __u8 reserved1:2; | ||
| 924 | #endif | ||
| 925 | __u8 add_len; | ||
| 926 | #if defined(__BIG_ENDIAN_BITFIELD) | ||
| 927 | __u8 mech_type:3; | ||
| 928 | __u8 load:1; | ||
| 929 | __u8 eject:1; | ||
| 930 | __u8 pvnt_jmpr:1; | ||
| 931 | __u8 dbml:1; | ||
| 932 | __u8 lock:1; | ||
| 933 | #elif defined(__LITTLE_ENDIAN_BITFIELD) | ||
| 934 | __u8 lock:1; | ||
| 935 | __u8 dbml:1; | ||
| 936 | __u8 pvnt_jmpr:1; | ||
| 937 | __u8 eject:1; | ||
| 938 | __u8 load:1; | ||
| 939 | __u8 mech_type:3; | ||
| 940 | #endif | ||
| 941 | __u8 reserved2; | ||
| 942 | __u8 reserved3; | ||
| 943 | __u8 reserved4; | ||
| 944 | }; | ||
| 911 | 945 | ||
| 912 | #endif /* _UAPI_LINUX_CDROM_H */ | 946 | #endif /* _UAPI_LINUX_CDROM_H */ |
diff --git a/include/uapi/linux/dm-ioctl.h b/include/uapi/linux/dm-ioctl.h index 539b179b349c..7e75b6fd8d45 100644 --- a/include/uapi/linux/dm-ioctl.h +++ b/include/uapi/linux/dm-ioctl.h | |||
| @@ -267,9 +267,9 @@ enum { | |||
| 267 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) | 267 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) |
| 268 | 268 | ||
| 269 | #define DM_VERSION_MAJOR 4 | 269 | #define DM_VERSION_MAJOR 4 |
| 270 | #define DM_VERSION_MINOR 23 | 270 | #define DM_VERSION_MINOR 24 |
| 271 | #define DM_VERSION_PATCHLEVEL 1 | 271 | #define DM_VERSION_PATCHLEVEL 0 |
| 272 | #define DM_VERSION_EXTRA "-ioctl (2012-12-18)" | 272 | #define DM_VERSION_EXTRA "-ioctl (2013-01-15)" |
| 273 | 273 | ||
| 274 | /* Status bits */ | 274 | /* Status bits */ |
| 275 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ | 275 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ |
| @@ -336,4 +336,9 @@ enum { | |||
| 336 | */ | 336 | */ |
| 337 | #define DM_SECURE_DATA_FLAG (1 << 15) /* In */ | 337 | #define DM_SECURE_DATA_FLAG (1 << 15) /* In */ |
| 338 | 338 | ||
| 339 | /* | ||
| 340 | * If set, a message generated output data. | ||
| 341 | */ | ||
| 342 | #define DM_DATA_OUT_FLAG (1 << 16) /* Out */ | ||
| 343 | |||
| 339 | #endif /* _LINUX_DM_IOCTL_H */ | 344 | #endif /* _LINUX_DM_IOCTL_H */ |
diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h index c12d452cb40d..c56d77c496a5 100644 --- a/include/uapi/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h | |||
| @@ -365,7 +365,17 @@ struct dvb_frontend_event { | |||
| 365 | #define DTV_INTERLEAVING 60 | 365 | #define DTV_INTERLEAVING 60 |
| 366 | #define DTV_LNA 61 | 366 | #define DTV_LNA 61 |
| 367 | 367 | ||
| 368 | #define DTV_MAX_COMMAND DTV_LNA | 368 | /* Quality parameters */ |
| 369 | #define DTV_STAT_SIGNAL_STRENGTH 62 | ||
| 370 | #define DTV_STAT_CNR 63 | ||
| 371 | #define DTV_STAT_PRE_ERROR_BIT_COUNT 64 | ||
| 372 | #define DTV_STAT_PRE_TOTAL_BIT_COUNT 65 | ||
| 373 | #define DTV_STAT_POST_ERROR_BIT_COUNT 66 | ||
| 374 | #define DTV_STAT_POST_TOTAL_BIT_COUNT 67 | ||
| 375 | #define DTV_STAT_ERROR_BLOCK_COUNT 68 | ||
| 376 | #define DTV_STAT_TOTAL_BLOCK_COUNT 69 | ||
| 377 | |||
| 378 | #define DTV_MAX_COMMAND DTV_STAT_TOTAL_BLOCK_COUNT | ||
| 369 | 379 | ||
| 370 | typedef enum fe_pilot { | 380 | typedef enum fe_pilot { |
| 371 | PILOT_ON, | 381 | PILOT_ON, |
| @@ -452,11 +462,78 @@ struct dtv_cmds_h { | |||
| 452 | __u32 reserved:30; /* Align */ | 462 | __u32 reserved:30; /* Align */ |
| 453 | }; | 463 | }; |
| 454 | 464 | ||
| 465 | /** | ||
| 466 | * Scale types for the quality parameters. | ||
| 467 | * @FE_SCALE_NOT_AVAILABLE: That QoS measure is not available. That | ||
| 468 | * could indicate a temporary or a permanent | ||
| 469 | * condition. | ||
| 470 | * @FE_SCALE_DECIBEL: The scale is measured in 0.0001 dB steps, typically | ||
| 471 | * used on signal measures. | ||
| 472 | * @FE_SCALE_RELATIVE: The scale is a relative percentual measure, | ||
| 473 | * ranging from 0 (0%) to 0xffff (100%). | ||
| 474 | * @FE_SCALE_COUNTER: The scale counts the occurrence of an event, like | ||
| 475 | * bit error, block error, lapsed time. | ||
| 476 | */ | ||
| 477 | enum fecap_scale_params { | ||
| 478 | FE_SCALE_NOT_AVAILABLE = 0, | ||
| 479 | FE_SCALE_DECIBEL, | ||
| 480 | FE_SCALE_RELATIVE, | ||
| 481 | FE_SCALE_COUNTER | ||
| 482 | }; | ||
| 483 | |||
| 484 | /** | ||
| 485 | * struct dtv_stats - Used for reading a DTV status property | ||
| 486 | * | ||
| 487 | * @value: value of the measure. Should range from 0 to 0xffff; | ||
| 488 | * @scale: Filled with enum fecap_scale_params - the scale | ||
| 489 | * in usage for that parameter | ||
| 490 | * | ||
| 491 | * For most delivery systems, this will return a single value for each | ||
| 492 | * parameter. | ||
| 493 | * It should be noticed, however, that new OFDM delivery systems like | ||
| 494 | * ISDB can use different modulation types for each group of carriers. | ||
| 495 | * On such standards, up to 8 groups of statistics can be provided, one | ||
| 496 | * for each carrier group (called "layer" on ISDB). | ||
| 497 | * In order to be consistent with other delivery systems, the first | ||
| 498 | * value refers to the entire set of carriers ("global"). | ||
| 499 | * dtv_status:scale should use the value FE_SCALE_NOT_AVAILABLE when | ||
| 500 | * the value for the entire group of carriers or from one specific layer | ||
| 501 | * is not provided by the hardware. | ||
| 502 | * st.len should be filled with the latest filled status + 1. | ||
| 503 | * | ||
| 504 | * In other words, for ISDB, those values should be filled like: | ||
| 505 | * u.st.stat.svalue[0] = global statistics; | ||
| 506 | * u.st.stat.scale[0] = FE_SCALE_DECIBELS; | ||
| 507 | * u.st.stat.value[1] = layer A statistics; | ||
| 508 | * u.st.stat.scale[1] = FE_SCALE_NOT_AVAILABLE (if not available); | ||
| 509 | * u.st.stat.svalue[2] = layer B statistics; | ||
| 510 | * u.st.stat.scale[2] = FE_SCALE_DECIBELS; | ||
| 511 | * u.st.stat.svalue[3] = layer C statistics; | ||
| 512 | * u.st.stat.scale[3] = FE_SCALE_DECIBELS; | ||
| 513 | * u.st.len = 4; | ||
| 514 | */ | ||
| 515 | struct dtv_stats { | ||
| 516 | __u8 scale; /* enum fecap_scale_params type */ | ||
| 517 | union { | ||
| 518 | __u64 uvalue; /* for counters and relative scales */ | ||
| 519 | __s64 svalue; /* for 0.0001 dB measures */ | ||
| 520 | }; | ||
| 521 | } __attribute__ ((packed)); | ||
| 522 | |||
| 523 | |||
| 524 | #define MAX_DTV_STATS 4 | ||
| 525 | |||
| 526 | struct dtv_fe_stats { | ||
| 527 | __u8 len; | ||
| 528 | struct dtv_stats stat[MAX_DTV_STATS]; | ||
| 529 | } __attribute__ ((packed)); | ||
| 530 | |||
| 455 | struct dtv_property { | 531 | struct dtv_property { |
| 456 | __u32 cmd; | 532 | __u32 cmd; |
| 457 | __u32 reserved[3]; | 533 | __u32 reserved[3]; |
| 458 | union { | 534 | union { |
| 459 | __u32 data; | 535 | __u32 data; |
| 536 | struct dtv_fe_stats st; | ||
| 460 | struct { | 537 | struct { |
| 461 | __u8 data[32]; | 538 | __u8 data[32]; |
| 462 | __u32 len; | 539 | __u32 len; |
diff --git a/include/uapi/linux/dvb/version.h b/include/uapi/linux/dvb/version.h index 827cce7e33e3..e53e2ad4444f 100644 --- a/include/uapi/linux/dvb/version.h +++ b/include/uapi/linux/dvb/version.h | |||
| @@ -24,6 +24,6 @@ | |||
| 24 | #define _DVBVERSION_H_ | 24 | #define _DVBVERSION_H_ |
| 25 | 25 | ||
| 26 | #define DVB_API_VERSION 5 | 26 | #define DVB_API_VERSION 5 |
| 27 | #define DVB_API_VERSION_MINOR 9 | 27 | #define DVB_API_VERSION_MINOR 10 |
| 28 | 28 | ||
| 29 | #endif /*_DVBVERSION_H_*/ | 29 | #endif /*_DVBVERSION_H_*/ |
diff --git a/include/uapi/linux/elf.h b/include/uapi/linux/elf.h index 900b9484445b..8072d352b98f 100644 --- a/include/uapi/linux/elf.h +++ b/include/uapi/linux/elf.h | |||
| @@ -395,6 +395,8 @@ typedef struct elf64_shdr { | |||
| 395 | #define NT_ARM_TLS 0x401 /* ARM TLS register */ | 395 | #define NT_ARM_TLS 0x401 /* ARM TLS register */ |
| 396 | #define NT_ARM_HW_BREAK 0x402 /* ARM hardware breakpoint registers */ | 396 | #define NT_ARM_HW_BREAK 0x402 /* ARM hardware breakpoint registers */ |
| 397 | #define NT_ARM_HW_WATCH 0x403 /* ARM hardware watchpoint registers */ | 397 | #define NT_ARM_HW_WATCH 0x403 /* ARM hardware watchpoint registers */ |
| 398 | #define NT_METAG_CBUF 0x500 /* Metag catch buffer registers */ | ||
| 399 | #define NT_METAG_RPIPE 0x501 /* Metag read pipeline state */ | ||
| 398 | 400 | ||
| 399 | 401 | ||
| 400 | /* Note header in a PT_NOTE section */ | 402 | /* Note header in a PT_NOTE section */ |
diff --git a/include/uapi/linux/ipmi.h b/include/uapi/linux/ipmi.h index 33fbc99b3812..7b26a62e5707 100644 --- a/include/uapi/linux/ipmi.h +++ b/include/uapi/linux/ipmi.h | |||
| @@ -59,15 +59,7 @@ | |||
| 59 | * if it becomes full and it is queried once a second to see if | 59 | * if it becomes full and it is queried once a second to see if |
| 60 | * anything is in it. Incoming commands to the driver will get | 60 | * anything is in it. Incoming commands to the driver will get |
| 61 | * delivered as commands. | 61 | * delivered as commands. |
| 62 | * | 62 | */ |
| 63 | * This driver provides two main interfaces: one for in-kernel | ||
| 64 | * applications and another for userland applications. The | ||
| 65 | * capabilities are basically the same for both interface, although | ||
| 66 | * the interfaces are somewhat different. The stuff in the | ||
| 67 | * #ifdef __KERNEL__ below is the in-kernel interface. The userland | ||
| 68 | * interface is defined later in the file. */ | ||
| 69 | |||
| 70 | |||
| 71 | 63 | ||
| 72 | /* | 64 | /* |
| 73 | * This is an overlay for all the address types, so it's easy to | 65 | * This is an overlay for all the address types, so it's easy to |
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index c70577cf67bc..3c56ba3d80c1 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h | |||
| @@ -169,6 +169,8 @@ struct kvm_pit_config { | |||
| 169 | #define KVM_EXIT_PAPR_HCALL 19 | 169 | #define KVM_EXIT_PAPR_HCALL 19 |
| 170 | #define KVM_EXIT_S390_UCONTROL 20 | 170 | #define KVM_EXIT_S390_UCONTROL 20 |
| 171 | #define KVM_EXIT_WATCHDOG 21 | 171 | #define KVM_EXIT_WATCHDOG 21 |
| 172 | #define KVM_EXIT_S390_TSCH 22 | ||
| 173 | #define KVM_EXIT_EPR 23 | ||
| 172 | 174 | ||
| 173 | /* For KVM_EXIT_INTERNAL_ERROR */ | 175 | /* For KVM_EXIT_INTERNAL_ERROR */ |
| 174 | /* Emulate instruction failed. */ | 176 | /* Emulate instruction failed. */ |
| @@ -286,6 +288,19 @@ struct kvm_run { | |||
| 286 | __u64 ret; | 288 | __u64 ret; |
| 287 | __u64 args[9]; | 289 | __u64 args[9]; |
| 288 | } papr_hcall; | 290 | } papr_hcall; |
| 291 | /* KVM_EXIT_S390_TSCH */ | ||
| 292 | struct { | ||
| 293 | __u16 subchannel_id; | ||
| 294 | __u16 subchannel_nr; | ||
| 295 | __u32 io_int_parm; | ||
| 296 | __u32 io_int_word; | ||
| 297 | __u32 ipb; | ||
| 298 | __u8 dequeued; | ||
| 299 | } s390_tsch; | ||
| 300 | /* KVM_EXIT_EPR */ | ||
| 301 | struct { | ||
| 302 | __u32 epr; | ||
| 303 | } epr; | ||
| 289 | /* Fix the size of the union. */ | 304 | /* Fix the size of the union. */ |
| 290 | char padding[256]; | 305 | char padding[256]; |
| 291 | }; | 306 | }; |
| @@ -398,10 +413,20 @@ struct kvm_s390_psw { | |||
| 398 | #define KVM_S390_PROGRAM_INT 0xfffe0001u | 413 | #define KVM_S390_PROGRAM_INT 0xfffe0001u |
| 399 | #define KVM_S390_SIGP_SET_PREFIX 0xfffe0002u | 414 | #define KVM_S390_SIGP_SET_PREFIX 0xfffe0002u |
| 400 | #define KVM_S390_RESTART 0xfffe0003u | 415 | #define KVM_S390_RESTART 0xfffe0003u |
| 416 | #define KVM_S390_MCHK 0xfffe1000u | ||
| 401 | #define KVM_S390_INT_VIRTIO 0xffff2603u | 417 | #define KVM_S390_INT_VIRTIO 0xffff2603u |
| 402 | #define KVM_S390_INT_SERVICE 0xffff2401u | 418 | #define KVM_S390_INT_SERVICE 0xffff2401u |
| 403 | #define KVM_S390_INT_EMERGENCY 0xffff1201u | 419 | #define KVM_S390_INT_EMERGENCY 0xffff1201u |
| 404 | #define KVM_S390_INT_EXTERNAL_CALL 0xffff1202u | 420 | #define KVM_S390_INT_EXTERNAL_CALL 0xffff1202u |
| 421 | /* Anything below 0xfffe0000u is taken by INT_IO */ | ||
| 422 | #define KVM_S390_INT_IO(ai,cssid,ssid,schid) \ | ||
| 423 | (((schid)) | \ | ||
| 424 | ((ssid) << 16) | \ | ||
| 425 | ((cssid) << 18) | \ | ||
| 426 | ((ai) << 26)) | ||
| 427 | #define KVM_S390_INT_IO_MIN 0x00000000u | ||
| 428 | #define KVM_S390_INT_IO_MAX 0xfffdffffu | ||
| 429 | |||
| 405 | 430 | ||
| 406 | struct kvm_s390_interrupt { | 431 | struct kvm_s390_interrupt { |
| 407 | __u32 type; | 432 | __u32 type; |
| @@ -636,6 +661,8 @@ struct kvm_ppc_smmu_info { | |||
| 636 | #define KVM_CAP_IRQFD_RESAMPLE 82 | 661 | #define KVM_CAP_IRQFD_RESAMPLE 82 |
| 637 | #define KVM_CAP_PPC_BOOKE_WATCHDOG 83 | 662 | #define KVM_CAP_PPC_BOOKE_WATCHDOG 83 |
| 638 | #define KVM_CAP_PPC_HTAB_FD 84 | 663 | #define KVM_CAP_PPC_HTAB_FD 84 |
| 664 | #define KVM_CAP_S390_CSS_SUPPORT 85 | ||
| 665 | #define KVM_CAP_PPC_EPR 86 | ||
| 639 | #define KVM_CAP_ARM_PSCI 87 | 666 | #define KVM_CAP_ARM_PSCI 87 |
| 640 | #define KVM_CAP_ARM_SET_DEVICE_ADDR 88 | 667 | #define KVM_CAP_ARM_SET_DEVICE_ADDR 88 |
| 641 | 668 | ||
diff --git a/include/uapi/linux/meye.h b/include/uapi/linux/meye.h index 0dd49954f746..8ff50fe9e481 100644 --- a/include/uapi/linux/meye.h +++ b/include/uapi/linux/meye.h | |||
| @@ -57,10 +57,8 @@ struct meye_params { | |||
| 57 | #define MEYEIOC_STILLJCAPT _IOR ('v', BASE_VIDIOC_PRIVATE+5, int) | 57 | #define MEYEIOC_STILLJCAPT _IOR ('v', BASE_VIDIOC_PRIVATE+5, int) |
| 58 | 58 | ||
| 59 | /* V4L2 private controls */ | 59 | /* V4L2 private controls */ |
| 60 | #define V4L2_CID_AGC V4L2_CID_PRIVATE_BASE | 60 | #define V4L2_CID_MEYE_AGC (V4L2_CID_USER_MEYE_BASE + 0) |
| 61 | #define V4L2_CID_MEYE_SHARPNESS (V4L2_CID_PRIVATE_BASE + 1) | 61 | #define V4L2_CID_MEYE_PICTURE (V4L2_CID_USER_MEYE_BASE + 1) |
| 62 | #define V4L2_CID_PICTURE (V4L2_CID_PRIVATE_BASE + 2) | 62 | #define V4L2_CID_MEYE_FRAMERATE (V4L2_CID_USER_MEYE_BASE + 2) |
| 63 | #define V4L2_CID_JPEGQUAL (V4L2_CID_PRIVATE_BASE + 3) | ||
| 64 | #define V4L2_CID_FRAMERATE (V4L2_CID_PRIVATE_BASE + 4) | ||
| 65 | 63 | ||
| 66 | #endif | 64 | #endif |
diff --git a/include/uapi/linux/msdos_fs.h b/include/uapi/linux/msdos_fs.h index 996719f82e28..f055e58b3147 100644 --- a/include/uapi/linux/msdos_fs.h +++ b/include/uapi/linux/msdos_fs.h | |||
| @@ -87,6 +87,8 @@ | |||
| 87 | #define IS_FSINFO(x) (le32_to_cpu((x)->signature1) == FAT_FSINFO_SIG1 \ | 87 | #define IS_FSINFO(x) (le32_to_cpu((x)->signature1) == FAT_FSINFO_SIG1 \ |
| 88 | && le32_to_cpu((x)->signature2) == FAT_FSINFO_SIG2) | 88 | && le32_to_cpu((x)->signature2) == FAT_FSINFO_SIG2) |
| 89 | 89 | ||
| 90 | #define FAT_STATE_DIRTY 0x01 | ||
| 91 | |||
| 90 | struct __fat_dirent { | 92 | struct __fat_dirent { |
| 91 | long d_ino; | 93 | long d_ino; |
| 92 | __kernel_off_t d_off; | 94 | __kernel_off_t d_off; |
| @@ -120,14 +122,34 @@ struct fat_boot_sector { | |||
| 120 | __le32 hidden; /* hidden sectors (unused) */ | 122 | __le32 hidden; /* hidden sectors (unused) */ |
| 121 | __le32 total_sect; /* number of sectors (if sectors == 0) */ | 123 | __le32 total_sect; /* number of sectors (if sectors == 0) */ |
| 122 | 124 | ||
| 123 | /* The following fields are only used by FAT32 */ | 125 | union { |
| 124 | __le32 fat32_length; /* sectors/FAT */ | 126 | struct { |
| 125 | __le16 flags; /* bit 8: fat mirroring, low 4: active fat */ | 127 | /* Extended BPB Fields for FAT16 */ |
| 126 | __u8 version[2]; /* major, minor filesystem version */ | 128 | __u8 drive_number; /* Physical drive number */ |
| 127 | __le32 root_cluster; /* first cluster in root directory */ | 129 | __u8 state; /* undocumented, but used |
| 128 | __le16 info_sector; /* filesystem info sector */ | 130 | for mount state. */ |
| 129 | __le16 backup_boot; /* backup boot sector */ | 131 | /* other fiealds are not added here */ |
| 130 | __le16 reserved2[6]; /* Unused */ | 132 | } fat16; |
| 133 | |||
| 134 | struct { | ||
| 135 | /* only used by FAT32 */ | ||
| 136 | __le32 length; /* sectors/FAT */ | ||
| 137 | __le16 flags; /* bit 8: fat mirroring, | ||
| 138 | low 4: active fat */ | ||
| 139 | __u8 version[2]; /* major, minor filesystem | ||
| 140 | version */ | ||
| 141 | __le32 root_cluster; /* first cluster in | ||
| 142 | root directory */ | ||
| 143 | __le16 info_sector; /* filesystem info sector */ | ||
| 144 | __le16 backup_boot; /* backup boot sector */ | ||
| 145 | __le16 reserved2[6]; /* Unused */ | ||
| 146 | /* Extended BPB Fields for FAT32 */ | ||
| 147 | __u8 drive_number; /* Physical drive number */ | ||
| 148 | __u8 state; /* undocumented, but used | ||
| 149 | for mount state. */ | ||
| 150 | /* other fiealds are not added here */ | ||
| 151 | } fat32; | ||
| 152 | }; | ||
| 131 | }; | 153 | }; |
| 132 | 154 | ||
| 133 | struct fat_boot_fsinfo { | 155 | struct fat_boot_fsinfo { |
diff --git a/include/uapi/linux/nbd.h b/include/uapi/linux/nbd.h index dfb514472cbc..4f52549b23ff 100644 --- a/include/uapi/linux/nbd.h +++ b/include/uapi/linux/nbd.h | |||
| @@ -33,13 +33,14 @@ enum { | |||
| 33 | NBD_CMD_READ = 0, | 33 | NBD_CMD_READ = 0, |
| 34 | NBD_CMD_WRITE = 1, | 34 | NBD_CMD_WRITE = 1, |
| 35 | NBD_CMD_DISC = 2, | 35 | NBD_CMD_DISC = 2, |
| 36 | /* there is a gap here to match userspace */ | 36 | NBD_CMD_FLUSH = 3, |
| 37 | NBD_CMD_TRIM = 4 | 37 | NBD_CMD_TRIM = 4 |
| 38 | }; | 38 | }; |
| 39 | 39 | ||
| 40 | /* values for flags field */ | 40 | /* values for flags field */ |
| 41 | #define NBD_FLAG_HAS_FLAGS (1 << 0) /* nbd-server supports flags */ | 41 | #define NBD_FLAG_HAS_FLAGS (1 << 0) /* nbd-server supports flags */ |
| 42 | #define NBD_FLAG_READ_ONLY (1 << 1) /* device is read-only */ | 42 | #define NBD_FLAG_READ_ONLY (1 << 1) /* device is read-only */ |
| 43 | #define NBD_FLAG_SEND_FLUSH (1 << 2) /* can flush writeback cache */ | ||
| 43 | /* there is a gap here to match userspace */ | 44 | /* there is a gap here to match userspace */ |
| 44 | #define NBD_FLAG_SEND_TRIM (1 << 5) /* send trim/discard */ | 45 | #define NBD_FLAG_SEND_TRIM (1 << 5) /* send trim/discard */ |
| 45 | 46 | ||
diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index f56c945cecd4..dcd63745e83a 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h | |||
| @@ -88,10 +88,6 @@ | |||
| 88 | #define V4L2_CID_HFLIP (V4L2_CID_BASE+20) | 88 | #define V4L2_CID_HFLIP (V4L2_CID_BASE+20) |
| 89 | #define V4L2_CID_VFLIP (V4L2_CID_BASE+21) | 89 | #define V4L2_CID_VFLIP (V4L2_CID_BASE+21) |
| 90 | 90 | ||
| 91 | /* Deprecated; use V4L2_CID_PAN_RESET and V4L2_CID_TILT_RESET */ | ||
| 92 | #define V4L2_CID_HCENTER (V4L2_CID_BASE+22) | ||
| 93 | #define V4L2_CID_VCENTER (V4L2_CID_BASE+23) | ||
| 94 | |||
| 95 | #define V4L2_CID_POWER_LINE_FREQUENCY (V4L2_CID_BASE+24) | 91 | #define V4L2_CID_POWER_LINE_FREQUENCY (V4L2_CID_BASE+24) |
| 96 | enum v4l2_power_line_frequency { | 92 | enum v4l2_power_line_frequency { |
| 97 | V4L2_CID_POWER_LINE_FREQUENCY_DISABLED = 0, | 93 | V4L2_CID_POWER_LINE_FREQUENCY_DISABLED = 0, |
| @@ -144,6 +140,11 @@ enum v4l2_colorfx { | |||
| 144 | /* last CID + 1 */ | 140 | /* last CID + 1 */ |
| 145 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+43) | 141 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+43) |
| 146 | 142 | ||
| 143 | /* USER-class private control IDs */ | ||
| 144 | |||
| 145 | /* The base for the meye driver controls. See linux/meye.h for the list | ||
| 146 | * of controls. We reserve 16 controls for this driver. */ | ||
| 147 | #define V4L2_CID_USER_MEYE_BASE (V4L2_CID_USER_BASE + 0x1000) | ||
| 147 | 148 | ||
| 148 | /* MPEG-class control IDs */ | 149 | /* MPEG-class control IDs */ |
| 149 | 150 | ||
| @@ -782,6 +783,7 @@ enum v4l2_jpeg_chroma_subsampling { | |||
| 782 | #define V4L2_JPEG_ACTIVE_MARKER_DQT (1 << 17) | 783 | #define V4L2_JPEG_ACTIVE_MARKER_DQT (1 << 17) |
| 783 | #define V4L2_JPEG_ACTIVE_MARKER_DHT (1 << 18) | 784 | #define V4L2_JPEG_ACTIVE_MARKER_DHT (1 << 18) |
| 784 | 785 | ||
| 786 | |||
| 785 | /* Image source controls */ | 787 | /* Image source controls */ |
| 786 | #define V4L2_CID_IMAGE_SOURCE_CLASS_BASE (V4L2_CTRL_CLASS_IMAGE_SOURCE | 0x900) | 788 | #define V4L2_CID_IMAGE_SOURCE_CLASS_BASE (V4L2_CTRL_CLASS_IMAGE_SOURCE | 0x900) |
| 787 | #define V4L2_CID_IMAGE_SOURCE_CLASS (V4L2_CTRL_CLASS_IMAGE_SOURCE | 1) | 789 | #define V4L2_CID_IMAGE_SOURCE_CLASS (V4L2_CTRL_CLASS_IMAGE_SOURCE | 1) |
| @@ -800,4 +802,27 @@ enum v4l2_jpeg_chroma_subsampling { | |||
| 800 | #define V4L2_CID_PIXEL_RATE (V4L2_CID_IMAGE_PROC_CLASS_BASE + 2) | 802 | #define V4L2_CID_PIXEL_RATE (V4L2_CID_IMAGE_PROC_CLASS_BASE + 2) |
| 801 | #define V4L2_CID_TEST_PATTERN (V4L2_CID_IMAGE_PROC_CLASS_BASE + 3) | 803 | #define V4L2_CID_TEST_PATTERN (V4L2_CID_IMAGE_PROC_CLASS_BASE + 3) |
| 802 | 804 | ||
| 805 | |||
| 806 | /* DV-class control IDs defined by V4L2 */ | ||
| 807 | #define V4L2_CID_DV_CLASS_BASE (V4L2_CTRL_CLASS_DV | 0x900) | ||
| 808 | #define V4L2_CID_DV_CLASS (V4L2_CTRL_CLASS_DV | 1) | ||
| 809 | |||
| 810 | #define V4L2_CID_DV_TX_HOTPLUG (V4L2_CID_DV_CLASS_BASE + 1) | ||
| 811 | #define V4L2_CID_DV_TX_RXSENSE (V4L2_CID_DV_CLASS_BASE + 2) | ||
| 812 | #define V4L2_CID_DV_TX_EDID_PRESENT (V4L2_CID_DV_CLASS_BASE + 3) | ||
| 813 | #define V4L2_CID_DV_TX_MODE (V4L2_CID_DV_CLASS_BASE + 4) | ||
| 814 | enum v4l2_dv_tx_mode { | ||
| 815 | V4L2_DV_TX_MODE_DVI_D = 0, | ||
| 816 | V4L2_DV_TX_MODE_HDMI = 1, | ||
| 817 | }; | ||
| 818 | #define V4L2_CID_DV_TX_RGB_RANGE (V4L2_CID_DV_CLASS_BASE + 5) | ||
| 819 | enum v4l2_dv_rgb_range { | ||
| 820 | V4L2_DV_RGB_RANGE_AUTO = 0, | ||
| 821 | V4L2_DV_RGB_RANGE_LIMITED = 1, | ||
| 822 | V4L2_DV_RGB_RANGE_FULL = 2, | ||
| 823 | }; | ||
| 824 | |||
| 825 | #define V4L2_CID_DV_RX_POWER_PRESENT (V4L2_CID_DV_CLASS_BASE + 100) | ||
| 826 | #define V4L2_CID_DV_RX_RGB_RANGE (V4L2_CID_DV_CLASS_BASE + 101) | ||
| 827 | |||
| 803 | #endif | 828 | #endif |
diff --git a/include/uapi/linux/v4l2-mediabus.h b/include/uapi/linux/v4l2-mediabus.h index 7d64e0e1a18b..b9b7bea04537 100644 --- a/include/uapi/linux/v4l2-mediabus.h +++ b/include/uapi/linux/v4l2-mediabus.h | |||
| @@ -47,8 +47,9 @@ enum v4l2_mbus_pixelcode { | |||
| 47 | V4L2_MBUS_FMT_RGB565_2X8_BE = 0x1007, | 47 | V4L2_MBUS_FMT_RGB565_2X8_BE = 0x1007, |
| 48 | V4L2_MBUS_FMT_RGB565_2X8_LE = 0x1008, | 48 | V4L2_MBUS_FMT_RGB565_2X8_LE = 0x1008, |
| 49 | 49 | ||
| 50 | /* YUV (including grey) - next is 0x2014 */ | 50 | /* YUV (including grey) - next is 0x2017 */ |
| 51 | V4L2_MBUS_FMT_Y8_1X8 = 0x2001, | 51 | V4L2_MBUS_FMT_Y8_1X8 = 0x2001, |
| 52 | V4L2_MBUS_FMT_UV8_1X8 = 0x2015, | ||
| 52 | V4L2_MBUS_FMT_UYVY8_1_5X8 = 0x2002, | 53 | V4L2_MBUS_FMT_UYVY8_1_5X8 = 0x2002, |
| 53 | V4L2_MBUS_FMT_VYUY8_1_5X8 = 0x2003, | 54 | V4L2_MBUS_FMT_VYUY8_1_5X8 = 0x2003, |
| 54 | V4L2_MBUS_FMT_YUYV8_1_5X8 = 0x2004, | 55 | V4L2_MBUS_FMT_YUYV8_1_5X8 = 0x2004, |
| @@ -65,14 +66,20 @@ enum v4l2_mbus_pixelcode { | |||
| 65 | V4L2_MBUS_FMT_VYUY8_1X16 = 0x2010, | 66 | V4L2_MBUS_FMT_VYUY8_1X16 = 0x2010, |
| 66 | V4L2_MBUS_FMT_YUYV8_1X16 = 0x2011, | 67 | V4L2_MBUS_FMT_YUYV8_1X16 = 0x2011, |
| 67 | V4L2_MBUS_FMT_YVYU8_1X16 = 0x2012, | 68 | V4L2_MBUS_FMT_YVYU8_1X16 = 0x2012, |
| 69 | V4L2_MBUS_FMT_YDYUYDYV8_1X16 = 0x2014, | ||
| 68 | V4L2_MBUS_FMT_YUYV10_1X20 = 0x200d, | 70 | V4L2_MBUS_FMT_YUYV10_1X20 = 0x200d, |
| 69 | V4L2_MBUS_FMT_YVYU10_1X20 = 0x200e, | 71 | V4L2_MBUS_FMT_YVYU10_1X20 = 0x200e, |
| 72 | V4L2_MBUS_FMT_YUV10_1X30 = 0x2016, | ||
| 70 | 73 | ||
| 71 | /* Bayer - next is 0x3015 */ | 74 | /* Bayer - next is 0x3019 */ |
| 72 | V4L2_MBUS_FMT_SBGGR8_1X8 = 0x3001, | 75 | V4L2_MBUS_FMT_SBGGR8_1X8 = 0x3001, |
| 73 | V4L2_MBUS_FMT_SGBRG8_1X8 = 0x3013, | 76 | V4L2_MBUS_FMT_SGBRG8_1X8 = 0x3013, |
| 74 | V4L2_MBUS_FMT_SGRBG8_1X8 = 0x3002, | 77 | V4L2_MBUS_FMT_SGRBG8_1X8 = 0x3002, |
| 75 | V4L2_MBUS_FMT_SRGGB8_1X8 = 0x3014, | 78 | V4L2_MBUS_FMT_SRGGB8_1X8 = 0x3014, |
| 79 | V4L2_MBUS_FMT_SBGGR10_ALAW8_1X8 = 0x3015, | ||
| 80 | V4L2_MBUS_FMT_SGBRG10_ALAW8_1X8 = 0x3016, | ||
| 81 | V4L2_MBUS_FMT_SGRBG10_ALAW8_1X8 = 0x3017, | ||
| 82 | V4L2_MBUS_FMT_SRGGB10_ALAW8_1X8 = 0x3018, | ||
| 76 | V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8 = 0x300b, | 83 | V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8 = 0x300b, |
| 77 | V4L2_MBUS_FMT_SGBRG10_DPCM8_1X8 = 0x300c, | 84 | V4L2_MBUS_FMT_SGBRG10_DPCM8_1X8 = 0x300c, |
| 78 | V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8 = 0x3009, | 85 | V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8 = 0x3009, |
diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h index 4758d1bfcf41..4f41f309911e 100644 --- a/include/uapi/linux/vfio.h +++ b/include/uapi/linux/vfio.h | |||
| @@ -303,6 +303,15 @@ enum { | |||
| 303 | VFIO_PCI_BAR5_REGION_INDEX, | 303 | VFIO_PCI_BAR5_REGION_INDEX, |
| 304 | VFIO_PCI_ROM_REGION_INDEX, | 304 | VFIO_PCI_ROM_REGION_INDEX, |
| 305 | VFIO_PCI_CONFIG_REGION_INDEX, | 305 | VFIO_PCI_CONFIG_REGION_INDEX, |
| 306 | /* | ||
| 307 | * Expose VGA regions defined for PCI base class 03, subclass 00. | ||
| 308 | * This includes I/O port ranges 0x3b0 to 0x3bb and 0x3c0 to 0x3df | ||
| 309 | * as well as the MMIO range 0xa0000 to 0xbffff. Each implemented | ||
| 310 | * range is found at it's identity mapped offset from the region | ||
| 311 | * offset, for example 0x3b0 is region_info.offset + 0x3b0. Areas | ||
| 312 | * between described ranges are unimplemented. | ||
| 313 | */ | ||
| 314 | VFIO_PCI_VGA_REGION_INDEX, | ||
| 306 | VFIO_PCI_NUM_REGIONS | 315 | VFIO_PCI_NUM_REGIONS |
| 307 | }; | 316 | }; |
| 308 | 317 | ||
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 3cf3e946e331..234d1d870914 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h | |||
| @@ -334,6 +334,9 @@ struct v4l2_pix_format { | |||
| 334 | /* Palette formats */ | 334 | /* Palette formats */ |
| 335 | #define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */ | 335 | #define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */ |
| 336 | 336 | ||
| 337 | /* Chrominance formats */ | ||
| 338 | #define V4L2_PIX_FMT_UV8 v4l2_fourcc('U', 'V', '8', ' ') /* 8 UV 4:4 */ | ||
| 339 | |||
| 337 | /* Luminance+Chrominance formats */ | 340 | /* Luminance+Chrominance formats */ |
| 338 | #define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y', 'V', 'U', '9') /* 9 YVU 4:1:0 */ | 341 | #define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y', 'V', 'U', '9') /* 9 YVU 4:1:0 */ |
| 339 | #define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2') /* 12 YVU 4:2:0 */ | 342 | #define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2') /* 12 YVU 4:2:0 */ |
| @@ -386,6 +389,11 @@ struct v4l2_pix_format { | |||
| 386 | #define V4L2_PIX_FMT_SGBRG12 v4l2_fourcc('G', 'B', '1', '2') /* 12 GBGB.. RGRG.. */ | 389 | #define V4L2_PIX_FMT_SGBRG12 v4l2_fourcc('G', 'B', '1', '2') /* 12 GBGB.. RGRG.. */ |
| 387 | #define V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2') /* 12 GRGR.. BGBG.. */ | 390 | #define V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2') /* 12 GRGR.. BGBG.. */ |
| 388 | #define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12 RGRG.. GBGB.. */ | 391 | #define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12 RGRG.. GBGB.. */ |
| 392 | /* 10bit raw bayer a-law compressed to 8 bits */ | ||
| 393 | #define V4L2_PIX_FMT_SBGGR10ALAW8 v4l2_fourcc('a', 'B', 'A', '8') | ||
| 394 | #define V4L2_PIX_FMT_SGBRG10ALAW8 v4l2_fourcc('a', 'G', 'A', '8') | ||
| 395 | #define V4L2_PIX_FMT_SGRBG10ALAW8 v4l2_fourcc('a', 'g', 'A', '8') | ||
| 396 | #define V4L2_PIX_FMT_SRGGB10ALAW8 v4l2_fourcc('a', 'R', 'A', '8') | ||
| 389 | /* 10bit raw bayer DPCM compressed to 8 bits */ | 397 | /* 10bit raw bayer DPCM compressed to 8 bits */ |
| 390 | #define V4L2_PIX_FMT_SBGGR10DPCM8 v4l2_fourcc('b', 'B', 'A', '8') | 398 | #define V4L2_PIX_FMT_SBGGR10DPCM8 v4l2_fourcc('b', 'B', 'A', '8') |
| 391 | #define V4L2_PIX_FMT_SGBRG10DPCM8 v4l2_fourcc('b', 'G', 'A', '8') | 399 | #define V4L2_PIX_FMT_SGBRG10DPCM8 v4l2_fourcc('b', 'G', 'A', '8') |
| @@ -693,6 +701,10 @@ struct v4l2_buffer { | |||
| 693 | /* Cache handling flags */ | 701 | /* Cache handling flags */ |
| 694 | #define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800 | 702 | #define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800 |
| 695 | #define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x1000 | 703 | #define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x1000 |
| 704 | /* Timestamp type */ | ||
| 705 | #define V4L2_BUF_FLAG_TIMESTAMP_MASK 0xe000 | ||
| 706 | #define V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN 0x0000 | ||
| 707 | #define V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC 0x2000 | ||
| 696 | 708 | ||
| 697 | /** | 709 | /** |
| 698 | * struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor | 710 | * struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor |
| @@ -1342,28 +1354,6 @@ struct v4l2_querymenu { | |||
| 1342 | #define V4L2_CID_PRIVATE_BASE 0x08000000 | 1354 | #define V4L2_CID_PRIVATE_BASE 0x08000000 |
| 1343 | 1355 | ||
| 1344 | 1356 | ||
| 1345 | /* DV-class control IDs defined by V4L2 */ | ||
| 1346 | #define V4L2_CID_DV_CLASS_BASE (V4L2_CTRL_CLASS_DV | 0x900) | ||
| 1347 | #define V4L2_CID_DV_CLASS (V4L2_CTRL_CLASS_DV | 1) | ||
| 1348 | |||
| 1349 | #define V4L2_CID_DV_TX_HOTPLUG (V4L2_CID_DV_CLASS_BASE + 1) | ||
| 1350 | #define V4L2_CID_DV_TX_RXSENSE (V4L2_CID_DV_CLASS_BASE + 2) | ||
| 1351 | #define V4L2_CID_DV_TX_EDID_PRESENT (V4L2_CID_DV_CLASS_BASE + 3) | ||
| 1352 | #define V4L2_CID_DV_TX_MODE (V4L2_CID_DV_CLASS_BASE + 4) | ||
| 1353 | enum v4l2_dv_tx_mode { | ||
| 1354 | V4L2_DV_TX_MODE_DVI_D = 0, | ||
| 1355 | V4L2_DV_TX_MODE_HDMI = 1, | ||
| 1356 | }; | ||
| 1357 | #define V4L2_CID_DV_TX_RGB_RANGE (V4L2_CID_DV_CLASS_BASE + 5) | ||
| 1358 | enum v4l2_dv_rgb_range { | ||
| 1359 | V4L2_DV_RGB_RANGE_AUTO = 0, | ||
| 1360 | V4L2_DV_RGB_RANGE_LIMITED = 1, | ||
| 1361 | V4L2_DV_RGB_RANGE_FULL = 2, | ||
| 1362 | }; | ||
| 1363 | |||
| 1364 | #define V4L2_CID_DV_RX_POWER_PRESENT (V4L2_CID_DV_CLASS_BASE + 100) | ||
| 1365 | #define V4L2_CID_DV_RX_RGB_RANGE (V4L2_CID_DV_CLASS_BASE + 101) | ||
| 1366 | |||
| 1367 | /* | 1357 | /* |
| 1368 | * T U N I N G | 1358 | * T U N I N G |
| 1369 | */ | 1359 | */ |
| @@ -1810,6 +1800,7 @@ struct v4l2_event_vsync { | |||
| 1810 | /* Payload for V4L2_EVENT_CTRL */ | 1800 | /* Payload for V4L2_EVENT_CTRL */ |
| 1811 | #define V4L2_EVENT_CTRL_CH_VALUE (1 << 0) | 1801 | #define V4L2_EVENT_CTRL_CH_VALUE (1 << 0) |
| 1812 | #define V4L2_EVENT_CTRL_CH_FLAGS (1 << 1) | 1802 | #define V4L2_EVENT_CTRL_CH_FLAGS (1 << 1) |
| 1803 | #define V4L2_EVENT_CTRL_CH_RANGE (1 << 2) | ||
| 1813 | 1804 | ||
| 1814 | struct v4l2_event_ctrl { | 1805 | struct v4l2_event_ctrl { |
| 1815 | __u32 changes; | 1806 | __u32 changes; |
diff --git a/include/uapi/linux/xattr.h b/include/uapi/linux/xattr.h index 26607bd965fa..e4629b93bdd6 100644 --- a/include/uapi/linux/xattr.h +++ b/include/uapi/linux/xattr.h | |||
| @@ -15,19 +15,22 @@ | |||
| 15 | 15 | ||
| 16 | /* Namespaces */ | 16 | /* Namespaces */ |
| 17 | #define XATTR_OS2_PREFIX "os2." | 17 | #define XATTR_OS2_PREFIX "os2." |
| 18 | #define XATTR_OS2_PREFIX_LEN (sizeof (XATTR_OS2_PREFIX) - 1) | 18 | #define XATTR_OS2_PREFIX_LEN (sizeof(XATTR_OS2_PREFIX) - 1) |
| 19 | |||
| 20 | #define XATTR_MAC_OSX_PREFIX "osx." | ||
| 21 | #define XATTR_MAC_OSX_PREFIX_LEN (sizeof(XATTR_MAC_OSX_PREFIX) - 1) | ||
| 19 | 22 | ||
| 20 | #define XATTR_SECURITY_PREFIX "security." | 23 | #define XATTR_SECURITY_PREFIX "security." |
| 21 | #define XATTR_SECURITY_PREFIX_LEN (sizeof (XATTR_SECURITY_PREFIX) - 1) | 24 | #define XATTR_SECURITY_PREFIX_LEN (sizeof(XATTR_SECURITY_PREFIX) - 1) |
| 22 | 25 | ||
| 23 | #define XATTR_SYSTEM_PREFIX "system." | 26 | #define XATTR_SYSTEM_PREFIX "system." |
| 24 | #define XATTR_SYSTEM_PREFIX_LEN (sizeof (XATTR_SYSTEM_PREFIX) - 1) | 27 | #define XATTR_SYSTEM_PREFIX_LEN (sizeof(XATTR_SYSTEM_PREFIX) - 1) |
| 25 | 28 | ||
| 26 | #define XATTR_TRUSTED_PREFIX "trusted." | 29 | #define XATTR_TRUSTED_PREFIX "trusted." |
| 27 | #define XATTR_TRUSTED_PREFIX_LEN (sizeof (XATTR_TRUSTED_PREFIX) - 1) | 30 | #define XATTR_TRUSTED_PREFIX_LEN (sizeof(XATTR_TRUSTED_PREFIX) - 1) |
| 28 | 31 | ||
| 29 | #define XATTR_USER_PREFIX "user." | 32 | #define XATTR_USER_PREFIX "user." |
| 30 | #define XATTR_USER_PREFIX_LEN (sizeof (XATTR_USER_PREFIX) - 1) | 33 | #define XATTR_USER_PREFIX_LEN (sizeof(XATTR_USER_PREFIX) - 1) |
| 31 | 34 | ||
| 32 | /* Security namespace */ | 35 | /* Security namespace */ |
| 33 | #define XATTR_EVM_SUFFIX "evm" | 36 | #define XATTR_EVM_SUFFIX "evm" |
diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h index 81aba3a73aa3..805711ea2005 100644 --- a/include/uapi/rdma/ib_user_verbs.h +++ b/include/uapi/rdma/ib_user_verbs.h | |||
| @@ -261,6 +261,22 @@ struct ib_uverbs_dereg_mr { | |||
| 261 | __u32 mr_handle; | 261 | __u32 mr_handle; |
| 262 | }; | 262 | }; |
| 263 | 263 | ||
| 264 | struct ib_uverbs_alloc_mw { | ||
| 265 | __u64 response; | ||
| 266 | __u32 pd_handle; | ||
| 267 | __u8 mw_type; | ||
| 268 | __u8 reserved[3]; | ||
| 269 | }; | ||
| 270 | |||
| 271 | struct ib_uverbs_alloc_mw_resp { | ||
| 272 | __u32 mw_handle; | ||
| 273 | __u32 rkey; | ||
| 274 | }; | ||
| 275 | |||
| 276 | struct ib_uverbs_dealloc_mw { | ||
| 277 | __u32 mw_handle; | ||
| 278 | }; | ||
| 279 | |||
| 264 | struct ib_uverbs_create_comp_channel { | 280 | struct ib_uverbs_create_comp_channel { |
| 265 | __u64 response; | 281 | __u64 response; |
| 266 | }; | 282 | }; |
diff --git a/include/uapi/scsi/Kbuild b/include/uapi/scsi/Kbuild index 29a87dd26cfb..75746d52f208 100644 --- a/include/uapi/scsi/Kbuild +++ b/include/uapi/scsi/Kbuild | |||
| @@ -1,2 +1,5 @@ | |||
| 1 | # UAPI Header export list | 1 | # UAPI Header export list |
| 2 | header-y += fc/ | 2 | header-y += fc/ |
| 3 | header-y += scsi_bsg_fc.h | ||
| 4 | header-y += scsi_netlink.h | ||
| 5 | header-y += scsi_netlink_fc.h | ||
diff --git a/include/uapi/scsi/fc/Kbuild b/include/uapi/scsi/fc/Kbuild index aafaa5aa54d4..5ead9fac265c 100644 --- a/include/uapi/scsi/fc/Kbuild +++ b/include/uapi/scsi/fc/Kbuild | |||
| @@ -1 +1,5 @@ | |||
| 1 | # UAPI Header export list | 1 | # UAPI Header export list |
| 2 | header-y += fc_els.h | ||
| 3 | header-y += fc_fs.h | ||
| 4 | header-y += fc_gs.h | ||
| 5 | header-y += fc_ns.h | ||
diff --git a/include/scsi/fc/fc_els.h b/include/uapi/scsi/fc/fc_els.h index 481abbd48e39..481abbd48e39 100644 --- a/include/scsi/fc/fc_els.h +++ b/include/uapi/scsi/fc/fc_els.h | |||
diff --git a/include/scsi/fc/fc_fs.h b/include/uapi/scsi/fc/fc_fs.h index 50f28b143451..50f28b143451 100644 --- a/include/scsi/fc/fc_fs.h +++ b/include/uapi/scsi/fc/fc_fs.h | |||
diff --git a/include/scsi/fc/fc_gs.h b/include/uapi/scsi/fc/fc_gs.h index a37346d47eb1..a37346d47eb1 100644 --- a/include/scsi/fc/fc_gs.h +++ b/include/uapi/scsi/fc/fc_gs.h | |||
diff --git a/include/scsi/fc/fc_ns.h b/include/uapi/scsi/fc/fc_ns.h index f7751d53f1d3..f7751d53f1d3 100644 --- a/include/scsi/fc/fc_ns.h +++ b/include/uapi/scsi/fc/fc_ns.h | |||
diff --git a/include/scsi/scsi_bsg_fc.h b/include/uapi/scsi/scsi_bsg_fc.h index 3031b900b087..3031b900b087 100644 --- a/include/scsi/scsi_bsg_fc.h +++ b/include/uapi/scsi/scsi_bsg_fc.h | |||
diff --git a/include/scsi/scsi_netlink.h b/include/uapi/scsi/scsi_netlink.h index 62b4edab15d3..62b4edab15d3 100644 --- a/include/scsi/scsi_netlink.h +++ b/include/uapi/scsi/scsi_netlink.h | |||
diff --git a/include/scsi/scsi_netlink_fc.h b/include/uapi/scsi/scsi_netlink_fc.h index cbf76e479761..cbf76e479761 100644 --- a/include/scsi/scsi_netlink_fc.h +++ b/include/uapi/scsi/scsi_netlink_fc.h | |||
diff --git a/include/uapi/video/Kbuild b/include/uapi/video/Kbuild index aafaa5aa54d4..ac7203bb32cc 100644 --- a/include/uapi/video/Kbuild +++ b/include/uapi/video/Kbuild | |||
| @@ -1 +1,4 @@ | |||
| 1 | # UAPI Header export list | 1 | # UAPI Header export list |
| 2 | header-y += edid.h | ||
| 3 | header-y += sisfb.h | ||
| 4 | header-y += uvesafb.h | ||
diff --git a/include/uapi/video/edid.h b/include/uapi/video/edid.h new file mode 100644 index 000000000000..8c0f032014c9 --- /dev/null +++ b/include/uapi/video/edid.h | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | #ifndef _UAPI__linux_video_edid_h__ | ||
| 2 | #define _UAPI__linux_video_edid_h__ | ||
| 3 | |||
| 4 | struct edid_info { | ||
| 5 | unsigned char dummy[128]; | ||
| 6 | }; | ||
| 7 | |||
| 8 | |||
| 9 | #endif /* _UAPI__linux_video_edid_h__ */ | ||
diff --git a/include/uapi/video/sisfb.h b/include/uapi/video/sisfb.h new file mode 100644 index 000000000000..9250b22b10f8 --- /dev/null +++ b/include/uapi/video/sisfb.h | |||
| @@ -0,0 +1,209 @@ | |||
| 1 | /* | ||
| 2 | * sisfb.h - definitions for the SiS framebuffer driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria. | ||
| 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 named License, | ||
| 9 | * or 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 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with this program; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef _UAPI_LINUX_SISFB_H_ | ||
| 22 | #define _UAPI_LINUX_SISFB_H_ | ||
| 23 | |||
| 24 | #include <linux/types.h> | ||
| 25 | #include <asm/ioctl.h> | ||
| 26 | |||
| 27 | /**********************************************/ | ||
| 28 | /* PUBLIC */ | ||
| 29 | /**********************************************/ | ||
| 30 | |||
| 31 | /* vbflags, public (others in sis.h) */ | ||
| 32 | #define CRT2_DEFAULT 0x00000001 | ||
| 33 | #define CRT2_LCD 0x00000002 | ||
| 34 | #define CRT2_TV 0x00000004 | ||
| 35 | #define CRT2_VGA 0x00000008 | ||
| 36 | #define TV_NTSC 0x00000010 | ||
| 37 | #define TV_PAL 0x00000020 | ||
| 38 | #define TV_HIVISION 0x00000040 | ||
| 39 | #define TV_YPBPR 0x00000080 | ||
| 40 | #define TV_AVIDEO 0x00000100 | ||
| 41 | #define TV_SVIDEO 0x00000200 | ||
| 42 | #define TV_SCART 0x00000400 | ||
| 43 | #define TV_PALM 0x00001000 | ||
| 44 | #define TV_PALN 0x00002000 | ||
| 45 | #define TV_NTSCJ 0x00001000 | ||
| 46 | #define TV_CHSCART 0x00008000 | ||
| 47 | #define TV_CHYPBPR525I 0x00010000 | ||
| 48 | #define CRT1_VGA 0x00000000 | ||
| 49 | #define CRT1_LCDA 0x00020000 | ||
| 50 | #define VGA2_CONNECTED 0x00040000 | ||
| 51 | #define VB_DISPTYPE_CRT1 0x00080000 /* CRT1 connected and used */ | ||
| 52 | #define VB_SINGLE_MODE 0x20000000 /* CRT1 or CRT2; determined by DISPTYPE_CRTx */ | ||
| 53 | #define VB_MIRROR_MODE 0x40000000 /* CRT1 + CRT2 identical (mirror mode) */ | ||
| 54 | #define VB_DUALVIEW_MODE 0x80000000 /* CRT1 + CRT2 independent (dual head mode) */ | ||
| 55 | |||
| 56 | /* Aliases: */ | ||
| 57 | #define CRT2_ENABLE (CRT2_LCD | CRT2_TV | CRT2_VGA) | ||
| 58 | #define TV_STANDARD (TV_NTSC | TV_PAL | TV_PALM | TV_PALN | TV_NTSCJ) | ||
| 59 | #define TV_INTERFACE (TV_AVIDEO|TV_SVIDEO|TV_SCART|TV_HIVISION|TV_YPBPR|TV_CHSCART|TV_CHYPBPR525I) | ||
| 60 | |||
| 61 | /* Only if TV_YPBPR is set: */ | ||
| 62 | #define TV_YPBPR525I TV_NTSC | ||
| 63 | #define TV_YPBPR525P TV_PAL | ||
| 64 | #define TV_YPBPR750P TV_PALM | ||
| 65 | #define TV_YPBPR1080I TV_PALN | ||
| 66 | #define TV_YPBPRALL (TV_YPBPR525I | TV_YPBPR525P | TV_YPBPR750P | TV_YPBPR1080I) | ||
| 67 | |||
| 68 | #define VB_DISPTYPE_DISP2 CRT2_ENABLE | ||
| 69 | #define VB_DISPTYPE_CRT2 CRT2_ENABLE | ||
| 70 | #define VB_DISPTYPE_DISP1 VB_DISPTYPE_CRT1 | ||
| 71 | #define VB_DISPMODE_SINGLE VB_SINGLE_MODE | ||
| 72 | #define VB_DISPMODE_MIRROR VB_MIRROR_MODE | ||
| 73 | #define VB_DISPMODE_DUAL VB_DUALVIEW_MODE | ||
| 74 | #define VB_DISPLAY_MODE (SINGLE_MODE | MIRROR_MODE | DUALVIEW_MODE) | ||
| 75 | |||
| 76 | /* Structure argument for SISFB_GET_INFO ioctl */ | ||
| 77 | struct sisfb_info { | ||
| 78 | __u32 sisfb_id; /* for identifying sisfb */ | ||
| 79 | #ifndef SISFB_ID | ||
| 80 | #define SISFB_ID 0x53495346 /* Identify myself with 'SISF' */ | ||
| 81 | #endif | ||
| 82 | __u32 chip_id; /* PCI-ID of detected chip */ | ||
| 83 | __u32 memory; /* total video memory in KB */ | ||
| 84 | __u32 heapstart; /* heap start offset in KB */ | ||
| 85 | __u8 fbvidmode; /* current sisfb mode */ | ||
| 86 | |||
| 87 | __u8 sisfb_version; | ||
| 88 | __u8 sisfb_revision; | ||
| 89 | __u8 sisfb_patchlevel; | ||
| 90 | |||
| 91 | __u8 sisfb_caps; /* sisfb capabilities */ | ||
| 92 | |||
| 93 | __u32 sisfb_tqlen; /* turbo queue length (in KB) */ | ||
| 94 | |||
| 95 | __u32 sisfb_pcibus; /* The card's PCI ID */ | ||
| 96 | __u32 sisfb_pcislot; | ||
| 97 | __u32 sisfb_pcifunc; | ||
| 98 | |||
| 99 | __u8 sisfb_lcdpdc; /* PanelDelayCompensation */ | ||
| 100 | |||
| 101 | __u8 sisfb_lcda; /* Detected status of LCDA for low res/text modes */ | ||
| 102 | |||
| 103 | __u32 sisfb_vbflags; | ||
| 104 | __u32 sisfb_currentvbflags; | ||
| 105 | |||
| 106 | __u32 sisfb_scalelcd; | ||
| 107 | __u32 sisfb_specialtiming; | ||
| 108 | |||
| 109 | __u8 sisfb_haveemi; | ||
| 110 | __u8 sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33; | ||
| 111 | __u8 sisfb_haveemilcd; | ||
| 112 | |||
| 113 | __u8 sisfb_lcdpdca; /* PanelDelayCompensation for LCD-via-CRT1 */ | ||
| 114 | |||
| 115 | __u16 sisfb_tvxpos, sisfb_tvypos; /* Warning: Values + 32 ! */ | ||
| 116 | |||
| 117 | __u32 sisfb_heapsize; /* heap size (in KB) */ | ||
| 118 | __u32 sisfb_videooffset; /* Offset of viewport in video memory (in bytes) */ | ||
| 119 | |||
| 120 | __u32 sisfb_curfstn; /* currently running FSTN/DSTN mode */ | ||
| 121 | __u32 sisfb_curdstn; | ||
| 122 | |||
| 123 | __u16 sisfb_pci_vendor; /* PCI vendor (SiS or XGI) */ | ||
| 124 | |||
| 125 | __u32 sisfb_vbflags2; /* ivideo->vbflags2 */ | ||
| 126 | |||
| 127 | __u8 sisfb_can_post; /* sisfb can POST this card */ | ||
| 128 | __u8 sisfb_card_posted; /* card is POSTED */ | ||
| 129 | __u8 sisfb_was_boot_device; /* This card was the boot video device (ie is primary) */ | ||
| 130 | |||
| 131 | __u8 reserved[183]; /* for future use */ | ||
| 132 | }; | ||
| 133 | |||
| 134 | #define SISFB_CMD_GETVBFLAGS 0x55AA0001 /* no arg; result[1] = vbflags */ | ||
| 135 | #define SISFB_CMD_SWITCHCRT1 0x55AA0010 /* arg[0]: 99 = query, 0 = off, 1 = on */ | ||
| 136 | /* more to come */ | ||
| 137 | |||
| 138 | #define SISFB_CMD_ERR_OK 0x80000000 /* command succeeded */ | ||
| 139 | #define SISFB_CMD_ERR_LOCKED 0x80000001 /* sisfb is locked */ | ||
| 140 | #define SISFB_CMD_ERR_EARLY 0x80000002 /* request before sisfb took over gfx system */ | ||
| 141 | #define SISFB_CMD_ERR_NOVB 0x80000003 /* No video bridge */ | ||
| 142 | #define SISFB_CMD_ERR_NOCRT2 0x80000004 /* can't change CRT1 status, CRT2 disabled */ | ||
| 143 | /* more to come */ | ||
| 144 | #define SISFB_CMD_ERR_UNKNOWN 0x8000ffff /* Unknown command */ | ||
| 145 | #define SISFB_CMD_ERR_OTHER 0x80010000 /* Other error */ | ||
| 146 | |||
| 147 | /* Argument for SISFB_CMD ioctl */ | ||
| 148 | struct sisfb_cmd { | ||
| 149 | __u32 sisfb_cmd; | ||
| 150 | __u32 sisfb_arg[16]; | ||
| 151 | __u32 sisfb_result[4]; | ||
| 152 | }; | ||
| 153 | |||
| 154 | /* Additional IOCTLs for communication sisfb <> X driver */ | ||
| 155 | /* If changing this, vgatypes.h must also be changed (for X driver) */ | ||
| 156 | |||
| 157 | /* ioctl for identifying and giving some info (esp. memory heap start) */ | ||
| 158 | #define SISFB_GET_INFO_SIZE _IOR(0xF3,0x00,__u32) | ||
| 159 | #define SISFB_GET_INFO _IOR(0xF3,0x01,struct sisfb_info) | ||
| 160 | |||
| 161 | /* ioctrl to get current vertical retrace status */ | ||
| 162 | #define SISFB_GET_VBRSTATUS _IOR(0xF3,0x02,__u32) | ||
| 163 | |||
| 164 | /* ioctl to enable/disable panning auto-maximize (like nomax parameter) */ | ||
| 165 | #define SISFB_GET_AUTOMAXIMIZE _IOR(0xF3,0x03,__u32) | ||
| 166 | #define SISFB_SET_AUTOMAXIMIZE _IOW(0xF3,0x03,__u32) | ||
| 167 | |||
| 168 | /* ioctls to relocate TV output (x=D[31:16], y=D[15:0], + 32)*/ | ||
| 169 | #define SISFB_GET_TVPOSOFFSET _IOR(0xF3,0x04,__u32) | ||
| 170 | #define SISFB_SET_TVPOSOFFSET _IOW(0xF3,0x04,__u32) | ||
| 171 | |||
| 172 | /* ioctl for internal sisfb commands (sisfbctrl) */ | ||
| 173 | #define SISFB_COMMAND _IOWR(0xF3,0x05,struct sisfb_cmd) | ||
| 174 | |||
| 175 | /* ioctl for locking sisfb (no register access during lock) */ | ||
| 176 | /* As of now, only used to avoid register access during | ||
| 177 | * the ioctls listed above. | ||
| 178 | */ | ||
| 179 | #define SISFB_SET_LOCK _IOW(0xF3,0x06,__u32) | ||
| 180 | |||
| 181 | /* ioctls 0xF3 up to 0x3F reserved for sisfb */ | ||
| 182 | |||
| 183 | /****************************************************************/ | ||
| 184 | /* The following are deprecated and should not be used anymore: */ | ||
| 185 | /****************************************************************/ | ||
| 186 | /* ioctl for identifying and giving some info (esp. memory heap start) */ | ||
| 187 | #define SISFB_GET_INFO_OLD _IOR('n',0xF8,__u32) | ||
| 188 | /* ioctrl to get current vertical retrace status */ | ||
| 189 | #define SISFB_GET_VBRSTATUS_OLD _IOR('n',0xF9,__u32) | ||
| 190 | /* ioctl to enable/disable panning auto-maximize (like nomax parameter) */ | ||
| 191 | #define SISFB_GET_AUTOMAXIMIZE_OLD _IOR('n',0xFA,__u32) | ||
| 192 | #define SISFB_SET_AUTOMAXIMIZE_OLD _IOW('n',0xFA,__u32) | ||
| 193 | /****************************************************************/ | ||
| 194 | /* End of deprecated ioctl numbers */ | ||
| 195 | /****************************************************************/ | ||
| 196 | |||
| 197 | /* For fb memory manager (FBIO_ALLOC, FBIO_FREE) */ | ||
| 198 | struct sis_memreq { | ||
| 199 | __u32 offset; | ||
| 200 | __u32 size; | ||
| 201 | }; | ||
| 202 | |||
| 203 | /**********************************************/ | ||
| 204 | /* PRIVATE */ | ||
| 205 | /* (for IN-KERNEL usage only) */ | ||
| 206 | /**********************************************/ | ||
| 207 | |||
| 208 | |||
| 209 | #endif /* _UAPI_LINUX_SISFB_H_ */ | ||
diff --git a/include/uapi/video/uvesafb.h b/include/uapi/video/uvesafb.h new file mode 100644 index 000000000000..cee063d723ad --- /dev/null +++ b/include/uapi/video/uvesafb.h | |||
| @@ -0,0 +1,60 @@ | |||
| 1 | #ifndef _UAPI_UVESAFB_H | ||
| 2 | #define _UAPI_UVESAFB_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | struct v86_regs { | ||
| 7 | __u32 ebx; | ||
| 8 | __u32 ecx; | ||
| 9 | __u32 edx; | ||
| 10 | __u32 esi; | ||
| 11 | __u32 edi; | ||
| 12 | __u32 ebp; | ||
| 13 | __u32 eax; | ||
| 14 | __u32 eip; | ||
| 15 | __u32 eflags; | ||
| 16 | __u32 esp; | ||
| 17 | __u16 cs; | ||
| 18 | __u16 ss; | ||
| 19 | __u16 es; | ||
| 20 | __u16 ds; | ||
| 21 | __u16 fs; | ||
| 22 | __u16 gs; | ||
| 23 | }; | ||
| 24 | |||
| 25 | /* Task flags */ | ||
| 26 | #define TF_VBEIB 0x01 | ||
| 27 | #define TF_BUF_ESDI 0x02 | ||
| 28 | #define TF_BUF_ESBX 0x04 | ||
| 29 | #define TF_BUF_RET 0x08 | ||
| 30 | #define TF_EXIT 0x10 | ||
| 31 | |||
| 32 | struct uvesafb_task { | ||
| 33 | __u8 flags; | ||
| 34 | int buf_len; | ||
| 35 | struct v86_regs regs; | ||
| 36 | }; | ||
| 37 | |||
| 38 | /* Constants for the capabilities field | ||
| 39 | * in vbe_ib */ | ||
| 40 | #define VBE_CAP_CAN_SWITCH_DAC 0x01 | ||
| 41 | #define VBE_CAP_VGACOMPAT 0x02 | ||
| 42 | |||
| 43 | /* The VBE Info Block */ | ||
| 44 | struct vbe_ib { | ||
| 45 | char vbe_signature[4]; | ||
| 46 | __u16 vbe_version; | ||
| 47 | __u32 oem_string_ptr; | ||
| 48 | __u32 capabilities; | ||
| 49 | __u32 mode_list_ptr; | ||
| 50 | __u16 total_memory; | ||
| 51 | __u16 oem_software_rev; | ||
| 52 | __u32 oem_vendor_name_ptr; | ||
| 53 | __u32 oem_product_name_ptr; | ||
| 54 | __u32 oem_product_rev_ptr; | ||
| 55 | __u8 reserved[222]; | ||
| 56 | char oem_data[256]; | ||
| 57 | char misc_data[512]; | ||
| 58 | } __attribute__ ((packed)); | ||
| 59 | |||
| 60 | #endif /* _UAPI_UVESAFB_H */ | ||
diff --git a/include/video/Kbuild b/include/video/Kbuild index ad3e622c5339..e69de29bb2d1 100644 --- a/include/video/Kbuild +++ b/include/video/Kbuild | |||
| @@ -1,3 +0,0 @@ | |||
| 1 | header-y += edid.h | ||
| 2 | header-y += sisfb.h | ||
| 3 | header-y += uvesafb.h | ||
diff --git a/include/video/display_timing.h b/include/video/display_timing.h new file mode 100644 index 000000000000..71e9a383a981 --- /dev/null +++ b/include/video/display_timing.h | |||
| @@ -0,0 +1,124 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2012 Steffen Trumtrar <s.trumtrar@pengutronix.de> | ||
| 3 | * | ||
| 4 | * description of display timings | ||
| 5 | * | ||
| 6 | * This file is released under the GPLv2 | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef __LINUX_DISPLAY_TIMING_H | ||
| 10 | #define __LINUX_DISPLAY_TIMING_H | ||
| 11 | |||
| 12 | #include <linux/bitops.h> | ||
| 13 | #include <linux/types.h> | ||
| 14 | |||
| 15 | /* VESA display monitor timing parameters */ | ||
| 16 | #define VESA_DMT_HSYNC_LOW BIT(0) | ||
| 17 | #define VESA_DMT_HSYNC_HIGH BIT(1) | ||
| 18 | #define VESA_DMT_VSYNC_LOW BIT(2) | ||
| 19 | #define VESA_DMT_VSYNC_HIGH BIT(3) | ||
| 20 | |||
| 21 | /* display specific flags */ | ||
| 22 | #define DISPLAY_FLAGS_DE_LOW BIT(0) /* data enable flag */ | ||
| 23 | #define DISPLAY_FLAGS_DE_HIGH BIT(1) | ||
| 24 | #define DISPLAY_FLAGS_PIXDATA_POSEDGE BIT(2) /* drive data on pos. edge */ | ||
| 25 | #define DISPLAY_FLAGS_PIXDATA_NEGEDGE BIT(3) /* drive data on neg. edge */ | ||
| 26 | #define DISPLAY_FLAGS_INTERLACED BIT(4) | ||
| 27 | #define DISPLAY_FLAGS_DOUBLESCAN BIT(5) | ||
| 28 | |||
| 29 | /* | ||
| 30 | * A single signal can be specified via a range of minimal and maximal values | ||
| 31 | * with a typical value, that lies somewhere inbetween. | ||
| 32 | */ | ||
| 33 | struct timing_entry { | ||
| 34 | u32 min; | ||
| 35 | u32 typ; | ||
| 36 | u32 max; | ||
| 37 | }; | ||
| 38 | |||
| 39 | enum timing_entry_index { | ||
| 40 | TE_MIN = 0, | ||
| 41 | TE_TYP = 1, | ||
| 42 | TE_MAX = 2, | ||
| 43 | }; | ||
| 44 | |||
| 45 | /* | ||
| 46 | * Single "mode" entry. This describes one set of signal timings a display can | ||
| 47 | * have in one setting. This struct can later be converted to struct videomode | ||
| 48 | * (see include/video/videomode.h). As each timing_entry can be defined as a | ||
| 49 | * range, one struct display_timing may become multiple struct videomodes. | ||
| 50 | * | ||
| 51 | * Example: hsync active high, vsync active low | ||
| 52 | * | ||
| 53 | * Active Video | ||
| 54 | * Video ______________________XXXXXXXXXXXXXXXXXXXXXX_____________________ | ||
| 55 | * |<- sync ->|<- back ->|<----- active ----->|<- front ->|<- sync.. | ||
| 56 | * | | porch | | porch | | ||
| 57 | * | ||
| 58 | * HSync _|¯¯¯¯¯¯¯¯¯¯|___________________________________________|¯¯¯¯¯¯¯¯¯ | ||
| 59 | * | ||
| 60 | * VSync ¯|__________|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|_________ | ||
| 61 | */ | ||
| 62 | struct display_timing { | ||
| 63 | struct timing_entry pixelclock; | ||
| 64 | |||
| 65 | struct timing_entry hactive; /* hor. active video */ | ||
| 66 | struct timing_entry hfront_porch; /* hor. front porch */ | ||
| 67 | struct timing_entry hback_porch; /* hor. back porch */ | ||
| 68 | struct timing_entry hsync_len; /* hor. sync len */ | ||
| 69 | |||
| 70 | struct timing_entry vactive; /* ver. active video */ | ||
| 71 | struct timing_entry vfront_porch; /* ver. front porch */ | ||
| 72 | struct timing_entry vback_porch; /* ver. back porch */ | ||
| 73 | struct timing_entry vsync_len; /* ver. sync len */ | ||
| 74 | |||
| 75 | unsigned int dmt_flags; /* VESA DMT flags */ | ||
| 76 | unsigned int data_flags; /* video data flags */ | ||
| 77 | }; | ||
| 78 | |||
| 79 | /* | ||
| 80 | * This describes all timing settings a display provides. | ||
| 81 | * The native_mode is the default setting for this display. | ||
| 82 | * Drivers that can handle multiple videomodes should work with this struct and | ||
| 83 | * convert each entry to the desired end result. | ||
| 84 | */ | ||
| 85 | struct display_timings { | ||
| 86 | unsigned int num_timings; | ||
| 87 | unsigned int native_mode; | ||
| 88 | |||
| 89 | struct display_timing **timings; | ||
| 90 | }; | ||
| 91 | |||
| 92 | /* get value specified by index from struct timing_entry */ | ||
| 93 | static inline u32 display_timing_get_value(const struct timing_entry *te, | ||
| 94 | enum timing_entry_index index) | ||
| 95 | { | ||
| 96 | switch (index) { | ||
| 97 | case TE_MIN: | ||
| 98 | return te->min; | ||
| 99 | break; | ||
| 100 | case TE_TYP: | ||
| 101 | return te->typ; | ||
| 102 | break; | ||
| 103 | case TE_MAX: | ||
| 104 | return te->max; | ||
| 105 | break; | ||
| 106 | default: | ||
| 107 | return te->typ; | ||
| 108 | } | ||
| 109 | } | ||
| 110 | |||
| 111 | /* get one entry from struct display_timings */ | ||
| 112 | static inline struct display_timing *display_timings_get(const struct | ||
| 113 | display_timings *disp, | ||
| 114 | unsigned int index) | ||
| 115 | { | ||
| 116 | if (disp->num_timings > index) | ||
| 117 | return disp->timings[index]; | ||
| 118 | else | ||
| 119 | return NULL; | ||
| 120 | } | ||
| 121 | |||
| 122 | void display_timings_release(struct display_timings *disp); | ||
| 123 | |||
| 124 | #endif | ||
diff --git a/include/video/edid.h b/include/video/edid.h index c5f198704912..0cb8b2a92b75 100644 --- a/include/video/edid.h +++ b/include/video/edid.h | |||
| @@ -1,14 +1,9 @@ | |||
| 1 | #ifndef __linux_video_edid_h__ | 1 | #ifndef __linux_video_edid_h__ |
| 2 | #define __linux_video_edid_h__ | 2 | #define __linux_video_edid_h__ |
| 3 | 3 | ||
| 4 | struct edid_info { | 4 | #include <uapi/video/edid.h> |
| 5 | unsigned char dummy[128]; | ||
| 6 | }; | ||
| 7 | 5 | ||
| 8 | #ifdef __KERNEL__ | ||
| 9 | #ifdef CONFIG_X86 | 6 | #ifdef CONFIG_X86 |
| 10 | extern struct edid_info edid_info; | 7 | extern struct edid_info edid_info; |
| 11 | #endif | 8 | #endif |
| 12 | #endif | ||
| 13 | |||
| 14 | #endif /* __linux_video_edid_h__ */ | 9 | #endif /* __linux_video_edid_h__ */ |
diff --git a/include/video/of_display_timing.h b/include/video/of_display_timing.h new file mode 100644 index 000000000000..8016eb727cf3 --- /dev/null +++ b/include/video/of_display_timing.h | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2012 Steffen Trumtrar <s.trumtrar@pengutronix.de> | ||
| 3 | * | ||
| 4 | * display timings of helpers | ||
| 5 | * | ||
| 6 | * This file is released under the GPLv2 | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef __LINUX_OF_DISPLAY_TIMING_H | ||
| 10 | #define __LINUX_OF_DISPLAY_TIMING_H | ||
| 11 | |||
| 12 | struct device_node; | ||
| 13 | struct display_timings; | ||
| 14 | |||
| 15 | #define OF_USE_NATIVE_MODE -1 | ||
| 16 | |||
| 17 | struct display_timings *of_get_display_timings(struct device_node *np); | ||
| 18 | int of_display_timings_exist(struct device_node *np); | ||
| 19 | |||
| 20 | #endif | ||
diff --git a/include/video/of_videomode.h b/include/video/of_videomode.h new file mode 100644 index 000000000000..a07efcc51424 --- /dev/null +++ b/include/video/of_videomode.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2012 Steffen Trumtrar <s.trumtrar@pengutronix.de> | ||
| 3 | * | ||
| 4 | * videomode of-helpers | ||
| 5 | * | ||
| 6 | * This file is released under the GPLv2 | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef __LINUX_OF_VIDEOMODE_H | ||
| 10 | #define __LINUX_OF_VIDEOMODE_H | ||
| 11 | |||
| 12 | struct device_node; | ||
| 13 | struct videomode; | ||
| 14 | |||
| 15 | int of_get_videomode(struct device_node *np, struct videomode *vm, | ||
| 16 | int index); | ||
| 17 | |||
| 18 | #endif /* __LINUX_OF_VIDEOMODE_H */ | ||
diff --git a/include/video/sisfb.h b/include/video/sisfb.h index 6dc5df9e43f3..6ddff93108fb 100644 --- a/include/video/sisfb.h +++ b/include/video/sisfb.h | |||
| @@ -17,197 +17,12 @@ | |||
| 17 | * along with this program; if not, write to the Free Software | 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA | 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA |
| 19 | */ | 19 | */ |
| 20 | |||
| 21 | #ifndef _LINUX_SISFB_H_ | 20 | #ifndef _LINUX_SISFB_H_ |
| 22 | #define _LINUX_SISFB_H_ | 21 | #define _LINUX_SISFB_H_ |
| 23 | 22 | ||
| 24 | #include <linux/types.h> | ||
| 25 | #include <asm/ioctl.h> | ||
| 26 | |||
| 27 | /**********************************************/ | ||
| 28 | /* PUBLIC */ | ||
| 29 | /**********************************************/ | ||
| 30 | |||
| 31 | /* vbflags, public (others in sis.h) */ | ||
| 32 | #define CRT2_DEFAULT 0x00000001 | ||
| 33 | #define CRT2_LCD 0x00000002 | ||
| 34 | #define CRT2_TV 0x00000004 | ||
| 35 | #define CRT2_VGA 0x00000008 | ||
| 36 | #define TV_NTSC 0x00000010 | ||
| 37 | #define TV_PAL 0x00000020 | ||
| 38 | #define TV_HIVISION 0x00000040 | ||
| 39 | #define TV_YPBPR 0x00000080 | ||
| 40 | #define TV_AVIDEO 0x00000100 | ||
| 41 | #define TV_SVIDEO 0x00000200 | ||
| 42 | #define TV_SCART 0x00000400 | ||
| 43 | #define TV_PALM 0x00001000 | ||
| 44 | #define TV_PALN 0x00002000 | ||
| 45 | #define TV_NTSCJ 0x00001000 | ||
| 46 | #define TV_CHSCART 0x00008000 | ||
| 47 | #define TV_CHYPBPR525I 0x00010000 | ||
| 48 | #define CRT1_VGA 0x00000000 | ||
| 49 | #define CRT1_LCDA 0x00020000 | ||
| 50 | #define VGA2_CONNECTED 0x00040000 | ||
| 51 | #define VB_DISPTYPE_CRT1 0x00080000 /* CRT1 connected and used */ | ||
| 52 | #define VB_SINGLE_MODE 0x20000000 /* CRT1 or CRT2; determined by DISPTYPE_CRTx */ | ||
| 53 | #define VB_MIRROR_MODE 0x40000000 /* CRT1 + CRT2 identical (mirror mode) */ | ||
| 54 | #define VB_DUALVIEW_MODE 0x80000000 /* CRT1 + CRT2 independent (dual head mode) */ | ||
| 55 | |||
| 56 | /* Aliases: */ | ||
| 57 | #define CRT2_ENABLE (CRT2_LCD | CRT2_TV | CRT2_VGA) | ||
| 58 | #define TV_STANDARD (TV_NTSC | TV_PAL | TV_PALM | TV_PALN | TV_NTSCJ) | ||
| 59 | #define TV_INTERFACE (TV_AVIDEO|TV_SVIDEO|TV_SCART|TV_HIVISION|TV_YPBPR|TV_CHSCART|TV_CHYPBPR525I) | ||
| 60 | |||
| 61 | /* Only if TV_YPBPR is set: */ | ||
| 62 | #define TV_YPBPR525I TV_NTSC | ||
| 63 | #define TV_YPBPR525P TV_PAL | ||
| 64 | #define TV_YPBPR750P TV_PALM | ||
| 65 | #define TV_YPBPR1080I TV_PALN | ||
| 66 | #define TV_YPBPRALL (TV_YPBPR525I | TV_YPBPR525P | TV_YPBPR750P | TV_YPBPR1080I) | ||
| 67 | |||
| 68 | #define VB_DISPTYPE_DISP2 CRT2_ENABLE | ||
| 69 | #define VB_DISPTYPE_CRT2 CRT2_ENABLE | ||
| 70 | #define VB_DISPTYPE_DISP1 VB_DISPTYPE_CRT1 | ||
| 71 | #define VB_DISPMODE_SINGLE VB_SINGLE_MODE | ||
| 72 | #define VB_DISPMODE_MIRROR VB_MIRROR_MODE | ||
| 73 | #define VB_DISPMODE_DUAL VB_DUALVIEW_MODE | ||
| 74 | #define VB_DISPLAY_MODE (SINGLE_MODE | MIRROR_MODE | DUALVIEW_MODE) | ||
| 75 | |||
| 76 | /* Structure argument for SISFB_GET_INFO ioctl */ | ||
| 77 | struct sisfb_info { | ||
| 78 | __u32 sisfb_id; /* for identifying sisfb */ | ||
| 79 | #ifndef SISFB_ID | ||
| 80 | #define SISFB_ID 0x53495346 /* Identify myself with 'SISF' */ | ||
| 81 | #endif | ||
| 82 | __u32 chip_id; /* PCI-ID of detected chip */ | ||
| 83 | __u32 memory; /* total video memory in KB */ | ||
| 84 | __u32 heapstart; /* heap start offset in KB */ | ||
| 85 | __u8 fbvidmode; /* current sisfb mode */ | ||
| 86 | |||
| 87 | __u8 sisfb_version; | ||
| 88 | __u8 sisfb_revision; | ||
| 89 | __u8 sisfb_patchlevel; | ||
| 90 | |||
| 91 | __u8 sisfb_caps; /* sisfb capabilities */ | ||
| 92 | |||
| 93 | __u32 sisfb_tqlen; /* turbo queue length (in KB) */ | ||
| 94 | |||
| 95 | __u32 sisfb_pcibus; /* The card's PCI ID */ | ||
| 96 | __u32 sisfb_pcislot; | ||
| 97 | __u32 sisfb_pcifunc; | ||
| 98 | |||
| 99 | __u8 sisfb_lcdpdc; /* PanelDelayCompensation */ | ||
| 100 | |||
| 101 | __u8 sisfb_lcda; /* Detected status of LCDA for low res/text modes */ | ||
| 102 | |||
| 103 | __u32 sisfb_vbflags; | ||
| 104 | __u32 sisfb_currentvbflags; | ||
| 105 | |||
| 106 | __u32 sisfb_scalelcd; | ||
| 107 | __u32 sisfb_specialtiming; | ||
| 108 | |||
| 109 | __u8 sisfb_haveemi; | ||
| 110 | __u8 sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33; | ||
| 111 | __u8 sisfb_haveemilcd; | ||
| 112 | |||
| 113 | __u8 sisfb_lcdpdca; /* PanelDelayCompensation for LCD-via-CRT1 */ | ||
| 114 | |||
| 115 | __u16 sisfb_tvxpos, sisfb_tvypos; /* Warning: Values + 32 ! */ | ||
| 116 | |||
| 117 | __u32 sisfb_heapsize; /* heap size (in KB) */ | ||
| 118 | __u32 sisfb_videooffset; /* Offset of viewport in video memory (in bytes) */ | ||
| 119 | |||
| 120 | __u32 sisfb_curfstn; /* currently running FSTN/DSTN mode */ | ||
| 121 | __u32 sisfb_curdstn; | ||
| 122 | |||
| 123 | __u16 sisfb_pci_vendor; /* PCI vendor (SiS or XGI) */ | ||
| 124 | |||
| 125 | __u32 sisfb_vbflags2; /* ivideo->vbflags2 */ | ||
| 126 | |||
| 127 | __u8 sisfb_can_post; /* sisfb can POST this card */ | ||
| 128 | __u8 sisfb_card_posted; /* card is POSTED */ | ||
| 129 | __u8 sisfb_was_boot_device; /* This card was the boot video device (ie is primary) */ | ||
| 130 | |||
| 131 | __u8 reserved[183]; /* for future use */ | ||
| 132 | }; | ||
| 133 | |||
| 134 | #define SISFB_CMD_GETVBFLAGS 0x55AA0001 /* no arg; result[1] = vbflags */ | ||
| 135 | #define SISFB_CMD_SWITCHCRT1 0x55AA0010 /* arg[0]: 99 = query, 0 = off, 1 = on */ | ||
| 136 | /* more to come */ | ||
| 137 | |||
| 138 | #define SISFB_CMD_ERR_OK 0x80000000 /* command succeeded */ | ||
| 139 | #define SISFB_CMD_ERR_LOCKED 0x80000001 /* sisfb is locked */ | ||
| 140 | #define SISFB_CMD_ERR_EARLY 0x80000002 /* request before sisfb took over gfx system */ | ||
| 141 | #define SISFB_CMD_ERR_NOVB 0x80000003 /* No video bridge */ | ||
| 142 | #define SISFB_CMD_ERR_NOCRT2 0x80000004 /* can't change CRT1 status, CRT2 disabled */ | ||
| 143 | /* more to come */ | ||
| 144 | #define SISFB_CMD_ERR_UNKNOWN 0x8000ffff /* Unknown command */ | ||
| 145 | #define SISFB_CMD_ERR_OTHER 0x80010000 /* Other error */ | ||
| 146 | |||
| 147 | /* Argument for SISFB_CMD ioctl */ | ||
| 148 | struct sisfb_cmd { | ||
| 149 | __u32 sisfb_cmd; | ||
| 150 | __u32 sisfb_arg[16]; | ||
| 151 | __u32 sisfb_result[4]; | ||
| 152 | }; | ||
| 153 | |||
| 154 | /* Additional IOCTLs for communication sisfb <> X driver */ | ||
| 155 | /* If changing this, vgatypes.h must also be changed (for X driver) */ | ||
| 156 | |||
| 157 | /* ioctl for identifying and giving some info (esp. memory heap start) */ | ||
| 158 | #define SISFB_GET_INFO_SIZE _IOR(0xF3,0x00,__u32) | ||
| 159 | #define SISFB_GET_INFO _IOR(0xF3,0x01,struct sisfb_info) | ||
| 160 | |||
| 161 | /* ioctrl to get current vertical retrace status */ | ||
| 162 | #define SISFB_GET_VBRSTATUS _IOR(0xF3,0x02,__u32) | ||
| 163 | |||
| 164 | /* ioctl to enable/disable panning auto-maximize (like nomax parameter) */ | ||
| 165 | #define SISFB_GET_AUTOMAXIMIZE _IOR(0xF3,0x03,__u32) | ||
| 166 | #define SISFB_SET_AUTOMAXIMIZE _IOW(0xF3,0x03,__u32) | ||
| 167 | |||
| 168 | /* ioctls to relocate TV output (x=D[31:16], y=D[15:0], + 32)*/ | ||
| 169 | #define SISFB_GET_TVPOSOFFSET _IOR(0xF3,0x04,__u32) | ||
| 170 | #define SISFB_SET_TVPOSOFFSET _IOW(0xF3,0x04,__u32) | ||
| 171 | |||
| 172 | /* ioctl for internal sisfb commands (sisfbctrl) */ | ||
| 173 | #define SISFB_COMMAND _IOWR(0xF3,0x05,struct sisfb_cmd) | ||
| 174 | |||
| 175 | /* ioctl for locking sisfb (no register access during lock) */ | ||
| 176 | /* As of now, only used to avoid register access during | ||
| 177 | * the ioctls listed above. | ||
| 178 | */ | ||
| 179 | #define SISFB_SET_LOCK _IOW(0xF3,0x06,__u32) | ||
| 180 | |||
| 181 | /* ioctls 0xF3 up to 0x3F reserved for sisfb */ | ||
| 182 | |||
| 183 | /****************************************************************/ | ||
| 184 | /* The following are deprecated and should not be used anymore: */ | ||
| 185 | /****************************************************************/ | ||
| 186 | /* ioctl for identifying and giving some info (esp. memory heap start) */ | ||
| 187 | #define SISFB_GET_INFO_OLD _IOR('n',0xF8,__u32) | ||
| 188 | /* ioctrl to get current vertical retrace status */ | ||
| 189 | #define SISFB_GET_VBRSTATUS_OLD _IOR('n',0xF9,__u32) | ||
| 190 | /* ioctl to enable/disable panning auto-maximize (like nomax parameter) */ | ||
| 191 | #define SISFB_GET_AUTOMAXIMIZE_OLD _IOR('n',0xFA,__u32) | ||
| 192 | #define SISFB_SET_AUTOMAXIMIZE_OLD _IOW('n',0xFA,__u32) | ||
| 193 | /****************************************************************/ | ||
| 194 | /* End of deprecated ioctl numbers */ | ||
| 195 | /****************************************************************/ | ||
| 196 | |||
| 197 | /* For fb memory manager (FBIO_ALLOC, FBIO_FREE) */ | ||
| 198 | struct sis_memreq { | ||
| 199 | __u32 offset; | ||
| 200 | __u32 size; | ||
| 201 | }; | ||
| 202 | |||
| 203 | /**********************************************/ | ||
| 204 | /* PRIVATE */ | ||
| 205 | /* (for IN-KERNEL usage only) */ | ||
| 206 | /**********************************************/ | ||
| 207 | |||
| 208 | #ifdef __KERNEL__ | ||
| 209 | 23 | ||
| 210 | #include <linux/pci.h> | 24 | #include <linux/pci.h> |
| 25 | #include <uapi/video/sisfb.h> | ||
| 211 | 26 | ||
| 212 | #define UNKNOWN_VGA 0 | 27 | #define UNKNOWN_VGA 0 |
| 213 | #define SIS_300_VGA 1 | 28 | #define SIS_300_VGA 1 |
| @@ -220,5 +35,3 @@ extern void sis_malloc_new(struct pci_dev *pdev, struct sis_memreq *req); | |||
| 220 | extern void sis_free(u32 base); | 35 | extern void sis_free(u32 base); |
| 221 | extern void sis_free_new(struct pci_dev *pdev, u32 base); | 36 | extern void sis_free_new(struct pci_dev *pdev, u32 base); |
| 222 | #endif | 37 | #endif |
| 223 | |||
| 224 | #endif | ||
diff --git a/include/video/uvesafb.h b/include/video/uvesafb.h index 0993a220a3e6..1a91850cb961 100644 --- a/include/video/uvesafb.h +++ b/include/video/uvesafb.h | |||
| @@ -1,63 +1,8 @@ | |||
| 1 | #ifndef _UVESAFB_H | 1 | #ifndef _UVESAFB_H |
| 2 | #define _UVESAFB_H | 2 | #define _UVESAFB_H |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <uapi/video/uvesafb.h> |
| 5 | |||
| 6 | struct v86_regs { | ||
| 7 | __u32 ebx; | ||
| 8 | __u32 ecx; | ||
| 9 | __u32 edx; | ||
| 10 | __u32 esi; | ||
| 11 | __u32 edi; | ||
| 12 | __u32 ebp; | ||
| 13 | __u32 eax; | ||
| 14 | __u32 eip; | ||
| 15 | __u32 eflags; | ||
| 16 | __u32 esp; | ||
| 17 | __u16 cs; | ||
| 18 | __u16 ss; | ||
| 19 | __u16 es; | ||
| 20 | __u16 ds; | ||
| 21 | __u16 fs; | ||
| 22 | __u16 gs; | ||
| 23 | }; | ||
| 24 | |||
| 25 | /* Task flags */ | ||
| 26 | #define TF_VBEIB 0x01 | ||
| 27 | #define TF_BUF_ESDI 0x02 | ||
| 28 | #define TF_BUF_ESBX 0x04 | ||
| 29 | #define TF_BUF_RET 0x08 | ||
| 30 | #define TF_EXIT 0x10 | ||
| 31 | |||
| 32 | struct uvesafb_task { | ||
| 33 | __u8 flags; | ||
| 34 | int buf_len; | ||
| 35 | struct v86_regs regs; | ||
| 36 | }; | ||
| 37 | |||
| 38 | /* Constants for the capabilities field | ||
| 39 | * in vbe_ib */ | ||
| 40 | #define VBE_CAP_CAN_SWITCH_DAC 0x01 | ||
| 41 | #define VBE_CAP_VGACOMPAT 0x02 | ||
| 42 | |||
| 43 | /* The VBE Info Block */ | ||
| 44 | struct vbe_ib { | ||
| 45 | char vbe_signature[4]; | ||
| 46 | __u16 vbe_version; | ||
| 47 | __u32 oem_string_ptr; | ||
| 48 | __u32 capabilities; | ||
| 49 | __u32 mode_list_ptr; | ||
| 50 | __u16 total_memory; | ||
| 51 | __u16 oem_software_rev; | ||
| 52 | __u32 oem_vendor_name_ptr; | ||
| 53 | __u32 oem_product_name_ptr; | ||
| 54 | __u32 oem_product_rev_ptr; | ||
| 55 | __u8 reserved[222]; | ||
| 56 | char oem_data[256]; | ||
| 57 | char misc_data[512]; | ||
| 58 | } __attribute__ ((packed)); | ||
| 59 | 5 | ||
| 60 | #ifdef __KERNEL__ | ||
| 61 | 6 | ||
| 62 | /* VBE CRTC Info Block */ | 7 | /* VBE CRTC Info Block */ |
| 63 | struct vbe_crtc_ib { | 8 | struct vbe_crtc_ib { |
| @@ -191,5 +136,4 @@ struct uvesafb_par { | |||
| 191 | struct vbe_crtc_ib crtc; | 136 | struct vbe_crtc_ib crtc; |
| 192 | }; | 137 | }; |
| 193 | 138 | ||
| 194 | #endif /* __KERNEL__ */ | ||
| 195 | #endif /* _UVESAFB_H */ | 139 | #endif /* _UVESAFB_H */ |
diff --git a/include/video/videomode.h b/include/video/videomode.h new file mode 100644 index 000000000000..a42156234dd4 --- /dev/null +++ b/include/video/videomode.h | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2012 Steffen Trumtrar <s.trumtrar@pengutronix.de> | ||
| 3 | * | ||
| 4 | * generic videomode description | ||
| 5 | * | ||
| 6 | * This file is released under the GPLv2 | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef __LINUX_VIDEOMODE_H | ||
| 10 | #define __LINUX_VIDEOMODE_H | ||
| 11 | |||
| 12 | #include <linux/types.h> | ||
| 13 | #include <video/display_timing.h> | ||
| 14 | |||
| 15 | /* | ||
| 16 | * Subsystem independent description of a videomode. | ||
| 17 | * Can be generated from struct display_timing. | ||
| 18 | */ | ||
| 19 | struct videomode { | ||
| 20 | unsigned long pixelclock; /* pixelclock in Hz */ | ||
| 21 | |||
| 22 | u32 hactive; | ||
| 23 | u32 hfront_porch; | ||
| 24 | u32 hback_porch; | ||
| 25 | u32 hsync_len; | ||
| 26 | |||
| 27 | u32 vactive; | ||
| 28 | u32 vfront_porch; | ||
| 29 | u32 vback_porch; | ||
| 30 | u32 vsync_len; | ||
| 31 | |||
| 32 | unsigned int dmt_flags; /* VESA DMT flags */ | ||
| 33 | unsigned int data_flags; /* video data flags */ | ||
| 34 | }; | ||
| 35 | |||
| 36 | /** | ||
| 37 | * videomode_from_timing - convert display timing to videomode | ||
| 38 | * @disp: structure with all possible timing entries | ||
| 39 | * @vm: return value | ||
| 40 | * @index: index into the list of display timings in devicetree | ||
| 41 | * | ||
| 42 | * DESCRIPTION: | ||
| 43 | * This function converts a struct display_timing to a struct videomode. | ||
| 44 | */ | ||
| 45 | int videomode_from_timing(const struct display_timings *disp, | ||
| 46 | struct videomode *vm, unsigned int index); | ||
| 47 | |||
| 48 | #endif | ||
diff --git a/include/xen/acpi.h b/include/xen/acpi.h index 48a9c0171b65..68d73d09b770 100644 --- a/include/xen/acpi.h +++ b/include/xen/acpi.h | |||
| @@ -40,6 +40,41 @@ | |||
| 40 | #include <xen/xen.h> | 40 | #include <xen/xen.h> |
| 41 | #include <linux/acpi.h> | 41 | #include <linux/acpi.h> |
| 42 | 42 | ||
| 43 | #define ACPI_MEMORY_DEVICE_CLASS "memory" | ||
| 44 | #define ACPI_MEMORY_DEVICE_HID "PNP0C80" | ||
| 45 | #define ACPI_MEMORY_DEVICE_NAME "Hotplug Mem Device" | ||
| 46 | |||
| 47 | int xen_stub_memory_device_init(void); | ||
| 48 | void xen_stub_memory_device_exit(void); | ||
| 49 | |||
| 50 | #define ACPI_PROCESSOR_CLASS "processor" | ||
| 51 | #define ACPI_PROCESSOR_DEVICE_HID "ACPI0007" | ||
| 52 | #define ACPI_PROCESSOR_DEVICE_NAME "Processor" | ||
| 53 | |||
| 54 | int xen_stub_processor_init(void); | ||
| 55 | void xen_stub_processor_exit(void); | ||
| 56 | |||
| 57 | void xen_pcpu_hotplug_sync(void); | ||
| 58 | int xen_pcpu_id(uint32_t acpi_id); | ||
| 59 | |||
| 60 | static inline int xen_acpi_get_pxm(acpi_handle h) | ||
| 61 | { | ||
| 62 | unsigned long long pxm; | ||
| 63 | acpi_status status; | ||
| 64 | acpi_handle handle; | ||
| 65 | acpi_handle phandle = h; | ||
| 66 | |||
| 67 | do { | ||
| 68 | handle = phandle; | ||
| 69 | status = acpi_evaluate_integer(handle, "_PXM", NULL, &pxm); | ||
| 70 | if (ACPI_SUCCESS(status)) | ||
| 71 | return pxm; | ||
| 72 | status = acpi_get_parent(handle, &phandle); | ||
| 73 | } while (ACPI_SUCCESS(status)); | ||
| 74 | |||
| 75 | return -ENXIO; | ||
| 76 | } | ||
| 77 | |||
| 43 | int xen_acpi_notify_hypervisor_state(u8 sleep_state, | 78 | int xen_acpi_notify_hypervisor_state(u8 sleep_state, |
| 44 | u32 pm1a_cnt, u32 pm1b_cnd); | 79 | u32 pm1a_cnt, u32 pm1b_cnd); |
| 45 | 80 | ||
diff --git a/include/xen/interface/memory.h b/include/xen/interface/memory.h index b40a4315cb8b..2ecfe4f700d9 100644 --- a/include/xen/interface/memory.h +++ b/include/xen/interface/memory.h | |||
| @@ -190,6 +190,7 @@ DEFINE_GUEST_HANDLE_STRUCT(xen_add_to_physmap); | |||
| 190 | 190 | ||
| 191 | #define XENMEM_add_to_physmap_range 23 | 191 | #define XENMEM_add_to_physmap_range 23 |
| 192 | struct xen_add_to_physmap_range { | 192 | struct xen_add_to_physmap_range { |
| 193 | /* IN */ | ||
| 193 | /* Which domain to change the mapping for. */ | 194 | /* Which domain to change the mapping for. */ |
| 194 | domid_t domid; | 195 | domid_t domid; |
| 195 | uint16_t space; /* => enum phys_map_space */ | 196 | uint16_t space; /* => enum phys_map_space */ |
| @@ -203,6 +204,11 @@ struct xen_add_to_physmap_range { | |||
| 203 | 204 | ||
| 204 | /* GPFN in domid where the source mapping page should appear. */ | 205 | /* GPFN in domid where the source mapping page should appear. */ |
| 205 | GUEST_HANDLE(xen_pfn_t) gpfns; | 206 | GUEST_HANDLE(xen_pfn_t) gpfns; |
| 207 | |||
| 208 | /* OUT */ | ||
| 209 | |||
| 210 | /* Per index error code. */ | ||
| 211 | GUEST_HANDLE(int) errs; | ||
| 206 | }; | 212 | }; |
| 207 | DEFINE_GUEST_HANDLE_STRUCT(xen_add_to_physmap_range); | 213 | DEFINE_GUEST_HANDLE_STRUCT(xen_add_to_physmap_range); |
| 208 | 214 | ||
diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h index 5e36932ab407..c57d5f67f702 100644 --- a/include/xen/interface/platform.h +++ b/include/xen/interface/platform.h | |||
| @@ -324,10 +324,21 @@ struct xenpf_cpu_ol { | |||
| 324 | }; | 324 | }; |
| 325 | DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol); | 325 | DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol); |
| 326 | 326 | ||
| 327 | /* | 327 | #define XENPF_cpu_hotadd 58 |
| 328 | * CMD 58 and 59 are reserved for cpu hotadd and memory hotadd, | 328 | struct xenpf_cpu_hotadd { |
| 329 | * which are already occupied at Xen hypervisor side. | 329 | uint32_t apic_id; |
| 330 | */ | 330 | uint32_t acpi_id; |
| 331 | uint32_t pxm; | ||
| 332 | }; | ||
| 333 | |||
| 334 | #define XENPF_mem_hotadd 59 | ||
| 335 | struct xenpf_mem_hotadd { | ||
| 336 | uint64_t spfn; | ||
| 337 | uint64_t epfn; | ||
| 338 | uint32_t pxm; | ||
| 339 | uint32_t flags; | ||
| 340 | }; | ||
| 341 | |||
| 331 | #define XENPF_core_parking 60 | 342 | #define XENPF_core_parking 60 |
| 332 | struct xenpf_core_parking { | 343 | struct xenpf_core_parking { |
| 333 | /* IN variables */ | 344 | /* IN variables */ |
| @@ -357,6 +368,8 @@ struct xen_platform_op { | |||
| 357 | struct xenpf_set_processor_pminfo set_pminfo; | 368 | struct xenpf_set_processor_pminfo set_pminfo; |
| 358 | struct xenpf_pcpuinfo pcpu_info; | 369 | struct xenpf_pcpuinfo pcpu_info; |
| 359 | struct xenpf_cpu_ol cpu_ol; | 370 | struct xenpf_cpu_ol cpu_ol; |
| 371 | struct xenpf_cpu_hotadd cpu_add; | ||
| 372 | struct xenpf_mem_hotadd mem_add; | ||
| 360 | struct xenpf_core_parking core_parking; | 373 | struct xenpf_core_parking core_parking; |
| 361 | uint8_t pad[128]; | 374 | uint8_t pad[128]; |
| 362 | } u; | 375 | } u; |
diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h index 886a5d80a18f..53ec4167bd0b 100644 --- a/include/xen/interface/xen.h +++ b/include/xen/interface/xen.h | |||
| @@ -285,7 +285,7 @@ DEFINE_GUEST_HANDLE_STRUCT(multicall_entry); | |||
| 285 | * Event channel endpoints per domain: | 285 | * Event channel endpoints per domain: |
| 286 | * 1024 if a long is 32 bits; 4096 if a long is 64 bits. | 286 | * 1024 if a long is 32 bits; 4096 if a long is 64 bits. |
| 287 | */ | 287 | */ |
| 288 | #define NR_EVENT_CHANNELS (sizeof(unsigned long) * sizeof(unsigned long) * 64) | 288 | #define NR_EVENT_CHANNELS (sizeof(xen_ulong_t) * sizeof(xen_ulong_t) * 64) |
| 289 | 289 | ||
| 290 | struct vcpu_time_info { | 290 | struct vcpu_time_info { |
| 291 | /* | 291 | /* |
| @@ -341,7 +341,7 @@ struct vcpu_info { | |||
| 341 | */ | 341 | */ |
| 342 | uint8_t evtchn_upcall_pending; | 342 | uint8_t evtchn_upcall_pending; |
| 343 | uint8_t evtchn_upcall_mask; | 343 | uint8_t evtchn_upcall_mask; |
| 344 | unsigned long evtchn_pending_sel; | 344 | xen_ulong_t evtchn_pending_sel; |
| 345 | struct arch_vcpu_info arch; | 345 | struct arch_vcpu_info arch; |
| 346 | struct pvclock_vcpu_time_info time; | 346 | struct pvclock_vcpu_time_info time; |
| 347 | }; /* 64 bytes (x86) */ | 347 | }; /* 64 bytes (x86) */ |
| @@ -384,8 +384,8 @@ struct shared_info { | |||
| 384 | * per-vcpu selector word to be set. Each bit in the selector covers a | 384 | * per-vcpu selector word to be set. Each bit in the selector covers a |
| 385 | * 'C long' in the PENDING bitfield array. | 385 | * 'C long' in the PENDING bitfield array. |
| 386 | */ | 386 | */ |
| 387 | unsigned long evtchn_pending[sizeof(unsigned long) * 8]; | 387 | xen_ulong_t evtchn_pending[sizeof(xen_ulong_t) * 8]; |
| 388 | unsigned long evtchn_mask[sizeof(unsigned long) * 8]; | 388 | xen_ulong_t evtchn_mask[sizeof(xen_ulong_t) * 8]; |
| 389 | 389 | ||
| 390 | /* | 390 | /* |
| 391 | * Wallclock time: updated only by control software. Guests should base | 391 | * Wallclock time: updated only by control software. Guests should base |
