diff options
| author | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-02-18 10:28:37 -0500 |
|---|---|---|
| committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-02-18 10:28:37 -0500 |
| commit | 65d2918e716afb89359cfa59734d76c1ff8700cb (patch) | |
| tree | 4685404f96642243d62c3a1a823340913d087090 /include/linux | |
| parent | bf40e5561fd288a505d5d8d8bf45eef96fe7253d (diff) | |
| parent | 338d00cfef07d74a072f96821c64b20f98517d72 (diff) | |
Merge branch 'cleanups'
Merge cleanups requested by Linus.
* cleanups: (3 commits)
pnfs: Refactor the *_layout_mark_request_commit to use pnfs_layout_mark_request_commit
nfs: Can call nfs_clear_page_commit() instead
nfs: Provide and use helper functions for marking a page as unstable
Diffstat (limited to 'include/linux')
168 files changed, 2653 insertions, 965 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index d459cd17b477..24c7aa8b1d20 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | 27 | ||
| 28 | #include <linux/errno.h> | 28 | #include <linux/errno.h> |
| 29 | #include <linux/ioport.h> /* for struct resource */ | 29 | #include <linux/ioport.h> /* for struct resource */ |
| 30 | #include <linux/resource_ext.h> | ||
| 30 | #include <linux/device.h> | 31 | #include <linux/device.h> |
| 31 | #include <linux/property.h> | 32 | #include <linux/property.h> |
| 32 | 33 | ||
| @@ -151,6 +152,10 @@ int acpi_map_cpu(acpi_handle handle, int physid, int *pcpu); | |||
| 151 | int acpi_unmap_cpu(int cpu); | 152 | int acpi_unmap_cpu(int cpu); |
| 152 | #endif /* CONFIG_ACPI_HOTPLUG_CPU */ | 153 | #endif /* CONFIG_ACPI_HOTPLUG_CPU */ |
| 153 | 154 | ||
| 155 | #ifdef CONFIG_ACPI_HOTPLUG_IOAPIC | ||
| 156 | int acpi_get_ioapic_id(acpi_handle handle, u32 gsi_base, u64 *phys_addr); | ||
| 157 | #endif | ||
| 158 | |||
| 154 | int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base); | 159 | int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base); |
| 155 | int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base); | 160 | int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base); |
| 156 | int acpi_ioapic_registered(acpi_handle handle, u32 gsi_base); | 161 | int acpi_ioapic_registered(acpi_handle handle, u32 gsi_base); |
| @@ -288,22 +293,25 @@ extern int pnpacpi_disabled; | |||
| 288 | bool acpi_dev_resource_memory(struct acpi_resource *ares, struct resource *res); | 293 | bool acpi_dev_resource_memory(struct acpi_resource *ares, struct resource *res); |
| 289 | bool acpi_dev_resource_io(struct acpi_resource *ares, struct resource *res); | 294 | bool acpi_dev_resource_io(struct acpi_resource *ares, struct resource *res); |
| 290 | bool acpi_dev_resource_address_space(struct acpi_resource *ares, | 295 | bool acpi_dev_resource_address_space(struct acpi_resource *ares, |
| 291 | struct resource *res); | 296 | struct resource_win *win); |
| 292 | bool acpi_dev_resource_ext_address_space(struct acpi_resource *ares, | 297 | bool acpi_dev_resource_ext_address_space(struct acpi_resource *ares, |
| 293 | struct resource *res); | 298 | struct resource_win *win); |
| 294 | unsigned long acpi_dev_irq_flags(u8 triggering, u8 polarity, u8 shareable); | 299 | unsigned long acpi_dev_irq_flags(u8 triggering, u8 polarity, u8 shareable); |
| 295 | bool acpi_dev_resource_interrupt(struct acpi_resource *ares, int index, | 300 | bool acpi_dev_resource_interrupt(struct acpi_resource *ares, int index, |
| 296 | struct resource *res); | 301 | struct resource *res); |
| 297 | 302 | ||
| 298 | struct resource_list_entry { | ||
| 299 | struct list_head node; | ||
| 300 | struct resource res; | ||
| 301 | }; | ||
| 302 | |||
| 303 | void acpi_dev_free_resource_list(struct list_head *list); | 303 | void acpi_dev_free_resource_list(struct list_head *list); |
| 304 | int acpi_dev_get_resources(struct acpi_device *adev, struct list_head *list, | 304 | int acpi_dev_get_resources(struct acpi_device *adev, struct list_head *list, |
| 305 | int (*preproc)(struct acpi_resource *, void *), | 305 | int (*preproc)(struct acpi_resource *, void *), |
| 306 | void *preproc_data); | 306 | void *preproc_data); |
| 307 | int acpi_dev_filter_resource_type(struct acpi_resource *ares, | ||
| 308 | unsigned long types); | ||
| 309 | |||
| 310 | static inline int acpi_dev_filter_resource_type_cb(struct acpi_resource *ares, | ||
| 311 | void *arg) | ||
| 312 | { | ||
| 313 | return acpi_dev_filter_resource_type(ares, (unsigned long)arg); | ||
| 314 | } | ||
| 307 | 315 | ||
| 308 | int acpi_check_resource_conflict(const struct resource *res); | 316 | int acpi_check_resource_conflict(const struct resource *res); |
| 309 | 317 | ||
diff --git a/include/linux/ahci_platform.h b/include/linux/ahci_platform.h index 642d6ae4030c..a270f25ee7c7 100644 --- a/include/linux/ahci_platform.h +++ b/include/linux/ahci_platform.h | |||
| @@ -21,16 +21,20 @@ struct device; | |||
| 21 | struct ata_port_info; | 21 | struct ata_port_info; |
| 22 | struct ahci_host_priv; | 22 | struct ahci_host_priv; |
| 23 | struct platform_device; | 23 | struct platform_device; |
| 24 | struct scsi_host_template; | ||
| 24 | 25 | ||
| 25 | int ahci_platform_enable_clks(struct ahci_host_priv *hpriv); | 26 | int ahci_platform_enable_clks(struct ahci_host_priv *hpriv); |
| 26 | void ahci_platform_disable_clks(struct ahci_host_priv *hpriv); | 27 | void ahci_platform_disable_clks(struct ahci_host_priv *hpriv); |
| 28 | int ahci_platform_enable_regulators(struct ahci_host_priv *hpriv); | ||
| 29 | void ahci_platform_disable_regulators(struct ahci_host_priv *hpriv); | ||
| 27 | int ahci_platform_enable_resources(struct ahci_host_priv *hpriv); | 30 | int ahci_platform_enable_resources(struct ahci_host_priv *hpriv); |
| 28 | void ahci_platform_disable_resources(struct ahci_host_priv *hpriv); | 31 | void ahci_platform_disable_resources(struct ahci_host_priv *hpriv); |
| 29 | struct ahci_host_priv *ahci_platform_get_resources( | 32 | struct ahci_host_priv *ahci_platform_get_resources( |
| 30 | struct platform_device *pdev); | 33 | struct platform_device *pdev); |
| 31 | int ahci_platform_init_host(struct platform_device *pdev, | 34 | int ahci_platform_init_host(struct platform_device *pdev, |
| 32 | struct ahci_host_priv *hpriv, | 35 | struct ahci_host_priv *hpriv, |
| 33 | const struct ata_port_info *pi_template); | 36 | const struct ata_port_info *pi_template, |
| 37 | struct scsi_host_template *sht); | ||
| 34 | 38 | ||
| 35 | int ahci_platform_suspend_host(struct device *dev); | 39 | int ahci_platform_suspend_host(struct device *dev); |
| 36 | int ahci_platform_resume_host(struct device *dev); | 40 | int ahci_platform_resume_host(struct device *dev); |
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index 2afc618b15ce..50fc66868402 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h | |||
| @@ -33,6 +33,7 @@ struct amba_device { | |||
| 33 | struct clk *pclk; | 33 | struct clk *pclk; |
| 34 | unsigned int periphid; | 34 | unsigned int periphid; |
| 35 | unsigned int irq[AMBA_NR_IRQS]; | 35 | unsigned int irq[AMBA_NR_IRQS]; |
| 36 | char *driver_override; | ||
| 36 | }; | 37 | }; |
| 37 | 38 | ||
| 38 | struct amba_driver { | 39 | struct amba_driver { |
| @@ -92,11 +93,15 @@ struct amba_device *amba_find_device(const char *, struct device *, unsigned int | |||
| 92 | int amba_request_regions(struct amba_device *, const char *); | 93 | int amba_request_regions(struct amba_device *, const char *); |
| 93 | void amba_release_regions(struct amba_device *); | 94 | void amba_release_regions(struct amba_device *); |
| 94 | 95 | ||
| 95 | #define amba_pclk_enable(d) \ | 96 | static inline int amba_pclk_enable(struct amba_device *dev) |
| 96 | (IS_ERR((d)->pclk) ? 0 : clk_enable((d)->pclk)) | 97 | { |
| 98 | return clk_enable(dev->pclk); | ||
| 99 | } | ||
| 97 | 100 | ||
| 98 | #define amba_pclk_disable(d) \ | 101 | static inline void amba_pclk_disable(struct amba_device *dev) |
| 99 | do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0) | 102 | { |
| 103 | clk_disable(dev->pclk); | ||
| 104 | } | ||
| 100 | 105 | ||
| 101 | static inline int amba_pclk_prepare(struct amba_device *dev) | 106 | static inline int amba_pclk_prepare(struct amba_device *dev) |
| 102 | { | 107 | { |
diff --git a/include/linux/ata.h b/include/linux/ata.h index f2f4d8da97c0..1648026e06b4 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
| @@ -503,7 +503,7 @@ struct ata_bmdma_prd { | |||
| 503 | #define ata_id_has_dma(id) ((id)[ATA_ID_CAPABILITY] & (1 << 8)) | 503 | #define ata_id_has_dma(id) ((id)[ATA_ID_CAPABILITY] & (1 << 8)) |
| 504 | #define ata_id_has_ncq(id) ((id)[ATA_ID_SATA_CAPABILITY] & (1 << 8)) | 504 | #define ata_id_has_ncq(id) ((id)[ATA_ID_SATA_CAPABILITY] & (1 << 8)) |
| 505 | #define ata_id_queue_depth(id) (((id)[ATA_ID_QUEUE_DEPTH] & 0x1f) + 1) | 505 | #define ata_id_queue_depth(id) (((id)[ATA_ID_QUEUE_DEPTH] & 0x1f) + 1) |
| 506 | #define ata_id_removeable(id) ((id)[ATA_ID_CONFIG] & (1 << 7)) | 506 | #define ata_id_removable(id) ((id)[ATA_ID_CONFIG] & (1 << 7)) |
| 507 | #define ata_id_has_atapi_AN(id) \ | 507 | #define ata_id_has_atapi_AN(id) \ |
| 508 | ((((id)[ATA_ID_SATA_CAPABILITY] != 0x0000) && \ | 508 | ((((id)[ATA_ID_SATA_CAPABILITY] != 0x0000) && \ |
| 509 | ((id)[ATA_ID_SATA_CAPABILITY] != 0xffff)) && \ | 509 | ((id)[ATA_ID_SATA_CAPABILITY] != 0xffff)) && \ |
diff --git a/include/linux/ata_platform.h b/include/linux/ata_platform.h index 5c618a084225..619d9e78e644 100644 --- a/include/linux/ata_platform.h +++ b/include/linux/ata_platform.h | |||
| @@ -10,12 +10,15 @@ struct pata_platform_info { | |||
| 10 | unsigned int ioport_shift; | 10 | unsigned int ioport_shift; |
| 11 | }; | 11 | }; |
| 12 | 12 | ||
| 13 | struct scsi_host_template; | ||
| 14 | |||
| 13 | extern int __pata_platform_probe(struct device *dev, | 15 | extern int __pata_platform_probe(struct device *dev, |
| 14 | struct resource *io_res, | 16 | struct resource *io_res, |
| 15 | struct resource *ctl_res, | 17 | struct resource *ctl_res, |
| 16 | struct resource *irq_res, | 18 | struct resource *irq_res, |
| 17 | unsigned int ioport_shift, | 19 | unsigned int ioport_shift, |
| 18 | int __pio_mask); | 20 | int __pio_mask, |
| 21 | struct scsi_host_template *sht); | ||
| 19 | 22 | ||
| 20 | /* | 23 | /* |
| 21 | * Marvell SATA private data | 24 | * Marvell SATA private data |
diff --git a/include/linux/audit.h b/include/linux/audit.h index af84234e1f6e..599f3bd2d6c5 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
| @@ -46,7 +46,6 @@ struct audit_tree; | |||
| 46 | struct sk_buff; | 46 | struct sk_buff; |
| 47 | 47 | ||
| 48 | struct audit_krule { | 48 | struct audit_krule { |
| 49 | int vers_ops; | ||
| 50 | u32 pflags; | 49 | u32 pflags; |
| 51 | u32 flags; | 50 | u32 flags; |
| 52 | u32 listnr; | 51 | u32 listnr; |
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index 5da6012b7a14..d94077fea1f8 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h | |||
| @@ -106,6 +106,8 @@ struct backing_dev_info { | |||
| 106 | #endif | 106 | #endif |
| 107 | }; | 107 | }; |
| 108 | 108 | ||
| 109 | struct backing_dev_info *inode_to_bdi(struct inode *inode); | ||
| 110 | |||
| 109 | int __must_check bdi_init(struct backing_dev_info *bdi); | 111 | int __must_check bdi_init(struct backing_dev_info *bdi); |
| 110 | void bdi_destroy(struct backing_dev_info *bdi); | 112 | void bdi_destroy(struct backing_dev_info *bdi); |
| 111 | 113 | ||
| @@ -114,7 +116,7 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent, | |||
| 114 | const char *fmt, ...); | 116 | const char *fmt, ...); |
| 115 | int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); | 117 | int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); |
| 116 | void bdi_unregister(struct backing_dev_info *bdi); | 118 | void bdi_unregister(struct backing_dev_info *bdi); |
| 117 | int __must_check bdi_setup_and_register(struct backing_dev_info *, char *, unsigned int); | 119 | int __must_check bdi_setup_and_register(struct backing_dev_info *, char *); |
| 118 | void bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages, | 120 | void bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages, |
| 119 | enum wb_reason reason); | 121 | enum wb_reason reason); |
| 120 | void bdi_start_background_writeback(struct backing_dev_info *bdi); | 122 | void bdi_start_background_writeback(struct backing_dev_info *bdi); |
| @@ -228,46 +230,17 @@ int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio); | |||
| 228 | * BDI_CAP_NO_ACCT_DIRTY: Dirty pages shouldn't contribute to accounting | 230 | * BDI_CAP_NO_ACCT_DIRTY: Dirty pages shouldn't contribute to accounting |
| 229 | * BDI_CAP_NO_WRITEBACK: Don't write pages back | 231 | * BDI_CAP_NO_WRITEBACK: Don't write pages back |
| 230 | * BDI_CAP_NO_ACCT_WB: Don't automatically account writeback pages | 232 | * BDI_CAP_NO_ACCT_WB: Don't automatically account writeback pages |
| 231 | * | ||
| 232 | * These flags let !MMU mmap() govern direct device mapping vs immediate | ||
| 233 | * copying more easily for MAP_PRIVATE, especially for ROM filesystems. | ||
| 234 | * | ||
| 235 | * BDI_CAP_MAP_COPY: Copy can be mapped (MAP_PRIVATE) | ||
| 236 | * BDI_CAP_MAP_DIRECT: Can be mapped directly (MAP_SHARED) | ||
| 237 | * BDI_CAP_READ_MAP: Can be mapped for reading | ||
| 238 | * BDI_CAP_WRITE_MAP: Can be mapped for writing | ||
| 239 | * BDI_CAP_EXEC_MAP: Can be mapped for execution | ||
| 240 | * | ||
| 241 | * BDI_CAP_SWAP_BACKED: Count shmem/tmpfs objects as swap-backed. | ||
| 242 | * | ||
| 243 | * BDI_CAP_STRICTLIMIT: Keep number of dirty pages below bdi threshold. | 233 | * BDI_CAP_STRICTLIMIT: Keep number of dirty pages below bdi threshold. |
| 244 | */ | 234 | */ |
| 245 | #define BDI_CAP_NO_ACCT_DIRTY 0x00000001 | 235 | #define BDI_CAP_NO_ACCT_DIRTY 0x00000001 |
| 246 | #define BDI_CAP_NO_WRITEBACK 0x00000002 | 236 | #define BDI_CAP_NO_WRITEBACK 0x00000002 |
| 247 | #define BDI_CAP_MAP_COPY 0x00000004 | 237 | #define BDI_CAP_NO_ACCT_WB 0x00000004 |
| 248 | #define BDI_CAP_MAP_DIRECT 0x00000008 | 238 | #define BDI_CAP_STABLE_WRITES 0x00000008 |
| 249 | #define BDI_CAP_READ_MAP 0x00000010 | 239 | #define BDI_CAP_STRICTLIMIT 0x00000010 |
| 250 | #define BDI_CAP_WRITE_MAP 0x00000020 | ||
| 251 | #define BDI_CAP_EXEC_MAP 0x00000040 | ||
| 252 | #define BDI_CAP_NO_ACCT_WB 0x00000080 | ||
| 253 | #define BDI_CAP_SWAP_BACKED 0x00000100 | ||
| 254 | #define BDI_CAP_STABLE_WRITES 0x00000200 | ||
| 255 | #define BDI_CAP_STRICTLIMIT 0x00000400 | ||
| 256 | |||
| 257 | #define BDI_CAP_VMFLAGS \ | ||
| 258 | (BDI_CAP_READ_MAP | BDI_CAP_WRITE_MAP | BDI_CAP_EXEC_MAP) | ||
| 259 | 240 | ||
| 260 | #define BDI_CAP_NO_ACCT_AND_WRITEBACK \ | 241 | #define BDI_CAP_NO_ACCT_AND_WRITEBACK \ |
| 261 | (BDI_CAP_NO_WRITEBACK | BDI_CAP_NO_ACCT_DIRTY | BDI_CAP_NO_ACCT_WB) | 242 | (BDI_CAP_NO_WRITEBACK | BDI_CAP_NO_ACCT_DIRTY | BDI_CAP_NO_ACCT_WB) |
| 262 | 243 | ||
| 263 | #if defined(VM_MAYREAD) && \ | ||
| 264 | (BDI_CAP_READ_MAP != VM_MAYREAD || \ | ||
| 265 | BDI_CAP_WRITE_MAP != VM_MAYWRITE || \ | ||
| 266 | BDI_CAP_EXEC_MAP != VM_MAYEXEC) | ||
| 267 | #error please change backing_dev_info::capabilities flags | ||
| 268 | #endif | ||
| 269 | |||
| 270 | extern struct backing_dev_info default_backing_dev_info; | ||
| 271 | extern struct backing_dev_info noop_backing_dev_info; | 244 | extern struct backing_dev_info noop_backing_dev_info; |
| 272 | 245 | ||
| 273 | int writeback_in_progress(struct backing_dev_info *bdi); | 246 | int writeback_in_progress(struct backing_dev_info *bdi); |
| @@ -329,24 +302,14 @@ static inline bool bdi_cap_account_writeback(struct backing_dev_info *bdi) | |||
| 329 | BDI_CAP_NO_WRITEBACK)); | 302 | BDI_CAP_NO_WRITEBACK)); |
| 330 | } | 303 | } |
| 331 | 304 | ||
| 332 | static inline bool bdi_cap_swap_backed(struct backing_dev_info *bdi) | ||
| 333 | { | ||
| 334 | return bdi->capabilities & BDI_CAP_SWAP_BACKED; | ||
| 335 | } | ||
| 336 | |||
| 337 | static inline bool mapping_cap_writeback_dirty(struct address_space *mapping) | 305 | static inline bool mapping_cap_writeback_dirty(struct address_space *mapping) |
| 338 | { | 306 | { |
| 339 | return bdi_cap_writeback_dirty(mapping->backing_dev_info); | 307 | return bdi_cap_writeback_dirty(inode_to_bdi(mapping->host)); |
| 340 | } | 308 | } |
| 341 | 309 | ||
| 342 | static inline bool mapping_cap_account_dirty(struct address_space *mapping) | 310 | static inline bool mapping_cap_account_dirty(struct address_space *mapping) |
| 343 | { | 311 | { |
| 344 | return bdi_cap_account_dirty(mapping->backing_dev_info); | 312 | return bdi_cap_account_dirty(inode_to_bdi(mapping->host)); |
| 345 | } | ||
| 346 | |||
| 347 | static inline bool mapping_cap_swap_backed(struct address_space *mapping) | ||
| 348 | { | ||
| 349 | return bdi_cap_swap_backed(mapping->backing_dev_info); | ||
| 350 | } | 313 | } |
| 351 | 314 | ||
| 352 | static inline int bdi_sched_wait(void *word) | 315 | static inline int bdi_sched_wait(void *word) |
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h index eb1c6a47b67f..994739da827f 100644 --- a/include/linux/bcma/bcma.h +++ b/include/linux/bcma/bcma.h | |||
| @@ -318,6 +318,7 @@ struct bcma_bus { | |||
| 318 | const struct bcma_host_ops *ops; | 318 | const struct bcma_host_ops *ops; |
| 319 | 319 | ||
| 320 | enum bcma_hosttype hosttype; | 320 | enum bcma_hosttype hosttype; |
| 321 | bool host_is_pcie2; /* Used for BCMA_HOSTTYPE_PCI only */ | ||
| 321 | union { | 322 | union { |
| 322 | /* Pointer to the PCI bus (only for BCMA_HOSTTYPE_PCI) */ | 323 | /* Pointer to the PCI bus (only for BCMA_HOSTTYPE_PCI) */ |
| 323 | struct pci_dev *host_pci; | 324 | struct pci_dev *host_pci; |
diff --git a/include/linux/bcma/bcma_driver_pci.h b/include/linux/bcma/bcma_driver_pci.h index 0333e605ea0d..3f809ae372c4 100644 --- a/include/linux/bcma/bcma_driver_pci.h +++ b/include/linux/bcma/bcma_driver_pci.h | |||
| @@ -223,6 +223,7 @@ struct bcma_drv_pci_host { | |||
| 223 | 223 | ||
| 224 | struct bcma_drv_pci { | 224 | struct bcma_drv_pci { |
| 225 | struct bcma_device *core; | 225 | struct bcma_device *core; |
| 226 | u8 early_setup_done:1; | ||
| 226 | u8 setup_done:1; | 227 | u8 setup_done:1; |
| 227 | u8 hostmode:1; | 228 | u8 hostmode:1; |
| 228 | 229 | ||
| @@ -237,6 +238,7 @@ struct bcma_drv_pci { | |||
| 237 | #define pcicore_write16(pc, offset, val) bcma_write16((pc)->core, offset, val) | 238 | #define pcicore_write16(pc, offset, val) bcma_write16((pc)->core, offset, val) |
| 238 | #define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val) | 239 | #define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val) |
| 239 | 240 | ||
| 241 | extern void bcma_core_pci_early_init(struct bcma_drv_pci *pc); | ||
| 240 | extern void bcma_core_pci_init(struct bcma_drv_pci *pc); | 242 | extern void bcma_core_pci_init(struct bcma_drv_pci *pc); |
| 241 | extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, | 243 | extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, |
| 242 | struct bcma_device *core, bool enable); | 244 | struct bcma_device *core, bool enable); |
diff --git a/include/linux/bcma/bcma_regs.h b/include/linux/bcma/bcma_regs.h index e64ae7bf80a1..ebd5c1fcdea4 100644 --- a/include/linux/bcma/bcma_regs.h +++ b/include/linux/bcma/bcma_regs.h | |||
| @@ -64,6 +64,8 @@ | |||
| 64 | #define BCMA_PCI_GPIO_XTAL 0x40 /* PCI config space GPIO 14 for Xtal powerup */ | 64 | #define BCMA_PCI_GPIO_XTAL 0x40 /* PCI config space GPIO 14 for Xtal powerup */ |
| 65 | #define BCMA_PCI_GPIO_PLL 0x80 /* PCI config space GPIO 15 for PLL powerdown */ | 65 | #define BCMA_PCI_GPIO_PLL 0x80 /* PCI config space GPIO 15 for PLL powerdown */ |
| 66 | 66 | ||
| 67 | #define BCMA_PCIE2_BAR0_WIN2 0x70 | ||
| 68 | |||
| 67 | /* SiliconBackplane Address Map. | 69 | /* SiliconBackplane Address Map. |
| 68 | * All regions may not exist on all chips. | 70 | * All regions may not exist on all chips. |
| 69 | */ | 71 | */ |
diff --git a/include/linux/bcma/bcma_soc.h b/include/linux/bcma/bcma_soc.h index f24d245f8394..1b5fc0c3b1b5 100644 --- a/include/linux/bcma/bcma_soc.h +++ b/include/linux/bcma/bcma_soc.h | |||
| @@ -5,8 +5,6 @@ | |||
| 5 | 5 | ||
| 6 | struct bcma_soc { | 6 | struct bcma_soc { |
| 7 | struct bcma_bus bus; | 7 | struct bcma_bus bus; |
| 8 | struct bcma_device core_cc; | ||
| 9 | struct bcma_device core_mips; | ||
| 10 | }; | 8 | }; |
| 11 | 9 | ||
| 12 | int __init bcma_host_soc_register(struct bcma_soc *soc); | 10 | int __init bcma_host_soc_register(struct bcma_soc *soc); |
diff --git a/include/linux/bitrev.h b/include/linux/bitrev.h index 7ffe03f4693d..fb790b8449c1 100644 --- a/include/linux/bitrev.h +++ b/include/linux/bitrev.h | |||
| @@ -3,14 +3,83 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | 5 | ||
| 6 | extern u8 const byte_rev_table[256]; | 6 | #ifdef CONFIG_HAVE_ARCH_BITREVERSE |
| 7 | #include <asm/bitrev.h> | ||
| 8 | |||
| 9 | #define __bitrev32 __arch_bitrev32 | ||
| 10 | #define __bitrev16 __arch_bitrev16 | ||
| 11 | #define __bitrev8 __arch_bitrev8 | ||
| 7 | 12 | ||
| 8 | static inline u8 bitrev8(u8 byte) | 13 | #else |
| 14 | extern u8 const byte_rev_table[256]; | ||
| 15 | static inline u8 __bitrev8(u8 byte) | ||
| 9 | { | 16 | { |
| 10 | return byte_rev_table[byte]; | 17 | return byte_rev_table[byte]; |
| 11 | } | 18 | } |
| 12 | 19 | ||
| 13 | extern u16 bitrev16(u16 in); | 20 | static inline u16 __bitrev16(u16 x) |
| 14 | extern u32 bitrev32(u32 in); | 21 | { |
| 22 | return (__bitrev8(x & 0xff) << 8) | __bitrev8(x >> 8); | ||
| 23 | } | ||
| 24 | |||
| 25 | static inline u32 __bitrev32(u32 x) | ||
| 26 | { | ||
| 27 | return (__bitrev16(x & 0xffff) << 16) | __bitrev16(x >> 16); | ||
| 28 | } | ||
| 29 | |||
| 30 | #endif /* CONFIG_HAVE_ARCH_BITREVERSE */ | ||
| 31 | |||
| 32 | #define __constant_bitrev32(x) \ | ||
| 33 | ({ \ | ||
| 34 | u32 __x = x; \ | ||
| 35 | __x = (__x >> 16) | (__x << 16); \ | ||
| 36 | __x = ((__x & (u32)0xFF00FF00UL) >> 8) | ((__x & (u32)0x00FF00FFUL) << 8); \ | ||
| 37 | __x = ((__x & (u32)0xF0F0F0F0UL) >> 4) | ((__x & (u32)0x0F0F0F0FUL) << 4); \ | ||
| 38 | __x = ((__x & (u32)0xCCCCCCCCUL) >> 2) | ((__x & (u32)0x33333333UL) << 2); \ | ||
| 39 | __x = ((__x & (u32)0xAAAAAAAAUL) >> 1) | ((__x & (u32)0x55555555UL) << 1); \ | ||
| 40 | __x; \ | ||
| 41 | }) | ||
| 42 | |||
| 43 | #define __constant_bitrev16(x) \ | ||
| 44 | ({ \ | ||
| 45 | u16 __x = x; \ | ||
| 46 | __x = (__x >> 8) | (__x << 8); \ | ||
| 47 | __x = ((__x & (u16)0xF0F0U) >> 4) | ((__x & (u16)0x0F0FU) << 4); \ | ||
| 48 | __x = ((__x & (u16)0xCCCCU) >> 2) | ((__x & (u16)0x3333U) << 2); \ | ||
| 49 | __x = ((__x & (u16)0xAAAAU) >> 1) | ((__x & (u16)0x5555U) << 1); \ | ||
| 50 | __x; \ | ||
| 51 | }) | ||
| 52 | |||
| 53 | #define __constant_bitrev8(x) \ | ||
| 54 | ({ \ | ||
| 55 | u8 __x = x; \ | ||
| 56 | __x = (__x >> 4) | (__x << 4); \ | ||
| 57 | __x = ((__x & (u8)0xCCU) >> 2) | ((__x & (u8)0x33U) << 2); \ | ||
| 58 | __x = ((__x & (u8)0xAAU) >> 1) | ((__x & (u8)0x55U) << 1); \ | ||
| 59 | __x; \ | ||
| 60 | }) | ||
| 61 | |||
| 62 | #define bitrev32(x) \ | ||
| 63 | ({ \ | ||
| 64 | u32 __x = x; \ | ||
| 65 | __builtin_constant_p(__x) ? \ | ||
| 66 | __constant_bitrev32(__x) : \ | ||
| 67 | __bitrev32(__x); \ | ||
| 68 | }) | ||
| 69 | |||
| 70 | #define bitrev16(x) \ | ||
| 71 | ({ \ | ||
| 72 | u16 __x = x; \ | ||
| 73 | __builtin_constant_p(__x) ? \ | ||
| 74 | __constant_bitrev16(__x) : \ | ||
| 75 | __bitrev16(__x); \ | ||
| 76 | }) | ||
| 15 | 77 | ||
| 78 | #define bitrev8(x) \ | ||
| 79 | ({ \ | ||
| 80 | u8 __x = x; \ | ||
| 81 | __builtin_constant_p(__x) ? \ | ||
| 82 | __constant_bitrev8(__x) : \ | ||
| 83 | __bitrev8(__x) ; \ | ||
| 84 | }) | ||
| 16 | #endif /* _LINUX_BITREV_H */ | 85 | #endif /* _LINUX_BITREV_H */ |
diff --git a/include/linux/cdev.h b/include/linux/cdev.h index fb4591977b03..f8763615a5f2 100644 --- a/include/linux/cdev.h +++ b/include/linux/cdev.h | |||
| @@ -30,6 +30,4 @@ void cdev_del(struct cdev *); | |||
| 30 | 30 | ||
| 31 | void cd_forget(struct inode *); | 31 | void cd_forget(struct inode *); |
| 32 | 32 | ||
| 33 | extern struct backing_dev_info directly_mappable_cdev_bdi; | ||
| 34 | |||
| 35 | #endif | 33 | #endif |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index da0dae0600e6..b9cb94c3102a 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
| @@ -943,6 +943,8 @@ struct cgroup_subsys_state *css_tryget_online_from_dir(struct dentry *dentry, | |||
| 943 | 943 | ||
| 944 | #else /* !CONFIG_CGROUPS */ | 944 | #else /* !CONFIG_CGROUPS */ |
| 945 | 945 | ||
| 946 | struct cgroup_subsys_state; | ||
| 947 | |||
| 946 | static inline int cgroup_init_early(void) { return 0; } | 948 | static inline int cgroup_init_early(void) { return 0; } |
| 947 | static inline int cgroup_init(void) { return 0; } | 949 | static inline int cgroup_init(void) { return 0; } |
| 948 | static inline void cgroup_fork(struct task_struct *p) {} | 950 | static inline void cgroup_fork(struct task_struct *p) {} |
| @@ -955,6 +957,8 @@ static inline int cgroupstats_build(struct cgroupstats *stats, | |||
| 955 | return -EINVAL; | 957 | return -EINVAL; |
| 956 | } | 958 | } |
| 957 | 959 | ||
| 960 | static inline void css_put(struct cgroup_subsys_state *css) {} | ||
| 961 | |||
| 958 | /* No cgroups - nothing to do */ | 962 | /* No cgroups - nothing to do */ |
| 959 | static inline int cgroup_attach_task_all(struct task_struct *from, | 963 | static inline int cgroup_attach_task_all(struct task_struct *from, |
| 960 | struct task_struct *t) | 964 | struct task_struct *t) |
diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h index 98c4f9b12b03..e4a96fb14403 100644 --- a/include/linux/cgroup_subsys.h +++ b/include/linux/cgroup_subsys.h | |||
| @@ -15,6 +15,10 @@ SUBSYS(cpu) | |||
| 15 | SUBSYS(cpuacct) | 15 | SUBSYS(cpuacct) |
| 16 | #endif | 16 | #endif |
| 17 | 17 | ||
| 18 | #if IS_ENABLED(CONFIG_BLK_CGROUP) | ||
| 19 | SUBSYS(blkio) | ||
| 20 | #endif | ||
| 21 | |||
| 18 | #if IS_ENABLED(CONFIG_MEMCG) | 22 | #if IS_ENABLED(CONFIG_MEMCG) |
| 19 | SUBSYS(memory) | 23 | SUBSYS(memory) |
| 20 | #endif | 24 | #endif |
| @@ -31,10 +35,6 @@ SUBSYS(freezer) | |||
| 31 | SUBSYS(net_cls) | 35 | SUBSYS(net_cls) |
| 32 | #endif | 36 | #endif |
| 33 | 37 | ||
| 34 | #if IS_ENABLED(CONFIG_BLK_CGROUP) | ||
| 35 | SUBSYS(blkio) | ||
| 36 | #endif | ||
| 37 | |||
| 38 | #if IS_ENABLED(CONFIG_CGROUP_PERF) | 38 | #if IS_ENABLED(CONFIG_CGROUP_PERF) |
| 39 | SUBSYS(perf_event) | 39 | SUBSYS(perf_event) |
| 40 | #endif | 40 | #endif |
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index abcafaa20b86..9c78d15d33e4 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
| @@ -18,8 +18,6 @@ | |||
| 18 | #include <asm/div64.h> | 18 | #include <asm/div64.h> |
| 19 | #include <asm/io.h> | 19 | #include <asm/io.h> |
| 20 | 20 | ||
| 21 | /* clocksource cycle base type */ | ||
| 22 | typedef u64 cycle_t; | ||
| 23 | struct clocksource; | 21 | struct clocksource; |
| 24 | struct module; | 22 | struct module; |
| 25 | 23 | ||
| @@ -28,106 +26,6 @@ struct module; | |||
| 28 | #endif | 26 | #endif |
| 29 | 27 | ||
| 30 | /** | 28 | /** |
| 31 | * struct cyclecounter - hardware abstraction for a free running counter | ||
| 32 | * Provides completely state-free accessors to the underlying hardware. | ||
| 33 | * Depending on which hardware it reads, the cycle counter may wrap | ||
| 34 | * around quickly. Locking rules (if necessary) have to be defined | ||
| 35 | * by the implementor and user of specific instances of this API. | ||
| 36 | * | ||
| 37 | * @read: returns the current cycle value | ||
| 38 | * @mask: bitmask for two's complement | ||
| 39 | * subtraction of non 64 bit counters, | ||
| 40 | * see CLOCKSOURCE_MASK() helper macro | ||
| 41 | * @mult: cycle to nanosecond multiplier | ||
| 42 | * @shift: cycle to nanosecond divisor (power of two) | ||
| 43 | */ | ||
| 44 | struct cyclecounter { | ||
| 45 | cycle_t (*read)(const struct cyclecounter *cc); | ||
| 46 | cycle_t mask; | ||
| 47 | u32 mult; | ||
| 48 | u32 shift; | ||
| 49 | }; | ||
| 50 | |||
| 51 | /** | ||
| 52 | * struct timecounter - layer above a %struct cyclecounter which counts nanoseconds | ||
| 53 | * Contains the state needed by timecounter_read() to detect | ||
| 54 | * cycle counter wrap around. Initialize with | ||
| 55 | * timecounter_init(). Also used to convert cycle counts into the | ||
| 56 | * corresponding nanosecond counts with timecounter_cyc2time(). Users | ||
| 57 | * of this code are responsible for initializing the underlying | ||
| 58 | * cycle counter hardware, locking issues and reading the time | ||
| 59 | * more often than the cycle counter wraps around. The nanosecond | ||
| 60 | * counter will only wrap around after ~585 years. | ||
| 61 | * | ||
| 62 | * @cc: the cycle counter used by this instance | ||
| 63 | * @cycle_last: most recent cycle counter value seen by | ||
| 64 | * timecounter_read() | ||
| 65 | * @nsec: continuously increasing count | ||
| 66 | */ | ||
| 67 | struct timecounter { | ||
| 68 | const struct cyclecounter *cc; | ||
| 69 | cycle_t cycle_last; | ||
| 70 | u64 nsec; | ||
| 71 | }; | ||
| 72 | |||
| 73 | /** | ||
| 74 | * cyclecounter_cyc2ns - converts cycle counter cycles to nanoseconds | ||
| 75 | * @cc: Pointer to cycle counter. | ||
| 76 | * @cycles: Cycles | ||
| 77 | * | ||
| 78 | * XXX - This could use some mult_lxl_ll() asm optimization. Same code | ||
| 79 | * as in cyc2ns, but with unsigned result. | ||
| 80 | */ | ||
| 81 | static inline u64 cyclecounter_cyc2ns(const struct cyclecounter *cc, | ||
| 82 | cycle_t cycles) | ||
| 83 | { | ||
| 84 | u64 ret = (u64)cycles; | ||
| 85 | ret = (ret * cc->mult) >> cc->shift; | ||
| 86 | return ret; | ||
| 87 | } | ||
| 88 | |||
| 89 | /** | ||
| 90 | * timecounter_init - initialize a time counter | ||
| 91 | * @tc: Pointer to time counter which is to be initialized/reset | ||
| 92 | * @cc: A cycle counter, ready to be used. | ||
| 93 | * @start_tstamp: Arbitrary initial time stamp. | ||
| 94 | * | ||
| 95 | * After this call the current cycle register (roughly) corresponds to | ||
| 96 | * the initial time stamp. Every call to timecounter_read() increments | ||
| 97 | * the time stamp counter by the number of elapsed nanoseconds. | ||
| 98 | */ | ||
| 99 | extern void timecounter_init(struct timecounter *tc, | ||
| 100 | const struct cyclecounter *cc, | ||
| 101 | u64 start_tstamp); | ||
| 102 | |||
| 103 | /** | ||
| 104 | * timecounter_read - return nanoseconds elapsed since timecounter_init() | ||
| 105 | * plus the initial time stamp | ||
| 106 | * @tc: Pointer to time counter. | ||
| 107 | * | ||
| 108 | * In other words, keeps track of time since the same epoch as | ||
| 109 | * the function which generated the initial time stamp. | ||
| 110 | */ | ||
| 111 | extern u64 timecounter_read(struct timecounter *tc); | ||
| 112 | |||
| 113 | /** | ||
| 114 | * timecounter_cyc2time - convert a cycle counter to same | ||
| 115 | * time base as values returned by | ||
| 116 | * timecounter_read() | ||
| 117 | * @tc: Pointer to time counter. | ||
| 118 | * @cycle_tstamp: a value returned by tc->cc->read() | ||
| 119 | * | ||
| 120 | * Cycle counts that are converted correctly as long as they | ||
| 121 | * fall into the interval [-1/2 max cycle count, +1/2 max cycle count], | ||
| 122 | * with "max cycle count" == cs->mask+1. | ||
| 123 | * | ||
| 124 | * This allows conversion of cycle counter values which were generated | ||
| 125 | * in the past. | ||
| 126 | */ | ||
| 127 | extern u64 timecounter_cyc2time(struct timecounter *tc, | ||
| 128 | cycle_t cycle_tstamp); | ||
| 129 | |||
| 130 | /** | ||
| 131 | * struct clocksource - hardware abstraction for a free running counter | 29 | * struct clocksource - hardware abstraction for a free running counter |
| 132 | * Provides mostly state-free accessors to the underlying hardware. | 30 | * Provides mostly state-free accessors to the underlying hardware. |
| 133 | * This is the structure used for system time. | 31 | * This is the structure used for system time. |
diff --git a/include/linux/compaction.h b/include/linux/compaction.h index 3238ffa33f68..a014559e4a49 100644 --- a/include/linux/compaction.h +++ b/include/linux/compaction.h | |||
| @@ -12,6 +12,10 @@ | |||
| 12 | #define COMPACT_PARTIAL 3 | 12 | #define COMPACT_PARTIAL 3 |
| 13 | /* The full zone was compacted */ | 13 | /* The full zone was compacted */ |
| 14 | #define COMPACT_COMPLETE 4 | 14 | #define COMPACT_COMPLETE 4 |
| 15 | /* For more detailed tracepoint output */ | ||
| 16 | #define COMPACT_NO_SUITABLE_PAGE 5 | ||
| 17 | #define COMPACT_NOT_SUITABLE_ZONE 6 | ||
| 18 | /* When adding new state, please change compaction_status_string, too */ | ||
| 15 | 19 | ||
| 16 | /* Used to signal whether compaction detected need_sched() or lock contention */ | 20 | /* Used to signal whether compaction detected need_sched() or lock contention */ |
| 17 | /* No contention detected */ | 21 | /* No contention detected */ |
| @@ -21,6 +25,8 @@ | |||
| 21 | /* Zone lock or lru_lock was contended in async compaction */ | 25 | /* Zone lock or lru_lock was contended in async compaction */ |
| 22 | #define COMPACT_CONTENDED_LOCK 2 | 26 | #define COMPACT_CONTENDED_LOCK 2 |
| 23 | 27 | ||
| 28 | struct alloc_context; /* in mm/internal.h */ | ||
| 29 | |||
| 24 | #ifdef CONFIG_COMPACTION | 30 | #ifdef CONFIG_COMPACTION |
| 25 | extern int sysctl_compact_memory; | 31 | extern int sysctl_compact_memory; |
| 26 | extern int sysctl_compaction_handler(struct ctl_table *table, int write, | 32 | extern int sysctl_compaction_handler(struct ctl_table *table, int write, |
| @@ -30,81 +36,25 @@ extern int sysctl_extfrag_handler(struct ctl_table *table, int write, | |||
| 30 | void __user *buffer, size_t *length, loff_t *ppos); | 36 | void __user *buffer, size_t *length, loff_t *ppos); |
| 31 | 37 | ||
| 32 | extern int fragmentation_index(struct zone *zone, unsigned int order); | 38 | extern int fragmentation_index(struct zone *zone, unsigned int order); |
| 33 | extern unsigned long try_to_compact_pages(struct zonelist *zonelist, | 39 | extern unsigned long try_to_compact_pages(gfp_t gfp_mask, unsigned int order, |
| 34 | int order, gfp_t gfp_mask, nodemask_t *mask, | 40 | int alloc_flags, const struct alloc_context *ac, |
| 35 | enum migrate_mode mode, int *contended, | 41 | enum migrate_mode mode, int *contended); |
| 36 | int alloc_flags, int classzone_idx); | ||
| 37 | extern void compact_pgdat(pg_data_t *pgdat, int order); | 42 | extern void compact_pgdat(pg_data_t *pgdat, int order); |
| 38 | extern void reset_isolation_suitable(pg_data_t *pgdat); | 43 | extern void reset_isolation_suitable(pg_data_t *pgdat); |
| 39 | extern unsigned long compaction_suitable(struct zone *zone, int order, | 44 | extern unsigned long compaction_suitable(struct zone *zone, int order, |
| 40 | int alloc_flags, int classzone_idx); | 45 | int alloc_flags, int classzone_idx); |
| 41 | 46 | ||
| 42 | /* Do not skip compaction more than 64 times */ | 47 | extern void defer_compaction(struct zone *zone, int order); |
| 43 | #define COMPACT_MAX_DEFER_SHIFT 6 | 48 | extern bool compaction_deferred(struct zone *zone, int order); |
| 44 | 49 | extern void compaction_defer_reset(struct zone *zone, int order, | |
| 45 | /* | 50 | bool alloc_success); |
| 46 | * Compaction is deferred when compaction fails to result in a page | 51 | extern bool compaction_restarting(struct zone *zone, int order); |
| 47 | * allocation success. 1 << compact_defer_limit compactions are skipped up | ||
| 48 | * to a limit of 1 << COMPACT_MAX_DEFER_SHIFT | ||
| 49 | */ | ||
| 50 | static inline void defer_compaction(struct zone *zone, int order) | ||
| 51 | { | ||
| 52 | zone->compact_considered = 0; | ||
| 53 | zone->compact_defer_shift++; | ||
| 54 | |||
| 55 | if (order < zone->compact_order_failed) | ||
| 56 | zone->compact_order_failed = order; | ||
| 57 | |||
| 58 | if (zone->compact_defer_shift > COMPACT_MAX_DEFER_SHIFT) | ||
| 59 | zone->compact_defer_shift = COMPACT_MAX_DEFER_SHIFT; | ||
| 60 | } | ||
| 61 | |||
| 62 | /* Returns true if compaction should be skipped this time */ | ||
| 63 | static inline bool compaction_deferred(struct zone *zone, int order) | ||
| 64 | { | ||
| 65 | unsigned long defer_limit = 1UL << zone->compact_defer_shift; | ||
| 66 | |||
| 67 | if (order < zone->compact_order_failed) | ||
| 68 | return false; | ||
| 69 | |||
| 70 | /* Avoid possible overflow */ | ||
| 71 | if (++zone->compact_considered > defer_limit) | ||
| 72 | zone->compact_considered = defer_limit; | ||
| 73 | |||
| 74 | return zone->compact_considered < defer_limit; | ||
| 75 | } | ||
| 76 | |||
| 77 | /* | ||
| 78 | * Update defer tracking counters after successful compaction of given order, | ||
| 79 | * which means an allocation either succeeded (alloc_success == true) or is | ||
| 80 | * expected to succeed. | ||
| 81 | */ | ||
| 82 | static inline void compaction_defer_reset(struct zone *zone, int order, | ||
| 83 | bool alloc_success) | ||
| 84 | { | ||
| 85 | if (alloc_success) { | ||
| 86 | zone->compact_considered = 0; | ||
| 87 | zone->compact_defer_shift = 0; | ||
| 88 | } | ||
| 89 | if (order >= zone->compact_order_failed) | ||
| 90 | zone->compact_order_failed = order + 1; | ||
| 91 | } | ||
| 92 | |||
| 93 | /* Returns true if restarting compaction after many failures */ | ||
| 94 | static inline bool compaction_restarting(struct zone *zone, int order) | ||
| 95 | { | ||
| 96 | if (order < zone->compact_order_failed) | ||
| 97 | return false; | ||
| 98 | |||
| 99 | return zone->compact_defer_shift == COMPACT_MAX_DEFER_SHIFT && | ||
| 100 | zone->compact_considered >= 1UL << zone->compact_defer_shift; | ||
| 101 | } | ||
| 102 | 52 | ||
| 103 | #else | 53 | #else |
| 104 | static inline unsigned long try_to_compact_pages(struct zonelist *zonelist, | 54 | static inline unsigned long try_to_compact_pages(gfp_t gfp_mask, |
| 105 | int order, gfp_t gfp_mask, nodemask_t *nodemask, | 55 | unsigned int order, int alloc_flags, |
| 106 | enum migrate_mode mode, int *contended, | 56 | const struct alloc_context *ac, |
| 107 | int alloc_flags, int classzone_idx) | 57 | enum migrate_mode mode, int *contended) |
| 108 | { | 58 | { |
| 109 | return COMPACT_CONTINUE; | 59 | return COMPACT_CONTINUE; |
| 110 | } | 60 | } |
diff --git a/include/linux/compat.h b/include/linux/compat.h index 7450ca2ac1fc..ab25814690bc 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
| @@ -689,6 +689,15 @@ asmlinkage long compat_sys_sendfile64(int out_fd, int in_fd, | |||
| 689 | asmlinkage long compat_sys_sigaltstack(const compat_stack_t __user *uss_ptr, | 689 | asmlinkage long compat_sys_sigaltstack(const compat_stack_t __user *uss_ptr, |
| 690 | compat_stack_t __user *uoss_ptr); | 690 | compat_stack_t __user *uoss_ptr); |
| 691 | 691 | ||
| 692 | #ifdef __ARCH_WANT_SYS_SIGPENDING | ||
| 693 | asmlinkage long compat_sys_sigpending(compat_old_sigset_t __user *set); | ||
| 694 | #endif | ||
| 695 | |||
| 696 | #ifdef __ARCH_WANT_SYS_SIGPROCMASK | ||
| 697 | asmlinkage long compat_sys_sigprocmask(int how, compat_old_sigset_t __user *nset, | ||
| 698 | compat_old_sigset_t __user *oset); | ||
| 699 | #endif | ||
| 700 | |||
| 692 | int compat_restore_altstack(const compat_stack_t __user *uss); | 701 | int compat_restore_altstack(const compat_stack_t __user *uss); |
| 693 | int __compat_save_altstack(compat_stack_t __user *, unsigned long); | 702 | int __compat_save_altstack(compat_stack_t __user *, unsigned long); |
| 694 | #define compat_save_altstack_ex(uss, sp) do { \ | 703 | #define compat_save_altstack_ex(uss, sp) do { \ |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 33063f872ee3..17f624cdf53c 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
| @@ -54,7 +54,11 @@ extern void __chk_io_ptr(const volatile void __iomem *); | |||
| 54 | #include <linux/compiler-gcc.h> | 54 | #include <linux/compiler-gcc.h> |
| 55 | #endif | 55 | #endif |
| 56 | 56 | ||
| 57 | #ifdef CC_USING_HOTPATCH | ||
| 58 | #define notrace __attribute__((hotpatch(0,0))) | ||
| 59 | #else | ||
| 57 | #define notrace __attribute__((no_instrument_function)) | 60 | #define notrace __attribute__((no_instrument_function)) |
| 61 | #endif | ||
| 58 | 62 | ||
| 59 | /* Intel compiler defines __GNUC__. So we will overwrite implementations | 63 | /* Intel compiler defines __GNUC__. So we will overwrite implementations |
| 60 | * coming from above header files here | 64 | * coming from above header files here |
| @@ -385,7 +389,7 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s | |||
| 385 | 389 | ||
| 386 | /* Is this type a native word size -- useful for atomic operations */ | 390 | /* Is this type a native word size -- useful for atomic operations */ |
| 387 | #ifndef __native_word | 391 | #ifndef __native_word |
| 388 | # define __native_word(t) (sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long)) | 392 | # define __native_word(t) (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long)) |
| 389 | #endif | 393 | #endif |
| 390 | 394 | ||
| 391 | /* Compile time object size, -1 for unknown */ | 395 | /* Compile time object size, -1 for unknown */ |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 4d078cebafd2..2ee4888c1f47 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
| @@ -66,8 +66,6 @@ struct cpufreq_policy { | |||
| 66 | unsigned int shared_type; /* ACPI: ANY or ALL affected CPUs | 66 | unsigned int shared_type; /* ACPI: ANY or ALL affected CPUs |
| 67 | should set cpufreq */ | 67 | should set cpufreq */ |
| 68 | unsigned int cpu; /* cpu nr of CPU managing this policy */ | 68 | unsigned int cpu; /* cpu nr of CPU managing this policy */ |
| 69 | unsigned int last_cpu; /* cpu nr of previous CPU that managed | ||
| 70 | * this policy */ | ||
| 71 | struct clk *clk; | 69 | struct clk *clk; |
| 72 | struct cpufreq_cpuinfo cpuinfo;/* see above */ | 70 | struct cpufreq_cpuinfo cpuinfo;/* see above */ |
| 73 | 71 | ||
| @@ -113,6 +111,9 @@ struct cpufreq_policy { | |||
| 113 | wait_queue_head_t transition_wait; | 111 | wait_queue_head_t transition_wait; |
| 114 | struct task_struct *transition_task; /* Task which is doing the transition */ | 112 | struct task_struct *transition_task; /* Task which is doing the transition */ |
| 115 | 113 | ||
| 114 | /* cpufreq-stats */ | ||
| 115 | struct cpufreq_stats *stats; | ||
| 116 | |||
| 116 | /* For cpufreq driver's internal use */ | 117 | /* For cpufreq driver's internal use */ |
| 117 | void *driver_data; | 118 | void *driver_data; |
| 118 | }; | 119 | }; |
| @@ -367,9 +368,8 @@ static inline void cpufreq_resume(void) {} | |||
| 367 | #define CPUFREQ_INCOMPATIBLE (1) | 368 | #define CPUFREQ_INCOMPATIBLE (1) |
| 368 | #define CPUFREQ_NOTIFY (2) | 369 | #define CPUFREQ_NOTIFY (2) |
| 369 | #define CPUFREQ_START (3) | 370 | #define CPUFREQ_START (3) |
| 370 | #define CPUFREQ_UPDATE_POLICY_CPU (4) | 371 | #define CPUFREQ_CREATE_POLICY (4) |
| 371 | #define CPUFREQ_CREATE_POLICY (5) | 372 | #define CPUFREQ_REMOVE_POLICY (5) |
| 372 | #define CPUFREQ_REMOVE_POLICY (6) | ||
| 373 | 373 | ||
| 374 | #ifdef CONFIG_CPU_FREQ | 374 | #ifdef CONFIG_CPU_FREQ |
| 375 | int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list); | 375 | int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list); |
diff --git a/include/linux/devfreq-event.h b/include/linux/devfreq-event.h new file mode 100644 index 000000000000..602fbbfcfeed --- /dev/null +++ b/include/linux/devfreq-event.h | |||
| @@ -0,0 +1,196 @@ | |||
| 1 | /* | ||
| 2 | * devfreq-event: a framework to provide raw data and events of devfreq devices | ||
| 3 | * | ||
| 4 | * Copyright (C) 2014 Samsung Electronics | ||
| 5 | * Author: Chanwoo Choi <cw00.choi@samsung.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 version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef __LINUX_DEVFREQ_EVENT_H__ | ||
| 13 | #define __LINUX_DEVFREQ_EVENT_H__ | ||
| 14 | |||
| 15 | #include <linux/device.h> | ||
| 16 | |||
| 17 | /** | ||
| 18 | * struct devfreq_event_dev - the devfreq-event device | ||
| 19 | * | ||
| 20 | * @node : Contain the devfreq-event device that have been registered. | ||
| 21 | * @dev : the device registered by devfreq-event class. dev.parent is | ||
| 22 | * the device using devfreq-event. | ||
| 23 | * @lock : a mutex to protect accessing devfreq-event. | ||
| 24 | * @enable_count: the number of enable function have been called. | ||
| 25 | * @desc : the description for devfreq-event device. | ||
| 26 | * | ||
| 27 | * This structure contains devfreq-event device information. | ||
| 28 | */ | ||
| 29 | struct devfreq_event_dev { | ||
| 30 | struct list_head node; | ||
| 31 | |||
| 32 | struct device dev; | ||
| 33 | struct mutex lock; | ||
| 34 | u32 enable_count; | ||
| 35 | |||
| 36 | const struct devfreq_event_desc *desc; | ||
| 37 | }; | ||
| 38 | |||
| 39 | /** | ||
| 40 | * struct devfreq_event_data - the devfreq-event data | ||
| 41 | * | ||
| 42 | * @load_count : load count of devfreq-event device for the given period. | ||
| 43 | * @total_count : total count of devfreq-event device for the given period. | ||
| 44 | * each count may represent a clock cycle, a time unit | ||
| 45 | * (ns/us/...), or anything the device driver wants. | ||
| 46 | * Generally, utilization is load_count / total_count. | ||
| 47 | * | ||
| 48 | * This structure contains the data of devfreq-event device for polling period. | ||
| 49 | */ | ||
| 50 | struct devfreq_event_data { | ||
| 51 | unsigned long load_count; | ||
| 52 | unsigned long total_count; | ||
| 53 | }; | ||
| 54 | |||
| 55 | /** | ||
| 56 | * struct devfreq_event_ops - the operations of devfreq-event device | ||
| 57 | * | ||
| 58 | * @enable : Enable the devfreq-event device. | ||
| 59 | * @disable : Disable the devfreq-event device. | ||
| 60 | * @reset : Reset all setting of the devfreq-event device. | ||
| 61 | * @set_event : Set the specific event type for the devfreq-event device. | ||
| 62 | * @get_event : Get the result of the devfreq-event devie with specific | ||
| 63 | * event type. | ||
| 64 | * | ||
| 65 | * This structure contains devfreq-event device operations which can be | ||
| 66 | * implemented by devfreq-event device drivers. | ||
| 67 | */ | ||
| 68 | struct devfreq_event_ops { | ||
| 69 | /* Optional functions */ | ||
| 70 | int (*enable)(struct devfreq_event_dev *edev); | ||
| 71 | int (*disable)(struct devfreq_event_dev *edev); | ||
| 72 | int (*reset)(struct devfreq_event_dev *edev); | ||
| 73 | |||
| 74 | /* Mandatory functions */ | ||
| 75 | int (*set_event)(struct devfreq_event_dev *edev); | ||
| 76 | int (*get_event)(struct devfreq_event_dev *edev, | ||
| 77 | struct devfreq_event_data *edata); | ||
| 78 | }; | ||
| 79 | |||
| 80 | /** | ||
| 81 | * struct devfreq_event_desc - the descriptor of devfreq-event device | ||
| 82 | * | ||
| 83 | * @name : the name of devfreq-event device. | ||
| 84 | * @driver_data : the private data for devfreq-event driver. | ||
| 85 | * @ops : the operation to control devfreq-event device. | ||
| 86 | * | ||
| 87 | * Each devfreq-event device is described with a this structure. | ||
| 88 | * This structure contains the various data for devfreq-event device. | ||
| 89 | */ | ||
| 90 | struct devfreq_event_desc { | ||
| 91 | const char *name; | ||
| 92 | void *driver_data; | ||
| 93 | |||
| 94 | struct devfreq_event_ops *ops; | ||
| 95 | }; | ||
| 96 | |||
| 97 | #if defined(CONFIG_PM_DEVFREQ_EVENT) | ||
| 98 | extern int devfreq_event_enable_edev(struct devfreq_event_dev *edev); | ||
| 99 | extern int devfreq_event_disable_edev(struct devfreq_event_dev *edev); | ||
| 100 | extern bool devfreq_event_is_enabled(struct devfreq_event_dev *edev); | ||
| 101 | extern int devfreq_event_set_event(struct devfreq_event_dev *edev); | ||
| 102 | extern int devfreq_event_get_event(struct devfreq_event_dev *edev, | ||
| 103 | struct devfreq_event_data *edata); | ||
| 104 | extern int devfreq_event_reset_event(struct devfreq_event_dev *edev); | ||
| 105 | extern struct devfreq_event_dev *devfreq_event_get_edev_by_phandle( | ||
| 106 | struct device *dev, int index); | ||
| 107 | extern int devfreq_event_get_edev_count(struct device *dev); | ||
| 108 | extern struct devfreq_event_dev *devfreq_event_add_edev(struct device *dev, | ||
| 109 | struct devfreq_event_desc *desc); | ||
| 110 | extern int devfreq_event_remove_edev(struct devfreq_event_dev *edev); | ||
| 111 | extern struct devfreq_event_dev *devm_devfreq_event_add_edev(struct device *dev, | ||
| 112 | struct devfreq_event_desc *desc); | ||
| 113 | extern void devm_devfreq_event_remove_edev(struct device *dev, | ||
| 114 | struct devfreq_event_dev *edev); | ||
| 115 | static inline void *devfreq_event_get_drvdata(struct devfreq_event_dev *edev) | ||
| 116 | { | ||
| 117 | return edev->desc->driver_data; | ||
| 118 | } | ||
| 119 | #else | ||
| 120 | static inline int devfreq_event_enable_edev(struct devfreq_event_dev *edev) | ||
| 121 | { | ||
| 122 | return -EINVAL; | ||
| 123 | } | ||
| 124 | |||
| 125 | static inline int devfreq_event_disable_edev(struct devfreq_event_dev *edev) | ||
| 126 | { | ||
| 127 | return -EINVAL; | ||
| 128 | } | ||
| 129 | |||
| 130 | static inline bool devfreq_event_is_enabled(struct devfreq_event_dev *edev) | ||
| 131 | { | ||
| 132 | return false; | ||
| 133 | } | ||
| 134 | |||
| 135 | static inline int devfreq_event_set_event(struct devfreq_event_dev *edev) | ||
| 136 | { | ||
| 137 | return -EINVAL; | ||
| 138 | } | ||
| 139 | |||
| 140 | static inline int devfreq_event_get_event(struct devfreq_event_dev *edev, | ||
| 141 | struct devfreq_event_data *edata) | ||
| 142 | { | ||
| 143 | return -EINVAL; | ||
| 144 | } | ||
| 145 | |||
| 146 | static inline int devfreq_event_reset_event(struct devfreq_event_dev *edev) | ||
| 147 | { | ||
| 148 | return -EINVAL; | ||
| 149 | } | ||
| 150 | |||
| 151 | static inline void *devfreq_event_get_drvdata(struct devfreq_event_dev *edev) | ||
| 152 | { | ||
| 153 | return ERR_PTR(-EINVAL); | ||
| 154 | } | ||
| 155 | |||
| 156 | static inline struct devfreq_event_dev *devfreq_event_get_edev_by_phandle( | ||
| 157 | struct device *dev, int index) | ||
| 158 | { | ||
| 159 | return ERR_PTR(-EINVAL); | ||
| 160 | } | ||
| 161 | |||
| 162 | static inline int devfreq_event_get_edev_count(struct device *dev) | ||
| 163 | { | ||
| 164 | return -EINVAL; | ||
| 165 | } | ||
| 166 | |||
| 167 | static inline struct devfreq_event_dev *devfreq_event_add_edev(struct device *dev, | ||
| 168 | struct devfreq_event_desc *desc) | ||
| 169 | { | ||
| 170 | return ERR_PTR(-EINVAL); | ||
| 171 | } | ||
| 172 | |||
| 173 | static inline int devfreq_event_remove_edev(struct devfreq_event_dev *edev) | ||
| 174 | { | ||
| 175 | return -EINVAL; | ||
| 176 | } | ||
| 177 | |||
| 178 | static inline struct devfreq_event_dev *devm_devfreq_event_add_edev( | ||
| 179 | struct device *dev, | ||
| 180 | struct devfreq_event_desc *desc) | ||
| 181 | { | ||
| 182 | return ERR_PTR(-EINVAL); | ||
| 183 | } | ||
| 184 | |||
| 185 | static inline void devm_devfreq_event_remove_edev(struct device *dev, | ||
| 186 | struct devfreq_event_dev *edev) | ||
| 187 | { | ||
| 188 | } | ||
| 189 | |||
| 190 | static inline void *devfreq_event_get_drvdata(struct devfreq_event_dev *edev) | ||
| 191 | { | ||
| 192 | return NULL; | ||
| 193 | } | ||
| 194 | #endif /* CONFIG_PM_DEVFREQ_EVENT */ | ||
| 195 | |||
| 196 | #endif /* __LINUX_DEVFREQ_EVENT_H__ */ | ||
diff --git a/include/linux/dqblk_v1.h b/include/linux/dqblk_v1.h index 3713a7232dd8..c0d4d1e2a45c 100644 --- a/include/linux/dqblk_v1.h +++ b/include/linux/dqblk_v1.h | |||
| @@ -5,9 +5,6 @@ | |||
| 5 | #ifndef _LINUX_DQBLK_V1_H | 5 | #ifndef _LINUX_DQBLK_V1_H |
| 6 | #define _LINUX_DQBLK_V1_H | 6 | #define _LINUX_DQBLK_V1_H |
| 7 | 7 | ||
| 8 | /* Root squash turned on */ | ||
| 9 | #define V1_DQF_RSQUASH 1 | ||
| 10 | |||
| 11 | /* Numbers of blocks needed for updates */ | 8 | /* Numbers of blocks needed for updates */ |
| 12 | #define V1_INIT_ALLOC 1 | 9 | #define V1_INIT_ALLOC 1 |
| 13 | #define V1_INIT_REWRITE 1 | 10 | #define V1_INIT_REWRITE 1 |
diff --git a/include/linux/efi.h b/include/linux/efi.h index 0238d612750e..cf7e431cbc73 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
| @@ -848,7 +848,7 @@ efi_guidcmp (efi_guid_t left, efi_guid_t right) | |||
| 848 | } | 848 | } |
| 849 | 849 | ||
| 850 | static inline char * | 850 | static inline char * |
| 851 | efi_guid_unparse(efi_guid_t *guid, char *out) | 851 | efi_guid_to_str(efi_guid_t *guid, char *out) |
| 852 | { | 852 | { |
| 853 | sprintf(out, "%pUl", guid->b); | 853 | sprintf(out, "%pUl", guid->b); |
| 854 | return out; | 854 | return out; |
| @@ -875,6 +875,8 @@ static inline efi_status_t efi_query_variable_store(u32 attributes, unsigned lon | |||
| 875 | #endif | 875 | #endif |
| 876 | extern void __iomem *efi_lookup_mapped_addr(u64 phys_addr); | 876 | extern void __iomem *efi_lookup_mapped_addr(u64 phys_addr); |
| 877 | extern int efi_config_init(efi_config_table_type_t *arch_tables); | 877 | extern int efi_config_init(efi_config_table_type_t *arch_tables); |
| 878 | extern int efi_config_parse_tables(void *config_tables, int count, int sz, | ||
| 879 | efi_config_table_type_t *arch_tables); | ||
| 878 | extern u64 efi_get_iobase (void); | 880 | extern u64 efi_get_iobase (void); |
| 879 | extern u32 efi_mem_type (unsigned long phys_addr); | 881 | extern u32 efi_mem_type (unsigned long phys_addr); |
| 880 | extern u64 efi_mem_attributes (unsigned long phys_addr); | 882 | extern u64 efi_mem_attributes (unsigned long phys_addr); |
diff --git a/include/linux/enclosure.h b/include/linux/enclosure.h index 9a33c5f7e126..7be22da321f3 100644 --- a/include/linux/enclosure.h +++ b/include/linux/enclosure.h | |||
| @@ -79,6 +79,12 @@ struct enclosure_component_callbacks { | |||
| 79 | int (*set_locate)(struct enclosure_device *, | 79 | int (*set_locate)(struct enclosure_device *, |
| 80 | struct enclosure_component *, | 80 | struct enclosure_component *, |
| 81 | enum enclosure_component_setting); | 81 | enum enclosure_component_setting); |
| 82 | void (*get_power_status)(struct enclosure_device *, | ||
| 83 | struct enclosure_component *); | ||
| 84 | int (*set_power_status)(struct enclosure_device *, | ||
| 85 | struct enclosure_component *, | ||
| 86 | int); | ||
| 87 | int (*show_id)(struct enclosure_device *, char *buf); | ||
| 82 | }; | 88 | }; |
| 83 | 89 | ||
| 84 | 90 | ||
| @@ -91,7 +97,9 @@ struct enclosure_component { | |||
| 91 | int fault; | 97 | int fault; |
| 92 | int active; | 98 | int active; |
| 93 | int locate; | 99 | int locate; |
| 100 | int slot; | ||
| 94 | enum enclosure_status status; | 101 | enum enclosure_status status; |
| 102 | int power_status; | ||
| 95 | }; | 103 | }; |
| 96 | 104 | ||
| 97 | struct enclosure_device { | 105 | struct enclosure_device { |
| @@ -120,8 +128,9 @@ enclosure_register(struct device *, const char *, int, | |||
| 120 | struct enclosure_component_callbacks *); | 128 | struct enclosure_component_callbacks *); |
| 121 | void enclosure_unregister(struct enclosure_device *); | 129 | void enclosure_unregister(struct enclosure_device *); |
| 122 | struct enclosure_component * | 130 | struct enclosure_component * |
| 123 | enclosure_component_register(struct enclosure_device *, unsigned int, | 131 | enclosure_component_alloc(struct enclosure_device *, unsigned int, |
| 124 | enum enclosure_component_type, const char *); | 132 | enum enclosure_component_type, const char *); |
| 133 | int enclosure_component_register(struct enclosure_component *); | ||
| 125 | int enclosure_add_device(struct enclosure_device *enclosure, int component, | 134 | int enclosure_add_device(struct enclosure_device *enclosure, int component, |
| 126 | struct device *dev); | 135 | struct device *dev); |
| 127 | int enclosure_remove_device(struct enclosure_device *, struct device *); | 136 | int enclosure_remove_device(struct enclosure_device *, struct device *); |
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index 41c891d05f04..1d869d185a0d 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h | |||
| @@ -52,6 +52,10 @@ struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs, | |||
| 52 | #define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1) | 52 | #define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1) |
| 53 | #define alloc_etherdev_mq(sizeof_priv, count) alloc_etherdev_mqs(sizeof_priv, count, count) | 53 | #define alloc_etherdev_mq(sizeof_priv, count) alloc_etherdev_mqs(sizeof_priv, count, count) |
| 54 | 54 | ||
| 55 | struct sk_buff **eth_gro_receive(struct sk_buff **head, | ||
| 56 | struct sk_buff *skb); | ||
| 57 | int eth_gro_complete(struct sk_buff *skb, int nhoff); | ||
| 58 | |||
| 55 | /* Reserved Ethernet Addresses per IEEE 802.1Q */ | 59 | /* Reserved Ethernet Addresses per IEEE 802.1Q */ |
| 56 | static const u8 eth_reserved_addr_base[ETH_ALEN] __aligned(2) = | 60 | static const u8 eth_reserved_addr_base[ETH_ALEN] __aligned(2) = |
| 57 | { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 }; | 61 | { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 }; |
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h index 41b223a59a63..fa05e04c5531 100644 --- a/include/linux/exportfs.h +++ b/include/linux/exportfs.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | 5 | ||
| 6 | struct dentry; | 6 | struct dentry; |
| 7 | struct iattr; | ||
| 7 | struct inode; | 8 | struct inode; |
| 8 | struct super_block; | 9 | struct super_block; |
| 9 | struct vfsmount; | 10 | struct vfsmount; |
| @@ -180,6 +181,21 @@ struct fid { | |||
| 180 | * get_name is not (which is possibly inconsistent) | 181 | * get_name is not (which is possibly inconsistent) |
| 181 | */ | 182 | */ |
| 182 | 183 | ||
| 184 | /* types of block ranges for multipage write mappings. */ | ||
| 185 | #define IOMAP_HOLE 0x01 /* no blocks allocated, need allocation */ | ||
| 186 | #define IOMAP_DELALLOC 0x02 /* delayed allocation blocks */ | ||
| 187 | #define IOMAP_MAPPED 0x03 /* blocks allocated @blkno */ | ||
| 188 | #define IOMAP_UNWRITTEN 0x04 /* blocks allocated @blkno in unwritten state */ | ||
| 189 | |||
| 190 | #define IOMAP_NULL_BLOCK -1LL /* blkno is not valid */ | ||
| 191 | |||
| 192 | struct iomap { | ||
| 193 | sector_t blkno; /* first sector of mapping */ | ||
| 194 | loff_t offset; /* file offset of mapping, bytes */ | ||
| 195 | u64 length; /* length of mapping, bytes */ | ||
| 196 | int type; /* type of mapping */ | ||
| 197 | }; | ||
| 198 | |||
| 183 | struct export_operations { | 199 | struct export_operations { |
| 184 | int (*encode_fh)(struct inode *inode, __u32 *fh, int *max_len, | 200 | int (*encode_fh)(struct inode *inode, __u32 *fh, int *max_len, |
| 185 | struct inode *parent); | 201 | struct inode *parent); |
| @@ -191,6 +207,13 @@ struct export_operations { | |||
| 191 | struct dentry *child); | 207 | struct dentry *child); |
| 192 | struct dentry * (*get_parent)(struct dentry *child); | 208 | struct dentry * (*get_parent)(struct dentry *child); |
| 193 | int (*commit_metadata)(struct inode *inode); | 209 | int (*commit_metadata)(struct inode *inode); |
| 210 | |||
| 211 | int (*get_uuid)(struct super_block *sb, u8 *buf, u32 *len, u64 *offset); | ||
| 212 | int (*map_blocks)(struct inode *inode, loff_t offset, | ||
| 213 | u64 len, struct iomap *iomap, | ||
| 214 | bool write, u32 *device_generation); | ||
| 215 | int (*commit_blocks)(struct inode *inode, struct iomap *iomaps, | ||
| 216 | int nr_iomaps, struct iattr *iattr); | ||
| 194 | }; | 217 | }; |
| 195 | 218 | ||
| 196 | extern int exportfs_encode_inode_fh(struct inode *inode, struct fid *fid, | 219 | extern int exportfs_encode_inode_fh(struct inode *inode, struct fid *fid, |
diff --git a/include/linux/fb.h b/include/linux/fb.h index 09bb7a18d287..043f3283b71c 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
| @@ -726,7 +726,9 @@ extern int fb_videomode_from_videomode(const struct videomode *vm, | |||
| 726 | struct fb_videomode *fbmode); | 726 | struct fb_videomode *fbmode); |
| 727 | 727 | ||
| 728 | /* drivers/video/modedb.c */ | 728 | /* drivers/video/modedb.c */ |
| 729 | #define VESA_MODEDB_SIZE 34 | 729 | #define VESA_MODEDB_SIZE 43 |
| 730 | #define DMT_SIZE 0x50 | ||
| 731 | |||
| 730 | extern void fb_var_to_videomode(struct fb_videomode *mode, | 732 | extern void fb_var_to_videomode(struct fb_videomode *mode, |
| 731 | const struct fb_var_screeninfo *var); | 733 | const struct fb_var_screeninfo *var); |
| 732 | extern void fb_videomode_to_var(struct fb_var_screeninfo *var, | 734 | extern void fb_videomode_to_var(struct fb_var_screeninfo *var, |
| @@ -777,9 +779,17 @@ struct fb_videomode { | |||
| 777 | u32 flag; | 779 | u32 flag; |
| 778 | }; | 780 | }; |
| 779 | 781 | ||
| 782 | struct dmt_videomode { | ||
| 783 | u32 dmt_id; | ||
| 784 | u32 std_2byte_code; | ||
| 785 | u32 cvt_3byte_code; | ||
| 786 | const struct fb_videomode *mode; | ||
| 787 | }; | ||
| 788 | |||
| 780 | extern const char *fb_mode_option; | 789 | extern const char *fb_mode_option; |
| 781 | extern const struct fb_videomode vesa_modes[]; | 790 | extern const struct fb_videomode vesa_modes[]; |
| 782 | extern const struct fb_videomode cea_modes[64]; | 791 | extern const struct fb_videomode cea_modes[64]; |
| 792 | extern const struct dmt_videomode dmt_modes[]; | ||
| 783 | 793 | ||
| 784 | struct fb_modelist { | 794 | struct fb_modelist { |
| 785 | struct list_head list; | 795 | struct list_head list; |
diff --git a/include/linux/fec.h b/include/linux/fec.h index bcff455d1d53..1454a503622d 100644 --- a/include/linux/fec.h +++ b/include/linux/fec.h | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | struct fec_platform_data { | 19 | struct fec_platform_data { |
| 20 | phy_interface_t phy; | 20 | phy_interface_t phy; |
| 21 | unsigned char mac[ETH_ALEN]; | 21 | unsigned char mac[ETH_ALEN]; |
| 22 | void (*sleep_mode_enable)(int enabled); | ||
| 22 | }; | 23 | }; |
| 23 | 24 | ||
| 24 | #endif | 25 | #endif |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 42efe13077b6..ec0f1dc66b9b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | #include <asm/byteorder.h> | 34 | #include <asm/byteorder.h> |
| 35 | #include <uapi/linux/fs.h> | 35 | #include <uapi/linux/fs.h> |
| 36 | 36 | ||
| 37 | struct backing_dev_info; | ||
| 37 | struct export_operations; | 38 | struct export_operations; |
| 38 | struct hd_geometry; | 39 | struct hd_geometry; |
| 39 | struct iovec; | 40 | struct iovec; |
| @@ -394,14 +395,12 @@ int pagecache_write_end(struct file *, struct address_space *mapping, | |||
| 394 | loff_t pos, unsigned len, unsigned copied, | 395 | loff_t pos, unsigned len, unsigned copied, |
| 395 | struct page *page, void *fsdata); | 396 | struct page *page, void *fsdata); |
| 396 | 397 | ||
| 397 | struct backing_dev_info; | ||
| 398 | struct address_space { | 398 | struct address_space { |
| 399 | struct inode *host; /* owner: inode, block_device */ | 399 | struct inode *host; /* owner: inode, block_device */ |
| 400 | struct radix_tree_root page_tree; /* radix tree of all pages */ | 400 | struct radix_tree_root page_tree; /* radix tree of all pages */ |
| 401 | spinlock_t tree_lock; /* and lock protecting it */ | 401 | spinlock_t tree_lock; /* and lock protecting it */ |
| 402 | atomic_t i_mmap_writable;/* count VM_SHARED mappings */ | 402 | atomic_t i_mmap_writable;/* count VM_SHARED mappings */ |
| 403 | struct rb_root i_mmap; /* tree of private and shared mappings */ | 403 | struct rb_root i_mmap; /* tree of private and shared mappings */ |
| 404 | struct list_head i_mmap_nonlinear;/*list VM_NONLINEAR mappings */ | ||
| 405 | struct rw_semaphore i_mmap_rwsem; /* protect tree, count, list */ | 404 | struct rw_semaphore i_mmap_rwsem; /* protect tree, count, list */ |
| 406 | /* Protected by tree_lock together with the radix tree */ | 405 | /* Protected by tree_lock together with the radix tree */ |
| 407 | unsigned long nrpages; /* number of total pages */ | 406 | unsigned long nrpages; /* number of total pages */ |
| @@ -409,7 +408,6 @@ struct address_space { | |||
| 409 | pgoff_t writeback_index;/* writeback starts here */ | 408 | pgoff_t writeback_index;/* writeback starts here */ |
| 410 | const struct address_space_operations *a_ops; /* methods */ | 409 | const struct address_space_operations *a_ops; /* methods */ |
| 411 | unsigned long flags; /* error bits/gfp mask */ | 410 | unsigned long flags; /* error bits/gfp mask */ |
| 412 | struct backing_dev_info *backing_dev_info; /* device readahead, etc */ | ||
| 413 | spinlock_t private_lock; /* for use by the address_space */ | 411 | spinlock_t private_lock; /* for use by the address_space */ |
| 414 | struct list_head private_list; /* ditto */ | 412 | struct list_head private_list; /* ditto */ |
| 415 | void *private_data; /* ditto */ | 413 | void *private_data; /* ditto */ |
| @@ -493,8 +491,7 @@ static inline void i_mmap_unlock_read(struct address_space *mapping) | |||
| 493 | */ | 491 | */ |
| 494 | static inline int mapping_mapped(struct address_space *mapping) | 492 | static inline int mapping_mapped(struct address_space *mapping) |
| 495 | { | 493 | { |
| 496 | return !RB_EMPTY_ROOT(&mapping->i_mmap) || | 494 | return !RB_EMPTY_ROOT(&mapping->i_mmap); |
| 497 | !list_empty(&mapping->i_mmap_nonlinear); | ||
| 498 | } | 495 | } |
| 499 | 496 | ||
| 500 | /* | 497 | /* |
| @@ -625,7 +622,7 @@ struct inode { | |||
| 625 | atomic_t i_readcount; /* struct files open RO */ | 622 | atomic_t i_readcount; /* struct files open RO */ |
| 626 | #endif | 623 | #endif |
| 627 | const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ | 624 | const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ |
| 628 | struct file_lock *i_flock; | 625 | struct file_lock_context *i_flctx; |
| 629 | struct address_space i_data; | 626 | struct address_space i_data; |
| 630 | struct list_head i_devices; | 627 | struct list_head i_devices; |
| 631 | union { | 628 | union { |
| @@ -875,6 +872,7 @@ static inline struct file *get_file(struct file *f) | |||
| 875 | #define FL_DOWNGRADE_PENDING 256 /* Lease is being downgraded */ | 872 | #define FL_DOWNGRADE_PENDING 256 /* Lease is being downgraded */ |
| 876 | #define FL_UNLOCK_PENDING 512 /* Lease is being broken */ | 873 | #define FL_UNLOCK_PENDING 512 /* Lease is being broken */ |
| 877 | #define FL_OFDLCK 1024 /* lock is "owned" by struct file */ | 874 | #define FL_OFDLCK 1024 /* lock is "owned" by struct file */ |
| 875 | #define FL_LAYOUT 2048 /* outstanding pNFS layout */ | ||
| 878 | 876 | ||
| 879 | /* | 877 | /* |
| 880 | * Special return value from posix_lock_file() and vfs_lock_file() for | 878 | * Special return value from posix_lock_file() and vfs_lock_file() for |
| @@ -885,6 +883,8 @@ static inline struct file *get_file(struct file *f) | |||
| 885 | /* legacy typedef, should eventually be removed */ | 883 | /* legacy typedef, should eventually be removed */ |
| 886 | typedef void *fl_owner_t; | 884 | typedef void *fl_owner_t; |
| 887 | 885 | ||
| 886 | struct file_lock; | ||
| 887 | |||
| 888 | struct file_lock_operations { | 888 | struct file_lock_operations { |
| 889 | void (*fl_copy_lock)(struct file_lock *, struct file_lock *); | 889 | void (*fl_copy_lock)(struct file_lock *, struct file_lock *); |
| 890 | void (*fl_release_private)(struct file_lock *); | 890 | void (*fl_release_private)(struct file_lock *); |
| @@ -898,7 +898,7 @@ struct lock_manager_operations { | |||
| 898 | void (*lm_notify)(struct file_lock *); /* unblock callback */ | 898 | void (*lm_notify)(struct file_lock *); /* unblock callback */ |
| 899 | int (*lm_grant)(struct file_lock *, int); | 899 | int (*lm_grant)(struct file_lock *, int); |
| 900 | bool (*lm_break)(struct file_lock *); | 900 | bool (*lm_break)(struct file_lock *); |
| 901 | int (*lm_change)(struct file_lock **, int, struct list_head *); | 901 | int (*lm_change)(struct file_lock *, int, struct list_head *); |
| 902 | void (*lm_setup)(struct file_lock *, void **); | 902 | void (*lm_setup)(struct file_lock *, void **); |
| 903 | }; | 903 | }; |
| 904 | 904 | ||
| @@ -923,17 +923,17 @@ int locks_in_grace(struct net *); | |||
| 923 | * FIXME: should we create a separate "struct lock_request" to help distinguish | 923 | * FIXME: should we create a separate "struct lock_request" to help distinguish |
| 924 | * these two uses? | 924 | * these two uses? |
| 925 | * | 925 | * |
| 926 | * The i_flock list is ordered by: | 926 | * The varous i_flctx lists are ordered by: |
| 927 | * | 927 | * |
| 928 | * 1) lock type -- FL_LEASEs first, then FL_FLOCK, and finally FL_POSIX | 928 | * 1) lock owner |
| 929 | * 2) lock owner | 929 | * 2) lock range start |
| 930 | * 3) lock range start | 930 | * 3) lock range end |
| 931 | * 4) lock range end | ||
| 932 | * | 931 | * |
| 933 | * Obviously, the last two criteria only matter for POSIX locks. | 932 | * Obviously, the last two criteria only matter for POSIX locks. |
| 934 | */ | 933 | */ |
| 935 | struct file_lock { | 934 | struct file_lock { |
| 936 | struct file_lock *fl_next; /* singly linked list for this inode */ | 935 | struct file_lock *fl_next; /* singly linked list for this inode */ |
| 936 | struct list_head fl_list; /* link into file_lock_context */ | ||
| 937 | struct hlist_node fl_link; /* node in global lists */ | 937 | struct hlist_node fl_link; /* node in global lists */ |
| 938 | struct list_head fl_block; /* circular list of blocked processes */ | 938 | struct list_head fl_block; /* circular list of blocked processes */ |
| 939 | fl_owner_t fl_owner; | 939 | fl_owner_t fl_owner; |
| @@ -964,6 +964,16 @@ struct file_lock { | |||
| 964 | } fl_u; | 964 | } fl_u; |
| 965 | }; | 965 | }; |
| 966 | 966 | ||
| 967 | struct file_lock_context { | ||
| 968 | spinlock_t flc_lock; | ||
| 969 | struct list_head flc_flock; | ||
| 970 | struct list_head flc_posix; | ||
| 971 | struct list_head flc_lease; | ||
| 972 | int flc_flock_cnt; | ||
| 973 | int flc_posix_cnt; | ||
| 974 | int flc_lease_cnt; | ||
| 975 | }; | ||
| 976 | |||
| 967 | /* The following constant reflects the upper bound of the file/locking space */ | 977 | /* The following constant reflects the upper bound of the file/locking space */ |
| 968 | #ifndef OFFSET_MAX | 978 | #ifndef OFFSET_MAX |
| 969 | #define INT_LIMIT(x) (~((x)1 << (sizeof(x)*8 - 1))) | 979 | #define INT_LIMIT(x) (~((x)1 << (sizeof(x)*8 - 1))) |
| @@ -990,6 +1000,7 @@ extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg); | |||
| 990 | extern int fcntl_getlease(struct file *filp); | 1000 | extern int fcntl_getlease(struct file *filp); |
| 991 | 1001 | ||
| 992 | /* fs/locks.c */ | 1002 | /* fs/locks.c */ |
| 1003 | void locks_free_lock_context(struct file_lock_context *ctx); | ||
| 993 | void locks_free_lock(struct file_lock *fl); | 1004 | void locks_free_lock(struct file_lock *fl); |
| 994 | extern void locks_init_lock(struct file_lock *); | 1005 | extern void locks_init_lock(struct file_lock *); |
| 995 | extern struct file_lock * locks_alloc_lock(void); | 1006 | extern struct file_lock * locks_alloc_lock(void); |
| @@ -1010,7 +1021,7 @@ extern int __break_lease(struct inode *inode, unsigned int flags, unsigned int t | |||
| 1010 | extern void lease_get_mtime(struct inode *, struct timespec *time); | 1021 | extern void lease_get_mtime(struct inode *, struct timespec *time); |
| 1011 | extern int generic_setlease(struct file *, long, struct file_lock **, void **priv); | 1022 | extern int generic_setlease(struct file *, long, struct file_lock **, void **priv); |
| 1012 | extern int vfs_setlease(struct file *, long, struct file_lock **, void **); | 1023 | extern int vfs_setlease(struct file *, long, struct file_lock **, void **); |
| 1013 | extern int lease_modify(struct file_lock **, int, struct list_head *); | 1024 | extern int lease_modify(struct file_lock *, int, struct list_head *); |
| 1014 | #else /* !CONFIG_FILE_LOCKING */ | 1025 | #else /* !CONFIG_FILE_LOCKING */ |
| 1015 | static inline int fcntl_getlk(struct file *file, unsigned int cmd, | 1026 | static inline int fcntl_getlk(struct file *file, unsigned int cmd, |
| 1016 | struct flock __user *user) | 1027 | struct flock __user *user) |
| @@ -1047,6 +1058,11 @@ static inline int fcntl_getlease(struct file *filp) | |||
| 1047 | return F_UNLCK; | 1058 | return F_UNLCK; |
| 1048 | } | 1059 | } |
| 1049 | 1060 | ||
| 1061 | static inline void | ||
| 1062 | locks_free_lock_context(struct file_lock_context *ctx) | ||
| 1063 | { | ||
| 1064 | } | ||
| 1065 | |||
| 1050 | static inline void locks_init_lock(struct file_lock *fl) | 1066 | static inline void locks_init_lock(struct file_lock *fl) |
| 1051 | { | 1067 | { |
| 1052 | return; | 1068 | return; |
| @@ -1137,7 +1153,7 @@ static inline int vfs_setlease(struct file *filp, long arg, | |||
| 1137 | return -EINVAL; | 1153 | return -EINVAL; |
| 1138 | } | 1154 | } |
| 1139 | 1155 | ||
| 1140 | static inline int lease_modify(struct file_lock **before, int arg, | 1156 | static inline int lease_modify(struct file_lock *fl, int arg, |
| 1141 | struct list_head *dispose) | 1157 | struct list_head *dispose) |
| 1142 | { | 1158 | { |
| 1143 | return -EINVAL; | 1159 | return -EINVAL; |
| @@ -1184,8 +1200,6 @@ struct mm_struct; | |||
| 1184 | #define UMOUNT_NOFOLLOW 0x00000008 /* Don't follow symlink on umount */ | 1200 | #define UMOUNT_NOFOLLOW 0x00000008 /* Don't follow symlink on umount */ |
| 1185 | #define UMOUNT_UNUSED 0x80000000 /* Flag guaranteed to be unused */ | 1201 | #define UMOUNT_UNUSED 0x80000000 /* Flag guaranteed to be unused */ |
| 1186 | 1202 | ||
| 1187 | extern struct list_head super_blocks; | ||
| 1188 | extern spinlock_t sb_lock; | ||
| 1189 | 1203 | ||
| 1190 | /* Possible states of 'frozen' field */ | 1204 | /* Possible states of 'frozen' field */ |
| 1191 | enum { | 1205 | enum { |
| @@ -1502,6 +1516,26 @@ struct block_device_operations; | |||
| 1502 | #define HAVE_COMPAT_IOCTL 1 | 1516 | #define HAVE_COMPAT_IOCTL 1 |
| 1503 | #define HAVE_UNLOCKED_IOCTL 1 | 1517 | #define HAVE_UNLOCKED_IOCTL 1 |
| 1504 | 1518 | ||
| 1519 | /* | ||
| 1520 | * These flags let !MMU mmap() govern direct device mapping vs immediate | ||
| 1521 | * copying more easily for MAP_PRIVATE, especially for ROM filesystems. | ||
| 1522 | * | ||
| 1523 | * NOMMU_MAP_COPY: Copy can be mapped (MAP_PRIVATE) | ||
| 1524 | * NOMMU_MAP_DIRECT: Can be mapped directly (MAP_SHARED) | ||
| 1525 | * NOMMU_MAP_READ: Can be mapped for reading | ||
| 1526 | * NOMMU_MAP_WRITE: Can be mapped for writing | ||
| 1527 | * NOMMU_MAP_EXEC: Can be mapped for execution | ||
| 1528 | */ | ||
| 1529 | #define NOMMU_MAP_COPY 0x00000001 | ||
| 1530 | #define NOMMU_MAP_DIRECT 0x00000008 | ||
| 1531 | #define NOMMU_MAP_READ VM_MAYREAD | ||
| 1532 | #define NOMMU_MAP_WRITE VM_MAYWRITE | ||
| 1533 | #define NOMMU_MAP_EXEC VM_MAYEXEC | ||
| 1534 | |||
| 1535 | #define NOMMU_VMFLAGS \ | ||
| 1536 | (NOMMU_MAP_READ | NOMMU_MAP_WRITE | NOMMU_MAP_EXEC) | ||
| 1537 | |||
| 1538 | |||
| 1505 | struct iov_iter; | 1539 | struct iov_iter; |
| 1506 | 1540 | ||
| 1507 | struct file_operations { | 1541 | struct file_operations { |
| @@ -1536,6 +1570,9 @@ struct file_operations { | |||
| 1536 | long (*fallocate)(struct file *file, int mode, loff_t offset, | 1570 | long (*fallocate)(struct file *file, int mode, loff_t offset, |
| 1537 | loff_t len); | 1571 | loff_t len); |
| 1538 | void (*show_fdinfo)(struct seq_file *m, struct file *f); | 1572 | void (*show_fdinfo)(struct seq_file *m, struct file *f); |
| 1573 | #ifndef CONFIG_MMU | ||
| 1574 | unsigned (*mmap_capabilities)(struct file *); | ||
| 1575 | #endif | ||
| 1539 | }; | 1576 | }; |
| 1540 | 1577 | ||
| 1541 | struct inode_operations { | 1578 | struct inode_operations { |
| @@ -1959,7 +1996,7 @@ static inline int locks_verify_truncate(struct inode *inode, | |||
| 1959 | struct file *filp, | 1996 | struct file *filp, |
| 1960 | loff_t size) | 1997 | loff_t size) |
| 1961 | { | 1998 | { |
| 1962 | if (inode->i_flock && mandatory_lock(inode)) | 1999 | if (inode->i_flctx && mandatory_lock(inode)) |
| 1963 | return locks_mandatory_area( | 2000 | return locks_mandatory_area( |
| 1964 | FLOCK_VERIFY_WRITE, inode, filp, | 2001 | FLOCK_VERIFY_WRITE, inode, filp, |
| 1965 | size < inode->i_size ? size : inode->i_size, | 2002 | size < inode->i_size ? size : inode->i_size, |
| @@ -1973,11 +2010,12 @@ static inline int break_lease(struct inode *inode, unsigned int mode) | |||
| 1973 | { | 2010 | { |
| 1974 | /* | 2011 | /* |
| 1975 | * Since this check is lockless, we must ensure that any refcounts | 2012 | * Since this check is lockless, we must ensure that any refcounts |
| 1976 | * taken are done before checking inode->i_flock. Otherwise, we could | 2013 | * taken are done before checking i_flctx->flc_lease. Otherwise, we |
| 1977 | * end up racing with tasks trying to set a new lease on this file. | 2014 | * could end up racing with tasks trying to set a new lease on this |
| 2015 | * file. | ||
| 1978 | */ | 2016 | */ |
| 1979 | smp_mb(); | 2017 | smp_mb(); |
| 1980 | if (inode->i_flock) | 2018 | if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease)) |
| 1981 | return __break_lease(inode, mode, FL_LEASE); | 2019 | return __break_lease(inode, mode, FL_LEASE); |
| 1982 | return 0; | 2020 | return 0; |
| 1983 | } | 2021 | } |
| @@ -1986,11 +2024,12 @@ static inline int break_deleg(struct inode *inode, unsigned int mode) | |||
| 1986 | { | 2024 | { |
| 1987 | /* | 2025 | /* |
| 1988 | * Since this check is lockless, we must ensure that any refcounts | 2026 | * Since this check is lockless, we must ensure that any refcounts |
| 1989 | * taken are done before checking inode->i_flock. Otherwise, we could | 2027 | * taken are done before checking i_flctx->flc_lease. Otherwise, we |
| 1990 | * end up racing with tasks trying to set a new lease on this file. | 2028 | * could end up racing with tasks trying to set a new lease on this |
| 2029 | * file. | ||
| 1991 | */ | 2030 | */ |
| 1992 | smp_mb(); | 2031 | smp_mb(); |
| 1993 | if (inode->i_flock) | 2032 | if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease)) |
| 1994 | return __break_lease(inode, mode, FL_DELEG); | 2033 | return __break_lease(inode, mode, FL_DELEG); |
| 1995 | return 0; | 2034 | return 0; |
| 1996 | } | 2035 | } |
| @@ -2017,6 +2056,16 @@ static inline int break_deleg_wait(struct inode **delegated_inode) | |||
| 2017 | return ret; | 2056 | return ret; |
| 2018 | } | 2057 | } |
| 2019 | 2058 | ||
| 2059 | static inline int break_layout(struct inode *inode, bool wait) | ||
| 2060 | { | ||
| 2061 | smp_mb(); | ||
| 2062 | if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease)) | ||
| 2063 | return __break_lease(inode, | ||
| 2064 | wait ? O_WRONLY : O_WRONLY | O_NONBLOCK, | ||
| 2065 | FL_LAYOUT); | ||
| 2066 | return 0; | ||
| 2067 | } | ||
| 2068 | |||
| 2020 | #else /* !CONFIG_FILE_LOCKING */ | 2069 | #else /* !CONFIG_FILE_LOCKING */ |
| 2021 | static inline int locks_mandatory_locked(struct file *file) | 2070 | static inline int locks_mandatory_locked(struct file *file) |
| 2022 | { | 2071 | { |
| @@ -2072,6 +2121,11 @@ static inline int break_deleg_wait(struct inode **delegated_inode) | |||
| 2072 | return 0; | 2121 | return 0; |
| 2073 | } | 2122 | } |
| 2074 | 2123 | ||
| 2124 | static inline int break_layout(struct inode *inode, bool wait) | ||
| 2125 | { | ||
| 2126 | return 0; | ||
| 2127 | } | ||
| 2128 | |||
| 2075 | #endif /* CONFIG_FILE_LOCKING */ | 2129 | #endif /* CONFIG_FILE_LOCKING */ |
| 2076 | 2130 | ||
| 2077 | /* fs/open.c */ | 2131 | /* fs/open.c */ |
| @@ -2481,8 +2535,6 @@ extern int sb_min_blocksize(struct super_block *, int); | |||
| 2481 | 2535 | ||
| 2482 | extern int generic_file_mmap(struct file *, struct vm_area_struct *); | 2536 | extern int generic_file_mmap(struct file *, struct vm_area_struct *); |
| 2483 | extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); | 2537 | extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); |
| 2484 | extern int generic_file_remap_pages(struct vm_area_struct *, unsigned long addr, | ||
| 2485 | unsigned long size, pgoff_t pgoff); | ||
| 2486 | int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); | 2538 | int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); |
| 2487 | extern ssize_t generic_file_read_iter(struct kiocb *, struct iov_iter *); | 2539 | extern ssize_t generic_file_read_iter(struct kiocb *, struct iov_iter *); |
| 2488 | extern ssize_t __generic_file_write_iter(struct kiocb *, struct iov_iter *); | 2540 | extern ssize_t __generic_file_write_iter(struct kiocb *, struct iov_iter *); |
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index 1c804b057fb1..7ee1774edee5 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
| @@ -101,8 +101,10 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, | |||
| 101 | new_dir_mask |= FS_ISDIR; | 101 | new_dir_mask |= FS_ISDIR; |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | fsnotify(old_dir, old_dir_mask, old_dir, FSNOTIFY_EVENT_INODE, old_name, fs_cookie); | 104 | fsnotify(old_dir, old_dir_mask, source, FSNOTIFY_EVENT_INODE, old_name, |
| 105 | fsnotify(new_dir, new_dir_mask, new_dir, FSNOTIFY_EVENT_INODE, new_name, fs_cookie); | 105 | fs_cookie); |
| 106 | fsnotify(new_dir, new_dir_mask, source, FSNOTIFY_EVENT_INODE, new_name, | ||
| 107 | fs_cookie); | ||
| 106 | 108 | ||
| 107 | if (target) | 109 | if (target) |
| 108 | fsnotify_link_count(target); | 110 | fsnotify_link_count(target); |
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 0bebb5c348b8..c674ee8f7fca 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
| @@ -44,6 +44,10 @@ const char *ftrace_print_bitmask_seq(struct trace_seq *p, void *bitmask_ptr, | |||
| 44 | const char *ftrace_print_hex_seq(struct trace_seq *p, | 44 | const char *ftrace_print_hex_seq(struct trace_seq *p, |
| 45 | const unsigned char *buf, int len); | 45 | const unsigned char *buf, int len); |
| 46 | 46 | ||
| 47 | const char *ftrace_print_array_seq(struct trace_seq *p, | ||
| 48 | const void *buf, int buf_len, | ||
| 49 | size_t el_size); | ||
| 50 | |||
| 47 | struct trace_iterator; | 51 | struct trace_iterator; |
| 48 | struct trace_event; | 52 | struct trace_event; |
| 49 | 53 | ||
| @@ -595,7 +599,7 @@ extern int ftrace_profile_set_filter(struct perf_event *event, int event_id, | |||
| 595 | char *filter_str); | 599 | char *filter_str); |
| 596 | extern void ftrace_profile_free_filter(struct perf_event *event); | 600 | extern void ftrace_profile_free_filter(struct perf_event *event); |
| 597 | extern void *perf_trace_buf_prepare(int size, unsigned short type, | 601 | extern void *perf_trace_buf_prepare(int size, unsigned short type, |
| 598 | struct pt_regs *regs, int *rctxp); | 602 | struct pt_regs **regs, int *rctxp); |
| 599 | 603 | ||
| 600 | static inline void | 604 | static inline void |
| 601 | perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr, | 605 | perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr, |
diff --git a/include/linux/genetlink.h b/include/linux/genetlink.h index 55b685719d52..09460d6d6682 100644 --- a/include/linux/genetlink.h +++ b/include/linux/genetlink.h | |||
| @@ -11,6 +11,10 @@ extern void genl_unlock(void); | |||
| 11 | extern int lockdep_genl_is_held(void); | 11 | extern int lockdep_genl_is_held(void); |
| 12 | #endif | 12 | #endif |
| 13 | 13 | ||
| 14 | /* for synchronisation between af_netlink and genetlink */ | ||
| 15 | extern atomic_t genl_sk_destructing_cnt; | ||
| 16 | extern wait_queue_head_t genl_sk_destructing_waitq; | ||
| 17 | |||
| 14 | /** | 18 | /** |
| 15 | * rcu_dereference_genl - rcu_dereference with debug checking | 19 | * rcu_dereference_genl - rcu_dereference with debug checking |
| 16 | * @p: The pointer to read, prior to dereferencing | 20 | * @p: The pointer to read, prior to dereferencing |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index b840e3b2770d..51bd1e72a917 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
| @@ -334,18 +334,22 @@ alloc_pages(gfp_t gfp_mask, unsigned int order) | |||
| 334 | } | 334 | } |
| 335 | extern struct page *alloc_pages_vma(gfp_t gfp_mask, int order, | 335 | extern struct page *alloc_pages_vma(gfp_t gfp_mask, int order, |
| 336 | struct vm_area_struct *vma, unsigned long addr, | 336 | struct vm_area_struct *vma, unsigned long addr, |
| 337 | int node); | 337 | int node, bool hugepage); |
| 338 | #define alloc_hugepage_vma(gfp_mask, vma, addr, order) \ | ||
| 339 | alloc_pages_vma(gfp_mask, order, vma, addr, numa_node_id(), true) | ||
| 338 | #else | 340 | #else |
| 339 | #define alloc_pages(gfp_mask, order) \ | 341 | #define alloc_pages(gfp_mask, order) \ |
| 340 | alloc_pages_node(numa_node_id(), gfp_mask, order) | 342 | alloc_pages_node(numa_node_id(), gfp_mask, order) |
| 341 | #define alloc_pages_vma(gfp_mask, order, vma, addr, node) \ | 343 | #define alloc_pages_vma(gfp_mask, order, vma, addr, node, false)\ |
| 344 | alloc_pages(gfp_mask, order) | ||
| 345 | #define alloc_hugepage_vma(gfp_mask, vma, addr, order) \ | ||
| 342 | alloc_pages(gfp_mask, order) | 346 | alloc_pages(gfp_mask, order) |
| 343 | #endif | 347 | #endif |
| 344 | #define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0) | 348 | #define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0) |
| 345 | #define alloc_page_vma(gfp_mask, vma, addr) \ | 349 | #define alloc_page_vma(gfp_mask, vma, addr) \ |
| 346 | alloc_pages_vma(gfp_mask, 0, vma, addr, numa_node_id()) | 350 | alloc_pages_vma(gfp_mask, 0, vma, addr, numa_node_id(), false) |
| 347 | #define alloc_page_vma_node(gfp_mask, vma, addr, node) \ | 351 | #define alloc_page_vma_node(gfp_mask, vma, addr, node) \ |
| 348 | alloc_pages_vma(gfp_mask, 0, vma, addr, node) | 352 | alloc_pages_vma(gfp_mask, 0, vma, addr, node, false) |
| 349 | 353 | ||
| 350 | extern struct page *alloc_kmem_pages(gfp_t gfp_mask, unsigned int order); | 354 | extern struct page *alloc_kmem_pages(gfp_t gfp_mask, unsigned int order); |
| 351 | extern struct page *alloc_kmem_pages_node(int nid, gfp_t gfp_mask, | 355 | extern struct page *alloc_kmem_pages_node(int nid, gfp_t gfp_mask, |
diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h index fd85cb120ee0..45afc2dee560 100644 --- a/include/linux/gpio/consumer.h +++ b/include/linux/gpio/consumer.h | |||
| @@ -340,31 +340,32 @@ static inline int desc_to_gpio(const struct gpio_desc *desc) | |||
| 340 | * etc. | 340 | * etc. |
| 341 | */ | 341 | */ |
| 342 | #define __gpiod_get(dev, con_id, flags, ...) __gpiod_get(dev, con_id, flags) | 342 | #define __gpiod_get(dev, con_id, flags, ...) __gpiod_get(dev, con_id, flags) |
| 343 | #define gpiod_get(varargs...) __gpiod_get(varargs, 0) | 343 | #define gpiod_get(varargs...) __gpiod_get(varargs, GPIOD_ASIS) |
| 344 | #define __gpiod_get_index(dev, con_id, index, flags, ...) \ | 344 | #define __gpiod_get_index(dev, con_id, index, flags, ...) \ |
| 345 | __gpiod_get_index(dev, con_id, index, flags) | 345 | __gpiod_get_index(dev, con_id, index, flags) |
| 346 | #define gpiod_get_index(varargs...) __gpiod_get_index(varargs, 0) | 346 | #define gpiod_get_index(varargs...) __gpiod_get_index(varargs, GPIOD_ASIS) |
| 347 | #define __gpiod_get_optional(dev, con_id, flags, ...) \ | 347 | #define __gpiod_get_optional(dev, con_id, flags, ...) \ |
| 348 | __gpiod_get_optional(dev, con_id, flags) | 348 | __gpiod_get_optional(dev, con_id, flags) |
| 349 | #define gpiod_get_optional(varargs...) __gpiod_get_optional(varargs, 0) | 349 | #define gpiod_get_optional(varargs...) __gpiod_get_optional(varargs, GPIOD_ASIS) |
| 350 | #define __gpiod_get_index_optional(dev, con_id, index, flags, ...) \ | 350 | #define __gpiod_get_index_optional(dev, con_id, index, flags, ...) \ |
| 351 | __gpiod_get_index_optional(dev, con_id, index, flags) | 351 | __gpiod_get_index_optional(dev, con_id, index, flags) |
| 352 | #define gpiod_get_index_optional(varargs...) \ | 352 | #define gpiod_get_index_optional(varargs...) \ |
| 353 | __gpiod_get_index_optional(varargs, 0) | 353 | __gpiod_get_index_optional(varargs, GPIOD_ASIS) |
| 354 | #define __devm_gpiod_get(dev, con_id, flags, ...) \ | 354 | #define __devm_gpiod_get(dev, con_id, flags, ...) \ |
| 355 | __devm_gpiod_get(dev, con_id, flags) | 355 | __devm_gpiod_get(dev, con_id, flags) |
| 356 | #define devm_gpiod_get(varargs...) __devm_gpiod_get(varargs, 0) | 356 | #define devm_gpiod_get(varargs...) __devm_gpiod_get(varargs, GPIOD_ASIS) |
| 357 | #define __devm_gpiod_get_index(dev, con_id, index, flags, ...) \ | 357 | #define __devm_gpiod_get_index(dev, con_id, index, flags, ...) \ |
| 358 | __devm_gpiod_get_index(dev, con_id, index, flags) | 358 | __devm_gpiod_get_index(dev, con_id, index, flags) |
| 359 | #define devm_gpiod_get_index(varargs...) __devm_gpiod_get_index(varargs, 0) | 359 | #define devm_gpiod_get_index(varargs...) \ |
| 360 | __devm_gpiod_get_index(varargs, GPIOD_ASIS) | ||
| 360 | #define __devm_gpiod_get_optional(dev, con_id, flags, ...) \ | 361 | #define __devm_gpiod_get_optional(dev, con_id, flags, ...) \ |
| 361 | __devm_gpiod_get_optional(dev, con_id, flags) | 362 | __devm_gpiod_get_optional(dev, con_id, flags) |
| 362 | #define devm_gpiod_get_optional(varargs...) \ | 363 | #define devm_gpiod_get_optional(varargs...) \ |
| 363 | __devm_gpiod_get_optional(varargs, 0) | 364 | __devm_gpiod_get_optional(varargs, GPIOD_ASIS) |
| 364 | #define __devm_gpiod_get_index_optional(dev, con_id, index, flags, ...) \ | 365 | #define __devm_gpiod_get_index_optional(dev, con_id, index, flags, ...) \ |
| 365 | __devm_gpiod_get_index_optional(dev, con_id, index, flags) | 366 | __devm_gpiod_get_index_optional(dev, con_id, index, flags) |
| 366 | #define devm_gpiod_get_index_optional(varargs...) \ | 367 | #define devm_gpiod_get_index_optional(varargs...) \ |
| 367 | __devm_gpiod_get_index_optional(varargs, 0) | 368 | __devm_gpiod_get_index_optional(varargs, GPIOD_ASIS) |
| 368 | 369 | ||
| 369 | #if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_GPIO_SYSFS) | 370 | #if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_GPIO_SYSFS) |
| 370 | 371 | ||
diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h index cbb5790a35cd..e9744202fa29 100644 --- a/include/linux/hdmi.h +++ b/include/linux/hdmi.h | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #define __LINUX_HDMI_H_ | 25 | #define __LINUX_HDMI_H_ |
| 26 | 26 | ||
| 27 | #include <linux/types.h> | 27 | #include <linux/types.h> |
| 28 | #include <linux/device.h> | ||
| 28 | 29 | ||
| 29 | enum hdmi_infoframe_type { | 30 | enum hdmi_infoframe_type { |
| 30 | HDMI_INFOFRAME_TYPE_VENDOR = 0x81, | 31 | HDMI_INFOFRAME_TYPE_VENDOR = 0x81, |
| @@ -52,12 +53,18 @@ enum hdmi_colorspace { | |||
| 52 | HDMI_COLORSPACE_RGB, | 53 | HDMI_COLORSPACE_RGB, |
| 53 | HDMI_COLORSPACE_YUV422, | 54 | HDMI_COLORSPACE_YUV422, |
| 54 | HDMI_COLORSPACE_YUV444, | 55 | HDMI_COLORSPACE_YUV444, |
| 56 | HDMI_COLORSPACE_YUV420, | ||
| 57 | HDMI_COLORSPACE_RESERVED4, | ||
| 58 | HDMI_COLORSPACE_RESERVED5, | ||
| 59 | HDMI_COLORSPACE_RESERVED6, | ||
| 60 | HDMI_COLORSPACE_IDO_DEFINED, | ||
| 55 | }; | 61 | }; |
| 56 | 62 | ||
| 57 | enum hdmi_scan_mode { | 63 | enum hdmi_scan_mode { |
| 58 | HDMI_SCAN_MODE_NONE, | 64 | HDMI_SCAN_MODE_NONE, |
| 59 | HDMI_SCAN_MODE_OVERSCAN, | 65 | HDMI_SCAN_MODE_OVERSCAN, |
| 60 | HDMI_SCAN_MODE_UNDERSCAN, | 66 | HDMI_SCAN_MODE_UNDERSCAN, |
| 67 | HDMI_SCAN_MODE_RESERVED, | ||
| 61 | }; | 68 | }; |
| 62 | 69 | ||
| 63 | enum hdmi_colorimetry { | 70 | enum hdmi_colorimetry { |
| @@ -71,6 +78,7 @@ enum hdmi_picture_aspect { | |||
| 71 | HDMI_PICTURE_ASPECT_NONE, | 78 | HDMI_PICTURE_ASPECT_NONE, |
| 72 | HDMI_PICTURE_ASPECT_4_3, | 79 | HDMI_PICTURE_ASPECT_4_3, |
| 73 | HDMI_PICTURE_ASPECT_16_9, | 80 | HDMI_PICTURE_ASPECT_16_9, |
| 81 | HDMI_PICTURE_ASPECT_RESERVED, | ||
| 74 | }; | 82 | }; |
| 75 | 83 | ||
| 76 | enum hdmi_active_aspect { | 84 | enum hdmi_active_aspect { |
| @@ -92,12 +100,18 @@ enum hdmi_extended_colorimetry { | |||
| 92 | HDMI_EXTENDED_COLORIMETRY_S_YCC_601, | 100 | HDMI_EXTENDED_COLORIMETRY_S_YCC_601, |
| 93 | HDMI_EXTENDED_COLORIMETRY_ADOBE_YCC_601, | 101 | HDMI_EXTENDED_COLORIMETRY_ADOBE_YCC_601, |
| 94 | HDMI_EXTENDED_COLORIMETRY_ADOBE_RGB, | 102 | HDMI_EXTENDED_COLORIMETRY_ADOBE_RGB, |
| 103 | |||
| 104 | /* The following EC values are only defined in CEA-861-F. */ | ||
| 105 | HDMI_EXTENDED_COLORIMETRY_BT2020_CONST_LUM, | ||
| 106 | HDMI_EXTENDED_COLORIMETRY_BT2020, | ||
| 107 | HDMI_EXTENDED_COLORIMETRY_RESERVED, | ||
| 95 | }; | 108 | }; |
| 96 | 109 | ||
| 97 | enum hdmi_quantization_range { | 110 | enum hdmi_quantization_range { |
| 98 | HDMI_QUANTIZATION_RANGE_DEFAULT, | 111 | HDMI_QUANTIZATION_RANGE_DEFAULT, |
| 99 | HDMI_QUANTIZATION_RANGE_LIMITED, | 112 | HDMI_QUANTIZATION_RANGE_LIMITED, |
| 100 | HDMI_QUANTIZATION_RANGE_FULL, | 113 | HDMI_QUANTIZATION_RANGE_FULL, |
| 114 | HDMI_QUANTIZATION_RANGE_RESERVED, | ||
| 101 | }; | 115 | }; |
| 102 | 116 | ||
| 103 | /* non-uniform picture scaling */ | 117 | /* non-uniform picture scaling */ |
| @@ -114,7 +128,7 @@ enum hdmi_ycc_quantization_range { | |||
| 114 | }; | 128 | }; |
| 115 | 129 | ||
| 116 | enum hdmi_content_type { | 130 | enum hdmi_content_type { |
| 117 | HDMI_CONTENT_TYPE_NONE, | 131 | HDMI_CONTENT_TYPE_GRAPHICS, |
| 118 | HDMI_CONTENT_TYPE_PHOTO, | 132 | HDMI_CONTENT_TYPE_PHOTO, |
| 119 | HDMI_CONTENT_TYPE_CINEMA, | 133 | HDMI_CONTENT_TYPE_CINEMA, |
| 120 | HDMI_CONTENT_TYPE_GAME, | 134 | HDMI_CONTENT_TYPE_GAME, |
| @@ -194,6 +208,7 @@ enum hdmi_audio_coding_type { | |||
| 194 | HDMI_AUDIO_CODING_TYPE_MLP, | 208 | HDMI_AUDIO_CODING_TYPE_MLP, |
| 195 | HDMI_AUDIO_CODING_TYPE_DST, | 209 | HDMI_AUDIO_CODING_TYPE_DST, |
| 196 | HDMI_AUDIO_CODING_TYPE_WMA_PRO, | 210 | HDMI_AUDIO_CODING_TYPE_WMA_PRO, |
| 211 | HDMI_AUDIO_CODING_TYPE_CXT, | ||
| 197 | }; | 212 | }; |
| 198 | 213 | ||
| 199 | enum hdmi_audio_sample_size { | 214 | enum hdmi_audio_sample_size { |
| @@ -215,10 +230,25 @@ enum hdmi_audio_sample_frequency { | |||
| 215 | }; | 230 | }; |
| 216 | 231 | ||
| 217 | enum hdmi_audio_coding_type_ext { | 232 | enum hdmi_audio_coding_type_ext { |
| 218 | HDMI_AUDIO_CODING_TYPE_EXT_STREAM, | 233 | /* Refer to Audio Coding Type (CT) field in Data Byte 1 */ |
| 234 | HDMI_AUDIO_CODING_TYPE_EXT_CT, | ||
| 235 | |||
| 236 | /* | ||
| 237 | * The next three CXT values are defined in CEA-861-E only. | ||
| 238 | * They do not exist in older versions, and in CEA-861-F they are | ||
| 239 | * defined as 'Not in use'. | ||
| 240 | */ | ||
| 219 | HDMI_AUDIO_CODING_TYPE_EXT_HE_AAC, | 241 | HDMI_AUDIO_CODING_TYPE_EXT_HE_AAC, |
| 220 | HDMI_AUDIO_CODING_TYPE_EXT_HE_AAC_V2, | 242 | HDMI_AUDIO_CODING_TYPE_EXT_HE_AAC_V2, |
| 221 | HDMI_AUDIO_CODING_TYPE_EXT_MPEG_SURROUND, | 243 | HDMI_AUDIO_CODING_TYPE_EXT_MPEG_SURROUND, |
| 244 | |||
| 245 | /* The following CXT values are only defined in CEA-861-F. */ | ||
| 246 | HDMI_AUDIO_CODING_TYPE_EXT_MPEG4_HE_AAC, | ||
| 247 | HDMI_AUDIO_CODING_TYPE_EXT_MPEG4_HE_AAC_V2, | ||
| 248 | HDMI_AUDIO_CODING_TYPE_EXT_MPEG4_AAC_LC, | ||
| 249 | HDMI_AUDIO_CODING_TYPE_EXT_DRA, | ||
| 250 | HDMI_AUDIO_CODING_TYPE_EXT_MPEG4_HE_AAC_SURROUND, | ||
| 251 | HDMI_AUDIO_CODING_TYPE_EXT_MPEG4_AAC_LC_SURROUND = 10, | ||
| 222 | }; | 252 | }; |
| 223 | 253 | ||
| 224 | struct hdmi_audio_infoframe { | 254 | struct hdmi_audio_infoframe { |
| @@ -299,5 +329,8 @@ union hdmi_infoframe { | |||
| 299 | 329 | ||
| 300 | ssize_t | 330 | ssize_t |
| 301 | hdmi_infoframe_pack(union hdmi_infoframe *frame, void *buffer, size_t size); | 331 | hdmi_infoframe_pack(union hdmi_infoframe *frame, void *buffer, size_t size); |
| 332 | int hdmi_infoframe_unpack(union hdmi_infoframe *frame, void *buffer); | ||
| 333 | void hdmi_infoframe_log(const char *level, struct device *dev, | ||
| 334 | union hdmi_infoframe *frame); | ||
| 302 | 335 | ||
| 303 | #endif /* _DRM_HDMI_H */ | 336 | #endif /* _DRM_HDMI_H */ |
diff --git a/include/linux/hid.h b/include/linux/hid.h index 06c4607744f6..efc7787a41a8 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
| @@ -574,7 +574,9 @@ static inline void hid_set_drvdata(struct hid_device *hdev, void *data) | |||
| 574 | #define HID_GLOBAL_STACK_SIZE 4 | 574 | #define HID_GLOBAL_STACK_SIZE 4 |
| 575 | #define HID_COLLECTION_STACK_SIZE 4 | 575 | #define HID_COLLECTION_STACK_SIZE 4 |
| 576 | 576 | ||
| 577 | #define HID_SCAN_FLAG_MT_WIN_8 0x00000001 | 577 | #define HID_SCAN_FLAG_MT_WIN_8 BIT(0) |
| 578 | #define HID_SCAN_FLAG_VENDOR_SPECIFIC BIT(1) | ||
| 579 | #define HID_SCAN_FLAG_GD_POINTER BIT(2) | ||
| 578 | 580 | ||
| 579 | struct hid_parser { | 581 | struct hid_parser { |
| 580 | struct hid_global global; | 582 | struct hid_global global; |
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index a036d058a249..05f6df1fdf5b 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
| @@ -170,6 +170,7 @@ enum hrtimer_base_type { | |||
| 170 | * @clock_was_set: Indicates that clock was set from irq context. | 170 | * @clock_was_set: Indicates that clock was set from irq context. |
| 171 | * @expires_next: absolute time of the next event which was scheduled | 171 | * @expires_next: absolute time of the next event which was scheduled |
| 172 | * via clock_set_next_event() | 172 | * via clock_set_next_event() |
| 173 | * @in_hrtirq: hrtimer_interrupt() is currently executing | ||
| 173 | * @hres_active: State of high resolution mode | 174 | * @hres_active: State of high resolution mode |
| 174 | * @hang_detected: The last hrtimer interrupt detected a hang | 175 | * @hang_detected: The last hrtimer interrupt detected a hang |
| 175 | * @nr_events: Total number of hrtimer interrupt events | 176 | * @nr_events: Total number of hrtimer interrupt events |
| @@ -185,6 +186,7 @@ struct hrtimer_cpu_base { | |||
| 185 | unsigned int clock_was_set; | 186 | unsigned int clock_was_set; |
| 186 | #ifdef CONFIG_HIGH_RES_TIMERS | 187 | #ifdef CONFIG_HIGH_RES_TIMERS |
| 187 | ktime_t expires_next; | 188 | ktime_t expires_next; |
| 189 | int in_hrtirq; | ||
| 188 | int hres_active; | 190 | int hres_active; |
| 189 | int hang_detected; | 191 | int hang_detected; |
| 190 | unsigned long nr_events; | 192 | unsigned long nr_events; |
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index ad9051bab267..f10b20f05159 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h | |||
| @@ -157,6 +157,13 @@ static inline int hpage_nr_pages(struct page *page) | |||
| 157 | extern int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, | 157 | extern int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, |
| 158 | unsigned long addr, pmd_t pmd, pmd_t *pmdp); | 158 | unsigned long addr, pmd_t pmd, pmd_t *pmdp); |
| 159 | 159 | ||
| 160 | extern struct page *huge_zero_page; | ||
| 161 | |||
| 162 | static inline bool is_huge_zero_page(struct page *page) | ||
| 163 | { | ||
| 164 | return ACCESS_ONCE(huge_zero_page) == page; | ||
| 165 | } | ||
| 166 | |||
| 160 | #else /* CONFIG_TRANSPARENT_HUGEPAGE */ | 167 | #else /* CONFIG_TRANSPARENT_HUGEPAGE */ |
| 161 | #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; }) | 168 | #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; }) |
| 162 | #define HPAGE_PMD_MASK ({ BUILD_BUG(); 0; }) | 169 | #define HPAGE_PMD_MASK ({ BUILD_BUG(); 0; }) |
| @@ -206,6 +213,11 @@ static inline int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_str | |||
| 206 | return 0; | 213 | return 0; |
| 207 | } | 214 | } |
| 208 | 215 | ||
| 216 | static inline bool is_huge_zero_page(struct page *page) | ||
| 217 | { | ||
| 218 | return false; | ||
| 219 | } | ||
| 220 | |||
| 209 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ | 221 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ |
| 210 | 222 | ||
| 211 | #endif /* _LINUX_HUGE_MM_H */ | 223 | #endif /* _LINUX_HUGE_MM_H */ |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 431b7fc605c9..7b5785032049 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
| @@ -86,7 +86,7 @@ void free_huge_page(struct page *page); | |||
| 86 | pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud); | 86 | pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud); |
| 87 | #endif | 87 | #endif |
| 88 | 88 | ||
| 89 | extern unsigned long hugepages_treat_as_movable; | 89 | extern int hugepages_treat_as_movable; |
| 90 | extern int sysctl_hugetlb_shm_group; | 90 | extern int sysctl_hugetlb_shm_group; |
| 91 | extern struct list_head huge_boot_pages; | 91 | extern struct list_head huge_boot_pages; |
| 92 | 92 | ||
| @@ -99,9 +99,9 @@ int huge_pmd_unshare(struct mm_struct *mm, unsigned long *addr, pte_t *ptep); | |||
| 99 | struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address, | 99 | struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address, |
| 100 | int write); | 100 | int write); |
| 101 | struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, | 101 | struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, |
| 102 | pmd_t *pmd, int write); | 102 | pmd_t *pmd, int flags); |
| 103 | struct page *follow_huge_pud(struct mm_struct *mm, unsigned long address, | 103 | struct page *follow_huge_pud(struct mm_struct *mm, unsigned long address, |
| 104 | pud_t *pud, int write); | 104 | pud_t *pud, int flags); |
| 105 | int pmd_huge(pmd_t pmd); | 105 | int pmd_huge(pmd_t pmd); |
| 106 | int pud_huge(pud_t pmd); | 106 | int pud_huge(pud_t pmd); |
| 107 | unsigned long hugetlb_change_protection(struct vm_area_struct *vma, | 107 | unsigned long hugetlb_change_protection(struct vm_area_struct *vma, |
| @@ -133,8 +133,8 @@ static inline void hugetlb_report_meminfo(struct seq_file *m) | |||
| 133 | static inline void hugetlb_show_meminfo(void) | 133 | static inline void hugetlb_show_meminfo(void) |
| 134 | { | 134 | { |
| 135 | } | 135 | } |
| 136 | #define follow_huge_pmd(mm, addr, pmd, write) NULL | 136 | #define follow_huge_pmd(mm, addr, pmd, flags) NULL |
| 137 | #define follow_huge_pud(mm, addr, pud, write) NULL | 137 | #define follow_huge_pud(mm, addr, pud, flags) NULL |
| 138 | #define prepare_hugepage_range(file, addr, len) (-EINVAL) | 138 | #define prepare_hugepage_range(file, addr, len) (-EINVAL) |
| 139 | #define pmd_huge(x) 0 | 139 | #define pmd_huge(x) 0 |
| 140 | #define pud_huge(x) 0 | 140 | #define pud_huge(x) 0 |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index e3a1721c8354..7c7695940ddd 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
| @@ -228,7 +228,9 @@ struct i2c_client { | |||
| 228 | struct device dev; /* the device structure */ | 228 | struct device dev; /* the device structure */ |
| 229 | int irq; /* irq issued by device */ | 229 | int irq; /* irq issued by device */ |
| 230 | struct list_head detected; | 230 | struct list_head detected; |
| 231 | #if IS_ENABLED(CONFIG_I2C_SLAVE) | ||
| 231 | i2c_slave_cb_t slave_cb; /* callback for slave mode */ | 232 | i2c_slave_cb_t slave_cb; /* callback for slave mode */ |
| 233 | #endif | ||
| 232 | }; | 234 | }; |
| 233 | #define to_i2c_client(d) container_of(d, struct i2c_client, dev) | 235 | #define to_i2c_client(d) container_of(d, struct i2c_client, dev) |
| 234 | 236 | ||
| @@ -253,6 +255,7 @@ static inline void i2c_set_clientdata(struct i2c_client *dev, void *data) | |||
| 253 | 255 | ||
| 254 | /* I2C slave support */ | 256 | /* I2C slave support */ |
| 255 | 257 | ||
| 258 | #if IS_ENABLED(CONFIG_I2C_SLAVE) | ||
| 256 | enum i2c_slave_event { | 259 | enum i2c_slave_event { |
| 257 | I2C_SLAVE_REQ_READ_START, | 260 | I2C_SLAVE_REQ_READ_START, |
| 258 | I2C_SLAVE_REQ_READ_END, | 261 | I2C_SLAVE_REQ_READ_END, |
| @@ -269,6 +272,7 @@ static inline int i2c_slave_event(struct i2c_client *client, | |||
| 269 | { | 272 | { |
| 270 | return client->slave_cb(client, event, val); | 273 | return client->slave_cb(client, event, val); |
| 271 | } | 274 | } |
| 275 | #endif | ||
| 272 | 276 | ||
| 273 | /** | 277 | /** |
| 274 | * struct i2c_board_info - template for device creation | 278 | * struct i2c_board_info - template for device creation |
| @@ -404,8 +408,10 @@ struct i2c_algorithm { | |||
| 404 | /* To determine what the adapter supports */ | 408 | /* To determine what the adapter supports */ |
| 405 | u32 (*functionality) (struct i2c_adapter *); | 409 | u32 (*functionality) (struct i2c_adapter *); |
| 406 | 410 | ||
| 411 | #if IS_ENABLED(CONFIG_I2C_SLAVE) | ||
| 407 | int (*reg_slave)(struct i2c_client *client); | 412 | int (*reg_slave)(struct i2c_client *client); |
| 408 | int (*unreg_slave)(struct i2c_client *client); | 413 | int (*unreg_slave)(struct i2c_client *client); |
| 414 | #endif | ||
| 409 | }; | 415 | }; |
| 410 | 416 | ||
| 411 | /** | 417 | /** |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 4f4eea8a6288..b9c7897dc566 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
| @@ -1017,6 +1017,15 @@ struct ieee80211_mmie { | |||
| 1017 | u8 mic[8]; | 1017 | u8 mic[8]; |
| 1018 | } __packed; | 1018 | } __packed; |
| 1019 | 1019 | ||
| 1020 | /* Management MIC information element (IEEE 802.11w) for GMAC and CMAC-256 */ | ||
| 1021 | struct ieee80211_mmie_16 { | ||
| 1022 | u8 element_id; | ||
| 1023 | u8 length; | ||
| 1024 | __le16 key_id; | ||
| 1025 | u8 sequence_number[6]; | ||
| 1026 | u8 mic[16]; | ||
| 1027 | } __packed; | ||
| 1028 | |||
| 1020 | struct ieee80211_vendor_ie { | 1029 | struct ieee80211_vendor_ie { |
| 1021 | u8 element_id; | 1030 | u8 element_id; |
| 1022 | u8 len; | 1031 | u8 len; |
| @@ -1994,9 +2003,15 @@ enum ieee80211_key_len { | |||
| 1994 | WLAN_KEY_LEN_WEP40 = 5, | 2003 | WLAN_KEY_LEN_WEP40 = 5, |
| 1995 | WLAN_KEY_LEN_WEP104 = 13, | 2004 | WLAN_KEY_LEN_WEP104 = 13, |
| 1996 | WLAN_KEY_LEN_CCMP = 16, | 2005 | WLAN_KEY_LEN_CCMP = 16, |
| 2006 | WLAN_KEY_LEN_CCMP_256 = 32, | ||
| 1997 | WLAN_KEY_LEN_TKIP = 32, | 2007 | WLAN_KEY_LEN_TKIP = 32, |
| 1998 | WLAN_KEY_LEN_AES_CMAC = 16, | 2008 | WLAN_KEY_LEN_AES_CMAC = 16, |
| 1999 | WLAN_KEY_LEN_SMS4 = 32, | 2009 | WLAN_KEY_LEN_SMS4 = 32, |
| 2010 | WLAN_KEY_LEN_GCMP = 16, | ||
| 2011 | WLAN_KEY_LEN_GCMP_256 = 32, | ||
| 2012 | WLAN_KEY_LEN_BIP_CMAC_256 = 32, | ||
| 2013 | WLAN_KEY_LEN_BIP_GMAC_128 = 16, | ||
| 2014 | WLAN_KEY_LEN_BIP_GMAC_256 = 32, | ||
| 2000 | }; | 2015 | }; |
| 2001 | 2016 | ||
| 2002 | #define IEEE80211_WEP_IV_LEN 4 | 2017 | #define IEEE80211_WEP_IV_LEN 4 |
| @@ -2004,9 +2019,16 @@ enum ieee80211_key_len { | |||
| 2004 | #define IEEE80211_CCMP_HDR_LEN 8 | 2019 | #define IEEE80211_CCMP_HDR_LEN 8 |
| 2005 | #define IEEE80211_CCMP_MIC_LEN 8 | 2020 | #define IEEE80211_CCMP_MIC_LEN 8 |
| 2006 | #define IEEE80211_CCMP_PN_LEN 6 | 2021 | #define IEEE80211_CCMP_PN_LEN 6 |
| 2022 | #define IEEE80211_CCMP_256_HDR_LEN 8 | ||
| 2023 | #define IEEE80211_CCMP_256_MIC_LEN 16 | ||
| 2024 | #define IEEE80211_CCMP_256_PN_LEN 6 | ||
| 2007 | #define IEEE80211_TKIP_IV_LEN 8 | 2025 | #define IEEE80211_TKIP_IV_LEN 8 |
| 2008 | #define IEEE80211_TKIP_ICV_LEN 4 | 2026 | #define IEEE80211_TKIP_ICV_LEN 4 |
| 2009 | #define IEEE80211_CMAC_PN_LEN 6 | 2027 | #define IEEE80211_CMAC_PN_LEN 6 |
| 2028 | #define IEEE80211_GMAC_PN_LEN 6 | ||
| 2029 | #define IEEE80211_GCMP_HDR_LEN 8 | ||
| 2030 | #define IEEE80211_GCMP_MIC_LEN 16 | ||
| 2031 | #define IEEE80211_GCMP_PN_LEN 6 | ||
| 2010 | 2032 | ||
| 2011 | /* Public action codes */ | 2033 | /* Public action codes */ |
| 2012 | enum ieee80211_pub_actioncode { | 2034 | enum ieee80211_pub_actioncode { |
| @@ -2230,6 +2252,11 @@ enum ieee80211_sa_query_action { | |||
| 2230 | #define WLAN_CIPHER_SUITE_WEP104 0x000FAC05 | 2252 | #define WLAN_CIPHER_SUITE_WEP104 0x000FAC05 |
| 2231 | #define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06 | 2253 | #define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06 |
| 2232 | #define WLAN_CIPHER_SUITE_GCMP 0x000FAC08 | 2254 | #define WLAN_CIPHER_SUITE_GCMP 0x000FAC08 |
| 2255 | #define WLAN_CIPHER_SUITE_GCMP_256 0x000FAC09 | ||
| 2256 | #define WLAN_CIPHER_SUITE_CCMP_256 0x000FAC0A | ||
| 2257 | #define WLAN_CIPHER_SUITE_BIP_GMAC_128 0x000FAC0B | ||
| 2258 | #define WLAN_CIPHER_SUITE_BIP_GMAC_256 0x000FAC0C | ||
| 2259 | #define WLAN_CIPHER_SUITE_BIP_CMAC_256 0x000FAC0D | ||
| 2233 | 2260 | ||
| 2234 | #define WLAN_CIPHER_SUITE_SMS4 0x00147201 | 2261 | #define WLAN_CIPHER_SUITE_SMS4 0x00147201 |
| 2235 | 2262 | ||
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h index 0a8ce762a47f..a57bca2ea97e 100644 --- a/include/linux/if_bridge.h +++ b/include/linux/if_bridge.h | |||
| @@ -50,24 +50,6 @@ extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __use | |||
| 50 | typedef int br_should_route_hook_t(struct sk_buff *skb); | 50 | typedef int br_should_route_hook_t(struct sk_buff *skb); |
| 51 | extern br_should_route_hook_t __rcu *br_should_route_hook; | 51 | extern br_should_route_hook_t __rcu *br_should_route_hook; |
| 52 | 52 | ||
| 53 | #if IS_ENABLED(CONFIG_BRIDGE) | ||
| 54 | int br_fdb_external_learn_add(struct net_device *dev, | ||
| 55 | const unsigned char *addr, u16 vid); | ||
| 56 | int br_fdb_external_learn_del(struct net_device *dev, | ||
| 57 | const unsigned char *addr, u16 vid); | ||
| 58 | #else | ||
| 59 | static inline int br_fdb_external_learn_add(struct net_device *dev, | ||
| 60 | const unsigned char *addr, u16 vid) | ||
| 61 | { | ||
| 62 | return 0; | ||
| 63 | } | ||
| 64 | static inline int br_fdb_external_learn_del(struct net_device *dev, | ||
| 65 | const unsigned char *addr, u16 vid) | ||
| 66 | { | ||
| 67 | return 0; | ||
| 68 | } | ||
| 69 | #endif | ||
| 70 | |||
| 71 | #if IS_ENABLED(CONFIG_BRIDGE) && IS_ENABLED(CONFIG_BRIDGE_IGMP_SNOOPING) | 53 | #if IS_ENABLED(CONFIG_BRIDGE) && IS_ENABLED(CONFIG_BRIDGE_IGMP_SNOOPING) |
| 72 | int br_multicast_list_adjacent(struct net_device *dev, | 54 | int br_multicast_list_adjacent(struct net_device *dev, |
| 73 | struct list_head *br_ip_list); | 55 | struct list_head *br_ip_list); |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 515a35e2a48a..b11b28a30b9e 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
| @@ -78,9 +78,9 @@ static inline bool is_vlan_dev(struct net_device *dev) | |||
| 78 | return dev->priv_flags & IFF_802_1Q_VLAN; | 78 | return dev->priv_flags & IFF_802_1Q_VLAN; |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | #define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT) | 81 | #define skb_vlan_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT) |
| 82 | #define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) | 82 | #define skb_vlan_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) |
| 83 | #define vlan_tx_tag_get_id(__skb) ((__skb)->vlan_tci & VLAN_VID_MASK) | 83 | #define skb_vlan_tag_get_id(__skb) ((__skb)->vlan_tci & VLAN_VID_MASK) |
| 84 | 84 | ||
| 85 | /** | 85 | /** |
| 86 | * struct vlan_pcpu_stats - VLAN percpu rx/tx stats | 86 | * struct vlan_pcpu_stats - VLAN percpu rx/tx stats |
| @@ -376,7 +376,7 @@ static inline struct sk_buff *vlan_insert_tag_set_proto(struct sk_buff *skb, | |||
| 376 | static inline struct sk_buff *__vlan_hwaccel_push_inside(struct sk_buff *skb) | 376 | static inline struct sk_buff *__vlan_hwaccel_push_inside(struct sk_buff *skb) |
| 377 | { | 377 | { |
| 378 | skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto, | 378 | skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto, |
| 379 | vlan_tx_tag_get(skb)); | 379 | skb_vlan_tag_get(skb)); |
| 380 | if (likely(skb)) | 380 | if (likely(skb)) |
| 381 | skb->vlan_tci = 0; | 381 | skb->vlan_tci = 0; |
| 382 | return skb; | 382 | return skb; |
| @@ -393,7 +393,7 @@ static inline struct sk_buff *__vlan_hwaccel_push_inside(struct sk_buff *skb) | |||
| 393 | */ | 393 | */ |
| 394 | static inline struct sk_buff *vlan_hwaccel_push_inside(struct sk_buff *skb) | 394 | static inline struct sk_buff *vlan_hwaccel_push_inside(struct sk_buff *skb) |
| 395 | { | 395 | { |
| 396 | if (vlan_tx_tag_present(skb)) | 396 | if (skb_vlan_tag_present(skb)) |
| 397 | skb = __vlan_hwaccel_push_inside(skb); | 397 | skb = __vlan_hwaccel_push_inside(skb); |
| 398 | return skb; | 398 | return skb; |
| 399 | } | 399 | } |
| @@ -442,8 +442,8 @@ static inline int __vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci) | |||
| 442 | static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb, | 442 | static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb, |
| 443 | u16 *vlan_tci) | 443 | u16 *vlan_tci) |
| 444 | { | 444 | { |
| 445 | if (vlan_tx_tag_present(skb)) { | 445 | if (skb_vlan_tag_present(skb)) { |
| 446 | *vlan_tci = vlan_tx_tag_get(skb); | 446 | *vlan_tci = skb_vlan_tag_get(skb); |
| 447 | return 0; | 447 | return 0; |
| 448 | } else { | 448 | } else { |
| 449 | *vlan_tci = 0; | 449 | *vlan_tci = 0; |
| @@ -472,27 +472,59 @@ static inline int vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci) | |||
| 472 | /** | 472 | /** |
| 473 | * vlan_get_protocol - get protocol EtherType. | 473 | * vlan_get_protocol - get protocol EtherType. |
| 474 | * @skb: skbuff to query | 474 | * @skb: skbuff to query |
| 475 | * @type: first vlan protocol | ||
| 476 | * @depth: buffer to store length of eth and vlan tags in bytes | ||
| 475 | * | 477 | * |
| 476 | * Returns the EtherType of the packet, regardless of whether it is | 478 | * Returns the EtherType of the packet, regardless of whether it is |
| 477 | * vlan encapsulated (normal or hardware accelerated) or not. | 479 | * vlan encapsulated (normal or hardware accelerated) or not. |
| 478 | */ | 480 | */ |
| 479 | static inline __be16 vlan_get_protocol(const struct sk_buff *skb) | 481 | static inline __be16 __vlan_get_protocol(struct sk_buff *skb, __be16 type, |
| 482 | int *depth) | ||
| 480 | { | 483 | { |
| 481 | __be16 protocol = 0; | 484 | unsigned int vlan_depth = skb->mac_len; |
| 482 | 485 | ||
| 483 | if (vlan_tx_tag_present(skb) || | 486 | /* if type is 802.1Q/AD then the header should already be |
| 484 | skb->protocol != cpu_to_be16(ETH_P_8021Q)) | 487 | * present at mac_len - VLAN_HLEN (if mac_len > 0), or at |
| 485 | protocol = skb->protocol; | 488 | * ETH_HLEN otherwise |
| 486 | else { | 489 | */ |
| 487 | __be16 proto, *protop; | 490 | if (type == htons(ETH_P_8021Q) || type == htons(ETH_P_8021AD)) { |
| 488 | protop = skb_header_pointer(skb, offsetof(struct vlan_ethhdr, | 491 | if (vlan_depth) { |
| 489 | h_vlan_encapsulated_proto), | 492 | if (WARN_ON(vlan_depth < VLAN_HLEN)) |
| 490 | sizeof(proto), &proto); | 493 | return 0; |
| 491 | if (likely(protop)) | 494 | vlan_depth -= VLAN_HLEN; |
| 492 | protocol = *protop; | 495 | } else { |
| 496 | vlan_depth = ETH_HLEN; | ||
| 497 | } | ||
| 498 | do { | ||
| 499 | struct vlan_hdr *vh; | ||
| 500 | |||
| 501 | if (unlikely(!pskb_may_pull(skb, | ||
| 502 | vlan_depth + VLAN_HLEN))) | ||
| 503 | return 0; | ||
| 504 | |||
| 505 | vh = (struct vlan_hdr *)(skb->data + vlan_depth); | ||
| 506 | type = vh->h_vlan_encapsulated_proto; | ||
| 507 | vlan_depth += VLAN_HLEN; | ||
| 508 | } while (type == htons(ETH_P_8021Q) || | ||
| 509 | type == htons(ETH_P_8021AD)); | ||
| 493 | } | 510 | } |
| 494 | 511 | ||
| 495 | return protocol; | 512 | if (depth) |
| 513 | *depth = vlan_depth; | ||
| 514 | |||
| 515 | return type; | ||
| 516 | } | ||
| 517 | |||
| 518 | /** | ||
| 519 | * vlan_get_protocol - get protocol EtherType. | ||
| 520 | * @skb: skbuff to query | ||
| 521 | * | ||
| 522 | * Returns the EtherType of the packet, regardless of whether it is | ||
| 523 | * vlan encapsulated (normal or hardware accelerated) or not. | ||
| 524 | */ | ||
| 525 | static inline __be16 vlan_get_protocol(struct sk_buff *skb) | ||
| 526 | { | ||
| 527 | return __vlan_get_protocol(skb, skb->protocol, NULL); | ||
| 496 | } | 528 | } |
| 497 | 529 | ||
| 498 | static inline void vlan_set_encap_proto(struct sk_buff *skb, | 530 | static inline void vlan_set_encap_proto(struct sk_buff *skb, |
diff --git a/include/linux/input/mt.h b/include/linux/input/mt.h index f583ff639776..d7188de4db96 100644 --- a/include/linux/input/mt.h +++ b/include/linux/input/mt.h | |||
| @@ -119,7 +119,8 @@ struct input_mt_pos { | |||
| 119 | }; | 119 | }; |
| 120 | 120 | ||
| 121 | int input_mt_assign_slots(struct input_dev *dev, int *slots, | 121 | int input_mt_assign_slots(struct input_dev *dev, int *slots, |
| 122 | const struct input_mt_pos *pos, int num_pos); | 122 | const struct input_mt_pos *pos, int num_pos, |
| 123 | int dmax); | ||
| 123 | 124 | ||
| 124 | int input_mt_get_slot_by_key(struct input_dev *dev, int key); | 125 | int input_mt_get_slot_by_key(struct input_dev *dev, int key); |
| 125 | 126 | ||
diff --git a/include/linux/iopoll.h b/include/linux/iopoll.h new file mode 100644 index 000000000000..1c30014ed176 --- /dev/null +++ b/include/linux/iopoll.h | |||
| @@ -0,0 +1,144 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. | ||
| 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 and | ||
| 6 | * only version 2 as published by the Free Software Foundation. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef _LINUX_IOPOLL_H | ||
| 16 | #define _LINUX_IOPOLL_H | ||
| 17 | |||
| 18 | #include <linux/kernel.h> | ||
| 19 | #include <linux/types.h> | ||
| 20 | #include <linux/hrtimer.h> | ||
| 21 | #include <linux/delay.h> | ||
| 22 | #include <linux/errno.h> | ||
| 23 | #include <linux/io.h> | ||
| 24 | |||
| 25 | /** | ||
| 26 | * readx_poll_timeout - Periodically poll an address until a condition is met or a timeout occurs | ||
| 27 | * @op: accessor function (takes @addr as its only argument) | ||
| 28 | * @addr: Address to poll | ||
| 29 | * @val: Variable to read the value into | ||
| 30 | * @cond: Break condition (usually involving @val) | ||
| 31 | * @sleep_us: Maximum time to sleep between reads in us (0 | ||
| 32 | * tight-loops). Should be less than ~20ms since usleep_range | ||
| 33 | * is used (see Documentation/timers/timers-howto.txt). | ||
| 34 | * @timeout_us: Timeout in us, 0 means never timeout | ||
| 35 | * | ||
| 36 | * Returns 0 on success and -ETIMEDOUT upon a timeout. In either | ||
| 37 | * case, the last read value at @addr is stored in @val. Must not | ||
| 38 | * be called from atomic context if sleep_us or timeout_us are used. | ||
| 39 | * | ||
| 40 | * When available, you'll probably want to use one of the specialized | ||
| 41 | * macros defined below rather than this macro directly. | ||
| 42 | */ | ||
| 43 | #define readx_poll_timeout(op, addr, val, cond, sleep_us, timeout_us) \ | ||
| 44 | ({ \ | ||
| 45 | ktime_t timeout = ktime_add_us(ktime_get(), timeout_us); \ | ||
| 46 | might_sleep_if(sleep_us); \ | ||
| 47 | for (;;) { \ | ||
| 48 | (val) = op(addr); \ | ||
| 49 | if (cond) \ | ||
| 50 | break; \ | ||
| 51 | if (timeout_us && ktime_compare(ktime_get(), timeout) > 0) { \ | ||
| 52 | (val) = op(addr); \ | ||
| 53 | break; \ | ||
| 54 | } \ | ||
| 55 | if (sleep_us) \ | ||
| 56 | usleep_range((sleep_us >> 2) + 1, sleep_us); \ | ||
| 57 | } \ | ||
| 58 | (cond) ? 0 : -ETIMEDOUT; \ | ||
| 59 | }) | ||
| 60 | |||
| 61 | /** | ||
| 62 | * readx_poll_timeout_atomic - Periodically poll an address until a condition is met or a timeout occurs | ||
| 63 | * @op: accessor function (takes @addr as its only argument) | ||
| 64 | * @addr: Address to poll | ||
| 65 | * @val: Variable to read the value into | ||
| 66 | * @cond: Break condition (usually involving @val) | ||
| 67 | * @delay_us: Time to udelay between reads in us (0 tight-loops). Should | ||
| 68 | * be less than ~10us since udelay is used (see | ||
| 69 | * Documentation/timers/timers-howto.txt). | ||
| 70 | * @timeout_us: Timeout in us, 0 means never timeout | ||
| 71 | * | ||
| 72 | * Returns 0 on success and -ETIMEDOUT upon a timeout. In either | ||
| 73 | * case, the last read value at @addr is stored in @val. | ||
| 74 | * | ||
| 75 | * When available, you'll probably want to use one of the specialized | ||
| 76 | * macros defined below rather than this macro directly. | ||
| 77 | */ | ||
| 78 | #define readx_poll_timeout_atomic(op, addr, val, cond, delay_us, timeout_us) \ | ||
| 79 | ({ \ | ||
| 80 | ktime_t timeout = ktime_add_us(ktime_get(), timeout_us); \ | ||
| 81 | for (;;) { \ | ||
| 82 | (val) = op(addr); \ | ||
| 83 | if (cond) \ | ||
| 84 | break; \ | ||
| 85 | if (timeout_us && ktime_compare(ktime_get(), timeout) > 0) { \ | ||
| 86 | (val) = op(addr); \ | ||
| 87 | break; \ | ||
| 88 | } \ | ||
| 89 | if (delay_us) \ | ||
| 90 | udelay(delay_us); \ | ||
| 91 | } \ | ||
| 92 | (cond) ? 0 : -ETIMEDOUT; \ | ||
| 93 | }) | ||
| 94 | |||
| 95 | |||
| 96 | #define readb_poll_timeout(addr, val, cond, delay_us, timeout_us) \ | ||
| 97 | readx_poll_timeout(readb, addr, val, cond, delay_us, timeout_us) | ||
| 98 | |||
| 99 | #define readb_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ | ||
| 100 | readx_poll_timeout_atomic(readb, addr, val, cond, delay_us, timeout_us) | ||
| 101 | |||
| 102 | #define readw_poll_timeout(addr, val, cond, delay_us, timeout_us) \ | ||
| 103 | readx_poll_timeout(readw, addr, val, cond, delay_us, timeout_us) | ||
| 104 | |||
| 105 | #define readw_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ | ||
| 106 | readx_poll_timeout_atomic(readw, addr, val, cond, delay_us, timeout_us) | ||
| 107 | |||
| 108 | #define readl_poll_timeout(addr, val, cond, delay_us, timeout_us) \ | ||
| 109 | readx_poll_timeout(readl, addr, val, cond, delay_us, timeout_us) | ||
| 110 | |||
| 111 | #define readl_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ | ||
| 112 | readx_poll_timeout_atomic(readl, addr, val, cond, delay_us, timeout_us) | ||
| 113 | |||
| 114 | #define readq_poll_timeout(addr, val, cond, delay_us, timeout_us) \ | ||
| 115 | readx_poll_timeout(readq, addr, val, cond, delay_us, timeout_us) | ||
| 116 | |||
| 117 | #define readq_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ | ||
| 118 | readx_poll_timeout_atomic(readq, addr, val, cond, delay_us, timeout_us) | ||
| 119 | |||
| 120 | #define readb_relaxed_poll_timeout(addr, val, cond, delay_us, timeout_us) \ | ||
| 121 | readx_poll_timeout(readb_relaxed, addr, val, cond, delay_us, timeout_us) | ||
| 122 | |||
| 123 | #define readb_relaxed_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ | ||
| 124 | readx_poll_timeout_atomic(readb_relaxed, addr, val, cond, delay_us, timeout_us) | ||
| 125 | |||
| 126 | #define readw_relaxed_poll_timeout(addr, val, cond, delay_us, timeout_us) \ | ||
| 127 | readx_poll_timeout(readw_relaxed, addr, val, cond, delay_us, timeout_us) | ||
| 128 | |||
| 129 | #define readw_relaxed_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ | ||
| 130 | readx_poll_timeout_atomic(readw_relaxed, addr, val, cond, delay_us, timeout_us) | ||
| 131 | |||
| 132 | #define readl_relaxed_poll_timeout(addr, val, cond, delay_us, timeout_us) \ | ||
| 133 | readx_poll_timeout(readl_relaxed, addr, val, cond, delay_us, timeout_us) | ||
| 134 | |||
| 135 | #define readl_relaxed_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ | ||
| 136 | readx_poll_timeout_atomic(readl_relaxed, addr, val, cond, delay_us, timeout_us) | ||
| 137 | |||
| 138 | #define readq_relaxed_poll_timeout(addr, val, cond, delay_us, timeout_us) \ | ||
| 139 | readx_poll_timeout(readq_relaxed, addr, val, cond, delay_us, timeout_us) | ||
| 140 | |||
| 141 | #define readq_relaxed_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ | ||
| 142 | readx_poll_timeout_atomic(readq_relaxed, addr, val, cond, delay_us, timeout_us) | ||
| 143 | |||
| 144 | #endif /* _LINUX_IOPOLL_H */ | ||
diff --git a/include/linux/iova.h b/include/linux/iova.h index 19e81d5ccb6d..3920a19d8194 100644 --- a/include/linux/iova.h +++ b/include/linux/iova.h | |||
| @@ -16,9 +16,6 @@ | |||
| 16 | #include <linux/rbtree.h> | 16 | #include <linux/rbtree.h> |
| 17 | #include <linux/dma-mapping.h> | 17 | #include <linux/dma-mapping.h> |
| 18 | 18 | ||
| 19 | /* IO virtual address start page frame number */ | ||
| 20 | #define IOVA_START_PFN (1) | ||
| 21 | |||
| 22 | /* iova structure */ | 19 | /* iova structure */ |
| 23 | struct iova { | 20 | struct iova { |
| 24 | struct rb_node node; | 21 | struct rb_node node; |
| @@ -31,6 +28,8 @@ struct iova_domain { | |||
| 31 | spinlock_t iova_rbtree_lock; /* Lock to protect update of rbtree */ | 28 | spinlock_t iova_rbtree_lock; /* Lock to protect update of rbtree */ |
| 32 | struct rb_root rbroot; /* iova domain rbtree root */ | 29 | struct rb_root rbroot; /* iova domain rbtree root */ |
| 33 | struct rb_node *cached32_node; /* Save last alloced node */ | 30 | struct rb_node *cached32_node; /* Save last alloced node */ |
| 31 | unsigned long granule; /* pfn granularity for this domain */ | ||
| 32 | unsigned long start_pfn; /* Lower limit for this domain */ | ||
| 34 | unsigned long dma_32bit_pfn; | 33 | unsigned long dma_32bit_pfn; |
| 35 | }; | 34 | }; |
| 36 | 35 | ||
| @@ -39,6 +38,39 @@ static inline unsigned long iova_size(struct iova *iova) | |||
| 39 | return iova->pfn_hi - iova->pfn_lo + 1; | 38 | return iova->pfn_hi - iova->pfn_lo + 1; |
| 40 | } | 39 | } |
| 41 | 40 | ||
| 41 | static inline unsigned long iova_shift(struct iova_domain *iovad) | ||
| 42 | { | ||
| 43 | return __ffs(iovad->granule); | ||
| 44 | } | ||
| 45 | |||
| 46 | static inline unsigned long iova_mask(struct iova_domain *iovad) | ||
| 47 | { | ||
| 48 | return iovad->granule - 1; | ||
| 49 | } | ||
| 50 | |||
| 51 | static inline size_t iova_offset(struct iova_domain *iovad, dma_addr_t iova) | ||
| 52 | { | ||
| 53 | return iova & iova_mask(iovad); | ||
| 54 | } | ||
| 55 | |||
| 56 | static inline size_t iova_align(struct iova_domain *iovad, size_t size) | ||
| 57 | { | ||
| 58 | return ALIGN(size, iovad->granule); | ||
| 59 | } | ||
| 60 | |||
| 61 | static inline dma_addr_t iova_dma_addr(struct iova_domain *iovad, struct iova *iova) | ||
| 62 | { | ||
| 63 | return (dma_addr_t)iova->pfn_lo << iova_shift(iovad); | ||
| 64 | } | ||
| 65 | |||
| 66 | static inline unsigned long iova_pfn(struct iova_domain *iovad, dma_addr_t iova) | ||
| 67 | { | ||
| 68 | return iova >> iova_shift(iovad); | ||
| 69 | } | ||
| 70 | |||
| 71 | int iommu_iova_cache_init(void); | ||
| 72 | void iommu_iova_cache_destroy(void); | ||
| 73 | |||
| 42 | struct iova *alloc_iova_mem(void); | 74 | struct iova *alloc_iova_mem(void); |
| 43 | void free_iova_mem(struct iova *iova); | 75 | void free_iova_mem(struct iova *iova); |
| 44 | void free_iova(struct iova_domain *iovad, unsigned long pfn); | 76 | void free_iova(struct iova_domain *iovad, unsigned long pfn); |
| @@ -49,7 +81,8 @@ struct iova *alloc_iova(struct iova_domain *iovad, unsigned long size, | |||
| 49 | struct iova *reserve_iova(struct iova_domain *iovad, unsigned long pfn_lo, | 81 | struct iova *reserve_iova(struct iova_domain *iovad, unsigned long pfn_lo, |
| 50 | unsigned long pfn_hi); | 82 | unsigned long pfn_hi); |
| 51 | void copy_reserved_iova(struct iova_domain *from, struct iova_domain *to); | 83 | void copy_reserved_iova(struct iova_domain *from, struct iova_domain *to); |
| 52 | void init_iova_domain(struct iova_domain *iovad, unsigned long pfn_32bit); | 84 | void init_iova_domain(struct iova_domain *iovad, unsigned long granule, |
| 85 | unsigned long start_pfn, unsigned long pfn_32bit); | ||
| 53 | struct iova *find_iova(struct iova_domain *iovad, unsigned long pfn); | 86 | struct iova *find_iova(struct iova_domain *iovad, unsigned long pfn); |
| 54 | void put_iova_domain(struct iova_domain *iovad); | 87 | void put_iova_domain(struct iova_domain *iovad); |
| 55 | struct iova *split_and_remove_iova(struct iova_domain *iovad, | 88 | struct iova *split_and_remove_iova(struct iova_domain *iovad, |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index c694e7baa621..4d5169f5d7d1 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
| @@ -52,6 +52,7 @@ struct ipv6_devconf { | |||
| 52 | __s32 force_tllao; | 52 | __s32 force_tllao; |
| 53 | __s32 ndisc_notify; | 53 | __s32 ndisc_notify; |
| 54 | __s32 suppress_frag_ndisc; | 54 | __s32 suppress_frag_ndisc; |
| 55 | __s32 accept_ra_mtu; | ||
| 55 | void *sysctl; | 56 | void *sysctl; |
| 56 | }; | 57 | }; |
| 57 | 58 | ||
| @@ -124,6 +125,12 @@ struct ipv6_mc_socklist; | |||
| 124 | struct ipv6_ac_socklist; | 125 | struct ipv6_ac_socklist; |
| 125 | struct ipv6_fl_socklist; | 126 | struct ipv6_fl_socklist; |
| 126 | 127 | ||
| 128 | struct inet6_cork { | ||
| 129 | struct ipv6_txoptions *opt; | ||
| 130 | u8 hop_limit; | ||
| 131 | u8 tclass; | ||
| 132 | }; | ||
| 133 | |||
| 127 | /** | 134 | /** |
| 128 | * struct ipv6_pinfo - ipv6 private area | 135 | * struct ipv6_pinfo - ipv6 private area |
| 129 | * | 136 | * |
| @@ -216,11 +223,7 @@ struct ipv6_pinfo { | |||
| 216 | struct ipv6_txoptions *opt; | 223 | struct ipv6_txoptions *opt; |
| 217 | struct sk_buff *pktoptions; | 224 | struct sk_buff *pktoptions; |
| 218 | struct sk_buff *rxpmtu; | 225 | struct sk_buff *rxpmtu; |
| 219 | struct { | 226 | struct inet6_cork cork; |
| 220 | struct ipv6_txoptions *opt; | ||
| 221 | u8 hop_limit; | ||
| 222 | u8 tclass; | ||
| 223 | } cork; | ||
| 224 | }; | 227 | }; |
| 225 | 228 | ||
| 226 | /* WARNING: don't change the layout of the members in {raw,udp,tcp}6_sock! */ | 229 | /* WARNING: don't change the layout of the members in {raw,udp,tcp}6_sock! */ |
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index 31229e0be90b..d32615280be9 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
| @@ -956,15 +956,6 @@ void __log_wait_for_space(journal_t *journal); | |||
| 956 | extern void __journal_drop_transaction(journal_t *, transaction_t *); | 956 | extern void __journal_drop_transaction(journal_t *, transaction_t *); |
| 957 | extern int cleanup_journal_tail(journal_t *); | 957 | extern int cleanup_journal_tail(journal_t *); |
| 958 | 958 | ||
| 959 | /* Debugging code only: */ | ||
| 960 | |||
| 961 | #define jbd_ENOSYS() \ | ||
| 962 | do { \ | ||
| 963 | printk (KERN_ERR "JBD unimplemented function %s\n", __func__); \ | ||
| 964 | current->state = TASK_UNINTERRUPTIBLE; \ | ||
| 965 | schedule(); \ | ||
| 966 | } while (1) | ||
| 967 | |||
| 968 | /* | 959 | /* |
| 969 | * is_journal_abort | 960 | * is_journal_abort |
| 970 | * | 961 | * |
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 704b9a599b26..20e7f78041c8 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
| @@ -1251,15 +1251,6 @@ void __jbd2_log_wait_for_space(journal_t *journal); | |||
| 1251 | extern void __jbd2_journal_drop_transaction(journal_t *, transaction_t *); | 1251 | extern void __jbd2_journal_drop_transaction(journal_t *, transaction_t *); |
| 1252 | extern int jbd2_cleanup_journal_tail(journal_t *); | 1252 | extern int jbd2_cleanup_journal_tail(journal_t *); |
| 1253 | 1253 | ||
| 1254 | /* Debugging code only: */ | ||
| 1255 | |||
| 1256 | #define jbd_ENOSYS() \ | ||
| 1257 | do { \ | ||
| 1258 | printk (KERN_ERR "JBD unimplemented function %s\n", __func__); \ | ||
| 1259 | current->state = TASK_UNINTERRUPTIBLE; \ | ||
| 1260 | schedule(); \ | ||
| 1261 | } while (1) | ||
| 1262 | |||
| 1263 | /* | 1254 | /* |
| 1264 | * is_journal_abort | 1255 | * is_journal_abort |
| 1265 | * | 1256 | * |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 5449d2f4a1ef..e42e7dc34c68 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -176,7 +176,7 @@ extern int _cond_resched(void); | |||
| 176 | */ | 176 | */ |
| 177 | # define might_sleep() \ | 177 | # define might_sleep() \ |
| 178 | do { __might_sleep(__FILE__, __LINE__, 0); might_resched(); } while (0) | 178 | do { __might_sleep(__FILE__, __LINE__, 0); might_resched(); } while (0) |
| 179 | # define sched_annotate_sleep() __set_current_state(TASK_RUNNING) | 179 | # define sched_annotate_sleep() (current->task_state_change = 0) |
| 180 | #else | 180 | #else |
| 181 | static inline void ___might_sleep(const char *file, int line, | 181 | static inline void ___might_sleep(const char *file, int line, |
| 182 | int preempt_offset) { } | 182 | int preempt_offset) { } |
| @@ -471,6 +471,7 @@ extern enum system_states { | |||
| 471 | #define TAINT_OOT_MODULE 12 | 471 | #define TAINT_OOT_MODULE 12 |
| 472 | #define TAINT_UNSIGNED_MODULE 13 | 472 | #define TAINT_UNSIGNED_MODULE 13 |
| 473 | #define TAINT_SOFTLOCKUP 14 | 473 | #define TAINT_SOFTLOCKUP 14 |
| 474 | #define TAINT_LIVEPATCH 15 | ||
| 474 | 475 | ||
| 475 | extern const char hex_asc[]; | 476 | extern const char hex_asc[]; |
| 476 | #define hex_asc_lo(x) hex_asc[((x) & 0x0f)] | 477 | #define hex_asc_lo(x) hex_asc[((x) & 0x0f)] |
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 5297f9fa0ef2..1ab54754a86d 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
| @@ -308,7 +308,8 @@ struct optimized_kprobe { | |||
| 308 | /* Architecture dependent functions for direct jump optimization */ | 308 | /* Architecture dependent functions for direct jump optimization */ |
| 309 | extern int arch_prepared_optinsn(struct arch_optimized_insn *optinsn); | 309 | extern int arch_prepared_optinsn(struct arch_optimized_insn *optinsn); |
| 310 | extern int arch_check_optimized_kprobe(struct optimized_kprobe *op); | 310 | extern int arch_check_optimized_kprobe(struct optimized_kprobe *op); |
| 311 | extern int arch_prepare_optimized_kprobe(struct optimized_kprobe *op); | 311 | extern int arch_prepare_optimized_kprobe(struct optimized_kprobe *op, |
| 312 | struct kprobe *orig); | ||
| 312 | extern void arch_remove_optimized_kprobe(struct optimized_kprobe *op); | 313 | extern void arch_remove_optimized_kprobe(struct optimized_kprobe *op); |
| 313 | extern void arch_optimize_kprobes(struct list_head *oplist); | 314 | extern void arch_optimize_kprobes(struct list_head *oplist); |
| 314 | extern void arch_unoptimize_kprobes(struct list_head *oplist, | 315 | extern void arch_unoptimize_kprobes(struct list_head *oplist, |
diff --git a/include/linux/ktime.h b/include/linux/ktime.h index c9d645ad98ff..5fc3d1083071 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h | |||
| @@ -166,7 +166,17 @@ static inline bool ktime_before(const ktime_t cmp1, const ktime_t cmp2) | |||
| 166 | } | 166 | } |
| 167 | 167 | ||
| 168 | #if BITS_PER_LONG < 64 | 168 | #if BITS_PER_LONG < 64 |
| 169 | extern u64 ktime_divns(const ktime_t kt, s64 div); | 169 | extern u64 __ktime_divns(const ktime_t kt, s64 div); |
| 170 | static inline u64 ktime_divns(const ktime_t kt, s64 div) | ||
| 171 | { | ||
| 172 | if (__builtin_constant_p(div) && !(div >> 32)) { | ||
| 173 | u64 ns = kt.tv64; | ||
| 174 | do_div(ns, div); | ||
| 175 | return ns; | ||
| 176 | } else { | ||
| 177 | return __ktime_divns(kt, div); | ||
| 178 | } | ||
| 179 | } | ||
| 170 | #else /* BITS_PER_LONG < 64 */ | 180 | #else /* BITS_PER_LONG < 64 */ |
| 171 | # define ktime_divns(kt, div) (u64)((kt).tv64 / (div)) | 181 | # define ktime_divns(kt, div) (u64)((kt).tv64 / (div)) |
| 172 | #endif | 182 | #endif |
| @@ -186,6 +196,11 @@ static inline s64 ktime_us_delta(const ktime_t later, const ktime_t earlier) | |||
| 186 | return ktime_to_us(ktime_sub(later, earlier)); | 196 | return ktime_to_us(ktime_sub(later, earlier)); |
| 187 | } | 197 | } |
| 188 | 198 | ||
| 199 | static inline s64 ktime_ms_delta(const ktime_t later, const ktime_t earlier) | ||
| 200 | { | ||
| 201 | return ktime_to_ms(ktime_sub(later, earlier)); | ||
| 202 | } | ||
| 203 | |||
| 189 | static inline ktime_t ktime_add_us(const ktime_t kt, const u64 usec) | 204 | static inline ktime_t ktime_add_us(const ktime_t kt, const u64 usec) |
| 190 | { | 205 | { |
| 191 | return ktime_add_ns(kt, usec * NSEC_PER_USEC); | 206 | return ktime_add_ns(kt, usec * NSEC_PER_USEC); |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 26f106022c88..d189ee098aa2 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
| @@ -200,17 +200,6 @@ int kvm_setup_async_pf(struct kvm_vcpu *vcpu, gva_t gva, unsigned long hva, | |||
| 200 | int kvm_async_pf_wakeup_all(struct kvm_vcpu *vcpu); | 200 | int kvm_async_pf_wakeup_all(struct kvm_vcpu *vcpu); |
| 201 | #endif | 201 | #endif |
| 202 | 202 | ||
| 203 | /* | ||
| 204 | * Carry out a gup that requires IO. Allow the mm to relinquish the mmap | ||
| 205 | * semaphore if the filemap/swap has to wait on a page lock. pagep == NULL | ||
| 206 | * controls whether we retry the gup one more time to completion in that case. | ||
| 207 | * Typically this is called after a FAULT_FLAG_RETRY_NOWAIT in the main tdp | ||
| 208 | * handler. | ||
| 209 | */ | ||
| 210 | int kvm_get_user_page_io(struct task_struct *tsk, struct mm_struct *mm, | ||
| 211 | unsigned long addr, bool write_fault, | ||
| 212 | struct page **pagep); | ||
| 213 | |||
| 214 | enum { | 203 | enum { |
| 215 | OUTSIDE_GUEST_MODE, | 204 | OUTSIDE_GUEST_MODE, |
| 216 | IN_GUEST_MODE, | 205 | IN_GUEST_MODE, |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 2d182413b1db..61df823ac86a 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -231,6 +231,7 @@ enum { | |||
| 231 | ATA_FLAG_SW_ACTIVITY = (1 << 22), /* driver supports sw activity | 231 | ATA_FLAG_SW_ACTIVITY = (1 << 22), /* driver supports sw activity |
| 232 | * led */ | 232 | * led */ |
| 233 | ATA_FLAG_NO_DIPM = (1 << 23), /* host not happy with DIPM */ | 233 | ATA_FLAG_NO_DIPM = (1 << 23), /* host not happy with DIPM */ |
| 234 | ATA_FLAG_LOWTAG = (1 << 24), /* host wants lowest available tag */ | ||
| 234 | 235 | ||
| 235 | /* bits 24:31 of ap->flags are reserved for LLD specific flags */ | 236 | /* bits 24:31 of ap->flags are reserved for LLD specific flags */ |
| 236 | 237 | ||
| @@ -422,6 +423,7 @@ enum { | |||
| 422 | ATA_HORKAGE_NO_NCQ_TRIM = (1 << 19), /* don't use queued TRIM */ | 423 | ATA_HORKAGE_NO_NCQ_TRIM = (1 << 19), /* don't use queued TRIM */ |
| 423 | ATA_HORKAGE_NOLPM = (1 << 20), /* don't use LPM */ | 424 | ATA_HORKAGE_NOLPM = (1 << 20), /* don't use LPM */ |
| 424 | ATA_HORKAGE_WD_BROKEN_LPM = (1 << 21), /* some WDs have broken LPM */ | 425 | ATA_HORKAGE_WD_BROKEN_LPM = (1 << 21), /* some WDs have broken LPM */ |
| 426 | ATA_HORKAGE_ZERO_AFTER_TRIM = (1 << 22),/* guarantees zero after trim */ | ||
| 425 | 427 | ||
| 426 | /* DMA mask for user DMA control: User visible values; DO NOT | 428 | /* DMA mask for user DMA control: User visible values; DO NOT |
| 427 | renumber */ | 429 | renumber */ |
| @@ -1338,6 +1340,12 @@ extern const struct ata_port_operations ata_base_port_ops; | |||
| 1338 | extern const struct ata_port_operations sata_port_ops; | 1340 | extern const struct ata_port_operations sata_port_ops; |
| 1339 | extern struct device_attribute *ata_common_sdev_attrs[]; | 1341 | extern struct device_attribute *ata_common_sdev_attrs[]; |
| 1340 | 1342 | ||
| 1343 | /* | ||
| 1344 | * All sht initializers (BASE, PIO, BMDMA, NCQ) must be instantiated | ||
| 1345 | * by the edge drivers. Because the 'module' field of sht must be the | ||
| 1346 | * edge driver's module reference, otherwise the driver can be unloaded | ||
| 1347 | * even if the scsi_device is being accessed. | ||
| 1348 | */ | ||
| 1341 | #define ATA_BASE_SHT(drv_name) \ | 1349 | #define ATA_BASE_SHT(drv_name) \ |
| 1342 | .module = THIS_MODULE, \ | 1350 | .module = THIS_MODULE, \ |
| 1343 | .name = drv_name, \ | 1351 | .name = drv_name, \ |
diff --git a/include/linux/list_nulls.h b/include/linux/list_nulls.h index 5d10ae364b5e..f266661d2666 100644 --- a/include/linux/list_nulls.h +++ b/include/linux/list_nulls.h | |||
| @@ -1,6 +1,9 @@ | |||
| 1 | #ifndef _LINUX_LIST_NULLS_H | 1 | #ifndef _LINUX_LIST_NULLS_H |
| 2 | #define _LINUX_LIST_NULLS_H | 2 | #define _LINUX_LIST_NULLS_H |
| 3 | 3 | ||
| 4 | #include <linux/poison.h> | ||
| 5 | #include <linux/const.h> | ||
| 6 | |||
| 4 | /* | 7 | /* |
| 5 | * Special version of lists, where end of list is not a NULL pointer, | 8 | * Special version of lists, where end of list is not a NULL pointer, |
| 6 | * but a 'nulls' marker, which can have many different values. | 9 | * but a 'nulls' marker, which can have many different values. |
| @@ -21,8 +24,9 @@ struct hlist_nulls_head { | |||
| 21 | struct hlist_nulls_node { | 24 | struct hlist_nulls_node { |
| 22 | struct hlist_nulls_node *next, **pprev; | 25 | struct hlist_nulls_node *next, **pprev; |
| 23 | }; | 26 | }; |
| 27 | #define NULLS_MARKER(value) (1UL | (((long)value) << 1)) | ||
| 24 | #define INIT_HLIST_NULLS_HEAD(ptr, nulls) \ | 28 | #define INIT_HLIST_NULLS_HEAD(ptr, nulls) \ |
| 25 | ((ptr)->first = (struct hlist_nulls_node *) (1UL | (((long)nulls) << 1))) | 29 | ((ptr)->first = (struct hlist_nulls_node *) NULLS_MARKER(nulls)) |
| 26 | 30 | ||
| 27 | #define hlist_nulls_entry(ptr, type, member) container_of(ptr,type,member) | 31 | #define hlist_nulls_entry(ptr, type, member) container_of(ptr,type,member) |
| 28 | /** | 32 | /** |
diff --git a/include/linux/livepatch.h b/include/linux/livepatch.h new file mode 100644 index 000000000000..95023fd8b00d --- /dev/null +++ b/include/linux/livepatch.h | |||
| @@ -0,0 +1,133 @@ | |||
| 1 | /* | ||
| 2 | * livepatch.h - Kernel Live Patching Core | ||
| 3 | * | ||
| 4 | * Copyright (C) 2014 Seth Jennings <sjenning@redhat.com> | ||
| 5 | * Copyright (C) 2014 SUSE | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or | ||
| 8 | * modify it under the terms of the GNU General Public License | ||
| 9 | * as published by the Free Software Foundation; either version 2 | ||
| 10 | * of the License, or (at your option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with this program; if not, see <http://www.gnu.org/licenses/>. | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef _LINUX_LIVEPATCH_H_ | ||
| 22 | #define _LINUX_LIVEPATCH_H_ | ||
| 23 | |||
| 24 | #include <linux/module.h> | ||
| 25 | #include <linux/ftrace.h> | ||
| 26 | |||
| 27 | #if IS_ENABLED(CONFIG_LIVEPATCH) | ||
| 28 | |||
| 29 | #include <asm/livepatch.h> | ||
| 30 | |||
| 31 | enum klp_state { | ||
| 32 | KLP_DISABLED, | ||
| 33 | KLP_ENABLED | ||
| 34 | }; | ||
| 35 | |||
| 36 | /** | ||
| 37 | * struct klp_func - function structure for live patching | ||
| 38 | * @old_name: name of the function to be patched | ||
| 39 | * @new_func: pointer to the patched function code | ||
| 40 | * @old_addr: a hint conveying at what address the old function | ||
| 41 | * can be found (optional, vmlinux patches only) | ||
| 42 | * @kobj: kobject for sysfs resources | ||
| 43 | * @state: tracks function-level patch application state | ||
| 44 | * @stack_node: list node for klp_ops func_stack list | ||
| 45 | */ | ||
| 46 | struct klp_func { | ||
| 47 | /* external */ | ||
| 48 | const char *old_name; | ||
| 49 | void *new_func; | ||
| 50 | /* | ||
| 51 | * The old_addr field is optional and can be used to resolve | ||
| 52 | * duplicate symbol names in the vmlinux object. If this | ||
| 53 | * information is not present, the symbol is located by name | ||
| 54 | * with kallsyms. If the name is not unique and old_addr is | ||
| 55 | * not provided, the patch application fails as there is no | ||
| 56 | * way to resolve the ambiguity. | ||
| 57 | */ | ||
| 58 | unsigned long old_addr; | ||
| 59 | |||
| 60 | /* internal */ | ||
| 61 | struct kobject kobj; | ||
| 62 | enum klp_state state; | ||
| 63 | struct list_head stack_node; | ||
| 64 | }; | ||
| 65 | |||
| 66 | /** | ||
| 67 | * struct klp_reloc - relocation structure for live patching | ||
| 68 | * @loc: address where the relocation will be written | ||
| 69 | * @val: address of the referenced symbol (optional, | ||
| 70 | * vmlinux patches only) | ||
| 71 | * @type: ELF relocation type | ||
| 72 | * @name: name of the referenced symbol (for lookup/verification) | ||
| 73 | * @addend: offset from the referenced symbol | ||
| 74 | * @external: symbol is either exported or within the live patch module itself | ||
| 75 | */ | ||
| 76 | struct klp_reloc { | ||
| 77 | unsigned long loc; | ||
| 78 | unsigned long val; | ||
| 79 | unsigned long type; | ||
| 80 | const char *name; | ||
| 81 | int addend; | ||
| 82 | int external; | ||
| 83 | }; | ||
| 84 | |||
| 85 | /** | ||
| 86 | * struct klp_object - kernel object structure for live patching | ||
| 87 | * @name: module name (or NULL for vmlinux) | ||
| 88 | * @relocs: relocation entries to be applied at load time | ||
| 89 | * @funcs: function entries for functions to be patched in the object | ||
| 90 | * @kobj: kobject for sysfs resources | ||
| 91 | * @mod: kernel module associated with the patched object | ||
| 92 | * (NULL for vmlinux) | ||
| 93 | * @state: tracks object-level patch application state | ||
| 94 | */ | ||
| 95 | struct klp_object { | ||
| 96 | /* external */ | ||
| 97 | const char *name; | ||
| 98 | struct klp_reloc *relocs; | ||
| 99 | struct klp_func *funcs; | ||
| 100 | |||
| 101 | /* internal */ | ||
| 102 | struct kobject *kobj; | ||
| 103 | struct module *mod; | ||
| 104 | enum klp_state state; | ||
| 105 | }; | ||
| 106 | |||
| 107 | /** | ||
| 108 | * struct klp_patch - patch structure for live patching | ||
| 109 | * @mod: reference to the live patch module | ||
| 110 | * @objs: object entries for kernel objects to be patched | ||
| 111 | * @list: list node for global list of registered patches | ||
| 112 | * @kobj: kobject for sysfs resources | ||
| 113 | * @state: tracks patch-level application state | ||
| 114 | */ | ||
| 115 | struct klp_patch { | ||
| 116 | /* external */ | ||
| 117 | struct module *mod; | ||
| 118 | struct klp_object *objs; | ||
| 119 | |||
| 120 | /* internal */ | ||
| 121 | struct list_head list; | ||
| 122 | struct kobject kobj; | ||
| 123 | enum klp_state state; | ||
| 124 | }; | ||
| 125 | |||
| 126 | extern int klp_register_patch(struct klp_patch *); | ||
| 127 | extern int klp_unregister_patch(struct klp_patch *); | ||
| 128 | extern int klp_enable_patch(struct klp_patch *); | ||
| 129 | extern int klp_disable_patch(struct klp_patch *); | ||
| 130 | |||
| 131 | #endif /* CONFIG_LIVEPATCH */ | ||
| 132 | |||
| 133 | #endif /* _LINUX_LIVEPATCH_H_ */ | ||
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 7c95af8d552c..6cfd934c7c9b 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
| @@ -52,7 +52,27 @@ struct mem_cgroup_reclaim_cookie { | |||
| 52 | unsigned int generation; | 52 | unsigned int generation; |
| 53 | }; | 53 | }; |
| 54 | 54 | ||
| 55 | enum mem_cgroup_events_index { | ||
| 56 | MEM_CGROUP_EVENTS_PGPGIN, /* # of pages paged in */ | ||
| 57 | MEM_CGROUP_EVENTS_PGPGOUT, /* # of pages paged out */ | ||
| 58 | MEM_CGROUP_EVENTS_PGFAULT, /* # of page-faults */ | ||
| 59 | MEM_CGROUP_EVENTS_PGMAJFAULT, /* # of major page-faults */ | ||
| 60 | MEM_CGROUP_EVENTS_NSTATS, | ||
| 61 | /* default hierarchy events */ | ||
| 62 | MEMCG_LOW = MEM_CGROUP_EVENTS_NSTATS, | ||
| 63 | MEMCG_HIGH, | ||
| 64 | MEMCG_MAX, | ||
| 65 | MEMCG_OOM, | ||
| 66 | MEMCG_NR_EVENTS, | ||
| 67 | }; | ||
| 68 | |||
| 55 | #ifdef CONFIG_MEMCG | 69 | #ifdef CONFIG_MEMCG |
| 70 | void mem_cgroup_events(struct mem_cgroup *memcg, | ||
| 71 | enum mem_cgroup_events_index idx, | ||
| 72 | unsigned int nr); | ||
| 73 | |||
| 74 | bool mem_cgroup_low(struct mem_cgroup *root, struct mem_cgroup *memcg); | ||
| 75 | |||
| 56 | int mem_cgroup_try_charge(struct page *page, struct mm_struct *mm, | 76 | int mem_cgroup_try_charge(struct page *page, struct mm_struct *mm, |
| 57 | gfp_t gfp_mask, struct mem_cgroup **memcgp); | 77 | gfp_t gfp_mask, struct mem_cgroup **memcgp); |
| 58 | void mem_cgroup_commit_charge(struct page *page, struct mem_cgroup *memcg, | 78 | void mem_cgroup_commit_charge(struct page *page, struct mem_cgroup *memcg, |
| @@ -102,6 +122,7 @@ void mem_cgroup_iter_break(struct mem_cgroup *, struct mem_cgroup *); | |||
| 102 | * For memory reclaim. | 122 | * For memory reclaim. |
| 103 | */ | 123 | */ |
| 104 | int mem_cgroup_inactive_anon_is_low(struct lruvec *lruvec); | 124 | int mem_cgroup_inactive_anon_is_low(struct lruvec *lruvec); |
| 125 | bool mem_cgroup_lruvec_online(struct lruvec *lruvec); | ||
| 105 | int mem_cgroup_select_victim_node(struct mem_cgroup *memcg); | 126 | int mem_cgroup_select_victim_node(struct mem_cgroup *memcg); |
| 106 | unsigned long mem_cgroup_get_lru_size(struct lruvec *lruvec, enum lru_list); | 127 | unsigned long mem_cgroup_get_lru_size(struct lruvec *lruvec, enum lru_list); |
| 107 | void mem_cgroup_update_lru_size(struct lruvec *, enum lru_list, int); | 128 | void mem_cgroup_update_lru_size(struct lruvec *, enum lru_list, int); |
| @@ -138,12 +159,10 @@ static inline bool mem_cgroup_disabled(void) | |||
| 138 | return false; | 159 | return false; |
| 139 | } | 160 | } |
| 140 | 161 | ||
| 141 | struct mem_cgroup *mem_cgroup_begin_page_stat(struct page *page, bool *locked, | 162 | struct mem_cgroup *mem_cgroup_begin_page_stat(struct page *page); |
| 142 | unsigned long *flags); | ||
| 143 | void mem_cgroup_end_page_stat(struct mem_cgroup *memcg, bool *locked, | ||
| 144 | unsigned long *flags); | ||
| 145 | void mem_cgroup_update_page_stat(struct mem_cgroup *memcg, | 163 | void mem_cgroup_update_page_stat(struct mem_cgroup *memcg, |
| 146 | enum mem_cgroup_stat_index idx, int val); | 164 | enum mem_cgroup_stat_index idx, int val); |
| 165 | void mem_cgroup_end_page_stat(struct mem_cgroup *memcg); | ||
| 147 | 166 | ||
| 148 | static inline void mem_cgroup_inc_page_stat(struct mem_cgroup *memcg, | 167 | static inline void mem_cgroup_inc_page_stat(struct mem_cgroup *memcg, |
| 149 | enum mem_cgroup_stat_index idx) | 168 | enum mem_cgroup_stat_index idx) |
| @@ -176,6 +195,18 @@ void mem_cgroup_split_huge_fixup(struct page *head); | |||
| 176 | #else /* CONFIG_MEMCG */ | 195 | #else /* CONFIG_MEMCG */ |
| 177 | struct mem_cgroup; | 196 | struct mem_cgroup; |
| 178 | 197 | ||
| 198 | static inline void mem_cgroup_events(struct mem_cgroup *memcg, | ||
| 199 | enum mem_cgroup_events_index idx, | ||
| 200 | unsigned int nr) | ||
| 201 | { | ||
| 202 | } | ||
| 203 | |||
| 204 | static inline bool mem_cgroup_low(struct mem_cgroup *root, | ||
| 205 | struct mem_cgroup *memcg) | ||
| 206 | { | ||
| 207 | return false; | ||
| 208 | } | ||
| 209 | |||
| 179 | static inline int mem_cgroup_try_charge(struct page *page, struct mm_struct *mm, | 210 | static inline int mem_cgroup_try_charge(struct page *page, struct mm_struct *mm, |
| 180 | gfp_t gfp_mask, | 211 | gfp_t gfp_mask, |
| 181 | struct mem_cgroup **memcgp) | 212 | struct mem_cgroup **memcgp) |
| @@ -268,6 +299,11 @@ mem_cgroup_inactive_anon_is_low(struct lruvec *lruvec) | |||
| 268 | return 1; | 299 | return 1; |
| 269 | } | 300 | } |
| 270 | 301 | ||
| 302 | static inline bool mem_cgroup_lruvec_online(struct lruvec *lruvec) | ||
| 303 | { | ||
| 304 | return true; | ||
| 305 | } | ||
| 306 | |||
| 271 | static inline unsigned long | 307 | static inline unsigned long |
| 272 | mem_cgroup_get_lru_size(struct lruvec *lruvec, enum lru_list lru) | 308 | mem_cgroup_get_lru_size(struct lruvec *lruvec, enum lru_list lru) |
| 273 | { | 309 | { |
| @@ -285,14 +321,12 @@ mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p) | |||
| 285 | { | 321 | { |
| 286 | } | 322 | } |
| 287 | 323 | ||
| 288 | static inline struct mem_cgroup *mem_cgroup_begin_page_stat(struct page *page, | 324 | static inline struct mem_cgroup *mem_cgroup_begin_page_stat(struct page *page) |
| 289 | bool *locked, unsigned long *flags) | ||
| 290 | { | 325 | { |
| 291 | return NULL; | 326 | return NULL; |
| 292 | } | 327 | } |
| 293 | 328 | ||
| 294 | static inline void mem_cgroup_end_page_stat(struct mem_cgroup *memcg, | 329 | static inline void mem_cgroup_end_page_stat(struct mem_cgroup *memcg) |
| 295 | bool *locked, unsigned long *flags) | ||
| 296 | { | 330 | { |
| 297 | } | 331 | } |
| 298 | 332 | ||
| @@ -403,10 +437,9 @@ void memcg_update_array_size(int num_groups); | |||
| 403 | struct kmem_cache *__memcg_kmem_get_cache(struct kmem_cache *cachep); | 437 | struct kmem_cache *__memcg_kmem_get_cache(struct kmem_cache *cachep); |
| 404 | void __memcg_kmem_put_cache(struct kmem_cache *cachep); | 438 | void __memcg_kmem_put_cache(struct kmem_cache *cachep); |
| 405 | 439 | ||
| 406 | int __memcg_charge_slab(struct kmem_cache *cachep, gfp_t gfp, int order); | 440 | int memcg_charge_kmem(struct mem_cgroup *memcg, gfp_t gfp, |
| 407 | void __memcg_uncharge_slab(struct kmem_cache *cachep, int order); | 441 | unsigned long nr_pages); |
| 408 | 442 | void memcg_uncharge_kmem(struct mem_cgroup *memcg, unsigned long nr_pages); | |
| 409 | int __memcg_cleanup_cache_params(struct kmem_cache *s); | ||
| 410 | 443 | ||
| 411 | /** | 444 | /** |
| 412 | * memcg_kmem_newpage_charge: verify if a new kmem allocation is allowed. | 445 | * memcg_kmem_newpage_charge: verify if a new kmem allocation is allowed. |
diff --git a/include/linux/mfd/abx500/ab8500-bm.h b/include/linux/mfd/abx500/ab8500-bm.h index cc892a8d8d6e..12a5b396921e 100644 --- a/include/linux/mfd/abx500/ab8500-bm.h +++ b/include/linux/mfd/abx500/ab8500-bm.h | |||
| @@ -461,7 +461,6 @@ struct ab8500_fg; | |||
| 461 | #ifdef CONFIG_AB8500_BM | 461 | #ifdef CONFIG_AB8500_BM |
| 462 | extern struct abx500_bm_data ab8500_bm_data; | 462 | extern struct abx500_bm_data ab8500_bm_data; |
| 463 | 463 | ||
| 464 | void ab8500_fg_reinit(void); | ||
| 465 | void ab8500_charger_usb_state_changed(u8 bm_usb_state, u16 mA); | 464 | void ab8500_charger_usb_state_changed(u8 bm_usb_state, u16 mA); |
| 466 | struct ab8500_btemp *ab8500_btemp_get(void); | 465 | struct ab8500_btemp *ab8500_btemp_get(void); |
| 467 | int ab8500_btemp_get_batctrl_temp(struct ab8500_btemp *btemp); | 466 | int ab8500_btemp_get_batctrl_temp(struct ab8500_btemp *btemp); |
diff --git a/include/linux/mfd/max77693-private.h b/include/linux/mfd/max77693-private.h index 08dae01258b9..955dd990beaf 100644 --- a/include/linux/mfd/max77693-private.h +++ b/include/linux/mfd/max77693-private.h | |||
| @@ -143,10 +143,118 @@ enum max77693_pmic_reg { | |||
| 143 | #define FLASH_INT_FLED1_SHORT BIT(3) | 143 | #define FLASH_INT_FLED1_SHORT BIT(3) |
| 144 | #define FLASH_INT_OVER_CURRENT BIT(4) | 144 | #define FLASH_INT_OVER_CURRENT BIT(4) |
| 145 | 145 | ||
| 146 | /* Fast charge timer in in hours */ | ||
| 147 | #define DEFAULT_FAST_CHARGE_TIMER 4 | ||
| 148 | /* microamps */ | ||
| 149 | #define DEFAULT_TOP_OFF_THRESHOLD_CURRENT 150000 | ||
| 150 | /* minutes */ | ||
| 151 | #define DEFAULT_TOP_OFF_TIMER 30 | ||
| 152 | /* microvolts */ | ||
| 153 | #define DEFAULT_CONSTANT_VOLT 4200000 | ||
| 154 | /* microvolts */ | ||
| 155 | #define DEFAULT_MIN_SYSTEM_VOLT 3600000 | ||
| 156 | /* celsius */ | ||
| 157 | #define DEFAULT_THERMAL_REGULATION_TEMP 100 | ||
| 158 | /* microamps */ | ||
| 159 | #define DEFAULT_BATTERY_OVERCURRENT 3500000 | ||
| 160 | /* microvolts */ | ||
| 161 | #define DEFAULT_CHARGER_INPUT_THRESHOLD_VOLT 4300000 | ||
| 162 | |||
| 163 | /* MAX77693_CHG_REG_CHG_INT_OK register */ | ||
| 164 | #define CHG_INT_OK_BYP_SHIFT 0 | ||
| 165 | #define CHG_INT_OK_BAT_SHIFT 3 | ||
| 166 | #define CHG_INT_OK_CHG_SHIFT 4 | ||
| 167 | #define CHG_INT_OK_CHGIN_SHIFT 6 | ||
| 168 | #define CHG_INT_OK_DETBAT_SHIFT 7 | ||
| 169 | #define CHG_INT_OK_BYP_MASK BIT(CHG_INT_OK_BYP_SHIFT) | ||
| 170 | #define CHG_INT_OK_BAT_MASK BIT(CHG_INT_OK_BAT_SHIFT) | ||
| 171 | #define CHG_INT_OK_CHG_MASK BIT(CHG_INT_OK_CHG_SHIFT) | ||
| 172 | #define CHG_INT_OK_CHGIN_MASK BIT(CHG_INT_OK_CHGIN_SHIFT) | ||
| 173 | #define CHG_INT_OK_DETBAT_MASK BIT(CHG_INT_OK_DETBAT_SHIFT) | ||
| 174 | |||
| 175 | /* MAX77693_CHG_REG_CHG_DETAILS_00 register */ | ||
| 176 | #define CHG_DETAILS_00_CHGIN_SHIFT 5 | ||
| 177 | #define CHG_DETAILS_00_CHGIN_MASK (0x3 << CHG_DETAILS_00_CHGIN_SHIFT) | ||
| 178 | |||
| 179 | /* MAX77693_CHG_REG_CHG_DETAILS_01 register */ | ||
| 180 | #define CHG_DETAILS_01_CHG_SHIFT 0 | ||
| 181 | #define CHG_DETAILS_01_BAT_SHIFT 4 | ||
| 182 | #define CHG_DETAILS_01_TREG_SHIFT 7 | ||
| 183 | #define CHG_DETAILS_01_CHG_MASK (0xf << CHG_DETAILS_01_CHG_SHIFT) | ||
| 184 | #define CHG_DETAILS_01_BAT_MASK (0x7 << CHG_DETAILS_01_BAT_SHIFT) | ||
| 185 | #define CHG_DETAILS_01_TREG_MASK BIT(7) | ||
| 186 | |||
| 187 | /* MAX77693_CHG_REG_CHG_DETAILS_01/CHG field */ | ||
| 188 | enum max77693_charger_charging_state { | ||
| 189 | MAX77693_CHARGING_PREQUALIFICATION = 0x0, | ||
| 190 | MAX77693_CHARGING_FAST_CONST_CURRENT, | ||
| 191 | MAX77693_CHARGING_FAST_CONST_VOLTAGE, | ||
| 192 | MAX77693_CHARGING_TOP_OFF, | ||
| 193 | MAX77693_CHARGING_DONE, | ||
| 194 | MAX77693_CHARGING_HIGH_TEMP, | ||
| 195 | MAX77693_CHARGING_TIMER_EXPIRED, | ||
| 196 | MAX77693_CHARGING_THERMISTOR_SUSPEND, | ||
| 197 | MAX77693_CHARGING_OFF, | ||
| 198 | MAX77693_CHARGING_RESERVED, | ||
| 199 | MAX77693_CHARGING_OVER_TEMP, | ||
| 200 | MAX77693_CHARGING_WATCHDOG_EXPIRED, | ||
| 201 | }; | ||
| 202 | |||
| 203 | /* MAX77693_CHG_REG_CHG_DETAILS_01/BAT field */ | ||
| 204 | enum max77693_charger_battery_state { | ||
| 205 | MAX77693_BATTERY_NOBAT = 0x0, | ||
| 206 | /* Dead-battery or low-battery prequalification */ | ||
| 207 | MAX77693_BATTERY_PREQUALIFICATION, | ||
| 208 | MAX77693_BATTERY_TIMER_EXPIRED, | ||
| 209 | MAX77693_BATTERY_GOOD, | ||
| 210 | MAX77693_BATTERY_LOWVOLTAGE, | ||
| 211 | MAX77693_BATTERY_OVERVOLTAGE, | ||
| 212 | MAX77693_BATTERY_OVERCURRENT, | ||
| 213 | MAX77693_BATTERY_RESERVED, | ||
| 214 | }; | ||
| 215 | |||
| 216 | /* MAX77693_CHG_REG_CHG_DETAILS_02 register */ | ||
| 217 | #define CHG_DETAILS_02_BYP_SHIFT 0 | ||
| 218 | #define CHG_DETAILS_02_BYP_MASK (0xf << CHG_DETAILS_02_BYP_SHIFT) | ||
| 219 | |||
| 146 | /* MAX77693 CHG_CNFG_00 register */ | 220 | /* MAX77693 CHG_CNFG_00 register */ |
| 147 | #define CHG_CNFG_00_CHG_MASK 0x1 | 221 | #define CHG_CNFG_00_CHG_MASK 0x1 |
| 148 | #define CHG_CNFG_00_BUCK_MASK 0x4 | 222 | #define CHG_CNFG_00_BUCK_MASK 0x4 |
| 149 | 223 | ||
| 224 | /* MAX77693_CHG_REG_CHG_CNFG_01 register */ | ||
| 225 | #define CHG_CNFG_01_FCHGTIME_SHIFT 0 | ||
| 226 | #define CHG_CNFG_01_CHGRSTRT_SHIFT 4 | ||
| 227 | #define CHG_CNFG_01_PQEN_SHIFT 7 | ||
| 228 | #define CHG_CNFG_01_FCHGTIME_MASK (0x7 << CHG_CNFG_01_FCHGTIME_SHIFT) | ||
| 229 | #define CHG_CNFG_01_CHGRSTRT_MASK (0x3 << CHG_CNFG_01_CHGRSTRT_SHIFT) | ||
| 230 | #define CHG_CNFG_01_PQEN_MAKS BIT(CHG_CNFG_01_PQEN_SHIFT) | ||
| 231 | |||
| 232 | /* MAX77693_CHG_REG_CHG_CNFG_03 register */ | ||
| 233 | #define CHG_CNFG_03_TOITH_SHIFT 0 | ||
| 234 | #define CHG_CNFG_03_TOTIME_SHIFT 3 | ||
| 235 | #define CHG_CNFG_03_TOITH_MASK (0x7 << CHG_CNFG_03_TOITH_SHIFT) | ||
| 236 | #define CHG_CNFG_03_TOTIME_MASK (0x7 << CHG_CNFG_03_TOTIME_SHIFT) | ||
| 237 | |||
| 238 | /* MAX77693_CHG_REG_CHG_CNFG_04 register */ | ||
| 239 | #define CHG_CNFG_04_CHGCVPRM_SHIFT 0 | ||
| 240 | #define CHG_CNFG_04_MINVSYS_SHIFT 5 | ||
| 241 | #define CHG_CNFG_04_CHGCVPRM_MASK (0x1f << CHG_CNFG_04_CHGCVPRM_SHIFT) | ||
| 242 | #define CHG_CNFG_04_MINVSYS_MASK (0x7 << CHG_CNFG_04_MINVSYS_SHIFT) | ||
| 243 | |||
| 244 | /* MAX77693_CHG_REG_CHG_CNFG_06 register */ | ||
| 245 | #define CHG_CNFG_06_CHGPROT_SHIFT 2 | ||
| 246 | #define CHG_CNFG_06_CHGPROT_MASK (0x3 << CHG_CNFG_06_CHGPROT_SHIFT) | ||
| 247 | |||
| 248 | /* MAX77693_CHG_REG_CHG_CNFG_07 register */ | ||
| 249 | #define CHG_CNFG_07_REGTEMP_SHIFT 5 | ||
| 250 | #define CHG_CNFG_07_REGTEMP_MASK (0x3 << CHG_CNFG_07_REGTEMP_SHIFT) | ||
| 251 | |||
| 252 | /* MAX77693_CHG_REG_CHG_CNFG_12 register */ | ||
| 253 | #define CHG_CNFG_12_B2SOVRC_SHIFT 0 | ||
| 254 | #define CHG_CNFG_12_VCHGINREG_SHIFT 3 | ||
| 255 | #define CHG_CNFG_12_B2SOVRC_MASK (0x7 << CHG_CNFG_12_B2SOVRC_SHIFT) | ||
| 256 | #define CHG_CNFG_12_VCHGINREG_MASK (0x3 << CHG_CNFG_12_VCHGINREG_SHIFT) | ||
| 257 | |||
| 150 | /* MAX77693 CHG_CNFG_09 Register */ | 258 | /* MAX77693 CHG_CNFG_09 Register */ |
| 151 | #define CHG_CNFG_09_CHGIN_ILIM_MASK 0x7F | 259 | #define CHG_CNFG_09_CHGIN_ILIM_MASK 0x7F |
| 152 | 260 | ||
diff --git a/include/linux/mfd/samsung/s2mps13.h b/include/linux/mfd/samsung/s2mps13.h index ce5dda8958fe..b1fd675fa36f 100644 --- a/include/linux/mfd/samsung/s2mps13.h +++ b/include/linux/mfd/samsung/s2mps13.h | |||
| @@ -59,6 +59,7 @@ enum s2mps13_reg { | |||
| 59 | S2MPS13_REG_B6CTRL, | 59 | S2MPS13_REG_B6CTRL, |
| 60 | S2MPS13_REG_B6OUT, | 60 | S2MPS13_REG_B6OUT, |
| 61 | S2MPS13_REG_B7CTRL, | 61 | S2MPS13_REG_B7CTRL, |
| 62 | S2MPS13_REG_B7SW, | ||
| 62 | S2MPS13_REG_B7OUT, | 63 | S2MPS13_REG_B7OUT, |
| 63 | S2MPS13_REG_B8CTRL, | 64 | S2MPS13_REG_B8CTRL, |
| 64 | S2MPS13_REG_B8OUT, | 65 | S2MPS13_REG_B8OUT, |
| @@ -102,6 +103,7 @@ enum s2mps13_reg { | |||
| 102 | S2MPS13_REG_L26CTRL, | 103 | S2MPS13_REG_L26CTRL, |
| 103 | S2MPS13_REG_L27CTRL, | 104 | S2MPS13_REG_L27CTRL, |
| 104 | S2MPS13_REG_L28CTRL, | 105 | S2MPS13_REG_L28CTRL, |
| 106 | S2MPS13_REG_L29CTRL, | ||
| 105 | S2MPS13_REG_L30CTRL, | 107 | S2MPS13_REG_L30CTRL, |
| 106 | S2MPS13_REG_L31CTRL, | 108 | S2MPS13_REG_L31CTRL, |
| 107 | S2MPS13_REG_L32CTRL, | 109 | S2MPS13_REG_L32CTRL, |
diff --git a/include/linux/mfd/stmpe.h b/include/linux/mfd/stmpe.h index f742b6717d52..c9d869027300 100644 --- a/include/linux/mfd/stmpe.h +++ b/include/linux/mfd/stmpe.h | |||
| @@ -118,20 +118,6 @@ extern int stmpe_disable(struct stmpe *stmpe, unsigned int blocks); | |||
| 118 | #define STMPE_GPIO_NOREQ_811_TOUCH (0xf0) | 118 | #define STMPE_GPIO_NOREQ_811_TOUCH (0xf0) |
| 119 | 119 | ||
| 120 | /** | 120 | /** |
| 121 | * struct stmpe_gpio_platform_data - STMPE GPIO platform data | ||
| 122 | * @norequest_mask: bitmask specifying which GPIOs should _not_ be | ||
| 123 | * requestable due to different usage (e.g. touch, keypad) | ||
| 124 | * STMPE_GPIO_NOREQ_* macros can be used here. | ||
| 125 | * @setup: board specific setup callback. | ||
| 126 | * @remove: board specific remove callback | ||
| 127 | */ | ||
| 128 | struct stmpe_gpio_platform_data { | ||
| 129 | unsigned norequest_mask; | ||
| 130 | void (*setup)(struct stmpe *stmpe, unsigned gpio_base); | ||
| 131 | void (*remove)(struct stmpe *stmpe, unsigned gpio_base); | ||
| 132 | }; | ||
| 133 | |||
| 134 | /** | ||
| 135 | * struct stmpe_ts_platform_data - stmpe811 touch screen controller platform | 121 | * struct stmpe_ts_platform_data - stmpe811 touch screen controller platform |
| 136 | * data | 122 | * data |
| 137 | * @sample_time: ADC converstion time in number of clock. | 123 | * @sample_time: ADC converstion time in number of clock. |
| @@ -182,7 +168,6 @@ struct stmpe_ts_platform_data { | |||
| 182 | * @irq_over_gpio: true if gpio is used to get irq | 168 | * @irq_over_gpio: true if gpio is used to get irq |
| 183 | * @irq_gpio: gpio number over which irq will be requested (significant only if | 169 | * @irq_gpio: gpio number over which irq will be requested (significant only if |
| 184 | * irq_over_gpio is true) | 170 | * irq_over_gpio is true) |
| 185 | * @gpio: GPIO-specific platform data | ||
| 186 | * @ts: touchscreen-specific platform data | 171 | * @ts: touchscreen-specific platform data |
| 187 | */ | 172 | */ |
| 188 | struct stmpe_platform_data { | 173 | struct stmpe_platform_data { |
| @@ -194,7 +179,6 @@ struct stmpe_platform_data { | |||
| 194 | int irq_gpio; | 179 | int irq_gpio; |
| 195 | int autosleep_timeout; | 180 | int autosleep_timeout; |
| 196 | 181 | ||
| 197 | struct stmpe_gpio_platform_data *gpio; | ||
| 198 | struct stmpe_ts_platform_data *ts; | 182 | struct stmpe_ts_platform_data *ts; |
| 199 | }; | 183 | }; |
| 200 | 184 | ||
diff --git a/include/linux/mfd/tc3589x.h b/include/linux/mfd/tc3589x.h index e1c12d84c26a..c203c9c56776 100644 --- a/include/linux/mfd/tc3589x.h +++ b/include/linux/mfd/tc3589x.h | |||
| @@ -163,24 +163,12 @@ struct tc3589x_keypad_platform_data { | |||
| 163 | }; | 163 | }; |
| 164 | 164 | ||
| 165 | /** | 165 | /** |
| 166 | * struct tc3589x_gpio_platform_data - TC3589x GPIO platform data | ||
| 167 | * @setup: callback for board-specific initialization | ||
| 168 | * @remove: callback for board-specific teardown | ||
| 169 | */ | ||
| 170 | struct tc3589x_gpio_platform_data { | ||
| 171 | void (*setup)(struct tc3589x *tc3589x, unsigned gpio_base); | ||
| 172 | void (*remove)(struct tc3589x *tc3589x, unsigned gpio_base); | ||
| 173 | }; | ||
| 174 | |||
| 175 | /** | ||
| 176 | * struct tc3589x_platform_data - TC3589x platform data | 166 | * struct tc3589x_platform_data - TC3589x platform data |
| 177 | * @block: bitmask of blocks to enable (use TC3589x_BLOCK_*) | 167 | * @block: bitmask of blocks to enable (use TC3589x_BLOCK_*) |
| 178 | * @gpio: GPIO-specific platform data | ||
| 179 | * @keypad: keypad-specific platform data | 168 | * @keypad: keypad-specific platform data |
| 180 | */ | 169 | */ |
| 181 | struct tc3589x_platform_data { | 170 | struct tc3589x_platform_data { |
| 182 | unsigned int block; | 171 | unsigned int block; |
| 183 | struct tc3589x_gpio_platform_data *gpio; | ||
| 184 | const struct tc3589x_keypad_platform_data *keypad; | 172 | const struct tc3589x_keypad_platform_data *keypad; |
| 185 | }; | 173 | }; |
| 186 | 174 | ||
diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h index e2e70053470e..3f4e994ace2b 100644 --- a/include/linux/mfd/ti_am335x_tscadc.h +++ b/include/linux/mfd/ti_am335x_tscadc.h | |||
| @@ -52,6 +52,7 @@ | |||
| 52 | 52 | ||
| 53 | /* IRQ enable */ | 53 | /* IRQ enable */ |
| 54 | #define IRQENB_HW_PEN BIT(0) | 54 | #define IRQENB_HW_PEN BIT(0) |
| 55 | #define IRQENB_EOS BIT(1) | ||
| 55 | #define IRQENB_FIFO0THRES BIT(2) | 56 | #define IRQENB_FIFO0THRES BIT(2) |
| 56 | #define IRQENB_FIFO0OVRRUN BIT(3) | 57 | #define IRQENB_FIFO0OVRRUN BIT(3) |
| 57 | #define IRQENB_FIFO0UNDRFLW BIT(4) | 58 | #define IRQENB_FIFO0UNDRFLW BIT(4) |
| @@ -107,7 +108,7 @@ | |||
| 107 | /* Charge delay */ | 108 | /* Charge delay */ |
| 108 | #define CHARGEDLY_OPEN_MASK (0x3FFFF << 0) | 109 | #define CHARGEDLY_OPEN_MASK (0x3FFFF << 0) |
| 109 | #define CHARGEDLY_OPEN(val) ((val) << 0) | 110 | #define CHARGEDLY_OPEN(val) ((val) << 0) |
| 110 | #define CHARGEDLY_OPENDLY CHARGEDLY_OPEN(1) | 111 | #define CHARGEDLY_OPENDLY CHARGEDLY_OPEN(0x400) |
| 111 | 112 | ||
| 112 | /* Control register */ | 113 | /* Control register */ |
| 113 | #define CNTRLREG_TSCSSENB BIT(0) | 114 | #define CNTRLREG_TSCSSENB BIT(0) |
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index 57388171610d..605812820e48 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h | |||
| @@ -96,11 +96,6 @@ | |||
| 96 | #define TMIO_MMC_SDIO_STATUS_QUIRK (1 << 8) | 96 | #define TMIO_MMC_SDIO_STATUS_QUIRK (1 << 8) |
| 97 | 97 | ||
| 98 | /* | 98 | /* |
| 99 | * Some controllers have DMA enable/disable register | ||
| 100 | */ | ||
| 101 | #define TMIO_MMC_HAVE_CTL_DMA_REG (1 << 9) | ||
| 102 | |||
| 103 | /* | ||
| 104 | * Some controllers allows to set SDx actual clock | 99 | * Some controllers allows to set SDx actual clock |
| 105 | */ | 100 | */ |
| 106 | #define TMIO_MMC_CLK_ACTUAL (1 << 10) | 101 | #define TMIO_MMC_CLK_ACTUAL (1 << 10) |
| @@ -112,18 +107,6 @@ void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state); | |||
| 112 | 107 | ||
| 113 | struct dma_chan; | 108 | struct dma_chan; |
| 114 | 109 | ||
| 115 | struct tmio_mmc_dma { | ||
| 116 | void *chan_priv_tx; | ||
| 117 | void *chan_priv_rx; | ||
| 118 | int slave_id_tx; | ||
| 119 | int slave_id_rx; | ||
| 120 | int alignment_shift; | ||
| 121 | dma_addr_t dma_rx_offset; | ||
| 122 | bool (*filter)(struct dma_chan *chan, void *arg); | ||
| 123 | }; | ||
| 124 | |||
| 125 | struct tmio_mmc_host; | ||
| 126 | |||
| 127 | /* | 110 | /* |
| 128 | * data for the MMC controller | 111 | * data for the MMC controller |
| 129 | */ | 112 | */ |
| @@ -132,19 +115,12 @@ struct tmio_mmc_data { | |||
| 132 | unsigned long capabilities; | 115 | unsigned long capabilities; |
| 133 | unsigned long capabilities2; | 116 | unsigned long capabilities2; |
| 134 | unsigned long flags; | 117 | unsigned long flags; |
| 135 | unsigned long bus_shift; | ||
| 136 | u32 ocr_mask; /* available voltages */ | 118 | u32 ocr_mask; /* available voltages */ |
| 137 | struct tmio_mmc_dma *dma; | ||
| 138 | struct device *dev; | ||
| 139 | unsigned int cd_gpio; | 119 | unsigned int cd_gpio; |
| 120 | int alignment_shift; | ||
| 121 | dma_addr_t dma_rx_offset; | ||
| 140 | void (*set_pwr)(struct platform_device *host, int state); | 122 | void (*set_pwr)(struct platform_device *host, int state); |
| 141 | void (*set_clk_div)(struct platform_device *host, int state); | 123 | void (*set_clk_div)(struct platform_device *host, int state); |
| 142 | int (*write16_hook)(struct tmio_mmc_host *host, int addr); | ||
| 143 | /* clock management callbacks */ | ||
| 144 | int (*clk_enable)(struct platform_device *pdev, unsigned int *f); | ||
| 145 | void (*clk_disable)(struct platform_device *pdev); | ||
| 146 | int (*multi_io_quirk)(struct mmc_card *card, | ||
| 147 | unsigned int direction, int blk_size); | ||
| 148 | }; | 124 | }; |
| 149 | 125 | ||
| 150 | /* | 126 | /* |
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h index 64d25941b329..7b6d4e9ff603 100644 --- a/include/linux/mlx4/cmd.h +++ b/include/linux/mlx4/cmd.h | |||
| @@ -71,6 +71,7 @@ enum { | |||
| 71 | 71 | ||
| 72 | /*master notify fw on finish for slave's flr*/ | 72 | /*master notify fw on finish for slave's flr*/ |
| 73 | MLX4_CMD_INFORM_FLR_DONE = 0x5b, | 73 | MLX4_CMD_INFORM_FLR_DONE = 0x5b, |
| 74 | MLX4_CMD_VIRT_PORT_MAP = 0x5c, | ||
| 74 | MLX4_CMD_GET_OP_REQ = 0x59, | 75 | MLX4_CMD_GET_OP_REQ = 0x59, |
| 75 | 76 | ||
| 76 | /* TPT commands */ | 77 | /* TPT commands */ |
| @@ -165,9 +166,15 @@ enum { | |||
| 165 | }; | 166 | }; |
| 166 | 167 | ||
| 167 | enum { | 168 | enum { |
| 168 | MLX4_CMD_TIME_CLASS_A = 10000, | 169 | MLX4_CMD_TIME_CLASS_A = 60000, |
| 169 | MLX4_CMD_TIME_CLASS_B = 10000, | 170 | MLX4_CMD_TIME_CLASS_B = 60000, |
| 170 | MLX4_CMD_TIME_CLASS_C = 10000, | 171 | MLX4_CMD_TIME_CLASS_C = 60000, |
| 172 | }; | ||
| 173 | |||
| 174 | enum { | ||
| 175 | /* virtual to physical port mapping opcode modifiers */ | ||
| 176 | MLX4_GET_PORT_VIRT2PHY = 0x0, | ||
| 177 | MLX4_SET_PORT_VIRT2PHY = 0x1, | ||
| 171 | }; | 178 | }; |
| 172 | 179 | ||
| 173 | enum { | 180 | enum { |
| @@ -279,6 +286,8 @@ int mlx4_get_vf_config(struct mlx4_dev *dev, int port, int vf, struct ifla_vf_in | |||
| 279 | int mlx4_set_vf_link_state(struct mlx4_dev *dev, int port, int vf, int link_state); | 286 | int mlx4_set_vf_link_state(struct mlx4_dev *dev, int port, int vf, int link_state); |
| 280 | int mlx4_config_dev_retrieval(struct mlx4_dev *dev, | 287 | int mlx4_config_dev_retrieval(struct mlx4_dev *dev, |
| 281 | struct mlx4_config_dev_params *params); | 288 | struct mlx4_config_dev_params *params); |
| 289 | void mlx4_cmd_wake_completions(struct mlx4_dev *dev); | ||
| 290 | void mlx4_report_internal_err_comm_event(struct mlx4_dev *dev); | ||
| 282 | /* | 291 | /* |
| 283 | * mlx4_get_slave_default_vlan - | 292 | * mlx4_get_slave_default_vlan - |
| 284 | * return true if VST ( default vlan) | 293 | * return true if VST ( default vlan) |
| @@ -288,5 +297,6 @@ bool mlx4_get_slave_default_vlan(struct mlx4_dev *dev, int port, int slave, | |||
| 288 | u16 *vlan, u8 *qos); | 297 | u16 *vlan, u8 *qos); |
| 289 | 298 | ||
| 290 | #define MLX4_COMM_GET_IF_REV(cmd_chan_ver) (u8)((cmd_chan_ver) >> 8) | 299 | #define MLX4_COMM_GET_IF_REV(cmd_chan_ver) (u8)((cmd_chan_ver) >> 8) |
| 300 | #define COMM_CHAN_EVENT_INTERNAL_ERR (1 << 17) | ||
| 291 | 301 | ||
| 292 | #endif /* MLX4_CMD_H */ | 302 | #endif /* MLX4_CMD_H */ |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 25c791e295fd..e4ebff7e9d02 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
| @@ -42,7 +42,7 @@ | |||
| 42 | 42 | ||
| 43 | #include <linux/atomic.h> | 43 | #include <linux/atomic.h> |
| 44 | 44 | ||
| 45 | #include <linux/clocksource.h> | 45 | #include <linux/timecounter.h> |
| 46 | 46 | ||
| 47 | #define MAX_MSIX_P_PORT 17 | 47 | #define MAX_MSIX_P_PORT 17 |
| 48 | #define MAX_MSIX 64 | 48 | #define MAX_MSIX 64 |
| @@ -70,6 +70,7 @@ enum { | |||
| 70 | MLX4_FLAG_SLAVE = 1 << 3, | 70 | MLX4_FLAG_SLAVE = 1 << 3, |
| 71 | MLX4_FLAG_SRIOV = 1 << 4, | 71 | MLX4_FLAG_SRIOV = 1 << 4, |
| 72 | MLX4_FLAG_OLD_REG_MAC = 1 << 6, | 72 | MLX4_FLAG_OLD_REG_MAC = 1 << 6, |
| 73 | MLX4_FLAG_BONDED = 1 << 7 | ||
| 73 | }; | 74 | }; |
| 74 | 75 | ||
| 75 | enum { | 76 | enum { |
| @@ -97,7 +98,7 @@ enum { | |||
| 97 | MLX4_MAX_NUM_PF = 16, | 98 | MLX4_MAX_NUM_PF = 16, |
| 98 | MLX4_MAX_NUM_VF = 126, | 99 | MLX4_MAX_NUM_VF = 126, |
| 99 | MLX4_MAX_NUM_VF_P_PORT = 64, | 100 | MLX4_MAX_NUM_VF_P_PORT = 64, |
| 100 | MLX4_MFUNC_MAX = 80, | 101 | MLX4_MFUNC_MAX = 128, |
| 101 | MLX4_MAX_EQ_NUM = 1024, | 102 | MLX4_MAX_EQ_NUM = 1024, |
| 102 | MLX4_MFUNC_EQ_NUM = 4, | 103 | MLX4_MFUNC_EQ_NUM = 4, |
| 103 | MLX4_MFUNC_MAX_EQES = 8, | 104 | MLX4_MFUNC_MAX_EQES = 8, |
| @@ -200,7 +201,9 @@ enum { | |||
| 200 | MLX4_DEV_CAP_FLAG2_CONFIG_DEV = 1LL << 16, | 201 | MLX4_DEV_CAP_FLAG2_CONFIG_DEV = 1LL << 16, |
| 201 | MLX4_DEV_CAP_FLAG2_SYS_EQS = 1LL << 17, | 202 | MLX4_DEV_CAP_FLAG2_SYS_EQS = 1LL << 17, |
| 202 | MLX4_DEV_CAP_FLAG2_80_VFS = 1LL << 18, | 203 | MLX4_DEV_CAP_FLAG2_80_VFS = 1LL << 18, |
| 203 | MLX4_DEV_CAP_FLAG2_FS_A0 = 1LL << 19 | 204 | MLX4_DEV_CAP_FLAG2_FS_A0 = 1LL << 19, |
| 205 | MLX4_DEV_CAP_FLAG2_RECOVERABLE_ERROR_EVENT = 1LL << 20, | ||
| 206 | MLX4_DEV_CAP_FLAG2_PORT_REMAP = 1LL << 21 | ||
| 204 | }; | 207 | }; |
| 205 | 208 | ||
| 206 | enum { | 209 | enum { |
| @@ -208,6 +211,10 @@ enum { | |||
| 208 | MLX4_QUERY_FUNC_FLAGS_A0_RES_QP = 1LL << 1 | 211 | MLX4_QUERY_FUNC_FLAGS_A0_RES_QP = 1LL << 1 |
| 209 | }; | 212 | }; |
| 210 | 213 | ||
| 214 | enum { | ||
| 215 | MLX4_VF_CAP_FLAG_RESET = 1 << 0 | ||
| 216 | }; | ||
| 217 | |||
| 211 | /* bit enums for an 8-bit flags field indicating special use | 218 | /* bit enums for an 8-bit flags field indicating special use |
| 212 | * QPs which require special handling in qp_reserve_range. | 219 | * QPs which require special handling in qp_reserve_range. |
| 213 | * Currently, this only includes QPs used by the ETH interface, | 220 | * Currently, this only includes QPs used by the ETH interface, |
| @@ -248,9 +255,14 @@ enum { | |||
| 248 | MLX4_BMME_FLAG_TYPE_2_WIN = 1 << 9, | 255 | MLX4_BMME_FLAG_TYPE_2_WIN = 1 << 9, |
| 249 | MLX4_BMME_FLAG_RESERVED_LKEY = 1 << 10, | 256 | MLX4_BMME_FLAG_RESERVED_LKEY = 1 << 10, |
| 250 | MLX4_BMME_FLAG_FAST_REG_WR = 1 << 11, | 257 | MLX4_BMME_FLAG_FAST_REG_WR = 1 << 11, |
| 258 | MLX4_BMME_FLAG_PORT_REMAP = 1 << 24, | ||
| 251 | MLX4_BMME_FLAG_VSD_INIT2RTR = 1 << 28, | 259 | MLX4_BMME_FLAG_VSD_INIT2RTR = 1 << 28, |
| 252 | }; | 260 | }; |
| 253 | 261 | ||
| 262 | enum { | ||
| 263 | MLX4_FLAG_PORT_REMAP = MLX4_BMME_FLAG_PORT_REMAP | ||
| 264 | }; | ||
| 265 | |||
| 254 | enum mlx4_event { | 266 | enum mlx4_event { |
| 255 | MLX4_EVENT_TYPE_COMP = 0x00, | 267 | MLX4_EVENT_TYPE_COMP = 0x00, |
| 256 | MLX4_EVENT_TYPE_PATH_MIG = 0x01, | 268 | MLX4_EVENT_TYPE_PATH_MIG = 0x01, |
| @@ -276,6 +288,7 @@ enum mlx4_event { | |||
| 276 | MLX4_EVENT_TYPE_FATAL_WARNING = 0x1b, | 288 | MLX4_EVENT_TYPE_FATAL_WARNING = 0x1b, |
| 277 | MLX4_EVENT_TYPE_FLR_EVENT = 0x1c, | 289 | MLX4_EVENT_TYPE_FLR_EVENT = 0x1c, |
| 278 | MLX4_EVENT_TYPE_PORT_MNG_CHG_EVENT = 0x1d, | 290 | MLX4_EVENT_TYPE_PORT_MNG_CHG_EVENT = 0x1d, |
| 291 | MLX4_EVENT_TYPE_RECOVERABLE_ERROR_EVENT = 0x3e, | ||
| 279 | MLX4_EVENT_TYPE_NONE = 0xff, | 292 | MLX4_EVENT_TYPE_NONE = 0xff, |
| 280 | }; | 293 | }; |
| 281 | 294 | ||
| @@ -285,6 +298,11 @@ enum { | |||
| 285 | }; | 298 | }; |
| 286 | 299 | ||
| 287 | enum { | 300 | enum { |
| 301 | MLX4_RECOVERABLE_ERROR_EVENT_SUBTYPE_BAD_CABLE = 1, | ||
| 302 | MLX4_RECOVERABLE_ERROR_EVENT_SUBTYPE_UNSUPPORTED_CABLE = 2, | ||
| 303 | }; | ||
| 304 | |||
| 305 | enum { | ||
| 288 | MLX4_FATAL_WARNING_SUBTYPE_WARMING = 0, | 306 | MLX4_FATAL_WARNING_SUBTYPE_WARMING = 0, |
| 289 | }; | 307 | }; |
| 290 | 308 | ||
| @@ -411,6 +429,16 @@ enum { | |||
| 411 | MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK = 1 << 4, | 429 | MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK = 1 << 4, |
| 412 | }; | 430 | }; |
| 413 | 431 | ||
| 432 | enum { | ||
| 433 | MLX4_DEVICE_STATE_UP = 1 << 0, | ||
| 434 | MLX4_DEVICE_STATE_INTERNAL_ERROR = 1 << 1, | ||
| 435 | }; | ||
| 436 | |||
| 437 | enum { | ||
| 438 | MLX4_INTERFACE_STATE_UP = 1 << 0, | ||
| 439 | MLX4_INTERFACE_STATE_DELETION = 1 << 1, | ||
| 440 | }; | ||
| 441 | |||
| 414 | #define MSTR_SM_CHANGE_MASK (MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK | \ | 442 | #define MSTR_SM_CHANGE_MASK (MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK | \ |
| 415 | MLX4_EQ_PORT_INFO_MSTR_SM_LID_CHANGE_MASK) | 443 | MLX4_EQ_PORT_INFO_MSTR_SM_LID_CHANGE_MASK) |
| 416 | 444 | ||
| @@ -535,6 +563,7 @@ struct mlx4_caps { | |||
| 535 | u8 alloc_res_qp_mask; | 563 | u8 alloc_res_qp_mask; |
| 536 | u32 dmfs_high_rate_qpn_base; | 564 | u32 dmfs_high_rate_qpn_base; |
| 537 | u32 dmfs_high_rate_qpn_range; | 565 | u32 dmfs_high_rate_qpn_range; |
| 566 | u32 vf_caps; | ||
| 538 | }; | 567 | }; |
| 539 | 568 | ||
| 540 | struct mlx4_buf_list { | 569 | struct mlx4_buf_list { |
| @@ -660,6 +689,8 @@ struct mlx4_cq { | |||
| 660 | void (*comp)(struct mlx4_cq *); | 689 | void (*comp)(struct mlx4_cq *); |
| 661 | void *priv; | 690 | void *priv; |
| 662 | } tasklet_ctx; | 691 | } tasklet_ctx; |
| 692 | int reset_notify_added; | ||
| 693 | struct list_head reset_notify; | ||
| 663 | }; | 694 | }; |
| 664 | 695 | ||
| 665 | struct mlx4_qp { | 696 | struct mlx4_qp { |
| @@ -744,8 +775,23 @@ struct mlx4_vf_dev { | |||
| 744 | u8 n_ports; | 775 | u8 n_ports; |
| 745 | }; | 776 | }; |
| 746 | 777 | ||
| 747 | struct mlx4_dev { | 778 | struct mlx4_dev_persistent { |
| 748 | struct pci_dev *pdev; | 779 | struct pci_dev *pdev; |
| 780 | struct mlx4_dev *dev; | ||
| 781 | int nvfs[MLX4_MAX_PORTS + 1]; | ||
| 782 | int num_vfs; | ||
| 783 | enum mlx4_port_type curr_port_type[MLX4_MAX_PORTS + 1]; | ||
| 784 | enum mlx4_port_type curr_port_poss_type[MLX4_MAX_PORTS + 1]; | ||
| 785 | struct work_struct catas_work; | ||
| 786 | struct workqueue_struct *catas_wq; | ||
| 787 | struct mutex device_state_mutex; /* protect HW state */ | ||
| 788 | u8 state; | ||
| 789 | struct mutex interface_state_mutex; /* protect SW state */ | ||
| 790 | u8 interface_state; | ||
| 791 | }; | ||
| 792 | |||
| 793 | struct mlx4_dev { | ||
| 794 | struct mlx4_dev_persistent *persist; | ||
| 749 | unsigned long flags; | 795 | unsigned long flags; |
| 750 | unsigned long num_slaves; | 796 | unsigned long num_slaves; |
| 751 | struct mlx4_caps caps; | 797 | struct mlx4_caps caps; |
| @@ -754,13 +800,11 @@ struct mlx4_dev { | |||
| 754 | struct radix_tree_root qp_table_tree; | 800 | struct radix_tree_root qp_table_tree; |
| 755 | u8 rev_id; | 801 | u8 rev_id; |
| 756 | char board_id[MLX4_BOARD_ID_LEN]; | 802 | char board_id[MLX4_BOARD_ID_LEN]; |
| 757 | int num_vfs; | ||
| 758 | int numa_node; | 803 | int numa_node; |
| 759 | int oper_log_mgm_entry_size; | 804 | int oper_log_mgm_entry_size; |
| 760 | u64 regid_promisc_array[MLX4_MAX_PORTS + 1]; | 805 | u64 regid_promisc_array[MLX4_MAX_PORTS + 1]; |
| 761 | u64 regid_allmulti_array[MLX4_MAX_PORTS + 1]; | 806 | u64 regid_allmulti_array[MLX4_MAX_PORTS + 1]; |
| 762 | struct mlx4_vf_dev *dev_vfs; | 807 | struct mlx4_vf_dev *dev_vfs; |
| 763 | int nvfs[MLX4_MAX_PORTS + 1]; | ||
| 764 | }; | 808 | }; |
| 765 | 809 | ||
| 766 | struct mlx4_eqe { | 810 | struct mlx4_eqe { |
| @@ -832,6 +876,11 @@ struct mlx4_eqe { | |||
| 832 | } __packed tbl_change_info; | 876 | } __packed tbl_change_info; |
| 833 | } params; | 877 | } params; |
| 834 | } __packed port_mgmt_change; | 878 | } __packed port_mgmt_change; |
| 879 | struct { | ||
| 880 | u8 reserved[3]; | ||
| 881 | u8 port; | ||
| 882 | u32 reserved1[5]; | ||
| 883 | } __packed bad_cable; | ||
| 835 | } event; | 884 | } event; |
| 836 | u8 slave_id; | 885 | u8 slave_id; |
| 837 | u8 reserved3[2]; | 886 | u8 reserved3[2]; |
| @@ -1338,6 +1387,8 @@ int mlx4_phys_to_slave_port(struct mlx4_dev *dev, int slave, int port); | |||
| 1338 | int mlx4_get_base_gid_ix(struct mlx4_dev *dev, int slave, int port); | 1387 | int mlx4_get_base_gid_ix(struct mlx4_dev *dev, int slave, int port); |
| 1339 | 1388 | ||
| 1340 | int mlx4_config_vxlan_port(struct mlx4_dev *dev, __be16 udp_port); | 1389 | int mlx4_config_vxlan_port(struct mlx4_dev *dev, __be16 udp_port); |
| 1390 | int mlx4_disable_rx_port_check(struct mlx4_dev *dev, bool dis); | ||
| 1391 | int mlx4_virt2phy_port_map(struct mlx4_dev *dev, u32 port1, u32 port2); | ||
| 1341 | int mlx4_vf_smi_enabled(struct mlx4_dev *dev, int slave, int port); | 1392 | int mlx4_vf_smi_enabled(struct mlx4_dev *dev, int slave, int port); |
| 1342 | int mlx4_vf_get_enable_smi_admin(struct mlx4_dev *dev, int slave, int port); | 1393 | int mlx4_vf_get_enable_smi_admin(struct mlx4_dev *dev, int slave, int port); |
| 1343 | int mlx4_vf_set_enable_smi_admin(struct mlx4_dev *dev, int slave, int port, | 1394 | int mlx4_vf_set_enable_smi_admin(struct mlx4_dev *dev, int slave, int port, |
diff --git a/include/linux/mlx4/driver.h b/include/linux/mlx4/driver.h index 022055c8fb26..9553a73d2049 100644 --- a/include/linux/mlx4/driver.h +++ b/include/linux/mlx4/driver.h | |||
| @@ -49,6 +49,10 @@ enum mlx4_dev_event { | |||
| 49 | MLX4_DEV_EVENT_SLAVE_SHUTDOWN, | 49 | MLX4_DEV_EVENT_SLAVE_SHUTDOWN, |
| 50 | }; | 50 | }; |
| 51 | 51 | ||
| 52 | enum { | ||
| 53 | MLX4_INTFF_BONDING = 1 << 0 | ||
| 54 | }; | ||
| 55 | |||
| 52 | struct mlx4_interface { | 56 | struct mlx4_interface { |
| 53 | void * (*add) (struct mlx4_dev *dev); | 57 | void * (*add) (struct mlx4_dev *dev); |
| 54 | void (*remove)(struct mlx4_dev *dev, void *context); | 58 | void (*remove)(struct mlx4_dev *dev, void *context); |
| @@ -57,11 +61,26 @@ struct mlx4_interface { | |||
| 57 | void * (*get_dev)(struct mlx4_dev *dev, void *context, u8 port); | 61 | void * (*get_dev)(struct mlx4_dev *dev, void *context, u8 port); |
| 58 | struct list_head list; | 62 | struct list_head list; |
| 59 | enum mlx4_protocol protocol; | 63 | enum mlx4_protocol protocol; |
| 64 | int flags; | ||
| 60 | }; | 65 | }; |
| 61 | 66 | ||
| 62 | int mlx4_register_interface(struct mlx4_interface *intf); | 67 | int mlx4_register_interface(struct mlx4_interface *intf); |
| 63 | void mlx4_unregister_interface(struct mlx4_interface *intf); | 68 | void mlx4_unregister_interface(struct mlx4_interface *intf); |
| 64 | 69 | ||
| 70 | int mlx4_bond(struct mlx4_dev *dev); | ||
| 71 | int mlx4_unbond(struct mlx4_dev *dev); | ||
| 72 | static inline int mlx4_is_bonded(struct mlx4_dev *dev) | ||
| 73 | { | ||
| 74 | return !!(dev->flags & MLX4_FLAG_BONDED); | ||
| 75 | } | ||
| 76 | |||
| 77 | struct mlx4_port_map { | ||
| 78 | u8 port1; | ||
| 79 | u8 port2; | ||
| 80 | }; | ||
| 81 | |||
| 82 | int mlx4_port_map_set(struct mlx4_dev *dev, struct mlx4_port_map *v2p); | ||
| 83 | |||
| 65 | void *mlx4_get_protocol_dev(struct mlx4_dev *dev, enum mlx4_protocol proto, int port); | 84 | void *mlx4_get_protocol_dev(struct mlx4_dev *dev, enum mlx4_protocol proto, int port); |
| 66 | 85 | ||
| 67 | static inline u64 mlx4_mac_to_u64(u8 *addr) | 86 | static inline u64 mlx4_mac_to_u64(u8 *addr) |
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h index 467ccdf94c98..2bbc62aa818a 100644 --- a/include/linux/mlx4/qp.h +++ b/include/linux/mlx4/qp.h | |||
| @@ -96,6 +96,7 @@ enum { | |||
| 96 | MLX4_QP_BIT_RRE = 1 << 15, | 96 | MLX4_QP_BIT_RRE = 1 << 15, |
| 97 | MLX4_QP_BIT_RWE = 1 << 14, | 97 | MLX4_QP_BIT_RWE = 1 << 14, |
| 98 | MLX4_QP_BIT_RAE = 1 << 13, | 98 | MLX4_QP_BIT_RAE = 1 << 13, |
| 99 | MLX4_QP_BIT_FPP = 1 << 3, | ||
| 99 | MLX4_QP_BIT_RIC = 1 << 4, | 100 | MLX4_QP_BIT_RIC = 1 << 4, |
| 100 | }; | 101 | }; |
| 101 | 102 | ||
diff --git a/include/linux/mm.h b/include/linux/mm.h index 80fc92a49649..a4d24f3c5430 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -138,7 +138,6 @@ extern unsigned int kobjsize(const void *objp); | |||
| 138 | #define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */ | 138 | #define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */ |
| 139 | #define VM_NORESERVE 0x00200000 /* should the VM suppress accounting */ | 139 | #define VM_NORESERVE 0x00200000 /* should the VM suppress accounting */ |
| 140 | #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ | 140 | #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ |
| 141 | #define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ | ||
| 142 | #define VM_ARCH_1 0x01000000 /* Architecture-specific flag */ | 141 | #define VM_ARCH_1 0x01000000 /* Architecture-specific flag */ |
| 143 | #define VM_ARCH_2 0x02000000 | 142 | #define VM_ARCH_2 0x02000000 |
| 144 | #define VM_DONTDUMP 0x04000000 /* Do not include in the core dump */ | 143 | #define VM_DONTDUMP 0x04000000 /* Do not include in the core dump */ |
| @@ -206,21 +205,19 @@ extern unsigned int kobjsize(const void *objp); | |||
| 206 | extern pgprot_t protection_map[16]; | 205 | extern pgprot_t protection_map[16]; |
| 207 | 206 | ||
| 208 | #define FAULT_FLAG_WRITE 0x01 /* Fault was a write access */ | 207 | #define FAULT_FLAG_WRITE 0x01 /* Fault was a write access */ |
| 209 | #define FAULT_FLAG_NONLINEAR 0x02 /* Fault was via a nonlinear mapping */ | 208 | #define FAULT_FLAG_MKWRITE 0x02 /* Fault was mkwrite of existing pte */ |
| 210 | #define FAULT_FLAG_MKWRITE 0x04 /* Fault was mkwrite of existing pte */ | 209 | #define FAULT_FLAG_ALLOW_RETRY 0x04 /* Retry fault if blocking */ |
| 211 | #define FAULT_FLAG_ALLOW_RETRY 0x08 /* Retry fault if blocking */ | 210 | #define FAULT_FLAG_RETRY_NOWAIT 0x08 /* Don't drop mmap_sem and wait when retrying */ |
| 212 | #define FAULT_FLAG_RETRY_NOWAIT 0x10 /* Don't drop mmap_sem and wait when retrying */ | 211 | #define FAULT_FLAG_KILLABLE 0x10 /* The fault task is in SIGKILL killable region */ |
| 213 | #define FAULT_FLAG_KILLABLE 0x20 /* The fault task is in SIGKILL killable region */ | 212 | #define FAULT_FLAG_TRIED 0x20 /* Second try */ |
| 214 | #define FAULT_FLAG_TRIED 0x40 /* second try */ | 213 | #define FAULT_FLAG_USER 0x40 /* The fault originated in userspace */ |
| 215 | #define FAULT_FLAG_USER 0x80 /* The fault originated in userspace */ | ||
| 216 | 214 | ||
| 217 | /* | 215 | /* |
| 218 | * vm_fault is filled by the the pagefault handler and passed to the vma's | 216 | * vm_fault is filled by the the pagefault handler and passed to the vma's |
| 219 | * ->fault function. The vma's ->fault is responsible for returning a bitmask | 217 | * ->fault function. The vma's ->fault is responsible for returning a bitmask |
| 220 | * of VM_FAULT_xxx flags that give details about how the fault was handled. | 218 | * of VM_FAULT_xxx flags that give details about how the fault was handled. |
| 221 | * | 219 | * |
| 222 | * pgoff should be used in favour of virtual_address, if possible. If pgoff | 220 | * pgoff should be used in favour of virtual_address, if possible. |
| 223 | * is used, one may implement ->remap_pages to get nonlinear mapping support. | ||
| 224 | */ | 221 | */ |
| 225 | struct vm_fault { | 222 | struct vm_fault { |
| 226 | unsigned int flags; /* FAULT_FLAG_xxx flags */ | 223 | unsigned int flags; /* FAULT_FLAG_xxx flags */ |
| @@ -287,9 +284,13 @@ struct vm_operations_struct { | |||
| 287 | struct mempolicy *(*get_policy)(struct vm_area_struct *vma, | 284 | struct mempolicy *(*get_policy)(struct vm_area_struct *vma, |
| 288 | unsigned long addr); | 285 | unsigned long addr); |
| 289 | #endif | 286 | #endif |
| 290 | /* called by sys_remap_file_pages() to populate non-linear mapping */ | 287 | /* |
| 291 | int (*remap_pages)(struct vm_area_struct *vma, unsigned long addr, | 288 | * Called by vm_normal_page() for special PTEs to find the |
| 292 | unsigned long size, pgoff_t pgoff); | 289 | * page for @addr. This is useful if the default behavior |
| 290 | * (using pte_page()) would not find the correct page. | ||
| 291 | */ | ||
| 292 | struct page *(*find_special_page)(struct vm_area_struct *vma, | ||
| 293 | unsigned long addr); | ||
| 293 | }; | 294 | }; |
| 294 | 295 | ||
| 295 | struct mmu_gather; | 296 | struct mmu_gather; |
| @@ -446,6 +447,12 @@ static inline struct page *compound_head_by_tail(struct page *tail) | |||
| 446 | return tail; | 447 | return tail; |
| 447 | } | 448 | } |
| 448 | 449 | ||
| 450 | /* | ||
| 451 | * Since either compound page could be dismantled asynchronously in THP | ||
| 452 | * or we access asynchronously arbitrary positioned struct page, there | ||
| 453 | * would be tail flag race. To handle this race, we should call | ||
| 454 | * smp_rmb() before checking tail flag. compound_head_by_tail() did it. | ||
| 455 | */ | ||
| 449 | static inline struct page *compound_head(struct page *page) | 456 | static inline struct page *compound_head(struct page *page) |
| 450 | { | 457 | { |
| 451 | if (unlikely(PageTail(page))) | 458 | if (unlikely(PageTail(page))) |
| @@ -454,6 +461,18 @@ static inline struct page *compound_head(struct page *page) | |||
| 454 | } | 461 | } |
| 455 | 462 | ||
| 456 | /* | 463 | /* |
| 464 | * If we access compound page synchronously such as access to | ||
| 465 | * allocated page, there is no need to handle tail flag race, so we can | ||
| 466 | * check tail flag directly without any synchronization primitive. | ||
| 467 | */ | ||
| 468 | static inline struct page *compound_head_fast(struct page *page) | ||
| 469 | { | ||
| 470 | if (unlikely(PageTail(page))) | ||
| 471 | return page->first_page; | ||
| 472 | return page; | ||
| 473 | } | ||
| 474 | |||
| 475 | /* | ||
| 457 | * The atomic page->_mapcount, starts from -1: so that transitions | 476 | * The atomic page->_mapcount, starts from -1: so that transitions |
| 458 | * both from it and to it can be tracked, using atomic_inc_and_test | 477 | * both from it and to it can be tracked, using atomic_inc_and_test |
| 459 | * and atomic_add_negative(-1). | 478 | * and atomic_add_negative(-1). |
| @@ -465,7 +484,8 @@ static inline void page_mapcount_reset(struct page *page) | |||
| 465 | 484 | ||
| 466 | static inline int page_mapcount(struct page *page) | 485 | static inline int page_mapcount(struct page *page) |
| 467 | { | 486 | { |
| 468 | return atomic_read(&(page)->_mapcount) + 1; | 487 | VM_BUG_ON_PAGE(PageSlab(page), page); |
| 488 | return atomic_read(&page->_mapcount) + 1; | ||
| 469 | } | 489 | } |
| 470 | 490 | ||
| 471 | static inline int page_count(struct page *page) | 491 | static inline int page_count(struct page *page) |
| @@ -531,7 +551,14 @@ static inline void get_page(struct page *page) | |||
| 531 | static inline struct page *virt_to_head_page(const void *x) | 551 | static inline struct page *virt_to_head_page(const void *x) |
| 532 | { | 552 | { |
| 533 | struct page *page = virt_to_page(x); | 553 | struct page *page = virt_to_page(x); |
| 534 | return compound_head(page); | 554 | |
| 555 | /* | ||
| 556 | * We don't need to worry about synchronization of tail flag | ||
| 557 | * when we call virt_to_head_page() since it is only called for | ||
| 558 | * already allocated page and this page won't be freed until | ||
| 559 | * this virt_to_head_page() is finished. So use _fast variant. | ||
| 560 | */ | ||
| 561 | return compound_head_fast(page); | ||
| 535 | } | 562 | } |
| 536 | 563 | ||
| 537 | /* | 564 | /* |
| @@ -601,29 +628,28 @@ int split_free_page(struct page *page); | |||
| 601 | * prototype for that function and accessor functions. | 628 | * prototype for that function and accessor functions. |
| 602 | * These are _only_ valid on the head of a PG_compound page. | 629 | * These are _only_ valid on the head of a PG_compound page. |
| 603 | */ | 630 | */ |
| 604 | typedef void compound_page_dtor(struct page *); | ||
| 605 | 631 | ||
| 606 | static inline void set_compound_page_dtor(struct page *page, | 632 | static inline void set_compound_page_dtor(struct page *page, |
| 607 | compound_page_dtor *dtor) | 633 | compound_page_dtor *dtor) |
| 608 | { | 634 | { |
| 609 | page[1].lru.next = (void *)dtor; | 635 | page[1].compound_dtor = dtor; |
| 610 | } | 636 | } |
| 611 | 637 | ||
| 612 | static inline compound_page_dtor *get_compound_page_dtor(struct page *page) | 638 | static inline compound_page_dtor *get_compound_page_dtor(struct page *page) |
| 613 | { | 639 | { |
| 614 | return (compound_page_dtor *)page[1].lru.next; | 640 | return page[1].compound_dtor; |
| 615 | } | 641 | } |
| 616 | 642 | ||
| 617 | static inline int compound_order(struct page *page) | 643 | static inline int compound_order(struct page *page) |
| 618 | { | 644 | { |
| 619 | if (!PageHead(page)) | 645 | if (!PageHead(page)) |
| 620 | return 0; | 646 | return 0; |
| 621 | return (unsigned long)page[1].lru.prev; | 647 | return page[1].compound_order; |
| 622 | } | 648 | } |
| 623 | 649 | ||
| 624 | static inline void set_compound_order(struct page *page, unsigned long order) | 650 | static inline void set_compound_order(struct page *page, unsigned long order) |
| 625 | { | 651 | { |
| 626 | page[1].lru.prev = (void *)order; | 652 | page[1].compound_order = order; |
| 627 | } | 653 | } |
| 628 | 654 | ||
| 629 | #ifdef CONFIG_MMU | 655 | #ifdef CONFIG_MMU |
| @@ -1070,6 +1096,7 @@ static inline int page_mapped(struct page *page) | |||
| 1070 | #define VM_FAULT_WRITE 0x0008 /* Special case for get_user_pages */ | 1096 | #define VM_FAULT_WRITE 0x0008 /* Special case for get_user_pages */ |
| 1071 | #define VM_FAULT_HWPOISON 0x0010 /* Hit poisoned small page */ | 1097 | #define VM_FAULT_HWPOISON 0x0010 /* Hit poisoned small page */ |
| 1072 | #define VM_FAULT_HWPOISON_LARGE 0x0020 /* Hit poisoned large page. Index encoded in upper bits */ | 1098 | #define VM_FAULT_HWPOISON_LARGE 0x0020 /* Hit poisoned large page. Index encoded in upper bits */ |
| 1099 | #define VM_FAULT_SIGSEGV 0x0040 | ||
| 1073 | 1100 | ||
| 1074 | #define VM_FAULT_NOPAGE 0x0100 /* ->fault installed the pte, not return page */ | 1101 | #define VM_FAULT_NOPAGE 0x0100 /* ->fault installed the pte, not return page */ |
| 1075 | #define VM_FAULT_LOCKED 0x0200 /* ->fault locked the returned page */ | 1102 | #define VM_FAULT_LOCKED 0x0200 /* ->fault locked the returned page */ |
| @@ -1078,8 +1105,9 @@ static inline int page_mapped(struct page *page) | |||
| 1078 | 1105 | ||
| 1079 | #define VM_FAULT_HWPOISON_LARGE_MASK 0xf000 /* encodes hpage index for large hwpoison */ | 1106 | #define VM_FAULT_HWPOISON_LARGE_MASK 0xf000 /* encodes hpage index for large hwpoison */ |
| 1080 | 1107 | ||
| 1081 | #define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS | VM_FAULT_HWPOISON | \ | 1108 | #define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS | VM_FAULT_SIGSEGV | \ |
| 1082 | VM_FAULT_FALLBACK | VM_FAULT_HWPOISON_LARGE) | 1109 | VM_FAULT_HWPOISON | VM_FAULT_HWPOISON_LARGE | \ |
| 1110 | VM_FAULT_FALLBACK) | ||
| 1083 | 1111 | ||
| 1084 | /* Encode hstate index for a hwpoisoned large page */ | 1112 | /* Encode hstate index for a hwpoisoned large page */ |
| 1085 | #define VM_FAULT_SET_HINDEX(x) ((x) << 12) | 1113 | #define VM_FAULT_SET_HINDEX(x) ((x) << 12) |
| @@ -1119,7 +1147,6 @@ extern void user_shm_unlock(size_t, struct user_struct *); | |||
| 1119 | * Parameter block passed down to zap_pte_range in exceptional cases. | 1147 | * Parameter block passed down to zap_pte_range in exceptional cases. |
| 1120 | */ | 1148 | */ |
| 1121 | struct zap_details { | 1149 | struct zap_details { |
| 1122 | struct vm_area_struct *nonlinear_vma; /* Check page->index if set */ | ||
| 1123 | struct address_space *check_mapping; /* Check page->mapping if set */ | 1150 | struct address_space *check_mapping; /* Check page->mapping if set */ |
| 1124 | pgoff_t first_index; /* Lowest page->index to unmap */ | 1151 | pgoff_t first_index; /* Lowest page->index to unmap */ |
| 1125 | pgoff_t last_index; /* Highest page->index to unmap */ | 1152 | pgoff_t last_index; /* Highest page->index to unmap */ |
| @@ -1137,8 +1164,6 @@ void unmap_vmas(struct mmu_gather *tlb, struct vm_area_struct *start_vma, | |||
| 1137 | 1164 | ||
| 1138 | /** | 1165 | /** |
| 1139 | * mm_walk - callbacks for walk_page_range | 1166 | * mm_walk - callbacks for walk_page_range |
| 1140 | * @pgd_entry: if set, called for each non-empty PGD (top-level) entry | ||
| 1141 | * @pud_entry: if set, called for each non-empty PUD (2nd-level) entry | ||
| 1142 | * @pmd_entry: if set, called for each non-empty PMD (3rd-level) entry | 1167 | * @pmd_entry: if set, called for each non-empty PMD (3rd-level) entry |
| 1143 | * this handler is required to be able to handle | 1168 | * this handler is required to be able to handle |
| 1144 | * pmd_trans_huge() pmds. They may simply choose to | 1169 | * pmd_trans_huge() pmds. They may simply choose to |
| @@ -1146,16 +1171,18 @@ void unmap_vmas(struct mmu_gather *tlb, struct vm_area_struct *start_vma, | |||
| 1146 | * @pte_entry: if set, called for each non-empty PTE (4th-level) entry | 1171 | * @pte_entry: if set, called for each non-empty PTE (4th-level) entry |
| 1147 | * @pte_hole: if set, called for each hole at all levels | 1172 | * @pte_hole: if set, called for each hole at all levels |
| 1148 | * @hugetlb_entry: if set, called for each hugetlb entry | 1173 | * @hugetlb_entry: if set, called for each hugetlb entry |
| 1149 | * *Caution*: The caller must hold mmap_sem() if @hugetlb_entry | 1174 | * @test_walk: caller specific callback function to determine whether |
| 1150 | * is used. | 1175 | * we walk over the current vma or not. A positive returned |
| 1176 | * value means "do page table walk over the current vma," | ||
| 1177 | * and a negative one means "abort current page table walk | ||
| 1178 | * right now." 0 means "skip the current vma." | ||
| 1179 | * @mm: mm_struct representing the target process of page table walk | ||
| 1180 | * @vma: vma currently walked (NULL if walking outside vmas) | ||
| 1181 | * @private: private data for callbacks' usage | ||
| 1151 | * | 1182 | * |
| 1152 | * (see walk_page_range for more details) | 1183 | * (see the comment on walk_page_range() for more details) |
| 1153 | */ | 1184 | */ |
| 1154 | struct mm_walk { | 1185 | struct mm_walk { |
| 1155 | int (*pgd_entry)(pgd_t *pgd, unsigned long addr, | ||
| 1156 | unsigned long next, struct mm_walk *walk); | ||
| 1157 | int (*pud_entry)(pud_t *pud, unsigned long addr, | ||
| 1158 | unsigned long next, struct mm_walk *walk); | ||
| 1159 | int (*pmd_entry)(pmd_t *pmd, unsigned long addr, | 1186 | int (*pmd_entry)(pmd_t *pmd, unsigned long addr, |
| 1160 | unsigned long next, struct mm_walk *walk); | 1187 | unsigned long next, struct mm_walk *walk); |
| 1161 | int (*pte_entry)(pte_t *pte, unsigned long addr, | 1188 | int (*pte_entry)(pte_t *pte, unsigned long addr, |
| @@ -1165,12 +1192,16 @@ struct mm_walk { | |||
| 1165 | int (*hugetlb_entry)(pte_t *pte, unsigned long hmask, | 1192 | int (*hugetlb_entry)(pte_t *pte, unsigned long hmask, |
| 1166 | unsigned long addr, unsigned long next, | 1193 | unsigned long addr, unsigned long next, |
| 1167 | struct mm_walk *walk); | 1194 | struct mm_walk *walk); |
| 1195 | int (*test_walk)(unsigned long addr, unsigned long next, | ||
| 1196 | struct mm_walk *walk); | ||
| 1168 | struct mm_struct *mm; | 1197 | struct mm_struct *mm; |
| 1198 | struct vm_area_struct *vma; | ||
| 1169 | void *private; | 1199 | void *private; |
| 1170 | }; | 1200 | }; |
| 1171 | 1201 | ||
| 1172 | int walk_page_range(unsigned long addr, unsigned long end, | 1202 | int walk_page_range(unsigned long addr, unsigned long end, |
| 1173 | struct mm_walk *walk); | 1203 | struct mm_walk *walk); |
| 1204 | int walk_page_vma(struct vm_area_struct *vma, struct mm_walk *walk); | ||
| 1174 | void free_pgd_range(struct mmu_gather *tlb, unsigned long addr, | 1205 | void free_pgd_range(struct mmu_gather *tlb, unsigned long addr, |
| 1175 | unsigned long end, unsigned long floor, unsigned long ceiling); | 1206 | unsigned long end, unsigned long floor, unsigned long ceiling); |
| 1176 | int copy_page_range(struct mm_struct *dst, struct mm_struct *src, | 1207 | int copy_page_range(struct mm_struct *dst, struct mm_struct *src, |
| @@ -1234,6 +1265,17 @@ long get_user_pages(struct task_struct *tsk, struct mm_struct *mm, | |||
| 1234 | unsigned long start, unsigned long nr_pages, | 1265 | unsigned long start, unsigned long nr_pages, |
| 1235 | int write, int force, struct page **pages, | 1266 | int write, int force, struct page **pages, |
| 1236 | struct vm_area_struct **vmas); | 1267 | struct vm_area_struct **vmas); |
| 1268 | long get_user_pages_locked(struct task_struct *tsk, struct mm_struct *mm, | ||
| 1269 | unsigned long start, unsigned long nr_pages, | ||
| 1270 | int write, int force, struct page **pages, | ||
| 1271 | int *locked); | ||
| 1272 | long __get_user_pages_unlocked(struct task_struct *tsk, struct mm_struct *mm, | ||
| 1273 | unsigned long start, unsigned long nr_pages, | ||
| 1274 | int write, int force, struct page **pages, | ||
| 1275 | unsigned int gup_flags); | ||
| 1276 | long get_user_pages_unlocked(struct task_struct *tsk, struct mm_struct *mm, | ||
| 1277 | unsigned long start, unsigned long nr_pages, | ||
| 1278 | int write, int force, struct page **pages); | ||
| 1237 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, | 1279 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, |
| 1238 | struct page **pages); | 1280 | struct page **pages); |
| 1239 | struct kvec; | 1281 | struct kvec; |
| @@ -1411,8 +1453,32 @@ static inline int __pmd_alloc(struct mm_struct *mm, pud_t *pud, | |||
| 1411 | { | 1453 | { |
| 1412 | return 0; | 1454 | return 0; |
| 1413 | } | 1455 | } |
| 1456 | |||
| 1457 | static inline unsigned long mm_nr_pmds(struct mm_struct *mm) | ||
| 1458 | { | ||
| 1459 | return 0; | ||
| 1460 | } | ||
| 1461 | |||
| 1462 | static inline void mm_inc_nr_pmds(struct mm_struct *mm) {} | ||
| 1463 | static inline void mm_dec_nr_pmds(struct mm_struct *mm) {} | ||
| 1464 | |||
| 1414 | #else | 1465 | #else |
| 1415 | int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address); | 1466 | int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address); |
| 1467 | |||
| 1468 | static inline unsigned long mm_nr_pmds(struct mm_struct *mm) | ||
| 1469 | { | ||
| 1470 | return atomic_long_read(&mm->nr_pmds); | ||
| 1471 | } | ||
| 1472 | |||
| 1473 | static inline void mm_inc_nr_pmds(struct mm_struct *mm) | ||
| 1474 | { | ||
| 1475 | atomic_long_inc(&mm->nr_pmds); | ||
| 1476 | } | ||
| 1477 | |||
| 1478 | static inline void mm_dec_nr_pmds(struct mm_struct *mm) | ||
| 1479 | { | ||
| 1480 | atomic_long_dec(&mm->nr_pmds); | ||
| 1481 | } | ||
| 1416 | #endif | 1482 | #endif |
| 1417 | 1483 | ||
| 1418 | int __pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma, | 1484 | int __pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma, |
| @@ -1775,12 +1841,6 @@ struct vm_area_struct *vma_interval_tree_iter_next(struct vm_area_struct *node, | |||
| 1775 | for (vma = vma_interval_tree_iter_first(root, start, last); \ | 1841 | for (vma = vma_interval_tree_iter_first(root, start, last); \ |
| 1776 | vma; vma = vma_interval_tree_iter_next(vma, start, last)) | 1842 | vma; vma = vma_interval_tree_iter_next(vma, start, last)) |
| 1777 | 1843 | ||
| 1778 | static inline void vma_nonlinear_insert(struct vm_area_struct *vma, | ||
| 1779 | struct list_head *list) | ||
| 1780 | { | ||
| 1781 | list_add_tail(&vma->shared.nonlinear, list); | ||
| 1782 | } | ||
| 1783 | |||
| 1784 | void anon_vma_interval_tree_insert(struct anon_vma_chain *node, | 1844 | void anon_vma_interval_tree_insert(struct anon_vma_chain *node, |
| 1785 | struct rb_root *root); | 1845 | struct rb_root *root); |
| 1786 | void anon_vma_interval_tree_remove(struct anon_vma_chain *node, | 1846 | void anon_vma_interval_tree_remove(struct anon_vma_chain *node, |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 6d34aa266a8c..199a03aab8dc 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
| @@ -28,6 +28,8 @@ struct mem_cgroup; | |||
| 28 | IS_ENABLED(CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK)) | 28 | IS_ENABLED(CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK)) |
| 29 | #define ALLOC_SPLIT_PTLOCKS (SPINLOCK_SIZE > BITS_PER_LONG/8) | 29 | #define ALLOC_SPLIT_PTLOCKS (SPINLOCK_SIZE > BITS_PER_LONG/8) |
| 30 | 30 | ||
| 31 | typedef void compound_page_dtor(struct page *); | ||
| 32 | |||
| 31 | /* | 33 | /* |
| 32 | * Each physical page in the system has a struct page associated with | 34 | * Each physical page in the system has a struct page associated with |
| 33 | * it to keep track of whatever it is we are using the page for at the | 35 | * it to keep track of whatever it is we are using the page for at the |
| @@ -142,6 +144,12 @@ struct page { | |||
| 142 | struct rcu_head rcu_head; /* Used by SLAB | 144 | struct rcu_head rcu_head; /* Used by SLAB |
| 143 | * when destroying via RCU | 145 | * when destroying via RCU |
| 144 | */ | 146 | */ |
| 147 | /* First tail page of compound page */ | ||
| 148 | struct { | ||
| 149 | compound_page_dtor *compound_dtor; | ||
| 150 | unsigned long compound_order; | ||
| 151 | }; | ||
| 152 | |||
| 145 | #if defined(CONFIG_TRANSPARENT_HUGEPAGE) && USE_SPLIT_PMD_PTLOCKS | 153 | #if defined(CONFIG_TRANSPARENT_HUGEPAGE) && USE_SPLIT_PMD_PTLOCKS |
| 146 | pgtable_t pmd_huge_pte; /* protected by page->ptl */ | 154 | pgtable_t pmd_huge_pte; /* protected by page->ptl */ |
| 147 | #endif | 155 | #endif |
| @@ -273,15 +281,11 @@ struct vm_area_struct { | |||
| 273 | 281 | ||
| 274 | /* | 282 | /* |
| 275 | * For areas with an address space and backing store, | 283 | * For areas with an address space and backing store, |
| 276 | * linkage into the address_space->i_mmap interval tree, or | 284 | * linkage into the address_space->i_mmap interval tree. |
| 277 | * linkage of vma in the address_space->i_mmap_nonlinear list. | ||
| 278 | */ | 285 | */ |
| 279 | union { | 286 | struct { |
| 280 | struct { | 287 | struct rb_node rb; |
| 281 | struct rb_node rb; | 288 | unsigned long rb_subtree_last; |
| 282 | unsigned long rb_subtree_last; | ||
| 283 | } linear; | ||
| 284 | struct list_head nonlinear; | ||
| 285 | } shared; | 289 | } shared; |
| 286 | 290 | ||
| 287 | /* | 291 | /* |
| @@ -359,7 +363,8 @@ struct mm_struct { | |||
| 359 | pgd_t * pgd; | 363 | pgd_t * pgd; |
| 360 | atomic_t mm_users; /* How many users with user space? */ | 364 | atomic_t mm_users; /* How many users with user space? */ |
| 361 | atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */ | 365 | atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */ |
| 362 | atomic_long_t nr_ptes; /* Page table pages */ | 366 | atomic_long_t nr_ptes; /* PTE page table pages */ |
| 367 | atomic_long_t nr_pmds; /* PMD page table pages */ | ||
| 363 | int map_count; /* number of VMAs */ | 368 | int map_count; /* number of VMAs */ |
| 364 | 369 | ||
| 365 | spinlock_t page_table_lock; /* Protects page tables and some counters */ | 370 | spinlock_t page_table_lock; /* Protects page tables and some counters */ |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 4d69c00497bd..a6cf4c063e4e 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
| @@ -83,7 +83,7 @@ struct mmc_ext_csd { | |||
| 83 | bool hpi; /* HPI support bit */ | 83 | bool hpi; /* HPI support bit */ |
| 84 | unsigned int hpi_cmd; /* cmd used as HPI */ | 84 | unsigned int hpi_cmd; /* cmd used as HPI */ |
| 85 | bool bkops; /* background support bit */ | 85 | bool bkops; /* background support bit */ |
| 86 | bool bkops_en; /* background enable bit */ | 86 | bool man_bkops_en; /* manual bkops enable bit */ |
| 87 | unsigned int data_sector_size; /* 512 bytes or 4KB */ | 87 | unsigned int data_sector_size; /* 512 bytes or 4KB */ |
| 88 | unsigned int data_tag_unit_size; /* DATA TAG UNIT size */ | 88 | unsigned int data_tag_unit_size; /* DATA TAG UNIT size */ |
| 89 | unsigned int boot_ro_lock; /* ro lock support */ | 89 | unsigned int boot_ro_lock; /* ro lock support */ |
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index cb2b0400d284..160448f920ac 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h | |||
| @@ -182,7 +182,6 @@ extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen); | |||
| 182 | extern int mmc_set_blockcount(struct mmc_card *card, unsigned int blockcount, | 182 | extern int mmc_set_blockcount(struct mmc_card *card, unsigned int blockcount, |
| 183 | bool is_rel_write); | 183 | bool is_rel_write); |
| 184 | extern int mmc_hw_reset(struct mmc_host *host); | 184 | extern int mmc_hw_reset(struct mmc_host *host); |
| 185 | extern int mmc_hw_reset_check(struct mmc_host *host); | ||
| 186 | extern int mmc_can_reset(struct mmc_card *card); | 185 | extern int mmc_can_reset(struct mmc_card *card); |
| 187 | 186 | ||
| 188 | extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *); | 187 | extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *); |
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h index 42b724e8d503..471fb3116dbe 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h | |||
| @@ -106,6 +106,11 @@ struct mmc_data; | |||
| 106 | * @cur_slot, @mrq and @state. These must always be updated | 106 | * @cur_slot, @mrq and @state. These must always be updated |
| 107 | * at the same time while holding @lock. | 107 | * at the same time while holding @lock. |
| 108 | * | 108 | * |
| 109 | * @irq_lock is an irq-safe spinlock protecting the INTMASK register | ||
| 110 | * to allow the interrupt handler to modify it directly. Held for only long | ||
| 111 | * enough to read-modify-write INTMASK and no other locks are grabbed when | ||
| 112 | * holding this one. | ||
| 113 | * | ||
| 109 | * The @mrq field of struct dw_mci_slot is also protected by @lock, | 114 | * The @mrq field of struct dw_mci_slot is also protected by @lock, |
| 110 | * and must always be written at the same time as the slot is added to | 115 | * and must always be written at the same time as the slot is added to |
| 111 | * @queue. | 116 | * @queue. |
| @@ -125,6 +130,7 @@ struct mmc_data; | |||
| 125 | */ | 130 | */ |
| 126 | struct dw_mci { | 131 | struct dw_mci { |
| 127 | spinlock_t lock; | 132 | spinlock_t lock; |
| 133 | spinlock_t irq_lock; | ||
| 128 | void __iomem *regs; | 134 | void __iomem *regs; |
| 129 | 135 | ||
| 130 | struct scatterlist *sg; | 136 | struct scatterlist *sg; |
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 9f322706f7cb..0c8cbe5d1550 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
| @@ -166,7 +166,6 @@ struct mmc_async_req { | |||
| 166 | * struct mmc_slot - MMC slot functions | 166 | * struct mmc_slot - MMC slot functions |
| 167 | * | 167 | * |
| 168 | * @cd_irq: MMC/SD-card slot hotplug detection IRQ or -EINVAL | 168 | * @cd_irq: MMC/SD-card slot hotplug detection IRQ or -EINVAL |
| 169 | * @lock: protect the @handler_priv pointer | ||
| 170 | * @handler_priv: MMC/SD-card slot context | 169 | * @handler_priv: MMC/SD-card slot context |
| 171 | * | 170 | * |
| 172 | * Some MMC/SD host controllers implement slot-functions like card and | 171 | * Some MMC/SD host controllers implement slot-functions like card and |
| @@ -176,7 +175,6 @@ struct mmc_async_req { | |||
| 176 | */ | 175 | */ |
| 177 | struct mmc_slot { | 176 | struct mmc_slot { |
| 178 | int cd_irq; | 177 | int cd_irq; |
| 179 | struct mutex lock; | ||
| 180 | void *handler_priv; | 178 | void *handler_priv; |
| 181 | }; | 179 | }; |
| 182 | 180 | ||
| @@ -197,6 +195,7 @@ struct mmc_context_info { | |||
| 197 | }; | 195 | }; |
| 198 | 196 | ||
| 199 | struct regulator; | 197 | struct regulator; |
| 198 | struct mmc_pwrseq; | ||
| 200 | 199 | ||
| 201 | struct mmc_supply { | 200 | struct mmc_supply { |
| 202 | struct regulator *vmmc; /* Card power supply */ | 201 | struct regulator *vmmc; /* Card power supply */ |
| @@ -208,6 +207,7 @@ struct mmc_host { | |||
| 208 | struct device class_dev; | 207 | struct device class_dev; |
| 209 | int index; | 208 | int index; |
| 210 | const struct mmc_host_ops *ops; | 209 | const struct mmc_host_ops *ops; |
| 210 | struct mmc_pwrseq *pwrseq; | ||
| 211 | unsigned int f_min; | 211 | unsigned int f_min; |
| 212 | unsigned int f_max; | 212 | unsigned int f_max; |
| 213 | unsigned int f_init; | 213 | unsigned int f_init; |
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 49ad7a943638..124f562118b8 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
| @@ -53,11 +53,6 @@ | |||
| 53 | #define MMC_SEND_TUNING_BLOCK 19 /* adtc R1 */ | 53 | #define MMC_SEND_TUNING_BLOCK 19 /* adtc R1 */ |
| 54 | #define MMC_SEND_TUNING_BLOCK_HS200 21 /* adtc R1 */ | 54 | #define MMC_SEND_TUNING_BLOCK_HS200 21 /* adtc R1 */ |
| 55 | 55 | ||
| 56 | #define MMC_TUNING_BLK_PATTERN_4BIT_SIZE 64 | ||
| 57 | #define MMC_TUNING_BLK_PATTERN_8BIT_SIZE 128 | ||
| 58 | extern const u8 tuning_blk_pattern_4bit[MMC_TUNING_BLK_PATTERN_4BIT_SIZE]; | ||
| 59 | extern const u8 tuning_blk_pattern_8bit[MMC_TUNING_BLK_PATTERN_8BIT_SIZE]; | ||
| 60 | |||
| 61 | /* class 3 */ | 56 | /* class 3 */ |
| 62 | #define MMC_WRITE_DAT_UNTIL_STOP 20 /* adtc [31:0] data addr R1 */ | 57 | #define MMC_WRITE_DAT_UNTIL_STOP 20 /* adtc [31:0] data addr R1 */ |
| 63 | 58 | ||
| @@ -433,6 +428,11 @@ struct _mmc_csd { | |||
| 433 | #define EXT_CSD_BKOPS_LEVEL_2 0x2 | 428 | #define EXT_CSD_BKOPS_LEVEL_2 0x2 |
| 434 | 429 | ||
| 435 | /* | 430 | /* |
| 431 | * BKOPS modes | ||
| 432 | */ | ||
| 433 | #define EXT_CSD_MANUAL_BKOPS_MASK 0x01 | ||
| 434 | |||
| 435 | /* | ||
| 436 | * MMC_SWITCH access modes | 436 | * MMC_SWITCH access modes |
| 437 | */ | 437 | */ |
| 438 | 438 | ||
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index f767a0de611f..c3e3db196738 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h | |||
| @@ -17,6 +17,11 @@ | |||
| 17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
| 18 | #include <linux/mmc/host.h> | 18 | #include <linux/mmc/host.h> |
| 19 | 19 | ||
| 20 | struct sdhci_host_next { | ||
| 21 | unsigned int sg_count; | ||
| 22 | s32 cookie; | ||
| 23 | }; | ||
| 24 | |||
| 20 | struct sdhci_host { | 25 | struct sdhci_host { |
| 21 | /* Data set by hardware interface driver */ | 26 | /* Data set by hardware interface driver */ |
| 22 | const char *hw_name; /* Hardware bus name */ | 27 | const char *hw_name; /* Hardware bus name */ |
| @@ -106,6 +111,10 @@ struct sdhci_host { | |||
| 106 | #define SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD (1<<10) | 111 | #define SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD (1<<10) |
| 107 | /* Capability register bit-63 indicates HS400 support */ | 112 | /* Capability register bit-63 indicates HS400 support */ |
| 108 | #define SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400 (1<<11) | 113 | #define SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400 (1<<11) |
| 114 | /* forced tuned clock */ | ||
| 115 | #define SDHCI_QUIRK2_TUNING_WORK_AROUND (1<<12) | ||
| 116 | /* disable the block count for single block transactions */ | ||
| 117 | #define SDHCI_QUIRK2_SUPPORT_SINGLE (1<<13) | ||
| 109 | 118 | ||
| 110 | int irq; /* Device IRQ */ | 119 | int irq; /* Device IRQ */ |
| 111 | void __iomem *ioaddr; /* Mapped address */ | 120 | void __iomem *ioaddr; /* Mapped address */ |
| @@ -203,6 +212,7 @@ struct sdhci_host { | |||
| 203 | #define SDHCI_TUNING_MODE_1 0 | 212 | #define SDHCI_TUNING_MODE_1 0 |
| 204 | struct timer_list tuning_timer; /* Timer for tuning */ | 213 | struct timer_list tuning_timer; /* Timer for tuning */ |
| 205 | 214 | ||
| 215 | struct sdhci_host_next next_data; | ||
| 206 | unsigned long private[0] ____cacheline_aligned; | 216 | unsigned long private[0] ____cacheline_aligned; |
| 207 | }; | 217 | }; |
| 208 | #endif /* LINUX_MMC_SDHCI_H */ | 218 | #endif /* LINUX_MMC_SDHCI_H */ |
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h index 0f01fe065424..996807963716 100644 --- a/include/linux/mmc/sdio_ids.h +++ b/include/linux/mmc/sdio_ids.h | |||
| @@ -24,13 +24,15 @@ | |||
| 24 | * Vendors and devices. Sort key: vendor first, device next. | 24 | * Vendors and devices. Sort key: vendor first, device next. |
| 25 | */ | 25 | */ |
| 26 | #define SDIO_VENDOR_ID_BROADCOM 0x02d0 | 26 | #define SDIO_VENDOR_ID_BROADCOM 0x02d0 |
| 27 | #define SDIO_DEVICE_ID_BROADCOM_43143 43143 | 27 | #define SDIO_DEVICE_ID_BROADCOM_43143 0xa887 |
| 28 | #define SDIO_DEVICE_ID_BROADCOM_43241 0x4324 | 28 | #define SDIO_DEVICE_ID_BROADCOM_43241 0x4324 |
| 29 | #define SDIO_DEVICE_ID_BROADCOM_4329 0x4329 | 29 | #define SDIO_DEVICE_ID_BROADCOM_4329 0x4329 |
| 30 | #define SDIO_DEVICE_ID_BROADCOM_4330 0x4330 | 30 | #define SDIO_DEVICE_ID_BROADCOM_4330 0x4330 |
| 31 | #define SDIO_DEVICE_ID_BROADCOM_4334 0x4334 | 31 | #define SDIO_DEVICE_ID_BROADCOM_4334 0x4334 |
| 32 | #define SDIO_DEVICE_ID_BROADCOM_43340 0xa94c | ||
| 33 | #define SDIO_DEVICE_ID_BROADCOM_43341 0xa94d | ||
| 32 | #define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335 | 34 | #define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335 |
| 33 | #define SDIO_DEVICE_ID_BROADCOM_43362 43362 | 35 | #define SDIO_DEVICE_ID_BROADCOM_43362 0xa962 |
| 34 | #define SDIO_DEVICE_ID_BROADCOM_4354 0x4354 | 36 | #define SDIO_DEVICE_ID_BROADCOM_4354 0x4354 |
| 35 | 37 | ||
| 36 | #define SDIO_VENDOR_ID_INTEL 0x0089 | 38 | #define SDIO_VENDOR_ID_INTEL 0x0089 |
diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h index 68927ae50845..da77e5e2041d 100644 --- a/include/linux/mmc/sh_mobile_sdhi.h +++ b/include/linux/mmc/sh_mobile_sdhi.h | |||
| @@ -3,20 +3,10 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | 5 | ||
| 6 | struct platform_device; | ||
| 7 | |||
| 8 | #define SH_MOBILE_SDHI_IRQ_CARD_DETECT "card_detect" | 6 | #define SH_MOBILE_SDHI_IRQ_CARD_DETECT "card_detect" |
| 9 | #define SH_MOBILE_SDHI_IRQ_SDCARD "sdcard" | 7 | #define SH_MOBILE_SDHI_IRQ_SDCARD "sdcard" |
| 10 | #define SH_MOBILE_SDHI_IRQ_SDIO "sdio" | 8 | #define SH_MOBILE_SDHI_IRQ_SDIO "sdio" |
| 11 | 9 | ||
| 12 | /** | ||
| 13 | * struct sh_mobile_sdhi_ops - SDHI driver callbacks | ||
| 14 | * @cd_wakeup: trigger a card-detection run | ||
| 15 | */ | ||
| 16 | struct sh_mobile_sdhi_ops { | ||
| 17 | void (*cd_wakeup)(const struct platform_device *pdev); | ||
| 18 | }; | ||
| 19 | |||
| 20 | struct sh_mobile_sdhi_info { | 10 | struct sh_mobile_sdhi_info { |
| 21 | int dma_slave_tx; | 11 | int dma_slave_tx; |
| 22 | int dma_slave_rx; | 12 | int dma_slave_rx; |
| @@ -25,11 +15,6 @@ struct sh_mobile_sdhi_info { | |||
| 25 | unsigned long tmio_caps2; | 15 | unsigned long tmio_caps2; |
| 26 | u32 tmio_ocr_mask; /* available MMC voltages */ | 16 | u32 tmio_ocr_mask; /* available MMC voltages */ |
| 27 | unsigned int cd_gpio; | 17 | unsigned int cd_gpio; |
| 28 | |||
| 29 | /* callbacks for board specific setup code */ | ||
| 30 | int (*init)(struct platform_device *pdev, | ||
| 31 | const struct sh_mobile_sdhi_ops *ops); | ||
| 32 | void (*cleanup)(struct platform_device *pdev); | ||
| 33 | }; | 18 | }; |
| 34 | 19 | ||
| 35 | #endif /* LINUX_MMC_SH_MOBILE_SDHI_H */ | 20 | #endif /* LINUX_MMC_SH_MOBILE_SDHI_H */ |
diff --git a/include/linux/mmc/slot-gpio.h b/include/linux/mmc/slot-gpio.h index e56fa24c9322..3945a8c9d3cb 100644 --- a/include/linux/mmc/slot-gpio.h +++ b/include/linux/mmc/slot-gpio.h | |||
| @@ -15,12 +15,10 @@ struct mmc_host; | |||
| 15 | 15 | ||
| 16 | int mmc_gpio_get_ro(struct mmc_host *host); | 16 | int mmc_gpio_get_ro(struct mmc_host *host); |
| 17 | int mmc_gpio_request_ro(struct mmc_host *host, unsigned int gpio); | 17 | int mmc_gpio_request_ro(struct mmc_host *host, unsigned int gpio); |
| 18 | void mmc_gpio_free_ro(struct mmc_host *host); | ||
| 19 | 18 | ||
| 20 | int mmc_gpio_get_cd(struct mmc_host *host); | 19 | int mmc_gpio_get_cd(struct mmc_host *host); |
| 21 | int mmc_gpio_request_cd(struct mmc_host *host, unsigned int gpio, | 20 | int mmc_gpio_request_cd(struct mmc_host *host, unsigned int gpio, |
| 22 | unsigned int debounce); | 21 | unsigned int debounce); |
| 23 | void mmc_gpio_free_cd(struct mmc_host *host); | ||
| 24 | 22 | ||
| 25 | int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id, | 23 | int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id, |
| 26 | unsigned int idx, bool override_active_level, | 24 | unsigned int idx, bool override_active_level, |
| @@ -28,7 +26,8 @@ int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id, | |||
| 28 | int mmc_gpiod_request_ro(struct mmc_host *host, const char *con_id, | 26 | int mmc_gpiod_request_ro(struct mmc_host *host, const char *con_id, |
| 29 | unsigned int idx, bool override_active_level, | 27 | unsigned int idx, bool override_active_level, |
| 30 | unsigned int debounce, bool *gpio_invert); | 28 | unsigned int debounce, bool *gpio_invert); |
| 31 | void mmc_gpiod_free_cd(struct mmc_host *host); | 29 | void mmc_gpio_set_cd_isr(struct mmc_host *host, |
| 30 | irqreturn_t (*isr)(int irq, void *dev_id)); | ||
| 32 | void mmc_gpiod_request_cd_irq(struct mmc_host *host); | 31 | void mmc_gpiod_request_cd_irq(struct mmc_host *host); |
| 33 | 32 | ||
| 34 | #endif | 33 | #endif |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 2f0856d14b21..f279d9c158cd 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
| @@ -426,7 +426,7 @@ struct zone { | |||
| 426 | const char *name; | 426 | const char *name; |
| 427 | 427 | ||
| 428 | /* | 428 | /* |
| 429 | * Number of MIGRATE_RESEVE page block. To maintain for just | 429 | * Number of MIGRATE_RESERVE page block. To maintain for just |
| 430 | * optimization. Protected by zone->lock. | 430 | * optimization. Protected by zone->lock. |
| 431 | */ | 431 | */ |
| 432 | int nr_migrate_reserve_block; | 432 | int nr_migrate_reserve_block; |
| @@ -970,7 +970,6 @@ static inline int zonelist_node_idx(struct zoneref *zoneref) | |||
| 970 | * @z - The cursor used as a starting point for the search | 970 | * @z - The cursor used as a starting point for the search |
| 971 | * @highest_zoneidx - The zone index of the highest zone to return | 971 | * @highest_zoneidx - The zone index of the highest zone to return |
| 972 | * @nodes - An optional nodemask to filter the zonelist with | 972 | * @nodes - An optional nodemask to filter the zonelist with |
| 973 | * @zone - The first suitable zone found is returned via this parameter | ||
| 974 | * | 973 | * |
| 975 | * This function returns the next zone at or below a given zone index that is | 974 | * This function returns the next zone at or below a given zone index that is |
| 976 | * within the allowed nodemask using a cursor as the starting point for the | 975 | * within the allowed nodemask using a cursor as the starting point for the |
| @@ -980,8 +979,7 @@ static inline int zonelist_node_idx(struct zoneref *zoneref) | |||
| 980 | */ | 979 | */ |
| 981 | struct zoneref *next_zones_zonelist(struct zoneref *z, | 980 | struct zoneref *next_zones_zonelist(struct zoneref *z, |
| 982 | enum zone_type highest_zoneidx, | 981 | enum zone_type highest_zoneidx, |
| 983 | nodemask_t *nodes, | 982 | nodemask_t *nodes); |
| 984 | struct zone **zone); | ||
| 985 | 983 | ||
| 986 | /** | 984 | /** |
| 987 | * first_zones_zonelist - Returns the first zone at or below highest_zoneidx within the allowed nodemask in a zonelist | 985 | * first_zones_zonelist - Returns the first zone at or below highest_zoneidx within the allowed nodemask in a zonelist |
| @@ -1000,8 +998,10 @@ static inline struct zoneref *first_zones_zonelist(struct zonelist *zonelist, | |||
| 1000 | nodemask_t *nodes, | 998 | nodemask_t *nodes, |
| 1001 | struct zone **zone) | 999 | struct zone **zone) |
| 1002 | { | 1000 | { |
| 1003 | return next_zones_zonelist(zonelist->_zonerefs, highest_zoneidx, nodes, | 1001 | struct zoneref *z = next_zones_zonelist(zonelist->_zonerefs, |
| 1004 | zone); | 1002 | highest_zoneidx, nodes); |
| 1003 | *zone = zonelist_zone(z); | ||
| 1004 | return z; | ||
| 1005 | } | 1005 | } |
| 1006 | 1006 | ||
| 1007 | /** | 1007 | /** |
| @@ -1018,7 +1018,8 @@ static inline struct zoneref *first_zones_zonelist(struct zonelist *zonelist, | |||
| 1018 | #define for_each_zone_zonelist_nodemask(zone, z, zlist, highidx, nodemask) \ | 1018 | #define for_each_zone_zonelist_nodemask(zone, z, zlist, highidx, nodemask) \ |
| 1019 | for (z = first_zones_zonelist(zlist, highidx, nodemask, &zone); \ | 1019 | for (z = first_zones_zonelist(zlist, highidx, nodemask, &zone); \ |
| 1020 | zone; \ | 1020 | zone; \ |
| 1021 | z = next_zones_zonelist(++z, highidx, nodemask, &zone)) \ | 1021 | z = next_zones_zonelist(++z, highidx, nodemask), \ |
| 1022 | zone = zonelist_zone(z)) \ | ||
| 1022 | 1023 | ||
| 1023 | /** | 1024 | /** |
| 1024 | * for_each_zone_zonelist - helper macro to iterate over valid zones in a zonelist at or below a given zone index | 1025 | * for_each_zone_zonelist - helper macro to iterate over valid zones in a zonelist at or below a given zone index |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 745def862580..bbf85d612be5 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
| @@ -220,8 +220,7 @@ struct serio_device_id { | |||
| 220 | /* | 220 | /* |
| 221 | * Struct used for matching a device | 221 | * Struct used for matching a device |
| 222 | */ | 222 | */ |
| 223 | struct of_device_id | 223 | struct of_device_id { |
| 224 | { | ||
| 225 | char name[32]; | 224 | char name[32]; |
| 226 | char type[32]; | 225 | char type[32]; |
| 227 | char compatible[128]; | 226 | char compatible[128]; |
diff --git a/include/linux/module.h b/include/linux/module.h index ebfb0e153c6a..b653d7c0a05a 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
| @@ -444,7 +444,7 @@ extern void __module_put_and_exit(struct module *mod, long code) | |||
| 444 | #define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code) | 444 | #define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code) |
| 445 | 445 | ||
| 446 | #ifdef CONFIG_MODULE_UNLOAD | 446 | #ifdef CONFIG_MODULE_UNLOAD |
| 447 | unsigned long module_refcount(struct module *mod); | 447 | int module_refcount(struct module *mod); |
| 448 | void __symbol_put(const char *symbol); | 448 | void __symbol_put(const char *symbol); |
| 449 | #define symbol_put(x) __symbol_put(VMLINUX_SYMBOL_STR(x)) | 449 | #define symbol_put(x) __symbol_put(VMLINUX_SYMBOL_STR(x)) |
| 450 | void symbol_put_addr(void *addr); | 450 | void symbol_put_addr(void *addr); |
diff --git a/include/linux/moduleloader.h b/include/linux/moduleloader.h index 7eeb9bbfb816..f7556261fe3c 100644 --- a/include/linux/moduleloader.h +++ b/include/linux/moduleloader.h | |||
| @@ -26,7 +26,7 @@ unsigned int arch_mod_section_prepend(struct module *mod, unsigned int section); | |||
| 26 | void *module_alloc(unsigned long size); | 26 | void *module_alloc(unsigned long size); |
| 27 | 27 | ||
| 28 | /* Free memory returned from module_alloc. */ | 28 | /* Free memory returned from module_alloc. */ |
| 29 | void module_free(struct module *mod, void *module_region); | 29 | void module_memfree(void *module_region); |
| 30 | 30 | ||
| 31 | /* | 31 | /* |
| 32 | * Apply the given relocation to the (simplified) ELF. Return -error | 32 | * Apply the given relocation to the (simplified) ELF. Return -error |
| @@ -82,4 +82,6 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
| 82 | /* Any cleanup needed when module leaves. */ | 82 | /* Any cleanup needed when module leaves. */ |
| 83 | void module_arch_cleanup(struct module *mod); | 83 | void module_arch_cleanup(struct module *mod); |
| 84 | 84 | ||
| 85 | /* Any cleanup before freeing mod->module_init */ | ||
| 86 | void module_arch_freeing_init(struct module *mod); | ||
| 85 | #endif | 87 | #endif |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 031ff3a9a0bd..3301c4c289d6 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
| @@ -408,4 +408,6 @@ static inline int mtd_is_bitflip_or_eccerr(int err) { | |||
| 408 | return mtd_is_bitflip(err) || mtd_is_eccerr(err); | 408 | return mtd_is_bitflip(err) || mtd_is_eccerr(err); |
| 409 | } | 409 | } |
| 410 | 410 | ||
| 411 | unsigned mtd_mmap_capabilities(struct mtd_info *mtd); | ||
| 412 | |||
| 411 | #endif /* __MTD_MTD_H__ */ | 413 | #endif /* __MTD_MTD_H__ */ |
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h index 8e30685affeb..7d59dc6ab789 100644 --- a/include/linux/netdev_features.h +++ b/include/linux/netdev_features.h | |||
| @@ -66,6 +66,7 @@ enum { | |||
| 66 | NETIF_F_HW_VLAN_STAG_FILTER_BIT,/* Receive filtering on VLAN STAGs */ | 66 | NETIF_F_HW_VLAN_STAG_FILTER_BIT,/* Receive filtering on VLAN STAGs */ |
| 67 | NETIF_F_HW_L2FW_DOFFLOAD_BIT, /* Allow L2 Forwarding in Hardware */ | 67 | NETIF_F_HW_L2FW_DOFFLOAD_BIT, /* Allow L2 Forwarding in Hardware */ |
| 68 | NETIF_F_BUSY_POLL_BIT, /* Busy poll */ | 68 | NETIF_F_BUSY_POLL_BIT, /* Busy poll */ |
| 69 | NETIF_F_HW_SWITCH_OFFLOAD_BIT, /* HW switch offload */ | ||
| 69 | 70 | ||
| 70 | /* | 71 | /* |
| 71 | * Add your fresh new feature above and remember to update | 72 | * Add your fresh new feature above and remember to update |
| @@ -124,6 +125,7 @@ enum { | |||
| 124 | #define NETIF_F_HW_VLAN_STAG_TX __NETIF_F(HW_VLAN_STAG_TX) | 125 | #define NETIF_F_HW_VLAN_STAG_TX __NETIF_F(HW_VLAN_STAG_TX) |
| 125 | #define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD) | 126 | #define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD) |
| 126 | #define NETIF_F_BUSY_POLL __NETIF_F(BUSY_POLL) | 127 | #define NETIF_F_BUSY_POLL __NETIF_F(BUSY_POLL) |
| 128 | #define NETIF_F_HW_SWITCH_OFFLOAD __NETIF_F(HW_SWITCH_OFFLOAD) | ||
| 127 | 129 | ||
| 128 | /* Features valid for ethtool to change */ | 130 | /* Features valid for ethtool to change */ |
| 129 | /* = all defined minus driver/device-class-related */ | 131 | /* = all defined minus driver/device-class-related */ |
| @@ -159,7 +161,9 @@ enum { | |||
| 159 | */ | 161 | */ |
| 160 | #define NETIF_F_ONE_FOR_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ROBUST | \ | 162 | #define NETIF_F_ONE_FOR_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ROBUST | \ |
| 161 | NETIF_F_SG | NETIF_F_HIGHDMA | \ | 163 | NETIF_F_SG | NETIF_F_HIGHDMA | \ |
| 162 | NETIF_F_FRAGLIST | NETIF_F_VLAN_CHALLENGED) | 164 | NETIF_F_FRAGLIST | NETIF_F_VLAN_CHALLENGED | \ |
| 165 | NETIF_F_HW_SWITCH_OFFLOAD) | ||
| 166 | |||
| 163 | /* | 167 | /* |
| 164 | * If one device doesn't support one of these features, then disable it | 168 | * If one device doesn't support one of these features, then disable it |
| 165 | * for all in netdev_increment_features. | 169 | * for all in netdev_increment_features. |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 52fd8e8694cf..d115256ed5a2 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -51,6 +51,7 @@ | |||
| 51 | #include <linux/netdev_features.h> | 51 | #include <linux/netdev_features.h> |
| 52 | #include <linux/neighbour.h> | 52 | #include <linux/neighbour.h> |
| 53 | #include <uapi/linux/netdevice.h> | 53 | #include <uapi/linux/netdevice.h> |
| 54 | #include <uapi/linux/if_bonding.h> | ||
| 54 | 55 | ||
| 55 | struct netpoll_info; | 56 | struct netpoll_info; |
| 56 | struct device; | 57 | struct device; |
| @@ -643,39 +644,40 @@ struct rps_dev_flow_table { | |||
| 643 | /* | 644 | /* |
| 644 | * The rps_sock_flow_table contains mappings of flows to the last CPU | 645 | * The rps_sock_flow_table contains mappings of flows to the last CPU |
| 645 | * on which they were processed by the application (set in recvmsg). | 646 | * on which they were processed by the application (set in recvmsg). |
| 647 | * Each entry is a 32bit value. Upper part is the high order bits | ||
| 648 | * of flow hash, lower part is cpu number. | ||
| 649 | * rps_cpu_mask is used to partition the space, depending on number of | ||
| 650 | * possible cpus : rps_cpu_mask = roundup_pow_of_two(nr_cpu_ids) - 1 | ||
| 651 | * For example, if 64 cpus are possible, rps_cpu_mask = 0x3f, | ||
| 652 | * meaning we use 32-6=26 bits for the hash. | ||
| 646 | */ | 653 | */ |
| 647 | struct rps_sock_flow_table { | 654 | struct rps_sock_flow_table { |
| 648 | unsigned int mask; | 655 | u32 mask; |
| 649 | u16 ents[0]; | 656 | |
| 657 | u32 ents[0] ____cacheline_aligned_in_smp; | ||
| 650 | }; | 658 | }; |
| 651 | #define RPS_SOCK_FLOW_TABLE_SIZE(_num) (sizeof(struct rps_sock_flow_table) + \ | 659 | #define RPS_SOCK_FLOW_TABLE_SIZE(_num) (offsetof(struct rps_sock_flow_table, ents[_num])) |
| 652 | ((_num) * sizeof(u16))) | ||
| 653 | 660 | ||
| 654 | #define RPS_NO_CPU 0xffff | 661 | #define RPS_NO_CPU 0xffff |
| 655 | 662 | ||
| 663 | extern u32 rps_cpu_mask; | ||
| 664 | extern struct rps_sock_flow_table __rcu *rps_sock_flow_table; | ||
| 665 | |||
| 656 | static inline void rps_record_sock_flow(struct rps_sock_flow_table *table, | 666 | static inline void rps_record_sock_flow(struct rps_sock_flow_table *table, |
| 657 | u32 hash) | 667 | u32 hash) |
| 658 | { | 668 | { |
| 659 | if (table && hash) { | 669 | if (table && hash) { |
| 660 | unsigned int cpu, index = hash & table->mask; | 670 | unsigned int index = hash & table->mask; |
| 671 | u32 val = hash & ~rps_cpu_mask; | ||
| 661 | 672 | ||
| 662 | /* We only give a hint, preemption can change cpu under us */ | 673 | /* We only give a hint, preemption can change cpu under us */ |
| 663 | cpu = raw_smp_processor_id(); | 674 | val |= raw_smp_processor_id(); |
| 664 | 675 | ||
| 665 | if (table->ents[index] != cpu) | 676 | if (table->ents[index] != val) |
| 666 | table->ents[index] = cpu; | 677 | table->ents[index] = val; |
| 667 | } | 678 | } |
| 668 | } | 679 | } |
| 669 | 680 | ||
| 670 | static inline void rps_reset_sock_flow(struct rps_sock_flow_table *table, | ||
| 671 | u32 hash) | ||
| 672 | { | ||
| 673 | if (table && hash) | ||
| 674 | table->ents[hash & table->mask] = RPS_NO_CPU; | ||
| 675 | } | ||
| 676 | |||
| 677 | extern struct rps_sock_flow_table __rcu *rps_sock_flow_table; | ||
| 678 | |||
| 679 | #ifdef CONFIG_RFS_ACCEL | 681 | #ifdef CONFIG_RFS_ACCEL |
| 680 | bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, u32 flow_id, | 682 | bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, u32 flow_id, |
| 681 | u16 filter_id); | 683 | u16 filter_id); |
| @@ -1154,13 +1156,15 @@ struct net_device_ops { | |||
| 1154 | int idx); | 1156 | int idx); |
| 1155 | 1157 | ||
| 1156 | int (*ndo_bridge_setlink)(struct net_device *dev, | 1158 | int (*ndo_bridge_setlink)(struct net_device *dev, |
| 1157 | struct nlmsghdr *nlh); | 1159 | struct nlmsghdr *nlh, |
| 1160 | u16 flags); | ||
| 1158 | int (*ndo_bridge_getlink)(struct sk_buff *skb, | 1161 | int (*ndo_bridge_getlink)(struct sk_buff *skb, |
| 1159 | u32 pid, u32 seq, | 1162 | u32 pid, u32 seq, |
| 1160 | struct net_device *dev, | 1163 | struct net_device *dev, |
| 1161 | u32 filter_mask); | 1164 | u32 filter_mask); |
| 1162 | int (*ndo_bridge_dellink)(struct net_device *dev, | 1165 | int (*ndo_bridge_dellink)(struct net_device *dev, |
| 1163 | struct nlmsghdr *nlh); | 1166 | struct nlmsghdr *nlh, |
| 1167 | u16 flags); | ||
| 1164 | int (*ndo_change_carrier)(struct net_device *dev, | 1168 | int (*ndo_change_carrier)(struct net_device *dev, |
| 1165 | bool new_carrier); | 1169 | bool new_carrier); |
| 1166 | int (*ndo_get_phys_port_id)(struct net_device *dev, | 1170 | int (*ndo_get_phys_port_id)(struct net_device *dev, |
| @@ -1514,6 +1518,8 @@ struct net_device { | |||
| 1514 | struct list_head napi_list; | 1518 | struct list_head napi_list; |
| 1515 | struct list_head unreg_list; | 1519 | struct list_head unreg_list; |
| 1516 | struct list_head close_list; | 1520 | struct list_head close_list; |
| 1521 | struct list_head ptype_all; | ||
| 1522 | struct list_head ptype_specific; | ||
| 1517 | 1523 | ||
| 1518 | struct { | 1524 | struct { |
| 1519 | struct list_head upper; | 1525 | struct list_head upper; |
| @@ -1969,7 +1975,7 @@ struct offload_callbacks { | |||
| 1969 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, | 1975 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, |
| 1970 | netdev_features_t features); | 1976 | netdev_features_t features); |
| 1971 | struct sk_buff **(*gro_receive)(struct sk_buff **head, | 1977 | struct sk_buff **(*gro_receive)(struct sk_buff **head, |
| 1972 | struct sk_buff *skb); | 1978 | struct sk_buff *skb); |
| 1973 | int (*gro_complete)(struct sk_buff *skb, int nhoff); | 1979 | int (*gro_complete)(struct sk_buff *skb, int nhoff); |
| 1974 | }; | 1980 | }; |
| 1975 | 1981 | ||
| @@ -1979,10 +1985,21 @@ struct packet_offload { | |||
| 1979 | struct list_head list; | 1985 | struct list_head list; |
| 1980 | }; | 1986 | }; |
| 1981 | 1987 | ||
| 1988 | struct udp_offload; | ||
| 1989 | |||
| 1990 | struct udp_offload_callbacks { | ||
| 1991 | struct sk_buff **(*gro_receive)(struct sk_buff **head, | ||
| 1992 | struct sk_buff *skb, | ||
| 1993 | struct udp_offload *uoff); | ||
| 1994 | int (*gro_complete)(struct sk_buff *skb, | ||
| 1995 | int nhoff, | ||
| 1996 | struct udp_offload *uoff); | ||
| 1997 | }; | ||
| 1998 | |||
| 1982 | struct udp_offload { | 1999 | struct udp_offload { |
| 1983 | __be16 port; | 2000 | __be16 port; |
| 1984 | u8 ipproto; | 2001 | u8 ipproto; |
| 1985 | struct offload_callbacks callbacks; | 2002 | struct udp_offload_callbacks callbacks; |
| 1986 | }; | 2003 | }; |
| 1987 | 2004 | ||
| 1988 | /* often modified stats are per cpu, other are shared (netdev->stats) */ | 2005 | /* often modified stats are per cpu, other are shared (netdev->stats) */ |
| @@ -2041,6 +2058,7 @@ struct pcpu_sw_netstats { | |||
| 2041 | #define NETDEV_RESEND_IGMP 0x0016 | 2058 | #define NETDEV_RESEND_IGMP 0x0016 |
| 2042 | #define NETDEV_PRECHANGEMTU 0x0017 /* notify before mtu change happened */ | 2059 | #define NETDEV_PRECHANGEMTU 0x0017 /* notify before mtu change happened */ |
| 2043 | #define NETDEV_CHANGEINFODATA 0x0018 | 2060 | #define NETDEV_CHANGEINFODATA 0x0018 |
| 2061 | #define NETDEV_BONDING_INFO 0x0019 | ||
| 2044 | 2062 | ||
| 2045 | int register_netdevice_notifier(struct notifier_block *nb); | 2063 | int register_netdevice_notifier(struct notifier_block *nb); |
| 2046 | int unregister_netdevice_notifier(struct notifier_block *nb); | 2064 | int unregister_netdevice_notifier(struct notifier_block *nb); |
| @@ -2303,6 +2321,21 @@ do { \ | |||
| 2303 | compute_pseudo(skb, proto)); \ | 2321 | compute_pseudo(skb, proto)); \ |
| 2304 | } while (0) | 2322 | } while (0) |
| 2305 | 2323 | ||
| 2324 | static inline void skb_gro_remcsum_process(struct sk_buff *skb, void *ptr, | ||
| 2325 | int start, int offset) | ||
| 2326 | { | ||
| 2327 | __wsum delta; | ||
| 2328 | |||
| 2329 | BUG_ON(!NAPI_GRO_CB(skb)->csum_valid); | ||
| 2330 | |||
| 2331 | delta = remcsum_adjust(ptr, NAPI_GRO_CB(skb)->csum, start, offset); | ||
| 2332 | |||
| 2333 | /* Adjust skb->csum since we changed the packet */ | ||
| 2334 | skb->csum = csum_add(skb->csum, delta); | ||
| 2335 | NAPI_GRO_CB(skb)->csum = csum_add(NAPI_GRO_CB(skb)->csum, delta); | ||
| 2336 | } | ||
| 2337 | |||
| 2338 | |||
| 2306 | static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, | 2339 | static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, |
| 2307 | unsigned short type, | 2340 | unsigned short type, |
| 2308 | const void *daddr, const void *saddr, | 2341 | const void *daddr, const void *saddr, |
| @@ -3464,6 +3497,19 @@ struct sk_buff *__skb_gso_segment(struct sk_buff *skb, | |||
| 3464 | struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb, | 3497 | struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb, |
| 3465 | netdev_features_t features); | 3498 | netdev_features_t features); |
| 3466 | 3499 | ||
| 3500 | struct netdev_bonding_info { | ||
| 3501 | ifslave slave; | ||
| 3502 | ifbond master; | ||
| 3503 | }; | ||
| 3504 | |||
| 3505 | struct netdev_notifier_bonding_info { | ||
| 3506 | struct netdev_notifier_info info; /* must be first */ | ||
| 3507 | struct netdev_bonding_info bonding_info; | ||
| 3508 | }; | ||
| 3509 | |||
| 3510 | void netdev_bonding_info_change(struct net_device *dev, | ||
| 3511 | struct netdev_bonding_info *bonding_info); | ||
| 3512 | |||
| 3467 | static inline | 3513 | static inline |
| 3468 | struct sk_buff *skb_gso_segment(struct sk_buff *skb, netdev_features_t features) | 3514 | struct sk_buff *skb_gso_segment(struct sk_buff *skb, netdev_features_t features) |
| 3469 | { | 3515 | { |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index de7c91ca427e..ed43cb74b11d 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
| @@ -411,6 +411,7 @@ enum lock_type4 { | |||
| 411 | #define FATTR4_WORD1_TIME_MODIFY_SET (1UL << 22) | 411 | #define FATTR4_WORD1_TIME_MODIFY_SET (1UL << 22) |
| 412 | #define FATTR4_WORD1_MOUNTED_ON_FILEID (1UL << 23) | 412 | #define FATTR4_WORD1_MOUNTED_ON_FILEID (1UL << 23) |
| 413 | #define FATTR4_WORD1_FS_LAYOUT_TYPES (1UL << 30) | 413 | #define FATTR4_WORD1_FS_LAYOUT_TYPES (1UL << 30) |
| 414 | #define FATTR4_WORD2_LAYOUT_TYPES (1UL << 0) | ||
| 414 | #define FATTR4_WORD2_LAYOUT_BLKSIZE (1UL << 1) | 415 | #define FATTR4_WORD2_LAYOUT_BLKSIZE (1UL << 1) |
| 415 | #define FATTR4_WORD2_MDSTHRESHOLD (1UL << 4) | 416 | #define FATTR4_WORD2_MDSTHRESHOLD (1UL << 4) |
| 416 | #define FATTR4_WORD2_SECURITY_LABEL (1UL << 16) | 417 | #define FATTR4_WORD2_SECURITY_LABEL (1UL << 16) |
| @@ -517,6 +518,7 @@ enum pnfs_layouttype { | |||
| 517 | LAYOUT_OSD2_OBJECTS = 2, | 518 | LAYOUT_OSD2_OBJECTS = 2, |
| 518 | LAYOUT_BLOCK_VOLUME = 3, | 519 | LAYOUT_BLOCK_VOLUME = 3, |
| 519 | LAYOUT_FLEX_FILES = 4, | 520 | LAYOUT_FLEX_FILES = 4, |
| 521 | LAYOUT_TYPE_MAX | ||
| 520 | }; | 522 | }; |
| 521 | 523 | ||
| 522 | /* used for both layout return and recall */ | 524 | /* used for both layout return and recall */ |
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h index 38fc05036015..69dbe312b11b 100644 --- a/include/linux/of_gpio.h +++ b/include/linux/of_gpio.h | |||
| @@ -52,6 +52,7 @@ extern int of_get_named_gpio_flags(struct device_node *np, | |||
| 52 | 52 | ||
| 53 | extern int of_mm_gpiochip_add(struct device_node *np, | 53 | extern int of_mm_gpiochip_add(struct device_node *np, |
| 54 | struct of_mm_gpio_chip *mm_gc); | 54 | struct of_mm_gpio_chip *mm_gc); |
| 55 | extern void of_mm_gpiochip_remove(struct of_mm_gpio_chip *mm_gc); | ||
| 55 | 56 | ||
| 56 | extern void of_gpiochip_add(struct gpio_chip *gc); | 57 | extern void of_gpiochip_add(struct gpio_chip *gc); |
| 57 | extern void of_gpiochip_remove(struct gpio_chip *gc); | 58 | extern void of_gpiochip_remove(struct gpio_chip *gc); |
diff --git a/include/linux/oom.h b/include/linux/oom.h index 853698c721f7..d5771bed59c9 100644 --- a/include/linux/oom.h +++ b/include/linux/oom.h | |||
| @@ -47,6 +47,10 @@ static inline bool oom_task_origin(const struct task_struct *p) | |||
| 47 | return !!(p->signal->oom_flags & OOM_FLAG_ORIGIN); | 47 | return !!(p->signal->oom_flags & OOM_FLAG_ORIGIN); |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | extern void mark_tsk_oom_victim(struct task_struct *tsk); | ||
| 51 | |||
| 52 | extern void unmark_oom_victim(void); | ||
| 53 | |||
| 50 | extern unsigned long oom_badness(struct task_struct *p, | 54 | extern unsigned long oom_badness(struct task_struct *p, |
| 51 | struct mem_cgroup *memcg, const nodemask_t *nodemask, | 55 | struct mem_cgroup *memcg, const nodemask_t *nodemask, |
| 52 | unsigned long totalpages); | 56 | unsigned long totalpages); |
| @@ -68,27 +72,14 @@ extern enum oom_scan_t oom_scan_process_thread(struct task_struct *task, | |||
| 68 | unsigned long totalpages, const nodemask_t *nodemask, | 72 | unsigned long totalpages, const nodemask_t *nodemask, |
| 69 | bool force_kill); | 73 | bool force_kill); |
| 70 | 74 | ||
| 71 | extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, | 75 | extern bool out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, |
| 72 | int order, nodemask_t *mask, bool force_kill); | 76 | int order, nodemask_t *mask, bool force_kill); |
| 73 | extern int register_oom_notifier(struct notifier_block *nb); | 77 | extern int register_oom_notifier(struct notifier_block *nb); |
| 74 | extern int unregister_oom_notifier(struct notifier_block *nb); | 78 | extern int unregister_oom_notifier(struct notifier_block *nb); |
| 75 | 79 | ||
| 76 | extern bool oom_killer_disabled; | 80 | extern bool oom_killer_disabled; |
| 77 | 81 | extern bool oom_killer_disable(void); | |
| 78 | static inline void oom_killer_disable(void) | 82 | extern void oom_killer_enable(void); |
| 79 | { | ||
| 80 | oom_killer_disabled = true; | ||
| 81 | } | ||
| 82 | |||
| 83 | static inline void oom_killer_enable(void) | ||
| 84 | { | ||
| 85 | oom_killer_disabled = false; | ||
| 86 | } | ||
| 87 | |||
| 88 | static inline bool oom_gfp_allowed(gfp_t gfp_mask) | ||
| 89 | { | ||
| 90 | return (gfp_mask & __GFP_FS) && !(gfp_mask & __GFP_NORETRY); | ||
| 91 | } | ||
| 92 | 83 | ||
| 93 | extern struct task_struct *find_lock_task_mm(struct task_struct *p); | 84 | extern struct task_struct *find_lock_task_mm(struct task_struct *p); |
| 94 | 85 | ||
diff --git a/include/linux/osq_lock.h b/include/linux/osq_lock.h index 90230d5811c5..3a6490e81b28 100644 --- a/include/linux/osq_lock.h +++ b/include/linux/osq_lock.h | |||
| @@ -5,8 +5,11 @@ | |||
| 5 | * An MCS like lock especially tailored for optimistic spinning for sleeping | 5 | * An MCS like lock especially tailored for optimistic spinning for sleeping |
| 6 | * lock implementations (mutex, rwsem, etc). | 6 | * lock implementations (mutex, rwsem, etc). |
| 7 | */ | 7 | */ |
| 8 | 8 | struct optimistic_spin_node { | |
| 9 | #define OSQ_UNLOCKED_VAL (0) | 9 | struct optimistic_spin_node *next, *prev; |
| 10 | int locked; /* 1 if lock acquired */ | ||
| 11 | int cpu; /* encoded CPU # + 1 value */ | ||
| 12 | }; | ||
| 10 | 13 | ||
| 11 | struct optimistic_spin_queue { | 14 | struct optimistic_spin_queue { |
| 12 | /* | 15 | /* |
| @@ -16,6 +19,8 @@ struct optimistic_spin_queue { | |||
| 16 | atomic_t tail; | 19 | atomic_t tail; |
| 17 | }; | 20 | }; |
| 18 | 21 | ||
| 22 | #define OSQ_UNLOCKED_VAL (0) | ||
| 23 | |||
| 19 | /* Init macro and function. */ | 24 | /* Init macro and function. */ |
| 20 | #define OSQ_LOCK_UNLOCKED { ATOMIC_INIT(OSQ_UNLOCKED_VAL) } | 25 | #define OSQ_LOCK_UNLOCKED { ATOMIC_INIT(OSQ_UNLOCKED_VAL) } |
| 21 | 26 | ||
| @@ -24,4 +29,7 @@ static inline void osq_lock_init(struct optimistic_spin_queue *lock) | |||
| 24 | atomic_set(&lock->tail, OSQ_UNLOCKED_VAL); | 29 | atomic_set(&lock->tail, OSQ_UNLOCKED_VAL); |
| 25 | } | 30 | } |
| 26 | 31 | ||
| 32 | extern bool osq_lock(struct optimistic_spin_queue *lock); | ||
| 33 | extern void osq_unlock(struct optimistic_spin_queue *lock); | ||
| 34 | |||
| 27 | #endif | 35 | #endif |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index e1f5fcd79792..5ed7bdaf22d5 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
| @@ -121,8 +121,12 @@ enum pageflags { | |||
| 121 | PG_fscache = PG_private_2, /* page backed by cache */ | 121 | PG_fscache = PG_private_2, /* page backed by cache */ |
| 122 | 122 | ||
| 123 | /* XEN */ | 123 | /* XEN */ |
| 124 | /* Pinned in Xen as a read-only pagetable page. */ | ||
| 124 | PG_pinned = PG_owner_priv_1, | 125 | PG_pinned = PG_owner_priv_1, |
| 126 | /* Pinned as part of domain save (see xen_mm_pin_all()). */ | ||
| 125 | PG_savepinned = PG_dirty, | 127 | PG_savepinned = PG_dirty, |
| 128 | /* Has a grant mapping of another (foreign) domain's page. */ | ||
| 129 | PG_foreign = PG_owner_priv_1, | ||
| 126 | 130 | ||
| 127 | /* SLOB */ | 131 | /* SLOB */ |
| 128 | PG_slob_free = PG_private, | 132 | PG_slob_free = PG_private, |
| @@ -215,6 +219,7 @@ __PAGEFLAG(Slab, slab) | |||
| 215 | PAGEFLAG(Checked, checked) /* Used by some filesystems */ | 219 | PAGEFLAG(Checked, checked) /* Used by some filesystems */ |
| 216 | PAGEFLAG(Pinned, pinned) TESTSCFLAG(Pinned, pinned) /* Xen */ | 220 | PAGEFLAG(Pinned, pinned) TESTSCFLAG(Pinned, pinned) /* Xen */ |
| 217 | PAGEFLAG(SavePinned, savepinned); /* Xen */ | 221 | PAGEFLAG(SavePinned, savepinned); /* Xen */ |
| 222 | PAGEFLAG(Foreign, foreign); /* Xen */ | ||
| 218 | PAGEFLAG(Reserved, reserved) __CLEARPAGEFLAG(Reserved, reserved) | 223 | PAGEFLAG(Reserved, reserved) __CLEARPAGEFLAG(Reserved, reserved) |
| 219 | PAGEFLAG(SwapBacked, swapbacked) __CLEARPAGEFLAG(SwapBacked, swapbacked) | 224 | PAGEFLAG(SwapBacked, swapbacked) __CLEARPAGEFLAG(SwapBacked, swapbacked) |
| 220 | __SETPAGEFLAG(SwapBacked, swapbacked) | 225 | __SETPAGEFLAG(SwapBacked, swapbacked) |
diff --git a/include/linux/page_counter.h b/include/linux/page_counter.h index 955421575d16..17fa4f8de3a6 100644 --- a/include/linux/page_counter.h +++ b/include/linux/page_counter.h | |||
| @@ -41,7 +41,8 @@ int page_counter_try_charge(struct page_counter *counter, | |||
| 41 | struct page_counter **fail); | 41 | struct page_counter **fail); |
| 42 | void page_counter_uncharge(struct page_counter *counter, unsigned long nr_pages); | 42 | void page_counter_uncharge(struct page_counter *counter, unsigned long nr_pages); |
| 43 | int page_counter_limit(struct page_counter *counter, unsigned long limit); | 43 | int page_counter_limit(struct page_counter *counter, unsigned long limit); |
| 44 | int page_counter_memparse(const char *buf, unsigned long *nr_pages); | 44 | int page_counter_memparse(const char *buf, const char *max, |
| 45 | unsigned long *nr_pages); | ||
| 45 | 46 | ||
| 46 | static inline void page_counter_reset_watermark(struct page_counter *counter) | 47 | static inline void page_counter_reset_watermark(struct page_counter *counter) |
| 47 | { | 48 | { |
diff --git a/include/linux/page_ext.h b/include/linux/page_ext.h index d2a2c84c72d0..c42981cd99aa 100644 --- a/include/linux/page_ext.h +++ b/include/linux/page_ext.h | |||
| @@ -40,7 +40,7 @@ struct page_ext { | |||
| 40 | #ifdef CONFIG_PAGE_OWNER | 40 | #ifdef CONFIG_PAGE_OWNER |
| 41 | unsigned int order; | 41 | unsigned int order; |
| 42 | gfp_t gfp_mask; | 42 | gfp_t gfp_mask; |
| 43 | struct stack_trace trace; | 43 | unsigned int nr_entries; |
| 44 | unsigned long trace_entries[8]; | 44 | unsigned long trace_entries[8]; |
| 45 | #endif | 45 | #endif |
| 46 | }; | 46 | }; |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 360a966a97a5..211e9da8a7d7 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <linux/atomic.h> | 29 | #include <linux/atomic.h> |
| 30 | #include <linux/device.h> | 30 | #include <linux/device.h> |
| 31 | #include <linux/io.h> | 31 | #include <linux/io.h> |
| 32 | #include <linux/resource_ext.h> | ||
| 32 | #include <uapi/linux/pci.h> | 33 | #include <uapi/linux/pci.h> |
| 33 | 34 | ||
| 34 | #include <linux/pci_ids.h> | 35 | #include <linux/pci_ids.h> |
| @@ -175,6 +176,10 @@ enum pci_dev_flags { | |||
| 175 | PCI_DEV_FLAGS_DMA_ALIAS_DEVFN = (__force pci_dev_flags_t) (1 << 4), | 176 | PCI_DEV_FLAGS_DMA_ALIAS_DEVFN = (__force pci_dev_flags_t) (1 << 4), |
| 176 | /* Use a PCIe-to-PCI bridge alias even if !pci_is_pcie */ | 177 | /* Use a PCIe-to-PCI bridge alias even if !pci_is_pcie */ |
| 177 | PCI_DEV_FLAG_PCIE_BRIDGE_ALIAS = (__force pci_dev_flags_t) (1 << 5), | 178 | PCI_DEV_FLAG_PCIE_BRIDGE_ALIAS = (__force pci_dev_flags_t) (1 << 5), |
| 179 | /* Do not use bus resets for device */ | ||
| 180 | PCI_DEV_FLAGS_NO_BUS_RESET = (__force pci_dev_flags_t) (1 << 6), | ||
| 181 | /* Do not use PM reset even if device advertises NoSoftRst- */ | ||
| 182 | PCI_DEV_FLAGS_NO_PM_RESET = (__force pci_dev_flags_t) (1 << 7), | ||
| 178 | }; | 183 | }; |
| 179 | 184 | ||
| 180 | enum pci_irq_reroute_variant { | 185 | enum pci_irq_reroute_variant { |
| @@ -395,16 +400,10 @@ static inline int pci_channel_offline(struct pci_dev *pdev) | |||
| 395 | return (pdev->error_state != pci_channel_io_normal); | 400 | return (pdev->error_state != pci_channel_io_normal); |
| 396 | } | 401 | } |
| 397 | 402 | ||
| 398 | struct pci_host_bridge_window { | ||
| 399 | struct list_head list; | ||
| 400 | struct resource *res; /* host bridge aperture (CPU address) */ | ||
| 401 | resource_size_t offset; /* bus address + offset = CPU address */ | ||
| 402 | }; | ||
| 403 | |||
| 404 | struct pci_host_bridge { | 403 | struct pci_host_bridge { |
| 405 | struct device dev; | 404 | struct device dev; |
| 406 | struct pci_bus *bus; /* root bus */ | 405 | struct pci_bus *bus; /* root bus */ |
| 407 | struct list_head windows; /* pci_host_bridge_windows */ | 406 | struct list_head windows; /* resource_entry */ |
| 408 | void (*release_fn)(struct pci_host_bridge *); | 407 | void (*release_fn)(struct pci_host_bridge *); |
| 409 | void *release_data; | 408 | void *release_data; |
| 410 | }; | 409 | }; |
| @@ -560,6 +559,7 @@ static inline int pcibios_err_to_errno(int err) | |||
| 560 | /* Low-level architecture-dependent routines */ | 559 | /* Low-level architecture-dependent routines */ |
| 561 | 560 | ||
| 562 | struct pci_ops { | 561 | struct pci_ops { |
| 562 | void __iomem *(*map_bus)(struct pci_bus *bus, unsigned int devfn, int where); | ||
| 563 | int (*read)(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val); | 563 | int (*read)(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val); |
| 564 | int (*write)(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val); | 564 | int (*write)(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val); |
| 565 | }; | 565 | }; |
| @@ -857,6 +857,16 @@ int pci_bus_write_config_word(struct pci_bus *bus, unsigned int devfn, | |||
| 857 | int where, u16 val); | 857 | int where, u16 val); |
| 858 | int pci_bus_write_config_dword(struct pci_bus *bus, unsigned int devfn, | 858 | int pci_bus_write_config_dword(struct pci_bus *bus, unsigned int devfn, |
| 859 | int where, u32 val); | 859 | int where, u32 val); |
| 860 | |||
| 861 | int pci_generic_config_read(struct pci_bus *bus, unsigned int devfn, | ||
| 862 | int where, int size, u32 *val); | ||
| 863 | int pci_generic_config_write(struct pci_bus *bus, unsigned int devfn, | ||
| 864 | int where, int size, u32 val); | ||
| 865 | int pci_generic_config_read32(struct pci_bus *bus, unsigned int devfn, | ||
| 866 | int where, int size, u32 *val); | ||
| 867 | int pci_generic_config_write32(struct pci_bus *bus, unsigned int devfn, | ||
| 868 | int where, int size, u32 val); | ||
| 869 | |||
| 860 | struct pci_ops *pci_bus_set_ops(struct pci_bus *bus, struct pci_ops *ops); | 870 | struct pci_ops *pci_bus_set_ops(struct pci_bus *bus, struct pci_ops *ops); |
| 861 | 871 | ||
| 862 | static inline int pci_read_config_byte(const struct pci_dev *dev, int where, u8 *val) | 872 | static inline int pci_read_config_byte(const struct pci_dev *dev, int where, u8 *val) |
| @@ -1065,6 +1075,7 @@ resource_size_t pcibios_retrieve_fw_addr(struct pci_dev *dev, int idx); | |||
| 1065 | void pci_bus_assign_resources(const struct pci_bus *bus); | 1075 | void pci_bus_assign_resources(const struct pci_bus *bus); |
| 1066 | void pci_bus_size_bridges(struct pci_bus *bus); | 1076 | void pci_bus_size_bridges(struct pci_bus *bus); |
| 1067 | int pci_claim_resource(struct pci_dev *, int); | 1077 | int pci_claim_resource(struct pci_dev *, int); |
| 1078 | int pci_claim_bridge_resource(struct pci_dev *bridge, int i); | ||
| 1068 | void pci_assign_unassigned_resources(void); | 1079 | void pci_assign_unassigned_resources(void); |
| 1069 | void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge); | 1080 | void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge); |
| 1070 | void pci_assign_unassigned_bus_resources(struct pci_bus *bus); | 1081 | void pci_assign_unassigned_bus_resources(struct pci_bus *bus); |
| @@ -1847,6 +1858,8 @@ static inline void pci_set_of_node(struct pci_dev *dev) { } | |||
| 1847 | static inline void pci_release_of_node(struct pci_dev *dev) { } | 1858 | static inline void pci_release_of_node(struct pci_dev *dev) { } |
| 1848 | static inline void pci_set_bus_of_node(struct pci_bus *bus) { } | 1859 | static inline void pci_set_bus_of_node(struct pci_bus *bus) { } |
| 1849 | static inline void pci_release_bus_of_node(struct pci_bus *bus) { } | 1860 | static inline void pci_release_bus_of_node(struct pci_bus *bus) { } |
| 1861 | static inline struct device_node * | ||
| 1862 | pci_device_to_OF_node(const struct pci_dev *pdev) { return NULL; } | ||
| 1850 | #endif /* CONFIG_OF */ | 1863 | #endif /* CONFIG_OF */ |
| 1851 | 1864 | ||
| 1852 | #ifdef CONFIG_EEH | 1865 | #ifdef CONFIG_EEH |
diff --git a/include/linux/percpu-refcount.h b/include/linux/percpu-refcount.h index b4337646388b..12c9b485beb7 100644 --- a/include/linux/percpu-refcount.h +++ b/include/linux/percpu-refcount.h | |||
| @@ -128,8 +128,22 @@ static inline void percpu_ref_kill(struct percpu_ref *ref) | |||
| 128 | static inline bool __ref_is_percpu(struct percpu_ref *ref, | 128 | static inline bool __ref_is_percpu(struct percpu_ref *ref, |
| 129 | unsigned long __percpu **percpu_countp) | 129 | unsigned long __percpu **percpu_countp) |
| 130 | { | 130 | { |
| 131 | /* paired with smp_store_release() in percpu_ref_reinit() */ | 131 | unsigned long percpu_ptr; |
| 132 | unsigned long percpu_ptr = lockless_dereference(ref->percpu_count_ptr); | 132 | |
| 133 | /* | ||
| 134 | * The value of @ref->percpu_count_ptr is tested for | ||
| 135 | * !__PERCPU_REF_ATOMIC, which may be set asynchronously, and then | ||
| 136 | * used as a pointer. If the compiler generates a separate fetch | ||
| 137 | * when using it as a pointer, __PERCPU_REF_ATOMIC may be set in | ||
| 138 | * between contaminating the pointer value, meaning that | ||
| 139 | * ACCESS_ONCE() is required when fetching it. | ||
| 140 | * | ||
| 141 | * Also, we need a data dependency barrier to be paired with | ||
| 142 | * smp_store_release() in __percpu_ref_switch_to_percpu(). | ||
| 143 | * | ||
| 144 | * Use lockless deref which contains both. | ||
| 145 | */ | ||
| 146 | percpu_ptr = lockless_dereference(ref->percpu_count_ptr); | ||
| 133 | 147 | ||
| 134 | /* | 148 | /* |
| 135 | * Theoretically, the following could test just ATOMIC; however, | 149 | * Theoretically, the following could test just ATOMIC; however, |
| @@ -233,7 +247,7 @@ static inline bool percpu_ref_tryget_live(struct percpu_ref *ref) | |||
| 233 | if (__ref_is_percpu(ref, &percpu_count)) { | 247 | if (__ref_is_percpu(ref, &percpu_count)) { |
| 234 | this_cpu_inc(*percpu_count); | 248 | this_cpu_inc(*percpu_count); |
| 235 | ret = true; | 249 | ret = true; |
| 236 | } else if (!(ACCESS_ONCE(ref->percpu_count_ptr) & __PERCPU_REF_DEAD)) { | 250 | } else if (!(ref->percpu_count_ptr & __PERCPU_REF_DEAD)) { |
| 237 | ret = atomic_long_inc_not_zero(&ref->count); | 251 | ret = atomic_long_inc_not_zero(&ref->count); |
| 238 | } | 252 | } |
| 239 | 253 | ||
| @@ -281,6 +295,20 @@ static inline void percpu_ref_put(struct percpu_ref *ref) | |||
| 281 | } | 295 | } |
| 282 | 296 | ||
| 283 | /** | 297 | /** |
| 298 | * percpu_ref_is_dying - test whether a percpu refcount is dying or dead | ||
| 299 | * @ref: percpu_ref to test | ||
| 300 | * | ||
| 301 | * Returns %true if @ref is dying or dead. | ||
| 302 | * | ||
| 303 | * This function is safe to call as long as @ref is between init and exit | ||
| 304 | * and the caller is responsible for synchronizing against state changes. | ||
| 305 | */ | ||
| 306 | static inline bool percpu_ref_is_dying(struct percpu_ref *ref) | ||
| 307 | { | ||
| 308 | return ref->percpu_count_ptr & __PERCPU_REF_DEAD; | ||
| 309 | } | ||
| 310 | |||
| 311 | /** | ||
| 284 | * percpu_ref_is_zero - test whether a percpu refcount reached zero | 312 | * percpu_ref_is_zero - test whether a percpu refcount reached zero |
| 285 | * @ref: percpu_ref to test | 313 | * @ref: percpu_ref to test |
| 286 | * | 314 | * |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 4f7a61ca4b39..2cdc9d422bed 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -450,11 +450,6 @@ struct perf_event { | |||
| 450 | #endif /* CONFIG_PERF_EVENTS */ | 450 | #endif /* CONFIG_PERF_EVENTS */ |
| 451 | }; | 451 | }; |
| 452 | 452 | ||
| 453 | enum perf_event_context_type { | ||
| 454 | task_context, | ||
| 455 | cpu_context, | ||
| 456 | }; | ||
| 457 | |||
| 458 | /** | 453 | /** |
| 459 | * struct perf_event_context - event context structure | 454 | * struct perf_event_context - event context structure |
| 460 | * | 455 | * |
| @@ -462,7 +457,6 @@ enum perf_event_context_type { | |||
| 462 | */ | 457 | */ |
| 463 | struct perf_event_context { | 458 | struct perf_event_context { |
| 464 | struct pmu *pmu; | 459 | struct pmu *pmu; |
| 465 | enum perf_event_context_type type; | ||
| 466 | /* | 460 | /* |
| 467 | * Protect the states of the events in the list, | 461 | * Protect the states of the events in the list, |
| 468 | * nr_active, and the list: | 462 | * nr_active, and the list: |
| @@ -475,6 +469,7 @@ struct perf_event_context { | |||
| 475 | */ | 469 | */ |
| 476 | struct mutex mutex; | 470 | struct mutex mutex; |
| 477 | 471 | ||
| 472 | struct list_head active_ctx_list; | ||
| 478 | struct list_head pinned_groups; | 473 | struct list_head pinned_groups; |
| 479 | struct list_head flexible_groups; | 474 | struct list_head flexible_groups; |
| 480 | struct list_head event_list; | 475 | struct list_head event_list; |
| @@ -525,7 +520,6 @@ struct perf_cpu_context { | |||
| 525 | int exclusive; | 520 | int exclusive; |
| 526 | struct hrtimer hrtimer; | 521 | struct hrtimer hrtimer; |
| 527 | ktime_t hrtimer_interval; | 522 | ktime_t hrtimer_interval; |
| 528 | struct list_head rotation_list; | ||
| 529 | struct pmu *unique_pmu; | 523 | struct pmu *unique_pmu; |
| 530 | struct perf_cgroup *cgrp; | 524 | struct perf_cgroup *cgrp; |
| 531 | }; | 525 | }; |
| @@ -665,6 +659,7 @@ static inline int is_software_event(struct perf_event *event) | |||
| 665 | 659 | ||
| 666 | extern struct static_key perf_swevent_enabled[PERF_COUNT_SW_MAX]; | 660 | extern struct static_key perf_swevent_enabled[PERF_COUNT_SW_MAX]; |
| 667 | 661 | ||
| 662 | extern void ___perf_sw_event(u32, u64, struct pt_regs *, u64); | ||
| 668 | extern void __perf_sw_event(u32, u64, struct pt_regs *, u64); | 663 | extern void __perf_sw_event(u32, u64, struct pt_regs *, u64); |
| 669 | 664 | ||
| 670 | #ifndef perf_arch_fetch_caller_regs | 665 | #ifndef perf_arch_fetch_caller_regs |
| @@ -689,14 +684,25 @@ static inline void perf_fetch_caller_regs(struct pt_regs *regs) | |||
| 689 | static __always_inline void | 684 | static __always_inline void |
| 690 | perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr) | 685 | perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr) |
| 691 | { | 686 | { |
| 692 | struct pt_regs hot_regs; | 687 | if (static_key_false(&perf_swevent_enabled[event_id])) |
| 688 | __perf_sw_event(event_id, nr, regs, addr); | ||
| 689 | } | ||
| 693 | 690 | ||
| 691 | DECLARE_PER_CPU(struct pt_regs, __perf_regs[4]); | ||
| 692 | |||
| 693 | /* | ||
| 694 | * 'Special' version for the scheduler, it hard assumes no recursion, | ||
| 695 | * which is guaranteed by us not actually scheduling inside other swevents | ||
| 696 | * because those disable preemption. | ||
| 697 | */ | ||
| 698 | static __always_inline void | ||
| 699 | perf_sw_event_sched(u32 event_id, u64 nr, u64 addr) | ||
| 700 | { | ||
| 694 | if (static_key_false(&perf_swevent_enabled[event_id])) { | 701 | if (static_key_false(&perf_swevent_enabled[event_id])) { |
| 695 | if (!regs) { | 702 | struct pt_regs *regs = this_cpu_ptr(&__perf_regs[0]); |
| 696 | perf_fetch_caller_regs(&hot_regs); | 703 | |
| 697 | regs = &hot_regs; | 704 | perf_fetch_caller_regs(regs); |
| 698 | } | 705 | ___perf_sw_event(event_id, nr, regs, addr); |
| 699 | __perf_sw_event(event_id, nr, regs, addr); | ||
| 700 | } | 706 | } |
| 701 | } | 707 | } |
| 702 | 708 | ||
| @@ -712,7 +718,7 @@ static inline void perf_event_task_sched_in(struct task_struct *prev, | |||
| 712 | static inline void perf_event_task_sched_out(struct task_struct *prev, | 718 | static inline void perf_event_task_sched_out(struct task_struct *prev, |
| 713 | struct task_struct *next) | 719 | struct task_struct *next) |
| 714 | { | 720 | { |
| 715 | perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, NULL, 0); | 721 | perf_sw_event_sched(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, 0); |
| 716 | 722 | ||
| 717 | if (static_key_false(&perf_sched_events.key)) | 723 | if (static_key_false(&perf_sched_events.key)) |
| 718 | __perf_event_task_sched_out(prev, next); | 724 | __perf_event_task_sched_out(prev, next); |
| @@ -823,6 +829,8 @@ static inline int perf_event_refresh(struct perf_event *event, int refresh) | |||
| 823 | static inline void | 829 | static inline void |
| 824 | perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr) { } | 830 | perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr) { } |
| 825 | static inline void | 831 | static inline void |
| 832 | perf_sw_event_sched(u32 event_id, u64 nr, u64 addr) { } | ||
| 833 | static inline void | ||
| 826 | perf_bp_event(struct perf_event *event, void *data) { } | 834 | perf_bp_event(struct perf_event *event, void *data) { } |
| 827 | 835 | ||
| 828 | static inline int perf_register_guest_info_callbacks | 836 | static inline int perf_register_guest_info_callbacks |
| @@ -899,12 +907,22 @@ struct perf_pmu_events_attr { | |||
| 899 | const char *event_str; | 907 | const char *event_str; |
| 900 | }; | 908 | }; |
| 901 | 909 | ||
| 910 | ssize_t perf_event_sysfs_show(struct device *dev, struct device_attribute *attr, | ||
| 911 | char *page); | ||
| 912 | |||
| 902 | #define PMU_EVENT_ATTR(_name, _var, _id, _show) \ | 913 | #define PMU_EVENT_ATTR(_name, _var, _id, _show) \ |
| 903 | static struct perf_pmu_events_attr _var = { \ | 914 | static struct perf_pmu_events_attr _var = { \ |
| 904 | .attr = __ATTR(_name, 0444, _show, NULL), \ | 915 | .attr = __ATTR(_name, 0444, _show, NULL), \ |
| 905 | .id = _id, \ | 916 | .id = _id, \ |
| 906 | }; | 917 | }; |
| 907 | 918 | ||
| 919 | #define PMU_EVENT_ATTR_STRING(_name, _var, _str) \ | ||
| 920 | static struct perf_pmu_events_attr _var = { \ | ||
| 921 | .attr = __ATTR(_name, 0444, perf_event_sysfs_show, NULL), \ | ||
| 922 | .id = 0, \ | ||
| 923 | .event_str = _str, \ | ||
| 924 | }; | ||
| 925 | |||
| 908 | #define PMU_FORMAT_ATTR(_name, _format) \ | 926 | #define PMU_FORMAT_ATTR(_name, _format) \ |
| 909 | static ssize_t \ | 927 | static ssize_t \ |
| 910 | _name##_show(struct device *dev, \ | 928 | _name##_show(struct device *dev, \ |
diff --git a/include/linux/phy.h b/include/linux/phy.h index 22af8f8f5802..685809835b5c 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
| @@ -327,6 +327,8 @@ struct phy_c45_device_ids { | |||
| 327 | * c45_ids: 802.3-c45 Device Identifers if is_c45. | 327 | * c45_ids: 802.3-c45 Device Identifers if is_c45. |
| 328 | * is_c45: Set to true if this phy uses clause 45 addressing. | 328 | * is_c45: Set to true if this phy uses clause 45 addressing. |
| 329 | * is_internal: Set to true if this phy is internal to a MAC. | 329 | * is_internal: Set to true if this phy is internal to a MAC. |
| 330 | * has_fixups: Set to true if this phy has fixups/quirks. | ||
| 331 | * suspended: Set to true if this phy has been suspended successfully. | ||
| 330 | * state: state of the PHY for management purposes | 332 | * state: state of the PHY for management purposes |
| 331 | * dev_flags: Device-specific flags used by the PHY driver. | 333 | * dev_flags: Device-specific flags used by the PHY driver. |
| 332 | * addr: Bus address of PHY | 334 | * addr: Bus address of PHY |
| @@ -364,6 +366,7 @@ struct phy_device { | |||
| 364 | bool is_c45; | 366 | bool is_c45; |
| 365 | bool is_internal; | 367 | bool is_internal; |
| 366 | bool has_fixups; | 368 | bool has_fixups; |
| 369 | bool suspended; | ||
| 367 | 370 | ||
| 368 | enum phy_state state; | 371 | enum phy_state state; |
| 369 | 372 | ||
| @@ -565,6 +568,15 @@ struct phy_driver { | |||
| 565 | void (*write_mmd_indirect)(struct phy_device *dev, int ptrad, | 568 | void (*write_mmd_indirect)(struct phy_device *dev, int ptrad, |
| 566 | int devnum, int regnum, u32 val); | 569 | int devnum, int regnum, u32 val); |
| 567 | 570 | ||
| 571 | /* Get the size and type of the eeprom contained within a plug-in | ||
| 572 | * module */ | ||
| 573 | int (*module_info)(struct phy_device *dev, | ||
| 574 | struct ethtool_modinfo *modinfo); | ||
| 575 | |||
| 576 | /* Get the eeprom information from the plug-in module */ | ||
| 577 | int (*module_eeprom)(struct phy_device *dev, | ||
| 578 | struct ethtool_eeprom *ee, u8 *data); | ||
| 579 | |||
| 568 | struct device_driver driver; | 580 | struct device_driver driver; |
| 569 | }; | 581 | }; |
| 570 | #define to_phy_driver(d) container_of(d, struct phy_driver, driver) | 582 | #define to_phy_driver(d) container_of(d, struct phy_driver, driver) |
diff --git a/include/linux/phy/phy-qcom-ufs.h b/include/linux/phy/phy-qcom-ufs.h new file mode 100644 index 000000000000..9d18e9f948e9 --- /dev/null +++ b/include/linux/phy/phy-qcom-ufs.h | |||
| @@ -0,0 +1,59 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2013-2015, Linux Foundation. All rights reserved. | ||
| 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 and | ||
| 6 | * only version 2 as published by the Free Software Foundation. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef PHY_QCOM_UFS_H_ | ||
| 16 | #define PHY_QCOM_UFS_H_ | ||
| 17 | |||
| 18 | #include "phy.h" | ||
| 19 | |||
| 20 | /** | ||
| 21 | * ufs_qcom_phy_enable_ref_clk() - Enable the phy | ||
| 22 | * ref clock. | ||
| 23 | * @phy: reference to a generic phy | ||
| 24 | * | ||
| 25 | * returns 0 for success, and non-zero for error. | ||
| 26 | */ | ||
| 27 | int ufs_qcom_phy_enable_ref_clk(struct phy *phy); | ||
| 28 | |||
| 29 | /** | ||
| 30 | * ufs_qcom_phy_disable_ref_clk() - Disable the phy | ||
| 31 | * ref clock. | ||
| 32 | * @phy: reference to a generic phy. | ||
| 33 | */ | ||
| 34 | void ufs_qcom_phy_disable_ref_clk(struct phy *phy); | ||
| 35 | |||
| 36 | /** | ||
| 37 | * ufs_qcom_phy_enable_dev_ref_clk() - Enable the device | ||
| 38 | * ref clock. | ||
| 39 | * @phy: reference to a generic phy. | ||
| 40 | */ | ||
| 41 | void ufs_qcom_phy_enable_dev_ref_clk(struct phy *phy); | ||
| 42 | |||
| 43 | /** | ||
| 44 | * ufs_qcom_phy_disable_dev_ref_clk() - Disable the device | ||
| 45 | * ref clock. | ||
| 46 | * @phy: reference to a generic phy. | ||
| 47 | */ | ||
| 48 | void ufs_qcom_phy_disable_dev_ref_clk(struct phy *phy); | ||
| 49 | |||
| 50 | int ufs_qcom_phy_enable_iface_clk(struct phy *phy); | ||
| 51 | void ufs_qcom_phy_disable_iface_clk(struct phy *phy); | ||
| 52 | int ufs_qcom_phy_start_serdes(struct phy *phy); | ||
| 53 | int ufs_qcom_phy_set_tx_lane_enable(struct phy *phy, u32 tx_lanes); | ||
| 54 | int ufs_qcom_phy_calibrate_phy(struct phy *phy, bool is_rate_B); | ||
| 55 | int ufs_qcom_phy_is_pcs_ready(struct phy *phy); | ||
| 56 | void ufs_qcom_phy_save_controller_version(struct phy *phy, | ||
| 57 | u8 major, u16 minor, u16 step); | ||
| 58 | |||
| 59 | #endif /* PHY_QCOM_UFS_H_ */ | ||
diff --git a/include/linux/pinctrl/consumer.h b/include/linux/pinctrl/consumer.h index 18eccefea06e..72c0415d6c21 100644 --- a/include/linux/pinctrl/consumer.h +++ b/include/linux/pinctrl/consumer.h | |||
| @@ -82,7 +82,7 @@ static inline int pinctrl_gpio_direction_output(unsigned gpio) | |||
| 82 | 82 | ||
| 83 | static inline struct pinctrl * __must_check pinctrl_get(struct device *dev) | 83 | static inline struct pinctrl * __must_check pinctrl_get(struct device *dev) |
| 84 | { | 84 | { |
| 85 | return NULL; | 85 | return ERR_PTR(-ENOSYS); |
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | static inline void pinctrl_put(struct pinctrl *p) | 88 | static inline void pinctrl_put(struct pinctrl *p) |
| @@ -93,7 +93,7 @@ static inline struct pinctrl_state * __must_check pinctrl_lookup_state( | |||
| 93 | struct pinctrl *p, | 93 | struct pinctrl *p, |
| 94 | const char *name) | 94 | const char *name) |
| 95 | { | 95 | { |
| 96 | return NULL; | 96 | return ERR_PTR(-ENOSYS); |
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | static inline int pinctrl_select_state(struct pinctrl *p, | 99 | static inline int pinctrl_select_state(struct pinctrl *p, |
| @@ -104,7 +104,7 @@ static inline int pinctrl_select_state(struct pinctrl *p, | |||
| 104 | 104 | ||
| 105 | static inline struct pinctrl * __must_check devm_pinctrl_get(struct device *dev) | 105 | static inline struct pinctrl * __must_check devm_pinctrl_get(struct device *dev) |
| 106 | { | 106 | { |
| 107 | return NULL; | 107 | return ERR_PTR(-ENOSYS); |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | static inline void devm_pinctrl_put(struct pinctrl *p) | 110 | static inline void devm_pinctrl_put(struct pinctrl *p) |
diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h index d578a60eff23..fe65962b264f 100644 --- a/include/linux/pinctrl/pinconf-generic.h +++ b/include/linux/pinctrl/pinconf-generic.h | |||
| @@ -115,6 +115,18 @@ enum pin_config_param { | |||
| 115 | PIN_CONFIG_END = 0x7FFF, | 115 | PIN_CONFIG_END = 0x7FFF, |
| 116 | }; | 116 | }; |
| 117 | 117 | ||
| 118 | #ifdef CONFIG_DEBUG_FS | ||
| 119 | #define PCONFDUMP(a, b, c, d) { .param = a, .display = b, .format = c, \ | ||
| 120 | .has_arg = d } | ||
| 121 | |||
| 122 | struct pin_config_item { | ||
| 123 | const enum pin_config_param param; | ||
| 124 | const char * const display; | ||
| 125 | const char * const format; | ||
| 126 | bool has_arg; | ||
| 127 | }; | ||
| 128 | #endif /* CONFIG_DEBUG_FS */ | ||
| 129 | |||
| 118 | /* | 130 | /* |
| 119 | * Helpful configuration macro to be used in tables etc. | 131 | * Helpful configuration macro to be used in tables etc. |
| 120 | */ | 132 | */ |
| @@ -150,6 +162,12 @@ static inline unsigned long pinconf_to_config_packed(enum pin_config_param param | |||
| 150 | struct pinctrl_dev; | 162 | struct pinctrl_dev; |
| 151 | struct pinctrl_map; | 163 | struct pinctrl_map; |
| 152 | 164 | ||
| 165 | struct pinconf_generic_params { | ||
| 166 | const char * const property; | ||
| 167 | enum pin_config_param param; | ||
| 168 | u32 default_value; | ||
| 169 | }; | ||
| 170 | |||
| 153 | int pinconf_generic_dt_subnode_to_map(struct pinctrl_dev *pctldev, | 171 | int pinconf_generic_dt_subnode_to_map(struct pinctrl_dev *pctldev, |
| 154 | struct device_node *np, struct pinctrl_map **map, | 172 | struct device_node *np, struct pinctrl_map **map, |
| 155 | unsigned *reserved_maps, unsigned *num_maps, | 173 | unsigned *reserved_maps, unsigned *num_maps, |
| @@ -174,6 +192,17 @@ static inline int pinconf_generic_dt_node_to_map_pin( | |||
| 174 | PIN_MAP_TYPE_CONFIGS_PIN); | 192 | PIN_MAP_TYPE_CONFIGS_PIN); |
| 175 | } | 193 | } |
| 176 | 194 | ||
| 195 | static inline int pinconf_generic_dt_node_to_map_all( | ||
| 196 | struct pinctrl_dev *pctldev, struct device_node *np_config, | ||
| 197 | struct pinctrl_map **map, unsigned *num_maps) | ||
| 198 | { | ||
| 199 | /* | ||
| 200 | * passing the type as PIN_MAP_TYPE_INVALID causes the underlying parser | ||
| 201 | * to infer the map type from the DT properties used. | ||
| 202 | */ | ||
| 203 | return pinconf_generic_dt_node_to_map(pctldev, np_config, map, num_maps, | ||
| 204 | PIN_MAP_TYPE_INVALID); | ||
| 205 | } | ||
| 177 | #endif | 206 | #endif |
| 178 | 207 | ||
| 179 | #endif /* CONFIG_GENERIC_PINCONF */ | 208 | #endif /* CONFIG_GENERIC_PINCONF */ |
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index cc8e1aff0e28..66e4697516de 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h | |||
| @@ -24,6 +24,7 @@ struct pinctrl_dev; | |||
| 24 | struct pinctrl_map; | 24 | struct pinctrl_map; |
| 25 | struct pinmux_ops; | 25 | struct pinmux_ops; |
| 26 | struct pinconf_ops; | 26 | struct pinconf_ops; |
| 27 | struct pin_config_item; | ||
| 27 | struct gpio_chip; | 28 | struct gpio_chip; |
| 28 | struct device_node; | 29 | struct device_node; |
| 29 | 30 | ||
| @@ -117,6 +118,12 @@ struct pinctrl_ops { | |||
| 117 | * @confops: pin config operations vtable, if you support pin configuration in | 118 | * @confops: pin config operations vtable, if you support pin configuration in |
| 118 | * your driver | 119 | * your driver |
| 119 | * @owner: module providing the pin controller, used for refcounting | 120 | * @owner: module providing the pin controller, used for refcounting |
| 121 | * @num_custom_params: Number of driver-specific custom parameters to be parsed | ||
| 122 | * from the hardware description | ||
| 123 | * @custom_params: List of driver_specific custom parameters to be parsed from | ||
| 124 | * the hardware description | ||
| 125 | * @custom_conf_items: Information how to print @params in debugfs, must be | ||
| 126 | * the same size as the @custom_params, i.e. @num_custom_params | ||
| 120 | */ | 127 | */ |
| 121 | struct pinctrl_desc { | 128 | struct pinctrl_desc { |
| 122 | const char *name; | 129 | const char *name; |
| @@ -126,6 +133,11 @@ struct pinctrl_desc { | |||
| 126 | const struct pinmux_ops *pmxops; | 133 | const struct pinmux_ops *pmxops; |
| 127 | const struct pinconf_ops *confops; | 134 | const struct pinconf_ops *confops; |
| 128 | struct module *owner; | 135 | struct module *owner; |
| 136 | #ifdef CONFIG_GENERIC_PINCONF | ||
| 137 | unsigned int num_custom_params; | ||
| 138 | const struct pinconf_generic_params *custom_params; | ||
| 139 | const struct pin_config_item *custom_conf_items; | ||
| 140 | #endif | ||
| 129 | }; | 141 | }; |
| 130 | 142 | ||
| 131 | /* External interface to pin controller */ | 143 | /* External interface to pin controller */ |
diff --git a/include/linux/platform_data/ipmmu-vmsa.h b/include/linux/platform_data/ipmmu-vmsa.h deleted file mode 100644 index 5275b3ac6d37..000000000000 --- a/include/linux/platform_data/ipmmu-vmsa.h +++ /dev/null | |||
| @@ -1,24 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * IPMMU VMSA Platform Data | ||
| 3 | * | ||
| 4 | * Copyright (C) 2014 Renesas Electronics Corporation | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; version 2 of the License. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __IPMMU_VMSA_H__ | ||
| 12 | #define __IPMMU_VMSA_H__ | ||
| 13 | |||
| 14 | struct ipmmu_vmsa_master { | ||
| 15 | const char *name; | ||
| 16 | unsigned int utlb; | ||
| 17 | }; | ||
| 18 | |||
| 19 | struct ipmmu_vmsa_platform_data { | ||
| 20 | const struct ipmmu_vmsa_master *masters; | ||
| 21 | unsigned int num_masters; | ||
| 22 | }; | ||
| 23 | |||
| 24 | #endif /* __IPMMU_VMSA_H__ */ | ||
diff --git a/include/linux/platform_data/irda-sa11x0.h b/include/linux/platform_data/irda-sa11x0.h new file mode 100644 index 000000000000..38f77b5e56cf --- /dev/null +++ b/include/linux/platform_data/irda-sa11x0.h | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/include/asm/mach/irda.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2004 Russell King. | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | #ifndef __ASM_ARM_MACH_IRDA_H | ||
| 11 | #define __ASM_ARM_MACH_IRDA_H | ||
| 12 | |||
| 13 | struct irda_platform_data { | ||
| 14 | int (*startup)(struct device *); | ||
| 15 | void (*shutdown)(struct device *); | ||
| 16 | int (*set_power)(struct device *, unsigned int state); | ||
| 17 | void (*set_speed)(struct device *, unsigned int speed); | ||
| 18 | }; | ||
| 19 | |||
| 20 | #endif | ||
diff --git a/include/linux/platform_data/mmc-omap.h b/include/linux/platform_data/mmc-omap.h index 5c188f4e9bec..929469291406 100644 --- a/include/linux/platform_data/mmc-omap.h +++ b/include/linux/platform_data/mmc-omap.h | |||
| @@ -31,10 +31,6 @@ struct omap_mmc_platform_data { | |||
| 31 | void (*cleanup)(struct device *dev); | 31 | void (*cleanup)(struct device *dev); |
| 32 | void (*shutdown)(struct device *dev); | 32 | void (*shutdown)(struct device *dev); |
| 33 | 33 | ||
| 34 | /* To handle board related suspend/resume functionality for MMC */ | ||
| 35 | int (*suspend)(struct device *dev, int slot); | ||
| 36 | int (*resume)(struct device *dev, int slot); | ||
| 37 | |||
| 38 | /* Return context loss count due to PM states changing */ | 34 | /* Return context loss count due to PM states changing */ |
| 39 | int (*get_context_loss_count)(struct device *dev); | 35 | int (*get_context_loss_count)(struct device *dev); |
| 40 | 36 | ||
diff --git a/include/linux/platform_data/regulator-haptic.h b/include/linux/platform_data/regulator-haptic.h new file mode 100644 index 000000000000..5658e58e0738 --- /dev/null +++ b/include/linux/platform_data/regulator-haptic.h | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | /* | ||
| 2 | * Regulator Haptic Platform Data | ||
| 3 | * | ||
| 4 | * Copyright (c) 2014 Samsung Electronics Co., Ltd. | ||
| 5 | * Author: Jaewon Kim <jaewon02.kim@samsung.com> | ||
| 6 | * Author: Hyunhee Kim <hyunhee.kim@samsung.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef _REGULATOR_HAPTIC_H | ||
| 14 | #define _REGULATOR_HAPTIC_H | ||
| 15 | |||
| 16 | /* | ||
| 17 | * struct regulator_haptic_data - Platform device data | ||
| 18 | * | ||
| 19 | * @max_volt: maximum voltage value supplied to the haptic motor. | ||
| 20 | * <The unit of the voltage is a micro> | ||
| 21 | * @min_volt: minimum voltage value supplied to the haptic motor. | ||
| 22 | * <The unit of the voltage is a micro> | ||
| 23 | */ | ||
| 24 | struct regulator_haptic_data { | ||
| 25 | unsigned int max_volt; | ||
| 26 | unsigned int min_volt; | ||
| 27 | }; | ||
| 28 | |||
| 29 | #endif /* _REGULATOR_HAPTIC_H */ | ||
diff --git a/include/linux/platform_data/st21nfca.h b/include/linux/platform_data/st21nfca.h index 5087fff96d86..cc2bdafb0c69 100644 --- a/include/linux/platform_data/st21nfca.h +++ b/include/linux/platform_data/st21nfca.h | |||
| @@ -26,6 +26,8 @@ | |||
| 26 | struct st21nfca_nfc_platform_data { | 26 | struct st21nfca_nfc_platform_data { |
| 27 | unsigned int gpio_ena; | 27 | unsigned int gpio_ena; |
| 28 | unsigned int irq_polarity; | 28 | unsigned int irq_polarity; |
| 29 | bool is_ese_present; | ||
| 30 | bool is_uicc_present; | ||
| 29 | }; | 31 | }; |
| 30 | 32 | ||
| 31 | #endif /* _ST21NFCA_HCI_H_ */ | 33 | #endif /* _ST21NFCA_HCI_H_ */ |
diff --git a/include/linux/platform_data/st21nfcb.h b/include/linux/platform_data/st21nfcb.h index c3b432f5b63e..b023373d9874 100644 --- a/include/linux/platform_data/st21nfcb.h +++ b/include/linux/platform_data/st21nfcb.h | |||
| @@ -19,8 +19,6 @@ | |||
| 19 | #ifndef _ST21NFCB_NCI_H_ | 19 | #ifndef _ST21NFCB_NCI_H_ |
| 20 | #define _ST21NFCB_NCI_H_ | 20 | #define _ST21NFCB_NCI_H_ |
| 21 | 21 | ||
| 22 | #include <linux/i2c.h> | ||
| 23 | |||
| 24 | #define ST21NFCB_NCI_DRIVER_NAME "st21nfcb_nci" | 22 | #define ST21NFCB_NCI_DRIVER_NAME "st21nfcb_nci" |
| 25 | 23 | ||
| 26 | struct st21nfcb_nfc_platform_data { | 24 | struct st21nfcb_nfc_platform_data { |
| @@ -28,4 +26,4 @@ struct st21nfcb_nfc_platform_data { | |||
| 28 | unsigned int irq_polarity; | 26 | unsigned int irq_polarity; |
| 29 | }; | 27 | }; |
| 30 | 28 | ||
| 31 | #endif /* _ST21NFCA_HCI_H_ */ | 29 | #endif /* _ST21NFCB_NCI_H_ */ |
diff --git a/include/linux/platform_data/tpm_stm_st33.h b/include/linux/platform_data/tpm_stm_st33.h new file mode 100644 index 000000000000..ff75310c0f47 --- /dev/null +++ b/include/linux/platform_data/tpm_stm_st33.h | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | /* | ||
| 2 | * STMicroelectronics TPM I2C Linux driver for TPM ST33ZP24 | ||
| 3 | * Copyright (C) 2009, 2010 STMicroelectronics | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation; either version 2 of the License, or | ||
| 8 | * (at your option) any later version. | ||
| 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 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program; if not, see <http://www.gnu.org/licenses/>. | ||
| 17 | * | ||
| 18 | * STMicroelectronics version 1.2.0, Copyright (C) 2010 | ||
| 19 | * STMicroelectronics comes with ABSOLUTELY NO WARRANTY. | ||
| 20 | * This is free software, and you are welcome to redistribute it | ||
| 21 | * under certain conditions. | ||
| 22 | * | ||
| 23 | * @Author: Christophe RICARD tpmsupport@st.com | ||
| 24 | * | ||
| 25 | * @File: stm_st33_tpm.h | ||
| 26 | * | ||
| 27 | * @Date: 09/15/2010 | ||
| 28 | */ | ||
| 29 | #ifndef __STM_ST33_TPM_H__ | ||
| 30 | #define __STM_ST33_TPM_H__ | ||
| 31 | |||
| 32 | #define TPM_ST33_I2C "st33zp24-i2c" | ||
| 33 | #define TPM_ST33_SPI "st33zp24-spi" | ||
| 34 | |||
| 35 | struct st33zp24_platform_data { | ||
| 36 | int io_lpcpd; | ||
| 37 | }; | ||
| 38 | |||
| 39 | #endif /* __STM_ST33_TPM_H__ */ | ||
diff --git a/include/linux/platform_data/vsp1.h b/include/linux/platform_data/vsp1.h deleted file mode 100644 index 63170e2614b3..000000000000 --- a/include/linux/platform_data/vsp1.h +++ /dev/null | |||
| @@ -1,27 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * vsp1.h -- R-Car VSP1 Platform Data | ||
| 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 | #ifndef __PLATFORM_VSP1_H__ | ||
| 14 | #define __PLATFORM_VSP1_H__ | ||
| 15 | |||
| 16 | #define VSP1_HAS_LIF (1 << 0) | ||
| 17 | #define VSP1_HAS_LUT (1 << 1) | ||
| 18 | #define VSP1_HAS_SRU (1 << 2) | ||
| 19 | |||
| 20 | struct vsp1_platform_data { | ||
| 21 | unsigned int features; | ||
| 22 | unsigned int rpf_count; | ||
| 23 | unsigned int uds_count; | ||
| 24 | unsigned int wpf_count; | ||
| 25 | }; | ||
| 26 | |||
| 27 | #endif /* __PLATFORM_VSP1_H__ */ | ||
diff --git a/include/linux/pm.h b/include/linux/pm.h index 8b5976364619..e2f1be6dd9dd 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
| @@ -597,7 +597,7 @@ struct dev_pm_info { | |||
| 597 | 597 | ||
| 598 | extern void update_pm_runtime_accounting(struct device *dev); | 598 | extern void update_pm_runtime_accounting(struct device *dev); |
| 599 | extern int dev_pm_get_subsys_data(struct device *dev); | 599 | extern int dev_pm_get_subsys_data(struct device *dev); |
| 600 | extern int dev_pm_put_subsys_data(struct device *dev); | 600 | extern void dev_pm_put_subsys_data(struct device *dev); |
| 601 | 601 | ||
| 602 | /* | 602 | /* |
| 603 | * Power domains provide callbacks that are executed during system suspend, | 603 | * Power domains provide callbacks that are executed during system suspend, |
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index a9edab2c787a..080e778118ba 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h | |||
| @@ -113,8 +113,6 @@ struct generic_pm_domain_data { | |||
| 113 | struct pm_domain_data base; | 113 | struct pm_domain_data base; |
| 114 | struct gpd_timing_data td; | 114 | struct gpd_timing_data td; |
| 115 | struct notifier_block nb; | 115 | struct notifier_block nb; |
| 116 | struct mutex lock; | ||
| 117 | unsigned int refcount; | ||
| 118 | int need_restore; | 116 | int need_restore; |
| 119 | }; | 117 | }; |
| 120 | 118 | ||
| @@ -140,7 +138,6 @@ extern int __pm_genpd_name_add_device(const char *domain_name, | |||
| 140 | 138 | ||
| 141 | extern int pm_genpd_remove_device(struct generic_pm_domain *genpd, | 139 | extern int pm_genpd_remove_device(struct generic_pm_domain *genpd, |
| 142 | struct device *dev); | 140 | struct device *dev); |
| 143 | extern void pm_genpd_dev_need_restore(struct device *dev, bool val); | ||
| 144 | extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, | 141 | extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, |
| 145 | struct generic_pm_domain *new_subdomain); | 142 | struct generic_pm_domain *new_subdomain); |
| 146 | extern int pm_genpd_add_subdomain_names(const char *master_name, | 143 | extern int pm_genpd_add_subdomain_names(const char *master_name, |
| @@ -187,7 +184,6 @@ static inline int pm_genpd_remove_device(struct generic_pm_domain *genpd, | |||
| 187 | { | 184 | { |
| 188 | return -ENOSYS; | 185 | return -ENOSYS; |
| 189 | } | 186 | } |
| 190 | static inline void pm_genpd_dev_need_restore(struct device *dev, bool val) {} | ||
| 191 | static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, | 187 | static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, |
| 192 | struct generic_pm_domain *new_sd) | 188 | struct generic_pm_domain *new_sd) |
| 193 | { | 189 | { |
diff --git a/include/linux/power/charger-manager.h b/include/linux/power/charger-manager.h index e97fc656a058..416ebeb6ee1e 100644 --- a/include/linux/power/charger-manager.h +++ b/include/linux/power/charger-manager.h | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | #include <linux/power_supply.h> | 18 | #include <linux/power_supply.h> |
| 19 | #include <linux/extcon.h> | 19 | #include <linux/extcon.h> |
| 20 | #include <linux/alarmtimer.h> | ||
| 20 | 21 | ||
| 21 | enum data_source { | 22 | enum data_source { |
| 22 | CM_BATTERY_PRESENT, | 23 | CM_BATTERY_PRESENT, |
| @@ -45,29 +46,6 @@ enum cm_event_types { | |||
| 45 | }; | 46 | }; |
| 46 | 47 | ||
| 47 | /** | 48 | /** |
| 48 | * struct charger_global_desc | ||
| 49 | * @rtc_name: the name of RTC used to wake up the system from suspend. | ||
| 50 | * @rtc_only_wakeup: | ||
| 51 | * If the system is woken up by waekup-sources other than the RTC or | ||
| 52 | * callbacks, Charger Manager should recognize with | ||
| 53 | * rtc_only_wakeup() returning false. | ||
| 54 | * If the RTC given to CM is the only wakeup reason, | ||
| 55 | * rtc_only_wakeup should return true. | ||
| 56 | * @assume_timer_stops_in_suspend: | ||
| 57 | * Assume that the jiffy timer stops in suspend-to-RAM. | ||
| 58 | * When enabled, CM does not rely on jiffies value in | ||
| 59 | * suspend_again and assumes that jiffies value does not | ||
| 60 | * change during suspend. | ||
| 61 | */ | ||
| 62 | struct charger_global_desc { | ||
| 63 | char *rtc_name; | ||
| 64 | |||
| 65 | bool (*rtc_only_wakeup)(void); | ||
| 66 | |||
| 67 | bool assume_timer_stops_in_suspend; | ||
| 68 | }; | ||
| 69 | |||
| 70 | /** | ||
| 71 | * struct charger_cable | 49 | * struct charger_cable |
| 72 | * @extcon_name: the name of extcon device. | 50 | * @extcon_name: the name of extcon device. |
| 73 | * @name: the name of charger cable(external connector). | 51 | * @name: the name of charger cable(external connector). |
| @@ -266,22 +244,14 @@ struct charger_manager { | |||
| 266 | char psy_name_buf[PSY_NAME_MAX + 1]; | 244 | char psy_name_buf[PSY_NAME_MAX + 1]; |
| 267 | struct power_supply charger_psy; | 245 | struct power_supply charger_psy; |
| 268 | 246 | ||
| 269 | bool status_save_ext_pwr_inserted; | ||
| 270 | bool status_save_batt; | ||
| 271 | |||
| 272 | u64 charging_start_time; | 247 | u64 charging_start_time; |
| 273 | u64 charging_end_time; | 248 | u64 charging_end_time; |
| 274 | }; | 249 | }; |
| 275 | 250 | ||
| 276 | #ifdef CONFIG_CHARGER_MANAGER | 251 | #ifdef CONFIG_CHARGER_MANAGER |
| 277 | extern int setup_charger_manager(struct charger_global_desc *gd); | ||
| 278 | extern bool cm_suspend_again(void); | ||
| 279 | extern void cm_notify_event(struct power_supply *psy, | 252 | extern void cm_notify_event(struct power_supply *psy, |
| 280 | enum cm_event_types type, char *msg); | 253 | enum cm_event_types type, char *msg); |
| 281 | #else | 254 | #else |
| 282 | static inline int setup_charger_manager(struct charger_global_desc *gd) | ||
| 283 | { return 0; } | ||
| 284 | static inline bool cm_suspend_again(void) { return false; } | ||
| 285 | static inline void cm_notify_event(struct power_supply *psy, | 255 | static inline void cm_notify_event(struct power_supply *psy, |
| 286 | enum cm_event_types type, char *msg) { } | 256 | enum cm_event_types type, char *msg) { } |
| 287 | #endif | 257 | #endif |
diff --git a/include/linux/printk.h b/include/linux/printk.h index c8f170324e64..4d5bf5726578 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h | |||
| @@ -10,9 +10,6 @@ | |||
| 10 | extern const char linux_banner[]; | 10 | extern const char linux_banner[]; |
| 11 | extern const char linux_proc_banner[]; | 11 | extern const char linux_proc_banner[]; |
| 12 | 12 | ||
| 13 | extern char *log_buf_addr_get(void); | ||
| 14 | extern u32 log_buf_len_get(void); | ||
| 15 | |||
| 16 | static inline int printk_get_level(const char *buffer) | 13 | static inline int printk_get_level(const char *buffer) |
| 17 | { | 14 | { |
| 18 | if (buffer[0] == KERN_SOH_ASCII && buffer[1]) { | 15 | if (buffer[0] == KERN_SOH_ASCII && buffer[1]) { |
| @@ -163,6 +160,8 @@ extern int kptr_restrict; | |||
| 163 | 160 | ||
| 164 | extern void wake_up_klogd(void); | 161 | extern void wake_up_klogd(void); |
| 165 | 162 | ||
| 163 | char *log_buf_addr_get(void); | ||
| 164 | u32 log_buf_len_get(void); | ||
| 166 | void log_buf_kexec_setup(void); | 165 | void log_buf_kexec_setup(void); |
| 167 | void __init setup_log_buf(int early); | 166 | void __init setup_log_buf(int early); |
| 168 | void dump_stack_set_arch_desc(const char *fmt, ...); | 167 | void dump_stack_set_arch_desc(const char *fmt, ...); |
| @@ -198,6 +197,16 @@ static inline void wake_up_klogd(void) | |||
| 198 | { | 197 | { |
| 199 | } | 198 | } |
| 200 | 199 | ||
| 200 | static inline char *log_buf_addr_get(void) | ||
| 201 | { | ||
| 202 | return NULL; | ||
| 203 | } | ||
| 204 | |||
| 205 | static inline u32 log_buf_len_get(void) | ||
| 206 | { | ||
| 207 | return 0; | ||
| 208 | } | ||
| 209 | |||
| 201 | static inline void log_buf_kexec_setup(void) | 210 | static inline void log_buf_kexec_setup(void) |
| 202 | { | 211 | { |
| 203 | } | 212 | } |
diff --git a/include/linux/pstore.h b/include/linux/pstore.h index ece0c6bbfcc5..8884f6e507f7 100644 --- a/include/linux/pstore.h +++ b/include/linux/pstore.h | |||
| @@ -39,6 +39,7 @@ enum pstore_type_id { | |||
| 39 | PSTORE_TYPE_PPC_RTAS = 4, | 39 | PSTORE_TYPE_PPC_RTAS = 4, |
| 40 | PSTORE_TYPE_PPC_OF = 5, | 40 | PSTORE_TYPE_PPC_OF = 5, |
| 41 | PSTORE_TYPE_PPC_COMMON = 6, | 41 | PSTORE_TYPE_PPC_COMMON = 6, |
| 42 | PSTORE_TYPE_PMSG = 7, | ||
| 42 | PSTORE_TYPE_UNKNOWN = 255 | 43 | PSTORE_TYPE_UNKNOWN = 255 |
| 43 | }; | 44 | }; |
| 44 | 45 | ||
diff --git a/include/linux/pstore_ram.h b/include/linux/pstore_ram.h index 4af3fdc85b01..9c9d6c154c8e 100644 --- a/include/linux/pstore_ram.h +++ b/include/linux/pstore_ram.h | |||
| @@ -81,6 +81,7 @@ struct ramoops_platform_data { | |||
| 81 | unsigned long record_size; | 81 | unsigned long record_size; |
| 82 | unsigned long console_size; | 82 | unsigned long console_size; |
| 83 | unsigned long ftrace_size; | 83 | unsigned long ftrace_size; |
| 84 | unsigned long pmsg_size; | ||
| 84 | int dump_oops; | 85 | int dump_oops; |
| 85 | struct persistent_ram_ecc_info ecc_info; | 86 | struct persistent_ram_ecc_info ecc_info; |
| 86 | }; | 87 | }; |
diff --git a/include/linux/pxa2xx_ssp.h b/include/linux/pxa2xx_ssp.h index 77aed9ea1d26..dab545bb66b3 100644 --- a/include/linux/pxa2xx_ssp.h +++ b/include/linux/pxa2xx_ssp.h | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | #define SSDR (0x10) /* SSP Data Write/Data Read Register */ | 37 | #define SSDR (0x10) /* SSP Data Write/Data Read Register */ |
| 38 | 38 | ||
| 39 | #define SSTO (0x28) /* SSP Time Out Register */ | 39 | #define SSTO (0x28) /* SSP Time Out Register */ |
| 40 | #define DDS_RATE (0x28) /* SSP DDS Clock Rate Register (Intel Quark) */ | ||
| 40 | #define SSPSP (0x2C) /* SSP Programmable Serial Protocol */ | 41 | #define SSPSP (0x2C) /* SSP Programmable Serial Protocol */ |
| 41 | #define SSTSA (0x30) /* SSP Tx Timeslot Active */ | 42 | #define SSTSA (0x30) /* SSP Tx Timeslot Active */ |
| 42 | #define SSRSA (0x34) /* SSP Rx Timeslot Active */ | 43 | #define SSRSA (0x34) /* SSP Rx Timeslot Active */ |
diff --git a/include/linux/quota.h b/include/linux/quota.h index 50978b781a19..d534e8ed308a 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
| @@ -216,19 +216,21 @@ struct mem_dqinfo { | |||
| 216 | unsigned long dqi_flags; | 216 | unsigned long dqi_flags; |
| 217 | unsigned int dqi_bgrace; | 217 | unsigned int dqi_bgrace; |
| 218 | unsigned int dqi_igrace; | 218 | unsigned int dqi_igrace; |
| 219 | qsize_t dqi_maxblimit; | 219 | qsize_t dqi_max_spc_limit; |
| 220 | qsize_t dqi_maxilimit; | 220 | qsize_t dqi_max_ino_limit; |
| 221 | void *dqi_priv; | 221 | void *dqi_priv; |
| 222 | }; | 222 | }; |
| 223 | 223 | ||
| 224 | struct super_block; | 224 | struct super_block; |
| 225 | 225 | ||
| 226 | #define DQF_MASK 0xffff /* Mask for format specific flags */ | 226 | /* Mask for flags passed to userspace */ |
| 227 | #define DQF_GETINFO_MASK 0x1ffff /* Mask for flags passed to userspace */ | 227 | #define DQF_GETINFO_MASK (DQF_ROOT_SQUASH | DQF_SYS_FILE) |
| 228 | #define DQF_SETINFO_MASK 0xffff /* Mask for flags modifiable from userspace */ | 228 | /* Mask for flags modifiable from userspace */ |
| 229 | #define DQF_SYS_FILE_B 16 | 229 | #define DQF_SETINFO_MASK DQF_ROOT_SQUASH |
| 230 | #define DQF_SYS_FILE (1 << DQF_SYS_FILE_B) /* Quota file stored as system file */ | 230 | |
| 231 | #define DQF_INFO_DIRTY_B 31 | 231 | enum { |
| 232 | DQF_INFO_DIRTY_B = DQF_PRIVATE, | ||
| 233 | }; | ||
| 232 | #define DQF_INFO_DIRTY (1 << DQF_INFO_DIRTY_B) /* Is info dirty? */ | 234 | #define DQF_INFO_DIRTY (1 << DQF_INFO_DIRTY_B) /* Is info dirty? */ |
| 233 | 235 | ||
| 234 | extern void mark_info_dirty(struct super_block *sb, int type); | 236 | extern void mark_info_dirty(struct super_block *sb, int type); |
| @@ -321,18 +323,61 @@ struct dquot_operations { | |||
| 321 | 323 | ||
| 322 | struct path; | 324 | struct path; |
| 323 | 325 | ||
| 326 | /* Structure for communicating via ->get_dqblk() & ->set_dqblk() */ | ||
| 327 | struct qc_dqblk { | ||
| 328 | int d_fieldmask; /* mask of fields to change in ->set_dqblk() */ | ||
| 329 | u64 d_spc_hardlimit; /* absolute limit on used space */ | ||
| 330 | u64 d_spc_softlimit; /* preferred limit on used space */ | ||
| 331 | u64 d_ino_hardlimit; /* maximum # allocated inodes */ | ||
| 332 | u64 d_ino_softlimit; /* preferred inode limit */ | ||
| 333 | u64 d_space; /* Space owned by the user */ | ||
| 334 | u64 d_ino_count; /* # inodes owned by the user */ | ||
| 335 | s64 d_ino_timer; /* zero if within inode limits */ | ||
| 336 | /* if not, we refuse service */ | ||
| 337 | s64 d_spc_timer; /* similar to above; for space */ | ||
| 338 | int d_ino_warns; /* # warnings issued wrt num inodes */ | ||
| 339 | int d_spc_warns; /* # warnings issued wrt used space */ | ||
| 340 | u64 d_rt_spc_hardlimit; /* absolute limit on realtime space */ | ||
| 341 | u64 d_rt_spc_softlimit; /* preferred limit on RT space */ | ||
| 342 | u64 d_rt_space; /* realtime space owned */ | ||
| 343 | s64 d_rt_spc_timer; /* similar to above; for RT space */ | ||
| 344 | int d_rt_spc_warns; /* # warnings issued wrt RT space */ | ||
| 345 | }; | ||
| 346 | |||
| 347 | /* Field specifiers for ->set_dqblk() in struct qc_dqblk */ | ||
| 348 | #define QC_INO_SOFT (1<<0) | ||
| 349 | #define QC_INO_HARD (1<<1) | ||
| 350 | #define QC_SPC_SOFT (1<<2) | ||
| 351 | #define QC_SPC_HARD (1<<3) | ||
| 352 | #define QC_RT_SPC_SOFT (1<<4) | ||
| 353 | #define QC_RT_SPC_HARD (1<<5) | ||
| 354 | #define QC_LIMIT_MASK (QC_INO_SOFT | QC_INO_HARD | QC_SPC_SOFT | QC_SPC_HARD | \ | ||
| 355 | QC_RT_SPC_SOFT | QC_RT_SPC_HARD) | ||
| 356 | #define QC_SPC_TIMER (1<<6) | ||
| 357 | #define QC_INO_TIMER (1<<7) | ||
| 358 | #define QC_RT_SPC_TIMER (1<<8) | ||
| 359 | #define QC_TIMER_MASK (QC_SPC_TIMER | QC_INO_TIMER | QC_RT_SPC_TIMER) | ||
| 360 | #define QC_SPC_WARNS (1<<9) | ||
| 361 | #define QC_INO_WARNS (1<<10) | ||
| 362 | #define QC_RT_SPC_WARNS (1<<11) | ||
| 363 | #define QC_WARNS_MASK (QC_SPC_WARNS | QC_INO_WARNS | QC_RT_SPC_WARNS) | ||
| 364 | #define QC_SPACE (1<<12) | ||
| 365 | #define QC_INO_COUNT (1<<13) | ||
| 366 | #define QC_RT_SPACE (1<<14) | ||
| 367 | #define QC_ACCT_MASK (QC_SPACE | QC_INO_COUNT | QC_RT_SPACE) | ||
| 368 | |||
| 324 | /* Operations handling requests from userspace */ | 369 | /* Operations handling requests from userspace */ |
| 325 | struct quotactl_ops { | 370 | struct quotactl_ops { |
| 326 | int (*quota_on)(struct super_block *, int, int, struct path *); | 371 | int (*quota_on)(struct super_block *, int, int, struct path *); |
| 327 | int (*quota_on_meta)(struct super_block *, int, int); | ||
| 328 | int (*quota_off)(struct super_block *, int); | 372 | int (*quota_off)(struct super_block *, int); |
| 373 | int (*quota_enable)(struct super_block *, unsigned int); | ||
| 374 | int (*quota_disable)(struct super_block *, unsigned int); | ||
| 329 | int (*quota_sync)(struct super_block *, int); | 375 | int (*quota_sync)(struct super_block *, int); |
| 330 | int (*get_info)(struct super_block *, int, struct if_dqinfo *); | 376 | int (*get_info)(struct super_block *, int, struct if_dqinfo *); |
| 331 | int (*set_info)(struct super_block *, int, struct if_dqinfo *); | 377 | int (*set_info)(struct super_block *, int, struct if_dqinfo *); |
| 332 | int (*get_dqblk)(struct super_block *, struct kqid, struct fs_disk_quota *); | 378 | int (*get_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *); |
| 333 | int (*set_dqblk)(struct super_block *, struct kqid, struct fs_disk_quota *); | 379 | int (*set_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *); |
| 334 | int (*get_xstate)(struct super_block *, struct fs_quota_stat *); | 380 | int (*get_xstate)(struct super_block *, struct fs_quota_stat *); |
| 335 | int (*set_xstate)(struct super_block *, unsigned int, int); | ||
| 336 | int (*get_xstatev)(struct super_block *, struct fs_quota_statv *); | 381 | int (*get_xstatev)(struct super_block *, struct fs_quota_statv *); |
| 337 | int (*rm_xquota)(struct super_block *, unsigned int); | 382 | int (*rm_xquota)(struct super_block *, unsigned int); |
| 338 | }; | 383 | }; |
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index f23538a6e411..df73258cca47 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h | |||
| @@ -98,9 +98,9 @@ int dquot_quota_sync(struct super_block *sb, int type); | |||
| 98 | int dquot_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); | 98 | int dquot_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); |
| 99 | int dquot_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); | 99 | int dquot_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); |
| 100 | int dquot_get_dqblk(struct super_block *sb, struct kqid id, | 100 | int dquot_get_dqblk(struct super_block *sb, struct kqid id, |
| 101 | struct fs_disk_quota *di); | 101 | struct qc_dqblk *di); |
| 102 | int dquot_set_dqblk(struct super_block *sb, struct kqid id, | 102 | int dquot_set_dqblk(struct super_block *sb, struct kqid id, |
| 103 | struct fs_disk_quota *di); | 103 | struct qc_dqblk *di); |
| 104 | 104 | ||
| 105 | int __dquot_transfer(struct inode *inode, struct dquot **transfer_to); | 105 | int __dquot_transfer(struct inode *inode, struct dquot **transfer_to); |
| 106 | int dquot_transfer(struct inode *inode, struct iattr *iattr); | 106 | int dquot_transfer(struct inode *inode, struct iattr *iattr); |
| @@ -166,6 +166,7 @@ static inline bool sb_has_quota_active(struct super_block *sb, int type) | |||
| 166 | */ | 166 | */ |
| 167 | extern const struct dquot_operations dquot_operations; | 167 | extern const struct dquot_operations dquot_operations; |
| 168 | extern const struct quotactl_ops dquot_quotactl_ops; | 168 | extern const struct quotactl_ops dquot_quotactl_ops; |
| 169 | extern const struct quotactl_ops dquot_quotactl_sysfile_ops; | ||
| 169 | 170 | ||
| 170 | #else | 171 | #else |
| 171 | 172 | ||
| @@ -386,4 +387,6 @@ static inline void dquot_release_reservation_block(struct inode *inode, | |||
| 386 | __dquot_free_space(inode, nr << inode->i_blkbits, DQUOT_SPACE_RESERVE); | 387 | __dquot_free_space(inode, nr << inode->i_blkbits, DQUOT_SPACE_RESERVE); |
| 387 | } | 388 | } |
| 388 | 389 | ||
| 390 | unsigned int qtype_enforce_flag(int type); | ||
| 391 | |||
| 389 | #endif /* _LINUX_QUOTAOPS_ */ | 392 | #endif /* _LINUX_QUOTAOPS_ */ |
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index 529bc946f450..a18b16f1dc0e 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
| @@ -524,11 +524,11 @@ static inline void hlist_add_behind_rcu(struct hlist_node *n, | |||
| 524 | * @member: the name of the hlist_node within the struct. | 524 | * @member: the name of the hlist_node within the struct. |
| 525 | */ | 525 | */ |
| 526 | #define hlist_for_each_entry_continue_rcu(pos, member) \ | 526 | #define hlist_for_each_entry_continue_rcu(pos, member) \ |
| 527 | for (pos = hlist_entry_safe(rcu_dereference((pos)->member.next),\ | 527 | for (pos = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu( \ |
| 528 | typeof(*(pos)), member); \ | 528 | &(pos)->member)), typeof(*(pos)), member); \ |
| 529 | pos; \ | 529 | pos; \ |
| 530 | pos = hlist_entry_safe(rcu_dereference((pos)->member.next),\ | 530 | pos = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu( \ |
| 531 | typeof(*(pos)), member)) | 531 | &(pos)->member)), typeof(*(pos)), member)) |
| 532 | 532 | ||
| 533 | /** | 533 | /** |
| 534 | * hlist_for_each_entry_continue_rcu_bh - iterate over a hlist continuing after current point | 534 | * hlist_for_each_entry_continue_rcu_bh - iterate over a hlist continuing after current point |
| @@ -536,11 +536,11 @@ static inline void hlist_add_behind_rcu(struct hlist_node *n, | |||
| 536 | * @member: the name of the hlist_node within the struct. | 536 | * @member: the name of the hlist_node within the struct. |
| 537 | */ | 537 | */ |
| 538 | #define hlist_for_each_entry_continue_rcu_bh(pos, member) \ | 538 | #define hlist_for_each_entry_continue_rcu_bh(pos, member) \ |
| 539 | for (pos = hlist_entry_safe(rcu_dereference_bh((pos)->member.next),\ | 539 | for (pos = hlist_entry_safe(rcu_dereference_bh(hlist_next_rcu( \ |
| 540 | typeof(*(pos)), member); \ | 540 | &(pos)->member)), typeof(*(pos)), member); \ |
| 541 | pos; \ | 541 | pos; \ |
| 542 | pos = hlist_entry_safe(rcu_dereference_bh((pos)->member.next),\ | 542 | pos = hlist_entry_safe(rcu_dereference_bh(hlist_next_rcu( \ |
| 543 | typeof(*(pos)), member)) | 543 | &(pos)->member)), typeof(*(pos)), member)) |
| 544 | 544 | ||
| 545 | /** | 545 | /** |
| 546 | * hlist_for_each_entry_from_rcu - iterate over a hlist continuing from current point | 546 | * hlist_for_each_entry_from_rcu - iterate over a hlist continuing from current point |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index ed4f5939a452..78097491cd99 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
| @@ -331,12 +331,13 @@ static inline void rcu_init_nohz(void) | |||
| 331 | extern struct srcu_struct tasks_rcu_exit_srcu; | 331 | extern struct srcu_struct tasks_rcu_exit_srcu; |
| 332 | #define rcu_note_voluntary_context_switch(t) \ | 332 | #define rcu_note_voluntary_context_switch(t) \ |
| 333 | do { \ | 333 | do { \ |
| 334 | rcu_all_qs(); \ | ||
| 334 | if (ACCESS_ONCE((t)->rcu_tasks_holdout)) \ | 335 | if (ACCESS_ONCE((t)->rcu_tasks_holdout)) \ |
| 335 | ACCESS_ONCE((t)->rcu_tasks_holdout) = false; \ | 336 | ACCESS_ONCE((t)->rcu_tasks_holdout) = false; \ |
| 336 | } while (0) | 337 | } while (0) |
| 337 | #else /* #ifdef CONFIG_TASKS_RCU */ | 338 | #else /* #ifdef CONFIG_TASKS_RCU */ |
| 338 | #define TASKS_RCU(x) do { } while (0) | 339 | #define TASKS_RCU(x) do { } while (0) |
| 339 | #define rcu_note_voluntary_context_switch(t) do { } while (0) | 340 | #define rcu_note_voluntary_context_switch(t) rcu_all_qs() |
| 340 | #endif /* #else #ifdef CONFIG_TASKS_RCU */ | 341 | #endif /* #else #ifdef CONFIG_TASKS_RCU */ |
| 341 | 342 | ||
| 342 | /** | 343 | /** |
| @@ -582,11 +583,11 @@ static inline void rcu_preempt_sleep_check(void) | |||
| 582 | }) | 583 | }) |
| 583 | #define __rcu_dereference_check(p, c, space) \ | 584 | #define __rcu_dereference_check(p, c, space) \ |
| 584 | ({ \ | 585 | ({ \ |
| 585 | typeof(*p) *_________p1 = (typeof(*p) *__force)ACCESS_ONCE(p); \ | 586 | /* Dependency order vs. p above. */ \ |
| 587 | typeof(*p) *________p1 = (typeof(*p) *__force)lockless_dereference(p); \ | ||
| 586 | rcu_lockdep_assert(c, "suspicious rcu_dereference_check() usage"); \ | 588 | rcu_lockdep_assert(c, "suspicious rcu_dereference_check() usage"); \ |
| 587 | rcu_dereference_sparse(p, space); \ | 589 | rcu_dereference_sparse(p, space); \ |
| 588 | smp_read_barrier_depends(); /* Dependency order vs. p above. */ \ | 590 | ((typeof(*p) __force __kernel *)(________p1)); \ |
| 589 | ((typeof(*p) __force __kernel *)(_________p1)); \ | ||
| 590 | }) | 591 | }) |
| 591 | #define __rcu_dereference_protected(p, c, space) \ | 592 | #define __rcu_dereference_protected(p, c, space) \ |
| 592 | ({ \ | 593 | ({ \ |
| @@ -603,10 +604,10 @@ static inline void rcu_preempt_sleep_check(void) | |||
| 603 | }) | 604 | }) |
| 604 | #define __rcu_dereference_index_check(p, c) \ | 605 | #define __rcu_dereference_index_check(p, c) \ |
| 605 | ({ \ | 606 | ({ \ |
| 606 | typeof(p) _________p1 = ACCESS_ONCE(p); \ | 607 | /* Dependency order vs. p above. */ \ |
| 608 | typeof(p) _________p1 = lockless_dereference(p); \ | ||
| 607 | rcu_lockdep_assert(c, \ | 609 | rcu_lockdep_assert(c, \ |
| 608 | "suspicious rcu_dereference_index_check() usage"); \ | 610 | "suspicious rcu_dereference_index_check() usage"); \ |
| 609 | smp_read_barrier_depends(); /* Dependency order vs. p above. */ \ | ||
| 610 | (_________p1); \ | 611 | (_________p1); \ |
| 611 | }) | 612 | }) |
| 612 | 613 | ||
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index 0e5366200154..937edaeb150d 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h | |||
| @@ -92,17 +92,49 @@ static inline void rcu_virt_note_context_switch(int cpu) | |||
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | /* | 94 | /* |
| 95 | * Return the number of grace periods. | 95 | * Return the number of grace periods started. |
| 96 | */ | 96 | */ |
| 97 | static inline long rcu_batches_completed(void) | 97 | static inline unsigned long rcu_batches_started(void) |
| 98 | { | 98 | { |
| 99 | return 0; | 99 | return 0; |
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | /* | 102 | /* |
| 103 | * Return the number of bottom-half grace periods. | 103 | * Return the number of bottom-half grace periods started. |
| 104 | */ | 104 | */ |
| 105 | static inline long rcu_batches_completed_bh(void) | 105 | static inline unsigned long rcu_batches_started_bh(void) |
| 106 | { | ||
| 107 | return 0; | ||
| 108 | } | ||
| 109 | |||
| 110 | /* | ||
| 111 | * Return the number of sched grace periods started. | ||
| 112 | */ | ||
| 113 | static inline unsigned long rcu_batches_started_sched(void) | ||
| 114 | { | ||
| 115 | return 0; | ||
| 116 | } | ||
| 117 | |||
| 118 | /* | ||
| 119 | * Return the number of grace periods completed. | ||
| 120 | */ | ||
| 121 | static inline unsigned long rcu_batches_completed(void) | ||
| 122 | { | ||
| 123 | return 0; | ||
| 124 | } | ||
| 125 | |||
| 126 | /* | ||
| 127 | * Return the number of bottom-half grace periods completed. | ||
| 128 | */ | ||
| 129 | static inline unsigned long rcu_batches_completed_bh(void) | ||
| 130 | { | ||
| 131 | return 0; | ||
| 132 | } | ||
| 133 | |||
| 134 | /* | ||
| 135 | * Return the number of sched grace periods completed. | ||
| 136 | */ | ||
| 137 | static inline unsigned long rcu_batches_completed_sched(void) | ||
| 106 | { | 138 | { |
| 107 | return 0; | 139 | return 0; |
| 108 | } | 140 | } |
| @@ -154,7 +186,10 @@ static inline bool rcu_is_watching(void) | |||
| 154 | return true; | 186 | return true; |
| 155 | } | 187 | } |
| 156 | 188 | ||
| 157 | |||
| 158 | #endif /* #else defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) */ | 189 | #endif /* #else defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) */ |
| 159 | 190 | ||
| 191 | static inline void rcu_all_qs(void) | ||
| 192 | { | ||
| 193 | } | ||
| 194 | |||
| 160 | #endif /* __LINUX_RCUTINY_H */ | 195 | #endif /* __LINUX_RCUTINY_H */ |
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 52953790dcca..d2e583a6aaca 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
| @@ -81,9 +81,12 @@ void cond_synchronize_rcu(unsigned long oldstate); | |||
| 81 | 81 | ||
| 82 | extern unsigned long rcutorture_testseq; | 82 | extern unsigned long rcutorture_testseq; |
| 83 | extern unsigned long rcutorture_vernum; | 83 | extern unsigned long rcutorture_vernum; |
| 84 | long rcu_batches_completed(void); | 84 | unsigned long rcu_batches_started(void); |
| 85 | long rcu_batches_completed_bh(void); | 85 | unsigned long rcu_batches_started_bh(void); |
| 86 | long rcu_batches_completed_sched(void); | 86 | unsigned long rcu_batches_started_sched(void); |
| 87 | unsigned long rcu_batches_completed(void); | ||
| 88 | unsigned long rcu_batches_completed_bh(void); | ||
| 89 | unsigned long rcu_batches_completed_sched(void); | ||
| 87 | void show_rcu_gp_kthreads(void); | 90 | void show_rcu_gp_kthreads(void); |
| 88 | 91 | ||
| 89 | void rcu_force_quiescent_state(void); | 92 | void rcu_force_quiescent_state(void); |
| @@ -97,4 +100,6 @@ extern int rcu_scheduler_active __read_mostly; | |||
| 97 | 100 | ||
| 98 | bool rcu_is_watching(void); | 101 | bool rcu_is_watching(void); |
| 99 | 102 | ||
| 103 | void rcu_all_qs(void); | ||
| 104 | |||
| 100 | #endif /* __LINUX_RCUTREE_H */ | 105 | #endif /* __LINUX_RCUTREE_H */ |
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index 4419b99d8d6e..116655d92269 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h | |||
| @@ -468,7 +468,7 @@ bool regmap_reg_in_ranges(unsigned int reg, | |||
| 468 | * | 468 | * |
| 469 | * @reg: Offset of the register within the regmap bank | 469 | * @reg: Offset of the register within the regmap bank |
| 470 | * @lsb: lsb of the register field. | 470 | * @lsb: lsb of the register field. |
| 471 | * @reg: msb of the register field. | 471 | * @msb: msb of the register field. |
| 472 | * @id_size: port size if it has some ports | 472 | * @id_size: port size if it has some ports |
| 473 | * @id_offset: address offset for each ports | 473 | * @id_offset: address offset for each ports |
| 474 | */ | 474 | */ |
diff --git a/include/linux/regulator/da9211.h b/include/linux/regulator/da9211.h index 5479394fefce..5dd65acc2a69 100644 --- a/include/linux/regulator/da9211.h +++ b/include/linux/regulator/da9211.h | |||
| @@ -32,6 +32,8 @@ struct da9211_pdata { | |||
| 32 | * 2 : 2 phase 2 buck | 32 | * 2 : 2 phase 2 buck |
| 33 | */ | 33 | */ |
| 34 | int num_buck; | 34 | int num_buck; |
| 35 | int gpio_ren[DA9211_MAX_REGULATORS]; | ||
| 36 | struct device_node *reg_node[DA9211_MAX_REGULATORS]; | ||
| 35 | struct regulator_init_data *init_data[DA9211_MAX_REGULATORS]; | 37 | struct regulator_init_data *init_data[DA9211_MAX_REGULATORS]; |
| 36 | }; | 38 | }; |
| 37 | #endif | 39 | #endif |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index 5f1e9ca47417..d4ad5b5a02bb 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | 21 | ||
| 22 | struct regmap; | 22 | struct regmap; |
| 23 | struct regulator_dev; | 23 | struct regulator_dev; |
| 24 | struct regulator_config; | ||
| 24 | struct regulator_init_data; | 25 | struct regulator_init_data; |
| 25 | struct regulator_enable_gpio; | 26 | struct regulator_enable_gpio; |
| 26 | 27 | ||
| @@ -205,6 +206,15 @@ enum regulator_type { | |||
| 205 | * @supply_name: Identifying the regulator supply | 206 | * @supply_name: Identifying the regulator supply |
| 206 | * @of_match: Name used to identify regulator in DT. | 207 | * @of_match: Name used to identify regulator in DT. |
| 207 | * @regulators_node: Name of node containing regulator definitions in DT. | 208 | * @regulators_node: Name of node containing regulator definitions in DT. |
| 209 | * @of_parse_cb: Optional callback called only if of_match is present. | ||
| 210 | * Will be called for each regulator parsed from DT, during | ||
| 211 | * init_data parsing. | ||
| 212 | * The regulator_config passed as argument to the callback will | ||
| 213 | * be a copy of config passed to regulator_register, valid only | ||
| 214 | * for this particular call. Callback may freely change the | ||
| 215 | * config but it cannot store it for later usage. | ||
| 216 | * Callback should return 0 on success or negative ERRNO | ||
| 217 | * indicating failure. | ||
| 208 | * @id: Numerical identifier for the regulator. | 218 | * @id: Numerical identifier for the regulator. |
| 209 | * @ops: Regulator operations table. | 219 | * @ops: Regulator operations table. |
| 210 | * @irq: Interrupt number for the regulator. | 220 | * @irq: Interrupt number for the regulator. |
| @@ -251,6 +261,9 @@ struct regulator_desc { | |||
| 251 | const char *supply_name; | 261 | const char *supply_name; |
| 252 | const char *of_match; | 262 | const char *of_match; |
| 253 | const char *regulators_node; | 263 | const char *regulators_node; |
| 264 | int (*of_parse_cb)(struct device_node *, | ||
| 265 | const struct regulator_desc *, | ||
| 266 | struct regulator_config *); | ||
| 254 | int id; | 267 | int id; |
| 255 | bool continuous_voltage_range; | 268 | bool continuous_voltage_range; |
| 256 | unsigned n_voltages; | 269 | unsigned n_voltages; |
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h index 0b08d05d470b..b07562e082c4 100644 --- a/include/linux/regulator/machine.h +++ b/include/linux/regulator/machine.h | |||
| @@ -191,15 +191,22 @@ struct regulator_init_data { | |||
| 191 | void *driver_data; /* core does not touch this */ | 191 | void *driver_data; /* core does not touch this */ |
| 192 | }; | 192 | }; |
| 193 | 193 | ||
| 194 | int regulator_suspend_prepare(suspend_state_t state); | ||
| 195 | int regulator_suspend_finish(void); | ||
| 196 | |||
| 197 | #ifdef CONFIG_REGULATOR | 194 | #ifdef CONFIG_REGULATOR |
| 198 | void regulator_has_full_constraints(void); | 195 | void regulator_has_full_constraints(void); |
| 196 | int regulator_suspend_prepare(suspend_state_t state); | ||
| 197 | int regulator_suspend_finish(void); | ||
| 199 | #else | 198 | #else |
| 200 | static inline void regulator_has_full_constraints(void) | 199 | static inline void regulator_has_full_constraints(void) |
| 201 | { | 200 | { |
| 202 | } | 201 | } |
| 202 | static inline int regulator_suspend_prepare(suspend_state_t state) | ||
| 203 | { | ||
| 204 | return 0; | ||
| 205 | } | ||
| 206 | static inline int regulator_suspend_finish(void) | ||
| 207 | { | ||
| 208 | return 0; | ||
| 209 | } | ||
| 203 | #endif | 210 | #endif |
| 204 | 211 | ||
| 205 | #endif | 212 | #endif |
diff --git a/include/linux/regulator/mt6397-regulator.h b/include/linux/regulator/mt6397-regulator.h new file mode 100644 index 000000000000..30cc5963e265 --- /dev/null +++ b/include/linux/regulator/mt6397-regulator.h | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2014 MediaTek Inc. | ||
| 3 | * Author: Flora Fu <flora.fu@mediatek.com> | ||
| 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 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __LINUX_REGULATOR_MT6397_H | ||
| 16 | #define __LINUX_REGULATOR_MT6397_H | ||
| 17 | |||
| 18 | enum { | ||
| 19 | MT6397_ID_VPCA15 = 0, | ||
| 20 | MT6397_ID_VPCA7, | ||
| 21 | MT6397_ID_VSRAMCA15, | ||
| 22 | MT6397_ID_VSRAMCA7, | ||
| 23 | MT6397_ID_VCORE, | ||
| 24 | MT6397_ID_VGPU, | ||
| 25 | MT6397_ID_VDRM, | ||
| 26 | MT6397_ID_VIO18 = 7, | ||
| 27 | MT6397_ID_VTCXO, | ||
| 28 | MT6397_ID_VA28, | ||
| 29 | MT6397_ID_VCAMA, | ||
| 30 | MT6397_ID_VIO28, | ||
| 31 | MT6397_ID_VUSB, | ||
| 32 | MT6397_ID_VMC, | ||
| 33 | MT6397_ID_VMCH, | ||
| 34 | MT6397_ID_VEMC3V3, | ||
| 35 | MT6397_ID_VGP1, | ||
| 36 | MT6397_ID_VGP2, | ||
| 37 | MT6397_ID_VGP3, | ||
| 38 | MT6397_ID_VGP4, | ||
| 39 | MT6397_ID_VGP5, | ||
| 40 | MT6397_ID_VGP6, | ||
| 41 | MT6397_ID_VIBR, | ||
| 42 | MT6397_ID_RG_MAX, | ||
| 43 | }; | ||
| 44 | |||
| 45 | #define MT6397_MAX_REGULATOR MT6397_ID_RG_MAX | ||
| 46 | #define MT6397_REGULATOR_ID97 0x97 | ||
| 47 | #define MT6397_REGULATOR_ID91 0x91 | ||
| 48 | |||
| 49 | #endif /* __LINUX_REGULATOR_MT6397_H */ | ||
diff --git a/include/linux/regulator/pfuze100.h b/include/linux/regulator/pfuze100.h index 364f7a7c43db..70c6c66c5bcf 100644 --- a/include/linux/regulator/pfuze100.h +++ b/include/linux/regulator/pfuze100.h | |||
| @@ -49,6 +49,20 @@ | |||
| 49 | #define PFUZE200_VGEN5 11 | 49 | #define PFUZE200_VGEN5 11 |
| 50 | #define PFUZE200_VGEN6 12 | 50 | #define PFUZE200_VGEN6 12 |
| 51 | 51 | ||
| 52 | #define PFUZE3000_SW1A 0 | ||
| 53 | #define PFUZE3000_SW1B 1 | ||
| 54 | #define PFUZE3000_SW2 2 | ||
| 55 | #define PFUZE3000_SW3 3 | ||
| 56 | #define PFUZE3000_SWBST 4 | ||
| 57 | #define PFUZE3000_VSNVS 5 | ||
| 58 | #define PFUZE3000_VREFDDR 6 | ||
| 59 | #define PFUZE3000_VLDO1 7 | ||
| 60 | #define PFUZE3000_VLDO2 8 | ||
| 61 | #define PFUZE3000_VCCSD 9 | ||
| 62 | #define PFUZE3000_V33 10 | ||
| 63 | #define PFUZE3000_VLDO3 11 | ||
| 64 | #define PFUZE3000_VLDO4 12 | ||
| 65 | |||
| 52 | struct regulator_init_data; | 66 | struct regulator_init_data; |
| 53 | 67 | ||
| 54 | struct pfuze_regulator_platform_data { | 68 | struct pfuze_regulator_platform_data { |
diff --git a/include/linux/resource_ext.h b/include/linux/resource_ext.h new file mode 100644 index 000000000000..e2bf63d881d4 --- /dev/null +++ b/include/linux/resource_ext.h | |||
| @@ -0,0 +1,77 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2015, Intel Corporation | ||
| 3 | * Author: Jiang Liu <jiang.liu@linux.intel.com> | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms and conditions of the GNU General Public License, | ||
| 7 | * version 2, as published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 12 | * more details. | ||
| 13 | */ | ||
| 14 | #ifndef _LINUX_RESOURCE_EXT_H | ||
| 15 | #define _LINUX_RESOURCE_EXT_H | ||
| 16 | #include <linux/types.h> | ||
| 17 | #include <linux/list.h> | ||
| 18 | #include <linux/ioport.h> | ||
| 19 | #include <linux/slab.h> | ||
| 20 | |||
| 21 | /* Represent resource window for bridge devices */ | ||
| 22 | struct resource_win { | ||
| 23 | struct resource res; /* In master (CPU) address space */ | ||
| 24 | resource_size_t offset; /* Translation offset for bridge */ | ||
| 25 | }; | ||
| 26 | |||
| 27 | /* | ||
| 28 | * Common resource list management data structure and interfaces to support | ||
| 29 | * ACPI, PNP and PCI host bridge etc. | ||
| 30 | */ | ||
| 31 | struct resource_entry { | ||
| 32 | struct list_head node; | ||
| 33 | struct resource *res; /* In master (CPU) address space */ | ||
| 34 | resource_size_t offset; /* Translation offset for bridge */ | ||
| 35 | struct resource __res; /* Default storage for res */ | ||
| 36 | }; | ||
| 37 | |||
| 38 | extern struct resource_entry * | ||
| 39 | resource_list_create_entry(struct resource *res, size_t extra_size); | ||
| 40 | extern void resource_list_free(struct list_head *head); | ||
| 41 | |||
| 42 | static inline void resource_list_add(struct resource_entry *entry, | ||
| 43 | struct list_head *head) | ||
| 44 | { | ||
| 45 | list_add(&entry->node, head); | ||
| 46 | } | ||
| 47 | |||
| 48 | static inline void resource_list_add_tail(struct resource_entry *entry, | ||
| 49 | struct list_head *head) | ||
| 50 | { | ||
| 51 | list_add_tail(&entry->node, head); | ||
| 52 | } | ||
| 53 | |||
| 54 | static inline void resource_list_del(struct resource_entry *entry) | ||
| 55 | { | ||
| 56 | list_del(&entry->node); | ||
| 57 | } | ||
| 58 | |||
| 59 | static inline void resource_list_free_entry(struct resource_entry *entry) | ||
| 60 | { | ||
| 61 | kfree(entry); | ||
| 62 | } | ||
| 63 | |||
| 64 | static inline void | ||
| 65 | resource_list_destroy_entry(struct resource_entry *entry) | ||
| 66 | { | ||
| 67 | resource_list_del(entry); | ||
| 68 | resource_list_free_entry(entry); | ||
| 69 | } | ||
| 70 | |||
| 71 | #define resource_list_for_each_entry(entry, list) \ | ||
| 72 | list_for_each_entry((entry), (list), node) | ||
| 73 | |||
| 74 | #define resource_list_for_each_entry_safe(entry, tmp, list) \ | ||
| 75 | list_for_each_entry_safe((entry), (tmp), (list), node) | ||
| 76 | |||
| 77 | #endif /* _LINUX_RESOURCE_EXT_H */ | ||
diff --git a/include/linux/rhashtable.h b/include/linux/rhashtable.h index b93fd89b2e5e..58851275fed9 100644 --- a/include/linux/rhashtable.h +++ b/include/linux/rhashtable.h | |||
| @@ -18,16 +18,45 @@ | |||
| 18 | #ifndef _LINUX_RHASHTABLE_H | 18 | #ifndef _LINUX_RHASHTABLE_H |
| 19 | #define _LINUX_RHASHTABLE_H | 19 | #define _LINUX_RHASHTABLE_H |
| 20 | 20 | ||
| 21 | #include <linux/rculist.h> | 21 | #include <linux/compiler.h> |
| 22 | #include <linux/list_nulls.h> | ||
| 23 | #include <linux/workqueue.h> | ||
| 24 | #include <linux/mutex.h> | ||
| 25 | |||
| 26 | /* | ||
| 27 | * The end of the chain is marked with a special nulls marks which has | ||
| 28 | * the following format: | ||
| 29 | * | ||
| 30 | * +-------+-----------------------------------------------------+-+ | ||
| 31 | * | Base | Hash |1| | ||
| 32 | * +-------+-----------------------------------------------------+-+ | ||
| 33 | * | ||
| 34 | * Base (4 bits) : Reserved to distinguish between multiple tables. | ||
| 35 | * Specified via &struct rhashtable_params.nulls_base. | ||
| 36 | * Hash (27 bits): Full hash (unmasked) of first element added to bucket | ||
| 37 | * 1 (1 bit) : Nulls marker (always set) | ||
| 38 | * | ||
| 39 | * The remaining bits of the next pointer remain unused for now. | ||
| 40 | */ | ||
| 41 | #define RHT_BASE_BITS 4 | ||
| 42 | #define RHT_HASH_BITS 27 | ||
| 43 | #define RHT_BASE_SHIFT RHT_HASH_BITS | ||
| 22 | 44 | ||
| 23 | struct rhash_head { | 45 | struct rhash_head { |
| 24 | struct rhash_head __rcu *next; | 46 | struct rhash_head __rcu *next; |
| 25 | }; | 47 | }; |
| 26 | 48 | ||
| 27 | #define INIT_HASH_HEAD(ptr) ((ptr)->next = NULL) | 49 | /** |
| 28 | 50 | * struct bucket_table - Table of hash buckets | |
| 51 | * @size: Number of hash buckets | ||
| 52 | * @locks_mask: Mask to apply before accessing locks[] | ||
| 53 | * @locks: Array of spinlocks protecting individual buckets | ||
| 54 | * @buckets: size * hash buckets | ||
| 55 | */ | ||
| 29 | struct bucket_table { | 56 | struct bucket_table { |
| 30 | size_t size; | 57 | size_t size; |
| 58 | unsigned int locks_mask; | ||
| 59 | spinlock_t *locks; | ||
| 31 | struct rhash_head __rcu *buckets[]; | 60 | struct rhash_head __rcu *buckets[]; |
| 32 | }; | 61 | }; |
| 33 | 62 | ||
| @@ -45,11 +74,16 @@ struct rhashtable; | |||
| 45 | * @hash_rnd: Seed to use while hashing | 74 | * @hash_rnd: Seed to use while hashing |
| 46 | * @max_shift: Maximum number of shifts while expanding | 75 | * @max_shift: Maximum number of shifts while expanding |
| 47 | * @min_shift: Minimum number of shifts while shrinking | 76 | * @min_shift: Minimum number of shifts while shrinking |
| 77 | * @nulls_base: Base value to generate nulls marker | ||
| 78 | * @locks_mul: Number of bucket locks to allocate per cpu (default: 128) | ||
| 48 | * @hashfn: Function to hash key | 79 | * @hashfn: Function to hash key |
| 49 | * @obj_hashfn: Function to hash object | 80 | * @obj_hashfn: Function to hash object |
| 50 | * @grow_decision: If defined, may return true if table should expand | 81 | * @grow_decision: If defined, may return true if table should expand |
| 51 | * @shrink_decision: If defined, may return true if table should shrink | 82 | * @shrink_decision: If defined, may return true if table should shrink |
| 52 | * @mutex_is_held: Must return true if protecting mutex is held | 83 | * |
| 84 | * Note: when implementing the grow and shrink decision function, min/max | ||
| 85 | * shift must be enforced, otherwise, resizing watermarks they set may be | ||
| 86 | * useless. | ||
| 53 | */ | 87 | */ |
| 54 | struct rhashtable_params { | 88 | struct rhashtable_params { |
| 55 | size_t nelem_hint; | 89 | size_t nelem_hint; |
| @@ -59,36 +93,95 @@ struct rhashtable_params { | |||
| 59 | u32 hash_rnd; | 93 | u32 hash_rnd; |
| 60 | size_t max_shift; | 94 | size_t max_shift; |
| 61 | size_t min_shift; | 95 | size_t min_shift; |
| 96 | u32 nulls_base; | ||
| 97 | size_t locks_mul; | ||
| 62 | rht_hashfn_t hashfn; | 98 | rht_hashfn_t hashfn; |
| 63 | rht_obj_hashfn_t obj_hashfn; | 99 | rht_obj_hashfn_t obj_hashfn; |
| 64 | bool (*grow_decision)(const struct rhashtable *ht, | 100 | bool (*grow_decision)(const struct rhashtable *ht, |
| 65 | size_t new_size); | 101 | size_t new_size); |
| 66 | bool (*shrink_decision)(const struct rhashtable *ht, | 102 | bool (*shrink_decision)(const struct rhashtable *ht, |
| 67 | size_t new_size); | 103 | size_t new_size); |
| 68 | #ifdef CONFIG_PROVE_LOCKING | ||
| 69 | int (*mutex_is_held)(void *parent); | ||
| 70 | void *parent; | ||
| 71 | #endif | ||
| 72 | }; | 104 | }; |
| 73 | 105 | ||
| 74 | /** | 106 | /** |
| 75 | * struct rhashtable - Hash table handle | 107 | * struct rhashtable - Hash table handle |
| 76 | * @tbl: Bucket table | 108 | * @tbl: Bucket table |
| 109 | * @future_tbl: Table under construction during expansion/shrinking | ||
| 77 | * @nelems: Number of elements in table | 110 | * @nelems: Number of elements in table |
| 78 | * @shift: Current size (1 << shift) | 111 | * @shift: Current size (1 << shift) |
| 79 | * @p: Configuration parameters | 112 | * @p: Configuration parameters |
| 113 | * @run_work: Deferred worker to expand/shrink asynchronously | ||
| 114 | * @mutex: Mutex to protect current/future table swapping | ||
| 115 | * @walkers: List of active walkers | ||
| 116 | * @being_destroyed: True if table is set up for destruction | ||
| 80 | */ | 117 | */ |
| 81 | struct rhashtable { | 118 | struct rhashtable { |
| 82 | struct bucket_table __rcu *tbl; | 119 | struct bucket_table __rcu *tbl; |
| 83 | size_t nelems; | 120 | struct bucket_table __rcu *future_tbl; |
| 84 | size_t shift; | 121 | atomic_t nelems; |
| 122 | atomic_t shift; | ||
| 85 | struct rhashtable_params p; | 123 | struct rhashtable_params p; |
| 124 | struct work_struct run_work; | ||
| 125 | struct mutex mutex; | ||
| 126 | struct list_head walkers; | ||
| 127 | bool being_destroyed; | ||
| 128 | }; | ||
| 129 | |||
| 130 | /** | ||
| 131 | * struct rhashtable_walker - Hash table walker | ||
| 132 | * @list: List entry on list of walkers | ||
| 133 | * @resize: Resize event occured | ||
| 134 | */ | ||
| 135 | struct rhashtable_walker { | ||
| 136 | struct list_head list; | ||
| 137 | bool resize; | ||
| 86 | }; | 138 | }; |
| 87 | 139 | ||
| 140 | /** | ||
| 141 | * struct rhashtable_iter - Hash table iterator, fits into netlink cb | ||
| 142 | * @ht: Table to iterate through | ||
| 143 | * @p: Current pointer | ||
| 144 | * @walker: Associated rhashtable walker | ||
| 145 | * @slot: Current slot | ||
| 146 | * @skip: Number of entries to skip in slot | ||
| 147 | */ | ||
| 148 | struct rhashtable_iter { | ||
| 149 | struct rhashtable *ht; | ||
| 150 | struct rhash_head *p; | ||
| 151 | struct rhashtable_walker *walker; | ||
| 152 | unsigned int slot; | ||
| 153 | unsigned int skip; | ||
| 154 | }; | ||
| 155 | |||
| 156 | static inline unsigned long rht_marker(const struct rhashtable *ht, u32 hash) | ||
| 157 | { | ||
| 158 | return NULLS_MARKER(ht->p.nulls_base + hash); | ||
| 159 | } | ||
| 160 | |||
| 161 | #define INIT_RHT_NULLS_HEAD(ptr, ht, hash) \ | ||
| 162 | ((ptr) = (typeof(ptr)) rht_marker(ht, hash)) | ||
| 163 | |||
| 164 | static inline bool rht_is_a_nulls(const struct rhash_head *ptr) | ||
| 165 | { | ||
| 166 | return ((unsigned long) ptr & 1); | ||
| 167 | } | ||
| 168 | |||
| 169 | static inline unsigned long rht_get_nulls_value(const struct rhash_head *ptr) | ||
| 170 | { | ||
| 171 | return ((unsigned long) ptr) >> 1; | ||
| 172 | } | ||
| 173 | |||
| 88 | #ifdef CONFIG_PROVE_LOCKING | 174 | #ifdef CONFIG_PROVE_LOCKING |
| 89 | int lockdep_rht_mutex_is_held(const struct rhashtable *ht); | 175 | int lockdep_rht_mutex_is_held(struct rhashtable *ht); |
| 176 | int lockdep_rht_bucket_is_held(const struct bucket_table *tbl, u32 hash); | ||
| 90 | #else | 177 | #else |
| 91 | static inline int lockdep_rht_mutex_is_held(const struct rhashtable *ht) | 178 | static inline int lockdep_rht_mutex_is_held(struct rhashtable *ht) |
| 179 | { | ||
| 180 | return 1; | ||
| 181 | } | ||
| 182 | |||
| 183 | static inline int lockdep_rht_bucket_is_held(const struct bucket_table *tbl, | ||
| 184 | u32 hash) | ||
| 92 | { | 185 | { |
| 93 | return 1; | 186 | return 1; |
| 94 | } | 187 | } |
| @@ -96,13 +189,8 @@ static inline int lockdep_rht_mutex_is_held(const struct rhashtable *ht) | |||
| 96 | 189 | ||
| 97 | int rhashtable_init(struct rhashtable *ht, struct rhashtable_params *params); | 190 | int rhashtable_init(struct rhashtable *ht, struct rhashtable_params *params); |
| 98 | 191 | ||
| 99 | u32 rhashtable_hashfn(const struct rhashtable *ht, const void *key, u32 len); | ||
| 100 | u32 rhashtable_obj_hashfn(const struct rhashtable *ht, void *ptr); | ||
| 101 | |||
| 102 | void rhashtable_insert(struct rhashtable *ht, struct rhash_head *node); | 192 | void rhashtable_insert(struct rhashtable *ht, struct rhash_head *node); |
| 103 | bool rhashtable_remove(struct rhashtable *ht, struct rhash_head *node); | 193 | bool rhashtable_remove(struct rhashtable *ht, struct rhash_head *node); |
| 104 | void rhashtable_remove_pprev(struct rhashtable *ht, struct rhash_head *obj, | ||
| 105 | struct rhash_head __rcu **pprev); | ||
| 106 | 194 | ||
| 107 | bool rht_grow_above_75(const struct rhashtable *ht, size_t new_size); | 195 | bool rht_grow_above_75(const struct rhashtable *ht, size_t new_size); |
| 108 | bool rht_shrink_below_30(const struct rhashtable *ht, size_t new_size); | 196 | bool rht_shrink_below_30(const struct rhashtable *ht, size_t new_size); |
| @@ -110,11 +198,23 @@ bool rht_shrink_below_30(const struct rhashtable *ht, size_t new_size); | |||
| 110 | int rhashtable_expand(struct rhashtable *ht); | 198 | int rhashtable_expand(struct rhashtable *ht); |
| 111 | int rhashtable_shrink(struct rhashtable *ht); | 199 | int rhashtable_shrink(struct rhashtable *ht); |
| 112 | 200 | ||
| 113 | void *rhashtable_lookup(const struct rhashtable *ht, const void *key); | 201 | void *rhashtable_lookup(struct rhashtable *ht, const void *key); |
| 114 | void *rhashtable_lookup_compare(const struct rhashtable *ht, u32 hash, | 202 | void *rhashtable_lookup_compare(struct rhashtable *ht, const void *key, |
| 115 | bool (*compare)(void *, void *), void *arg); | 203 | bool (*compare)(void *, void *), void *arg); |
| 116 | 204 | ||
| 117 | void rhashtable_destroy(const struct rhashtable *ht); | 205 | bool rhashtable_lookup_insert(struct rhashtable *ht, struct rhash_head *obj); |
| 206 | bool rhashtable_lookup_compare_insert(struct rhashtable *ht, | ||
| 207 | struct rhash_head *obj, | ||
| 208 | bool (*compare)(void *, void *), | ||
| 209 | void *arg); | ||
| 210 | |||
| 211 | int rhashtable_walk_init(struct rhashtable *ht, struct rhashtable_iter *iter); | ||
| 212 | void rhashtable_walk_exit(struct rhashtable_iter *iter); | ||
| 213 | int rhashtable_walk_start(struct rhashtable_iter *iter) __acquires(RCU); | ||
| 214 | void *rhashtable_walk_next(struct rhashtable_iter *iter); | ||
| 215 | void rhashtable_walk_stop(struct rhashtable_iter *iter) __releases(RCU); | ||
| 216 | |||
| 217 | void rhashtable_destroy(struct rhashtable *ht); | ||
| 118 | 218 | ||
| 119 | #define rht_dereference(p, ht) \ | 219 | #define rht_dereference(p, ht) \ |
| 120 | rcu_dereference_protected(p, lockdep_rht_mutex_is_held(ht)) | 220 | rcu_dereference_protected(p, lockdep_rht_mutex_is_held(ht)) |
| @@ -122,92 +222,146 @@ void rhashtable_destroy(const struct rhashtable *ht); | |||
| 122 | #define rht_dereference_rcu(p, ht) \ | 222 | #define rht_dereference_rcu(p, ht) \ |
| 123 | rcu_dereference_check(p, lockdep_rht_mutex_is_held(ht)) | 223 | rcu_dereference_check(p, lockdep_rht_mutex_is_held(ht)) |
| 124 | 224 | ||
| 125 | #define rht_entry(ptr, type, member) container_of(ptr, type, member) | 225 | #define rht_dereference_bucket(p, tbl, hash) \ |
| 126 | #define rht_entry_safe(ptr, type, member) \ | 226 | rcu_dereference_protected(p, lockdep_rht_bucket_is_held(tbl, hash)) |
| 127 | ({ \ | 227 | |
| 128 | typeof(ptr) __ptr = (ptr); \ | 228 | #define rht_dereference_bucket_rcu(p, tbl, hash) \ |
| 129 | __ptr ? rht_entry(__ptr, type, member) : NULL; \ | 229 | rcu_dereference_check(p, lockdep_rht_bucket_is_held(tbl, hash)) |
| 130 | }) | ||
| 131 | 230 | ||
| 132 | #define rht_next_entry_safe(pos, ht, member) \ | 231 | #define rht_entry(tpos, pos, member) \ |
| 133 | ({ \ | 232 | ({ tpos = container_of(pos, typeof(*tpos), member); 1; }) |
| 134 | pos ? rht_entry_safe(rht_dereference((pos)->member.next, ht), \ | 233 | |
| 135 | typeof(*(pos)), member) : NULL; \ | 234 | /** |
| 136 | }) | 235 | * rht_for_each_continue - continue iterating over hash chain |
| 236 | * @pos: the &struct rhash_head to use as a loop cursor. | ||
| 237 | * @head: the previous &struct rhash_head to continue from | ||
| 238 | * @tbl: the &struct bucket_table | ||
| 239 | * @hash: the hash value / bucket index | ||
| 240 | */ | ||
| 241 | #define rht_for_each_continue(pos, head, tbl, hash) \ | ||
| 242 | for (pos = rht_dereference_bucket(head, tbl, hash); \ | ||
| 243 | !rht_is_a_nulls(pos); \ | ||
| 244 | pos = rht_dereference_bucket((pos)->next, tbl, hash)) | ||
| 137 | 245 | ||
| 138 | /** | 246 | /** |
| 139 | * rht_for_each - iterate over hash chain | 247 | * rht_for_each - iterate over hash chain |
| 140 | * @pos: &struct rhash_head to use as a loop cursor. | 248 | * @pos: the &struct rhash_head to use as a loop cursor. |
| 141 | * @head: head of the hash chain (struct rhash_head *) | 249 | * @tbl: the &struct bucket_table |
| 142 | * @ht: pointer to your struct rhashtable | 250 | * @hash: the hash value / bucket index |
| 143 | */ | 251 | */ |
| 144 | #define rht_for_each(pos, head, ht) \ | 252 | #define rht_for_each(pos, tbl, hash) \ |
| 145 | for (pos = rht_dereference(head, ht); \ | 253 | rht_for_each_continue(pos, (tbl)->buckets[hash], tbl, hash) |
| 146 | pos; \ | 254 | |
| 147 | pos = rht_dereference((pos)->next, ht)) | 255 | /** |
| 256 | * rht_for_each_entry_continue - continue iterating over hash chain | ||
| 257 | * @tpos: the type * to use as a loop cursor. | ||
| 258 | * @pos: the &struct rhash_head to use as a loop cursor. | ||
| 259 | * @head: the previous &struct rhash_head to continue from | ||
| 260 | * @tbl: the &struct bucket_table | ||
| 261 | * @hash: the hash value / bucket index | ||
| 262 | * @member: name of the &struct rhash_head within the hashable struct. | ||
| 263 | */ | ||
| 264 | #define rht_for_each_entry_continue(tpos, pos, head, tbl, hash, member) \ | ||
| 265 | for (pos = rht_dereference_bucket(head, tbl, hash); \ | ||
| 266 | (!rht_is_a_nulls(pos)) && rht_entry(tpos, pos, member); \ | ||
| 267 | pos = rht_dereference_bucket((pos)->next, tbl, hash)) | ||
| 148 | 268 | ||
| 149 | /** | 269 | /** |
| 150 | * rht_for_each_entry - iterate over hash chain of given type | 270 | * rht_for_each_entry - iterate over hash chain of given type |
| 151 | * @pos: type * to use as a loop cursor. | 271 | * @tpos: the type * to use as a loop cursor. |
| 152 | * @head: head of the hash chain (struct rhash_head *) | 272 | * @pos: the &struct rhash_head to use as a loop cursor. |
| 153 | * @ht: pointer to your struct rhashtable | 273 | * @tbl: the &struct bucket_table |
| 154 | * @member: name of the rhash_head within the hashable struct. | 274 | * @hash: the hash value / bucket index |
| 275 | * @member: name of the &struct rhash_head within the hashable struct. | ||
| 155 | */ | 276 | */ |
| 156 | #define rht_for_each_entry(pos, head, ht, member) \ | 277 | #define rht_for_each_entry(tpos, pos, tbl, hash, member) \ |
| 157 | for (pos = rht_entry_safe(rht_dereference(head, ht), \ | 278 | rht_for_each_entry_continue(tpos, pos, (tbl)->buckets[hash], \ |
| 158 | typeof(*(pos)), member); \ | 279 | tbl, hash, member) |
| 159 | pos; \ | ||
| 160 | pos = rht_next_entry_safe(pos, ht, member)) | ||
| 161 | 280 | ||
| 162 | /** | 281 | /** |
| 163 | * rht_for_each_entry_safe - safely iterate over hash chain of given type | 282 | * rht_for_each_entry_safe - safely iterate over hash chain of given type |
| 164 | * @pos: type * to use as a loop cursor. | 283 | * @tpos: the type * to use as a loop cursor. |
| 165 | * @n: type * to use for temporary next object storage | 284 | * @pos: the &struct rhash_head to use as a loop cursor. |
| 166 | * @head: head of the hash chain (struct rhash_head *) | 285 | * @next: the &struct rhash_head to use as next in loop cursor. |
| 167 | * @ht: pointer to your struct rhashtable | 286 | * @tbl: the &struct bucket_table |
| 168 | * @member: name of the rhash_head within the hashable struct. | 287 | * @hash: the hash value / bucket index |
| 288 | * @member: name of the &struct rhash_head within the hashable struct. | ||
| 169 | * | 289 | * |
| 170 | * This hash chain list-traversal primitive allows for the looped code to | 290 | * This hash chain list-traversal primitive allows for the looped code to |
| 171 | * remove the loop cursor from the list. | 291 | * remove the loop cursor from the list. |
| 172 | */ | 292 | */ |
| 173 | #define rht_for_each_entry_safe(pos, n, head, ht, member) \ | 293 | #define rht_for_each_entry_safe(tpos, pos, next, tbl, hash, member) \ |
| 174 | for (pos = rht_entry_safe(rht_dereference(head, ht), \ | 294 | for (pos = rht_dereference_bucket((tbl)->buckets[hash], tbl, hash), \ |
| 175 | typeof(*(pos)), member), \ | 295 | next = !rht_is_a_nulls(pos) ? \ |
| 176 | n = rht_next_entry_safe(pos, ht, member); \ | 296 | rht_dereference_bucket(pos->next, tbl, hash) : NULL; \ |
| 177 | pos; \ | 297 | (!rht_is_a_nulls(pos)) && rht_entry(tpos, pos, member); \ |
| 178 | pos = n, \ | 298 | pos = next, \ |
| 179 | n = rht_next_entry_safe(pos, ht, member)) | 299 | next = !rht_is_a_nulls(pos) ? \ |
| 300 | rht_dereference_bucket(pos->next, tbl, hash) : NULL) | ||
| 301 | |||
| 302 | /** | ||
| 303 | * rht_for_each_rcu_continue - continue iterating over rcu hash chain | ||
| 304 | * @pos: the &struct rhash_head to use as a loop cursor. | ||
| 305 | * @head: the previous &struct rhash_head to continue from | ||
| 306 | * @tbl: the &struct bucket_table | ||
| 307 | * @hash: the hash value / bucket index | ||
| 308 | * | ||
| 309 | * This hash chain list-traversal primitive may safely run concurrently with | ||
| 310 | * the _rcu mutation primitives such as rhashtable_insert() as long as the | ||
| 311 | * traversal is guarded by rcu_read_lock(). | ||
| 312 | */ | ||
| 313 | #define rht_for_each_rcu_continue(pos, head, tbl, hash) \ | ||
| 314 | for (({barrier(); }), \ | ||
| 315 | pos = rht_dereference_bucket_rcu(head, tbl, hash); \ | ||
| 316 | !rht_is_a_nulls(pos); \ | ||
| 317 | pos = rcu_dereference_raw(pos->next)) | ||
| 180 | 318 | ||
| 181 | /** | 319 | /** |
| 182 | * rht_for_each_rcu - iterate over rcu hash chain | 320 | * rht_for_each_rcu - iterate over rcu hash chain |
| 183 | * @pos: &struct rhash_head to use as a loop cursor. | 321 | * @pos: the &struct rhash_head to use as a loop cursor. |
| 184 | * @head: head of the hash chain (struct rhash_head *) | 322 | * @tbl: the &struct bucket_table |
| 185 | * @ht: pointer to your struct rhashtable | 323 | * @hash: the hash value / bucket index |
| 324 | * | ||
| 325 | * This hash chain list-traversal primitive may safely run concurrently with | ||
| 326 | * the _rcu mutation primitives such as rhashtable_insert() as long as the | ||
| 327 | * traversal is guarded by rcu_read_lock(). | ||
| 328 | */ | ||
| 329 | #define rht_for_each_rcu(pos, tbl, hash) \ | ||
| 330 | rht_for_each_rcu_continue(pos, (tbl)->buckets[hash], tbl, hash) | ||
| 331 | |||
| 332 | /** | ||
| 333 | * rht_for_each_entry_rcu_continue - continue iterating over rcu hash chain | ||
| 334 | * @tpos: the type * to use as a loop cursor. | ||
| 335 | * @pos: the &struct rhash_head to use as a loop cursor. | ||
| 336 | * @head: the previous &struct rhash_head to continue from | ||
| 337 | * @tbl: the &struct bucket_table | ||
| 338 | * @hash: the hash value / bucket index | ||
| 339 | * @member: name of the &struct rhash_head within the hashable struct. | ||
| 186 | * | 340 | * |
| 187 | * This hash chain list-traversal primitive may safely run concurrently with | 341 | * This hash chain list-traversal primitive may safely run concurrently with |
| 188 | * the _rcu fkht mutation primitives such as rht_insert() as long as the | 342 | * the _rcu mutation primitives such as rhashtable_insert() as long as the |
| 189 | * traversal is guarded by rcu_read_lock(). | 343 | * traversal is guarded by rcu_read_lock(). |
| 190 | */ | 344 | */ |
| 191 | #define rht_for_each_rcu(pos, head, ht) \ | 345 | #define rht_for_each_entry_rcu_continue(tpos, pos, head, tbl, hash, member) \ |
| 192 | for (pos = rht_dereference_rcu(head, ht); \ | 346 | for (({barrier(); }), \ |
| 193 | pos; \ | 347 | pos = rht_dereference_bucket_rcu(head, tbl, hash); \ |
| 194 | pos = rht_dereference_rcu((pos)->next, ht)) | 348 | (!rht_is_a_nulls(pos)) && rht_entry(tpos, pos, member); \ |
| 349 | pos = rht_dereference_bucket_rcu(pos->next, tbl, hash)) | ||
| 195 | 350 | ||
| 196 | /** | 351 | /** |
| 197 | * rht_for_each_entry_rcu - iterate over rcu hash chain of given type | 352 | * rht_for_each_entry_rcu - iterate over rcu hash chain of given type |
| 198 | * @pos: type * to use as a loop cursor. | 353 | * @tpos: the type * to use as a loop cursor. |
| 199 | * @head: head of the hash chain (struct rhash_head *) | 354 | * @pos: the &struct rhash_head to use as a loop cursor. |
| 200 | * @member: name of the rhash_head within the hashable struct. | 355 | * @tbl: the &struct bucket_table |
| 356 | * @hash: the hash value / bucket index | ||
| 357 | * @member: name of the &struct rhash_head within the hashable struct. | ||
| 201 | * | 358 | * |
| 202 | * This hash chain list-traversal primitive may safely run concurrently with | 359 | * This hash chain list-traversal primitive may safely run concurrently with |
| 203 | * the _rcu fkht mutation primitives such as rht_insert() as long as the | 360 | * the _rcu mutation primitives such as rhashtable_insert() as long as the |
| 204 | * traversal is guarded by rcu_read_lock(). | 361 | * traversal is guarded by rcu_read_lock(). |
| 205 | */ | 362 | */ |
| 206 | #define rht_for_each_entry_rcu(pos, head, member) \ | 363 | #define rht_for_each_entry_rcu(tpos, pos, tbl, hash, member) \ |
| 207 | for (pos = rht_entry_safe(rcu_dereference_raw(head), \ | 364 | rht_for_each_entry_rcu_continue(tpos, pos, (tbl)->buckets[hash],\ |
| 208 | typeof(*(pos)), member); \ | 365 | tbl, hash, member) |
| 209 | pos; \ | ||
| 210 | pos = rht_entry_safe(rcu_dereference_raw((pos)->member.next), \ | ||
| 211 | typeof(*(pos)), member)) | ||
| 212 | 366 | ||
| 213 | #endif /* _LINUX_RHASHTABLE_H */ | 367 | #endif /* _LINUX_RHASHTABLE_H */ |
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index d9d7e7e56352..b38f559130d5 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
| @@ -246,7 +246,6 @@ int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); | |||
| 246 | * arg: passed to rmap_one() and invalid_vma() | 246 | * arg: passed to rmap_one() and invalid_vma() |
| 247 | * rmap_one: executed on each vma where page is mapped | 247 | * rmap_one: executed on each vma where page is mapped |
| 248 | * done: for checking traversing termination condition | 248 | * done: for checking traversing termination condition |
| 249 | * file_nonlinear: for handling file nonlinear mapping | ||
| 250 | * anon_lock: for getting anon_lock by optimized way rather than default | 249 | * anon_lock: for getting anon_lock by optimized way rather than default |
| 251 | * invalid_vma: for skipping uninterested vma | 250 | * invalid_vma: for skipping uninterested vma |
| 252 | */ | 251 | */ |
| @@ -255,7 +254,6 @@ struct rmap_walk_control { | |||
| 255 | int (*rmap_one)(struct page *page, struct vm_area_struct *vma, | 254 | int (*rmap_one)(struct page *page, struct vm_area_struct *vma, |
| 256 | unsigned long addr, void *arg); | 255 | unsigned long addr, void *arg); |
| 257 | int (*done)(struct page *page); | 256 | int (*done)(struct page *page); |
| 258 | int (*file_nonlinear)(struct page *, struct address_space *, void *arg); | ||
| 259 | struct anon_vma *(*anon_lock)(struct page *page); | 257 | struct anon_vma *(*anon_lock)(struct page *page); |
| 260 | bool (*invalid_vma)(struct vm_area_struct *vma, void *arg); | 258 | bool (*invalid_vma)(struct vm_area_struct *vma, void *arg); |
| 261 | }; | 259 | }; |
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 6d6be09a2fe5..dcad7ee0d746 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h | |||
| @@ -161,7 +161,7 @@ extern void devm_rtc_device_unregister(struct device *dev, | |||
| 161 | extern int rtc_read_time(struct rtc_device *rtc, struct rtc_time *tm); | 161 | extern int rtc_read_time(struct rtc_device *rtc, struct rtc_time *tm); |
| 162 | extern int rtc_set_time(struct rtc_device *rtc, struct rtc_time *tm); | 162 | extern int rtc_set_time(struct rtc_device *rtc, struct rtc_time *tm); |
| 163 | extern int rtc_set_mmss(struct rtc_device *rtc, unsigned long secs); | 163 | extern int rtc_set_mmss(struct rtc_device *rtc, unsigned long secs); |
| 164 | extern int rtc_set_ntp_time(struct timespec now); | 164 | extern int rtc_set_ntp_time(struct timespec64 now); |
| 165 | int __rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm); | 165 | int __rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm); |
| 166 | extern int rtc_read_alarm(struct rtc_device *rtc, | 166 | extern int rtc_read_alarm(struct rtc_device *rtc, |
| 167 | struct rtc_wkalrm *alrm); | 167 | struct rtc_wkalrm *alrm); |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 85ab7d72b54c..1bb36edb66b9 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -626,8 +626,11 @@ struct sk_buff { | |||
| 626 | __u32 hash; | 626 | __u32 hash; |
| 627 | __be16 vlan_proto; | 627 | __be16 vlan_proto; |
| 628 | __u16 vlan_tci; | 628 | __u16 vlan_tci; |
| 629 | #ifdef CONFIG_NET_RX_BUSY_POLL | 629 | #if defined(CONFIG_NET_RX_BUSY_POLL) || defined(CONFIG_XPS) |
| 630 | unsigned int napi_id; | 630 | union { |
| 631 | unsigned int napi_id; | ||
| 632 | unsigned int sender_cpu; | ||
| 633 | }; | ||
| 631 | #endif | 634 | #endif |
| 632 | #ifdef CONFIG_NETWORK_SECMARK | 635 | #ifdef CONFIG_NETWORK_SECMARK |
| 633 | __u32 secmark; | 636 | __u32 secmark; |
| @@ -2484,19 +2487,18 @@ static inline int skb_put_padto(struct sk_buff *skb, unsigned int len) | |||
| 2484 | } | 2487 | } |
| 2485 | 2488 | ||
| 2486 | static inline int skb_add_data(struct sk_buff *skb, | 2489 | static inline int skb_add_data(struct sk_buff *skb, |
| 2487 | char __user *from, int copy) | 2490 | struct iov_iter *from, int copy) |
| 2488 | { | 2491 | { |
| 2489 | const int off = skb->len; | 2492 | const int off = skb->len; |
| 2490 | 2493 | ||
| 2491 | if (skb->ip_summed == CHECKSUM_NONE) { | 2494 | if (skb->ip_summed == CHECKSUM_NONE) { |
| 2492 | int err = 0; | 2495 | __wsum csum = 0; |
| 2493 | __wsum csum = csum_and_copy_from_user(from, skb_put(skb, copy), | 2496 | if (csum_and_copy_from_iter(skb_put(skb, copy), copy, |
| 2494 | copy, 0, &err); | 2497 | &csum, from) == copy) { |
| 2495 | if (!err) { | ||
| 2496 | skb->csum = csum_block_add(skb->csum, csum, off); | 2498 | skb->csum = csum_block_add(skb->csum, csum, off); |
| 2497 | return 0; | 2499 | return 0; |
| 2498 | } | 2500 | } |
| 2499 | } else if (!copy_from_user(skb_put(skb, copy), from, copy)) | 2501 | } else if (copy_from_iter(skb_put(skb, copy), copy, from) == copy) |
| 2500 | return 0; | 2502 | return 0; |
| 2501 | 2503 | ||
| 2502 | __skb_trim(skb, off); | 2504 | __skb_trim(skb, off); |
| @@ -2693,8 +2695,7 @@ int skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci); | |||
| 2693 | 2695 | ||
| 2694 | static inline int memcpy_from_msg(void *data, struct msghdr *msg, int len) | 2696 | static inline int memcpy_from_msg(void *data, struct msghdr *msg, int len) |
| 2695 | { | 2697 | { |
| 2696 | /* XXX: stripping const */ | 2698 | return copy_from_iter(data, len, &msg->msg_iter) == len ? 0 : -EFAULT; |
| 2697 | return memcpy_fromiovec(data, (struct iovec *)msg->msg_iter.iov, len); | ||
| 2698 | } | 2699 | } |
| 2699 | 2700 | ||
| 2700 | static inline int memcpy_to_msg(struct msghdr *msg, void *data, int len) | 2701 | static inline int memcpy_to_msg(struct msghdr *msg, void *data, int len) |
| @@ -3071,7 +3072,7 @@ static inline __wsum null_compute_pseudo(struct sk_buff *skb, int proto) | |||
| 3071 | 3072 | ||
| 3072 | #define skb_checksum_validate_zero_check(skb, proto, check, \ | 3073 | #define skb_checksum_validate_zero_check(skb, proto, check, \ |
| 3073 | compute_pseudo) \ | 3074 | compute_pseudo) \ |
| 3074 | __skb_checksum_validate_(skb, proto, true, true, check, compute_pseudo) | 3075 | __skb_checksum_validate(skb, proto, true, true, check, compute_pseudo) |
| 3075 | 3076 | ||
| 3076 | #define skb_checksum_simple_validate(skb) \ | 3077 | #define skb_checksum_simple_validate(skb) \ |
| 3077 | __skb_checksum_validate(skb, 0, true, false, 0, null_compute_pseudo) | 3078 | __skb_checksum_validate(skb, 0, true, false, 0, null_compute_pseudo) |
| @@ -3096,6 +3097,27 @@ do { \ | |||
| 3096 | compute_pseudo(skb, proto)); \ | 3097 | compute_pseudo(skb, proto)); \ |
| 3097 | } while (0) | 3098 | } while (0) |
| 3098 | 3099 | ||
| 3100 | /* Update skbuf and packet to reflect the remote checksum offload operation. | ||
| 3101 | * When called, ptr indicates the starting point for skb->csum when | ||
| 3102 | * ip_summed is CHECKSUM_COMPLETE. If we need create checksum complete | ||
| 3103 | * here, skb_postpull_rcsum is done so skb->csum start is ptr. | ||
| 3104 | */ | ||
| 3105 | static inline void skb_remcsum_process(struct sk_buff *skb, void *ptr, | ||
| 3106 | int start, int offset) | ||
| 3107 | { | ||
| 3108 | __wsum delta; | ||
| 3109 | |||
| 3110 | if (unlikely(skb->ip_summed != CHECKSUM_COMPLETE)) { | ||
| 3111 | __skb_checksum_complete(skb); | ||
| 3112 | skb_postpull_rcsum(skb, skb->data, ptr - (void *)skb->data); | ||
| 3113 | } | ||
| 3114 | |||
| 3115 | delta = remcsum_adjust(ptr, skb->csum, start, offset); | ||
| 3116 | |||
| 3117 | /* Adjust skb->csum since we changed the packet */ | ||
| 3118 | skb->csum = csum_add(skb->csum, delta); | ||
| 3119 | } | ||
| 3120 | |||
| 3099 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 3121 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
| 3100 | void nf_conntrack_destroy(struct nf_conntrack *nfct); | 3122 | void nf_conntrack_destroy(struct nf_conntrack *nfct); |
| 3101 | static inline void nf_conntrack_put(struct nf_conntrack *nfct) | 3123 | static inline void nf_conntrack_put(struct nf_conntrack *nfct) |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 9a139b637069..2e3b448cfa2d 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
| @@ -116,9 +116,8 @@ struct kmem_cache *kmem_cache_create(const char *, size_t, size_t, | |||
| 116 | unsigned long, | 116 | unsigned long, |
| 117 | void (*)(void *)); | 117 | void (*)(void *)); |
| 118 | #ifdef CONFIG_MEMCG_KMEM | 118 | #ifdef CONFIG_MEMCG_KMEM |
| 119 | struct kmem_cache *memcg_create_kmem_cache(struct mem_cgroup *, | 119 | void memcg_create_kmem_cache(struct mem_cgroup *, struct kmem_cache *); |
| 120 | struct kmem_cache *, | 120 | void memcg_destroy_kmem_caches(struct mem_cgroup *); |
| 121 | const char *); | ||
| 122 | #endif | 121 | #endif |
| 123 | void kmem_cache_destroy(struct kmem_cache *); | 122 | void kmem_cache_destroy(struct kmem_cache *); |
| 124 | int kmem_cache_shrink(struct kmem_cache *); | 123 | int kmem_cache_shrink(struct kmem_cache *); |
| @@ -491,7 +490,6 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) | |||
| 491 | * Child caches will hold extra metadata needed for its operation. Fields are: | 490 | * Child caches will hold extra metadata needed for its operation. Fields are: |
| 492 | * | 491 | * |
| 493 | * @memcg: pointer to the memcg this cache belongs to | 492 | * @memcg: pointer to the memcg this cache belongs to |
| 494 | * @list: list_head for the list of all caches in this memcg | ||
| 495 | * @root_cache: pointer to the global, root cache, this cache was derived from | 493 | * @root_cache: pointer to the global, root cache, this cache was derived from |
| 496 | */ | 494 | */ |
| 497 | struct memcg_cache_params { | 495 | struct memcg_cache_params { |
| @@ -503,7 +501,6 @@ struct memcg_cache_params { | |||
| 503 | }; | 501 | }; |
| 504 | struct { | 502 | struct { |
| 505 | struct mem_cgroup *memcg; | 503 | struct mem_cgroup *memcg; |
| 506 | struct list_head list; | ||
| 507 | struct kmem_cache *root_cache; | 504 | struct kmem_cache *root_cache; |
| 508 | }; | 505 | }; |
| 509 | }; | 506 | }; |
diff --git a/include/linux/smp.h b/include/linux/smp.h index 93dff5fff524..be91db2a7017 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
| @@ -151,6 +151,13 @@ smp_call_function_any(const struct cpumask *mask, smp_call_func_t func, | |||
| 151 | static inline void kick_all_cpus_sync(void) { } | 151 | static inline void kick_all_cpus_sync(void) { } |
| 152 | static inline void wake_up_all_idle_cpus(void) { } | 152 | static inline void wake_up_all_idle_cpus(void) { } |
| 153 | 153 | ||
| 154 | #ifdef CONFIG_UP_LATE_INIT | ||
| 155 | extern void __init up_late_init(void); | ||
| 156 | static inline void smp_init(void) { up_late_init(); } | ||
| 157 | #else | ||
| 158 | static inline void smp_init(void) { } | ||
| 159 | #endif | ||
| 160 | |||
| 154 | #endif /* !SMP */ | 161 | #endif /* !SMP */ |
| 155 | 162 | ||
| 156 | /* | 163 | /* |
diff --git a/include/linux/socket.h b/include/linux/socket.h index 6e49a14365dc..5c19cba34dce 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
| @@ -318,13 +318,6 @@ struct ucred { | |||
| 318 | /* IPX options */ | 318 | /* IPX options */ |
| 319 | #define IPX_TYPE 1 | 319 | #define IPX_TYPE 1 |
| 320 | 320 | ||
| 321 | extern int csum_partial_copy_fromiovecend(unsigned char *kdata, | ||
| 322 | struct iovec *iov, | ||
| 323 | int offset, | ||
| 324 | unsigned int len, __wsum *csump); | ||
| 325 | extern unsigned long iov_pages(const struct iovec *iov, int offset, | ||
| 326 | unsigned long nr_segs); | ||
| 327 | |||
| 328 | extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr_storage *kaddr); | 321 | extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr_storage *kaddr); |
| 329 | extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); | 322 | extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); |
| 330 | 323 | ||
diff --git a/include/linux/spi/at86rf230.h b/include/linux/spi/at86rf230.h index b2b1afbb3202..cd519a11c2c6 100644 --- a/include/linux/spi/at86rf230.h +++ b/include/linux/spi/at86rf230.h | |||
| @@ -12,10 +12,6 @@ | |||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
| 14 | * | 14 | * |
| 15 | * You should have received a copy of the GNU General Public License along | ||
| 16 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 18 | * | ||
| 19 | * Written by: | 15 | * Written by: |
| 20 | * Dmitry Eremin-Solenikov <dmitry.baryshkov@siemens.com> | 16 | * Dmitry Eremin-Solenikov <dmitry.baryshkov@siemens.com> |
| 21 | */ | 17 | */ |
diff --git a/include/linux/spi/l4f00242t03.h b/include/linux/spi/l4f00242t03.h index bc8677c8eba9..e69e9b51b21a 100644 --- a/include/linux/spi/l4f00242t03.h +++ b/include/linux/spi/l4f00242t03.h | |||
| @@ -12,10 +12,6 @@ | |||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. | 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 | */ | 15 | */ |
| 20 | 16 | ||
| 21 | #ifndef _INCLUDE_LINUX_SPI_L4F00242T03_H_ | 17 | #ifndef _INCLUDE_LINUX_SPI_L4F00242T03_H_ |
diff --git a/include/linux/spi/lms283gf05.h b/include/linux/spi/lms283gf05.h index 555d254e6606..fdd1d1d51da5 100644 --- a/include/linux/spi/lms283gf05.h +++ b/include/linux/spi/lms283gf05.h | |||
| @@ -11,10 +11,6 @@ | |||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program; if not, write to the Free Software | ||
| 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 18 | */ | 14 | */ |
| 19 | 15 | ||
| 20 | #ifndef _INCLUDE_LINUX_SPI_LMS283GF05_H_ | 16 | #ifndef _INCLUDE_LINUX_SPI_LMS283GF05_H_ |
diff --git a/include/linux/spi/mxs-spi.h b/include/linux/spi/mxs-spi.h index 4835486f58e5..381d368b91b4 100644 --- a/include/linux/spi/mxs-spi.h +++ b/include/linux/spi/mxs-spi.h | |||
| @@ -15,10 +15,6 @@ | |||
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. | 17 | * GNU General Public License for more details. |
| 18 | * | ||
| 19 | * You should have received a copy of the GNU General Public License along | ||
| 20 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 21 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 22 | */ | 18 | */ |
| 23 | 19 | ||
| 24 | #ifndef __LINUX_SPI_MXS_SPI_H__ | 20 | #ifndef __LINUX_SPI_MXS_SPI_H__ |
diff --git a/include/linux/spi/pxa2xx_spi.h b/include/linux/spi/pxa2xx_spi.h index d5a316550177..6d36dacec4ba 100644 --- a/include/linux/spi/pxa2xx_spi.h +++ b/include/linux/spi/pxa2xx_spi.h | |||
| @@ -10,10 +10,6 @@ | |||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. |
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program; if not, write to the Free Software | ||
| 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 17 | */ | 13 | */ |
| 18 | #ifndef __linux_pxa2xx_spi_h | 14 | #ifndef __linux_pxa2xx_spi_h |
| 19 | #define __linux_pxa2xx_spi_h | 15 | #define __linux_pxa2xx_spi_h |
| @@ -57,7 +53,6 @@ struct pxa2xx_spi_chip { | |||
| 57 | #if defined(CONFIG_ARCH_PXA) || defined(CONFIG_ARCH_MMP) | 53 | #if defined(CONFIG_ARCH_PXA) || defined(CONFIG_ARCH_MMP) |
| 58 | 54 | ||
| 59 | #include <linux/clk.h> | 55 | #include <linux/clk.h> |
| 60 | #include <mach/dma.h> | ||
| 61 | 56 | ||
| 62 | extern void pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info); | 57 | extern void pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info); |
| 63 | 58 | ||
diff --git a/include/linux/spi/rspi.h b/include/linux/spi/rspi.h index e546b2ceb623..a693188cc08b 100644 --- a/include/linux/spi/rspi.h +++ b/include/linux/spi/rspi.h | |||
| @@ -11,11 +11,6 @@ | |||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program; if not, write to the Free Software | ||
| 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 18 | * | ||
| 19 | */ | 14 | */ |
| 20 | 15 | ||
| 21 | #ifndef __LINUX_SPI_RENESAS_SPI_H__ | 16 | #ifndef __LINUX_SPI_RENESAS_SPI_H__ |
diff --git a/include/linux/spi/sh_hspi.h b/include/linux/spi/sh_hspi.h index a1121f872ac1..aa0d440ab4f0 100644 --- a/include/linux/spi/sh_hspi.h +++ b/include/linux/spi/sh_hspi.h | |||
| @@ -9,10 +9,6 @@ | |||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. | 11 | * GNU General Public License for more details. |
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program; if not, write to the Free Software | ||
| 15 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 16 | */ | 12 | */ |
| 17 | #ifndef SH_HSPI_H | 13 | #ifndef SH_HSPI_H |
| 18 | #define SH_HSPI_H | 14 | #define SH_HSPI_H |
diff --git a/include/linux/spi/sh_msiof.h b/include/linux/spi/sh_msiof.h index 88a14d81c49e..b087a85f5f72 100644 --- a/include/linux/spi/sh_msiof.h +++ b/include/linux/spi/sh_msiof.h | |||
| @@ -7,6 +7,8 @@ struct sh_msiof_spi_info { | |||
| 7 | u16 num_chipselect; | 7 | u16 num_chipselect; |
| 8 | unsigned int dma_tx_id; | 8 | unsigned int dma_tx_id; |
| 9 | unsigned int dma_rx_id; | 9 | unsigned int dma_rx_id; |
| 10 | u32 dtdl; | ||
| 11 | u32 syncdl; | ||
| 10 | }; | 12 | }; |
| 11 | 13 | ||
| 12 | #endif /* __SPI_SH_MSIOF_H__ */ | 14 | #endif /* __SPI_SH_MSIOF_H__ */ |
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index a6ef2a8e6de4..ed9489d893a4 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
| @@ -10,10 +10,6 @@ | |||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. |
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program; if not, write to the Free Software | ||
| 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 17 | */ | 13 | */ |
| 18 | 14 | ||
| 19 | #ifndef __LINUX_SPI_H | 15 | #ifndef __LINUX_SPI_H |
| @@ -260,6 +256,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
| 260 | * @pump_messages: work struct for scheduling work to the message pump | 256 | * @pump_messages: work struct for scheduling work to the message pump |
| 261 | * @queue_lock: spinlock to syncronise access to message queue | 257 | * @queue_lock: spinlock to syncronise access to message queue |
| 262 | * @queue: message queue | 258 | * @queue: message queue |
| 259 | * @idling: the device is entering idle state | ||
| 263 | * @cur_msg: the currently in-flight message | 260 | * @cur_msg: the currently in-flight message |
| 264 | * @cur_msg_prepared: spi_prepare_message was called for the currently | 261 | * @cur_msg_prepared: spi_prepare_message was called for the currently |
| 265 | * in-flight message | 262 | * in-flight message |
| @@ -425,6 +422,7 @@ struct spi_master { | |||
| 425 | spinlock_t queue_lock; | 422 | spinlock_t queue_lock; |
| 426 | struct list_head queue; | 423 | struct list_head queue; |
| 427 | struct spi_message *cur_msg; | 424 | struct spi_message *cur_msg; |
| 425 | bool idling; | ||
| 428 | bool busy; | 426 | bool busy; |
| 429 | bool running; | 427 | bool running; |
| 430 | bool rt; | 428 | bool rt; |
diff --git a/include/linux/spi/tle62x0.h b/include/linux/spi/tle62x0.h index 60b59187e590..414c6fddfcf0 100644 --- a/include/linux/spi/tle62x0.h +++ b/include/linux/spi/tle62x0.h | |||
| @@ -12,10 +12,6 @@ | |||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. | 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 | */ | 15 | */ |
| 20 | 16 | ||
| 21 | struct tle62x0_pdata { | 17 | struct tle62x0_pdata { |
diff --git a/include/linux/spi/tsc2005.h b/include/linux/spi/tsc2005.h index 8f721e465e05..563b3b1799a8 100644 --- a/include/linux/spi/tsc2005.h +++ b/include/linux/spi/tsc2005.h | |||
| @@ -12,11 +12,6 @@ | |||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. | 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 | */ | 15 | */ |
| 21 | 16 | ||
| 22 | #ifndef _LINUX_SPI_TSC2005_H | 17 | #ifndef _LINUX_SPI_TSC2005_H |
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 262ba4ef9a8e..3e18379dfa6f 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
| @@ -190,6 +190,8 @@ static inline void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock) | |||
| 190 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 190 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
| 191 | # define raw_spin_lock_nested(lock, subclass) \ | 191 | # define raw_spin_lock_nested(lock, subclass) \ |
| 192 | _raw_spin_lock_nested(lock, subclass) | 192 | _raw_spin_lock_nested(lock, subclass) |
| 193 | # define raw_spin_lock_bh_nested(lock, subclass) \ | ||
| 194 | _raw_spin_lock_bh_nested(lock, subclass) | ||
| 193 | 195 | ||
| 194 | # define raw_spin_lock_nest_lock(lock, nest_lock) \ | 196 | # define raw_spin_lock_nest_lock(lock, nest_lock) \ |
| 195 | do { \ | 197 | do { \ |
| @@ -205,6 +207,7 @@ static inline void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock) | |||
| 205 | # define raw_spin_lock_nested(lock, subclass) \ | 207 | # define raw_spin_lock_nested(lock, subclass) \ |
| 206 | _raw_spin_lock(((void)(subclass), (lock))) | 208 | _raw_spin_lock(((void)(subclass), (lock))) |
| 207 | # define raw_spin_lock_nest_lock(lock, nest_lock) _raw_spin_lock(lock) | 209 | # define raw_spin_lock_nest_lock(lock, nest_lock) _raw_spin_lock(lock) |
| 210 | # define raw_spin_lock_bh_nested(lock, subclass) _raw_spin_lock_bh(lock) | ||
| 208 | #endif | 211 | #endif |
| 209 | 212 | ||
| 210 | #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) | 213 | #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) |
| @@ -324,6 +327,11 @@ do { \ | |||
| 324 | raw_spin_lock_nested(spinlock_check(lock), subclass); \ | 327 | raw_spin_lock_nested(spinlock_check(lock), subclass); \ |
| 325 | } while (0) | 328 | } while (0) |
| 326 | 329 | ||
| 330 | #define spin_lock_bh_nested(lock, subclass) \ | ||
| 331 | do { \ | ||
| 332 | raw_spin_lock_bh_nested(spinlock_check(lock), subclass);\ | ||
| 333 | } while (0) | ||
| 334 | |||
| 327 | #define spin_lock_nest_lock(lock, nest_lock) \ | 335 | #define spin_lock_nest_lock(lock, nest_lock) \ |
| 328 | do { \ | 336 | do { \ |
| 329 | raw_spin_lock_nest_lock(spinlock_check(lock), nest_lock); \ | 337 | raw_spin_lock_nest_lock(spinlock_check(lock), nest_lock); \ |
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h index 42dfab89e740..5344268e6e62 100644 --- a/include/linux/spinlock_api_smp.h +++ b/include/linux/spinlock_api_smp.h | |||
| @@ -22,6 +22,8 @@ int in_lock_functions(unsigned long addr); | |||
| 22 | void __lockfunc _raw_spin_lock(raw_spinlock_t *lock) __acquires(lock); | 22 | void __lockfunc _raw_spin_lock(raw_spinlock_t *lock) __acquires(lock); |
| 23 | void __lockfunc _raw_spin_lock_nested(raw_spinlock_t *lock, int subclass) | 23 | void __lockfunc _raw_spin_lock_nested(raw_spinlock_t *lock, int subclass) |
| 24 | __acquires(lock); | 24 | __acquires(lock); |
| 25 | void __lockfunc _raw_spin_lock_bh_nested(raw_spinlock_t *lock, int subclass) | ||
| 26 | __acquires(lock); | ||
| 25 | void __lockfunc | 27 | void __lockfunc |
| 26 | _raw_spin_lock_nest_lock(raw_spinlock_t *lock, struct lockdep_map *map) | 28 | _raw_spin_lock_nest_lock(raw_spinlock_t *lock, struct lockdep_map *map) |
| 27 | __acquires(lock); | 29 | __acquires(lock); |
diff --git a/include/linux/spinlock_api_up.h b/include/linux/spinlock_api_up.h index d0d188861ad6..d3afef9d8dbe 100644 --- a/include/linux/spinlock_api_up.h +++ b/include/linux/spinlock_api_up.h | |||
| @@ -57,6 +57,7 @@ | |||
| 57 | 57 | ||
| 58 | #define _raw_spin_lock(lock) __LOCK(lock) | 58 | #define _raw_spin_lock(lock) __LOCK(lock) |
| 59 | #define _raw_spin_lock_nested(lock, subclass) __LOCK(lock) | 59 | #define _raw_spin_lock_nested(lock, subclass) __LOCK(lock) |
| 60 | #define _raw_spin_lock_bh_nested(lock, subclass) __LOCK(lock) | ||
| 60 | #define _raw_read_lock(lock) __LOCK(lock) | 61 | #define _raw_read_lock(lock) __LOCK(lock) |
| 61 | #define _raw_write_lock(lock) __LOCK(lock) | 62 | #define _raw_write_lock(lock) __LOCK(lock) |
| 62 | #define _raw_spin_lock_bh(lock) __LOCK_BH(lock) | 63 | #define _raw_spin_lock_bh(lock) __LOCK_BH(lock) |
diff --git a/include/linux/srcu.h b/include/linux/srcu.h index a2783cb5d275..9cfd9623fb03 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h | |||
| @@ -45,7 +45,7 @@ struct rcu_batch { | |||
| 45 | #define RCU_BATCH_INIT(name) { NULL, &(name.head) } | 45 | #define RCU_BATCH_INIT(name) { NULL, &(name.head) } |
| 46 | 46 | ||
| 47 | struct srcu_struct { | 47 | struct srcu_struct { |
| 48 | unsigned completed; | 48 | unsigned long completed; |
| 49 | struct srcu_struct_array __percpu *per_cpu_ref; | 49 | struct srcu_struct_array __percpu *per_cpu_ref; |
| 50 | spinlock_t queue_lock; /* protect ->batch_queue, ->running */ | 50 | spinlock_t queue_lock; /* protect ->batch_queue, ->running */ |
| 51 | bool running; | 51 | bool running; |
| @@ -102,13 +102,11 @@ void process_srcu(struct work_struct *work); | |||
| 102 | * define and init a srcu struct at build time. | 102 | * define and init a srcu struct at build time. |
| 103 | * dont't call init_srcu_struct() nor cleanup_srcu_struct() on it. | 103 | * dont't call init_srcu_struct() nor cleanup_srcu_struct() on it. |
| 104 | */ | 104 | */ |
| 105 | #define DEFINE_SRCU(name) \ | 105 | #define __DEFINE_SRCU(name, is_static) \ |
| 106 | static DEFINE_PER_CPU(struct srcu_struct_array, name##_srcu_array);\ | 106 | static DEFINE_PER_CPU(struct srcu_struct_array, name##_srcu_array);\ |
| 107 | struct srcu_struct name = __SRCU_STRUCT_INIT(name); | 107 | is_static struct srcu_struct name = __SRCU_STRUCT_INIT(name) |
| 108 | 108 | #define DEFINE_SRCU(name) __DEFINE_SRCU(name, /* not static */) | |
| 109 | #define DEFINE_STATIC_SRCU(name) \ | 109 | #define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, static) |
| 110 | static DEFINE_PER_CPU(struct srcu_struct_array, name##_srcu_array);\ | ||
| 111 | static struct srcu_struct name = __SRCU_STRUCT_INIT(name); | ||
| 112 | 110 | ||
| 113 | /** | 111 | /** |
| 114 | * call_srcu() - Queue a callback for invocation after an SRCU grace period | 112 | * call_srcu() - Queue a callback for invocation after an SRCU grace period |
| @@ -135,7 +133,7 @@ int __srcu_read_lock(struct srcu_struct *sp) __acquires(sp); | |||
| 135 | void __srcu_read_unlock(struct srcu_struct *sp, int idx) __releases(sp); | 133 | void __srcu_read_unlock(struct srcu_struct *sp, int idx) __releases(sp); |
| 136 | void synchronize_srcu(struct srcu_struct *sp); | 134 | void synchronize_srcu(struct srcu_struct *sp); |
| 137 | void synchronize_srcu_expedited(struct srcu_struct *sp); | 135 | void synchronize_srcu_expedited(struct srcu_struct *sp); |
| 138 | long srcu_batches_completed(struct srcu_struct *sp); | 136 | unsigned long srcu_batches_completed(struct srcu_struct *sp); |
| 139 | void srcu_barrier(struct srcu_struct *sp); | 137 | void srcu_barrier(struct srcu_struct *sp); |
| 140 | 138 | ||
| 141 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 139 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h index f7b9100686c3..c0f707ac192b 100644 --- a/include/linux/ssb/ssb_regs.h +++ b/include/linux/ssb/ssb_regs.h | |||
| @@ -173,6 +173,7 @@ | |||
| 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_SPROMSIZE_WORDS_R10 230 |
| 176 | #define SSB_SPROMSIZE_WORDS_R11 234 | ||
| 176 | #define SSB_SPROM_BASE1 0x1000 | 177 | #define SSB_SPROM_BASE1 0x1000 |
| 177 | #define SSB_SPROM_BASE31 0x0800 | 178 | #define SSB_SPROM_BASE31 0x0800 |
| 178 | #define SSB_SPROM_REVISION 0x007E | 179 | #define SSB_SPROM_REVISION 0x007E |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 6f22cfeef5e3..fae6fb947fc8 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
| @@ -110,7 +110,7 @@ struct svc_serv { | |||
| 110 | * We use sv_nrthreads as a reference count. svc_destroy() drops | 110 | * We use sv_nrthreads as a reference count. svc_destroy() drops |
| 111 | * this refcount, so we need to bump it up around operations that | 111 | * this refcount, so we need to bump it up around operations that |
| 112 | * change the number of threads. Horrible, but there it is. | 112 | * change the number of threads. Horrible, but there it is. |
| 113 | * Should be called with the BKL held. | 113 | * Should be called with the "service mutex" held. |
| 114 | */ | 114 | */ |
| 115 | static inline void svc_get(struct svc_serv *serv) | 115 | static inline void svc_get(struct svc_serv *serv) |
| 116 | { | 116 | { |
diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h index ddfe88f52219..df8edf8ec914 100644 --- a/include/linux/sunrpc/svc_rdma.h +++ b/include/linux/sunrpc/svc_rdma.h | |||
| @@ -77,6 +77,7 @@ struct svc_rdma_op_ctxt { | |||
| 77 | enum ib_wr_opcode wr_op; | 77 | enum ib_wr_opcode wr_op; |
| 78 | enum ib_wc_status wc_status; | 78 | enum ib_wc_status wc_status; |
| 79 | u32 byte_len; | 79 | u32 byte_len; |
| 80 | u32 position; | ||
| 80 | struct svcxprt_rdma *xprt; | 81 | struct svcxprt_rdma *xprt; |
| 81 | unsigned long flags; | 82 | unsigned long flags; |
| 82 | enum dma_data_direction direction; | 83 | enum dma_data_direction direction; |
| @@ -148,6 +149,10 @@ struct svcxprt_rdma { | |||
| 148 | struct ib_cq *sc_rq_cq; | 149 | struct ib_cq *sc_rq_cq; |
| 149 | struct ib_cq *sc_sq_cq; | 150 | struct ib_cq *sc_sq_cq; |
| 150 | struct ib_mr *sc_phys_mr; /* MR for server memory */ | 151 | struct ib_mr *sc_phys_mr; /* MR for server memory */ |
| 152 | int (*sc_reader)(struct svcxprt_rdma *, | ||
| 153 | struct svc_rqst *, | ||
| 154 | struct svc_rdma_op_ctxt *, | ||
| 155 | int *, u32 *, u32, u32, u64, bool); | ||
| 151 | u32 sc_dev_caps; /* distilled device caps */ | 156 | u32 sc_dev_caps; /* distilled device caps */ |
| 152 | u32 sc_dma_lkey; /* local dma key */ | 157 | u32 sc_dma_lkey; /* local dma key */ |
| 153 | unsigned int sc_frmr_pg_list_len; | 158 | unsigned int sc_frmr_pg_list_len; |
| @@ -176,8 +181,6 @@ struct svcxprt_rdma { | |||
| 176 | #define RPCRDMA_MAX_REQ_SIZE 4096 | 181 | #define RPCRDMA_MAX_REQ_SIZE 4096 |
| 177 | 182 | ||
| 178 | /* svc_rdma_marshal.c */ | 183 | /* svc_rdma_marshal.c */ |
| 179 | extern void svc_rdma_rcl_chunk_counts(struct rpcrdma_read_chunk *, | ||
| 180 | int *, int *); | ||
| 181 | extern int svc_rdma_xdr_decode_req(struct rpcrdma_msg **, struct svc_rqst *); | 184 | extern int svc_rdma_xdr_decode_req(struct rpcrdma_msg **, struct svc_rqst *); |
| 182 | extern int svc_rdma_xdr_decode_deferred_req(struct svc_rqst *); | 185 | extern int svc_rdma_xdr_decode_deferred_req(struct svc_rqst *); |
| 183 | extern int svc_rdma_xdr_encode_error(struct svcxprt_rdma *, | 186 | extern int svc_rdma_xdr_encode_error(struct svcxprt_rdma *, |
| @@ -195,6 +198,12 @@ extern int svc_rdma_xdr_get_reply_hdr_len(struct rpcrdma_msg *); | |||
| 195 | 198 | ||
| 196 | /* svc_rdma_recvfrom.c */ | 199 | /* svc_rdma_recvfrom.c */ |
| 197 | extern int svc_rdma_recvfrom(struct svc_rqst *); | 200 | extern int svc_rdma_recvfrom(struct svc_rqst *); |
| 201 | extern int rdma_read_chunk_lcl(struct svcxprt_rdma *, struct svc_rqst *, | ||
| 202 | struct svc_rdma_op_ctxt *, int *, u32 *, | ||
| 203 | u32, u32, u64, bool); | ||
| 204 | extern int rdma_read_chunk_frmr(struct svcxprt_rdma *, struct svc_rqst *, | ||
| 205 | struct svc_rdma_op_ctxt *, int *, u32 *, | ||
| 206 | u32, u32, u64, bool); | ||
| 198 | 207 | ||
| 199 | /* svc_rdma_sendto.c */ | 208 | /* svc_rdma_sendto.c */ |
| 200 | extern int svc_rdma_sendto(struct svc_rqst *); | 209 | extern int svc_rdma_sendto(struct svc_rqst *); |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 34e8b60ab973..7067eca501e2 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
| @@ -437,16 +437,6 @@ extern int reuse_swap_page(struct page *); | |||
| 437 | extern int try_to_free_swap(struct page *); | 437 | extern int try_to_free_swap(struct page *); |
| 438 | struct backing_dev_info; | 438 | struct backing_dev_info; |
| 439 | 439 | ||
| 440 | #ifdef CONFIG_MEMCG | ||
| 441 | extern void | ||
| 442 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout); | ||
| 443 | #else | ||
| 444 | static inline void | ||
| 445 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout) | ||
| 446 | { | ||
| 447 | } | ||
| 448 | #endif | ||
| 449 | |||
| 450 | #else /* CONFIG_SWAP */ | 440 | #else /* CONFIG_SWAP */ |
| 451 | 441 | ||
| 452 | #define swap_address_space(entry) (NULL) | 442 | #define swap_address_space(entry) (NULL) |
| @@ -547,11 +537,6 @@ static inline swp_entry_t get_swap_page(void) | |||
| 547 | return entry; | 537 | return entry; |
| 548 | } | 538 | } |
| 549 | 539 | ||
| 550 | static inline void | ||
| 551 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent) | ||
| 552 | { | ||
| 553 | } | ||
| 554 | |||
| 555 | #endif /* CONFIG_SWAP */ | 540 | #endif /* CONFIG_SWAP */ |
| 556 | #endif /* __KERNEL__*/ | 541 | #endif /* __KERNEL__*/ |
| 557 | #endif /* _LINUX_SWAP_H */ | 542 | #endif /* _LINUX_SWAP_H */ |
diff --git a/include/linux/swapops.h b/include/linux/swapops.h index 6adfb7bfbf44..831a3168ab35 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h | |||
| @@ -54,7 +54,7 @@ static inline pgoff_t swp_offset(swp_entry_t entry) | |||
| 54 | /* check whether a pte points to a swap entry */ | 54 | /* check whether a pte points to a swap entry */ |
| 55 | static inline int is_swap_pte(pte_t pte) | 55 | static inline int is_swap_pte(pte_t pte) |
| 56 | { | 56 | { |
| 57 | return !pte_none(pte) && !pte_present_nonuma(pte) && !pte_file(pte); | 57 | return !pte_none(pte) && !pte_present_nonuma(pte); |
| 58 | } | 58 | } |
| 59 | #endif | 59 | #endif |
| 60 | 60 | ||
| @@ -66,7 +66,6 @@ static inline swp_entry_t pte_to_swp_entry(pte_t pte) | |||
| 66 | { | 66 | { |
| 67 | swp_entry_t arch_entry; | 67 | swp_entry_t arch_entry; |
| 68 | 68 | ||
| 69 | BUG_ON(pte_file(pte)); | ||
| 70 | if (pte_swp_soft_dirty(pte)) | 69 | if (pte_swp_soft_dirty(pte)) |
| 71 | pte = pte_swp_clear_soft_dirty(pte); | 70 | pte = pte_swp_clear_soft_dirty(pte); |
| 72 | arch_entry = __pte_to_swp_entry(pte); | 71 | arch_entry = __pte_to_swp_entry(pte); |
| @@ -82,7 +81,6 @@ static inline pte_t swp_entry_to_pte(swp_entry_t entry) | |||
| 82 | swp_entry_t arch_entry; | 81 | swp_entry_t arch_entry; |
| 83 | 82 | ||
| 84 | arch_entry = __swp_entry(swp_type(entry), swp_offset(entry)); | 83 | arch_entry = __swp_entry(swp_type(entry), swp_offset(entry)); |
| 85 | BUG_ON(pte_file(__swp_entry_to_pte(arch_entry))); | ||
| 86 | return __swp_entry_to_pte(arch_entry); | 84 | return __swp_entry_to_pte(arch_entry); |
| 87 | } | 85 | } |
| 88 | 86 | ||
| @@ -137,6 +135,8 @@ static inline void make_migration_entry_read(swp_entry_t *entry) | |||
| 137 | *entry = swp_entry(SWP_MIGRATION_READ, swp_offset(*entry)); | 135 | *entry = swp_entry(SWP_MIGRATION_READ, swp_offset(*entry)); |
| 138 | } | 136 | } |
| 139 | 137 | ||
| 138 | extern void __migration_entry_wait(struct mm_struct *mm, pte_t *ptep, | ||
| 139 | spinlock_t *ptl); | ||
| 140 | extern void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, | 140 | extern void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, |
| 141 | unsigned long address); | 141 | unsigned long address); |
| 142 | extern void migration_entry_wait_huge(struct vm_area_struct *vma, | 142 | extern void migration_entry_wait_huge(struct vm_area_struct *vma, |
| @@ -150,6 +150,8 @@ static inline int is_migration_entry(swp_entry_t swp) | |||
| 150 | } | 150 | } |
| 151 | #define migration_entry_to_page(swp) NULL | 151 | #define migration_entry_to_page(swp) NULL |
| 152 | static inline void make_migration_entry_read(swp_entry_t *entryp) { } | 152 | static inline void make_migration_entry_read(swp_entry_t *entryp) { } |
| 153 | static inline void __migration_entry_wait(struct mm_struct *mm, pte_t *ptep, | ||
| 154 | spinlock_t *ptl) { } | ||
| 153 | static inline void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, | 155 | static inline void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, |
| 154 | unsigned long address) { } | 156 | unsigned long address) { } |
| 155 | static inline void migration_entry_wait_huge(struct vm_area_struct *vma, | 157 | static inline void migration_entry_wait_huge(struct vm_area_struct *vma, |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 85893d744901..76d1e38aabe1 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -410,12 +410,16 @@ asmlinkage long sys_newlstat(const char __user *filename, | |||
| 410 | struct stat __user *statbuf); | 410 | struct stat __user *statbuf); |
| 411 | asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf); | 411 | asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf); |
| 412 | asmlinkage long sys_ustat(unsigned dev, struct ustat __user *ubuf); | 412 | asmlinkage long sys_ustat(unsigned dev, struct ustat __user *ubuf); |
| 413 | #if BITS_PER_LONG == 32 | 413 | #if defined(__ARCH_WANT_STAT64) || defined(__ARCH_WANT_COMPAT_STAT64) |
| 414 | asmlinkage long sys_stat64(const char __user *filename, | 414 | asmlinkage long sys_stat64(const char __user *filename, |
| 415 | struct stat64 __user *statbuf); | 415 | struct stat64 __user *statbuf); |
| 416 | asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user *statbuf); | 416 | asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user *statbuf); |
| 417 | asmlinkage long sys_lstat64(const char __user *filename, | 417 | asmlinkage long sys_lstat64(const char __user *filename, |
| 418 | struct stat64 __user *statbuf); | 418 | struct stat64 __user *statbuf); |
| 419 | asmlinkage long sys_fstatat64(int dfd, const char __user *filename, | ||
| 420 | struct stat64 __user *statbuf, int flag); | ||
| 421 | #endif | ||
| 422 | #if BITS_PER_LONG == 32 | ||
| 419 | asmlinkage long sys_truncate64(const char __user *path, loff_t length); | 423 | asmlinkage long sys_truncate64(const char __user *path, loff_t length); |
| 420 | asmlinkage long sys_ftruncate64(unsigned int fd, loff_t length); | 424 | asmlinkage long sys_ftruncate64(unsigned int fd, loff_t length); |
| 421 | #endif | 425 | #endif |
| @@ -771,8 +775,6 @@ asmlinkage long sys_openat(int dfd, const char __user *filename, int flags, | |||
| 771 | umode_t mode); | 775 | umode_t mode); |
| 772 | asmlinkage long sys_newfstatat(int dfd, const char __user *filename, | 776 | asmlinkage long sys_newfstatat(int dfd, const char __user *filename, |
| 773 | struct stat __user *statbuf, int flag); | 777 | struct stat __user *statbuf, int flag); |
| 774 | asmlinkage long sys_fstatat64(int dfd, const char __user *filename, | ||
| 775 | struct stat64 __user *statbuf, int flag); | ||
| 776 | asmlinkage long sys_readlinkat(int dfd, const char __user *path, char __user *buf, | 778 | asmlinkage long sys_readlinkat(int dfd, const char __user *path, char __user *buf, |
| 777 | int bufsiz); | 779 | int bufsiz); |
| 778 | asmlinkage long sys_utimensat(int dfd, const char __user *filename, | 780 | asmlinkage long sys_utimensat(int dfd, const char __user *filename, |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 67309ece0772..1a7adb411647 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
| @@ -115,6 +115,7 @@ struct tcp_request_sock { | |||
| 115 | u32 rcv_isn; | 115 | u32 rcv_isn; |
| 116 | u32 snt_isn; | 116 | u32 snt_isn; |
| 117 | u32 snt_synack; /* synack sent time */ | 117 | u32 snt_synack; /* synack sent time */ |
| 118 | u32 last_oow_ack_time; /* last SYNACK */ | ||
| 118 | u32 rcv_nxt; /* the ack # by SYNACK. For | 119 | u32 rcv_nxt; /* the ack # by SYNACK. For |
| 119 | * FastOpen it's the seq# | 120 | * FastOpen it's the seq# |
| 120 | * after data-in-SYN. | 121 | * after data-in-SYN. |
| @@ -152,6 +153,7 @@ struct tcp_sock { | |||
| 152 | u32 snd_sml; /* Last byte of the most recently transmitted small packet */ | 153 | u32 snd_sml; /* Last byte of the most recently transmitted small packet */ |
| 153 | u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */ | 154 | u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */ |
| 154 | u32 lsndtime; /* timestamp of last sent data packet (for restart window) */ | 155 | u32 lsndtime; /* timestamp of last sent data packet (for restart window) */ |
| 156 | u32 last_oow_ack_time; /* timestamp of last out-of-window ACK */ | ||
| 155 | 157 | ||
| 156 | u32 tsoffset; /* timestamp offset */ | 158 | u32 tsoffset; /* timestamp offset */ |
| 157 | 159 | ||
| @@ -340,6 +342,10 @@ struct tcp_timewait_sock { | |||
| 340 | u32 tw_rcv_wnd; | 342 | u32 tw_rcv_wnd; |
| 341 | u32 tw_ts_offset; | 343 | u32 tw_ts_offset; |
| 342 | u32 tw_ts_recent; | 344 | u32 tw_ts_recent; |
| 345 | |||
| 346 | /* The time we sent the last out-of-window ACK: */ | ||
| 347 | u32 tw_last_oow_ack_time; | ||
| 348 | |||
| 343 | long tw_ts_recent_stamp; | 349 | long tw_ts_recent_stamp; |
| 344 | #ifdef CONFIG_TCP_MD5SIG | 350 | #ifdef CONFIG_TCP_MD5SIG |
| 345 | struct tcp_md5sig_key *tw_md5_key; | 351 | struct tcp_md5sig_key *tw_md5_key; |
diff --git a/include/linux/time.h b/include/linux/time.h index 203c2ad40d71..beebe3a02d43 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
| @@ -110,6 +110,19 @@ static inline bool timespec_valid_strict(const struct timespec *ts) | |||
| 110 | return true; | 110 | return true; |
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | static inline bool timeval_valid(const struct timeval *tv) | ||
| 114 | { | ||
| 115 | /* Dates before 1970 are bogus */ | ||
| 116 | if (tv->tv_sec < 0) | ||
| 117 | return false; | ||
| 118 | |||
| 119 | /* Can't have more microseconds then a second */ | ||
| 120 | if (tv->tv_usec < 0 || tv->tv_usec >= USEC_PER_SEC) | ||
| 121 | return false; | ||
| 122 | |||
| 123 | return true; | ||
| 124 | } | ||
| 125 | |||
| 113 | extern struct timespec timespec_trunc(struct timespec t, unsigned gran); | 126 | extern struct timespec timespec_trunc(struct timespec t, unsigned gran); |
| 114 | 127 | ||
| 115 | #define CURRENT_TIME (current_kernel_time()) | 128 | #define CURRENT_TIME (current_kernel_time()) |
diff --git a/include/linux/timecounter.h b/include/linux/timecounter.h new file mode 100644 index 000000000000..4382035a75bb --- /dev/null +++ b/include/linux/timecounter.h | |||
| @@ -0,0 +1,139 @@ | |||
| 1 | /* | ||
| 2 | * linux/include/linux/timecounter.h | ||
| 3 | * | ||
| 4 | * based on code that migrated away from | ||
| 5 | * linux/include/linux/clocksource.h | ||
| 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 as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | */ | ||
| 17 | #ifndef _LINUX_TIMECOUNTER_H | ||
| 18 | #define _LINUX_TIMECOUNTER_H | ||
| 19 | |||
| 20 | #include <linux/types.h> | ||
| 21 | |||
| 22 | /* simplify initialization of mask field */ | ||
| 23 | #define CYCLECOUNTER_MASK(bits) (cycle_t)((bits) < 64 ? ((1ULL<<(bits))-1) : -1) | ||
| 24 | |||
| 25 | /** | ||
| 26 | * struct cyclecounter - hardware abstraction for a free running counter | ||
| 27 | * Provides completely state-free accessors to the underlying hardware. | ||
| 28 | * Depending on which hardware it reads, the cycle counter may wrap | ||
| 29 | * around quickly. Locking rules (if necessary) have to be defined | ||
| 30 | * by the implementor and user of specific instances of this API. | ||
| 31 | * | ||
| 32 | * @read: returns the current cycle value | ||
| 33 | * @mask: bitmask for two's complement | ||
| 34 | * subtraction of non 64 bit counters, | ||
| 35 | * see CYCLECOUNTER_MASK() helper macro | ||
| 36 | * @mult: cycle to nanosecond multiplier | ||
| 37 | * @shift: cycle to nanosecond divisor (power of two) | ||
| 38 | */ | ||
| 39 | struct cyclecounter { | ||
| 40 | cycle_t (*read)(const struct cyclecounter *cc); | ||
| 41 | cycle_t mask; | ||
| 42 | u32 mult; | ||
| 43 | u32 shift; | ||
| 44 | }; | ||
| 45 | |||
| 46 | /** | ||
| 47 | * struct timecounter - layer above a %struct cyclecounter which counts nanoseconds | ||
| 48 | * Contains the state needed by timecounter_read() to detect | ||
| 49 | * cycle counter wrap around. Initialize with | ||
| 50 | * timecounter_init(). Also used to convert cycle counts into the | ||
| 51 | * corresponding nanosecond counts with timecounter_cyc2time(). Users | ||
| 52 | * of this code are responsible for initializing the underlying | ||
| 53 | * cycle counter hardware, locking issues and reading the time | ||
| 54 | * more often than the cycle counter wraps around. The nanosecond | ||
| 55 | * counter will only wrap around after ~585 years. | ||
| 56 | * | ||
| 57 | * @cc: the cycle counter used by this instance | ||
| 58 | * @cycle_last: most recent cycle counter value seen by | ||
| 59 | * timecounter_read() | ||
| 60 | * @nsec: continuously increasing count | ||
| 61 | * @mask: bit mask for maintaining the 'frac' field | ||
| 62 | * @frac: accumulated fractional nanoseconds | ||
| 63 | */ | ||
| 64 | struct timecounter { | ||
| 65 | const struct cyclecounter *cc; | ||
| 66 | cycle_t cycle_last; | ||
| 67 | u64 nsec; | ||
| 68 | u64 mask; | ||
| 69 | u64 frac; | ||
| 70 | }; | ||
| 71 | |||
| 72 | /** | ||
| 73 | * cyclecounter_cyc2ns - converts cycle counter cycles to nanoseconds | ||
| 74 | * @cc: Pointer to cycle counter. | ||
| 75 | * @cycles: Cycles | ||
| 76 | * @mask: bit mask for maintaining the 'frac' field | ||
| 77 | * @frac: pointer to storage for the fractional nanoseconds. | ||
| 78 | */ | ||
| 79 | static inline u64 cyclecounter_cyc2ns(const struct cyclecounter *cc, | ||
| 80 | cycle_t cycles, u64 mask, u64 *frac) | ||
| 81 | { | ||
| 82 | u64 ns = (u64) cycles; | ||
| 83 | |||
| 84 | ns = (ns * cc->mult) + *frac; | ||
| 85 | *frac = ns & mask; | ||
| 86 | return ns >> cc->shift; | ||
| 87 | } | ||
| 88 | |||
| 89 | /** | ||
| 90 | * timecounter_adjtime - Shifts the time of the clock. | ||
| 91 | * @delta: Desired change in nanoseconds. | ||
| 92 | */ | ||
| 93 | static inline void timecounter_adjtime(struct timecounter *tc, s64 delta) | ||
| 94 | { | ||
| 95 | tc->nsec += delta; | ||
| 96 | } | ||
| 97 | |||
| 98 | /** | ||
| 99 | * timecounter_init - initialize a time counter | ||
| 100 | * @tc: Pointer to time counter which is to be initialized/reset | ||
| 101 | * @cc: A cycle counter, ready to be used. | ||
| 102 | * @start_tstamp: Arbitrary initial time stamp. | ||
| 103 | * | ||
| 104 | * After this call the current cycle register (roughly) corresponds to | ||
| 105 | * the initial time stamp. Every call to timecounter_read() increments | ||
| 106 | * the time stamp counter by the number of elapsed nanoseconds. | ||
| 107 | */ | ||
| 108 | extern void timecounter_init(struct timecounter *tc, | ||
| 109 | const struct cyclecounter *cc, | ||
| 110 | u64 start_tstamp); | ||
| 111 | |||
| 112 | /** | ||
| 113 | * timecounter_read - return nanoseconds elapsed since timecounter_init() | ||
| 114 | * plus the initial time stamp | ||
| 115 | * @tc: Pointer to time counter. | ||
| 116 | * | ||
| 117 | * In other words, keeps track of time since the same epoch as | ||
| 118 | * the function which generated the initial time stamp. | ||
| 119 | */ | ||
| 120 | extern u64 timecounter_read(struct timecounter *tc); | ||
| 121 | |||
| 122 | /** | ||
| 123 | * timecounter_cyc2time - convert a cycle counter to same | ||
| 124 | * time base as values returned by | ||
| 125 | * timecounter_read() | ||
| 126 | * @tc: Pointer to time counter. | ||
| 127 | * @cycle_tstamp: a value returned by tc->cc->read() | ||
| 128 | * | ||
| 129 | * Cycle counts that are converted correctly as long as they | ||
| 130 | * fall into the interval [-1/2 max cycle count, +1/2 max cycle count], | ||
| 131 | * with "max cycle count" == cs->mask+1. | ||
| 132 | * | ||
| 133 | * This allows conversion of cycle counter values which were generated | ||
| 134 | * in the past. | ||
| 135 | */ | ||
| 136 | extern u64 timecounter_cyc2time(struct timecounter *tc, | ||
| 137 | cycle_t cycle_tstamp); | ||
| 138 | |||
| 139 | #endif | ||
diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h index 9b63d13ba82b..3eaae4754275 100644 --- a/include/linux/timekeeping.h +++ b/include/linux/timekeeping.h | |||
| @@ -33,6 +33,7 @@ extern time64_t ktime_get_real_seconds(void); | |||
| 33 | 33 | ||
| 34 | extern int __getnstimeofday64(struct timespec64 *tv); | 34 | extern int __getnstimeofday64(struct timespec64 *tv); |
| 35 | extern void getnstimeofday64(struct timespec64 *tv); | 35 | extern void getnstimeofday64(struct timespec64 *tv); |
| 36 | extern void getboottime64(struct timespec64 *ts); | ||
| 36 | 37 | ||
| 37 | #if BITS_PER_LONG == 64 | 38 | #if BITS_PER_LONG == 64 |
| 38 | /** | 39 | /** |
| @@ -72,6 +73,11 @@ static inline struct timespec get_monotonic_coarse(void) | |||
| 72 | { | 73 | { |
| 73 | return get_monotonic_coarse64(); | 74 | return get_monotonic_coarse64(); |
| 74 | } | 75 | } |
| 76 | |||
| 77 | static inline void getboottime(struct timespec *ts) | ||
| 78 | { | ||
| 79 | return getboottime64(ts); | ||
| 80 | } | ||
| 75 | #else | 81 | #else |
| 76 | /** | 82 | /** |
| 77 | * Deprecated. Use do_settimeofday64(). | 83 | * Deprecated. Use do_settimeofday64(). |
| @@ -129,9 +135,15 @@ static inline struct timespec get_monotonic_coarse(void) | |||
| 129 | { | 135 | { |
| 130 | return timespec64_to_timespec(get_monotonic_coarse64()); | 136 | return timespec64_to_timespec(get_monotonic_coarse64()); |
| 131 | } | 137 | } |
| 132 | #endif | ||
| 133 | 138 | ||
| 134 | extern void getboottime(struct timespec *ts); | 139 | static inline void getboottime(struct timespec *ts) |
| 140 | { | ||
| 141 | struct timespec64 ts64; | ||
| 142 | |||
| 143 | getboottime64(&ts64); | ||
| 144 | *ts = timespec64_to_timespec(ts64); | ||
| 145 | } | ||
| 146 | #endif | ||
| 135 | 147 | ||
| 136 | #define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts) | 148 | #define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts) |
| 137 | #define ktime_get_real_ts64(ts) getnstimeofday64(ts) | 149 | #define ktime_get_real_ts64(ts) getnstimeofday64(ts) |
| @@ -217,6 +229,11 @@ static inline void get_monotonic_boottime(struct timespec *ts) | |||
| 217 | *ts = ktime_to_timespec(ktime_get_boottime()); | 229 | *ts = ktime_to_timespec(ktime_get_boottime()); |
| 218 | } | 230 | } |
| 219 | 231 | ||
| 232 | static inline void get_monotonic_boottime64(struct timespec64 *ts) | ||
| 233 | { | ||
| 234 | *ts = ktime_to_timespec64(ktime_get_boottime()); | ||
| 235 | } | ||
| 236 | |||
| 220 | static inline void timekeeping_clocktai(struct timespec *ts) | 237 | static inline void timekeeping_clocktai(struct timespec *ts) |
| 221 | { | 238 | { |
| 222 | *ts = ktime_to_timespec(ktime_get_clocktai()); | 239 | *ts = ktime_to_timespec(ktime_get_clocktai()); |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index e08e21e5f601..c72851328ca9 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
| @@ -173,7 +173,7 @@ extern void syscall_unregfunc(void); | |||
| 173 | TP_PROTO(data_proto), \ | 173 | TP_PROTO(data_proto), \ |
| 174 | TP_ARGS(data_args), \ | 174 | TP_ARGS(data_args), \ |
| 175 | TP_CONDITION(cond),,); \ | 175 | TP_CONDITION(cond),,); \ |
| 176 | if (IS_ENABLED(CONFIG_LOCKDEP)) { \ | 176 | if (IS_ENABLED(CONFIG_LOCKDEP) && (cond)) { \ |
| 177 | rcu_read_lock_sched_notrace(); \ | 177 | rcu_read_lock_sched_notrace(); \ |
| 178 | rcu_dereference_sched(__tracepoint_##name.funcs);\ | 178 | rcu_dereference_sched(__tracepoint_##name.funcs);\ |
| 179 | rcu_read_unlock_sched_notrace(); \ | 179 | rcu_read_unlock_sched_notrace(); \ |
diff --git a/include/linux/types.h b/include/linux/types.h index a0bb7048687f..62323825cff9 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
| @@ -213,5 +213,8 @@ struct callback_head { | |||
| 213 | }; | 213 | }; |
| 214 | #define rcu_head callback_head | 214 | #define rcu_head callback_head |
| 215 | 215 | ||
| 216 | /* clocksource cycle base type */ | ||
| 217 | typedef u64 cycle_t; | ||
| 218 | |||
| 216 | #endif /* __ASSEMBLY__ */ | 219 | #endif /* __ASSEMBLY__ */ |
| 217 | #endif /* _LINUX_TYPES_H */ | 220 | #endif /* _LINUX_TYPES_H */ |
diff --git a/include/linux/udp.h b/include/linux/udp.h index ee3277593222..247cfdcc4b08 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h | |||
| @@ -49,11 +49,7 @@ struct udp_sock { | |||
| 49 | unsigned int corkflag; /* Cork is required */ | 49 | unsigned int corkflag; /* Cork is required */ |
| 50 | __u8 encap_type; /* Is this an Encapsulation socket? */ | 50 | __u8 encap_type; /* Is this an Encapsulation socket? */ |
| 51 | unsigned char no_check6_tx:1,/* Send zero UDP6 checksums on TX? */ | 51 | unsigned char no_check6_tx:1,/* Send zero UDP6 checksums on TX? */ |
| 52 | no_check6_rx:1,/* Allow zero UDP6 checksums on RX? */ | 52 | no_check6_rx:1;/* Allow zero UDP6 checksums on RX? */ |
| 53 | convert_csum:1;/* On receive, convert checksum | ||
| 54 | * unnecessary to checksum complete | ||
| 55 | * if possible. | ||
| 56 | */ | ||
| 57 | /* | 53 | /* |
| 58 | * Following member retains the information to create a UDP header | 54 | * Following member retains the information to create a UDP header |
| 59 | * when the socket is uncorked. | 55 | * when the socket is uncorked. |
| @@ -102,16 +98,6 @@ static inline bool udp_get_no_check6_rx(struct sock *sk) | |||
| 102 | return udp_sk(sk)->no_check6_rx; | 98 | return udp_sk(sk)->no_check6_rx; |
| 103 | } | 99 | } |
| 104 | 100 | ||
| 105 | static inline void udp_set_convert_csum(struct sock *sk, bool val) | ||
| 106 | { | ||
| 107 | udp_sk(sk)->convert_csum = val; | ||
| 108 | } | ||
| 109 | |||
| 110 | static inline bool udp_get_convert_csum(struct sock *sk) | ||
| 111 | { | ||
| 112 | return udp_sk(sk)->convert_csum; | ||
| 113 | } | ||
| 114 | |||
| 115 | #define udp_portaddr_for_each_entry(__sk, node, list) \ | 101 | #define udp_portaddr_for_each_entry(__sk, node, list) \ |
| 116 | hlist_nulls_for_each_entry(__sk, node, list, __sk_common.skc_portaddr_node) | 102 | hlist_nulls_for_each_entry(__sk, node, list, __sk_common.skc_portaddr_node) |
| 117 | 103 | ||
diff --git a/include/linux/uio.h b/include/linux/uio.h index 1c5e453f7ea9..3e0cb4ea3905 100644 --- a/include/linux/uio.h +++ b/include/linux/uio.h | |||
| @@ -135,10 +135,4 @@ static inline void iov_iter_reexpand(struct iov_iter *i, size_t count) | |||
| 135 | size_t csum_and_copy_to_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i); | 135 | size_t csum_and_copy_to_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i); |
| 136 | size_t csum_and_copy_from_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i); | 136 | size_t csum_and_copy_from_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i); |
| 137 | 137 | ||
| 138 | int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len); | ||
| 139 | int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov, | ||
| 140 | int offset, int len); | ||
| 141 | int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata, | ||
| 142 | int offset, int len); | ||
| 143 | |||
| 144 | #endif | 138 | #endif |
diff --git a/include/linux/vmw_vmci_api.h b/include/linux/vmw_vmci_api.h index 5691f752ce8f..63df3a2a8ce5 100644 --- a/include/linux/vmw_vmci_api.h +++ b/include/linux/vmw_vmci_api.h | |||
| @@ -74,7 +74,7 @@ ssize_t vmci_qpair_dequeue(struct vmci_qp *qpair, | |||
| 74 | ssize_t vmci_qpair_peek(struct vmci_qp *qpair, void *buf, size_t buf_size, | 74 | ssize_t vmci_qpair_peek(struct vmci_qp *qpair, void *buf, size_t buf_size, |
| 75 | int mode); | 75 | int mode); |
| 76 | ssize_t vmci_qpair_enquev(struct vmci_qp *qpair, | 76 | ssize_t vmci_qpair_enquev(struct vmci_qp *qpair, |
| 77 | void *iov, size_t iov_size, int mode); | 77 | struct msghdr *msg, size_t iov_size, int mode); |
| 78 | ssize_t vmci_qpair_dequev(struct vmci_qp *qpair, | 78 | ssize_t vmci_qpair_dequev(struct vmci_qp *qpair, |
| 79 | struct msghdr *msg, size_t iov_size, int mode); | 79 | struct msghdr *msg, size_t iov_size, int mode); |
| 80 | ssize_t vmci_qpair_peekv(struct vmci_qp *qpair, struct msghdr *msg, size_t iov_size, | 80 | ssize_t vmci_qpair_peekv(struct vmci_qp *qpair, struct msghdr *msg, size_t iov_size, |
diff --git a/include/linux/wait.h b/include/linux/wait.h index 2232ed16635a..537d58eea8a0 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
| @@ -363,7 +363,6 @@ do { \ | |||
| 363 | */ | 363 | */ |
| 364 | #define wait_event_cmd(wq, condition, cmd1, cmd2) \ | 364 | #define wait_event_cmd(wq, condition, cmd1, cmd2) \ |
| 365 | do { \ | 365 | do { \ |
| 366 | might_sleep(); \ | ||
| 367 | if (condition) \ | 366 | if (condition) \ |
| 368 | break; \ | 367 | break; \ |
| 369 | __wait_event_cmd(wq, condition, cmd1, cmd2); \ | 368 | __wait_event_cmd(wq, condition, cmd1, cmd2); \ |
| @@ -991,6 +990,32 @@ wait_on_bit_io(void *word, int bit, unsigned mode) | |||
| 991 | } | 990 | } |
| 992 | 991 | ||
| 993 | /** | 992 | /** |
| 993 | * wait_on_bit_timeout - wait for a bit to be cleared or a timeout elapses | ||
| 994 | * @word: the word being waited on, a kernel virtual address | ||
| 995 | * @bit: the bit of the word being waited on | ||
| 996 | * @mode: the task state to sleep in | ||
| 997 | * @timeout: timeout, in jiffies | ||
| 998 | * | ||
| 999 | * Use the standard hashed waitqueue table to wait for a bit | ||
| 1000 | * to be cleared. This is similar to wait_on_bit(), except also takes a | ||
| 1001 | * timeout parameter. | ||
| 1002 | * | ||
| 1003 | * Returned value will be zero if the bit was cleared before the | ||
| 1004 | * @timeout elapsed, or non-zero if the @timeout elapsed or process | ||
| 1005 | * received a signal and the mode permitted wakeup on that signal. | ||
| 1006 | */ | ||
| 1007 | static inline int | ||
| 1008 | wait_on_bit_timeout(void *word, int bit, unsigned mode, unsigned long timeout) | ||
| 1009 | { | ||
| 1010 | might_sleep(); | ||
| 1011 | if (!test_bit(bit, word)) | ||
| 1012 | return 0; | ||
| 1013 | return out_of_line_wait_on_bit_timeout(word, bit, | ||
| 1014 | bit_wait_timeout, | ||
| 1015 | mode, timeout); | ||
| 1016 | } | ||
| 1017 | |||
| 1018 | /** | ||
| 994 | * wait_on_bit_action - wait for a bit to be cleared | 1019 | * wait_on_bit_action - wait for a bit to be cleared |
| 995 | * @word: the word being waited on, a kernel virtual address | 1020 | * @word: the word being waited on, a kernel virtual address |
| 996 | * @bit: the bit of the word being waited on | 1021 | * @bit: the bit of the word being waited on |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index b996e6cde6bb..74db135f9957 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
| @@ -220,14 +220,10 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; } | |||
| 220 | #endif | 220 | #endif |
| 221 | 221 | ||
| 222 | #define INIT_WORK(_work, _func) \ | 222 | #define INIT_WORK(_work, _func) \ |
| 223 | do { \ | 223 | __INIT_WORK((_work), (_func), 0) |
| 224 | __INIT_WORK((_work), (_func), 0); \ | ||
| 225 | } while (0) | ||
| 226 | 224 | ||
| 227 | #define INIT_WORK_ONSTACK(_work, _func) \ | 225 | #define INIT_WORK_ONSTACK(_work, _func) \ |
| 228 | do { \ | 226 | __INIT_WORK((_work), (_func), 1) |
| 229 | __INIT_WORK((_work), (_func), 1); \ | ||
| 230 | } while (0) | ||
| 231 | 227 | ||
| 232 | #define __INIT_DELAYED_WORK(_work, _func, _tflags) \ | 228 | #define __INIT_DELAYED_WORK(_work, _func, _tflags) \ |
| 233 | do { \ | 229 | do { \ |
