summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRadim Krčmář <rkrcmar@redhat.com>2018-02-01 09:04:17 -0500
committerRadim Krčmář <rkrcmar@redhat.com>2018-02-01 09:04:17 -0500
commit7bf14c28ee776be567855bd39ed8ff795ea19f55 (patch)
tree6113748c673e85fccc2c56c050697789c00c6bc2 /include
parent87cedc6be55954c6efd6eca2e694132513f65a2a (diff)
parent5fa4ec9cb2e6679e2f828033726f758ea314b9c5 (diff)
Merge branch 'x86/hyperv' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Topic branch for stable KVM clockource under Hyper-V. Thanks to Christoffer Dall for resolving the ARM conflict.
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acconfig.h4
-rw-r--r--include/acpi/acexcep.h12
-rw-r--r--include/acpi/acpi_bus.h3
-rw-r--r--include/acpi/acpixf.h6
-rw-r--r--include/acpi/actbl1.h159
-rw-r--r--include/acpi/actbl2.h15
-rw-r--r--include/acpi/actypes.h4
-rw-r--r--include/asm-generic/mm_hooks.h5
-rw-r--r--include/asm-generic/pgtable.h5
-rw-r--r--include/asm-generic/vmlinux.lds.h4
-rw-r--r--include/crypto/if_alg.h5
-rw-r--r--include/crypto/internal/hash.h8
-rw-r--r--include/crypto/mcryptd.h1
-rw-r--r--include/drm/drm_connector.h10
-rw-r--r--include/drm/drm_edid.h2
-rw-r--r--include/drm/drm_mode_config.h18
-rw-r--r--include/kvm/arm_arch_timer.h2
-rw-r--r--include/linux/acpi.h7
-rw-r--r--include/linux/arch_topology.h2
-rw-r--r--include/linux/backing-dev.h2
-rw-r--r--include/linux/bio.h26
-rw-r--r--include/linux/blk-cgroup.h8
-rw-r--r--include/linux/blk-mq.h3
-rw-r--r--include/linux/blk_types.h37
-rw-r--r--include/linux/blkdev.h195
-rw-r--r--include/linux/bpf.h36
-rw-r--r--include/linux/bpf_verifier.h4
-rw-r--r--include/linux/bvec.h9
-rw-r--r--include/linux/compiler-gcc.h2
-rw-r--r--include/linux/compiler.h47
-rw-r--r--include/linux/completion.h46
-rw-r--r--include/linux/cper.h48
-rw-r--r--include/linux/cpu.h7
-rw-r--r--include/linux/cpu_cooling.h75
-rw-r--r--include/linux/cpuhotplug.h2
-rw-r--r--include/linux/crash_core.h2
-rw-r--r--include/linux/crc-ccitt.h7
-rw-r--r--include/linux/cred.h1
-rw-r--r--include/linux/delayacct.h8
-rw-r--r--include/linux/efi.h4
-rw-r--r--include/linux/elevator.h2
-rw-r--r--include/linux/fs.h17
-rw-r--r--include/linux/fscache.h2
-rw-r--r--include/linux/ftrace.h14
-rw-r--r--include/linux/genetlink.h3
-rw-r--r--include/linux/genhd.h5
-rw-r--r--include/linux/gpio/driver.h33
-rw-r--r--include/linux/hrtimer.h113
-rw-r--r--include/linux/idr.h1
-rw-r--r--include/linux/iio/adc/stm32-dfsdm-adc.h18
-rw-r--r--include/linux/iio/consumer.h37
-rw-r--r--include/linux/iio/hw-consumer.h21
-rw-r--r--include/linux/iio/iio.h28
-rw-r--r--include/linux/iio/types.h28
-rw-r--r--include/linux/init_task.h258
-rw-r--r--include/linux/intel-pti.h43
-rw-r--r--include/linux/ipv6.h3
-rw-r--r--include/linux/irq.h17
-rw-r--r--include/linux/irq_work.h11
-rw-r--r--include/linux/irqdesc.h9
-rw-r--r--include/linux/irqdomain.h2
-rw-r--r--include/linux/irqflags.h6
-rw-r--r--include/linux/iversion.h341
-rw-r--r--include/linux/jump_label.h7
-rw-r--r--include/linux/lightnvm.h125
-rw-r--r--include/linux/lockdep.h134
-rw-r--r--include/linux/mfd/axp20x.h5
-rw-r--r--include/linux/mfd/cros_ec.h4
-rw-r--r--include/linux/mfd/cros_ec_commands.h17
-rw-r--r--include/linux/mfd/palmas.h3
-rw-r--r--include/linux/mfd/rave-sp.h60
-rw-r--r--include/linux/mfd/stm32-lptimer.h6
-rw-r--r--include/linux/mfd/stm32-timers.h4
-rw-r--r--include/linux/mfd/tmio.h20
-rw-r--r--include/linux/mlx5/driver.h26
-rw-r--r--include/linux/mlx5/mlx5_ifc.h13
-rw-r--r--include/linux/mmc/host.h5
-rw-r--r--include/linux/mmc/slot-gpio.h1
-rw-r--r--include/linux/module.h9
-rw-r--r--include/linux/mtd/map.h130
-rw-r--r--include/linux/mtd/mtd.h28
-rw-r--r--include/linux/mtd/rawnand.h443
-rw-r--r--include/linux/mtd/spi-nor.h12
-rw-r--r--include/linux/netfilter/nfnetlink.h3
-rw-r--r--include/linux/netlink.h4
-rw-r--r--include/linux/nubus.h189
-rw-r--r--include/linux/nvme.h22
-rw-r--r--include/linux/omap-gpmc.h28
-rw-r--r--include/linux/oom.h9
-rw-r--r--include/linux/pci.h3
-rw-r--r--include/linux/percpu-refcount.h6
-rw-r--r--include/linux/platform_data/mtd-onenand-omap2.h34
-rw-r--r--include/linux/platform_data/spi-s3c64xx.h6
-rw-r--r--include/linux/pm.h17
-rw-r--r--include/linux/pm_wakeup.h7
-rw-r--r--include/linux/posix-timers.h25
-rw-r--r--include/linux/pti.h50
-rw-r--r--include/linux/ptr_ring.h23
-rw-r--r--include/linux/rbtree.h2
-rw-r--r--include/linux/rcupdate.h25
-rw-r--r--include/linux/rcutiny.h1
-rw-r--r--include/linux/rcutree.h1
-rw-r--r--include/linux/regmap.h50
-rw-r--r--include/linux/regulator/driver.h2
-rw-r--r--include/linux/regulator/machine.h37
-rw-r--r--include/linux/rtnetlink.h3
-rw-r--r--include/linux/rtsx_common.h (renamed from include/linux/mfd/rtsx_common.h)0
-rw-r--r--include/linux/rtsx_pci.h (renamed from include/linux/mfd/rtsx_pci.h)238
-rw-r--r--include/linux/rtsx_usb.h (renamed from include/linux/mfd/rtsx_usb.h)0
-rw-r--r--include/linux/rwlock_types.h3
-rw-r--r--include/linux/scatterlist.h11
-rw-r--r--include/linux/sched.h31
-rw-r--r--include/linux/sched/coredump.h1
-rw-r--r--include/linux/sched/cpufreq.h2
-rw-r--r--include/linux/sched/task_stack.h2
-rw-r--r--include/linux/sched/topology.h12
-rw-r--r--include/linux/seqlock.h3
-rw-r--r--include/linux/serdev.h1
-rw-r--r--include/linux/sh_eth.h1
-rw-r--r--include/linux/sound.h2
-rw-r--r--include/linux/spi/spi.h2
-rw-r--r--include/linux/spinlock.h5
-rw-r--r--include/linux/spinlock_types.h3
-rw-r--r--include/linux/srcu.h4
-rw-r--r--include/linux/srcutree.h8
-rw-r--r--include/linux/string.h5
-rw-r--r--include/linux/suspend.h28
-rw-r--r--include/linux/swapops.h21
-rw-r--r--include/linux/tick.h1
-rw-r--r--include/linux/timer.h4
-rw-r--r--include/linux/torture.h8
-rw-r--r--include/linux/trace.h2
-rw-r--r--include/linux/tracepoint.h5
-rw-r--r--include/net/arp.h3
-rw-r--r--include/net/cfg80211.h3
-rw-r--r--include/net/dst.h8
-rw-r--r--include/net/gue.h18
-rw-r--r--include/net/ip.h1
-rw-r--r--include/net/ipv6.h1
-rw-r--r--include/net/net_namespace.h10
-rw-r--r--include/net/pkt_cls.h7
-rw-r--r--include/net/sch_generic.h3
-rw-r--r--include/net/sctp/structs.h2
-rw-r--r--include/net/sock.h9
-rw-r--r--include/net/tls.h2
-rw-r--r--include/net/vxlan.h2
-rw-r--r--include/net/xfrm.h3
-rw-r--r--include/sound/hdaudio_ext.h4
-rw-r--r--include/sound/pcm.h8
-rw-r--r--include/sound/rt5514.h2
-rw-r--r--include/sound/rt5645.h3
-rw-r--r--include/sound/soc-acpi-intel-match.h1
-rw-r--r--include/sound/soc-acpi.h14
-rw-r--r--include/sound/soc-dai.h5
-rw-r--r--include/sound/soc.h9
-rw-r--r--include/trace/events/btrfs.h1
-rw-r--r--include/trace/events/clk.h4
-rw-r--r--include/trace/events/kvm.h7
-rw-r--r--include/trace/events/preemptirq.h11
-rw-r--r--include/trace/events/rcu.h75
-rw-r--r--include/trace/events/tcp.h97
-rw-r--r--include/trace/events/thermal.h10
-rw-r--r--include/trace/events/timer.h37
-rw-r--r--include/uapi/linux/btrfs.h11
-rw-r--r--include/uapi/linux/btrfs_tree.h2
-rw-r--r--include/uapi/linux/if_ether.h3
-rw-r--r--include/uapi/linux/kvm.h4
-rw-r--r--include/uapi/linux/libc-compat.h61
-rw-r--r--include/uapi/linux/lightnvm.h9
-rw-r--r--include/uapi/linux/netfilter/nf_conntrack_common.h2
-rw-r--r--include/uapi/linux/nubus.h23
-rw-r--r--include/uapi/linux/openvswitch.h1
-rw-r--r--include/uapi/linux/perf_event.h10
-rw-r--r--include/uapi/linux/pkt_sched.h1
-rw-r--r--include/uapi/linux/rtnetlink.h1
-rw-r--r--include/uapi/linux/sched.h5
-rw-r--r--include/uapi/sound/asound.h9
-rw-r--r--include/uapi/sound/snd_sst_tokens.h17
-rw-r--r--include/xen/balloon.h5
179 files changed, 2903 insertions, 1476 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 6db3b4668b1a..ffe364fa4040 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -145,9 +145,9 @@
145 145
146#define ACPI_ADDRESS_RANGE_MAX 2 146#define ACPI_ADDRESS_RANGE_MAX 2
147 147
148/* Maximum number of While() loops before abort */ 148/* Maximum time (default 30s) of While() loops before abort */
149 149
150#define ACPI_MAX_LOOP_COUNT 0x000FFFFF 150#define ACPI_MAX_LOOP_TIMEOUT 30
151 151
152/****************************************************************************** 152/******************************************************************************
153 * 153 *
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h
index 17d61b1f2511..3c46f0ef5f7a 100644
--- a/include/acpi/acexcep.h
+++ b/include/acpi/acexcep.h
@@ -130,8 +130,9 @@ struct acpi_exception_info {
130#define AE_HEX_OVERFLOW EXCEP_ENV (0x0020) 130#define AE_HEX_OVERFLOW EXCEP_ENV (0x0020)
131#define AE_DECIMAL_OVERFLOW EXCEP_ENV (0x0021) 131#define AE_DECIMAL_OVERFLOW EXCEP_ENV (0x0021)
132#define AE_OCTAL_OVERFLOW EXCEP_ENV (0x0022) 132#define AE_OCTAL_OVERFLOW EXCEP_ENV (0x0022)
133#define AE_END_OF_TABLE EXCEP_ENV (0x0023)
133 134
134#define AE_CODE_ENV_MAX 0x0022 135#define AE_CODE_ENV_MAX 0x0023
135 136
136/* 137/*
137 * Programmer exceptions 138 * Programmer exceptions
@@ -195,7 +196,7 @@ struct acpi_exception_info {
195#define AE_AML_CIRCULAR_REFERENCE EXCEP_AML (0x001E) 196#define AE_AML_CIRCULAR_REFERENCE EXCEP_AML (0x001E)
196#define AE_AML_BAD_RESOURCE_LENGTH EXCEP_AML (0x001F) 197#define AE_AML_BAD_RESOURCE_LENGTH EXCEP_AML (0x001F)
197#define AE_AML_ILLEGAL_ADDRESS EXCEP_AML (0x0020) 198#define AE_AML_ILLEGAL_ADDRESS EXCEP_AML (0x0020)
198#define AE_AML_INFINITE_LOOP EXCEP_AML (0x0021) 199#define AE_AML_LOOP_TIMEOUT EXCEP_AML (0x0021)
199#define AE_AML_UNINITIALIZED_NODE EXCEP_AML (0x0022) 200#define AE_AML_UNINITIALIZED_NODE EXCEP_AML (0x0022)
200#define AE_AML_TARGET_TYPE EXCEP_AML (0x0023) 201#define AE_AML_TARGET_TYPE EXCEP_AML (0x0023)
201 202
@@ -275,7 +276,8 @@ static const struct acpi_exception_info acpi_gbl_exception_names_env[] = {
275 EXCEP_TXT("AE_DECIMAL_OVERFLOW", 276 EXCEP_TXT("AE_DECIMAL_OVERFLOW",
276 "Overflow during ASCII decimal-to-binary conversion"), 277 "Overflow during ASCII decimal-to-binary conversion"),
277 EXCEP_TXT("AE_OCTAL_OVERFLOW", 278 EXCEP_TXT("AE_OCTAL_OVERFLOW",
278 "Overflow during ASCII octal-to-binary conversion") 279 "Overflow during ASCII octal-to-binary conversion"),
280 EXCEP_TXT("AE_END_OF_TABLE", "Reached the end of table")
279}; 281};
280 282
281static const struct acpi_exception_info acpi_gbl_exception_names_pgm[] = { 283static const struct acpi_exception_info acpi_gbl_exception_names_pgm[] = {
@@ -368,8 +370,8 @@ static const struct acpi_exception_info acpi_gbl_exception_names_aml[] = {
368 "The length of a Resource Descriptor in the AML is incorrect"), 370 "The length of a Resource Descriptor in the AML is incorrect"),
369 EXCEP_TXT("AE_AML_ILLEGAL_ADDRESS", 371 EXCEP_TXT("AE_AML_ILLEGAL_ADDRESS",
370 "A memory, I/O, or PCI configuration address is invalid"), 372 "A memory, I/O, or PCI configuration address is invalid"),
371 EXCEP_TXT("AE_AML_INFINITE_LOOP", 373 EXCEP_TXT("AE_AML_LOOP_TIMEOUT",
372 "An apparent infinite AML While loop, method was aborted"), 374 "An AML While loop exceeded the maximum execution time"),
373 EXCEP_TXT("AE_AML_UNINITIALIZED_NODE", 375 EXCEP_TXT("AE_AML_UNINITIALIZED_NODE",
374 "A namespace node is uninitialized or unresolved"), 376 "A namespace node is uninitialized or unresolved"),
375 EXCEP_TXT("AE_AML_TARGET_TYPE", 377 EXCEP_TXT("AE_AML_TARGET_TYPE",
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 79287629c888..c9608b0b80c6 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -91,6 +91,9 @@ acpi_evaluate_dsm_typed(acpi_handle handle, const guid_t *guid, u64 rev,
91bool acpi_dev_found(const char *hid); 91bool acpi_dev_found(const char *hid);
92bool acpi_dev_present(const char *hid, const char *uid, s64 hrv); 92bool acpi_dev_present(const char *hid, const char *uid, s64 hrv);
93 93
94const char *
95acpi_dev_get_first_match_name(const char *hid, const char *uid, s64 hrv);
96
94#ifdef CONFIG_ACPI 97#ifdef CONFIG_ACPI
95 98
96#include <linux/proc_fs.h> 99#include <linux/proc_fs.h>
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index e1dd1a8d42b6..c589c3e12d90 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -46,7 +46,7 @@
46 46
47/* Current ACPICA subsystem version in YYYYMMDD format */ 47/* Current ACPICA subsystem version in YYYYMMDD format */
48 48
49#define ACPI_CA_VERSION 0x20170831 49#define ACPI_CA_VERSION 0x20171215
50 50
51#include <acpi/acconfig.h> 51#include <acpi/acconfig.h>
52#include <acpi/actypes.h> 52#include <acpi/actypes.h>
@@ -260,11 +260,11 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_osi_data, 0);
260ACPI_INIT_GLOBAL(u8, acpi_gbl_reduced_hardware, FALSE); 260ACPI_INIT_GLOBAL(u8, acpi_gbl_reduced_hardware, FALSE);
261 261
262/* 262/*
263 * Maximum number of While() loop iterations before forced method abort. 263 * Maximum timeout for While() loop iterations before forced method abort.
264 * This mechanism is intended to prevent infinite loops during interpreter 264 * This mechanism is intended to prevent infinite loops during interpreter
265 * execution within a host kernel. 265 * execution within a host kernel.
266 */ 266 */
267ACPI_INIT_GLOBAL(u32, acpi_gbl_max_loop_iterations, ACPI_MAX_LOOP_COUNT); 267ACPI_INIT_GLOBAL(u32, acpi_gbl_max_loop_iterations, ACPI_MAX_LOOP_TIMEOUT);
268 268
269/* 269/*
270 * This mechanism is used to trace a specified AML method. The method is 270 * This mechanism is used to trace a specified AML method. The method is
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 7a89e6de94da..4c304bf4d591 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -69,9 +69,10 @@
69#define ACPI_SIG_HEST "HEST" /* Hardware Error Source Table */ 69#define ACPI_SIG_HEST "HEST" /* Hardware Error Source Table */
70#define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */ 70#define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */
71#define ACPI_SIG_MSCT "MSCT" /* Maximum System Characteristics Table */ 71#define ACPI_SIG_MSCT "MSCT" /* Maximum System Characteristics Table */
72#define ACPI_SIG_PDTT "PDTT" /* Processor Debug Trigger Table */ 72#define ACPI_SIG_PDTT "PDTT" /* Platform Debug Trigger Table */
73#define ACPI_SIG_PPTT "PPTT" /* Processor Properties Topology Table */ 73#define ACPI_SIG_PPTT "PPTT" /* Processor Properties Topology Table */
74#define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */ 74#define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */
75#define ACPI_SIG_SDEV "SDEV" /* Secure Devices table */
75#define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */ 76#define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */
76#define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */ 77#define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */
77#define ACPI_SIG_NFIT "NFIT" /* NVDIMM Firmware Interface Table */ 78#define ACPI_SIG_NFIT "NFIT" /* NVDIMM Firmware Interface Table */
@@ -1149,7 +1150,8 @@ enum acpi_nfit_type {
1149 ACPI_NFIT_TYPE_CONTROL_REGION = 4, 1150 ACPI_NFIT_TYPE_CONTROL_REGION = 4,
1150 ACPI_NFIT_TYPE_DATA_REGION = 5, 1151 ACPI_NFIT_TYPE_DATA_REGION = 5,
1151 ACPI_NFIT_TYPE_FLUSH_ADDRESS = 6, 1152 ACPI_NFIT_TYPE_FLUSH_ADDRESS = 6,
1152 ACPI_NFIT_TYPE_RESERVED = 7 /* 7 and greater are reserved */ 1153 ACPI_NFIT_TYPE_CAPABILITIES = 7,
1154 ACPI_NFIT_TYPE_RESERVED = 8 /* 8 and greater are reserved */
1153}; 1155};
1154 1156
1155/* 1157/*
@@ -1162,7 +1164,7 @@ struct acpi_nfit_system_address {
1162 struct acpi_nfit_header header; 1164 struct acpi_nfit_header header;
1163 u16 range_index; 1165 u16 range_index;
1164 u16 flags; 1166 u16 flags;
1165 u32 reserved; /* Reseved, must be zero */ 1167 u32 reserved; /* Reserved, must be zero */
1166 u32 proximity_domain; 1168 u32 proximity_domain;
1167 u8 range_guid[16]; 1169 u8 range_guid[16];
1168 u64 address; 1170 u64 address;
@@ -1281,9 +1283,72 @@ struct acpi_nfit_flush_address {
1281 u64 hint_address[1]; /* Variable length */ 1283 u64 hint_address[1]; /* Variable length */
1282}; 1284};
1283 1285
1286/* 7: Platform Capabilities Structure */
1287
1288struct acpi_nfit_capabilities {
1289 struct acpi_nfit_header header;
1290 u8 highest_capability;
1291 u8 reserved[3]; /* Reserved, must be zero */
1292 u32 capabilities;
1293 u32 reserved2;
1294};
1295
1296/* Capabilities Flags */
1297
1298#define ACPI_NFIT_CAPABILITY_CACHE_FLUSH (1) /* 00: Cache Flush to NVDIMM capable */
1299#define ACPI_NFIT_CAPABILITY_MEM_FLUSH (1<<1) /* 01: Memory Flush to NVDIMM capable */
1300#define ACPI_NFIT_CAPABILITY_MEM_MIRRORING (1<<2) /* 02: Memory Mirroring capable */
1301
1302/*
1303 * NFIT/DVDIMM device handle support - used as the _ADR for each NVDIMM
1304 */
1305struct nfit_device_handle {
1306 u32 handle;
1307};
1308
1309/* Device handle construction and extraction macros */
1310
1311#define ACPI_NFIT_DIMM_NUMBER_MASK 0x0000000F
1312#define ACPI_NFIT_CHANNEL_NUMBER_MASK 0x000000F0
1313#define ACPI_NFIT_MEMORY_ID_MASK 0x00000F00
1314#define ACPI_NFIT_SOCKET_ID_MASK 0x0000F000
1315#define ACPI_NFIT_NODE_ID_MASK 0x0FFF0000
1316
1317#define ACPI_NFIT_DIMM_NUMBER_OFFSET 0
1318#define ACPI_NFIT_CHANNEL_NUMBER_OFFSET 4
1319#define ACPI_NFIT_MEMORY_ID_OFFSET 8
1320#define ACPI_NFIT_SOCKET_ID_OFFSET 12
1321#define ACPI_NFIT_NODE_ID_OFFSET 16
1322
1323/* Macro to construct a NFIT/NVDIMM device handle */
1324
1325#define ACPI_NFIT_BUILD_DEVICE_HANDLE(dimm, channel, memory, socket, node) \
1326 ((dimm) | \
1327 ((channel) << ACPI_NFIT_CHANNEL_NUMBER_OFFSET) | \
1328 ((memory) << ACPI_NFIT_MEMORY_ID_OFFSET) | \
1329 ((socket) << ACPI_NFIT_SOCKET_ID_OFFSET) | \
1330 ((node) << ACPI_NFIT_NODE_ID_OFFSET))
1331
1332/* Macros to extract individual fields from a NFIT/NVDIMM device handle */
1333
1334#define ACPI_NFIT_GET_DIMM_NUMBER(handle) \
1335 ((handle) & ACPI_NFIT_DIMM_NUMBER_MASK)
1336
1337#define ACPI_NFIT_GET_CHANNEL_NUMBER(handle) \
1338 (((handle) & ACPI_NFIT_CHANNEL_NUMBER_MASK) >> ACPI_NFIT_CHANNEL_NUMBER_OFFSET)
1339
1340#define ACPI_NFIT_GET_MEMORY_ID(handle) \
1341 (((handle) & ACPI_NFIT_MEMORY_ID_MASK) >> ACPI_NFIT_MEMORY_ID_OFFSET)
1342
1343#define ACPI_NFIT_GET_SOCKET_ID(handle) \
1344 (((handle) & ACPI_NFIT_SOCKET_ID_MASK) >> ACPI_NFIT_SOCKET_ID_OFFSET)
1345
1346#define ACPI_NFIT_GET_NODE_ID(handle) \
1347 (((handle) & ACPI_NFIT_NODE_ID_MASK) >> ACPI_NFIT_NODE_ID_OFFSET)
1348
1284/******************************************************************************* 1349/*******************************************************************************
1285 * 1350 *
1286 * PDTT - Processor Debug Trigger Table (ACPI 6.2) 1351 * PDTT - Platform Debug Trigger Table (ACPI 6.2)
1287 * Version 0 1352 * Version 0
1288 * 1353 *
1289 ******************************************************************************/ 1354 ******************************************************************************/
@@ -1301,14 +1366,14 @@ struct acpi_table_pdtt {
1301 * starting at array_offset. 1366 * starting at array_offset.
1302 */ 1367 */
1303struct acpi_pdtt_channel { 1368struct acpi_pdtt_channel {
1304 u16 sub_channel_id; 1369 u8 subchannel_id;
1370 u8 flags;
1305}; 1371};
1306 1372
1307/* Mask and Flags for above */ 1373/* Flags for above */
1308 1374
1309#define ACPI_PDTT_SUBCHANNEL_ID_MASK 0x00FF 1375#define ACPI_PDTT_RUNTIME_TRIGGER (1)
1310#define ACPI_PDTT_RUNTIME_TRIGGER (1<<8) 1376#define ACPI_PDTT_WAIT_COMPLETION (1<<1)
1311#define ACPI_PPTT_WAIT_COMPLETION (1<<9)
1312 1377
1313/******************************************************************************* 1378/*******************************************************************************
1314 * 1379 *
@@ -1376,6 +1441,20 @@ struct acpi_pptt_cache {
1376#define ACPI_PPTT_MASK_CACHE_TYPE (0x0C) /* Cache type */ 1441#define ACPI_PPTT_MASK_CACHE_TYPE (0x0C) /* Cache type */
1377#define ACPI_PPTT_MASK_WRITE_POLICY (0x10) /* Write policy */ 1442#define ACPI_PPTT_MASK_WRITE_POLICY (0x10) /* Write policy */
1378 1443
1444/* Attributes describing cache */
1445#define ACPI_PPTT_CACHE_READ_ALLOCATE (0x0) /* Cache line is allocated on read */
1446#define ACPI_PPTT_CACHE_WRITE_ALLOCATE (0x01) /* Cache line is allocated on write */
1447#define ACPI_PPTT_CACHE_RW_ALLOCATE (0x02) /* Cache line is allocated on read and write */
1448#define ACPI_PPTT_CACHE_RW_ALLOCATE_ALT (0x03) /* Alternate representation of above */
1449
1450#define ACPI_PPTT_CACHE_TYPE_DATA (0x0) /* Data cache */
1451#define ACPI_PPTT_CACHE_TYPE_INSTR (1<<2) /* Instruction cache */
1452#define ACPI_PPTT_CACHE_TYPE_UNIFIED (2<<2) /* Unified I & D cache */
1453#define ACPI_PPTT_CACHE_TYPE_UNIFIED_ALT (3<<2) /* Alternate representation of above */
1454
1455#define ACPI_PPTT_CACHE_POLICY_WB (0x0) /* Cache is write back */
1456#define ACPI_PPTT_CACHE_POLICY_WT (1<<4) /* Cache is write through */
1457
1379/* 2: ID Structure */ 1458/* 2: ID Structure */
1380 1459
1381struct acpi_pptt_id { 1460struct acpi_pptt_id {
@@ -1405,6 +1484,68 @@ struct acpi_table_sbst {
1405 1484
1406/******************************************************************************* 1485/*******************************************************************************
1407 * 1486 *
1487 * SDEV - Secure Devices Table (ACPI 6.2)
1488 * Version 1
1489 *
1490 ******************************************************************************/
1491
1492struct acpi_table_sdev {
1493 struct acpi_table_header header; /* Common ACPI table header */
1494};
1495
1496struct acpi_sdev_header {
1497 u8 type;
1498 u8 flags;
1499 u16 length;
1500};
1501
1502/* Values for subtable type above */
1503
1504enum acpi_sdev_type {
1505 ACPI_SDEV_TYPE_NAMESPACE_DEVICE = 0,
1506 ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE = 1,
1507 ACPI_SDEV_TYPE_RESERVED = 2 /* 2 and greater are reserved */
1508};
1509
1510/* Values for flags above */
1511
1512#define ACPI_SDEV_HANDOFF_TO_UNSECURE_OS (1)
1513
1514/*
1515 * SDEV subtables
1516 */
1517
1518/* 0: Namespace Device Based Secure Device Structure */
1519
1520struct acpi_sdev_namespace {
1521 struct acpi_sdev_header header;
1522 u16 device_id_offset;
1523 u16 device_id_length;
1524 u16 vendor_data_offset;
1525 u16 vendor_data_length;
1526};
1527
1528/* 1: PCIe Endpoint Device Based Device Structure */
1529
1530struct acpi_sdev_pcie {
1531 struct acpi_sdev_header header;
1532 u16 segment;
1533 u16 start_bus;
1534 u16 path_offset;
1535 u16 path_length;
1536 u16 vendor_data_offset;
1537 u16 vendor_data_length;
1538};
1539
1540/* 1a: PCIe Endpoint path entry */
1541
1542struct acpi_sdev_pcie_path {
1543 u8 device;
1544 u8 function;
1545};
1546
1547/*******************************************************************************
1548 *
1408 * SLIT - System Locality Distance Information Table 1549 * SLIT - System Locality Distance Information Table
1409 * Version 1 1550 * Version 1
1410 * 1551 *
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
index 686b6f8c09dc..0d60d5df14f8 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -810,6 +810,7 @@ struct acpi_iort_smmu_v3 {
810 u8 pxm; 810 u8 pxm;
811 u8 reserved1; 811 u8 reserved1;
812 u16 reserved2; 812 u16 reserved2;
813 u32 id_mapping_index;
813}; 814};
814 815
815/* Values for Model field above */ 816/* Values for Model field above */
@@ -1246,6 +1247,8 @@ enum acpi_spmi_interface_types {
1246 * TCPA - Trusted Computing Platform Alliance table 1247 * TCPA - Trusted Computing Platform Alliance table
1247 * Version 2 1248 * Version 2
1248 * 1249 *
1250 * TCG Hardware Interface Table for TPM 1.2 Clients and Servers
1251 *
1249 * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0", 1252 * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0",
1250 * Version 1.2, Revision 8 1253 * Version 1.2, Revision 8
1251 * February 27, 2017 1254 * February 27, 2017
@@ -1310,6 +1313,8 @@ struct acpi_table_tcpa_server {
1310 * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table 1313 * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table
1311 * Version 4 1314 * Version 4
1312 * 1315 *
1316 * TCG Hardware Interface Table for TPM 2.0 Clients and Servers
1317 *
1313 * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0", 1318 * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0",
1314 * Version 1.2, Revision 8 1319 * Version 1.2, Revision 8
1315 * February 27, 2017 1320 * February 27, 2017
@@ -1329,15 +1334,23 @@ struct acpi_table_tpm2 {
1329/* Values for start_method above */ 1334/* Values for start_method above */
1330 1335
1331#define ACPI_TPM2_NOT_ALLOWED 0 1336#define ACPI_TPM2_NOT_ALLOWED 0
1337#define ACPI_TPM2_RESERVED1 1
1332#define ACPI_TPM2_START_METHOD 2 1338#define ACPI_TPM2_START_METHOD 2
1339#define ACPI_TPM2_RESERVED3 3
1340#define ACPI_TPM2_RESERVED4 4
1341#define ACPI_TPM2_RESERVED5 5
1333#define ACPI_TPM2_MEMORY_MAPPED 6 1342#define ACPI_TPM2_MEMORY_MAPPED 6
1334#define ACPI_TPM2_COMMAND_BUFFER 7 1343#define ACPI_TPM2_COMMAND_BUFFER 7
1335#define ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD 8 1344#define ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD 8
1345#define ACPI_TPM2_RESERVED9 9
1346#define ACPI_TPM2_RESERVED10 10
1336#define ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC 11 /* V1.2 Rev 8 */ 1347#define ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC 11 /* V1.2 Rev 8 */
1348#define ACPI_TPM2_RESERVED 12
1337 1349
1338/* Trailer appears after any start_method subtables */ 1350/* Optional trailer appears after any start_method subtables */
1339 1351
1340struct acpi_tpm2_trailer { 1352struct acpi_tpm2_trailer {
1353 u8 method_parameters[12];
1341 u32 minimum_log_length; /* Minimum length for the event log area */ 1354 u32 minimum_log_length; /* Minimum length for the event log area */
1342 u64 log_address; /* Address of the event log area */ 1355 u64 log_address; /* Address of the event log area */
1343}; 1356};
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 4f077edb9b81..31f1be74dd16 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -468,6 +468,8 @@ typedef void *acpi_handle; /* Actually a ptr to a NS Node */
468#define ACPI_NSEC_PER_MSEC 1000000L 468#define ACPI_NSEC_PER_MSEC 1000000L
469#define ACPI_NSEC_PER_SEC 1000000000L 469#define ACPI_NSEC_PER_SEC 1000000000L
470 470
471#define ACPI_TIME_AFTER(a, b) ((s64)((b) - (a)) < 0)
472
471/* Owner IDs are used to track namespace nodes for selective deletion */ 473/* Owner IDs are used to track namespace nodes for selective deletion */
472 474
473typedef u8 acpi_owner_id; 475typedef u8 acpi_owner_id;
@@ -1299,6 +1301,8 @@ typedef enum {
1299#define ACPI_OSI_WIN_7 0x0B 1301#define ACPI_OSI_WIN_7 0x0B
1300#define ACPI_OSI_WIN_8 0x0C 1302#define ACPI_OSI_WIN_8 0x0C
1301#define ACPI_OSI_WIN_10 0x0D 1303#define ACPI_OSI_WIN_10 0x0D
1304#define ACPI_OSI_WIN_10_RS1 0x0E
1305#define ACPI_OSI_WIN_10_RS2 0x0F
1302 1306
1303/* Definitions of getopt */ 1307/* Definitions of getopt */
1304 1308
diff --git a/include/asm-generic/mm_hooks.h b/include/asm-generic/mm_hooks.h
index ea189d88a3cc..8ac4e68a12f0 100644
--- a/include/asm-generic/mm_hooks.h
+++ b/include/asm-generic/mm_hooks.h
@@ -7,9 +7,10 @@
7#ifndef _ASM_GENERIC_MM_HOOKS_H 7#ifndef _ASM_GENERIC_MM_HOOKS_H
8#define _ASM_GENERIC_MM_HOOKS_H 8#define _ASM_GENERIC_MM_HOOKS_H
9 9
10static inline void arch_dup_mmap(struct mm_struct *oldmm, 10static inline int arch_dup_mmap(struct mm_struct *oldmm,
11 struct mm_struct *mm) 11 struct mm_struct *mm)
12{ 12{
13 return 0;
13} 14}
14 15
15static inline void arch_exit_mmap(struct mm_struct *mm) 16static inline void arch_exit_mmap(struct mm_struct *mm)
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index b234d54f2cb6..868e68561f91 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -1025,6 +1025,11 @@ static inline int pmd_clear_huge(pmd_t *pmd)
1025struct file; 1025struct file;
1026int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn, 1026int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn,
1027 unsigned long size, pgprot_t *vma_prot); 1027 unsigned long size, pgprot_t *vma_prot);
1028
1029#ifndef CONFIG_X86_ESPFIX64
1030static inline void init_espfix_bsp(void) { }
1031#endif
1032
1028#endif /* !__ASSEMBLY__ */ 1033#endif /* !__ASSEMBLY__ */
1029 1034
1030#ifndef io_remap_pfn_range 1035#ifndef io_remap_pfn_range
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index ee8b707d9fa9..a564b83bf013 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -268,7 +268,11 @@
268#define INIT_TASK_DATA(align) \ 268#define INIT_TASK_DATA(align) \
269 . = ALIGN(align); \ 269 . = ALIGN(align); \
270 VMLINUX_SYMBOL(__start_init_task) = .; \ 270 VMLINUX_SYMBOL(__start_init_task) = .; \
271 VMLINUX_SYMBOL(init_thread_union) = .; \
272 VMLINUX_SYMBOL(init_stack) = .; \
271 *(.data..init_task) \ 273 *(.data..init_task) \
274 *(.data..init_thread_info) \
275 . = VMLINUX_SYMBOL(__start_init_task) + THREAD_SIZE; \
272 VMLINUX_SYMBOL(__end_init_task) = .; 276 VMLINUX_SYMBOL(__end_init_task) = .;
273 277
274/* 278/*
diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h
index 38d9c5861ed8..f38227a78eae 100644
--- a/include/crypto/if_alg.h
+++ b/include/crypto/if_alg.h
@@ -18,6 +18,7 @@
18#include <linux/if_alg.h> 18#include <linux/if_alg.h>
19#include <linux/scatterlist.h> 19#include <linux/scatterlist.h>
20#include <linux/types.h> 20#include <linux/types.h>
21#include <linux/atomic.h>
21#include <net/sock.h> 22#include <net/sock.h>
22 23
23#include <crypto/aead.h> 24#include <crypto/aead.h>
@@ -150,7 +151,7 @@ struct af_alg_ctx {
150 struct crypto_wait wait; 151 struct crypto_wait wait;
151 152
152 size_t used; 153 size_t used;
153 size_t rcvused; 154 atomic_t rcvused;
154 155
155 bool more; 156 bool more;
156 bool merge; 157 bool merge;
@@ -215,7 +216,7 @@ static inline int af_alg_rcvbuf(struct sock *sk)
215 struct af_alg_ctx *ctx = ask->private; 216 struct af_alg_ctx *ctx = ask->private;
216 217
217 return max_t(int, max_t(int, sk->sk_rcvbuf & PAGE_MASK, PAGE_SIZE) - 218 return max_t(int, max_t(int, sk->sk_rcvbuf & PAGE_MASK, PAGE_SIZE) -
218 ctx->rcvused, 0); 219 atomic_read(&ctx->rcvused), 0);
219} 220}
220 221
221/** 222/**
diff --git a/include/crypto/internal/hash.h b/include/crypto/internal/hash.h
index f0b44c16e88f..c2bae8da642c 100644
--- a/include/crypto/internal/hash.h
+++ b/include/crypto/internal/hash.h
@@ -82,6 +82,14 @@ int ahash_register_instance(struct crypto_template *tmpl,
82 struct ahash_instance *inst); 82 struct ahash_instance *inst);
83void ahash_free_instance(struct crypto_instance *inst); 83void ahash_free_instance(struct crypto_instance *inst);
84 84
85int shash_no_setkey(struct crypto_shash *tfm, const u8 *key,
86 unsigned int keylen);
87
88static inline bool crypto_shash_alg_has_setkey(struct shash_alg *alg)
89{
90 return alg->setkey != shash_no_setkey;
91}
92
85int crypto_init_ahash_spawn(struct crypto_ahash_spawn *spawn, 93int crypto_init_ahash_spawn(struct crypto_ahash_spawn *spawn,
86 struct hash_alg_common *alg, 94 struct hash_alg_common *alg,
87 struct crypto_instance *inst); 95 struct crypto_instance *inst);
diff --git a/include/crypto/mcryptd.h b/include/crypto/mcryptd.h
index cceafa01f907..b67404fc4b34 100644
--- a/include/crypto/mcryptd.h
+++ b/include/crypto/mcryptd.h
@@ -27,6 +27,7 @@ static inline struct mcryptd_ahash *__mcryptd_ahash_cast(
27 27
28struct mcryptd_cpu_queue { 28struct mcryptd_cpu_queue {
29 struct crypto_queue queue; 29 struct crypto_queue queue;
30 spinlock_t q_lock;
30 struct work_struct work; 31 struct work_struct work;
31}; 32};
32 33
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index a4649c56ca2f..5971577016a2 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -24,6 +24,7 @@
24#define __DRM_CONNECTOR_H__ 24#define __DRM_CONNECTOR_H__
25 25
26#include <linux/list.h> 26#include <linux/list.h>
27#include <linux/llist.h>
27#include <linux/ctype.h> 28#include <linux/ctype.h>
28#include <linux/hdmi.h> 29#include <linux/hdmi.h>
29#include <drm/drm_mode_object.h> 30#include <drm/drm_mode_object.h>
@@ -918,12 +919,13 @@ struct drm_connector {
918 uint16_t tile_h_size, tile_v_size; 919 uint16_t tile_h_size, tile_v_size;
919 920
920 /** 921 /**
921 * @free_work: 922 * @free_node:
922 * 923 *
923 * Work used only by &drm_connector_iter to be able to clean up a 924 * List used only by &drm_connector_iter to be able to clean up a
924 * connector from any context. 925 * connector from any context, in conjunction with
926 * &drm_mode_config.connector_free_work.
925 */ 927 */
926 struct work_struct free_work; 928 struct llist_node free_node;
927}; 929};
928 930
929#define obj_to_connector(x) container_of(x, struct drm_connector, base) 931#define obj_to_connector(x) container_of(x, struct drm_connector, base)
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index 2ec41d032e56..efe6d5a8e834 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -465,6 +465,8 @@ struct edid *drm_get_edid(struct drm_connector *connector,
465struct edid *drm_get_edid_switcheroo(struct drm_connector *connector, 465struct edid *drm_get_edid_switcheroo(struct drm_connector *connector,
466 struct i2c_adapter *adapter); 466 struct i2c_adapter *adapter);
467struct edid *drm_edid_duplicate(const struct edid *edid); 467struct edid *drm_edid_duplicate(const struct edid *edid);
468void drm_reset_display_info(struct drm_connector *connector);
469u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edid);
468int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid); 470int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid);
469 471
470u8 drm_match_cea_mode(const struct drm_display_mode *to_match); 472u8 drm_match_cea_mode(const struct drm_display_mode *to_match);
diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h
index b21e827c5c78..b0ce26d71296 100644
--- a/include/drm/drm_mode_config.h
+++ b/include/drm/drm_mode_config.h
@@ -27,6 +27,7 @@
27#include <linux/types.h> 27#include <linux/types.h>
28#include <linux/idr.h> 28#include <linux/idr.h>
29#include <linux/workqueue.h> 29#include <linux/workqueue.h>
30#include <linux/llist.h>
30 31
31#include <drm/drm_modeset_lock.h> 32#include <drm/drm_modeset_lock.h>
32 33
@@ -393,7 +394,7 @@ struct drm_mode_config {
393 394
394 /** 395 /**
395 * @connector_list_lock: Protects @num_connector and 396 * @connector_list_lock: Protects @num_connector and
396 * @connector_list. 397 * @connector_list and @connector_free_list.
397 */ 398 */
398 spinlock_t connector_list_lock; 399 spinlock_t connector_list_lock;
399 /** 400 /**
@@ -414,6 +415,21 @@ struct drm_mode_config {
414 */ 415 */
415 struct list_head connector_list; 416 struct list_head connector_list;
416 /** 417 /**
418 * @connector_free_list:
419 *
420 * List of connector objects linked with &drm_connector.free_head.
421 * Protected by @connector_list_lock. Used by
422 * drm_for_each_connector_iter() and
423 * &struct drm_connector_list_iter to savely free connectors using
424 * @connector_free_work.
425 */
426 struct llist_head connector_free_list;
427 /**
428 * @connector_free_work: Work to clean up @connector_free_list.
429 */
430 struct work_struct connector_free_work;
431
432 /**
417 * @num_encoder: 433 * @num_encoder:
418 * 434 *
419 * Number of encoders on this device. This is invariant over the 435 * Number of encoders on this device. This is invariant over the
diff --git a/include/kvm/arm_arch_timer.h b/include/kvm/arm_arch_timer.h
index b1dcfde0a3ef..6502feb9524b 100644
--- a/include/kvm/arm_arch_timer.h
+++ b/include/kvm/arm_arch_timer.h
@@ -62,7 +62,7 @@ struct arch_timer_cpu {
62 bool enabled; 62 bool enabled;
63}; 63};
64 64
65int kvm_timer_hyp_init(void); 65int kvm_timer_hyp_init(bool);
66int kvm_timer_enable(struct kvm_vcpu *vcpu); 66int kvm_timer_enable(struct kvm_vcpu *vcpu);
67int kvm_timer_vcpu_reset(struct kvm_vcpu *vcpu); 67int kvm_timer_vcpu_reset(struct kvm_vcpu *vcpu);
68void kvm_timer_vcpu_init(struct kvm_vcpu *vcpu); 68void kvm_timer_vcpu_init(struct kvm_vcpu *vcpu);
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index dc1ebfeeb5ec..b8f4c3c776e5 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -451,6 +451,7 @@ void __init acpi_no_s4_hw_signature(void);
451void __init acpi_old_suspend_ordering(void); 451void __init acpi_old_suspend_ordering(void);
452void __init acpi_nvs_nosave(void); 452void __init acpi_nvs_nosave(void);
453void __init acpi_nvs_nosave_s3(void); 453void __init acpi_nvs_nosave_s3(void);
454void __init acpi_sleep_no_blacklist(void);
454#endif /* CONFIG_PM_SLEEP */ 455#endif /* CONFIG_PM_SLEEP */
455 456
456struct acpi_osc_context { 457struct acpi_osc_context {
@@ -640,6 +641,12 @@ static inline bool acpi_dev_present(const char *hid, const char *uid, s64 hrv)
640 return false; 641 return false;
641} 642}
642 643
644static inline const char *
645acpi_dev_get_first_match_name(const char *hid, const char *uid, s64 hrv)
646{
647 return NULL;
648}
649
643static inline bool is_acpi_node(struct fwnode_handle *fwnode) 650static inline bool is_acpi_node(struct fwnode_handle *fwnode)
644{ 651{
645 return false; 652 return false;
diff --git a/include/linux/arch_topology.h b/include/linux/arch_topology.h
index 304511267c82..2b709416de05 100644
--- a/include/linux/arch_topology.h
+++ b/include/linux/arch_topology.h
@@ -27,7 +27,7 @@ void topology_set_cpu_scale(unsigned int cpu, unsigned long capacity);
27DECLARE_PER_CPU(unsigned long, freq_scale); 27DECLARE_PER_CPU(unsigned long, freq_scale);
28 28
29static inline 29static inline
30unsigned long topology_get_freq_scale(struct sched_domain *sd, int cpu) 30unsigned long topology_get_freq_scale(int cpu)
31{ 31{
32 return per_cpu(freq_scale, cpu); 32 return per_cpu(freq_scale, cpu);
33} 33}
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index e54e7e0033eb..3e4ce54d84ab 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -332,7 +332,7 @@ static inline bool inode_to_wb_is_valid(struct inode *inode)
332 * holding either @inode->i_lock, @inode->i_mapping->tree_lock, or the 332 * holding either @inode->i_lock, @inode->i_mapping->tree_lock, or the
333 * associated wb's list_lock. 333 * associated wb's list_lock.
334 */ 334 */
335static inline struct bdi_writeback *inode_to_wb(struct inode *inode) 335static inline struct bdi_writeback *inode_to_wb(const struct inode *inode)
336{ 336{
337#ifdef CONFIG_LOCKDEP 337#ifdef CONFIG_LOCKDEP
338 WARN_ON_ONCE(debug_locks && 338 WARN_ON_ONCE(debug_locks &&
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 82f0c8fd7be8..d0eb659fa733 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -300,6 +300,29 @@ static inline void bio_get_last_bvec(struct bio *bio, struct bio_vec *bv)
300 bv->bv_len = iter.bi_bvec_done; 300 bv->bv_len = iter.bi_bvec_done;
301} 301}
302 302
303static inline unsigned bio_pages_all(struct bio *bio)
304{
305 WARN_ON_ONCE(bio_flagged(bio, BIO_CLONED));
306 return bio->bi_vcnt;
307}
308
309static inline struct bio_vec *bio_first_bvec_all(struct bio *bio)
310{
311 WARN_ON_ONCE(bio_flagged(bio, BIO_CLONED));
312 return bio->bi_io_vec;
313}
314
315static inline struct page *bio_first_page_all(struct bio *bio)
316{
317 return bio_first_bvec_all(bio)->bv_page;
318}
319
320static inline struct bio_vec *bio_last_bvec_all(struct bio *bio)
321{
322 WARN_ON_ONCE(bio_flagged(bio, BIO_CLONED));
323 return &bio->bi_io_vec[bio->bi_vcnt - 1];
324}
325
303enum bip_flags { 326enum bip_flags {
304 BIP_BLOCK_INTEGRITY = 1 << 0, /* block layer owns integrity data */ 327 BIP_BLOCK_INTEGRITY = 1 << 0, /* block layer owns integrity data */
305 BIP_MAPPED_INTEGRITY = 1 << 1, /* ref tag has been remapped */ 328 BIP_MAPPED_INTEGRITY = 1 << 1, /* ref tag has been remapped */
@@ -477,7 +500,6 @@ static inline void bio_flush_dcache_pages(struct bio *bi)
477#endif 500#endif
478 501
479extern void bio_copy_data(struct bio *dst, struct bio *src); 502extern void bio_copy_data(struct bio *dst, struct bio *src);
480extern int bio_alloc_pages(struct bio *bio, gfp_t gfp);
481extern void bio_free_pages(struct bio *bio); 503extern void bio_free_pages(struct bio *bio);
482 504
483extern struct bio *bio_copy_user_iov(struct request_queue *, 505extern struct bio *bio_copy_user_iov(struct request_queue *,
@@ -492,6 +514,8 @@ extern unsigned int bvec_nr_vecs(unsigned short idx);
492 514
493#define bio_set_dev(bio, bdev) \ 515#define bio_set_dev(bio, bdev) \
494do { \ 516do { \
517 if ((bio)->bi_disk != (bdev)->bd_disk) \
518 bio_clear_flag(bio, BIO_THROTTLED);\
495 (bio)->bi_disk = (bdev)->bd_disk; \ 519 (bio)->bi_disk = (bdev)->bd_disk; \
496 (bio)->bi_partno = (bdev)->bd_partno; \ 520 (bio)->bi_partno = (bdev)->bd_partno; \
497} while (0) 521} while (0)
diff --git a/include/linux/blk-cgroup.h b/include/linux/blk-cgroup.h
index e9825ff57b15..69bea82ebeb1 100644
--- a/include/linux/blk-cgroup.h
+++ b/include/linux/blk-cgroup.h
@@ -660,12 +660,14 @@ static inline void blkg_rwstat_reset(struct blkg_rwstat *rwstat)
660static inline void blkg_rwstat_add_aux(struct blkg_rwstat *to, 660static inline void blkg_rwstat_add_aux(struct blkg_rwstat *to,
661 struct blkg_rwstat *from) 661 struct blkg_rwstat *from)
662{ 662{
663 struct blkg_rwstat v = blkg_rwstat_read(from); 663 u64 sum[BLKG_RWSTAT_NR];
664 int i; 664 int i;
665 665
666 for (i = 0; i < BLKG_RWSTAT_NR; i++) 666 for (i = 0; i < BLKG_RWSTAT_NR; i++)
667 atomic64_add(atomic64_read(&v.aux_cnt[i]) + 667 sum[i] = percpu_counter_sum_positive(&from->cpu_cnt[i]);
668 atomic64_read(&from->aux_cnt[i]), 668
669 for (i = 0; i < BLKG_RWSTAT_NR; i++)
670 atomic64_add(sum[i] + atomic64_read(&from->aux_cnt[i]),
669 &to->aux_cnt[i]); 671 &to->aux_cnt[i]);
670} 672}
671 673
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index 95c9a5c862e2..8efcf49796a3 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -51,6 +51,7 @@ struct blk_mq_hw_ctx {
51 unsigned int queue_num; 51 unsigned int queue_num;
52 52
53 atomic_t nr_active; 53 atomic_t nr_active;
54 unsigned int nr_expired;
54 55
55 struct hlist_node cpuhp_dead; 56 struct hlist_node cpuhp_dead;
56 struct kobject kobj; 57 struct kobject kobj;
@@ -65,7 +66,7 @@ struct blk_mq_hw_ctx {
65#endif 66#endif
66 67
67 /* Must be the last member - see also blk_mq_hw_ctx_size(). */ 68 /* Must be the last member - see also blk_mq_hw_ctx_size(). */
68 struct srcu_struct queue_rq_srcu[0]; 69 struct srcu_struct srcu[0];
69}; 70};
70 71
71struct blk_mq_tag_set { 72struct blk_mq_tag_set {
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index a1e628e032da..c5d3db0d83f8 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -39,6 +39,34 @@ typedef u8 __bitwise blk_status_t;
39 39
40#define BLK_STS_AGAIN ((__force blk_status_t)12) 40#define BLK_STS_AGAIN ((__force blk_status_t)12)
41 41
42/**
43 * blk_path_error - returns true if error may be path related
44 * @error: status the request was completed with
45 *
46 * Description:
47 * This classifies block error status into non-retryable errors and ones
48 * that may be successful if retried on a failover path.
49 *
50 * Return:
51 * %false - retrying failover path will not help
52 * %true - may succeed if retried
53 */
54static inline bool blk_path_error(blk_status_t error)
55{
56 switch (error) {
57 case BLK_STS_NOTSUPP:
58 case BLK_STS_NOSPC:
59 case BLK_STS_TARGET:
60 case BLK_STS_NEXUS:
61 case BLK_STS_MEDIUM:
62 case BLK_STS_PROTECTION:
63 return false;
64 }
65
66 /* Anything else could be a path failure, so should be retried */
67 return true;
68}
69
42struct blk_issue_stat { 70struct blk_issue_stat {
43 u64 stat; 71 u64 stat;
44}; 72};
@@ -50,8 +78,6 @@ struct blk_issue_stat {
50struct bio { 78struct bio {
51 struct bio *bi_next; /* request queue link */ 79 struct bio *bi_next; /* request queue link */
52 struct gendisk *bi_disk; 80 struct gendisk *bi_disk;
53 u8 bi_partno;
54 blk_status_t bi_status;
55 unsigned int bi_opf; /* bottom bits req flags, 81 unsigned int bi_opf; /* bottom bits req flags,
56 * top bits REQ_OP. Use 82 * top bits REQ_OP. Use
57 * accessors. 83 * accessors.
@@ -59,8 +85,8 @@ struct bio {
59 unsigned short bi_flags; /* status, etc and bvec pool number */ 85 unsigned short bi_flags; /* status, etc and bvec pool number */
60 unsigned short bi_ioprio; 86 unsigned short bi_ioprio;
61 unsigned short bi_write_hint; 87 unsigned short bi_write_hint;
62 88 blk_status_t bi_status;
63 struct bvec_iter bi_iter; 89 u8 bi_partno;
64 90
65 /* Number of segments in this BIO after 91 /* Number of segments in this BIO after
66 * physical address coalescing is performed. 92 * physical address coalescing is performed.
@@ -74,8 +100,9 @@ struct bio {
74 unsigned int bi_seg_front_size; 100 unsigned int bi_seg_front_size;
75 unsigned int bi_seg_back_size; 101 unsigned int bi_seg_back_size;
76 102
77 atomic_t __bi_remaining; 103 struct bvec_iter bi_iter;
78 104
105 atomic_t __bi_remaining;
79 bio_end_io_t *bi_end_io; 106 bio_end_io_t *bi_end_io;
80 107
81 void *bi_private; 108 void *bi_private;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 8089ca17db9a..4f3df807cf8f 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -27,6 +27,8 @@
27#include <linux/percpu-refcount.h> 27#include <linux/percpu-refcount.h>
28#include <linux/scatterlist.h> 28#include <linux/scatterlist.h>
29#include <linux/blkzoned.h> 29#include <linux/blkzoned.h>
30#include <linux/seqlock.h>
31#include <linux/u64_stats_sync.h>
30 32
31struct module; 33struct module;
32struct scsi_ioctl_command; 34struct scsi_ioctl_command;
@@ -121,6 +123,12 @@ typedef __u32 __bitwise req_flags_t;
121/* Look at ->special_vec for the actual data payload instead of the 123/* Look at ->special_vec for the actual data payload instead of the
122 bio chain. */ 124 bio chain. */
123#define RQF_SPECIAL_PAYLOAD ((__force req_flags_t)(1 << 18)) 125#define RQF_SPECIAL_PAYLOAD ((__force req_flags_t)(1 << 18))
126/* The per-zone write lock is held for this request */
127#define RQF_ZONE_WRITE_LOCKED ((__force req_flags_t)(1 << 19))
128/* timeout is expired */
129#define RQF_MQ_TIMEOUT_EXPIRED ((__force req_flags_t)(1 << 20))
130/* already slept for hybrid poll */
131#define RQF_MQ_POLL_SLEPT ((__force req_flags_t)(1 << 21))
124 132
125/* flags that prevent us from merging requests: */ 133/* flags that prevent us from merging requests: */
126#define RQF_NOMERGE_FLAGS \ 134#define RQF_NOMERGE_FLAGS \
@@ -133,12 +141,6 @@ typedef __u32 __bitwise req_flags_t;
133 * especially blk_mq_rq_ctx_init() to take care of the added fields. 141 * especially blk_mq_rq_ctx_init() to take care of the added fields.
134 */ 142 */
135struct request { 143struct request {
136 struct list_head queuelist;
137 union {
138 call_single_data_t csd;
139 u64 fifo_time;
140 };
141
142 struct request_queue *q; 144 struct request_queue *q;
143 struct blk_mq_ctx *mq_ctx; 145 struct blk_mq_ctx *mq_ctx;
144 146
@@ -148,8 +150,6 @@ struct request {
148 150
149 int internal_tag; 151 int internal_tag;
150 152
151 unsigned long atomic_flags;
152
153 /* the following two fields are internal, NEVER access directly */ 153 /* the following two fields are internal, NEVER access directly */
154 unsigned int __data_len; /* total data len */ 154 unsigned int __data_len; /* total data len */
155 int tag; 155 int tag;
@@ -158,6 +158,8 @@ struct request {
158 struct bio *bio; 158 struct bio *bio;
159 struct bio *biotail; 159 struct bio *biotail;
160 160
161 struct list_head queuelist;
162
161 /* 163 /*
162 * The hash is used inside the scheduler, and killed once the 164 * The hash is used inside the scheduler, and killed once the
163 * request reaches the dispatch list. The ipi_list is only used 165 * request reaches the dispatch list. The ipi_list is only used
@@ -205,19 +207,16 @@ struct request {
205 struct hd_struct *part; 207 struct hd_struct *part;
206 unsigned long start_time; 208 unsigned long start_time;
207 struct blk_issue_stat issue_stat; 209 struct blk_issue_stat issue_stat;
208#ifdef CONFIG_BLK_CGROUP
209 struct request_list *rl; /* rl this rq is alloced from */
210 unsigned long long start_time_ns;
211 unsigned long long io_start_time_ns; /* when passed to hardware */
212#endif
213 /* Number of scatter-gather DMA addr+len pairs after 210 /* Number of scatter-gather DMA addr+len pairs after
214 * physical address coalescing is performed. 211 * physical address coalescing is performed.
215 */ 212 */
216 unsigned short nr_phys_segments; 213 unsigned short nr_phys_segments;
214
217#if defined(CONFIG_BLK_DEV_INTEGRITY) 215#if defined(CONFIG_BLK_DEV_INTEGRITY)
218 unsigned short nr_integrity_segments; 216 unsigned short nr_integrity_segments;
219#endif 217#endif
220 218
219 unsigned short write_hint;
221 unsigned short ioprio; 220 unsigned short ioprio;
222 221
223 unsigned int timeout; 222 unsigned int timeout;
@@ -226,11 +225,37 @@ struct request {
226 225
227 unsigned int extra_len; /* length of alignment and padding */ 226 unsigned int extra_len; /* length of alignment and padding */
228 227
229 unsigned short write_hint; 228 /*
229 * On blk-mq, the lower bits of ->gstate (generation number and
230 * state) carry the MQ_RQ_* state value and the upper bits the
231 * generation number which is monotonically incremented and used to
232 * distinguish the reuse instances.
233 *
234 * ->gstate_seq allows updates to ->gstate and other fields
235 * (currently ->deadline) during request start to be read
236 * atomically from the timeout path, so that it can operate on a
237 * coherent set of information.
238 */
239 seqcount_t gstate_seq;
240 u64 gstate;
241
242 /*
243 * ->aborted_gstate is used by the timeout to claim a specific
244 * recycle instance of this request. See blk_mq_timeout_work().
245 */
246 struct u64_stats_sync aborted_gstate_sync;
247 u64 aborted_gstate;
248
249 /* access through blk_rq_set_deadline, blk_rq_deadline */
250 unsigned long __deadline;
230 251
231 unsigned long deadline;
232 struct list_head timeout_list; 252 struct list_head timeout_list;
233 253
254 union {
255 struct __call_single_data csd;
256 u64 fifo_time;
257 };
258
234 /* 259 /*
235 * completion callback. 260 * completion callback.
236 */ 261 */
@@ -239,16 +264,32 @@ struct request {
239 264
240 /* for bidi */ 265 /* for bidi */
241 struct request *next_rq; 266 struct request *next_rq;
267
268#ifdef CONFIG_BLK_CGROUP
269 struct request_list *rl; /* rl this rq is alloced from */
270 unsigned long long start_time_ns;
271 unsigned long long io_start_time_ns; /* when passed to hardware */
272#endif
242}; 273};
243 274
275static inline bool blk_op_is_scsi(unsigned int op)
276{
277 return op == REQ_OP_SCSI_IN || op == REQ_OP_SCSI_OUT;
278}
279
280static inline bool blk_op_is_private(unsigned int op)
281{
282 return op == REQ_OP_DRV_IN || op == REQ_OP_DRV_OUT;
283}
284
244static inline bool blk_rq_is_scsi(struct request *rq) 285static inline bool blk_rq_is_scsi(struct request *rq)
245{ 286{
246 return req_op(rq) == REQ_OP_SCSI_IN || req_op(rq) == REQ_OP_SCSI_OUT; 287 return blk_op_is_scsi(req_op(rq));
247} 288}
248 289
249static inline bool blk_rq_is_private(struct request *rq) 290static inline bool blk_rq_is_private(struct request *rq)
250{ 291{
251 return req_op(rq) == REQ_OP_DRV_IN || req_op(rq) == REQ_OP_DRV_OUT; 292 return blk_op_is_private(req_op(rq));
252} 293}
253 294
254static inline bool blk_rq_is_passthrough(struct request *rq) 295static inline bool blk_rq_is_passthrough(struct request *rq)
@@ -256,6 +297,13 @@ static inline bool blk_rq_is_passthrough(struct request *rq)
256 return blk_rq_is_scsi(rq) || blk_rq_is_private(rq); 297 return blk_rq_is_scsi(rq) || blk_rq_is_private(rq);
257} 298}
258 299
300static inline bool bio_is_passthrough(struct bio *bio)
301{
302 unsigned op = bio_op(bio);
303
304 return blk_op_is_scsi(op) || blk_op_is_private(op);
305}
306
259static inline unsigned short req_get_ioprio(struct request *req) 307static inline unsigned short req_get_ioprio(struct request *req)
260{ 308{
261 return req->ioprio; 309 return req->ioprio;
@@ -547,6 +595,22 @@ struct request_queue {
547 struct queue_limits limits; 595 struct queue_limits limits;
548 596
549 /* 597 /*
598 * Zoned block device information for request dispatch control.
599 * nr_zones is the total number of zones of the device. This is always
600 * 0 for regular block devices. seq_zones_bitmap is a bitmap of nr_zones
601 * bits which indicates if a zone is conventional (bit clear) or
602 * sequential (bit set). seq_zones_wlock is a bitmap of nr_zones
603 * bits which indicates if a zone is write locked, that is, if a write
604 * request targeting the zone was dispatched. All three fields are
605 * initialized by the low level device driver (e.g. scsi/sd.c).
606 * Stacking drivers (device mappers) may or may not initialize
607 * these fields.
608 */
609 unsigned int nr_zones;
610 unsigned long *seq_zones_bitmap;
611 unsigned long *seq_zones_wlock;
612
613 /*
550 * sg stuff 614 * sg stuff
551 */ 615 */
552 unsigned int sg_timeout; 616 unsigned int sg_timeout;
@@ -790,6 +854,27 @@ static inline unsigned int blk_queue_zone_sectors(struct request_queue *q)
790 return blk_queue_is_zoned(q) ? q->limits.chunk_sectors : 0; 854 return blk_queue_is_zoned(q) ? q->limits.chunk_sectors : 0;
791} 855}
792 856
857static inline unsigned int blk_queue_nr_zones(struct request_queue *q)
858{
859 return q->nr_zones;
860}
861
862static inline unsigned int blk_queue_zone_no(struct request_queue *q,
863 sector_t sector)
864{
865 if (!blk_queue_is_zoned(q))
866 return 0;
867 return sector >> ilog2(q->limits.chunk_sectors);
868}
869
870static inline bool blk_queue_zone_is_seq(struct request_queue *q,
871 sector_t sector)
872{
873 if (!blk_queue_is_zoned(q) || !q->seq_zones_bitmap)
874 return false;
875 return test_bit(blk_queue_zone_no(q, sector), q->seq_zones_bitmap);
876}
877
793static inline bool rq_is_sync(struct request *rq) 878static inline bool rq_is_sync(struct request *rq)
794{ 879{
795 return op_is_sync(rq->cmd_flags); 880 return op_is_sync(rq->cmd_flags);
@@ -948,7 +1033,7 @@ extern int blk_rq_prep_clone(struct request *rq, struct request *rq_src,
948extern void blk_rq_unprep_clone(struct request *rq); 1033extern void blk_rq_unprep_clone(struct request *rq);
949extern blk_status_t blk_insert_cloned_request(struct request_queue *q, 1034extern blk_status_t blk_insert_cloned_request(struct request_queue *q,
950 struct request *rq); 1035 struct request *rq);
951extern int blk_rq_append_bio(struct request *rq, struct bio *bio); 1036extern int blk_rq_append_bio(struct request *rq, struct bio **bio);
952extern void blk_delay_queue(struct request_queue *, unsigned long); 1037extern void blk_delay_queue(struct request_queue *, unsigned long);
953extern void blk_queue_split(struct request_queue *, struct bio **); 1038extern void blk_queue_split(struct request_queue *, struct bio **);
954extern void blk_recount_segments(struct request_queue *, struct bio *); 1039extern void blk_recount_segments(struct request_queue *, struct bio *);
@@ -1029,6 +1114,16 @@ static inline unsigned int blk_rq_cur_sectors(const struct request *rq)
1029 return blk_rq_cur_bytes(rq) >> 9; 1114 return blk_rq_cur_bytes(rq) >> 9;
1030} 1115}
1031 1116
1117static inline unsigned int blk_rq_zone_no(struct request *rq)
1118{
1119 return blk_queue_zone_no(rq->q, blk_rq_pos(rq));
1120}
1121
1122static inline unsigned int blk_rq_zone_is_seq(struct request *rq)
1123{
1124 return blk_queue_zone_is_seq(rq->q, blk_rq_pos(rq));
1125}
1126
1032/* 1127/*
1033 * Some commands like WRITE SAME have a payload or data transfer size which 1128 * Some commands like WRITE SAME have a payload or data transfer size which
1034 * is different from the size of the request. Any driver that supports such 1129 * is different from the size of the request. Any driver that supports such
@@ -1578,7 +1673,15 @@ static inline unsigned int bdev_zone_sectors(struct block_device *bdev)
1578 1673
1579 if (q) 1674 if (q)
1580 return blk_queue_zone_sectors(q); 1675 return blk_queue_zone_sectors(q);
1676 return 0;
1677}
1581 1678
1679static inline unsigned int bdev_nr_zones(struct block_device *bdev)
1680{
1681 struct request_queue *q = bdev_get_queue(bdev);
1682
1683 if (q)
1684 return blk_queue_nr_zones(q);
1582 return 0; 1685 return 0;
1583} 1686}
1584 1687
@@ -1714,8 +1817,6 @@ static inline bool req_gap_front_merge(struct request *req, struct bio *bio)
1714 1817
1715int kblockd_schedule_work(struct work_struct *work); 1818int kblockd_schedule_work(struct work_struct *work);
1716int kblockd_schedule_work_on(int cpu, struct work_struct *work); 1819int kblockd_schedule_work_on(int cpu, struct work_struct *work);
1717int kblockd_schedule_delayed_work(struct delayed_work *dwork, unsigned long delay);
1718int kblockd_schedule_delayed_work_on(int cpu, struct delayed_work *dwork, unsigned long delay);
1719int kblockd_mod_delayed_work_on(int cpu, struct delayed_work *dwork, unsigned long delay); 1820int kblockd_mod_delayed_work_on(int cpu, struct delayed_work *dwork, unsigned long delay);
1720 1821
1721#ifdef CONFIG_BLK_CGROUP 1822#ifdef CONFIG_BLK_CGROUP
@@ -1954,6 +2055,60 @@ extern int __blkdev_driver_ioctl(struct block_device *, fmode_t, unsigned int,
1954extern int bdev_read_page(struct block_device *, sector_t, struct page *); 2055extern int bdev_read_page(struct block_device *, sector_t, struct page *);
1955extern int bdev_write_page(struct block_device *, sector_t, struct page *, 2056extern int bdev_write_page(struct block_device *, sector_t, struct page *,
1956 struct writeback_control *); 2057 struct writeback_control *);
2058
2059#ifdef CONFIG_BLK_DEV_ZONED
2060bool blk_req_needs_zone_write_lock(struct request *rq);
2061void __blk_req_zone_write_lock(struct request *rq);
2062void __blk_req_zone_write_unlock(struct request *rq);
2063
2064static inline void blk_req_zone_write_lock(struct request *rq)
2065{
2066 if (blk_req_needs_zone_write_lock(rq))
2067 __blk_req_zone_write_lock(rq);
2068}
2069
2070static inline void blk_req_zone_write_unlock(struct request *rq)
2071{
2072 if (rq->rq_flags & RQF_ZONE_WRITE_LOCKED)
2073 __blk_req_zone_write_unlock(rq);
2074}
2075
2076static inline bool blk_req_zone_is_write_locked(struct request *rq)
2077{
2078 return rq->q->seq_zones_wlock &&
2079 test_bit(blk_rq_zone_no(rq), rq->q->seq_zones_wlock);
2080}
2081
2082static inline bool blk_req_can_dispatch_to_zone(struct request *rq)
2083{
2084 if (!blk_req_needs_zone_write_lock(rq))
2085 return true;
2086 return !blk_req_zone_is_write_locked(rq);
2087}
2088#else
2089static inline bool blk_req_needs_zone_write_lock(struct request *rq)
2090{
2091 return false;
2092}
2093
2094static inline void blk_req_zone_write_lock(struct request *rq)
2095{
2096}
2097
2098static inline void blk_req_zone_write_unlock(struct request *rq)
2099{
2100}
2101static inline bool blk_req_zone_is_write_locked(struct request *rq)
2102{
2103 return false;
2104}
2105
2106static inline bool blk_req_can_dispatch_to_zone(struct request *rq)
2107{
2108 return true;
2109}
2110#endif /* CONFIG_BLK_DEV_ZONED */
2111
1957#else /* CONFIG_BLOCK */ 2112#else /* CONFIG_BLOCK */
1958 2113
1959struct block_device; 2114struct block_device;
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index e55e4255a210..0b25cf87b6d6 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -43,7 +43,14 @@ struct bpf_map_ops {
43}; 43};
44 44
45struct bpf_map { 45struct bpf_map {
46 atomic_t refcnt; 46 /* 1st cacheline with read-mostly members of which some
47 * are also accessed in fast-path (e.g. ops, max_entries).
48 */
49 const struct bpf_map_ops *ops ____cacheline_aligned;
50 struct bpf_map *inner_map_meta;
51#ifdef CONFIG_SECURITY
52 void *security;
53#endif
47 enum bpf_map_type map_type; 54 enum bpf_map_type map_type;
48 u32 key_size; 55 u32 key_size;
49 u32 value_size; 56 u32 value_size;
@@ -52,15 +59,17 @@ struct bpf_map {
52 u32 pages; 59 u32 pages;
53 u32 id; 60 u32 id;
54 int numa_node; 61 int numa_node;
55 struct user_struct *user; 62 bool unpriv_array;
56 const struct bpf_map_ops *ops; 63 /* 7 bytes hole */
57 struct work_struct work; 64
65 /* 2nd cacheline with misc members to avoid false sharing
66 * particularly with refcounting.
67 */
68 struct user_struct *user ____cacheline_aligned;
69 atomic_t refcnt;
58 atomic_t usercnt; 70 atomic_t usercnt;
59 struct bpf_map *inner_map_meta; 71 struct work_struct work;
60 char name[BPF_OBJ_NAME_LEN]; 72 char name[BPF_OBJ_NAME_LEN];
61#ifdef CONFIG_SECURITY
62 void *security;
63#endif
64}; 73};
65 74
66/* function argument constraints */ 75/* function argument constraints */
@@ -221,6 +230,7 @@ struct bpf_prog_aux {
221struct bpf_array { 230struct bpf_array {
222 struct bpf_map map; 231 struct bpf_map map;
223 u32 elem_size; 232 u32 elem_size;
233 u32 index_mask;
224 /* 'ownership' of prog_array is claimed by the first program that 234 /* 'ownership' of prog_array is claimed by the first program that
225 * is going to use this map or by the first program which FD is stored 235 * is going to use this map or by the first program which FD is stored
226 * in the map to make sure that all callers and callees have the same 236 * in the map to make sure that all callers and callees have the same
@@ -419,6 +429,8 @@ static inline int bpf_map_attr_numa_node(const union bpf_attr *attr)
419 attr->numa_node : NUMA_NO_NODE; 429 attr->numa_node : NUMA_NO_NODE;
420} 430}
421 431
432struct bpf_prog *bpf_prog_get_type_path(const char *name, enum bpf_prog_type type);
433
422#else /* !CONFIG_BPF_SYSCALL */ 434#else /* !CONFIG_BPF_SYSCALL */
423static inline struct bpf_prog *bpf_prog_get(u32 ufd) 435static inline struct bpf_prog *bpf_prog_get(u32 ufd)
424{ 436{
@@ -506,6 +518,12 @@ static inline int cpu_map_enqueue(struct bpf_cpu_map_entry *rcpu,
506{ 518{
507 return 0; 519 return 0;
508} 520}
521
522static inline struct bpf_prog *bpf_prog_get_type_path(const char *name,
523 enum bpf_prog_type type)
524{
525 return ERR_PTR(-EOPNOTSUPP);
526}
509#endif /* CONFIG_BPF_SYSCALL */ 527#endif /* CONFIG_BPF_SYSCALL */
510 528
511static inline struct bpf_prog *bpf_prog_get_type(u32 ufd, 529static inline struct bpf_prog *bpf_prog_get_type(u32 ufd,
@@ -514,6 +532,8 @@ static inline struct bpf_prog *bpf_prog_get_type(u32 ufd,
514 return bpf_prog_get_type_dev(ufd, type, false); 532 return bpf_prog_get_type_dev(ufd, type, false);
515} 533}
516 534
535bool bpf_prog_get_ok(struct bpf_prog *, enum bpf_prog_type *, bool);
536
517int bpf_prog_offload_compile(struct bpf_prog *prog); 537int bpf_prog_offload_compile(struct bpf_prog *prog);
518void bpf_prog_offload_destroy(struct bpf_prog *prog); 538void bpf_prog_offload_destroy(struct bpf_prog *prog);
519 539
diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h
index c561b986bab0..1632bb13ad8a 100644
--- a/include/linux/bpf_verifier.h
+++ b/include/linux/bpf_verifier.h
@@ -15,11 +15,11 @@
15 * In practice this is far bigger than any realistic pointer offset; this limit 15 * In practice this is far bigger than any realistic pointer offset; this limit
16 * ensures that umax_value + (int)off + (int)size cannot overflow a u64. 16 * ensures that umax_value + (int)off + (int)size cannot overflow a u64.
17 */ 17 */
18#define BPF_MAX_VAR_OFF (1ULL << 31) 18#define BPF_MAX_VAR_OFF (1 << 29)
19/* Maximum variable size permitted for ARG_CONST_SIZE[_OR_ZERO]. This ensures 19/* Maximum variable size permitted for ARG_CONST_SIZE[_OR_ZERO]. This ensures
20 * that converting umax_value to int cannot overflow. 20 * that converting umax_value to int cannot overflow.
21 */ 21 */
22#define BPF_MAX_VAR_SIZ INT_MAX 22#define BPF_MAX_VAR_SIZ (1 << 29)
23 23
24/* Liveness marks, used for registers and spilled-regs (in stack slots). 24/* Liveness marks, used for registers and spilled-regs (in stack slots).
25 * Read marks propagate upwards until they find a write mark; they record that 25 * Read marks propagate upwards until they find a write mark; they record that
diff --git a/include/linux/bvec.h b/include/linux/bvec.h
index ec8a4d7af6bd..fe7a22dd133b 100644
--- a/include/linux/bvec.h
+++ b/include/linux/bvec.h
@@ -125,4 +125,13 @@ static inline bool bvec_iter_rewind(const struct bio_vec *bv,
125 ((bvl = bvec_iter_bvec((bio_vec), (iter))), 1); \ 125 ((bvl = bvec_iter_bvec((bio_vec), (iter))), 1); \
126 bvec_iter_advance((bio_vec), &(iter), (bvl).bv_len)) 126 bvec_iter_advance((bio_vec), &(iter), (bvl).bv_len))
127 127
128/* for iterating one bio from start to end */
129#define BVEC_ITER_ALL_INIT (struct bvec_iter) \
130{ \
131 .bi_sector = 0, \
132 .bi_size = UINT_MAX, \
133 .bi_idx = 0, \
134 .bi_bvec_done = 0, \
135}
136
128#endif /* __LINUX_BVEC_ITER_H */ 137#endif /* __LINUX_BVEC_ITER_H */
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 2272ded07496..631354acfa72 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -219,7 +219,7 @@
219/* Mark a function definition as prohibited from being cloned. */ 219/* Mark a function definition as prohibited from being cloned. */
220#define __noclone __attribute__((__noclone__, __optimize__("no-tracer"))) 220#define __noclone __attribute__((__noclone__, __optimize__("no-tracer")))
221 221
222#ifdef RANDSTRUCT_PLUGIN 222#if defined(RANDSTRUCT_PLUGIN) && !defined(__CHECKER__)
223#define __randomize_layout __attribute__((randomize_layout)) 223#define __randomize_layout __attribute__((randomize_layout))
224#define __no_randomize_layout __attribute__((no_randomize_layout)) 224#define __no_randomize_layout __attribute__((no_randomize_layout))
225#endif 225#endif
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 188ed9f65517..52e611ab9a6c 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -220,21 +220,21 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
220/* 220/*
221 * Prevent the compiler from merging or refetching reads or writes. The 221 * Prevent the compiler from merging or refetching reads or writes. The
222 * compiler is also forbidden from reordering successive instances of 222 * compiler is also forbidden from reordering successive instances of
223 * READ_ONCE, WRITE_ONCE and ACCESS_ONCE (see below), but only when the 223 * READ_ONCE and WRITE_ONCE, but only when the compiler is aware of some
224 * compiler is aware of some particular ordering. One way to make the 224 * particular ordering. One way to make the compiler aware of ordering is to
225 * compiler aware of ordering is to put the two invocations of READ_ONCE, 225 * put the two invocations of READ_ONCE or WRITE_ONCE in different C
226 * WRITE_ONCE or ACCESS_ONCE() in different C statements. 226 * statements.
227 * 227 *
228 * In contrast to ACCESS_ONCE these two macros will also work on aggregate 228 * These two macros will also work on aggregate data types like structs or
229 * data types like structs or unions. If the size of the accessed data 229 * unions. If the size of the accessed data type exceeds the word size of
230 * type exceeds the word size of the machine (e.g., 32 bits or 64 bits) 230 * the machine (e.g., 32 bits or 64 bits) READ_ONCE() and WRITE_ONCE() will
231 * READ_ONCE() and WRITE_ONCE() will fall back to memcpy(). There's at 231 * fall back to memcpy(). There's at least two memcpy()s: one for the
232 * least two memcpy()s: one for the __builtin_memcpy() and then one for 232 * __builtin_memcpy() and then one for the macro doing the copy of variable
233 * the macro doing the copy of variable - '__u' allocated on the stack. 233 * - '__u' allocated on the stack.
234 * 234 *
235 * Their two major use cases are: (1) Mediating communication between 235 * Their two major use cases are: (1) Mediating communication between
236 * process-level code and irq/NMI handlers, all running on the same CPU, 236 * process-level code and irq/NMI handlers, all running on the same CPU,
237 * and (2) Ensuring that the compiler does not fold, spindle, or otherwise 237 * and (2) Ensuring that the compiler does not fold, spindle, or otherwise
238 * mutilate accesses that either do not require ordering or that interact 238 * mutilate accesses that either do not require ordering or that interact
239 * with an explicit memory barrier or atomic instruction that provides the 239 * with an explicit memory barrier or atomic instruction that provides the
240 * required ordering. 240 * required ordering.
@@ -327,29 +327,4 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
327 compiletime_assert(__native_word(t), \ 327 compiletime_assert(__native_word(t), \
328 "Need native word sized stores/loads for atomicity.") 328 "Need native word sized stores/loads for atomicity.")
329 329
330/*
331 * Prevent the compiler from merging or refetching accesses. The compiler
332 * is also forbidden from reordering successive instances of ACCESS_ONCE(),
333 * but only when the compiler is aware of some particular ordering. One way
334 * to make the compiler aware of ordering is to put the two invocations of
335 * ACCESS_ONCE() in different C statements.
336 *
337 * ACCESS_ONCE will only work on scalar types. For union types, ACCESS_ONCE
338 * on a union member will work as long as the size of the member matches the
339 * size of the union and the size is smaller than word size.
340 *
341 * The major use cases of ACCESS_ONCE used to be (1) Mediating communication
342 * between process-level code and irq/NMI handlers, all running on the same CPU,
343 * and (2) Ensuring that the compiler does not fold, spindle, or otherwise
344 * mutilate accesses that either do not require ordering or that interact
345 * with an explicit memory barrier or atomic instruction that provides the
346 * required ordering.
347 *
348 * If possible use READ_ONCE()/WRITE_ONCE() instead.
349 */
350#define __ACCESS_ONCE(x) ({ \
351 __maybe_unused typeof(x) __var = (__force typeof(x)) 0; \
352 (volatile typeof(x) *)&(x); })
353#define ACCESS_ONCE(x) (*__ACCESS_ONCE(x))
354
355#endif /* __LINUX_COMPILER_H */ 330#endif /* __LINUX_COMPILER_H */
diff --git a/include/linux/completion.h b/include/linux/completion.h
index 0662a417febe..519e94915d18 100644
--- a/include/linux/completion.h
+++ b/include/linux/completion.h
@@ -10,9 +10,6 @@
10 */ 10 */
11 11
12#include <linux/wait.h> 12#include <linux/wait.h>
13#ifdef CONFIG_LOCKDEP_COMPLETIONS
14#include <linux/lockdep.h>
15#endif
16 13
17/* 14/*
18 * struct completion - structure used to maintain state for a "completion" 15 * struct completion - structure used to maintain state for a "completion"
@@ -29,58 +26,15 @@
29struct completion { 26struct completion {
30 unsigned int done; 27 unsigned int done;
31 wait_queue_head_t wait; 28 wait_queue_head_t wait;
32#ifdef CONFIG_LOCKDEP_COMPLETIONS
33 struct lockdep_map_cross map;
34#endif
35}; 29};
36 30
37#ifdef CONFIG_LOCKDEP_COMPLETIONS
38static inline void complete_acquire(struct completion *x)
39{
40 lock_acquire_exclusive((struct lockdep_map *)&x->map, 0, 0, NULL, _RET_IP_);
41}
42
43static inline void complete_release(struct completion *x)
44{
45 lock_release((struct lockdep_map *)&x->map, 0, _RET_IP_);
46}
47
48static inline void complete_release_commit(struct completion *x)
49{
50 lock_commit_crosslock((struct lockdep_map *)&x->map);
51}
52
53#define init_completion_map(x, m) \
54do { \
55 lockdep_init_map_crosslock((struct lockdep_map *)&(x)->map, \
56 (m)->name, (m)->key, 0); \
57 __init_completion(x); \
58} while (0)
59
60#define init_completion(x) \
61do { \
62 static struct lock_class_key __key; \
63 lockdep_init_map_crosslock((struct lockdep_map *)&(x)->map, \
64 "(completion)" #x, \
65 &__key, 0); \
66 __init_completion(x); \
67} while (0)
68#else
69#define init_completion_map(x, m) __init_completion(x) 31#define init_completion_map(x, m) __init_completion(x)
70#define init_completion(x) __init_completion(x) 32#define init_completion(x) __init_completion(x)
71static inline void complete_acquire(struct completion *x) {} 33static inline void complete_acquire(struct completion *x) {}
72static inline void complete_release(struct completion *x) {} 34static inline void complete_release(struct completion *x) {}
73static inline void complete_release_commit(struct completion *x) {}
74#endif
75 35
76#ifdef CONFIG_LOCKDEP_COMPLETIONS
77#define COMPLETION_INITIALIZER(work) \
78 { 0, __WAIT_QUEUE_HEAD_INITIALIZER((work).wait), \
79 STATIC_CROSS_LOCKDEP_MAP_INIT("(completion)" #work, &(work)) }
80#else
81#define COMPLETION_INITIALIZER(work) \ 36#define COMPLETION_INITIALIZER(work) \
82 { 0, __WAIT_QUEUE_HEAD_INITIALIZER((work).wait) } 37 { 0, __WAIT_QUEUE_HEAD_INITIALIZER((work).wait) }
83#endif
84 38
85#define COMPLETION_INITIALIZER_ONSTACK_MAP(work, map) \ 39#define COMPLETION_INITIALIZER_ONSTACK_MAP(work, map) \
86 (*({ init_completion_map(&(work), &(map)); &(work); })) 40 (*({ init_completion_map(&(work), &(map)); &(work); }))
diff --git a/include/linux/cper.h b/include/linux/cper.h
index 723e952fde0d..d14ef4e77c8a 100644
--- a/include/linux/cper.h
+++ b/include/linux/cper.h
@@ -275,6 +275,50 @@ enum {
275#define CPER_ARM_INFO_FLAGS_PROPAGATED BIT(2) 275#define CPER_ARM_INFO_FLAGS_PROPAGATED BIT(2)
276#define CPER_ARM_INFO_FLAGS_OVERFLOW BIT(3) 276#define CPER_ARM_INFO_FLAGS_OVERFLOW BIT(3)
277 277
278#define CPER_ARM_CACHE_ERROR 0
279#define CPER_ARM_TLB_ERROR 1
280#define CPER_ARM_BUS_ERROR 2
281#define CPER_ARM_VENDOR_ERROR 3
282#define CPER_ARM_MAX_TYPE CPER_ARM_VENDOR_ERROR
283
284#define CPER_ARM_ERR_VALID_TRANSACTION_TYPE BIT(0)
285#define CPER_ARM_ERR_VALID_OPERATION_TYPE BIT(1)
286#define CPER_ARM_ERR_VALID_LEVEL BIT(2)
287#define CPER_ARM_ERR_VALID_PROC_CONTEXT_CORRUPT BIT(3)
288#define CPER_ARM_ERR_VALID_CORRECTED BIT(4)
289#define CPER_ARM_ERR_VALID_PRECISE_PC BIT(5)
290#define CPER_ARM_ERR_VALID_RESTARTABLE_PC BIT(6)
291#define CPER_ARM_ERR_VALID_PARTICIPATION_TYPE BIT(7)
292#define CPER_ARM_ERR_VALID_TIME_OUT BIT(8)
293#define CPER_ARM_ERR_VALID_ADDRESS_SPACE BIT(9)
294#define CPER_ARM_ERR_VALID_MEM_ATTRIBUTES BIT(10)
295#define CPER_ARM_ERR_VALID_ACCESS_MODE BIT(11)
296
297#define CPER_ARM_ERR_TRANSACTION_SHIFT 16
298#define CPER_ARM_ERR_TRANSACTION_MASK GENMASK(1,0)
299#define CPER_ARM_ERR_OPERATION_SHIFT 18
300#define CPER_ARM_ERR_OPERATION_MASK GENMASK(3,0)
301#define CPER_ARM_ERR_LEVEL_SHIFT 22
302#define CPER_ARM_ERR_LEVEL_MASK GENMASK(2,0)
303#define CPER_ARM_ERR_PC_CORRUPT_SHIFT 25
304#define CPER_ARM_ERR_PC_CORRUPT_MASK GENMASK(0,0)
305#define CPER_ARM_ERR_CORRECTED_SHIFT 26
306#define CPER_ARM_ERR_CORRECTED_MASK GENMASK(0,0)
307#define CPER_ARM_ERR_PRECISE_PC_SHIFT 27
308#define CPER_ARM_ERR_PRECISE_PC_MASK GENMASK(0,0)
309#define CPER_ARM_ERR_RESTARTABLE_PC_SHIFT 28
310#define CPER_ARM_ERR_RESTARTABLE_PC_MASK GENMASK(0,0)
311#define CPER_ARM_ERR_PARTICIPATION_TYPE_SHIFT 29
312#define CPER_ARM_ERR_PARTICIPATION_TYPE_MASK GENMASK(1,0)
313#define CPER_ARM_ERR_TIME_OUT_SHIFT 31
314#define CPER_ARM_ERR_TIME_OUT_MASK GENMASK(0,0)
315#define CPER_ARM_ERR_ADDRESS_SPACE_SHIFT 32
316#define CPER_ARM_ERR_ADDRESS_SPACE_MASK GENMASK(1,0)
317#define CPER_ARM_ERR_MEM_ATTRIBUTES_SHIFT 34
318#define CPER_ARM_ERR_MEM_ATTRIBUTES_MASK GENMASK(8,0)
319#define CPER_ARM_ERR_ACCESS_MODE_SHIFT 43
320#define CPER_ARM_ERR_ACCESS_MODE_MASK GENMASK(0,0)
321
278/* 322/*
279 * All tables and structs must be byte-packed to match CPER 323 * All tables and structs must be byte-packed to match CPER
280 * specification, since the tables are provided by the system BIOS 324 * specification, since the tables are provided by the system BIOS
@@ -494,6 +538,8 @@ struct cper_sec_pcie {
494/* Reset to default packing */ 538/* Reset to default packing */
495#pragma pack() 539#pragma pack()
496 540
541extern const char * const cper_proc_error_type_strs[4];
542
497u64 cper_next_record_id(void); 543u64 cper_next_record_id(void);
498const char *cper_severity_str(unsigned int); 544const char *cper_severity_str(unsigned int);
499const char *cper_mem_err_type_str(unsigned int); 545const char *cper_mem_err_type_str(unsigned int);
@@ -503,5 +549,7 @@ void cper_mem_err_pack(const struct cper_sec_mem_err *,
503 struct cper_mem_err_compact *); 549 struct cper_mem_err_compact *);
504const char *cper_mem_err_unpack(struct trace_seq *, 550const char *cper_mem_err_unpack(struct trace_seq *,
505 struct cper_mem_err_compact *); 551 struct cper_mem_err_compact *);
552void cper_print_proc_arm(const char *pfx,
553 const struct cper_sec_proc_arm *proc);
506 554
507#endif 555#endif
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index a04ef7c15c6a..7b01bc11c692 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -47,6 +47,13 @@ extern void cpu_remove_dev_attr(struct device_attribute *attr);
47extern int cpu_add_dev_attr_group(struct attribute_group *attrs); 47extern int cpu_add_dev_attr_group(struct attribute_group *attrs);
48extern void cpu_remove_dev_attr_group(struct attribute_group *attrs); 48extern void cpu_remove_dev_attr_group(struct attribute_group *attrs);
49 49
50extern ssize_t cpu_show_meltdown(struct device *dev,
51 struct device_attribute *attr, char *buf);
52extern ssize_t cpu_show_spectre_v1(struct device *dev,
53 struct device_attribute *attr, char *buf);
54extern ssize_t cpu_show_spectre_v2(struct device *dev,
55 struct device_attribute *attr, char *buf);
56
50extern __printf(4, 5) 57extern __printf(4, 5)
51struct device *cpu_device_create(struct device *parent, void *drvdata, 58struct device *cpu_device_create(struct device *parent, void *drvdata,
52 const struct attribute_group **groups, 59 const struct attribute_group **groups,
diff --git a/include/linux/cpu_cooling.h b/include/linux/cpu_cooling.h
index d4292ebc5c8b..de0dafb9399d 100644
--- a/include/linux/cpu_cooling.h
+++ b/include/linux/cpu_cooling.h
@@ -30,9 +30,6 @@
30 30
31struct cpufreq_policy; 31struct cpufreq_policy;
32 32
33typedef int (*get_static_t)(cpumask_t *cpumask, int interval,
34 unsigned long voltage, u32 *power);
35
36#ifdef CONFIG_CPU_THERMAL 33#ifdef CONFIG_CPU_THERMAL
37/** 34/**
38 * cpufreq_cooling_register - function to create cpufreq cooling device. 35 * cpufreq_cooling_register - function to create cpufreq cooling device.
@@ -41,43 +38,6 @@ typedef int (*get_static_t)(cpumask_t *cpumask, int interval,
41struct thermal_cooling_device * 38struct thermal_cooling_device *
42cpufreq_cooling_register(struct cpufreq_policy *policy); 39cpufreq_cooling_register(struct cpufreq_policy *policy);
43 40
44struct thermal_cooling_device *
45cpufreq_power_cooling_register(struct cpufreq_policy *policy,
46 u32 capacitance, get_static_t plat_static_func);
47
48/**
49 * of_cpufreq_cooling_register - create cpufreq cooling device based on DT.
50 * @np: a valid struct device_node to the cooling device device tree node.
51 * @policy: cpufreq policy.
52 */
53#ifdef CONFIG_THERMAL_OF
54struct thermal_cooling_device *
55of_cpufreq_cooling_register(struct device_node *np,
56 struct cpufreq_policy *policy);
57
58struct thermal_cooling_device *
59of_cpufreq_power_cooling_register(struct device_node *np,
60 struct cpufreq_policy *policy,
61 u32 capacitance,
62 get_static_t plat_static_func);
63#else
64static inline struct thermal_cooling_device *
65of_cpufreq_cooling_register(struct device_node *np,
66 struct cpufreq_policy *policy)
67{
68 return ERR_PTR(-ENOSYS);
69}
70
71static inline struct thermal_cooling_device *
72of_cpufreq_power_cooling_register(struct device_node *np,
73 struct cpufreq_policy *policy,
74 u32 capacitance,
75 get_static_t plat_static_func)
76{
77 return NULL;
78}
79#endif
80
81/** 41/**
82 * cpufreq_cooling_unregister - function to remove cpufreq cooling device. 42 * cpufreq_cooling_unregister - function to remove cpufreq cooling device.
83 * @cdev: thermal cooling device pointer. 43 * @cdev: thermal cooling device pointer.
@@ -90,34 +50,27 @@ cpufreq_cooling_register(struct cpufreq_policy *policy)
90{ 50{
91 return ERR_PTR(-ENOSYS); 51 return ERR_PTR(-ENOSYS);
92} 52}
93static inline struct thermal_cooling_device *
94cpufreq_power_cooling_register(struct cpufreq_policy *policy,
95 u32 capacitance, get_static_t plat_static_func)
96{
97 return NULL;
98}
99 53
100static inline struct thermal_cooling_device * 54static inline
101of_cpufreq_cooling_register(struct device_node *np, 55void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)
102 struct cpufreq_policy *policy)
103{ 56{
104 return ERR_PTR(-ENOSYS); 57 return;
105} 58}
59#endif /* CONFIG_CPU_THERMAL */
106 60
61#if defined(CONFIG_THERMAL_OF) && defined(CONFIG_CPU_THERMAL)
62/**
63 * of_cpufreq_cooling_register - create cpufreq cooling device based on DT.
64 * @policy: cpufreq policy.
65 */
66struct thermal_cooling_device *
67of_cpufreq_cooling_register(struct cpufreq_policy *policy);
68#else
107static inline struct thermal_cooling_device * 69static inline struct thermal_cooling_device *
108of_cpufreq_power_cooling_register(struct device_node *np, 70of_cpufreq_cooling_register(struct cpufreq_policy *policy)
109 struct cpufreq_policy *policy,
110 u32 capacitance,
111 get_static_t plat_static_func)
112{ 71{
113 return NULL; 72 return NULL;
114} 73}
115 74#endif /* defined(CONFIG_THERMAL_OF) && defined(CONFIG_CPU_THERMAL) */
116static inline
117void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)
118{
119 return;
120}
121#endif /* CONFIG_CPU_THERMAL */
122 75
123#endif /* __CPU_COOLING_H__ */ 76#endif /* __CPU_COOLING_H__ */
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index 201ab7267986..1a32e558eb11 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -86,7 +86,7 @@ enum cpuhp_state {
86 CPUHP_MM_ZSWP_POOL_PREPARE, 86 CPUHP_MM_ZSWP_POOL_PREPARE,
87 CPUHP_KVM_PPC_BOOK3S_PREPARE, 87 CPUHP_KVM_PPC_BOOK3S_PREPARE,
88 CPUHP_ZCOMP_PREPARE, 88 CPUHP_ZCOMP_PREPARE,
89 CPUHP_TIMERS_DEAD, 89 CPUHP_TIMERS_PREPARE,
90 CPUHP_MIPS_SOC_PREPARE, 90 CPUHP_MIPS_SOC_PREPARE,
91 CPUHP_BP_PREPARE_DYN, 91 CPUHP_BP_PREPARE_DYN,
92 CPUHP_BP_PREPARE_DYN_END = CPUHP_BP_PREPARE_DYN + 20, 92 CPUHP_BP_PREPARE_DYN_END = CPUHP_BP_PREPARE_DYN + 20,
diff --git a/include/linux/crash_core.h b/include/linux/crash_core.h
index 06097ef30449..b511f6d24b42 100644
--- a/include/linux/crash_core.h
+++ b/include/linux/crash_core.h
@@ -42,6 +42,8 @@ phys_addr_t paddr_vmcoreinfo_note(void);
42 vmcoreinfo_append_str("PAGESIZE=%ld\n", value) 42 vmcoreinfo_append_str("PAGESIZE=%ld\n", value)
43#define VMCOREINFO_SYMBOL(name) \ 43#define VMCOREINFO_SYMBOL(name) \
44 vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)&name) 44 vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)&name)
45#define VMCOREINFO_SYMBOL_ARRAY(name) \
46 vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)name)
45#define VMCOREINFO_SIZE(name) \ 47#define VMCOREINFO_SIZE(name) \
46 vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \ 48 vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \
47 (unsigned long)sizeof(name)) 49 (unsigned long)sizeof(name))
diff --git a/include/linux/crc-ccitt.h b/include/linux/crc-ccitt.h
index cd4f420231ba..72c92c396bb8 100644
--- a/include/linux/crc-ccitt.h
+++ b/include/linux/crc-ccitt.h
@@ -5,12 +5,19 @@
5#include <linux/types.h> 5#include <linux/types.h>
6 6
7extern u16 const crc_ccitt_table[256]; 7extern u16 const crc_ccitt_table[256];
8extern u16 const crc_ccitt_false_table[256];
8 9
9extern u16 crc_ccitt(u16 crc, const u8 *buffer, size_t len); 10extern u16 crc_ccitt(u16 crc, const u8 *buffer, size_t len);
11extern u16 crc_ccitt_false(u16 crc, const u8 *buffer, size_t len);
10 12
11static inline u16 crc_ccitt_byte(u16 crc, const u8 c) 13static inline u16 crc_ccitt_byte(u16 crc, const u8 c)
12{ 14{
13 return (crc >> 8) ^ crc_ccitt_table[(crc ^ c) & 0xff]; 15 return (crc >> 8) ^ crc_ccitt_table[(crc ^ c) & 0xff];
14} 16}
15 17
18static inline u16 crc_ccitt_false_byte(u16 crc, const u8 c)
19{
20 return (crc << 8) ^ crc_ccitt_false_table[(crc >> 8) ^ c];
21}
22
16#endif /* _LINUX_CRC_CCITT_H */ 23#endif /* _LINUX_CRC_CCITT_H */
diff --git a/include/linux/cred.h b/include/linux/cred.h
index 099058e1178b..631286535d0f 100644
--- a/include/linux/cred.h
+++ b/include/linux/cred.h
@@ -83,6 +83,7 @@ extern int set_current_groups(struct group_info *);
83extern void set_groups(struct cred *, struct group_info *); 83extern void set_groups(struct cred *, struct group_info *);
84extern int groups_search(const struct group_info *, kgid_t); 84extern int groups_search(const struct group_info *, kgid_t);
85extern bool may_setgroups(void); 85extern bool may_setgroups(void);
86extern void groups_sort(struct group_info *);
86 87
87/* 88/*
88 * The security context of a task 89 * The security context of a task
diff --git a/include/linux/delayacct.h b/include/linux/delayacct.h
index 4178d2493547..5e335b6203f4 100644
--- a/include/linux/delayacct.h
+++ b/include/linux/delayacct.h
@@ -71,7 +71,7 @@ extern void delayacct_init(void);
71extern void __delayacct_tsk_init(struct task_struct *); 71extern void __delayacct_tsk_init(struct task_struct *);
72extern void __delayacct_tsk_exit(struct task_struct *); 72extern void __delayacct_tsk_exit(struct task_struct *);
73extern void __delayacct_blkio_start(void); 73extern void __delayacct_blkio_start(void);
74extern void __delayacct_blkio_end(void); 74extern void __delayacct_blkio_end(struct task_struct *);
75extern int __delayacct_add_tsk(struct taskstats *, struct task_struct *); 75extern int __delayacct_add_tsk(struct taskstats *, struct task_struct *);
76extern __u64 __delayacct_blkio_ticks(struct task_struct *); 76extern __u64 __delayacct_blkio_ticks(struct task_struct *);
77extern void __delayacct_freepages_start(void); 77extern void __delayacct_freepages_start(void);
@@ -122,10 +122,10 @@ static inline void delayacct_blkio_start(void)
122 __delayacct_blkio_start(); 122 __delayacct_blkio_start();
123} 123}
124 124
125static inline void delayacct_blkio_end(void) 125static inline void delayacct_blkio_end(struct task_struct *p)
126{ 126{
127 if (current->delays) 127 if (current->delays)
128 __delayacct_blkio_end(); 128 __delayacct_blkio_end(p);
129 delayacct_clear_flag(DELAYACCT_PF_BLKIO); 129 delayacct_clear_flag(DELAYACCT_PF_BLKIO);
130} 130}
131 131
@@ -169,7 +169,7 @@ static inline void delayacct_tsk_free(struct task_struct *tsk)
169{} 169{}
170static inline void delayacct_blkio_start(void) 170static inline void delayacct_blkio_start(void)
171{} 171{}
172static inline void delayacct_blkio_end(void) 172static inline void delayacct_blkio_end(struct task_struct *p)
173{} 173{}
174static inline int delayacct_add_tsk(struct taskstats *d, 174static inline int delayacct_add_tsk(struct taskstats *d,
175 struct task_struct *tsk) 175 struct task_struct *tsk)
diff --git a/include/linux/efi.h b/include/linux/efi.h
index d813f7b04da7..29fdf8029cf6 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -140,11 +140,13 @@ struct efi_boot_memmap {
140 140
141struct capsule_info { 141struct capsule_info {
142 efi_capsule_header_t header; 142 efi_capsule_header_t header;
143 efi_capsule_header_t *capsule;
143 int reset_type; 144 int reset_type;
144 long index; 145 long index;
145 size_t count; 146 size_t count;
146 size_t total_size; 147 size_t total_size;
147 phys_addr_t *pages; 148 struct page **pages;
149 phys_addr_t *phys;
148 size_t page_bytes_remain; 150 size_t page_bytes_remain;
149}; 151};
150 152
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index 3d794b3dc532..6d9e230dffd2 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -198,8 +198,6 @@ extern bool elv_attempt_insert_merge(struct request_queue *, struct request *);
198extern void elv_requeue_request(struct request_queue *, struct request *); 198extern void elv_requeue_request(struct request_queue *, struct request *);
199extern struct request *elv_former_request(struct request_queue *, struct request *); 199extern struct request *elv_former_request(struct request_queue *, struct request *);
200extern struct request *elv_latter_request(struct request_queue *, struct request *); 200extern struct request *elv_latter_request(struct request_queue *, struct request *);
201extern int elv_register_queue(struct request_queue *q);
202extern void elv_unregister_queue(struct request_queue *q);
203extern int elv_may_queue(struct request_queue *, unsigned int); 201extern int elv_may_queue(struct request_queue *, unsigned int);
204extern void elv_completed_request(struct request_queue *, struct request *); 202extern void elv_completed_request(struct request_queue *, struct request *);
205extern int elv_set_request(struct request_queue *q, struct request *rq, 203extern int elv_set_request(struct request_queue *q, struct request *rq,
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 511fbaabf624..6804d075933e 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -639,7 +639,7 @@ struct inode {
639 struct hlist_head i_dentry; 639 struct hlist_head i_dentry;
640 struct rcu_head i_rcu; 640 struct rcu_head i_rcu;
641 }; 641 };
642 u64 i_version; 642 atomic64_t i_version;
643 atomic_t i_count; 643 atomic_t i_count;
644 atomic_t i_dio_count; 644 atomic_t i_dio_count;
645 atomic_t i_writecount; 645 atomic_t i_writecount;
@@ -2036,21 +2036,6 @@ static inline void inode_dec_link_count(struct inode *inode)
2036 mark_inode_dirty(inode); 2036 mark_inode_dirty(inode);
2037} 2037}
2038 2038
2039/**
2040 * inode_inc_iversion - increments i_version
2041 * @inode: inode that need to be updated
2042 *
2043 * Every time the inode is modified, the i_version field will be incremented.
2044 * The filesystem has to be mounted with i_version flag
2045 */
2046
2047static inline void inode_inc_iversion(struct inode *inode)
2048{
2049 spin_lock(&inode->i_lock);
2050 inode->i_version++;
2051 spin_unlock(&inode->i_lock);
2052}
2053
2054enum file_time_flags { 2039enum file_time_flags {
2055 S_ATIME = 1, 2040 S_ATIME = 1,
2056 S_MTIME = 2, 2041 S_MTIME = 2,
diff --git a/include/linux/fscache.h b/include/linux/fscache.h
index f4ff47d4a893..fe0c349684fa 100644
--- a/include/linux/fscache.h
+++ b/include/linux/fscache.h
@@ -755,7 +755,7 @@ bool fscache_maybe_release_page(struct fscache_cookie *cookie,
755{ 755{
756 if (fscache_cookie_valid(cookie) && PageFsCache(page)) 756 if (fscache_cookie_valid(cookie) && PageFsCache(page))
757 return __fscache_maybe_release_page(cookie, page, gfp); 757 return __fscache_maybe_release_page(cookie, page, gfp);
758 return false; 758 return true;
759} 759}
760 760
761/** 761/**
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 2bab81951ced..9c3c9a319e48 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -332,6 +332,8 @@ extern int ftrace_text_reserved(const void *start, const void *end);
332 332
333extern int ftrace_nr_registered_ops(void); 333extern int ftrace_nr_registered_ops(void);
334 334
335struct ftrace_ops *ftrace_ops_trampoline(unsigned long addr);
336
335bool is_ftrace_trampoline(unsigned long addr); 337bool is_ftrace_trampoline(unsigned long addr);
336 338
337/* 339/*
@@ -764,9 +766,6 @@ typedef int (*trace_func_graph_ent_t)(struct ftrace_graph_ent *); /* entry */
764 766
765#ifdef CONFIG_FUNCTION_GRAPH_TRACER 767#ifdef CONFIG_FUNCTION_GRAPH_TRACER
766 768
767/* for init task */
768#define INIT_FTRACE_GRAPH .ret_stack = NULL,
769
770/* 769/*
771 * Stack of return addresses for functions 770 * Stack of return addresses for functions
772 * of a thread. 771 * of a thread.
@@ -844,7 +843,6 @@ static inline void unpause_graph_tracing(void)
844#else /* !CONFIG_FUNCTION_GRAPH_TRACER */ 843#else /* !CONFIG_FUNCTION_GRAPH_TRACER */
845 844
846#define __notrace_funcgraph 845#define __notrace_funcgraph
847#define INIT_FTRACE_GRAPH
848 846
849static inline void ftrace_graph_init_task(struct task_struct *t) { } 847static inline void ftrace_graph_init_task(struct task_struct *t) { }
850static inline void ftrace_graph_exit_task(struct task_struct *t) { } 848static inline void ftrace_graph_exit_task(struct task_struct *t) { }
@@ -923,10 +921,6 @@ extern int tracepoint_printk;
923extern void disable_trace_on_warning(void); 921extern void disable_trace_on_warning(void);
924extern int __disable_trace_on_warning; 922extern int __disable_trace_on_warning;
925 923
926#ifdef CONFIG_PREEMPT
927#define INIT_TRACE_RECURSION .trace_recursion = 0,
928#endif
929
930int tracepoint_printk_sysctl(struct ctl_table *table, int write, 924int tracepoint_printk_sysctl(struct ctl_table *table, int write,
931 void __user *buffer, size_t *lenp, 925 void __user *buffer, size_t *lenp,
932 loff_t *ppos); 926 loff_t *ppos);
@@ -935,10 +929,6 @@ int tracepoint_printk_sysctl(struct ctl_table *table, int write,
935static inline void disable_trace_on_warning(void) { } 929static inline void disable_trace_on_warning(void) { }
936#endif /* CONFIG_TRACING */ 930#endif /* CONFIG_TRACING */
937 931
938#ifndef INIT_TRACE_RECURSION
939#define INIT_TRACE_RECURSION
940#endif
941
942#ifdef CONFIG_FTRACE_SYSCALLS 932#ifdef CONFIG_FTRACE_SYSCALLS
943 933
944unsigned long arch_syscall_addr(int nr); 934unsigned long arch_syscall_addr(int nr);
diff --git a/include/linux/genetlink.h b/include/linux/genetlink.h
index ecc2928e8046..bc738504ab4a 100644
--- a/include/linux/genetlink.h
+++ b/include/linux/genetlink.h
@@ -31,8 +31,7 @@ extern wait_queue_head_t genl_sk_destructing_waitq;
31 * @p: The pointer to read, prior to dereferencing 31 * @p: The pointer to read, prior to dereferencing
32 * 32 *
33 * Return the value of the specified RCU-protected pointer, but omit 33 * Return the value of the specified RCU-protected pointer, but omit
34 * both the smp_read_barrier_depends() and the READ_ONCE(), because 34 * the READ_ONCE(), because caller holds genl mutex.
35 * caller holds genl mutex.
36 */ 35 */
37#define genl_dereference(p) \ 36#define genl_dereference(p) \
38 rcu_dereference_protected(p, lockdep_genl_is_held()) 37 rcu_dereference_protected(p, lockdep_genl_is_held())
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 5144ebe046c9..5e3531027b51 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -395,6 +395,11 @@ static inline void add_disk(struct gendisk *disk)
395{ 395{
396 device_add_disk(NULL, disk); 396 device_add_disk(NULL, disk);
397} 397}
398extern void device_add_disk_no_queue_reg(struct device *parent, struct gendisk *disk);
399static inline void add_disk_no_queue_reg(struct gendisk *disk)
400{
401 device_add_disk_no_queue_reg(NULL, disk);
402}
398 403
399extern void del_gendisk(struct gendisk *gp); 404extern void del_gendisk(struct gendisk *gp);
400extern struct gendisk *get_gendisk(dev_t dev, int *partno); 405extern struct gendisk *get_gendisk(dev_t dev, int *partno);
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index 55e672592fa9..7258cd676df4 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -66,9 +66,10 @@ struct gpio_irq_chip {
66 /** 66 /**
67 * @lock_key: 67 * @lock_key:
68 * 68 *
69 * Per GPIO IRQ chip lockdep class. 69 * Per GPIO IRQ chip lockdep classes.
70 */ 70 */
71 struct lock_class_key *lock_key; 71 struct lock_class_key *lock_key;
72 struct lock_class_key *request_key;
72 73
73 /** 74 /**
74 * @parent_handler: 75 * @parent_handler:
@@ -323,7 +324,8 @@ extern const char *gpiochip_is_requested(struct gpio_chip *chip,
323 324
324/* add/remove chips */ 325/* add/remove chips */
325extern int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data, 326extern int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data,
326 struct lock_class_key *lock_key); 327 struct lock_class_key *lock_key,
328 struct lock_class_key *request_key);
327 329
328/** 330/**
329 * gpiochip_add_data() - register a gpio_chip 331 * gpiochip_add_data() - register a gpio_chip
@@ -350,11 +352,13 @@ extern int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data,
350 */ 352 */
351#ifdef CONFIG_LOCKDEP 353#ifdef CONFIG_LOCKDEP
352#define gpiochip_add_data(chip, data) ({ \ 354#define gpiochip_add_data(chip, data) ({ \
353 static struct lock_class_key key; \ 355 static struct lock_class_key lock_key; \
354 gpiochip_add_data_with_key(chip, data, &key); \ 356 static struct lock_class_key request_key; \
357 gpiochip_add_data_with_key(chip, data, &lock_key, \
358 &request_key); \
355 }) 359 })
356#else 360#else
357#define gpiochip_add_data(chip, data) gpiochip_add_data_with_key(chip, data, NULL) 361#define gpiochip_add_data(chip, data) gpiochip_add_data_with_key(chip, data, NULL, NULL)
358#endif 362#endif
359 363
360static inline int gpiochip_add(struct gpio_chip *chip) 364static inline int gpiochip_add(struct gpio_chip *chip)
@@ -429,7 +433,8 @@ int gpiochip_irqchip_add_key(struct gpio_chip *gpiochip,
429 irq_flow_handler_t handler, 433 irq_flow_handler_t handler,
430 unsigned int type, 434 unsigned int type,
431 bool threaded, 435 bool threaded,
432 struct lock_class_key *lock_key); 436 struct lock_class_key *lock_key,
437 struct lock_class_key *request_key);
433 438
434#ifdef CONFIG_LOCKDEP 439#ifdef CONFIG_LOCKDEP
435 440
@@ -445,10 +450,12 @@ static inline int gpiochip_irqchip_add(struct gpio_chip *gpiochip,
445 irq_flow_handler_t handler, 450 irq_flow_handler_t handler,
446 unsigned int type) 451 unsigned int type)
447{ 452{
448 static struct lock_class_key key; 453 static struct lock_class_key lock_key;
454 static struct lock_class_key request_key;
449 455
450 return gpiochip_irqchip_add_key(gpiochip, irqchip, first_irq, 456 return gpiochip_irqchip_add_key(gpiochip, irqchip, first_irq,
451 handler, type, false, &key); 457 handler, type, false,
458 &lock_key, &request_key);
452} 459}
453 460
454static inline int gpiochip_irqchip_add_nested(struct gpio_chip *gpiochip, 461static inline int gpiochip_irqchip_add_nested(struct gpio_chip *gpiochip,
@@ -458,10 +465,12 @@ static inline int gpiochip_irqchip_add_nested(struct gpio_chip *gpiochip,
458 unsigned int type) 465 unsigned int type)
459{ 466{
460 467
461 static struct lock_class_key key; 468 static struct lock_class_key lock_key;
469 static struct lock_class_key request_key;
462 470
463 return gpiochip_irqchip_add_key(gpiochip, irqchip, first_irq, 471 return gpiochip_irqchip_add_key(gpiochip, irqchip, first_irq,
464 handler, type, true, &key); 472 handler, type, true,
473 &lock_key, &request_key);
465} 474}
466#else 475#else
467static inline int gpiochip_irqchip_add(struct gpio_chip *gpiochip, 476static inline int gpiochip_irqchip_add(struct gpio_chip *gpiochip,
@@ -471,7 +480,7 @@ static inline int gpiochip_irqchip_add(struct gpio_chip *gpiochip,
471 unsigned int type) 480 unsigned int type)
472{ 481{
473 return gpiochip_irqchip_add_key(gpiochip, irqchip, first_irq, 482 return gpiochip_irqchip_add_key(gpiochip, irqchip, first_irq,
474 handler, type, false, NULL); 483 handler, type, false, NULL, NULL);
475} 484}
476 485
477static inline int gpiochip_irqchip_add_nested(struct gpio_chip *gpiochip, 486static inline int gpiochip_irqchip_add_nested(struct gpio_chip *gpiochip,
@@ -481,7 +490,7 @@ static inline int gpiochip_irqchip_add_nested(struct gpio_chip *gpiochip,
481 unsigned int type) 490 unsigned int type)
482{ 491{
483 return gpiochip_irqchip_add_key(gpiochip, irqchip, first_irq, 492 return gpiochip_irqchip_add_key(gpiochip, irqchip, first_irq,
484 handler, type, true, NULL); 493 handler, type, true, NULL, NULL);
485} 494}
486#endif /* CONFIG_LOCKDEP */ 495#endif /* CONFIG_LOCKDEP */
487 496
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 012c37fdb688..c7902ca7c9f4 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -28,13 +28,29 @@ struct hrtimer_cpu_base;
28 28
29/* 29/*
30 * Mode arguments of xxx_hrtimer functions: 30 * Mode arguments of xxx_hrtimer functions:
31 *
32 * HRTIMER_MODE_ABS - Time value is absolute
33 * HRTIMER_MODE_REL - Time value is relative to now
34 * HRTIMER_MODE_PINNED - Timer is bound to CPU (is only considered
35 * when starting the timer)
36 * HRTIMER_MODE_SOFT - Timer callback function will be executed in
37 * soft irq context
31 */ 38 */
32enum hrtimer_mode { 39enum hrtimer_mode {
33 HRTIMER_MODE_ABS = 0x0, /* Time value is absolute */ 40 HRTIMER_MODE_ABS = 0x00,
34 HRTIMER_MODE_REL = 0x1, /* Time value is relative to now */ 41 HRTIMER_MODE_REL = 0x01,
35 HRTIMER_MODE_PINNED = 0x02, /* Timer is bound to CPU */ 42 HRTIMER_MODE_PINNED = 0x02,
36 HRTIMER_MODE_ABS_PINNED = 0x02, 43 HRTIMER_MODE_SOFT = 0x04,
37 HRTIMER_MODE_REL_PINNED = 0x03, 44
45 HRTIMER_MODE_ABS_PINNED = HRTIMER_MODE_ABS | HRTIMER_MODE_PINNED,
46 HRTIMER_MODE_REL_PINNED = HRTIMER_MODE_REL | HRTIMER_MODE_PINNED,
47
48 HRTIMER_MODE_ABS_SOFT = HRTIMER_MODE_ABS | HRTIMER_MODE_SOFT,
49 HRTIMER_MODE_REL_SOFT = HRTIMER_MODE_REL | HRTIMER_MODE_SOFT,
50
51 HRTIMER_MODE_ABS_PINNED_SOFT = HRTIMER_MODE_ABS_PINNED | HRTIMER_MODE_SOFT,
52 HRTIMER_MODE_REL_PINNED_SOFT = HRTIMER_MODE_REL_PINNED | HRTIMER_MODE_SOFT,
53
38}; 54};
39 55
40/* 56/*
@@ -87,6 +103,7 @@ enum hrtimer_restart {
87 * @base: pointer to the timer base (per cpu and per clock) 103 * @base: pointer to the timer base (per cpu and per clock)
88 * @state: state information (See bit values above) 104 * @state: state information (See bit values above)
89 * @is_rel: Set if the timer was armed relative 105 * @is_rel: Set if the timer was armed relative
106 * @is_soft: Set if hrtimer will be expired in soft interrupt context.
90 * 107 *
91 * The hrtimer structure must be initialized by hrtimer_init() 108 * The hrtimer structure must be initialized by hrtimer_init()
92 */ 109 */
@@ -97,6 +114,7 @@ struct hrtimer {
97 struct hrtimer_clock_base *base; 114 struct hrtimer_clock_base *base;
98 u8 state; 115 u8 state;
99 u8 is_rel; 116 u8 is_rel;
117 u8 is_soft;
100}; 118};
101 119
102/** 120/**
@@ -112,9 +130,9 @@ struct hrtimer_sleeper {
112}; 130};
113 131
114#ifdef CONFIG_64BIT 132#ifdef CONFIG_64BIT
115# define HRTIMER_CLOCK_BASE_ALIGN 64 133# define __hrtimer_clock_base_align ____cacheline_aligned
116#else 134#else
117# define HRTIMER_CLOCK_BASE_ALIGN 32 135# define __hrtimer_clock_base_align
118#endif 136#endif
119 137
120/** 138/**
@@ -123,48 +141,57 @@ struct hrtimer_sleeper {
123 * @index: clock type index for per_cpu support when moving a 141 * @index: clock type index for per_cpu support when moving a
124 * timer to a base on another cpu. 142 * timer to a base on another cpu.
125 * @clockid: clock id for per_cpu support 143 * @clockid: clock id for per_cpu support
144 * @seq: seqcount around __run_hrtimer
145 * @running: pointer to the currently running hrtimer
126 * @active: red black tree root node for the active timers 146 * @active: red black tree root node for the active timers
127 * @get_time: function to retrieve the current time of the clock 147 * @get_time: function to retrieve the current time of the clock
128 * @offset: offset of this clock to the monotonic base 148 * @offset: offset of this clock to the monotonic base
129 */ 149 */
130struct hrtimer_clock_base { 150struct hrtimer_clock_base {
131 struct hrtimer_cpu_base *cpu_base; 151 struct hrtimer_cpu_base *cpu_base;
132 int index; 152 unsigned int index;
133 clockid_t clockid; 153 clockid_t clockid;
154 seqcount_t seq;
155 struct hrtimer *running;
134 struct timerqueue_head active; 156 struct timerqueue_head active;
135 ktime_t (*get_time)(void); 157 ktime_t (*get_time)(void);
136 ktime_t offset; 158 ktime_t offset;
137} __attribute__((__aligned__(HRTIMER_CLOCK_BASE_ALIGN))); 159} __hrtimer_clock_base_align;
138 160
139enum hrtimer_base_type { 161enum hrtimer_base_type {
140 HRTIMER_BASE_MONOTONIC, 162 HRTIMER_BASE_MONOTONIC,
141 HRTIMER_BASE_REALTIME, 163 HRTIMER_BASE_REALTIME,
142 HRTIMER_BASE_BOOTTIME, 164 HRTIMER_BASE_BOOTTIME,
143 HRTIMER_BASE_TAI, 165 HRTIMER_BASE_TAI,
166 HRTIMER_BASE_MONOTONIC_SOFT,
167 HRTIMER_BASE_REALTIME_SOFT,
168 HRTIMER_BASE_BOOTTIME_SOFT,
169 HRTIMER_BASE_TAI_SOFT,
144 HRTIMER_MAX_CLOCK_BASES, 170 HRTIMER_MAX_CLOCK_BASES,
145}; 171};
146 172
147/* 173/**
148 * struct hrtimer_cpu_base - the per cpu clock bases 174 * struct hrtimer_cpu_base - the per cpu clock bases
149 * @lock: lock protecting the base and associated clock bases 175 * @lock: lock protecting the base and associated clock bases
150 * and timers 176 * and timers
151 * @seq: seqcount around __run_hrtimer
152 * @running: pointer to the currently running hrtimer
153 * @cpu: cpu number 177 * @cpu: cpu number
154 * @active_bases: Bitfield to mark bases with active timers 178 * @active_bases: Bitfield to mark bases with active timers
155 * @clock_was_set_seq: Sequence counter of clock was set events 179 * @clock_was_set_seq: Sequence counter of clock was set events
156 * @migration_enabled: The migration of hrtimers to other cpus is enabled
157 * @nohz_active: The nohz functionality is enabled
158 * @expires_next: absolute time of the next event which was scheduled
159 * via clock_set_next_event()
160 * @next_timer: Pointer to the first expiring timer
161 * @in_hrtirq: hrtimer_interrupt() is currently executing
162 * @hres_active: State of high resolution mode 180 * @hres_active: State of high resolution mode
181 * @in_hrtirq: hrtimer_interrupt() is currently executing
163 * @hang_detected: The last hrtimer interrupt detected a hang 182 * @hang_detected: The last hrtimer interrupt detected a hang
183 * @softirq_activated: displays, if the softirq is raised - update of softirq
184 * related settings is not required then.
164 * @nr_events: Total number of hrtimer interrupt events 185 * @nr_events: Total number of hrtimer interrupt events
165 * @nr_retries: Total number of hrtimer interrupt retries 186 * @nr_retries: Total number of hrtimer interrupt retries
166 * @nr_hangs: Total number of hrtimer interrupt hangs 187 * @nr_hangs: Total number of hrtimer interrupt hangs
167 * @max_hang_time: Maximum time spent in hrtimer_interrupt 188 * @max_hang_time: Maximum time spent in hrtimer_interrupt
189 * @expires_next: absolute time of the next event, is required for remote
190 * hrtimer enqueue; it is the total first expiry time (hard
191 * and soft hrtimer are taken into account)
192 * @next_timer: Pointer to the first expiring timer
193 * @softirq_expires_next: Time to check, if soft queues needs also to be expired
194 * @softirq_next_timer: Pointer to the first expiring softirq based timer
168 * @clock_base: array of clock bases for this cpu 195 * @clock_base: array of clock bases for this cpu
169 * 196 *
170 * Note: next_timer is just an optimization for __remove_hrtimer(). 197 * Note: next_timer is just an optimization for __remove_hrtimer().
@@ -173,31 +200,28 @@ enum hrtimer_base_type {
173 */ 200 */
174struct hrtimer_cpu_base { 201struct hrtimer_cpu_base {
175 raw_spinlock_t lock; 202 raw_spinlock_t lock;
176 seqcount_t seq;
177 struct hrtimer *running;
178 unsigned int cpu; 203 unsigned int cpu;
179 unsigned int active_bases; 204 unsigned int active_bases;
180 unsigned int clock_was_set_seq; 205 unsigned int clock_was_set_seq;
181 bool migration_enabled; 206 unsigned int hres_active : 1,
182 bool nohz_active; 207 in_hrtirq : 1,
208 hang_detected : 1,
209 softirq_activated : 1;
183#ifdef CONFIG_HIGH_RES_TIMERS 210#ifdef CONFIG_HIGH_RES_TIMERS
184 unsigned int in_hrtirq : 1,
185 hres_active : 1,
186 hang_detected : 1;
187 ktime_t expires_next;
188 struct hrtimer *next_timer;
189 unsigned int nr_events; 211 unsigned int nr_events;
190 unsigned int nr_retries; 212 unsigned short nr_retries;
191 unsigned int nr_hangs; 213 unsigned short nr_hangs;
192 unsigned int max_hang_time; 214 unsigned int max_hang_time;
193#endif 215#endif
216 ktime_t expires_next;
217 struct hrtimer *next_timer;
218 ktime_t softirq_expires_next;
219 struct hrtimer *softirq_next_timer;
194 struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES]; 220 struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES];
195} ____cacheline_aligned; 221} ____cacheline_aligned;
196 222
197static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time) 223static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time)
198{ 224{
199 BUILD_BUG_ON(sizeof(struct hrtimer_clock_base) > HRTIMER_CLOCK_BASE_ALIGN);
200
201 timer->node.expires = time; 225 timer->node.expires = time;
202 timer->_softexpires = time; 226 timer->_softexpires = time;
203} 227}
@@ -266,16 +290,17 @@ static inline ktime_t hrtimer_cb_get_time(struct hrtimer *timer)
266 return timer->base->get_time(); 290 return timer->base->get_time();
267} 291}
268 292
293static inline int hrtimer_is_hres_active(struct hrtimer *timer)
294{
295 return IS_ENABLED(CONFIG_HIGH_RES_TIMERS) ?
296 timer->base->cpu_base->hres_active : 0;
297}
298
269#ifdef CONFIG_HIGH_RES_TIMERS 299#ifdef CONFIG_HIGH_RES_TIMERS
270struct clock_event_device; 300struct clock_event_device;
271 301
272extern void hrtimer_interrupt(struct clock_event_device *dev); 302extern void hrtimer_interrupt(struct clock_event_device *dev);
273 303
274static inline int hrtimer_is_hres_active(struct hrtimer *timer)
275{
276 return timer->base->cpu_base->hres_active;
277}
278
279/* 304/*
280 * The resolution of the clocks. The resolution value is returned in 305 * The resolution of the clocks. The resolution value is returned in
281 * the clock_getres() system call to give application programmers an 306 * the clock_getres() system call to give application programmers an
@@ -298,11 +323,6 @@ extern unsigned int hrtimer_resolution;
298 323
299#define hrtimer_resolution (unsigned int)LOW_RES_NSEC 324#define hrtimer_resolution (unsigned int)LOW_RES_NSEC
300 325
301static inline int hrtimer_is_hres_active(struct hrtimer *timer)
302{
303 return 0;
304}
305
306static inline void clock_was_set_delayed(void) { } 326static inline void clock_was_set_delayed(void) { }
307 327
308#endif 328#endif
@@ -365,11 +385,12 @@ extern void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
365 u64 range_ns, const enum hrtimer_mode mode); 385 u64 range_ns, const enum hrtimer_mode mode);
366 386
367/** 387/**
368 * hrtimer_start - (re)start an hrtimer on the current CPU 388 * hrtimer_start - (re)start an hrtimer
369 * @timer: the timer to be added 389 * @timer: the timer to be added
370 * @tim: expiry time 390 * @tim: expiry time
371 * @mode: expiry mode: absolute (HRTIMER_MODE_ABS) or 391 * @mode: timer mode: absolute (HRTIMER_MODE_ABS) or
372 * relative (HRTIMER_MODE_REL) 392 * relative (HRTIMER_MODE_REL), and pinned (HRTIMER_MODE_PINNED);
393 * softirq based mode is considered for debug purpose only!
373 */ 394 */
374static inline void hrtimer_start(struct hrtimer *timer, ktime_t tim, 395static inline void hrtimer_start(struct hrtimer *timer, ktime_t tim,
375 const enum hrtimer_mode mode) 396 const enum hrtimer_mode mode)
@@ -422,7 +443,7 @@ static inline int hrtimer_is_queued(struct hrtimer *timer)
422 */ 443 */
423static inline int hrtimer_callback_running(struct hrtimer *timer) 444static inline int hrtimer_callback_running(struct hrtimer *timer)
424{ 445{
425 return timer->base->cpu_base->running == timer; 446 return timer->base->running == timer;
426} 447}
427 448
428/* Forward a hrtimer so it expires after now: */ 449/* Forward a hrtimer so it expires after now: */
@@ -466,7 +487,7 @@ extern int schedule_hrtimeout_range(ktime_t *expires, u64 delta,
466extern int schedule_hrtimeout_range_clock(ktime_t *expires, 487extern int schedule_hrtimeout_range_clock(ktime_t *expires,
467 u64 delta, 488 u64 delta,
468 const enum hrtimer_mode mode, 489 const enum hrtimer_mode mode,
469 int clock); 490 clockid_t clock_id);
470extern int schedule_hrtimeout(ktime_t *expires, const enum hrtimer_mode mode); 491extern int schedule_hrtimeout(ktime_t *expires, const enum hrtimer_mode mode);
471 492
472/* Soft interrupt function to run the hrtimer queues: */ 493/* Soft interrupt function to run the hrtimer queues: */
diff --git a/include/linux/idr.h b/include/linux/idr.h
index 7c3a365f7e12..fa14f834e4ed 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -15,6 +15,7 @@
15#include <linux/radix-tree.h> 15#include <linux/radix-tree.h>
16#include <linux/gfp.h> 16#include <linux/gfp.h>
17#include <linux/percpu.h> 17#include <linux/percpu.h>
18#include <linux/bug.h>
18 19
19struct idr { 20struct idr {
20 struct radix_tree_root idr_rt; 21 struct radix_tree_root idr_rt;
diff --git a/include/linux/iio/adc/stm32-dfsdm-adc.h b/include/linux/iio/adc/stm32-dfsdm-adc.h
new file mode 100644
index 000000000000..e7dc7a542a4e
--- /dev/null
+++ b/include/linux/iio/adc/stm32-dfsdm-adc.h
@@ -0,0 +1,18 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * This file discribe the STM32 DFSDM IIO driver API for audio part
4 *
5 * Copyright (C) 2017, STMicroelectronics - All Rights Reserved
6 * Author(s): Arnaud Pouliquen <arnaud.pouliquen@st.com>.
7 */
8
9#ifndef STM32_DFSDM_ADC_H
10#define STM32_DFSDM_ADC_H
11
12int stm32_dfsdm_get_buff_cb(struct iio_dev *iio_dev,
13 int (*cb)(const void *data, size_t size,
14 void *private),
15 void *private);
16int stm32_dfsdm_release_buff_cb(struct iio_dev *iio_dev);
17
18#endif
diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h
index 5e347a9805fd..9887f4f8e2a8 100644
--- a/include/linux/iio/consumer.h
+++ b/include/linux/iio/consumer.h
@@ -134,6 +134,17 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev,
134 void *private), 134 void *private),
135 void *private); 135 void *private);
136/** 136/**
137 * iio_channel_cb_set_buffer_watermark() - set the buffer watermark.
138 * @cb_buffer: The callback buffer from whom we want the channel
139 * information.
140 * @watermark: buffer watermark in bytes.
141 *
142 * This function allows to configure the buffer watermark.
143 */
144int iio_channel_cb_set_buffer_watermark(struct iio_cb_buffer *cb_buffer,
145 size_t watermark);
146
147/**
137 * iio_channel_release_all_cb() - release and unregister the callback. 148 * iio_channel_release_all_cb() - release and unregister the callback.
138 * @cb_buffer: The callback buffer that was allocated. 149 * @cb_buffer: The callback buffer that was allocated.
139 */ 150 */
@@ -216,6 +227,32 @@ int iio_read_channel_average_raw(struct iio_channel *chan, int *val);
216int iio_read_channel_processed(struct iio_channel *chan, int *val); 227int iio_read_channel_processed(struct iio_channel *chan, int *val);
217 228
218/** 229/**
230 * iio_write_channel_attribute() - Write values to the device attribute.
231 * @chan: The channel being queried.
232 * @val: Value being written.
233 * @val2: Value being written.val2 use depends on attribute type.
234 * @attribute: info attribute to be read.
235 *
236 * Returns an error code or 0.
237 */
238int iio_write_channel_attribute(struct iio_channel *chan, int val,
239 int val2, enum iio_chan_info_enum attribute);
240
241/**
242 * iio_read_channel_attribute() - Read values from the device attribute.
243 * @chan: The channel being queried.
244 * @val: Value being written.
245 * @val2: Value being written.Val2 use depends on attribute type.
246 * @attribute: info attribute to be written.
247 *
248 * Returns an error code if failed. Else returns a description of what is in val
249 * and val2, such as IIO_VAL_INT_PLUS_MICRO telling us we have a value of val
250 * + val2/1e6
251 */
252int iio_read_channel_attribute(struct iio_channel *chan, int *val,
253 int *val2, enum iio_chan_info_enum attribute);
254
255/**
219 * iio_write_channel_raw() - write to a given channel 256 * iio_write_channel_raw() - write to a given channel
220 * @chan: The channel being queried. 257 * @chan: The channel being queried.
221 * @val: Value being written. 258 * @val: Value being written.
diff --git a/include/linux/iio/hw-consumer.h b/include/linux/iio/hw-consumer.h
new file mode 100644
index 000000000000..44d48bb1d39f
--- /dev/null
+++ b/include/linux/iio/hw-consumer.h
@@ -0,0 +1,21 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Industrial I/O in kernel hardware consumer interface
4 *
5 * Copyright 2017 Analog Devices Inc.
6 * Author: Lars-Peter Clausen <lars@metafoo.de>
7 */
8
9#ifndef LINUX_IIO_HW_CONSUMER_H
10#define LINUX_IIO_HW_CONSUMER_H
11
12struct iio_hw_consumer;
13
14struct iio_hw_consumer *iio_hw_consumer_alloc(struct device *dev);
15void iio_hw_consumer_free(struct iio_hw_consumer *hwc);
16struct iio_hw_consumer *devm_iio_hw_consumer_alloc(struct device *dev);
17void devm_iio_hw_consumer_free(struct device *dev, struct iio_hw_consumer *hwc);
18int iio_hw_consumer_enable(struct iio_hw_consumer *hwc);
19void iio_hw_consumer_disable(struct iio_hw_consumer *hwc);
20
21#endif
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index 20b61347ea58..f12a61be1ede 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -20,34 +20,6 @@
20 * Currently assumes nano seconds. 20 * Currently assumes nano seconds.
21 */ 21 */
22 22
23enum iio_chan_info_enum {
24 IIO_CHAN_INFO_RAW = 0,
25 IIO_CHAN_INFO_PROCESSED,
26 IIO_CHAN_INFO_SCALE,
27 IIO_CHAN_INFO_OFFSET,
28 IIO_CHAN_INFO_CALIBSCALE,
29 IIO_CHAN_INFO_CALIBBIAS,
30 IIO_CHAN_INFO_PEAK,
31 IIO_CHAN_INFO_PEAK_SCALE,
32 IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW,
33 IIO_CHAN_INFO_AVERAGE_RAW,
34 IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY,
35 IIO_CHAN_INFO_HIGH_PASS_FILTER_3DB_FREQUENCY,
36 IIO_CHAN_INFO_SAMP_FREQ,
37 IIO_CHAN_INFO_FREQUENCY,
38 IIO_CHAN_INFO_PHASE,
39 IIO_CHAN_INFO_HARDWAREGAIN,
40 IIO_CHAN_INFO_HYSTERESIS,
41 IIO_CHAN_INFO_INT_TIME,
42 IIO_CHAN_INFO_ENABLE,
43 IIO_CHAN_INFO_CALIBHEIGHT,
44 IIO_CHAN_INFO_CALIBWEIGHT,
45 IIO_CHAN_INFO_DEBOUNCE_COUNT,
46 IIO_CHAN_INFO_DEBOUNCE_TIME,
47 IIO_CHAN_INFO_CALIBEMISSIVITY,
48 IIO_CHAN_INFO_OVERSAMPLING_RATIO,
49};
50
51enum iio_shared_by { 23enum iio_shared_by {
52 IIO_SEPARATE, 24 IIO_SEPARATE,
53 IIO_SHARED_BY_TYPE, 25 IIO_SHARED_BY_TYPE,
diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h
index 2aa7b6384d64..6eb3d683ef62 100644
--- a/include/linux/iio/types.h
+++ b/include/linux/iio/types.h
@@ -34,4 +34,32 @@ enum iio_available_type {
34 IIO_AVAIL_RANGE, 34 IIO_AVAIL_RANGE,
35}; 35};
36 36
37enum iio_chan_info_enum {
38 IIO_CHAN_INFO_RAW = 0,
39 IIO_CHAN_INFO_PROCESSED,
40 IIO_CHAN_INFO_SCALE,
41 IIO_CHAN_INFO_OFFSET,
42 IIO_CHAN_INFO_CALIBSCALE,
43 IIO_CHAN_INFO_CALIBBIAS,
44 IIO_CHAN_INFO_PEAK,
45 IIO_CHAN_INFO_PEAK_SCALE,
46 IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW,
47 IIO_CHAN_INFO_AVERAGE_RAW,
48 IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY,
49 IIO_CHAN_INFO_HIGH_PASS_FILTER_3DB_FREQUENCY,
50 IIO_CHAN_INFO_SAMP_FREQ,
51 IIO_CHAN_INFO_FREQUENCY,
52 IIO_CHAN_INFO_PHASE,
53 IIO_CHAN_INFO_HARDWAREGAIN,
54 IIO_CHAN_INFO_HYSTERESIS,
55 IIO_CHAN_INFO_INT_TIME,
56 IIO_CHAN_INFO_ENABLE,
57 IIO_CHAN_INFO_CALIBHEIGHT,
58 IIO_CHAN_INFO_CALIBWEIGHT,
59 IIO_CHAN_INFO_DEBOUNCE_COUNT,
60 IIO_CHAN_INFO_DEBOUNCE_TIME,
61 IIO_CHAN_INFO_CALIBEMISSIVITY,
62 IIO_CHAN_INFO_OVERSAMPLING_RATIO,
63};
64
37#endif /* _IIO_TYPES_H_ */ 65#endif /* _IIO_TYPES_H_ */
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 6a532629c983..a454b8aeb938 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -21,22 +21,11 @@
21 21
22#include <asm/thread_info.h> 22#include <asm/thread_info.h>
23 23
24#ifdef CONFIG_SMP
25# define INIT_PUSHABLE_TASKS(tsk) \
26 .pushable_tasks = PLIST_NODE_INIT(tsk.pushable_tasks, MAX_PRIO),
27#else
28# define INIT_PUSHABLE_TASKS(tsk)
29#endif
30
31extern struct files_struct init_files; 24extern struct files_struct init_files;
32extern struct fs_struct init_fs; 25extern struct fs_struct init_fs;
33 26extern struct nsproxy init_nsproxy;
34#ifdef CONFIG_CPUSETS 27extern struct group_info init_groups;
35#define INIT_CPUSET_SEQ(tsk) \ 28extern struct cred init_cred;
36 .mems_allowed_seq = SEQCNT_ZERO(tsk.mems_allowed_seq),
37#else
38#define INIT_CPUSET_SEQ(tsk)
39#endif
40 29
41#ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE 30#ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
42#define INIT_PREV_CPUTIME(x) .prev_cputime = { \ 31#define INIT_PREV_CPUTIME(x) .prev_cputime = { \
@@ -47,67 +36,16 @@ extern struct fs_struct init_fs;
47#endif 36#endif
48 37
49#ifdef CONFIG_POSIX_TIMERS 38#ifdef CONFIG_POSIX_TIMERS
50#define INIT_POSIX_TIMERS(s) \
51 .posix_timers = LIST_HEAD_INIT(s.posix_timers),
52#define INIT_CPU_TIMERS(s) \ 39#define INIT_CPU_TIMERS(s) \
53 .cpu_timers = { \ 40 .cpu_timers = { \
54 LIST_HEAD_INIT(s.cpu_timers[0]), \ 41 LIST_HEAD_INIT(s.cpu_timers[0]), \
55 LIST_HEAD_INIT(s.cpu_timers[1]), \ 42 LIST_HEAD_INIT(s.cpu_timers[1]), \
56 LIST_HEAD_INIT(s.cpu_timers[2]), \ 43 LIST_HEAD_INIT(s.cpu_timers[2]), \
57 },
58#define INIT_CPUTIMER(s) \
59 .cputimer = { \
60 .cputime_atomic = INIT_CPUTIME_ATOMIC, \
61 .running = false, \
62 .checking_timer = false, \
63 }, 44 },
64#else 45#else
65#define INIT_POSIX_TIMERS(s)
66#define INIT_CPU_TIMERS(s) 46#define INIT_CPU_TIMERS(s)
67#define INIT_CPUTIMER(s)
68#endif 47#endif
69 48
70#define INIT_SIGNALS(sig) { \
71 .nr_threads = 1, \
72 .thread_head = LIST_HEAD_INIT(init_task.thread_node), \
73 .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\
74 .shared_pending = { \
75 .list = LIST_HEAD_INIT(sig.shared_pending.list), \
76 .signal = {{0}}}, \
77 INIT_POSIX_TIMERS(sig) \
78 INIT_CPU_TIMERS(sig) \
79 .rlim = INIT_RLIMITS, \
80 INIT_CPUTIMER(sig) \
81 INIT_PREV_CPUTIME(sig) \
82 .cred_guard_mutex = \
83 __MUTEX_INITIALIZER(sig.cred_guard_mutex), \
84}
85
86extern struct nsproxy init_nsproxy;
87
88#define INIT_SIGHAND(sighand) { \
89 .count = ATOMIC_INIT(1), \
90 .action = { { { .sa_handler = SIG_DFL, } }, }, \
91 .siglock = __SPIN_LOCK_UNLOCKED(sighand.siglock), \
92 .signalfd_wqh = __WAIT_QUEUE_HEAD_INITIALIZER(sighand.signalfd_wqh), \
93}
94
95extern struct group_info init_groups;
96
97#define INIT_STRUCT_PID { \
98 .count = ATOMIC_INIT(1), \
99 .tasks = { \
100 { .first = NULL }, \
101 { .first = NULL }, \
102 { .first = NULL }, \
103 }, \
104 .level = 0, \
105 .numbers = { { \
106 .nr = 0, \
107 .ns = &init_pid_ns, \
108 }, } \
109}
110
111#define INIT_PID_LINK(type) \ 49#define INIT_PID_LINK(type) \
112{ \ 50{ \
113 .node = { \ 51 .node = { \
@@ -117,192 +55,16 @@ extern struct group_info init_groups;
117 .pid = &init_struct_pid, \ 55 .pid = &init_struct_pid, \
118} 56}
119 57
120#ifdef CONFIG_AUDITSYSCALL
121#define INIT_IDS \
122 .loginuid = INVALID_UID, \
123 .sessionid = (unsigned int)-1,
124#else
125#define INIT_IDS
126#endif
127
128#ifdef CONFIG_PREEMPT_RCU
129#define INIT_TASK_RCU_PREEMPT(tsk) \
130 .rcu_read_lock_nesting = 0, \
131 .rcu_read_unlock_special.s = 0, \
132 .rcu_node_entry = LIST_HEAD_INIT(tsk.rcu_node_entry), \
133 .rcu_blocked_node = NULL,
134#else
135#define INIT_TASK_RCU_PREEMPT(tsk)
136#endif
137#ifdef CONFIG_TASKS_RCU
138#define INIT_TASK_RCU_TASKS(tsk) \
139 .rcu_tasks_holdout = false, \
140 .rcu_tasks_holdout_list = \
141 LIST_HEAD_INIT(tsk.rcu_tasks_holdout_list), \
142 .rcu_tasks_idle_cpu = -1,
143#else
144#define INIT_TASK_RCU_TASKS(tsk)
145#endif
146
147extern struct cred init_cred;
148
149#ifdef CONFIG_CGROUP_SCHED
150# define INIT_CGROUP_SCHED(tsk) \
151 .sched_task_group = &root_task_group,
152#else
153# define INIT_CGROUP_SCHED(tsk)
154#endif
155
156#ifdef CONFIG_PERF_EVENTS
157# define INIT_PERF_EVENTS(tsk) \
158 .perf_event_mutex = \
159 __MUTEX_INITIALIZER(tsk.perf_event_mutex), \
160 .perf_event_list = LIST_HEAD_INIT(tsk.perf_event_list),
161#else
162# define INIT_PERF_EVENTS(tsk)
163#endif
164
165#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
166# define INIT_VTIME(tsk) \
167 .vtime.seqcount = SEQCNT_ZERO(tsk.vtime.seqcount), \
168 .vtime.starttime = 0, \
169 .vtime.state = VTIME_SYS,
170#else
171# define INIT_VTIME(tsk)
172#endif
173
174#define INIT_TASK_COMM "swapper" 58#define INIT_TASK_COMM "swapper"
175 59
176#ifdef CONFIG_RT_MUTEXES
177# define INIT_RT_MUTEXES(tsk) \
178 .pi_waiters = RB_ROOT_CACHED, \
179 .pi_top_task = NULL,
180#else
181# define INIT_RT_MUTEXES(tsk)
182#endif
183
184#ifdef CONFIG_NUMA_BALANCING
185# define INIT_NUMA_BALANCING(tsk) \
186 .numa_preferred_nid = -1, \
187 .numa_group = NULL, \
188 .numa_faults = NULL,
189#else
190# define INIT_NUMA_BALANCING(tsk)
191#endif
192
193#ifdef CONFIG_KASAN
194# define INIT_KASAN(tsk) \
195 .kasan_depth = 1,
196#else
197# define INIT_KASAN(tsk)
198#endif
199
200#ifdef CONFIG_LIVEPATCH
201# define INIT_LIVEPATCH(tsk) \
202 .patch_state = KLP_UNDEFINED,
203#else
204# define INIT_LIVEPATCH(tsk)
205#endif
206
207#ifdef CONFIG_THREAD_INFO_IN_TASK
208# define INIT_TASK_TI(tsk) \
209 .thread_info = INIT_THREAD_INFO(tsk), \
210 .stack_refcount = ATOMIC_INIT(1),
211#else
212# define INIT_TASK_TI(tsk)
213#endif
214
215#ifdef CONFIG_SECURITY
216#define INIT_TASK_SECURITY .security = NULL,
217#else
218#define INIT_TASK_SECURITY
219#endif
220
221/*
222 * INIT_TASK is used to set up the first task table, touch at
223 * your own risk!. Base=0, limit=0x1fffff (=2MB)
224 */
225#define INIT_TASK(tsk) \
226{ \
227 INIT_TASK_TI(tsk) \
228 .state = 0, \
229 .stack = init_stack, \
230 .usage = ATOMIC_INIT(2), \
231 .flags = PF_KTHREAD, \
232 .prio = MAX_PRIO-20, \
233 .static_prio = MAX_PRIO-20, \
234 .normal_prio = MAX_PRIO-20, \
235 .policy = SCHED_NORMAL, \
236 .cpus_allowed = CPU_MASK_ALL, \
237 .nr_cpus_allowed= NR_CPUS, \
238 .mm = NULL, \
239 .active_mm = &init_mm, \
240 .restart_block = { \
241 .fn = do_no_restart_syscall, \
242 }, \
243 .se = { \
244 .group_node = LIST_HEAD_INIT(tsk.se.group_node), \
245 }, \
246 .rt = { \
247 .run_list = LIST_HEAD_INIT(tsk.rt.run_list), \
248 .time_slice = RR_TIMESLICE, \
249 }, \
250 .tasks = LIST_HEAD_INIT(tsk.tasks), \
251 INIT_PUSHABLE_TASKS(tsk) \
252 INIT_CGROUP_SCHED(tsk) \
253 .ptraced = LIST_HEAD_INIT(tsk.ptraced), \
254 .ptrace_entry = LIST_HEAD_INIT(tsk.ptrace_entry), \
255 .real_parent = &tsk, \
256 .parent = &tsk, \
257 .children = LIST_HEAD_INIT(tsk.children), \
258 .sibling = LIST_HEAD_INIT(tsk.sibling), \
259 .group_leader = &tsk, \
260 RCU_POINTER_INITIALIZER(real_cred, &init_cred), \
261 RCU_POINTER_INITIALIZER(cred, &init_cred), \
262 .comm = INIT_TASK_COMM, \
263 .thread = INIT_THREAD, \
264 .fs = &init_fs, \
265 .files = &init_files, \
266 .signal = &init_signals, \
267 .sighand = &init_sighand, \
268 .nsproxy = &init_nsproxy, \
269 .pending = { \
270 .list = LIST_HEAD_INIT(tsk.pending.list), \
271 .signal = {{0}}}, \
272 .blocked = {{0}}, \
273 .alloc_lock = __SPIN_LOCK_UNLOCKED(tsk.alloc_lock), \
274 .journal_info = NULL, \
275 INIT_CPU_TIMERS(tsk) \
276 .pi_lock = __RAW_SPIN_LOCK_UNLOCKED(tsk.pi_lock), \
277 .timer_slack_ns = 50000, /* 50 usec default slack */ \
278 .pids = { \
279 [PIDTYPE_PID] = INIT_PID_LINK(PIDTYPE_PID), \
280 [PIDTYPE_PGID] = INIT_PID_LINK(PIDTYPE_PGID), \
281 [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \
282 }, \
283 .thread_group = LIST_HEAD_INIT(tsk.thread_group), \
284 .thread_node = LIST_HEAD_INIT(init_signals.thread_head), \
285 INIT_IDS \
286 INIT_PERF_EVENTS(tsk) \
287 INIT_TRACE_IRQFLAGS \
288 INIT_LOCKDEP \
289 INIT_FTRACE_GRAPH \
290 INIT_TRACE_RECURSION \
291 INIT_TASK_RCU_PREEMPT(tsk) \
292 INIT_TASK_RCU_TASKS(tsk) \
293 INIT_CPUSET_SEQ(tsk) \
294 INIT_RT_MUTEXES(tsk) \
295 INIT_PREV_CPUTIME(tsk) \
296 INIT_VTIME(tsk) \
297 INIT_NUMA_BALANCING(tsk) \
298 INIT_KASAN(tsk) \
299 INIT_LIVEPATCH(tsk) \
300 INIT_TASK_SECURITY \
301}
302
303
304/* Attach to the init_task data structure for proper alignment */ 60/* Attach to the init_task data structure for proper alignment */
61#ifdef CONFIG_ARCH_TASK_STRUCT_ON_STACK
305#define __init_task_data __attribute__((__section__(".data..init_task"))) 62#define __init_task_data __attribute__((__section__(".data..init_task")))
63#else
64#define __init_task_data /**/
65#endif
306 66
67/* Attach to the thread_info data structure for proper alignment */
68#define __init_thread_info __attribute__((__section__(".data..init_thread_info")))
307 69
308#endif 70#endif
diff --git a/include/linux/intel-pti.h b/include/linux/intel-pti.h
new file mode 100644
index 000000000000..2710d72de3c9
--- /dev/null
+++ b/include/linux/intel-pti.h
@@ -0,0 +1,43 @@
1/*
2 * Copyright (C) Intel 2011
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14 *
15 * The PTI (Parallel Trace Interface) driver directs trace data routed from
16 * various parts in the system out through the Intel Penwell PTI port and
17 * out of the mobile device for analysis with a debugging tool
18 * (Lauterbach, Fido). This is part of a solution for the MIPI P1149.7,
19 * compact JTAG, standard.
20 *
21 * This header file will allow other parts of the OS to use the
22 * interface to write out it's contents for debugging a mobile system.
23 */
24
25#ifndef LINUX_INTEL_PTI_H_
26#define LINUX_INTEL_PTI_H_
27
28/* offset for last dword of any PTI message. Part of MIPI P1149.7 */
29#define PTI_LASTDWORD_DTS 0x30
30
31/* basic structure used as a write address to the PTI HW */
32struct pti_masterchannel {
33 u8 master;
34 u8 channel;
35};
36
37/* the following functions are defined in misc/pti.c */
38void pti_writedata(struct pti_masterchannel *mc, u8 *buf, int count);
39struct pti_masterchannel *pti_request_masterchannel(u8 type,
40 const char *thread_name);
41void pti_release_masterchannel(struct pti_masterchannel *mc);
42
43#endif /* LINUX_INTEL_PTI_H_ */
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index cb18c6290ca8..8415bf1a9776 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -273,7 +273,8 @@ struct ipv6_pinfo {
273 * 100: prefer care-of address 273 * 100: prefer care-of address
274 */ 274 */
275 dontfrag:1, 275 dontfrag:1,
276 autoflowlabel:1; 276 autoflowlabel:1,
277 autoflowlabel_set:1;
277 __u8 min_hopcount; 278 __u8 min_hopcount;
278 __u8 tclass; 279 __u8 tclass;
279 __be32 rcv_flowinfo; 280 __be32 rcv_flowinfo;
diff --git a/include/linux/irq.h b/include/linux/irq.h
index e140f69163b6..a0231e96a578 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -212,6 +212,7 @@ struct irq_data {
212 * mask. Applies only to affinity managed irqs. 212 * mask. Applies only to affinity managed irqs.
213 * IRQD_SINGLE_TARGET - IRQ allows only a single affinity target 213 * IRQD_SINGLE_TARGET - IRQ allows only a single affinity target
214 * IRQD_DEFAULT_TRIGGER_SET - Expected trigger already been set 214 * IRQD_DEFAULT_TRIGGER_SET - Expected trigger already been set
215 * IRQD_CAN_RESERVE - Can use reservation mode
215 */ 216 */
216enum { 217enum {
217 IRQD_TRIGGER_MASK = 0xf, 218 IRQD_TRIGGER_MASK = 0xf,
@@ -233,6 +234,7 @@ enum {
233 IRQD_MANAGED_SHUTDOWN = (1 << 23), 234 IRQD_MANAGED_SHUTDOWN = (1 << 23),
234 IRQD_SINGLE_TARGET = (1 << 24), 235 IRQD_SINGLE_TARGET = (1 << 24),
235 IRQD_DEFAULT_TRIGGER_SET = (1 << 25), 236 IRQD_DEFAULT_TRIGGER_SET = (1 << 25),
237 IRQD_CAN_RESERVE = (1 << 26),
236}; 238};
237 239
238#define __irqd_to_state(d) ACCESS_PRIVATE((d)->common, state_use_accessors) 240#define __irqd_to_state(d) ACCESS_PRIVATE((d)->common, state_use_accessors)
@@ -377,6 +379,21 @@ static inline bool irqd_is_managed_and_shutdown(struct irq_data *d)
377 return __irqd_to_state(d) & IRQD_MANAGED_SHUTDOWN; 379 return __irqd_to_state(d) & IRQD_MANAGED_SHUTDOWN;
378} 380}
379 381
382static inline void irqd_set_can_reserve(struct irq_data *d)
383{
384 __irqd_to_state(d) |= IRQD_CAN_RESERVE;
385}
386
387static inline void irqd_clr_can_reserve(struct irq_data *d)
388{
389 __irqd_to_state(d) &= ~IRQD_CAN_RESERVE;
390}
391
392static inline bool irqd_can_reserve(struct irq_data *d)
393{
394 return __irqd_to_state(d) & IRQD_CAN_RESERVE;
395}
396
380#undef __irqd_to_state 397#undef __irqd_to_state
381 398
382static inline irq_hw_number_t irqd_to_hwirq(struct irq_data *d) 399static inline irq_hw_number_t irqd_to_hwirq(struct irq_data *d)
diff --git a/include/linux/irq_work.h b/include/linux/irq_work.h
index 0e81035b678f..b11fcdfd0770 100644
--- a/include/linux/irq_work.h
+++ b/include/linux/irq_work.h
@@ -13,10 +13,13 @@
13 * busy NULL, 2 -> {free, claimed} : callback in progress, can be claimed 13 * busy NULL, 2 -> {free, claimed} : callback in progress, can be claimed
14 */ 14 */
15 15
16#define IRQ_WORK_PENDING 1UL 16#define IRQ_WORK_PENDING BIT(0)
17#define IRQ_WORK_BUSY 2UL 17#define IRQ_WORK_BUSY BIT(1)
18#define IRQ_WORK_FLAGS 3UL 18
19#define IRQ_WORK_LAZY 4UL /* Doesn't want IPI, wait for tick */ 19/* Doesn't want IPI, wait for tick: */
20#define IRQ_WORK_LAZY BIT(2)
21
22#define IRQ_WORK_CLAIMED (IRQ_WORK_PENDING | IRQ_WORK_BUSY)
20 23
21struct irq_work { 24struct irq_work {
22 unsigned long flags; 25 unsigned long flags;
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
index 39fb3700f7a9..25b33b664537 100644
--- a/include/linux/irqdesc.h
+++ b/include/linux/irqdesc.h
@@ -255,12 +255,15 @@ static inline bool irq_is_percpu_devid(unsigned int irq)
255} 255}
256 256
257static inline void 257static inline void
258irq_set_lockdep_class(unsigned int irq, struct lock_class_key *class) 258irq_set_lockdep_class(unsigned int irq, struct lock_class_key *lock_class,
259 struct lock_class_key *request_class)
259{ 260{
260 struct irq_desc *desc = irq_to_desc(irq); 261 struct irq_desc *desc = irq_to_desc(irq);
261 262
262 if (desc) 263 if (desc) {
263 lockdep_set_class(&desc->lock, class); 264 lockdep_set_class(&desc->lock, lock_class);
265 lockdep_set_class(&desc->request_mutex, request_class);
266 }
264} 267}
265 268
266#ifdef CONFIG_IRQ_PREFLOW_FASTEOI 269#ifdef CONFIG_IRQ_PREFLOW_FASTEOI
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index a34355d19546..48c7e86bb556 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -113,7 +113,7 @@ struct irq_domain_ops {
113 unsigned int nr_irqs, void *arg); 113 unsigned int nr_irqs, void *arg);
114 void (*free)(struct irq_domain *d, unsigned int virq, 114 void (*free)(struct irq_domain *d, unsigned int virq,
115 unsigned int nr_irqs); 115 unsigned int nr_irqs);
116 int (*activate)(struct irq_domain *d, struct irq_data *irqd, bool early); 116 int (*activate)(struct irq_domain *d, struct irq_data *irqd, bool reserve);
117 void (*deactivate)(struct irq_domain *d, struct irq_data *irq_data); 117 void (*deactivate)(struct irq_domain *d, struct irq_data *irq_data);
118 int (*translate)(struct irq_domain *d, struct irq_fwspec *fwspec, 118 int (*translate)(struct irq_domain *d, struct irq_fwspec *fwspec,
119 unsigned long *out_hwirq, unsigned int *out_type); 119 unsigned long *out_hwirq, unsigned int *out_type);
diff --git a/include/linux/irqflags.h b/include/linux/irqflags.h
index 46cb57d5eb13..9700f00bbc04 100644
--- a/include/linux/irqflags.h
+++ b/include/linux/irqflags.h
@@ -27,24 +27,19 @@
27# define trace_hardirq_enter() \ 27# define trace_hardirq_enter() \
28do { \ 28do { \
29 current->hardirq_context++; \ 29 current->hardirq_context++; \
30 crossrelease_hist_start(XHLOCK_HARD); \
31} while (0) 30} while (0)
32# define trace_hardirq_exit() \ 31# define trace_hardirq_exit() \
33do { \ 32do { \
34 current->hardirq_context--; \ 33 current->hardirq_context--; \
35 crossrelease_hist_end(XHLOCK_HARD); \
36} while (0) 34} while (0)
37# define lockdep_softirq_enter() \ 35# define lockdep_softirq_enter() \
38do { \ 36do { \
39 current->softirq_context++; \ 37 current->softirq_context++; \
40 crossrelease_hist_start(XHLOCK_SOFT); \
41} while (0) 38} while (0)
42# define lockdep_softirq_exit() \ 39# define lockdep_softirq_exit() \
43do { \ 40do { \
44 current->softirq_context--; \ 41 current->softirq_context--; \
45 crossrelease_hist_end(XHLOCK_SOFT); \
46} while (0) 42} while (0)
47# define INIT_TRACE_IRQFLAGS .softirqs_enabled = 1,
48#else 43#else
49# define trace_hardirqs_on() do { } while (0) 44# define trace_hardirqs_on() do { } while (0)
50# define trace_hardirqs_off() do { } while (0) 45# define trace_hardirqs_off() do { } while (0)
@@ -58,7 +53,6 @@ do { \
58# define trace_hardirq_exit() do { } while (0) 53# define trace_hardirq_exit() do { } while (0)
59# define lockdep_softirq_enter() do { } while (0) 54# define lockdep_softirq_enter() do { } while (0)
60# define lockdep_softirq_exit() do { } while (0) 55# define lockdep_softirq_exit() do { } while (0)
61# define INIT_TRACE_IRQFLAGS
62#endif 56#endif
63 57
64#if defined(CONFIG_IRQSOFF_TRACER) || \ 58#if defined(CONFIG_IRQSOFF_TRACER) || \
diff --git a/include/linux/iversion.h b/include/linux/iversion.h
new file mode 100644
index 000000000000..858463fca249
--- /dev/null
+++ b/include/linux/iversion.h
@@ -0,0 +1,341 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _LINUX_IVERSION_H
3#define _LINUX_IVERSION_H
4
5#include <linux/fs.h>
6
7/*
8 * The inode->i_version field:
9 * ---------------------------
10 * The change attribute (i_version) is mandated by NFSv4 and is mostly for
11 * knfsd, but is also used for other purposes (e.g. IMA). The i_version must
12 * appear different to observers if there was a change to the inode's data or
13 * metadata since it was last queried.
14 *
15 * Observers see the i_version as a 64-bit number that never decreases. If it
16 * remains the same since it was last checked, then nothing has changed in the
17 * inode. If it's different then something has changed. Observers cannot infer
18 * anything about the nature or magnitude of the changes from the value, only
19 * that the inode has changed in some fashion.
20 *
21 * Not all filesystems properly implement the i_version counter. Subsystems that
22 * want to use i_version field on an inode should first check whether the
23 * filesystem sets the SB_I_VERSION flag (usually via the IS_I_VERSION macro).
24 *
25 * Those that set SB_I_VERSION will automatically have their i_version counter
26 * incremented on writes to normal files. If the SB_I_VERSION is not set, then
27 * the VFS will not touch it on writes, and the filesystem can use it how it
28 * wishes. Note that the filesystem is always responsible for updating the
29 * i_version on namespace changes in directories (mkdir, rmdir, unlink, etc.).
30 * We consider these sorts of filesystems to have a kernel-managed i_version.
31 *
32 * It may be impractical for filesystems to keep i_version updates atomic with
33 * respect to the changes that cause them. They should, however, guarantee
34 * that i_version updates are never visible before the changes that caused
35 * them. Also, i_version updates should never be delayed longer than it takes
36 * the original change to reach disk.
37 *
38 * This implementation uses the low bit in the i_version field as a flag to
39 * track when the value has been queried. If it has not been queried since it
40 * was last incremented, we can skip the increment in most cases.
41 *
42 * In the event that we're updating the ctime, we will usually go ahead and
43 * bump the i_version anyway. Since that has to go to stable storage in some
44 * fashion, we might as well increment it as well.
45 *
46 * With this implementation, the value should always appear to observers to
47 * increase over time if the file has changed. It's recommended to use
48 * inode_cmp_iversion() helper to compare values.
49 *
50 * Note that some filesystems (e.g. NFS and AFS) just use the field to store
51 * a server-provided value (for the most part). For that reason, those
52 * filesystems do not set SB_I_VERSION. These filesystems are considered to
53 * have a self-managed i_version.
54 *
55 * Persistently storing the i_version
56 * ----------------------------------
57 * Queries of the i_version field are not gated on them hitting the backing
58 * store. It's always possible that the host could crash after allowing
59 * a query of the value but before it has made it to disk.
60 *
61 * To mitigate this problem, filesystems should always use
62 * inode_set_iversion_queried when loading an existing inode from disk. This
63 * ensures that the next attempted inode increment will result in the value
64 * changing.
65 *
66 * Storing the value to disk therefore does not count as a query, so those
67 * filesystems should use inode_peek_iversion to grab the value to be stored.
68 * There is no need to flag the value as having been queried in that case.
69 */
70
71/*
72 * We borrow the lowest bit in the i_version to use as a flag to tell whether
73 * it has been queried since we last incremented it. If it has, then we must
74 * increment it on the next change. After that, we can clear the flag and
75 * avoid incrementing it again until it has again been queried.
76 */
77#define I_VERSION_QUERIED_SHIFT (1)
78#define I_VERSION_QUERIED (1ULL << (I_VERSION_QUERIED_SHIFT - 1))
79#define I_VERSION_INCREMENT (1ULL << I_VERSION_QUERIED_SHIFT)
80
81/**
82 * inode_set_iversion_raw - set i_version to the specified raw value
83 * @inode: inode to set
84 * @val: new i_version value to set
85 *
86 * Set @inode's i_version field to @val. This function is for use by
87 * filesystems that self-manage the i_version.
88 *
89 * For example, the NFS client stores its NFSv4 change attribute in this way,
90 * and the AFS client stores the data_version from the server here.
91 */
92static inline void
93inode_set_iversion_raw(struct inode *inode, u64 val)
94{
95 atomic64_set(&inode->i_version, val);
96}
97
98/**
99 * inode_peek_iversion_raw - grab a "raw" iversion value
100 * @inode: inode from which i_version should be read
101 *
102 * Grab a "raw" inode->i_version value and return it. The i_version is not
103 * flagged or converted in any way. This is mostly used to access a self-managed
104 * i_version.
105 *
106 * With those filesystems, we want to treat the i_version as an entirely
107 * opaque value.
108 */
109static inline u64
110inode_peek_iversion_raw(const struct inode *inode)
111{
112 return atomic64_read(&inode->i_version);
113}
114
115/**
116 * inode_set_iversion - set i_version to a particular value
117 * @inode: inode to set
118 * @val: new i_version value to set
119 *
120 * Set @inode's i_version field to @val. This function is for filesystems with
121 * a kernel-managed i_version, for initializing a newly-created inode from
122 * scratch.
123 *
124 * In this case, we do not set the QUERIED flag since we know that this value
125 * has never been queried.
126 */
127static inline void
128inode_set_iversion(struct inode *inode, u64 val)
129{
130 inode_set_iversion_raw(inode, val << I_VERSION_QUERIED_SHIFT);
131}
132
133/**
134 * inode_set_iversion_queried - set i_version to a particular value as quereied
135 * @inode: inode to set
136 * @val: new i_version value to set
137 *
138 * Set @inode's i_version field to @val, and flag it for increment on the next
139 * change.
140 *
141 * Filesystems that persistently store the i_version on disk should use this
142 * when loading an existing inode from disk.
143 *
144 * When loading in an i_version value from a backing store, we can't be certain
145 * that it wasn't previously viewed before being stored. Thus, we must assume
146 * that it was, to ensure that we don't end up handing out the same value for
147 * different versions of the same inode.
148 */
149static inline void
150inode_set_iversion_queried(struct inode *inode, u64 val)
151{
152 inode_set_iversion_raw(inode, (val << I_VERSION_QUERIED_SHIFT) |
153 I_VERSION_QUERIED);
154}
155
156/**
157 * inode_maybe_inc_iversion - increments i_version
158 * @inode: inode with the i_version that should be updated
159 * @force: increment the counter even if it's not necessary?
160 *
161 * Every time the inode is modified, the i_version field must be seen to have
162 * changed by any observer.
163 *
164 * If "force" is set or the QUERIED flag is set, then ensure that we increment
165 * the value, and clear the queried flag.
166 *
167 * In the common case where neither is set, then we can return "false" without
168 * updating i_version.
169 *
170 * If this function returns false, and no other metadata has changed, then we
171 * can avoid logging the metadata.
172 */
173static inline bool
174inode_maybe_inc_iversion(struct inode *inode, bool force)
175{
176 u64 cur, old, new;
177
178 /*
179 * The i_version field is not strictly ordered with any other inode
180 * information, but the legacy inode_inc_iversion code used a spinlock
181 * to serialize increments.
182 *
183 * Here, we add full memory barriers to ensure that any de-facto
184 * ordering with other info is preserved.
185 *
186 * This barrier pairs with the barrier in inode_query_iversion()
187 */
188 smp_mb();
189 cur = inode_peek_iversion_raw(inode);
190 for (;;) {
191 /* If flag is clear then we needn't do anything */
192 if (!force && !(cur & I_VERSION_QUERIED))
193 return false;
194
195 /* Since lowest bit is flag, add 2 to avoid it */
196 new = (cur & ~I_VERSION_QUERIED) + I_VERSION_INCREMENT;
197
198 old = atomic64_cmpxchg(&inode->i_version, cur, new);
199 if (likely(old == cur))
200 break;
201 cur = old;
202 }
203 return true;
204}
205
206
207/**
208 * inode_inc_iversion - forcibly increment i_version
209 * @inode: inode that needs to be updated
210 *
211 * Forcbily increment the i_version field. This always results in a change to
212 * the observable value.
213 */
214static inline void
215inode_inc_iversion(struct inode *inode)
216{
217 inode_maybe_inc_iversion(inode, true);
218}
219
220/**
221 * inode_iversion_need_inc - is the i_version in need of being incremented?
222 * @inode: inode to check
223 *
224 * Returns whether the inode->i_version counter needs incrementing on the next
225 * change. Just fetch the value and check the QUERIED flag.
226 */
227static inline bool
228inode_iversion_need_inc(struct inode *inode)
229{
230 return inode_peek_iversion_raw(inode) & I_VERSION_QUERIED;
231}
232
233/**
234 * inode_inc_iversion_raw - forcibly increment raw i_version
235 * @inode: inode that needs to be updated
236 *
237 * Forcbily increment the raw i_version field. This always results in a change
238 * to the raw value.
239 *
240 * NFS will use the i_version field to store the value from the server. It
241 * mostly treats it as opaque, but in the case where it holds a write
242 * delegation, it must increment the value itself. This function does that.
243 */
244static inline void
245inode_inc_iversion_raw(struct inode *inode)
246{
247 atomic64_inc(&inode->i_version);
248}
249
250/**
251 * inode_peek_iversion - read i_version without flagging it to be incremented
252 * @inode: inode from which i_version should be read
253 *
254 * Read the inode i_version counter for an inode without registering it as a
255 * query.
256 *
257 * This is typically used by local filesystems that need to store an i_version
258 * on disk. In that situation, it's not necessary to flag it as having been
259 * viewed, as the result won't be used to gauge changes from that point.
260 */
261static inline u64
262inode_peek_iversion(const struct inode *inode)
263{
264 return inode_peek_iversion_raw(inode) >> I_VERSION_QUERIED_SHIFT;
265}
266
267/**
268 * inode_query_iversion - read i_version for later use
269 * @inode: inode from which i_version should be read
270 *
271 * Read the inode i_version counter. This should be used by callers that wish
272 * to store the returned i_version for later comparison. This will guarantee
273 * that a later query of the i_version will result in a different value if
274 * anything has changed.
275 *
276 * In this implementation, we fetch the current value, set the QUERIED flag and
277 * then try to swap it into place with a cmpxchg, if it wasn't already set. If
278 * that fails, we try again with the newly fetched value from the cmpxchg.
279 */
280static inline u64
281inode_query_iversion(struct inode *inode)
282{
283 u64 cur, old, new;
284
285 cur = inode_peek_iversion_raw(inode);
286 for (;;) {
287 /* If flag is already set, then no need to swap */
288 if (cur & I_VERSION_QUERIED) {
289 /*
290 * This barrier (and the implicit barrier in the
291 * cmpxchg below) pairs with the barrier in
292 * inode_maybe_inc_iversion().
293 */
294 smp_mb();
295 break;
296 }
297
298 new = cur | I_VERSION_QUERIED;
299 old = atomic64_cmpxchg(&inode->i_version, cur, new);
300 if (likely(old == cur))
301 break;
302 cur = old;
303 }
304 return cur >> I_VERSION_QUERIED_SHIFT;
305}
306
307/**
308 * inode_cmp_iversion_raw - check whether the raw i_version counter has changed
309 * @inode: inode to check
310 * @old: old value to check against its i_version
311 *
312 * Compare the current raw i_version counter with a previous one. Returns 0 if
313 * they are the same or non-zero if they are different.
314 */
315static inline s64
316inode_cmp_iversion_raw(const struct inode *inode, u64 old)
317{
318 return (s64)inode_peek_iversion_raw(inode) - (s64)old;
319}
320
321/**
322 * inode_cmp_iversion - check whether the i_version counter has changed
323 * @inode: inode to check
324 * @old: old value to check against its i_version
325 *
326 * Compare an i_version counter with a previous one. Returns 0 if they are
327 * the same, a positive value if the one in the inode appears newer than @old,
328 * and a negative value if @old appears to be newer than the one in the
329 * inode.
330 *
331 * Note that we don't need to set the QUERIED flag in this case, as the value
332 * in the inode is not being recorded for later use.
333 */
334
335static inline s64
336inode_cmp_iversion(const struct inode *inode, u64 old)
337{
338 return (s64)(inode_peek_iversion_raw(inode) & ~I_VERSION_QUERIED) -
339 (s64)(old << I_VERSION_QUERIED_SHIFT);
340}
341#endif
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index c7b368c734af..e0340ca08d98 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -160,6 +160,8 @@ extern void arch_jump_label_transform_static(struct jump_entry *entry,
160extern int jump_label_text_reserved(void *start, void *end); 160extern int jump_label_text_reserved(void *start, void *end);
161extern void static_key_slow_inc(struct static_key *key); 161extern void static_key_slow_inc(struct static_key *key);
162extern void static_key_slow_dec(struct static_key *key); 162extern void static_key_slow_dec(struct static_key *key);
163extern void static_key_slow_inc_cpuslocked(struct static_key *key);
164extern void static_key_slow_dec_cpuslocked(struct static_key *key);
163extern void jump_label_apply_nops(struct module *mod); 165extern void jump_label_apply_nops(struct module *mod);
164extern int static_key_count(struct static_key *key); 166extern int static_key_count(struct static_key *key);
165extern void static_key_enable(struct static_key *key); 167extern void static_key_enable(struct static_key *key);
@@ -222,6 +224,9 @@ static inline void static_key_slow_dec(struct static_key *key)
222 atomic_dec(&key->enabled); 224 atomic_dec(&key->enabled);
223} 225}
224 226
227#define static_key_slow_inc_cpuslocked(key) static_key_slow_inc(key)
228#define static_key_slow_dec_cpuslocked(key) static_key_slow_dec(key)
229
225static inline int jump_label_text_reserved(void *start, void *end) 230static inline int jump_label_text_reserved(void *start, void *end)
226{ 231{
227 return 0; 232 return 0;
@@ -416,6 +421,8 @@ extern bool ____wrong_branch_error(void);
416 421
417#define static_branch_inc(x) static_key_slow_inc(&(x)->key) 422#define static_branch_inc(x) static_key_slow_inc(&(x)->key)
418#define static_branch_dec(x) static_key_slow_dec(&(x)->key) 423#define static_branch_dec(x) static_key_slow_dec(&(x)->key)
424#define static_branch_inc_cpuslocked(x) static_key_slow_inc_cpuslocked(&(x)->key)
425#define static_branch_dec_cpuslocked(x) static_key_slow_dec_cpuslocked(&(x)->key)
419 426
420/* 427/*
421 * Normal usage; boolean enable/disable. 428 * Normal usage; boolean enable/disable.
diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h
index 2d1d9de06728..7f4b60abdf27 100644
--- a/include/linux/lightnvm.h
+++ b/include/linux/lightnvm.h
@@ -50,10 +50,7 @@ struct nvm_id;
50struct nvm_dev; 50struct nvm_dev;
51struct nvm_tgt_dev; 51struct nvm_tgt_dev;
52 52
53typedef int (nvm_l2p_update_fn)(u64, u32, __le64 *, void *);
54typedef int (nvm_id_fn)(struct nvm_dev *, struct nvm_id *); 53typedef int (nvm_id_fn)(struct nvm_dev *, struct nvm_id *);
55typedef int (nvm_get_l2p_tbl_fn)(struct nvm_dev *, u64, u32,
56 nvm_l2p_update_fn *, void *);
57typedef int (nvm_op_bb_tbl_fn)(struct nvm_dev *, struct ppa_addr, u8 *); 54typedef int (nvm_op_bb_tbl_fn)(struct nvm_dev *, struct ppa_addr, u8 *);
58typedef int (nvm_op_set_bb_fn)(struct nvm_dev *, struct ppa_addr *, int, int); 55typedef int (nvm_op_set_bb_fn)(struct nvm_dev *, struct ppa_addr *, int, int);
59typedef int (nvm_submit_io_fn)(struct nvm_dev *, struct nvm_rq *); 56typedef int (nvm_submit_io_fn)(struct nvm_dev *, struct nvm_rq *);
@@ -66,7 +63,6 @@ typedef void (nvm_dev_dma_free_fn)(void *, void*, dma_addr_t);
66 63
67struct nvm_dev_ops { 64struct nvm_dev_ops {
68 nvm_id_fn *identity; 65 nvm_id_fn *identity;
69 nvm_get_l2p_tbl_fn *get_l2p_tbl;
70 nvm_op_bb_tbl_fn *get_bb_tbl; 66 nvm_op_bb_tbl_fn *get_bb_tbl;
71 nvm_op_set_bb_fn *set_bb_tbl; 67 nvm_op_set_bb_fn *set_bb_tbl;
72 68
@@ -112,8 +108,6 @@ enum {
112 NVM_RSP_WARN_HIGHECC = 0x4700, 108 NVM_RSP_WARN_HIGHECC = 0x4700,
113 109
114 /* Device opcodes */ 110 /* Device opcodes */
115 NVM_OP_HBREAD = 0x02,
116 NVM_OP_HBWRITE = 0x81,
117 NVM_OP_PWRITE = 0x91, 111 NVM_OP_PWRITE = 0x91,
118 NVM_OP_PREAD = 0x92, 112 NVM_OP_PREAD = 0x92,
119 NVM_OP_ERASE = 0x90, 113 NVM_OP_ERASE = 0x90,
@@ -165,12 +159,16 @@ struct nvm_id_group {
165 u8 fmtype; 159 u8 fmtype;
166 u8 num_ch; 160 u8 num_ch;
167 u8 num_lun; 161 u8 num_lun;
168 u8 num_pln; 162 u16 num_chk;
169 u16 num_blk; 163 u16 clba;
170 u16 num_pg;
171 u16 fpg_sz;
172 u16 csecs; 164 u16 csecs;
173 u16 sos; 165 u16 sos;
166
167 u16 ws_min;
168 u16 ws_opt;
169 u16 ws_seq;
170 u16 ws_per_chk;
171
174 u32 trdt; 172 u32 trdt;
175 u32 trdm; 173 u32 trdm;
176 u32 tprt; 174 u32 tprt;
@@ -181,7 +179,10 @@ struct nvm_id_group {
181 u32 mccap; 179 u32 mccap;
182 u16 cpar; 180 u16 cpar;
183 181
184 struct nvm_id_lp_tbl lptbl; 182 /* 1.2 compatibility */
183 u8 num_pln;
184 u16 num_pg;
185 u16 fpg_sz;
185}; 186};
186 187
187struct nvm_addr_format { 188struct nvm_addr_format {
@@ -217,6 +218,10 @@ struct nvm_target {
217 218
218#define ADDR_EMPTY (~0ULL) 219#define ADDR_EMPTY (~0ULL)
219 220
221#define NVM_TARGET_DEFAULT_OP (101)
222#define NVM_TARGET_MIN_OP (3)
223#define NVM_TARGET_MAX_OP (80)
224
220#define NVM_VERSION_MAJOR 1 225#define NVM_VERSION_MAJOR 1
221#define NVM_VERSION_MINOR 0 226#define NVM_VERSION_MINOR 0
222#define NVM_VERSION_PATCH 0 227#define NVM_VERSION_PATCH 0
@@ -239,7 +244,6 @@ struct nvm_rq {
239 void *meta_list; 244 void *meta_list;
240 dma_addr_t dma_meta_list; 245 dma_addr_t dma_meta_list;
241 246
242 struct completion *wait;
243 nvm_end_io_fn *end_io; 247 nvm_end_io_fn *end_io;
244 248
245 uint8_t opcode; 249 uint8_t opcode;
@@ -268,31 +272,38 @@ enum {
268 NVM_BLK_ST_BAD = 0x8, /* Bad block */ 272 NVM_BLK_ST_BAD = 0x8, /* Bad block */
269}; 273};
270 274
275
271/* Device generic information */ 276/* Device generic information */
272struct nvm_geo { 277struct nvm_geo {
278 /* generic geometry */
273 int nr_chnls; 279 int nr_chnls;
274 int nr_luns; 280 int all_luns; /* across channels */
275 int luns_per_chnl; /* -1 if channels are not symmetric */ 281 int nr_luns; /* per channel */
276 int nr_planes; 282 int nr_chks; /* per lun */
277 int sec_per_pg; /* only sectors for a single page */ 283
278 int pgs_per_blk;
279 int blks_per_lun;
280 int fpg_size;
281 int pfpg_size; /* size of buffer if all pages are to be read */
282 int sec_size; 284 int sec_size;
283 int oob_size; 285 int oob_size;
284 int mccap; 286 int mccap;
285 struct nvm_addr_format ppaf;
286 287
287 /* Calculated/Cached values. These do not reflect the actual usable 288 int sec_per_chk;
288 * blocks at run-time. 289 int sec_per_lun;
289 */ 290
291 int ws_min;
292 int ws_opt;
293 int ws_seq;
294 int ws_per_chk;
295
290 int max_rq_size; 296 int max_rq_size;
291 int plane_mode; /* drive device in single, double or quad mode */
292 297
298 int op;
299
300 struct nvm_addr_format ppaf;
301
302 /* Legacy 1.2 specific geometry */
303 int plane_mode; /* drive device in single, double or quad mode */
304 int nr_planes;
305 int sec_per_pg; /* only sectors for a single page */
293 int sec_per_pl; /* all sectors across planes */ 306 int sec_per_pl; /* all sectors across planes */
294 int sec_per_blk;
295 int sec_per_lun;
296}; 307};
297 308
298/* sub-device structure */ 309/* sub-device structure */
@@ -320,10 +331,6 @@ struct nvm_dev {
320 /* Device information */ 331 /* Device information */
321 struct nvm_geo geo; 332 struct nvm_geo geo;
322 333
323 /* lower page table */
324 int lps_per_blk;
325 int *lptbl;
326
327 unsigned long total_secs; 334 unsigned long total_secs;
328 335
329 unsigned long *lun_map; 336 unsigned long *lun_map;
@@ -346,36 +353,6 @@ struct nvm_dev {
346 struct list_head targets; 353 struct list_head targets;
347}; 354};
348 355
349static inline struct ppa_addr linear_to_generic_addr(struct nvm_geo *geo,
350 u64 pba)
351{
352 struct ppa_addr l;
353 int secs, pgs, blks, luns;
354 sector_t ppa = pba;
355
356 l.ppa = 0;
357
358 div_u64_rem(ppa, geo->sec_per_pg, &secs);
359 l.g.sec = secs;
360
361 sector_div(ppa, geo->sec_per_pg);
362 div_u64_rem(ppa, geo->pgs_per_blk, &pgs);
363 l.g.pg = pgs;
364
365 sector_div(ppa, geo->pgs_per_blk);
366 div_u64_rem(ppa, geo->blks_per_lun, &blks);
367 l.g.blk = blks;
368
369 sector_div(ppa, geo->blks_per_lun);
370 div_u64_rem(ppa, geo->luns_per_chnl, &luns);
371 l.g.lun = luns;
372
373 sector_div(ppa, geo->luns_per_chnl);
374 l.g.ch = ppa;
375
376 return l;
377}
378
379static inline struct ppa_addr generic_to_dev_addr(struct nvm_tgt_dev *tgt_dev, 356static inline struct ppa_addr generic_to_dev_addr(struct nvm_tgt_dev *tgt_dev,
380 struct ppa_addr r) 357 struct ppa_addr r)
381{ 358{
@@ -418,25 +395,6 @@ static inline struct ppa_addr dev_to_generic_addr(struct nvm_tgt_dev *tgt_dev,
418 return l; 395 return l;
419} 396}
420 397
421static inline int ppa_empty(struct ppa_addr ppa_addr)
422{
423 return (ppa_addr.ppa == ADDR_EMPTY);
424}
425
426static inline void ppa_set_empty(struct ppa_addr *ppa_addr)
427{
428 ppa_addr->ppa = ADDR_EMPTY;
429}
430
431static inline int ppa_cmp_blk(struct ppa_addr ppa1, struct ppa_addr ppa2)
432{
433 if (ppa_empty(ppa1) || ppa_empty(ppa2))
434 return 0;
435
436 return ((ppa1.g.ch == ppa2.g.ch) && (ppa1.g.lun == ppa2.g.lun) &&
437 (ppa1.g.blk == ppa2.g.blk));
438}
439
440typedef blk_qc_t (nvm_tgt_make_rq_fn)(struct request_queue *, struct bio *); 398typedef blk_qc_t (nvm_tgt_make_rq_fn)(struct request_queue *, struct bio *);
441typedef sector_t (nvm_tgt_capacity_fn)(void *); 399typedef sector_t (nvm_tgt_capacity_fn)(void *);
442typedef void *(nvm_tgt_init_fn)(struct nvm_tgt_dev *, struct gendisk *, 400typedef void *(nvm_tgt_init_fn)(struct nvm_tgt_dev *, struct gendisk *,
@@ -481,17 +439,10 @@ extern int nvm_set_tgt_bb_tbl(struct nvm_tgt_dev *, struct ppa_addr *,
481extern int nvm_max_phys_sects(struct nvm_tgt_dev *); 439extern int nvm_max_phys_sects(struct nvm_tgt_dev *);
482extern int nvm_submit_io(struct nvm_tgt_dev *, struct nvm_rq *); 440extern int nvm_submit_io(struct nvm_tgt_dev *, struct nvm_rq *);
483extern int nvm_submit_io_sync(struct nvm_tgt_dev *, struct nvm_rq *); 441extern int nvm_submit_io_sync(struct nvm_tgt_dev *, struct nvm_rq *);
484extern int nvm_erase_sync(struct nvm_tgt_dev *, struct ppa_addr *, int);
485extern int nvm_get_l2p_tbl(struct nvm_tgt_dev *, u64, u32, nvm_l2p_update_fn *,
486 void *);
487extern int nvm_get_area(struct nvm_tgt_dev *, sector_t *, sector_t);
488extern void nvm_put_area(struct nvm_tgt_dev *, sector_t);
489extern void nvm_end_io(struct nvm_rq *); 442extern void nvm_end_io(struct nvm_rq *);
490extern int nvm_bb_tbl_fold(struct nvm_dev *, u8 *, int); 443extern int nvm_bb_tbl_fold(struct nvm_dev *, u8 *, int);
491extern int nvm_get_tgt_bb_tbl(struct nvm_tgt_dev *, struct ppa_addr, u8 *); 444extern int nvm_get_tgt_bb_tbl(struct nvm_tgt_dev *, struct ppa_addr, u8 *);
492 445
493extern void nvm_part_to_tgt(struct nvm_dev *, sector_t *, int);
494
495#else /* CONFIG_NVM */ 446#else /* CONFIG_NVM */
496struct nvm_dev_ops; 447struct nvm_dev_ops;
497 448
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index a842551fe044..6fc77d4dbdcd 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -158,12 +158,6 @@ struct lockdep_map {
158 int cpu; 158 int cpu;
159 unsigned long ip; 159 unsigned long ip;
160#endif 160#endif
161#ifdef CONFIG_LOCKDEP_CROSSRELEASE
162 /*
163 * Whether it's a crosslock.
164 */
165 int cross;
166#endif
167}; 161};
168 162
169static inline void lockdep_copy_map(struct lockdep_map *to, 163static inline void lockdep_copy_map(struct lockdep_map *to,
@@ -267,96 +261,9 @@ struct held_lock {
267 unsigned int hardirqs_off:1; 261 unsigned int hardirqs_off:1;
268 unsigned int references:12; /* 32 bits */ 262 unsigned int references:12; /* 32 bits */
269 unsigned int pin_count; 263 unsigned int pin_count;
270#ifdef CONFIG_LOCKDEP_CROSSRELEASE
271 /*
272 * Generation id.
273 *
274 * A value of cross_gen_id will be stored when holding this,
275 * which is globally increased whenever each crosslock is held.
276 */
277 unsigned int gen_id;
278#endif
279};
280
281#ifdef CONFIG_LOCKDEP_CROSSRELEASE
282#define MAX_XHLOCK_TRACE_ENTRIES 5
283
284/*
285 * This is for keeping locks waiting for commit so that true dependencies
286 * can be added at commit step.
287 */
288struct hist_lock {
289 /*
290 * Id for each entry in the ring buffer. This is used to
291 * decide whether the ring buffer was overwritten or not.
292 *
293 * For example,
294 *
295 * |<----------- hist_lock ring buffer size ------->|
296 * pppppppppppppppppppppiiiiiiiiiiiiiiiiiiiiiiiiiiiii
297 * wrapped > iiiiiiiiiiiiiiiiiiiiiiiiiii.......................
298 *
299 * where 'p' represents an acquisition in process
300 * context, 'i' represents an acquisition in irq
301 * context.
302 *
303 * In this example, the ring buffer was overwritten by
304 * acquisitions in irq context, that should be detected on
305 * rollback or commit.
306 */
307 unsigned int hist_id;
308
309 /*
310 * Seperate stack_trace data. This will be used at commit step.
311 */
312 struct stack_trace trace;
313 unsigned long trace_entries[MAX_XHLOCK_TRACE_ENTRIES];
314
315 /*
316 * Seperate hlock instance. This will be used at commit step.
317 *
318 * TODO: Use a smaller data structure containing only necessary
319 * data. However, we should make lockdep code able to handle the
320 * smaller one first.
321 */
322 struct held_lock hlock;
323}; 264};
324 265
325/* 266/*
326 * To initialize a lock as crosslock, lockdep_init_map_crosslock() should
327 * be called instead of lockdep_init_map().
328 */
329struct cross_lock {
330 /*
331 * When more than one acquisition of crosslocks are overlapped,
332 * we have to perform commit for them based on cross_gen_id of
333 * the first acquisition, which allows us to add more true
334 * dependencies.
335 *
336 * Moreover, when no acquisition of a crosslock is in progress,
337 * we should not perform commit because the lock might not exist
338 * any more, which might cause incorrect memory access. So we
339 * have to track the number of acquisitions of a crosslock.
340 */
341 int nr_acquire;
342
343 /*
344 * Seperate hlock instance. This will be used at commit step.
345 *
346 * TODO: Use a smaller data structure containing only necessary
347 * data. However, we should make lockdep code able to handle the
348 * smaller one first.
349 */
350 struct held_lock hlock;
351};
352
353struct lockdep_map_cross {
354 struct lockdep_map map;
355 struct cross_lock xlock;
356};
357#endif
358
359/*
360 * Initialization, self-test and debugging-output methods: 267 * Initialization, self-test and debugging-output methods:
361 */ 268 */
362extern void lockdep_info(void); 269extern void lockdep_info(void);
@@ -430,9 +337,9 @@ extern void lock_release(struct lockdep_map *lock, int nested,
430/* 337/*
431 * Same "read" as for lock_acquire(), except -1 means any. 338 * Same "read" as for lock_acquire(), except -1 means any.
432 */ 339 */
433extern int lock_is_held_type(struct lockdep_map *lock, int read); 340extern int lock_is_held_type(const struct lockdep_map *lock, int read);
434 341
435static inline int lock_is_held(struct lockdep_map *lock) 342static inline int lock_is_held(const struct lockdep_map *lock)
436{ 343{
437 return lock_is_held_type(lock, -1); 344 return lock_is_held_type(lock, -1);
438} 345}
@@ -460,8 +367,6 @@ extern struct pin_cookie lock_pin_lock(struct lockdep_map *lock);
460extern void lock_repin_lock(struct lockdep_map *lock, struct pin_cookie); 367extern void lock_repin_lock(struct lockdep_map *lock, struct pin_cookie);
461extern void lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie); 368extern void lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie);
462 369
463# define INIT_LOCKDEP .lockdep_recursion = 0,
464
465#define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) 370#define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0)
466 371
467#define lockdep_assert_held(l) do { \ 372#define lockdep_assert_held(l) do { \
@@ -519,7 +424,6 @@ static inline void lockdep_on(void)
519 * #ifdef the call himself. 424 * #ifdef the call himself.
520 */ 425 */
521 426
522# define INIT_LOCKDEP
523# define lockdep_reset() do { debug_locks = 1; } while (0) 427# define lockdep_reset() do { debug_locks = 1; } while (0)
524# define lockdep_free_key_range(start, size) do { } while (0) 428# define lockdep_free_key_range(start, size) do { } while (0)
525# define lockdep_sys_exit() do { } while (0) 429# define lockdep_sys_exit() do { } while (0)
@@ -560,37 +464,6 @@ enum xhlock_context_t {
560 XHLOCK_CTX_NR, 464 XHLOCK_CTX_NR,
561}; 465};
562 466
563#ifdef CONFIG_LOCKDEP_CROSSRELEASE
564extern void lockdep_init_map_crosslock(struct lockdep_map *lock,
565 const char *name,
566 struct lock_class_key *key,
567 int subclass);
568extern void lock_commit_crosslock(struct lockdep_map *lock);
569
570/*
571 * What we essencially have to initialize is 'nr_acquire'. Other members
572 * will be initialized in add_xlock().
573 */
574#define STATIC_CROSS_LOCK_INIT() \
575 { .nr_acquire = 0,}
576
577#define STATIC_CROSS_LOCKDEP_MAP_INIT(_name, _key) \
578 { .map.name = (_name), .map.key = (void *)(_key), \
579 .map.cross = 1, .xlock = STATIC_CROSS_LOCK_INIT(), }
580
581/*
582 * To initialize a lockdep_map statically use this macro.
583 * Note that _name must not be NULL.
584 */
585#define STATIC_LOCKDEP_MAP_INIT(_name, _key) \
586 { .name = (_name), .key = (void *)(_key), .cross = 0, }
587
588extern void crossrelease_hist_start(enum xhlock_context_t c);
589extern void crossrelease_hist_end(enum xhlock_context_t c);
590extern void lockdep_invariant_state(bool force);
591extern void lockdep_init_task(struct task_struct *task);
592extern void lockdep_free_task(struct task_struct *task);
593#else /* !CROSSRELEASE */
594#define lockdep_init_map_crosslock(m, n, k, s) do {} while (0) 467#define lockdep_init_map_crosslock(m, n, k, s) do {} while (0)
595/* 468/*
596 * To initialize a lockdep_map statically use this macro. 469 * To initialize a lockdep_map statically use this macro.
@@ -599,12 +472,9 @@ extern void lockdep_free_task(struct task_struct *task);
599#define STATIC_LOCKDEP_MAP_INIT(_name, _key) \ 472#define STATIC_LOCKDEP_MAP_INIT(_name, _key) \
600 { .name = (_name), .key = (void *)(_key), } 473 { .name = (_name), .key = (void *)(_key), }
601 474
602static inline void crossrelease_hist_start(enum xhlock_context_t c) {}
603static inline void crossrelease_hist_end(enum xhlock_context_t c) {}
604static inline void lockdep_invariant_state(bool force) {} 475static inline void lockdep_invariant_state(bool force) {}
605static inline void lockdep_init_task(struct task_struct *task) {} 476static inline void lockdep_init_task(struct task_struct *task) {}
606static inline void lockdep_free_task(struct task_struct *task) {} 477static inline void lockdep_free_task(struct task_struct *task) {}
607#endif /* CROSSRELEASE */
608 478
609#ifdef CONFIG_LOCK_STAT 479#ifdef CONFIG_LOCK_STAT
610 480
diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h
index 78dc85365c4f..080798f17ece 100644
--- a/include/linux/mfd/axp20x.h
+++ b/include/linux/mfd/axp20x.h
@@ -645,11 +645,6 @@ struct axp20x_dev {
645 const struct regmap_irq_chip *regmap_irq_chip; 645 const struct regmap_irq_chip *regmap_irq_chip;
646}; 646};
647 647
648struct axp288_extcon_pdata {
649 /* GPIO pin control to switch D+/D- lines b/w PMIC and SOC */
650 struct gpio_desc *gpio_mux_cntl;
651};
652
653/* generic helper function for reading 9-16 bit wide regs */ 648/* generic helper function for reading 9-16 bit wide regs */
654static inline int axp20x_read_variable_width(struct regmap *regmap, 649static inline int axp20x_read_variable_width(struct regmap *regmap,
655 unsigned int reg, unsigned int width) 650 unsigned int reg, unsigned int width)
diff --git a/include/linux/mfd/cros_ec.h b/include/linux/mfd/cros_ec.h
index 4e887ba22635..c61535979b8f 100644
--- a/include/linux/mfd/cros_ec.h
+++ b/include/linux/mfd/cros_ec.h
@@ -322,6 +322,10 @@ extern struct attribute_group cros_ec_attr_group;
322extern struct attribute_group cros_ec_lightbar_attr_group; 322extern struct attribute_group cros_ec_lightbar_attr_group;
323extern struct attribute_group cros_ec_vbc_attr_group; 323extern struct attribute_group cros_ec_vbc_attr_group;
324 324
325/* debugfs stuff */
326int cros_ec_debugfs_init(struct cros_ec_dev *ec);
327void cros_ec_debugfs_remove(struct cros_ec_dev *ec);
328
325/* ACPI GPE handler */ 329/* ACPI GPE handler */
326#ifdef CONFIG_ACPI 330#ifdef CONFIG_ACPI
327 331
diff --git a/include/linux/mfd/cros_ec_commands.h b/include/linux/mfd/cros_ec_commands.h
index 2b16e95b9bb8..a83f6498b95e 100644
--- a/include/linux/mfd/cros_ec_commands.h
+++ b/include/linux/mfd/cros_ec_commands.h
@@ -2904,16 +2904,33 @@ enum usb_pd_control_mux {
2904 USB_PD_CTRL_MUX_AUTO = 5, 2904 USB_PD_CTRL_MUX_AUTO = 5,
2905}; 2905};
2906 2906
2907enum usb_pd_control_swap {
2908 USB_PD_CTRL_SWAP_NONE = 0,
2909 USB_PD_CTRL_SWAP_DATA = 1,
2910 USB_PD_CTRL_SWAP_POWER = 2,
2911 USB_PD_CTRL_SWAP_VCONN = 3,
2912 USB_PD_CTRL_SWAP_COUNT
2913};
2914
2907struct ec_params_usb_pd_control { 2915struct ec_params_usb_pd_control {
2908 uint8_t port; 2916 uint8_t port;
2909 uint8_t role; 2917 uint8_t role;
2910 uint8_t mux; 2918 uint8_t mux;
2919 uint8_t swap;
2911} __packed; 2920} __packed;
2912 2921
2913#define PD_CTRL_RESP_ENABLED_COMMS (1 << 0) /* Communication enabled */ 2922#define PD_CTRL_RESP_ENABLED_COMMS (1 << 0) /* Communication enabled */
2914#define PD_CTRL_RESP_ENABLED_CONNECTED (1 << 1) /* Device connected */ 2923#define PD_CTRL_RESP_ENABLED_CONNECTED (1 << 1) /* Device connected */
2915#define PD_CTRL_RESP_ENABLED_PD_CAPABLE (1 << 2) /* Partner is PD capable */ 2924#define PD_CTRL_RESP_ENABLED_PD_CAPABLE (1 << 2) /* Partner is PD capable */
2916 2925
2926#define PD_CTRL_RESP_ROLE_POWER BIT(0) /* 0=SNK/1=SRC */
2927#define PD_CTRL_RESP_ROLE_DATA BIT(1) /* 0=UFP/1=DFP */
2928#define PD_CTRL_RESP_ROLE_VCONN BIT(2) /* Vconn status */
2929#define PD_CTRL_RESP_ROLE_DR_POWER BIT(3) /* Partner is dualrole power */
2930#define PD_CTRL_RESP_ROLE_DR_DATA BIT(4) /* Partner is dualrole data */
2931#define PD_CTRL_RESP_ROLE_USB_COMM BIT(5) /* Partner USB comm capable */
2932#define PD_CTRL_RESP_ROLE_EXT_POWERED BIT(6) /* Partner externally powerd */
2933
2917struct ec_response_usb_pd_control_v1 { 2934struct ec_response_usb_pd_control_v1 {
2918 uint8_t enabled; 2935 uint8_t enabled;
2919 uint8_t role; 2936 uint8_t role;
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
index 3c8568aa82a5..75e5c8ff85fc 100644
--- a/include/linux/mfd/palmas.h
+++ b/include/linux/mfd/palmas.h
@@ -3733,6 +3733,9 @@ enum usb_irq_events {
3733#define TPS65917_REGEN3_CTRL_MODE_ACTIVE 0x01 3733#define TPS65917_REGEN3_CTRL_MODE_ACTIVE 0x01
3734#define TPS65917_REGEN3_CTRL_MODE_ACTIVE_SHIFT 0x00 3734#define TPS65917_REGEN3_CTRL_MODE_ACTIVE_SHIFT 0x00
3735 3735
3736/* POWERHOLD Mask field for PRIMARY_SECONDARY_PAD2 register */
3737#define TPS65917_PRIMARY_SECONDARY_PAD2_GPIO_5_MASK 0xC
3738
3736/* Registers for function RESOURCE */ 3739/* Registers for function RESOURCE */
3737#define TPS65917_REGEN1_CTRL 0x2 3740#define TPS65917_REGEN1_CTRL 0x2
3738#define TPS65917_PLLEN_CTRL 0x3 3741#define TPS65917_PLLEN_CTRL 0x3
diff --git a/include/linux/mfd/rave-sp.h b/include/linux/mfd/rave-sp.h
new file mode 100644
index 000000000000..796fb9794c9e
--- /dev/null
+++ b/include/linux/mfd/rave-sp.h
@@ -0,0 +1,60 @@
1/* SPDX-License-Identifier: GPL-2.0+ */
2
3/*
4 * Core definitions for RAVE SP MFD driver.
5 *
6 * Copyright (C) 2017 Zodiac Inflight Innovations
7 */
8
9#ifndef _LINUX_RAVE_SP_H_
10#define _LINUX_RAVE_SP_H_
11
12#include <linux/notifier.h>
13
14enum rave_sp_command {
15 RAVE_SP_CMD_GET_FIRMWARE_VERSION = 0x20,
16 RAVE_SP_CMD_GET_BOOTLOADER_VERSION = 0x21,
17 RAVE_SP_CMD_BOOT_SOURCE = 0x26,
18 RAVE_SP_CMD_GET_BOARD_COPPER_REV = 0x2B,
19 RAVE_SP_CMD_GET_GPIO_STATE = 0x2F,
20
21 RAVE_SP_CMD_STATUS = 0xA0,
22 RAVE_SP_CMD_SW_WDT = 0xA1,
23 RAVE_SP_CMD_PET_WDT = 0xA2,
24 RAVE_SP_CMD_RESET = 0xA7,
25 RAVE_SP_CMD_RESET_REASON = 0xA8,
26
27 RAVE_SP_CMD_REQ_COPPER_REV = 0xB6,
28 RAVE_SP_CMD_GET_I2C_DEVICE_STATUS = 0xBA,
29 RAVE_SP_CMD_GET_SP_SILICON_REV = 0xB9,
30 RAVE_SP_CMD_CONTROL_EVENTS = 0xBB,
31
32 RAVE_SP_EVNT_BASE = 0xE0,
33};
34
35struct rave_sp;
36
37static inline unsigned long rave_sp_action_pack(u8 event, u8 value)
38{
39 return ((unsigned long)value << 8) | event;
40}
41
42static inline u8 rave_sp_action_unpack_event(unsigned long action)
43{
44 return action;
45}
46
47static inline u8 rave_sp_action_unpack_value(unsigned long action)
48{
49 return action >> 8;
50}
51
52int rave_sp_exec(struct rave_sp *sp,
53 void *__data, size_t data_size,
54 void *reply_data, size_t reply_data_size);
55
56struct device;
57int devm_rave_sp_register_event_notifier(struct device *dev,
58 struct notifier_block *nb);
59
60#endif /* _LINUX_RAVE_SP_H_ */
diff --git a/include/linux/mfd/stm32-lptimer.h b/include/linux/mfd/stm32-lptimer.h
index 77c7cf40d9b4..605f62264825 100644
--- a/include/linux/mfd/stm32-lptimer.h
+++ b/include/linux/mfd/stm32-lptimer.h
@@ -1,13 +1,9 @@
1/* SPDX-License-Identifier: GPL-2.0 */
1/* 2/*
2 * STM32 Low-Power Timer parent driver. 3 * STM32 Low-Power Timer parent driver.
3 *
4 * Copyright (C) STMicroelectronics 2017 4 * Copyright (C) STMicroelectronics 2017
5 *
6 * Author: Fabrice Gasnier <fabrice.gasnier@st.com> 5 * Author: Fabrice Gasnier <fabrice.gasnier@st.com>
7 *
8 * Inspired by Benjamin Gaignard's stm32-timers driver 6 * Inspired by Benjamin Gaignard's stm32-timers driver
9 *
10 * License terms: GNU General Public License (GPL), version 2
11 */ 7 */
12 8
13#ifndef _LINUX_STM32_LPTIMER_H_ 9#ifndef _LINUX_STM32_LPTIMER_H_
diff --git a/include/linux/mfd/stm32-timers.h b/include/linux/mfd/stm32-timers.h
index ce7346e7f77a..2aadab6f34a1 100644
--- a/include/linux/mfd/stm32-timers.h
+++ b/include/linux/mfd/stm32-timers.h
@@ -1,9 +1,7 @@
1/* SPDX-License-Identifier: GPL-2.0 */
1/* 2/*
2 * Copyright (C) STMicroelectronics 2016 3 * Copyright (C) STMicroelectronics 2016
3 *
4 * Author: Benjamin Gaignard <benjamin.gaignard@st.com> 4 * Author: Benjamin Gaignard <benjamin.gaignard@st.com>
5 *
6 * License terms: GNU General Public License (GPL), version 2
7 */ 5 */
8 6
9#ifndef _LINUX_STM32_GPTIMER_H_ 7#ifndef _LINUX_STM32_GPTIMER_H_
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index e1cfe9194129..396a103c8bc6 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -25,26 +25,6 @@
25 writew((val) >> 16, (addr) + 2); \ 25 writew((val) >> 16, (addr) + 2); \
26 } while (0) 26 } while (0)
27 27
28#define CNF_CMD 0x04
29#define CNF_CTL_BASE 0x10
30#define CNF_INT_PIN 0x3d
31#define CNF_STOP_CLK_CTL 0x40
32#define CNF_GCLK_CTL 0x41
33#define CNF_SD_CLK_MODE 0x42
34#define CNF_PIN_STATUS 0x44
35#define CNF_PWR_CTL_1 0x48
36#define CNF_PWR_CTL_2 0x49
37#define CNF_PWR_CTL_3 0x4a
38#define CNF_CARD_DETECT_MODE 0x4c
39#define CNF_SD_SLOT 0x50
40#define CNF_EXT_GCLK_CTL_1 0xf0
41#define CNF_EXT_GCLK_CTL_2 0xf1
42#define CNF_EXT_GCLK_CTL_3 0xf9
43#define CNF_SD_LED_EN_1 0xfa
44#define CNF_SD_LED_EN_2 0xfe
45
46#define SDCREN 0x2 /* Enable access to MMC CTL regs. (flag in COMMAND_REG)*/
47
48#define sd_config_write8(base, shift, reg, val) \ 28#define sd_config_write8(base, shift, reg, val) \
49 tmio_iowrite8((val), (base) + ((reg) << (shift))) 29 tmio_iowrite8((val), (base) + ((reg) << (shift)))
50#define sd_config_write16(base, shift, reg, val) \ 30#define sd_config_write16(base, shift, reg, val) \
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index a886b51511ab..a0610427e168 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -36,6 +36,7 @@
36#include <linux/kernel.h> 36#include <linux/kernel.h>
37#include <linux/completion.h> 37#include <linux/completion.h>
38#include <linux/pci.h> 38#include <linux/pci.h>
39#include <linux/irq.h>
39#include <linux/spinlock_types.h> 40#include <linux/spinlock_types.h>
40#include <linux/semaphore.h> 41#include <linux/semaphore.h>
41#include <linux/slab.h> 42#include <linux/slab.h>
@@ -556,6 +557,7 @@ struct mlx5_core_sriov {
556}; 557};
557 558
558struct mlx5_irq_info { 559struct mlx5_irq_info {
560 cpumask_var_t mask;
559 char name[MLX5_MAX_IRQ_NAME]; 561 char name[MLX5_MAX_IRQ_NAME];
560}; 562};
561 563
@@ -1048,7 +1050,7 @@ int mlx5_create_map_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq, u8 vecidx,
1048 enum mlx5_eq_type type); 1050 enum mlx5_eq_type type);
1049int mlx5_destroy_unmap_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq); 1051int mlx5_destroy_unmap_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq);
1050int mlx5_start_eqs(struct mlx5_core_dev *dev); 1052int mlx5_start_eqs(struct mlx5_core_dev *dev);
1051int mlx5_stop_eqs(struct mlx5_core_dev *dev); 1053void mlx5_stop_eqs(struct mlx5_core_dev *dev);
1052int mlx5_vector2eqn(struct mlx5_core_dev *dev, int vector, int *eqn, 1054int mlx5_vector2eqn(struct mlx5_core_dev *dev, int vector, int *eqn,
1053 unsigned int *irqn); 1055 unsigned int *irqn);
1054int mlx5_core_attach_mcg(struct mlx5_core_dev *dev, union ib_gid *mgid, u32 qpn); 1056int mlx5_core_attach_mcg(struct mlx5_core_dev *dev, union ib_gid *mgid, u32 qpn);
@@ -1164,6 +1166,10 @@ int mlx5_cmd_create_vport_lag(struct mlx5_core_dev *dev);
1164int mlx5_cmd_destroy_vport_lag(struct mlx5_core_dev *dev); 1166int mlx5_cmd_destroy_vport_lag(struct mlx5_core_dev *dev);
1165bool mlx5_lag_is_active(struct mlx5_core_dev *dev); 1167bool mlx5_lag_is_active(struct mlx5_core_dev *dev);
1166struct net_device *mlx5_lag_get_roce_netdev(struct mlx5_core_dev *dev); 1168struct net_device *mlx5_lag_get_roce_netdev(struct mlx5_core_dev *dev);
1169int mlx5_lag_query_cong_counters(struct mlx5_core_dev *dev,
1170 u64 *values,
1171 int num_counters,
1172 size_t *offsets);
1167struct mlx5_uars_page *mlx5_get_uars_page(struct mlx5_core_dev *mdev); 1173struct mlx5_uars_page *mlx5_get_uars_page(struct mlx5_core_dev *mdev);
1168void mlx5_put_uars_page(struct mlx5_core_dev *mdev, struct mlx5_uars_page *up); 1174void mlx5_put_uars_page(struct mlx5_core_dev *mdev, struct mlx5_uars_page *up);
1169 1175
@@ -1226,7 +1232,23 @@ enum {
1226static inline const struct cpumask * 1232static inline const struct cpumask *
1227mlx5_get_vector_affinity(struct mlx5_core_dev *dev, int vector) 1233mlx5_get_vector_affinity(struct mlx5_core_dev *dev, int vector)
1228{ 1234{
1229 return pci_irq_get_affinity(dev->pdev, MLX5_EQ_VEC_COMP_BASE + vector); 1235 const struct cpumask *mask;
1236 struct irq_desc *desc;
1237 unsigned int irq;
1238 int eqn;
1239 int err;
1240
1241 err = mlx5_vector2eqn(dev, vector, &eqn, &irq);
1242 if (err)
1243 return NULL;
1244
1245 desc = irq_to_desc(irq);
1246#ifdef CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK
1247 mask = irq_data_get_effective_affinity_mask(&desc->irq_data);
1248#else
1249 mask = desc->irq_common_data.affinity;
1250#endif
1251 return mask;
1230} 1252}
1231 1253
1232#endif /* MLX5_DRIVER_H */ 1254#endif /* MLX5_DRIVER_H */
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index 38a7577a9ce7..1391a82da98e 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -147,7 +147,7 @@ enum {
147 MLX5_CMD_OP_ALLOC_Q_COUNTER = 0x771, 147 MLX5_CMD_OP_ALLOC_Q_COUNTER = 0x771,
148 MLX5_CMD_OP_DEALLOC_Q_COUNTER = 0x772, 148 MLX5_CMD_OP_DEALLOC_Q_COUNTER = 0x772,
149 MLX5_CMD_OP_QUERY_Q_COUNTER = 0x773, 149 MLX5_CMD_OP_QUERY_Q_COUNTER = 0x773,
150 MLX5_CMD_OP_SET_RATE_LIMIT = 0x780, 150 MLX5_CMD_OP_SET_PP_RATE_LIMIT = 0x780,
151 MLX5_CMD_OP_QUERY_RATE_LIMIT = 0x781, 151 MLX5_CMD_OP_QUERY_RATE_LIMIT = 0x781,
152 MLX5_CMD_OP_CREATE_SCHEDULING_ELEMENT = 0x782, 152 MLX5_CMD_OP_CREATE_SCHEDULING_ELEMENT = 0x782,
153 MLX5_CMD_OP_DESTROY_SCHEDULING_ELEMENT = 0x783, 153 MLX5_CMD_OP_DESTROY_SCHEDULING_ELEMENT = 0x783,
@@ -1027,8 +1027,9 @@ struct mlx5_ifc_cmd_hca_cap_bits {
1027 u8 log_max_wq_sz[0x5]; 1027 u8 log_max_wq_sz[0x5];
1028 1028
1029 u8 nic_vport_change_event[0x1]; 1029 u8 nic_vport_change_event[0x1];
1030 u8 disable_local_lb[0x1]; 1030 u8 disable_local_lb_uc[0x1];
1031 u8 reserved_at_3e2[0x9]; 1031 u8 disable_local_lb_mc[0x1];
1032 u8 reserved_at_3e3[0x8];
1032 u8 log_max_vlan_list[0x5]; 1033 u8 log_max_vlan_list[0x5];
1033 u8 reserved_at_3f0[0x3]; 1034 u8 reserved_at_3f0[0x3];
1034 u8 log_max_current_mc_list[0x5]; 1035 u8 log_max_current_mc_list[0x5];
@@ -7239,7 +7240,7 @@ struct mlx5_ifc_add_vxlan_udp_dport_in_bits {
7239 u8 vxlan_udp_port[0x10]; 7240 u8 vxlan_udp_port[0x10];
7240}; 7241};
7241 7242
7242struct mlx5_ifc_set_rate_limit_out_bits { 7243struct mlx5_ifc_set_pp_rate_limit_out_bits {
7243 u8 status[0x8]; 7244 u8 status[0x8];
7244 u8 reserved_at_8[0x18]; 7245 u8 reserved_at_8[0x18];
7245 7246
@@ -7248,7 +7249,7 @@ struct mlx5_ifc_set_rate_limit_out_bits {
7248 u8 reserved_at_40[0x40]; 7249 u8 reserved_at_40[0x40];
7249}; 7250};
7250 7251
7251struct mlx5_ifc_set_rate_limit_in_bits { 7252struct mlx5_ifc_set_pp_rate_limit_in_bits {
7252 u8 opcode[0x10]; 7253 u8 opcode[0x10];
7253 u8 reserved_at_10[0x10]; 7254 u8 reserved_at_10[0x10];
7254 7255
@@ -7261,6 +7262,8 @@ struct mlx5_ifc_set_rate_limit_in_bits {
7261 u8 reserved_at_60[0x20]; 7262 u8 reserved_at_60[0x20];
7262 7263
7263 u8 rate_limit[0x20]; 7264 u8 rate_limit[0x20];
7265
7266 u8 reserved_at_a0[0x160];
7264}; 7267};
7265 7268
7266struct mlx5_ifc_access_register_out_bits { 7269struct mlx5_ifc_access_register_out_bits {
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index e7743eca1021..85146235231e 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -324,6 +324,7 @@ struct mmc_host {
324#define MMC_CAP_DRIVER_TYPE_A (1 << 23) /* Host supports Driver Type A */ 324#define MMC_CAP_DRIVER_TYPE_A (1 << 23) /* Host supports Driver Type A */
325#define MMC_CAP_DRIVER_TYPE_C (1 << 24) /* Host supports Driver Type C */ 325#define MMC_CAP_DRIVER_TYPE_C (1 << 24) /* Host supports Driver Type C */
326#define MMC_CAP_DRIVER_TYPE_D (1 << 25) /* Host supports Driver Type D */ 326#define MMC_CAP_DRIVER_TYPE_D (1 << 25) /* Host supports Driver Type D */
327#define MMC_CAP_DONE_COMPLETE (1 << 27) /* RW reqs can be completed within mmc_request_done() */
327#define MMC_CAP_CD_WAKE (1 << 28) /* Enable card detect wake */ 328#define MMC_CAP_CD_WAKE (1 << 28) /* Enable card detect wake */
328#define MMC_CAP_CMD_DURING_TFR (1 << 29) /* Commands during data transfer */ 329#define MMC_CAP_CMD_DURING_TFR (1 << 29) /* Commands during data transfer */
329#define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */ 330#define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */
@@ -380,6 +381,7 @@ struct mmc_host {
380 unsigned int doing_retune:1; /* re-tuning in progress */ 381 unsigned int doing_retune:1; /* re-tuning in progress */
381 unsigned int retune_now:1; /* do re-tuning at next req */ 382 unsigned int retune_now:1; /* do re-tuning at next req */
382 unsigned int retune_paused:1; /* re-tuning is temporarily disabled */ 383 unsigned int retune_paused:1; /* re-tuning is temporarily disabled */
384 unsigned int use_blk_mq:1; /* use blk-mq */
383 385
384 int rescan_disable; /* disable card detection */ 386 int rescan_disable; /* disable card detection */
385 int rescan_entered; /* used with nonremovable devices */ 387 int rescan_entered; /* used with nonremovable devices */
@@ -422,9 +424,6 @@ struct mmc_host {
422 424
423 struct dentry *debugfs_root; 425 struct dentry *debugfs_root;
424 426
425 struct mmc_async_req *areq; /* active async req */
426 struct mmc_context_info context_info; /* async synchronization info */
427
428 /* Ongoing data transfer that allows commands during transfer */ 427 /* Ongoing data transfer that allows commands during transfer */
429 struct mmc_request *ongoing_mrq; 428 struct mmc_request *ongoing_mrq;
430 429
diff --git a/include/linux/mmc/slot-gpio.h b/include/linux/mmc/slot-gpio.h
index 82f0d289f110..91f1ba0663c8 100644
--- a/include/linux/mmc/slot-gpio.h
+++ b/include/linux/mmc/slot-gpio.h
@@ -33,5 +33,6 @@ void mmc_gpio_set_cd_isr(struct mmc_host *host,
33 irqreturn_t (*isr)(int irq, void *dev_id)); 33 irqreturn_t (*isr)(int irq, void *dev_id));
34void mmc_gpiod_request_cd_irq(struct mmc_host *host); 34void mmc_gpiod_request_cd_irq(struct mmc_host *host);
35bool mmc_can_gpio_cd(struct mmc_host *host); 35bool mmc_can_gpio_cd(struct mmc_host *host);
36bool mmc_can_gpio_ro(struct mmc_host *host);
36 37
37#endif 38#endif
diff --git a/include/linux/module.h b/include/linux/module.h
index c69b49abe877..1d8f245967be 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -801,6 +801,15 @@ static inline void module_bug_finalize(const Elf_Ehdr *hdr,
801static inline void module_bug_cleanup(struct module *mod) {} 801static inline void module_bug_cleanup(struct module *mod) {}
802#endif /* CONFIG_GENERIC_BUG */ 802#endif /* CONFIG_GENERIC_BUG */
803 803
804#ifdef RETPOLINE
805extern bool retpoline_module_ok(bool has_retpoline);
806#else
807static inline bool retpoline_module_ok(bool has_retpoline)
808{
809 return true;
810}
811#endif
812
804#ifdef CONFIG_MODULE_SIG 813#ifdef CONFIG_MODULE_SIG
805static inline bool module_sig_ok(struct module *module) 814static inline bool module_sig_ok(struct module *module)
806{ 815{
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h
index 3aa56e3104bb..b5b43f94f311 100644
--- a/include/linux/mtd/map.h
+++ b/include/linux/mtd/map.h
@@ -270,75 +270,67 @@ void map_destroy(struct mtd_info *mtd);
270#define INVALIDATE_CACHED_RANGE(map, from, size) \ 270#define INVALIDATE_CACHED_RANGE(map, from, size) \
271 do { if (map->inval_cache) map->inval_cache(map, from, size); } while (0) 271 do { if (map->inval_cache) map->inval_cache(map, from, size); } while (0)
272 272
273 273#define map_word_equal(map, val1, val2) \
274static inline int map_word_equal(struct map_info *map, map_word val1, map_word val2) 274({ \
275{ 275 int i, ret = 1; \
276 int i; 276 for (i = 0; i < map_words(map); i++) \
277 277 if ((val1).x[i] != (val2).x[i]) { \
278 for (i = 0; i < map_words(map); i++) { 278 ret = 0; \
279 if (val1.x[i] != val2.x[i]) 279 break; \
280 return 0; 280 } \
281 } 281 ret; \
282 282})
283 return 1; 283
284} 284#define map_word_and(map, val1, val2) \
285 285({ \
286static inline map_word map_word_and(struct map_info *map, map_word val1, map_word val2) 286 map_word r; \
287{ 287 int i; \
288 map_word r; 288 for (i = 0; i < map_words(map); i++) \
289 int i; 289 r.x[i] = (val1).x[i] & (val2).x[i]; \
290 290 r; \
291 for (i = 0; i < map_words(map); i++) 291})
292 r.x[i] = val1.x[i] & val2.x[i]; 292
293 293#define map_word_clr(map, val1, val2) \
294 return r; 294({ \
295} 295 map_word r; \
296 296 int i; \
297static inline map_word map_word_clr(struct map_info *map, map_word val1, map_word val2) 297 for (i = 0; i < map_words(map); i++) \
298{ 298 r.x[i] = (val1).x[i] & ~(val2).x[i]; \
299 map_word r; 299 r; \
300 int i; 300})
301 301
302 for (i = 0; i < map_words(map); i++) 302#define map_word_or(map, val1, val2) \
303 r.x[i] = val1.x[i] & ~val2.x[i]; 303({ \
304 304 map_word r; \
305 return r; 305 int i; \
306} 306 for (i = 0; i < map_words(map); i++) \
307 307 r.x[i] = (val1).x[i] | (val2).x[i]; \
308static inline map_word map_word_or(struct map_info *map, map_word val1, map_word val2) 308 r; \
309{ 309})
310 map_word r; 310
311 int i; 311#define map_word_andequal(map, val1, val2, val3) \
312 312({ \
313 for (i = 0; i < map_words(map); i++) 313 int i, ret = 1; \
314 r.x[i] = val1.x[i] | val2.x[i]; 314 for (i = 0; i < map_words(map); i++) { \
315 315 if (((val1).x[i] & (val2).x[i]) != (val2).x[i]) { \
316 return r; 316 ret = 0; \
317} 317 break; \
318 318 } \
319static inline int map_word_andequal(struct map_info *map, map_word val1, map_word val2, map_word val3) 319 } \
320{ 320 ret; \
321 int i; 321})
322 322
323 for (i = 0; i < map_words(map); i++) { 323#define map_word_bitsset(map, val1, val2) \
324 if ((val1.x[i] & val2.x[i]) != val3.x[i]) 324({ \
325 return 0; 325 int i, ret = 0; \
326 } 326 for (i = 0; i < map_words(map); i++) { \
327 327 if ((val1).x[i] & (val2).x[i]) { \
328 return 1; 328 ret = 1; \
329} 329 break; \
330 330 } \
331static inline int map_word_bitsset(struct map_info *map, map_word val1, map_word val2) 331 } \
332{ 332 ret; \
333 int i; 333})
334
335 for (i = 0; i < map_words(map); i++) {
336 if (val1.x[i] & val2.x[i])
337 return 1;
338 }
339
340 return 0;
341}
342 334
343static inline map_word map_word_load(struct map_info *map, const void *ptr) 335static inline map_word map_word_load(struct map_info *map, const void *ptr)
344{ 336{
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index cd55bf14ad51..205ededccc60 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -489,6 +489,34 @@ static inline uint32_t mtd_mod_by_eb(uint64_t sz, struct mtd_info *mtd)
489 return do_div(sz, mtd->erasesize); 489 return do_div(sz, mtd->erasesize);
490} 490}
491 491
492/**
493 * mtd_align_erase_req - Adjust an erase request to align things on eraseblock
494 * boundaries.
495 * @mtd: the MTD device this erase request applies on
496 * @req: the erase request to adjust
497 *
498 * This function will adjust @req->addr and @req->len to align them on
499 * @mtd->erasesize. Of course we expect @mtd->erasesize to be != 0.
500 */
501static inline void mtd_align_erase_req(struct mtd_info *mtd,
502 struct erase_info *req)
503{
504 u32 mod;
505
506 if (WARN_ON(!mtd->erasesize))
507 return;
508
509 mod = mtd_mod_by_eb(req->addr, mtd);
510 if (mod) {
511 req->addr -= mod;
512 req->len += mod;
513 }
514
515 mod = mtd_mod_by_eb(req->addr + req->len, mtd);
516 if (mod)
517 req->len += mtd->erasesize - mod;
518}
519
492static inline uint32_t mtd_div_by_ws(uint64_t sz, struct mtd_info *mtd) 520static inline uint32_t mtd_div_by_ws(uint64_t sz, struct mtd_info *mtd)
493{ 521{
494 if (mtd->writesize_shift) 522 if (mtd->writesize_shift)
diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
index 749bb08c4772..56c5570aadbe 100644
--- a/include/linux/mtd/rawnand.h
+++ b/include/linux/mtd/rawnand.h
@@ -133,12 +133,6 @@ enum nand_ecc_algo {
133 */ 133 */
134#define NAND_ECC_GENERIC_ERASED_CHECK BIT(0) 134#define NAND_ECC_GENERIC_ERASED_CHECK BIT(0)
135#define NAND_ECC_MAXIMIZE BIT(1) 135#define NAND_ECC_MAXIMIZE BIT(1)
136/*
137 * If your controller already sends the required NAND commands when
138 * reading or writing a page, then the framework is not supposed to
139 * send READ0 and SEQIN/PAGEPROG respectively.
140 */
141#define NAND_ECC_CUSTOM_PAGE_ACCESS BIT(2)
142 136
143/* Bit mask for flags passed to do_nand_read_ecc */ 137/* Bit mask for flags passed to do_nand_read_ecc */
144#define NAND_GET_DEVICE 0x80 138#define NAND_GET_DEVICE 0x80
@@ -191,11 +185,6 @@ enum nand_ecc_algo {
191/* Non chip related options */ 185/* Non chip related options */
192/* This option skips the bbt scan during initialization. */ 186/* This option skips the bbt scan during initialization. */
193#define NAND_SKIP_BBTSCAN 0x00010000 187#define NAND_SKIP_BBTSCAN 0x00010000
194/*
195 * This option is defined if the board driver allocates its own buffers
196 * (e.g. because it needs them DMA-coherent).
197 */
198#define NAND_OWN_BUFFERS 0x00020000
199/* Chip may not exist, so silence any errors in scan */ 188/* Chip may not exist, so silence any errors in scan */
200#define NAND_SCAN_SILENT_NODEV 0x00040000 189#define NAND_SCAN_SILENT_NODEV 0x00040000
201/* 190/*
@@ -525,6 +514,8 @@ static const struct nand_ecc_caps __name = { \
525 * @postpad: padding information for syndrome based ECC generators 514 * @postpad: padding information for syndrome based ECC generators
526 * @options: ECC specific options (see NAND_ECC_XXX flags defined above) 515 * @options: ECC specific options (see NAND_ECC_XXX flags defined above)
527 * @priv: pointer to private ECC control data 516 * @priv: pointer to private ECC control data
517 * @calc_buf: buffer for calculated ECC, size is oobsize.
518 * @code_buf: buffer for ECC read from flash, size is oobsize.
528 * @hwctl: function to control hardware ECC generator. Must only 519 * @hwctl: function to control hardware ECC generator. Must only
529 * be provided if an hardware ECC is available 520 * be provided if an hardware ECC is available
530 * @calculate: function for ECC calculation or readback from ECC hardware 521 * @calculate: function for ECC calculation or readback from ECC hardware
@@ -575,6 +566,8 @@ struct nand_ecc_ctrl {
575 int postpad; 566 int postpad;
576 unsigned int options; 567 unsigned int options;
577 void *priv; 568 void *priv;
569 u8 *calc_buf;
570 u8 *code_buf;
578 void (*hwctl)(struct mtd_info *mtd, int mode); 571 void (*hwctl)(struct mtd_info *mtd, int mode);
579 int (*calculate)(struct mtd_info *mtd, const uint8_t *dat, 572 int (*calculate)(struct mtd_info *mtd, const uint8_t *dat,
580 uint8_t *ecc_code); 573 uint8_t *ecc_code);
@@ -602,26 +595,6 @@ struct nand_ecc_ctrl {
602 int page); 595 int page);
603}; 596};
604 597
605static inline int nand_standard_page_accessors(struct nand_ecc_ctrl *ecc)
606{
607 return !(ecc->options & NAND_ECC_CUSTOM_PAGE_ACCESS);
608}
609
610/**
611 * struct nand_buffers - buffer structure for read/write
612 * @ecccalc: buffer pointer for calculated ECC, size is oobsize.
613 * @ecccode: buffer pointer for ECC read from flash, size is oobsize.
614 * @databuf: buffer pointer for data, size is (page size + oobsize).
615 *
616 * Do not change the order of buffers. databuf and oobrbuf must be in
617 * consecutive order.
618 */
619struct nand_buffers {
620 uint8_t *ecccalc;
621 uint8_t *ecccode;
622 uint8_t *databuf;
623};
624
625/** 598/**
626 * struct nand_sdr_timings - SDR NAND chip timings 599 * struct nand_sdr_timings - SDR NAND chip timings
627 * 600 *
@@ -762,6 +735,350 @@ struct nand_manufacturer_ops {
762}; 735};
763 736
764/** 737/**
738 * struct nand_op_cmd_instr - Definition of a command instruction
739 * @opcode: the command to issue in one cycle
740 */
741struct nand_op_cmd_instr {
742 u8 opcode;
743};
744
745/**
746 * struct nand_op_addr_instr - Definition of an address instruction
747 * @naddrs: length of the @addrs array
748 * @addrs: array containing the address cycles to issue
749 */
750struct nand_op_addr_instr {
751 unsigned int naddrs;
752 const u8 *addrs;
753};
754
755/**
756 * struct nand_op_data_instr - Definition of a data instruction
757 * @len: number of data bytes to move
758 * @in: buffer to fill when reading from the NAND chip
759 * @out: buffer to read from when writing to the NAND chip
760 * @force_8bit: force 8-bit access
761 *
762 * Please note that "in" and "out" are inverted from the ONFI specification
763 * and are from the controller perspective, so a "in" is a read from the NAND
764 * chip while a "out" is a write to the NAND chip.
765 */
766struct nand_op_data_instr {
767 unsigned int len;
768 union {
769 void *in;
770 const void *out;
771 } buf;
772 bool force_8bit;
773};
774
775/**
776 * struct nand_op_waitrdy_instr - Definition of a wait ready instruction
777 * @timeout_ms: maximum delay while waiting for the ready/busy pin in ms
778 */
779struct nand_op_waitrdy_instr {
780 unsigned int timeout_ms;
781};
782
783/**
784 * enum nand_op_instr_type - Definition of all instruction types
785 * @NAND_OP_CMD_INSTR: command instruction
786 * @NAND_OP_ADDR_INSTR: address instruction
787 * @NAND_OP_DATA_IN_INSTR: data in instruction
788 * @NAND_OP_DATA_OUT_INSTR: data out instruction
789 * @NAND_OP_WAITRDY_INSTR: wait ready instruction
790 */
791enum nand_op_instr_type {
792 NAND_OP_CMD_INSTR,
793 NAND_OP_ADDR_INSTR,
794 NAND_OP_DATA_IN_INSTR,
795 NAND_OP_DATA_OUT_INSTR,
796 NAND_OP_WAITRDY_INSTR,
797};
798
799/**
800 * struct nand_op_instr - Instruction object
801 * @type: the instruction type
802 * @cmd/@addr/@data/@waitrdy: extra data associated to the instruction.
803 * You'll have to use the appropriate element
804 * depending on @type
805 * @delay_ns: delay the controller should apply after the instruction has been
806 * issued on the bus. Most modern controllers have internal timings
807 * control logic, and in this case, the controller driver can ignore
808 * this field.
809 */
810struct nand_op_instr {
811 enum nand_op_instr_type type;
812 union {
813 struct nand_op_cmd_instr cmd;
814 struct nand_op_addr_instr addr;
815 struct nand_op_data_instr data;
816 struct nand_op_waitrdy_instr waitrdy;
817 } ctx;
818 unsigned int delay_ns;
819};
820
821/*
822 * Special handling must be done for the WAITRDY timeout parameter as it usually
823 * is either tPROG (after a prog), tR (before a read), tRST (during a reset) or
824 * tBERS (during an erase) which all of them are u64 values that cannot be
825 * divided by usual kernel macros and must be handled with the special
826 * DIV_ROUND_UP_ULL() macro.
827 */
828#define __DIVIDE(dividend, divisor) ({ \
829 sizeof(dividend) == sizeof(u32) ? \
830 DIV_ROUND_UP(dividend, divisor) : \
831 DIV_ROUND_UP_ULL(dividend, divisor); \
832 })
833#define PSEC_TO_NSEC(x) __DIVIDE(x, 1000)
834#define PSEC_TO_MSEC(x) __DIVIDE(x, 1000000000)
835
836#define NAND_OP_CMD(id, ns) \
837 { \
838 .type = NAND_OP_CMD_INSTR, \
839 .ctx.cmd.opcode = id, \
840 .delay_ns = ns, \
841 }
842
843#define NAND_OP_ADDR(ncycles, cycles, ns) \
844 { \
845 .type = NAND_OP_ADDR_INSTR, \
846 .ctx.addr = { \
847 .naddrs = ncycles, \
848 .addrs = cycles, \
849 }, \
850 .delay_ns = ns, \
851 }
852
853#define NAND_OP_DATA_IN(l, b, ns) \
854 { \
855 .type = NAND_OP_DATA_IN_INSTR, \
856 .ctx.data = { \
857 .len = l, \
858 .buf.in = b, \
859 .force_8bit = false, \
860 }, \
861 .delay_ns = ns, \
862 }
863
864#define NAND_OP_DATA_OUT(l, b, ns) \
865 { \
866 .type = NAND_OP_DATA_OUT_INSTR, \
867 .ctx.data = { \
868 .len = l, \
869 .buf.out = b, \
870 .force_8bit = false, \
871 }, \
872 .delay_ns = ns, \
873 }
874
875#define NAND_OP_8BIT_DATA_IN(l, b, ns) \
876 { \
877 .type = NAND_OP_DATA_IN_INSTR, \
878 .ctx.data = { \
879 .len = l, \
880 .buf.in = b, \
881 .force_8bit = true, \
882 }, \
883 .delay_ns = ns, \
884 }
885
886#define NAND_OP_8BIT_DATA_OUT(l, b, ns) \
887 { \
888 .type = NAND_OP_DATA_OUT_INSTR, \
889 .ctx.data = { \
890 .len = l, \
891 .buf.out = b, \
892 .force_8bit = true, \
893 }, \
894 .delay_ns = ns, \
895 }
896
897#define NAND_OP_WAIT_RDY(tout_ms, ns) \
898 { \
899 .type = NAND_OP_WAITRDY_INSTR, \
900 .ctx.waitrdy.timeout_ms = tout_ms, \
901 .delay_ns = ns, \
902 }
903
904/**
905 * struct nand_subop - a sub operation
906 * @instrs: array of instructions
907 * @ninstrs: length of the @instrs array
908 * @first_instr_start_off: offset to start from for the first instruction
909 * of the sub-operation
910 * @last_instr_end_off: offset to end at (excluded) for the last instruction
911 * of the sub-operation
912 *
913 * Both @first_instr_start_off and @last_instr_end_off only apply to data or
914 * address instructions.
915 *
916 * When an operation cannot be handled as is by the NAND controller, it will
917 * be split by the parser into sub-operations which will be passed to the
918 * controller driver.
919 */
920struct nand_subop {
921 const struct nand_op_instr *instrs;
922 unsigned int ninstrs;
923 unsigned int first_instr_start_off;
924 unsigned int last_instr_end_off;
925};
926
927int nand_subop_get_addr_start_off(const struct nand_subop *subop,
928 unsigned int op_id);
929int nand_subop_get_num_addr_cyc(const struct nand_subop *subop,
930 unsigned int op_id);
931int nand_subop_get_data_start_off(const struct nand_subop *subop,
932 unsigned int op_id);
933int nand_subop_get_data_len(const struct nand_subop *subop,
934 unsigned int op_id);
935
936/**
937 * struct nand_op_parser_addr_constraints - Constraints for address instructions
938 * @maxcycles: maximum number of address cycles the controller can issue in a
939 * single step
940 */
941struct nand_op_parser_addr_constraints {
942 unsigned int maxcycles;
943};
944
945/**
946 * struct nand_op_parser_data_constraints - Constraints for data instructions
947 * @maxlen: maximum data length that the controller can handle in a single step
948 */
949struct nand_op_parser_data_constraints {
950 unsigned int maxlen;
951};
952
953/**
954 * struct nand_op_parser_pattern_elem - One element of a pattern
955 * @type: the instructuction type
956 * @optional: whether this element of the pattern is optional or mandatory
957 * @addr/@data: address or data constraint (number of cycles or data length)
958 */
959struct nand_op_parser_pattern_elem {
960 enum nand_op_instr_type type;
961 bool optional;
962 union {
963 struct nand_op_parser_addr_constraints addr;
964 struct nand_op_parser_data_constraints data;
965 } ctx;
966};
967
968#define NAND_OP_PARSER_PAT_CMD_ELEM(_opt) \
969 { \
970 .type = NAND_OP_CMD_INSTR, \
971 .optional = _opt, \
972 }
973
974#define NAND_OP_PARSER_PAT_ADDR_ELEM(_opt, _maxcycles) \
975 { \
976 .type = NAND_OP_ADDR_INSTR, \
977 .optional = _opt, \
978 .ctx.addr.maxcycles = _maxcycles, \
979 }
980
981#define NAND_OP_PARSER_PAT_DATA_IN_ELEM(_opt, _maxlen) \
982 { \
983 .type = NAND_OP_DATA_IN_INSTR, \
984 .optional = _opt, \
985 .ctx.data.maxlen = _maxlen, \
986 }
987
988#define NAND_OP_PARSER_PAT_DATA_OUT_ELEM(_opt, _maxlen) \
989 { \
990 .type = NAND_OP_DATA_OUT_INSTR, \
991 .optional = _opt, \
992 .ctx.data.maxlen = _maxlen, \
993 }
994
995#define NAND_OP_PARSER_PAT_WAITRDY_ELEM(_opt) \
996 { \
997 .type = NAND_OP_WAITRDY_INSTR, \
998 .optional = _opt, \
999 }
1000
1001/**
1002 * struct nand_op_parser_pattern - NAND sub-operation pattern descriptor
1003 * @elems: array of pattern elements
1004 * @nelems: number of pattern elements in @elems array
1005 * @exec: the function that will issue a sub-operation
1006 *
1007 * A pattern is a list of elements, each element reprensenting one instruction
1008 * with its constraints. The pattern itself is used by the core to match NAND
1009 * chip operation with NAND controller operations.
1010 * Once a match between a NAND controller operation pattern and a NAND chip
1011 * operation (or a sub-set of a NAND operation) is found, the pattern ->exec()
1012 * hook is called so that the controller driver can issue the operation on the
1013 * bus.
1014 *
1015 * Controller drivers should declare as many patterns as they support and pass
1016 * this list of patterns (created with the help of the following macro) to
1017 * the nand_op_parser_exec_op() helper.
1018 */
1019struct nand_op_parser_pattern {
1020 const struct nand_op_parser_pattern_elem *elems;
1021 unsigned int nelems;
1022 int (*exec)(struct nand_chip *chip, const struct nand_subop *subop);
1023};
1024
1025#define NAND_OP_PARSER_PATTERN(_exec, ...) \
1026 { \
1027 .exec = _exec, \
1028 .elems = (struct nand_op_parser_pattern_elem[]) { __VA_ARGS__ }, \
1029 .nelems = sizeof((struct nand_op_parser_pattern_elem[]) { __VA_ARGS__ }) / \
1030 sizeof(struct nand_op_parser_pattern_elem), \
1031 }
1032
1033/**
1034 * struct nand_op_parser - NAND controller operation parser descriptor
1035 * @patterns: array of supported patterns
1036 * @npatterns: length of the @patterns array
1037 *
1038 * The parser descriptor is just an array of supported patterns which will be
1039 * iterated by nand_op_parser_exec_op() everytime it tries to execute an
1040 * NAND operation (or tries to determine if a specific operation is supported).
1041 *
1042 * It is worth mentioning that patterns will be tested in their declaration
1043 * order, and the first match will be taken, so it's important to order patterns
1044 * appropriately so that simple/inefficient patterns are placed at the end of
1045 * the list. Usually, this is where you put single instruction patterns.
1046 */
1047struct nand_op_parser {
1048 const struct nand_op_parser_pattern *patterns;
1049 unsigned int npatterns;
1050};
1051
1052#define NAND_OP_PARSER(...) \
1053 { \
1054 .patterns = (struct nand_op_parser_pattern[]) { __VA_ARGS__ }, \
1055 .npatterns = sizeof((struct nand_op_parser_pattern[]) { __VA_ARGS__ }) / \
1056 sizeof(struct nand_op_parser_pattern), \
1057 }
1058
1059/**
1060 * struct nand_operation - NAND operation descriptor
1061 * @instrs: array of instructions to execute
1062 * @ninstrs: length of the @instrs array
1063 *
1064 * The actual operation structure that will be passed to chip->exec_op().
1065 */
1066struct nand_operation {
1067 const struct nand_op_instr *instrs;
1068 unsigned int ninstrs;
1069};
1070
1071#define NAND_OPERATION(_instrs) \
1072 { \
1073 .instrs = _instrs, \
1074 .ninstrs = ARRAY_SIZE(_instrs), \
1075 }
1076
1077int nand_op_parser_exec_op(struct nand_chip *chip,
1078 const struct nand_op_parser *parser,
1079 const struct nand_operation *op, bool check_only);
1080
1081/**
765 * struct nand_chip - NAND Private Flash Chip Data 1082 * struct nand_chip - NAND Private Flash Chip Data
766 * @mtd: MTD device registered to the MTD framework 1083 * @mtd: MTD device registered to the MTD framework
767 * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the 1084 * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the
@@ -787,10 +1104,13 @@ struct nand_manufacturer_ops {
787 * commands to the chip. 1104 * commands to the chip.
788 * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on 1105 * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on
789 * ready. 1106 * ready.
1107 * @exec_op: controller specific method to execute NAND operations.
1108 * This method replaces ->cmdfunc(),
1109 * ->{read,write}_{buf,byte,word}(), ->dev_ready() and
1110 * ->waifunc().
790 * @setup_read_retry: [FLASHSPECIFIC] flash (vendor) specific function for 1111 * @setup_read_retry: [FLASHSPECIFIC] flash (vendor) specific function for
791 * setting the read-retry mode. Mostly needed for MLC NAND. 1112 * setting the read-retry mode. Mostly needed for MLC NAND.
792 * @ecc: [BOARDSPECIFIC] ECC control structure 1113 * @ecc: [BOARDSPECIFIC] ECC control structure
793 * @buffers: buffer structure for read/write
794 * @buf_align: minimum buffer alignment required by a platform 1114 * @buf_align: minimum buffer alignment required by a platform
795 * @hwcontrol: platform-specific hardware control structure 1115 * @hwcontrol: platform-specific hardware control structure
796 * @erase: [REPLACEABLE] erase function 1116 * @erase: [REPLACEABLE] erase function
@@ -830,6 +1150,7 @@ struct nand_manufacturer_ops {
830 * @numchips: [INTERN] number of physical chips 1150 * @numchips: [INTERN] number of physical chips
831 * @chipsize: [INTERN] the size of one chip for multichip arrays 1151 * @chipsize: [INTERN] the size of one chip for multichip arrays
832 * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1 1152 * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1
1153 * @data_buf: [INTERN] buffer for data, size is (page size + oobsize).
833 * @pagebuf: [INTERN] holds the pagenumber which is currently in 1154 * @pagebuf: [INTERN] holds the pagenumber which is currently in
834 * data_buf. 1155 * data_buf.
835 * @pagebuf_bitflips: [INTERN] holds the bitflip count for the page which is 1156 * @pagebuf_bitflips: [INTERN] holds the bitflip count for the page which is
@@ -886,6 +1207,9 @@ struct nand_chip {
886 void (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column, 1207 void (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column,
887 int page_addr); 1208 int page_addr);
888 int(*waitfunc)(struct mtd_info *mtd, struct nand_chip *this); 1209 int(*waitfunc)(struct mtd_info *mtd, struct nand_chip *this);
1210 int (*exec_op)(struct nand_chip *chip,
1211 const struct nand_operation *op,
1212 bool check_only);
889 int (*erase)(struct mtd_info *mtd, int page); 1213 int (*erase)(struct mtd_info *mtd, int page);
890 int (*scan_bbt)(struct mtd_info *mtd); 1214 int (*scan_bbt)(struct mtd_info *mtd);
891 int (*onfi_set_features)(struct mtd_info *mtd, struct nand_chip *chip, 1215 int (*onfi_set_features)(struct mtd_info *mtd, struct nand_chip *chip,
@@ -896,7 +1220,6 @@ struct nand_chip {
896 int (*setup_data_interface)(struct mtd_info *mtd, int chipnr, 1220 int (*setup_data_interface)(struct mtd_info *mtd, int chipnr,
897 const struct nand_data_interface *conf); 1221 const struct nand_data_interface *conf);
898 1222
899
900 int chip_delay; 1223 int chip_delay;
901 unsigned int options; 1224 unsigned int options;
902 unsigned int bbt_options; 1225 unsigned int bbt_options;
@@ -908,6 +1231,7 @@ struct nand_chip {
908 int numchips; 1231 int numchips;
909 uint64_t chipsize; 1232 uint64_t chipsize;
910 int pagemask; 1233 int pagemask;
1234 u8 *data_buf;
911 int pagebuf; 1235 int pagebuf;
912 unsigned int pagebuf_bitflips; 1236 unsigned int pagebuf_bitflips;
913 int subpagesize; 1237 int subpagesize;
@@ -928,7 +1252,7 @@ struct nand_chip {
928 u16 max_bb_per_die; 1252 u16 max_bb_per_die;
929 u32 blocks_per_die; 1253 u32 blocks_per_die;
930 1254
931 struct nand_data_interface *data_interface; 1255 struct nand_data_interface data_interface;
932 1256
933 int read_retries; 1257 int read_retries;
934 1258
@@ -938,7 +1262,6 @@ struct nand_chip {
938 struct nand_hw_control *controller; 1262 struct nand_hw_control *controller;
939 1263
940 struct nand_ecc_ctrl ecc; 1264 struct nand_ecc_ctrl ecc;
941 struct nand_buffers *buffers;
942 unsigned long buf_align; 1265 unsigned long buf_align;
943 struct nand_hw_control hwcontrol; 1266 struct nand_hw_control hwcontrol;
944 1267
@@ -956,6 +1279,15 @@ struct nand_chip {
956 } manufacturer; 1279 } manufacturer;
957}; 1280};
958 1281
1282static inline int nand_exec_op(struct nand_chip *chip,
1283 const struct nand_operation *op)
1284{
1285 if (!chip->exec_op)
1286 return -ENOTSUPP;
1287
1288 return chip->exec_op(chip, op, false);
1289}
1290
959extern const struct mtd_ooblayout_ops nand_ooblayout_sp_ops; 1291extern const struct mtd_ooblayout_ops nand_ooblayout_sp_ops;
960extern const struct mtd_ooblayout_ops nand_ooblayout_lp_ops; 1292extern const struct mtd_ooblayout_ops nand_ooblayout_lp_ops;
961 1293
@@ -1225,8 +1557,7 @@ static inline int onfi_get_sync_timing_mode(struct nand_chip *chip)
1225 return le16_to_cpu(chip->onfi_params.src_sync_timing_mode); 1557 return le16_to_cpu(chip->onfi_params.src_sync_timing_mode);
1226} 1558}
1227 1559
1228int onfi_init_data_interface(struct nand_chip *chip, 1560int onfi_fill_data_interface(struct nand_chip *chip,
1229 struct nand_data_interface *iface,
1230 enum nand_data_interface_type type, 1561 enum nand_data_interface_type type,
1231 int timing_mode); 1562 int timing_mode);
1232 1563
@@ -1269,8 +1600,6 @@ static inline int jedec_feature(struct nand_chip *chip)
1269 1600
1270/* get timing characteristics from ONFI timing mode. */ 1601/* get timing characteristics from ONFI timing mode. */
1271const struct nand_sdr_timings *onfi_async_timing_mode_to_sdr_timings(int mode); 1602const struct nand_sdr_timings *onfi_async_timing_mode_to_sdr_timings(int mode);
1272/* get data interface from ONFI timing mode 0, used after reset. */
1273const struct nand_data_interface *nand_get_default_data_interface(void);
1274 1603
1275int nand_check_erased_ecc_chunk(void *data, int datalen, 1604int nand_check_erased_ecc_chunk(void *data, int datalen,
1276 void *ecc, int ecclen, 1605 void *ecc, int ecclen,
@@ -1316,9 +1645,45 @@ int nand_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
1316/* Reset and initialize a NAND device */ 1645/* Reset and initialize a NAND device */
1317int nand_reset(struct nand_chip *chip, int chipnr); 1646int nand_reset(struct nand_chip *chip, int chipnr);
1318 1647
1648/* NAND operation helpers */
1649int nand_reset_op(struct nand_chip *chip);
1650int nand_readid_op(struct nand_chip *chip, u8 addr, void *buf,
1651 unsigned int len);
1652int nand_status_op(struct nand_chip *chip, u8 *status);
1653int nand_exit_status_op(struct nand_chip *chip);
1654int nand_erase_op(struct nand_chip *chip, unsigned int eraseblock);
1655int nand_read_page_op(struct nand_chip *chip, unsigned int page,
1656 unsigned int offset_in_page, void *buf, unsigned int len);
1657int nand_change_read_column_op(struct nand_chip *chip,
1658 unsigned int offset_in_page, void *buf,
1659 unsigned int len, bool force_8bit);
1660int nand_read_oob_op(struct nand_chip *chip, unsigned int page,
1661 unsigned int offset_in_page, void *buf, unsigned int len);
1662int nand_prog_page_begin_op(struct nand_chip *chip, unsigned int page,
1663 unsigned int offset_in_page, const void *buf,
1664 unsigned int len);
1665int nand_prog_page_end_op(struct nand_chip *chip);
1666int nand_prog_page_op(struct nand_chip *chip, unsigned int page,
1667 unsigned int offset_in_page, const void *buf,
1668 unsigned int len);
1669int nand_change_write_column_op(struct nand_chip *chip,
1670 unsigned int offset_in_page, const void *buf,
1671 unsigned int len, bool force_8bit);
1672int nand_read_data_op(struct nand_chip *chip, void *buf, unsigned int len,
1673 bool force_8bit);
1674int nand_write_data_op(struct nand_chip *chip, const void *buf,
1675 unsigned int len, bool force_8bit);
1676
1319/* Free resources held by the NAND device */ 1677/* Free resources held by the NAND device */
1320void nand_cleanup(struct nand_chip *chip); 1678void nand_cleanup(struct nand_chip *chip);
1321 1679
1322/* Default extended ID decoding function */ 1680/* Default extended ID decoding function */
1323void nand_decode_ext_id(struct nand_chip *chip); 1681void nand_decode_ext_id(struct nand_chip *chip);
1682
1683/*
1684 * External helper for controller drivers that have to implement the WAITRDY
1685 * instruction and have no physical pin to check it.
1686 */
1687int nand_soft_waitrdy(struct nand_chip *chip, unsigned long timeout_ms);
1688
1324#endif /* __LINUX_MTD_RAWNAND_H */ 1689#endif /* __LINUX_MTD_RAWNAND_H */
diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h
index d0c66a0975cf..de36969eb359 100644
--- a/include/linux/mtd/spi-nor.h
+++ b/include/linux/mtd/spi-nor.h
@@ -61,6 +61,7 @@
61#define SPINOR_OP_RDSFDP 0x5a /* Read SFDP */ 61#define SPINOR_OP_RDSFDP 0x5a /* Read SFDP */
62#define SPINOR_OP_RDCR 0x35 /* Read configuration register */ 62#define SPINOR_OP_RDCR 0x35 /* Read configuration register */
63#define SPINOR_OP_RDFSR 0x70 /* Read flag status register */ 63#define SPINOR_OP_RDFSR 0x70 /* Read flag status register */
64#define SPINOR_OP_CLFSR 0x50 /* Clear flag status register */
64 65
65/* 4-byte address opcodes - used on Spansion and some Macronix flashes. */ 66/* 4-byte address opcodes - used on Spansion and some Macronix flashes. */
66#define SPINOR_OP_READ_4B 0x13 /* Read data bytes (low frequency) */ 67#define SPINOR_OP_READ_4B 0x13 /* Read data bytes (low frequency) */
@@ -130,7 +131,10 @@
130#define EVCR_QUAD_EN_MICRON BIT(7) /* Micron Quad I/O */ 131#define EVCR_QUAD_EN_MICRON BIT(7) /* Micron Quad I/O */
131 132
132/* Flag Status Register bits */ 133/* Flag Status Register bits */
133#define FSR_READY BIT(7) 134#define FSR_READY BIT(7) /* Device status, 0 = Busy, 1 = Ready */
135#define FSR_E_ERR BIT(5) /* Erase operation status */
136#define FSR_P_ERR BIT(4) /* Program operation status */
137#define FSR_PT_ERR BIT(1) /* Protection error bit */
134 138
135/* Configuration Register bits. */ 139/* Configuration Register bits. */
136#define CR_QUAD_EN_SPAN BIT(1) /* Spansion Quad I/O */ 140#define CR_QUAD_EN_SPAN BIT(1) /* Spansion Quad I/O */
@@ -399,4 +403,10 @@ struct spi_nor_hwcaps {
399int spi_nor_scan(struct spi_nor *nor, const char *name, 403int spi_nor_scan(struct spi_nor *nor, const char *name,
400 const struct spi_nor_hwcaps *hwcaps); 404 const struct spi_nor_hwcaps *hwcaps);
401 405
406/**
407 * spi_nor_restore_addr_mode() - restore the status of SPI NOR
408 * @nor: the spi_nor structure
409 */
410void spi_nor_restore(struct spi_nor *nor);
411
402#endif 412#endif
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
index 495ba4dd9da5..34551f8aaf9d 100644
--- a/include/linux/netfilter/nfnetlink.h
+++ b/include/linux/netfilter/nfnetlink.h
@@ -67,8 +67,7 @@ static inline bool lockdep_nfnl_is_held(__u8 subsys_id)
67 * @ss: The nfnetlink subsystem ID 67 * @ss: The nfnetlink subsystem ID
68 * 68 *
69 * Return the value of the specified RCU-protected pointer, but omit 69 * Return the value of the specified RCU-protected pointer, but omit
70 * both the smp_read_barrier_depends() and the READ_ONCE(), because 70 * the READ_ONCE(), because caller holds the NFNL subsystem mutex.
71 * caller holds the NFNL subsystem mutex.
72 */ 71 */
73#define nfnl_dereference(p, ss) \ 72#define nfnl_dereference(p, ss) \
74 rcu_dereference_protected(p, lockdep_nfnl_is_held(ss)) 73 rcu_dereference_protected(p, lockdep_nfnl_is_held(ss))
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 49b4257ce1ea..f3075d6c7e82 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -85,7 +85,7 @@ struct netlink_ext_ack {
85 * to the lack of an output buffer.) 85 * to the lack of an output buffer.)
86 */ 86 */
87#define NL_SET_ERR_MSG(extack, msg) do { \ 87#define NL_SET_ERR_MSG(extack, msg) do { \
88 static const char __msg[] = (msg); \ 88 static const char __msg[] = msg; \
89 struct netlink_ext_ack *__extack = (extack); \ 89 struct netlink_ext_ack *__extack = (extack); \
90 \ 90 \
91 if (__extack) \ 91 if (__extack) \
@@ -101,7 +101,7 @@ struct netlink_ext_ack {
101} while (0) 101} while (0)
102 102
103#define NL_SET_ERR_MSG_ATTR(extack, attr, msg) do { \ 103#define NL_SET_ERR_MSG_ATTR(extack, attr, msg) do { \
104 static const char __msg[] = (msg); \ 104 static const char __msg[] = msg; \
105 struct netlink_ext_ack *__extack = (extack); \ 105 struct netlink_ext_ack *__extack = (extack); \
106 \ 106 \
107 if (__extack) { \ 107 if (__extack) { \
diff --git a/include/linux/nubus.h b/include/linux/nubus.h
index 11ce6b1117a8..6e8200215321 100644
--- a/include/linux/nubus.h
+++ b/include/linux/nubus.h
@@ -5,20 +5,36 @@
5 Originally written by Alan Cox. 5 Originally written by Alan Cox.
6 6
7 Hacked to death by C. Scott Ananian and David Huggins-Daines. 7 Hacked to death by C. Scott Ananian and David Huggins-Daines.
8 8*/
9 Some of the constants in here are from the corresponding 9
10 NetBSD/OpenBSD header file, by Allen Briggs. We figured out the
11 rest of them on our own. */
12#ifndef LINUX_NUBUS_H 10#ifndef LINUX_NUBUS_H
13#define LINUX_NUBUS_H 11#define LINUX_NUBUS_H
14 12
13#include <linux/device.h>
15#include <asm/nubus.h> 14#include <asm/nubus.h>
16#include <uapi/linux/nubus.h> 15#include <uapi/linux/nubus.h>
17 16
17struct proc_dir_entry;
18struct seq_file;
19
20struct nubus_dir {
21 unsigned char *base;
22 unsigned char *ptr;
23 int done;
24 int mask;
25 struct proc_dir_entry *procdir;
26};
27
28struct nubus_dirent {
29 unsigned char *base;
30 unsigned char type;
31 __u32 data; /* Actually 24 bits used */
32 int mask;
33};
34
18struct nubus_board { 35struct nubus_board {
19 struct nubus_board* next; 36 struct device dev;
20 struct nubus_dev* first_dev; 37
21
22 /* Only 9-E actually exist, though 0-8 are also theoretically 38 /* Only 9-E actually exist, though 0-8 are also theoretically
23 possible, and 0 is a special case which represents the 39 possible, and 0 is a special case which represents the
24 motherboard and onboard peripherals (Ethernet, video) */ 40 motherboard and onboard peripherals (Ethernet, video) */
@@ -27,10 +43,10 @@ struct nubus_board {
27 char name[64]; 43 char name[64];
28 44
29 /* Format block */ 45 /* Format block */
30 unsigned char* fblock; 46 unsigned char *fblock;
31 /* Root directory (does *not* always equal fblock + doffset!) */ 47 /* Root directory (does *not* always equal fblock + doffset!) */
32 unsigned char* directory; 48 unsigned char *directory;
33 49
34 unsigned long slot_addr; 50 unsigned long slot_addr;
35 /* Offset to root directory (sometimes) */ 51 /* Offset to root directory (sometimes) */
36 unsigned long doffset; 52 unsigned long doffset;
@@ -41,15 +57,15 @@ struct nubus_board {
41 unsigned char rev; 57 unsigned char rev;
42 unsigned char format; 58 unsigned char format;
43 unsigned char lanes; 59 unsigned char lanes;
44};
45 60
46struct nubus_dev {
47 /* Next link in device list */
48 struct nubus_dev* next;
49 /* Directory entry in /proc/bus/nubus */ 61 /* Directory entry in /proc/bus/nubus */
50 struct proc_dir_entry* procdir; 62 struct proc_dir_entry *procdir;
63};
64
65struct nubus_rsrc {
66 struct list_head list;
51 67
52 /* The functional resource ID of this device */ 68 /* The functional resource ID */
53 unsigned char resid; 69 unsigned char resid;
54 /* These are mostly here for convenience; we could always read 70 /* These are mostly here for convenience; we could always read
55 them from the ROMs if we wanted to */ 71 them from the ROMs if we wanted to */
@@ -57,79 +73,116 @@ struct nubus_dev {
57 unsigned short type; 73 unsigned short type;
58 unsigned short dr_sw; 74 unsigned short dr_sw;
59 unsigned short dr_hw; 75 unsigned short dr_hw;
60 /* This is the device's name rather than the board's. 76
61 Sometimes they are different. Usually the board name is
62 more correct. */
63 char name[64];
64 /* MacOS driver (I kid you not) */
65 unsigned char* driver;
66 /* Actually this is an offset */
67 unsigned long iobase;
68 unsigned long iosize;
69 unsigned char flags, hwdevid;
70
71 /* Functional directory */ 77 /* Functional directory */
72 unsigned char* directory; 78 unsigned char *directory;
73 /* Much of our info comes from here */ 79 /* Much of our info comes from here */
74 struct nubus_board* board; 80 struct nubus_board *board;
81};
82
83/* This is all NuBus functional resources (used to find devices later on) */
84extern struct list_head nubus_func_rsrcs;
85
86struct nubus_driver {
87 struct device_driver driver;
88 int (*probe)(struct nubus_board *board);
89 int (*remove)(struct nubus_board *board);
75}; 90};
76 91
77/* This is all NuBus devices (used to find devices later on) */ 92extern struct bus_type nubus_bus_type;
78extern struct nubus_dev* nubus_devices;
79/* This is all NuBus cards */
80extern struct nubus_board* nubus_boards;
81 93
82/* Generic NuBus interface functions, modelled after the PCI interface */ 94/* Generic NuBus interface functions, modelled after the PCI interface */
83void nubus_scan_bus(void);
84#ifdef CONFIG_PROC_FS 95#ifdef CONFIG_PROC_FS
85extern void nubus_proc_init(void); 96void nubus_proc_init(void);
97struct proc_dir_entry *nubus_proc_add_board(struct nubus_board *board);
98struct proc_dir_entry *nubus_proc_add_rsrc_dir(struct proc_dir_entry *procdir,
99 const struct nubus_dirent *ent,
100 struct nubus_board *board);
101void nubus_proc_add_rsrc_mem(struct proc_dir_entry *procdir,
102 const struct nubus_dirent *ent,
103 unsigned int size);
104void nubus_proc_add_rsrc(struct proc_dir_entry *procdir,
105 const struct nubus_dirent *ent);
86#else 106#else
87static inline void nubus_proc_init(void) {} 107static inline void nubus_proc_init(void) {}
108static inline
109struct proc_dir_entry *nubus_proc_add_board(struct nubus_board *board)
110{ return NULL; }
111static inline
112struct proc_dir_entry *nubus_proc_add_rsrc_dir(struct proc_dir_entry *procdir,
113 const struct nubus_dirent *ent,
114 struct nubus_board *board)
115{ return NULL; }
116static inline void nubus_proc_add_rsrc_mem(struct proc_dir_entry *procdir,
117 const struct nubus_dirent *ent,
118 unsigned int size) {}
119static inline void nubus_proc_add_rsrc(struct proc_dir_entry *procdir,
120 const struct nubus_dirent *ent) {}
88#endif 121#endif
89int get_nubus_list(char *buf); 122
90int nubus_proc_attach_device(struct nubus_dev *dev); 123struct nubus_rsrc *nubus_first_rsrc_or_null(void);
91/* If we need more precision we can add some more of these */ 124struct nubus_rsrc *nubus_next_rsrc_or_null(struct nubus_rsrc *from);
92struct nubus_dev* nubus_find_device(unsigned short category, 125
93 unsigned short type, 126#define for_each_func_rsrc(f) \
94 unsigned short dr_hw, 127 for (f = nubus_first_rsrc_or_null(); f; f = nubus_next_rsrc_or_null(f))
95 unsigned short dr_sw, 128
96 const struct nubus_dev* from); 129#define for_each_board_func_rsrc(b, f) \
97struct nubus_dev* nubus_find_type(unsigned short category, 130 for_each_func_rsrc(f) if (f->board != b) {} else
98 unsigned short type,
99 const struct nubus_dev* from);
100/* Might have more than one device in a slot, you know... */
101struct nubus_dev* nubus_find_slot(unsigned int slot,
102 const struct nubus_dev* from);
103 131
104/* These are somewhat more NuBus-specific. They all return 0 for 132/* These are somewhat more NuBus-specific. They all return 0 for
105 success and -1 for failure, as you'd expect. */ 133 success and -1 for failure, as you'd expect. */
106 134
107/* The root directory which contains the board and functional 135/* The root directory which contains the board and functional
108 directories */ 136 directories */
109int nubus_get_root_dir(const struct nubus_board* board, 137int nubus_get_root_dir(const struct nubus_board *board,
110 struct nubus_dir* dir); 138 struct nubus_dir *dir);
111/* The board directory */ 139/* The board directory */
112int nubus_get_board_dir(const struct nubus_board* board, 140int nubus_get_board_dir(const struct nubus_board *board,
113 struct nubus_dir* dir); 141 struct nubus_dir *dir);
114/* The functional directory */ 142/* The functional directory */
115int nubus_get_func_dir(const struct nubus_dev* dev, 143int nubus_get_func_dir(const struct nubus_rsrc *fres, struct nubus_dir *dir);
116 struct nubus_dir* dir);
117 144
118/* These work on any directory gotten via the above */ 145/* These work on any directory gotten via the above */
119int nubus_readdir(struct nubus_dir* dir, 146int nubus_readdir(struct nubus_dir *dir,
120 struct nubus_dirent* ent); 147 struct nubus_dirent *ent);
121int nubus_find_rsrc(struct nubus_dir* dir, 148int nubus_find_rsrc(struct nubus_dir *dir,
122 unsigned char rsrc_type, 149 unsigned char rsrc_type,
123 struct nubus_dirent* ent); 150 struct nubus_dirent *ent);
124int nubus_rewinddir(struct nubus_dir* dir); 151int nubus_rewinddir(struct nubus_dir *dir);
125 152
126/* Things to do with directory entries */ 153/* Things to do with directory entries */
127int nubus_get_subdir(const struct nubus_dirent* ent, 154int nubus_get_subdir(const struct nubus_dirent *ent,
128 struct nubus_dir* dir); 155 struct nubus_dir *dir);
129void nubus_get_rsrc_mem(void* dest, 156void nubus_get_rsrc_mem(void *dest, const struct nubus_dirent *dirent,
130 const struct nubus_dirent *dirent, 157 unsigned int len);
131 int len); 158unsigned int nubus_get_rsrc_str(char *dest, const struct nubus_dirent *dirent,
132void nubus_get_rsrc_str(void* dest, 159 unsigned int len);
133 const struct nubus_dirent *dirent, 160void nubus_seq_write_rsrc_mem(struct seq_file *m,
134 int maxlen); 161 const struct nubus_dirent *dirent,
162 unsigned int len);
163unsigned char *nubus_dirptr(const struct nubus_dirent *nd);
164
165/* Declarations relating to driver model objects */
166int nubus_bus_register(void);
167int nubus_device_register(struct nubus_board *board);
168int nubus_driver_register(struct nubus_driver *ndrv);
169void nubus_driver_unregister(struct nubus_driver *ndrv);
170int nubus_proc_show(struct seq_file *m, void *data);
171
172static inline void nubus_set_drvdata(struct nubus_board *board, void *data)
173{
174 dev_set_drvdata(&board->dev, data);
175}
176
177static inline void *nubus_get_drvdata(struct nubus_board *board)
178{
179 return dev_get_drvdata(&board->dev);
180}
181
182/* Returns a pointer to the "standard" slot space. */
183static inline void *nubus_slot_addr(int slot)
184{
185 return (void *)(0xF0000000 | (slot << 24));
186}
187
135#endif /* LINUX_NUBUS_H */ 188#endif /* LINUX_NUBUS_H */
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index aea87f0d917b..4112e2bd747f 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -124,14 +124,20 @@ enum {
124 124
125#define NVME_CMB_BIR(cmbloc) ((cmbloc) & 0x7) 125#define NVME_CMB_BIR(cmbloc) ((cmbloc) & 0x7)
126#define NVME_CMB_OFST(cmbloc) (((cmbloc) >> 12) & 0xfffff) 126#define NVME_CMB_OFST(cmbloc) (((cmbloc) >> 12) & 0xfffff)
127#define NVME_CMB_SZ(cmbsz) (((cmbsz) >> 12) & 0xfffff) 127
128#define NVME_CMB_SZU(cmbsz) (((cmbsz) >> 8) & 0xf) 128enum {
129 129 NVME_CMBSZ_SQS = 1 << 0,
130#define NVME_CMB_WDS(cmbsz) ((cmbsz) & 0x10) 130 NVME_CMBSZ_CQS = 1 << 1,
131#define NVME_CMB_RDS(cmbsz) ((cmbsz) & 0x8) 131 NVME_CMBSZ_LISTS = 1 << 2,
132#define NVME_CMB_LISTS(cmbsz) ((cmbsz) & 0x4) 132 NVME_CMBSZ_RDS = 1 << 3,
133#define NVME_CMB_CQS(cmbsz) ((cmbsz) & 0x2) 133 NVME_CMBSZ_WDS = 1 << 4,
134#define NVME_CMB_SQS(cmbsz) ((cmbsz) & 0x1) 134
135 NVME_CMBSZ_SZ_SHIFT = 12,
136 NVME_CMBSZ_SZ_MASK = 0xfffff,
137
138 NVME_CMBSZ_SZU_SHIFT = 8,
139 NVME_CMBSZ_SZU_MASK = 0xf,
140};
135 141
136/* 142/*
137 * Submission and Completion Queue Entry Sizes for the NVM command set. 143 * Submission and Completion Queue Entry Sizes for the NVM command set.
diff --git a/include/linux/omap-gpmc.h b/include/linux/omap-gpmc.h
index edfa280c3d56..053feb41510a 100644
--- a/include/linux/omap-gpmc.h
+++ b/include/linux/omap-gpmc.h
@@ -25,15 +25,43 @@ struct gpmc_nand_ops {
25 25
26struct gpmc_nand_regs; 26struct gpmc_nand_regs;
27 27
28struct gpmc_onenand_info {
29 bool sync_read;
30 bool sync_write;
31 int burst_len;
32};
33
28#if IS_ENABLED(CONFIG_OMAP_GPMC) 34#if IS_ENABLED(CONFIG_OMAP_GPMC)
29struct gpmc_nand_ops *gpmc_omap_get_nand_ops(struct gpmc_nand_regs *regs, 35struct gpmc_nand_ops *gpmc_omap_get_nand_ops(struct gpmc_nand_regs *regs,
30 int cs); 36 int cs);
37/**
38 * gpmc_omap_onenand_set_timings - set optimized sync timings.
39 * @cs: Chip Select Region
40 * @freq: Chip frequency
41 * @latency: Burst latency cycle count
42 * @info: Structure describing parameters used
43 *
44 * Sets optimized timings for the @cs region based on @freq and @latency.
45 * Updates the @info structure based on the GPMC settings.
46 */
47int gpmc_omap_onenand_set_timings(struct device *dev, int cs, int freq,
48 int latency,
49 struct gpmc_onenand_info *info);
50
31#else 51#else
32static inline struct gpmc_nand_ops *gpmc_omap_get_nand_ops(struct gpmc_nand_regs *regs, 52static inline struct gpmc_nand_ops *gpmc_omap_get_nand_ops(struct gpmc_nand_regs *regs,
33 int cs) 53 int cs)
34{ 54{
35 return NULL; 55 return NULL;
36} 56}
57
58static inline
59int gpmc_omap_onenand_set_timings(struct device *dev, int cs, int freq,
60 int latency,
61 struct gpmc_onenand_info *info)
62{
63 return -EINVAL;
64}
37#endif /* CONFIG_OMAP_GPMC */ 65#endif /* CONFIG_OMAP_GPMC */
38 66
39extern int gpmc_calc_timings(struct gpmc_timings *gpmc_t, 67extern int gpmc_calc_timings(struct gpmc_timings *gpmc_t,
diff --git a/include/linux/oom.h b/include/linux/oom.h
index 01c91d874a57..5bad038ac012 100644
--- a/include/linux/oom.h
+++ b/include/linux/oom.h
@@ -67,6 +67,15 @@ static inline bool tsk_is_oom_victim(struct task_struct * tsk)
67} 67}
68 68
69/* 69/*
70 * Use this helper if tsk->mm != mm and the victim mm needs a special
71 * handling. This is guaranteed to stay true after once set.
72 */
73static inline bool mm_is_oom_victim(struct mm_struct *mm)
74{
75 return test_bit(MMF_OOM_VICTIM, &mm->flags);
76}
77
78/*
70 * Checks whether a page fault on the given mm is still reliable. 79 * Checks whether a page fault on the given mm is still reliable.
71 * This is no longer true if the oom reaper started to reap the 80 * This is no longer true if the oom reaper started to reap the
72 * address space which is reflected by MMF_UNSTABLE flag set in 81 * address space which is reflected by MMF_UNSTABLE flag set in
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 0403894147a3..c170c9250c8b 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1674,6 +1674,9 @@ static inline struct pci_dev *pci_get_slot(struct pci_bus *bus,
1674static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus, 1674static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus,
1675 unsigned int devfn) 1675 unsigned int devfn)
1676{ return NULL; } 1676{ return NULL; }
1677static inline struct pci_dev *pci_get_domain_bus_and_slot(int domain,
1678 unsigned int bus, unsigned int devfn)
1679{ return NULL; }
1677 1680
1678static inline int pci_domain_nr(struct pci_bus *bus) { return 0; } 1681static inline int pci_domain_nr(struct pci_bus *bus) { return 0; }
1679static inline struct pci_dev *pci_dev_get(struct pci_dev *dev) { return NULL; } 1682static inline struct pci_dev *pci_dev_get(struct pci_dev *dev) { return NULL; }
diff --git a/include/linux/percpu-refcount.h b/include/linux/percpu-refcount.h
index 6658d9ee5257..864d167a1073 100644
--- a/include/linux/percpu-refcount.h
+++ b/include/linux/percpu-refcount.h
@@ -139,12 +139,12 @@ static inline bool __ref_is_percpu(struct percpu_ref *ref,
139 * when using it as a pointer, __PERCPU_REF_ATOMIC may be set in 139 * when using it as a pointer, __PERCPU_REF_ATOMIC may be set in
140 * between contaminating the pointer value, meaning that 140 * between contaminating the pointer value, meaning that
141 * READ_ONCE() is required when fetching it. 141 * READ_ONCE() is required when fetching it.
142 *
143 * The smp_read_barrier_depends() implied by READ_ONCE() pairs
144 * with smp_store_release() in __percpu_ref_switch_to_percpu().
142 */ 145 */
143 percpu_ptr = READ_ONCE(ref->percpu_count_ptr); 146 percpu_ptr = READ_ONCE(ref->percpu_count_ptr);
144 147
145 /* paired with smp_store_release() in __percpu_ref_switch_to_percpu() */
146 smp_read_barrier_depends();
147
148 /* 148 /*
149 * Theoretically, the following could test just ATOMIC; however, 149 * Theoretically, the following could test just ATOMIC; however,
150 * then we'd have to mask off DEAD separately as DEAD may be 150 * then we'd have to mask off DEAD separately as DEAD may be
diff --git a/include/linux/platform_data/mtd-onenand-omap2.h b/include/linux/platform_data/mtd-onenand-omap2.h
deleted file mode 100644
index 56ff0e6f5ad1..000000000000
--- a/include/linux/platform_data/mtd-onenand-omap2.h
+++ /dev/null
@@ -1,34 +0,0 @@
1/*
2 * Copyright (C) 2006 Nokia Corporation
3 * Author: Juha Yrjola
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9
10#ifndef __MTD_ONENAND_OMAP2_H
11#define __MTD_ONENAND_OMAP2_H
12
13#include <linux/mtd/mtd.h>
14#include <linux/mtd/partitions.h>
15
16#define ONENAND_SYNC_READ (1 << 0)
17#define ONENAND_SYNC_READWRITE (1 << 1)
18#define ONENAND_IN_OMAP34XX (1 << 2)
19
20struct omap_onenand_platform_data {
21 int cs;
22 int gpio_irq;
23 struct mtd_partition *parts;
24 int nr_parts;
25 int (*onenand_setup)(void __iomem *, int *freq_ptr);
26 int dma_channel;
27 u8 flags;
28 u8 regulator_can_sleep;
29 u8 skip_initial_unlocking;
30
31 /* for passing the partitions */
32 struct device_node *of_node;
33};
34#endif
diff --git a/include/linux/platform_data/spi-s3c64xx.h b/include/linux/platform_data/spi-s3c64xx.h
index da79774078a7..773daf7915a3 100644
--- a/include/linux/platform_data/spi-s3c64xx.h
+++ b/include/linux/platform_data/spi-s3c64xx.h
@@ -1,10 +1,8 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2
1/* 3/*
2 * Copyright (C) 2009 Samsung Electronics Ltd. 4 * Copyright (C) 2009 Samsung Electronics Ltd.
3 * Jaswinder Singh <jassi.brar@samsung.com> 5 * Jaswinder Singh <jassi.brar@samsung.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */ 6 */
9 7
10#ifndef __SPI_S3C64XX_H 8#ifndef __SPI_S3C64XX_H
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 65d39115f06d..e723b78d8357 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -556,9 +556,10 @@ struct pm_subsys_data {
556 * These flags can be set by device drivers at the probe time. They need not be 556 * These flags can be set by device drivers at the probe time. They need not be
557 * cleared by the drivers as the driver core will take care of that. 557 * cleared by the drivers as the driver core will take care of that.
558 * 558 *
559 * NEVER_SKIP: Do not skip system suspend/resume callbacks for the device. 559 * NEVER_SKIP: Do not skip all system suspend/resume callbacks for the device.
560 * SMART_PREPARE: Check the return value of the driver's ->prepare callback. 560 * SMART_PREPARE: Check the return value of the driver's ->prepare callback.
561 * SMART_SUSPEND: No need to resume the device from runtime suspend. 561 * SMART_SUSPEND: No need to resume the device from runtime suspend.
562 * LEAVE_SUSPENDED: Avoid resuming the device during system resume if possible.
562 * 563 *
563 * Setting SMART_PREPARE instructs bus types and PM domains which may want 564 * Setting SMART_PREPARE instructs bus types and PM domains which may want
564 * system suspend/resume callbacks to be skipped for the device to return 0 from 565 * system suspend/resume callbacks to be skipped for the device to return 0 from
@@ -572,10 +573,14 @@ struct pm_subsys_data {
572 * necessary from the driver's perspective. It also may cause them to skip 573 * necessary from the driver's perspective. It also may cause them to skip
573 * invocations of the ->suspend_late and ->suspend_noirq callbacks provided by 574 * invocations of the ->suspend_late and ->suspend_noirq callbacks provided by
574 * the driver if they decide to leave the device in runtime suspend. 575 * the driver if they decide to leave the device in runtime suspend.
576 *
577 * Setting LEAVE_SUSPENDED informs the PM core and middle-layer code that the
578 * driver prefers the device to be left in suspend after system resume.
575 */ 579 */
576#define DPM_FLAG_NEVER_SKIP BIT(0) 580#define DPM_FLAG_NEVER_SKIP BIT(0)
577#define DPM_FLAG_SMART_PREPARE BIT(1) 581#define DPM_FLAG_SMART_PREPARE BIT(1)
578#define DPM_FLAG_SMART_SUSPEND BIT(2) 582#define DPM_FLAG_SMART_SUSPEND BIT(2)
583#define DPM_FLAG_LEAVE_SUSPENDED BIT(3)
579 584
580struct dev_pm_info { 585struct dev_pm_info {
581 pm_message_t power_state; 586 pm_message_t power_state;
@@ -597,6 +602,8 @@ struct dev_pm_info {
597 bool wakeup_path:1; 602 bool wakeup_path:1;
598 bool syscore:1; 603 bool syscore:1;
599 bool no_pm_callbacks:1; /* Owned by the PM core */ 604 bool no_pm_callbacks:1; /* Owned by the PM core */
605 unsigned int must_resume:1; /* Owned by the PM core */
606 unsigned int may_skip_resume:1; /* Set by subsystems */
600#else 607#else
601 unsigned int should_wakeup:1; 608 unsigned int should_wakeup:1;
602#endif 609#endif
@@ -765,6 +772,8 @@ extern int pm_generic_poweroff_late(struct device *dev);
765extern int pm_generic_poweroff(struct device *dev); 772extern int pm_generic_poweroff(struct device *dev);
766extern void pm_generic_complete(struct device *dev); 773extern void pm_generic_complete(struct device *dev);
767 774
775extern void dev_pm_skip_next_resume_phases(struct device *dev);
776extern bool dev_pm_may_skip_resume(struct device *dev);
768extern bool dev_pm_smart_suspend_and_suspended(struct device *dev); 777extern bool dev_pm_smart_suspend_and_suspended(struct device *dev);
769 778
770#else /* !CONFIG_PM_SLEEP */ 779#else /* !CONFIG_PM_SLEEP */
diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h
index 4c2cba7ec1d4..4238dde0aaf0 100644
--- a/include/linux/pm_wakeup.h
+++ b/include/linux/pm_wakeup.h
@@ -88,6 +88,11 @@ static inline bool device_may_wakeup(struct device *dev)
88 return dev->power.can_wakeup && !!dev->power.wakeup; 88 return dev->power.can_wakeup && !!dev->power.wakeup;
89} 89}
90 90
91static inline void device_set_wakeup_path(struct device *dev)
92{
93 dev->power.wakeup_path = true;
94}
95
91/* drivers/base/power/wakeup.c */ 96/* drivers/base/power/wakeup.c */
92extern void wakeup_source_prepare(struct wakeup_source *ws, const char *name); 97extern void wakeup_source_prepare(struct wakeup_source *ws, const char *name);
93extern struct wakeup_source *wakeup_source_create(const char *name); 98extern struct wakeup_source *wakeup_source_create(const char *name);
@@ -174,6 +179,8 @@ static inline bool device_may_wakeup(struct device *dev)
174 return dev->power.can_wakeup && dev->power.should_wakeup; 179 return dev->power.can_wakeup && dev->power.should_wakeup;
175} 180}
176 181
182static inline void device_set_wakeup_path(struct device *dev) {}
183
177static inline void __pm_stay_awake(struct wakeup_source *ws) {} 184static inline void __pm_stay_awake(struct wakeup_source *ws) {}
178 185
179static inline void pm_stay_awake(struct device *dev) {} 186static inline void pm_stay_awake(struct device *dev) {}
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h
index 672c4f32311e..c85704fcdbd2 100644
--- a/include/linux/posix-timers.h
+++ b/include/linux/posix-timers.h
@@ -42,13 +42,26 @@ struct cpu_timer_list {
42#define CLOCKFD CPUCLOCK_MAX 42#define CLOCKFD CPUCLOCK_MAX
43#define CLOCKFD_MASK (CPUCLOCK_PERTHREAD_MASK|CPUCLOCK_CLOCK_MASK) 43#define CLOCKFD_MASK (CPUCLOCK_PERTHREAD_MASK|CPUCLOCK_CLOCK_MASK)
44 44
45#define MAKE_PROCESS_CPUCLOCK(pid, clock) \ 45static inline clockid_t make_process_cpuclock(const unsigned int pid,
46 ((~(clockid_t) (pid) << 3) | (clockid_t) (clock)) 46 const clockid_t clock)
47#define MAKE_THREAD_CPUCLOCK(tid, clock) \ 47{
48 MAKE_PROCESS_CPUCLOCK((tid), (clock) | CPUCLOCK_PERTHREAD_MASK) 48 return ((~pid) << 3) | clock;
49}
50static inline clockid_t make_thread_cpuclock(const unsigned int tid,
51 const clockid_t clock)
52{
53 return make_process_cpuclock(tid, clock | CPUCLOCK_PERTHREAD_MASK);
54}
49 55
50#define FD_TO_CLOCKID(fd) ((~(clockid_t) (fd) << 3) | CLOCKFD) 56static inline clockid_t fd_to_clockid(const int fd)
51#define CLOCKID_TO_FD(clk) ((unsigned int) ~((clk) >> 3)) 57{
58 return make_process_cpuclock((unsigned int) fd, CLOCKFD);
59}
60
61static inline int clockid_to_fd(const clockid_t clk)
62{
63 return ~(clk >> 3);
64}
52 65
53#define REQUEUE_PENDING 1 66#define REQUEUE_PENDING 1
54 67
diff --git a/include/linux/pti.h b/include/linux/pti.h
index b3ea01a3197e..0174883a935a 100644
--- a/include/linux/pti.h
+++ b/include/linux/pti.h
@@ -1,43 +1,11 @@
1/* 1// SPDX-License-Identifier: GPL-2.0
2 * Copyright (C) Intel 2011 2#ifndef _INCLUDE_PTI_H
3 * 3#define _INCLUDE_PTI_H
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14 *
15 * The PTI (Parallel Trace Interface) driver directs trace data routed from
16 * various parts in the system out through the Intel Penwell PTI port and
17 * out of the mobile device for analysis with a debugging tool
18 * (Lauterbach, Fido). This is part of a solution for the MIPI P1149.7,
19 * compact JTAG, standard.
20 *
21 * This header file will allow other parts of the OS to use the
22 * interface to write out it's contents for debugging a mobile system.
23 */
24 4
25#ifndef PTI_H_ 5#ifdef CONFIG_PAGE_TABLE_ISOLATION
26#define PTI_H_ 6#include <asm/pti.h>
7#else
8static inline void pti_init(void) { }
9#endif
27 10
28/* offset for last dword of any PTI message. Part of MIPI P1149.7 */ 11#endif
29#define PTI_LASTDWORD_DTS 0x30
30
31/* basic structure used as a write address to the PTI HW */
32struct pti_masterchannel {
33 u8 master;
34 u8 channel;
35};
36
37/* the following functions are defined in misc/pti.c */
38void pti_writedata(struct pti_masterchannel *mc, u8 *buf, int count);
39struct pti_masterchannel *pti_request_masterchannel(u8 type,
40 const char *thread_name);
41void pti_release_masterchannel(struct pti_masterchannel *mc);
42
43#endif /*PTI_H_*/
diff --git a/include/linux/ptr_ring.h b/include/linux/ptr_ring.h
index 37b4bb2545b3..d72b2e7dd500 100644
--- a/include/linux/ptr_ring.h
+++ b/include/linux/ptr_ring.h
@@ -101,12 +101,18 @@ static inline bool ptr_ring_full_bh(struct ptr_ring *r)
101 101
102/* Note: callers invoking this in a loop must use a compiler barrier, 102/* Note: callers invoking this in a loop must use a compiler barrier,
103 * for example cpu_relax(). Callers must hold producer_lock. 103 * for example cpu_relax(). Callers must hold producer_lock.
104 * Callers are responsible for making sure pointer that is being queued
105 * points to a valid data.
104 */ 106 */
105static inline int __ptr_ring_produce(struct ptr_ring *r, void *ptr) 107static inline int __ptr_ring_produce(struct ptr_ring *r, void *ptr)
106{ 108{
107 if (unlikely(!r->size) || r->queue[r->producer]) 109 if (unlikely(!r->size) || r->queue[r->producer])
108 return -ENOSPC; 110 return -ENOSPC;
109 111
112 /* Make sure the pointer we are storing points to a valid data. */
113 /* Pairs with smp_read_barrier_depends in __ptr_ring_consume. */
114 smp_wmb();
115
110 r->queue[r->producer++] = ptr; 116 r->queue[r->producer++] = ptr;
111 if (unlikely(r->producer >= r->size)) 117 if (unlikely(r->producer >= r->size))
112 r->producer = 0; 118 r->producer = 0;
@@ -168,6 +174,15 @@ static inline int ptr_ring_produce_bh(struct ptr_ring *r, void *ptr)
168 * if they dereference the pointer - see e.g. PTR_RING_PEEK_CALL. 174 * if they dereference the pointer - see e.g. PTR_RING_PEEK_CALL.
169 * If ring is never resized, and if the pointer is merely 175 * If ring is never resized, and if the pointer is merely
170 * tested, there's no need to take the lock - see e.g. __ptr_ring_empty. 176 * tested, there's no need to take the lock - see e.g. __ptr_ring_empty.
177 * However, if called outside the lock, and if some other CPU
178 * consumes ring entries at the same time, the value returned
179 * is not guaranteed to be correct.
180 * In this case - to avoid incorrectly detecting the ring
181 * as empty - the CPU consuming the ring entries is responsible
182 * for either consuming all ring entries until the ring is empty,
183 * or synchronizing with some other CPU and causing it to
184 * execute __ptr_ring_peek and/or consume the ring enteries
185 * after the synchronization point.
171 */ 186 */
172static inline void *__ptr_ring_peek(struct ptr_ring *r) 187static inline void *__ptr_ring_peek(struct ptr_ring *r)
173{ 188{
@@ -176,10 +191,7 @@ static inline void *__ptr_ring_peek(struct ptr_ring *r)
176 return NULL; 191 return NULL;
177} 192}
178 193
179/* Note: callers invoking this in a loop must use a compiler barrier, 194/* See __ptr_ring_peek above for locking rules. */
180 * for example cpu_relax(). Callers must take consumer_lock
181 * if the ring is ever resized - see e.g. ptr_ring_empty.
182 */
183static inline bool __ptr_ring_empty(struct ptr_ring *r) 195static inline bool __ptr_ring_empty(struct ptr_ring *r)
184{ 196{
185 return !__ptr_ring_peek(r); 197 return !__ptr_ring_peek(r);
@@ -275,6 +287,9 @@ static inline void *__ptr_ring_consume(struct ptr_ring *r)
275 if (ptr) 287 if (ptr)
276 __ptr_ring_discard_one(r); 288 __ptr_ring_discard_one(r);
277 289
290 /* Make sure anyone accessing data through the pointer is up to date. */
291 /* Pairs with smp_wmb in __ptr_ring_produce. */
292 smp_read_barrier_depends();
278 return ptr; 293 return ptr;
279} 294}
280 295
diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h
index d574361943ea..fcbeed4053ef 100644
--- a/include/linux/rbtree.h
+++ b/include/linux/rbtree.h
@@ -99,6 +99,8 @@ extern void rb_replace_node(struct rb_node *victim, struct rb_node *new,
99 struct rb_root *root); 99 struct rb_root *root);
100extern void rb_replace_node_rcu(struct rb_node *victim, struct rb_node *new, 100extern void rb_replace_node_rcu(struct rb_node *victim, struct rb_node *new,
101 struct rb_root *root); 101 struct rb_root *root);
102extern void rb_replace_node_cached(struct rb_node *victim, struct rb_node *new,
103 struct rb_root_cached *root);
102 104
103static inline void rb_link_node(struct rb_node *node, struct rb_node *parent, 105static inline void rb_link_node(struct rb_node *node, struct rb_node *parent,
104 struct rb_node **rb_link) 106 struct rb_node **rb_link)
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index a6ddc42f87a5..043d04784675 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -197,7 +197,7 @@ static inline void exit_tasks_rcu_finish(void) { }
197#define cond_resched_rcu_qs() \ 197#define cond_resched_rcu_qs() \
198do { \ 198do { \
199 if (!cond_resched()) \ 199 if (!cond_resched()) \
200 rcu_note_voluntary_context_switch(current); \ 200 rcu_note_voluntary_context_switch_lite(current); \
201} while (0) 201} while (0)
202 202
203/* 203/*
@@ -433,12 +433,12 @@ static inline void rcu_preempt_sleep_check(void) { }
433 * @p: The pointer to read 433 * @p: The pointer to read
434 * 434 *
435 * Return the value of the specified RCU-protected pointer, but omit the 435 * Return the value of the specified RCU-protected pointer, but omit the
436 * smp_read_barrier_depends() and keep the READ_ONCE(). This is useful 436 * lockdep checks for being in an RCU read-side critical section. This is
437 * when the value of this pointer is accessed, but the pointer is not 437 * useful when the value of this pointer is accessed, but the pointer is
438 * dereferenced, for example, when testing an RCU-protected pointer against 438 * not dereferenced, for example, when testing an RCU-protected pointer
439 * NULL. Although rcu_access_pointer() may also be used in cases where 439 * against NULL. Although rcu_access_pointer() may also be used in cases
440 * update-side locks prevent the value of the pointer from changing, you 440 * where update-side locks prevent the value of the pointer from changing,
441 * should instead use rcu_dereference_protected() for this use case. 441 * you should instead use rcu_dereference_protected() for this use case.
442 * 442 *
443 * It is also permissible to use rcu_access_pointer() when read-side 443 * It is also permissible to use rcu_access_pointer() when read-side
444 * access to the pointer was removed at least one grace period ago, as 444 * access to the pointer was removed at least one grace period ago, as
@@ -521,12 +521,11 @@ static inline void rcu_preempt_sleep_check(void) { }
521 * @c: The conditions under which the dereference will take place 521 * @c: The conditions under which the dereference will take place
522 * 522 *
523 * Return the value of the specified RCU-protected pointer, but omit 523 * Return the value of the specified RCU-protected pointer, but omit
524 * both the smp_read_barrier_depends() and the READ_ONCE(). This 524 * the READ_ONCE(). This is useful in cases where update-side locks
525 * is useful in cases where update-side locks prevent the value of the 525 * prevent the value of the pointer from changing. Please note that this
526 * pointer from changing. Please note that this primitive does *not* 526 * primitive does *not* prevent the compiler from repeating this reference
527 * prevent the compiler from repeating this reference or combining it 527 * or combining it with other references, so it should not be used without
528 * with other references, so it should not be used without protection 528 * protection of appropriate locks.
529 * of appropriate locks.
530 * 529 *
531 * This function is only for update-side use. Using this function 530 * This function is only for update-side use. Using this function
532 * when protected only by rcu_read_lock() will result in infrequent 531 * when protected only by rcu_read_lock() will result in infrequent
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
index b3dbf9502fd0..ce9beec35e34 100644
--- a/include/linux/rcutiny.h
+++ b/include/linux/rcutiny.h
@@ -111,7 +111,6 @@ static inline void rcu_cpu_stall_reset(void) { }
111static inline void rcu_idle_enter(void) { } 111static inline void rcu_idle_enter(void) { }
112static inline void rcu_idle_exit(void) { } 112static inline void rcu_idle_exit(void) { }
113static inline void rcu_irq_enter(void) { } 113static inline void rcu_irq_enter(void) { }
114static inline bool rcu_irq_enter_disabled(void) { return false; }
115static inline void rcu_irq_exit_irqson(void) { } 114static inline void rcu_irq_exit_irqson(void) { }
116static inline void rcu_irq_enter_irqson(void) { } 115static inline void rcu_irq_enter_irqson(void) { }
117static inline void rcu_irq_exit(void) { } 116static inline void rcu_irq_exit(void) { }
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index 37d6fd3b7ff8..fd996cdf1833 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -85,7 +85,6 @@ void rcu_irq_enter(void);
85void rcu_irq_exit(void); 85void rcu_irq_exit(void);
86void rcu_irq_enter_irqson(void); 86void rcu_irq_enter_irqson(void);
87void rcu_irq_exit_irqson(void); 87void rcu_irq_exit_irqson(void);
88bool rcu_irq_enter_disabled(void);
89 88
90void exit_rcu(void); 89void exit_rcu(void);
91 90
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 15eddc1353ba..20268b7d5001 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -30,6 +30,7 @@ struct regmap;
30struct regmap_range_cfg; 30struct regmap_range_cfg;
31struct regmap_field; 31struct regmap_field;
32struct snd_ac97; 32struct snd_ac97;
33struct sdw_slave;
33 34
34/* An enum of all the supported cache types */ 35/* An enum of all the supported cache types */
35enum regcache_type { 36enum regcache_type {
@@ -264,6 +265,9 @@ typedef void (*regmap_unlock)(void *);
264 * field is NULL but precious_table (see below) is not, the 265 * field is NULL but precious_table (see below) is not, the
265 * check is performed on such table (a register is precious if 266 * check is performed on such table (a register is precious if
266 * it belongs to one of the ranges specified by precious_table). 267 * it belongs to one of the ranges specified by precious_table).
268 * @disable_locking: This regmap is either protected by external means or
269 * is guaranteed not be be accessed from multiple threads.
270 * Don't use any locking mechanisms.
267 * @lock: Optional lock callback (overrides regmap's default lock 271 * @lock: Optional lock callback (overrides regmap's default lock
268 * function, based on spinlock or mutex). 272 * function, based on spinlock or mutex).
269 * @unlock: As above for unlocking. 273 * @unlock: As above for unlocking.
@@ -296,7 +300,10 @@ typedef void (*regmap_unlock)(void *);
296 * a read. 300 * a read.
297 * @write_flag_mask: Mask to be set in the top bytes of the register when doing 301 * @write_flag_mask: Mask to be set in the top bytes of the register when doing
298 * a write. If both read_flag_mask and write_flag_mask are 302 * a write. If both read_flag_mask and write_flag_mask are
299 * empty the regmap_bus default masks are used. 303 * empty and zero_flag_mask is not set the regmap_bus default
304 * masks are used.
305 * @zero_flag_mask: If set, read_flag_mask and write_flag_mask are used even
306 * if they are both empty.
300 * @use_single_rw: If set, converts the bulk read and write operations into 307 * @use_single_rw: If set, converts the bulk read and write operations into
301 * a series of single read and write operations. This is useful 308 * a series of single read and write operations. This is useful
302 * for device that does not support bulk read and write. 309 * for device that does not support bulk read and write.
@@ -317,6 +324,7 @@ typedef void (*regmap_unlock)(void *);
317 * 324 *
318 * @ranges: Array of configuration entries for virtual address ranges. 325 * @ranges: Array of configuration entries for virtual address ranges.
319 * @num_ranges: Number of range configuration entries. 326 * @num_ranges: Number of range configuration entries.
327 * @use_hwlock: Indicate if a hardware spinlock should be used.
320 * @hwlock_id: Specify the hardware spinlock id. 328 * @hwlock_id: Specify the hardware spinlock id.
321 * @hwlock_mode: The hardware spinlock mode, should be HWLOCK_IRQSTATE, 329 * @hwlock_mode: The hardware spinlock mode, should be HWLOCK_IRQSTATE,
322 * HWLOCK_IRQ or 0. 330 * HWLOCK_IRQ or 0.
@@ -333,6 +341,8 @@ struct regmap_config {
333 bool (*readable_reg)(struct device *dev, unsigned int reg); 341 bool (*readable_reg)(struct device *dev, unsigned int reg);
334 bool (*volatile_reg)(struct device *dev, unsigned int reg); 342 bool (*volatile_reg)(struct device *dev, unsigned int reg);
335 bool (*precious_reg)(struct device *dev, unsigned int reg); 343 bool (*precious_reg)(struct device *dev, unsigned int reg);
344
345 bool disable_locking;
336 regmap_lock lock; 346 regmap_lock lock;
337 regmap_unlock unlock; 347 regmap_unlock unlock;
338 void *lock_arg; 348 void *lock_arg;
@@ -355,6 +365,7 @@ struct regmap_config {
355 365
356 unsigned long read_flag_mask; 366 unsigned long read_flag_mask;
357 unsigned long write_flag_mask; 367 unsigned long write_flag_mask;
368 bool zero_flag_mask;
358 369
359 bool use_single_rw; 370 bool use_single_rw;
360 bool can_multi_write; 371 bool can_multi_write;
@@ -365,6 +376,7 @@ struct regmap_config {
365 const struct regmap_range_cfg *ranges; 376 const struct regmap_range_cfg *ranges;
366 unsigned int num_ranges; 377 unsigned int num_ranges;
367 378
379 bool use_hwlock;
368 unsigned int hwlock_id; 380 unsigned int hwlock_id;
369 unsigned int hwlock_mode; 381 unsigned int hwlock_mode;
370}; 382};
@@ -524,6 +536,10 @@ struct regmap *__regmap_init_ac97(struct snd_ac97 *ac97,
524 const struct regmap_config *config, 536 const struct regmap_config *config,
525 struct lock_class_key *lock_key, 537 struct lock_class_key *lock_key,
526 const char *lock_name); 538 const char *lock_name);
539struct regmap *__regmap_init_sdw(struct sdw_slave *sdw,
540 const struct regmap_config *config,
541 struct lock_class_key *lock_key,
542 const char *lock_name);
527 543
528struct regmap *__devm_regmap_init(struct device *dev, 544struct regmap *__devm_regmap_init(struct device *dev,
529 const struct regmap_bus *bus, 545 const struct regmap_bus *bus,
@@ -561,6 +577,10 @@ struct regmap *__devm_regmap_init_ac97(struct snd_ac97 *ac97,
561 const struct regmap_config *config, 577 const struct regmap_config *config,
562 struct lock_class_key *lock_key, 578 struct lock_class_key *lock_key,
563 const char *lock_name); 579 const char *lock_name);
580struct regmap *__devm_regmap_init_sdw(struct sdw_slave *sdw,
581 const struct regmap_config *config,
582 struct lock_class_key *lock_key,
583 const char *lock_name);
564 584
565/* 585/*
566 * Wrapper for regmap_init macros to include a unique lockdep key and name 586 * Wrapper for regmap_init macros to include a unique lockdep key and name
@@ -710,6 +730,20 @@ int regmap_attach_dev(struct device *dev, struct regmap *map,
710bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg); 730bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg);
711 731
712/** 732/**
733 * regmap_init_sdw() - Initialise register map
734 *
735 * @sdw: Device that will be interacted with
736 * @config: Configuration for register map
737 *
738 * The return value will be an ERR_PTR() on error or a valid pointer to
739 * a struct regmap.
740 */
741#define regmap_init_sdw(sdw, config) \
742 __regmap_lockdep_wrapper(__regmap_init_sdw, #config, \
743 sdw, config)
744
745
746/**
713 * devm_regmap_init() - Initialise managed register map 747 * devm_regmap_init() - Initialise managed register map
714 * 748 *
715 * @dev: Device that will be interacted with 749 * @dev: Device that will be interacted with
@@ -839,6 +873,20 @@ bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg);
839 __regmap_lockdep_wrapper(__devm_regmap_init_ac97, #config, \ 873 __regmap_lockdep_wrapper(__devm_regmap_init_ac97, #config, \
840 ac97, config) 874 ac97, config)
841 875
876/**
877 * devm_regmap_init_sdw() - Initialise managed register map
878 *
879 * @sdw: Device that will be interacted with
880 * @config: Configuration for register map
881 *
882 * The return value will be an ERR_PTR() on error or a valid pointer
883 * to a struct regmap. The regmap will be automatically freed by the
884 * device management code.
885 */
886#define devm_regmap_init_sdw(sdw, config) \
887 __regmap_lockdep_wrapper(__devm_regmap_init_sdw, #config, \
888 sdw, config)
889
842void regmap_exit(struct regmap *map); 890void regmap_exit(struct regmap *map);
843int regmap_reinit_cache(struct regmap *map, 891int regmap_reinit_cache(struct regmap *map,
844 const struct regmap_config *config); 892 const struct regmap_config *config);
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index 94417b4226bd..4c00486b7a78 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -214,6 +214,8 @@ struct regulator_ops {
214 /* set regulator suspend operating mode (defined in consumer.h) */ 214 /* set regulator suspend operating mode (defined in consumer.h) */
215 int (*set_suspend_mode) (struct regulator_dev *, unsigned int mode); 215 int (*set_suspend_mode) (struct regulator_dev *, unsigned int mode);
216 216
217 int (*resume_early)(struct regulator_dev *rdev);
218
217 int (*set_pull_down) (struct regulator_dev *); 219 int (*set_pull_down) (struct regulator_dev *);
218}; 220};
219 221
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index 9cd4fef37203..93a04893c739 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -42,6 +42,16 @@ struct regulator;
42#define REGULATOR_CHANGE_DRMS 0x10 42#define REGULATOR_CHANGE_DRMS 0x10
43#define REGULATOR_CHANGE_BYPASS 0x20 43#define REGULATOR_CHANGE_BYPASS 0x20
44 44
45/*
46 * operations in suspend mode
47 * DO_NOTHING_IN_SUSPEND - the default value
48 * DISABLE_IN_SUSPEND - turn off regulator in suspend states
49 * ENABLE_IN_SUSPEND - keep regulator on in suspend states
50 */
51#define DO_NOTHING_IN_SUSPEND (-1)
52#define DISABLE_IN_SUSPEND 0
53#define ENABLE_IN_SUSPEND 1
54
45/* Regulator active discharge flags */ 55/* Regulator active discharge flags */
46enum regulator_active_discharge { 56enum regulator_active_discharge {
47 REGULATOR_ACTIVE_DISCHARGE_DEFAULT, 57 REGULATOR_ACTIVE_DISCHARGE_DEFAULT,
@@ -56,16 +66,24 @@ enum regulator_active_discharge {
56 * state. One of enabled or disabled must be set for the 66 * state. One of enabled or disabled must be set for the
57 * configuration to be applied. 67 * configuration to be applied.
58 * 68 *
59 * @uV: Operating voltage during suspend. 69 * @uV: Default operating voltage during suspend, it can be adjusted
70 * among <min_uV, max_uV>.
71 * @min_uV: Minimum suspend voltage may be set.
72 * @max_uV: Maximum suspend voltage may be set.
60 * @mode: Operating mode during suspend. 73 * @mode: Operating mode during suspend.
61 * @enabled: Enabled during suspend. 74 * @enabled: operations during suspend.
62 * @disabled: Disabled during suspend. 75 * - DO_NOTHING_IN_SUSPEND
76 * - DISABLE_IN_SUSPEND
77 * - ENABLE_IN_SUSPEND
78 * @changeable: Is this state can be switched between enabled/disabled,
63 */ 79 */
64struct regulator_state { 80struct regulator_state {
65 int uV; /* suspend voltage */ 81 int uV;
66 unsigned int mode; /* suspend regulator operating mode */ 82 int min_uV;
67 int enabled; /* is regulator enabled in this suspend state */ 83 int max_uV;
68 int disabled; /* is the regulator disabled in this suspend state */ 84 unsigned int mode;
85 int enabled;
86 bool changeable;
69}; 87};
70 88
71/** 89/**
@@ -225,12 +243,12 @@ struct regulator_init_data {
225 243
226#ifdef CONFIG_REGULATOR 244#ifdef CONFIG_REGULATOR
227void regulator_has_full_constraints(void); 245void regulator_has_full_constraints(void);
228int regulator_suspend_prepare(suspend_state_t state);
229int regulator_suspend_finish(void);
230#else 246#else
231static inline void regulator_has_full_constraints(void) 247static inline void regulator_has_full_constraints(void)
232{ 248{
233} 249}
250#endif
251
234static inline int regulator_suspend_prepare(suspend_state_t state) 252static inline int regulator_suspend_prepare(suspend_state_t state)
235{ 253{
236 return 0; 254 return 0;
@@ -239,6 +257,5 @@ static inline int regulator_suspend_finish(void)
239{ 257{
240 return 0; 258 return 0;
241} 259}
242#endif
243 260
244#endif 261#endif
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 2032ce2eb20b..1eadec3fc228 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -70,8 +70,7 @@ static inline bool lockdep_rtnl_is_held(void)
70 * @p: The pointer to read, prior to dereferencing 70 * @p: The pointer to read, prior to dereferencing
71 * 71 *
72 * Return the value of the specified RCU-protected pointer, but omit 72 * Return the value of the specified RCU-protected pointer, but omit
73 * both the smp_read_barrier_depends() and the READ_ONCE(), because 73 * the READ_ONCE(), because caller holds RTNL.
74 * caller holds RTNL.
75 */ 74 */
76#define rtnl_dereference(p) \ 75#define rtnl_dereference(p) \
77 rcu_dereference_protected(p, lockdep_rtnl_is_held()) 76 rcu_dereference_protected(p, lockdep_rtnl_is_held())
diff --git a/include/linux/mfd/rtsx_common.h b/include/linux/rtsx_common.h
index 443176ee1ab0..443176ee1ab0 100644
--- a/include/linux/mfd/rtsx_common.h
+++ b/include/linux/rtsx_common.h
diff --git a/include/linux/mfd/rtsx_pci.h b/include/linux/rtsx_pci.h
index a2a1318a3d0c..478acf6efac6 100644
--- a/include/linux/mfd/rtsx_pci.h
+++ b/include/linux/rtsx_pci.h
@@ -24,7 +24,7 @@
24 24
25#include <linux/sched.h> 25#include <linux/sched.h>
26#include <linux/pci.h> 26#include <linux/pci.h>
27#include <linux/mfd/rtsx_common.h> 27#include <linux/rtsx_common.h>
28 28
29#define MAX_RW_REG_CNT 1024 29#define MAX_RW_REG_CNT 1024
30 30
@@ -203,6 +203,7 @@
203#define SD_DDR_MODE 0x04 203#define SD_DDR_MODE 0x04
204#define SD_30_MODE 0x08 204#define SD_30_MODE 0x08
205#define SD_CLK_DIVIDE_MASK 0xC0 205#define SD_CLK_DIVIDE_MASK 0xC0
206#define SD_MODE_SELECT_MASK 0x0C
206#define SD_CFG2 0xFDA1 207#define SD_CFG2 0xFDA1
207#define SD_CALCULATE_CRC7 0x00 208#define SD_CALCULATE_CRC7 0x00
208#define SD_NO_CALCULATE_CRC7 0x80 209#define SD_NO_CALCULATE_CRC7 0x80
@@ -226,6 +227,7 @@
226#define SD_RSP_TYPE_R6 0x01 227#define SD_RSP_TYPE_R6 0x01
227#define SD_RSP_TYPE_R7 0x01 228#define SD_RSP_TYPE_R7 0x01
228#define SD_CFG3 0xFDA2 229#define SD_CFG3 0xFDA2
230#define SD30_CLK_END_EN 0x10
229#define SD_RSP_80CLK_TIMEOUT_EN 0x01 231#define SD_RSP_80CLK_TIMEOUT_EN 0x01
230 232
231#define SD_STAT1 0xFDA3 233#define SD_STAT1 0xFDA3
@@ -309,6 +311,12 @@
309 311
310#define SD_DATA_STATE 0xFDB6 312#define SD_DATA_STATE 0xFDB6
311#define SD_DATA_IDLE 0x80 313#define SD_DATA_IDLE 0x80
314#define REG_SD_STOP_SDCLK_CFG 0xFDB8
315#define SD30_CLK_STOP_CFG_EN 0x04
316#define SD30_CLK_STOP_CFG1 0x02
317#define SD30_CLK_STOP_CFG0 0x01
318#define REG_PRE_RW_MODE 0xFD70
319#define EN_INFINITE_MODE 0x01
312 320
313#define SRCTL 0xFC13 321#define SRCTL 0xFC13
314 322
@@ -434,6 +442,7 @@
434#define CARD_CLK_EN 0xFD69 442#define CARD_CLK_EN 0xFD69
435#define SD_CLK_EN 0x04 443#define SD_CLK_EN 0x04
436#define MS_CLK_EN 0x08 444#define MS_CLK_EN 0x08
445#define SD40_CLK_EN 0x10
437#define SDIO_CTRL 0xFD6B 446#define SDIO_CTRL 0xFD6B
438#define CD_PAD_CTL 0xFD73 447#define CD_PAD_CTL 0xFD73
439#define CD_DISABLE_MASK 0x07 448#define CD_DISABLE_MASK 0x07
@@ -453,8 +462,8 @@
453#define FPDCTL 0xFC00 462#define FPDCTL 0xFC00
454#define SSC_POWER_DOWN 0x01 463#define SSC_POWER_DOWN 0x01
455#define SD_OC_POWER_DOWN 0x02 464#define SD_OC_POWER_DOWN 0x02
456#define ALL_POWER_DOWN 0x07 465#define ALL_POWER_DOWN 0x03
457#define OC_POWER_DOWN 0x06 466#define OC_POWER_DOWN 0x02
458#define PDINFO 0xFC01 467#define PDINFO 0xFC01
459 468
460#define CLK_CTL 0xFC02 469#define CLK_CTL 0xFC02
@@ -490,6 +499,9 @@
490 499
491#define FPGA_PULL_CTL 0xFC1D 500#define FPGA_PULL_CTL 0xFC1D
492#define OLT_LED_CTL 0xFC1E 501#define OLT_LED_CTL 0xFC1E
502#define LED_SHINE_MASK 0x08
503#define LED_SHINE_EN 0x08
504#define LED_SHINE_DISABLE 0x00
493#define GPIO_CTL 0xFC1F 505#define GPIO_CTL 0xFC1F
494 506
495#define LDO_CTL 0xFC1E 507#define LDO_CTL 0xFC1E
@@ -511,7 +523,11 @@
511#define BPP_LDO_ON 0x00 523#define BPP_LDO_ON 0x00
512#define BPP_LDO_SUSPEND 0x02 524#define BPP_LDO_SUSPEND 0x02
513#define BPP_LDO_OFF 0x03 525#define BPP_LDO_OFF 0x03
526#define EFUSE_CTL 0xFC30
527#define EFUSE_ADD 0xFC31
514#define SYS_VER 0xFC32 528#define SYS_VER 0xFC32
529#define EFUSE_DATAL 0xFC34
530#define EFUSE_DATAH 0xFC35
515 531
516#define CARD_PULL_CTL1 0xFD60 532#define CARD_PULL_CTL1 0xFD60
517#define CARD_PULL_CTL2 0xFD61 533#define CARD_PULL_CTL2 0xFD61
@@ -553,6 +569,9 @@
553#define RBBC1 0xFE2F 569#define RBBC1 0xFE2F
554#define RBDAT 0xFE30 570#define RBDAT 0xFE30
555#define RBCTL 0xFE34 571#define RBCTL 0xFE34
572#define U_AUTO_DMA_EN_MASK 0x20
573#define U_AUTO_DMA_DISABLE 0x00
574#define RB_FLUSH 0x80
556#define CFGADDR0 0xFE35 575#define CFGADDR0 0xFE35
557#define CFGADDR1 0xFE36 576#define CFGADDR1 0xFE36
558#define CFGDATA0 0xFE37 577#define CFGDATA0 0xFE37
@@ -581,6 +600,8 @@
581#define LTR_LATENCY_MODE_HW 0 600#define LTR_LATENCY_MODE_HW 0
582#define LTR_LATENCY_MODE_SW BIT(6) 601#define LTR_LATENCY_MODE_SW BIT(6)
583#define OBFF_CFG 0xFE4C 602#define OBFF_CFG 0xFE4C
603#define OBFF_EN_MASK 0x03
604#define OBFF_DISABLE 0x00
584 605
585#define CDRESUMECTL 0xFE52 606#define CDRESUMECTL 0xFE52
586#define WAKE_SEL_CTL 0xFE54 607#define WAKE_SEL_CTL 0xFE54
@@ -595,6 +616,7 @@
595#define FORCE_ASPM_L0_EN 0x01 616#define FORCE_ASPM_L0_EN 0x01
596#define FORCE_ASPM_NO_ASPM 0x00 617#define FORCE_ASPM_NO_ASPM 0x00
597#define PM_CLK_FORCE_CTL 0xFE58 618#define PM_CLK_FORCE_CTL 0xFE58
619#define CLK_PM_EN 0x01
598#define FUNC_FORCE_CTL 0xFE59 620#define FUNC_FORCE_CTL 0xFE59
599#define FUNC_FORCE_UPME_XMT_DBG 0x02 621#define FUNC_FORCE_UPME_XMT_DBG 0x02
600#define PERST_GLITCH_WIDTH 0xFE5C 622#define PERST_GLITCH_WIDTH 0xFE5C
@@ -620,14 +642,23 @@
620#define LDO_PWR_SEL 0xFE78 642#define LDO_PWR_SEL 0xFE78
621 643
622#define L1SUB_CONFIG1 0xFE8D 644#define L1SUB_CONFIG1 0xFE8D
645#define AUX_CLK_ACTIVE_SEL_MASK 0x01
646#define MAC_CKSW_DONE 0x00
623#define L1SUB_CONFIG2 0xFE8E 647#define L1SUB_CONFIG2 0xFE8E
624#define L1SUB_AUTO_CFG 0x02 648#define L1SUB_AUTO_CFG 0x02
625#define L1SUB_CONFIG3 0xFE8F 649#define L1SUB_CONFIG3 0xFE8F
626#define L1OFF_MBIAS2_EN_5250 BIT(7) 650#define L1OFF_MBIAS2_EN_5250 BIT(7)
627 651
628#define DUMMY_REG_RESET_0 0xFE90 652#define DUMMY_REG_RESET_0 0xFE90
653#define IC_VERSION_MASK 0x0F
629 654
655#define REG_VREF 0xFE97
656#define PWD_SUSPND_EN 0x10
657#define RTS5260_DMA_RST_CTL_0 0xFEBF
658#define RTS5260_DMA_RST 0x80
659#define RTS5260_ADMA3_RST 0x40
630#define AUTOLOAD_CFG_BASE 0xFF00 660#define AUTOLOAD_CFG_BASE 0xFF00
661#define RELINK_TIME_MASK 0x01
631#define PETXCFG 0xFF03 662#define PETXCFG 0xFF03
632#define FORCE_CLKREQ_DELINK_MASK BIT(7) 663#define FORCE_CLKREQ_DELINK_MASK BIT(7)
633#define FORCE_CLKREQ_LOW 0x80 664#define FORCE_CLKREQ_LOW 0x80
@@ -667,15 +698,24 @@
667#define LDO_DV18_CFG 0xFF70 698#define LDO_DV18_CFG 0xFF70
668#define LDO_DV18_SR_MASK 0xC0 699#define LDO_DV18_SR_MASK 0xC0
669#define LDO_DV18_SR_DF 0x40 700#define LDO_DV18_SR_DF 0x40
701#define DV331812_MASK 0x70
702#define DV331812_33 0x70
703#define DV331812_17 0x30
670 704
671#define LDO_CONFIG2 0xFF71 705#define LDO_CONFIG2 0xFF71
672#define LDO_D3318_MASK 0x07 706#define LDO_D3318_MASK 0x07
673#define LDO_D3318_33V 0x07 707#define LDO_D3318_33V 0x07
674#define LDO_D3318_18V 0x02 708#define LDO_D3318_18V 0x02
709#define DV331812_VDD1 0x04
710#define DV331812_POWERON 0x08
711#define DV331812_POWEROFF 0x00
675 712
676#define LDO_VCC_CFG0 0xFF72 713#define LDO_VCC_CFG0 0xFF72
677#define LDO_VCC_LMTVTH_MASK 0x30 714#define LDO_VCC_LMTVTH_MASK 0x30
678#define LDO_VCC_LMTVTH_2A 0x10 715#define LDO_VCC_LMTVTH_2A 0x10
716/*RTS5260*/
717#define RTS5260_DVCC_TUNE_MASK 0x70
718#define RTS5260_DVCC_33 0x70
679 719
680#define LDO_VCC_CFG1 0xFF73 720#define LDO_VCC_CFG1 0xFF73
681#define LDO_VCC_REF_TUNE_MASK 0x30 721#define LDO_VCC_REF_TUNE_MASK 0x30
@@ -684,6 +724,10 @@
684#define LDO_VCC_1V8 0x04 724#define LDO_VCC_1V8 0x04
685#define LDO_VCC_3V3 0x07 725#define LDO_VCC_3V3 0x07
686#define LDO_VCC_LMT_EN 0x08 726#define LDO_VCC_LMT_EN 0x08
727/*RTS5260*/
728#define LDO_POW_SDVDD1_MASK 0x08
729#define LDO_POW_SDVDD1_ON 0x08
730#define LDO_POW_SDVDD1_OFF 0x00
687 731
688#define LDO_VIO_CFG 0xFF75 732#define LDO_VIO_CFG 0xFF75
689#define LDO_VIO_SR_MASK 0xC0 733#define LDO_VIO_SR_MASK 0xC0
@@ -711,6 +755,160 @@
711#define SD_VIO_LDO_1V8 0x40 755#define SD_VIO_LDO_1V8 0x40
712#define SD_VIO_LDO_3V3 0x70 756#define SD_VIO_LDO_3V3 0x70
713 757
758#define RTS5260_AUTOLOAD_CFG4 0xFF7F
759#define RTS5260_MIMO_DISABLE 0x8A
760
761#define RTS5260_REG_GPIO_CTL0 0xFC1A
762#define RTS5260_REG_GPIO_MASK 0x01
763#define RTS5260_REG_GPIO_ON 0x01
764#define RTS5260_REG_GPIO_OFF 0x00
765
766#define PWR_GLOBAL_CTRL 0xF200
767#define PCIE_L1_2_EN 0x0C
768#define PCIE_L1_1_EN 0x0A
769#define PCIE_L1_0_EN 0x09
770#define PWR_FE_CTL 0xF201
771#define PCIE_L1_2_PD_FE_EN 0x0C
772#define PCIE_L1_1_PD_FE_EN 0x0A
773#define PCIE_L1_0_PD_FE_EN 0x09
774#define CFG_PCIE_APHY_OFF_0 0xF204
775#define CFG_PCIE_APHY_OFF_0_DEFAULT 0xBF
776#define CFG_PCIE_APHY_OFF_1 0xF205
777#define CFG_PCIE_APHY_OFF_1_DEFAULT 0xFF
778#define CFG_PCIE_APHY_OFF_2 0xF206
779#define CFG_PCIE_APHY_OFF_2_DEFAULT 0x01
780#define CFG_PCIE_APHY_OFF_3 0xF207
781#define CFG_PCIE_APHY_OFF_3_DEFAULT 0x00
782#define CFG_L1_0_PCIE_MAC_RET_VALUE 0xF20C
783#define CFG_L1_0_PCIE_DPHY_RET_VALUE 0xF20E
784#define CFG_L1_0_SYS_RET_VALUE 0xF210
785#define CFG_L1_0_CRC_MISC_RET_VALUE 0xF212
786#define CFG_L1_0_CRC_SD30_RET_VALUE 0xF214
787#define CFG_L1_0_CRC_SD40_RET_VALUE 0xF216
788#define CFG_LP_FPWM_VALUE 0xF219
789#define CFG_LP_FPWM_VALUE_DEFAULT 0x18
790#define PWC_CDR 0xF253
791#define PWC_CDR_DEFAULT 0x03
792#define CFG_L1_0_RET_VALUE_DEFAULT 0x1B
793#define CFG_L1_0_CRC_MISC_RET_VALUE_DEFAULT 0x0C
794
795/* OCPCTL */
796#define SD_DETECT_EN 0x08
797#define SD_OCP_INT_EN 0x04
798#define SD_OCP_INT_CLR 0x02
799#define SD_OC_CLR 0x01
800
801#define SDVIO_DETECT_EN (1 << 7)
802#define SDVIO_OCP_INT_EN (1 << 6)
803#define SDVIO_OCP_INT_CLR (1 << 5)
804#define SDVIO_OC_CLR (1 << 4)
805
806/* OCPSTAT */
807#define SD_OCP_DETECT 0x08
808#define SD_OC_NOW 0x04
809#define SD_OC_EVER 0x02
810
811#define SDVIO_OC_NOW (1 << 6)
812#define SDVIO_OC_EVER (1 << 5)
813
814#define REG_OCPCTL 0xFD6A
815#define REG_OCPSTAT 0xFD6E
816#define REG_OCPGLITCH 0xFD6C
817#define REG_OCPPARA1 0xFD6B
818#define REG_OCPPARA2 0xFD6D
819
820/* rts5260 DV3318 OCP-related registers */
821#define REG_DV3318_OCPCTL 0xFD89
822#define DV3318_OCP_TIME_MASK 0xF0
823#define DV3318_DETECT_EN 0x08
824#define DV3318_OCP_INT_EN 0x04
825#define DV3318_OCP_INT_CLR 0x02
826#define DV3318_OCP_CLR 0x01
827
828#define REG_DV3318_OCPSTAT 0xFD8A
829#define DV3318_OCP_GlITCH_TIME_MASK 0xF0
830#define DV3318_OCP_DETECT 0x08
831#define DV3318_OCP_NOW 0x04
832#define DV3318_OCP_EVER 0x02
833
834#define SD_OCP_GLITCH_MASK 0x0F
835
836/* OCPPARA1 */
837#define SDVIO_OCP_TIME_60 0x00
838#define SDVIO_OCP_TIME_100 0x10
839#define SDVIO_OCP_TIME_200 0x20
840#define SDVIO_OCP_TIME_400 0x30
841#define SDVIO_OCP_TIME_600 0x40
842#define SDVIO_OCP_TIME_800 0x50
843#define SDVIO_OCP_TIME_1100 0x60
844#define SDVIO_OCP_TIME_MASK 0x70
845
846#define SD_OCP_TIME_60 0x00
847#define SD_OCP_TIME_100 0x01
848#define SD_OCP_TIME_200 0x02
849#define SD_OCP_TIME_400 0x03
850#define SD_OCP_TIME_600 0x04
851#define SD_OCP_TIME_800 0x05
852#define SD_OCP_TIME_1100 0x06
853#define SD_OCP_TIME_MASK 0x07
854
855/* OCPPARA2 */
856#define SDVIO_OCP_THD_190 0x00
857#define SDVIO_OCP_THD_250 0x10
858#define SDVIO_OCP_THD_320 0x20
859#define SDVIO_OCP_THD_380 0x30
860#define SDVIO_OCP_THD_440 0x40
861#define SDVIO_OCP_THD_500 0x50
862#define SDVIO_OCP_THD_570 0x60
863#define SDVIO_OCP_THD_630 0x70
864#define SDVIO_OCP_THD_MASK 0x70
865
866#define SD_OCP_THD_450 0x00
867#define SD_OCP_THD_550 0x01
868#define SD_OCP_THD_650 0x02
869#define SD_OCP_THD_750 0x03
870#define SD_OCP_THD_850 0x04
871#define SD_OCP_THD_950 0x05
872#define SD_OCP_THD_1050 0x06
873#define SD_OCP_THD_1150 0x07
874#define SD_OCP_THD_MASK 0x07
875
876#define SDVIO_OCP_GLITCH_MASK 0xF0
877#define SDVIO_OCP_GLITCH_NONE 0x00
878#define SDVIO_OCP_GLITCH_50U 0x10
879#define SDVIO_OCP_GLITCH_100U 0x20
880#define SDVIO_OCP_GLITCH_200U 0x30
881#define SDVIO_OCP_GLITCH_600U 0x40
882#define SDVIO_OCP_GLITCH_800U 0x50
883#define SDVIO_OCP_GLITCH_1M 0x60
884#define SDVIO_OCP_GLITCH_2M 0x70
885#define SDVIO_OCP_GLITCH_3M 0x80
886#define SDVIO_OCP_GLITCH_4M 0x90
887#define SDVIO_OCP_GLIVCH_5M 0xA0
888#define SDVIO_OCP_GLITCH_6M 0xB0
889#define SDVIO_OCP_GLITCH_7M 0xC0
890#define SDVIO_OCP_GLITCH_8M 0xD0
891#define SDVIO_OCP_GLITCH_9M 0xE0
892#define SDVIO_OCP_GLITCH_10M 0xF0
893
894#define SD_OCP_GLITCH_MASK 0x0F
895#define SD_OCP_GLITCH_NONE 0x00
896#define SD_OCP_GLITCH_50U 0x01
897#define SD_OCP_GLITCH_100U 0x02
898#define SD_OCP_GLITCH_200U 0x03
899#define SD_OCP_GLITCH_600U 0x04
900#define SD_OCP_GLITCH_800U 0x05
901#define SD_OCP_GLITCH_1M 0x06
902#define SD_OCP_GLITCH_2M 0x07
903#define SD_OCP_GLITCH_3M 0x08
904#define SD_OCP_GLITCH_4M 0x09
905#define SD_OCP_GLIVCH_5M 0x0A
906#define SD_OCP_GLITCH_6M 0x0B
907#define SD_OCP_GLITCH_7M 0x0C
908#define SD_OCP_GLITCH_8M 0x0D
909#define SD_OCP_GLITCH_9M 0x0E
910#define SD_OCP_GLITCH_10M 0x0F
911
714/* Phy register */ 912/* Phy register */
715#define PHY_PCR 0x00 913#define PHY_PCR 0x00
716#define PHY_PCR_FORCE_CODE 0xB000 914#define PHY_PCR_FORCE_CODE 0xB000
@@ -857,6 +1055,7 @@
857 1055
858#define PCR_ASPM_SETTING_REG1 0x160 1056#define PCR_ASPM_SETTING_REG1 0x160
859#define PCR_ASPM_SETTING_REG2 0x168 1057#define PCR_ASPM_SETTING_REG2 0x168
1058#define PCR_ASPM_SETTING_5260 0x178
860 1059
861#define PCR_SETTING_REG1 0x724 1060#define PCR_SETTING_REG1 0x724
862#define PCR_SETTING_REG2 0x814 1061#define PCR_SETTING_REG2 0x814
@@ -890,6 +1089,7 @@ struct pcr_ops {
890 int (*conv_clk_and_div_n)(int clk, int dir); 1089 int (*conv_clk_and_div_n)(int clk, int dir);
891 void (*fetch_vendor_settings)(struct rtsx_pcr *pcr); 1090 void (*fetch_vendor_settings)(struct rtsx_pcr *pcr);
892 void (*force_power_down)(struct rtsx_pcr *pcr, u8 pm_state); 1091 void (*force_power_down)(struct rtsx_pcr *pcr, u8 pm_state);
1092 void (*stop_cmd)(struct rtsx_pcr *pcr);
893 1093
894 void (*set_aspm)(struct rtsx_pcr *pcr, bool enable); 1094 void (*set_aspm)(struct rtsx_pcr *pcr, bool enable);
895 int (*set_ltr_latency)(struct rtsx_pcr *pcr, u32 latency); 1095 int (*set_ltr_latency)(struct rtsx_pcr *pcr, u32 latency);
@@ -897,6 +1097,12 @@ struct pcr_ops {
897 void (*set_l1off_cfg_sub_d0)(struct rtsx_pcr *pcr, int active); 1097 void (*set_l1off_cfg_sub_d0)(struct rtsx_pcr *pcr, int active);
898 void (*full_on)(struct rtsx_pcr *pcr); 1098 void (*full_on)(struct rtsx_pcr *pcr);
899 void (*power_saving)(struct rtsx_pcr *pcr); 1099 void (*power_saving)(struct rtsx_pcr *pcr);
1100 void (*enable_ocp)(struct rtsx_pcr *pcr);
1101 void (*disable_ocp)(struct rtsx_pcr *pcr);
1102 void (*init_ocp)(struct rtsx_pcr *pcr);
1103 void (*process_ocp)(struct rtsx_pcr *pcr);
1104 int (*get_ocpstat)(struct rtsx_pcr *pcr, u8 *val);
1105 void (*clear_ocpstat)(struct rtsx_pcr *pcr);
900}; 1106};
901 1107
902enum PDEV_STAT {PDEV_STAT_IDLE, PDEV_STAT_RUN}; 1108enum PDEV_STAT {PDEV_STAT_IDLE, PDEV_STAT_RUN};
@@ -915,10 +1121,10 @@ enum PDEV_STAT {PDEV_STAT_IDLE, PDEV_STAT_RUN};
915#define LTR_L1SS_PWR_GATE_CHECK_CARD_EN BIT(6) 1121#define LTR_L1SS_PWR_GATE_CHECK_CARD_EN BIT(6)
916 1122
917enum dev_aspm_mode { 1123enum dev_aspm_mode {
918 DEV_ASPM_DISABLE = 0,
919 DEV_ASPM_DYNAMIC, 1124 DEV_ASPM_DYNAMIC,
920 DEV_ASPM_BACKDOOR, 1125 DEV_ASPM_BACKDOOR,
921 DEV_ASPM_STATIC, 1126 DEV_ASPM_STATIC,
1127 DEV_ASPM_DISABLE,
922}; 1128};
923 1129
924/* 1130/*
@@ -935,6 +1141,9 @@ enum dev_aspm_mode {
935 * @l1_snooze_delay: l1 snooze delay 1141 * @l1_snooze_delay: l1 snooze delay
936 * @ltr_l1off_sspwrgate: ltr l1off sspwrgate 1142 * @ltr_l1off_sspwrgate: ltr l1off sspwrgate
937 * @ltr_l1off_snooze_sspwrgate: ltr l1off snooze sspwrgate 1143 * @ltr_l1off_snooze_sspwrgate: ltr l1off snooze sspwrgate
1144 * @ocp_en: enable ocp flag
1145 * @sd_400mA_ocp_thd: 400mA ocp thd
1146 * @sd_800mA_ocp_thd: 800mA ocp thd
938 */ 1147 */
939struct rtsx_cr_option { 1148struct rtsx_cr_option {
940 u32 dev_flags; 1149 u32 dev_flags;
@@ -949,6 +1158,19 @@ struct rtsx_cr_option {
949 u32 l1_snooze_delay; 1158 u32 l1_snooze_delay;
950 u8 ltr_l1off_sspwrgate; 1159 u8 ltr_l1off_sspwrgate;
951 u8 ltr_l1off_snooze_sspwrgate; 1160 u8 ltr_l1off_snooze_sspwrgate;
1161 bool ocp_en;
1162 u8 sd_400mA_ocp_thd;
1163 u8 sd_800mA_ocp_thd;
1164};
1165
1166/*
1167 * struct rtsx_hw_param - card reader hardware param
1168 * @interrupt_en: indicate which interrutp enable
1169 * @ocp_glitch: ocp glitch time
1170 */
1171struct rtsx_hw_param {
1172 u32 interrupt_en;
1173 u8 ocp_glitch;
952}; 1174};
953 1175
954#define rtsx_set_dev_flag(cr, flag) \ 1176#define rtsx_set_dev_flag(cr, flag) \
@@ -963,6 +1185,7 @@ struct rtsx_pcr {
963 unsigned int id; 1185 unsigned int id;
964 int pcie_cap; 1186 int pcie_cap;
965 struct rtsx_cr_option option; 1187 struct rtsx_cr_option option;
1188 struct rtsx_hw_param hw_param;
966 1189
967 /* pci resources */ 1190 /* pci resources */
968 unsigned long addr; 1191 unsigned long addr;
@@ -1042,12 +1265,15 @@ struct rtsx_pcr {
1042 struct rtsx_slot *slots; 1265 struct rtsx_slot *slots;
1043 1266
1044 u8 dma_error_count; 1267 u8 dma_error_count;
1268 u8 ocp_stat;
1269 u8 ocp_stat2;
1045}; 1270};
1046 1271
1047#define PID_524A 0x524A 1272#define PID_524A 0x524A
1048#define PID_5249 0x5249 1273#define PID_5249 0x5249
1049#define PID_5250 0x5250 1274#define PID_5250 0x5250
1050#define PID_525A 0x525A 1275#define PID_525A 0x525A
1276#define PID_5260 0x5260
1051 1277
1052#define CHK_PCI_PID(pcr, pid) ((pcr)->pci->device == (pid)) 1278#define CHK_PCI_PID(pcr, pid) ((pcr)->pci->device == (pid))
1053#define PCI_VID(pcr) ((pcr)->pci->vendor) 1279#define PCI_VID(pcr) ((pcr)->pci->vendor)
diff --git a/include/linux/mfd/rtsx_usb.h b/include/linux/rtsx_usb.h
index c446e4fd6b5c..c446e4fd6b5c 100644
--- a/include/linux/mfd/rtsx_usb.h
+++ b/include/linux/rtsx_usb.h
diff --git a/include/linux/rwlock_types.h b/include/linux/rwlock_types.h
index cc0072e93e36..857a72ceb794 100644
--- a/include/linux/rwlock_types.h
+++ b/include/linux/rwlock_types.h
@@ -10,9 +10,6 @@
10 */ 10 */
11typedef struct { 11typedef struct {
12 arch_rwlock_t raw_lock; 12 arch_rwlock_t raw_lock;
13#ifdef CONFIG_GENERIC_LOCKBREAK
14 unsigned int break_lock;
15#endif
16#ifdef CONFIG_DEBUG_SPINLOCK 13#ifdef CONFIG_DEBUG_SPINLOCK
17 unsigned int magic, owner_cpu; 14 unsigned int magic, owner_cpu;
18 void *owner; 15 void *owner;
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index b7c83254c566..22b2131bcdcd 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -276,6 +276,17 @@ int sg_alloc_table_from_pages(struct sg_table *sgt, struct page **pages,
276 unsigned int n_pages, unsigned int offset, 276 unsigned int n_pages, unsigned int offset,
277 unsigned long size, gfp_t gfp_mask); 277 unsigned long size, gfp_t gfp_mask);
278 278
279#ifdef CONFIG_SGL_ALLOC
280struct scatterlist *sgl_alloc_order(unsigned long long length,
281 unsigned int order, bool chainable,
282 gfp_t gfp, unsigned int *nent_p);
283struct scatterlist *sgl_alloc(unsigned long long length, gfp_t gfp,
284 unsigned int *nent_p);
285void sgl_free_n_order(struct scatterlist *sgl, int nents, int order);
286void sgl_free_order(struct scatterlist *sgl, int order);
287void sgl_free(struct scatterlist *sgl);
288#endif /* CONFIG_SGL_ALLOC */
289
279size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, void *buf, 290size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, void *buf,
280 size_t buflen, off_t skip, bool to_buffer); 291 size_t buflen, off_t skip, bool to_buffer);
281 292
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 21991d668d35..166144c04ef6 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -472,11 +472,15 @@ struct sched_dl_entity {
472 * has not been executed yet. This flag is useful to avoid race 472 * has not been executed yet. This flag is useful to avoid race
473 * conditions between the inactive timer handler and the wakeup 473 * conditions between the inactive timer handler and the wakeup
474 * code. 474 * code.
475 *
476 * @dl_overrun tells if the task asked to be informed about runtime
477 * overruns.
475 */ 478 */
476 unsigned int dl_throttled : 1; 479 unsigned int dl_throttled : 1;
477 unsigned int dl_boosted : 1; 480 unsigned int dl_boosted : 1;
478 unsigned int dl_yielded : 1; 481 unsigned int dl_yielded : 1;
479 unsigned int dl_non_contending : 1; 482 unsigned int dl_non_contending : 1;
483 unsigned int dl_overrun : 1;
480 484
481 /* 485 /*
482 * Bandwidth enforcement timer. Each -deadline task has its 486 * Bandwidth enforcement timer. Each -deadline task has its
@@ -849,17 +853,6 @@ struct task_struct {
849 struct held_lock held_locks[MAX_LOCK_DEPTH]; 853 struct held_lock held_locks[MAX_LOCK_DEPTH];
850#endif 854#endif
851 855
852#ifdef CONFIG_LOCKDEP_CROSSRELEASE
853#define MAX_XHLOCKS_NR 64UL
854 struct hist_lock *xhlocks; /* Crossrelease history locks */
855 unsigned int xhlock_idx;
856 /* For restoring at history boundaries */
857 unsigned int xhlock_idx_hist[XHLOCK_CTX_NR];
858 unsigned int hist_id;
859 /* For overwrite check at each context exit */
860 unsigned int hist_id_save[XHLOCK_CTX_NR];
861#endif
862
863#ifdef CONFIG_UBSAN 856#ifdef CONFIG_UBSAN
864 unsigned int in_ubsan; 857 unsigned int in_ubsan;
865#endif 858#endif
@@ -1438,6 +1431,7 @@ extern int idle_cpu(int cpu);
1438extern int sched_setscheduler(struct task_struct *, int, const struct sched_param *); 1431extern int sched_setscheduler(struct task_struct *, int, const struct sched_param *);
1439extern int sched_setscheduler_nocheck(struct task_struct *, int, const struct sched_param *); 1432extern int sched_setscheduler_nocheck(struct task_struct *, int, const struct sched_param *);
1440extern int sched_setattr(struct task_struct *, const struct sched_attr *); 1433extern int sched_setattr(struct task_struct *, const struct sched_attr *);
1434extern int sched_setattr_nocheck(struct task_struct *, const struct sched_attr *);
1441extern struct task_struct *idle_task(int cpu); 1435extern struct task_struct *idle_task(int cpu);
1442 1436
1443/** 1437/**
@@ -1457,12 +1451,21 @@ extern void ia64_set_curr_task(int cpu, struct task_struct *p);
1457void yield(void); 1451void yield(void);
1458 1452
1459union thread_union { 1453union thread_union {
1454#ifndef CONFIG_ARCH_TASK_STRUCT_ON_STACK
1455 struct task_struct task;
1456#endif
1460#ifndef CONFIG_THREAD_INFO_IN_TASK 1457#ifndef CONFIG_THREAD_INFO_IN_TASK
1461 struct thread_info thread_info; 1458 struct thread_info thread_info;
1462#endif 1459#endif
1463 unsigned long stack[THREAD_SIZE/sizeof(long)]; 1460 unsigned long stack[THREAD_SIZE/sizeof(long)];
1464}; 1461};
1465 1462
1463#ifndef CONFIG_THREAD_INFO_IN_TASK
1464extern struct thread_info init_thread_info;
1465#endif
1466
1467extern unsigned long init_stack[THREAD_SIZE / sizeof(unsigned long)];
1468
1466#ifdef CONFIG_THREAD_INFO_IN_TASK 1469#ifdef CONFIG_THREAD_INFO_IN_TASK
1467static inline struct thread_info *task_thread_info(struct task_struct *task) 1470static inline struct thread_info *task_thread_info(struct task_struct *task)
1468{ 1471{
@@ -1503,7 +1506,11 @@ static inline void set_task_comm(struct task_struct *tsk, const char *from)
1503 __set_task_comm(tsk, from, false); 1506 __set_task_comm(tsk, from, false);
1504} 1507}
1505 1508
1506extern char *get_task_comm(char *to, struct task_struct *tsk); 1509extern char *__get_task_comm(char *to, size_t len, struct task_struct *tsk);
1510#define get_task_comm(buf, tsk) ({ \
1511 BUILD_BUG_ON(sizeof(buf) != TASK_COMM_LEN); \
1512 __get_task_comm(buf, sizeof(buf), tsk); \
1513})
1507 1514
1508#ifdef CONFIG_SMP 1515#ifdef CONFIG_SMP
1509void scheduler_ipi(void); 1516void scheduler_ipi(void);
diff --git a/include/linux/sched/coredump.h b/include/linux/sched/coredump.h
index 9c8847395b5e..ec912d01126f 100644
--- a/include/linux/sched/coredump.h
+++ b/include/linux/sched/coredump.h
@@ -70,6 +70,7 @@ static inline int get_dumpable(struct mm_struct *mm)
70#define MMF_UNSTABLE 22 /* mm is unstable for copy_from_user */ 70#define MMF_UNSTABLE 22 /* mm is unstable for copy_from_user */
71#define MMF_HUGE_ZERO_PAGE 23 /* mm has ever used the global huge zero page */ 71#define MMF_HUGE_ZERO_PAGE 23 /* mm has ever used the global huge zero page */
72#define MMF_DISABLE_THP 24 /* disable THP for all VMAs */ 72#define MMF_DISABLE_THP 24 /* disable THP for all VMAs */
73#define MMF_OOM_VICTIM 25 /* mm is the oom victim */
73#define MMF_DISABLE_THP_MASK (1 << MMF_DISABLE_THP) 74#define MMF_DISABLE_THP_MASK (1 << MMF_DISABLE_THP)
74 75
75#define MMF_INIT_MASK (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK |\ 76#define MMF_INIT_MASK (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK |\
diff --git a/include/linux/sched/cpufreq.h b/include/linux/sched/cpufreq.h
index d1ad3d825561..0b55834efd46 100644
--- a/include/linux/sched/cpufreq.h
+++ b/include/linux/sched/cpufreq.h
@@ -12,8 +12,6 @@
12#define SCHED_CPUFREQ_DL (1U << 1) 12#define SCHED_CPUFREQ_DL (1U << 1)
13#define SCHED_CPUFREQ_IOWAIT (1U << 2) 13#define SCHED_CPUFREQ_IOWAIT (1U << 2)
14 14
15#define SCHED_CPUFREQ_RT_DL (SCHED_CPUFREQ_RT | SCHED_CPUFREQ_DL)
16
17#ifdef CONFIG_CPU_FREQ 15#ifdef CONFIG_CPU_FREQ
18struct update_util_data { 16struct update_util_data {
19 void (*func)(struct update_util_data *data, u64 time, unsigned int flags); 17 void (*func)(struct update_util_data *data, u64 time, unsigned int flags);
diff --git a/include/linux/sched/task_stack.h b/include/linux/sched/task_stack.h
index cb4828aaa34f..6a841929073f 100644
--- a/include/linux/sched/task_stack.h
+++ b/include/linux/sched/task_stack.h
@@ -78,7 +78,7 @@ static inline void put_task_stack(struct task_struct *tsk) {}
78#define task_stack_end_corrupted(task) \ 78#define task_stack_end_corrupted(task) \
79 (*(end_of_stack(task)) != STACK_END_MAGIC) 79 (*(end_of_stack(task)) != STACK_END_MAGIC)
80 80
81static inline int object_is_on_stack(void *obj) 81static inline int object_is_on_stack(const void *obj)
82{ 82{
83 void *stack = task_stack_page(current); 83 void *stack = task_stack_page(current);
84 84
diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h
index cf257c2e728d..26347741ba50 100644
--- a/include/linux/sched/topology.h
+++ b/include/linux/sched/topology.h
@@ -7,6 +7,12 @@
7#include <linux/sched/idle.h> 7#include <linux/sched/idle.h>
8 8
9/* 9/*
10 * Increase resolution of cpu_capacity calculations
11 */
12#define SCHED_CAPACITY_SHIFT SCHED_FIXEDPOINT_SHIFT
13#define SCHED_CAPACITY_SCALE (1L << SCHED_CAPACITY_SHIFT)
14
15/*
10 * sched-domains (multiprocessor balancing) declarations: 16 * sched-domains (multiprocessor balancing) declarations:
11 */ 17 */
12#ifdef CONFIG_SMP 18#ifdef CONFIG_SMP
@@ -27,12 +33,6 @@
27#define SD_OVERLAP 0x2000 /* sched_domains of this level overlap */ 33#define SD_OVERLAP 0x2000 /* sched_domains of this level overlap */
28#define SD_NUMA 0x4000 /* cross-node balancing */ 34#define SD_NUMA 0x4000 /* cross-node balancing */
29 35
30/*
31 * Increase resolution of cpu_capacity calculations
32 */
33#define SCHED_CAPACITY_SHIFT SCHED_FIXEDPOINT_SHIFT
34#define SCHED_CAPACITY_SCALE (1L << SCHED_CAPACITY_SHIFT)
35
36#ifdef CONFIG_SCHED_SMT 36#ifdef CONFIG_SCHED_SMT
37static inline int cpu_smt_flags(void) 37static inline int cpu_smt_flags(void)
38{ 38{
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h
index f189a8a3bbb8..bcf4cf26b8c8 100644
--- a/include/linux/seqlock.h
+++ b/include/linux/seqlock.h
@@ -278,9 +278,8 @@ static inline void raw_write_seqcount_barrier(seqcount_t *s)
278 278
279static inline int raw_read_seqcount_latch(seqcount_t *s) 279static inline int raw_read_seqcount_latch(seqcount_t *s)
280{ 280{
281 int seq = READ_ONCE(s->sequence);
282 /* Pairs with the first smp_wmb() in raw_write_seqcount_latch() */ 281 /* Pairs with the first smp_wmb() in raw_write_seqcount_latch() */
283 smp_read_barrier_depends(); 282 int seq = READ_ONCE(s->sequence); /* ^^^ */
284 return seq; 283 return seq;
285} 284}
286 285
diff --git a/include/linux/serdev.h b/include/linux/serdev.h
index d609e6dc5bad..d4bb46a26dc3 100644
--- a/include/linux/serdev.h
+++ b/include/linux/serdev.h
@@ -193,6 +193,7 @@ static inline int serdev_controller_receive_buf(struct serdev_controller *ctrl,
193 193
194int serdev_device_open(struct serdev_device *); 194int serdev_device_open(struct serdev_device *);
195void serdev_device_close(struct serdev_device *); 195void serdev_device_close(struct serdev_device *);
196int devm_serdev_device_open(struct device *, struct serdev_device *);
196unsigned int serdev_device_set_baudrate(struct serdev_device *, unsigned int); 197unsigned int serdev_device_set_baudrate(struct serdev_device *, unsigned int);
197void serdev_device_set_flow_control(struct serdev_device *, bool); 198void serdev_device_set_flow_control(struct serdev_device *, bool);
198int serdev_device_write_buf(struct serdev_device *, const unsigned char *, size_t); 199int serdev_device_write_buf(struct serdev_device *, const unsigned char *, size_t);
diff --git a/include/linux/sh_eth.h b/include/linux/sh_eth.h
index ff3642d267f7..94081e9a5010 100644
--- a/include/linux/sh_eth.h
+++ b/include/linux/sh_eth.h
@@ -17,7 +17,6 @@ struct sh_eth_plat_data {
17 unsigned char mac_addr[ETH_ALEN]; 17 unsigned char mac_addr[ETH_ALEN];
18 unsigned no_ether_link:1; 18 unsigned no_ether_link:1;
19 unsigned ether_link_active_low:1; 19 unsigned ether_link_active_low:1;
20 unsigned needs_init:1;
21}; 20};
22 21
23#endif 22#endif
diff --git a/include/linux/sound.h b/include/linux/sound.h
index 3c6d393c7f29..ec85b7a1f8d1 100644
--- a/include/linux/sound.h
+++ b/include/linux/sound.h
@@ -12,11 +12,9 @@ struct device;
12extern int register_sound_special(const struct file_operations *fops, int unit); 12extern int register_sound_special(const struct file_operations *fops, int unit);
13extern int register_sound_special_device(const struct file_operations *fops, int unit, struct device *dev); 13extern int register_sound_special_device(const struct file_operations *fops, int unit, struct device *dev);
14extern int register_sound_mixer(const struct file_operations *fops, int dev); 14extern int register_sound_mixer(const struct file_operations *fops, int dev);
15extern int register_sound_midi(const struct file_operations *fops, int dev);
16extern int register_sound_dsp(const struct file_operations *fops, int dev); 15extern int register_sound_dsp(const struct file_operations *fops, int dev);
17 16
18extern void unregister_sound_special(int unit); 17extern void unregister_sound_special(int unit);
19extern void unregister_sound_mixer(int unit); 18extern void unregister_sound_mixer(int unit);
20extern void unregister_sound_midi(int unit);
21extern void unregister_sound_dsp(int unit); 19extern void unregister_sound_dsp(int unit);
22#endif /* _LINUX_SOUND_H */ 20#endif /* _LINUX_SOUND_H */
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 7b2170bfd6e7..bc6bb325d1bf 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -126,7 +126,7 @@ void spi_statistics_add_transfer_stats(struct spi_statistics *stats,
126 * for that name. This appears in the sysfs "modalias" attribute 126 * for that name. This appears in the sysfs "modalias" attribute
127 * for driver coldplugging, and in uevents used for hotplugging 127 * for driver coldplugging, and in uevents used for hotplugging
128 * @cs_gpio: gpio number of the chipselect line (optional, -ENOENT when 128 * @cs_gpio: gpio number of the chipselect line (optional, -ENOENT when
129 * when not using a GPIO line) 129 * not using a GPIO line)
130 * 130 *
131 * @statistics: statistics for the spi_device 131 * @statistics: statistics for the spi_device
132 * 132 *
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index a39186194cd6..3bf273538840 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -107,16 +107,11 @@ do { \
107 107
108#define raw_spin_is_locked(lock) arch_spin_is_locked(&(lock)->raw_lock) 108#define raw_spin_is_locked(lock) arch_spin_is_locked(&(lock)->raw_lock)
109 109
110#ifdef CONFIG_GENERIC_LOCKBREAK
111#define raw_spin_is_contended(lock) ((lock)->break_lock)
112#else
113
114#ifdef arch_spin_is_contended 110#ifdef arch_spin_is_contended
115#define raw_spin_is_contended(lock) arch_spin_is_contended(&(lock)->raw_lock) 111#define raw_spin_is_contended(lock) arch_spin_is_contended(&(lock)->raw_lock)
116#else 112#else
117#define raw_spin_is_contended(lock) (((void)(lock), 0)) 113#define raw_spin_is_contended(lock) (((void)(lock), 0))
118#endif /*arch_spin_is_contended*/ 114#endif /*arch_spin_is_contended*/
119#endif
120 115
121/* 116/*
122 * This barrier must provide two things: 117 * This barrier must provide two things:
diff --git a/include/linux/spinlock_types.h b/include/linux/spinlock_types.h
index 73548eb13a5d..24b4e6f2c1a2 100644
--- a/include/linux/spinlock_types.h
+++ b/include/linux/spinlock_types.h
@@ -19,9 +19,6 @@
19 19
20typedef struct raw_spinlock { 20typedef struct raw_spinlock {
21 arch_spinlock_t raw_lock; 21 arch_spinlock_t raw_lock;
22#ifdef CONFIG_GENERIC_LOCKBREAK
23 unsigned int break_lock;
24#endif
25#ifdef CONFIG_DEBUG_SPINLOCK 22#ifdef CONFIG_DEBUG_SPINLOCK
26 unsigned int magic, owner_cpu; 23 unsigned int magic, owner_cpu;
27 void *owner; 24 void *owner;
diff --git a/include/linux/srcu.h b/include/linux/srcu.h
index 62be8966e837..33c1c698df09 100644
--- a/include/linux/srcu.h
+++ b/include/linux/srcu.h
@@ -92,7 +92,7 @@ void synchronize_srcu(struct srcu_struct *sp);
92 * relies on normal RCU, it can be called from the CPU which 92 * relies on normal RCU, it can be called from the CPU which
93 * is in the idle loop from an RCU point of view or offline. 93 * is in the idle loop from an RCU point of view or offline.
94 */ 94 */
95static inline int srcu_read_lock_held(struct srcu_struct *sp) 95static inline int srcu_read_lock_held(const struct srcu_struct *sp)
96{ 96{
97 if (!debug_lockdep_rcu_enabled()) 97 if (!debug_lockdep_rcu_enabled())
98 return 1; 98 return 1;
@@ -101,7 +101,7 @@ static inline int srcu_read_lock_held(struct srcu_struct *sp)
101 101
102#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ 102#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
103 103
104static inline int srcu_read_lock_held(struct srcu_struct *sp) 104static inline int srcu_read_lock_held(const struct srcu_struct *sp)
105{ 105{
106 return 1; 106 return 1;
107} 107}
diff --git a/include/linux/srcutree.h b/include/linux/srcutree.h
index a949f4f9e4d7..4eda108abee0 100644
--- a/include/linux/srcutree.h
+++ b/include/linux/srcutree.h
@@ -40,7 +40,7 @@ struct srcu_data {
40 unsigned long srcu_unlock_count[2]; /* Unlocks per CPU. */ 40 unsigned long srcu_unlock_count[2]; /* Unlocks per CPU. */
41 41
42 /* Update-side state. */ 42 /* Update-side state. */
43 raw_spinlock_t __private lock ____cacheline_internodealigned_in_smp; 43 spinlock_t __private lock ____cacheline_internodealigned_in_smp;
44 struct rcu_segcblist srcu_cblist; /* List of callbacks.*/ 44 struct rcu_segcblist srcu_cblist; /* List of callbacks.*/
45 unsigned long srcu_gp_seq_needed; /* Furthest future GP needed. */ 45 unsigned long srcu_gp_seq_needed; /* Furthest future GP needed. */
46 unsigned long srcu_gp_seq_needed_exp; /* Furthest future exp GP. */ 46 unsigned long srcu_gp_seq_needed_exp; /* Furthest future exp GP. */
@@ -58,7 +58,7 @@ struct srcu_data {
58 * Node in SRCU combining tree, similar in function to rcu_data. 58 * Node in SRCU combining tree, similar in function to rcu_data.
59 */ 59 */
60struct srcu_node { 60struct srcu_node {
61 raw_spinlock_t __private lock; 61 spinlock_t __private lock;
62 unsigned long srcu_have_cbs[4]; /* GP seq for children */ 62 unsigned long srcu_have_cbs[4]; /* GP seq for children */
63 /* having CBs, but only */ 63 /* having CBs, but only */
64 /* is > ->srcu_gq_seq. */ 64 /* is > ->srcu_gq_seq. */
@@ -78,7 +78,7 @@ struct srcu_struct {
78 struct srcu_node *level[RCU_NUM_LVLS + 1]; 78 struct srcu_node *level[RCU_NUM_LVLS + 1];
79 /* First node at each level. */ 79 /* First node at each level. */
80 struct mutex srcu_cb_mutex; /* Serialize CB preparation. */ 80 struct mutex srcu_cb_mutex; /* Serialize CB preparation. */
81 raw_spinlock_t __private lock; /* Protect counters */ 81 spinlock_t __private lock; /* Protect counters */
82 struct mutex srcu_gp_mutex; /* Serialize GP work. */ 82 struct mutex srcu_gp_mutex; /* Serialize GP work. */
83 unsigned int srcu_idx; /* Current rdr array element. */ 83 unsigned int srcu_idx; /* Current rdr array element. */
84 unsigned long srcu_gp_seq; /* Grace-period seq #. */ 84 unsigned long srcu_gp_seq; /* Grace-period seq #. */
@@ -107,7 +107,7 @@ struct srcu_struct {
107#define __SRCU_STRUCT_INIT(name) \ 107#define __SRCU_STRUCT_INIT(name) \
108 { \ 108 { \
109 .sda = &name##_srcu_data, \ 109 .sda = &name##_srcu_data, \
110 .lock = __RAW_SPIN_LOCK_UNLOCKED(name.lock), \ 110 .lock = __SPIN_LOCK_UNLOCKED(name.lock), \
111 .srcu_gp_seq_needed = 0 - 1, \ 111 .srcu_gp_seq_needed = 0 - 1, \
112 __SRCU_DEP_MAP_INIT(name) \ 112 __SRCU_DEP_MAP_INIT(name) \
113 } 113 }
diff --git a/include/linux/string.h b/include/linux/string.h
index 410ecf17de3c..cfd83eb2f926 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -259,7 +259,10 @@ __FORTIFY_INLINE __kernel_size_t strlen(const char *p)
259{ 259{
260 __kernel_size_t ret; 260 __kernel_size_t ret;
261 size_t p_size = __builtin_object_size(p, 0); 261 size_t p_size = __builtin_object_size(p, 0);
262 if (p_size == (size_t)-1) 262
263 /* Work around gcc excess stack consumption issue */
264 if (p_size == (size_t)-1 ||
265 (__builtin_constant_p(p[p_size - 1]) && p[p_size - 1] == '\0'))
263 return __builtin_strlen(p); 266 return __builtin_strlen(p);
264 ret = strnlen(p, p_size); 267 ret = strnlen(p, p_size);
265 if (p_size <= ret) 268 if (p_size <= ret)
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index d60b0f5c38d5..cc22a24516d6 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -443,32 +443,8 @@ extern bool pm_save_wakeup_count(unsigned int count);
443extern void pm_wakep_autosleep_enabled(bool set); 443extern void pm_wakep_autosleep_enabled(bool set);
444extern void pm_print_active_wakeup_sources(void); 444extern void pm_print_active_wakeup_sources(void);
445 445
446static inline void lock_system_sleep(void) 446extern void lock_system_sleep(void);
447{ 447extern void unlock_system_sleep(void);
448 current->flags |= PF_FREEZER_SKIP;
449 mutex_lock(&pm_mutex);
450}
451
452static inline void unlock_system_sleep(void)
453{
454 /*
455 * Don't use freezer_count() because we don't want the call to
456 * try_to_freeze() here.
457 *
458 * Reason:
459 * Fundamentally, we just don't need it, because freezing condition
460 * doesn't come into effect until we release the pm_mutex lock,
461 * since the freezer always works with pm_mutex held.
462 *
463 * More importantly, in the case of hibernation,
464 * unlock_system_sleep() gets called in snapshot_read() and
465 * snapshot_write() when the freezing condition is still in effect.
466 * Which means, if we use try_to_freeze() here, it would make them
467 * enter the refrigerator, thus causing hibernation to lockup.
468 */
469 current->flags &= ~PF_FREEZER_SKIP;
470 mutex_unlock(&pm_mutex);
471}
472 448
473#else /* !CONFIG_PM_SLEEP */ 449#else /* !CONFIG_PM_SLEEP */
474 450
diff --git a/include/linux/swapops.h b/include/linux/swapops.h
index 9c5a2628d6ce..1d3877c39a00 100644
--- a/include/linux/swapops.h
+++ b/include/linux/swapops.h
@@ -124,6 +124,11 @@ static inline bool is_write_device_private_entry(swp_entry_t entry)
124 return unlikely(swp_type(entry) == SWP_DEVICE_WRITE); 124 return unlikely(swp_type(entry) == SWP_DEVICE_WRITE);
125} 125}
126 126
127static inline unsigned long device_private_entry_to_pfn(swp_entry_t entry)
128{
129 return swp_offset(entry);
130}
131
127static inline struct page *device_private_entry_to_page(swp_entry_t entry) 132static inline struct page *device_private_entry_to_page(swp_entry_t entry)
128{ 133{
129 return pfn_to_page(swp_offset(entry)); 134 return pfn_to_page(swp_offset(entry));
@@ -154,6 +159,11 @@ static inline bool is_write_device_private_entry(swp_entry_t entry)
154 return false; 159 return false;
155} 160}
156 161
162static inline unsigned long device_private_entry_to_pfn(swp_entry_t entry)
163{
164 return 0;
165}
166
157static inline struct page *device_private_entry_to_page(swp_entry_t entry) 167static inline struct page *device_private_entry_to_page(swp_entry_t entry)
158{ 168{
159 return NULL; 169 return NULL;
@@ -189,6 +199,11 @@ static inline int is_write_migration_entry(swp_entry_t entry)
189 return unlikely(swp_type(entry) == SWP_MIGRATION_WRITE); 199 return unlikely(swp_type(entry) == SWP_MIGRATION_WRITE);
190} 200}
191 201
202static inline unsigned long migration_entry_to_pfn(swp_entry_t entry)
203{
204 return swp_offset(entry);
205}
206
192static inline struct page *migration_entry_to_page(swp_entry_t entry) 207static inline struct page *migration_entry_to_page(swp_entry_t entry)
193{ 208{
194 struct page *p = pfn_to_page(swp_offset(entry)); 209 struct page *p = pfn_to_page(swp_offset(entry));
@@ -218,6 +233,12 @@ static inline int is_migration_entry(swp_entry_t swp)
218{ 233{
219 return 0; 234 return 0;
220} 235}
236
237static inline unsigned long migration_entry_to_pfn(swp_entry_t entry)
238{
239 return 0;
240}
241
221static inline struct page *migration_entry_to_page(swp_entry_t entry) 242static inline struct page *migration_entry_to_page(swp_entry_t entry)
222{ 243{
223 return NULL; 244 return NULL;
diff --git a/include/linux/tick.h b/include/linux/tick.h
index f442d1a42025..7cc35921218e 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -119,6 +119,7 @@ extern void tick_nohz_idle_exit(void);
119extern void tick_nohz_irq_exit(void); 119extern void tick_nohz_irq_exit(void);
120extern ktime_t tick_nohz_get_sleep_length(void); 120extern ktime_t tick_nohz_get_sleep_length(void);
121extern unsigned long tick_nohz_get_idle_calls(void); 121extern unsigned long tick_nohz_get_idle_calls(void);
122extern unsigned long tick_nohz_get_idle_calls_cpu(int cpu);
122extern u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time); 123extern u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time);
123extern u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time); 124extern u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time);
124#else /* !CONFIG_NO_HZ_COMMON */ 125#else /* !CONFIG_NO_HZ_COMMON */
diff --git a/include/linux/timer.h b/include/linux/timer.h
index 04af640ea95b..2448f9cc48a3 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -207,9 +207,11 @@ unsigned long round_jiffies_up(unsigned long j);
207unsigned long round_jiffies_up_relative(unsigned long j); 207unsigned long round_jiffies_up_relative(unsigned long j);
208 208
209#ifdef CONFIG_HOTPLUG_CPU 209#ifdef CONFIG_HOTPLUG_CPU
210int timers_prepare_cpu(unsigned int cpu);
210int timers_dead_cpu(unsigned int cpu); 211int timers_dead_cpu(unsigned int cpu);
211#else 212#else
212#define timers_dead_cpu NULL 213#define timers_prepare_cpu NULL
214#define timers_dead_cpu NULL
213#endif 215#endif
214 216
215#endif 217#endif
diff --git a/include/linux/torture.h b/include/linux/torture.h
index a45702eb3e7b..66272862070b 100644
--- a/include/linux/torture.h
+++ b/include/linux/torture.h
@@ -79,7 +79,7 @@ void stutter_wait(const char *title);
79int torture_stutter_init(int s); 79int torture_stutter_init(int s);
80 80
81/* Initialization and cleanup. */ 81/* Initialization and cleanup. */
82bool torture_init_begin(char *ttype, bool v, int *runnable); 82bool torture_init_begin(char *ttype, bool v);
83void torture_init_end(void); 83void torture_init_end(void);
84bool torture_cleanup_begin(void); 84bool torture_cleanup_begin(void);
85void torture_cleanup_end(void); 85void torture_cleanup_end(void);
@@ -96,4 +96,10 @@ void _torture_stop_kthread(char *m, struct task_struct **tp);
96#define torture_stop_kthread(n, tp) \ 96#define torture_stop_kthread(n, tp) \
97 _torture_stop_kthread("Stopping " #n " task", &(tp)) 97 _torture_stop_kthread("Stopping " #n " task", &(tp))
98 98
99#ifdef CONFIG_PREEMPT
100#define torture_preempt_schedule() preempt_schedule()
101#else
102#define torture_preempt_schedule()
103#endif
104
99#endif /* __LINUX_TORTURE_H */ 105#endif /* __LINUX_TORTURE_H */
diff --git a/include/linux/trace.h b/include/linux/trace.h
index d24991c1fef3..b95ffb2188ab 100644
--- a/include/linux/trace.h
+++ b/include/linux/trace.h
@@ -18,7 +18,7 @@
18 */ 18 */
19struct trace_export { 19struct trace_export {
20 struct trace_export __rcu *next; 20 struct trace_export __rcu *next;
21 void (*write)(const void *, unsigned int); 21 void (*write)(struct trace_export *, const void *, unsigned int);
22}; 22};
23 23
24int register_ftrace_export(struct trace_export *export); 24int register_ftrace_export(struct trace_export *export);
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index a26ffbe09e71..c94f466d57ef 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -137,11 +137,8 @@ extern void syscall_unregfunc(void);
137 \ 137 \
138 if (!(cond)) \ 138 if (!(cond)) \
139 return; \ 139 return; \
140 if (rcucheck) { \ 140 if (rcucheck) \
141 if (WARN_ON_ONCE(rcu_irq_enter_disabled())) \
142 return; \
143 rcu_irq_enter_irqson(); \ 141 rcu_irq_enter_irqson(); \
144 } \
145 rcu_read_lock_sched_notrace(); \ 142 rcu_read_lock_sched_notrace(); \
146 it_func_ptr = rcu_dereference_sched((tp)->funcs); \ 143 it_func_ptr = rcu_dereference_sched((tp)->funcs); \
147 if (it_func_ptr) { \ 144 if (it_func_ptr) { \
diff --git a/include/net/arp.h b/include/net/arp.h
index dc8cd47f883b..977aabfcdc03 100644
--- a/include/net/arp.h
+++ b/include/net/arp.h
@@ -20,6 +20,9 @@ static inline u32 arp_hashfn(const void *pkey, const struct net_device *dev, u32
20 20
21static inline struct neighbour *__ipv4_neigh_lookup_noref(struct net_device *dev, u32 key) 21static inline struct neighbour *__ipv4_neigh_lookup_noref(struct net_device *dev, u32 key)
22{ 22{
23 if (dev->flags & (IFF_LOOPBACK | IFF_POINTOPOINT))
24 key = INADDR_ANY;
25
23 return ___neigh_lookup_noref(&arp_tbl, neigh_key_eq32, arp_hashfn, &key, dev); 26 return ___neigh_lookup_noref(&arp_tbl, neigh_key_eq32, arp_hashfn, &key, dev);
24} 27}
25 28
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 8b8118a7fadb..fb94a8bd8ab5 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -815,6 +815,8 @@ struct cfg80211_csa_settings {
815 u8 count; 815 u8 count;
816}; 816};
817 817
818#define CFG80211_MAX_NUM_DIFFERENT_CHANNELS 10
819
818/** 820/**
819 * struct iface_combination_params - input parameters for interface combinations 821 * struct iface_combination_params - input parameters for interface combinations
820 * 822 *
@@ -3226,7 +3228,6 @@ struct cfg80211_ops {
3226 * @WIPHY_FLAG_IBSS_RSN: The device supports IBSS RSN. 3228 * @WIPHY_FLAG_IBSS_RSN: The device supports IBSS RSN.
3227 * @WIPHY_FLAG_MESH_AUTH: The device supports mesh authentication by routing 3229 * @WIPHY_FLAG_MESH_AUTH: The device supports mesh authentication by routing
3228 * auth frames to userspace. See @NL80211_MESH_SETUP_USERSPACE_AUTH. 3230 * auth frames to userspace. See @NL80211_MESH_SETUP_USERSPACE_AUTH.
3229 * @WIPHY_FLAG_SUPPORTS_SCHED_SCAN: The device supports scheduled scans.
3230 * @WIPHY_FLAG_SUPPORTS_FW_ROAM: The device supports roaming feature in the 3231 * @WIPHY_FLAG_SUPPORTS_FW_ROAM: The device supports roaming feature in the
3231 * firmware. 3232 * firmware.
3232 * @WIPHY_FLAG_AP_UAPSD: The device supports uapsd on AP. 3233 * @WIPHY_FLAG_AP_UAPSD: The device supports uapsd on AP.
diff --git a/include/net/dst.h b/include/net/dst.h
index b091fd536098..d49d607dd2b3 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -521,4 +521,12 @@ static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst)
521} 521}
522#endif 522#endif
523 523
524static inline void skb_dst_update_pmtu(struct sk_buff *skb, u32 mtu)
525{
526 struct dst_entry *dst = skb_dst(skb);
527
528 if (dst && dst->ops->update_pmtu)
529 dst->ops->update_pmtu(dst, NULL, skb, mtu);
530}
531
524#endif /* _NET_DST_H */ 532#endif /* _NET_DST_H */
diff --git a/include/net/gue.h b/include/net/gue.h
index 2fdb29ca74c2..fdad41469b65 100644
--- a/include/net/gue.h
+++ b/include/net/gue.h
@@ -44,10 +44,10 @@ struct guehdr {
44#else 44#else
45#error "Please fix <asm/byteorder.h>" 45#error "Please fix <asm/byteorder.h>"
46#endif 46#endif
47 __u8 proto_ctype; 47 __u8 proto_ctype;
48 __u16 flags; 48 __be16 flags;
49 }; 49 };
50 __u32 word; 50 __be32 word;
51 }; 51 };
52}; 52};
53 53
@@ -84,11 +84,10 @@ static inline size_t guehdr_priv_flags_len(__be32 flags)
84 * if there is an unknown standard or private flags, or the options length for 84 * if there is an unknown standard or private flags, or the options length for
85 * the flags exceeds the options length specific in hlen of the GUE header. 85 * the flags exceeds the options length specific in hlen of the GUE header.
86 */ 86 */
87static inline int validate_gue_flags(struct guehdr *guehdr, 87static inline int validate_gue_flags(struct guehdr *guehdr, size_t optlen)
88 size_t optlen)
89{ 88{
89 __be16 flags = guehdr->flags;
90 size_t len; 90 size_t len;
91 __be32 flags = guehdr->flags;
92 91
93 if (flags & ~GUE_FLAGS_ALL) 92 if (flags & ~GUE_FLAGS_ALL)
94 return 1; 93 return 1;
@@ -101,12 +100,13 @@ static inline int validate_gue_flags(struct guehdr *guehdr,
101 /* Private flags are last four bytes accounted in 100 /* Private flags are last four bytes accounted in
102 * guehdr_flags_len 101 * guehdr_flags_len
103 */ 102 */
104 flags = *(__be32 *)((void *)&guehdr[1] + len - GUE_LEN_PRIV); 103 __be32 pflags = *(__be32 *)((void *)&guehdr[1] +
104 len - GUE_LEN_PRIV);
105 105
106 if (flags & ~GUE_PFLAGS_ALL) 106 if (pflags & ~GUE_PFLAGS_ALL)
107 return 1; 107 return 1;
108 108
109 len += guehdr_priv_flags_len(flags); 109 len += guehdr_priv_flags_len(pflags);
110 if (len > optlen) 110 if (len > optlen)
111 return 1; 111 return 1;
112 } 112 }
diff --git a/include/net/ip.h b/include/net/ip.h
index 9896f46cbbf1..af8addbaa3c1 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -34,6 +34,7 @@
34#include <net/flow_dissector.h> 34#include <net/flow_dissector.h>
35 35
36#define IPV4_MAX_PMTU 65535U /* RFC 2675, Section 5.1 */ 36#define IPV4_MAX_PMTU 65535U /* RFC 2675, Section 5.1 */
37#define IPV4_MIN_MTU 68 /* RFC 791 */
37 38
38struct sock; 39struct sock;
39 40
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index f73797e2fa60..221238254eb7 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -331,6 +331,7 @@ int ipv6_flowlabel_opt_get(struct sock *sk, struct in6_flowlabel_req *freq,
331 int flags); 331 int flags);
332int ip6_flowlabel_init(void); 332int ip6_flowlabel_init(void);
333void ip6_flowlabel_cleanup(void); 333void ip6_flowlabel_cleanup(void);
334bool ip6_autoflowlabel(struct net *net, const struct ipv6_pinfo *np);
334 335
335static inline void fl6_sock_release(struct ip6_flowlabel *fl) 336static inline void fl6_sock_release(struct ip6_flowlabel *fl)
336{ 337{
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 10f99dafd5ac..049008493faf 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -223,6 +223,11 @@ int net_eq(const struct net *net1, const struct net *net2)
223 return net1 == net2; 223 return net1 == net2;
224} 224}
225 225
226static inline int check_net(const struct net *net)
227{
228 return atomic_read(&net->count) != 0;
229}
230
226void net_drop_ns(void *); 231void net_drop_ns(void *);
227 232
228#else 233#else
@@ -247,6 +252,11 @@ int net_eq(const struct net *net1, const struct net *net2)
247 return 1; 252 return 1;
248} 253}
249 254
255static inline int check_net(const struct net *net)
256{
257 return 1;
258}
259
250#define net_drop_ns NULL 260#define net_drop_ns NULL
251#endif 261#endif
252 262
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 0105445cab83..753ac9361154 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -522,7 +522,7 @@ static inline unsigned char * tcf_get_base_ptr(struct sk_buff *skb, int layer)
522{ 522{
523 switch (layer) { 523 switch (layer) {
524 case TCF_LAYER_LINK: 524 case TCF_LAYER_LINK:
525 return skb->data; 525 return skb_mac_header(skb);
526 case TCF_LAYER_NETWORK: 526 case TCF_LAYER_NETWORK:
527 return skb_network_header(skb); 527 return skb_network_header(skb);
528 case TCF_LAYER_TRANSPORT: 528 case TCF_LAYER_TRANSPORT:
@@ -694,9 +694,7 @@ struct tc_cls_matchall_offload {
694}; 694};
695 695
696enum tc_clsbpf_command { 696enum tc_clsbpf_command {
697 TC_CLSBPF_ADD, 697 TC_CLSBPF_OFFLOAD,
698 TC_CLSBPF_REPLACE,
699 TC_CLSBPF_DESTROY,
700 TC_CLSBPF_STATS, 698 TC_CLSBPF_STATS,
701}; 699};
702 700
@@ -705,6 +703,7 @@ struct tc_cls_bpf_offload {
705 enum tc_clsbpf_command command; 703 enum tc_clsbpf_command command;
706 struct tcf_exts *exts; 704 struct tcf_exts *exts;
707 struct bpf_prog *prog; 705 struct bpf_prog *prog;
706 struct bpf_prog *oldprog;
708 const char *name; 707 const char *name;
709 bool exts_integrated; 708 bool exts_integrated;
710 u32 gen_flags; 709 u32 gen_flags;
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 65d0d25f2648..becf86aa4ac6 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -71,6 +71,7 @@ struct Qdisc {
71 * qdisc_tree_decrease_qlen() should stop. 71 * qdisc_tree_decrease_qlen() should stop.
72 */ 72 */
73#define TCQ_F_INVISIBLE 0x80 /* invisible by default in dump */ 73#define TCQ_F_INVISIBLE 0x80 /* invisible by default in dump */
74#define TCQ_F_OFFLOADED 0x200 /* qdisc is offloaded to HW */
74 u32 limit; 75 u32 limit;
75 const struct Qdisc_ops *ops; 76 const struct Qdisc_ops *ops;
76 struct qdisc_size_table __rcu *stab; 77 struct qdisc_size_table __rcu *stab;
@@ -178,6 +179,7 @@ struct Qdisc_ops {
178 const struct Qdisc_class_ops *cl_ops; 179 const struct Qdisc_class_ops *cl_ops;
179 char id[IFNAMSIZ]; 180 char id[IFNAMSIZ];
180 int priv_size; 181 int priv_size;
182 unsigned int static_flags;
181 183
182 int (*enqueue)(struct sk_buff *skb, 184 int (*enqueue)(struct sk_buff *skb,
183 struct Qdisc *sch, 185 struct Qdisc *sch,
@@ -443,6 +445,7 @@ void qdisc_tree_reduce_backlog(struct Qdisc *qdisc, unsigned int n,
443 unsigned int len); 445 unsigned int len);
444struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue, 446struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
445 const struct Qdisc_ops *ops); 447 const struct Qdisc_ops *ops);
448void qdisc_free(struct Qdisc *qdisc);
446struct Qdisc *qdisc_create_dflt(struct netdev_queue *dev_queue, 449struct Qdisc *qdisc_create_dflt(struct netdev_queue *dev_queue,
447 const struct Qdisc_ops *ops, u32 parentid); 450 const struct Qdisc_ops *ops, u32 parentid);
448void __qdisc_calculate_pkt_len(struct sk_buff *skb, 451void __qdisc_calculate_pkt_len(struct sk_buff *skb,
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 2f8f93da5dc2..9a5ccf03a59b 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -966,7 +966,7 @@ void sctp_transport_burst_limited(struct sctp_transport *);
966void sctp_transport_burst_reset(struct sctp_transport *); 966void sctp_transport_burst_reset(struct sctp_transport *);
967unsigned long sctp_transport_timeout(struct sctp_transport *); 967unsigned long sctp_transport_timeout(struct sctp_transport *);
968void sctp_transport_reset(struct sctp_transport *t); 968void sctp_transport_reset(struct sctp_transport *t);
969void sctp_transport_update_pmtu(struct sctp_transport *t, u32 pmtu); 969bool sctp_transport_update_pmtu(struct sctp_transport *t, u32 pmtu);
970void sctp_transport_immediate_rtx(struct sctp_transport *); 970void sctp_transport_immediate_rtx(struct sctp_transport *);
971void sctp_transport_dst_release(struct sctp_transport *t); 971void sctp_transport_dst_release(struct sctp_transport *t);
972void sctp_transport_dst_confirm(struct sctp_transport *t); 972void sctp_transport_dst_confirm(struct sctp_transport *t);
diff --git a/include/net/sock.h b/include/net/sock.h
index 9155da422692..c4a424fe6fdd 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1445,10 +1445,8 @@ do { \
1445} while (0) 1445} while (0)
1446 1446
1447#ifdef CONFIG_LOCKDEP 1447#ifdef CONFIG_LOCKDEP
1448static inline bool lockdep_sock_is_held(const struct sock *csk) 1448static inline bool lockdep_sock_is_held(const struct sock *sk)
1449{ 1449{
1450 struct sock *sk = (struct sock *)csk;
1451
1452 return lockdep_is_held(&sk->sk_lock) || 1450 return lockdep_is_held(&sk->sk_lock) ||
1453 lockdep_is_held(&sk->sk_lock.slock); 1451 lockdep_is_held(&sk->sk_lock.slock);
1454} 1452}
@@ -1514,6 +1512,11 @@ static inline bool sock_owned_by_user(const struct sock *sk)
1514 return sk->sk_lock.owned; 1512 return sk->sk_lock.owned;
1515} 1513}
1516 1514
1515static inline bool sock_owned_by_user_nocheck(const struct sock *sk)
1516{
1517 return sk->sk_lock.owned;
1518}
1519
1517/* no reclassification while locks are held */ 1520/* no reclassification while locks are held */
1518static inline bool sock_allow_reclassification(const struct sock *csk) 1521static inline bool sock_allow_reclassification(const struct sock *csk)
1519{ 1522{
diff --git a/include/net/tls.h b/include/net/tls.h
index 936cfc5cab7d..9185e53a743c 100644
--- a/include/net/tls.h
+++ b/include/net/tls.h
@@ -170,7 +170,7 @@ static inline bool tls_is_pending_open_record(struct tls_context *tls_ctx)
170 170
171static inline void tls_err_abort(struct sock *sk) 171static inline void tls_err_abort(struct sock *sk)
172{ 172{
173 sk->sk_err = -EBADMSG; 173 sk->sk_err = EBADMSG;
174 sk->sk_error_report(sk); 174 sk->sk_error_report(sk);
175} 175}
176 176
diff --git a/include/net/vxlan.h b/include/net/vxlan.h
index 13223396dc64..f96391e84a8a 100644
--- a/include/net/vxlan.h
+++ b/include/net/vxlan.h
@@ -146,7 +146,7 @@ struct vxlanhdr_gpe {
146 np_applied:1, 146 np_applied:1,
147 instance_applied:1, 147 instance_applied:1,
148 version:2, 148 version:2,
149reserved_flags2:2; 149 reserved_flags2:2;
150#elif defined(__BIG_ENDIAN_BITFIELD) 150#elif defined(__BIG_ENDIAN_BITFIELD)
151 u8 reserved_flags2:2, 151 u8 reserved_flags2:2,
152 version:2, 152 version:2,
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index dc28a98ce97c..ae35991b5877 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1570,6 +1570,9 @@ int xfrm_init_state(struct xfrm_state *x);
1570int xfrm_prepare_input(struct xfrm_state *x, struct sk_buff *skb); 1570int xfrm_prepare_input(struct xfrm_state *x, struct sk_buff *skb);
1571int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type); 1571int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type);
1572int xfrm_input_resume(struct sk_buff *skb, int nexthdr); 1572int xfrm_input_resume(struct sk_buff *skb, int nexthdr);
1573int xfrm_trans_queue(struct sk_buff *skb,
1574 int (*finish)(struct net *, struct sock *,
1575 struct sk_buff *));
1573int xfrm_output_resume(struct sk_buff *skb, int err); 1576int xfrm_output_resume(struct sk_buff *skb, int err);
1574int xfrm_output(struct sock *sk, struct sk_buff *skb); 1577int xfrm_output(struct sock *sk, struct sk_buff *skb);
1575int xfrm_inner_extract_output(struct xfrm_state *x, struct sk_buff *skb); 1578int xfrm_inner_extract_output(struct xfrm_state *x, struct sk_buff *skb);
diff --git a/include/sound/hdaudio_ext.h b/include/sound/hdaudio_ext.h
index ca00130cb028..9c14e21dda85 100644
--- a/include/sound/hdaudio_ext.h
+++ b/include/sound/hdaudio_ext.h
@@ -193,7 +193,7 @@ struct hda_dai_map {
193 * @pvt_data - private data, for asoc contains asoc codec object 193 * @pvt_data - private data, for asoc contains asoc codec object
194 */ 194 */
195struct hdac_ext_device { 195struct hdac_ext_device {
196 struct hdac_device hdac; 196 struct hdac_device hdev;
197 struct hdac_ext_bus *ebus; 197 struct hdac_ext_bus *ebus;
198 198
199 /* soc-dai to nid map */ 199 /* soc-dai to nid map */
@@ -213,7 +213,7 @@ struct hdac_ext_dma_params {
213 u8 stream_tag; 213 u8 stream_tag;
214}; 214};
215#define to_ehdac_device(dev) (container_of((dev), \ 215#define to_ehdac_device(dev) (container_of((dev), \
216 struct hdac_ext_device, hdac)) 216 struct hdac_ext_device, hdev))
217/* 217/*
218 * HD-audio codec base driver 218 * HD-audio codec base driver
219 */ 219 */
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 24febf9e177c..e054c583d3b3 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -169,6 +169,10 @@ struct snd_pcm_ops {
169#define SNDRV_PCM_FMTBIT_IMA_ADPCM _SNDRV_PCM_FMTBIT(IMA_ADPCM) 169#define SNDRV_PCM_FMTBIT_IMA_ADPCM _SNDRV_PCM_FMTBIT(IMA_ADPCM)
170#define SNDRV_PCM_FMTBIT_MPEG _SNDRV_PCM_FMTBIT(MPEG) 170#define SNDRV_PCM_FMTBIT_MPEG _SNDRV_PCM_FMTBIT(MPEG)
171#define SNDRV_PCM_FMTBIT_GSM _SNDRV_PCM_FMTBIT(GSM) 171#define SNDRV_PCM_FMTBIT_GSM _SNDRV_PCM_FMTBIT(GSM)
172#define SNDRV_PCM_FMTBIT_S20_LE _SNDRV_PCM_FMTBIT(S20_LE)
173#define SNDRV_PCM_FMTBIT_U20_LE _SNDRV_PCM_FMTBIT(U20_LE)
174#define SNDRV_PCM_FMTBIT_S20_BE _SNDRV_PCM_FMTBIT(S20_BE)
175#define SNDRV_PCM_FMTBIT_U20_BE _SNDRV_PCM_FMTBIT(U20_BE)
172#define SNDRV_PCM_FMTBIT_SPECIAL _SNDRV_PCM_FMTBIT(SPECIAL) 176#define SNDRV_PCM_FMTBIT_SPECIAL _SNDRV_PCM_FMTBIT(SPECIAL)
173#define SNDRV_PCM_FMTBIT_S24_3LE _SNDRV_PCM_FMTBIT(S24_3LE) 177#define SNDRV_PCM_FMTBIT_S24_3LE _SNDRV_PCM_FMTBIT(S24_3LE)
174#define SNDRV_PCM_FMTBIT_U24_3LE _SNDRV_PCM_FMTBIT(U24_3LE) 178#define SNDRV_PCM_FMTBIT_U24_3LE _SNDRV_PCM_FMTBIT(U24_3LE)
@@ -202,6 +206,8 @@ struct snd_pcm_ops {
202#define SNDRV_PCM_FMTBIT_FLOAT SNDRV_PCM_FMTBIT_FLOAT_LE 206#define SNDRV_PCM_FMTBIT_FLOAT SNDRV_PCM_FMTBIT_FLOAT_LE
203#define SNDRV_PCM_FMTBIT_FLOAT64 SNDRV_PCM_FMTBIT_FLOAT64_LE 207#define SNDRV_PCM_FMTBIT_FLOAT64 SNDRV_PCM_FMTBIT_FLOAT64_LE
204#define SNDRV_PCM_FMTBIT_IEC958_SUBFRAME SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE 208#define SNDRV_PCM_FMTBIT_IEC958_SUBFRAME SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE
209#define SNDRV_PCM_FMTBIT_S20 SNDRV_PCM_FMTBIT_S20_LE
210#define SNDRV_PCM_FMTBIT_U20 SNDRV_PCM_FMTBIT_U20_LE
205#endif 211#endif
206#ifdef SNDRV_BIG_ENDIAN 212#ifdef SNDRV_BIG_ENDIAN
207#define SNDRV_PCM_FMTBIT_S16 SNDRV_PCM_FMTBIT_S16_BE 213#define SNDRV_PCM_FMTBIT_S16 SNDRV_PCM_FMTBIT_S16_BE
@@ -213,6 +219,8 @@ struct snd_pcm_ops {
213#define SNDRV_PCM_FMTBIT_FLOAT SNDRV_PCM_FMTBIT_FLOAT_BE 219#define SNDRV_PCM_FMTBIT_FLOAT SNDRV_PCM_FMTBIT_FLOAT_BE
214#define SNDRV_PCM_FMTBIT_FLOAT64 SNDRV_PCM_FMTBIT_FLOAT64_BE 220#define SNDRV_PCM_FMTBIT_FLOAT64 SNDRV_PCM_FMTBIT_FLOAT64_BE
215#define SNDRV_PCM_FMTBIT_IEC958_SUBFRAME SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_BE 221#define SNDRV_PCM_FMTBIT_IEC958_SUBFRAME SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_BE
222#define SNDRV_PCM_FMTBIT_S20 SNDRV_PCM_FMTBIT_S20_BE
223#define SNDRV_PCM_FMTBIT_U20 SNDRV_PCM_FMTBIT_U20_BE
216#endif 224#endif
217 225
218struct snd_pcm_file { 226struct snd_pcm_file {
diff --git a/include/sound/rt5514.h b/include/sound/rt5514.h
index ef18494769ee..64d027dbaaca 100644
--- a/include/sound/rt5514.h
+++ b/include/sound/rt5514.h
@@ -14,6 +14,8 @@
14 14
15struct rt5514_platform_data { 15struct rt5514_platform_data {
16 unsigned int dmic_init_delay; 16 unsigned int dmic_init_delay;
17 const char *dsp_calib_clk_name;
18 unsigned int dsp_calib_clk_rate;
17}; 19};
18 20
19#endif 21#endif
diff --git a/include/sound/rt5645.h b/include/sound/rt5645.h
index d0c33a9972b9..f218c742f08e 100644
--- a/include/sound/rt5645.h
+++ b/include/sound/rt5645.h
@@ -25,6 +25,9 @@ struct rt5645_platform_data {
25 bool level_trigger_irq; 25 bool level_trigger_irq;
26 /* Invert JD1_1 status polarity */ 26 /* Invert JD1_1 status polarity */
27 bool inv_jd1_1; 27 bool inv_jd1_1;
28
29 /* Value to asign to snd_soc_card.long_name */
30 const char *long_name;
28}; 31};
29 32
30#endif 33#endif
diff --git a/include/sound/soc-acpi-intel-match.h b/include/sound/soc-acpi-intel-match.h
index 1a9191cd4bb3..9da6388c20a1 100644
--- a/include/sound/soc-acpi-intel-match.h
+++ b/include/sound/soc-acpi-intel-match.h
@@ -16,6 +16,7 @@
16#ifndef __LINUX_SND_SOC_ACPI_INTEL_MATCH_H 16#ifndef __LINUX_SND_SOC_ACPI_INTEL_MATCH_H
17#define __LINUX_SND_SOC_ACPI_INTEL_MATCH_H 17#define __LINUX_SND_SOC_ACPI_INTEL_MATCH_H
18 18
19#include <linux/module.h>
19#include <linux/stddef.h> 20#include <linux/stddef.h>
20#include <linux/acpi.h> 21#include <linux/acpi.h>
21 22
diff --git a/include/sound/soc-acpi.h b/include/sound/soc-acpi.h
index a7d8d335b043..082224275f52 100644
--- a/include/sound/soc-acpi.h
+++ b/include/sound/soc-acpi.h
@@ -17,6 +17,7 @@
17 17
18#include <linux/stddef.h> 18#include <linux/stddef.h>
19#include <linux/acpi.h> 19#include <linux/acpi.h>
20#include <linux/mod_devicetable.h>
20 21
21struct snd_soc_acpi_package_context { 22struct snd_soc_acpi_package_context {
22 char *name; /* package name */ 23 char *name; /* package name */
@@ -26,17 +27,13 @@ struct snd_soc_acpi_package_context {
26 bool data_valid; 27 bool data_valid;
27}; 28};
28 29
30/* codec name is used in DAIs is i2c-<HID>:00 with HID being 8 chars */
31#define SND_ACPI_I2C_ID_LEN (4 + ACPI_ID_LEN + 3 + 1)
32
29#if IS_ENABLED(CONFIG_ACPI) 33#if IS_ENABLED(CONFIG_ACPI)
30/* translation fron HID to I2C name, needed for DAI codec_name */
31const char *snd_soc_acpi_find_name_from_hid(const u8 hid[ACPI_ID_LEN]);
32bool snd_soc_acpi_find_package_from_hid(const u8 hid[ACPI_ID_LEN], 34bool snd_soc_acpi_find_package_from_hid(const u8 hid[ACPI_ID_LEN],
33 struct snd_soc_acpi_package_context *ctx); 35 struct snd_soc_acpi_package_context *ctx);
34#else 36#else
35static inline const char *
36snd_soc_acpi_find_name_from_hid(const u8 hid[ACPI_ID_LEN])
37{
38 return NULL;
39}
40static inline bool 37static inline bool
41snd_soc_acpi_find_package_from_hid(const u8 hid[ACPI_ID_LEN], 38snd_soc_acpi_find_package_from_hid(const u8 hid[ACPI_ID_LEN],
42 struct snd_soc_acpi_package_context *ctx) 39 struct snd_soc_acpi_package_context *ctx)
@@ -49,9 +46,6 @@ snd_soc_acpi_find_package_from_hid(const u8 hid[ACPI_ID_LEN],
49struct snd_soc_acpi_mach * 46struct snd_soc_acpi_mach *
50snd_soc_acpi_find_machine(struct snd_soc_acpi_mach *machines); 47snd_soc_acpi_find_machine(struct snd_soc_acpi_mach *machines);
51 48
52/* acpi check hid */
53bool snd_soc_acpi_check_hid(const u8 hid[ACPI_ID_LEN]);
54
55/** 49/**
56 * snd_soc_acpi_mach: ACPI-based machine descriptor. Most of the fields are 50 * snd_soc_acpi_mach: ACPI-based machine descriptor. Most of the fields are
57 * related to the hardware, except for the firmware and topology file names. 51 * related to the hardware, except for the firmware and topology file names.
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 58acd00cae19..8ad11669e4d8 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -102,6 +102,8 @@ struct snd_compr_stream;
102 SNDRV_PCM_FMTBIT_S16_BE |\ 102 SNDRV_PCM_FMTBIT_S16_BE |\
103 SNDRV_PCM_FMTBIT_S20_3LE |\ 103 SNDRV_PCM_FMTBIT_S20_3LE |\
104 SNDRV_PCM_FMTBIT_S20_3BE |\ 104 SNDRV_PCM_FMTBIT_S20_3BE |\
105 SNDRV_PCM_FMTBIT_S20_LE |\
106 SNDRV_PCM_FMTBIT_S20_BE |\
105 SNDRV_PCM_FMTBIT_S24_3LE |\ 107 SNDRV_PCM_FMTBIT_S24_3LE |\
106 SNDRV_PCM_FMTBIT_S24_3BE |\ 108 SNDRV_PCM_FMTBIT_S24_3BE |\
107 SNDRV_PCM_FMTBIT_S32_LE |\ 109 SNDRV_PCM_FMTBIT_S32_LE |\
@@ -294,9 +296,6 @@ struct snd_soc_dai {
294 /* DAI runtime info */ 296 /* DAI runtime info */
295 unsigned int capture_active:1; /* stream is in use */ 297 unsigned int capture_active:1; /* stream is in use */
296 unsigned int playback_active:1; /* stream is in use */ 298 unsigned int playback_active:1; /* stream is in use */
297 unsigned int symmetric_rates:1;
298 unsigned int symmetric_channels:1;
299 unsigned int symmetric_samplebits:1;
300 unsigned int probed:1; 299 unsigned int probed:1;
301 300
302 unsigned int active; 301 unsigned int active;
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 1a7323238c49..b655d987fbe7 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -494,6 +494,8 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num);
494int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num); 494int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num);
495#endif 495#endif
496 496
497void snd_soc_disconnect_sync(struct device *dev);
498
497struct snd_pcm_substream *snd_soc_get_dai_substream(struct snd_soc_card *card, 499struct snd_pcm_substream *snd_soc_get_dai_substream(struct snd_soc_card *card,
498 const char *dai_link, int stream); 500 const char *dai_link, int stream);
499struct snd_soc_pcm_runtime *snd_soc_get_pcm_runtime(struct snd_soc_card *card, 501struct snd_soc_pcm_runtime *snd_soc_get_pcm_runtime(struct snd_soc_card *card,
@@ -802,6 +804,9 @@ struct snd_soc_component_driver {
802 int (*suspend)(struct snd_soc_component *); 804 int (*suspend)(struct snd_soc_component *);
803 int (*resume)(struct snd_soc_component *); 805 int (*resume)(struct snd_soc_component *);
804 806
807 unsigned int (*read)(struct snd_soc_component *, unsigned int);
808 int (*write)(struct snd_soc_component *, unsigned int, unsigned int);
809
805 /* pcm creation and destruction */ 810 /* pcm creation and destruction */
806 int (*pcm_new)(struct snd_soc_pcm_runtime *); 811 int (*pcm_new)(struct snd_soc_pcm_runtime *);
807 void (*pcm_free)(struct snd_pcm *); 812 void (*pcm_free)(struct snd_pcm *);
@@ -858,12 +863,10 @@ struct snd_soc_component {
858 struct list_head card_aux_list; /* for auxiliary bound components */ 863 struct list_head card_aux_list; /* for auxiliary bound components */
859 struct list_head card_list; 864 struct list_head card_list;
860 865
861 struct snd_soc_dai_driver *dai_drv;
862 int num_dai;
863
864 const struct snd_soc_component_driver *driver; 866 const struct snd_soc_component_driver *driver;
865 867
866 struct list_head dai_list; 868 struct list_head dai_list;
869 int num_dai;
867 870
868 int (*read)(struct snd_soc_component *, unsigned int, unsigned int *); 871 int (*read)(struct snd_soc_component *, unsigned int, unsigned int *);
869 int (*write)(struct snd_soc_component *, unsigned int, unsigned int); 872 int (*write)(struct snd_soc_component *, unsigned int, unsigned int);
diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h
index 4342a329821f..c3ac5ec86519 100644
--- a/include/trace/events/btrfs.h
+++ b/include/trace/events/btrfs.h
@@ -193,7 +193,6 @@ DEFINE_EVENT(btrfs__inode, btrfs_inode_evict,
193 __print_flags(flag, "|", \ 193 __print_flags(flag, "|", \
194 { (1 << EXTENT_FLAG_PINNED), "PINNED" },\ 194 { (1 << EXTENT_FLAG_PINNED), "PINNED" },\
195 { (1 << EXTENT_FLAG_COMPRESSED), "COMPRESSED" },\ 195 { (1 << EXTENT_FLAG_COMPRESSED), "COMPRESSED" },\
196 { (1 << EXTENT_FLAG_VACANCY), "VACANCY" },\
197 { (1 << EXTENT_FLAG_PREALLOC), "PREALLOC" },\ 196 { (1 << EXTENT_FLAG_PREALLOC), "PREALLOC" },\
198 { (1 << EXTENT_FLAG_LOGGING), "LOGGING" },\ 197 { (1 << EXTENT_FLAG_LOGGING), "LOGGING" },\
199 { (1 << EXTENT_FLAG_FILLING), "FILLING" },\ 198 { (1 << EXTENT_FLAG_FILLING), "FILLING" },\
diff --git a/include/trace/events/clk.h b/include/trace/events/clk.h
index 758607226bfd..2cd449328aee 100644
--- a/include/trace/events/clk.h
+++ b/include/trace/events/clk.h
@@ -134,12 +134,12 @@ DECLARE_EVENT_CLASS(clk_parent,
134 134
135 TP_STRUCT__entry( 135 TP_STRUCT__entry(
136 __string( name, core->name ) 136 __string( name, core->name )
137 __string( pname, parent->name ) 137 __string( pname, parent ? parent->name : "none" )
138 ), 138 ),
139 139
140 TP_fast_assign( 140 TP_fast_assign(
141 __assign_str(name, core->name); 141 __assign_str(name, core->name);
142 __assign_str(pname, parent->name); 142 __assign_str(pname, parent ? parent->name : "none");
143 ), 143 ),
144 144
145 TP_printk("%s %s", __get_str(name), __get_str(pname)) 145 TP_printk("%s %s", __get_str(name), __get_str(pname))
diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h
index e4b0b8e09932..2c735a3e6613 100644
--- a/include/trace/events/kvm.h
+++ b/include/trace/events/kvm.h
@@ -211,7 +211,7 @@ TRACE_EVENT(kvm_ack_irq,
211 { KVM_TRACE_MMIO_WRITE, "write" } 211 { KVM_TRACE_MMIO_WRITE, "write" }
212 212
213TRACE_EVENT(kvm_mmio, 213TRACE_EVENT(kvm_mmio,
214 TP_PROTO(int type, int len, u64 gpa, u64 val), 214 TP_PROTO(int type, int len, u64 gpa, void *val),
215 TP_ARGS(type, len, gpa, val), 215 TP_ARGS(type, len, gpa, val),
216 216
217 TP_STRUCT__entry( 217 TP_STRUCT__entry(
@@ -225,7 +225,10 @@ TRACE_EVENT(kvm_mmio,
225 __entry->type = type; 225 __entry->type = type;
226 __entry->len = len; 226 __entry->len = len;
227 __entry->gpa = gpa; 227 __entry->gpa = gpa;
228 __entry->val = val; 228 __entry->val = 0;
229 if (val)
230 memcpy(&__entry->val, val,
231 min_t(u32, sizeof(__entry->val), len));
229 ), 232 ),
230 233
231 TP_printk("mmio %s len %u gpa 0x%llx val 0x%llx", 234 TP_printk("mmio %s len %u gpa 0x%llx val 0x%llx",
diff --git a/include/trace/events/preemptirq.h b/include/trace/events/preemptirq.h
index f5024c560d8f..9c4eb33c5a1d 100644
--- a/include/trace/events/preemptirq.h
+++ b/include/trace/events/preemptirq.h
@@ -56,15 +56,18 @@ DEFINE_EVENT(preemptirq_template, preempt_enable,
56 56
57#include <trace/define_trace.h> 57#include <trace/define_trace.h>
58 58
59#else /* !CONFIG_PREEMPTIRQ_EVENTS */ 59#endif /* !CONFIG_PREEMPTIRQ_EVENTS */
60 60
61#if !defined(CONFIG_PREEMPTIRQ_EVENTS) || defined(CONFIG_PROVE_LOCKING)
61#define trace_irq_enable(...) 62#define trace_irq_enable(...)
62#define trace_irq_disable(...) 63#define trace_irq_disable(...)
63#define trace_preempt_enable(...)
64#define trace_preempt_disable(...)
65#define trace_irq_enable_rcuidle(...) 64#define trace_irq_enable_rcuidle(...)
66#define trace_irq_disable_rcuidle(...) 65#define trace_irq_disable_rcuidle(...)
66#endif
67
68#if !defined(CONFIG_PREEMPTIRQ_EVENTS) || !defined(CONFIG_DEBUG_PREEMPT)
69#define trace_preempt_enable(...)
70#define trace_preempt_disable(...)
67#define trace_preempt_enable_rcuidle(...) 71#define trace_preempt_enable_rcuidle(...)
68#define trace_preempt_disable_rcuidle(...) 72#define trace_preempt_disable_rcuidle(...)
69
70#endif 73#endif
diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h
index 59d40c454aa0..0b50fda80db0 100644
--- a/include/trace/events/rcu.h
+++ b/include/trace/events/rcu.h
@@ -243,6 +243,7 @@ TRACE_EVENT(rcu_exp_funnel_lock,
243 __entry->grphi, __entry->gpevent) 243 __entry->grphi, __entry->gpevent)
244); 244);
245 245
246#ifdef CONFIG_RCU_NOCB_CPU
246/* 247/*
247 * Tracepoint for RCU no-CBs CPU callback handoffs. This event is intended 248 * Tracepoint for RCU no-CBs CPU callback handoffs. This event is intended
248 * to assist debugging of these handoffs. 249 * to assist debugging of these handoffs.
@@ -285,6 +286,7 @@ TRACE_EVENT(rcu_nocb_wake,
285 286
286 TP_printk("%s %d %s", __entry->rcuname, __entry->cpu, __entry->reason) 287 TP_printk("%s %d %s", __entry->rcuname, __entry->cpu, __entry->reason)
287); 288);
289#endif
288 290
289/* 291/*
290 * Tracepoint for tasks blocking within preemptible-RCU read-side 292 * Tracepoint for tasks blocking within preemptible-RCU read-side
@@ -421,76 +423,40 @@ TRACE_EVENT(rcu_fqs,
421 423
422/* 424/*
423 * Tracepoint for dyntick-idle entry/exit events. These take a string 425 * Tracepoint for dyntick-idle entry/exit events. These take a string
424 * as argument: "Start" for entering dyntick-idle mode, "End" for 426 * as argument: "Start" for entering dyntick-idle mode, "Startirq" for
425 * leaving it, "--=" for events moving towards idle, and "++=" for events 427 * entering it from irq/NMI, "End" for leaving it, "Endirq" for leaving it
426 * moving away from idle. "Error on entry: not idle task" and "Error on 428 * to irq/NMI, "--=" for events moving towards idle, and "++=" for events
427 * exit: not idle task" indicate that a non-idle task is erroneously 429 * moving away from idle.
428 * toying with the idle loop.
429 * 430 *
430 * These events also take a pair of numbers, which indicate the nesting 431 * These events also take a pair of numbers, which indicate the nesting
431 * depth before and after the event of interest. Note that task-related 432 * depth before and after the event of interest, and a third number that is
432 * events use the upper bits of each number, while interrupt-related 433 * the ->dynticks counter. Note that task-related and interrupt-related
433 * events use the lower bits. 434 * events use two separate counters, and that the "++=" and "--=" events
435 * for irq/NMI will change the counter by two, otherwise by one.
434 */ 436 */
435TRACE_EVENT(rcu_dyntick, 437TRACE_EVENT(rcu_dyntick,
436 438
437 TP_PROTO(const char *polarity, long long oldnesting, long long newnesting), 439 TP_PROTO(const char *polarity, long oldnesting, long newnesting, atomic_t dynticks),
438 440
439 TP_ARGS(polarity, oldnesting, newnesting), 441 TP_ARGS(polarity, oldnesting, newnesting, dynticks),
440 442
441 TP_STRUCT__entry( 443 TP_STRUCT__entry(
442 __field(const char *, polarity) 444 __field(const char *, polarity)
443 __field(long long, oldnesting) 445 __field(long, oldnesting)
444 __field(long long, newnesting) 446 __field(long, newnesting)
447 __field(int, dynticks)
445 ), 448 ),
446 449
447 TP_fast_assign( 450 TP_fast_assign(
448 __entry->polarity = polarity; 451 __entry->polarity = polarity;
449 __entry->oldnesting = oldnesting; 452 __entry->oldnesting = oldnesting;
450 __entry->newnesting = newnesting; 453 __entry->newnesting = newnesting;
454 __entry->dynticks = atomic_read(&dynticks);
451 ), 455 ),
452 456
453 TP_printk("%s %llx %llx", __entry->polarity, 457 TP_printk("%s %lx %lx %#3x", __entry->polarity,
454 __entry->oldnesting, __entry->newnesting) 458 __entry->oldnesting, __entry->newnesting,
455); 459 __entry->dynticks & 0xfff)
456
457/*
458 * Tracepoint for RCU preparation for idle, the goal being to get RCU
459 * processing done so that the current CPU can shut off its scheduling
460 * clock and enter dyntick-idle mode. One way to accomplish this is
461 * to drain all RCU callbacks from this CPU, and the other is to have
462 * done everything RCU requires for the current grace period. In this
463 * latter case, the CPU will be awakened at the end of the current grace
464 * period in order to process the remainder of its callbacks.
465 *
466 * These tracepoints take a string as argument:
467 *
468 * "No callbacks": Nothing to do, no callbacks on this CPU.
469 * "In holdoff": Nothing to do, holding off after unsuccessful attempt.
470 * "Begin holdoff": Attempt failed, don't retry until next jiffy.
471 * "Dyntick with callbacks": Entering dyntick-idle despite callbacks.
472 * "Dyntick with lazy callbacks": Entering dyntick-idle w/lazy callbacks.
473 * "More callbacks": Still more callbacks, try again to clear them out.
474 * "Callbacks drained": All callbacks processed, off to dyntick idle!
475 * "Timer": Timer fired to cause CPU to continue processing callbacks.
476 * "Demigrate": Timer fired on wrong CPU, woke up correct CPU.
477 * "Cleanup after idle": Idle exited, timer canceled.
478 */
479TRACE_EVENT(rcu_prep_idle,
480
481 TP_PROTO(const char *reason),
482
483 TP_ARGS(reason),
484
485 TP_STRUCT__entry(
486 __field(const char *, reason)
487 ),
488
489 TP_fast_assign(
490 __entry->reason = reason;
491 ),
492
493 TP_printk("%s", __entry->reason)
494); 460);
495 461
496/* 462/*
@@ -799,8 +765,7 @@ TRACE_EVENT(rcu_barrier,
799 grplo, grphi, gp_tasks) do { } \ 765 grplo, grphi, gp_tasks) do { } \
800 while (0) 766 while (0)
801#define trace_rcu_fqs(rcuname, gpnum, cpu, qsevent) do { } while (0) 767#define trace_rcu_fqs(rcuname, gpnum, cpu, qsevent) do { } while (0)
802#define trace_rcu_dyntick(polarity, oldnesting, newnesting) do { } while (0) 768#define trace_rcu_dyntick(polarity, oldnesting, newnesting, dyntick) do { } while (0)
803#define trace_rcu_prep_idle(reason) do { } while (0)
804#define trace_rcu_callback(rcuname, rhp, qlen_lazy, qlen) do { } while (0) 769#define trace_rcu_callback(rcuname, rhp, qlen_lazy, qlen) do { } while (0)
805#define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen_lazy, qlen) \ 770#define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen_lazy, qlen) \
806 do { } while (0) 771 do { } while (0)
diff --git a/include/trace/events/tcp.h b/include/trace/events/tcp.h
index 07cccca6cbf1..ab34c561f26b 100644
--- a/include/trace/events/tcp.h
+++ b/include/trace/events/tcp.h
@@ -25,6 +25,35 @@
25 tcp_state_name(TCP_CLOSING), \ 25 tcp_state_name(TCP_CLOSING), \
26 tcp_state_name(TCP_NEW_SYN_RECV)) 26 tcp_state_name(TCP_NEW_SYN_RECV))
27 27
28#define TP_STORE_V4MAPPED(__entry, saddr, daddr) \
29 do { \
30 struct in6_addr *pin6; \
31 \
32 pin6 = (struct in6_addr *)__entry->saddr_v6; \
33 ipv6_addr_set_v4mapped(saddr, pin6); \
34 pin6 = (struct in6_addr *)__entry->daddr_v6; \
35 ipv6_addr_set_v4mapped(daddr, pin6); \
36 } while (0)
37
38#if IS_ENABLED(CONFIG_IPV6)
39#define TP_STORE_ADDRS(__entry, saddr, daddr, saddr6, daddr6) \
40 do { \
41 if (sk->sk_family == AF_INET6) { \
42 struct in6_addr *pin6; \
43 \
44 pin6 = (struct in6_addr *)__entry->saddr_v6; \
45 *pin6 = saddr6; \
46 pin6 = (struct in6_addr *)__entry->daddr_v6; \
47 *pin6 = daddr6; \
48 } else { \
49 TP_STORE_V4MAPPED(__entry, saddr, daddr); \
50 } \
51 } while (0)
52#else
53#define TP_STORE_ADDRS(__entry, saddr, daddr, saddr6, daddr6) \
54 TP_STORE_V4MAPPED(__entry, saddr, daddr)
55#endif
56
28/* 57/*
29 * tcp event with arguments sk and skb 58 * tcp event with arguments sk and skb
30 * 59 *
@@ -50,7 +79,6 @@ DECLARE_EVENT_CLASS(tcp_event_sk_skb,
50 79
51 TP_fast_assign( 80 TP_fast_assign(
52 struct inet_sock *inet = inet_sk(sk); 81 struct inet_sock *inet = inet_sk(sk);
53 struct in6_addr *pin6;
54 __be32 *p32; 82 __be32 *p32;
55 83
56 __entry->skbaddr = skb; 84 __entry->skbaddr = skb;
@@ -65,20 +93,8 @@ DECLARE_EVENT_CLASS(tcp_event_sk_skb,
65 p32 = (__be32 *) __entry->daddr; 93 p32 = (__be32 *) __entry->daddr;
66 *p32 = inet->inet_daddr; 94 *p32 = inet->inet_daddr;
67 95
68#if IS_ENABLED(CONFIG_IPV6) 96 TP_STORE_ADDRS(__entry, inet->inet_saddr, inet->inet_daddr,
69 if (sk->sk_family == AF_INET6) { 97 sk->sk_v6_rcv_saddr, sk->sk_v6_daddr);
70 pin6 = (struct in6_addr *)__entry->saddr_v6;
71 *pin6 = sk->sk_v6_rcv_saddr;
72 pin6 = (struct in6_addr *)__entry->daddr_v6;
73 *pin6 = sk->sk_v6_daddr;
74 } else
75#endif
76 {
77 pin6 = (struct in6_addr *)__entry->saddr_v6;
78 ipv6_addr_set_v4mapped(inet->inet_saddr, pin6);
79 pin6 = (struct in6_addr *)__entry->daddr_v6;
80 ipv6_addr_set_v4mapped(inet->inet_daddr, pin6);
81 }
82 ), 98 ),
83 99
84 TP_printk("sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c", 100 TP_printk("sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c",
@@ -127,7 +143,6 @@ DECLARE_EVENT_CLASS(tcp_event_sk,
127 143
128 TP_fast_assign( 144 TP_fast_assign(
129 struct inet_sock *inet = inet_sk(sk); 145 struct inet_sock *inet = inet_sk(sk);
130 struct in6_addr *pin6;
131 __be32 *p32; 146 __be32 *p32;
132 147
133 __entry->skaddr = sk; 148 __entry->skaddr = sk;
@@ -141,20 +156,8 @@ DECLARE_EVENT_CLASS(tcp_event_sk,
141 p32 = (__be32 *) __entry->daddr; 156 p32 = (__be32 *) __entry->daddr;
142 *p32 = inet->inet_daddr; 157 *p32 = inet->inet_daddr;
143 158
144#if IS_ENABLED(CONFIG_IPV6) 159 TP_STORE_ADDRS(__entry, inet->inet_saddr, inet->inet_daddr,
145 if (sk->sk_family == AF_INET6) { 160 sk->sk_v6_rcv_saddr, sk->sk_v6_daddr);
146 pin6 = (struct in6_addr *)__entry->saddr_v6;
147 *pin6 = sk->sk_v6_rcv_saddr;
148 pin6 = (struct in6_addr *)__entry->daddr_v6;
149 *pin6 = sk->sk_v6_daddr;
150 } else
151#endif
152 {
153 pin6 = (struct in6_addr *)__entry->saddr_v6;
154 ipv6_addr_set_v4mapped(inet->inet_saddr, pin6);
155 pin6 = (struct in6_addr *)__entry->daddr_v6;
156 ipv6_addr_set_v4mapped(inet->inet_daddr, pin6);
157 }
158 ), 161 ),
159 162
160 TP_printk("sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c", 163 TP_printk("sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c",
@@ -197,7 +200,6 @@ TRACE_EVENT(tcp_set_state,
197 200
198 TP_fast_assign( 201 TP_fast_assign(
199 struct inet_sock *inet = inet_sk(sk); 202 struct inet_sock *inet = inet_sk(sk);
200 struct in6_addr *pin6;
201 __be32 *p32; 203 __be32 *p32;
202 204
203 __entry->skaddr = sk; 205 __entry->skaddr = sk;
@@ -213,20 +215,8 @@ TRACE_EVENT(tcp_set_state,
213 p32 = (__be32 *) __entry->daddr; 215 p32 = (__be32 *) __entry->daddr;
214 *p32 = inet->inet_daddr; 216 *p32 = inet->inet_daddr;
215 217
216#if IS_ENABLED(CONFIG_IPV6) 218 TP_STORE_ADDRS(__entry, inet->inet_saddr, inet->inet_daddr,
217 if (sk->sk_family == AF_INET6) { 219 sk->sk_v6_rcv_saddr, sk->sk_v6_daddr);
218 pin6 = (struct in6_addr *)__entry->saddr_v6;
219 *pin6 = sk->sk_v6_rcv_saddr;
220 pin6 = (struct in6_addr *)__entry->daddr_v6;
221 *pin6 = sk->sk_v6_daddr;
222 } else
223#endif
224 {
225 pin6 = (struct in6_addr *)__entry->saddr_v6;
226 ipv6_addr_set_v4mapped(inet->inet_saddr, pin6);
227 pin6 = (struct in6_addr *)__entry->daddr_v6;
228 ipv6_addr_set_v4mapped(inet->inet_daddr, pin6);
229 }
230 ), 220 ),
231 221
232 TP_printk("sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c oldstate=%s newstate=%s", 222 TP_printk("sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c oldstate=%s newstate=%s",
@@ -256,7 +246,6 @@ TRACE_EVENT(tcp_retransmit_synack,
256 246
257 TP_fast_assign( 247 TP_fast_assign(
258 struct inet_request_sock *ireq = inet_rsk(req); 248 struct inet_request_sock *ireq = inet_rsk(req);
259 struct in6_addr *pin6;
260 __be32 *p32; 249 __be32 *p32;
261 250
262 __entry->skaddr = sk; 251 __entry->skaddr = sk;
@@ -271,20 +260,8 @@ TRACE_EVENT(tcp_retransmit_synack,
271 p32 = (__be32 *) __entry->daddr; 260 p32 = (__be32 *) __entry->daddr;
272 *p32 = ireq->ir_rmt_addr; 261 *p32 = ireq->ir_rmt_addr;
273 262
274#if IS_ENABLED(CONFIG_IPV6) 263 TP_STORE_ADDRS(__entry, ireq->ir_loc_addr, ireq->ir_rmt_addr,
275 if (sk->sk_family == AF_INET6) { 264 ireq->ir_v6_loc_addr, ireq->ir_v6_rmt_addr);
276 pin6 = (struct in6_addr *)__entry->saddr_v6;
277 *pin6 = ireq->ir_v6_loc_addr;
278 pin6 = (struct in6_addr *)__entry->daddr_v6;
279 *pin6 = ireq->ir_v6_rmt_addr;
280 } else
281#endif
282 {
283 pin6 = (struct in6_addr *)__entry->saddr_v6;
284 ipv6_addr_set_v4mapped(ireq->ir_loc_addr, pin6);
285 pin6 = (struct in6_addr *)__entry->daddr_v6;
286 ipv6_addr_set_v4mapped(ireq->ir_rmt_addr, pin6);
287 }
288 ), 265 ),
289 266
290 TP_printk("sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c", 267 TP_printk("sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c",
diff --git a/include/trace/events/thermal.h b/include/trace/events/thermal.h
index 78946640fe03..135e5421f003 100644
--- a/include/trace/events/thermal.h
+++ b/include/trace/events/thermal.h
@@ -94,9 +94,9 @@ TRACE_EVENT(thermal_zone_trip,
94#ifdef CONFIG_CPU_THERMAL 94#ifdef CONFIG_CPU_THERMAL
95TRACE_EVENT(thermal_power_cpu_get_power, 95TRACE_EVENT(thermal_power_cpu_get_power,
96 TP_PROTO(const struct cpumask *cpus, unsigned long freq, u32 *load, 96 TP_PROTO(const struct cpumask *cpus, unsigned long freq, u32 *load,
97 size_t load_len, u32 dynamic_power, u32 static_power), 97 size_t load_len, u32 dynamic_power),
98 98
99 TP_ARGS(cpus, freq, load, load_len, dynamic_power, static_power), 99 TP_ARGS(cpus, freq, load, load_len, dynamic_power),
100 100
101 TP_STRUCT__entry( 101 TP_STRUCT__entry(
102 __bitmask(cpumask, num_possible_cpus()) 102 __bitmask(cpumask, num_possible_cpus())
@@ -104,7 +104,6 @@ TRACE_EVENT(thermal_power_cpu_get_power,
104 __dynamic_array(u32, load, load_len) 104 __dynamic_array(u32, load, load_len)
105 __field(size_t, load_len ) 105 __field(size_t, load_len )
106 __field(u32, dynamic_power ) 106 __field(u32, dynamic_power )
107 __field(u32, static_power )
108 ), 107 ),
109 108
110 TP_fast_assign( 109 TP_fast_assign(
@@ -115,13 +114,12 @@ TRACE_EVENT(thermal_power_cpu_get_power,
115 load_len * sizeof(*load)); 114 load_len * sizeof(*load));
116 __entry->load_len = load_len; 115 __entry->load_len = load_len;
117 __entry->dynamic_power = dynamic_power; 116 __entry->dynamic_power = dynamic_power;
118 __entry->static_power = static_power;
119 ), 117 ),
120 118
121 TP_printk("cpus=%s freq=%lu load={%s} dynamic_power=%d static_power=%d", 119 TP_printk("cpus=%s freq=%lu load={%s} dynamic_power=%d",
122 __get_bitmask(cpumask), __entry->freq, 120 __get_bitmask(cpumask), __entry->freq,
123 __print_array(__get_dynamic_array(load), __entry->load_len, 4), 121 __print_array(__get_dynamic_array(load), __entry->load_len, 4),
124 __entry->dynamic_power, __entry->static_power) 122 __entry->dynamic_power)
125); 123);
126 124
127TRACE_EVENT(thermal_power_cpu_limit, 125TRACE_EVENT(thermal_power_cpu_limit,
diff --git a/include/trace/events/timer.h b/include/trace/events/timer.h
index 16e305e69f34..a57e4ee989d6 100644
--- a/include/trace/events/timer.h
+++ b/include/trace/events/timer.h
@@ -136,6 +136,24 @@ DEFINE_EVENT(timer_class, timer_cancel,
136 TP_ARGS(timer) 136 TP_ARGS(timer)
137); 137);
138 138
139#define decode_clockid(type) \
140 __print_symbolic(type, \
141 { CLOCK_REALTIME, "CLOCK_REALTIME" }, \
142 { CLOCK_MONOTONIC, "CLOCK_MONOTONIC" }, \
143 { CLOCK_BOOTTIME, "CLOCK_BOOTTIME" }, \
144 { CLOCK_TAI, "CLOCK_TAI" })
145
146#define decode_hrtimer_mode(mode) \
147 __print_symbolic(mode, \
148 { HRTIMER_MODE_ABS, "ABS" }, \
149 { HRTIMER_MODE_REL, "REL" }, \
150 { HRTIMER_MODE_ABS_PINNED, "ABS|PINNED" }, \
151 { HRTIMER_MODE_REL_PINNED, "REL|PINNED" }, \
152 { HRTIMER_MODE_ABS_SOFT, "ABS|SOFT" }, \
153 { HRTIMER_MODE_REL_SOFT, "REL|SOFT" }, \
154 { HRTIMER_MODE_ABS_PINNED_SOFT, "ABS|PINNED|SOFT" }, \
155 { HRTIMER_MODE_REL_PINNED_SOFT, "REL|PINNED|SOFT" })
156
139/** 157/**
140 * hrtimer_init - called when the hrtimer is initialized 158 * hrtimer_init - called when the hrtimer is initialized
141 * @hrtimer: pointer to struct hrtimer 159 * @hrtimer: pointer to struct hrtimer
@@ -162,10 +180,8 @@ TRACE_EVENT(hrtimer_init,
162 ), 180 ),
163 181
164 TP_printk("hrtimer=%p clockid=%s mode=%s", __entry->hrtimer, 182 TP_printk("hrtimer=%p clockid=%s mode=%s", __entry->hrtimer,
165 __entry->clockid == CLOCK_REALTIME ? 183 decode_clockid(__entry->clockid),
166 "CLOCK_REALTIME" : "CLOCK_MONOTONIC", 184 decode_hrtimer_mode(__entry->mode))
167 __entry->mode == HRTIMER_MODE_ABS ?
168 "HRTIMER_MODE_ABS" : "HRTIMER_MODE_REL")
169); 185);
170 186
171/** 187/**
@@ -174,15 +190,16 @@ TRACE_EVENT(hrtimer_init,
174 */ 190 */
175TRACE_EVENT(hrtimer_start, 191TRACE_EVENT(hrtimer_start,
176 192
177 TP_PROTO(struct hrtimer *hrtimer), 193 TP_PROTO(struct hrtimer *hrtimer, enum hrtimer_mode mode),
178 194
179 TP_ARGS(hrtimer), 195 TP_ARGS(hrtimer, mode),
180 196
181 TP_STRUCT__entry( 197 TP_STRUCT__entry(
182 __field( void *, hrtimer ) 198 __field( void *, hrtimer )
183 __field( void *, function ) 199 __field( void *, function )
184 __field( s64, expires ) 200 __field( s64, expires )
185 __field( s64, softexpires ) 201 __field( s64, softexpires )
202 __field( enum hrtimer_mode, mode )
186 ), 203 ),
187 204
188 TP_fast_assign( 205 TP_fast_assign(
@@ -190,12 +207,14 @@ TRACE_EVENT(hrtimer_start,
190 __entry->function = hrtimer->function; 207 __entry->function = hrtimer->function;
191 __entry->expires = hrtimer_get_expires(hrtimer); 208 __entry->expires = hrtimer_get_expires(hrtimer);
192 __entry->softexpires = hrtimer_get_softexpires(hrtimer); 209 __entry->softexpires = hrtimer_get_softexpires(hrtimer);
210 __entry->mode = mode;
193 ), 211 ),
194 212
195 TP_printk("hrtimer=%p function=%pf expires=%llu softexpires=%llu", 213 TP_printk("hrtimer=%p function=%pf expires=%llu softexpires=%llu "
196 __entry->hrtimer, __entry->function, 214 "mode=%s", __entry->hrtimer, __entry->function,
197 (unsigned long long) __entry->expires, 215 (unsigned long long) __entry->expires,
198 (unsigned long long) __entry->softexpires) 216 (unsigned long long) __entry->softexpires,
217 decode_hrtimer_mode(__entry->mode))
199); 218);
200 219
201/** 220/**
diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
index ce615b75e855..c8d99b9ca550 100644
--- a/include/uapi/linux/btrfs.h
+++ b/include/uapi/linux/btrfs.h
@@ -33,7 +33,12 @@ struct btrfs_ioctl_vol_args {
33 char name[BTRFS_PATH_NAME_MAX + 1]; 33 char name[BTRFS_PATH_NAME_MAX + 1];
34}; 34};
35 35
36#define BTRFS_DEVICE_PATH_NAME_MAX 1024 36#define BTRFS_DEVICE_PATH_NAME_MAX 1024
37#define BTRFS_SUBVOL_NAME_MAX 4039
38
39#define BTRFS_SUBVOL_CREATE_ASYNC (1ULL << 0)
40#define BTRFS_SUBVOL_RDONLY (1ULL << 1)
41#define BTRFS_SUBVOL_QGROUP_INHERIT (1ULL << 2)
37 42
38#define BTRFS_DEVICE_SPEC_BY_ID (1ULL << 3) 43#define BTRFS_DEVICE_SPEC_BY_ID (1ULL << 3)
39 44
@@ -101,11 +106,7 @@ struct btrfs_ioctl_qgroup_limit_args {
101 * - BTRFS_IOC_SUBVOL_GETFLAGS 106 * - BTRFS_IOC_SUBVOL_GETFLAGS
102 * - BTRFS_IOC_SUBVOL_SETFLAGS 107 * - BTRFS_IOC_SUBVOL_SETFLAGS
103 */ 108 */
104#define BTRFS_SUBVOL_CREATE_ASYNC (1ULL << 0)
105#define BTRFS_SUBVOL_RDONLY (1ULL << 1)
106#define BTRFS_SUBVOL_QGROUP_INHERIT (1ULL << 2)
107 109
108#define BTRFS_SUBVOL_NAME_MAX 4039
109struct btrfs_ioctl_vol_args_v2 { 110struct btrfs_ioctl_vol_args_v2 {
110 __s64 fd; 111 __s64 fd;
111 __u64 transid; 112 __u64 transid;
diff --git a/include/uapi/linux/btrfs_tree.h b/include/uapi/linux/btrfs_tree.h
index 6d6e5da51527..aff1356c2bb8 100644
--- a/include/uapi/linux/btrfs_tree.h
+++ b/include/uapi/linux/btrfs_tree.h
@@ -456,6 +456,8 @@ struct btrfs_free_space_header {
456 456
457#define BTRFS_SUPER_FLAG_SEEDING (1ULL << 32) 457#define BTRFS_SUPER_FLAG_SEEDING (1ULL << 32)
458#define BTRFS_SUPER_FLAG_METADUMP (1ULL << 33) 458#define BTRFS_SUPER_FLAG_METADUMP (1ULL << 33)
459#define BTRFS_SUPER_FLAG_METADUMP_V2 (1ULL << 34)
460#define BTRFS_SUPER_FLAG_CHANGING_FSID (1ULL << 35)
459 461
460 462
461/* 463/*
diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h
index 3ee3bf7c8526..144de4d2f385 100644
--- a/include/uapi/linux/if_ether.h
+++ b/include/uapi/linux/if_ether.h
@@ -23,6 +23,7 @@
23#define _UAPI_LINUX_IF_ETHER_H 23#define _UAPI_LINUX_IF_ETHER_H
24 24
25#include <linux/types.h> 25#include <linux/types.h>
26#include <linux/libc-compat.h>
26 27
27/* 28/*
28 * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble 29 * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
@@ -149,11 +150,13 @@
149 * This is an Ethernet frame header. 150 * This is an Ethernet frame header.
150 */ 151 */
151 152
153#if __UAPI_DEF_ETHHDR
152struct ethhdr { 154struct ethhdr {
153 unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ 155 unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
154 unsigned char h_source[ETH_ALEN]; /* source ether addr */ 156 unsigned char h_source[ETH_ALEN]; /* source ether addr */
155 __be16 h_proto; /* packet type ID field */ 157 __be16 h_proto; /* packet type ID field */
156} __attribute__((packed)); 158} __attribute__((packed));
159#endif
157 160
158 161
159#endif /* _UAPI_LINUX_IF_ETHER_H */ 162#endif /* _UAPI_LINUX_IF_ETHER_H */
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 62c564dd4aa1..0fb5ef939732 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -932,6 +932,8 @@ struct kvm_ppc_resize_hpt {
932#define KVM_CAP_HYPERV_SYNIC2 148 932#define KVM_CAP_HYPERV_SYNIC2 148
933#define KVM_CAP_HYPERV_VP_INDEX 149 933#define KVM_CAP_HYPERV_VP_INDEX 149
934#define KVM_CAP_S390_AIS_MIGRATION 150 934#define KVM_CAP_S390_AIS_MIGRATION 150
935#define KVM_CAP_PPC_GET_CPU_CHAR 151
936#define KVM_CAP_S390_BPB 152
935 937
936#ifdef KVM_CAP_IRQ_ROUTING 938#ifdef KVM_CAP_IRQ_ROUTING
937 939
@@ -1261,6 +1263,8 @@ struct kvm_s390_ucas_mapping {
1261#define KVM_PPC_CONFIGURE_V3_MMU _IOW(KVMIO, 0xaf, struct kvm_ppc_mmuv3_cfg) 1263#define KVM_PPC_CONFIGURE_V3_MMU _IOW(KVMIO, 0xaf, struct kvm_ppc_mmuv3_cfg)
1262/* Available with KVM_CAP_PPC_RADIX_MMU */ 1264/* Available with KVM_CAP_PPC_RADIX_MMU */
1263#define KVM_PPC_GET_RMMU_INFO _IOW(KVMIO, 0xb0, struct kvm_ppc_rmmu_info) 1265#define KVM_PPC_GET_RMMU_INFO _IOW(KVMIO, 0xb0, struct kvm_ppc_rmmu_info)
1266/* Available with KVM_CAP_PPC_GET_CPU_CHAR */
1267#define KVM_PPC_GET_CPU_CHAR _IOR(KVMIO, 0xb1, struct kvm_ppc_cpu_char)
1264 1268
1265/* ioctl for vm fd */ 1269/* ioctl for vm fd */
1266#define KVM_CREATE_DEVICE _IOWR(KVMIO, 0xe0, struct kvm_create_device) 1270#define KVM_CREATE_DEVICE _IOWR(KVMIO, 0xe0, struct kvm_create_device)
diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
index 282875cf8056..fc29efaa918c 100644
--- a/include/uapi/linux/libc-compat.h
+++ b/include/uapi/linux/libc-compat.h
@@ -168,47 +168,106 @@
168 168
169/* If we did not see any headers from any supported C libraries, 169/* If we did not see any headers from any supported C libraries,
170 * or we are being included in the kernel, then define everything 170 * or we are being included in the kernel, then define everything
171 * that we need. */ 171 * that we need. Check for previous __UAPI_* definitions to give
172 * unsupported C libraries a way to opt out of any kernel definition. */
172#else /* !defined(__GLIBC__) */ 173#else /* !defined(__GLIBC__) */
173 174
174/* Definitions for if.h */ 175/* Definitions for if.h */
176#ifndef __UAPI_DEF_IF_IFCONF
175#define __UAPI_DEF_IF_IFCONF 1 177#define __UAPI_DEF_IF_IFCONF 1
178#endif
179#ifndef __UAPI_DEF_IF_IFMAP
176#define __UAPI_DEF_IF_IFMAP 1 180#define __UAPI_DEF_IF_IFMAP 1
181#endif
182#ifndef __UAPI_DEF_IF_IFNAMSIZ
177#define __UAPI_DEF_IF_IFNAMSIZ 1 183#define __UAPI_DEF_IF_IFNAMSIZ 1
184#endif
185#ifndef __UAPI_DEF_IF_IFREQ
178#define __UAPI_DEF_IF_IFREQ 1 186#define __UAPI_DEF_IF_IFREQ 1
187#endif
179/* Everything up to IFF_DYNAMIC, matches net/if.h until glibc 2.23 */ 188/* Everything up to IFF_DYNAMIC, matches net/if.h until glibc 2.23 */
189#ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS
180#define __UAPI_DEF_IF_NET_DEVICE_FLAGS 1 190#define __UAPI_DEF_IF_NET_DEVICE_FLAGS 1
191#endif
181/* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */ 192/* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
193#ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
182#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1 194#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
195#endif
183 196
184/* Definitions for in.h */ 197/* Definitions for in.h */
198#ifndef __UAPI_DEF_IN_ADDR
185#define __UAPI_DEF_IN_ADDR 1 199#define __UAPI_DEF_IN_ADDR 1
200#endif
201#ifndef __UAPI_DEF_IN_IPPROTO
186#define __UAPI_DEF_IN_IPPROTO 1 202#define __UAPI_DEF_IN_IPPROTO 1
203#endif
204#ifndef __UAPI_DEF_IN_PKTINFO
187#define __UAPI_DEF_IN_PKTINFO 1 205#define __UAPI_DEF_IN_PKTINFO 1
206#endif
207#ifndef __UAPI_DEF_IP_MREQ
188#define __UAPI_DEF_IP_MREQ 1 208#define __UAPI_DEF_IP_MREQ 1
209#endif
210#ifndef __UAPI_DEF_SOCKADDR_IN
189#define __UAPI_DEF_SOCKADDR_IN 1 211#define __UAPI_DEF_SOCKADDR_IN 1
212#endif
213#ifndef __UAPI_DEF_IN_CLASS
190#define __UAPI_DEF_IN_CLASS 1 214#define __UAPI_DEF_IN_CLASS 1
215#endif
191 216
192/* Definitions for in6.h */ 217/* Definitions for in6.h */
218#ifndef __UAPI_DEF_IN6_ADDR
193#define __UAPI_DEF_IN6_ADDR 1 219#define __UAPI_DEF_IN6_ADDR 1
220#endif
221#ifndef __UAPI_DEF_IN6_ADDR_ALT
194#define __UAPI_DEF_IN6_ADDR_ALT 1 222#define __UAPI_DEF_IN6_ADDR_ALT 1
223#endif
224#ifndef __UAPI_DEF_SOCKADDR_IN6
195#define __UAPI_DEF_SOCKADDR_IN6 1 225#define __UAPI_DEF_SOCKADDR_IN6 1
226#endif
227#ifndef __UAPI_DEF_IPV6_MREQ
196#define __UAPI_DEF_IPV6_MREQ 1 228#define __UAPI_DEF_IPV6_MREQ 1
229#endif
230#ifndef __UAPI_DEF_IPPROTO_V6
197#define __UAPI_DEF_IPPROTO_V6 1 231#define __UAPI_DEF_IPPROTO_V6 1
232#endif
233#ifndef __UAPI_DEF_IPV6_OPTIONS
198#define __UAPI_DEF_IPV6_OPTIONS 1 234#define __UAPI_DEF_IPV6_OPTIONS 1
235#endif
236#ifndef __UAPI_DEF_IN6_PKTINFO
199#define __UAPI_DEF_IN6_PKTINFO 1 237#define __UAPI_DEF_IN6_PKTINFO 1
238#endif
239#ifndef __UAPI_DEF_IP6_MTUINFO
200#define __UAPI_DEF_IP6_MTUINFO 1 240#define __UAPI_DEF_IP6_MTUINFO 1
241#endif
201 242
202/* Definitions for ipx.h */ 243/* Definitions for ipx.h */
244#ifndef __UAPI_DEF_SOCKADDR_IPX
203#define __UAPI_DEF_SOCKADDR_IPX 1 245#define __UAPI_DEF_SOCKADDR_IPX 1
246#endif
247#ifndef __UAPI_DEF_IPX_ROUTE_DEFINITION
204#define __UAPI_DEF_IPX_ROUTE_DEFINITION 1 248#define __UAPI_DEF_IPX_ROUTE_DEFINITION 1
249#endif
250#ifndef __UAPI_DEF_IPX_INTERFACE_DEFINITION
205#define __UAPI_DEF_IPX_INTERFACE_DEFINITION 1 251#define __UAPI_DEF_IPX_INTERFACE_DEFINITION 1
252#endif
253#ifndef __UAPI_DEF_IPX_CONFIG_DATA
206#define __UAPI_DEF_IPX_CONFIG_DATA 1 254#define __UAPI_DEF_IPX_CONFIG_DATA 1
255#endif
256#ifndef __UAPI_DEF_IPX_ROUTE_DEF
207#define __UAPI_DEF_IPX_ROUTE_DEF 1 257#define __UAPI_DEF_IPX_ROUTE_DEF 1
258#endif
208 259
209/* Definitions for xattr.h */ 260/* Definitions for xattr.h */
261#ifndef __UAPI_DEF_XATTR
210#define __UAPI_DEF_XATTR 1 262#define __UAPI_DEF_XATTR 1
263#endif
211 264
212#endif /* __GLIBC__ */ 265#endif /* __GLIBC__ */
213 266
267/* Definitions for if_ether.h */
268/* allow libcs like musl to deactivate this, glibc does not implement this. */
269#ifndef __UAPI_DEF_ETHHDR
270#define __UAPI_DEF_ETHHDR 1
271#endif
272
214#endif /* _UAPI_LIBC_COMPAT_H */ 273#endif /* _UAPI_LIBC_COMPAT_H */
diff --git a/include/uapi/linux/lightnvm.h b/include/uapi/linux/lightnvm.h
index 42d1a434af29..f9a1be7fc696 100644
--- a/include/uapi/linux/lightnvm.h
+++ b/include/uapi/linux/lightnvm.h
@@ -75,14 +75,23 @@ struct nvm_ioctl_create_simple {
75 __u32 lun_end; 75 __u32 lun_end;
76}; 76};
77 77
78struct nvm_ioctl_create_extended {
79 __u16 lun_begin;
80 __u16 lun_end;
81 __u16 op;
82 __u16 rsv;
83};
84
78enum { 85enum {
79 NVM_CONFIG_TYPE_SIMPLE = 0, 86 NVM_CONFIG_TYPE_SIMPLE = 0,
87 NVM_CONFIG_TYPE_EXTENDED = 1,
80}; 88};
81 89
82struct nvm_ioctl_create_conf { 90struct nvm_ioctl_create_conf {
83 __u32 type; 91 __u32 type;
84 union { 92 union {
85 struct nvm_ioctl_create_simple s; 93 struct nvm_ioctl_create_simple s;
94 struct nvm_ioctl_create_extended e;
86 }; 95 };
87}; 96};
88 97
diff --git a/include/uapi/linux/netfilter/nf_conntrack_common.h b/include/uapi/linux/netfilter/nf_conntrack_common.h
index 3fea7709a441..57ccfb32e87f 100644
--- a/include/uapi/linux/netfilter/nf_conntrack_common.h
+++ b/include/uapi/linux/netfilter/nf_conntrack_common.h
@@ -36,7 +36,7 @@ enum ip_conntrack_info {
36 36
37#define NF_CT_STATE_INVALID_BIT (1 << 0) 37#define NF_CT_STATE_INVALID_BIT (1 << 0)
38#define NF_CT_STATE_BIT(ctinfo) (1 << ((ctinfo) % IP_CT_IS_REPLY + 1)) 38#define NF_CT_STATE_BIT(ctinfo) (1 << ((ctinfo) % IP_CT_IS_REPLY + 1))
39#define NF_CT_STATE_UNTRACKED_BIT (1 << (IP_CT_UNTRACKED + 1)) 39#define NF_CT_STATE_UNTRACKED_BIT (1 << 6)
40 40
41/* Bitset representing status of connection. */ 41/* Bitset representing status of connection. */
42enum ip_conntrack_status { 42enum ip_conntrack_status {
diff --git a/include/uapi/linux/nubus.h b/include/uapi/linux/nubus.h
index f3776cc80f4d..48031e7858f1 100644
--- a/include/uapi/linux/nubus.h
+++ b/include/uapi/linux/nubus.h
@@ -221,27 +221,4 @@ enum nubus_display_res_id {
221 NUBUS_RESID_SIXTHMODE = 0x0085 221 NUBUS_RESID_SIXTHMODE = 0x0085
222}; 222};
223 223
224struct nubus_dir
225{
226 unsigned char *base;
227 unsigned char *ptr;
228 int done;
229 int mask;
230};
231
232struct nubus_dirent
233{
234 unsigned char *base;
235 unsigned char type;
236 __u32 data; /* Actually 24bits used */
237 int mask;
238};
239
240
241/* We'd like to get rid of this eventually. Only daynaport.c uses it now. */
242static inline void *nubus_slot_addr(int slot)
243{
244 return (void *)(0xF0000000|(slot<<24));
245}
246
247#endif /* _UAPILINUX_NUBUS_H */ 224#endif /* _UAPILINUX_NUBUS_H */
diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h
index 4265d7f9e1f2..dcfab5e3b55c 100644
--- a/include/uapi/linux/openvswitch.h
+++ b/include/uapi/linux/openvswitch.h
@@ -363,7 +363,6 @@ enum ovs_tunnel_key_attr {
363 OVS_TUNNEL_KEY_ATTR_IPV6_SRC, /* struct in6_addr src IPv6 address. */ 363 OVS_TUNNEL_KEY_ATTR_IPV6_SRC, /* struct in6_addr src IPv6 address. */
364 OVS_TUNNEL_KEY_ATTR_IPV6_DST, /* struct in6_addr dst IPv6 address. */ 364 OVS_TUNNEL_KEY_ATTR_IPV6_DST, /* struct in6_addr dst IPv6 address. */
365 OVS_TUNNEL_KEY_ATTR_PAD, 365 OVS_TUNNEL_KEY_ATTR_PAD,
366 OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTS, /* be32 ERSPAN index. */
367 __OVS_TUNNEL_KEY_ATTR_MAX 366 __OVS_TUNNEL_KEY_ATTR_MAX
368}; 367};
369 368
diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
index b9a4953018ed..c77c9a2ebbbb 100644
--- a/include/uapi/linux/perf_event.h
+++ b/include/uapi/linux/perf_event.h
@@ -612,9 +612,12 @@ struct perf_event_mmap_page {
612 */ 612 */
613#define PERF_RECORD_MISC_PROC_MAP_PARSE_TIMEOUT (1 << 12) 613#define PERF_RECORD_MISC_PROC_MAP_PARSE_TIMEOUT (1 << 12)
614/* 614/*
615 * PERF_RECORD_MISC_MMAP_DATA and PERF_RECORD_MISC_COMM_EXEC are used on 615 * Following PERF_RECORD_MISC_* are used on different
616 * different events so can reuse the same bit position. 616 * events, so can reuse the same bit position:
617 * Ditto PERF_RECORD_MISC_SWITCH_OUT. 617 *
618 * PERF_RECORD_MISC_MMAP_DATA - PERF_RECORD_MMAP* events
619 * PERF_RECORD_MISC_COMM_EXEC - PERF_RECORD_COMM event
620 * PERF_RECORD_MISC_SWITCH_OUT - PERF_RECORD_SWITCH* events
618 */ 621 */
619#define PERF_RECORD_MISC_MMAP_DATA (1 << 13) 622#define PERF_RECORD_MISC_MMAP_DATA (1 << 13)
620#define PERF_RECORD_MISC_COMM_EXEC (1 << 13) 623#define PERF_RECORD_MISC_COMM_EXEC (1 << 13)
@@ -864,6 +867,7 @@ enum perf_event_type {
864 * struct perf_event_header header; 867 * struct perf_event_header header;
865 * u32 pid; 868 * u32 pid;
866 * u32 tid; 869 * u32 tid;
870 * struct sample_id sample_id;
867 * }; 871 * };
868 */ 872 */
869 PERF_RECORD_ITRACE_START = 12, 873 PERF_RECORD_ITRACE_START = 12,
diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
index af3cc2f4e1ad..37b5096ae97b 100644
--- a/include/uapi/linux/pkt_sched.h
+++ b/include/uapi/linux/pkt_sched.h
@@ -256,7 +256,6 @@ struct tc_red_qopt {
256#define TC_RED_ECN 1 256#define TC_RED_ECN 1
257#define TC_RED_HARDDROP 2 257#define TC_RED_HARDDROP 2
258#define TC_RED_ADAPTATIVE 4 258#define TC_RED_ADAPTATIVE 4
259#define TC_RED_OFFLOADED 8
260}; 259};
261 260
262struct tc_red_xstats { 261struct tc_red_xstats {
diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
index d8b5f80c2ea6..843e29aa3cac 100644
--- a/include/uapi/linux/rtnetlink.h
+++ b/include/uapi/linux/rtnetlink.h
@@ -557,6 +557,7 @@ enum {
557 TCA_PAD, 557 TCA_PAD,
558 TCA_DUMP_INVISIBLE, 558 TCA_DUMP_INVISIBLE,
559 TCA_CHAIN, 559 TCA_CHAIN,
560 TCA_HW_OFFLOAD,
560 __TCA_MAX 561 __TCA_MAX
561}; 562};
562 563
diff --git a/include/uapi/linux/sched.h b/include/uapi/linux/sched.h
index 30a9e51bbb1e..22627f80063e 100644
--- a/include/uapi/linux/sched.h
+++ b/include/uapi/linux/sched.h
@@ -49,5 +49,10 @@
49 */ 49 */
50#define SCHED_FLAG_RESET_ON_FORK 0x01 50#define SCHED_FLAG_RESET_ON_FORK 0x01
51#define SCHED_FLAG_RECLAIM 0x02 51#define SCHED_FLAG_RECLAIM 0x02
52#define SCHED_FLAG_DL_OVERRUN 0x04
53
54#define SCHED_FLAG_ALL (SCHED_FLAG_RESET_ON_FORK | \
55 SCHED_FLAG_RECLAIM | \
56 SCHED_FLAG_DL_OVERRUN)
52 57
53#endif /* _UAPI_LINUX_SCHED_H */ 58#endif /* _UAPI_LINUX_SCHED_H */
diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h
index c227ccba60ae..07d61583fd02 100644
--- a/include/uapi/sound/asound.h
+++ b/include/uapi/sound/asound.h
@@ -214,6 +214,11 @@ typedef int __bitwise snd_pcm_format_t;
214#define SNDRV_PCM_FORMAT_IMA_ADPCM ((__force snd_pcm_format_t) 22) 214#define SNDRV_PCM_FORMAT_IMA_ADPCM ((__force snd_pcm_format_t) 22)
215#define SNDRV_PCM_FORMAT_MPEG ((__force snd_pcm_format_t) 23) 215#define SNDRV_PCM_FORMAT_MPEG ((__force snd_pcm_format_t) 23)
216#define SNDRV_PCM_FORMAT_GSM ((__force snd_pcm_format_t) 24) 216#define SNDRV_PCM_FORMAT_GSM ((__force snd_pcm_format_t) 24)
217#define SNDRV_PCM_FORMAT_S20_LE ((__force snd_pcm_format_t) 25) /* in four bytes, LSB justified */
218#define SNDRV_PCM_FORMAT_S20_BE ((__force snd_pcm_format_t) 26) /* in four bytes, LSB justified */
219#define SNDRV_PCM_FORMAT_U20_LE ((__force snd_pcm_format_t) 27) /* in four bytes, LSB justified */
220#define SNDRV_PCM_FORMAT_U20_BE ((__force snd_pcm_format_t) 28) /* in four bytes, LSB justified */
221/* gap in the numbering for a future standard linear format */
217#define SNDRV_PCM_FORMAT_SPECIAL ((__force snd_pcm_format_t) 31) 222#define SNDRV_PCM_FORMAT_SPECIAL ((__force snd_pcm_format_t) 31)
218#define SNDRV_PCM_FORMAT_S24_3LE ((__force snd_pcm_format_t) 32) /* in three bytes */ 223#define SNDRV_PCM_FORMAT_S24_3LE ((__force snd_pcm_format_t) 32) /* in three bytes */
219#define SNDRV_PCM_FORMAT_S24_3BE ((__force snd_pcm_format_t) 33) /* in three bytes */ 224#define SNDRV_PCM_FORMAT_S24_3BE ((__force snd_pcm_format_t) 33) /* in three bytes */
@@ -248,6 +253,8 @@ typedef int __bitwise snd_pcm_format_t;
248#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_LE 253#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_LE
249#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_LE 254#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_LE
250#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE 255#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE
256#define SNDRV_PCM_FORMAT_S20 SNDRV_PCM_FORMAT_S20_LE
257#define SNDRV_PCM_FORMAT_U20 SNDRV_PCM_FORMAT_U20_LE
251#endif 258#endif
252#ifdef SNDRV_BIG_ENDIAN 259#ifdef SNDRV_BIG_ENDIAN
253#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_BE 260#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_BE
@@ -259,6 +266,8 @@ typedef int __bitwise snd_pcm_format_t;
259#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_BE 266#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_BE
260#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_BE 267#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_BE
261#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE 268#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE
269#define SNDRV_PCM_FORMAT_S20 SNDRV_PCM_FORMAT_S20_BE
270#define SNDRV_PCM_FORMAT_U20 SNDRV_PCM_FORMAT_U20_BE
262#endif 271#endif
263 272
264typedef int __bitwise snd_pcm_subformat_t; 273typedef int __bitwise snd_pcm_subformat_t;
diff --git a/include/uapi/sound/snd_sst_tokens.h b/include/uapi/sound/snd_sst_tokens.h
index 326054a72bc7..8ba0112e5336 100644
--- a/include/uapi/sound/snd_sst_tokens.h
+++ b/include/uapi/sound/snd_sst_tokens.h
@@ -222,6 +222,17 @@
222 * %SKL_TKN_MM_U32_NUM_IN_FMT: Number of input formats 222 * %SKL_TKN_MM_U32_NUM_IN_FMT: Number of input formats
223 * %SKL_TKN_MM_U32_NUM_OUT_FMT: Number of output formats 223 * %SKL_TKN_MM_U32_NUM_OUT_FMT: Number of output formats
224 * 224 *
225 * %SKL_TKN_U32_ASTATE_IDX: Table Index for the A-State entry to be filled
226 * with kcps and clock source
227 *
228 * %SKL_TKN_U32_ASTATE_COUNT: Number of valid entries in A-State table
229 *
230 * %SKL_TKN_U32_ASTATE_KCPS: Specifies the core load threshold (in kilo
231 * cycles per second) below which DSP is clocked
232 * from source specified by clock source.
233 *
234 * %SKL_TKN_U32_ASTATE_CLK_SRC: Clock source for A-State entry
235 *
225 * module_id and loadable flags dont have tokens as these values will be 236 * module_id and loadable flags dont have tokens as these values will be
226 * read from the DSP FW manifest 237 * read from the DSP FW manifest
227 * 238 *
@@ -309,7 +320,11 @@ enum SKL_TKNS {
309 SKL_TKN_MM_U32_NUM_IN_FMT, 320 SKL_TKN_MM_U32_NUM_IN_FMT,
310 SKL_TKN_MM_U32_NUM_OUT_FMT, 321 SKL_TKN_MM_U32_NUM_OUT_FMT,
311 322
312 SKL_TKN_MAX = SKL_TKN_MM_U32_NUM_OUT_FMT, 323 SKL_TKN_U32_ASTATE_IDX,
324 SKL_TKN_U32_ASTATE_COUNT,
325 SKL_TKN_U32_ASTATE_KCPS,
326 SKL_TKN_U32_ASTATE_CLK_SRC,
327 SKL_TKN_MAX = SKL_TKN_U32_ASTATE_CLK_SRC,
313}; 328};
314 329
315#endif 330#endif
diff --git a/include/xen/balloon.h b/include/xen/balloon.h
index 4914b93a23f2..61f410fd74e4 100644
--- a/include/xen/balloon.h
+++ b/include/xen/balloon.h
@@ -44,3 +44,8 @@ static inline void xen_balloon_init(void)
44{ 44{
45} 45}
46#endif 46#endif
47
48#ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG
49struct resource;
50void arch_xen_balloon_init(struct resource *hostmem_resource);
51#endif