diff options
author | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
commit | 62b8c978ee6b8d135d9e7953221de58000dba986 (patch) | |
tree | 683b04b2e627f6710c22c151b23c8cc9a165315e /include/linux | |
parent | 78fd82238d0e5716578c326404184a27ba67fd6e (diff) | |
download | linux-fsl-qoriq-62b8c978ee6b8d135d9e7953221de58000dba986.tar.xz |
Rewind v3.13-rc3+ (78fd82238d0e5716) to v3.12
Diffstat (limited to 'include/linux')
294 files changed, 3056 insertions, 7668 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index d9099b1..a5db4ae 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -44,20 +44,6 @@ #include <acpi/acpi_numa.h> #include <asm/acpi.h> -static inline acpi_handle acpi_device_handle(struct acpi_device *adev) -{ - return adev ? adev->handle : NULL; -} - -#define ACPI_COMPANION(dev) ((dev)->acpi_node.companion) -#define ACPI_COMPANION_SET(dev, adev) ACPI_COMPANION(dev) = (adev) -#define ACPI_HANDLE(dev) acpi_device_handle(ACPI_COMPANION(dev)) - -static inline const char *acpi_dev_name(struct acpi_device *adev) -{ - return dev_name(&adev->dev); -} - enum acpi_irq_model_id { ACPI_IRQ_MODEL_PIC = 0, ACPI_IRQ_MODEL_IOAPIC, @@ -130,7 +116,7 @@ void acpi_numa_arch_fixup(void); #ifdef CONFIG_ACPI_HOTPLUG_CPU /* Arch dependent functions for cpu hotplug support */ -int acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu); +int acpi_map_lsapic(acpi_handle handle, int *pcpu); int acpi_unmap_lsapic(int cpu); #endif /* CONFIG_ACPI_HOTPLUG_CPU */ @@ -308,52 +294,58 @@ void __init acpi_nvs_nosave_s3(void); #endif /* CONFIG_PM_SLEEP */ struct acpi_osc_context { - char *uuid_str; /* UUID string */ + char *uuid_str; /* uuid string */ int rev; - struct acpi_buffer cap; /* list of DWORD capabilities */ - struct acpi_buffer ret; /* free by caller if success */ + struct acpi_buffer cap; /* arg2/arg3 */ + struct acpi_buffer ret; /* free by caller if success */ }; -acpi_status acpi_str_to_uuid(char *str, u8 *uuid); +#define OSC_QUERY_TYPE 0 +#define OSC_SUPPORT_TYPE 1 +#define OSC_CONTROL_TYPE 2 + +/* _OSC DW0 Definition */ +#define OSC_QUERY_ENABLE 1 +#define OSC_REQUEST_ERROR 2 +#define OSC_INVALID_UUID_ERROR 4 +#define OSC_INVALID_REVISION_ERROR 8 +#define OSC_CAPABILITIES_MASK_ERROR 16 + acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context); -/* Indexes into _OSC Capabilities Buffer (DWORDs 2 & 3 are device-specific) */ -#define OSC_QUERY_DWORD 0 /* DWORD 1 */ -#define OSC_SUPPORT_DWORD 1 /* DWORD 2 */ -#define OSC_CONTROL_DWORD 2 /* DWORD 3 */ - -/* _OSC Capabilities DWORD 1: Query/Control and Error Returns (generic) */ -#define OSC_QUERY_ENABLE 0x00000001 /* input */ -#define OSC_REQUEST_ERROR 0x00000002 /* return */ -#define OSC_INVALID_UUID_ERROR 0x00000004 /* return */ -#define OSC_INVALID_REVISION_ERROR 0x00000008 /* return */ -#define OSC_CAPABILITIES_MASK_ERROR 0x00000010 /* return */ - -/* Platform-Wide Capabilities _OSC: Capabilities DWORD 2: Support Field */ -#define OSC_SB_PAD_SUPPORT 0x00000001 -#define OSC_SB_PPC_OST_SUPPORT 0x00000002 -#define OSC_SB_PR3_SUPPORT 0x00000004 -#define OSC_SB_HOTPLUG_OST_SUPPORT 0x00000008 -#define OSC_SB_APEI_SUPPORT 0x00000010 -#define OSC_SB_CPC_SUPPORT 0x00000020 +/* platform-wide _OSC bits */ +#define OSC_SB_PAD_SUPPORT 1 +#define OSC_SB_PPC_OST_SUPPORT 2 +#define OSC_SB_PR3_SUPPORT 4 +#define OSC_SB_HOTPLUG_OST_SUPPORT 8 +#define OSC_SB_APEI_SUPPORT 16 extern bool osc_sb_apei_support_acked; -/* PCI Host Bridge _OSC: Capabilities DWORD 2: Support Field */ -#define OSC_PCI_EXT_CONFIG_SUPPORT 0x00000001 -#define OSC_PCI_ASPM_SUPPORT 0x00000002 -#define OSC_PCI_CLOCK_PM_SUPPORT 0x00000004 -#define OSC_PCI_SEGMENT_GROUPS_SUPPORT 0x00000008 -#define OSC_PCI_MSI_SUPPORT 0x00000010 -#define OSC_PCI_SUPPORT_MASKS 0x0000001f - -/* PCI Host Bridge _OSC: Capabilities DWORD 3: Control Field */ -#define OSC_PCI_EXPRESS_NATIVE_HP_CONTROL 0x00000001 -#define OSC_PCI_SHPC_NATIVE_HP_CONTROL 0x00000002 -#define OSC_PCI_EXPRESS_PME_CONTROL 0x00000004 -#define OSC_PCI_EXPRESS_AER_CONTROL 0x00000008 -#define OSC_PCI_EXPRESS_CAPABILITY_CONTROL 0x00000010 -#define OSC_PCI_CONTROL_MASKS 0x0000001f +/* PCI defined _OSC bits */ +/* _OSC DW1 Definition (OS Support Fields) */ +#define OSC_EXT_PCI_CONFIG_SUPPORT 1 +#define OSC_ACTIVE_STATE_PWR_SUPPORT 2 +#define OSC_CLOCK_PWR_CAPABILITY_SUPPORT 4 +#define OSC_PCI_SEGMENT_GROUPS_SUPPORT 8 +#define OSC_MSI_SUPPORT 16 +#define OSC_PCI_SUPPORT_MASKS 0x1f + +/* _OSC DW1 Definition (OS Control Fields) */ +#define OSC_PCI_EXPRESS_NATIVE_HP_CONTROL 1 +#define OSC_SHPC_NATIVE_HP_CONTROL 2 +#define OSC_PCI_EXPRESS_PME_CONTROL 4 +#define OSC_PCI_EXPRESS_AER_CONTROL 8 +#define OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL 16 + +#define OSC_PCI_CONTROL_MASKS (OSC_PCI_EXPRESS_NATIVE_HP_CONTROL | \ + OSC_SHPC_NATIVE_HP_CONTROL | \ + OSC_PCI_EXPRESS_PME_CONTROL | \ + OSC_PCI_EXPRESS_AER_CONTROL | \ + OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL) + +#define OSC_PCI_NATIVE_HOTPLUG (OSC_PCI_EXPRESS_NATIVE_HP_CONTROL | \ + OSC_SHPC_NATIVE_HP_CONTROL) extern acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 *mask, u32 req); @@ -415,15 +407,6 @@ static inline bool acpi_driver_match_device(struct device *dev, #define acpi_disabled 1 -#define ACPI_COMPANION(dev) (NULL) -#define ACPI_COMPANION_SET(dev, adev) do { } while (0) -#define ACPI_HANDLE(dev) (NULL) - -static inline const char *acpi_dev_name(struct acpi_device *adev) -{ - return NULL; -} - static inline void acpi_early_init(void) { } static inline int early_acpi_boot_init(void) diff --git a/include/linux/acpi_gpio.h b/include/linux/acpi_gpio.h index d875bc3..4c120a1 100644 --- a/include/linux/acpi_gpio.h +++ b/include/linux/acpi_gpio.h @@ -2,50 +2,41 @@ #define _LINUX_ACPI_GPIO_H_ #include <linux/device.h> -#include <linux/err.h> #include <linux/errno.h> #include <linux/gpio.h> -#include <linux/gpio/consumer.h> /** * struct acpi_gpio_info - ACPI GPIO specific information * @gpioint: if %true this GPIO is of type GpioInt otherwise type is GpioIo - * @active_low: in case of @gpioint, the pin is active low */ struct acpi_gpio_info { bool gpioint; - bool active_low; }; #ifdef CONFIG_GPIO_ACPI -struct gpio_desc *acpi_get_gpiod_by_index(struct device *dev, int index, - struct acpi_gpio_info *info); +int acpi_get_gpio(char *path, int pin); +int acpi_get_gpio_by_index(struct device *dev, int index, + struct acpi_gpio_info *info); void acpi_gpiochip_request_interrupts(struct gpio_chip *chip); void acpi_gpiochip_free_interrupts(struct gpio_chip *chip); #else /* CONFIG_GPIO_ACPI */ -static inline struct gpio_desc * -acpi_get_gpiod_by_index(struct device *dev, int index, - struct acpi_gpio_info *info) +static inline int acpi_get_gpio(char *path, int pin) { - return ERR_PTR(-ENOSYS); + return -ENODEV; } -static inline void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) { } -static inline void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) { } - -#endif /* CONFIG_GPIO_ACPI */ - static inline int acpi_get_gpio_by_index(struct device *dev, int index, struct acpi_gpio_info *info) { - struct gpio_desc *desc = acpi_get_gpiod_by_index(dev, index, info); - - if (IS_ERR(desc)) - return PTR_ERR(desc); - return desc_to_gpio(desc); + return -ENODEV; } +static inline void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) { } +static inline void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) { } + +#endif /* CONFIG_GPIO_ACPI */ + #endif /* _LINUX_ACPI_GPIO_H_ */ diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index 63b5eff..43ec7e2 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h @@ -21,7 +21,7 @@ #include <linux/resource.h> #include <linux/regulator/consumer.h> -#define AMBA_NR_IRQS 9 +#define AMBA_NR_IRQS 2 #define AMBA_CID 0xb105f00d struct clk; @@ -30,6 +30,7 @@ struct amba_device { struct device dev; struct resource res; struct clk *pclk; + u64 dma_mask; unsigned int periphid; unsigned int irq[AMBA_NR_IRQS]; }; @@ -130,6 +131,7 @@ struct amba_device name##_device = { \ struct amba_device name##_device = { \ .dev = __AMBA_DEV(busid, data, ~0ULL), \ .res = DEFINE_RES_MEM(base, SZ_4K), \ + .dma_mask = ~0ULL, \ .irq = irqs, \ .periphid = id, \ } diff --git a/include/linux/amba/serial.h b/include/linux/amba/serial.h index 0ddb5c0..62d9303 100644 --- a/include/linux/amba/serial.h +++ b/include/linux/amba/serial.h @@ -40,7 +40,7 @@ #define UART010_LCRL 0x10 /* Line control register, low byte. */ #define UART010_CR 0x14 /* Control register. */ #define UART01x_FR 0x18 /* Flag register (Read only). */ -#define UART010_IIR 0x1C /* Interrupt identification register (Read). */ +#define UART010_IIR 0x1C /* Interrupt indentification register (Read). */ #define UART010_ICR 0x1C /* Interrupt clear register (Write). */ #define ST_UART011_LCRH_RX 0x1C /* Rx line control register. */ #define UART01x_ILPR 0x20 /* IrDA low power counter register. */ diff --git a/include/linux/anon_inodes.h b/include/linux/anon_inodes.h index 8013a45..cf573c2 100644 --- a/include/linux/anon_inodes.h +++ b/include/linux/anon_inodes.h @@ -13,6 +13,9 @@ struct file_operations; struct file *anon_inode_getfile(const char *name, const struct file_operations *fops, void *priv, int flags); +struct file *anon_inode_getfile_private(const char *name, + const struct file_operations *fops, + void *priv, int flags); int anon_inode_getfd(const char *name, const struct file_operations *fops, void *priv, int flags); diff --git a/include/linux/assoc_array.h b/include/linux/assoc_array.h deleted file mode 100644 index 9a193b8..0000000 --- a/include/linux/assoc_array.h +++ /dev/null @@ -1,92 +0,0 @@ -/* Generic associative array implementation. - * - * See Documentation/assoc_array.txt for information. - * - * Copyright (C) 2013 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public Licence - * as published by the Free Software Foundation; either version - * 2 of the Licence, or (at your option) any later version. - */ - -#ifndef _LINUX_ASSOC_ARRAY_H -#define _LINUX_ASSOC_ARRAY_H - -#ifdef CONFIG_ASSOCIATIVE_ARRAY - -#include <linux/types.h> - -#define ASSOC_ARRAY_KEY_CHUNK_SIZE BITS_PER_LONG /* Key data retrieved in chunks of this size */ - -/* - * Generic associative array. - */ -struct assoc_array { - struct assoc_array_ptr *root; /* The node at the root of the tree */ - unsigned long nr_leaves_on_tree; -}; - -/* - * Operations on objects and index keys for use by array manipulation routines. - */ -struct assoc_array_ops { - /* Method to get a chunk of an index key from caller-supplied data */ - unsigned long (*get_key_chunk)(const void *index_key, int level); - - /* Method to get a piece of an object's index key */ - unsigned long (*get_object_key_chunk)(const void *object, int level); - - /* Is this the object we're looking for? */ - bool (*compare_object)(const void *object, const void *index_key); - - /* How different are two objects, to a bit position in their keys? (or - * -1 if they're the same) - */ - int (*diff_objects)(const void *a, const void *b); - - /* Method to free an object. */ - void (*free_object)(void *object); -}; - -/* - * Access and manipulation functions. - */ -struct assoc_array_edit; - -static inline void assoc_array_init(struct assoc_array *array) -{ - array->root = NULL; - array->nr_leaves_on_tree = 0; -} - -extern int assoc_array_iterate(const struct assoc_array *array, - int (*iterator)(const void *object, - void *iterator_data), - void *iterator_data); -extern void *assoc_array_find(const struct assoc_array *array, - const struct assoc_array_ops *ops, - const void *index_key); -extern void assoc_array_destroy(struct assoc_array *array, - const struct assoc_array_ops *ops); -extern struct assoc_array_edit *assoc_array_insert(struct assoc_array *array, - const struct assoc_array_ops *ops, - const void *index_key, - void *object); -extern void assoc_array_insert_set_object(struct assoc_array_edit *edit, - void *object); -extern struct assoc_array_edit *assoc_array_delete(struct assoc_array *array, - const struct assoc_array_ops *ops, - const void *index_key); -extern struct assoc_array_edit *assoc_array_clear(struct assoc_array *array, - const struct assoc_array_ops *ops); -extern void assoc_array_apply_edit(struct assoc_array_edit *edit); -extern void assoc_array_cancel_edit(struct assoc_array_edit *edit); -extern int assoc_array_gc(struct assoc_array *array, - const struct assoc_array_ops *ops, - bool (*iterator)(void *object, void *iterator_data), - void *iterator_data); - -#endif /* CONFIG_ASSOCIATIVE_ARRAY */ -#endif /* _LINUX_ASSOC_ARRAY_H */ diff --git a/include/linux/assoc_array_priv.h b/include/linux/assoc_array_priv.h deleted file mode 100644 index 711275e..0000000 --- a/include/linux/assoc_array_priv.h +++ /dev/null @@ -1,182 +0,0 @@ -/* Private definitions for the generic associative array implementation. - * - * See Documentation/assoc_array.txt for information. - * - * Copyright (C) 2013 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public Licence - * as published by the Free Software Foundation; either version - * 2 of the Licence, or (at your option) any later version. - */ - -#ifndef _LINUX_ASSOC_ARRAY_PRIV_H -#define _LINUX_ASSOC_ARRAY_PRIV_H - -#ifdef CONFIG_ASSOCIATIVE_ARRAY - -#include <linux/assoc_array.h> - -#define ASSOC_ARRAY_FAN_OUT 16 /* Number of slots per node */ -#define ASSOC_ARRAY_FAN_MASK (ASSOC_ARRAY_FAN_OUT - 1) -#define ASSOC_ARRAY_LEVEL_STEP (ilog2(ASSOC_ARRAY_FAN_OUT)) -#define ASSOC_ARRAY_LEVEL_STEP_MASK (ASSOC_ARRAY_LEVEL_STEP - 1) -#define ASSOC_ARRAY_KEY_CHUNK_MASK (ASSOC_ARRAY_KEY_CHUNK_SIZE - 1) -#define ASSOC_ARRAY_KEY_CHUNK_SHIFT (ilog2(BITS_PER_LONG)) - -/* - * Undefined type representing a pointer with type information in the bottom - * two bits. - */ -struct assoc_array_ptr; - -/* - * An N-way node in the tree. - * - * Each slot contains one of four things: - * - * (1) Nothing (NULL). - * - * (2) A leaf object (pointer types 0). - * - * (3) A next-level node (pointer type 1, subtype 0). - * - * (4) A shortcut (pointer type 1, subtype 1). - * - * The tree is optimised for search-by-ID, but permits reasonable iteration - * also. - * - * The tree is navigated by constructing an index key consisting of an array of - * segments, where each segment is ilog2(ASSOC_ARRAY_FAN_OUT) bits in size. - * - * The segments correspond to levels of the tree (the first segment is used at - * level 0, the second at level 1, etc.). - */ -struct assoc_array_node { - struct assoc_array_ptr *back_pointer; - u8 parent_slot; - struct assoc_array_ptr *slots[ASSOC_ARRAY_FAN_OUT]; - unsigned long nr_leaves_on_branch; -}; - -/* - * A shortcut through the index space out to where a collection of nodes/leaves - * with the same IDs live. - */ -struct assoc_array_shortcut { - struct assoc_array_ptr *back_pointer; - int parent_slot; - int skip_to_level; - struct assoc_array_ptr *next_node; - unsigned long index_key[]; -}; - -/* - * Preallocation cache. - */ -struct assoc_array_edit { - struct rcu_head rcu; - struct assoc_array *array; - const struct assoc_array_ops *ops; - const struct assoc_array_ops *ops_for_excised_subtree; - struct assoc_array_ptr *leaf; - struct assoc_array_ptr **leaf_p; - struct assoc_array_ptr *dead_leaf; - struct assoc_array_ptr *new_meta[3]; - struct assoc_array_ptr *excised_meta[1]; - struct assoc_array_ptr *excised_subtree; - struct assoc_array_ptr **set_backpointers[ASSOC_ARRAY_FAN_OUT]; - struct assoc_array_ptr *set_backpointers_to; - struct assoc_array_node *adjust_count_on; - long adjust_count_by; - struct { - struct assoc_array_ptr **ptr; - struct assoc_array_ptr *to; - } set[2]; - struct { - u8 *p; - u8 to; - } set_parent_slot[1]; - u8 segment_cache[ASSOC_ARRAY_FAN_OUT + 1]; -}; - -/* - * Internal tree member pointers are marked in the bottom one or two bits to - * indicate what type they are so that we don't have to look behind every - * pointer to see what it points to. - * - * We provide functions to test type annotations and to create and translate - * the annotated pointers. - */ -#define ASSOC_ARRAY_PTR_TYPE_MASK 0x1UL -#define ASSOC_ARRAY_PTR_LEAF_TYPE 0x0UL /* Points to leaf (or nowhere) */ -#define ASSOC_ARRAY_PTR_META_TYPE 0x1UL /* Points to node or shortcut */ -#define ASSOC_ARRAY_PTR_SUBTYPE_MASK 0x2UL -#define ASSOC_ARRAY_PTR_NODE_SUBTYPE 0x0UL -#define ASSOC_ARRAY_PTR_SHORTCUT_SUBTYPE 0x2UL - -static inline bool assoc_array_ptr_is_meta(const struct assoc_array_ptr *x) -{ - return (unsigned long)x & ASSOC_ARRAY_PTR_TYPE_MASK; -} -static inline bool assoc_array_ptr_is_leaf(const struct assoc_array_ptr *x) -{ - return !assoc_array_ptr_is_meta(x); -} -static inline bool assoc_array_ptr_is_shortcut(const struct assoc_array_ptr *x) -{ - return (unsigned long)x & ASSOC_ARRAY_PTR_SUBTYPE_MASK; -} -static inline bool assoc_array_ptr_is_node(const struct assoc_array_ptr *x) -{ - return !assoc_array_ptr_is_shortcut(x); -} - -static inline void *assoc_array_ptr_to_leaf(const struct assoc_array_ptr *x) -{ - return (void *)((unsigned long)x & ~ASSOC_ARRAY_PTR_TYPE_MASK); -} - -static inline -unsigned long __assoc_array_ptr_to_meta(const struct assoc_array_ptr *x) -{ - return (unsigned long)x & - ~(ASSOC_ARRAY_PTR_SUBTYPE_MASK | ASSOC_ARRAY_PTR_TYPE_MASK); -} -static inline -struct assoc_array_node *assoc_array_ptr_to_node(const struct assoc_array_ptr *x) -{ - return (struct assoc_array_node *)__assoc_array_ptr_to_meta(x); -} -static inline -struct assoc_array_shortcut *assoc_array_ptr_to_shortcut(const struct assoc_array_ptr *x) -{ - return (struct assoc_array_shortcut *)__assoc_array_ptr_to_meta(x); -} - -static inline -struct assoc_array_ptr *__assoc_array_x_to_ptr(const void *p, unsigned long t) -{ - return (struct assoc_array_ptr *)((unsigned long)p | t); -} -static inline -struct assoc_array_ptr *assoc_array_leaf_to_ptr(const void *p) -{ - return __assoc_array_x_to_ptr(p, ASSOC_ARRAY_PTR_LEAF_TYPE); -} -static inline -struct assoc_array_ptr *assoc_array_node_to_ptr(const struct assoc_array_node *p) -{ - return __assoc_array_x_to_ptr( - p, ASSOC_ARRAY_PTR_META_TYPE | ASSOC_ARRAY_PTR_NODE_SUBTYPE); -} -static inline -struct assoc_array_ptr *assoc_array_shortcut_to_ptr(const struct assoc_array_shortcut *p) -{ - return __assoc_array_x_to_ptr( - p, ASSOC_ARRAY_PTR_META_TYPE | ASSOC_ARRAY_PTR_SHORTCUT_SUBTYPE); -} - -#endif /* CONFIG_ASSOCIATIVE_ARRAY */ -#endif /* _LINUX_ASSOC_ARRAY_PRIV_H */ diff --git a/include/linux/ata.h b/include/linux/ata.h index f2f4d8d..bf4c69c 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h @@ -219,7 +219,6 @@ enum { ATA_CMD_IDLE = 0xE3, /* place in idle power mode */ ATA_CMD_EDD = 0x90, /* execute device diagnostic */ ATA_CMD_DOWNLOAD_MICRO = 0x92, - ATA_CMD_DOWNLOAD_MICRO_DMA = 0x93, ATA_CMD_NOP = 0x00, ATA_CMD_FLUSH = 0xE7, ATA_CMD_FLUSH_EXT = 0xEA, @@ -269,15 +268,12 @@ enum { ATA_CMD_WRITE_LOG_EXT = 0x3F, ATA_CMD_READ_LOG_DMA_EXT = 0x47, ATA_CMD_WRITE_LOG_DMA_EXT = 0x57, - ATA_CMD_TRUSTED_NONDATA = 0x5B, ATA_CMD_TRUSTED_RCV = 0x5C, ATA_CMD_TRUSTED_RCV_DMA = 0x5D, ATA_CMD_TRUSTED_SND = 0x5E, ATA_CMD_TRUSTED_SND_DMA = 0x5F, ATA_CMD_PMP_READ = 0xE4, - ATA_CMD_PMP_READ_DMA = 0xE9, ATA_CMD_PMP_WRITE = 0xE8, - ATA_CMD_PMP_WRITE_DMA = 0xEB, ATA_CMD_CONF_OVERLAY = 0xB1, ATA_CMD_SEC_SET_PASS = 0xF1, ATA_CMD_SEC_UNLOCK = 0xF2, @@ -296,9 +292,6 @@ enum { ATA_CMD_CFA_TRANS_SECT = 0x87, ATA_CMD_CFA_ERASE = 0xC0, ATA_CMD_CFA_WRITE_MULT_NE = 0xCD, - ATA_CMD_REQ_SENSE_DATA = 0x0B, - ATA_CMD_SANITIZE_DEVICE = 0xB4, - /* marked obsolete in the ATA/ATAPI-7 spec */ ATA_CMD_RESTORE = 0x10, diff --git a/include/linux/atmel_serial.h b/include/linux/atmel_serial.h index 00beddf..be201ca 100644 --- a/include/linux/atmel_serial.h +++ b/include/linux/atmel_serial.h @@ -125,6 +125,5 @@ #define ATMEL_US_IF 0x4c /* IrDA Filter Register */ #define ATMEL_US_NAME 0xf0 /* Ip Name */ -#define ATMEL_US_VERSION 0xfc /* Ip Version */ #endif diff --git a/include/linux/audit.h b/include/linux/audit.h index a406419..729a4d1 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h @@ -73,8 +73,6 @@ struct audit_field { void *lsm_rule; }; -extern int is_audit_feature_set(int which); - extern int __init audit_register_class(int class, unsigned *list); extern int audit_classify_syscall(int abi, unsigned syscall); extern int audit_classify_arch(int arch); @@ -209,7 +207,7 @@ static inline int audit_get_sessionid(struct task_struct *tsk) extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp); extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode); -extern void __audit_bprm(struct linux_binprm *bprm); +extern int __audit_bprm(struct linux_binprm *bprm); extern int __audit_socketcall(int nargs, unsigned long *args); extern int __audit_sockaddr(int len, void *addr); extern void __audit_fd_pair(int fd1, int fd2); @@ -238,10 +236,11 @@ static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid if (unlikely(!audit_dummy_context())) __audit_ipc_set_perm(qbytes, uid, gid, mode); } -static inline void audit_bprm(struct linux_binprm *bprm) +static inline int audit_bprm(struct linux_binprm *bprm) { if (unlikely(!audit_dummy_context())) - __audit_bprm(bprm); + return __audit_bprm(bprm); + return 0; } static inline int audit_socketcall(int nargs, unsigned long *args) { @@ -368,8 +367,10 @@ static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp) static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode) { } -static inline void audit_bprm(struct linux_binprm *bprm) -{ } +static inline int audit_bprm(struct linux_binprm *bprm) +{ + return 0; +} static inline int audit_socketcall(int nargs, unsigned long *args) { return 0; diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index 2481900..5f66d51 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h @@ -109,7 +109,7 @@ struct backing_dev_info { #endif }; -int __must_check bdi_init(struct backing_dev_info *bdi); +int bdi_init(struct backing_dev_info *bdi); void bdi_destroy(struct backing_dev_info *bdi); __printf(3, 4) @@ -117,7 +117,7 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent, const char *fmt, ...); int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); void bdi_unregister(struct backing_dev_info *bdi); -int __must_check bdi_setup_and_register(struct backing_dev_info *, char *, unsigned int); +int bdi_setup_and_register(struct backing_dev_info *, char *, unsigned int); void bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages, enum wb_reason reason); void bdi_start_background_writeback(struct backing_dev_info *bdi); diff --git a/include/linux/backlight.h b/include/linux/backlight.h index 5f9cd96..53b7794 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h @@ -100,9 +100,6 @@ struct backlight_device { /* The framebuffer notifier block */ struct notifier_block fb_notif; - /* list entry of all registered backlight devices */ - struct list_head entry; - struct device dev; }; @@ -126,7 +123,6 @@ extern void devm_backlight_device_unregister(struct device *dev, struct backlight_device *bd); extern void backlight_force_update(struct backlight_device *bd, enum backlight_update_reason reason); -extern bool backlight_device_registered(enum backlight_type type); #define to_backlight_device(obj) container_of(obj, struct backlight_device, dev) diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index fd8bf32..e8112ae 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h @@ -56,12 +56,11 @@ struct linux_binprm { /* Function parameter for binfmt->coredump */ struct coredump_params { - const siginfo_t *siginfo; + siginfo_t *siginfo; struct pt_regs *regs; struct file *file; unsigned long limit; unsigned long mm_flags; - loff_t written; }; /* @@ -100,6 +99,9 @@ extern void setup_new_exec(struct linux_binprm * bprm); extern void would_dump(struct linux_binprm *, struct file *); extern int suid_dumpable; +#define SUID_DUMP_DISABLE 0 /* No setuid dumping */ +#define SUID_DUMP_USER 1 /* Dump as user of process */ +#define SUID_DUMP_ROOT 2 /* Dump as root */ /* Stack area protections */ #define EXSTACK_DEFAULT 0 /* Whatever the arch defaults to */ diff --git a/include/linux/bio.h b/include/linux/bio.h index 060ff69..ec48bac 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -218,7 +218,6 @@ struct bio_pair { }; extern struct bio_pair *bio_split(struct bio *bi, int first_sectors); extern void bio_pair_release(struct bio_pair *dbio); -extern void bio_trim(struct bio *bio, int offset, int size); extern struct bio_set *bioset_create(unsigned int, unsigned int); extern void bioset_free(struct bio_set *); @@ -420,8 +419,6 @@ static inline void bio_list_init(struct bio_list *bl) bl->head = bl->tail = NULL; } -#define BIO_EMPTY_LIST { NULL, NULL } - #define bio_list_for_each(bio, bl) \ for (bio = (bl)->head; bio; bio = bio->bi_next) diff --git a/include/linux/bitops.h b/include/linux/bitops.h index abc9ca7..a3b6b82 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -4,23 +4,12 @@ #ifdef __KERNEL__ #define BIT(nr) (1UL << (nr)) -#define BIT_ULL(nr) (1ULL << (nr)) #define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) #define BIT_WORD(nr) ((nr) / BITS_PER_LONG) -#define BIT_ULL_MASK(nr) (1ULL << ((nr) % BITS_PER_LONG_LONG)) -#define BIT_ULL_WORD(nr) ((nr) / BITS_PER_LONG_LONG) #define BITS_PER_BYTE 8 #define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) #endif -/* - * Create a contiguous bitmask starting at bit position @l and ending at - * position @h. For example - * GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000. - */ -#define GENMASK(h, l) (((U32_C(1) << ((h) - (l) + 1)) - 1) << (l)) -#define GENMASK_ULL(h, l) (((U64_C(1) << ((h) - (l) + 1)) - 1) << (l)) - extern unsigned int __sw_hweight8(unsigned int w); extern unsigned int __sw_hweight16(unsigned int w); extern unsigned int __sw_hweight32(unsigned int w); diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h deleted file mode 100644 index ab0e9b2..0000000 --- a/include/linux/blk-mq.h +++ /dev/null @@ -1,183 +0,0 @@ -#ifndef BLK_MQ_H -#define BLK_MQ_H - -#include <linux/blkdev.h> - -struct blk_mq_tags; - -struct blk_mq_cpu_notifier { - struct list_head list; - void *data; - void (*notify)(void *data, unsigned long action, unsigned int cpu); -}; - -struct blk_mq_hw_ctx { - struct { - spinlock_t lock; - struct list_head dispatch; - } ____cacheline_aligned_in_smp; - - unsigned long state; /* BLK_MQ_S_* flags */ - struct delayed_work delayed_work; - - unsigned long flags; /* BLK_MQ_F_* flags */ - - struct request_queue *queue; - unsigned int queue_num; - - void *driver_data; - - unsigned int nr_ctx; - struct blk_mq_ctx **ctxs; - unsigned int nr_ctx_map; - unsigned long *ctx_map; - - struct request **rqs; - struct list_head page_list; - struct blk_mq_tags *tags; - - unsigned long queued; - unsigned long run; -#define BLK_MQ_MAX_DISPATCH_ORDER 10 - unsigned long dispatched[BLK_MQ_MAX_DISPATCH_ORDER]; - - unsigned int queue_depth; - unsigned int numa_node; - unsigned int cmd_size; /* per-request extra data */ - - struct blk_mq_cpu_notifier cpu_notifier; - struct kobject kobj; -}; - -struct blk_mq_reg { - struct blk_mq_ops *ops; - unsigned int nr_hw_queues; - unsigned int queue_depth; - unsigned int reserved_tags; - unsigned int cmd_size; /* per-request extra data */ - int numa_node; - unsigned int timeout; - unsigned int flags; /* BLK_MQ_F_* */ -}; - -typedef int (queue_rq_fn)(struct blk_mq_hw_ctx *, struct request *); -typedef struct blk_mq_hw_ctx *(map_queue_fn)(struct request_queue *, const int); -typedef struct blk_mq_hw_ctx *(alloc_hctx_fn)(struct blk_mq_reg *,unsigned int); -typedef void (free_hctx_fn)(struct blk_mq_hw_ctx *, unsigned int); -typedef int (init_hctx_fn)(struct blk_mq_hw_ctx *, void *, unsigned int); -typedef void (exit_hctx_fn)(struct blk_mq_hw_ctx *, unsigned int); - -struct blk_mq_ops { - /* - * Queue request - */ - queue_rq_fn *queue_rq; - - /* - * Map to specific hardware queue - */ - map_queue_fn *map_queue; - - /* - * Called on request timeout - */ - rq_timed_out_fn *timeout; - - /* - * Override for hctx allocations (should probably go) - */ - alloc_hctx_fn *alloc_hctx; - free_hctx_fn *free_hctx; - - /* - * Called when the block layer side of a hardware queue has been - * set up, allowing the driver to allocate/init matching structures. - * Ditto for exit/teardown. - */ - init_hctx_fn *init_hctx; - exit_hctx_fn *exit_hctx; -}; - -enum { - BLK_MQ_RQ_QUEUE_OK = 0, /* queued fine */ - BLK_MQ_RQ_QUEUE_BUSY = 1, /* requeue IO for later */ - BLK_MQ_RQ_QUEUE_ERROR = 2, /* end IO with error */ - - BLK_MQ_F_SHOULD_MERGE = 1 << 0, - BLK_MQ_F_SHOULD_SORT = 1 << 1, - BLK_MQ_F_SHOULD_IPI = 1 << 2, - - BLK_MQ_S_STOPPED = 1 << 0, - - BLK_MQ_MAX_DEPTH = 2048, -}; - -struct request_queue *blk_mq_init_queue(struct blk_mq_reg *, void *); -void blk_mq_free_queue(struct request_queue *); -int blk_mq_register_disk(struct gendisk *); -void blk_mq_unregister_disk(struct gendisk *); -void blk_mq_init_commands(struct request_queue *, void (*init)(void *data, struct blk_mq_hw_ctx *, struct request *, unsigned int), void *data); - -void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule); - -void blk_mq_insert_request(struct request_queue *, struct request *, bool); -void blk_mq_run_queues(struct request_queue *q, bool async); -void blk_mq_free_request(struct request *rq); -bool blk_mq_can_queue(struct blk_mq_hw_ctx *); -struct request *blk_mq_alloc_request(struct request_queue *q, int rw, gfp_t gfp, bool reserved); -struct request *blk_mq_alloc_reserved_request(struct request_queue *q, int rw, gfp_t gfp); -struct request *blk_mq_rq_from_tag(struct request_queue *q, unsigned int tag); - -struct blk_mq_hw_ctx *blk_mq_map_queue(struct request_queue *, const int ctx_index); -struct blk_mq_hw_ctx *blk_mq_alloc_single_hw_queue(struct blk_mq_reg *, unsigned int); -void blk_mq_free_single_hw_queue(struct blk_mq_hw_ctx *, unsigned int); - -void blk_mq_end_io(struct request *rq, int error); - -void blk_mq_stop_hw_queue(struct blk_mq_hw_ctx *hctx); -void blk_mq_start_hw_queue(struct blk_mq_hw_ctx *hctx); -void blk_mq_stop_hw_queues(struct request_queue *q); -void blk_mq_start_stopped_hw_queues(struct request_queue *q); - -/* - * Driver command data is immediately after the request. So subtract request - * size to get back to the original request. - */ -static inline struct request *blk_mq_rq_from_pdu(void *pdu) -{ - return pdu - sizeof(struct request); -} -static inline void *blk_mq_rq_to_pdu(struct request *rq) -{ - return (void *) rq + sizeof(*rq); -} - -static inline struct request *blk_mq_tag_to_rq(struct blk_mq_hw_ctx *hctx, - unsigned int tag) -{ - return hctx->rqs[tag]; -} - -#define queue_for_each_hw_ctx(q, hctx, i) \ - for ((i) = 0, hctx = (q)->queue_hw_ctx[0]; \ - (i) < (q)->nr_hw_queues; (i)++, hctx = (q)->queue_hw_ctx[i]) - -#define queue_for_each_ctx(q, ctx, i) \ - for ((i) = 0, ctx = per_cpu_ptr((q)->queue_ctx, 0); \ - (i) < (q)->nr_queues; (i)++, ctx = per_cpu_ptr(q->queue_ctx, (i))) - -#define hctx_for_each_ctx(hctx, ctx, i) \ - for ((i) = 0, ctx = (hctx)->ctxs[0]; \ - (i) < (hctx)->nr_ctx; (i)++, ctx = (hctx)->ctxs[(i)]) - -#define blk_ctx_sum(q, sum) \ -({ \ - struct blk_mq_ctx *__x; \ - unsigned int __ret = 0, __i; \ - \ - queue_for_each_ctx((q), __x, __i) \ - __ret += sum; \ - __ret; \ -}) - -#endif diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 238ef0e..fa1abeb 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -178,20 +178,19 @@ enum rq_flag_bits { __REQ_MIXED_MERGE, /* merge of different types, fail separately */ __REQ_KERNEL, /* direct IO to kernel pages */ __REQ_PM, /* runtime pm request */ - __REQ_END, /* last of chain of requests */ __REQ_NR_BITS, /* stops here */ }; -#define REQ_WRITE (1ULL << __REQ_WRITE) -#define REQ_FAILFAST_DEV (1ULL << __REQ_FAILFAST_DEV) -#define REQ_FAILFAST_TRANSPORT (1ULL << __REQ_FAILFAST_TRANSPORT) -#define REQ_FAILFAST_DRIVER (1ULL << __REQ_FAILFAST_DRIVER) -#define REQ_SYNC (1ULL << __REQ_SYNC) -#define REQ_META (1ULL << __REQ_META) -#define REQ_PRIO (1ULL << __REQ_PRIO) -#define REQ_DISCARD (1ULL << __REQ_DISCARD) -#define REQ_WRITE_SAME (1ULL << __REQ_WRITE_SAME) -#define REQ_NOIDLE (1ULL << __REQ_NOIDLE) +#define REQ_WRITE (1 << __REQ_WRITE) +#define REQ_FAILFAST_DEV (1 << __REQ_FAILFAST_DEV) +#define REQ_FAILFAST_TRANSPORT (1 << __REQ_FAILFAST_TRANSPORT) +#define REQ_FAILFAST_DRIVER (1 << __REQ_FAILFAST_DRIVER) +#define REQ_SYNC (1 << __REQ_SYNC) +#define REQ_META (1 << __REQ_META) +#define REQ_PRIO (1 << __REQ_PRIO) +#define REQ_DISCARD (1 << __REQ_DISCARD) +#define REQ_WRITE_SAME (1 << __REQ_WRITE_SAME) +#define REQ_NOIDLE (1 << __REQ_NOIDLE) #define REQ_FAILFAST_MASK \ (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER) @@ -207,29 +206,28 @@ enum rq_flag_bits { #define REQ_NOMERGE_FLAGS \ (REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA) -#define REQ_RAHEAD (1ULL << __REQ_RAHEAD) -#define REQ_THROTTLED (1ULL << __REQ_THROTTLED) - -#define REQ_SORTED (1ULL << __REQ_SORTED) -#define REQ_SOFTBARRIER (1ULL << __REQ_SOFTBARRIER) -#define REQ_FUA (1ULL << __REQ_FUA) -#define REQ_NOMERGE (1ULL << __REQ_NOMERGE) -#define REQ_STARTED (1ULL << __REQ_STARTED) -#define REQ_DONTPREP (1ULL << __REQ_DONTPREP) -#define REQ_QUEUED (1ULL << __REQ_QUEUED) -#define REQ_ELVPRIV (1ULL << __REQ_ELVPRIV) -#define REQ_FAILED (1ULL << __REQ_FAILED) -#define REQ_QUIET (1ULL << __REQ_QUIET) -#define REQ_PREEMPT (1ULL << __REQ_PREEMPT) -#define REQ_ALLOCED (1ULL << __REQ_ALLOCED) -#define REQ_COPY_USER (1ULL << __REQ_COPY_USER) -#define REQ_FLUSH (1ULL << __REQ_FLUSH) -#define REQ_FLUSH_SEQ (1ULL << __REQ_FLUSH_SEQ) -#define REQ_IO_STAT (1ULL << __REQ_IO_STAT) -#define REQ_MIXED_MERGE (1ULL << __REQ_MIXED_MERGE) -#define REQ_SECURE (1ULL << __REQ_SECURE) -#define REQ_KERNEL (1ULL << __REQ_KERNEL) -#define REQ_PM (1ULL << __REQ_PM) -#define REQ_END (1ULL << __REQ_END) +#define REQ_RAHEAD (1 << __REQ_RAHEAD) +#define REQ_THROTTLED (1 << __REQ_THROTTLED) + +#define REQ_SORTED (1 << __REQ_SORTED) +#define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER) +#define REQ_FUA (1 << __REQ_FUA) +#define REQ_NOMERGE (1 << __REQ_NOMERGE) +#define REQ_STARTED (1 << __REQ_STARTED) +#define REQ_DONTPREP (1 << __REQ_DONTPREP) +#define REQ_QUEUED (1 << __REQ_QUEUED) +#define REQ_ELVPRIV (1 << __REQ_ELVPRIV) +#define REQ_FAILED (1 << __REQ_FAILED) +#define REQ_QUIET (1 << __REQ_QUIET) +#define REQ_PREEMPT (1 << __REQ_PREEMPT) +#define REQ_ALLOCED (1 << __REQ_ALLOCED) +#define REQ_COPY_USER (1 << __REQ_COPY_USER) +#define REQ_FLUSH (1 << __REQ_FLUSH) +#define REQ_FLUSH_SEQ (1 << __REQ_FLUSH_SEQ) +#define REQ_IO_STAT (1 << __REQ_IO_STAT) +#define REQ_MIXED_MERGE (1 << __REQ_MIXED_MERGE) +#define REQ_SECURE (1 << __REQ_SECURE) +#define REQ_KERNEL (1 << __REQ_KERNEL) +#define REQ_PM (1 << __REQ_PM) #endif /* __LINUX_BLK_TYPES_H */ diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 1b135d4..0e6f765 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -8,7 +8,6 @@ #include <linux/major.h> #include <linux/genhd.h> #include <linux/list.h> -#include <linux/llist.h> #include <linux/timer.h> #include <linux/workqueue.h> #include <linux/pagemap.h> @@ -95,19 +94,12 @@ enum rq_cmd_type_bits { * as well! */ struct request { - union { - struct list_head queuelist; - struct llist_node ll_list; - }; - union { - struct call_single_data csd; - struct work_struct mq_flush_data; - }; + struct list_head queuelist; + struct call_single_data csd; struct request_queue *q; - struct blk_mq_ctx *mq_ctx; - u64 cmd_flags; + unsigned int cmd_flags; enum rq_cmd_type_bits cmd_type; unsigned long atomic_flags; @@ -168,6 +160,8 @@ struct request { unsigned short ioprio; + int ref_count; + void *special; /* opaque pointer available for LLD use */ char *buffer; /* kaddr of the current segment if available */ @@ -221,8 +215,6 @@ struct request_pm_state #include <linux/elevator.h> -struct blk_queue_ctx; - typedef void (request_fn_proc) (struct request_queue *q); typedef void (make_request_fn) (struct request_queue *q, struct bio *bio); typedef int (prep_rq_fn) (struct request_queue *, struct request *); @@ -321,18 +313,6 @@ struct request_queue { dma_drain_needed_fn *dma_drain_needed; lld_busy_fn *lld_busy_fn; - struct blk_mq_ops *mq_ops; - - unsigned int *mq_map; - - /* sw queues */ - struct blk_mq_ctx *queue_ctx; - unsigned int nr_queues; - - /* hw dispatch queues */ - struct blk_mq_hw_ctx **queue_hw_ctx; - unsigned int nr_hw_queues; - /* * Dispatch queue sorting */ @@ -381,11 +361,6 @@ struct request_queue { */ struct kobject kobj; - /* - * mq queue kobject - */ - struct kobject mq_kobj; - #ifdef CONFIG_PM_RUNTIME struct device *dev; int rpm_status; @@ -450,13 +425,7 @@ struct request_queue { unsigned long flush_pending_since; struct list_head flush_queue[2]; struct list_head flush_data_in_flight; - union { - struct request flush_rq; - struct { - spinlock_t mq_flush_lock; - struct work_struct mq_flush_work; - }; - }; + struct request flush_rq; struct mutex sysfs_lock; @@ -468,14 +437,14 @@ struct request_queue { struct bsg_class_device bsg_dev; #endif +#ifdef CONFIG_BLK_CGROUP + struct list_head all_q_node; +#endif #ifdef CONFIG_BLK_DEV_THROTTLING /* Throttle data */ struct throtl_data *td; #endif struct rcu_head rcu_head; - wait_queue_head_t mq_freeze_wq; - struct percpu_counter mq_usage_counter; - struct list_head all_q_node; }; #define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ @@ -498,16 +467,12 @@ struct request_queue { #define QUEUE_FLAG_SECDISCARD 17 /* supports SECDISCARD */ #define QUEUE_FLAG_SAME_FORCE 18 /* force complete on same CPU */ #define QUEUE_FLAG_DEAD 19 /* queue tear-down finished */ -#define QUEUE_FLAG_INIT_DONE 20 /* queue is initialized */ #define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ (1 << QUEUE_FLAG_STACKABLE) | \ (1 << QUEUE_FLAG_SAME_COMP) | \ (1 << QUEUE_FLAG_ADD_RANDOM)) -#define QUEUE_FLAG_MQ_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ - (1 << QUEUE_FLAG_SAME_COMP)) - static inline void queue_lockdep_assert_held(struct request_queue *q) { if (q->queue_lock) @@ -574,7 +539,6 @@ static inline void queue_flag_clear(unsigned int flag, struct request_queue *q) #define blk_queue_dying(q) test_bit(QUEUE_FLAG_DYING, &(q)->queue_flags) #define blk_queue_dead(q) test_bit(QUEUE_FLAG_DEAD, &(q)->queue_flags) #define blk_queue_bypass(q) test_bit(QUEUE_FLAG_BYPASS, &(q)->queue_flags) -#define blk_queue_init_done(q) test_bit(QUEUE_FLAG_INIT_DONE, &(q)->queue_flags) #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) #define blk_queue_noxmerges(q) \ test_bit(QUEUE_FLAG_NOXMERGES, &(q)->queue_flags) @@ -606,7 +570,7 @@ static inline void queue_flag_clear(unsigned int flag, struct request_queue *q) #define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist) -#define rq_data_dir(rq) (((rq)->cmd_flags & 1) != 0) +#define rq_data_dir(rq) ((rq)->cmd_flags & 1) static inline unsigned int blk_queue_cluster(struct request_queue *q) { @@ -1049,7 +1013,6 @@ static inline void blk_post_runtime_resume(struct request_queue *q, int err) {} struct blk_plug { unsigned long magic; /* detect uninitialized use-cases */ struct list_head list; /* requests */ - struct list_head mq_list; /* blk-mq requests */ struct list_head cb_list; /* md requires an unplug callback */ }; #define BLK_MAX_REQUEST_COUNT 16 @@ -1087,10 +1050,7 @@ static inline bool blk_needs_flush_plug(struct task_struct *tsk) { struct blk_plug *plug = tsk->plug; - return plug && - (!list_empty(&plug->list) || - !list_empty(&plug->mq_list) || - !list_empty(&plug->cb_list)); + return plug && (!list_empty(&plug->list) || !list_empty(&plug->cb_list)); } /* @@ -1365,7 +1325,6 @@ static inline void put_dev_sector(Sector p) struct work_struct; int kblockd_schedule_work(struct request_queue *q, struct work_struct *work); -int kblockd_schedule_delayed_work(struct request_queue *q, struct delayed_work *dwork, unsigned long delay); #ifdef CONFIG_BLK_CGROUP /* diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index afc1343..7c2e030 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h @@ -5,7 +5,6 @@ #include <linux/relay.h> #include <linux/compat.h> #include <uapi/linux/blktrace_api.h> -#include <linux/list.h> #if defined(CONFIG_BLK_DEV_IO_TRACE) @@ -24,7 +23,6 @@ struct blk_trace { struct dentry *dir; struct dentry *dropped_file; struct dentry *msg_file; - struct list_head running_list; atomic_t dropped; }; @@ -89,7 +87,7 @@ static inline int blk_trace_init_sysfs(struct device *dev) #ifdef CONFIG_COMPAT struct compat_blk_user_trace_setup { - char name[BLKTRACE_BDEV_SIZE]; + char name[32]; u16 act_mask; u32 buf_size; u32 buf_nr; diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 39c1d94..3561d30 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -612,6 +612,11 @@ struct cgroup_subsys { int subsys_id; int disabled; int early_init; + /* + * True if this subsys uses ID. ID is not available before cgroup_init() + * (not available in early_init time.) + */ + bool use_id; /* * If %false, this subsystem is properly hierarchical - @@ -637,6 +642,9 @@ struct cgroup_subsys { */ struct cgroupfs_root *root; struct list_head sibling; + /* used when use_id == true */ + struct idr idr; + spinlock_t id_lock; /* list of cftype_sets */ struct list_head cftsets; @@ -867,6 +875,35 @@ int css_scan_tasks(struct cgroup_subsys_state *css, int cgroup_attach_task_all(struct task_struct *from, struct task_struct *); int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from); +/* + * CSS ID is ID for cgroup_subsys_state structs under subsys. This only works + * if cgroup_subsys.use_id == true. It can be used for looking up and scanning. + * CSS ID is assigned at cgroup allocation (create) automatically + * and removed when subsys calls free_css_id() function. This is because + * the lifetime of cgroup_subsys_state is subsys's matter. + * + * Looking up and scanning function should be called under rcu_read_lock(). + * Taking cgroup_mutex is not necessary for following calls. + * But the css returned by this routine can be "not populated yet" or "being + * destroyed". The caller should check css and cgroup's status. + */ + +/* + * Typically Called at ->destroy(), or somewhere the subsys frees + * cgroup_subsys_state. + */ +void free_css_id(struct cgroup_subsys *ss, struct cgroup_subsys_state *css); + +/* Find a cgroup_subsys_state which has given ID */ + +struct cgroup_subsys_state *css_lookup(struct cgroup_subsys *ss, int id); + +/* Returns true if root is ancestor of cg */ +bool css_is_ancestor(struct cgroup_subsys_state *cg, + const struct cgroup_subsys_state *root); + +/* Get id and depth of css */ +unsigned short css_id(struct cgroup_subsys_state *css); struct cgroup_subsys_state *css_from_dir(struct dentry *dentry, struct cgroup_subsys *ss); diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 7e59253..73bdb69 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -472,7 +472,6 @@ void of_clk_del_provider(struct device_node *np); struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec, void *data); struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data); -int of_clk_get_parent_count(struct device_node *np); const char *of_clk_get_parent_name(struct device_node *np, int index); void of_clk_init(const struct of_device_id *matches); diff --git a/include/linux/clk/mxs.h b/include/linux/clk/mxs.h index 5138a90..90c30dc 100644 --- a/include/linux/clk/mxs.h +++ b/include/linux/clk/mxs.h @@ -9,6 +9,8 @@ #ifndef __LINUX_CLK_MXS_H #define __LINUX_CLK_MXS_H +int mx23_clocks_init(void); +int mx28_clocks_init(void); int mxs_saif_clkmux_select(unsigned int clkmux); #endif diff --git a/include/linux/clk/sunxi.h b/include/linux/clk/sunxi.h new file mode 100644 index 0000000..e074fdd --- /dev/null +++ b/include/linux/clk/sunxi.h @@ -0,0 +1,22 @@ +/* + * Copyright 2012 Maxime Ripard + * + * Maxime Ripard <maxime.ripard@free-electrons.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef __LINUX_CLK_SUNXI_H_ +#define __LINUX_CLK_SUNXI_H_ + +void __init sunxi_init_clocks(void); + +#endif diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index 493aa02..0857922 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h @@ -60,7 +60,6 @@ enum clock_event_mode { * Core shall set the interrupt affinity dynamically in broadcast mode */ #define CLOCK_EVT_FEAT_DYNIRQ 0x000020 -#define CLOCK_EVT_FEAT_PERCPU 0x000040 /** * struct clock_event_device - clock event device descriptor diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 67301a4..dbbf8aa 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h @@ -292,8 +292,6 @@ extern void clocksource_resume(void); extern struct clocksource * __init __weak clocksource_default_clock(void); extern void clocksource_mark_unstable(struct clocksource *cs); -extern u64 -clocks_calc_max_nsecs(u32 mult, u32 shift, u32 maxadj, u64 mask); extern void clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec); diff --git a/include/linux/cmdline-parser.h b/include/linux/cmdline-parser.h index a0f9280..98e892e 100644 --- a/include/linux/cmdline-parser.h +++ b/include/linux/cmdline-parser.h @@ -8,8 +8,6 @@ #define CMDLINEPARSEH #include <linux/blkdev.h> -#include <linux/fs.h> -#include <linux/slab.h> /* partition flags */ #define PF_RDONLY 0x01 /* Device is read only */ diff --git a/include/linux/compat.h b/include/linux/compat.h index eb8a49d..345da00 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -41,14 +41,14 @@ COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__) #define COMPAT_SYSCALL_DEFINEx(x, name, ...) \ - asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))\ - __attribute__((alias(__stringify(compat_SyS##name)))); \ + asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\ static inline long C_SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__));\ asmlinkage long compat_SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__));\ asmlinkage long compat_SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__))\ { \ return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \ } \ + SYSCALL_ALIAS(compat_sys##name, compat_SyS##name); \ static inline long C_SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__)) #ifndef compat_user_stack_pointer @@ -362,7 +362,7 @@ long compat_get_bitmap(unsigned long *mask, const compat_ulong_t __user *umask, long compat_put_bitmap(compat_ulong_t __user *umask, unsigned long *mask, unsigned long bitmap_size); int copy_siginfo_from_user32(siginfo_t *to, struct compat_siginfo __user *from); -int copy_siginfo_to_user32(struct compat_siginfo __user *to, const siginfo_t *from); +int copy_siginfo_to_user32(struct compat_siginfo __user *to, siginfo_t *from); int get_compat_sigevent(struct sigevent *event, const struct compat_sigevent __user *u_event); long compat_sys_rt_tgsigqueueinfo(compat_pid_t tgid, compat_pid_t pid, int sig, diff --git a/include/linux/completion.h b/include/linux/completion.h index 5d5aaae..3cd574d 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h @@ -5,7 +5,7 @@ * (C) Copyright 2001 Linus Torvalds * * Atomic wait-for-completion handler data structures. - * See kernel/sched/completion.c for details. + * See kernel/sched/core.c for details. */ #include <linux/wait.h> @@ -19,8 +19,8 @@ * * See also: complete(), wait_for_completion() (and friends _timeout, * _interruptible, _interruptible_timeout, and _killable), init_completion(), - * reinit_completion(), and macros DECLARE_COMPLETION(), - * DECLARE_COMPLETION_ONSTACK(). + * and macros DECLARE_COMPLETION(), DECLARE_COMPLETION_ONSTACK(), and + * INIT_COMPLETION(). */ struct completion { unsigned int done; @@ -65,7 +65,7 @@ struct completion { /** * init_completion - Initialize a dynamically allocated completion - * @x: pointer to completion structure that is to be initialized + * @x: completion structure that is to be initialized * * This inline function will initialize a dynamically created completion * structure. @@ -76,18 +76,6 @@ static inline void init_completion(struct completion *x) init_waitqueue_head(&x->wait); } -/** - * reinit_completion - reinitialize a completion structure - * @x: pointer to completion structure that is to be reinitialized - * - * This inline function should be used to reinitialize a completion structure so it can - * be reused. This is especially important after complete_all() is used. - */ -static inline void reinit_completion(struct completion *x) -{ - x->done = 0; -} - extern void wait_for_completion(struct completion *); extern void wait_for_completion_io(struct completion *); extern int wait_for_completion_interruptible(struct completion *x); @@ -106,4 +94,14 @@ extern bool completion_done(struct completion *x); extern void complete(struct completion *); extern void complete_all(struct completion *); +/** + * INIT_COMPLETION - reinitialize a completion structure + * @x: completion structure to be reinitialized + * + * This macro should be used to reinitialize a completion structure so it can + * be reused. This is especially important after complete_all() is used. + */ +#define INIT_COMPLETION(x) ((x).done = 0) + + #endif diff --git a/include/linux/coredump.h b/include/linux/coredump.h index d016a12..a98f1ca 100644 --- a/include/linux/coredump.h +++ b/include/linux/coredump.h @@ -10,14 +10,12 @@ * These are the only things you should do on a core-file: use only these * functions to write out all the necessary info. */ -struct coredump_params; -extern int dump_skip(struct coredump_params *cprm, size_t nr); -extern int dump_emit(struct coredump_params *cprm, const void *addr, int nr); -extern int dump_align(struct coredump_params *cprm, int align); +extern int dump_write(struct file *file, const void *addr, int nr); +extern int dump_seek(struct file *file, loff_t off); #ifdef CONFIG_COREDUMP -extern void do_coredump(const siginfo_t *siginfo); +extern void do_coredump(siginfo_t *siginfo); #else -static inline void do_coredump(const siginfo_t *siginfo) {} +static inline void do_coredump(siginfo_t *siginfo) {} #endif #endif /* _LINUX_COREDUMP_H */ diff --git a/include/linux/cper.h b/include/linux/cper.h index 2fc0ec3..c230494 100644 --- a/include/linux/cper.h +++ b/include/linux/cper.h @@ -218,8 +218,8 @@ enum { #define CPER_PROC_VALID_IP 0x1000 #define CPER_MEM_VALID_ERROR_STATUS 0x0001 -#define CPER_MEM_VALID_PA 0x0002 -#define CPER_MEM_VALID_PA_MASK 0x0004 +#define CPER_MEM_VALID_PHYSICAL_ADDRESS 0x0002 +#define CPER_MEM_VALID_PHYSICAL_ADDRESS_MASK 0x0004 #define CPER_MEM_VALID_NODE 0x0008 #define CPER_MEM_VALID_CARD 0x0010 #define CPER_MEM_VALID_MODULE 0x0020 @@ -232,9 +232,6 @@ enum { #define CPER_MEM_VALID_RESPONDER_ID 0x1000 #define CPER_MEM_VALID_TARGET_ID 0x2000 #define CPER_MEM_VALID_ERROR_TYPE 0x4000 -#define CPER_MEM_VALID_RANK_NUMBER 0x8000 -#define CPER_MEM_VALID_CARD_HANDLE 0x10000 -#define CPER_MEM_VALID_MODULE_HANDLE 0x20000 #define CPER_PCIE_VALID_PORT_TYPE 0x0001 #define CPER_PCIE_VALID_VERSION 0x0002 @@ -350,10 +347,6 @@ struct cper_sec_mem_err { __u64 responder_id; __u64 target_id; __u8 error_type; - __u8 reserved; - __u16 rank; - __u16 mem_array_handle; /* card handle in UEFI 2.4 */ - __u16 mem_dev_handle; /* module handle in UEFI 2.4 */ }; struct cper_sec_pcie { @@ -396,6 +389,6 @@ struct cper_sec_pcie { u64 cper_next_record_id(void); void cper_print_bits(const char *prefix, unsigned int bits, - const char * const strs[], unsigned int strs_size); + const char *strs[], unsigned int strs_size); #endif diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 03e235ad..801ff9e 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -18,7 +18,6 @@ #include <linux/cpumask.h> struct device; -struct device_node; struct cpu { int node_id; /* The node which contains the CPU */ @@ -30,8 +29,6 @@ extern int register_cpu(struct cpu *cpu, int num); extern struct device *get_cpu_device(unsigned cpu); extern bool cpu_is_hotpluggable(unsigned cpu); extern bool arch_match_cpu_phys_id(int cpu, u64 phys_id); -extern bool arch_find_n_match_cpu_physical_id(struct device_node *cpun, - int cpu, unsigned int *thread); extern int cpu_add_dev_attr(struct device_attribute *attr); extern void cpu_remove_dev_attr(struct device_attribute *attr); @@ -188,6 +185,19 @@ extern void cpu_hotplug_enable(void); void clear_tasks_mm_cpumask(int cpu); int cpu_down(unsigned int cpu); +#ifdef CONFIG_ARCH_CPU_PROBE_RELEASE +extern void cpu_hotplug_driver_lock(void); +extern void cpu_hotplug_driver_unlock(void); +#else +static inline void cpu_hotplug_driver_lock(void) +{ +} + +static inline void cpu_hotplug_driver_unlock(void) +{ +} +#endif + #else /* CONFIG_HOTPLUG_CPU */ static inline void cpu_hotplug_begin(void) {} diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index dc196bb..fcabc42 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -85,20 +85,6 @@ struct cpufreq_policy { struct list_head policy_list; struct kobject kobj; struct completion kobj_unregister; - - /* - * The rules for this semaphore: - * - Any routine that wants to read from the policy structure will - * do a down_read on this semaphore. - * - Any routine that will write to the policy structure and/or may take away - * the policy altogether (eg. CPU hotplug), will hold this lock in write - * mode before doing so. - * - * Additional rules: - * - Lock should not be held across - * __cpufreq_governor(data, CPUFREQ_GOV_POLICY_EXIT); - */ - struct rw_semaphore rwsem; }; /* Only for ACPI */ @@ -107,16 +93,8 @@ struct cpufreq_policy { #define CPUFREQ_SHARED_TYPE_ALL (2) /* All dependent CPUs should set freq */ #define CPUFREQ_SHARED_TYPE_ANY (3) /* Freq can be set from any dependent CPU*/ -#ifdef CONFIG_CPU_FREQ struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu); void cpufreq_cpu_put(struct cpufreq_policy *policy); -#else -static inline struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu) -{ - return NULL; -} -static inline void cpufreq_cpu_put(struct cpufreq_policy *policy) { } -#endif static inline bool policy_is_shared(struct cpufreq_policy *policy) { @@ -202,6 +180,13 @@ __ATTR(_name, 0644, show_##_name, store_##_name) struct cpufreq_driver { char name[CPUFREQ_NAME_LEN]; u8 flags; + /* + * This should be set by platforms having multiple clock-domains, i.e. + * supporting multiple policies. With this sysfs directories of governor + * would be created in cpu/cpu<num>/cpufreq/ directory and so they can + * use the same governor with different tunables for different clusters. + */ + bool have_governor_per_policy; /* needed by all drivers */ int (*init) (struct cpufreq_policy *policy); @@ -209,11 +194,9 @@ struct cpufreq_driver { /* define one out of two */ int (*setpolicy) (struct cpufreq_policy *policy); - int (*target) (struct cpufreq_policy *policy, /* Deprecated */ + int (*target) (struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation); - int (*target_index) (struct cpufreq_policy *policy, - unsigned int index); /* should be defined, if possible */ unsigned int (*get) (unsigned int cpu); @@ -228,29 +211,13 @@ struct cpufreq_driver { }; /* flags */ -#define CPUFREQ_STICKY (1 << 0) /* driver isn't removed even if - all ->init() calls failed */ -#define CPUFREQ_CONST_LOOPS (1 << 1) /* loops_per_jiffy or other - kernel "constants" aren't - affected by frequency - transitions */ -#define CPUFREQ_PM_NO_WARN (1 << 2) /* don't warn on suspend/resume - speed mismatches */ - -/* - * This should be set by platforms having multiple clock-domains, i.e. - * supporting multiple policies. With this sysfs directories of governor would - * be created in cpu/cpu<num>/cpufreq/ directory and so they can use the same - * governor with different tunables for different clusters. - */ -#define CPUFREQ_HAVE_GOVERNOR_PER_POLICY (1 << 3) - -/* - * Driver will do POSTCHANGE notifications from outside of their ->target() - * routine and so must set cpufreq_driver->flags with this flag, so that core - * can handle them specially. - */ -#define CPUFREQ_ASYNC_NOTIFICATION (1 << 4) +#define CPUFREQ_STICKY 0x01 /* the driver isn't removed even if + * all ->init() calls failed */ +#define CPUFREQ_CONST_LOOPS 0x02 /* loops_per_jiffy or other kernel + * "constants" aren't affected by + * frequency transitions */ +#define CPUFREQ_PM_NO_WARN 0x04 /* don't warn on suspend/resume speed + * mismatches */ int cpufreq_register_driver(struct cpufreq_driver *driver_data); int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); @@ -273,13 +240,6 @@ static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy, return; } -static inline void -cpufreq_verify_within_cpu_limits(struct cpufreq_policy *policy) -{ - cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, - policy->cpuinfo.max_freq); -} - /********************************************************************* * CPUFREQ NOTIFIER INTERFACE * *********************************************************************/ @@ -432,7 +392,6 @@ int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy, int cpufreq_frequency_table_verify(struct cpufreq_policy *policy, struct cpufreq_frequency_table *table); -int cpufreq_generic_frequency_table_verify(struct cpufreq_policy *policy); int cpufreq_frequency_table_target(struct cpufreq_policy *policy, struct cpufreq_frequency_table *table, @@ -448,20 +407,8 @@ struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu); /* the following are really really optional */ extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs; -extern struct freq_attr *cpufreq_generic_attr[]; void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table, unsigned int cpu); void cpufreq_frequency_table_put_attr(unsigned int cpu); -int cpufreq_table_validate_and_show(struct cpufreq_policy *policy, - struct cpufreq_frequency_table *table); - -int cpufreq_generic_init(struct cpufreq_policy *policy, - struct cpufreq_frequency_table *table, - unsigned int transition_latency); -static inline int cpufreq_generic_exit(struct cpufreq_policy *policy) -{ - cpufreq_frequency_table_put_attr(policy->cpu); - return 0; -} #endif /* _LINUX_CPUFREQ_H */ diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 50fcbb0..781addc 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h @@ -114,7 +114,7 @@ struct cpuidle_driver { int safe_state_index; /* the driver handles the cpus in cpumask */ - struct cpumask *cpumask; + struct cpumask *cpumask; }; #ifdef CONFIG_CPU_IDLE @@ -195,10 +195,16 @@ struct cpuidle_governor { }; #ifdef CONFIG_CPU_IDLE + extern int cpuidle_register_governor(struct cpuidle_governor *gov); +extern void cpuidle_unregister_governor(struct cpuidle_governor *gov); + #else + static inline int cpuidle_register_governor(struct cpuidle_governor *gov) {return 0;} +static inline void cpuidle_unregister_governor(struct cpuidle_governor *gov) { } + #endif #ifdef CONFIG_ARCH_HAS_CPU_RELAX diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index 3fe661f..cc1b01c 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h @@ -110,14 +110,10 @@ static inline bool put_mems_allowed(unsigned int seq) static inline void set_mems_allowed(nodemask_t nodemask) { - unsigned long flags; - task_lock(current); - local_irq_save(flags); write_seqcount_begin(¤t->mems_allowed_seq); current->mems_allowed = nodemask; write_seqcount_end(¤t->mems_allowed_seq); - local_irq_restore(flags); task_unlock(current); } diff --git a/include/linux/crc32.h b/include/linux/crc32.h index 7d275c4..68267b6 100644 --- a/include/linux/crc32.h +++ b/include/linux/crc32.h @@ -11,48 +11,8 @@ extern u32 crc32_le(u32 crc, unsigned char const *p, size_t len); extern u32 crc32_be(u32 crc, unsigned char const *p, size_t len); -/** - * crc32_le_combine - Combine two crc32 check values into one. For two - * sequences of bytes, seq1 and seq2 with lengths len1 - * and len2, crc32_le() check values were calculated - * for each, crc1 and crc2. - * - * @crc1: crc32 of the first block - * @crc2: crc32 of the second block - * @len2: length of the second block - * - * Return: The crc32_le() check value of seq1 and seq2 concatenated, - * requiring only crc1, crc2, and len2. Note: If seq_full denotes - * the concatenated memory area of seq1 with seq2, and crc_full - * the crc32_le() value of seq_full, then crc_full == - * crc32_le_combine(crc1, crc2, len2) when crc_full was seeded - * with the same initializer as crc1, and crc2 seed was 0. See - * also crc32_combine_test(). - */ -extern u32 crc32_le_combine(u32 crc1, u32 crc2, size_t len2); - extern u32 __crc32c_le(u32 crc, unsigned char const *p, size_t len); -/** - * __crc32c_le_combine - Combine two crc32c check values into one. For two - * sequences of bytes, seq1 and seq2 with lengths len1 - * and len2, __crc32c_le() check values were calculated - * for each, crc1 and crc2. - * - * @crc1: crc32c of the first block - * @crc2: crc32c of the second block - * @len2: length of the second block - * - * Return: The __crc32c_le() check value of seq1 and seq2 concatenated, - * requiring only crc1, crc2, and len2. Note: If seq_full denotes - * the concatenated memory area of seq1 with seq2, and crc_full - * the __crc32c_le() value of seq_full, then crc_full == - * __crc32c_le_combine(crc1, crc2, len2) when crc_full was - * seeded with the same initializer as crc1, and crc2 seed - * was 0. See also crc32c_combine_test(). - */ -extern u32 __crc32c_le_combine(u32 crc1, u32 crc2, size_t len2); - #define crc32(seed, data, length) crc32_le(seed, (unsigned char const *)(data), length) /* diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 57e87e7..59066e0 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -169,13 +169,13 @@ struct dentry_operations { */ /* d_flags entries */ -#define DCACHE_OP_HASH 0x00000001 -#define DCACHE_OP_COMPARE 0x00000002 -#define DCACHE_OP_REVALIDATE 0x00000004 -#define DCACHE_OP_DELETE 0x00000008 -#define DCACHE_OP_PRUNE 0x00000010 +#define DCACHE_OP_HASH 0x0001 +#define DCACHE_OP_COMPARE 0x0002 +#define DCACHE_OP_REVALIDATE 0x0004 +#define DCACHE_OP_DELETE 0x0008 +#define DCACHE_OP_PRUNE 0x0010 -#define DCACHE_DISCONNECTED 0x00000020 +#define DCACHE_DISCONNECTED 0x0020 /* This dentry is possibly not currently connected to the dcache tree, in * which case its parent will either be itself, or will have this flag as * well. nfsd will not use a dentry with this bit set, but will first @@ -186,38 +186,30 @@ struct dentry_operations { * dentry into place and return that dentry rather than the passed one, * typically using d_splice_alias. */ -#define DCACHE_REFERENCED 0x00000040 /* Recently used, don't discard. */ -#define DCACHE_RCUACCESS 0x00000080 /* Entry has ever been RCU-visible */ +#define DCACHE_REFERENCED 0x0040 /* Recently used, don't discard. */ +#define DCACHE_RCUACCESS 0x0080 /* Entry has ever been RCU-visible */ -#define DCACHE_CANT_MOUNT 0x00000100 -#define DCACHE_GENOCIDE 0x00000200 -#define DCACHE_SHRINK_LIST 0x00000400 +#define DCACHE_CANT_MOUNT 0x0100 +#define DCACHE_GENOCIDE 0x0200 +#define DCACHE_SHRINK_LIST 0x0400 -#define DCACHE_OP_WEAK_REVALIDATE 0x00000800 +#define DCACHE_OP_WEAK_REVALIDATE 0x0800 -#define DCACHE_NFSFS_RENAMED 0x00001000 +#define DCACHE_NFSFS_RENAMED 0x1000 /* this dentry has been "silly renamed" and has to be deleted on the last * dput() */ -#define DCACHE_COOKIE 0x00002000 /* For use by dcookie subsystem */ -#define DCACHE_FSNOTIFY_PARENT_WATCHED 0x00004000 +#define DCACHE_COOKIE 0x2000 /* For use by dcookie subsystem */ +#define DCACHE_FSNOTIFY_PARENT_WATCHED 0x4000 /* Parent inode is watched by some fsnotify listener */ -#define DCACHE_DENTRY_KILLED 0x00008000 - -#define DCACHE_MOUNTED 0x00010000 /* is a mountpoint */ -#define DCACHE_NEED_AUTOMOUNT 0x00020000 /* handle automount on this dir */ -#define DCACHE_MANAGE_TRANSIT 0x00040000 /* manage transit from this dirent */ +#define DCACHE_MOUNTED 0x10000 /* is a mountpoint */ +#define DCACHE_NEED_AUTOMOUNT 0x20000 /* handle automount on this dir */ +#define DCACHE_MANAGE_TRANSIT 0x40000 /* manage transit from this dirent */ #define DCACHE_MANAGED_DENTRY \ (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT) -#define DCACHE_LRU_LIST 0x00080000 - -#define DCACHE_ENTRY_TYPE 0x00700000 -#define DCACHE_MISS_TYPE 0x00000000 /* Negative dentry */ -#define DCACHE_DIRECTORY_TYPE 0x00100000 /* Normal directory */ -#define DCACHE_AUTODIR_TYPE 0x00200000 /* Lookupless directory (presumed automount) */ -#define DCACHE_SYMLINK_TYPE 0x00300000 /* Symlink */ -#define DCACHE_FILE_TYPE 0x00400000 /* Other file type */ +#define DCACHE_LRU_LIST 0x80000 +#define DCACHE_DENTRY_KILLED 0x100000 extern seqlock_t rename_lock; @@ -232,7 +224,6 @@ static inline int dname_external(const struct dentry *dentry) extern void d_instantiate(struct dentry *, struct inode *); extern struct dentry * d_instantiate_unique(struct dentry *, struct inode *); extern struct dentry * d_materialise_unique(struct dentry *, struct inode *); -extern int d_instantiate_no_diralias(struct dentry *, struct inode *); extern void __d_drop(struct dentry *dentry); extern void d_drop(struct dentry *dentry); extern void d_delete(struct dentry *); @@ -402,61 +393,6 @@ static inline bool d_mountpoint(const struct dentry *dentry) return dentry->d_flags & DCACHE_MOUNTED; } -/* - * Directory cache entry type accessor functions. - */ -static inline void __d_set_type(struct dentry *dentry, unsigned type) -{ - dentry->d_flags = (dentry->d_flags & ~DCACHE_ENTRY_TYPE) | type; -} - -static inline void __d_clear_type(struct dentry *dentry) -{ - __d_set_type(dentry, DCACHE_MISS_TYPE); -} - -static inline void d_set_type(struct dentry *dentry, unsigned type) -{ - spin_lock(&dentry->d_lock); - __d_set_type(dentry, type); - spin_unlock(&dentry->d_lock); -} - -static inline unsigned __d_entry_type(const struct dentry *dentry) -{ - return dentry->d_flags & DCACHE_ENTRY_TYPE; -} - -static inline bool d_is_directory(const struct dentry *dentry) -{ - return __d_entry_type(dentry) == DCACHE_DIRECTORY_TYPE; -} - -static inline bool d_is_autodir(const struct dentry *dentry) -{ - return __d_entry_type(dentry) == DCACHE_AUTODIR_TYPE; -} - -static inline bool d_is_symlink(const struct dentry *dentry) -{ - return __d_entry_type(dentry) == DCACHE_SYMLINK_TYPE; -} - -static inline bool d_is_file(const struct dentry *dentry) -{ - return __d_entry_type(dentry) == DCACHE_FILE_TYPE; -} - -static inline bool d_is_negative(const struct dentry *dentry) -{ - return __d_entry_type(dentry) == DCACHE_MISS_TYPE; -} - -static inline bool d_is_positive(const struct dentry *dentry) -{ - return !d_is_negative(dentry); -} - extern int sysctl_vfs_cache_pressure; static inline unsigned long vfs_pressure_ratio(unsigned long val) diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index 4d0b4d1..263489d 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h @@ -206,12 +206,6 @@ static inline struct dentry *debugfs_create_size_t(const char *name, umode_t mod return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_atomic_t(const char *name, umode_t mode, - struct dentry *parent, atomic_t *value) -{ - return ERR_PTR(-ENODEV); -} - static inline struct dentry *debugfs_create_bool(const char *name, umode_t mode, struct dentry *parent, u32 *value) @@ -233,12 +227,6 @@ static inline struct dentry *debugfs_create_regset32(const char *name, return ERR_PTR(-ENODEV); } -static inline int debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs, - int nregs, void __iomem *base, char *prefix) -{ - return 0; -} - static inline bool debugfs_initialized(void) { return false; diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h index d48dc00..5f1ab92 100644 --- a/include/linux/devfreq.h +++ b/include/linux/devfreq.h @@ -15,7 +15,7 @@ #include <linux/device.h> #include <linux/notifier.h> -#include <linux/pm_opp.h> +#include <linux/opp.h> #define DEVFREQ_NAME_LEN 16 @@ -168,7 +168,7 @@ struct devfreq { unsigned long max_freq; bool stop_polling; - /* information for device frequency transition */ + /* information for device freqeuncy transition */ unsigned int total_trans; unsigned int *trans_table; unsigned long *time_in_state; @@ -187,7 +187,7 @@ extern int devfreq_suspend_device(struct devfreq *devfreq); extern int devfreq_resume_device(struct devfreq *devfreq); /* Helper functions for devfreq user device driver with OPP. */ -extern struct dev_pm_opp *devfreq_recommended_opp(struct device *dev, +extern struct opp *devfreq_recommended_opp(struct device *dev, unsigned long *freq, u32 flags); extern int devfreq_register_opp_notifier(struct device *dev, struct devfreq *devfreq); @@ -238,7 +238,7 @@ static inline int devfreq_resume_device(struct devfreq *devfreq) return 0; } -static inline struct dev_pm_opp *devfreq_recommended_opp(struct device *dev, +static inline struct opp *devfreq_recommended_opp(struct device *dev, unsigned long *freq, u32 flags) { return ERR_PTR(-EINVAL); diff --git a/include/linux/device.h b/include/linux/device.h index 952b010..2a9d6ed 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -26,7 +26,6 @@ #include <linux/atomic.h> #include <linux/ratelimit.h> #include <linux/uidgid.h> -#include <linux/gfp.h> #include <asm/device.h> struct device; @@ -64,7 +63,9 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *); * @name: The name of the bus. * @dev_name: Used for subsystems to enumerate devices like ("foo%u", dev->id). * @dev_root: Default device to use as the parent. + * @bus_attrs: Default attributes of the bus. * @dev_attrs: Default attributes of the devices on the bus. + * @drv_attrs: Default attributes of the device drivers on the bus. * @bus_groups: Default attributes of the bus. * @dev_groups: Default attributes of the devices on the bus. * @drv_groups: Default attributes of the device drivers on the bus. @@ -105,7 +106,9 @@ struct bus_type { const char *name; const char *dev_name; struct device *dev_root; + struct bus_attribute *bus_attrs; /* use bus_groups instead */ struct device_attribute *dev_attrs; /* use dev_groups instead */ + struct driver_attribute *drv_attrs; /* use drv_groups instead */ const struct attribute_group **bus_groups; const struct attribute_group **dev_groups; const struct attribute_group **drv_groups; @@ -326,6 +329,8 @@ int subsys_virtual_register(struct bus_type *subsys, * @owner: The module owner. * @class_attrs: Default attributes of this class. * @dev_groups: Default attributes of the devices that belong to the class. + * @dev_attrs: Default attributes of the devices belong to the class. + * @dev_bin_attrs: Default binary attributes of the devices belong to the class. * @dev_kobj: The kobject that represents this class and links it into the hierarchy. * @dev_uevent: Called when a device is added, removed from this class, or a * few other things that generate uevents to add the environment @@ -353,7 +358,9 @@ struct class { struct module *owner; struct class_attribute *class_attrs; + struct device_attribute *dev_attrs; /* use dev_groups instead */ const struct attribute_group **dev_groups; + struct bin_attribute *dev_bin_attrs; struct kobject *dev_kobj; int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env); @@ -420,6 +427,8 @@ struct class_attribute { char *buf); ssize_t (*store)(struct class *class, struct class_attribute *attr, const char *buf, size_t count); + const void *(*namespace)(struct class *class, + const struct class_attribute *attr); }; #define CLASS_ATTR(_name, _mode, _show, _store) \ @@ -429,24 +438,10 @@ struct class_attribute { #define CLASS_ATTR_RO(_name) \ struct class_attribute class_attr_##_name = __ATTR_RO(_name) -extern int __must_check class_create_file_ns(struct class *class, - const struct class_attribute *attr, - const void *ns); -extern void class_remove_file_ns(struct class *class, - const struct class_attribute *attr, - const void *ns); - -static inline int __must_check class_create_file(struct class *class, - const struct class_attribute *attr) -{ - return class_create_file_ns(class, attr, NULL); -} - -static inline void class_remove_file(struct class *class, - const struct class_attribute *attr) -{ - return class_remove_file_ns(class, attr, NULL); -} +extern int __must_check class_create_file(struct class *class, + const struct class_attribute *attr); +extern void class_remove_file(struct class *class, + const struct class_attribute *attr); /* Simple class attribute that is just a static string */ struct class_attribute_string { @@ -607,24 +602,8 @@ extern void devres_close_group(struct device *dev, void *id); extern void devres_remove_group(struct device *dev, void *id); extern int devres_release_group(struct device *dev, void *id); -/* managed devm_k.alloc/kfree for device drivers */ -extern void *devm_kmalloc(struct device *dev, size_t size, gfp_t gfp); -static inline void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp) -{ - return devm_kmalloc(dev, size, gfp | __GFP_ZERO); -} -static inline void *devm_kmalloc_array(struct device *dev, - size_t n, size_t size, gfp_t flags) -{ - if (size != 0 && n > SIZE_MAX / size) - return NULL; - return devm_kmalloc(dev, n * size, flags); -} -static inline void *devm_kcalloc(struct device *dev, - size_t n, size_t size, gfp_t flags) -{ - return devm_kmalloc_array(dev, n, size, flags | __GFP_ZERO); -} +/* managed kzalloc/kfree for device drivers, no kmalloc, always use kzalloc */ +extern void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp); extern void devm_kfree(struct device *dev, void *p); void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res); @@ -644,11 +623,9 @@ struct device_dma_parameters { unsigned long segment_boundary_mask; }; -struct acpi_device; - struct acpi_dev_node { #ifdef CONFIG_ACPI - struct acpi_device *companion; + void *handle; #endif }; @@ -792,6 +769,14 @@ static inline struct device *kobj_to_dev(struct kobject *kobj) return container_of(kobj, struct device, kobj); } +#ifdef CONFIG_ACPI +#define ACPI_HANDLE(dev) ((dev)->acpi_node.handle) +#define ACPI_HANDLE_SET(dev, _handle_) (dev)->acpi_node.handle = (_handle_) +#else +#define ACPI_HANDLE(dev) (NULL) +#define ACPI_HANDLE_SET(dev, _handle_) do { } while (0) +#endif + /* Get the wakeup routines, which depend on struct device */ #include <linux/pm_wakeup.h> @@ -1164,15 +1149,16 @@ do { \ #endif /* - * dev_WARN*() acts like dev_printk(), but with the key difference of - * using WARN/WARN_ONCE to include file/line information and a backtrace. + * dev_WARN*() acts like dev_printk(), but with the key difference + * of using a WARN/WARN_ON to get the message out, including the + * file/line information and a backtrace. */ #define dev_WARN(dev, format, arg...) \ - WARN(1, "%s %s: " format, dev_driver_string(dev), dev_name(dev), ## arg); + WARN(1, "Device: %s\n" format, dev_driver_string(dev), ## arg); #define dev_WARN_ONCE(dev, condition, format, arg...) \ - WARN_ONCE(condition, "%s %s: " format, \ - dev_driver_string(dev), dev_name(dev), ## arg) + WARN_ONCE(condition, "Device %s\n" format, \ + dev_driver_string(dev), ## arg) /* Create alias, so I can be autoloaded. */ #define MODULE_ALIAS_CHARDEV(major,minor) \ diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index fd4aee2..3a8d0a2 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h @@ -97,30 +97,6 @@ static inline int dma_set_coherent_mask(struct device *dev, u64 mask) } #endif -/* - * Set both the DMA mask and the coherent DMA mask to the same thing. - * Note that we don't check the return value from dma_set_coherent_mask() - * as the DMA API guarantees that the coherent DMA mask can be set to - * the same or smaller than the streaming DMA mask. - */ -static inline int dma_set_mask_and_coherent(struct device *dev, u64 mask) -{ - int rc = dma_set_mask(dev, mask); - if (rc == 0) - dma_set_coherent_mask(dev, mask); - return rc; -} - -/* - * Similar to the above, except it deals with the case where the device - * does not have dev->dma_mask appropriately setup. - */ -static inline int dma_coerce_mask_and_coherent(struct device *dev, u64 mask) -{ - dev->dma_mask = &dev->coherent_dma_mask; - return dma_set_mask_and_coherent(dev, mask); -} - extern u64 dma_get_required_mask(struct device *dev); static inline unsigned int dma_get_max_seg_size(struct device *dev) @@ -153,13 +129,6 @@ static inline int dma_set_seg_boundary(struct device *dev, unsigned long mask) return -EIO; } -#ifndef dma_max_pfn -static inline unsigned long dma_max_pfn(struct device *dev) -{ - return *dev->dma_mask >> PAGE_SHIFT; -} -#endif - static inline void *dma_zalloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flag) { diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 41cf0c3..0bc7275 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h @@ -45,13 +45,13 @@ static inline int dma_submit_error(dma_cookie_t cookie) /** * enum dma_status - DMA transaction status - * @DMA_COMPLETE: transaction completed + * @DMA_SUCCESS: transaction completed successfully * @DMA_IN_PROGRESS: transaction not yet processed * @DMA_PAUSED: transaction is paused * @DMA_ERROR: transaction failed */ enum dma_status { - DMA_COMPLETE, + DMA_SUCCESS, DMA_IN_PROGRESS, DMA_PAUSED, DMA_ERROR, @@ -171,6 +171,12 @@ struct dma_interleaved_template { * @DMA_CTRL_ACK - if clear, the descriptor cannot be reused until the client * acknowledges receipt, i.e. has has a chance to establish any dependency * chains + * @DMA_COMPL_SKIP_SRC_UNMAP - set to disable dma-unmapping the source buffer(s) + * @DMA_COMPL_SKIP_DEST_UNMAP - set to disable dma-unmapping the destination(s) + * @DMA_COMPL_SRC_UNMAP_SINGLE - set to do the source dma-unmapping as single + * (if not set, do the source dma-unmapping as page) + * @DMA_COMPL_DEST_UNMAP_SINGLE - set to do the destination dma-unmapping as single + * (if not set, do the destination dma-unmapping as page) * @DMA_PREP_PQ_DISABLE_P - prevent generation of P while generating Q * @DMA_PREP_PQ_DISABLE_Q - prevent generation of Q while generating P * @DMA_PREP_CONTINUE - indicate to a driver that it is reusing buffers as @@ -182,10 +188,14 @@ struct dma_interleaved_template { enum dma_ctrl_flags { DMA_PREP_INTERRUPT = (1 << 0), DMA_CTRL_ACK = (1 << 1), - DMA_PREP_PQ_DISABLE_P = (1 << 2), - DMA_PREP_PQ_DISABLE_Q = (1 << 3), - DMA_PREP_CONTINUE = (1 << 4), - DMA_PREP_FENCE = (1 << 5), + DMA_COMPL_SKIP_SRC_UNMAP = (1 << 2), + DMA_COMPL_SKIP_DEST_UNMAP = (1 << 3), + DMA_COMPL_SRC_UNMAP_SINGLE = (1 << 4), + DMA_COMPL_DEST_UNMAP_SINGLE = (1 << 5), + DMA_PREP_PQ_DISABLE_P = (1 << 6), + DMA_PREP_PQ_DISABLE_Q = (1 << 7), + DMA_PREP_CONTINUE = (1 << 8), + DMA_PREP_FENCE = (1 << 9), }; /** @@ -403,17 +413,6 @@ void dma_chan_cleanup(struct kref *kref); typedef bool (*dma_filter_fn)(struct dma_chan *chan, void *filter_param); typedef void (*dma_async_tx_callback)(void *dma_async_param); - -struct dmaengine_unmap_data { - u8 to_cnt; - u8 from_cnt; - u8 bidi_cnt; - struct device *dev; - struct kref kref; - size_t len; - dma_addr_t addr[0]; -}; - /** * struct dma_async_tx_descriptor - async transaction descriptor * ---dma generic offload fields--- @@ -439,7 +438,6 @@ struct dma_async_tx_descriptor { dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx); dma_async_tx_callback callback; void *callback_param; - struct dmaengine_unmap_data *unmap; #ifdef CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH struct dma_async_tx_descriptor *next; struct dma_async_tx_descriptor *parent; @@ -447,40 +445,6 @@ struct dma_async_tx_descriptor { #endif }; -#ifdef CONFIG_DMA_ENGINE -static inline void dma_set_unmap(struct dma_async_tx_descriptor *tx, - struct dmaengine_unmap_data *unmap) -{ - kref_get(&unmap->kref); - tx->unmap = unmap; -} - -struct dmaengine_unmap_data * -dmaengine_get_unmap_data(struct device *dev, int nr, gfp_t flags); -void dmaengine_unmap_put(struct dmaengine_unmap_data *unmap); -#else -static inline void dma_set_unmap(struct dma_async_tx_descriptor *tx, - struct dmaengine_unmap_data *unmap) -{ -} -static inline struct dmaengine_unmap_data * -dmaengine_get_unmap_data(struct device *dev, int nr, gfp_t flags) -{ - return NULL; -} -static inline void dmaengine_unmap_put(struct dmaengine_unmap_data *unmap) -{ -} -#endif - -static inline void dma_descriptor_unmap(struct dma_async_tx_descriptor *tx) -{ - if (tx->unmap) { - dmaengine_unmap_put(tx->unmap); - tx->unmap = NULL; - } -} - #ifndef CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH static inline void txd_lock(struct dma_async_tx_descriptor *txd) { @@ -1015,10 +979,10 @@ static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie, { if (last_complete <= last_used) { if ((cookie <= last_complete) || (cookie > last_used)) - return DMA_COMPLETE; + return DMA_SUCCESS; } else { if ((cookie <= last_complete) && (cookie > last_used)) - return DMA_COMPLETE; + return DMA_SUCCESS; } return DMA_IN_PROGRESS; } @@ -1049,11 +1013,11 @@ static inline struct dma_chan *dma_find_channel(enum dma_transaction_type tx_typ } static inline enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie) { - return DMA_COMPLETE; + return DMA_SUCCESS; } static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx) { - return DMA_COMPLETE; + return DMA_SUCCESS; } static inline void dma_issue_pending_all(void) { diff --git a/include/linux/dmi.h b/include/linux/dmi.h index f820f0a..b6eb7a0 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h @@ -99,7 +99,6 @@ extern const char * dmi_get_system_info(int field); extern const struct dmi_device * dmi_find_device(int type, const char *name, const struct dmi_device *from); extern void dmi_scan_machine(void); -extern void dmi_memdev_walk(void); extern void dmi_set_dump_stack_arch_desc(void); extern bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp); extern int dmi_name_in_vendors(const char *str); @@ -108,7 +107,6 @@ extern int dmi_available; extern int dmi_walk(void (*decode)(const struct dmi_header *, void *), void *private_data); extern bool dmi_match(enum dmi_field f, const char *str); -extern void dmi_memdev_name(u16 handle, const char **bank, const char **device); #else @@ -117,7 +115,6 @@ static inline const char * dmi_get_system_info(int field) { return NULL; } static inline const struct dmi_device * dmi_find_device(int type, const char *name, const struct dmi_device *from) { return NULL; } static inline void dmi_scan_machine(void) { return; } -static inline void dmi_memdev_walk(void) { } static inline void dmi_set_dump_stack_arch_desc(void) { } static inline bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp) { @@ -136,8 +133,6 @@ static inline int dmi_walk(void (*decode)(const struct dmi_header *, void *), void *private_data) { return -1; } static inline bool dmi_match(enum dmi_field f, const char *str) { return false; } -static inline void dmi_memdev_name(u16 handle, const char **bank, - const char **device) { } static inline const struct dmi_system_id * dmi_first_match(const struct dmi_system_id *list) { return NULL; } diff --git a/include/linux/edac.h b/include/linux/edac.h index dbdffe8..5c6d7fb 100644 --- a/include/linux/edac.h +++ b/include/linux/edac.h @@ -51,7 +51,7 @@ static inline void opstate_init(void) #define EDAC_MC_LABEL_LEN 31 /* Maximum size of the location string */ -#define LOCATION_SIZE 256 +#define LOCATION_SIZE 80 /* Defines the maximum number of labels that can be reported */ #define EDAC_MAX_LABELS 8 diff --git a/include/linux/efi.h b/include/linux/efi.h index 11ce678..5f8f176 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -39,8 +39,6 @@ typedef unsigned long efi_status_t; typedef u8 efi_bool_t; typedef u16 efi_char16_t; /* UNICODE character */ -typedef u64 efi_physical_addr_t; -typedef void *efi_handle_t; typedef struct { @@ -98,7 +96,6 @@ typedef struct { #define EFI_MEMORY_DESCRIPTOR_VERSION 1 #define EFI_PAGE_SHIFT 12 -#define EFI_PAGE_SIZE (1UL << EFI_PAGE_SHIFT) typedef struct { u32 type; @@ -160,13 +157,11 @@ typedef struct { efi_table_hdr_t hdr; void *raise_tpl; void *restore_tpl; - efi_status_t (*allocate_pages)(int, int, unsigned long, - efi_physical_addr_t *); - efi_status_t (*free_pages)(efi_physical_addr_t, unsigned long); - efi_status_t (*get_memory_map)(unsigned long *, void *, unsigned long *, - unsigned long *, u32 *); - efi_status_t (*allocate_pool)(int, unsigned long, void **); - efi_status_t (*free_pool)(void *); + void *allocate_pages; + void *free_pages; + void *get_memory_map; + void *allocate_pool; + void *free_pool; void *create_event; void *set_timer; void *wait_for_event; @@ -176,7 +171,7 @@ typedef struct { void *install_protocol_interface; void *reinstall_protocol_interface; void *uninstall_protocol_interface; - efi_status_t (*handle_protocol)(efi_handle_t, efi_guid_t *, void **); + void *handle_protocol; void *__reserved; void *register_protocol_notify; void *locate_handle; @@ -186,7 +181,7 @@ typedef struct { void *start_image; void *exit; void *unload_image; - efi_status_t (*exit_boot_services)(efi_handle_t, unsigned long); + void *exit_boot_services; void *get_next_monotonic_count; void *stall; void *set_watchdog_timer; @@ -409,12 +404,6 @@ typedef struct { unsigned long table; } efi_config_table_t; -typedef struct { - efi_guid_t guid; - const char *name; - unsigned long *ptr; -} efi_config_table_type_t; - #define EFI_SYSTEM_TABLE_SIGNATURE ((u64)0x5453595320494249ULL) #define EFI_2_30_SYSTEM_TABLE_REVISION ((2 << 16) | (30)) @@ -499,6 +488,10 @@ typedef struct { unsigned long unload; } efi_loaded_image_t; +typedef struct { + u64 revision; + void *open_volume; +} efi_file_io_interface_t; typedef struct { u64 size; @@ -511,30 +504,20 @@ typedef struct { efi_char16_t filename[1]; } efi_file_info_t; -typedef struct _efi_file_handle { +typedef struct { u64 revision; - efi_status_t (*open)(struct _efi_file_handle *, - struct _efi_file_handle **, - efi_char16_t *, u64, u64); - efi_status_t (*close)(struct _efi_file_handle *); + void *open; + void *close; void *delete; - efi_status_t (*read)(struct _efi_file_handle *, unsigned long *, - void *); + void *read; void *write; void *get_position; void *set_position; - efi_status_t (*get_info)(struct _efi_file_handle *, efi_guid_t *, - unsigned long *, void *); + void *get_info; void *set_info; void *flush; } efi_file_handle_t; -typedef struct _efi_file_io_interface { - u64 revision; - int (*open_volume)(struct _efi_file_io_interface *, - efi_file_handle_t **); -} efi_file_io_interface_t; - #define EFI_FILE_MODE_READ 0x0000000000000001 #define EFI_FILE_MODE_WRITE 0x0000000000000002 #define EFI_FILE_MODE_CREATE 0x8000000000000000 @@ -569,7 +552,6 @@ extern struct efi { efi_get_next_high_mono_count_t *get_next_high_mono_count; efi_reset_system_t *reset_system; efi_set_virtual_address_map_t *set_virtual_address_map; - struct efi_memory_map *memmap; } efi; static inline int @@ -605,7 +587,6 @@ static inline efi_status_t efi_query_variable_store(u32 attributes, unsigned lon } #endif extern void __iomem *efi_lookup_mapped_addr(u64 phys_addr); -extern int efi_config_init(efi_config_table_type_t *arch_tables); extern u64 efi_get_iobase (void); extern u32 efi_mem_type (unsigned long phys_addr); extern u64 efi_mem_attributes (unsigned long phys_addr); @@ -801,15 +782,6 @@ struct efivar_entry { struct efi_variable var; struct list_head list; struct kobject kobj; - bool scanning; - bool deleting; -}; - - -struct efi_simple_text_output_protocol { - void *reset; - efi_status_t (*output_string)(void *, void *); - void *test_string; }; extern struct list_head efivar_sysfs_list; @@ -868,8 +840,6 @@ void efivar_run_worker(void); #if defined(CONFIG_EFI_VARS) || defined(CONFIG_EFI_VARS_MODULE) int efivars_sysfs_init(void); -#define EFIVARS_DATA_SIZE_MAX 1024 - #endif /* CONFIG_EFI_VARS */ #endif /* _LINUX_EFI_H */ diff --git a/include/linux/elf.h b/include/linux/elf.h index 67a5fa7..40a3c0e 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h @@ -39,13 +39,13 @@ extern Elf64_Dyn _DYNAMIC []; /* Optional callbacks to write extra ELF notes. */ struct file; -struct coredump_params; #ifndef ARCH_HAVE_EXTRA_ELF_NOTES static inline int elf_coredump_extra_notes_size(void) { return 0; } -static inline int elf_coredump_extra_notes_write(struct coredump_params *cprm) { return 0; } +static inline int elf_coredump_extra_notes_write(struct file *file, + loff_t *foffset) { return 0; } #else extern int elf_coredump_extra_notes_size(void); -extern int elf_coredump_extra_notes_write(struct coredump_params *cprm); +extern int elf_coredump_extra_notes_write(struct file *file, loff_t *foffset); #endif #endif /* _LINUX_ELF_H */ diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h index 698d51a..cdd3d13 100644 --- a/include/linux/elfcore.h +++ b/include/linux/elfcore.h @@ -6,8 +6,6 @@ #include <asm/elf.h> #include <uapi/linux/elfcore.h> -struct coredump_params; - static inline void elf_core_copy_regs(elf_gregset_t *elfregs, struct pt_regs *regs) { #ifdef ELF_CORE_COPY_REGS @@ -65,9 +63,10 @@ static inline int elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregse */ extern Elf_Half elf_core_extra_phdrs(void); extern int -elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset); +elf_core_write_extra_phdrs(struct file *file, loff_t offset, size_t *size, + unsigned long limit); extern int -elf_core_write_extra_data(struct coredump_params *cprm); +elf_core_write_extra_data(struct file *file, size_t *size, unsigned long limit); extern size_t elf_core_extra_data_size(void); #endif /* _LINUX_ELFCORE_H */ diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index fc4a9aa..d8b5124 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h @@ -28,24 +28,27 @@ #include <asm/unaligned.h> #ifdef __KERNEL__ -__be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev); +extern __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev); extern const struct header_ops eth_header_ops; -int eth_header(struct sk_buff *skb, struct net_device *dev, unsigned short type, - const void *daddr, const void *saddr, unsigned len); -int eth_rebuild_header(struct sk_buff *skb); -int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr); -int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh, - __be16 type); -void eth_header_cache_update(struct hh_cache *hh, const struct net_device *dev, - const unsigned char *haddr); -int eth_prepare_mac_addr_change(struct net_device *dev, void *p); -void eth_commit_mac_addr_change(struct net_device *dev, void *p); -int eth_mac_addr(struct net_device *dev, void *p); -int eth_change_mtu(struct net_device *dev, int new_mtu); -int eth_validate_addr(struct net_device *dev); - -struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs, +extern int eth_header(struct sk_buff *skb, struct net_device *dev, + unsigned short type, + const void *daddr, const void *saddr, unsigned len); +extern int eth_rebuild_header(struct sk_buff *skb); +extern int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr); +extern int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh, __be16 type); +extern void eth_header_cache_update(struct hh_cache *hh, + const struct net_device *dev, + const unsigned char *haddr); +extern int eth_prepare_mac_addr_change(struct net_device *dev, void *p); +extern void eth_commit_mac_addr_change(struct net_device *dev, void *p); +extern int eth_mac_addr(struct net_device *dev, void *p); +extern int eth_change_mtu(struct net_device *dev, int new_mtu); +extern int eth_validate_addr(struct net_device *dev); + + + +extern struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs, unsigned int rxqs); #define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1) #define alloc_etherdev_mq(sizeof_priv, count) alloc_etherdev_mqs(sizeof_priv, count, count) diff --git a/include/linux/export.h b/include/linux/export.h index 3f2793d..412cd50 100644 --- a/include/linux/export.h +++ b/include/linux/export.h @@ -43,7 +43,7 @@ extern struct module __this_module; /* Mark the CRC weak since genksyms apparently decides not to * generate a checksums for some symbols */ #define __CRC_SYMBOL(sym, sec) \ - extern __visible void *__crc_##sym __attribute__((weak)); \ + extern void *__crc_##sym __attribute__((weak)); \ static const unsigned long __kcrctab_##sym \ __used \ __attribute__((section("___kcrctab" sec "+" #sym), unused)) \ @@ -59,7 +59,7 @@ extern struct module __this_module; static const char __kstrtab_##sym[] \ __attribute__((section("__ksymtab_strings"), aligned(1))) \ = VMLINUX_SYMBOL_STR(sym); \ - __visible const struct kernel_symbol __ksymtab_##sym \ + static const struct kernel_symbol __ksymtab_##sym \ __used \ __attribute__((section("___ksymtab" sec "+" #sym), unused)) \ = { (unsigned long)&sym, __kstrtab_##sym } diff --git a/include/linux/extcon.h b/include/linux/extcon.h index 21c59af..fcb51c8 100644 --- a/include/linux/extcon.h +++ b/include/linux/extcon.h @@ -51,10 +51,10 @@ enum extcon_cable_name { EXTCON_USB = 0, EXTCON_USB_HOST, - EXTCON_TA, /* Travel Adaptor */ + EXTCON_TA, /* Travel Adaptor */ EXTCON_FAST_CHARGER, EXTCON_SLOW_CHARGER, - EXTCON_CHARGE_DOWNSTREAM, /* Charging an external device */ + EXTCON_CHARGE_DOWNSTREAM, /* Charging an external device */ EXTCON_HDMI, EXTCON_MHL, EXTCON_DVI, @@ -76,8 +76,8 @@ struct extcon_cable; /** * struct extcon_dev - An extcon device represents one external connector. - * @name: The name of this extcon device. Parent device name is - * used if NULL. + * @name: The name of this extcon device. Parent device name is used + * if NULL. * @supported_cable: Array of supported cable names ending with NULL. * If supported_cable is NULL, cable name related APIs * are disabled. @@ -89,21 +89,21 @@ struct extcon_cable; * be attached simulataneously. {0x7, 0} is equivalent to * {0x3, 0x6, 0x5, 0}. If it is {0xFFFFFFFF, 0}, there * can be no simultaneous connections. - * @print_name: An optional callback to override the method to print the - * name of the extcon device. + * @print_name: An optional callback to override the method to print the + * name of the extcon device. * @print_state: An optional callback to override the method to print the - * status of the extcon device. - * @dev: Device of this extcon. - * @state: Attach/detach state of this extcon. Do not provide at - * register-time. - * @nh: Notifier for the state change events from this extcon - * @entry: To support list of extcon devices so that users can search - * for extcon devices based on the extcon name. + * status of the extcon device. + * @dev: Device of this extcon. Do not provide at register-time. + * @state: Attach/detach state of this extcon. Do not provide at + * register-time + * @nh: Notifier for the state change events from this extcon + * @entry: To support list of extcon devices so that users can search + * for extcon devices based on the extcon name. * @lock: * @max_supported: Internal value to store the number of cables. * @extcon_dev_type: Device_type struct to provide attribute_groups * customized for each extcon device. - * @cables: Sysfs subdirectories. Each represents one cable. + * @cables: Sysfs subdirectories. Each represents one cable. * * In most cases, users only need to provide "User initializing data" of * this struct when registering an extcon. In some exceptional cases, @@ -111,27 +111,26 @@ struct extcon_cable; * are overwritten by register function. */ struct extcon_dev { - /* Optional user initializing data */ - const char *name; + /* --- Optional user initializing data --- */ + const char *name; const char **supported_cable; - const u32 *mutually_exclusive; + const u32 *mutually_exclusive; - /* Optional callbacks to override class functions */ + /* --- Optional callbacks to override class functions --- */ ssize_t (*print_name)(struct extcon_dev *edev, char *buf); ssize_t (*print_state)(struct extcon_dev *edev, char *buf); - /* Internal data. Please do not set. */ - struct device dev; + /* --- Internal data. Please do not set. --- */ + struct device *dev; + u32 state; struct raw_notifier_head nh; struct list_head entry; + spinlock_t lock; /* could be called by irq handler */ int max_supported; - spinlock_t lock; /* could be called by irq handler */ - u32 state; /* /sys/class/extcon/.../cable.n/... */ struct device_type extcon_dev_type; struct extcon_cable *cables; - /* /sys/class/extcon/.../mutually_exclusive/... */ struct attribute_group attr_g_muex; struct attribute **attrs_muex; @@ -139,13 +138,13 @@ struct extcon_dev { }; /** - * struct extcon_cable - An internal data for each cable of extcon device. - * @edev: The extcon device + * struct extcon_cable - An internal data for each cable of extcon device. + * @edev: The extcon device * @cable_index: Index of this cable in the edev - * @attr_g: Attribute group for the cable - * @attr_name: "name" sysfs entry - * @attr_state: "state" sysfs entry - * @attrs: Array pointing to attr_name and attr_state for attr_g + * @attr_g: Attribute group for the cable + * @attr_name: "name" sysfs entry + * @attr_state: "state" sysfs entry + * @attrs: Array pointing to attr_name and attr_state for attr_g */ struct extcon_cable { struct extcon_dev *edev; @@ -160,13 +159,11 @@ struct extcon_cable { /** * struct extcon_specific_cable_nb - An internal data for - * extcon_register_interest(). - * @internal_nb: A notifier block bridging extcon notifier - * and cable notifier. - * @user_nb: user provided notifier block for events from - * a specific cable. + * extcon_register_interest(). + * @internal_nb: a notifier block bridging extcon notifier and cable notifier. + * @user_nb: user provided notifier block for events from a specific cable. * @cable_index: the target cable. - * @edev: the target extcon device. + * @edev: the target extcon device. * @previous_value: the saved previous event value. */ struct extcon_specific_cable_nb { @@ -183,7 +180,7 @@ struct extcon_specific_cable_nb { * Following APIs are for notifiers or configurations. * Notifiers are the external port and connection devices. */ -extern int extcon_dev_register(struct extcon_dev *edev); +extern int extcon_dev_register(struct extcon_dev *edev, struct device *dev); extern void extcon_dev_unregister(struct extcon_dev *edev); extern struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name); @@ -241,7 +238,8 @@ extern int extcon_register_notifier(struct extcon_dev *edev, extern int extcon_unregister_notifier(struct extcon_dev *edev, struct notifier_block *nb); #else /* CONFIG_EXTCON */ -static inline int extcon_dev_register(struct extcon_dev *edev) +static inline int extcon_dev_register(struct extcon_dev *edev, + struct device *dev) { return 0; } diff --git a/include/linux/extcon/extcon-adc-jack.h b/include/linux/extcon/extcon-adc-jack.h index 9ca958c..20e9eef 100644 --- a/include/linux/extcon/extcon-adc-jack.h +++ b/include/linux/extcon/extcon-adc-jack.h @@ -20,10 +20,10 @@ /** * struct adc_jack_cond - condition to use an extcon state - * @state: the corresponding extcon state (if 0, this struct - * denotes the last adc_jack_cond element among the array) - * @min_adc: min adc value for this condition - * @max_adc: max adc value for this condition + * @state - the corresponding extcon state (if 0, this struct denotes + * the last adc_jack_cond element among the array) + * @min_adc - min adc value for this condition + * @max_adc - max adc value for this condition * * For example, if { .state = 0x3, .min_adc = 100, .max_adc = 200}, it means * that if ADC value is between (inclusive) 100 and 200, than the cable 0 and @@ -33,34 +33,34 @@ * because when no adc_jack_cond is met, state = 0 is automatically chosen. */ struct adc_jack_cond { - u32 state; /* extcon state value. 0 if invalid */ + u32 state; /* extcon state value. 0 if invalid */ u32 min_adc; u32 max_adc; }; /** * struct adc_jack_pdata - platform data for adc jack device. - * @name: name of the extcon device. If null, "adc-jack" is used. - * @consumer_channel: Unique name to identify the channel on the consumer - * side. This typically describes the channels used within - * the consumer. E.g. 'battery_voltage' - * @cable_names: array of cable names ending with null. - * @adc_contitions: array of struct adc_jack_cond conditions ending - * with .state = 0 entry. This describes how to decode - * adc values into extcon state. - * @irq_flags: irq flags used for the @irq - * @handling_delay_ms: in some devices, we need to read ADC value some - * milli-seconds after the interrupt occurs. You may - * describe such delays with @handling_delay_ms, which - * is rounded-off by jiffies. + * @name - name of the extcon device. If null, "adc-jack" is used. + * @consumer_channel - Unique name to identify the channel on the consumer + * side. This typically describes the channels used within + * the consumer. E.g. 'battery_voltage' + * @cable_names - array of cable names ending with null. + * @adc_contitions - array of struct adc_jack_cond conditions ending + * with .state = 0 entry. This describes how to decode + * adc values into extcon state. + * @irq_flags - irq flags used for the @irq + * @handling_delay_ms - in some devices, we need to read ADC value some + * milli-seconds after the interrupt occurs. You may + * describe such delays with @handling_delay_ms, which + * is rounded-off by jiffies. */ struct adc_jack_pdata { const char *name; const char *consumer_channel; - - /* The last entry should be NULL */ + /* + * The last entry should be NULL + */ const char **cable_names; - /* The last entry's state should be 0 */ struct adc_jack_cond *adc_conditions; diff --git a/include/linux/extcon/extcon-gpio.h b/include/linux/extcon/extcon-gpio.h index 4195810..2d8307f 100644 --- a/include/linux/extcon/extcon-gpio.h +++ b/include/linux/extcon/extcon-gpio.h @@ -25,17 +25,14 @@ /** * struct gpio_extcon_platform_data - A simple GPIO-controlled extcon device. - * @name: The name of this GPIO extcon device. - * @gpio: Corresponding GPIO. - * @gpio_active_low: Boolean describing whether gpio active state is 1 or 0 - * If true, low state of gpio means active. - * If false, high state of gpio means active. - * @debounce: Debounce time for GPIO IRQ in ms. - * @irq_flags: IRQ Flags (e.g., IRQF_TRIGGER_LOW). - * @state_on: print_state is overriden with state_on if attached. - * If NULL, default method of extcon class is used. - * @state_off: print_state is overriden with state_on if detached. - * If NUll, default method of extcon class is used. + * @name The name of this GPIO extcon device. + * @gpio Corresponding GPIO. + * @debounce Debounce time for GPIO IRQ in ms. + * @irq_flags IRQ Flags (e.g., IRQF_TRIGGER_LOW). + * @state_on print_state is overriden with state_on if attached. If Null, + * default method of extcon class is used. + * @state_off print_state is overriden with state_on if detached. If Null, + * default method of extcon class is used. * * Note that in order for state_on or state_off to be valid, both state_on * and state_off should be not NULL. If at least one of them is NULL, @@ -44,7 +41,6 @@ struct gpio_extcon_platform_data { const char *name; unsigned gpio; - bool gpio_active_low; unsigned long debounce; unsigned long irq_flags; diff --git a/include/linux/fb.h b/include/linux/fb.h index 70c4836..ffac70a 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -792,16 +792,4 @@ extern int fb_find_mode(struct fb_var_screeninfo *var, const struct fb_videomode *default_mode, unsigned int default_bpp); -/* Convenience logging macros */ -#define fb_err(fb_info, fmt, ...) \ - pr_err("fb%d: " fmt, (fb_info)->node, ##__VA_ARGS__) -#define fb_notice(info, fmt, ...) \ - pr_notice("fb%d: " fmt, (fb_info)->node, ##__VA_ARGS__) -#define fb_warn(fb_info, fmt, ...) \ - pr_warn("fb%d: " fmt, (fb_info)->node, ##__VA_ARGS__) -#define fb_info(fb_info, fmt, ...) \ - pr_info("fb%d: " fmt, (fb_info)->node, ##__VA_ARGS__) -#define fb_dbg(fb_info, fmt, ...) \ - pr_debug("fb%d: " fmt, (fb_info)->node, ##__VA_ARGS__) - #endif /* _LINUX_FB_H */ diff --git a/include/linux/fcdevice.h b/include/linux/fcdevice.h index 5009fa1..e460ef8 100644 --- a/include/linux/fcdevice.h +++ b/include/linux/fcdevice.h @@ -27,7 +27,7 @@ #include <linux/if_fc.h> #ifdef __KERNEL__ -struct net_device *alloc_fcdev(int sizeof_priv); +extern struct net_device *alloc_fcdev(int sizeof_priv); #endif #endif /* _LINUX_FCDEVICE_H */ diff --git a/include/linux/fddidevice.h b/include/linux/fddidevice.h index 9a79f01..155bafd 100644 --- a/include/linux/fddidevice.h +++ b/include/linux/fddidevice.h @@ -25,9 +25,10 @@ #include <linux/if_fddi.h> #ifdef __KERNEL__ -__be16 fddi_type_trans(struct sk_buff *skb, struct net_device *dev); -int fddi_change_mtu(struct net_device *dev, int new_mtu); -struct net_device *alloc_fddidev(int sizeof_priv); +extern __be16 fddi_type_trans(struct sk_buff *skb, + struct net_device *dev); +extern int fddi_change_mtu(struct net_device *dev, int new_mtu); +extern struct net_device *alloc_fddidev(int sizeof_priv); #endif #endif /* _LINUX_FDDIDEVICE_H */ diff --git a/include/linux/fs.h b/include/linux/fs.h index 121f11f..3f40547 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -623,13 +623,10 @@ static inline int inode_unhashed(struct inode *inode) * 0: the object of the current VFS operation * 1: parent * 2: child/target - * 3: xattr - * 4: second non-directory - * The last is for certain operations (such as rename) which lock two - * non-directories at once. + * 3: quota file * * The locking order between these classes is - * parent -> child -> normal -> xattr -> second non-directory + * parent -> child -> normal -> xattr -> quota */ enum inode_i_mutex_lock_class { @@ -637,12 +634,9 @@ enum inode_i_mutex_lock_class I_MUTEX_PARENT, I_MUTEX_CHILD, I_MUTEX_XATTR, - I_MUTEX_NONDIR2 + I_MUTEX_QUOTA }; -void lock_two_nondirectories(struct inode *, struct inode*); -void unlock_two_nondirectories(struct inode *, struct inode*); - /* * NOTE: in a 32bit arch with a preemptable kernel and * an UP compile the i_size_read/write must be atomic @@ -770,7 +764,12 @@ static inline int ra_has_index(struct file_ra_state *ra, pgoff_t index) #define FILE_MNT_WRITE_RELEASED 2 struct file { + /* + * fu_list becomes invalid after file_free is called and queued via + * fu_rcuhead for RCU freeing + */ union { + struct list_head fu_list; struct llist_node fu_llist; struct rcu_head fu_rcuhead; } f_u; @@ -784,6 +783,9 @@ struct file { * Must not be taken from IRQ context. */ spinlock_t f_lock; +#ifdef CONFIG_SMP + int f_sb_list_cpu; +#endif atomic_long_t f_count; unsigned int f_flags; fmode_t f_mode; @@ -880,7 +882,6 @@ static inline int file_check_writeable(struct file *filp) #define FL_POSIX 1 #define FL_FLOCK 2 -#define FL_DELEG 4 /* NFSv4 delegation */ #define FL_ACCESS 8 /* not trying to lock, just looking */ #define FL_EXISTS 16 /* when unlocking, test for existence */ #define FL_LEASE 32 /* lease held on this file */ @@ -1022,7 +1023,7 @@ extern int vfs_test_lock(struct file *, struct file_lock *); extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *); extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl); extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); -extern int __break_lease(struct inode *inode, unsigned int flags, unsigned int type); +extern int __break_lease(struct inode *inode, unsigned int flags); extern void lease_get_mtime(struct inode *, struct timespec *time); extern int generic_setlease(struct file *, long, struct file_lock **); extern int vfs_setlease(struct file *, long, struct file_lock **); @@ -1131,7 +1132,7 @@ static inline int flock_lock_file_wait(struct file *filp, return -ENOLCK; } -static inline int __break_lease(struct inode *inode, unsigned int mode, unsigned int type) +static inline int __break_lease(struct inode *inode, unsigned int mode) { return 0; } @@ -1263,6 +1264,11 @@ struct super_block { struct list_head s_inodes; /* all inodes */ struct hlist_bl_head s_anon; /* anonymous dentries for (nfs) exporting */ +#ifdef CONFIG_SMP + struct list_head __percpu *s_files; +#else + struct list_head s_files; +#endif struct list_head s_mounts; /* list of mounts; _not_ for fs use */ struct block_device *s_bdev; struct backing_dev_info *s_bdi; @@ -1324,7 +1330,6 @@ struct super_block { */ struct list_lru s_dentry_lru ____cacheline_aligned_in_smp; struct list_lru s_inode_lru ____cacheline_aligned_in_smp; - struct rcu_head rcu; }; extern struct timespec current_fs_time(struct super_block *sb); @@ -1453,10 +1458,10 @@ extern int vfs_create(struct inode *, struct dentry *, umode_t, bool); extern int vfs_mkdir(struct inode *, struct dentry *, umode_t); extern int vfs_mknod(struct inode *, struct dentry *, umode_t, dev_t); extern int vfs_symlink(struct inode *, struct dentry *, const char *); -extern int vfs_link(struct dentry *, struct inode *, struct dentry *, struct inode **); +extern int vfs_link(struct dentry *, struct inode *, struct dentry *); extern int vfs_rmdir(struct inode *, struct dentry *); -extern int vfs_unlink(struct inode *, struct dentry *, struct inode **); -extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *, struct inode **); +extern int vfs_unlink(struct inode *, struct dentry *); +extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); /* * VFS dentry helper functions. @@ -1870,17 +1875,6 @@ extern struct dentry *mount_pseudo(struct file_system_type *, char *, (((fops) && try_module_get((fops)->owner) ? (fops) : NULL)) #define fops_put(fops) \ do { if (fops) module_put((fops)->owner); } while(0) -/* - * This one is to be used *ONLY* from ->open() instances. - * fops must be non-NULL, pinned down *and* module dependencies - * should be sufficient to pin the caller down as well. - */ -#define replace_fops(f, fops) \ - do { \ - struct file *__file = (f); \ - fops_put(__file->f_op); \ - BUG_ON(!(__file->f_op = (fops))); \ - } while(0) extern int register_filesystem(struct file_system_type *); extern int unregister_filesystem(struct file_system_type *); @@ -1905,9 +1899,6 @@ extern bool fs_fully_visible(struct file_system_type *); extern int current_umask(void); -extern void ihold(struct inode * inode); -extern void iput(struct inode *); - /* /sys/fs */ extern struct kobject *fs_kobj; @@ -1964,39 +1955,9 @@ static inline int locks_verify_truncate(struct inode *inode, static inline int break_lease(struct inode *inode, unsigned int mode) { if (inode->i_flock) - return __break_lease(inode, mode, FL_LEASE); + return __break_lease(inode, mode); return 0; } - -static inline int break_deleg(struct inode *inode, unsigned int mode) -{ - if (inode->i_flock) - return __break_lease(inode, mode, FL_DELEG); - return 0; -} - -static inline int try_break_deleg(struct inode *inode, struct inode **delegated_inode) -{ - int ret; - - ret = break_deleg(inode, O_WRONLY|O_NONBLOCK); - if (ret == -EWOULDBLOCK && delegated_inode) { - *delegated_inode = inode; - ihold(inode); - } - return ret; -} - -static inline int break_deleg_wait(struct inode **delegated_inode) -{ - int ret; - - ret = break_deleg(*delegated_inode, O_WRONLY); - iput(*delegated_inode); - *delegated_inode = NULL; - return ret; -} - #else /* !CONFIG_FILE_LOCKING */ static inline int locks_mandatory_locked(struct inode *inode) { @@ -2036,22 +1997,6 @@ static inline int break_lease(struct inode *inode, unsigned int mode) return 0; } -static inline int break_deleg(struct inode *inode, unsigned int mode) -{ - return 0; -} - -static inline int try_break_deleg(struct inode *inode, struct inode **delegated_inode) -{ - return 0; -} - -static inline int break_deleg_wait(struct inode **delegated_inode) -{ - BUG(); - return 0; -} - #endif /* CONFIG_FILE_LOCKING */ /* fs/open.c */ @@ -2278,7 +2223,7 @@ extern void emergency_remount(void); #ifdef CONFIG_BLOCK extern sector_t bmap(struct inode *, sector_t); #endif -extern int notify_change(struct dentry *, struct iattr *, struct inode **); +extern int notify_change(struct dentry *, struct iattr *); extern int inode_permission(struct inode *, int); extern int generic_permission(struct inode *, int); @@ -2347,11 +2292,6 @@ static inline void allow_write_access(struct file *file) if (file) atomic_inc(&file_inode(file)->i_writecount); } -static inline bool inode_is_open_for_write(const struct inode *inode) -{ - return atomic_read(&inode->i_writecount) > 0; -} - #ifdef CONFIG_IMA static inline void i_readcount_dec(struct inode *inode) { @@ -2392,6 +2332,8 @@ extern loff_t vfs_llseek(struct file *file, loff_t offset, int whence); extern int inode_init_always(struct super_block *, struct inode *); extern void inode_init_once(struct inode *); extern void address_space_init_once(struct address_space *mapping); +extern void ihold(struct inode * inode); +extern void iput(struct inode *); extern struct inode * igrab(struct inode *); extern ino_t iunique(struct super_block *, ino_t); extern int inode_needs_sync(struct inode *inode); @@ -2560,10 +2502,8 @@ extern int __page_symlink(struct inode *inode, const char *symname, int len, int nofs); extern int page_symlink(struct inode *inode, const char *symname, int len); extern const struct inode_operations page_symlink_inode_operations; -extern void kfree_put_link(struct dentry *, struct nameidata *, void *); extern int generic_readlink(struct dentry *, char __user *, int); extern void generic_fillattr(struct inode *, struct kstat *); -int vfs_getattr_nosec(struct path *path, struct kstat *stat); extern int vfs_getattr(struct path *, struct kstat *); void __inode_add_bytes(struct inode *inode, loff_t bytes); void inode_add_bytes(struct inode *inode, loff_t bytes); @@ -2622,9 +2562,6 @@ extern int simple_write_begin(struct file *file, struct address_space *mapping, extern int simple_write_end(struct file *file, struct address_space *mapping, loff_t pos, unsigned len, unsigned copied, struct page *page, void *fsdata); -extern int always_delete_dentry(const struct dentry *); -extern struct inode *alloc_anon_inode(struct super_block *); -extern const struct dentry_operations simple_dentry_operations; extern struct dentry *simple_lookup(struct inode *, struct dentry *, unsigned int flags); extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); diff --git a/include/linux/fscache-cache.h b/include/linux/fscache-cache.h index 7714849..7823e9e 100644 --- a/include/linux/fscache-cache.h +++ b/include/linux/fscache-cache.h @@ -308,6 +308,36 @@ struct fscache_cache_ops { void (*dissociate_pages)(struct fscache_cache *cache); }; +/* + * data file or index object cookie + * - a file will only appear in one cache + * - a request to cache a file may or may not be honoured, subject to + * constraints such as disk space + * - indices are created on disk just-in-time + */ +struct fscache_cookie { + atomic_t usage; /* number of users of this cookie */ + atomic_t n_children; /* number of children of this cookie */ + atomic_t n_active; /* number of active users of netfs ptrs */ + spinlock_t lock; + spinlock_t stores_lock; /* lock on page store tree */ + struct hlist_head backing_objects; /* object(s) backing this file/index */ + const struct fscache_cookie_def *def; /* definition */ + struct fscache_cookie *parent; /* parent of this entry */ + void *netfs_data; /* back pointer to netfs */ + struct radix_tree_root stores; /* pages to be stored on this cookie */ +#define FSCACHE_COOKIE_PENDING_TAG 0 /* pages tag: pending write to cache */ +#define FSCACHE_COOKIE_STORING_TAG 1 /* pages tag: writing to cache */ + + unsigned long flags; +#define FSCACHE_COOKIE_LOOKING_UP 0 /* T if non-index cookie being looked up still */ +#define FSCACHE_COOKIE_NO_DATA_YET 1 /* T if new object with no cached data yet */ +#define FSCACHE_COOKIE_UNAVAILABLE 2 /* T if cookie is unavailable (error, etc) */ +#define FSCACHE_COOKIE_INVALIDATING 3 /* T if cookie is being invalidated */ +#define FSCACHE_COOKIE_RELINQUISHED 4 /* T if cookie has been relinquished */ +#define FSCACHE_COOKIE_RETIRED 5 /* T if cookie was retired */ +}; + extern struct fscache_cookie fscache_fsdef_index; /* @@ -370,7 +400,6 @@ struct fscache_object { #define FSCACHE_OBJECT_IS_LIVE 3 /* T if object is not withdrawn or relinquished */ #define FSCACHE_OBJECT_IS_LOOKED_UP 4 /* T if object has been looked up */ #define FSCACHE_OBJECT_IS_AVAILABLE 5 /* T if object has become active */ -#define FSCACHE_OBJECT_RETIRED 6 /* T if object was retired on relinquishment */ struct list_head cache_link; /* link in cache->object_list */ struct hlist_node cookie_link; /* link in cookie->backing_objects */ @@ -482,11 +511,6 @@ static inline void fscache_end_io(struct fscache_retrieval *op, op->end_io_func(page, op->context, error); } -static inline void __fscache_use_cookie(struct fscache_cookie *cookie) -{ - atomic_inc(&cookie->n_active); -} - /** * fscache_use_cookie - Request usage of cookie attached to an object * @object: Object description @@ -500,16 +524,6 @@ static inline bool fscache_use_cookie(struct fscache_object *object) return atomic_inc_not_zero(&cookie->n_active) != 0; } -static inline bool __fscache_unuse_cookie(struct fscache_cookie *cookie) -{ - return atomic_dec_and_test(&cookie->n_active); -} - -static inline void __fscache_wake_unused_cookie(struct fscache_cookie *cookie) -{ - wake_up_atomic_t(&cookie->n_active); -} - /** * fscache_unuse_cookie - Cease usage of cookie attached to an object * @object: Object description @@ -520,8 +534,8 @@ static inline void __fscache_wake_unused_cookie(struct fscache_cookie *cookie) static inline void fscache_unuse_cookie(struct fscache_object *object) { struct fscache_cookie *cookie = object->cookie; - if (__fscache_unuse_cookie(cookie)) - __fscache_wake_unused_cookie(cookie); + if (atomic_dec_and_test(&cookie->n_active)) + wake_up_atomic_t(&cookie->n_active); } /* diff --git a/include/linux/fscache.h b/include/linux/fscache.h index 115bb81..19b4645 100644 --- a/include/linux/fscache.h +++ b/include/linux/fscache.h @@ -167,42 +167,6 @@ struct fscache_netfs { }; /* - * data file or index object cookie - * - a file will only appear in one cache - * - a request to cache a file may or may not be honoured, subject to - * constraints such as disk space - * - indices are created on disk just-in-time - */ -struct fscache_cookie { - atomic_t usage; /* number of users of this cookie */ - atomic_t n_children; /* number of children of this cookie */ - atomic_t n_active; /* number of active users of netfs ptrs */ - spinlock_t lock; - spinlock_t stores_lock; /* lock on page store tree */ - struct hlist_head backing_objects; /* object(s) backing this file/index */ - const struct fscache_cookie_def *def; /* definition */ - struct fscache_cookie *parent; /* parent of this entry */ - void *netfs_data; /* back pointer to netfs */ - struct radix_tree_root stores; /* pages to be stored on this cookie */ -#define FSCACHE_COOKIE_PENDING_TAG 0 /* pages tag: pending write to cache */ -#define FSCACHE_COOKIE_STORING_TAG 1 /* pages tag: writing to cache */ - - unsigned long flags; -#define FSCACHE_COOKIE_LOOKING_UP 0 /* T if non-index cookie being looked up still */ -#define FSCACHE_COOKIE_NO_DATA_YET 1 /* T if new object with no cached data yet */ -#define FSCACHE_COOKIE_UNAVAILABLE 2 /* T if cookie is unavailable (error, etc) */ -#define FSCACHE_COOKIE_INVALIDATING 3 /* T if cookie is being invalidated */ -#define FSCACHE_COOKIE_RELINQUISHED 4 /* T if cookie has been relinquished */ -#define FSCACHE_COOKIE_ENABLED 5 /* T if cookie is enabled */ -#define FSCACHE_COOKIE_ENABLEMENT_LOCK 6 /* T if cookie is being en/disabled */ -}; - -static inline bool fscache_cookie_enabled(struct fscache_cookie *cookie) -{ - return test_bit(FSCACHE_COOKIE_ENABLED, &cookie->flags); -} - -/* * slow-path functions for when there is actually caching available, and the * netfs does actually have a valid token * - these are not to be called directly @@ -217,8 +181,8 @@ extern void __fscache_release_cache_tag(struct fscache_cache_tag *); extern struct fscache_cookie *__fscache_acquire_cookie( struct fscache_cookie *, const struct fscache_cookie_def *, - void *, bool); -extern void __fscache_relinquish_cookie(struct fscache_cookie *, bool); + void *); +extern void __fscache_relinquish_cookie(struct fscache_cookie *, int); extern int __fscache_check_consistency(struct fscache_cookie *); extern void __fscache_update_cookie(struct fscache_cookie *); extern int __fscache_attr_changed(struct fscache_cookie *); @@ -247,9 +211,6 @@ extern void __fscache_uncache_all_inode_pages(struct fscache_cookie *, struct inode *); extern void __fscache_readpages_cancel(struct fscache_cookie *cookie, struct list_head *pages); -extern void __fscache_disable_cookie(struct fscache_cookie *, bool); -extern void __fscache_enable_cookie(struct fscache_cookie *, - bool (*)(void *), void *); /** * fscache_register_netfs - Register a filesystem as desiring caching services @@ -328,7 +289,6 @@ void fscache_release_cache_tag(struct fscache_cache_tag *tag) * @def: A description of the cache object, including callback operations * @netfs_data: An arbitrary piece of data to be kept in the cookie to * represent the cache object to the netfs - * @enable: Whether or not to enable a data cookie immediately * * This function is used to inform FS-Cache about part of an index hierarchy * that can be used to locate files. This is done by requesting a cookie for @@ -341,12 +301,10 @@ static inline struct fscache_cookie *fscache_acquire_cookie( struct fscache_cookie *parent, const struct fscache_cookie_def *def, - void *netfs_data, - bool enable) + void *netfs_data) { - if (fscache_cookie_valid(parent) && fscache_cookie_enabled(parent)) - return __fscache_acquire_cookie(parent, def, netfs_data, - enable); + if (fscache_cookie_valid(parent)) + return __fscache_acquire_cookie(parent, def, netfs_data); else return NULL; } @@ -364,7 +322,7 @@ struct fscache_cookie *fscache_acquire_cookie( * description. */ static inline -void fscache_relinquish_cookie(struct fscache_cookie *cookie, bool retire) +void fscache_relinquish_cookie(struct fscache_cookie *cookie, int retire) { if (fscache_cookie_valid(cookie)) __fscache_relinquish_cookie(cookie, retire); @@ -383,7 +341,7 @@ void fscache_relinquish_cookie(struct fscache_cookie *cookie, bool retire) static inline int fscache_check_consistency(struct fscache_cookie *cookie) { - if (fscache_cookie_valid(cookie) && fscache_cookie_enabled(cookie)) + if (fscache_cookie_valid(cookie)) return __fscache_check_consistency(cookie); else return 0; @@ -402,7 +360,7 @@ int fscache_check_consistency(struct fscache_cookie *cookie) static inline void fscache_update_cookie(struct fscache_cookie *cookie) { - if (fscache_cookie_valid(cookie) && fscache_cookie_enabled(cookie)) + if (fscache_cookie_valid(cookie)) __fscache_update_cookie(cookie); } @@ -449,7 +407,7 @@ void fscache_unpin_cookie(struct fscache_cookie *cookie) static inline int fscache_attr_changed(struct fscache_cookie *cookie) { - if (fscache_cookie_valid(cookie) && fscache_cookie_enabled(cookie)) + if (fscache_cookie_valid(cookie)) return __fscache_attr_changed(cookie); else return -ENOBUFS; @@ -471,7 +429,7 @@ int fscache_attr_changed(struct fscache_cookie *cookie) static inline void fscache_invalidate(struct fscache_cookie *cookie) { - if (fscache_cookie_valid(cookie) && fscache_cookie_enabled(cookie)) + if (fscache_cookie_valid(cookie)) __fscache_invalidate(cookie); } @@ -545,7 +503,7 @@ int fscache_read_or_alloc_page(struct fscache_cookie *cookie, void *context, gfp_t gfp) { - if (fscache_cookie_valid(cookie) && fscache_cookie_enabled(cookie)) + if (fscache_cookie_valid(cookie)) return __fscache_read_or_alloc_page(cookie, page, end_io_func, context, gfp); else @@ -596,7 +554,7 @@ int fscache_read_or_alloc_pages(struct fscache_cookie *cookie, void *context, gfp_t gfp) { - if (fscache_cookie_valid(cookie) && fscache_cookie_enabled(cookie)) + if (fscache_cookie_valid(cookie)) return __fscache_read_or_alloc_pages(cookie, mapping, pages, nr_pages, end_io_func, context, gfp); @@ -627,7 +585,7 @@ int fscache_alloc_page(struct fscache_cookie *cookie, struct page *page, gfp_t gfp) { - if (fscache_cookie_valid(cookie) && fscache_cookie_enabled(cookie)) + if (fscache_cookie_valid(cookie)) return __fscache_alloc_page(cookie, page, gfp); else return -ENOBUFS; @@ -676,7 +634,7 @@ int fscache_write_page(struct fscache_cookie *cookie, struct page *page, gfp_t gfp) { - if (fscache_cookie_valid(cookie) && fscache_cookie_enabled(cookie)) + if (fscache_cookie_valid(cookie)) return __fscache_write_page(cookie, page, gfp); else return -ENOBUFS; @@ -786,47 +744,4 @@ void fscache_uncache_all_inode_pages(struct fscache_cookie *cookie, __fscache_uncache_all_inode_pages(cookie, inode); } -/** - * fscache_disable_cookie - Disable a cookie - * @cookie: The cookie representing the cache object - * @invalidate: Invalidate the backing object - * - * Disable a cookie from accepting further alloc, read, write, invalidate, - * update or acquire operations. Outstanding operations can still be waited - * upon and pages can still be uncached and the cookie relinquished. - * - * This will not return until all outstanding operations have completed. - * - * If @invalidate is set, then the backing object will be invalidated and - * detached, otherwise it will just be detached. - */ -static inline -void fscache_disable_cookie(struct fscache_cookie *cookie, bool invalidate) -{ - if (fscache_cookie_valid(cookie) && fscache_cookie_enabled(cookie)) - __fscache_disable_cookie(cookie, invalidate); -} - -/** - * fscache_enable_cookie - Reenable a cookie - * @cookie: The cookie representing the cache object - * @can_enable: A function to permit enablement once lock is held - * @data: Data for can_enable() - * - * Reenable a previously disabled cookie, allowing it to accept further alloc, - * read, write, invalidate, update or acquire operations. An attempt will be - * made to immediately reattach the cookie to a backing object. - * - * The can_enable() function is called (if not NULL) once the enablement lock - * is held to rule on whether enablement is still permitted to go ahead. - */ -static inline -void fscache_enable_cookie(struct fscache_cookie *cookie, - bool (*can_enable)(void *data), - void *data) -{ - if (fscache_cookie_valid(cookie) && !fscache_cookie_enabled(cookie)) - __fscache_enable_cookie(cookie, can_enable, data); -} - #endif /* _LINUX_FSCACHE_H */ diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 31ea4b4..9f15c00 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h @@ -533,11 +533,11 @@ static inline int ftrace_force_update(void) { return 0; } static inline void ftrace_disable_daemon(void) { } static inline void ftrace_enable_daemon(void) { } static inline void ftrace_release_mod(struct module *mod) {} -static inline __init int register_ftrace_command(struct ftrace_func_command *cmd) +static inline int register_ftrace_command(struct ftrace_func_command *cmd) { return -EINVAL; } -static inline __init int unregister_ftrace_command(char *cmd_name) +static inline int unregister_ftrace_command(char *cmd_name) { return -EINVAL; } @@ -721,7 +721,6 @@ ftrace_push_return_trace(unsigned long ret, unsigned long func, int *depth, extern char __irqentry_text_start[]; extern char __irqentry_text_end[]; -#define FTRACE_NOTRACE_DEPTH 65536 #define FTRACE_RETFUNC_DEPTH 50 #define FTRACE_RETSTACK_ALLOC_SIZE 32 extern int register_ftrace_graph(trace_func_graph_ret_t retfunc, diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 8c9b7a1..5eaa746 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h @@ -202,7 +202,6 @@ enum { TRACE_EVENT_FL_NO_SET_FILTER_BIT, TRACE_EVENT_FL_IGNORE_ENABLE_BIT, TRACE_EVENT_FL_WAS_ENABLED_BIT, - TRACE_EVENT_FL_USE_CALL_FILTER_BIT, }; /* @@ -214,7 +213,6 @@ enum { * WAS_ENABLED - Set and stays set when an event was ever enabled * (used for module unloading, if a module event is enabled, * it is best to clear the buffers that used it). - * USE_CALL_FILTER - For ftrace internal events, don't use file filter */ enum { TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), @@ -222,7 +220,6 @@ enum { TRACE_EVENT_FL_NO_SET_FILTER = (1 << TRACE_EVENT_FL_NO_SET_FILTER_BIT), TRACE_EVENT_FL_IGNORE_ENABLE = (1 << TRACE_EVENT_FL_IGNORE_ENABLE_BIT), TRACE_EVENT_FL_WAS_ENABLED = (1 << TRACE_EVENT_FL_WAS_ENABLED_BIT), - TRACE_EVENT_FL_USE_CALL_FILTER = (1 << TRACE_EVENT_FL_USE_CALL_FILTER_BIT), }; struct ftrace_event_call { @@ -241,16 +238,12 @@ struct ftrace_event_call { * bit 2: failed to apply filter * bit 3: ftrace internal event (do not enable) * bit 4: Event was enabled by module - * bit 5: use call filter rather than file filter */ int flags; /* static flags of different events */ #ifdef CONFIG_PERF_EVENTS int perf_refcount; struct hlist_head __percpu *perf_events; - - int (*perf_perm)(struct ftrace_event_call *, - struct perf_event *); #endif }; @@ -260,8 +253,6 @@ struct ftrace_subsystem_dir; enum { FTRACE_EVENT_FL_ENABLED_BIT, FTRACE_EVENT_FL_RECORDED_CMD_BIT, - FTRACE_EVENT_FL_FILTERED_BIT, - FTRACE_EVENT_FL_NO_SET_FILTER_BIT, FTRACE_EVENT_FL_SOFT_MODE_BIT, FTRACE_EVENT_FL_SOFT_DISABLED_BIT, }; @@ -270,8 +261,6 @@ enum { * Ftrace event file flags: * ENABLED - The event is enabled * RECORDED_CMD - The comms should be recorded at sched_switch - * FILTERED - The event has a filter attached - * NO_SET_FILTER - Set when filter has error and is to be ignored * SOFT_MODE - The event is enabled/disabled by SOFT_DISABLED * SOFT_DISABLED - When set, do not trace the event (even though its * tracepoint may be enabled) @@ -279,8 +268,6 @@ enum { enum { FTRACE_EVENT_FL_ENABLED = (1 << FTRACE_EVENT_FL_ENABLED_BIT), FTRACE_EVENT_FL_RECORDED_CMD = (1 << FTRACE_EVENT_FL_RECORDED_CMD_BIT), - FTRACE_EVENT_FL_FILTERED = (1 << FTRACE_EVENT_FL_FILTERED_BIT), - FTRACE_EVENT_FL_NO_SET_FILTER = (1 << FTRACE_EVENT_FL_NO_SET_FILTER_BIT), FTRACE_EVENT_FL_SOFT_MODE = (1 << FTRACE_EVENT_FL_SOFT_MODE_BIT), FTRACE_EVENT_FL_SOFT_DISABLED = (1 << FTRACE_EVENT_FL_SOFT_DISABLED_BIT), }; @@ -288,7 +275,6 @@ enum { struct ftrace_event_file { struct list_head list; struct ftrace_event_call *event_call; - struct event_filter *filter; struct dentry *dir; struct trace_array *tr; struct ftrace_subsystem_dir *system; @@ -320,33 +306,16 @@ struct ftrace_event_file { } \ early_initcall(trace_init_flags_##name); -#define __TRACE_EVENT_PERF_PERM(name, expr...) \ - static int perf_perm_##name(struct ftrace_event_call *tp_event, \ - struct perf_event *p_event) \ - { \ - return ({ expr; }); \ - } \ - static int __init trace_init_perf_perm_##name(void) \ - { \ - event_##name.perf_perm = &perf_perm_##name; \ - return 0; \ - } \ - early_initcall(trace_init_perf_perm_##name); - #define PERF_MAX_TRACE_SIZE 2048 #define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ -extern void destroy_preds(struct ftrace_event_file *file); -extern void destroy_call_preds(struct ftrace_event_call *call); +extern void destroy_preds(struct ftrace_event_call *call); extern int filter_match_preds(struct event_filter *filter, void *rec); - -extern int filter_check_discard(struct ftrace_event_file *file, void *rec, - struct ring_buffer *buffer, - struct ring_buffer_event *event); -extern int call_filter_check_discard(struct ftrace_event_call *call, void *rec, - struct ring_buffer *buffer, - struct ring_buffer_event *event); +extern int filter_current_check_discard(struct ring_buffer *buffer, + struct ftrace_event_call *call, + void *rec, + struct ring_buffer_event *event); enum { FILTER_OTHER = 0, diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h index 1eda33d..f8d41cb 100644 --- a/include/linux/genalloc.h +++ b/include/linux/genalloc.h @@ -94,8 +94,6 @@ static inline int gen_pool_add(struct gen_pool *pool, unsigned long addr, } extern void gen_pool_destroy(struct gen_pool *); extern unsigned long gen_pool_alloc(struct gen_pool *, size_t); -extern void *gen_pool_dma_alloc(struct gen_pool *pool, size_t size, - dma_addr_t *dma); extern void gen_pool_free(struct gen_pool *, unsigned long, size_t); extern void gen_pool_for_each_chunk(struct gen_pool *, void (*)(struct gen_pool *, struct gen_pool_chunk *, void *), void *); diff --git a/include/linux/genl_magic_func.h b/include/linux/genl_magic_func.h index c0894dd..023bc34 100644 --- a/include/linux/genl_magic_func.h +++ b/include/linux/genl_magic_func.h @@ -273,40 +273,49 @@ static struct genl_family ZZZ_genl_family __read_mostly = { * Magic: define multicast groups * Magic: define multicast group registration helper */ -#define ZZZ_genl_mcgrps CONCAT_(GENL_MAGIC_FAMILY, _genl_mcgrps) -static const struct genl_multicast_group ZZZ_genl_mcgrps[] = { -#undef GENL_mc_group -#define GENL_mc_group(group) { .name = #group, }, -#include GENL_MAGIC_INCLUDE_FILE -}; - -enum CONCAT_(GENL_MAGIC_FAMILY, group_ids) { -#undef GENL_mc_group -#define GENL_mc_group(group) CONCAT_(GENL_MAGIC_FAMILY, _group_ ## group), -#include GENL_MAGIC_INCLUDE_FILE -}; - #undef GENL_mc_group #define GENL_mc_group(group) \ +static struct genl_multicast_group \ +CONCAT_(GENL_MAGIC_FAMILY, _mcg_ ## group) __read_mostly = { \ + .name = #group, \ +}; \ static int CONCAT_(GENL_MAGIC_FAMILY, _genl_multicast_ ## group)( \ struct sk_buff *skb, gfp_t flags) \ { \ unsigned int group_id = \ - CONCAT_(GENL_MAGIC_FAMILY, _group_ ## group); \ - return genlmsg_multicast(&ZZZ_genl_family, skb, 0, \ - group_id, flags); \ + CONCAT_(GENL_MAGIC_FAMILY, _mcg_ ## group).id; \ + if (!group_id) \ + return -EINVAL; \ + return genlmsg_multicast(skb, 0, group_id, flags); \ } #include GENL_MAGIC_INCLUDE_FILE -#undef GENL_mc_group -#define GENL_mc_group(group) - int CONCAT_(GENL_MAGIC_FAMILY, _genl_register)(void) { - return genl_register_family_with_ops_groups(&ZZZ_genl_family, \ - ZZZ_genl_ops, \ - ZZZ_genl_mcgrps); + int err = genl_register_family_with_ops(&ZZZ_genl_family, + ZZZ_genl_ops, ARRAY_SIZE(ZZZ_genl_ops)); + if (err) + return err; +#undef GENL_mc_group +#define GENL_mc_group(group) \ + err = genl_register_mc_group(&ZZZ_genl_family, \ + &CONCAT_(GENL_MAGIC_FAMILY, _mcg_ ## group)); \ + if (err) \ + goto fail; \ + else \ + pr_info("%s: mcg %s: %u\n", #group, \ + __stringify(GENL_MAGIC_FAMILY), \ + CONCAT_(GENL_MAGIC_FAMILY, _mcg_ ## group).id); + +#include GENL_MAGIC_INCLUDE_FILE + +#undef GENL_mc_group +#define GENL_mc_group(group) + return 0; +fail: + genl_unregister_family(&ZZZ_genl_family); + return err; } void CONCAT_(GENL_MAGIC_FAMILY, _genl_unregister)(void) diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 13dfd24..552e3f4 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h @@ -16,17 +16,14 @@ #define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW) #define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH) -/* Gpio pin is active-low */ -#define GPIOF_ACTIVE_LOW (1 << 2) - /* Gpio pin is open drain */ -#define GPIOF_OPEN_DRAIN (1 << 3) +#define GPIOF_OPEN_DRAIN (1 << 2) /* Gpio pin is open source */ -#define GPIOF_OPEN_SOURCE (1 << 4) +#define GPIOF_OPEN_SOURCE (1 << 3) -#define GPIOF_EXPORT (1 << 5) -#define GPIOF_EXPORT_CHANGEABLE (1 << 6) +#define GPIOF_EXPORT (1 << 4) +#define GPIOF_EXPORT_CHANGEABLE (1 << 5) #define GPIOF_EXPORT_DIR_FIXED (GPIOF_EXPORT) #define GPIOF_EXPORT_DIR_CHANGEABLE (GPIOF_EXPORT | GPIOF_EXPORT_CHANGEABLE) @@ -77,22 +74,12 @@ static inline int irq_to_gpio(unsigned int irq) #endif /* ! CONFIG_ARCH_HAVE_CUSTOM_GPIO_H */ -/* CONFIG_GPIOLIB: bindings for managed devices that want to request gpios */ - -struct device; - -int devm_gpio_request(struct device *dev, unsigned gpio, const char *label); -int devm_gpio_request_one(struct device *dev, unsigned gpio, - unsigned long flags, const char *label); -void devm_gpio_free(struct device *dev, unsigned int gpio); - #else /* ! CONFIG_GPIOLIB */ #include <linux/kernel.h> #include <linux/types.h> #include <linux/errno.h> #include <linux/bug.h> -#include <linux/pinctrl/pinctrl.h> struct device; struct gpio_chip; @@ -217,18 +204,6 @@ static inline int gpio_to_irq(unsigned gpio) return -EINVAL; } -static inline int gpio_lock_as_irq(struct gpio_chip *chip, unsigned int offset) -{ - WARN_ON(1); - return -EINVAL; -} - -static inline void gpio_unlock_as_irq(struct gpio_chip *chip, - unsigned int offset) -{ - WARN_ON(1); -} - static inline int irq_to_gpio(unsigned irq) { /* irq can never have been returned from gpio_to_irq() */ @@ -245,40 +220,20 @@ gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, return -EINVAL; } -static inline int -gpiochip_add_pingroup_range(struct gpio_chip *chip, - struct pinctrl_dev *pctldev, - unsigned int gpio_offset, const char *pin_group) -{ - WARN_ON(1); - return -EINVAL; -} - static inline void gpiochip_remove_pin_ranges(struct gpio_chip *chip) { WARN_ON(1); } -static inline int devm_gpio_request(struct device *dev, unsigned gpio, - const char *label) -{ - WARN_ON(1); - return -EINVAL; -} - -static inline int devm_gpio_request_one(struct device *dev, unsigned gpio, - unsigned long flags, const char *label) -{ - WARN_ON(1); - return -EINVAL; -} +#endif /* ! CONFIG_GPIOLIB */ -static inline void devm_gpio_free(struct device *dev, unsigned int gpio) -{ - WARN_ON(1); -} +struct device; -#endif /* ! CONFIG_GPIOLIB */ +/* bindings for managed devices that want to request gpios */ +int devm_gpio_request(struct device *dev, unsigned gpio, const char *label); +int devm_gpio_request_one(struct device *dev, unsigned gpio, + unsigned long flags, const char *label); +void devm_gpio_free(struct device *dev, unsigned int gpio); #endif /* __LINUX_GPIO_H */ diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h deleted file mode 100644 index 4d34dbb..0000000 --- a/include/linux/gpio/consumer.h +++ /dev/null @@ -1,253 +0,0 @@ -#ifndef __LINUX_GPIO_CONSUMER_H -#define __LINUX_GPIO_CONSUMER_H - -#include <linux/err.h> -#include <linux/kernel.h> - -#ifdef CONFIG_GPIOLIB - -struct device; -struct gpio_chip; - -/** - * Opaque descriptor for a GPIO. These are obtained using gpiod_get() and are - * preferable to the old integer-based handles. - * - * Contrary to integers, a pointer to a gpio_desc is guaranteed to be valid - * until the GPIO is released. - */ -struct gpio_desc; - -/* Acquire and dispose GPIOs */ -struct gpio_desc *__must_check gpiod_get(struct device *dev, - const char *con_id); -struct gpio_desc *__must_check gpiod_get_index(struct device *dev, - const char *con_id, - unsigned int idx); -void gpiod_put(struct gpio_desc *desc); - -struct gpio_desc *__must_check devm_gpiod_get(struct device *dev, - const char *con_id); -struct gpio_desc *__must_check devm_gpiod_get_index(struct device *dev, - const char *con_id, - unsigned int idx); -void devm_gpiod_put(struct device *dev, struct gpio_desc *desc); - -int gpiod_get_direction(const struct gpio_desc *desc); -int gpiod_direction_input(struct gpio_desc *desc); -int gpiod_direction_output(struct gpio_desc *desc, int value); - -/* Value get/set from non-sleeping context */ -int gpiod_get_value(const struct gpio_desc *desc); -void gpiod_set_value(struct gpio_desc *desc, int value); -int gpiod_get_raw_value(const struct gpio_desc *desc); -void gpiod_set_raw_value(struct gpio_desc *desc, int value); - -/* Value get/set from sleeping context */ -int gpiod_get_value_cansleep(const struct gpio_desc *desc); -void gpiod_set_value_cansleep(struct gpio_desc *desc, int value); -int gpiod_get_raw_value_cansleep(const struct gpio_desc *desc); -void gpiod_set_raw_value_cansleep(struct gpio_desc *desc, int value); - -int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce); - -int gpiod_is_active_low(const struct gpio_desc *desc); -int gpiod_cansleep(const struct gpio_desc *desc); - -int gpiod_to_irq(const struct gpio_desc *desc); - -/* Convert between the old gpio_ and new gpiod_ interfaces */ -struct gpio_desc *gpio_to_desc(unsigned gpio); -int desc_to_gpio(const struct gpio_desc *desc); -struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc); - -#else /* CONFIG_GPIOLIB */ - -static inline struct gpio_desc *__must_check gpiod_get(struct device *dev, - const char *con_id) -{ - return ERR_PTR(-ENOSYS); -} -static inline struct gpio_desc *__must_check gpiod_get_index(struct device *dev, - const char *con_id, - unsigned int idx) -{ - return ERR_PTR(-ENOSYS); -} -static inline void gpiod_put(struct gpio_desc *desc) -{ - might_sleep(); - - /* GPIO can never have been requested */ - WARN_ON(1); -} - -static inline struct gpio_desc *__must_check devm_gpiod_get(struct device *dev, - const char *con_id) -{ - return ERR_PTR(-ENOSYS); -} -static inline -struct gpio_desc *__must_check devm_gpiod_get_index(struct device *dev, - const char *con_id, - unsigned int idx) -{ - return ERR_PTR(-ENOSYS); -} -static inline void devm_gpiod_put(struct device *dev, struct gpio_desc *desc) -{ - might_sleep(); - - /* GPIO can never have been requested */ - WARN_ON(1); -} - - -static inline int gpiod_get_direction(const struct gpio_desc *desc) -{ - /* GPIO can never have been requested */ - WARN_ON(1); - return -ENOSYS; -} -static inline int gpiod_direction_input(struct gpio_desc *desc) -{ - /* GPIO can never have been requested */ - WARN_ON(1); - return -ENOSYS; -} -static inline int gpiod_direction_output(struct gpio_desc *desc, int value) -{ - /* GPIO can never have been requested */ - WARN_ON(1); - return -ENOSYS; -} - - -static inline int gpiod_get_value(const struct gpio_desc *desc) -{ - /* GPIO can never have been requested */ - WARN_ON(1); - return 0; -} -static inline void gpiod_set_value(struct gpio_desc *desc, int value) -{ - /* GPIO can never have been requested */ - WARN_ON(1); -} -static inline int gpiod_get_raw_value(const struct gpio_desc *desc) -{ - /* GPIO can never have been requested */ - WARN_ON(1); - return 0; -} -static inline void gpiod_set_raw_value(struct gpio_desc *desc, int value) -{ - /* GPIO can never have been requested */ - WARN_ON(1); -} - -static inline int gpiod_get_value_cansleep(const struct gpio_desc *desc) -{ - /* GPIO can never have been requested */ - WARN_ON(1); - return 0; -} -static inline void gpiod_set_value_cansleep(struct gpio_desc *desc, int value) -{ - /* GPIO can never have been requested */ - WARN_ON(1); -} -static inline int gpiod_get_raw_value_cansleep(const struct gpio_desc *desc) -{ - /* GPIO can never have been requested */ - WARN_ON(1); - return 0; -} -static inline void gpiod_set_raw_value_cansleep(struct gpio_desc *desc, - int value) -{ - /* GPIO can never have been requested */ - WARN_ON(1); -} - -static inline int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce) -{ - /* GPIO can never have been requested */ - WARN_ON(1); - return -ENOSYS; -} - -static inline int gpiod_is_active_low(const struct gpio_desc *desc) -{ - /* GPIO can never have been requested */ - WARN_ON(1); - return 0; -} -static inline int gpiod_cansleep(const struct gpio_desc *desc) -{ - /* GPIO can never have been requested */ - WARN_ON(1); - return 0; -} - -static inline int gpiod_to_irq(const struct gpio_desc *desc) -{ - /* GPIO can never have been requested */ - WARN_ON(1); - return -EINVAL; -} - -static inline struct gpio_desc *gpio_to_desc(unsigned gpio) -{ - return ERR_PTR(-EINVAL); -} -static inline int desc_to_gpio(const struct gpio_desc *desc) -{ - /* GPIO can never have been requested */ - WARN_ON(1); - return -EINVAL; -} -static inline struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc) -{ - /* GPIO can never have been requested */ - WARN_ON(1); - return ERR_PTR(-ENODEV); -} - - -#endif /* CONFIG_GPIOLIB */ - -#if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_GPIO_SYSFS) - -int gpiod_export(struct gpio_desc *desc, bool direction_may_change); -int gpiod_export_link(struct device *dev, const char *name, - struct gpio_desc *desc); -int gpiod_sysfs_set_active_low(struct gpio_desc *desc, int value); -void gpiod_unexport(struct gpio_desc *desc); - -#else /* CONFIG_GPIOLIB && CONFIG_GPIO_SYSFS */ - -static inline int gpiod_export(struct gpio_desc *desc, - bool direction_may_change) -{ - return -ENOSYS; -} - -static inline int gpiod_export_link(struct device *dev, const char *name, - struct gpio_desc *desc) -{ - return -ENOSYS; -} - -static inline int gpiod_sysfs_set_active_low(struct gpio_desc *desc, int value) -{ - return -ENOSYS; -} - -static inline void gpiod_unexport(struct gpio_desc *desc) -{ -} - -#endif /* CONFIG_GPIOLIB && CONFIG_GPIO_SYSFS */ - -#endif diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h deleted file mode 100644 index 3ea2cf6..0000000 --- a/include/linux/gpio/driver.h +++ /dev/null @@ -1,194 +0,0 @@ -#ifndef __LINUX_GPIO_DRIVER_H -#define __LINUX_GPIO_DRIVER_H - -#include <linux/types.h> -#include <linux/module.h> - -struct device; -struct gpio_desc; -struct of_phandle_args; -struct device_node; -struct seq_file; - -/** - * struct gpio_chip - abstract a GPIO controller - * @label: for diagnostics - * @dev: optional device providing the GPIOs - * @owner: helps prevent removal of modules exporting active GPIOs - * @list: links gpio_chips together for traversal - * @request: optional hook for chip-specific activation, such as - * enabling module power and clock; may sleep - * @free: optional hook for chip-specific deactivation, such as - * disabling module power and clock; may sleep - * @get_direction: returns direction for signal "offset", 0=out, 1=in, - * (same as GPIOF_DIR_XXX), or negative error - * @direction_input: configures signal "offset" as input, or returns error - * @direction_output: configures signal "offset" as output, or returns error - * @get: returns value for signal "offset"; for output signals this - * returns either the value actually sensed, or zero - * @set: assigns output value for signal "offset" - * @set_debounce: optional hook for setting debounce time for specified gpio in - * interrupt triggered gpio chips - * @to_irq: optional hook supporting non-static gpio_to_irq() mappings; - * implementation may not sleep - * @dbg_show: optional routine to show contents in debugfs; default code - * will be used when this is omitted, but custom code can show extra - * state (such as pullup/pulldown configuration). - * @base: identifies the first GPIO number handled by this chip; or, if - * negative during registration, requests dynamic ID allocation. - * @ngpio: the number of GPIOs handled by this controller; the last GPIO - * handled is (base + ngpio - 1). - * @desc: array of ngpio descriptors. Private. - * @can_sleep: flag must be set iff get()/set() methods sleep, as they - * must while accessing GPIO expander chips over I2C or SPI - * @names: if set, must be an array of strings to use as alternative - * names for the GPIOs in this chip. Any entry in the array - * may be NULL if there is no alias for the GPIO, however the - * array must be @ngpio entries long. A name can include a single printk - * format specifier for an unsigned int. It is substituted by the actual - * number of the gpio. - * - * A gpio_chip can help platforms abstract various sources of GPIOs so - * they can all be accessed through a common programing interface. - * Example sources would be SOC controllers, FPGAs, multifunction - * chips, dedicated GPIO expanders, and so on. - * - * Each chip controls a number of signals, identified in method calls - * by "offset" values in the range 0..(@ngpio - 1). When those signals - * are referenced through calls like gpio_get_value(gpio), the offset - * is calculated by subtracting @base from the gpio number. - */ -struct gpio_chip { - const char *label; - struct device *dev; - struct module *owner; - struct list_head list; - - int (*request)(struct gpio_chip *chip, - unsigned offset); - void (*free)(struct gpio_chip *chip, - unsigned offset); - int (*get_direction)(struct gpio_chip *chip, - unsigned offset); - int (*direction_input)(struct gpio_chip *chip, - unsigned offset); - int (*direction_output)(struct gpio_chip *chip, - unsigned offset, int value); - int (*get)(struct gpio_chip *chip, - unsigned offset); - void (*set)(struct gpio_chip *chip, - unsigned offset, int value); - int (*set_debounce)(struct gpio_chip *chip, - unsigned offset, - unsigned debounce); - - int (*to_irq)(struct gpio_chip *chip, - unsigned offset); - - void (*dbg_show)(struct seq_file *s, - struct gpio_chip *chip); - int base; - u16 ngpio; - struct gpio_desc *desc; - const char *const *names; - unsigned can_sleep:1; - unsigned exported:1; - -#if defined(CONFIG_OF_GPIO) - /* - * If CONFIG_OF is enabled, then all GPIO controllers described in the - * device tree automatically may have an OF translation - */ - struct device_node *of_node; - int of_gpio_n_cells; - int (*of_xlate)(struct gpio_chip *gc, - const struct of_phandle_args *gpiospec, u32 *flags); -#endif -#ifdef CONFIG_PINCTRL - /* - * If CONFIG_PINCTRL is enabled, then gpio controllers can optionally - * describe the actual pin range which they serve in an SoC. This - * information would be used by pinctrl subsystem to configure - * corresponding pins for gpio usage. - */ - struct list_head pin_ranges; -#endif -}; - -extern const char *gpiochip_is_requested(struct gpio_chip *chip, - unsigned offset); - -/* add/remove chips */ -extern int gpiochip_add(struct gpio_chip *chip); -extern int __must_check gpiochip_remove(struct gpio_chip *chip); -extern struct gpio_chip *gpiochip_find(void *data, - int (*match)(struct gpio_chip *chip, void *data)); - -/* lock/unlock as IRQ */ -int gpiod_lock_as_irq(struct gpio_desc *desc); -void gpiod_unlock_as_irq(struct gpio_desc *desc); - -enum gpio_lookup_flags { - GPIO_ACTIVE_HIGH = (0 << 0), - GPIO_ACTIVE_LOW = (1 << 0), - GPIO_OPEN_DRAIN = (1 << 1), - GPIO_OPEN_SOURCE = (1 << 2), -}; - -/** - * Lookup table for associating GPIOs to specific devices and functions using - * platform data. - */ -struct gpiod_lookup { - struct list_head list; - /* - * name of the chip the GPIO belongs to - */ - const char *chip_label; - /* - * hardware number (i.e. relative to the chip) of the GPIO - */ - u16 chip_hwnum; - /* - * name of device that can claim this GPIO - */ - const char *dev_id; - /* - * name of the GPIO from the device's point of view - */ - const char *con_id; - /* - * index of the GPIO in case several GPIOs share the same name - */ - unsigned int idx; - /* - * mask of GPIO_* values - */ - enum gpio_lookup_flags flags; -}; - -/* - * Simple definition of a single GPIO under a con_id - */ -#define GPIO_LOOKUP(_chip_label, _chip_hwnum, _dev_id, _con_id, _flags) \ - GPIO_LOOKUP_IDX(_chip_label, _chip_hwnum, _dev_id, _con_id, 0, _flags) - -/* - * Use this macro if you need to have several GPIOs under the same con_id. - * Each GPIO needs to use a different index and can be accessed using - * gpiod_get_index() - */ -#define GPIO_LOOKUP_IDX(_chip_label, _chip_hwnum, _dev_id, _con_id, _idx, \ - _flags) \ -{ \ - .chip_label = _chip_label, \ - .chip_hwnum = _chip_hwnum, \ - .dev_id = _dev_id, \ - .con_id = _con_id, \ - .idx = _idx, \ - .flags = _flags, \ -} - -void gpiod_add_table(struct gpiod_lookup *table, size_t size); - -#endif diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index d9cf963..1e04106 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h @@ -33,7 +33,7 @@ extern void rcu_nmi_exit(void); #define __irq_enter() \ do { \ account_irq_enter_time(current); \ - preempt_count_add(HARDIRQ_OFFSET); \ + add_preempt_count(HARDIRQ_OFFSET); \ trace_hardirq_enter(); \ } while (0) @@ -49,7 +49,7 @@ extern void irq_enter(void); do { \ trace_hardirq_exit(); \ account_irq_exit_time(current); \ - preempt_count_sub(HARDIRQ_OFFSET); \ + sub_preempt_count(HARDIRQ_OFFSET); \ } while (0) /* @@ -62,7 +62,7 @@ extern void irq_exit(void); lockdep_off(); \ ftrace_nmi_enter(); \ BUG_ON(in_nmi()); \ - preempt_count_add(NMI_OFFSET + HARDIRQ_OFFSET); \ + add_preempt_count(NMI_OFFSET + HARDIRQ_OFFSET); \ rcu_nmi_enter(); \ trace_hardirq_enter(); \ } while (0) @@ -72,7 +72,7 @@ extern void irq_exit(void); trace_hardirq_exit(); \ rcu_nmi_exit(); \ BUG_ON(!in_nmi()); \ - preempt_count_sub(NMI_OFFSET + HARDIRQ_OFFSET); \ + sub_preempt_count(NMI_OFFSET + HARDIRQ_OFFSET); \ ftrace_nmi_exit(); \ lockdep_on(); \ } while (0) diff --git a/include/linux/hashtable.h b/include/linux/hashtable.h index 519b6e2..a9df51f 100644 --- a/include/linux/hashtable.h +++ b/include/linux/hashtable.h @@ -174,21 +174,6 @@ static inline void hash_del_rcu(struct hlist_node *node) member) /** - * hash_for_each_possible_rcu_notrace - iterate over all possible objects hashing - * to the same bucket in an rcu enabled hashtable in a rcu enabled hashtable - * @name: hashtable to iterate - * @obj: the type * to use as a loop cursor for each entry - * @member: the name of the hlist_node within the struct - * @key: the key of the objects to iterate over - * - * This is the same as hash_for_each_possible_rcu() except that it does - * not do any RCU debugging or tracing. - */ -#define hash_for_each_possible_rcu_notrace(name, obj, member, key) \ - hlist_for_each_entry_rcu_notrace(obj, \ - &name[hash_min(key, HASH_BITS(name))], member) - -/** * hash_for_each_possible_safe - iterate over all possible objects hashing to the * same bucket safe against removals * @name: hashtable to iterate diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h index b914ca3..32ba451 100644 --- a/include/linux/hid-sensor-hub.h +++ b/include/linux/hid-sensor-hub.h @@ -21,8 +21,6 @@ #include <linux/hid.h> #include <linux/hid-sensor-ids.h> -#include <linux/iio/iio.h> -#include <linux/iio/trigger.h> /** * struct hid_sensor_hub_attribute_info - Attribute info @@ -42,8 +40,6 @@ struct hid_sensor_hub_attribute_info { s32 units; s32 unit_expo; s32 size; - s32 logical_minimum; - s32 logical_maximum; }; /** @@ -51,13 +47,11 @@ struct hid_sensor_hub_attribute_info { * @hdev: Stores the hid instance. * @vendor_id: Vendor id of hub device. * @product_id: Product id of hub device. - * @ref_cnt: Number of MFD clients have opened this device */ struct hid_sensor_hub_device { struct hid_device *hdev; u32 vendor_id; u32 product_id; - int ref_cnt; }; /** @@ -80,22 +74,6 @@ struct hid_sensor_hub_callbacks { void *priv); }; -/** -* sensor_hub_device_open() - Open hub device -* @hsdev: Hub device instance. -* -* Used to open hid device for sensor hub. -*/ -int sensor_hub_device_open(struct hid_sensor_hub_device *hsdev); - -/** -* sensor_hub_device_clode() - Close hub device -* @hsdev: Hub device instance. -* -* Used to clode hid device for sensor hub. -*/ -void sensor_hub_device_close(struct hid_sensor_hub_device *hsdev); - /* Registration functions */ /** @@ -188,7 +166,6 @@ struct hid_sensor_common { struct platform_device *pdev; unsigned usage_id; bool data_ready; - struct iio_trigger *trigger; struct hid_sensor_hub_attribute_info poll; struct hid_sensor_hub_attribute_info report_state; struct hid_sensor_hub_attribute_info power_state; diff --git a/include/linux/hid-sensor-ids.h b/include/linux/hid-sensor-ids.h index 8323775..4f945d3 100644 --- a/include/linux/hid-sensor-ids.h +++ b/include/linux/hid-sensor-ids.h @@ -117,16 +117,4 @@ #define HID_USAGE_SENSOR_PROP_REPORT_STATE 0x200316 #define HID_USAGE_SENSOR_PROY_POWER_STATE 0x200319 -/* Power state enumerations */ -#define HID_USAGE_SENSOR_PROP_POWER_STATE_UNDEFINED_ENUM 0x00 -#define HID_USAGE_SENSOR_PROP_POWER_STATE_D0_FULL_POWER_ENUM 0x01 -#define HID_USAGE_SENSOR_PROP_POWER_STATE_D1_LOW_POWER_ENUM 0x02 -#define HID_USAGE_SENSOR_PROP_POWER_STATE_D2_STANDBY_WITH_WAKE_ENUM 0x03 -#define HID_USAGE_SENSOR_PROP_POWER_STATE_D3_SLEEP_WITH_WAKE_ENUM 0x04 -#define HID_USAGE_SENSOR_PROP_POWER_STATE_D4_POWER_OFF_ENUM 0x05 - -/* Report State enumerations */ -#define HID_USAGE_SENSOR_PROP_REPORTING_STATE_NO_EVENTS_ENUM 0x00 -#define HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM 0x01 - #endif diff --git a/include/linux/hippidevice.h b/include/linux/hippidevice.h index 8ec23fb..f148e49 100644 --- a/include/linux/hippidevice.h +++ b/include/linux/hippidevice.h @@ -31,11 +31,11 @@ struct hippi_cb { __u32 ifield; }; -__be16 hippi_type_trans(struct sk_buff *skb, struct net_device *dev); -int hippi_change_mtu(struct net_device *dev, int new_mtu); -int hippi_mac_addr(struct net_device *dev, void *p); -int hippi_neigh_setup_dev(struct net_device *dev, struct neigh_parms *p); -struct net_device *alloc_hippi_dev(int sizeof_priv); +extern __be16 hippi_type_trans(struct sk_buff *skb, struct net_device *dev); +extern int hippi_change_mtu(struct net_device *dev, int new_mtu); +extern int hippi_mac_addr(struct net_device *dev, void *p); +extern int hippi_neigh_setup_dev(struct net_device *dev, struct neigh_parms *p); +extern struct net_device *alloc_hippi_dev(int sizeof_priv); #endif #endif /* _LINUX_HIPPIDEVICE_H */ diff --git a/include/linux/host1x.h b/include/linux/host1x.h deleted file mode 100644 index f5b9b87..0000000 --- a/include/linux/host1x.h +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Copyright (c) 2009-2013, NVIDIA Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef __LINUX_HOST1X_H -#define __LINUX_HOST1X_H - -#include <linux/device.h> -#include <linux/types.h> - -enum host1x_class { - HOST1X_CLASS_HOST1X = 0x1, - HOST1X_CLASS_GR2D = 0x51, - HOST1X_CLASS_GR2D_SB = 0x52, - HOST1X_CLASS_GR3D = 0x60, -}; - -struct host1x_client; - -struct host1x_client_ops { - int (*init)(struct host1x_client *client); - int (*exit)(struct host1x_client *client); -}; - -struct host1x_client { - struct list_head list; - struct device *parent; - struct device *dev; - - const struct host1x_client_ops *ops; - - enum host1x_class class; - struct host1x_channel *channel; - - struct host1x_syncpt **syncpts; - unsigned int num_syncpts; -}; - -/* - * host1x buffer objects - */ - -struct host1x_bo; -struct sg_table; - -struct host1x_bo_ops { - struct host1x_bo *(*get)(struct host1x_bo *bo); - void (*put)(struct host1x_bo *bo); - dma_addr_t (*pin)(struct host1x_bo *bo, struct sg_table **sgt); - void (*unpin)(struct host1x_bo *bo, struct sg_table *sgt); - void *(*mmap)(struct host1x_bo *bo); - void (*munmap)(struct host1x_bo *bo, void *addr); - void *(*kmap)(struct host1x_bo *bo, unsigned int pagenum); - void (*kunmap)(struct host1x_bo *bo, unsigned int pagenum, void *addr); -}; - -struct host1x_bo { - const struct host1x_bo_ops *ops; -}; - -static inline void host1x_bo_init(struct host1x_bo *bo, - const struct host1x_bo_ops *ops) -{ - bo->ops = ops; -} - -static inline struct host1x_bo *host1x_bo_get(struct host1x_bo *bo) -{ - return bo->ops->get(bo); -} - -static inline void host1x_bo_put(struct host1x_bo *bo) -{ - bo->ops->put(bo); -} - -static inline dma_addr_t host1x_bo_pin(struct host1x_bo *bo, - struct sg_table **sgt) -{ - return bo->ops->pin(bo, sgt); -} - -static inline void host1x_bo_unpin(struct host1x_bo *bo, struct sg_table *sgt) -{ - bo->ops->unpin(bo, sgt); -} - -static inline void *host1x_bo_mmap(struct host1x_bo *bo) -{ - return bo->ops->mmap(bo); -} - -static inline void host1x_bo_munmap(struct host1x_bo *bo, void *addr) -{ - bo->ops->munmap(bo, addr); -} - -static inline void *host1x_bo_kmap(struct host1x_bo *bo, unsigned int pagenum) -{ - return bo->ops->kmap(bo, pagenum); -} - -static inline void host1x_bo_kunmap(struct host1x_bo *bo, - unsigned int pagenum, void *addr) -{ - bo->ops->kunmap(bo, pagenum, addr); -} - -/* - * host1x syncpoints - */ - -#define HOST1X_SYNCPT_CLIENT_MANAGED (1 << 0) -#define HOST1X_SYNCPT_HAS_BASE (1 << 1) - -struct host1x_syncpt_base; -struct host1x_syncpt; -struct host1x; - -struct host1x_syncpt *host1x_syncpt_get(struct host1x *host, u32 id); -u32 host1x_syncpt_id(struct host1x_syncpt *sp); -u32 host1x_syncpt_read_min(struct host1x_syncpt *sp); -u32 host1x_syncpt_read_max(struct host1x_syncpt *sp); -int host1x_syncpt_incr(struct host1x_syncpt *sp); -int host1x_syncpt_wait(struct host1x_syncpt *sp, u32 thresh, long timeout, - u32 *value); -struct host1x_syncpt *host1x_syncpt_request(struct device *dev, - unsigned long flags); -void host1x_syncpt_free(struct host1x_syncpt *sp); - -struct host1x_syncpt_base *host1x_syncpt_get_base(struct host1x_syncpt *sp); -u32 host1x_syncpt_base_id(struct host1x_syncpt_base *base); - -/* - * host1x channel - */ - -struct host1x_channel; -struct host1x_job; - -struct host1x_channel *host1x_channel_request(struct device *dev); -void host1x_channel_free(struct host1x_channel *channel); -struct host1x_channel *host1x_channel_get(struct host1x_channel *channel); -void host1x_channel_put(struct host1x_channel *channel); -int host1x_job_submit(struct host1x_job *job); - -/* - * host1x job - */ - -struct host1x_reloc { - struct host1x_bo *cmdbuf; - u32 cmdbuf_offset; - struct host1x_bo *target; - u32 target_offset; - u32 shift; - u32 pad; -}; - -struct host1x_job { - /* When refcount goes to zero, job can be freed */ - struct kref ref; - - /* List entry */ - struct list_head list; - - /* Channel where job is submitted to */ - struct host1x_channel *channel; - - u32 client; - - /* Gathers and their memory */ - struct host1x_job_gather *gathers; - unsigned int num_gathers; - - /* Wait checks to be processed at submit time */ - struct host1x_waitchk *waitchk; - unsigned int num_waitchk; - u32 waitchk_mask; - - /* Array of handles to be pinned & unpinned */ - struct host1x_reloc *relocarray; - unsigned int num_relocs; - struct host1x_job_unpin_data *unpins; - unsigned int num_unpins; - - dma_addr_t *addr_phys; - dma_addr_t *gather_addr_phys; - dma_addr_t *reloc_addr_phys; - - /* Sync point id, number of increments and end related to the submit */ - u32 syncpt_id; - u32 syncpt_incrs; - u32 syncpt_end; - - /* Maximum time to wait for this job */ - unsigned int timeout; - - /* Index and number of slots used in the push buffer */ - unsigned int first_get; - unsigned int num_slots; - - /* Copy of gathers */ - size_t gather_copy_size; - dma_addr_t gather_copy; - u8 *gather_copy_mapped; - - /* Check if register is marked as an address reg */ - int (*is_addr_reg)(struct device *dev, u32 reg, u32 class); - - /* Request a SETCLASS to this class */ - u32 class; - - /* Add a channel wait for previous ops to complete */ - bool serialize; -}; - -struct host1x_job *host1x_job_alloc(struct host1x_channel *ch, - u32 num_cmdbufs, u32 num_relocs, - u32 num_waitchks); -void host1x_job_add_gather(struct host1x_job *job, struct host1x_bo *mem_id, - u32 words, u32 offset); -struct host1x_job *host1x_job_get(struct host1x_job *job); -void host1x_job_put(struct host1x_job *job); -int host1x_job_pin(struct host1x_job *job, struct device *dev); -void host1x_job_unpin(struct host1x_job *job); - -/* - * subdevice probe infrastructure - */ - -struct host1x_device; - -struct host1x_driver { - const struct of_device_id *subdevs; - struct list_head list; - const char *name; - - int (*probe)(struct host1x_device *device); - int (*remove)(struct host1x_device *device); -}; - -int host1x_driver_register(struct host1x_driver *driver); -void host1x_driver_unregister(struct host1x_driver *driver); - -struct host1x_device { - struct host1x_driver *driver; - struct list_head list; - struct device dev; - - struct mutex subdevs_lock; - struct list_head subdevs; - struct list_head active; - - struct mutex clients_lock; - struct list_head clients; -}; - -static inline struct host1x_device *to_host1x_device(struct device *dev) -{ - return container_of(dev, struct host1x_device, dev); -} - -int host1x_device_init(struct host1x_device *device); -int host1x_device_exit(struct host1x_device *device); - -int host1x_client_register(struct host1x_client *client); -int host1x_client_unregister(struct host1x_client *client); - -#endif diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index 91672e2..3935428 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -54,8 +54,7 @@ enum page_check_address_pmd_flag { extern pmd_t *page_check_address_pmd(struct page *page, struct mm_struct *mm, unsigned long address, - enum page_check_address_pmd_flag flag, - spinlock_t **ptl); + enum page_check_address_pmd_flag flag); #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT) #define HPAGE_PMD_NR (1<<HPAGE_PMD_ORDER) @@ -130,15 +129,15 @@ extern void __vma_adjust_trans_huge(struct vm_area_struct *vma, unsigned long start, unsigned long end, long adjust_next); -extern int __pmd_trans_huge_lock(pmd_t *pmd, struct vm_area_struct *vma, - spinlock_t **ptl); +extern int __pmd_trans_huge_lock(pmd_t *pmd, + struct vm_area_struct *vma); /* mmap_sem must be held on entry */ -static inline int pmd_trans_huge_lock(pmd_t *pmd, struct vm_area_struct *vma, - spinlock_t **ptl) +static inline int pmd_trans_huge_lock(pmd_t *pmd, + struct vm_area_struct *vma) { VM_BUG_ON(!rwsem_is_locked(&vma->vm_mm->mmap_sem)); if (pmd_trans_huge(*pmd)) - return __pmd_trans_huge_lock(pmd, vma, ptl); + return __pmd_trans_huge_lock(pmd, vma); else return 0; } @@ -216,8 +215,8 @@ static inline void vma_adjust_trans_huge(struct vm_area_struct *vma, long adjust_next) { } -static inline int pmd_trans_huge_lock(pmd_t *pmd, struct vm_area_struct *vma, - spinlock_t **ptl) +static inline int pmd_trans_huge_lock(pmd_t *pmd, + struct vm_area_struct *vma) { return 0; } diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 9649ff0..0393270 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -31,7 +31,6 @@ struct hugepage_subpool *hugepage_new_subpool(long nr_blocks); void hugepage_put_subpool(struct hugepage_subpool *spool); int PageHuge(struct page *page); -int PageHeadHuge(struct page *page_head); void reset_vma_resv_huge_pages(struct vm_area_struct *vma); int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); @@ -70,6 +69,7 @@ int dequeue_hwpoisoned_huge_page(struct page *page); bool isolate_huge_page(struct page *page, struct list_head *list); void putback_active_hugepage(struct page *page); bool is_hugepage_active(struct page *page); +void copy_huge_page(struct page *dst, struct page *src); #ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud); @@ -104,11 +104,6 @@ static inline int PageHuge(struct page *page) return 0; } -static inline int PageHeadHuge(struct page *page_head) -{ - return 0; -} - static inline void reset_vma_resv_huge_pages(struct vm_area_struct *vma) { } @@ -145,6 +140,9 @@ static inline int dequeue_hwpoisoned_huge_page(struct page *page) #define isolate_huge_page(p, l) false #define putback_active_hugepage(p) do {} while (0) #define is_hugepage_active(x) false +static inline void copy_huge_page(struct page *dst, struct page *src) +{ +} static inline unsigned long hugetlb_change_protection(struct vm_area_struct *vma, unsigned long address, unsigned long end, pgprot_t newprot) @@ -394,15 +392,6 @@ static inline int hugepage_migration_support(struct hstate *h) return pmd_huge_support() && (huge_page_shift(h) == PMD_SHIFT); } -static inline spinlock_t *huge_pte_lockptr(struct hstate *h, - struct mm_struct *mm, pte_t *pte) -{ - if (huge_page_size(h) == PMD_SIZE) - return pmd_lockptr(mm, (pmd_t *) pte); - VM_BUG_ON(huge_page_size(h) == PAGE_SIZE); - return &mm->page_table_lock; -} - #else /* CONFIG_HUGETLB_PAGE */ struct hstate {}; #define alloc_huge_page_node(h, nid) NULL @@ -412,7 +401,6 @@ struct hstate {}; #define hstate_sizelog(s) NULL #define hstate_vma(v) NULL #define hstate_inode(i) NULL -#define page_hstate(page) NULL #define huge_page_size(h) PAGE_SIZE #define huge_page_mask(h) PAGE_MASK #define vma_kernel_pagesize(v) PAGE_SIZE @@ -433,22 +421,6 @@ static inline pgoff_t basepage_index(struct page *page) #define dissolve_free_huge_pages(s, e) do {} while (0) #define pmd_huge_support() 0 #define hugepage_migration_support(h) 0 - -static inline spinlock_t *huge_pte_lockptr(struct hstate *h, - struct mm_struct *mm, pte_t *pte) -{ - return &mm->page_table_lock; -} #endif /* CONFIG_HUGETLB_PAGE */ -static inline spinlock_t *huge_pte_lock(struct hstate *h, - struct mm_struct *mm, pte_t *pte) -{ - spinlock_t *ptl; - - ptl = huge_pte_lockptr(h, mm, pte); - spin_lock(ptl); - return ptl; -} - #endif /* _LINUX_HUGETLB_H */ diff --git a/include/linux/hwmon-vid.h b/include/linux/hwmon-vid.h index da0a680..f346e4d 100644 --- a/include/linux/hwmon-vid.h +++ b/include/linux/hwmon-vid.h @@ -38,7 +38,7 @@ static inline int vid_to_reg(int val, u8 vrm) return ((val >= 1100) && (val <= 1850) ? ((18499 - val * 10) / 25 + 5) / 10 : -1); default: - return -EINVAL; + return -1; } } diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h index 09354f6..b2514f7 100644 --- a/include/linux/hwmon.h +++ b/include/linux/hwmon.h @@ -15,19 +15,9 @@ #define _HWMON_H_ struct device; -struct attribute_group; struct device *hwmon_device_register(struct device *dev); -struct device * -hwmon_device_register_with_groups(struct device *dev, const char *name, - void *drvdata, - const struct attribute_group **groups); -struct device * -devm_hwmon_device_register_with_groups(struct device *dev, const char *name, - void *drvdata, - const struct attribute_group **groups); void hwmon_device_unregister(struct device *dev); -void devm_hwmon_device_unregister(struct device *dev); #endif diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index 15da677..d98503b 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h @@ -432,6 +432,15 @@ struct hv_ring_buffer_info { u32 ring_data_startoffset; }; +struct hv_ring_buffer_debug_info { + u32 current_interrupt_mask; + u32 current_read_index; + u32 current_write_index; + u32 bytes_avail_toread; + u32 bytes_avail_towrite; +}; + + /* * * hv_get_ringbuffer_availbytes() @@ -893,6 +902,23 @@ enum vmbus_channel_state { CHANNEL_OPENED_STATE, }; +struct vmbus_channel_debug_info { + u32 relid; + enum vmbus_channel_state state; + uuid_le interfacetype; + uuid_le interface_instance; + u32 monitorid; + u32 servermonitor_pending; + u32 servermonitor_latency; + u32 servermonitor_connectionid; + u32 clientmonitor_pending; + u32 clientmonitor_latency; + u32 clientmonitor_connectionid; + + struct hv_ring_buffer_debug_info inbound; + struct hv_ring_buffer_debug_info outbound; +}; + /* * Represents each channel msg on the vmbus connection This is a * variable-size data structure depending on the msg type itself @@ -1158,8 +1184,19 @@ extern int vmbus_recvpacket_raw(struct vmbus_channel *channel, u64 *requestid); +extern void vmbus_get_debug_info(struct vmbus_channel *channel, + struct vmbus_channel_debug_info *debug); + extern void vmbus_ontimer(unsigned long data); +struct hv_dev_port_info { + u32 int_mask; + u32 read_idx; + u32 write_idx; + u32 bytes_avail_toread; + u32 bytes_avail_towrite; +}; + /* Base driver object */ struct hv_driver { const char *name; diff --git a/include/linux/i2c.h b/include/linux/i2c.h index eff50e0..2ab11dc 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -205,6 +205,7 @@ struct i2c_driver { * @name: Indicates the type of the device, usually a chip name that's * generic enough to hide second-sourcing and compatible revisions. * @adapter: manages the bus segment hosting this I2C device + * @driver: device's driver, hence pointer to access routines * @dev: Driver model device node for the slave. * @irq: indicates the IRQ generated by this device (if any) * @detected: member of an i2c_driver.clients list or i2c-core's @@ -221,6 +222,7 @@ struct i2c_client { /* _LOWER_ 7 bits */ char name[I2C_NAME_SIZE]; struct i2c_adapter *adapter; /* the adapter we sit on */ + struct i2c_driver *driver; /* and our access routines */ struct device dev; /* the device structure */ int irq; /* irq issued by device */ struct list_head detected; diff --git a/include/linux/platform_data/at24.h b/include/linux/i2c/at24.h index c42aa89..285025a 100644 --- a/include/linux/platform_data/at24.h +++ b/include/linux/i2c/at24.h @@ -28,7 +28,7 @@ * * void get_mac_addr(struct memory_accessor *mem_acc, void *context) * { - * u8 *mac_addr = ethernet_pdata->mac_addr; + * u8 *mac_addr = ethernet_pdata->mac_addr; * off_t offset = context; * * // Read MAC addr from EEPROM diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 673a3ce..81cbbdb 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h @@ -26,7 +26,6 @@ #define __TWL_H_ #include <linux/types.h> -#include <linux/phy/phy.h> #include <linux/input/matrix_keypad.h> /* @@ -616,7 +615,6 @@ enum twl4030_usb_mode { struct twl4030_usb_data { enum twl4030_usb_mode usb_mode; unsigned long features; - struct phy_init_data *init_data; int (*phy_init)(struct device *dev); int (*phy_exit)(struct device *dev); diff --git a/include/linux/ide.h b/include/linux/ide.h index 46a1422..b179749 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -1514,7 +1514,7 @@ static inline void ide_set_max_pio(ide_drive_t *drive) char *ide_media_string(ide_drive_t *); -extern const struct attribute_group *ide_dev_groups[]; +extern struct device_attribute ide_dev_attrs[]; extern struct bus_type ide_bus_type; extern struct class *ide_port_class; diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 8c3b26a..a5b598a 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -697,18 +697,6 @@ struct ieee80211_sec_chan_offs_ie { } __packed; /** - * struct ieee80211_mesh_chansw_params_ie - mesh channel switch parameters IE - * - * This structure represents the "Mesh Channel Switch Paramters element" - */ -struct ieee80211_mesh_chansw_params_ie { - u8 mesh_ttl; - u8 mesh_flags; - __le16 mesh_reason; - __le16 mesh_pre_value; -} __packed; - -/** * struct ieee80211_wide_bw_chansw_ie - wide bandwidth channel switch IE */ struct ieee80211_wide_bw_chansw_ie { @@ -763,14 +751,6 @@ enum mesh_config_capab_flags { }; /** - * mesh channel switch parameters element's flag indicator - * - */ -#define WLAN_EID_CHAN_SWITCH_PARAM_TX_RESTRICT BIT(0) -#define WLAN_EID_CHAN_SWITCH_PARAM_INITIATOR BIT(1) -#define WLAN_EID_CHAN_SWITCH_PARAM_REASON BIT(2) - -/** * struct ieee80211_rann_ie * * This structure refers to "Root Announcement information element" @@ -1411,8 +1391,8 @@ struct ieee80211_vht_operation { #define IEEE80211_VHT_CAP_RXSTBC_MASK 0x00000700 #define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800 #define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000 -#define IEEE80211_VHT_CAP_BEAMFORMEE_STS_MAX 0x0000e000 -#define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MAX 0x00070000 +#define IEEE80211_VHT_CAP_BEAMFORMER_ANTENNAS_MAX 0x00006000 +#define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MAX 0x00030000 #define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000 #define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000 #define IEEE80211_VHT_CAP_VHT_TXOP_PS 0x00200000 diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h index 84ba5ac..ddd33fd 100644 --- a/include/linux/if_macvlan.h +++ b/include/linux/if_macvlan.h @@ -61,7 +61,6 @@ struct macvlan_dev { struct hlist_node hlist; struct macvlan_port *port; struct net_device *lowerdev; - void *fwd_priv; struct macvlan_pcpu_stats __percpu *pcpu_stats; DECLARE_BITMAP(mc_filter, MACVLAN_MC_FILTER_SZ); @@ -119,21 +118,4 @@ extern int macvlan_link_register(struct rtnl_link_ops *ops); extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb, struct net_device *dev); -#if IS_ENABLED(CONFIG_MACVLAN) -static inline struct net_device * -macvlan_dev_real_dev(const struct net_device *dev) -{ - struct macvlan_dev *macvlan = netdev_priv(dev); - - return macvlan->lowerdev; -} -#else -static inline struct net_device * -macvlan_dev_real_dev(const struct net_device *dev) -{ - BUG(); - return NULL; -} -#endif - #endif /* _LINUX_IF_MACVLAN_H */ diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index f252deb..715c343 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h @@ -89,101 +89,6 @@ extern struct net_device *__vlan_find_dev_deep(struct net_device *real_dev, extern struct net_device *vlan_dev_real_dev(const struct net_device *dev); extern u16 vlan_dev_vlan_id(const struct net_device *dev); -/** - * struct vlan_priority_tci_mapping - vlan egress priority mappings - * @priority: skb priority - * @vlan_qos: vlan priority: (skb->priority << 13) & 0xE000 - * @next: pointer to next struct - */ -struct vlan_priority_tci_mapping { - u32 priority; - u16 vlan_qos; - struct vlan_priority_tci_mapping *next; -}; - -/** - * struct vlan_pcpu_stats - VLAN percpu rx/tx stats - * @rx_packets: number of received packets - * @rx_bytes: number of received bytes - * @rx_multicast: number of received multicast packets - * @tx_packets: number of transmitted packets - * @tx_bytes: number of transmitted bytes - * @syncp: synchronization point for 64bit counters - * @rx_errors: number of rx errors - * @tx_dropped: number of tx drops - */ -struct vlan_pcpu_stats { - u64 rx_packets; - u64 rx_bytes; - u64 rx_multicast; - u64 tx_packets; - u64 tx_bytes; - struct u64_stats_sync syncp; - u32 rx_errors; - u32 tx_dropped; -}; - -struct proc_dir_entry; -struct netpoll; - -/** - * struct vlan_dev_priv - VLAN private device data - * @nr_ingress_mappings: number of ingress priority mappings - * @ingress_priority_map: ingress priority mappings - * @nr_egress_mappings: number of egress priority mappings - * @egress_priority_map: hash of egress priority mappings - * @vlan_proto: VLAN encapsulation protocol - * @vlan_id: VLAN identifier - * @flags: device flags - * @real_dev: underlying netdevice - * @real_dev_addr: address of underlying netdevice - * @dent: proc dir entry - * @vlan_pcpu_stats: ptr to percpu rx stats - */ -struct vlan_dev_priv { - unsigned int nr_ingress_mappings; - u32 ingress_priority_map[8]; - unsigned int nr_egress_mappings; - struct vlan_priority_tci_mapping *egress_priority_map[16]; - - __be16 vlan_proto; - u16 vlan_id; - u16 flags; - - struct net_device *real_dev; - unsigned char real_dev_addr[ETH_ALEN]; - - struct proc_dir_entry *dent; - struct vlan_pcpu_stats __percpu *vlan_pcpu_stats; -#ifdef CONFIG_NET_POLL_CONTROLLER - struct netpoll *netpoll; -#endif -}; - -static inline struct vlan_dev_priv *vlan_dev_priv(const struct net_device *dev) -{ - return netdev_priv(dev); -} - -static inline u16 -vlan_dev_get_egress_qos_mask(struct net_device *dev, u32 skprio) -{ - struct vlan_priority_tci_mapping *mp; - - smp_rmb(); /* coupled with smp_wmb() in vlan_dev_set_egress_priority() */ - - mp = vlan_dev_priv(dev)->egress_priority_map[(skprio & 0xF)]; - while (mp) { - if (mp->priority == skprio) { - return mp->vlan_qos; /* This should already be shifted - * to mask correctly with the - * VLAN's TCI */ - } - mp = mp->next; - } - return 0; -} - extern bool vlan_do_receive(struct sk_buff **skb); extern struct sk_buff *vlan_untag(struct sk_buff *skb); @@ -216,12 +121,6 @@ static inline u16 vlan_dev_vlan_id(const struct net_device *dev) return 0; } -static inline u16 vlan_dev_get_egress_qos_mask(struct net_device *dev, - u32 skprio) -{ - return 0; -} - static inline bool vlan_do_receive(struct sk_buff **skb) { return false; diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h index 15607b4..2bac0eb 100644 --- a/include/linux/iio/buffer.h +++ b/include/linux/iio/buffer.h @@ -11,7 +11,6 @@ #define _IIO_BUFFER_GENERIC_H_ #include <linux/sysfs.h> #include <linux/iio/iio.h> -#include <linux/kref.h> #ifdef CONFIG_IIO_BUFFER @@ -27,8 +26,6 @@ struct iio_buffer; * @set_bytes_per_datum:set number of bytes per datum * @get_length: get number of datums in buffer * @set_length: set number of datums in buffer - * @release: called when the last reference to the buffer is dropped, - * should free all resources allocated by the buffer. * * The purpose of this structure is to make the buffer element * modular as event for a given driver, different usecases may require @@ -39,7 +36,7 @@ struct iio_buffer; * any of them not existing. **/ struct iio_buffer_access_funcs { - int (*store_to)(struct iio_buffer *buffer, const void *data); + int (*store_to)(struct iio_buffer *buffer, u8 *data); int (*read_first_n)(struct iio_buffer *buffer, size_t n, char __user *buf); @@ -50,8 +47,6 @@ struct iio_buffer_access_funcs { int (*set_bytes_per_datum)(struct iio_buffer *buffer, size_t bpd); int (*get_length)(struct iio_buffer *buffer); int (*set_length)(struct iio_buffer *buffer, int length); - - void (*release)(struct iio_buffer *buffer); }; /** @@ -72,7 +67,6 @@ struct iio_buffer_access_funcs { * @demux_list: [INTERN] list of operations required to demux the scan. * @demux_bounce: [INTERN] buffer for doing gather from incoming scan. * @buffer_list: [INTERN] entry in the devices list of current buffers. - * @ref: [INTERN] reference count of the buffer. */ struct iio_buffer { int length; @@ -87,9 +81,8 @@ struct iio_buffer { bool stufftoread; const struct attribute_group *attrs; struct list_head demux_list; - void *demux_bounce; + unsigned char *demux_bounce; struct list_head buffer_list; - struct kref ref; }; /** @@ -127,32 +120,7 @@ int iio_scan_mask_set(struct iio_dev *indio_dev, * @indio_dev: iio_dev structure for device. * @data: Full scan. */ -int iio_push_to_buffers(struct iio_dev *indio_dev, const void *data); - -/* - * iio_push_to_buffers_with_timestamp() - push data and timestamp to buffers - * @indio_dev: iio_dev structure for device. - * @data: sample data - * @timestamp: timestamp for the sample data - * - * Pushes data to the IIO device's buffers. If timestamps are enabled for the - * device the function will store the supplied timestamp as the last element in - * the sample data buffer before pushing it to the device buffers. The sample - * data buffer needs to be large enough to hold the additional timestamp - * (usually the buffer should be indio->scan_bytes bytes large). - * - * Returns 0 on success, a negative error code otherwise. - */ -static inline int iio_push_to_buffers_with_timestamp(struct iio_dev *indio_dev, - void *data, int64_t timestamp) -{ - if (indio_dev->scan_timestamp) { - size_t ts_offset = indio_dev->scan_bytes / sizeof(int64_t) - 1; - ((int64_t *)data)[ts_offset] = timestamp; - } - - return iio_push_to_buffers(indio_dev, data); -} +int iio_push_to_buffers(struct iio_dev *indio_dev, unsigned char *data); int iio_update_demux(struct iio_dev *indio_dev); @@ -206,27 +174,11 @@ ssize_t iio_buffer_show_enable(struct device *dev, iio_buffer_show_enable, \ iio_buffer_store_enable) +int iio_sw_buffer_preenable(struct iio_dev *indio_dev); + bool iio_validate_scan_mask_onehot(struct iio_dev *indio_dev, const unsigned long *mask); -struct iio_buffer *iio_buffer_get(struct iio_buffer *buffer); -void iio_buffer_put(struct iio_buffer *buffer); - -/** - * iio_device_attach_buffer - Attach a buffer to a IIO device - * @indio_dev: The device the buffer should be attached to - * @buffer: The buffer to attach to the device - * - * This function attaches a buffer to a IIO device. The buffer stays attached to - * the device until the device is freed. The function should only be called at - * most once per device. - */ -static inline void iio_device_attach_buffer(struct iio_dev *indio_dev, - struct iio_buffer *buffer) -{ - indio_dev->buffer = iio_buffer_get(buffer); -} - #else /* CONFIG_IIO_BUFFER */ static inline int iio_buffer_register(struct iio_dev *indio_dev, @@ -239,9 +191,6 @@ static inline int iio_buffer_register(struct iio_dev *indio_dev, static inline void iio_buffer_unregister(struct iio_dev *indio_dev) {} -static inline void iio_buffer_get(struct iio_buffer *buffer) {} -static inline void iio_buffer_put(struct iio_buffer *buffer) {} - #endif /* CONFIG_IIO_BUFFER */ #endif /* _IIO_BUFFER_GENERIC_H_ */ diff --git a/include/linux/iio/common/st_sensors.h b/include/linux/iio/common/st_sensors.h index 3c005eb..e51f654 100644 --- a/include/linux/iio/common/st_sensors.h +++ b/include/linux/iio/common/st_sensors.h @@ -16,7 +16,6 @@ #include <linux/irqreturn.h> #include <linux/iio/trigger.h> #include <linux/bitops.h> -#include <linux/regulator/consumer.h> #include <linux/platform_data/st_sensors_pdata.h> @@ -185,7 +184,6 @@ struct st_sensors { u8 wai; char sensors_supported[ST_SENSORS_MAX_4WAI][ST_SENSORS_MAX_NAME]; struct iio_chan_spec *ch; - int num_ch; struct st_sensor_odr odr; struct st_sensor_power pw; struct st_sensor_axis enable_axis; @@ -202,8 +200,6 @@ struct st_sensors { * @trig: The trigger in use by the core driver. * @sensor: Pointer to the current sensor struct in use. * @current_fullscale: Maximum range of measure by the sensor. - * @vdd: Pointer to sensor's Vdd power supply - * @vdd_io: Pointer to sensor's Vdd-IO power supply * @enabled: Status of the sensor (false->off, true->on). * @multiread_bit: Use or not particular bit for [I2C/SPI] multiread. * @buffer_data: Data used by buffer part. @@ -219,8 +215,6 @@ struct st_sensor_data { struct iio_trigger *trig; struct st_sensors *sensor; struct st_sensor_fullscale_avl *current_fullscale; - struct regulator *vdd; - struct regulator *vdd_io; bool enabled; bool multiread_bit; diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h index 2752b1f..833926c 100644 --- a/include/linux/iio/consumer.h +++ b/include/linux/iio/consumer.h @@ -77,7 +77,7 @@ struct iio_cb_buffer; * fail. */ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev, - int (*cb)(const void *data, + int (*cb)(u8 *data, void *private), void *private); /** diff --git a/include/linux/iio/events.h b/include/linux/iio/events.h index 5dab2c4..13ce220 100644 --- a/include/linux/iio/events.h +++ b/include/linux/iio/events.h @@ -26,6 +26,20 @@ struct iio_event_data { #define IIO_GET_EVENT_FD_IOCTL _IOR('i', 0x90, int) +enum iio_event_type { + IIO_EV_TYPE_THRESH, + IIO_EV_TYPE_MAG, + IIO_EV_TYPE_ROC, + IIO_EV_TYPE_THRESH_ADAPTIVE, + IIO_EV_TYPE_MAG_ADAPTIVE, +}; + +enum iio_event_direction { + IIO_EV_DIR_EITHER, + IIO_EV_DIR_RISING, + IIO_EV_DIR_FALLING, +}; + /** * IIO_EVENT_CODE() - create event identifier * @chan_type: Type of the channel. Should be one of enum iio_chan_type. diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 256a90a..2103cc3 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h @@ -36,14 +36,6 @@ enum iio_chan_info_enum { IIO_CHAN_INFO_PHASE, IIO_CHAN_INFO_HARDWAREGAIN, IIO_CHAN_INFO_HYSTERESIS, - IIO_CHAN_INFO_INT_TIME, -}; - -enum iio_shared_by { - IIO_SEPARATE, - IIO_SHARED_BY_TYPE, - IIO_SHARED_BY_DIR, - IIO_SHARED_BY_ALL }; enum iio_endian { @@ -65,7 +57,7 @@ struct iio_dev; */ struct iio_chan_spec_ext_info { const char *name; - enum iio_shared_by shared; + bool shared; ssize_t (*read)(struct iio_dev *, uintptr_t private, struct iio_chan_spec const *, char *buf); ssize_t (*write)(struct iio_dev *, uintptr_t private, @@ -133,35 +125,12 @@ ssize_t iio_enum_write(struct iio_dev *indio_dev, #define IIO_ENUM_AVAILABLE(_name, _e) \ { \ .name = (_name "_available"), \ - .shared = IIO_SHARED_BY_TYPE, \ + .shared = true, \ .read = iio_enum_available_read, \ .private = (uintptr_t)(_e), \ } /** - * struct iio_event_spec - specification for a channel event - * @type: Type of the event - * @dir: Direction of the event - * @mask_separate: Bit mask of enum iio_event_info values. Attributes - * set in this mask will be registered per channel. - * @mask_shared_by_type: Bit mask of enum iio_event_info values. Attributes - * set in this mask will be shared by channel type. - * @mask_shared_by_dir: Bit mask of enum iio_event_info values. Attributes - * set in this mask will be shared by channel type and - * direction. - * @mask_shared_by_all: Bit mask of enum iio_event_info values. Attributes - * set in this mask will be shared by all channels. - */ -struct iio_event_spec { - enum iio_event_type type; - enum iio_event_direction dir; - unsigned long mask_separate; - unsigned long mask_shared_by_type; - unsigned long mask_shared_by_dir; - unsigned long mask_shared_by_all; -}; - -/** * struct iio_chan_spec - specification of a single channel * @type: What type of measurement is the channel making. * @channel: What number do we wish to assign the channel. @@ -177,18 +146,13 @@ struct iio_event_spec { * shift: Shift right by this before masking out * realbits. * endianness: little or big endian + * @info_mask: What information is to be exported about this channel. + * This includes calibbias, scale etc. * @info_mask_separate: What information is to be exported that is specific to * this channel. * @info_mask_shared_by_type: What information is to be exported that is shared - * by all channels of the same type. - * @info_mask_shared_by_dir: What information is to be exported that is shared - * by all channels of the same direction. - * @info_mask_shared_by_all: What information is to be exported that is shared - * by all channels. +* by all channels of the same type. * @event_mask: What events can this channel produce. - * @event_spec: Array of events which should be registered for this - * channel. - * @num_event_specs: Size of the event_spec array. * @ext_info: Array of extended info attributes for this channel. * The array is NULL terminated, the last element should * have its name field set to NULL. @@ -222,13 +186,10 @@ struct iio_chan_spec { u8 shift; enum iio_endian endianness; } scan_type; + long info_mask; long info_mask_separate; long info_mask_shared_by_type; - long info_mask_shared_by_dir; - long info_mask_shared_by_all; long event_mask; - const struct iio_event_spec *event_spec; - unsigned int num_event_specs; const struct iio_chan_spec_ext_info *ext_info; const char *extend_name; const char *datasheet_name; @@ -251,9 +212,7 @@ static inline bool iio_channel_has_info(const struct iio_chan_spec *chan, enum iio_chan_info_enum type) { return (chan->info_mask_separate & BIT(type)) | - (chan->info_mask_shared_by_type & BIT(type)) | - (chan->info_mask_shared_by_dir & BIT(type)) | - (chan->info_mask_shared_by_all & BIT(type)); + (chan->info_mask_shared_by_type & BIT(type)); } #define IIO_ST(si, rb, sb, sh) \ @@ -311,12 +270,6 @@ struct iio_dev; * is event dependant. event_code specifies which event. * @write_event_value: write the value associated with the event. * Meaning is event dependent. - * @read_event_config_new: find out if the event is enabled. New style interface. - * @write_event_config_new: set if the event is enabled. New style interface. - * @read_event_value_new: read a configuration value associated with the event. - * New style interface. - * @write_event_value_new: write a configuration value for the event. New style - * interface. * @validate_trigger: function to validate the trigger when the * current trigger gets changed. * @update_scan_mode: function to configure device and scan buffer when @@ -357,30 +310,6 @@ struct iio_info { int (*write_event_value)(struct iio_dev *indio_dev, u64 event_code, int val); - - int (*read_event_config_new)(struct iio_dev *indio_dev, - const struct iio_chan_spec *chan, - enum iio_event_type type, - enum iio_event_direction dir); - - int (*write_event_config_new)(struct iio_dev *indio_dev, - const struct iio_chan_spec *chan, - enum iio_event_type type, - enum iio_event_direction dir, - int state); - - int (*read_event_value_new)(struct iio_dev *indio_dev, - const struct iio_chan_spec *chan, - enum iio_event_type type, - enum iio_event_direction dir, - enum iio_event_info info, int *val, int *val2); - - int (*write_event_value_new)(struct iio_dev *indio_dev, - const struct iio_chan_spec *chan, - enum iio_event_type type, - enum iio_event_direction dir, - enum iio_event_info info, int val, int val2); - int (*validate_trigger)(struct iio_dev *indio_dev, struct iio_trigger *trig); int (*update_scan_mode)(struct iio_dev *indio_dev, @@ -528,7 +457,7 @@ static inline void iio_device_put(struct iio_dev *indio_dev) { if (indio_dev) put_device(&indio_dev->dev); -} +}; /** * dev_to_iio_dev() - Get IIO device struct from a device struct @@ -664,7 +593,7 @@ static inline bool iio_buffer_enabled(struct iio_dev *indio_dev) { return indio_dev->currentmode & (INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE); -} +}; /** * iio_get_debugfs_dentry() - helper function to get the debugfs_dentry @@ -674,12 +603,12 @@ static inline bool iio_buffer_enabled(struct iio_dev *indio_dev) static inline struct dentry *iio_get_debugfs_dentry(struct iio_dev *indio_dev) { return indio_dev->debugfs_dentry; -} +}; #else static inline struct dentry *iio_get_debugfs_dentry(struct iio_dev *indio_dev) { return NULL; -} +}; #endif int iio_str_to_fixpoint(const char *str, int fract_mult, int *integer, diff --git a/include/linux/iio/sysfs.h b/include/linux/iio/sysfs.h index 8a1d186..2958c96 100644 --- a/include/linux/iio/sysfs.h +++ b/include/linux/iio/sysfs.h @@ -100,21 +100,6 @@ struct iio_const_attr { #define IIO_CONST_ATTR_SAMP_FREQ_AVAIL(_string) \ IIO_CONST_ATTR(sampling_frequency_available, _string) -/** - * IIO_DEV_ATTR_INT_TIME_AVAIL - list available integration times - * @_show: output method for the attribute - **/ -#define IIO_DEV_ATTR_INT_TIME_AVAIL(_show) \ - IIO_DEVICE_ATTR(integration_time_available, S_IRUGO, _show, NULL, 0) -/** - * IIO_CONST_ATTR_INT_TIME_AVAIL - list available integration times - * @_string: frequency string for the attribute - * - * Constant version - **/ -#define IIO_CONST_ATTR_INT_TIME_AVAIL(_string) \ - IIO_CONST_ATTR(integration_time_available, _string) - #define IIO_DEV_ATTR_TEMP_RAW(_show) \ IIO_DEVICE_ATTR(in_temp_raw, S_IRUGO, _show, NULL, 0) diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h index 4ac928e..88bf0f0 100644 --- a/include/linux/iio/types.h +++ b/include/linux/iio/types.h @@ -54,26 +54,6 @@ enum iio_modifier { IIO_MOD_LIGHT_BLUE, }; -enum iio_event_type { - IIO_EV_TYPE_THRESH, - IIO_EV_TYPE_MAG, - IIO_EV_TYPE_ROC, - IIO_EV_TYPE_THRESH_ADAPTIVE, - IIO_EV_TYPE_MAG_ADAPTIVE, -}; - -enum iio_event_info { - IIO_EV_INFO_ENABLE, - IIO_EV_INFO_VALUE, - IIO_EV_INFO_HYSTERESIS, -}; - -enum iio_event_direction { - IIO_EV_DIR_EITHER, - IIO_EV_DIR_RISING, - IIO_EV_DIR_FALLING, -}; - #define IIO_VAL_INT 1 #define IIO_VAL_INT_PLUS_MICRO 2 #define IIO_VAL_INT_PLUS_NANO 3 diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index 0d678ae..79640e0 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h @@ -147,27 +147,25 @@ struct in_ifaddr { unsigned long ifa_tstamp; /* updated timestamp */ }; -int register_inetaddr_notifier(struct notifier_block *nb); -int unregister_inetaddr_notifier(struct notifier_block *nb); +extern int register_inetaddr_notifier(struct notifier_block *nb); +extern int unregister_inetaddr_notifier(struct notifier_block *nb); -void inet_netconf_notify_devconf(struct net *net, int type, int ifindex, - struct ipv4_devconf *devconf); +extern void inet_netconf_notify_devconf(struct net *net, int type, int ifindex, + struct ipv4_devconf *devconf); -struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref); +extern struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref); static inline struct net_device *ip_dev_find(struct net *net, __be32 addr) { return __ip_dev_find(net, addr, true); } -int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b); -int devinet_ioctl(struct net *net, unsigned int cmd, void __user *); -void devinet_init(void); -struct in_device *inetdev_by_index(struct net *, int); -__be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope); -__be32 inet_confirm_addr(struct in_device *in_dev, __be32 dst, __be32 local, - int scope); -struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix, - __be32 mask); +extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b); +extern int devinet_ioctl(struct net *net, unsigned int cmd, void __user *); +extern void devinet_init(void); +extern struct in_device *inetdev_by_index(struct net *, int); +extern __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope); +extern __be32 inet_confirm_addr(struct in_device *in_dev, __be32 dst, __be32 local, int scope); +extern struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix, __be32 mask); static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa) { @@ -220,7 +218,7 @@ static inline struct in_device *__in_dev_get_rtnl(const struct net_device *dev) return rtnl_dereference(dev->ip_ptr); } -void in_dev_finish_destroy(struct in_device *idev); +extern void in_dev_finish_destroy(struct in_device *idev); static inline void in_dev_put(struct in_device *idev) { diff --git a/include/linux/init.h b/include/linux/init.h index 8e68a64..f1c27a7 100644 --- a/include/linux/init.h +++ b/include/linux/init.h @@ -26,8 +26,8 @@ * extern int initialize_foobar_device(int, int, int) __init; * * For initialized data: - * You should insert __initdata or __initconst between the variable name - * and equal sign followed by value, e.g.: + * You should insert __initdata between the variable name and equal + * sign followed by value, e.g.: * * static int init_variable __initdata = 0; * static const char linux_logo[] __initconst = { 0x32, 0x36, ... }; @@ -35,6 +35,8 @@ * Don't forget to initialize data not at file scope, i.e. within a function, * as gcc otherwise puts the data into the bss section and not into the init * section. + * + * Also note, that this data cannot be "const". */ /* These are for everybody (although not all archs will actually diff --git a/include/linux/init_task.h b/include/linux/init_task.h index b0ed422..5cd0f09 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h @@ -32,10 +32,10 @@ extern struct fs_struct init_fs; #endif #ifdef CONFIG_CPUSETS -#define INIT_CPUSET_SEQ(tsk) \ - .mems_allowed_seq = SEQCNT_ZERO(tsk.mems_allowed_seq), +#define INIT_CPUSET_SEQ \ + .mems_allowed_seq = SEQCNT_ZERO, #else -#define INIT_CPUSET_SEQ(tsk) +#define INIT_CPUSET_SEQ #endif #define INIT_SIGNALS(sig) { \ @@ -220,7 +220,7 @@ extern struct task_group root_task_group; INIT_FTRACE_GRAPH \ INIT_TRACE_RECURSION \ INIT_TASK_RCU_PREEMPT(tsk) \ - INIT_CPUSET_SEQ(tsk) \ + INIT_CPUSET_SEQ \ INIT_VTIME(tsk) \ } diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index db43b58..5e865b5 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -11,13 +11,14 @@ #include <linux/irqnr.h> #include <linux/hardirq.h> #include <linux/irqflags.h> +#include <linux/smp.h> +#include <linux/percpu.h> #include <linux/hrtimer.h> #include <linux/kref.h> #include <linux/workqueue.h> #include <linux/atomic.h> #include <asm/ptrace.h> -#include <asm/irq.h> /* * These correspond to the IORESOURCE_IRQ_* defines in @@ -373,16 +374,6 @@ struct softirq_action asmlinkage void do_softirq(void); asmlinkage void __do_softirq(void); - -#ifdef __ARCH_HAS_DO_SOFTIRQ -void do_softirq_own_stack(void); -#else -static inline void do_softirq_own_stack(void) -{ - __do_softirq(); -} -#endif - extern void open_softirq(int nr, void (*action)(struct softirq_action *)); extern void softirq_init(void); extern void __raise_softirq_irqoff(unsigned int nr); @@ -390,6 +381,15 @@ extern void __raise_softirq_irqoff(unsigned int nr); extern void raise_softirq_irqoff(unsigned int nr); extern void raise_softirq(unsigned int nr); +/* This is the worklist that queues up per-cpu softirq work. + * + * send_remote_sendirq() adds work to these lists, and + * the softirq handler itself dequeues from them. The queues + * are protected by disabling local cpu interrupts and they must + * only be accessed by the local cpu that they are for. + */ +DECLARE_PER_CPU(struct list_head [NR_SOFTIRQS], softirq_work_list); + DECLARE_PER_CPU(struct task_struct *, ksoftirqd); static inline struct task_struct *this_cpu_ksoftirqd(void) @@ -397,6 +397,17 @@ static inline struct task_struct *this_cpu_ksoftirqd(void) return this_cpu_read(ksoftirqd); } +/* Try to send a softirq to a remote cpu. If this cannot be done, the + * work will be queued to the local cpu. + */ +extern void send_remote_softirq(struct call_single_data *cp, int cpu, int softirq); + +/* Like send_remote_softirq(), but the caller must disable local cpu interrupts + * and compute the current cpu, passed in as 'this_cpu'. + */ +extern void __send_remote_softirq(struct call_single_data *cp, int cpu, + int this_cpu, int softirq); + /* Tasklets --- multithreaded analogue of BHs. Main feature differing them of generic softirqs: tasklet diff --git a/include/linux/iommu.h b/include/linux/iommu.h index a444c79..7ea319e 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -22,7 +22,6 @@ #include <linux/errno.h> #include <linux/err.h> #include <linux/types.h> -#include <trace/events/iommu.h> #define IOMMU_READ (1) #define IOMMU_WRITE (2) @@ -228,7 +227,6 @@ static inline int report_iommu_fault(struct iommu_domain *domain, ret = domain->handler(domain, dev, iova, flags, domain->handler_token); - trace_io_page_fault(dev, iova, flags); return ret; } diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 5d89d1b..28ea384 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h @@ -21,11 +21,13 @@ struct ipv6_devconf { __s32 force_mld_version; __s32 mldv1_unsolicited_report_interval; __s32 mldv2_unsolicited_report_interval; +#ifdef CONFIG_IPV6_PRIVACY __s32 use_tempaddr; __s32 temp_valid_lft; __s32 temp_prefered_lft; __s32 regen_max_retry; __s32 max_desync_factor; +#endif __s32 max_addresses; __s32 accept_ra_defrtr; __s32 accept_ra_pinfo; @@ -113,8 +115,16 @@ static inline int inet6_iif(const struct sk_buff *skb) return IP6CB(skb)->iif; } +struct inet6_request_sock { + struct in6_addr loc_addr; + struct in6_addr rmt_addr; + struct sk_buff *pktopts; + int iif; +}; + struct tcp6_request_sock { struct tcp_request_sock tcp6rsk_tcp; + struct inet6_request_sock tcp6rsk_inet6; }; struct ipv6_mc_socklist; @@ -131,6 +141,8 @@ struct ipv6_fl_socklist; */ struct ipv6_pinfo { struct in6_addr saddr; + struct in6_addr rcv_saddr; + struct in6_addr daddr; struct in6_pktinfo sticky_pktinfo; const struct in6_addr *daddr_cache; #ifdef CONFIG_IPV6_SUBTREES @@ -244,22 +256,48 @@ struct tcp6_sock { extern int inet6_sk_rebuild_header(struct sock *sk); +struct inet6_timewait_sock { + struct in6_addr tw_v6_daddr; + struct in6_addr tw_v6_rcv_saddr; +}; + struct tcp6_timewait_sock { struct tcp_timewait_sock tcp6tw_tcp; + struct inet6_timewait_sock tcp6tw_inet6; }; +static inline struct inet6_timewait_sock *inet6_twsk(const struct sock *sk) +{ + return (struct inet6_timewait_sock *)(((u8 *)sk) + + inet_twsk(sk)->tw_ipv6_offset); +} + #if IS_ENABLED(CONFIG_IPV6) static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk) { return inet_sk(__sk)->pinet6; } +static inline struct inet6_request_sock * + inet6_rsk(const struct request_sock *rsk) +{ + return (struct inet6_request_sock *)(((u8 *)rsk) + + inet_rsk(rsk)->inet6_rsk_offset); +} + +static inline u32 inet6_rsk_offset(struct request_sock *rsk) +{ + return rsk->rsk_ops->obj_size - sizeof(struct inet6_request_sock); +} + static inline struct request_sock *inet6_reqsk_alloc(struct request_sock_ops *ops) { struct request_sock *req = reqsk_alloc(ops); - if (req) - inet_rsk(req)->pktopts = NULL; + if (req != NULL) { + inet_rsk(req)->inet6_rsk_offset = inet6_rsk_offset(req); + inet6_rsk(req)->pktopts = NULL; + } return req; } @@ -283,11 +321,21 @@ static inline void inet_sk_copy_descendant(struct sock *sk_to, #define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only) #define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk)) -static inline const struct in6_addr *inet6_rcv_saddr(const struct sock *sk) +static inline u16 inet6_tw_offset(const struct proto *prot) { - if (sk->sk_family == AF_INET6) - return &sk->sk_v6_rcv_saddr; - return NULL; + return prot->twsk_prot->twsk_obj_size - + sizeof(struct inet6_timewait_sock); +} + +static inline struct in6_addr *__inet6_rcv_saddr(const struct sock *sk) +{ + return likely(sk->sk_state != TCP_TIME_WAIT) ? + &inet6_sk(sk)->rcv_saddr : &inet6_twsk(sk)->tw_v6_rcv_saddr; +} + +static inline struct in6_addr *inet6_rcv_saddr(const struct sock *sk) +{ + return sk->sk_family == AF_INET6 ? __inet6_rcv_saddr(sk) : NULL; } static inline int inet_v6_ipv6only(const struct sock *sk) @@ -315,18 +363,28 @@ static inline struct raw6_sock *raw6_sk(const struct sock *sk) return NULL; } +#define __inet6_rcv_saddr(__sk) NULL #define inet6_rcv_saddr(__sk) NULL #define tcp_twsk_ipv6only(__sk) 0 #define inet_v6_ipv6only(__sk) 0 #endif /* IS_ENABLED(CONFIG_IPV6) */ #define INET6_MATCH(__sk, __net, __saddr, __daddr, __ports, __dif) \ - (((__sk)->sk_portpair == (__ports)) && \ + ((inet_sk(__sk)->inet_portpair == (__ports)) && \ ((__sk)->sk_family == AF_INET6) && \ - ipv6_addr_equal(&(__sk)->sk_v6_daddr, (__saddr)) && \ - ipv6_addr_equal(&(__sk)->sk_v6_rcv_saddr, (__daddr)) && \ + ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \ + ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \ (!(__sk)->sk_bound_dev_if || \ ((__sk)->sk_bound_dev_if == (__dif))) && \ net_eq(sock_net(__sk), (__net))) +#define INET6_TW_MATCH(__sk, __net, __saddr, __daddr, __ports, __dif) \ + ((inet_twsk(__sk)->tw_portpair == (__ports)) && \ + ((__sk)->sk_family == AF_INET6) && \ + ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_daddr, (__saddr)) && \ + ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_rcv_saddr, (__daddr)) && \ + (!(__sk)->sk_bound_dev_if || \ + ((__sk)->sk_bound_dev_if == (__dif))) && \ + net_eq(sock_net(__sk), (__net))) + #endif /* _IPV6_H */ diff --git a/include/linux/irq.h b/include/linux/irq.h index 7dc1003..56bb0dc 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -70,9 +70,6 @@ typedef void (*irq_preflow_handler_t)(struct irq_data *data); * IRQ_MOVE_PCNTXT - Interrupt can be migrated from process context * IRQ_NESTED_TRHEAD - Interrupt nests into another thread * IRQ_PER_CPU_DEVID - Dev_id is a per-cpu variable - * IRQ_IS_POLLED - Always polled by another interrupt. Exclude - * it from the spurious interrupt detection - * mechanism and from core side polling. */ enum { IRQ_TYPE_NONE = 0x00000000, @@ -97,14 +94,12 @@ enum { IRQ_NESTED_THREAD = (1 << 15), IRQ_NOTHREAD = (1 << 16), IRQ_PER_CPU_DEVID = (1 << 17), - IRQ_IS_POLLED = (1 << 18), }; #define IRQF_MODIFY_MASK \ (IRQ_TYPE_SENSE_MASK | IRQ_NOPROBE | IRQ_NOREQUEST | \ IRQ_NOAUTOEN | IRQ_MOVE_PCNTXT | IRQ_LEVEL | IRQ_NO_BALANCING | \ - IRQ_PER_CPU | IRQ_NESTED_THREAD | IRQ_NOTHREAD | IRQ_PER_CPU_DEVID | \ - IRQ_IS_POLLED) + IRQ_PER_CPU | IRQ_NESTED_THREAD | IRQ_NOTHREAD | IRQ_PER_CPU_DEVID) #define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING) diff --git a/include/linux/irqchip/arm-gic.h b/include/linux/irqchip/arm-gic.h index cac496b..0e5d9ec 100644 --- a/include/linux/irqchip/arm-gic.h +++ b/include/linux/irqchip/arm-gic.h @@ -31,8 +31,6 @@ #define GIC_DIST_TARGET 0x800 #define GIC_DIST_CONFIG 0xc00 #define GIC_DIST_SOFTINT 0xf00 -#define GIC_DIST_SGI_PENDING_CLEAR 0xf10 -#define GIC_DIST_SGI_PENDING_SET 0xf20 #define GICH_HCR 0x0 #define GICH_VTR 0x4 @@ -76,11 +74,6 @@ static inline void gic_init(unsigned int nr, int start, gic_init_bases(nr, start, dist, cpu, 0, NULL); } -void gic_send_sgi(unsigned int cpu_id, unsigned int irq); -int gic_get_cpu_id(unsigned int cpu); -void gic_migrate_target(unsigned int new_cpu_id); -unsigned long gic_get_sgir_physaddr(void); - #endif /* __ASSEMBLY */ #endif diff --git a/include/linux/power/bq24735-charger.h b/include/linux/irqchip/bcm2835.h index f536164..48a859b 100644 --- a/include/linux/power/bq24735-charger.h +++ b/include/linux/irqchip/bcm2835.h @@ -1,4 +1,5 @@ /* + * Copyright (C) 2010 Broadcom * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,25 +16,14 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __CHARGER_BQ24735_H_ -#define __CHARGER_BQ24735_H_ +#ifndef __LINUX_IRQCHIP_BCM2835_H_ +#define __LINUX_IRQCHIP_BCM2835_H_ -#include <linux/types.h> -#include <linux/power_supply.h> +#include <asm/exception.h> -struct bq24735_platform { - uint32_t charge_current; - uint32_t charge_voltage; - uint32_t input_current; +extern void bcm2835_init_irq(void); - const char *name; +extern asmlinkage void __exception_irq_entry bcm2835_handle_irq( + struct pt_regs *regs); - int status_gpio; - int status_gpio_active_low; - bool status_gpio_valid; - - char **supplied_to; - size_t num_supplicants; -}; - -#endif /* __CHARGER_BQ24735_H_ */ +#endif diff --git a/include/linux/irqreturn.h b/include/linux/irqreturn.h index e374e36..714ba08 100644 --- a/include/linux/irqreturn.h +++ b/include/linux/irqreturn.h @@ -14,6 +14,6 @@ enum irqreturn { }; typedef enum irqreturn irqreturn_t; -#define IRQ_RETVAL(x) ((x) ? IRQ_HANDLED : IRQ_NONE) +#define IRQ_RETVAL(x) ((x) != IRQ_NONE) #endif diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h index 3999977..a507907 100644 --- a/include/linux/jump_label.h +++ b/include/linux/jump_label.h @@ -48,13 +48,6 @@ #include <linux/types.h> #include <linux/compiler.h> -#include <linux/bug.h> - -extern bool static_key_initialized; - -#define STATIC_KEY_CHECK_USE() WARN(!static_key_initialized, \ - "%s used before call to jump_label_init", \ - __func__) #if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL) @@ -135,32 +128,29 @@ struct static_key { static __always_inline void jump_label_init(void) { - static_key_initialized = true; } static __always_inline bool static_key_false(struct static_key *key) { - if (unlikely(atomic_read(&key->enabled) > 0)) + if (unlikely(atomic_read(&key->enabled)) > 0) return true; return false; } static __always_inline bool static_key_true(struct static_key *key) { - if (likely(atomic_read(&key->enabled) > 0)) + if (likely(atomic_read(&key->enabled)) > 0) return true; return false; } static inline void static_key_slow_inc(struct static_key *key) { - STATIC_KEY_CHECK_USE(); atomic_inc(&key->enabled); } static inline void static_key_slow_dec(struct static_key *key) { - STATIC_KEY_CHECK_USE(); atomic_dec(&key->enabled); } diff --git a/include/linux/jump_label_ratelimit.h b/include/linux/jump_label_ratelimit.h index 089f70f..1137883 100644 --- a/include/linux/jump_label_ratelimit.h +++ b/include/linux/jump_label_ratelimit.h @@ -23,14 +23,12 @@ struct static_key_deferred { }; static inline void static_key_slow_dec_deferred(struct static_key_deferred *key) { - STATIC_KEY_CHECK_USE(); static_key_slow_dec(&key->key); } static inline void jump_label_rate_limit(struct static_key_deferred *key, unsigned long rl) { - STATIC_KEY_CHECK_USE(); } #endif /* HAVE_JUMP_LABEL */ #endif /* _LINUX_JUMP_LABEL_RATELIMIT_H */ diff --git a/include/linux/kdb.h b/include/linux/kdb.h index 290db12..7f6fe6e 100644 --- a/include/linux/kdb.h +++ b/include/linux/kdb.h @@ -109,7 +109,6 @@ typedef enum { KDB_REASON_RECURSE, /* Recursive entry to kdb; * regs probably valid */ KDB_REASON_SSTEP, /* Single Step trap. - regs valid */ - KDB_REASON_SYSTEM_NMI, /* In NMI due to SYSTEM cmd; regs valid */ } kdb_reason_t; extern int kdb_trap_printk; diff --git a/include/linux/kernel-page-flags.h b/include/linux/kernel-page-flags.h index f65ce09..546eb6a 100644 --- a/include/linux/kernel-page-flags.h +++ b/include/linux/kernel-page-flags.h @@ -15,6 +15,5 @@ #define KPF_OWNER_PRIVATE 37 #define KPF_ARCH 38 #define KPF_UNCACHED 39 -#define KPF_SOFTDIRTY 40 #endif /* LINUX_KERNEL_PAGE_FLAGS_H */ diff --git a/include/linux/kernel.h b/include/linux/kernel.h index d4e98d1..672ddc4 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -501,6 +501,7 @@ void tracing_snapshot_alloc(void); extern void tracing_start(void); extern void tracing_stop(void); +extern void ftrace_off_permanent(void); static inline __printf(1, 2) void ____trace_printk_check_format(const char *fmt, ...) @@ -638,6 +639,7 @@ extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode); #else static inline void tracing_start(void) { } static inline void tracing_stop(void) { } +static inline void ftrace_off_permanent(void) { } static inline void trace_dump_stack(int skip) { } static inline void tracing_on(void) { } diff --git a/include/linux/key-type.h b/include/linux/key-type.h index a74c3a8..518a53a 100644 --- a/include/linux/key-type.h +++ b/include/linux/key-type.h @@ -45,7 +45,6 @@ struct key_preparsed_payload { const void *data; /* Raw data */ size_t datalen; /* Raw datalen */ size_t quotalen; /* Quota length for proposed payload */ - bool trusted; /* True if key is trusted */ }; typedef int (*request_key_actor_t)(struct key_construction *key, @@ -64,11 +63,6 @@ struct key_type { */ size_t def_datalen; - /* Default key search algorithm. */ - unsigned def_lookup_type; -#define KEYRING_SEARCH_LOOKUP_DIRECT 0x0000 /* Direct lookup by description. */ -#define KEYRING_SEARCH_LOOKUP_ITERATE 0x0001 /* Iterative search. */ - /* vet a description */ int (*vet_description)(const char *description); diff --git a/include/linux/key.h b/include/linux/key.h index 80d6774..4dfde11 100644 --- a/include/linux/key.h +++ b/include/linux/key.h @@ -22,7 +22,6 @@ #include <linux/sysctl.h> #include <linux/rwsem.h> #include <linux/atomic.h> -#include <linux/assoc_array.h> #ifdef __KERNEL__ #include <linux/uidgid.h> @@ -83,12 +82,6 @@ struct key_owner; struct keyring_list; struct keyring_name; -struct keyring_index_key { - struct key_type *type; - const char *description; - size_t desc_len; -}; - /*****************************************************************************/ /* * key reference with possession attribute handling @@ -106,7 +99,7 @@ struct keyring_index_key { typedef struct __key_reference_with_attributes *key_ref_t; static inline key_ref_t make_key_ref(const struct key *key, - bool possession) + unsigned long possession) { return (key_ref_t) ((unsigned long) key | possession); } @@ -116,7 +109,7 @@ static inline struct key *key_ref_to_ptr(const key_ref_t key_ref) return (struct key *) ((unsigned long) key_ref & ~1UL); } -static inline bool is_key_possessed(const key_ref_t key_ref) +static inline unsigned long is_key_possessed(const key_ref_t key_ref) { return (unsigned long) key_ref & 1UL; } @@ -136,6 +129,7 @@ struct key { struct list_head graveyard_link; struct rb_node serial_node; }; + struct key_type *type; /* type of key */ struct rw_semaphore sem; /* change vs change sem */ struct key_user *user; /* owner of this key */ void *security; /* security data for this key */ @@ -168,21 +162,13 @@ struct key { #define KEY_FLAG_NEGATIVE 5 /* set if key is negative */ #define KEY_FLAG_ROOT_CAN_CLEAR 6 /* set if key can be cleared by root without permission */ #define KEY_FLAG_INVALIDATED 7 /* set if key has been invalidated */ -#define KEY_FLAG_TRUSTED 8 /* set if key is trusted */ -#define KEY_FLAG_TRUSTED_ONLY 9 /* set if keyring only accepts links to trusted keys */ - /* the key type and key description string - * - the desc is used to match a key against search criteria - * - it should be a printable string + /* the description string + * - this is used to match a key against search criteria + * - this should be a printable string * - eg: for krb5 AFS, this might be "afs@REDHAT.COM" */ - union { - struct keyring_index_key index_key; - struct { - struct key_type *type; /* type of key */ - char *description; - }; - }; + char *description; /* type specific data * - this is used by the keyring type to index the name @@ -199,14 +185,11 @@ struct key { * whatever */ union { - union { - unsigned long value; - void __rcu *rcudata; - void *data; - void *data2[2]; - } payload; - struct assoc_array keys; - }; + unsigned long value; + void __rcu *rcudata; + void *data; + struct keyring_list __rcu *subscriptions; + } payload; }; extern struct key *key_alloc(struct key_type *type, @@ -220,21 +203,16 @@ extern struct key *key_alloc(struct key_type *type, #define KEY_ALLOC_IN_QUOTA 0x0000 /* add to quota, reject if would overrun */ #define KEY_ALLOC_QUOTA_OVERRUN 0x0001 /* add to quota, permit even if overrun */ #define KEY_ALLOC_NOT_IN_QUOTA 0x0002 /* not in quota */ -#define KEY_ALLOC_TRUSTED 0x0004 /* Key should be flagged as trusted */ extern void key_revoke(struct key *key); extern void key_invalidate(struct key *key); extern void key_put(struct key *key); -static inline struct key *__key_get(struct key *key) -{ - atomic_inc(&key->usage); - return key; -} - static inline struct key *key_get(struct key *key) { - return key ? __key_get(key) : key; + if (key) + atomic_inc(&key->usage); + return key; } static inline void key_ref_put(key_ref_t key_ref) diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h index 552d51e..10308c6 100644 --- a/include/linux/kfifo.h +++ b/include/linux/kfifo.h @@ -1,7 +1,7 @@ /* * A generic kernel FIFO implementation * - * Copyright (C) 2013 Stefani Seibold <stefani@seibold.net> + * Copyright (C) 2009/2010 Stefani Seibold <stefani@seibold.net> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -67,10 +67,9 @@ struct __kfifo { union { \ struct __kfifo kfifo; \ datatype *type; \ - const datatype *const_type; \ char (*rectype)[recsize]; \ ptrtype *ptr; \ - ptrtype const *ptr_const; \ + const ptrtype *ptr_const; \ } #define __STRUCT_KFIFO(type, size, recsize, ptrtype) \ @@ -387,12 +386,16 @@ __kfifo_int_must_check_helper( \ #define kfifo_put(fifo, val) \ ({ \ typeof((fifo) + 1) __tmp = (fifo); \ - typeof(*__tmp->const_type) __val = (val); \ + typeof((val) + 1) __val = (val); \ unsigned int __ret; \ - size_t __recsize = sizeof(*__tmp->rectype); \ + const size_t __recsize = sizeof(*__tmp->rectype); \ struct __kfifo *__kfifo = &__tmp->kfifo; \ + if (0) { \ + typeof(__tmp->ptr_const) __dummy __attribute__ ((unused)); \ + __dummy = (typeof(__val))NULL; \ + } \ if (__recsize) \ - __ret = __kfifo_in_r(__kfifo, &__val, sizeof(__val), \ + __ret = __kfifo_in_r(__kfifo, __val, sizeof(*__val), \ __recsize); \ else { \ __ret = !kfifo_is_full(__tmp); \ @@ -401,7 +404,7 @@ __kfifo_int_must_check_helper( \ ((typeof(__tmp->type))__kfifo->data) : \ (__tmp->buf) \ )[__kfifo->in & __tmp->kfifo.mask] = \ - (typeof(*__tmp->type))__val; \ + *(typeof(__tmp->type))__val; \ smp_wmb(); \ __kfifo->in++; \ } \ @@ -412,7 +415,7 @@ __kfifo_int_must_check_helper( \ /** * kfifo_get - get data from the fifo * @fifo: address of the fifo to be used - * @val: address where to store the data + * @val: the var where to store the data to be added * * This macro reads the data from the fifo. * It returns 0 if the fifo was empty. Otherwise it returns the number @@ -425,10 +428,12 @@ __kfifo_int_must_check_helper( \ __kfifo_uint_must_check_helper( \ ({ \ typeof((fifo) + 1) __tmp = (fifo); \ - typeof(__tmp->ptr) __val = (val); \ + typeof((val) + 1) __val = (val); \ unsigned int __ret; \ const size_t __recsize = sizeof(*__tmp->rectype); \ struct __kfifo *__kfifo = &__tmp->kfifo; \ + if (0) \ + __val = (typeof(__tmp->ptr))0; \ if (__recsize) \ __ret = __kfifo_out_r(__kfifo, __val, sizeof(*__val), \ __recsize); \ @@ -451,7 +456,7 @@ __kfifo_uint_must_check_helper( \ /** * kfifo_peek - get data from the fifo without removing * @fifo: address of the fifo to be used - * @val: address where to store the data + * @val: the var where to store the data to be added * * This reads the data from the fifo without removing it from the fifo. * It returns 0 if the fifo was empty. Otherwise it returns the number @@ -464,10 +469,12 @@ __kfifo_uint_must_check_helper( \ __kfifo_uint_must_check_helper( \ ({ \ typeof((fifo) + 1) __tmp = (fifo); \ - typeof(__tmp->ptr) __val = (val); \ + typeof((val) + 1) __val = (val); \ unsigned int __ret; \ const size_t __recsize = sizeof(*__tmp->rectype); \ struct __kfifo *__kfifo = &__tmp->kfifo; \ + if (0) \ + __val = (typeof(__tmp->ptr))NULL; \ if (__recsize) \ __ret = __kfifo_out_peek_r(__kfifo, __val, sizeof(*__val), \ __recsize); \ @@ -501,10 +508,14 @@ __kfifo_uint_must_check_helper( \ #define kfifo_in(fifo, buf, n) \ ({ \ typeof((fifo) + 1) __tmp = (fifo); \ - typeof(__tmp->ptr_const) __buf = (buf); \ + typeof((buf) + 1) __buf = (buf); \ unsigned long __n = (n); \ const size_t __recsize = sizeof(*__tmp->rectype); \ struct __kfifo *__kfifo = &__tmp->kfifo; \ + if (0) { \ + typeof(__tmp->ptr_const) __dummy __attribute__ ((unused)); \ + __dummy = (typeof(__buf))NULL; \ + } \ (__recsize) ?\ __kfifo_in_r(__kfifo, __buf, __n, __recsize) : \ __kfifo_in(__kfifo, __buf, __n); \ @@ -550,10 +561,14 @@ __kfifo_uint_must_check_helper( \ __kfifo_uint_must_check_helper( \ ({ \ typeof((fifo) + 1) __tmp = (fifo); \ - typeof(__tmp->ptr) __buf = (buf); \ + typeof((buf) + 1) __buf = (buf); \ unsigned long __n = (n); \ const size_t __recsize = sizeof(*__tmp->rectype); \ struct __kfifo *__kfifo = &__tmp->kfifo; \ + if (0) { \ + typeof(__tmp->ptr) __dummy = NULL; \ + __buf = __dummy; \ + } \ (__recsize) ?\ __kfifo_out_r(__kfifo, __buf, __n, __recsize) : \ __kfifo_out(__kfifo, __buf, __n); \ @@ -758,10 +773,14 @@ __kfifo_uint_must_check_helper( \ __kfifo_uint_must_check_helper( \ ({ \ typeof((fifo) + 1) __tmp = (fifo); \ - typeof(__tmp->ptr) __buf = (buf); \ + typeof((buf) + 1) __buf = (buf); \ unsigned long __n = (n); \ const size_t __recsize = sizeof(*__tmp->rectype); \ struct __kfifo *__kfifo = &__tmp->kfifo; \ + if (0) { \ + typeof(__tmp->ptr) __dummy __attribute__ ((unused)) = NULL; \ + __buf = __dummy; \ + } \ (__recsize) ? \ __kfifo_out_peek_r(__kfifo, __buf, __n, __recsize) : \ __kfifo_out_peek(__kfifo, __buf, __n); \ diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h index dfb4f2f..c6e091b 100644 --- a/include/linux/kgdb.h +++ b/include/linux/kgdb.h @@ -310,7 +310,6 @@ extern int kgdb_handle_exception(int ex_vector, int signo, int err_code, struct pt_regs *regs); extern int kgdb_nmicallback(int cpu, void *regs); -extern int kgdb_nmicallin(int cpu, int trapnr, void *regs, atomic_t *snd_rdy); extern void gdbstub_exit(int status); extern int kgdb_single_step; diff --git a/include/linux/kobj_completion.h b/include/linux/kobj_completion.h deleted file mode 100644 index a428f64..0000000 --- a/include/linux/kobj_completion.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _KOBJ_COMPLETION_H_ -#define _KOBJ_COMPLETION_H_ - -#include <linux/kobject.h> -#include <linux/completion.h> - -struct kobj_completion { - struct kobject kc_kobj; - struct completion kc_unregister; -}; - -#define kobj_to_kobj_completion(kobj) \ - container_of(kobj, struct kobj_completion, kc_kobj) - -void kobj_completion_init(struct kobj_completion *kc, struct kobj_type *ktype); -void kobj_completion_release(struct kobject *kobj); -void kobj_completion_del_and_wait(struct kobj_completion *kc); -#endif /* _KOBJ_COMPLETION_H_ */ diff --git a/include/linux/kobject.h b/include/linux/kobject.h index e7ba650..de6dcbcc 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h @@ -107,7 +107,6 @@ extern int __must_check kobject_move(struct kobject *, struct kobject *); extern struct kobject *kobject_get(struct kobject *kobj); extern void kobject_put(struct kobject *kobj); -extern const void *kobject_namespace(struct kobject *kobj); extern char *kobject_get_path(struct kobject *kobj, gfp_t flag); struct kobj_type { diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 9523d2a..0fbbc7a 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -142,7 +142,7 @@ struct kvm; struct kvm_vcpu; extern struct kmem_cache *kvm_vcpu_cache; -extern spinlock_t kvm_lock; +extern raw_spinlock_t kvm_lock; extern struct list_head vm_list; struct kvm_io_range { @@ -189,7 +189,8 @@ struct kvm_async_pf { gva_t gva; unsigned long addr; struct kvm_arch_async_pf arch; - bool wakeup_all; + struct page *page; + bool done; }; void kvm_clear_async_pf_completion_queue(struct kvm_vcpu *vcpu); @@ -507,10 +508,9 @@ int kvm_set_memory_region(struct kvm *kvm, struct kvm_userspace_memory_region *mem); int __kvm_set_memory_region(struct kvm *kvm, struct kvm_userspace_memory_region *mem); -void kvm_arch_free_memslot(struct kvm *kvm, struct kvm_memory_slot *free, +void kvm_arch_free_memslot(struct kvm_memory_slot *free, struct kvm_memory_slot *dont); -int kvm_arch_create_memslot(struct kvm *kvm, struct kvm_memory_slot *slot, - unsigned long npages); +int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages); void kvm_arch_memslots_updated(struct kvm *kvm); int kvm_arch_prepare_memory_region(struct kvm *kvm, struct kvm_memory_slot *memslot, @@ -671,25 +671,6 @@ static inline void kvm_arch_free_vm(struct kvm *kvm) } #endif -#ifdef __KVM_HAVE_ARCH_NONCOHERENT_DMA -void kvm_arch_register_noncoherent_dma(struct kvm *kvm); -void kvm_arch_unregister_noncoherent_dma(struct kvm *kvm); -bool kvm_arch_has_noncoherent_dma(struct kvm *kvm); -#else -static inline void kvm_arch_register_noncoherent_dma(struct kvm *kvm) -{ -} - -static inline void kvm_arch_unregister_noncoherent_dma(struct kvm *kvm) -{ -} - -static inline bool kvm_arch_has_noncoherent_dma(struct kvm *kvm) -{ - return false; -} -#endif - static inline wait_queue_head_t *kvm_arch_vcpu_wq(struct kvm_vcpu *vcpu) { #ifdef __KVM_HAVE_ARCH_WQP @@ -766,6 +747,9 @@ void kvm_unregister_irq_ack_notifier(struct kvm *kvm, int kvm_request_irq_source_id(struct kvm *kvm); void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id); +/* For vcpu->arch.iommu_flags */ +#define KVM_IOMMU_CACHE_COHERENCY 0x1 + #ifdef CONFIG_KVM_DEVICE_ASSIGNMENT int kvm_iommu_map_pages(struct kvm *kvm, struct kvm_memory_slot *slot); void kvm_iommu_unmap_pages(struct kvm *kvm, struct kvm_memory_slot *slot); @@ -805,7 +789,7 @@ static inline void kvm_guest_enter(void) /* KVM does not hold any references to rcu protected data when it * switches CPU into a guest mode. In fact switching to a guest mode - * is very similar to exiting to userspace from rcu point of view. In + * is very similar to exiting to userspase from rcu point of view. In * addition CPU may stay in a guest mode for quite a long time (up to * one time slice). Lets treat guest mode as quiescent state, just like * we do with user-mode execution. @@ -858,6 +842,13 @@ static inline int memslot_id(struct kvm *kvm, gfn_t gfn) return gfn_to_memslot(kvm, gfn)->id; } +static inline gfn_t gfn_to_index(gfn_t gfn, gfn_t base_gfn, int level) +{ + /* KVM_HPAGE_GFN_SHIFT(PT_PAGE_TABLE_LEVEL) must be 0. */ + return (gfn >> KVM_HPAGE_GFN_SHIFT(level)) - + (base_gfn >> KVM_HPAGE_GFN_SHIFT(level)); +} + static inline gfn_t hva_to_gfn_memslot(unsigned long hva, struct kvm_memory_slot *slot) { @@ -1075,7 +1066,6 @@ struct kvm_device *kvm_device_from_filp(struct file *filp); extern struct kvm_device_ops kvm_mpic_ops; extern struct kvm_device_ops kvm_xics_ops; -extern struct kvm_device_ops kvm_vfio_ops; #ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT diff --git a/include/linux/lglock.h b/include/linux/lglock.h index 96549ab..0d24e93 100644 --- a/include/linux/lglock.h +++ b/include/linux/lglock.h @@ -25,6 +25,16 @@ #include <linux/cpu.h> #include <linux/notifier.h> +/* can make br locks by using local lock for read side, global lock for write */ +#define br_lock_init(name) lg_lock_init(name, #name) +#define br_read_lock(name) lg_local_lock(name) +#define br_read_unlock(name) lg_local_unlock(name) +#define br_write_lock(name) lg_global_lock(name) +#define br_write_unlock(name) lg_global_unlock(name) + +#define DEFINE_BRLOCK(name) DEFINE_LGLOCK(name) +#define DEFINE_STATIC_BRLOCK(name) DEFINE_STATIC_LGLOCK(name) + #ifdef CONFIG_DEBUG_LOCK_ALLOC #define LOCKDEP_INIT_MAP lockdep_init_map #else diff --git a/include/linux/list.h b/include/linux/list.h index ef95941..f4d8a2f 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -362,17 +362,6 @@ static inline void list_splice_tail_init(struct list_head *list, list_entry((ptr)->next, type, member) /** - * list_last_entry - get the last element from a list - * @ptr: the list head to take the element from. - * @type: the type of the struct this is embedded in. - * @member: the name of the list_struct within the struct. - * - * Note, that list is expected to be not empty. - */ -#define list_last_entry(ptr, type, member) \ - list_entry((ptr)->prev, type, member) - -/** * list_first_entry_or_null - get the first element from a list * @ptr: the list head to take the element from. * @type: the type of the struct this is embedded in. @@ -384,22 +373,6 @@ static inline void list_splice_tail_init(struct list_head *list, (!list_empty(ptr) ? list_first_entry(ptr, type, member) : NULL) /** - * list_next_entry - get the next element in list - * @pos: the type * to cursor - * @member: the name of the list_struct within the struct. - */ -#define list_next_entry(pos, member) \ - list_entry((pos)->member.next, typeof(*(pos)), member) - -/** - * list_prev_entry - get the prev element in list - * @pos: the type * to cursor - * @member: the name of the list_struct within the struct. - */ -#define list_prev_entry(pos, member) \ - list_entry((pos)->member.prev, typeof(*(pos)), member) - -/** * list_for_each - iterate over a list * @pos: the &struct list_head to use as a loop cursor. * @head: the head for your list. @@ -443,9 +416,9 @@ static inline void list_splice_tail_init(struct list_head *list, * @member: the name of the list_struct within the struct. */ #define list_for_each_entry(pos, head, member) \ - for (pos = list_first_entry(head, typeof(*pos), member); \ - &pos->member != (head); \ - pos = list_next_entry(pos, member)) + for (pos = list_entry((head)->next, typeof(*pos), member); \ + &pos->member != (head); \ + pos = list_entry(pos->member.next, typeof(*pos), member)) /** * list_for_each_entry_reverse - iterate backwards over list of given type. @@ -454,9 +427,9 @@ static inline void list_splice_tail_init(struct list_head *list, * @member: the name of the list_struct within the struct. */ #define list_for_each_entry_reverse(pos, head, member) \ - for (pos = list_last_entry(head, typeof(*pos), member); \ - &pos->member != (head); \ - pos = list_prev_entry(pos, member)) + for (pos = list_entry((head)->prev, typeof(*pos), member); \ + &pos->member != (head); \ + pos = list_entry(pos->member.prev, typeof(*pos), member)) /** * list_prepare_entry - prepare a pos entry for use in list_for_each_entry_continue() @@ -479,9 +452,9 @@ static inline void list_splice_tail_init(struct list_head *list, * the current position. */ #define list_for_each_entry_continue(pos, head, member) \ - for (pos = list_next_entry(pos, member); \ - &pos->member != (head); \ - pos = list_next_entry(pos, member)) + for (pos = list_entry(pos->member.next, typeof(*pos), member); \ + &pos->member != (head); \ + pos = list_entry(pos->member.next, typeof(*pos), member)) /** * list_for_each_entry_continue_reverse - iterate backwards from the given point @@ -493,9 +466,9 @@ static inline void list_splice_tail_init(struct list_head *list, * the current position. */ #define list_for_each_entry_continue_reverse(pos, head, member) \ - for (pos = list_prev_entry(pos, member); \ - &pos->member != (head); \ - pos = list_prev_entry(pos, member)) + for (pos = list_entry(pos->member.prev, typeof(*pos), member); \ + &pos->member != (head); \ + pos = list_entry(pos->member.prev, typeof(*pos), member)) /** * list_for_each_entry_from - iterate over list of given type from the current point @@ -506,8 +479,8 @@ static inline void list_splice_tail_init(struct list_head *list, * Iterate over list of given type, continuing from current position. */ #define list_for_each_entry_from(pos, head, member) \ - for (; &pos->member != (head); \ - pos = list_next_entry(pos, member)) + for (; &pos->member != (head); \ + pos = list_entry(pos->member.next, typeof(*pos), member)) /** * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry @@ -517,10 +490,10 @@ static inline void list_splice_tail_init(struct list_head *list, * @member: the name of the list_struct within the struct. */ #define list_for_each_entry_safe(pos, n, head, member) \ - for (pos = list_first_entry(head, typeof(*pos), member), \ - n = list_next_entry(pos, member); \ + for (pos = list_entry((head)->next, typeof(*pos), member), \ + n = list_entry(pos->member.next, typeof(*pos), member); \ &pos->member != (head); \ - pos = n, n = list_next_entry(n, member)) + pos = n, n = list_entry(n->member.next, typeof(*n), member)) /** * list_for_each_entry_safe_continue - continue list iteration safe against removal @@ -533,10 +506,10 @@ static inline void list_splice_tail_init(struct list_head *list, * safe against removal of list entry. */ #define list_for_each_entry_safe_continue(pos, n, head, member) \ - for (pos = list_next_entry(pos, member), \ - n = list_next_entry(pos, member); \ + for (pos = list_entry(pos->member.next, typeof(*pos), member), \ + n = list_entry(pos->member.next, typeof(*pos), member); \ &pos->member != (head); \ - pos = n, n = list_next_entry(n, member)) + pos = n, n = list_entry(n->member.next, typeof(*n), member)) /** * list_for_each_entry_safe_from - iterate over list from current point safe against removal @@ -549,9 +522,9 @@ static inline void list_splice_tail_init(struct list_head *list, * removal of list entry. */ #define list_for_each_entry_safe_from(pos, n, head, member) \ - for (n = list_next_entry(pos, member); \ + for (n = list_entry(pos->member.next, typeof(*pos), member); \ &pos->member != (head); \ - pos = n, n = list_next_entry(n, member)) + pos = n, n = list_entry(n->member.next, typeof(*n), member)) /** * list_for_each_entry_safe_reverse - iterate backwards over list safe against removal @@ -564,10 +537,10 @@ static inline void list_splice_tail_init(struct list_head *list, * of list entry. */ #define list_for_each_entry_safe_reverse(pos, n, head, member) \ - for (pos = list_last_entry(head, typeof(*pos), member), \ - n = list_prev_entry(pos, member); \ + for (pos = list_entry((head)->prev, typeof(*pos), member), \ + n = list_entry(pos->member.prev, typeof(*pos), member); \ &pos->member != (head); \ - pos = n, n = list_prev_entry(n, member)) + pos = n, n = list_entry(n->member.prev, typeof(*n), member)) /** * list_safe_reset_next - reset a stale list_for_each_entry_safe loop @@ -582,7 +555,7 @@ static inline void list_splice_tail_init(struct list_head *list, * completing the current iteration of the loop body. */ #define list_safe_reset_next(pos, n, member) \ - n = list_next_entry(pos, member) + n = list_entry(pos->member.next, typeof(*pos), member) /* * Double linked lists with a single pointer list head. diff --git a/include/linux/llist.h b/include/linux/llist.h index fbf10a0..8828a78 100644 --- a/include/linux/llist.h +++ b/include/linux/llist.h @@ -195,6 +195,4 @@ static inline struct llist_node *llist_del_all(struct llist_head *head) extern struct llist_node *llist_del_first(struct llist_head *head); -struct llist_node *llist_reverse_order(struct llist_node *head); - #endif /* LLIST_H */ diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index 92b1bfc..cfc2f11 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h @@ -497,10 +497,6 @@ static inline void print_irqtrace_events(struct task_struct *curr) #define rwlock_acquire_read(l, s, t, i) lock_acquire_shared_recursive(l, s, t, NULL, i) #define rwlock_release(l, n, i) lock_release(l, n, i) -#define seqcount_acquire(l, s, t, i) lock_acquire_exclusive(l, s, t, NULL, i) -#define seqcount_acquire_read(l, s, t, i) lock_acquire_shared_recursive(l, s, t, NULL, i) -#define seqcount_release(l, n, i) lock_release(l, n, i) - #define mutex_acquire(l, s, t, i) lock_acquire_exclusive(l, s, t, NULL, i) #define mutex_acquire_nest(l, s, t, n, i) lock_acquire_exclusive(l, s, t, n, i) #define mutex_release(l, n, i) lock_release(l, n, i) @@ -508,11 +504,11 @@ static inline void print_irqtrace_events(struct task_struct *curr) #define rwsem_acquire(l, s, t, i) lock_acquire_exclusive(l, s, t, NULL, i) #define rwsem_acquire_nest(l, s, t, n, i) lock_acquire_exclusive(l, s, t, n, i) #define rwsem_acquire_read(l, s, t, i) lock_acquire_shared(l, s, t, NULL, i) -#define rwsem_release(l, n, i) lock_release(l, n, i) +# define rwsem_release(l, n, i) lock_release(l, n, i) #define lock_map_acquire(l) lock_acquire_exclusive(l, 0, 0, NULL, _THIS_IP_) #define lock_map_acquire_read(l) lock_acquire_shared_recursive(l, 0, 0, NULL, _THIS_IP_) -#define lock_map_release(l) lock_release(l, 1, _THIS_IP_) +# define lock_map_release(l) lock_release(l, 1, _THIS_IP_) #ifdef CONFIG_PROVE_LOCKING # define might_lock(lock) \ diff --git a/include/linux/lockref.h b/include/linux/lockref.h index c8929c3..f279ed9 100644 --- a/include/linux/lockref.h +++ b/include/linux/lockref.h @@ -15,15 +15,10 @@ */ #include <linux/spinlock.h> -#include <generated/bounds.h> - -#define USE_CMPXCHG_LOCKREF \ - (IS_ENABLED(CONFIG_ARCH_USE_CMPXCHG_LOCKREF) && \ - IS_ENABLED(CONFIG_SMP) && !BLOATED_SPINLOCKS) struct lockref { union { -#if USE_CMPXCHG_LOCKREF +#ifdef CONFIG_CMPXCHG_LOCKREF aligned_u64 lock_count; #endif struct { @@ -41,10 +36,4 @@ extern int lockref_put_or_lock(struct lockref *); extern void lockref_mark_dead(struct lockref *); extern int lockref_get_not_dead(struct lockref *); -/* Must be called under spinlock for reliable results */ -static inline int __lockref_is_dead(const struct lockref *l) -{ - return ((int)l->count < 0); -} - #endif /* __LINUX_LOCKREF_H */ diff --git a/include/linux/memblock.h b/include/linux/memblock.h index 77c60e5..31e95ac 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h @@ -35,7 +35,6 @@ struct memblock_type { }; struct memblock { - bool bottom_up; /* is bottom up direction? */ phys_addr_t current_limit; struct memblock_type memory; struct memblock_type reserved; @@ -149,29 +148,6 @@ phys_addr_t memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align, int nid) phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align); -#ifdef CONFIG_MOVABLE_NODE -/* - * Set the allocation direction to bottom-up or top-down. - */ -static inline void memblock_set_bottom_up(bool enable) -{ - memblock.bottom_up = enable; -} - -/* - * Check if the allocation direction is bottom-up or not. - * if this is true, that said, memblock will allocate memory - * in bottom-up direction. - */ -static inline bool memblock_bottom_up(void) -{ - return memblock.bottom_up; -} -#else -static inline void memblock_set_bottom_up(bool enable) {} -static inline bool memblock_bottom_up(void) { return false; } -#endif - /* Flags for memblock_alloc_base() amd __memblock_alloc_base() */ #define MEMBLOCK_ALLOC_ANYWHERE (~(phys_addr_t)0) #define MEMBLOCK_ALLOC_ACCESSIBLE 0 diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 4ca3d95..dd38e62 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h @@ -94,8 +94,6 @@ extern void __online_page_set_limits(struct page *page); extern void __online_page_increment_counters(struct page *page); extern void __online_page_free(struct page *page); -extern int try_online_node(int nid); - #ifdef CONFIG_MEMORY_HOTREMOVE extern bool is_pageblock_removable_nolock(struct page *page); extern int arch_remove_memory(u64 start, u64 size); @@ -227,11 +225,6 @@ static inline void register_page_bootmem_info_node(struct pglist_data *pgdat) { } -static inline int try_online_node(int nid) -{ - return 0; -} - static inline void lock_memory_hotplug(void) {} static inline void unlock_memory_hotplug(void) {} @@ -263,12 +256,14 @@ static inline void remove_memory(int nid, u64 start, u64 size) {} extern int walk_memory_range(unsigned long start_pfn, unsigned long end_pfn, void *arg, int (*func)(struct memory_block *, void *)); +extern int mem_online_node(int nid); extern int add_memory(int nid, u64 start, u64 size); extern int arch_add_memory(int nid, u64 start, u64 size); extern int offline_pages(unsigned long start_pfn, unsigned long nr_pages); extern bool is_memblock_offlined(struct memory_block *mem); extern void remove_memory(int nid, u64 start, u64 size); -extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn); +extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn, + int nr_pages); extern void sparse_remove_one_section(struct zone *zone, struct mem_section *ms); extern struct page *sparse_decode_mem_map(unsigned long coded_mem_map, unsigned long pnum); diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index 9fe426b..da6716b 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h @@ -136,7 +136,6 @@ struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp, struct mempolicy *get_vma_policy(struct task_struct *tsk, struct vm_area_struct *vma, unsigned long addr); -bool vma_policy_mof(struct task_struct *task, struct vm_area_struct *vma); extern void numa_default_policy(void); extern void numa_policy_init(void); @@ -169,7 +168,7 @@ int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from, extern int mpol_parse_str(char *str, struct mempolicy **mpol); #endif -extern void mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol); +extern int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol); /* Check if a vma is migratable */ static inline int vma_migratable(struct vm_area_struct *vma) @@ -307,8 +306,9 @@ static inline int mpol_parse_str(char *str, struct mempolicy **mpol) } #endif -static inline void mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol) +static inline int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol) { + return 0; } static inline int mpol_misplaced(struct page *page, struct vm_area_struct *vma, diff --git a/include/linux/mfd/arizona/registers.h b/include/linux/mfd/arizona/registers.h index cb49417..4706d3d 100644 --- a/include/linux/mfd/arizona/registers.h +++ b/include/linux/mfd/arizona/registers.h @@ -1908,7 +1908,7 @@ #define ARIZONA_FLL2_SYNC_GAIN_MASK 0x003c /* FLL2_SYNC_GAIN */ #define ARIZONA_FLL2_SYNC_GAIN_SHIFT 2 /* FLL2_SYNC_GAIN */ #define ARIZONA_FLL2_SYNC_GAIN_WIDTH 4 /* FLL2_SYNC_GAIN */ -#define ARIZONA_FLL2_SYNC_BW 0x0001 /* FLL2_SYNC_BW */ +#define ARIZONA_FLL2_SYNC_BW_MASK 0x0001 /* FLL2_SYNC_BW */ #define ARIZONA_FLL2_SYNC_BW_MASK 0x0001 /* FLL2_SYNC_BW */ #define ARIZONA_FLL2_SYNC_BW_SHIFT 0 /* FLL2_SYNC_BW */ #define ARIZONA_FLL2_SYNC_BW_WIDTH 1 /* FLL2_SYNC_BW */ diff --git a/include/linux/mfd/as3722.h b/include/linux/mfd/as3722.h deleted file mode 100644 index 16bf8a0..0000000 --- a/include/linux/mfd/as3722.h +++ /dev/null @@ -1,423 +0,0 @@ -/* - * as3722 definitions - * - * Copyright (C) 2013 ams - * Copyright (c) 2013, NVIDIA Corporation. All rights reserved. - * - * Author: Florian Lobmaier <florian.lobmaier@ams.com> - * Author: Laxman Dewangan <ldewangan@nvidia.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#ifndef __LINUX_MFD_AS3722_H__ -#define __LINUX_MFD_AS3722_H__ - -#include <linux/regmap.h> - -/* AS3722 registers */ -#define AS3722_SD0_VOLTAGE_REG 0x00 -#define AS3722_SD1_VOLTAGE_REG 0x01 -#define AS3722_SD2_VOLTAGE_REG 0x02 -#define AS3722_SD3_VOLTAGE_REG 0x03 -#define AS3722_SD4_VOLTAGE_REG 0x04 -#define AS3722_SD5_VOLTAGE_REG 0x05 -#define AS3722_SD6_VOLTAGE_REG 0x06 -#define AS3722_GPIO0_CONTROL_REG 0x08 -#define AS3722_GPIO1_CONTROL_REG 0x09 -#define AS3722_GPIO2_CONTROL_REG 0x0A -#define AS3722_GPIO3_CONTROL_REG 0x0B -#define AS3722_GPIO4_CONTROL_REG 0x0C -#define AS3722_GPIO5_CONTROL_REG 0x0D -#define AS3722_GPIO6_CONTROL_REG 0x0E -#define AS3722_GPIO7_CONTROL_REG 0x0F -#define AS3722_LDO0_VOLTAGE_REG 0x10 -#define AS3722_LDO1_VOLTAGE_REG 0x11 -#define AS3722_LDO2_VOLTAGE_REG 0x12 -#define AS3722_LDO3_VOLTAGE_REG 0x13 -#define AS3722_LDO4_VOLTAGE_REG 0x14 -#define AS3722_LDO5_VOLTAGE_REG 0x15 -#define AS3722_LDO6_VOLTAGE_REG 0x16 -#define AS3722_LDO7_VOLTAGE_REG 0x17 -#define AS3722_LDO9_VOLTAGE_REG 0x19 -#define AS3722_LDO10_VOLTAGE_REG 0x1A -#define AS3722_LDO11_VOLTAGE_REG 0x1B -#define AS3722_GPIO_DEB1_REG 0x1E -#define AS3722_GPIO_DEB2_REG 0x1F -#define AS3722_GPIO_SIGNAL_OUT_REG 0x20 -#define AS3722_GPIO_SIGNAL_IN_REG 0x21 -#define AS3722_REG_SEQU_MOD1_REG 0x22 -#define AS3722_REG_SEQU_MOD2_REG 0x23 -#define AS3722_REG_SEQU_MOD3_REG 0x24 -#define AS3722_SD_PHSW_CTRL_REG 0x27 -#define AS3722_SD_PHSW_STATUS 0x28 -#define AS3722_SD0_CONTROL_REG 0x29 -#define AS3722_SD1_CONTROL_REG 0x2A -#define AS3722_SDmph_CONTROL_REG 0x2B -#define AS3722_SD23_CONTROL_REG 0x2C -#define AS3722_SD4_CONTROL_REG 0x2D -#define AS3722_SD5_CONTROL_REG 0x2E -#define AS3722_SD6_CONTROL_REG 0x2F -#define AS3722_SD_DVM_REG 0x30 -#define AS3722_RESET_REASON_REG 0x31 -#define AS3722_BATTERY_VOLTAGE_MONITOR_REG 0x32 -#define AS3722_STARTUP_CONTROL_REG 0x33 -#define AS3722_RESET_TIMER_REG 0x34 -#define AS3722_REFERENCE_CONTROL_REG 0x35 -#define AS3722_RESET_CONTROL_REG 0x36 -#define AS3722_OVER_TEMP_CONTROL_REG 0x37 -#define AS3722_WATCHDOG_CONTROL_REG 0x38 -#define AS3722_REG_STANDBY_MOD1_REG 0x39 -#define AS3722_REG_STANDBY_MOD2_REG 0x3A -#define AS3722_REG_STANDBY_MOD3_REG 0x3B -#define AS3722_ENABLE_CTRL1_REG 0x3C -#define AS3722_ENABLE_CTRL2_REG 0x3D -#define AS3722_ENABLE_CTRL3_REG 0x3E -#define AS3722_ENABLE_CTRL4_REG 0x3F -#define AS3722_ENABLE_CTRL5_REG 0x40 -#define AS3722_PWM_CONTROL_L_REG 0x41 -#define AS3722_PWM_CONTROL_H_REG 0x42 -#define AS3722_WATCHDOG_TIMER_REG 0x46 -#define AS3722_WATCHDOG_SOFTWARE_SIGNAL_REG 0x48 -#define AS3722_IOVOLTAGE_REG 0x49 -#define AS3722_BATTERY_VOLTAGE_MONITOR2_REG 0x4A -#define AS3722_SD_CONTROL_REG 0x4D -#define AS3722_LDOCONTROL0_REG 0x4E -#define AS3722_LDOCONTROL1_REG 0x4F -#define AS3722_SD0_PROTECT_REG 0x50 -#define AS3722_SD6_PROTECT_REG 0x51 -#define AS3722_PWM_VCONTROL1_REG 0x52 -#define AS3722_PWM_VCONTROL2_REG 0x53 -#define AS3722_PWM_VCONTROL3_REG 0x54 -#define AS3722_PWM_VCONTROL4_REG 0x55 -#define AS3722_BB_CHARGER_REG 0x57 -#define AS3722_CTRL_SEQU1_REG 0x58 -#define AS3722_CTRL_SEQU2_REG 0x59 -#define AS3722_OVCURRENT_REG 0x5A -#define AS3722_OVCURRENT_DEB_REG 0x5B -#define AS3722_SDLV_DEB_REG 0x5C -#define AS3722_OC_PG_CTRL_REG 0x5D -#define AS3722_OC_PG_CTRL2_REG 0x5E -#define AS3722_CTRL_STATUS 0x5F -#define AS3722_RTC_CONTROL_REG 0x60 -#define AS3722_RTC_SECOND_REG 0x61 -#define AS3722_RTC_MINUTE_REG 0x62 -#define AS3722_RTC_HOUR_REG 0x63 -#define AS3722_RTC_DAY_REG 0x64 -#define AS3722_RTC_MONTH_REG 0x65 -#define AS3722_RTC_YEAR_REG 0x66 -#define AS3722_RTC_ALARM_SECOND_REG 0x67 -#define AS3722_RTC_ALARM_MINUTE_REG 0x68 -#define AS3722_RTC_ALARM_HOUR_REG 0x69 -#define AS3722_RTC_ALARM_DAY_REG 0x6A -#define AS3722_RTC_ALARM_MONTH_REG 0x6B -#define AS3722_RTC_ALARM_YEAR_REG 0x6C -#define AS3722_SRAM_REG 0x6D -#define AS3722_RTC_ACCESS_REG 0x6F -#define AS3722_RTC_STATUS_REG 0x73 -#define AS3722_INTERRUPT_MASK1_REG 0x74 -#define AS3722_INTERRUPT_MASK2_REG 0x75 -#define AS3722_INTERRUPT_MASK3_REG 0x76 -#define AS3722_INTERRUPT_MASK4_REG 0x77 -#define AS3722_INTERRUPT_STATUS1_REG 0x78 -#define AS3722_INTERRUPT_STATUS2_REG 0x79 -#define AS3722_INTERRUPT_STATUS3_REG 0x7A -#define AS3722_INTERRUPT_STATUS4_REG 0x7B -#define AS3722_TEMP_STATUS_REG 0x7D -#define AS3722_ADC0_CONTROL_REG 0x80 -#define AS3722_ADC1_CONTROL_REG 0x81 -#define AS3722_ADC0_MSB_RESULT_REG 0x82 -#define AS3722_ADC0_LSB_RESULT_REG 0x83 -#define AS3722_ADC1_MSB_RESULT_REG 0x84 -#define AS3722_ADC1_LSB_RESULT_REG 0x85 -#define AS3722_ADC1_THRESHOLD_HI_MSB_REG 0x86 -#define AS3722_ADC1_THRESHOLD_HI_LSB_REG 0x87 -#define AS3722_ADC1_THRESHOLD_LO_MSB_REG 0x88 -#define AS3722_ADC1_THRESHOLD_LO_LSB_REG 0x89 -#define AS3722_ADC_CONFIGURATION_REG 0x8A -#define AS3722_ASIC_ID1_REG 0x90 -#define AS3722_ASIC_ID2_REG 0x91 -#define AS3722_LOCK_REG 0x9E -#define AS3722_MAX_REGISTER 0xF4 - -#define AS3722_SD0_EXT_ENABLE_MASK 0x03 -#define AS3722_SD1_EXT_ENABLE_MASK 0x0C -#define AS3722_SD2_EXT_ENABLE_MASK 0x30 -#define AS3722_SD3_EXT_ENABLE_MASK 0xC0 -#define AS3722_SD4_EXT_ENABLE_MASK 0x03 -#define AS3722_SD5_EXT_ENABLE_MASK 0x0C -#define AS3722_SD6_EXT_ENABLE_MASK 0x30 -#define AS3722_LDO0_EXT_ENABLE_MASK 0x03 -#define AS3722_LDO1_EXT_ENABLE_MASK 0x0C -#define AS3722_LDO2_EXT_ENABLE_MASK 0x30 -#define AS3722_LDO3_EXT_ENABLE_MASK 0xC0 -#define AS3722_LDO4_EXT_ENABLE_MASK 0x03 -#define AS3722_LDO5_EXT_ENABLE_MASK 0x0C -#define AS3722_LDO6_EXT_ENABLE_MASK 0x30 -#define AS3722_LDO7_EXT_ENABLE_MASK 0xC0 -#define AS3722_LDO9_EXT_ENABLE_MASK 0x0C -#define AS3722_LDO10_EXT_ENABLE_MASK 0x30 -#define AS3722_LDO11_EXT_ENABLE_MASK 0xC0 - -#define AS3722_OVCURRENT_SD0_ALARM_MASK 0x07 -#define AS3722_OVCURRENT_SD0_ALARM_SHIFT 0x01 -#define AS3722_OVCURRENT_SD0_TRIP_MASK 0x18 -#define AS3722_OVCURRENT_SD0_TRIP_SHIFT 0x03 -#define AS3722_OVCURRENT_SD1_TRIP_MASK 0x60 -#define AS3722_OVCURRENT_SD1_TRIP_SHIFT 0x05 - -#define AS3722_OVCURRENT_SD6_ALARM_MASK 0x07 -#define AS3722_OVCURRENT_SD6_ALARM_SHIFT 0x01 -#define AS3722_OVCURRENT_SD6_TRIP_MASK 0x18 -#define AS3722_OVCURRENT_SD6_TRIP_SHIFT 0x03 - -/* AS3722 register bits and bit masks */ -#define AS3722_LDO_ILIMIT_MASK BIT(7) -#define AS3722_LDO_ILIMIT_BIT BIT(7) -#define AS3722_LDO0_VSEL_MASK 0x1F -#define AS3722_LDO0_VSEL_MIN 0x01 -#define AS3722_LDO0_VSEL_MAX 0x12 -#define AS3722_LDO0_NUM_VOLT 0x12 -#define AS3722_LDO3_VSEL_MASK 0x3F -#define AS3722_LDO3_VSEL_MIN 0x01 -#define AS3722_LDO3_VSEL_MAX 0x2D -#define AS3722_LDO3_NUM_VOLT 0x2D -#define AS3722_LDO_VSEL_MASK 0x7F -#define AS3722_LDO_VSEL_MIN 0x01 -#define AS3722_LDO_VSEL_MAX 0x7F -#define AS3722_LDO_VSEL_DNU_MIN 0x25 -#define AS3722_LDO_VSEL_DNU_MAX 0x3F -#define AS3722_LDO_NUM_VOLT 0x80 - -#define AS3722_LDO0_CTRL BIT(0) -#define AS3722_LDO1_CTRL BIT(1) -#define AS3722_LDO2_CTRL BIT(2) -#define AS3722_LDO3_CTRL BIT(3) -#define AS3722_LDO4_CTRL BIT(4) -#define AS3722_LDO5_CTRL BIT(5) -#define AS3722_LDO6_CTRL BIT(6) -#define AS3722_LDO7_CTRL BIT(7) -#define AS3722_LDO9_CTRL BIT(1) -#define AS3722_LDO10_CTRL BIT(2) -#define AS3722_LDO11_CTRL BIT(3) - -#define AS3722_LDO3_MODE_MASK (3 << 6) -#define AS3722_LDO3_MODE_VAL(n) (((n) & 0x3) << 6) -#define AS3722_LDO3_MODE_PMOS AS3722_LDO3_MODE_VAL(0) -#define AS3722_LDO3_MODE_PMOS_TRACKING AS3722_LDO3_MODE_VAL(1) -#define AS3722_LDO3_MODE_NMOS AS3722_LDO3_MODE_VAL(2) -#define AS3722_LDO3_MODE_SWITCH AS3722_LDO3_MODE_VAL(3) - -#define AS3722_SD_VSEL_MASK 0x7F -#define AS3722_SD0_VSEL_MIN 0x01 -#define AS3722_SD0_VSEL_MAX 0x5A -#define AS3722_SD2_VSEL_MIN 0x01 -#define AS3722_SD2_VSEL_MAX 0x7F - -#define AS3722_SDn_CTRL(n) BIT(n) - -#define AS3722_SD0_MODE_FAST BIT(4) -#define AS3722_SD1_MODE_FAST BIT(4) -#define AS3722_SD2_MODE_FAST BIT(2) -#define AS3722_SD3_MODE_FAST BIT(6) -#define AS3722_SD4_MODE_FAST BIT(2) -#define AS3722_SD5_MODE_FAST BIT(2) -#define AS3722_SD6_MODE_FAST BIT(4) - -#define AS3722_POWER_OFF BIT(1) - -#define AS3722_INTERRUPT_MASK1_LID BIT(0) -#define AS3722_INTERRUPT_MASK1_ACOK BIT(1) -#define AS3722_INTERRUPT_MASK1_ENABLE1 BIT(2) -#define AS3722_INTERRUPT_MASK1_OCURR_ALARM_SD0 BIT(3) -#define AS3722_INTERRUPT_MASK1_ONKEY_LONG BIT(4) -#define AS3722_INTERRUPT_MASK1_ONKEY BIT(5) -#define AS3722_INTERRUPT_MASK1_OVTMP BIT(6) -#define AS3722_INTERRUPT_MASK1_LOWBAT BIT(7) - -#define AS3722_INTERRUPT_MASK2_SD0_LV BIT(0) -#define AS3722_INTERRUPT_MASK2_SD1_LV BIT(1) -#define AS3722_INTERRUPT_MASK2_SD2345_LV BIT(2) -#define AS3722_INTERRUPT_MASK2_PWM1_OV_PROT BIT(3) -#define AS3722_INTERRUPT_MASK2_PWM2_OV_PROT BIT(4) -#define AS3722_INTERRUPT_MASK2_ENABLE2 BIT(5) -#define AS3722_INTERRUPT_MASK2_SD6_LV BIT(6) -#define AS3722_INTERRUPT_MASK2_RTC_REP BIT(7) - -#define AS3722_INTERRUPT_MASK3_RTC_ALARM BIT(0) -#define AS3722_INTERRUPT_MASK3_GPIO1 BIT(1) -#define AS3722_INTERRUPT_MASK3_GPIO2 BIT(2) -#define AS3722_INTERRUPT_MASK3_GPIO3 BIT(3) -#define AS3722_INTERRUPT_MASK3_GPIO4 BIT(4) -#define AS3722_INTERRUPT_MASK3_GPIO5 BIT(5) -#define AS3722_INTERRUPT_MASK3_WATCHDOG BIT(6) -#define AS3722_INTERRUPT_MASK3_ENABLE3 BIT(7) - -#define AS3722_INTERRUPT_MASK4_TEMP_SD0_SHUTDOWN BIT(0) -#define AS3722_INTERRUPT_MASK4_TEMP_SD1_SHUTDOWN BIT(1) -#define AS3722_INTERRUPT_MASK4_TEMP_SD6_SHUTDOWN BIT(2) -#define AS3722_INTERRUPT_MASK4_TEMP_SD0_ALARM BIT(3) -#define AS3722_INTERRUPT_MASK4_TEMP_SD1_ALARM BIT(4) -#define AS3722_INTERRUPT_MASK4_TEMP_SD6_ALARM BIT(5) -#define AS3722_INTERRUPT_MASK4_OCCUR_ALARM_SD6 BIT(6) -#define AS3722_INTERRUPT_MASK4_ADC BIT(7) - -#define AS3722_ADC1_INTERVAL_TIME BIT(0) -#define AS3722_ADC1_INT_MODE_ON BIT(1) -#define AS3722_ADC_BUF_ON BIT(2) -#define AS3722_ADC1_LOW_VOLTAGE_RANGE BIT(5) -#define AS3722_ADC1_INTEVAL_SCAN BIT(6) -#define AS3722_ADC1_INT_MASK BIT(7) - -#define AS3722_ADC_MSB_VAL_MASK 0x7F -#define AS3722_ADC_LSB_VAL_MASK 0x07 - -#define AS3722_ADC0_CONV_START BIT(7) -#define AS3722_ADC0_CONV_NOTREADY BIT(7) -#define AS3722_ADC0_SOURCE_SELECT_MASK 0x1F - -#define AS3722_ADC1_CONV_START BIT(7) -#define AS3722_ADC1_CONV_NOTREADY BIT(7) -#define AS3722_ADC1_SOURCE_SELECT_MASK 0x1F - -/* GPIO modes */ -#define AS3722_GPIO_MODE_MASK 0x07 -#define AS3722_GPIO_MODE_INPUT 0x00 -#define AS3722_GPIO_MODE_OUTPUT_VDDH 0x01 -#define AS3722_GPIO_MODE_IO_OPEN_DRAIN 0x02 -#define AS3722_GPIO_MODE_ADC_IN 0x03 -#define AS3722_GPIO_MODE_INPUT_PULL_UP 0x04 -#define AS3722_GPIO_MODE_INPUT_PULL_DOWN 0x05 -#define AS3722_GPIO_MODE_IO_OPEN_DRAIN_PULL_UP 0x06 -#define AS3722_GPIO_MODE_OUTPUT_VDDL 0x07 -#define AS3722_GPIO_MODE_VAL(n) ((n) & AS3722_GPIO_MODE_MASK) - -#define AS3722_GPIO_INV BIT(7) -#define AS3722_GPIO_IOSF_MASK 0x78 -#define AS3722_GPIO_IOSF_VAL(n) (((n) & 0xF) << 3) -#define AS3722_GPIO_IOSF_NORMAL AS3722_GPIO_IOSF_VAL(0) -#define AS3722_GPIO_IOSF_INTERRUPT_OUT AS3722_GPIO_IOSF_VAL(1) -#define AS3722_GPIO_IOSF_VSUP_LOW_OUT AS3722_GPIO_IOSF_VAL(2) -#define AS3722_GPIO_IOSF_GPIO_INTERRUPT_IN AS3722_GPIO_IOSF_VAL(3) -#define AS3722_GPIO_IOSF_ISINK_PWM_IN AS3722_GPIO_IOSF_VAL(4) -#define AS3722_GPIO_IOSF_VOLTAGE_STBY AS3722_GPIO_IOSF_VAL(5) -#define AS3722_GPIO_IOSF_PWR_GOOD_OUT AS3722_GPIO_IOSF_VAL(7) -#define AS3722_GPIO_IOSF_Q32K_OUT AS3722_GPIO_IOSF_VAL(8) -#define AS3722_GPIO_IOSF_WATCHDOG_IN AS3722_GPIO_IOSF_VAL(9) -#define AS3722_GPIO_IOSF_SOFT_RESET_IN AS3722_GPIO_IOSF_VAL(11) -#define AS3722_GPIO_IOSF_PWM_OUT AS3722_GPIO_IOSF_VAL(12) -#define AS3722_GPIO_IOSF_VSUP_LOW_DEB_OUT AS3722_GPIO_IOSF_VAL(13) -#define AS3722_GPIO_IOSF_SD6_LOW_VOLT_LOW AS3722_GPIO_IOSF_VAL(14) - -#define AS3722_GPIOn_SIGNAL(n) BIT(n) -#define AS3722_GPIOn_CONTROL_REG(n) (AS3722_GPIO0_CONTROL_REG + n) -#define AS3722_I2C_PULL_UP BIT(4) -#define AS3722_INT_PULL_UP BIT(5) - -#define AS3722_RTC_REP_WAKEUP_EN BIT(0) -#define AS3722_RTC_ALARM_WAKEUP_EN BIT(1) -#define AS3722_RTC_ON BIT(2) -#define AS3722_RTC_IRQMODE BIT(3) -#define AS3722_RTC_CLK32K_OUT_EN BIT(5) - -#define AS3722_WATCHDOG_TIMER_MAX 0x7F -#define AS3722_WATCHDOG_ON BIT(0) -#define AS3722_WATCHDOG_SW_SIG BIT(0) - -#define AS3722_EXT_CONTROL_ENABLE1 0x1 -#define AS3722_EXT_CONTROL_ENABLE2 0x2 -#define AS3722_EXT_CONTROL_ENABLE3 0x3 - -/* Interrupt IDs */ -enum as3722_irq { - AS3722_IRQ_LID, - AS3722_IRQ_ACOK, - AS3722_IRQ_ENABLE1, - AS3722_IRQ_OCCUR_ALARM_SD0, - AS3722_IRQ_ONKEY_LONG_PRESS, - AS3722_IRQ_ONKEY, - AS3722_IRQ_OVTMP, - AS3722_IRQ_LOWBAT, - AS3722_IRQ_SD0_LV, - AS3722_IRQ_SD1_LV, - AS3722_IRQ_SD2_LV, - AS3722_IRQ_PWM1_OV_PROT, - AS3722_IRQ_PWM2_OV_PROT, - AS3722_IRQ_ENABLE2, - AS3722_IRQ_SD6_LV, - AS3722_IRQ_RTC_REP, - AS3722_IRQ_RTC_ALARM, - AS3722_IRQ_GPIO1, - AS3722_IRQ_GPIO2, - AS3722_IRQ_GPIO3, - AS3722_IRQ_GPIO4, - AS3722_IRQ_GPIO5, - AS3722_IRQ_WATCHDOG, - AS3722_IRQ_ENABLE3, - AS3722_IRQ_TEMP_SD0_SHUTDOWN, - AS3722_IRQ_TEMP_SD1_SHUTDOWN, - AS3722_IRQ_TEMP_SD2_SHUTDOWN, - AS3722_IRQ_TEMP_SD0_ALARM, - AS3722_IRQ_TEMP_SD1_ALARM, - AS3722_IRQ_TEMP_SD6_ALARM, - AS3722_IRQ_OCCUR_ALARM_SD6, - AS3722_IRQ_ADC, - AS3722_IRQ_MAX, -}; - -struct as3722 { - struct device *dev; - struct regmap *regmap; - int chip_irq; - unsigned long irq_flags; - bool en_intern_int_pullup; - bool en_intern_i2c_pullup; - struct regmap_irq_chip_data *irq_data; -}; - -static inline int as3722_read(struct as3722 *as3722, u32 reg, u32 *dest) -{ - return regmap_read(as3722->regmap, reg, dest); -} - -static inline int as3722_write(struct as3722 *as3722, u32 reg, u32 value) -{ - return regmap_write(as3722->regmap, reg, value); -} - -static inline int as3722_block_read(struct as3722 *as3722, u32 reg, - int count, u8 *buf) -{ - return regmap_bulk_read(as3722->regmap, reg, buf, count); -} - -static inline int as3722_block_write(struct as3722 *as3722, u32 reg, - int count, u8 *data) -{ - return regmap_bulk_write(as3722->regmap, reg, data, count); -} - -static inline int as3722_update_bits(struct as3722 *as3722, u32 reg, - u32 mask, u8 val) -{ - return regmap_update_bits(as3722->regmap, reg, mask, val); -} - -static inline int as3722_irq_get_virq(struct as3722 *as3722, int irq) -{ - return regmap_irq_get_virq(as3722->irq_data, irq); -} -#endif /* __LINUX_MFD_AS3722_H__ */ diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index bdba8c6..cebe97e 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h @@ -59,12 +59,6 @@ struct mfd_cell { * pm_runtime_no_callbacks(). */ bool pm_runtime_no_callbacks; - - /* A list of regulator supplies that should be mapped to the MFD - * device rather than the child device when requested - */ - const char **parent_supplies; - int num_parent_supplies; }; /* @@ -104,7 +98,7 @@ static inline const struct mfd_cell *mfd_get_cell(struct platform_device *pdev) } extern int mfd_add_devices(struct device *parent, int id, - const struct mfd_cell *cells, int n_devs, + struct mfd_cell *cells, int n_devs, struct resource *mem_base, int irq_base, struct irq_domain *irq_domain); diff --git a/include/linux/mfd/da9052/da9052.h b/include/linux/mfd/da9052/da9052.h index 21e21b8..786d02e 100644 --- a/include/linux/mfd/da9052/da9052.h +++ b/include/linux/mfd/da9052/da9052.h @@ -148,15 +148,10 @@ static inline int da9052_group_read(struct da9052 *da9052, unsigned char reg, unsigned reg_cnt, unsigned char *val) { int ret; - unsigned int tmp; - int i; - for (i = 0; i < reg_cnt; i++) { - ret = regmap_read(da9052->regmap, reg + i, &tmp); - val[i] = (unsigned char)tmp; - if (ret < 0) - return ret; - } + ret = regmap_bulk_read(da9052->regmap, reg, val, reg_cnt); + if (ret < 0) + return ret; if (da9052->fix_io) { ret = da9052->fix_io(da9052, reg); @@ -171,13 +166,10 @@ static inline int da9052_group_write(struct da9052 *da9052, unsigned char reg, unsigned reg_cnt, unsigned char *val) { int ret; - int i; - for (i = 0; i < reg_cnt; i++) { - ret = regmap_write(da9052->regmap, reg + i, val[i]); - if (ret < 0) - return ret; - } + ret = regmap_raw_write(da9052->regmap, reg, val, reg_cnt); + if (ret < 0) + return ret; if (da9052->fix_io) { ret = da9052->fix_io(da9052, reg); diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h index 060e112..ca0790f 100644 --- a/include/linux/mfd/dbx500-prcmu.h +++ b/include/linux/mfd/dbx500-prcmu.h @@ -12,8 +12,6 @@ #include <linux/notifier.h> #include <linux/err.h> -#include <dt-bindings/mfd/dbx500-prcmu.h> /* For clock identifiers */ - /* Offset for the firmware version within the TCPM */ #define DB8500_PRCMU_FW_VERSION_OFFSET 0xA4 #define DBX540_PRCMU_FW_VERSION_OFFSET 0xA8 @@ -96,6 +94,74 @@ enum prcmu_wakeup_index { #define PRCMU_CLKSRC_ARMCLKFIX 0x46 #define PRCMU_CLKSRC_HDMICLK 0x47 +/* + * Clock identifiers. + */ +enum prcmu_clock { + PRCMU_SGACLK, + PRCMU_UARTCLK, + PRCMU_MSP02CLK, + PRCMU_MSP1CLK, + PRCMU_I2CCLK, + PRCMU_SDMMCCLK, + PRCMU_SPARE1CLK, + PRCMU_SLIMCLK, + PRCMU_PER1CLK, + PRCMU_PER2CLK, + PRCMU_PER3CLK, + PRCMU_PER5CLK, + PRCMU_PER6CLK, + PRCMU_PER7CLK, + PRCMU_LCDCLK, + PRCMU_BMLCLK, + PRCMU_HSITXCLK, + PRCMU_HSIRXCLK, + PRCMU_HDMICLK, + PRCMU_APEATCLK, + PRCMU_APETRACECLK, + PRCMU_MCDECLK, + PRCMU_IPI2CCLK, + PRCMU_DSIALTCLK, + PRCMU_DMACLK, + PRCMU_B2R2CLK, + PRCMU_TVCLK, + PRCMU_SSPCLK, + PRCMU_RNGCLK, + PRCMU_UICCCLK, + PRCMU_PWMCLK, + PRCMU_IRDACLK, + PRCMU_IRRCCLK, + PRCMU_SIACLK, + PRCMU_SVACLK, + PRCMU_ACLK, + PRCMU_HVACLK, /* Ux540 only */ + PRCMU_G1CLK, /* Ux540 only */ + PRCMU_SDMMCHCLK, + PRCMU_CAMCLK, + PRCMU_BML8580CLK, + PRCMU_NUM_REG_CLOCKS, + PRCMU_SYSCLK = PRCMU_NUM_REG_CLOCKS, + PRCMU_CDCLK, + PRCMU_TIMCLK, + PRCMU_PLLSOC0, + PRCMU_PLLSOC1, + PRCMU_ARMSS, + PRCMU_PLLDDR, + PRCMU_PLLDSI, + PRCMU_DSI0CLK, + PRCMU_DSI1CLK, + PRCMU_DSI0ESCCLK, + PRCMU_DSI1ESCCLK, + PRCMU_DSI2ESCCLK, + /* LCD DSI PLL - Ux540 only */ + PRCMU_PLLDSI_LCD, + PRCMU_DSI0CLK_LCD, + PRCMU_DSI1CLK_LCD, + PRCMU_DSI0ESCCLK_LCD, + PRCMU_DSI1ESCCLK_LCD, + PRCMU_DSI2ESCCLK_LCD, +}; + /** * enum prcmu_wdog_id - PRCMU watchdog IDs * @PRCMU_WDOG_ALL: use all timers diff --git a/include/linux/mfd/max77693-private.h b/include/linux/mfd/max77693-private.h index 3e050b9..244fb0d 100644 --- a/include/linux/mfd/max77693-private.h +++ b/include/linux/mfd/max77693-private.h @@ -323,6 +323,7 @@ struct max77693_dev { int irq; int irq_gpio; + bool wakeup; struct mutex irqlock; int irq_masks_cur[MAX77693_IRQ_GROUP_NR]; int irq_masks_cache[MAX77693_IRQ_GROUP_NR]; diff --git a/include/linux/mfd/max77693.h b/include/linux/mfd/max77693.h index 3f3dc45..676f0f3 100644 --- a/include/linux/mfd/max77693.h +++ b/include/linux/mfd/max77693.h @@ -64,6 +64,8 @@ struct max77693_muic_platform_data { }; struct max77693_platform_data { + int wakeup; + /* regulator data */ struct max77693_regulator_data *regulators; int num_regulators; diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h index 67c17b5..41ed592 100644 --- a/include/linux/mfd/mc13xxx.h +++ b/include/linux/mfd/mc13xxx.h @@ -41,13 +41,6 @@ int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx, unsigned int mode, unsigned int channel, u8 ato, bool atox, unsigned int *sample); -#define MC13783_AUDIO_RX0 36 -#define MC13783_AUDIO_RX1 37 -#define MC13783_AUDIO_TX 38 -#define MC13783_SSI_NETWORK 39 -#define MC13783_AUDIO_CODEC 40 -#define MC13783_AUDIO_DAC 41 - #define MC13XXX_IRQ_ADCDONE 0 #define MC13XXX_IRQ_ADCBISDONE 1 #define MC13XXX_IRQ_TS 2 diff --git a/include/linux/mfd/rtsx_pci.h b/include/linux/mfd/rtsx_pci.h index 0ce7721..d1382df 100644 --- a/include/linux/mfd/rtsx_pci.h +++ b/include/linux/mfd/rtsx_pci.h @@ -756,59 +756,6 @@ #define PCR_SETTING_REG2 0x814 #define PCR_SETTING_REG3 0x747 -/* Phy bits */ -#define PHY_PCR_FORCE_CODE 0xB000 -#define PHY_PCR_OOBS_CALI_50 0x0800 -#define PHY_PCR_OOBS_VCM_08 0x0200 -#define PHY_PCR_OOBS_SEN_90 0x0040 -#define PHY_PCR_RSSI_EN 0x0002 - -#define PHY_RCR1_ADP_TIME 0x0100 -#define PHY_RCR1_VCO_COARSE 0x001F - -#define PHY_RCR2_EMPHASE_EN 0x8000 -#define PHY_RCR2_NADJR 0x4000 -#define PHY_RCR2_CDR_CP_10 0x0400 -#define PHY_RCR2_CDR_SR_2 0x0100 -#define PHY_RCR2_FREQSEL_12 0x0040 -#define PHY_RCR2_CPADJEN 0x0020 -#define PHY_RCR2_CDR_SC_8 0x0008 -#define PHY_RCR2_CALIB_LATE 0x0002 - -#define PHY_RDR_RXDSEL_1_9 0x4000 - -#define PHY_TUNE_TUNEREF_1_0 0x4000 -#define PHY_TUNE_VBGSEL_1252 0x0C00 -#define PHY_TUNE_SDBUS_33 0x0200 -#define PHY_TUNE_TUNED18 0x01C0 -#define PHY_TUNE_TUNED12 0X0020 - -#define PHY_BPCR_IBRXSEL 0x0400 -#define PHY_BPCR_IBTXSEL 0x0100 -#define PHY_BPCR_IB_FILTER 0x0080 -#define PHY_BPCR_CMIRROR_EN 0x0040 - -#define PHY_REG_REV_RESV 0xE000 -#define PHY_REG_REV_RXIDLE_LATCHED 0x1000 -#define PHY_REG_REV_P1_EN 0x0800 -#define PHY_REG_REV_RXIDLE_EN 0x0400 -#define PHY_REG_REV_CLKREQ_DLY_TIMER_1_0 0x0040 -#define PHY_REG_REV_STOP_CLKRD 0x0020 -#define PHY_REG_REV_RX_PWST 0x0008 -#define PHY_REG_REV_STOP_CLKWR 0x0004 - -#define PHY_FLD3_TIMER_4 0x7800 -#define PHY_FLD3_TIMER_6 0x00E0 -#define PHY_FLD3_RXDELINK 0x0004 - -#define PHY_FLD4_FLDEN_SEL 0x4000 -#define PHY_FLD4_REQ_REF 0x2000 -#define PHY_FLD4_RXAMP_OFF 0x1000 -#define PHY_FLD4_REQ_ADDA 0x0800 -#define PHY_FLD4_BER_COUNT 0x00E0 -#define PHY_FLD4_BER_TIMER 0x000A -#define PHY_FLD4_BER_CHK_EN 0x0001 - #define rtsx_pci_init_cmd(pcr) ((pcr)->ci = 0) struct rtsx_pcr; diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h index 2d0c907..378ae8a 100644 --- a/include/linux/mfd/samsung/core.h +++ b/include/linux/mfd/samsung/core.h @@ -51,7 +51,6 @@ struct sec_pmic_dev { int ono; int type; bool wakeup; - bool wtsr_smpl; }; int sec_irq_init(struct sec_pmic_dev *sec_pmic); diff --git a/include/linux/mfd/samsung/rtc.h b/include/linux/mfd/samsung/rtc.h index 94b7cd6..71597e2 100644 --- a/include/linux/mfd/samsung/rtc.h +++ b/include/linux/mfd/samsung/rtc.h @@ -62,11 +62,6 @@ enum sec_rtc_reg { /* RTC Update Register1 */ #define RTC_UDR_SHIFT 0 #define RTC_UDR_MASK (1 << RTC_UDR_SHIFT) -#define RTC_TCON_SHIFT 1 -#define RTC_TCON_MASK (1 << RTC_TCON_SHIFT) -#define RTC_TIME_EN_SHIFT 3 -#define RTC_TIME_EN_MASK (1 << RTC_TIME_EN_SHIFT) - /* RTC Hour register */ #define HOUR_PM_SHIFT 6 #define HOUR_PM_MASK (1 << HOUR_PM_SHIFT) @@ -74,12 +69,6 @@ enum sec_rtc_reg { #define ALARM_ENABLE_SHIFT 7 #define ALARM_ENABLE_MASK (1 << ALARM_ENABLE_SHIFT) -#define SMPL_ENABLE_SHIFT 7 -#define SMPL_ENABLE_MASK (1 << SMPL_ENABLE_SHIFT) - -#define WTSR_ENABLE_SHIFT 6 -#define WTSR_ENABLE_MASK (1 << WTSR_ENABLE_SHIFT) - enum { RTC_SEC = 0, RTC_MIN, diff --git a/include/linux/mfd/si476x-core.h b/include/linux/mfd/si476x-core.h index 674b45d..ba89b94 100644 --- a/include/linux/mfd/si476x-core.h +++ b/include/linux/mfd/si476x-core.h @@ -316,7 +316,7 @@ enum si476x_smoothmetrics { * response to 'FM_RD_STATUS' command * @rdstpptyint: Traffic program flag(TP) and/or program type(PTY) * code has changed. - * @rdspiint: Program identification(PI) code has changed. + * @rdspiint: Program indentifiaction(PI) code has changed. * @rdssyncint: RDS synchronization has changed. * @rdsfifoint: RDS was received and the RDS FIFO has at least * 'FM_RDS_INTERRUPT_FIFO_COUNT' elements in it. diff --git a/include/linux/mfd/stw481x.h b/include/linux/mfd/stw481x.h deleted file mode 100644 index eda1215..0000000 --- a/include/linux/mfd/stw481x.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2011 ST-Ericsson SA - * Written on behalf of Linaro for ST-Ericsson - * - * Author: Linus Walleij <linus.walleij@linaro.org> - * - * License terms: GNU General Public License (GPL) version 2 - */ -#ifndef MFD_STW481X_H -#define MFD_STW481X_H - -#include <linux/i2c.h> -#include <linux/regulator/machine.h> -#include <linux/regmap.h> -#include <linux/bitops.h> - -/* These registers are accessed from more than one driver */ -#define STW_CONF1 0x11U -#define STW_CONF1_PDN_VMMC 0x01U -#define STW_CONF1_VMMC_MASK 0x0eU -#define STW_CONF1_VMMC_1_8V 0x02U -#define STW_CONF1_VMMC_2_85V 0x04U -#define STW_CONF1_VMMC_3V 0x06U -#define STW_CONF1_VMMC_1_85V 0x08U -#define STW_CONF1_VMMC_2_6V 0x0aU -#define STW_CONF1_VMMC_2_7V 0x0cU -#define STW_CONF1_VMMC_3_3V 0x0eU -#define STW_CONF1_MMC_LS_STATUS 0x10U -#define STW_PCTL_REG_LO 0x1eU -#define STW_PCTL_REG_HI 0x1fU -#define STW_CONF1_V_MONITORING 0x20U -#define STW_CONF1_IT_WARN 0x40U -#define STW_CONF1_PDN_VAUX 0x80U -#define STW_CONF2 0x20U -#define STW_CONF2_MASK_TWARN 0x01U -#define STW_CONF2_VMMC_EXT 0x02U -#define STW_CONF2_MASK_IT_WAKE_UP 0x04U -#define STW_CONF2_GPO1 0x08U -#define STW_CONF2_GPO2 0x10U -#define STW_VCORE_SLEEP 0x21U - -/** - * struct stw481x - state holder for the Stw481x drivers - * @mutex: mutex to serialize I2C accesses - * @i2c_client: corresponding I2C client - * @regulator: regulator device for regulator children - * @map: regmap handle to access device registers - */ -struct stw481x { - struct mutex lock; - struct i2c_client *client; - struct regulator_dev *vmmc_regulator; - struct regmap *map; -}; - -#endif diff --git a/include/linux/mfd/syscon.h b/include/linux/mfd/syscon.h index 8789fa3..b473577f 100644 --- a/include/linux/mfd/syscon.h +++ b/include/linux/mfd/syscon.h @@ -17,35 +17,10 @@ struct device_node; -#ifdef CONFIG_MFD_SYSCON extern struct regmap *syscon_node_to_regmap(struct device_node *np); extern struct regmap *syscon_regmap_lookup_by_compatible(const char *s); extern struct regmap *syscon_regmap_lookup_by_pdevname(const char *s); extern struct regmap *syscon_regmap_lookup_by_phandle( struct device_node *np, const char *property); -#else -static inline struct regmap *syscon_node_to_regmap(struct device_node *np) -{ - return ERR_PTR(-ENOSYS); -} - -static inline struct regmap *syscon_regmap_lookup_by_compatible(const char *s) -{ - return ERR_PTR(-ENOSYS); -} - -static inline struct regmap *syscon_regmap_lookup_by_pdevname(const char *s) -{ - return ERR_PTR(-ENOSYS); -} - -static inline struct regmap *syscon_regmap_lookup_by_phandle( - struct device_node *np, - const char *property) -{ - return ERR_PTR(-ENOSYS); -} -#endif - #endif /* __LINUX_MFD_SYSCON_H__ */ diff --git a/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h b/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h index b6d36b3..b6bdcd6 100644 --- a/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h +++ b/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h @@ -241,12 +241,6 @@ #define IMX6Q_GPR5_L2_CLK_STOP BIT(8) -#define IMX6Q_GPR8_TX_SWING_LOW (0x7f << 25) -#define IMX6Q_GPR8_TX_SWING_FULL (0x7f << 18) -#define IMX6Q_GPR8_TX_DEEMPH_GEN2_6DB (0x3f << 12) -#define IMX6Q_GPR8_TX_DEEMPH_GEN2_3P5DB (0x3f << 6) -#define IMX6Q_GPR8_TX_DEEMPH_GEN1 (0x3f << 0) - #define IMX6Q_GPR9_TZASC2_BYP BIT(1) #define IMX6Q_GPR9_TZASC1_BYP BIT(0) @@ -279,9 +273,7 @@ #define IMX6Q_GPR12_ARMP_AHB_CLK_EN BIT(26) #define IMX6Q_GPR12_ARMP_ATB_CLK_EN BIT(25) #define IMX6Q_GPR12_ARMP_APB_CLK_EN BIT(24) -#define IMX6Q_GPR12_DEVICE_TYPE (0xf << 12) #define IMX6Q_GPR12_PCIE_CTL_2 BIT(10) -#define IMX6Q_GPR12_LOS_LEVEL (0x1f << 4) #define IMX6Q_GPR13_SDMA_STOP_REQ BIT(30) #define IMX6Q_GPR13_CAN2_STOP_REQ BIT(29) @@ -371,9 +363,4 @@ #define IMX6Q_GPR13_SATA_TX_LVL_1_240_V (0x1f << 2) #define IMX6Q_GPR13_SATA_MPLL_CLK_EN BIT(1) #define IMX6Q_GPR13_SATA_TX_EDGE_RATE BIT(0) - -/* For imx6sl iomux gpr register field define */ -#define IMX6SL_GPR1_FEC_CLOCK_MUX1_SEL_MASK (0x3 << 17) -#define IMX6SL_GPR1_FEC_CLOCK_MUX2_SEL_MASK (0x1 << 14) - #endif /* __LINUX_IMX6Q_IOMUXC_GPR_H */ diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h index d498d98f..25f2c61 100644 --- a/include/linux/mfd/ti_am335x_tscadc.h +++ b/include/linux/mfd/ti_am335x_tscadc.h @@ -46,24 +46,16 @@ /* Step Enable */ #define STEPENB_MASK (0x1FFFF << 0) #define STEPENB(val) ((val) << 0) -#define ENB(val) (1 << (val)) -#define STPENB_STEPENB STEPENB(0x1FFFF) -#define STPENB_STEPENB_TC STEPENB(0x1FFF) /* IRQ enable */ #define IRQENB_HW_PEN BIT(0) #define IRQENB_FIFO0THRES BIT(2) -#define IRQENB_FIFO0OVRRUN BIT(3) -#define IRQENB_FIFO0UNDRFLW BIT(4) #define IRQENB_FIFO1THRES BIT(5) -#define IRQENB_FIFO1OVRRUN BIT(6) -#define IRQENB_FIFO1UNDRFLW BIT(7) #define IRQENB_PENUP BIT(9) /* Step Configuration */ #define STEPCONFIG_MODE_MASK (3 << 0) #define STEPCONFIG_MODE(val) ((val) << 0) -#define STEPCONFIG_MODE_SWCNT STEPCONFIG_MODE(1) #define STEPCONFIG_MODE_HWSYNC STEPCONFIG_MODE(2) #define STEPCONFIG_AVG_MASK (7 << 2) #define STEPCONFIG_AVG(val) ((val) << 2) @@ -131,21 +123,15 @@ #define ADC_CLK 3000000 #define TOTAL_STEPS 16 #define TOTAL_CHANNELS 8 -#define FIFO1_THRESHOLD 19 /* - * time in us for processing a single channel, calculated as follows: - * - * num cycles = open delay + (sample delay + conv time) * averaging - * - * num cycles: 152 + (1 + 13) * 16 = 376 - * - * clock frequency: 26MHz / 8 = 3.25MHz - * clock period: 1 / 3.25MHz = 308ns - * - * processing time: 376 * 308ns = 116us - */ -#define IDLE_TIMEOUT 116 /* microsec */ +* ADC runs at 3MHz, and it takes +* 15 cycles to latch one data output. +* Hence the idle time for ADC to +* process one sample data would be +* around 5 micro seconds. +*/ +#define IDLE_TIMEOUT 5 /* microsec */ #define TSCADC_CELLS 2 @@ -160,7 +146,6 @@ struct ti_tscadc_dev { struct mfd_cell cells[TSCADC_CELLS]; u32 reg_se_cache; spinlock_t reg_lock; - unsigned int clk_div; /* tsc device */ struct titsc *tsc; diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h index eefafa6..40854ac 100644 --- a/include/linux/mfd/wm8994/core.h +++ b/include/linux/mfd/wm8994/core.h @@ -56,6 +56,8 @@ struct irq_domain; #define WM8994_IRQ_GPIO(x) (x + WM8994_IRQ_TEMP_WARN) struct wm8994 { + struct mutex irq_lock; + struct wm8994_pdata pdata; enum wm8994_type type; @@ -83,43 +85,16 @@ struct wm8994 { }; /* Device I/O API */ +int wm8994_reg_read(struct wm8994 *wm8994, unsigned short reg); +int wm8994_reg_write(struct wm8994 *wm8994, unsigned short reg, + unsigned short val); +int wm8994_set_bits(struct wm8994 *wm8994, unsigned short reg, + unsigned short mask, unsigned short val); +int wm8994_bulk_read(struct wm8994 *wm8994, unsigned short reg, + int count, u16 *buf); +int wm8994_bulk_write(struct wm8994 *wm8994, unsigned short reg, + int count, const u16 *buf); -static inline int wm8994_reg_read(struct wm8994 *wm8994, unsigned short reg) -{ - unsigned int val; - int ret; - - ret = regmap_read(wm8994->regmap, reg, &val); - - if (ret < 0) - return ret; - else - return val; -} - -static inline int wm8994_reg_write(struct wm8994 *wm8994, unsigned short reg, - unsigned short val) -{ - return regmap_write(wm8994->regmap, reg, val); -} - -static inline int wm8994_bulk_read(struct wm8994 *wm8994, unsigned short reg, - int count, u16 *buf) -{ - return regmap_bulk_read(wm8994->regmap, reg, buf, count); -} - -static inline int wm8994_bulk_write(struct wm8994 *wm8994, unsigned short reg, - int count, const u16 *buf) -{ - return regmap_raw_write(wm8994->regmap, reg, buf, count * sizeof(u16)); -} - -static inline int wm8994_set_bits(struct wm8994 *wm8994, unsigned short reg, - unsigned short mask, unsigned short val) -{ - return regmap_update_bits(wm8994->regmap, reg, mask, val); -} /* Helper to save on boilerplate */ static inline int wm8994_request_irq(struct wm8994 *wm8994, int irq, diff --git a/include/linux/migrate.h b/include/linux/migrate.h index f5096b5..8d3c57f 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h @@ -90,12 +90,11 @@ static inline int migrate_huge_page_move_mapping(struct address_space *mapping, #endif /* CONFIG_MIGRATION */ #ifdef CONFIG_NUMA_BALANCING -extern int migrate_misplaced_page(struct page *page, - struct vm_area_struct *vma, int node); +extern int migrate_misplaced_page(struct page *page, int node); +extern int migrate_misplaced_page(struct page *page, int node); extern bool migrate_ratelimited(int node); #else -static inline int migrate_misplaced_page(struct page *page, - struct vm_area_struct *vma, int node) +static inline int migrate_misplaced_page(struct page *page, int node) { return -EAGAIN; /* can't migrate now */ } diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index f7eaf2d..cb35835 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h @@ -31,7 +31,6 @@ #define I2O_MINOR 166 #define MICROCODE_MINOR 184 #define TUN_MINOR 200 -#define CUSE_MINOR 203 #define MWAVE_MINOR 219 /* ACP/Mwave Modem */ #define MPT_MINOR 220 #define MPT2SAS_MINOR 221 diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h index 8df61bc..cd1fdf7 100644 --- a/include/linux/mlx4/cmd.h +++ b/include/linux/mlx4/cmd.h @@ -154,6 +154,10 @@ enum { MLX4_CMD_QUERY_IF_STAT = 0X54, MLX4_CMD_SET_IF_STAT = 0X55, + /* set port opcode modifiers */ + MLX4_SET_PORT_PRIO2TC = 0x8, + MLX4_SET_PORT_SCHEDULER = 0x9, + /* register/delete flow steering network rules */ MLX4_QP_FLOW_STEERING_ATTACH = 0x65, MLX4_QP_FLOW_STEERING_DETACH = 0x66, @@ -178,8 +182,6 @@ enum { MLX4_SET_PORT_VLAN_TABLE = 0x3, MLX4_SET_PORT_PRIO_MAP = 0x4, MLX4_SET_PORT_GID_TABLE = 0x5, - MLX4_SET_PORT_PRIO2TC = 0x8, - MLX4_SET_PORT_SCHEDULER = 0x9, }; enum { diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 7d3a523..24ce6bd 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h @@ -54,7 +54,6 @@ enum { MLX4_FLAG_MASTER = 1 << 2, MLX4_FLAG_SLAVE = 1 << 3, MLX4_FLAG_SRIOV = 1 << 4, - MLX4_FLAG_OLD_REG_MAC = 1 << 6, }; enum { @@ -156,7 +155,7 @@ enum { MLX4_DEV_CAP_FLAG2_RSS_TOP = 1LL << 1, MLX4_DEV_CAP_FLAG2_RSS_XOR = 1LL << 2, MLX4_DEV_CAP_FLAG2_FS_EN = 1LL << 3, - MLX4_DEV_CAP_FLAG2_REASSIGN_MAC_EN = 1LL << 4, + MLX4_DEV_CAP_FLAGS2_REASSIGN_MAC_EN = 1LL << 4, MLX4_DEV_CAP_FLAG2_TS = 1LL << 5, MLX4_DEV_CAP_FLAG2_VLAN_CONTROL = 1LL << 6, MLX4_DEV_CAP_FLAG2_FSM = 1LL << 7, @@ -641,28 +640,16 @@ struct mlx4_counter { __be64 tx_bytes; }; -struct mlx4_quotas { - int qp; - int cq; - int srq; - int mpt; - int mtt; - int counter; - int xrcd; -}; - struct mlx4_dev { struct pci_dev *pdev; unsigned long flags; unsigned long num_slaves; struct mlx4_caps caps; struct mlx4_phys_caps phys_caps; - struct mlx4_quotas quotas; struct radix_tree_root qp_table_tree; u8 rev_id; char board_id[MLX4_BOARD_ID_LEN]; int num_vfs; - int numa_node; int oper_log_mgm_entry_size; u64 regid_promisc_array[MLX4_MAX_PORTS + 1]; u64 regid_allmulti_array[MLX4_MAX_PORTS + 1]; @@ -784,12 +771,6 @@ static inline int mlx4_is_master(struct mlx4_dev *dev) return dev->flags & MLX4_FLAG_MASTER; } -static inline int mlx4_num_reserved_sqps(struct mlx4_dev *dev) -{ - return dev->phys_caps.base_sqpn + 8 + - 16 * MLX4_MFUNC_MAX * !!mlx4_is_master(dev); -} - static inline int mlx4_is_qp_reserved(struct mlx4_dev *dev, u32 qpn) { return (qpn < dev->phys_caps.base_sqpn + 8 + @@ -835,7 +816,7 @@ void mlx4_xrcd_free(struct mlx4_dev *dev, u32 xrcdn); int mlx4_uar_alloc(struct mlx4_dev *dev, struct mlx4_uar *uar); void mlx4_uar_free(struct mlx4_dev *dev, struct mlx4_uar *uar); -int mlx4_bf_alloc(struct mlx4_dev *dev, struct mlx4_bf *bf, int node); +int mlx4_bf_alloc(struct mlx4_dev *dev, struct mlx4_bf *bf); void mlx4_bf_free(struct mlx4_dev *dev, struct mlx4_bf *bf); int mlx4_mtt_init(struct mlx4_dev *dev, int npages, int page_shift, @@ -1097,7 +1078,7 @@ int mlx4_SET_PORT_SCHEDULER(struct mlx4_dev *dev, u8 port, u8 *tc_tx_bw, u8 *pg, u16 *ratelimit); int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx); int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); -void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, u16 vlan); +void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, int index); int mlx4_map_phys_fmr(struct mlx4_dev *dev, struct mlx4_fmr *fmr, u64 *page_list, int npages, u64 iova, u32 *lkey, u32 *rkey); diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h index da78875..5eb4e31 100644 --- a/include/linux/mlx5/device.h +++ b/include/linux/mlx5/device.h @@ -230,15 +230,6 @@ enum { MLX5_MAX_PAGE_SHIFT = 31 }; -enum { - MLX5_ADAPTER_PAGE_SHIFT = 12 -}; - -enum { - MLX5_CAP_OFF_DCT = 41, - MLX5_CAP_OFF_CMDIF_CSUM = 46, -}; - struct mlx5_inbox_hdr { __be16 opcode; u8 rsvd[4]; @@ -328,9 +319,9 @@ struct mlx5_hca_cap { u8 rsvd25[42]; __be16 log_uar_page_sz; u8 rsvd26[28]; - u8 log_max_atomic_size_qp; + u8 log_msx_atomic_size_qp; u8 rsvd27[2]; - u8 log_max_atomic_size_dc; + u8 log_msx_atomic_size_dc; u8 rsvd28[76]; }; diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index 554548c..6b8c496 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h @@ -483,7 +483,6 @@ struct mlx5_priv { struct rb_root page_root; int fw_pages; int reg_pages; - struct list_head free_list; struct mlx5_core_health health; @@ -558,11 +557,9 @@ typedef void (*mlx5_cmd_cbk_t)(int status, void *context); struct mlx5_cmd_work_ent { struct mlx5_cmd_msg *in; struct mlx5_cmd_msg *out; - void *uout; - int uout_size; mlx5_cmd_cbk_t callback; void *context; - int idx; + int idx; struct completion done; struct mlx5_cmd *cmd; struct work_struct work; @@ -573,7 +570,6 @@ struct mlx5_cmd_work_ent { u8 token; struct timespec ts1; struct timespec ts2; - u16 op; }; struct mlx5_pas { @@ -657,9 +653,6 @@ void mlx5_cmd_use_polling(struct mlx5_core_dev *dev); int mlx5_cmd_status_to_err(struct mlx5_outbox_hdr *hdr); int mlx5_cmd_exec(struct mlx5_core_dev *dev, void *in, int in_size, void *out, int out_size); -int mlx5_cmd_exec_cb(struct mlx5_core_dev *dev, void *in, int in_size, - void *out, int out_size, mlx5_cmd_cbk_t callback, - void *context); int mlx5_cmd_alloc_uar(struct mlx5_core_dev *dev, u32 *uarn); int mlx5_cmd_free_uar(struct mlx5_core_dev *dev, u32 uarn); int mlx5_alloc_uuars(struct mlx5_core_dev *dev, struct mlx5_uuar_info *uuari); @@ -683,9 +676,7 @@ int mlx5_core_query_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq, int mlx5_core_arm_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq, u16 lwm, int is_srq); int mlx5_core_create_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr, - struct mlx5_create_mkey_mbox_in *in, int inlen, - mlx5_cmd_cbk_t callback, void *context, - struct mlx5_create_mkey_mbox_out *out); + struct mlx5_create_mkey_mbox_in *in, int inlen); int mlx5_core_destroy_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr); int mlx5_core_query_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr, struct mlx5_query_mkey_mbox_out *out, int outlen); @@ -754,11 +745,6 @@ static inline u32 mlx5_idx_to_mkey(u32 mkey_idx) return mkey_idx << 8; } -static inline u8 mlx5_mkey_variant(u32 mkey) -{ - return mkey & 0xff; -} - enum { MLX5_PROF_MASK_QP_SIZE = (u64)1 << 0, MLX5_PROF_MASK_MR_CACHE = (u64)1 << 1, diff --git a/include/linux/mm.h b/include/linux/mm.h index 1cedd00..8b6e55e 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -50,10 +50,6 @@ extern int sysctl_legacy_va_layout; #include <asm/pgtable.h> #include <asm/processor.h> -#ifndef __pa_symbol -#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x), 0)) -#endif - extern unsigned long sysctl_user_reserve_kbytes; extern unsigned long sysctl_admin_reserve_kbytes; @@ -301,26 +297,12 @@ static inline int put_page_testzero(struct page *page) /* * Try to grab a ref unless the page has a refcount of zero, return false if * that is the case. - * This can be called when MMU is off so it must not access - * any of the virtual mappings. */ static inline int get_page_unless_zero(struct page *page) { return atomic_inc_not_zero(&page->_count); } -/* - * Try to drop a ref unless the page has a refcount of one, return false if - * that is the case. - * This is to make sure that the refcount won't become zero after this drop. - * This can be called when MMU is off so it must not access - * any of the virtual mappings. - */ -static inline int put_page_unless_one(struct page *page) -{ - return atomic_add_unless(&page->_count, -1, 1); -} - extern int page_is_ram(unsigned long pfn); /* Support for virtually mapped pages */ @@ -599,11 +581,11 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma) * sets it, so none of the operations on it need to be atomic. */ -/* Page flags: | [SECTION] | [NODE] | ZONE | [LAST_CPUPID] | ... | FLAGS | */ +/* Page flags: | [SECTION] | [NODE] | ZONE | [LAST_NID] | ... | FLAGS | */ #define SECTIONS_PGOFF ((sizeof(unsigned long)*8) - SECTIONS_WIDTH) #define NODES_PGOFF (SECTIONS_PGOFF - NODES_WIDTH) #define ZONES_PGOFF (NODES_PGOFF - ZONES_WIDTH) -#define LAST_CPUPID_PGOFF (ZONES_PGOFF - LAST_CPUPID_WIDTH) +#define LAST_NID_PGOFF (ZONES_PGOFF - LAST_NID_WIDTH) /* * Define the bit shifts to access each section. For non-existent @@ -613,7 +595,7 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma) #define SECTIONS_PGSHIFT (SECTIONS_PGOFF * (SECTIONS_WIDTH != 0)) #define NODES_PGSHIFT (NODES_PGOFF * (NODES_WIDTH != 0)) #define ZONES_PGSHIFT (ZONES_PGOFF * (ZONES_WIDTH != 0)) -#define LAST_CPUPID_PGSHIFT (LAST_CPUPID_PGOFF * (LAST_CPUPID_WIDTH != 0)) +#define LAST_NID_PGSHIFT (LAST_NID_PGOFF * (LAST_NID_WIDTH != 0)) /* NODE:ZONE or SECTION:ZONE is used to ID a zone for the buddy allocator */ #ifdef NODE_NOT_IN_PAGE_FLAGS @@ -635,7 +617,7 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma) #define ZONES_MASK ((1UL << ZONES_WIDTH) - 1) #define NODES_MASK ((1UL << NODES_WIDTH) - 1) #define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1) -#define LAST_CPUPID_MASK ((1UL << LAST_CPUPID_WIDTH) - 1) +#define LAST_NID_MASK ((1UL << LAST_NID_WIDTH) - 1) #define ZONEID_MASK ((1UL << ZONEID_SHIFT) - 1) static inline enum zone_type page_zonenum(const struct page *page) @@ -679,117 +661,51 @@ static inline int page_to_nid(const struct page *page) #endif #ifdef CONFIG_NUMA_BALANCING -static inline int cpu_pid_to_cpupid(int cpu, int pid) -{ - return ((cpu & LAST__CPU_MASK) << LAST__PID_SHIFT) | (pid & LAST__PID_MASK); -} - -static inline int cpupid_to_pid(int cpupid) -{ - return cpupid & LAST__PID_MASK; -} - -static inline int cpupid_to_cpu(int cpupid) -{ - return (cpupid >> LAST__PID_SHIFT) & LAST__CPU_MASK; -} - -static inline int cpupid_to_nid(int cpupid) -{ - return cpu_to_node(cpupid_to_cpu(cpupid)); -} - -static inline bool cpupid_pid_unset(int cpupid) -{ - return cpupid_to_pid(cpupid) == (-1 & LAST__PID_MASK); -} - -static inline bool cpupid_cpu_unset(int cpupid) -{ - return cpupid_to_cpu(cpupid) == (-1 & LAST__CPU_MASK); -} - -static inline bool __cpupid_match_pid(pid_t task_pid, int cpupid) +#ifdef LAST_NID_NOT_IN_PAGE_FLAGS +static inline int page_nid_xchg_last(struct page *page, int nid) { - return (task_pid & LAST__PID_MASK) == cpupid_to_pid(cpupid); + return xchg(&page->_last_nid, nid); } -#define cpupid_match_pid(task, cpupid) __cpupid_match_pid(task->pid, cpupid) -#ifdef LAST_CPUPID_NOT_IN_PAGE_FLAGS -static inline int page_cpupid_xchg_last(struct page *page, int cpupid) +static inline int page_nid_last(struct page *page) { - return xchg(&page->_last_cpupid, cpupid); + return page->_last_nid; } - -static inline int page_cpupid_last(struct page *page) -{ - return page->_last_cpupid; -} -static inline void page_cpupid_reset_last(struct page *page) +static inline void page_nid_reset_last(struct page *page) { - page->_last_cpupid = -1; + page->_last_nid = -1; } #else -static inline int page_cpupid_last(struct page *page) -{ - return (page->flags >> LAST_CPUPID_PGSHIFT) & LAST_CPUPID_MASK; -} - -extern int page_cpupid_xchg_last(struct page *page, int cpupid); - -static inline void page_cpupid_reset_last(struct page *page) -{ - int cpupid = (1 << LAST_CPUPID_SHIFT) - 1; - - page->flags &= ~(LAST_CPUPID_MASK << LAST_CPUPID_PGSHIFT); - page->flags |= (cpupid & LAST_CPUPID_MASK) << LAST_CPUPID_PGSHIFT; -} -#endif /* LAST_CPUPID_NOT_IN_PAGE_FLAGS */ -#else /* !CONFIG_NUMA_BALANCING */ -static inline int page_cpupid_xchg_last(struct page *page, int cpupid) -{ - return page_to_nid(page); /* XXX */ -} - -static inline int page_cpupid_last(struct page *page) +static inline int page_nid_last(struct page *page) { - return page_to_nid(page); /* XXX */ + return (page->flags >> LAST_NID_PGSHIFT) & LAST_NID_MASK; } -static inline int cpupid_to_nid(int cpupid) -{ - return -1; -} +extern int page_nid_xchg_last(struct page *page, int nid); -static inline int cpupid_to_pid(int cpupid) +static inline void page_nid_reset_last(struct page *page) { - return -1; -} + int nid = (1 << LAST_NID_SHIFT) - 1; -static inline int cpupid_to_cpu(int cpupid) -{ - return -1; -} - -static inline int cpu_pid_to_cpupid(int nid, int pid) -{ - return -1; + page->flags &= ~(LAST_NID_MASK << LAST_NID_PGSHIFT); + page->flags |= (nid & LAST_NID_MASK) << LAST_NID_PGSHIFT; } - -static inline bool cpupid_pid_unset(int cpupid) +#endif /* LAST_NID_NOT_IN_PAGE_FLAGS */ +#else +static inline int page_nid_xchg_last(struct page *page, int nid) { - return 1; + return page_to_nid(page); } -static inline void page_cpupid_reset_last(struct page *page) +static inline int page_nid_last(struct page *page) { + return page_to_nid(page); } -static inline bool cpupid_match_pid(struct task_struct *task, int cpupid) +static inline void page_nid_reset_last(struct page *page) { - return false; } -#endif /* CONFIG_NUMA_BALANCING */ +#endif static inline struct zone *page_zone(const struct page *page) { @@ -1316,76 +1232,32 @@ static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long a } #endif /* CONFIG_MMU && !__ARCH_HAS_4LEVEL_HACK */ -#if USE_SPLIT_PTE_PTLOCKS -#if BLOATED_SPINLOCKS -extern bool ptlock_alloc(struct page *page); -extern void ptlock_free(struct page *page); - -static inline spinlock_t *ptlock_ptr(struct page *page) -{ - return page->ptl; -} -#else /* BLOATED_SPINLOCKS */ -static inline bool ptlock_alloc(struct page *page) -{ - return true; -} - -static inline void ptlock_free(struct page *page) -{ -} - -static inline spinlock_t *ptlock_ptr(struct page *page) -{ - return &page->ptl; -} -#endif /* BLOATED_SPINLOCKS */ - -static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd) -{ - return ptlock_ptr(pmd_page(*pmd)); -} - -static inline bool ptlock_init(struct page *page) -{ - /* - * prep_new_page() initialize page->private (and therefore page->ptl) - * with 0. Make sure nobody took it in use in between. - * - * It can happen if arch try to use slab for page table allocation: - * slab code uses page->slab_cache and page->first_page (for tail - * pages), which share storage with page->ptl. - */ - VM_BUG_ON(*(unsigned long *)&page->ptl); - if (!ptlock_alloc(page)) - return false; - spin_lock_init(ptlock_ptr(page)); - return true; -} - -/* Reset page->mapping so free_pages_check won't complain. */ -static inline void pte_lock_deinit(struct page *page) -{ - page->mapping = NULL; - ptlock_free(page); -} - -#else /* !USE_SPLIT_PTE_PTLOCKS */ +#if USE_SPLIT_PTLOCKS +/* + * We tuck a spinlock to guard each pagetable page into its struct page, + * at page->private, with BUILD_BUG_ON to make sure that this will not + * overflow into the next struct page (as it might with DEBUG_SPINLOCK). + * When freeing, reset page->mapping so free_pages_check won't complain. + */ +#define __pte_lockptr(page) &((page)->ptl) +#define pte_lock_init(_page) do { \ + spin_lock_init(__pte_lockptr(_page)); \ +} while (0) +#define pte_lock_deinit(page) ((page)->mapping = NULL) +#define pte_lockptr(mm, pmd) ({(void)(mm); __pte_lockptr(pmd_page(*(pmd)));}) +#else /* !USE_SPLIT_PTLOCKS */ /* * We use mm->page_table_lock to guard all pagetable pages of the mm. */ -static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd) -{ - return &mm->page_table_lock; -} -static inline bool ptlock_init(struct page *page) { return true; } -static inline void pte_lock_deinit(struct page *page) {} -#endif /* USE_SPLIT_PTE_PTLOCKS */ +#define pte_lock_init(page) do {} while (0) +#define pte_lock_deinit(page) do {} while (0) +#define pte_lockptr(mm, pmd) ({(void)(pmd); &(mm)->page_table_lock;}) +#endif /* USE_SPLIT_PTLOCKS */ -static inline bool pgtable_page_ctor(struct page *page) +static inline void pgtable_page_ctor(struct page *page) { + pte_lock_init(page); inc_zone_page_state(page, NR_PAGETABLE); - return ptlock_init(page); } static inline void pgtable_page_dtor(struct page *page) @@ -1422,52 +1294,6 @@ static inline void pgtable_page_dtor(struct page *page) ((unlikely(pmd_none(*(pmd))) && __pte_alloc_kernel(pmd, address))? \ NULL: pte_offset_kernel(pmd, address)) -#if USE_SPLIT_PMD_PTLOCKS - -static inline spinlock_t *pmd_lockptr(struct mm_struct *mm, pmd_t *pmd) -{ - return ptlock_ptr(virt_to_page(pmd)); -} - -static inline bool pgtable_pmd_page_ctor(struct page *page) -{ -#ifdef CONFIG_TRANSPARENT_HUGEPAGE - page->pmd_huge_pte = NULL; -#endif - return ptlock_init(page); -} - -static inline void pgtable_pmd_page_dtor(struct page *page) -{ -#ifdef CONFIG_TRANSPARENT_HUGEPAGE - VM_BUG_ON(page->pmd_huge_pte); -#endif - ptlock_free(page); -} - -#define pmd_huge_pte(mm, pmd) (virt_to_page(pmd)->pmd_huge_pte) - -#else - -static inline spinlock_t *pmd_lockptr(struct mm_struct *mm, pmd_t *pmd) -{ - return &mm->page_table_lock; -} - -static inline bool pgtable_pmd_page_ctor(struct page *page) { return true; } -static inline void pgtable_pmd_page_dtor(struct page *page) {} - -#define pmd_huge_pte(mm, pmd) ((mm)->pmd_huge_pte) - -#endif - -static inline spinlock_t *pmd_lock(struct mm_struct *mm, pmd_t *pmd) -{ - spinlock_t *ptl = pmd_lockptr(mm, pmd); - spin_lock(ptl); - return ptl; -} - extern void free_area_init(unsigned long * zones_size); extern void free_area_init_node(int nid, unsigned long * zones_size, unsigned long zone_start_pfn, unsigned long *zholes_size); diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index bd29941..d9851ee 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -23,9 +23,7 @@ struct address_space; -#define USE_SPLIT_PTE_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS) -#define USE_SPLIT_PMD_PTLOCKS (USE_SPLIT_PTE_PTLOCKS && \ - IS_ENABLED(CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK)) +#define USE_SPLIT_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS) /* * Each physical page in the system has a struct page associated with @@ -44,22 +42,18 @@ struct page { /* First double word block */ unsigned long flags; /* Atomic flags, some possibly * updated asynchronously */ - union { - struct address_space *mapping; /* If low bit clear, points to - * inode address_space, or NULL. - * If page mapped as anonymous - * memory, low bit is set, and - * it points to anon_vma object: - * see PAGE_MAPPING_ANON below. - */ - void *s_mem; /* slab first object */ - }; - + struct address_space *mapping; /* If low bit clear, points to + * inode address_space, or NULL. + * If page mapped as anonymous + * memory, low bit is set, and + * it points to anon_vma object: + * see PAGE_MAPPING_ANON below. + */ /* Second double word */ struct { union { pgoff_t index; /* Our offset within mapping. */ - void *freelist; /* sl[aou]b first free object */ + void *freelist; /* slub/slob first free object */ bool pfmemalloc; /* If set by the page allocator, * ALLOC_NO_WATERMARKS was set * and the low watermark was not @@ -115,7 +109,6 @@ struct page { }; atomic_t _count; /* Usage count, see below. */ }; - unsigned int active; /* SLAB */ }; }; @@ -137,12 +130,6 @@ struct page { struct list_head list; /* slobs list of pages */ struct slab *slab_page; /* slab fields */ - struct rcu_head rcu_head; /* Used by SLAB - * when destroying via RCU - */ -#if defined(CONFIG_TRANSPARENT_HUGEPAGE) && USE_SPLIT_PMD_PTLOCKS - pgtable_t pmd_huge_pte; /* protected by page->ptl */ -#endif }; /* Remainder is not double word aligned */ @@ -154,13 +141,9 @@ struct page { * indicates order in the buddy * system if PG_buddy is set. */ -#if USE_SPLIT_PTE_PTLOCKS -#if BLOATED_SPINLOCKS - spinlock_t *ptl; -#else +#if USE_SPLIT_PTLOCKS spinlock_t ptl; #endif -#endif struct kmem_cache *slab_cache; /* SL[AU]B: Pointer to slab */ struct page *first_page; /* Compound tail pages */ }; @@ -191,8 +174,8 @@ struct page { void *shadow; #endif -#ifdef LAST_CPUPID_NOT_IN_PAGE_FLAGS - int _last_cpupid; +#ifdef LAST_NID_NOT_IN_PAGE_FLAGS + int _last_nid; #endif } /* @@ -326,14 +309,14 @@ enum { NR_MM_COUNTERS }; -#if USE_SPLIT_PTE_PTLOCKS && defined(CONFIG_MMU) +#if USE_SPLIT_PTLOCKS && defined(CONFIG_MMU) #define SPLIT_RSS_COUNTING /* per-thread cached information, */ struct task_rss_stat { int events; /* for synchronization threshold */ int count[NR_MM_COUNTERS]; }; -#endif /* USE_SPLIT_PTE_PTLOCKS */ +#endif /* USE_SPLIT_PTLOCKS */ struct mm_rss_stat { atomic_long_t count[NR_MM_COUNTERS]; @@ -356,7 +339,6 @@ struct mm_struct { pgd_t * pgd; atomic_t mm_users; /* How many users with user space? */ atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */ - atomic_long_t nr_ptes; /* Page table pages */ int map_count; /* number of VMAs */ spinlock_t page_table_lock; /* Protects page tables and some counters */ @@ -378,6 +360,7 @@ struct mm_struct { unsigned long exec_vm; /* VM_EXEC & ~VM_WRITE */ unsigned long stack_vm; /* VM_GROWSUP/DOWN */ unsigned long def_flags; + unsigned long nr_ptes; /* Page table pages */ unsigned long start_code, end_code, start_data, end_data; unsigned long start_brk, brk, start_stack; unsigned long arg_start, arg_end, env_start, env_end; @@ -423,7 +406,7 @@ struct mm_struct { #ifdef CONFIG_MMU_NOTIFIER struct mmu_notifier_mm *mmu_notifier_mm; #endif -#if defined(CONFIG_TRANSPARENT_HUGEPAGE) && !USE_SPLIT_PMD_PTLOCKS +#ifdef CONFIG_TRANSPARENT_HUGEPAGE pgtable_t pmd_huge_pte; /* protected by page_table_lock */ #endif #ifdef CONFIG_CPUMASK_OFFSTACK @@ -437,15 +420,28 @@ struct mm_struct { */ unsigned long numa_next_scan; + /* numa_next_reset is when the PTE scanner period will be reset */ + unsigned long numa_next_reset; + /* Restart point for scanning and setting pte_numa */ unsigned long numa_scan_offset; /* numa_scan_seq prevents two threads setting pte_numa */ int numa_scan_seq; + + /* + * The first node a task was scheduled on. If a task runs on + * a different node than Make PTE Scan Go Now. + */ + int first_nid; #endif struct uprobes_state uprobes_state; }; +/* first nid will either be a valid NID or one of these values */ +#define NUMA_PTE_SCAN_INIT -1 +#define NUMA_PTE_SCAN_ACTIVE -2 + static inline void mm_init_cpumask(struct mm_struct *mm) { #ifdef CONFIG_CPUMASK_OFFSTACK diff --git a/include/linux/mman.h b/include/linux/mman.h index 7f7f8da..92dc257 100644 --- a/include/linux/mman.h +++ b/include/linux/mman.h @@ -87,6 +87,4 @@ calc_vm_flag_bits(unsigned long flags) _calc_vm_trans(flags, MAP_DENYWRITE, VM_DENYWRITE ) | _calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED ); } - -unsigned long vm_commit_limit(void); #endif /* _LINUX_MMAN_H */ diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 176fdf8..842de3e 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h @@ -240,7 +240,6 @@ struct mmc_part { struct mmc_card { struct mmc_host *host; /* the host this device belongs to */ struct device dev; /* the device */ - u32 ocr; /* the current OCR setting */ unsigned int rca; /* relative card address of device */ unsigned int type; /* card type */ #define MMC_TYPE_MMC 0 /* MMC card */ @@ -258,7 +257,6 @@ struct mmc_card { #define MMC_CARD_REMOVED (1<<7) /* card has been removed */ #define MMC_STATE_HIGHSPEED_200 (1<<8) /* card is in HS200 mode */ #define MMC_STATE_DOING_BKOPS (1<<10) /* card is doing BKOPS */ -#define MMC_STATE_SUSPENDED (1<<11) /* card is suspended */ unsigned int quirks; /* card quirks */ #define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */ #define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1) /* use func->cur_blksize */ @@ -422,10 +420,10 @@ static inline void __maybe_unused remove_quirk(struct mmc_card *card, int data) #define mmc_card_blockaddr(c) ((c)->state & MMC_STATE_BLOCKADDR) #define mmc_card_ddr_mode(c) ((c)->state & MMC_STATE_HIGHSPEED_DDR) #define mmc_card_uhs(c) ((c)->state & MMC_STATE_ULTRAHIGHSPEED) +#define mmc_sd_card_uhs(c) ((c)->state & MMC_STATE_ULTRAHIGHSPEED) #define mmc_card_ext_capacity(c) ((c)->state & MMC_CARD_SDXC) #define mmc_card_removed(c) ((c) && ((c)->state & MMC_CARD_REMOVED)) #define mmc_card_doing_bkops(c) ((c)->state & MMC_STATE_DOING_BKOPS) -#define mmc_card_suspended(c) ((c)->state & MMC_STATE_SUSPENDED) #define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) #define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY) @@ -434,12 +432,11 @@ static inline void __maybe_unused remove_quirk(struct mmc_card *card, int data) #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR) #define mmc_card_set_ddr_mode(c) ((c)->state |= MMC_STATE_HIGHSPEED_DDR) #define mmc_card_set_uhs(c) ((c)->state |= MMC_STATE_ULTRAHIGHSPEED) +#define mmc_sd_card_set_uhs(c) ((c)->state |= MMC_STATE_ULTRAHIGHSPEED) #define mmc_card_set_ext_capacity(c) ((c)->state |= MMC_CARD_SDXC) #define mmc_card_set_removed(c) ((c)->state |= MMC_CARD_REMOVED) #define mmc_card_set_doing_bkops(c) ((c)->state |= MMC_STATE_DOING_BKOPS) #define mmc_card_clr_doing_bkops(c) ((c)->state &= ~MMC_STATE_DOING_BKOPS) -#define mmc_card_set_suspended(c) ((c)->state |= MMC_STATE_SUSPENDED) -#define mmc_card_clr_suspended(c) ((c)->state &= ~MMC_STATE_SUSPENDED) /* * Quirk add/remove for MMC products. diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index 87079fc..da51bec 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h @@ -151,8 +151,7 @@ extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *); extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *, struct mmc_command *, int); extern void mmc_start_bkops(struct mmc_card *card, bool from_exception); -extern int __mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int, bool, - bool); +extern int __mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int, bool); extern int mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int); extern int mmc_send_ext_csd(struct mmc_card *card, u8 *ext_csd); @@ -189,6 +188,7 @@ extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int); extern int __mmc_claim_host(struct mmc_host *host, atomic_t *abort); extern void mmc_release_host(struct mmc_host *host); +extern int mmc_try_claim_host(struct mmc_host *host); extern void mmc_get_card(struct mmc_card *card); extern void mmc_put_card(struct mmc_card *card); diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h index 6ce7d2c..198f0fa 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h @@ -15,7 +15,6 @@ #define LINUX_MMC_DW_MMC_H #include <linux/scatterlist.h> -#include <linux/mmc/core.h> #define MAX_MCI_SLOTS 2 @@ -130,9 +129,6 @@ struct dw_mci { struct mmc_request *mrq; struct mmc_command *cmd; struct mmc_data *data; - struct mmc_command stop_abort; - unsigned int prev_blksz; - unsigned char timing; struct workqueue_struct *card_workqueue; /* DMA interface members*/ diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 99f5709..3b0c33a 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -254,7 +254,6 @@ struct mmc_host { #define MMC_CAP_UHS_SDR50 (1 << 17) /* Host supports UHS SDR50 mode */ #define MMC_CAP_UHS_SDR104 (1 << 18) /* Host supports UHS SDR104 mode */ #define MMC_CAP_UHS_DDR50 (1 << 19) /* Host supports UHS DDR50 mode */ -#define MMC_CAP_RUNTIME_RESUME (1 << 20) /* Resume at runtime_resume. */ #define MMC_CAP_DRIVER_TYPE_A (1 << 23) /* Host supports Driver Type A */ #define MMC_CAP_DRIVER_TYPE_C (1 << 24) /* Host supports Driver Type C */ #define MMC_CAP_DRIVER_TYPE_D (1 << 25) /* Host supports Driver Type D */ @@ -310,6 +309,7 @@ struct mmc_host { spinlock_t lock; /* lock for claim and bus ops */ struct mmc_ios ios; /* current io bus settings */ + u32 ocr; /* the current OCR setting */ /* group bitfields together to minimize padding */ unsigned int use_spi_crc:1; @@ -382,6 +382,9 @@ static inline void *mmc_priv(struct mmc_host *host) #define mmc_classdev(x) (&(x)->class_dev) #define mmc_hostname(x) (dev_name(&(x)->class_dev)) +int mmc_suspend_host(struct mmc_host *); +int mmc_resume_host(struct mmc_host *); + int mmc_power_save_host(struct mmc_host *host); int mmc_power_restore_host(struct mmc_host *host); diff --git a/include/linux/module.h b/include/linux/module.h index 15cd6b1..05f2447 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -367,6 +367,9 @@ struct module /* What modules do I depend on? */ struct list_head target_list; + /* Who is waiting for us to be unloaded */ + struct task_struct *waiter; + /* Destruction function. */ void (*exit)(void); diff --git a/include/linux/mount.h b/include/linux/mount.h index 371d346..38cd98f 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h @@ -49,8 +49,6 @@ struct mnt_namespace; #define MNT_LOCK_READONLY 0x400000 #define MNT_LOCKED 0x800000 -#define MNT_DOOMED 0x1000000 -#define MNT_SYNC_UMOUNT 0x2000000 struct vfsmount { struct dentry *mnt_root; /* root of the mounted tree */ diff --git a/include/linux/msg.h b/include/linux/msg.h index e21f9d4..391af8d 100644 --- a/include/linux/msg.h +++ b/include/linux/msg.h @@ -6,9 +6,9 @@ /* one msg_msg structure for each message */ struct msg_msg { - struct list_head m_list; - long m_type; - size_t m_ts; /* message text size */ + struct list_head m_list; + long m_type; + int m_ts; /* message text size */ struct msg_msgseg* next; void *security; /* the actual message follows immediately */ diff --git a/include/linux/msi.h b/include/linux/msi.h index 009b024..b17ead8 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -26,11 +26,11 @@ struct msi_desc { struct { __u8 is_msix : 1; __u8 multiple: 3; /* log2 number of messages */ - __u8 maskbit : 1; /* mask-pending bit supported ? */ - __u8 is_64 : 1; /* Address size: 0=32bit 1=64bit */ - __u8 pos; /* Location of the msi capability */ - __u16 entry_nr; /* specific enabled entry */ - unsigned default_irq; /* default pre-assigned irq */ + __u8 maskbit : 1; /* mask-pending bit supported ? */ + __u8 is_64 : 1; /* Address size: 0=32bit 1=64bit */ + __u8 pos; /* Location of the msi capability */ + __u16 entry_nr; /* specific enabled entry */ + unsigned default_irq; /* default pre-assigned irq */ } msi_attrib; u32 masked; /* mask bits */ @@ -64,8 +64,6 @@ void arch_restore_msi_irqs(struct pci_dev *dev, int irq); void default_teardown_msi_irqs(struct pci_dev *dev); void default_restore_msi_irqs(struct pci_dev *dev, int irq); -u32 default_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag); -u32 default_msix_mask_irq(struct msi_desc *desc, u32 flag); struct msi_chip { struct module *owner; diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h index 36bb6a5..95fc482 100644 --- a/include/linux/mtd/bbm.h +++ b/include/linux/mtd/bbm.h @@ -91,6 +91,8 @@ struct nand_bbt_descr { * with NAND_BBT_CREATE. */ #define NAND_BBT_CREATE_EMPTY 0x00000400 +/* Search good / bad pattern through all pages of a block */ +#define NAND_BBT_SCANALLPAGES 0x00000800 /* Write bbt if neccecary */ #define NAND_BBT_WRITE 0x00002000 /* Read and write back block contents when writing bbt */ diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h index 5f487d7..4b02512 100644 --- a/include/linux/mtd/map.h +++ b/include/linux/mtd/map.h @@ -365,7 +365,7 @@ static inline map_word map_word_load_partial(struct map_info *map, map_word orig bitpos = (map_bankwidth(map)-1-i)*8; #endif orig.x[0] &= ~(0xff << bitpos); - orig.x[0] |= (unsigned long)buf[i-start] << bitpos; + orig.x[0] |= buf[i-start] << bitpos; } } return orig; @@ -384,7 +384,7 @@ static inline map_word map_word_ff(struct map_info *map) if (map_bankwidth(map) < MAP_FF_LIMIT) { int bw = 8 * map_bankwidth(map); - r.x[0] = (1UL << bw) - 1; + r.x[0] = (1 << bw) - 1; } else { for (i=0; i<map_words(map); i++) r.x[i] = ~0UL; diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 8cc0e2f..f9bfe52 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -29,6 +29,9 @@ #include <asm/div64.h> +#define MTD_CHAR_MAJOR 90 +#define MTD_BLOCK_MAJOR 31 + #define MTD_ERASE_PENDING 0x01 #define MTD_ERASING 0x02 #define MTD_ERASE_SUSPEND 0x04 @@ -351,11 +354,6 @@ static inline int mtd_has_oob(const struct mtd_info *mtd) return mtd->_read_oob && mtd->_write_oob; } -static inline int mtd_type_is_nand(const struct mtd_info *mtd) -{ - return mtd->type == MTD_NANDFLASH || mtd->type == MTD_MLCNANDFLASH; -} - static inline int mtd_can_have_bb(const struct mtd_info *mtd) { return !!mtd->_block_isbad; diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 9e6c8f9..ac8e89d 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h @@ -198,7 +198,6 @@ typedef enum { /* Cell info constants */ #define NAND_CI_CHIPNR_MSK 0x03 #define NAND_CI_CELLTYPE_MSK 0x0C -#define NAND_CI_CELLTYPE_SHIFT 2 /* Keep gcc happy */ struct nand_chip; @@ -478,7 +477,7 @@ struct nand_buffers { * @badblockbits: [INTERN] minimum number of set bits in a good block's * bad block marker position; i.e., BBM == 11110111b is * not bad when badblockbits == 7 - * @bits_per_cell: [INTERN] number of bits per cell. i.e., 1 means SLC. + * @cellinfo: [INTERN] MLC/multichip data from chip ident * @ecc_strength_ds: [INTERN] ECC correctability from the datasheet. * Minimum amount of bit errors per @ecc_step_ds guaranteed * to be correctable. If unknown, set to zero. @@ -499,6 +498,7 @@ struct nand_buffers { * supported, 0 otherwise. * @onfi_set_features: [REPLACEABLE] set the features for ONFI nand * @onfi_get_features: [REPLACEABLE] get the features for ONFI nand + * @ecclayout: [REPLACEABLE] the default ECC placement scheme * @bbt: [INTERN] bad block table pointer * @bbt_td: [REPLACEABLE] bad block table descriptor for flash * lookup. @@ -559,7 +559,7 @@ struct nand_chip { int pagebuf; unsigned int pagebuf_bitflips; int subpagesize; - uint8_t bits_per_cell; + uint8_t cellinfo; uint16_t ecc_strength_ds; uint16_t ecc_step_ds; int badblockpos; @@ -572,6 +572,7 @@ struct nand_chip { uint8_t *oob_poi; struct nand_hw_control *controller; + struct nand_ecclayout *ecclayout; struct nand_ecc_ctrl ecc; struct nand_buffers *buffers; @@ -796,13 +797,4 @@ static inline int onfi_get_sync_timing_mode(struct nand_chip *chip) return le16_to_cpu(chip->onfi_params.src_sync_timing_mode); } -/* - * Check if it is a SLC nand. - * The !nand_is_slc() can be used to check the MLC/TLC nand chips. - * We do not distinguish the MLC and TLC now. - */ -static inline bool nand_is_slc(struct nand_chip *chip) -{ - return chip->bits_per_cell == 1; -} #endif /* __LINUX_MTD_NAND_H */ diff --git a/include/linux/mutex.h b/include/linux/mutex.h index d318193..bab49da 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h @@ -131,7 +131,7 @@ static inline int mutex_is_locked(struct mutex *lock) } /* - * See kernel/locking/mutex.c for detailed documentation of these APIs. + * See kernel/mutex.c for detailed documentation of these APIs. * Also see Documentation/mutex-design.txt. */ #ifdef CONFIG_DEBUG_LOCK_ALLOC diff --git a/include/linux/namei.h b/include/linux/namei.h index 492de72..8e47bc7 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h @@ -16,7 +16,7 @@ struct nameidata { struct path root; struct inode *inode; /* path.dentry.d_inode */ unsigned int flags; - unsigned seq, m_seq; + unsigned seq; int last_type; unsigned depth; char *saved_names[MAX_NESTED_LINKS + 1]; diff --git a/include/linux/net.h b/include/linux/net.h index 4bcee94..4f27575 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -24,7 +24,6 @@ #include <linux/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK */ #include <linux/kmemcheck.h> #include <linux/rcupdate.h> -#include <linux/jump_label.h> #include <uapi/linux/net.h> struct poll_table_struct; @@ -164,14 +163,6 @@ struct proto_ops { #endif int (*sendmsg) (struct kiocb *iocb, struct socket *sock, struct msghdr *m, size_t total_len); - /* Notes for implementing recvmsg: - * =============================== - * msg->msg_namelen should get updated by the recvmsg handlers - * iff msg_name != NULL. It is by default 0 to prevent - * returning uninitialized memory to user space. The recvfrom - * handlers can assume that msg.msg_name is either NULL or has - * a minimum size of sizeof(struct sockaddr_storage). - */ int (*recvmsg) (struct kiocb *iocb, struct socket *sock, struct msghdr *m, size_t total_len, int flags); @@ -204,23 +195,27 @@ enum { SOCK_WAKE_URG, }; -int sock_wake_async(struct socket *sk, int how, int band); -int sock_register(const struct net_proto_family *fam); -void sock_unregister(int family); -int __sock_create(struct net *net, int family, int type, int proto, - struct socket **res, int kern); -int sock_create(int family, int type, int proto, struct socket **res); -int sock_create_kern(int family, int type, int proto, struct socket **res); -int sock_create_lite(int family, int type, int proto, struct socket **res); -void sock_release(struct socket *sock); -int sock_sendmsg(struct socket *sock, struct msghdr *msg, size_t len); -int sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t size, - int flags); -struct file *sock_alloc_file(struct socket *sock, int flags, const char *dname); -struct socket *sockfd_lookup(int fd, int *err); -struct socket *sock_from_file(struct file *file, int *err); +extern int sock_wake_async(struct socket *sk, int how, int band); +extern int sock_register(const struct net_proto_family *fam); +extern void sock_unregister(int family); +extern int __sock_create(struct net *net, int family, int type, int proto, + struct socket **res, int kern); +extern int sock_create(int family, int type, int proto, + struct socket **res); +extern int sock_create_kern(int family, int type, int proto, + struct socket **res); +extern int sock_create_lite(int family, int type, int proto, + struct socket **res); +extern void sock_release(struct socket *sock); +extern int sock_sendmsg(struct socket *sock, struct msghdr *msg, + size_t len); +extern int sock_recvmsg(struct socket *sock, struct msghdr *msg, + size_t size, int flags); +extern struct file *sock_alloc_file(struct socket *sock, int flags, const char *dname); +extern struct socket *sockfd_lookup(int fd, int *err); +extern struct socket *sock_from_file(struct file *file, int *err); #define sockfd_put(sock) fput(sock->file) -int net_ratelimit(void); +extern int net_ratelimit(void); #define net_ratelimited_function(function, ...) \ do { \ @@ -248,52 +243,32 @@ do { \ #define net_random() prandom_u32() #define net_srandom(seed) prandom_seed((__force u32)(seed)) -bool __net_get_random_once(void *buf, int nbytes, bool *done, - struct static_key *done_key); - -#ifdef HAVE_JUMP_LABEL -#define ___NET_RANDOM_STATIC_KEY_INIT ((struct static_key) \ - { .enabled = ATOMIC_INIT(0), .entries = (void *)1 }) -#else /* !HAVE_JUMP_LABEL */ -#define ___NET_RANDOM_STATIC_KEY_INIT STATIC_KEY_INIT_FALSE -#endif /* HAVE_JUMP_LABEL */ - -#define net_get_random_once(buf, nbytes) \ - ({ \ - bool ___ret = false; \ - static bool ___done = false; \ - static struct static_key ___done_key = \ - ___NET_RANDOM_STATIC_KEY_INIT; \ - if (!static_key_true(&___done_key)) \ - ___ret = __net_get_random_once(buf, \ - nbytes, \ - &___done, \ - &___done_key); \ - ___ret; \ - }) - -int kernel_sendmsg(struct socket *sock, struct msghdr *msg, struct kvec *vec, - size_t num, size_t len); -int kernel_recvmsg(struct socket *sock, struct msghdr *msg, struct kvec *vec, - size_t num, size_t len, int flags); - -int kernel_bind(struct socket *sock, struct sockaddr *addr, int addrlen); -int kernel_listen(struct socket *sock, int backlog); -int kernel_accept(struct socket *sock, struct socket **newsock, int flags); -int kernel_connect(struct socket *sock, struct sockaddr *addr, int addrlen, - int flags); -int kernel_getsockname(struct socket *sock, struct sockaddr *addr, - int *addrlen); -int kernel_getpeername(struct socket *sock, struct sockaddr *addr, - int *addrlen); -int kernel_getsockopt(struct socket *sock, int level, int optname, char *optval, - int *optlen); -int kernel_setsockopt(struct socket *sock, int level, int optname, char *optval, - unsigned int optlen); -int kernel_sendpage(struct socket *sock, struct page *page, int offset, - size_t size, int flags); -int kernel_sock_ioctl(struct socket *sock, int cmd, unsigned long arg); -int kernel_sock_shutdown(struct socket *sock, enum sock_shutdown_cmd how); +extern int kernel_sendmsg(struct socket *sock, struct msghdr *msg, + struct kvec *vec, size_t num, size_t len); +extern int kernel_recvmsg(struct socket *sock, struct msghdr *msg, + struct kvec *vec, size_t num, + size_t len, int flags); + +extern int kernel_bind(struct socket *sock, struct sockaddr *addr, + int addrlen); +extern int kernel_listen(struct socket *sock, int backlog); +extern int kernel_accept(struct socket *sock, struct socket **newsock, + int flags); +extern int kernel_connect(struct socket *sock, struct sockaddr *addr, + int addrlen, int flags); +extern int kernel_getsockname(struct socket *sock, struct sockaddr *addr, + int *addrlen); +extern int kernel_getpeername(struct socket *sock, struct sockaddr *addr, + int *addrlen); +extern int kernel_getsockopt(struct socket *sock, int level, int optname, + char *optval, int *optlen); +extern int kernel_setsockopt(struct socket *sock, int level, int optname, + char *optval, unsigned int optlen); +extern int kernel_sendpage(struct socket *sock, struct page *page, int offset, + size_t size, int flags); +extern int kernel_sock_ioctl(struct socket *sock, int cmd, unsigned long arg); +extern int kernel_sock_shutdown(struct socket *sock, + enum sock_shutdown_cmd how); #define MODULE_ALIAS_NETPROTO(proto) \ MODULE_ALIAS("net-pf-" __stringify(proto)) diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h index 1005ebf..a2a89a5 100644 --- a/include/linux/netdev_features.h +++ b/include/linux/netdev_features.h @@ -42,8 +42,6 @@ enum { NETIF_F_TSO6_BIT, /* ... TCPv6 segmentation */ NETIF_F_FSO_BIT, /* ... FCoE segmentation */ NETIF_F_GSO_GRE_BIT, /* ... GRE with TSO */ - NETIF_F_GSO_IPIP_BIT, /* ... IPIP tunnel with TSO */ - NETIF_F_GSO_SIT_BIT, /* ... SIT tunnel with TSO */ NETIF_F_GSO_UDP_TUNNEL_BIT, /* ... UDP TUNNEL with TSO */ NETIF_F_GSO_MPLS_BIT, /* ... MPLS segmentation */ /**/NETIF_F_GSO_LAST = /* last bit, see GSO_MASK */ @@ -62,7 +60,6 @@ enum { NETIF_F_HW_VLAN_STAG_TX_BIT, /* Transmit VLAN STAG HW acceleration */ NETIF_F_HW_VLAN_STAG_RX_BIT, /* Receive VLAN STAG HW acceleration */ NETIF_F_HW_VLAN_STAG_FILTER_BIT,/* Receive filtering on VLAN STAGs */ - NETIF_F_HW_L2FW_DOFFLOAD_BIT, /* Allow L2 Forwarding in Hardware */ /* * Add your fresh new feature above and remember to update @@ -110,14 +107,11 @@ enum { #define NETIF_F_RXFCS __NETIF_F(RXFCS) #define NETIF_F_RXALL __NETIF_F(RXALL) #define NETIF_F_GSO_GRE __NETIF_F(GSO_GRE) -#define NETIF_F_GSO_IPIP __NETIF_F(GSO_IPIP) -#define NETIF_F_GSO_SIT __NETIF_F(GSO_SIT) #define NETIF_F_GSO_UDP_TUNNEL __NETIF_F(GSO_UDP_TUNNEL) #define NETIF_F_GSO_MPLS __NETIF_F(GSO_MPLS) #define NETIF_F_HW_VLAN_STAG_FILTER __NETIF_F(HW_VLAN_STAG_FILTER) #define NETIF_F_HW_VLAN_STAG_RX __NETIF_F(HW_VLAN_STAG_RX) #define NETIF_F_HW_VLAN_STAG_TX __NETIF_F(HW_VLAN_STAG_TX) -#define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD) /* Features valid for ethtool to change */ /* = all defined minus driver/device-class-related */ diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 7f0ed42..25f5d2d 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -60,8 +60,8 @@ struct wireless_dev; #define SET_ETHTOOL_OPS(netdev,ops) \ ( (netdev)->ethtool_ops = (ops) ) -void netdev_set_default_ethtool_ops(struct net_device *dev, - const struct ethtool_ops *ops); +extern void netdev_set_default_ethtool_ops(struct net_device *dev, + const struct ethtool_ops *ops); /* hardware address assignment types */ #define NET_ADDR_PERM 0 /* address is permanent (default) */ @@ -298,7 +298,7 @@ struct netdev_boot_setup { }; #define NETDEV_BOOT_SETUP_MAX 8 -int __init netdev_boot_setup(char *str); +extern int __init netdev_boot_setup(char *str); /* * Structure for NAPI scheduling similar to tasklet but with weighting @@ -394,7 +394,7 @@ enum rx_handler_result { typedef enum rx_handler_result rx_handler_result_t; typedef rx_handler_result_t rx_handler_func_t(struct sk_buff **pskb); -void __napi_schedule(struct napi_struct *n); +extern void __napi_schedule(struct napi_struct *n); static inline bool napi_disable_pending(struct napi_struct *n) { @@ -445,8 +445,8 @@ static inline bool napi_reschedule(struct napi_struct *napi) * * Mark NAPI processing as complete. */ -void __napi_complete(struct napi_struct *n); -void napi_complete(struct napi_struct *n); +extern void __napi_complete(struct napi_struct *n); +extern void napi_complete(struct napi_struct *n); /** * napi_by_id - lookup a NAPI by napi_id @@ -455,7 +455,7 @@ void napi_complete(struct napi_struct *n); * lookup @napi_id in napi_hash table * must be called under rcu_read_lock() */ -struct napi_struct *napi_by_id(unsigned int napi_id); +extern struct napi_struct *napi_by_id(unsigned int napi_id); /** * napi_hash_add - add a NAPI to global hashtable @@ -463,7 +463,7 @@ struct napi_struct *napi_by_id(unsigned int napi_id); * * generate a new napi_id and store a @napi under it in napi_hash */ -void napi_hash_add(struct napi_struct *napi); +extern void napi_hash_add(struct napi_struct *napi); /** * napi_hash_del - remove a NAPI from global table @@ -472,7 +472,7 @@ void napi_hash_add(struct napi_struct *napi); * Warning: caller must observe rcu grace period * before freeing memory containing @napi */ -void napi_hash_del(struct napi_struct *napi); +extern void napi_hash_del(struct napi_struct *napi); /** * napi_disable - prevent NAPI from scheduling @@ -483,7 +483,6 @@ void napi_hash_del(struct napi_struct *napi); */ static inline void napi_disable(struct napi_struct *n) { - might_sleep(); set_bit(NAPI_STATE_DISABLE, &n->state); while (test_and_set_bit(NAPI_STATE_SCHED, &n->state)) msleep(1); @@ -665,8 +664,8 @@ static inline void rps_reset_sock_flow(struct rps_sock_flow_table *table, extern struct rps_sock_flow_table __rcu *rps_sock_flow_table; #ifdef CONFIG_RFS_ACCEL -bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, u32 flow_id, - u16 filter_id); +extern bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, + u32 flow_id, u16 filter_id); #endif /* This structure contains an instance of an RX queue. */ @@ -962,25 +961,6 @@ struct netdev_phys_port_id { * Called by vxlan to notify the driver about a UDP port and socket * address family that vxlan is not listening to anymore. The operation * is protected by the vxlan_net->sock_lock. - * - * void* (*ndo_dfwd_add_station)(struct net_device *pdev, - * struct net_device *dev) - * Called by upper layer devices to accelerate switching or other - * station functionality into hardware. 'pdev is the lowerdev - * to use for the offload and 'dev' is the net device that will - * back the offload. Returns a pointer to the private structure - * the upper layer will maintain. - * void (*ndo_dfwd_del_station)(struct net_device *pdev, void *priv) - * Called by upper layer device to delete the station created - * by 'ndo_dfwd_add_station'. 'pdev' is the net device backing - * the station and priv is the structure returned by the add - * operation. - * netdev_tx_t (*ndo_dfwd_start_xmit)(struct sk_buff *skb, - * struct net_device *dev, - * void *priv); - * Callback to use for xmit over the accelerated station. This - * is used in place of ndo_start_xmit on accelerated net - * devices. */ struct net_device_ops { int (*ndo_init)(struct net_device *dev); @@ -1117,15 +1097,6 @@ struct net_device_ops { void (*ndo_del_vxlan_port)(struct net_device *dev, sa_family_t sa_family, __be16 port); - - void* (*ndo_dfwd_add_station)(struct net_device *pdev, - struct net_device *dev); - void (*ndo_dfwd_del_station)(struct net_device *pdev, - void *priv); - - netdev_tx_t (*ndo_dfwd_start_xmit) (struct sk_buff *skb, - struct net_device *dev, - void *priv); }; /* @@ -1160,7 +1131,7 @@ struct net_device { unsigned long mem_end; /* shared mem end */ unsigned long mem_start; /* shared mem start */ unsigned long base_addr; /* device I/O address */ - int irq; /* device IRQ number */ + unsigned int irq; /* device IRQ number */ /* * Some hardware also needs these fields, but they are not @@ -1172,19 +1143,8 @@ struct net_device { struct list_head dev_list; struct list_head napi_list; struct list_head unreg_list; - struct list_head close_list; - - /* directly linked devices, like slaves for bonding */ - struct { - struct list_head upper; - struct list_head lower; - } adj_list; - - /* all linked devices, *including* neighbours */ - struct { - struct list_head upper; - struct list_head lower; - } all_adj_list; + struct list_head upper_dev_list; /* List of upper devices */ + struct list_head lower_dev_list; /* currently active device features */ @@ -1223,7 +1183,6 @@ struct net_device { /* Management operations */ const struct net_device_ops *netdev_ops; const struct ethtool_ops *ethtool_ops; - const struct forwarding_accel_ops *fwd_ops; /* Hardware header description */ const struct header_ops *header_ops; @@ -1528,9 +1487,9 @@ static inline void netdev_for_each_tx_queue(struct net_device *dev, f(dev, &dev->_tx[i], arg); } -struct netdev_queue *netdev_pick_tx(struct net_device *dev, - struct sk_buff *skb); -u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb); +extern struct netdev_queue *netdev_pick_tx(struct net_device *dev, + struct sk_buff *skb); +extern u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb); /* * Net namespace inlines @@ -1587,7 +1546,7 @@ static inline void *netdev_priv(const struct net_device *dev) #define SET_NETDEV_DEV(net, pdev) ((net)->dev.parent = (pdev)) /* Set the sysfs device type for the network logical device to allow - * fine-grained identification of different network device types. For + * fin grained indentification of different network device types. For * example Ethernet, Wirelss LAN, Bluetooth, WiMAX etc. */ #define SET_NETDEV_DEVTYPE(net, devtype) ((net)->dev.type = (devtype)) @@ -1714,8 +1673,8 @@ struct packet_offload { #define NETDEV_CHANGEUPPER 0x0015 #define NETDEV_RESEND_IGMP 0x0016 -int register_netdevice_notifier(struct notifier_block *nb); -int unregister_netdevice_notifier(struct notifier_block *nb); +extern int register_netdevice_notifier(struct notifier_block *nb); +extern int unregister_netdevice_notifier(struct notifier_block *nb); struct netdev_notifier_info { struct net_device *dev; @@ -1738,9 +1697,9 @@ netdev_notifier_info_to_dev(const struct netdev_notifier_info *info) return info->dev; } -int call_netdevice_notifiers_info(unsigned long val, struct net_device *dev, - struct netdev_notifier_info *info); -int call_netdevice_notifiers(unsigned long val, struct net_device *dev); +extern int call_netdevice_notifiers_info(unsigned long val, struct net_device *dev, + struct netdev_notifier_info *info); +extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); extern rwlock_t dev_base_lock; /* Device list lock */ @@ -1795,53 +1754,54 @@ static inline struct net_device *first_net_device_rcu(struct net *net) return lh == &net->dev_base_head ? NULL : net_device_entry(lh); } -int netdev_boot_setup_check(struct net_device *dev); -unsigned long netdev_boot_base(const char *prefix, int unit); -struct net_device *dev_getbyhwaddr_rcu(struct net *net, unsigned short type, - const char *hwaddr); -struct net_device *dev_getfirstbyhwtype(struct net *net, unsigned short type); -struct net_device *__dev_getfirstbyhwtype(struct net *net, unsigned short type); -void dev_add_pack(struct packet_type *pt); -void dev_remove_pack(struct packet_type *pt); -void __dev_remove_pack(struct packet_type *pt); -void dev_add_offload(struct packet_offload *po); -void dev_remove_offload(struct packet_offload *po); -void __dev_remove_offload(struct packet_offload *po); - -struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags, - unsigned short mask); -struct net_device *dev_get_by_name(struct net *net, const char *name); -struct net_device *dev_get_by_name_rcu(struct net *net, const char *name); -struct net_device *__dev_get_by_name(struct net *net, const char *name); -int dev_alloc_name(struct net_device *dev, const char *name); -int dev_open(struct net_device *dev); -int dev_close(struct net_device *dev); -void dev_disable_lro(struct net_device *dev); -int dev_loopback_xmit(struct sk_buff *newskb); -int dev_queue_xmit(struct sk_buff *skb); -int register_netdevice(struct net_device *dev); -void unregister_netdevice_queue(struct net_device *dev, struct list_head *head); -void unregister_netdevice_many(struct list_head *head); +extern int netdev_boot_setup_check(struct net_device *dev); +extern unsigned long netdev_boot_base(const char *prefix, int unit); +extern struct net_device *dev_getbyhwaddr_rcu(struct net *net, unsigned short type, + const char *hwaddr); +extern struct net_device *dev_getfirstbyhwtype(struct net *net, unsigned short type); +extern struct net_device *__dev_getfirstbyhwtype(struct net *net, unsigned short type); +extern void dev_add_pack(struct packet_type *pt); +extern void dev_remove_pack(struct packet_type *pt); +extern void __dev_remove_pack(struct packet_type *pt); +extern void dev_add_offload(struct packet_offload *po); +extern void dev_remove_offload(struct packet_offload *po); +extern void __dev_remove_offload(struct packet_offload *po); + +extern struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags, + unsigned short mask); +extern struct net_device *dev_get_by_name(struct net *net, const char *name); +extern struct net_device *dev_get_by_name_rcu(struct net *net, const char *name); +extern struct net_device *__dev_get_by_name(struct net *net, const char *name); +extern int dev_alloc_name(struct net_device *dev, const char *name); +extern int dev_open(struct net_device *dev); +extern int dev_close(struct net_device *dev); +extern void dev_disable_lro(struct net_device *dev); +extern int dev_loopback_xmit(struct sk_buff *newskb); +extern int dev_queue_xmit(struct sk_buff *skb); +extern int register_netdevice(struct net_device *dev); +extern void unregister_netdevice_queue(struct net_device *dev, + struct list_head *head); +extern void unregister_netdevice_many(struct list_head *head); static inline void unregister_netdevice(struct net_device *dev) { unregister_netdevice_queue(dev, NULL); } -int netdev_refcnt_read(const struct net_device *dev); -void free_netdev(struct net_device *dev); -void netdev_freemem(struct net_device *dev); -void synchronize_net(void); -int init_dummy_netdev(struct net_device *dev); +extern int netdev_refcnt_read(const struct net_device *dev); +extern void free_netdev(struct net_device *dev); +extern void synchronize_net(void); +extern int init_dummy_netdev(struct net_device *dev); -struct net_device *dev_get_by_index(struct net *net, int ifindex); -struct net_device *__dev_get_by_index(struct net *net, int ifindex); -struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex); -int netdev_get_name(struct net *net, char *name, int ifindex); -int dev_restart(struct net_device *dev); +extern struct net_device *dev_get_by_index(struct net *net, int ifindex); +extern struct net_device *__dev_get_by_index(struct net *net, int ifindex); +extern struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex); +extern int netdev_get_name(struct net *net, char *name, int ifindex); +extern int dev_restart(struct net_device *dev); #ifdef CONFIG_NETPOLL_TRAP -int netpoll_trap(void); +extern int netpoll_trap(void); #endif -int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb); +extern int skb_gro_receive(struct sk_buff **head, + struct sk_buff *skb); static inline unsigned int skb_gro_offset(const struct sk_buff *skb) { @@ -1913,7 +1873,7 @@ static inline int dev_parse_header(const struct sk_buff *skb, } typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len); -int register_gifconf(unsigned int family, gifconf_func_t *gifconf); +extern int register_gifconf(unsigned int family, gifconf_func_t * gifconf); static inline int unregister_gifconf(unsigned int family) { return register_gifconf(family, NULL); @@ -1984,7 +1944,7 @@ static inline void input_queue_tail_incr_save(struct softnet_data *sd, DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data); -void __netif_schedule(struct Qdisc *q); +extern void __netif_schedule(struct Qdisc *q); static inline void netif_schedule_queue(struct netdev_queue *txq) { @@ -2304,8 +2264,9 @@ static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index) } #ifdef CONFIG_XPS -int netif_set_xps_queue(struct net_device *dev, const struct cpumask *mask, - u16 index); +extern int netif_set_xps_queue(struct net_device *dev, + const struct cpumask *mask, + u16 index); #else static inline int netif_set_xps_queue(struct net_device *dev, const struct cpumask *mask, @@ -2336,10 +2297,12 @@ static inline bool netif_is_multiqueue(const struct net_device *dev) return dev->num_tx_queues > 1; } -int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq); +extern int netif_set_real_num_tx_queues(struct net_device *dev, + unsigned int txq); #ifdef CONFIG_RPS -int netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq); +extern int netif_set_real_num_rx_queues(struct net_device *dev, + unsigned int rxq); #else static inline int netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq) @@ -2366,27 +2329,28 @@ static inline int netif_copy_real_num_queues(struct net_device *to_dev, } #define DEFAULT_MAX_NUM_RSS_QUEUES (8) -int netif_get_num_default_rss_queues(void); +extern int netif_get_num_default_rss_queues(void); /* Use this variant when it is known for sure that it * is executing from hardware interrupt context or with hardware interrupts * disabled. */ -void dev_kfree_skb_irq(struct sk_buff *skb); +extern void dev_kfree_skb_irq(struct sk_buff *skb); /* Use this variant in places where it could be invoked * from either hardware interrupt or other context, with hardware interrupts * either disabled or enabled. */ -void dev_kfree_skb_any(struct sk_buff *skb); +extern void dev_kfree_skb_any(struct sk_buff *skb); -int netif_rx(struct sk_buff *skb); -int netif_rx_ni(struct sk_buff *skb); -int netif_receive_skb(struct sk_buff *skb); -gro_result_t napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb); -void napi_gro_flush(struct napi_struct *napi, bool flush_old); -struct sk_buff *napi_get_frags(struct napi_struct *napi); -gro_result_t napi_gro_frags(struct napi_struct *napi); +extern int netif_rx(struct sk_buff *skb); +extern int netif_rx_ni(struct sk_buff *skb); +extern int netif_receive_skb(struct sk_buff *skb); +extern gro_result_t napi_gro_receive(struct napi_struct *napi, + struct sk_buff *skb); +extern void napi_gro_flush(struct napi_struct *napi, bool flush_old); +extern struct sk_buff * napi_get_frags(struct napi_struct *napi); +extern gro_result_t napi_gro_frags(struct napi_struct *napi); static inline void napi_free_frags(struct napi_struct *napi) { @@ -2394,36 +2358,40 @@ static inline void napi_free_frags(struct napi_struct *napi) napi->skb = NULL; } -int netdev_rx_handler_register(struct net_device *dev, - rx_handler_func_t *rx_handler, - void *rx_handler_data); -void netdev_rx_handler_unregister(struct net_device *dev); - -bool dev_valid_name(const char *name); -int dev_ioctl(struct net *net, unsigned int cmd, void __user *); -int dev_ethtool(struct net *net, struct ifreq *); -unsigned int dev_get_flags(const struct net_device *); -int __dev_change_flags(struct net_device *, unsigned int flags); -int dev_change_flags(struct net_device *, unsigned int); -void __dev_notify_flags(struct net_device *, unsigned int old_flags, - unsigned int gchanges); -int dev_change_name(struct net_device *, const char *); -int dev_set_alias(struct net_device *, const char *, size_t); -int dev_change_net_namespace(struct net_device *, struct net *, const char *); -int dev_set_mtu(struct net_device *, int); -void dev_set_group(struct net_device *, int); -int dev_set_mac_address(struct net_device *, struct sockaddr *); -int dev_change_carrier(struct net_device *, bool new_carrier); -int dev_get_phys_port_id(struct net_device *dev, - struct netdev_phys_port_id *ppid); -int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, - struct netdev_queue *txq, void *accel_priv); -int dev_forward_skb(struct net_device *dev, struct sk_buff *skb); +extern int netdev_rx_handler_register(struct net_device *dev, + rx_handler_func_t *rx_handler, + void *rx_handler_data); +extern void netdev_rx_handler_unregister(struct net_device *dev); + +extern bool dev_valid_name(const char *name); +extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); +extern int dev_ethtool(struct net *net, struct ifreq *); +extern unsigned int dev_get_flags(const struct net_device *); +extern int __dev_change_flags(struct net_device *, unsigned int flags); +extern int dev_change_flags(struct net_device *, unsigned int); +extern void __dev_notify_flags(struct net_device *, unsigned int old_flags); +extern int dev_change_name(struct net_device *, const char *); +extern int dev_set_alias(struct net_device *, const char *, size_t); +extern int dev_change_net_namespace(struct net_device *, + struct net *, const char *); +extern int dev_set_mtu(struct net_device *, int); +extern void dev_set_group(struct net_device *, int); +extern int dev_set_mac_address(struct net_device *, + struct sockaddr *); +extern int dev_change_carrier(struct net_device *, + bool new_carrier); +extern int dev_get_phys_port_id(struct net_device *dev, + struct netdev_phys_port_id *ppid); +extern int dev_hard_start_xmit(struct sk_buff *skb, + struct net_device *dev, + struct netdev_queue *txq); +extern int dev_forward_skb(struct net_device *dev, + struct sk_buff *skb); extern int netdev_budget; /* Called by rtnetlink.c:rtnl_unlock() */ -void netdev_run_todo(void); +extern void netdev_run_todo(void); /** * dev_put - release reference to device @@ -2456,9 +2424,9 @@ static inline void dev_hold(struct net_device *dev) * kind of lower layer not just hardware media. */ -void linkwatch_init_dev(struct net_device *dev); -void linkwatch_fire_event(struct net_device *dev); -void linkwatch_forget_dev(struct net_device *dev); +extern void linkwatch_init_dev(struct net_device *dev); +extern void linkwatch_fire_event(struct net_device *dev); +extern void linkwatch_forget_dev(struct net_device *dev); /** * netif_carrier_ok - test if carrier present @@ -2471,13 +2439,13 @@ static inline bool netif_carrier_ok(const struct net_device *dev) return !test_bit(__LINK_STATE_NOCARRIER, &dev->state); } -unsigned long dev_trans_start(struct net_device *dev); +extern unsigned long dev_trans_start(struct net_device *dev); -void __netdev_watchdog_up(struct net_device *dev); +extern void __netdev_watchdog_up(struct net_device *dev); -void netif_carrier_on(struct net_device *dev); +extern void netif_carrier_on(struct net_device *dev); -void netif_carrier_off(struct net_device *dev); +extern void netif_carrier_off(struct net_device *dev); /** * netif_dormant_on - mark device as dormant. @@ -2545,9 +2513,9 @@ static inline bool netif_device_present(struct net_device *dev) return test_bit(__LINK_STATE_PRESENT, &dev->state); } -void netif_device_detach(struct net_device *dev); +extern void netif_device_detach(struct net_device *dev); -void netif_device_attach(struct net_device *dev); +extern void netif_device_attach(struct net_device *dev); /* * Network interface message level settings @@ -2756,138 +2724,119 @@ static inline void netif_addr_unlock_bh(struct net_device *dev) /* These functions live elsewhere (drivers/net/net_init.c, but related) */ -void ether_setup(struct net_device *dev); +extern void ether_setup(struct net_device *dev); /* Support for loadable net-drivers */ -struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, - void (*setup)(struct net_device *), - unsigned int txqs, unsigned int rxqs); +extern struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, + void (*setup)(struct net_device *), + unsigned int txqs, unsigned int rxqs); #define alloc_netdev(sizeof_priv, name, setup) \ alloc_netdev_mqs(sizeof_priv, name, setup, 1, 1) #define alloc_netdev_mq(sizeof_priv, name, setup, count) \ alloc_netdev_mqs(sizeof_priv, name, setup, count, count) -int register_netdev(struct net_device *dev); -void unregister_netdev(struct net_device *dev); +extern int register_netdev(struct net_device *dev); +extern void unregister_netdev(struct net_device *dev); /* General hardware address lists handling functions */ -int __hw_addr_add_multiple(struct netdev_hw_addr_list *to_list, - struct netdev_hw_addr_list *from_list, - int addr_len, unsigned char addr_type); -void __hw_addr_del_multiple(struct netdev_hw_addr_list *to_list, - struct netdev_hw_addr_list *from_list, - int addr_len, unsigned char addr_type); -int __hw_addr_sync(struct netdev_hw_addr_list *to_list, - struct netdev_hw_addr_list *from_list, int addr_len); -void __hw_addr_unsync(struct netdev_hw_addr_list *to_list, - struct netdev_hw_addr_list *from_list, int addr_len); -void __hw_addr_flush(struct netdev_hw_addr_list *list); -void __hw_addr_init(struct netdev_hw_addr_list *list); +extern int __hw_addr_add_multiple(struct netdev_hw_addr_list *to_list, + struct netdev_hw_addr_list *from_list, + int addr_len, unsigned char addr_type); +extern void __hw_addr_del_multiple(struct netdev_hw_addr_list *to_list, + struct netdev_hw_addr_list *from_list, + int addr_len, unsigned char addr_type); +extern int __hw_addr_sync(struct netdev_hw_addr_list *to_list, + struct netdev_hw_addr_list *from_list, + int addr_len); +extern void __hw_addr_unsync(struct netdev_hw_addr_list *to_list, + struct netdev_hw_addr_list *from_list, + int addr_len); +extern void __hw_addr_flush(struct netdev_hw_addr_list *list); +extern void __hw_addr_init(struct netdev_hw_addr_list *list); /* Functions used for device addresses handling */ -int dev_addr_add(struct net_device *dev, const unsigned char *addr, - unsigned char addr_type); -int dev_addr_del(struct net_device *dev, const unsigned char *addr, - unsigned char addr_type); -int dev_addr_add_multiple(struct net_device *to_dev, - struct net_device *from_dev, unsigned char addr_type); -int dev_addr_del_multiple(struct net_device *to_dev, - struct net_device *from_dev, unsigned char addr_type); -void dev_addr_flush(struct net_device *dev); -int dev_addr_init(struct net_device *dev); +extern int dev_addr_add(struct net_device *dev, const unsigned char *addr, + unsigned char addr_type); +extern int dev_addr_del(struct net_device *dev, const unsigned char *addr, + unsigned char addr_type); +extern int dev_addr_add_multiple(struct net_device *to_dev, + struct net_device *from_dev, + unsigned char addr_type); +extern int dev_addr_del_multiple(struct net_device *to_dev, + struct net_device *from_dev, + unsigned char addr_type); +extern void dev_addr_flush(struct net_device *dev); +extern int dev_addr_init(struct net_device *dev); /* Functions used for unicast addresses handling */ -int dev_uc_add(struct net_device *dev, const unsigned char *addr); -int dev_uc_add_excl(struct net_device *dev, const unsigned char *addr); -int dev_uc_del(struct net_device *dev, const unsigned char *addr); -int dev_uc_sync(struct net_device *to, struct net_device *from); -int dev_uc_sync_multiple(struct net_device *to, struct net_device *from); -void dev_uc_unsync(struct net_device *to, struct net_device *from); -void dev_uc_flush(struct net_device *dev); -void dev_uc_init(struct net_device *dev); +extern int dev_uc_add(struct net_device *dev, const unsigned char *addr); +extern int dev_uc_add_excl(struct net_device *dev, const unsigned char *addr); +extern int dev_uc_del(struct net_device *dev, const unsigned char *addr); +extern int dev_uc_sync(struct net_device *to, struct net_device *from); +extern int dev_uc_sync_multiple(struct net_device *to, struct net_device *from); +extern void dev_uc_unsync(struct net_device *to, struct net_device *from); +extern void dev_uc_flush(struct net_device *dev); +extern void dev_uc_init(struct net_device *dev); /* Functions used for multicast addresses handling */ -int dev_mc_add(struct net_device *dev, const unsigned char *addr); -int dev_mc_add_global(struct net_device *dev, const unsigned char *addr); -int dev_mc_add_excl(struct net_device *dev, const unsigned char *addr); -int dev_mc_del(struct net_device *dev, const unsigned char *addr); -int dev_mc_del_global(struct net_device *dev, const unsigned char *addr); -int dev_mc_sync(struct net_device *to, struct net_device *from); -int dev_mc_sync_multiple(struct net_device *to, struct net_device *from); -void dev_mc_unsync(struct net_device *to, struct net_device *from); -void dev_mc_flush(struct net_device *dev); -void dev_mc_init(struct net_device *dev); +extern int dev_mc_add(struct net_device *dev, const unsigned char *addr); +extern int dev_mc_add_global(struct net_device *dev, const unsigned char *addr); +extern int dev_mc_add_excl(struct net_device *dev, const unsigned char *addr); +extern int dev_mc_del(struct net_device *dev, const unsigned char *addr); +extern int dev_mc_del_global(struct net_device *dev, const unsigned char *addr); +extern int dev_mc_sync(struct net_device *to, struct net_device *from); +extern int dev_mc_sync_multiple(struct net_device *to, struct net_device *from); +extern void dev_mc_unsync(struct net_device *to, struct net_device *from); +extern void dev_mc_flush(struct net_device *dev); +extern void dev_mc_init(struct net_device *dev); /* Functions used for secondary unicast and multicast support */ -void dev_set_rx_mode(struct net_device *dev); -void __dev_set_rx_mode(struct net_device *dev); -int dev_set_promiscuity(struct net_device *dev, int inc); -int dev_set_allmulti(struct net_device *dev, int inc); -void netdev_state_change(struct net_device *dev); -void netdev_notify_peers(struct net_device *dev); -void netdev_features_change(struct net_device *dev); +extern void dev_set_rx_mode(struct net_device *dev); +extern void __dev_set_rx_mode(struct net_device *dev); +extern int dev_set_promiscuity(struct net_device *dev, int inc); +extern int dev_set_allmulti(struct net_device *dev, int inc); +extern void netdev_state_change(struct net_device *dev); +extern void netdev_notify_peers(struct net_device *dev); +extern void netdev_features_change(struct net_device *dev); /* Load a device via the kmod */ -void dev_load(struct net *net, const char *name); -struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev, - struct rtnl_link_stats64 *storage); -void netdev_stats_to_stats64(struct rtnl_link_stats64 *stats64, - const struct net_device_stats *netdev_stats); +extern void dev_load(struct net *net, const char *name); +extern struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev, + struct rtnl_link_stats64 *storage); +extern void netdev_stats_to_stats64(struct rtnl_link_stats64 *stats64, + const struct net_device_stats *netdev_stats); extern int netdev_max_backlog; extern int netdev_tstamp_prequeue; extern int weight_p; extern int bpf_jit_enable; -bool netdev_has_upper_dev(struct net_device *dev, struct net_device *upper_dev); -bool netdev_has_any_upper_dev(struct net_device *dev); -struct net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *dev, - struct list_head **iter); +extern bool netdev_has_upper_dev(struct net_device *dev, + struct net_device *upper_dev); +extern bool netdev_has_any_upper_dev(struct net_device *dev); +extern struct net_device *netdev_upper_get_next_dev_rcu(struct net_device *dev, + struct list_head **iter); /* iterate through upper list, must be called under RCU read lock */ -#define netdev_for_each_all_upper_dev_rcu(dev, updev, iter) \ - for (iter = &(dev)->all_adj_list.upper, \ - updev = netdev_all_upper_get_next_dev_rcu(dev, &(iter)); \ - updev; \ - updev = netdev_all_upper_get_next_dev_rcu(dev, &(iter))) - -void *netdev_lower_get_next_private(struct net_device *dev, - struct list_head **iter); -void *netdev_lower_get_next_private_rcu(struct net_device *dev, - struct list_head **iter); - -#define netdev_for_each_lower_private(dev, priv, iter) \ - for (iter = (dev)->adj_list.lower.next, \ - priv = netdev_lower_get_next_private(dev, &(iter)); \ - priv; \ - priv = netdev_lower_get_next_private(dev, &(iter))) - -#define netdev_for_each_lower_private_rcu(dev, priv, iter) \ - for (iter = &(dev)->adj_list.lower, \ - priv = netdev_lower_get_next_private_rcu(dev, &(iter)); \ - priv; \ - priv = netdev_lower_get_next_private_rcu(dev, &(iter))) - -void *netdev_adjacent_get_private(struct list_head *adj_list); -struct net_device *netdev_master_upper_dev_get(struct net_device *dev); -struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev); -int netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev); -int netdev_master_upper_dev_link(struct net_device *dev, +#define netdev_for_each_upper_dev_rcu(dev, upper, iter) \ + for (iter = &(dev)->upper_dev_list, \ + upper = netdev_upper_get_next_dev_rcu(dev, &(iter)); \ + upper; \ + upper = netdev_upper_get_next_dev_rcu(dev, &(iter))) + +extern struct net_device *netdev_master_upper_dev_get(struct net_device *dev); +extern struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev); +extern int netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev); -int netdev_master_upper_dev_link_private(struct net_device *dev, - struct net_device *upper_dev, - void *private); -void netdev_upper_dev_unlink(struct net_device *dev, - struct net_device *upper_dev); -void *netdev_lower_dev_get_private_rcu(struct net_device *dev, - struct net_device *lower_dev); -void *netdev_lower_dev_get_private(struct net_device *dev, - struct net_device *lower_dev); -int skb_checksum_help(struct sk_buff *skb); -struct sk_buff *__skb_gso_segment(struct sk_buff *skb, - netdev_features_t features, bool tx_path); -struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb, - netdev_features_t features); +extern int netdev_master_upper_dev_link(struct net_device *dev, + struct net_device *upper_dev); +extern void netdev_upper_dev_unlink(struct net_device *dev, + struct net_device *upper_dev); +extern int skb_checksum_help(struct sk_buff *skb); +extern struct sk_buff *__skb_gso_segment(struct sk_buff *skb, + netdev_features_t features, bool tx_path); +extern struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb, + netdev_features_t features); static inline struct sk_buff *skb_gso_segment(struct sk_buff *skb, netdev_features_t features) @@ -2909,42 +2858,30 @@ static inline bool can_checksum_protocol(netdev_features_t features, } #ifdef CONFIG_BUG -void netdev_rx_csum_fault(struct net_device *dev); +extern void netdev_rx_csum_fault(struct net_device *dev); #else static inline void netdev_rx_csum_fault(struct net_device *dev) { } #endif /* rx skb timestamps */ -void net_enable_timestamp(void); -void net_disable_timestamp(void); +extern void net_enable_timestamp(void); +extern void net_disable_timestamp(void); #ifdef CONFIG_PROC_FS -int __init dev_proc_init(void); +extern int __init dev_proc_init(void); #else #define dev_proc_init() 0 #endif -int netdev_class_create_file_ns(struct class_attribute *class_attr, - const void *ns); -void netdev_class_remove_file_ns(struct class_attribute *class_attr, - const void *ns); - -static inline int netdev_class_create_file(struct class_attribute *class_attr) -{ - return netdev_class_create_file_ns(class_attr, NULL); -} - -static inline void netdev_class_remove_file(struct class_attribute *class_attr) -{ - netdev_class_remove_file_ns(class_attr, NULL); -} +extern int netdev_class_create_file(struct class_attribute *class_attr); +extern void netdev_class_remove_file(struct class_attribute *class_attr); extern struct kobj_ns_type_operations net_ns_type_operations; -const char *netdev_drivername(const struct net_device *dev); +extern const char *netdev_drivername(const struct net_device *dev); -void linkwatch_run_queue(void); +extern void linkwatch_run_queue(void); static inline netdev_features_t netdev_get_wanted_features( struct net_device *dev) @@ -3008,11 +2945,6 @@ static inline void netif_set_gso_max_size(struct net_device *dev, dev->gso_max_size = size; } -static inline bool netif_is_macvlan(struct net_device *dev) -{ - return dev->priv_flags & IFF_MACVLAN; -} - static inline bool netif_is_bond_master(struct net_device *dev) { return dev->flags & IFF_MASTER && dev->priv_flags & IFF_BONDING; @@ -3041,22 +2973,22 @@ static inline const char *netdev_name(const struct net_device *dev) return dev->name; } -__printf(3, 4) +extern __printf(3, 4) int netdev_printk(const char *level, const struct net_device *dev, const char *format, ...); -__printf(2, 3) +extern __printf(2, 3) int netdev_emerg(const struct net_device *dev, const char *format, ...); -__printf(2, 3) +extern __printf(2, 3) int netdev_alert(const struct net_device *dev, const char *format, ...); -__printf(2, 3) +extern __printf(2, 3) int netdev_crit(const struct net_device *dev, const char *format, ...); -__printf(2, 3) +extern __printf(2, 3) int netdev_err(const struct net_device *dev, const char *format, ...); -__printf(2, 3) +extern __printf(2, 3) int netdev_warn(const struct net_device *dev, const char *format, ...); -__printf(2, 3) +extern __printf(2, 3) int netdev_notice(const struct net_device *dev, const char *format, ...); -__printf(2, 3) +extern __printf(2, 3) int netdev_info(const struct net_device *dev, const char *format, ...); #define MODULE_ALIAS_NETDEV(device) \ @@ -3097,7 +3029,7 @@ do { \ * file/line information and a backtrace. */ #define netdev_WARN(dev, format, args...) \ - WARN(1, "netdevice: %s\n" format, netdev_name(dev), ##args) + WARN(1, "netdevice: %s\n" format, netdev_name(dev), ##args); /* netif printk helpers, similar to netdev_printk */ diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 2077489..708fe72ab9 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h @@ -35,15 +35,14 @@ static inline void nf_inet_addr_mask(const union nf_inet_addr *a1, result->all[3] = a1->all[3] & mask->all[3]; } -int netfilter_init(void); +extern int netfilter_init(void); /* Largest hook number + 1 */ #define NF_MAX_HOOKS 8 struct sk_buff; -struct nf_hook_ops; -typedef unsigned int nf_hookfn(const struct nf_hook_ops *ops, +typedef unsigned int nf_hookfn(unsigned int hooknum, struct sk_buff *skb, const struct net_device *in, const struct net_device *out, @@ -53,13 +52,12 @@ struct nf_hook_ops { struct list_head list; /* User fills in from here down. */ - nf_hookfn *hook; - struct module *owner; - void *priv; - u_int8_t pf; - unsigned int hooknum; + nf_hookfn *hook; + struct module *owner; + u_int8_t pf; + unsigned int hooknum; /* Hooks are ordered in ascending priority. */ - int priority; + int priority; }; struct nf_sockopt_ops { @@ -210,7 +208,7 @@ int compat_nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, /* Call this before modifying an existing packet: ensures it is modifiable and linear to the point you care about (writable_len). Returns true or false. */ -int skb_make_writable(struct sk_buff *skb, unsigned int writable_len); +extern int skb_make_writable(struct sk_buff *skb, unsigned int writable_len); struct flowi; struct nf_queue_entry; @@ -271,8 +269,8 @@ nf_checksum_partial(struct sk_buff *skb, unsigned int hook, return csum; } -int nf_register_afinfo(const struct nf_afinfo *afinfo); -void nf_unregister_afinfo(const struct nf_afinfo *afinfo); +extern int nf_register_afinfo(const struct nf_afinfo *afinfo); +extern void nf_unregister_afinfo(const struct nf_afinfo *afinfo); #include <net/flow.h> extern void (*nf_nat_decode_session_hook)(struct sk_buff *, struct flowi *); @@ -317,7 +315,7 @@ nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family) #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) extern void (*ip_ct_attach)(struct sk_buff *, const struct sk_buff *) __rcu; -void nf_ct_attach(struct sk_buff *, const struct sk_buff *); +extern void nf_ct_attach(struct sk_buff *, const struct sk_buff *); extern void (*nf_ct_destroy)(struct nf_conntrack *) __rcu; struct nf_conn; diff --git a/include/linux/netfilter/ipset/ip_set.h b/include/linux/netfilter/ipset/ip_set.h index c7174b8..9ac9fbd 100644 --- a/include/linux/netfilter/ipset/ip_set.h +++ b/include/linux/netfilter/ipset/ip_set.h @@ -49,68 +49,31 @@ enum ip_set_feature { /* Set extensions */ enum ip_set_extension { - IPSET_EXT_BIT_TIMEOUT = 0, + IPSET_EXT_NONE = 0, + IPSET_EXT_BIT_TIMEOUT = 1, IPSET_EXT_TIMEOUT = (1 << IPSET_EXT_BIT_TIMEOUT), - IPSET_EXT_BIT_COUNTER = 1, + IPSET_EXT_BIT_COUNTER = 2, IPSET_EXT_COUNTER = (1 << IPSET_EXT_BIT_COUNTER), - IPSET_EXT_BIT_COMMENT = 2, - IPSET_EXT_COMMENT = (1 << IPSET_EXT_BIT_COMMENT), - /* Mark set with an extension which needs to call destroy */ - IPSET_EXT_BIT_DESTROY = 7, - IPSET_EXT_DESTROY = (1 << IPSET_EXT_BIT_DESTROY), }; -#define SET_WITH_TIMEOUT(s) ((s)->extensions & IPSET_EXT_TIMEOUT) -#define SET_WITH_COUNTER(s) ((s)->extensions & IPSET_EXT_COUNTER) -#define SET_WITH_COMMENT(s) ((s)->extensions & IPSET_EXT_COMMENT) - -/* Extension id, in size order */ -enum ip_set_ext_id { - IPSET_EXT_ID_COUNTER = 0, - IPSET_EXT_ID_TIMEOUT, - IPSET_EXT_ID_COMMENT, - IPSET_EXT_ID_MAX, +/* Extension offsets */ +enum ip_set_offset { + IPSET_OFFSET_TIMEOUT = 0, + IPSET_OFFSET_COUNTER, + IPSET_OFFSET_MAX, }; -/* Extension type */ -struct ip_set_ext_type { - /* Destroy extension private data (can be NULL) */ - void (*destroy)(void *ext); - enum ip_set_extension type; - enum ipset_cadt_flags flag; - /* Size and minimal alignment */ - u8 len; - u8 align; -}; - -extern const struct ip_set_ext_type ip_set_extensions[]; +#define SET_WITH_TIMEOUT(s) ((s)->extensions & IPSET_EXT_TIMEOUT) +#define SET_WITH_COUNTER(s) ((s)->extensions & IPSET_EXT_COUNTER) struct ip_set_ext { + unsigned long timeout; u64 packets; u64 bytes; - u32 timeout; - char *comment; -}; - -struct ip_set_counter { - atomic64_t bytes; - atomic64_t packets; -}; - -struct ip_set_comment { - char *str; }; struct ip_set; -#define ext_timeout(e, s) \ -(unsigned long *)(((void *)(e)) + (s)->offset[IPSET_EXT_ID_TIMEOUT]) -#define ext_counter(e, s) \ -(struct ip_set_counter *)(((void *)(e)) + (s)->offset[IPSET_EXT_ID_COUNTER]) -#define ext_comment(e, s) \ -(struct ip_set_comment *)(((void *)(e)) + (s)->offset[IPSET_EXT_ID_COMMENT]) - - typedef int (*ipset_adtfn)(struct ip_set *set, void *value, const struct ip_set_ext *ext, struct ip_set_ext *mext, u32 cmdflags); @@ -184,8 +147,7 @@ struct ip_set_type { u8 revision_min, revision_max; /* Create set */ - int (*create)(struct net *net, struct ip_set *set, - struct nlattr *tb[], u32 flags); + int (*create)(struct ip_set *set, struct nlattr *tb[], u32 flags); /* Attribute policies */ const struct nla_policy create_policy[IPSET_ATTR_CREATE_MAX + 1]; @@ -217,45 +179,14 @@ struct ip_set { u8 revision; /* Extensions */ u8 extensions; - /* Default timeout value, if enabled */ - u32 timeout; - /* Element data size */ - size_t dsize; - /* Offsets to extensions in elements */ - size_t offset[IPSET_EXT_ID_MAX]; /* The type specific data */ void *data; }; -static inline void -ip_set_ext_destroy(struct ip_set *set, void *data) -{ - /* Check that the extension is enabled for the set and - * call it's destroy function for its extension part in data. - */ - if (SET_WITH_COMMENT(set)) - ip_set_extensions[IPSET_EXT_ID_COMMENT].destroy( - ext_comment(data, set)); -} - -static inline int -ip_set_put_flags(struct sk_buff *skb, struct ip_set *set) -{ - u32 cadt_flags = 0; - - if (SET_WITH_TIMEOUT(set)) - if (unlikely(nla_put_net32(skb, IPSET_ATTR_TIMEOUT, - htonl(set->timeout)))) - return -EMSGSIZE; - if (SET_WITH_COUNTER(set)) - cadt_flags |= IPSET_FLAG_WITH_COUNTERS; - if (SET_WITH_COMMENT(set)) - cadt_flags |= IPSET_FLAG_WITH_COMMENT; - - if (!cadt_flags) - return 0; - return nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(cadt_flags)); -} +struct ip_set_counter { + atomic64_t bytes; + atomic64_t packets; +}; static inline void ip_set_add_bytes(u64 bytes, struct ip_set_counter *counter) @@ -316,24 +247,13 @@ ip_set_init_counter(struct ip_set_counter *counter, atomic64_set(&(counter)->packets, (long long)(ext->packets)); } -/* Netlink CB args */ -enum { - IPSET_CB_NET = 0, - IPSET_CB_DUMP, - IPSET_CB_INDEX, - IPSET_CB_ARG0, - IPSET_CB_ARG1, - IPSET_CB_ARG2, -}; - /* register and unregister set references */ -extern ip_set_id_t ip_set_get_byname(struct net *net, - const char *name, struct ip_set **set); -extern void ip_set_put_byindex(struct net *net, ip_set_id_t index); -extern const char *ip_set_name_byindex(struct net *net, ip_set_id_t index); -extern ip_set_id_t ip_set_nfnl_get(struct net *net, const char *name); -extern ip_set_id_t ip_set_nfnl_get_byindex(struct net *net, ip_set_id_t index); -extern void ip_set_nfnl_put(struct net *net, ip_set_id_t index); +extern ip_set_id_t ip_set_get_byname(const char *name, struct ip_set **set); +extern void ip_set_put_byindex(ip_set_id_t index); +extern const char *ip_set_name_byindex(ip_set_id_t index); +extern ip_set_id_t ip_set_nfnl_get(const char *name); +extern ip_set_id_t ip_set_nfnl_get_byindex(ip_set_id_t index); +extern void ip_set_nfnl_put(ip_set_id_t index); /* API for iptables set match, and SET target */ @@ -352,8 +272,6 @@ extern void *ip_set_alloc(size_t size); extern void ip_set_free(void *members); extern int ip_set_get_ipaddr4(struct nlattr *nla, __be32 *ipaddr); extern int ip_set_get_ipaddr6(struct nlattr *nla, union nf_inet_addr *ipaddr); -extern size_t ip_set_elem_len(struct ip_set *set, struct nlattr *tb[], - size_t len); extern int ip_set_get_extensions(struct ip_set *set, struct nlattr *tb[], struct ip_set_ext *ext); @@ -471,40 +389,13 @@ bitmap_bytes(u32 a, u32 b) } #include <linux/netfilter/ipset/ip_set_timeout.h> -#include <linux/netfilter/ipset/ip_set_comment.h> - -static inline int -ip_set_put_extensions(struct sk_buff *skb, const struct ip_set *set, - const void *e, bool active) -{ - if (SET_WITH_TIMEOUT(set)) { - unsigned long *timeout = ext_timeout(e, set); - - if (nla_put_net32(skb, IPSET_ATTR_TIMEOUT, - htonl(active ? ip_set_timeout_get(timeout) - : *timeout))) - return -EMSGSIZE; - } - if (SET_WITH_COUNTER(set) && - ip_set_put_counter(skb, ext_counter(e, set))) - return -EMSGSIZE; - if (SET_WITH_COMMENT(set) && - ip_set_put_comment(skb, ext_comment(e, set))) - return -EMSGSIZE; - return 0; -} -#define IP_SET_INIT_KEXT(skb, opt, set) \ +#define IP_SET_INIT_KEXT(skb, opt, map) \ { .bytes = (skb)->len, .packets = 1, \ - .timeout = ip_set_adt_opt_timeout(opt, set) } + .timeout = ip_set_adt_opt_timeout(opt, map) } -#define IP_SET_INIT_UEXT(set) \ +#define IP_SET_INIT_UEXT(map) \ { .bytes = ULLONG_MAX, .packets = ULLONG_MAX, \ - .timeout = (set)->timeout } - -#define IP_SET_INIT_CIDR(a, b) ((a) ? (a) : (b)) - -#define IPSET_CONCAT(a, b) a##b -#define IPSET_TOKEN(a, b) IPSET_CONCAT(a, b) + .timeout = (map)->timeout } #endif /*_IP_SET_H */ diff --git a/include/linux/netfilter/ipset/ip_set_comment.h b/include/linux/netfilter/ipset/ip_set_comment.h deleted file mode 100644 index 21217ea..0000000 --- a/include/linux/netfilter/ipset/ip_set_comment.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef _IP_SET_COMMENT_H -#define _IP_SET_COMMENT_H - -/* Copyright (C) 2013 Oliver Smith <oliver@8.c.9.b.0.7.4.0.1.0.0.2.ip6.arpa> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#ifdef __KERNEL__ - -static inline char* -ip_set_comment_uget(struct nlattr *tb) -{ - return nla_data(tb); -} - -static inline void -ip_set_init_comment(struct ip_set_comment *comment, - const struct ip_set_ext *ext) -{ - size_t len = ext->comment ? strlen(ext->comment) : 0; - - if (unlikely(comment->str)) { - kfree(comment->str); - comment->str = NULL; - } - if (!len) - return; - if (unlikely(len > IPSET_MAX_COMMENT_SIZE)) - len = IPSET_MAX_COMMENT_SIZE; - comment->str = kzalloc(len + 1, GFP_ATOMIC); - if (unlikely(!comment->str)) - return; - strlcpy(comment->str, ext->comment, len + 1); -} - -static inline int -ip_set_put_comment(struct sk_buff *skb, struct ip_set_comment *comment) -{ - if (!comment->str) - return 0; - return nla_put_string(skb, IPSET_ATTR_COMMENT, comment->str); -} - -static inline void -ip_set_comment_free(struct ip_set_comment *comment) -{ - if (unlikely(!comment->str)) - return; - kfree(comment->str); - comment->str = NULL; -} - -#endif -#endif diff --git a/include/linux/netfilter/ipset/ip_set_timeout.h b/include/linux/netfilter/ipset/ip_set_timeout.h index 83c2f9e..3aac041 100644 --- a/include/linux/netfilter/ipset/ip_set_timeout.h +++ b/include/linux/netfilter/ipset/ip_set_timeout.h @@ -23,8 +23,8 @@ /* Set is defined with timeout support: timeout value may be 0 */ #define IPSET_NO_TIMEOUT UINT_MAX -#define ip_set_adt_opt_timeout(opt, set) \ -((opt)->ext.timeout != IPSET_NO_TIMEOUT ? (opt)->ext.timeout : (set)->timeout) +#define ip_set_adt_opt_timeout(opt, map) \ +((opt)->ext.timeout != IPSET_NO_TIMEOUT ? (opt)->ext.timeout : (map)->timeout) static inline unsigned int ip_set_timeout_uget(struct nlattr *tb) diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h index 2755057..127d0b9 100644 --- a/include/linux/netfilter/nf_conntrack_common.h +++ b/include/linux/netfilter/nf_conntrack_common.h @@ -23,6 +23,6 @@ struct ip_conntrack_stat { }; /* call to create an explicit dependency on nf_conntrack. */ -void need_conntrack(void); +extern void need_conntrack(void); #endif /* _NF_CONNTRACK_COMMON_H */ diff --git a/include/linux/netfilter/nf_conntrack_h323.h b/include/linux/netfilter/nf_conntrack_h323.h index 858d9b2..f381020 100644 --- a/include/linux/netfilter/nf_conntrack_h323.h +++ b/include/linux/netfilter/nf_conntrack_h323.h @@ -29,13 +29,13 @@ struct nf_ct_h323_master { struct nf_conn; -int get_h225_addr(struct nf_conn *ct, unsigned char *data, - TransportAddress *taddr, union nf_inet_addr *addr, - __be16 *port); -void nf_conntrack_h245_expect(struct nf_conn *new, - struct nf_conntrack_expect *this); -void nf_conntrack_q931_expect(struct nf_conn *new, - struct nf_conntrack_expect *this); +extern int get_h225_addr(struct nf_conn *ct, unsigned char *data, + TransportAddress *taddr, + union nf_inet_addr *addr, __be16 *port); +extern void nf_conntrack_h245_expect(struct nf_conn *new, + struct nf_conntrack_expect *this); +extern void nf_conntrack_q931_expect(struct nf_conn *new, + struct nf_conntrack_expect *this); extern int (*set_h245_addr_hook) (struct sk_buff *skb, unsigned int protoff, unsigned char **data, int dataoff, H245_TransportAddress *taddr, diff --git a/include/linux/netfilter/nf_conntrack_proto_gre.h b/include/linux/netfilter/nf_conntrack_proto_gre.h index ec2ffaf..6a0664c 100644 --- a/include/linux/netfilter/nf_conntrack_proto_gre.h +++ b/include/linux/netfilter/nf_conntrack_proto_gre.h @@ -87,8 +87,8 @@ int nf_ct_gre_keymap_add(struct nf_conn *ct, enum ip_conntrack_dir dir, /* delete keymap entries */ void nf_ct_gre_keymap_destroy(struct nf_conn *ct); -void nf_ct_gre_keymap_flush(struct net *net); -void nf_nat_need_gre(void); +extern void nf_ct_gre_keymap_flush(struct net *net); +extern void nf_nat_need_gre(void); #endif /* __KERNEL__ */ #endif /* _CONNTRACK_PROTO_GRE_H */ diff --git a/include/linux/netfilter/nf_conntrack_sip.h b/include/linux/netfilter/nf_conntrack_sip.h index d5af3c2..ba7f571 100644 --- a/include/linux/netfilter/nf_conntrack_sip.h +++ b/include/linux/netfilter/nf_conntrack_sip.h @@ -107,93 +107,85 @@ enum sdp_header_types { SDP_HDR_MEDIA, }; -struct nf_nat_sip_hooks { - unsigned int (*msg)(struct sk_buff *skb, - unsigned int protoff, - unsigned int dataoff, - const char **dptr, - unsigned int *datalen); - - void (*seq_adjust)(struct sk_buff *skb, - unsigned int protoff, s16 off); - - unsigned int (*expect)(struct sk_buff *skb, - unsigned int protoff, - unsigned int dataoff, - const char **dptr, - unsigned int *datalen, - struct nf_conntrack_expect *exp, - unsigned int matchoff, - unsigned int matchlen); - - unsigned int (*sdp_addr)(struct sk_buff *skb, - unsigned int protoff, - unsigned int dataoff, - const char **dptr, - unsigned int *datalen, - unsigned int sdpoff, +extern unsigned int (*nf_nat_sip_hook)(struct sk_buff *skb, + unsigned int protoff, + unsigned int dataoff, + const char **dptr, + unsigned int *datalen); +extern void (*nf_nat_sip_seq_adjust_hook)(struct sk_buff *skb, + unsigned int protoff, s16 off); +extern unsigned int (*nf_nat_sip_expect_hook)(struct sk_buff *skb, + unsigned int protoff, + unsigned int dataoff, + const char **dptr, + unsigned int *datalen, + struct nf_conntrack_expect *exp, + unsigned int matchoff, + unsigned int matchlen); +extern unsigned int (*nf_nat_sdp_addr_hook)(struct sk_buff *skb, + unsigned int protoff, + unsigned int dataoff, + const char **dptr, + unsigned int *datalen, + unsigned int sdpoff, + enum sdp_header_types type, + enum sdp_header_types term, + const union nf_inet_addr *addr); +extern unsigned int (*nf_nat_sdp_port_hook)(struct sk_buff *skb, + unsigned int protoff, + unsigned int dataoff, + const char **dptr, + unsigned int *datalen, + unsigned int matchoff, + unsigned int matchlen, + u_int16_t port); +extern unsigned int (*nf_nat_sdp_session_hook)(struct sk_buff *skb, + unsigned int protoff, + unsigned int dataoff, + const char **dptr, + unsigned int *datalen, + unsigned int sdpoff, + const union nf_inet_addr *addr); +extern unsigned int (*nf_nat_sdp_media_hook)(struct sk_buff *skb, + unsigned int protoff, + unsigned int dataoff, + const char **dptr, + unsigned int *datalen, + struct nf_conntrack_expect *rtp_exp, + struct nf_conntrack_expect *rtcp_exp, + unsigned int mediaoff, + unsigned int medialen, + union nf_inet_addr *rtp_addr); + +extern int ct_sip_parse_request(const struct nf_conn *ct, + const char *dptr, unsigned int datalen, + unsigned int *matchoff, unsigned int *matchlen, + union nf_inet_addr *addr, __be16 *port); +extern int ct_sip_get_header(const struct nf_conn *ct, const char *dptr, + unsigned int dataoff, unsigned int datalen, + enum sip_header_types type, + unsigned int *matchoff, unsigned int *matchlen); +extern int ct_sip_parse_header_uri(const struct nf_conn *ct, const char *dptr, + unsigned int *dataoff, unsigned int datalen, + enum sip_header_types type, int *in_header, + unsigned int *matchoff, unsigned int *matchlen, + union nf_inet_addr *addr, __be16 *port); +extern int ct_sip_parse_address_param(const struct nf_conn *ct, const char *dptr, + unsigned int dataoff, unsigned int datalen, + const char *name, + unsigned int *matchoff, unsigned int *matchlen, + union nf_inet_addr *addr, bool delim); +extern int ct_sip_parse_numerical_param(const struct nf_conn *ct, const char *dptr, + unsigned int off, unsigned int datalen, + const char *name, + unsigned int *matchoff, unsigned int *matchen, + unsigned int *val); + +extern int ct_sip_get_sdp_header(const struct nf_conn *ct, const char *dptr, + unsigned int dataoff, unsigned int datalen, enum sdp_header_types type, enum sdp_header_types term, - const union nf_inet_addr *addr); - - unsigned int (*sdp_port)(struct sk_buff *skb, - unsigned int protoff, - unsigned int dataoff, - const char **dptr, - unsigned int *datalen, - unsigned int matchoff, - unsigned int matchlen, - u_int16_t port); - - unsigned int (*sdp_session)(struct sk_buff *skb, - unsigned int protoff, - unsigned int dataoff, - const char **dptr, - unsigned int *datalen, - unsigned int sdpoff, - const union nf_inet_addr *addr); - - unsigned int (*sdp_media)(struct sk_buff *skb, - unsigned int protoff, - unsigned int dataoff, - const char **dptr, - unsigned int *datalen, - struct nf_conntrack_expect *rtp_exp, - struct nf_conntrack_expect *rtcp_exp, - unsigned int mediaoff, - unsigned int medialen, - union nf_inet_addr *rtp_addr); -}; -extern const struct nf_nat_sip_hooks *nf_nat_sip_hooks; - -int ct_sip_parse_request(const struct nf_conn *ct, const char *dptr, - unsigned int datalen, unsigned int *matchoff, - unsigned int *matchlen, union nf_inet_addr *addr, - __be16 *port); -int ct_sip_get_header(const struct nf_conn *ct, const char *dptr, - unsigned int dataoff, unsigned int datalen, - enum sip_header_types type, unsigned int *matchoff, - unsigned int *matchlen); -int ct_sip_parse_header_uri(const struct nf_conn *ct, const char *dptr, - unsigned int *dataoff, unsigned int datalen, - enum sip_header_types type, int *in_header, - unsigned int *matchoff, unsigned int *matchlen, - union nf_inet_addr *addr, __be16 *port); -int ct_sip_parse_address_param(const struct nf_conn *ct, const char *dptr, - unsigned int dataoff, unsigned int datalen, - const char *name, unsigned int *matchoff, - unsigned int *matchlen, union nf_inet_addr *addr, - bool delim); -int ct_sip_parse_numerical_param(const struct nf_conn *ct, const char *dptr, - unsigned int off, unsigned int datalen, - const char *name, unsigned int *matchoff, - unsigned int *matchen, unsigned int *val); - -int ct_sip_get_sdp_header(const struct nf_conn *ct, const char *dptr, - unsigned int dataoff, unsigned int datalen, - enum sdp_header_types type, - enum sdp_header_types term, - unsigned int *matchoff, unsigned int *matchlen); + unsigned int *matchoff, unsigned int *matchlen); #endif /* __KERNEL__ */ #endif /* __NF_CONNTRACK_SIP_H__ */ diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index 28c7436..cadb740 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h @@ -14,9 +14,6 @@ struct nfnl_callback { int (*call_rcu)(struct sock *nl, struct sk_buff *skb, const struct nlmsghdr *nlh, const struct nlattr * const cda[]); - int (*call_batch)(struct sock *nl, struct sk_buff *skb, - const struct nlmsghdr *nlh, - const struct nlattr * const cda[]); const struct nla_policy *policy; /* netlink attribute policy */ const u_int16_t attr_count; /* number of nlattr's */ }; @@ -26,24 +23,22 @@ struct nfnetlink_subsystem { __u8 subsys_id; /* nfnetlink subsystem ID */ __u8 cb_count; /* number of callbacks */ const struct nfnl_callback *cb; /* callback for individual types */ - int (*commit)(struct sk_buff *skb); - int (*abort)(struct sk_buff *skb); }; -int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n); -int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n); +extern int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n); +extern int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n); -int nfnetlink_has_listeners(struct net *net, unsigned int group); -struct sk_buff *nfnetlink_alloc_skb(struct net *net, unsigned int size, - u32 dst_portid, gfp_t gfp_mask); -int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 portid, - unsigned int group, int echo, gfp_t flags); -int nfnetlink_set_err(struct net *net, u32 portid, u32 group, int error); -int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u32 portid, - int flags); +extern int nfnetlink_has_listeners(struct net *net, unsigned int group); +extern struct sk_buff *nfnetlink_alloc_skb(struct net *net, unsigned int size, + u32 dst_portid, gfp_t gfp_mask); +extern int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 portid, + unsigned int group, int echo, gfp_t flags); +extern int nfnetlink_set_err(struct net *net, u32 portid, u32 group, int error); +extern int nfnetlink_unicast(struct sk_buff *skb, struct net *net, + u32 portid, int flags); -void nfnl_lock(__u8 subsys_id); -void nfnl_unlock(__u8 subsys_id); +extern void nfnl_lock(__u8 subsys_id); +extern void nfnl_unlock(__u8 subsys_id); #define MODULE_ALIAS_NFNL_SUBSYS(subsys) \ MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys)) diff --git a/include/linux/netfilter/nfnetlink_acct.h b/include/linux/netfilter/nfnetlink_acct.h index b2e85e5..bb4bbc9 100644 --- a/include/linux/netfilter/nfnetlink_acct.h +++ b/include/linux/netfilter/nfnetlink_acct.h @@ -6,8 +6,8 @@ struct nf_acct; -struct nf_acct *nfnl_acct_find_get(const char *filter_name); -void nfnl_acct_put(struct nf_acct *acct); -void nfnl_acct_update(const struct sk_buff *skb, struct nf_acct *nfacct); +extern struct nf_acct *nfnl_acct_find_get(const char *filter_name); +extern void nfnl_acct_put(struct nf_acct *acct); +extern void nfnl_acct_update(const struct sk_buff *skb, struct nf_acct *nfacct); #endif /* _NFNL_ACCT_H */ diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index a3e215b..dd49566 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h @@ -229,48 +229,50 @@ struct xt_table_info { #define XT_TABLE_INFO_SZ (offsetof(struct xt_table_info, entries) \ + nr_cpu_ids * sizeof(char *)) -int xt_register_target(struct xt_target *target); -void xt_unregister_target(struct xt_target *target); -int xt_register_targets(struct xt_target *target, unsigned int n); -void xt_unregister_targets(struct xt_target *target, unsigned int n); - -int xt_register_match(struct xt_match *target); -void xt_unregister_match(struct xt_match *target); -int xt_register_matches(struct xt_match *match, unsigned int n); -void xt_unregister_matches(struct xt_match *match, unsigned int n); - -int xt_check_match(struct xt_mtchk_param *, unsigned int size, u_int8_t proto, - bool inv_proto); -int xt_check_target(struct xt_tgchk_param *, unsigned int size, u_int8_t proto, - bool inv_proto); - -struct xt_table *xt_register_table(struct net *net, - const struct xt_table *table, - struct xt_table_info *bootstrap, - struct xt_table_info *newinfo); -void *xt_unregister_table(struct xt_table *table); - -struct xt_table_info *xt_replace_table(struct xt_table *table, - unsigned int num_counters, - struct xt_table_info *newinfo, - int *error); - -struct xt_match *xt_find_match(u8 af, const char *name, u8 revision); -struct xt_target *xt_find_target(u8 af, const char *name, u8 revision); -struct xt_match *xt_request_find_match(u8 af, const char *name, u8 revision); -struct xt_target *xt_request_find_target(u8 af, const char *name, u8 revision); -int xt_find_revision(u8 af, const char *name, u8 revision, int target, - int *err); - -struct xt_table *xt_find_table_lock(struct net *net, u_int8_t af, - const char *name); -void xt_table_unlock(struct xt_table *t); - -int xt_proto_init(struct net *net, u_int8_t af); -void xt_proto_fini(struct net *net, u_int8_t af); - -struct xt_table_info *xt_alloc_table_info(unsigned int size); -void xt_free_table_info(struct xt_table_info *info); +extern int xt_register_target(struct xt_target *target); +extern void xt_unregister_target(struct xt_target *target); +extern int xt_register_targets(struct xt_target *target, unsigned int n); +extern void xt_unregister_targets(struct xt_target *target, unsigned int n); + +extern int xt_register_match(struct xt_match *target); +extern void xt_unregister_match(struct xt_match *target); +extern int xt_register_matches(struct xt_match *match, unsigned int n); +extern void xt_unregister_matches(struct xt_match *match, unsigned int n); + +extern int xt_check_match(struct xt_mtchk_param *, + unsigned int size, u_int8_t proto, bool inv_proto); +extern int xt_check_target(struct xt_tgchk_param *, + unsigned int size, u_int8_t proto, bool inv_proto); + +extern struct xt_table *xt_register_table(struct net *net, + const struct xt_table *table, + struct xt_table_info *bootstrap, + struct xt_table_info *newinfo); +extern void *xt_unregister_table(struct xt_table *table); + +extern struct xt_table_info *xt_replace_table(struct xt_table *table, + unsigned int num_counters, + struct xt_table_info *newinfo, + int *error); + +extern struct xt_match *xt_find_match(u8 af, const char *name, u8 revision); +extern struct xt_target *xt_find_target(u8 af, const char *name, u8 revision); +extern struct xt_match *xt_request_find_match(u8 af, const char *name, + u8 revision); +extern struct xt_target *xt_request_find_target(u8 af, const char *name, + u8 revision); +extern int xt_find_revision(u8 af, const char *name, u8 revision, + int target, int *err); + +extern struct xt_table *xt_find_table_lock(struct net *net, u_int8_t af, + const char *name); +extern void xt_table_unlock(struct xt_table *t); + +extern int xt_proto_init(struct net *net, u_int8_t af); +extern void xt_proto_fini(struct net *net, u_int8_t af); + +extern struct xt_table_info *xt_alloc_table_info(unsigned int size); +extern void xt_free_table_info(struct xt_table_info *info); /** * xt_recseq - recursive seqcount for netfilter use @@ -351,8 +353,8 @@ static inline unsigned long ifname_compare_aligned(const char *_a, return ret; } -struct nf_hook_ops *xt_hook_link(const struct xt_table *, nf_hookfn *); -void xt_hook_unlink(const struct xt_table *, struct nf_hook_ops *); +extern struct nf_hook_ops *xt_hook_link(const struct xt_table *, nf_hookfn *); +extern void xt_hook_unlink(const struct xt_table *, struct nf_hook_ops *); #ifdef CONFIG_COMPAT #include <net/compat.h> @@ -412,25 +414,25 @@ struct _compat_xt_align { #define COMPAT_XT_ALIGN(s) __ALIGN_KERNEL((s), __alignof__(struct _compat_xt_align)) -void xt_compat_lock(u_int8_t af); -void xt_compat_unlock(u_int8_t af); - -int xt_compat_add_offset(u_int8_t af, unsigned int offset, int delta); -void xt_compat_flush_offsets(u_int8_t af); -void xt_compat_init_offsets(u_int8_t af, unsigned int number); -int xt_compat_calc_jump(u_int8_t af, unsigned int offset); - -int xt_compat_match_offset(const struct xt_match *match); -int xt_compat_match_from_user(struct xt_entry_match *m, void **dstptr, - unsigned int *size); -int xt_compat_match_to_user(const struct xt_entry_match *m, - void __user **dstptr, unsigned int *size); - -int xt_compat_target_offset(const struct xt_target *target); -void xt_compat_target_from_user(struct xt_entry_target *t, void **dstptr, - unsigned int *size); -int xt_compat_target_to_user(const struct xt_entry_target *t, - void __user **dstptr, unsigned int *size); +extern void xt_compat_lock(u_int8_t af); +extern void xt_compat_unlock(u_int8_t af); + +extern int xt_compat_add_offset(u_int8_t af, unsigned int offset, int delta); +extern void xt_compat_flush_offsets(u_int8_t af); +extern void xt_compat_init_offsets(u_int8_t af, unsigned int number); +extern int xt_compat_calc_jump(u_int8_t af, unsigned int offset); + +extern int xt_compat_match_offset(const struct xt_match *match); +extern int xt_compat_match_from_user(struct xt_entry_match *m, + void **dstptr, unsigned int *size); +extern int xt_compat_match_to_user(const struct xt_entry_match *m, + void __user **dstptr, unsigned int *size); + +extern int xt_compat_target_offset(const struct xt_target *target); +extern void xt_compat_target_from_user(struct xt_entry_target *t, + void **dstptr, unsigned int *size); +extern int xt_compat_target_to_user(const struct xt_entry_target *t, + void __user **dstptr, unsigned int *size); #endif /* CONFIG_COMPAT */ #endif /* _X_TABLES_H */ diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h index 8ab1c27..dfb4d9e 100644 --- a/include/linux/netfilter_bridge.h +++ b/include/linux/netfilter_bridge.h @@ -25,7 +25,7 @@ enum nf_br_hook_priorities { #define BRNF_PPPoE 0x20 /* Only used in br_forward.c */ -int nf_bridge_copy_header(struct sk_buff *skb); +extern int nf_bridge_copy_header(struct sk_buff *skb); static inline int nf_bridge_maybe_copy_header(struct sk_buff *skb) { if (skb->nf_bridge && @@ -53,7 +53,7 @@ static inline unsigned int nf_bridge_mtu_reduction(const struct sk_buff *skb) return 0; } -int br_handle_frame_finish(struct sk_buff *skb); +extern int br_handle_frame_finish(struct sk_buff *skb); /* Only used in br_device.c */ static inline int br_nf_pre_routing_finish_bridge_slow(struct sk_buff *skb) { diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h index 6e4591b..dfaf116 100644 --- a/include/linux/netfilter_ipv4.h +++ b/include/linux/netfilter_ipv4.h @@ -6,7 +6,7 @@ #include <uapi/linux/netfilter_ipv4.h> -int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type); -__sum16 nf_ip_checksum(struct sk_buff *skb, unsigned int hook, - unsigned int dataoff, u_int8_t protocol); +extern int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type); +extern __sum16 nf_ip_checksum(struct sk_buff *skb, unsigned int hook, + unsigned int dataoff, u_int8_t protocol); #endif /*__LINUX_IP_NETFILTER_H*/ diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h index 64dad1cc..2d4df6ce 100644 --- a/include/linux/netfilter_ipv6.h +++ b/include/linux/netfilter_ipv6.h @@ -11,12 +11,12 @@ #ifdef CONFIG_NETFILTER -int ip6_route_me_harder(struct sk_buff *skb); -__sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, - unsigned int dataoff, u_int8_t protocol); +extern int ip6_route_me_harder(struct sk_buff *skb); +extern __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, + unsigned int dataoff, u_int8_t protocol); -int ipv6_netfilter_init(void); -void ipv6_netfilter_fini(void); +extern int ipv6_netfilter_init(void); +extern void ipv6_netfilter_fini(void); /* * Hook functions for ipv6 to allow xt_* modules to be built-in even diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index fbfdb9d..f3c7c24 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h @@ -24,8 +24,7 @@ struct netpoll { struct net_device *dev; char dev_name[IFNAMSIZ]; const char *name; - void (*rx_skb_hook)(struct netpoll *np, int source, struct sk_buff *skb, - int offset, int len); + void (*rx_hook)(struct netpoll *, int, char *, int); union inet_addr local_ip, remote_ip; bool ipv6; @@ -42,7 +41,7 @@ struct netpoll_info { unsigned long rx_flags; spinlock_t rx_lock; struct semaphore dev_lock; - struct list_head rx_np; /* netpolls that registered an rx_skb_hook */ + struct list_head rx_np; /* netpolls that registered an rx_hook */ struct sk_buff_head neigh_tx; /* list of neigh requests to reply to */ struct sk_buff_head txq; diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 12c2cb9..e36dee5 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h @@ -118,9 +118,6 @@ Needs to be updated if more operations are defined in future.*/ #define FIRST_NFS4_OP OP_ACCESS #define LAST_NFS4_OP OP_RECLAIM_COMPLETE -#define LAST_NFS40_OP OP_RELEASE_LOCKOWNER -#define LAST_NFS41_OP OP_RECLAIM_COMPLETE -#define LAST_NFS42_OP OP_RECLAIM_COMPLETE enum nfsstat4 { NFS4_OK = 0, @@ -398,9 +395,7 @@ enum lock_type4 { #define FATTR4_WORD1_FS_LAYOUT_TYPES (1UL << 30) #define FATTR4_WORD2_LAYOUT_BLKSIZE (1UL << 1) #define FATTR4_WORD2_MDSTHRESHOLD (1UL << 4) -#define FATTR4_WORD2_SECURITY_LABEL (1UL << 16) -#define FATTR4_WORD2_CHANGE_SECURITY_LABEL \ - (1UL << 17) +#define FATTR4_WORD2_SECURITY_LABEL (1UL << 17) /* MDS threshold bitmap bits */ #define THRESHOLD_RD (1UL << 0) @@ -413,6 +408,16 @@ enum lock_type4 { #define NFS4_VERSION 4 #define NFS4_MINOR_VERSION 0 +#if defined(CONFIG_NFS_V4_2) +#define NFS4_MAX_MINOR_VERSION 2 +#else +#if defined(CONFIG_NFS_V4_1) +#define NFS4_MAX_MINOR_VERSION 1 +#else +#define NFS4_MAX_MINOR_VERSION 0 +#endif /* CONFIG_NFS_V4_1 */ +#endif /* CONFIG_NFS_V4_2 */ + #define NFS4_DEBUG 1 /* Index of predefined Linux client operations */ @@ -455,7 +460,6 @@ enum { NFSPROC4_CLNT_FS_LOCATIONS, NFSPROC4_CLNT_RELEASE_LOCKOWNER, NFSPROC4_CLNT_SECINFO, - NFSPROC4_CLNT_FSID_PRESENT, /* nfs41 */ NFSPROC4_CLNT_EXCHANGE_ID, diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 4899737..3ea4cde 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -269,13 +269,9 @@ static inline int NFS_STALE(const struct inode *inode) return test_bit(NFS_INO_STALE, &NFS_I(inode)->flags); } -static inline struct fscache_cookie *nfs_i_fscache(struct inode *inode) +static inline int NFS_FSCACHE(const struct inode *inode) { -#ifdef CONFIG_NFS_FSCACHE - return NFS_I(inode)->fscache; -#else - return NULL; -#endif + return test_bit(NFS_INO_FSCACHE, &NFS_I(inode)->flags); } static inline __u64 NFS_FILEID(const struct inode *inode) @@ -507,6 +503,24 @@ extern int nfs_mountpoint_expiry_timeout; extern void nfs_release_automount_timer(void); /* + * linux/fs/nfs/nfs4proc.c + */ +#ifdef CONFIG_NFS_V4_SECURITY_LABEL +extern struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags); +static inline void nfs4_label_free(struct nfs4_label *label) +{ + if (label) { + kfree(label->label); + kfree(label); + } + return; +} +#else +static inline struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags) { return NULL; } +static inline void nfs4_label_free(void *label) {} +#endif + +/* * linux/fs/nfs/unlink.c */ extern void nfs_complete_unlink(struct dentry *dentry, struct inode *); diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 1150ea4..b8cedce 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h @@ -41,7 +41,6 @@ struct nfs_client { #define NFS_CS_DISCRTRY 1 /* - disconnect on RPC retry */ #define NFS_CS_MIGRATION 2 /* - transparent state migr */ #define NFS_CS_INFINITE_SLOTS 3 /* - don't limit TCP slots */ -#define NFS_CS_NO_RETRANS_TIMEOUT 4 /* - Disable retransmit timeouts */ struct sockaddr_storage cl_addr; /* server identifier */ size_t cl_addrlen; char * cl_hostname; /* hostname of server */ @@ -79,7 +78,6 @@ struct nfs_client { char cl_ipaddr[48]; u32 cl_cb_ident; /* v4.0 callback identifier */ const struct nfs4_minor_version_ops *cl_mvops; - unsigned long cl_mig_gen; /* NFSv4.0 transport blocking */ struct nfs4_slot_table *cl_slot_tbl; @@ -149,9 +147,7 @@ struct nfs_server { __u64 maxfilesize; /* maximum file size */ struct timespec time_delta; /* smallest time granularity */ unsigned long mount_time; /* when this fs was mounted */ - struct super_block *super; /* VFS super block */ dev_t s_dev; /* superblock dev numbers */ - struct nfs_auth_info auth_info; /* parsed auth flavors */ #ifdef CONFIG_NFS_FSCACHE struct nfs_fscache_key *fscache_key; /* unique key for superblock */ @@ -191,12 +187,6 @@ struct nfs_server { struct list_head state_owners_lru; struct list_head layouts; struct list_head delegations; - - unsigned long mig_gen; - unsigned long mig_status; -#define NFS_MIG_IN_TRANSITION (1) -#define NFS_MIG_FAILED (2) - void (*destroy)(struct nfs_server *); atomic_t active; /* Keep trace of any activity to this server */ diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 3ccfcec..49f52c8 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h @@ -591,13 +591,6 @@ struct nfs_renameres { struct nfs_fattr *new_fattr; }; -/* parsed sec= options */ -#define NFS_AUTH_INFO_MAX_FLAVORS 12 /* see fs/nfs/super.c */ -struct nfs_auth_info { - unsigned int flavor_len; - rpc_authflavor_t flavors[NFS_AUTH_INFO_MAX_FLAVORS]; -}; - /* * Argument struct for decode_entry function */ @@ -1060,18 +1053,14 @@ struct nfs4_fs_locations { struct nfs4_fs_locations_arg { struct nfs4_sequence_args seq_args; const struct nfs_fh *dir_fh; - const struct nfs_fh *fh; const struct qstr *name; struct page *page; const u32 *bitmask; - clientid4 clientid; - unsigned char migration:1, renew:1; }; struct nfs4_fs_locations_res { struct nfs4_sequence_res seq_res; struct nfs4_fs_locations *fs_locations; - unsigned char migration:1, renew:1; }; struct nfs4_secinfo4 { @@ -1095,19 +1084,6 @@ struct nfs4_secinfo_res { struct nfs4_secinfo_flavors *flavors; }; -struct nfs4_fsid_present_arg { - struct nfs4_sequence_args seq_args; - const struct nfs_fh *fh; - clientid4 clientid; - unsigned char renew:1; -}; - -struct nfs4_fsid_present_res { - struct nfs4_sequence_res seq_res; - struct nfs_fh *fh; - unsigned char renew:1; -}; - #endif /* CONFIG_NFS_V4 */ struct nfstime4 { diff --git a/include/linux/of.h b/include/linux/of.h index 276c546..f95aee3 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -136,9 +136,7 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size) return of_read_number(cell, size); } -#if defined(CONFIG_SPARC) #include <asm/prom.h> -#endif /* Default #address and #size cells. Allow arch asm/prom.h to override */ #if !defined(OF_ROOT_NODE_ADDR_CELLS_DEFAULT) @@ -228,19 +226,6 @@ static inline int of_get_child_count(const struct device_node *np) return num; } -static inline int of_get_available_child_count(const struct device_node *np) -{ - struct device_node *child; - int num = 0; - - for_each_available_child_of_node(np, child) - num++; - - return num; -} - -/* cache lookup */ -extern struct device_node *of_find_next_cache_node(const struct device_node *); extern struct device_node *of_find_node_with_property( struct device_node *from, const char *prop_name); #define for_each_node_with_property(dn, prop_name) \ @@ -290,7 +275,6 @@ extern int of_n_size_cells(struct device_node *np); extern const struct of_device_id *of_match_node( const struct of_device_id *matches, const struct device_node *node); extern int of_modalias_node(struct device_node *node, char *modalias, int len); -extern void of_print_phandle_args(const char *msg, const struct of_phandle_args *args); extern struct device_node *of_parse_phandle(const struct device_node *np, const char *phandle_name, int index); @@ -380,9 +364,6 @@ static inline bool of_have_populated_dt(void) #define for_each_child_of_node(parent, child) \ while (0) -#define for_each_available_child_of_node(parent, child) \ - while (0) - static inline struct device_node *of_get_child_by_name( const struct device_node *node, const char *name) @@ -395,11 +376,6 @@ static inline int of_get_child_count(const struct device_node *np) return 0; } -static inline int of_get_available_child_count(const struct device_node *np) -{ - return 0; -} - static inline int of_device_is_compatible(const struct device_node *device, const char *name) { @@ -558,10 +534,13 @@ static inline const char *of_prop_next_string(struct property *prop, #define of_match_node(_matches, _node) NULL #endif /* CONFIG_OF */ -#if defined(CONFIG_OF) && defined(CONFIG_NUMA) -extern int of_node_to_nid(struct device_node *np); -#else -static inline int of_node_to_nid(struct device_node *device) { return 0; } +#ifndef of_node_to_nid +static inline int of_node_to_nid(struct device_node *np) +{ + return numa_node_id(); +} + +#define of_node_to_nid of_node_to_nid #endif /** diff --git a/include/linux/of_address.h b/include/linux/of_address.h index 5f6ed6b..4c2e6f2 100644 --- a/include/linux/of_address.h +++ b/include/linux/of_address.h @@ -34,10 +34,6 @@ static inline void of_pci_range_to_resource(struct of_pci_range *range, res->name = np->full_name; } -/* Translate a DMA address from device space to CPU space */ -extern u64 of_translate_dma_address(struct device_node *dev, - const __be32 *in_addr); - #ifdef CONFIG_OF_ADDRESS extern u64 of_translate_address(struct device_node *np, const __be32 *addr); extern bool of_can_translate_address(struct device_node *dev); @@ -56,7 +52,10 @@ extern void __iomem *of_iomap(struct device_node *device, int index); extern const __be32 *of_get_address(struct device_node *dev, int index, u64 *size, unsigned int *flags); -extern unsigned long pci_address_to_pio(phys_addr_t addr); +#ifndef pci_address_to_pio +static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; } +#define pci_address_to_pio pci_address_to_pio +#endif extern int of_pci_range_parser_init(struct of_pci_range_parser *parser, struct device_node *node); @@ -64,6 +63,13 @@ extern struct of_pci_range *of_pci_range_parser_one( struct of_pci_range_parser *parser, struct of_pci_range *range); #else /* CONFIG_OF_ADDRESS */ +#ifndef of_address_to_resource +static inline int of_address_to_resource(struct device_node *dev, int index, + struct resource *r) +{ + return -EINVAL; +} +#endif static inline struct device_node *of_find_matching_node_by_address( struct device_node *from, const struct of_device_id *matches, @@ -71,7 +77,12 @@ static inline struct device_node *of_find_matching_node_by_address( { return NULL; } - +#ifndef of_iomap +static inline void __iomem *of_iomap(struct device_node *device, int index) +{ + return NULL; +} +#endif static inline const __be32 *of_get_address(struct device_node *dev, int index, u64 *size, unsigned int *flags) { @@ -92,22 +103,6 @@ static inline struct of_pci_range *of_pci_range_parser_one( } #endif /* CONFIG_OF_ADDRESS */ -#ifdef CONFIG_OF -extern int of_address_to_resource(struct device_node *dev, int index, - struct resource *r); -void __iomem *of_iomap(struct device_node *node, int index); -#else -static inline int of_address_to_resource(struct device_node *dev, int index, - struct resource *r) -{ - return -EINVAL; -} - -static inline void __iomem *of_iomap(struct device_node *device, int index) -{ - return NULL; -} -#endif #if defined(CONFIG_OF_ADDRESS) && defined(CONFIG_PCI) extern const __be32 *of_get_pci_address(struct device_node *dev, int bar_no, diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h index 0beaee9..a478c62 100644 --- a/include/linux/of_fdt.h +++ b/include/linux/of_fdt.h @@ -96,30 +96,31 @@ extern int of_scan_flat_dt_by_path(const char *path, extern int early_init_dt_scan_chosen(unsigned long node, const char *uname, int depth, void *data); +extern void early_init_dt_check_for_initrd(unsigned long node); extern int early_init_dt_scan_memory(unsigned long node, const char *uname, int depth, void *data); extern void early_init_dt_add_memory_arch(u64 base, u64 size); extern void * early_init_dt_alloc_memory_arch(u64 size, u64 align); extern u64 dt_mem_next_cell(int s, __be32 **cellp); +/* + * If BLK_DEV_INITRD, the fdt early init code will call this function, + * to be provided by the arch code. start and end are specified as + * physical addresses. + */ +#ifdef CONFIG_BLK_DEV_INITRD +extern void early_init_dt_setup_initrd_arch(u64 start, u64 end); +#endif + /* Early flat tree scan hooks */ extern int early_init_dt_scan_root(unsigned long node, const char *uname, int depth, void *data); -extern bool early_init_dt_scan(void *params); - -extern const char *of_flat_dt_get_machine_name(void); -extern const void *of_flat_dt_match_machine(const void *default_match, - const void * (*get_next_compat)(const char * const**)); - /* Other Prototypes */ extern void unflatten_device_tree(void); -extern void unflatten_and_copy_device_tree(void); extern void early_init_devtree(void *); #else /* CONFIG_OF_FLATTREE */ -static inline const char *of_flat_dt_get_machine_name(void) { return NULL; } static inline void unflatten_device_tree(void) {} -static inline void unflatten_and_copy_device_tree(void) {} #endif /* CONFIG_OF_FLATTREE */ #endif /* __ASSEMBLY__ */ diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h index f14123a..a83dc6f 100644 --- a/include/linux/of_gpio.h +++ b/include/linux/of_gpio.h @@ -19,7 +19,6 @@ #include <linux/errno.h> #include <linux/gpio.h> #include <linux/of.h> -#include <linux/gpio/consumer.h> struct device_node; @@ -48,7 +47,7 @@ static inline struct of_mm_gpio_chip *to_of_mm_gpio_chip(struct gpio_chip *gc) return container_of(gc, struct of_mm_gpio_chip, gc); } -extern struct gpio_desc *of_get_named_gpiod_flags(struct device_node *np, +extern int of_get_named_gpio_flags(struct device_node *np, const char *list_name, int index, enum of_gpio_flags *flags); extern int of_mm_gpiochip_add(struct device_node *np, @@ -63,10 +62,10 @@ extern int of_gpio_simple_xlate(struct gpio_chip *gc, #else /* CONFIG_OF_GPIO */ /* Drivers may not strictly depend on the GPIO support, so let them link. */ -static inline struct gpio_desc *of_get_named_gpiod_flags(struct device_node *np, +static inline int of_get_named_gpio_flags(struct device_node *np, const char *list_name, int index, enum of_gpio_flags *flags) { - return ERR_PTR(-ENOSYS); + return -ENOSYS; } static inline int of_gpio_simple_xlate(struct gpio_chip *gc, @@ -81,18 +80,6 @@ static inline void of_gpiochip_remove(struct gpio_chip *gc) { } #endif /* CONFIG_OF_GPIO */ -static inline int of_get_named_gpio_flags(struct device_node *np, - const char *list_name, int index, enum of_gpio_flags *flags) -{ - struct gpio_desc *desc; - desc = of_get_named_gpiod_flags(np, list_name, index, flags); - - if (IS_ERR(desc)) - return PTR_ERR(desc); - else - return desc_to_gpio(desc); -} - /** * of_gpio_named_count() - Count GPIOs for a device * @np: device node to count GPIOs for @@ -130,21 +117,15 @@ static inline int of_gpio_count(struct device_node *np) } /** - * of_get_gpiod_flags() - Get a GPIO descriptor and flags to use with GPIO API + * of_get_gpio_flags() - Get a GPIO number and flags to use with GPIO API * @np: device node to get GPIO from * @index: index of the GPIO * @flags: a flags pointer to fill in * - * Returns GPIO descriptor to use with Linux generic GPIO API, or a errno + * Returns GPIO number to use with Linux generic GPIO API, or one of the errno * value on the error condition. If @flags is not NULL the function also fills * in flags for the GPIO. */ -static inline struct gpio_desc *of_get_gpiod_flags(struct device_node *np, - int index, enum of_gpio_flags *flags) -{ - return of_get_named_gpiod_flags(np, "gpios", index, flags); -} - static inline int of_get_gpio_flags(struct device_node *np, int index, enum of_gpio_flags *flags) { diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h index 3f23b44..fcd63ba 100644 --- a/include/linux/of_irq.h +++ b/include/linux/of_irq.h @@ -8,6 +8,22 @@ #include <linux/ioport.h> #include <linux/of.h> +/** + * of_irq - container for device_node/irq_specifier pair for an irq controller + * @controller: pointer to interrupt controller device tree node + * @size: size of interrupt specifier + * @specifier: array of cells @size long specifing the specific interrupt + * + * This structure is returned when an interrupt is mapped. The controller + * field needs to be put() after use + */ +#define OF_MAX_IRQ_SPEC 4 /* We handle specifiers of at most 4 cells */ +struct of_irq { + struct device_node *controller; /* Interrupt controller node */ + u32 size; /* Specifier size */ + u32 specifier[OF_MAX_IRQ_SPEC]; /* Specifier copy */ +}; + typedef int (*of_irq_init_cb_t)(struct device_node *, struct device_node *); /* @@ -19,38 +35,35 @@ typedef int (*of_irq_init_cb_t)(struct device_node *, struct device_node *); #if defined(CONFIG_PPC32) && defined(CONFIG_PPC_PMAC) extern unsigned int of_irq_workarounds; extern struct device_node *of_irq_dflt_pic; -extern int of_irq_parse_oldworld(struct device_node *device, int index, - struct of_phandle_args *out_irq); +extern int of_irq_map_oldworld(struct device_node *device, int index, + struct of_irq *out_irq); #else /* CONFIG_PPC32 && CONFIG_PPC_PMAC */ #define of_irq_workarounds (0) #define of_irq_dflt_pic (NULL) -static inline int of_irq_parse_oldworld(struct device_node *device, int index, - struct of_phandle_args *out_irq) +static inline int of_irq_map_oldworld(struct device_node *device, int index, + struct of_irq *out_irq) { return -EINVAL; } #endif /* CONFIG_PPC32 && CONFIG_PPC_PMAC */ -extern int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq); -extern int of_irq_parse_one(struct device_node *device, int index, - struct of_phandle_args *out_irq); -extern unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data); + +extern int of_irq_map_raw(struct device_node *parent, const __be32 *intspec, + u32 ointsize, const __be32 *addr, + struct of_irq *out_irq); +extern int of_irq_map_one(struct device_node *device, int index, + struct of_irq *out_irq); +extern unsigned int irq_create_of_mapping(struct device_node *controller, + const u32 *intspec, + unsigned int intsize); extern int of_irq_to_resource(struct device_node *dev, int index, struct resource *r); +extern int of_irq_count(struct device_node *dev); extern int of_irq_to_resource_table(struct device_node *dev, struct resource *res, int nr_irqs); extern void of_irq_init(const struct of_device_id *matches); -#ifdef CONFIG_OF_IRQ -extern int of_irq_count(struct device_node *dev); -#else -static inline int of_irq_count(struct device_node *dev) -{ - return 0; -} -#endif - #if defined(CONFIG_OF) /* * irq_of_parse_and_map() is used by all OF enabled platforms; but SPARC diff --git a/include/linux/of_mtd.h b/include/linux/of_mtd.h index 6f10e93..ed7f267 100644 --- a/include/linux/of_mtd.h +++ b/include/linux/of_mtd.h @@ -10,29 +10,10 @@ #define __LINUX_OF_NET_H #ifdef CONFIG_OF_MTD - #include <linux/of.h> int of_get_nand_ecc_mode(struct device_node *np); int of_get_nand_bus_width(struct device_node *np); bool of_get_nand_on_flash_bbt(struct device_node *np); - -#else /* CONFIG_OF_MTD */ - -static inline int of_get_nand_ecc_mode(struct device_node *np) -{ - return -ENOSYS; -} - -static inline int of_get_nand_bus_width(struct device_node *np) -{ - return -ENOSYS; -} - -static inline bool of_get_nand_on_flash_bbt(struct device_node *np) -{ - return false; -} - -#endif /* CONFIG_OF_MTD */ +#endif #endif /* __LINUX_OF_MTD_H */ diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h index 1a1f5ff..fd9c408 100644 --- a/include/linux/of_pci.h +++ b/include/linux/of_pci.h @@ -5,9 +5,8 @@ #include <linux/msi.h> struct pci_dev; -struct of_phandle_args; -int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq); -int of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin); +struct of_irq; +int of_irq_map_pci(const struct pci_dev *pdev, struct of_irq *out_irq); struct device_node; struct device_node *of_pci_find_child_device(struct device_node *parent, diff --git a/include/linux/oom.h b/include/linux/oom.h index 4cd6267..da60007 100644 --- a/include/linux/oom.h +++ b/include/linux/oom.h @@ -82,11 +82,6 @@ static inline void oom_killer_enable(void) oom_killer_disabled = false; } -static inline bool oom_gfp_allowed(gfp_t gfp_mask) -{ - return (gfp_mask & __GFP_FS) && !(gfp_mask & __GFP_NORETRY); -} - extern struct task_struct *find_lock_task_mm(struct task_struct *p); /* sysctls */ diff --git a/include/linux/opp.h b/include/linux/opp.h new file mode 100644 index 0000000..3aca2b8 --- /dev/null +++ b/include/linux/opp.h @@ -0,0 +1,134 @@ +/* + * Generic OPP Interface + * + * Copyright (C) 2009-2010 Texas Instruments Incorporated. + * Nishanth Menon + * Romit Dasgupta + * Kevin Hilman + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __LINUX_OPP_H__ +#define __LINUX_OPP_H__ + +#include <linux/err.h> +#include <linux/cpufreq.h> +#include <linux/notifier.h> + +struct opp; +struct device; + +enum opp_event { + OPP_EVENT_ADD, OPP_EVENT_ENABLE, OPP_EVENT_DISABLE, +}; + +#if defined(CONFIG_PM_OPP) + +unsigned long opp_get_voltage(struct opp *opp); + +unsigned long opp_get_freq(struct opp *opp); + +int opp_get_opp_count(struct device *dev); + +struct opp *opp_find_freq_exact(struct device *dev, unsigned long freq, + bool available); + +struct opp *opp_find_freq_floor(struct device *dev, unsigned long *freq); + +struct opp *opp_find_freq_ceil(struct device *dev, unsigned long *freq); + +int opp_add(struct device *dev, unsigned long freq, unsigned long u_volt); + +int opp_enable(struct device *dev, unsigned long freq); + +int opp_disable(struct device *dev, unsigned long freq); + +struct srcu_notifier_head *opp_get_notifier(struct device *dev); +#else +static inline unsigned long opp_get_voltage(struct opp *opp) +{ + return 0; +} + +static inline unsigned long opp_get_freq(struct opp *opp) +{ + return 0; +} + +static inline int opp_get_opp_count(struct device *dev) +{ + return 0; +} + +static inline struct opp *opp_find_freq_exact(struct device *dev, + unsigned long freq, bool available) +{ + return ERR_PTR(-EINVAL); +} + +static inline struct opp *opp_find_freq_floor(struct device *dev, + unsigned long *freq) +{ + return ERR_PTR(-EINVAL); +} + +static inline struct opp *opp_find_freq_ceil(struct device *dev, + unsigned long *freq) +{ + return ERR_PTR(-EINVAL); +} + +static inline int opp_add(struct device *dev, unsigned long freq, + unsigned long u_volt) +{ + return -EINVAL; +} + +static inline int opp_enable(struct device *dev, unsigned long freq) +{ + return 0; +} + +static inline int opp_disable(struct device *dev, unsigned long freq) +{ + return 0; +} + +static inline struct srcu_notifier_head *opp_get_notifier(struct device *dev) +{ + return ERR_PTR(-EINVAL); +} +#endif /* CONFIG_PM_OPP */ + +#if defined(CONFIG_PM_OPP) && defined(CONFIG_OF) +int of_init_opp_table(struct device *dev); +#else +static inline int of_init_opp_table(struct device *dev) +{ + return -EINVAL; +} +#endif + +#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP) +int opp_init_cpufreq_table(struct device *dev, + struct cpufreq_frequency_table **table); +void opp_free_cpufreq_table(struct device *dev, + struct cpufreq_frequency_table **table); +#else +static inline int opp_init_cpufreq_table(struct device *dev, + struct cpufreq_frequency_table **table) +{ + return -EINVAL; +} + +static inline +void opp_free_cpufreq_table(struct device *dev, + struct cpufreq_frequency_table **table) +{ +} +#endif /* CONFIG_CPU_FREQ */ + +#endif /* __LINUX_OPP_H__ */ diff --git a/include/linux/padata.h b/include/linux/padata.h index 4386946..86292be 100644 --- a/include/linux/padata.h +++ b/include/linux/padata.h @@ -129,9 +129,10 @@ struct parallel_data { struct padata_serial_queue __percpu *squeue; atomic_t reorder_objects; atomic_t refcnt; - atomic_t seq_nr; struct padata_cpumask cpumask; spinlock_t lock ____cacheline_aligned; + spinlock_t seq_lock; + unsigned int seq_nr; unsigned int processed; struct timer_list timer; }; diff --git a/include/linux/page-flags-layout.h b/include/linux/page-flags-layout.h index da52366..93506a1 100644 --- a/include/linux/page-flags-layout.h +++ b/include/linux/page-flags-layout.h @@ -38,10 +38,10 @@ * The last is when there is insufficient space in page->flags and a separate * lookup is necessary. * - * No sparsemem or sparsemem vmemmap: | NODE | ZONE | ... | FLAGS | - * " plus space for last_cpupid: | NODE | ZONE | LAST_CPUPID ... | FLAGS | - * classic sparse with space for node:| SECTION | NODE | ZONE | ... | FLAGS | - * " plus space for last_cpupid: | SECTION | NODE | ZONE | LAST_CPUPID ... | FLAGS | + * No sparsemem or sparsemem vmemmap: | NODE | ZONE | ... | FLAGS | + * " plus space for last_nid: | NODE | ZONE | LAST_NID ... | FLAGS | + * classic sparse with space for node:| SECTION | NODE | ZONE | ... | FLAGS | + * " plus space for last_nid: | SECTION | NODE | ZONE | LAST_NID ... | FLAGS | * classic sparse no space for node: | SECTION | ZONE | ... | FLAGS | */ #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) @@ -62,21 +62,15 @@ #endif #ifdef CONFIG_NUMA_BALANCING -#define LAST__PID_SHIFT 8 -#define LAST__PID_MASK ((1 << LAST__PID_SHIFT)-1) - -#define LAST__CPU_SHIFT NR_CPUS_BITS -#define LAST__CPU_MASK ((1 << LAST__CPU_SHIFT)-1) - -#define LAST_CPUPID_SHIFT (LAST__PID_SHIFT+LAST__CPU_SHIFT) +#define LAST_NID_SHIFT NODES_SHIFT #else -#define LAST_CPUPID_SHIFT 0 +#define LAST_NID_SHIFT 0 #endif -#if SECTIONS_WIDTH+ZONES_WIDTH+NODES_SHIFT+LAST_CPUPID_SHIFT <= BITS_PER_LONG - NR_PAGEFLAGS -#define LAST_CPUPID_WIDTH LAST_CPUPID_SHIFT +#if SECTIONS_WIDTH+ZONES_WIDTH+NODES_SHIFT+LAST_NID_SHIFT <= BITS_PER_LONG - NR_PAGEFLAGS +#define LAST_NID_WIDTH LAST_NID_SHIFT #else -#define LAST_CPUPID_WIDTH 0 +#define LAST_NID_WIDTH 0 #endif /* @@ -87,8 +81,8 @@ #define NODE_NOT_IN_PAGE_FLAGS #endif -#if defined(CONFIG_NUMA_BALANCING) && LAST_CPUPID_WIDTH == 0 -#define LAST_CPUPID_NOT_IN_PAGE_FLAGS +#if defined(CONFIG_NUMA_BALANCING) && LAST_NID_WIDTH == 0 +#define LAST_NID_NOT_IN_PAGE_FLAGS #endif #endif /* _LINUX_PAGE_FLAGS_LAYOUT */ diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 98ada58..6d53675 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -329,9 +329,7 @@ static inline void set_page_writeback(struct page *page) * System with lots of page flags available. This allows separate * flags for PageHead() and PageTail() checks of compound pages so that bit * tests can be used in performance sensitive paths. PageCompound is - * generally not used in hot code paths except arch/powerpc/mm/init_64.c - * and arch/powerpc/kvm/book3s_64_vio_hv.c which use it to detect huge pages - * and avoid handling those in real mode. + * generally not used in hot code paths. */ __PAGEFLAG(Head, head) CLEARPAGEFLAG(Head, head) __PAGEFLAG(Tail, tail) diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h index 5a462c4..d006f0c 100644 --- a/include/linux/pci-acpi.h +++ b/include/linux/pci-acpi.h @@ -27,7 +27,7 @@ static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) while (!pci_is_root_bus(pbus)) pbus = pbus->parent; - return ACPI_HANDLE(pbus->bridge); + return DEVICE_ACPI_HANDLE(pbus->bridge); } static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus) @@ -39,7 +39,7 @@ static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus) else dev = &pbus->self->dev; - return ACPI_HANDLE(dev); + return DEVICE_ACPI_HANDLE(dev); } void acpi_pci_add_bus(struct pci_bus *bus); diff --git a/include/linux/pci.h b/include/linux/pci.h index 1084a15..da172f9 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -32,6 +32,7 @@ #include <linux/irqreturn.h> #include <uapi/linux/pci.h> +/* Include the ID list */ #include <linux/pci_ids.h> /* @@ -41,10 +42,9 @@ * * 7:3 = slot * 2:0 = function - * - * PCI_DEVFN(), PCI_SLOT(), and PCI_FUNC() are defined in uapi/linux/pci.h. + * PCI_DEVFN(), PCI_SLOT(), and PCI_FUNC() are defined uapi/linux/pci.h * In the interest of not exposing interfaces to user-space unnecessarily, - * the following kernel-only defines are being added here. + * the following kernel only defines are being added here. */ #define PCI_DEVID(bus, devfn) ((((u16)bus) << 8) | devfn) /* return bus from PCI devid = ((u16)bus_number) << 8) | devfn */ @@ -153,10 +153,10 @@ enum pcie_reset_state { /* Reset is NOT asserted (Use to deassert reset) */ pcie_deassert_reset = (__force pcie_reset_state_t) 1, - /* Use #PERST to reset PCIe device */ + /* Use #PERST to reset PCI-E device */ pcie_warm_reset = (__force pcie_reset_state_t) 2, - /* Use PCIe Hot Reset to reset device */ + /* Use PCI-E Hot Reset to reset device */ pcie_hot_reset = (__force pcie_reset_state_t) 3 }; @@ -259,13 +259,13 @@ struct pci_dev { unsigned int class; /* 3 bytes: (base,sub,prog-if) */ u8 revision; /* PCI revision, low byte of class word */ u8 hdr_type; /* PCI header type (`multi' flag masked out) */ - u8 pcie_cap; /* PCIe capability offset */ + u8 pcie_cap; /* PCI-E capability offset */ u8 msi_cap; /* MSI capability offset */ u8 msix_cap; /* MSI-X capability offset */ - u8 pcie_mpss:3; /* PCIe Max Payload Size Supported */ + u8 pcie_mpss:3; /* PCI-E Max Payload Size Supported */ u8 rom_base_reg; /* which config register controls the ROM */ - u8 pin; /* which interrupt pin this device uses */ - u16 pcie_flags_reg; /* cached PCIe Capabilities Register */ + u8 pin; /* which interrupt pin this device uses */ + u16 pcie_flags_reg; /* cached PCI-E Capabilities Register */ struct pci_driver *driver; /* which driver has allocated this device */ u64 dma_mask; /* Mask of the bits of bus address this @@ -300,7 +300,7 @@ struct pci_dev { unsigned int d3cold_delay; /* D3cold->D0 transition time in ms */ #ifdef CONFIG_PCIEASPM - struct pcie_link_state *link_state; /* ASPM link state */ + struct pcie_link_state *link_state; /* ASPM link state. */ #endif pci_channel_state_t error_state; /* current connectivity state */ @@ -317,7 +317,7 @@ struct pci_dev { bool match_driver; /* Skip attaching driver */ /* These fields are used by common fixups */ - unsigned int transparent:1; /* Subtractive decode PCI bridge */ + unsigned int transparent:1; /* Transparent PCI bridge */ unsigned int multifunction:1;/* Part of multi-function device */ /* keep track of device state */ unsigned int is_added:1; @@ -326,10 +326,12 @@ struct pci_dev { unsigned int block_cfg_access:1; /* config space access is blocked */ unsigned int broken_parity_status:1; /* Device generates false positive parity */ unsigned int irq_reroute_variant:2; /* device needs IRQ rerouting variant */ - unsigned int msi_enabled:1; + unsigned int msi_enabled:1; unsigned int msix_enabled:1; unsigned int ari_enabled:1; /* ARI forwarding */ unsigned int is_managed:1; + unsigned int is_pcie:1; /* Obsolete. Will be removed. + Use pci_is_pcie() instead */ unsigned int needs_freset:1; /* Dev requires fundamental reset */ unsigned int state_saved:1; unsigned int is_physfn:1; @@ -371,6 +373,7 @@ static inline struct pci_dev *pci_physfn(struct pci_dev *dev) if (dev->is_virtfn) dev = dev->physfn; #endif + return dev; } @@ -455,7 +458,7 @@ struct pci_bus { char name[48]; unsigned short bridge_ctl; /* manage NO_ISA/FBB/et al behaviors */ - pci_bus_flags_t bus_flags; /* inherited by child buses */ + pci_bus_flags_t bus_flags; /* Inherited by child busses */ struct device *bridge; struct device dev; struct bin_attribute *legacy_io; /* legacy I/O for this bus */ @@ -467,27 +470,14 @@ struct pci_bus { #define to_pci_bus(n) container_of(n, struct pci_bus, dev) /* - * Returns true if the PCI bus is root (behind host-PCI bridge), + * Returns true if the pci bus is root (behind host-pci bridge), * false otherwise - * - * Some code assumes that "bus->self == NULL" means that bus is a root bus. - * This is incorrect because "virtual" buses added for SR-IOV (via - * virtfn_add_bus()) have "bus->self == NULL" but are not root buses. */ static inline bool pci_is_root_bus(struct pci_bus *pbus) { return !(pbus->parent); } -static inline struct pci_dev *pci_upstream_bridge(struct pci_dev *dev) -{ - dev = pci_physfn(dev); - if (pci_is_root_bus(dev->bus)) - return NULL; - - return dev->bus->self; -} - #ifdef CONFIG_PCI_MSI static inline bool pci_dev_msi_enabled(struct pci_dev *pci_dev) { @@ -509,7 +499,7 @@ static inline bool pci_dev_msi_enabled(struct pci_dev *pci_dev) { return false; #define PCIBIOS_BUFFER_TOO_SMALL 0x89 /* - * Translate above to generic errno for passing back through non-PCI code. + * Translate above to generic errno for passing back through non-pci. */ static inline int pcibios_err_to_errno(int err) { @@ -560,12 +550,11 @@ struct pci_dynids { struct list_head list; /* for IDs added at runtime */ }; - -/* - * PCI Error Recovery System (PCI-ERS). If a PCI device driver provides - * a set of callbacks in struct pci_error_handlers, that device driver - * will be notified of PCI bus errors, and will be driven to recovery - * when an error occurs. +/* ---------------------------------------------------------------- */ +/** PCI Error Recovery System (PCI-ERS). If a PCI device driver provides + * a set of callbacks in struct pci_error_handlers, then that device driver + * will be notified of PCI bus errors, and will be driven to recovery + * when an error occurs. */ typedef unsigned int __bitwise pci_ers_result_t; @@ -609,6 +598,7 @@ struct pci_error_handlers { void (*resume)(struct pci_dev *dev); }; +/* ---------------------------------------------------------------- */ struct module; struct pci_driver { @@ -712,10 +702,10 @@ extern enum pcie_bus_config_types pcie_bus_config; extern struct bus_type pci_bus_type; -/* Do NOT directly access these two variables, unless you are arch-specific PCI - * code, or PCI core code. */ +/* Do NOT directly access these two variables, unless you are arch specific pci + * code, or pci core code. */ extern struct list_head pci_root_buses; /* list of all known PCI buses */ -/* Some device drivers need know if PCI is initiated */ +/* Some device drivers need know if pci is initiated */ int no_pci_devices(void); void pcibios_resource_survey_bus(struct pci_bus *bus); @@ -723,7 +713,7 @@ void pcibios_add_bus(struct pci_bus *bus); void pcibios_remove_bus(struct pci_bus *bus); void pcibios_fixup_bus(struct pci_bus *); int __must_check pcibios_enable_device(struct pci_dev *, int mask); -/* Architecture-specific versions may override this (weak) */ +/* Architecture specific versions may override this (weak) */ char *pcibios_setup(char *str); /* Used only when drivers/pci/setup.c is used */ @@ -1257,7 +1247,7 @@ void pci_cfg_access_unlock(struct pci_dev *dev); /* * PCI domain support. Sometimes called PCI segment (eg by ACPI), - * a PCI domain is defined to be a set of PCI buses which share + * a PCI domain is defined to be a set of PCI busses which share * configuration space. */ #ifdef CONFIG_PCI_DOMAINS @@ -1671,7 +1661,7 @@ extern u8 pci_cache_line_size; extern unsigned long pci_hotplug_io_size; extern unsigned long pci_hotplug_mem_size; -/* Architecture-specific versions may override these (weak) */ +/* Architecture specific versions may override these (weak) */ int pcibios_add_platform_entries(struct pci_dev *dev); void pcibios_disable_device(struct pci_dev *dev); void pcibios_set_master(struct pci_dev *dev); @@ -1759,11 +1749,11 @@ static inline int pci_pcie_cap(struct pci_dev *dev) * pci_is_pcie - check if the PCI device is PCI Express capable * @dev: PCI device * - * Returns: true if the PCI device is PCI Express capable, false otherwise. + * Retrun true if the PCI device is PCI Express capable, false otherwise. */ static inline bool pci_is_pcie(struct pci_dev *dev) { - return pci_pcie_cap(dev); + return !!pci_pcie_cap(dev); } /** diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h index a2e2f1d..430dd96 100644 --- a/include/linux/pci_hotplug.h +++ b/include/linux/pci_hotplug.h @@ -39,8 +39,8 @@ * @hardware_test: Called to run a specified hardware test on the specified * slot. * @get_power_status: Called to get the current power status of a slot. - * If this field is NULL, the value passed in the struct hotplug_slot_info - * will be used when this value is requested by a user. + * If this field is NULL, the value passed in the struct hotplug_slot_info + * will be used when this value is requested by a user. * @get_attention_status: Called to get the current attention status of a slot. * If this field is NULL, the value passed in the struct hotplug_slot_info * will be used when this value is requested by a user. @@ -191,3 +191,4 @@ static inline int pci_get_hp_params(struct pci_dev *dev, void pci_configure_slot(struct pci_dev *dev); #endif + diff --git a/include/linux/pcieport_if.h b/include/linux/pcieport_if.h index 4f1089f..9572669 100644 --- a/include/linux/pcieport_if.h +++ b/include/linux/pcieport_if.h @@ -23,7 +23,7 @@ #define PCIE_PORT_SERVICE_VC (1 << PCIE_PORT_SERVICE_VC_SHIFT) struct pcie_device { - int irq; /* Service IRQ/MSI/MSI-X Vector */ + int irq; /* Service IRQ/MSI/MSI-X Vector */ struct pci_dev *port; /* Root/Upstream/Downstream Port */ u32 service; /* Port service this device represents */ void *priv_data; /* Service Private Data */ diff --git a/include/linux/percpu.h b/include/linux/percpu.h index 9e4761c..c74088a 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h @@ -375,6 +375,22 @@ do { \ # define this_cpu_or(pcp, val) __pcpu_size_call(this_cpu_or_, (pcp), (val)) #endif +#ifndef this_cpu_xor +# ifndef this_cpu_xor_1 +# define this_cpu_xor_1(pcp, val) _this_cpu_generic_to_op((pcp), (val), ^=) +# endif +# ifndef this_cpu_xor_2 +# define this_cpu_xor_2(pcp, val) _this_cpu_generic_to_op((pcp), (val), ^=) +# endif +# ifndef this_cpu_xor_4 +# define this_cpu_xor_4(pcp, val) _this_cpu_generic_to_op((pcp), (val), ^=) +# endif +# ifndef this_cpu_xor_8 +# define this_cpu_xor_8(pcp, val) _this_cpu_generic_to_op((pcp), (val), ^=) +# endif +# define this_cpu_xor(pcp, val) __pcpu_size_call(this_cpu_or_, (pcp), (val)) +#endif + #define _this_cpu_generic_add_return(pcp, val) \ ({ \ typeof(pcp) ret__; \ @@ -613,6 +629,22 @@ do { \ # define __this_cpu_or(pcp, val) __pcpu_size_call(__this_cpu_or_, (pcp), (val)) #endif +#ifndef __this_cpu_xor +# ifndef __this_cpu_xor_1 +# define __this_cpu_xor_1(pcp, val) __this_cpu_generic_to_op((pcp), (val), ^=) +# endif +# ifndef __this_cpu_xor_2 +# define __this_cpu_xor_2(pcp, val) __this_cpu_generic_to_op((pcp), (val), ^=) +# endif +# ifndef __this_cpu_xor_4 +# define __this_cpu_xor_4(pcp, val) __this_cpu_generic_to_op((pcp), (val), ^=) +# endif +# ifndef __this_cpu_xor_8 +# define __this_cpu_xor_8(pcp, val) __this_cpu_generic_to_op((pcp), (val), ^=) +# endif +# define __this_cpu_xor(pcp, val) __pcpu_size_call(__this_cpu_xor_, (pcp), (val)) +#endif + #define __this_cpu_generic_add_return(pcp, val) \ ({ \ __this_cpu_add(pcp, val); \ diff --git a/include/linux/percpu_ida.h b/include/linux/percpu_ida.h index 1900bd0..0b23edb 100644 --- a/include/linux/percpu_ida.h +++ b/include/linux/percpu_ida.h @@ -16,8 +16,6 @@ struct percpu_ida { * percpu_ida_init() */ unsigned nr_tags; - unsigned percpu_max_size; - unsigned percpu_batch_size; struct percpu_ida_cpu __percpu *tag_cpu; @@ -53,29 +51,10 @@ struct percpu_ida { } ____cacheline_aligned_in_smp; }; -/* - * Number of tags we move between the percpu freelist and the global freelist at - * a time - */ -#define IDA_DEFAULT_PCPU_BATCH_MOVE 32U -/* Max size of percpu freelist, */ -#define IDA_DEFAULT_PCPU_SIZE ((IDA_DEFAULT_PCPU_BATCH_MOVE * 3) / 2) - int percpu_ida_alloc(struct percpu_ida *pool, gfp_t gfp); void percpu_ida_free(struct percpu_ida *pool, unsigned tag); void percpu_ida_destroy(struct percpu_ida *pool); -int __percpu_ida_init(struct percpu_ida *pool, unsigned long nr_tags, - unsigned long max_size, unsigned long batch_size); -static inline int percpu_ida_init(struct percpu_ida *pool, unsigned long nr_tags) -{ - return __percpu_ida_init(pool, nr_tags, IDA_DEFAULT_PCPU_SIZE, - IDA_DEFAULT_PCPU_BATCH_MOVE); -} - -typedef int (*percpu_ida_cb)(unsigned, void *); -int percpu_ida_for_each_free(struct percpu_ida *pool, percpu_ida_cb fn, - void *data); +int percpu_ida_init(struct percpu_ida *pool, unsigned long nr_tags); -unsigned percpu_ida_free_tags(struct percpu_ida *pool, int cpu); #endif /* __PERCPU_IDA_H__ */ diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 2e069d1..c8ba627 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -584,10 +584,6 @@ struct perf_sample_data { struct perf_regs_user regs_user; u64 stack_user_size; u64 weight; - /* - * Transaction flags for abort events: - */ - u64 txn; }; static inline void perf_sample_data_init(struct perf_sample_data *data, @@ -603,7 +599,6 @@ static inline void perf_sample_data_init(struct perf_sample_data *data, data->stack_user_size = 0; data->weight = 0; data->data_src.val = 0; - data->txn = 0; } extern void perf_output_sample(struct perf_output_handle *handle, diff --git a/include/linux/phy.h b/include/linux/phy.h index 48a4dc3..64ab823 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -559,7 +559,6 @@ static inline int phy_read_status(struct phy_device *phydev) { return phydev->drv->read_status(phydev); } -int genphy_setup_forced(struct phy_device *phydev); int genphy_restart_aneg(struct phy_device *phydev); int genphy_config_aneg(struct phy_device *phydev); int genphy_update_link(struct phy_device *phydev); diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h deleted file mode 100644 index 6d72269..0000000 --- a/include/linux/phy/phy.h +++ /dev/null @@ -1,270 +0,0 @@ -/* - * phy.h -- generic phy header file - * - * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com - * - * Author: Kishon Vijay Abraham I <kishon@ti.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - */ - -#ifndef __DRIVERS_PHY_H -#define __DRIVERS_PHY_H - -#include <linux/err.h> -#include <linux/of.h> -#include <linux/device.h> -#include <linux/pm_runtime.h> - -struct phy; - -/** - * struct phy_ops - set of function pointers for performing phy operations - * @init: operation to be performed for initializing phy - * @exit: operation to be performed while exiting - * @power_on: powering on the phy - * @power_off: powering off the phy - * @owner: the module owner containing the ops - */ -struct phy_ops { - int (*init)(struct phy *phy); - int (*exit)(struct phy *phy); - int (*power_on)(struct phy *phy); - int (*power_off)(struct phy *phy); - struct module *owner; -}; - -/** - * struct phy - represents the phy device - * @dev: phy device - * @id: id of the phy device - * @ops: function pointers for performing phy operations - * @init_data: list of PHY consumers (non-dt only) - * @mutex: mutex to protect phy_ops - * @init_count: used to protect when the PHY is used by multiple consumers - * @power_count: used to protect when the PHY is used by multiple consumers - */ -struct phy { - struct device dev; - int id; - const struct phy_ops *ops; - struct phy_init_data *init_data; - struct mutex mutex; - int init_count; - int power_count; -}; - -/** - * struct phy_provider - represents the phy provider - * @dev: phy provider device - * @owner: the module owner having of_xlate - * @of_xlate: function pointer to obtain phy instance from phy pointer - * @list: to maintain a linked list of PHY providers - */ -struct phy_provider { - struct device *dev; - struct module *owner; - struct list_head list; - struct phy * (*of_xlate)(struct device *dev, - struct of_phandle_args *args); -}; - -/** - * struct phy_consumer - represents the phy consumer - * @dev_name: the device name of the controller that will use this PHY device - * @port: name given to the consumer port - */ -struct phy_consumer { - const char *dev_name; - const char *port; -}; - -/** - * struct phy_init_data - contains the list of PHY consumers - * @num_consumers: number of consumers for this PHY device - * @consumers: list of PHY consumers - */ -struct phy_init_data { - unsigned int num_consumers; - struct phy_consumer *consumers; -}; - -#define PHY_CONSUMER(_dev_name, _port) \ -{ \ - .dev_name = _dev_name, \ - .port = _port, \ -} - -#define to_phy(dev) (container_of((dev), struct phy, dev)) - -#define of_phy_provider_register(dev, xlate) \ - __of_phy_provider_register((dev), THIS_MODULE, (xlate)) - -#define devm_of_phy_provider_register(dev, xlate) \ - __devm_of_phy_provider_register((dev), THIS_MODULE, (xlate)) - -static inline void phy_set_drvdata(struct phy *phy, void *data) -{ - dev_set_drvdata(&phy->dev, data); -} - -static inline void *phy_get_drvdata(struct phy *phy) -{ - return dev_get_drvdata(&phy->dev); -} - -#if IS_ENABLED(CONFIG_GENERIC_PHY) -int phy_pm_runtime_get(struct phy *phy); -int phy_pm_runtime_get_sync(struct phy *phy); -int phy_pm_runtime_put(struct phy *phy); -int phy_pm_runtime_put_sync(struct phy *phy); -void phy_pm_runtime_allow(struct phy *phy); -void phy_pm_runtime_forbid(struct phy *phy); -int phy_init(struct phy *phy); -int phy_exit(struct phy *phy); -int phy_power_on(struct phy *phy); -int phy_power_off(struct phy *phy); -struct phy *phy_get(struct device *dev, const char *string); -struct phy *devm_phy_get(struct device *dev, const char *string); -void phy_put(struct phy *phy); -void devm_phy_put(struct device *dev, struct phy *phy); -struct phy *of_phy_simple_xlate(struct device *dev, - struct of_phandle_args *args); -struct phy *phy_create(struct device *dev, const struct phy_ops *ops, - struct phy_init_data *init_data); -struct phy *devm_phy_create(struct device *dev, - const struct phy_ops *ops, struct phy_init_data *init_data); -void phy_destroy(struct phy *phy); -void devm_phy_destroy(struct device *dev, struct phy *phy); -struct phy_provider *__of_phy_provider_register(struct device *dev, - struct module *owner, struct phy * (*of_xlate)(struct device *dev, - struct of_phandle_args *args)); -struct phy_provider *__devm_of_phy_provider_register(struct device *dev, - struct module *owner, struct phy * (*of_xlate)(struct device *dev, - struct of_phandle_args *args)); -void of_phy_provider_unregister(struct phy_provider *phy_provider); -void devm_of_phy_provider_unregister(struct device *dev, - struct phy_provider *phy_provider); -#else -static inline int phy_pm_runtime_get(struct phy *phy) -{ - return -ENOSYS; -} - -static inline int phy_pm_runtime_get_sync(struct phy *phy) -{ - return -ENOSYS; -} - -static inline int phy_pm_runtime_put(struct phy *phy) -{ - return -ENOSYS; -} - -static inline int phy_pm_runtime_put_sync(struct phy *phy) -{ - return -ENOSYS; -} - -static inline void phy_pm_runtime_allow(struct phy *phy) -{ - return; -} - -static inline void phy_pm_runtime_forbid(struct phy *phy) -{ - return; -} - -static inline int phy_init(struct phy *phy) -{ - return -ENOSYS; -} - -static inline int phy_exit(struct phy *phy) -{ - return -ENOSYS; -} - -static inline int phy_power_on(struct phy *phy) -{ - return -ENOSYS; -} - -static inline int phy_power_off(struct phy *phy) -{ - return -ENOSYS; -} - -static inline struct phy *phy_get(struct device *dev, const char *string) -{ - return ERR_PTR(-ENOSYS); -} - -static inline struct phy *devm_phy_get(struct device *dev, const char *string) -{ - return ERR_PTR(-ENOSYS); -} - -static inline void phy_put(struct phy *phy) -{ -} - -static inline void devm_phy_put(struct device *dev, struct phy *phy) -{ -} - -static inline struct phy *of_phy_simple_xlate(struct device *dev, - struct of_phandle_args *args) -{ - return ERR_PTR(-ENOSYS); -} - -static inline struct phy *phy_create(struct device *dev, - const struct phy_ops *ops, struct phy_init_data *init_data) -{ - return ERR_PTR(-ENOSYS); -} - -static inline struct phy *devm_phy_create(struct device *dev, - const struct phy_ops *ops, struct phy_init_data *init_data) -{ - return ERR_PTR(-ENOSYS); -} - -static inline void phy_destroy(struct phy *phy) -{ -} - -static inline void devm_phy_destroy(struct device *dev, struct phy *phy) -{ -} - -static inline struct phy_provider *__of_phy_provider_register( - struct device *dev, struct module *owner, struct phy * (*of_xlate)( - struct device *dev, struct of_phandle_args *args)) -{ - return ERR_PTR(-ENOSYS); -} - -static inline struct phy_provider *__devm_of_phy_provider_register(struct device - *dev, struct module *owner, struct phy * (*of_xlate)(struct device *dev, - struct of_phandle_args *args)) -{ - return ERR_PTR(-ENOSYS); -} - -static inline void of_phy_provider_unregister(struct phy_provider *phy_provider) -{ -} - -static inline void devm_of_phy_provider_unregister(struct device *dev, - struct phy_provider *phy_provider) -{ -} -#endif - -#endif /* __DRIVERS_PHY_H */ diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h index 7246ef3..e277266 100644 --- a/include/linux/pid_namespace.h +++ b/include/linux/pid_namespace.h @@ -23,7 +23,6 @@ struct bsd_acct_struct; struct pid_namespace { struct kref kref; struct pidmap pidmap[PIDMAP_ENTRIES]; - struct rcu_head rcu; int last_pid; unsigned int nr_hashed; struct task_struct *child_reaper; diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index fefb886..5979147 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h @@ -144,9 +144,6 @@ extern struct pinctrl_dev *pinctrl_find_and_add_gpio_range(const char *devname, extern struct pinctrl_gpio_range * pinctrl_find_gpio_range_from_pin(struct pinctrl_dev *pctldev, unsigned int pin); -extern int pinctrl_get_group_pins(struct pinctrl_dev *pctldev, - const char *pin_group, const unsigned **pins, - unsigned *num_pins); #ifdef CONFIG_OF extern struct pinctrl_dev *of_pinctrl_get(struct device_node *np); diff --git a/include/linux/platform_data/clk-nomadik.h b/include/linux/platform_data/clk-nomadik.h new file mode 100644 index 0000000..5713c87 --- /dev/null +++ b/include/linux/platform_data/clk-nomadik.h @@ -0,0 +1,2 @@ +/* Minimal platform data header */ +void nomadik_clk_init(void); diff --git a/include/linux/platform_data/clk-ux500.h b/include/linux/platform_data/clk-ux500.h index 97baf83..9d98f3a 100644 --- a/include/linux/platform_data/clk-ux500.h +++ b/include/linux/platform_data/clk-ux500.h @@ -10,9 +10,6 @@ #ifndef __CLK_UX500_H #define __CLK_UX500_H -void u8500_of_clk_init(u32 clkrst1_base, u32 clkrst2_base, u32 clkrst3_base, - u32 clkrst5_base, u32 clkrst6_base); - void u8500_clk_init(u32 clkrst1_base, u32 clkrst2_base, u32 clkrst3_base, u32 clkrst5_base, u32 clkrst6_base); void u9540_clk_init(u32 clkrst1_base, u32 clkrst2_base, u32 clkrst3_base, diff --git a/include/linux/platform_data/davinci_asp.h b/include/linux/platform_data/davinci_asp.h index 689a856..8db5ae0 100644 --- a/include/linux/platform_data/davinci_asp.h +++ b/include/linux/platform_data/davinci_asp.h @@ -84,8 +84,6 @@ struct snd_platform_data { u8 version; u8 txnumevt; u8 rxnumevt; - int tx_dma_channel; - int rx_dma_channel; }; enum { diff --git a/include/linux/platform_data/dma-s3c24xx.h b/include/linux/platform_data/dma-s3c24xx.h deleted file mode 100644 index 89ba1b0..0000000 --- a/include/linux/platform_data/dma-s3c24xx.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * S3C24XX DMA handling - * - * Copyright (c) 2013 Heiko Stuebner <heiko@sntech.de> - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - */ - -/* Helper to encode the source selection constraints for early s3c socs. */ -#define S3C24XX_DMA_CHANREQ(src, chan) ((BIT(3) | src) << chan * 4) - -enum s3c24xx_dma_bus { - S3C24XX_DMA_APB, - S3C24XX_DMA_AHB, -}; - -/** - * @bus: on which bus does the peripheral reside - AHB or APB. - * @handshake: is a handshake with the peripheral necessary - * @chansel: channel selection information, depending on variant; reqsel for - * s3c2443 and later and channel-selection map for earlier SoCs - * see CHANSEL doc in s3c2443-dma.c - */ -struct s3c24xx_dma_channel { - enum s3c24xx_dma_bus bus; - bool handshake; - u16 chansel; -}; - -/** - * struct s3c24xx_dma_platdata - platform specific settings - * @num_phy_channels: number of physical channels - * @channels: array of virtual channel descriptions - * @num_channels: number of virtual channels - */ -struct s3c24xx_dma_platdata { - int num_phy_channels; - struct s3c24xx_dma_channel *channels; - int num_channels; -}; - -struct dma_chan; -bool s3c24xx_dma_filter(struct dma_chan *chan, void *param); diff --git a/include/linux/platform_data/edma.h b/include/linux/platform_data/edma.h index f50821c..179fb91 100644 --- a/include/linux/platform_data/edma.h +++ b/include/linux/platform_data/edma.h @@ -67,10 +67,10 @@ struct edmacc_param { #define ITCCHEN BIT(23) /*ch_status paramater of callback function possible values*/ -#define EDMA_DMA_COMPLETE 1 -#define EDMA_DMA_CC_ERROR 2 -#define EDMA_DMA_TC1_ERROR 3 -#define EDMA_DMA_TC2_ERROR 4 +#define DMA_COMPLETE 1 +#define DMA_CC_ERROR 2 +#define DMA_TC1_ERROR 3 +#define DMA_TC2_ERROR 4 enum address_mode { INCR = 0, diff --git a/include/linux/platform_data/gpio-davinci.h b/include/linux/platform_data/gpio-davinci.h deleted file mode 100644 index 6efd202..0000000 --- a/include/linux/platform_data/gpio-davinci.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * DaVinci GPIO Platform Related Defines - * - * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation version 2. - * - * This program is distributed "as is" WITHOUT ANY WARRANTY of any - * kind, whether express or implied; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#ifndef __DAVINCI_GPIO_PLATFORM_H -#define __DAVINCI_GPIO_PLATFORM_H - -#include <linux/io.h> -#include <linux/spinlock.h> - -#include <asm-generic/gpio.h> - -enum davinci_gpio_type { - GPIO_TYPE_TNETV107X = 0, -}; - -struct davinci_gpio_platform_data { - u32 ngpio; - u32 gpio_unbanked; - u32 intc_irq_num; -}; - - -struct davinci_gpio_controller { - struct gpio_chip chip; - int irq_base; - /* Serialize access to GPIO registers */ - spinlock_t lock; - void __iomem *regs; - void __iomem *set_data; - void __iomem *clr_data; - void __iomem *in_data; - int gpio_unbanked; - unsigned gpio_irq; -}; - -/* - * basic gpio routines - */ -#define GPIO(X) (X) /* 0 <= X <= (DAVINCI_N_GPIO - 1) */ - -/* Convert GPIO signal to GPIO pin number */ -#define GPIO_TO_PIN(bank, gpio) (16 * (bank) + (gpio)) - -static inline u32 __gpio_mask(unsigned gpio) -{ - return 1 << (gpio % 32); -} -#endif diff --git a/include/linux/platform_data/leds-lp55xx.h b/include/linux/platform_data/leds-lp55xx.h index 624ff9e..51a2ff5 100644 --- a/include/linux/platform_data/leds-lp55xx.h +++ b/include/linux/platform_data/leds-lp55xx.h @@ -22,7 +22,6 @@ struct lp55xx_led_config { const char *name; - const char *default_trigger; u8 chan_nr; u8 led_current; /* mA x10, 0 if led is not connected */ u8 max_current; @@ -67,8 +66,10 @@ struct lp55xx_platform_data { /* Clock configuration */ u8 clock_mode; - /* optional enable GPIO */ - int enable_gpio; + /* Platform specific functions */ + int (*setup_resources)(void); + void (*release_resources)(void); + void (*enable)(bool state); /* Predefined pattern data */ struct lp55xx_predef_pattern *patterns; diff --git a/include/linux/platform_data/leds-pca9685.h b/include/linux/platform_data/leds-pca9685.h deleted file mode 100644 index 778e9e4..0000000 --- a/include/linux/platform_data/leds-pca9685.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2013 Maximilian Güntner <maximilian.guentner@gmail.com> - * - * This file is subject to the terms and conditions of version 2 of - * the GNU General Public License. See the file COPYING in the main - * directory of this archive for more details. - * - * Based on leds-pca963x.h by Peter Meerwald <p.meerwald@bct-electronic.com> - * - * LED driver for the NXP PCA9685 PWM chip - * - */ - -#ifndef __LINUX_PCA9685_H -#define __LINUX_PCA9685_H - -#include <linux/leds.h> - -enum pca9685_outdrv { - PCA9685_OPEN_DRAIN, - PCA9685_TOTEM_POLE, -}; - -enum pca9685_inverted { - PCA9685_NOT_INVERTED, - PCA9685_INVERTED, -}; - -struct pca9685_platform_data { - struct led_platform_data leds; - enum pca9685_outdrv outdrv; - enum pca9685_inverted inverted; -}; - -#endif /* __LINUX_PCA9685_H */ diff --git a/include/linux/platform_data/lm3630_bl.h b/include/linux/platform_data/lm3630_bl.h new file mode 100644 index 0000000..9176dd3 --- /dev/null +++ b/include/linux/platform_data/lm3630_bl.h @@ -0,0 +1,57 @@ +/* +* Simple driver for Texas Instruments LM3630 LED Flash driver chip +* Copyright (C) 2012 Texas Instruments +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +* +*/ + +#ifndef __LINUX_LM3630_H +#define __LINUX_LM3630_H + +#define LM3630_NAME "lm3630_bl" + +enum lm3630_pwm_ctrl { + PWM_CTRL_DISABLE = 0, + PWM_CTRL_BANK_A, + PWM_CTRL_BANK_B, + PWM_CTRL_BANK_ALL, +}; + +enum lm3630_pwm_active { + PWM_ACTIVE_HIGH = 0, + PWM_ACTIVE_LOW, +}; + +enum lm3630_bank_a_ctrl { + BANK_A_CTRL_DISABLE = 0x0, + BANK_A_CTRL_LED1 = 0x4, + BANK_A_CTRL_LED2 = 0x1, + BANK_A_CTRL_ALL = 0x5, +}; + +enum lm3630_bank_b_ctrl { + BANK_B_CTRL_DISABLE = 0, + BANK_B_CTRL_LED2, +}; + +struct lm3630_platform_data { + + /* maximum brightness */ + int max_brt_led1; + int max_brt_led2; + + /* initial on brightness */ + int init_brt_led1; + int init_brt_led2; + enum lm3630_pwm_ctrl pwm_ctrl; + enum lm3630_pwm_active pwm_active; + enum lm3630_bank_a_ctrl bank_a_ctrl; + enum lm3630_bank_b_ctrl bank_b_ctrl; + unsigned int pwm_period; + void (*pwm_set_intensity) (int brightness, int max_brightness); +}; + +#endif /* __LINUX_LM3630_H */ diff --git a/include/linux/platform_data/lm3630a_bl.h b/include/linux/platform_data/lm3630a_bl.h deleted file mode 100644 index 7538e38..0000000 --- a/include/linux/platform_data/lm3630a_bl.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -* Simple driver for Texas Instruments LM3630A LED Flash driver chip -* Copyright (C) 2012 Texas Instruments -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -* -*/ - -#ifndef __LINUX_LM3630A_H -#define __LINUX_LM3630A_H - -#define LM3630A_NAME "lm3630a_bl" - -enum lm3630a_pwm_ctrl { - LM3630A_PWM_DISABLE = 0x00, - LM3630A_PWM_BANK_A, - LM3630A_PWM_BANK_B, - LM3630A_PWM_BANK_ALL, - LM3630A_PWM_BANK_A_ACT_LOW = 0x05, - LM3630A_PWM_BANK_B_ACT_LOW, - LM3630A_PWM_BANK_ALL_ACT_LOW, -}; - -enum lm3630a_leda_ctrl { - LM3630A_LEDA_DISABLE = 0x00, - LM3630A_LEDA_ENABLE = 0x04, - LM3630A_LEDA_ENABLE_LINEAR = 0x14, -}; - -enum lm3630a_ledb_ctrl { - LM3630A_LEDB_DISABLE = 0x00, - LM3630A_LEDB_ON_A = 0x01, - LM3630A_LEDB_ENABLE = 0x02, - LM3630A_LEDB_ENABLE_LINEAR = 0x0A, -}; - -#define LM3630A_MAX_BRIGHTNESS 255 -/* - *@leda_init_brt : led a init brightness. 4~255 - *@leda_max_brt : led a max brightness. 4~255 - *@leda_ctrl : led a disable, enable linear, enable exponential - *@ledb_init_brt : led b init brightness. 4~255 - *@ledb_max_brt : led b max brightness. 4~255 - *@ledb_ctrl : led b disable, enable linear, enable exponential - *@pwm_period : pwm period - *@pwm_ctrl : pwm disable, bank a or b, active high or low - */ -struct lm3630a_platform_data { - - /* led a config. */ - int leda_init_brt; - int leda_max_brt; - enum lm3630a_leda_ctrl leda_ctrl; - /* led b config. */ - int ledb_init_brt; - int ledb_max_brt; - enum lm3630a_ledb_ctrl ledb_ctrl; - /* pwm config. */ - unsigned int pwm_period; - enum lm3630a_pwm_ctrl pwm_ctrl; -}; - -#endif /* __LINUX_LM3630A_H */ diff --git a/include/linux/platform_data/lp855x.h b/include/linux/platform_data/lp855x.h index 1b2ba24..ea32005 100644 --- a/include/linux/platform_data/lp855x.h +++ b/include/linux/platform_data/lp855x.h @@ -40,17 +40,6 @@ #define LP8553_PWM_CONFIG LP8550_PWM_CONFIG #define LP8553_I2C_CONFIG LP8550_I2C_CONFIG -/* CONFIG register - LP8555 */ -#define LP8555_PWM_STANDBY BIT(7) -#define LP8555_PWM_FILTER BIT(6) -#define LP8555_RELOAD_EPROM BIT(3) /* use it if EPROMs should be reset - when the backlight turns on */ -#define LP8555_OFF_OPENLEDS BIT(2) -#define LP8555_PWM_CONFIG LP8555_PWM_ONLY -#define LP8555_I2C_CONFIG LP8555_I2C_ONLY -#define LP8555_COMB1_CONFIG LP8555_COMBINED1 -#define LP8555_COMB2_CONFIG LP8555_COMBINED2 - /* DEVICE CONTROL register - LP8556 */ #define LP8556_PWM_CONFIG (LP8556_PWM_ONLY << BRT_MODE_SHFT) #define LP8556_COMB1_CONFIG (LP8556_COMBINED1 << BRT_MODE_SHFT) @@ -76,7 +65,6 @@ enum lp855x_chip_id { LP8551, LP8552, LP8553, - LP8555, LP8556, LP8557, }; @@ -101,13 +89,6 @@ enum lp8553_brighntess_source { LP8553_I2C_ONLY = LP8550_I2C_ONLY, }; -enum lp8555_brightness_source { - LP8555_PWM_ONLY, - LP8555_I2C_ONLY, - LP8555_COMBINED1, /* Brightness register with shaped PWM */ - LP8555_COMBINED2, /* PWM with shaped brightness register */ -}; - enum lp8556_brightness_source { LP8556_PWM_ONLY, LP8556_COMBINED1, /* pwm + i2c before the shaper block */ diff --git a/include/linux/platform_data/mipi-csis.h b/include/linux/platform_data/mipi-csis.h index c2fd902..bf34e17 100644 --- a/include/linux/platform_data/mipi-csis.h +++ b/include/linux/platform_data/mipi-csis.h @@ -25,4 +25,13 @@ struct s5p_platform_mipi_csis { u8 hs_settle; }; +/** + * s5p_csis_phy_enable - global MIPI-CSI receiver D-PHY control + * @id: MIPI-CSIS harware instance index (0...1) + * @on: true to enable D-PHY and deassert its reset + * false to disable D-PHY + * @return: 0 on success, or negative error code on failure + */ +int s5p_csis_phy_enable(int id, bool on); + #endif /* __PLAT_SAMSUNG_MIPI_CSIS_H_ */ diff --git a/include/linux/platform_data/mmc-esdhc-imx.h b/include/linux/platform_data/mmc-esdhc-imx.h index 75f70f6..d44912d 100644 --- a/include/linux/platform_data/mmc-esdhc-imx.h +++ b/include/linux/platform_data/mmc-esdhc-imx.h @@ -10,8 +10,6 @@ #ifndef __ASM_ARCH_IMX_ESDHC_H #define __ASM_ARCH_IMX_ESDHC_H -#include <linux/types.h> - enum wp_types { ESDHC_WP_NONE, /* no WP, neither controller nor gpio */ ESDHC_WP_CONTROLLER, /* mmc controller internal WP */ @@ -34,7 +32,6 @@ enum cd_types { * @cd_gpio: gpio for card_detect interrupt * @wp_type: type of write_protect method (see wp_types enum above) * @cd_type: type of card_detect method (see cd_types enum above) - * @support_vsel: indicate it supports 1.8v switching */ struct esdhc_platform_data { @@ -44,7 +41,5 @@ struct esdhc_platform_data { enum cd_types cd_type; int max_bus_width; unsigned int f_max; - bool support_vsel; - unsigned int delay_line; }; #endif /* __ASM_ARCH_IMX_ESDHC_H */ diff --git a/include/linux/platform_data/mtd-nand-omap2.h b/include/linux/platform_data/mtd-nand-omap2.h index 4da5bfa..6bf9ef4 100644 --- a/include/linux/platform_data/mtd-nand-omap2.h +++ b/include/linux/platform_data/mtd-nand-omap2.h @@ -23,16 +23,13 @@ enum nand_io { }; enum omap_ecc { - /* 1-bit ECC calculation by GPMC, Error detection by Software */ - OMAP_ECC_HAM1_CODE_HW = 0, - /* 4-bit ECC calculation by GPMC, Error detection by Software */ - OMAP_ECC_BCH4_CODE_HW_DETECTION_SW, - /* 4-bit ECC calculation by GPMC, Error detection by ELM */ - OMAP_ECC_BCH4_CODE_HW, - /* 8-bit ECC calculation by GPMC, Error detection by Software */ - OMAP_ECC_BCH8_CODE_HW_DETECTION_SW, - /* 8-bit ECC calculation by GPMC, Error detection by ELM */ - OMAP_ECC_BCH8_CODE_HW, + /* 1-bit ecc: stored at end of spare area */ + OMAP_ECC_HAMMING_CODE_DEFAULT = 0, /* Default, s/w method */ + OMAP_ECC_HAMMING_CODE_HW, /* gpmc to detect the error */ + /* 1-bit ecc: stored at beginning of spare area as romcode */ + OMAP_ECC_HAMMING_CODE_HW_ROMCODE, /* gpmc method & romcode layout */ + OMAP_ECC_BCH4_CODE_HW, /* 4-bit BCH ecc code */ + OMAP_ECC_BCH8_CODE_HW, /* 8-bit BCH ecc code */ }; struct gpmc_nand_regs { @@ -66,6 +63,5 @@ struct omap_nand_platform_data { /* for passing the partitions */ struct device_node *of_node; - struct device_node *elm_of_node; }; #endif diff --git a/include/linux/platform_data/pinctrl-adi2.h b/include/linux/platform_data/pinctrl-adi2.h deleted file mode 100644 index 8f91300..0000000 --- a/include/linux/platform_data/pinctrl-adi2.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Pinctrl Driver for ADI GPIO2 controller - * - * Copyright 2007-2013 Analog Devices Inc. - * - * Licensed under the GPLv2 or later - */ - - -#ifndef PINCTRL_ADI2_H -#define PINCTRL_ADI2_H - -#include <linux/io.h> -#include <linux/platform_device.h> - -/** - * struct adi_pinctrl_gpio_platform_data - Pinctrl gpio platform data - * for ADI GPIO2 device. - * - * @port_gpio_base: Optional global GPIO index of the GPIO bank. - * 0 means driver decides. - * @port_pin_base: Pin index of the pin controller device. - * @port_width: PIN number of the GPIO bank device - * @pint_id: GPIO PINT device id that this GPIO bank should map to. - * @pint_assign: The 32-bit GPIO PINT registers can be divided into 2 parts. A - * GPIO bank can be mapped into either low 16 bits[0] or high 16 - * bits[1] of each PINT register. - * @pint_map: GIOP bank mapping code in PINT device - */ -struct adi_pinctrl_gpio_platform_data { - unsigned int port_gpio_base; - unsigned int port_pin_base; - unsigned int port_width; - u8 pinctrl_id; - u8 pint_id; - bool pint_assign; - u8 pint_map; -}; - -#endif diff --git a/include/linux/platform_data/pinctrl-single.h b/include/linux/platform_data/pinctrl-single.h deleted file mode 100644 index 72eacda..0000000 --- a/include/linux/platform_data/pinctrl-single.h +++ /dev/null @@ -1,12 +0,0 @@ -/** - * irq: optional wake-up interrupt - * rearm: optional soc specific rearm function - * - * Note that the irq and rearm setup should come from device - * tree except for omap where there are still some dependencies - * to the legacy PRM code. - */ -struct pcs_pdata { - int irq; - void (*rearm)(void); -}; diff --git a/include/linux/platform_data/usb-ehci-s5p.h b/include/linux/platform_data/usb-ehci-s5p.h new file mode 100644 index 0000000..5f28cae --- /dev/null +++ b/include/linux/platform_data/usb-ehci-s5p.h @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2011 Samsung Electronics Co.Ltd + * Author: Joonyoung Shim <jy0922.shim@samsung.com> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#ifndef __PLAT_SAMSUNG_EHCI_H +#define __PLAT_SAMSUNG_EHCI_H __FILE__ + +struct s5p_ehci_platdata { + int (*phy_init)(struct platform_device *pdev, int type); + int (*phy_exit)(struct platform_device *pdev, int type); +}; + +extern void s5p_ehci_set_platdata(struct s5p_ehci_platdata *pd); + +#endif /* __PLAT_SAMSUNG_EHCI_H */ diff --git a/include/linux/platform_data/usb-ohci-exynos.h b/include/linux/platform_data/usb-ohci-exynos.h new file mode 100644 index 0000000..c256c59 --- /dev/null +++ b/include/linux/platform_data/usb-ohci-exynos.h @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2011 Samsung Electronics Co.Ltd + * http://www.samsung.com/ + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#ifndef __MACH_EXYNOS_OHCI_H +#define __MACH_EXYNOS_OHCI_H + +struct exynos4_ohci_platdata { + int (*phy_init)(struct platform_device *pdev, int type); + int (*phy_exit)(struct platform_device *pdev, int type); +}; + +extern void exynos4_ohci_set_platdata(struct exynos4_ohci_platdata *pd); + +#endif /* __MACH_EXYNOS_OHCI_H */ diff --git a/include/linux/platform_data/usb-rcar-gen2-phy.h b/include/linux/platform_data/usb-rcar-gen2-phy.h deleted file mode 100644 index dd3ba46..0000000 --- a/include/linux/platform_data/usb-rcar-gen2-phy.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2013 Renesas Solutions Corp. - * Copyright (C) 2013 Cogent Embedded, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#ifndef __USB_RCAR_GEN2_PHY_H -#define __USB_RCAR_GEN2_PHY_H - -#include <linux/types.h> - -struct rcar_gen2_phy_platform_data { - /* USB channel 0 configuration */ - bool chan0_pci:1; /* true: PCI USB host 0, false: USBHS */ - /* USB channel 2 configuration */ - bool chan2_pci:1; /* true: PCI USB host 2, false: USBSS */ -}; - -#endif diff --git a/include/linux/platform_data/zforce_ts.h b/include/linux/platform_data/zforce_ts.h deleted file mode 100644 index 0472ab2..0000000 --- a/include/linux/platform_data/zforce_ts.h +++ /dev/null @@ -1,26 +0,0 @@ -/* drivers/input/touchscreen/zforce.c - * - * Copyright (C) 2012-2013 MundoReader S.L. - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#ifndef _LINUX_INPUT_ZFORCE_TS_H -#define _LINUX_INPUT_ZFORCE_TS_H - -struct zforce_ts_platdata { - int gpio_int; - int gpio_rst; - - unsigned int x_max; - unsigned int y_max; -}; - -#endif /* _LINUX_INPUT_ZFORCE_TS_H */ diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 16f6654..ce8e4ff 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h @@ -178,7 +178,6 @@ struct platform_driver { int (*resume)(struct platform_device *); struct device_driver driver; const struct platform_device_id *id_table; - bool prevent_deferred_probe; }; #define to_platform_driver(drv) (container_of((drv), struct platform_driver, \ diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h deleted file mode 100644 index 5151b00..0000000 --- a/include/linux/pm_opp.h +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Generic OPP Interface - * - * Copyright (C) 2009-2010 Texas Instruments Incorporated. - * Nishanth Menon - * Romit Dasgupta - * Kevin Hilman - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#ifndef __LINUX_OPP_H__ -#define __LINUX_OPP_H__ - -#include <linux/err.h> -#include <linux/cpufreq.h> -#include <linux/notifier.h> - -struct dev_pm_opp; -struct device; - -enum dev_pm_opp_event { - OPP_EVENT_ADD, OPP_EVENT_ENABLE, OPP_EVENT_DISABLE, -}; - -#if defined(CONFIG_PM_OPP) - -unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp); - -unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp); - -int dev_pm_opp_get_opp_count(struct device *dev); - -struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev, - unsigned long freq, - bool available); - -struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev, - unsigned long *freq); - -struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev, - unsigned long *freq); - -int dev_pm_opp_add(struct device *dev, unsigned long freq, - unsigned long u_volt); - -int dev_pm_opp_enable(struct device *dev, unsigned long freq); - -int dev_pm_opp_disable(struct device *dev, unsigned long freq); - -struct srcu_notifier_head *dev_pm_opp_get_notifier(struct device *dev); -#else -static inline unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp) -{ - return 0; -} - -static inline unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp) -{ - return 0; -} - -static inline int dev_pm_opp_get_opp_count(struct device *dev) -{ - return 0; -} - -static inline struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev, - unsigned long freq, bool available) -{ - return ERR_PTR(-EINVAL); -} - -static inline struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev, - unsigned long *freq) -{ - return ERR_PTR(-EINVAL); -} - -static inline struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev, - unsigned long *freq) -{ - return ERR_PTR(-EINVAL); -} - -static inline int dev_pm_opp_add(struct device *dev, unsigned long freq, - unsigned long u_volt) -{ - return -EINVAL; -} - -static inline int dev_pm_opp_enable(struct device *dev, unsigned long freq) -{ - return 0; -} - -static inline int dev_pm_opp_disable(struct device *dev, unsigned long freq) -{ - return 0; -} - -static inline struct srcu_notifier_head *dev_pm_opp_get_notifier( - struct device *dev) -{ - return ERR_PTR(-EINVAL); -} -#endif /* CONFIG_PM_OPP */ - -#if defined(CONFIG_PM_OPP) && defined(CONFIG_OF) -int of_init_opp_table(struct device *dev); -#else -static inline int of_init_opp_table(struct device *dev) -{ - return -EINVAL; -} -#endif - -#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP) -int dev_pm_opp_init_cpufreq_table(struct device *dev, - struct cpufreq_frequency_table **table); -void dev_pm_opp_free_cpufreq_table(struct device *dev, - struct cpufreq_frequency_table **table); -#else -static inline int dev_pm_opp_init_cpufreq_table(struct device *dev, - struct cpufreq_frequency_table **table) -{ - return -EINVAL; -} - -static inline -void dev_pm_opp_free_cpufreq_table(struct device *dev, - struct cpufreq_frequency_table **table) -{ -} -#endif /* CONFIG_CPU_FREQ */ - -#endif /* __LINUX_OPP_H__ */ diff --git a/include/linux/powercap.h b/include/linux/powercap.h deleted file mode 100644 index 4e25041..0000000 --- a/include/linux/powercap.h +++ /dev/null @@ -1,325 +0,0 @@ -/* - * powercap.h: Data types and headers for sysfs power capping interface - * Copyright (c) 2013, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc. - * - */ - -#ifndef __POWERCAP_H__ -#define __POWERCAP_H__ - -#include <linux/device.h> -#include <linux/idr.h> - -/* - * A power cap class device can contain multiple powercap control_types. - * Each control_type can have multiple power zones, which can be independently - * controlled. Each power zone can have one or more constraints. - */ - -struct powercap_control_type; -struct powercap_zone; -struct powercap_zone_constraint; - -/** - * struct powercap_control_type_ops - Define control type callbacks - * @set_enable: Enable/Disable whole control type. - * Default is enabled. But this callback allows all zones - * to be in disable state and remove any applied power - * limits. If disabled power zone can only be monitored - * not controlled. - * @get_enable: get Enable/Disable status. - * @release: Callback to inform that last reference to this - * control type is closed. So it is safe to free data - * structure associated with this control type. - * This callback is mandatory if the client own memory - * for the control type. - * - * This structure defines control type callbacks to be implemented by client - * drivers - */ -struct powercap_control_type_ops { - int (*set_enable) (struct powercap_control_type *, bool mode); - int (*get_enable) (struct powercap_control_type *, bool *mode); - int (*release) (struct powercap_control_type *); -}; - -/** - * struct powercap_control_type- Defines a powercap control_type - * @name: name of control_type - * @dev: device for this control_type - * @idr: idr to have unique id for its child - * @root_node: Root holding power zones for this control_type - * @ops: Pointer to callback struct - * @node_lock: mutex for control type - * @allocated: This is possible that client owns the memory - * used by this structure. In this case - * this flag is set to false by framework to - * prevent deallocation during release process. - * Otherwise this flag is set to true. - * @ctrl_inst: link to the control_type list - * - * Defines powercap control_type. This acts as a container for power - * zones, which use same method to control power. E.g. RAPL, RAPL-PCI etc. - * All fields are private and should not be used by client drivers. - */ -struct powercap_control_type { - struct device dev; - struct idr idr; - int nr_zones; - const struct powercap_control_type_ops *ops; - struct mutex lock; - bool allocated; - struct list_head node; -}; - -/** - * struct powercap_zone_ops - Define power zone callbacks - * @get_max_energy_range_uj: Get maximum range of energy counter in - * micro-joules. - * @get_energy_uj: Get current energy counter in micro-joules. - * @reset_energy_uj: Reset micro-joules energy counter. - * @get_max_power_range_uw: Get maximum range of power counter in - * micro-watts. - * @get_power_uw: Get current power counter in micro-watts. - * @set_enable: Enable/Disable power zone controls. - * Default is enabled. - * @get_enable: get Enable/Disable status. - * @release: Callback to inform that last reference to this - * control type is closed. So it is safe to free - * data structure associated with this - * control type. Mandatory, if client driver owns - * the power_zone memory. - * - * This structure defines zone callbacks to be implemented by client drivers. - * Client drives can define both energy and power related callbacks. But at - * the least one type (either power or energy) is mandatory. Client drivers - * should handle mutual exclusion, if required in callbacks. - */ -struct powercap_zone_ops { - int (*get_max_energy_range_uj) (struct powercap_zone *, u64 *); - int (*get_energy_uj) (struct powercap_zone *, u64 *); - int (*reset_energy_uj) (struct powercap_zone *); - int (*get_max_power_range_uw) (struct powercap_zone *, u64 *); - int (*get_power_uw) (struct powercap_zone *, u64 *); - int (*set_enable) (struct powercap_zone *, bool mode); - int (*get_enable) (struct powercap_zone *, bool *mode); - int (*release) (struct powercap_zone *); -}; - -#define POWERCAP_ZONE_MAX_ATTRS 6 -#define POWERCAP_CONSTRAINTS_ATTRS 8 -#define MAX_CONSTRAINTS_PER_ZONE 10 -/** - * struct powercap_zone- Defines instance of a power cap zone - * @id: Unique id - * @name: Power zone name. - * @control_type_inst: Control type instance for this zone. - * @ops: Pointer to the zone operation structure. - * @dev: Instance of a device. - * @const_id_cnt: Number of constraint defined. - * @idr: Instance to an idr entry for children zones. - * @parent_idr: To remove reference from the parent idr. - * @private_data: Private data pointer if any for this zone. - * @zone_dev_attrs: Attributes associated with this device. - * @zone_attr_count: Attribute count. - * @dev_zone_attr_group: Attribute group for attributes. - * @dev_attr_groups: Attribute group store to register with device. - * @allocated: This is possible that client owns the memory - * used by this structure. In this case - * this flag is set to false by framework to - * prevent deallocation during release process. - * Otherwise this flag is set to true. - * @constraint_ptr: List of constraints for this zone. - * - * This defines a power zone instance. The fields of this structure are - * private, and should not be used by client drivers. - */ -struct powercap_zone { - int id; - char *name; - void *control_type_inst; - const struct powercap_zone_ops *ops; - struct device dev; - int const_id_cnt; - struct idr idr; - struct idr *parent_idr; - void *private_data; - struct attribute **zone_dev_attrs; - int zone_attr_count; - struct attribute_group dev_zone_attr_group; - const struct attribute_group *dev_attr_groups[2]; /* 1 group + NULL */ - bool allocated; - struct powercap_zone_constraint *constraints; -}; - -/** - * struct powercap_zone_constraint_ops - Define constraint callbacks - * @set_power_limit_uw: Set power limit in micro-watts. - * @get_power_limit_uw: Get power limit in micro-watts. - * @set_time_window_us: Set time window in micro-seconds. - * @get_time_window_us: Get time window in micro-seconds. - * @get_max_power_uw: Get max power allowed in micro-watts. - * @get_min_power_uw: Get min power allowed in micro-watts. - * @get_max_time_window_us: Get max time window allowed in micro-seconds. - * @get_min_time_window_us: Get min time window allowed in micro-seconds. - * @get_name: Get the name of constraint - * - * This structure is used to define the constraint callbacks for the client - * drivers. The following callbacks are mandatory and can't be NULL: - * set_power_limit_uw - * get_power_limit_uw - * set_time_window_us - * get_time_window_us - * get_name - * Client drivers should handle mutual exclusion, if required in callbacks. - */ -struct powercap_zone_constraint_ops { - int (*set_power_limit_uw) (struct powercap_zone *, int, u64); - int (*get_power_limit_uw) (struct powercap_zone *, int, u64 *); - int (*set_time_window_us) (struct powercap_zone *, int, u64); - int (*get_time_window_us) (struct powercap_zone *, int, u64 *); - int (*get_max_power_uw) (struct powercap_zone *, int, u64 *); - int (*get_min_power_uw) (struct powercap_zone *, int, u64 *); - int (*get_max_time_window_us) (struct powercap_zone *, int, u64 *); - int (*get_min_time_window_us) (struct powercap_zone *, int, u64 *); - const char *(*get_name) (struct powercap_zone *, int); -}; - -/** - * struct powercap_zone_constraint- Defines instance of a constraint - * @id: Instance Id of this constraint. - * @power_zone: Pointer to the power zone for this constraint. - * @ops: Pointer to the constraint callbacks. - * - * This defines a constraint instance. - */ -struct powercap_zone_constraint { - int id; - struct powercap_zone *power_zone; - struct powercap_zone_constraint_ops *ops; -}; - - -/* For clients to get their device pointer, may be used for dev_dbgs */ -#define POWERCAP_GET_DEV(power_zone) (&power_zone->dev) - -/** -* powercap_set_zone_data() - Set private data for a zone -* @power_zone: A pointer to the valid zone instance. -* @pdata: A pointer to the user private data. -* -* Allows client drivers to associate some private data to zone instance. -*/ -static inline void powercap_set_zone_data(struct powercap_zone *power_zone, - void *pdata) -{ - if (power_zone) - power_zone->private_data = pdata; -} - -/** -* powercap_get_zone_data() - Get private data for a zone -* @power_zone: A pointer to the valid zone instance. -* -* Allows client drivers to get private data associate with a zone, -* using call to powercap_set_zone_data. -*/ -static inline void *powercap_get_zone_data(struct powercap_zone *power_zone) -{ - if (power_zone) - return power_zone->private_data; - return NULL; -} - -/** -* powercap_register_control_type() - Register a control_type with framework -* @control_type: Pointer to client allocated memory for the control type -* structure storage. If this is NULL, powercap framework -* will allocate memory and own it. -* Advantage of this parameter is that client can embed -* this data in its data structures and allocate in a -* single call, preventing multiple allocations. -* @control_type_name: The Name of this control_type, which will be shown -* in the sysfs Interface. -* @ops: Callbacks for control type. This parameter is optional. -* -* Used to create a control_type with the power capping class. Here control_type -* can represent a type of technology, which can control a range of power zones. -* For example a control_type can be RAPL (Running Average Power Limit) -* Intel® 64 and IA-32 Processor Architectures. The name can be any string -* which must be unique, otherwise this function returns NULL. -* A pointer to the control_type instance is returned on success. -*/ -struct powercap_control_type *powercap_register_control_type( - struct powercap_control_type *control_type, - const char *name, - const struct powercap_control_type_ops *ops); - -/** -* powercap_unregister_control_type() - Unregister a control_type from framework -* @instance: A pointer to the valid control_type instance. -* -* Used to unregister a control_type with the power capping class. -* All power zones registered under this control type have to be unregistered -* before calling this function, or it will fail with an error code. -*/ -int powercap_unregister_control_type(struct powercap_control_type *instance); - -/* Zone register/unregister API */ - -/** -* powercap_register_zone() - Register a power zone -* @power_zone: Pointer to client allocated memory for the power zone structure -* storage. If this is NULL, powercap framework will allocate -* memory and own it. Advantage of this parameter is that client -* can embed this data in its data structures and allocate in a -* single call, preventing multiple allocations. -* @control_type: A control_type instance under which this zone operates. -* @name: A name for this zone. -* @parent: A pointer to the parent power zone instance if any or NULL -* @ops: Pointer to zone operation callback structure. -* @no_constraints: Number of constraints for this zone -* @const_ops: Pointer to constraint callback structure -* -* Register a power zone under a given control type. A power zone must register -* a pointer to a structure representing zone callbacks. -* A power zone can be located under a parent power zone, in which case @parent -* should point to it. Otherwise, if @parent is NULL, the new power zone will -* be located directly under the given control type -* For each power zone there may be a number of constraints that appear in the -* sysfs under that zone as attributes with unique numeric IDs. -* Returns pointer to the power_zone on success. -*/ -struct powercap_zone *powercap_register_zone( - struct powercap_zone *power_zone, - struct powercap_control_type *control_type, - const char *name, - struct powercap_zone *parent, - const struct powercap_zone_ops *ops, - int nr_constraints, - struct powercap_zone_constraint_ops *const_ops); - -/** -* powercap_unregister_zone() - Unregister a zone device -* @control_type: A pointer to the valid instance of a control_type. -* @power_zone: A pointer to the valid zone instance for a control_type -* -* Used to unregister a zone device for a control_type. Caller should -* make sure that children for this zone are unregistered first. -*/ -int powercap_unregister_zone(struct powercap_control_type *control_type, - struct powercap_zone *power_zone); - -#endif diff --git a/include/linux/preempt.h b/include/linux/preempt.h index a3d9dc8..f5d4723 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -6,95 +6,106 @@ * preempt_count (used for kernel preemption, interrupt count, etc.) */ +#include <linux/thread_info.h> #include <linux/linkage.h> #include <linux/list.h> -/* - * We use the MSB mostly because its available; see <linux/preempt_mask.h> for - * the other bits -- can't include that header due to inclusion hell. - */ -#define PREEMPT_NEED_RESCHED 0x80000000 - -#include <asm/preempt.h> - #if defined(CONFIG_DEBUG_PREEMPT) || defined(CONFIG_PREEMPT_TRACER) -extern void preempt_count_add(int val); -extern void preempt_count_sub(int val); -#define preempt_count_dec_and_test() ({ preempt_count_sub(1); should_resched(); }) + extern void add_preempt_count(int val); + extern void sub_preempt_count(int val); #else -#define preempt_count_add(val) __preempt_count_add(val) -#define preempt_count_sub(val) __preempt_count_sub(val) -#define preempt_count_dec_and_test() __preempt_count_dec_and_test() +# define add_preempt_count(val) do { preempt_count() += (val); } while (0) +# define sub_preempt_count(val) do { preempt_count() -= (val); } while (0) #endif -#define __preempt_count_inc() __preempt_count_add(1) -#define __preempt_count_dec() __preempt_count_sub(1) +#define inc_preempt_count() add_preempt_count(1) +#define dec_preempt_count() sub_preempt_count(1) + +#define preempt_count() (current_thread_info()->preempt_count) + +#ifdef CONFIG_PREEMPT + +asmlinkage void preempt_schedule(void); + +#define preempt_check_resched() \ +do { \ + if (unlikely(test_thread_flag(TIF_NEED_RESCHED))) \ + preempt_schedule(); \ +} while (0) + +#ifdef CONFIG_CONTEXT_TRACKING + +void preempt_schedule_context(void); + +#define preempt_check_resched_context() \ +do { \ + if (unlikely(test_thread_flag(TIF_NEED_RESCHED))) \ + preempt_schedule_context(); \ +} while (0) +#else + +#define preempt_check_resched_context() preempt_check_resched() + +#endif /* CONFIG_CONTEXT_TRACKING */ + +#else /* !CONFIG_PREEMPT */ + +#define preempt_check_resched() do { } while (0) +#define preempt_check_resched_context() do { } while (0) + +#endif /* CONFIG_PREEMPT */ -#define preempt_count_inc() preempt_count_add(1) -#define preempt_count_dec() preempt_count_sub(1) #ifdef CONFIG_PREEMPT_COUNT #define preempt_disable() \ do { \ - preempt_count_inc(); \ + inc_preempt_count(); \ barrier(); \ } while (0) #define sched_preempt_enable_no_resched() \ do { \ barrier(); \ - preempt_count_dec(); \ + dec_preempt_count(); \ } while (0) -#define preempt_enable_no_resched() sched_preempt_enable_no_resched() +#define preempt_enable_no_resched() sched_preempt_enable_no_resched() -#ifdef CONFIG_PREEMPT #define preempt_enable() \ do { \ + preempt_enable_no_resched(); \ barrier(); \ - if (unlikely(preempt_count_dec_and_test())) \ - __preempt_schedule(); \ -} while (0) - -#define preempt_check_resched() \ -do { \ - if (should_resched()) \ - __preempt_schedule(); \ + preempt_check_resched(); \ } while (0) -#else -#define preempt_enable() preempt_enable_no_resched() -#define preempt_check_resched() do { } while (0) -#endif +/* For debugging and tracer internals only! */ +#define add_preempt_count_notrace(val) \ + do { preempt_count() += (val); } while (0) +#define sub_preempt_count_notrace(val) \ + do { preempt_count() -= (val); } while (0) +#define inc_preempt_count_notrace() add_preempt_count_notrace(1) +#define dec_preempt_count_notrace() sub_preempt_count_notrace(1) #define preempt_disable_notrace() \ do { \ - __preempt_count_inc(); \ + inc_preempt_count_notrace(); \ barrier(); \ } while (0) #define preempt_enable_no_resched_notrace() \ do { \ barrier(); \ - __preempt_count_dec(); \ + dec_preempt_count_notrace(); \ } while (0) -#ifdef CONFIG_PREEMPT - -#ifndef CONFIG_CONTEXT_TRACKING -#define __preempt_schedule_context() __preempt_schedule() -#endif - +/* preempt_check_resched is OK to trace */ #define preempt_enable_notrace() \ do { \ + preempt_enable_no_resched_notrace(); \ barrier(); \ - if (unlikely(__preempt_count_dec_and_test())) \ - __preempt_schedule_context(); \ + preempt_check_resched_context(); \ } while (0) -#else -#define preempt_enable_notrace() preempt_enable_no_resched_notrace() -#endif #else /* !CONFIG_PREEMPT_COUNT */ @@ -104,11 +115,10 @@ do { \ * that can cause faults and scheduling migrate into our preempt-protected * region. */ -#define preempt_disable() barrier() +#define preempt_disable() barrier() #define sched_preempt_enable_no_resched() barrier() -#define preempt_enable_no_resched() barrier() -#define preempt_enable() barrier() -#define preempt_check_resched() do { } while (0) +#define preempt_enable_no_resched() barrier() +#define preempt_enable() barrier() #define preempt_disable_notrace() barrier() #define preempt_enable_no_resched_notrace() barrier() diff --git a/include/linux/preempt_mask.h b/include/linux/preempt_mask.h index d169820..931bc61 100644 --- a/include/linux/preempt_mask.h +++ b/include/linux/preempt_mask.h @@ -11,23 +11,36 @@ * - bits 0-7 are the preemption count (max preemption depth: 256) * - bits 8-15 are the softirq count (max # of softirqs: 256) * - * The hardirq count could in theory be the same as the number of - * interrupts in the system, but we run all interrupt handlers with - * interrupts disabled, so we cannot have nesting interrupts. Though - * there are a few palaeontologic drivers which reenable interrupts in - * the handler, so we need more than one bit here. + * The hardirq count can in theory reach the same as NR_IRQS. + * In reality, the number of nested IRQS is limited to the stack + * size as well. For archs with over 1000 IRQS it is not practical + * to expect that they will all nest. We give a max of 10 bits for + * hardirq nesting. An arch may choose to give less than 10 bits. + * m68k expects it to be 8. * - * PREEMPT_MASK: 0x000000ff - * SOFTIRQ_MASK: 0x0000ff00 - * HARDIRQ_MASK: 0x000f0000 - * NMI_MASK: 0x00100000 - * PREEMPT_ACTIVE: 0x00200000 + * - bits 16-25 are the hardirq count (max # of nested hardirqs: 1024) + * - bit 26 is the NMI_MASK + * - bit 27 is the PREEMPT_ACTIVE flag + * + * PREEMPT_MASK: 0x000000ff + * SOFTIRQ_MASK: 0x0000ff00 + * HARDIRQ_MASK: 0x03ff0000 + * NMI_MASK: 0x04000000 */ #define PREEMPT_BITS 8 #define SOFTIRQ_BITS 8 -#define HARDIRQ_BITS 4 #define NMI_BITS 1 +#define MAX_HARDIRQ_BITS 10 + +#ifndef HARDIRQ_BITS +# define HARDIRQ_BITS MAX_HARDIRQ_BITS +#endif + +#if HARDIRQ_BITS > MAX_HARDIRQ_BITS +#error HARDIRQ_BITS too high! +#endif + #define PREEMPT_SHIFT 0 #define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) #define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) @@ -47,9 +60,15 @@ #define SOFTIRQ_DISABLE_OFFSET (2 * SOFTIRQ_OFFSET) +#ifndef PREEMPT_ACTIVE #define PREEMPT_ACTIVE_BITS 1 #define PREEMPT_ACTIVE_SHIFT (NMI_SHIFT + NMI_BITS) #define PREEMPT_ACTIVE (__IRQ_MASK(PREEMPT_ACTIVE_BITS) << PREEMPT_ACTIVE_SHIFT) +#endif + +#if PREEMPT_ACTIVE < (1 << (NMI_SHIFT + NMI_BITS)) +#error PREEMPT_ACTIVE is too low! +#endif #define hardirq_count() (preempt_count() & HARDIRQ_MASK) #define softirq_count() (preempt_count() & SOFTIRQ_MASK) diff --git a/include/linux/printk.h b/include/linux/printk.h index 6949258..e6131a78 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -233,8 +233,6 @@ extern asmlinkage void dump_stack(void) __cold; no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) #endif -#include <linux/dynamic_debug.h> - /* If you are writing a driver, please use dev_dbg instead */ #if defined(CONFIG_DYNAMIC_DEBUG) /* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */ @@ -345,19 +343,7 @@ extern asmlinkage void dump_stack(void) __cold; #endif /* If you are writing a driver, please use dev_dbg instead */ -#if defined(CONFIG_DYNAMIC_DEBUG) -/* descriptor check is first to prevent flooding with "callbacks suppressed" */ -#define pr_debug_ratelimited(fmt, ...) \ -do { \ - static DEFINE_RATELIMIT_STATE(_rs, \ - DEFAULT_RATELIMIT_INTERVAL, \ - DEFAULT_RATELIMIT_BURST); \ - DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ - if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT) && \ - __ratelimit(&_rs)) \ - __dynamic_pr_debug(&descriptor, fmt, ##__VA_ARGS__); \ -} while (0) -#elif defined(DEBUG) +#if defined(DEBUG) #define pr_debug_ratelimited(fmt, ...) \ printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) #else diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h index 2de2e27..56f4a86 100644 --- a/include/linux/pwm_backlight.h +++ b/include/linux/pwm_backlight.h @@ -6,9 +6,6 @@ #include <linux/backlight.h> -/* TODO: convert to gpiod_*() API once it has been merged */ -#define PWM_BACKLIGHT_GPIO_ACTIVE_LOW (1 << 0) - struct platform_pwm_backlight_data { int pwm_id; unsigned int max_brightness; @@ -16,8 +13,6 @@ struct platform_pwm_backlight_data { unsigned int lth_brightness; unsigned int pwm_period_ns; unsigned int *levels; - int enable_gpio; - unsigned long enable_gpio_flags; int (*init)(struct device *dev); int (*notify)(struct device *dev, int brightness); void (*notify_after)(struct device *dev, int brightness); diff --git a/include/linux/random.h b/include/linux/random.h index 4002b3d..6312dd9 100644 --- a/include/linux/random.h +++ b/include/linux/random.h @@ -29,13 +29,8 @@ unsigned long randomize_range(unsigned long start, unsigned long end, unsigned l u32 prandom_u32(void); void prandom_bytes(void *buf, int nbytes); void prandom_seed(u32 seed); -void prandom_reseed_late(void); -struct rnd_state { - __u32 s1, s2, s3, s4; -}; - -u32 prandom_u32_state(struct rnd_state *state); +u32 prandom_u32_state(struct rnd_state *); void prandom_bytes_state(struct rnd_state *state, void *buf, int nbytes); /* @@ -55,10 +50,9 @@ static inline void prandom_seed_state(struct rnd_state *state, u64 seed) { u32 i = (seed >> 32) ^ (seed << 10) ^ seed; - state->s1 = __seed(i, 2U); - state->s2 = __seed(i, 8U); - state->s3 = __seed(i, 16U); - state->s4 = __seed(i, 128U); + state->s1 = __seed(i, 1); + state->s2 = __seed(i, 7); + state->s3 = __seed(i, 15); } #ifdef CONFIG_ARCH_RANDOM diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h index 57e75ae..aa870a4 100644 --- a/include/linux/rbtree.h +++ b/include/linux/rbtree.h @@ -85,11 +85,6 @@ static inline void rb_link_node(struct rb_node * node, struct rb_node * parent, *rb_link = node; } -#define rb_entry_safe(ptr, type, member) \ - ({ typeof(ptr) ____ptr = (ptr); \ - ____ptr ? rb_entry(____ptr, type, member) : NULL; \ - }) - /** * rbtree_postorder_for_each_entry_safe - iterate over rb_root in post order of * given type safe against removal of rb_node entry @@ -100,9 +95,12 @@ static inline void rb_link_node(struct rb_node * node, struct rb_node * parent, * @field: the name of the rb_node field within 'type'. */ #define rbtree_postorder_for_each_entry_safe(pos, n, root, field) \ - for (pos = rb_entry_safe(rb_first_postorder(root), typeof(*pos), field); \ - pos && ({ n = rb_entry_safe(rb_next_postorder(&pos->field), \ - typeof(*pos), field); 1; }); \ - pos = n) + for (pos = rb_entry(rb_first_postorder(root), typeof(*pos), field),\ + n = rb_entry(rb_next_postorder(&pos->field), \ + typeof(*pos), field); \ + &pos->field; \ + pos = n, \ + n = rb_entry(rb_next_postorder(&pos->field), \ + typeof(*pos), field)) #endif /* _LINUX_RBTREE_H */ diff --git a/include/linux/rculist.h b/include/linux/rculist.h index 45a0a9e..4106721 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h @@ -19,21 +19,6 @@ */ /* - * INIT_LIST_HEAD_RCU - Initialize a list_head visible to RCU readers - * @list: list to be initialized - * - * You should instead use INIT_LIST_HEAD() for normal initialization and - * cleanup tasks, when readers have no access to the list being initialized. - * However, if the list being initialized is visible to readers, you - * need to keep the compiler from being too mischievous. - */ -static inline void INIT_LIST_HEAD_RCU(struct list_head *list) -{ - ACCESS_ONCE(list->next) = list; - ACCESS_ONCE(list->prev) = list; -} - -/* * return the ->next pointer of a list_head in an rcu safe * way, we must not access it directly */ @@ -206,13 +191,9 @@ static inline void list_splice_init_rcu(struct list_head *list, if (list_empty(list)) return; - /* - * "first" and "last" tracking list, so initialize it. RCU readers - * have access to this list, so we must use INIT_LIST_HEAD_RCU() - * instead of INIT_LIST_HEAD(). - */ + /* "first" and "last" tracking list, so initialize it. */ - INIT_LIST_HEAD_RCU(list); + INIT_LIST_HEAD(list); /* * At this point, the list body still points to the source list. diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 39cbb88..f1f1bc3 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -261,10 +261,6 @@ static inline void rcu_user_hooks_switch(struct task_struct *prev, rcu_irq_exit(); \ } while (0) -#if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) -extern bool __rcu_is_watching(void); -#endif /* #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) */ - /* * Infrastructure to implement the synchronize_() primitives in * TREE_RCU and rcu_barrier_() primitives in TINY_RCU. @@ -301,6 +297,10 @@ static inline void destroy_rcu_head_on_stack(struct rcu_head *head) } #endif /* #else !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ +#if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_SMP) +extern int rcu_is_cpu_idle(void); +#endif /* #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_SMP) */ + #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PROVE_RCU) bool rcu_lockdep_current_cpu_online(void); #else /* #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PROVE_RCU) */ @@ -351,7 +351,7 @@ static inline int rcu_read_lock_held(void) { if (!debug_lockdep_rcu_enabled()) return 1; - if (!rcu_is_watching()) + if (rcu_is_cpu_idle()) return 0; if (!rcu_lockdep_current_cpu_online()) return 0; @@ -402,7 +402,7 @@ static inline int rcu_read_lock_sched_held(void) if (!debug_lockdep_rcu_enabled()) return 1; - if (!rcu_is_watching()) + if (rcu_is_cpu_idle()) return 0; if (!rcu_lockdep_current_cpu_online()) return 0; @@ -771,7 +771,7 @@ static inline void rcu_read_lock(void) __rcu_read_lock(); __acquire(RCU); rcu_lock_acquire(&rcu_lock_map); - rcu_lockdep_assert(rcu_is_watching(), + rcu_lockdep_assert(!rcu_is_cpu_idle(), "rcu_read_lock() used illegally while idle"); } @@ -792,7 +792,7 @@ static inline void rcu_read_lock(void) */ static inline void rcu_read_unlock(void) { - rcu_lockdep_assert(rcu_is_watching(), + rcu_lockdep_assert(!rcu_is_cpu_idle(), "rcu_read_unlock() used illegally while idle"); rcu_lock_release(&rcu_lock_map); __release(RCU); @@ -821,7 +821,7 @@ static inline void rcu_read_lock_bh(void) local_bh_disable(); __acquire(RCU_BH); rcu_lock_acquire(&rcu_bh_lock_map); - rcu_lockdep_assert(rcu_is_watching(), + rcu_lockdep_assert(!rcu_is_cpu_idle(), "rcu_read_lock_bh() used illegally while idle"); } @@ -832,7 +832,7 @@ static inline void rcu_read_lock_bh(void) */ static inline void rcu_read_unlock_bh(void) { - rcu_lockdep_assert(rcu_is_watching(), + rcu_lockdep_assert(!rcu_is_cpu_idle(), "rcu_read_unlock_bh() used illegally while idle"); rcu_lock_release(&rcu_bh_lock_map); __release(RCU_BH); @@ -857,7 +857,7 @@ static inline void rcu_read_lock_sched(void) preempt_disable(); __acquire(RCU_SCHED); rcu_lock_acquire(&rcu_sched_lock_map); - rcu_lockdep_assert(rcu_is_watching(), + rcu_lockdep_assert(!rcu_is_cpu_idle(), "rcu_read_lock_sched() used illegally while idle"); } @@ -875,7 +875,7 @@ static inline notrace void rcu_read_lock_sched_notrace(void) */ static inline void rcu_read_unlock_sched(void) { - rcu_lockdep_assert(rcu_is_watching(), + rcu_lockdep_assert(!rcu_is_cpu_idle(), "rcu_read_unlock_sched() used illegally while idle"); rcu_lock_release(&rcu_sched_lock_map); __release(RCU_SCHED); diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index 09ebcbe..e31005e 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h @@ -132,21 +132,4 @@ static inline void rcu_scheduler_starting(void) } #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ -#if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) - -static inline bool rcu_is_watching(void) -{ - return __rcu_is_watching(); -} - -#else /* defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) */ - -static inline bool rcu_is_watching(void) -{ - return true; -} - - -#endif /* #else defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) */ - #endif /* __LINUX_RCUTINY_H */ diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 4b9c815..226169d 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h @@ -90,6 +90,4 @@ extern void exit_rcu(void); extern void rcu_scheduler_starting(void); extern int rcu_scheduler_active __read_mostly; -extern bool rcu_is_watching(void); - #endif /* __LINUX_RCUTREE_H */ diff --git a/include/linux/regmap.h b/include/linux/regmap.h index e559078..a10380b 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h @@ -23,7 +23,6 @@ struct device; struct i2c_client; struct irq_domain; struct spi_device; -struct spmi_device; struct regmap; struct regmap_range_cfg; struct regmap_field; @@ -71,8 +70,6 @@ struct regmap_range { unsigned int range_max; }; -#define regmap_reg_range(low, high) { .range_min = low, .range_max = high, } - /* * A table of ranges including some yes ranges and some no ranges. * If a register belongs to a no_range, the corresponding check function @@ -321,8 +318,6 @@ struct regmap *regmap_init_i2c(struct i2c_client *i2c, const struct regmap_config *config); struct regmap *regmap_init_spi(struct spi_device *dev, const struct regmap_config *config); -struct regmap *regmap_init_spmi(struct spmi_device *dev, - const struct regmap_config *config); struct regmap *regmap_init_mmio_clk(struct device *dev, const char *clk_id, void __iomem *regs, const struct regmap_config *config); @@ -335,8 +330,6 @@ struct regmap *devm_regmap_init_i2c(struct i2c_client *i2c, const struct regmap_config *config); struct regmap *devm_regmap_init_spi(struct spi_device *dev, const struct regmap_config *config); -struct regmap *devm_regmap_init_spmi(struct spmi_device *dev, - const struct regmap_config *config); struct regmap *devm_regmap_init_mmio_clk(struct device *dev, const char *clk_id, void __iomem *regs, const struct regmap_config *config); @@ -381,13 +374,10 @@ int regmap_reinit_cache(struct regmap *map, const struct regmap_config *config); struct regmap *dev_get_regmap(struct device *dev, const char *name); int regmap_write(struct regmap *map, unsigned int reg, unsigned int val); -int regmap_write_async(struct regmap *map, unsigned int reg, unsigned int val); int regmap_raw_write(struct regmap *map, unsigned int reg, const void *val, size_t val_len); int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val, size_t val_count); -int regmap_multi_reg_write(struct regmap *map, struct reg_default *regs, - int num_regs); int regmap_raw_write_async(struct regmap *map, unsigned int reg, const void *val, size_t val_len); int regmap_read(struct regmap *map, unsigned int reg, unsigned int *val); @@ -397,14 +387,9 @@ int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val, size_t val_count); int regmap_update_bits(struct regmap *map, unsigned int reg, unsigned int mask, unsigned int val); -int regmap_update_bits_async(struct regmap *map, unsigned int reg, - unsigned int mask, unsigned int val); int regmap_update_bits_check(struct regmap *map, unsigned int reg, unsigned int mask, unsigned int val, bool *change); -int regmap_update_bits_check_async(struct regmap *map, unsigned int reg, - unsigned int mask, unsigned int val, - bool *change); int regmap_get_val_bytes(struct regmap *map); int regmap_async_complete(struct regmap *map); bool regmap_can_raw_write(struct regmap *map); @@ -440,15 +425,11 @@ bool regmap_reg_in_ranges(unsigned int reg, * @reg: Offset of the register within the regmap bank * @lsb: lsb of the register field. * @reg: msb of the register field. - * @id_size: port size if it has some ports - * @id_offset: address offset for each ports */ struct reg_field { unsigned int reg; unsigned int lsb; unsigned int msb; - unsigned int id_size; - unsigned int id_offset; }; #define REG_FIELD(_reg, _lsb, _msb) { \ @@ -467,15 +448,6 @@ void devm_regmap_field_free(struct device *dev, struct regmap_field *field); int regmap_field_read(struct regmap_field *field, unsigned int *val); int regmap_field_write(struct regmap_field *field, unsigned int val); -int regmap_field_update_bits(struct regmap_field *field, - unsigned int mask, unsigned int val); - -int regmap_fields_write(struct regmap_field *field, unsigned int id, - unsigned int val); -int regmap_fields_read(struct regmap_field *field, unsigned int id, - unsigned int *val); -int regmap_fields_update_bits(struct regmap_field *field, unsigned int id, - unsigned int mask, unsigned int val); /** * Description of an IRQ for the generic regmap irq_chip. @@ -555,13 +527,6 @@ static inline int regmap_write(struct regmap *map, unsigned int reg, return -EINVAL; } -static inline int regmap_write_async(struct regmap *map, unsigned int reg, - unsigned int val) -{ - WARN_ONCE(1, "regmap API is disabled"); - return -EINVAL; -} - static inline int regmap_raw_write(struct regmap *map, unsigned int reg, const void *val, size_t val_len) { @@ -611,14 +576,6 @@ static inline int regmap_update_bits(struct regmap *map, unsigned int reg, return -EINVAL; } -static inline int regmap_update_bits_async(struct regmap *map, - unsigned int reg, - unsigned int mask, unsigned int val) -{ - WARN_ONCE(1, "regmap API is disabled"); - return -EINVAL; -} - static inline int regmap_update_bits_check(struct regmap *map, unsigned int reg, unsigned int mask, unsigned int val, @@ -628,16 +585,6 @@ static inline int regmap_update_bits_check(struct regmap *map, return -EINVAL; } -static inline int regmap_update_bits_check_async(struct regmap *map, - unsigned int reg, - unsigned int mask, - unsigned int val, - bool *change) -{ - WARN_ONCE(1, "regmap API is disabled"); - return -EINVAL; -} - static inline int regmap_get_val_bytes(struct regmap *map) { WARN_ONCE(1, "regmap API is disabled"); diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index e530681..27be915 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h @@ -146,32 +146,6 @@ struct regulator *__must_check devm_regulator_get_optional(struct device *dev, void regulator_put(struct regulator *regulator); void devm_regulator_put(struct regulator *regulator); -int regulator_register_supply_alias(struct device *dev, const char *id, - struct device *alias_dev, - const char *alias_id); -void regulator_unregister_supply_alias(struct device *dev, const char *id); - -int regulator_bulk_register_supply_alias(struct device *dev, const char **id, - struct device *alias_dev, - const char **alias_id, int num_id); -void regulator_bulk_unregister_supply_alias(struct device *dev, - const char **id, int num_id); - -int devm_regulator_register_supply_alias(struct device *dev, const char *id, - struct device *alias_dev, - const char *alias_id); -void devm_regulator_unregister_supply_alias(struct device *dev, - const char *id); - -int devm_regulator_bulk_register_supply_alias(struct device *dev, - const char **id, - struct device *alias_dev, - const char **alias_id, - int num_id); -void devm_regulator_bulk_unregister_supply_alias(struct device *dev, - const char **id, - int num_id); - /* regulator output control and status */ int __must_check regulator_enable(struct regulator *regulator); int regulator_disable(struct regulator *regulator); @@ -276,59 +250,6 @@ static inline void devm_regulator_put(struct regulator *regulator) { } -static inline int regulator_register_supply_alias(struct device *dev, - const char *id, - struct device *alias_dev, - const char *alias_id) -{ - return 0; -} - -static inline void regulator_unregister_supply_alias(struct device *dev, - const char *id) -{ -} - -static inline int regulator_bulk_register_supply_alias(struct device *dev, - const char **id, - struct device *alias_dev, - const char **alias_id, - int num_id) -{ - return 0; -} - -static inline void regulator_bulk_unregister_supply_alias(struct device *dev, - const char **id, - int num_id) -{ -} - -static inline int devm_regulator_register_supply_alias(struct device *dev, - const char *id, - struct device *alias_dev, - const char *alias_id) -{ - return 0; -} - -static inline void devm_regulator_unregister_supply_alias(struct device *dev, - const char *id) -{ -} - -static inline int devm_regulator_bulk_register_supply_alias( - struct device *dev, const char **id, struct device *alias_dev, - const char **alias_id, int num_id) -{ - return 0; -} - -static inline void devm_regulator_bulk_unregister_supply_alias( - struct device *dev, const char **id, int num_id) -{ -} - static inline int regulator_enable(struct regulator *regulator) { return 0; diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index 9370e65..9bdad43 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h @@ -46,26 +46,19 @@ enum regulator_status { * regulator_list_linear_range(). * * @min_uV: Lowest voltage in range + * @max_uV: Highest voltage in range * @min_sel: Lowest selector for range * @max_sel: Highest selector for range * @uV_step: Step size */ struct regulator_linear_range { unsigned int min_uV; + unsigned int max_uV; unsigned int min_sel; unsigned int max_sel; unsigned int uV_step; }; -/* Initialize struct regulator_linear_range */ -#define REGULATOR_LINEAR_RANGE(_min_uV, _min_sel, _max_sel, _step_uV) \ -{ \ - .min_uV = _min_uV, \ - .min_sel = _min_sel, \ - .max_sel = _max_sel, \ - .uV_step = _step_uV, \ -} - /** * struct regulator_ops - regulator operations. * @@ -216,7 +209,6 @@ enum regulator_type { * @min_uV: Voltage given by the lowest selector (if linear mapping) * @uV_step: Voltage increase with each selector (if linear mapping) * @linear_min_sel: Minimal selector for starting linear mapping - * @fixed_uV: Fixed voltage of rails. * @ramp_delay: Time to settle down after voltage change (unit: uV/us) * @volt_table: Voltage mapping table (if table based mapping) * @@ -249,7 +241,6 @@ struct regulator_desc { unsigned int min_uV; unsigned int uV_step; unsigned int linear_min_sel; - int fixed_uV; unsigned int ramp_delay; const struct regulator_linear_range *linear_ranges; @@ -345,12 +336,7 @@ struct regulator_dev { struct regulator_dev * regulator_register(const struct regulator_desc *regulator_desc, const struct regulator_config *config); -struct regulator_dev * -devm_regulator_register(struct device *dev, - const struct regulator_desc *regulator_desc, - const struct regulator_config *config); void regulator_unregister(struct regulator_dev *rdev); -void devm_regulator_unregister(struct device *dev, struct regulator_dev *rdev); int regulator_notifier_call_chain(struct regulator_dev *rdev, unsigned long event, void *data); diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h index 730e638..999b20c 100644 --- a/include/linux/regulator/machine.h +++ b/include/linux/regulator/machine.h @@ -95,7 +95,6 @@ struct regulator_state { * @initial_state: Suspend state to set by default. * @initial_mode: Mode to set at startup. * @ramp_delay: Time to settle down after voltage change (unit: uV/us) - * @enable_time: Turn-on time of the rails (unit: microseconds) */ struct regulation_constraints { @@ -130,7 +129,6 @@ struct regulation_constraints { unsigned int initial_mode; unsigned int ramp_delay; - unsigned int enable_time; /* constraint flags */ unsigned always_on:1; /* regulator never off when system is on */ @@ -195,10 +193,15 @@ int regulator_suspend_finish(void); #ifdef CONFIG_REGULATOR void regulator_has_full_constraints(void); +void regulator_use_dummy_regulator(void); #else static inline void regulator_has_full_constraints(void) { } + +static inline void regulator_use_dummy_regulator(void) +{ +} #endif #endif diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 939428a..f28544b 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h @@ -15,7 +15,7 @@ extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics); extern int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst, u32 id, long expires, u32 error); -void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change, gfp_t flags); +extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change); /* RTNL is used as a global lock for all changes to network configuration */ extern void rtnl_lock(void); diff --git a/include/linux/sched.h b/include/linux/sched.h index 768b037..e27baee 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -22,7 +22,6 @@ struct sched_param { #include <linux/errno.h> #include <linux/nodemask.h> #include <linux/mm_types.h> -#include <linux/preempt_mask.h> #include <asm/page.h> #include <asm/ptrace.h> @@ -286,14 +285,6 @@ static inline void lockup_detector_init(void) } #endif -#ifdef CONFIG_DETECT_HUNG_TASK -void reset_hung_task_detector(void); -#else -static inline void reset_hung_task_detector(void) -{ -} -#endif - /* Attach to any functions which should be ignored in wchan output. */ #define __sched __attribute__((__section__(".sched.text"))) @@ -331,10 +322,6 @@ static inline void arch_pick_mmap_layout(struct mm_struct *mm) {} extern void set_dumpable(struct mm_struct *mm, int value); extern int get_dumpable(struct mm_struct *mm); -#define SUID_DUMP_DISABLE 0 /* No setuid dumping */ -#define SUID_DUMP_USER 1 /* Dump as user of process */ -#define SUID_DUMP_ROOT 2 /* Dump as root */ - /* mm flags */ /* dumpable bits */ #define MMF_DUMPABLE 0 /* core dump is permitted */ @@ -440,14 +427,6 @@ struct task_cputime { .sum_exec_runtime = 0, \ } -#define PREEMPT_ENABLED (PREEMPT_NEED_RESCHED) - -#ifdef CONFIG_PREEMPT_COUNT -#define PREEMPT_DISABLED (1 + PREEMPT_ENABLED) -#else -#define PREEMPT_DISABLED PREEMPT_ENABLED -#endif - /* * Disable preemption until the scheduler is running. * Reset by start_kernel()->sched_init()->init_idle(). @@ -455,7 +434,7 @@ struct task_cputime { * We include PREEMPT_ACTIVE to avoid cond_resched() from working * before the scheduler is active -- see should_resched(). */ -#define INIT_PREEMPT_COUNT (PREEMPT_DISABLED + PREEMPT_ACTIVE) +#define INIT_PREEMPT_COUNT (1 + PREEMPT_ACTIVE) /** * struct thread_group_cputimer - thread group interval timer counts @@ -789,7 +768,6 @@ enum cpu_idle_type { #define SD_ASYM_PACKING 0x0800 /* Place busy groups earlier in the domain */ #define SD_PREFER_SIBLING 0x1000 /* Prefer to place tasks in a sibling domain */ #define SD_OVERLAP 0x2000 /* sched_domains of this level overlap */ -#define SD_NUMA 0x4000 /* cross-node balancing */ extern int __weak arch_sd_sibiling_asym_packing(void); @@ -831,9 +809,7 @@ struct sched_domain { unsigned int balance_interval; /* initialise to 1. units in ms. */ unsigned int nr_balance_failed; /* initialise to 0 */ - /* idle_balance() stats */ - u64 max_newidle_lb_cost; - unsigned long next_decay_max_lb_cost; + u64 last_update; #ifdef CONFIG_SCHEDSTATS /* load_balance() stats */ @@ -1053,8 +1029,6 @@ struct task_struct { struct task_struct *last_wakee; unsigned long wakee_flips; unsigned long wakee_flip_decay_ts; - - int wake_cpu; #endif int on_rq; @@ -1072,6 +1046,15 @@ struct task_struct { struct hlist_head preempt_notifiers; #endif + /* + * fpu_counter contains the number of consecutive context switches + * that the FPU is used. If this is over a threshold, the lazy fpu + * saving becomes unlazy to save the trap. This is an unsigned char + * so that after 256 times the counter wraps and the behavior turns + * lazy again; this to deal with bursty apps that only use FPU for + * a short time + */ + unsigned char fpu_counter; #ifdef CONFIG_BLK_DEV_IO_TRACE unsigned int btrace_seq; #endif @@ -1341,41 +1324,10 @@ struct task_struct { #endif #ifdef CONFIG_NUMA_BALANCING int numa_scan_seq; + int numa_migrate_seq; unsigned int numa_scan_period; - unsigned int numa_scan_period_max; - int numa_preferred_nid; - int numa_migrate_deferred; - unsigned long numa_migrate_retry; u64 node_stamp; /* migration stamp */ struct callback_head numa_work; - - struct list_head numa_entry; - struct numa_group *numa_group; - - /* - * Exponential decaying average of faults on a per-node basis. - * Scheduling placement decisions are made based on the these counts. - * The values remain static for the duration of a PTE scan - */ - unsigned long *numa_faults; - unsigned long total_numa_faults; - - /* - * numa_faults_buffer records faults per node during the current - * scan window. When the scan completes, the counts in numa_faults - * decay and these values are copied. - */ - unsigned long *numa_faults_buffer; - - /* - * numa_faults_locality tracks if faults recorded during the last - * scan window were remote/local. The task scan period is adapted - * based on the locality of the faults with different weights - * depending on whether they were shared or private faults - */ - unsigned long numa_faults_locality[2]; - - unsigned long numa_pages_migrated; #endif /* CONFIG_NUMA_BALANCING */ struct rcu_head rcu; @@ -1460,33 +1412,16 @@ struct task_struct { /* Future-safe accessor for struct task_struct's cpus_allowed. */ #define tsk_cpus_allowed(tsk) (&(tsk)->cpus_allowed) -#define TNF_MIGRATED 0x01 -#define TNF_NO_GROUP 0x02 -#define TNF_SHARED 0x04 -#define TNF_FAULT_LOCAL 0x08 - #ifdef CONFIG_NUMA_BALANCING -extern void task_numa_fault(int last_node, int node, int pages, int flags); -extern pid_t task_numa_group_id(struct task_struct *p); +extern void task_numa_fault(int node, int pages, bool migrated); extern void set_numabalancing_state(bool enabled); -extern void task_numa_free(struct task_struct *p); - -extern unsigned int sysctl_numa_balancing_migrate_deferred; #else -static inline void task_numa_fault(int last_node, int node, int pages, - int flags) +static inline void task_numa_fault(int node, int pages, bool migrated) { } -static inline pid_t task_numa_group_id(struct task_struct *p) -{ - return 0; -} static inline void set_numabalancing_state(bool enabled) { } -static inline void task_numa_free(struct task_struct *p) -{ -} #endif static inline struct pid *task_pid(struct task_struct *task) @@ -2039,7 +1974,7 @@ extern void wake_up_new_task(struct task_struct *tsk); #else static inline void kick_process(struct task_struct *tsk) { } #endif -extern void sched_fork(unsigned long clone_flags, struct task_struct *p); +extern void sched_fork(struct task_struct *p); extern void sched_dead(struct task_struct *p); extern void proc_caches_init(void); @@ -2466,6 +2401,11 @@ static inline int signal_pending_state(long state, struct task_struct *p) return (state & TASK_INTERRUPTIBLE) || __fatal_signal_pending(p); } +static inline int need_resched(void) +{ + return unlikely(test_thread_flag(TIF_NEED_RESCHED)); +} + /* * cond_resched() and cond_resched_lock(): latency reduction via * explicit rescheduling in places that are safe. The return @@ -2534,105 +2474,36 @@ static inline int tsk_is_polling(struct task_struct *p) { return task_thread_info(p)->status & TS_POLLING; } -static inline void __current_set_polling(void) +static inline void current_set_polling(void) { current_thread_info()->status |= TS_POLLING; } -static inline bool __must_check current_set_polling_and_test(void) -{ - __current_set_polling(); - - /* - * Polling state must be visible before we test NEED_RESCHED, - * paired by resched_task() - */ - smp_mb(); - - return unlikely(tif_need_resched()); -} - -static inline void __current_clr_polling(void) +static inline void current_clr_polling(void) { current_thread_info()->status &= ~TS_POLLING; -} - -static inline bool __must_check current_clr_polling_and_test(void) -{ - __current_clr_polling(); - - /* - * Polling state must be visible before we test NEED_RESCHED, - * paired by resched_task() - */ - smp_mb(); - - return unlikely(tif_need_resched()); + smp_mb__after_clear_bit(); } #elif defined(TIF_POLLING_NRFLAG) static inline int tsk_is_polling(struct task_struct *p) { return test_tsk_thread_flag(p, TIF_POLLING_NRFLAG); } - -static inline void __current_set_polling(void) +static inline void current_set_polling(void) { set_thread_flag(TIF_POLLING_NRFLAG); } -static inline bool __must_check current_set_polling_and_test(void) -{ - __current_set_polling(); - - /* - * Polling state must be visible before we test NEED_RESCHED, - * paired by resched_task() - * - * XXX: assumes set/clear bit are identical barrier wise. - */ - smp_mb__after_clear_bit(); - - return unlikely(tif_need_resched()); -} - -static inline void __current_clr_polling(void) +static inline void current_clr_polling(void) { clear_thread_flag(TIF_POLLING_NRFLAG); } - -static inline bool __must_check current_clr_polling_and_test(void) -{ - __current_clr_polling(); - - /* - * Polling state must be visible before we test NEED_RESCHED, - * paired by resched_task() - */ - smp_mb__after_clear_bit(); - - return unlikely(tif_need_resched()); -} - #else static inline int tsk_is_polling(struct task_struct *p) { return 0; } -static inline void __current_set_polling(void) { } -static inline void __current_clr_polling(void) { } - -static inline bool __must_check current_set_polling_and_test(void) -{ - return unlikely(tif_need_resched()); -} -static inline bool __must_check current_clr_polling_and_test(void) -{ - return unlikely(tif_need_resched()); -} +static inline void current_set_polling(void) { } +static inline void current_clr_polling(void) { } #endif -static __always_inline bool need_resched(void) -{ - return unlikely(tif_need_resched()); -} - /* * Thread group CPU time accounting. */ @@ -2674,11 +2545,6 @@ static inline unsigned int task_cpu(const struct task_struct *p) return task_thread_info(p)->cpu; } -static inline int task_node(const struct task_struct *p) -{ - return cpu_to_node(task_cpu(p)); -} - extern void set_task_cpu(struct task_struct *p, unsigned int cpu); #else diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h index 41467f8..bf8086b 100644 --- a/include/linux/sched/sysctl.h +++ b/include/linux/sched/sysctl.h @@ -2,8 +2,8 @@ #define _SCHED_SYSCTL_H #ifdef CONFIG_DETECT_HUNG_TASK -extern int sysctl_hung_task_check_count; extern unsigned int sysctl_hung_task_panic; +extern unsigned long sysctl_hung_task_check_count; extern unsigned long sysctl_hung_task_timeout_secs; extern unsigned long sysctl_hung_task_warnings; extern int proc_dohung_task_timeout_secs(struct ctl_table *table, int write, @@ -47,6 +47,7 @@ extern enum sched_tunable_scaling sysctl_sched_tunable_scaling; extern unsigned int sysctl_numa_balancing_scan_delay; extern unsigned int sysctl_numa_balancing_scan_period_min; extern unsigned int sysctl_numa_balancing_scan_period_max; +extern unsigned int sysctl_numa_balancing_scan_period_reset; extern unsigned int sysctl_numa_balancing_scan_size; extern unsigned int sysctl_numa_balancing_settle_count; diff --git a/include/linux/sched_clock.h b/include/linux/sched_clock.h index cddf0c2..fa7922c 100644 --- a/include/linux/sched_clock.h +++ b/include/linux/sched_clock.h @@ -15,7 +15,7 @@ static inline void sched_clock_postinit(void) { } #endif extern void setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate); -extern void sched_clock_register(u64 (*read)(void), int bits, - unsigned long rate); + +extern unsigned long long (*sched_clock_func)(void); #endif diff --git a/include/linux/security.h b/include/linux/security.h index 5623a7f..9d37e2b 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -1052,25 +1052,17 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) * @xfrm_policy_delete_security: * @ctx contains the xfrm_sec_ctx. * Authorize deletion of xp->security. - * @xfrm_state_alloc: + * @xfrm_state_alloc_security: * @x contains the xfrm_state being added to the Security Association * Database by the XFRM system. * @sec_ctx contains the security context information being provided by * the user-level SA generation program (e.g., setkey or racoon). + * @secid contains the secid from which to take the mls portion of the context. * Allocate a security structure to the x->security field; the security * field is initialized to NULL when the xfrm_state is allocated. Set the - * context to correspond to sec_ctx. Return 0 if operation was successful - * (memory to allocate, legal context). - * @xfrm_state_alloc_acquire: - * @x contains the xfrm_state being added to the Security Association - * Database by the XFRM system. - * @polsec contains the policy's security context. - * @secid contains the secid from which to take the mls portion of the - * context. - * Allocate a security structure to the x->security field; the security - * field is initialized to NULL when the xfrm_state is allocated. Set the - * context to correspond to secid. Return 0 if operation was successful - * (memory to allocate, legal context). + * context to correspond to either sec_ctx or polsec, with the mls portion + * taken from secid in the latter case. + * Return 0 if operation was successful (memory to allocate, legal context). * @xfrm_state_free_security: * @x contains the xfrm_state. * Deallocate x->security. @@ -1687,11 +1679,9 @@ struct security_operations { int (*xfrm_policy_clone_security) (struct xfrm_sec_ctx *old_ctx, struct xfrm_sec_ctx **new_ctx); void (*xfrm_policy_free_security) (struct xfrm_sec_ctx *ctx); int (*xfrm_policy_delete_security) (struct xfrm_sec_ctx *ctx); - int (*xfrm_state_alloc) (struct xfrm_state *x, - struct xfrm_user_sec_ctx *sec_ctx); - int (*xfrm_state_alloc_acquire) (struct xfrm_state *x, - struct xfrm_sec_ctx *polsec, - u32 secid); + int (*xfrm_state_alloc_security) (struct xfrm_state *x, + struct xfrm_user_sec_ctx *sec_ctx, + u32 secid); void (*xfrm_state_free_security) (struct xfrm_state *x); int (*xfrm_state_delete_security) (struct xfrm_state *x); int (*xfrm_policy_lookup) (struct xfrm_sec_ctx *ctx, u32 fl_secid, u8 dir); diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 52e0097..4e32edc 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h @@ -20,7 +20,6 @@ struct seq_file { size_t size; size_t from; size_t count; - size_t pad_until; loff_t index; loff_t read_pos; u64 version; @@ -80,20 +79,6 @@ static inline void seq_commit(struct seq_file *m, int num) } } -/** - * seq_setwidth - set padding width - * @m: the seq_file handle - * @size: the max number of bytes to pad. - * - * Call seq_setwidth() for setting max width, then call seq_printf() etc. and - * finally call seq_pad() to pad the remaining bytes. - */ -static inline void seq_setwidth(struct seq_file *m, size_t size) -{ - m->pad_until = m->count + size; -} -void seq_pad(struct seq_file *m, char c); - char *mangle_path(char *s, const char *p, const char *esc); int seq_open(struct file *, const struct seq_operations *); ssize_t seq_read(struct file *, char __user *, size_t, loff_t *); diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index cf87a24..21a2093 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h @@ -34,7 +34,6 @@ #include <linux/spinlock.h> #include <linux/preempt.h> -#include <linux/lockdep.h> #include <asm/processor.h> /* @@ -45,50 +44,10 @@ */ typedef struct seqcount { unsigned sequence; -#ifdef CONFIG_DEBUG_LOCK_ALLOC - struct lockdep_map dep_map; -#endif } seqcount_t; -static inline void __seqcount_init(seqcount_t *s, const char *name, - struct lock_class_key *key) -{ - /* - * Make sure we are not reinitializing a held lock: - */ - lockdep_init_map(&s->dep_map, name, key, 0); - s->sequence = 0; -} - -#ifdef CONFIG_DEBUG_LOCK_ALLOC -# define SEQCOUNT_DEP_MAP_INIT(lockname) \ - .dep_map = { .name = #lockname } \ - -# define seqcount_init(s) \ - do { \ - static struct lock_class_key __key; \ - __seqcount_init((s), #s, &__key); \ - } while (0) - -static inline void seqcount_lockdep_reader_access(const seqcount_t *s) -{ - seqcount_t *l = (seqcount_t *)s; - unsigned long flags; - - local_irq_save(flags); - seqcount_acquire_read(&l->dep_map, 0, 0, _RET_IP_); - seqcount_release(&l->dep_map, 1, _RET_IP_); - local_irq_restore(flags); -} - -#else -# define SEQCOUNT_DEP_MAP_INIT(lockname) -# define seqcount_init(s) __seqcount_init(s, NULL, NULL) -# define seqcount_lockdep_reader_access(x) -#endif - -#define SEQCNT_ZERO(lockname) { .sequence = 0, SEQCOUNT_DEP_MAP_INIT(lockname)} - +#define SEQCNT_ZERO { 0 } +#define seqcount_init(x) do { *(x) = (seqcount_t) SEQCNT_ZERO; } while (0) /** * __read_seqcount_begin - begin a seq-read critical section (without barrier) @@ -117,22 +76,6 @@ repeat: } /** - * read_seqcount_begin_no_lockdep - start seq-read critical section w/o lockdep - * @s: pointer to seqcount_t - * Returns: count to be passed to read_seqcount_retry - * - * read_seqcount_begin_no_lockdep opens a read critical section of the given - * seqcount, but without any lockdep checking. Validity of the critical - * section is tested by checking read_seqcount_retry function. - */ -static inline unsigned read_seqcount_begin_no_lockdep(const seqcount_t *s) -{ - unsigned ret = __read_seqcount_begin(s); - smp_rmb(); - return ret; -} - -/** * read_seqcount_begin - begin a seq-read critical section * @s: pointer to seqcount_t * Returns: count to be passed to read_seqcount_retry @@ -143,8 +86,9 @@ static inline unsigned read_seqcount_begin_no_lockdep(const seqcount_t *s) */ static inline unsigned read_seqcount_begin(const seqcount_t *s) { - seqcount_lockdep_reader_access(s); - return read_seqcount_begin_no_lockdep(s); + unsigned ret = __read_seqcount_begin(s); + smp_rmb(); + return ret; } /** @@ -164,8 +108,6 @@ static inline unsigned read_seqcount_begin(const seqcount_t *s) static inline unsigned raw_seqcount_begin(const seqcount_t *s) { unsigned ret = ACCESS_ONCE(s->sequence); - - seqcount_lockdep_reader_access(s); smp_rmb(); return ret & ~1; } @@ -210,21 +152,14 @@ static inline int read_seqcount_retry(const seqcount_t *s, unsigned start) * Sequence counter only version assumes that callers are using their * own mutexing. */ -static inline void write_seqcount_begin_nested(seqcount_t *s, int subclass) +static inline void write_seqcount_begin(seqcount_t *s) { s->sequence++; smp_wmb(); - seqcount_acquire(&s->dep_map, subclass, 0, _RET_IP_); -} - -static inline void write_seqcount_begin(seqcount_t *s) -{ - write_seqcount_begin_nested(s, 0); } static inline void write_seqcount_end(seqcount_t *s) { - seqcount_release(&s->dep_map, 1, _RET_IP_); smp_wmb(); s->sequence++; } @@ -253,7 +188,7 @@ typedef struct { */ #define __SEQLOCK_UNLOCKED(lockname) \ { \ - .seqcount = SEQCNT_ZERO(lockname), \ + .seqcount = SEQCNT_ZERO, \ .lock = __SPIN_LOCK_UNLOCKED(lockname) \ } @@ -354,35 +289,6 @@ static inline void read_sequnlock_excl(seqlock_t *sl) spin_unlock(&sl->lock); } -/** - * read_seqbegin_or_lock - begin a sequence number check or locking block - * @lock: sequence lock - * @seq : sequence number to be checked - * - * First try it once optimistically without taking the lock. If that fails, - * take the lock. The sequence number is also used as a marker for deciding - * whether to be a reader (even) or writer (odd). - * N.B. seq must be initialized to an even number to begin with. - */ -static inline void read_seqbegin_or_lock(seqlock_t *lock, int *seq) -{ - if (!(*seq & 1)) /* Even */ - *seq = read_seqbegin(lock); - else /* Odd */ - read_seqlock_excl(lock); -} - -static inline int need_seqretry(seqlock_t *lock, int seq) -{ - return !(seq & 1) && read_seqretry(lock, seq); -} - -static inline void done_seqretry(seqlock_t *lock, int seq) -{ - if (seq & 1) - read_sequnlock_excl(lock); -} - static inline void read_seqlock_excl_bh(seqlock_t *sl) { spin_lock_bh(&sl->lock); diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index f729be9..b98291a 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -66,6 +66,7 @@ struct uart_ops { void (*set_ldisc)(struct uart_port *, int new); void (*pm)(struct uart_port *, unsigned int state, unsigned int oldstate); + int (*set_wake)(struct uart_port *, unsigned int state); /* * Return a string describing the type of the port diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h index 50fe651..d340497 100644 --- a/include/linux/serial_sci.h +++ b/include/linux/serial_sci.h @@ -5,7 +5,7 @@ #include <linux/sh_dma.h> /* - * Generic header for SuperH (H)SCI(F) (used by sh/sh64 and related parts) + * Generic header for SuperH (H)SCI(F) (used by sh/sh64/h8300 and related parts) */ #define SCIx_NOT_SUPPORTED (-1) diff --git a/include/linux/sfi.h b/include/linux/sfi.h index d9b436f..fe81791 100644 --- a/include/linux/sfi.h +++ b/include/linux/sfi.h @@ -59,9 +59,6 @@ #ifndef _LINUX_SFI_H #define _LINUX_SFI_H -#include <linux/init.h> -#include <linux/types.h> - /* Table signatures reserved by the SFI specification */ #define SFI_SIG_SYST "SYST" #define SFI_SIG_FREQ "FREQ" diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index bec1cc7..c2d8933 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -318,13 +318,9 @@ enum { SKB_GSO_GRE = 1 << 6, - SKB_GSO_IPIP = 1 << 7, + SKB_GSO_UDP_TUNNEL = 1 << 7, - SKB_GSO_SIT = 1 << 8, - - SKB_GSO_UDP_TUNNEL = 1 << 9, - - SKB_GSO_MPLS = 1 << 10, + SKB_GSO_MPLS = 1 << 8, }; #if BITS_PER_LONG > 32 @@ -337,6 +333,11 @@ typedef unsigned int sk_buff_data_t; typedef unsigned char *sk_buff_data_t; #endif +#if defined(CONFIG_NF_DEFRAG_IPV4) || defined(CONFIG_NF_DEFRAG_IPV4_MODULE) || \ + defined(CONFIG_NF_DEFRAG_IPV6) || defined(CONFIG_NF_DEFRAG_IPV6_MODULE) +#define NET_SKBUFF_NF_DEFRAG_NEEDED 1 +#endif + /** * struct sk_buff - socket buffer * @next: Next buffer in list @@ -369,6 +370,7 @@ typedef unsigned char *sk_buff_data_t; * @protocol: Packet protocol from driver * @destructor: Destruct function * @nfct: Associated connection, if any + * @nfct_reasm: netfilter conntrack re-assembly pointer * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c * @skb_iif: ifindex of device we arrived on * @tc_index: Traffic control index @@ -457,6 +459,9 @@ struct sk_buff { #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) struct nf_conntrack *nfct; #endif +#ifdef NET_SKBUFF_NF_DEFRAG_NEEDED + struct sk_buff *nfct_reasm; +#endif #ifdef CONFIG_BRIDGE_NETFILTER struct nf_bridge_info *nf_bridge; #endif @@ -580,8 +585,8 @@ static inline void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst) skb->_skb_refdst = (unsigned long)dst; } -void __skb_dst_set_noref(struct sk_buff *skb, struct dst_entry *dst, - bool force); +extern void __skb_dst_set_noref(struct sk_buff *skb, struct dst_entry *dst, + bool force); /** * skb_dst_set_noref - sets skb dst, hopefully, without taking reference @@ -629,20 +634,20 @@ static inline struct rtable *skb_rtable(const struct sk_buff *skb) return (struct rtable *)skb_dst(skb); } -void kfree_skb(struct sk_buff *skb); -void kfree_skb_list(struct sk_buff *segs); -void skb_tx_error(struct sk_buff *skb); -void consume_skb(struct sk_buff *skb); -void __kfree_skb(struct sk_buff *skb); +extern void kfree_skb(struct sk_buff *skb); +extern void kfree_skb_list(struct sk_buff *segs); +extern void skb_tx_error(struct sk_buff *skb); +extern void consume_skb(struct sk_buff *skb); +extern void __kfree_skb(struct sk_buff *skb); extern struct kmem_cache *skbuff_head_cache; -void kfree_skb_partial(struct sk_buff *skb, bool head_stolen); -bool skb_try_coalesce(struct sk_buff *to, struct sk_buff *from, - bool *fragstolen, int *delta_truesize); +extern void kfree_skb_partial(struct sk_buff *skb, bool head_stolen); +extern bool skb_try_coalesce(struct sk_buff *to, struct sk_buff *from, + bool *fragstolen, int *delta_truesize); -struct sk_buff *__alloc_skb(unsigned int size, gfp_t priority, int flags, - int node); -struct sk_buff *build_skb(void *data, unsigned int frag_size); +extern struct sk_buff *__alloc_skb(unsigned int size, + gfp_t priority, int flags, int node); +extern struct sk_buff *build_skb(void *data, unsigned int frag_size); static inline struct sk_buff *alloc_skb(unsigned int size, gfp_t priority) { @@ -655,33 +660,41 @@ static inline struct sk_buff *alloc_skb_fclone(unsigned int size, return __alloc_skb(size, priority, SKB_ALLOC_FCLONE, NUMA_NO_NODE); } -struct sk_buff *__alloc_skb_head(gfp_t priority, int node); +extern struct sk_buff *__alloc_skb_head(gfp_t priority, int node); static inline struct sk_buff *alloc_skb_head(gfp_t priority) { return __alloc_skb_head(priority, -1); } -struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src); -int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask); -struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t priority); -struct sk_buff *skb_copy(const struct sk_buff *skb, gfp_t priority); -struct sk_buff *__pskb_copy(struct sk_buff *skb, int headroom, gfp_t gfp_mask); - -int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail, gfp_t gfp_mask); -struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, - unsigned int headroom); -struct sk_buff *skb_copy_expand(const struct sk_buff *skb, int newheadroom, - int newtailroom, gfp_t priority); -int skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, - int len); -int skb_cow_data(struct sk_buff *skb, int tailbits, struct sk_buff **trailer); -int skb_pad(struct sk_buff *skb, int pad); +extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src); +extern int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask); +extern struct sk_buff *skb_clone(struct sk_buff *skb, + gfp_t priority); +extern struct sk_buff *skb_copy(const struct sk_buff *skb, + gfp_t priority); +extern struct sk_buff *__pskb_copy(struct sk_buff *skb, + int headroom, gfp_t gfp_mask); + +extern int pskb_expand_head(struct sk_buff *skb, + int nhead, int ntail, + gfp_t gfp_mask); +extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, + unsigned int headroom); +extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb, + int newheadroom, int newtailroom, + gfp_t priority); +extern int skb_to_sgvec(struct sk_buff *skb, + struct scatterlist *sg, int offset, + int len); +extern int skb_cow_data(struct sk_buff *skb, int tailbits, + struct sk_buff **trailer); +extern int skb_pad(struct sk_buff *skb, int pad); #define dev_kfree_skb(a) consume_skb(a) -int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb, - int getfrag(void *from, char *to, int offset, - int len, int odd, struct sk_buff *skb), - void *from, int length); +extern int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb, + int getfrag(void *from, char *to, int offset, + int len,int odd, struct sk_buff *skb), + void *from, int length); struct skb_seq_state { __u32 lower_offset; @@ -693,17 +706,18 @@ struct skb_seq_state { __u8 *frag_data; }; -void skb_prepare_seq_read(struct sk_buff *skb, unsigned int from, - unsigned int to, struct skb_seq_state *st); -unsigned int skb_seq_read(unsigned int consumed, const u8 **data, - struct skb_seq_state *st); -void skb_abort_seq_read(struct skb_seq_state *st); +extern void skb_prepare_seq_read(struct sk_buff *skb, + unsigned int from, unsigned int to, + struct skb_seq_state *st); +extern unsigned int skb_seq_read(unsigned int consumed, const u8 **data, + struct skb_seq_state *st); +extern void skb_abort_seq_read(struct skb_seq_state *st); -unsigned int skb_find_text(struct sk_buff *skb, unsigned int from, - unsigned int to, struct ts_config *config, - struct ts_state *state); +extern unsigned int skb_find_text(struct sk_buff *skb, unsigned int from, + unsigned int to, struct ts_config *config, + struct ts_state *state); -void __skb_get_rxhash(struct sk_buff *skb); +extern void __skb_get_rxhash(struct sk_buff *skb); static inline __u32 skb_get_rxhash(struct sk_buff *skb) { if (!skb->l4_rxhash) @@ -1081,8 +1095,7 @@ static inline void skb_queue_head_init_class(struct sk_buff_head *list, * The "__skb_xxxx()" functions are the non-atomic ones that * can only be called with interrupts disabled. */ -void skb_insert(struct sk_buff *old, struct sk_buff *newsk, - struct sk_buff_head *list); +extern void skb_insert(struct sk_buff *old, struct sk_buff *newsk, struct sk_buff_head *list); static inline void __skb_insert(struct sk_buff *newsk, struct sk_buff *prev, struct sk_buff *next, struct sk_buff_head *list) @@ -1188,8 +1201,8 @@ static inline void __skb_queue_after(struct sk_buff_head *list, __skb_insert(newsk, prev, prev->next, list); } -void skb_append(struct sk_buff *old, struct sk_buff *newsk, - struct sk_buff_head *list); +extern void skb_append(struct sk_buff *old, struct sk_buff *newsk, + struct sk_buff_head *list); static inline void __skb_queue_before(struct sk_buff_head *list, struct sk_buff *next, @@ -1208,7 +1221,7 @@ static inline void __skb_queue_before(struct sk_buff_head *list, * * A buffer cannot be placed on two lists at the same time. */ -void skb_queue_head(struct sk_buff_head *list, struct sk_buff *newsk); +extern void skb_queue_head(struct sk_buff_head *list, struct sk_buff *newsk); static inline void __skb_queue_head(struct sk_buff_head *list, struct sk_buff *newsk) { @@ -1225,7 +1238,7 @@ static inline void __skb_queue_head(struct sk_buff_head *list, * * A buffer cannot be placed on two lists at the same time. */ -void skb_queue_tail(struct sk_buff_head *list, struct sk_buff *newsk); +extern void skb_queue_tail(struct sk_buff_head *list, struct sk_buff *newsk); static inline void __skb_queue_tail(struct sk_buff_head *list, struct sk_buff *newsk) { @@ -1236,7 +1249,7 @@ static inline void __skb_queue_tail(struct sk_buff_head *list, * remove sk_buff from list. _Must_ be called atomically, and with * the list known.. */ -void skb_unlink(struct sk_buff *skb, struct sk_buff_head *list); +extern void skb_unlink(struct sk_buff *skb, struct sk_buff_head *list); static inline void __skb_unlink(struct sk_buff *skb, struct sk_buff_head *list) { struct sk_buff *next, *prev; @@ -1257,7 +1270,7 @@ static inline void __skb_unlink(struct sk_buff *skb, struct sk_buff_head *list) * so must be used with appropriate locks held only. The head item is * returned or %NULL if the list is empty. */ -struct sk_buff *skb_dequeue(struct sk_buff_head *list); +extern struct sk_buff *skb_dequeue(struct sk_buff_head *list); static inline struct sk_buff *__skb_dequeue(struct sk_buff_head *list) { struct sk_buff *skb = skb_peek(list); @@ -1274,7 +1287,7 @@ static inline struct sk_buff *__skb_dequeue(struct sk_buff_head *list) * so must be used with appropriate locks held only. The tail item is * returned or %NULL if the list is empty. */ -struct sk_buff *skb_dequeue_tail(struct sk_buff_head *list); +extern struct sk_buff *skb_dequeue_tail(struct sk_buff_head *list); static inline struct sk_buff *__skb_dequeue_tail(struct sk_buff_head *list) { struct sk_buff *skb = skb_peek_tail(list); @@ -1348,7 +1361,7 @@ static inline void __skb_fill_page_desc(struct sk_buff *skb, int i, * @size: the length of the data * * As per __skb_fill_page_desc() -- initialises the @i'th fragment of - * @skb to point to @size bytes at offset @off within @page. In + * @skb to point to &size bytes at offset @off within @page. In * addition updates @skb such that @i is the last fragment. * * Does not take any additional reference on the fragment. @@ -1360,11 +1373,8 @@ static inline void skb_fill_page_desc(struct sk_buff *skb, int i, skb_shinfo(skb)->nr_frags = i + 1; } -void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, int off, - int size, unsigned int truesize); - -void skb_coalesce_rx_frag(struct sk_buff *skb, int i, int size, - unsigned int truesize); +extern void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, + int off, int size, unsigned int truesize); #define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags) #define SKB_FRAG_ASSERT(skb) BUG_ON(skb_has_frag_list(skb)) @@ -1408,8 +1418,7 @@ static inline void skb_set_tail_pointer(struct sk_buff *skb, const int offset) /* * Add data to an sk_buff */ -unsigned char *pskb_put(struct sk_buff *skb, struct sk_buff *tail, int len); -unsigned char *skb_put(struct sk_buff *skb, unsigned int len); +extern unsigned char *skb_put(struct sk_buff *skb, unsigned int len); static inline unsigned char *__skb_put(struct sk_buff *skb, unsigned int len) { unsigned char *tmp = skb_tail_pointer(skb); @@ -1419,7 +1428,7 @@ static inline unsigned char *__skb_put(struct sk_buff *skb, unsigned int len) return tmp; } -unsigned char *skb_push(struct sk_buff *skb, unsigned int len); +extern unsigned char *skb_push(struct sk_buff *skb, unsigned int len); static inline unsigned char *__skb_push(struct sk_buff *skb, unsigned int len) { skb->data -= len; @@ -1427,7 +1436,7 @@ static inline unsigned char *__skb_push(struct sk_buff *skb, unsigned int len) return skb->data; } -unsigned char *skb_pull(struct sk_buff *skb, unsigned int len); +extern unsigned char *skb_pull(struct sk_buff *skb, unsigned int len); static inline unsigned char *__skb_pull(struct sk_buff *skb, unsigned int len) { skb->len -= len; @@ -1440,7 +1449,7 @@ static inline unsigned char *skb_pull_inline(struct sk_buff *skb, unsigned int l return unlikely(len > skb->len) ? NULL : __skb_pull(skb, len); } -unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta); +extern unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta); static inline unsigned char *__pskb_pull(struct sk_buff *skb, unsigned int len) { @@ -1744,7 +1753,7 @@ static inline int pskb_network_may_pull(struct sk_buff *skb, unsigned int len) #define NET_SKB_PAD max(32, L1_CACHE_BYTES) #endif -int ___pskb_trim(struct sk_buff *skb, unsigned int len); +extern int ___pskb_trim(struct sk_buff *skb, unsigned int len); static inline void __skb_trim(struct sk_buff *skb, unsigned int len) { @@ -1756,7 +1765,7 @@ static inline void __skb_trim(struct sk_buff *skb, unsigned int len) skb_set_tail_pointer(skb, len); } -void skb_trim(struct sk_buff *skb, unsigned int len); +extern void skb_trim(struct sk_buff *skb, unsigned int len); static inline int __pskb_trim(struct sk_buff *skb, unsigned int len) { @@ -1829,7 +1838,7 @@ static inline int skb_orphan_frags(struct sk_buff *skb, gfp_t gfp_mask) * the list and one reference dropped. This function does not take the * list lock and the caller must hold the relevant locks to use it. */ -void skb_queue_purge(struct sk_buff_head *list); +extern void skb_queue_purge(struct sk_buff_head *list); static inline void __skb_queue_purge(struct sk_buff_head *list) { struct sk_buff *skb; @@ -1841,10 +1850,11 @@ static inline void __skb_queue_purge(struct sk_buff_head *list) #define NETDEV_FRAG_PAGE_MAX_SIZE (PAGE_SIZE << NETDEV_FRAG_PAGE_MAX_ORDER) #define NETDEV_PAGECNT_MAX_BIAS NETDEV_FRAG_PAGE_MAX_SIZE -void *netdev_alloc_frag(unsigned int fragsz); +extern void *netdev_alloc_frag(unsigned int fragsz); -struct sk_buff *__netdev_alloc_skb(struct net_device *dev, unsigned int length, - gfp_t gfp_mask); +extern struct sk_buff *__netdev_alloc_skb(struct net_device *dev, + unsigned int length, + gfp_t gfp_mask); /** * netdev_alloc_skb - allocate an skbuff for rx on a specific device @@ -2061,8 +2071,6 @@ static inline void skb_frag_set_page(struct sk_buff *skb, int f, __skb_frag_set_page(&skb_shinfo(skb)->frags[f], page); } -bool skb_page_frag_refill(unsigned int sz, struct page_frag *pfrag, gfp_t prio); - /** * skb_frag_dma_map - maps a paged fragment via the DMA API * @dev: the device to map the fragment to @@ -2263,6 +2271,24 @@ static inline void skb_postpull_rcsum(struct sk_buff *skb, unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len); +/** + * pskb_trim_rcsum - trim received skb and update checksum + * @skb: buffer to trim + * @len: new length + * + * This is exactly the same as pskb_trim except that it ensures the + * checksum of received packets are still valid after the operation. + */ + +static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) +{ + if (likely(len >= skb->len)) + return 0; + if (skb->ip_summed == CHECKSUM_COMPLETE) + skb->ip_summed = CHECKSUM_NONE; + return __pskb_trim(skb, len); +} + #define skb_queue_walk(queue, skb) \ for (skb = (queue)->next; \ skb != (struct sk_buff *)(queue); \ @@ -2316,70 +2342,60 @@ static inline void skb_frag_add_head(struct sk_buff *skb, struct sk_buff *frag) #define skb_walk_frags(skb, iter) \ for (iter = skb_shinfo(skb)->frag_list; iter; iter = iter->next) -struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned flags, - int *peeked, int *off, int *err); -struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock, - int *err); -unsigned int datagram_poll(struct file *file, struct socket *sock, - struct poll_table_struct *wait); -int skb_copy_datagram_iovec(const struct sk_buff *from, int offset, - struct iovec *to, int size); -int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, int hlen, - struct iovec *iov); -int skb_copy_datagram_from_iovec(struct sk_buff *skb, int offset, - const struct iovec *from, int from_offset, - int len); -int zerocopy_sg_from_iovec(struct sk_buff *skb, const struct iovec *frm, - int offset, size_t count); -int skb_copy_datagram_const_iovec(const struct sk_buff *from, int offset, - const struct iovec *to, int to_offset, - int size); -void skb_free_datagram(struct sock *sk, struct sk_buff *skb); -void skb_free_datagram_locked(struct sock *sk, struct sk_buff *skb); -int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, unsigned int flags); -int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len); -int skb_store_bits(struct sk_buff *skb, int offset, const void *from, int len); -__wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset, u8 *to, - int len, __wsum csum); -int skb_splice_bits(struct sk_buff *skb, unsigned int offset, - struct pipe_inode_info *pipe, unsigned int len, - unsigned int flags); -void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to); -void skb_split(struct sk_buff *skb, struct sk_buff *skb1, const u32 len); -int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen); -void skb_scrub_packet(struct sk_buff *skb, bool xnet); -struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features); - -struct skb_checksum_ops { - __wsum (*update)(const void *mem, int len, __wsum wsum); - __wsum (*combine)(__wsum csum, __wsum csum2, int offset, int len); -}; - -__wsum __skb_checksum(const struct sk_buff *skb, int offset, int len, - __wsum csum, const struct skb_checksum_ops *ops); -__wsum skb_checksum(const struct sk_buff *skb, int offset, int len, - __wsum csum); - -/** - * pskb_trim_rcsum - trim received skb and update checksum - * @skb: buffer to trim - * @len: new length - * - * This is exactly the same as pskb_trim except that it ensures the - * checksum of received packets are still valid after the operation. - */ - -static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) -{ - if (likely(len >= skb->len)) - return 0; - if (skb->ip_summed == CHECKSUM_COMPLETE) { - __wsum adj = skb_checksum(skb, len, skb->len - len, 0); - - skb->csum = csum_sub(skb->csum, adj); - } - return __pskb_trim(skb, len); -} +extern struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned flags, + int *peeked, int *off, int *err); +extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, + int noblock, int *err); +extern unsigned int datagram_poll(struct file *file, struct socket *sock, + struct poll_table_struct *wait); +extern int skb_copy_datagram_iovec(const struct sk_buff *from, + int offset, struct iovec *to, + int size); +extern int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, + int hlen, + struct iovec *iov); +extern int skb_copy_datagram_from_iovec(struct sk_buff *skb, + int offset, + const struct iovec *from, + int from_offset, + int len); +extern int zerocopy_sg_from_iovec(struct sk_buff *skb, + const struct iovec *frm, + int offset, + size_t count); +extern int skb_copy_datagram_const_iovec(const struct sk_buff *from, + int offset, + const struct iovec *to, + int to_offset, + int size); +extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); +extern void skb_free_datagram_locked(struct sock *sk, + struct sk_buff *skb); +extern int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, + unsigned int flags); +extern __wsum skb_checksum(const struct sk_buff *skb, int offset, + int len, __wsum csum); +extern int skb_copy_bits(const struct sk_buff *skb, int offset, + void *to, int len); +extern int skb_store_bits(struct sk_buff *skb, int offset, + const void *from, int len); +extern __wsum skb_copy_and_csum_bits(const struct sk_buff *skb, + int offset, u8 *to, int len, + __wsum csum); +extern int skb_splice_bits(struct sk_buff *skb, + unsigned int offset, + struct pipe_inode_info *pipe, + unsigned int len, + unsigned int flags); +extern void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to); +extern void skb_split(struct sk_buff *skb, + struct sk_buff *skb1, const u32 len); +extern int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, + int shiftlen); +extern void skb_scrub_packet(struct sk_buff *skb, bool xnet); + +extern struct sk_buff *skb_segment(struct sk_buff *skb, + netdev_features_t features); static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, int len, void *buffer) @@ -2424,7 +2440,7 @@ static inline void skb_copy_to_linear_data_offset(struct sk_buff *skb, memcpy(skb->data + offset, from, len); } -void skb_init(void); +extern void skb_init(void); static inline ktime_t skb_get_ktime(const struct sk_buff *skb) { @@ -2467,12 +2483,12 @@ static inline ktime_t net_invalid_timestamp(void) return ktime_set(0, 0); } -void skb_timestamping_init(void); +extern void skb_timestamping_init(void); #ifdef CONFIG_NETWORK_PHY_TIMESTAMPING -void skb_clone_tx_timestamp(struct sk_buff *skb); -bool skb_defer_rx_timestamp(struct sk_buff *skb); +extern void skb_clone_tx_timestamp(struct sk_buff *skb); +extern bool skb_defer_rx_timestamp(struct sk_buff *skb); #else /* CONFIG_NETWORK_PHY_TIMESTAMPING */ @@ -2513,8 +2529,8 @@ void skb_complete_tx_timestamp(struct sk_buff *skb, * generates a software time stamp (otherwise), then queues the clone * to the error queue of the socket. Errors are silently ignored. */ -void skb_tstamp_tx(struct sk_buff *orig_skb, - struct skb_shared_hwtstamps *hwtstamps); +extern void skb_tstamp_tx(struct sk_buff *orig_skb, + struct skb_shared_hwtstamps *hwtstamps); static inline void sw_tx_timestamp(struct sk_buff *skb) { @@ -2546,8 +2562,8 @@ static inline void skb_tx_timestamp(struct sk_buff *skb) */ void skb_complete_wifi_ack(struct sk_buff *skb, bool acked); -__sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len); -__sum16 __skb_checksum_complete(struct sk_buff *skb); +extern __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len); +extern __sum16 __skb_checksum_complete(struct sk_buff *skb); static inline int skb_csum_unnecessary(const struct sk_buff *skb) { @@ -2577,7 +2593,7 @@ static inline __sum16 skb_checksum_complete(struct sk_buff *skb) } #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) -void nf_conntrack_destroy(struct nf_conntrack *nfct); +extern void nf_conntrack_destroy(struct nf_conntrack *nfct); static inline void nf_conntrack_put(struct nf_conntrack *nfct) { if (nfct && atomic_dec_and_test(&nfct->use)) @@ -2589,6 +2605,18 @@ static inline void nf_conntrack_get(struct nf_conntrack *nfct) atomic_inc(&nfct->use); } #endif +#ifdef NET_SKBUFF_NF_DEFRAG_NEEDED +static inline void nf_conntrack_get_reasm(struct sk_buff *skb) +{ + if (skb) + atomic_inc(&skb->users); +} +static inline void nf_conntrack_put_reasm(struct sk_buff *skb) +{ + if (skb) + kfree_skb(skb); +} +#endif #ifdef CONFIG_BRIDGE_NETFILTER static inline void nf_bridge_put(struct nf_bridge_info *nf_bridge) { @@ -2607,6 +2635,10 @@ static inline void nf_reset(struct sk_buff *skb) nf_conntrack_put(skb->nfct); skb->nfct = NULL; #endif +#ifdef NET_SKBUFF_NF_DEFRAG_NEEDED + nf_conntrack_put_reasm(skb->nfct_reasm); + skb->nfct_reasm = NULL; +#endif #ifdef CONFIG_BRIDGE_NETFILTER nf_bridge_put(skb->nf_bridge); skb->nf_bridge = NULL; @@ -2628,6 +2660,10 @@ static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src) nf_conntrack_get(src->nfct); dst->nfctinfo = src->nfctinfo; #endif +#ifdef NET_SKBUFF_NF_DEFRAG_NEEDED + dst->nfct_reasm = src->nfct_reasm; + nf_conntrack_get_reasm(src->nfct_reasm); +#endif #ifdef CONFIG_BRIDGE_NETFILTER dst->nf_bridge = src->nf_bridge; nf_bridge_get(src->nf_bridge); @@ -2639,6 +2675,9 @@ static inline void nf_copy(struct sk_buff *dst, const struct sk_buff *src) #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) nf_conntrack_put(dst->nfct); #endif +#ifdef NET_SKBUFF_NF_DEFRAG_NEEDED + nf_conntrack_put_reasm(dst->nfct_reasm); +#endif #ifdef CONFIG_BRIDGE_NETFILTER nf_bridge_put(dst->nf_bridge); #endif @@ -2693,27 +2732,28 @@ static inline bool skb_rx_queue_recorded(const struct sk_buff *skb) return skb->queue_mapping != 0; } -u16 __skb_tx_hash(const struct net_device *dev, const struct sk_buff *skb, - unsigned int num_tx_queues); +extern u16 __skb_tx_hash(const struct net_device *dev, + const struct sk_buff *skb, + unsigned int num_tx_queues); +#ifdef CONFIG_XFRM static inline struct sec_path *skb_sec_path(struct sk_buff *skb) { -#ifdef CONFIG_XFRM return skb->sp; +} #else +static inline struct sec_path *skb_sec_path(struct sk_buff *skb) +{ return NULL; -#endif } +#endif /* Keeps track of mac header offset relative to skb->head. * It is useful for TSO of Tunneling protocol. e.g. GRE. * For non-tunnel skb it points to skb_mac_header() and for - * tunnel skb it points to outer mac header. - * Keeps track of level of encapsulation of network headers. - */ + * tunnel skb it points to outer mac header. */ struct skb_gso_cb { - int mac_offset; - int encap_level; + int mac_offset; }; #define SKB_GSO_CB(skb) ((struct skb_gso_cb *)(skb)->cb) @@ -2743,13 +2783,12 @@ static inline bool skb_is_gso(const struct sk_buff *skb) return skb_shinfo(skb)->gso_size; } -/* Note: Should be called only if skb_is_gso(skb) is true */ static inline bool skb_is_gso_v6(const struct sk_buff *skb) { return skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6; } -void __skb_warn_lro_forwarding(const struct sk_buff *skb); +extern void __skb_warn_lro_forwarding(const struct sk_buff *skb); static inline bool skb_warn_if_lro(const struct sk_buff *skb) { diff --git a/include/linux/slab.h b/include/linux/slab.h index 1e2f4fe..74f1058 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -53,14 +53,7 @@ * } * rcu_read_unlock(); * - * This is useful if we need to approach a kernel structure obliquely, - * from its address obtained without the usual locking. We can lock - * the structure to stabilize it and check it's still at the given address, - * only if we can be sure that the memory has not been meanwhile reused - * for some other kind of object (which our subsystem's lock might corrupt). - * - * rcu_read_lock before reading the address, then rcu_read_unlock after - * taking the spinlock within the structure expected at that address. + * See also the comment on struct slab_rcu in mm/slab.c. */ #define SLAB_DESTROY_BY_RCU 0x00080000UL /* Defer freeing slabs to RCU */ #define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */ @@ -388,55 +381,10 @@ static __always_inline void *kmalloc_large(size_t size, gfp_t flags) /** * kmalloc - allocate memory * @size: how many bytes of memory are required. - * @flags: the type of memory to allocate. + * @flags: the type of memory to allocate (see kcalloc). * * kmalloc is the normal method of allocating memory * for objects smaller than page size in the kernel. - * - * The @flags argument may be one of: - * - * %GFP_USER - Allocate memory on behalf of user. May sleep. - * - * %GFP_KERNEL - Allocate normal kernel ram. May sleep. - * - * %GFP_ATOMIC - Allocation will not sleep. May use emergency pools. - * For example, use this inside interrupt handlers. - * - * %GFP_HIGHUSER - Allocate pages from high memory. - * - * %GFP_NOIO - Do not do any I/O at all while trying to get memory. - * - * %GFP_NOFS - Do not make any fs calls while trying to get memory. - * - * %GFP_NOWAIT - Allocation will not sleep. - * - * %GFP_THISNODE - Allocate node-local memory only. - * - * %GFP_DMA - Allocation suitable for DMA. - * Should only be used for kmalloc() caches. Otherwise, use a - * slab created with SLAB_DMA. - * - * Also it is possible to set different flags by OR'ing - * in one or more of the following additional @flags: - * - * %__GFP_COLD - Request cache-cold pages instead of - * trying to return cache-warm pages. - * - * %__GFP_HIGH - This allocation has high priority and may use emergency pools. - * - * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail - * (think twice before using). - * - * %__GFP_NORETRY - If memory is not immediately available, - * then give up at once. - * - * %__GFP_NOWARN - If allocation fails, don't issue any warnings. - * - * %__GFP_REPEAT - If allocation fails initially, try once more before failing. - * - * There are other flags available as well, but these are not intended - * for general use, and so are not documented here. For a full list of - * potential flags, always refer to linux/gfp.h. */ static __always_inline void *kmalloc(size_t size, gfp_t flags) { @@ -547,6 +495,61 @@ int cache_show(struct kmem_cache *s, struct seq_file *m); void print_slabinfo_header(struct seq_file *m); /** + * kmalloc - allocate memory + * @size: how many bytes of memory are required. + * @flags: the type of memory to allocate. + * + * The @flags argument may be one of: + * + * %GFP_USER - Allocate memory on behalf of user. May sleep. + * + * %GFP_KERNEL - Allocate normal kernel ram. May sleep. + * + * %GFP_ATOMIC - Allocation will not sleep. May use emergency pools. + * For example, use this inside interrupt handlers. + * + * %GFP_HIGHUSER - Allocate pages from high memory. + * + * %GFP_NOIO - Do not do any I/O at all while trying to get memory. + * + * %GFP_NOFS - Do not make any fs calls while trying to get memory. + * + * %GFP_NOWAIT - Allocation will not sleep. + * + * %GFP_THISNODE - Allocate node-local memory only. + * + * %GFP_DMA - Allocation suitable for DMA. + * Should only be used for kmalloc() caches. Otherwise, use a + * slab created with SLAB_DMA. + * + * Also it is possible to set different flags by OR'ing + * in one or more of the following additional @flags: + * + * %__GFP_COLD - Request cache-cold pages instead of + * trying to return cache-warm pages. + * + * %__GFP_HIGH - This allocation has high priority and may use emergency pools. + * + * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail + * (think twice before using). + * + * %__GFP_NORETRY - If memory is not immediately available, + * then give up at once. + * + * %__GFP_NOWARN - If allocation fails, don't issue any warnings. + * + * %__GFP_REPEAT - If allocation fails initially, try once more before failing. + * + * There are other flags available as well, but these are not intended + * for general use, and so are not documented here. For a full list of + * potential flags, always refer to linux/gfp.h. + * + * kmalloc is the normal method of allocating memory + * in the kernel. + */ +static __always_inline void *kmalloc(size_t size, gfp_t flags); + +/** * kmalloc_array - allocate memory for an array. * @n: number of elements. * @size: element size. diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h index 09bfffb..e9346b4 100644 --- a/include/linux/slab_def.h +++ b/include/linux/slab_def.h @@ -27,8 +27,8 @@ struct kmem_cache { size_t colour; /* cache colouring range */ unsigned int colour_off; /* colour offset */ - struct kmem_cache *freelist_cache; - unsigned int freelist_size; + struct kmem_cache *slabp_cache; + unsigned int slab_size; /* constructor func */ void (*ctor)(void *obj); diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index f56bfa9..cc0b67e 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h @@ -11,7 +11,7 @@ enum stat_item { ALLOC_FASTPATH, /* Allocation from cpu slab */ ALLOC_SLOWPATH, /* Allocation by getting a new cpu slab */ - FREE_FASTPATH, /* Free to cpu slab */ + FREE_FASTPATH, /* Free to cpu slub */ FREE_SLOWPATH, /* Freeing not to cpu slab */ FREE_FROZEN, /* Freeing to frozen slab */ FREE_ADD_PARTIAL, /* Freeing moves slab to partial list */ diff --git a/include/linux/smp.h b/include/linux/smp.h index 5da22ee..731f523 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h @@ -49,9 +49,6 @@ void on_each_cpu_cond(bool (*cond_func)(int cpu, void *info), smp_call_func_t func, void *info, bool wait, gfp_t gfp_flags); -void __smp_call_function_single(int cpuid, struct call_single_data *data, - int wait); - #ifdef CONFIG_SMP #include <linux/preempt.h> @@ -98,6 +95,9 @@ int smp_call_function(smp_call_func_t func, void *info, int wait); void smp_call_function_many(const struct cpumask *mask, smp_call_func_t func, void *info, bool wait); +void __smp_call_function_single(int cpuid, struct call_single_data *data, + int wait); + int smp_call_function_any(const struct cpumask *mask, smp_call_func_t func, void *info, int wait); @@ -106,10 +106,14 @@ void kick_all_cpus_sync(void); /* * Generic and arch helpers */ +#ifdef CONFIG_USE_GENERIC_SMP_HELPERS void __init call_function_init(void); void generic_smp_call_function_single_interrupt(void); #define generic_smp_call_function_interrupt \ generic_smp_call_function_single_interrupt +#else +static inline void call_function_init(void) { } +#endif /* * Mark the boot cpu "online" so that it can call console drivers in @@ -151,6 +155,12 @@ smp_call_function_any(const struct cpumask *mask, smp_call_func_t func, static inline void kick_all_cpus_sync(void) { } +static inline void __smp_call_function_single(int cpuid, + struct call_single_data *data, int wait) +{ + on_each_cpu(data->func, data->info, wait); +} + #endif /* !SMP */ /* diff --git a/include/linux/spi/rspi.h b/include/linux/spi/rspi.h index a25bd6f..900f0e3 100644 --- a/include/linux/spi/rspi.h +++ b/include/linux/spi/rspi.h @@ -26,8 +26,6 @@ struct rspi_plat_data { unsigned int dma_rx_id; unsigned dma_width_16bit:1; /* DMAC read/write width = 16-bit */ - - u16 num_chipselect; }; #endif diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 8c62ba7..887116d 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -23,7 +23,6 @@ #include <linux/mod_devicetable.h> #include <linux/slab.h> #include <linux/kthread.h> -#include <linux/completion.h> /* * INTERFACES between SPI master-side drivers and SPI infrastructure. @@ -151,7 +150,8 @@ static inline void *spi_get_drvdata(struct spi_device *spi) } struct spi_message; -struct spi_transfer; + + /** * struct spi_driver - Host side "protocol" driver @@ -257,9 +257,6 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) * @queue_lock: spinlock to syncronise access to message queue * @queue: message queue * @cur_msg: the currently in-flight message - * @cur_msg_prepared: spi_prepare_message was called for the currently - * in-flight message - * @xfer_completion: used by core tranfer_one_message() * @busy: message pump is busy * @running: message pump is running * @rt: whether this queue is set to run as a realtime task @@ -277,16 +274,6 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) * @unprepare_transfer_hardware: there are currently no more messages on the * queue so the subsystem notifies the driver that it may relax the * hardware by issuing this call - * @set_cs: assert or deassert chip select, true to assert. May be called - * from interrupt context. - * @prepare_message: set up the controller to transfer a single message, - * for example doing DMA mapping. Called from threaded - * context. - * @transfer_one: transfer a single spi_transfer. When the - * driver is finished with this transfer it must call - * spi_finalize_current_transfer() so the subsystem can issue - * the next transfer - * @unprepare_message: undo any work done by prepare_message(). * @cs_gpios: Array of GPIOs to use as chip select lines; one per CS * number. Any individual value may be -ENOENT for CS lines that * are not GPIOs (driven by the SPI controller itself). @@ -401,25 +388,11 @@ struct spi_master { bool running; bool rt; bool auto_runtime_pm; - bool cur_msg_prepared; - struct completion xfer_completion; int (*prepare_transfer_hardware)(struct spi_master *master); int (*transfer_one_message)(struct spi_master *master, struct spi_message *mesg); int (*unprepare_transfer_hardware)(struct spi_master *master); - int (*prepare_message)(struct spi_master *master, - struct spi_message *message); - int (*unprepare_message)(struct spi_master *master, - struct spi_message *message); - - /* - * These hooks are for drivers that use a generic implementation - * of transfer_one_message() provied by the core. - */ - void (*set_cs)(struct spi_device *spi, bool enable); - int (*transfer_one)(struct spi_master *master, struct spi_device *spi, - struct spi_transfer *transfer); /* gpio chip select */ int *cs_gpios; @@ -455,15 +428,12 @@ extern int spi_master_resume(struct spi_master *master); /* Calls the driver make to interact with the message queue */ extern struct spi_message *spi_get_next_queued_message(struct spi_master *master); extern void spi_finalize_current_message(struct spi_master *master); -extern void spi_finalize_current_transfer(struct spi_master *master); /* the spi driver core manages memory for the spi_master classdev */ extern struct spi_master * spi_alloc_master(struct device *host, unsigned size); extern int spi_register_master(struct spi_master *master); -extern int devm_spi_register_master(struct device *dev, - struct spi_master *master); extern void spi_unregister_master(struct spi_master *master); extern struct spi_master *spi_busnum_to_master(u16 busnum); @@ -853,33 +823,6 @@ static inline ssize_t spi_w8r16(struct spi_device *spi, u8 cmd) return (status < 0) ? status : result; } -/** - * spi_w8r16be - SPI synchronous 8 bit write followed by 16 bit big-endian read - * @spi: device with which data will be exchanged - * @cmd: command to be written before data is read back - * Context: can sleep - * - * This returns the (unsigned) sixteen bit number returned by the device in cpu - * endianness, or else a negative error code. Callable only from contexts that - * can sleep. - * - * This function is similar to spi_w8r16, with the exception that it will - * convert the read 16 bit data word from big-endian to native endianness. - * - */ -static inline ssize_t spi_w8r16be(struct spi_device *spi, u8 cmd) - -{ - ssize_t status; - __be16 result; - - status = spi_write_then_read(spi, &cmd, 1, &result, 2); - if (status < 0) - return status; - - return be16_to_cpu(result); -} - /*---------------------------------------------------------------------------*/ /* diff --git a/include/linux/srcu.h b/include/linux/srcu.h index 9b058ee..c114614 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h @@ -237,18 +237,4 @@ static inline void srcu_read_unlock(struct srcu_struct *sp, int idx) __srcu_read_unlock(sp, idx); } -/** - * smp_mb__after_srcu_read_unlock - ensure full ordering after srcu_read_unlock - * - * Converts the preceding srcu_read_unlock into a two-way memory barrier. - * - * Call this after srcu_read_unlock, to guarantee that all memory operations - * that occur after smp_mb__after_srcu_read_unlock will appear to happen after - * the preceding srcu_read_unlock. - */ -static inline void smp_mb__after_srcu_read_unlock(void) -{ - /* __srcu_read_unlock has smp_mb() internally so nothing to do here. */ -} - #endif diff --git a/include/linux/ssb/ssb_driver_gige.h b/include/linux/ssb/ssb_driver_gige.h index 0688472..86a12b0 100644 --- a/include/linux/ssb/ssb_driver_gige.h +++ b/include/linux/ssb/ssb_driver_gige.h @@ -108,16 +108,6 @@ static inline int ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr) return 0; } -/* Get the device phy address */ -static inline int ssb_gige_get_phyaddr(struct pci_dev *pdev) -{ - struct ssb_gige *dev = pdev_to_ssb_gige(pdev); - if (!dev) - return -ENODEV; - - return dev->dev->bus->sprom.et0phyaddr; -} - extern int ssb_gige_pcibios_plat_dev_init(struct ssb_device *sdev, struct pci_dev *pdev); extern int ssb_gige_map_irq(struct ssb_device *sdev, @@ -184,10 +174,6 @@ static inline int ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr) { return -ENODEV; } -static inline int ssb_gige_get_phyaddr(struct pci_dev *pdev) -{ - return -ENODEV; -} #endif /* CONFIG_SSB_DRIVER_GIGE */ #endif /* LINUX_SSB_DRIVER_GIGE_H_ */ diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h index d2abbdb..3b5e910 100644 --- a/include/linux/stop_machine.h +++ b/include/linux/stop_machine.h @@ -28,7 +28,6 @@ struct cpu_stop_work { }; int stop_one_cpu(unsigned int cpu, cpu_stop_fn_t fn, void *arg); -int stop_two_cpus(unsigned int cpu1, unsigned int cpu2, cpu_stop_fn_t fn, void *arg); void stop_one_cpu_nowait(unsigned int cpu, cpu_stop_fn_t fn, void *arg, struct cpu_stop_work *work_buf); int stop_cpus(const struct cpumask *cpumask, cpu_stop_fn_t fn, void *arg); diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 8af2804..6740801 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h @@ -49,7 +49,6 @@ struct rpc_clnt { unsigned int cl_softrtry : 1,/* soft timeouts */ cl_discrtry : 1,/* disconnect before retry */ - cl_noretranstimeo: 1,/* No retransmit timeouts */ cl_autobind : 1,/* use getport() */ cl_chatty : 1;/* be verbose */ @@ -127,7 +126,6 @@ struct rpc_create_args { #define RPC_CLNT_CREATE_QUIET (1UL << 6) #define RPC_CLNT_CREATE_INFINITE_SLOTS (1UL << 7) #define RPC_CLNT_CREATE_NO_IDLE_TIMEOUT (1UL << 8) -#define RPC_CLNT_CREATE_NO_RETRANS_TIMEOUT (1UL << 9) struct rpc_clnt *rpc_create(struct rpc_create_args *args); struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, @@ -136,10 +134,6 @@ void rpc_task_reset_client(struct rpc_task *task, struct rpc_clnt *clnt); struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); struct rpc_clnt *rpc_clone_client_set_auth(struct rpc_clnt *, rpc_authflavor_t); -int rpc_switch_client_transport(struct rpc_clnt *, - struct xprt_create *, - const struct rpc_timeout *); - void rpc_shutdown_client(struct rpc_clnt *); void rpc_release_client(struct rpc_clnt *); void rpc_task_release_client(struct rpc_task *); diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 3a847de..096ee58 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h @@ -122,7 +122,6 @@ struct rpc_task_setup { #define RPC_TASK_SENT 0x0800 /* message was sent */ #define RPC_TASK_TIMEOUT 0x1000 /* fail with ETIMEDOUT on timeout */ #define RPC_TASK_NOCONNECT 0x2000 /* return ENOTCONN if not connected */ -#define RPC_TASK_NO_RETRANS_TIMEOUT 0x4000 /* wait forever for a reply */ #define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC) #define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER) diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 8097b9d..cec7b9b 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h @@ -288,7 +288,7 @@ int xprt_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task); int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); void xprt_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task); void xprt_lock_and_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task); -bool xprt_prepare_transmit(struct rpc_task *task); +int xprt_prepare_transmit(struct rpc_task *task); void xprt_transmit(struct rpc_task *task); void xprt_end_transmit(struct rpc_task *task); int xprt_adjust_timeout(struct rpc_rqst *req); diff --git a/include/linux/swapops.h b/include/linux/swapops.h index c0f7526..8d4fa82 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h @@ -139,8 +139,7 @@ static inline void make_migration_entry_read(swp_entry_t *entry) extern void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, unsigned long address); -extern void migration_entry_wait_huge(struct vm_area_struct *vma, - struct mm_struct *mm, pte_t *pte); +extern void migration_entry_wait_huge(struct mm_struct *mm, pte_t *pte); #else #define make_migration_entry(page, write) swp_entry(0, 0) @@ -152,8 +151,8 @@ static inline int is_migration_entry(swp_entry_t swp) static inline void make_migration_entry_read(swp_entry_t *entryp) { } static inline void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, unsigned long address) { } -static inline void migration_entry_wait_huge(struct vm_area_struct *vma, - struct mm_struct *mm, pte_t *pte) { } +static inline void migration_entry_wait_huge(struct mm_struct *mm, + pte_t *pte) { } static inline int is_write_migration_entry(swp_entry_t entry) { return 0; diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 94273bb..7fac04e 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -120,7 +120,7 @@ extern struct trace_event_functions exit_syscall_print_funcs; .class = &event_class_syscall_enter, \ .event.funcs = &enter_syscall_print_funcs, \ .data = (void *)&__syscall_meta_##sname,\ - .flags = TRACE_EVENT_FL_CAP_ANY, \ + .flags = TRACE_EVENT_FL_CAP_ANY, \ }; \ static struct ftrace_event_call __used \ __attribute__((section("_ftrace_events"))) \ @@ -134,7 +134,7 @@ extern struct trace_event_functions exit_syscall_print_funcs; .class = &event_class_syscall_exit, \ .event.funcs = &exit_syscall_print_funcs, \ .data = (void *)&__syscall_meta_##sname,\ - .flags = TRACE_EVENT_FL_CAP_ANY, \ + .flags = TRACE_EVENT_FL_CAP_ANY, \ }; \ static struct ftrace_event_call __used \ __attribute__((section("_ftrace_events"))) \ @@ -184,8 +184,7 @@ extern struct trace_event_functions exit_syscall_print_funcs; #define __PROTECT(...) asmlinkage_protect(__VA_ARGS__) #define __SYSCALL_DEFINEx(x, name, ...) \ - asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \ - __attribute__((alias(__stringify(SyS##name)))); \ + asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \ static inline long SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \ asmlinkage long SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \ asmlinkage long SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \ @@ -195,6 +194,7 @@ extern struct trace_event_functions exit_syscall_print_funcs; __PROTECT(x, ret,__MAP(x,__SC_ARGS,__VA_ARGS__)); \ return ret; \ } \ + SYSCALL_ALIAS(sys##name, SyS##name); \ static inline long SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__)) asmlinkage long sys_time(time_t __user *tloc); diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 6695040..11baec7 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h @@ -173,6 +173,7 @@ struct bin_attribute bin_attr_##_name = __BIN_ATTR_RW(_name, _size) struct sysfs_ops { ssize_t (*show)(struct kobject *, struct attribute *, char *); ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t); + const void *(*namespace)(struct kobject *, const struct attribute *); }; struct sysfs_dirent; @@ -182,23 +183,19 @@ struct sysfs_dirent; int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *), void *data, struct module *owner); -int __must_check sysfs_create_dir_ns(struct kobject *kobj, const void *ns); +int __must_check sysfs_create_dir(struct kobject *kobj); void sysfs_remove_dir(struct kobject *kobj); -int __must_check sysfs_rename_dir_ns(struct kobject *kobj, const char *new_name, - const void *new_ns); -int __must_check sysfs_move_dir_ns(struct kobject *kobj, - struct kobject *new_parent_kobj, - const void *new_ns); - -int __must_check sysfs_create_file_ns(struct kobject *kobj, - const struct attribute *attr, - const void *ns); +int __must_check sysfs_rename_dir(struct kobject *kobj, const char *new_name); +int __must_check sysfs_move_dir(struct kobject *kobj, + struct kobject *new_parent_kobj); + +int __must_check sysfs_create_file(struct kobject *kobj, + const struct attribute *attr); int __must_check sysfs_create_files(struct kobject *kobj, const struct attribute **attr); int __must_check sysfs_chmod_file(struct kobject *kobj, const struct attribute *attr, umode_t mode); -void sysfs_remove_file_ns(struct kobject *kobj, const struct attribute *attr, - const void *ns); +void sysfs_remove_file(struct kobject *kobj, const struct attribute *attr); void sysfs_remove_files(struct kobject *kobj, const struct attribute **attr); int __must_check sysfs_create_bin_file(struct kobject *kobj, @@ -213,9 +210,8 @@ int __must_check sysfs_create_link_nowarn(struct kobject *kobj, const char *name); void sysfs_remove_link(struct kobject *kobj, const char *name); -int sysfs_rename_link_ns(struct kobject *kobj, struct kobject *target, - const char *old_name, const char *new_name, - const void *new_ns); +int sysfs_rename_link(struct kobject *kobj, struct kobject *target, + const char *old_name, const char *new_name); void sysfs_delete_link(struct kobject *dir, struct kobject *targ, const char *name); @@ -245,9 +241,9 @@ void sysfs_remove_link_from_group(struct kobject *kobj, const char *group_name, void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); void sysfs_notify_dirent(struct sysfs_dirent *sd); -struct sysfs_dirent *sysfs_get_dirent_ns(struct sysfs_dirent *parent_sd, - const unsigned char *name, - const void *ns); +struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd, + const void *ns, + const unsigned char *name); struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd); void sysfs_put(struct sysfs_dirent *sd); @@ -261,7 +257,7 @@ static inline int sysfs_schedule_callback(struct kobject *kobj, return -ENOSYS; } -static inline int sysfs_create_dir_ns(struct kobject *kobj, const void *ns) +static inline int sysfs_create_dir(struct kobject *kobj) { return 0; } @@ -270,22 +266,19 @@ static inline void sysfs_remove_dir(struct kobject *kobj) { } -static inline int sysfs_rename_dir_ns(struct kobject *kobj, - const char *new_name, const void *new_ns) +static inline int sysfs_rename_dir(struct kobject *kobj, const char *new_name) { return 0; } -static inline int sysfs_move_dir_ns(struct kobject *kobj, - struct kobject *new_parent_kobj, - const void *new_ns) +static inline int sysfs_move_dir(struct kobject *kobj, + struct kobject *new_parent_kobj) { return 0; } -static inline int sysfs_create_file_ns(struct kobject *kobj, - const struct attribute *attr, - const void *ns) +static inline int sysfs_create_file(struct kobject *kobj, + const struct attribute *attr) { return 0; } @@ -302,9 +295,8 @@ static inline int sysfs_chmod_file(struct kobject *kobj, return 0; } -static inline void sysfs_remove_file_ns(struct kobject *kobj, - const struct attribute *attr, - const void *ns) +static inline void sysfs_remove_file(struct kobject *kobj, + const struct attribute *attr) { } @@ -341,9 +333,8 @@ static inline void sysfs_remove_link(struct kobject *kobj, const char *name) { } -static inline int sysfs_rename_link_ns(struct kobject *k, struct kobject *t, - const char *old_name, - const char *new_name, const void *ns) +static inline int sysfs_rename_link(struct kobject *k, struct kobject *t, + const char *old_name, const char *new_name) { return 0; } @@ -422,9 +413,10 @@ static inline void sysfs_notify(struct kobject *kobj, const char *dir, static inline void sysfs_notify_dirent(struct sysfs_dirent *sd) { } -static inline struct sysfs_dirent * -sysfs_get_dirent_ns(struct sysfs_dirent *parent_sd, const unsigned char *name, - const void *ns) +static inline +struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd, + const void *ns, + const unsigned char *name) { return NULL; } @@ -443,28 +435,4 @@ static inline int __must_check sysfs_init(void) #endif /* CONFIG_SYSFS */ -static inline int __must_check sysfs_create_file(struct kobject *kobj, - const struct attribute *attr) -{ - return sysfs_create_file_ns(kobj, attr, NULL); -} - -static inline void sysfs_remove_file(struct kobject *kobj, - const struct attribute *attr) -{ - return sysfs_remove_file_ns(kobj, attr, NULL); -} - -static inline int sysfs_rename_link(struct kobject *kobj, struct kobject *target, - const char *old_name, const char *new_name) -{ - return sysfs_rename_link_ns(kobj, target, old_name, new_name, NULL); -} - -static inline struct sysfs_dirent * -sysfs_get_dirent(struct sysfs_dirent *parent_sd, const unsigned char *name) -{ - return sysfs_get_dirent_ns(parent_sd, name, NULL); -} - #endif /* _SYSFS_H_ */ diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h index 387fa7d..7faf933 100644 --- a/include/linux/sysrq.h +++ b/include/linux/sysrq.h @@ -17,6 +17,9 @@ #include <linux/errno.h> #include <linux/types.h> +/* Enable/disable SYSRQ support by default (0==no, 1==yes). */ +#define SYSRQ_DEFAULT_ENABLE 1 + /* Possible values of bitmask for enabling sysrq functions */ /* 0x0001 is reserved for enable everything */ #define SYSRQ_ENABLE_LOG 0x0002 diff --git a/include/linux/tegra-powergate.h b/include/linux/tegra-powergate.h index fd44983..55c29a8 100644 --- a/include/linux/tegra-powergate.h +++ b/include/linux/tegra-powergate.h @@ -34,18 +34,10 @@ struct clk; #define TEGRA_POWERGATE_CPU3 11 #define TEGRA_POWERGATE_CELP 12 #define TEGRA_POWERGATE_3D1 13 -#define TEGRA_POWERGATE_CPU0 14 -#define TEGRA_POWERGATE_C0NC 15 -#define TEGRA_POWERGATE_C1NC 16 -#define TEGRA_POWERGATE_DIS 18 -#define TEGRA_POWERGATE_DISB 19 -#define TEGRA_POWERGATE_XUSBA 20 -#define TEGRA_POWERGATE_XUSBB 21 -#define TEGRA_POWERGATE_XUSBC 22 +#define TEGRA_POWERGATE_CPU0 TEGRA_POWERGATE_CPU #define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D -#ifdef CONFIG_ARCH_TEGRA int tegra_powergate_is_powered(int id); int tegra_powergate_power_on(int id); int tegra_powergate_power_off(int id); @@ -53,31 +45,5 @@ int tegra_powergate_remove_clamping(int id); /* Must be called with clk disabled, and returns with clk enabled */ int tegra_powergate_sequence_power_up(int id, struct clk *clk); -#else -static inline int tegra_powergate_is_powered(int id) -{ - return -ENOSYS; -} - -static inline int tegra_powergate_power_on(int id) -{ - return -ENOSYS; -} - -static inline int tegra_powergate_power_off(int id) -{ - return -ENOSYS; -} - -static inline int tegra_powergate_remove_clamping(int id) -{ - return -ENOSYS; -} - -static inline int tegra_powergate_sequence_power_up(int id, struct clk *clk) -{ - return -ENOSYS; -} -#endif #endif /* _MACH_TEGRA_POWERGATE_H_ */ diff --git a/include/linux/thinkpad_acpi.h b/include/linux/thinkpad_acpi.h deleted file mode 100644 index 361de59..0000000 --- a/include/linux/thinkpad_acpi.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef __THINKPAD_ACPI_H__ -#define __THINKPAD_ACPI_H__ - -/* These two functions return 0 if success, or negative error code - (e g -ENODEV if no led present) */ - -enum { - TPACPI_LED_MUTE, - TPACPI_LED_MICMUTE, - TPACPI_LED_MAX, -}; - -int tpacpi_led_set(int whichled, bool on); - -#endif diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h index fddbe20..e7e0473 100644 --- a/include/linux/thread_info.h +++ b/include/linux/thread_info.h @@ -104,21 +104,8 @@ static inline int test_ti_thread_flag(struct thread_info *ti, int flag) #define test_thread_flag(flag) \ test_ti_thread_flag(current_thread_info(), flag) -static inline __deprecated void set_need_resched(void) -{ - /* - * Use of this function in deprecated. - * - * As of this writing there are only a few users in the DRM tree left - * all of which are wrong and can be removed without causing too much - * grief. - * - * The DRM people are aware and are working on removing the last few - * instances. - */ -} - -#define tif_need_resched() test_thread_flag(TIF_NEED_RESCHED) +#define set_need_resched() set_thread_flag(TIF_NEED_RESCHED) +#define clear_need_resched() clear_thread_flag(TIF_NEED_RESCHED) #if defined TIF_RESTORE_SIGMASK && !defined HAVE_SET_RESTORE_SIGMASK /* diff --git a/include/linux/topology.h b/include/linux/topology.h index 12ae6ce..d3cf0d6 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h @@ -106,8 +106,6 @@ int arch_update_cpu_topology(void); .last_balance = jiffies, \ .balance_interval = 1, \ .smt_gain = 1178, /* 15% */ \ - .max_newidle_lb_cost = 0, \ - .next_decay_max_lb_cost = jiffies, \ } #endif #endif /* CONFIG_SCHED_SMT */ @@ -137,8 +135,6 @@ int arch_update_cpu_topology(void); , \ .last_balance = jiffies, \ .balance_interval = 1, \ - .max_newidle_lb_cost = 0, \ - .next_decay_max_lb_cost = jiffies, \ } #endif #endif /* CONFIG_SCHED_MC */ @@ -170,8 +166,6 @@ int arch_update_cpu_topology(void); , \ .last_balance = jiffies, \ .balance_interval = 1, \ - .max_newidle_lb_cost = 0, \ - .next_decay_max_lb_cost = jiffies, \ } #endif diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index f16dc0a..ebeab36 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h @@ -267,8 +267,6 @@ static inline void tracepoint_synchronize_unregister(void) #define TRACE_EVENT_FLAGS(event, flag) -#define TRACE_EVENT_PERF_PERM(event, expr...) - #endif /* DECLARE_TRACE */ #ifndef TRACE_EVENT @@ -401,6 +399,4 @@ static inline void tracepoint_synchronize_unregister(void) #define TRACE_EVENT_FLAGS(event, flag) -#define TRACE_EVENT_PERF_PERM(event, expr...) - #endif /* ifdef TRACE_EVENT (see note above) */ diff --git a/include/linux/tty.h b/include/linux/tty.h index 97d660e..64f8646 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -180,6 +180,7 @@ struct tty_port_operations { IFF the port was initialized. Do not use to free resources. Called under the port mutex to serialize against activate/shutdowns */ void (*shutdown)(struct tty_port *port); + void (*drop)(struct tty_port *port); /* Called under the port mutex from tty_port_open, serialized using the port mutex */ /* FIXME: long term getting the tty argument *out* of this would be @@ -671,17 +672,31 @@ static inline void tty_wait_until_sent_from_close(struct tty_struct *tty, #define wait_event_interruptible_tty(tty, wq, condition) \ ({ \ int __ret = 0; \ - if (!(condition)) \ - __ret = __wait_event_interruptible_tty(tty, wq, \ - condition); \ + if (!(condition)) { \ + __wait_event_interruptible_tty(tty, wq, condition, __ret); \ + } \ __ret; \ }) -#define __wait_event_interruptible_tty(tty, wq, condition) \ - ___wait_event(wq, condition, TASK_INTERRUPTIBLE, 0, 0, \ - tty_unlock(tty); \ +#define __wait_event_interruptible_tty(tty, wq, condition, ret) \ +do { \ + DEFINE_WAIT(__wait); \ + \ + for (;;) { \ + prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE); \ + if (condition) \ + break; \ + if (!signal_pending(current)) { \ + tty_unlock(tty); \ schedule(); \ - tty_lock(tty)) + tty_lock(tty); \ + continue; \ + } \ + ret = -ERESTARTSYS; \ + break; \ + } \ + finish_wait(&wq, &__wait); \ +} while (0) #ifdef CONFIG_PROC_FS extern void proc_tty_register_driver(struct tty_driver *); diff --git a/include/linux/u64_stats_sync.h b/include/linux/u64_stats_sync.h index 7bfabd2..8da8c4e 100644 --- a/include/linux/u64_stats_sync.h +++ b/include/linux/u64_stats_sync.h @@ -67,13 +67,6 @@ struct u64_stats_sync { #endif }; - -#if BITS_PER_LONG == 32 && defined(CONFIG_SMP) -# define u64_stats_init(syncp) seqcount_init(syncp.seq) -#else -# define u64_stats_init(syncp) do { } while (0) -#endif - static inline void u64_stats_update_begin(struct u64_stats_sync *syncp) { #if BITS_PER_LONG==32 && defined(CONFIG_SMP) diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h index 9d8cf05..5ca0951 100644 --- a/include/linux/uaccess.h +++ b/include/linux/uaccess.h @@ -15,7 +15,7 @@ */ static inline void pagefault_disable(void) { - preempt_count_inc(); + inc_preempt_count(); /* * make sure to have issued the store before a pagefault * can hit. @@ -30,7 +30,11 @@ static inline void pagefault_enable(void) * the pagefault handler again. */ barrier(); - preempt_count_dec(); + dec_preempt_count(); + /* + * make sure we do.. + */ + barrier(); preempt_check_resched(); } diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h index 319eae7..06f28be 100644 --- a/include/linux/uprobes.h +++ b/include/linux/uprobes.h @@ -30,7 +30,6 @@ struct vm_area_struct; struct mm_struct; struct inode; -struct notifier_block; #ifdef CONFIG_ARCH_SUPPORTS_UPROBES # include <asm/uprobes.h> @@ -109,7 +108,6 @@ extern int __weak set_swbp(struct arch_uprobe *aup, struct mm_struct *mm, unsign extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); extern bool __weak is_swbp_insn(uprobe_opcode_t *insn); extern bool __weak is_trap_insn(uprobe_opcode_t *insn); -extern int uprobe_write_opcode(struct mm_struct *mm, unsigned long vaddr, uprobe_opcode_t); extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); extern int uprobe_apply(struct inode *inode, loff_t offset, struct uprobe_consumer *uc, bool); extern void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); @@ -119,21 +117,14 @@ extern void uprobe_start_dup_mmap(void); extern void uprobe_end_dup_mmap(void); extern void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm); extern void uprobe_free_utask(struct task_struct *t); -extern void uprobe_copy_process(struct task_struct *t, unsigned long flags); +extern void uprobe_copy_process(struct task_struct *t); extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs); extern int uprobe_post_sstep_notifier(struct pt_regs *regs); extern int uprobe_pre_sstep_notifier(struct pt_regs *regs); extern void uprobe_notify_resume(struct pt_regs *regs); extern bool uprobe_deny_signal(void); -extern bool arch_uprobe_skip_sstep(struct arch_uprobe *aup, struct pt_regs *regs); +extern bool __weak arch_uprobe_skip_sstep(struct arch_uprobe *aup, struct pt_regs *regs); extern void uprobe_clear_state(struct mm_struct *mm); -extern int arch_uprobe_analyze_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long addr); -extern int arch_uprobe_pre_xol(struct arch_uprobe *aup, struct pt_regs *regs); -extern int arch_uprobe_post_xol(struct arch_uprobe *aup, struct pt_regs *regs); -extern bool arch_uprobe_xol_was_trapped(struct task_struct *tsk); -extern int arch_uprobe_exception_notify(struct notifier_block *self, unsigned long val, void *data); -extern void arch_uprobe_abort_xol(struct arch_uprobe *aup, struct pt_regs *regs); -extern unsigned long arch_uretprobe_hijack_return_addr(unsigned long trampoline_vaddr, struct pt_regs *regs); #else /* !CONFIG_UPROBES */ struct uprobes_state { }; @@ -183,7 +174,7 @@ static inline unsigned long uprobe_get_swbp_addr(struct pt_regs *regs) static inline void uprobe_free_utask(struct task_struct *t) { } -static inline void uprobe_copy_process(struct task_struct *t, unsigned long flags) +static inline void uprobe_copy_process(struct task_struct *t) { } static inline void uprobe_clear_state(struct mm_struct *mm) diff --git a/include/linux/usb.h b/include/linux/usb.h index 512ab16..001629c 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -475,8 +475,7 @@ struct usb3_lpm_parameters { * @lpm_capable: device supports LPM * @usb2_hw_lpm_capable: device can perform USB2 hardware LPM * @usb2_hw_lpm_besl_capable: device can perform USB2 hardware BESL LPM - * @usb2_hw_lpm_enabled: USB2 hardware LPM is enabled - * @usb2_hw_lpm_allowed: Userspace allows USB 2.0 LPM to be enabled + * @usb2_hw_lpm_enabled: USB2 hardware LPM enabled * @usb3_lpm_enabled: USB3 hardware LPM enabled * @string_langid: language ID for strings * @product: iProduct string, if present (static) @@ -549,7 +548,6 @@ struct usb_device { unsigned usb2_hw_lpm_capable:1; unsigned usb2_hw_lpm_besl_capable:1; unsigned usb2_hw_lpm_enabled:1; - unsigned usb2_hw_lpm_allowed:1; unsigned usb3_lpm_enabled:1; int string_langid; @@ -704,7 +702,7 @@ extern int usb_alloc_streams(struct usb_interface *interface, unsigned int num_streams, gfp_t mem_flags); /* Reverts a group of bulk endpoints back to not using stream IDs. */ -extern int usb_free_streams(struct usb_interface *interface, +extern void usb_free_streams(struct usb_interface *interface, struct usb_host_endpoint **eps, unsigned int num_eps, gfp_t mem_flags); @@ -1211,13 +1209,11 @@ struct usb_anchor { struct list_head urb_list; wait_queue_head_t wait; spinlock_t lock; - atomic_t suspend_wakeups; unsigned int poisoned:1; }; static inline void init_usb_anchor(struct usb_anchor *anchor) { - memset(anchor, 0, sizeof(*anchor)); INIT_LIST_HEAD(&anchor->urb_list); init_waitqueue_head(&anchor->wait); spin_lock_init(&anchor->lock); @@ -1264,8 +1260,6 @@ typedef void (*usb_complete_t)(struct urb *); * @sg: scatter gather buffer list, the buffer size of each element in * the list (except the last) must be divisible by the endpoint's * max packet size if no_sg_constraint isn't set in 'struct usb_bus' - * (FIXME: scatter-gather under xHCI is broken for periodic transfers. - * Do not use urb->sg for interrupt endpoints for now, only bulk.) * @num_mapped_sgs: (internal) number of mapped sg entries * @num_sgs: number of entries in the sg list * @transfer_buffer_length: How big is transfer_buffer. The transfer may @@ -1580,8 +1574,6 @@ extern void usb_kill_anchored_urbs(struct usb_anchor *anchor); extern void usb_poison_anchored_urbs(struct usb_anchor *anchor); extern void usb_unpoison_anchored_urbs(struct usb_anchor *anchor); extern void usb_unlink_anchored_urbs(struct usb_anchor *anchor); -extern void usb_anchor_suspend_wakeups(struct usb_anchor *anchor); -extern void usb_anchor_resume_wakeups(struct usb_anchor *anchor); extern void usb_anchor_urb(struct urb *urb, struct usb_anchor *anchor); extern void usb_unanchor_urb(struct urb *urb); extern int usb_wait_anchor_empty_timeout(struct usb_anchor *anchor, diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h index c3fa807..cc25b70 100644 --- a/include/linux/usb/cdc_ncm.h +++ b/include/linux/usb/cdc_ncm.h @@ -36,9 +36,6 @@ * SUCH DAMAGE. */ -#ifndef __LINUX_USB_CDC_NCM_H -#define __LINUX_USB_CDC_NCM_H - #define CDC_NCM_COMM_ALTSETTING_NCM 0 #define CDC_NCM_COMM_ALTSETTING_MBIM 1 @@ -88,13 +85,22 @@ #define cdc_ncm_data_intf_is_mbim(x) ((x)->desc.bInterfaceProtocol == USB_CDC_MBIM_PROTO_NTB) struct cdc_ncm_ctx { + struct usb_cdc_ncm_ntb_parameters ncm_parm; struct hrtimer tx_timer; struct tasklet_struct bh; const struct usb_cdc_ncm_desc *func_desc; - const struct usb_cdc_mbim_desc *mbim_desc; + const struct usb_cdc_mbim_desc *mbim_desc; + const struct usb_cdc_header_desc *header_desc; + const struct usb_cdc_union_desc *union_desc; const struct usb_cdc_ether_desc *ether_desc; + struct net_device *netdev; + struct usb_device *udev; + struct usb_host_endpoint *in_ep; + struct usb_host_endpoint *out_ep; + struct usb_host_endpoint *status_ep; + struct usb_interface *intf; struct usb_interface *control; struct usb_interface *data; @@ -107,6 +113,8 @@ struct cdc_ncm_ctx { u32 tx_timer_pending; u32 tx_curr_frame_num; + u32 rx_speed; + u32 tx_speed; u32 rx_max; u32 tx_max; u32 max_datagram_size; @@ -119,14 +127,9 @@ struct cdc_ncm_ctx { u16 connected; }; -u8 cdc_ncm_select_altsetting(struct usbnet *dev, struct usb_interface *intf); -int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting); -void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf); -struct sk_buff *cdc_ncm_fill_tx_frame(struct usbnet *dev, struct sk_buff *skb, __le32 sign); -int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in); -int cdc_ncm_rx_verify_ndp16(struct sk_buff *skb_in, int ndpoffset); -struct sk_buff * -cdc_ncm_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags); -int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in); - -#endif /* __LINUX_USB_CDC_NCM_H */ +extern u8 cdc_ncm_select_altsetting(struct usbnet *dev, struct usb_interface *intf); +extern int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting); +extern void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf); +extern struct sk_buff *cdc_ncm_fill_tx_frame(struct cdc_ncm_ctx *ctx, struct sk_buff *skb, __le32 sign); +extern int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in); +extern int cdc_ncm_rx_verify_ndp16(struct sk_buff *skb_in, int ndpoffset); diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index b8aba19..75efc45 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h @@ -73,7 +73,6 @@ struct giveback_urb_bh { spinlock_t lock; struct list_head head; struct tasklet_struct bh; - struct usb_host_endpoint *completing_ep; }; struct usb_hcd { @@ -141,7 +140,6 @@ struct usb_hcd { unsigned wireless:1; /* Wireless USB HCD */ unsigned authorized_default:1; unsigned has_tt:1; /* Integrated TT in root hub */ - unsigned amd_resume_bug:1; /* AMD remote wakeup quirk */ unsigned int irq; /* irq allocated */ void __iomem *regs; /* device memory/io */ @@ -380,12 +378,6 @@ static inline int hcd_giveback_urb_in_bh(struct usb_hcd *hcd) return hcd->driver->flags & HCD_BH; } -static inline bool hcd_periodic_completion_in_progress(struct usb_hcd *hcd, - struct usb_host_endpoint *ep) -{ - return hcd->high_prio_bh.completing_ep == ep; -} - extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); extern int usb_hcd_check_unlink_urb(struct usb_hcd *hcd, struct urb *urb, int status); @@ -436,8 +428,6 @@ extern int usb_hcd_pci_probe(struct pci_dev *dev, extern void usb_hcd_pci_remove(struct pci_dev *dev); extern void usb_hcd_pci_shutdown(struct pci_dev *dev); -extern int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *dev); - #ifdef CONFIG_PM extern const struct dev_pm_ops usb_hcd_pci_pm_ops; #endif @@ -506,7 +496,6 @@ struct usb_tt { struct usb_device *hub; /* upstream highspeed hub */ int multi; /* true means one TT per port */ unsigned think_time; /* think time in ns */ - void *hcpriv; /* HCD private data */ /* for control/bulk error recovery (CLEAR_TT_BUFFER) */ spinlock_t lock; @@ -565,8 +554,9 @@ extern void usb_ep0_reinit(struct usb_device *); * of (7/6 * 8 * bytecount) = 9.33 * bytecount */ /* bytecount = data payload byte count */ -#define NS_TO_US(ns) DIV_ROUND_UP(ns, 1000L) - /* convert nanoseconds to microseconds, rounding up */ +#define NS_TO_US(ns) ((ns + 500L) / 1000L) + /* convert & round nanoseconds to microseconds */ + /* * Full/low speed bandwidth allocation constants/support. diff --git a/include/linux/usb/intel_mid_otg.h b/include/linux/usb/intel_mid_otg.h new file mode 100644 index 0000000..756cf55 --- /dev/null +++ b/include/linux/usb/intel_mid_otg.h @@ -0,0 +1,180 @@ +/* + * Intel MID (Langwell/Penwell) USB OTG Transceiver driver + * Copyright (C) 2008 - 2010, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#ifndef __INTEL_MID_OTG_H +#define __INTEL_MID_OTG_H + +#include <linux/pm.h> +#include <linux/usb/otg.h> +#include <linux/notifier.h> + +struct intel_mid_otg_xceiv; + +/* This is a common data structure for Intel MID platform to + * save values of the OTG state machine */ +struct otg_hsm { + /* Input */ + int a_bus_resume; + int a_bus_suspend; + int a_conn; + int a_sess_vld; + int a_srp_det; + int a_vbus_vld; + int b_bus_resume; + int b_bus_suspend; + int b_conn; + int b_se0_srp; + int b_ssend_srp; + int b_sess_end; + int b_sess_vld; + int id; +/* id values */ +#define ID_B 0x05 +#define ID_A 0x04 +#define ID_ACA_C 0x03 +#define ID_ACA_B 0x02 +#define ID_ACA_A 0x01 + int power_up; + int adp_change; + int test_device; + + /* Internal variables */ + int a_set_b_hnp_en; + int b_srp_done; + int b_hnp_enable; + int hnp_poll_enable; + + /* Timeout indicator for timers */ + int a_wait_vrise_tmout; + int a_wait_bcon_tmout; + int a_aidl_bdis_tmout; + int a_bidl_adis_tmout; + int a_bidl_adis_tmr; + int a_wait_vfall_tmout; + int b_ase0_brst_tmout; + int b_bus_suspend_tmout; + int b_srp_init_tmout; + int b_srp_fail_tmout; + int b_srp_fail_tmr; + int b_adp_sense_tmout; + + /* Informative variables */ + int a_bus_drop; + int a_bus_req; + int a_clr_err; + int b_bus_req; + int a_suspend_req; + int b_bus_suspend_vld; + + /* Output */ + int drv_vbus; + int loc_conn; + int loc_sof; + + /* Others */ + int vbus_srp_up; +}; + +/* must provide ULPI access function to read/write registers implemented in + * ULPI address space */ +struct iotg_ulpi_access_ops { + int (*read)(struct intel_mid_otg_xceiv *iotg, u8 reg, u8 *val); + int (*write)(struct intel_mid_otg_xceiv *iotg, u8 reg, u8 val); +}; + +#define OTG_A_DEVICE 0x0 +#define OTG_B_DEVICE 0x1 + +/* + * the Intel MID (Langwell/Penwell) otg transceiver driver needs to interact + * with device and host drivers to implement the USB OTG related feature. More + * function members are added based on usb_phy data structure for this + * purpose. + */ +struct intel_mid_otg_xceiv { + struct usb_phy otg; + struct otg_hsm hsm; + + /* base address */ + void __iomem *base; + + /* ops to access ulpi */ + struct iotg_ulpi_access_ops ulpi_ops; + + /* atomic notifier for interrupt context */ + struct atomic_notifier_head iotg_notifier; + + /* start/stop USB Host function */ + int (*start_host)(struct intel_mid_otg_xceiv *iotg); + int (*stop_host)(struct intel_mid_otg_xceiv *iotg); + + /* start/stop USB Peripheral function */ + int (*start_peripheral)(struct intel_mid_otg_xceiv *iotg); + int (*stop_peripheral)(struct intel_mid_otg_xceiv *iotg); + + /* start/stop ADP sense/probe function */ + int (*set_adp_probe)(struct intel_mid_otg_xceiv *iotg, + bool enabled, int dev); + int (*set_adp_sense)(struct intel_mid_otg_xceiv *iotg, + bool enabled); + +#ifdef CONFIG_PM + /* suspend/resume USB host function */ + int (*suspend_host)(struct intel_mid_otg_xceiv *iotg, + pm_message_t message); + int (*resume_host)(struct intel_mid_otg_xceiv *iotg); + + int (*suspend_peripheral)(struct intel_mid_otg_xceiv *iotg, + pm_message_t message); + int (*resume_peripheral)(struct intel_mid_otg_xceiv *iotg); +#endif + +}; +static inline +struct intel_mid_otg_xceiv *otg_to_mid_xceiv(struct usb_phy *otg) +{ + return container_of(otg, struct intel_mid_otg_xceiv, otg); +} + +#define MID_OTG_NOTIFY_CONNECT 0x0001 +#define MID_OTG_NOTIFY_DISCONN 0x0002 +#define MID_OTG_NOTIFY_HSUSPEND 0x0003 +#define MID_OTG_NOTIFY_HRESUME 0x0004 +#define MID_OTG_NOTIFY_CSUSPEND 0x0005 +#define MID_OTG_NOTIFY_CRESUME 0x0006 +#define MID_OTG_NOTIFY_HOSTADD 0x0007 +#define MID_OTG_NOTIFY_HOSTREMOVE 0x0008 +#define MID_OTG_NOTIFY_CLIENTADD 0x0009 +#define MID_OTG_NOTIFY_CLIENTREMOVE 0x000a + +static inline int +intel_mid_otg_register_notifier(struct intel_mid_otg_xceiv *iotg, + struct notifier_block *nb) +{ + return atomic_notifier_chain_register(&iotg->iotg_notifier, nb); +} + +static inline void +intel_mid_otg_unregister_notifier(struct intel_mid_otg_xceiv *iotg, + struct notifier_block *nb) +{ + atomic_notifier_chain_unregister(&iotg->iotg_notifier, nb); +} + +#endif /* __INTEL_MID_OTG_H */ diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h index eb50525..053c268 100644 --- a/include/linux/usb/musb.h +++ b/include/linux/usb/musb.h @@ -99,6 +99,8 @@ struct musb_hdrc_platform_data { /* MUSB_HOST, MUSB_PERIPHERAL, or MUSB_OTG */ u8 mode; + u8 has_mailbox:1; + /* for clk_get() */ const char *clock; diff --git a/include/linux/usb/omap_control_usb.h b/include/linux/usb/omap_control_usb.h index 596b019..27b5b8c 100644 --- a/include/linux/usb/omap_control_usb.h +++ b/include/linux/usb/omap_control_usb.h @@ -19,23 +19,20 @@ #ifndef __OMAP_CONTROL_USB_H__ #define __OMAP_CONTROL_USB_H__ -enum omap_control_usb_type { - OMAP_CTRL_TYPE_OTGHS = 1, /* Mailbox OTGHS_CONTROL */ - OMAP_CTRL_TYPE_USB2, /* USB2_PHY, power down in CONTROL_DEV_CONF */ - OMAP_CTRL_TYPE_PIPE3, /* PIPE3 PHY, DPLL & seperate Rx/Tx power */ - OMAP_CTRL_TYPE_DRA7USB2, /* USB2 PHY, power and power_aux e.g. DRA7 */ -}; - struct omap_control_usb { struct device *dev; + u32 __iomem *dev_conf; u32 __iomem *otghs_control; - u32 __iomem *power; - u32 __iomem *power_aux; + u32 __iomem *phy_power; struct clk *sys_clk; - enum omap_control_usb_type type; + u32 type; +}; + +struct omap_control_usb_platform_data { + u8 type; }; enum omap_control_usb_mode { @@ -45,6 +42,10 @@ enum omap_control_usb_mode { USB_MODE_DISCONNECT, }; +/* To differentiate ctrl module IP having either mailbox or USB3 PHY power */ +#define OMAP_CTRL_DEV_TYPE1 0x1 +#define OMAP_CTRL_DEV_TYPE2 0x2 + #define OMAP_CTRL_DEV_PHY_PD BIT(0) #define OMAP_CTRL_DEV_AVALID BIT(0) @@ -62,18 +63,26 @@ enum omap_control_usb_mode { #define OMAP_CTRL_USB3_PHY_TX_RX_POWERON 0x3 #define OMAP_CTRL_USB3_PHY_TX_RX_POWEROFF 0x0 -#define OMAP_CTRL_USB2_PHY_PD BIT(28) - #if IS_ENABLED(CONFIG_OMAP_CONTROL_USB) +extern struct device *omap_get_control_dev(void); extern void omap_control_usb_phy_power(struct device *dev, int on); +extern void omap_control_usb3_phy_power(struct device *dev, bool on); extern void omap_control_usb_set_mode(struct device *dev, enum omap_control_usb_mode mode); #else +static inline struct device *omap_get_control_dev(void) +{ + return ERR_PTR(-ENODEV); +} static inline void omap_control_usb_phy_power(struct device *dev, int on) { } +static inline void omap_control_usb3_phy_power(struct device *dev, int on) +{ +} + static inline void omap_control_usb_set_mode(struct device *dev, enum omap_control_usb_mode mode) { diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 704a1ab..d528b80 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h @@ -320,8 +320,6 @@ extern struct usb_serial_port *usb_serial_port_get_by_minor(unsigned int minor); extern void usb_serial_put(struct usb_serial *serial); extern int usb_serial_generic_open(struct tty_struct *tty, struct usb_serial_port *port); -extern int usb_serial_generic_write_start(struct usb_serial_port *port, - gfp_t mem_flags); extern int usb_serial_generic_write(struct tty_struct *tty, struct usb_serial_port *port, const unsigned char *buf, int count); extern void usb_serial_generic_close(struct usb_serial_port *port); diff --git a/include/linux/usb/usb_phy_gen_xceiv.h b/include/linux/usb/usb_phy_gen_xceiv.h index cc8d818..11d85b9 100644 --- a/include/linux/usb/usb_phy_gen_xceiv.h +++ b/include/linux/usb/usb_phy_gen_xceiv.h @@ -9,8 +9,7 @@ struct usb_phy_gen_xceiv_platform_data { /* if set fails with -EPROBE_DEFER if can't get regulator */ unsigned int needs_vcc:1; - unsigned int needs_reset:1; /* deprecated */ - int gpio_reset; + unsigned int needs_reset:1; }; #if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE)) diff --git a/include/linux/usb/wusb-wa.h b/include/linux/usb/wusb-wa.h index c125713..4ff744e 100644 --- a/include/linux/usb/wusb-wa.h +++ b/include/linux/usb/wusb-wa.h @@ -142,7 +142,7 @@ enum wa_notif_type { struct wa_notif_hdr { u8 bLength; u8 bNotifyType; /* enum wa_notif_type */ -} __packed; +} __attribute__((packed)); /** * HWA DN Received notification [(WUSB] section 8.5.4.2) @@ -158,7 +158,7 @@ struct hwa_notif_dn { u8 bSourceDeviceAddr; /* from errata 2005/07 */ u8 bmAttributes; struct wusb_dn_hdr dndata[]; -} __packed; +} __attribute__((packed)); /* [WUSB] section 8.3.3 */ enum wa_xfer_type { @@ -167,8 +167,6 @@ enum wa_xfer_type { WA_XFER_TYPE_ISO = 0x82, WA_XFER_RESULT = 0x83, WA_XFER_ABORT = 0x84, - WA_XFER_ISO_PACKET_INFO = 0xA0, - WA_XFER_ISO_PACKET_STATUS = 0xA1, }; /* [WUSB] section 8.3.3 */ @@ -179,47 +177,28 @@ struct wa_xfer_hdr { __le32 dwTransferID; /* Host-assigned ID */ __le32 dwTransferLength; /* Length of data to xfer */ u8 bTransferSegment; -} __packed; +} __attribute__((packed)); struct wa_xfer_ctl { struct wa_xfer_hdr hdr; u8 bmAttribute; __le16 wReserved; struct usb_ctrlrequest baSetupData; -} __packed; +} __attribute__((packed)); struct wa_xfer_bi { struct wa_xfer_hdr hdr; u8 bReserved; __le16 wReserved; -} __packed; +} __attribute__((packed)); -/* [WUSB] section 8.5.5 */ struct wa_xfer_hwaiso { struct wa_xfer_hdr hdr; u8 bReserved; __le16 wPresentationTime; __le32 dwNumOfPackets; -} __packed; - -struct wa_xfer_packet_info_hwaiso { - __le16 wLength; - u8 bPacketType; - u8 bReserved; - __le16 PacketLength[0]; -} __packed; - -struct wa_xfer_packet_status_len_hwaiso { - __le16 PacketLength; - __le16 PacketStatus; -} __packed; - -struct wa_xfer_packet_status_hwaiso { - __le16 wLength; - u8 bPacketType; - u8 bReserved; - struct wa_xfer_packet_status_len_hwaiso PacketStatus[0]; -} __packed; + /* FIXME: u8 pktdata[]? */ +} __attribute__((packed)); /* [WUSB] section 8.3.3.5 */ struct wa_xfer_abort { @@ -227,7 +206,7 @@ struct wa_xfer_abort { u8 bRequestType; __le16 wRPipe; /* RPipe index */ __le32 dwTransferID; /* Host-assigned ID */ -} __packed; +} __attribute__((packed)); /** * WA Transfer Complete notification ([WUSB] section 8.3.3.3) @@ -237,7 +216,7 @@ struct wa_notif_xfer { struct wa_notif_hdr hdr; u8 bEndpoint; u8 Reserved; -} __packed; +} __attribute__((packed)); /** Transfer result basic codes [WUSB] table 8-15 */ enum { @@ -264,7 +243,7 @@ struct wa_xfer_result { u8 bTransferSegment; u8 bTransferStatus; __le32 dwNumOfPackets; -} __packed; +} __attribute__((packed)); /** * Wire Adapter Class Descriptor ([WUSB] section 8.5.2.7). @@ -279,16 +258,16 @@ struct wa_xfer_result { struct usb_wa_descriptor { u8 bLength; u8 bDescriptorType; - __le16 bcdWAVersion; + u16 bcdWAVersion; u8 bNumPorts; /* don't use!! */ u8 bmAttributes; /* Reserved == 0 */ - __le16 wNumRPipes; - __le16 wRPipeMaxBlock; + u16 wNumRPipes; + u16 wRPipeMaxBlock; u8 bRPipeBlockSize; u8 bPwrOn2PwrGood; u8 bNumMMCIEs; u8 DeviceRemovable; /* FIXME: in DWA this is up to 16 bytes */ -} __packed; +} __attribute__((packed)); /** * HWA Device Information Buffer (WUSB1.0[T8.54]) @@ -298,6 +277,6 @@ struct hwa_dev_info { u8 bDeviceAddress; __le16 wPHYRates; u8 bmDeviceAttribute; -} __packed; +} __attribute__((packed)); #endif /* #ifndef __LINUX_USB_WUSB_WA_H */ diff --git a/include/linux/usb/wusb.h b/include/linux/usb/wusb.h index eeb2832..0c4d4ca 100644 --- a/include/linux/usb/wusb.h +++ b/include/linux/usb/wusb.h @@ -271,8 +271,6 @@ static inline u8 wusb_key_index(int index, int type, int originator) #define WUSB_KEY_INDEX_TYPE_GTK 2 #define WUSB_KEY_INDEX_ORIGINATOR_HOST 0 #define WUSB_KEY_INDEX_ORIGINATOR_DEVICE 1 -/* bits 0-3 used for the key index. */ -#define WUSB_KEY_INDEX_MAX 15 /* A CCM Nonce, defined in WUSB1.0[6.4.1] */ struct aes_ccm_nonce { diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h index 4836ba3..4db2985 100644 --- a/include/linux/user_namespace.h +++ b/include/linux/user_namespace.h @@ -27,12 +27,6 @@ struct user_namespace { kuid_t owner; kgid_t group; unsigned int proc_inum; - - /* Register of per-UID persistent keyrings for this namespace */ -#ifdef CONFIG_PERSISTENT_KEYRINGS - struct key *persistent_keyring_register; - struct rw_semaphore persistent_keyring_register_sem; -#endif }; extern struct user_namespace init_user_ns; diff --git a/include/linux/virtio.h b/include/linux/virtio.h index e4abb84..36d36cc 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h @@ -51,11 +51,11 @@ int virtqueue_add_sgs(struct virtqueue *vq, void *data, gfp_t gfp); -bool virtqueue_kick(struct virtqueue *vq); +void virtqueue_kick(struct virtqueue *vq); bool virtqueue_kick_prepare(struct virtqueue *vq); -bool virtqueue_notify(struct virtqueue *vq); +void virtqueue_notify(struct virtqueue *vq); void *virtqueue_get_buf(struct virtqueue *vq, unsigned int *len); @@ -73,8 +73,6 @@ void *virtqueue_detach_unused_buf(struct virtqueue *vq); unsigned int virtqueue_get_vring_size(struct virtqueue *vq); -bool virtqueue_is_broken(struct virtqueue *vq); - /** * virtio_device - representation of a device using virtio * @index: unique position on the virtio bus diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index e8f8f71..29b9104 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -96,6 +96,33 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev, return test_bit(fbit, vdev->features); } +/** + * virtio_config_val - look for a feature and get a virtio config entry. + * @vdev: the virtio device + * @fbit: the feature bit + * @offset: the type to search for. + * @v: a pointer to the value to fill in. + * + * The return value is -ENOENT if the feature doesn't exist. Otherwise + * the config value is copied into whatever is pointed to by v. */ +#define virtio_config_val(vdev, fbit, offset, v) \ + virtio_config_buf((vdev), (fbit), (offset), (v), sizeof(*v)) + +#define virtio_config_val_len(vdev, fbit, offset, v, len) \ + virtio_config_buf((vdev), (fbit), (offset), (v), (len)) + +static inline int virtio_config_buf(struct virtio_device *vdev, + unsigned int fbit, + unsigned int offset, + void *buf, unsigned len) +{ + if (!virtio_has_feature(vdev, fbit)) + return -ENOENT; + + vdev->config->get(vdev, offset, buf, len); + return 0; +} + static inline struct virtqueue *virtio_find_single_vq(struct virtio_device *vdev, vq_callback_t *c, const char *n) @@ -135,139 +162,5 @@ int virtqueue_set_affinity(struct virtqueue *vq, int cpu) return 0; } -/* Config space accessors. */ -#define virtio_cread(vdev, structname, member, ptr) \ - do { \ - /* Must match the member's type, and be integer */ \ - if (!typecheck(typeof((((structname*)0)->member)), *(ptr))) \ - (*ptr) = 1; \ - \ - switch (sizeof(*ptr)) { \ - case 1: \ - *(ptr) = virtio_cread8(vdev, \ - offsetof(structname, member)); \ - break; \ - case 2: \ - *(ptr) = virtio_cread16(vdev, \ - offsetof(structname, member)); \ - break; \ - case 4: \ - *(ptr) = virtio_cread32(vdev, \ - offsetof(structname, member)); \ - break; \ - case 8: \ - *(ptr) = virtio_cread64(vdev, \ - offsetof(structname, member)); \ - break; \ - default: \ - BUG(); \ - } \ - } while(0) - -/* Config space accessors. */ -#define virtio_cwrite(vdev, structname, member, ptr) \ - do { \ - /* Must match the member's type, and be integer */ \ - if (!typecheck(typeof((((structname*)0)->member)), *(ptr))) \ - BUG_ON((*ptr) == 1); \ - \ - switch (sizeof(*ptr)) { \ - case 1: \ - virtio_cwrite8(vdev, \ - offsetof(structname, member), \ - *(ptr)); \ - break; \ - case 2: \ - virtio_cwrite16(vdev, \ - offsetof(structname, member), \ - *(ptr)); \ - break; \ - case 4: \ - virtio_cwrite32(vdev, \ - offsetof(structname, member), \ - *(ptr)); \ - break; \ - case 8: \ - virtio_cwrite64(vdev, \ - offsetof(structname, member), \ - *(ptr)); \ - break; \ - default: \ - BUG(); \ - } \ - } while(0) - -static inline u8 virtio_cread8(struct virtio_device *vdev, unsigned int offset) -{ - u8 ret; - vdev->config->get(vdev, offset, &ret, sizeof(ret)); - return ret; -} - -static inline void virtio_cread_bytes(struct virtio_device *vdev, - unsigned int offset, - void *buf, size_t len) -{ - vdev->config->get(vdev, offset, buf, len); -} - -static inline void virtio_cwrite8(struct virtio_device *vdev, - unsigned int offset, u8 val) -{ - vdev->config->set(vdev, offset, &val, sizeof(val)); -} - -static inline u16 virtio_cread16(struct virtio_device *vdev, - unsigned int offset) -{ - u16 ret; - vdev->config->get(vdev, offset, &ret, sizeof(ret)); - return ret; -} - -static inline void virtio_cwrite16(struct virtio_device *vdev, - unsigned int offset, u16 val) -{ - vdev->config->set(vdev, offset, &val, sizeof(val)); -} - -static inline u32 virtio_cread32(struct virtio_device *vdev, - unsigned int offset) -{ - u32 ret; - vdev->config->get(vdev, offset, &ret, sizeof(ret)); - return ret; -} - -static inline void virtio_cwrite32(struct virtio_device *vdev, - unsigned int offset, u32 val) -{ - vdev->config->set(vdev, offset, &val, sizeof(val)); -} - -static inline u64 virtio_cread64(struct virtio_device *vdev, - unsigned int offset) -{ - u64 ret; - vdev->config->get(vdev, offset, &ret, sizeof(ret)); - return ret; -} - -static inline void virtio_cwrite64(struct virtio_device *vdev, - unsigned int offset, u64 val) -{ - vdev->config->set(vdev, offset, &val, sizeof(val)); -} - -/* Conditional config space accessors. */ -#define virtio_cread_feature(vdev, fbit, structname, member, ptr) \ - ({ \ - int _r = 0; \ - if (!virtio_has_feature(vdev, fbit)) \ - _r = -ENOENT; \ - else \ - virtio_cread((vdev), structname, member, ptr); \ - _r; \ - }) #endif /* _LINUX_VIRTIO_CONFIG_H */ diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index 67e06fe..b300787 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h @@ -71,7 +71,7 @@ struct virtqueue *vring_new_virtqueue(unsigned int index, struct virtio_device *vdev, bool weak_barriers, void *pages, - bool (*notify)(struct virtqueue *vq), + void (*notify)(struct virtqueue *vq), void (*callback)(struct virtqueue *vq), const char *name); void vring_del_virtqueue(struct virtqueue *vq); diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h index c557c6d..1855f0a 100644 --- a/include/linux/vm_event_item.h +++ b/include/linux/vm_event_item.h @@ -39,7 +39,6 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, PAGEOUTRUN, ALLOCSTALL, PGROTATED, #ifdef CONFIG_NUMA_BALANCING NUMA_PTE_UPDATES, - NUMA_HUGE_PTE_UPDATES, NUMA_HINT_FAULTS, NUMA_HINT_FAULTS_LOCAL, NUMA_PAGE_MIGRATE, diff --git a/include/linux/wait.h b/include/linux/wait.h index eaa00b1..a67fc16 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -1,8 +1,7 @@ #ifndef _LINUX_WAIT_H #define _LINUX_WAIT_H -/* - * Linux wait queue related types and methods - */ + + #include <linux/list.h> #include <linux/stddef.h> #include <linux/spinlock.h> @@ -14,27 +13,27 @@ typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int flags, v int default_wake_function(wait_queue_t *wait, unsigned mode, int flags, void *key); struct __wait_queue { - unsigned int flags; + unsigned int flags; #define WQ_FLAG_EXCLUSIVE 0x01 - void *private; - wait_queue_func_t func; - struct list_head task_list; + void *private; + wait_queue_func_t func; + struct list_head task_list; }; struct wait_bit_key { - void *flags; - int bit_nr; -#define WAIT_ATOMIC_T_BIT_NR -1 + void *flags; + int bit_nr; +#define WAIT_ATOMIC_T_BIT_NR -1 }; struct wait_bit_queue { - struct wait_bit_key key; - wait_queue_t wait; + struct wait_bit_key key; + wait_queue_t wait; }; struct __wait_queue_head { - spinlock_t lock; - struct list_head task_list; + spinlock_t lock; + struct list_head task_list; }; typedef struct __wait_queue_head wait_queue_head_t; @@ -85,17 +84,17 @@ extern void __init_waitqueue_head(wait_queue_head_t *q, const char *name, struct static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p) { - q->flags = 0; - q->private = p; - q->func = default_wake_function; + q->flags = 0; + q->private = p; + q->func = default_wake_function; } -static inline void -init_waitqueue_func_entry(wait_queue_t *q, wait_queue_func_t func) +static inline void init_waitqueue_func_entry(wait_queue_t *q, + wait_queue_func_t func) { - q->flags = 0; - q->private = NULL; - q->func = func; + q->flags = 0; + q->private = NULL; + q->func = func; } static inline int waitqueue_active(wait_queue_head_t *q) @@ -115,8 +114,8 @@ static inline void __add_wait_queue(wait_queue_head_t *head, wait_queue_t *new) /* * Used for wake-one threads: */ -static inline void -__add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t *wait) +static inline void __add_wait_queue_exclusive(wait_queue_head_t *q, + wait_queue_t *wait) { wait->flags |= WQ_FLAG_EXCLUSIVE; __add_wait_queue(q, wait); @@ -128,22 +127,23 @@ static inline void __add_wait_queue_tail(wait_queue_head_t *head, list_add_tail(&new->task_list, &head->task_list); } -static inline void -__add_wait_queue_tail_exclusive(wait_queue_head_t *q, wait_queue_t *wait) +static inline void __add_wait_queue_tail_exclusive(wait_queue_head_t *q, + wait_queue_t *wait) { wait->flags |= WQ_FLAG_EXCLUSIVE; __add_wait_queue_tail(q, wait); } -static inline void -__remove_wait_queue(wait_queue_head_t *head, wait_queue_t *old) +static inline void __remove_wait_queue(wait_queue_head_t *head, + wait_queue_t *old) { list_del(&old->task_list); } void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key); void __wake_up_locked_key(wait_queue_head_t *q, unsigned int mode, void *key); -void __wake_up_sync_key(wait_queue_head_t *q, unsigned int mode, int nr, void *key); +void __wake_up_sync_key(wait_queue_head_t *q, unsigned int mode, int nr, + void *key); void __wake_up_locked(wait_queue_head_t *q, unsigned int mode, int nr); void __wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr); void __wake_up_bit(wait_queue_head_t *, void *, int); @@ -170,64 +170,27 @@ wait_queue_head_t *bit_waitqueue(void *, int); /* * Wakeup macros to be used to report events to the targets. */ -#define wake_up_poll(x, m) \ +#define wake_up_poll(x, m) \ __wake_up(x, TASK_NORMAL, 1, (void *) (m)) -#define wake_up_locked_poll(x, m) \ +#define wake_up_locked_poll(x, m) \ __wake_up_locked_key((x), TASK_NORMAL, (void *) (m)) -#define wake_up_interruptible_poll(x, m) \ +#define wake_up_interruptible_poll(x, m) \ __wake_up(x, TASK_INTERRUPTIBLE, 1, (void *) (m)) #define wake_up_interruptible_sync_poll(x, m) \ __wake_up_sync_key((x), TASK_INTERRUPTIBLE, 1, (void *) (m)) -#define ___wait_cond_timeout(condition) \ -({ \ - bool __cond = (condition); \ - if (__cond && !__ret) \ - __ret = 1; \ - __cond || !__ret; \ -}) - -#define ___wait_is_interruptible(state) \ - (!__builtin_constant_p(state) || \ - state == TASK_INTERRUPTIBLE || state == TASK_KILLABLE) \ - -#define ___wait_event(wq, condition, state, exclusive, ret, cmd) \ -({ \ - __label__ __out; \ - wait_queue_t __wait; \ - long __ret = ret; \ - \ - INIT_LIST_HEAD(&__wait.task_list); \ - if (exclusive) \ - __wait.flags = WQ_FLAG_EXCLUSIVE; \ - else \ - __wait.flags = 0; \ +#define __wait_event(wq, condition) \ +do { \ + DEFINE_WAIT(__wait); \ \ for (;;) { \ - long __int = prepare_to_wait_event(&wq, &__wait, state);\ - \ + prepare_to_wait(&wq, &__wait, TASK_UNINTERRUPTIBLE); \ if (condition) \ break; \ - \ - if (___wait_is_interruptible(state) && __int) { \ - __ret = __int; \ - if (exclusive) { \ - abort_exclusive_wait(&wq, &__wait, \ - state, NULL); \ - goto __out; \ - } \ - break; \ - } \ - \ - cmd; \ + schedule(); \ } \ finish_wait(&wq, &__wait); \ -__out: __ret; \ -}) - -#define __wait_event(wq, condition) \ - (void)___wait_event(wq, condition, TASK_UNINTERRUPTIBLE, 0, 0, \ - schedule()) +} while (0) /** * wait_event - sleep until a condition gets true @@ -241,17 +204,29 @@ __out: __ret; \ * wake_up() has to be called after changing any variable that could * change the result of the wait condition. */ -#define wait_event(wq, condition) \ +#define wait_event(wq, condition) \ do { \ - if (condition) \ + if (condition) \ break; \ __wait_event(wq, condition); \ } while (0) -#define __wait_event_timeout(wq, condition, timeout) \ - ___wait_event(wq, ___wait_cond_timeout(condition), \ - TASK_UNINTERRUPTIBLE, 0, timeout, \ - __ret = schedule_timeout(__ret)) +#define __wait_event_timeout(wq, condition, ret) \ +do { \ + DEFINE_WAIT(__wait); \ + \ + for (;;) { \ + prepare_to_wait(&wq, &__wait, TASK_UNINTERRUPTIBLE); \ + if (condition) \ + break; \ + ret = schedule_timeout(ret); \ + if (!ret) \ + break; \ + } \ + if (!ret && (condition)) \ + ret = 1; \ + finish_wait(&wq, &__wait); \ +} while (0) /** * wait_event_timeout - sleep until a condition gets true or a timeout elapses @@ -273,40 +248,29 @@ do { \ #define wait_event_timeout(wq, condition, timeout) \ ({ \ long __ret = timeout; \ - if (!___wait_cond_timeout(condition)) \ - __ret = __wait_event_timeout(wq, condition, timeout); \ + if (!(condition)) \ + __wait_event_timeout(wq, condition, __ret); \ __ret; \ }) -#define __wait_event_cmd(wq, condition, cmd1, cmd2) \ - (void)___wait_event(wq, condition, TASK_UNINTERRUPTIBLE, 0, 0, \ - cmd1; schedule(); cmd2) - -/** - * wait_event_cmd - sleep until a condition gets true - * @wq: the waitqueue to wait on - * @condition: a C expression for the event to wait for - * cmd1: the command will be executed before sleep - * cmd2: the command will be executed after sleep - * - * The process is put to sleep (TASK_UNINTERRUPTIBLE) until the - * @condition evaluates to true. The @condition is checked each time - * the waitqueue @wq is woken up. - * - * wake_up() has to be called after changing any variable that could - * change the result of the wait condition. - */ -#define wait_event_cmd(wq, condition, cmd1, cmd2) \ +#define __wait_event_interruptible(wq, condition, ret) \ do { \ - if (condition) \ + DEFINE_WAIT(__wait); \ + \ + for (;;) { \ + prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE); \ + if (condition) \ + break; \ + if (!signal_pending(current)) { \ + schedule(); \ + continue; \ + } \ + ret = -ERESTARTSYS; \ break; \ - __wait_event_cmd(wq, condition, cmd1, cmd2); \ + } \ + finish_wait(&wq, &__wait); \ } while (0) -#define __wait_event_interruptible(wq, condition) \ - ___wait_event(wq, condition, TASK_INTERRUPTIBLE, 0, 0, \ - schedule()) - /** * wait_event_interruptible - sleep until a condition gets true * @wq: the waitqueue to wait on @@ -326,14 +290,31 @@ do { \ ({ \ int __ret = 0; \ if (!(condition)) \ - __ret = __wait_event_interruptible(wq, condition); \ + __wait_event_interruptible(wq, condition, __ret); \ __ret; \ }) -#define __wait_event_interruptible_timeout(wq, condition, timeout) \ - ___wait_event(wq, ___wait_cond_timeout(condition), \ - TASK_INTERRUPTIBLE, 0, timeout, \ - __ret = schedule_timeout(__ret)) +#define __wait_event_interruptible_timeout(wq, condition, ret) \ +do { \ + DEFINE_WAIT(__wait); \ + \ + for (;;) { \ + prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE); \ + if (condition) \ + break; \ + if (!signal_pending(current)) { \ + ret = schedule_timeout(ret); \ + if (!ret) \ + break; \ + continue; \ + } \ + ret = -ERESTARTSYS; \ + break; \ + } \ + if (!ret && (condition)) \ + ret = 1; \ + finish_wait(&wq, &__wait); \ +} while (0) /** * wait_event_interruptible_timeout - sleep until a condition gets true or a timeout elapses @@ -356,15 +337,15 @@ do { \ #define wait_event_interruptible_timeout(wq, condition, timeout) \ ({ \ long __ret = timeout; \ - if (!___wait_cond_timeout(condition)) \ - __ret = __wait_event_interruptible_timeout(wq, \ - condition, timeout); \ + if (!(condition)) \ + __wait_event_interruptible_timeout(wq, condition, __ret); \ __ret; \ }) #define __wait_event_hrtimeout(wq, condition, timeout, state) \ ({ \ int __ret = 0; \ + DEFINE_WAIT(__wait); \ struct hrtimer_sleeper __t; \ \ hrtimer_init_on_stack(&__t.timer, CLOCK_MONOTONIC, \ @@ -375,15 +356,25 @@ do { \ current->timer_slack_ns, \ HRTIMER_MODE_REL); \ \ - __ret = ___wait_event(wq, condition, state, 0, 0, \ + for (;;) { \ + prepare_to_wait(&wq, &__wait, state); \ + if (condition) \ + break; \ + if (state == TASK_INTERRUPTIBLE && \ + signal_pending(current)) { \ + __ret = -ERESTARTSYS; \ + break; \ + } \ if (!__t.task) { \ __ret = -ETIME; \ break; \ } \ - schedule()); \ + schedule(); \ + } \ \ hrtimer_cancel(&__t.timer); \ destroy_hrtimer_on_stack(&__t.timer); \ + finish_wait(&wq, &__wait); \ __ret; \ }) @@ -437,15 +428,33 @@ do { \ __ret; \ }) -#define __wait_event_interruptible_exclusive(wq, condition) \ - ___wait_event(wq, condition, TASK_INTERRUPTIBLE, 1, 0, \ - schedule()) +#define __wait_event_interruptible_exclusive(wq, condition, ret) \ +do { \ + DEFINE_WAIT(__wait); \ + \ + for (;;) { \ + prepare_to_wait_exclusive(&wq, &__wait, \ + TASK_INTERRUPTIBLE); \ + if (condition) { \ + finish_wait(&wq, &__wait); \ + break; \ + } \ + if (!signal_pending(current)) { \ + schedule(); \ + continue; \ + } \ + ret = -ERESTARTSYS; \ + abort_exclusive_wait(&wq, &__wait, \ + TASK_INTERRUPTIBLE, NULL); \ + break; \ + } \ +} while (0) #define wait_event_interruptible_exclusive(wq, condition) \ ({ \ int __ret = 0; \ if (!(condition)) \ - __ret = __wait_event_interruptible_exclusive(wq, condition);\ + __wait_event_interruptible_exclusive(wq, condition, __ret);\ __ret; \ }) @@ -597,8 +606,24 @@ do { \ ? 0 : __wait_event_interruptible_locked(wq, condition, 1, 1)) -#define __wait_event_killable(wq, condition) \ - ___wait_event(wq, condition, TASK_KILLABLE, 0, 0, schedule()) + +#define __wait_event_killable(wq, condition, ret) \ +do { \ + DEFINE_WAIT(__wait); \ + \ + for (;;) { \ + prepare_to_wait(&wq, &__wait, TASK_KILLABLE); \ + if (condition) \ + break; \ + if (!fatal_signal_pending(current)) { \ + schedule(); \ + continue; \ + } \ + ret = -ERESTARTSYS; \ + break; \ + } \ + finish_wait(&wq, &__wait); \ +} while (0) /** * wait_event_killable - sleep until a condition gets true @@ -619,17 +644,26 @@ do { \ ({ \ int __ret = 0; \ if (!(condition)) \ - __ret = __wait_event_killable(wq, condition); \ + __wait_event_killable(wq, condition, __ret); \ __ret; \ }) #define __wait_event_lock_irq(wq, condition, lock, cmd) \ - (void)___wait_event(wq, condition, TASK_UNINTERRUPTIBLE, 0, 0, \ - spin_unlock_irq(&lock); \ - cmd; \ - schedule(); \ - spin_lock_irq(&lock)) +do { \ + DEFINE_WAIT(__wait); \ + \ + for (;;) { \ + prepare_to_wait(&wq, &__wait, TASK_UNINTERRUPTIBLE); \ + if (condition) \ + break; \ + spin_unlock_irq(&lock); \ + cmd; \ + schedule(); \ + spin_lock_irq(&lock); \ + } \ + finish_wait(&wq, &__wait); \ +} while (0) /** * wait_event_lock_irq_cmd - sleep until a condition gets true. The @@ -689,12 +723,26 @@ do { \ } while (0) -#define __wait_event_interruptible_lock_irq(wq, condition, lock, cmd) \ - ___wait_event(wq, condition, TASK_INTERRUPTIBLE, 0, 0, \ - spin_unlock_irq(&lock); \ - cmd; \ - schedule(); \ - spin_lock_irq(&lock)) +#define __wait_event_interruptible_lock_irq(wq, condition, \ + lock, ret, cmd) \ +do { \ + DEFINE_WAIT(__wait); \ + \ + for (;;) { \ + prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE); \ + if (condition) \ + break; \ + if (signal_pending(current)) { \ + ret = -ERESTARTSYS; \ + break; \ + } \ + spin_unlock_irq(&lock); \ + cmd; \ + schedule(); \ + spin_lock_irq(&lock); \ + } \ + finish_wait(&wq, &__wait); \ +} while (0) /** * wait_event_interruptible_lock_irq_cmd - sleep until a condition gets true. @@ -724,9 +772,10 @@ do { \ #define wait_event_interruptible_lock_irq_cmd(wq, condition, lock, cmd) \ ({ \ int __ret = 0; \ + \ if (!(condition)) \ - __ret = __wait_event_interruptible_lock_irq(wq, \ - condition, lock, cmd); \ + __wait_event_interruptible_lock_irq(wq, condition, \ + lock, __ret, cmd); \ __ret; \ }) @@ -755,24 +804,39 @@ do { \ #define wait_event_interruptible_lock_irq(wq, condition, lock) \ ({ \ int __ret = 0; \ + \ if (!(condition)) \ - __ret = __wait_event_interruptible_lock_irq(wq, \ - condition, lock,); \ + __wait_event_interruptible_lock_irq(wq, condition, \ + lock, __ret, ); \ __ret; \ }) #define __wait_event_interruptible_lock_irq_timeout(wq, condition, \ - lock, timeout) \ - ___wait_event(wq, ___wait_cond_timeout(condition), \ - TASK_INTERRUPTIBLE, 0, timeout, \ - spin_unlock_irq(&lock); \ - __ret = schedule_timeout(__ret); \ - spin_lock_irq(&lock)); + lock, ret) \ +do { \ + DEFINE_WAIT(__wait); \ + \ + for (;;) { \ + prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE); \ + if (condition) \ + break; \ + if (signal_pending(current)) { \ + ret = -ERESTARTSYS; \ + break; \ + } \ + spin_unlock_irq(&lock); \ + ret = schedule_timeout(ret); \ + spin_lock_irq(&lock); \ + if (!ret) \ + break; \ + } \ + finish_wait(&wq, &__wait); \ +} while (0) /** - * wait_event_interruptible_lock_irq_timeout - sleep until a condition gets - * true or a timeout elapses. The condition is checked under - * the lock. This is expected to be called with the lock taken. + * wait_event_interruptible_lock_irq_timeout - sleep until a condition gets true or a timeout elapses. + * The condition is checked under the lock. This is expected + * to be called with the lock taken. * @wq: the waitqueue to wait on * @condition: a C expression for the event to wait for * @lock: a locked spinlock_t, which will be released before schedule() @@ -796,10 +860,11 @@ do { \ #define wait_event_interruptible_lock_irq_timeout(wq, condition, lock, \ timeout) \ ({ \ - long __ret = timeout; \ - if (!___wait_cond_timeout(condition)) \ - __ret = __wait_event_interruptible_lock_irq_timeout( \ - wq, condition, lock, timeout); \ + int __ret = timeout; \ + \ + if (!(condition)) \ + __wait_event_interruptible_lock_irq_timeout( \ + wq, condition, lock, __ret); \ __ret; \ }) @@ -810,18 +875,20 @@ do { \ * We plan to remove these interfaces. */ extern void sleep_on(wait_queue_head_t *q); -extern long sleep_on_timeout(wait_queue_head_t *q, signed long timeout); +extern long sleep_on_timeout(wait_queue_head_t *q, + signed long timeout); extern void interruptible_sleep_on(wait_queue_head_t *q); -extern long interruptible_sleep_on_timeout(wait_queue_head_t *q, signed long timeout); +extern long interruptible_sleep_on_timeout(wait_queue_head_t *q, + signed long timeout); /* * Waitqueues which are removed from the waitqueue_head at wakeup time */ void prepare_to_wait(wait_queue_head_t *q, wait_queue_t *wait, int state); void prepare_to_wait_exclusive(wait_queue_head_t *q, wait_queue_t *wait, int state); -long prepare_to_wait_event(wait_queue_head_t *q, wait_queue_t *wait, int state); void finish_wait(wait_queue_head_t *q, wait_queue_t *wait); -void abort_exclusive_wait(wait_queue_head_t *q, wait_queue_t *wait, unsigned int mode, void *key); +void abort_exclusive_wait(wait_queue_head_t *q, wait_queue_t *wait, + unsigned int mode, void *key); int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key); int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key); @@ -867,8 +934,8 @@ int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key); * One uses wait_on_bit() where one is waiting for the bit to clear, * but has no intention of setting it. */ -static inline int -wait_on_bit(void *word, int bit, int (*action)(void *), unsigned mode) +static inline int wait_on_bit(void *word, int bit, + int (*action)(void *), unsigned mode) { if (!test_bit(bit, word)) return 0; @@ -891,8 +958,8 @@ wait_on_bit(void *word, int bit, int (*action)(void *), unsigned mode) * One uses wait_on_bit_lock() where one is waiting for the bit to * clear with the intention of setting it, and when done, clearing it. */ -static inline int -wait_on_bit_lock(void *word, int bit, int (*action)(void *), unsigned mode) +static inline int wait_on_bit_lock(void *word, int bit, + int (*action)(void *), unsigned mode) { if (!test_and_set_bit(bit, word)) return 0; @@ -916,5 +983,5 @@ int wait_on_atomic_t(atomic_t *val, int (*action)(atomic_t *), unsigned mode) return 0; return out_of_line_wait_on_atomic_t(val, action, mode); } - -#endif /* _LINUX_WAIT_H */ + +#endif diff --git a/include/linux/writeback.h b/include/linux/writeback.h index fc0e432..021b8a3 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h @@ -97,7 +97,7 @@ void writeback_inodes_sb_nr(struct super_block *, unsigned long nr, int try_to_writeback_inodes_sb(struct super_block *, enum wb_reason reason); int try_to_writeback_inodes_sb_nr(struct super_block *, unsigned long nr, enum wb_reason reason); -void sync_inodes_sb(struct super_block *sb, unsigned long older_than_this); +void sync_inodes_sb(struct super_block *); void wakeup_flusher_threads(long nr_pages, enum wb_reason reason); void inode_wait_for_writeback(struct inode *inode); |