diff options
author | Sage Weil <sage@inktank.com> | 2013-08-15 14:11:45 -0400 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-08-15 14:11:45 -0400 |
commit | ee3e542fec6e69bc9fb668698889a37d93950ddf (patch) | |
tree | e74ee766a4764769ef1d3d45d266b4dea64101d3 /include/linux | |
parent | fe2a801b50c0bb8039d627e5ae1fec249d10ff39 (diff) | |
parent | f1d6e17f540af37bb1891480143669ba7636c4cf (diff) |
Merge remote-tracking branch 'linus/master' into testing
Diffstat (limited to 'include/linux')
290 files changed, 7805 insertions, 1802 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 17b5b5967641..353ba256f368 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -352,8 +352,7 @@ extern acpi_status acpi_pci_osc_control_set(acpi_handle handle, | |||
352 | 352 | ||
353 | /* Enable _OST when all relevant hotplug operations are enabled */ | 353 | /* Enable _OST when all relevant hotplug operations are enabled */ |
354 | #if defined(CONFIG_ACPI_HOTPLUG_CPU) && \ | 354 | #if defined(CONFIG_ACPI_HOTPLUG_CPU) && \ |
355 | (defined(CONFIG_ACPI_HOTPLUG_MEMORY) || \ | 355 | defined(CONFIG_ACPI_HOTPLUG_MEMORY) && \ |
356 | defined(CONFIG_ACPI_HOTPLUG_MEMORY_MODULE)) && \ | ||
357 | defined(CONFIG_ACPI_CONTAINER) | 356 | defined(CONFIG_ACPI_CONTAINER) |
358 | #define ACPI_HOTPLUG_OST | 357 | #define ACPI_HOTPLUG_OST |
359 | #endif | 358 | #endif |
diff --git a/include/linux/aer.h b/include/linux/aer.h index 737f90ab4b62..4dbaa7081530 100644 --- a/include/linux/aer.h +++ b/include/linux/aer.h | |||
@@ -7,6 +7,10 @@ | |||
7 | #ifndef _AER_H_ | 7 | #ifndef _AER_H_ |
8 | #define _AER_H_ | 8 | #define _AER_H_ |
9 | 9 | ||
10 | #define AER_NONFATAL 0 | ||
11 | #define AER_FATAL 1 | ||
12 | #define AER_CORRECTABLE 2 | ||
13 | |||
10 | struct aer_header_log_regs { | 14 | struct aer_header_log_regs { |
11 | unsigned int dw0; | 15 | unsigned int dw0; |
12 | unsigned int dw1; | 16 | unsigned int dw1; |
@@ -31,9 +35,9 @@ struct aer_capability_regs { | |||
31 | 35 | ||
32 | #if defined(CONFIG_PCIEAER) | 36 | #if defined(CONFIG_PCIEAER) |
33 | /* pci-e port driver needs this function to enable aer */ | 37 | /* pci-e port driver needs this function to enable aer */ |
34 | extern int pci_enable_pcie_error_reporting(struct pci_dev *dev); | 38 | int pci_enable_pcie_error_reporting(struct pci_dev *dev); |
35 | extern int pci_disable_pcie_error_reporting(struct pci_dev *dev); | 39 | int pci_disable_pcie_error_reporting(struct pci_dev *dev); |
36 | extern int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev); | 40 | int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev); |
37 | #else | 41 | #else |
38 | static inline int pci_enable_pcie_error_reporting(struct pci_dev *dev) | 42 | static inline int pci_enable_pcie_error_reporting(struct pci_dev *dev) |
39 | { | 43 | { |
@@ -49,11 +53,11 @@ static inline int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev) | |||
49 | } | 53 | } |
50 | #endif | 54 | #endif |
51 | 55 | ||
52 | extern void cper_print_aer(struct pci_dev *dev, | 56 | void cper_print_aer(struct pci_dev *dev, int cper_severity, |
53 | int cper_severity, struct aer_capability_regs *aer); | 57 | struct aer_capability_regs *aer); |
54 | extern int cper_severity_to_aer(int cper_severity); | 58 | int cper_severity_to_aer(int cper_severity); |
55 | extern void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn, | 59 | void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn, |
56 | int severity, | 60 | int severity, |
57 | struct aer_capability_regs *aer_regs); | 61 | struct aer_capability_regs *aer_regs); |
58 | #endif //_AER_H_ | 62 | #endif //_AER_H_ |
59 | 63 | ||
diff --git a/include/linux/alarmtimer.h b/include/linux/alarmtimer.h index 9069694e70eb..a899402a5a0e 100644 --- a/include/linux/alarmtimer.h +++ b/include/linux/alarmtimer.h | |||
@@ -44,10 +44,14 @@ struct alarm { | |||
44 | void alarm_init(struct alarm *alarm, enum alarmtimer_type type, | 44 | void alarm_init(struct alarm *alarm, enum alarmtimer_type type, |
45 | enum alarmtimer_restart (*function)(struct alarm *, ktime_t)); | 45 | enum alarmtimer_restart (*function)(struct alarm *, ktime_t)); |
46 | int alarm_start(struct alarm *alarm, ktime_t start); | 46 | int alarm_start(struct alarm *alarm, ktime_t start); |
47 | int alarm_start_relative(struct alarm *alarm, ktime_t start); | ||
48 | void alarm_restart(struct alarm *alarm); | ||
47 | int alarm_try_to_cancel(struct alarm *alarm); | 49 | int alarm_try_to_cancel(struct alarm *alarm); |
48 | int alarm_cancel(struct alarm *alarm); | 50 | int alarm_cancel(struct alarm *alarm); |
49 | 51 | ||
50 | u64 alarm_forward(struct alarm *alarm, ktime_t now, ktime_t interval); | 52 | u64 alarm_forward(struct alarm *alarm, ktime_t now, ktime_t interval); |
53 | u64 alarm_forward_now(struct alarm *alarm, ktime_t interval); | ||
54 | ktime_t alarm_expires_remaining(const struct alarm *alarm); | ||
51 | 55 | ||
52 | /* Provide way to access the rtc device being used by alarmtimers */ | 56 | /* Provide way to access the rtc device being used by alarmtimers */ |
53 | struct rtc_device *alarmtimer_get_rtcdev(void); | 57 | struct rtc_device *alarmtimer_get_rtcdev(void); |
diff --git a/include/linux/amba/pl08x.h b/include/linux/amba/pl08x.h index 2a5f64a11b77..10fe2a211c2e 100644 --- a/include/linux/amba/pl08x.h +++ b/include/linux/amba/pl08x.h | |||
@@ -76,11 +76,11 @@ struct pl08x_channel_data { | |||
76 | * platform, all inclusive, including multiplexed channels. The available | 76 | * platform, all inclusive, including multiplexed channels. The available |
77 | * physical channels will be multiplexed around these signals as they are | 77 | * physical channels will be multiplexed around these signals as they are |
78 | * requested, just enumerate all possible channels. | 78 | * requested, just enumerate all possible channels. |
79 | * @get_signal: request a physical signal to be used for a DMA transfer | 79 | * @get_xfer_signal: request a physical signal to be used for a DMA transfer |
80 | * immediately: if there is some multiplexing or similar blocking the use | 80 | * immediately: if there is some multiplexing or similar blocking the use |
81 | * of the channel the transfer can be denied by returning less than zero, | 81 | * of the channel the transfer can be denied by returning less than zero, |
82 | * else it returns the allocated signal number | 82 | * else it returns the allocated signal number |
83 | * @put_signal: indicate to the platform that this physical signal is not | 83 | * @put_xfer_signal: indicate to the platform that this physical signal is not |
84 | * running any DMA transfer and multiplexing can be recycled | 84 | * running any DMA transfer and multiplexing can be recycled |
85 | * @lli_buses: buses which LLIs can be fetched from: PL08X_AHB1 | PL08X_AHB2 | 85 | * @lli_buses: buses which LLIs can be fetched from: PL08X_AHB1 | PL08X_AHB2 |
86 | * @mem_buses: buses which memory can be accessed from: PL08X_AHB1 | PL08X_AHB2 | 86 | * @mem_buses: buses which memory can be accessed from: PL08X_AHB1 | PL08X_AHB2 |
@@ -89,8 +89,8 @@ struct pl08x_platform_data { | |||
89 | const struct pl08x_channel_data *slave_channels; | 89 | const struct pl08x_channel_data *slave_channels; |
90 | unsigned int num_slave_channels; | 90 | unsigned int num_slave_channels; |
91 | struct pl08x_channel_data memcpy_channel; | 91 | struct pl08x_channel_data memcpy_channel; |
92 | int (*get_signal)(const struct pl08x_channel_data *); | 92 | int (*get_xfer_signal)(const struct pl08x_channel_data *); |
93 | void (*put_signal)(const struct pl08x_channel_data *, int); | 93 | void (*put_xfer_signal)(const struct pl08x_channel_data *, int); |
94 | u8 lli_buses; | 94 | u8 lli_buses; |
95 | u8 mem_buses; | 95 | u8 mem_buses; |
96 | }; | 96 | }; |
diff --git a/include/linux/arm-cci.h b/include/linux/arm-cci.h new file mode 100644 index 000000000000..79d6edf446d5 --- /dev/null +++ b/include/linux/arm-cci.h | |||
@@ -0,0 +1,61 @@ | |||
1 | /* | ||
2 | * CCI cache coherent interconnect support | ||
3 | * | ||
4 | * Copyright (C) 2013 ARM Ltd. | ||
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 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | |||
21 | #ifndef __LINUX_ARM_CCI_H | ||
22 | #define __LINUX_ARM_CCI_H | ||
23 | |||
24 | #include <linux/errno.h> | ||
25 | #include <linux/types.h> | ||
26 | |||
27 | struct device_node; | ||
28 | |||
29 | #ifdef CONFIG_ARM_CCI | ||
30 | extern bool cci_probed(void); | ||
31 | extern int cci_ace_get_port(struct device_node *dn); | ||
32 | extern int cci_disable_port_by_cpu(u64 mpidr); | ||
33 | extern int __cci_control_port_by_device(struct device_node *dn, bool enable); | ||
34 | extern int __cci_control_port_by_index(u32 port, bool enable); | ||
35 | #else | ||
36 | static inline bool cci_probed(void) { return false; } | ||
37 | static inline int cci_ace_get_port(struct device_node *dn) | ||
38 | { | ||
39 | return -ENODEV; | ||
40 | } | ||
41 | static inline int cci_disable_port_by_cpu(u64 mpidr) { return -ENODEV; } | ||
42 | static inline int __cci_control_port_by_device(struct device_node *dn, | ||
43 | bool enable) | ||
44 | { | ||
45 | return -ENODEV; | ||
46 | } | ||
47 | static inline int __cci_control_port_by_index(u32 port, bool enable) | ||
48 | { | ||
49 | return -ENODEV; | ||
50 | } | ||
51 | #endif | ||
52 | #define cci_disable_port_by_device(dev) \ | ||
53 | __cci_control_port_by_device(dev, false) | ||
54 | #define cci_enable_port_by_device(dev) \ | ||
55 | __cci_control_port_by_device(dev, true) | ||
56 | #define cci_disable_port_by_index(dev) \ | ||
57 | __cci_control_port_by_index(dev, false) | ||
58 | #define cci_enable_port_by_index(dev) \ | ||
59 | __cci_control_port_by_index(dev, true) | ||
60 | |||
61 | #endif | ||
diff --git a/include/linux/async_tx.h b/include/linux/async_tx.h index a1c486a88e88..179b38ffd351 100644 --- a/include/linux/async_tx.h +++ b/include/linux/async_tx.h | |||
@@ -182,10 +182,6 @@ async_memcpy(struct page *dest, struct page *src, unsigned int dest_offset, | |||
182 | unsigned int src_offset, size_t len, | 182 | unsigned int src_offset, size_t len, |
183 | struct async_submit_ctl *submit); | 183 | struct async_submit_ctl *submit); |
184 | 184 | ||
185 | struct dma_async_tx_descriptor * | ||
186 | async_memset(struct page *dest, int val, unsigned int offset, | ||
187 | size_t len, struct async_submit_ctl *submit); | ||
188 | |||
189 | struct dma_async_tx_descriptor *async_trigger_callback(struct async_submit_ctl *submit); | 185 | struct dma_async_tx_descriptor *async_trigger_callback(struct async_submit_ctl *submit); |
190 | 186 | ||
191 | struct dma_async_tx_descriptor * | 187 | struct dma_async_tx_descriptor * |
diff --git a/include/linux/audit.h b/include/linux/audit.h index b20b03852f21..729a4d165bcc 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -103,8 +103,11 @@ extern void __audit_syscall_exit(int ret_success, long ret_value); | |||
103 | extern struct filename *__audit_reusename(const __user char *uptr); | 103 | extern struct filename *__audit_reusename(const __user char *uptr); |
104 | extern void __audit_getname(struct filename *name); | 104 | extern void __audit_getname(struct filename *name); |
105 | extern void audit_putname(struct filename *name); | 105 | extern void audit_putname(struct filename *name); |
106 | |||
107 | #define AUDIT_INODE_PARENT 1 /* dentry represents the parent */ | ||
108 | #define AUDIT_INODE_HIDDEN 2 /* audit record should be hidden */ | ||
106 | extern void __audit_inode(struct filename *name, const struct dentry *dentry, | 109 | extern void __audit_inode(struct filename *name, const struct dentry *dentry, |
107 | unsigned int parent); | 110 | unsigned int flags); |
108 | extern void __audit_inode_child(const struct inode *parent, | 111 | extern void __audit_inode_child(const struct inode *parent, |
109 | const struct dentry *dentry, | 112 | const struct dentry *dentry, |
110 | const unsigned char type); | 113 | const unsigned char type); |
@@ -148,10 +151,22 @@ static inline void audit_getname(struct filename *name) | |||
148 | if (unlikely(!audit_dummy_context())) | 151 | if (unlikely(!audit_dummy_context())) |
149 | __audit_getname(name); | 152 | __audit_getname(name); |
150 | } | 153 | } |
151 | static inline void audit_inode(struct filename *name, const struct dentry *dentry, | 154 | static inline void audit_inode(struct filename *name, |
155 | const struct dentry *dentry, | ||
152 | unsigned int parent) { | 156 | unsigned int parent) { |
157 | if (unlikely(!audit_dummy_context())) { | ||
158 | unsigned int flags = 0; | ||
159 | if (parent) | ||
160 | flags |= AUDIT_INODE_PARENT; | ||
161 | __audit_inode(name, dentry, flags); | ||
162 | } | ||
163 | } | ||
164 | static inline void audit_inode_parent_hidden(struct filename *name, | ||
165 | const struct dentry *dentry) | ||
166 | { | ||
153 | if (unlikely(!audit_dummy_context())) | 167 | if (unlikely(!audit_dummy_context())) |
154 | __audit_inode(name, dentry, parent); | 168 | __audit_inode(name, dentry, |
169 | AUDIT_INODE_PARENT | AUDIT_INODE_HIDDEN); | ||
155 | } | 170 | } |
156 | static inline void audit_inode_child(const struct inode *parent, | 171 | static inline void audit_inode_child(const struct inode *parent, |
157 | const struct dentry *dentry, | 172 | const struct dentry *dentry, |
@@ -311,7 +326,7 @@ static inline void audit_putname(struct filename *name) | |||
311 | { } | 326 | { } |
312 | static inline void __audit_inode(struct filename *name, | 327 | static inline void __audit_inode(struct filename *name, |
313 | const struct dentry *dentry, | 328 | const struct dentry *dentry, |
314 | unsigned int parent) | 329 | unsigned int flags) |
315 | { } | 330 | { } |
316 | static inline void __audit_inode_child(const struct inode *parent, | 331 | static inline void __audit_inode_child(const struct inode *parent, |
317 | const struct dentry *dentry, | 332 | const struct dentry *dentry, |
@@ -321,6 +336,9 @@ static inline void audit_inode(struct filename *name, | |||
321 | const struct dentry *dentry, | 336 | const struct dentry *dentry, |
322 | unsigned int parent) | 337 | unsigned int parent) |
323 | { } | 338 | { } |
339 | static inline void audit_inode_parent_hidden(struct filename *name, | ||
340 | const struct dentry *dentry) | ||
341 | { } | ||
324 | static inline void audit_inode_child(const struct inode *parent, | 342 | static inline void audit_inode_child(const struct inode *parent, |
325 | const struct dentry *dentry, | 343 | const struct dentry *dentry, |
326 | const unsigned char type) | 344 | const unsigned char type) |
diff --git a/include/linux/backlight.h b/include/linux/backlight.h index da9a0825e007..53b77949c79d 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h | |||
@@ -114,7 +114,13 @@ static inline void backlight_update_status(struct backlight_device *bd) | |||
114 | extern struct backlight_device *backlight_device_register(const char *name, | 114 | extern struct backlight_device *backlight_device_register(const char *name, |
115 | struct device *dev, void *devdata, const struct backlight_ops *ops, | 115 | struct device *dev, void *devdata, const struct backlight_ops *ops, |
116 | const struct backlight_properties *props); | 116 | const struct backlight_properties *props); |
117 | extern struct backlight_device *devm_backlight_device_register( | ||
118 | struct device *dev, const char *name, struct device *parent, | ||
119 | void *devdata, const struct backlight_ops *ops, | ||
120 | const struct backlight_properties *props); | ||
117 | extern void backlight_device_unregister(struct backlight_device *bd); | 121 | extern void backlight_device_unregister(struct backlight_device *bd); |
122 | extern void devm_backlight_device_unregister(struct device *dev, | ||
123 | struct backlight_device *bd); | ||
118 | extern void backlight_force_update(struct backlight_device *bd, | 124 | extern void backlight_force_update(struct backlight_device *bd, |
119 | enum backlight_update_reason reason); | 125 | enum backlight_update_reason reason); |
120 | 126 | ||
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h index 2e34db82a643..622fc505d3e1 100644 --- a/include/linux/bcma/bcma.h +++ b/include/linux/bcma/bcma.h | |||
@@ -144,6 +144,7 @@ struct bcma_host_ops { | |||
144 | 144 | ||
145 | /* Chip IDs of PCIe devices */ | 145 | /* Chip IDs of PCIe devices */ |
146 | #define BCMA_CHIP_ID_BCM4313 0x4313 | 146 | #define BCMA_CHIP_ID_BCM4313 0x4313 |
147 | #define BCMA_CHIP_ID_BCM43142 43142 | ||
147 | #define BCMA_CHIP_ID_BCM43224 43224 | 148 | #define BCMA_CHIP_ID_BCM43224 43224 |
148 | #define BCMA_PKG_ID_BCM43224_FAB_CSM 0x8 | 149 | #define BCMA_PKG_ID_BCM43224_FAB_CSM 0x8 |
149 | #define BCMA_PKG_ID_BCM43224_FAB_SMIC 0xa | 150 | #define BCMA_PKG_ID_BCM43224_FAB_SMIC 0xa |
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h index b8b09eac60a4..c49e1a159e6e 100644 --- a/include/linux/bcma/bcma_driver_chipcommon.h +++ b/include/linux/bcma/bcma_driver_chipcommon.h | |||
@@ -330,6 +330,8 @@ | |||
330 | #define BCMA_CC_PMU_CAP 0x0604 /* PMU capabilities */ | 330 | #define BCMA_CC_PMU_CAP 0x0604 /* PMU capabilities */ |
331 | #define BCMA_CC_PMU_CAP_REVISION 0x000000FF /* Revision mask */ | 331 | #define BCMA_CC_PMU_CAP_REVISION 0x000000FF /* Revision mask */ |
332 | #define BCMA_CC_PMU_STAT 0x0608 /* PMU status */ | 332 | #define BCMA_CC_PMU_STAT 0x0608 /* PMU status */ |
333 | #define BCMA_CC_PMU_STAT_EXT_LPO_AVAIL 0x00000100 | ||
334 | #define BCMA_CC_PMU_STAT_WDRESET 0x00000080 | ||
333 | #define BCMA_CC_PMU_STAT_INTPEND 0x00000040 /* Interrupt pending */ | 335 | #define BCMA_CC_PMU_STAT_INTPEND 0x00000040 /* Interrupt pending */ |
334 | #define BCMA_CC_PMU_STAT_SBCLKST 0x00000030 /* Backplane clock status? */ | 336 | #define BCMA_CC_PMU_STAT_SBCLKST 0x00000030 /* Backplane clock status? */ |
335 | #define BCMA_CC_PMU_STAT_HAVEALP 0x00000008 /* ALP available */ | 337 | #define BCMA_CC_PMU_STAT_HAVEALP 0x00000008 /* ALP available */ |
@@ -355,6 +357,11 @@ | |||
355 | #define BCMA_CC_REGCTL_DATA 0x065C | 357 | #define BCMA_CC_REGCTL_DATA 0x065C |
356 | #define BCMA_CC_PLLCTL_ADDR 0x0660 | 358 | #define BCMA_CC_PLLCTL_ADDR 0x0660 |
357 | #define BCMA_CC_PLLCTL_DATA 0x0664 | 359 | #define BCMA_CC_PLLCTL_DATA 0x0664 |
360 | #define BCMA_CC_PMU_STRAPOPT 0x0668 /* (corerev >= 28) */ | ||
361 | #define BCMA_CC_PMU_XTAL_FREQ 0x066C /* (pmurev >= 10) */ | ||
362 | #define BCMA_CC_PMU_XTAL_FREQ_ILPCTL_MASK 0x00001FFF | ||
363 | #define BCMA_CC_PMU_XTAL_FREQ_MEASURE_MASK 0x80000000 | ||
364 | #define BCMA_CC_PMU_XTAL_FREQ_MEASURE_SHIFT 31 | ||
358 | #define BCMA_CC_SPROM 0x0800 /* SPROM beginning */ | 365 | #define BCMA_CC_SPROM 0x0800 /* SPROM beginning */ |
359 | /* NAND flash MLC controller registers (corerev >= 38) */ | 366 | /* NAND flash MLC controller registers (corerev >= 38) */ |
360 | #define BCMA_CC_NAND_REVISION 0x0C00 | 367 | #define BCMA_CC_NAND_REVISION 0x0C00 |
@@ -435,6 +442,23 @@ | |||
435 | #define BCMA_CC_PMU6_4706_PROC_NDIV_MODE_MASK 0x00000007 | 442 | #define BCMA_CC_PMU6_4706_PROC_NDIV_MODE_MASK 0x00000007 |
436 | #define BCMA_CC_PMU6_4706_PROC_NDIV_MODE_SHIFT 0 | 443 | #define BCMA_CC_PMU6_4706_PROC_NDIV_MODE_SHIFT 0 |
437 | 444 | ||
445 | /* PMU rev 15 */ | ||
446 | #define BCMA_CC_PMU15_PLL_PLLCTL0 0 | ||
447 | #define BCMA_CC_PMU15_PLL_PC0_CLKSEL_MASK 0x00000003 | ||
448 | #define BCMA_CC_PMU15_PLL_PC0_CLKSEL_SHIFT 0 | ||
449 | #define BCMA_CC_PMU15_PLL_PC0_FREQTGT_MASK 0x003FFFFC | ||
450 | #define BCMA_CC_PMU15_PLL_PC0_FREQTGT_SHIFT 2 | ||
451 | #define BCMA_CC_PMU15_PLL_PC0_PRESCALE_MASK 0x00C00000 | ||
452 | #define BCMA_CC_PMU15_PLL_PC0_PRESCALE_SHIFT 22 | ||
453 | #define BCMA_CC_PMU15_PLL_PC0_KPCTRL_MASK 0x07000000 | ||
454 | #define BCMA_CC_PMU15_PLL_PC0_KPCTRL_SHIFT 24 | ||
455 | #define BCMA_CC_PMU15_PLL_PC0_FCNTCTRL_MASK 0x38000000 | ||
456 | #define BCMA_CC_PMU15_PLL_PC0_FCNTCTRL_SHIFT 27 | ||
457 | #define BCMA_CC_PMU15_PLL_PC0_FDCMODE_MASK 0x40000000 | ||
458 | #define BCMA_CC_PMU15_PLL_PC0_FDCMODE_SHIFT 30 | ||
459 | #define BCMA_CC_PMU15_PLL_PC0_CTRLBIAS_MASK 0x80000000 | ||
460 | #define BCMA_CC_PMU15_PLL_PC0_CTRLBIAS_SHIFT 31 | ||
461 | |||
438 | /* ALP clock on pre-PMU chips */ | 462 | /* ALP clock on pre-PMU chips */ |
439 | #define BCMA_CC_PMU_ALP_CLOCK 20000000 | 463 | #define BCMA_CC_PMU_ALP_CLOCK 20000000 |
440 | /* HT clock for systems with PMU-enabled chipcommon */ | 464 | /* HT clock for systems with PMU-enabled chipcommon */ |
@@ -507,6 +531,37 @@ | |||
507 | #define BCMA_CHIPCTL_5357_I2S_PINS_ENABLE BIT(18) | 531 | #define BCMA_CHIPCTL_5357_I2S_PINS_ENABLE BIT(18) |
508 | #define BCMA_CHIPCTL_5357_I2CSPI_PINS_ENABLE BIT(19) | 532 | #define BCMA_CHIPCTL_5357_I2CSPI_PINS_ENABLE BIT(19) |
509 | 533 | ||
534 | #define BCMA_RES_4314_LPLDO_PU BIT(0) | ||
535 | #define BCMA_RES_4314_PMU_SLEEP_DIS BIT(1) | ||
536 | #define BCMA_RES_4314_PMU_BG_PU BIT(2) | ||
537 | #define BCMA_RES_4314_CBUCK_LPOM_PU BIT(3) | ||
538 | #define BCMA_RES_4314_CBUCK_PFM_PU BIT(4) | ||
539 | #define BCMA_RES_4314_CLDO_PU BIT(5) | ||
540 | #define BCMA_RES_4314_LPLDO2_LVM BIT(6) | ||
541 | #define BCMA_RES_4314_WL_PMU_PU BIT(7) | ||
542 | #define BCMA_RES_4314_LNLDO_PU BIT(8) | ||
543 | #define BCMA_RES_4314_LDO3P3_PU BIT(9) | ||
544 | #define BCMA_RES_4314_OTP_PU BIT(10) | ||
545 | #define BCMA_RES_4314_XTAL_PU BIT(11) | ||
546 | #define BCMA_RES_4314_WL_PWRSW_PU BIT(12) | ||
547 | #define BCMA_RES_4314_LQ_AVAIL BIT(13) | ||
548 | #define BCMA_RES_4314_LOGIC_RET BIT(14) | ||
549 | #define BCMA_RES_4314_MEM_SLEEP BIT(15) | ||
550 | #define BCMA_RES_4314_MACPHY_RET BIT(16) | ||
551 | #define BCMA_RES_4314_WL_CORE_READY BIT(17) | ||
552 | #define BCMA_RES_4314_ILP_REQ BIT(18) | ||
553 | #define BCMA_RES_4314_ALP_AVAIL BIT(19) | ||
554 | #define BCMA_RES_4314_MISC_PWRSW_PU BIT(20) | ||
555 | #define BCMA_RES_4314_SYNTH_PWRSW_PU BIT(21) | ||
556 | #define BCMA_RES_4314_RX_PWRSW_PU BIT(22) | ||
557 | #define BCMA_RES_4314_RADIO_PU BIT(23) | ||
558 | #define BCMA_RES_4314_VCO_LDO_PU BIT(24) | ||
559 | #define BCMA_RES_4314_AFE_LDO_PU BIT(25) | ||
560 | #define BCMA_RES_4314_RX_LDO_PU BIT(26) | ||
561 | #define BCMA_RES_4314_TX_LDO_PU BIT(27) | ||
562 | #define BCMA_RES_4314_HT_AVAIL BIT(28) | ||
563 | #define BCMA_RES_4314_MACPHY_CLK_AVAIL BIT(29) | ||
564 | |||
510 | /* Data for the PMU, if available. | 565 | /* Data for the PMU, if available. |
511 | * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU) | 566 | * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU) |
512 | */ | 567 | */ |
diff --git a/include/linux/bio.h b/include/linux/bio.h index ef24466d8f82..ec48bac5b039 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -97,11 +97,11 @@ static inline void *bio_data(struct bio *bio) | |||
97 | * permanent PIO fall back, user is probably better off disabling highmem | 97 | * permanent PIO fall back, user is probably better off disabling highmem |
98 | * I/O completely on that queue (see ide-dma for example) | 98 | * I/O completely on that queue (see ide-dma for example) |
99 | */ | 99 | */ |
100 | #define __bio_kmap_atomic(bio, idx, kmtype) \ | 100 | #define __bio_kmap_atomic(bio, idx) \ |
101 | (kmap_atomic(bio_iovec_idx((bio), (idx))->bv_page) + \ | 101 | (kmap_atomic(bio_iovec_idx((bio), (idx))->bv_page) + \ |
102 | bio_iovec_idx((bio), (idx))->bv_offset) | 102 | bio_iovec_idx((bio), (idx))->bv_offset) |
103 | 103 | ||
104 | #define __bio_kunmap_atomic(addr, kmtype) kunmap_atomic(addr) | 104 | #define __bio_kunmap_atomic(addr) kunmap_atomic(addr) |
105 | 105 | ||
106 | /* | 106 | /* |
107 | * merge helpers etc | 107 | * merge helpers etc |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 5f0b0e1f7c08..f1f07d31a3af 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
@@ -44,8 +44,8 @@ extern unsigned long init_bootmem_node(pg_data_t *pgdat, | |||
44 | unsigned long endpfn); | 44 | unsigned long endpfn); |
45 | extern unsigned long init_bootmem(unsigned long addr, unsigned long memend); | 45 | extern unsigned long init_bootmem(unsigned long addr, unsigned long memend); |
46 | 46 | ||
47 | extern unsigned long free_all_bootmem_node(pg_data_t *pgdat); | ||
48 | extern unsigned long free_all_bootmem(void); | 47 | extern unsigned long free_all_bootmem(void); |
48 | extern void reset_all_zones_managed_pages(void); | ||
49 | 49 | ||
50 | extern void free_bootmem_node(pg_data_t *pgdat, | 50 | extern void free_bootmem_node(pg_data_t *pgdat, |
51 | unsigned long addr, | 51 | unsigned long addr, |
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 9e52b0626b39..91fa9a94ae92 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -139,6 +139,9 @@ BUFFER_FNS(Prio, prio) | |||
139 | }) | 139 | }) |
140 | #define page_has_buffers(page) PagePrivate(page) | 140 | #define page_has_buffers(page) PagePrivate(page) |
141 | 141 | ||
142 | void buffer_check_dirty_writeback(struct page *page, | ||
143 | bool *dirty, bool *writeback); | ||
144 | |||
142 | /* | 145 | /* |
143 | * Declarations | 146 | * Declarations |
144 | */ | 147 | */ |
@@ -198,7 +201,8 @@ extern int buffer_heads_over_limit; | |||
198 | * Generic address_space_operations implementations for buffer_head-backed | 201 | * Generic address_space_operations implementations for buffer_head-backed |
199 | * address_spaces. | 202 | * address_spaces. |
200 | */ | 203 | */ |
201 | void block_invalidatepage(struct page *page, unsigned long offset); | 204 | void block_invalidatepage(struct page *page, unsigned int offset, |
205 | unsigned int length); | ||
202 | int block_write_full_page(struct page *page, get_block_t *get_block, | 206 | int block_write_full_page(struct page *page, get_block_t *get_block, |
203 | struct writeback_control *wbc); | 207 | struct writeback_control *wbc); |
204 | int block_write_full_page_endio(struct page *page, get_block_t *get_block, | 208 | int block_write_full_page_endio(struct page *page, get_block_t *get_block, |
diff --git a/include/linux/can/platform/flexcan.h b/include/linux/can/platform/flexcan.h deleted file mode 100644 index 72b713ab57e9..000000000000 --- a/include/linux/can/platform/flexcan.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Marc Kleine-Budde <kernel@pengutronix.de> | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | * | ||
6 | */ | ||
7 | |||
8 | #ifndef __CAN_PLATFORM_FLEXCAN_H | ||
9 | #define __CAN_PLATFORM_FLEXCAN_H | ||
10 | |||
11 | /** | ||
12 | * struct flexcan_platform_data - flex CAN controller platform data | ||
13 | * @transceiver_enable: - called to power on/off the transceiver | ||
14 | * | ||
15 | */ | ||
16 | struct flexcan_platform_data { | ||
17 | void (*transceiver_switch)(int enable); | ||
18 | }; | ||
19 | |||
20 | #endif /* __CAN_PLATFORM_FLEXCAN_H */ | ||
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 8bda1294c035..e9ac882868c0 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/workqueue.h> | 20 | #include <linux/workqueue.h> |
21 | #include <linux/xattr.h> | 21 | #include <linux/xattr.h> |
22 | #include <linux/fs.h> | 22 | #include <linux/fs.h> |
23 | #include <linux/percpu-refcount.h> | ||
23 | 24 | ||
24 | #ifdef CONFIG_CGROUPS | 25 | #ifdef CONFIG_CGROUPS |
25 | 26 | ||
@@ -72,13 +73,8 @@ struct cgroup_subsys_state { | |||
72 | */ | 73 | */ |
73 | struct cgroup *cgroup; | 74 | struct cgroup *cgroup; |
74 | 75 | ||
75 | /* | 76 | /* reference count - access via css_[try]get() and css_put() */ |
76 | * State maintained by the cgroup system to allow subsystems | 77 | struct percpu_ref refcnt; |
77 | * to be "busy". Should be accessed via css_get(), | ||
78 | * css_tryget() and css_put(). | ||
79 | */ | ||
80 | |||
81 | atomic_t refcnt; | ||
82 | 78 | ||
83 | unsigned long flags; | 79 | unsigned long flags; |
84 | /* ID for this css, if possible */ | 80 | /* ID for this css, if possible */ |
@@ -94,56 +90,52 @@ enum { | |||
94 | CSS_ONLINE = (1 << 1), /* between ->css_online() and ->css_offline() */ | 90 | CSS_ONLINE = (1 << 1), /* between ->css_online() and ->css_offline() */ |
95 | }; | 91 | }; |
96 | 92 | ||
97 | /* Caller must verify that the css is not for root cgroup */ | 93 | /** |
98 | static inline void __css_get(struct cgroup_subsys_state *css, int count) | 94 | * css_get - obtain a reference on the specified css |
99 | { | 95 | * @css: target css |
100 | atomic_add(count, &css->refcnt); | 96 | * |
101 | } | 97 | * The caller must already have a reference. |
102 | |||
103 | /* | ||
104 | * Call css_get() to hold a reference on the css; it can be used | ||
105 | * for a reference obtained via: | ||
106 | * - an existing ref-counted reference to the css | ||
107 | * - task->cgroups for a locked task | ||
108 | */ | 98 | */ |
109 | |||
110 | static inline void css_get(struct cgroup_subsys_state *css) | 99 | static inline void css_get(struct cgroup_subsys_state *css) |
111 | { | 100 | { |
112 | /* We don't need to reference count the root state */ | 101 | /* We don't need to reference count the root state */ |
113 | if (!(css->flags & CSS_ROOT)) | 102 | if (!(css->flags & CSS_ROOT)) |
114 | __css_get(css, 1); | 103 | percpu_ref_get(&css->refcnt); |
115 | } | 104 | } |
116 | 105 | ||
117 | /* | 106 | /** |
118 | * Call css_tryget() to take a reference on a css if your existing | 107 | * css_tryget - try to obtain a reference on the specified css |
119 | * (known-valid) reference isn't already ref-counted. Returns false if | 108 | * @css: target css |
120 | * the css has been destroyed. | 109 | * |
110 | * Obtain a reference on @css if it's alive. The caller naturally needs to | ||
111 | * ensure that @css is accessible but doesn't have to be holding a | ||
112 | * reference on it - IOW, RCU protected access is good enough for this | ||
113 | * function. Returns %true if a reference count was successfully obtained; | ||
114 | * %false otherwise. | ||
121 | */ | 115 | */ |
122 | |||
123 | extern bool __css_tryget(struct cgroup_subsys_state *css); | ||
124 | static inline bool css_tryget(struct cgroup_subsys_state *css) | 116 | static inline bool css_tryget(struct cgroup_subsys_state *css) |
125 | { | 117 | { |
126 | if (css->flags & CSS_ROOT) | 118 | if (css->flags & CSS_ROOT) |
127 | return true; | 119 | return true; |
128 | return __css_tryget(css); | 120 | return percpu_ref_tryget(&css->refcnt); |
129 | } | 121 | } |
130 | 122 | ||
131 | /* | 123 | /** |
132 | * css_put() should be called to release a reference taken by | 124 | * css_put - put a css reference |
133 | * css_get() or css_tryget() | 125 | * @css: target css |
126 | * | ||
127 | * Put a reference obtained via css_get() and css_tryget(). | ||
134 | */ | 128 | */ |
135 | |||
136 | extern void __css_put(struct cgroup_subsys_state *css); | ||
137 | static inline void css_put(struct cgroup_subsys_state *css) | 129 | static inline void css_put(struct cgroup_subsys_state *css) |
138 | { | 130 | { |
139 | if (!(css->flags & CSS_ROOT)) | 131 | if (!(css->flags & CSS_ROOT)) |
140 | __css_put(css); | 132 | percpu_ref_put(&css->refcnt); |
141 | } | 133 | } |
142 | 134 | ||
143 | /* bits in struct cgroup flags field */ | 135 | /* bits in struct cgroup flags field */ |
144 | enum { | 136 | enum { |
145 | /* Control Group is dead */ | 137 | /* Control Group is dead */ |
146 | CGRP_REMOVED, | 138 | CGRP_DEAD, |
147 | /* | 139 | /* |
148 | * Control Group has previously had a child cgroup or a task, | 140 | * Control Group has previously had a child cgroup or a task, |
149 | * but no longer (only if CGRP_NOTIFY_ON_RELEASE is set) | 141 | * but no longer (only if CGRP_NOTIFY_ON_RELEASE is set) |
@@ -169,12 +161,6 @@ struct cgroup_name { | |||
169 | struct cgroup { | 161 | struct cgroup { |
170 | unsigned long flags; /* "unsigned long" so bitops work */ | 162 | unsigned long flags; /* "unsigned long" so bitops work */ |
171 | 163 | ||
172 | /* | ||
173 | * count users of this cgroup. >0 means busy, but doesn't | ||
174 | * necessarily indicate the number of tasks in the cgroup | ||
175 | */ | ||
176 | atomic_t count; | ||
177 | |||
178 | int id; /* ida allocated in-hierarchy ID */ | 164 | int id; /* ida allocated in-hierarchy ID */ |
179 | 165 | ||
180 | /* | 166 | /* |
@@ -189,6 +175,14 @@ struct cgroup { | |||
189 | struct dentry *dentry; /* cgroup fs entry, RCU protected */ | 175 | struct dentry *dentry; /* cgroup fs entry, RCU protected */ |
190 | 176 | ||
191 | /* | 177 | /* |
178 | * Monotonically increasing unique serial number which defines a | ||
179 | * uniform order among all cgroups. It's guaranteed that all | ||
180 | * ->children lists are in the ascending order of ->serial_nr. | ||
181 | * It's used to allow interrupting and resuming iterations. | ||
182 | */ | ||
183 | u64 serial_nr; | ||
184 | |||
185 | /* | ||
192 | * This is a copy of dentry->d_name, and it's needed because | 186 | * This is a copy of dentry->d_name, and it's needed because |
193 | * we can't use dentry->d_name in cgroup_path(). | 187 | * we can't use dentry->d_name in cgroup_path(). |
194 | * | 188 | * |
@@ -207,13 +201,10 @@ struct cgroup { | |||
207 | struct cgroupfs_root *root; | 201 | struct cgroupfs_root *root; |
208 | 202 | ||
209 | /* | 203 | /* |
210 | * List of cg_cgroup_links pointing at css_sets with | 204 | * List of cgrp_cset_links pointing at css_sets with tasks in this |
211 | * tasks in this cgroup. Protected by css_set_lock | 205 | * cgroup. Protected by css_set_lock. |
212 | */ | 206 | */ |
213 | struct list_head css_sets; | 207 | struct list_head cset_links; |
214 | |||
215 | struct list_head allcg_node; /* cgroupfs_root->allcg_list */ | ||
216 | struct list_head cft_q_node; /* used during cftype add/rm */ | ||
217 | 208 | ||
218 | /* | 209 | /* |
219 | * Linked list running through all cgroups that can | 210 | * Linked list running through all cgroups that can |
@@ -229,9 +220,10 @@ struct cgroup { | |||
229 | struct list_head pidlists; | 220 | struct list_head pidlists; |
230 | struct mutex pidlist_mutex; | 221 | struct mutex pidlist_mutex; |
231 | 222 | ||
232 | /* For RCU-protected deletion */ | 223 | /* For css percpu_ref killing and RCU-protected deletion */ |
233 | struct rcu_head rcu_head; | 224 | struct rcu_head rcu_head; |
234 | struct work_struct free_work; | 225 | struct work_struct destroy_work; |
226 | atomic_t css_kill_cnt; | ||
235 | 227 | ||
236 | /* List of events which userspace want to receive */ | 228 | /* List of events which userspace want to receive */ |
237 | struct list_head event_list; | 229 | struct list_head event_list; |
@@ -269,18 +261,35 @@ enum { | |||
269 | * | 261 | * |
270 | * - Remount is disallowed. | 262 | * - Remount is disallowed. |
271 | * | 263 | * |
264 | * - rename(2) is disallowed. | ||
265 | * | ||
266 | * - "tasks" is removed. Everything should be at process | ||
267 | * granularity. Use "cgroup.procs" instead. | ||
268 | * | ||
269 | * - "release_agent" and "notify_on_release" are removed. | ||
270 | * Replacement notification mechanism will be implemented. | ||
271 | * | ||
272 | * - cpuset: tasks will be kept in empty cpusets when hotplug happens | ||
273 | * and take masks of ancestors with non-empty cpus/mems, instead of | ||
274 | * being moved to an ancestor. | ||
275 | * | ||
276 | * - cpuset: a task can be moved into an empty cpuset, and again it | ||
277 | * takes masks of ancestors. | ||
278 | * | ||
272 | * - memcg: use_hierarchy is on by default and the cgroup file for | 279 | * - memcg: use_hierarchy is on by default and the cgroup file for |
273 | * the flag is not created. | 280 | * the flag is not created. |
274 | * | 281 | * |
275 | * The followings are planned changes. | 282 | * - blkcg: blk-throttle becomes properly hierarchical. |
276 | * | ||
277 | * - release_agent will be disallowed once replacement notification | ||
278 | * mechanism is implemented. | ||
279 | */ | 283 | */ |
280 | CGRP_ROOT_SANE_BEHAVIOR = (1 << 0), | 284 | CGRP_ROOT_SANE_BEHAVIOR = (1 << 0), |
281 | 285 | ||
282 | CGRP_ROOT_NOPREFIX = (1 << 1), /* mounted subsystems have no named prefix */ | 286 | CGRP_ROOT_NOPREFIX = (1 << 1), /* mounted subsystems have no named prefix */ |
283 | CGRP_ROOT_XATTR = (1 << 2), /* supports extended attributes */ | 287 | CGRP_ROOT_XATTR = (1 << 2), /* supports extended attributes */ |
288 | |||
289 | /* mount options live below bit 16 */ | ||
290 | CGRP_ROOT_OPTION_MASK = (1 << 16) - 1, | ||
291 | |||
292 | CGRP_ROOT_SUBSYS_BOUND = (1 << 16), /* subsystems finished binding */ | ||
284 | }; | 293 | }; |
285 | 294 | ||
286 | /* | 295 | /* |
@@ -291,18 +300,12 @@ enum { | |||
291 | struct cgroupfs_root { | 300 | struct cgroupfs_root { |
292 | struct super_block *sb; | 301 | struct super_block *sb; |
293 | 302 | ||
294 | /* | 303 | /* The bitmask of subsystems attached to this hierarchy */ |
295 | * The bitmask of subsystems intended to be attached to this | ||
296 | * hierarchy | ||
297 | */ | ||
298 | unsigned long subsys_mask; | 304 | unsigned long subsys_mask; |
299 | 305 | ||
300 | /* Unique id for this hierarchy. */ | 306 | /* Unique id for this hierarchy. */ |
301 | int hierarchy_id; | 307 | int hierarchy_id; |
302 | 308 | ||
303 | /* The bitmask of subsystems currently attached to this hierarchy */ | ||
304 | unsigned long actual_subsys_mask; | ||
305 | |||
306 | /* A list running through the attached subsystems */ | 309 | /* A list running through the attached subsystems */ |
307 | struct list_head subsys_list; | 310 | struct list_head subsys_list; |
308 | 311 | ||
@@ -315,9 +318,6 @@ struct cgroupfs_root { | |||
315 | /* A list running through the active hierarchies */ | 318 | /* A list running through the active hierarchies */ |
316 | struct list_head root_list; | 319 | struct list_head root_list; |
317 | 320 | ||
318 | /* All cgroups on this root, cgroup_mutex protected */ | ||
319 | struct list_head allcg_list; | ||
320 | |||
321 | /* Hierarchy-specific flags */ | 321 | /* Hierarchy-specific flags */ |
322 | unsigned long flags; | 322 | unsigned long flags; |
323 | 323 | ||
@@ -357,11 +357,10 @@ struct css_set { | |||
357 | struct list_head tasks; | 357 | struct list_head tasks; |
358 | 358 | ||
359 | /* | 359 | /* |
360 | * List of cg_cgroup_link objects on link chains from | 360 | * List of cgrp_cset_links pointing at cgroups referenced from this |
361 | * cgroups referenced from this css_set. Protected by | 361 | * css_set. Protected by css_set_lock. |
362 | * css_set_lock | ||
363 | */ | 362 | */ |
364 | struct list_head cg_links; | 363 | struct list_head cgrp_links; |
365 | 364 | ||
366 | /* | 365 | /* |
367 | * Set of subsystem states, one for each subsystem. This array | 366 | * Set of subsystem states, one for each subsystem. This array |
@@ -394,9 +393,11 @@ struct cgroup_map_cb { | |||
394 | */ | 393 | */ |
395 | 394 | ||
396 | /* cftype->flags */ | 395 | /* cftype->flags */ |
397 | #define CFTYPE_ONLY_ON_ROOT (1U << 0) /* only create on root cg */ | 396 | enum { |
398 | #define CFTYPE_NOT_ON_ROOT (1U << 1) /* don't create on root cg */ | 397 | CFTYPE_ONLY_ON_ROOT = (1 << 0), /* only create on root cg */ |
399 | #define CFTYPE_INSANE (1U << 2) /* don't create if sane_behavior */ | 398 | CFTYPE_NOT_ON_ROOT = (1 << 1), /* don't create on root cg */ |
399 | CFTYPE_INSANE = (1 << 2), /* don't create if sane_behavior */ | ||
400 | }; | ||
400 | 401 | ||
401 | #define MAX_CFTYPE_NAME 64 | 402 | #define MAX_CFTYPE_NAME 64 |
402 | 403 | ||
@@ -442,13 +443,13 @@ struct cftype { | |||
442 | * entry. The key/value pairs (and their ordering) should not | 443 | * entry. The key/value pairs (and their ordering) should not |
443 | * change between reboots. | 444 | * change between reboots. |
444 | */ | 445 | */ |
445 | int (*read_map)(struct cgroup *cont, struct cftype *cft, | 446 | int (*read_map)(struct cgroup *cgrp, struct cftype *cft, |
446 | struct cgroup_map_cb *cb); | 447 | struct cgroup_map_cb *cb); |
447 | /* | 448 | /* |
448 | * read_seq_string() is used for outputting a simple sequence | 449 | * read_seq_string() is used for outputting a simple sequence |
449 | * using seqfile. | 450 | * using seqfile. |
450 | */ | 451 | */ |
451 | int (*read_seq_string)(struct cgroup *cont, struct cftype *cft, | 452 | int (*read_seq_string)(struct cgroup *cgrp, struct cftype *cft, |
452 | struct seq_file *m); | 453 | struct seq_file *m); |
453 | 454 | ||
454 | ssize_t (*write)(struct cgroup *cgrp, struct cftype *cft, | 455 | ssize_t (*write)(struct cgroup *cgrp, struct cftype *cft, |
@@ -538,10 +539,10 @@ static inline const char *cgroup_name(const struct cgroup *cgrp) | |||
538 | int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); | 539 | int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); |
539 | int cgroup_rm_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); | 540 | int cgroup_rm_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); |
540 | 541 | ||
541 | int cgroup_is_removed(const struct cgroup *cgrp); | ||
542 | bool cgroup_is_descendant(struct cgroup *cgrp, struct cgroup *ancestor); | 542 | bool cgroup_is_descendant(struct cgroup *cgrp, struct cgroup *ancestor); |
543 | 543 | ||
544 | int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen); | 544 | int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen); |
545 | int task_cgroup_path(struct task_struct *task, char *buf, size_t buflen); | ||
545 | 546 | ||
546 | int cgroup_task_count(const struct cgroup *cgrp); | 547 | int cgroup_task_count(const struct cgroup *cgrp); |
547 | 548 | ||
@@ -646,22 +647,60 @@ static inline struct cgroup_subsys_state *cgroup_subsys_state( | |||
646 | return cgrp->subsys[subsys_id]; | 647 | return cgrp->subsys[subsys_id]; |
647 | } | 648 | } |
648 | 649 | ||
649 | /* | 650 | /** |
650 | * function to get the cgroup_subsys_state which allows for extra | 651 | * task_css_set_check - obtain a task's css_set with extra access conditions |
651 | * rcu_dereference_check() conditions, such as locks used during the | 652 | * @task: the task to obtain css_set for |
652 | * cgroup_subsys::attach() methods. | 653 | * @__c: extra condition expression to be passed to rcu_dereference_check() |
654 | * | ||
655 | * A task's css_set is RCU protected, initialized and exited while holding | ||
656 | * task_lock(), and can only be modified while holding both cgroup_mutex | ||
657 | * and task_lock() while the task is alive. This macro verifies that the | ||
658 | * caller is inside proper critical section and returns @task's css_set. | ||
659 | * | ||
660 | * The caller can also specify additional allowed conditions via @__c, such | ||
661 | * as locks used during the cgroup_subsys::attach() methods. | ||
653 | */ | 662 | */ |
654 | #ifdef CONFIG_PROVE_RCU | 663 | #ifdef CONFIG_PROVE_RCU |
655 | extern struct mutex cgroup_mutex; | 664 | extern struct mutex cgroup_mutex; |
656 | #define task_subsys_state_check(task, subsys_id, __c) \ | 665 | #define task_css_set_check(task, __c) \ |
657 | rcu_dereference_check((task)->cgroups->subsys[(subsys_id)], \ | 666 | rcu_dereference_check((task)->cgroups, \ |
658 | lockdep_is_held(&(task)->alloc_lock) || \ | 667 | lockdep_is_held(&(task)->alloc_lock) || \ |
659 | lockdep_is_held(&cgroup_mutex) || (__c)) | 668 | lockdep_is_held(&cgroup_mutex) || (__c)) |
660 | #else | 669 | #else |
661 | #define task_subsys_state_check(task, subsys_id, __c) \ | 670 | #define task_css_set_check(task, __c) \ |
662 | rcu_dereference((task)->cgroups->subsys[(subsys_id)]) | 671 | rcu_dereference((task)->cgroups) |
663 | #endif | 672 | #endif |
664 | 673 | ||
674 | /** | ||
675 | * task_subsys_state_check - obtain css for (task, subsys) w/ extra access conds | ||
676 | * @task: the target task | ||
677 | * @subsys_id: the target subsystem ID | ||
678 | * @__c: extra condition expression to be passed to rcu_dereference_check() | ||
679 | * | ||
680 | * Return the cgroup_subsys_state for the (@task, @subsys_id) pair. The | ||
681 | * synchronization rules are the same as task_css_set_check(). | ||
682 | */ | ||
683 | #define task_subsys_state_check(task, subsys_id, __c) \ | ||
684 | task_css_set_check((task), (__c))->subsys[(subsys_id)] | ||
685 | |||
686 | /** | ||
687 | * task_css_set - obtain a task's css_set | ||
688 | * @task: the task to obtain css_set for | ||
689 | * | ||
690 | * See task_css_set_check(). | ||
691 | */ | ||
692 | static inline struct css_set *task_css_set(struct task_struct *task) | ||
693 | { | ||
694 | return task_css_set_check(task, false); | ||
695 | } | ||
696 | |||
697 | /** | ||
698 | * task_subsys_state - obtain css for (task, subsys) | ||
699 | * @task: the target task | ||
700 | * @subsys_id: the target subsystem ID | ||
701 | * | ||
702 | * See task_subsys_state_check(). | ||
703 | */ | ||
665 | static inline struct cgroup_subsys_state * | 704 | static inline struct cgroup_subsys_state * |
666 | task_subsys_state(struct task_struct *task, int subsys_id) | 705 | task_subsys_state(struct task_struct *task, int subsys_id) |
667 | { | 706 | { |
@@ -674,12 +713,14 @@ static inline struct cgroup* task_cgroup(struct task_struct *task, | |||
674 | return task_subsys_state(task, subsys_id)->cgroup; | 713 | return task_subsys_state(task, subsys_id)->cgroup; |
675 | } | 714 | } |
676 | 715 | ||
716 | struct cgroup *cgroup_next_sibling(struct cgroup *pos); | ||
717 | |||
677 | /** | 718 | /** |
678 | * cgroup_for_each_child - iterate through children of a cgroup | 719 | * cgroup_for_each_child - iterate through children of a cgroup |
679 | * @pos: the cgroup * to use as the loop cursor | 720 | * @pos: the cgroup * to use as the loop cursor |
680 | * @cgroup: cgroup whose children to walk | 721 | * @cgrp: cgroup whose children to walk |
681 | * | 722 | * |
682 | * Walk @cgroup's children. Must be called under rcu_read_lock(). A child | 723 | * Walk @cgrp's children. Must be called under rcu_read_lock(). A child |
683 | * cgroup which hasn't finished ->css_online() or already has finished | 724 | * cgroup which hasn't finished ->css_online() or already has finished |
684 | * ->css_offline() may show up during traversal and it's each subsystem's | 725 | * ->css_offline() may show up during traversal and it's each subsystem's |
685 | * responsibility to verify that each @pos is alive. | 726 | * responsibility to verify that each @pos is alive. |
@@ -687,9 +728,15 @@ static inline struct cgroup* task_cgroup(struct task_struct *task, | |||
687 | * If a subsystem synchronizes against the parent in its ->css_online() and | 728 | * If a subsystem synchronizes against the parent in its ->css_online() and |
688 | * before starting iterating, a cgroup which finished ->css_online() is | 729 | * before starting iterating, a cgroup which finished ->css_online() is |
689 | * guaranteed to be visible in the future iterations. | 730 | * guaranteed to be visible in the future iterations. |
731 | * | ||
732 | * It is allowed to temporarily drop RCU read lock during iteration. The | ||
733 | * caller is responsible for ensuring that @pos remains accessible until | ||
734 | * the start of the next iteration by, for example, bumping the css refcnt. | ||
690 | */ | 735 | */ |
691 | #define cgroup_for_each_child(pos, cgroup) \ | 736 | #define cgroup_for_each_child(pos, cgrp) \ |
692 | list_for_each_entry_rcu(pos, &(cgroup)->children, sibling) | 737 | for ((pos) = list_first_or_null_rcu(&(cgrp)->children, \ |
738 | struct cgroup, sibling); \ | ||
739 | (pos); (pos) = cgroup_next_sibling((pos))) | ||
693 | 740 | ||
694 | struct cgroup *cgroup_next_descendant_pre(struct cgroup *pos, | 741 | struct cgroup *cgroup_next_descendant_pre(struct cgroup *pos, |
695 | struct cgroup *cgroup); | 742 | struct cgroup *cgroup); |
@@ -748,6 +795,10 @@ struct cgroup *cgroup_rightmost_descendant(struct cgroup *pos); | |||
748 | * Alternatively, a subsystem may choose to use a single global lock to | 795 | * Alternatively, a subsystem may choose to use a single global lock to |
749 | * synchronize ->css_online() and ->css_offline() against tree-walking | 796 | * synchronize ->css_online() and ->css_offline() against tree-walking |
750 | * operations. | 797 | * operations. |
798 | * | ||
799 | * It is allowed to temporarily drop RCU read lock during iteration. The | ||
800 | * caller is responsible for ensuring that @pos remains accessible until | ||
801 | * the start of the next iteration by, for example, bumping the css refcnt. | ||
751 | */ | 802 | */ |
752 | #define cgroup_for_each_descendant_pre(pos, cgroup) \ | 803 | #define cgroup_for_each_descendant_pre(pos, cgroup) \ |
753 | for (pos = cgroup_next_descendant_pre(NULL, (cgroup)); (pos); \ | 804 | for (pos = cgroup_next_descendant_pre(NULL, (cgroup)); (pos); \ |
@@ -771,7 +822,7 @@ struct cgroup *cgroup_next_descendant_post(struct cgroup *pos, | |||
771 | 822 | ||
772 | /* A cgroup_iter should be treated as an opaque object */ | 823 | /* A cgroup_iter should be treated as an opaque object */ |
773 | struct cgroup_iter { | 824 | struct cgroup_iter { |
774 | struct list_head *cg_link; | 825 | struct list_head *cset_link; |
775 | struct list_head *task; | 826 | struct list_head *task; |
776 | }; | 827 | }; |
777 | 828 | ||
@@ -827,7 +878,6 @@ bool css_is_ancestor(struct cgroup_subsys_state *cg, | |||
827 | 878 | ||
828 | /* Get id and depth of css */ | 879 | /* Get id and depth of css */ |
829 | unsigned short css_id(struct cgroup_subsys_state *css); | 880 | unsigned short css_id(struct cgroup_subsys_state *css); |
830 | unsigned short css_depth(struct cgroup_subsys_state *css); | ||
831 | struct cgroup_subsys_state *cgroup_css_from_dir(struct file *f, int id); | 881 | struct cgroup_subsys_state *cgroup_css_from_dir(struct file *f, int id); |
832 | 882 | ||
833 | #else /* !CONFIG_CGROUPS */ | 883 | #else /* !CONFIG_CGROUPS */ |
@@ -838,8 +888,6 @@ static inline void cgroup_fork(struct task_struct *p) {} | |||
838 | static inline void cgroup_post_fork(struct task_struct *p) {} | 888 | static inline void cgroup_post_fork(struct task_struct *p) {} |
839 | static inline void cgroup_exit(struct task_struct *p, int callbacks) {} | 889 | static inline void cgroup_exit(struct task_struct *p, int callbacks) {} |
840 | 890 | ||
841 | static inline void cgroup_lock(void) {} | ||
842 | static inline void cgroup_unlock(void) {} | ||
843 | static inline int cgroupstats_build(struct cgroupstats *stats, | 891 | static inline int cgroupstats_build(struct cgroupstats *stats, |
844 | struct dentry *dentry) | 892 | struct dentry *dentry) |
845 | { | 893 | { |
diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h index 6e7ec64b69ab..b613ffd402d1 100644 --- a/include/linux/cgroup_subsys.h +++ b/include/linux/cgroup_subsys.h | |||
@@ -1,86 +1,55 @@ | |||
1 | /* Add subsystem definitions of the form SUBSYS(<name>) in this | 1 | /* |
2 | * file. Surround each one by a line of comment markers so that | 2 | * List of cgroup subsystems. |
3 | * patches don't collide | 3 | * |
4 | * DO NOT ADD ANY SUBSYSTEM WITHOUT EXPLICIT ACKS FROM CGROUP MAINTAINERS. | ||
4 | */ | 5 | */ |
5 | |||
6 | /* */ | ||
7 | |||
8 | /* */ | ||
9 | |||
10 | #if IS_SUBSYS_ENABLED(CONFIG_CPUSETS) | 6 | #if IS_SUBSYS_ENABLED(CONFIG_CPUSETS) |
11 | SUBSYS(cpuset) | 7 | SUBSYS(cpuset) |
12 | #endif | 8 | #endif |
13 | 9 | ||
14 | /* */ | ||
15 | |||
16 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_DEBUG) | 10 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_DEBUG) |
17 | SUBSYS(debug) | 11 | SUBSYS(debug) |
18 | #endif | 12 | #endif |
19 | 13 | ||
20 | /* */ | ||
21 | |||
22 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_SCHED) | 14 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_SCHED) |
23 | SUBSYS(cpu_cgroup) | 15 | SUBSYS(cpu_cgroup) |
24 | #endif | 16 | #endif |
25 | 17 | ||
26 | /* */ | ||
27 | |||
28 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_CPUACCT) | 18 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_CPUACCT) |
29 | SUBSYS(cpuacct) | 19 | SUBSYS(cpuacct) |
30 | #endif | 20 | #endif |
31 | 21 | ||
32 | /* */ | ||
33 | |||
34 | #if IS_SUBSYS_ENABLED(CONFIG_MEMCG) | 22 | #if IS_SUBSYS_ENABLED(CONFIG_MEMCG) |
35 | SUBSYS(mem_cgroup) | 23 | SUBSYS(mem_cgroup) |
36 | #endif | 24 | #endif |
37 | 25 | ||
38 | /* */ | ||
39 | |||
40 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_DEVICE) | 26 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_DEVICE) |
41 | SUBSYS(devices) | 27 | SUBSYS(devices) |
42 | #endif | 28 | #endif |
43 | 29 | ||
44 | /* */ | ||
45 | |||
46 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_FREEZER) | 30 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_FREEZER) |
47 | SUBSYS(freezer) | 31 | SUBSYS(freezer) |
48 | #endif | 32 | #endif |
49 | 33 | ||
50 | /* */ | ||
51 | |||
52 | #if IS_SUBSYS_ENABLED(CONFIG_NET_CLS_CGROUP) | 34 | #if IS_SUBSYS_ENABLED(CONFIG_NET_CLS_CGROUP) |
53 | SUBSYS(net_cls) | 35 | SUBSYS(net_cls) |
54 | #endif | 36 | #endif |
55 | 37 | ||
56 | /* */ | ||
57 | |||
58 | #if IS_SUBSYS_ENABLED(CONFIG_BLK_CGROUP) | 38 | #if IS_SUBSYS_ENABLED(CONFIG_BLK_CGROUP) |
59 | SUBSYS(blkio) | 39 | SUBSYS(blkio) |
60 | #endif | 40 | #endif |
61 | 41 | ||
62 | /* */ | ||
63 | |||
64 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_PERF) | 42 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_PERF) |
65 | SUBSYS(perf) | 43 | SUBSYS(perf) |
66 | #endif | 44 | #endif |
67 | 45 | ||
68 | /* */ | ||
69 | |||
70 | #if IS_SUBSYS_ENABLED(CONFIG_NETPRIO_CGROUP) | 46 | #if IS_SUBSYS_ENABLED(CONFIG_NETPRIO_CGROUP) |
71 | SUBSYS(net_prio) | 47 | SUBSYS(net_prio) |
72 | #endif | 48 | #endif |
73 | 49 | ||
74 | /* */ | ||
75 | |||
76 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_HUGETLB) | 50 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_HUGETLB) |
77 | SUBSYS(hugetlb) | 51 | SUBSYS(hugetlb) |
78 | #endif | 52 | #endif |
79 | 53 | /* | |
80 | /* */ | 54 | * DO NOT ADD ANY SUBSYSTEM WITHOUT EXPLICIT ACKS FROM CGROUP MAINTAINERS. |
81 | 55 | */ | |
82 | #ifdef CONFIG_CGROUP_BCACHE | ||
83 | SUBSYS(bcache) | ||
84 | #endif | ||
85 | |||
86 | /* */ | ||
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 11860985fecb..1ec14a732176 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h | |||
@@ -210,6 +210,10 @@ void of_fixed_clk_setup(struct device_node *np); | |||
210 | * CLK_GATE_SET_TO_DISABLE - by default this clock sets the bit at bit_idx to | 210 | * CLK_GATE_SET_TO_DISABLE - by default this clock sets the bit at bit_idx to |
211 | * enable the clock. Setting this flag does the opposite: setting the bit | 211 | * enable the clock. Setting this flag does the opposite: setting the bit |
212 | * disable the clock and clearing it enables the clock | 212 | * disable the clock and clearing it enables the clock |
213 | * CLK_GATE_HIWORD_MASK - The gate settings are only in lower 16-bit | ||
214 | * of this register, and mask of gate bits are in higher 16-bit of this | ||
215 | * register. While setting the gate bits, higher 16-bit should also be | ||
216 | * updated to indicate changing gate bits. | ||
213 | */ | 217 | */ |
214 | struct clk_gate { | 218 | struct clk_gate { |
215 | struct clk_hw hw; | 219 | struct clk_hw hw; |
@@ -220,6 +224,7 @@ struct clk_gate { | |||
220 | }; | 224 | }; |
221 | 225 | ||
222 | #define CLK_GATE_SET_TO_DISABLE BIT(0) | 226 | #define CLK_GATE_SET_TO_DISABLE BIT(0) |
227 | #define CLK_GATE_HIWORD_MASK BIT(1) | ||
223 | 228 | ||
224 | extern const struct clk_ops clk_gate_ops; | 229 | extern const struct clk_ops clk_gate_ops; |
225 | struct clk *clk_register_gate(struct device *dev, const char *name, | 230 | struct clk *clk_register_gate(struct device *dev, const char *name, |
@@ -257,6 +262,10 @@ struct clk_div_table { | |||
257 | * Some hardware implementations gracefully handle this case and allow a | 262 | * Some hardware implementations gracefully handle this case and allow a |
258 | * zero divisor by not modifying their input clock | 263 | * zero divisor by not modifying their input clock |
259 | * (divide by one / bypass). | 264 | * (divide by one / bypass). |
265 | * CLK_DIVIDER_HIWORD_MASK - The divider settings are only in lower 16-bit | ||
266 | * of this register, and mask of divider bits are in higher 16-bit of this | ||
267 | * register. While setting the divider bits, higher 16-bit should also be | ||
268 | * updated to indicate changing divider bits. | ||
260 | */ | 269 | */ |
261 | struct clk_divider { | 270 | struct clk_divider { |
262 | struct clk_hw hw; | 271 | struct clk_hw hw; |
@@ -271,6 +280,7 @@ struct clk_divider { | |||
271 | #define CLK_DIVIDER_ONE_BASED BIT(0) | 280 | #define CLK_DIVIDER_ONE_BASED BIT(0) |
272 | #define CLK_DIVIDER_POWER_OF_TWO BIT(1) | 281 | #define CLK_DIVIDER_POWER_OF_TWO BIT(1) |
273 | #define CLK_DIVIDER_ALLOW_ZERO BIT(2) | 282 | #define CLK_DIVIDER_ALLOW_ZERO BIT(2) |
283 | #define CLK_DIVIDER_HIWORD_MASK BIT(3) | ||
274 | 284 | ||
275 | extern const struct clk_ops clk_divider_ops; | 285 | extern const struct clk_ops clk_divider_ops; |
276 | struct clk *clk_register_divider(struct device *dev, const char *name, | 286 | struct clk *clk_register_divider(struct device *dev, const char *name, |
@@ -299,6 +309,10 @@ struct clk *clk_register_divider_table(struct device *dev, const char *name, | |||
299 | * Flags: | 309 | * Flags: |
300 | * CLK_MUX_INDEX_ONE - register index starts at 1, not 0 | 310 | * CLK_MUX_INDEX_ONE - register index starts at 1, not 0 |
301 | * CLK_MUX_INDEX_BIT - register index is a single bit (power of two) | 311 | * CLK_MUX_INDEX_BIT - register index is a single bit (power of two) |
312 | * CLK_MUX_HIWORD_MASK - The mux settings are only in lower 16-bit of this | ||
313 | * register, and mask of mux bits are in higher 16-bit of this register. | ||
314 | * While setting the mux bits, higher 16-bit should also be updated to | ||
315 | * indicate changing mux bits. | ||
302 | */ | 316 | */ |
303 | struct clk_mux { | 317 | struct clk_mux { |
304 | struct clk_hw hw; | 318 | struct clk_hw hw; |
@@ -312,6 +326,7 @@ struct clk_mux { | |||
312 | 326 | ||
313 | #define CLK_MUX_INDEX_ONE BIT(0) | 327 | #define CLK_MUX_INDEX_ONE BIT(0) |
314 | #define CLK_MUX_INDEX_BIT BIT(1) | 328 | #define CLK_MUX_INDEX_BIT BIT(1) |
329 | #define CLK_MUX_HIWORD_MASK BIT(2) | ||
315 | 330 | ||
316 | extern const struct clk_ops clk_mux_ops; | 331 | extern const struct clk_ops clk_mux_ops; |
317 | 332 | ||
@@ -423,6 +438,17 @@ struct of_device_id; | |||
423 | 438 | ||
424 | typedef void (*of_clk_init_cb_t)(struct device_node *); | 439 | typedef void (*of_clk_init_cb_t)(struct device_node *); |
425 | 440 | ||
441 | struct clk_onecell_data { | ||
442 | struct clk **clks; | ||
443 | unsigned int clk_num; | ||
444 | }; | ||
445 | |||
446 | #define CLK_OF_DECLARE(name, compat, fn) \ | ||
447 | static const struct of_device_id __clk_of_table_##name \ | ||
448 | __used __section(__clk_of_table) \ | ||
449 | = { .compatible = compat, .data = fn }; | ||
450 | |||
451 | #ifdef CONFIG_OF | ||
426 | int of_clk_add_provider(struct device_node *np, | 452 | int of_clk_add_provider(struct device_node *np, |
427 | struct clk *(*clk_src_get)(struct of_phandle_args *args, | 453 | struct clk *(*clk_src_get)(struct of_phandle_args *args, |
428 | void *data), | 454 | void *data), |
@@ -430,19 +456,39 @@ int of_clk_add_provider(struct device_node *np, | |||
430 | void of_clk_del_provider(struct device_node *np); | 456 | void of_clk_del_provider(struct device_node *np); |
431 | struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec, | 457 | struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec, |
432 | void *data); | 458 | void *data); |
433 | struct clk_onecell_data { | ||
434 | struct clk **clks; | ||
435 | unsigned int clk_num; | ||
436 | }; | ||
437 | struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data); | 459 | struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data); |
438 | const char *of_clk_get_parent_name(struct device_node *np, int index); | 460 | const char *of_clk_get_parent_name(struct device_node *np, int index); |
439 | 461 | ||
440 | void of_clk_init(const struct of_device_id *matches); | 462 | void of_clk_init(const struct of_device_id *matches); |
441 | 463 | ||
442 | #define CLK_OF_DECLARE(name, compat, fn) \ | 464 | #else /* !CONFIG_OF */ |
443 | static const struct of_device_id __clk_of_table_##name \ | ||
444 | __used __section(__clk_of_table) \ | ||
445 | = { .compatible = compat, .data = fn }; | ||
446 | 465 | ||
466 | static inline int of_clk_add_provider(struct device_node *np, | ||
467 | struct clk *(*clk_src_get)(struct of_phandle_args *args, | ||
468 | void *data), | ||
469 | void *data) | ||
470 | { | ||
471 | return 0; | ||
472 | } | ||
473 | #define of_clk_del_provider(np) \ | ||
474 | { while (0); } | ||
475 | static inline struct clk *of_clk_src_simple_get( | ||
476 | struct of_phandle_args *clkspec, void *data) | ||
477 | { | ||
478 | return ERR_PTR(-ENOENT); | ||
479 | } | ||
480 | static inline struct clk *of_clk_src_onecell_get( | ||
481 | struct of_phandle_args *clkspec, void *data) | ||
482 | { | ||
483 | return ERR_PTR(-ENOENT); | ||
484 | } | ||
485 | static inline const char *of_clk_get_parent_name(struct device_node *np, | ||
486 | int index) | ||
487 | { | ||
488 | return NULL; | ||
489 | } | ||
490 | #define of_clk_init(matches) \ | ||
491 | { while (0); } | ||
492 | #endif /* CONFIG_OF */ | ||
447 | #endif /* CONFIG_COMMON_CLK */ | 493 | #endif /* CONFIG_COMMON_CLK */ |
448 | #endif /* CLK_PROVIDER_H */ | 494 | #endif /* CLK_PROVIDER_H */ |
diff --git a/include/linux/clk/tegra.h b/include/linux/clk/tegra.h index 642789baec74..23a0ceee831f 100644 --- a/include/linux/clk/tegra.h +++ b/include/linux/clk/tegra.h | |||
@@ -120,9 +120,13 @@ static inline void tegra_cpu_clock_resume(void) | |||
120 | } | 120 | } |
121 | #endif | 121 | #endif |
122 | 122 | ||
123 | #ifdef CONFIG_ARCH_TEGRA | ||
123 | void tegra_periph_reset_deassert(struct clk *c); | 124 | void tegra_periph_reset_deassert(struct clk *c); |
124 | void tegra_periph_reset_assert(struct clk *c); | 125 | void tegra_periph_reset_assert(struct clk *c); |
125 | void tegra_clocks_init(void); | 126 | #else |
127 | static inline void tegra_periph_reset_deassert(struct clk *c) {} | ||
128 | static inline void tegra_periph_reset_assert(struct clk *c) {} | ||
129 | #endif | ||
126 | void tegra_clocks_apply_init_table(void); | 130 | void tegra_clocks_apply_init_table(void); |
127 | 131 | ||
128 | #endif /* __LINUX_CLK_TEGRA_H_ */ | 132 | #endif /* __LINUX_CLK_TEGRA_H_ */ |
diff --git a/include/linux/clk/zynq.h b/include/linux/clk/zynq.h index 56be7cd9aa8b..e062d317ccce 100644 --- a/include/linux/clk/zynq.h +++ b/include/linux/clk/zynq.h | |||
@@ -1,4 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2013 Xilinx Inc. | ||
2 | * Copyright (C) 2012 National Instruments | 3 | * Copyright (C) 2012 National Instruments |
3 | * | 4 | * |
4 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
@@ -19,6 +20,11 @@ | |||
19 | #ifndef __LINUX_CLK_ZYNQ_H_ | 20 | #ifndef __LINUX_CLK_ZYNQ_H_ |
20 | #define __LINUX_CLK_ZYNQ_H_ | 21 | #define __LINUX_CLK_ZYNQ_H_ |
21 | 22 | ||
22 | void __init xilinx_zynq_clocks_init(void __iomem *slcr); | 23 | #include <linux/spinlock.h> |
23 | 24 | ||
25 | void zynq_clock_init(void __iomem *slcr); | ||
26 | |||
27 | struct clk *clk_register_zynq_pll(const char *name, const char *parent, | ||
28 | void __iomem *pll_ctrl, void __iomem *pll_status, u8 lock_index, | ||
29 | spinlock_t *lock); | ||
24 | #endif | 30 | #endif |
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index 963d71431388..0857922e8ad0 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h | |||
@@ -30,6 +30,7 @@ enum clock_event_nofitiers { | |||
30 | #include <linux/notifier.h> | 30 | #include <linux/notifier.h> |
31 | 31 | ||
32 | struct clock_event_device; | 32 | struct clock_event_device; |
33 | struct module; | ||
33 | 34 | ||
34 | /* Clock event mode commands */ | 35 | /* Clock event mode commands */ |
35 | enum clock_event_mode { | 36 | enum clock_event_mode { |
@@ -83,6 +84,7 @@ enum clock_event_mode { | |||
83 | * @irq: IRQ number (only for non CPU local devices) | 84 | * @irq: IRQ number (only for non CPU local devices) |
84 | * @cpumask: cpumask to indicate for which CPUs this device works | 85 | * @cpumask: cpumask to indicate for which CPUs this device works |
85 | * @list: list head for the management code | 86 | * @list: list head for the management code |
87 | * @owner: module reference | ||
86 | */ | 88 | */ |
87 | struct clock_event_device { | 89 | struct clock_event_device { |
88 | void (*event_handler)(struct clock_event_device *); | 90 | void (*event_handler)(struct clock_event_device *); |
@@ -112,6 +114,7 @@ struct clock_event_device { | |||
112 | int irq; | 114 | int irq; |
113 | const struct cpumask *cpumask; | 115 | const struct cpumask *cpumask; |
114 | struct list_head list; | 116 | struct list_head list; |
117 | struct module *owner; | ||
115 | } ____cacheline_aligned; | 118 | } ____cacheline_aligned; |
116 | 119 | ||
117 | /* | 120 | /* |
@@ -138,6 +141,7 @@ static inline unsigned long div_sc(unsigned long ticks, unsigned long nsec, | |||
138 | extern u64 clockevent_delta2ns(unsigned long latch, | 141 | extern u64 clockevent_delta2ns(unsigned long latch, |
139 | struct clock_event_device *evt); | 142 | struct clock_event_device *evt); |
140 | extern void clockevents_register_device(struct clock_event_device *dev); | 143 | extern void clockevents_register_device(struct clock_event_device *dev); |
144 | extern int clockevents_unbind_device(struct clock_event_device *ced, int cpu); | ||
141 | 145 | ||
142 | extern void clockevents_config(struct clock_event_device *dev, u32 freq); | 146 | extern void clockevents_config(struct clock_event_device *dev, u32 freq); |
143 | extern void clockevents_config_and_register(struct clock_event_device *dev, | 147 | extern void clockevents_config_and_register(struct clock_event_device *dev, |
@@ -150,7 +154,6 @@ extern void clockevents_exchange_device(struct clock_event_device *old, | |||
150 | struct clock_event_device *new); | 154 | struct clock_event_device *new); |
151 | extern void clockevents_set_mode(struct clock_event_device *dev, | 155 | extern void clockevents_set_mode(struct clock_event_device *dev, |
152 | enum clock_event_mode mode); | 156 | enum clock_event_mode mode); |
153 | extern int clockevents_register_notifier(struct notifier_block *nb); | ||
154 | extern int clockevents_program_event(struct clock_event_device *dev, | 157 | extern int clockevents_program_event(struct clock_event_device *dev, |
155 | ktime_t expires, bool force); | 158 | ktime_t expires, bool force); |
156 | 159 | ||
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 7279b94c01da..dbbf8aa7731b 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
@@ -21,6 +21,7 @@ | |||
21 | /* clocksource cycle base type */ | 21 | /* clocksource cycle base type */ |
22 | typedef u64 cycle_t; | 22 | typedef u64 cycle_t; |
23 | struct clocksource; | 23 | struct clocksource; |
24 | struct module; | ||
24 | 25 | ||
25 | #ifdef CONFIG_ARCH_CLOCKSOURCE_DATA | 26 | #ifdef CONFIG_ARCH_CLOCKSOURCE_DATA |
26 | #include <asm/clocksource.h> | 27 | #include <asm/clocksource.h> |
@@ -162,6 +163,7 @@ extern u64 timecounter_cyc2time(struct timecounter *tc, | |||
162 | * @suspend: suspend function for the clocksource, if necessary | 163 | * @suspend: suspend function for the clocksource, if necessary |
163 | * @resume: resume function for the clocksource, if necessary | 164 | * @resume: resume function for the clocksource, if necessary |
164 | * @cycle_last: most recent cycle counter value seen by ::read() | 165 | * @cycle_last: most recent cycle counter value seen by ::read() |
166 | * @owner: module reference, must be set by clocksource in modules | ||
165 | */ | 167 | */ |
166 | struct clocksource { | 168 | struct clocksource { |
167 | /* | 169 | /* |
@@ -195,6 +197,7 @@ struct clocksource { | |||
195 | cycle_t cs_last; | 197 | cycle_t cs_last; |
196 | cycle_t wd_last; | 198 | cycle_t wd_last; |
197 | #endif | 199 | #endif |
200 | struct module *owner; | ||
198 | } ____cacheline_aligned; | 201 | } ____cacheline_aligned; |
199 | 202 | ||
200 | /* | 203 | /* |
@@ -207,6 +210,7 @@ struct clocksource { | |||
207 | #define CLOCK_SOURCE_VALID_FOR_HRES 0x20 | 210 | #define CLOCK_SOURCE_VALID_FOR_HRES 0x20 |
208 | #define CLOCK_SOURCE_UNSTABLE 0x40 | 211 | #define CLOCK_SOURCE_UNSTABLE 0x40 |
209 | #define CLOCK_SOURCE_SUSPEND_NONSTOP 0x80 | 212 | #define CLOCK_SOURCE_SUSPEND_NONSTOP 0x80 |
213 | #define CLOCK_SOURCE_RESELECT 0x100 | ||
210 | 214 | ||
211 | /* simplify initialization of mask field */ | 215 | /* simplify initialization of mask field */ |
212 | #define CLOCKSOURCE_MASK(bits) (cycle_t)((bits) < 64 ? ((1ULL<<(bits))-1) : -1) | 216 | #define CLOCKSOURCE_MASK(bits) (cycle_t)((bits) < 64 ? ((1ULL<<(bits))-1) : -1) |
@@ -279,7 +283,7 @@ static inline s64 clocksource_cyc2ns(cycle_t cycles, u32 mult, u32 shift) | |||
279 | 283 | ||
280 | 284 | ||
281 | extern int clocksource_register(struct clocksource*); | 285 | extern int clocksource_register(struct clocksource*); |
282 | extern void clocksource_unregister(struct clocksource*); | 286 | extern int clocksource_unregister(struct clocksource*); |
283 | extern void clocksource_touch_watchdog(void); | 287 | extern void clocksource_touch_watchdog(void); |
284 | extern struct clocksource* clocksource_get_next(void); | 288 | extern struct clocksource* clocksource_get_next(void); |
285 | extern void clocksource_change_rating(struct clocksource *cs, int rating); | 289 | extern void clocksource_change_rating(struct clocksource *cs, int rating); |
@@ -321,7 +325,7 @@ static inline void __clocksource_updatefreq_khz(struct clocksource *cs, u32 khz) | |||
321 | } | 325 | } |
322 | 326 | ||
323 | 327 | ||
324 | extern void timekeeping_notify(struct clocksource *clock); | 328 | extern int timekeeping_notify(struct clocksource *clock); |
325 | 329 | ||
326 | extern cycle_t clocksource_mmio_readl_up(struct clocksource *); | 330 | extern cycle_t clocksource_mmio_readl_up(struct clocksource *); |
327 | extern cycle_t clocksource_mmio_readl_down(struct clocksource *); | 331 | extern cycle_t clocksource_mmio_readl_down(struct clocksource *); |
diff --git a/include/linux/completion.h b/include/linux/completion.h index 33f0280fd533..3cd574d5b19e 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h | |||
@@ -5,7 +5,7 @@ | |||
5 | * (C) Copyright 2001 Linus Torvalds | 5 | * (C) Copyright 2001 Linus Torvalds |
6 | * | 6 | * |
7 | * Atomic wait-for-completion handler data structures. | 7 | * Atomic wait-for-completion handler data structures. |
8 | * See kernel/sched.c for details. | 8 | * See kernel/sched/core.c for details. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/wait.h> | 11 | #include <linux/wait.h> |
diff --git a/include/linux/console.h b/include/linux/console.h index 73bab0f58af5..7571a16bd653 100644 --- a/include/linux/console.h +++ b/include/linux/console.h | |||
@@ -75,10 +75,7 @@ extern const struct consw newport_con; /* SGI Newport console */ | |||
75 | extern const struct consw prom_con; /* SPARC PROM console */ | 75 | extern const struct consw prom_con; /* SPARC PROM console */ |
76 | 76 | ||
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); | ||
79 | int unregister_con_driver(const struct consw *csw); | ||
80 | int do_unregister_con_driver(const struct consw *csw); | 78 | int do_unregister_con_driver(const struct consw *csw); |
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); | 79 | int do_take_over_console(const struct consw *sw, int first, int last, int deflt); |
83 | void give_up_console(const struct consw *sw); | 80 | void give_up_console(const struct consw *sw); |
84 | #ifdef CONFIG_HW_CONSOLE | 81 | #ifdef CONFIG_HW_CONSOLE |
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 9f3c7e81270a..ab0eade73039 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -6,9 +6,8 @@ | |||
6 | * definitions of processors. | 6 | * definitions of processors. |
7 | * | 7 | * |
8 | * Basic handling of the devices is done in drivers/base/cpu.c | 8 | * Basic handling of the devices is done in drivers/base/cpu.c |
9 | * and system devices are handled in drivers/base/sys.c. | ||
10 | * | 9 | * |
11 | * CPUs are exported via sysfs in the class/cpu/devices/ | 10 | * CPUs are exported via sysfs in the devices/system/cpu |
12 | * directory. | 11 | * directory. |
13 | */ | 12 | */ |
14 | #ifndef _LINUX_CPU_H_ | 13 | #ifndef _LINUX_CPU_H_ |
@@ -115,7 +114,7 @@ enum { | |||
115 | /* Need to know about CPUs going up/down? */ | 114 | /* Need to know about CPUs going up/down? */ |
116 | #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) | 115 | #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) |
117 | #define cpu_notifier(fn, pri) { \ | 116 | #define cpu_notifier(fn, pri) { \ |
118 | static struct notifier_block fn##_nb __cpuinitdata = \ | 117 | static struct notifier_block fn##_nb = \ |
119 | { .notifier_call = fn, .priority = pri }; \ | 118 | { .notifier_call = fn, .priority = pri }; \ |
120 | register_cpu_notifier(&fn##_nb); \ | 119 | register_cpu_notifier(&fn##_nb); \ |
121 | } | 120 | } |
diff --git a/include/linux/cpu_cooling.h b/include/linux/cpu_cooling.h index 282e27028418..a5d52eea8232 100644 --- a/include/linux/cpu_cooling.h +++ b/include/linux/cpu_cooling.h | |||
@@ -41,7 +41,7 @@ cpufreq_cooling_register(const struct cpumask *clip_cpus); | |||
41 | */ | 41 | */ |
42 | void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev); | 42 | void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev); |
43 | 43 | ||
44 | unsigned long cpufreq_cooling_get_level(unsigned int, unsigned int); | 44 | unsigned long cpufreq_cooling_get_level(unsigned int cpu, unsigned int freq); |
45 | #else /* !CONFIG_CPU_THERMAL */ | 45 | #else /* !CONFIG_CPU_THERMAL */ |
46 | static inline struct thermal_cooling_device * | 46 | static inline struct thermal_cooling_device * |
47 | cpufreq_cooling_register(const struct cpumask *clip_cpus) | 47 | cpufreq_cooling_register(const struct cpumask *clip_cpus) |
@@ -54,7 +54,7 @@ void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) | |||
54 | return; | 54 | return; |
55 | } | 55 | } |
56 | static inline | 56 | static inline |
57 | unsigned long cpufreq_cooling_get_level(unsigned int, unsigned int) | 57 | unsigned long cpufreq_cooling_get_level(unsigned int cpu, unsigned int freq) |
58 | { | 58 | { |
59 | return THERMAL_CSTATE_INVALID; | 59 | return THERMAL_CSTATE_INVALID; |
60 | } | 60 | } |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 037d36ae63e5..90d5a15120d5 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -1,8 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/linux/cpufreq.h | 2 | * linux/include/linux/cpufreq.h |
3 | * | 3 | * |
4 | * Copyright (C) 2001 Russell King | 4 | * Copyright (C) 2001 Russell King |
5 | * (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de> | 5 | * (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de> |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License version 2 as | 8 | * it under the terms of the GNU General Public License version 2 as |
@@ -26,7 +26,6 @@ | |||
26 | /* Print length for names. Extra 1 space for accomodating '\n' in prints */ | 26 | /* Print length for names. Extra 1 space for accomodating '\n' in prints */ |
27 | #define CPUFREQ_NAME_PLEN (CPUFREQ_NAME_LEN + 1) | 27 | #define CPUFREQ_NAME_PLEN (CPUFREQ_NAME_LEN + 1) |
28 | 28 | ||
29 | |||
30 | /********************************************************************* | 29 | /********************************************************************* |
31 | * CPUFREQ NOTIFIER INTERFACE * | 30 | * CPUFREQ NOTIFIER INTERFACE * |
32 | *********************************************************************/ | 31 | *********************************************************************/ |
@@ -71,6 +70,10 @@ struct cpufreq_governor; | |||
71 | 70 | ||
72 | /* /sys/devices/system/cpu/cpufreq: entry point for global variables */ | 71 | /* /sys/devices/system/cpu/cpufreq: entry point for global variables */ |
73 | extern struct kobject *cpufreq_global_kobject; | 72 | extern struct kobject *cpufreq_global_kobject; |
73 | int cpufreq_get_global_kobject(void); | ||
74 | void cpufreq_put_global_kobject(void); | ||
75 | int cpufreq_sysfs_create_file(const struct attribute *attr); | ||
76 | void cpufreq_sysfs_remove_file(const struct attribute *attr); | ||
74 | 77 | ||
75 | #define CPUFREQ_ETERNAL (-1) | 78 | #define CPUFREQ_ETERNAL (-1) |
76 | struct cpufreq_cpuinfo { | 79 | struct cpufreq_cpuinfo { |
@@ -107,6 +110,7 @@ struct cpufreq_policy { | |||
107 | unsigned int policy; /* see above */ | 110 | unsigned int policy; /* see above */ |
108 | struct cpufreq_governor *governor; /* see below */ | 111 | struct cpufreq_governor *governor; /* see below */ |
109 | void *governor_data; | 112 | void *governor_data; |
113 | bool governor_enabled; /* governor start/stop flag */ | ||
110 | 114 | ||
111 | struct work_struct update; /* if update_policy() needs to be | 115 | struct work_struct update; /* if update_policy() needs to be |
112 | * called, but you're in IRQ context */ | 116 | * called, but you're in IRQ context */ |
@@ -115,6 +119,7 @@ struct cpufreq_policy { | |||
115 | 119 | ||
116 | struct kobject kobj; | 120 | struct kobject kobj; |
117 | struct completion kobj_unregister; | 121 | struct completion kobj_unregister; |
122 | int transition_ongoing; /* Tracks transition status */ | ||
118 | }; | 123 | }; |
119 | 124 | ||
120 | #define CPUFREQ_ADJUST (0) | 125 | #define CPUFREQ_ADJUST (0) |
@@ -148,17 +153,18 @@ struct cpufreq_freqs { | |||
148 | u8 flags; /* flags of cpufreq_driver, see below. */ | 153 | u8 flags; /* flags of cpufreq_driver, see below. */ |
149 | }; | 154 | }; |
150 | 155 | ||
151 | |||
152 | /** | 156 | /** |
153 | * cpufreq_scale - "old * mult / div" calculation for large values (32-bit-arch safe) | 157 | * cpufreq_scale - "old * mult / div" calculation for large values (32-bit-arch |
158 | * safe) | ||
154 | * @old: old value | 159 | * @old: old value |
155 | * @div: divisor | 160 | * @div: divisor |
156 | * @mult: multiplier | 161 | * @mult: multiplier |
157 | * | 162 | * |
158 | * | 163 | * |
159 | * new = old * mult / div | 164 | * new = old * mult / div |
160 | */ | 165 | */ |
161 | static inline unsigned long cpufreq_scale(unsigned long old, u_int div, u_int mult) | 166 | static inline unsigned long cpufreq_scale(unsigned long old, u_int div, |
167 | u_int mult) | ||
162 | { | 168 | { |
163 | #if BITS_PER_LONG == 32 | 169 | #if BITS_PER_LONG == 32 |
164 | 170 | ||
@@ -211,14 +217,12 @@ extern int __cpufreq_driver_target(struct cpufreq_policy *policy, | |||
211 | unsigned int target_freq, | 217 | unsigned int target_freq, |
212 | unsigned int relation); | 218 | unsigned int relation); |
213 | 219 | ||
214 | |||
215 | extern int __cpufreq_driver_getavg(struct cpufreq_policy *policy, | 220 | extern int __cpufreq_driver_getavg(struct cpufreq_policy *policy, |
216 | unsigned int cpu); | 221 | unsigned int cpu); |
217 | 222 | ||
218 | int cpufreq_register_governor(struct cpufreq_governor *governor); | 223 | int cpufreq_register_governor(struct cpufreq_governor *governor); |
219 | void cpufreq_unregister_governor(struct cpufreq_governor *governor); | 224 | void cpufreq_unregister_governor(struct cpufreq_governor *governor); |
220 | 225 | ||
221 | |||
222 | /********************************************************************* | 226 | /********************************************************************* |
223 | * CPUFREQ DRIVER INTERFACE * | 227 | * CPUFREQ DRIVER INTERFACE * |
224 | *********************************************************************/ | 228 | *********************************************************************/ |
@@ -229,7 +233,7 @@ void cpufreq_unregister_governor(struct cpufreq_governor *governor); | |||
229 | struct freq_attr; | 233 | struct freq_attr; |
230 | 234 | ||
231 | struct cpufreq_driver { | 235 | struct cpufreq_driver { |
232 | struct module *owner; | 236 | struct module *owner; |
233 | char name[CPUFREQ_NAME_LEN]; | 237 | char name[CPUFREQ_NAME_LEN]; |
234 | u8 flags; | 238 | u8 flags; |
235 | /* | 239 | /* |
@@ -277,11 +281,11 @@ struct cpufreq_driver { | |||
277 | int cpufreq_register_driver(struct cpufreq_driver *driver_data); | 281 | int cpufreq_register_driver(struct cpufreq_driver *driver_data); |
278 | int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); | 282 | int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); |
279 | 283 | ||
280 | |||
281 | void cpufreq_notify_transition(struct cpufreq_policy *policy, | 284 | void cpufreq_notify_transition(struct cpufreq_policy *policy, |
282 | struct cpufreq_freqs *freqs, unsigned int state); | 285 | struct cpufreq_freqs *freqs, unsigned int state); |
283 | 286 | ||
284 | static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy, unsigned int min, unsigned int max) | 287 | static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy, |
288 | unsigned int min, unsigned int max) | ||
285 | { | 289 | { |
286 | if (policy->min < min) | 290 | if (policy->min < min) |
287 | policy->min = min; | 291 | policy->min = min; |
@@ -337,12 +341,16 @@ const char *cpufreq_get_current_driver(void); | |||
337 | /********************************************************************* | 341 | /********************************************************************* |
338 | * CPUFREQ 2.6. INTERFACE * | 342 | * CPUFREQ 2.6. INTERFACE * |
339 | *********************************************************************/ | 343 | *********************************************************************/ |
344 | u64 get_cpu_idle_time(unsigned int cpu, u64 *wall, int io_busy); | ||
340 | int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu); | 345 | int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu); |
341 | int cpufreq_update_policy(unsigned int cpu); | 346 | int cpufreq_update_policy(unsigned int cpu); |
342 | bool have_governor_per_policy(void); | 347 | bool have_governor_per_policy(void); |
348 | struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy); | ||
343 | 349 | ||
344 | #ifdef CONFIG_CPU_FREQ | 350 | #ifdef CONFIG_CPU_FREQ |
345 | /* query the current CPU frequency (in kHz). If zero, cpufreq couldn't detect it */ | 351 | /* |
352 | * query the current CPU frequency (in kHz). If zero, cpufreq couldn't detect it | ||
353 | */ | ||
346 | unsigned int cpufreq_get(unsigned int cpu); | 354 | unsigned int cpufreq_get(unsigned int cpu); |
347 | #else | 355 | #else |
348 | static inline unsigned int cpufreq_get(unsigned int cpu) | 356 | static inline unsigned int cpufreq_get(unsigned int cpu) |
@@ -351,7 +359,9 @@ static inline unsigned int cpufreq_get(unsigned int cpu) | |||
351 | } | 359 | } |
352 | #endif | 360 | #endif |
353 | 361 | ||
354 | /* query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it */ | 362 | /* |
363 | * query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it | ||
364 | */ | ||
355 | #ifdef CONFIG_CPU_FREQ | 365 | #ifdef CONFIG_CPU_FREQ |
356 | unsigned int cpufreq_quick_get(unsigned int cpu); | 366 | unsigned int cpufreq_quick_get(unsigned int cpu); |
357 | unsigned int cpufreq_quick_get_max(unsigned int cpu); | 367 | unsigned int cpufreq_quick_get_max(unsigned int cpu); |
@@ -366,16 +376,14 @@ static inline unsigned int cpufreq_quick_get_max(unsigned int cpu) | |||
366 | } | 376 | } |
367 | #endif | 377 | #endif |
368 | 378 | ||
369 | |||
370 | /********************************************************************* | 379 | /********************************************************************* |
371 | * CPUFREQ DEFAULT GOVERNOR * | 380 | * CPUFREQ DEFAULT GOVERNOR * |
372 | *********************************************************************/ | 381 | *********************************************************************/ |
373 | 382 | ||
374 | |||
375 | /* | 383 | /* |
376 | Performance governor is fallback governor if any other gov failed to | 384 | * Performance governor is fallback governor if any other gov failed to auto |
377 | auto load due latency restrictions | 385 | * load due latency restrictions |
378 | */ | 386 | */ |
379 | #ifdef CONFIG_CPU_FREQ_GOV_PERFORMANCE | 387 | #ifdef CONFIG_CPU_FREQ_GOV_PERFORMANCE |
380 | extern struct cpufreq_governor cpufreq_gov_performance; | 388 | extern struct cpufreq_governor cpufreq_gov_performance; |
381 | #endif | 389 | #endif |
@@ -395,7 +403,6 @@ extern struct cpufreq_governor cpufreq_gov_conservative; | |||
395 | #define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_conservative) | 403 | #define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_conservative) |
396 | #endif | 404 | #endif |
397 | 405 | ||
398 | |||
399 | /********************************************************************* | 406 | /********************************************************************* |
400 | * FREQUENCY TABLE HELPERS * | 407 | * FREQUENCY TABLE HELPERS * |
401 | *********************************************************************/ | 408 | *********************************************************************/ |
@@ -404,7 +411,7 @@ extern struct cpufreq_governor cpufreq_gov_conservative; | |||
404 | #define CPUFREQ_TABLE_END ~1 | 411 | #define CPUFREQ_TABLE_END ~1 |
405 | 412 | ||
406 | struct cpufreq_frequency_table { | 413 | struct cpufreq_frequency_table { |
407 | unsigned int index; /* any */ | 414 | unsigned int driver_data; /* driver specific data, not used by core */ |
408 | unsigned int frequency; /* kHz - doesn't need to be in ascending | 415 | unsigned int frequency; /* kHz - doesn't need to be in ascending |
409 | * order */ | 416 | * order */ |
410 | }; | 417 | }; |
@@ -432,4 +439,7 @@ void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table, | |||
432 | void cpufreq_frequency_table_update_policy_cpu(struct cpufreq_policy *policy); | 439 | void cpufreq_frequency_table_update_policy_cpu(struct cpufreq_policy *policy); |
433 | 440 | ||
434 | void cpufreq_frequency_table_put_attr(unsigned int cpu); | 441 | void cpufreq_frequency_table_put_attr(unsigned int cpu); |
442 | |||
443 | ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf); | ||
444 | |||
435 | #endif /* _LINUX_CPUFREQ_H */ | 445 | #endif /* _LINUX_CPUFREQ_H */ |
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 8f0406230a0a..0bc4b74668e9 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h | |||
@@ -111,6 +111,9 @@ struct cpuidle_driver { | |||
111 | struct cpuidle_state states[CPUIDLE_STATE_MAX]; | 111 | struct cpuidle_state states[CPUIDLE_STATE_MAX]; |
112 | int state_count; | 112 | int state_count; |
113 | int safe_state_index; | 113 | int safe_state_index; |
114 | |||
115 | /* the driver handles the cpus in cpumask */ | ||
116 | struct cpumask *cpumask; | ||
114 | }; | 117 | }; |
115 | 118 | ||
116 | #ifdef CONFIG_CPU_IDLE | 119 | #ifdef CONFIG_CPU_IDLE |
@@ -135,9 +138,6 @@ extern void cpuidle_disable_device(struct cpuidle_device *dev); | |||
135 | extern int cpuidle_play_dead(void); | 138 | extern int cpuidle_play_dead(void); |
136 | 139 | ||
137 | extern struct cpuidle_driver *cpuidle_get_cpu_driver(struct cpuidle_device *dev); | 140 | extern struct cpuidle_driver *cpuidle_get_cpu_driver(struct cpuidle_device *dev); |
138 | extern int cpuidle_register_cpu_driver(struct cpuidle_driver *drv, int cpu); | ||
139 | extern void cpuidle_unregister_cpu_driver(struct cpuidle_driver *drv, int cpu); | ||
140 | |||
141 | #else | 141 | #else |
142 | static inline void disable_cpuidle(void) { } | 142 | static inline void disable_cpuidle(void) { } |
143 | static inline int cpuidle_idle_call(void) { return -ENODEV; } | 143 | static inline int cpuidle_idle_call(void) { return -ENODEV; } |
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 1a6bb81f0fe5..b90337c9d468 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
@@ -146,10 +146,8 @@ enum dentry_d_lock_class | |||
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_weak_revalidate)(struct dentry *, unsigned int); |
149 | int (*d_hash)(const struct dentry *, const struct inode *, | 149 | int (*d_hash)(const struct dentry *, struct qstr *); |
150 | struct qstr *); | 150 | int (*d_compare)(const struct dentry *, const struct dentry *, |
151 | int (*d_compare)(const struct dentry *, const struct inode *, | ||
152 | const struct dentry *, const struct inode *, | ||
153 | unsigned int, const char *, const struct qstr *); | 151 | unsigned int, const char *, const struct qstr *); |
154 | int (*d_delete)(const struct dentry *); | 152 | int (*d_delete)(const struct dentry *); |
155 | void (*d_release)(struct dentry *); | 153 | void (*d_release)(struct dentry *); |
@@ -246,6 +244,8 @@ extern struct dentry * d_make_root(struct inode *); | |||
246 | /* <clickety>-<click> the ramfs-type tree */ | 244 | /* <clickety>-<click> the ramfs-type tree */ |
247 | extern void d_genocide(struct dentry *); | 245 | extern void d_genocide(struct dentry *); |
248 | 246 | ||
247 | extern void d_tmpfile(struct dentry *, struct inode *); | ||
248 | |||
249 | extern struct dentry *d_find_alias(struct inode *); | 249 | extern struct dentry *d_find_alias(struct inode *); |
250 | extern void d_prune_aliases(struct inode *); | 250 | extern void d_prune_aliases(struct inode *); |
251 | 251 | ||
@@ -300,8 +300,7 @@ extern struct dentry *d_lookup(const struct dentry *, const struct qstr *); | |||
300 | extern struct dentry *d_hash_and_lookup(struct dentry *, struct qstr *); | 300 | extern struct dentry *d_hash_and_lookup(struct dentry *, struct qstr *); |
301 | extern struct dentry *__d_lookup(const struct dentry *, const struct qstr *); | 301 | extern struct dentry *__d_lookup(const struct dentry *, const struct qstr *); |
302 | extern struct dentry *__d_lookup_rcu(const struct dentry *parent, | 302 | extern struct dentry *__d_lookup_rcu(const struct dentry *parent, |
303 | const struct qstr *name, | 303 | const struct qstr *name, unsigned *seq); |
304 | unsigned *seq, struct inode *inode); | ||
305 | 304 | ||
306 | /** | 305 | /** |
307 | * __d_rcu_to_refcount - take a refcount on dentry if sequence check is ok | 306 | * __d_rcu_to_refcount - take a refcount on dentry if sequence check is ok |
@@ -325,6 +324,11 @@ static inline int __d_rcu_to_refcount(struct dentry *dentry, unsigned seq) | |||
325 | return ret; | 324 | return ret; |
326 | } | 325 | } |
327 | 326 | ||
327 | static inline unsigned d_count(const struct dentry *dentry) | ||
328 | { | ||
329 | return dentry->d_count; | ||
330 | } | ||
331 | |||
328 | /* validate "insecure" dentry pointer */ | 332 | /* validate "insecure" dentry pointer */ |
329 | extern int d_validate(struct dentry *, struct dentry *); | 333 | extern int d_validate(struct dentry *, struct dentry *); |
330 | 334 | ||
diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h index 21ca773f77bf..822c1354f3a6 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/debugfs.h b/include/linux/debugfs.h index 63f2465807d4..d68b4ea7343c 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h | |||
@@ -79,6 +79,8 @@ struct dentry *debugfs_create_x64(const char *name, umode_t mode, | |||
79 | struct dentry *parent, u64 *value); | 79 | struct dentry *parent, u64 *value); |
80 | struct dentry *debugfs_create_size_t(const char *name, umode_t mode, | 80 | struct dentry *debugfs_create_size_t(const char *name, umode_t mode, |
81 | struct dentry *parent, size_t *value); | 81 | struct dentry *parent, size_t *value); |
82 | struct dentry *debugfs_create_atomic_t(const char *name, umode_t mode, | ||
83 | struct dentry *parent, atomic_t *value); | ||
82 | struct dentry *debugfs_create_bool(const char *name, umode_t mode, | 84 | struct dentry *debugfs_create_bool(const char *name, umode_t mode, |
83 | struct dentry *parent, u32 *value); | 85 | struct dentry *parent, u32 *value); |
84 | 86 | ||
diff --git a/include/linux/decompress/unlz4.h b/include/linux/decompress/unlz4.h new file mode 100644 index 000000000000..d5b68bf3ec92 --- /dev/null +++ b/include/linux/decompress/unlz4.h | |||
@@ -0,0 +1,10 @@ | |||
1 | #ifndef DECOMPRESS_UNLZ4_H | ||
2 | #define DECOMPRESS_UNLZ4_H | ||
3 | |||
4 | int unlz4(unsigned char *inbuf, int len, | ||
5 | int(*fill)(void*, unsigned int), | ||
6 | int(*flush)(void*, unsigned int), | ||
7 | unsigned char *output, | ||
8 | int *pos, | ||
9 | void(*error)(char *x)); | ||
10 | #endif | ||
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h index fe8c4476f7e4..5f1ab92107e6 100644 --- a/include/linux/devfreq.h +++ b/include/linux/devfreq.h | |||
@@ -181,6 +181,8 @@ extern struct devfreq *devfreq_add_device(struct device *dev, | |||
181 | const char *governor_name, | 181 | const char *governor_name, |
182 | void *data); | 182 | void *data); |
183 | extern int devfreq_remove_device(struct devfreq *devfreq); | 183 | extern int devfreq_remove_device(struct devfreq *devfreq); |
184 | |||
185 | /* Supposed to be called by PM_SLEEP/PM_RUNTIME callbacks */ | ||
184 | extern int devfreq_suspend_device(struct devfreq *devfreq); | 186 | extern int devfreq_suspend_device(struct devfreq *devfreq); |
185 | extern int devfreq_resume_device(struct devfreq *devfreq); | 187 | extern int devfreq_resume_device(struct devfreq *devfreq); |
186 | 188 | ||
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 3cd32478f2fd..e151d4c9298d 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -446,9 +446,9 @@ int __must_check dm_set_target_max_io_len(struct dm_target *ti, sector_t len); | |||
446 | /* | 446 | /* |
447 | * Table reference counting. | 447 | * Table reference counting. |
448 | */ | 448 | */ |
449 | struct dm_table *dm_get_live_table(struct mapped_device *md); | 449 | struct dm_table *dm_get_live_table(struct mapped_device *md, int *srcu_idx); |
450 | void dm_table_get(struct dm_table *t); | 450 | void dm_put_live_table(struct mapped_device *md, int srcu_idx); |
451 | void dm_table_put(struct dm_table *t); | 451 | void dm_sync_table(struct mapped_device *md); |
452 | 452 | ||
453 | /* | 453 | /* |
454 | * Queries | 454 | * Queries |
diff --git a/include/linux/device.h b/include/linux/device.h index c0a126125325..22b546a58591 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -47,7 +47,11 @@ struct bus_attribute { | |||
47 | }; | 47 | }; |
48 | 48 | ||
49 | #define BUS_ATTR(_name, _mode, _show, _store) \ | 49 | #define BUS_ATTR(_name, _mode, _show, _store) \ |
50 | struct bus_attribute bus_attr_##_name = __ATTR(_name, _mode, _show, _store) | 50 | struct bus_attribute bus_attr_##_name = __ATTR(_name, _mode, _show, _store) |
51 | #define BUS_ATTR_RW(_name) \ | ||
52 | struct bus_attribute bus_attr_##_name = __ATTR_RW(_name) | ||
53 | #define BUS_ATTR_RO(_name) \ | ||
54 | struct bus_attribute bus_attr_##_name = __ATTR_RO(_name) | ||
51 | 55 | ||
52 | extern int __must_check bus_create_file(struct bus_type *, | 56 | extern int __must_check bus_create_file(struct bus_type *, |
53 | struct bus_attribute *); | 57 | struct bus_attribute *); |
@@ -71,6 +75,10 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *); | |||
71 | * the specific driver's probe to initial the matched device. | 75 | * the specific driver's probe to initial the matched device. |
72 | * @remove: Called when a device removed from this bus. | 76 | * @remove: Called when a device removed from this bus. |
73 | * @shutdown: Called at shut-down time to quiesce the device. | 77 | * @shutdown: Called at shut-down time to quiesce the device. |
78 | * | ||
79 | * @online: Called to put the device back online (after offlining it). | ||
80 | * @offline: Called to put the device offline for hot-removal. May fail. | ||
81 | * | ||
74 | * @suspend: Called when a device on this bus wants to go to sleep mode. | 82 | * @suspend: Called when a device on this bus wants to go to sleep mode. |
75 | * @resume: Called to bring a device on this bus out of sleep mode. | 83 | * @resume: Called to bring a device on this bus out of sleep mode. |
76 | * @pm: Power management operations of this bus, callback the specific | 84 | * @pm: Power management operations of this bus, callback the specific |
@@ -80,6 +88,7 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *); | |||
80 | * bus-specific setup | 88 | * bus-specific setup |
81 | * @p: The private data of the driver core, only the driver core can | 89 | * @p: The private data of the driver core, only the driver core can |
82 | * touch this. | 90 | * touch this. |
91 | * @lock_key: Lock class key for use by the lock validator | ||
83 | * | 92 | * |
84 | * A bus is a channel between the processor and one or more devices. For the | 93 | * A bus is a channel between the processor and one or more devices. For the |
85 | * purposes of the device model, all devices are connected via a bus, even if | 94 | * purposes of the device model, all devices are connected via a bus, even if |
@@ -104,6 +113,9 @@ struct bus_type { | |||
104 | int (*remove)(struct device *dev); | 113 | int (*remove)(struct device *dev); |
105 | void (*shutdown)(struct device *dev); | 114 | void (*shutdown)(struct device *dev); |
106 | 115 | ||
116 | int (*online)(struct device *dev); | ||
117 | int (*offline)(struct device *dev); | ||
118 | |||
107 | int (*suspend)(struct device *dev, pm_message_t state); | 119 | int (*suspend)(struct device *dev, pm_message_t state); |
108 | int (*resume)(struct device *dev); | 120 | int (*resume)(struct device *dev); |
109 | 121 | ||
@@ -253,9 +265,12 @@ struct driver_attribute { | |||
253 | size_t count); | 265 | size_t count); |
254 | }; | 266 | }; |
255 | 267 | ||
256 | #define DRIVER_ATTR(_name, _mode, _show, _store) \ | 268 | #define DRIVER_ATTR(_name, _mode, _show, _store) \ |
257 | struct driver_attribute driver_attr_##_name = \ | 269 | struct driver_attribute driver_attr_##_name = __ATTR(_name, _mode, _show, _store) |
258 | __ATTR(_name, _mode, _show, _store) | 270 | #define DRIVER_ATTR_RW(_name) \ |
271 | struct driver_attribute driver_attr_##_name = __ATTR_RW(_name) | ||
272 | #define DRIVER_ATTR_RO(_name) \ | ||
273 | struct driver_attribute driver_attr_##_name = __ATTR_RO(_name) | ||
259 | 274 | ||
260 | extern int __must_check driver_create_file(struct device_driver *driver, | 275 | extern int __must_check driver_create_file(struct device_driver *driver, |
261 | const struct driver_attribute *attr); | 276 | const struct driver_attribute *attr); |
@@ -305,6 +320,7 @@ int subsys_virtual_register(struct bus_type *subsys, | |||
305 | * @name: Name of the class. | 320 | * @name: Name of the class. |
306 | * @owner: The module owner. | 321 | * @owner: The module owner. |
307 | * @class_attrs: Default attributes of this class. | 322 | * @class_attrs: Default attributes of this class. |
323 | * @dev_groups: Default attributes of the devices that belong to the class. | ||
308 | * @dev_attrs: Default attributes of the devices belong to the class. | 324 | * @dev_attrs: Default attributes of the devices belong to the class. |
309 | * @dev_bin_attrs: Default binary attributes of the devices belong to the class. | 325 | * @dev_bin_attrs: Default binary attributes of the devices belong to the class. |
310 | * @dev_kobj: The kobject that represents this class and links it into the hierarchy. | 326 | * @dev_kobj: The kobject that represents this class and links it into the hierarchy. |
@@ -334,7 +350,8 @@ struct class { | |||
334 | struct module *owner; | 350 | struct module *owner; |
335 | 351 | ||
336 | struct class_attribute *class_attrs; | 352 | struct class_attribute *class_attrs; |
337 | struct device_attribute *dev_attrs; | 353 | struct device_attribute *dev_attrs; /* use dev_groups instead */ |
354 | const struct attribute_group **dev_groups; | ||
338 | struct bin_attribute *dev_bin_attrs; | 355 | struct bin_attribute *dev_bin_attrs; |
339 | struct kobject *dev_kobj; | 356 | struct kobject *dev_kobj; |
340 | 357 | ||
@@ -406,8 +423,12 @@ struct class_attribute { | |||
406 | const struct class_attribute *attr); | 423 | const struct class_attribute *attr); |
407 | }; | 424 | }; |
408 | 425 | ||
409 | #define CLASS_ATTR(_name, _mode, _show, _store) \ | 426 | #define CLASS_ATTR(_name, _mode, _show, _store) \ |
410 | struct class_attribute class_attr_##_name = __ATTR(_name, _mode, _show, _store) | 427 | struct class_attribute class_attr_##_name = __ATTR(_name, _mode, _show, _store) |
428 | #define CLASS_ATTR_RW(_name) \ | ||
429 | struct class_attribute class_attr_##_name = __ATTR_RW(_name) | ||
430 | #define CLASS_ATTR_RO(_name) \ | ||
431 | struct class_attribute class_attr_##_name = __ATTR_RO(_name) | ||
411 | 432 | ||
412 | extern int __must_check class_create_file(struct class *class, | 433 | extern int __must_check class_create_file(struct class *class, |
413 | const struct class_attribute *attr); | 434 | const struct class_attribute *attr); |
@@ -415,7 +436,6 @@ extern void class_remove_file(struct class *class, | |||
415 | const struct class_attribute *attr); | 436 | const struct class_attribute *attr); |
416 | 437 | ||
417 | /* Simple class attribute that is just a static string */ | 438 | /* Simple class attribute that is just a static string */ |
418 | |||
419 | struct class_attribute_string { | 439 | struct class_attribute_string { |
420 | struct class_attribute attr; | 440 | struct class_attribute attr; |
421 | char *str; | 441 | char *str; |
@@ -504,6 +524,10 @@ ssize_t device_store_bool(struct device *dev, struct device_attribute *attr, | |||
504 | 524 | ||
505 | #define DEVICE_ATTR(_name, _mode, _show, _store) \ | 525 | #define DEVICE_ATTR(_name, _mode, _show, _store) \ |
506 | struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store) | 526 | struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store) |
527 | #define DEVICE_ATTR_RW(_name) \ | ||
528 | struct device_attribute dev_attr_##_name = __ATTR_RW(_name) | ||
529 | #define DEVICE_ATTR_RO(_name) \ | ||
530 | struct device_attribute dev_attr_##_name = __ATTR_RO(_name) | ||
507 | #define DEVICE_ULONG_ATTR(_name, _mode, _var) \ | 531 | #define DEVICE_ULONG_ATTR(_name, _mode, _var) \ |
508 | struct dev_ext_attribute dev_attr_##_name = \ | 532 | struct dev_ext_attribute dev_attr_##_name = \ |
509 | { __ATTR(_name, _mode, device_show_ulong, device_store_ulong), &(_var) } | 533 | { __ATTR(_name, _mode, device_show_ulong, device_store_ulong), &(_var) } |
@@ -635,6 +659,7 @@ struct acpi_dev_node { | |||
635 | * segment limitations. | 659 | * segment limitations. |
636 | * @dma_pools: Dma pools (if dma'ble device). | 660 | * @dma_pools: Dma pools (if dma'ble device). |
637 | * @dma_mem: Internal for coherent mem override. | 661 | * @dma_mem: Internal for coherent mem override. |
662 | * @cma_area: Contiguous memory area for dma allocations | ||
638 | * @archdata: For arch-specific additions. | 663 | * @archdata: For arch-specific additions. |
639 | * @of_node: Associated device tree node. | 664 | * @of_node: Associated device tree node. |
640 | * @acpi_node: Associated ACPI device node. | 665 | * @acpi_node: Associated ACPI device node. |
@@ -648,6 +673,10 @@ struct acpi_dev_node { | |||
648 | * @release: Callback to free the device after all references have | 673 | * @release: Callback to free the device after all references have |
649 | * gone away. This should be set by the allocator of the | 674 | * gone away. This should be set by the allocator of the |
650 | * device (i.e. the bus driver that discovered the device). | 675 | * device (i.e. the bus driver that discovered the device). |
676 | * @iommu_group: IOMMU group the device belongs to. | ||
677 | * | ||
678 | * @offline_disabled: If set, the device is permanently online. | ||
679 | * @offline: Set after successful invocation of bus type's .offline(). | ||
651 | * | 680 | * |
652 | * At the lowest level, every device in a Linux system is represented by an | 681 | * At the lowest level, every device in a Linux system is represented by an |
653 | * instance of struct device. The device structure contains the information | 682 | * instance of struct device. The device structure contains the information |
@@ -720,6 +749,9 @@ struct device { | |||
720 | 749 | ||
721 | void (*release)(struct device *dev); | 750 | void (*release)(struct device *dev); |
722 | struct iommu_group *iommu_group; | 751 | struct iommu_group *iommu_group; |
752 | |||
753 | bool offline_disabled:1; | ||
754 | bool offline:1; | ||
723 | }; | 755 | }; |
724 | 756 | ||
725 | static inline struct device *kobj_to_dev(struct kobject *kobj) | 757 | static inline struct device *kobj_to_dev(struct kobject *kobj) |
@@ -856,6 +888,15 @@ extern const char *device_get_devnode(struct device *dev, | |||
856 | extern void *dev_get_drvdata(const struct device *dev); | 888 | extern void *dev_get_drvdata(const struct device *dev); |
857 | extern int dev_set_drvdata(struct device *dev, void *data); | 889 | extern int dev_set_drvdata(struct device *dev, void *data); |
858 | 890 | ||
891 | static inline bool device_supports_offline(struct device *dev) | ||
892 | { | ||
893 | return dev->bus && dev->bus->offline && dev->bus->online; | ||
894 | } | ||
895 | |||
896 | extern void lock_device_hotplug(void); | ||
897 | extern void unlock_device_hotplug(void); | ||
898 | extern int device_offline(struct device *dev); | ||
899 | extern int device_online(struct device *dev); | ||
859 | /* | 900 | /* |
860 | * Root device objects for grouping under /sys/devices | 901 | * Root device objects for grouping under /sys/devices |
861 | */ | 902 | */ |
@@ -899,6 +940,11 @@ extern __printf(5, 6) | |||
899 | struct device *device_create(struct class *cls, struct device *parent, | 940 | struct device *device_create(struct class *cls, struct device *parent, |
900 | dev_t devt, void *drvdata, | 941 | dev_t devt, void *drvdata, |
901 | const char *fmt, ...); | 942 | const char *fmt, ...); |
943 | extern __printf(6, 7) | ||
944 | struct device *device_create_with_groups(struct class *cls, | ||
945 | struct device *parent, dev_t devt, void *drvdata, | ||
946 | const struct attribute_group **groups, | ||
947 | const char *fmt, ...); | ||
902 | extern void device_destroy(struct class *cls, dev_t devt); | 948 | extern void device_destroy(struct class *cls, dev_t devt); |
903 | 949 | ||
904 | /* | 950 | /* |
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 96d3e4ab11a9..cb286b1acdb6 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -66,7 +66,6 @@ enum dma_transaction_type { | |||
66 | DMA_PQ, | 66 | DMA_PQ, |
67 | DMA_XOR_VAL, | 67 | DMA_XOR_VAL, |
68 | DMA_PQ_VAL, | 68 | DMA_PQ_VAL, |
69 | DMA_MEMSET, | ||
70 | DMA_INTERRUPT, | 69 | DMA_INTERRUPT, |
71 | DMA_SG, | 70 | DMA_SG, |
72 | DMA_PRIVATE, | 71 | DMA_PRIVATE, |
@@ -520,7 +519,6 @@ struct dma_tx_state { | |||
520 | * @device_prep_dma_xor_val: prepares a xor validation operation | 519 | * @device_prep_dma_xor_val: prepares a xor validation operation |
521 | * @device_prep_dma_pq: prepares a pq operation | 520 | * @device_prep_dma_pq: prepares a pq operation |
522 | * @device_prep_dma_pq_val: prepares a pqzero_sum operation | 521 | * @device_prep_dma_pq_val: prepares a pqzero_sum operation |
523 | * @device_prep_dma_memset: prepares a memset operation | ||
524 | * @device_prep_dma_interrupt: prepares an end of chain interrupt operation | 522 | * @device_prep_dma_interrupt: prepares an end of chain interrupt operation |
525 | * @device_prep_slave_sg: prepares a slave dma operation | 523 | * @device_prep_slave_sg: prepares a slave dma operation |
526 | * @device_prep_dma_cyclic: prepare a cyclic dma operation suitable for audio. | 524 | * @device_prep_dma_cyclic: prepare a cyclic dma operation suitable for audio. |
@@ -573,9 +571,6 @@ struct dma_device { | |||
573 | struct dma_chan *chan, dma_addr_t *pq, dma_addr_t *src, | 571 | struct dma_chan *chan, dma_addr_t *pq, dma_addr_t *src, |
574 | unsigned int src_cnt, const unsigned char *scf, size_t len, | 572 | unsigned int src_cnt, const unsigned char *scf, size_t len, |
575 | enum sum_check_flags *pqres, unsigned long flags); | 573 | enum sum_check_flags *pqres, unsigned long flags); |
576 | struct dma_async_tx_descriptor *(*device_prep_dma_memset)( | ||
577 | struct dma_chan *chan, dma_addr_t dest, int value, size_t len, | ||
578 | unsigned long flags); | ||
579 | struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)( | 574 | struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)( |
580 | struct dma_chan *chan, unsigned long flags); | 575 | struct dma_chan *chan, unsigned long flags); |
581 | struct dma_async_tx_descriptor *(*device_prep_dma_sg)( | 576 | struct dma_async_tx_descriptor *(*device_prep_dma_sg)( |
diff --git a/include/linux/drbd.h b/include/linux/drbd.h index 1b4d4ee1168f..de7d74ab3de6 100644 --- a/include/linux/drbd.h +++ b/include/linux/drbd.h | |||
@@ -177,7 +177,11 @@ enum drbd_ret_code { | |||
177 | ERR_NEED_APV_100 = 163, | 177 | ERR_NEED_APV_100 = 163, |
178 | ERR_NEED_ALLOW_TWO_PRI = 164, | 178 | ERR_NEED_ALLOW_TWO_PRI = 164, |
179 | ERR_MD_UNCLEAN = 165, | 179 | ERR_MD_UNCLEAN = 165, |
180 | 180 | ERR_MD_LAYOUT_CONNECTED = 166, | |
181 | ERR_MD_LAYOUT_TOO_BIG = 167, | ||
182 | ERR_MD_LAYOUT_TOO_SMALL = 168, | ||
183 | ERR_MD_LAYOUT_NO_FIT = 169, | ||
184 | ERR_IMPLICIT_SHRINK = 170, | ||
181 | /* insert new ones above this line */ | 185 | /* insert new ones above this line */ |
182 | AFTER_LAST_ERR_CODE | 186 | AFTER_LAST_ERR_CODE |
183 | }; | 187 | }; |
diff --git a/include/linux/drbd_genl.h b/include/linux/drbd_genl.h index d0d8fac8a6e4..e8c44572b8cb 100644 --- a/include/linux/drbd_genl.h +++ b/include/linux/drbd_genl.h | |||
@@ -181,6 +181,8 @@ GENL_struct(DRBD_NLA_RESIZE_PARMS, 7, resize_parms, | |||
181 | __u64_field(1, DRBD_GENLA_F_MANDATORY, resize_size) | 181 | __u64_field(1, DRBD_GENLA_F_MANDATORY, resize_size) |
182 | __flg_field(2, DRBD_GENLA_F_MANDATORY, resize_force) | 182 | __flg_field(2, DRBD_GENLA_F_MANDATORY, resize_force) |
183 | __flg_field(3, DRBD_GENLA_F_MANDATORY, no_resync) | 183 | __flg_field(3, DRBD_GENLA_F_MANDATORY, no_resync) |
184 | __u32_field_def(4, 0 /* OPTIONAL */, al_stripes, DRBD_AL_STRIPES_DEF) | ||
185 | __u32_field_def(5, 0 /* OPTIONAL */, al_stripe_size, DRBD_AL_STRIPE_SIZE_DEF) | ||
184 | ) | 186 | ) |
185 | 187 | ||
186 | GENL_struct(DRBD_NLA_STATE_INFO, 8, state_info, | 188 | GENL_struct(DRBD_NLA_STATE_INFO, 8, state_info, |
diff --git a/include/linux/drbd_limits.h b/include/linux/drbd_limits.h index 1fedf2b17cc8..17e50bb00521 100644 --- a/include/linux/drbd_limits.h +++ b/include/linux/drbd_limits.h | |||
@@ -215,4 +215,13 @@ | |||
215 | #define DRBD_ALWAYS_ASBP_DEF 0 | 215 | #define DRBD_ALWAYS_ASBP_DEF 0 |
216 | #define DRBD_USE_RLE_DEF 1 | 216 | #define DRBD_USE_RLE_DEF 1 |
217 | 217 | ||
218 | #define DRBD_AL_STRIPES_MIN 1 | ||
219 | #define DRBD_AL_STRIPES_MAX 1024 | ||
220 | #define DRBD_AL_STRIPES_DEF 1 | ||
221 | #define DRBD_AL_STRIPES_SCALE '1' | ||
222 | |||
223 | #define DRBD_AL_STRIPE_SIZE_MIN 4 | ||
224 | #define DRBD_AL_STRIPE_SIZE_MAX 16777216 | ||
225 | #define DRBD_AL_STRIPE_SIZE_DEF 32 | ||
226 | #define DRBD_AL_STRIPE_SIZE_SCALE 'k' /* kilobytes */ | ||
218 | #endif | 227 | #endif |
diff --git a/include/linux/dw_apb_timer.h b/include/linux/dw_apb_timer.h index dd755ce2a5eb..1f79b20918b1 100644 --- a/include/linux/dw_apb_timer.h +++ b/include/linux/dw_apb_timer.h | |||
@@ -51,7 +51,5 @@ dw_apb_clocksource_init(unsigned rating, const char *name, void __iomem *base, | |||
51 | void dw_apb_clocksource_register(struct dw_apb_clocksource *dw_cs); | 51 | void dw_apb_clocksource_register(struct dw_apb_clocksource *dw_cs); |
52 | void dw_apb_clocksource_start(struct dw_apb_clocksource *dw_cs); | 52 | void dw_apb_clocksource_start(struct dw_apb_clocksource *dw_cs); |
53 | cycle_t dw_apb_clocksource_read(struct dw_apb_clocksource *dw_cs); | 53 | cycle_t dw_apb_clocksource_read(struct dw_apb_clocksource *dw_cs); |
54 | void dw_apb_clocksource_unregister(struct dw_apb_clocksource *dw_cs); | ||
55 | 54 | ||
56 | extern void dw_apb_timer_init(void); | ||
57 | #endif /* __DW_APB_TIMER_H__ */ | 55 | #endif /* __DW_APB_TIMER_H__ */ |
diff --git a/include/linux/edac.h b/include/linux/edac.h index 0b763276f619..5c6d7fbaf89e 100644 --- a/include/linux/edac.h +++ b/include/linux/edac.h | |||
@@ -622,7 +622,7 @@ struct edac_raw_error_desc { | |||
622 | */ | 622 | */ |
623 | struct mem_ctl_info { | 623 | struct mem_ctl_info { |
624 | struct device dev; | 624 | struct device dev; |
625 | struct bus_type bus; | 625 | struct bus_type *bus; |
626 | 626 | ||
627 | struct list_head link; /* for global list of mem_ctl_info structs */ | 627 | struct list_head link; /* for global list of mem_ctl_info structs */ |
628 | 628 | ||
@@ -742,4 +742,9 @@ struct mem_ctl_info { | |||
742 | #endif | 742 | #endif |
743 | }; | 743 | }; |
744 | 744 | ||
745 | /* | ||
746 | * Maximum number of memory controllers in the coherent fabric. | ||
747 | */ | ||
748 | #define EDAC_MAX_MCS 16 | ||
749 | |||
745 | #endif | 750 | #endif |
diff --git a/include/linux/efi.h b/include/linux/efi.h index 2bc0ad78d058..5f8f176154f7 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
@@ -287,20 +287,20 @@ typedef struct { | |||
287 | 287 | ||
288 | typedef struct { | 288 | typedef struct { |
289 | efi_table_hdr_t hdr; | 289 | efi_table_hdr_t hdr; |
290 | unsigned long get_time; | 290 | void *get_time; |
291 | unsigned long set_time; | 291 | void *set_time; |
292 | unsigned long get_wakeup_time; | 292 | void *get_wakeup_time; |
293 | unsigned long set_wakeup_time; | 293 | void *set_wakeup_time; |
294 | unsigned long set_virtual_address_map; | 294 | void *set_virtual_address_map; |
295 | unsigned long convert_pointer; | 295 | void *convert_pointer; |
296 | unsigned long get_variable; | 296 | void *get_variable; |
297 | unsigned long get_next_variable; | 297 | void *get_next_variable; |
298 | unsigned long set_variable; | 298 | void *set_variable; |
299 | unsigned long get_next_high_mono_count; | 299 | void *get_next_high_mono_count; |
300 | unsigned long reset_system; | 300 | void *reset_system; |
301 | unsigned long update_capsule; | 301 | void *update_capsule; |
302 | unsigned long query_capsule_caps; | 302 | void *query_capsule_caps; |
303 | unsigned long query_variable_info; | 303 | void *query_variable_info; |
304 | } efi_runtime_services_t; | 304 | } efi_runtime_services_t; |
305 | 305 | ||
306 | typedef efi_status_t efi_get_time_t (efi_time_t *tm, efi_time_cap_t *tc); | 306 | typedef efi_status_t efi_get_time_t (efi_time_t *tm, efi_time_cap_t *tc); |
@@ -594,8 +594,8 @@ extern u64 efi_mem_attribute (unsigned long phys_addr, unsigned long size); | |||
594 | extern int __init efi_uart_console_only (void); | 594 | extern int __init efi_uart_console_only (void); |
595 | extern void efi_initialize_iomem_resources(struct resource *code_resource, | 595 | extern void efi_initialize_iomem_resources(struct resource *code_resource, |
596 | struct resource *data_resource, struct resource *bss_resource); | 596 | struct resource *data_resource, struct resource *bss_resource); |
597 | extern unsigned long efi_get_time(void); | 597 | extern void efi_get_time(struct timespec *now); |
598 | extern int efi_set_rtc_mmss(unsigned long nowtime); | 598 | extern int efi_set_rtc_mmss(const struct timespec *now); |
599 | extern void efi_reserve_boot_services(void); | 599 | extern void efi_reserve_boot_services(void); |
600 | extern struct efi_memory_map memmap; | 600 | extern struct efi_memory_map memmap; |
601 | 601 | ||
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index acd0312d46fb..306dd8cd0b6f 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #ifdef CONFIG_BLOCK | 7 | #ifdef CONFIG_BLOCK |
8 | 8 | ||
9 | struct io_cq; | 9 | struct io_cq; |
10 | struct elevator_type; | ||
10 | 11 | ||
11 | typedef int (elevator_merge_fn) (struct request_queue *, struct request **, | 12 | typedef int (elevator_merge_fn) (struct request_queue *, struct request **, |
12 | struct bio *); | 13 | struct bio *); |
@@ -35,7 +36,8 @@ typedef void (elevator_put_req_fn) (struct request *); | |||
35 | typedef void (elevator_activate_req_fn) (struct request_queue *, struct request *); | 36 | typedef void (elevator_activate_req_fn) (struct request_queue *, struct request *); |
36 | typedef void (elevator_deactivate_req_fn) (struct request_queue *, struct request *); | 37 | typedef void (elevator_deactivate_req_fn) (struct request_queue *, struct request *); |
37 | 38 | ||
38 | typedef int (elevator_init_fn) (struct request_queue *); | 39 | typedef int (elevator_init_fn) (struct request_queue *, |
40 | struct elevator_type *e); | ||
39 | typedef void (elevator_exit_fn) (struct elevator_queue *); | 41 | typedef void (elevator_exit_fn) (struct elevator_queue *); |
40 | 42 | ||
41 | struct elevator_ops | 43 | struct elevator_ops |
@@ -155,6 +157,8 @@ extern int elevator_init(struct request_queue *, char *); | |||
155 | extern void elevator_exit(struct elevator_queue *); | 157 | extern void elevator_exit(struct elevator_queue *); |
156 | extern int elevator_change(struct request_queue *, const char *); | 158 | extern int elevator_change(struct request_queue *, const char *); |
157 | extern bool elv_rq_merge_ok(struct request *, struct bio *); | 159 | extern bool elv_rq_merge_ok(struct request *, struct bio *); |
160 | extern struct elevator_queue *elevator_alloc(struct request_queue *, | ||
161 | struct elevator_type *); | ||
158 | 162 | ||
159 | /* | 163 | /* |
160 | * Helper functions. | 164 | * Helper functions. |
diff --git a/include/linux/err.h b/include/linux/err.h index f2edce25a76b..221fcfb676c4 100644 --- a/include/linux/err.h +++ b/include/linux/err.h | |||
@@ -24,17 +24,17 @@ static inline void * __must_check ERR_PTR(long error) | |||
24 | return (void *) error; | 24 | return (void *) error; |
25 | } | 25 | } |
26 | 26 | ||
27 | static inline long __must_check PTR_ERR(const void *ptr) | 27 | static inline long __must_check PTR_ERR(__force const void *ptr) |
28 | { | 28 | { |
29 | return (long) ptr; | 29 | return (long) ptr; |
30 | } | 30 | } |
31 | 31 | ||
32 | static inline long __must_check IS_ERR(const void *ptr) | 32 | static inline long __must_check IS_ERR(__force const void *ptr) |
33 | { | 33 | { |
34 | return IS_ERR_VALUE((unsigned long)ptr); | 34 | return IS_ERR_VALUE((unsigned long)ptr); |
35 | } | 35 | } |
36 | 36 | ||
37 | static inline long __must_check IS_ERR_OR_NULL(const void *ptr) | 37 | static inline long __must_check IS_ERR_OR_NULL(__force const void *ptr) |
38 | { | 38 | { |
39 | return !ptr || IS_ERR_VALUE((unsigned long)ptr); | 39 | return !ptr || IS_ERR_VALUE((unsigned long)ptr); |
40 | } | 40 | } |
@@ -46,13 +46,13 @@ static inline long __must_check IS_ERR_OR_NULL(const void *ptr) | |||
46 | * Explicitly cast an error-valued pointer to another pointer type in such a | 46 | * Explicitly cast an error-valued pointer to another pointer type in such a |
47 | * way as to make it clear that's what's going on. | 47 | * way as to make it clear that's what's going on. |
48 | */ | 48 | */ |
49 | static inline void * __must_check ERR_CAST(const void *ptr) | 49 | static inline void * __must_check ERR_CAST(__force const void *ptr) |
50 | { | 50 | { |
51 | /* cast away the const */ | 51 | /* cast away the const */ |
52 | return (void *) ptr; | 52 | return (void *) ptr; |
53 | } | 53 | } |
54 | 54 | ||
55 | static inline int __must_check PTR_RET(const void *ptr) | 55 | static inline int __must_check PTR_RET(__force const void *ptr) |
56 | { | 56 | { |
57 | if (IS_ERR(ptr)) | 57 | if (IS_ERR(ptr)) |
58 | return PTR_ERR(ptr); | 58 | return PTR_ERR(ptr); |
diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h index df6fab82f87e..383d5e39b280 100644 --- a/include/linux/f2fs_fs.h +++ b/include/linux/f2fs_fs.h | |||
@@ -20,8 +20,8 @@ | |||
20 | #define F2FS_BLKSIZE 4096 /* support only 4KB block */ | 20 | #define F2FS_BLKSIZE 4096 /* support only 4KB block */ |
21 | #define F2FS_MAX_EXTENSION 64 /* # of extension entries */ | 21 | #define F2FS_MAX_EXTENSION 64 /* # of extension entries */ |
22 | 22 | ||
23 | #define NULL_ADDR 0x0U | 23 | #define NULL_ADDR ((block_t)0) /* used as block_t addresses */ |
24 | #define NEW_ADDR -1U | 24 | #define NEW_ADDR ((block_t)-1) /* used as block_t addresses */ |
25 | 25 | ||
26 | #define F2FS_ROOT_INO(sbi) (sbi->root_ino_num) | 26 | #define F2FS_ROOT_INO(sbi) (sbi->root_ino_num) |
27 | #define F2FS_NODE_INO(sbi) (sbi->node_ino_num) | 27 | #define F2FS_NODE_INO(sbi) (sbi->node_ino_num) |
diff --git a/include/linux/fb.h b/include/linux/fb.h index d49c60f5aa4c..ffac70aab3e9 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -624,7 +624,7 @@ extern void fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, u3 | |||
624 | extern void fb_set_suspend(struct fb_info *info, int state); | 624 | extern void fb_set_suspend(struct fb_info *info, int state); |
625 | extern int fb_get_color_depth(struct fb_var_screeninfo *var, | 625 | extern int fb_get_color_depth(struct fb_var_screeninfo *var, |
626 | struct fb_fix_screeninfo *fix); | 626 | struct fb_fix_screeninfo *fix); |
627 | extern int fb_get_options(char *name, char **option); | 627 | extern int fb_get_options(const char *name, char **option); |
628 | extern int fb_new_modelist(struct fb_info *info); | 628 | extern int fb_new_modelist(struct fb_info *info); |
629 | 629 | ||
630 | extern struct fb_info *registered_fb[FB_MAX]; | 630 | extern struct fb_info *registered_fb[FB_MAX]; |
diff --git a/include/linux/filter.h b/include/linux/filter.h index f65f5a69db8f..a6ac84871d6d 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
@@ -59,10 +59,10 @@ extern void bpf_jit_free(struct sk_filter *fp); | |||
59 | static inline void bpf_jit_dump(unsigned int flen, unsigned int proglen, | 59 | static inline void bpf_jit_dump(unsigned int flen, unsigned int proglen, |
60 | u32 pass, void *image) | 60 | u32 pass, void *image) |
61 | { | 61 | { |
62 | pr_err("flen=%u proglen=%u pass=%u image=%p\n", | 62 | pr_err("flen=%u proglen=%u pass=%u image=%pK\n", |
63 | flen, proglen, pass, image); | 63 | flen, proglen, pass, image); |
64 | if (image) | 64 | if (image) |
65 | print_hex_dump(KERN_ERR, "JIT code: ", DUMP_PREFIX_ADDRESS, | 65 | print_hex_dump(KERN_ERR, "JIT code: ", DUMP_PREFIX_OFFSET, |
66 | 16, 1, image, proglen, false); | 66 | 16, 1, image, proglen, false); |
67 | } | 67 | } |
68 | #define SK_RUN_FILTER(FILTER, SKB) (*FILTER->bpf_func)(SKB, FILTER->insns) | 68 | #define SK_RUN_FILTER(FILTER, SKB) (*FILTER->bpf_func)(SKB, FILTER->insns) |
diff --git a/include/linux/firewire.h b/include/linux/firewire.h index 191501afd7fb..5d7782e42b8f 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h | |||
@@ -251,8 +251,10 @@ struct ieee1394_device_id; | |||
251 | 251 | ||
252 | struct fw_driver { | 252 | struct fw_driver { |
253 | struct device_driver driver; | 253 | struct device_driver driver; |
254 | int (*probe)(struct fw_unit *unit, const struct ieee1394_device_id *id); | ||
254 | /* Called when the parent device sits through a bus reset. */ | 255 | /* Called when the parent device sits through a bus reset. */ |
255 | void (*update)(struct fw_unit *unit); | 256 | void (*update)(struct fw_unit *unit); |
257 | void (*remove)(struct fw_unit *unit); | ||
256 | const struct ieee1394_device_id *id_table; | 258 | const struct ieee1394_device_id *id_table; |
257 | }; | 259 | }; |
258 | 260 | ||
@@ -434,6 +436,7 @@ struct fw_iso_context { | |||
434 | int type; | 436 | int type; |
435 | int channel; | 437 | int channel; |
436 | int speed; | 438 | int speed; |
439 | bool drop_overflow_headers; | ||
437 | size_t header_size; | 440 | size_t header_size; |
438 | union { | 441 | union { |
439 | fw_iso_callback_t sc; | 442 | fw_iso_callback_t sc; |
diff --git a/include/linux/firmware.h b/include/linux/firmware.h index e4279fedb93a..e154c1005cd1 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h | |||
@@ -47,8 +47,6 @@ int request_firmware_nowait( | |||
47 | void (*cont)(const struct firmware *fw, void *context)); | 47 | void (*cont)(const struct firmware *fw, void *context)); |
48 | 48 | ||
49 | void release_firmware(const struct firmware *fw); | 49 | void release_firmware(const struct firmware *fw); |
50 | int cache_firmware(const char *name); | ||
51 | int uncache_firmware(const char *name); | ||
52 | #else | 50 | #else |
53 | static inline int request_firmware(const struct firmware **fw, | 51 | static inline int request_firmware(const struct firmware **fw, |
54 | const char *name, | 52 | const char *name, |
@@ -68,15 +66,6 @@ static inline void release_firmware(const struct firmware *fw) | |||
68 | { | 66 | { |
69 | } | 67 | } |
70 | 68 | ||
71 | static inline int cache_firmware(const char *name) | ||
72 | { | ||
73 | return -ENOENT; | ||
74 | } | ||
75 | |||
76 | static inline int uncache_firmware(const char *name) | ||
77 | { | ||
78 | return -EINVAL; | ||
79 | } | ||
80 | #endif | 69 | #endif |
81 | 70 | ||
82 | #endif | 71 | #endif |
diff --git a/include/linux/fmc-sdb.h b/include/linux/fmc-sdb.h new file mode 100644 index 000000000000..1974317a9b3d --- /dev/null +++ b/include/linux/fmc-sdb.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * This file is separate from sdb.h, because I want that one to remain | ||
3 | * unchanged (as far as possible) from the official sdb distribution | ||
4 | * | ||
5 | * This file and associated functionality are a playground for me to | ||
6 | * understand stuff which will later be implemented in more generic places. | ||
7 | */ | ||
8 | #include <linux/sdb.h> | ||
9 | |||
10 | /* This is the union of all currently defined types */ | ||
11 | union sdb_record { | ||
12 | struct sdb_interconnect ic; | ||
13 | struct sdb_device dev; | ||
14 | struct sdb_bridge bridge; | ||
15 | struct sdb_integration integr; | ||
16 | struct sdb_empty empty; | ||
17 | }; | ||
18 | |||
19 | struct fmc_device; | ||
20 | |||
21 | /* Every sdb table is turned into this structure */ | ||
22 | struct sdb_array { | ||
23 | int len; | ||
24 | int level; | ||
25 | unsigned long baseaddr; | ||
26 | struct fmc_device *fmc; /* the device that hosts it */ | ||
27 | struct sdb_array *parent; /* NULL at root */ | ||
28 | union sdb_record *record; /* copies of the struct */ | ||
29 | struct sdb_array **subtree; /* only valid for bridge items */ | ||
30 | }; | ||
31 | |||
32 | extern int fmc_scan_sdb_tree(struct fmc_device *fmc, unsigned long address); | ||
33 | extern void fmc_show_sdb_tree(const struct fmc_device *fmc); | ||
34 | extern signed long fmc_find_sdb_device(struct sdb_array *tree, uint64_t vendor, | ||
35 | uint32_t device, unsigned long *sz); | ||
36 | extern int fmc_free_sdb_tree(struct fmc_device *fmc); | ||
diff --git a/include/linux/fmc.h b/include/linux/fmc.h new file mode 100644 index 000000000000..a5f0aa5c2a8d --- /dev/null +++ b/include/linux/fmc.h | |||
@@ -0,0 +1,237 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2012 CERN (www.cern.ch) | ||
3 | * Author: Alessandro Rubini <rubini@gnudd.com> | ||
4 | * | ||
5 | * Released according to the GNU GPL, version 2 or any later version. | ||
6 | * | ||
7 | * This work is part of the White Rabbit project, a research effort led | ||
8 | * by CERN, the European Institute for Nuclear Research. | ||
9 | */ | ||
10 | #ifndef __LINUX_FMC_H__ | ||
11 | #define __LINUX_FMC_H__ | ||
12 | #include <linux/types.h> | ||
13 | #include <linux/moduleparam.h> | ||
14 | #include <linux/device.h> | ||
15 | #include <linux/list.h> | ||
16 | #include <linux/interrupt.h> | ||
17 | #include <linux/io.h> | ||
18 | |||
19 | struct fmc_device; | ||
20 | struct fmc_driver; | ||
21 | |||
22 | /* | ||
23 | * This bus abstraction is developed separately from drivers, so we need | ||
24 | * to check the version of the data structures we receive. | ||
25 | */ | ||
26 | |||
27 | #define FMC_MAJOR 3 | ||
28 | #define FMC_MINOR 0 | ||
29 | #define FMC_VERSION ((FMC_MAJOR << 16) | FMC_MINOR) | ||
30 | #define __FMC_MAJOR(x) ((x) >> 16) | ||
31 | #define __FMC_MINOR(x) ((x) & 0xffff) | ||
32 | |||
33 | /* | ||
34 | * The device identification, as defined by the IPMI FRU (Field Replaceable | ||
35 | * Unit) includes four different strings to describe the device. Here we | ||
36 | * only match the "Board Manufacturer" and the "Board Product Name", | ||
37 | * ignoring the "Board Serial Number" and "Board Part Number". All 4 are | ||
38 | * expected to be strings, so they are treated as zero-terminated C strings. | ||
39 | * Unspecified string (NULL) means "any", so if both are unspecified this | ||
40 | * is a catch-all driver. So null entries are allowed and we use array | ||
41 | * and length. This is unlike pci and usb that use null-terminated arrays | ||
42 | */ | ||
43 | struct fmc_fru_id { | ||
44 | char *manufacturer; | ||
45 | char *product_name; | ||
46 | }; | ||
47 | |||
48 | /* | ||
49 | * If the FPGA is already programmed (think Etherbone or the second | ||
50 | * SVEC slot), we can match on SDB devices in the memory image. This | ||
51 | * match uses an array of devices that must all be present, and the | ||
52 | * match is based on vendor and device only. Further checks are expected | ||
53 | * to happen in the probe function. Zero means "any" and catch-all is allowed. | ||
54 | */ | ||
55 | struct fmc_sdb_one_id { | ||
56 | uint64_t vendor; | ||
57 | uint32_t device; | ||
58 | }; | ||
59 | struct fmc_sdb_id { | ||
60 | struct fmc_sdb_one_id *cores; | ||
61 | int cores_nr; | ||
62 | }; | ||
63 | |||
64 | struct fmc_device_id { | ||
65 | struct fmc_fru_id *fru_id; | ||
66 | int fru_id_nr; | ||
67 | struct fmc_sdb_id *sdb_id; | ||
68 | int sdb_id_nr; | ||
69 | }; | ||
70 | |||
71 | /* This sizes the module_param_array used by generic module parameters */ | ||
72 | #define FMC_MAX_CARDS 32 | ||
73 | |||
74 | /* The driver is a pretty simple thing */ | ||
75 | struct fmc_driver { | ||
76 | unsigned long version; | ||
77 | struct device_driver driver; | ||
78 | int (*probe)(struct fmc_device *); | ||
79 | int (*remove)(struct fmc_device *); | ||
80 | const struct fmc_device_id id_table; | ||
81 | /* What follows is for generic module parameters */ | ||
82 | int busid_n; | ||
83 | int busid_val[FMC_MAX_CARDS]; | ||
84 | int gw_n; | ||
85 | char *gw_val[FMC_MAX_CARDS]; | ||
86 | }; | ||
87 | #define to_fmc_driver(x) container_of((x), struct fmc_driver, driver) | ||
88 | |||
89 | /* These are the generic parameters, that drivers may instantiate */ | ||
90 | #define FMC_PARAM_BUSID(_d) \ | ||
91 | module_param_array_named(busid, _d.busid_val, int, &_d.busid_n, 0444) | ||
92 | #define FMC_PARAM_GATEWARE(_d) \ | ||
93 | module_param_array_named(gateware, _d.gw_val, charp, &_d.gw_n, 0444) | ||
94 | |||
95 | /* | ||
96 | * Drivers may need to configure gpio pins in the carrier. To read input | ||
97 | * (a very uncommon operation, and definitely not in the hot paths), just | ||
98 | * configure one gpio only and get 0 or 1 as retval of the config method | ||
99 | */ | ||
100 | struct fmc_gpio { | ||
101 | char *carrier_name; /* name or NULL for virtual pins */ | ||
102 | int gpio; | ||
103 | int _gpio; /* internal use by the carrier */ | ||
104 | int mode; /* GPIOF_DIR_OUT etc, from <linux/gpio.h> */ | ||
105 | int irqmode; /* IRQF_TRIGGER_LOW and so on */ | ||
106 | }; | ||
107 | |||
108 | /* The numbering of gpio pins allows access to raw pins or virtual roles */ | ||
109 | #define FMC_GPIO_RAW(x) (x) /* 4096 of them */ | ||
110 | #define __FMC_GPIO_IS_RAW(x) ((x) < 0x1000) | ||
111 | #define FMC_GPIO_IRQ(x) ((x) + 0x1000) /* 256 of them */ | ||
112 | #define FMC_GPIO_LED(x) ((x) + 0x1100) /* 256 of them */ | ||
113 | #define FMC_GPIO_KEY(x) ((x) + 0x1200) /* 256 of them */ | ||
114 | #define FMC_GPIO_TP(x) ((x) + 0x1300) /* 256 of them */ | ||
115 | #define FMC_GPIO_USER(x) ((x) + 0x1400) /* 256 of them */ | ||
116 | /* We may add SCL and SDA, or other roles if the need arises */ | ||
117 | |||
118 | /* GPIOF_DIR_IN etc are missing before 3.0. copy from <linux/gpio.h> */ | ||
119 | #ifndef GPIOF_DIR_IN | ||
120 | # define GPIOF_DIR_OUT (0 << 0) | ||
121 | # define GPIOF_DIR_IN (1 << 0) | ||
122 | # define GPIOF_INIT_LOW (0 << 1) | ||
123 | # define GPIOF_INIT_HIGH (1 << 1) | ||
124 | #endif | ||
125 | |||
126 | /* | ||
127 | * The operations are offered by each carrier and should make driver | ||
128 | * design completely independent of the carrier. Named GPIO pins may be | ||
129 | * the exception. | ||
130 | */ | ||
131 | struct fmc_operations { | ||
132 | uint32_t (*read32)(struct fmc_device *fmc, int offset); | ||
133 | void (*write32)(struct fmc_device *fmc, uint32_t value, int offset); | ||
134 | int (*validate)(struct fmc_device *fmc, struct fmc_driver *drv); | ||
135 | int (*reprogram)(struct fmc_device *f, struct fmc_driver *d, char *gw); | ||
136 | int (*irq_request)(struct fmc_device *fmc, irq_handler_t h, | ||
137 | char *name, int flags); | ||
138 | void (*irq_ack)(struct fmc_device *fmc); | ||
139 | int (*irq_free)(struct fmc_device *fmc); | ||
140 | int (*gpio_config)(struct fmc_device *fmc, struct fmc_gpio *gpio, | ||
141 | int ngpio); | ||
142 | int (*read_ee)(struct fmc_device *fmc, int pos, void *d, int l); | ||
143 | int (*write_ee)(struct fmc_device *fmc, int pos, const void *d, int l); | ||
144 | }; | ||
145 | |||
146 | /* Prefer this helper rather than calling of fmc->reprogram directly */ | ||
147 | extern int fmc_reprogram(struct fmc_device *f, struct fmc_driver *d, char *gw, | ||
148 | int sdb_entry); | ||
149 | |||
150 | /* | ||
151 | * The device reports all information needed to access hw. | ||
152 | * | ||
153 | * If we have eeprom_len and not contents, the core reads it. | ||
154 | * Then, parsing of identifiers is done by the core which fills fmc_fru_id.. | ||
155 | * Similarly a device that must be matched based on SDB cores must | ||
156 | * fill the entry point and the core will scan the bus (FIXME: sdb match) | ||
157 | */ | ||
158 | struct fmc_device { | ||
159 | unsigned long version; | ||
160 | unsigned long flags; | ||
161 | struct module *owner; /* char device must pin it */ | ||
162 | struct fmc_fru_id id; /* for EEPROM-based match */ | ||
163 | struct fmc_operations *op; /* carrier-provided */ | ||
164 | int irq; /* according to host bus. 0 == none */ | ||
165 | int eeprom_len; /* Usually 8kB, may be less */ | ||
166 | int eeprom_addr; /* 0x50, 0x52 etc */ | ||
167 | uint8_t *eeprom; /* Full contents or leading part */ | ||
168 | char *carrier_name; /* "SPEC" or similar, for special use */ | ||
169 | void *carrier_data; /* "struct spec *" or equivalent */ | ||
170 | __iomem void *fpga_base; /* May be NULL (Etherbone) */ | ||
171 | __iomem void *slot_base; /* Set by the driver */ | ||
172 | struct fmc_device **devarray; /* Allocated by the bus */ | ||
173 | int slot_id; /* Index in the slot array */ | ||
174 | int nr_slots; /* Number of slots in this carrier */ | ||
175 | unsigned long memlen; /* Used for the char device */ | ||
176 | struct device dev; /* For Linux use */ | ||
177 | struct device *hwdev; /* The underlying hardware device */ | ||
178 | unsigned long sdbfs_entry; | ||
179 | struct sdb_array *sdb; | ||
180 | uint32_t device_id; /* Filled by the device */ | ||
181 | char *mezzanine_name; /* Defaults to ``fmc'' */ | ||
182 | void *mezzanine_data; | ||
183 | }; | ||
184 | #define to_fmc_device(x) container_of((x), struct fmc_device, dev) | ||
185 | |||
186 | #define FMC_DEVICE_HAS_GOLDEN 1 | ||
187 | #define FMC_DEVICE_HAS_CUSTOM 2 | ||
188 | #define FMC_DEVICE_NO_MEZZANINE 4 | ||
189 | #define FMC_DEVICE_MATCH_SDB 8 /* fmc-core must scan sdb in fpga */ | ||
190 | |||
191 | /* | ||
192 | * If fpga_base can be used, the carrier offers no readl/writel methods, and | ||
193 | * this expands to a single, fast, I/O access. | ||
194 | */ | ||
195 | static inline uint32_t fmc_readl(struct fmc_device *fmc, int offset) | ||
196 | { | ||
197 | if (unlikely(fmc->op->read32)) | ||
198 | return fmc->op->read32(fmc, offset); | ||
199 | return readl(fmc->fpga_base + offset); | ||
200 | } | ||
201 | static inline void fmc_writel(struct fmc_device *fmc, uint32_t val, int off) | ||
202 | { | ||
203 | if (unlikely(fmc->op->write32)) | ||
204 | fmc->op->write32(fmc, val, off); | ||
205 | else | ||
206 | writel(val, fmc->fpga_base + off); | ||
207 | } | ||
208 | |||
209 | /* pci-like naming */ | ||
210 | static inline void *fmc_get_drvdata(const struct fmc_device *fmc) | ||
211 | { | ||
212 | return dev_get_drvdata(&fmc->dev); | ||
213 | } | ||
214 | |||
215 | static inline void fmc_set_drvdata(struct fmc_device *fmc, void *data) | ||
216 | { | ||
217 | dev_set_drvdata(&fmc->dev, data); | ||
218 | } | ||
219 | |||
220 | /* The 4 access points */ | ||
221 | extern int fmc_driver_register(struct fmc_driver *drv); | ||
222 | extern void fmc_driver_unregister(struct fmc_driver *drv); | ||
223 | extern int fmc_device_register(struct fmc_device *tdev); | ||
224 | extern void fmc_device_unregister(struct fmc_device *tdev); | ||
225 | |||
226 | /* Two more for device sets, all driven by the same FPGA */ | ||
227 | extern int fmc_device_register_n(struct fmc_device **devs, int n); | ||
228 | extern void fmc_device_unregister_n(struct fmc_device **devs, int n); | ||
229 | |||
230 | /* Internal cross-calls between files; not exported to other modules */ | ||
231 | extern int fmc_match(struct device *dev, struct device_driver *drv); | ||
232 | extern int fmc_fill_id_info(struct fmc_device *fmc); | ||
233 | extern void fmc_free_id_info(struct fmc_device *fmc); | ||
234 | extern void fmc_dump_eeprom(const struct fmc_device *fmc); | ||
235 | extern void fmc_dump_sdb(const struct fmc_device *fmc); | ||
236 | |||
237 | #endif /* __LINUX_FMC_H__ */ | ||
diff --git a/include/linux/freezer.h b/include/linux/freezer.h index e70df40d84f6..7fd81b8c4897 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> |
@@ -46,7 +47,11 @@ extern int freeze_kernel_threads(void); | |||
46 | extern void thaw_processes(void); | 47 | extern void thaw_processes(void); |
47 | extern void thaw_kernel_threads(void); | 48 | extern void thaw_kernel_threads(void); |
48 | 49 | ||
49 | static inline bool try_to_freeze(void) | 50 | /* |
51 | * DO NOT ADD ANY NEW CALLERS OF THIS FUNCTION | ||
52 | * If try_to_freeze causes a lockdep warning it means the caller may deadlock | ||
53 | */ | ||
54 | static inline bool try_to_freeze_unsafe(void) | ||
50 | { | 55 | { |
51 | might_sleep(); | 56 | might_sleep(); |
52 | if (likely(!freezing(current))) | 57 | if (likely(!freezing(current))) |
@@ -54,6 +59,13 @@ static inline bool try_to_freeze(void) | |||
54 | return __refrigerator(false); | 59 | return __refrigerator(false); |
55 | } | 60 | } |
56 | 61 | ||
62 | static inline bool try_to_freeze(void) | ||
63 | { | ||
64 | if (!(current->flags & PF_NOFREEZE)) | ||
65 | debug_check_no_locks_held(); | ||
66 | return try_to_freeze_unsafe(); | ||
67 | } | ||
68 | |||
57 | extern bool freeze_task(struct task_struct *p); | 69 | extern bool freeze_task(struct task_struct *p); |
58 | extern bool set_freezable(void); | 70 | extern bool set_freezable(void); |
59 | 71 | ||
@@ -115,6 +127,14 @@ static inline void freezer_count(void) | |||
115 | try_to_freeze(); | 127 | try_to_freeze(); |
116 | } | 128 | } |
117 | 129 | ||
130 | /* DO NOT ADD ANY NEW CALLERS OF THIS FUNCTION */ | ||
131 | static inline void freezer_count_unsafe(void) | ||
132 | { | ||
133 | current->flags &= ~PF_FREEZER_SKIP; | ||
134 | smp_mb(); | ||
135 | try_to_freeze_unsafe(); | ||
136 | } | ||
137 | |||
118 | /** | 138 | /** |
119 | * freezer_should_skip - whether to skip a task when determining frozen | 139 | * freezer_should_skip - whether to skip a task when determining frozen |
120 | * state is reached | 140 | * state is reached |
@@ -139,28 +159,86 @@ static inline bool freezer_should_skip(struct task_struct *p) | |||
139 | } | 159 | } |
140 | 160 | ||
141 | /* | 161 | /* |
142 | * These macros are intended to be used whenever you want allow a sleeping | 162 | * These functions are intended to be used whenever you want allow a sleeping |
143 | * task to be frozen. Note that neither return any clear indication of | 163 | * task to be frozen. Note that neither return any clear indication of |
144 | * whether a freeze event happened while in this function. | 164 | * whether a freeze event happened while in this function. |
145 | */ | 165 | */ |
146 | 166 | ||
147 | /* Like schedule(), but should not block the freezer. */ | 167 | /* Like schedule(), but should not block the freezer. */ |
148 | #define freezable_schedule() \ | 168 | static inline void freezable_schedule(void) |
149 | ({ \ | 169 | { |
150 | freezer_do_not_count(); \ | 170 | freezer_do_not_count(); |
151 | schedule(); \ | 171 | schedule(); |
152 | freezer_count(); \ | 172 | freezer_count(); |
153 | }) | 173 | } |
174 | |||
175 | /* DO NOT ADD ANY NEW CALLERS OF THIS FUNCTION */ | ||
176 | static inline void freezable_schedule_unsafe(void) | ||
177 | { | ||
178 | freezer_do_not_count(); | ||
179 | schedule(); | ||
180 | freezer_count_unsafe(); | ||
181 | } | ||
182 | |||
183 | /* | ||
184 | * Like freezable_schedule_timeout(), but should not block the freezer. Do not | ||
185 | * call this with locks held. | ||
186 | */ | ||
187 | static inline long freezable_schedule_timeout(long timeout) | ||
188 | { | ||
189 | long __retval; | ||
190 | freezer_do_not_count(); | ||
191 | __retval = schedule_timeout(timeout); | ||
192 | freezer_count(); | ||
193 | return __retval; | ||
194 | } | ||
195 | |||
196 | /* | ||
197 | * Like schedule_timeout_interruptible(), but should not block the freezer. Do not | ||
198 | * call this with locks held. | ||
199 | */ | ||
200 | static inline long freezable_schedule_timeout_interruptible(long timeout) | ||
201 | { | ||
202 | long __retval; | ||
203 | freezer_do_not_count(); | ||
204 | __retval = schedule_timeout_interruptible(timeout); | ||
205 | freezer_count(); | ||
206 | return __retval; | ||
207 | } | ||
154 | 208 | ||
155 | /* Like schedule_timeout_killable(), but should not block the freezer. */ | 209 | /* Like schedule_timeout_killable(), but should not block the freezer. */ |
156 | #define freezable_schedule_timeout_killable(timeout) \ | 210 | static inline long freezable_schedule_timeout_killable(long timeout) |
157 | ({ \ | 211 | { |
158 | long __retval; \ | 212 | long __retval; |
159 | freezer_do_not_count(); \ | 213 | freezer_do_not_count(); |
160 | __retval = schedule_timeout_killable(timeout); \ | 214 | __retval = schedule_timeout_killable(timeout); |
161 | freezer_count(); \ | 215 | freezer_count(); |
162 | __retval; \ | 216 | return __retval; |
163 | }) | 217 | } |
218 | |||
219 | /* DO NOT ADD ANY NEW CALLERS OF THIS FUNCTION */ | ||
220 | static inline long freezable_schedule_timeout_killable_unsafe(long timeout) | ||
221 | { | ||
222 | long __retval; | ||
223 | freezer_do_not_count(); | ||
224 | __retval = schedule_timeout_killable(timeout); | ||
225 | freezer_count_unsafe(); | ||
226 | return __retval; | ||
227 | } | ||
228 | |||
229 | /* | ||
230 | * Like schedule_hrtimeout_range(), but should not block the freezer. Do not | ||
231 | * call this with locks held. | ||
232 | */ | ||
233 | static inline int freezable_schedule_hrtimeout_range(ktime_t *expires, | ||
234 | unsigned long delta, const enum hrtimer_mode mode) | ||
235 | { | ||
236 | int __retval; | ||
237 | freezer_do_not_count(); | ||
238 | __retval = schedule_hrtimeout_range(expires, delta, mode); | ||
239 | freezer_count(); | ||
240 | return __retval; | ||
241 | } | ||
164 | 242 | ||
165 | /* | 243 | /* |
166 | * Freezer-friendly wrappers around wait_event_interruptible(), | 244 | * Freezer-friendly wrappers around wait_event_interruptible(), |
@@ -177,33 +255,45 @@ static inline bool freezer_should_skip(struct task_struct *p) | |||
177 | __retval; \ | 255 | __retval; \ |
178 | }) | 256 | }) |
179 | 257 | ||
258 | /* DO NOT ADD ANY NEW CALLERS OF THIS FUNCTION */ | ||
259 | #define wait_event_freezekillable_unsafe(wq, condition) \ | ||
260 | ({ \ | ||
261 | int __retval; \ | ||
262 | freezer_do_not_count(); \ | ||
263 | __retval = wait_event_killable(wq, (condition)); \ | ||
264 | freezer_count_unsafe(); \ | ||
265 | __retval; \ | ||
266 | }) | ||
267 | |||
180 | #define wait_event_freezable(wq, condition) \ | 268 | #define wait_event_freezable(wq, condition) \ |
181 | ({ \ | 269 | ({ \ |
182 | int __retval; \ | 270 | int __retval; \ |
183 | for (;;) { \ | 271 | freezer_do_not_count(); \ |
184 | __retval = wait_event_interruptible(wq, \ | 272 | __retval = wait_event_interruptible(wq, (condition)); \ |
185 | (condition) || freezing(current)); \ | 273 | freezer_count(); \ |
186 | if (__retval || (condition)) \ | ||
187 | break; \ | ||
188 | try_to_freeze(); \ | ||
189 | } \ | ||
190 | __retval; \ | 274 | __retval; \ |
191 | }) | 275 | }) |
192 | 276 | ||
193 | #define wait_event_freezable_timeout(wq, condition, timeout) \ | 277 | #define wait_event_freezable_timeout(wq, condition, timeout) \ |
194 | ({ \ | 278 | ({ \ |
195 | long __retval = timeout; \ | 279 | long __retval = timeout; \ |
196 | for (;;) { \ | 280 | freezer_do_not_count(); \ |
197 | __retval = wait_event_interruptible_timeout(wq, \ | 281 | __retval = wait_event_interruptible_timeout(wq, (condition), \ |
198 | (condition) || freezing(current), \ | 282 | __retval); \ |
199 | __retval); \ | 283 | freezer_count(); \ |
200 | if (__retval <= 0 || (condition)) \ | ||
201 | break; \ | ||
202 | try_to_freeze(); \ | ||
203 | } \ | ||
204 | __retval; \ | 284 | __retval; \ |
205 | }) | 285 | }) |
206 | 286 | ||
287 | #define wait_event_freezable_exclusive(wq, condition) \ | ||
288 | ({ \ | ||
289 | int __retval; \ | ||
290 | freezer_do_not_count(); \ | ||
291 | __retval = wait_event_interruptible_exclusive(wq, condition); \ | ||
292 | freezer_count(); \ | ||
293 | __retval; \ | ||
294 | }) | ||
295 | |||
296 | |||
207 | #else /* !CONFIG_FREEZER */ | 297 | #else /* !CONFIG_FREEZER */ |
208 | static inline bool frozen(struct task_struct *p) { return false; } | 298 | static inline bool frozen(struct task_struct *p) { return false; } |
209 | static inline bool freezing(struct task_struct *p) { return false; } | 299 | static inline bool freezing(struct task_struct *p) { return false; } |
@@ -225,18 +315,37 @@ static inline void set_freezable(void) {} | |||
225 | 315 | ||
226 | #define freezable_schedule() schedule() | 316 | #define freezable_schedule() schedule() |
227 | 317 | ||
318 | #define freezable_schedule_unsafe() schedule() | ||
319 | |||
320 | #define freezable_schedule_timeout(timeout) schedule_timeout(timeout) | ||
321 | |||
322 | #define freezable_schedule_timeout_interruptible(timeout) \ | ||
323 | schedule_timeout_interruptible(timeout) | ||
324 | |||
228 | #define freezable_schedule_timeout_killable(timeout) \ | 325 | #define freezable_schedule_timeout_killable(timeout) \ |
229 | schedule_timeout_killable(timeout) | 326 | schedule_timeout_killable(timeout) |
230 | 327 | ||
328 | #define freezable_schedule_timeout_killable_unsafe(timeout) \ | ||
329 | schedule_timeout_killable(timeout) | ||
330 | |||
331 | #define freezable_schedule_hrtimeout_range(expires, delta, mode) \ | ||
332 | schedule_hrtimeout_range(expires, delta, mode) | ||
333 | |||
231 | #define wait_event_freezable(wq, condition) \ | 334 | #define wait_event_freezable(wq, condition) \ |
232 | wait_event_interruptible(wq, condition) | 335 | wait_event_interruptible(wq, condition) |
233 | 336 | ||
234 | #define wait_event_freezable_timeout(wq, condition, timeout) \ | 337 | #define wait_event_freezable_timeout(wq, condition, timeout) \ |
235 | wait_event_interruptible_timeout(wq, condition, timeout) | 338 | wait_event_interruptible_timeout(wq, condition, timeout) |
236 | 339 | ||
340 | #define wait_event_freezable_exclusive(wq, condition) \ | ||
341 | wait_event_interruptible_exclusive(wq, condition) | ||
342 | |||
237 | #define wait_event_freezekillable(wq, condition) \ | 343 | #define wait_event_freezekillable(wq, condition) \ |
238 | wait_event_killable(wq, condition) | 344 | wait_event_killable(wq, condition) |
239 | 345 | ||
346 | #define wait_event_freezekillable_unsafe(wq, condition) \ | ||
347 | wait_event_killable(wq, condition) | ||
348 | |||
240 | #endif /* !CONFIG_FREEZER */ | 349 | #endif /* !CONFIG_FREEZER */ |
241 | 350 | ||
242 | #endif /* FREEZER_H_INCLUDED */ | 351 | #endif /* FREEZER_H_INCLUDED */ |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 65c2be22b601..981874773e85 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/stat.h> | 10 | #include <linux/stat.h> |
11 | #include <linux/cache.h> | 11 | #include <linux/cache.h> |
12 | #include <linux/list.h> | 12 | #include <linux/list.h> |
13 | #include <linux/llist.h> | ||
13 | #include <linux/radix-tree.h> | 14 | #include <linux/radix-tree.h> |
14 | #include <linux/rbtree.h> | 15 | #include <linux/rbtree.h> |
15 | #include <linux/init.h> | 16 | #include <linux/init.h> |
@@ -364,7 +365,7 @@ struct address_space_operations { | |||
364 | 365 | ||
365 | /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ | 366 | /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ |
366 | sector_t (*bmap)(struct address_space *, sector_t); | 367 | sector_t (*bmap)(struct address_space *, sector_t); |
367 | void (*invalidatepage) (struct page *, unsigned long); | 368 | void (*invalidatepage) (struct page *, unsigned int, unsigned int); |
368 | int (*releasepage) (struct page *, gfp_t); | 369 | int (*releasepage) (struct page *, gfp_t); |
369 | void (*freepage)(struct page *); | 370 | void (*freepage)(struct page *); |
370 | ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, | 371 | ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, |
@@ -372,14 +373,15 @@ struct address_space_operations { | |||
372 | int (*get_xip_mem)(struct address_space *, pgoff_t, int, | 373 | int (*get_xip_mem)(struct address_space *, pgoff_t, int, |
373 | void **, unsigned long *); | 374 | void **, unsigned long *); |
374 | /* | 375 | /* |
375 | * migrate the contents of a page to the specified target. If sync | 376 | * migrate the contents of a page to the specified target. If |
376 | * is false, it must not block. | 377 | * migrate_mode is MIGRATE_ASYNC, it must not block. |
377 | */ | 378 | */ |
378 | int (*migratepage) (struct address_space *, | 379 | int (*migratepage) (struct address_space *, |
379 | struct page *, struct page *, enum migrate_mode); | 380 | struct page *, struct page *, enum migrate_mode); |
380 | int (*launder_page) (struct page *); | 381 | int (*launder_page) (struct page *); |
381 | int (*is_partially_uptodate) (struct page *, read_descriptor_t *, | 382 | int (*is_partially_uptodate) (struct page *, read_descriptor_t *, |
382 | unsigned long); | 383 | unsigned long); |
384 | void (*is_dirty_writeback) (struct page *, bool *, bool *); | ||
383 | int (*error_remove_page)(struct address_space *, struct page *); | 385 | int (*error_remove_page)(struct address_space *, struct page *); |
384 | 386 | ||
385 | /* swapfile support */ | 387 | /* swapfile support */ |
@@ -767,6 +769,7 @@ struct file { | |||
767 | */ | 769 | */ |
768 | union { | 770 | union { |
769 | struct list_head fu_list; | 771 | struct list_head fu_list; |
772 | struct llist_node fu_llist; | ||
770 | struct rcu_head fu_rcuhead; | 773 | struct rcu_head fu_rcuhead; |
771 | } f_u; | 774 | } f_u; |
772 | struct path f_path; | 775 | struct path f_path; |
@@ -908,6 +911,7 @@ struct file_lock_operations { | |||
908 | 911 | ||
909 | struct lock_manager_operations { | 912 | struct lock_manager_operations { |
910 | int (*lm_compare_owner)(struct file_lock *, struct file_lock *); | 913 | int (*lm_compare_owner)(struct file_lock *, struct file_lock *); |
914 | unsigned long (*lm_owner_key)(struct file_lock *); | ||
911 | void (*lm_notify)(struct file_lock *); /* unblock callback */ | 915 | void (*lm_notify)(struct file_lock *); /* unblock callback */ |
912 | int (*lm_grant)(struct file_lock *, struct file_lock *, int); | 916 | int (*lm_grant)(struct file_lock *, struct file_lock *, int); |
913 | void (*lm_break)(struct file_lock *); | 917 | void (*lm_break)(struct file_lock *); |
@@ -926,14 +930,33 @@ int locks_in_grace(struct net *); | |||
926 | /* that will die - we need it for nfs_lock_info */ | 930 | /* that will die - we need it for nfs_lock_info */ |
927 | #include <linux/nfs_fs_i.h> | 931 | #include <linux/nfs_fs_i.h> |
928 | 932 | ||
933 | /* | ||
934 | * struct file_lock represents a generic "file lock". It's used to represent | ||
935 | * POSIX byte range locks, BSD (flock) locks, and leases. It's important to | ||
936 | * note that the same struct is used to represent both a request for a lock and | ||
937 | * the lock itself, but the same object is never used for both. | ||
938 | * | ||
939 | * FIXME: should we create a separate "struct lock_request" to help distinguish | ||
940 | * these two uses? | ||
941 | * | ||
942 | * The i_flock list is ordered by: | ||
943 | * | ||
944 | * 1) lock type -- FL_LEASEs first, then FL_FLOCK, and finally FL_POSIX | ||
945 | * 2) lock owner | ||
946 | * 3) lock range start | ||
947 | * 4) lock range end | ||
948 | * | ||
949 | * Obviously, the last two criteria only matter for POSIX locks. | ||
950 | */ | ||
929 | struct file_lock { | 951 | struct file_lock { |
930 | struct file_lock *fl_next; /* singly linked list for this inode */ | 952 | struct file_lock *fl_next; /* singly linked list for this inode */ |
931 | struct list_head fl_link; /* doubly linked list of all locks */ | 953 | struct hlist_node fl_link; /* node in global lists */ |
932 | struct list_head fl_block; /* circular list of blocked processes */ | 954 | struct list_head fl_block; /* circular list of blocked processes */ |
933 | fl_owner_t fl_owner; | 955 | fl_owner_t fl_owner; |
934 | unsigned int fl_flags; | 956 | unsigned int fl_flags; |
935 | unsigned char fl_type; | 957 | unsigned char fl_type; |
936 | unsigned int fl_pid; | 958 | unsigned int fl_pid; |
959 | int fl_link_cpu; /* what cpu's list is this on? */ | ||
937 | struct pid *fl_nspid; | 960 | struct pid *fl_nspid; |
938 | wait_queue_head_t fl_wait; | 961 | wait_queue_head_t fl_wait; |
939 | struct file *fl_file; | 962 | struct file *fl_file; |
@@ -994,7 +1017,7 @@ extern void locks_release_private(struct file_lock *); | |||
994 | extern void posix_test_lock(struct file *, struct file_lock *); | 1017 | extern void posix_test_lock(struct file *, struct file_lock *); |
995 | extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *); | 1018 | extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *); |
996 | extern int posix_lock_file_wait(struct file *, struct file_lock *); | 1019 | extern int posix_lock_file_wait(struct file *, struct file_lock *); |
997 | extern int posix_unblock_lock(struct file *, struct file_lock *); | 1020 | extern int posix_unblock_lock(struct file_lock *); |
998 | extern int vfs_test_lock(struct file *, struct file_lock *); | 1021 | extern int vfs_test_lock(struct file *, struct file_lock *); |
999 | extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *); | 1022 | extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *); |
1000 | extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl); | 1023 | extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl); |
@@ -1006,9 +1029,6 @@ extern int vfs_setlease(struct file *, long, struct file_lock **); | |||
1006 | extern int lease_modify(struct file_lock **, int); | 1029 | extern int lease_modify(struct file_lock **, int); |
1007 | extern int lock_may_read(struct inode *, loff_t start, unsigned long count); | 1030 | extern int lock_may_read(struct inode *, loff_t start, unsigned long count); |
1008 | extern int lock_may_write(struct inode *, loff_t start, unsigned long count); | 1031 | extern int lock_may_write(struct inode *, loff_t start, unsigned long count); |
1009 | extern void locks_delete_block(struct file_lock *waiter); | ||
1010 | extern void lock_flocks(void); | ||
1011 | extern void unlock_flocks(void); | ||
1012 | #else /* !CONFIG_FILE_LOCKING */ | 1032 | #else /* !CONFIG_FILE_LOCKING */ |
1013 | static inline int fcntl_getlk(struct file *file, struct flock __user *user) | 1033 | static inline int fcntl_getlk(struct file *file, struct flock __user *user) |
1014 | { | 1034 | { |
@@ -1084,8 +1104,7 @@ static inline int posix_lock_file_wait(struct file *filp, struct file_lock *fl) | |||
1084 | return -ENOLCK; | 1104 | return -ENOLCK; |
1085 | } | 1105 | } |
1086 | 1106 | ||
1087 | static inline int posix_unblock_lock(struct file *filp, | 1107 | static inline int posix_unblock_lock(struct file_lock *waiter) |
1088 | struct file_lock *waiter) | ||
1089 | { | 1108 | { |
1090 | return -ENOENT; | 1109 | return -ENOENT; |
1091 | } | 1110 | } |
@@ -1150,19 +1169,6 @@ static inline int lock_may_write(struct inode *inode, loff_t start, | |||
1150 | { | 1169 | { |
1151 | return 1; | 1170 | return 1; |
1152 | } | 1171 | } |
1153 | |||
1154 | static inline void locks_delete_block(struct file_lock *waiter) | ||
1155 | { | ||
1156 | } | ||
1157 | |||
1158 | static inline void lock_flocks(void) | ||
1159 | { | ||
1160 | } | ||
1161 | |||
1162 | static inline void unlock_flocks(void) | ||
1163 | { | ||
1164 | } | ||
1165 | |||
1166 | #endif /* !CONFIG_FILE_LOCKING */ | 1172 | #endif /* !CONFIG_FILE_LOCKING */ |
1167 | 1173 | ||
1168 | 1174 | ||
@@ -1506,6 +1512,11 @@ int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags); | |||
1506 | * to have different dirent layouts depending on the binary type. | 1512 | * to have different dirent layouts depending on the binary type. |
1507 | */ | 1513 | */ |
1508 | typedef int (*filldir_t)(void *, const char *, int, loff_t, u64, unsigned); | 1514 | typedef int (*filldir_t)(void *, const char *, int, loff_t, u64, unsigned); |
1515 | struct dir_context { | ||
1516 | const filldir_t actor; | ||
1517 | loff_t pos; | ||
1518 | }; | ||
1519 | |||
1509 | struct block_device_operations; | 1520 | struct block_device_operations; |
1510 | 1521 | ||
1511 | /* These macros are for out of kernel modules to test that | 1522 | /* These macros are for out of kernel modules to test that |
@@ -1521,7 +1532,7 @@ struct file_operations { | |||
1521 | ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); | 1532 | ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); |
1522 | ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t); | 1533 | ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t); |
1523 | ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t); | 1534 | ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t); |
1524 | int (*readdir) (struct file *, void *, filldir_t); | 1535 | int (*iterate) (struct file *, struct dir_context *); |
1525 | unsigned int (*poll) (struct file *, struct poll_table_struct *); | 1536 | unsigned int (*poll) (struct file *, struct poll_table_struct *); |
1526 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); | 1537 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); |
1527 | long (*compat_ioctl) (struct file *, unsigned int, unsigned long); | 1538 | long (*compat_ioctl) (struct file *, unsigned int, unsigned long); |
@@ -1575,6 +1586,7 @@ struct inode_operations { | |||
1575 | int (*atomic_open)(struct inode *, struct dentry *, | 1586 | int (*atomic_open)(struct inode *, struct dentry *, |
1576 | struct file *, unsigned open_flag, | 1587 | struct file *, unsigned open_flag, |
1577 | umode_t create_mode, int *opened); | 1588 | umode_t create_mode, int *opened); |
1589 | int (*tmpfile) (struct inode *, struct dentry *, umode_t); | ||
1578 | } ____cacheline_aligned; | 1590 | } ____cacheline_aligned; |
1579 | 1591 | ||
1580 | ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, | 1592 | ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, |
@@ -1738,6 +1750,7 @@ struct super_operations { | |||
1738 | #define I_REFERENCED (1 << 8) | 1750 | #define I_REFERENCED (1 << 8) |
1739 | #define __I_DIO_WAKEUP 9 | 1751 | #define __I_DIO_WAKEUP 9 |
1740 | #define I_DIO_WAKEUP (1 << I_DIO_WAKEUP) | 1752 | #define I_DIO_WAKEUP (1 << I_DIO_WAKEUP) |
1753 | #define I_LINKABLE (1 << 10) | ||
1741 | 1754 | ||
1742 | #define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) | 1755 | #define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) |
1743 | 1756 | ||
@@ -1891,7 +1904,6 @@ extern int current_umask(void); | |||
1891 | extern struct kobject *fs_kobj; | 1904 | extern struct kobject *fs_kobj; |
1892 | 1905 | ||
1893 | #define MAX_RW_COUNT (INT_MAX & PAGE_CACHE_MASK) | 1906 | #define MAX_RW_COUNT (INT_MAX & PAGE_CACHE_MASK) |
1894 | extern int rw_verify_area(int, struct file *, loff_t *, size_t); | ||
1895 | 1907 | ||
1896 | #define FLOCK_VERIFY_READ 1 | 1908 | #define FLOCK_VERIFY_READ 1 |
1897 | #define FLOCK_VERIFY_WRITE 2 | 1909 | #define FLOCK_VERIFY_WRITE 2 |
@@ -2304,7 +2316,6 @@ extern struct file * open_exec(const char *); | |||
2304 | /* fs/dcache.c -- generic fs support functions */ | 2316 | /* fs/dcache.c -- generic fs support functions */ |
2305 | extern int is_subdir(struct dentry *, struct dentry *); | 2317 | extern int is_subdir(struct dentry *, struct dentry *); |
2306 | extern int path_is_under(struct path *, struct path *); | 2318 | extern int path_is_under(struct path *, struct path *); |
2307 | extern ino_t find_inode_number(struct dentry *, struct qstr *); | ||
2308 | 2319 | ||
2309 | #include <linux/err.h> | 2320 | #include <linux/err.h> |
2310 | 2321 | ||
@@ -2419,9 +2430,12 @@ extern void | |||
2419 | file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); | 2430 | file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); |
2420 | extern loff_t noop_llseek(struct file *file, loff_t offset, int whence); | 2431 | extern loff_t noop_llseek(struct file *file, loff_t offset, int whence); |
2421 | extern loff_t no_llseek(struct file *file, loff_t offset, int whence); | 2432 | extern loff_t no_llseek(struct file *file, loff_t offset, int whence); |
2433 | extern loff_t vfs_setpos(struct file *file, loff_t offset, loff_t maxsize); | ||
2422 | extern loff_t generic_file_llseek(struct file *file, loff_t offset, int whence); | 2434 | extern loff_t generic_file_llseek(struct file *file, loff_t offset, int whence); |
2423 | extern loff_t generic_file_llseek_size(struct file *file, loff_t offset, | 2435 | extern loff_t generic_file_llseek_size(struct file *file, loff_t offset, |
2424 | int whence, loff_t maxsize, loff_t eof); | 2436 | int whence, loff_t maxsize, loff_t eof); |
2437 | extern loff_t fixed_size_llseek(struct file *file, loff_t offset, | ||
2438 | int whence, loff_t size); | ||
2425 | extern int generic_file_open(struct inode * inode, struct file * filp); | 2439 | extern int generic_file_open(struct inode * inode, struct file * filp); |
2426 | extern int nonseekable_open(struct inode * inode, struct file * filp); | 2440 | extern int nonseekable_open(struct inode * inode, struct file * filp); |
2427 | 2441 | ||
@@ -2494,6 +2508,7 @@ loff_t inode_get_bytes(struct inode *inode); | |||
2494 | void inode_set_bytes(struct inode *inode, loff_t bytes); | 2508 | void inode_set_bytes(struct inode *inode, loff_t bytes); |
2495 | 2509 | ||
2496 | extern int vfs_readdir(struct file *, filldir_t, void *); | 2510 | extern int vfs_readdir(struct file *, filldir_t, void *); |
2511 | extern int iterate_dir(struct file *, struct dir_context *); | ||
2497 | 2512 | ||
2498 | extern int vfs_stat(const char __user *, struct kstat *); | 2513 | extern int vfs_stat(const char __user *, struct kstat *); |
2499 | extern int vfs_lstat(const char __user *, struct kstat *); | 2514 | extern int vfs_lstat(const char __user *, struct kstat *); |
@@ -2524,7 +2539,7 @@ extern void iterate_supers_type(struct file_system_type *, | |||
2524 | extern int dcache_dir_open(struct inode *, struct file *); | 2539 | extern int dcache_dir_open(struct inode *, struct file *); |
2525 | extern int dcache_dir_close(struct inode *, struct file *); | 2540 | extern int dcache_dir_close(struct inode *, struct file *); |
2526 | extern loff_t dcache_dir_lseek(struct file *, loff_t, int); | 2541 | extern loff_t dcache_dir_lseek(struct file *, loff_t, int); |
2527 | extern int dcache_readdir(struct file *, void *, filldir_t); | 2542 | extern int dcache_readdir(struct file *, struct dir_context *); |
2528 | extern int simple_setattr(struct dentry *, struct iattr *); | 2543 | extern int simple_setattr(struct dentry *, struct iattr *); |
2529 | extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *); | 2544 | extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *); |
2530 | extern int simple_statfs(struct dentry *, struct kstatfs *); | 2545 | extern int simple_statfs(struct dentry *, struct kstatfs *); |
@@ -2688,4 +2703,41 @@ static inline void inode_has_no_xattr(struct inode *inode) | |||
2688 | inode->i_flags |= S_NOSEC; | 2703 | inode->i_flags |= S_NOSEC; |
2689 | } | 2704 | } |
2690 | 2705 | ||
2706 | static inline bool dir_emit(struct dir_context *ctx, | ||
2707 | const char *name, int namelen, | ||
2708 | u64 ino, unsigned type) | ||
2709 | { | ||
2710 | return ctx->actor(ctx, name, namelen, ctx->pos, ino, type) == 0; | ||
2711 | } | ||
2712 | static inline bool dir_emit_dot(struct file *file, struct dir_context *ctx) | ||
2713 | { | ||
2714 | return ctx->actor(ctx, ".", 1, ctx->pos, | ||
2715 | file->f_path.dentry->d_inode->i_ino, DT_DIR) == 0; | ||
2716 | } | ||
2717 | static inline bool dir_emit_dotdot(struct file *file, struct dir_context *ctx) | ||
2718 | { | ||
2719 | return ctx->actor(ctx, "..", 2, ctx->pos, | ||
2720 | parent_ino(file->f_path.dentry), DT_DIR) == 0; | ||
2721 | } | ||
2722 | static inline bool dir_emit_dots(struct file *file, struct dir_context *ctx) | ||
2723 | { | ||
2724 | if (ctx->pos == 0) { | ||
2725 | if (!dir_emit_dot(file, ctx)) | ||
2726 | return false; | ||
2727 | ctx->pos = 1; | ||
2728 | } | ||
2729 | if (ctx->pos == 1) { | ||
2730 | if (!dir_emit_dotdot(file, ctx)) | ||
2731 | return false; | ||
2732 | ctx->pos = 2; | ||
2733 | } | ||
2734 | return true; | ||
2735 | } | ||
2736 | static inline bool dir_relax(struct inode *inode) | ||
2737 | { | ||
2738 | mutex_unlock(&inode->i_mutex); | ||
2739 | mutex_lock(&inode->i_mutex); | ||
2740 | return !IS_DEADDIR(inode); | ||
2741 | } | ||
2742 | |||
2691 | #endif /* _LINUX_FS_H */ | 2743 | #endif /* _LINUX_FS_H */ |
diff --git a/include/linux/fscache-cache.h b/include/linux/fscache-cache.h index 5dfa0aa216b6..a9ff9a36b86d 100644 --- a/include/linux/fscache-cache.h +++ b/include/linux/fscache-cache.h | |||
@@ -97,7 +97,8 @@ struct fscache_operation { | |||
97 | #define FSCACHE_OP_WAITING 4 /* cleared when op is woken */ | 97 | #define FSCACHE_OP_WAITING 4 /* cleared when op is woken */ |
98 | #define FSCACHE_OP_EXCLUSIVE 5 /* exclusive op, other ops must wait */ | 98 | #define FSCACHE_OP_EXCLUSIVE 5 /* exclusive op, other ops must wait */ |
99 | #define FSCACHE_OP_DEC_READ_CNT 6 /* decrement object->n_reads on destruction */ | 99 | #define FSCACHE_OP_DEC_READ_CNT 6 /* decrement object->n_reads on destruction */ |
100 | #define FSCACHE_OP_KEEP_FLAGS 0x0070 /* flags to keep when repurposing an op */ | 100 | #define FSCACHE_OP_UNUSE_COOKIE 7 /* call fscache_unuse_cookie() on completion */ |
101 | #define FSCACHE_OP_KEEP_FLAGS 0x00f0 /* flags to keep when repurposing an op */ | ||
101 | 102 | ||
102 | enum fscache_operation_state state; | 103 | enum fscache_operation_state state; |
103 | atomic_t usage; | 104 | atomic_t usage; |
@@ -150,7 +151,7 @@ struct fscache_retrieval { | |||
150 | void *context; /* netfs read context (pinned) */ | 151 | void *context; /* netfs read context (pinned) */ |
151 | struct list_head to_do; /* list of things to be done by the backend */ | 152 | struct list_head to_do; /* list of things to be done by the backend */ |
152 | unsigned long start_time; /* time at which retrieval started */ | 153 | unsigned long start_time; /* time at which retrieval started */ |
153 | unsigned n_pages; /* number of pages to be retrieved */ | 154 | atomic_t n_pages; /* number of pages to be retrieved */ |
154 | }; | 155 | }; |
155 | 156 | ||
156 | typedef int (*fscache_page_retrieval_func_t)(struct fscache_retrieval *op, | 157 | typedef int (*fscache_page_retrieval_func_t)(struct fscache_retrieval *op, |
@@ -194,15 +195,14 @@ static inline void fscache_enqueue_retrieval(struct fscache_retrieval *op) | |||
194 | static inline void fscache_retrieval_complete(struct fscache_retrieval *op, | 195 | static inline void fscache_retrieval_complete(struct fscache_retrieval *op, |
195 | int n_pages) | 196 | int n_pages) |
196 | { | 197 | { |
197 | op->n_pages -= n_pages; | 198 | atomic_sub(n_pages, &op->n_pages); |
198 | if (op->n_pages <= 0) | 199 | if (atomic_read(&op->n_pages) <= 0) |
199 | fscache_op_complete(&op->op, true); | 200 | fscache_op_complete(&op->op, true); |
200 | } | 201 | } |
201 | 202 | ||
202 | /** | 203 | /** |
203 | * fscache_put_retrieval - Drop a reference to a retrieval operation | 204 | * fscache_put_retrieval - Drop a reference to a retrieval operation |
204 | * @op: The retrieval operation affected | 205 | * @op: The retrieval operation affected |
205 | * @n_pages: The number of pages to account for | ||
206 | * | 206 | * |
207 | * Drop a reference to a retrieval operation. | 207 | * Drop a reference to a retrieval operation. |
208 | */ | 208 | */ |
@@ -314,6 +314,7 @@ struct fscache_cache_ops { | |||
314 | struct fscache_cookie { | 314 | struct fscache_cookie { |
315 | atomic_t usage; /* number of users of this cookie */ | 315 | atomic_t usage; /* number of users of this cookie */ |
316 | atomic_t n_children; /* number of children of this cookie */ | 316 | atomic_t n_children; /* number of children of this cookie */ |
317 | atomic_t n_active; /* number of active users of netfs ptrs */ | ||
317 | spinlock_t lock; | 318 | spinlock_t lock; |
318 | spinlock_t stores_lock; /* lock on page store tree */ | 319 | spinlock_t stores_lock; /* lock on page store tree */ |
319 | struct hlist_head backing_objects; /* object(s) backing this file/index */ | 320 | struct hlist_head backing_objects; /* object(s) backing this file/index */ |
@@ -326,13 +327,11 @@ struct fscache_cookie { | |||
326 | 327 | ||
327 | unsigned long flags; | 328 | unsigned long flags; |
328 | #define FSCACHE_COOKIE_LOOKING_UP 0 /* T if non-index cookie being looked up still */ | 329 | #define FSCACHE_COOKIE_LOOKING_UP 0 /* T if non-index cookie being looked up still */ |
329 | #define FSCACHE_COOKIE_CREATING 1 /* T if non-index object being created still */ | 330 | #define FSCACHE_COOKIE_NO_DATA_YET 1 /* T if new object with no cached data yet */ |
330 | #define FSCACHE_COOKIE_NO_DATA_YET 2 /* T if new object with no cached data yet */ | 331 | #define FSCACHE_COOKIE_UNAVAILABLE 2 /* T if cookie is unavailable (error, etc) */ |
331 | #define FSCACHE_COOKIE_PENDING_FILL 3 /* T if pending initial fill on object */ | 332 | #define FSCACHE_COOKIE_INVALIDATING 3 /* T if cookie is being invalidated */ |
332 | #define FSCACHE_COOKIE_FILLING 4 /* T if filling object incrementally */ | 333 | #define FSCACHE_COOKIE_RELINQUISHED 4 /* T if cookie has been relinquished */ |
333 | #define FSCACHE_COOKIE_UNAVAILABLE 5 /* T if cookie is unavailable (error, etc) */ | 334 | #define FSCACHE_COOKIE_RETIRED 5 /* T if cookie was retired */ |
334 | #define FSCACHE_COOKIE_WAITING_ON_READS 6 /* T if cookie is waiting on reads */ | ||
335 | #define FSCACHE_COOKIE_INVALIDATING 7 /* T if cookie is being invalidated */ | ||
336 | }; | 335 | }; |
337 | 336 | ||
338 | extern struct fscache_cookie fscache_fsdef_index; | 337 | extern struct fscache_cookie fscache_fsdef_index; |
@@ -341,45 +340,40 @@ extern struct fscache_cookie fscache_fsdef_index; | |||
341 | * Event list for fscache_object::{event_mask,events} | 340 | * Event list for fscache_object::{event_mask,events} |
342 | */ | 341 | */ |
343 | enum { | 342 | enum { |
344 | FSCACHE_OBJECT_EV_REQUEUE, /* T if object should be requeued */ | 343 | FSCACHE_OBJECT_EV_NEW_CHILD, /* T if object has a new child */ |
344 | FSCACHE_OBJECT_EV_PARENT_READY, /* T if object's parent is ready */ | ||
345 | FSCACHE_OBJECT_EV_UPDATE, /* T if object should be updated */ | 345 | FSCACHE_OBJECT_EV_UPDATE, /* T if object should be updated */ |
346 | FSCACHE_OBJECT_EV_INVALIDATE, /* T if cache requested object invalidation */ | 346 | FSCACHE_OBJECT_EV_INVALIDATE, /* T if cache requested object invalidation */ |
347 | FSCACHE_OBJECT_EV_CLEARED, /* T if accessors all gone */ | 347 | FSCACHE_OBJECT_EV_CLEARED, /* T if accessors all gone */ |
348 | FSCACHE_OBJECT_EV_ERROR, /* T if fatal error occurred during processing */ | 348 | FSCACHE_OBJECT_EV_ERROR, /* T if fatal error occurred during processing */ |
349 | FSCACHE_OBJECT_EV_RELEASE, /* T if netfs requested object release */ | 349 | FSCACHE_OBJECT_EV_KILL, /* T if netfs relinquished or cache withdrew object */ |
350 | FSCACHE_OBJECT_EV_RETIRE, /* T if netfs requested object retirement */ | ||
351 | FSCACHE_OBJECT_EV_WITHDRAW, /* T if cache requested object withdrawal */ | ||
352 | NR_FSCACHE_OBJECT_EVENTS | 350 | NR_FSCACHE_OBJECT_EVENTS |
353 | }; | 351 | }; |
354 | 352 | ||
355 | #define FSCACHE_OBJECT_EVENTS_MASK ((1UL << NR_FSCACHE_OBJECT_EVENTS) - 1) | 353 | #define FSCACHE_OBJECT_EVENTS_MASK ((1UL << NR_FSCACHE_OBJECT_EVENTS) - 1) |
356 | 354 | ||
357 | /* | 355 | /* |
356 | * States for object state machine. | ||
357 | */ | ||
358 | struct fscache_transition { | ||
359 | unsigned long events; | ||
360 | const struct fscache_state *transit_to; | ||
361 | }; | ||
362 | |||
363 | struct fscache_state { | ||
364 | char name[24]; | ||
365 | char short_name[8]; | ||
366 | const struct fscache_state *(*work)(struct fscache_object *object, | ||
367 | int event); | ||
368 | const struct fscache_transition transitions[]; | ||
369 | }; | ||
370 | |||
371 | /* | ||
358 | * on-disk cache file or index handle | 372 | * on-disk cache file or index handle |
359 | */ | 373 | */ |
360 | struct fscache_object { | 374 | struct fscache_object { |
361 | enum fscache_object_state { | 375 | const struct fscache_state *state; /* Object state machine state */ |
362 | FSCACHE_OBJECT_INIT, /* object in initial unbound state */ | 376 | const struct fscache_transition *oob_table; /* OOB state transition table */ |
363 | FSCACHE_OBJECT_LOOKING_UP, /* looking up object */ | ||
364 | FSCACHE_OBJECT_CREATING, /* creating object */ | ||
365 | |||
366 | /* active states */ | ||
367 | FSCACHE_OBJECT_AVAILABLE, /* cleaning up object after creation */ | ||
368 | FSCACHE_OBJECT_ACTIVE, /* object is usable */ | ||
369 | FSCACHE_OBJECT_INVALIDATING, /* object is invalidating */ | ||
370 | FSCACHE_OBJECT_UPDATING, /* object is updating */ | ||
371 | |||
372 | /* terminal states */ | ||
373 | FSCACHE_OBJECT_DYING, /* object waiting for accessors to finish */ | ||
374 | FSCACHE_OBJECT_LC_DYING, /* object cleaning up after lookup/create */ | ||
375 | FSCACHE_OBJECT_ABORT_INIT, /* abort the init state */ | ||
376 | FSCACHE_OBJECT_RELEASING, /* releasing object */ | ||
377 | FSCACHE_OBJECT_RECYCLING, /* retiring object */ | ||
378 | FSCACHE_OBJECT_WITHDRAWING, /* withdrawing object */ | ||
379 | FSCACHE_OBJECT_DEAD, /* object is now dead */ | ||
380 | FSCACHE_OBJECT__NSTATES | ||
381 | } state; | ||
382 | |||
383 | int debug_id; /* debugging ID */ | 377 | int debug_id; /* debugging ID */ |
384 | int n_children; /* number of child objects */ | 378 | int n_children; /* number of child objects */ |
385 | int n_ops; /* number of extant ops on object */ | 379 | int n_ops; /* number of extant ops on object */ |
@@ -390,6 +384,7 @@ struct fscache_object { | |||
390 | spinlock_t lock; /* state and operations lock */ | 384 | spinlock_t lock; /* state and operations lock */ |
391 | 385 | ||
392 | unsigned long lookup_jif; /* time at which lookup started */ | 386 | unsigned long lookup_jif; /* time at which lookup started */ |
387 | unsigned long oob_event_mask; /* OOB events this object is interested in */ | ||
393 | unsigned long event_mask; /* events this object is interested in */ | 388 | unsigned long event_mask; /* events this object is interested in */ |
394 | unsigned long events; /* events to be processed by this object | 389 | unsigned long events; /* events to be processed by this object |
395 | * (order is important - using fls) */ | 390 | * (order is important - using fls) */ |
@@ -398,6 +393,9 @@ struct fscache_object { | |||
398 | #define FSCACHE_OBJECT_LOCK 0 /* T if object is busy being processed */ | 393 | #define FSCACHE_OBJECT_LOCK 0 /* T if object is busy being processed */ |
399 | #define FSCACHE_OBJECT_PENDING_WRITE 1 /* T if object has pending write */ | 394 | #define FSCACHE_OBJECT_PENDING_WRITE 1 /* T if object has pending write */ |
400 | #define FSCACHE_OBJECT_WAITING 2 /* T if object is waiting on its parent */ | 395 | #define FSCACHE_OBJECT_WAITING 2 /* T if object is waiting on its parent */ |
396 | #define FSCACHE_OBJECT_IS_LIVE 3 /* T if object is not withdrawn or relinquished */ | ||
397 | #define FSCACHE_OBJECT_IS_LOOKED_UP 4 /* T if object has been looked up */ | ||
398 | #define FSCACHE_OBJECT_IS_AVAILABLE 5 /* T if object has become active */ | ||
401 | 399 | ||
402 | struct list_head cache_link; /* link in cache->object_list */ | 400 | struct list_head cache_link; /* link in cache->object_list */ |
403 | struct hlist_node cookie_link; /* link in cookie->backing_objects */ | 401 | struct hlist_node cookie_link; /* link in cookie->backing_objects */ |
@@ -415,62 +413,40 @@ struct fscache_object { | |||
415 | loff_t store_limit_l; /* current storage limit */ | 413 | loff_t store_limit_l; /* current storage limit */ |
416 | }; | 414 | }; |
417 | 415 | ||
418 | extern const char *fscache_object_states[]; | 416 | extern void fscache_object_init(struct fscache_object *, struct fscache_cookie *, |
417 | struct fscache_cache *); | ||
418 | extern void fscache_object_destroy(struct fscache_object *); | ||
419 | 419 | ||
420 | #define fscache_object_is_active(obj) \ | 420 | extern void fscache_object_lookup_negative(struct fscache_object *object); |
421 | (!test_bit(FSCACHE_IOERROR, &(obj)->cache->flags) && \ | 421 | extern void fscache_obtained_object(struct fscache_object *object); |
422 | (obj)->state >= FSCACHE_OBJECT_AVAILABLE && \ | ||
423 | (obj)->state < FSCACHE_OBJECT_DYING) | ||
424 | 422 | ||
425 | #define fscache_object_is_dead(obj) \ | 423 | static inline bool fscache_object_is_live(struct fscache_object *object) |
426 | (test_bit(FSCACHE_IOERROR, &(obj)->cache->flags) && \ | 424 | { |
427 | (obj)->state >= FSCACHE_OBJECT_DYING) | 425 | return test_bit(FSCACHE_OBJECT_IS_LIVE, &object->flags); |
426 | } | ||
428 | 427 | ||
429 | extern void fscache_object_work_func(struct work_struct *work); | 428 | static inline bool fscache_object_is_dying(struct fscache_object *object) |
429 | { | ||
430 | return !fscache_object_is_live(object); | ||
431 | } | ||
430 | 432 | ||
431 | /** | 433 | static inline bool fscache_object_is_available(struct fscache_object *object) |
432 | * fscache_object_init - Initialise a cache object description | ||
433 | * @object: Object description | ||
434 | * | ||
435 | * Initialise a cache object description to its basic values. | ||
436 | * | ||
437 | * See Documentation/filesystems/caching/backend-api.txt for a complete | ||
438 | * description. | ||
439 | */ | ||
440 | static inline | ||
441 | void fscache_object_init(struct fscache_object *object, | ||
442 | struct fscache_cookie *cookie, | ||
443 | struct fscache_cache *cache) | ||
444 | { | 434 | { |
445 | atomic_inc(&cache->object_count); | 435 | return test_bit(FSCACHE_OBJECT_IS_AVAILABLE, &object->flags); |
446 | |||
447 | object->state = FSCACHE_OBJECT_INIT; | ||
448 | spin_lock_init(&object->lock); | ||
449 | INIT_LIST_HEAD(&object->cache_link); | ||
450 | INIT_HLIST_NODE(&object->cookie_link); | ||
451 | INIT_WORK(&object->work, fscache_object_work_func); | ||
452 | INIT_LIST_HEAD(&object->dependents); | ||
453 | INIT_LIST_HEAD(&object->dep_link); | ||
454 | INIT_LIST_HEAD(&object->pending_ops); | ||
455 | object->n_children = 0; | ||
456 | object->n_ops = object->n_in_progress = object->n_exclusive = 0; | ||
457 | object->events = object->event_mask = 0; | ||
458 | object->flags = 0; | ||
459 | object->store_limit = 0; | ||
460 | object->store_limit_l = 0; | ||
461 | object->cache = cache; | ||
462 | object->cookie = cookie; | ||
463 | object->parent = NULL; | ||
464 | } | 436 | } |
465 | 437 | ||
466 | extern void fscache_object_lookup_negative(struct fscache_object *object); | 438 | static inline bool fscache_object_is_active(struct fscache_object *object) |
467 | extern void fscache_obtained_object(struct fscache_object *object); | 439 | { |
440 | return fscache_object_is_available(object) && | ||
441 | fscache_object_is_live(object) && | ||
442 | !test_bit(FSCACHE_IOERROR, &object->cache->flags); | ||
443 | } | ||
468 | 444 | ||
469 | #ifdef CONFIG_FSCACHE_OBJECT_LIST | 445 | static inline bool fscache_object_is_dead(struct fscache_object *object) |
470 | extern void fscache_object_destroy(struct fscache_object *object); | 446 | { |
471 | #else | 447 | return fscache_object_is_dying(object) && |
472 | #define fscache_object_destroy(object) do {} while(0) | 448 | test_bit(FSCACHE_IOERROR, &object->cache->flags); |
473 | #endif | 449 | } |
474 | 450 | ||
475 | /** | 451 | /** |
476 | * fscache_object_destroyed - Note destruction of an object in a cache | 452 | * fscache_object_destroyed - Note destruction of an object in a cache |
@@ -531,6 +507,33 @@ static inline void fscache_end_io(struct fscache_retrieval *op, | |||
531 | op->end_io_func(page, op->context, error); | 507 | op->end_io_func(page, op->context, error); |
532 | } | 508 | } |
533 | 509 | ||
510 | /** | ||
511 | * fscache_use_cookie - Request usage of cookie attached to an object | ||
512 | * @object: Object description | ||
513 | * | ||
514 | * Request usage of the cookie attached to an object. NULL is returned if the | ||
515 | * relinquishment had reduced the cookie usage count to 0. | ||
516 | */ | ||
517 | static inline bool fscache_use_cookie(struct fscache_object *object) | ||
518 | { | ||
519 | struct fscache_cookie *cookie = object->cookie; | ||
520 | return atomic_inc_not_zero(&cookie->n_active) != 0; | ||
521 | } | ||
522 | |||
523 | /** | ||
524 | * fscache_unuse_cookie - Cease usage of cookie attached to an object | ||
525 | * @object: Object description | ||
526 | * | ||
527 | * Cease usage of the cookie attached to an object. When the users count | ||
528 | * reaches zero then the cookie relinquishment will be permitted to proceed. | ||
529 | */ | ||
530 | static inline void fscache_unuse_cookie(struct fscache_object *object) | ||
531 | { | ||
532 | struct fscache_cookie *cookie = object->cookie; | ||
533 | if (atomic_dec_and_test(&cookie->n_active)) | ||
534 | wake_up_atomic_t(&cookie->n_active); | ||
535 | } | ||
536 | |||
534 | /* | 537 | /* |
535 | * out-of-line cache backend functions | 538 | * out-of-line cache backend functions |
536 | */ | 539 | */ |
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index a78680a92dba..1c804b057fb1 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
@@ -38,7 +38,7 @@ static inline int fsnotify_parent(struct path *path, struct dentry *dentry, __u3 | |||
38 | static inline int fsnotify_perm(struct file *file, int mask) | 38 | static inline int fsnotify_perm(struct file *file, int mask) |
39 | { | 39 | { |
40 | struct path *path = &file->f_path; | 40 | struct path *path = &file->f_path; |
41 | struct inode *inode = path->dentry->d_inode; | 41 | struct inode *inode = file_inode(file); |
42 | __u32 fsnotify_mask = 0; | 42 | __u32 fsnotify_mask = 0; |
43 | int ret; | 43 | int ret; |
44 | 44 | ||
@@ -192,7 +192,7 @@ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry) | |||
192 | static inline void fsnotify_access(struct file *file) | 192 | static inline void fsnotify_access(struct file *file) |
193 | { | 193 | { |
194 | struct path *path = &file->f_path; | 194 | struct path *path = &file->f_path; |
195 | struct inode *inode = path->dentry->d_inode; | 195 | struct inode *inode = file_inode(file); |
196 | __u32 mask = FS_ACCESS; | 196 | __u32 mask = FS_ACCESS; |
197 | 197 | ||
198 | if (S_ISDIR(inode->i_mode)) | 198 | if (S_ISDIR(inode->i_mode)) |
@@ -210,7 +210,7 @@ static inline void fsnotify_access(struct file *file) | |||
210 | static inline void fsnotify_modify(struct file *file) | 210 | static inline void fsnotify_modify(struct file *file) |
211 | { | 211 | { |
212 | struct path *path = &file->f_path; | 212 | struct path *path = &file->f_path; |
213 | struct inode *inode = path->dentry->d_inode; | 213 | struct inode *inode = file_inode(file); |
214 | __u32 mask = FS_MODIFY; | 214 | __u32 mask = FS_MODIFY; |
215 | 215 | ||
216 | if (S_ISDIR(inode->i_mode)) | 216 | if (S_ISDIR(inode->i_mode)) |
@@ -228,7 +228,7 @@ static inline void fsnotify_modify(struct file *file) | |||
228 | static inline void fsnotify_open(struct file *file) | 228 | static inline void fsnotify_open(struct file *file) |
229 | { | 229 | { |
230 | struct path *path = &file->f_path; | 230 | struct path *path = &file->f_path; |
231 | struct inode *inode = path->dentry->d_inode; | 231 | struct inode *inode = file_inode(file); |
232 | __u32 mask = FS_OPEN; | 232 | __u32 mask = FS_OPEN; |
233 | 233 | ||
234 | if (S_ISDIR(inode->i_mode)) | 234 | if (S_ISDIR(inode->i_mode)) |
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 99d0fbcbaf79..9f15c0064c50 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -566,10 +566,6 @@ static inline ssize_t ftrace_filter_write(struct file *file, const char __user * | |||
566 | size_t cnt, loff_t *ppos) { return -ENODEV; } | 566 | size_t cnt, loff_t *ppos) { return -ENODEV; } |
567 | static inline ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf, | 567 | static inline ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf, |
568 | size_t cnt, loff_t *ppos) { return -ENODEV; } | 568 | size_t cnt, loff_t *ppos) { return -ENODEV; } |
569 | static inline loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int whence) | ||
570 | { | ||
571 | return -ENODEV; | ||
572 | } | ||
573 | static inline int | 569 | static inline int |
574 | ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; } | 570 | ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; } |
575 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 571 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
@@ -828,10 +824,15 @@ enum ftrace_dump_mode; | |||
828 | 824 | ||
829 | extern enum ftrace_dump_mode ftrace_dump_on_oops; | 825 | extern enum ftrace_dump_mode ftrace_dump_on_oops; |
830 | 826 | ||
827 | extern void disable_trace_on_warning(void); | ||
828 | extern int __disable_trace_on_warning; | ||
829 | |||
831 | #ifdef CONFIG_PREEMPT | 830 | #ifdef CONFIG_PREEMPT |
832 | #define INIT_TRACE_RECURSION .trace_recursion = 0, | 831 | #define INIT_TRACE_RECURSION .trace_recursion = 0, |
833 | #endif | 832 | #endif |
834 | 833 | ||
834 | #else /* CONFIG_TRACING */ | ||
835 | static inline void disable_trace_on_warning(void) { } | ||
835 | #endif /* CONFIG_TRACING */ | 836 | #endif /* CONFIG_TRACING */ |
836 | 837 | ||
837 | #ifndef INIT_TRACE_RECURSION | 838 | #ifndef INIT_TRACE_RECURSION |
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 4372658c73ae..120d57a1c3a5 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -78,6 +78,11 @@ struct trace_iterator { | |||
78 | /* trace_seq for __print_flags() and __print_symbolic() etc. */ | 78 | /* trace_seq for __print_flags() and __print_symbolic() etc. */ |
79 | struct trace_seq tmp_seq; | 79 | struct trace_seq tmp_seq; |
80 | 80 | ||
81 | cpumask_var_t started; | ||
82 | |||
83 | /* it's true when current open file is snapshot */ | ||
84 | bool snapshot; | ||
85 | |||
81 | /* The below is zeroed out in pipe_read */ | 86 | /* The below is zeroed out in pipe_read */ |
82 | struct trace_seq seq; | 87 | struct trace_seq seq; |
83 | struct trace_entry *ent; | 88 | struct trace_entry *ent; |
@@ -90,10 +95,7 @@ struct trace_iterator { | |||
90 | loff_t pos; | 95 | loff_t pos; |
91 | long idx; | 96 | long idx; |
92 | 97 | ||
93 | cpumask_var_t started; | 98 | /* All new field here will be zeroed out in pipe_read */ |
94 | |||
95 | /* it's true when current open file is snapshot */ | ||
96 | bool snapshot; | ||
97 | }; | 99 | }; |
98 | 100 | ||
99 | enum trace_iter_flags { | 101 | enum trace_iter_flags { |
@@ -332,7 +334,7 @@ extern int trace_define_field(struct ftrace_event_call *call, const char *type, | |||
332 | const char *name, int offset, int size, | 334 | const char *name, int offset, int size, |
333 | int is_signed, int filter_type); | 335 | int is_signed, int filter_type); |
334 | extern int trace_add_event_call(struct ftrace_event_call *call); | 336 | extern int trace_add_event_call(struct ftrace_event_call *call); |
335 | extern void trace_remove_event_call(struct ftrace_event_call *call); | 337 | extern int trace_remove_event_call(struct ftrace_event_call *call); |
336 | 338 | ||
337 | #define is_signed_type(type) (((type)(-1)) < (type)1) | 339 | #define is_signed_type(type) (((type)(-1)) < (type)1) |
338 | 340 | ||
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 0f615eb23d05..9b4dd491f7e8 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -209,7 +209,7 @@ static inline int allocflags_to_migratetype(gfp_t gfp_flags) | |||
209 | * 0x9 => DMA or NORMAL (MOVABLE+DMA) | 209 | * 0x9 => DMA or NORMAL (MOVABLE+DMA) |
210 | * 0xa => MOVABLE (Movable is valid only if HIGHMEM is set too) | 210 | * 0xa => MOVABLE (Movable is valid only if HIGHMEM is set too) |
211 | * 0xb => BAD (MOVABLE+HIGHMEM+DMA) | 211 | * 0xb => BAD (MOVABLE+HIGHMEM+DMA) |
212 | * 0xc => DMA32 (MOVABLE+HIGHMEM+DMA32) | 212 | * 0xc => DMA32 (MOVABLE+DMA32) |
213 | * 0xd => BAD (MOVABLE+DMA32+DMA) | 213 | * 0xd => BAD (MOVABLE+DMA32+DMA) |
214 | * 0xe => BAD (MOVABLE+DMA32+HIGHMEM) | 214 | * 0xe => BAD (MOVABLE+DMA32+HIGHMEM) |
215 | * 0xf => BAD (MOVABLE+DMA32+HIGHMEM+DMA) | 215 | * 0xf => BAD (MOVABLE+DMA32+HIGHMEM+DMA) |
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index c1d6555d2567..05bcc0903766 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -128,7 +128,7 @@ extern void synchronize_irq(unsigned int irq); | |||
128 | # define synchronize_irq(irq) barrier() | 128 | # define synchronize_irq(irq) barrier() |
129 | #endif | 129 | #endif |
130 | 130 | ||
131 | #if defined(CONFIG_TINY_RCU) || defined(CONFIG_TINY_PREEMPT_RCU) | 131 | #if defined(CONFIG_TINY_RCU) |
132 | 132 | ||
133 | static inline void rcu_nmi_enter(void) | 133 | static inline void rcu_nmi_enter(void) |
134 | { | 134 | { |
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index 528454c2caa9..b60de92e2edc 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h | |||
@@ -60,9 +60,9 @@ extern pmd_t *page_check_address_pmd(struct page *page, | |||
60 | #define HPAGE_PMD_NR (1<<HPAGE_PMD_ORDER) | 60 | #define HPAGE_PMD_NR (1<<HPAGE_PMD_ORDER) |
61 | 61 | ||
62 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 62 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
63 | #define HPAGE_PMD_SHIFT HPAGE_SHIFT | 63 | #define HPAGE_PMD_SHIFT PMD_SHIFT |
64 | #define HPAGE_PMD_MASK HPAGE_MASK | 64 | #define HPAGE_PMD_SIZE ((1UL) << HPAGE_PMD_SHIFT) |
65 | #define HPAGE_PMD_SIZE HPAGE_SIZE | 65 | #define HPAGE_PMD_MASK (~(HPAGE_PMD_SIZE - 1)) |
66 | 66 | ||
67 | extern bool is_vma_temporary_stack(struct vm_area_struct *vma); | 67 | extern bool is_vma_temporary_stack(struct vm_area_struct *vma); |
68 | 68 | ||
@@ -123,7 +123,7 @@ extern void __split_huge_page_pmd(struct vm_area_struct *vma, | |||
123 | } while (0) | 123 | } while (0) |
124 | extern void split_huge_page_pmd_mm(struct mm_struct *mm, unsigned long address, | 124 | extern void split_huge_page_pmd_mm(struct mm_struct *mm, unsigned long address, |
125 | pmd_t *pmd); | 125 | pmd_t *pmd); |
126 | #if HPAGE_PMD_ORDER > MAX_ORDER | 126 | #if HPAGE_PMD_ORDER >= MAX_ORDER |
127 | #error "hugepages can't be allocated by the buddy allocator" | 127 | #error "hugepages can't be allocated by the buddy allocator" |
128 | #endif | 128 | #endif |
129 | extern int hugepage_madvise(struct vm_area_struct *vma, | 129 | extern int hugepage_madvise(struct vm_area_struct *vma, |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 6b4890fa57e7..c2b1801a160b 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -55,7 +55,6 @@ void __unmap_hugepage_range_final(struct mmu_gather *tlb, | |||
55 | void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma, | 55 | void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma, |
56 | unsigned long start, unsigned long end, | 56 | unsigned long start, unsigned long end, |
57 | struct page *ref_page); | 57 | struct page *ref_page); |
58 | int hugetlb_prefault(struct address_space *, struct vm_area_struct *); | ||
59 | void hugetlb_report_meminfo(struct seq_file *); | 58 | void hugetlb_report_meminfo(struct seq_file *); |
60 | int hugetlb_report_node_meminfo(int, char *); | 59 | int hugetlb_report_node_meminfo(int, char *); |
61 | void hugetlb_show_meminfo(void); | 60 | void hugetlb_show_meminfo(void); |
@@ -69,6 +68,10 @@ void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); | |||
69 | int dequeue_hwpoisoned_huge_page(struct page *page); | 68 | int dequeue_hwpoisoned_huge_page(struct page *page); |
70 | void copy_huge_page(struct page *dst, struct page *src); | 69 | void copy_huge_page(struct page *dst, struct page *src); |
71 | 70 | ||
71 | #ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE | ||
72 | pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud); | ||
73 | #endif | ||
74 | |||
72 | extern unsigned long hugepages_treat_as_movable; | 75 | extern unsigned long hugepages_treat_as_movable; |
73 | extern const unsigned long hugetlb_zero, hugetlb_infinity; | 76 | extern const unsigned long hugetlb_zero, hugetlb_infinity; |
74 | extern int sysctl_hugetlb_shm_group; | 77 | extern int sysctl_hugetlb_shm_group; |
@@ -110,7 +113,6 @@ static inline unsigned long hugetlb_total_pages(void) | |||
110 | #define follow_hugetlb_page(m,v,p,vs,a,b,i,w) ({ BUG(); 0; }) | 113 | #define follow_hugetlb_page(m,v,p,vs,a,b,i,w) ({ BUG(); 0; }) |
111 | #define follow_huge_addr(mm, addr, write) ERR_PTR(-EINVAL) | 114 | #define follow_huge_addr(mm, addr, write) ERR_PTR(-EINVAL) |
112 | #define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; }) | 115 | #define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; }) |
113 | #define hugetlb_prefault(mapping, vma) ({ BUG(); 0; }) | ||
114 | static inline void hugetlb_report_meminfo(struct seq_file *m) | 116 | static inline void hugetlb_report_meminfo(struct seq_file *m) |
115 | { | 117 | { |
116 | } | 118 | } |
@@ -358,6 +360,17 @@ static inline int hstate_index(struct hstate *h) | |||
358 | return h - hstates; | 360 | return h - hstates; |
359 | } | 361 | } |
360 | 362 | ||
363 | pgoff_t __basepage_index(struct page *page); | ||
364 | |||
365 | /* Return page->index in PAGE_SIZE units */ | ||
366 | static inline pgoff_t basepage_index(struct page *page) | ||
367 | { | ||
368 | if (!PageCompound(page)) | ||
369 | return page->index; | ||
370 | |||
371 | return __basepage_index(page); | ||
372 | } | ||
373 | |||
361 | #else /* CONFIG_HUGETLB_PAGE */ | 374 | #else /* CONFIG_HUGETLB_PAGE */ |
362 | struct hstate {}; | 375 | struct hstate {}; |
363 | #define alloc_huge_page_node(h, nid) NULL | 376 | #define alloc_huge_page_node(h, nid) NULL |
@@ -378,6 +391,11 @@ static inline unsigned int pages_per_huge_page(struct hstate *h) | |||
378 | } | 391 | } |
379 | #define hstate_index_to_shift(index) 0 | 392 | #define hstate_index_to_shift(index) 0 |
380 | #define hstate_index(h) 0 | 393 | #define hstate_index(h) 0 |
394 | |||
395 | static inline pgoff_t basepage_index(struct page *page) | ||
396 | { | ||
397 | return page->index; | ||
398 | } | ||
381 | #endif /* CONFIG_HUGETLB_PAGE */ | 399 | #endif /* CONFIG_HUGETLB_PAGE */ |
382 | 400 | ||
383 | #endif /* _LINUX_HUGETLB_H */ | 401 | #endif /* _LINUX_HUGETLB_H */ |
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index c2559847d7ee..fae8bac907ef 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h | |||
@@ -909,6 +909,7 @@ enum vmbus_channel_state { | |||
909 | CHANNEL_OFFER_STATE, | 909 | CHANNEL_OFFER_STATE, |
910 | CHANNEL_OPENING_STATE, | 910 | CHANNEL_OPENING_STATE, |
911 | CHANNEL_OPEN_STATE, | 911 | CHANNEL_OPEN_STATE, |
912 | CHANNEL_OPENED_STATE, | ||
912 | }; | 913 | }; |
913 | 914 | ||
914 | struct vmbus_channel_debug_info { | 915 | struct vmbus_channel_debug_info { |
@@ -1046,6 +1047,38 @@ struct vmbus_channel { | |||
1046 | * preserve the earlier behavior. | 1047 | * preserve the earlier behavior. |
1047 | */ | 1048 | */ |
1048 | u32 target_vp; | 1049 | u32 target_vp; |
1050 | /* | ||
1051 | * Support for sub-channels. For high performance devices, | ||
1052 | * it will be useful to have multiple sub-channels to support | ||
1053 | * a scalable communication infrastructure with the host. | ||
1054 | * The support for sub-channels is implemented as an extention | ||
1055 | * to the current infrastructure. | ||
1056 | * The initial offer is considered the primary channel and this | ||
1057 | * offer message will indicate if the host supports sub-channels. | ||
1058 | * The guest is free to ask for sub-channels to be offerred and can | ||
1059 | * open these sub-channels as a normal "primary" channel. However, | ||
1060 | * all sub-channels will have the same type and instance guids as the | ||
1061 | * primary channel. Requests sent on a given channel will result in a | ||
1062 | * response on the same channel. | ||
1063 | */ | ||
1064 | |||
1065 | /* | ||
1066 | * Sub-channel creation callback. This callback will be called in | ||
1067 | * process context when a sub-channel offer is received from the host. | ||
1068 | * The guest can open the sub-channel in the context of this callback. | ||
1069 | */ | ||
1070 | void (*sc_creation_callback)(struct vmbus_channel *new_sc); | ||
1071 | |||
1072 | spinlock_t sc_lock; | ||
1073 | /* | ||
1074 | * All Sub-channels of a primary channel are linked here. | ||
1075 | */ | ||
1076 | struct list_head sc_list; | ||
1077 | /* | ||
1078 | * The primary channel this sub-channel belongs to. | ||
1079 | * This will be NULL for the primary channel. | ||
1080 | */ | ||
1081 | struct vmbus_channel *primary_channel; | ||
1049 | }; | 1082 | }; |
1050 | 1083 | ||
1051 | static inline void set_channel_read_state(struct vmbus_channel *c, bool state) | 1084 | static inline void set_channel_read_state(struct vmbus_channel *c, bool state) |
@@ -1057,6 +1090,34 @@ void vmbus_onmessage(void *context); | |||
1057 | 1090 | ||
1058 | int vmbus_request_offers(void); | 1091 | int vmbus_request_offers(void); |
1059 | 1092 | ||
1093 | /* | ||
1094 | * APIs for managing sub-channels. | ||
1095 | */ | ||
1096 | |||
1097 | void vmbus_set_sc_create_callback(struct vmbus_channel *primary_channel, | ||
1098 | void (*sc_cr_cb)(struct vmbus_channel *new_sc)); | ||
1099 | |||
1100 | /* | ||
1101 | * Retrieve the (sub) channel on which to send an outgoing request. | ||
1102 | * When a primary channel has multiple sub-channels, we choose a | ||
1103 | * channel whose VCPU binding is closest to the VCPU on which | ||
1104 | * this call is being made. | ||
1105 | */ | ||
1106 | struct vmbus_channel *vmbus_get_outgoing_channel(struct vmbus_channel *primary); | ||
1107 | |||
1108 | /* | ||
1109 | * Check if sub-channels have already been offerred. This API will be useful | ||
1110 | * when the driver is unloaded after establishing sub-channels. In this case, | ||
1111 | * when the driver is re-loaded, the driver would have to check if the | ||
1112 | * subchannels have already been established before attempting to request | ||
1113 | * the creation of sub-channels. | ||
1114 | * This function returns TRUE to indicate that subchannels have already been | ||
1115 | * created. | ||
1116 | * This function should be invoked after setting the callback function for | ||
1117 | * sub-channel creation. | ||
1118 | */ | ||
1119 | bool vmbus_are_subchannels_present(struct vmbus_channel *primary); | ||
1120 | |||
1060 | /* The format must be the same as struct vmdata_gpa_direct */ | 1121 | /* The format must be the same as struct vmdata_gpa_direct */ |
1061 | struct vmbus_channel_packet_page_buffer { | 1122 | struct vmbus_channel_packet_page_buffer { |
1062 | u16 type; | 1123 | u16 type; |
@@ -1327,6 +1388,15 @@ void vmbus_driver_unregister(struct hv_driver *hv_driver); | |||
1327 | 0x8e, 0x77, 0x05, 0x58, 0xeb, 0x10, 0x73, 0xf8 \ | 1388 | 0x8e, 0x77, 0x05, 0x58, 0xeb, 0x10, 0x73, 0xf8 \ |
1328 | } | 1389 | } |
1329 | 1390 | ||
1391 | /* | ||
1392 | * Synthetic FC GUID | ||
1393 | * {2f9bcc4a-0069-4af3-b76b-6fd0be528cda} | ||
1394 | */ | ||
1395 | #define HV_SYNTHFC_GUID \ | ||
1396 | .guid = { \ | ||
1397 | 0x4A, 0xCC, 0x9B, 0x2F, 0x69, 0x00, 0xF3, 0x4A, \ | ||
1398 | 0xB7, 0x6B, 0x6F, 0xD0, 0xBE, 0x52, 0x8C, 0xDA \ | ||
1399 | } | ||
1330 | 1400 | ||
1331 | /* | 1401 | /* |
1332 | * Common header for Hyper-V ICs | 1402 | * Common header for Hyper-V ICs |
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 488debbef895..81cbbdb96aae 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
@@ -658,7 +658,6 @@ struct twl4030_power_data { | |||
658 | bool use_poweroff; /* Board is wired for TWL poweroff */ | 658 | bool use_poweroff; /* Board is wired for TWL poweroff */ |
659 | }; | 659 | }; |
660 | 660 | ||
661 | extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); | ||
662 | extern int twl4030_remove_script(u8 flags); | 661 | extern int twl4030_remove_script(u8 flags); |
663 | extern void twl4030_power_off(void); | 662 | extern void twl4030_power_off(void); |
664 | 663 | ||
@@ -726,7 +725,7 @@ struct twl4030_platform_data { | |||
726 | struct regulator_init_data *clk32kg; | 725 | struct regulator_init_data *clk32kg; |
727 | struct regulator_init_data *v1v8; | 726 | struct regulator_init_data *v1v8; |
728 | struct regulator_init_data *v2v1; | 727 | struct regulator_init_data *v2v1; |
729 | /* TWL6025 LDO regulators */ | 728 | /* TWL6032 LDO regulators */ |
730 | struct regulator_init_data *ldo1; | 729 | struct regulator_init_data *ldo1; |
731 | struct regulator_init_data *ldo2; | 730 | struct regulator_init_data *ldo2; |
732 | struct regulator_init_data *ldo3; | 731 | struct regulator_init_data *ldo3; |
@@ -736,7 +735,7 @@ struct twl4030_platform_data { | |||
736 | struct regulator_init_data *ldo7; | 735 | struct regulator_init_data *ldo7; |
737 | struct regulator_init_data *ldoln; | 736 | struct regulator_init_data *ldoln; |
738 | struct regulator_init_data *ldousb; | 737 | struct regulator_init_data *ldousb; |
739 | /* TWL6025 DCDC regulators */ | 738 | /* TWL6032 DCDC regulators */ |
740 | struct regulator_init_data *smps3; | 739 | struct regulator_init_data *smps3; |
741 | struct regulator_init_data *smps4; | 740 | struct regulator_init_data *smps4; |
742 | struct regulator_init_data *vio6025; | 741 | struct regulator_init_data *vio6025; |
@@ -753,7 +752,7 @@ struct twl_regulator_driver_data { | |||
753 | #define TPS_SUBSET BIT(1) /* tps659[23]0 have fewer LDOs */ | 752 | #define TPS_SUBSET BIT(1) /* tps659[23]0 have fewer LDOs */ |
754 | #define TWL5031 BIT(2) /* twl5031 has different registers */ | 753 | #define TWL5031 BIT(2) /* twl5031 has different registers */ |
755 | #define TWL6030_CLASS BIT(3) /* TWL6030 class */ | 754 | #define TWL6030_CLASS BIT(3) /* TWL6030 class */ |
756 | #define TWL6025_SUBCLASS BIT(4) /* TWL6025 has changed registers */ | 755 | #define TWL6032_SUBCLASS BIT(4) /* TWL6032 has changed registers */ |
757 | #define TWL4030_ALLOW_UNSUPPORTED BIT(5) /* Some voltages are possible | 756 | #define TWL4030_ALLOW_UNSUPPORTED BIT(5) /* Some voltages are possible |
758 | * but not officially supported. | 757 | * but not officially supported. |
759 | * This flag is necessary to | 758 | * This flag is necessary to |
@@ -840,20 +839,20 @@ static inline int twl4030charger_usb_en(int enable) { return 0; } | |||
840 | #define TWL6030_REG_CLK32KG 48 | 839 | #define TWL6030_REG_CLK32KG 48 |
841 | 840 | ||
842 | /* LDOs on 6025 have different names */ | 841 | /* LDOs on 6025 have different names */ |
843 | #define TWL6025_REG_LDO2 49 | 842 | #define TWL6032_REG_LDO2 49 |
844 | #define TWL6025_REG_LDO4 50 | 843 | #define TWL6032_REG_LDO4 50 |
845 | #define TWL6025_REG_LDO3 51 | 844 | #define TWL6032_REG_LDO3 51 |
846 | #define TWL6025_REG_LDO5 52 | 845 | #define TWL6032_REG_LDO5 52 |
847 | #define TWL6025_REG_LDO1 53 | 846 | #define TWL6032_REG_LDO1 53 |
848 | #define TWL6025_REG_LDO7 54 | 847 | #define TWL6032_REG_LDO7 54 |
849 | #define TWL6025_REG_LDO6 55 | 848 | #define TWL6032_REG_LDO6 55 |
850 | #define TWL6025_REG_LDOLN 56 | 849 | #define TWL6032_REG_LDOLN 56 |
851 | #define TWL6025_REG_LDOUSB 57 | 850 | #define TWL6032_REG_LDOUSB 57 |
852 | 851 | ||
853 | /* 6025 DCDC supplies */ | 852 | /* 6025 DCDC supplies */ |
854 | #define TWL6025_REG_SMPS3 58 | 853 | #define TWL6032_REG_SMPS3 58 |
855 | #define TWL6025_REG_SMPS4 59 | 854 | #define TWL6032_REG_SMPS4 59 |
856 | #define TWL6025_REG_VIO 60 | 855 | #define TWL6032_REG_VIO 60 |
857 | 856 | ||
858 | 857 | ||
859 | #endif /* End of __TWL4030_H */ | 858 | #endif /* End of __TWL4030_H */ |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 06b0ed0154a4..b0dc87a2a376 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -146,6 +146,7 @@ static inline u16 ieee80211_sn_sub(u16 sn1, u16 sn2) | |||
146 | #define IEEE80211_MAX_RTS_THRESHOLD 2353 | 146 | #define IEEE80211_MAX_RTS_THRESHOLD 2353 |
147 | #define IEEE80211_MAX_AID 2007 | 147 | #define IEEE80211_MAX_AID 2007 |
148 | #define IEEE80211_MAX_TIM_LEN 251 | 148 | #define IEEE80211_MAX_TIM_LEN 251 |
149 | #define IEEE80211_MAX_MESH_PEERINGS 63 | ||
149 | /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section | 150 | /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section |
150 | 6.2.1.1.2. | 151 | 6.2.1.1.2. |
151 | 152 | ||
@@ -1829,6 +1830,15 @@ enum ieee80211_key_len { | |||
1829 | WLAN_KEY_LEN_AES_CMAC = 16, | 1830 | WLAN_KEY_LEN_AES_CMAC = 16, |
1830 | }; | 1831 | }; |
1831 | 1832 | ||
1833 | #define IEEE80211_WEP_IV_LEN 4 | ||
1834 | #define IEEE80211_WEP_ICV_LEN 4 | ||
1835 | #define IEEE80211_CCMP_HDR_LEN 8 | ||
1836 | #define IEEE80211_CCMP_MIC_LEN 8 | ||
1837 | #define IEEE80211_CCMP_PN_LEN 6 | ||
1838 | #define IEEE80211_TKIP_IV_LEN 8 | ||
1839 | #define IEEE80211_TKIP_ICV_LEN 4 | ||
1840 | #define IEEE80211_CMAC_PN_LEN 6 | ||
1841 | |||
1832 | /* Public action codes */ | 1842 | /* Public action codes */ |
1833 | enum ieee80211_pub_actioncode { | 1843 | enum ieee80211_pub_actioncode { |
1834 | WLAN_PUB_ACTION_EXT_CHANSW_ANN = 4, | 1844 | WLAN_PUB_ACTION_EXT_CHANSW_ANN = 4, |
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index 12b4d55a02af..d5569734f672 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
@@ -30,7 +30,6 @@ static inline struct ethhdr *eth_hdr(const struct sk_buff *skb) | |||
30 | 30 | ||
31 | int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr); | 31 | int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr); |
32 | 32 | ||
33 | int mac_pton(const char *s, u8 *mac); | ||
34 | extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); | 33 | extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); |
35 | 34 | ||
36 | #endif /* _LINUX_IF_ETHER_H */ | 35 | #endif /* _LINUX_IF_ETHER_H */ |
diff --git a/include/linux/if_link.h b/include/linux/if_link.h index c3f817c3eb45..a86784dec3d3 100644 --- a/include/linux/if_link.h +++ b/include/linux/if_link.h | |||
@@ -12,5 +12,6 @@ struct ifla_vf_info { | |||
12 | __u32 qos; | 12 | __u32 qos; |
13 | __u32 tx_rate; | 13 | __u32 tx_rate; |
14 | __u32 spoofchk; | 14 | __u32 spoofchk; |
15 | __u32 linkstate; | ||
15 | }; | 16 | }; |
16 | #endif /* _LINUX_IF_LINK_H */ | 17 | #endif /* _LINUX_IF_LINK_H */ |
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h index 84dde1dd1da4..ddd33fd5904d 100644 --- a/include/linux/if_macvlan.h +++ b/include/linux/if_macvlan.h | |||
@@ -8,7 +8,7 @@ | |||
8 | #include <net/netlink.h> | 8 | #include <net/netlink.h> |
9 | #include <linux/u64_stats_sync.h> | 9 | #include <linux/u64_stats_sync.h> |
10 | 10 | ||
11 | #if defined(CONFIG_MACVTAP) || defined(CONFIG_MACVTAP_MODULE) | 11 | #if IS_ENABLED(CONFIG_MACVTAP) |
12 | struct socket *macvtap_get_socket(struct file *); | 12 | struct socket *macvtap_get_socket(struct file *); |
13 | #else | 13 | #else |
14 | #include <linux/err.h> | 14 | #include <linux/err.h> |
@@ -50,7 +50,7 @@ struct macvlan_pcpu_stats { | |||
50 | * Maximum times a macvtap device can be opened. This can be used to | 50 | * Maximum times a macvtap device can be opened. This can be used to |
51 | * configure the number of receive queue, e.g. for multiqueue virtio. | 51 | * configure the number of receive queue, e.g. for multiqueue virtio. |
52 | */ | 52 | */ |
53 | #define MAX_MACVTAP_QUEUES (NR_CPUS < 16 ? NR_CPUS : 16) | 53 | #define MAX_MACVTAP_QUEUES 16 |
54 | 54 | ||
55 | #define MACVLAN_MC_FILTER_BITS 8 | 55 | #define MACVLAN_MC_FILTER_BITS 8 |
56 | #define MACVLAN_MC_FILTER_SZ (1 << MACVLAN_MC_FILTER_BITS) | 56 | #define MACVLAN_MC_FILTER_SZ (1 << MACVLAN_MC_FILTER_BITS) |
@@ -65,12 +65,18 @@ struct macvlan_dev { | |||
65 | 65 | ||
66 | DECLARE_BITMAP(mc_filter, MACVLAN_MC_FILTER_SZ); | 66 | DECLARE_BITMAP(mc_filter, MACVLAN_MC_FILTER_SZ); |
67 | 67 | ||
68 | netdev_features_t set_features; | ||
68 | enum macvlan_mode mode; | 69 | enum macvlan_mode mode; |
69 | u16 flags; | 70 | u16 flags; |
70 | int (*receive)(struct sk_buff *skb); | 71 | int (*receive)(struct sk_buff *skb); |
71 | int (*forward)(struct net_device *dev, struct sk_buff *skb); | 72 | int (*forward)(struct net_device *dev, struct sk_buff *skb); |
72 | struct macvtap_queue *taps[MAX_MACVTAP_QUEUES]; | 73 | /* This array tracks active taps. */ |
74 | struct macvtap_queue __rcu *taps[MAX_MACVTAP_QUEUES]; | ||
75 | /* This list tracks all taps (both enabled and disabled) */ | ||
76 | struct list_head queue_list; | ||
73 | int numvtaps; | 77 | int numvtaps; |
78 | int numqueues; | ||
79 | netdev_features_t tap_features; | ||
74 | int minor; | 80 | int minor; |
75 | }; | 81 | }; |
76 | 82 | ||
diff --git a/include/linux/if_team.h b/include/linux/if_team.h index 16fae6436d0e..f6156f91eb1c 100644 --- a/include/linux/if_team.h +++ b/include/linux/if_team.h | |||
@@ -69,6 +69,7 @@ struct team_port { | |||
69 | s32 priority; /* lower number ~ higher priority */ | 69 | s32 priority; /* lower number ~ higher priority */ |
70 | u16 queue_id; | 70 | u16 queue_id; |
71 | struct list_head qom_list; /* node in queue override mapping list */ | 71 | struct list_head qom_list; /* node in queue override mapping list */ |
72 | struct rcu_head rcu; | ||
72 | long mode_priv[0]; | 73 | long mode_priv[0]; |
73 | }; | 74 | }; |
74 | 75 | ||
@@ -228,6 +229,16 @@ static inline struct team_port *team_get_port_by_index(struct team *team, | |||
228 | return port; | 229 | return port; |
229 | return NULL; | 230 | return NULL; |
230 | } | 231 | } |
232 | |||
233 | static inline int team_num_to_port_index(struct team *team, int num) | ||
234 | { | ||
235 | int en_port_count = ACCESS_ONCE(team->en_port_count); | ||
236 | |||
237 | if (unlikely(!en_port_count)) | ||
238 | return 0; | ||
239 | return num % en_port_count; | ||
240 | } | ||
241 | |||
231 | static inline struct team_port *team_get_port_by_index_rcu(struct team *team, | 242 | static inline struct team_port *team_get_port_by_index_rcu(struct team *team, |
232 | int port_index) | 243 | int port_index) |
233 | { | 244 | { |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 637fa71de0c7..715c343f7c00 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -79,9 +79,8 @@ static inline int is_vlan_dev(struct net_device *dev) | |||
79 | } | 79 | } |
80 | 80 | ||
81 | #define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT) | 81 | #define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT) |
82 | #define vlan_tx_nonzero_tag_present(__skb) \ | ||
83 | (vlan_tx_tag_present(__skb) && ((__skb)->vlan_tci & VLAN_VID_MASK)) | ||
84 | #define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) | 82 | #define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) |
83 | #define vlan_tx_tag_get_id(__skb) ((__skb)->vlan_tci & VLAN_VID_MASK) | ||
85 | 84 | ||
86 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) | 85 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) |
87 | 86 | ||
@@ -243,8 +242,6 @@ static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, | |||
243 | return skb; | 242 | return skb; |
244 | } | 243 | } |
245 | 244 | ||
246 | #define HAVE_VLAN_PUT_TAG | ||
247 | |||
248 | /** | 245 | /** |
249 | * vlan_put_tag - inserts VLAN tag according to device features | 246 | * vlan_put_tag - inserts VLAN tag according to device features |
250 | * @skb: skbuff to tag | 247 | * @skb: skbuff to tag |
diff --git a/include/linux/igmp.h b/include/linux/igmp.h index 7f2bf1518480..e3362b5f13e8 100644 --- a/include/linux/igmp.h +++ b/include/linux/igmp.h | |||
@@ -84,6 +84,7 @@ struct ip_mc_list { | |||
84 | struct ip_mc_list *next; | 84 | struct ip_mc_list *next; |
85 | struct ip_mc_list __rcu *next_rcu; | 85 | struct ip_mc_list __rcu *next_rcu; |
86 | }; | 86 | }; |
87 | struct ip_mc_list __rcu *next_hash; | ||
87 | struct timer_list timer; | 88 | struct timer_list timer; |
88 | int users; | 89 | int users; |
89 | atomic_t refcnt; | 90 | atomic_t refcnt; |
diff --git a/include/linux/iio/common/st_sensors.h b/include/linux/iio/common/st_sensors.h index 172c5b23cb84..72b26940730d 100644 --- a/include/linux/iio/common/st_sensors.h +++ b/include/linux/iio/common/st_sensors.h | |||
@@ -24,14 +24,10 @@ | |||
24 | #define ST_SENSORS_FULLSCALE_AVL_MAX 10 | 24 | #define ST_SENSORS_FULLSCALE_AVL_MAX 10 |
25 | 25 | ||
26 | #define ST_SENSORS_NUMBER_ALL_CHANNELS 4 | 26 | #define ST_SENSORS_NUMBER_ALL_CHANNELS 4 |
27 | #define ST_SENSORS_NUMBER_DATA_CHANNELS 3 | ||
28 | #define ST_SENSORS_ENABLE_ALL_AXIS 0x07 | 27 | #define ST_SENSORS_ENABLE_ALL_AXIS 0x07 |
29 | #define ST_SENSORS_BYTE_FOR_CHANNEL 2 | ||
30 | #define ST_SENSORS_SCAN_X 0 | 28 | #define ST_SENSORS_SCAN_X 0 |
31 | #define ST_SENSORS_SCAN_Y 1 | 29 | #define ST_SENSORS_SCAN_Y 1 |
32 | #define ST_SENSORS_SCAN_Z 2 | 30 | #define ST_SENSORS_SCAN_Z 2 |
33 | #define ST_SENSORS_DEFAULT_12_REALBITS 12 | ||
34 | #define ST_SENSORS_DEFAULT_16_REALBITS 16 | ||
35 | #define ST_SENSORS_DEFAULT_POWER_ON_VALUE 0x01 | 31 | #define ST_SENSORS_DEFAULT_POWER_ON_VALUE 0x01 |
36 | #define ST_SENSORS_DEFAULT_POWER_OFF_VALUE 0x00 | 32 | #define ST_SENSORS_DEFAULT_POWER_OFF_VALUE 0x00 |
37 | #define ST_SENSORS_DEFAULT_WAI_ADDRESS 0x0f | 33 | #define ST_SENSORS_DEFAULT_WAI_ADDRESS 0x0f |
@@ -42,20 +38,20 @@ | |||
42 | #define ST_SENSORS_MAX_NAME 17 | 38 | #define ST_SENSORS_MAX_NAME 17 |
43 | #define ST_SENSORS_MAX_4WAI 7 | 39 | #define ST_SENSORS_MAX_4WAI 7 |
44 | 40 | ||
45 | #define ST_SENSORS_LSM_CHANNELS(device_type, index, mod, endian, bits, addr) \ | 41 | #define ST_SENSORS_LSM_CHANNELS(device_type, mask, index, mod, \ |
42 | ch2, s, endian, rbits, sbits, addr) \ | ||
46 | { \ | 43 | { \ |
47 | .type = device_type, \ | 44 | .type = device_type, \ |
48 | .modified = 1, \ | 45 | .modified = mod, \ |
49 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ | 46 | .info_mask_separate = mask, \ |
50 | BIT(IIO_CHAN_INFO_SCALE), \ | ||
51 | .scan_index = index, \ | 47 | .scan_index = index, \ |
52 | .channel2 = mod, \ | 48 | .channel2 = ch2, \ |
53 | .address = addr, \ | 49 | .address = addr, \ |
54 | .scan_type = { \ | 50 | .scan_type = { \ |
55 | .sign = 's', \ | 51 | .sign = s, \ |
56 | .realbits = bits, \ | 52 | .realbits = rbits, \ |
57 | .shift = 16 - bits, \ | 53 | .shift = sbits - rbits, \ |
58 | .storagebits = 16, \ | 54 | .storagebits = sbits, \ |
59 | .endianness = endian, \ | 55 | .endianness = endian, \ |
60 | }, \ | 56 | }, \ |
61 | } | 57 | } |
@@ -204,6 +200,7 @@ struct st_sensors { | |||
204 | * @multiread_bit: Use or not particular bit for [I2C/SPI] multiread. | 200 | * @multiread_bit: Use or not particular bit for [I2C/SPI] multiread. |
205 | * @buffer_data: Data used by buffer part. | 201 | * @buffer_data: Data used by buffer part. |
206 | * @odr: Output data rate of the sensor [Hz]. | 202 | * @odr: Output data rate of the sensor [Hz]. |
203 | * num_data_channels: Number of data channels used in buffer. | ||
207 | * @get_irq_data_ready: Function to get the IRQ used for data ready signal. | 204 | * @get_irq_data_ready: Function to get the IRQ used for data ready signal. |
208 | * @tf: Transfer function structure used by I/O operations. | 205 | * @tf: Transfer function structure used by I/O operations. |
209 | * @tb: Transfer buffers and mutex used by I/O operations. | 206 | * @tb: Transfer buffers and mutex used by I/O operations. |
@@ -220,6 +217,7 @@ struct st_sensor_data { | |||
220 | char *buffer_data; | 217 | char *buffer_data; |
221 | 218 | ||
222 | unsigned int odr; | 219 | unsigned int odr; |
220 | unsigned int num_data_channels; | ||
223 | 221 | ||
224 | unsigned int (*get_irq_data_ready) (struct iio_dev *indio_dev); | 222 | unsigned int (*get_irq_data_ready) (struct iio_dev *indio_dev); |
225 | 223 | ||
diff --git a/include/linux/iio/frequency/adf4350.h b/include/linux/iio/frequency/adf4350.h index be91f344d5fc..ffd8c8f90928 100644 --- a/include/linux/iio/frequency/adf4350.h +++ b/include/linux/iio/frequency/adf4350.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * ADF4350/ADF4351 SPI PLL driver | 2 | * ADF4350/ADF4351 SPI PLL driver |
3 | * | 3 | * |
4 | * Copyright 2012 Analog Devices Inc. | 4 | * Copyright 2012-2013 Analog Devices Inc. |
5 | * | 5 | * |
6 | * Licensed under the GPL-2. | 6 | * Licensed under the GPL-2. |
7 | */ | 7 | */ |
@@ -41,7 +41,7 @@ | |||
41 | #define ADF4350_REG2_RDIV2_EN (1 << 24) | 41 | #define ADF4350_REG2_RDIV2_EN (1 << 24) |
42 | #define ADF4350_REG2_RMULT2_EN (1 << 25) | 42 | #define ADF4350_REG2_RMULT2_EN (1 << 25) |
43 | #define ADF4350_REG2_MUXOUT(x) ((x) << 26) | 43 | #define ADF4350_REG2_MUXOUT(x) ((x) << 26) |
44 | #define ADF4350_REG2_NOISE_MODE(x) ((x) << 29) | 44 | #define ADF4350_REG2_NOISE_MODE(x) (((unsigned)(x)) << 29) |
45 | #define ADF4350_MUXOUT_THREESTATE 0 | 45 | #define ADF4350_MUXOUT_THREESTATE 0 |
46 | #define ADF4350_MUXOUT_DVDD 1 | 46 | #define ADF4350_MUXOUT_DVDD 1 |
47 | #define ADF4350_MUXOUT_GND 2 | 47 | #define ADF4350_MUXOUT_GND 2 |
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 8d171f427632..3d35b7023591 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h | |||
@@ -211,8 +211,8 @@ struct iio_chan_spec { | |||
211 | static inline bool iio_channel_has_info(const struct iio_chan_spec *chan, | 211 | static inline bool iio_channel_has_info(const struct iio_chan_spec *chan, |
212 | enum iio_chan_info_enum type) | 212 | enum iio_chan_info_enum type) |
213 | { | 213 | { |
214 | return (chan->info_mask_separate & type) | | 214 | return (chan->info_mask_separate & BIT(type)) | |
215 | (chan->info_mask_shared_by_type & type); | 215 | (chan->info_mask_shared_by_type & BIT(type)); |
216 | } | 216 | } |
217 | 217 | ||
218 | #define IIO_ST(si, rb, sb, sh) \ | 218 | #define IIO_ST(si, rb, sb, sh) \ |
diff --git a/include/linux/iio/trigger.h b/include/linux/iio/trigger.h index 3869c525b052..369cf2cd5144 100644 --- a/include/linux/iio/trigger.h +++ b/include/linux/iio/trigger.h | |||
@@ -8,6 +8,7 @@ | |||
8 | */ | 8 | */ |
9 | #include <linux/irq.h> | 9 | #include <linux/irq.h> |
10 | #include <linux/module.h> | 10 | #include <linux/module.h> |
11 | #include <linux/atomic.h> | ||
11 | 12 | ||
12 | #ifndef _IIO_TRIGGER_H_ | 13 | #ifndef _IIO_TRIGGER_H_ |
13 | #define _IIO_TRIGGER_H_ | 14 | #define _IIO_TRIGGER_H_ |
@@ -61,7 +62,7 @@ struct iio_trigger { | |||
61 | 62 | ||
62 | struct list_head list; | 63 | struct list_head list; |
63 | struct list_head alloc_list; | 64 | struct list_head alloc_list; |
64 | int use_count; | 65 | atomic_t use_count; |
65 | 66 | ||
66 | struct irq_chip subirq_chip; | 67 | struct irq_chip subirq_chip; |
67 | int subirq_base; | 68 | int subirq_base; |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index ea1e3b863890..b99cd23f3474 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
@@ -50,12 +50,17 @@ struct ipv4_devconf { | |||
50 | DECLARE_BITMAP(state, IPV4_DEVCONF_MAX); | 50 | DECLARE_BITMAP(state, IPV4_DEVCONF_MAX); |
51 | }; | 51 | }; |
52 | 52 | ||
53 | #define MC_HASH_SZ_LOG 9 | ||
54 | |||
53 | struct in_device { | 55 | struct in_device { |
54 | struct net_device *dev; | 56 | struct net_device *dev; |
55 | atomic_t refcnt; | 57 | atomic_t refcnt; |
56 | int dead; | 58 | int dead; |
57 | struct in_ifaddr *ifa_list; /* IP ifaddr chain */ | 59 | struct in_ifaddr *ifa_list; /* IP ifaddr chain */ |
60 | |||
58 | struct ip_mc_list __rcu *mc_list; /* IP multicast filter chain */ | 61 | struct ip_mc_list __rcu *mc_list; /* IP multicast filter chain */ |
62 | struct ip_mc_list __rcu * __rcu *mc_hash; | ||
63 | |||
59 | int mc_count; /* Number of installed mcasts */ | 64 | int mc_count; /* Number of installed mcasts */ |
60 | spinlock_t mc_tomb_lock; | 65 | spinlock_t mc_tomb_lock; |
61 | struct ip_mc_list *mc_tomb; | 66 | struct ip_mc_list *mc_tomb; |
diff --git a/include/linux/init.h b/include/linux/init.h index 861814710d52..e73f2b708525 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -93,13 +93,13 @@ | |||
93 | 93 | ||
94 | #define __exit __section(.exit.text) __exitused __cold notrace | 94 | #define __exit __section(.exit.text) __exitused __cold notrace |
95 | 95 | ||
96 | /* Used for HOTPLUG_CPU */ | 96 | /* temporary, until all users are removed */ |
97 | #define __cpuinit __section(.cpuinit.text) __cold notrace | 97 | #define __cpuinit |
98 | #define __cpuinitdata __section(.cpuinit.data) | 98 | #define __cpuinitdata |
99 | #define __cpuinitconst __constsection(.cpuinit.rodata) | 99 | #define __cpuinitconst |
100 | #define __cpuexit __section(.cpuexit.text) __exitused __cold notrace | 100 | #define __cpuexit |
101 | #define __cpuexitdata __section(.cpuexit.data) | 101 | #define __cpuexitdata |
102 | #define __cpuexitconst __constsection(.cpuexit.rodata) | 102 | #define __cpuexitconst |
103 | 103 | ||
104 | /* Used for MEMORY_HOTPLUG */ | 104 | /* Used for MEMORY_HOTPLUG */ |
105 | #define __meminit __section(.meminit.text) __cold notrace | 105 | #define __meminit __section(.meminit.text) __cold notrace |
@@ -118,9 +118,8 @@ | |||
118 | #define __INITRODATA .section ".init.rodata","a",%progbits | 118 | #define __INITRODATA .section ".init.rodata","a",%progbits |
119 | #define __FINITDATA .previous | 119 | #define __FINITDATA .previous |
120 | 120 | ||
121 | #define __CPUINIT .section ".cpuinit.text", "ax" | 121 | /* temporary, until all users are removed */ |
122 | #define __CPUINITDATA .section ".cpuinit.data", "aw" | 122 | #define __CPUINIT |
123 | #define __CPUINITRODATA .section ".cpuinit.rodata", "a" | ||
124 | 123 | ||
125 | #define __MEMINIT .section ".meminit.text", "ax" | 124 | #define __MEMINIT .section ".meminit.text", "ax" |
126 | #define __MEMINITDATA .section ".meminit.data", "aw" | 125 | #define __MEMINITDATA .section ".meminit.data", "aw" |
diff --git a/include/linux/input/ti_am335x_tsc.h b/include/linux/input/ti_am335x_tsc.h deleted file mode 100644 index 49269a2aa329..000000000000 --- a/include/linux/input/ti_am335x_tsc.h +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | #ifndef __LINUX_TI_AM335X_TSC_H | ||
2 | #define __LINUX_TI_AM335X_TSC_H | ||
3 | |||
4 | /** | ||
5 | * struct tsc_data Touchscreen wire configuration | ||
6 | * @wires: Wires refer to application modes | ||
7 | * i.e. 4/5/8 wire touchscreen support | ||
8 | * on the platform. | ||
9 | * @x_plate_resistance: X plate resistance. | ||
10 | * @steps_to_configure: The sequencer supports a total of | ||
11 | * 16 programmable steps. | ||
12 | * A step configured to read a single | ||
13 | * co-ordinate value, can be applied | ||
14 | * more number of times for better results. | ||
15 | */ | ||
16 | |||
17 | struct tsc_data { | ||
18 | int wires; | ||
19 | int x_plate_resistance; | ||
20 | int steps_to_configure; | ||
21 | }; | ||
22 | |||
23 | #endif | ||
diff --git a/include/linux/input/tps6507x-ts.h b/include/linux/input/tps6507x-ts.h index ab1440313924..b433df801d92 100644 --- a/include/linux/input/tps6507x-ts.h +++ b/include/linux/input/tps6507x-ts.h | |||
@@ -14,7 +14,6 @@ | |||
14 | /* Board specific touch screen initial values */ | 14 | /* Board specific touch screen initial values */ |
15 | struct touchscreen_init_data { | 15 | struct touchscreen_init_data { |
16 | int poll_period; /* ms */ | 16 | int poll_period; /* ms */ |
17 | int vref; /* non-zero to leave vref on */ | ||
18 | __u16 min_pressure; /* min reading to be treated as a touch */ | 17 | __u16 min_pressure; /* min reading to be treated as a touch */ |
19 | __u16 vendor; | 18 | __u16 vendor; |
20 | __u16 product; | 19 | __u16 product; |
diff --git a/include/linux/io.h b/include/linux/io.h index 069e4075f872..f4f42faec686 100644 --- a/include/linux/io.h +++ b/include/linux/io.h | |||
@@ -76,4 +76,29 @@ void devm_ioremap_release(struct device *dev, void *res); | |||
76 | #define arch_has_dev_port() (1) | 76 | #define arch_has_dev_port() (1) |
77 | #endif | 77 | #endif |
78 | 78 | ||
79 | /* | ||
80 | * Some systems (x86 without PAT) have a somewhat reliable way to mark a | ||
81 | * physical address range such that uncached mappings will actually | ||
82 | * end up write-combining. This facility should be used in conjunction | ||
83 | * with pgprot_writecombine, ioremap-wc, or set_memory_wc, since it has | ||
84 | * no effect if the per-page mechanisms are functional. | ||
85 | * (On x86 without PAT, these functions manipulate MTRRs.) | ||
86 | * | ||
87 | * arch_phys_del_wc(0) or arch_phys_del_wc(any error code) is guaranteed | ||
88 | * to have no effect. | ||
89 | */ | ||
90 | #ifndef arch_phys_wc_add | ||
91 | static inline int __must_check arch_phys_wc_add(unsigned long base, | ||
92 | unsigned long size) | ||
93 | { | ||
94 | return 0; /* It worked (i.e. did nothing). */ | ||
95 | } | ||
96 | |||
97 | static inline void arch_phys_wc_del(int handle) | ||
98 | { | ||
99 | } | ||
100 | |||
101 | #define arch_phys_wc_add arch_phys_wc_add | ||
102 | #endif | ||
103 | |||
79 | #endif /* _LINUX_IO_H */ | 104 | #endif /* _LINUX_IO_H */ |
diff --git a/include/linux/ipmi-fru.h b/include/linux/ipmi-fru.h new file mode 100644 index 000000000000..4d3a76380e32 --- /dev/null +++ b/include/linux/ipmi-fru.h | |||
@@ -0,0 +1,135 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2012 CERN (www.cern.ch) | ||
3 | * Author: Alessandro Rubini <rubini@gnudd.com> | ||
4 | * | ||
5 | * Released according to the GNU GPL, version 2 or any later version. | ||
6 | * | ||
7 | * This work is part of the White Rabbit project, a research effort led | ||
8 | * by CERN, the European Institute for Nuclear Research. | ||
9 | */ | ||
10 | #ifndef __LINUX_IPMI_FRU_H__ | ||
11 | #define __LINUX_IPMI_FRU_H__ | ||
12 | #ifdef __KERNEL__ | ||
13 | # include <linux/types.h> | ||
14 | # include <linux/string.h> | ||
15 | #else | ||
16 | # include <stdint.h> | ||
17 | # include <string.h> | ||
18 | #endif | ||
19 | |||
20 | /* | ||
21 | * These structures match the unaligned crap we have in FRU1011.pdf | ||
22 | * (http://download.intel.com/design/servers/ipmi/FRU1011.pdf) | ||
23 | */ | ||
24 | |||
25 | /* chapter 8, page 5 */ | ||
26 | struct fru_common_header { | ||
27 | uint8_t format; /* 0x01 */ | ||
28 | uint8_t internal_use_off; /* multiple of 8 bytes */ | ||
29 | uint8_t chassis_info_off; /* multiple of 8 bytes */ | ||
30 | uint8_t board_area_off; /* multiple of 8 bytes */ | ||
31 | uint8_t product_area_off; /* multiple of 8 bytes */ | ||
32 | uint8_t multirecord_off; /* multiple of 8 bytes */ | ||
33 | uint8_t pad; /* must be 0 */ | ||
34 | uint8_t checksum; /* sum modulo 256 must be 0 */ | ||
35 | }; | ||
36 | |||
37 | /* chapter 9, page 5 -- internal_use: not used by us */ | ||
38 | |||
39 | /* chapter 10, page 6 -- chassis info: not used by us */ | ||
40 | |||
41 | /* chapter 13, page 9 -- used by board_info_area below */ | ||
42 | struct fru_type_length { | ||
43 | uint8_t type_length; | ||
44 | uint8_t data[0]; | ||
45 | }; | ||
46 | |||
47 | /* chapter 11, page 7 */ | ||
48 | struct fru_board_info_area { | ||
49 | uint8_t format; /* 0x01 */ | ||
50 | uint8_t area_len; /* multiple of 8 bytes */ | ||
51 | uint8_t language; /* I hope it's 0 */ | ||
52 | uint8_t mfg_date[3]; /* LSB, minutes since 1996-01-01 */ | ||
53 | struct fru_type_length tl[0]; /* type-length stuff follows */ | ||
54 | |||
55 | /* | ||
56 | * the TL there are in order: | ||
57 | * Board Manufacturer | ||
58 | * Board Product Name | ||
59 | * Board Serial Number | ||
60 | * Board Part Number | ||
61 | * FRU File ID (may be null) | ||
62 | * more manufacturer-specific stuff | ||
63 | * 0xc1 as a terminator | ||
64 | * 0x00 pad to a multiple of 8 bytes - 1 | ||
65 | * checksum (sum of all stuff module 256 must be zero) | ||
66 | */ | ||
67 | }; | ||
68 | |||
69 | enum fru_type { | ||
70 | FRU_TYPE_BINARY = 0x00, | ||
71 | FRU_TYPE_BCDPLUS = 0x40, | ||
72 | FRU_TYPE_ASCII6 = 0x80, | ||
73 | FRU_TYPE_ASCII = 0xc0, /* not ascii: depends on language */ | ||
74 | }; | ||
75 | |||
76 | /* | ||
77 | * some helpers | ||
78 | */ | ||
79 | static inline struct fru_board_info_area *fru_get_board_area( | ||
80 | const struct fru_common_header *header) | ||
81 | { | ||
82 | /* we know for sure that the header is 8 bytes in size */ | ||
83 | return (struct fru_board_info_area *)(header + header->board_area_off); | ||
84 | } | ||
85 | |||
86 | static inline int fru_type(struct fru_type_length *tl) | ||
87 | { | ||
88 | return tl->type_length & 0xc0; | ||
89 | } | ||
90 | |||
91 | static inline int fru_length(struct fru_type_length *tl) | ||
92 | { | ||
93 | return (tl->type_length & 0x3f) + 1; /* len of whole record */ | ||
94 | } | ||
95 | |||
96 | /* assume ascii-latin1 encoding */ | ||
97 | static inline int fru_strlen(struct fru_type_length *tl) | ||
98 | { | ||
99 | return fru_length(tl) - 1; | ||
100 | } | ||
101 | |||
102 | static inline char *fru_strcpy(char *dest, struct fru_type_length *tl) | ||
103 | { | ||
104 | int len = fru_strlen(tl); | ||
105 | memcpy(dest, tl->data, len); | ||
106 | dest[len] = '\0'; | ||
107 | return dest; | ||
108 | } | ||
109 | |||
110 | static inline struct fru_type_length *fru_next_tl(struct fru_type_length *tl) | ||
111 | { | ||
112 | return tl + fru_length(tl); | ||
113 | } | ||
114 | |||
115 | static inline int fru_is_eof(struct fru_type_length *tl) | ||
116 | { | ||
117 | return tl->type_length == 0xc1; | ||
118 | } | ||
119 | |||
120 | /* | ||
121 | * External functions defined in fru-parse.c. | ||
122 | */ | ||
123 | extern int fru_header_cksum_ok(struct fru_common_header *header); | ||
124 | extern int fru_bia_cksum_ok(struct fru_board_info_area *bia); | ||
125 | |||
126 | /* All these 4 return allocated strings by calling fru_alloc() */ | ||
127 | extern char *fru_get_board_manufacturer(struct fru_common_header *header); | ||
128 | extern char *fru_get_product_name(struct fru_common_header *header); | ||
129 | extern char *fru_get_serial_number(struct fru_common_header *header); | ||
130 | extern char *fru_get_part_number(struct fru_common_header *header); | ||
131 | |||
132 | /* This must be defined by the caller of the above functions */ | ||
133 | extern void *fru_alloc(size_t size); | ||
134 | |||
135 | #endif /* __LINUX_IMPI_FRU_H__ */ | ||
diff --git a/include/linux/irq.h b/include/linux/irq.h index bc4e06611958..f04d3ba335cb 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -119,6 +119,7 @@ struct irq_domain; | |||
119 | 119 | ||
120 | /** | 120 | /** |
121 | * struct irq_data - per irq and irq chip data passed down to chip functions | 121 | * struct irq_data - per irq and irq chip data passed down to chip functions |
122 | * @mask: precomputed bitmask for accessing the chip registers | ||
122 | * @irq: interrupt number | 123 | * @irq: interrupt number |
123 | * @hwirq: hardware interrupt number, local to the interrupt domain | 124 | * @hwirq: hardware interrupt number, local to the interrupt domain |
124 | * @node: node index useful for balancing | 125 | * @node: node index useful for balancing |
@@ -138,6 +139,7 @@ struct irq_domain; | |||
138 | * irq_data. | 139 | * irq_data. |
139 | */ | 140 | */ |
140 | struct irq_data { | 141 | struct irq_data { |
142 | u32 mask; | ||
141 | unsigned int irq; | 143 | unsigned int irq; |
142 | unsigned long hwirq; | 144 | unsigned long hwirq; |
143 | unsigned int node; | 145 | unsigned int node; |
@@ -294,6 +296,7 @@ static inline irq_hw_number_t irqd_to_hwirq(struct irq_data *d) | |||
294 | * @irq_suspend: function called from core code on suspend once per chip | 296 | * @irq_suspend: function called from core code on suspend once per chip |
295 | * @irq_resume: function called from core code on resume once per chip | 297 | * @irq_resume: function called from core code on resume once per chip |
296 | * @irq_pm_shutdown: function called from core code on shutdown once per chip | 298 | * @irq_pm_shutdown: function called from core code on shutdown once per chip |
299 | * @irq_calc_mask: Optional function to set irq_data.mask for special cases | ||
297 | * @irq_print_chip: optional to print special chip info in show_interrupts | 300 | * @irq_print_chip: optional to print special chip info in show_interrupts |
298 | * @flags: chip specific flags | 301 | * @flags: chip specific flags |
299 | */ | 302 | */ |
@@ -325,6 +328,8 @@ struct irq_chip { | |||
325 | void (*irq_resume)(struct irq_data *data); | 328 | void (*irq_resume)(struct irq_data *data); |
326 | void (*irq_pm_shutdown)(struct irq_data *data); | 329 | void (*irq_pm_shutdown)(struct irq_data *data); |
327 | 330 | ||
331 | void (*irq_calc_mask)(struct irq_data *data); | ||
332 | |||
328 | void (*irq_print_chip)(struct irq_data *data, struct seq_file *p); | 333 | void (*irq_print_chip)(struct irq_data *data, struct seq_file *p); |
329 | 334 | ||
330 | unsigned long flags; | 335 | unsigned long flags; |
@@ -579,6 +584,12 @@ static inline struct msi_desc *irq_data_get_msi(struct irq_data *d) | |||
579 | return d->msi_desc; | 584 | return d->msi_desc; |
580 | } | 585 | } |
581 | 586 | ||
587 | static inline u32 irq_get_trigger_type(unsigned int irq) | ||
588 | { | ||
589 | struct irq_data *d = irq_get_irq_data(irq); | ||
590 | return d ? irqd_get_trigger_type(d) : 0; | ||
591 | } | ||
592 | |||
582 | int __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node, | 593 | int __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node, |
583 | struct module *owner); | 594 | struct module *owner); |
584 | 595 | ||
@@ -644,6 +655,8 @@ struct irq_chip_regs { | |||
644 | * @regs: Register offsets for this chip | 655 | * @regs: Register offsets for this chip |
645 | * @handler: Flow handler associated with this chip | 656 | * @handler: Flow handler associated with this chip |
646 | * @type: Chip can handle these flow types | 657 | * @type: Chip can handle these flow types |
658 | * @mask_cache_priv: Cached mask register private to the chip type | ||
659 | * @mask_cache: Pointer to cached mask register | ||
647 | * | 660 | * |
648 | * A irq_generic_chip can have several instances of irq_chip_type when | 661 | * A irq_generic_chip can have several instances of irq_chip_type when |
649 | * it requires different functions and register offsets for different | 662 | * it requires different functions and register offsets for different |
@@ -654,6 +667,8 @@ struct irq_chip_type { | |||
654 | struct irq_chip_regs regs; | 667 | struct irq_chip_regs regs; |
655 | irq_flow_handler_t handler; | 668 | irq_flow_handler_t handler; |
656 | u32 type; | 669 | u32 type; |
670 | u32 mask_cache_priv; | ||
671 | u32 *mask_cache; | ||
657 | }; | 672 | }; |
658 | 673 | ||
659 | /** | 674 | /** |
@@ -662,13 +677,16 @@ struct irq_chip_type { | |||
662 | * @reg_base: Register base address (virtual) | 677 | * @reg_base: Register base address (virtual) |
663 | * @irq_base: Interrupt base nr for this chip | 678 | * @irq_base: Interrupt base nr for this chip |
664 | * @irq_cnt: Number of interrupts handled by this chip | 679 | * @irq_cnt: Number of interrupts handled by this chip |
665 | * @mask_cache: Cached mask register | 680 | * @mask_cache: Cached mask register shared between all chip types |
666 | * @type_cache: Cached type register | 681 | * @type_cache: Cached type register |
667 | * @polarity_cache: Cached polarity register | 682 | * @polarity_cache: Cached polarity register |
668 | * @wake_enabled: Interrupt can wakeup from suspend | 683 | * @wake_enabled: Interrupt can wakeup from suspend |
669 | * @wake_active: Interrupt is marked as an wakeup from suspend source | 684 | * @wake_active: Interrupt is marked as an wakeup from suspend source |
670 | * @num_ct: Number of available irq_chip_type instances (usually 1) | 685 | * @num_ct: Number of available irq_chip_type instances (usually 1) |
671 | * @private: Private data for non generic chip callbacks | 686 | * @private: Private data for non generic chip callbacks |
687 | * @installed: bitfield to denote installed interrupts | ||
688 | * @unused: bitfield to denote unused interrupts | ||
689 | * @domain: irq domain pointer | ||
672 | * @list: List head for keeping track of instances | 690 | * @list: List head for keeping track of instances |
673 | * @chip_types: Array of interrupt irq_chip_types | 691 | * @chip_types: Array of interrupt irq_chip_types |
674 | * | 692 | * |
@@ -690,6 +708,9 @@ struct irq_chip_generic { | |||
690 | u32 wake_active; | 708 | u32 wake_active; |
691 | unsigned int num_ct; | 709 | unsigned int num_ct; |
692 | void *private; | 710 | void *private; |
711 | unsigned long installed; | ||
712 | unsigned long unused; | ||
713 | struct irq_domain *domain; | ||
693 | struct list_head list; | 714 | struct list_head list; |
694 | struct irq_chip_type chip_types[0]; | 715 | struct irq_chip_type chip_types[0]; |
695 | }; | 716 | }; |
@@ -700,10 +721,32 @@ struct irq_chip_generic { | |||
700 | * @IRQ_GC_INIT_NESTED_LOCK: Set the lock class of the irqs to nested for | 721 | * @IRQ_GC_INIT_NESTED_LOCK: Set the lock class of the irqs to nested for |
701 | * irq chips which need to call irq_set_wake() on | 722 | * irq chips which need to call irq_set_wake() on |
702 | * the parent irq. Usually GPIO implementations | 723 | * the parent irq. Usually GPIO implementations |
724 | * @IRQ_GC_MASK_CACHE_PER_TYPE: Mask cache is chip type private | ||
725 | * @IRQ_GC_NO_MASK: Do not calculate irq_data->mask | ||
703 | */ | 726 | */ |
704 | enum irq_gc_flags { | 727 | enum irq_gc_flags { |
705 | IRQ_GC_INIT_MASK_CACHE = 1 << 0, | 728 | IRQ_GC_INIT_MASK_CACHE = 1 << 0, |
706 | IRQ_GC_INIT_NESTED_LOCK = 1 << 1, | 729 | IRQ_GC_INIT_NESTED_LOCK = 1 << 1, |
730 | IRQ_GC_MASK_CACHE_PER_TYPE = 1 << 2, | ||
731 | IRQ_GC_NO_MASK = 1 << 3, | ||
732 | }; | ||
733 | |||
734 | /* | ||
735 | * struct irq_domain_chip_generic - Generic irq chip data structure for irq domains | ||
736 | * @irqs_per_chip: Number of interrupts per chip | ||
737 | * @num_chips: Number of chips | ||
738 | * @irq_flags_to_set: IRQ* flags to set on irq setup | ||
739 | * @irq_flags_to_clear: IRQ* flags to clear on irq setup | ||
740 | * @gc_flags: Generic chip specific setup flags | ||
741 | * @gc: Array of pointers to generic interrupt chips | ||
742 | */ | ||
743 | struct irq_domain_chip_generic { | ||
744 | unsigned int irqs_per_chip; | ||
745 | unsigned int num_chips; | ||
746 | unsigned int irq_flags_to_clear; | ||
747 | unsigned int irq_flags_to_set; | ||
748 | enum irq_gc_flags gc_flags; | ||
749 | struct irq_chip_generic *gc[0]; | ||
707 | }; | 750 | }; |
708 | 751 | ||
709 | /* Generic chip callback functions */ | 752 | /* Generic chip callback functions */ |
@@ -729,6 +772,14 @@ int irq_setup_alt_chip(struct irq_data *d, unsigned int type); | |||
729 | void irq_remove_generic_chip(struct irq_chip_generic *gc, u32 msk, | 772 | void irq_remove_generic_chip(struct irq_chip_generic *gc, u32 msk, |
730 | unsigned int clr, unsigned int set); | 773 | unsigned int clr, unsigned int set); |
731 | 774 | ||
775 | struct irq_chip_generic *irq_get_domain_generic_chip(struct irq_domain *d, unsigned int hw_irq); | ||
776 | int irq_alloc_domain_generic_chips(struct irq_domain *d, int irqs_per_chip, | ||
777 | int num_ct, const char *name, | ||
778 | irq_flow_handler_t handler, | ||
779 | unsigned int clr, unsigned int set, | ||
780 | enum irq_gc_flags flags); | ||
781 | |||
782 | |||
732 | static inline struct irq_chip_type *irq_data_get_chip_type(struct irq_data *d) | 783 | static inline struct irq_chip_type *irq_data_get_chip_type(struct irq_data *d) |
733 | { | 784 | { |
734 | return container_of(d->chip, struct irq_chip_type, chip); | 785 | return container_of(d->chip, struct irq_chip_type, chip); |
diff --git a/include/linux/irqchip.h b/include/linux/irqchip.h index e0006f1d35a0..14d79131f53d 100644 --- a/include/linux/irqchip.h +++ b/include/linux/irqchip.h | |||
@@ -11,6 +11,10 @@ | |||
11 | #ifndef _LINUX_IRQCHIP_H | 11 | #ifndef _LINUX_IRQCHIP_H |
12 | #define _LINUX_IRQCHIP_H | 12 | #define _LINUX_IRQCHIP_H |
13 | 13 | ||
14 | #ifdef CONFIG_IRQCHIP | ||
14 | void irqchip_init(void); | 15 | void irqchip_init(void); |
16 | #else | ||
17 | static inline void irqchip_init(void) {} | ||
18 | #endif | ||
15 | 19 | ||
16 | #endif | 20 | #endif |
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index 0d5b17bf5e51..c983ed18c332 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h | |||
@@ -66,52 +66,55 @@ struct irq_domain_ops { | |||
66 | unsigned long *out_hwirq, unsigned int *out_type); | 66 | unsigned long *out_hwirq, unsigned int *out_type); |
67 | }; | 67 | }; |
68 | 68 | ||
69 | extern struct irq_domain_ops irq_generic_chip_ops; | ||
70 | |||
71 | struct irq_domain_chip_generic; | ||
72 | |||
69 | /** | 73 | /** |
70 | * struct irq_domain - Hardware interrupt number translation object | 74 | * struct irq_domain - Hardware interrupt number translation object |
71 | * @link: Element in global irq_domain list. | 75 | * @link: Element in global irq_domain list. |
72 | * @revmap_type: Method used for reverse mapping hwirq numbers to linux irq. This | 76 | * @name: Name of interrupt domain |
73 | * will be one of the IRQ_DOMAIN_MAP_* values. | ||
74 | * @revmap_data: Revmap method specific data. | ||
75 | * @ops: pointer to irq_domain methods | 77 | * @ops: pointer to irq_domain methods |
76 | * @host_data: private data pointer for use by owner. Not touched by irq_domain | 78 | * @host_data: private data pointer for use by owner. Not touched by irq_domain |
77 | * core code. | 79 | * core code. |
78 | * @irq_base: Start of irq_desc range assigned to the irq_domain. The creator | 80 | * |
79 | * of the irq_domain is responsible for allocating the array of | 81 | * Optional elements |
80 | * irq_desc structures. | 82 | * @of_node: Pointer to device tree nodes associated with the irq_domain. Used |
81 | * @nr_irq: Number of irqs managed by the irq domain | 83 | * when decoding device tree interrupt specifiers. |
82 | * @hwirq_base: Starting number for hwirqs managed by the irq domain | 84 | * @gc: Pointer to a list of generic chips. There is a helper function for |
83 | * @of_node: (optional) Pointer to device tree nodes associated with the | 85 | * setting up one or more generic chips for interrupt controllers |
84 | * irq_domain. Used when decoding device tree interrupt specifiers. | 86 | * drivers using the generic chip library which uses this pointer. |
87 | * | ||
88 | * Revmap data, used internally by irq_domain | ||
89 | * @revmap_direct_max_irq: The largest hwirq that can be set for controllers that | ||
90 | * support direct mapping | ||
91 | * @revmap_size: Size of the linear map table @linear_revmap[] | ||
92 | * @revmap_tree: Radix map tree for hwirqs that don't fit in the linear map | ||
93 | * @linear_revmap: Linear table of hwirq->virq reverse mappings | ||
85 | */ | 94 | */ |
86 | struct irq_domain { | 95 | struct irq_domain { |
87 | struct list_head link; | 96 | struct list_head link; |
88 | 97 | const char *name; | |
89 | /* type of reverse mapping_technique */ | ||
90 | unsigned int revmap_type; | ||
91 | union { | ||
92 | struct { | ||
93 | unsigned int size; | ||
94 | unsigned int first_irq; | ||
95 | irq_hw_number_t first_hwirq; | ||
96 | } legacy; | ||
97 | struct { | ||
98 | unsigned int size; | ||
99 | unsigned int *revmap; | ||
100 | } linear; | ||
101 | struct { | ||
102 | unsigned int max_irq; | ||
103 | } nomap; | ||
104 | struct radix_tree_root tree; | ||
105 | } revmap_data; | ||
106 | const struct irq_domain_ops *ops; | 98 | const struct irq_domain_ops *ops; |
107 | void *host_data; | 99 | void *host_data; |
108 | irq_hw_number_t inval_irq; | ||
109 | 100 | ||
110 | /* Optional device node pointer */ | 101 | /* Optional data */ |
111 | struct device_node *of_node; | 102 | struct device_node *of_node; |
103 | struct irq_domain_chip_generic *gc; | ||
104 | |||
105 | /* reverse map data. The linear map gets appended to the irq_domain */ | ||
106 | irq_hw_number_t hwirq_max; | ||
107 | unsigned int revmap_direct_max_irq; | ||
108 | unsigned int revmap_size; | ||
109 | struct radix_tree_root revmap_tree; | ||
110 | unsigned int linear_revmap[]; | ||
112 | }; | 111 | }; |
113 | 112 | ||
114 | #ifdef CONFIG_IRQ_DOMAIN | 113 | #ifdef CONFIG_IRQ_DOMAIN |
114 | struct irq_domain *__irq_domain_add(struct device_node *of_node, int size, | ||
115 | irq_hw_number_t hwirq_max, int direct_max, | ||
116 | const struct irq_domain_ops *ops, | ||
117 | void *host_data); | ||
115 | struct irq_domain *irq_domain_add_simple(struct device_node *of_node, | 118 | struct irq_domain *irq_domain_add_simple(struct device_node *of_node, |
116 | unsigned int size, | 119 | unsigned int size, |
117 | unsigned int first_irq, | 120 | unsigned int first_irq, |
@@ -123,21 +126,30 @@ struct irq_domain *irq_domain_add_legacy(struct device_node *of_node, | |||
123 | irq_hw_number_t first_hwirq, | 126 | irq_hw_number_t first_hwirq, |
124 | const struct irq_domain_ops *ops, | 127 | const struct irq_domain_ops *ops, |
125 | void *host_data); | 128 | void *host_data); |
126 | struct irq_domain *irq_domain_add_linear(struct device_node *of_node, | 129 | extern struct irq_domain *irq_find_host(struct device_node *node); |
130 | extern void irq_set_default_host(struct irq_domain *host); | ||
131 | |||
132 | /** | ||
133 | * irq_domain_add_linear() - Allocate and register a linear revmap irq_domain. | ||
134 | * @of_node: pointer to interrupt controller's device tree node. | ||
135 | * @size: Number of interrupts in the domain. | ||
136 | * @ops: map/unmap domain callbacks | ||
137 | * @host_data: Controller private data pointer | ||
138 | */ | ||
139 | static inline struct irq_domain *irq_domain_add_linear(struct device_node *of_node, | ||
127 | unsigned int size, | 140 | unsigned int size, |
128 | const struct irq_domain_ops *ops, | 141 | const struct irq_domain_ops *ops, |
129 | void *host_data); | 142 | void *host_data) |
130 | struct irq_domain *irq_domain_add_nomap(struct device_node *of_node, | 143 | { |
144 | return __irq_domain_add(of_node, size, size, 0, ops, host_data); | ||
145 | } | ||
146 | static inline struct irq_domain *irq_domain_add_nomap(struct device_node *of_node, | ||
131 | unsigned int max_irq, | 147 | unsigned int max_irq, |
132 | const struct irq_domain_ops *ops, | 148 | const struct irq_domain_ops *ops, |
133 | void *host_data); | 149 | void *host_data) |
134 | struct irq_domain *irq_domain_add_tree(struct device_node *of_node, | 150 | { |
135 | const struct irq_domain_ops *ops, | 151 | return __irq_domain_add(of_node, 0, max_irq, max_irq, ops, host_data); |
136 | void *host_data); | 152 | } |
137 | |||
138 | extern struct irq_domain *irq_find_host(struct device_node *node); | ||
139 | extern void irq_set_default_host(struct irq_domain *host); | ||
140 | |||
141 | static inline struct irq_domain *irq_domain_add_legacy_isa( | 153 | static inline struct irq_domain *irq_domain_add_legacy_isa( |
142 | struct device_node *of_node, | 154 | struct device_node *of_node, |
143 | const struct irq_domain_ops *ops, | 155 | const struct irq_domain_ops *ops, |
@@ -146,21 +158,40 @@ static inline struct irq_domain *irq_domain_add_legacy_isa( | |||
146 | return irq_domain_add_legacy(of_node, NUM_ISA_INTERRUPTS, 0, 0, ops, | 158 | return irq_domain_add_legacy(of_node, NUM_ISA_INTERRUPTS, 0, 0, ops, |
147 | host_data); | 159 | host_data); |
148 | } | 160 | } |
161 | static inline struct irq_domain *irq_domain_add_tree(struct device_node *of_node, | ||
162 | const struct irq_domain_ops *ops, | ||
163 | void *host_data) | ||
164 | { | ||
165 | return __irq_domain_add(of_node, 0, ~0, 0, ops, host_data); | ||
166 | } | ||
149 | 167 | ||
150 | extern void irq_domain_remove(struct irq_domain *host); | 168 | extern void irq_domain_remove(struct irq_domain *host); |
151 | 169 | ||
152 | extern int irq_domain_associate_many(struct irq_domain *domain, | 170 | extern int irq_domain_associate(struct irq_domain *domain, unsigned int irq, |
153 | unsigned int irq_base, | 171 | irq_hw_number_t hwirq); |
154 | irq_hw_number_t hwirq_base, int count); | 172 | extern void irq_domain_associate_many(struct irq_domain *domain, |
155 | static inline int irq_domain_associate(struct irq_domain *domain, unsigned int irq, | 173 | unsigned int irq_base, |
156 | irq_hw_number_t hwirq) | 174 | irq_hw_number_t hwirq_base, int count); |
157 | { | ||
158 | return irq_domain_associate_many(domain, irq, hwirq, 1); | ||
159 | } | ||
160 | 175 | ||
161 | extern unsigned int irq_create_mapping(struct irq_domain *host, | 176 | extern unsigned int irq_create_mapping(struct irq_domain *host, |
162 | irq_hw_number_t hwirq); | 177 | irq_hw_number_t hwirq); |
163 | extern void irq_dispose_mapping(unsigned int virq); | 178 | extern void irq_dispose_mapping(unsigned int virq); |
179 | |||
180 | /** | ||
181 | * irq_linear_revmap() - Find a linux irq from a hw irq number. | ||
182 | * @domain: domain owning this hardware interrupt | ||
183 | * @hwirq: hardware irq number in that domain space | ||
184 | * | ||
185 | * This is a fast path alternative to irq_find_mapping() that can be | ||
186 | * called directly by irq controller code to save a handful of | ||
187 | * instructions. It is always safe to call, but won't find irqs mapped | ||
188 | * using the radix tree. | ||
189 | */ | ||
190 | static inline unsigned int irq_linear_revmap(struct irq_domain *domain, | ||
191 | irq_hw_number_t hwirq) | ||
192 | { | ||
193 | return hwirq < domain->revmap_size ? domain->linear_revmap[hwirq] : 0; | ||
194 | } | ||
164 | extern unsigned int irq_find_mapping(struct irq_domain *host, | 195 | extern unsigned int irq_find_mapping(struct irq_domain *host, |
165 | irq_hw_number_t hwirq); | 196 | irq_hw_number_t hwirq); |
166 | extern unsigned int irq_create_direct_mapping(struct irq_domain *host); | 197 | extern unsigned int irq_create_direct_mapping(struct irq_domain *host); |
@@ -174,9 +205,6 @@ static inline int irq_create_identity_mapping(struct irq_domain *host, | |||
174 | return irq_create_strict_mappings(host, hwirq, hwirq, 1); | 205 | return irq_create_strict_mappings(host, hwirq, hwirq, 1); |
175 | } | 206 | } |
176 | 207 | ||
177 | extern unsigned int irq_linear_revmap(struct irq_domain *host, | ||
178 | irq_hw_number_t hwirq); | ||
179 | |||
180 | extern const struct irq_domain_ops irq_domain_simple_ops; | 208 | extern const struct irq_domain_ops irq_domain_simple_ops; |
181 | 209 | ||
182 | /* stock xlate functions */ | 210 | /* stock xlate functions */ |
@@ -190,14 +218,6 @@ int irq_domain_xlate_onetwocell(struct irq_domain *d, struct device_node *ctrlr, | |||
190 | const u32 *intspec, unsigned int intsize, | 218 | const u32 *intspec, unsigned int intsize, |
191 | irq_hw_number_t *out_hwirq, unsigned int *out_type); | 219 | irq_hw_number_t *out_hwirq, unsigned int *out_type); |
192 | 220 | ||
193 | #if defined(CONFIG_OF_IRQ) | ||
194 | extern void irq_domain_generate_simple(const struct of_device_id *match, | ||
195 | u64 phys_base, unsigned int irq_start); | ||
196 | #else /* CONFIG_OF_IRQ */ | ||
197 | static inline void irq_domain_generate_simple(const struct of_device_id *match, | ||
198 | u64 phys_base, unsigned int irq_start) { } | ||
199 | #endif /* !CONFIG_OF_IRQ */ | ||
200 | |||
201 | #else /* CONFIG_IRQ_DOMAIN */ | 221 | #else /* CONFIG_IRQ_DOMAIN */ |
202 | static inline void irq_dispose_mapping(unsigned int virq) { } | 222 | static inline void irq_dispose_mapping(unsigned int virq) { } |
203 | #endif /* !CONFIG_IRQ_DOMAIN */ | 223 | #endif /* !CONFIG_IRQ_DOMAIN */ |
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index 7e0b622503c4..8685d1be12c7 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <linux/buffer_head.h> | 27 | #include <linux/buffer_head.h> |
28 | #include <linux/journal-head.h> | 28 | #include <linux/journal-head.h> |
29 | #include <linux/stddef.h> | 29 | #include <linux/stddef.h> |
30 | #include <linux/bit_spinlock.h> | ||
31 | #include <linux/mutex.h> | 30 | #include <linux/mutex.h> |
32 | #include <linux/timer.h> | 31 | #include <linux/timer.h> |
33 | #include <linux/lockdep.h> | 32 | #include <linux/lockdep.h> |
@@ -244,6 +243,31 @@ typedef struct journal_superblock_s | |||
244 | 243 | ||
245 | #include <linux/fs.h> | 244 | #include <linux/fs.h> |
246 | #include <linux/sched.h> | 245 | #include <linux/sched.h> |
246 | |||
247 | enum jbd_state_bits { | ||
248 | BH_JBD /* Has an attached ext3 journal_head */ | ||
249 | = BH_PrivateStart, | ||
250 | BH_JWrite, /* Being written to log (@@@ DEBUGGING) */ | ||
251 | BH_Freed, /* Has been freed (truncated) */ | ||
252 | BH_Revoked, /* Has been revoked from the log */ | ||
253 | BH_RevokeValid, /* Revoked flag is valid */ | ||
254 | BH_JBDDirty, /* Is dirty but journaled */ | ||
255 | BH_State, /* Pins most journal_head state */ | ||
256 | BH_JournalHead, /* Pins bh->b_private and jh->b_bh */ | ||
257 | BH_Unshadow, /* Dummy bit, for BJ_Shadow wakeup filtering */ | ||
258 | BH_JBDPrivateStart, /* First bit available for private use by FS */ | ||
259 | }; | ||
260 | |||
261 | BUFFER_FNS(JBD, jbd) | ||
262 | BUFFER_FNS(JWrite, jwrite) | ||
263 | BUFFER_FNS(JBDDirty, jbddirty) | ||
264 | TAS_BUFFER_FNS(JBDDirty, jbddirty) | ||
265 | BUFFER_FNS(Revoked, revoked) | ||
266 | TAS_BUFFER_FNS(Revoked, revoked) | ||
267 | BUFFER_FNS(RevokeValid, revokevalid) | ||
268 | TAS_BUFFER_FNS(RevokeValid, revokevalid) | ||
269 | BUFFER_FNS(Freed, freed) | ||
270 | |||
247 | #include <linux/jbd_common.h> | 271 | #include <linux/jbd_common.h> |
248 | 272 | ||
249 | #define J_ASSERT(assert) BUG_ON(!(assert)) | 273 | #define J_ASSERT(assert) BUG_ON(!(assert)) |
@@ -840,7 +864,7 @@ extern void journal_release_buffer (handle_t *, struct buffer_head *); | |||
840 | extern int journal_forget (handle_t *, struct buffer_head *); | 864 | extern int journal_forget (handle_t *, struct buffer_head *); |
841 | extern void journal_sync_buffer (struct buffer_head *); | 865 | extern void journal_sync_buffer (struct buffer_head *); |
842 | extern void journal_invalidatepage(journal_t *, | 866 | extern void journal_invalidatepage(journal_t *, |
843 | struct page *, unsigned long); | 867 | struct page *, unsigned int, unsigned int); |
844 | extern int journal_try_to_free_buffers(journal_t *, struct page *, gfp_t); | 868 | extern int journal_try_to_free_buffers(journal_t *, struct page *, gfp_t); |
845 | extern int journal_stop(handle_t *); | 869 | extern int journal_stop(handle_t *); |
846 | extern int journal_flush (journal_t *); | 870 | extern int journal_flush (journal_t *); |
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 6e051f472edb..d5b50a19463c 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/buffer_head.h> | 26 | #include <linux/buffer_head.h> |
27 | #include <linux/journal-head.h> | 27 | #include <linux/journal-head.h> |
28 | #include <linux/stddef.h> | 28 | #include <linux/stddef.h> |
29 | #include <linux/bit_spinlock.h> | ||
30 | #include <linux/mutex.h> | 29 | #include <linux/mutex.h> |
31 | #include <linux/timer.h> | 30 | #include <linux/timer.h> |
32 | #include <linux/slab.h> | 31 | #include <linux/slab.h> |
@@ -57,17 +56,13 @@ | |||
57 | */ | 56 | */ |
58 | #define JBD2_EXPENSIVE_CHECKING | 57 | #define JBD2_EXPENSIVE_CHECKING |
59 | extern ushort jbd2_journal_enable_debug; | 58 | extern ushort jbd2_journal_enable_debug; |
59 | void __jbd2_debug(int level, const char *file, const char *func, | ||
60 | unsigned int line, const char *fmt, ...); | ||
60 | 61 | ||
61 | #define jbd_debug(n, f, a...) \ | 62 | #define jbd_debug(n, fmt, a...) \ |
62 | do { \ | 63 | __jbd2_debug((n), __FILE__, __func__, __LINE__, (fmt), ##a) |
63 | if ((n) <= jbd2_journal_enable_debug) { \ | ||
64 | printk (KERN_DEBUG "(%s, %d): %s: ", \ | ||
65 | __FILE__, __LINE__, __func__); \ | ||
66 | printk (f, ## a); \ | ||
67 | } \ | ||
68 | } while (0) | ||
69 | #else | 64 | #else |
70 | #define jbd_debug(f, a...) /**/ | 65 | #define jbd_debug(n, fmt, a...) /**/ |
71 | #endif | 66 | #endif |
72 | 67 | ||
73 | extern void *jbd2_alloc(size_t size, gfp_t flags); | 68 | extern void *jbd2_alloc(size_t size, gfp_t flags); |
@@ -302,6 +297,34 @@ typedef struct journal_superblock_s | |||
302 | 297 | ||
303 | #include <linux/fs.h> | 298 | #include <linux/fs.h> |
304 | #include <linux/sched.h> | 299 | #include <linux/sched.h> |
300 | |||
301 | enum jbd_state_bits { | ||
302 | BH_JBD /* Has an attached ext3 journal_head */ | ||
303 | = BH_PrivateStart, | ||
304 | BH_JWrite, /* Being written to log (@@@ DEBUGGING) */ | ||
305 | BH_Freed, /* Has been freed (truncated) */ | ||
306 | BH_Revoked, /* Has been revoked from the log */ | ||
307 | BH_RevokeValid, /* Revoked flag is valid */ | ||
308 | BH_JBDDirty, /* Is dirty but journaled */ | ||
309 | BH_State, /* Pins most journal_head state */ | ||
310 | BH_JournalHead, /* Pins bh->b_private and jh->b_bh */ | ||
311 | BH_Shadow, /* IO on shadow buffer is running */ | ||
312 | BH_Verified, /* Metadata block has been verified ok */ | ||
313 | BH_JBDPrivateStart, /* First bit available for private use by FS */ | ||
314 | }; | ||
315 | |||
316 | BUFFER_FNS(JBD, jbd) | ||
317 | BUFFER_FNS(JWrite, jwrite) | ||
318 | BUFFER_FNS(JBDDirty, jbddirty) | ||
319 | TAS_BUFFER_FNS(JBDDirty, jbddirty) | ||
320 | BUFFER_FNS(Revoked, revoked) | ||
321 | TAS_BUFFER_FNS(Revoked, revoked) | ||
322 | BUFFER_FNS(RevokeValid, revokevalid) | ||
323 | TAS_BUFFER_FNS(RevokeValid, revokevalid) | ||
324 | BUFFER_FNS(Freed, freed) | ||
325 | BUFFER_FNS(Shadow, shadow) | ||
326 | BUFFER_FNS(Verified, verified) | ||
327 | |||
305 | #include <linux/jbd_common.h> | 328 | #include <linux/jbd_common.h> |
306 | 329 | ||
307 | #define J_ASSERT(assert) BUG_ON(!(assert)) | 330 | #define J_ASSERT(assert) BUG_ON(!(assert)) |
@@ -382,8 +405,15 @@ struct jbd2_revoke_table_s; | |||
382 | 405 | ||
383 | struct jbd2_journal_handle | 406 | struct jbd2_journal_handle |
384 | { | 407 | { |
385 | /* Which compound transaction is this update a part of? */ | 408 | union { |
386 | transaction_t *h_transaction; | 409 | /* Which compound transaction is this update a part of? */ |
410 | transaction_t *h_transaction; | ||
411 | /* Which journal handle belongs to - used iff h_reserved set */ | ||
412 | journal_t *h_journal; | ||
413 | }; | ||
414 | |||
415 | /* Handle reserved for finishing the logical operation */ | ||
416 | handle_t *h_rsv_handle; | ||
387 | 417 | ||
388 | /* Number of remaining buffers we are allowed to dirty: */ | 418 | /* Number of remaining buffers we are allowed to dirty: */ |
389 | int h_buffer_credits; | 419 | int h_buffer_credits; |
@@ -398,6 +428,7 @@ struct jbd2_journal_handle | |||
398 | /* Flags [no locking] */ | 428 | /* Flags [no locking] */ |
399 | unsigned int h_sync: 1; /* sync-on-close */ | 429 | unsigned int h_sync: 1; /* sync-on-close */ |
400 | unsigned int h_jdata: 1; /* force data journaling */ | 430 | unsigned int h_jdata: 1; /* force data journaling */ |
431 | unsigned int h_reserved: 1; /* handle with reserved credits */ | ||
401 | unsigned int h_aborted: 1; /* fatal error on handle */ | 432 | unsigned int h_aborted: 1; /* fatal error on handle */ |
402 | unsigned int h_type: 8; /* for handle statistics */ | 433 | unsigned int h_type: 8; /* for handle statistics */ |
403 | unsigned int h_line_no: 16; /* for handle statistics */ | 434 | unsigned int h_line_no: 16; /* for handle statistics */ |
@@ -524,12 +555,6 @@ struct transaction_s | |||
524 | struct journal_head *t_checkpoint_io_list; | 555 | struct journal_head *t_checkpoint_io_list; |
525 | 556 | ||
526 | /* | 557 | /* |
527 | * Doubly-linked circular list of temporary buffers currently undergoing | ||
528 | * IO in the log [j_list_lock] | ||
529 | */ | ||
530 | struct journal_head *t_iobuf_list; | ||
531 | |||
532 | /* | ||
533 | * Doubly-linked circular list of metadata buffers being shadowed by log | 558 | * Doubly-linked circular list of metadata buffers being shadowed by log |
534 | * IO. The IO buffers on the iobuf list and the shadow buffers on this | 559 | * IO. The IO buffers on the iobuf list and the shadow buffers on this |
535 | * list match each other one for one at all times. [j_list_lock] | 560 | * list match each other one for one at all times. [j_list_lock] |
@@ -537,12 +562,6 @@ struct transaction_s | |||
537 | struct journal_head *t_shadow_list; | 562 | struct journal_head *t_shadow_list; |
538 | 563 | ||
539 | /* | 564 | /* |
540 | * Doubly-linked circular list of control buffers being written to the | ||
541 | * log. [j_list_lock] | ||
542 | */ | ||
543 | struct journal_head *t_log_list; | ||
544 | |||
545 | /* | ||
546 | * List of inodes whose data we've modified in data=ordered mode. | 565 | * List of inodes whose data we've modified in data=ordered mode. |
547 | * [j_list_lock] | 566 | * [j_list_lock] |
548 | */ | 567 | */ |
@@ -671,11 +690,10 @@ jbd2_time_diff(unsigned long start, unsigned long end) | |||
671 | * waiting for checkpointing | 690 | * waiting for checkpointing |
672 | * @j_wait_transaction_locked: Wait queue for waiting for a locked transaction | 691 | * @j_wait_transaction_locked: Wait queue for waiting for a locked transaction |
673 | * to start committing, or for a barrier lock to be released | 692 | * to start committing, or for a barrier lock to be released |
674 | * @j_wait_logspace: Wait queue for waiting for checkpointing to complete | ||
675 | * @j_wait_done_commit: Wait queue for waiting for commit to complete | 693 | * @j_wait_done_commit: Wait queue for waiting for commit to complete |
676 | * @j_wait_checkpoint: Wait queue to trigger checkpointing | ||
677 | * @j_wait_commit: Wait queue to trigger commit | 694 | * @j_wait_commit: Wait queue to trigger commit |
678 | * @j_wait_updates: Wait queue to wait for updates to complete | 695 | * @j_wait_updates: Wait queue to wait for updates to complete |
696 | * @j_wait_reserved: Wait queue to wait for reserved buffer credits to drop | ||
679 | * @j_checkpoint_mutex: Mutex for locking against concurrent checkpoints | 697 | * @j_checkpoint_mutex: Mutex for locking against concurrent checkpoints |
680 | * @j_head: Journal head - identifies the first unused block in the journal | 698 | * @j_head: Journal head - identifies the first unused block in the journal |
681 | * @j_tail: Journal tail - identifies the oldest still-used block in the | 699 | * @j_tail: Journal tail - identifies the oldest still-used block in the |
@@ -689,6 +707,7 @@ jbd2_time_diff(unsigned long start, unsigned long end) | |||
689 | * journal | 707 | * journal |
690 | * @j_fs_dev: Device which holds the client fs. For internal journal this will | 708 | * @j_fs_dev: Device which holds the client fs. For internal journal this will |
691 | * be equal to j_dev | 709 | * be equal to j_dev |
710 | * @j_reserved_credits: Number of buffers reserved from the running transaction | ||
692 | * @j_maxlen: Total maximum capacity of the journal region on disk. | 711 | * @j_maxlen: Total maximum capacity of the journal region on disk. |
693 | * @j_list_lock: Protects the buffer lists and internal buffer state. | 712 | * @j_list_lock: Protects the buffer lists and internal buffer state. |
694 | * @j_inode: Optional inode where we store the journal. If present, all journal | 713 | * @j_inode: Optional inode where we store the journal. If present, all journal |
@@ -778,21 +797,18 @@ struct journal_s | |||
778 | */ | 797 | */ |
779 | wait_queue_head_t j_wait_transaction_locked; | 798 | wait_queue_head_t j_wait_transaction_locked; |
780 | 799 | ||
781 | /* Wait queue for waiting for checkpointing to complete */ | ||
782 | wait_queue_head_t j_wait_logspace; | ||
783 | |||
784 | /* Wait queue for waiting for commit to complete */ | 800 | /* Wait queue for waiting for commit to complete */ |
785 | wait_queue_head_t j_wait_done_commit; | 801 | wait_queue_head_t j_wait_done_commit; |
786 | 802 | ||
787 | /* Wait queue to trigger checkpointing */ | ||
788 | wait_queue_head_t j_wait_checkpoint; | ||
789 | |||
790 | /* Wait queue to trigger commit */ | 803 | /* Wait queue to trigger commit */ |
791 | wait_queue_head_t j_wait_commit; | 804 | wait_queue_head_t j_wait_commit; |
792 | 805 | ||
793 | /* Wait queue to wait for updates to complete */ | 806 | /* Wait queue to wait for updates to complete */ |
794 | wait_queue_head_t j_wait_updates; | 807 | wait_queue_head_t j_wait_updates; |
795 | 808 | ||
809 | /* Wait queue to wait for reserved buffer credits to drop */ | ||
810 | wait_queue_head_t j_wait_reserved; | ||
811 | |||
796 | /* Semaphore for locking against concurrent checkpoints */ | 812 | /* Semaphore for locking against concurrent checkpoints */ |
797 | struct mutex j_checkpoint_mutex; | 813 | struct mutex j_checkpoint_mutex; |
798 | 814 | ||
@@ -847,6 +863,9 @@ struct journal_s | |||
847 | /* Total maximum capacity of the journal region on disk. */ | 863 | /* Total maximum capacity of the journal region on disk. */ |
848 | unsigned int j_maxlen; | 864 | unsigned int j_maxlen; |
849 | 865 | ||
866 | /* Number of buffers reserved from the running transaction */ | ||
867 | atomic_t j_reserved_credits; | ||
868 | |||
850 | /* | 869 | /* |
851 | * Protects the buffer lists and internal buffer state. | 870 | * Protects the buffer lists and internal buffer state. |
852 | */ | 871 | */ |
@@ -991,9 +1010,17 @@ extern void __jbd2_journal_file_buffer(struct journal_head *, transaction_t *, i | |||
991 | extern void __journal_free_buffer(struct journal_head *bh); | 1010 | extern void __journal_free_buffer(struct journal_head *bh); |
992 | extern void jbd2_journal_file_buffer(struct journal_head *, transaction_t *, int); | 1011 | extern void jbd2_journal_file_buffer(struct journal_head *, transaction_t *, int); |
993 | extern void __journal_clean_data_list(transaction_t *transaction); | 1012 | extern void __journal_clean_data_list(transaction_t *transaction); |
1013 | static inline void jbd2_file_log_bh(struct list_head *head, struct buffer_head *bh) | ||
1014 | { | ||
1015 | list_add_tail(&bh->b_assoc_buffers, head); | ||
1016 | } | ||
1017 | static inline void jbd2_unfile_log_bh(struct buffer_head *bh) | ||
1018 | { | ||
1019 | list_del_init(&bh->b_assoc_buffers); | ||
1020 | } | ||
994 | 1021 | ||
995 | /* Log buffer allocation */ | 1022 | /* Log buffer allocation */ |
996 | extern struct journal_head * jbd2_journal_get_descriptor_buffer(journal_t *); | 1023 | struct buffer_head *jbd2_journal_get_descriptor_buffer(journal_t *journal); |
997 | int jbd2_journal_next_log_block(journal_t *, unsigned long long *); | 1024 | int jbd2_journal_next_log_block(journal_t *, unsigned long long *); |
998 | int jbd2_journal_get_log_tail(journal_t *journal, tid_t *tid, | 1025 | int jbd2_journal_get_log_tail(journal_t *journal, tid_t *tid, |
999 | unsigned long *block); | 1026 | unsigned long *block); |
@@ -1039,11 +1066,10 @@ extern void jbd2_buffer_abort_trigger(struct journal_head *jh, | |||
1039 | struct jbd2_buffer_trigger_type *triggers); | 1066 | struct jbd2_buffer_trigger_type *triggers); |
1040 | 1067 | ||
1041 | /* Buffer IO */ | 1068 | /* Buffer IO */ |
1042 | extern int | 1069 | extern int jbd2_journal_write_metadata_buffer(transaction_t *transaction, |
1043 | jbd2_journal_write_metadata_buffer(transaction_t *transaction, | 1070 | struct journal_head *jh_in, |
1044 | struct journal_head *jh_in, | 1071 | struct buffer_head **bh_out, |
1045 | struct journal_head **jh_out, | 1072 | sector_t blocknr); |
1046 | unsigned long long blocknr); | ||
1047 | 1073 | ||
1048 | /* Transaction locking */ | 1074 | /* Transaction locking */ |
1049 | extern void __wait_on_journal (journal_t *); | 1075 | extern void __wait_on_journal (journal_t *); |
@@ -1076,10 +1102,14 @@ static inline handle_t *journal_current_handle(void) | |||
1076 | */ | 1102 | */ |
1077 | 1103 | ||
1078 | extern handle_t *jbd2_journal_start(journal_t *, int nblocks); | 1104 | extern handle_t *jbd2_journal_start(journal_t *, int nblocks); |
1079 | extern handle_t *jbd2__journal_start(journal_t *, int nblocks, gfp_t gfp_mask, | 1105 | extern handle_t *jbd2__journal_start(journal_t *, int blocks, int rsv_blocks, |
1080 | unsigned int type, unsigned int line_no); | 1106 | gfp_t gfp_mask, unsigned int type, |
1107 | unsigned int line_no); | ||
1081 | extern int jbd2_journal_restart(handle_t *, int nblocks); | 1108 | extern int jbd2_journal_restart(handle_t *, int nblocks); |
1082 | extern int jbd2__journal_restart(handle_t *, int nblocks, gfp_t gfp_mask); | 1109 | extern int jbd2__journal_restart(handle_t *, int nblocks, gfp_t gfp_mask); |
1110 | extern int jbd2_journal_start_reserved(handle_t *handle, | ||
1111 | unsigned int type, unsigned int line_no); | ||
1112 | extern void jbd2_journal_free_reserved(handle_t *handle); | ||
1083 | extern int jbd2_journal_extend (handle_t *, int nblocks); | 1113 | extern int jbd2_journal_extend (handle_t *, int nblocks); |
1084 | extern int jbd2_journal_get_write_access(handle_t *, struct buffer_head *); | 1114 | extern int jbd2_journal_get_write_access(handle_t *, struct buffer_head *); |
1085 | extern int jbd2_journal_get_create_access (handle_t *, struct buffer_head *); | 1115 | extern int jbd2_journal_get_create_access (handle_t *, struct buffer_head *); |
@@ -1090,7 +1120,7 @@ extern int jbd2_journal_dirty_metadata (handle_t *, struct buffer_head *); | |||
1090 | extern int jbd2_journal_forget (handle_t *, struct buffer_head *); | 1120 | extern int jbd2_journal_forget (handle_t *, struct buffer_head *); |
1091 | extern void journal_sync_buffer (struct buffer_head *); | 1121 | extern void journal_sync_buffer (struct buffer_head *); |
1092 | extern int jbd2_journal_invalidatepage(journal_t *, | 1122 | extern int jbd2_journal_invalidatepage(journal_t *, |
1093 | struct page *, unsigned long); | 1123 | struct page *, unsigned int, unsigned int); |
1094 | extern int jbd2_journal_try_to_free_buffers(journal_t *, struct page *, gfp_t); | 1124 | extern int jbd2_journal_try_to_free_buffers(journal_t *, struct page *, gfp_t); |
1095 | extern int jbd2_journal_stop(handle_t *); | 1125 | extern int jbd2_journal_stop(handle_t *); |
1096 | extern int jbd2_journal_flush (journal_t *); | 1126 | extern int jbd2_journal_flush (journal_t *); |
@@ -1125,6 +1155,7 @@ extern void jbd2_journal_ack_err (journal_t *); | |||
1125 | extern int jbd2_journal_clear_err (journal_t *); | 1155 | extern int jbd2_journal_clear_err (journal_t *); |
1126 | extern int jbd2_journal_bmap(journal_t *, unsigned long, unsigned long long *); | 1156 | extern int jbd2_journal_bmap(journal_t *, unsigned long, unsigned long long *); |
1127 | extern int jbd2_journal_force_commit(journal_t *); | 1157 | extern int jbd2_journal_force_commit(journal_t *); |
1158 | extern int jbd2_journal_force_commit_nested(journal_t *); | ||
1128 | extern int jbd2_journal_file_inode(handle_t *handle, struct jbd2_inode *inode); | 1159 | extern int jbd2_journal_file_inode(handle_t *handle, struct jbd2_inode *inode); |
1129 | extern int jbd2_journal_begin_ordered_truncate(journal_t *journal, | 1160 | extern int jbd2_journal_begin_ordered_truncate(journal_t *journal, |
1130 | struct jbd2_inode *inode, loff_t new_size); | 1161 | struct jbd2_inode *inode, loff_t new_size); |
@@ -1178,8 +1209,10 @@ extern int jbd2_journal_init_revoke_caches(void); | |||
1178 | extern void jbd2_journal_destroy_revoke(journal_t *); | 1209 | extern void jbd2_journal_destroy_revoke(journal_t *); |
1179 | extern int jbd2_journal_revoke (handle_t *, unsigned long long, struct buffer_head *); | 1210 | extern int jbd2_journal_revoke (handle_t *, unsigned long long, struct buffer_head *); |
1180 | extern int jbd2_journal_cancel_revoke(handle_t *, struct journal_head *); | 1211 | extern int jbd2_journal_cancel_revoke(handle_t *, struct journal_head *); |
1181 | extern void jbd2_journal_write_revoke_records(journal_t *, | 1212 | extern void jbd2_journal_write_revoke_records(journal_t *journal, |
1182 | transaction_t *, int); | 1213 | transaction_t *transaction, |
1214 | struct list_head *log_bufs, | ||
1215 | int write_op); | ||
1183 | 1216 | ||
1184 | /* Recovery revoke support */ | 1217 | /* Recovery revoke support */ |
1185 | extern int jbd2_journal_set_revoke(journal_t *, unsigned long long, tid_t); | 1218 | extern int jbd2_journal_set_revoke(journal_t *, unsigned long long, tid_t); |
@@ -1195,11 +1228,9 @@ extern void jbd2_clear_buffer_revoked_flags(journal_t *journal); | |||
1195 | * transitions on demand. | 1228 | * transitions on demand. |
1196 | */ | 1229 | */ |
1197 | 1230 | ||
1198 | int __jbd2_log_space_left(journal_t *); /* Called with journal locked */ | ||
1199 | int jbd2_log_start_commit(journal_t *journal, tid_t tid); | 1231 | int jbd2_log_start_commit(journal_t *journal, tid_t tid); |
1200 | int __jbd2_log_start_commit(journal_t *journal, tid_t tid); | 1232 | int __jbd2_log_start_commit(journal_t *journal, tid_t tid); |
1201 | int jbd2_journal_start_commit(journal_t *journal, tid_t *tid); | 1233 | int jbd2_journal_start_commit(journal_t *journal, tid_t *tid); |
1202 | int jbd2_journal_force_commit_nested(journal_t *journal); | ||
1203 | int jbd2_log_wait_commit(journal_t *journal, tid_t tid); | 1234 | int jbd2_log_wait_commit(journal_t *journal, tid_t tid); |
1204 | int jbd2_complete_transaction(journal_t *journal, tid_t tid); | 1235 | int jbd2_complete_transaction(journal_t *journal, tid_t tid); |
1205 | int jbd2_log_do_checkpoint(journal_t *journal); | 1236 | int jbd2_log_do_checkpoint(journal_t *journal); |
@@ -1235,7 +1266,7 @@ static inline int is_journal_aborted(journal_t *journal) | |||
1235 | 1266 | ||
1236 | static inline int is_handle_aborted(handle_t *handle) | 1267 | static inline int is_handle_aborted(handle_t *handle) |
1237 | { | 1268 | { |
1238 | if (handle->h_aborted) | 1269 | if (handle->h_aborted || !handle->h_transaction) |
1239 | return 1; | 1270 | return 1; |
1240 | return is_journal_aborted(handle->h_transaction->t_journal); | 1271 | return is_journal_aborted(handle->h_transaction->t_journal); |
1241 | } | 1272 | } |
@@ -1266,16 +1297,37 @@ extern int jbd2_journal_blocks_per_page(struct inode *inode); | |||
1266 | extern size_t journal_tag_bytes(journal_t *journal); | 1297 | extern size_t journal_tag_bytes(journal_t *journal); |
1267 | 1298 | ||
1268 | /* | 1299 | /* |
1300 | * We reserve t_outstanding_credits >> JBD2_CONTROL_BLOCKS_SHIFT for | ||
1301 | * transaction control blocks. | ||
1302 | */ | ||
1303 | #define JBD2_CONTROL_BLOCKS_SHIFT 5 | ||
1304 | |||
1305 | /* | ||
1269 | * Return the minimum number of blocks which must be free in the journal | 1306 | * Return the minimum number of blocks which must be free in the journal |
1270 | * before a new transaction may be started. Must be called under j_state_lock. | 1307 | * before a new transaction may be started. Must be called under j_state_lock. |
1271 | */ | 1308 | */ |
1272 | static inline int jbd_space_needed(journal_t *journal) | 1309 | static inline int jbd2_space_needed(journal_t *journal) |
1273 | { | 1310 | { |
1274 | int nblocks = journal->j_max_transaction_buffers; | 1311 | int nblocks = journal->j_max_transaction_buffers; |
1275 | if (journal->j_committing_transaction) | 1312 | return nblocks + (nblocks >> JBD2_CONTROL_BLOCKS_SHIFT); |
1276 | nblocks += atomic_read(&journal->j_committing_transaction-> | 1313 | } |
1277 | t_outstanding_credits); | 1314 | |
1278 | return nblocks; | 1315 | /* |
1316 | * Return number of free blocks in the log. Must be called under j_state_lock. | ||
1317 | */ | ||
1318 | static inline unsigned long jbd2_log_space_left(journal_t *journal) | ||
1319 | { | ||
1320 | /* Allow for rounding errors */ | ||
1321 | unsigned long free = journal->j_free - 32; | ||
1322 | |||
1323 | if (journal->j_committing_transaction) { | ||
1324 | unsigned long committing = atomic_read(&journal-> | ||
1325 | j_committing_transaction->t_outstanding_credits); | ||
1326 | |||
1327 | /* Transaction + control blocks */ | ||
1328 | free -= committing + (committing >> JBD2_CONTROL_BLOCKS_SHIFT); | ||
1329 | } | ||
1330 | return free; | ||
1279 | } | 1331 | } |
1280 | 1332 | ||
1281 | /* | 1333 | /* |
@@ -1286,11 +1338,9 @@ static inline int jbd_space_needed(journal_t *journal) | |||
1286 | #define BJ_None 0 /* Not journaled */ | 1338 | #define BJ_None 0 /* Not journaled */ |
1287 | #define BJ_Metadata 1 /* Normal journaled metadata */ | 1339 | #define BJ_Metadata 1 /* Normal journaled metadata */ |
1288 | #define BJ_Forget 2 /* Buffer superseded by this transaction */ | 1340 | #define BJ_Forget 2 /* Buffer superseded by this transaction */ |
1289 | #define BJ_IO 3 /* Buffer is for temporary IO use */ | 1341 | #define BJ_Shadow 3 /* Buffer contents being shadowed to the log */ |
1290 | #define BJ_Shadow 4 /* Buffer contents being shadowed to the log */ | 1342 | #define BJ_Reserved 4 /* Buffer is reserved for access by journal */ |
1291 | #define BJ_LogCtl 5 /* Buffer contains log descriptors */ | 1343 | #define BJ_Types 5 |
1292 | #define BJ_Reserved 6 /* Buffer is reserved for access by journal */ | ||
1293 | #define BJ_Types 7 | ||
1294 | 1344 | ||
1295 | extern int jbd_blocks_per_page(struct inode *inode); | 1345 | extern int jbd_blocks_per_page(struct inode *inode); |
1296 | 1346 | ||
@@ -1319,6 +1369,19 @@ static inline u32 jbd2_chksum(journal_t *journal, u32 crc, | |||
1319 | return *(u32 *)desc.ctx; | 1369 | return *(u32 *)desc.ctx; |
1320 | } | 1370 | } |
1321 | 1371 | ||
1372 | /* Return most recent uncommitted transaction */ | ||
1373 | static inline tid_t jbd2_get_latest_transaction(journal_t *journal) | ||
1374 | { | ||
1375 | tid_t tid; | ||
1376 | |||
1377 | read_lock(&journal->j_state_lock); | ||
1378 | tid = journal->j_commit_request; | ||
1379 | if (journal->j_running_transaction) | ||
1380 | tid = journal->j_running_transaction->t_tid; | ||
1381 | read_unlock(&journal->j_state_lock); | ||
1382 | return tid; | ||
1383 | } | ||
1384 | |||
1322 | #ifdef __KERNEL__ | 1385 | #ifdef __KERNEL__ |
1323 | 1386 | ||
1324 | #define buffer_trace_init(bh) do {} while (0) | 1387 | #define buffer_trace_init(bh) do {} while (0) |
diff --git a/include/linux/jbd_common.h b/include/linux/jbd_common.h index 6133679bc4c0..3dc53432355f 100644 --- a/include/linux/jbd_common.h +++ b/include/linux/jbd_common.h | |||
@@ -1,31 +1,7 @@ | |||
1 | #ifndef _LINUX_JBD_STATE_H | 1 | #ifndef _LINUX_JBD_STATE_H |
2 | #define _LINUX_JBD_STATE_H | 2 | #define _LINUX_JBD_STATE_H |
3 | 3 | ||
4 | enum jbd_state_bits { | 4 | #include <linux/bit_spinlock.h> |
5 | BH_JBD /* Has an attached ext3 journal_head */ | ||
6 | = BH_PrivateStart, | ||
7 | BH_JWrite, /* Being written to log (@@@ DEBUGGING) */ | ||
8 | BH_Freed, /* Has been freed (truncated) */ | ||
9 | BH_Revoked, /* Has been revoked from the log */ | ||
10 | BH_RevokeValid, /* Revoked flag is valid */ | ||
11 | BH_JBDDirty, /* Is dirty but journaled */ | ||
12 | BH_State, /* Pins most journal_head state */ | ||
13 | BH_JournalHead, /* Pins bh->b_private and jh->b_bh */ | ||
14 | BH_Unshadow, /* Dummy bit, for BJ_Shadow wakeup filtering */ | ||
15 | BH_Verified, /* Metadata block has been verified ok */ | ||
16 | BH_JBDPrivateStart, /* First bit available for private use by FS */ | ||
17 | }; | ||
18 | |||
19 | BUFFER_FNS(JBD, jbd) | ||
20 | BUFFER_FNS(JWrite, jwrite) | ||
21 | BUFFER_FNS(JBDDirty, jbddirty) | ||
22 | TAS_BUFFER_FNS(JBDDirty, jbddirty) | ||
23 | BUFFER_FNS(Revoked, revoked) | ||
24 | TAS_BUFFER_FNS(Revoked, revoked) | ||
25 | BUFFER_FNS(RevokeValid, revokevalid) | ||
26 | TAS_BUFFER_FNS(RevokeValid, revokevalid) | ||
27 | BUFFER_FNS(Freed, freed) | ||
28 | BUFFER_FNS(Verified, verified) | ||
29 | 5 | ||
30 | static inline struct buffer_head *jh2bh(struct journal_head *jh) | 6 | static inline struct buffer_head *jh2bh(struct journal_head *jh) |
31 | { | 7 | { |
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index 8fb8edf12417..97ba4e78a37e 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h | |||
@@ -139,6 +139,10 @@ static inline u64 get_jiffies_64(void) | |||
139 | ((__s64)(a) - (__s64)(b) >= 0)) | 139 | ((__s64)(a) - (__s64)(b) >= 0)) |
140 | #define time_before_eq64(a,b) time_after_eq64(b,a) | 140 | #define time_before_eq64(a,b) time_after_eq64(b,a) |
141 | 141 | ||
142 | #define time_in_range64(a, b, c) \ | ||
143 | (time_after_eq64(a, b) && \ | ||
144 | time_before_eq64(a, c)) | ||
145 | |||
142 | /* | 146 | /* |
143 | * These four macros compare jiffies and 'a' for convenience. | 147 | * These four macros compare jiffies and 'a' for convenience. |
144 | */ | 148 | */ |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index e9ef6d6b51d5..482ad2d84a32 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -193,13 +193,10 @@ extern int _cond_resched(void); | |||
193 | (__x < 0) ? -__x : __x; \ | 193 | (__x < 0) ? -__x : __x; \ |
194 | }) | 194 | }) |
195 | 195 | ||
196 | #ifdef CONFIG_PROVE_LOCKING | 196 | #if defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP) |
197 | void might_fault(void); | 197 | void might_fault(void); |
198 | #else | 198 | #else |
199 | static inline void might_fault(void) | 199 | static inline void might_fault(void) { } |
200 | { | ||
201 | might_sleep(); | ||
202 | } | ||
203 | #endif | 200 | #endif |
204 | 201 | ||
205 | extern struct atomic_notifier_head panic_notifier_list; | 202 | extern struct atomic_notifier_head panic_notifier_list; |
@@ -450,6 +447,8 @@ static inline char * __deprecated pack_hex_byte(char *buf, u8 byte) | |||
450 | extern int hex_to_bin(char ch); | 447 | extern int hex_to_bin(char ch); |
451 | extern int __must_check hex2bin(u8 *dst, const char *src, size_t count); | 448 | extern int __must_check hex2bin(u8 *dst, const char *src, size_t count); |
452 | 449 | ||
450 | int mac_pton(const char *s, u8 *mac); | ||
451 | |||
453 | /* | 452 | /* |
454 | * General tracing related utility functions - trace_printk(), | 453 | * General tracing related utility functions - trace_printk(), |
455 | * tracing_on/tracing_off and tracing_start()/tracing_stop | 454 | * tracing_on/tracing_off and tracing_start()/tracing_stop |
@@ -562,9 +561,6 @@ int __trace_bprintk(unsigned long ip, const char *fmt, ...); | |||
562 | extern __printf(2, 3) | 561 | extern __printf(2, 3) |
563 | int __trace_printk(unsigned long ip, const char *fmt, ...); | 562 | int __trace_printk(unsigned long ip, const char *fmt, ...); |
564 | 563 | ||
565 | extern int __trace_bputs(unsigned long ip, const char *str); | ||
566 | extern int __trace_puts(unsigned long ip, const char *str, int size); | ||
567 | |||
568 | /** | 564 | /** |
569 | * trace_puts - write a string into the ftrace buffer | 565 | * trace_puts - write a string into the ftrace buffer |
570 | * @str: the string to record | 566 | * @str: the string to record |
@@ -600,6 +596,8 @@ extern int __trace_puts(unsigned long ip, const char *str, int size); | |||
600 | else \ | 596 | else \ |
601 | __trace_puts(_THIS_IP_, str, strlen(str)); \ | 597 | __trace_puts(_THIS_IP_, str, strlen(str)); \ |
602 | }) | 598 | }) |
599 | extern int __trace_bputs(unsigned long ip, const char *str); | ||
600 | extern int __trace_puts(unsigned long ip, const char *str, int size); | ||
603 | 601 | ||
604 | extern void trace_dump_stack(int skip); | 602 | extern void trace_dump_stack(int skip); |
605 | 603 | ||
@@ -631,7 +629,7 @@ extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode); | |||
631 | static inline void tracing_start(void) { } | 629 | static inline void tracing_start(void) { } |
632 | static inline void tracing_stop(void) { } | 630 | static inline void tracing_stop(void) { } |
633 | static inline void ftrace_off_permanent(void) { } | 631 | static inline void ftrace_off_permanent(void) { } |
634 | static inline void trace_dump_stack(void) { } | 632 | static inline void trace_dump_stack(int skip) { } |
635 | 633 | ||
636 | static inline void tracing_on(void) { } | 634 | static inline void tracing_on(void) { } |
637 | static inline void tracing_off(void) { } | 635 | static inline void tracing_off(void) { } |
diff --git a/include/linux/ktime.h b/include/linux/ktime.h index bbca12804d12..debf208b7611 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h | |||
@@ -229,7 +229,8 @@ static inline ktime_t timespec_to_ktime(const struct timespec ts) | |||
229 | static inline ktime_t timeval_to_ktime(const struct timeval tv) | 229 | static inline ktime_t timeval_to_ktime(const struct timeval tv) |
230 | { | 230 | { |
231 | return (ktime_t) { .tv = { .sec = (s32)tv.tv_sec, | 231 | return (ktime_t) { .tv = { .sec = (s32)tv.tv_sec, |
232 | .nsec = (s32)tv.tv_usec * 1000 } }; | 232 | .nsec = (s32)(tv.tv_usec * |
233 | NSEC_PER_USEC) } }; | ||
233 | } | 234 | } |
234 | 235 | ||
235 | /** | 236 | /** |
@@ -320,12 +321,17 @@ static inline s64 ktime_us_delta(const ktime_t later, const ktime_t earlier) | |||
320 | 321 | ||
321 | static inline ktime_t ktime_add_us(const ktime_t kt, const u64 usec) | 322 | static inline ktime_t ktime_add_us(const ktime_t kt, const u64 usec) |
322 | { | 323 | { |
323 | return ktime_add_ns(kt, usec * 1000); | 324 | return ktime_add_ns(kt, usec * NSEC_PER_USEC); |
325 | } | ||
326 | |||
327 | static inline ktime_t ktime_add_ms(const ktime_t kt, const u64 msec) | ||
328 | { | ||
329 | return ktime_add_ns(kt, msec * NSEC_PER_MSEC); | ||
324 | } | 330 | } |
325 | 331 | ||
326 | static inline ktime_t ktime_sub_us(const ktime_t kt, const u64 usec) | 332 | static inline ktime_t ktime_sub_us(const ktime_t kt, const u64 usec) |
327 | { | 333 | { |
328 | return ktime_sub_ns(kt, usec * 1000); | 334 | return ktime_sub_ns(kt, usec * NSEC_PER_USEC); |
329 | } | 335 | } |
330 | 336 | ||
331 | extern ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs); | 337 | extern ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs); |
@@ -338,7 +344,8 @@ extern ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs); | |||
338 | * | 344 | * |
339 | * Returns true if there was a successful conversion, false if kt was 0. | 345 | * Returns true if there was a successful conversion, false if kt was 0. |
340 | */ | 346 | */ |
341 | static inline bool ktime_to_timespec_cond(const ktime_t kt, struct timespec *ts) | 347 | static inline __must_check bool ktime_to_timespec_cond(const ktime_t kt, |
348 | struct timespec *ts) | ||
342 | { | 349 | { |
343 | if (kt.tv64) { | 350 | if (kt.tv64) { |
344 | *ts = ktime_to_timespec(kt); | 351 | *ts = ktime_to_timespec(kt); |
@@ -366,7 +373,15 @@ extern void ktime_get_ts(struct timespec *ts); | |||
366 | static inline ktime_t ns_to_ktime(u64 ns) | 373 | static inline ktime_t ns_to_ktime(u64 ns) |
367 | { | 374 | { |
368 | static const ktime_t ktime_zero = { .tv64 = 0 }; | 375 | static const ktime_t ktime_zero = { .tv64 = 0 }; |
376 | |||
369 | return ktime_add_ns(ktime_zero, ns); | 377 | return ktime_add_ns(ktime_zero, ns); |
370 | } | 378 | } |
371 | 379 | ||
380 | static inline ktime_t ms_to_ktime(u64 ms) | ||
381 | { | ||
382 | static const ktime_t ktime_zero = { .tv64 = 0 }; | ||
383 | |||
384 | return ktime_add_ms(ktime_zero, ms); | ||
385 | } | ||
386 | |||
372 | #endif | 387 | #endif |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 8db53cfaccdb..a63d83ebd151 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -125,6 +125,7 @@ static inline bool is_error_page(struct page *page) | |||
125 | #define KVM_REQ_MCLOCK_INPROGRESS 19 | 125 | #define KVM_REQ_MCLOCK_INPROGRESS 19 |
126 | #define KVM_REQ_EPR_EXIT 20 | 126 | #define KVM_REQ_EPR_EXIT 20 |
127 | #define KVM_REQ_SCAN_IOAPIC 21 | 127 | #define KVM_REQ_SCAN_IOAPIC 21 |
128 | #define KVM_REQ_GLOBAL_CLOCK_UPDATE 22 | ||
128 | 129 | ||
129 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 | 130 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 |
130 | #define KVM_IRQFD_RESAMPLE_IRQ_SOURCE_ID 1 | 131 | #define KVM_IRQFD_RESAMPLE_IRQ_SOURCE_ID 1 |
@@ -145,7 +146,8 @@ struct kvm_io_range { | |||
145 | #define NR_IOBUS_DEVS 1000 | 146 | #define NR_IOBUS_DEVS 1000 |
146 | 147 | ||
147 | struct kvm_io_bus { | 148 | struct kvm_io_bus { |
148 | int dev_count; | 149 | int dev_count; |
150 | int ioeventfd_count; | ||
149 | struct kvm_io_range range[]; | 151 | struct kvm_io_range range[]; |
150 | }; | 152 | }; |
151 | 153 | ||
diff --git a/include/linux/lcd.h b/include/linux/lcd.h index e00c3b0ebc6b..504f6246f38f 100644 --- a/include/linux/lcd.h +++ b/include/linux/lcd.h | |||
@@ -112,7 +112,12 @@ static inline void lcd_set_power(struct lcd_device *ld, int power) | |||
112 | 112 | ||
113 | extern struct lcd_device *lcd_device_register(const char *name, | 113 | extern struct lcd_device *lcd_device_register(const char *name, |
114 | struct device *parent, void *devdata, struct lcd_ops *ops); | 114 | struct device *parent, void *devdata, struct lcd_ops *ops); |
115 | extern struct lcd_device *devm_lcd_device_register(struct device *dev, | ||
116 | const char *name, struct device *parent, | ||
117 | void *devdata, struct lcd_ops *ops); | ||
115 | extern void lcd_device_unregister(struct lcd_device *ld); | 118 | extern void lcd_device_unregister(struct lcd_device *ld); |
119 | extern void devm_lcd_device_unregister(struct device *dev, | ||
120 | struct lcd_device *ld); | ||
116 | 121 | ||
117 | #define to_lcd_device(obj) container_of(obj, struct lcd_device, dev) | 122 | #define to_lcd_device(obj) container_of(obj, struct lcd_device, dev) |
118 | 123 | ||
diff --git a/include/linux/libata.h b/include/linux/libata.h index eae7a053dc51..4ea55bb45deb 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -399,6 +399,7 @@ enum { | |||
399 | ATA_HORKAGE_BROKEN_FPDMA_AA = (1 << 15), /* skip AA */ | 399 | ATA_HORKAGE_BROKEN_FPDMA_AA = (1 << 15), /* skip AA */ |
400 | ATA_HORKAGE_DUMP_ID = (1 << 16), /* dump IDENTIFY data */ | 400 | ATA_HORKAGE_DUMP_ID = (1 << 16), /* dump IDENTIFY data */ |
401 | ATA_HORKAGE_MAX_SEC_LBA48 = (1 << 17), /* Set max sects to 65535 */ | 401 | ATA_HORKAGE_MAX_SEC_LBA48 = (1 << 17), /* Set max sects to 65535 */ |
402 | ATA_HORKAGE_ATAPI_DMADIR = (1 << 18), /* device requires dmadir */ | ||
402 | 403 | ||
403 | /* DMA mask for user DMA control: User visible values; DO NOT | 404 | /* DMA mask for user DMA control: User visible values; DO NOT |
404 | renumber */ | 405 | renumber */ |
@@ -746,6 +747,7 @@ struct ata_port { | |||
746 | /* Flags that change dynamically, protected by ap->lock */ | 747 | /* Flags that change dynamically, protected by ap->lock */ |
747 | unsigned int pflags; /* ATA_PFLAG_xxx */ | 748 | unsigned int pflags; /* ATA_PFLAG_xxx */ |
748 | unsigned int print_id; /* user visible unique port ID */ | 749 | unsigned int print_id; /* user visible unique port ID */ |
750 | unsigned int local_port_no; /* host local port num */ | ||
749 | unsigned int port_no; /* 0 based port no. inside the host */ | 751 | unsigned int port_no; /* 0 based port no. inside the host */ |
750 | 752 | ||
751 | #ifdef CONFIG_ATA_SFF | 753 | #ifdef CONFIG_ATA_SFF |
@@ -908,6 +910,9 @@ struct ata_port_operations { | |||
908 | ssize_t (*sw_activity_show)(struct ata_device *dev, char *buf); | 910 | ssize_t (*sw_activity_show)(struct ata_device *dev, char *buf); |
909 | ssize_t (*sw_activity_store)(struct ata_device *dev, | 911 | ssize_t (*sw_activity_store)(struct ata_device *dev, |
910 | enum sw_activity val); | 912 | enum sw_activity val); |
913 | ssize_t (*transmit_led_message)(struct ata_port *ap, u32 state, | ||
914 | ssize_t size); | ||
915 | |||
911 | /* | 916 | /* |
912 | * Obsolete | 917 | * Obsolete |
913 | */ | 918 | */ |
diff --git a/include/linux/list.h b/include/linux/list.h index b83e5657365a..f4d8a2f12a33 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -381,17 +381,6 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
381 | for (pos = (head)->next; pos != (head); pos = pos->next) | 381 | for (pos = (head)->next; pos != (head); pos = pos->next) |
382 | 382 | ||
383 | /** | 383 | /** |
384 | * __list_for_each - iterate over a list | ||
385 | * @pos: the &struct list_head to use as a loop cursor. | ||
386 | * @head: the head for your list. | ||
387 | * | ||
388 | * This variant doesn't differ from list_for_each() any more. | ||
389 | * We don't do prefetching in either case. | ||
390 | */ | ||
391 | #define __list_for_each(pos, head) \ | ||
392 | for (pos = (head)->next; pos != (head); pos = pos->next) | ||
393 | |||
394 | /** | ||
395 | * list_for_each_prev - iterate over a list backwards | 384 | * list_for_each_prev - iterate over a list backwards |
396 | * @pos: the &struct list_head to use as a loop cursor. | 385 | * @pos: the &struct list_head to use as a loop cursor. |
397 | * @head: the head for your list. | 386 | * @head: the head for your list. |
diff --git a/include/linux/llist.h b/include/linux/llist.h index a5199f6d0e82..cdaa7f023899 100644 --- a/include/linux/llist.h +++ b/include/linux/llist.h | |||
@@ -142,6 +142,9 @@ static inline struct llist_node *llist_next(struct llist_node *node) | |||
142 | return node->next; | 142 | return node->next; |
143 | } | 143 | } |
144 | 144 | ||
145 | extern bool llist_add_batch(struct llist_node *new_first, | ||
146 | struct llist_node *new_last, | ||
147 | struct llist_head *head); | ||
145 | /** | 148 | /** |
146 | * llist_add - add a new entry | 149 | * llist_add - add a new entry |
147 | * @new: new entry to be added | 150 | * @new: new entry to be added |
@@ -151,18 +154,7 @@ static inline struct llist_node *llist_next(struct llist_node *node) | |||
151 | */ | 154 | */ |
152 | static inline bool llist_add(struct llist_node *new, struct llist_head *head) | 155 | static inline bool llist_add(struct llist_node *new, struct llist_head *head) |
153 | { | 156 | { |
154 | struct llist_node *entry, *old_entry; | 157 | return llist_add_batch(new, new, head); |
155 | |||
156 | entry = head->first; | ||
157 | for (;;) { | ||
158 | old_entry = entry; | ||
159 | new->next = entry; | ||
160 | entry = cmpxchg(&head->first, old_entry, new); | ||
161 | if (entry == old_entry) | ||
162 | break; | ||
163 | } | ||
164 | |||
165 | return old_entry == NULL; | ||
166 | } | 158 | } |
167 | 159 | ||
168 | /** | 160 | /** |
@@ -178,9 +170,6 @@ static inline struct llist_node *llist_del_all(struct llist_head *head) | |||
178 | return xchg(&head->first, NULL); | 170 | return xchg(&head->first, NULL); |
179 | } | 171 | } |
180 | 172 | ||
181 | extern bool llist_add_batch(struct llist_node *new_first, | ||
182 | struct llist_node *new_last, | ||
183 | struct llist_head *head); | ||
184 | extern struct llist_node *llist_del_first(struct llist_head *head); | 173 | extern struct llist_node *llist_del_first(struct llist_head *head); |
185 | 174 | ||
186 | #endif /* LLIST_H */ | 175 | #endif /* LLIST_H */ |
diff --git a/include/linux/loop.h b/include/linux/loop.h deleted file mode 100644 index 460b60fa7adf..000000000000 --- a/include/linux/loop.h +++ /dev/null | |||
@@ -1,85 +0,0 @@ | |||
1 | /* | ||
2 | * include/linux/loop.h | ||
3 | * | ||
4 | * Written by Theodore Ts'o, 3/29/93. | ||
5 | * | ||
6 | * Copyright 1993 by Theodore Ts'o. Redistribution of this file is | ||
7 | * permitted under the GNU General Public License. | ||
8 | */ | ||
9 | #ifndef _LINUX_LOOP_H | ||
10 | #define _LINUX_LOOP_H | ||
11 | |||
12 | #include <linux/bio.h> | ||
13 | #include <linux/blkdev.h> | ||
14 | #include <linux/spinlock.h> | ||
15 | #include <linux/mutex.h> | ||
16 | #include <uapi/linux/loop.h> | ||
17 | |||
18 | /* Possible states of device */ | ||
19 | enum { | ||
20 | Lo_unbound, | ||
21 | Lo_bound, | ||
22 | Lo_rundown, | ||
23 | }; | ||
24 | |||
25 | struct loop_func_table; | ||
26 | |||
27 | struct loop_device { | ||
28 | int lo_number; | ||
29 | int lo_refcnt; | ||
30 | loff_t lo_offset; | ||
31 | loff_t lo_sizelimit; | ||
32 | int lo_flags; | ||
33 | int (*transfer)(struct loop_device *, int cmd, | ||
34 | struct page *raw_page, unsigned raw_off, | ||
35 | struct page *loop_page, unsigned loop_off, | ||
36 | int size, sector_t real_block); | ||
37 | char lo_file_name[LO_NAME_SIZE]; | ||
38 | char lo_crypt_name[LO_NAME_SIZE]; | ||
39 | char lo_encrypt_key[LO_KEY_SIZE]; | ||
40 | int lo_encrypt_key_size; | ||
41 | struct loop_func_table *lo_encryption; | ||
42 | __u32 lo_init[2]; | ||
43 | kuid_t lo_key_owner; /* Who set the key */ | ||
44 | int (*ioctl)(struct loop_device *, int cmd, | ||
45 | unsigned long arg); | ||
46 | |||
47 | struct file * lo_backing_file; | ||
48 | struct block_device *lo_device; | ||
49 | unsigned lo_blocksize; | ||
50 | void *key_data; | ||
51 | |||
52 | gfp_t old_gfp_mask; | ||
53 | |||
54 | spinlock_t lo_lock; | ||
55 | struct bio_list lo_bio_list; | ||
56 | unsigned int lo_bio_count; | ||
57 | int lo_state; | ||
58 | struct mutex lo_ctl_mutex; | ||
59 | struct task_struct *lo_thread; | ||
60 | wait_queue_head_t lo_event; | ||
61 | /* wait queue for incoming requests */ | ||
62 | wait_queue_head_t lo_req_wait; | ||
63 | |||
64 | struct request_queue *lo_queue; | ||
65 | struct gendisk *lo_disk; | ||
66 | }; | ||
67 | |||
68 | /* Support for loadable transfer modules */ | ||
69 | struct loop_func_table { | ||
70 | int number; /* filter type */ | ||
71 | int (*transfer)(struct loop_device *lo, int cmd, | ||
72 | struct page *raw_page, unsigned raw_off, | ||
73 | struct page *loop_page, unsigned loop_off, | ||
74 | int size, sector_t real_block); | ||
75 | int (*init)(struct loop_device *, const struct loop_info64 *); | ||
76 | /* release is called from loop_unregister_transfer or clr_fd */ | ||
77 | int (*release)(struct loop_device *); | ||
78 | int (*ioctl)(struct loop_device *, int cmd, unsigned long arg); | ||
79 | struct module *owner; | ||
80 | }; | ||
81 | |||
82 | int loop_register_transfer(struct loop_func_table *funcs); | ||
83 | int loop_unregister_transfer(int number); | ||
84 | |||
85 | #endif | ||
diff --git a/include/linux/lz4.h b/include/linux/lz4.h new file mode 100644 index 000000000000..d21c13f10a64 --- /dev/null +++ b/include/linux/lz4.h | |||
@@ -0,0 +1,87 @@ | |||
1 | #ifndef __LZ4_H__ | ||
2 | #define __LZ4_H__ | ||
3 | /* | ||
4 | * LZ4 Kernel Interface | ||
5 | * | ||
6 | * Copyright (C) 2013, LG Electronics, Kyungsik Lee <kyungsik.lee@lge.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 | #define LZ4_MEM_COMPRESS (4096 * sizeof(unsigned char *)) | ||
13 | #define LZ4HC_MEM_COMPRESS (65538 * sizeof(unsigned char *)) | ||
14 | |||
15 | /* | ||
16 | * lz4_compressbound() | ||
17 | * Provides the maximum size that LZ4 may output in a "worst case" scenario | ||
18 | * (input data not compressible) | ||
19 | */ | ||
20 | static inline size_t lz4_compressbound(size_t isize) | ||
21 | { | ||
22 | return isize + (isize / 255) + 16; | ||
23 | } | ||
24 | |||
25 | /* | ||
26 | * lz4_compress() | ||
27 | * src : source address of the original data | ||
28 | * src_len : size of the original data | ||
29 | * dst : output buffer address of the compressed data | ||
30 | * This requires 'dst' of size LZ4_COMPRESSBOUND. | ||
31 | * dst_len : is the output size, which is returned after compress done | ||
32 | * workmem : address of the working memory. | ||
33 | * This requires 'workmem' of size LZ4_MEM_COMPRESS. | ||
34 | * return : Success if return 0 | ||
35 | * Error if return (< 0) | ||
36 | * note : Destination buffer and workmem must be already allocated with | ||
37 | * the defined size. | ||
38 | */ | ||
39 | int lz4_compress(const unsigned char *src, size_t src_len, | ||
40 | unsigned char *dst, size_t *dst_len, void *wrkmem); | ||
41 | |||
42 | /* | ||
43 | * lz4hc_compress() | ||
44 | * src : source address of the original data | ||
45 | * src_len : size of the original data | ||
46 | * dst : output buffer address of the compressed data | ||
47 | * This requires 'dst' of size LZ4_COMPRESSBOUND. | ||
48 | * dst_len : is the output size, which is returned after compress done | ||
49 | * workmem : address of the working memory. | ||
50 | * This requires 'workmem' of size LZ4HC_MEM_COMPRESS. | ||
51 | * return : Success if return 0 | ||
52 | * Error if return (< 0) | ||
53 | * note : Destination buffer and workmem must be already allocated with | ||
54 | * the defined size. | ||
55 | */ | ||
56 | int lz4hc_compress(const unsigned char *src, size_t src_len, | ||
57 | unsigned char *dst, size_t *dst_len, void *wrkmem); | ||
58 | |||
59 | /* | ||
60 | * lz4_decompress() | ||
61 | * src : source address of the compressed data | ||
62 | * src_len : is the input size, whcih is returned after decompress done | ||
63 | * dest : output buffer address of the decompressed data | ||
64 | * actual_dest_len: is the size of uncompressed data, supposing it's known | ||
65 | * return : Success if return 0 | ||
66 | * Error if return (< 0) | ||
67 | * note : Destination buffer must be already allocated. | ||
68 | * slightly faster than lz4_decompress_unknownoutputsize() | ||
69 | */ | ||
70 | int lz4_decompress(const char *src, size_t *src_len, char *dest, | ||
71 | size_t actual_dest_len); | ||
72 | |||
73 | /* | ||
74 | * lz4_decompress_unknownoutputsize() | ||
75 | * src : source address of the compressed data | ||
76 | * src_len : is the input size, therefore the compressed size | ||
77 | * dest : output buffer address of the decompressed data | ||
78 | * dest_len: is the max size of the destination buffer, which is | ||
79 | * returned with actual size of decompressed data after | ||
80 | * decompress done | ||
81 | * return : Success if return 0 | ||
82 | * Error if return (< 0) | ||
83 | * note : Destination buffer must be already allocated. | ||
84 | */ | ||
85 | int lz4_decompress_unknownoutputsize(const char *src, size_t src_len, | ||
86 | char *dest, size_t *dest_len); | ||
87 | #endif | ||
diff --git a/include/linux/marvell_phy.h b/include/linux/marvell_phy.h index dd3c34ebca9a..8e9a029e093d 100644 --- a/include/linux/marvell_phy.h +++ b/include/linux/marvell_phy.h | |||
@@ -14,6 +14,8 @@ | |||
14 | #define MARVELL_PHY_ID_88E1149R 0x01410e50 | 14 | #define MARVELL_PHY_ID_88E1149R 0x01410e50 |
15 | #define MARVELL_PHY_ID_88E1240 0x01410e30 | 15 | #define MARVELL_PHY_ID_88E1240 0x01410e30 |
16 | #define MARVELL_PHY_ID_88E1318S 0x01410e90 | 16 | #define MARVELL_PHY_ID_88E1318S 0x01410e90 |
17 | #define MARVELL_PHY_ID_88E1116R 0x01410e40 | ||
18 | #define MARVELL_PHY_ID_88E1510 0x01410dd0 | ||
17 | 19 | ||
18 | /* struct phy_device dev_flags definitions */ | 20 | /* struct phy_device dev_flags definitions */ |
19 | #define MARVELL_PHY_M1145_FLAGS_RESISTANCE 0x00000001 | 21 | #define MARVELL_PHY_M1145_FLAGS_RESISTANCE 0x00000001 |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index d6183f06d8c1..7b4d9d79570b 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -77,7 +77,8 @@ extern void mem_cgroup_uncharge_cache_page(struct page *page); | |||
77 | 77 | ||
78 | bool __mem_cgroup_same_or_subtree(const struct mem_cgroup *root_memcg, | 78 | bool __mem_cgroup_same_or_subtree(const struct mem_cgroup *root_memcg, |
79 | struct mem_cgroup *memcg); | 79 | struct mem_cgroup *memcg); |
80 | int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *memcg); | 80 | bool task_in_mem_cgroup(struct task_struct *task, |
81 | const struct mem_cgroup *memcg); | ||
81 | 82 | ||
82 | extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); | 83 | extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); |
83 | extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); | 84 | extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); |
@@ -273,10 +274,10 @@ static inline bool mm_match_cgroup(struct mm_struct *mm, | |||
273 | return true; | 274 | return true; |
274 | } | 275 | } |
275 | 276 | ||
276 | static inline int task_in_mem_cgroup(struct task_struct *task, | 277 | static inline bool task_in_mem_cgroup(struct task_struct *task, |
277 | const struct mem_cgroup *memcg) | 278 | const struct mem_cgroup *memcg) |
278 | { | 279 | { |
279 | return 1; | 280 | return true; |
280 | } | 281 | } |
281 | 282 | ||
282 | static inline struct cgroup_subsys_state | 283 | static inline struct cgroup_subsys_state |
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 3e622c610925..dd38e62b84d2 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
@@ -234,6 +234,8 @@ static inline void unlock_memory_hotplug(void) {} | |||
234 | 234 | ||
235 | extern int is_mem_section_removable(unsigned long pfn, unsigned long nr_pages); | 235 | extern int is_mem_section_removable(unsigned long pfn, unsigned long nr_pages); |
236 | extern void try_offline_node(int nid); | 236 | extern void try_offline_node(int nid); |
237 | extern int offline_pages(unsigned long start_pfn, unsigned long nr_pages); | ||
238 | extern void remove_memory(int nid, u64 start, u64 size); | ||
237 | 239 | ||
238 | #else | 240 | #else |
239 | static inline int is_mem_section_removable(unsigned long pfn, | 241 | static inline int is_mem_section_removable(unsigned long pfn, |
@@ -243,15 +245,23 @@ static inline int is_mem_section_removable(unsigned long pfn, | |||
243 | } | 245 | } |
244 | 246 | ||
245 | static inline void try_offline_node(int nid) {} | 247 | static inline void try_offline_node(int nid) {} |
248 | |||
249 | static inline int offline_pages(unsigned long start_pfn, unsigned long nr_pages) | ||
250 | { | ||
251 | return -EINVAL; | ||
252 | } | ||
253 | |||
254 | static inline void remove_memory(int nid, u64 start, u64 size) {} | ||
246 | #endif /* CONFIG_MEMORY_HOTREMOVE */ | 255 | #endif /* CONFIG_MEMORY_HOTREMOVE */ |
247 | 256 | ||
257 | extern int walk_memory_range(unsigned long start_pfn, unsigned long end_pfn, | ||
258 | void *arg, int (*func)(struct memory_block *, void *)); | ||
248 | extern int mem_online_node(int nid); | 259 | extern int mem_online_node(int nid); |
249 | extern int add_memory(int nid, u64 start, u64 size); | 260 | extern int add_memory(int nid, u64 start, u64 size); |
250 | extern int arch_add_memory(int nid, u64 start, u64 size); | 261 | extern int arch_add_memory(int nid, u64 start, u64 size); |
251 | extern int offline_pages(unsigned long start_pfn, unsigned long nr_pages); | 262 | extern int offline_pages(unsigned long start_pfn, unsigned long nr_pages); |
252 | extern int offline_memory_block(struct memory_block *mem); | ||
253 | extern bool is_memblock_offlined(struct memory_block *mem); | 263 | extern bool is_memblock_offlined(struct memory_block *mem); |
254 | extern int remove_memory(int nid, u64 start, u64 size); | 264 | extern void remove_memory(int nid, u64 start, u64 size); |
255 | extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn, | 265 | extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn, |
256 | int nr_pages); | 266 | int nr_pages); |
257 | extern void sparse_remove_one_section(struct zone *zone, struct mem_section *ms); | 267 | extern void sparse_remove_one_section(struct zone *zone, struct mem_section *ms); |
diff --git a/include/linux/mfd/88pm80x.h b/include/linux/mfd/88pm80x.h index e94537befabd..97cb283cc8e1 100644 --- a/include/linux/mfd/88pm80x.h +++ b/include/linux/mfd/88pm80x.h | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/regmap.h> | 17 | #include <linux/regmap.h> |
18 | #include <linux/atomic.h> | 18 | #include <linux/atomic.h> |
19 | 19 | ||
20 | #define PM80X_VERSION_MASK (0xFF) /* 80X chip ID mask */ | ||
21 | enum { | 20 | enum { |
22 | CHIP_INVALID = 0, | 21 | CHIP_INVALID = 0, |
23 | CHIP_PM800, | 22 | CHIP_PM800, |
@@ -299,8 +298,7 @@ struct pm80x_chip { | |||
299 | struct regmap *regmap; | 298 | struct regmap *regmap; |
300 | struct regmap_irq_chip *regmap_irq_chip; | 299 | struct regmap_irq_chip *regmap_irq_chip; |
301 | struct regmap_irq_chip_data *irq_data; | 300 | struct regmap_irq_chip_data *irq_data; |
302 | unsigned char version; | 301 | int type; |
303 | int id; | ||
304 | int irq; | 302 | int irq; |
305 | int irq_mode; | 303 | int irq_mode; |
306 | unsigned long wu_flag; | 304 | unsigned long wu_flag; |
@@ -309,8 +307,14 @@ struct pm80x_chip { | |||
309 | 307 | ||
310 | struct pm80x_platform_data { | 308 | struct pm80x_platform_data { |
311 | struct pm80x_rtc_pdata *rtc; | 309 | struct pm80x_rtc_pdata *rtc; |
312 | unsigned short power_page_addr; /* power page I2C address */ | 310 | /* |
313 | unsigned short gpadc_page_addr; /* gpadc page I2C address */ | 311 | * For the regulator not defined, set regulators[not_defined] to be |
312 | * NULL. num_regulators are the number of regulators supposed to be | ||
313 | * initialized. If all regulators are not defined, set num_regulators | ||
314 | * to be 0. | ||
315 | */ | ||
316 | struct regulator_init_data *regulators[PM800_ID_RG_MAX]; | ||
317 | unsigned int num_regulators; | ||
314 | int irq_mode; /* Clear interrupt by read/write(0/1) */ | 318 | int irq_mode; /* Clear interrupt by read/write(0/1) */ |
315 | int batt_det; /* enable/disable */ | 319 | int batt_det; /* enable/disable */ |
316 | int (*plat_config)(struct pm80x_chip *chip, | 320 | int (*plat_config)(struct pm80x_chip *chip, |
@@ -363,7 +367,6 @@ static inline int pm80x_dev_resume(struct device *dev) | |||
363 | } | 367 | } |
364 | #endif | 368 | #endif |
365 | 369 | ||
366 | extern int pm80x_init(struct i2c_client *client, | 370 | extern int pm80x_init(struct i2c_client *client); |
367 | const struct i2c_device_id *id); | ||
368 | extern int pm80x_deinit(void); | 371 | extern int pm80x_deinit(void); |
369 | #endif /* __LINUX_MFD_88PM80X_H */ | 372 | #endif /* __LINUX_MFD_88PM80X_H */ |
diff --git a/include/linux/mfd/abx500/ab8500-sysctrl.h b/include/linux/mfd/abx500/ab8500-sysctrl.h index 990bc93f46e1..adba89d9c660 100644 --- a/include/linux/mfd/abx500/ab8500-sysctrl.h +++ b/include/linux/mfd/abx500/ab8500-sysctrl.h | |||
@@ -278,8 +278,8 @@ struct ab8500_sysctrl_platform_data { | |||
278 | 278 | ||
279 | #define AB9540_SYSCLK12CONFCTRL_PLL26TO38ENA BIT(0) | 279 | #define AB9540_SYSCLK12CONFCTRL_PLL26TO38ENA BIT(0) |
280 | #define AB9540_SYSCLK12CONFCTRL_SYSCLK12USBMUXSEL BIT(1) | 280 | #define AB9540_SYSCLK12CONFCTRL_SYSCLK12USBMUXSEL BIT(1) |
281 | #define AB9540_SYSCLK12CONFCTRL_INT384MHZMUXSEL_MASK 0x0C | 281 | #define AB9540_SYSCLK12CONFCTRL_INT384MHZMUXSEL0 BIT(2) |
282 | #define AB9540_SYSCLK12CONFCTRL_INT384MHZMUXSEL_SHIFT 2 | 282 | #define AB9540_SYSCLK12CONFCTRL_INT384MHZMUXSEL1 BIT(3) |
283 | #define AB9540_SYSCLK12CONFCTRL_SYSCLK12BUFMUX BIT(4) | 283 | #define AB9540_SYSCLK12CONFCTRL_SYSCLK12BUFMUX BIT(4) |
284 | #define AB9540_SYSCLK12CONFCTRL_SYSCLK12PLLMUX BIT(5) | 284 | #define AB9540_SYSCLK12CONFCTRL_SYSCLK12PLLMUX BIT(5) |
285 | #define AB9540_SYSCLK12CONFCTRL_SYSCLK2MUXVALID BIT(6) | 285 | #define AB9540_SYSCLK12CONFCTRL_SYSCLK2MUXVALID BIT(6) |
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h index 0390d5943ed6..f4acd898dac9 100644 --- a/include/linux/mfd/abx500/ab8500.h +++ b/include/linux/mfd/abx500/ab8500.h | |||
@@ -291,6 +291,8 @@ enum ab8500_version { | |||
291 | #define AB8540_INT_FSYNC2R 213 | 291 | #define AB8540_INT_FSYNC2R 213 |
292 | #define AB8540_INT_BITCLK2F 214 | 292 | #define AB8540_INT_BITCLK2F 214 |
293 | #define AB8540_INT_BITCLK2R 215 | 293 | #define AB8540_INT_BITCLK2R 215 |
294 | /* ab8540_irq_regoffset[27] -> IT[Source|Latch|Mask]33 */ | ||
295 | #define AB8540_INT_RTC_1S 216 | ||
294 | 296 | ||
295 | /* | 297 | /* |
296 | * AB8500_AB9540_NR_IRQS is used when configuring the IRQ numbers for the | 298 | * AB8500_AB9540_NR_IRQS is used when configuring the IRQ numbers for the |
diff --git a/include/linux/mfd/arizona/core.h b/include/linux/mfd/arizona/core.h index cc281368dc55..5cf8b91ce996 100644 --- a/include/linux/mfd/arizona/core.h +++ b/include/linux/mfd/arizona/core.h | |||
@@ -23,6 +23,7 @@ | |||
23 | enum arizona_type { | 23 | enum arizona_type { |
24 | WM5102 = 1, | 24 | WM5102 = 1, |
25 | WM5110 = 2, | 25 | WM5110 = 2, |
26 | WM8997 = 3, | ||
26 | }; | 27 | }; |
27 | 28 | ||
28 | #define ARIZONA_IRQ_GP1 0 | 29 | #define ARIZONA_IRQ_GP1 0 |
@@ -95,6 +96,8 @@ struct arizona { | |||
95 | 96 | ||
96 | struct arizona_pdata pdata; | 97 | struct arizona_pdata pdata; |
97 | 98 | ||
99 | unsigned int external_dcvdd:1; | ||
100 | |||
98 | int irq; | 101 | int irq; |
99 | struct irq_domain *virq; | 102 | struct irq_domain *virq; |
100 | struct regmap_irq_chip_data *aod_irq_chip; | 103 | struct regmap_irq_chip_data *aod_irq_chip; |
@@ -119,5 +122,6 @@ int arizona_set_irq_wake(struct arizona *arizona, int irq, int on); | |||
119 | 122 | ||
120 | int wm5102_patch(struct arizona *arizona); | 123 | int wm5102_patch(struct arizona *arizona); |
121 | int wm5110_patch(struct arizona *arizona); | 124 | int wm5110_patch(struct arizona *arizona); |
125 | int wm8997_patch(struct arizona *arizona); | ||
122 | 126 | ||
123 | #endif | 127 | #endif |
diff --git a/include/linux/mfd/arizona/pdata.h b/include/linux/mfd/arizona/pdata.h index 80dead1f7100..12a5c135c746 100644 --- a/include/linux/mfd/arizona/pdata.h +++ b/include/linux/mfd/arizona/pdata.h | |||
@@ -77,7 +77,7 @@ struct arizona_micbias { | |||
77 | int mV; /** Regulated voltage */ | 77 | int mV; /** Regulated voltage */ |
78 | unsigned int ext_cap:1; /** External capacitor fitted */ | 78 | unsigned int ext_cap:1; /** External capacitor fitted */ |
79 | unsigned int discharge:1; /** Actively discharge */ | 79 | unsigned int discharge:1; /** Actively discharge */ |
80 | unsigned int fast_start:1; /** Enable aggressive startup ramp rate */ | 80 | unsigned int soft_start:1; /** Disable aggressive startup ramp rate */ |
81 | unsigned int bypass:1; /** Use bypass mode */ | 81 | unsigned int bypass:1; /** Use bypass mode */ |
82 | }; | 82 | }; |
83 | 83 | ||
diff --git a/include/linux/mfd/arizona/registers.h b/include/linux/mfd/arizona/registers.h index 715b6ba3d52a..4706d3d46e56 100644 --- a/include/linux/mfd/arizona/registers.h +++ b/include/linux/mfd/arizona/registers.h | |||
@@ -215,6 +215,9 @@ | |||
215 | #define ARIZONA_DAC_DIGITAL_VOLUME_6R 0x43D | 215 | #define ARIZONA_DAC_DIGITAL_VOLUME_6R 0x43D |
216 | #define ARIZONA_DAC_VOLUME_LIMIT_6R 0x43E | 216 | #define ARIZONA_DAC_VOLUME_LIMIT_6R 0x43E |
217 | #define ARIZONA_NOISE_GATE_SELECT_6R 0x43F | 217 | #define ARIZONA_NOISE_GATE_SELECT_6R 0x43F |
218 | #define ARIZONA_DRE_ENABLE 0x440 | ||
219 | #define ARIZONA_DRE_CONTROL_2 0x442 | ||
220 | #define ARIZONA_DRE_CONTROL_3 0x443 | ||
218 | #define ARIZONA_DAC_AEC_CONTROL_1 0x450 | 221 | #define ARIZONA_DAC_AEC_CONTROL_1 0x450 |
219 | #define ARIZONA_NOISE_GATE_CONTROL 0x458 | 222 | #define ARIZONA_NOISE_GATE_CONTROL 0x458 |
220 | #define ARIZONA_PDM_SPK1_CTRL_1 0x490 | 223 | #define ARIZONA_PDM_SPK1_CTRL_1 0x490 |
@@ -1002,6 +1005,7 @@ | |||
1002 | #define ARIZONA_DSP2_CLOCKING_1 0x1201 | 1005 | #define ARIZONA_DSP2_CLOCKING_1 0x1201 |
1003 | #define ARIZONA_DSP2_STATUS_1 0x1204 | 1006 | #define ARIZONA_DSP2_STATUS_1 0x1204 |
1004 | #define ARIZONA_DSP2_STATUS_2 0x1205 | 1007 | #define ARIZONA_DSP2_STATUS_2 0x1205 |
1008 | #define ARIZONA_DSP2_STATUS_3 0x1206 | ||
1005 | #define ARIZONA_DSP2_SCRATCH_0 0x1240 | 1009 | #define ARIZONA_DSP2_SCRATCH_0 0x1240 |
1006 | #define ARIZONA_DSP2_SCRATCH_1 0x1241 | 1010 | #define ARIZONA_DSP2_SCRATCH_1 0x1241 |
1007 | #define ARIZONA_DSP2_SCRATCH_2 0x1242 | 1011 | #define ARIZONA_DSP2_SCRATCH_2 0x1242 |
@@ -1010,6 +1014,7 @@ | |||
1010 | #define ARIZONA_DSP3_CLOCKING_1 0x1301 | 1014 | #define ARIZONA_DSP3_CLOCKING_1 0x1301 |
1011 | #define ARIZONA_DSP3_STATUS_1 0x1304 | 1015 | #define ARIZONA_DSP3_STATUS_1 0x1304 |
1012 | #define ARIZONA_DSP3_STATUS_2 0x1305 | 1016 | #define ARIZONA_DSP3_STATUS_2 0x1305 |
1017 | #define ARIZONA_DSP3_STATUS_3 0x1306 | ||
1013 | #define ARIZONA_DSP3_SCRATCH_0 0x1340 | 1018 | #define ARIZONA_DSP3_SCRATCH_0 0x1340 |
1014 | #define ARIZONA_DSP3_SCRATCH_1 0x1341 | 1019 | #define ARIZONA_DSP3_SCRATCH_1 0x1341 |
1015 | #define ARIZONA_DSP3_SCRATCH_2 0x1342 | 1020 | #define ARIZONA_DSP3_SCRATCH_2 0x1342 |
@@ -1018,6 +1023,7 @@ | |||
1018 | #define ARIZONA_DSP4_CLOCKING_1 0x1401 | 1023 | #define ARIZONA_DSP4_CLOCKING_1 0x1401 |
1019 | #define ARIZONA_DSP4_STATUS_1 0x1404 | 1024 | #define ARIZONA_DSP4_STATUS_1 0x1404 |
1020 | #define ARIZONA_DSP4_STATUS_2 0x1405 | 1025 | #define ARIZONA_DSP4_STATUS_2 0x1405 |
1026 | #define ARIZONA_DSP4_STATUS_3 0x1406 | ||
1021 | #define ARIZONA_DSP4_SCRATCH_0 0x1440 | 1027 | #define ARIZONA_DSP4_SCRATCH_0 0x1440 |
1022 | #define ARIZONA_DSP4_SCRATCH_1 0x1441 | 1028 | #define ARIZONA_DSP4_SCRATCH_1 0x1441 |
1023 | #define ARIZONA_DSP4_SCRATCH_2 0x1442 | 1029 | #define ARIZONA_DSP4_SCRATCH_2 0x1442 |
@@ -3130,6 +3136,47 @@ | |||
3130 | #define ARIZONA_OUT6R_NGATE_SRC_WIDTH 12 /* OUT6R_NGATE_SRC - [11:0] */ | 3136 | #define ARIZONA_OUT6R_NGATE_SRC_WIDTH 12 /* OUT6R_NGATE_SRC - [11:0] */ |
3131 | 3137 | ||
3132 | /* | 3138 | /* |
3139 | * R1088 (0x440) - DRE Enable | ||
3140 | */ | ||
3141 | #define ARIZONA_DRE3L_ENA 0x0010 /* DRE3L_ENA */ | ||
3142 | #define ARIZONA_DRE3L_ENA_MASK 0x0010 /* DRE3L_ENA */ | ||
3143 | #define ARIZONA_DRE3L_ENA_SHIFT 4 /* DRE3L_ENA */ | ||
3144 | #define ARIZONA_DRE3L_ENA_WIDTH 1 /* DRE3L_ENA */ | ||
3145 | #define ARIZONA_DRE2R_ENA 0x0008 /* DRE2R_ENA */ | ||
3146 | #define ARIZONA_DRE2R_ENA_MASK 0x0008 /* DRE2R_ENA */ | ||
3147 | #define ARIZONA_DRE2R_ENA_SHIFT 3 /* DRE2R_ENA */ | ||
3148 | #define ARIZONA_DRE2R_ENA_WIDTH 1 /* DRE2R_ENA */ | ||
3149 | #define ARIZONA_DRE2L_ENA 0x0004 /* DRE2L_ENA */ | ||
3150 | #define ARIZONA_DRE2L_ENA_MASK 0x0004 /* DRE2L_ENA */ | ||
3151 | #define ARIZONA_DRE2L_ENA_SHIFT 2 /* DRE2L_ENA */ | ||
3152 | #define ARIZONA_DRE2L_ENA_WIDTH 1 /* DRE2L_ENA */ | ||
3153 | #define ARIZONA_DRE1R_ENA 0x0002 /* DRE1R_ENA */ | ||
3154 | #define ARIZONA_DRE1R_ENA_MASK 0x0002 /* DRE1R_ENA */ | ||
3155 | #define ARIZONA_DRE1R_ENA_SHIFT 1 /* DRE1R_ENA */ | ||
3156 | #define ARIZONA_DRE1R_ENA_WIDTH 1 /* DRE1R_ENA */ | ||
3157 | #define ARIZONA_DRE1L_ENA 0x0001 /* DRE1L_ENA */ | ||
3158 | #define ARIZONA_DRE1L_ENA_MASK 0x0001 /* DRE1L_ENA */ | ||
3159 | #define ARIZONA_DRE1L_ENA_SHIFT 0 /* DRE1L_ENA */ | ||
3160 | #define ARIZONA_DRE1L_ENA_WIDTH 1 /* DRE1L_ENA */ | ||
3161 | |||
3162 | /* | ||
3163 | * R1090 (0x442) - DRE Control 2 | ||
3164 | */ | ||
3165 | #define ARIZONA_DRE_T_LOW_MASK 0x3F00 /* DRE_T_LOW - [13:8] */ | ||
3166 | #define ARIZONA_DRE_T_LOW_SHIFT 8 /* DRE_T_LOW - [13:8] */ | ||
3167 | #define ARIZONA_DRE_T_LOW_WIDTH 6 /* DRE_T_LOW - [13:8] */ | ||
3168 | |||
3169 | /* | ||
3170 | * R1091 (0x443) - DRE Control 3 | ||
3171 | */ | ||
3172 | #define ARIZONA_DRE_GAIN_SHIFT_MASK 0xC000 /* DRE_GAIN_SHIFT - [15:14] */ | ||
3173 | #define ARIZONA_DRE_GAIN_SHIFT_SHIFT 14 /* DRE_GAIN_SHIFT - [15:14] */ | ||
3174 | #define ARIZONA_DRE_GAIN_SHIFT_WIDTH 2 /* DRE_GAIN_SHIFT - [15:14] */ | ||
3175 | #define ARIZONA_DRE_LOW_LEVEL_ABS_MASK 0x000F /* LOW_LEVEL_ABS - [3:0] */ | ||
3176 | #define ARIZONA_DRE_LOW_LEVEL_ABS_SHIFT 0 /* LOW_LEVEL_ABS - [3:0] */ | ||
3177 | #define ARIZONA_DRE_LOW_LEVEL_ABS_WIDTH 4 /* LOW_LEVEL_ABS - [3:0] */ | ||
3178 | |||
3179 | /* | ||
3133 | * R1104 (0x450) - DAC AEC Control 1 | 3180 | * R1104 (0x450) - DAC AEC Control 1 |
3134 | */ | 3181 | */ |
3135 | #define ARIZONA_AEC_LOOPBACK_SRC_MASK 0x003C /* AEC_LOOPBACK_SRC - [5:2] */ | 3182 | #define ARIZONA_AEC_LOOPBACK_SRC_MASK 0x003C /* AEC_LOOPBACK_SRC - [5:2] */ |
diff --git a/include/linux/mfd/davinci_voicecodec.h b/include/linux/mfd/davinci_voicecodec.h index 0ab61320ffa8..13a1ee95a233 100644 --- a/include/linux/mfd/davinci_voicecodec.h +++ b/include/linux/mfd/davinci_voicecodec.h | |||
@@ -26,8 +26,9 @@ | |||
26 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
27 | #include <linux/platform_device.h> | 27 | #include <linux/platform_device.h> |
28 | #include <linux/mfd/core.h> | 28 | #include <linux/mfd/core.h> |
29 | #include <linux/platform_data/edma.h> | ||
29 | 30 | ||
30 | #include <mach/edma.h> | 31 | #include <mach/hardware.h> |
31 | 32 | ||
32 | /* | 33 | /* |
33 | * Register values. | 34 | * Register values. |
@@ -112,8 +113,6 @@ struct davinci_vc { | |||
112 | 113 | ||
113 | /* Memory resources */ | 114 | /* Memory resources */ |
114 | void __iomem *base; | 115 | void __iomem *base; |
115 | resource_size_t pbase; | ||
116 | size_t base_size; | ||
117 | 116 | ||
118 | /* MFD cells */ | 117 | /* MFD cells */ |
119 | struct mfd_cell cells[DAVINCI_VC_CELLS]; | 118 | struct mfd_cell cells[DAVINCI_VC_CELLS]; |
diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h index 689e6a0d9c99..ca0790fba2f5 100644 --- a/include/linux/mfd/dbx500-prcmu.h +++ b/include/linux/mfd/dbx500-prcmu.h | |||
@@ -134,6 +134,11 @@ enum prcmu_clock { | |||
134 | PRCMU_SIACLK, | 134 | PRCMU_SIACLK, |
135 | PRCMU_SVACLK, | 135 | PRCMU_SVACLK, |
136 | PRCMU_ACLK, | 136 | PRCMU_ACLK, |
137 | PRCMU_HVACLK, /* Ux540 only */ | ||
138 | PRCMU_G1CLK, /* Ux540 only */ | ||
139 | PRCMU_SDMMCHCLK, | ||
140 | PRCMU_CAMCLK, | ||
141 | PRCMU_BML8580CLK, | ||
137 | PRCMU_NUM_REG_CLOCKS, | 142 | PRCMU_NUM_REG_CLOCKS, |
138 | PRCMU_SYSCLK = PRCMU_NUM_REG_CLOCKS, | 143 | PRCMU_SYSCLK = PRCMU_NUM_REG_CLOCKS, |
139 | PRCMU_CDCLK, | 144 | PRCMU_CDCLK, |
@@ -148,6 +153,13 @@ enum prcmu_clock { | |||
148 | PRCMU_DSI0ESCCLK, | 153 | PRCMU_DSI0ESCCLK, |
149 | PRCMU_DSI1ESCCLK, | 154 | PRCMU_DSI1ESCCLK, |
150 | PRCMU_DSI2ESCCLK, | 155 | PRCMU_DSI2ESCCLK, |
156 | /* LCD DSI PLL - Ux540 only */ | ||
157 | PRCMU_PLLDSI_LCD, | ||
158 | PRCMU_DSI0CLK_LCD, | ||
159 | PRCMU_DSI1CLK_LCD, | ||
160 | PRCMU_DSI0ESCCLK_LCD, | ||
161 | PRCMU_DSI1ESCCLK_LCD, | ||
162 | PRCMU_DSI2ESCCLK_LCD, | ||
151 | }; | 163 | }; |
152 | 164 | ||
153 | /** | 165 | /** |
diff --git a/include/linux/mfd/kempld.h b/include/linux/mfd/kempld.h new file mode 100644 index 000000000000..b911ef3add03 --- /dev/null +++ b/include/linux/mfd/kempld.h | |||
@@ -0,0 +1,125 @@ | |||
1 | /* | ||
2 | * Kontron PLD driver definitions | ||
3 | * | ||
4 | * Copyright (c) 2010-2012 Kontron Europe GmbH | ||
5 | * Author: Michael Brunner <michael.brunner@kontron.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License 2 as published | ||
9 | * by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #ifndef _LINUX_MFD_KEMPLD_H_ | ||
13 | #define _LINUX_MFD_KEMPLD_H_ | ||
14 | |||
15 | /* kempld register definitions */ | ||
16 | #define KEMPLD_IOINDEX 0xa80 | ||
17 | #define KEMPLD_IODATA 0xa81 | ||
18 | #define KEMPLD_MUTEX_KEY 0x80 | ||
19 | #define KEMPLD_VERSION 0x00 | ||
20 | #define KEMPLD_VERSION_LSB 0x00 | ||
21 | #define KEMPLD_VERSION_MSB 0x01 | ||
22 | #define KEMPLD_VERSION_GET_MINOR(x) (x & 0x1f) | ||
23 | #define KEMPLD_VERSION_GET_MAJOR(x) ((x >> 5) & 0x1f) | ||
24 | #define KEMPLD_VERSION_GET_NUMBER(x) ((x >> 10) & 0xf) | ||
25 | #define KEMPLD_VERSION_GET_TYPE(x) ((x >> 14) & 0x3) | ||
26 | #define KEMPLD_BUILDNR 0x02 | ||
27 | #define KEMPLD_BUILDNR_LSB 0x02 | ||
28 | #define KEMPLD_BUILDNR_MSB 0x03 | ||
29 | #define KEMPLD_FEATURE 0x04 | ||
30 | #define KEMPLD_FEATURE_LSB 0x04 | ||
31 | #define KEMPLD_FEATURE_MSB 0x05 | ||
32 | #define KEMPLD_FEATURE_BIT_I2C (1 << 0) | ||
33 | #define KEMPLD_FEATURE_BIT_WATCHDOG (1 << 1) | ||
34 | #define KEMPLD_FEATURE_BIT_GPIO (1 << 2) | ||
35 | #define KEMPLD_FEATURE_MASK_UART (7 << 3) | ||
36 | #define KEMPLD_FEATURE_BIT_NMI (1 << 8) | ||
37 | #define KEMPLD_FEATURE_BIT_SMI (1 << 9) | ||
38 | #define KEMPLD_FEATURE_BIT_SCI (1 << 10) | ||
39 | #define KEMPLD_SPEC 0x06 | ||
40 | #define KEMPLD_SPEC_GET_MINOR(x) (x & 0x0f) | ||
41 | #define KEMPLD_SPEC_GET_MAJOR(x) ((x >> 4) & 0x0f) | ||
42 | #define KEMPLD_IRQ_GPIO 0x35 | ||
43 | #define KEMPLD_IRQ_I2C 0x36 | ||
44 | #define KEMPLD_CFG 0x37 | ||
45 | #define KEMPLD_CFG_GPIO_I2C_MUX (1 << 0) | ||
46 | #define KEMPLD_CFG_BIOS_WP (1 << 7) | ||
47 | |||
48 | #define KEMPLD_CLK 33333333 | ||
49 | |||
50 | #define KEMPLD_TYPE_RELEASE 0x0 | ||
51 | #define KEMPLD_TYPE_DEBUG 0x1 | ||
52 | #define KEMPLD_TYPE_CUSTOM 0x2 | ||
53 | |||
54 | /** | ||
55 | * struct kempld_info - PLD device information structure | ||
56 | * @major: PLD major revision | ||
57 | * @minor: PLD minor revision | ||
58 | * @buildnr: PLD build number | ||
59 | * @number: PLD board specific index | ||
60 | * @type: PLD type | ||
61 | * @spec_major: PLD FW specification major revision | ||
62 | * @spec_minor: PLD FW specification minor revision | ||
63 | */ | ||
64 | struct kempld_info { | ||
65 | unsigned int major; | ||
66 | unsigned int minor; | ||
67 | unsigned int buildnr; | ||
68 | unsigned int number; | ||
69 | unsigned int type; | ||
70 | unsigned int spec_major; | ||
71 | unsigned int spec_minor; | ||
72 | }; | ||
73 | |||
74 | /** | ||
75 | * struct kempld_device_data - Internal representation of the PLD device | ||
76 | * @io_base: Pointer to the IO memory | ||
77 | * @io_index: Pointer to the IO index register | ||
78 | * @io_data: Pointer to the IO data register | ||
79 | * @pld_clock: PLD clock frequency | ||
80 | * @feature_mask: PLD feature mask | ||
81 | * @dev: Pointer to kernel device structure | ||
82 | * @info: KEMPLD info structure | ||
83 | * @lock: PLD mutex | ||
84 | */ | ||
85 | struct kempld_device_data { | ||
86 | void __iomem *io_base; | ||
87 | void __iomem *io_index; | ||
88 | void __iomem *io_data; | ||
89 | u32 pld_clock; | ||
90 | u32 feature_mask; | ||
91 | struct device *dev; | ||
92 | struct kempld_info info; | ||
93 | struct mutex lock; | ||
94 | }; | ||
95 | |||
96 | /** | ||
97 | * struct kempld_platform_data - PLD hardware configuration structure | ||
98 | * @pld_clock: PLD clock frequency | ||
99 | * @gpio_base GPIO base pin number | ||
100 | * @ioresource: IO addresses of the PLD | ||
101 | * @get_mutex: PLD specific get_mutex callback | ||
102 | * @release_mutex: PLD specific release_mutex callback | ||
103 | * @get_info: PLD specific get_info callback | ||
104 | * @register_cells: PLD specific register_cells callback | ||
105 | */ | ||
106 | struct kempld_platform_data { | ||
107 | u32 pld_clock; | ||
108 | int gpio_base; | ||
109 | struct resource *ioresource; | ||
110 | void (*get_hardware_mutex) (struct kempld_device_data *); | ||
111 | void (*release_hardware_mutex) (struct kempld_device_data *); | ||
112 | int (*get_info) (struct kempld_device_data *); | ||
113 | int (*register_cells) (struct kempld_device_data *); | ||
114 | }; | ||
115 | |||
116 | extern void kempld_get_mutex(struct kempld_device_data *pld); | ||
117 | extern void kempld_release_mutex(struct kempld_device_data *pld); | ||
118 | extern u8 kempld_read8(struct kempld_device_data *pld, u8 index); | ||
119 | extern void kempld_write8(struct kempld_device_data *pld, u8 index, u8 data); | ||
120 | extern u16 kempld_read16(struct kempld_device_data *pld, u8 index); | ||
121 | extern void kempld_write16(struct kempld_device_data *pld, u8 index, u16 data); | ||
122 | extern u32 kempld_read32(struct kempld_device_data *pld, u8 index); | ||
123 | extern void kempld_write32(struct kempld_device_data *pld, u8 index, u32 data); | ||
124 | |||
125 | #endif /* _LINUX_MFD_KEMPLD_H_ */ | ||
diff --git a/include/linux/mfd/max77693-private.h b/include/linux/mfd/max77693-private.h index 1aa4f13cdfa6..244fb0d51589 100644 --- a/include/linux/mfd/max77693-private.h +++ b/include/linux/mfd/max77693-private.h | |||
@@ -85,6 +85,19 @@ enum max77693_pmic_reg { | |||
85 | MAX77693_PMIC_REG_END, | 85 | MAX77693_PMIC_REG_END, |
86 | }; | 86 | }; |
87 | 87 | ||
88 | /* MAX77693 CHG_CNFG_00 register */ | ||
89 | #define CHG_CNFG_00_CHG_MASK 0x1 | ||
90 | #define CHG_CNFG_00_BUCK_MASK 0x4 | ||
91 | |||
92 | /* MAX77693 CHG_CNFG_09 Register */ | ||
93 | #define CHG_CNFG_09_CHGIN_ILIM_MASK 0x7F | ||
94 | |||
95 | /* MAX77693 CHG_CTRL Register */ | ||
96 | #define SAFEOUT_CTRL_SAFEOUT1_MASK 0x3 | ||
97 | #define SAFEOUT_CTRL_SAFEOUT2_MASK 0xC | ||
98 | #define SAFEOUT_CTRL_ENSAFEOUT1_MASK 0x40 | ||
99 | #define SAFEOUT_CTRL_ENSAFEOUT2_MASK 0x80 | ||
100 | |||
88 | /* Slave addr = 0x4A: MUIC */ | 101 | /* Slave addr = 0x4A: MUIC */ |
89 | enum max77693_muic_reg { | 102 | enum max77693_muic_reg { |
90 | MAX77693_MUIC_REG_ID = 0x00, | 103 | MAX77693_MUIC_REG_ID = 0x00, |
diff --git a/include/linux/mfd/max77693.h b/include/linux/mfd/max77693.h index 3109a6c5c948..676f0f388992 100644 --- a/include/linux/mfd/max77693.h +++ b/include/linux/mfd/max77693.h | |||
@@ -30,6 +30,20 @@ | |||
30 | #ifndef __LINUX_MFD_MAX77693_H | 30 | #ifndef __LINUX_MFD_MAX77693_H |
31 | #define __LINUX_MFD_MAX77693_H | 31 | #define __LINUX_MFD_MAX77693_H |
32 | 32 | ||
33 | /* MAX77686 regulator IDs */ | ||
34 | enum max77693_regulators { | ||
35 | MAX77693_ESAFEOUT1 = 0, | ||
36 | MAX77693_ESAFEOUT2, | ||
37 | MAX77693_CHARGER, | ||
38 | MAX77693_REG_MAX, | ||
39 | }; | ||
40 | |||
41 | struct max77693_regulator_data { | ||
42 | int id; | ||
43 | struct regulator_init_data *initdata; | ||
44 | struct device_node *of_node; | ||
45 | }; | ||
46 | |||
33 | struct max77693_reg_data { | 47 | struct max77693_reg_data { |
34 | u8 addr; | 48 | u8 addr; |
35 | u8 data; | 49 | u8 data; |
@@ -52,6 +66,10 @@ struct max77693_muic_platform_data { | |||
52 | struct max77693_platform_data { | 66 | struct max77693_platform_data { |
53 | int wakeup; | 67 | int wakeup; |
54 | 68 | ||
69 | /* regulator data */ | ||
70 | struct max77693_regulator_data *regulators; | ||
71 | int num_regulators; | ||
72 | |||
55 | /* muic data */ | 73 | /* muic data */ |
56 | struct max77693_muic_platform_data *muic_data; | 74 | struct max77693_muic_platform_data *muic_data; |
57 | }; | 75 | }; |
diff --git a/include/linux/mfd/max8998-private.h b/include/linux/mfd/max8998-private.h index effa5d3b96ae..84844e0a5704 100644 --- a/include/linux/mfd/max8998-private.h +++ b/include/linux/mfd/max8998-private.h | |||
@@ -132,9 +132,12 @@ enum { | |||
132 | 132 | ||
133 | #define MAX8998_ENRAMP (1 << 4) | 133 | #define MAX8998_ENRAMP (1 << 4) |
134 | 134 | ||
135 | struct irq_domain; | ||
136 | |||
135 | /** | 137 | /** |
136 | * struct max8998_dev - max8998 master device for sub-drivers | 138 | * struct max8998_dev - max8998 master device for sub-drivers |
137 | * @dev: master device of the chip (can be used to access platform data) | 139 | * @dev: master device of the chip (can be used to access platform data) |
140 | * @pdata: platform data for the driver and subdrivers | ||
138 | * @i2c: i2c client private data for regulator | 141 | * @i2c: i2c client private data for regulator |
139 | * @rtc: i2c client private data for rtc | 142 | * @rtc: i2c client private data for rtc |
140 | * @iolock: mutex for serializing io access | 143 | * @iolock: mutex for serializing io access |
@@ -148,12 +151,14 @@ enum { | |||
148 | */ | 151 | */ |
149 | struct max8998_dev { | 152 | struct max8998_dev { |
150 | struct device *dev; | 153 | struct device *dev; |
154 | struct max8998_platform_data *pdata; | ||
151 | struct i2c_client *i2c; | 155 | struct i2c_client *i2c; |
152 | struct i2c_client *rtc; | 156 | struct i2c_client *rtc; |
153 | struct mutex iolock; | 157 | struct mutex iolock; |
154 | struct mutex irqlock; | 158 | struct mutex irqlock; |
155 | 159 | ||
156 | int irq_base; | 160 | unsigned int irq_base; |
161 | struct irq_domain *irq_domain; | ||
157 | int irq; | 162 | int irq; |
158 | int ono; | 163 | int ono; |
159 | u8 irq_masks_cur[MAX8998_NUM_IRQ_REGS]; | 164 | u8 irq_masks_cur[MAX8998_NUM_IRQ_REGS]; |
diff --git a/include/linux/mfd/max8998.h b/include/linux/mfd/max8998.h index 6823548d0c0a..e3956a654cbc 100644 --- a/include/linux/mfd/max8998.h +++ b/include/linux/mfd/max8998.h | |||
@@ -58,10 +58,12 @@ enum { | |||
58 | * max8998_regulator_data - regulator data | 58 | * max8998_regulator_data - regulator data |
59 | * @id: regulator id | 59 | * @id: regulator id |
60 | * @initdata: regulator init data (contraints, supplies, ...) | 60 | * @initdata: regulator init data (contraints, supplies, ...) |
61 | * @reg_node: DT node of regulator (unused on non-DT platforms) | ||
61 | */ | 62 | */ |
62 | struct max8998_regulator_data { | 63 | struct max8998_regulator_data { |
63 | int id; | 64 | int id; |
64 | struct regulator_init_data *initdata; | 65 | struct regulator_init_data *initdata; |
66 | struct device_node *reg_node; | ||
65 | }; | 67 | }; |
66 | 68 | ||
67 | /** | 69 | /** |
@@ -73,12 +75,8 @@ struct max8998_regulator_data { | |||
73 | * @buck_voltage_lock: Do NOT change the values of the following six | 75 | * @buck_voltage_lock: Do NOT change the values of the following six |
74 | * registers set by buck?_voltage?. The voltage of BUCK1/2 cannot | 76 | * registers set by buck?_voltage?. The voltage of BUCK1/2 cannot |
75 | * be other than the preset values. | 77 | * be other than the preset values. |
76 | * @buck1_voltage1: BUCK1 DVS mode 1 voltage register | 78 | * @buck1_voltage: BUCK1 DVS mode 1 voltage registers |
77 | * @buck1_voltage2: BUCK1 DVS mode 2 voltage register | 79 | * @buck2_voltage: BUCK2 DVS mode 2 voltage registers |
78 | * @buck1_voltage3: BUCK1 DVS mode 3 voltage register | ||
79 | * @buck1_voltage4: BUCK1 DVS mode 4 voltage register | ||
80 | * @buck2_voltage1: BUCK2 DVS mode 1 voltage register | ||
81 | * @buck2_voltage2: BUCK2 DVS mode 2 voltage register | ||
82 | * @buck1_set1: BUCK1 gpio pin 1 to set output voltage | 80 | * @buck1_set1: BUCK1 gpio pin 1 to set output voltage |
83 | * @buck1_set2: BUCK1 gpio pin 2 to set output voltage | 81 | * @buck1_set2: BUCK1 gpio pin 2 to set output voltage |
84 | * @buck1_default_idx: Default for BUCK1 gpio pin 1, 2 | 82 | * @buck1_default_idx: Default for BUCK1 gpio pin 1, 2 |
@@ -100,15 +98,11 @@ struct max8998_regulator_data { | |||
100 | struct max8998_platform_data { | 98 | struct max8998_platform_data { |
101 | struct max8998_regulator_data *regulators; | 99 | struct max8998_regulator_data *regulators; |
102 | int num_regulators; | 100 | int num_regulators; |
103 | int irq_base; | 101 | unsigned int irq_base; |
104 | int ono; | 102 | int ono; |
105 | bool buck_voltage_lock; | 103 | bool buck_voltage_lock; |
106 | int buck1_voltage1; | 104 | int buck1_voltage[4]; |
107 | int buck1_voltage2; | 105 | int buck2_voltage[2]; |
108 | int buck1_voltage3; | ||
109 | int buck1_voltage4; | ||
110 | int buck2_voltage1; | ||
111 | int buck2_voltage2; | ||
112 | int buck1_set1; | 106 | int buck1_set1; |
113 | int buck1_set2; | 107 | int buck1_set2; |
114 | int buck1_default_idx; | 108 | int buck1_default_idx; |
diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h index bf070755982e..41ed59276c00 100644 --- a/include/linux/mfd/mc13xxx.h +++ b/include/linux/mfd/mc13xxx.h | |||
@@ -78,20 +78,30 @@ struct mc13xxx_regulator_platform_data { | |||
78 | struct mc13xxx_regulator_init_data *regulators; | 78 | struct mc13xxx_regulator_init_data *regulators; |
79 | }; | 79 | }; |
80 | 80 | ||
81 | enum { | ||
82 | /* MC13783 LED IDs */ | ||
83 | MC13783_LED_MD, | ||
84 | MC13783_LED_AD, | ||
85 | MC13783_LED_KP, | ||
86 | MC13783_LED_R1, | ||
87 | MC13783_LED_G1, | ||
88 | MC13783_LED_B1, | ||
89 | MC13783_LED_R2, | ||
90 | MC13783_LED_G2, | ||
91 | MC13783_LED_B2, | ||
92 | MC13783_LED_R3, | ||
93 | MC13783_LED_G3, | ||
94 | MC13783_LED_B3, | ||
95 | /* MC13892 LED IDs */ | ||
96 | MC13892_LED_MD, | ||
97 | MC13892_LED_AD, | ||
98 | MC13892_LED_KP, | ||
99 | MC13892_LED_R, | ||
100 | MC13892_LED_G, | ||
101 | MC13892_LED_B, | ||
102 | }; | ||
103 | |||
81 | struct mc13xxx_led_platform_data { | 104 | struct mc13xxx_led_platform_data { |
82 | #define MC13783_LED_MD 0 | ||
83 | #define MC13783_LED_AD 1 | ||
84 | #define MC13783_LED_KP 2 | ||
85 | #define MC13783_LED_R1 3 | ||
86 | #define MC13783_LED_G1 4 | ||
87 | #define MC13783_LED_B1 5 | ||
88 | #define MC13783_LED_R2 6 | ||
89 | #define MC13783_LED_G2 7 | ||
90 | #define MC13783_LED_B2 8 | ||
91 | #define MC13783_LED_R3 9 | ||
92 | #define MC13783_LED_G3 10 | ||
93 | #define MC13783_LED_B3 11 | ||
94 | #define MC13783_LED_MAX MC13783_LED_B3 | ||
95 | int id; | 105 | int id; |
96 | const char *name; | 106 | const char *name; |
97 | const char *default_trigger; | 107 | const char *default_trigger; |
@@ -100,46 +110,36 @@ struct mc13xxx_led_platform_data { | |||
100 | char max_current; | 110 | char max_current; |
101 | }; | 111 | }; |
102 | 112 | ||
113 | #define MAX_LED_CONTROL_REGS 6 | ||
114 | |||
103 | struct mc13xxx_leds_platform_data { | 115 | struct mc13xxx_leds_platform_data { |
104 | int num_leds; | ||
105 | struct mc13xxx_led_platform_data *led; | 116 | struct mc13xxx_led_platform_data *led; |
117 | int num_leds; | ||
106 | 118 | ||
107 | #define MC13783_LED_TRIODE_MD (1 << 0) | 119 | /* LED Control 0 */ |
108 | #define MC13783_LED_TRIODE_AD (1 << 1) | 120 | #define MC13783_LED_C0_ENABLE (1 << 0) |
109 | #define MC13783_LED_TRIODE_KP (1 << 2) | 121 | #define MC13783_LED_C0_TRIODE_MD (1 << 7) |
110 | #define MC13783_LED_BOOST_EN (1 << 3) | 122 | #define MC13783_LED_C0_TRIODE_AD (1 << 8) |
111 | #define MC13783_LED_TC1HALF (1 << 4) | 123 | #define MC13783_LED_C0_TRIODE_KP (1 << 9) |
112 | #define MC13783_LED_SLEWLIMTC (1 << 5) | 124 | #define MC13783_LED_C0_BOOST (1 << 10) |
113 | #define MC13783_LED_SLEWLIMBL (1 << 6) | 125 | #define MC13783_LED_C0_ABMODE(x) (((x) & 0x7) << 11) |
114 | #define MC13783_LED_TRIODE_TC1 (1 << 7) | 126 | #define MC13783_LED_C0_ABREF(x) (((x) & 0x3) << 14) |
115 | #define MC13783_LED_TRIODE_TC2 (1 << 8) | 127 | /* LED Control 1 */ |
116 | #define MC13783_LED_TRIODE_TC3 (1 << 9) | 128 | #define MC13783_LED_C1_TC1HALF (1 << 18) |
117 | int flags; | 129 | #define MC13783_LED_C1_SLEWLIM (1 << 23) |
118 | 130 | /* LED Control 2 */ | |
119 | #define MC13783_LED_AB_DISABLED 0 | 131 | #define MC13783_LED_C2_PERIOD(x) (((x) & 0x3) << 21) |
120 | #define MC13783_LED_AB_MD1 1 | 132 | #define MC13783_LED_C2_SLEWLIM (1 << 23) |
121 | #define MC13783_LED_AB_MD12 2 | 133 | /* LED Control 3 */ |
122 | #define MC13783_LED_AB_MD123 3 | 134 | #define MC13783_LED_C3_PERIOD(x) (((x) & 0x3) << 21) |
123 | #define MC13783_LED_AB_MD1234 4 | 135 | #define MC13783_LED_C3_TRIODE_TC1 (1 << 23) |
124 | #define MC13783_LED_AB_MD1234_AD1 5 | 136 | /* LED Control 4 */ |
125 | #define MC13783_LED_AB_MD1234_AD12 6 | 137 | #define MC13783_LED_C4_PERIOD(x) (((x) & 0x3) << 21) |
126 | #define MC13783_LED_AB_MD1_AD 7 | 138 | #define MC13783_LED_C4_TRIODE_TC2 (1 << 23) |
127 | char abmode; | 139 | /* LED Control 5 */ |
128 | 140 | #define MC13783_LED_C5_PERIOD(x) (((x) & 0x3) << 21) | |
129 | #define MC13783_LED_ABREF_200MV 0 | 141 | #define MC13783_LED_C5_TRIODE_TC3 (1 << 23) |
130 | #define MC13783_LED_ABREF_400MV 1 | 142 | u32 led_control[MAX_LED_CONTROL_REGS]; |
131 | #define MC13783_LED_ABREF_600MV 2 | ||
132 | #define MC13783_LED_ABREF_800MV 3 | ||
133 | char abref; | ||
134 | |||
135 | #define MC13783_LED_PERIOD_10MS 0 | ||
136 | #define MC13783_LED_PERIOD_100MS 1 | ||
137 | #define MC13783_LED_PERIOD_500MS 2 | ||
138 | #define MC13783_LED_PERIOD_2S 3 | ||
139 | char bl_period; | ||
140 | char tc1_period; | ||
141 | char tc2_period; | ||
142 | char tc3_period; | ||
143 | }; | 143 | }; |
144 | 144 | ||
145 | struct mc13xxx_buttons_platform_data { | 145 | struct mc13xxx_buttons_platform_data { |
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h index 8f21daf62fb5..1a8dd7afe084 100644 --- a/include/linux/mfd/palmas.h +++ b/include/linux/mfd/palmas.h | |||
@@ -20,6 +20,8 @@ | |||
20 | #include <linux/leds.h> | 20 | #include <linux/leds.h> |
21 | #include <linux/regmap.h> | 21 | #include <linux/regmap.h> |
22 | #include <linux/regulator/driver.h> | 22 | #include <linux/regulator/driver.h> |
23 | #include <linux/extcon.h> | ||
24 | #include <linux/usb/phy_companion.h> | ||
23 | 25 | ||
24 | #define PALMAS_NUM_CLIENTS 3 | 26 | #define PALMAS_NUM_CLIENTS 3 |
25 | 27 | ||
@@ -32,11 +34,30 @@ | |||
32 | ((a) == PALMAS_CHIP_ID)) | 34 | ((a) == PALMAS_CHIP_ID)) |
33 | #define is_palmas_charger(a) ((a) == PALMAS_CHIP_CHARGER_ID) | 35 | #define is_palmas_charger(a) ((a) == PALMAS_CHIP_CHARGER_ID) |
34 | 36 | ||
37 | /** | ||
38 | * Palmas PMIC feature types | ||
39 | * | ||
40 | * PALMAS_PMIC_FEATURE_SMPS10_BOOST - used when the PMIC provides SMPS10_BOOST | ||
41 | * regulator. | ||
42 | * | ||
43 | * PALMAS_PMIC_HAS(b, f) - macro to check if a bandgap device is capable of a | ||
44 | * specific feature (above) or not. Return non-zero, if yes. | ||
45 | */ | ||
46 | #define PALMAS_PMIC_FEATURE_SMPS10_BOOST BIT(0) | ||
47 | #define PALMAS_PMIC_HAS(b, f) \ | ||
48 | ((b)->features & PALMAS_PMIC_FEATURE_ ## f) | ||
49 | |||
35 | struct palmas_pmic; | 50 | struct palmas_pmic; |
36 | struct palmas_gpadc; | 51 | struct palmas_gpadc; |
37 | struct palmas_resource; | 52 | struct palmas_resource; |
38 | struct palmas_usb; | 53 | struct palmas_usb; |
39 | 54 | ||
55 | enum palmas_usb_state { | ||
56 | PALMAS_USB_STATE_DISCONNECT, | ||
57 | PALMAS_USB_STATE_VBUS, | ||
58 | PALMAS_USB_STATE_ID, | ||
59 | }; | ||
60 | |||
40 | struct palmas { | 61 | struct palmas { |
41 | struct device *dev; | 62 | struct device *dev; |
42 | 63 | ||
@@ -46,6 +67,7 @@ struct palmas { | |||
46 | /* Stored chip id */ | 67 | /* Stored chip id */ |
47 | int id; | 68 | int id; |
48 | 69 | ||
70 | unsigned int features; | ||
49 | /* IRQ Data */ | 71 | /* IRQ Data */ |
50 | int irq; | 72 | int irq; |
51 | u32 irq_mask; | 73 | u32 irq_mask; |
@@ -180,9 +202,6 @@ struct palmas_pmic_platform_data { | |||
180 | }; | 202 | }; |
181 | 203 | ||
182 | struct palmas_usb_platform_data { | 204 | struct palmas_usb_platform_data { |
183 | /* Set this if platform wishes its own vbus control */ | ||
184 | int no_control_vbus; | ||
185 | |||
186 | /* Do we enable the wakeup comparator on probe */ | 205 | /* Do we enable the wakeup comparator on probe */ |
187 | int wakeup; | 206 | int wakeup; |
188 | }; | 207 | }; |
@@ -350,22 +369,19 @@ struct palmas_usb { | |||
350 | struct palmas *palmas; | 369 | struct palmas *palmas; |
351 | struct device *dev; | 370 | struct device *dev; |
352 | 371 | ||
353 | /* for vbus reporting with irqs disabled */ | 372 | struct extcon_dev edev; |
354 | spinlock_t lock; | ||
355 | |||
356 | struct regulator *vbus_reg; | ||
357 | 373 | ||
358 | /* used to set vbus, in atomic path */ | 374 | /* used to set vbus, in atomic path */ |
359 | struct work_struct set_vbus_work; | 375 | struct work_struct set_vbus_work; |
360 | 376 | ||
361 | int irq1; | 377 | int id_otg_irq; |
362 | int irq2; | 378 | int id_irq; |
363 | int irq3; | 379 | int vbus_otg_irq; |
364 | int irq4; | 380 | int vbus_irq; |
365 | 381 | ||
366 | int vbus_enable; | 382 | int vbus_enable; |
367 | 383 | ||
368 | u8 linkstat; | 384 | enum palmas_usb_state linkstat; |
369 | }; | 385 | }; |
370 | 386 | ||
371 | #define comparator_to_palmas(x) container_of((x), struct palmas_usb, comparator) | 387 | #define comparator_to_palmas(x) container_of((x), struct palmas_usb, comparator) |
diff --git a/include/linux/mfd/rtsx_pci.h b/include/linux/mfd/rtsx_pci.h index 86bc635f8385..7a9f7089435d 100644 --- a/include/linux/mfd/rtsx_pci.h +++ b/include/linux/mfd/rtsx_pci.h | |||
@@ -575,6 +575,7 @@ | |||
575 | 575 | ||
576 | #define CARD_PWR_CTL 0xFD50 | 576 | #define CARD_PWR_CTL 0xFD50 |
577 | #define CARD_CLK_SWITCH 0xFD51 | 577 | #define CARD_CLK_SWITCH 0xFD51 |
578 | #define RTL8411B_PACKAGE_MODE 0xFD51 | ||
578 | #define CARD_SHARE_MODE 0xFD52 | 579 | #define CARD_SHARE_MODE 0xFD52 |
579 | #define CARD_DRIVE_SEL 0xFD53 | 580 | #define CARD_DRIVE_SEL 0xFD53 |
580 | #define CARD_STOP 0xFD54 | 581 | #define CARD_STOP 0xFD54 |
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h index f0f4de3b4ccc..378ae8a04c6a 100644 --- a/include/linux/mfd/samsung/core.h +++ b/include/linux/mfd/samsung/core.h | |||
@@ -14,8 +14,6 @@ | |||
14 | #ifndef __LINUX_MFD_SEC_CORE_H | 14 | #ifndef __LINUX_MFD_SEC_CORE_H |
15 | #define __LINUX_MFD_SEC_CORE_H | 15 | #define __LINUX_MFD_SEC_CORE_H |
16 | 16 | ||
17 | #define NUM_IRQ_REGS 4 | ||
18 | |||
19 | enum sec_device_type { | 17 | enum sec_device_type { |
20 | S5M8751X, | 18 | S5M8751X, |
21 | S5M8763X, | 19 | S5M8763X, |
@@ -44,8 +42,6 @@ struct sec_pmic_dev { | |||
44 | struct regmap *regmap; | 42 | struct regmap *regmap; |
45 | struct i2c_client *i2c; | 43 | struct i2c_client *i2c; |
46 | struct i2c_client *rtc; | 44 | struct i2c_client *rtc; |
47 | struct mutex iolock; | ||
48 | struct mutex irqlock; | ||
49 | 45 | ||
50 | int device_type; | 46 | int device_type; |
51 | int irq_base; | 47 | int irq_base; |
@@ -53,8 +49,6 @@ struct sec_pmic_dev { | |||
53 | struct regmap_irq_chip_data *irq_data; | 49 | struct regmap_irq_chip_data *irq_data; |
54 | 50 | ||
55 | int ono; | 51 | int ono; |
56 | u8 irq_masks_cur[NUM_IRQ_REGS]; | ||
57 | u8 irq_masks_cache[NUM_IRQ_REGS]; | ||
58 | int type; | 52 | int type; |
59 | bool wakeup; | 53 | bool wakeup; |
60 | }; | 54 | }; |
diff --git a/include/linux/mfd/samsung/s2mps11.h b/include/linux/mfd/samsung/s2mps11.h index ad2252f239d7..4e94dc65f987 100644 --- a/include/linux/mfd/samsung/s2mps11.h +++ b/include/linux/mfd/samsung/s2mps11.h | |||
@@ -189,6 +189,7 @@ enum s2mps11_regulators { | |||
189 | #define S2MPS11_ENABLE_SHIFT 0x06 | 189 | #define S2MPS11_ENABLE_SHIFT 0x06 |
190 | #define S2MPS11_LDO_N_VOLTAGES (S2MPS11_LDO_VSEL_MASK + 1) | 190 | #define S2MPS11_LDO_N_VOLTAGES (S2MPS11_LDO_VSEL_MASK + 1) |
191 | #define S2MPS11_BUCK_N_VOLTAGES (S2MPS11_BUCK_VSEL_MASK + 1) | 191 | #define S2MPS11_BUCK_N_VOLTAGES (S2MPS11_BUCK_VSEL_MASK + 1) |
192 | #define S2MPS11_RAMP_DELAY 25000 /* uV/us */ | ||
192 | 193 | ||
193 | #define S2MPS11_PMIC_EN_SHIFT 6 | 194 | #define S2MPS11_PMIC_EN_SHIFT 6 |
194 | #define S2MPS11_REGULATOR_MAX (S2MPS11_REG_MAX - 3) | 195 | #define S2MPS11_REGULATOR_MAX (S2MPS11_REG_MAX - 3) |
diff --git a/include/linux/mfd/syscon/clps711x.h b/include/linux/mfd/syscon/clps711x.h new file mode 100644 index 000000000000..26355abae515 --- /dev/null +++ b/include/linux/mfd/syscon/clps711x.h | |||
@@ -0,0 +1,94 @@ | |||
1 | /* | ||
2 | * CLPS711X system register bits definitions | ||
3 | * | ||
4 | * Copyright (C) 2013 Alexander Shiyan <shc_work@mail.ru> | ||
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 | |||
12 | #ifndef _LINUX_MFD_SYSCON_CLPS711X_H_ | ||
13 | #define _LINUX_MFD_SYSCON_CLPS711X_H_ | ||
14 | |||
15 | #define SYSCON_OFFSET (0x00) | ||
16 | #define SYSFLG_OFFSET (0x40) | ||
17 | |||
18 | #define SYSCON1_KBDSCAN(x) ((x) & 15) | ||
19 | #define SYSCON1_KBDSCAN_MASK (15) | ||
20 | #define SYSCON1_TC1M (1 << 4) | ||
21 | #define SYSCON1_TC1S (1 << 5) | ||
22 | #define SYSCON1_TC2M (1 << 6) | ||
23 | #define SYSCON1_TC2S (1 << 7) | ||
24 | #define SYSCON1_BZTOG (1 << 9) | ||
25 | #define SYSCON1_BZMOD (1 << 10) | ||
26 | #define SYSCON1_DBGEN (1 << 11) | ||
27 | #define SYSCON1_LCDEN (1 << 12) | ||
28 | #define SYSCON1_CDENTX (1 << 13) | ||
29 | #define SYSCON1_CDENRX (1 << 14) | ||
30 | #define SYSCON1_SIREN (1 << 15) | ||
31 | #define SYSCON1_ADCKSEL(x) (((x) & 3) << 16) | ||
32 | #define SYSCON1_ADCKSEL_MASK (3 << 16) | ||
33 | #define SYSCON1_EXCKEN (1 << 18) | ||
34 | #define SYSCON1_WAKEDIS (1 << 19) | ||
35 | #define SYSCON1_IRTXM (1 << 20) | ||
36 | |||
37 | #define SYSCON2_SERSEL (1 << 0) | ||
38 | #define SYSCON2_KBD6 (1 << 1) | ||
39 | #define SYSCON2_DRAMZ (1 << 2) | ||
40 | #define SYSCON2_KBWEN (1 << 3) | ||
41 | #define SYSCON2_SS2TXEN (1 << 4) | ||
42 | #define SYSCON2_PCCARD1 (1 << 5) | ||
43 | #define SYSCON2_PCCARD2 (1 << 6) | ||
44 | #define SYSCON2_SS2RXEN (1 << 7) | ||
45 | #define SYSCON2_SS2MAEN (1 << 9) | ||
46 | #define SYSCON2_OSTB (1 << 12) | ||
47 | #define SYSCON2_CLKENSL (1 << 13) | ||
48 | #define SYSCON2_BUZFREQ (1 << 14) | ||
49 | |||
50 | #define SYSCON3_ADCCON (1 << 0) | ||
51 | #define SYSCON3_CLKCTL0 (1 << 1) | ||
52 | #define SYSCON3_CLKCTL1 (1 << 2) | ||
53 | #define SYSCON3_DAISEL (1 << 3) | ||
54 | #define SYSCON3_ADCCKNSEN (1 << 4) | ||
55 | #define SYSCON3_VERSN(x) (((x) >> 5) & 7) | ||
56 | #define SYSCON3_VERSN_MASK (7 << 5) | ||
57 | #define SYSCON3_FASTWAKE (1 << 8) | ||
58 | #define SYSCON3_DAIEN (1 << 9) | ||
59 | #define SYSCON3_128FS SYSCON3_DAIEN | ||
60 | #define SYSCON3_ENPD67 (1 << 10) | ||
61 | |||
62 | #define SYSCON_UARTEN (1 << 8) | ||
63 | |||
64 | #define SYSFLG1_MCDR (1 << 0) | ||
65 | #define SYSFLG1_DCDET (1 << 1) | ||
66 | #define SYSFLG1_WUDR (1 << 2) | ||
67 | #define SYSFLG1_WUON (1 << 3) | ||
68 | #define SYSFLG1_CTS (1 << 8) | ||
69 | #define SYSFLG1_DSR (1 << 9) | ||
70 | #define SYSFLG1_DCD (1 << 10) | ||
71 | #define SYSFLG1_NBFLG (1 << 12) | ||
72 | #define SYSFLG1_RSTFLG (1 << 13) | ||
73 | #define SYSFLG1_PFFLG (1 << 14) | ||
74 | #define SYSFLG1_CLDFLG (1 << 15) | ||
75 | #define SYSFLG1_CRXFE (1 << 24) | ||
76 | #define SYSFLG1_CTXFF (1 << 25) | ||
77 | #define SYSFLG1_SSIBUSY (1 << 26) | ||
78 | #define SYSFLG1_ID (1 << 29) | ||
79 | #define SYSFLG1_VERID(x) (((x) >> 30) & 3) | ||
80 | #define SYSFLG1_VERID_MASK (3 << 30) | ||
81 | |||
82 | #define SYSFLG2_SSRXOF (1 << 0) | ||
83 | #define SYSFLG2_RESVAL (1 << 1) | ||
84 | #define SYSFLG2_RESFRM (1 << 2) | ||
85 | #define SYSFLG2_SS2RXFE (1 << 3) | ||
86 | #define SYSFLG2_SS2TXFF (1 << 4) | ||
87 | #define SYSFLG2_SS2TXUF (1 << 5) | ||
88 | #define SYSFLG2_CKMODE (1 << 6) | ||
89 | |||
90 | #define SYSFLG_UBUSY (1 << 11) | ||
91 | #define SYSFLG_URXFE (1 << 22) | ||
92 | #define SYSFLG_UTXFF (1 << 23) | ||
93 | |||
94 | #endif | ||
diff --git a/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h b/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h index dab34a1deb2c..b6bdcd66c07d 100644 --- a/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h +++ b/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h | |||
@@ -103,15 +103,15 @@ | |||
103 | #define IMX6Q_GPR1_EXC_MON_MASK BIT(22) | 103 | #define IMX6Q_GPR1_EXC_MON_MASK BIT(22) |
104 | #define IMX6Q_GPR1_EXC_MON_OKAY 0x0 | 104 | #define IMX6Q_GPR1_EXC_MON_OKAY 0x0 |
105 | #define IMX6Q_GPR1_EXC_MON_SLVE BIT(22) | 105 | #define IMX6Q_GPR1_EXC_MON_SLVE BIT(22) |
106 | #define IMX6Q_GPR1_MIPI_IPU2_SEL_MASK BIT(21) | 106 | #define IMX6Q_GPR1_ENET_CLK_SEL_MASK BIT(21) |
107 | #define IMX6Q_GPR1_MIPI_IPU2_SEL_GASKET 0x0 | 107 | #define IMX6Q_GPR1_ENET_CLK_SEL_PAD 0 |
108 | #define IMX6Q_GPR1_MIPI_IPU2_SEL_IOMUX BIT(21) | 108 | #define IMX6Q_GPR1_ENET_CLK_SEL_ANATOP BIT(21) |
109 | #define IMX6Q_GPR1_MIPI_IPU1_MUX_MASK BIT(20) | 109 | #define IMX6Q_GPR1_MIPI_IPU2_MUX_MASK BIT(20) |
110 | #define IMX6Q_GPR1_MIPI_IPU1_MUX_GASKET 0x0 | ||
111 | #define IMX6Q_GPR1_MIPI_IPU1_MUX_IOMUX BIT(20) | ||
112 | #define IMX6Q_GPR1_MIPI_IPU2_MUX_MASK BIT(19) | ||
113 | #define IMX6Q_GPR1_MIPI_IPU2_MUX_GASKET 0x0 | 110 | #define IMX6Q_GPR1_MIPI_IPU2_MUX_GASKET 0x0 |
114 | #define IMX6Q_GPR1_MIPI_IPU2_MUX_IOMUX BIT(19) | 111 | #define IMX6Q_GPR1_MIPI_IPU2_MUX_IOMUX BIT(20) |
112 | #define IMX6Q_GPR1_MIPI_IPU1_MUX_MASK BIT(19) | ||
113 | #define IMX6Q_GPR1_MIPI_IPU1_MUX_GASKET 0x0 | ||
114 | #define IMX6Q_GPR1_MIPI_IPU1_MUX_IOMUX BIT(19) | ||
115 | #define IMX6Q_GPR1_PCIE_TEST_PD BIT(18) | 115 | #define IMX6Q_GPR1_PCIE_TEST_PD BIT(18) |
116 | #define IMX6Q_GPR1_IPU_VPU_MUX_MASK BIT(17) | 116 | #define IMX6Q_GPR1_IPU_VPU_MUX_MASK BIT(17) |
117 | #define IMX6Q_GPR1_IPU_VPU_MUX_IPU1 0x0 | 117 | #define IMX6Q_GPR1_IPU_VPU_MUX_IPU1 0x0 |
@@ -279,41 +279,88 @@ | |||
279 | #define IMX6Q_GPR13_CAN2_STOP_REQ BIT(29) | 279 | #define IMX6Q_GPR13_CAN2_STOP_REQ BIT(29) |
280 | #define IMX6Q_GPR13_CAN1_STOP_REQ BIT(28) | 280 | #define IMX6Q_GPR13_CAN1_STOP_REQ BIT(28) |
281 | #define IMX6Q_GPR13_ENET_STOP_REQ BIT(27) | 281 | #define IMX6Q_GPR13_ENET_STOP_REQ BIT(27) |
282 | #define IMX6Q_GPR13_SATA_PHY_8_MASK (0x7 << 24) | 282 | #define IMX6Q_GPR13_SATA_RX_EQ_VAL_MASK (0x7 << 24) |
283 | #define IMX6Q_GPR13_SATA_PHY_8_0_5_DB (0x0 << 24) | 283 | #define IMX6Q_GPR13_SATA_RX_EQ_VAL_0_5_DB (0x0 << 24) |
284 | #define IMX6Q_GPR13_SATA_PHY_8_1_0_DB (0x1 << 24) | 284 | #define IMX6Q_GPR13_SATA_RX_EQ_VAL_1_0_DB (0x1 << 24) |
285 | #define IMX6Q_GPR13_SATA_PHY_8_1_5_DB (0x2 << 24) | 285 | #define IMX6Q_GPR13_SATA_RX_EQ_VAL_1_5_DB (0x2 << 24) |
286 | #define IMX6Q_GPR13_SATA_PHY_8_2_0_DB (0x3 << 24) | 286 | #define IMX6Q_GPR13_SATA_RX_EQ_VAL_2_0_DB (0x3 << 24) |
287 | #define IMX6Q_GPR13_SATA_PHY_8_2_5_DB (0x4 << 24) | 287 | #define IMX6Q_GPR13_SATA_RX_EQ_VAL_2_5_DB (0x4 << 24) |
288 | #define IMX6Q_GPR13_SATA_PHY_8_3_0_DB (0x5 << 24) | 288 | #define IMX6Q_GPR13_SATA_RX_EQ_VAL_3_0_DB (0x5 << 24) |
289 | #define IMX6Q_GPR13_SATA_PHY_8_3_5_DB (0x6 << 24) | 289 | #define IMX6Q_GPR13_SATA_RX_EQ_VAL_3_5_DB (0x6 << 24) |
290 | #define IMX6Q_GPR13_SATA_PHY_8_4_0_DB (0x7 << 24) | 290 | #define IMX6Q_GPR13_SATA_RX_EQ_VAL_4_0_DB (0x7 << 24) |
291 | #define IMX6Q_GPR13_SATA_PHY_7_MASK (0x1f << 19) | 291 | #define IMX6Q_GPR13_SATA_RX_LOS_LVL_MASK (0x1f << 19) |
292 | #define IMX6Q_GPR13_SATA_PHY_7_SATA1I (0x10 << 19) | 292 | #define IMX6Q_GPR13_SATA_RX_LOS_LVL_SATA1I (0x10 << 19) |
293 | #define IMX6Q_GPR13_SATA_PHY_7_SATA1M (0x10 << 19) | 293 | #define IMX6Q_GPR13_SATA_RX_LOS_LVL_SATA1M (0x10 << 19) |
294 | #define IMX6Q_GPR13_SATA_PHY_7_SATA1X (0x1a << 19) | 294 | #define IMX6Q_GPR13_SATA_RX_LOS_LVL_SATA1X (0x1a << 19) |
295 | #define IMX6Q_GPR13_SATA_PHY_7_SATA2I (0x12 << 19) | 295 | #define IMX6Q_GPR13_SATA_RX_LOS_LVL_SATA2I (0x12 << 19) |
296 | #define IMX6Q_GPR13_SATA_PHY_7_SATA2M (0x12 << 19) | 296 | #define IMX6Q_GPR13_SATA_RX_LOS_LVL_SATA2M (0x12 << 19) |
297 | #define IMX6Q_GPR13_SATA_PHY_7_SATA2X (0x1a << 19) | 297 | #define IMX6Q_GPR13_SATA_RX_LOS_LVL_SATA2X (0x1a << 19) |
298 | #define IMX6Q_GPR13_SATA_PHY_6_MASK (0x7 << 16) | 298 | #define IMX6Q_GPR13_SATA_RX_DPLL_MODE_MASK (0x7 << 16) |
299 | #define IMX6Q_GPR13_SATA_SPEED_MASK BIT(15) | 299 | #define IMX6Q_GPR13_SATA_RX_DPLL_MODE_1P_1F (0x0 << 16) |
300 | #define IMX6Q_GPR13_SATA_SPEED_1P5G 0x0 | 300 | #define IMX6Q_GPR13_SATA_RX_DPLL_MODE_2P_2F (0x1 << 16) |
301 | #define IMX6Q_GPR13_SATA_SPEED_3P0G BIT(15) | 301 | #define IMX6Q_GPR13_SATA_RX_DPLL_MODE_1P_4F (0x2 << 16) |
302 | #define IMX6Q_GPR13_SATA_PHY_5 BIT(14) | 302 | #define IMX6Q_GPR13_SATA_RX_DPLL_MODE_2P_4F (0x3 << 16) |
303 | #define IMX6Q_GPR13_SATA_PHY_4_MASK (0x7 << 11) | 303 | #define IMX6Q_GPR13_SATA_SPD_MODE_MASK BIT(15) |
304 | #define IMX6Q_GPR13_SATA_PHY_4_16_16 (0x0 << 11) | 304 | #define IMX6Q_GPR13_SATA_SPD_MODE_1P5G 0x0 |
305 | #define IMX6Q_GPR13_SATA_PHY_4_14_16 (0x1 << 11) | 305 | #define IMX6Q_GPR13_SATA_SPD_MODE_3P0G BIT(15) |
306 | #define IMX6Q_GPR13_SATA_PHY_4_12_16 (0x2 << 11) | 306 | #define IMX6Q_GPR13_SATA_MPLL_SS_EN BIT(14) |
307 | #define IMX6Q_GPR13_SATA_PHY_4_10_16 (0x3 << 11) | 307 | #define IMX6Q_GPR13_SATA_TX_ATTEN_MASK (0x7 << 11) |
308 | #define IMX6Q_GPR13_SATA_PHY_4_9_16 (0x4 << 11) | 308 | #define IMX6Q_GPR13_SATA_TX_ATTEN_16_16 (0x0 << 11) |
309 | #define IMX6Q_GPR13_SATA_PHY_4_8_16 (0x5 << 11) | 309 | #define IMX6Q_GPR13_SATA_TX_ATTEN_14_16 (0x1 << 11) |
310 | #define IMX6Q_GPR13_SATA_PHY_3_MASK (0xf << 7) | 310 | #define IMX6Q_GPR13_SATA_TX_ATTEN_12_16 (0x2 << 11) |
311 | #define IMX6Q_GPR13_SATA_PHY_3_OFF 0x7 | 311 | #define IMX6Q_GPR13_SATA_TX_ATTEN_10_16 (0x3 << 11) |
312 | #define IMX6Q_GPR13_SATA_PHY_2_MASK (0x1f << 2) | 312 | #define IMX6Q_GPR13_SATA_TX_ATTEN_9_16 (0x4 << 11) |
313 | #define IMX6Q_GPR13_SATA_PHY_2_OFF 0x2 | 313 | #define IMX6Q_GPR13_SATA_TX_ATTEN_8_16 (0x5 << 11) |
314 | #define IMX6Q_GPR13_SATA_PHY_1_MASK (0x3 << 0) | 314 | #define IMX6Q_GPR13_SATA_TX_BOOST_MASK (0xf << 7) |
315 | #define IMX6Q_GPR13_SATA_PHY_1_FAST (0x0 << 0) | 315 | #define IMX6Q_GPR13_SATA_TX_BOOST_0_00_DB (0x0 << 7) |
316 | #define IMX6Q_GPR13_SATA_PHY_1_MED (0x1 << 0) | 316 | #define IMX6Q_GPR13_SATA_TX_BOOST_0_37_DB (0x1 << 7) |
317 | #define IMX6Q_GPR13_SATA_PHY_1_SLOW (0x2 << 0) | 317 | #define IMX6Q_GPR13_SATA_TX_BOOST_0_74_DB (0x2 << 7) |
318 | 318 | #define IMX6Q_GPR13_SATA_TX_BOOST_1_11_DB (0x3 << 7) | |
319 | #define IMX6Q_GPR13_SATA_TX_BOOST_1_48_DB (0x4 << 7) | ||
320 | #define IMX6Q_GPR13_SATA_TX_BOOST_1_85_DB (0x5 << 7) | ||
321 | #define IMX6Q_GPR13_SATA_TX_BOOST_2_22_DB (0x6 << 7) | ||
322 | #define IMX6Q_GPR13_SATA_TX_BOOST_2_59_DB (0x7 << 7) | ||
323 | #define IMX6Q_GPR13_SATA_TX_BOOST_2_96_DB (0x8 << 7) | ||
324 | #define IMX6Q_GPR13_SATA_TX_BOOST_3_33_DB (0x9 << 7) | ||
325 | #define IMX6Q_GPR13_SATA_TX_BOOST_3_70_DB (0xa << 7) | ||
326 | #define IMX6Q_GPR13_SATA_TX_BOOST_4_07_DB (0xb << 7) | ||
327 | #define IMX6Q_GPR13_SATA_TX_BOOST_4_44_DB (0xc << 7) | ||
328 | #define IMX6Q_GPR13_SATA_TX_BOOST_4_81_DB (0xd << 7) | ||
329 | #define IMX6Q_GPR13_SATA_TX_BOOST_5_28_DB (0xe << 7) | ||
330 | #define IMX6Q_GPR13_SATA_TX_BOOST_5_75_DB (0xf << 7) | ||
331 | #define IMX6Q_GPR13_SATA_TX_LVL_MASK (0x1f << 2) | ||
332 | #define IMX6Q_GPR13_SATA_TX_LVL_0_937_V (0x00 << 2) | ||
333 | #define IMX6Q_GPR13_SATA_TX_LVL_0_947_V (0x01 << 2) | ||
334 | #define IMX6Q_GPR13_SATA_TX_LVL_0_957_V (0x02 << 2) | ||
335 | #define IMX6Q_GPR13_SATA_TX_LVL_0_966_V (0x03 << 2) | ||
336 | #define IMX6Q_GPR13_SATA_TX_LVL_0_976_V (0x04 << 2) | ||
337 | #define IMX6Q_GPR13_SATA_TX_LVL_0_986_V (0x05 << 2) | ||
338 | #define IMX6Q_GPR13_SATA_TX_LVL_0_996_V (0x06 << 2) | ||
339 | #define IMX6Q_GPR13_SATA_TX_LVL_1_005_V (0x07 << 2) | ||
340 | #define IMX6Q_GPR13_SATA_TX_LVL_1_015_V (0x08 << 2) | ||
341 | #define IMX6Q_GPR13_SATA_TX_LVL_1_025_V (0x09 << 2) | ||
342 | #define IMX6Q_GPR13_SATA_TX_LVL_1_035_V (0x0a << 2) | ||
343 | #define IMX6Q_GPR13_SATA_TX_LVL_1_045_V (0x0b << 2) | ||
344 | #define IMX6Q_GPR13_SATA_TX_LVL_1_054_V (0x0c << 2) | ||
345 | #define IMX6Q_GPR13_SATA_TX_LVL_1_064_V (0x0d << 2) | ||
346 | #define IMX6Q_GPR13_SATA_TX_LVL_1_074_V (0x0e << 2) | ||
347 | #define IMX6Q_GPR13_SATA_TX_LVL_1_084_V (0x0f << 2) | ||
348 | #define IMX6Q_GPR13_SATA_TX_LVL_1_094_V (0x10 << 2) | ||
349 | #define IMX6Q_GPR13_SATA_TX_LVL_1_104_V (0x11 << 2) | ||
350 | #define IMX6Q_GPR13_SATA_TX_LVL_1_113_V (0x12 << 2) | ||
351 | #define IMX6Q_GPR13_SATA_TX_LVL_1_123_V (0x13 << 2) | ||
352 | #define IMX6Q_GPR13_SATA_TX_LVL_1_133_V (0x14 << 2) | ||
353 | #define IMX6Q_GPR13_SATA_TX_LVL_1_143_V (0x15 << 2) | ||
354 | #define IMX6Q_GPR13_SATA_TX_LVL_1_152_V (0x16 << 2) | ||
355 | #define IMX6Q_GPR13_SATA_TX_LVL_1_162_V (0x17 << 2) | ||
356 | #define IMX6Q_GPR13_SATA_TX_LVL_1_172_V (0x18 << 2) | ||
357 | #define IMX6Q_GPR13_SATA_TX_LVL_1_182_V (0x19 << 2) | ||
358 | #define IMX6Q_GPR13_SATA_TX_LVL_1_191_V (0x1a << 2) | ||
359 | #define IMX6Q_GPR13_SATA_TX_LVL_1_201_V (0x1b << 2) | ||
360 | #define IMX6Q_GPR13_SATA_TX_LVL_1_211_V (0x1c << 2) | ||
361 | #define IMX6Q_GPR13_SATA_TX_LVL_1_221_V (0x1d << 2) | ||
362 | #define IMX6Q_GPR13_SATA_TX_LVL_1_230_V (0x1e << 2) | ||
363 | #define IMX6Q_GPR13_SATA_TX_LVL_1_240_V (0x1f << 2) | ||
364 | #define IMX6Q_GPR13_SATA_MPLL_CLK_EN BIT(1) | ||
365 | #define IMX6Q_GPR13_SATA_TX_EDGE_RATE BIT(0) | ||
319 | #endif /* __LINUX_IMX6Q_IOMUXC_GPR_H */ | 366 | #endif /* __LINUX_IMX6Q_IOMUXC_GPR_H */ |
diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h index c79ad5d2f271..db1791bb997a 100644 --- a/include/linux/mfd/ti_am335x_tscadc.h +++ b/include/linux/mfd/ti_am335x_tscadc.h | |||
@@ -30,8 +30,8 @@ | |||
30 | #define REG_IDLECONFIG 0x058 | 30 | #define REG_IDLECONFIG 0x058 |
31 | #define REG_CHARGECONFIG 0x05C | 31 | #define REG_CHARGECONFIG 0x05C |
32 | #define REG_CHARGEDELAY 0x060 | 32 | #define REG_CHARGEDELAY 0x060 |
33 | #define REG_STEPCONFIG(n) (0x64 + ((n - 1) * 8)) | 33 | #define REG_STEPCONFIG(n) (0x64 + ((n) * 8)) |
34 | #define REG_STEPDELAY(n) (0x68 + ((n - 1) * 8)) | 34 | #define REG_STEPDELAY(n) (0x68 + ((n) * 8)) |
35 | #define REG_FIFO0CNT 0xE4 | 35 | #define REG_FIFO0CNT 0xE4 |
36 | #define REG_FIFO0THR 0xE8 | 36 | #define REG_FIFO0THR 0xE8 |
37 | #define REG_FIFO1CNT 0xF0 | 37 | #define REG_FIFO1CNT 0xF0 |
@@ -46,8 +46,6 @@ | |||
46 | /* Step Enable */ | 46 | /* Step Enable */ |
47 | #define STEPENB_MASK (0x1FFFF << 0) | 47 | #define STEPENB_MASK (0x1FFFF << 0) |
48 | #define STEPENB(val) ((val) << 0) | 48 | #define STEPENB(val) ((val) << 0) |
49 | #define STPENB_STEPENB STEPENB(0x1FFFF) | ||
50 | #define STPENB_STEPENB_TC STEPENB(0x1FFF) | ||
51 | 49 | ||
52 | /* IRQ enable */ | 50 | /* IRQ enable */ |
53 | #define IRQENB_HW_PEN BIT(0) | 51 | #define IRQENB_HW_PEN BIT(0) |
@@ -73,8 +71,6 @@ | |||
73 | #define STEPCONFIG_INM_ADCREFM STEPCONFIG_INM(8) | 71 | #define STEPCONFIG_INM_ADCREFM STEPCONFIG_INM(8) |
74 | #define STEPCONFIG_INP_MASK (0xF << 19) | 72 | #define STEPCONFIG_INP_MASK (0xF << 19) |
75 | #define STEPCONFIG_INP(val) ((val) << 19) | 73 | #define STEPCONFIG_INP(val) ((val) << 19) |
76 | #define STEPCONFIG_INP_AN2 STEPCONFIG_INP(2) | ||
77 | #define STEPCONFIG_INP_AN3 STEPCONFIG_INP(3) | ||
78 | #define STEPCONFIG_INP_AN4 STEPCONFIG_INP(4) | 74 | #define STEPCONFIG_INP_AN4 STEPCONFIG_INP(4) |
79 | #define STEPCONFIG_INP_ADCREFM STEPCONFIG_INP(8) | 75 | #define STEPCONFIG_INP_ADCREFM STEPCONFIG_INP(8) |
80 | #define STEPCONFIG_FIFO1 BIT(26) | 76 | #define STEPCONFIG_FIFO1 BIT(26) |
@@ -96,7 +92,6 @@ | |||
96 | #define STEPCHARGE_INM_AN1 STEPCHARGE_INM(1) | 92 | #define STEPCHARGE_INM_AN1 STEPCHARGE_INM(1) |
97 | #define STEPCHARGE_INP_MASK (0xF << 19) | 93 | #define STEPCHARGE_INP_MASK (0xF << 19) |
98 | #define STEPCHARGE_INP(val) ((val) << 19) | 94 | #define STEPCHARGE_INP(val) ((val) << 19) |
99 | #define STEPCHARGE_INP_AN1 STEPCHARGE_INP(1) | ||
100 | #define STEPCHARGE_RFM_MASK (3 << 23) | 95 | #define STEPCHARGE_RFM_MASK (3 << 23) |
101 | #define STEPCHARGE_RFM(val) ((val) << 23) | 96 | #define STEPCHARGE_RFM(val) ((val) << 23) |
102 | #define STEPCHARGE_RFM_XNUR STEPCHARGE_RFM(1) | 97 | #define STEPCHARGE_RFM_XNUR STEPCHARGE_RFM(1) |
@@ -118,29 +113,40 @@ | |||
118 | #define CNTRLREG_8WIRE CNTRLREG_AFE_CTRL(3) | 113 | #define CNTRLREG_8WIRE CNTRLREG_AFE_CTRL(3) |
119 | #define CNTRLREG_TSCENB BIT(7) | 114 | #define CNTRLREG_TSCENB BIT(7) |
120 | 115 | ||
116 | /* FIFO READ Register */ | ||
117 | #define FIFOREAD_DATA_MASK (0xfff << 0) | ||
118 | #define FIFOREAD_CHNLID_MASK (0xf << 16) | ||
119 | |||
120 | /* Sequencer Status */ | ||
121 | #define SEQ_STATUS BIT(5) | ||
122 | |||
121 | #define ADC_CLK 3000000 | 123 | #define ADC_CLK 3000000 |
122 | #define MAX_CLK_DIV 7 | 124 | #define MAX_CLK_DIV 7 |
123 | #define TOTAL_STEPS 16 | 125 | #define TOTAL_STEPS 16 |
124 | #define TOTAL_CHANNELS 8 | 126 | #define TOTAL_CHANNELS 8 |
125 | 127 | ||
126 | #define TSCADC_CELLS 2 | 128 | /* |
127 | 129 | * ADC runs at 3MHz, and it takes | |
128 | enum tscadc_cells { | 130 | * 15 cycles to latch one data output. |
129 | TSC_CELL, | 131 | * Hence the idle time for ADC to |
130 | ADC_CELL, | 132 | * process one sample data would be |
131 | }; | 133 | * around 5 micro seconds. |
134 | */ | ||
135 | #define IDLE_TIMEOUT 5 /* microsec */ | ||
132 | 136 | ||
133 | struct mfd_tscadc_board { | 137 | #define TSCADC_CELLS 2 |
134 | struct tsc_data *tsc_init; | ||
135 | struct adc_data *adc_init; | ||
136 | }; | ||
137 | 138 | ||
138 | struct ti_tscadc_dev { | 139 | struct ti_tscadc_dev { |
139 | struct device *dev; | 140 | struct device *dev; |
140 | struct regmap *regmap_tscadc; | 141 | struct regmap *regmap_tscadc; |
141 | void __iomem *tscadc_base; | 142 | void __iomem *tscadc_base; |
142 | int irq; | 143 | int irq; |
144 | int used_cells; /* 1-2 */ | ||
145 | int tsc_cell; /* -1 if not used */ | ||
146 | int adc_cell; /* -1 if not used */ | ||
143 | struct mfd_cell cells[TSCADC_CELLS]; | 147 | struct mfd_cell cells[TSCADC_CELLS]; |
148 | u32 reg_se_cache; | ||
149 | spinlock_t reg_lock; | ||
144 | 150 | ||
145 | /* tsc device */ | 151 | /* tsc device */ |
146 | struct titsc *tsc; | 152 | struct titsc *tsc; |
@@ -149,4 +155,15 @@ struct ti_tscadc_dev { | |||
149 | struct adc_device *adc; | 155 | struct adc_device *adc; |
150 | }; | 156 | }; |
151 | 157 | ||
158 | static inline struct ti_tscadc_dev *ti_tscadc_dev_get(struct platform_device *p) | ||
159 | { | ||
160 | struct ti_tscadc_dev **tscadc_dev = p->dev.platform_data; | ||
161 | |||
162 | return *tscadc_dev; | ||
163 | } | ||
164 | |||
165 | void am335x_tsc_se_update(struct ti_tscadc_dev *tsadc); | ||
166 | void am335x_tsc_se_set(struct ti_tscadc_dev *tsadc, u32 val); | ||
167 | void am335x_tsc_se_clr(struct ti_tscadc_dev *tsadc, u32 val); | ||
168 | |||
152 | #endif | 169 | #endif |
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index 99bf3e665997..ce3511326f80 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h | |||
@@ -81,10 +81,15 @@ int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); | |||
81 | void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state); | 81 | void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state); |
82 | void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state); | 82 | void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state); |
83 | 83 | ||
84 | struct dma_chan; | ||
85 | |||
84 | struct tmio_mmc_dma { | 86 | struct tmio_mmc_dma { |
85 | void *chan_priv_tx; | 87 | void *chan_priv_tx; |
86 | void *chan_priv_rx; | 88 | void *chan_priv_rx; |
89 | int slave_id_tx; | ||
90 | int slave_id_rx; | ||
87 | int alignment_shift; | 91 | int alignment_shift; |
92 | bool (*filter)(struct dma_chan *chan, void *arg); | ||
88 | }; | 93 | }; |
89 | 94 | ||
90 | struct tmio_mmc_host; | 95 | struct tmio_mmc_host; |
diff --git a/include/linux/mfd/tps6507x.h b/include/linux/mfd/tps6507x.h index c923e4864f55..c2ae56933539 100644 --- a/include/linux/mfd/tps6507x.h +++ b/include/linux/mfd/tps6507x.h | |||
@@ -163,7 +163,6 @@ struct tps6507x_dev { | |||
163 | 163 | ||
164 | /* Client devices */ | 164 | /* Client devices */ |
165 | struct tps6507x_pmic *pmic; | 165 | struct tps6507x_pmic *pmic; |
166 | struct tps6507x_ts *ts; | ||
167 | }; | 166 | }; |
168 | 167 | ||
169 | #endif /* __LINUX_MFD_TPS6507X_H */ | 168 | #endif /* __LINUX_MFD_TPS6507X_H */ |
diff --git a/include/linux/mfd/twl6040.h b/include/linux/mfd/twl6040.h index 94ac944d12f0..7e7fbce7a308 100644 --- a/include/linux/mfd/twl6040.h +++ b/include/linux/mfd/twl6040.h | |||
@@ -125,8 +125,15 @@ | |||
125 | 125 | ||
126 | #define TWL6040_HSDACENA (1 << 0) | 126 | #define TWL6040_HSDACENA (1 << 0) |
127 | #define TWL6040_HSDACMODE (1 << 1) | 127 | #define TWL6040_HSDACMODE (1 << 1) |
128 | #define TWL6040_HSDRVENA (1 << 2) | ||
128 | #define TWL6040_HSDRVMODE (1 << 3) | 129 | #define TWL6040_HSDRVMODE (1 << 3) |
129 | 130 | ||
131 | /* HFLCTL/R (0x14/0x16) fields */ | ||
132 | |||
133 | #define TWL6040_HFDACENA (1 << 0) | ||
134 | #define TWL6040_HFPGAENA (1 << 1) | ||
135 | #define TWL6040_HFDRVENA (1 << 4) | ||
136 | |||
130 | /* VIBCTLL/R (0x18/0x1A) fields */ | 137 | /* VIBCTLL/R (0x18/0x1A) fields */ |
131 | 138 | ||
132 | #define TWL6040_VIBENA (1 << 0) | 139 | #define TWL6040_VIBENA (1 << 0) |
diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h index ae5c249530b4..40854ac0ba3d 100644 --- a/include/linux/mfd/wm8994/core.h +++ b/include/linux/mfd/wm8994/core.h | |||
@@ -29,6 +29,7 @@ enum wm8994_type { | |||
29 | 29 | ||
30 | struct regulator_dev; | 30 | struct regulator_dev; |
31 | struct regulator_bulk_data; | 31 | struct regulator_bulk_data; |
32 | struct irq_domain; | ||
32 | 33 | ||
33 | #define WM8994_NUM_GPIO_REGS 11 | 34 | #define WM8994_NUM_GPIO_REGS 11 |
34 | #define WM8994_NUM_LDO_REGS 2 | 35 | #define WM8994_NUM_LDO_REGS 2 |
@@ -73,6 +74,7 @@ struct wm8994 { | |||
73 | 74 | ||
74 | int irq; | 75 | int irq; |
75 | struct regmap_irq_chip_data *irq_data; | 76 | struct regmap_irq_chip_data *irq_data; |
77 | struct irq_domain *edge_irq; | ||
76 | 78 | ||
77 | /* Used over suspend/resume */ | 79 | /* Used over suspend/resume */ |
78 | bool suspended; | 80 | bool suspended; |
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h index 68e776594889..90c60524a496 100644 --- a/include/linux/mfd/wm8994/pdata.h +++ b/include/linux/mfd/wm8994/pdata.h | |||
@@ -182,6 +182,11 @@ struct wm8994_pdata { | |||
182 | */ | 182 | */ |
183 | int micdet_delay; | 183 | int micdet_delay; |
184 | 184 | ||
185 | /* Delay between microphone detect completing and reporting on | ||
186 | * insert (specified in ms) | ||
187 | */ | ||
188 | int mic_id_delay; | ||
189 | |||
185 | /* IRQ for microphone detection if brought out directly as a | 190 | /* IRQ for microphone detection if brought out directly as a |
186 | * signal. | 191 | * signal. |
187 | */ | 192 | */ |
@@ -223,6 +228,11 @@ struct wm8994_pdata { | |||
223 | * lines is mastered. | 228 | * lines is mastered. |
224 | */ | 229 | */ |
225 | int max_channels_clocked[WM8994_NUM_AIF]; | 230 | int max_channels_clocked[WM8994_NUM_AIF]; |
231 | |||
232 | /** | ||
233 | * GPIO for the IRQ pin if host only supports edge triggering | ||
234 | */ | ||
235 | int irq_gpio; | ||
226 | }; | 236 | }; |
227 | 237 | ||
228 | #endif | 238 | #endif |
diff --git a/include/linux/mfd/wm8994/registers.h b/include/linux/mfd/wm8994/registers.h index 053548961c15..db8cef3d5321 100644 --- a/include/linux/mfd/wm8994/registers.h +++ b/include/linux/mfd/wm8994/registers.h | |||
@@ -2668,6 +2668,10 @@ | |||
2668 | /* | 2668 | /* |
2669 | * R772 (0x304) - AIF1ADC LRCLK | 2669 | * R772 (0x304) - AIF1ADC LRCLK |
2670 | */ | 2670 | */ |
2671 | #define WM8958_AIF1_LRCLK_INV 0x1000 /* AIF1_LRCLK_INV */ | ||
2672 | #define WM8958_AIF1_LRCLK_INV_MASK 0x1000 /* AIF1_LRCLK_INV */ | ||
2673 | #define WM8958_AIF1_LRCLK_INV_SHIFT 12 /* AIF1_LRCLK_INV */ | ||
2674 | #define WM8958_AIF1_LRCLK_INV_WIDTH 1 /* AIF1_LRCLK_INV */ | ||
2671 | #define WM8994_AIF1ADC_LRCLK_DIR 0x0800 /* AIF1ADC_LRCLK_DIR */ | 2675 | #define WM8994_AIF1ADC_LRCLK_DIR 0x0800 /* AIF1ADC_LRCLK_DIR */ |
2672 | #define WM8994_AIF1ADC_LRCLK_DIR_MASK 0x0800 /* AIF1ADC_LRCLK_DIR */ | 2676 | #define WM8994_AIF1ADC_LRCLK_DIR_MASK 0x0800 /* AIF1ADC_LRCLK_DIR */ |
2673 | #define WM8994_AIF1ADC_LRCLK_DIR_SHIFT 11 /* AIF1ADC_LRCLK_DIR */ | 2677 | #define WM8994_AIF1ADC_LRCLK_DIR_SHIFT 11 /* AIF1ADC_LRCLK_DIR */ |
@@ -2679,6 +2683,10 @@ | |||
2679 | /* | 2683 | /* |
2680 | * R773 (0x305) - AIF1DAC LRCLK | 2684 | * R773 (0x305) - AIF1DAC LRCLK |
2681 | */ | 2685 | */ |
2686 | #define WM8958_AIF1_LRCLK_INV 0x1000 /* AIF1_LRCLK_INV */ | ||
2687 | #define WM8958_AIF1_LRCLK_INV_MASK 0x1000 /* AIF1_LRCLK_INV */ | ||
2688 | #define WM8958_AIF1_LRCLK_INV_SHIFT 12 /* AIF1_LRCLK_INV */ | ||
2689 | #define WM8958_AIF1_LRCLK_INV_WIDTH 1 /* AIF1_LRCLK_INV */ | ||
2682 | #define WM8994_AIF1DAC_LRCLK_DIR 0x0800 /* AIF1DAC_LRCLK_DIR */ | 2690 | #define WM8994_AIF1DAC_LRCLK_DIR 0x0800 /* AIF1DAC_LRCLK_DIR */ |
2683 | #define WM8994_AIF1DAC_LRCLK_DIR_MASK 0x0800 /* AIF1DAC_LRCLK_DIR */ | 2691 | #define WM8994_AIF1DAC_LRCLK_DIR_MASK 0x0800 /* AIF1DAC_LRCLK_DIR */ |
2684 | #define WM8994_AIF1DAC_LRCLK_DIR_SHIFT 11 /* AIF1DAC_LRCLK_DIR */ | 2692 | #define WM8994_AIF1DAC_LRCLK_DIR_SHIFT 11 /* AIF1DAC_LRCLK_DIR */ |
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h index adf6e0648f20..bb1c8096a7eb 100644 --- a/include/linux/mlx4/cmd.h +++ b/include/linux/mlx4/cmd.h | |||
@@ -111,6 +111,7 @@ enum { | |||
111 | MLX4_CMD_INIT2INIT_QP = 0x2d, | 111 | MLX4_CMD_INIT2INIT_QP = 0x2d, |
112 | MLX4_CMD_SUSPEND_QP = 0x32, | 112 | MLX4_CMD_SUSPEND_QP = 0x32, |
113 | MLX4_CMD_UNSUSPEND_QP = 0x33, | 113 | MLX4_CMD_UNSUSPEND_QP = 0x33, |
114 | MLX4_CMD_UPDATE_QP = 0x61, | ||
114 | /* special QP and management commands */ | 115 | /* special QP and management commands */ |
115 | MLX4_CMD_CONF_SPECIAL_QP = 0x23, | 116 | MLX4_CMD_CONF_SPECIAL_QP = 0x23, |
116 | MLX4_CMD_MAD_IFC = 0x24, | 117 | MLX4_CMD_MAD_IFC = 0x24, |
@@ -237,7 +238,7 @@ int mlx4_set_vf_mac(struct mlx4_dev *dev, int port, int vf, u64 mac); | |||
237 | int mlx4_set_vf_vlan(struct mlx4_dev *dev, int port, int vf, u16 vlan, u8 qos); | 238 | int mlx4_set_vf_vlan(struct mlx4_dev *dev, int port, int vf, u16 vlan, u8 qos); |
238 | int mlx4_set_vf_spoofchk(struct mlx4_dev *dev, int port, int vf, bool setting); | 239 | int mlx4_set_vf_spoofchk(struct mlx4_dev *dev, int port, int vf, bool setting); |
239 | int mlx4_get_vf_config(struct mlx4_dev *dev, int port, int vf, struct ifla_vf_info *ivf); | 240 | int mlx4_get_vf_config(struct mlx4_dev *dev, int port, int vf, struct ifla_vf_info *ivf); |
240 | 241 | int mlx4_set_vf_link_state(struct mlx4_dev *dev, int port, int vf, int link_state); | |
241 | 242 | ||
242 | #define MLX4_COMM_GET_IF_REV(cmd_chan_ver) (u8)((cmd_chan_ver) >> 8) | 243 | #define MLX4_COMM_GET_IF_REV(cmd_chan_ver) (u8)((cmd_chan_ver) >> 8) |
243 | 244 | ||
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index a51b0134ce18..52c23a892bab 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -157,7 +157,8 @@ enum { | |||
157 | MLX4_DEV_CAP_FLAGS2_REASSIGN_MAC_EN = 1LL << 4, | 157 | MLX4_DEV_CAP_FLAGS2_REASSIGN_MAC_EN = 1LL << 4, |
158 | MLX4_DEV_CAP_FLAG2_TS = 1LL << 5, | 158 | MLX4_DEV_CAP_FLAG2_TS = 1LL << 5, |
159 | MLX4_DEV_CAP_FLAG2_VLAN_CONTROL = 1LL << 6, | 159 | MLX4_DEV_CAP_FLAG2_VLAN_CONTROL = 1LL << 6, |
160 | MLX4_DEV_CAP_FLAG2_FSM = 1LL << 7 | 160 | MLX4_DEV_CAP_FLAG2_FSM = 1LL << 7, |
161 | MLX4_DEV_CAP_FLAG2_UPDATE_QP = 1LL << 8 | ||
161 | }; | 162 | }; |
162 | 163 | ||
163 | enum { | 164 | enum { |
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h index 352eec9df1b8..262deac02c9e 100644 --- a/include/linux/mlx4/qp.h +++ b/include/linux/mlx4/qp.h | |||
@@ -152,6 +152,8 @@ enum { /* fl */ | |||
152 | }; | 152 | }; |
153 | enum { /* vlan_control */ | 153 | enum { /* vlan_control */ |
154 | MLX4_VLAN_CTRL_ETH_TX_BLOCK_TAGGED = 1 << 6, | 154 | MLX4_VLAN_CTRL_ETH_TX_BLOCK_TAGGED = 1 << 6, |
155 | MLX4_VLAN_CTRL_ETH_TX_BLOCK_PRIO_TAGGED = 1 << 5, /* 802.1p priority tag */ | ||
156 | MLX4_VLAN_CTRL_ETH_TX_BLOCK_UNTAGGED = 1 << 4, | ||
155 | MLX4_VLAN_CTRL_ETH_RX_BLOCK_TAGGED = 1 << 2, | 157 | MLX4_VLAN_CTRL_ETH_RX_BLOCK_TAGGED = 1 << 2, |
156 | MLX4_VLAN_CTRL_ETH_RX_BLOCK_PRIO_TAGGED = 1 << 1, /* 802.1p priority tag */ | 158 | MLX4_VLAN_CTRL_ETH_RX_BLOCK_PRIO_TAGGED = 1 << 1, /* 802.1p priority tag */ |
157 | MLX4_VLAN_CTRL_ETH_RX_BLOCK_UNTAGGED = 1 << 0 | 159 | MLX4_VLAN_CTRL_ETH_RX_BLOCK_UNTAGGED = 1 << 0 |
@@ -206,6 +208,40 @@ struct mlx4_qp_context { | |||
206 | u32 reserved5[10]; | 208 | u32 reserved5[10]; |
207 | }; | 209 | }; |
208 | 210 | ||
211 | struct mlx4_update_qp_context { | ||
212 | __be64 qp_mask; | ||
213 | __be64 primary_addr_path_mask; | ||
214 | __be64 secondary_addr_path_mask; | ||
215 | u64 reserved1; | ||
216 | struct mlx4_qp_context qp_context; | ||
217 | u64 reserved2[58]; | ||
218 | }; | ||
219 | |||
220 | enum { | ||
221 | MLX4_UPD_QP_MASK_PM_STATE = 32, | ||
222 | MLX4_UPD_QP_MASK_VSD = 33, | ||
223 | }; | ||
224 | |||
225 | enum { | ||
226 | MLX4_UPD_QP_PATH_MASK_PKEY_INDEX = 0 + 32, | ||
227 | MLX4_UPD_QP_PATH_MASK_FSM = 1 + 32, | ||
228 | MLX4_UPD_QP_PATH_MASK_MAC_INDEX = 2 + 32, | ||
229 | MLX4_UPD_QP_PATH_MASK_FVL = 3 + 32, | ||
230 | MLX4_UPD_QP_PATH_MASK_CV = 4 + 32, | ||
231 | MLX4_UPD_QP_PATH_MASK_VLAN_INDEX = 5 + 32, | ||
232 | MLX4_UPD_QP_PATH_MASK_ETH_HIDE_CQE_VLAN = 6 + 32, | ||
233 | MLX4_UPD_QP_PATH_MASK_ETH_TX_BLOCK_UNTAGGED = 7 + 32, | ||
234 | MLX4_UPD_QP_PATH_MASK_ETH_TX_BLOCK_1P = 8 + 32, | ||
235 | MLX4_UPD_QP_PATH_MASK_ETH_TX_BLOCK_TAGGED = 9 + 32, | ||
236 | MLX4_UPD_QP_PATH_MASK_ETH_RX_BLOCK_UNTAGGED = 10 + 32, | ||
237 | MLX4_UPD_QP_PATH_MASK_ETH_RX_BLOCK_1P = 11 + 32, | ||
238 | MLX4_UPD_QP_PATH_MASK_ETH_RX_BLOCK_TAGGED = 12 + 32, | ||
239 | MLX4_UPD_QP_PATH_MASK_FEUP = 13 + 32, | ||
240 | MLX4_UPD_QP_PATH_MASK_SCHED_QUEUE = 14 + 32, | ||
241 | MLX4_UPD_QP_PATH_MASK_IF_COUNTER_INDEX = 15 + 32, | ||
242 | MLX4_UPD_QP_PATH_MASK_FVL_RX = 16 + 32, | ||
243 | }; | ||
244 | |||
209 | enum { /* param3 */ | 245 | enum { /* param3 */ |
210 | MLX4_STRIP_VLAN = 1 << 30 | 246 | MLX4_STRIP_VLAN = 1 << 30 |
211 | }; | 247 | }; |
diff --git a/include/linux/mlx5/cmd.h b/include/linux/mlx5/cmd.h new file mode 100644 index 000000000000..2826a4b6071e --- /dev/null +++ b/include/linux/mlx5/cmd.h | |||
@@ -0,0 +1,51 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2013, Mellanox Technologies inc. All rights reserved. | ||
3 | * | ||
4 | * This software is available to you under a choice of one of two | ||
5 | * licenses. You may choose to be licensed under the terms of the GNU | ||
6 | * General Public License (GPL) Version 2, available from the file | ||
7 | * COPYING in the main directory of this source tree, or the | ||
8 | * OpenIB.org BSD license below: | ||
9 | * | ||
10 | * Redistribution and use in source and binary forms, with or | ||
11 | * without modification, are permitted provided that the following | ||
12 | * conditions are met: | ||
13 | * | ||
14 | * - Redistributions of source code must retain the above | ||
15 | * copyright notice, this list of conditions and the following | ||
16 | * disclaimer. | ||
17 | * | ||
18 | * - Redistributions in binary form must reproduce the above | ||
19 | * copyright notice, this list of conditions and the following | ||
20 | * disclaimer in the documentation and/or other materials | ||
21 | * provided with the distribution. | ||
22 | * | ||
23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
25 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
27 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
28 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
30 | * SOFTWARE. | ||
31 | */ | ||
32 | |||
33 | #ifndef MLX5_CMD_H | ||
34 | #define MLX5_CMD_H | ||
35 | |||
36 | #include <linux/types.h> | ||
37 | |||
38 | struct manage_pages_layout { | ||
39 | u64 ptr; | ||
40 | u32 reserved; | ||
41 | u16 num_entries; | ||
42 | u16 func_id; | ||
43 | }; | ||
44 | |||
45 | |||
46 | struct mlx5_cmd_alloc_uar_imm_out { | ||
47 | u32 rsvd[3]; | ||
48 | u32 uarn; | ||
49 | }; | ||
50 | |||
51 | #endif /* MLX5_CMD_H */ | ||
diff --git a/include/linux/mlx5/cq.h b/include/linux/mlx5/cq.h new file mode 100644 index 000000000000..3db67f73d96d --- /dev/null +++ b/include/linux/mlx5/cq.h | |||
@@ -0,0 +1,165 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2013, Mellanox Technologies inc. All rights reserved. | ||
3 | * | ||
4 | * This software is available to you under a choice of one of two | ||
5 | * licenses. You may choose to be licensed under the terms of the GNU | ||
6 | * General Public License (GPL) Version 2, available from the file | ||
7 | * COPYING in the main directory of this source tree, or the | ||
8 | * OpenIB.org BSD license below: | ||
9 | * | ||
10 | * Redistribution and use in source and binary forms, with or | ||
11 | * without modification, are permitted provided that the following | ||
12 | * conditions are met: | ||
13 | * | ||
14 | * - Redistributions of source code must retain the above | ||
15 | * copyright notice, this list of conditions and the following | ||
16 | * disclaimer. | ||
17 | * | ||
18 | * - Redistributions in binary form must reproduce the above | ||
19 | * copyright notice, this list of conditions and the following | ||
20 | * disclaimer in the documentation and/or other materials | ||
21 | * provided with the distribution. | ||
22 | * | ||
23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
25 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
27 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
28 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
30 | * SOFTWARE. | ||
31 | */ | ||
32 | |||
33 | #ifndef MLX5_CORE_CQ_H | ||
34 | #define MLX5_CORE_CQ_H | ||
35 | |||
36 | #include <rdma/ib_verbs.h> | ||
37 | #include <linux/mlx5/driver.h> | ||
38 | |||
39 | |||
40 | struct mlx5_core_cq { | ||
41 | u32 cqn; | ||
42 | int cqe_sz; | ||
43 | __be32 *set_ci_db; | ||
44 | __be32 *arm_db; | ||
45 | atomic_t refcount; | ||
46 | struct completion free; | ||
47 | unsigned vector; | ||
48 | int irqn; | ||
49 | void (*comp) (struct mlx5_core_cq *); | ||
50 | void (*event) (struct mlx5_core_cq *, enum mlx5_event); | ||
51 | struct mlx5_uar *uar; | ||
52 | u32 cons_index; | ||
53 | unsigned arm_sn; | ||
54 | struct mlx5_rsc_debug *dbg; | ||
55 | int pid; | ||
56 | }; | ||
57 | |||
58 | |||
59 | enum { | ||
60 | MLX5_CQE_SYNDROME_LOCAL_LENGTH_ERR = 0x01, | ||
61 | MLX5_CQE_SYNDROME_LOCAL_QP_OP_ERR = 0x02, | ||
62 | MLX5_CQE_SYNDROME_LOCAL_PROT_ERR = 0x04, | ||
63 | MLX5_CQE_SYNDROME_WR_FLUSH_ERR = 0x05, | ||
64 | MLX5_CQE_SYNDROME_MW_BIND_ERR = 0x06, | ||
65 | MLX5_CQE_SYNDROME_BAD_RESP_ERR = 0x10, | ||
66 | MLX5_CQE_SYNDROME_LOCAL_ACCESS_ERR = 0x11, | ||
67 | MLX5_CQE_SYNDROME_REMOTE_INVAL_REQ_ERR = 0x12, | ||
68 | MLX5_CQE_SYNDROME_REMOTE_ACCESS_ERR = 0x13, | ||
69 | MLX5_CQE_SYNDROME_REMOTE_OP_ERR = 0x14, | ||
70 | MLX5_CQE_SYNDROME_TRANSPORT_RETRY_EXC_ERR = 0x15, | ||
71 | MLX5_CQE_SYNDROME_RNR_RETRY_EXC_ERR = 0x16, | ||
72 | MLX5_CQE_SYNDROME_REMOTE_ABORTED_ERR = 0x22, | ||
73 | }; | ||
74 | |||
75 | enum { | ||
76 | MLX5_CQE_OWNER_MASK = 1, | ||
77 | MLX5_CQE_REQ = 0, | ||
78 | MLX5_CQE_RESP_WR_IMM = 1, | ||
79 | MLX5_CQE_RESP_SEND = 2, | ||
80 | MLX5_CQE_RESP_SEND_IMM = 3, | ||
81 | MLX5_CQE_RESP_SEND_INV = 4, | ||
82 | MLX5_CQE_RESIZE_CQ = 0xff, /* TBD */ | ||
83 | MLX5_CQE_REQ_ERR = 13, | ||
84 | MLX5_CQE_RESP_ERR = 14, | ||
85 | }; | ||
86 | |||
87 | enum { | ||
88 | MLX5_CQ_MODIFY_RESEIZE = 0, | ||
89 | MLX5_CQ_MODIFY_MODER = 1, | ||
90 | MLX5_CQ_MODIFY_MAPPING = 2, | ||
91 | }; | ||
92 | |||
93 | struct mlx5_cq_modify_params { | ||
94 | int type; | ||
95 | union { | ||
96 | struct { | ||
97 | u32 page_offset; | ||
98 | u8 log_cq_size; | ||
99 | } resize; | ||
100 | |||
101 | struct { | ||
102 | } moder; | ||
103 | |||
104 | struct { | ||
105 | } mapping; | ||
106 | } params; | ||
107 | }; | ||
108 | |||
109 | enum { | ||
110 | CQE_SIZE_64 = 0, | ||
111 | CQE_SIZE_128 = 1, | ||
112 | }; | ||
113 | |||
114 | static inline int cqe_sz_to_mlx_sz(u8 size) | ||
115 | { | ||
116 | return size == 64 ? CQE_SIZE_64 : CQE_SIZE_128; | ||
117 | } | ||
118 | |||
119 | static inline void mlx5_cq_set_ci(struct mlx5_core_cq *cq) | ||
120 | { | ||
121 | *cq->set_ci_db = cpu_to_be32(cq->cons_index & 0xffffff); | ||
122 | } | ||
123 | |||
124 | enum { | ||
125 | MLX5_CQ_DB_REQ_NOT_SOL = 1 << 24, | ||
126 | MLX5_CQ_DB_REQ_NOT = 0 << 24 | ||
127 | }; | ||
128 | |||
129 | static inline void mlx5_cq_arm(struct mlx5_core_cq *cq, u32 cmd, | ||
130 | void __iomem *uar_page, | ||
131 | spinlock_t *doorbell_lock) | ||
132 | { | ||
133 | __be32 doorbell[2]; | ||
134 | u32 sn; | ||
135 | u32 ci; | ||
136 | |||
137 | sn = cq->arm_sn & 3; | ||
138 | ci = cq->cons_index & 0xffffff; | ||
139 | |||
140 | *cq->arm_db = cpu_to_be32(sn << 28 | cmd | ci); | ||
141 | |||
142 | /* Make sure that the doorbell record in host memory is | ||
143 | * written before ringing the doorbell via PCI MMIO. | ||
144 | */ | ||
145 | wmb(); | ||
146 | |||
147 | doorbell[0] = cpu_to_be32(sn << 28 | cmd | ci); | ||
148 | doorbell[1] = cpu_to_be32(cq->cqn); | ||
149 | |||
150 | mlx5_write64(doorbell, uar_page + MLX5_CQ_DOORBELL, doorbell_lock); | ||
151 | } | ||
152 | |||
153 | int mlx5_init_cq_table(struct mlx5_core_dev *dev); | ||
154 | void mlx5_cleanup_cq_table(struct mlx5_core_dev *dev); | ||
155 | int mlx5_core_create_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, | ||
156 | struct mlx5_create_cq_mbox_in *in, int inlen); | ||
157 | int mlx5_core_destroy_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); | ||
158 | int mlx5_core_query_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, | ||
159 | struct mlx5_query_cq_mbox_out *out); | ||
160 | int mlx5_core_modify_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, | ||
161 | int type, struct mlx5_cq_modify_params *params); | ||
162 | int mlx5_debug_cq_add(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); | ||
163 | void mlx5_debug_cq_remove(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); | ||
164 | |||
165 | #endif /* MLX5_CORE_CQ_H */ | ||
diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h new file mode 100644 index 000000000000..737685e9e852 --- /dev/null +++ b/include/linux/mlx5/device.h | |||
@@ -0,0 +1,913 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2013, Mellanox Technologies inc. All rights reserved. | ||
3 | * | ||
4 | * This software is available to you under a choice of one of two | ||
5 | * licenses. You may choose to be licensed under the terms of the GNU | ||
6 | * General Public License (GPL) Version 2, available from the file | ||
7 | * COPYING in the main directory of this source tree, or the | ||
8 | * OpenIB.org BSD license below: | ||
9 | * | ||
10 | * Redistribution and use in source and binary forms, with or | ||
11 | * without modification, are permitted provided that the following | ||
12 | * conditions are met: | ||
13 | * | ||
14 | * - Redistributions of source code must retain the above | ||
15 | * copyright notice, this list of conditions and the following | ||
16 | * disclaimer. | ||
17 | * | ||
18 | * - Redistributions in binary form must reproduce the above | ||
19 | * copyright notice, this list of conditions and the following | ||
20 | * disclaimer in the documentation and/or other materials | ||
21 | * provided with the distribution. | ||
22 | * | ||
23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
25 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
27 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
28 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
30 | * SOFTWARE. | ||
31 | */ | ||
32 | |||
33 | #ifndef MLX5_DEVICE_H | ||
34 | #define MLX5_DEVICE_H | ||
35 | |||
36 | #include <linux/types.h> | ||
37 | #include <rdma/ib_verbs.h> | ||
38 | |||
39 | #if defined(__LITTLE_ENDIAN) | ||
40 | #define MLX5_SET_HOST_ENDIANNESS 0 | ||
41 | #elif defined(__BIG_ENDIAN) | ||
42 | #define MLX5_SET_HOST_ENDIANNESS 0x80 | ||
43 | #else | ||
44 | #error Host endianness not defined | ||
45 | #endif | ||
46 | |||
47 | enum { | ||
48 | MLX5_MAX_COMMANDS = 32, | ||
49 | MLX5_CMD_DATA_BLOCK_SIZE = 512, | ||
50 | MLX5_PCI_CMD_XPORT = 7, | ||
51 | }; | ||
52 | |||
53 | enum { | ||
54 | MLX5_EXTENDED_UD_AV = 0x80000000, | ||
55 | }; | ||
56 | |||
57 | enum { | ||
58 | MLX5_CQ_STATE_ARMED = 9, | ||
59 | MLX5_CQ_STATE_ALWAYS_ARMED = 0xb, | ||
60 | MLX5_CQ_STATE_FIRED = 0xa, | ||
61 | }; | ||
62 | |||
63 | enum { | ||
64 | MLX5_STAT_RATE_OFFSET = 5, | ||
65 | }; | ||
66 | |||
67 | enum { | ||
68 | MLX5_INLINE_SEG = 0x80000000, | ||
69 | }; | ||
70 | |||
71 | enum { | ||
72 | MLX5_PERM_LOCAL_READ = 1 << 2, | ||
73 | MLX5_PERM_LOCAL_WRITE = 1 << 3, | ||
74 | MLX5_PERM_REMOTE_READ = 1 << 4, | ||
75 | MLX5_PERM_REMOTE_WRITE = 1 << 5, | ||
76 | MLX5_PERM_ATOMIC = 1 << 6, | ||
77 | MLX5_PERM_UMR_EN = 1 << 7, | ||
78 | }; | ||
79 | |||
80 | enum { | ||
81 | MLX5_PCIE_CTRL_SMALL_FENCE = 1 << 0, | ||
82 | MLX5_PCIE_CTRL_RELAXED_ORDERING = 1 << 2, | ||
83 | MLX5_PCIE_CTRL_NO_SNOOP = 1 << 3, | ||
84 | MLX5_PCIE_CTRL_TLP_PROCE_EN = 1 << 6, | ||
85 | MLX5_PCIE_CTRL_TPH_MASK = 3 << 4, | ||
86 | }; | ||
87 | |||
88 | enum { | ||
89 | MLX5_ACCESS_MODE_PA = 0, | ||
90 | MLX5_ACCESS_MODE_MTT = 1, | ||
91 | MLX5_ACCESS_MODE_KLM = 2 | ||
92 | }; | ||
93 | |||
94 | enum { | ||
95 | MLX5_MKEY_REMOTE_INVAL = 1 << 24, | ||
96 | MLX5_MKEY_FLAG_SYNC_UMR = 1 << 29, | ||
97 | MLX5_MKEY_BSF_EN = 1 << 30, | ||
98 | MLX5_MKEY_LEN64 = 1 << 31, | ||
99 | }; | ||
100 | |||
101 | enum { | ||
102 | MLX5_EN_RD = (u64)1, | ||
103 | MLX5_EN_WR = (u64)2 | ||
104 | }; | ||
105 | |||
106 | enum { | ||
107 | MLX5_BF_REGS_PER_PAGE = 4, | ||
108 | MLX5_MAX_UAR_PAGES = 1 << 8, | ||
109 | MLX5_MAX_UUARS = MLX5_MAX_UAR_PAGES * MLX5_BF_REGS_PER_PAGE, | ||
110 | }; | ||
111 | |||
112 | enum { | ||
113 | MLX5_MKEY_MASK_LEN = 1ull << 0, | ||
114 | MLX5_MKEY_MASK_PAGE_SIZE = 1ull << 1, | ||
115 | MLX5_MKEY_MASK_START_ADDR = 1ull << 6, | ||
116 | MLX5_MKEY_MASK_PD = 1ull << 7, | ||
117 | MLX5_MKEY_MASK_EN_RINVAL = 1ull << 8, | ||
118 | MLX5_MKEY_MASK_BSF_EN = 1ull << 12, | ||
119 | MLX5_MKEY_MASK_KEY = 1ull << 13, | ||
120 | MLX5_MKEY_MASK_QPN = 1ull << 14, | ||
121 | MLX5_MKEY_MASK_LR = 1ull << 17, | ||
122 | MLX5_MKEY_MASK_LW = 1ull << 18, | ||
123 | MLX5_MKEY_MASK_RR = 1ull << 19, | ||
124 | MLX5_MKEY_MASK_RW = 1ull << 20, | ||
125 | MLX5_MKEY_MASK_A = 1ull << 21, | ||
126 | MLX5_MKEY_MASK_SMALL_FENCE = 1ull << 23, | ||
127 | MLX5_MKEY_MASK_FREE = 1ull << 29, | ||
128 | }; | ||
129 | |||
130 | enum mlx5_event { | ||
131 | MLX5_EVENT_TYPE_COMP = 0x0, | ||
132 | |||
133 | MLX5_EVENT_TYPE_PATH_MIG = 0x01, | ||
134 | MLX5_EVENT_TYPE_COMM_EST = 0x02, | ||
135 | MLX5_EVENT_TYPE_SQ_DRAINED = 0x03, | ||
136 | MLX5_EVENT_TYPE_SRQ_LAST_WQE = 0x13, | ||
137 | MLX5_EVENT_TYPE_SRQ_RQ_LIMIT = 0x14, | ||
138 | |||
139 | MLX5_EVENT_TYPE_CQ_ERROR = 0x04, | ||
140 | MLX5_EVENT_TYPE_WQ_CATAS_ERROR = 0x05, | ||
141 | MLX5_EVENT_TYPE_PATH_MIG_FAILED = 0x07, | ||
142 | MLX5_EVENT_TYPE_WQ_INVAL_REQ_ERROR = 0x10, | ||
143 | MLX5_EVENT_TYPE_WQ_ACCESS_ERROR = 0x11, | ||
144 | MLX5_EVENT_TYPE_SRQ_CATAS_ERROR = 0x12, | ||
145 | |||
146 | MLX5_EVENT_TYPE_INTERNAL_ERROR = 0x08, | ||
147 | MLX5_EVENT_TYPE_PORT_CHANGE = 0x09, | ||
148 | MLX5_EVENT_TYPE_GPIO_EVENT = 0x15, | ||
149 | MLX5_EVENT_TYPE_REMOTE_CONFIG = 0x19, | ||
150 | |||
151 | MLX5_EVENT_TYPE_DB_BF_CONGESTION = 0x1a, | ||
152 | MLX5_EVENT_TYPE_STALL_EVENT = 0x1b, | ||
153 | |||
154 | MLX5_EVENT_TYPE_CMD = 0x0a, | ||
155 | MLX5_EVENT_TYPE_PAGE_REQUEST = 0xb, | ||
156 | }; | ||
157 | |||
158 | enum { | ||
159 | MLX5_PORT_CHANGE_SUBTYPE_DOWN = 1, | ||
160 | MLX5_PORT_CHANGE_SUBTYPE_ACTIVE = 4, | ||
161 | MLX5_PORT_CHANGE_SUBTYPE_INITIALIZED = 5, | ||
162 | MLX5_PORT_CHANGE_SUBTYPE_LID = 6, | ||
163 | MLX5_PORT_CHANGE_SUBTYPE_PKEY = 7, | ||
164 | MLX5_PORT_CHANGE_SUBTYPE_GUID = 8, | ||
165 | MLX5_PORT_CHANGE_SUBTYPE_CLIENT_REREG = 9, | ||
166 | }; | ||
167 | |||
168 | enum { | ||
169 | MLX5_DEV_CAP_FLAG_RC = 1LL << 0, | ||
170 | MLX5_DEV_CAP_FLAG_UC = 1LL << 1, | ||
171 | MLX5_DEV_CAP_FLAG_UD = 1LL << 2, | ||
172 | MLX5_DEV_CAP_FLAG_XRC = 1LL << 3, | ||
173 | MLX5_DEV_CAP_FLAG_SRQ = 1LL << 6, | ||
174 | MLX5_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1LL << 8, | ||
175 | MLX5_DEV_CAP_FLAG_BAD_QKEY_CNTR = 1LL << 9, | ||
176 | MLX5_DEV_CAP_FLAG_APM = 1LL << 17, | ||
177 | MLX5_DEV_CAP_FLAG_ATOMIC = 1LL << 18, | ||
178 | MLX5_DEV_CAP_FLAG_ON_DMND_PG = 1LL << 24, | ||
179 | MLX5_DEV_CAP_FLAG_RESIZE_SRQ = 1LL << 32, | ||
180 | MLX5_DEV_CAP_FLAG_REMOTE_FENCE = 1LL << 38, | ||
181 | MLX5_DEV_CAP_FLAG_TLP_HINTS = 1LL << 39, | ||
182 | MLX5_DEV_CAP_FLAG_SIG_HAND_OVER = 1LL << 40, | ||
183 | MLX5_DEV_CAP_FLAG_DCT = 1LL << 41, | ||
184 | MLX5_DEV_CAP_FLAG_CMDIF_CSUM = 1LL << 46, | ||
185 | }; | ||
186 | |||
187 | enum { | ||
188 | MLX5_OPCODE_NOP = 0x00, | ||
189 | MLX5_OPCODE_SEND_INVAL = 0x01, | ||
190 | MLX5_OPCODE_RDMA_WRITE = 0x08, | ||
191 | MLX5_OPCODE_RDMA_WRITE_IMM = 0x09, | ||
192 | MLX5_OPCODE_SEND = 0x0a, | ||
193 | MLX5_OPCODE_SEND_IMM = 0x0b, | ||
194 | MLX5_OPCODE_RDMA_READ = 0x10, | ||
195 | MLX5_OPCODE_ATOMIC_CS = 0x11, | ||
196 | MLX5_OPCODE_ATOMIC_FA = 0x12, | ||
197 | MLX5_OPCODE_ATOMIC_MASKED_CS = 0x14, | ||
198 | MLX5_OPCODE_ATOMIC_MASKED_FA = 0x15, | ||
199 | MLX5_OPCODE_BIND_MW = 0x18, | ||
200 | MLX5_OPCODE_CONFIG_CMD = 0x1f, | ||
201 | |||
202 | MLX5_RECV_OPCODE_RDMA_WRITE_IMM = 0x00, | ||
203 | MLX5_RECV_OPCODE_SEND = 0x01, | ||
204 | MLX5_RECV_OPCODE_SEND_IMM = 0x02, | ||
205 | MLX5_RECV_OPCODE_SEND_INVAL = 0x03, | ||
206 | |||
207 | MLX5_CQE_OPCODE_ERROR = 0x1e, | ||
208 | MLX5_CQE_OPCODE_RESIZE = 0x16, | ||
209 | |||
210 | MLX5_OPCODE_SET_PSV = 0x20, | ||
211 | MLX5_OPCODE_GET_PSV = 0x21, | ||
212 | MLX5_OPCODE_CHECK_PSV = 0x22, | ||
213 | MLX5_OPCODE_RGET_PSV = 0x26, | ||
214 | MLX5_OPCODE_RCHECK_PSV = 0x27, | ||
215 | |||
216 | MLX5_OPCODE_UMR = 0x25, | ||
217 | |||
218 | }; | ||
219 | |||
220 | enum { | ||
221 | MLX5_SET_PORT_RESET_QKEY = 0, | ||
222 | MLX5_SET_PORT_GUID0 = 16, | ||
223 | MLX5_SET_PORT_NODE_GUID = 17, | ||
224 | MLX5_SET_PORT_SYS_GUID = 18, | ||
225 | MLX5_SET_PORT_GID_TABLE = 19, | ||
226 | MLX5_SET_PORT_PKEY_TABLE = 20, | ||
227 | }; | ||
228 | |||
229 | enum { | ||
230 | MLX5_MAX_PAGE_SHIFT = 31 | ||
231 | }; | ||
232 | |||
233 | struct mlx5_inbox_hdr { | ||
234 | __be16 opcode; | ||
235 | u8 rsvd[4]; | ||
236 | __be16 opmod; | ||
237 | }; | ||
238 | |||
239 | struct mlx5_outbox_hdr { | ||
240 | u8 status; | ||
241 | u8 rsvd[3]; | ||
242 | __be32 syndrome; | ||
243 | }; | ||
244 | |||
245 | struct mlx5_cmd_query_adapter_mbox_in { | ||
246 | struct mlx5_inbox_hdr hdr; | ||
247 | u8 rsvd[8]; | ||
248 | }; | ||
249 | |||
250 | struct mlx5_cmd_query_adapter_mbox_out { | ||
251 | struct mlx5_outbox_hdr hdr; | ||
252 | u8 rsvd0[24]; | ||
253 | u8 intapin; | ||
254 | u8 rsvd1[13]; | ||
255 | __be16 vsd_vendor_id; | ||
256 | u8 vsd[208]; | ||
257 | u8 vsd_psid[16]; | ||
258 | }; | ||
259 | |||
260 | struct mlx5_hca_cap { | ||
261 | u8 rsvd1[16]; | ||
262 | u8 log_max_srq_sz; | ||
263 | u8 log_max_qp_sz; | ||
264 | u8 rsvd2; | ||
265 | u8 log_max_qp; | ||
266 | u8 log_max_strq_sz; | ||
267 | u8 log_max_srqs; | ||
268 | u8 rsvd4[2]; | ||
269 | u8 rsvd5; | ||
270 | u8 log_max_cq_sz; | ||
271 | u8 rsvd6; | ||
272 | u8 log_max_cq; | ||
273 | u8 log_max_eq_sz; | ||
274 | u8 log_max_mkey; | ||
275 | u8 rsvd7; | ||
276 | u8 log_max_eq; | ||
277 | u8 max_indirection; | ||
278 | u8 log_max_mrw_sz; | ||
279 | u8 log_max_bsf_list_sz; | ||
280 | u8 log_max_klm_list_sz; | ||
281 | u8 rsvd_8_0; | ||
282 | u8 log_max_ra_req_dc; | ||
283 | u8 rsvd_8_1; | ||
284 | u8 log_max_ra_res_dc; | ||
285 | u8 rsvd9; | ||
286 | u8 log_max_ra_req_qp; | ||
287 | u8 rsvd10; | ||
288 | u8 log_max_ra_res_qp; | ||
289 | u8 rsvd11[4]; | ||
290 | __be16 max_qp_count; | ||
291 | __be16 rsvd12; | ||
292 | u8 rsvd13; | ||
293 | u8 local_ca_ack_delay; | ||
294 | u8 rsvd14; | ||
295 | u8 num_ports; | ||
296 | u8 log_max_msg; | ||
297 | u8 rsvd15[3]; | ||
298 | __be16 stat_rate_support; | ||
299 | u8 rsvd16[2]; | ||
300 | __be64 flags; | ||
301 | u8 rsvd17; | ||
302 | u8 uar_sz; | ||
303 | u8 rsvd18; | ||
304 | u8 log_pg_sz; | ||
305 | __be16 bf_log_bf_reg_size; | ||
306 | u8 rsvd19[4]; | ||
307 | __be16 max_desc_sz_sq; | ||
308 | u8 rsvd20[2]; | ||
309 | __be16 max_desc_sz_rq; | ||
310 | u8 rsvd21[2]; | ||
311 | __be16 max_desc_sz_sq_dc; | ||
312 | u8 rsvd22[4]; | ||
313 | __be16 max_qp_mcg; | ||
314 | u8 rsvd23; | ||
315 | u8 log_max_mcg; | ||
316 | u8 rsvd24; | ||
317 | u8 log_max_pd; | ||
318 | u8 rsvd25; | ||
319 | u8 log_max_xrcd; | ||
320 | u8 rsvd26[42]; | ||
321 | __be16 log_uar_page_sz; | ||
322 | u8 rsvd27[28]; | ||
323 | u8 log_msx_atomic_size_qp; | ||
324 | u8 rsvd28[2]; | ||
325 | u8 log_msx_atomic_size_dc; | ||
326 | u8 rsvd29[76]; | ||
327 | }; | ||
328 | |||
329 | |||
330 | struct mlx5_cmd_query_hca_cap_mbox_in { | ||
331 | struct mlx5_inbox_hdr hdr; | ||
332 | u8 rsvd[8]; | ||
333 | }; | ||
334 | |||
335 | |||
336 | struct mlx5_cmd_query_hca_cap_mbox_out { | ||
337 | struct mlx5_outbox_hdr hdr; | ||
338 | u8 rsvd0[8]; | ||
339 | struct mlx5_hca_cap hca_cap; | ||
340 | }; | ||
341 | |||
342 | |||
343 | struct mlx5_cmd_set_hca_cap_mbox_in { | ||
344 | struct mlx5_inbox_hdr hdr; | ||
345 | u8 rsvd[8]; | ||
346 | struct mlx5_hca_cap hca_cap; | ||
347 | }; | ||
348 | |||
349 | |||
350 | struct mlx5_cmd_set_hca_cap_mbox_out { | ||
351 | struct mlx5_outbox_hdr hdr; | ||
352 | u8 rsvd0[8]; | ||
353 | }; | ||
354 | |||
355 | |||
356 | struct mlx5_cmd_init_hca_mbox_in { | ||
357 | struct mlx5_inbox_hdr hdr; | ||
358 | u8 rsvd0[2]; | ||
359 | __be16 profile; | ||
360 | u8 rsvd1[4]; | ||
361 | }; | ||
362 | |||
363 | struct mlx5_cmd_init_hca_mbox_out { | ||
364 | struct mlx5_outbox_hdr hdr; | ||
365 | u8 rsvd[8]; | ||
366 | }; | ||
367 | |||
368 | struct mlx5_cmd_teardown_hca_mbox_in { | ||
369 | struct mlx5_inbox_hdr hdr; | ||
370 | u8 rsvd0[2]; | ||
371 | __be16 profile; | ||
372 | u8 rsvd1[4]; | ||
373 | }; | ||
374 | |||
375 | struct mlx5_cmd_teardown_hca_mbox_out { | ||
376 | struct mlx5_outbox_hdr hdr; | ||
377 | u8 rsvd[8]; | ||
378 | }; | ||
379 | |||
380 | struct mlx5_cmd_layout { | ||
381 | u8 type; | ||
382 | u8 rsvd0[3]; | ||
383 | __be32 inlen; | ||
384 | __be64 in_ptr; | ||
385 | __be32 in[4]; | ||
386 | __be32 out[4]; | ||
387 | __be64 out_ptr; | ||
388 | __be32 outlen; | ||
389 | u8 token; | ||
390 | u8 sig; | ||
391 | u8 rsvd1; | ||
392 | u8 status_own; | ||
393 | }; | ||
394 | |||
395 | |||
396 | struct health_buffer { | ||
397 | __be32 assert_var[5]; | ||
398 | __be32 rsvd0[3]; | ||
399 | __be32 assert_exit_ptr; | ||
400 | __be32 assert_callra; | ||
401 | __be32 rsvd1[2]; | ||
402 | __be32 fw_ver; | ||
403 | __be32 hw_id; | ||
404 | __be32 rsvd2; | ||
405 | u8 irisc_index; | ||
406 | u8 synd; | ||
407 | __be16 ext_sync; | ||
408 | }; | ||
409 | |||
410 | struct mlx5_init_seg { | ||
411 | __be32 fw_rev; | ||
412 | __be32 cmdif_rev_fw_sub; | ||
413 | __be32 rsvd0[2]; | ||
414 | __be32 cmdq_addr_h; | ||
415 | __be32 cmdq_addr_l_sz; | ||
416 | __be32 cmd_dbell; | ||
417 | __be32 rsvd1[121]; | ||
418 | struct health_buffer health; | ||
419 | __be32 rsvd2[884]; | ||
420 | __be32 health_counter; | ||
421 | __be32 rsvd3[1023]; | ||
422 | __be64 ieee1588_clk; | ||
423 | __be32 ieee1588_clk_type; | ||
424 | __be32 clr_intx; | ||
425 | }; | ||
426 | |||
427 | struct mlx5_eqe_comp { | ||
428 | __be32 reserved[6]; | ||
429 | __be32 cqn; | ||
430 | }; | ||
431 | |||
432 | struct mlx5_eqe_qp_srq { | ||
433 | __be32 reserved[6]; | ||
434 | __be32 qp_srq_n; | ||
435 | }; | ||
436 | |||
437 | struct mlx5_eqe_cq_err { | ||
438 | __be32 cqn; | ||
439 | u8 reserved1[7]; | ||
440 | u8 syndrome; | ||
441 | }; | ||
442 | |||
443 | struct mlx5_eqe_dropped_packet { | ||
444 | }; | ||
445 | |||
446 | struct mlx5_eqe_port_state { | ||
447 | u8 reserved0[8]; | ||
448 | u8 port; | ||
449 | }; | ||
450 | |||
451 | struct mlx5_eqe_gpio { | ||
452 | __be32 reserved0[2]; | ||
453 | __be64 gpio_event; | ||
454 | }; | ||
455 | |||
456 | struct mlx5_eqe_congestion { | ||
457 | u8 type; | ||
458 | u8 rsvd0; | ||
459 | u8 congestion_level; | ||
460 | }; | ||
461 | |||
462 | struct mlx5_eqe_stall_vl { | ||
463 | u8 rsvd0[3]; | ||
464 | u8 port_vl; | ||
465 | }; | ||
466 | |||
467 | struct mlx5_eqe_cmd { | ||
468 | __be32 vector; | ||
469 | __be32 rsvd[6]; | ||
470 | }; | ||
471 | |||
472 | struct mlx5_eqe_page_req { | ||
473 | u8 rsvd0[2]; | ||
474 | __be16 func_id; | ||
475 | u8 rsvd1[2]; | ||
476 | __be16 num_pages; | ||
477 | __be32 rsvd2[5]; | ||
478 | }; | ||
479 | |||
480 | union ev_data { | ||
481 | __be32 raw[7]; | ||
482 | struct mlx5_eqe_cmd cmd; | ||
483 | struct mlx5_eqe_comp comp; | ||
484 | struct mlx5_eqe_qp_srq qp_srq; | ||
485 | struct mlx5_eqe_cq_err cq_err; | ||
486 | struct mlx5_eqe_dropped_packet dp; | ||
487 | struct mlx5_eqe_port_state port; | ||
488 | struct mlx5_eqe_gpio gpio; | ||
489 | struct mlx5_eqe_congestion cong; | ||
490 | struct mlx5_eqe_stall_vl stall_vl; | ||
491 | struct mlx5_eqe_page_req req_pages; | ||
492 | } __packed; | ||
493 | |||
494 | struct mlx5_eqe { | ||
495 | u8 rsvd0; | ||
496 | u8 type; | ||
497 | u8 rsvd1; | ||
498 | u8 sub_type; | ||
499 | __be32 rsvd2[7]; | ||
500 | union ev_data data; | ||
501 | __be16 rsvd3; | ||
502 | u8 signature; | ||
503 | u8 owner; | ||
504 | } __packed; | ||
505 | |||
506 | struct mlx5_cmd_prot_block { | ||
507 | u8 data[MLX5_CMD_DATA_BLOCK_SIZE]; | ||
508 | u8 rsvd0[48]; | ||
509 | __be64 next; | ||
510 | __be32 block_num; | ||
511 | u8 rsvd1; | ||
512 | u8 token; | ||
513 | u8 ctrl_sig; | ||
514 | u8 sig; | ||
515 | }; | ||
516 | |||
517 | struct mlx5_err_cqe { | ||
518 | u8 rsvd0[32]; | ||
519 | __be32 srqn; | ||
520 | u8 rsvd1[18]; | ||
521 | u8 vendor_err_synd; | ||
522 | u8 syndrome; | ||
523 | __be32 s_wqe_opcode_qpn; | ||
524 | __be16 wqe_counter; | ||
525 | u8 signature; | ||
526 | u8 op_own; | ||
527 | }; | ||
528 | |||
529 | struct mlx5_cqe64 { | ||
530 | u8 rsvd0[17]; | ||
531 | u8 ml_path; | ||
532 | u8 rsvd20[4]; | ||
533 | __be16 slid; | ||
534 | __be32 flags_rqpn; | ||
535 | u8 rsvd28[4]; | ||
536 | __be32 srqn; | ||
537 | __be32 imm_inval_pkey; | ||
538 | u8 rsvd40[4]; | ||
539 | __be32 byte_cnt; | ||
540 | __be64 timestamp; | ||
541 | __be32 sop_drop_qpn; | ||
542 | __be16 wqe_counter; | ||
543 | u8 signature; | ||
544 | u8 op_own; | ||
545 | }; | ||
546 | |||
547 | struct mlx5_wqe_srq_next_seg { | ||
548 | u8 rsvd0[2]; | ||
549 | __be16 next_wqe_index; | ||
550 | u8 signature; | ||
551 | u8 rsvd1[11]; | ||
552 | }; | ||
553 | |||
554 | union mlx5_ext_cqe { | ||
555 | struct ib_grh grh; | ||
556 | u8 inl[64]; | ||
557 | }; | ||
558 | |||
559 | struct mlx5_cqe128 { | ||
560 | union mlx5_ext_cqe inl_grh; | ||
561 | struct mlx5_cqe64 cqe64; | ||
562 | }; | ||
563 | |||
564 | struct mlx5_srq_ctx { | ||
565 | u8 state_log_sz; | ||
566 | u8 rsvd0[3]; | ||
567 | __be32 flags_xrcd; | ||
568 | __be32 pgoff_cqn; | ||
569 | u8 rsvd1[4]; | ||
570 | u8 log_pg_sz; | ||
571 | u8 rsvd2[7]; | ||
572 | __be32 pd; | ||
573 | __be16 lwm; | ||
574 | __be16 wqe_cnt; | ||
575 | u8 rsvd3[8]; | ||
576 | __be64 db_record; | ||
577 | }; | ||
578 | |||
579 | struct mlx5_create_srq_mbox_in { | ||
580 | struct mlx5_inbox_hdr hdr; | ||
581 | __be32 input_srqn; | ||
582 | u8 rsvd0[4]; | ||
583 | struct mlx5_srq_ctx ctx; | ||
584 | u8 rsvd1[208]; | ||
585 | __be64 pas[0]; | ||
586 | }; | ||
587 | |||
588 | struct mlx5_create_srq_mbox_out { | ||
589 | struct mlx5_outbox_hdr hdr; | ||
590 | __be32 srqn; | ||
591 | u8 rsvd[4]; | ||
592 | }; | ||
593 | |||
594 | struct mlx5_destroy_srq_mbox_in { | ||
595 | struct mlx5_inbox_hdr hdr; | ||
596 | __be32 srqn; | ||
597 | u8 rsvd[4]; | ||
598 | }; | ||
599 | |||
600 | struct mlx5_destroy_srq_mbox_out { | ||
601 | struct mlx5_outbox_hdr hdr; | ||
602 | u8 rsvd[8]; | ||
603 | }; | ||
604 | |||
605 | struct mlx5_query_srq_mbox_in { | ||
606 | struct mlx5_inbox_hdr hdr; | ||
607 | __be32 srqn; | ||
608 | u8 rsvd0[4]; | ||
609 | }; | ||
610 | |||
611 | struct mlx5_query_srq_mbox_out { | ||
612 | struct mlx5_outbox_hdr hdr; | ||
613 | u8 rsvd0[8]; | ||
614 | struct mlx5_srq_ctx ctx; | ||
615 | u8 rsvd1[32]; | ||
616 | __be64 pas[0]; | ||
617 | }; | ||
618 | |||
619 | struct mlx5_arm_srq_mbox_in { | ||
620 | struct mlx5_inbox_hdr hdr; | ||
621 | __be32 srqn; | ||
622 | __be16 rsvd; | ||
623 | __be16 lwm; | ||
624 | }; | ||
625 | |||
626 | struct mlx5_arm_srq_mbox_out { | ||
627 | struct mlx5_outbox_hdr hdr; | ||
628 | u8 rsvd[8]; | ||
629 | }; | ||
630 | |||
631 | struct mlx5_cq_context { | ||
632 | u8 status; | ||
633 | u8 cqe_sz_flags; | ||
634 | u8 st; | ||
635 | u8 rsvd3; | ||
636 | u8 rsvd4[6]; | ||
637 | __be16 page_offset; | ||
638 | __be32 log_sz_usr_page; | ||
639 | __be16 cq_period; | ||
640 | __be16 cq_max_count; | ||
641 | __be16 rsvd20; | ||
642 | __be16 c_eqn; | ||
643 | u8 log_pg_sz; | ||
644 | u8 rsvd25[7]; | ||
645 | __be32 last_notified_index; | ||
646 | __be32 solicit_producer_index; | ||
647 | __be32 consumer_counter; | ||
648 | __be32 producer_counter; | ||
649 | u8 rsvd48[8]; | ||
650 | __be64 db_record_addr; | ||
651 | }; | ||
652 | |||
653 | struct mlx5_create_cq_mbox_in { | ||
654 | struct mlx5_inbox_hdr hdr; | ||
655 | __be32 input_cqn; | ||
656 | u8 rsvdx[4]; | ||
657 | struct mlx5_cq_context ctx; | ||
658 | u8 rsvd6[192]; | ||
659 | __be64 pas[0]; | ||
660 | }; | ||
661 | |||
662 | struct mlx5_create_cq_mbox_out { | ||
663 | struct mlx5_outbox_hdr hdr; | ||
664 | __be32 cqn; | ||
665 | u8 rsvd0[4]; | ||
666 | }; | ||
667 | |||
668 | struct mlx5_destroy_cq_mbox_in { | ||
669 | struct mlx5_inbox_hdr hdr; | ||
670 | __be32 cqn; | ||
671 | u8 rsvd0[4]; | ||
672 | }; | ||
673 | |||
674 | struct mlx5_destroy_cq_mbox_out { | ||
675 | struct mlx5_outbox_hdr hdr; | ||
676 | u8 rsvd0[8]; | ||
677 | }; | ||
678 | |||
679 | struct mlx5_query_cq_mbox_in { | ||
680 | struct mlx5_inbox_hdr hdr; | ||
681 | __be32 cqn; | ||
682 | u8 rsvd0[4]; | ||
683 | }; | ||
684 | |||
685 | struct mlx5_query_cq_mbox_out { | ||
686 | struct mlx5_outbox_hdr hdr; | ||
687 | u8 rsvd0[8]; | ||
688 | struct mlx5_cq_context ctx; | ||
689 | u8 rsvd6[16]; | ||
690 | __be64 pas[0]; | ||
691 | }; | ||
692 | |||
693 | struct mlx5_enable_hca_mbox_in { | ||
694 | struct mlx5_inbox_hdr hdr; | ||
695 | u8 rsvd[8]; | ||
696 | }; | ||
697 | |||
698 | struct mlx5_enable_hca_mbox_out { | ||
699 | struct mlx5_outbox_hdr hdr; | ||
700 | u8 rsvd[8]; | ||
701 | }; | ||
702 | |||
703 | struct mlx5_disable_hca_mbox_in { | ||
704 | struct mlx5_inbox_hdr hdr; | ||
705 | u8 rsvd[8]; | ||
706 | }; | ||
707 | |||
708 | struct mlx5_disable_hca_mbox_out { | ||
709 | struct mlx5_outbox_hdr hdr; | ||
710 | u8 rsvd[8]; | ||
711 | }; | ||
712 | |||
713 | struct mlx5_eq_context { | ||
714 | u8 status; | ||
715 | u8 ec_oi; | ||
716 | u8 st; | ||
717 | u8 rsvd2[7]; | ||
718 | __be16 page_pffset; | ||
719 | __be32 log_sz_usr_page; | ||
720 | u8 rsvd3[7]; | ||
721 | u8 intr; | ||
722 | u8 log_page_size; | ||
723 | u8 rsvd4[15]; | ||
724 | __be32 consumer_counter; | ||
725 | __be32 produser_counter; | ||
726 | u8 rsvd5[16]; | ||
727 | }; | ||
728 | |||
729 | struct mlx5_create_eq_mbox_in { | ||
730 | struct mlx5_inbox_hdr hdr; | ||
731 | u8 rsvd0[3]; | ||
732 | u8 input_eqn; | ||
733 | u8 rsvd1[4]; | ||
734 | struct mlx5_eq_context ctx; | ||
735 | u8 rsvd2[8]; | ||
736 | __be64 events_mask; | ||
737 | u8 rsvd3[176]; | ||
738 | __be64 pas[0]; | ||
739 | }; | ||
740 | |||
741 | struct mlx5_create_eq_mbox_out { | ||
742 | struct mlx5_outbox_hdr hdr; | ||
743 | u8 rsvd0[3]; | ||
744 | u8 eq_number; | ||
745 | u8 rsvd1[4]; | ||
746 | }; | ||
747 | |||
748 | struct mlx5_destroy_eq_mbox_in { | ||
749 | struct mlx5_inbox_hdr hdr; | ||
750 | u8 rsvd0[3]; | ||
751 | u8 eqn; | ||
752 | u8 rsvd1[4]; | ||
753 | }; | ||
754 | |||
755 | struct mlx5_destroy_eq_mbox_out { | ||
756 | struct mlx5_outbox_hdr hdr; | ||
757 | u8 rsvd[8]; | ||
758 | }; | ||
759 | |||
760 | struct mlx5_map_eq_mbox_in { | ||
761 | struct mlx5_inbox_hdr hdr; | ||
762 | __be64 mask; | ||
763 | u8 mu; | ||
764 | u8 rsvd0[2]; | ||
765 | u8 eqn; | ||
766 | u8 rsvd1[24]; | ||
767 | }; | ||
768 | |||
769 | struct mlx5_map_eq_mbox_out { | ||
770 | struct mlx5_outbox_hdr hdr; | ||
771 | u8 rsvd[8]; | ||
772 | }; | ||
773 | |||
774 | struct mlx5_query_eq_mbox_in { | ||
775 | struct mlx5_inbox_hdr hdr; | ||
776 | u8 rsvd0[3]; | ||
777 | u8 eqn; | ||
778 | u8 rsvd1[4]; | ||
779 | }; | ||
780 | |||
781 | struct mlx5_query_eq_mbox_out { | ||
782 | struct mlx5_outbox_hdr hdr; | ||
783 | u8 rsvd[8]; | ||
784 | struct mlx5_eq_context ctx; | ||
785 | }; | ||
786 | |||
787 | struct mlx5_mkey_seg { | ||
788 | /* This is a two bit field occupying bits 31-30. | ||
789 | * bit 31 is always 0, | ||
790 | * bit 30 is zero for regular MRs and 1 (e.g free) for UMRs that do not have tanslation | ||
791 | */ | ||
792 | u8 status; | ||
793 | u8 pcie_control; | ||
794 | u8 flags; | ||
795 | u8 version; | ||
796 | __be32 qpn_mkey7_0; | ||
797 | u8 rsvd1[4]; | ||
798 | __be32 flags_pd; | ||
799 | __be64 start_addr; | ||
800 | __be64 len; | ||
801 | __be32 bsfs_octo_size; | ||
802 | u8 rsvd2[16]; | ||
803 | __be32 xlt_oct_size; | ||
804 | u8 rsvd3[3]; | ||
805 | u8 log2_page_size; | ||
806 | u8 rsvd4[4]; | ||
807 | }; | ||
808 | |||
809 | struct mlx5_query_special_ctxs_mbox_in { | ||
810 | struct mlx5_inbox_hdr hdr; | ||
811 | u8 rsvd[8]; | ||
812 | }; | ||
813 | |||
814 | struct mlx5_query_special_ctxs_mbox_out { | ||
815 | struct mlx5_outbox_hdr hdr; | ||
816 | __be32 dump_fill_mkey; | ||
817 | __be32 reserved_lkey; | ||
818 | }; | ||
819 | |||
820 | struct mlx5_create_mkey_mbox_in { | ||
821 | struct mlx5_inbox_hdr hdr; | ||
822 | __be32 input_mkey_index; | ||
823 | u8 rsvd0[4]; | ||
824 | struct mlx5_mkey_seg seg; | ||
825 | u8 rsvd1[16]; | ||
826 | __be32 xlat_oct_act_size; | ||
827 | __be32 bsf_coto_act_size; | ||
828 | u8 rsvd2[168]; | ||
829 | __be64 pas[0]; | ||
830 | }; | ||
831 | |||
832 | struct mlx5_create_mkey_mbox_out { | ||
833 | struct mlx5_outbox_hdr hdr; | ||
834 | __be32 mkey; | ||
835 | u8 rsvd[4]; | ||
836 | }; | ||
837 | |||
838 | struct mlx5_destroy_mkey_mbox_in { | ||
839 | struct mlx5_inbox_hdr hdr; | ||
840 | __be32 mkey; | ||
841 | u8 rsvd[4]; | ||
842 | }; | ||
843 | |||
844 | struct mlx5_destroy_mkey_mbox_out { | ||
845 | struct mlx5_outbox_hdr hdr; | ||
846 | u8 rsvd[8]; | ||
847 | }; | ||
848 | |||
849 | struct mlx5_query_mkey_mbox_in { | ||
850 | struct mlx5_inbox_hdr hdr; | ||
851 | __be32 mkey; | ||
852 | }; | ||
853 | |||
854 | struct mlx5_query_mkey_mbox_out { | ||
855 | struct mlx5_outbox_hdr hdr; | ||
856 | __be64 pas[0]; | ||
857 | }; | ||
858 | |||
859 | struct mlx5_modify_mkey_mbox_in { | ||
860 | struct mlx5_inbox_hdr hdr; | ||
861 | __be32 mkey; | ||
862 | __be64 pas[0]; | ||
863 | }; | ||
864 | |||
865 | struct mlx5_modify_mkey_mbox_out { | ||
866 | struct mlx5_outbox_hdr hdr; | ||
867 | }; | ||
868 | |||
869 | struct mlx5_dump_mkey_mbox_in { | ||
870 | struct mlx5_inbox_hdr hdr; | ||
871 | }; | ||
872 | |||
873 | struct mlx5_dump_mkey_mbox_out { | ||
874 | struct mlx5_outbox_hdr hdr; | ||
875 | __be32 mkey; | ||
876 | }; | ||
877 | |||
878 | struct mlx5_mad_ifc_mbox_in { | ||
879 | struct mlx5_inbox_hdr hdr; | ||
880 | __be16 remote_lid; | ||
881 | u8 rsvd0; | ||
882 | u8 port; | ||
883 | u8 rsvd1[4]; | ||
884 | u8 data[256]; | ||
885 | }; | ||
886 | |||
887 | struct mlx5_mad_ifc_mbox_out { | ||
888 | struct mlx5_outbox_hdr hdr; | ||
889 | u8 rsvd[8]; | ||
890 | u8 data[256]; | ||
891 | }; | ||
892 | |||
893 | struct mlx5_access_reg_mbox_in { | ||
894 | struct mlx5_inbox_hdr hdr; | ||
895 | u8 rsvd0[2]; | ||
896 | __be16 register_id; | ||
897 | __be32 arg; | ||
898 | __be32 data[0]; | ||
899 | }; | ||
900 | |||
901 | struct mlx5_access_reg_mbox_out { | ||
902 | struct mlx5_outbox_hdr hdr; | ||
903 | u8 rsvd[8]; | ||
904 | __be32 data[0]; | ||
905 | }; | ||
906 | |||
907 | #define MLX5_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90) | ||
908 | |||
909 | enum { | ||
910 | MLX_EXT_PORT_CAP_FLAG_EXTENDED_PORT_INFO = 1 << 0 | ||
911 | }; | ||
912 | |||
913 | #endif /* MLX5_DEVICE_H */ | ||
diff --git a/include/linux/mlx5/doorbell.h b/include/linux/mlx5/doorbell.h new file mode 100644 index 000000000000..163a818411e7 --- /dev/null +++ b/include/linux/mlx5/doorbell.h | |||
@@ -0,0 +1,79 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2013, Mellanox Technologies inc. All rights reserved. | ||
3 | * | ||
4 | * This software is available to you under a choice of one of two | ||
5 | * licenses. You may choose to be licensed under the terms of the GNU | ||
6 | * General Public License (GPL) Version 2, available from the file | ||
7 | * COPYING in the main directory of this source tree, or the | ||
8 | * OpenIB.org BSD license below: | ||
9 | * | ||
10 | * Redistribution and use in source and binary forms, with or | ||
11 | * without modification, are permitted provided that the following | ||
12 | * conditions are met: | ||
13 | * | ||
14 | * - Redistributions of source code must retain the above | ||
15 | * copyright notice, this list of conditions and the following | ||
16 | * disclaimer. | ||
17 | * | ||
18 | * - Redistributions in binary form must reproduce the above | ||
19 | * copyright notice, this list of conditions and the following | ||
20 | * disclaimer in the documentation and/or other materials | ||
21 | * provided with the distribution. | ||
22 | * | ||
23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
25 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
27 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
28 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
30 | * SOFTWARE. | ||
31 | */ | ||
32 | |||
33 | #ifndef MLX5_DOORBELL_H | ||
34 | #define MLX5_DOORBELL_H | ||
35 | |||
36 | #define MLX5_BF_OFFSET 0x800 | ||
37 | #define MLX5_CQ_DOORBELL 0x20 | ||
38 | |||
39 | #if BITS_PER_LONG == 64 | ||
40 | /* Assume that we can just write a 64-bit doorbell atomically. s390 | ||
41 | * actually doesn't have writeq() but S/390 systems don't even have | ||
42 | * PCI so we won't worry about it. | ||
43 | */ | ||
44 | |||
45 | #define MLX5_DECLARE_DOORBELL_LOCK(name) | ||
46 | #define MLX5_INIT_DOORBELL_LOCK(ptr) do { } while (0) | ||
47 | #define MLX5_GET_DOORBELL_LOCK(ptr) (NULL) | ||
48 | |||
49 | static inline void mlx5_write64(__be32 val[2], void __iomem *dest, | ||
50 | spinlock_t *doorbell_lock) | ||
51 | { | ||
52 | __raw_writeq(*(u64 *)val, dest); | ||
53 | } | ||
54 | |||
55 | #else | ||
56 | |||
57 | /* Just fall back to a spinlock to protect the doorbell if | ||
58 | * BITS_PER_LONG is 32 -- there's no portable way to do atomic 64-bit | ||
59 | * MMIO writes. | ||
60 | */ | ||
61 | |||
62 | #define MLX5_DECLARE_DOORBELL_LOCK(name) spinlock_t name; | ||
63 | #define MLX5_INIT_DOORBELL_LOCK(ptr) spin_lock_init(ptr) | ||
64 | #define MLX5_GET_DOORBELL_LOCK(ptr) (ptr) | ||
65 | |||
66 | static inline void mlx5_write64(__be32 val[2], void __iomem *dest, | ||
67 | spinlock_t *doorbell_lock) | ||
68 | { | ||
69 | unsigned long flags; | ||
70 | |||
71 | spin_lock_irqsave(doorbell_lock, flags); | ||
72 | __raw_writel((__force u32) val[0], dest); | ||
73 | __raw_writel((__force u32) val[1], dest + 4); | ||
74 | spin_unlock_irqrestore(doorbell_lock, flags); | ||
75 | } | ||
76 | |||
77 | #endif | ||
78 | |||
79 | #endif /* MLX5_DOORBELL_H */ | ||
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h new file mode 100644 index 000000000000..2aa258b0ced1 --- /dev/null +++ b/include/linux/mlx5/driver.h | |||
@@ -0,0 +1,771 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2013, Mellanox Technologies inc. All rights reserved. | ||
3 | * | ||
4 | * This software is available to you under a choice of one of two | ||
5 | * licenses. You may choose to be licensed under the terms of the GNU | ||
6 | * General Public License (GPL) Version 2, available from the file | ||
7 | * COPYING in the main directory of this source tree, or the | ||
8 | * OpenIB.org BSD license below: | ||
9 | * | ||
10 | * Redistribution and use in source and binary forms, with or | ||
11 | * without modification, are permitted provided that the following | ||
12 | * conditions are met: | ||
13 | * | ||
14 | * - Redistributions of source code must retain the above | ||
15 | * copyright notice, this list of conditions and the following | ||
16 | * disclaimer. | ||
17 | * | ||
18 | * - Redistributions in binary form must reproduce the above | ||
19 | * copyright notice, this list of conditions and the following | ||
20 | * disclaimer in the documentation and/or other materials | ||
21 | * provided with the distribution. | ||
22 | * | ||
23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
25 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
27 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
28 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
30 | * SOFTWARE. | ||
31 | */ | ||
32 | |||
33 | #ifndef MLX5_DRIVER_H | ||
34 | #define MLX5_DRIVER_H | ||
35 | |||
36 | #include <linux/kernel.h> | ||
37 | #include <linux/completion.h> | ||
38 | #include <linux/pci.h> | ||
39 | #include <linux/spinlock_types.h> | ||
40 | #include <linux/semaphore.h> | ||
41 | #include <linux/vmalloc.h> | ||
42 | #include <linux/radix-tree.h> | ||
43 | #include <linux/mlx5/device.h> | ||
44 | #include <linux/mlx5/doorbell.h> | ||
45 | |||
46 | enum { | ||
47 | MLX5_BOARD_ID_LEN = 64, | ||
48 | MLX5_MAX_NAME_LEN = 16, | ||
49 | }; | ||
50 | |||
51 | enum { | ||
52 | /* one minute for the sake of bringup. Generally, commands must always | ||
53 | * complete and we may need to increase this timeout value | ||
54 | */ | ||
55 | MLX5_CMD_TIMEOUT_MSEC = 7200 * 1000, | ||
56 | MLX5_CMD_WQ_MAX_NAME = 32, | ||
57 | }; | ||
58 | |||
59 | enum { | ||
60 | CMD_OWNER_SW = 0x0, | ||
61 | CMD_OWNER_HW = 0x1, | ||
62 | CMD_STATUS_SUCCESS = 0, | ||
63 | }; | ||
64 | |||
65 | enum mlx5_sqp_t { | ||
66 | MLX5_SQP_SMI = 0, | ||
67 | MLX5_SQP_GSI = 1, | ||
68 | MLX5_SQP_IEEE_1588 = 2, | ||
69 | MLX5_SQP_SNIFFER = 3, | ||
70 | MLX5_SQP_SYNC_UMR = 4, | ||
71 | }; | ||
72 | |||
73 | enum { | ||
74 | MLX5_MAX_PORTS = 2, | ||
75 | }; | ||
76 | |||
77 | enum { | ||
78 | MLX5_EQ_VEC_PAGES = 0, | ||
79 | MLX5_EQ_VEC_CMD = 1, | ||
80 | MLX5_EQ_VEC_ASYNC = 2, | ||
81 | MLX5_EQ_VEC_COMP_BASE, | ||
82 | }; | ||
83 | |||
84 | enum { | ||
85 | MLX5_MAX_EQ_NAME = 20 | ||
86 | }; | ||
87 | |||
88 | enum { | ||
89 | MLX5_ATOMIC_MODE_IB_COMP = 1 << 16, | ||
90 | MLX5_ATOMIC_MODE_CX = 2 << 16, | ||
91 | MLX5_ATOMIC_MODE_8B = 3 << 16, | ||
92 | MLX5_ATOMIC_MODE_16B = 4 << 16, | ||
93 | MLX5_ATOMIC_MODE_32B = 5 << 16, | ||
94 | MLX5_ATOMIC_MODE_64B = 6 << 16, | ||
95 | MLX5_ATOMIC_MODE_128B = 7 << 16, | ||
96 | MLX5_ATOMIC_MODE_256B = 8 << 16, | ||
97 | }; | ||
98 | |||
99 | enum { | ||
100 | MLX5_CMD_OP_QUERY_HCA_CAP = 0x100, | ||
101 | MLX5_CMD_OP_QUERY_ADAPTER = 0x101, | ||
102 | MLX5_CMD_OP_INIT_HCA = 0x102, | ||
103 | MLX5_CMD_OP_TEARDOWN_HCA = 0x103, | ||
104 | MLX5_CMD_OP_ENABLE_HCA = 0x104, | ||
105 | MLX5_CMD_OP_DISABLE_HCA = 0x105, | ||
106 | MLX5_CMD_OP_QUERY_PAGES = 0x107, | ||
107 | MLX5_CMD_OP_MANAGE_PAGES = 0x108, | ||
108 | MLX5_CMD_OP_SET_HCA_CAP = 0x109, | ||
109 | |||
110 | MLX5_CMD_OP_CREATE_MKEY = 0x200, | ||
111 | MLX5_CMD_OP_QUERY_MKEY = 0x201, | ||
112 | MLX5_CMD_OP_DESTROY_MKEY = 0x202, | ||
113 | MLX5_CMD_OP_QUERY_SPECIAL_CONTEXTS = 0x203, | ||
114 | |||
115 | MLX5_CMD_OP_CREATE_EQ = 0x301, | ||
116 | MLX5_CMD_OP_DESTROY_EQ = 0x302, | ||
117 | MLX5_CMD_OP_QUERY_EQ = 0x303, | ||
118 | |||
119 | MLX5_CMD_OP_CREATE_CQ = 0x400, | ||
120 | MLX5_CMD_OP_DESTROY_CQ = 0x401, | ||
121 | MLX5_CMD_OP_QUERY_CQ = 0x402, | ||
122 | MLX5_CMD_OP_MODIFY_CQ = 0x403, | ||
123 | |||
124 | MLX5_CMD_OP_CREATE_QP = 0x500, | ||
125 | MLX5_CMD_OP_DESTROY_QP = 0x501, | ||
126 | MLX5_CMD_OP_RST2INIT_QP = 0x502, | ||
127 | MLX5_CMD_OP_INIT2RTR_QP = 0x503, | ||
128 | MLX5_CMD_OP_RTR2RTS_QP = 0x504, | ||
129 | MLX5_CMD_OP_RTS2RTS_QP = 0x505, | ||
130 | MLX5_CMD_OP_SQERR2RTS_QP = 0x506, | ||
131 | MLX5_CMD_OP_2ERR_QP = 0x507, | ||
132 | MLX5_CMD_OP_RTS2SQD_QP = 0x508, | ||
133 | MLX5_CMD_OP_SQD2RTS_QP = 0x509, | ||
134 | MLX5_CMD_OP_2RST_QP = 0x50a, | ||
135 | MLX5_CMD_OP_QUERY_QP = 0x50b, | ||
136 | MLX5_CMD_OP_CONF_SQP = 0x50c, | ||
137 | MLX5_CMD_OP_MAD_IFC = 0x50d, | ||
138 | MLX5_CMD_OP_INIT2INIT_QP = 0x50e, | ||
139 | MLX5_CMD_OP_SUSPEND_QP = 0x50f, | ||
140 | MLX5_CMD_OP_UNSUSPEND_QP = 0x510, | ||
141 | MLX5_CMD_OP_SQD2SQD_QP = 0x511, | ||
142 | MLX5_CMD_OP_ALLOC_QP_COUNTER_SET = 0x512, | ||
143 | MLX5_CMD_OP_DEALLOC_QP_COUNTER_SET = 0x513, | ||
144 | MLX5_CMD_OP_QUERY_QP_COUNTER_SET = 0x514, | ||
145 | |||
146 | MLX5_CMD_OP_CREATE_PSV = 0x600, | ||
147 | MLX5_CMD_OP_DESTROY_PSV = 0x601, | ||
148 | MLX5_CMD_OP_QUERY_PSV = 0x602, | ||
149 | MLX5_CMD_OP_QUERY_SIG_RULE_TABLE = 0x603, | ||
150 | MLX5_CMD_OP_QUERY_BLOCK_SIZE_TABLE = 0x604, | ||
151 | |||
152 | MLX5_CMD_OP_CREATE_SRQ = 0x700, | ||
153 | MLX5_CMD_OP_DESTROY_SRQ = 0x701, | ||
154 | MLX5_CMD_OP_QUERY_SRQ = 0x702, | ||
155 | MLX5_CMD_OP_ARM_RQ = 0x703, | ||
156 | MLX5_CMD_OP_RESIZE_SRQ = 0x704, | ||
157 | |||
158 | MLX5_CMD_OP_ALLOC_PD = 0x800, | ||
159 | MLX5_CMD_OP_DEALLOC_PD = 0x801, | ||
160 | MLX5_CMD_OP_ALLOC_UAR = 0x802, | ||
161 | MLX5_CMD_OP_DEALLOC_UAR = 0x803, | ||
162 | |||
163 | MLX5_CMD_OP_ATTACH_TO_MCG = 0x806, | ||
164 | MLX5_CMD_OP_DETACH_FROM_MCG = 0x807, | ||
165 | |||
166 | |||
167 | MLX5_CMD_OP_ALLOC_XRCD = 0x80e, | ||
168 | MLX5_CMD_OP_DEALLOC_XRCD = 0x80f, | ||
169 | |||
170 | MLX5_CMD_OP_ACCESS_REG = 0x805, | ||
171 | MLX5_CMD_OP_MAX = 0x810, | ||
172 | }; | ||
173 | |||
174 | enum { | ||
175 | MLX5_REG_PCAP = 0x5001, | ||
176 | MLX5_REG_PMTU = 0x5003, | ||
177 | MLX5_REG_PTYS = 0x5004, | ||
178 | MLX5_REG_PAOS = 0x5006, | ||
179 | MLX5_REG_PMAOS = 0x5012, | ||
180 | MLX5_REG_PUDE = 0x5009, | ||
181 | MLX5_REG_PMPE = 0x5010, | ||
182 | MLX5_REG_PELC = 0x500e, | ||
183 | MLX5_REG_PMLP = 0, /* TBD */ | ||
184 | MLX5_REG_NODE_DESC = 0x6001, | ||
185 | MLX5_REG_HOST_ENDIANNESS = 0x7004, | ||
186 | }; | ||
187 | |||
188 | enum dbg_rsc_type { | ||
189 | MLX5_DBG_RSC_QP, | ||
190 | MLX5_DBG_RSC_EQ, | ||
191 | MLX5_DBG_RSC_CQ, | ||
192 | }; | ||
193 | |||
194 | struct mlx5_field_desc { | ||
195 | struct dentry *dent; | ||
196 | int i; | ||
197 | }; | ||
198 | |||
199 | struct mlx5_rsc_debug { | ||
200 | struct mlx5_core_dev *dev; | ||
201 | void *object; | ||
202 | enum dbg_rsc_type type; | ||
203 | struct dentry *root; | ||
204 | struct mlx5_field_desc fields[0]; | ||
205 | }; | ||
206 | |||
207 | enum mlx5_dev_event { | ||
208 | MLX5_DEV_EVENT_SYS_ERROR, | ||
209 | MLX5_DEV_EVENT_PORT_UP, | ||
210 | MLX5_DEV_EVENT_PORT_DOWN, | ||
211 | MLX5_DEV_EVENT_PORT_INITIALIZED, | ||
212 | MLX5_DEV_EVENT_LID_CHANGE, | ||
213 | MLX5_DEV_EVENT_PKEY_CHANGE, | ||
214 | MLX5_DEV_EVENT_GUID_CHANGE, | ||
215 | MLX5_DEV_EVENT_CLIENT_REREG, | ||
216 | }; | ||
217 | |||
218 | struct mlx5_uuar_info { | ||
219 | struct mlx5_uar *uars; | ||
220 | int num_uars; | ||
221 | int num_low_latency_uuars; | ||
222 | unsigned long *bitmap; | ||
223 | unsigned int *count; | ||
224 | struct mlx5_bf *bfs; | ||
225 | |||
226 | /* | ||
227 | * protect uuar allocation data structs | ||
228 | */ | ||
229 | struct mutex lock; | ||
230 | }; | ||
231 | |||
232 | struct mlx5_bf { | ||
233 | void __iomem *reg; | ||
234 | void __iomem *regreg; | ||
235 | int buf_size; | ||
236 | struct mlx5_uar *uar; | ||
237 | unsigned long offset; | ||
238 | int need_lock; | ||
239 | /* protect blue flame buffer selection when needed | ||
240 | */ | ||
241 | spinlock_t lock; | ||
242 | |||
243 | /* serialize 64 bit writes when done as two 32 bit accesses | ||
244 | */ | ||
245 | spinlock_t lock32; | ||
246 | int uuarn; | ||
247 | }; | ||
248 | |||
249 | struct mlx5_cmd_first { | ||
250 | __be32 data[4]; | ||
251 | }; | ||
252 | |||
253 | struct mlx5_cmd_msg { | ||
254 | struct list_head list; | ||
255 | struct cache_ent *cache; | ||
256 | u32 len; | ||
257 | struct mlx5_cmd_first first; | ||
258 | struct mlx5_cmd_mailbox *next; | ||
259 | }; | ||
260 | |||
261 | struct mlx5_cmd_debug { | ||
262 | struct dentry *dbg_root; | ||
263 | struct dentry *dbg_in; | ||
264 | struct dentry *dbg_out; | ||
265 | struct dentry *dbg_outlen; | ||
266 | struct dentry *dbg_status; | ||
267 | struct dentry *dbg_run; | ||
268 | void *in_msg; | ||
269 | void *out_msg; | ||
270 | u8 status; | ||
271 | u16 inlen; | ||
272 | u16 outlen; | ||
273 | }; | ||
274 | |||
275 | struct cache_ent { | ||
276 | /* protect block chain allocations | ||
277 | */ | ||
278 | spinlock_t lock; | ||
279 | struct list_head head; | ||
280 | }; | ||
281 | |||
282 | struct cmd_msg_cache { | ||
283 | struct cache_ent large; | ||
284 | struct cache_ent med; | ||
285 | |||
286 | }; | ||
287 | |||
288 | struct mlx5_cmd_stats { | ||
289 | u64 sum; | ||
290 | u64 n; | ||
291 | struct dentry *root; | ||
292 | struct dentry *avg; | ||
293 | struct dentry *count; | ||
294 | /* protect command average calculations */ | ||
295 | spinlock_t lock; | ||
296 | }; | ||
297 | |||
298 | struct mlx5_cmd { | ||
299 | void *cmd_buf; | ||
300 | dma_addr_t dma; | ||
301 | u16 cmdif_rev; | ||
302 | u8 log_sz; | ||
303 | u8 log_stride; | ||
304 | int max_reg_cmds; | ||
305 | int events; | ||
306 | u32 __iomem *vector; | ||
307 | |||
308 | /* protect command queue allocations | ||
309 | */ | ||
310 | spinlock_t alloc_lock; | ||
311 | |||
312 | /* protect token allocations | ||
313 | */ | ||
314 | spinlock_t token_lock; | ||
315 | u8 token; | ||
316 | unsigned long bitmask; | ||
317 | char wq_name[MLX5_CMD_WQ_MAX_NAME]; | ||
318 | struct workqueue_struct *wq; | ||
319 | struct semaphore sem; | ||
320 | struct semaphore pages_sem; | ||
321 | int mode; | ||
322 | struct mlx5_cmd_work_ent *ent_arr[MLX5_MAX_COMMANDS]; | ||
323 | struct pci_pool *pool; | ||
324 | struct mlx5_cmd_debug dbg; | ||
325 | struct cmd_msg_cache cache; | ||
326 | int checksum_disabled; | ||
327 | struct mlx5_cmd_stats stats[MLX5_CMD_OP_MAX]; | ||
328 | }; | ||
329 | |||
330 | struct mlx5_port_caps { | ||
331 | int gid_table_len; | ||
332 | int pkey_table_len; | ||
333 | }; | ||
334 | |||
335 | struct mlx5_caps { | ||
336 | u8 log_max_eq; | ||
337 | u8 log_max_cq; | ||
338 | u8 log_max_qp; | ||
339 | u8 log_max_mkey; | ||
340 | u8 log_max_pd; | ||
341 | u8 log_max_srq; | ||
342 | u32 max_cqes; | ||
343 | int max_wqes; | ||
344 | int max_sq_desc_sz; | ||
345 | int max_rq_desc_sz; | ||
346 | u64 flags; | ||
347 | u16 stat_rate_support; | ||
348 | int log_max_msg; | ||
349 | int num_ports; | ||
350 | int max_ra_res_qp; | ||
351 | int max_ra_req_qp; | ||
352 | int max_srq_wqes; | ||
353 | int bf_reg_size; | ||
354 | int bf_regs_per_page; | ||
355 | struct mlx5_port_caps port[MLX5_MAX_PORTS]; | ||
356 | u8 ext_port_cap[MLX5_MAX_PORTS]; | ||
357 | int max_vf; | ||
358 | u32 reserved_lkey; | ||
359 | u8 local_ca_ack_delay; | ||
360 | u8 log_max_mcg; | ||
361 | u16 max_qp_mcg; | ||
362 | int min_page_sz; | ||
363 | }; | ||
364 | |||
365 | struct mlx5_cmd_mailbox { | ||
366 | void *buf; | ||
367 | dma_addr_t dma; | ||
368 | struct mlx5_cmd_mailbox *next; | ||
369 | }; | ||
370 | |||
371 | struct mlx5_buf_list { | ||
372 | void *buf; | ||
373 | dma_addr_t map; | ||
374 | }; | ||
375 | |||
376 | struct mlx5_buf { | ||
377 | struct mlx5_buf_list direct; | ||
378 | struct mlx5_buf_list *page_list; | ||
379 | int nbufs; | ||
380 | int npages; | ||
381 | int page_shift; | ||
382 | int size; | ||
383 | }; | ||
384 | |||
385 | struct mlx5_eq { | ||
386 | struct mlx5_core_dev *dev; | ||
387 | __be32 __iomem *doorbell; | ||
388 | u32 cons_index; | ||
389 | struct mlx5_buf buf; | ||
390 | int size; | ||
391 | u8 irqn; | ||
392 | u8 eqn; | ||
393 | int nent; | ||
394 | u64 mask; | ||
395 | char name[MLX5_MAX_EQ_NAME]; | ||
396 | struct list_head list; | ||
397 | int index; | ||
398 | struct mlx5_rsc_debug *dbg; | ||
399 | }; | ||
400 | |||
401 | |||
402 | struct mlx5_core_mr { | ||
403 | u64 iova; | ||
404 | u64 size; | ||
405 | u32 key; | ||
406 | u32 pd; | ||
407 | u32 access; | ||
408 | }; | ||
409 | |||
410 | struct mlx5_core_srq { | ||
411 | u32 srqn; | ||
412 | int max; | ||
413 | int max_gs; | ||
414 | int max_avail_gather; | ||
415 | int wqe_shift; | ||
416 | void (*event) (struct mlx5_core_srq *, enum mlx5_event); | ||
417 | |||
418 | atomic_t refcount; | ||
419 | struct completion free; | ||
420 | }; | ||
421 | |||
422 | struct mlx5_eq_table { | ||
423 | void __iomem *update_ci; | ||
424 | void __iomem *update_arm_ci; | ||
425 | struct list_head *comp_eq_head; | ||
426 | struct mlx5_eq pages_eq; | ||
427 | struct mlx5_eq async_eq; | ||
428 | struct mlx5_eq cmd_eq; | ||
429 | struct msix_entry *msix_arr; | ||
430 | int num_comp_vectors; | ||
431 | /* protect EQs list | ||
432 | */ | ||
433 | spinlock_t lock; | ||
434 | }; | ||
435 | |||
436 | struct mlx5_uar { | ||
437 | u32 index; | ||
438 | struct list_head bf_list; | ||
439 | unsigned free_bf_bmap; | ||
440 | void __iomem *wc_map; | ||
441 | void __iomem *map; | ||
442 | }; | ||
443 | |||
444 | |||
445 | struct mlx5_core_health { | ||
446 | struct health_buffer __iomem *health; | ||
447 | __be32 __iomem *health_counter; | ||
448 | struct timer_list timer; | ||
449 | struct list_head list; | ||
450 | u32 prev; | ||
451 | int miss_counter; | ||
452 | }; | ||
453 | |||
454 | struct mlx5_cq_table { | ||
455 | /* protect radix tree | ||
456 | */ | ||
457 | spinlock_t lock; | ||
458 | struct radix_tree_root tree; | ||
459 | }; | ||
460 | |||
461 | struct mlx5_qp_table { | ||
462 | /* protect radix tree | ||
463 | */ | ||
464 | spinlock_t lock; | ||
465 | struct radix_tree_root tree; | ||
466 | }; | ||
467 | |||
468 | struct mlx5_srq_table { | ||
469 | /* protect radix tree | ||
470 | */ | ||
471 | spinlock_t lock; | ||
472 | struct radix_tree_root tree; | ||
473 | }; | ||
474 | |||
475 | struct mlx5_priv { | ||
476 | char name[MLX5_MAX_NAME_LEN]; | ||
477 | struct mlx5_eq_table eq_table; | ||
478 | struct mlx5_uuar_info uuari; | ||
479 | MLX5_DECLARE_DOORBELL_LOCK(cq_uar_lock); | ||
480 | |||
481 | /* pages stuff */ | ||
482 | struct workqueue_struct *pg_wq; | ||
483 | struct rb_root page_root; | ||
484 | int fw_pages; | ||
485 | int reg_pages; | ||
486 | |||
487 | struct mlx5_core_health health; | ||
488 | |||
489 | struct mlx5_srq_table srq_table; | ||
490 | |||
491 | /* start: qp staff */ | ||
492 | struct mlx5_qp_table qp_table; | ||
493 | struct dentry *qp_debugfs; | ||
494 | struct dentry *eq_debugfs; | ||
495 | struct dentry *cq_debugfs; | ||
496 | struct dentry *cmdif_debugfs; | ||
497 | /* end: qp staff */ | ||
498 | |||
499 | /* start: cq staff */ | ||
500 | struct mlx5_cq_table cq_table; | ||
501 | /* end: cq staff */ | ||
502 | |||
503 | /* start: alloc staff */ | ||
504 | struct mutex pgdir_mutex; | ||
505 | struct list_head pgdir_list; | ||
506 | /* end: alloc staff */ | ||
507 | struct dentry *dbg_root; | ||
508 | |||
509 | /* protect mkey key part */ | ||
510 | spinlock_t mkey_lock; | ||
511 | u8 mkey_key; | ||
512 | }; | ||
513 | |||
514 | struct mlx5_core_dev { | ||
515 | struct pci_dev *pdev; | ||
516 | u8 rev_id; | ||
517 | char board_id[MLX5_BOARD_ID_LEN]; | ||
518 | struct mlx5_cmd cmd; | ||
519 | struct mlx5_caps caps; | ||
520 | phys_addr_t iseg_base; | ||
521 | struct mlx5_init_seg __iomem *iseg; | ||
522 | void (*event) (struct mlx5_core_dev *dev, | ||
523 | enum mlx5_dev_event event, | ||
524 | void *data); | ||
525 | struct mlx5_priv priv; | ||
526 | struct mlx5_profile *profile; | ||
527 | atomic_t num_qps; | ||
528 | }; | ||
529 | |||
530 | struct mlx5_db { | ||
531 | __be32 *db; | ||
532 | union { | ||
533 | struct mlx5_db_pgdir *pgdir; | ||
534 | struct mlx5_ib_user_db_page *user_page; | ||
535 | } u; | ||
536 | dma_addr_t dma; | ||
537 | int index; | ||
538 | }; | ||
539 | |||
540 | enum { | ||
541 | MLX5_DB_PER_PAGE = PAGE_SIZE / L1_CACHE_BYTES, | ||
542 | }; | ||
543 | |||
544 | enum { | ||
545 | MLX5_COMP_EQ_SIZE = 1024, | ||
546 | }; | ||
547 | |||
548 | struct mlx5_db_pgdir { | ||
549 | struct list_head list; | ||
550 | DECLARE_BITMAP(bitmap, MLX5_DB_PER_PAGE); | ||
551 | __be32 *db_page; | ||
552 | dma_addr_t db_dma; | ||
553 | }; | ||
554 | |||
555 | typedef void (*mlx5_cmd_cbk_t)(int status, void *context); | ||
556 | |||
557 | struct mlx5_cmd_work_ent { | ||
558 | struct mlx5_cmd_msg *in; | ||
559 | struct mlx5_cmd_msg *out; | ||
560 | mlx5_cmd_cbk_t callback; | ||
561 | void *context; | ||
562 | int idx; | ||
563 | struct completion done; | ||
564 | struct mlx5_cmd *cmd; | ||
565 | struct work_struct work; | ||
566 | struct mlx5_cmd_layout *lay; | ||
567 | int ret; | ||
568 | int page_queue; | ||
569 | u8 status; | ||
570 | u8 token; | ||
571 | struct timespec ts1; | ||
572 | struct timespec ts2; | ||
573 | }; | ||
574 | |||
575 | struct mlx5_pas { | ||
576 | u64 pa; | ||
577 | u8 log_sz; | ||
578 | }; | ||
579 | |||
580 | static inline void *mlx5_buf_offset(struct mlx5_buf *buf, int offset) | ||
581 | { | ||
582 | if (likely(BITS_PER_LONG == 64 || buf->nbufs == 1)) | ||
583 | return buf->direct.buf + offset; | ||
584 | else | ||
585 | return buf->page_list[offset >> PAGE_SHIFT].buf + | ||
586 | (offset & (PAGE_SIZE - 1)); | ||
587 | } | ||
588 | |||
589 | extern struct workqueue_struct *mlx5_core_wq; | ||
590 | |||
591 | #define STRUCT_FIELD(header, field) \ | ||
592 | .struct_offset_bytes = offsetof(struct ib_unpacked_ ## header, field), \ | ||
593 | .struct_size_bytes = sizeof((struct ib_unpacked_ ## header *)0)->field | ||
594 | |||
595 | struct ib_field { | ||
596 | size_t struct_offset_bytes; | ||
597 | size_t struct_size_bytes; | ||
598 | int offset_bits; | ||
599 | int size_bits; | ||
600 | }; | ||
601 | |||
602 | static inline struct mlx5_core_dev *pci2mlx5_core_dev(struct pci_dev *pdev) | ||
603 | { | ||
604 | return pci_get_drvdata(pdev); | ||
605 | } | ||
606 | |||
607 | extern struct dentry *mlx5_debugfs_root; | ||
608 | |||
609 | static inline u16 fw_rev_maj(struct mlx5_core_dev *dev) | ||
610 | { | ||
611 | return ioread32be(&dev->iseg->fw_rev) & 0xffff; | ||
612 | } | ||
613 | |||
614 | static inline u16 fw_rev_min(struct mlx5_core_dev *dev) | ||
615 | { | ||
616 | return ioread32be(&dev->iseg->fw_rev) >> 16; | ||
617 | } | ||
618 | |||
619 | static inline u16 fw_rev_sub(struct mlx5_core_dev *dev) | ||
620 | { | ||
621 | return ioread32be(&dev->iseg->cmdif_rev_fw_sub) & 0xffff; | ||
622 | } | ||
623 | |||
624 | static inline u16 cmdif_rev(struct mlx5_core_dev *dev) | ||
625 | { | ||
626 | return ioread32be(&dev->iseg->cmdif_rev_fw_sub) >> 16; | ||
627 | } | ||
628 | |||
629 | static inline void *mlx5_vzalloc(unsigned long size) | ||
630 | { | ||
631 | void *rtn; | ||
632 | |||
633 | rtn = kzalloc(size, GFP_KERNEL | __GFP_NOWARN); | ||
634 | if (!rtn) | ||
635 | rtn = vzalloc(size); | ||
636 | return rtn; | ||
637 | } | ||
638 | |||
639 | static inline void mlx5_vfree(const void *addr) | ||
640 | { | ||
641 | if (addr && is_vmalloc_addr(addr)) | ||
642 | vfree(addr); | ||
643 | else | ||
644 | kfree(addr); | ||
645 | } | ||
646 | |||
647 | int mlx5_dev_init(struct mlx5_core_dev *dev, struct pci_dev *pdev); | ||
648 | void mlx5_dev_cleanup(struct mlx5_core_dev *dev); | ||
649 | int mlx5_cmd_init(struct mlx5_core_dev *dev); | ||
650 | void mlx5_cmd_cleanup(struct mlx5_core_dev *dev); | ||
651 | void mlx5_cmd_use_events(struct mlx5_core_dev *dev); | ||
652 | void mlx5_cmd_use_polling(struct mlx5_core_dev *dev); | ||
653 | int mlx5_cmd_status_to_err(struct mlx5_outbox_hdr *hdr); | ||
654 | int mlx5_cmd_exec(struct mlx5_core_dev *dev, void *in, int in_size, void *out, | ||
655 | int out_size); | ||
656 | int mlx5_cmd_alloc_uar(struct mlx5_core_dev *dev, u32 *uarn); | ||
657 | int mlx5_cmd_free_uar(struct mlx5_core_dev *dev, u32 uarn); | ||
658 | int mlx5_alloc_uuars(struct mlx5_core_dev *dev, struct mlx5_uuar_info *uuari); | ||
659 | int mlx5_free_uuars(struct mlx5_core_dev *dev, struct mlx5_uuar_info *uuari); | ||
660 | void mlx5_health_cleanup(void); | ||
661 | void __init mlx5_health_init(void); | ||
662 | void mlx5_start_health_poll(struct mlx5_core_dev *dev); | ||
663 | void mlx5_stop_health_poll(struct mlx5_core_dev *dev); | ||
664 | int mlx5_buf_alloc(struct mlx5_core_dev *dev, int size, int max_direct, | ||
665 | struct mlx5_buf *buf); | ||
666 | void mlx5_buf_free(struct mlx5_core_dev *dev, struct mlx5_buf *buf); | ||
667 | struct mlx5_cmd_mailbox *mlx5_alloc_cmd_mailbox_chain(struct mlx5_core_dev *dev, | ||
668 | gfp_t flags, int npages); | ||
669 | void mlx5_free_cmd_mailbox_chain(struct mlx5_core_dev *dev, | ||
670 | struct mlx5_cmd_mailbox *head); | ||
671 | int mlx5_core_create_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq, | ||
672 | struct mlx5_create_srq_mbox_in *in, int inlen); | ||
673 | int mlx5_core_destroy_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq); | ||
674 | int mlx5_core_query_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq, | ||
675 | struct mlx5_query_srq_mbox_out *out); | ||
676 | int mlx5_core_arm_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq, | ||
677 | u16 lwm, int is_srq); | ||
678 | int mlx5_core_create_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr, | ||
679 | struct mlx5_create_mkey_mbox_in *in, int inlen); | ||
680 | int mlx5_core_destroy_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr); | ||
681 | int mlx5_core_query_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr, | ||
682 | struct mlx5_query_mkey_mbox_out *out, int outlen); | ||
683 | int mlx5_core_dump_fill_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr, | ||
684 | u32 *mkey); | ||
685 | int mlx5_core_alloc_pd(struct mlx5_core_dev *dev, u32 *pdn); | ||
686 | int mlx5_core_dealloc_pd(struct mlx5_core_dev *dev, u32 pdn); | ||
687 | int mlx5_core_mad_ifc(struct mlx5_core_dev *dev, void *inb, void *outb, | ||
688 | u16 opmod, int port); | ||
689 | void mlx5_pagealloc_init(struct mlx5_core_dev *dev); | ||
690 | void mlx5_pagealloc_cleanup(struct mlx5_core_dev *dev); | ||
691 | int mlx5_pagealloc_start(struct mlx5_core_dev *dev); | ||
692 | void mlx5_pagealloc_stop(struct mlx5_core_dev *dev); | ||
693 | void mlx5_core_req_pages_handler(struct mlx5_core_dev *dev, u16 func_id, | ||
694 | s16 npages); | ||
695 | int mlx5_satisfy_startup_pages(struct mlx5_core_dev *dev, int boot); | ||
696 | int mlx5_reclaim_startup_pages(struct mlx5_core_dev *dev); | ||
697 | void mlx5_register_debugfs(void); | ||
698 | void mlx5_unregister_debugfs(void); | ||
699 | int mlx5_eq_init(struct mlx5_core_dev *dev); | ||
700 | void mlx5_eq_cleanup(struct mlx5_core_dev *dev); | ||
701 | void mlx5_fill_page_array(struct mlx5_buf *buf, __be64 *pas); | ||
702 | void mlx5_cq_completion(struct mlx5_core_dev *dev, u32 cqn); | ||
703 | void mlx5_qp_event(struct mlx5_core_dev *dev, u32 qpn, int event_type); | ||
704 | void mlx5_srq_event(struct mlx5_core_dev *dev, u32 srqn, int event_type); | ||
705 | struct mlx5_core_srq *mlx5_core_get_srq(struct mlx5_core_dev *dev, u32 srqn); | ||
706 | void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, unsigned long vector); | ||
707 | void mlx5_cq_event(struct mlx5_core_dev *dev, u32 cqn, int event_type); | ||
708 | int mlx5_create_map_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq, u8 vecidx, | ||
709 | int nent, u64 mask, const char *name, struct mlx5_uar *uar); | ||
710 | int mlx5_destroy_unmap_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq); | ||
711 | int mlx5_start_eqs(struct mlx5_core_dev *dev); | ||
712 | int mlx5_stop_eqs(struct mlx5_core_dev *dev); | ||
713 | int mlx5_core_attach_mcg(struct mlx5_core_dev *dev, union ib_gid *mgid, u32 qpn); | ||
714 | int mlx5_core_detach_mcg(struct mlx5_core_dev *dev, union ib_gid *mgid, u32 qpn); | ||
715 | |||
716 | int mlx5_qp_debugfs_init(struct mlx5_core_dev *dev); | ||
717 | void mlx5_qp_debugfs_cleanup(struct mlx5_core_dev *dev); | ||
718 | int mlx5_core_access_reg(struct mlx5_core_dev *dev, void *data_in, | ||
719 | int size_in, void *data_out, int size_out, | ||
720 | u16 reg_num, int arg, int write); | ||
721 | int mlx5_set_port_caps(struct mlx5_core_dev *dev, int port_num, u32 caps); | ||
722 | |||
723 | int mlx5_debug_eq_add(struct mlx5_core_dev *dev, struct mlx5_eq *eq); | ||
724 | void mlx5_debug_eq_remove(struct mlx5_core_dev *dev, struct mlx5_eq *eq); | ||
725 | int mlx5_core_eq_query(struct mlx5_core_dev *dev, struct mlx5_eq *eq, | ||
726 | struct mlx5_query_eq_mbox_out *out, int outlen); | ||
727 | int mlx5_eq_debugfs_init(struct mlx5_core_dev *dev); | ||
728 | void mlx5_eq_debugfs_cleanup(struct mlx5_core_dev *dev); | ||
729 | int mlx5_cq_debugfs_init(struct mlx5_core_dev *dev); | ||
730 | void mlx5_cq_debugfs_cleanup(struct mlx5_core_dev *dev); | ||
731 | int mlx5_db_alloc(struct mlx5_core_dev *dev, struct mlx5_db *db); | ||
732 | void mlx5_db_free(struct mlx5_core_dev *dev, struct mlx5_db *db); | ||
733 | |||
734 | typedef void (*health_handler_t)(struct pci_dev *pdev, struct health_buffer __iomem *buf, int size); | ||
735 | int mlx5_register_health_report_handler(health_handler_t handler); | ||
736 | void mlx5_unregister_health_report_handler(void); | ||
737 | const char *mlx5_command_str(int command); | ||
738 | int mlx5_cmdif_debugfs_init(struct mlx5_core_dev *dev); | ||
739 | void mlx5_cmdif_debugfs_cleanup(struct mlx5_core_dev *dev); | ||
740 | |||
741 | static inline u32 mlx5_mkey_to_idx(u32 mkey) | ||
742 | { | ||
743 | return mkey >> 8; | ||
744 | } | ||
745 | |||
746 | static inline u32 mlx5_idx_to_mkey(u32 mkey_idx) | ||
747 | { | ||
748 | return mkey_idx << 8; | ||
749 | } | ||
750 | |||
751 | enum { | ||
752 | MLX5_PROF_MASK_QP_SIZE = (u64)1 << 0, | ||
753 | MLX5_PROF_MASK_CMDIF_CSUM = (u64)1 << 1, | ||
754 | MLX5_PROF_MASK_MR_CACHE = (u64)1 << 2, | ||
755 | }; | ||
756 | |||
757 | enum { | ||
758 | MAX_MR_CACHE_ENTRIES = 16, | ||
759 | }; | ||
760 | |||
761 | struct mlx5_profile { | ||
762 | u64 mask; | ||
763 | u32 log_max_qp; | ||
764 | int cmdif_csum; | ||
765 | struct { | ||
766 | int size; | ||
767 | int limit; | ||
768 | } mr_cache[MAX_MR_CACHE_ENTRIES]; | ||
769 | }; | ||
770 | |||
771 | #endif /* MLX5_DRIVER_H */ | ||
diff --git a/include/linux/mlx5/qp.h b/include/linux/mlx5/qp.h new file mode 100644 index 000000000000..d9e3eacb3a7f --- /dev/null +++ b/include/linux/mlx5/qp.h | |||
@@ -0,0 +1,467 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2013, Mellanox Technologies inc. All rights reserved. | ||
3 | * | ||
4 | * This software is available to you under a choice of one of two | ||
5 | * licenses. You may choose to be licensed under the terms of the GNU | ||
6 | * General Public License (GPL) Version 2, available from the file | ||
7 | * COPYING in the main directory of this source tree, or the | ||
8 | * OpenIB.org BSD license below: | ||
9 | * | ||
10 | * Redistribution and use in source and binary forms, with or | ||
11 | * without modification, are permitted provided that the following | ||
12 | * conditions are met: | ||
13 | * | ||
14 | * - Redistributions of source code must retain the above | ||
15 | * copyright notice, this list of conditions and the following | ||
16 | * disclaimer. | ||
17 | * | ||
18 | * - Redistributions in binary form must reproduce the above | ||
19 | * copyright notice, this list of conditions and the following | ||
20 | * disclaimer in the documentation and/or other materials | ||
21 | * provided with the distribution. | ||
22 | * | ||
23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
25 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
27 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
28 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
30 | * SOFTWARE. | ||
31 | */ | ||
32 | |||
33 | #ifndef MLX5_QP_H | ||
34 | #define MLX5_QP_H | ||
35 | |||
36 | #include <linux/mlx5/device.h> | ||
37 | #include <linux/mlx5/driver.h> | ||
38 | |||
39 | #define MLX5_INVALID_LKEY 0x100 | ||
40 | |||
41 | enum mlx5_qp_optpar { | ||
42 | MLX5_QP_OPTPAR_ALT_ADDR_PATH = 1 << 0, | ||
43 | MLX5_QP_OPTPAR_RRE = 1 << 1, | ||
44 | MLX5_QP_OPTPAR_RAE = 1 << 2, | ||
45 | MLX5_QP_OPTPAR_RWE = 1 << 3, | ||
46 | MLX5_QP_OPTPAR_PKEY_INDEX = 1 << 4, | ||
47 | MLX5_QP_OPTPAR_Q_KEY = 1 << 5, | ||
48 | MLX5_QP_OPTPAR_RNR_TIMEOUT = 1 << 6, | ||
49 | MLX5_QP_OPTPAR_PRIMARY_ADDR_PATH = 1 << 7, | ||
50 | MLX5_QP_OPTPAR_SRA_MAX = 1 << 8, | ||
51 | MLX5_QP_OPTPAR_RRA_MAX = 1 << 9, | ||
52 | MLX5_QP_OPTPAR_PM_STATE = 1 << 10, | ||
53 | MLX5_QP_OPTPAR_RETRY_COUNT = 1 << 12, | ||
54 | MLX5_QP_OPTPAR_RNR_RETRY = 1 << 13, | ||
55 | MLX5_QP_OPTPAR_ACK_TIMEOUT = 1 << 14, | ||
56 | MLX5_QP_OPTPAR_PRI_PORT = 1 << 16, | ||
57 | MLX5_QP_OPTPAR_SRQN = 1 << 18, | ||
58 | MLX5_QP_OPTPAR_CQN_RCV = 1 << 19, | ||
59 | MLX5_QP_OPTPAR_DC_HS = 1 << 20, | ||
60 | MLX5_QP_OPTPAR_DC_KEY = 1 << 21, | ||
61 | }; | ||
62 | |||
63 | enum mlx5_qp_state { | ||
64 | MLX5_QP_STATE_RST = 0, | ||
65 | MLX5_QP_STATE_INIT = 1, | ||
66 | MLX5_QP_STATE_RTR = 2, | ||
67 | MLX5_QP_STATE_RTS = 3, | ||
68 | MLX5_QP_STATE_SQER = 4, | ||
69 | MLX5_QP_STATE_SQD = 5, | ||
70 | MLX5_QP_STATE_ERR = 6, | ||
71 | MLX5_QP_STATE_SQ_DRAINING = 7, | ||
72 | MLX5_QP_STATE_SUSPENDED = 9, | ||
73 | MLX5_QP_NUM_STATE | ||
74 | }; | ||
75 | |||
76 | enum { | ||
77 | MLX5_QP_ST_RC = 0x0, | ||
78 | MLX5_QP_ST_UC = 0x1, | ||
79 | MLX5_QP_ST_UD = 0x2, | ||
80 | MLX5_QP_ST_XRC = 0x3, | ||
81 | MLX5_QP_ST_MLX = 0x4, | ||
82 | MLX5_QP_ST_DCI = 0x5, | ||
83 | MLX5_QP_ST_DCT = 0x6, | ||
84 | MLX5_QP_ST_QP0 = 0x7, | ||
85 | MLX5_QP_ST_QP1 = 0x8, | ||
86 | MLX5_QP_ST_RAW_ETHERTYPE = 0x9, | ||
87 | MLX5_QP_ST_RAW_IPV6 = 0xa, | ||
88 | MLX5_QP_ST_SNIFFER = 0xb, | ||
89 | MLX5_QP_ST_SYNC_UMR = 0xe, | ||
90 | MLX5_QP_ST_PTP_1588 = 0xd, | ||
91 | MLX5_QP_ST_REG_UMR = 0xc, | ||
92 | MLX5_QP_ST_MAX | ||
93 | }; | ||
94 | |||
95 | enum { | ||
96 | MLX5_QP_PM_MIGRATED = 0x3, | ||
97 | MLX5_QP_PM_ARMED = 0x0, | ||
98 | MLX5_QP_PM_REARM = 0x1 | ||
99 | }; | ||
100 | |||
101 | enum { | ||
102 | MLX5_NON_ZERO_RQ = 0 << 24, | ||
103 | MLX5_SRQ_RQ = 1 << 24, | ||
104 | MLX5_CRQ_RQ = 2 << 24, | ||
105 | MLX5_ZERO_LEN_RQ = 3 << 24 | ||
106 | }; | ||
107 | |||
108 | enum { | ||
109 | /* params1 */ | ||
110 | MLX5_QP_BIT_SRE = 1 << 15, | ||
111 | MLX5_QP_BIT_SWE = 1 << 14, | ||
112 | MLX5_QP_BIT_SAE = 1 << 13, | ||
113 | /* params2 */ | ||
114 | MLX5_QP_BIT_RRE = 1 << 15, | ||
115 | MLX5_QP_BIT_RWE = 1 << 14, | ||
116 | MLX5_QP_BIT_RAE = 1 << 13, | ||
117 | MLX5_QP_BIT_RIC = 1 << 4, | ||
118 | }; | ||
119 | |||
120 | enum { | ||
121 | MLX5_WQE_CTRL_CQ_UPDATE = 2 << 2, | ||
122 | MLX5_WQE_CTRL_SOLICITED = 1 << 1, | ||
123 | }; | ||
124 | |||
125 | enum { | ||
126 | MLX5_SEND_WQE_BB = 64, | ||
127 | }; | ||
128 | |||
129 | enum { | ||
130 | MLX5_WQE_FMR_PERM_LOCAL_READ = 1 << 27, | ||
131 | MLX5_WQE_FMR_PERM_LOCAL_WRITE = 1 << 28, | ||
132 | MLX5_WQE_FMR_PERM_REMOTE_READ = 1 << 29, | ||
133 | MLX5_WQE_FMR_PERM_REMOTE_WRITE = 1 << 30, | ||
134 | MLX5_WQE_FMR_PERM_ATOMIC = 1 << 31 | ||
135 | }; | ||
136 | |||
137 | enum { | ||
138 | MLX5_FENCE_MODE_NONE = 0 << 5, | ||
139 | MLX5_FENCE_MODE_INITIATOR_SMALL = 1 << 5, | ||
140 | MLX5_FENCE_MODE_STRONG_ORDERING = 3 << 5, | ||
141 | MLX5_FENCE_MODE_SMALL_AND_FENCE = 4 << 5, | ||
142 | }; | ||
143 | |||
144 | enum { | ||
145 | MLX5_QP_LAT_SENSITIVE = 1 << 28, | ||
146 | MLX5_QP_ENABLE_SIG = 1 << 31, | ||
147 | }; | ||
148 | |||
149 | enum { | ||
150 | MLX5_RCV_DBR = 0, | ||
151 | MLX5_SND_DBR = 1, | ||
152 | }; | ||
153 | |||
154 | struct mlx5_wqe_fmr_seg { | ||
155 | __be32 flags; | ||
156 | __be32 mem_key; | ||
157 | __be64 buf_list; | ||
158 | __be64 start_addr; | ||
159 | __be64 reg_len; | ||
160 | __be32 offset; | ||
161 | __be32 page_size; | ||
162 | u32 reserved[2]; | ||
163 | }; | ||
164 | |||
165 | struct mlx5_wqe_ctrl_seg { | ||
166 | __be32 opmod_idx_opcode; | ||
167 | __be32 qpn_ds; | ||
168 | u8 signature; | ||
169 | u8 rsvd[2]; | ||
170 | u8 fm_ce_se; | ||
171 | __be32 imm; | ||
172 | }; | ||
173 | |||
174 | struct mlx5_wqe_xrc_seg { | ||
175 | __be32 xrc_srqn; | ||
176 | u8 rsvd[12]; | ||
177 | }; | ||
178 | |||
179 | struct mlx5_wqe_masked_atomic_seg { | ||
180 | __be64 swap_add; | ||
181 | __be64 compare; | ||
182 | __be64 swap_add_mask; | ||
183 | __be64 compare_mask; | ||
184 | }; | ||
185 | |||
186 | struct mlx5_av { | ||
187 | union { | ||
188 | struct { | ||
189 | __be32 qkey; | ||
190 | __be32 reserved; | ||
191 | } qkey; | ||
192 | __be64 dc_key; | ||
193 | } key; | ||
194 | __be32 dqp_dct; | ||
195 | u8 stat_rate_sl; | ||
196 | u8 fl_mlid; | ||
197 | __be16 rlid; | ||
198 | u8 reserved0[10]; | ||
199 | u8 tclass; | ||
200 | u8 hop_limit; | ||
201 | __be32 grh_gid_fl; | ||
202 | u8 rgid[16]; | ||
203 | }; | ||
204 | |||
205 | struct mlx5_wqe_datagram_seg { | ||
206 | struct mlx5_av av; | ||
207 | }; | ||
208 | |||
209 | struct mlx5_wqe_raddr_seg { | ||
210 | __be64 raddr; | ||
211 | __be32 rkey; | ||
212 | u32 reserved; | ||
213 | }; | ||
214 | |||
215 | struct mlx5_wqe_atomic_seg { | ||
216 | __be64 swap_add; | ||
217 | __be64 compare; | ||
218 | }; | ||
219 | |||
220 | struct mlx5_wqe_data_seg { | ||
221 | __be32 byte_count; | ||
222 | __be32 lkey; | ||
223 | __be64 addr; | ||
224 | }; | ||
225 | |||
226 | struct mlx5_wqe_umr_ctrl_seg { | ||
227 | u8 flags; | ||
228 | u8 rsvd0[3]; | ||
229 | __be16 klm_octowords; | ||
230 | __be16 bsf_octowords; | ||
231 | __be64 mkey_mask; | ||
232 | u8 rsvd1[32]; | ||
233 | }; | ||
234 | |||
235 | struct mlx5_seg_set_psv { | ||
236 | __be32 psv_num; | ||
237 | __be16 syndrome; | ||
238 | __be16 status; | ||
239 | __be32 transient_sig; | ||
240 | __be32 ref_tag; | ||
241 | }; | ||
242 | |||
243 | struct mlx5_seg_get_psv { | ||
244 | u8 rsvd[19]; | ||
245 | u8 num_psv; | ||
246 | __be32 l_key; | ||
247 | __be64 va; | ||
248 | __be32 psv_index[4]; | ||
249 | }; | ||
250 | |||
251 | struct mlx5_seg_check_psv { | ||
252 | u8 rsvd0[2]; | ||
253 | __be16 err_coalescing_op; | ||
254 | u8 rsvd1[2]; | ||
255 | __be16 xport_err_op; | ||
256 | u8 rsvd2[2]; | ||
257 | __be16 xport_err_mask; | ||
258 | u8 rsvd3[7]; | ||
259 | u8 num_psv; | ||
260 | __be32 l_key; | ||
261 | __be64 va; | ||
262 | __be32 psv_index[4]; | ||
263 | }; | ||
264 | |||
265 | struct mlx5_rwqe_sig { | ||
266 | u8 rsvd0[4]; | ||
267 | u8 signature; | ||
268 | u8 rsvd1[11]; | ||
269 | }; | ||
270 | |||
271 | struct mlx5_wqe_signature_seg { | ||
272 | u8 rsvd0[4]; | ||
273 | u8 signature; | ||
274 | u8 rsvd1[11]; | ||
275 | }; | ||
276 | |||
277 | struct mlx5_wqe_inline_seg { | ||
278 | __be32 byte_count; | ||
279 | }; | ||
280 | |||
281 | struct mlx5_core_qp { | ||
282 | void (*event) (struct mlx5_core_qp *, int); | ||
283 | int qpn; | ||
284 | atomic_t refcount; | ||
285 | struct completion free; | ||
286 | struct mlx5_rsc_debug *dbg; | ||
287 | int pid; | ||
288 | }; | ||
289 | |||
290 | struct mlx5_qp_path { | ||
291 | u8 fl; | ||
292 | u8 rsvd3; | ||
293 | u8 free_ar; | ||
294 | u8 pkey_index; | ||
295 | u8 rsvd0; | ||
296 | u8 grh_mlid; | ||
297 | __be16 rlid; | ||
298 | u8 ackto_lt; | ||
299 | u8 mgid_index; | ||
300 | u8 static_rate; | ||
301 | u8 hop_limit; | ||
302 | __be32 tclass_flowlabel; | ||
303 | u8 rgid[16]; | ||
304 | u8 rsvd1[4]; | ||
305 | u8 sl; | ||
306 | u8 port; | ||
307 | u8 rsvd2[6]; | ||
308 | }; | ||
309 | |||
310 | struct mlx5_qp_context { | ||
311 | __be32 flags; | ||
312 | __be32 flags_pd; | ||
313 | u8 mtu_msgmax; | ||
314 | u8 rq_size_stride; | ||
315 | __be16 sq_crq_size; | ||
316 | __be32 qp_counter_set_usr_page; | ||
317 | __be32 wire_qpn; | ||
318 | __be32 log_pg_sz_remote_qpn; | ||
319 | struct mlx5_qp_path pri_path; | ||
320 | struct mlx5_qp_path alt_path; | ||
321 | __be32 params1; | ||
322 | u8 reserved2[4]; | ||
323 | __be32 next_send_psn; | ||
324 | __be32 cqn_send; | ||
325 | u8 reserved3[8]; | ||
326 | __be32 last_acked_psn; | ||
327 | __be32 ssn; | ||
328 | __be32 params2; | ||
329 | __be32 rnr_nextrecvpsn; | ||
330 | __be32 xrcd; | ||
331 | __be32 cqn_recv; | ||
332 | __be64 db_rec_addr; | ||
333 | __be32 qkey; | ||
334 | __be32 rq_type_srqn; | ||
335 | __be32 rmsn; | ||
336 | __be16 hw_sq_wqe_counter; | ||
337 | __be16 sw_sq_wqe_counter; | ||
338 | __be16 hw_rcyclic_byte_counter; | ||
339 | __be16 hw_rq_counter; | ||
340 | __be16 sw_rcyclic_byte_counter; | ||
341 | __be16 sw_rq_counter; | ||
342 | u8 rsvd0[5]; | ||
343 | u8 cgs; | ||
344 | u8 cs_req; | ||
345 | u8 cs_res; | ||
346 | __be64 dc_access_key; | ||
347 | u8 rsvd1[24]; | ||
348 | }; | ||
349 | |||
350 | struct mlx5_create_qp_mbox_in { | ||
351 | struct mlx5_inbox_hdr hdr; | ||
352 | __be32 input_qpn; | ||
353 | u8 rsvd0[4]; | ||
354 | __be32 opt_param_mask; | ||
355 | u8 rsvd1[4]; | ||
356 | struct mlx5_qp_context ctx; | ||
357 | u8 rsvd3[16]; | ||
358 | __be64 pas[0]; | ||
359 | }; | ||
360 | |||
361 | struct mlx5_create_qp_mbox_out { | ||
362 | struct mlx5_outbox_hdr hdr; | ||
363 | __be32 qpn; | ||
364 | u8 rsvd0[4]; | ||
365 | }; | ||
366 | |||
367 | struct mlx5_destroy_qp_mbox_in { | ||
368 | struct mlx5_inbox_hdr hdr; | ||
369 | __be32 qpn; | ||
370 | u8 rsvd0[4]; | ||
371 | }; | ||
372 | |||
373 | struct mlx5_destroy_qp_mbox_out { | ||
374 | struct mlx5_outbox_hdr hdr; | ||
375 | u8 rsvd0[8]; | ||
376 | }; | ||
377 | |||
378 | struct mlx5_modify_qp_mbox_in { | ||
379 | struct mlx5_inbox_hdr hdr; | ||
380 | __be32 qpn; | ||
381 | u8 rsvd1[4]; | ||
382 | __be32 optparam; | ||
383 | u8 rsvd0[4]; | ||
384 | struct mlx5_qp_context ctx; | ||
385 | }; | ||
386 | |||
387 | struct mlx5_modify_qp_mbox_out { | ||
388 | struct mlx5_outbox_hdr hdr; | ||
389 | u8 rsvd0[8]; | ||
390 | }; | ||
391 | |||
392 | struct mlx5_query_qp_mbox_in { | ||
393 | struct mlx5_inbox_hdr hdr; | ||
394 | __be32 qpn; | ||
395 | u8 rsvd[4]; | ||
396 | }; | ||
397 | |||
398 | struct mlx5_query_qp_mbox_out { | ||
399 | struct mlx5_outbox_hdr hdr; | ||
400 | u8 rsvd1[8]; | ||
401 | __be32 optparam; | ||
402 | u8 rsvd0[4]; | ||
403 | struct mlx5_qp_context ctx; | ||
404 | u8 rsvd2[16]; | ||
405 | __be64 pas[0]; | ||
406 | }; | ||
407 | |||
408 | struct mlx5_conf_sqp_mbox_in { | ||
409 | struct mlx5_inbox_hdr hdr; | ||
410 | __be32 qpn; | ||
411 | u8 rsvd[3]; | ||
412 | u8 type; | ||
413 | }; | ||
414 | |||
415 | struct mlx5_conf_sqp_mbox_out { | ||
416 | struct mlx5_outbox_hdr hdr; | ||
417 | u8 rsvd[8]; | ||
418 | }; | ||
419 | |||
420 | struct mlx5_alloc_xrcd_mbox_in { | ||
421 | struct mlx5_inbox_hdr hdr; | ||
422 | u8 rsvd[8]; | ||
423 | }; | ||
424 | |||
425 | struct mlx5_alloc_xrcd_mbox_out { | ||
426 | struct mlx5_outbox_hdr hdr; | ||
427 | __be32 xrcdn; | ||
428 | u8 rsvd[4]; | ||
429 | }; | ||
430 | |||
431 | struct mlx5_dealloc_xrcd_mbox_in { | ||
432 | struct mlx5_inbox_hdr hdr; | ||
433 | __be32 xrcdn; | ||
434 | u8 rsvd[4]; | ||
435 | }; | ||
436 | |||
437 | struct mlx5_dealloc_xrcd_mbox_out { | ||
438 | struct mlx5_outbox_hdr hdr; | ||
439 | u8 rsvd[8]; | ||
440 | }; | ||
441 | |||
442 | static inline struct mlx5_core_qp *__mlx5_qp_lookup(struct mlx5_core_dev *dev, u32 qpn) | ||
443 | { | ||
444 | return radix_tree_lookup(&dev->priv.qp_table.tree, qpn); | ||
445 | } | ||
446 | |||
447 | int mlx5_core_create_qp(struct mlx5_core_dev *dev, | ||
448 | struct mlx5_core_qp *qp, | ||
449 | struct mlx5_create_qp_mbox_in *in, | ||
450 | int inlen); | ||
451 | int mlx5_core_qp_modify(struct mlx5_core_dev *dev, enum mlx5_qp_state cur_state, | ||
452 | enum mlx5_qp_state new_state, | ||
453 | struct mlx5_modify_qp_mbox_in *in, int sqd_event, | ||
454 | struct mlx5_core_qp *qp); | ||
455 | int mlx5_core_destroy_qp(struct mlx5_core_dev *dev, | ||
456 | struct mlx5_core_qp *qp); | ||
457 | int mlx5_core_qp_query(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp, | ||
458 | struct mlx5_query_qp_mbox_out *out, int outlen); | ||
459 | |||
460 | int mlx5_core_xrcd_alloc(struct mlx5_core_dev *dev, u32 *xrcdn); | ||
461 | int mlx5_core_xrcd_dealloc(struct mlx5_core_dev *dev, u32 xrcdn); | ||
462 | void mlx5_init_qp_table(struct mlx5_core_dev *dev); | ||
463 | void mlx5_cleanup_qp_table(struct mlx5_core_dev *dev); | ||
464 | int mlx5_debug_qp_add(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp); | ||
465 | void mlx5_debug_qp_remove(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp); | ||
466 | |||
467 | #endif /* MLX5_QP_H */ | ||
diff --git a/include/linux/mlx5/srq.h b/include/linux/mlx5/srq.h new file mode 100644 index 000000000000..e1a363a33663 --- /dev/null +++ b/include/linux/mlx5/srq.h | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2013, Mellanox Technologies inc. All rights reserved. | ||
3 | * | ||
4 | * This software is available to you under a choice of one of two | ||
5 | * licenses. You may choose to be licensed under the terms of the GNU | ||
6 | * General Public License (GPL) Version 2, available from the file | ||
7 | * COPYING in the main directory of this source tree, or the | ||
8 | * OpenIB.org BSD license below: | ||
9 | * | ||
10 | * Redistribution and use in source and binary forms, with or | ||
11 | * without modification, are permitted provided that the following | ||
12 | * conditions are met: | ||
13 | * | ||
14 | * - Redistributions of source code must retain the above | ||
15 | * copyright notice, this list of conditions and the following | ||
16 | * disclaimer. | ||
17 | * | ||
18 | * - Redistributions in binary form must reproduce the above | ||
19 | * copyright notice, this list of conditions and the following | ||
20 | * disclaimer in the documentation and/or other materials | ||
21 | * provided with the distribution. | ||
22 | * | ||
23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
25 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
27 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
28 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
30 | * SOFTWARE. | ||
31 | */ | ||
32 | |||
33 | #ifndef MLX5_SRQ_H | ||
34 | #define MLX5_SRQ_H | ||
35 | |||
36 | #include <linux/mlx5/driver.h> | ||
37 | |||
38 | void mlx5_init_srq_table(struct mlx5_core_dev *dev); | ||
39 | void mlx5_cleanup_srq_table(struct mlx5_core_dev *dev); | ||
40 | |||
41 | #endif /* MLX5_SRQ_H */ | ||
diff --git a/include/linux/mm.h b/include/linux/mm.h index e0c8528a41a4..f0224608d15e 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -25,11 +25,17 @@ struct file_ra_state; | |||
25 | struct user_struct; | 25 | struct user_struct; |
26 | struct writeback_control; | 26 | struct writeback_control; |
27 | 27 | ||
28 | #ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */ | 28 | #ifndef CONFIG_NEED_MULTIPLE_NODES /* Don't use mapnrs, do it properly */ |
29 | extern unsigned long max_mapnr; | 29 | extern unsigned long max_mapnr; |
30 | |||
31 | static inline void set_max_mapnr(unsigned long limit) | ||
32 | { | ||
33 | max_mapnr = limit; | ||
34 | } | ||
35 | #else | ||
36 | static inline void set_max_mapnr(unsigned long limit) { } | ||
30 | #endif | 37 | #endif |
31 | 38 | ||
32 | extern unsigned long num_physpages; | ||
33 | extern unsigned long totalram_pages; | 39 | extern unsigned long totalram_pages; |
34 | extern void * high_memory; | 40 | extern void * high_memory; |
35 | extern int page_cluster; | 41 | extern int page_cluster; |
@@ -52,6 +58,9 @@ extern unsigned long sysctl_admin_reserve_kbytes; | |||
52 | /* to align the pointer to the (next) page boundary */ | 58 | /* to align the pointer to the (next) page boundary */ |
53 | #define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE) | 59 | #define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE) |
54 | 60 | ||
61 | /* test whether an address (unsigned long or pointer) is aligned to PAGE_SIZE */ | ||
62 | #define PAGE_ALIGNED(addr) IS_ALIGNED((unsigned long)addr, PAGE_SIZE) | ||
63 | |||
55 | /* | 64 | /* |
56 | * Linux kernel virtual memory manager primitives. | 65 | * Linux kernel virtual memory manager primitives. |
57 | * The idea being to have a "virtual" mm in the same way | 66 | * The idea being to have a "virtual" mm in the same way |
@@ -142,12 +151,6 @@ extern unsigned int kobjsize(const void *objp); | |||
142 | #define VM_STACK_FLAGS (VM_GROWSDOWN | VM_STACK_DEFAULT_FLAGS | VM_ACCOUNT) | 151 | #define VM_STACK_FLAGS (VM_GROWSDOWN | VM_STACK_DEFAULT_FLAGS | VM_ACCOUNT) |
143 | #endif | 152 | #endif |
144 | 153 | ||
145 | #define VM_READHINTMASK (VM_SEQ_READ | VM_RAND_READ) | ||
146 | #define VM_ClearReadHint(v) (v)->vm_flags &= ~VM_READHINTMASK | ||
147 | #define VM_NormalReadHint(v) (!((v)->vm_flags & VM_READHINTMASK)) | ||
148 | #define VM_SequentialReadHint(v) ((v)->vm_flags & VM_SEQ_READ) | ||
149 | #define VM_RandomReadHint(v) ((v)->vm_flags & VM_RAND_READ) | ||
150 | |||
151 | /* | 154 | /* |
152 | * Special vmas that are non-mergable, non-mlock()able. | 155 | * Special vmas that are non-mergable, non-mlock()able. |
153 | * Note: mm/huge_memory.c VM_NO_THP depends on this definition. | 156 | * Note: mm/huge_memory.c VM_NO_THP depends on this definition. |
@@ -1041,7 +1044,8 @@ int get_kernel_page(unsigned long start, int write, struct page **pages); | |||
1041 | struct page *get_dump_page(unsigned long addr); | 1044 | struct page *get_dump_page(unsigned long addr); |
1042 | 1045 | ||
1043 | extern int try_to_release_page(struct page * page, gfp_t gfp_mask); | 1046 | extern int try_to_release_page(struct page * page, gfp_t gfp_mask); |
1044 | extern void do_invalidatepage(struct page *page, unsigned long offset); | 1047 | extern void do_invalidatepage(struct page *page, unsigned int offset, |
1048 | unsigned int length); | ||
1045 | 1049 | ||
1046 | int __set_page_dirty_nobuffers(struct page *page); | 1050 | int __set_page_dirty_nobuffers(struct page *page); |
1047 | int __set_page_dirty_no_writeback(struct page *page); | 1051 | int __set_page_dirty_no_writeback(struct page *page); |
@@ -1304,11 +1308,12 @@ extern void free_initmem(void); | |||
1304 | /* | 1308 | /* |
1305 | * Free reserved pages within range [PAGE_ALIGN(start), end & PAGE_MASK) | 1309 | * Free reserved pages within range [PAGE_ALIGN(start), end & PAGE_MASK) |
1306 | * into the buddy system. The freed pages will be poisoned with pattern | 1310 | * into the buddy system. The freed pages will be poisoned with pattern |
1307 | * "poison" if it's non-zero. | 1311 | * "poison" if it's within range [0, UCHAR_MAX]. |
1308 | * Return pages freed into the buddy system. | 1312 | * Return pages freed into the buddy system. |
1309 | */ | 1313 | */ |
1310 | extern unsigned long free_reserved_area(unsigned long start, unsigned long end, | 1314 | extern unsigned long free_reserved_area(void *start, void *end, |
1311 | int poison, char *s); | 1315 | int poison, char *s); |
1316 | |||
1312 | #ifdef CONFIG_HIGHMEM | 1317 | #ifdef CONFIG_HIGHMEM |
1313 | /* | 1318 | /* |
1314 | * Free a highmem page into the buddy system, adjusting totalhigh_pages | 1319 | * Free a highmem page into the buddy system, adjusting totalhigh_pages |
@@ -1317,10 +1322,8 @@ extern unsigned long free_reserved_area(unsigned long start, unsigned long end, | |||
1317 | extern void free_highmem_page(struct page *page); | 1322 | extern void free_highmem_page(struct page *page); |
1318 | #endif | 1323 | #endif |
1319 | 1324 | ||
1320 | static inline void adjust_managed_page_count(struct page *page, long count) | 1325 | extern void adjust_managed_page_count(struct page *page, long count); |
1321 | { | 1326 | extern void mem_init_print_info(const char *str); |
1322 | totalram_pages += count; | ||
1323 | } | ||
1324 | 1327 | ||
1325 | /* Free the reserved page into the buddy system, so it gets managed. */ | 1328 | /* Free the reserved page into the buddy system, so it gets managed. */ |
1326 | static inline void __free_reserved_page(struct page *page) | 1329 | static inline void __free_reserved_page(struct page *page) |
@@ -1344,18 +1347,29 @@ static inline void mark_page_reserved(struct page *page) | |||
1344 | 1347 | ||
1345 | /* | 1348 | /* |
1346 | * Default method to free all the __init memory into the buddy system. | 1349 | * Default method to free all the __init memory into the buddy system. |
1347 | * The freed pages will be poisoned with pattern "poison" if it is | 1350 | * The freed pages will be poisoned with pattern "poison" if it's within |
1348 | * non-zero. Return pages freed into the buddy system. | 1351 | * range [0, UCHAR_MAX]. |
1352 | * Return pages freed into the buddy system. | ||
1349 | */ | 1353 | */ |
1350 | static inline unsigned long free_initmem_default(int poison) | 1354 | static inline unsigned long free_initmem_default(int poison) |
1351 | { | 1355 | { |
1352 | extern char __init_begin[], __init_end[]; | 1356 | extern char __init_begin[], __init_end[]; |
1353 | 1357 | ||
1354 | return free_reserved_area(PAGE_ALIGN((unsigned long)&__init_begin) , | 1358 | return free_reserved_area(&__init_begin, &__init_end, |
1355 | ((unsigned long)&__init_end) & PAGE_MASK, | ||
1356 | poison, "unused kernel"); | 1359 | poison, "unused kernel"); |
1357 | } | 1360 | } |
1358 | 1361 | ||
1362 | static inline unsigned long get_num_physpages(void) | ||
1363 | { | ||
1364 | int nid; | ||
1365 | unsigned long phys_pages = 0; | ||
1366 | |||
1367 | for_each_online_node(nid) | ||
1368 | phys_pages += node_present_pages(nid); | ||
1369 | |||
1370 | return phys_pages; | ||
1371 | } | ||
1372 | |||
1359 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP | 1373 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP |
1360 | /* | 1374 | /* |
1361 | * With CONFIG_HAVE_MEMBLOCK_NODE_MAP set, an architecture may initialise its | 1375 | * With CONFIG_HAVE_MEMBLOCK_NODE_MAP set, an architecture may initialise its |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index ace9a5f01c64..fb425aa16c01 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -330,12 +330,9 @@ struct mm_struct { | |||
330 | unsigned long (*get_unmapped_area) (struct file *filp, | 330 | unsigned long (*get_unmapped_area) (struct file *filp, |
331 | unsigned long addr, unsigned long len, | 331 | unsigned long addr, unsigned long len, |
332 | unsigned long pgoff, unsigned long flags); | 332 | unsigned long pgoff, unsigned long flags); |
333 | void (*unmap_area) (struct mm_struct *mm, unsigned long addr); | ||
334 | #endif | 333 | #endif |
335 | unsigned long mmap_base; /* base of mmap area */ | 334 | unsigned long mmap_base; /* base of mmap area */ |
336 | unsigned long task_size; /* size of task vm space */ | 335 | unsigned long task_size; /* size of task vm space */ |
337 | unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */ | ||
338 | unsigned long free_area_cache; /* first hole of size cached_hole_size or larger */ | ||
339 | unsigned long highest_vm_end; /* highest vma end address */ | 336 | unsigned long highest_vm_end; /* highest vma end address */ |
340 | pgd_t * pgd; | 337 | pgd_t * pgd; |
341 | atomic_t mm_users; /* How many users with user space? */ | 338 | atomic_t mm_users; /* How many users with user space? */ |
diff --git a/include/linux/mman.h b/include/linux/mman.h index 9aa863da287f..92dc257251e4 100644 --- a/include/linux/mman.h +++ b/include/linux/mman.h | |||
@@ -11,11 +11,17 @@ extern int sysctl_overcommit_memory; | |||
11 | extern int sysctl_overcommit_ratio; | 11 | extern int sysctl_overcommit_ratio; |
12 | extern struct percpu_counter vm_committed_as; | 12 | extern struct percpu_counter vm_committed_as; |
13 | 13 | ||
14 | #ifdef CONFIG_SMP | ||
15 | extern s32 vm_committed_as_batch; | ||
16 | #else | ||
17 | #define vm_committed_as_batch 0 | ||
18 | #endif | ||
19 | |||
14 | unsigned long vm_memory_committed(void); | 20 | unsigned long vm_memory_committed(void); |
15 | 21 | ||
16 | static inline void vm_acct_memory(long pages) | 22 | static inline void vm_acct_memory(long pages) |
17 | { | 23 | { |
18 | percpu_counter_add(&vm_committed_as, pages); | 24 | __percpu_counter_add(&vm_committed_as, pages, vm_committed_as_batch); |
19 | } | 25 | } |
20 | 26 | ||
21 | static inline void vm_unacct_memory(long pages) | 27 | static inline void vm_unacct_memory(long pages) |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index f31725ba49f3..842de3e21e70 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
@@ -94,7 +94,11 @@ struct mmc_ext_csd { | |||
94 | u8 raw_ext_csd_structure; /* 194 */ | 94 | u8 raw_ext_csd_structure; /* 194 */ |
95 | u8 raw_card_type; /* 196 */ | 95 | u8 raw_card_type; /* 196 */ |
96 | u8 out_of_int_time; /* 198 */ | 96 | u8 out_of_int_time; /* 198 */ |
97 | u8 raw_s_a_timeout; /* 217 */ | 97 | u8 raw_pwr_cl_52_195; /* 200 */ |
98 | u8 raw_pwr_cl_26_195; /* 201 */ | ||
99 | u8 raw_pwr_cl_52_360; /* 202 */ | ||
100 | u8 raw_pwr_cl_26_360; /* 203 */ | ||
101 | u8 raw_s_a_timeout; /* 217 */ | ||
98 | u8 raw_hc_erase_gap_size; /* 221 */ | 102 | u8 raw_hc_erase_gap_size; /* 221 */ |
99 | u8 raw_erase_timeout_mult; /* 223 */ | 103 | u8 raw_erase_timeout_mult; /* 223 */ |
100 | u8 raw_hc_erase_grp_size; /* 224 */ | 104 | u8 raw_hc_erase_grp_size; /* 224 */ |
@@ -102,6 +106,10 @@ struct mmc_ext_csd { | |||
102 | u8 raw_sec_erase_mult; /* 230 */ | 106 | u8 raw_sec_erase_mult; /* 230 */ |
103 | u8 raw_sec_feature_support;/* 231 */ | 107 | u8 raw_sec_feature_support;/* 231 */ |
104 | u8 raw_trim_mult; /* 232 */ | 108 | u8 raw_trim_mult; /* 232 */ |
109 | u8 raw_pwr_cl_200_195; /* 236 */ | ||
110 | u8 raw_pwr_cl_200_360; /* 237 */ | ||
111 | u8 raw_pwr_cl_ddr_52_195; /* 238 */ | ||
112 | u8 raw_pwr_cl_ddr_52_360; /* 239 */ | ||
105 | u8 raw_bkops_status; /* 246 */ | 113 | u8 raw_bkops_status; /* 246 */ |
106 | u8 raw_sectors[4]; /* 212 - 4 bytes */ | 114 | u8 raw_sectors[4]; /* 212 - 4 bytes */ |
107 | 115 | ||
@@ -512,6 +520,7 @@ struct mmc_driver { | |||
512 | void (*remove)(struct mmc_card *); | 520 | void (*remove)(struct mmc_card *); |
513 | int (*suspend)(struct mmc_card *); | 521 | int (*suspend)(struct mmc_card *); |
514 | int (*resume)(struct mmc_card *); | 522 | int (*resume)(struct mmc_card *); |
523 | void (*shutdown)(struct mmc_card *); | ||
515 | }; | 524 | }; |
516 | 525 | ||
517 | extern int mmc_register_driver(struct mmc_driver *); | 526 | extern int mmc_register_driver(struct mmc_driver *); |
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index 39613b9a6fc5..443243b241d5 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h | |||
@@ -96,6 +96,8 @@ struct mmc_command { | |||
96 | */ | 96 | */ |
97 | 97 | ||
98 | unsigned int cmd_timeout_ms; /* in milliseconds */ | 98 | unsigned int cmd_timeout_ms; /* in milliseconds */ |
99 | /* Set this flag only for blocking sanitize request */ | ||
100 | bool sanitize_busy; | ||
99 | 101 | ||
100 | struct mmc_data *data; /* data segment associated with cmd */ | 102 | struct mmc_data *data; /* data segment associated with cmd */ |
101 | struct mmc_request *mrq; /* associated request */ | 103 | struct mmc_request *mrq; /* associated request */ |
@@ -188,6 +190,9 @@ extern int __mmc_claim_host(struct mmc_host *host, atomic_t *abort); | |||
188 | extern void mmc_release_host(struct mmc_host *host); | 190 | extern void mmc_release_host(struct mmc_host *host); |
189 | extern int mmc_try_claim_host(struct mmc_host *host); | 191 | extern int mmc_try_claim_host(struct mmc_host *host); |
190 | 192 | ||
193 | extern void mmc_get_card(struct mmc_card *card); | ||
194 | extern void mmc_put_card(struct mmc_card *card); | ||
195 | |||
191 | extern int mmc_flush_cache(struct mmc_card *); | 196 | extern int mmc_flush_cache(struct mmc_card *); |
192 | 197 | ||
193 | extern int mmc_detect_card_removed(struct mmc_host *host); | 198 | extern int mmc_detect_card_removed(struct mmc_host *host); |
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index e326ae2882a0..3b0c33ae13e1 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -239,7 +239,7 @@ struct mmc_host { | |||
239 | #define MMC_CAP_SPI (1 << 4) /* Talks only SPI protocols */ | 239 | #define MMC_CAP_SPI (1 << 4) /* Talks only SPI protocols */ |
240 | #define MMC_CAP_NEEDS_POLL (1 << 5) /* Needs polling for card-detection */ | 240 | #define MMC_CAP_NEEDS_POLL (1 << 5) /* Needs polling for card-detection */ |
241 | #define MMC_CAP_8_BIT_DATA (1 << 6) /* Can the host do 8 bit transfers */ | 241 | #define MMC_CAP_8_BIT_DATA (1 << 6) /* Can the host do 8 bit transfers */ |
242 | 242 | #define MMC_CAP_AGGRESSIVE_PM (1 << 7) /* Suspend (e)MMC/SD at idle */ | |
243 | #define MMC_CAP_NONREMOVABLE (1 << 8) /* Nonremovable e.g. eMMC */ | 243 | #define MMC_CAP_NONREMOVABLE (1 << 8) /* Nonremovable e.g. eMMC */ |
244 | #define MMC_CAP_WAIT_WHILE_BUSY (1 << 9) /* Waits while card is busy */ | 244 | #define MMC_CAP_WAIT_WHILE_BUSY (1 << 9) /* Waits while card is busy */ |
245 | #define MMC_CAP_ERASE (1 << 10) /* Allow erase/trim commands */ | 245 | #define MMC_CAP_ERASE (1 << 10) /* Allow erase/trim commands */ |
@@ -264,7 +264,7 @@ struct mmc_host { | |||
264 | 264 | ||
265 | #define MMC_CAP2_BOOTPART_NOACC (1 << 0) /* Boot partition no access */ | 265 | #define MMC_CAP2_BOOTPART_NOACC (1 << 0) /* Boot partition no access */ |
266 | #define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */ | 266 | #define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */ |
267 | #define MMC_CAP2_POWEROFF_NOTIFY (1 << 2) /* Notify poweroff supported */ | 267 | #define MMC_CAP2_FULL_PWR_CYCLE (1 << 2) /* Can do full power cycle */ |
268 | #define MMC_CAP2_NO_MULTI_READ (1 << 3) /* Multiblock reads don't work */ | 268 | #define MMC_CAP2_NO_MULTI_READ (1 << 3) /* Multiblock reads don't work */ |
269 | #define MMC_CAP2_NO_SLEEP_CMD (1 << 4) /* Don't allow sleep command */ | 269 | #define MMC_CAP2_NO_SLEEP_CMD (1 << 4) /* Don't allow sleep command */ |
270 | #define MMC_CAP2_HS200_1_8V_SDR (1 << 5) /* can support */ | 270 | #define MMC_CAP2_HS200_1_8V_SDR (1 << 5) /* can support */ |
@@ -272,7 +272,6 @@ struct mmc_host { | |||
272 | #define MMC_CAP2_HS200 (MMC_CAP2_HS200_1_8V_SDR | \ | 272 | #define MMC_CAP2_HS200 (MMC_CAP2_HS200_1_8V_SDR | \ |
273 | MMC_CAP2_HS200_1_2V_SDR) | 273 | MMC_CAP2_HS200_1_2V_SDR) |
274 | #define MMC_CAP2_BROKEN_VOLTAGE (1 << 7) /* Use the broken voltage */ | 274 | #define MMC_CAP2_BROKEN_VOLTAGE (1 << 7) /* Use the broken voltage */ |
275 | #define MMC_CAP2_DETECT_ON_ERR (1 << 8) /* On I/O err check card removal */ | ||
276 | #define MMC_CAP2_HC_ERASE_SZ (1 << 9) /* High-capacity erase size */ | 275 | #define MMC_CAP2_HC_ERASE_SZ (1 << 9) /* High-capacity erase size */ |
277 | #define MMC_CAP2_CD_ACTIVE_HIGH (1 << 10) /* Card-detect signal active high */ | 276 | #define MMC_CAP2_CD_ACTIVE_HIGH (1 << 10) /* Card-detect signal active high */ |
278 | #define MMC_CAP2_RO_ACTIVE_HIGH (1 << 11) /* Write-protect signal active high */ | 277 | #define MMC_CAP2_RO_ACTIVE_HIGH (1 << 11) /* Write-protect signal active high */ |
@@ -281,6 +280,7 @@ struct mmc_host { | |||
281 | #define MMC_CAP2_PACKED_CMD (MMC_CAP2_PACKED_RD | \ | 280 | #define MMC_CAP2_PACKED_CMD (MMC_CAP2_PACKED_RD | \ |
282 | MMC_CAP2_PACKED_WR) | 281 | MMC_CAP2_PACKED_WR) |
283 | #define MMC_CAP2_NO_PRESCAN_POWERUP (1 << 14) /* Don't power up before scan */ | 282 | #define MMC_CAP2_NO_PRESCAN_POWERUP (1 << 14) /* Don't power up before scan */ |
283 | #define MMC_CAP2_SANITIZE (1 << 15) /* Support Sanitize */ | ||
284 | 284 | ||
285 | mmc_pm_flag_t pm_caps; /* supported pm features */ | 285 | mmc_pm_flag_t pm_caps; /* supported pm features */ |
286 | 286 | ||
@@ -369,7 +369,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *); | |||
369 | int mmc_add_host(struct mmc_host *); | 369 | int mmc_add_host(struct mmc_host *); |
370 | void mmc_remove_host(struct mmc_host *); | 370 | void mmc_remove_host(struct mmc_host *); |
371 | void mmc_free_host(struct mmc_host *); | 371 | void mmc_free_host(struct mmc_host *); |
372 | void mmc_of_parse(struct mmc_host *host); | 372 | int mmc_of_parse(struct mmc_host *host); |
373 | 373 | ||
374 | static inline void *mmc_priv(struct mmc_host *host) | 374 | static inline void *mmc_priv(struct mmc_host *host) |
375 | { | 375 | { |
@@ -425,10 +425,6 @@ static inline int mmc_regulator_get_supply(struct mmc_host *mmc) | |||
425 | } | 425 | } |
426 | #endif | 426 | #endif |
427 | 427 | ||
428 | int mmc_card_awake(struct mmc_host *host); | ||
429 | int mmc_card_sleep(struct mmc_host *host); | ||
430 | int mmc_card_can_sleep(struct mmc_host *host); | ||
431 | |||
432 | int mmc_pm_notify(struct notifier_block *notify_block, unsigned long, void *); | 428 | int mmc_pm_notify(struct notifier_block *notify_block, unsigned long, void *); |
433 | 429 | ||
434 | /* Module parameter */ | 430 | /* Module parameter */ |
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index b838ffc49e4a..e3c6a74d980a 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h | |||
@@ -95,6 +95,9 @@ struct sdhci_host { | |||
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 | #define SDHCI_QUIRK2_PRESET_VALUE_BROKEN (1<<3) |
98 | #define SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON (1<<4) | ||
99 | /* Controller has a non-standard host control register */ | ||
100 | #define SDHCI_QUIRK2_BROKEN_HOST_CONTROL (1<<5) | ||
98 | 101 | ||
99 | int irq; /* Device IRQ */ | 102 | int irq; /* Device IRQ */ |
100 | void __iomem *ioaddr; /* Mapped address */ | 103 | void __iomem *ioaddr; /* Mapped address */ |
@@ -126,7 +129,7 @@ struct sdhci_host { | |||
126 | #define SDHCI_AUTO_CMD23 (1<<7) /* Auto CMD23 support */ | 129 | #define SDHCI_AUTO_CMD23 (1<<7) /* Auto CMD23 support */ |
127 | #define SDHCI_PV_ENABLED (1<<8) /* Preset value enabled */ | 130 | #define SDHCI_PV_ENABLED (1<<8) /* Preset value enabled */ |
128 | #define SDHCI_SDIO_IRQ_ENABLED (1<<9) /* SDIO irq enabled */ | 131 | #define SDHCI_SDIO_IRQ_ENABLED (1<<9) /* SDIO irq enabled */ |
129 | #define SDHCI_HS200_NEEDS_TUNING (1<<10) /* HS200 needs tuning */ | 132 | #define SDHCI_SDR104_NEEDS_TUNING (1<<10) /* SDR104/HS200 needs tuning */ |
130 | #define SDHCI_USING_RETUNING_TIMER (1<<11) /* Host is using a retuning timer for the card */ | 133 | #define SDHCI_USING_RETUNING_TIMER (1<<11) /* Host is using a retuning timer for the card */ |
131 | 134 | ||
132 | unsigned int version; /* SDHCI spec. version */ | 135 | unsigned int version; /* SDHCI spec. version */ |
@@ -139,6 +142,7 @@ struct sdhci_host { | |||
139 | u8 pwr; /* Current voltage */ | 142 | u8 pwr; /* Current voltage */ |
140 | 143 | ||
141 | bool runtime_suspended; /* Host is runtime suspended */ | 144 | bool runtime_suspended; /* Host is runtime suspended */ |
145 | bool bus_on; /* Bus power prevents runtime suspend */ | ||
142 | 146 | ||
143 | struct mmc_request *mrq; /* Current request */ | 147 | struct mmc_request *mrq; /* Current request */ |
144 | struct mmc_command *cmd; /* Current command */ | 148 | struct mmc_command *cmd; /* Current command */ |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 5c76737d836b..af4a3b77a8de 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -474,10 +474,16 @@ struct zone { | |||
474 | * frequently read in proximity to zone->lock. It's good to | 474 | * frequently read in proximity to zone->lock. It's good to |
475 | * give them a chance of being in the same cacheline. | 475 | * give them a chance of being in the same cacheline. |
476 | * | 476 | * |
477 | * Write access to present_pages and managed_pages at runtime should | 477 | * Write access to present_pages at runtime should be protected by |
478 | * be protected by lock_memory_hotplug()/unlock_memory_hotplug(). | 478 | * lock_memory_hotplug()/unlock_memory_hotplug(). Any reader who can't |
479 | * Any reader who can't tolerant drift of present_pages and | 479 | * tolerant drift of present_pages should hold memory hotplug lock to |
480 | * managed_pages should hold memory hotplug lock to get a stable value. | 480 | * get a stable value. |
481 | * | ||
482 | * Read access to managed_pages should be safe because it's unsigned | ||
483 | * long. Write access to zone->managed_pages and totalram_pages are | ||
484 | * protected by managed_page_count_lock at runtime. Idealy only | ||
485 | * adjust_managed_page_count() should be used instead of directly | ||
486 | * touching zone->managed_pages and totalram_pages. | ||
481 | */ | 487 | */ |
482 | unsigned long spanned_pages; | 488 | unsigned long spanned_pages; |
483 | unsigned long present_pages; | 489 | unsigned long present_pages; |
@@ -495,6 +501,13 @@ typedef enum { | |||
495 | ZONE_CONGESTED, /* zone has many dirty pages backed by | 501 | ZONE_CONGESTED, /* zone has many dirty pages backed by |
496 | * a congested BDI | 502 | * a congested BDI |
497 | */ | 503 | */ |
504 | ZONE_TAIL_LRU_DIRTY, /* reclaim scanning has recently found | ||
505 | * many dirty file pages at the tail | ||
506 | * of the LRU. | ||
507 | */ | ||
508 | ZONE_WRITEBACK, /* reclaim scanning has recently found | ||
509 | * many pages under writeback | ||
510 | */ | ||
498 | } zone_flags_t; | 511 | } zone_flags_t; |
499 | 512 | ||
500 | static inline void zone_set_flag(struct zone *zone, zone_flags_t flag) | 513 | static inline void zone_set_flag(struct zone *zone, zone_flags_t flag) |
@@ -517,6 +530,16 @@ static inline int zone_is_reclaim_congested(const struct zone *zone) | |||
517 | return test_bit(ZONE_CONGESTED, &zone->flags); | 530 | return test_bit(ZONE_CONGESTED, &zone->flags); |
518 | } | 531 | } |
519 | 532 | ||
533 | static inline int zone_is_reclaim_dirty(const struct zone *zone) | ||
534 | { | ||
535 | return test_bit(ZONE_TAIL_LRU_DIRTY, &zone->flags); | ||
536 | } | ||
537 | |||
538 | static inline int zone_is_reclaim_writeback(const struct zone *zone) | ||
539 | { | ||
540 | return test_bit(ZONE_WRITEBACK, &zone->flags); | ||
541 | } | ||
542 | |||
520 | static inline int zone_is_reclaim_locked(const struct zone *zone) | 543 | static inline int zone_is_reclaim_locked(const struct zone *zone) |
521 | { | 544 | { |
522 | return test_bit(ZONE_RECLAIM_LOCKED, &zone->flags); | 545 | return test_bit(ZONE_RECLAIM_LOCKED, &zone->flags); |
@@ -716,7 +739,10 @@ typedef struct pglist_data { | |||
716 | * or node_spanned_pages stay constant. Holding this will also | 739 | * or node_spanned_pages stay constant. Holding this will also |
717 | * guarantee that any pfn_valid() stays that way. | 740 | * guarantee that any pfn_valid() stays that way. |
718 | * | 741 | * |
719 | * Nests above zone->lock and zone->size_seqlock. | 742 | * pgdat_resize_lock() and pgdat_resize_unlock() are provided to |
743 | * manipulate node_size_lock without checking for CONFIG_MEMORY_HOTPLUG. | ||
744 | * | ||
745 | * Nests above zone->lock and zone->span_seqlock | ||
720 | */ | 746 | */ |
721 | spinlock_t node_size_lock; | 747 | spinlock_t node_size_lock; |
722 | #endif | 748 | #endif |
@@ -843,11 +869,6 @@ static inline int is_highmem_idx(enum zone_type idx) | |||
843 | #endif | 869 | #endif |
844 | } | 870 | } |
845 | 871 | ||
846 | static inline int is_normal_idx(enum zone_type idx) | ||
847 | { | ||
848 | return (idx == ZONE_NORMAL); | ||
849 | } | ||
850 | |||
851 | /** | 872 | /** |
852 | * is_highmem - helper function to quickly check if a struct zone is a | 873 | * is_highmem - helper function to quickly check if a struct zone is a |
853 | * highmem zone or not. This is an attempt to keep references | 874 | * highmem zone or not. This is an attempt to keep references |
@@ -866,29 +887,6 @@ static inline int is_highmem(struct zone *zone) | |||
866 | #endif | 887 | #endif |
867 | } | 888 | } |
868 | 889 | ||
869 | static inline int is_normal(struct zone *zone) | ||
870 | { | ||
871 | return zone == zone->zone_pgdat->node_zones + ZONE_NORMAL; | ||
872 | } | ||
873 | |||
874 | static inline int is_dma32(struct zone *zone) | ||
875 | { | ||
876 | #ifdef CONFIG_ZONE_DMA32 | ||
877 | return zone == zone->zone_pgdat->node_zones + ZONE_DMA32; | ||
878 | #else | ||
879 | return 0; | ||
880 | #endif | ||
881 | } | ||
882 | |||
883 | static inline int is_dma(struct zone *zone) | ||
884 | { | ||
885 | #ifdef CONFIG_ZONE_DMA | ||
886 | return zone == zone->zone_pgdat->node_zones + ZONE_DMA; | ||
887 | #else | ||
888 | return 0; | ||
889 | #endif | ||
890 | } | ||
891 | |||
892 | /* These two functions are used to setup the per zone pages min values */ | 890 | /* These two functions are used to setup the per zone pages min values */ |
893 | struct ctl_table; | 891 | struct ctl_table; |
894 | int min_free_kbytes_sysctl_handler(struct ctl_table *, int, | 892 | int min_free_kbytes_sysctl_handler(struct ctl_table *, int, |
@@ -1111,6 +1109,10 @@ struct mem_section { | |||
1111 | struct page_cgroup *page_cgroup; | 1109 | struct page_cgroup *page_cgroup; |
1112 | unsigned long pad; | 1110 | unsigned long pad; |
1113 | #endif | 1111 | #endif |
1112 | /* | ||
1113 | * WARNING: mem_section must be a power-of-2 in size for the | ||
1114 | * calculation and use of SECTION_ROOT_MASK to make sense. | ||
1115 | */ | ||
1114 | }; | 1116 | }; |
1115 | 1117 | ||
1116 | #ifdef CONFIG_SPARSEMEM_EXTREME | 1118 | #ifdef CONFIG_SPARSEMEM_EXTREME |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index b508016fb76d..45e921401b06 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -361,7 +361,8 @@ struct ssb_device_id { | |||
361 | __u16 vendor; | 361 | __u16 vendor; |
362 | __u16 coreid; | 362 | __u16 coreid; |
363 | __u8 revision; | 363 | __u8 revision; |
364 | }; | 364 | __u8 __pad; |
365 | } __attribute__((packed, aligned(2))); | ||
365 | #define SSB_DEVICE(_vendor, _coreid, _revision) \ | 366 | #define SSB_DEVICE(_vendor, _coreid, _revision) \ |
366 | { .vendor = _vendor, .coreid = _coreid, .revision = _revision, } | 367 | { .vendor = _vendor, .coreid = _coreid, .revision = _revision, } |
367 | #define SSB_DEVTABLE_END \ | 368 | #define SSB_DEVTABLE_END \ |
@@ -377,7 +378,7 @@ struct bcma_device_id { | |||
377 | __u16 id; | 378 | __u16 id; |
378 | __u8 rev; | 379 | __u8 rev; |
379 | __u8 class; | 380 | __u8 class; |
380 | }; | 381 | } __attribute__((packed,aligned(2))); |
381 | #define BCMA_CORE(_manuf, _id, _rev, _class) \ | 382 | #define BCMA_CORE(_manuf, _id, _rev, _class) \ |
382 | { .manuf = _manuf, .id = _id, .rev = _rev, .class = _class, } | 383 | { .manuf = _manuf, .id = _id, .rev = _rev, .class = _class, } |
383 | #define BCMA_CORETABLE_END \ | 384 | #define BCMA_CORETABLE_END \ |
@@ -456,7 +457,8 @@ enum dmi_field { | |||
456 | }; | 457 | }; |
457 | 458 | ||
458 | struct dmi_strmatch { | 459 | struct dmi_strmatch { |
459 | unsigned char slot; | 460 | unsigned char slot:7; |
461 | unsigned char exact_match:1; | ||
460 | char substr[79]; | 462 | char substr[79]; |
461 | }; | 463 | }; |
462 | 464 | ||
@@ -474,7 +476,8 @@ struct dmi_system_id { | |||
474 | */ | 476 | */ |
475 | #define dmi_device_id dmi_system_id | 477 | #define dmi_device_id dmi_system_id |
476 | 478 | ||
477 | #define DMI_MATCH(a, b) { a, b } | 479 | #define DMI_MATCH(a, b) { .slot = a, .substr = b } |
480 | #define DMI_EXACT_MATCH(a, b) { .slot = a, .substr = b, .exact_match = 1 } | ||
478 | 481 | ||
479 | #define PLATFORM_NAME_SIZE 20 | 482 | #define PLATFORM_NAME_SIZE 20 |
480 | #define PLATFORM_MODULE_PREFIX "platform:" | 483 | #define PLATFORM_MODULE_PREFIX "platform:" |
@@ -577,4 +580,23 @@ struct mei_cl_device_id { | |||
577 | kernel_ulong_t driver_info; | 580 | kernel_ulong_t driver_info; |
578 | }; | 581 | }; |
579 | 582 | ||
583 | /* RapidIO */ | ||
584 | |||
585 | #define RIO_ANY_ID 0xffff | ||
586 | |||
587 | /** | ||
588 | * struct rio_device_id - RIO device identifier | ||
589 | * @did: RapidIO device ID | ||
590 | * @vid: RapidIO vendor ID | ||
591 | * @asm_did: RapidIO assembly device ID | ||
592 | * @asm_vid: RapidIO assembly vendor ID | ||
593 | * | ||
594 | * Identifies a RapidIO device based on both the device/vendor IDs and | ||
595 | * the assembly device/vendor IDs. | ||
596 | */ | ||
597 | struct rio_device_id { | ||
598 | __u16 did, vid; | ||
599 | __u16 asm_did, asm_vid; | ||
600 | }; | ||
601 | |||
580 | #endif /* LINUX_MOD_DEVICETABLE_H */ | 602 | #endif /* LINUX_MOD_DEVICETABLE_H */ |
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index 137b4198fc03..27d9da3f86ff 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h | |||
@@ -439,7 +439,7 @@ extern struct kernel_param_ops param_ops_string; | |||
439 | extern int param_set_copystring(const char *val, const struct kernel_param *); | 439 | extern int param_set_copystring(const char *val, const struct kernel_param *); |
440 | extern int param_get_string(char *buffer, const struct kernel_param *kp); | 440 | extern int param_get_string(char *buffer, const struct kernel_param *kp); |
441 | 441 | ||
442 | /* for exporting parameters in /sys/parameters */ | 442 | /* for exporting parameters in /sys/module/.../parameters */ |
443 | 443 | ||
444 | struct module; | 444 | struct module; |
445 | 445 | ||
diff --git a/include/linux/msi.h b/include/linux/msi.h index 20c2d6dd5d25..ee66f3a12fb6 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h | |||
@@ -35,6 +35,7 @@ struct msi_desc { | |||
35 | 35 | ||
36 | u32 masked; /* mask bits */ | 36 | u32 masked; /* mask bits */ |
37 | unsigned int irq; | 37 | unsigned int irq; |
38 | unsigned int nvec_used; /* number of messages */ | ||
38 | struct list_head list; | 39 | struct list_head list; |
39 | 40 | ||
40 | union { | 41 | union { |
diff --git a/include/linux/mutex-debug.h b/include/linux/mutex-debug.h index 731d77d6e155..4ac8b1977b73 100644 --- a/include/linux/mutex-debug.h +++ b/include/linux/mutex-debug.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/linkage.h> | 4 | #include <linux/linkage.h> |
5 | #include <linux/lockdep.h> | 5 | #include <linux/lockdep.h> |
6 | #include <linux/debug_locks.h> | ||
6 | 7 | ||
7 | /* | 8 | /* |
8 | * Mutexes - debugging helpers: | 9 | * Mutexes - debugging helpers: |
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index 433da8a1a426..ccd4260834c5 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #ifndef __LINUX_MUTEX_H | 10 | #ifndef __LINUX_MUTEX_H |
11 | #define __LINUX_MUTEX_H | 11 | #define __LINUX_MUTEX_H |
12 | 12 | ||
13 | #include <asm/current.h> | ||
13 | #include <linux/list.h> | 14 | #include <linux/list.h> |
14 | #include <linux/spinlock_types.h> | 15 | #include <linux/spinlock_types.h> |
15 | #include <linux/linkage.h> | 16 | #include <linux/linkage.h> |
@@ -136,6 +137,7 @@ static inline int mutex_is_locked(struct mutex *lock) | |||
136 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 137 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
137 | extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass); | 138 | extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass); |
138 | extern void _mutex_lock_nest_lock(struct mutex *lock, struct lockdep_map *nest_lock); | 139 | extern void _mutex_lock_nest_lock(struct mutex *lock, struct lockdep_map *nest_lock); |
140 | |||
139 | extern int __must_check mutex_lock_interruptible_nested(struct mutex *lock, | 141 | extern int __must_check mutex_lock_interruptible_nested(struct mutex *lock, |
140 | unsigned int subclass); | 142 | unsigned int subclass); |
141 | extern int __must_check mutex_lock_killable_nested(struct mutex *lock, | 143 | extern int __must_check mutex_lock_killable_nested(struct mutex *lock, |
@@ -147,7 +149,7 @@ extern int __must_check mutex_lock_killable_nested(struct mutex *lock, | |||
147 | 149 | ||
148 | #define mutex_lock_nest_lock(lock, nest_lock) \ | 150 | #define mutex_lock_nest_lock(lock, nest_lock) \ |
149 | do { \ | 151 | do { \ |
150 | typecheck(struct lockdep_map *, &(nest_lock)->dep_map); \ | 152 | typecheck(struct lockdep_map *, &(nest_lock)->dep_map); \ |
151 | _mutex_lock_nest_lock(lock, &(nest_lock)->dep_map); \ | 153 | _mutex_lock_nest_lock(lock, &(nest_lock)->dep_map); \ |
152 | } while (0) | 154 | } while (0) |
153 | 155 | ||
@@ -170,6 +172,7 @@ extern int __must_check mutex_lock_killable(struct mutex *lock); | |||
170 | */ | 172 | */ |
171 | extern int mutex_trylock(struct mutex *lock); | 173 | extern int mutex_trylock(struct mutex *lock); |
172 | extern void mutex_unlock(struct mutex *lock); | 174 | extern void mutex_unlock(struct mutex *lock); |
175 | |||
173 | extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock); | 176 | extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock); |
174 | 177 | ||
175 | #ifndef CONFIG_HAVE_ARCH_MUTEX_CPU_RELAX | 178 | #ifndef CONFIG_HAVE_ARCH_MUTEX_CPU_RELAX |
diff --git a/include/linux/mv643xx_eth.h b/include/linux/mv643xx_eth.h index 141d395bbb5f..6e8215b15998 100644 --- a/include/linux/mv643xx_eth.h +++ b/include/linux/mv643xx_eth.h | |||
@@ -30,6 +30,7 @@ struct mv643xx_eth_shared_platform_data { | |||
30 | #define MV643XX_ETH_PHY_ADDR(x) (0x80 | (x)) | 30 | #define MV643XX_ETH_PHY_ADDR(x) (0x80 | (x)) |
31 | #define MV643XX_ETH_PHY_NONE 0xff | 31 | #define MV643XX_ETH_PHY_NONE 0xff |
32 | 32 | ||
33 | struct device_node; | ||
33 | struct mv643xx_eth_platform_data { | 34 | struct mv643xx_eth_platform_data { |
34 | /* | 35 | /* |
35 | * Pointer back to our parent instance, and our port number. | 36 | * Pointer back to our parent instance, and our port number. |
@@ -41,6 +42,7 @@ struct mv643xx_eth_platform_data { | |||
41 | * Whether a PHY is present, and if yes, at which address. | 42 | * Whether a PHY is present, and if yes, at which address. |
42 | */ | 43 | */ |
43 | int phy_addr; | 44 | int phy_addr; |
45 | struct device_node *phy_node; | ||
44 | 46 | ||
45 | /* | 47 | /* |
46 | * Use this MAC address if it is valid, overriding the | 48 | * Use this MAC address if it is valid, overriding the |
diff --git a/include/linux/nbd.h b/include/linux/nbd.h index 4871170a04a0..ae4981ebd18e 100644 --- a/include/linux/nbd.h +++ b/include/linux/nbd.h | |||
@@ -41,6 +41,7 @@ struct nbd_device { | |||
41 | u64 bytesize; | 41 | u64 bytesize; |
42 | pid_t pid; /* pid of nbd-client, if attached */ | 42 | pid_t pid; /* pid of nbd-client, if attached */ |
43 | int xmit_timeout; | 43 | int xmit_timeout; |
44 | int disconnect; /* a disconnect has been requested by user */ | ||
44 | }; | 45 | }; |
45 | 46 | ||
46 | #endif | 47 | #endif |
diff --git a/include/linux/net.h b/include/linux/net.h index 99c9f0c103c2..4f27575ce1d6 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -79,9 +79,9 @@ enum sock_type { | |||
79 | #endif /* ARCH_HAS_SOCKET_TYPES */ | 79 | #endif /* ARCH_HAS_SOCKET_TYPES */ |
80 | 80 | ||
81 | enum sock_shutdown_cmd { | 81 | enum sock_shutdown_cmd { |
82 | SHUT_RD = 0, | 82 | SHUT_RD, |
83 | SHUT_WR = 1, | 83 | SHUT_WR, |
84 | SHUT_RDWR = 2, | 84 | SHUT_RDWR, |
85 | }; | 85 | }; |
86 | 86 | ||
87 | struct socket_wq { | 87 | struct socket_wq { |
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h index 09906b7ca47d..a2a89a5c7be5 100644 --- a/include/linux/netdev_features.h +++ b/include/linux/netdev_features.h | |||
@@ -43,8 +43,9 @@ enum { | |||
43 | NETIF_F_FSO_BIT, /* ... FCoE segmentation */ | 43 | NETIF_F_FSO_BIT, /* ... FCoE segmentation */ |
44 | NETIF_F_GSO_GRE_BIT, /* ... GRE with TSO */ | 44 | NETIF_F_GSO_GRE_BIT, /* ... GRE with TSO */ |
45 | NETIF_F_GSO_UDP_TUNNEL_BIT, /* ... UDP TUNNEL with TSO */ | 45 | NETIF_F_GSO_UDP_TUNNEL_BIT, /* ... UDP TUNNEL with TSO */ |
46 | NETIF_F_GSO_MPLS_BIT, /* ... MPLS segmentation */ | ||
46 | /**/NETIF_F_GSO_LAST = /* last bit, see GSO_MASK */ | 47 | /**/NETIF_F_GSO_LAST = /* last bit, see GSO_MASK */ |
47 | NETIF_F_GSO_UDP_TUNNEL_BIT, | 48 | NETIF_F_GSO_MPLS_BIT, |
48 | 49 | ||
49 | NETIF_F_FCOE_CRC_BIT, /* FCoE CRC32 */ | 50 | NETIF_F_FCOE_CRC_BIT, /* FCoE CRC32 */ |
50 | NETIF_F_SCTP_CSUM_BIT, /* SCTP checksum offload */ | 51 | NETIF_F_SCTP_CSUM_BIT, /* SCTP checksum offload */ |
@@ -107,6 +108,7 @@ enum { | |||
107 | #define NETIF_F_RXALL __NETIF_F(RXALL) | 108 | #define NETIF_F_RXALL __NETIF_F(RXALL) |
108 | #define NETIF_F_GSO_GRE __NETIF_F(GSO_GRE) | 109 | #define NETIF_F_GSO_GRE __NETIF_F(GSO_GRE) |
109 | #define NETIF_F_GSO_UDP_TUNNEL __NETIF_F(GSO_UDP_TUNNEL) | 110 | #define NETIF_F_GSO_UDP_TUNNEL __NETIF_F(GSO_UDP_TUNNEL) |
111 | #define NETIF_F_GSO_MPLS __NETIF_F(GSO_MPLS) | ||
110 | #define NETIF_F_HW_VLAN_STAG_FILTER __NETIF_F(HW_VLAN_STAG_FILTER) | 112 | #define NETIF_F_HW_VLAN_STAG_FILTER __NETIF_F(HW_VLAN_STAG_FILTER) |
111 | #define NETIF_F_HW_VLAN_STAG_RX __NETIF_F(HW_VLAN_STAG_RX) | 113 | #define NETIF_F_HW_VLAN_STAG_RX __NETIF_F(HW_VLAN_STAG_RX) |
112 | #define NETIF_F_HW_VLAN_STAG_TX __NETIF_F(HW_VLAN_STAG_TX) | 114 | #define NETIF_F_HW_VLAN_STAG_TX __NETIF_F(HW_VLAN_STAG_TX) |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 96e4c21e15e0..9a4156845e93 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -324,12 +324,15 @@ struct napi_struct { | |||
324 | struct sk_buff *gro_list; | 324 | struct sk_buff *gro_list; |
325 | struct sk_buff *skb; | 325 | struct sk_buff *skb; |
326 | struct list_head dev_list; | 326 | struct list_head dev_list; |
327 | struct hlist_node napi_hash_node; | ||
328 | unsigned int napi_id; | ||
327 | }; | 329 | }; |
328 | 330 | ||
329 | enum { | 331 | enum { |
330 | NAPI_STATE_SCHED, /* Poll is scheduled */ | 332 | NAPI_STATE_SCHED, /* Poll is scheduled */ |
331 | NAPI_STATE_DISABLE, /* Disable pending */ | 333 | NAPI_STATE_DISABLE, /* Disable pending */ |
332 | NAPI_STATE_NPSVC, /* Netpoll - don't dequeue from poll_list */ | 334 | NAPI_STATE_NPSVC, /* Netpoll - don't dequeue from poll_list */ |
335 | NAPI_STATE_HASHED, /* In NAPI hash */ | ||
333 | }; | 336 | }; |
334 | 337 | ||
335 | enum gro_result { | 338 | enum gro_result { |
@@ -446,6 +449,32 @@ extern void __napi_complete(struct napi_struct *n); | |||
446 | extern void napi_complete(struct napi_struct *n); | 449 | extern void napi_complete(struct napi_struct *n); |
447 | 450 | ||
448 | /** | 451 | /** |
452 | * napi_by_id - lookup a NAPI by napi_id | ||
453 | * @napi_id: hashed napi_id | ||
454 | * | ||
455 | * lookup @napi_id in napi_hash table | ||
456 | * must be called under rcu_read_lock() | ||
457 | */ | ||
458 | extern struct napi_struct *napi_by_id(unsigned int napi_id); | ||
459 | |||
460 | /** | ||
461 | * napi_hash_add - add a NAPI to global hashtable | ||
462 | * @napi: napi context | ||
463 | * | ||
464 | * generate a new napi_id and store a @napi under it in napi_hash | ||
465 | */ | ||
466 | extern void napi_hash_add(struct napi_struct *napi); | ||
467 | |||
468 | /** | ||
469 | * napi_hash_del - remove a NAPI from global table | ||
470 | * @napi: napi context | ||
471 | * | ||
472 | * Warning: caller must observe rcu grace period | ||
473 | * before freeing memory containing @napi | ||
474 | */ | ||
475 | extern void napi_hash_del(struct napi_struct *napi); | ||
476 | |||
477 | /** | ||
449 | * napi_disable - prevent NAPI from scheduling | 478 | * napi_disable - prevent NAPI from scheduling |
450 | * @n: napi context | 479 | * @n: napi context |
451 | * | 480 | * |
@@ -800,6 +829,7 @@ struct netdev_fcoe_hbainfo { | |||
800 | * int (*ndo_set_vf_spoofchk)(struct net_device *dev, int vf, bool setting); | 829 | * int (*ndo_set_vf_spoofchk)(struct net_device *dev, int vf, bool setting); |
801 | * int (*ndo_get_vf_config)(struct net_device *dev, | 830 | * int (*ndo_get_vf_config)(struct net_device *dev, |
802 | * int vf, struct ifla_vf_info *ivf); | 831 | * int vf, struct ifla_vf_info *ivf); |
832 | * int (*ndo_set_vf_link_state)(struct net_device *dev, int vf, int link_state); | ||
803 | * int (*ndo_set_vf_port)(struct net_device *dev, int vf, | 833 | * int (*ndo_set_vf_port)(struct net_device *dev, int vf, |
804 | * struct nlattr *port[]); | 834 | * struct nlattr *port[]); |
805 | * int (*ndo_get_vf_port)(struct net_device *dev, int vf, struct sk_buff *skb); | 835 | * int (*ndo_get_vf_port)(struct net_device *dev, int vf, struct sk_buff *skb); |
@@ -943,6 +973,9 @@ struct net_device_ops { | |||
943 | gfp_t gfp); | 973 | gfp_t gfp); |
944 | void (*ndo_netpoll_cleanup)(struct net_device *dev); | 974 | void (*ndo_netpoll_cleanup)(struct net_device *dev); |
945 | #endif | 975 | #endif |
976 | #ifdef CONFIG_NET_RX_BUSY_POLL | ||
977 | int (*ndo_busy_poll)(struct napi_struct *dev); | ||
978 | #endif | ||
946 | int (*ndo_set_vf_mac)(struct net_device *dev, | 979 | int (*ndo_set_vf_mac)(struct net_device *dev, |
947 | int queue, u8 *mac); | 980 | int queue, u8 *mac); |
948 | int (*ndo_set_vf_vlan)(struct net_device *dev, | 981 | int (*ndo_set_vf_vlan)(struct net_device *dev, |
@@ -954,6 +987,8 @@ struct net_device_ops { | |||
954 | int (*ndo_get_vf_config)(struct net_device *dev, | 987 | int (*ndo_get_vf_config)(struct net_device *dev, |
955 | int vf, | 988 | int vf, |
956 | struct ifla_vf_info *ivf); | 989 | struct ifla_vf_info *ivf); |
990 | int (*ndo_set_vf_link_state)(struct net_device *dev, | ||
991 | int vf, int link_state); | ||
957 | int (*ndo_set_vf_port)(struct net_device *dev, | 992 | int (*ndo_set_vf_port)(struct net_device *dev, |
958 | int vf, | 993 | int vf, |
959 | struct nlattr *port[]); | 994 | struct nlattr *port[]); |
@@ -1088,6 +1123,8 @@ struct net_device { | |||
1088 | * need to set them appropriately. | 1123 | * need to set them appropriately. |
1089 | */ | 1124 | */ |
1090 | netdev_features_t hw_enc_features; | 1125 | netdev_features_t hw_enc_features; |
1126 | /* mask of fetures inheritable by MPLS */ | ||
1127 | netdev_features_t mpls_features; | ||
1091 | 1128 | ||
1092 | /* Interface index. Unique device identifier */ | 1129 | /* Interface index. Unique device identifier */ |
1093 | int ifindex; | 1130 | int ifindex; |
@@ -1140,8 +1177,10 @@ struct net_device { | |||
1140 | unsigned char addr_assign_type; /* hw address assignment type */ | 1177 | unsigned char addr_assign_type; /* hw address assignment type */ |
1141 | unsigned char addr_len; /* hardware address length */ | 1178 | unsigned char addr_len; /* hardware address length */ |
1142 | unsigned char neigh_priv_len; | 1179 | unsigned char neigh_priv_len; |
1143 | unsigned short dev_id; /* for shared network cards */ | 1180 | unsigned short dev_id; /* Used to differentiate devices |
1144 | 1181 | * that share the same link | |
1182 | * layer address | ||
1183 | */ | ||
1145 | spinlock_t addr_list_lock; | 1184 | spinlock_t addr_list_lock; |
1146 | struct netdev_hw_addr_list uc; /* Unicast mac addresses */ | 1185 | struct netdev_hw_addr_list uc; /* Unicast mac addresses */ |
1147 | struct netdev_hw_addr_list mc; /* Multicast mac addresses */ | 1186 | struct netdev_hw_addr_list mc; /* Multicast mac addresses */ |
@@ -1593,9 +1632,34 @@ struct packet_offload { | |||
1593 | #define NETDEV_RELEASE 0x0012 | 1632 | #define NETDEV_RELEASE 0x0012 |
1594 | #define NETDEV_NOTIFY_PEERS 0x0013 | 1633 | #define NETDEV_NOTIFY_PEERS 0x0013 |
1595 | #define NETDEV_JOIN 0x0014 | 1634 | #define NETDEV_JOIN 0x0014 |
1635 | #define NETDEV_CHANGEUPPER 0x0015 | ||
1596 | 1636 | ||
1597 | extern int register_netdevice_notifier(struct notifier_block *nb); | 1637 | extern int register_netdevice_notifier(struct notifier_block *nb); |
1598 | extern int unregister_netdevice_notifier(struct notifier_block *nb); | 1638 | extern int unregister_netdevice_notifier(struct notifier_block *nb); |
1639 | |||
1640 | struct netdev_notifier_info { | ||
1641 | struct net_device *dev; | ||
1642 | }; | ||
1643 | |||
1644 | struct netdev_notifier_change_info { | ||
1645 | struct netdev_notifier_info info; /* must be first */ | ||
1646 | unsigned int flags_changed; | ||
1647 | }; | ||
1648 | |||
1649 | static inline void netdev_notifier_info_init(struct netdev_notifier_info *info, | ||
1650 | struct net_device *dev) | ||
1651 | { | ||
1652 | info->dev = dev; | ||
1653 | } | ||
1654 | |||
1655 | static inline struct net_device * | ||
1656 | netdev_notifier_info_to_dev(const struct netdev_notifier_info *info) | ||
1657 | { | ||
1658 | return info->dev; | ||
1659 | } | ||
1660 | |||
1661 | extern int call_netdevice_notifiers_info(unsigned long val, struct net_device *dev, | ||
1662 | struct netdev_notifier_info *info); | ||
1599 | extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); | 1663 | extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); |
1600 | 1664 | ||
1601 | 1665 | ||
@@ -1779,6 +1843,19 @@ static inline int unregister_gifconf(unsigned int family) | |||
1779 | return register_gifconf(family, NULL); | 1843 | return register_gifconf(family, NULL); |
1780 | } | 1844 | } |
1781 | 1845 | ||
1846 | #ifdef CONFIG_NET_FLOW_LIMIT | ||
1847 | #define FLOW_LIMIT_HISTORY (1 << 7) /* must be ^2 and !overflow buckets */ | ||
1848 | struct sd_flow_limit { | ||
1849 | u64 count; | ||
1850 | unsigned int num_buckets; | ||
1851 | unsigned int history_head; | ||
1852 | u16 history[FLOW_LIMIT_HISTORY]; | ||
1853 | u8 buckets[]; | ||
1854 | }; | ||
1855 | |||
1856 | extern int netdev_flow_limit_table_len; | ||
1857 | #endif /* CONFIG_NET_FLOW_LIMIT */ | ||
1858 | |||
1782 | /* | 1859 | /* |
1783 | * Incoming packets are placed on per-cpu queues | 1860 | * Incoming packets are placed on per-cpu queues |
1784 | */ | 1861 | */ |
@@ -1808,6 +1885,10 @@ struct softnet_data { | |||
1808 | unsigned int dropped; | 1885 | unsigned int dropped; |
1809 | struct sk_buff_head input_pkt_queue; | 1886 | struct sk_buff_head input_pkt_queue; |
1810 | struct napi_struct backlog; | 1887 | struct napi_struct backlog; |
1888 | |||
1889 | #ifdef CONFIG_NET_FLOW_LIMIT | ||
1890 | struct sd_flow_limit __rcu *flow_limit; | ||
1891 | #endif | ||
1811 | }; | 1892 | }; |
1812 | 1893 | ||
1813 | static inline void input_queue_head_incr(struct softnet_data *sd) | 1894 | static inline void input_queue_head_incr(struct softnet_data *sd) |
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 0060fde3160e..de70f7b45b68 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
@@ -35,7 +35,7 @@ static inline void nf_inet_addr_mask(const union nf_inet_addr *a1, | |||
35 | result->all[3] = a1->all[3] & mask->all[3]; | 35 | result->all[3] = a1->all[3] & mask->all[3]; |
36 | } | 36 | } |
37 | 37 | ||
38 | extern void netfilter_init(void); | 38 | extern int netfilter_init(void); |
39 | 39 | ||
40 | /* Largest hook number + 1 */ | 40 | /* Largest hook number + 1 */ |
41 | #define NF_MAX_HOOKS 8 | 41 | #define NF_MAX_HOOKS 8 |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 6358da5eeee8..7a6c396a263b 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -46,6 +46,7 @@ struct netlink_kernel_cfg { | |||
46 | void (*input)(struct sk_buff *skb); | 46 | void (*input)(struct sk_buff *skb); |
47 | struct mutex *cb_mutex; | 47 | struct mutex *cb_mutex; |
48 | void (*bind)(int group); | 48 | void (*bind)(int group); |
49 | bool (*compare)(struct net *net, struct sock *sk); | ||
49 | }; | 50 | }; |
50 | 51 | ||
51 | extern struct sock *__netlink_kernel_create(struct net *net, int unit, | 52 | extern struct sock *__netlink_kernel_create(struct net *net, int unit, |
@@ -84,6 +85,22 @@ int netlink_attachskb(struct sock *sk, struct sk_buff *skb, | |||
84 | void netlink_detachskb(struct sock *sk, struct sk_buff *skb); | 85 | void netlink_detachskb(struct sock *sk, struct sk_buff *skb); |
85 | int netlink_sendskb(struct sock *sk, struct sk_buff *skb); | 86 | int netlink_sendskb(struct sock *sk, struct sk_buff *skb); |
86 | 87 | ||
88 | static inline struct sk_buff * | ||
89 | netlink_skb_clone(struct sk_buff *skb, gfp_t gfp_mask) | ||
90 | { | ||
91 | struct sk_buff *nskb; | ||
92 | |||
93 | nskb = skb_clone(skb, gfp_mask); | ||
94 | if (!nskb) | ||
95 | return NULL; | ||
96 | |||
97 | /* This is a large skb, set destructor callback to release head */ | ||
98 | if (is_vmalloc_addr(skb->head)) | ||
99 | nskb->destructor = skb->destructor; | ||
100 | |||
101 | return nskb; | ||
102 | } | ||
103 | |||
87 | /* | 104 | /* |
88 | * skb should fit one page. This choice is good for headerless malloc. | 105 | * skb should fit one page. This choice is good for headerless malloc. |
89 | * But we should limit to 8K so that userspace does not have to | 106 | * But we should limit to 8K so that userspace does not have to |
@@ -144,4 +161,14 @@ static inline int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, | |||
144 | return __netlink_dump_start(ssk, skb, nlh, control); | 161 | return __netlink_dump_start(ssk, skb, nlh, control); |
145 | } | 162 | } |
146 | 163 | ||
164 | struct netlink_tap { | ||
165 | struct net_device *dev; | ||
166 | struct module *module; | ||
167 | struct list_head list; | ||
168 | }; | ||
169 | |||
170 | extern int netlink_add_tap(struct netlink_tap *nt); | ||
171 | extern int __netlink_remove_tap(struct netlink_tap *nt); | ||
172 | extern int netlink_remove_tap(struct netlink_tap *nt); | ||
173 | |||
147 | #endif /* __LINUX_NETLINK_H */ | 174 | #endif /* __LINUX_NETLINK_H */ |
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index fa2cb76a7029..f3c7c24bec1c 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h | |||
@@ -53,10 +53,10 @@ struct netpoll_info { | |||
53 | }; | 53 | }; |
54 | 54 | ||
55 | #ifdef CONFIG_NETPOLL | 55 | #ifdef CONFIG_NETPOLL |
56 | extern int netpoll_rx_disable(struct net_device *dev); | 56 | extern void netpoll_rx_disable(struct net_device *dev); |
57 | extern void netpoll_rx_enable(struct net_device *dev); | 57 | extern void netpoll_rx_enable(struct net_device *dev); |
58 | #else | 58 | #else |
59 | static inline int netpoll_rx_disable(struct net_device *dev) { return 0; } | 59 | static inline void netpoll_rx_disable(struct net_device *dev) { return; } |
60 | static inline void netpoll_rx_enable(struct net_device *dev) { return; } | 60 | static inline void netpoll_rx_enable(struct net_device *dev) { return; } |
61 | #endif | 61 | #endif |
62 | 62 | ||
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 7b8fc73810ad..e36dee52f224 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -32,6 +32,15 @@ struct nfs4_acl { | |||
32 | struct nfs4_ace aces[0]; | 32 | struct nfs4_ace aces[0]; |
33 | }; | 33 | }; |
34 | 34 | ||
35 | #define NFS4_MAXLABELLEN 2048 | ||
36 | |||
37 | struct nfs4_label { | ||
38 | uint32_t lfs; | ||
39 | uint32_t pi; | ||
40 | u32 len; | ||
41 | char *label; | ||
42 | }; | ||
43 | |||
35 | typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier; | 44 | typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier; |
36 | 45 | ||
37 | struct nfs_stateid4 { | 46 | struct nfs_stateid4 { |
@@ -219,6 +228,14 @@ enum nfsstat4 { | |||
219 | NFS4ERR_REJECT_DELEG = 10085, /* on callback */ | 228 | NFS4ERR_REJECT_DELEG = 10085, /* on callback */ |
220 | NFS4ERR_RETURNCONFLICT = 10086, /* outstanding layoutreturn */ | 229 | NFS4ERR_RETURNCONFLICT = 10086, /* outstanding layoutreturn */ |
221 | NFS4ERR_DELEG_REVOKED = 10087, /* deleg./layout revoked */ | 230 | NFS4ERR_DELEG_REVOKED = 10087, /* deleg./layout revoked */ |
231 | |||
232 | /* nfs42 */ | ||
233 | NFS4ERR_PARTNER_NOTSUPP = 10088, | ||
234 | NFS4ERR_PARTNER_NO_AUTH = 10089, | ||
235 | NFS4ERR_METADATA_NOTSUPP = 10090, | ||
236 | NFS4ERR_OFFLOAD_DENIED = 10091, | ||
237 | NFS4ERR_WRONG_LFS = 10092, | ||
238 | NFS4ERR_BADLABEL = 10093, | ||
222 | }; | 239 | }; |
223 | 240 | ||
224 | static inline bool seqid_mutating_err(u32 err) | 241 | static inline bool seqid_mutating_err(u32 err) |
@@ -378,6 +395,7 @@ enum lock_type4 { | |||
378 | #define FATTR4_WORD1_FS_LAYOUT_TYPES (1UL << 30) | 395 | #define FATTR4_WORD1_FS_LAYOUT_TYPES (1UL << 30) |
379 | #define FATTR4_WORD2_LAYOUT_BLKSIZE (1UL << 1) | 396 | #define FATTR4_WORD2_LAYOUT_BLKSIZE (1UL << 1) |
380 | #define FATTR4_WORD2_MDSTHRESHOLD (1UL << 4) | 397 | #define FATTR4_WORD2_MDSTHRESHOLD (1UL << 4) |
398 | #define FATTR4_WORD2_SECURITY_LABEL (1UL << 17) | ||
381 | 399 | ||
382 | /* MDS threshold bitmap bits */ | 400 | /* MDS threshold bitmap bits */ |
383 | #define THRESHOLD_RD (1UL << 0) | 401 | #define THRESHOLD_RD (1UL << 0) |
@@ -390,11 +408,15 @@ enum lock_type4 { | |||
390 | #define NFS4_VERSION 4 | 408 | #define NFS4_VERSION 4 |
391 | #define NFS4_MINOR_VERSION 0 | 409 | #define NFS4_MINOR_VERSION 0 |
392 | 410 | ||
411 | #if defined(CONFIG_NFS_V4_2) | ||
412 | #define NFS4_MAX_MINOR_VERSION 2 | ||
413 | #else | ||
393 | #if defined(CONFIG_NFS_V4_1) | 414 | #if defined(CONFIG_NFS_V4_1) |
394 | #define NFS4_MAX_MINOR_VERSION 1 | 415 | #define NFS4_MAX_MINOR_VERSION 1 |
395 | #else | 416 | #else |
396 | #define NFS4_MAX_MINOR_VERSION 0 | 417 | #define NFS4_MAX_MINOR_VERSION 0 |
397 | #endif /* CONFIG_NFS_V4_1 */ | 418 | #endif /* CONFIG_NFS_V4_1 */ |
419 | #endif /* CONFIG_NFS_V4_2 */ | ||
398 | 420 | ||
399 | #define NFS4_DEBUG 1 | 421 | #define NFS4_DEBUG 1 |
400 | 422 | ||
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index fc01d5cb4cf1..7125cef74164 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -207,6 +207,7 @@ struct nfs_inode { | |||
207 | #define NFS_INO_INVALID_ACL 0x0010 /* cached acls are invalid */ | 207 | #define NFS_INO_INVALID_ACL 0x0010 /* cached acls are invalid */ |
208 | #define NFS_INO_REVAL_PAGECACHE 0x0020 /* must revalidate pagecache */ | 208 | #define NFS_INO_REVAL_PAGECACHE 0x0020 /* must revalidate pagecache */ |
209 | #define NFS_INO_REVAL_FORCED 0x0040 /* force revalidation ignoring a delegation */ | 209 | #define NFS_INO_REVAL_FORCED 0x0040 /* force revalidation ignoring a delegation */ |
210 | #define NFS_INO_INVALID_LABEL 0x0080 /* cached label is invalid */ | ||
210 | 211 | ||
211 | /* | 212 | /* |
212 | * Bit offsets in flags field | 213 | * Bit offsets in flags field |
@@ -336,7 +337,7 @@ extern void nfs_zap_mapping(struct inode *inode, struct address_space *mapping); | |||
336 | extern void nfs_zap_caches(struct inode *); | 337 | extern void nfs_zap_caches(struct inode *); |
337 | extern void nfs_invalidate_atime(struct inode *); | 338 | extern void nfs_invalidate_atime(struct inode *); |
338 | extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *, | 339 | extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *, |
339 | struct nfs_fattr *); | 340 | struct nfs_fattr *, struct nfs4_label *); |
340 | extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *); | 341 | extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *); |
341 | extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr); | 342 | extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr); |
342 | extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fattr); | 343 | extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fattr); |
@@ -347,15 +348,19 @@ extern int nfs_permission(struct inode *, int); | |||
347 | extern int nfs_open(struct inode *, struct file *); | 348 | extern int nfs_open(struct inode *, struct file *); |
348 | extern int nfs_release(struct inode *, struct file *); | 349 | extern int nfs_release(struct inode *, struct file *); |
349 | extern int nfs_attribute_timeout(struct inode *inode); | 350 | extern int nfs_attribute_timeout(struct inode *inode); |
351 | extern int nfs_attribute_cache_expired(struct inode *inode); | ||
350 | extern int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode); | 352 | extern int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode); |
351 | extern int __nfs_revalidate_inode(struct nfs_server *, struct inode *); | 353 | extern int __nfs_revalidate_inode(struct nfs_server *, struct inode *); |
352 | extern int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping); | 354 | extern int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping); |
353 | extern int nfs_setattr(struct dentry *, struct iattr *); | 355 | extern int nfs_setattr(struct dentry *, struct iattr *); |
354 | extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr); | 356 | extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr); |
357 | extern void nfs_setsecurity(struct inode *inode, struct nfs_fattr *fattr, | ||
358 | struct nfs4_label *label); | ||
355 | extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); | 359 | extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); |
356 | extern void put_nfs_open_context(struct nfs_open_context *ctx); | 360 | extern void put_nfs_open_context(struct nfs_open_context *ctx); |
357 | extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode); | 361 | extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode); |
358 | extern struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, fmode_t f_mode); | 362 | extern struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, fmode_t f_mode); |
363 | extern void nfs_inode_attach_open_context(struct nfs_open_context *ctx); | ||
359 | extern void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx); | 364 | extern void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx); |
360 | extern struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx); | 365 | extern struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx); |
361 | extern void nfs_put_lock_context(struct nfs_lock_context *l_ctx); | 366 | extern void nfs_put_lock_context(struct nfs_lock_context *l_ctx); |
@@ -468,7 +473,8 @@ extern const struct file_operations nfs_dir_operations; | |||
468 | extern const struct dentry_operations nfs_dentry_operations; | 473 | extern const struct dentry_operations nfs_dentry_operations; |
469 | 474 | ||
470 | extern void nfs_force_lookup_revalidate(struct inode *dir); | 475 | extern void nfs_force_lookup_revalidate(struct inode *dir); |
471 | extern int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fh, struct nfs_fattr *fattr); | 476 | extern int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fh, |
477 | struct nfs_fattr *fattr, struct nfs4_label *label); | ||
472 | extern int nfs_may_open(struct inode *inode, struct rpc_cred *cred, int openflags); | 478 | extern int nfs_may_open(struct inode *inode, struct rpc_cred *cred, int openflags); |
473 | extern void nfs_access_zap_cache(struct inode *inode); | 479 | extern void nfs_access_zap_cache(struct inode *inode); |
474 | 480 | ||
@@ -497,6 +503,24 @@ extern int nfs_mountpoint_expiry_timeout; | |||
497 | extern void nfs_release_automount_timer(void); | 503 | extern void nfs_release_automount_timer(void); |
498 | 504 | ||
499 | /* | 505 | /* |
506 | * linux/fs/nfs/nfs4proc.c | ||
507 | */ | ||
508 | #ifdef CONFIG_NFS_V4_SECURITY_LABEL | ||
509 | extern struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags); | ||
510 | static inline void nfs4_label_free(struct nfs4_label *label) | ||
511 | { | ||
512 | if (label) { | ||
513 | kfree(label->label); | ||
514 | kfree(label); | ||
515 | } | ||
516 | return; | ||
517 | } | ||
518 | #else | ||
519 | static inline struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags) { return NULL; } | ||
520 | static inline void nfs4_label_free(void *label) {} | ||
521 | #endif | ||
522 | |||
523 | /* | ||
500 | * linux/fs/nfs/unlink.c | 524 | * linux/fs/nfs/unlink.c |
501 | */ | 525 | */ |
502 | extern void nfs_complete_unlink(struct dentry *dentry, struct inode *); | 526 | extern void nfs_complete_unlink(struct dentry *dentry, struct inode *); |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 3b7fa2abecca..d2212432c456 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
@@ -146,7 +146,12 @@ struct nfs_server { | |||
146 | u32 attr_bitmask[3];/* V4 bitmask representing the set | 146 | u32 attr_bitmask[3];/* V4 bitmask representing the set |
147 | of attributes supported on this | 147 | of attributes supported on this |
148 | filesystem */ | 148 | filesystem */ |
149 | u32 cache_consistency_bitmask[2]; | 149 | u32 attr_bitmask_nl[3]; |
150 | /* V4 bitmask representing the | ||
151 | set of attributes supported | ||
152 | on this filesystem excluding | ||
153 | the label support bit. */ | ||
154 | u32 cache_consistency_bitmask[3]; | ||
150 | /* V4 bitmask representing the subset | 155 | /* V4 bitmask representing the subset |
151 | of change attribute, size, ctime | 156 | of change attribute, size, ctime |
152 | and mtime attributes supported by | 157 | and mtime attributes supported by |
@@ -200,5 +205,6 @@ struct nfs_server { | |||
200 | #define NFS_CAP_UIDGID_NOMAP (1U << 15) | 205 | #define NFS_CAP_UIDGID_NOMAP (1U << 15) |
201 | #define NFS_CAP_STATEID_NFSV41 (1U << 16) | 206 | #define NFS_CAP_STATEID_NFSV41 (1U << 16) |
202 | #define NFS_CAP_ATOMIC_OPEN_V1 (1U << 17) | 207 | #define NFS_CAP_ATOMIC_OPEN_V1 (1U << 17) |
208 | #define NFS_CAP_SECURITY_LABEL (1U << 18) | ||
203 | 209 | ||
204 | #endif | 210 | #endif |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 104b62f23ee0..8651574a305b 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -101,6 +101,7 @@ struct nfs_fattr { | |||
101 | #define NFS_ATTR_FATTR_MOUNTED_ON_FILEID (1U << 22) | 101 | #define NFS_ATTR_FATTR_MOUNTED_ON_FILEID (1U << 22) |
102 | #define NFS_ATTR_FATTR_OWNER_NAME (1U << 23) | 102 | #define NFS_ATTR_FATTR_OWNER_NAME (1U << 23) |
103 | #define NFS_ATTR_FATTR_GROUP_NAME (1U << 24) | 103 | #define NFS_ATTR_FATTR_GROUP_NAME (1U << 24) |
104 | #define NFS_ATTR_FATTR_V4_SECURITY_LABEL (1U << 25) | ||
104 | 105 | ||
105 | #define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \ | 106 | #define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \ |
106 | | NFS_ATTR_FATTR_MODE \ | 107 | | NFS_ATTR_FATTR_MODE \ |
@@ -120,7 +121,8 @@ struct nfs_fattr { | |||
120 | #define NFS_ATTR_FATTR_V3 (NFS_ATTR_FATTR \ | 121 | #define NFS_ATTR_FATTR_V3 (NFS_ATTR_FATTR \ |
121 | | NFS_ATTR_FATTR_SPACE_USED) | 122 | | NFS_ATTR_FATTR_SPACE_USED) |
122 | #define NFS_ATTR_FATTR_V4 (NFS_ATTR_FATTR \ | 123 | #define NFS_ATTR_FATTR_V4 (NFS_ATTR_FATTR \ |
123 | | NFS_ATTR_FATTR_SPACE_USED) | 124 | | NFS_ATTR_FATTR_SPACE_USED \ |
125 | | NFS_ATTR_FATTR_V4_SECURITY_LABEL) | ||
124 | 126 | ||
125 | /* | 127 | /* |
126 | * Info on the file system | 128 | * Info on the file system |
@@ -246,6 +248,7 @@ struct nfs4_layoutget_res { | |||
246 | struct nfs4_layoutget { | 248 | struct nfs4_layoutget { |
247 | struct nfs4_layoutget_args args; | 249 | struct nfs4_layoutget_args args; |
248 | struct nfs4_layoutget_res res; | 250 | struct nfs4_layoutget_res res; |
251 | struct rpc_cred *cred; | ||
249 | gfp_t gfp_flags; | 252 | gfp_t gfp_flags; |
250 | }; | 253 | }; |
251 | 254 | ||
@@ -347,6 +350,7 @@ struct nfs_openargs { | |||
347 | const u32 * open_bitmap; | 350 | const u32 * open_bitmap; |
348 | __u32 claim; | 351 | __u32 claim; |
349 | enum createmode4 createmode; | 352 | enum createmode4 createmode; |
353 | const struct nfs4_label *label; | ||
350 | }; | 354 | }; |
351 | 355 | ||
352 | struct nfs_openres { | 356 | struct nfs_openres { |
@@ -356,6 +360,7 @@ struct nfs_openres { | |||
356 | struct nfs4_change_info cinfo; | 360 | struct nfs4_change_info cinfo; |
357 | __u32 rflags; | 361 | __u32 rflags; |
358 | struct nfs_fattr * f_attr; | 362 | struct nfs_fattr * f_attr; |
363 | struct nfs4_label *f_label; | ||
359 | struct nfs_seqid * seqid; | 364 | struct nfs_seqid * seqid; |
360 | const struct nfs_server *server; | 365 | const struct nfs_server *server; |
361 | fmode_t delegation_type; | 366 | fmode_t delegation_type; |
@@ -598,6 +603,7 @@ struct nfs_entry { | |||
598 | int eof; | 603 | int eof; |
599 | struct nfs_fh * fh; | 604 | struct nfs_fh * fh; |
600 | struct nfs_fattr * fattr; | 605 | struct nfs_fattr * fattr; |
606 | struct nfs4_label *label; | ||
601 | unsigned char d_type; | 607 | unsigned char d_type; |
602 | struct nfs_server * server; | 608 | struct nfs_server * server; |
603 | }; | 609 | }; |
@@ -630,6 +636,7 @@ struct nfs_setattrargs { | |||
630 | struct iattr * iap; | 636 | struct iattr * iap; |
631 | const struct nfs_server * server; /* Needed for name mapping */ | 637 | const struct nfs_server * server; /* Needed for name mapping */ |
632 | const u32 * bitmask; | 638 | const u32 * bitmask; |
639 | const struct nfs4_label *label; | ||
633 | }; | 640 | }; |
634 | 641 | ||
635 | struct nfs_setaclargs { | 642 | struct nfs_setaclargs { |
@@ -665,6 +672,7 @@ struct nfs_getaclres { | |||
665 | struct nfs_setattrres { | 672 | struct nfs_setattrres { |
666 | struct nfs4_sequence_res seq_res; | 673 | struct nfs4_sequence_res seq_res; |
667 | struct nfs_fattr * fattr; | 674 | struct nfs_fattr * fattr; |
675 | struct nfs4_label *label; | ||
668 | const struct nfs_server * server; | 676 | const struct nfs_server * server; |
669 | }; | 677 | }; |
670 | 678 | ||
@@ -862,6 +870,7 @@ struct nfs4_create_arg { | |||
862 | const struct iattr * attrs; | 870 | const struct iattr * attrs; |
863 | const struct nfs_fh * dir_fh; | 871 | const struct nfs_fh * dir_fh; |
864 | const u32 * bitmask; | 872 | const u32 * bitmask; |
873 | const struct nfs4_label *label; | ||
865 | }; | 874 | }; |
866 | 875 | ||
867 | struct nfs4_create_res { | 876 | struct nfs4_create_res { |
@@ -869,6 +878,7 @@ struct nfs4_create_res { | |||
869 | const struct nfs_server * server; | 878 | const struct nfs_server * server; |
870 | struct nfs_fh * fh; | 879 | struct nfs_fh * fh; |
871 | struct nfs_fattr * fattr; | 880 | struct nfs_fattr * fattr; |
881 | struct nfs4_label *label; | ||
872 | struct nfs4_change_info dir_cinfo; | 882 | struct nfs4_change_info dir_cinfo; |
873 | }; | 883 | }; |
874 | 884 | ||
@@ -893,6 +903,7 @@ struct nfs4_getattr_res { | |||
893 | struct nfs4_sequence_res seq_res; | 903 | struct nfs4_sequence_res seq_res; |
894 | const struct nfs_server * server; | 904 | const struct nfs_server * server; |
895 | struct nfs_fattr * fattr; | 905 | struct nfs_fattr * fattr; |
906 | struct nfs4_label *label; | ||
896 | }; | 907 | }; |
897 | 908 | ||
898 | struct nfs4_link_arg { | 909 | struct nfs4_link_arg { |
@@ -907,6 +918,7 @@ struct nfs4_link_res { | |||
907 | struct nfs4_sequence_res seq_res; | 918 | struct nfs4_sequence_res seq_res; |
908 | const struct nfs_server * server; | 919 | const struct nfs_server * server; |
909 | struct nfs_fattr * fattr; | 920 | struct nfs_fattr * fattr; |
921 | struct nfs4_label *label; | ||
910 | struct nfs4_change_info cinfo; | 922 | struct nfs4_change_info cinfo; |
911 | struct nfs_fattr * dir_attr; | 923 | struct nfs_fattr * dir_attr; |
912 | }; | 924 | }; |
@@ -924,6 +936,7 @@ struct nfs4_lookup_res { | |||
924 | const struct nfs_server * server; | 936 | const struct nfs_server * server; |
925 | struct nfs_fattr * fattr; | 937 | struct nfs_fattr * fattr; |
926 | struct nfs_fh * fh; | 938 | struct nfs_fh * fh; |
939 | struct nfs4_label *label; | ||
927 | }; | 940 | }; |
928 | 941 | ||
929 | struct nfs4_lookup_root_arg { | 942 | struct nfs4_lookup_root_arg { |
@@ -1366,11 +1379,12 @@ struct nfs_rpc_ops { | |||
1366 | struct dentry *(*try_mount) (int, const char *, struct nfs_mount_info *, | 1379 | struct dentry *(*try_mount) (int, const char *, struct nfs_mount_info *, |
1367 | struct nfs_subversion *); | 1380 | struct nfs_subversion *); |
1368 | int (*getattr) (struct nfs_server *, struct nfs_fh *, | 1381 | int (*getattr) (struct nfs_server *, struct nfs_fh *, |
1369 | struct nfs_fattr *); | 1382 | struct nfs_fattr *, struct nfs4_label *); |
1370 | int (*setattr) (struct dentry *, struct nfs_fattr *, | 1383 | int (*setattr) (struct dentry *, struct nfs_fattr *, |
1371 | struct iattr *); | 1384 | struct iattr *); |
1372 | int (*lookup) (struct inode *, struct qstr *, | 1385 | int (*lookup) (struct inode *, struct qstr *, |
1373 | struct nfs_fh *, struct nfs_fattr *); | 1386 | struct nfs_fh *, struct nfs_fattr *, |
1387 | struct nfs4_label *); | ||
1374 | int (*access) (struct inode *, struct nfs_access_entry *); | 1388 | int (*access) (struct inode *, struct nfs_access_entry *); |
1375 | int (*readlink)(struct inode *, struct page *, unsigned int, | 1389 | int (*readlink)(struct inode *, struct page *, unsigned int, |
1376 | unsigned int); | 1390 | unsigned int); |
diff --git a/include/linux/nmi.h b/include/linux/nmi.h index db50840e6355..6a45fb583ff1 100644 --- a/include/linux/nmi.h +++ b/include/linux/nmi.h | |||
@@ -46,7 +46,7 @@ static inline bool trigger_all_cpu_backtrace(void) | |||
46 | #ifdef CONFIG_LOCKUP_DETECTOR | 46 | #ifdef CONFIG_LOCKUP_DETECTOR |
47 | int hw_nmi_is_cpu_stuck(struct pt_regs *); | 47 | int hw_nmi_is_cpu_stuck(struct pt_regs *); |
48 | u64 hw_nmi_get_sample_period(int watchdog_thresh); | 48 | u64 hw_nmi_get_sample_period(int watchdog_thresh); |
49 | extern int watchdog_enabled; | 49 | extern int watchdog_user_enabled; |
50 | extern int watchdog_thresh; | 50 | extern int watchdog_thresh; |
51 | struct ctl_table; | 51 | struct ctl_table; |
52 | extern int proc_dowatchdog(struct ctl_table *, int , | 52 | extern int proc_dowatchdog(struct ctl_table *, int , |
diff --git a/include/linux/of_address.h b/include/linux/of_address.h index 0506eb53519b..4c2e6f26432c 100644 --- a/include/linux/of_address.h +++ b/include/linux/of_address.h | |||
@@ -4,6 +4,36 @@ | |||
4 | #include <linux/errno.h> | 4 | #include <linux/errno.h> |
5 | #include <linux/of.h> | 5 | #include <linux/of.h> |
6 | 6 | ||
7 | struct of_pci_range_parser { | ||
8 | struct device_node *node; | ||
9 | const __be32 *range; | ||
10 | const __be32 *end; | ||
11 | int np; | ||
12 | int pna; | ||
13 | }; | ||
14 | |||
15 | struct of_pci_range { | ||
16 | u32 pci_space; | ||
17 | u64 pci_addr; | ||
18 | u64 cpu_addr; | ||
19 | u64 size; | ||
20 | u32 flags; | ||
21 | }; | ||
22 | |||
23 | #define for_each_of_pci_range(parser, range) \ | ||
24 | for (; of_pci_range_parser_one(parser, range);) | ||
25 | |||
26 | static inline void of_pci_range_to_resource(struct of_pci_range *range, | ||
27 | struct device_node *np, | ||
28 | struct resource *res) | ||
29 | { | ||
30 | res->flags = range->flags; | ||
31 | res->start = range->cpu_addr; | ||
32 | res->end = range->cpu_addr + range->size - 1; | ||
33 | res->parent = res->child = res->sibling = NULL; | ||
34 | res->name = np->full_name; | ||
35 | } | ||
36 | |||
7 | #ifdef CONFIG_OF_ADDRESS | 37 | #ifdef CONFIG_OF_ADDRESS |
8 | extern u64 of_translate_address(struct device_node *np, const __be32 *addr); | 38 | extern u64 of_translate_address(struct device_node *np, const __be32 *addr); |
9 | extern bool of_can_translate_address(struct device_node *dev); | 39 | extern bool of_can_translate_address(struct device_node *dev); |
@@ -27,6 +57,11 @@ static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; } | |||
27 | #define pci_address_to_pio pci_address_to_pio | 57 | #define pci_address_to_pio pci_address_to_pio |
28 | #endif | 58 | #endif |
29 | 59 | ||
60 | extern int of_pci_range_parser_init(struct of_pci_range_parser *parser, | ||
61 | struct device_node *node); | ||
62 | extern struct of_pci_range *of_pci_range_parser_one( | ||
63 | struct of_pci_range_parser *parser, | ||
64 | struct of_pci_range *range); | ||
30 | #else /* CONFIG_OF_ADDRESS */ | 65 | #else /* CONFIG_OF_ADDRESS */ |
31 | #ifndef of_address_to_resource | 66 | #ifndef of_address_to_resource |
32 | static inline int of_address_to_resource(struct device_node *dev, int index, | 67 | static inline int of_address_to_resource(struct device_node *dev, int index, |
@@ -53,6 +88,19 @@ static inline const __be32 *of_get_address(struct device_node *dev, int index, | |||
53 | { | 88 | { |
54 | return NULL; | 89 | return NULL; |
55 | } | 90 | } |
91 | |||
92 | static inline int of_pci_range_parser_init(struct of_pci_range_parser *parser, | ||
93 | struct device_node *node) | ||
94 | { | ||
95 | return -1; | ||
96 | } | ||
97 | |||
98 | static inline struct of_pci_range *of_pci_range_parser_one( | ||
99 | struct of_pci_range_parser *parser, | ||
100 | struct of_pci_range *range) | ||
101 | { | ||
102 | return NULL; | ||
103 | } | ||
56 | #endif /* CONFIG_OF_ADDRESS */ | 104 | #endif /* CONFIG_OF_ADDRESS */ |
57 | 105 | ||
58 | 106 | ||
diff --git a/include/linux/of_device.h b/include/linux/of_device.h index 901b7435e890..9d27475feec1 100644 --- a/include/linux/of_device.h +++ b/include/linux/of_device.h | |||
@@ -4,12 +4,12 @@ | |||
4 | #include <linux/platform_device.h> | 4 | #include <linux/platform_device.h> |
5 | #include <linux/of_platform.h> /* temporary until merge */ | 5 | #include <linux/of_platform.h> /* temporary until merge */ |
6 | 6 | ||
7 | #ifdef CONFIG_OF_DEVICE | ||
8 | #include <linux/of.h> | 7 | #include <linux/of.h> |
9 | #include <linux/mod_devicetable.h> | 8 | #include <linux/mod_devicetable.h> |
10 | 9 | ||
11 | struct device; | 10 | struct device; |
12 | 11 | ||
12 | #ifdef CONFIG_OF | ||
13 | extern const struct of_device_id *of_match_device( | 13 | extern const struct of_device_id *of_match_device( |
14 | const struct of_device_id *matches, const struct device *dev); | 14 | const struct of_device_id *matches, const struct device *dev); |
15 | extern void of_device_make_bus_id(struct device *dev); | 15 | extern void of_device_make_bus_id(struct device *dev); |
@@ -43,7 +43,7 @@ static inline void of_device_node_put(struct device *dev) | |||
43 | of_node_put(dev->of_node); | 43 | of_node_put(dev->of_node); |
44 | } | 44 | } |
45 | 45 | ||
46 | #else /* CONFIG_OF_DEVICE */ | 46 | #else /* CONFIG_OF */ |
47 | 47 | ||
48 | static inline int of_driver_match_device(struct device *dev, | 48 | static inline int of_driver_match_device(struct device *dev, |
49 | struct device_driver *drv) | 49 | struct device_driver *drv) |
@@ -67,6 +67,6 @@ static inline const struct of_device_id *of_match_device( | |||
67 | { | 67 | { |
68 | return NULL; | 68 | return NULL; |
69 | } | 69 | } |
70 | #endif /* CONFIG_OF_DEVICE */ | 70 | #endif /* CONFIG_OF */ |
71 | 71 | ||
72 | #endif /* _LINUX_OF_DEVICE_H */ | 72 | #endif /* _LINUX_OF_DEVICE_H */ |
diff --git a/include/linux/of_dma.h b/include/linux/of_dma.h index 364dda734877..ae36298ba076 100644 --- a/include/linux/of_dma.h +++ b/include/linux/of_dma.h | |||
@@ -21,7 +21,6 @@ struct device_node; | |||
21 | struct of_dma { | 21 | struct of_dma { |
22 | struct list_head of_dma_controllers; | 22 | struct list_head of_dma_controllers; |
23 | struct device_node *of_node; | 23 | struct device_node *of_node; |
24 | int of_dma_nbcells; | ||
25 | struct dma_chan *(*of_dma_xlate) | 24 | struct dma_chan *(*of_dma_xlate) |
26 | (struct of_phandle_args *, struct of_dma *); | 25 | (struct of_phandle_args *, struct of_dma *); |
27 | void *of_dma_data; | 26 | void *of_dma_data; |
diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h index bb115deb7612..7a04826018c0 100644 --- a/include/linux/of_pci.h +++ b/include/linux/of_pci.h | |||
@@ -10,5 +10,7 @@ int of_irq_map_pci(const struct pci_dev *pdev, struct of_irq *out_irq); | |||
10 | struct device_node; | 10 | struct device_node; |
11 | struct device_node *of_pci_find_child_device(struct device_node *parent, | 11 | struct device_node *of_pci_find_child_device(struct device_node *parent, |
12 | unsigned int devfn); | 12 | unsigned int devfn); |
13 | int of_pci_get_devfn(struct device_node *np); | ||
14 | int of_pci_parse_bus_range(struct device_node *node, struct resource *res); | ||
13 | 15 | ||
14 | #endif | 16 | #endif |
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h index 2a93b64a3869..05cb4a928252 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h | |||
@@ -13,8 +13,6 @@ | |||
13 | 13 | ||
14 | #include <linux/device.h> | 14 | #include <linux/device.h> |
15 | #include <linux/mod_devicetable.h> | 15 | #include <linux/mod_devicetable.h> |
16 | |||
17 | #ifdef CONFIG_OF_DEVICE | ||
18 | #include <linux/pm.h> | 16 | #include <linux/pm.h> |
19 | #include <linux/of_device.h> | 17 | #include <linux/of_device.h> |
20 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
@@ -53,27 +51,6 @@ struct of_dev_auxdata { | |||
53 | { .compatible = _compat, .phys_addr = _phys, .name = _name, \ | 51 | { .compatible = _compat, .phys_addr = _phys, .name = _name, \ |
54 | .platform_data = _pdata } | 52 | .platform_data = _pdata } |
55 | 53 | ||
56 | /** | ||
57 | * of_platform_driver - Legacy of-aware driver for platform devices. | ||
58 | * | ||
59 | * An of_platform_driver driver is attached to a basic platform_device on | ||
60 | * the ibm ebus (ibmebus_bus_type). | ||
61 | */ | ||
62 | struct of_platform_driver | ||
63 | { | ||
64 | int (*probe)(struct platform_device* dev, | ||
65 | const struct of_device_id *match); | ||
66 | int (*remove)(struct platform_device* dev); | ||
67 | |||
68 | int (*suspend)(struct platform_device* dev, pm_message_t state); | ||
69 | int (*resume)(struct platform_device* dev); | ||
70 | int (*shutdown)(struct platform_device* dev); | ||
71 | |||
72 | struct device_driver driver; | ||
73 | }; | ||
74 | #define to_of_platform_driver(drv) \ | ||
75 | container_of(drv,struct of_platform_driver, driver) | ||
76 | |||
77 | extern const struct of_device_id of_default_bus_match_table[]; | 54 | extern const struct of_device_id of_default_bus_match_table[]; |
78 | 55 | ||
79 | /* Platform drivers register/unregister */ | 56 | /* Platform drivers register/unregister */ |
@@ -82,7 +59,6 @@ extern struct platform_device *of_device_alloc(struct device_node *np, | |||
82 | struct device *parent); | 59 | struct device *parent); |
83 | extern struct platform_device *of_find_device_by_node(struct device_node *np); | 60 | extern struct platform_device *of_find_device_by_node(struct device_node *np); |
84 | 61 | ||
85 | #ifdef CONFIG_OF_ADDRESS /* device reg helpers depend on OF_ADDRESS */ | ||
86 | /* Platform devices and busses creation */ | 62 | /* Platform devices and busses creation */ |
87 | extern struct platform_device *of_platform_device_create(struct device_node *np, | 63 | extern struct platform_device *of_platform_device_create(struct device_node *np, |
88 | const char *bus_id, | 64 | const char *bus_id, |
@@ -91,17 +67,12 @@ extern struct platform_device *of_platform_device_create(struct device_node *np, | |||
91 | extern int of_platform_bus_probe(struct device_node *root, | 67 | extern int of_platform_bus_probe(struct device_node *root, |
92 | const struct of_device_id *matches, | 68 | const struct of_device_id *matches, |
93 | struct device *parent); | 69 | struct device *parent); |
70 | #ifdef CONFIG_OF_ADDRESS | ||
94 | extern int of_platform_populate(struct device_node *root, | 71 | extern int of_platform_populate(struct device_node *root, |
95 | const struct of_device_id *matches, | 72 | const struct of_device_id *matches, |
96 | const struct of_dev_auxdata *lookup, | 73 | const struct of_dev_auxdata *lookup, |
97 | struct device *parent); | 74 | struct device *parent); |
98 | #endif /* CONFIG_OF_ADDRESS */ | 75 | #else |
99 | |||
100 | #endif /* CONFIG_OF_DEVICE */ | ||
101 | |||
102 | #if !defined(CONFIG_OF_ADDRESS) | ||
103 | struct of_dev_auxdata; | ||
104 | struct device_node; | ||
105 | static inline int of_platform_populate(struct device_node *root, | 76 | static inline int of_platform_populate(struct device_node *root, |
106 | const struct of_device_id *matches, | 77 | const struct of_device_id *matches, |
107 | const struct of_dev_auxdata *lookup, | 78 | const struct of_dev_auxdata *lookup, |
@@ -109,6 +80,6 @@ static inline int of_platform_populate(struct device_node *root, | |||
109 | { | 80 | { |
110 | return -ENODEV; | 81 | return -ENODEV; |
111 | } | 82 | } |
112 | #endif /* !CONFIG_OF_ADDRESS */ | 83 | #endif |
113 | 84 | ||
114 | #endif /* _LINUX_OF_PLATFORM_H */ | 85 | #endif /* _LINUX_OF_PLATFORM_H */ |
diff --git a/include/linux/omap-mailbox.h b/include/linux/omap-mailbox.h new file mode 100644 index 000000000000..f8322d9cd235 --- /dev/null +++ b/include/linux/omap-mailbox.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * omap-mailbox: interprocessor communication module for OMAP | ||
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 OMAP_MAILBOX_H | ||
10 | #define OMAP_MAILBOX_H | ||
11 | |||
12 | typedef u32 mbox_msg_t; | ||
13 | struct omap_mbox; | ||
14 | |||
15 | typedef int __bitwise omap_mbox_irq_t; | ||
16 | #define IRQ_TX ((__force omap_mbox_irq_t) 1) | ||
17 | #define IRQ_RX ((__force omap_mbox_irq_t) 2) | ||
18 | |||
19 | int omap_mbox_msg_send(struct omap_mbox *, mbox_msg_t msg); | ||
20 | |||
21 | struct omap_mbox *omap_mbox_get(const char *, struct notifier_block *nb); | ||
22 | void omap_mbox_put(struct omap_mbox *mbox, struct notifier_block *nb); | ||
23 | |||
24 | void omap_mbox_save_ctx(struct omap_mbox *mbox); | ||
25 | void omap_mbox_restore_ctx(struct omap_mbox *mbox); | ||
26 | void omap_mbox_enable_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq); | ||
27 | void omap_mbox_disable_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq); | ||
28 | |||
29 | #endif /* OMAP_MAILBOX_H */ | ||
diff --git a/include/linux/pageblock-flags.h b/include/linux/pageblock-flags.h index be655e4a2a75..2ee8cd2466b5 100644 --- a/include/linux/pageblock-flags.h +++ b/include/linux/pageblock-flags.h | |||
@@ -80,10 +80,4 @@ void set_pageblock_flags_group(struct page *page, unsigned long flags, | |||
80 | PB_migrate_skip) | 80 | PB_migrate_skip) |
81 | #endif /* CONFIG_COMPACTION */ | 81 | #endif /* CONFIG_COMPACTION */ |
82 | 82 | ||
83 | #define get_pageblock_flags(page) \ | ||
84 | get_pageblock_flags_group(page, 0, PB_migrate_end) | ||
85 | #define set_pageblock_flags(page, flags) \ | ||
86 | set_pageblock_flags_group(page, flags, \ | ||
87 | 0, PB_migrate_end) | ||
88 | |||
89 | #endif /* PAGEBLOCK_FLAGS_H */ | 83 | #endif /* PAGEBLOCK_FLAGS_H */ |
diff --git a/include/linux/pagevec.h b/include/linux/pagevec.h index 2aa12b8499c0..e4dbfab37729 100644 --- a/include/linux/pagevec.h +++ b/include/linux/pagevec.h | |||
@@ -21,7 +21,7 @@ struct pagevec { | |||
21 | }; | 21 | }; |
22 | 22 | ||
23 | void __pagevec_release(struct pagevec *pvec); | 23 | void __pagevec_release(struct pagevec *pvec); |
24 | void __pagevec_lru_add(struct pagevec *pvec, enum lru_list lru); | 24 | void __pagevec_lru_add(struct pagevec *pvec); |
25 | unsigned pagevec_lookup(struct pagevec *pvec, struct address_space *mapping, | 25 | unsigned pagevec_lookup(struct pagevec *pvec, struct address_space *mapping, |
26 | pgoff_t start, unsigned nr_pages); | 26 | pgoff_t start, unsigned nr_pages); |
27 | unsigned pagevec_lookup_tag(struct pagevec *pvec, | 27 | unsigned pagevec_lookup_tag(struct pagevec *pvec, |
@@ -64,36 +64,4 @@ static inline void pagevec_release(struct pagevec *pvec) | |||
64 | __pagevec_release(pvec); | 64 | __pagevec_release(pvec); |
65 | } | 65 | } |
66 | 66 | ||
67 | static inline void __pagevec_lru_add_anon(struct pagevec *pvec) | ||
68 | { | ||
69 | __pagevec_lru_add(pvec, LRU_INACTIVE_ANON); | ||
70 | } | ||
71 | |||
72 | static inline void __pagevec_lru_add_active_anon(struct pagevec *pvec) | ||
73 | { | ||
74 | __pagevec_lru_add(pvec, LRU_ACTIVE_ANON); | ||
75 | } | ||
76 | |||
77 | static inline void __pagevec_lru_add_file(struct pagevec *pvec) | ||
78 | { | ||
79 | __pagevec_lru_add(pvec, LRU_INACTIVE_FILE); | ||
80 | } | ||
81 | |||
82 | static inline void __pagevec_lru_add_active_file(struct pagevec *pvec) | ||
83 | { | ||
84 | __pagevec_lru_add(pvec, LRU_ACTIVE_FILE); | ||
85 | } | ||
86 | |||
87 | static inline void pagevec_lru_add_file(struct pagevec *pvec) | ||
88 | { | ||
89 | if (pagevec_count(pvec)) | ||
90 | __pagevec_lru_add_file(pvec); | ||
91 | } | ||
92 | |||
93 | static inline void pagevec_lru_add_anon(struct pagevec *pvec) | ||
94 | { | ||
95 | if (pagevec_count(pvec)) | ||
96 | __pagevec_lru_add_anon(pvec); | ||
97 | } | ||
98 | |||
99 | #endif /* _LINUX_PAGEVEC_H */ | 67 | #endif /* _LINUX_PAGEVEC_H */ |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 3a24e4ff3248..0fd1f1582fa1 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -364,7 +364,8 @@ static inline struct pci_dev *pci_physfn(struct pci_dev *dev) | |||
364 | return dev; | 364 | return dev; |
365 | } | 365 | } |
366 | 366 | ||
367 | struct pci_dev *alloc_pci_dev(void); | 367 | struct pci_dev *pci_alloc_dev(struct pci_bus *bus); |
368 | struct pci_dev * __deprecated alloc_pci_dev(void); | ||
368 | 369 | ||
369 | #define to_pci_dev(n) container_of(n, struct pci_dev, dev) | 370 | #define to_pci_dev(n) container_of(n, struct pci_dev, dev) |
370 | #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) | 371 | #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) |
@@ -1018,6 +1019,8 @@ int pci_request_selected_regions_exclusive(struct pci_dev *, int, const char *); | |||
1018 | void pci_release_selected_regions(struct pci_dev *, int); | 1019 | void pci_release_selected_regions(struct pci_dev *, int); |
1019 | 1020 | ||
1020 | /* drivers/pci/bus.c */ | 1021 | /* drivers/pci/bus.c */ |
1022 | struct pci_bus *pci_bus_get(struct pci_bus *bus); | ||
1023 | void pci_bus_put(struct pci_bus *bus); | ||
1021 | void pci_add_resource(struct list_head *resources, struct resource *res); | 1024 | void pci_add_resource(struct list_head *resources, struct resource *res); |
1022 | void pci_add_resource_offset(struct list_head *resources, struct resource *res, | 1025 | void pci_add_resource_offset(struct list_head *resources, struct resource *res, |
1023 | resource_size_t offset); | 1026 | resource_size_t offset); |
@@ -1643,6 +1646,7 @@ void pcibios_set_master(struct pci_dev *dev); | |||
1643 | int pcibios_set_pcie_reset_state(struct pci_dev *dev, | 1646 | int pcibios_set_pcie_reset_state(struct pci_dev *dev, |
1644 | enum pcie_reset_state state); | 1647 | enum pcie_reset_state state); |
1645 | int pcibios_add_device(struct pci_dev *dev); | 1648 | int pcibios_add_device(struct pci_dev *dev); |
1649 | void pcibios_release_device(struct pci_dev *dev); | ||
1646 | 1650 | ||
1647 | #ifdef CONFIG_PCI_MMCONFIG | 1651 | #ifdef CONFIG_PCI_MMCONFIG |
1648 | void __init pci_mmcfg_early_init(void); | 1652 | void __init pci_mmcfg_early_init(void); |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index c12916248469..3bed2e89611b 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -556,7 +556,6 @@ | |||
556 | #define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450 | 556 | #define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450 |
557 | #define PCI_DEVICE_ID_AMD_8131_APIC 0x7451 | 557 | #define PCI_DEVICE_ID_AMD_8131_APIC 0x7451 |
558 | #define PCI_DEVICE_ID_AMD_8132_BRIDGE 0x7458 | 558 | #define PCI_DEVICE_ID_AMD_8132_BRIDGE 0x7458 |
559 | #define PCI_DEVICE_ID_AMD_HUDSON2_SMBUS 0x780b | ||
560 | #define PCI_DEVICE_ID_AMD_CS5535_IDE 0x208F | 559 | #define PCI_DEVICE_ID_AMD_CS5535_IDE 0x208F |
561 | #define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090 | 560 | #define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090 |
562 | #define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091 | 561 | #define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091 |
@@ -568,8 +567,9 @@ | |||
568 | #define PCI_DEVICE_ID_AMD_CS5536_IDE 0x209A | 567 | #define PCI_DEVICE_ID_AMD_CS5536_IDE 0x209A |
569 | #define PCI_DEVICE_ID_AMD_LX_VIDEO 0x2081 | 568 | #define PCI_DEVICE_ID_AMD_LX_VIDEO 0x2081 |
570 | #define PCI_DEVICE_ID_AMD_LX_AES 0x2082 | 569 | #define PCI_DEVICE_ID_AMD_LX_AES 0x2082 |
571 | #define PCI_DEVICE_ID_AMD_HUDSON2_IDE 0x780c | ||
572 | #define PCI_DEVICE_ID_AMD_HUDSON2_SATA_IDE 0x7800 | 570 | #define PCI_DEVICE_ID_AMD_HUDSON2_SATA_IDE 0x7800 |
571 | #define PCI_DEVICE_ID_AMD_HUDSON2_SMBUS 0x780b | ||
572 | #define PCI_DEVICE_ID_AMD_HUDSON2_IDE 0x780c | ||
573 | 573 | ||
574 | #define PCI_VENDOR_ID_TRIDENT 0x1023 | 574 | #define PCI_VENDOR_ID_TRIDENT 0x1023 |
575 | #define PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 0x2000 | 575 | #define PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 0x2000 |
@@ -2476,6 +2476,9 @@ | |||
2476 | 2476 | ||
2477 | #define PCI_VENDOR_ID_ASMEDIA 0x1b21 | 2477 | #define PCI_VENDOR_ID_ASMEDIA 0x1b21 |
2478 | 2478 | ||
2479 | #define PCI_VENDOR_ID_CIRCUITCO 0x1cc8 | ||
2480 | #define PCI_SUBSYSTEM_ID_CIRCUITCO_MINNOWBOARD 0x0001 | ||
2481 | |||
2479 | #define PCI_VENDOR_ID_TEKRAM 0x1de1 | 2482 | #define PCI_VENDOR_ID_TEKRAM 0x1de1 |
2480 | #define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29 | 2483 | #define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29 |
2481 | 2484 | ||
diff --git a/include/linux/percpu-refcount.h b/include/linux/percpu-refcount.h new file mode 100644 index 000000000000..95961f0bf62d --- /dev/null +++ b/include/linux/percpu-refcount.h | |||
@@ -0,0 +1,174 @@ | |||
1 | /* | ||
2 | * Percpu refcounts: | ||
3 | * (C) 2012 Google, Inc. | ||
4 | * Author: Kent Overstreet <koverstreet@google.com> | ||
5 | * | ||
6 | * This implements a refcount with similar semantics to atomic_t - atomic_inc(), | ||
7 | * atomic_dec_and_test() - but percpu. | ||
8 | * | ||
9 | * There's one important difference between percpu refs and normal atomic_t | ||
10 | * refcounts; you have to keep track of your initial refcount, and then when you | ||
11 | * start shutting down you call percpu_ref_kill() _before_ dropping the initial | ||
12 | * refcount. | ||
13 | * | ||
14 | * The refcount will have a range of 0 to ((1U << 31) - 1), i.e. one bit less | ||
15 | * than an atomic_t - this is because of the way shutdown works, see | ||
16 | * percpu_ref_kill()/PCPU_COUNT_BIAS. | ||
17 | * | ||
18 | * Before you call percpu_ref_kill(), percpu_ref_put() does not check for the | ||
19 | * refcount hitting 0 - it can't, if it was in percpu mode. percpu_ref_kill() | ||
20 | * puts the ref back in single atomic_t mode, collecting the per cpu refs and | ||
21 | * issuing the appropriate barriers, and then marks the ref as shutting down so | ||
22 | * that percpu_ref_put() will check for the ref hitting 0. After it returns, | ||
23 | * it's safe to drop the initial ref. | ||
24 | * | ||
25 | * USAGE: | ||
26 | * | ||
27 | * See fs/aio.c for some example usage; it's used there for struct kioctx, which | ||
28 | * is created when userspaces calls io_setup(), and destroyed when userspace | ||
29 | * calls io_destroy() or the process exits. | ||
30 | * | ||
31 | * In the aio code, kill_ioctx() is called when we wish to destroy a kioctx; it | ||
32 | * calls percpu_ref_kill(), then hlist_del_rcu() and sychronize_rcu() to remove | ||
33 | * the kioctx from the proccess's list of kioctxs - after that, there can't be | ||
34 | * any new users of the kioctx (from lookup_ioctx()) and it's then safe to drop | ||
35 | * the initial ref with percpu_ref_put(). | ||
36 | * | ||
37 | * Code that does a two stage shutdown like this often needs some kind of | ||
38 | * explicit synchronization to ensure the initial refcount can only be dropped | ||
39 | * once - percpu_ref_kill() does this for you, it returns true once and false if | ||
40 | * someone else already called it. The aio code uses it this way, but it's not | ||
41 | * necessary if the code has some other mechanism to synchronize teardown. | ||
42 | * around. | ||
43 | */ | ||
44 | |||
45 | #ifndef _LINUX_PERCPU_REFCOUNT_H | ||
46 | #define _LINUX_PERCPU_REFCOUNT_H | ||
47 | |||
48 | #include <linux/atomic.h> | ||
49 | #include <linux/kernel.h> | ||
50 | #include <linux/percpu.h> | ||
51 | #include <linux/rcupdate.h> | ||
52 | |||
53 | struct percpu_ref; | ||
54 | typedef void (percpu_ref_func_t)(struct percpu_ref *); | ||
55 | |||
56 | struct percpu_ref { | ||
57 | atomic_t count; | ||
58 | /* | ||
59 | * The low bit of the pointer indicates whether the ref is in percpu | ||
60 | * mode; if set, then get/put will manipulate the atomic_t (this is a | ||
61 | * hack because we need to keep the pointer around for | ||
62 | * percpu_ref_kill_rcu()) | ||
63 | */ | ||
64 | unsigned __percpu *pcpu_count; | ||
65 | percpu_ref_func_t *release; | ||
66 | percpu_ref_func_t *confirm_kill; | ||
67 | struct rcu_head rcu; | ||
68 | }; | ||
69 | |||
70 | int __must_check percpu_ref_init(struct percpu_ref *ref, | ||
71 | percpu_ref_func_t *release); | ||
72 | void percpu_ref_cancel_init(struct percpu_ref *ref); | ||
73 | void percpu_ref_kill_and_confirm(struct percpu_ref *ref, | ||
74 | percpu_ref_func_t *confirm_kill); | ||
75 | |||
76 | /** | ||
77 | * percpu_ref_kill - drop the initial ref | ||
78 | * @ref: percpu_ref to kill | ||
79 | * | ||
80 | * Must be used to drop the initial ref on a percpu refcount; must be called | ||
81 | * precisely once before shutdown. | ||
82 | * | ||
83 | * Puts @ref in non percpu mode, then does a call_rcu() before gathering up the | ||
84 | * percpu counters and dropping the initial ref. | ||
85 | */ | ||
86 | static inline void percpu_ref_kill(struct percpu_ref *ref) | ||
87 | { | ||
88 | return percpu_ref_kill_and_confirm(ref, NULL); | ||
89 | } | ||
90 | |||
91 | #define PCPU_STATUS_BITS 2 | ||
92 | #define PCPU_STATUS_MASK ((1 << PCPU_STATUS_BITS) - 1) | ||
93 | #define PCPU_REF_PTR 0 | ||
94 | #define PCPU_REF_DEAD 1 | ||
95 | |||
96 | #define REF_STATUS(count) (((unsigned long) count) & PCPU_STATUS_MASK) | ||
97 | |||
98 | /** | ||
99 | * percpu_ref_get - increment a percpu refcount | ||
100 | * @ref: percpu_ref to get | ||
101 | * | ||
102 | * Analagous to atomic_inc(). | ||
103 | */ | ||
104 | static inline void percpu_ref_get(struct percpu_ref *ref) | ||
105 | { | ||
106 | unsigned __percpu *pcpu_count; | ||
107 | |||
108 | rcu_read_lock_sched(); | ||
109 | |||
110 | pcpu_count = ACCESS_ONCE(ref->pcpu_count); | ||
111 | |||
112 | if (likely(REF_STATUS(pcpu_count) == PCPU_REF_PTR)) | ||
113 | __this_cpu_inc(*pcpu_count); | ||
114 | else | ||
115 | atomic_inc(&ref->count); | ||
116 | |||
117 | rcu_read_unlock_sched(); | ||
118 | } | ||
119 | |||
120 | /** | ||
121 | * percpu_ref_tryget - try to increment a percpu refcount | ||
122 | * @ref: percpu_ref to try-get | ||
123 | * | ||
124 | * Increment a percpu refcount unless it has already been killed. Returns | ||
125 | * %true on success; %false on failure. | ||
126 | * | ||
127 | * Completion of percpu_ref_kill() in itself doesn't guarantee that tryget | ||
128 | * will fail. For such guarantee, percpu_ref_kill_and_confirm() should be | ||
129 | * used. After the confirm_kill callback is invoked, it's guaranteed that | ||
130 | * no new reference will be given out by percpu_ref_tryget(). | ||
131 | */ | ||
132 | static inline bool percpu_ref_tryget(struct percpu_ref *ref) | ||
133 | { | ||
134 | unsigned __percpu *pcpu_count; | ||
135 | int ret = false; | ||
136 | |||
137 | rcu_read_lock_sched(); | ||
138 | |||
139 | pcpu_count = ACCESS_ONCE(ref->pcpu_count); | ||
140 | |||
141 | if (likely(REF_STATUS(pcpu_count) == PCPU_REF_PTR)) { | ||
142 | __this_cpu_inc(*pcpu_count); | ||
143 | ret = true; | ||
144 | } | ||
145 | |||
146 | rcu_read_unlock_sched(); | ||
147 | |||
148 | return ret; | ||
149 | } | ||
150 | |||
151 | /** | ||
152 | * percpu_ref_put - decrement a percpu refcount | ||
153 | * @ref: percpu_ref to put | ||
154 | * | ||
155 | * Decrement the refcount, and if 0, call the release function (which was passed | ||
156 | * to percpu_ref_init()) | ||
157 | */ | ||
158 | static inline void percpu_ref_put(struct percpu_ref *ref) | ||
159 | { | ||
160 | unsigned __percpu *pcpu_count; | ||
161 | |||
162 | rcu_read_lock_sched(); | ||
163 | |||
164 | pcpu_count = ACCESS_ONCE(ref->pcpu_count); | ||
165 | |||
166 | if (likely(REF_STATUS(pcpu_count) == PCPU_REF_PTR)) | ||
167 | __this_cpu_dec(*pcpu_count); | ||
168 | else if (unlikely(atomic_dec_and_test(&ref->count))) | ||
169 | ref->release(ref); | ||
170 | |||
171 | rcu_read_unlock_sched(); | ||
172 | } | ||
173 | |||
174 | #endif | ||
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index c5b6dbf9c2fc..c43f6eabad5b 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -73,13 +73,18 @@ struct perf_raw_record { | |||
73 | * | 73 | * |
74 | * support for mispred, predicted is optional. In case it | 74 | * support for mispred, predicted is optional. In case it |
75 | * is not supported mispred = predicted = 0. | 75 | * is not supported mispred = predicted = 0. |
76 | * | ||
77 | * in_tx: running in a hardware transaction | ||
78 | * abort: aborting a hardware transaction | ||
76 | */ | 79 | */ |
77 | struct perf_branch_entry { | 80 | struct perf_branch_entry { |
78 | __u64 from; | 81 | __u64 from; |
79 | __u64 to; | 82 | __u64 to; |
80 | __u64 mispred:1, /* target mispredicted */ | 83 | __u64 mispred:1, /* target mispredicted */ |
81 | predicted:1,/* target predicted */ | 84 | predicted:1,/* target predicted */ |
82 | reserved:62; | 85 | in_tx:1, /* in transaction */ |
86 | abort:1, /* transaction abort */ | ||
87 | reserved:60; | ||
83 | }; | 88 | }; |
84 | 89 | ||
85 | /* | 90 | /* |
@@ -113,6 +118,8 @@ struct hw_perf_event_extra { | |||
113 | int idx; /* index in shared_regs->regs[] */ | 118 | int idx; /* index in shared_regs->regs[] */ |
114 | }; | 119 | }; |
115 | 120 | ||
121 | struct event_constraint; | ||
122 | |||
116 | /** | 123 | /** |
117 | * struct hw_perf_event - performance event hardware details: | 124 | * struct hw_perf_event - performance event hardware details: |
118 | */ | 125 | */ |
@@ -131,6 +138,8 @@ struct hw_perf_event { | |||
131 | 138 | ||
132 | struct hw_perf_event_extra extra_reg; | 139 | struct hw_perf_event_extra extra_reg; |
133 | struct hw_perf_event_extra branch_reg; | 140 | struct hw_perf_event_extra branch_reg; |
141 | |||
142 | struct event_constraint *constraint; | ||
134 | }; | 143 | }; |
135 | struct { /* software */ | 144 | struct { /* software */ |
136 | struct hrtimer hrtimer; | 145 | struct hrtimer hrtimer; |
@@ -188,12 +197,13 @@ struct pmu { | |||
188 | 197 | ||
189 | struct device *dev; | 198 | struct device *dev; |
190 | const struct attribute_group **attr_groups; | 199 | const struct attribute_group **attr_groups; |
191 | char *name; | 200 | const char *name; |
192 | int type; | 201 | int type; |
193 | 202 | ||
194 | int * __percpu pmu_disable_count; | 203 | int * __percpu pmu_disable_count; |
195 | struct perf_cpu_context * __percpu pmu_cpu_context; | 204 | struct perf_cpu_context * __percpu pmu_cpu_context; |
196 | int task_ctx_nr; | 205 | int task_ctx_nr; |
206 | int hrtimer_interval_ms; | ||
197 | 207 | ||
198 | /* | 208 | /* |
199 | * Fully disable/enable this PMU, can be used to protect from the PMI | 209 | * Fully disable/enable this PMU, can be used to protect from the PMI |
@@ -500,8 +510,9 @@ struct perf_cpu_context { | |||
500 | struct perf_event_context *task_ctx; | 510 | struct perf_event_context *task_ctx; |
501 | int active_oncpu; | 511 | int active_oncpu; |
502 | int exclusive; | 512 | int exclusive; |
513 | struct hrtimer hrtimer; | ||
514 | ktime_t hrtimer_interval; | ||
503 | struct list_head rotation_list; | 515 | struct list_head rotation_list; |
504 | int jiffies_interval; | ||
505 | struct pmu *unique_pmu; | 516 | struct pmu *unique_pmu; |
506 | struct perf_cgroup *cgrp; | 517 | struct perf_cgroup *cgrp; |
507 | }; | 518 | }; |
@@ -517,7 +528,7 @@ struct perf_output_handle { | |||
517 | 528 | ||
518 | #ifdef CONFIG_PERF_EVENTS | 529 | #ifdef CONFIG_PERF_EVENTS |
519 | 530 | ||
520 | extern int perf_pmu_register(struct pmu *pmu, char *name, int type); | 531 | extern int perf_pmu_register(struct pmu *pmu, const char *name, int type); |
521 | extern void perf_pmu_unregister(struct pmu *pmu); | 532 | extern void perf_pmu_unregister(struct pmu *pmu); |
522 | 533 | ||
523 | extern int perf_num_counters(void); | 534 | extern int perf_num_counters(void); |
@@ -695,10 +706,17 @@ static inline void perf_callchain_store(struct perf_callchain_entry *entry, u64 | |||
695 | extern int sysctl_perf_event_paranoid; | 706 | extern int sysctl_perf_event_paranoid; |
696 | extern int sysctl_perf_event_mlock; | 707 | extern int sysctl_perf_event_mlock; |
697 | extern int sysctl_perf_event_sample_rate; | 708 | extern int sysctl_perf_event_sample_rate; |
709 | extern int sysctl_perf_cpu_time_max_percent; | ||
710 | |||
711 | extern void perf_sample_event_took(u64 sample_len_ns); | ||
698 | 712 | ||
699 | extern int perf_proc_update_handler(struct ctl_table *table, int write, | 713 | extern int perf_proc_update_handler(struct ctl_table *table, int write, |
700 | void __user *buffer, size_t *lenp, | 714 | void __user *buffer, size_t *lenp, |
701 | loff_t *ppos); | 715 | loff_t *ppos); |
716 | extern int perf_cpu_time_max_percent_handler(struct ctl_table *table, int write, | ||
717 | void __user *buffer, size_t *lenp, | ||
718 | loff_t *ppos); | ||
719 | |||
702 | 720 | ||
703 | static inline bool perf_paranoid_tracepoint_raw(void) | 721 | static inline bool perf_paranoid_tracepoint_raw(void) |
704 | { | 722 | { |
@@ -742,6 +760,7 @@ extern unsigned int perf_output_skip(struct perf_output_handle *handle, | |||
742 | unsigned int len); | 760 | unsigned int len); |
743 | extern int perf_swevent_get_recursion_context(void); | 761 | extern int perf_swevent_get_recursion_context(void); |
744 | extern void perf_swevent_put_recursion_context(int rctx); | 762 | extern void perf_swevent_put_recursion_context(int rctx); |
763 | extern u64 perf_swevent_set_period(struct perf_event *event); | ||
745 | extern void perf_event_enable(struct perf_event *event); | 764 | extern void perf_event_enable(struct perf_event *event); |
746 | extern void perf_event_disable(struct perf_event *event); | 765 | extern void perf_event_disable(struct perf_event *event); |
747 | extern int __perf_event_disable(void *info); | 766 | extern int __perf_event_disable(void *info); |
@@ -781,6 +800,7 @@ static inline void perf_event_fork(struct task_struct *tsk) { } | |||
781 | static inline void perf_event_init(void) { } | 800 | static inline void perf_event_init(void) { } |
782 | static inline int perf_swevent_get_recursion_context(void) { return -1; } | 801 | static inline int perf_swevent_get_recursion_context(void) { return -1; } |
783 | static inline void perf_swevent_put_recursion_context(int rctx) { } | 802 | static inline void perf_swevent_put_recursion_context(int rctx) { } |
803 | static inline u64 perf_swevent_set_period(struct perf_event *event) { return 0; } | ||
784 | static inline void perf_event_enable(struct perf_event *event) { } | 804 | static inline void perf_event_enable(struct perf_event *event) { } |
785 | static inline void perf_event_disable(struct perf_event *event) { } | 805 | static inline void perf_event_disable(struct perf_event *event) { } |
786 | static inline int __perf_event_disable(void *info) { return -1; } | 806 | static inline int __perf_event_disable(void *info) { return -1; } |
@@ -802,11 +822,11 @@ static inline void perf_restore_debug_store(void) { } | |||
802 | #define perf_output_put(handle, x) perf_output_copy((handle), &(x), sizeof(x)) | 822 | #define perf_output_put(handle, x) perf_output_copy((handle), &(x), sizeof(x)) |
803 | 823 | ||
804 | /* | 824 | /* |
805 | * This has to have a higher priority than migration_notifier in sched.c. | 825 | * This has to have a higher priority than migration_notifier in sched/core.c. |
806 | */ | 826 | */ |
807 | #define perf_cpu_notifier(fn) \ | 827 | #define perf_cpu_notifier(fn) \ |
808 | do { \ | 828 | do { \ |
809 | static struct notifier_block fn##_nb __cpuinitdata = \ | 829 | static struct notifier_block fn##_nb = \ |
810 | { .notifier_call = fn, .priority = CPU_PRI_PERF }; \ | 830 | { .notifier_call = fn, .priority = CPU_PRI_PERF }; \ |
811 | unsigned long cpu = smp_processor_id(); \ | 831 | unsigned long cpu = smp_processor_id(); \ |
812 | unsigned long flags; \ | 832 | unsigned long flags; \ |
diff --git a/include/linux/phy.h b/include/linux/phy.h index 9e11039dd7a3..64ab823f7b74 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
@@ -49,6 +49,7 @@ | |||
49 | 49 | ||
50 | #define PHY_HAS_INTERRUPT 0x00000001 | 50 | #define PHY_HAS_INTERRUPT 0x00000001 |
51 | #define PHY_HAS_MAGICANEG 0x00000002 | 51 | #define PHY_HAS_MAGICANEG 0x00000002 |
52 | #define PHY_IS_INTERNAL 0x00000004 | ||
52 | 53 | ||
53 | /* Interface Mode definitions */ | 54 | /* Interface Mode definitions */ |
54 | typedef enum { | 55 | typedef enum { |
@@ -57,6 +58,7 @@ typedef enum { | |||
57 | PHY_INTERFACE_MODE_GMII, | 58 | PHY_INTERFACE_MODE_GMII, |
58 | PHY_INTERFACE_MODE_SGMII, | 59 | PHY_INTERFACE_MODE_SGMII, |
59 | PHY_INTERFACE_MODE_TBI, | 60 | PHY_INTERFACE_MODE_TBI, |
61 | PHY_INTERFACE_MODE_REVMII, | ||
60 | PHY_INTERFACE_MODE_RMII, | 62 | PHY_INTERFACE_MODE_RMII, |
61 | PHY_INTERFACE_MODE_RGMII, | 63 | PHY_INTERFACE_MODE_RGMII, |
62 | PHY_INTERFACE_MODE_RGMII_ID, | 64 | PHY_INTERFACE_MODE_RGMII_ID, |
@@ -261,6 +263,7 @@ struct phy_c45_device_ids { | |||
261 | * phy_id: UID for this device found during discovery | 263 | * phy_id: UID for this device found during discovery |
262 | * c45_ids: 802.3-c45 Device Identifers if is_c45. | 264 | * c45_ids: 802.3-c45 Device Identifers if is_c45. |
263 | * is_c45: Set to true if this phy uses clause 45 addressing. | 265 | * is_c45: Set to true if this phy uses clause 45 addressing. |
266 | * is_internal: Set to true if this phy is internal to a MAC. | ||
264 | * state: state of the PHY for management purposes | 267 | * state: state of the PHY for management purposes |
265 | * dev_flags: Device-specific flags used by the PHY driver. | 268 | * dev_flags: Device-specific flags used by the PHY driver. |
266 | * addr: Bus address of PHY | 269 | * addr: Bus address of PHY |
@@ -298,6 +301,7 @@ struct phy_device { | |||
298 | 301 | ||
299 | struct phy_c45_device_ids c45_ids; | 302 | struct phy_c45_device_ids c45_ids; |
300 | bool is_c45; | 303 | bool is_c45; |
304 | bool is_internal; | ||
301 | 305 | ||
302 | enum phy_state state; | 306 | enum phy_state state; |
303 | 307 | ||
@@ -508,6 +512,27 @@ static inline int phy_write(struct phy_device *phydev, u32 regnum, u16 val) | |||
508 | return mdiobus_write(phydev->bus, phydev->addr, regnum, val); | 512 | return mdiobus_write(phydev->bus, phydev->addr, regnum, val); |
509 | } | 513 | } |
510 | 514 | ||
515 | /** | ||
516 | * phy_interrupt_is_valid - Convenience function for testing a given PHY irq | ||
517 | * @phydev: the phy_device struct | ||
518 | * | ||
519 | * NOTE: must be kept in sync with addition/removal of PHY_POLL and | ||
520 | * PHY_IGNORE_INTERRUPT | ||
521 | */ | ||
522 | static inline bool phy_interrupt_is_valid(struct phy_device *phydev) | ||
523 | { | ||
524 | return phydev->irq != PHY_POLL && phydev->irq != PHY_IGNORE_INTERRUPT; | ||
525 | } | ||
526 | |||
527 | /** | ||
528 | * phy_is_internal - Convenience function for testing if a PHY is internal | ||
529 | * @phydev: the phy_device struct | ||
530 | */ | ||
531 | static inline bool phy_is_internal(struct phy_device *phydev) | ||
532 | { | ||
533 | return phydev->is_internal; | ||
534 | } | ||
535 | |||
511 | struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id, | 536 | struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id, |
512 | bool is_c45, struct phy_c45_device_ids *c45_ids); | 537 | bool is_c45, struct phy_c45_device_ids *c45_ids); |
513 | struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45); | 538 | struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45); |
@@ -545,6 +570,8 @@ void phy_drivers_unregister(struct phy_driver *drv, int n); | |||
545 | int phy_driver_register(struct phy_driver *new_driver); | 570 | int phy_driver_register(struct phy_driver *new_driver); |
546 | int phy_drivers_register(struct phy_driver *new_driver, int n); | 571 | int phy_drivers_register(struct phy_driver *new_driver, int n); |
547 | void phy_state_machine(struct work_struct *work); | 572 | void phy_state_machine(struct work_struct *work); |
573 | void phy_change(struct work_struct *work); | ||
574 | void phy_mac_interrupt(struct phy_device *phydev, int new_link); | ||
548 | void phy_start_machine(struct phy_device *phydev, | 575 | void phy_start_machine(struct phy_device *phydev, |
549 | void (*handler)(struct net_device *)); | 576 | void (*handler)(struct net_device *)); |
550 | void phy_stop_machine(struct phy_device *phydev); | 577 | void phy_stop_machine(struct phy_device *phydev); |
diff --git a/include/linux/pid.h b/include/linux/pid.h index a089a3c447fc..23705a53abba 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h | |||
@@ -86,11 +86,9 @@ extern struct task_struct *get_pid_task(struct pid *pid, enum pid_type); | |||
86 | extern struct pid *get_task_pid(struct task_struct *task, enum pid_type type); | 86 | extern struct pid *get_task_pid(struct task_struct *task, enum pid_type type); |
87 | 87 | ||
88 | /* | 88 | /* |
89 | * attach_pid() and detach_pid() must be called with the tasklist_lock | 89 | * these helpers must be called with the tasklist_lock write-held. |
90 | * write-held. | ||
91 | */ | 90 | */ |
92 | extern void attach_pid(struct task_struct *task, enum pid_type type, | 91 | extern void attach_pid(struct task_struct *task, enum pid_type); |
93 | struct pid *pid); | ||
94 | extern void detach_pid(struct task_struct *task, enum pid_type); | 92 | extern void detach_pid(struct task_struct *task, enum pid_type); |
95 | extern void change_pid(struct task_struct *task, enum pid_type, | 93 | extern void change_pid(struct task_struct *task, enum pid_type, |
96 | struct pid *pid); | 94 | struct pid *pid); |
diff --git a/include/linux/pinctrl/consumer.h b/include/linux/pinctrl/consumer.h index 4aad3cea69ae..18eccefea06e 100644 --- a/include/linux/pinctrl/consumer.h +++ b/include/linux/pinctrl/consumer.h | |||
@@ -40,6 +40,25 @@ extern int pinctrl_select_state(struct pinctrl *p, struct pinctrl_state *s); | |||
40 | extern struct pinctrl * __must_check devm_pinctrl_get(struct device *dev); | 40 | extern struct pinctrl * __must_check devm_pinctrl_get(struct device *dev); |
41 | extern void devm_pinctrl_put(struct pinctrl *p); | 41 | extern void devm_pinctrl_put(struct pinctrl *p); |
42 | 42 | ||
43 | #ifdef CONFIG_PM | ||
44 | extern int pinctrl_pm_select_default_state(struct device *dev); | ||
45 | extern int pinctrl_pm_select_sleep_state(struct device *dev); | ||
46 | extern int pinctrl_pm_select_idle_state(struct device *dev); | ||
47 | #else | ||
48 | static inline int pinctrl_pm_select_default_state(struct device *dev) | ||
49 | { | ||
50 | return 0; | ||
51 | } | ||
52 | static inline int pinctrl_pm_select_sleep_state(struct device *dev) | ||
53 | { | ||
54 | return 0; | ||
55 | } | ||
56 | static inline int pinctrl_pm_select_idle_state(struct device *dev) | ||
57 | { | ||
58 | return 0; | ||
59 | } | ||
60 | #endif | ||
61 | |||
43 | #else /* !CONFIG_PINCTRL */ | 62 | #else /* !CONFIG_PINCTRL */ |
44 | 63 | ||
45 | static inline int pinctrl_request_gpio(unsigned gpio) | 64 | static inline int pinctrl_request_gpio(unsigned gpio) |
@@ -92,6 +111,21 @@ static inline void devm_pinctrl_put(struct pinctrl *p) | |||
92 | { | 111 | { |
93 | } | 112 | } |
94 | 113 | ||
114 | static inline int pinctrl_pm_select_default_state(struct device *dev) | ||
115 | { | ||
116 | return 0; | ||
117 | } | ||
118 | |||
119 | static inline int pinctrl_pm_select_sleep_state(struct device *dev) | ||
120 | { | ||
121 | return 0; | ||
122 | } | ||
123 | |||
124 | static inline int pinctrl_pm_select_idle_state(struct device *dev) | ||
125 | { | ||
126 | return 0; | ||
127 | } | ||
128 | |||
95 | #endif /* CONFIG_PINCTRL */ | 129 | #endif /* CONFIG_PINCTRL */ |
96 | 130 | ||
97 | static inline struct pinctrl * __must_check pinctrl_get_select( | 131 | static inline struct pinctrl * __must_check pinctrl_get_select( |
@@ -158,47 +192,4 @@ static inline struct pinctrl * __must_check devm_pinctrl_get_select_default( | |||
158 | return devm_pinctrl_get_select(dev, PINCTRL_STATE_DEFAULT); | 192 | return devm_pinctrl_get_select(dev, PINCTRL_STATE_DEFAULT); |
159 | } | 193 | } |
160 | 194 | ||
161 | #ifdef CONFIG_PINCONF | ||
162 | |||
163 | extern int pin_config_get(const char *dev_name, const char *name, | ||
164 | unsigned long *config); | ||
165 | extern int pin_config_set(const char *dev_name, const char *name, | ||
166 | unsigned long config); | ||
167 | extern int pin_config_group_get(const char *dev_name, | ||
168 | const char *pin_group, | ||
169 | unsigned long *config); | ||
170 | extern int pin_config_group_set(const char *dev_name, | ||
171 | const char *pin_group, | ||
172 | unsigned long config); | ||
173 | |||
174 | #else | ||
175 | |||
176 | static inline int pin_config_get(const char *dev_name, const char *name, | ||
177 | unsigned long *config) | ||
178 | { | ||
179 | return 0; | ||
180 | } | ||
181 | |||
182 | static inline int pin_config_set(const char *dev_name, const char *name, | ||
183 | unsigned long config) | ||
184 | { | ||
185 | return 0; | ||
186 | } | ||
187 | |||
188 | static inline int pin_config_group_get(const char *dev_name, | ||
189 | const char *pin_group, | ||
190 | unsigned long *config) | ||
191 | { | ||
192 | return 0; | ||
193 | } | ||
194 | |||
195 | static inline int pin_config_group_set(const char *dev_name, | ||
196 | const char *pin_group, | ||
197 | unsigned long config) | ||
198 | { | ||
199 | return 0; | ||
200 | } | ||
201 | |||
202 | #endif | ||
203 | |||
204 | #endif /* __LINUX_PINCTRL_CONSUMER_H */ | 195 | #endif /* __LINUX_PINCTRL_CONSUMER_H */ |
diff --git a/include/linux/pinctrl/devinfo.h b/include/linux/pinctrl/devinfo.h index 6e5f8a985ea7..281cb91ddcf5 100644 --- a/include/linux/pinctrl/devinfo.h +++ b/include/linux/pinctrl/devinfo.h | |||
@@ -28,6 +28,10 @@ | |||
28 | struct dev_pin_info { | 28 | struct dev_pin_info { |
29 | struct pinctrl *p; | 29 | struct pinctrl *p; |
30 | struct pinctrl_state *default_state; | 30 | struct pinctrl_state *default_state; |
31 | #ifdef CONFIG_PM | ||
32 | struct pinctrl_state *sleep_state; | ||
33 | struct pinctrl_state *idle_state; | ||
34 | #endif | ||
31 | }; | 35 | }; |
32 | 36 | ||
33 | extern int pinctrl_bind_pins(struct device *dev); | 37 | extern int pinctrl_bind_pins(struct device *dev); |
diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h index 6aa238096622..bf7e989abcb5 100644 --- a/include/linux/pinctrl/pinconf-generic.h +++ b/include/linux/pinctrl/pinconf-generic.h | |||
@@ -29,12 +29,25 @@ | |||
29 | * if for example some other pin is going to drive the signal connected | 29 | * if for example some other pin is going to drive the signal connected |
30 | * to it for a while. Pins used for input are usually always high | 30 | * to it for a while. Pins used for input are usually always high |
31 | * impedance. | 31 | * impedance. |
32 | * @PIN_CONFIG_BIAS_BUS_HOLD: the pin will be set to weakly latch so that it | ||
33 | * weakly drives the last value on a tristate bus, also known as a "bus | ||
34 | * holder", "bus keeper" or "repeater". This allows another device on the | ||
35 | * bus to change the value by driving the bus high or low and switching to | ||
36 | * tristate. The argument is ignored. | ||
32 | * @PIN_CONFIG_BIAS_PULL_UP: the pin will be pulled up (usually with high | 37 | * @PIN_CONFIG_BIAS_PULL_UP: the pin will be pulled up (usually with high |
33 | * impedance to VDD). If the argument is != 0 pull-up is enabled, | 38 | * impedance to VDD). If the argument is != 0 pull-up is enabled, |
34 | * if it is 0, pull-up is disabled. | 39 | * if it is 0, pull-up is total, i.e. the pin is connected to VDD. |
35 | * @PIN_CONFIG_BIAS_PULL_DOWN: the pin will be pulled down (usually with high | 40 | * @PIN_CONFIG_BIAS_PULL_DOWN: the pin will be pulled down (usually with high |
36 | * impedance to GROUND). If the argument is != 0 pull-down is enabled, | 41 | * impedance to GROUND). If the argument is != 0 pull-down is enabled, |
37 | * if it is 0, pull-down is disabled. | 42 | * if it is 0, pull-down is total, i.e. the pin is connected to GROUND. |
43 | * @PIN_CONFIG_BIAS_PULL_PIN_DEFAULT: the pin will be pulled up or down based | ||
44 | * on embedded knowledge of the controller hardware, like current mux | ||
45 | * function. The pull direction and possibly strength too will normally | ||
46 | * be decided completely inside the hardware block and not be readable | ||
47 | * from the kernel side. | ||
48 | * If the argument is != 0 pull up/down is enabled, if it is 0, the | ||
49 | * configuration is ignored. The proper way to disable it is to use | ||
50 | * @PIN_CONFIG_BIAS_DISABLE. | ||
38 | * @PIN_CONFIG_DRIVE_PUSH_PULL: the pin will be driven actively high and | 51 | * @PIN_CONFIG_DRIVE_PUSH_PULL: the pin will be driven actively high and |
39 | * low, this is the most typical case and is typically achieved with two | 52 | * low, this is the most typical case and is typically achieved with two |
40 | * active transistors on the output. Setting this config will enable | 53 | * active transistors on the output. Setting this config will enable |
@@ -57,14 +70,14 @@ | |||
57 | * setting pins to this mode. | 70 | * setting pins to this mode. |
58 | * @PIN_CONFIG_INPUT_DEBOUNCE: this will configure the pin to debounce mode, | 71 | * @PIN_CONFIG_INPUT_DEBOUNCE: this will configure the pin to debounce mode, |
59 | * which means it will wait for signals to settle when reading inputs. The | 72 | * which means it will wait for signals to settle when reading inputs. The |
60 | * argument gives the debounce time on a custom format. Setting the | 73 | * argument gives the debounce time in usecs. Setting the |
61 | * argument to zero turns debouncing off. | 74 | * argument to zero turns debouncing off. |
62 | * @PIN_CONFIG_POWER_SOURCE: if the pin can select between different power | 75 | * @PIN_CONFIG_POWER_SOURCE: if the pin can select between different power |
63 | * supplies, the argument to this parameter (on a custom format) tells | 76 | * supplies, the argument to this parameter (on a custom format) tells |
64 | * the driver which alternative power source to use. | 77 | * the driver which alternative power source to use. |
65 | * @PIN_CONFIG_SLEW_RATE: if the pin can select slew rate, the argument to | 78 | * @PIN_CONFIG_SLEW_RATE: if the pin can select slew rate, the argument to |
66 | * this parameter (on a custom format) tells the driver which alternative | 79 | * this parameter (on a custom format) tells the driver which alternative |
67 | * slew rate to use. | 80 | * slew rate to use. |
68 | * @PIN_CONFIG_LOW_POWER_MODE: this will configure the pin for low power | 81 | * @PIN_CONFIG_LOW_POWER_MODE: this will configure the pin for low power |
69 | * operation, if several modes of operation are supported these can be | 82 | * operation, if several modes of operation are supported these can be |
70 | * passed in the argument on a custom form, else just use argument 1 | 83 | * passed in the argument on a custom form, else just use argument 1 |
@@ -78,8 +91,10 @@ | |||
78 | enum pin_config_param { | 91 | enum pin_config_param { |
79 | PIN_CONFIG_BIAS_DISABLE, | 92 | PIN_CONFIG_BIAS_DISABLE, |
80 | PIN_CONFIG_BIAS_HIGH_IMPEDANCE, | 93 | PIN_CONFIG_BIAS_HIGH_IMPEDANCE, |
94 | PIN_CONFIG_BIAS_BUS_HOLD, | ||
81 | PIN_CONFIG_BIAS_PULL_UP, | 95 | PIN_CONFIG_BIAS_PULL_UP, |
82 | PIN_CONFIG_BIAS_PULL_DOWN, | 96 | PIN_CONFIG_BIAS_PULL_DOWN, |
97 | PIN_CONFIG_BIAS_PULL_PIN_DEFAULT, | ||
83 | PIN_CONFIG_DRIVE_PUSH_PULL, | 98 | PIN_CONFIG_DRIVE_PUSH_PULL, |
84 | PIN_CONFIG_DRIVE_OPEN_DRAIN, | 99 | PIN_CONFIG_DRIVE_OPEN_DRAIN, |
85 | PIN_CONFIG_DRIVE_OPEN_SOURCE, | 100 | PIN_CONFIG_DRIVE_OPEN_SOURCE, |
diff --git a/include/linux/pinctrl/pinconf.h b/include/linux/pinctrl/pinconf.h index 1ad4f31ef6b8..f6998692bdc9 100644 --- a/include/linux/pinctrl/pinconf.h +++ b/include/linux/pinctrl/pinconf.h | |||
@@ -30,7 +30,7 @@ struct seq_file; | |||
30 | * @pin_config_set: configure an individual pin | 30 | * @pin_config_set: configure an individual pin |
31 | * @pin_config_group_get: get configurations for an entire pin group | 31 | * @pin_config_group_get: get configurations for an entire pin group |
32 | * @pin_config_group_set: configure all pins in a group | 32 | * @pin_config_group_set: configure all pins in a group |
33 | * @pin_config_group_dbg_set: optional debugfs to modify a pin configuration | 33 | * @pin_config_dbg_parse_modify: optional debugfs to modify a pin configuration |
34 | * @pin_config_dbg_show: optional debugfs display hook that will provide | 34 | * @pin_config_dbg_show: optional debugfs display hook that will provide |
35 | * per-device info for a certain pin in debugfs | 35 | * per-device info for a certain pin in debugfs |
36 | * @pin_config_group_dbg_show: optional debugfs display hook that will provide | 36 | * @pin_config_group_dbg_show: optional debugfs display hook that will provide |
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index 2c2a9e8d8578..5979147d2bda 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h | |||
@@ -49,7 +49,8 @@ struct pinctrl_pin_desc { | |||
49 | * @name: a name for the chip in this range | 49 | * @name: a name for the chip in this range |
50 | * @id: an ID number for the chip in this range | 50 | * @id: an ID number for the chip in this range |
51 | * @base: base offset of the GPIO range | 51 | * @base: base offset of the GPIO range |
52 | * @pin_base: base pin number of the GPIO range | 52 | * @pin_base: base pin number of the GPIO range if pins == NULL |
53 | * @pins: enumeration of pins in GPIO range or NULL | ||
53 | * @npins: number of pins in the GPIO range, including the base number | 54 | * @npins: number of pins in the GPIO range, including the base number |
54 | * @gc: an optional pointer to a gpio_chip | 55 | * @gc: an optional pointer to a gpio_chip |
55 | */ | 56 | */ |
@@ -59,6 +60,7 @@ struct pinctrl_gpio_range { | |||
59 | unsigned int id; | 60 | unsigned int id; |
60 | unsigned int base; | 61 | unsigned int base; |
61 | unsigned int pin_base; | 62 | unsigned int pin_base; |
63 | unsigned const *pins; | ||
62 | unsigned int npins; | 64 | unsigned int npins; |
63 | struct gpio_chip *gc; | 65 | struct gpio_chip *gc; |
64 | }; | 66 | }; |
diff --git a/include/linux/platform_data/ad7303.h b/include/linux/platform_data/ad7303.h new file mode 100644 index 000000000000..de6a7a6b4bbf --- /dev/null +++ b/include/linux/platform_data/ad7303.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * Analog Devices AD7303 DAC driver | ||
3 | * | ||
4 | * Copyright 2013 Analog Devices Inc. | ||
5 | * | ||
6 | * Licensed under the GPL-2. | ||
7 | */ | ||
8 | |||
9 | #ifndef __IIO_ADC_AD7303_H__ | ||
10 | #define __IIO_ADC_AD7303_H__ | ||
11 | |||
12 | /** | ||
13 | * struct ad7303_platform_data - AD7303 platform data | ||
14 | * @use_external_ref: If set to true use an external voltage reference connected | ||
15 | * to the REF pin, otherwise use the internal reference derived from Vdd. | ||
16 | */ | ||
17 | struct ad7303_platform_data { | ||
18 | bool use_external_ref; | ||
19 | }; | ||
20 | |||
21 | #endif | ||
diff --git a/include/linux/platform_data/brcmfmac-sdio.h b/include/linux/platform_data/brcmfmac-sdio.h index 1ade657d5fc1..b7174998c24a 100644 --- a/include/linux/platform_data/brcmfmac-sdio.h +++ b/include/linux/platform_data/brcmfmac-sdio.h | |||
@@ -90,6 +90,10 @@ void __init brcmfmac_init_pdata(void) | |||
90 | * oob_irq_nr, oob_irq_flags: the OOB interrupt information. The values are | 90 | * oob_irq_nr, oob_irq_flags: the OOB interrupt information. The values are |
91 | * used for registering the irq using request_irq function. | 91 | * used for registering the irq using request_irq function. |
92 | * | 92 | * |
93 | * broken_sg_support: flag for broken sg list support of SDIO host controller. | ||
94 | * Set this to true if the SDIO host controller has higher align requirement | ||
95 | * than 32 bytes for each scatterlist item. | ||
96 | * | ||
93 | * power_on: This function is called by the brcmfmac when the module gets | 97 | * power_on: This function is called by the brcmfmac when the module gets |
94 | * loaded. This can be particularly useful for low power devices. The platform | 98 | * loaded. This can be particularly useful for low power devices. The platform |
95 | * spcific routine may for example decide to power up the complete device. | 99 | * spcific routine may for example decide to power up the complete device. |
@@ -116,6 +120,7 @@ struct brcmfmac_sdio_platform_data { | |||
116 | bool oob_irq_supported; | 120 | bool oob_irq_supported; |
117 | unsigned int oob_irq_nr; | 121 | unsigned int oob_irq_nr; |
118 | unsigned long oob_irq_flags; | 122 | unsigned long oob_irq_flags; |
123 | bool broken_sg_support; | ||
119 | void (*power_on)(void); | 124 | void (*power_on)(void); |
120 | void (*power_off)(void); | 125 | void (*power_off)(void); |
121 | void (*reset)(void); | 126 | void (*reset)(void); |
diff --git a/include/linux/platform_data/clk-ux500.h b/include/linux/platform_data/clk-ux500.h index 320d9c39ea0a..9d98f3aaa16c 100644 --- a/include/linux/platform_data/clk-ux500.h +++ b/include/linux/platform_data/clk-ux500.h | |||
@@ -12,7 +12,9 @@ | |||
12 | 12 | ||
13 | void u8500_clk_init(u32 clkrst1_base, u32 clkrst2_base, u32 clkrst3_base, | 13 | void u8500_clk_init(u32 clkrst1_base, u32 clkrst2_base, u32 clkrst3_base, |
14 | u32 clkrst5_base, u32 clkrst6_base); | 14 | u32 clkrst5_base, u32 clkrst6_base); |
15 | void u9540_clk_init(void); | 15 | void u9540_clk_init(u32 clkrst1_base, u32 clkrst2_base, u32 clkrst3_base, |
16 | void u8540_clk_init(void); | 16 | u32 clkrst5_base, u32 clkrst6_base); |
17 | void u8540_clk_init(u32 clkrst1_base, u32 clkrst2_base, u32 clkrst3_base, | ||
18 | u32 clkrst5_base, u32 clkrst6_base); | ||
17 | 19 | ||
18 | #endif /* __CLK_UX500_H */ | 20 | #endif /* __CLK_UX500_H */ |
diff --git a/include/linux/platform_data/cyttsp4.h b/include/linux/platform_data/cyttsp4.h new file mode 100644 index 000000000000..6eba54aff1dc --- /dev/null +++ b/include/linux/platform_data/cyttsp4.h | |||
@@ -0,0 +1,76 @@ | |||
1 | /* | ||
2 | * Header file for: | ||
3 | * Cypress TrueTouch(TM) Standard Product (TTSP) touchscreen drivers. | ||
4 | * For use with Cypress Txx3xx parts. | ||
5 | * Supported parts include: | ||
6 | * CY8CTST341 | ||
7 | * CY8CTMA340 | ||
8 | * | ||
9 | * Copyright (C) 2009, 2010, 2011 Cypress Semiconductor, Inc. | ||
10 | * Copyright (C) 2012 Javier Martinez Canillas <javier@dowhile0.org> | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * version 2, and only version 2, as published by the | ||
15 | * Free Software Foundation. | ||
16 | * | ||
17 | * This program is distributed in the hope that it will be useful, | ||
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
20 | * GNU General Public License for more details. | ||
21 | * | ||
22 | * You should have received a copy of the GNU General Public License along | ||
23 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
24 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
25 | * | ||
26 | * Contact Cypress Semiconductor at www.cypress.com (kev@cypress.com) | ||
27 | * | ||
28 | */ | ||
29 | #ifndef _CYTTSP4_H_ | ||
30 | #define _CYTTSP4_H_ | ||
31 | |||
32 | #define CYTTSP4_MT_NAME "cyttsp4_mt" | ||
33 | #define CYTTSP4_I2C_NAME "cyttsp4_i2c_adapter" | ||
34 | #define CYTTSP4_SPI_NAME "cyttsp4_spi_adapter" | ||
35 | |||
36 | #define CY_TOUCH_SETTINGS_MAX 32 | ||
37 | |||
38 | struct touch_framework { | ||
39 | const uint16_t *abs; | ||
40 | uint8_t size; | ||
41 | uint8_t enable_vkeys; | ||
42 | } __packed; | ||
43 | |||
44 | struct cyttsp4_mt_platform_data { | ||
45 | struct touch_framework *frmwrk; | ||
46 | unsigned short flags; | ||
47 | char const *inp_dev_name; | ||
48 | }; | ||
49 | |||
50 | struct touch_settings { | ||
51 | const uint8_t *data; | ||
52 | uint32_t size; | ||
53 | uint8_t tag; | ||
54 | } __packed; | ||
55 | |||
56 | struct cyttsp4_core_platform_data { | ||
57 | int irq_gpio; | ||
58 | int rst_gpio; | ||
59 | int level_irq_udelay; | ||
60 | int (*xres)(struct cyttsp4_core_platform_data *pdata, | ||
61 | struct device *dev); | ||
62 | int (*init)(struct cyttsp4_core_platform_data *pdata, | ||
63 | int on, struct device *dev); | ||
64 | int (*power)(struct cyttsp4_core_platform_data *pdata, | ||
65 | int on, struct device *dev, atomic_t *ignore_irq); | ||
66 | int (*irq_stat)(struct cyttsp4_core_platform_data *pdata, | ||
67 | struct device *dev); | ||
68 | struct touch_settings *sett[CY_TOUCH_SETTINGS_MAX]; | ||
69 | }; | ||
70 | |||
71 | struct cyttsp4_platform_data { | ||
72 | struct cyttsp4_core_platform_data *core_pdata; | ||
73 | struct cyttsp4_mt_platform_data *mt_pdata; | ||
74 | }; | ||
75 | |||
76 | #endif /* _CYTTSP4_H_ */ | ||
diff --git a/include/linux/platform_data/dma-atmel.h b/include/linux/platform_data/dma-atmel.h index cab0997be3de..e95f19c65873 100644 --- a/include/linux/platform_data/dma-atmel.h +++ b/include/linux/platform_data/dma-atmel.h | |||
@@ -35,16 +35,20 @@ struct at_dma_slave { | |||
35 | 35 | ||
36 | 36 | ||
37 | /* Platform-configurable bits in CFG */ | 37 | /* Platform-configurable bits in CFG */ |
38 | #define ATC_PER_MSB(h) ((0x30U & (h)) >> 4) /* Extract most significant bits of a handshaking identifier */ | ||
39 | |||
38 | #define ATC_SRC_PER(h) (0xFU & (h)) /* Channel src rq associated with periph handshaking ifc h */ | 40 | #define ATC_SRC_PER(h) (0xFU & (h)) /* Channel src rq associated with periph handshaking ifc h */ |
39 | #define ATC_DST_PER(h) ((0xFU & (h)) << 4) /* Channel dst rq associated with periph handshaking ifc h */ | 41 | #define ATC_DST_PER(h) ((0xFU & (h)) << 4) /* Channel dst rq associated with periph handshaking ifc h */ |
40 | #define ATC_SRC_REP (0x1 << 8) /* Source Replay Mod */ | 42 | #define ATC_SRC_REP (0x1 << 8) /* Source Replay Mod */ |
41 | #define ATC_SRC_H2SEL (0x1 << 9) /* Source Handshaking Mod */ | 43 | #define ATC_SRC_H2SEL (0x1 << 9) /* Source Handshaking Mod */ |
42 | #define ATC_SRC_H2SEL_SW (0x0 << 9) | 44 | #define ATC_SRC_H2SEL_SW (0x0 << 9) |
43 | #define ATC_SRC_H2SEL_HW (0x1 << 9) | 45 | #define ATC_SRC_H2SEL_HW (0x1 << 9) |
46 | #define ATC_SRC_PER_MSB(h) (ATC_PER_MSB(h) << 10) /* Channel src rq (most significant bits) */ | ||
44 | #define ATC_DST_REP (0x1 << 12) /* Destination Replay Mod */ | 47 | #define ATC_DST_REP (0x1 << 12) /* Destination Replay Mod */ |
45 | #define ATC_DST_H2SEL (0x1 << 13) /* Destination Handshaking Mod */ | 48 | #define ATC_DST_H2SEL (0x1 << 13) /* Destination Handshaking Mod */ |
46 | #define ATC_DST_H2SEL_SW (0x0 << 13) | 49 | #define ATC_DST_H2SEL_SW (0x0 << 13) |
47 | #define ATC_DST_H2SEL_HW (0x1 << 13) | 50 | #define ATC_DST_H2SEL_HW (0x1 << 13) |
51 | #define ATC_DST_PER_MSB(h) (ATC_PER_MSB(h) << 14) /* Channel dst rq (most significant bits) */ | ||
48 | #define ATC_SOD (0x1 << 16) /* Stop On Done */ | 52 | #define ATC_SOD (0x1 << 16) /* Stop On Done */ |
49 | #define ATC_LOCK_IF (0x1 << 20) /* Interface Lock */ | 53 | #define ATC_LOCK_IF (0x1 << 20) /* Interface Lock */ |
50 | #define ATC_LOCK_B (0x1 << 21) /* AHB Bus Lock */ | 54 | #define ATC_LOCK_B (0x1 << 21) /* AHB Bus Lock */ |
diff --git a/include/linux/platform_data/dma-imx.h b/include/linux/platform_data/dma-imx.h index f6d30cc1cb77..beac6b8b6a7b 100644 --- a/include/linux/platform_data/dma-imx.h +++ b/include/linux/platform_data/dma-imx.h | |||
@@ -60,10 +60,8 @@ static inline int imx_dma_is_ipu(struct dma_chan *chan) | |||
60 | 60 | ||
61 | static inline int imx_dma_is_general_purpose(struct dma_chan *chan) | 61 | static inline int imx_dma_is_general_purpose(struct dma_chan *chan) |
62 | { | 62 | { |
63 | return strstr(dev_name(chan->device->dev), "sdma") || | 63 | return !strcmp(chan->device->dev->driver->name, "imx-sdma") || |
64 | !strcmp(dev_name(chan->device->dev), "imx1-dma") || | 64 | !strcmp(chan->device->dev->driver->name, "imx-dma"); |
65 | !strcmp(dev_name(chan->device->dev), "imx21-dma") || | ||
66 | !strcmp(dev_name(chan->device->dev), "imx27-dma"); | ||
67 | } | 65 | } |
68 | 66 | ||
69 | #endif | 67 | #endif |
diff --git a/include/linux/platform_data/dma-ste-dma40.h b/include/linux/platform_data/dma-ste-dma40.h index 4b781014b0a0..1bb9b1852256 100644 --- a/include/linux/platform_data/dma-ste-dma40.h +++ b/include/linux/platform_data/dma-ste-dma40.h | |||
@@ -70,23 +70,8 @@ enum stedma40_flow_ctrl { | |||
70 | STEDMA40_FLOW_CTRL, | 70 | STEDMA40_FLOW_CTRL, |
71 | }; | 71 | }; |
72 | 72 | ||
73 | enum stedma40_periph_data_width { | ||
74 | STEDMA40_BYTE_WIDTH = STEDMA40_ESIZE_8_BIT, | ||
75 | STEDMA40_HALFWORD_WIDTH = STEDMA40_ESIZE_16_BIT, | ||
76 | STEDMA40_WORD_WIDTH = STEDMA40_ESIZE_32_BIT, | ||
77 | STEDMA40_DOUBLEWORD_WIDTH = STEDMA40_ESIZE_64_BIT | ||
78 | }; | ||
79 | |||
80 | enum stedma40_xfer_dir { | ||
81 | STEDMA40_MEM_TO_MEM = 1, | ||
82 | STEDMA40_MEM_TO_PERIPH, | ||
83 | STEDMA40_PERIPH_TO_MEM, | ||
84 | STEDMA40_PERIPH_TO_PERIPH | ||
85 | }; | ||
86 | |||
87 | |||
88 | /** | 73 | /** |
89 | * struct stedma40_chan_cfg - dst/src channel configuration | 74 | * struct stedma40_half_channel_info - dst/src channel configuration |
90 | * | 75 | * |
91 | * @big_endian: true if the src/dst should be read as big endian | 76 | * @big_endian: true if the src/dst should be read as big endian |
92 | * @data_width: Data width of the src/dst hardware | 77 | * @data_width: Data width of the src/dst hardware |
@@ -95,7 +80,7 @@ enum stedma40_xfer_dir { | |||
95 | */ | 80 | */ |
96 | struct stedma40_half_channel_info { | 81 | struct stedma40_half_channel_info { |
97 | bool big_endian; | 82 | bool big_endian; |
98 | enum stedma40_periph_data_width data_width; | 83 | enum dma_slave_buswidth data_width; |
99 | int psize; | 84 | int psize; |
100 | enum stedma40_flow_ctrl flow_ctrl; | 85 | enum stedma40_flow_ctrl flow_ctrl; |
101 | }; | 86 | }; |
@@ -109,8 +94,7 @@ struct stedma40_half_channel_info { | |||
109 | * version 3+, i.e DB8500v2+ | 94 | * version 3+, i.e DB8500v2+ |
110 | * @mode: channel mode: physical, logical, or operation | 95 | * @mode: channel mode: physical, logical, or operation |
111 | * @mode_opt: options for the chosen channel mode | 96 | * @mode_opt: options for the chosen channel mode |
112 | * @src_dev_type: Src device type | 97 | * @dev_type: src/dst device type (driver uses dir to figure out which) |
113 | * @dst_dev_type: Dst device type | ||
114 | * @src_info: Parameters for dst half channel | 98 | * @src_info: Parameters for dst half channel |
115 | * @dst_info: Parameters for dst half channel | 99 | * @dst_info: Parameters for dst half channel |
116 | * @use_fixed_channel: if true, use physical channel specified by phy_channel | 100 | * @use_fixed_channel: if true, use physical channel specified by phy_channel |
@@ -121,13 +105,12 @@ struct stedma40_half_channel_info { | |||
121 | * | 105 | * |
122 | */ | 106 | */ |
123 | struct stedma40_chan_cfg { | 107 | struct stedma40_chan_cfg { |
124 | enum stedma40_xfer_dir dir; | 108 | enum dma_transfer_direction dir; |
125 | bool high_priority; | 109 | bool high_priority; |
126 | bool realtime; | 110 | bool realtime; |
127 | enum stedma40_mode mode; | 111 | enum stedma40_mode mode; |
128 | enum stedma40_mode_opt mode_opt; | 112 | enum stedma40_mode_opt mode_opt; |
129 | int src_dev_type; | 113 | int dev_type; |
130 | int dst_dev_type; | ||
131 | struct stedma40_half_channel_info src_info; | 114 | struct stedma40_half_channel_info src_info; |
132 | struct stedma40_half_channel_info dst_info; | 115 | struct stedma40_half_channel_info dst_info; |
133 | 116 | ||
@@ -138,13 +121,8 @@ struct stedma40_chan_cfg { | |||
138 | /** | 121 | /** |
139 | * struct stedma40_platform_data - Configuration struct for the dma device. | 122 | * struct stedma40_platform_data - Configuration struct for the dma device. |
140 | * | 123 | * |
141 | * @dev_len: length of dev_tx and dev_rx | ||
142 | * @dev_tx: mapping between destination event line and io address | 124 | * @dev_tx: mapping between destination event line and io address |
143 | * @dev_rx: mapping between source event line and io address | 125 | * @dev_rx: mapping between source event line and io address |
144 | * @memcpy: list of memcpy event lines | ||
145 | * @memcpy_len: length of memcpy | ||
146 | * @memcpy_conf_phy: default configuration of physical channel memcpy | ||
147 | * @memcpy_conf_log: default configuration of logical channel memcpy | ||
148 | * @disabled_channels: A vector, ending with -1, that marks physical channels | 126 | * @disabled_channels: A vector, ending with -1, that marks physical channels |
149 | * that are for different reasons not available for the driver. | 127 | * 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 | 128 | * @soft_lli_chans: A vector, that marks physical channels will use LLI by SW |
@@ -154,22 +132,17 @@ struct stedma40_chan_cfg { | |||
154 | * @num_of_soft_lli_chans: The number of channels that needs to be configured | 132 | * @num_of_soft_lli_chans: The number of channels that needs to be configured |
155 | * to use SoftLLI. | 133 | * to use SoftLLI. |
156 | * @use_esram_lcla: flag for mapping the lcla into esram region | 134 | * @use_esram_lcla: flag for mapping the lcla into esram region |
135 | * @num_of_memcpy_chans: The number of channels reserved for memcpy. | ||
157 | * @num_of_phy_chans: The number of physical channels implemented in HW. | 136 | * @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 | 137 | * 0 means reading the number of channels from DMA HW but this is only valid |
159 | * for 'multiple of 4' channels, like 8. | 138 | * for 'multiple of 4' channels, like 8. |
160 | */ | 139 | */ |
161 | struct stedma40_platform_data { | 140 | struct stedma40_platform_data { |
162 | u32 dev_len; | ||
163 | const dma_addr_t *dev_tx; | ||
164 | const dma_addr_t *dev_rx; | ||
165 | int *memcpy; | ||
166 | u32 memcpy_len; | ||
167 | struct stedma40_chan_cfg *memcpy_conf_phy; | ||
168 | struct stedma40_chan_cfg *memcpy_conf_log; | ||
169 | int disabled_channels[STEDMA40_MAX_PHYS]; | 141 | int disabled_channels[STEDMA40_MAX_PHYS]; |
170 | int *soft_lli_chans; | 142 | int *soft_lli_chans; |
171 | int num_of_soft_lli_chans; | 143 | int num_of_soft_lli_chans; |
172 | bool use_esram_lcla; | 144 | bool use_esram_lcla; |
145 | int num_of_memcpy_chans; | ||
173 | int num_of_phy_chans; | 146 | int num_of_phy_chans; |
174 | }; | 147 | }; |
175 | 148 | ||
diff --git a/include/linux/platform_data/edma.h b/include/linux/platform_data/edma.h new file mode 100644 index 000000000000..57300fd7cc03 --- /dev/null +++ b/include/linux/platform_data/edma.h | |||
@@ -0,0 +1,183 @@ | |||
1 | /* | ||
2 | * TI EDMA definitions | ||
3 | * | ||
4 | * Copyright (C) 2006-2013 Texas Instruments. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the | ||
8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
9 | * option) any later version. | ||
10 | */ | ||
11 | |||
12 | /* | ||
13 | * This EDMA3 programming framework exposes two basic kinds of resource: | ||
14 | * | ||
15 | * Channel Triggers transfers, usually from a hardware event but | ||
16 | * also manually or by "chaining" from DMA completions. | ||
17 | * Each channel is coupled to a Parameter RAM (PaRAM) slot. | ||
18 | * | ||
19 | * Slot Each PaRAM slot holds a DMA transfer descriptor (PaRAM | ||
20 | * "set"), source and destination addresses, a link to a | ||
21 | * next PaRAM slot (if any), options for the transfer, and | ||
22 | * instructions for updating those addresses. There are | ||
23 | * more than twice as many slots as event channels. | ||
24 | * | ||
25 | * Each PaRAM set describes a sequence of transfers, either for one large | ||
26 | * buffer or for several discontiguous smaller buffers. An EDMA transfer | ||
27 | * is driven only from a channel, which performs the transfers specified | ||
28 | * in its PaRAM slot until there are no more transfers. When that last | ||
29 | * transfer completes, the "link" field may be used to reload the channel's | ||
30 | * PaRAM slot with a new transfer descriptor. | ||
31 | * | ||
32 | * The EDMA Channel Controller (CC) maps requests from channels into physical | ||
33 | * Transfer Controller (TC) requests when the channel triggers (by hardware | ||
34 | * or software events, or by chaining). The two physical DMA channels provided | ||
35 | * by the TCs are thus shared by many logical channels. | ||
36 | * | ||
37 | * DaVinci hardware also has a "QDMA" mechanism which is not currently | ||
38 | * supported through this interface. (DSP firmware uses it though.) | ||
39 | */ | ||
40 | |||
41 | #ifndef EDMA_H_ | ||
42 | #define EDMA_H_ | ||
43 | |||
44 | /* PaRAM slots are laid out like this */ | ||
45 | struct edmacc_param { | ||
46 | unsigned int opt; | ||
47 | unsigned int src; | ||
48 | unsigned int a_b_cnt; | ||
49 | unsigned int dst; | ||
50 | unsigned int src_dst_bidx; | ||
51 | unsigned int link_bcntrld; | ||
52 | unsigned int src_dst_cidx; | ||
53 | unsigned int ccnt; | ||
54 | }; | ||
55 | |||
56 | /* fields in edmacc_param.opt */ | ||
57 | #define SAM BIT(0) | ||
58 | #define DAM BIT(1) | ||
59 | #define SYNCDIM BIT(2) | ||
60 | #define STATIC BIT(3) | ||
61 | #define EDMA_FWID (0x07 << 8) | ||
62 | #define TCCMODE BIT(11) | ||
63 | #define EDMA_TCC(t) ((t) << 12) | ||
64 | #define TCINTEN BIT(20) | ||
65 | #define ITCINTEN BIT(21) | ||
66 | #define TCCHEN BIT(22) | ||
67 | #define ITCCHEN BIT(23) | ||
68 | |||
69 | /*ch_status paramater of callback function possible values*/ | ||
70 | #define DMA_COMPLETE 1 | ||
71 | #define DMA_CC_ERROR 2 | ||
72 | #define DMA_TC1_ERROR 3 | ||
73 | #define DMA_TC2_ERROR 4 | ||
74 | |||
75 | enum address_mode { | ||
76 | INCR = 0, | ||
77 | FIFO = 1 | ||
78 | }; | ||
79 | |||
80 | enum fifo_width { | ||
81 | W8BIT = 0, | ||
82 | W16BIT = 1, | ||
83 | W32BIT = 2, | ||
84 | W64BIT = 3, | ||
85 | W128BIT = 4, | ||
86 | W256BIT = 5 | ||
87 | }; | ||
88 | |||
89 | enum dma_event_q { | ||
90 | EVENTQ_0 = 0, | ||
91 | EVENTQ_1 = 1, | ||
92 | EVENTQ_2 = 2, | ||
93 | EVENTQ_3 = 3, | ||
94 | EVENTQ_DEFAULT = -1 | ||
95 | }; | ||
96 | |||
97 | enum sync_dimension { | ||
98 | ASYNC = 0, | ||
99 | ABSYNC = 1 | ||
100 | }; | ||
101 | |||
102 | #define EDMA_CTLR_CHAN(ctlr, chan) (((ctlr) << 16) | (chan)) | ||
103 | #define EDMA_CTLR(i) ((i) >> 16) | ||
104 | #define EDMA_CHAN_SLOT(i) ((i) & 0xffff) | ||
105 | |||
106 | #define EDMA_CHANNEL_ANY -1 /* for edma_alloc_channel() */ | ||
107 | #define EDMA_SLOT_ANY -1 /* for edma_alloc_slot() */ | ||
108 | #define EDMA_CONT_PARAMS_ANY 1001 | ||
109 | #define EDMA_CONT_PARAMS_FIXED_EXACT 1002 | ||
110 | #define EDMA_CONT_PARAMS_FIXED_NOT_EXACT 1003 | ||
111 | |||
112 | #define EDMA_MAX_CC 2 | ||
113 | |||
114 | /* alloc/free DMA channels and their dedicated parameter RAM slots */ | ||
115 | int edma_alloc_channel(int channel, | ||
116 | void (*callback)(unsigned channel, u16 ch_status, void *data), | ||
117 | void *data, enum dma_event_q); | ||
118 | void edma_free_channel(unsigned channel); | ||
119 | |||
120 | /* alloc/free parameter RAM slots */ | ||
121 | int edma_alloc_slot(unsigned ctlr, int slot); | ||
122 | void edma_free_slot(unsigned slot); | ||
123 | |||
124 | /* alloc/free a set of contiguous parameter RAM slots */ | ||
125 | int edma_alloc_cont_slots(unsigned ctlr, unsigned int id, int slot, int count); | ||
126 | int edma_free_cont_slots(unsigned slot, int count); | ||
127 | |||
128 | /* calls that operate on part of a parameter RAM slot */ | ||
129 | void edma_set_src(unsigned slot, dma_addr_t src_port, | ||
130 | enum address_mode mode, enum fifo_width); | ||
131 | void edma_set_dest(unsigned slot, dma_addr_t dest_port, | ||
132 | enum address_mode mode, enum fifo_width); | ||
133 | void edma_get_position(unsigned slot, dma_addr_t *src, dma_addr_t *dst); | ||
134 | void edma_set_src_index(unsigned slot, s16 src_bidx, s16 src_cidx); | ||
135 | void edma_set_dest_index(unsigned slot, s16 dest_bidx, s16 dest_cidx); | ||
136 | void edma_set_transfer_params(unsigned slot, u16 acnt, u16 bcnt, u16 ccnt, | ||
137 | u16 bcnt_rld, enum sync_dimension sync_mode); | ||
138 | void edma_link(unsigned from, unsigned to); | ||
139 | void edma_unlink(unsigned from); | ||
140 | |||
141 | /* calls that operate on an entire parameter RAM slot */ | ||
142 | void edma_write_slot(unsigned slot, const struct edmacc_param *params); | ||
143 | void edma_read_slot(unsigned slot, struct edmacc_param *params); | ||
144 | |||
145 | /* channel control operations */ | ||
146 | int edma_start(unsigned channel); | ||
147 | void edma_stop(unsigned channel); | ||
148 | void edma_clean_channel(unsigned channel); | ||
149 | void edma_clear_event(unsigned channel); | ||
150 | void edma_pause(unsigned channel); | ||
151 | void edma_resume(unsigned channel); | ||
152 | |||
153 | struct edma_rsv_info { | ||
154 | |||
155 | const s16 (*rsv_chans)[2]; | ||
156 | const s16 (*rsv_slots)[2]; | ||
157 | }; | ||
158 | |||
159 | /* platform_data for EDMA driver */ | ||
160 | struct edma_soc_info { | ||
161 | |||
162 | /* how many dma resources of each type */ | ||
163 | unsigned n_channel; | ||
164 | unsigned n_region; | ||
165 | unsigned n_slot; | ||
166 | unsigned n_tc; | ||
167 | unsigned n_cc; | ||
168 | /* | ||
169 | * Default queue is expected to be a low-priority queue. | ||
170 | * This way, long transfers on the default queue started | ||
171 | * by the codec engine will not cause audio defects. | ||
172 | */ | ||
173 | enum dma_event_q default_queue; | ||
174 | |||
175 | /* Resource reservation for other cores */ | ||
176 | struct edma_rsv_info *rsv; | ||
177 | |||
178 | s8 (*queue_tc_mapping)[2]; | ||
179 | s8 (*queue_priority_mapping)[2]; | ||
180 | const s16 (*xbar_chans)[2]; | ||
181 | }; | ||
182 | |||
183 | #endif | ||
diff --git a/include/linux/clk/mvebu.h b/include/linux/platform_data/g762.h index 8c4ae713b063..d3c51283764d 100644 --- a/include/linux/clk/mvebu.h +++ b/include/linux/platform_data/g762.h | |||
@@ -1,4 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * Platform data structure for g762 fan controller driver | ||
3 | * | ||
4 | * Copyright (C) 2013, Arnaud EBALARD <arno@natisbad.org> | ||
5 | * | ||
2 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
3 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
4 | * the Free Software Foundation; either version 2 of the License, or | 8 | * the Free Software Foundation; either version 2 of the License, or |
@@ -13,10 +17,21 @@ | |||
13 | * along with this program; if not, write to the Free Software | 17 | * along with this program; if not, write to the Free Software |
14 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
15 | */ | 19 | */ |
20 | #ifndef __LINUX_PLATFORM_DATA_G762_H__ | ||
21 | #define __LINUX_PLATFORM_DATA_G762_H__ | ||
16 | 22 | ||
17 | #ifndef __CLK_MVEBU_H_ | 23 | /* |
18 | #define __CLK_MVEBU_H_ | 24 | * Following structure can be used to set g762 driver platform specific data |
25 | * during board init. Note that passing a sparse structure is possible but | ||
26 | * will result in non-specified attributes to be set to default value, hence | ||
27 | * overloading those installed during boot (e.g. by u-boot). | ||
28 | */ | ||
19 | 29 | ||
20 | void __init mvebu_clocks_init(void); | 30 | struct g762_platform_data { |
31 | u32 fan_startv; | ||
32 | u32 fan_gear_mode; | ||
33 | u32 pwm_polarity; | ||
34 | u32 clk_freq; | ||
35 | }; | ||
21 | 36 | ||
22 | #endif | 37 | #endif /* __LINUX_PLATFORM_DATA_G762_H__ */ |
diff --git a/include/linux/platform_data/gpio-rcar.h b/include/linux/platform_data/gpio-rcar.h index b253f77a7ddf..2d8d69432813 100644 --- a/include/linux/platform_data/gpio-rcar.h +++ b/include/linux/platform_data/gpio-rcar.h | |||
@@ -17,10 +17,13 @@ | |||
17 | #define __GPIO_RCAR_H__ | 17 | #define __GPIO_RCAR_H__ |
18 | 18 | ||
19 | struct gpio_rcar_config { | 19 | struct gpio_rcar_config { |
20 | unsigned int gpio_base; | 20 | int gpio_base; |
21 | unsigned int irq_base; | 21 | unsigned int irq_base; |
22 | unsigned int number_of_pins; | 22 | unsigned int number_of_pins; |
23 | const char *pctl_name; | 23 | const char *pctl_name; |
24 | unsigned has_both_edge_trigger:1; | ||
24 | }; | 25 | }; |
25 | 26 | ||
27 | #define RCAR_GP_PIN(bank, pin) (((bank) * 32) + (pin)) | ||
28 | |||
26 | #endif /* __GPIO_RCAR_H__ */ | 29 | #endif /* __GPIO_RCAR_H__ */ |
diff --git a/include/linux/platform_data/keypad-pxa27x.h b/include/linux/platform_data/keypad-pxa27x.h index 5ce8d5e6ea51..24625569d16d 100644 --- a/include/linux/platform_data/keypad-pxa27x.h +++ b/include/linux/platform_data/keypad-pxa27x.h | |||
@@ -36,10 +36,9 @@ | |||
36 | struct pxa27x_keypad_platform_data { | 36 | struct pxa27x_keypad_platform_data { |
37 | 37 | ||
38 | /* code map for the matrix keys */ | 38 | /* code map for the matrix keys */ |
39 | const struct matrix_keymap_data *matrix_keymap_data; | ||
39 | unsigned int matrix_key_rows; | 40 | unsigned int matrix_key_rows; |
40 | unsigned int matrix_key_cols; | 41 | unsigned int matrix_key_cols; |
41 | unsigned int *matrix_key_map; | ||
42 | int matrix_key_map_size; | ||
43 | 42 | ||
44 | /* direct keys */ | 43 | /* direct keys */ |
45 | int direct_key_num; | 44 | int direct_key_num; |
diff --git a/include/linux/platform_data/mailbox-omap.h b/include/linux/platform_data/mailbox-omap.h new file mode 100644 index 000000000000..4631dbb4255e --- /dev/null +++ b/include/linux/platform_data/mailbox-omap.h | |||
@@ -0,0 +1,58 @@ | |||
1 | /* | ||
2 | * mailbox-omap.h | ||
3 | * | ||
4 | * Copyright (C) 2013 Texas Instruments, Inc. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * version 2 as published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | */ | ||
15 | |||
16 | #ifndef _PLAT_MAILBOX_H | ||
17 | #define _PLAT_MAILBOX_H | ||
18 | |||
19 | /* Interrupt register configuration types */ | ||
20 | #define MBOX_INTR_CFG_TYPE1 (0) | ||
21 | #define MBOX_INTR_CFG_TYPE2 (1) | ||
22 | |||
23 | /** | ||
24 | * struct omap_mbox_dev_info - OMAP mailbox device attribute info | ||
25 | * @name: name of the mailbox device | ||
26 | * @tx_id: mailbox queue id used for transmitting messages | ||
27 | * @rx_id: mailbox queue id on which messages are received | ||
28 | * @irq_id: irq identifier number to use from the hwmod data | ||
29 | * @usr_id: mailbox user id for identifying the interrupt into | ||
30 | * the MPU interrupt controller. | ||
31 | */ | ||
32 | struct omap_mbox_dev_info { | ||
33 | const char *name; | ||
34 | u32 tx_id; | ||
35 | u32 rx_id; | ||
36 | u32 irq_id; | ||
37 | u32 usr_id; | ||
38 | }; | ||
39 | |||
40 | /** | ||
41 | * struct omap_mbox_pdata - OMAP mailbox platform data | ||
42 | * @intr_type: type of interrupt configuration registers used | ||
43 | while programming mailbox queue interrupts | ||
44 | * @num_users: number of users (processor devices) that the mailbox | ||
45 | * h/w block can interrupt | ||
46 | * @num_fifos: number of h/w fifos within the mailbox h/w block | ||
47 | * @info_cnt: number of mailbox devices for the platform | ||
48 | * @info: array of mailbox device attributes | ||
49 | */ | ||
50 | struct omap_mbox_pdata { | ||
51 | u32 intr_type; | ||
52 | u32 num_users; | ||
53 | u32 num_fifos; | ||
54 | u32 info_cnt; | ||
55 | struct omap_mbox_dev_info *info; | ||
56 | }; | ||
57 | |||
58 | #endif /* _PLAT_MAILBOX_H */ | ||
diff --git a/include/linux/platform_data/mmc-esdhc-imx.h b/include/linux/platform_data/mmc-esdhc-imx.h index b4a0521ce411..d44912d81578 100644 --- a/include/linux/platform_data/mmc-esdhc-imx.h +++ b/include/linux/platform_data/mmc-esdhc-imx.h | |||
@@ -40,5 +40,6 @@ struct esdhc_platform_data { | |||
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 | int max_bus_width; |
43 | unsigned int f_max; | ||
43 | }; | 44 | }; |
44 | #endif /* __ASM_ARCH_IMX_ESDHC_H */ | 45 | #endif /* __ASM_ARCH_IMX_ESDHC_H */ |
diff --git a/include/linux/platform_data/mmc-pxamci.h b/include/linux/platform_data/mmc-pxamci.h index 9eb515bb799d..1706b3597ce0 100644 --- a/include/linux/platform_data/mmc-pxamci.h +++ b/include/linux/platform_data/mmc-pxamci.h | |||
@@ -12,7 +12,7 @@ struct pxamci_platform_data { | |||
12 | unsigned long detect_delay_ms; /* delay in millisecond before detecting cards after interrupt */ | 12 | unsigned long detect_delay_ms; /* delay in millisecond before detecting cards after interrupt */ |
13 | int (*init)(struct device *, irq_handler_t , void *); | 13 | int (*init)(struct device *, irq_handler_t , void *); |
14 | int (*get_ro)(struct device *); | 14 | int (*get_ro)(struct device *); |
15 | void (*setpower)(struct device *, unsigned int); | 15 | int (*setpower)(struct device *, unsigned int); |
16 | void (*exit)(struct device *, void *); | 16 | void (*exit)(struct device *, void *); |
17 | int gpio_card_detect; /* gpio detecting card insertion */ | 17 | int gpio_card_detect; /* gpio detecting card insertion */ |
18 | int gpio_card_ro; /* gpio detecting read only toggle */ | 18 | int gpio_card_ro; /* gpio detecting read only toggle */ |
diff --git a/include/linux/platform_data/net-cw1200.h b/include/linux/platform_data/net-cw1200.h new file mode 100644 index 000000000000..c6fbc3ce4ab0 --- /dev/null +++ b/include/linux/platform_data/net-cw1200.h | |||
@@ -0,0 +1,81 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2011 | ||
3 | * | ||
4 | * Author: Dmitry Tarnyagin <dmitry.tarnyagin@stericsson.com> | ||
5 | * License terms: GNU General Public License (GPL) version 2 | ||
6 | */ | ||
7 | |||
8 | #ifndef CW1200_PLAT_H_INCLUDED | ||
9 | #define CW1200_PLAT_H_INCLUDED | ||
10 | |||
11 | struct cw1200_platform_data_spi { | ||
12 | u8 spi_bits_per_word; /* REQUIRED */ | ||
13 | u16 ref_clk; /* REQUIRED (in KHz) */ | ||
14 | |||
15 | /* All others are optional */ | ||
16 | bool have_5ghz; | ||
17 | int reset; /* GPIO to RSTn signal (0 disables) */ | ||
18 | int powerup; /* GPIO to POWERUP signal (0 disables) */ | ||
19 | int (*power_ctrl)(const struct cw1200_platform_data_spi *pdata, | ||
20 | bool enable); /* Control 3v3 / 1v8 supply */ | ||
21 | int (*clk_ctrl)(const struct cw1200_platform_data_spi *pdata, | ||
22 | bool enable); /* Control CLK32K */ | ||
23 | const u8 *macaddr; /* if NULL, use cw1200_mac_template module parameter */ | ||
24 | const char *sdd_file; /* if NULL, will use default for detected hw type */ | ||
25 | }; | ||
26 | |||
27 | struct cw1200_platform_data_sdio { | ||
28 | u16 ref_clk; /* REQUIRED (in KHz) */ | ||
29 | |||
30 | /* All others are optional */ | ||
31 | bool have_5ghz; | ||
32 | bool no_nptb; /* SDIO hardware does not support non-power-of-2-blocksizes */ | ||
33 | int reset; /* GPIO to RSTn signal (0 disables) */ | ||
34 | int powerup; /* GPIO to POWERUP signal (0 disables) */ | ||
35 | int irq; /* IRQ line or 0 to use SDIO IRQ */ | ||
36 | int (*power_ctrl)(const struct cw1200_platform_data_sdio *pdata, | ||
37 | bool enable); /* Control 3v3 / 1v8 supply */ | ||
38 | int (*clk_ctrl)(const struct cw1200_platform_data_sdio *pdata, | ||
39 | bool enable); /* Control CLK32K */ | ||
40 | const u8 *macaddr; /* if NULL, use cw1200_mac_template module parameter */ | ||
41 | const char *sdd_file; /* if NULL, will use default for detected hw type */ | ||
42 | }; | ||
43 | |||
44 | |||
45 | /* An example of SPI support in your board setup file: | ||
46 | |||
47 | static struct cw1200_platform_data_spi cw1200_platform_data = { | ||
48 | .ref_clk = 38400, | ||
49 | .spi_bits_per_word = 16, | ||
50 | .reset = GPIO_RF_RESET, | ||
51 | .powerup = GPIO_RF_POWERUP, | ||
52 | .macaddr = wifi_mac_addr, | ||
53 | .sdd_file = "sdd_sagrad_1091_1098.bin", | ||
54 | }; | ||
55 | static struct spi_board_info myboard_spi_devices[] __initdata = { | ||
56 | { | ||
57 | .modalias = "cw1200_wlan_spi", | ||
58 | .max_speed_hz = 52000000, | ||
59 | .bus_num = 0, | ||
60 | .irq = WIFI_IRQ, | ||
61 | .platform_data = &cw1200_platform_data, | ||
62 | .chip_select = 0, | ||
63 | }, | ||
64 | }; | ||
65 | |||
66 | */ | ||
67 | |||
68 | /* An example of SDIO support in your board setup file: | ||
69 | |||
70 | static struct cw1200_platform_data_sdio my_cw1200_platform_data = { | ||
71 | .ref_clk = 38400, | ||
72 | .have_5ghz = false, | ||
73 | .sdd_file = "sdd_myplatform.bin", | ||
74 | }; | ||
75 | cw1200_sdio_set_platform_data(&my_cw1200_platform_data); | ||
76 | |||
77 | */ | ||
78 | |||
79 | void __init cw1200_sdio_set_platform_data(struct cw1200_platform_data_sdio *pdata); | ||
80 | |||
81 | #endif /* CW1200_PLAT_H_INCLUDED */ | ||
diff --git a/include/linux/platform_data/omap_ocp2scp.h b/include/linux/platform_data/omap_ocp2scp.h deleted file mode 100644 index 5c6c3939355f..000000000000 --- a/include/linux/platform_data/omap_ocp2scp.h +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | /* | ||
2 | * omap_ocp2scp.h -- ocp2scp header file | ||
3 | * | ||
4 | * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com | ||
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; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * Author: Kishon Vijay Abraham I <kishon@ti.com> | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | */ | ||
18 | |||
19 | #ifndef __DRIVERS_OMAP_OCP2SCP_H | ||
20 | #define __DRIVERS_OMAP_OCP2SCP_H | ||
21 | |||
22 | struct omap_ocp2scp_dev { | ||
23 | const char *drv_name; | ||
24 | struct resource *res; | ||
25 | }; | ||
26 | |||
27 | struct omap_ocp2scp_platform_data { | ||
28 | int dev_cnt; | ||
29 | struct omap_ocp2scp_dev **devices; | ||
30 | }; | ||
31 | #endif /* __DRIVERS_OMAP_OCP2SCP_H */ | ||
diff --git a/include/linux/platform_data/pinctrl-coh901.h b/include/linux/platform_data/pinctrl-coh901.h deleted file mode 100644 index dfbc65d10484..000000000000 --- a/include/linux/platform_data/pinctrl-coh901.h +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2012 ST-Ericsson AB | ||
3 | * License terms: GNU General Public License (GPL) version 2 | ||
4 | * GPIO block resgister definitions and inline macros for | ||
5 | * U300 GPIO COH 901 335 or COH 901 571/3 | ||
6 | * Author: Linus Walleij <linus.walleij@stericsson.com> | ||
7 | */ | ||
8 | |||
9 | #ifndef __MACH_U300_GPIO_U300_H | ||
10 | #define __MACH_U300_GPIO_U300_H | ||
11 | |||
12 | /** | ||
13 | * struct u300_gpio_platform - U300 GPIO platform data | ||
14 | * @ports: number of GPIO block ports | ||
15 | * @gpio_base: first GPIO number for this block (use a free range) | ||
16 | */ | ||
17 | struct u300_gpio_platform { | ||
18 | u8 ports; | ||
19 | int gpio_base; | ||
20 | }; | ||
21 | |||
22 | #endif /* __MACH_U300_GPIO_U300_H */ | ||
diff --git a/include/linux/platform_data/pwm-renesas-tpu.h b/include/linux/platform_data/pwm-renesas-tpu.h new file mode 100644 index 000000000000..a7220b10ddab --- /dev/null +++ b/include/linux/platform_data/pwm-renesas-tpu.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef __PWM_RENESAS_TPU_H__ | ||
2 | #define __PWM_RENESAS_TPU_H__ | ||
3 | |||
4 | #include <linux/pwm.h> | ||
5 | |||
6 | #define TPU_CHANNEL_MAX 4 | ||
7 | |||
8 | struct tpu_pwm_channel_data { | ||
9 | enum pwm_polarity polarity; | ||
10 | }; | ||
11 | |||
12 | struct tpu_pwm_platform_data { | ||
13 | struct tpu_pwm_channel_data channels[TPU_CHANNEL_MAX]; | ||
14 | }; | ||
15 | |||
16 | #endif /* __PWM_RENESAS_TPU_H__ */ | ||
diff --git a/include/linux/platform_data/rcar-du.h b/include/linux/platform_data/rcar-du.h new file mode 100644 index 000000000000..80587fdbba3e --- /dev/null +++ b/include/linux/platform_data/rcar-du.h | |||
@@ -0,0 +1,54 @@ | |||
1 | /* | ||
2 | * rcar_du.h -- R-Car Display Unit DRM driver | ||
3 | * | ||
4 | * Copyright (C) 2013 Renesas Corporation | ||
5 | * | ||
6 | * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com) | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | */ | ||
13 | |||
14 | #ifndef __RCAR_DU_H__ | ||
15 | #define __RCAR_DU_H__ | ||
16 | |||
17 | #include <drm/drm_mode.h> | ||
18 | |||
19 | enum rcar_du_encoder_type { | ||
20 | RCAR_DU_ENCODER_UNUSED = 0, | ||
21 | RCAR_DU_ENCODER_VGA, | ||
22 | RCAR_DU_ENCODER_LVDS, | ||
23 | }; | ||
24 | |||
25 | struct rcar_du_panel_data { | ||
26 | unsigned int width_mm; /* Panel width in mm */ | ||
27 | unsigned int height_mm; /* Panel height in mm */ | ||
28 | struct drm_mode_modeinfo mode; | ||
29 | }; | ||
30 | |||
31 | struct rcar_du_encoder_lvds_data { | ||
32 | struct rcar_du_panel_data panel; | ||
33 | }; | ||
34 | |||
35 | struct rcar_du_encoder_vga_data { | ||
36 | /* TODO: Add DDC information for EDID retrieval */ | ||
37 | }; | ||
38 | |||
39 | struct rcar_du_encoder_data { | ||
40 | enum rcar_du_encoder_type encoder; | ||
41 | unsigned int output; | ||
42 | |||
43 | union { | ||
44 | struct rcar_du_encoder_lvds_data lvds; | ||
45 | struct rcar_du_encoder_vga_data vga; | ||
46 | } u; | ||
47 | }; | ||
48 | |||
49 | struct rcar_du_platform_data { | ||
50 | struct rcar_du_encoder_data *encoders; | ||
51 | unsigned int num_encoders; | ||
52 | }; | ||
53 | |||
54 | #endif /* __RCAR_DU_H__ */ | ||
diff --git a/include/linux/platform_data/remoteproc-omap.h b/include/linux/platform_data/remoteproc-omap.h index 3c1c6444ec4b..bfbd12b41162 100644 --- a/include/linux/platform_data/remoteproc-omap.h +++ b/include/linux/platform_data/remoteproc-omap.h | |||
@@ -50,7 +50,7 @@ void __init omap_rproc_reserve_cma(void); | |||
50 | 50 | ||
51 | #else | 51 | #else |
52 | 52 | ||
53 | void __init omap_rproc_reserve_cma(void) | 53 | static inline void __init omap_rproc_reserve_cma(void) |
54 | { | 54 | { |
55 | } | 55 | } |
56 | 56 | ||
diff --git a/include/linux/platform_data/si5351.h b/include/linux/platform_data/si5351.h index 92dabcaf6499..54334393ab92 100644 --- a/include/linux/platform_data/si5351.h +++ b/include/linux/platform_data/si5351.h | |||
@@ -79,6 +79,23 @@ enum si5351_drive_strength { | |||
79 | }; | 79 | }; |
80 | 80 | ||
81 | /** | 81 | /** |
82 | * enum si5351_disable_state - Si5351 clock output disable state | ||
83 | * @SI5351_DISABLE_DEFAULT: default, do not change eeprom config | ||
84 | * @SI5351_DISABLE_LOW: CLKx is set to a LOW state when disabled | ||
85 | * @SI5351_DISABLE_HIGH: CLKx is set to a HIGH state when disabled | ||
86 | * @SI5351_DISABLE_FLOATING: CLKx is set to a FLOATING state when | ||
87 | * disabled | ||
88 | * @SI5351_DISABLE_NEVER: CLKx is NEVER disabled | ||
89 | */ | ||
90 | enum si5351_disable_state { | ||
91 | SI5351_DISABLE_DEFAULT = 0, | ||
92 | SI5351_DISABLE_LOW, | ||
93 | SI5351_DISABLE_HIGH, | ||
94 | SI5351_DISABLE_FLOATING, | ||
95 | SI5351_DISABLE_NEVER, | ||
96 | }; | ||
97 | |||
98 | /** | ||
82 | * struct si5351_clkout_config - Si5351 clock output configuration | 99 | * struct si5351_clkout_config - Si5351 clock output configuration |
83 | * @clkout: clkout number | 100 | * @clkout: clkout number |
84 | * @multisynth_src: multisynth source clock | 101 | * @multisynth_src: multisynth source clock |
@@ -91,6 +108,7 @@ struct si5351_clkout_config { | |||
91 | enum si5351_multisynth_src multisynth_src; | 108 | enum si5351_multisynth_src multisynth_src; |
92 | enum si5351_clkout_src clkout_src; | 109 | enum si5351_clkout_src clkout_src; |
93 | enum si5351_drive_strength drive; | 110 | enum si5351_drive_strength drive; |
111 | enum si5351_disable_state disable_state; | ||
94 | bool pll_master; | 112 | bool pll_master; |
95 | unsigned long rate; | 113 | unsigned long rate; |
96 | }; | 114 | }; |
diff --git a/include/linux/platform_data/spi-davinci.h b/include/linux/platform_data/spi-davinci.h index 7af305b37868..8dc2fa47a2aa 100644 --- a/include/linux/platform_data/spi-davinci.h +++ b/include/linux/platform_data/spi-davinci.h | |||
@@ -19,7 +19,7 @@ | |||
19 | #ifndef __ARCH_ARM_DAVINCI_SPI_H | 19 | #ifndef __ARCH_ARM_DAVINCI_SPI_H |
20 | #define __ARCH_ARM_DAVINCI_SPI_H | 20 | #define __ARCH_ARM_DAVINCI_SPI_H |
21 | 21 | ||
22 | #include <mach/edma.h> | 22 | #include <linux/platform_data/edma.h> |
23 | 23 | ||
24 | #define SPI_INTERN_CS 0xFF | 24 | #define SPI_INTERN_CS 0xFF |
25 | 25 | ||
diff --git a/include/linux/platform_data/ssm2518.h b/include/linux/platform_data/ssm2518.h new file mode 100644 index 000000000000..9a8e3ea287e3 --- /dev/null +++ b/include/linux/platform_data/ssm2518.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * SSM2518 amplifier audio driver | ||
3 | * | ||
4 | * Copyright 2013 Analog Devices Inc. | ||
5 | * Author: Lars-Peter Clausen <lars@metafoo.de> | ||
6 | * | ||
7 | * Licensed under the GPL-2. | ||
8 | */ | ||
9 | |||
10 | #ifndef __LINUX_PLATFORM_DATA_SSM2518_H__ | ||
11 | #define __LINUX_PLATFORM_DATA_SSM2518_H__ | ||
12 | |||
13 | /** | ||
14 | * struct ssm2518_platform_data - Platform data for the ssm2518 driver | ||
15 | * @enable_gpio: GPIO connected to the nSD pin. Set to -1 if the nSD pin is | ||
16 | * hardwired. | ||
17 | */ | ||
18 | struct ssm2518_platform_data { | ||
19 | int enable_gpio; | ||
20 | }; | ||
21 | |||
22 | #endif | ||
diff --git a/include/linux/platform_data/ti_am335x_adc.h b/include/linux/platform_data/ti_am335x_adc.h deleted file mode 100644 index e41d5834cb84..000000000000 --- a/include/linux/platform_data/ti_am335x_adc.h +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | #ifndef __LINUX_TI_AM335X_ADC_H | ||
2 | #define __LINUX_TI_AM335X_ADC_H | ||
3 | |||
4 | /** | ||
5 | * struct adc_data ADC Input information | ||
6 | * @adc_channels: Number of analog inputs | ||
7 | * available for ADC. | ||
8 | */ | ||
9 | |||
10 | struct adc_data { | ||
11 | unsigned int adc_channels; | ||
12 | }; | ||
13 | |||
14 | #endif | ||
diff --git a/include/linux/platform_data/usb-musb-ux500.h b/include/linux/platform_data/usb-musb-ux500.h index 4c1cc50a595a..dd9c83ac7de0 100644 --- a/include/linux/platform_data/usb-musb-ux500.h +++ b/include/linux/platform_data/usb-musb-ux500.h | |||
@@ -9,14 +9,11 @@ | |||
9 | 9 | ||
10 | #include <linux/dmaengine.h> | 10 | #include <linux/dmaengine.h> |
11 | 11 | ||
12 | #define UX500_MUSB_DMA_NUM_RX_CHANNELS 8 | 12 | #define UX500_MUSB_DMA_NUM_RX_TX_CHANNELS 8 |
13 | #define UX500_MUSB_DMA_NUM_TX_CHANNELS 8 | ||
14 | 13 | ||
15 | struct ux500_musb_board_data { | 14 | struct ux500_musb_board_data { |
16 | void **dma_rx_param_array; | 15 | void **dma_rx_param_array; |
17 | void **dma_tx_param_array; | 16 | void **dma_tx_param_array; |
18 | u32 num_rx_channels; | ||
19 | u32 num_tx_channels; | ||
20 | bool (*dma_filter)(struct dma_chan *chan, void *filter_param); | 17 | bool (*dma_filter)(struct dma_chan *chan, void *filter_param); |
21 | }; | 18 | }; |
22 | 19 | ||
diff --git a/include/linux/platform_data/usb-rcar-phy.h b/include/linux/platform_data/usb-rcar-phy.h new file mode 100644 index 000000000000..8ec6964a32a5 --- /dev/null +++ b/include/linux/platform_data/usb-rcar-phy.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2013 Renesas Solutions Corp. | ||
3 | * Copyright (C) 2013 Cogent Embedded, Inc. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | |||
10 | #ifndef __USB_RCAR_PHY_H | ||
11 | #define __USB_RCAR_PHY_H | ||
12 | |||
13 | #include <linux/types.h> | ||
14 | |||
15 | struct rcar_phy_platform_data { | ||
16 | bool ferrite_bead:1; /* (R8A7778 only) */ | ||
17 | |||
18 | bool port1_func:1; /* true: port 1 used by function, false: host */ | ||
19 | unsigned penc1:1; /* Output of the PENC1 pin in function mode */ | ||
20 | struct { /* Overcurrent pin control for ports 0..2 */ | ||
21 | bool select_3_3v:1; /* true: USB_OVCn pin, false: OVCn pin */ | ||
22 | /* Set to false on port 1 in function mode */ | ||
23 | bool active_high:1; /* true: active high, false: active low */ | ||
24 | /* Set to true on port 1 in function mode */ | ||
25 | } ovc_pin[3]; /* (R8A7778 only has 2 ports) */ | ||
26 | }; | ||
27 | |||
28 | #endif /* __USB_RCAR_PHY_H */ | ||
diff --git a/include/linux/platform_data/usb3503.h b/include/linux/platform_data/usb3503.h index 85dcc709f7e9..1d1b6ef871f6 100644 --- a/include/linux/platform_data/usb3503.h +++ b/include/linux/platform_data/usb3503.h | |||
@@ -3,6 +3,10 @@ | |||
3 | 3 | ||
4 | #define USB3503_I2C_NAME "usb3503" | 4 | #define USB3503_I2C_NAME "usb3503" |
5 | 5 | ||
6 | #define USB3503_OFF_PORT1 (1 << 1) | ||
7 | #define USB3503_OFF_PORT2 (1 << 2) | ||
8 | #define USB3503_OFF_PORT3 (1 << 3) | ||
9 | |||
6 | enum usb3503_mode { | 10 | enum usb3503_mode { |
7 | USB3503_MODE_UNKNOWN, | 11 | USB3503_MODE_UNKNOWN, |
8 | USB3503_MODE_HUB, | 12 | USB3503_MODE_HUB, |
@@ -11,6 +15,7 @@ enum usb3503_mode { | |||
11 | 15 | ||
12 | struct usb3503_platform_data { | 16 | struct usb3503_platform_data { |
13 | enum usb3503_mode initial_mode; | 17 | enum usb3503_mode initial_mode; |
18 | u8 port_off_mask; | ||
14 | int gpio_intn; | 19 | int gpio_intn; |
15 | int gpio_connect; | 20 | int gpio_connect; |
16 | int gpio_reset; | 21 | int gpio_reset; |
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 9abf1db6aea6..ce8e4ffd78c7 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
@@ -180,7 +180,16 @@ struct platform_driver { | |||
180 | const struct platform_device_id *id_table; | 180 | const struct platform_device_id *id_table; |
181 | }; | 181 | }; |
182 | 182 | ||
183 | extern int platform_driver_register(struct platform_driver *); | 183 | #define to_platform_driver(drv) (container_of((drv), struct platform_driver, \ |
184 | driver)) | ||
185 | |||
186 | /* | ||
187 | * use a macro to avoid include chaining to get THIS_MODULE | ||
188 | */ | ||
189 | #define platform_driver_register(drv) \ | ||
190 | __platform_driver_register(drv, THIS_MODULE) | ||
191 | extern int __platform_driver_register(struct platform_driver *, | ||
192 | struct module *); | ||
184 | extern void platform_driver_unregister(struct platform_driver *); | 193 | extern void platform_driver_unregister(struct platform_driver *); |
185 | 194 | ||
186 | /* non-hotpluggable platform devices may use this so that probe() and | 195 | /* non-hotpluggable platform devices may use this so that probe() and |
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 7d7e09efff9b..6fa7cea25da9 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
@@ -37,7 +37,6 @@ extern void pm_runtime_enable(struct device *dev); | |||
37 | extern void __pm_runtime_disable(struct device *dev, bool check_resume); | 37 | extern void __pm_runtime_disable(struct device *dev, bool check_resume); |
38 | extern void pm_runtime_allow(struct device *dev); | 38 | extern void pm_runtime_allow(struct device *dev); |
39 | extern void pm_runtime_forbid(struct device *dev); | 39 | extern void pm_runtime_forbid(struct device *dev); |
40 | extern int pm_generic_runtime_idle(struct device *dev); | ||
41 | extern int pm_generic_runtime_suspend(struct device *dev); | 40 | extern int pm_generic_runtime_suspend(struct device *dev); |
42 | extern int pm_generic_runtime_resume(struct device *dev); | 41 | extern int pm_generic_runtime_resume(struct device *dev); |
43 | extern void pm_runtime_no_callbacks(struct device *dev); | 42 | extern void pm_runtime_no_callbacks(struct device *dev); |
@@ -143,7 +142,6 @@ static inline bool pm_runtime_active(struct device *dev) { return true; } | |||
143 | static inline bool pm_runtime_status_suspended(struct device *dev) { return false; } | 142 | static inline bool pm_runtime_status_suspended(struct device *dev) { return false; } |
144 | static inline bool pm_runtime_enabled(struct device *dev) { return false; } | 143 | static inline bool pm_runtime_enabled(struct device *dev) { return false; } |
145 | 144 | ||
146 | static inline int pm_generic_runtime_idle(struct device *dev) { return 0; } | ||
147 | static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } | 145 | static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } |
148 | static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } | 146 | static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } |
149 | static inline void pm_runtime_no_callbacks(struct device *dev) {} | 147 | static inline void pm_runtime_no_callbacks(struct device *dev) {} |
diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h index 569781faa504..a0f70808d7f4 100644 --- a/include/linux/pm_wakeup.h +++ b/include/linux/pm_wakeup.h | |||
@@ -36,8 +36,8 @@ | |||
36 | * @last_time: Monotonic clock when the wakeup source's was touched last time. | 36 | * @last_time: Monotonic clock when the wakeup source's was touched last time. |
37 | * @prevent_sleep_time: Total time this source has been preventing autosleep. | 37 | * @prevent_sleep_time: Total time this source has been preventing autosleep. |
38 | * @event_count: Number of signaled wakeup events. | 38 | * @event_count: Number of signaled wakeup events. |
39 | * @active_count: Number of times the wakeup sorce was activated. | 39 | * @active_count: Number of times the wakeup source was activated. |
40 | * @relax_count: Number of times the wakeup sorce was deactivated. | 40 | * @relax_count: Number of times the wakeup source was deactivated. |
41 | * @expire_count: Number of times the wakeup source's timeout has expired. | 41 | * @expire_count: Number of times the wakeup source's timeout has expired. |
42 | * @wakeup_count: Number of times the wakeup source might abort suspend. | 42 | * @wakeup_count: Number of times the wakeup source might abort suspend. |
43 | * @active: Status of the wakeup source. | 43 | * @active: Status of the wakeup source. |
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h index 7794d75ed155..907f3fd191ac 100644 --- a/include/linux/posix-timers.h +++ b/include/linux/posix-timers.h | |||
@@ -7,14 +7,20 @@ | |||
7 | #include <linux/timex.h> | 7 | #include <linux/timex.h> |
8 | #include <linux/alarmtimer.h> | 8 | #include <linux/alarmtimer.h> |
9 | 9 | ||
10 | union cpu_time_count { | 10 | |
11 | cputime_t cpu; | 11 | static inline unsigned long long cputime_to_expires(cputime_t expires) |
12 | unsigned long long sched; | 12 | { |
13 | }; | 13 | return (__force unsigned long long)expires; |
14 | } | ||
15 | |||
16 | static inline cputime_t expires_to_cputime(unsigned long long expires) | ||
17 | { | ||
18 | return (__force cputime_t)expires; | ||
19 | } | ||
14 | 20 | ||
15 | struct cpu_timer_list { | 21 | struct cpu_timer_list { |
16 | struct list_head entry; | 22 | struct list_head entry; |
17 | union cpu_time_count expires, incr; | 23 | unsigned long long expires, incr; |
18 | struct task_struct *task; | 24 | struct task_struct *task; |
19 | int firing; | 25 | int firing; |
20 | }; | 26 | }; |
diff --git a/include/linux/power/smartreflex.h b/include/linux/power/smartreflex.h index c0f44c2b006d..d8b187c3925d 100644 --- a/include/linux/power/smartreflex.h +++ b/include/linux/power/smartreflex.h | |||
@@ -299,11 +299,11 @@ void omap_sr_disable_reset_volt(struct voltagedomain *voltdm); | |||
299 | void omap_sr_register_pmic(struct omap_sr_pmic_data *pmic_data); | 299 | void omap_sr_register_pmic(struct omap_sr_pmic_data *pmic_data); |
300 | 300 | ||
301 | /* Smartreflex driver hooks to be called from Smartreflex class driver */ | 301 | /* Smartreflex driver hooks to be called from Smartreflex class driver */ |
302 | int sr_enable(struct voltagedomain *voltdm, unsigned long volt); | 302 | int sr_enable(struct omap_sr *sr, unsigned long volt); |
303 | void sr_disable(struct voltagedomain *voltdm); | 303 | void sr_disable(struct omap_sr *sr); |
304 | int sr_configure_errgen(struct voltagedomain *voltdm); | 304 | int sr_configure_errgen(struct omap_sr *sr); |
305 | int sr_disable_errgen(struct voltagedomain *voltdm); | 305 | int sr_disable_errgen(struct omap_sr *sr); |
306 | int sr_configure_minmax(struct voltagedomain *voltdm); | 306 | int sr_configure_minmax(struct omap_sr *sr); |
307 | 307 | ||
308 | /* API to register the smartreflex class driver with the smartreflex driver */ | 308 | /* API to register the smartreflex class driver with the smartreflex driver */ |
309 | int sr_register_class(struct omap_sr_class_data *class_data); | 309 | int sr_register_class(struct omap_sr_class_data *class_data); |
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 3828cefb4f65..804b90643a85 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h | |||
@@ -162,6 +162,8 @@ union power_supply_propval { | |||
162 | const char *strval; | 162 | const char *strval; |
163 | }; | 163 | }; |
164 | 164 | ||
165 | struct device_node; | ||
166 | |||
165 | struct power_supply { | 167 | struct power_supply { |
166 | const char *name; | 168 | const char *name; |
167 | enum power_supply_type type; | 169 | enum power_supply_type type; |
@@ -173,9 +175,7 @@ struct power_supply { | |||
173 | 175 | ||
174 | char **supplied_from; | 176 | char **supplied_from; |
175 | size_t num_supplies; | 177 | size_t num_supplies; |
176 | #ifdef CONFIG_OF | ||
177 | struct device_node *of_node; | 178 | struct device_node *of_node; |
178 | #endif | ||
179 | 179 | ||
180 | int (*get_property)(struct power_supply *psy, | 180 | int (*get_property)(struct power_supply *psy, |
181 | enum power_supply_property psp, | 181 | enum power_supply_property psp, |
diff --git a/include/linux/pstore.h b/include/linux/pstore.h index 75d01760c911..4aa80ba830a2 100644 --- a/include/linux/pstore.h +++ b/include/linux/pstore.h | |||
@@ -35,6 +35,10 @@ enum pstore_type_id { | |||
35 | PSTORE_TYPE_MCE = 1, | 35 | PSTORE_TYPE_MCE = 1, |
36 | PSTORE_TYPE_CONSOLE = 2, | 36 | PSTORE_TYPE_CONSOLE = 2, |
37 | PSTORE_TYPE_FTRACE = 3, | 37 | PSTORE_TYPE_FTRACE = 3, |
38 | /* PPC64 partition types */ | ||
39 | PSTORE_TYPE_PPC_RTAS = 4, | ||
40 | PSTORE_TYPE_PPC_OF = 5, | ||
41 | PSTORE_TYPE_PPC_COMMON = 6, | ||
38 | PSTORE_TYPE_UNKNOWN = 255 | 42 | PSTORE_TYPE_UNKNOWN = 255 |
39 | }; | 43 | }; |
40 | 44 | ||
@@ -54,12 +58,12 @@ struct pstore_info { | |||
54 | struct pstore_info *psi); | 58 | struct pstore_info *psi); |
55 | int (*write)(enum pstore_type_id type, | 59 | int (*write)(enum pstore_type_id type, |
56 | enum kmsg_dump_reason reason, u64 *id, | 60 | enum kmsg_dump_reason reason, u64 *id, |
57 | unsigned int part, int count, size_t size, | 61 | unsigned int part, int count, size_t hsize, |
58 | struct pstore_info *psi); | 62 | size_t size, struct pstore_info *psi); |
59 | int (*write_buf)(enum pstore_type_id type, | 63 | int (*write_buf)(enum pstore_type_id type, |
60 | enum kmsg_dump_reason reason, u64 *id, | 64 | enum kmsg_dump_reason reason, u64 *id, |
61 | unsigned int part, const char *buf, size_t size, | 65 | unsigned int part, const char *buf, size_t hsize, |
62 | struct pstore_info *psi); | 66 | size_t size, struct pstore_info *psi); |
63 | int (*erase)(enum pstore_type_id type, u64 id, | 67 | int (*erase)(enum pstore_type_id type, u64 id, |
64 | int count, struct timespec time, | 68 | int count, struct timespec time, |
65 | struct pstore_info *psi); | 69 | struct pstore_info *psi); |
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 89573a33ab3c..07d0df6bf768 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -142,9 +142,6 @@ static inline void ptrace_init_task(struct task_struct *child, bool ptrace) | |||
142 | { | 142 | { |
143 | INIT_LIST_HEAD(&child->ptrace_entry); | 143 | INIT_LIST_HEAD(&child->ptrace_entry); |
144 | INIT_LIST_HEAD(&child->ptraced); | 144 | INIT_LIST_HEAD(&child->ptraced); |
145 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | ||
146 | atomic_set(&child->ptrace_bp_refcnt, 1); | ||
147 | #endif | ||
148 | child->jobctl = 0; | 145 | child->jobctl = 0; |
149 | child->ptrace = 0; | 146 | child->ptrace = 0; |
150 | child->parent = child->real_parent; | 147 | child->parent = child->real_parent; |
@@ -351,11 +348,4 @@ extern int task_current_syscall(struct task_struct *target, long *callno, | |||
351 | unsigned long args[6], unsigned int maxargs, | 348 | unsigned long args[6], unsigned int maxargs, |
352 | unsigned long *sp, unsigned long *pc); | 349 | unsigned long *sp, unsigned long *pc); |
353 | 350 | ||
354 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | ||
355 | extern int ptrace_get_breakpoints(struct task_struct *tsk); | ||
356 | extern void ptrace_put_breakpoints(struct task_struct *tsk); | ||
357 | #else | ||
358 | static inline void ptrace_put_breakpoints(struct task_struct *tsk) { } | ||
359 | #endif /* CONFIG_HAVE_HW_BREAKPOINT */ | ||
360 | |||
361 | #endif | 351 | #endif |
diff --git a/include/linux/pvclock_gtod.h b/include/linux/pvclock_gtod.h index 0ca75825b60d..a71d2dbd3610 100644 --- a/include/linux/pvclock_gtod.h +++ b/include/linux/pvclock_gtod.h | |||
@@ -3,6 +3,13 @@ | |||
3 | 3 | ||
4 | #include <linux/notifier.h> | 4 | #include <linux/notifier.h> |
5 | 5 | ||
6 | /* | ||
7 | * The pvclock gtod notifier is called when the system time is updated | ||
8 | * and is used to keep guest time synchronized with host time. | ||
9 | * | ||
10 | * The 'action' parameter in the notifier function is false (0), or | ||
11 | * true (non-zero) if system time was stepped. | ||
12 | */ | ||
6 | extern int pvclock_gtod_register_notifier(struct notifier_block *nb); | 13 | extern int pvclock_gtod_register_notifier(struct notifier_block *nb); |
7 | extern int pvclock_gtod_unregister_notifier(struct notifier_block *nb); | 14 | extern int pvclock_gtod_unregister_notifier(struct notifier_block *nb); |
8 | 15 | ||
diff --git a/include/linux/pwm.h b/include/linux/pwm.h index a4df2042b79c..f0feafd184a0 100644 --- a/include/linux/pwm.h +++ b/include/linux/pwm.h | |||
@@ -76,6 +76,7 @@ enum pwm_polarity { | |||
76 | enum { | 76 | enum { |
77 | PWMF_REQUESTED = 1 << 0, | 77 | PWMF_REQUESTED = 1 << 0, |
78 | PWMF_ENABLED = 1 << 1, | 78 | PWMF_ENABLED = 1 << 1, |
79 | PWMF_EXPORTED = 1 << 2, | ||
79 | }; | 80 | }; |
80 | 81 | ||
81 | struct pwm_device { | 82 | struct pwm_device { |
@@ -86,7 +87,9 @@ struct pwm_device { | |||
86 | struct pwm_chip *chip; | 87 | struct pwm_chip *chip; |
87 | void *chip_data; | 88 | void *chip_data; |
88 | 89 | ||
89 | unsigned int period; /* in nanoseconds */ | 90 | unsigned int period; /* in nanoseconds */ |
91 | unsigned int duty_cycle; /* in nanoseconds */ | ||
92 | enum pwm_polarity polarity; | ||
90 | }; | 93 | }; |
91 | 94 | ||
92 | static inline void pwm_set_period(struct pwm_device *pwm, unsigned int period) | 95 | static inline void pwm_set_period(struct pwm_device *pwm, unsigned int period) |
@@ -100,6 +103,17 @@ static inline unsigned int pwm_get_period(struct pwm_device *pwm) | |||
100 | return pwm ? pwm->period : 0; | 103 | return pwm ? pwm->period : 0; |
101 | } | 104 | } |
102 | 105 | ||
106 | static inline void pwm_set_duty_cycle(struct pwm_device *pwm, unsigned int duty) | ||
107 | { | ||
108 | if (pwm) | ||
109 | pwm->duty_cycle = duty; | ||
110 | } | ||
111 | |||
112 | static inline unsigned int pwm_get_duty_cycle(struct pwm_device *pwm) | ||
113 | { | ||
114 | return pwm ? pwm->duty_cycle : 0; | ||
115 | } | ||
116 | |||
103 | /* | 117 | /* |
104 | * pwm_set_polarity - configure the polarity of a PWM signal | 118 | * pwm_set_polarity - configure the polarity of a PWM signal |
105 | */ | 119 | */ |
@@ -278,4 +292,17 @@ static inline void pwm_add_table(struct pwm_lookup *table, size_t num) | |||
278 | } | 292 | } |
279 | #endif | 293 | #endif |
280 | 294 | ||
295 | #ifdef CONFIG_PWM_SYSFS | ||
296 | void pwmchip_sysfs_export(struct pwm_chip *chip); | ||
297 | void pwmchip_sysfs_unexport(struct pwm_chip *chip); | ||
298 | #else | ||
299 | static inline void pwmchip_sysfs_export(struct pwm_chip *chip) | ||
300 | { | ||
301 | } | ||
302 | |||
303 | static inline void pwmchip_sysfs_unexport(struct pwm_chip *chip) | ||
304 | { | ||
305 | } | ||
306 | #endif /* CONFIG_PWM_SYSFS */ | ||
307 | |||
281 | #endif /* __LINUX_PWM_H */ | 308 | #endif /* __LINUX_PWM_H */ |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index ddcc7826d907..4b14bdc911d7 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -216,6 +216,7 @@ static inline int rcu_preempt_depth(void) | |||
216 | #endif /* #else #ifdef CONFIG_PREEMPT_RCU */ | 216 | #endif /* #else #ifdef CONFIG_PREEMPT_RCU */ |
217 | 217 | ||
218 | /* Internal to kernel */ | 218 | /* Internal to kernel */ |
219 | extern void rcu_init(void); | ||
219 | extern void rcu_sched_qs(int cpu); | 220 | extern void rcu_sched_qs(int cpu); |
220 | extern void rcu_bh_qs(int cpu); | 221 | extern void rcu_bh_qs(int cpu); |
221 | extern void rcu_check_callbacks(int cpu, int user); | 222 | extern void rcu_check_callbacks(int cpu, int user); |
@@ -239,8 +240,6 @@ static inline void rcu_user_hooks_switch(struct task_struct *prev, | |||
239 | struct task_struct *next) { } | 240 | struct task_struct *next) { } |
240 | #endif /* CONFIG_RCU_USER_QS */ | 241 | #endif /* CONFIG_RCU_USER_QS */ |
241 | 242 | ||
242 | extern void exit_rcu(void); | ||
243 | |||
244 | /** | 243 | /** |
245 | * RCU_NONIDLE - Indicate idle-loop code that needs RCU readers | 244 | * RCU_NONIDLE - Indicate idle-loop code that needs RCU readers |
246 | * @a: Code that RCU needs to pay attention to. | 245 | * @a: Code that RCU needs to pay attention to. |
@@ -277,7 +276,7 @@ void wait_rcu_gp(call_rcu_func_t crf); | |||
277 | 276 | ||
278 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) | 277 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) |
279 | #include <linux/rcutree.h> | 278 | #include <linux/rcutree.h> |
280 | #elif defined(CONFIG_TINY_RCU) || defined(CONFIG_TINY_PREEMPT_RCU) | 279 | #elif defined(CONFIG_TINY_RCU) |
281 | #include <linux/rcutiny.h> | 280 | #include <linux/rcutiny.h> |
282 | #else | 281 | #else |
283 | #error "Unknown RCU implementation specified to kernel configuration" | 282 | #error "Unknown RCU implementation specified to kernel configuration" |
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index 4e56a9c69a35..e31005ee339e 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h | |||
@@ -27,10 +27,6 @@ | |||
27 | 27 | ||
28 | #include <linux/cache.h> | 28 | #include <linux/cache.h> |
29 | 29 | ||
30 | static inline void rcu_init(void) | ||
31 | { | ||
32 | } | ||
33 | |||
34 | static inline void rcu_barrier_bh(void) | 30 | static inline void rcu_barrier_bh(void) |
35 | { | 31 | { |
36 | wait_rcu_gp(call_rcu_bh); | 32 | wait_rcu_gp(call_rcu_bh); |
@@ -41,8 +37,6 @@ static inline void rcu_barrier_sched(void) | |||
41 | wait_rcu_gp(call_rcu_sched); | 37 | wait_rcu_gp(call_rcu_sched); |
42 | } | 38 | } |
43 | 39 | ||
44 | #ifdef CONFIG_TINY_RCU | ||
45 | |||
46 | static inline void synchronize_rcu_expedited(void) | 40 | static inline void synchronize_rcu_expedited(void) |
47 | { | 41 | { |
48 | synchronize_sched(); /* Only one CPU, so pretty fast anyway!!! */ | 42 | synchronize_sched(); /* Only one CPU, so pretty fast anyway!!! */ |
@@ -53,17 +47,6 @@ static inline void rcu_barrier(void) | |||
53 | rcu_barrier_sched(); /* Only one CPU, so only one list of callbacks! */ | 47 | rcu_barrier_sched(); /* Only one CPU, so only one list of callbacks! */ |
54 | } | 48 | } |
55 | 49 | ||
56 | #else /* #ifdef CONFIG_TINY_RCU */ | ||
57 | |||
58 | void synchronize_rcu_expedited(void); | ||
59 | |||
60 | static inline void rcu_barrier(void) | ||
61 | { | ||
62 | wait_rcu_gp(call_rcu); | ||
63 | } | ||
64 | |||
65 | #endif /* #else #ifdef CONFIG_TINY_RCU */ | ||
66 | |||
67 | static inline void synchronize_rcu_bh(void) | 50 | static inline void synchronize_rcu_bh(void) |
68 | { | 51 | { |
69 | synchronize_sched(); | 52 | synchronize_sched(); |
@@ -85,35 +68,15 @@ static inline void kfree_call_rcu(struct rcu_head *head, | |||
85 | call_rcu(head, func); | 68 | call_rcu(head, func); |
86 | } | 69 | } |
87 | 70 | ||
88 | #ifdef CONFIG_TINY_RCU | ||
89 | |||
90 | static inline void rcu_preempt_note_context_switch(void) | ||
91 | { | ||
92 | } | ||
93 | |||
94 | static inline int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies) | 71 | static inline int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies) |
95 | { | 72 | { |
96 | *delta_jiffies = ULONG_MAX; | 73 | *delta_jiffies = ULONG_MAX; |
97 | return 0; | 74 | return 0; |
98 | } | 75 | } |
99 | 76 | ||
100 | #else /* #ifdef CONFIG_TINY_RCU */ | ||
101 | |||
102 | void rcu_preempt_note_context_switch(void); | ||
103 | int rcu_preempt_needs_cpu(void); | ||
104 | |||
105 | static inline int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies) | ||
106 | { | ||
107 | *delta_jiffies = ULONG_MAX; | ||
108 | return rcu_preempt_needs_cpu(); | ||
109 | } | ||
110 | |||
111 | #endif /* #else #ifdef CONFIG_TINY_RCU */ | ||
112 | |||
113 | static inline void rcu_note_context_switch(int cpu) | 77 | static inline void rcu_note_context_switch(int cpu) |
114 | { | 78 | { |
115 | rcu_sched_qs(cpu); | 79 | rcu_sched_qs(cpu); |
116 | rcu_preempt_note_context_switch(); | ||
117 | } | 80 | } |
118 | 81 | ||
119 | /* | 82 | /* |
@@ -156,6 +119,10 @@ static inline void rcu_cpu_stall_reset(void) | |||
156 | { | 119 | { |
157 | } | 120 | } |
158 | 121 | ||
122 | static inline void exit_rcu(void) | ||
123 | { | ||
124 | } | ||
125 | |||
159 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 126 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
160 | extern int rcu_scheduler_active __read_mostly; | 127 | extern int rcu_scheduler_active __read_mostly; |
161 | extern void rcu_scheduler_starting(void); | 128 | extern void rcu_scheduler_starting(void); |
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 952b79339304..226169d1bd2b 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
@@ -30,7 +30,6 @@ | |||
30 | #ifndef __LINUX_RCUTREE_H | 30 | #ifndef __LINUX_RCUTREE_H |
31 | #define __LINUX_RCUTREE_H | 31 | #define __LINUX_RCUTREE_H |
32 | 32 | ||
33 | extern void rcu_init(void); | ||
34 | extern void rcu_note_context_switch(int cpu); | 33 | extern void rcu_note_context_switch(int cpu); |
35 | extern int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies); | 34 | extern int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies); |
36 | extern void rcu_cpu_stall_reset(void); | 35 | extern void rcu_cpu_stall_reset(void); |
@@ -86,6 +85,8 @@ extern void rcu_force_quiescent_state(void); | |||
86 | extern void rcu_bh_force_quiescent_state(void); | 85 | extern void rcu_bh_force_quiescent_state(void); |
87 | extern void rcu_sched_force_quiescent_state(void); | 86 | extern void rcu_sched_force_quiescent_state(void); |
88 | 87 | ||
88 | extern void exit_rcu(void); | ||
89 | |||
89 | extern void rcu_scheduler_starting(void); | 90 | extern void rcu_scheduler_starting(void); |
90 | extern int rcu_scheduler_active __read_mostly; | 91 | extern int rcu_scheduler_active __read_mostly; |
91 | 92 | ||
diff --git a/include/linux/reboot.h b/include/linux/reboot.h index 23b36304cd88..8e00f9f6f963 100644 --- a/include/linux/reboot.h +++ b/include/linux/reboot.h | |||
@@ -10,6 +10,31 @@ | |||
10 | #define SYS_HALT 0x0002 /* Notify of system halt */ | 10 | #define SYS_HALT 0x0002 /* Notify of system halt */ |
11 | #define SYS_POWER_OFF 0x0003 /* Notify of system power off */ | 11 | #define SYS_POWER_OFF 0x0003 /* Notify of system power off */ |
12 | 12 | ||
13 | enum reboot_mode { | ||
14 | REBOOT_COLD = 0, | ||
15 | REBOOT_WARM, | ||
16 | REBOOT_HARD, | ||
17 | REBOOT_SOFT, | ||
18 | REBOOT_GPIO, | ||
19 | }; | ||
20 | extern enum reboot_mode reboot_mode; | ||
21 | |||
22 | enum reboot_type { | ||
23 | BOOT_TRIPLE = 't', | ||
24 | BOOT_KBD = 'k', | ||
25 | BOOT_BIOS = 'b', | ||
26 | BOOT_ACPI = 'a', | ||
27 | BOOT_EFI = 'e', | ||
28 | BOOT_CF9 = 'p', | ||
29 | BOOT_CF9_COND = 'q', | ||
30 | }; | ||
31 | extern enum reboot_type reboot_type; | ||
32 | |||
33 | extern int reboot_default; | ||
34 | extern int reboot_cpu; | ||
35 | extern int reboot_force; | ||
36 | |||
37 | |||
13 | extern int register_reboot_notifier(struct notifier_block *); | 38 | extern int register_reboot_notifier(struct notifier_block *); |
14 | extern int unregister_reboot_notifier(struct notifier_block *); | 39 | extern int unregister_reboot_notifier(struct notifier_block *); |
15 | 40 | ||
@@ -26,7 +51,7 @@ extern void machine_shutdown(void); | |||
26 | struct pt_regs; | 51 | struct pt_regs; |
27 | extern void machine_crash_shutdown(struct pt_regs *); | 52 | extern void machine_crash_shutdown(struct pt_regs *); |
28 | 53 | ||
29 | /* | 54 | /* |
30 | * Architecture independent implemenations of sys_reboot commands. | 55 | * Architecture independent implemenations of sys_reboot commands. |
31 | */ | 56 | */ |
32 | 57 | ||
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index 02d84e24b7c2..580a5320cc96 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h | |||
@@ -15,6 +15,7 @@ | |||
15 | 15 | ||
16 | #include <linux/list.h> | 16 | #include <linux/list.h> |
17 | #include <linux/rbtree.h> | 17 | #include <linux/rbtree.h> |
18 | #include <linux/err.h> | ||
18 | 19 | ||
19 | struct module; | 20 | struct module; |
20 | struct device; | 21 | struct device; |
@@ -23,6 +24,7 @@ struct irq_domain; | |||
23 | struct spi_device; | 24 | struct spi_device; |
24 | struct regmap; | 25 | struct regmap; |
25 | struct regmap_range_cfg; | 26 | struct regmap_range_cfg; |
27 | struct regmap_field; | ||
26 | 28 | ||
27 | /* An enum of all the supported cache types */ | 29 | /* An enum of all the supported cache types */ |
28 | enum regcache_type { | 30 | enum regcache_type { |
@@ -394,10 +396,15 @@ bool regmap_can_raw_write(struct regmap *map); | |||
394 | int regcache_sync(struct regmap *map); | 396 | int regcache_sync(struct regmap *map); |
395 | int regcache_sync_region(struct regmap *map, unsigned int min, | 397 | int regcache_sync_region(struct regmap *map, unsigned int min, |
396 | unsigned int max); | 398 | unsigned int max); |
399 | int regcache_drop_region(struct regmap *map, unsigned int min, | ||
400 | unsigned int max); | ||
397 | void regcache_cache_only(struct regmap *map, bool enable); | 401 | void regcache_cache_only(struct regmap *map, bool enable); |
398 | void regcache_cache_bypass(struct regmap *map, bool enable); | 402 | void regcache_cache_bypass(struct regmap *map, bool enable); |
399 | void regcache_mark_dirty(struct regmap *map); | 403 | void regcache_mark_dirty(struct regmap *map); |
400 | 404 | ||
405 | bool regmap_check_range_table(struct regmap *map, unsigned int reg, | ||
406 | const struct regmap_access_table *table); | ||
407 | |||
401 | int regmap_register_patch(struct regmap *map, const struct reg_default *regs, | 408 | int regmap_register_patch(struct regmap *map, const struct reg_default *regs, |
402 | int num_regs); | 409 | int num_regs); |
403 | 410 | ||
@@ -412,6 +419,36 @@ bool regmap_reg_in_ranges(unsigned int reg, | |||
412 | unsigned int nranges); | 419 | unsigned int nranges); |
413 | 420 | ||
414 | /** | 421 | /** |
422 | * Description of an register field | ||
423 | * | ||
424 | * @reg: Offset of the register within the regmap bank | ||
425 | * @lsb: lsb of the register field. | ||
426 | * @reg: msb of the register field. | ||
427 | */ | ||
428 | struct reg_field { | ||
429 | unsigned int reg; | ||
430 | unsigned int lsb; | ||
431 | unsigned int msb; | ||
432 | }; | ||
433 | |||
434 | #define REG_FIELD(_reg, _lsb, _msb) { \ | ||
435 | .reg = _reg, \ | ||
436 | .lsb = _lsb, \ | ||
437 | .msb = _msb, \ | ||
438 | } | ||
439 | |||
440 | struct regmap_field *regmap_field_alloc(struct regmap *regmap, | ||
441 | struct reg_field reg_field); | ||
442 | void regmap_field_free(struct regmap_field *field); | ||
443 | |||
444 | struct regmap_field *devm_regmap_field_alloc(struct device *dev, | ||
445 | struct regmap *regmap, struct reg_field reg_field); | ||
446 | void devm_regmap_field_free(struct device *dev, struct regmap_field *field); | ||
447 | |||
448 | int regmap_field_read(struct regmap_field *field, unsigned int *val); | ||
449 | int regmap_field_write(struct regmap_field *field, unsigned int val); | ||
450 | |||
451 | /** | ||
415 | * Description of an IRQ for the generic regmap irq_chip. | 452 | * Description of an IRQ for the generic regmap irq_chip. |
416 | * | 453 | * |
417 | * @reg_offset: Offset of the status/mask register within the bank | 454 | * @reg_offset: Offset of the status/mask register within the bank |
@@ -562,6 +599,13 @@ static inline int regcache_sync_region(struct regmap *map, unsigned int min, | |||
562 | return -EINVAL; | 599 | return -EINVAL; |
563 | } | 600 | } |
564 | 601 | ||
602 | static inline int regcache_drop_region(struct regmap *map, unsigned int min, | ||
603 | unsigned int max) | ||
604 | { | ||
605 | WARN_ONCE(1, "regmap API is disabled"); | ||
606 | return -EINVAL; | ||
607 | } | ||
608 | |||
565 | static inline void regcache_cache_only(struct regmap *map, bool enable) | 609 | static inline void regcache_cache_only(struct regmap *map, bool enable) |
566 | { | 610 | { |
567 | WARN_ONCE(1, "regmap API is disabled"); | 611 | WARN_ONCE(1, "regmap API is disabled"); |
diff --git a/include/linux/regulator/ab8500.h b/include/linux/regulator/ab8500.h index 7c5ff0c55773..75307447cef9 100644 --- a/include/linux/regulator/ab8500.h +++ b/include/linux/regulator/ab8500.h | |||
@@ -336,8 +336,4 @@ static inline int ab8500_regulator_debug_exit(struct platform_device *pdev) | |||
336 | } | 336 | } |
337 | #endif | 337 | #endif |
338 | 338 | ||
339 | /* AB8500 external regulator functions. */ | ||
340 | int ab8500_ext_regulator_init(struct platform_device *pdev); | ||
341 | void ab8500_ext_regulator_exit(struct platform_device *pdev); | ||
342 | |||
343 | #endif | 339 | #endif |
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index 145022a83085..3a76389c6aaa 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
@@ -165,6 +165,7 @@ int regulator_count_voltages(struct regulator *regulator); | |||
165 | int regulator_list_voltage(struct regulator *regulator, unsigned selector); | 165 | int regulator_list_voltage(struct regulator *regulator, unsigned selector); |
166 | int regulator_is_supported_voltage(struct regulator *regulator, | 166 | int regulator_is_supported_voltage(struct regulator *regulator, |
167 | int min_uV, int max_uV); | 167 | int min_uV, int max_uV); |
168 | unsigned int regulator_get_linear_step(struct regulator *regulator); | ||
168 | int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV); | 169 | int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV); |
169 | int regulator_set_voltage_time(struct regulator *regulator, | 170 | int regulator_set_voltage_time(struct regulator *regulator, |
170 | int old_uV, int new_uV); | 171 | int old_uV, int new_uV); |
diff --git a/include/linux/reservation.h b/include/linux/reservation.h new file mode 100644 index 000000000000..813dae960ebd --- /dev/null +++ b/include/linux/reservation.h | |||
@@ -0,0 +1,62 @@ | |||
1 | /* | ||
2 | * Header file for reservations for dma-buf and ttm | ||
3 | * | ||
4 | * Copyright(C) 2011 Linaro Limited. All rights reserved. | ||
5 | * Copyright (C) 2012-2013 Canonical Ltd | ||
6 | * Copyright (C) 2012 Texas Instruments | ||
7 | * | ||
8 | * Authors: | ||
9 | * Rob Clark <rob.clark@linaro.org> | ||
10 | * Maarten Lankhorst <maarten.lankhorst@canonical.com> | ||
11 | * Thomas Hellstrom <thellstrom-at-vmware-dot-com> | ||
12 | * | ||
13 | * Based on bo.c which bears the following copyright notice, | ||
14 | * but is dual licensed: | ||
15 | * | ||
16 | * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA | ||
17 | * All Rights Reserved. | ||
18 | * | ||
19 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
20 | * copy of this software and associated documentation files (the | ||
21 | * "Software"), to deal in the Software without restriction, including | ||
22 | * without limitation the rights to use, copy, modify, merge, publish, | ||
23 | * distribute, sub license, and/or sell copies of the Software, and to | ||
24 | * permit persons to whom the Software is furnished to do so, subject to | ||
25 | * the following conditions: | ||
26 | * | ||
27 | * The above copyright notice and this permission notice (including the | ||
28 | * next paragraph) shall be included in all copies or substantial portions | ||
29 | * of the Software. | ||
30 | * | ||
31 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
32 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
33 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL | ||
34 | * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, | ||
35 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
36 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE | ||
37 | * USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
38 | */ | ||
39 | #ifndef _LINUX_RESERVATION_H | ||
40 | #define _LINUX_RESERVATION_H | ||
41 | |||
42 | #include <linux/ww_mutex.h> | ||
43 | |||
44 | extern struct ww_class reservation_ww_class; | ||
45 | |||
46 | struct reservation_object { | ||
47 | struct ww_mutex lock; | ||
48 | }; | ||
49 | |||
50 | static inline void | ||
51 | reservation_object_init(struct reservation_object *obj) | ||
52 | { | ||
53 | ww_mutex_init(&obj->lock, &reservation_ww_class); | ||
54 | } | ||
55 | |||
56 | static inline void | ||
57 | reservation_object_fini(struct reservation_object *obj) | ||
58 | { | ||
59 | ww_mutex_destroy(&obj->lock); | ||
60 | } | ||
61 | |||
62 | #endif /* _LINUX_RESERVATION_H */ | ||
diff --git a/include/linux/rio.h b/include/linux/rio.h index 18e099342e6f..b71d5738e683 100644 --- a/include/linux/rio.h +++ b/include/linux/rio.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/errno.h> | 20 | #include <linux/errno.h> |
21 | #include <linux/device.h> | 21 | #include <linux/device.h> |
22 | #include <linux/rio_regs.h> | 22 | #include <linux/rio_regs.h> |
23 | #include <linux/mod_devicetable.h> | ||
23 | #ifdef CONFIG_RAPIDIO_DMA_ENGINE | 24 | #ifdef CONFIG_RAPIDIO_DMA_ENGINE |
24 | #include <linux/dmaengine.h> | 25 | #include <linux/dmaengine.h> |
25 | #endif | 26 | #endif |
@@ -91,9 +92,24 @@ union rio_pw_msg; | |||
91 | /** | 92 | /** |
92 | * struct rio_switch - RIO switch info | 93 | * struct rio_switch - RIO switch info |
93 | * @node: Node in global list of switches | 94 | * @node: Node in global list of switches |
94 | * @switchid: Switch ID that is unique across a network | ||
95 | * @route_table: Copy of switch routing table | 95 | * @route_table: Copy of switch routing table |
96 | * @port_ok: Status of each port (one bit per port) - OK=1 or UNINIT=0 | 96 | * @port_ok: Status of each port (one bit per port) - OK=1 or UNINIT=0 |
97 | * @ops: pointer to switch-specific operations | ||
98 | * @lock: lock to serialize operations updates | ||
99 | * @nextdev: Array of per-port pointers to the next attached device | ||
100 | */ | ||
101 | struct rio_switch { | ||
102 | struct list_head node; | ||
103 | u8 *route_table; | ||
104 | u32 port_ok; | ||
105 | struct rio_switch_ops *ops; | ||
106 | spinlock_t lock; | ||
107 | struct rio_dev *nextdev[0]; | ||
108 | }; | ||
109 | |||
110 | /** | ||
111 | * struct rio_switch_ops - Per-switch operations | ||
112 | * @owner: The module owner of this structure | ||
97 | * @add_entry: Callback for switch-specific route add function | 113 | * @add_entry: Callback for switch-specific route add function |
98 | * @get_entry: Callback for switch-specific route get function | 114 | * @get_entry: Callback for switch-specific route get function |
99 | * @clr_table: Callback for switch-specific clear route table function | 115 | * @clr_table: Callback for switch-specific clear route table function |
@@ -101,14 +117,12 @@ union rio_pw_msg; | |||
101 | * @get_domain: Callback for switch-specific domain get function | 117 | * @get_domain: Callback for switch-specific domain get function |
102 | * @em_init: Callback for switch-specific error management init function | 118 | * @em_init: Callback for switch-specific error management init function |
103 | * @em_handle: Callback for switch-specific error management handler function | 119 | * @em_handle: Callback for switch-specific error management handler function |
104 | * @sw_sysfs: Callback that initializes switch-specific sysfs attributes | 120 | * |
105 | * @nextdev: Array of per-port pointers to the next attached device | 121 | * Defines the operations that are necessary to initialize/control |
122 | * a particular RIO switch device. | ||
106 | */ | 123 | */ |
107 | struct rio_switch { | 124 | struct rio_switch_ops { |
108 | struct list_head node; | 125 | struct module *owner; |
109 | u16 switchid; | ||
110 | u8 *route_table; | ||
111 | u32 port_ok; | ||
112 | int (*add_entry) (struct rio_mport *mport, u16 destid, u8 hopcount, | 126 | int (*add_entry) (struct rio_mport *mport, u16 destid, u8 hopcount, |
113 | u16 table, u16 route_destid, u8 route_port); | 127 | u16 table, u16 route_destid, u8 route_port); |
114 | int (*get_entry) (struct rio_mport *mport, u16 destid, u8 hopcount, | 128 | int (*get_entry) (struct rio_mport *mport, u16 destid, u8 hopcount, |
@@ -121,8 +135,6 @@ struct rio_switch { | |||
121 | u8 *sw_domain); | 135 | u8 *sw_domain); |
122 | int (*em_init) (struct rio_dev *dev); | 136 | int (*em_init) (struct rio_dev *dev); |
123 | int (*em_handle) (struct rio_dev *dev, u8 swport); | 137 | int (*em_handle) (struct rio_dev *dev, u8 swport); |
124 | int (*sw_sysfs) (struct rio_dev *dev, int create); | ||
125 | struct rio_dev *nextdev[0]; | ||
126 | }; | 138 | }; |
127 | 139 | ||
128 | /** | 140 | /** |
@@ -130,6 +142,7 @@ struct rio_switch { | |||
130 | * @global_list: Node in list of all RIO devices | 142 | * @global_list: Node in list of all RIO devices |
131 | * @net_list: Node in list of RIO devices in a network | 143 | * @net_list: Node in list of RIO devices in a network |
132 | * @net: Network this device is a part of | 144 | * @net: Network this device is a part of |
145 | * @do_enum: Enumeration flag | ||
133 | * @did: Device ID | 146 | * @did: Device ID |
134 | * @vid: Vendor ID | 147 | * @vid: Vendor ID |
135 | * @device_rev: Device revision | 148 | * @device_rev: Device revision |
@@ -158,6 +171,7 @@ struct rio_dev { | |||
158 | struct list_head global_list; /* node in list of all RIO devices */ | 171 | struct list_head global_list; /* node in list of all RIO devices */ |
159 | struct list_head net_list; /* node in per net list */ | 172 | struct list_head net_list; /* node in per net list */ |
160 | struct rio_net *net; /* RIO net this device resides in */ | 173 | struct rio_net *net; /* RIO net this device resides in */ |
174 | bool do_enum; | ||
161 | u16 did; | 175 | u16 did; |
162 | u16 vid; | 176 | u16 vid; |
163 | u32 device_rev; | 177 | u32 device_rev; |
@@ -297,10 +311,6 @@ struct rio_net { | |||
297 | struct rio_id_table destid_table; /* destID allocation table */ | 311 | struct rio_id_table destid_table; /* destID allocation table */ |
298 | }; | 312 | }; |
299 | 313 | ||
300 | /* Definitions used by switch sysfs initialization callback */ | ||
301 | #define RIO_SW_SYSFS_CREATE 1 /* Create switch attributes */ | ||
302 | #define RIO_SW_SYSFS_REMOVE 0 /* Remove switch attributes */ | ||
303 | |||
304 | /* Low-level architecture-dependent routines */ | 314 | /* Low-level architecture-dependent routines */ |
305 | 315 | ||
306 | /** | 316 | /** |
@@ -385,35 +395,6 @@ struct rio_driver { | |||
385 | 395 | ||
386 | #define to_rio_driver(drv) container_of(drv,struct rio_driver, driver) | 396 | #define to_rio_driver(drv) container_of(drv,struct rio_driver, driver) |
387 | 397 | ||
388 | /** | ||
389 | * struct rio_device_id - RIO device identifier | ||
390 | * @did: RIO device ID | ||
391 | * @vid: RIO vendor ID | ||
392 | * @asm_did: RIO assembly device ID | ||
393 | * @asm_vid: RIO assembly vendor ID | ||
394 | * | ||
395 | * Identifies a RIO device based on both the device/vendor IDs and | ||
396 | * the assembly device/vendor IDs. | ||
397 | */ | ||
398 | struct rio_device_id { | ||
399 | u16 did, vid; | ||
400 | u16 asm_did, asm_vid; | ||
401 | }; | ||
402 | |||
403 | /** | ||
404 | * struct rio_switch_ops - Per-switch operations | ||
405 | * @vid: RIO vendor ID | ||
406 | * @did: RIO device ID | ||
407 | * @init_hook: Callback that performs switch device initialization | ||
408 | * | ||
409 | * Defines the operations that are necessary to initialize/control | ||
410 | * a particular RIO switch device. | ||
411 | */ | ||
412 | struct rio_switch_ops { | ||
413 | u16 vid, did; | ||
414 | int (*init_hook) (struct rio_dev *rdev, int do_enum); | ||
415 | }; | ||
416 | |||
417 | union rio_pw_msg { | 398 | union rio_pw_msg { |
418 | struct { | 399 | struct { |
419 | u32 comptag; /* Component Tag CSR */ | 400 | u32 comptag; /* Component Tag CSR */ |
@@ -468,14 +449,29 @@ static inline struct rio_mport *dma_to_mport(struct dma_device *ddev) | |||
468 | 449 | ||
469 | /** | 450 | /** |
470 | * struct rio_scan - RIO enumeration and discovery operations | 451 | * struct rio_scan - RIO enumeration and discovery operations |
452 | * @owner: The module owner of this structure | ||
471 | * @enumerate: Callback to perform RapidIO fabric enumeration. | 453 | * @enumerate: Callback to perform RapidIO fabric enumeration. |
472 | * @discover: Callback to perform RapidIO fabric discovery. | 454 | * @discover: Callback to perform RapidIO fabric discovery. |
473 | */ | 455 | */ |
474 | struct rio_scan { | 456 | struct rio_scan { |
457 | struct module *owner; | ||
475 | int (*enumerate)(struct rio_mport *mport, u32 flags); | 458 | int (*enumerate)(struct rio_mport *mport, u32 flags); |
476 | int (*discover)(struct rio_mport *mport, u32 flags); | 459 | int (*discover)(struct rio_mport *mport, u32 flags); |
477 | }; | 460 | }; |
478 | 461 | ||
462 | /** | ||
463 | * struct rio_scan_node - list node to register RapidIO enumeration and | ||
464 | * discovery methods with RapidIO core. | ||
465 | * @mport_id: ID of an mport (net) serviced by this enumerator | ||
466 | * @node: node in global list of registered enumerators | ||
467 | * @ops: RIO enumeration and discovery operations | ||
468 | */ | ||
469 | struct rio_scan_node { | ||
470 | int mport_id; | ||
471 | struct list_head node; | ||
472 | struct rio_scan *ops; | ||
473 | }; | ||
474 | |||
479 | /* Architecture and hardware-specific functions */ | 475 | /* Architecture and hardware-specific functions */ |
480 | extern int rio_register_mport(struct rio_mport *); | 476 | extern int rio_register_mport(struct rio_mport *); |
481 | extern int rio_open_inb_mbox(struct rio_mport *, void *, int, int); | 477 | extern int rio_open_inb_mbox(struct rio_mport *, void *, int, int); |
diff --git a/include/linux/rio_ids.h b/include/linux/rio_ids.h index b66d13d1bdc0..2543bc163d54 100644 --- a/include/linux/rio_ids.h +++ b/include/linux/rio_ids.h | |||
@@ -13,8 +13,6 @@ | |||
13 | #ifndef LINUX_RIO_IDS_H | 13 | #ifndef LINUX_RIO_IDS_H |
14 | #define LINUX_RIO_IDS_H | 14 | #define LINUX_RIO_IDS_H |
15 | 15 | ||
16 | #define RIO_ANY_ID 0xffff | ||
17 | |||
18 | #define RIO_VID_FREESCALE 0x0002 | 16 | #define RIO_VID_FREESCALE 0x0002 |
19 | #define RIO_DID_MPC8560 0x0003 | 17 | #define RIO_DID_MPC8560 0x0003 |
20 | 18 | ||
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index 26806775b11b..adae88f5b0ab 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h | |||
@@ -244,6 +244,11 @@ size_t sg_copy_from_buffer(struct scatterlist *sgl, unsigned int nents, | |||
244 | size_t sg_copy_to_buffer(struct scatterlist *sgl, unsigned int nents, | 244 | size_t sg_copy_to_buffer(struct scatterlist *sgl, unsigned int nents, |
245 | void *buf, size_t buflen); | 245 | void *buf, size_t buflen); |
246 | 246 | ||
247 | size_t sg_pcopy_from_buffer(struct scatterlist *sgl, unsigned int nents, | ||
248 | void *buf, size_t buflen, off_t skip); | ||
249 | size_t sg_pcopy_to_buffer(struct scatterlist *sgl, unsigned int nents, | ||
250 | void *buf, size_t buflen, off_t skip); | ||
251 | |||
247 | /* | 252 | /* |
248 | * Maximum number of entries that will be allocated in one piece, if | 253 | * Maximum number of entries that will be allocated in one piece, if |
249 | * a list larger than this is required then chaining will be utilized. | 254 | * a list larger than this is required then chaining will be utilized. |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 178a8d909f14..e9995eb5985c 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -314,6 +314,7 @@ struct nsproxy; | |||
314 | struct user_namespace; | 314 | struct user_namespace; |
315 | 315 | ||
316 | #ifdef CONFIG_MMU | 316 | #ifdef CONFIG_MMU |
317 | extern unsigned long mmap_legacy_base(void); | ||
317 | extern void arch_pick_mmap_layout(struct mm_struct *mm); | 318 | extern void arch_pick_mmap_layout(struct mm_struct *mm); |
318 | extern unsigned long | 319 | extern unsigned long |
319 | arch_get_unmapped_area(struct file *, unsigned long, unsigned long, | 320 | arch_get_unmapped_area(struct file *, unsigned long, unsigned long, |
@@ -322,8 +323,6 @@ extern unsigned long | |||
322 | arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr, | 323 | arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr, |
323 | unsigned long len, unsigned long pgoff, | 324 | unsigned long len, unsigned long pgoff, |
324 | unsigned long flags); | 325 | unsigned long flags); |
325 | extern void arch_unmap_area(struct mm_struct *, unsigned long); | ||
326 | extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); | ||
327 | #else | 326 | #else |
328 | static inline void arch_pick_mmap_layout(struct mm_struct *mm) {} | 327 | static inline void arch_pick_mmap_layout(struct mm_struct *mm) {} |
329 | #endif | 328 | #endif |
@@ -924,7 +923,7 @@ struct load_weight { | |||
924 | struct sched_avg { | 923 | struct sched_avg { |
925 | /* | 924 | /* |
926 | * These sums represent an infinite geometric series and so are bound | 925 | * These sums represent an infinite geometric series and so are bound |
927 | * above by 1024/(1-y). Thus we only need a u32 to store them for for all | 926 | * above by 1024/(1-y). Thus we only need a u32 to store them for all |
928 | * choices of y < 1-2^(-32)*1024. | 927 | * choices of y < 1-2^(-32)*1024. |
929 | */ | 928 | */ |
930 | u32 runnable_avg_sum, runnable_avg_period; | 929 | u32 runnable_avg_sum, runnable_avg_period; |
@@ -994,12 +993,7 @@ struct sched_entity { | |||
994 | struct cfs_rq *my_q; | 993 | struct cfs_rq *my_q; |
995 | #endif | 994 | #endif |
996 | 995 | ||
997 | /* | 996 | #ifdef CONFIG_SMP |
998 | * Load-tracking only depends on SMP, FAIR_GROUP_SCHED dependency below may be | ||
999 | * removed when useful for applications beyond shares distribution (e.g. | ||
1000 | * load-balance). | ||
1001 | */ | ||
1002 | #if defined(CONFIG_SMP) && defined(CONFIG_FAIR_GROUP_SCHED) | ||
1003 | /* Per-entity load-tracking */ | 997 | /* Per-entity load-tracking */ |
1004 | struct sched_avg avg; | 998 | struct sched_avg avg; |
1005 | #endif | 999 | #endif |
@@ -1406,9 +1400,6 @@ struct task_struct { | |||
1406 | } memcg_batch; | 1400 | } memcg_batch; |
1407 | unsigned int memcg_kmem_skip_account; | 1401 | unsigned int memcg_kmem_skip_account; |
1408 | #endif | 1402 | #endif |
1409 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | ||
1410 | atomic_t ptrace_bp_refcnt; | ||
1411 | #endif | ||
1412 | #ifdef CONFIG_UPROBES | 1403 | #ifdef CONFIG_UPROBES |
1413 | struct uprobe_task *utask; | 1404 | struct uprobe_task *utask; |
1414 | #endif | 1405 | #endif |
@@ -1542,6 +1533,8 @@ static inline pid_t task_pgrp_nr(struct task_struct *tsk) | |||
1542 | * Test if a process is not yet dead (at most zombie state) | 1533 | * Test if a process is not yet dead (at most zombie state) |
1543 | * If pid_alive fails, then pointers within the task structure | 1534 | * If pid_alive fails, then pointers within the task structure |
1544 | * can be stale and must not be dereferenced. | 1535 | * can be stale and must not be dereferenced. |
1536 | * | ||
1537 | * Return: 1 if the process is alive. 0 otherwise. | ||
1545 | */ | 1538 | */ |
1546 | static inline int pid_alive(struct task_struct *p) | 1539 | static inline int pid_alive(struct task_struct *p) |
1547 | { | 1540 | { |
@@ -1553,6 +1546,8 @@ static inline int pid_alive(struct task_struct *p) | |||
1553 | * @tsk: Task structure to be checked. | 1546 | * @tsk: Task structure to be checked. |
1554 | * | 1547 | * |
1555 | * Check if a task structure is the first user space task the kernel created. | 1548 | * Check if a task structure is the first user space task the kernel created. |
1549 | * | ||
1550 | * Return: 1 if the task structure is init. 0 otherwise. | ||
1556 | */ | 1551 | */ |
1557 | static inline int is_global_init(struct task_struct *tsk) | 1552 | static inline int is_global_init(struct task_struct *tsk) |
1558 | { | 1553 | { |
@@ -1638,6 +1633,7 @@ extern void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut, | |||
1638 | #define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ | 1633 | #define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ |
1639 | #define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ | 1634 | #define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ |
1640 | #define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezable */ | 1635 | #define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezable */ |
1636 | #define PF_SUSPEND_TASK 0x80000000 /* this thread called freeze_processes and should not be frozen */ | ||
1641 | 1637 | ||
1642 | /* | 1638 | /* |
1643 | * Only the _current_ task can read/write to tsk->flags, but other | 1639 | * Only the _current_ task can read/write to tsk->flags, but other |
@@ -1903,6 +1899,8 @@ extern struct task_struct *idle_task(int cpu); | |||
1903 | /** | 1899 | /** |
1904 | * is_idle_task - is the specified task an idle task? | 1900 | * is_idle_task - is the specified task an idle task? |
1905 | * @p: the task in question. | 1901 | * @p: the task in question. |
1902 | * | ||
1903 | * Return: 1 if @p is an idle task. 0 otherwise. | ||
1906 | */ | 1904 | */ |
1907 | static inline bool is_idle_task(const struct task_struct *p) | 1905 | static inline bool is_idle_task(const struct task_struct *p) |
1908 | { | 1906 | { |
@@ -1955,8 +1953,6 @@ extern struct task_struct *find_task_by_vpid(pid_t nr); | |||
1955 | extern struct task_struct *find_task_by_pid_ns(pid_t nr, | 1953 | extern struct task_struct *find_task_by_pid_ns(pid_t nr, |
1956 | struct pid_namespace *ns); | 1954 | struct pid_namespace *ns); |
1957 | 1955 | ||
1958 | extern void __set_special_pids(struct pid *pid); | ||
1959 | |||
1960 | /* per-UID process charging. */ | 1956 | /* per-UID process charging. */ |
1961 | extern struct user_struct * alloc_uid(kuid_t); | 1957 | extern struct user_struct * alloc_uid(kuid_t); |
1962 | static inline struct user_struct *get_uid(struct user_struct *u) | 1958 | static inline struct user_struct *get_uid(struct user_struct *u) |
@@ -2444,6 +2440,15 @@ extern int __cond_resched_softirq(void); | |||
2444 | __cond_resched_softirq(); \ | 2440 | __cond_resched_softirq(); \ |
2445 | }) | 2441 | }) |
2446 | 2442 | ||
2443 | static inline void cond_resched_rcu(void) | ||
2444 | { | ||
2445 | #if defined(CONFIG_DEBUG_ATOMIC_SLEEP) || !defined(CONFIG_PREEMPT_RCU) | ||
2446 | rcu_read_unlock(); | ||
2447 | cond_resched(); | ||
2448 | rcu_read_lock(); | ||
2449 | #endif | ||
2450 | } | ||
2451 | |||
2447 | /* | 2452 | /* |
2448 | * Does a critical section need to be broken due to another | 2453 | * Does a critical section need to be broken due to another |
2449 | * task waiting?: (technically does not depend on CONFIG_PREEMPT, | 2454 | * task waiting?: (technically does not depend on CONFIG_PREEMPT, |
diff --git a/include/linux/sched_clock.h b/include/linux/sched_clock.h new file mode 100644 index 000000000000..fa7922c80a41 --- /dev/null +++ b/include/linux/sched_clock.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * sched_clock.h: support for extending counters to full 64-bit ns counter | ||
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 | #ifndef LINUX_SCHED_CLOCK | ||
9 | #define LINUX_SCHED_CLOCK | ||
10 | |||
11 | #ifdef CONFIG_GENERIC_SCHED_CLOCK | ||
12 | extern void sched_clock_postinit(void); | ||
13 | #else | ||
14 | static inline void sched_clock_postinit(void) { } | ||
15 | #endif | ||
16 | |||
17 | extern void setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate); | ||
18 | |||
19 | extern unsigned long long (*sched_clock_func)(void); | ||
20 | |||
21 | #endif | ||
diff --git a/include/linux/sdb.h b/include/linux/sdb.h new file mode 100644 index 000000000000..fbb76a46c8a5 --- /dev/null +++ b/include/linux/sdb.h | |||
@@ -0,0 +1,159 @@ | |||
1 | /* | ||
2 | * This is the official version 1.1 of sdb.h | ||
3 | */ | ||
4 | #ifndef __SDB_H__ | ||
5 | #define __SDB_H__ | ||
6 | #ifdef __KERNEL__ | ||
7 | #include <linux/types.h> | ||
8 | #else | ||
9 | #include <stdint.h> | ||
10 | #endif | ||
11 | |||
12 | /* | ||
13 | * All structures are 64 bytes long and are expected | ||
14 | * to live in an array, one for each interconnect. | ||
15 | * Most fields of the structures are shared among the | ||
16 | * various types, and most-specific fields are at the | ||
17 | * beginning (for alignment reasons, and to keep the | ||
18 | * magic number at the head of the interconnect record | ||
19 | */ | ||
20 | |||
21 | /* Product, 40 bytes at offset 24, 8-byte aligned | ||
22 | * | ||
23 | * device_id is vendor-assigned; version is device-specific, | ||
24 | * date is hex (e.g 0x20120501), name is UTF-8, blank-filled | ||
25 | * and not terminated with a 0 byte. | ||
26 | */ | ||
27 | struct sdb_product { | ||
28 | uint64_t vendor_id; /* 0x18..0x1f */ | ||
29 | uint32_t device_id; /* 0x20..0x23 */ | ||
30 | uint32_t version; /* 0x24..0x27 */ | ||
31 | uint32_t date; /* 0x28..0x2b */ | ||
32 | uint8_t name[19]; /* 0x2c..0x3e */ | ||
33 | uint8_t record_type; /* 0x3f */ | ||
34 | }; | ||
35 | |||
36 | /* | ||
37 | * Component, 56 bytes at offset 8, 8-byte aligned | ||
38 | * | ||
39 | * The address range is first to last, inclusive | ||
40 | * (for example 0x100000 - 0x10ffff) | ||
41 | */ | ||
42 | struct sdb_component { | ||
43 | uint64_t addr_first; /* 0x08..0x0f */ | ||
44 | uint64_t addr_last; /* 0x10..0x17 */ | ||
45 | struct sdb_product product; /* 0x18..0x3f */ | ||
46 | }; | ||
47 | |||
48 | /* Type of the SDB record */ | ||
49 | enum sdb_record_type { | ||
50 | sdb_type_interconnect = 0x00, | ||
51 | sdb_type_device = 0x01, | ||
52 | sdb_type_bridge = 0x02, | ||
53 | sdb_type_integration = 0x80, | ||
54 | sdb_type_repo_url = 0x81, | ||
55 | sdb_type_synthesis = 0x82, | ||
56 | sdb_type_empty = 0xFF, | ||
57 | }; | ||
58 | |||
59 | /* Type 0: interconnect (first of the array) | ||
60 | * | ||
61 | * sdb_records is the length of the table including this first | ||
62 | * record, version is 1. The bus type is enumerated later. | ||
63 | */ | ||
64 | #define SDB_MAGIC 0x5344422d /* "SDB-" */ | ||
65 | struct sdb_interconnect { | ||
66 | uint32_t sdb_magic; /* 0x00-0x03 */ | ||
67 | uint16_t sdb_records; /* 0x04-0x05 */ | ||
68 | uint8_t sdb_version; /* 0x06 */ | ||
69 | uint8_t sdb_bus_type; /* 0x07 */ | ||
70 | struct sdb_component sdb_component; /* 0x08-0x3f */ | ||
71 | }; | ||
72 | |||
73 | /* Type 1: device | ||
74 | * | ||
75 | * class is 0 for "custom device", other values are | ||
76 | * to be standardized; ABI version is for the driver, | ||
77 | * bus-specific bits are defined by each bus (see below) | ||
78 | */ | ||
79 | struct sdb_device { | ||
80 | uint16_t abi_class; /* 0x00-0x01 */ | ||
81 | uint8_t abi_ver_major; /* 0x02 */ | ||
82 | uint8_t abi_ver_minor; /* 0x03 */ | ||
83 | uint32_t bus_specific; /* 0x04-0x07 */ | ||
84 | struct sdb_component sdb_component; /* 0x08-0x3f */ | ||
85 | }; | ||
86 | |||
87 | /* Type 2: bridge | ||
88 | * | ||
89 | * child is the address of the nested SDB table | ||
90 | */ | ||
91 | struct sdb_bridge { | ||
92 | uint64_t sdb_child; /* 0x00-0x07 */ | ||
93 | struct sdb_component sdb_component; /* 0x08-0x3f */ | ||
94 | }; | ||
95 | |||
96 | /* Type 0x80: integration | ||
97 | * | ||
98 | * all types with bit 7 set are meta-information, so | ||
99 | * software can ignore the types it doesn't know. Here we | ||
100 | * just provide product information for an aggregate device | ||
101 | */ | ||
102 | struct sdb_integration { | ||
103 | uint8_t reserved[24]; /* 0x00-0x17 */ | ||
104 | struct sdb_product product; /* 0x08-0x3f */ | ||
105 | }; | ||
106 | |||
107 | /* Type 0x81: Top module repository url | ||
108 | * | ||
109 | * again, an informative field that software can ignore | ||
110 | */ | ||
111 | struct sdb_repo_url { | ||
112 | uint8_t repo_url[63]; /* 0x00-0x3e */ | ||
113 | uint8_t record_type; /* 0x3f */ | ||
114 | }; | ||
115 | |||
116 | /* Type 0x82: Synthesis tool information | ||
117 | * | ||
118 | * this informative record | ||
119 | */ | ||
120 | struct sdb_synthesis { | ||
121 | uint8_t syn_name[16]; /* 0x00-0x0f */ | ||
122 | uint8_t commit_id[16]; /* 0x10-0x1f */ | ||
123 | uint8_t tool_name[8]; /* 0x20-0x27 */ | ||
124 | uint32_t tool_version; /* 0x28-0x2b */ | ||
125 | uint32_t date; /* 0x2c-0x2f */ | ||
126 | uint8_t user_name[15]; /* 0x30-0x3e */ | ||
127 | uint8_t record_type; /* 0x3f */ | ||
128 | }; | ||
129 | |||
130 | /* Type 0xff: empty | ||
131 | * | ||
132 | * this allows keeping empty slots during development, | ||
133 | * so they can be filled later with minimal efforts and | ||
134 | * no misleading description is ever shipped -- hopefully. | ||
135 | * It can also be used to pad a table to a desired length. | ||
136 | */ | ||
137 | struct sdb_empty { | ||
138 | uint8_t reserved[63]; /* 0x00-0x3e */ | ||
139 | uint8_t record_type; /* 0x3f */ | ||
140 | }; | ||
141 | |||
142 | /* The type of bus, for bus-specific flags */ | ||
143 | enum sdb_bus_type { | ||
144 | sdb_wishbone = 0x00, | ||
145 | sdb_data = 0x01, | ||
146 | }; | ||
147 | |||
148 | #define SDB_WB_WIDTH_MASK 0x0f | ||
149 | #define SDB_WB_ACCESS8 0x01 | ||
150 | #define SDB_WB_ACCESS16 0x02 | ||
151 | #define SDB_WB_ACCESS32 0x04 | ||
152 | #define SDB_WB_ACCESS64 0x08 | ||
153 | #define SDB_WB_LITTLE_ENDIAN 0x80 | ||
154 | |||
155 | #define SDB_DATA_READ 0x04 | ||
156 | #define SDB_DATA_WRITE 0x02 | ||
157 | #define SDB_DATA_EXEC 0x01 | ||
158 | |||
159 | #endif /* __SDB_H__ */ | ||
diff --git a/include/linux/security.h b/include/linux/security.h index 4686491852a7..7ce53ae1266b 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/capability.h> | 26 | #include <linux/capability.h> |
27 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
28 | #include <linux/err.h> | 28 | #include <linux/err.h> |
29 | #include <linux/string.h> | ||
29 | 30 | ||
30 | struct linux_binprm; | 31 | struct linux_binprm; |
31 | struct cred; | 32 | struct cred; |
@@ -60,6 +61,9 @@ struct mm_struct; | |||
60 | #define SECURITY_CAP_NOAUDIT 0 | 61 | #define SECURITY_CAP_NOAUDIT 0 |
61 | #define SECURITY_CAP_AUDIT 1 | 62 | #define SECURITY_CAP_AUDIT 1 |
62 | 63 | ||
64 | /* LSM Agnostic defines for sb_set_mnt_opts */ | ||
65 | #define SECURITY_LSM_NATIVE_LABELS 1 | ||
66 | |||
63 | struct ctl_table; | 67 | struct ctl_table; |
64 | struct audit_krule; | 68 | struct audit_krule; |
65 | struct user_namespace; | 69 | struct user_namespace; |
@@ -306,6 +310,15 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
306 | * Parse a string of security data filling in the opts structure | 310 | * Parse a string of security data filling in the opts structure |
307 | * @options string containing all mount options known by the LSM | 311 | * @options string containing all mount options known by the LSM |
308 | * @opts binary data structure usable by the LSM | 312 | * @opts binary data structure usable by the LSM |
313 | * @dentry_init_security: | ||
314 | * Compute a context for a dentry as the inode is not yet available | ||
315 | * since NFSv4 has no label backed by an EA anyway. | ||
316 | * @dentry dentry to use in calculating the context. | ||
317 | * @mode mode used to determine resource type. | ||
318 | * @name name of the last path component used to create file | ||
319 | * @ctx pointer to place the pointer to the resulting context in. | ||
320 | * @ctxlen point to place the length of the resulting context. | ||
321 | * | ||
309 | * | 322 | * |
310 | * Security hooks for inode operations. | 323 | * Security hooks for inode operations. |
311 | * | 324 | * |
@@ -1313,6 +1326,13 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
1313 | * @pages contains the number of pages. | 1326 | * @pages contains the number of pages. |
1314 | * Return 0 if permission is granted. | 1327 | * Return 0 if permission is granted. |
1315 | * | 1328 | * |
1329 | * @ismaclabel: | ||
1330 | * Check if the extended attribute specified by @name | ||
1331 | * represents a MAC label. Returns 1 if name is a MAC | ||
1332 | * attribute otherwise returns 0. | ||
1333 | * @name full extended attribute name to check against | ||
1334 | * LSM as a MAC label. | ||
1335 | * | ||
1316 | * @secid_to_secctx: | 1336 | * @secid_to_secctx: |
1317 | * Convert secid to security context. If secdata is NULL the length of | 1337 | * Convert secid to security context. If secdata is NULL the length of |
1318 | * the result will be returned in seclen, but no secdata will be returned. | 1338 | * the result will be returned in seclen, but no secdata will be returned. |
@@ -1392,7 +1412,8 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
1392 | * @ctxlen contains the length of @ctx. | 1412 | * @ctxlen contains the length of @ctx. |
1393 | * | 1413 | * |
1394 | * @inode_getsecctx: | 1414 | * @inode_getsecctx: |
1395 | * Returns a string containing all relevant security context information | 1415 | * On success, returns 0 and fills out @ctx and @ctxlen with the security |
1416 | * context for the given @inode. | ||
1396 | * | 1417 | * |
1397 | * @inode we wish to get the security context of. | 1418 | * @inode we wish to get the security context of. |
1398 | * @ctx is a pointer in which to place the allocated security context. | 1419 | * @ctx is a pointer in which to place the allocated security context. |
@@ -1439,10 +1460,16 @@ struct security_operations { | |||
1439 | int (*sb_pivotroot) (struct path *old_path, | 1460 | int (*sb_pivotroot) (struct path *old_path, |
1440 | struct path *new_path); | 1461 | struct path *new_path); |
1441 | int (*sb_set_mnt_opts) (struct super_block *sb, | 1462 | int (*sb_set_mnt_opts) (struct super_block *sb, |
1442 | struct security_mnt_opts *opts); | 1463 | struct security_mnt_opts *opts, |
1464 | unsigned long kern_flags, | ||
1465 | unsigned long *set_kern_flags); | ||
1443 | int (*sb_clone_mnt_opts) (const struct super_block *oldsb, | 1466 | int (*sb_clone_mnt_opts) (const struct super_block *oldsb, |
1444 | struct super_block *newsb); | 1467 | struct super_block *newsb); |
1445 | int (*sb_parse_opts_str) (char *options, struct security_mnt_opts *opts); | 1468 | int (*sb_parse_opts_str) (char *options, struct security_mnt_opts *opts); |
1469 | int (*dentry_init_security) (struct dentry *dentry, int mode, | ||
1470 | struct qstr *name, void **ctx, | ||
1471 | u32 *ctxlen); | ||
1472 | |||
1446 | 1473 | ||
1447 | #ifdef CONFIG_SECURITY_PATH | 1474 | #ifdef CONFIG_SECURITY_PATH |
1448 | int (*path_unlink) (struct path *dir, struct dentry *dentry); | 1475 | int (*path_unlink) (struct path *dir, struct dentry *dentry); |
@@ -1590,6 +1617,7 @@ struct security_operations { | |||
1590 | 1617 | ||
1591 | int (*getprocattr) (struct task_struct *p, char *name, char **value); | 1618 | int (*getprocattr) (struct task_struct *p, char *name, char **value); |
1592 | int (*setprocattr) (struct task_struct *p, char *name, void *value, size_t size); | 1619 | int (*setprocattr) (struct task_struct *p, char *name, void *value, size_t size); |
1620 | int (*ismaclabel) (const char *name); | ||
1593 | int (*secid_to_secctx) (u32 secid, char **secdata, u32 *seclen); | 1621 | int (*secid_to_secctx) (u32 secid, char **secdata, u32 *seclen); |
1594 | int (*secctx_to_secid) (const char *secdata, u32 seclen, u32 *secid); | 1622 | int (*secctx_to_secid) (const char *secdata, u32 seclen, u32 *secid); |
1595 | void (*release_secctx) (char *secdata, u32 seclen); | 1623 | void (*release_secctx) (char *secdata, u32 seclen); |
@@ -1725,10 +1753,16 @@ int security_sb_mount(const char *dev_name, struct path *path, | |||
1725 | const char *type, unsigned long flags, void *data); | 1753 | const char *type, unsigned long flags, void *data); |
1726 | int security_sb_umount(struct vfsmount *mnt, int flags); | 1754 | int security_sb_umount(struct vfsmount *mnt, int flags); |
1727 | int security_sb_pivotroot(struct path *old_path, struct path *new_path); | 1755 | int security_sb_pivotroot(struct path *old_path, struct path *new_path); |
1728 | int security_sb_set_mnt_opts(struct super_block *sb, struct security_mnt_opts *opts); | 1756 | int security_sb_set_mnt_opts(struct super_block *sb, |
1757 | struct security_mnt_opts *opts, | ||
1758 | unsigned long kern_flags, | ||
1759 | unsigned long *set_kern_flags); | ||
1729 | int security_sb_clone_mnt_opts(const struct super_block *oldsb, | 1760 | int security_sb_clone_mnt_opts(const struct super_block *oldsb, |
1730 | struct super_block *newsb); | 1761 | struct super_block *newsb); |
1731 | int security_sb_parse_opts_str(char *options, struct security_mnt_opts *opts); | 1762 | int security_sb_parse_opts_str(char *options, struct security_mnt_opts *opts); |
1763 | int security_dentry_init_security(struct dentry *dentry, int mode, | ||
1764 | struct qstr *name, void **ctx, | ||
1765 | u32 *ctxlen); | ||
1732 | 1766 | ||
1733 | int security_inode_alloc(struct inode *inode); | 1767 | int security_inode_alloc(struct inode *inode); |
1734 | void security_inode_free(struct inode *inode); | 1768 | void security_inode_free(struct inode *inode); |
@@ -1840,6 +1874,7 @@ void security_d_instantiate(struct dentry *dentry, struct inode *inode); | |||
1840 | int security_getprocattr(struct task_struct *p, char *name, char **value); | 1874 | int security_getprocattr(struct task_struct *p, char *name, char **value); |
1841 | int security_setprocattr(struct task_struct *p, char *name, void *value, size_t size); | 1875 | int security_setprocattr(struct task_struct *p, char *name, void *value, size_t size); |
1842 | int security_netlink_send(struct sock *sk, struct sk_buff *skb); | 1876 | int security_netlink_send(struct sock *sk, struct sk_buff *skb); |
1877 | int security_ismaclabel(const char *name); | ||
1843 | int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen); | 1878 | int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen); |
1844 | int security_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid); | 1879 | int security_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid); |
1845 | void security_release_secctx(char *secdata, u32 seclen); | 1880 | void security_release_secctx(char *secdata, u32 seclen); |
@@ -2011,7 +2046,9 @@ static inline int security_sb_pivotroot(struct path *old_path, | |||
2011 | } | 2046 | } |
2012 | 2047 | ||
2013 | static inline int security_sb_set_mnt_opts(struct super_block *sb, | 2048 | static inline int security_sb_set_mnt_opts(struct super_block *sb, |
2014 | struct security_mnt_opts *opts) | 2049 | struct security_mnt_opts *opts, |
2050 | unsigned long kern_flags, | ||
2051 | unsigned long *set_kern_flags) | ||
2015 | { | 2052 | { |
2016 | return 0; | 2053 | return 0; |
2017 | } | 2054 | } |
@@ -2035,6 +2072,16 @@ static inline int security_inode_alloc(struct inode *inode) | |||
2035 | static inline void security_inode_free(struct inode *inode) | 2072 | static inline void security_inode_free(struct inode *inode) |
2036 | { } | 2073 | { } |
2037 | 2074 | ||
2075 | static inline int security_dentry_init_security(struct dentry *dentry, | ||
2076 | int mode, | ||
2077 | struct qstr *name, | ||
2078 | void **ctx, | ||
2079 | u32 *ctxlen) | ||
2080 | { | ||
2081 | return -EOPNOTSUPP; | ||
2082 | } | ||
2083 | |||
2084 | |||
2038 | static inline int security_inode_init_security(struct inode *inode, | 2085 | static inline int security_inode_init_security(struct inode *inode, |
2039 | struct inode *dir, | 2086 | struct inode *dir, |
2040 | const struct qstr *qstr, | 2087 | const struct qstr *qstr, |
@@ -2520,6 +2567,11 @@ static inline int security_netlink_send(struct sock *sk, struct sk_buff *skb) | |||
2520 | return cap_netlink_send(sk, skb); | 2567 | return cap_netlink_send(sk, skb); |
2521 | } | 2568 | } |
2522 | 2569 | ||
2570 | static inline int security_ismaclabel(const char *name) | ||
2571 | { | ||
2572 | return 0; | ||
2573 | } | ||
2574 | |||
2523 | static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen) | 2575 | static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen) |
2524 | { | 2576 | { |
2525 | return -EOPNOTSUPP; | 2577 | return -EOPNOTSUPP; |
diff --git a/include/linux/sem.h b/include/linux/sem.h index 53d42650b193..976ce3a19f1b 100644 --- a/include/linux/sem.h +++ b/include/linux/sem.h | |||
@@ -12,10 +12,12 @@ struct task_struct; | |||
12 | struct sem_array { | 12 | struct sem_array { |
13 | struct kern_ipc_perm ____cacheline_aligned_in_smp | 13 | struct kern_ipc_perm ____cacheline_aligned_in_smp |
14 | sem_perm; /* permissions .. see ipc.h */ | 14 | sem_perm; /* permissions .. see ipc.h */ |
15 | time_t sem_otime; /* last semop time */ | ||
16 | time_t sem_ctime; /* last change time */ | 15 | time_t sem_ctime; /* last change time */ |
17 | struct sem *sem_base; /* ptr to first semaphore in array */ | 16 | struct sem *sem_base; /* ptr to first semaphore in array */ |
18 | struct list_head sem_pending; /* pending operations to be processed */ | 17 | struct list_head pending_alter; /* pending operations */ |
18 | /* that alter the array */ | ||
19 | struct list_head pending_const; /* pending complex operations */ | ||
20 | /* that do not alter semvals */ | ||
19 | struct list_head list_id; /* undo requests on this array */ | 21 | struct list_head list_id; /* undo requests on this array */ |
20 | int sem_nsems; /* no. of semaphores in array */ | 22 | int sem_nsems; /* no. of semaphores in array */ |
21 | int complex_count; /* pending complex operations */ | 23 | int complex_count; /* pending complex operations */ |
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 2da29ac178fc..4e32edc8f506 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
@@ -173,4 +173,10 @@ extern struct hlist_node *seq_hlist_start_head_rcu(struct hlist_head *head, | |||
173 | extern struct hlist_node *seq_hlist_next_rcu(void *v, | 173 | extern struct hlist_node *seq_hlist_next_rcu(void *v, |
174 | struct hlist_head *head, | 174 | struct hlist_head *head, |
175 | loff_t *ppos); | 175 | loff_t *ppos); |
176 | |||
177 | /* Helpers for iterating over per-cpu hlist_head-s in seq_files */ | ||
178 | extern struct hlist_node *seq_hlist_start_percpu(struct hlist_head __percpu *head, int *cpu, loff_t pos); | ||
179 | |||
180 | extern struct hlist_node *seq_hlist_next_percpu(void *v, struct hlist_head __percpu *head, int *cpu, loff_t *pos); | ||
181 | |||
176 | #endif | 182 | #endif |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 87d4bbc773fc..b98291ac7f14 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -31,6 +31,13 @@ | |||
31 | #include <linux/sysrq.h> | 31 | #include <linux/sysrq.h> |
32 | #include <uapi/linux/serial_core.h> | 32 | #include <uapi/linux/serial_core.h> |
33 | 33 | ||
34 | #ifdef CONFIG_SERIAL_CORE_CONSOLE | ||
35 | #define uart_console(port) \ | ||
36 | ((port)->cons && (port)->cons->index == (port)->line) | ||
37 | #else | ||
38 | #define uart_console(port) (0) | ||
39 | #endif | ||
40 | |||
34 | struct uart_port; | 41 | struct uart_port; |
35 | struct serial_struct; | 42 | struct serial_struct; |
36 | struct device; | 43 | struct device; |
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h index eb763adf9815..d34049712a4d 100644 --- a/include/linux/serial_sci.h +++ b/include/linux/serial_sci.h | |||
@@ -5,7 +5,7 @@ | |||
5 | #include <linux/sh_dma.h> | 5 | #include <linux/sh_dma.h> |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts) | 8 | * Generic header for SuperH (H)SCI(F) (used by sh/sh64/h8300 and related parts) |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #define SCIx_NOT_SUPPORTED (-1) | 11 | #define SCIx_NOT_SUPPORTED (-1) |
@@ -16,6 +16,7 @@ enum { | |||
16 | SCBRR_ALGO_3, /* (((clk * 2) + 16 * bps) / (16 * bps) - 1) */ | 16 | SCBRR_ALGO_3, /* (((clk * 2) + 16 * bps) / (16 * bps) - 1) */ |
17 | SCBRR_ALGO_4, /* (((clk * 2) + 16 * bps) / (32 * bps) - 1) */ | 17 | SCBRR_ALGO_4, /* (((clk * 2) + 16 * bps) / (32 * bps) - 1) */ |
18 | SCBRR_ALGO_5, /* (((clk * 1000 / 32) / bps) - 1) */ | 18 | SCBRR_ALGO_5, /* (((clk * 1000 / 32) / bps) - 1) */ |
19 | SCBRR_ALGO_6, /* HSCIF variable sample rate algorithm */ | ||
19 | }; | 20 | }; |
20 | 21 | ||
21 | #define SCSCR_TIE (1 << 7) | 22 | #define SCSCR_TIE (1 << 7) |
@@ -37,7 +38,7 @@ enum { | |||
37 | 38 | ||
38 | #define SCI_DEFAULT_ERROR_MASK (SCI_PER | SCI_FER) | 39 | #define SCI_DEFAULT_ERROR_MASK (SCI_PER | SCI_FER) |
39 | 40 | ||
40 | /* SCxSR SCIF */ | 41 | /* SCxSR SCIF, HSCIF */ |
41 | #define SCIF_ER 0x0080 | 42 | #define SCIF_ER 0x0080 |
42 | #define SCIF_TEND 0x0040 | 43 | #define SCIF_TEND 0x0040 |
43 | #define SCIF_TDFE 0x0020 | 44 | #define SCIF_TDFE 0x0020 |
@@ -55,6 +56,9 @@ enum { | |||
55 | #define SCSPTR_SPB2IO (1 << 1) | 56 | #define SCSPTR_SPB2IO (1 << 1) |
56 | #define SCSPTR_SPB2DT (1 << 0) | 57 | #define SCSPTR_SPB2DT (1 << 0) |
57 | 58 | ||
59 | /* HSSRR HSCIF */ | ||
60 | #define HSCIF_SRE 0x8000 | ||
61 | |||
58 | /* Offsets into the sci_port->irqs array */ | 62 | /* Offsets into the sci_port->irqs array */ |
59 | enum { | 63 | enum { |
60 | SCIx_ERI_IRQ, | 64 | SCIx_ERI_IRQ, |
@@ -90,6 +94,7 @@ enum { | |||
90 | SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, | 94 | SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, |
91 | SCIx_SH4_SCIF_FIFODATA_REGTYPE, | 95 | SCIx_SH4_SCIF_FIFODATA_REGTYPE, |
92 | SCIx_SH7705_SCIF_REGTYPE, | 96 | SCIx_SH7705_SCIF_REGTYPE, |
97 | SCIx_HSCIF_REGTYPE, | ||
93 | 98 | ||
94 | SCIx_NR_REGTYPES, | 99 | SCIx_NR_REGTYPES, |
95 | }; | 100 | }; |
@@ -115,6 +120,7 @@ enum { | |||
115 | SCSMR, SCBRR, SCSCR, SCxSR, | 120 | SCSMR, SCBRR, SCSCR, SCxSR, |
116 | SCFCR, SCFDR, SCxTDR, SCxRDR, | 121 | SCFCR, SCFDR, SCxTDR, SCxRDR, |
117 | SCLSR, SCTFDR, SCRFDR, SCSPTR, | 122 | SCLSR, SCTFDR, SCRFDR, SCSPTR, |
123 | HSSRR, | ||
118 | 124 | ||
119 | SCIx_NR_REGS, | 125 | SCIx_NR_REGS, |
120 | }; | 126 | }; |
@@ -137,7 +143,7 @@ struct plat_sci_port { | |||
137 | unsigned long mapbase; /* resource base */ | 143 | unsigned long mapbase; /* resource base */ |
138 | unsigned int irqs[SCIx_NR_IRQS]; /* ERI, RXI, TXI, BRI */ | 144 | unsigned int irqs[SCIx_NR_IRQS]; /* ERI, RXI, TXI, BRI */ |
139 | unsigned int gpios[SCIx_NR_FNS]; /* SCK, RXD, TXD, CTS, RTS */ | 145 | unsigned int gpios[SCIx_NR_FNS]; /* SCK, RXD, TXD, CTS, RTS */ |
140 | unsigned int type; /* SCI / SCIF / IRDA */ | 146 | unsigned int type; /* SCI / SCIF / IRDA / HSCIF */ |
141 | upf_t flags; /* UPF_* flags */ | 147 | upf_t flags; /* UPF_* flags */ |
142 | unsigned long capabilities; /* Port features/capabilities */ | 148 | unsigned long capabilities; /* Port features/capabilities */ |
143 | 149 | ||
diff --git a/include/linux/sh_dma.h b/include/linux/sh_dma.h index b64d6bec6f90..4e83f3e034f3 100644 --- a/include/linux/sh_dma.h +++ b/include/linux/sh_dma.h | |||
@@ -99,6 +99,4 @@ struct sh_dmae_pdata { | |||
99 | #define CHCR_TE 0x00000002 | 99 | #define CHCR_TE 0x00000002 |
100 | #define CHCR_IE 0x00000004 | 100 | #define CHCR_IE 0x00000004 |
101 | 101 | ||
102 | bool shdma_chan_filter(struct dma_chan *chan, void *arg); | ||
103 | |||
104 | #endif | 102 | #endif |
diff --git a/include/linux/shdma-base.h b/include/linux/shdma-base.h index a3728bf66f0e..5b1c9848124c 100644 --- a/include/linux/shdma-base.h +++ b/include/linux/shdma-base.h | |||
@@ -68,6 +68,8 @@ struct shdma_chan { | |||
68 | int id; /* Raw id of this channel */ | 68 | int id; /* Raw id of this channel */ |
69 | int irq; /* Channel IRQ */ | 69 | int irq; /* Channel IRQ */ |
70 | int slave_id; /* Client ID for slave DMA */ | 70 | int slave_id; /* Client ID for slave DMA */ |
71 | int hw_req; /* DMA request line for slave DMA - same | ||
72 | * as MID/RID, used with DT */ | ||
71 | enum shdma_pm_state pm_state; | 73 | enum shdma_pm_state pm_state; |
72 | }; | 74 | }; |
73 | 75 | ||
@@ -122,5 +124,10 @@ void shdma_chan_remove(struct shdma_chan *schan); | |||
122 | int shdma_init(struct device *dev, struct shdma_dev *sdev, | 124 | int shdma_init(struct device *dev, struct shdma_dev *sdev, |
123 | int chan_num); | 125 | int chan_num); |
124 | void shdma_cleanup(struct shdma_dev *sdev); | 126 | void shdma_cleanup(struct shdma_dev *sdev); |
127 | #if IS_ENABLED(CONFIG_SH_DMAE_BASE) | ||
128 | bool shdma_chan_filter(struct dma_chan *chan, void *arg); | ||
129 | #else | ||
130 | #define shdma_chan_filter NULL | ||
131 | #endif | ||
125 | 132 | ||
126 | #endif | 133 | #endif |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index dec1748cd002..3b71a4e83642 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -319,6 +319,8 @@ enum { | |||
319 | SKB_GSO_GRE = 1 << 6, | 319 | SKB_GSO_GRE = 1 << 6, |
320 | 320 | ||
321 | SKB_GSO_UDP_TUNNEL = 1 << 7, | 321 | SKB_GSO_UDP_TUNNEL = 1 << 7, |
322 | |||
323 | SKB_GSO_MPLS = 1 << 8, | ||
322 | }; | 324 | }; |
323 | 325 | ||
324 | #if BITS_PER_LONG > 32 | 326 | #if BITS_PER_LONG > 32 |
@@ -384,11 +386,13 @@ typedef unsigned char *sk_buff_data_t; | |||
384 | * @no_fcs: Request NIC to treat last 4 bytes as Ethernet FCS | 386 | * @no_fcs: Request NIC to treat last 4 bytes as Ethernet FCS |
385 | * @dma_cookie: a cookie to one of several possible DMA operations | 387 | * @dma_cookie: a cookie to one of several possible DMA operations |
386 | * done by skb DMA functions | 388 | * done by skb DMA functions |
389 | * @napi_id: id of the NAPI struct this skb came from | ||
387 | * @secmark: security marking | 390 | * @secmark: security marking |
388 | * @mark: Generic packet mark | 391 | * @mark: Generic packet mark |
389 | * @dropcount: total number of sk_receive_queue overflows | 392 | * @dropcount: total number of sk_receive_queue overflows |
390 | * @vlan_proto: vlan encapsulation protocol | 393 | * @vlan_proto: vlan encapsulation protocol |
391 | * @vlan_tci: vlan tag control information | 394 | * @vlan_tci: vlan tag control information |
395 | * @inner_protocol: Protocol (encapsulation) | ||
392 | * @inner_transport_header: Inner transport layer header (encapsulation) | 396 | * @inner_transport_header: Inner transport layer header (encapsulation) |
393 | * @inner_network_header: Network layer header (encapsulation) | 397 | * @inner_network_header: Network layer header (encapsulation) |
394 | * @inner_mac_header: Link layer header (encapsulation) | 398 | * @inner_mac_header: Link layer header (encapsulation) |
@@ -497,8 +501,11 @@ struct sk_buff { | |||
497 | /* 7/9 bit hole (depending on ndisc_nodetype presence) */ | 501 | /* 7/9 bit hole (depending on ndisc_nodetype presence) */ |
498 | kmemcheck_bitfield_end(flags2); | 502 | kmemcheck_bitfield_end(flags2); |
499 | 503 | ||
500 | #ifdef CONFIG_NET_DMA | 504 | #if defined CONFIG_NET_DMA || defined CONFIG_NET_RX_BUSY_POLL |
501 | dma_cookie_t dma_cookie; | 505 | union { |
506 | unsigned int napi_id; | ||
507 | dma_cookie_t dma_cookie; | ||
508 | }; | ||
502 | #endif | 509 | #endif |
503 | #ifdef CONFIG_NETWORK_SECMARK | 510 | #ifdef CONFIG_NETWORK_SECMARK |
504 | __u32 secmark; | 511 | __u32 secmark; |
@@ -509,12 +516,13 @@ struct sk_buff { | |||
509 | __u32 reserved_tailroom; | 516 | __u32 reserved_tailroom; |
510 | }; | 517 | }; |
511 | 518 | ||
512 | sk_buff_data_t inner_transport_header; | 519 | __be16 inner_protocol; |
513 | sk_buff_data_t inner_network_header; | 520 | __u16 inner_transport_header; |
514 | sk_buff_data_t inner_mac_header; | 521 | __u16 inner_network_header; |
515 | sk_buff_data_t transport_header; | 522 | __u16 inner_mac_header; |
516 | sk_buff_data_t network_header; | 523 | __u16 transport_header; |
517 | sk_buff_data_t mac_header; | 524 | __u16 network_header; |
525 | __u16 mac_header; | ||
518 | /* These elements must be at the end, see alloc_skb() for details. */ | 526 | /* These elements must be at the end, see alloc_skb() for details. */ |
519 | sk_buff_data_t tail; | 527 | sk_buff_data_t tail; |
520 | sk_buff_data_t end; | 528 | sk_buff_data_t end; |
@@ -1388,6 +1396,7 @@ static inline void skb_set_tail_pointer(struct sk_buff *skb, const int offset) | |||
1388 | skb_reset_tail_pointer(skb); | 1396 | skb_reset_tail_pointer(skb); |
1389 | skb->tail += offset; | 1397 | skb->tail += offset; |
1390 | } | 1398 | } |
1399 | |||
1391 | #else /* NET_SKBUFF_DATA_USES_OFFSET */ | 1400 | #else /* NET_SKBUFF_DATA_USES_OFFSET */ |
1392 | static inline unsigned char *skb_tail_pointer(const struct sk_buff *skb) | 1401 | static inline unsigned char *skb_tail_pointer(const struct sk_buff *skb) |
1393 | { | 1402 | { |
@@ -1528,7 +1537,6 @@ static inline void skb_reset_mac_len(struct sk_buff *skb) | |||
1528 | skb->mac_len = skb->network_header - skb->mac_header; | 1537 | skb->mac_len = skb->network_header - skb->mac_header; |
1529 | } | 1538 | } |
1530 | 1539 | ||
1531 | #ifdef NET_SKBUFF_DATA_USES_OFFSET | ||
1532 | static inline unsigned char *skb_inner_transport_header(const struct sk_buff | 1540 | static inline unsigned char *skb_inner_transport_header(const struct sk_buff |
1533 | *skb) | 1541 | *skb) |
1534 | { | 1542 | { |
@@ -1582,7 +1590,7 @@ static inline void skb_set_inner_mac_header(struct sk_buff *skb, | |||
1582 | } | 1590 | } |
1583 | static inline bool skb_transport_header_was_set(const struct sk_buff *skb) | 1591 | static inline bool skb_transport_header_was_set(const struct sk_buff *skb) |
1584 | { | 1592 | { |
1585 | return skb->transport_header != ~0U; | 1593 | return skb->transport_header != (typeof(skb->transport_header))~0U; |
1586 | } | 1594 | } |
1587 | 1595 | ||
1588 | static inline unsigned char *skb_transport_header(const struct sk_buff *skb) | 1596 | static inline unsigned char *skb_transport_header(const struct sk_buff *skb) |
@@ -1625,7 +1633,7 @@ static inline unsigned char *skb_mac_header(const struct sk_buff *skb) | |||
1625 | 1633 | ||
1626 | static inline int skb_mac_header_was_set(const struct sk_buff *skb) | 1634 | static inline int skb_mac_header_was_set(const struct sk_buff *skb) |
1627 | { | 1635 | { |
1628 | return skb->mac_header != ~0U; | 1636 | return skb->mac_header != (typeof(skb->mac_header))~0U; |
1629 | } | 1637 | } |
1630 | 1638 | ||
1631 | static inline void skb_reset_mac_header(struct sk_buff *skb) | 1639 | static inline void skb_reset_mac_header(struct sk_buff *skb) |
@@ -1639,112 +1647,6 @@ static inline void skb_set_mac_header(struct sk_buff *skb, const int offset) | |||
1639 | skb->mac_header += offset; | 1647 | skb->mac_header += offset; |
1640 | } | 1648 | } |
1641 | 1649 | ||
1642 | #else /* NET_SKBUFF_DATA_USES_OFFSET */ | ||
1643 | static inline unsigned char *skb_inner_transport_header(const struct sk_buff | ||
1644 | *skb) | ||
1645 | { | ||
1646 | return skb->inner_transport_header; | ||
1647 | } | ||
1648 | |||
1649 | static inline void skb_reset_inner_transport_header(struct sk_buff *skb) | ||
1650 | { | ||
1651 | skb->inner_transport_header = skb->data; | ||
1652 | } | ||
1653 | |||
1654 | static inline void skb_set_inner_transport_header(struct sk_buff *skb, | ||
1655 | const int offset) | ||
1656 | { | ||
1657 | skb->inner_transport_header = skb->data + offset; | ||
1658 | } | ||
1659 | |||
1660 | static inline unsigned char *skb_inner_network_header(const struct sk_buff *skb) | ||
1661 | { | ||
1662 | return skb->inner_network_header; | ||
1663 | } | ||
1664 | |||
1665 | static inline void skb_reset_inner_network_header(struct sk_buff *skb) | ||
1666 | { | ||
1667 | skb->inner_network_header = skb->data; | ||
1668 | } | ||
1669 | |||
1670 | static inline void skb_set_inner_network_header(struct sk_buff *skb, | ||
1671 | const int offset) | ||
1672 | { | ||
1673 | skb->inner_network_header = skb->data + offset; | ||
1674 | } | ||
1675 | |||
1676 | static inline unsigned char *skb_inner_mac_header(const struct sk_buff *skb) | ||
1677 | { | ||
1678 | return skb->inner_mac_header; | ||
1679 | } | ||
1680 | |||
1681 | static inline void skb_reset_inner_mac_header(struct sk_buff *skb) | ||
1682 | { | ||
1683 | skb->inner_mac_header = skb->data; | ||
1684 | } | ||
1685 | |||
1686 | static inline void skb_set_inner_mac_header(struct sk_buff *skb, | ||
1687 | const int offset) | ||
1688 | { | ||
1689 | skb->inner_mac_header = skb->data + offset; | ||
1690 | } | ||
1691 | static inline bool skb_transport_header_was_set(const struct sk_buff *skb) | ||
1692 | { | ||
1693 | return skb->transport_header != NULL; | ||
1694 | } | ||
1695 | |||
1696 | static inline unsigned char *skb_transport_header(const struct sk_buff *skb) | ||
1697 | { | ||
1698 | return skb->transport_header; | ||
1699 | } | ||
1700 | |||
1701 | static inline void skb_reset_transport_header(struct sk_buff *skb) | ||
1702 | { | ||
1703 | skb->transport_header = skb->data; | ||
1704 | } | ||
1705 | |||
1706 | static inline void skb_set_transport_header(struct sk_buff *skb, | ||
1707 | const int offset) | ||
1708 | { | ||
1709 | skb->transport_header = skb->data + offset; | ||
1710 | } | ||
1711 | |||
1712 | static inline unsigned char *skb_network_header(const struct sk_buff *skb) | ||
1713 | { | ||
1714 | return skb->network_header; | ||
1715 | } | ||
1716 | |||
1717 | static inline void skb_reset_network_header(struct sk_buff *skb) | ||
1718 | { | ||
1719 | skb->network_header = skb->data; | ||
1720 | } | ||
1721 | |||
1722 | static inline void skb_set_network_header(struct sk_buff *skb, const int offset) | ||
1723 | { | ||
1724 | skb->network_header = skb->data + offset; | ||
1725 | } | ||
1726 | |||
1727 | static inline unsigned char *skb_mac_header(const struct sk_buff *skb) | ||
1728 | { | ||
1729 | return skb->mac_header; | ||
1730 | } | ||
1731 | |||
1732 | static inline int skb_mac_header_was_set(const struct sk_buff *skb) | ||
1733 | { | ||
1734 | return skb->mac_header != NULL; | ||
1735 | } | ||
1736 | |||
1737 | static inline void skb_reset_mac_header(struct sk_buff *skb) | ||
1738 | { | ||
1739 | skb->mac_header = skb->data; | ||
1740 | } | ||
1741 | |||
1742 | static inline void skb_set_mac_header(struct sk_buff *skb, const int offset) | ||
1743 | { | ||
1744 | skb->mac_header = skb->data + offset; | ||
1745 | } | ||
1746 | #endif /* NET_SKBUFF_DATA_USES_OFFSET */ | ||
1747 | |||
1748 | static inline void skb_probe_transport_header(struct sk_buff *skb, | 1650 | static inline void skb_probe_transport_header(struct sk_buff *skb, |
1749 | const int offset_hint) | 1651 | const int offset_hint) |
1750 | { | 1652 | { |
@@ -2483,6 +2385,7 @@ extern void skb_split(struct sk_buff *skb, | |||
2483 | struct sk_buff *skb1, const u32 len); | 2385 | struct sk_buff *skb1, const u32 len); |
2484 | extern int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, | 2386 | extern int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, |
2485 | int shiftlen); | 2387 | int shiftlen); |
2388 | extern void skb_scrub_packet(struct sk_buff *skb); | ||
2486 | 2389 | ||
2487 | extern struct sk_buff *skb_segment(struct sk_buff *skb, | 2390 | extern struct sk_buff *skb_segment(struct sk_buff *skb, |
2488 | netdev_features_t features); | 2391 | netdev_features_t features); |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 0c621752caa6..6c5cc0ea8713 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -169,11 +169,7 @@ struct kmem_cache { | |||
169 | struct list_head list; /* List of all slab caches on the system */ | 169 | struct list_head list; /* List of all slab caches on the system */ |
170 | }; | 170 | }; |
171 | 171 | ||
172 | #define KMALLOC_MAX_SIZE (1UL << 30) | 172 | #endif /* CONFIG_SLOB */ |
173 | |||
174 | #include <linux/slob_def.h> | ||
175 | |||
176 | #else /* CONFIG_SLOB */ | ||
177 | 173 | ||
178 | /* | 174 | /* |
179 | * Kmalloc array related definitions | 175 | * Kmalloc array related definitions |
@@ -195,7 +191,9 @@ struct kmem_cache { | |||
195 | #ifndef KMALLOC_SHIFT_LOW | 191 | #ifndef KMALLOC_SHIFT_LOW |
196 | #define KMALLOC_SHIFT_LOW 5 | 192 | #define KMALLOC_SHIFT_LOW 5 |
197 | #endif | 193 | #endif |
198 | #else | 194 | #endif |
195 | |||
196 | #ifdef CONFIG_SLUB | ||
199 | /* | 197 | /* |
200 | * SLUB allocates up to order 2 pages directly and otherwise | 198 | * SLUB allocates up to order 2 pages directly and otherwise |
201 | * passes the request to the page allocator. | 199 | * passes the request to the page allocator. |
@@ -207,6 +205,19 @@ struct kmem_cache { | |||
207 | #endif | 205 | #endif |
208 | #endif | 206 | #endif |
209 | 207 | ||
208 | #ifdef CONFIG_SLOB | ||
209 | /* | ||
210 | * SLOB passes all page size and larger requests to the page allocator. | ||
211 | * No kmalloc array is necessary since objects of different sizes can | ||
212 | * be allocated from the same page. | ||
213 | */ | ||
214 | #define KMALLOC_SHIFT_MAX 30 | ||
215 | #define KMALLOC_SHIFT_HIGH PAGE_SHIFT | ||
216 | #ifndef KMALLOC_SHIFT_LOW | ||
217 | #define KMALLOC_SHIFT_LOW 3 | ||
218 | #endif | ||
219 | #endif | ||
220 | |||
210 | /* Maximum allocatable size */ | 221 | /* Maximum allocatable size */ |
211 | #define KMALLOC_MAX_SIZE (1UL << KMALLOC_SHIFT_MAX) | 222 | #define KMALLOC_MAX_SIZE (1UL << KMALLOC_SHIFT_MAX) |
212 | /* Maximum size for which we actually use a slab cache */ | 223 | /* Maximum size for which we actually use a slab cache */ |
@@ -221,6 +232,7 @@ struct kmem_cache { | |||
221 | #define KMALLOC_MIN_SIZE (1 << KMALLOC_SHIFT_LOW) | 232 | #define KMALLOC_MIN_SIZE (1 << KMALLOC_SHIFT_LOW) |
222 | #endif | 233 | #endif |
223 | 234 | ||
235 | #ifndef CONFIG_SLOB | ||
224 | extern struct kmem_cache *kmalloc_caches[KMALLOC_SHIFT_HIGH + 1]; | 236 | extern struct kmem_cache *kmalloc_caches[KMALLOC_SHIFT_HIGH + 1]; |
225 | #ifdef CONFIG_ZONE_DMA | 237 | #ifdef CONFIG_ZONE_DMA |
226 | extern struct kmem_cache *kmalloc_dma_caches[KMALLOC_SHIFT_HIGH + 1]; | 238 | extern struct kmem_cache *kmalloc_dma_caches[KMALLOC_SHIFT_HIGH + 1]; |
@@ -275,13 +287,18 @@ static __always_inline int kmalloc_index(size_t size) | |||
275 | /* Will never be reached. Needed because the compiler may complain */ | 287 | /* Will never be reached. Needed because the compiler may complain */ |
276 | return -1; | 288 | return -1; |
277 | } | 289 | } |
290 | #endif /* !CONFIG_SLOB */ | ||
278 | 291 | ||
279 | #ifdef CONFIG_SLAB | 292 | #ifdef CONFIG_SLAB |
280 | #include <linux/slab_def.h> | 293 | #include <linux/slab_def.h> |
281 | #elif defined(CONFIG_SLUB) | 294 | #endif |
295 | |||
296 | #ifdef CONFIG_SLUB | ||
282 | #include <linux/slub_def.h> | 297 | #include <linux/slub_def.h> |
283 | #else | 298 | #endif |
284 | #error "Unknown slab allocator" | 299 | |
300 | #ifdef CONFIG_SLOB | ||
301 | #include <linux/slob_def.h> | ||
285 | #endif | 302 | #endif |
286 | 303 | ||
287 | /* | 304 | /* |
@@ -291,6 +308,7 @@ static __always_inline int kmalloc_index(size_t size) | |||
291 | */ | 308 | */ |
292 | static __always_inline int kmalloc_size(int n) | 309 | static __always_inline int kmalloc_size(int n) |
293 | { | 310 | { |
311 | #ifndef CONFIG_SLOB | ||
294 | if (n > 2) | 312 | if (n > 2) |
295 | return 1 << n; | 313 | return 1 << n; |
296 | 314 | ||
@@ -299,10 +317,9 @@ static __always_inline int kmalloc_size(int n) | |||
299 | 317 | ||
300 | if (n == 2 && KMALLOC_MIN_SIZE <= 64) | 318 | if (n == 2 && KMALLOC_MIN_SIZE <= 64) |
301 | return 192; | 319 | return 192; |
302 | 320 | #endif | |
303 | return 0; | 321 | return 0; |
304 | } | 322 | } |
305 | #endif /* !CONFIG_SLOB */ | ||
306 | 323 | ||
307 | /* | 324 | /* |
308 | * Setting ARCH_SLAB_MINALIGN in arch headers allows a different alignment. | 325 | * Setting ARCH_SLAB_MINALIGN in arch headers allows a different alignment. |
@@ -356,9 +373,8 @@ int cache_show(struct kmem_cache *s, struct seq_file *m); | |||
356 | void print_slabinfo_header(struct seq_file *m); | 373 | void print_slabinfo_header(struct seq_file *m); |
357 | 374 | ||
358 | /** | 375 | /** |
359 | * kmalloc_array - allocate memory for an array. | 376 | * kmalloc - allocate memory |
360 | * @n: number of elements. | 377 | * @size: how many bytes of memory are required. |
361 | * @size: element size. | ||
362 | * @flags: the type of memory to allocate. | 378 | * @flags: the type of memory to allocate. |
363 | * | 379 | * |
364 | * The @flags argument may be one of: | 380 | * The @flags argument may be one of: |
@@ -405,6 +421,17 @@ void print_slabinfo_header(struct seq_file *m); | |||
405 | * There are other flags available as well, but these are not intended | 421 | * There are other flags available as well, but these are not intended |
406 | * for general use, and so are not documented here. For a full list of | 422 | * for general use, and so are not documented here. For a full list of |
407 | * potential flags, always refer to linux/gfp.h. | 423 | * potential flags, always refer to linux/gfp.h. |
424 | * | ||
425 | * kmalloc is the normal method of allocating memory | ||
426 | * in the kernel. | ||
427 | */ | ||
428 | static __always_inline void *kmalloc(size_t size, gfp_t flags); | ||
429 | |||
430 | /** | ||
431 | * kmalloc_array - allocate memory for an array. | ||
432 | * @n: number of elements. | ||
433 | * @size: element size. | ||
434 | * @flags: the type of memory to allocate (see kmalloc). | ||
408 | */ | 435 | */ |
409 | static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags) | 436 | static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags) |
410 | { | 437 | { |
@@ -428,7 +455,7 @@ static inline void *kcalloc(size_t n, size_t size, gfp_t flags) | |||
428 | /** | 455 | /** |
429 | * kmalloc_node - allocate memory from a specific node | 456 | * kmalloc_node - allocate memory from a specific node |
430 | * @size: how many bytes of memory are required. | 457 | * @size: how many bytes of memory are required. |
431 | * @flags: the type of memory to allocate (see kcalloc). | 458 | * @flags: the type of memory to allocate (see kmalloc). |
432 | * @node: node to allocate from. | 459 | * @node: node to allocate from. |
433 | * | 460 | * |
434 | * kmalloc() for non-local nodes, used to allocate from a specific node | 461 | * kmalloc() for non-local nodes, used to allocate from a specific node |
diff --git a/include/linux/slob_def.h b/include/linux/slob_def.h index f28e14a12e3f..095a5a4a8516 100644 --- a/include/linux/slob_def.h +++ b/include/linux/slob_def.h | |||
@@ -18,14 +18,6 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) | |||
18 | return __kmalloc_node(size, flags, node); | 18 | return __kmalloc_node(size, flags, node); |
19 | } | 19 | } |
20 | 20 | ||
21 | /** | ||
22 | * kmalloc - allocate memory | ||
23 | * @size: how many bytes of memory are required. | ||
24 | * @flags: the type of memory to allocate (see kcalloc). | ||
25 | * | ||
26 | * kmalloc is the normal method of allocating memory | ||
27 | * in the kernel. | ||
28 | */ | ||
29 | static __always_inline void *kmalloc(size_t size, gfp_t flags) | 21 | static __always_inline void *kmalloc(size_t size, gfp_t flags) |
30 | { | 22 | { |
31 | return __kmalloc_node(size, flags, NUMA_NO_NODE); | 23 | return __kmalloc_node(size, flags, NUMA_NO_NODE); |
diff --git a/include/linux/smp.h b/include/linux/smp.h index c8488763277f..c181399f2c20 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -11,7 +11,6 @@ | |||
11 | #include <linux/list.h> | 11 | #include <linux/list.h> |
12 | #include <linux/cpumask.h> | 12 | #include <linux/cpumask.h> |
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/irqflags.h> | ||
15 | 14 | ||
16 | extern void cpu_idle(void); | 15 | extern void cpu_idle(void); |
17 | 16 | ||
@@ -140,17 +139,14 @@ static inline int up_smp_call_function(smp_call_func_t func, void *info) | |||
140 | } | 139 | } |
141 | #define smp_call_function(func, info, wait) \ | 140 | #define smp_call_function(func, info, wait) \ |
142 | (up_smp_call_function(func, info)) | 141 | (up_smp_call_function(func, info)) |
143 | 142 | #define on_each_cpu(func, info, wait) \ | |
144 | static inline int on_each_cpu(smp_call_func_t func, void *info, int wait) | 143 | ({ \ |
145 | { | 144 | unsigned long __flags; \ |
146 | unsigned long flags; | 145 | local_irq_save(__flags); \ |
147 | 146 | func(info); \ | |
148 | local_irq_save(flags); | 147 | local_irq_restore(__flags); \ |
149 | func(info); | 148 | 0; \ |
150 | local_irq_restore(flags); | 149 | }) |
151 | return 0; | ||
152 | } | ||
153 | |||
154 | /* | 150 | /* |
155 | * Note we still need to test the mask even for UP | 151 | * Note we still need to test the mask even for UP |
156 | * because we actually can get an empty mask from | 152 | * because we actually can get an empty mask from |
diff --git a/include/linux/socket.h b/include/linux/socket.h index b10ce4b341ea..230c04bda3e2 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -167,6 +167,7 @@ struct ucred { | |||
167 | #define AF_PPPOX 24 /* PPPoX sockets */ | 167 | #define AF_PPPOX 24 /* PPPoX sockets */ |
168 | #define AF_WANPIPE 25 /* Wanpipe API Sockets */ | 168 | #define AF_WANPIPE 25 /* Wanpipe API Sockets */ |
169 | #define AF_LLC 26 /* Linux LLC */ | 169 | #define AF_LLC 26 /* Linux LLC */ |
170 | #define AF_IB 27 /* Native InfiniBand address */ | ||
170 | #define AF_CAN 29 /* Controller Area Network */ | 171 | #define AF_CAN 29 /* Controller Area Network */ |
171 | #define AF_TIPC 30 /* TIPC sockets */ | 172 | #define AF_TIPC 30 /* TIPC sockets */ |
172 | #define AF_BLUETOOTH 31 /* Bluetooth sockets */ | 173 | #define AF_BLUETOOTH 31 /* Bluetooth sockets */ |
@@ -211,6 +212,7 @@ struct ucred { | |||
211 | #define PF_PPPOX AF_PPPOX | 212 | #define PF_PPPOX AF_PPPOX |
212 | #define PF_WANPIPE AF_WANPIPE | 213 | #define PF_WANPIPE AF_WANPIPE |
213 | #define PF_LLC AF_LLC | 214 | #define PF_LLC AF_LLC |
215 | #define PF_IB AF_IB | ||
214 | #define PF_CAN AF_CAN | 216 | #define PF_CAN AF_CAN |
215 | #define PF_TIPC AF_TIPC | 217 | #define PF_TIPC AF_TIPC |
216 | #define PF_BLUETOOTH AF_BLUETOOTH | 218 | #define PF_BLUETOOTH AF_BLUETOOTH |
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 6ff26c8db7b9..28e440be1c07 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -308,6 +308,9 @@ struct spi_master { | |||
308 | 308 | ||
309 | /* bitmask of supported bits_per_word for transfers */ | 309 | /* bitmask of supported bits_per_word for transfers */ |
310 | u32 bits_per_word_mask; | 310 | u32 bits_per_word_mask; |
311 | #define SPI_BPW_MASK(bits) BIT((bits) - 1) | ||
312 | #define SPI_BIT_MASK(bits) (((bits) == 32) ? ~0UL : (BIT(bits) - 1)) | ||
313 | #define SPI_BPW_RANGE_MASK(min, max) (SPI_BIT_MASK(max) - SPI_BIT_MASK(min - 1)) | ||
311 | 314 | ||
312 | /* other constraints relevant to this driver */ | 315 | /* other constraints relevant to this driver */ |
313 | u16 flags; | 316 | u16 flags; |
diff --git a/include/linux/spi/xilinx_spi.h b/include/linux/spi/xilinx_spi.h index 6f17278810b0..333ecdfee0d9 100644 --- a/include/linux/spi/xilinx_spi.h +++ b/include/linux/spi/xilinx_spi.h | |||
@@ -11,7 +11,6 @@ | |||
11 | */ | 11 | */ |
12 | struct xspi_platform_data { | 12 | struct xspi_platform_data { |
13 | u16 num_chipselect; | 13 | u16 num_chipselect; |
14 | bool little_endian; | ||
15 | u8 bits_per_word; | 14 | u8 bits_per_word; |
16 | struct spi_board_info *devices; | 15 | struct spi_board_info *devices; |
17 | u8 num_devices; | 16 | u8 num_devices; |
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 7d537ced949a..75f34949d9ab 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
@@ -117,9 +117,17 @@ do { \ | |||
117 | #endif /*arch_spin_is_contended*/ | 117 | #endif /*arch_spin_is_contended*/ |
118 | #endif | 118 | #endif |
119 | 119 | ||
120 | /* The lock does not imply full memory barrier. */ | 120 | /* |
121 | #ifndef ARCH_HAS_SMP_MB_AFTER_LOCK | 121 | * Despite its name it doesn't necessarily has to be a full barrier. |
122 | static inline void smp_mb__after_lock(void) { smp_mb(); } | 122 | * It should only guarantee that a STORE before the critical section |
123 | * can not be reordered with a LOAD inside this section. | ||
124 | * spin_lock() is the one-way barrier, this LOAD can not escape out | ||
125 | * of the region. So the default implementation simply ensures that | ||
126 | * a STORE can not move into the critical section, smp_wmb() should | ||
127 | * serialize it with another STORE done by spin_lock(). | ||
128 | */ | ||
129 | #ifndef smp_mb__before_spinlock | ||
130 | #define smp_mb__before_spinlock() smp_wmb() | ||
123 | #endif | 131 | #endif |
124 | 132 | ||
125 | /** | 133 | /** |
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h index 51df117abe46..bdb9993f0fda 100644 --- a/include/linux/spinlock_api_smp.h +++ b/include/linux/spinlock_api_smp.h | |||
@@ -144,7 +144,7 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock) | |||
144 | LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); | 144 | LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); |
145 | } | 145 | } |
146 | 146 | ||
147 | #endif /* CONFIG_PREEMPT */ | 147 | #endif /* !CONFIG_GENERIC_LOCKBREAK || CONFIG_DEBUG_LOCK_ALLOC */ |
148 | 148 | ||
149 | static inline void __raw_spin_unlock(raw_spinlock_t *lock) | 149 | static inline void __raw_spin_unlock(raw_spinlock_t *lock) |
150 | { | 150 | { |
diff --git a/include/linux/spinlock_up.h b/include/linux/spinlock_up.h index e2369c167dbd..8b3ac0d718eb 100644 --- a/include/linux/spinlock_up.h +++ b/include/linux/spinlock_up.h | |||
@@ -67,7 +67,7 @@ static inline void arch_spin_unlock(arch_spinlock_t *lock) | |||
67 | 67 | ||
68 | #else /* DEBUG_SPINLOCK */ | 68 | #else /* DEBUG_SPINLOCK */ |
69 | #define arch_spin_is_locked(lock) ((void)(lock), 0) | 69 | #define arch_spin_is_locked(lock) ((void)(lock), 0) |
70 | /* for sched.c and kernel_lock.c: */ | 70 | /* for sched/core.c and kernel_lock.c: */ |
71 | # define arch_spin_lock(lock) do { barrier(); (void)(lock); } while (0) | 71 | # define arch_spin_lock(lock) do { barrier(); (void)(lock); } while (0) |
72 | # define arch_spin_lock_flags(lock, flags) do { barrier(); (void)(lock); } while (0) | 72 | # define arch_spin_lock_flags(lock, flags) do { barrier(); (void)(lock); } while (0) |
73 | # define arch_spin_unlock(lock) do { barrier(); (void)(lock); } while (0) | 73 | # define arch_spin_unlock(lock) do { barrier(); (void)(lock); } while (0) |
diff --git a/include/linux/srcu.h b/include/linux/srcu.h index 04f4121a23ae..c114614ed172 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h | |||
@@ -237,47 +237,4 @@ static inline void srcu_read_unlock(struct srcu_struct *sp, int idx) | |||
237 | __srcu_read_unlock(sp, idx); | 237 | __srcu_read_unlock(sp, idx); |
238 | } | 238 | } |
239 | 239 | ||
240 | /** | ||
241 | * srcu_read_lock_raw - register a new reader for an SRCU-protected structure. | ||
242 | * @sp: srcu_struct in which to register the new reader. | ||
243 | * | ||
244 | * Enter an SRCU read-side critical section. Similar to srcu_read_lock(), | ||
245 | * but avoids the RCU-lockdep checking. This means that it is legal to | ||
246 | * use srcu_read_lock_raw() in one context, for example, in an exception | ||
247 | * handler, and then have the matching srcu_read_unlock_raw() in another | ||
248 | * context, for example in the task that took the exception. | ||
249 | * | ||
250 | * However, the entire SRCU read-side critical section must reside within a | ||
251 | * single task. For example, beware of using srcu_read_lock_raw() in | ||
252 | * a device interrupt handler and srcu_read_unlock() in the interrupted | ||
253 | * task: This will not work if interrupts are threaded. | ||
254 | */ | ||
255 | static inline int srcu_read_lock_raw(struct srcu_struct *sp) | ||
256 | { | ||
257 | unsigned long flags; | ||
258 | int ret; | ||
259 | |||
260 | local_irq_save(flags); | ||
261 | ret = __srcu_read_lock(sp); | ||
262 | local_irq_restore(flags); | ||
263 | return ret; | ||
264 | } | ||
265 | |||
266 | /** | ||
267 | * srcu_read_unlock_raw - unregister reader from an SRCU-protected structure. | ||
268 | * @sp: srcu_struct in which to unregister the old reader. | ||
269 | * @idx: return value from corresponding srcu_read_lock_raw(). | ||
270 | * | ||
271 | * Exit an SRCU read-side critical section without lockdep-RCU checking. | ||
272 | * See srcu_read_lock_raw() for more details. | ||
273 | */ | ||
274 | static inline void srcu_read_unlock_raw(struct srcu_struct *sp, int idx) | ||
275 | { | ||
276 | unsigned long flags; | ||
277 | |||
278 | local_irq_save(flags); | ||
279 | __srcu_read_unlock(sp, idx); | ||
280 | local_irq_restore(flags); | ||
281 | } | ||
282 | |||
283 | #endif | 240 | #endif |
diff --git a/include/linux/ssb/ssb_driver_mips.h b/include/linux/ssb/ssb_driver_mips.h index afe79d40a99e..6535e4718fde 100644 --- a/include/linux/ssb/ssb_driver_mips.h +++ b/include/linux/ssb/ssb_driver_mips.h | |||
@@ -20,6 +20,18 @@ struct ssb_pflash { | |||
20 | u32 window_size; | 20 | u32 window_size; |
21 | }; | 21 | }; |
22 | 22 | ||
23 | #ifdef CONFIG_SSB_SFLASH | ||
24 | struct ssb_sflash { | ||
25 | bool present; | ||
26 | u32 window; | ||
27 | u32 blocksize; | ||
28 | u16 numblocks; | ||
29 | u32 size; | ||
30 | |||
31 | void *priv; | ||
32 | }; | ||
33 | #endif | ||
34 | |||
23 | struct ssb_mipscore { | 35 | struct ssb_mipscore { |
24 | struct ssb_device *dev; | 36 | struct ssb_device *dev; |
25 | 37 | ||
@@ -27,6 +39,9 @@ struct ssb_mipscore { | |||
27 | struct ssb_serial_port serial_ports[4]; | 39 | struct ssb_serial_port serial_ports[4]; |
28 | 40 | ||
29 | struct ssb_pflash pflash; | 41 | struct ssb_pflash pflash; |
42 | #ifdef CONFIG_SSB_SFLASH | ||
43 | struct ssb_sflash sflash; | ||
44 | #endif | ||
30 | }; | 45 | }; |
31 | 46 | ||
32 | extern void ssb_mipscore_init(struct ssb_mipscore *mcore); | 47 | extern void ssb_mipscore_init(struct ssb_mipscore *mcore); |
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h index 3a7256955b10..f9f931c89e3e 100644 --- a/include/linux/ssb/ssb_regs.h +++ b/include/linux/ssb/ssb_regs.h | |||
@@ -172,6 +172,7 @@ | |||
172 | #define SSB_SPROMSIZE_WORDS_R4 220 | 172 | #define SSB_SPROMSIZE_WORDS_R4 220 |
173 | #define SSB_SPROMSIZE_BYTES_R123 (SSB_SPROMSIZE_WORDS_R123 * sizeof(u16)) | 173 | #define SSB_SPROMSIZE_BYTES_R123 (SSB_SPROMSIZE_WORDS_R123 * sizeof(u16)) |
174 | #define SSB_SPROMSIZE_BYTES_R4 (SSB_SPROMSIZE_WORDS_R4 * sizeof(u16)) | 174 | #define SSB_SPROMSIZE_BYTES_R4 (SSB_SPROMSIZE_WORDS_R4 * sizeof(u16)) |
175 | #define SSB_SPROMSIZE_WORDS_R10 230 | ||
175 | #define SSB_SPROM_BASE1 0x1000 | 176 | #define SSB_SPROM_BASE1 0x1000 |
176 | #define SSB_SPROM_BASE31 0x0800 | 177 | #define SSB_SPROM_BASE31 0x0800 |
177 | #define SSB_SPROM_REVISION 0x007E | 178 | #define SSB_SPROM_REVISION 0x007E |
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index c1b3ed3fb787..9e495d31516e 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h | |||
@@ -80,6 +80,10 @@ struct stmmac_mdio_bus_data { | |||
80 | unsigned int phy_mask; | 80 | unsigned int phy_mask; |
81 | int *irqs; | 81 | int *irqs; |
82 | int probed_phy_irq; | 82 | int probed_phy_irq; |
83 | #ifdef CONFIG_OF | ||
84 | int reset_gpio, active_low; | ||
85 | u32 delays[3]; | ||
86 | #endif | ||
83 | }; | 87 | }; |
84 | 88 | ||
85 | struct stmmac_dma_cfg { | 89 | struct stmmac_dma_cfg { |
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index 303399b1ba59..6ce690de447f 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h | |||
@@ -57,6 +57,7 @@ struct cache_head { | |||
57 | #define CACHE_VALID 0 /* Entry contains valid data */ | 57 | #define CACHE_VALID 0 /* Entry contains valid data */ |
58 | #define CACHE_NEGATIVE 1 /* Negative entry - there is no match for the key */ | 58 | #define CACHE_NEGATIVE 1 /* Negative entry - there is no match for the key */ |
59 | #define CACHE_PENDING 2 /* An upcall has been sent but no reply received yet*/ | 59 | #define CACHE_PENDING 2 /* An upcall has been sent but no reply received yet*/ |
60 | #define CACHE_CLEANED 3 /* Entry has been cleaned from cache */ | ||
60 | 61 | ||
61 | #define CACHE_NEW_EXPIRY 120 /* keep new things pending confirmation for 120 seconds */ | 62 | #define CACHE_NEW_EXPIRY 120 /* keep new things pending confirmation for 120 seconds */ |
62 | 63 | ||
@@ -148,6 +149,24 @@ struct cache_deferred_req { | |||
148 | int too_many); | 149 | int too_many); |
149 | }; | 150 | }; |
150 | 151 | ||
152 | /* | ||
153 | * timestamps kept in the cache are expressed in seconds | ||
154 | * since boot. This is the best for measuring differences in | ||
155 | * real time. | ||
156 | */ | ||
157 | static inline time_t seconds_since_boot(void) | ||
158 | { | ||
159 | struct timespec boot; | ||
160 | getboottime(&boot); | ||
161 | return get_seconds() - boot.tv_sec; | ||
162 | } | ||
163 | |||
164 | static inline time_t convert_to_wallclock(time_t sinceboot) | ||
165 | { | ||
166 | struct timespec boot; | ||
167 | getboottime(&boot); | ||
168 | return boot.tv_sec + sinceboot; | ||
169 | } | ||
151 | 170 | ||
152 | extern const struct file_operations cache_file_operations_pipefs; | 171 | extern const struct file_operations cache_file_operations_pipefs; |
153 | extern const struct file_operations content_file_operations_pipefs; | 172 | extern const struct file_operations content_file_operations_pipefs; |
@@ -181,15 +200,10 @@ static inline void cache_put(struct cache_head *h, struct cache_detail *cd) | |||
181 | kref_put(&h->ref, cd->cache_put); | 200 | kref_put(&h->ref, cd->cache_put); |
182 | } | 201 | } |
183 | 202 | ||
184 | static inline int cache_valid(struct cache_head *h) | 203 | static inline int cache_is_expired(struct cache_detail *detail, struct cache_head *h) |
185 | { | 204 | { |
186 | /* If an item has been unhashed pending removal when | 205 | return (h->expiry_time < seconds_since_boot()) || |
187 | * the refcount drops to 0, the expiry_time will be | 206 | (detail->flush_time > h->last_refresh); |
188 | * set to 0. We don't want to consider such items | ||
189 | * valid in this context even though CACHE_VALID is | ||
190 | * set. | ||
191 | */ | ||
192 | return (h->expiry_time != 0 && test_bit(CACHE_VALID, &h->flags)); | ||
193 | } | 207 | } |
194 | 208 | ||
195 | extern int cache_check(struct cache_detail *detail, | 209 | extern int cache_check(struct cache_detail *detail, |
@@ -250,25 +264,6 @@ static inline int get_uint(char **bpp, unsigned int *anint) | |||
250 | return 0; | 264 | return 0; |
251 | } | 265 | } |
252 | 266 | ||
253 | /* | ||
254 | * timestamps kept in the cache are expressed in seconds | ||
255 | * since boot. This is the best for measuring differences in | ||
256 | * real time. | ||
257 | */ | ||
258 | static inline time_t seconds_since_boot(void) | ||
259 | { | ||
260 | struct timespec boot; | ||
261 | getboottime(&boot); | ||
262 | return get_seconds() - boot.tv_sec; | ||
263 | } | ||
264 | |||
265 | static inline time_t convert_to_wallclock(time_t sinceboot) | ||
266 | { | ||
267 | struct timespec boot; | ||
268 | getboottime(&boot); | ||
269 | return boot.tv_sec + sinceboot; | ||
270 | } | ||
271 | |||
272 | static inline time_t get_expiry(char **bpp) | 267 | static inline time_t get_expiry(char **bpp) |
273 | { | 268 | { |
274 | int rv; | 269 | int rv; |
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h index 161463e59624..1f911ccb2a75 100644 --- a/include/linux/sunrpc/gss_api.h +++ b/include/linux/sunrpc/gss_api.h | |||
@@ -151,6 +151,8 @@ struct gss_api_mech *gss_mech_get_by_pseudoflavor(u32); | |||
151 | /* Fill in an array with a list of supported pseudoflavors */ | 151 | /* Fill in an array with a list of supported pseudoflavors */ |
152 | int gss_mech_list_pseudoflavors(rpc_authflavor_t *, int); | 152 | int gss_mech_list_pseudoflavors(rpc_authflavor_t *, int); |
153 | 153 | ||
154 | struct gss_api_mech * gss_mech_get(struct gss_api_mech *); | ||
155 | |||
154 | /* For every successful gss_mech_get or gss_mech_get_by_* call there must be a | 156 | /* For every successful gss_mech_get or gss_mech_get_by_* call there must be a |
155 | * corresponding call to gss_mech_put. */ | 157 | * corresponding call to gss_mech_put. */ |
156 | void gss_mech_put(struct gss_api_mech *); | 158 | void gss_mech_put(struct gss_api_mech *); |
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h index a7b422b33eda..aa5b582cc471 100644 --- a/include/linux/sunrpc/rpc_pipe_fs.h +++ b/include/linux/sunrpc/rpc_pipe_fs.h | |||
@@ -73,12 +73,12 @@ extern ssize_t rpc_pipe_generic_upcall(struct file *, struct rpc_pipe_msg *, | |||
73 | extern int rpc_queue_upcall(struct rpc_pipe *, struct rpc_pipe_msg *); | 73 | extern int rpc_queue_upcall(struct rpc_pipe *, struct rpc_pipe_msg *); |
74 | 74 | ||
75 | struct rpc_clnt; | 75 | struct rpc_clnt; |
76 | extern struct dentry *rpc_create_client_dir(struct dentry *, struct qstr *, struct rpc_clnt *); | 76 | extern struct dentry *rpc_create_client_dir(struct dentry *, const char *, struct rpc_clnt *); |
77 | extern int rpc_remove_client_dir(struct dentry *); | 77 | extern int rpc_remove_client_dir(struct dentry *); |
78 | 78 | ||
79 | struct cache_detail; | 79 | struct cache_detail; |
80 | extern struct dentry *rpc_create_cache_dir(struct dentry *, | 80 | extern struct dentry *rpc_create_cache_dir(struct dentry *, |
81 | struct qstr *, | 81 | const char *, |
82 | umode_t umode, | 82 | umode_t umode, |
83 | struct cache_detail *); | 83 | struct cache_detail *); |
84 | extern void rpc_remove_cache_dir(struct dentry *); | 84 | extern void rpc_remove_cache_dir(struct dentry *); |
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 84ca436b76c2..1821445708d6 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
@@ -88,15 +88,6 @@ struct rpc_task { | |||
88 | tk_rebind_retry : 2; | 88 | tk_rebind_retry : 2; |
89 | }; | 89 | }; |
90 | 90 | ||
91 | /* support walking a list of tasks on a wait queue */ | ||
92 | #define task_for_each(task, pos, head) \ | ||
93 | list_for_each(pos, head) \ | ||
94 | if ((task=list_entry(pos, struct rpc_task, u.tk_wait.list)),1) | ||
95 | |||
96 | #define task_for_first(task, head) \ | ||
97 | if (!list_empty(head) && \ | ||
98 | ((task=list_entry((head)->next, struct rpc_task, u.tk_wait.list)),1)) | ||
99 | |||
100 | typedef void (*rpc_action)(struct rpc_task *); | 91 | typedef void (*rpc_action)(struct rpc_task *); |
101 | 92 | ||
102 | struct rpc_call_ops { | 93 | struct rpc_call_ops { |
@@ -130,6 +121,7 @@ struct rpc_task_setup { | |||
130 | #define RPC_TASK_SOFTCONN 0x0400 /* Fail if can't connect */ | 121 | #define RPC_TASK_SOFTCONN 0x0400 /* Fail if can't connect */ |
131 | #define RPC_TASK_SENT 0x0800 /* message was sent */ | 122 | #define RPC_TASK_SENT 0x0800 /* message was sent */ |
132 | #define RPC_TASK_TIMEOUT 0x1000 /* fail with ETIMEDOUT on timeout */ | 123 | #define RPC_TASK_TIMEOUT 0x1000 /* fail with ETIMEDOUT on timeout */ |
124 | #define RPC_TASK_NOCONNECT 0x2000 /* return ENOTCONN if not connected */ | ||
133 | 125 | ||
134 | #define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC) | 126 | #define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC) |
135 | #define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER) | 127 | #define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER) |
@@ -238,7 +230,6 @@ struct rpc_task *rpc_wake_up_first(struct rpc_wait_queue *, | |||
238 | bool (*)(struct rpc_task *, void *), | 230 | bool (*)(struct rpc_task *, void *), |
239 | void *); | 231 | void *); |
240 | void rpc_wake_up_status(struct rpc_wait_queue *, int); | 232 | void rpc_wake_up_status(struct rpc_wait_queue *, int); |
241 | int rpc_queue_empty(struct rpc_wait_queue *); | ||
242 | void rpc_delay(struct rpc_task *, unsigned long); | 233 | void rpc_delay(struct rpc_task *, unsigned long); |
243 | void * rpc_malloc(struct rpc_task *, size_t); | 234 | void * rpc_malloc(struct rpc_task *, size_t); |
244 | void rpc_free(void *); | 235 | void rpc_free(void *); |
@@ -259,16 +250,6 @@ static inline int rpc_wait_for_completion_task(struct rpc_task *task) | |||
259 | return __rpc_wait_for_completion_task(task, NULL); | 250 | return __rpc_wait_for_completion_task(task, NULL); |
260 | } | 251 | } |
261 | 252 | ||
262 | static inline void rpc_task_set_priority(struct rpc_task *task, unsigned char prio) | ||
263 | { | ||
264 | task->tk_priority = prio - RPC_PRIORITY_LOW; | ||
265 | } | ||
266 | |||
267 | static inline int rpc_task_has_priority(struct rpc_task *task, unsigned char prio) | ||
268 | { | ||
269 | return (task->tk_priority + RPC_PRIORITY_LOW == prio); | ||
270 | } | ||
271 | |||
272 | #if defined(RPC_DEBUG) || defined (RPC_TRACEPOINTS) | 253 | #if defined(RPC_DEBUG) || defined (RPC_TRACEPOINTS) |
273 | static inline const char * rpc_qname(const struct rpc_wait_queue *q) | 254 | static inline const char * rpc_qname(const struct rpc_wait_queue *q) |
274 | { | 255 | { |
diff --git a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h index ff374ab30839..8d71d6577459 100644 --- a/include/linux/sunrpc/svcauth.h +++ b/include/linux/sunrpc/svcauth.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/string.h> | 14 | #include <linux/string.h> |
15 | #include <linux/sunrpc/msg_prot.h> | 15 | #include <linux/sunrpc/msg_prot.h> |
16 | #include <linux/sunrpc/cache.h> | 16 | #include <linux/sunrpc/cache.h> |
17 | #include <linux/sunrpc/gss_api.h> | ||
17 | #include <linux/hash.h> | 18 | #include <linux/hash.h> |
18 | #include <linux/cred.h> | 19 | #include <linux/cred.h> |
19 | 20 | ||
@@ -23,13 +24,23 @@ struct svc_cred { | |||
23 | struct group_info *cr_group_info; | 24 | struct group_info *cr_group_info; |
24 | u32 cr_flavor; /* pseudoflavor */ | 25 | u32 cr_flavor; /* pseudoflavor */ |
25 | char *cr_principal; /* for gss */ | 26 | char *cr_principal; /* for gss */ |
27 | struct gss_api_mech *cr_gss_mech; | ||
26 | }; | 28 | }; |
27 | 29 | ||
30 | static inline void init_svc_cred(struct svc_cred *cred) | ||
31 | { | ||
32 | cred->cr_group_info = NULL; | ||
33 | cred->cr_principal = NULL; | ||
34 | cred->cr_gss_mech = NULL; | ||
35 | } | ||
36 | |||
28 | static inline void free_svc_cred(struct svc_cred *cred) | 37 | static inline void free_svc_cred(struct svc_cred *cred) |
29 | { | 38 | { |
30 | if (cred->cr_group_info) | 39 | if (cred->cr_group_info) |
31 | put_group_info(cred->cr_group_info); | 40 | put_group_info(cred->cr_group_info); |
32 | kfree(cred->cr_principal); | 41 | kfree(cred->cr_principal); |
42 | gss_mech_put(cred->cr_gss_mech); | ||
43 | init_svc_cred(cred); | ||
33 | } | 44 | } |
34 | 45 | ||
35 | struct svc_rqst; /* forward decl */ | 46 | struct svc_rqst; /* forward decl */ |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index d4e3f16d5e89..f73cabf59012 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -363,6 +363,7 @@ extern bool pm_wakeup_pending(void); | |||
363 | extern bool pm_get_wakeup_count(unsigned int *count, bool block); | 363 | extern bool pm_get_wakeup_count(unsigned int *count, bool block); |
364 | extern bool pm_save_wakeup_count(unsigned int count); | 364 | extern bool pm_save_wakeup_count(unsigned int count); |
365 | extern void pm_wakep_autosleep_enabled(bool set); | 365 | extern void pm_wakep_autosleep_enabled(bool set); |
366 | extern void pm_print_active_wakeup_sources(void); | ||
366 | 367 | ||
367 | static inline void lock_system_sleep(void) | 368 | static inline void lock_system_sleep(void) |
368 | { | 369 | { |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 1701ce4be746..d95cde5e257d 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/node.h> | 10 | #include <linux/node.h> |
11 | #include <linux/fs.h> | 11 | #include <linux/fs.h> |
12 | #include <linux/atomic.h> | 12 | #include <linux/atomic.h> |
13 | #include <linux/page-flags.h> | ||
13 | #include <asm/page.h> | 14 | #include <asm/page.h> |
14 | 15 | ||
15 | struct notifier_block; | 16 | struct notifier_block; |
@@ -19,10 +20,13 @@ struct bio; | |||
19 | #define SWAP_FLAG_PREFER 0x8000 /* set if swap priority specified */ | 20 | #define SWAP_FLAG_PREFER 0x8000 /* set if swap priority specified */ |
20 | #define SWAP_FLAG_PRIO_MASK 0x7fff | 21 | #define SWAP_FLAG_PRIO_MASK 0x7fff |
21 | #define SWAP_FLAG_PRIO_SHIFT 0 | 22 | #define SWAP_FLAG_PRIO_SHIFT 0 |
22 | #define SWAP_FLAG_DISCARD 0x10000 /* discard swap cluster after use */ | 23 | #define SWAP_FLAG_DISCARD 0x10000 /* enable discard for swap */ |
24 | #define SWAP_FLAG_DISCARD_ONCE 0x20000 /* discard swap area at swapon-time */ | ||
25 | #define SWAP_FLAG_DISCARD_PAGES 0x40000 /* discard page-clusters after use */ | ||
23 | 26 | ||
24 | #define SWAP_FLAGS_VALID (SWAP_FLAG_PRIO_MASK | SWAP_FLAG_PREFER | \ | 27 | #define SWAP_FLAGS_VALID (SWAP_FLAG_PRIO_MASK | SWAP_FLAG_PREFER | \ |
25 | SWAP_FLAG_DISCARD) | 28 | SWAP_FLAG_DISCARD | SWAP_FLAG_DISCARD_ONCE | \ |
29 | SWAP_FLAG_DISCARD_PAGES) | ||
26 | 30 | ||
27 | static inline int current_is_kswapd(void) | 31 | static inline int current_is_kswapd(void) |
28 | { | 32 | { |
@@ -146,14 +150,16 @@ struct swap_extent { | |||
146 | enum { | 150 | enum { |
147 | SWP_USED = (1 << 0), /* is slot in swap_info[] used? */ | 151 | SWP_USED = (1 << 0), /* is slot in swap_info[] used? */ |
148 | SWP_WRITEOK = (1 << 1), /* ok to write to this swap? */ | 152 | SWP_WRITEOK = (1 << 1), /* ok to write to this swap? */ |
149 | SWP_DISCARDABLE = (1 << 2), /* swapon+blkdev support discard */ | 153 | SWP_DISCARDABLE = (1 << 2), /* blkdev support discard */ |
150 | SWP_DISCARDING = (1 << 3), /* now discarding a free cluster */ | 154 | SWP_DISCARDING = (1 << 3), /* now discarding a free cluster */ |
151 | SWP_SOLIDSTATE = (1 << 4), /* blkdev seeks are cheap */ | 155 | SWP_SOLIDSTATE = (1 << 4), /* blkdev seeks are cheap */ |
152 | SWP_CONTINUED = (1 << 5), /* swap_map has count continuation */ | 156 | SWP_CONTINUED = (1 << 5), /* swap_map has count continuation */ |
153 | SWP_BLKDEV = (1 << 6), /* its a block device */ | 157 | SWP_BLKDEV = (1 << 6), /* its a block device */ |
154 | SWP_FILE = (1 << 7), /* set after swap_activate success */ | 158 | SWP_FILE = (1 << 7), /* set after swap_activate success */ |
159 | SWP_AREA_DISCARD = (1 << 8), /* single-time swap area discards */ | ||
160 | SWP_PAGE_DISCARD = (1 << 9), /* freed swap page-cluster discards */ | ||
155 | /* add others here before... */ | 161 | /* add others here before... */ |
156 | SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */ | 162 | SWP_SCANNING = (1 << 10), /* refcount in scan_swap_map */ |
157 | }; | 163 | }; |
158 | 164 | ||
159 | #define SWAP_CLUSTER_MAX 32UL | 165 | #define SWAP_CLUSTER_MAX 32UL |
@@ -233,8 +239,8 @@ extern unsigned long nr_free_pagecache_pages(void); | |||
233 | 239 | ||
234 | 240 | ||
235 | /* linux/mm/swap.c */ | 241 | /* linux/mm/swap.c */ |
236 | extern void __lru_cache_add(struct page *, enum lru_list lru); | 242 | extern void __lru_cache_add(struct page *); |
237 | extern void lru_cache_add_lru(struct page *, enum lru_list lru); | 243 | extern void lru_cache_add(struct page *); |
238 | extern void lru_add_page_tail(struct page *page, struct page *page_tail, | 244 | extern void lru_add_page_tail(struct page *page, struct page *page_tail, |
239 | struct lruvec *lruvec, struct list_head *head); | 245 | struct lruvec *lruvec, struct list_head *head); |
240 | extern void activate_page(struct page *); | 246 | extern void activate_page(struct page *); |
@@ -254,12 +260,14 @@ extern void add_page_to_unevictable_list(struct page *page); | |||
254 | */ | 260 | */ |
255 | static inline void lru_cache_add_anon(struct page *page) | 261 | static inline void lru_cache_add_anon(struct page *page) |
256 | { | 262 | { |
257 | __lru_cache_add(page, LRU_INACTIVE_ANON); | 263 | ClearPageActive(page); |
264 | __lru_cache_add(page); | ||
258 | } | 265 | } |
259 | 266 | ||
260 | static inline void lru_cache_add_file(struct page *page) | 267 | static inline void lru_cache_add_file(struct page *page) |
261 | { | 268 | { |
262 | __lru_cache_add(page, LRU_INACTIVE_FILE); | 269 | ClearPageActive(page); |
270 | __lru_cache_add(page); | ||
263 | } | 271 | } |
264 | 272 | ||
265 | /* linux/mm/vmscan.c */ | 273 | /* linux/mm/vmscan.c */ |
diff --git a/include/linux/swapops.h b/include/linux/swapops.h index c5fd30d2a415..8d4fa82bfb91 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h | |||
@@ -67,6 +67,8 @@ static inline swp_entry_t pte_to_swp_entry(pte_t pte) | |||
67 | swp_entry_t arch_entry; | 67 | swp_entry_t arch_entry; |
68 | 68 | ||
69 | BUG_ON(pte_file(pte)); | 69 | BUG_ON(pte_file(pte)); |
70 | if (pte_swp_soft_dirty(pte)) | ||
71 | pte = pte_swp_clear_soft_dirty(pte); | ||
70 | arch_entry = __pte_to_swp_entry(pte); | 72 | arch_entry = __pte_to_swp_entry(pte); |
71 | return swp_entry(__swp_type(arch_entry), __swp_offset(arch_entry)); | 73 | return swp_entry(__swp_type(arch_entry), __swp_offset(arch_entry)); |
72 | } | 74 | } |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 4147d700a293..84662ecc7b51 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -802,9 +802,14 @@ asmlinkage long sys_vfork(void); | |||
802 | asmlinkage long sys_clone(unsigned long, unsigned long, int __user *, int, | 802 | asmlinkage long sys_clone(unsigned long, unsigned long, int __user *, int, |
803 | int __user *); | 803 | int __user *); |
804 | #else | 804 | #else |
805 | #ifdef CONFIG_CLONE_BACKWARDS3 | ||
806 | asmlinkage long sys_clone(unsigned long, unsigned long, int, int __user *, | ||
807 | int __user *, int); | ||
808 | #else | ||
805 | asmlinkage long sys_clone(unsigned long, unsigned long, int __user *, | 809 | asmlinkage long sys_clone(unsigned long, unsigned long, int __user *, |
806 | int __user *, int); | 810 | int __user *, int); |
807 | #endif | 811 | #endif |
812 | #endif | ||
808 | 813 | ||
809 | asmlinkage long sys_execve(const char __user *filename, | 814 | asmlinkage long sys_execve(const char __user *filename, |
810 | const char __user *const __user *argv, | 815 | const char __user *const __user *argv, |
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index e2cee22f578a..9e8a9b555ad6 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -17,10 +17,12 @@ | |||
17 | #include <linux/list.h> | 17 | #include <linux/list.h> |
18 | #include <linux/lockdep.h> | 18 | #include <linux/lockdep.h> |
19 | #include <linux/kobject_ns.h> | 19 | #include <linux/kobject_ns.h> |
20 | #include <linux/stat.h> | ||
20 | #include <linux/atomic.h> | 21 | #include <linux/atomic.h> |
21 | 22 | ||
22 | struct kobject; | 23 | struct kobject; |
23 | struct module; | 24 | struct module; |
25 | struct bin_attribute; | ||
24 | enum kobj_ns_type; | 26 | enum kobj_ns_type; |
25 | 27 | ||
26 | struct attribute { | 28 | struct attribute { |
@@ -59,26 +61,28 @@ struct attribute_group { | |||
59 | umode_t (*is_visible)(struct kobject *, | 61 | umode_t (*is_visible)(struct kobject *, |
60 | struct attribute *, int); | 62 | struct attribute *, int); |
61 | struct attribute **attrs; | 63 | struct attribute **attrs; |
64 | struct bin_attribute **bin_attrs; | ||
62 | }; | 65 | }; |
63 | 66 | ||
64 | |||
65 | |||
66 | /** | 67 | /** |
67 | * Use these macros to make defining attributes easier. See include/linux/device.h | 68 | * Use these macros to make defining attributes easier. See include/linux/device.h |
68 | * for examples.. | 69 | * for examples.. |
69 | */ | 70 | */ |
70 | 71 | ||
71 | #define __ATTR(_name,_mode,_show,_store) { \ | 72 | #define __ATTR(_name,_mode,_show,_store) { \ |
72 | .attr = {.name = __stringify(_name), .mode = _mode }, \ | 73 | .attr = {.name = __stringify(_name), .mode = _mode }, \ |
73 | .show = _show, \ | 74 | .show = _show, \ |
74 | .store = _store, \ | 75 | .store = _store, \ |
75 | } | 76 | } |
76 | 77 | ||
77 | #define __ATTR_RO(_name) { \ | 78 | #define __ATTR_RO(_name) { \ |
78 | .attr = { .name = __stringify(_name), .mode = 0444 }, \ | 79 | .attr = { .name = __stringify(_name), .mode = S_IRUGO }, \ |
79 | .show = _name##_show, \ | 80 | .show = _name##_show, \ |
80 | } | 81 | } |
81 | 82 | ||
83 | #define __ATTR_RW(_name) __ATTR(_name, (S_IWUSR | S_IRUGO), \ | ||
84 | _name##_show, _name##_store) | ||
85 | |||
82 | #define __ATTR_NULL { .attr = { .name = NULL } } | 86 | #define __ATTR_NULL { .attr = { .name = NULL } } |
83 | 87 | ||
84 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 88 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
@@ -92,6 +96,18 @@ struct attribute_group { | |||
92 | #define __ATTR_IGNORE_LOCKDEP __ATTR | 96 | #define __ATTR_IGNORE_LOCKDEP __ATTR |
93 | #endif | 97 | #endif |
94 | 98 | ||
99 | #define __ATTRIBUTE_GROUPS(_name) \ | ||
100 | static const struct attribute_group *_name##_groups[] = { \ | ||
101 | &_name##_group, \ | ||
102 | NULL, \ | ||
103 | } | ||
104 | |||
105 | #define ATTRIBUTE_GROUPS(_name) \ | ||
106 | static const struct attribute_group _name##_group = { \ | ||
107 | .attrs = _name##_attrs, \ | ||
108 | }; \ | ||
109 | __ATTRIBUTE_GROUPS(_name) | ||
110 | |||
95 | #define attr_name(_attr) (_attr).attr.name | 111 | #define attr_name(_attr) (_attr).attr.name |
96 | 112 | ||
97 | struct file; | 113 | struct file; |
@@ -121,6 +137,36 @@ struct bin_attribute { | |||
121 | */ | 137 | */ |
122 | #define sysfs_bin_attr_init(bin_attr) sysfs_attr_init(&(bin_attr)->attr) | 138 | #define sysfs_bin_attr_init(bin_attr) sysfs_attr_init(&(bin_attr)->attr) |
123 | 139 | ||
140 | /* macros to create static binary attributes easier */ | ||
141 | #define __BIN_ATTR(_name, _mode, _read, _write, _size) { \ | ||
142 | .attr = { .name = __stringify(_name), .mode = _mode }, \ | ||
143 | .read = _read, \ | ||
144 | .write = _write, \ | ||
145 | .size = _size, \ | ||
146 | } | ||
147 | |||
148 | #define __BIN_ATTR_RO(_name, _size) { \ | ||
149 | .attr = { .name = __stringify(_name), .mode = S_IRUGO }, \ | ||
150 | .read = _name##_read, \ | ||
151 | .size = _size, \ | ||
152 | } | ||
153 | |||
154 | #define __BIN_ATTR_RW(_name, _size) __BIN_ATTR(_name, \ | ||
155 | (S_IWUSR | S_IRUGO), _name##_read, \ | ||
156 | _name##_write) | ||
157 | |||
158 | #define __BIN_ATTR_NULL __ATTR_NULL | ||
159 | |||
160 | #define BIN_ATTR(_name, _mode, _read, _write, _size) \ | ||
161 | struct bin_attribute bin_attr_##_name = __BIN_ATTR(_name, _mode, _read, \ | ||
162 | _write, _size) | ||
163 | |||
164 | #define BIN_ATTR_RO(_name, _size) \ | ||
165 | struct bin_attribute bin_attr_##_name = __BIN_ATTR_RO(_name, _size) | ||
166 | |||
167 | #define BIN_ATTR_RW(_name, _size) \ | ||
168 | struct bin_attribute bin_attr_##_name = __BIN_ATTR_RW(_name, _size) | ||
169 | |||
124 | struct sysfs_ops { | 170 | struct sysfs_ops { |
125 | ssize_t (*show)(struct kobject *, struct attribute *,char *); | 171 | ssize_t (*show)(struct kobject *, struct attribute *,char *); |
126 | ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); | 172 | ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 5adbc33d1ab3..472120b4fac5 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -246,7 +246,6 @@ struct tcp_sock { | |||
246 | 246 | ||
247 | /* from STCP, retrans queue hinting */ | 247 | /* from STCP, retrans queue hinting */ |
248 | struct sk_buff* lost_skb_hint; | 248 | struct sk_buff* lost_skb_hint; |
249 | struct sk_buff *scoreboard_skb_hint; | ||
250 | struct sk_buff *retransmit_skb_hint; | 249 | struct sk_buff *retransmit_skb_hint; |
251 | 250 | ||
252 | struct sk_buff_head out_of_order_queue; /* Out of order segments go here */ | 251 | struct sk_buff_head out_of_order_queue; /* Out of order segments go here */ |
diff --git a/include/linux/tick.h b/include/linux/tick.h index 9180f4b85e6d..62bd8b72873c 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h | |||
@@ -174,10 +174,4 @@ static inline void tick_nohz_task_switch(struct task_struct *tsk) { } | |||
174 | #endif | 174 | #endif |
175 | 175 | ||
176 | 176 | ||
177 | # ifdef CONFIG_CPU_IDLE_GOV_MENU | ||
178 | extern void menu_hrtimer_cancel(void); | ||
179 | # else | ||
180 | static inline void menu_hrtimer_cancel(void) {} | ||
181 | # endif /* CONFIG_CPU_IDLE_GOV_MENU */ | ||
182 | |||
183 | #endif | 177 | #endif |
diff --git a/include/linux/tpm.h b/include/linux/tpm.h index fcb627ff8d3e..9a9051bb1a03 100644 --- a/include/linux/tpm.h +++ b/include/linux/tpm.h | |||
@@ -22,6 +22,8 @@ | |||
22 | #ifndef __LINUX_TPM_H__ | 22 | #ifndef __LINUX_TPM_H__ |
23 | #define __LINUX_TPM_H__ | 23 | #define __LINUX_TPM_H__ |
24 | 24 | ||
25 | #define TPM_DIGEST_SIZE 20 /* Max TPM v1.2 PCR size */ | ||
26 | |||
25 | /* | 27 | /* |
26 | * Chip num is this value or a valid tpm idx | 28 | * Chip num is this value or a valid tpm idx |
27 | */ | 29 | */ |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index f8e084d0fc77..ebeab360d851 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -378,6 +378,8 @@ static inline void tracepoint_synchronize_unregister(void) | |||
378 | #define DECLARE_EVENT_CLASS(name, proto, args, tstruct, assign, print) | 378 | #define DECLARE_EVENT_CLASS(name, proto, args, tstruct, assign, print) |
379 | #define DEFINE_EVENT(template, name, proto, args) \ | 379 | #define DEFINE_EVENT(template, name, proto, args) \ |
380 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | 380 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
381 | #define DEFINE_EVENT_FN(template, name, proto, args, reg, unreg)\ | ||
382 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | ||
381 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | 383 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ |
382 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | 384 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
383 | #define DEFINE_EVENT_CONDITION(template, name, proto, \ | 385 | #define DEFINE_EVENT_CONDITION(template, name, proto, \ |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 8780bd2a272a..01ac30efd6a6 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -272,7 +272,6 @@ struct tty_struct { | |||
272 | #define N_TTY_BUF_SIZE 4096 | 272 | #define N_TTY_BUF_SIZE 4096 |
273 | 273 | ||
274 | unsigned char closing:1; | 274 | unsigned char closing:1; |
275 | unsigned short minimum_to_wake; | ||
276 | unsigned char *write_buf; | 275 | unsigned char *write_buf; |
277 | int write_cnt; | 276 | int write_cnt; |
278 | /* If the tty has a pending do_SAK, queue it here - akpm */ | 277 | /* If the tty has a pending do_SAK, queue it here - akpm */ |
@@ -309,8 +308,6 @@ struct tty_file_private { | |||
309 | #define TTY_LDISC 9 /* Line discipline attached */ | 308 | #define TTY_LDISC 9 /* Line discipline attached */ |
310 | #define TTY_LDISC_CHANGING 10 /* Line discipline changing */ | 309 | #define TTY_LDISC_CHANGING 10 /* Line discipline changing */ |
311 | #define TTY_LDISC_OPEN 11 /* Line discipline is open */ | 310 | #define TTY_LDISC_OPEN 11 /* Line discipline is open */ |
312 | #define TTY_HW_COOK_OUT 14 /* Hardware can do output cooking */ | ||
313 | #define TTY_HW_COOK_IN 15 /* Hardware can do input cooking */ | ||
314 | #define TTY_PTY_LOCK 16 /* pty private */ | 311 | #define TTY_PTY_LOCK 16 /* pty private */ |
315 | #define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */ | 312 | #define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */ |
316 | #define TTY_HUPPED 18 /* Post driver->hangup() */ | 313 | #define TTY_HUPPED 18 /* Post driver->hangup() */ |
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index 58390c73df8b..a1b048999821 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h | |||
@@ -100,6 +100,11 @@ | |||
100 | * seek to perform this action quickly but should wait until | 100 | * seek to perform this action quickly but should wait until |
101 | * any pending driver I/O is completed. | 101 | * any pending driver I/O is completed. |
102 | * | 102 | * |
103 | * void (*fasync)(struct tty_struct *, int on) | ||
104 | * | ||
105 | * Notify line discipline when signal-driven I/O is enabled or | ||
106 | * disabled. | ||
107 | * | ||
103 | * void (*dcd_change)(struct tty_struct *tty, unsigned int status) | 108 | * void (*dcd_change)(struct tty_struct *tty, unsigned int status) |
104 | * | 109 | * |
105 | * Tells the discipline that the DCD pin has changed its status. | 110 | * Tells the discipline that the DCD pin has changed its status. |
@@ -110,6 +115,52 @@ | |||
110 | #include <linux/wait.h> | 115 | #include <linux/wait.h> |
111 | #include <linux/wait.h> | 116 | #include <linux/wait.h> |
112 | 117 | ||
118 | |||
119 | /* | ||
120 | * the semaphore definition | ||
121 | */ | ||
122 | struct ld_semaphore { | ||
123 | long count; | ||
124 | raw_spinlock_t wait_lock; | ||
125 | unsigned int wait_readers; | ||
126 | struct list_head read_wait; | ||
127 | struct list_head write_wait; | ||
128 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
129 | struct lockdep_map dep_map; | ||
130 | #endif | ||
131 | }; | ||
132 | |||
133 | extern void __init_ldsem(struct ld_semaphore *sem, const char *name, | ||
134 | struct lock_class_key *key); | ||
135 | |||
136 | #define init_ldsem(sem) \ | ||
137 | do { \ | ||
138 | static struct lock_class_key __key; \ | ||
139 | \ | ||
140 | __init_ldsem((sem), #sem, &__key); \ | ||
141 | } while (0) | ||
142 | |||
143 | |||
144 | extern int ldsem_down_read(struct ld_semaphore *sem, long timeout); | ||
145 | extern int ldsem_down_read_trylock(struct ld_semaphore *sem); | ||
146 | extern int ldsem_down_write(struct ld_semaphore *sem, long timeout); | ||
147 | extern int ldsem_down_write_trylock(struct ld_semaphore *sem); | ||
148 | extern void ldsem_up_read(struct ld_semaphore *sem); | ||
149 | extern void ldsem_up_write(struct ld_semaphore *sem); | ||
150 | |||
151 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
152 | extern int ldsem_down_read_nested(struct ld_semaphore *sem, int subclass, | ||
153 | long timeout); | ||
154 | extern int ldsem_down_write_nested(struct ld_semaphore *sem, int subclass, | ||
155 | long timeout); | ||
156 | #else | ||
157 | # define ldsem_down_read_nested(sem, subclass, timeout) \ | ||
158 | ldsem_down_read(sem, timeout) | ||
159 | # define ldsem_down_write_nested(sem, subclass, timeout) \ | ||
160 | ldsem_down_write(sem, timeout) | ||
161 | #endif | ||
162 | |||
163 | |||
113 | struct tty_ldisc_ops { | 164 | struct tty_ldisc_ops { |
114 | int magic; | 165 | int magic; |
115 | char *name; | 166 | char *name; |
@@ -143,6 +194,7 @@ struct tty_ldisc_ops { | |||
143 | char *fp, int count); | 194 | char *fp, int count); |
144 | void (*write_wakeup)(struct tty_struct *); | 195 | void (*write_wakeup)(struct tty_struct *); |
145 | void (*dcd_change)(struct tty_struct *, unsigned int); | 196 | void (*dcd_change)(struct tty_struct *, unsigned int); |
197 | void (*fasync)(struct tty_struct *tty, int on); | ||
146 | 198 | ||
147 | struct module *owner; | 199 | struct module *owner; |
148 | 200 | ||
diff --git a/include/linux/usb.h b/include/linux/usb.h index a0bee5a28d1a..0eec2689b955 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -367,17 +367,6 @@ struct usb_bus { | |||
367 | 367 | ||
368 | /* ----------------------------------------------------------------------- */ | 368 | /* ----------------------------------------------------------------------- */ |
369 | 369 | ||
370 | /* This is arbitrary. | ||
371 | * From USB 2.0 spec Table 11-13, offset 7, a hub can | ||
372 | * have up to 255 ports. The most yet reported is 10. | ||
373 | * | ||
374 | * Current Wireless USB host hardware (Intel i1480 for example) allows | ||
375 | * up to 22 devices to connect. Upcoming hardware might raise that | ||
376 | * limit. Because the arrays need to add a bit for hub status data, we | ||
377 | * do 31, so plus one evens out to four bytes. | ||
378 | */ | ||
379 | #define USB_MAXCHILDREN (31) | ||
380 | |||
381 | struct usb_tt; | 370 | struct usb_tt; |
382 | 371 | ||
383 | enum usb_device_removable { | 372 | enum usb_device_removable { |
@@ -394,6 +383,22 @@ enum usb_port_connect_type { | |||
394 | }; | 383 | }; |
395 | 384 | ||
396 | /* | 385 | /* |
386 | * USB 2.0 Link Power Management (LPM) parameters. | ||
387 | */ | ||
388 | struct usb2_lpm_parameters { | ||
389 | /* Best effort service latency indicate how long the host will drive | ||
390 | * resume on an exit from L1. | ||
391 | */ | ||
392 | unsigned int besl; | ||
393 | |||
394 | /* Timeout value in microseconds for the L1 inactivity (LPM) timer. | ||
395 | * When the timer counts to zero, the parent hub will initiate a LPM | ||
396 | * transition to L1. | ||
397 | */ | ||
398 | int timeout; | ||
399 | }; | ||
400 | |||
401 | /* | ||
397 | * USB 3.0 Link Power Management (LPM) parameters. | 402 | * USB 3.0 Link Power Management (LPM) parameters. |
398 | * | 403 | * |
399 | * PEL and SEL are USB 3.0 Link PM latencies for device-initiated LPM exit. | 404 | * PEL and SEL are USB 3.0 Link PM latencies for device-initiated LPM exit. |
@@ -468,6 +473,7 @@ struct usb3_lpm_parameters { | |||
468 | * @wusb: device is Wireless USB | 473 | * @wusb: device is Wireless USB |
469 | * @lpm_capable: device supports LPM | 474 | * @lpm_capable: device supports LPM |
470 | * @usb2_hw_lpm_capable: device can perform USB2 hardware LPM | 475 | * @usb2_hw_lpm_capable: device can perform USB2 hardware LPM |
476 | * @usb2_hw_lpm_besl_capable: device can perform USB2 hardware BESL LPM | ||
471 | * @usb2_hw_lpm_enabled: USB2 hardware LPM enabled | 477 | * @usb2_hw_lpm_enabled: USB2 hardware LPM enabled |
472 | * @usb3_lpm_enabled: USB3 hardware LPM enabled | 478 | * @usb3_lpm_enabled: USB3 hardware LPM enabled |
473 | * @string_langid: language ID for strings | 479 | * @string_langid: language ID for strings |
@@ -487,6 +493,7 @@ struct usb3_lpm_parameters { | |||
487 | * specific data for the device. | 493 | * specific data for the device. |
488 | * @slot_id: Slot ID assigned by xHCI | 494 | * @slot_id: Slot ID assigned by xHCI |
489 | * @removable: Device can be physically removed from this port | 495 | * @removable: Device can be physically removed from this port |
496 | * @l1_params: best effor service latency for USB2 L1 LPM state, and L1 timeout. | ||
490 | * @u1_params: exit latencies for USB3 U1 LPM state, and hub-initiated timeout. | 497 | * @u1_params: exit latencies for USB3 U1 LPM state, and hub-initiated timeout. |
491 | * @u2_params: exit latencies for USB3 U2 LPM state, and hub-initiated timeout. | 498 | * @u2_params: exit latencies for USB3 U2 LPM state, and hub-initiated timeout. |
492 | * @lpm_disable_count: Ref count used by usb_disable_lpm() and usb_enable_lpm() | 499 | * @lpm_disable_count: Ref count used by usb_disable_lpm() and usb_enable_lpm() |
@@ -538,6 +545,7 @@ struct usb_device { | |||
538 | unsigned wusb:1; | 545 | unsigned wusb:1; |
539 | unsigned lpm_capable:1; | 546 | unsigned lpm_capable:1; |
540 | unsigned usb2_hw_lpm_capable:1; | 547 | unsigned usb2_hw_lpm_capable:1; |
548 | unsigned usb2_hw_lpm_besl_capable:1; | ||
541 | unsigned usb2_hw_lpm_enabled:1; | 549 | unsigned usb2_hw_lpm_enabled:1; |
542 | unsigned usb3_lpm_enabled:1; | 550 | unsigned usb3_lpm_enabled:1; |
543 | int string_langid; | 551 | int string_langid; |
@@ -566,6 +574,7 @@ struct usb_device { | |||
566 | struct wusb_dev *wusb_dev; | 574 | struct wusb_dev *wusb_dev; |
567 | int slot_id; | 575 | int slot_id; |
568 | enum usb_device_removable removable; | 576 | enum usb_device_removable removable; |
577 | struct usb2_lpm_parameters l1_params; | ||
569 | struct usb3_lpm_parameters u1_params; | 578 | struct usb3_lpm_parameters u1_params; |
570 | struct usb3_lpm_parameters u2_params; | 579 | struct usb3_lpm_parameters u2_params; |
571 | unsigned lpm_disable_count; | 580 | unsigned lpm_disable_count; |
@@ -717,6 +726,7 @@ const struct usb_device_id *usb_match_id(struct usb_interface *interface, | |||
717 | extern int usb_match_one_id(struct usb_interface *interface, | 726 | extern int usb_match_one_id(struct usb_interface *interface, |
718 | const struct usb_device_id *id); | 727 | const struct usb_device_id *id); |
719 | 728 | ||
729 | extern int usb_for_each_dev(void *data, int (*fn)(struct usb_device *, void *)); | ||
720 | extern struct usb_interface *usb_find_interface(struct usb_driver *drv, | 730 | extern struct usb_interface *usb_find_interface(struct usb_driver *drv, |
721 | int minor); | 731 | int minor); |
722 | extern struct usb_interface *usb_ifnum_to_if(const struct usb_device *dev, | 732 | extern struct usb_interface *usb_ifnum_to_if(const struct usb_device *dev, |
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h index 544825dde823..25629948c842 100644 --- a/include/linux/usb/chipidea.h +++ b/include/linux/usb/chipidea.h | |||
@@ -7,32 +7,33 @@ | |||
7 | 7 | ||
8 | #include <linux/usb/otg.h> | 8 | #include <linux/usb/otg.h> |
9 | 9 | ||
10 | struct ci13xxx; | 10 | struct ci_hdrc; |
11 | struct ci13xxx_platform_data { | 11 | struct ci_hdrc_platform_data { |
12 | const char *name; | 12 | const char *name; |
13 | /* offset of the capability registers */ | 13 | /* offset of the capability registers */ |
14 | uintptr_t capoffset; | 14 | uintptr_t capoffset; |
15 | unsigned power_budget; | 15 | unsigned power_budget; |
16 | struct usb_phy *phy; | 16 | struct usb_phy *phy; |
17 | enum usb_phy_interface phy_mode; | ||
17 | unsigned long flags; | 18 | unsigned long flags; |
18 | #define CI13XXX_REGS_SHARED BIT(0) | 19 | #define CI_HDRC_REGS_SHARED BIT(0) |
19 | #define CI13XXX_REQUIRE_TRANSCEIVER BIT(1) | 20 | #define CI_HDRC_REQUIRE_TRANSCEIVER BIT(1) |
20 | #define CI13XXX_PULLUP_ON_VBUS BIT(2) | 21 | #define CI_HDRC_PULLUP_ON_VBUS BIT(2) |
21 | #define CI13XXX_DISABLE_STREAMING BIT(3) | 22 | #define CI_HDRC_DISABLE_STREAMING BIT(3) |
22 | 23 | enum usb_dr_mode dr_mode; | |
23 | #define CI13XXX_CONTROLLER_RESET_EVENT 0 | 24 | #define CI_HDRC_CONTROLLER_RESET_EVENT 0 |
24 | #define CI13XXX_CONTROLLER_STOPPED_EVENT 1 | 25 | #define CI_HDRC_CONTROLLER_STOPPED_EVENT 1 |
25 | void (*notify_event) (struct ci13xxx *ci, unsigned event); | 26 | void (*notify_event) (struct ci_hdrc *ci, unsigned event); |
26 | }; | 27 | }; |
27 | 28 | ||
28 | /* Default offset of capability registers */ | 29 | /* Default offset of capability registers */ |
29 | #define DEF_CAPOFFSET 0x100 | 30 | #define DEF_CAPOFFSET 0x100 |
30 | 31 | ||
31 | /* Add ci13xxx device */ | 32 | /* Add ci hdrc device */ |
32 | struct platform_device *ci13xxx_add_device(struct device *dev, | 33 | struct platform_device *ci_hdrc_add_device(struct device *dev, |
33 | struct resource *res, int nres, | 34 | struct resource *res, int nres, |
34 | struct ci13xxx_platform_data *platdata); | 35 | struct ci_hdrc_platform_data *platdata); |
35 | /* Remove ci13xxx device */ | 36 | /* Remove ci hdrc device */ |
36 | void ci13xxx_remove_device(struct platform_device *pdev); | 37 | void ci_hdrc_remove_device(struct platform_device *pdev); |
37 | 38 | ||
38 | #endif | 39 | #endif |
diff --git a/include/linux/usb/ehci_pdriver.h b/include/linux/usb/ehci_pdriver.h index 99238b096f7e..7eb4dcd0d386 100644 --- a/include/linux/usb/ehci_pdriver.h +++ b/include/linux/usb/ehci_pdriver.h | |||
@@ -19,6 +19,9 @@ | |||
19 | #ifndef __USB_CORE_EHCI_PDRIVER_H | 19 | #ifndef __USB_CORE_EHCI_PDRIVER_H |
20 | #define __USB_CORE_EHCI_PDRIVER_H | 20 | #define __USB_CORE_EHCI_PDRIVER_H |
21 | 21 | ||
22 | struct platform_device; | ||
23 | struct usb_hcd; | ||
24 | |||
22 | /** | 25 | /** |
23 | * struct usb_ehci_pdata - platform_data for generic ehci driver | 26 | * struct usb_ehci_pdata - platform_data for generic ehci driver |
24 | * | 27 | * |
@@ -50,6 +53,7 @@ struct usb_ehci_pdata { | |||
50 | /* Turn on only VBUS suspend power and hotplug detection, | 53 | /* Turn on only VBUS suspend power and hotplug detection, |
51 | * turn off everything else */ | 54 | * turn off everything else */ |
52 | void (*power_suspend)(struct platform_device *pdev); | 55 | void (*power_suspend)(struct platform_device *pdev); |
56 | int (*pre_setup)(struct usb_hcd *hcd); | ||
53 | }; | 57 | }; |
54 | 58 | ||
55 | #endif /* __USB_CORE_EHCI_PDRIVER_H */ | 59 | #endif /* __USB_CORE_EHCI_PDRIVER_H */ |
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index f5f5c7dfda90..1e88377e22f4 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
@@ -218,6 +218,7 @@ struct hc_driver { | |||
218 | #define HCD_SHARED 0x0004 /* Two (or more) usb_hcds share HW */ | 218 | #define HCD_SHARED 0x0004 /* Two (or more) usb_hcds share HW */ |
219 | #define HCD_USB11 0x0010 /* USB 1.1 */ | 219 | #define HCD_USB11 0x0010 /* USB 1.1 */ |
220 | #define HCD_USB2 0x0020 /* USB 2.0 */ | 220 | #define HCD_USB2 0x0020 /* USB 2.0 */ |
221 | #define HCD_USB25 0x0030 /* Wireless USB 1.0 (USB 2.5)*/ | ||
221 | #define HCD_USB3 0x0040 /* USB 3.0 */ | 222 | #define HCD_USB3 0x0040 /* USB 3.0 */ |
222 | #define HCD_MASK 0x0070 | 223 | #define HCD_MASK 0x0070 |
223 | 224 | ||
diff --git a/include/linux/usb/of.h b/include/linux/usb/of.h new file mode 100644 index 000000000000..a0ef405368b8 --- /dev/null +++ b/include/linux/usb/of.h | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * OF helpers for usb devices. | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | |||
7 | #ifndef __LINUX_USB_OF_H | ||
8 | #define __LINUX_USB_OF_H | ||
9 | |||
10 | #include <linux/usb/otg.h> | ||
11 | #include <linux/usb/phy.h> | ||
12 | |||
13 | #if IS_ENABLED(CONFIG_OF) | ||
14 | enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np); | ||
15 | #else | ||
16 | static inline enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np) | ||
17 | { | ||
18 | return USB_DR_MODE_UNKNOWN; | ||
19 | } | ||
20 | #endif | ||
21 | |||
22 | #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_USB_PHY) | ||
23 | enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np); | ||
24 | #else | ||
25 | static inline enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np) | ||
26 | { | ||
27 | return USBPHY_INTERFACE_MODE_UNKNOWN; | ||
28 | } | ||
29 | |||
30 | #endif | ||
31 | |||
32 | #endif /* __LINUX_USB_OF_H */ | ||
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index 291e01ba32e5..154332b7c8c0 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h | |||
@@ -92,4 +92,11 @@ otg_start_srp(struct usb_otg *otg) | |||
92 | /* for OTG controller drivers (and maybe other stuff) */ | 92 | /* for OTG controller drivers (and maybe other stuff) */ |
93 | extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num); | 93 | extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num); |
94 | 94 | ||
95 | enum usb_dr_mode { | ||
96 | USB_DR_MODE_UNKNOWN, | ||
97 | USB_DR_MODE_HOST, | ||
98 | USB_DR_MODE_PERIPHERAL, | ||
99 | USB_DR_MODE_OTG, | ||
100 | }; | ||
101 | |||
95 | #endif /* __LINUX_USB_OTG_H */ | 102 | #endif /* __LINUX_USB_OTG_H */ |
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h index 6b5978f57633..44036808bf0f 100644 --- a/include/linux/usb/phy.h +++ b/include/linux/usb/phy.h | |||
@@ -12,6 +12,15 @@ | |||
12 | #include <linux/notifier.h> | 12 | #include <linux/notifier.h> |
13 | #include <linux/usb.h> | 13 | #include <linux/usb.h> |
14 | 14 | ||
15 | enum usb_phy_interface { | ||
16 | USBPHY_INTERFACE_MODE_UNKNOWN, | ||
17 | USBPHY_INTERFACE_MODE_UTMI, | ||
18 | USBPHY_INTERFACE_MODE_UTMIW, | ||
19 | USBPHY_INTERFACE_MODE_ULPI, | ||
20 | USBPHY_INTERFACE_MODE_SERIAL, | ||
21 | USBPHY_INTERFACE_MODE_HSIC, | ||
22 | }; | ||
23 | |||
15 | enum usb_phy_events { | 24 | enum usb_phy_events { |
16 | USB_EVENT_NONE, /* no events or cable disconnected */ | 25 | USB_EVENT_NONE, /* no events or cable disconnected */ |
17 | USB_EVENT_VBUS, /* vbus valid event */ | 26 | USB_EVENT_VBUS, /* vbus valid event */ |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 302ddf55d2da..d528b8045150 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -19,10 +19,6 @@ | |||
19 | #include <linux/sysrq.h> | 19 | #include <linux/sysrq.h> |
20 | #include <linux/kfifo.h> | 20 | #include <linux/kfifo.h> |
21 | 21 | ||
22 | #define SERIAL_TTY_MAJOR 188 /* Nice legal number now */ | ||
23 | #define SERIAL_TTY_MINORS 254 /* loads of devices :) */ | ||
24 | #define SERIAL_TTY_NO_MINOR 255 /* No minor was assigned */ | ||
25 | |||
26 | /* The maximum number of ports one device can grab at once */ | 22 | /* The maximum number of ports one device can grab at once */ |
27 | #define MAX_NUM_PORTS 8 | 23 | #define MAX_NUM_PORTS 8 |
28 | 24 | ||
@@ -37,7 +33,8 @@ | |||
37 | * @serial: pointer back to the struct usb_serial owner of this port. | 33 | * @serial: pointer back to the struct usb_serial owner of this port. |
38 | * @port: pointer to the corresponding tty_port for this port. | 34 | * @port: pointer to the corresponding tty_port for this port. |
39 | * @lock: spinlock to grab when updating portions of this structure. | 35 | * @lock: spinlock to grab when updating portions of this structure. |
40 | * @number: the number of the port (the minor number). | 36 | * @minor: the minor number of the port |
37 | * @port_number: the struct usb_serial port number of this port (starts at 0) | ||
41 | * @interrupt_in_buffer: pointer to the interrupt in buffer for this port. | 38 | * @interrupt_in_buffer: pointer to the interrupt in buffer for this port. |
42 | * @interrupt_in_urb: pointer to the interrupt in struct urb for this port. | 39 | * @interrupt_in_urb: pointer to the interrupt in struct urb for this port. |
43 | * @interrupt_in_endpointAddress: endpoint address for the interrupt in pipe | 40 | * @interrupt_in_endpointAddress: endpoint address for the interrupt in pipe |
@@ -80,7 +77,8 @@ struct usb_serial_port { | |||
80 | struct usb_serial *serial; | 77 | struct usb_serial *serial; |
81 | struct tty_port port; | 78 | struct tty_port port; |
82 | spinlock_t lock; | 79 | spinlock_t lock; |
83 | unsigned char number; | 80 | u32 minor; |
81 | u8 port_number; | ||
84 | 82 | ||
85 | unsigned char *interrupt_in_buffer; | 83 | unsigned char *interrupt_in_buffer; |
86 | struct urb *interrupt_in_urb; | 84 | struct urb *interrupt_in_urb; |
@@ -140,7 +138,6 @@ static inline void usb_set_serial_port_data(struct usb_serial_port *port, | |||
140 | * @dev: pointer to the struct usb_device for this device | 138 | * @dev: pointer to the struct usb_device for this device |
141 | * @type: pointer to the struct usb_serial_driver for this device | 139 | * @type: pointer to the struct usb_serial_driver for this device |
142 | * @interface: pointer to the struct usb_interface for this device | 140 | * @interface: pointer to the struct usb_interface for this device |
143 | * @minor: the starting minor number for this device | ||
144 | * @num_ports: the number of ports this device has | 141 | * @num_ports: the number of ports this device has |
145 | * @num_interrupt_in: number of interrupt in endpoints we have | 142 | * @num_interrupt_in: number of interrupt in endpoints we have |
146 | * @num_interrupt_out: number of interrupt out endpoints we have | 143 | * @num_interrupt_out: number of interrupt out endpoints we have |
@@ -159,7 +156,7 @@ struct usb_serial { | |||
159 | unsigned char disconnected:1; | 156 | unsigned char disconnected:1; |
160 | unsigned char suspending:1; | 157 | unsigned char suspending:1; |
161 | unsigned char attached:1; | 158 | unsigned char attached:1; |
162 | unsigned char minor; | 159 | unsigned char minors_reserved:1; |
163 | unsigned char num_ports; | 160 | unsigned char num_ports; |
164 | unsigned char num_port_pointers; | 161 | unsigned char num_port_pointers; |
165 | char num_interrupt_in; | 162 | char num_interrupt_in; |
@@ -319,7 +316,7 @@ static inline void usb_serial_console_disconnect(struct usb_serial *serial) {} | |||
319 | #endif | 316 | #endif |
320 | 317 | ||
321 | /* Functions needed by other parts of the usbserial core */ | 318 | /* Functions needed by other parts of the usbserial core */ |
322 | extern struct usb_serial *usb_serial_get_by_index(unsigned int minor); | 319 | extern struct usb_serial_port *usb_serial_port_get_by_minor(unsigned int minor); |
323 | extern void usb_serial_put(struct usb_serial *serial); | 320 | extern void usb_serial_put(struct usb_serial *serial); |
324 | extern int usb_serial_generic_open(struct tty_struct *tty, | 321 | extern int usb_serial_generic_open(struct tty_struct *tty, |
325 | struct usb_serial_port *port); | 322 | struct usb_serial_port *port); |
diff --git a/include/linux/usb/tegra_usb_phy.h b/include/linux/usb/tegra_usb_phy.h index 1b7519a8c0bf..d2ca919a5b73 100644 --- a/include/linux/usb/tegra_usb_phy.h +++ b/include/linux/usb/tegra_usb_phy.h | |||
@@ -42,6 +42,7 @@ enum tegra_usb_phy_port_speed { | |||
42 | enum tegra_usb_phy_mode { | 42 | enum tegra_usb_phy_mode { |
43 | TEGRA_USB_PHY_MODE_DEVICE, | 43 | TEGRA_USB_PHY_MODE_DEVICE, |
44 | TEGRA_USB_PHY_MODE_HOST, | 44 | TEGRA_USB_PHY_MODE_HOST, |
45 | TEGRA_USB_PHY_MODE_OTG, | ||
45 | }; | 46 | }; |
46 | 47 | ||
47 | struct tegra_xtal_freq; | 48 | struct tegra_xtal_freq; |
@@ -61,14 +62,10 @@ struct tegra_usb_phy { | |||
61 | struct device *dev; | 62 | struct device *dev; |
62 | bool is_legacy_phy; | 63 | bool is_legacy_phy; |
63 | bool is_ulpi_phy; | 64 | bool is_ulpi_phy; |
64 | void (*set_pts)(struct usb_phy *x, u8 pts_val); | 65 | int reset_gpio; |
65 | void (*set_phcd)(struct usb_phy *x, bool enable); | ||
66 | }; | 66 | }; |
67 | 67 | ||
68 | struct tegra_usb_phy *tegra_usb_phy_open(struct device *dev, int instance, | 68 | struct usb_phy *tegra_usb_get_phy(struct device_node *dn); |
69 | void __iomem *regs, void *config, enum tegra_usb_phy_mode phy_mode, | ||
70 | void (*set_pts)(struct usb_phy *x, u8 pts_val), | ||
71 | void (*set_phcd)(struct usb_phy *x, bool enable)); | ||
72 | 69 | ||
73 | void tegra_usb_phy_preresume(struct usb_phy *phy); | 70 | void tegra_usb_phy_preresume(struct usb_phy *phy); |
74 | 71 | ||
diff --git a/include/linux/usb/wusb-wa.h b/include/linux/usb/wusb-wa.h index f9dec37f617b..6be985b2a434 100644 --- a/include/linux/usb/wusb-wa.h +++ b/include/linux/usb/wusb-wa.h | |||
@@ -92,11 +92,20 @@ struct usb_rpipe_descriptor { | |||
92 | __le16 wRPipeIndex; | 92 | __le16 wRPipeIndex; |
93 | __le16 wRequests; | 93 | __le16 wRequests; |
94 | __le16 wBlocks; /* rw if 0 */ | 94 | __le16 wBlocks; /* rw if 0 */ |
95 | __le16 wMaxPacketSize; /* rw? */ | 95 | __le16 wMaxPacketSize; /* rw */ |
96 | u8 bHSHubAddress; /* reserved: 0 */ | 96 | union { |
97 | u8 bHSHubPort; /* ??? FIXME ??? */ | 97 | u8 dwa_bHSHubAddress; /* rw: DWA. */ |
98 | u8 hwa_bMaxBurst; /* rw: HWA. */ | ||
99 | }; | ||
100 | union { | ||
101 | u8 dwa_bHSHubPort; /* rw: DWA. */ | ||
102 | u8 hwa_bDeviceInfoIndex; /* rw: HWA. */ | ||
103 | }; | ||
98 | u8 bSpeed; /* rw: xfer rate 'enum uwb_phy_rate' */ | 104 | u8 bSpeed; /* rw: xfer rate 'enum uwb_phy_rate' */ |
99 | u8 bDeviceAddress; /* rw: Target device address */ | 105 | union { |
106 | u8 dwa_bDeviceAddress; /* rw: DWA Target device address. */ | ||
107 | u8 hwa_reserved; /* rw: HWA. */ | ||
108 | }; | ||
100 | u8 bEndpointAddress; /* rw: Target EP address */ | 109 | u8 bEndpointAddress; /* rw: Target EP address */ |
101 | u8 bDataSequence; /* ro: Current Data sequence */ | 110 | u8 bDataSequence; /* ro: Current Data sequence */ |
102 | __le32 dwCurrentWindow; /* ro */ | 111 | __le32 dwCurrentWindow; /* ro */ |
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h index b6b215f13b45..14105c26a836 100644 --- a/include/linux/user_namespace.h +++ b/include/linux/user_namespace.h | |||
@@ -23,6 +23,7 @@ struct user_namespace { | |||
23 | struct uid_gid_map projid_map; | 23 | struct uid_gid_map projid_map; |
24 | atomic_t count; | 24 | atomic_t count; |
25 | struct user_namespace *parent; | 25 | struct user_namespace *parent; |
26 | int level; | ||
26 | kuid_t owner; | 27 | kuid_t owner; |
27 | kgid_t group; | 28 | kgid_t group; |
28 | unsigned int proc_inum; | 29 | unsigned int proc_inum; |
diff --git a/include/linux/vexpress.h b/include/linux/vexpress.h index ea7168a68081..617c01b8f74a 100644 --- a/include/linux/vexpress.h +++ b/include/linux/vexpress.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #define _LINUX_VEXPRESS_H | 15 | #define _LINUX_VEXPRESS_H |
16 | 16 | ||
17 | #include <linux/device.h> | 17 | #include <linux/device.h> |
18 | #include <linux/reboot.h> | ||
18 | 19 | ||
19 | #define VEXPRESS_SITE_MB 0 | 20 | #define VEXPRESS_SITE_MB 0 |
20 | #define VEXPRESS_SITE_DB1 1 | 21 | #define VEXPRESS_SITE_DB1 1 |
diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 9ff8645b7e0b..36d36cc89329 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h | |||
@@ -34,13 +34,6 @@ struct virtqueue { | |||
34 | void *priv; | 34 | void *priv; |
35 | }; | 35 | }; |
36 | 36 | ||
37 | int virtqueue_add_buf(struct virtqueue *vq, | ||
38 | struct scatterlist sg[], | ||
39 | unsigned int out_num, | ||
40 | unsigned int in_num, | ||
41 | void *data, | ||
42 | gfp_t gfp); | ||
43 | |||
44 | int virtqueue_add_outbuf(struct virtqueue *vq, | 37 | int virtqueue_add_outbuf(struct virtqueue *vq, |
45 | struct scatterlist sg[], unsigned int num, | 38 | struct scatterlist sg[], unsigned int num, |
46 | void *data, | 39 | void *data, |
@@ -70,6 +63,10 @@ void virtqueue_disable_cb(struct virtqueue *vq); | |||
70 | 63 | ||
71 | bool virtqueue_enable_cb(struct virtqueue *vq); | 64 | bool virtqueue_enable_cb(struct virtqueue *vq); |
72 | 65 | ||
66 | unsigned virtqueue_enable_cb_prepare(struct virtqueue *vq); | ||
67 | |||
68 | bool virtqueue_poll(struct virtqueue *vq, unsigned); | ||
69 | |||
73 | bool virtqueue_enable_cb_delayed(struct virtqueue *vq); | 70 | bool virtqueue_enable_cb_delayed(struct virtqueue *vq); |
74 | 71 | ||
75 | void *virtqueue_detach_unused_buf(struct virtqueue *vq); | 72 | void *virtqueue_detach_unused_buf(struct virtqueue *vq); |
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index ca3ad41c2c82..b300787af8e0 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _LINUX_VIRTIO_RING_H | 1 | #ifndef _LINUX_VIRTIO_RING_H |
2 | #define _LINUX_VIRTIO_RING_H | 2 | #define _LINUX_VIRTIO_RING_H |
3 | 3 | ||
4 | #include <asm/barrier.h> | ||
4 | #include <linux/irqreturn.h> | 5 | #include <linux/irqreturn.h> |
5 | #include <uapi/linux/virtio_ring.h> | 6 | #include <uapi/linux/virtio_ring.h> |
6 | 7 | ||
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 7d5773a99f20..4b8a89189a29 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -10,12 +10,12 @@ | |||
10 | struct vm_area_struct; /* vma defining user mapping in mm_types.h */ | 10 | struct vm_area_struct; /* vma defining user mapping in mm_types.h */ |
11 | 11 | ||
12 | /* bits in flags of vmalloc's vm_struct below */ | 12 | /* bits in flags of vmalloc's vm_struct below */ |
13 | #define VM_IOREMAP 0x00000001 /* ioremap() and friends */ | 13 | #define VM_IOREMAP 0x00000001 /* ioremap() and friends */ |
14 | #define VM_ALLOC 0x00000002 /* vmalloc() */ | 14 | #define VM_ALLOC 0x00000002 /* vmalloc() */ |
15 | #define VM_MAP 0x00000004 /* vmap()ed pages */ | 15 | #define VM_MAP 0x00000004 /* vmap()ed pages */ |
16 | #define VM_USERMAP 0x00000008 /* suitable for remap_vmalloc_range */ | 16 | #define VM_USERMAP 0x00000008 /* suitable for remap_vmalloc_range */ |
17 | #define VM_VPAGES 0x00000010 /* buffer for pages was vmalloc'ed */ | 17 | #define VM_VPAGES 0x00000010 /* buffer for pages was vmalloc'ed */ |
18 | #define VM_UNLIST 0x00000020 /* vm_struct is not listed in vmlist */ | 18 | #define VM_UNINITIALIZED 0x00000020 /* vm_struct is not fully initialized */ |
19 | /* bits [20..32] reserved for arch specific ioremap internals */ | 19 | /* bits [20..32] reserved for arch specific ioremap internals */ |
20 | 20 | ||
21 | /* | 21 | /* |
@@ -82,6 +82,10 @@ extern void *vmap(struct page **pages, unsigned int count, | |||
82 | unsigned long flags, pgprot_t prot); | 82 | unsigned long flags, pgprot_t prot); |
83 | extern void vunmap(const void *addr); | 83 | extern void vunmap(const void *addr); |
84 | 84 | ||
85 | extern int remap_vmalloc_range_partial(struct vm_area_struct *vma, | ||
86 | unsigned long uaddr, void *kaddr, | ||
87 | unsigned long size); | ||
88 | |||
85 | extern int remap_vmalloc_range(struct vm_area_struct *vma, void *addr, | 89 | extern int remap_vmalloc_range(struct vm_area_struct *vma, void *addr, |
86 | unsigned long pgoff); | 90 | unsigned long pgoff); |
87 | void vmalloc_sync_all(void); | 91 | void vmalloc_sync_all(void); |
diff --git a/include/linux/vmpressure.h b/include/linux/vmpressure.h index 76be077340ea..7dc17e2456de 100644 --- a/include/linux/vmpressure.h +++ b/include/linux/vmpressure.h | |||
@@ -12,7 +12,7 @@ struct vmpressure { | |||
12 | unsigned long scanned; | 12 | unsigned long scanned; |
13 | unsigned long reclaimed; | 13 | unsigned long reclaimed; |
14 | /* The lock is used to keep the scanned/reclaimed above in sync. */ | 14 | /* The lock is used to keep the scanned/reclaimed above in sync. */ |
15 | struct mutex sr_lock; | 15 | struct spinlock sr_lock; |
16 | 16 | ||
17 | /* The list of vmpressure_event structs. */ | 17 | /* The list of vmpressure_event structs. */ |
18 | struct list_head events; | 18 | struct list_head events; |
@@ -30,6 +30,7 @@ extern void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, | |||
30 | extern void vmpressure_prio(gfp_t gfp, struct mem_cgroup *memcg, int prio); | 30 | extern void vmpressure_prio(gfp_t gfp, struct mem_cgroup *memcg, int prio); |
31 | 31 | ||
32 | extern void vmpressure_init(struct vmpressure *vmpr); | 32 | extern void vmpressure_init(struct vmpressure *vmpr); |
33 | extern void vmpressure_cleanup(struct vmpressure *vmpr); | ||
33 | extern struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg); | 34 | extern struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg); |
34 | extern struct cgroup_subsys_state *vmpressure_to_css(struct vmpressure *vmpr); | 35 | extern struct cgroup_subsys_state *vmpressure_to_css(struct vmpressure *vmpr); |
35 | extern struct vmpressure *css_to_vmpressure(struct cgroup_subsys_state *css); | 36 | extern struct vmpressure *css_to_vmpressure(struct cgroup_subsys_state *css); |
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index 0d33fca48774..8d7634247fb4 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
@@ -133,8 +133,6 @@ void change_console(struct vc_data *new_vc); | |||
133 | 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, | 134 | extern int do_unbind_con_driver(const struct consw *csw, int first, int last, |
135 | int deflt); | 135 | int deflt); |
136 | extern int unbind_con_driver(const struct consw *csw, int first, int last, | ||
137 | int deflt); | ||
138 | int vty_init(const struct file_operations *console_fops); | 136 | int vty_init(const struct file_operations *console_fops); |
139 | 137 | ||
140 | static inline bool vt_force_oops_output(struct vc_data *vc) | 138 | static inline bool vt_force_oops_output(struct vc_data *vc) |
diff --git a/include/linux/wait.h b/include/linux/wait.h index 1133695eb067..f487a4750b7f 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
@@ -23,6 +23,7 @@ struct __wait_queue { | |||
23 | struct wait_bit_key { | 23 | struct wait_bit_key { |
24 | void *flags; | 24 | void *flags; |
25 | int bit_nr; | 25 | int bit_nr; |
26 | #define WAIT_ATOMIC_T_BIT_NR -1 | ||
26 | }; | 27 | }; |
27 | 28 | ||
28 | struct wait_bit_queue { | 29 | struct wait_bit_queue { |
@@ -60,6 +61,9 @@ struct task_struct; | |||
60 | #define __WAIT_BIT_KEY_INITIALIZER(word, bit) \ | 61 | #define __WAIT_BIT_KEY_INITIALIZER(word, bit) \ |
61 | { .flags = word, .bit_nr = bit, } | 62 | { .flags = word, .bit_nr = bit, } |
62 | 63 | ||
64 | #define __WAIT_ATOMIC_T_KEY_INITIALIZER(p) \ | ||
65 | { .flags = p, .bit_nr = WAIT_ATOMIC_T_BIT_NR, } | ||
66 | |||
63 | extern void __init_waitqueue_head(wait_queue_head_t *q, const char *name, struct lock_class_key *); | 67 | extern void __init_waitqueue_head(wait_queue_head_t *q, const char *name, struct lock_class_key *); |
64 | 68 | ||
65 | #define init_waitqueue_head(q) \ | 69 | #define init_waitqueue_head(q) \ |
@@ -146,8 +150,10 @@ void __wake_up_bit(wait_queue_head_t *, void *, int); | |||
146 | int __wait_on_bit(wait_queue_head_t *, struct wait_bit_queue *, int (*)(void *), unsigned); | 150 | int __wait_on_bit(wait_queue_head_t *, struct wait_bit_queue *, int (*)(void *), unsigned); |
147 | int __wait_on_bit_lock(wait_queue_head_t *, struct wait_bit_queue *, int (*)(void *), unsigned); | 151 | int __wait_on_bit_lock(wait_queue_head_t *, struct wait_bit_queue *, int (*)(void *), unsigned); |
148 | void wake_up_bit(void *, int); | 152 | void wake_up_bit(void *, int); |
153 | void wake_up_atomic_t(atomic_t *); | ||
149 | int out_of_line_wait_on_bit(void *, int, int (*)(void *), unsigned); | 154 | int out_of_line_wait_on_bit(void *, int, int (*)(void *), unsigned); |
150 | int out_of_line_wait_on_bit_lock(void *, int, int (*)(void *), unsigned); | 155 | int out_of_line_wait_on_bit_lock(void *, int, int (*)(void *), unsigned); |
156 | int out_of_line_wait_on_atomic_t(atomic_t *, int (*)(atomic_t *), unsigned); | ||
151 | wait_queue_head_t *bit_waitqueue(void *, int); | 157 | wait_queue_head_t *bit_waitqueue(void *, int); |
152 | 158 | ||
153 | #define wake_up(x) __wake_up(x, TASK_NORMAL, 1, NULL) | 159 | #define wake_up(x) __wake_up(x, TASK_NORMAL, 1, NULL) |
@@ -902,5 +908,23 @@ static inline int wait_on_bit_lock(void *word, int bit, | |||
902 | return 0; | 908 | return 0; |
903 | return out_of_line_wait_on_bit_lock(word, bit, action, mode); | 909 | return out_of_line_wait_on_bit_lock(word, bit, action, mode); |
904 | } | 910 | } |
911 | |||
912 | /** | ||
913 | * wait_on_atomic_t - Wait for an atomic_t to become 0 | ||
914 | * @val: The atomic value being waited on, a kernel virtual address | ||
915 | * @action: the function used to sleep, which may take special actions | ||
916 | * @mode: the task state to sleep in | ||
917 | * | ||
918 | * Wait for an atomic_t to become 0. We abuse the bit-wait waitqueue table for | ||
919 | * the purpose of getting a waitqueue, but we set the key to a bit number | ||
920 | * outside of the target 'word'. | ||
921 | */ | ||
922 | static inline | ||
923 | int wait_on_atomic_t(atomic_t *val, int (*action)(atomic_t *), unsigned mode) | ||
924 | { | ||
925 | if (atomic_read(val) == 0) | ||
926 | return 0; | ||
927 | return out_of_line_wait_on_atomic_t(val, action, mode); | ||
928 | } | ||
905 | 929 | ||
906 | #endif | 930 | #endif |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 623488fdc1f5..a0ed78ab54d7 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -303,6 +303,33 @@ enum { | |||
303 | WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */ | 303 | WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */ |
304 | WQ_SYSFS = 1 << 6, /* visible in sysfs, see wq_sysfs_register() */ | 304 | WQ_SYSFS = 1 << 6, /* visible in sysfs, see wq_sysfs_register() */ |
305 | 305 | ||
306 | /* | ||
307 | * Per-cpu workqueues are generally preferred because they tend to | ||
308 | * show better performance thanks to cache locality. Per-cpu | ||
309 | * workqueues exclude the scheduler from choosing the CPU to | ||
310 | * execute the worker threads, which has an unfortunate side effect | ||
311 | * of increasing power consumption. | ||
312 | * | ||
313 | * The scheduler considers a CPU idle if it doesn't have any task | ||
314 | * to execute and tries to keep idle cores idle to conserve power; | ||
315 | * however, for example, a per-cpu work item scheduled from an | ||
316 | * interrupt handler on an idle CPU will force the scheduler to | ||
317 | * excute the work item on that CPU breaking the idleness, which in | ||
318 | * turn may lead to more scheduling choices which are sub-optimal | ||
319 | * in terms of power consumption. | ||
320 | * | ||
321 | * Workqueues marked with WQ_POWER_EFFICIENT are per-cpu by default | ||
322 | * but become unbound if workqueue.power_efficient kernel param is | ||
323 | * specified. Per-cpu workqueues which are identified to | ||
324 | * contribute significantly to power-consumption are identified and | ||
325 | * marked with this flag and enabling the power_efficient mode | ||
326 | * leads to noticeable power saving at the cost of small | ||
327 | * performance disadvantage. | ||
328 | * | ||
329 | * http://thread.gmane.org/gmane.linux.kernel/1480396 | ||
330 | */ | ||
331 | WQ_POWER_EFFICIENT = 1 << 7, | ||
332 | |||
306 | __WQ_DRAINING = 1 << 16, /* internal: workqueue is draining */ | 333 | __WQ_DRAINING = 1 << 16, /* internal: workqueue is draining */ |
307 | __WQ_ORDERED = 1 << 17, /* internal: workqueue is ordered */ | 334 | __WQ_ORDERED = 1 << 17, /* internal: workqueue is ordered */ |
308 | 335 | ||
@@ -333,11 +360,19 @@ enum { | |||
333 | * | 360 | * |
334 | * system_freezable_wq is equivalent to system_wq except that it's | 361 | * system_freezable_wq is equivalent to system_wq except that it's |
335 | * freezable. | 362 | * freezable. |
363 | * | ||
364 | * *_power_efficient_wq are inclined towards saving power and converted | ||
365 | * into WQ_UNBOUND variants if 'wq_power_efficient' is enabled; otherwise, | ||
366 | * they are same as their non-power-efficient counterparts - e.g. | ||
367 | * system_power_efficient_wq is identical to system_wq if | ||
368 | * 'wq_power_efficient' is disabled. See WQ_POWER_EFFICIENT for more info. | ||
336 | */ | 369 | */ |
337 | extern struct workqueue_struct *system_wq; | 370 | extern struct workqueue_struct *system_wq; |
338 | extern struct workqueue_struct *system_long_wq; | 371 | extern struct workqueue_struct *system_long_wq; |
339 | extern struct workqueue_struct *system_unbound_wq; | 372 | extern struct workqueue_struct *system_unbound_wq; |
340 | extern struct workqueue_struct *system_freezable_wq; | 373 | extern struct workqueue_struct *system_freezable_wq; |
374 | extern struct workqueue_struct *system_power_efficient_wq; | ||
375 | extern struct workqueue_struct *system_freezable_power_efficient_wq; | ||
341 | 376 | ||
342 | static inline struct workqueue_struct * __deprecated __system_nrt_wq(void) | 377 | static inline struct workqueue_struct * __deprecated __system_nrt_wq(void) |
343 | { | 378 | { |
@@ -410,11 +445,12 @@ __alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active, | |||
410 | alloc_workqueue(fmt, WQ_UNBOUND | __WQ_ORDERED | (flags), 1, ##args) | 445 | alloc_workqueue(fmt, WQ_UNBOUND | __WQ_ORDERED | (flags), 1, ##args) |
411 | 446 | ||
412 | #define create_workqueue(name) \ | 447 | #define create_workqueue(name) \ |
413 | alloc_workqueue((name), WQ_MEM_RECLAIM, 1) | 448 | alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, (name)) |
414 | #define create_freezable_workqueue(name) \ | 449 | #define create_freezable_workqueue(name) \ |
415 | alloc_workqueue((name), WQ_FREEZABLE | WQ_UNBOUND | WQ_MEM_RECLAIM, 1) | 450 | alloc_workqueue("%s", WQ_FREEZABLE | WQ_UNBOUND | WQ_MEM_RECLAIM, \ |
451 | 1, (name)) | ||
416 | #define create_singlethread_workqueue(name) \ | 452 | #define create_singlethread_workqueue(name) \ |
417 | alloc_workqueue((name), WQ_UNBOUND | WQ_MEM_RECLAIM, 1) | 453 | alloc_workqueue("%s", WQ_UNBOUND | WQ_MEM_RECLAIM, 1, (name)) |
418 | 454 | ||
419 | extern void destroy_workqueue(struct workqueue_struct *wq); | 455 | extern void destroy_workqueue(struct workqueue_struct *wq); |
420 | 456 | ||
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 579a5007c696..4e198ca1f685 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -47,11 +47,16 @@ enum wb_reason { | |||
47 | WB_REASON_LAPTOP_TIMER, | 47 | WB_REASON_LAPTOP_TIMER, |
48 | WB_REASON_FREE_MORE_MEM, | 48 | WB_REASON_FREE_MORE_MEM, |
49 | WB_REASON_FS_FREE_SPACE, | 49 | WB_REASON_FS_FREE_SPACE, |
50 | /* | ||
51 | * There is no bdi forker thread any more and works are done | ||
52 | * by emergency worker, however, this is TPs userland visible | ||
53 | * and we'll be exposing exactly the same information, | ||
54 | * so it has a mismatch name. | ||
55 | */ | ||
50 | WB_REASON_FORKER_THREAD, | 56 | WB_REASON_FORKER_THREAD, |
51 | 57 | ||
52 | WB_REASON_MAX, | 58 | WB_REASON_MAX, |
53 | }; | 59 | }; |
54 | extern const char *wb_reason_name[]; | ||
55 | 60 | ||
56 | /* | 61 | /* |
57 | * A control structure which tells the writeback code what to do. These are | 62 | * A control structure which tells the writeback code what to do. These are |
@@ -78,6 +83,7 @@ struct writeback_control { | |||
78 | unsigned tagged_writepages:1; /* tag-and-write to avoid livelock */ | 83 | unsigned tagged_writepages:1; /* tag-and-write to avoid livelock */ |
79 | unsigned for_reclaim:1; /* Invoked from the page allocator */ | 84 | unsigned for_reclaim:1; /* Invoked from the page allocator */ |
80 | unsigned range_cyclic:1; /* range_start is cyclic */ | 85 | unsigned range_cyclic:1; /* range_start is cyclic */ |
86 | unsigned for_sync:1; /* sync(2) WB_SYNC_ALL writeback */ | ||
81 | }; | 87 | }; |
82 | 88 | ||
83 | /* | 89 | /* |
@@ -94,7 +100,6 @@ int try_to_writeback_inodes_sb_nr(struct super_block *, unsigned long nr, | |||
94 | void sync_inodes_sb(struct super_block *); | 100 | void sync_inodes_sb(struct super_block *); |
95 | long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages, | 101 | long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages, |
96 | enum wb_reason reason); | 102 | enum wb_reason reason); |
97 | long wb_do_writeback(struct bdi_writeback *wb, int force_wait); | ||
98 | void wakeup_flusher_threads(long nr_pages, enum wb_reason reason); | 103 | void wakeup_flusher_threads(long nr_pages, enum wb_reason reason); |
99 | void inode_wait_for_writeback(struct inode *inode); | 104 | void inode_wait_for_writeback(struct inode *inode); |
100 | 105 | ||
diff --git a/include/linux/ww_mutex.h b/include/linux/ww_mutex.h new file mode 100644 index 000000000000..760399a470bd --- /dev/null +++ b/include/linux/ww_mutex.h | |||
@@ -0,0 +1,378 @@ | |||
1 | /* | ||
2 | * Wound/Wait Mutexes: blocking mutual exclusion locks with deadlock avoidance | ||
3 | * | ||
4 | * Original mutex implementation started by Ingo Molnar: | ||
5 | * | ||
6 | * Copyright (C) 2004, 2005, 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com> | ||
7 | * | ||
8 | * Wound/wait implementation: | ||
9 | * Copyright (C) 2013 Canonical Ltd. | ||
10 | * | ||
11 | * This file contains the main data structure and API definitions. | ||
12 | */ | ||
13 | |||
14 | #ifndef __LINUX_WW_MUTEX_H | ||
15 | #define __LINUX_WW_MUTEX_H | ||
16 | |||
17 | #include <linux/mutex.h> | ||
18 | |||
19 | struct ww_class { | ||
20 | atomic_long_t stamp; | ||
21 | struct lock_class_key acquire_key; | ||
22 | struct lock_class_key mutex_key; | ||
23 | const char *acquire_name; | ||
24 | const char *mutex_name; | ||
25 | }; | ||
26 | |||
27 | struct ww_acquire_ctx { | ||
28 | struct task_struct *task; | ||
29 | unsigned long stamp; | ||
30 | unsigned acquired; | ||
31 | #ifdef CONFIG_DEBUG_MUTEXES | ||
32 | unsigned done_acquire; | ||
33 | struct ww_class *ww_class; | ||
34 | struct ww_mutex *contending_lock; | ||
35 | #endif | ||
36 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
37 | struct lockdep_map dep_map; | ||
38 | #endif | ||
39 | #ifdef CONFIG_DEBUG_WW_MUTEX_SLOWPATH | ||
40 | unsigned deadlock_inject_interval; | ||
41 | unsigned deadlock_inject_countdown; | ||
42 | #endif | ||
43 | }; | ||
44 | |||
45 | struct ww_mutex { | ||
46 | struct mutex base; | ||
47 | struct ww_acquire_ctx *ctx; | ||
48 | #ifdef CONFIG_DEBUG_MUTEXES | ||
49 | struct ww_class *ww_class; | ||
50 | #endif | ||
51 | }; | ||
52 | |||
53 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
54 | # define __WW_CLASS_MUTEX_INITIALIZER(lockname, ww_class) \ | ||
55 | , .ww_class = &ww_class | ||
56 | #else | ||
57 | # define __WW_CLASS_MUTEX_INITIALIZER(lockname, ww_class) | ||
58 | #endif | ||
59 | |||
60 | #define __WW_CLASS_INITIALIZER(ww_class) \ | ||
61 | { .stamp = ATOMIC_LONG_INIT(0) \ | ||
62 | , .acquire_name = #ww_class "_acquire" \ | ||
63 | , .mutex_name = #ww_class "_mutex" } | ||
64 | |||
65 | #define __WW_MUTEX_INITIALIZER(lockname, class) \ | ||
66 | { .base = { \__MUTEX_INITIALIZER(lockname) } \ | ||
67 | __WW_CLASS_MUTEX_INITIALIZER(lockname, class) } | ||
68 | |||
69 | #define DEFINE_WW_CLASS(classname) \ | ||
70 | struct ww_class classname = __WW_CLASS_INITIALIZER(classname) | ||
71 | |||
72 | #define DEFINE_WW_MUTEX(mutexname, ww_class) \ | ||
73 | struct ww_mutex mutexname = __WW_MUTEX_INITIALIZER(mutexname, ww_class) | ||
74 | |||
75 | /** | ||
76 | * ww_mutex_init - initialize the w/w mutex | ||
77 | * @lock: the mutex to be initialized | ||
78 | * @ww_class: the w/w class the mutex should belong to | ||
79 | * | ||
80 | * Initialize the w/w mutex to unlocked state and associate it with the given | ||
81 | * class. | ||
82 | * | ||
83 | * It is not allowed to initialize an already locked mutex. | ||
84 | */ | ||
85 | static inline void ww_mutex_init(struct ww_mutex *lock, | ||
86 | struct ww_class *ww_class) | ||
87 | { | ||
88 | __mutex_init(&lock->base, ww_class->mutex_name, &ww_class->mutex_key); | ||
89 | lock->ctx = NULL; | ||
90 | #ifdef CONFIG_DEBUG_MUTEXES | ||
91 | lock->ww_class = ww_class; | ||
92 | #endif | ||
93 | } | ||
94 | |||
95 | /** | ||
96 | * ww_acquire_init - initialize a w/w acquire context | ||
97 | * @ctx: w/w acquire context to initialize | ||
98 | * @ww_class: w/w class of the context | ||
99 | * | ||
100 | * Initializes an context to acquire multiple mutexes of the given w/w class. | ||
101 | * | ||
102 | * Context-based w/w mutex acquiring can be done in any order whatsoever within | ||
103 | * a given lock class. Deadlocks will be detected and handled with the | ||
104 | * wait/wound logic. | ||
105 | * | ||
106 | * Mixing of context-based w/w mutex acquiring and single w/w mutex locking can | ||
107 | * result in undetected deadlocks and is so forbidden. Mixing different contexts | ||
108 | * for the same w/w class when acquiring mutexes can also result in undetected | ||
109 | * deadlocks, and is hence also forbidden. Both types of abuse will be caught by | ||
110 | * enabling CONFIG_PROVE_LOCKING. | ||
111 | * | ||
112 | * Nesting of acquire contexts for _different_ w/w classes is possible, subject | ||
113 | * to the usual locking rules between different lock classes. | ||
114 | * | ||
115 | * An acquire context must be released with ww_acquire_fini by the same task | ||
116 | * before the memory is freed. It is recommended to allocate the context itself | ||
117 | * on the stack. | ||
118 | */ | ||
119 | static inline void ww_acquire_init(struct ww_acquire_ctx *ctx, | ||
120 | struct ww_class *ww_class) | ||
121 | { | ||
122 | ctx->task = current; | ||
123 | ctx->stamp = atomic_long_inc_return(&ww_class->stamp); | ||
124 | ctx->acquired = 0; | ||
125 | #ifdef CONFIG_DEBUG_MUTEXES | ||
126 | ctx->ww_class = ww_class; | ||
127 | ctx->done_acquire = 0; | ||
128 | ctx->contending_lock = NULL; | ||
129 | #endif | ||
130 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
131 | debug_check_no_locks_freed((void *)ctx, sizeof(*ctx)); | ||
132 | lockdep_init_map(&ctx->dep_map, ww_class->acquire_name, | ||
133 | &ww_class->acquire_key, 0); | ||
134 | mutex_acquire(&ctx->dep_map, 0, 0, _RET_IP_); | ||
135 | #endif | ||
136 | #ifdef CONFIG_DEBUG_WW_MUTEX_SLOWPATH | ||
137 | ctx->deadlock_inject_interval = 1; | ||
138 | ctx->deadlock_inject_countdown = ctx->stamp & 0xf; | ||
139 | #endif | ||
140 | } | ||
141 | |||
142 | /** | ||
143 | * ww_acquire_done - marks the end of the acquire phase | ||
144 | * @ctx: the acquire context | ||
145 | * | ||
146 | * Marks the end of the acquire phase, any further w/w mutex lock calls using | ||
147 | * this context are forbidden. | ||
148 | * | ||
149 | * Calling this function is optional, it is just useful to document w/w mutex | ||
150 | * code and clearly designated the acquire phase from actually using the locked | ||
151 | * data structures. | ||
152 | */ | ||
153 | static inline void ww_acquire_done(struct ww_acquire_ctx *ctx) | ||
154 | { | ||
155 | #ifdef CONFIG_DEBUG_MUTEXES | ||
156 | lockdep_assert_held(ctx); | ||
157 | |||
158 | DEBUG_LOCKS_WARN_ON(ctx->done_acquire); | ||
159 | ctx->done_acquire = 1; | ||
160 | #endif | ||
161 | } | ||
162 | |||
163 | /** | ||
164 | * ww_acquire_fini - releases a w/w acquire context | ||
165 | * @ctx: the acquire context to free | ||
166 | * | ||
167 | * Releases a w/w acquire context. This must be called _after_ all acquired w/w | ||
168 | * mutexes have been released with ww_mutex_unlock. | ||
169 | */ | ||
170 | static inline void ww_acquire_fini(struct ww_acquire_ctx *ctx) | ||
171 | { | ||
172 | #ifdef CONFIG_DEBUG_MUTEXES | ||
173 | mutex_release(&ctx->dep_map, 0, _THIS_IP_); | ||
174 | |||
175 | DEBUG_LOCKS_WARN_ON(ctx->acquired); | ||
176 | if (!config_enabled(CONFIG_PROVE_LOCKING)) | ||
177 | /* | ||
178 | * lockdep will normally handle this, | ||
179 | * but fail without anyway | ||
180 | */ | ||
181 | ctx->done_acquire = 1; | ||
182 | |||
183 | if (!config_enabled(CONFIG_DEBUG_LOCK_ALLOC)) | ||
184 | /* ensure ww_acquire_fini will still fail if called twice */ | ||
185 | ctx->acquired = ~0U; | ||
186 | #endif | ||
187 | } | ||
188 | |||
189 | extern int __must_check __ww_mutex_lock(struct ww_mutex *lock, | ||
190 | struct ww_acquire_ctx *ctx); | ||
191 | extern int __must_check __ww_mutex_lock_interruptible(struct ww_mutex *lock, | ||
192 | struct ww_acquire_ctx *ctx); | ||
193 | |||
194 | /** | ||
195 | * ww_mutex_lock - acquire the w/w mutex | ||
196 | * @lock: the mutex to be acquired | ||
197 | * @ctx: w/w acquire context, or NULL to acquire only a single lock. | ||
198 | * | ||
199 | * Lock the w/w mutex exclusively for this task. | ||
200 | * | ||
201 | * Deadlocks within a given w/w class of locks are detected and handled with the | ||
202 | * wait/wound algorithm. If the lock isn't immediately avaiable this function | ||
203 | * will either sleep until it is (wait case). Or it selects the current context | ||
204 | * for backing off by returning -EDEADLK (wound case). Trying to acquire the | ||
205 | * same lock with the same context twice is also detected and signalled by | ||
206 | * returning -EALREADY. Returns 0 if the mutex was successfully acquired. | ||
207 | * | ||
208 | * In the wound case the caller must release all currently held w/w mutexes for | ||
209 | * the given context and then wait for this contending lock to be available by | ||
210 | * calling ww_mutex_lock_slow. Alternatively callers can opt to not acquire this | ||
211 | * lock and proceed with trying to acquire further w/w mutexes (e.g. when | ||
212 | * scanning through lru lists trying to free resources). | ||
213 | * | ||
214 | * The mutex must later on be released by the same task that | ||
215 | * acquired it. The task may not exit without first unlocking the mutex. Also, | ||
216 | * kernel memory where the mutex resides must not be freed with the mutex still | ||
217 | * locked. The mutex must first be initialized (or statically defined) before it | ||
218 | * can be locked. memset()-ing the mutex to 0 is not allowed. The mutex must be | ||
219 | * of the same w/w lock class as was used to initialize the acquire context. | ||
220 | * | ||
221 | * A mutex acquired with this function must be released with ww_mutex_unlock. | ||
222 | */ | ||
223 | static inline int ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ctx) | ||
224 | { | ||
225 | if (ctx) | ||
226 | return __ww_mutex_lock(lock, ctx); | ||
227 | |||
228 | mutex_lock(&lock->base); | ||
229 | return 0; | ||
230 | } | ||
231 | |||
232 | /** | ||
233 | * ww_mutex_lock_interruptible - acquire the w/w mutex, interruptible | ||
234 | * @lock: the mutex to be acquired | ||
235 | * @ctx: w/w acquire context | ||
236 | * | ||
237 | * Lock the w/w mutex exclusively for this task. | ||
238 | * | ||
239 | * Deadlocks within a given w/w class of locks are detected and handled with the | ||
240 | * wait/wound algorithm. If the lock isn't immediately avaiable this function | ||
241 | * will either sleep until it is (wait case). Or it selects the current context | ||
242 | * for backing off by returning -EDEADLK (wound case). Trying to acquire the | ||
243 | * same lock with the same context twice is also detected and signalled by | ||
244 | * returning -EALREADY. Returns 0 if the mutex was successfully acquired. If a | ||
245 | * signal arrives while waiting for the lock then this function returns -EINTR. | ||
246 | * | ||
247 | * In the wound case the caller must release all currently held w/w mutexes for | ||
248 | * the given context and then wait for this contending lock to be available by | ||
249 | * calling ww_mutex_lock_slow_interruptible. Alternatively callers can opt to | ||
250 | * not acquire this lock and proceed with trying to acquire further w/w mutexes | ||
251 | * (e.g. when scanning through lru lists trying to free resources). | ||
252 | * | ||
253 | * The mutex must later on be released by the same task that | ||
254 | * acquired it. The task may not exit without first unlocking the mutex. Also, | ||
255 | * kernel memory where the mutex resides must not be freed with the mutex still | ||
256 | * locked. The mutex must first be initialized (or statically defined) before it | ||
257 | * can be locked. memset()-ing the mutex to 0 is not allowed. The mutex must be | ||
258 | * of the same w/w lock class as was used to initialize the acquire context. | ||
259 | * | ||
260 | * A mutex acquired with this function must be released with ww_mutex_unlock. | ||
261 | */ | ||
262 | static inline int __must_check ww_mutex_lock_interruptible(struct ww_mutex *lock, | ||
263 | struct ww_acquire_ctx *ctx) | ||
264 | { | ||
265 | if (ctx) | ||
266 | return __ww_mutex_lock_interruptible(lock, ctx); | ||
267 | else | ||
268 | return mutex_lock_interruptible(&lock->base); | ||
269 | } | ||
270 | |||
271 | /** | ||
272 | * ww_mutex_lock_slow - slowpath acquiring of the w/w mutex | ||
273 | * @lock: the mutex to be acquired | ||
274 | * @ctx: w/w acquire context | ||
275 | * | ||
276 | * Acquires a w/w mutex with the given context after a wound case. This function | ||
277 | * will sleep until the lock becomes available. | ||
278 | * | ||
279 | * The caller must have released all w/w mutexes already acquired with the | ||
280 | * context and then call this function on the contended lock. | ||
281 | * | ||
282 | * Afterwards the caller may continue to (re)acquire the other w/w mutexes it | ||
283 | * needs with ww_mutex_lock. Note that the -EALREADY return code from | ||
284 | * ww_mutex_lock can be used to avoid locking this contended mutex twice. | ||
285 | * | ||
286 | * It is forbidden to call this function with any other w/w mutexes associated | ||
287 | * with the context held. It is forbidden to call this on anything else than the | ||
288 | * contending mutex. | ||
289 | * | ||
290 | * Note that the slowpath lock acquiring can also be done by calling | ||
291 | * ww_mutex_lock directly. This function here is simply to help w/w mutex | ||
292 | * locking code readability by clearly denoting the slowpath. | ||
293 | */ | ||
294 | static inline void | ||
295 | ww_mutex_lock_slow(struct ww_mutex *lock, struct ww_acquire_ctx *ctx) | ||
296 | { | ||
297 | int ret; | ||
298 | #ifdef CONFIG_DEBUG_MUTEXES | ||
299 | DEBUG_LOCKS_WARN_ON(!ctx->contending_lock); | ||
300 | #endif | ||
301 | ret = ww_mutex_lock(lock, ctx); | ||
302 | (void)ret; | ||
303 | } | ||
304 | |||
305 | /** | ||
306 | * ww_mutex_lock_slow_interruptible - slowpath acquiring of the w/w mutex, interruptible | ||
307 | * @lock: the mutex to be acquired | ||
308 | * @ctx: w/w acquire context | ||
309 | * | ||
310 | * Acquires a w/w mutex with the given context after a wound case. This function | ||
311 | * will sleep until the lock becomes available and returns 0 when the lock has | ||
312 | * been acquired. If a signal arrives while waiting for the lock then this | ||
313 | * function returns -EINTR. | ||
314 | * | ||
315 | * The caller must have released all w/w mutexes already acquired with the | ||
316 | * context and then call this function on the contended lock. | ||
317 | * | ||
318 | * Afterwards the caller may continue to (re)acquire the other w/w mutexes it | ||
319 | * needs with ww_mutex_lock. Note that the -EALREADY return code from | ||
320 | * ww_mutex_lock can be used to avoid locking this contended mutex twice. | ||
321 | * | ||
322 | * It is forbidden to call this function with any other w/w mutexes associated | ||
323 | * with the given context held. It is forbidden to call this on anything else | ||
324 | * than the contending mutex. | ||
325 | * | ||
326 | * Note that the slowpath lock acquiring can also be done by calling | ||
327 | * ww_mutex_lock_interruptible directly. This function here is simply to help | ||
328 | * w/w mutex locking code readability by clearly denoting the slowpath. | ||
329 | */ | ||
330 | static inline int __must_check | ||
331 | ww_mutex_lock_slow_interruptible(struct ww_mutex *lock, | ||
332 | struct ww_acquire_ctx *ctx) | ||
333 | { | ||
334 | #ifdef CONFIG_DEBUG_MUTEXES | ||
335 | DEBUG_LOCKS_WARN_ON(!ctx->contending_lock); | ||
336 | #endif | ||
337 | return ww_mutex_lock_interruptible(lock, ctx); | ||
338 | } | ||
339 | |||
340 | extern void ww_mutex_unlock(struct ww_mutex *lock); | ||
341 | |||
342 | /** | ||
343 | * ww_mutex_trylock - tries to acquire the w/w mutex without acquire context | ||
344 | * @lock: mutex to lock | ||
345 | * | ||
346 | * Trylocks a mutex without acquire context, so no deadlock detection is | ||
347 | * possible. Returns 1 if the mutex has been acquired successfully, 0 otherwise. | ||
348 | */ | ||
349 | static inline int __must_check ww_mutex_trylock(struct ww_mutex *lock) | ||
350 | { | ||
351 | return mutex_trylock(&lock->base); | ||
352 | } | ||
353 | |||
354 | /*** | ||
355 | * ww_mutex_destroy - mark a w/w mutex unusable | ||
356 | * @lock: the mutex to be destroyed | ||
357 | * | ||
358 | * This function marks the mutex uninitialized, and any subsequent | ||
359 | * use of the mutex is forbidden. The mutex must not be locked when | ||
360 | * this function is called. | ||
361 | */ | ||
362 | static inline void ww_mutex_destroy(struct ww_mutex *lock) | ||
363 | { | ||
364 | mutex_destroy(&lock->base); | ||
365 | } | ||
366 | |||
367 | /** | ||
368 | * ww_mutex_is_locked - is the w/w mutex locked | ||
369 | * @lock: the mutex to be queried | ||
370 | * | ||
371 | * Returns 1 if the mutex is locked, 0 if unlocked. | ||
372 | */ | ||
373 | static inline bool ww_mutex_is_locked(struct ww_mutex *lock) | ||
374 | { | ||
375 | return mutex_is_locked(&lock->base); | ||
376 | } | ||
377 | |||
378 | #endif | ||
diff --git a/include/linux/zbud.h b/include/linux/zbud.h new file mode 100644 index 000000000000..2571a5cfa5fc --- /dev/null +++ b/include/linux/zbud.h | |||
@@ -0,0 +1,22 @@ | |||
1 | #ifndef _ZBUD_H_ | ||
2 | #define _ZBUD_H_ | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | struct zbud_pool; | ||
7 | |||
8 | struct zbud_ops { | ||
9 | int (*evict)(struct zbud_pool *pool, unsigned long handle); | ||
10 | }; | ||
11 | |||
12 | struct zbud_pool *zbud_create_pool(gfp_t gfp, struct zbud_ops *ops); | ||
13 | void zbud_destroy_pool(struct zbud_pool *pool); | ||
14 | int zbud_alloc(struct zbud_pool *pool, int size, gfp_t gfp, | ||
15 | unsigned long *handle); | ||
16 | void zbud_free(struct zbud_pool *pool, unsigned long handle); | ||
17 | int zbud_reclaim_page(struct zbud_pool *pool, unsigned int retries); | ||
18 | void *zbud_map(struct zbud_pool *pool, unsigned long handle); | ||
19 | void zbud_unmap(struct zbud_pool *pool, unsigned long handle); | ||
20 | u64 zbud_get_pool_size(struct zbud_pool *pool); | ||
21 | |||
22 | #endif /* _ZBUD_H_ */ | ||