diff options
Diffstat (limited to 'include/linux')
129 files changed, 2142 insertions, 1027 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index f46cfd73a553..bcbdd7484e58 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -485,14 +485,6 @@ static inline bool acpi_driver_match_device(struct device *dev, | |||
| 485 | 485 | ||
| 486 | #endif /* !CONFIG_ACPI */ | 486 | #endif /* !CONFIG_ACPI */ |
| 487 | 487 | ||
| 488 | #ifdef CONFIG_ACPI_NUMA | ||
| 489 | void __init early_parse_srat(void); | ||
| 490 | #else | ||
| 491 | static inline void early_parse_srat(void) | ||
| 492 | { | ||
| 493 | } | ||
| 494 | #endif | ||
| 495 | |||
| 496 | #ifdef CONFIG_ACPI | 488 | #ifdef CONFIG_ACPI |
| 497 | void acpi_os_set_prepare_sleep(int (*func)(u8 sleep_state, | 489 | void acpi_os_set_prepare_sleep(int (*func)(u8 sleep_state, |
| 498 | u32 pm1a_ctrl, u32 pm1b_ctrl)); | 490 | u32 pm1a_ctrl, u32 pm1b_ctrl)); |
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/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/compat.h b/include/linux/compat.h index de095b0462a7..76a87fb57ac2 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
| @@ -359,6 +359,7 @@ asmlinkage ssize_t compat_sys_preadv(unsigned long fd, | |||
| 359 | asmlinkage ssize_t compat_sys_pwritev(unsigned long fd, | 359 | asmlinkage ssize_t compat_sys_pwritev(unsigned long fd, |
| 360 | const struct compat_iovec __user *vec, | 360 | const struct compat_iovec __user *vec, |
| 361 | 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); | ||
| 362 | 363 | ||
| 363 | 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, |
| 364 | const compat_uptr_t __user *envp); | 365 | const compat_uptr_t __user *envp); |
| @@ -535,6 +536,8 @@ asmlinkage long compat_sys_openat(int dfd, const char __user *filename, | |||
| 535 | asmlinkage long compat_sys_open_by_handle_at(int mountdirfd, | 536 | asmlinkage long compat_sys_open_by_handle_at(int mountdirfd, |
| 536 | struct file_handle __user *handle, | 537 | struct file_handle __user *handle, |
| 537 | 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); | ||
| 538 | 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, |
| 539 | compat_ulong_t __user *outp, | 542 | compat_ulong_t __user *outp, |
| 540 | compat_ulong_t __user *exp, | 543 | compat_ulong_t __user *exp, |
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/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/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/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/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/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/hugetlb.h b/include/linux/hugetlb.h index eedc334fb6f5..16e4e9a643fb 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
| @@ -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 e5eb125effe6..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 |
| @@ -141,7 +183,6 @@ struct ida { | |||
| 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/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/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 3e5ecb2d790e..f388203db7e8 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h | |||
| @@ -42,7 +42,6 @@ struct memblock { | |||
| 42 | 42 | ||
| 43 | extern struct memblock memblock; | 43 | extern struct memblock memblock; |
| 44 | extern int memblock_debug; | 44 | extern int memblock_debug; |
| 45 | extern struct movablemem_map movablemem_map; | ||
| 46 | 45 | ||
| 47 | #define memblock_dbg(fmt, ...) \ | 46 | #define memblock_dbg(fmt, ...) \ |
| 48 | if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | 47 | if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) |
| @@ -61,7 +60,6 @@ int memblock_reserve(phys_addr_t base, phys_addr_t size); | |||
| 61 | void memblock_trim_memory(phys_addr_t align); | 60 | void memblock_trim_memory(phys_addr_t align); |
| 62 | 61 | ||
| 63 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP | 62 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP |
| 64 | |||
| 65 | void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn, | 63 | void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn, |
| 66 | unsigned long *out_end_pfn, int *out_nid); | 64 | unsigned long *out_end_pfn, int *out_nid); |
| 67 | 65 | ||
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/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 e7c3f9a0111a..7acc9dc73c9f 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -115,6 +115,8 @@ extern unsigned int kobjsize(const void *objp); | |||
| 115 | # define VM_SAO VM_ARCH_1 /* Strong Access Ordering (powerpc) */ | 115 | # define VM_SAO VM_ARCH_1 /* Strong Access Ordering (powerpc) */ |
| 116 | #elif defined(CONFIG_PARISC) | 116 | #elif defined(CONFIG_PARISC) |
| 117 | # 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 | ||
| 118 | #elif defined(CONFIG_IA64) | 120 | #elif defined(CONFIG_IA64) |
| 119 | # define VM_GROWSUP VM_ARCH_1 | 121 | # define VM_GROWSUP VM_ARCH_1 |
| 120 | #elif !defined(CONFIG_MMU) | 122 | #elif !defined(CONFIG_MMU) |
| @@ -1333,24 +1335,6 @@ extern void free_bootmem_with_active_regions(int nid, | |||
| 1333 | unsigned long max_low_pfn); | 1335 | unsigned long max_low_pfn); |
| 1334 | extern void sparse_memory_present_with_active_regions(int nid); | 1336 | extern void sparse_memory_present_with_active_regions(int nid); |
| 1335 | 1337 | ||
| 1336 | #define MOVABLEMEM_MAP_MAX MAX_NUMNODES | ||
| 1337 | struct movablemem_entry { | ||
| 1338 | unsigned long start_pfn; /* start pfn of memory segment */ | ||
| 1339 | unsigned long end_pfn; /* end pfn of memory segment (exclusive) */ | ||
| 1340 | }; | ||
| 1341 | |||
| 1342 | struct movablemem_map { | ||
| 1343 | bool acpi; /* true if using SRAT info */ | ||
| 1344 | int nr_map; | ||
| 1345 | struct movablemem_entry map[MOVABLEMEM_MAP_MAX]; | ||
| 1346 | nodemask_t numa_nodes_hotplug; /* on which nodes we specify memory */ | ||
| 1347 | nodemask_t numa_nodes_kernel; /* on which nodes kernel resides in */ | ||
| 1348 | }; | ||
| 1349 | |||
| 1350 | extern void __init insert_movablemem_map(unsigned long start_pfn, | ||
| 1351 | unsigned long end_pfn); | ||
| 1352 | extern int __init movablemem_map_overlap(unsigned long start_pfn, | ||
| 1353 | unsigned long end_pfn); | ||
| 1354 | #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ | 1338 | #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ |
| 1355 | 1339 | ||
| 1356 | #if !defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) && \ | 1340 | #if !defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) && \ |
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/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/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/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/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/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 0655570c67eb..d35d2b6ddbfb 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -99,7 +99,6 @@ extern int nr_threads; | |||
| 99 | DECLARE_PER_CPU(unsigned long, process_counts); | 99 | DECLARE_PER_CPU(unsigned long, process_counts); |
| 100 | extern int nr_processes(void); | 100 | extern int nr_processes(void); |
| 101 | extern unsigned long nr_running(void); | 101 | extern unsigned long nr_running(void); |
| 102 | extern unsigned long nr_uninterruptible(void); | ||
| 103 | extern unsigned long nr_iowait(void); | 102 | extern unsigned long nr_iowait(void); |
| 104 | extern unsigned long nr_iowait_cpu(int cpu); | 103 | extern unsigned long nr_iowait_cpu(int cpu); |
| 105 | extern unsigned long this_cpu_load(void); | 104 | extern unsigned long this_cpu_load(void); |
| @@ -347,11 +346,6 @@ static inline void arch_pick_mmap_layout(struct mm_struct *mm) {} | |||
| 347 | extern void set_dumpable(struct mm_struct *mm, int value); | 346 | extern void set_dumpable(struct mm_struct *mm, int value); |
| 348 | extern int get_dumpable(struct mm_struct *mm); | 347 | extern int get_dumpable(struct mm_struct *mm); |
| 349 | 348 | ||
| 350 | /* get/set_dumpable() values */ | ||
| 351 | #define SUID_DUMPABLE_DISABLED 0 | ||
| 352 | #define SUID_DUMPABLE_ENABLED 1 | ||
| 353 | #define SUID_DUMPABLE_SAFE 2 | ||
| 354 | |||
| 355 | /* mm flags */ | 349 | /* mm flags */ |
| 356 | /* dumpable bits */ | 350 | /* dumpable bits */ |
| 357 | #define MMF_DUMPABLE 0 /* core dump is permitted */ | 351 | #define MMF_DUMPABLE 0 /* core dump is permitted */ |
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/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/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); |
