aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/acpi.h24
-rw-r--r--include/linux/acpi_gpio.h51
-rw-r--r--include/linux/acpi_io.h18
-rw-r--r--include/linux/ath9k_platform.h2
-rw-r--r--include/linux/audit.h22
-rw-r--r--include/linux/auxvec.h2
-rw-r--r--include/linux/bcma/bcma.h9
-rw-r--r--include/linux/bcma/bcma_driver_chipcommon.h1
-rw-r--r--include/linux/binfmts.h1
-rw-r--r--include/linux/bio.h295
-rw-r--r--include/linux/blk-mq.h22
-rw-r--r--include/linux/blk_types.h24
-rw-r--r--include/linux/blkdev.h26
-rw-r--r--include/linux/bootmem.h190
-rw-r--r--include/linux/bottom_half.h32
-rw-r--r--include/linux/cache.h4
-rw-r--r--include/linux/can/skb.h38
-rw-r--r--include/linux/ccp.h537
-rw-r--r--include/linux/ceph/buffer.h1
-rw-r--r--include/linux/ceph/ceph_features.h101
-rw-r--r--include/linux/ceph/ceph_fs.h36
-rw-r--r--include/linux/ceph/decode.h17
-rw-r--r--include/linux/ceph/libceph.h19
-rw-r--r--include/linux/ceph/messenger.h17
-rw-r--r--include/linux/ceph/osd_client.h19
-rw-r--r--include/linux/ceph/osdmap.h66
-rw-r--r--include/linux/ceph/rados.h4
-rw-r--r--include/linux/cgroup.h112
-rw-r--r--include/linux/cgroup_subsys.h4
-rw-r--r--include/linux/clk-private.h8
-rw-r--r--include/linux/clk-provider.h48
-rw-r--r--include/linux/clk.h17
-rw-r--r--include/linux/clk/at91_pmc.h192
-rw-r--r--include/linux/clk/shmobile.h19
-rw-r--r--include/linux/clk/tegra.h7
-rw-r--r--include/linux/clk/ti.h298
-rw-r--r--include/linux/clkdev.h5
-rw-r--r--include/linux/cmdline-parser.h8
-rw-r--r--include/linux/compaction.h16
-rw-r--r--include/linux/compat.h20
-rw-r--r--include/linux/compiler-gcc.h3
-rw-r--r--include/linux/compiler-gcc4.h6
-rw-r--r--include/linux/compiler-intel.h7
-rw-r--r--include/linux/compiler.h13
-rw-r--r--include/linux/component.h32
-rw-r--r--include/linux/container.h25
-rw-r--r--include/linux/context_tracking.h10
-rw-r--r--include/linux/context_tracking_state.h11
-rw-r--r--include/linux/cpu_cooling.h25
-rw-r--r--include/linux/cpufreq.h42
-rw-r--r--include/linux/cramfs_fs.h10
-rw-r--r--include/linux/cramfs_fs_sb.h20
-rw-r--r--include/linux/crash_dump.h2
-rw-r--r--include/linux/crush/crush.h20
-rw-r--r--include/linux/crush/mapper.h3
-rw-r--r--include/linux/dm-io.h4
-rw-r--r--include/linux/dma-debug.h6
-rw-r--r--include/linux/dma_remapping.h4
-rw-r--r--include/linux/dmaengine.h52
-rw-r--r--include/linux/dmar.h13
-rw-r--r--include/linux/edac.h28
-rw-r--r--include/linux/efi.h17
-rw-r--r--include/linux/etherdevice.h118
-rw-r--r--include/linux/export.h1
-rw-r--r--include/linux/extcon/extcon-gpio.h1
-rw-r--r--include/linux/f2fs_fs.h7
-rw-r--r--include/linux/fb.h4
-rw-r--r--include/linux/fdtable.h35
-rw-r--r--include/linux/filter.h5
-rw-r--r--include/linux/firmware.h7
-rw-r--r--include/linux/flex_array.h3
-rw-r--r--include/linux/fs.h10
-rw-r--r--include/linux/fsnotify_backend.h126
-rw-r--r--include/linux/ftrace.h2
-rw-r--r--include/linux/ftrace_event.h139
-rw-r--r--include/linux/genalloc.h2
-rw-r--r--include/linux/generic_acl.h14
-rw-r--r--include/linux/gfp.h1
-rw-r--r--include/linux/gpio.h1
-rw-r--r--include/linux/gpio/consumer.h4
-rw-r--r--include/linux/gpio/driver.h56
-rw-r--r--include/linux/hardirq.h1
-rw-r--r--include/linux/hash.h36
-rw-r--r--include/linux/hid-sensor-ids.h12
-rw-r--r--include/linux/host1x.h6
-rw-r--r--include/linux/huge_mm.h23
-rw-r--r--include/linux/hugetlb.h8
-rw-r--r--include/linux/hugetlb_cgroup.h5
-rw-r--r--include/linux/hyperv.h2
-rw-r--r--include/linux/i2c-pnx.h1
-rw-r--r--include/linux/i2c-smbus.h2
-rw-r--r--include/linux/i2c.h18
-rw-r--r--include/linux/i2c/tsc2007.h8
-rw-r--r--include/linux/i2c/twl.h5
-rw-r--r--include/linux/ide.h8
-rw-r--r--include/linux/ieee80211.h10
-rw-r--r--include/linux/if_macvlan.h37
-rw-r--r--include/linux/if_tunnel.h9
-rw-r--r--include/linux/if_vlan.h38
-rw-r--r--include/linux/iio/buffer.h3
-rw-r--r--include/linux/iio/events.h4
-rw-r--r--include/linux/iio/iio.h115
-rw-r--r--include/linux/iio/types.h1
-rw-r--r--include/linux/inet_lro.h23
-rw-r--r--include/linux/inetdevice.h14
-rw-r--r--include/linux/init.h2
-rw-r--r--include/linux/init_task.h14
-rw-r--r--include/linux/intel-iommu.h3
-rw-r--r--include/linux/interrupt.h7
-rw-r--r--include/linux/iommu.h16
-rw-r--r--include/linux/ipc.h2
-rw-r--r--include/linux/ipc_namespace.h1
-rw-r--r--include/linux/ipv6.h8
-rw-r--r--include/linux/irqchip/arm-gic.h12
-rw-r--r--include/linux/irqchip/xtensa-mx.h17
-rw-r--r--include/linux/irqchip/xtensa-pic.h18
-rw-r--r--include/linux/irqdesc.h8
-rw-r--r--include/linux/iscsi_ibft.h2
-rw-r--r--include/linux/jiffies.h6
-rw-r--r--include/linux/jump_label.h19
-rw-r--r--include/linux/kernel.h41
-rw-r--r--include/linux/kernfs.h376
-rw-r--r--include/linux/kexec.h1
-rw-r--r--include/linux/kgdb.h3
-rw-r--r--include/linux/kobj_completion.h18
-rw-r--r--include/linux/kobject.h2
-rw-r--r--include/linux/ksm.h15
-rw-r--r--include/linux/kvm_host.h20
-rw-r--r--include/linux/libata.h3
-rw-r--r--include/linux/linkage.h19
-rw-r--r--include/linux/lockref.h2
-rw-r--r--include/linux/math64.h30
-rw-r--r--include/linux/mdio.h3
-rw-r--r--include/linux/memblock.h55
-rw-r--r--include/linux/memcontrol.h23
-rw-r--r--include/linux/memory.h1
-rw-r--r--include/linux/mempolicy.h32
-rw-r--r--include/linux/mfd/abx500/ab8500-gpio.h33
-rw-r--r--include/linux/mfd/abx500/ab8500.h2
-rw-r--r--include/linux/mfd/arizona/registers.h198
-rw-r--r--include/linux/mfd/as3722.h5
-rw-r--r--include/linux/mfd/lp3943.h114
-rw-r--r--include/linux/mfd/max14577-private.h330
-rw-r--r--include/linux/mfd/max14577.h69
-rw-r--r--include/linux/mfd/max77686-private.h2
-rw-r--r--include/linux/mfd/max8997-private.h2
-rw-r--r--include/linux/mfd/max8998-private.h2
-rw-r--r--include/linux/mfd/mc13xxx.h39
-rw-r--r--include/linux/mfd/samsung/core.h6
-rw-r--r--include/linux/mfd/samsung/s5m8767.h18
-rw-r--r--include/linux/mfd/syscon/imx6q-iomuxc-gpr.h1
-rw-r--r--include/linux/mfd/ti_am335x_tscadc.h8
-rw-r--r--include/linux/mfd/tmio.h8
-rw-r--r--include/linux/mfd/tps6586x.h7
-rw-r--r--include/linux/mfd/tps65910.h5
-rw-r--r--include/linux/migrate.h18
-rw-r--r--include/linux/miscdevice.h1
-rw-r--r--include/linux/mlx4/cmd.h2
-rw-r--r--include/linux/mlx4/cq.h20
-rw-r--r--include/linux/mlx4/device.h44
-rw-r--r--include/linux/mlx4/qp.h6
-rw-r--r--include/linux/mlx5/cq.h18
-rw-r--r--include/linux/mlx5/device.h31
-rw-r--r--include/linux/mlx5/driver.h3
-rw-r--r--include/linux/mlx5/qp.h45
-rw-r--r--include/linux/mm.h101
-rw-r--r--include/linux/mm_types.h52
-rw-r--r--include/linux/mman.h1
-rw-r--r--include/linux/mmc/card.h8
-rw-r--r--include/linux/mmc/sdhci.h2
-rw-r--r--include/linux/mmc/sdio_ids.h9
-rw-r--r--include/linux/mmc/tmio.h1
-rw-r--r--include/linux/mmdebug.h9
-rw-r--r--include/linux/mmzone.h11
-rw-r--r--include/linux/module.h64
-rw-r--r--include/linux/msg.h2
-rw-r--r--include/linux/msi.h4
-rw-r--r--include/linux/mtd/mtdram.h2
-rw-r--r--include/linux/mtd/nand.h41
-rw-r--r--include/linux/mtd/partitions.h8
-rw-r--r--include/linux/net.h3
-rw-r--r--include/linux/netdevice.h190
-rw-r--r--include/linux/netfilter/ipset/ip_set.h1
-rw-r--r--include/linux/netlink.h2
-rw-r--r--include/linux/nfs_fs.h25
-rw-r--r--include/linux/nfs_xdr.h2
-rw-r--r--include/linux/nls.h3
-rw-r--r--include/linux/nvme.h6
-rw-r--r--include/linux/of.h154
-rw-r--r--include/linux/of_device.h10
-rw-r--r--include/linux/of_fdt.h1
-rw-r--r--include/linux/of_mdio.h10
-rw-r--r--include/linux/of_mtd.h2
-rw-r--r--include/linux/page-flags.h14
-rw-r--r--include/linux/pagemap.h10
-rw-r--r--include/linux/parser.h1
-rw-r--r--include/linux/pci-ats.h17
-rw-r--r--include/linux/pci.h352
-rw-r--r--include/linux/pci_hotplug.h3
-rw-r--r--include/linux/percpu-defs.h1
-rw-r--r--include/linux/percpu.h1
-rw-r--r--include/linux/percpu_ida.h3
-rw-r--r--include/linux/perf_event.h1
-rw-r--r--include/linux/phy.h116
-rw-r--r--include/linux/phy/phy.h42
-rw-r--r--include/linux/pinctrl/pinconf-generic.h10
-rw-r--r--include/linux/pinctrl/pinctrl.h2
-rw-r--r--include/linux/pipe_fs_i.h2
-rw-r--r--include/linux/platform_data/asoc-ti-mcbsp.h6
-rw-r--r--include/linux/platform_data/asoc-ux500-msp.h9
-rw-r--r--include/linux/platform_data/clocksource-nomadik-mtu.h9
-rw-r--r--include/linux/platform_data/davinci_asp.h1
-rw-r--r--include/linux/platform_data/dma-imx-sdma.h5
-rw-r--r--include/linux/platform_data/dma-imx.h1
-rw-r--r--include/linux/platform_data/dma-mmp_tdma.h8
-rw-r--r--include/linux/platform_data/dma-mv_xor.h6
-rw-r--r--include/linux/platform_data/eth-netx.h6
-rw-r--r--include/linux/platform_data/gpio-davinci.h3
-rw-r--r--include/linux/platform_data/gpio-lpc32xx.h50
-rw-r--r--include/linux/platform_data/hwmon-s3c.h10
-rw-r--r--include/linux/platform_data/i2c-nomadik.h39
-rw-r--r--include/linux/platform_data/keypad-ep93xx.h10
-rw-r--r--include/linux/platform_data/keypad-omap.h6
-rw-r--r--include/linux/platform_data/leds-kirkwood-netxbig.h8
-rw-r--r--include/linux/platform_data/leds-kirkwood-ns2.h8
-rw-r--r--include/linux/platform_data/max197.h5
-rw-r--r--include/linux/platform_data/mfd-mcp-sa11x0.h6
-rw-r--r--include/linux/platform_data/mtd-nand-omap2.h2
-rw-r--r--include/linux/platform_data/mtd-nand-pxa3xx.h3
-rw-r--r--include/linux/platform_data/mtd-onenand-omap2.h2
-rw-r--r--include/linux/platform_data/mtd-orion_nand.h6
-rw-r--r--include/linux/platform_data/pinctrl-nomadik.h242
-rw-r--r--include/linux/platform_data/pn544.h3
-rw-r--r--include/linux/platform_data/sht15.h5
-rw-r--r--include/linux/platform_data/si5351.h16
-rw-r--r--include/linux/platform_data/spi-nuc900.h8
-rw-r--r--include/linux/platform_data/usb-ehci-orion.h6
-rw-r--r--include/linux/platform_data/usb-omap1.h53
-rw-r--r--include/linux/platform_data/video-ep93xx.h10
-rw-r--r--include/linux/platform_data/video-msm_fb.h3
-rw-r--r--include/linux/platform_data/video-pxafb.h2
-rw-r--r--include/linux/platform_data/vsp1.h2
-rw-r--r--include/linux/pm.h21
-rw-r--r--include/linux/pm_runtime.h12
-rw-r--r--include/linux/posix_acl.h100
-rw-r--r--include/linux/posix_acl_xattr.h3
-rw-r--r--include/linux/power/bq2415x_charger.h48
-rw-r--r--include/linux/power/charger-manager.h34
-rw-r--r--include/linux/power/isp1704_charger.h1
-rw-r--r--include/linux/power_supply.h16
-rw-r--r--include/linux/preempt.h32
-rw-r--r--include/linux/preempt_mask.h16
-rw-r--r--include/linux/printk.h26
-rw-r--r--include/linux/projid.h15
-rw-r--r--include/linux/pstore.h3
-rw-r--r--include/linux/ramfs.h7
-rw-r--r--include/linux/random.h18
-rw-r--r--include/linux/rculist.h4
-rw-r--r--include/linux/rcupdate.h153
-rw-r--r--include/linux/rcutiny.h2
-rw-r--r--include/linux/rcutree.h36
-rw-r--r--include/linux/reboot.h1
-rw-r--r--include/linux/reciprocal_div.h39
-rw-r--r--include/linux/regmap.h15
-rw-r--r--include/linux/regulator/act8865.h53
-rw-r--r--include/linux/reset-controller.h1
-rw-r--r--include/linux/rmap.h27
-rw-r--r--include/linux/rtmutex.h18
-rw-r--r--include/linux/rtnetlink.h5
-rw-r--r--include/linux/rwlock_api_smp.h12
-rw-r--r--include/linux/rwsem.h11
-rw-r--r--include/linux/scatterlist.h1
-rw-r--r--include/linux/sched.h191
-rw-r--r--include/linux/sched/deadline.h24
-rw-r--r--include/linux/sched/rt.h5
-rw-r--r--include/linux/sched/sysctl.h7
-rw-r--r--include/linux/sctp.h7
-rw-r--r--include/linux/seqlock.h27
-rw-r--r--include/linux/serial_bcm63xx.h119
-rw-r--r--include/linux/serial_sci.h52
-rw-r--r--include/linux/sfi_acpi.h5
-rw-r--r--include/linux/sh_eth.h1
-rw-r--r--include/linux/shm.h2
-rw-r--r--include/linux/skbuff.h239
-rw-r--r--include/linux/slab.h17
-rw-r--r--include/linux/slab_def.h4
-rw-r--r--include/linux/smp.h9
-rw-r--r--include/linux/socket.h16
-rw-r--r--include/linux/spi/74x164.h9
-rw-r--r--include/linux/spi/s3c24xx.h2
-rw-r--r--include/linux/spi/spi.h25
-rw-r--r--include/linux/spinlock.h10
-rw-r--r--include/linux/spinlock_api_smp.h12
-rw-r--r--include/linux/spinlock_api_up.h16
-rw-r--r--include/linux/splice.h3
-rw-r--r--include/linux/ssb/ssb.h1
-rw-r--r--include/linux/ssbi.h19
-rw-r--r--include/linux/stmmac.h26
-rw-r--r--include/linux/sunrpc/rpc_pipe_fs.h5
-rw-r--r--include/linux/sunrpc/svc.h6
-rw-r--r--include/linux/syscalls.h6
-rw-r--r--include/linux/sysfs.h47
-rw-r--r--include/linux/tboot.h2
-rw-r--r--include/linux/tcp.h5
-rw-r--r--include/linux/tegra-powergate.h55
-rw-r--r--include/linux/thermal.h32
-rw-r--r--include/linux/tick.h8
-rw-r--r--include/linux/tpm.h12
-rw-r--r--include/linux/tty.h9
-rw-r--r--include/linux/tty_flip.h11
-rw-r--r--include/linux/tty_ldisc.h6
-rw-r--r--include/linux/uaccess.h5
-rw-r--r--include/linux/uidgid.h22
-rw-r--r--include/linux/uprobes.h52
-rw-r--r--include/linux/usb.h3
-rw-r--r--include/linux/usb/chipidea.h1
-rw-r--r--include/linux/usb/composite.h2
-rw-r--r--include/linux/usb/functionfs.h30
-rw-r--r--include/linux/usb/gadget.h58
-rw-r--r--include/linux/usb/hcd.h3
-rw-r--r--include/linux/usb/msm_hsusb.h3
-rw-r--r--include/linux/usb/musb.h3
-rw-r--r--include/linux/usb/omap_control_usb.h6
-rw-r--r--include/linux/usb/otg-fsm.h244
-rw-r--r--include/linux/uwb/umc.h2
-rw-r--r--include/linux/vm_event_item.h4
-rw-r--r--include/linux/vme.h3
-rw-r--r--include/linux/vmpressure.h8
-rw-r--r--include/linux/vmstat.h10
-rw-r--r--include/linux/vtime.h4
-rw-r--r--include/linux/w1-gpio.h1
-rw-r--r--include/linux/zorro.h121
-rw-r--r--include/linux/zorro_ids.h552
-rw-r--r--include/linux/zsmalloc.h51
334 files changed, 6872 insertions, 3382 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index d9099b15b472..1151a1dcfe41 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -42,6 +42,7 @@
42#include <acpi/acpi_bus.h> 42#include <acpi/acpi_bus.h>
43#include <acpi/acpi_drivers.h> 43#include <acpi/acpi_drivers.h>
44#include <acpi/acpi_numa.h> 44#include <acpi/acpi_numa.h>
45#include <acpi/acpi_io.h>
45#include <asm/acpi.h> 46#include <asm/acpi.h>
46 47
47static inline acpi_handle acpi_device_handle(struct acpi_device *adev) 48static inline acpi_handle acpi_device_handle(struct acpi_device *adev)
@@ -53,6 +54,12 @@ static inline acpi_handle acpi_device_handle(struct acpi_device *adev)
53#define ACPI_COMPANION_SET(dev, adev) ACPI_COMPANION(dev) = (adev) 54#define ACPI_COMPANION_SET(dev, adev) ACPI_COMPANION(dev) = (adev)
54#define ACPI_HANDLE(dev) acpi_device_handle(ACPI_COMPANION(dev)) 55#define ACPI_HANDLE(dev) acpi_device_handle(ACPI_COMPANION(dev))
55 56
57static inline void acpi_preset_companion(struct device *dev,
58 struct acpi_device *parent, u64 addr)
59{
60 ACPI_COMPANION_SET(dev, acpi_find_child_device(parent, addr, NULL));
61}
62
56static inline const char *acpi_dev_name(struct acpi_device *adev) 63static inline const char *acpi_dev_name(struct acpi_device *adev)
57{ 64{
58 return dev_name(&adev->dev); 65 return dev_name(&adev->dev);
@@ -409,6 +416,9 @@ static inline bool acpi_driver_match_device(struct device *dev,
409 return !!acpi_match_device(drv->acpi_match_table, dev); 416 return !!acpi_match_device(drv->acpi_match_table, dev);
410} 417}
411 418
419int acpi_device_uevent_modalias(struct device *, struct kobj_uevent_env *);
420int acpi_device_modalias(struct device *, char *, int);
421
412#define ACPI_PTR(_ptr) (_ptr) 422#define ACPI_PTR(_ptr) (_ptr)
413 423
414#else /* !CONFIG_ACPI */ 424#else /* !CONFIG_ACPI */
@@ -460,7 +470,7 @@ struct acpi_table_header;
460static inline int acpi_table_parse(char *id, 470static inline int acpi_table_parse(char *id,
461 int (*handler)(struct acpi_table_header *)) 471 int (*handler)(struct acpi_table_header *))
462{ 472{
463 return -1; 473 return -ENODEV;
464} 474}
465 475
466static inline int acpi_nvs_register(__u64 start, __u64 size) 476static inline int acpi_nvs_register(__u64 start, __u64 size)
@@ -488,6 +498,18 @@ static inline bool acpi_driver_match_device(struct device *dev,
488 return false; 498 return false;
489} 499}
490 500
501static inline int acpi_device_uevent_modalias(struct device *dev,
502 struct kobj_uevent_env *env)
503{
504 return -ENODEV;
505}
506
507static inline int acpi_device_modalias(struct device *dev,
508 char *buf, int size)
509{
510 return -ENODEV;
511}
512
491#define ACPI_PTR(_ptr) (NULL) 513#define ACPI_PTR(_ptr) (NULL)
492 514
493#endif /* !CONFIG_ACPI */ 515#endif /* !CONFIG_ACPI */
diff --git a/include/linux/acpi_gpio.h b/include/linux/acpi_gpio.h
deleted file mode 100644
index d875bc3dba3c..000000000000
--- a/include/linux/acpi_gpio.h
+++ /dev/null
@@ -1,51 +0,0 @@
1#ifndef _LINUX_ACPI_GPIO_H_
2#define _LINUX_ACPI_GPIO_H_
3
4#include <linux/device.h>
5#include <linux/err.h>
6#include <linux/errno.h>
7#include <linux/gpio.h>
8#include <linux/gpio/consumer.h>
9
10/**
11 * struct acpi_gpio_info - ACPI GPIO specific information
12 * @gpioint: if %true this GPIO is of type GpioInt otherwise type is GpioIo
13 * @active_low: in case of @gpioint, the pin is active low
14 */
15struct acpi_gpio_info {
16 bool gpioint;
17 bool active_low;
18};
19
20#ifdef CONFIG_GPIO_ACPI
21
22struct gpio_desc *acpi_get_gpiod_by_index(struct device *dev, int index,
23 struct acpi_gpio_info *info);
24void acpi_gpiochip_request_interrupts(struct gpio_chip *chip);
25void acpi_gpiochip_free_interrupts(struct gpio_chip *chip);
26
27#else /* CONFIG_GPIO_ACPI */
28
29static inline struct gpio_desc *
30acpi_get_gpiod_by_index(struct device *dev, int index,
31 struct acpi_gpio_info *info)
32{
33 return ERR_PTR(-ENOSYS);
34}
35
36static inline void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) { }
37static inline void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) { }
38
39#endif /* CONFIG_GPIO_ACPI */
40
41static inline int acpi_get_gpio_by_index(struct device *dev, int index,
42 struct acpi_gpio_info *info)
43{
44 struct gpio_desc *desc = acpi_get_gpiod_by_index(dev, index, info);
45
46 if (IS_ERR(desc))
47 return PTR_ERR(desc);
48 return desc_to_gpio(desc);
49}
50
51#endif /* _LINUX_ACPI_GPIO_H_ */
diff --git a/include/linux/acpi_io.h b/include/linux/acpi_io.h
deleted file mode 100644
index b0ffa219993e..000000000000
--- a/include/linux/acpi_io.h
+++ /dev/null
@@ -1,18 +0,0 @@
1#ifndef _ACPI_IO_H_
2#define _ACPI_IO_H_
3
4#include <linux/io.h>
5#include <acpi/acpi.h>
6
7static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys,
8 acpi_size size)
9{
10 return ioremap_cache(phys, size);
11}
12
13void __iomem *acpi_os_get_iomem(acpi_physical_address phys, unsigned int size);
14
15int acpi_os_map_generic_address(struct acpi_generic_address *addr);
16void acpi_os_unmap_generic_address(struct acpi_generic_address *addr);
17
18#endif
diff --git a/include/linux/ath9k_platform.h b/include/linux/ath9k_platform.h
index fcdd81bd5314..8598f8eacb20 100644
--- a/include/linux/ath9k_platform.h
+++ b/include/linux/ath9k_platform.h
@@ -32,6 +32,8 @@ struct ath9k_platform_data {
32 u32 gpio_val; 32 u32 gpio_val;
33 33
34 bool is_clk_25mhz; 34 bool is_clk_25mhz;
35 bool tx_gain_buffalo;
36
35 int (*get_mac_revision)(void); 37 int (*get_mac_revision)(void);
36 int (*external_reset)(void); 38 int (*external_reset)(void);
37}; 39};
diff --git a/include/linux/audit.h b/include/linux/audit.h
index a40641954c29..aa865a9a4c4f 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -137,7 +137,7 @@ static inline void audit_syscall_exit(void *pt_regs)
137{ 137{
138 if (unlikely(current->audit_context)) { 138 if (unlikely(current->audit_context)) {
139 int success = is_syscall_success(pt_regs); 139 int success = is_syscall_success(pt_regs);
140 int return_code = regs_return_value(pt_regs); 140 long return_code = regs_return_value(pt_regs);
141 141
142 __audit_syscall_exit(success, return_code); 142 __audit_syscall_exit(success, return_code);
143 } 143 }
@@ -202,7 +202,7 @@ static inline kuid_t audit_get_loginuid(struct task_struct *tsk)
202 return tsk->loginuid; 202 return tsk->loginuid;
203} 203}
204 204
205static inline int audit_get_sessionid(struct task_struct *tsk) 205static inline unsigned int audit_get_sessionid(struct task_struct *tsk)
206{ 206{
207 return tsk->sessionid; 207 return tsk->sessionid;
208} 208}
@@ -220,7 +220,7 @@ extern void __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat);
220extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm, 220extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm,
221 const struct cred *new, 221 const struct cred *new,
222 const struct cred *old); 222 const struct cred *old);
223extern void __audit_log_capset(pid_t pid, const struct cred *new, const struct cred *old); 223extern void __audit_log_capset(const struct cred *new, const struct cred *old);
224extern void __audit_mmap_fd(int fd, int flags); 224extern void __audit_mmap_fd(int fd, int flags);
225 225
226static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp) 226static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp)
@@ -285,11 +285,11 @@ static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm,
285 return 0; 285 return 0;
286} 286}
287 287
288static inline void audit_log_capset(pid_t pid, const struct cred *new, 288static inline void audit_log_capset(const struct cred *new,
289 const struct cred *old) 289 const struct cred *old)
290{ 290{
291 if (unlikely(!audit_dummy_context())) 291 if (unlikely(!audit_dummy_context()))
292 __audit_log_capset(pid, new, old); 292 __audit_log_capset(new, old);
293} 293}
294 294
295static inline void audit_mmap_fd(int fd, int flags) 295static inline void audit_mmap_fd(int fd, int flags)
@@ -359,7 +359,7 @@ static inline kuid_t audit_get_loginuid(struct task_struct *tsk)
359{ 359{
360 return INVALID_UID; 360 return INVALID_UID;
361} 361}
362static inline int audit_get_sessionid(struct task_struct *tsk) 362static inline unsigned int audit_get_sessionid(struct task_struct *tsk)
363{ 363{
364 return -1; 364 return -1;
365} 365}
@@ -397,8 +397,8 @@ static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm,
397{ 397{
398 return 0; 398 return 0;
399} 399}
400static inline void audit_log_capset(pid_t pid, const struct cred *new, 400static inline void audit_log_capset(const struct cred *new,
401 const struct cred *old) 401 const struct cred *old)
402{ } 402{ }
403static inline void audit_mmap_fd(int fd, int flags) 403static inline void audit_mmap_fd(int fd, int flags)
404{ } 404{ }
@@ -461,9 +461,11 @@ extern int audit_update_lsm_rules(void);
461 /* Private API (for audit.c only) */ 461 /* Private API (for audit.c only) */
462extern int audit_filter_user(int type); 462extern int audit_filter_user(int type);
463extern int audit_filter_type(int type); 463extern int audit_filter_type(int type);
464extern int audit_receive_filter(int type, int pid, int seq, 464extern int audit_rule_change(int type, __u32 portid, int seq,
465 void *data, size_t datasz); 465 void *data, size_t datasz);
466extern int audit_enabled; 466extern int audit_list_rules_send(__u32 portid, int seq);
467
468extern u32 audit_enabled;
467#else /* CONFIG_AUDIT */ 469#else /* CONFIG_AUDIT */
468static inline __printf(4, 5) 470static inline __printf(4, 5)
469void audit_log(struct audit_context *ctx, gfp_t gfp_mask, int type, 471void audit_log(struct audit_context *ctx, gfp_t gfp_mask, int type,
diff --git a/include/linux/auxvec.h b/include/linux/auxvec.h
index 669fef5c745a..3e0fbe441763 100644
--- a/include/linux/auxvec.h
+++ b/include/linux/auxvec.h
@@ -3,6 +3,6 @@
3 3
4#include <uapi/linux/auxvec.h> 4#include <uapi/linux/auxvec.h>
5 5
6#define AT_VECTOR_SIZE_BASE 19 /* NEW_AUX_ENT entries in auxiliary table */ 6#define AT_VECTOR_SIZE_BASE 20 /* NEW_AUX_ENT entries in auxiliary table */
7 /* number of "#define AT_.*" above, minus {AT_NULL, AT_IGNORE, AT_NOTELF} */ 7 /* number of "#define AT_.*" above, minus {AT_NULL, AT_IGNORE, AT_NOTELF} */
8#endif /* _LINUX_AUXVEC_H */ 8#endif /* _LINUX_AUXVEC_H */
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 4d043c30216f..0b3bb16c705a 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -418,7 +418,14 @@ static inline void bcma_maskset16(struct bcma_device *cc,
418 bcma_write16(cc, offset, (bcma_read16(cc, offset) & mask) | set); 418 bcma_write16(cc, offset, (bcma_read16(cc, offset) & mask) | set);
419} 419}
420 420
421extern struct bcma_device *bcma_find_core(struct bcma_bus *bus, u16 coreid); 421extern struct bcma_device *bcma_find_core_unit(struct bcma_bus *bus, u16 coreid,
422 u8 unit);
423static inline struct bcma_device *bcma_find_core(struct bcma_bus *bus,
424 u16 coreid)
425{
426 return bcma_find_core_unit(bus, coreid, 0);
427}
428
422extern bool bcma_core_is_enabled(struct bcma_device *core); 429extern bool bcma_core_is_enabled(struct bcma_device *core);
423extern void bcma_core_disable(struct bcma_device *core, u32 flags); 430extern void bcma_core_disable(struct bcma_device *core, u32 flags);
424extern int bcma_core_enable(struct bcma_device *core, u32 flags); 431extern int bcma_core_enable(struct bcma_device *core, u32 flags);
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h
index c49e1a159e6e..63d105cd14a3 100644
--- a/include/linux/bcma/bcma_driver_chipcommon.h
+++ b/include/linux/bcma/bcma_driver_chipcommon.h
@@ -640,6 +640,7 @@ struct bcma_drv_cc {
640 spinlock_t gpio_lock; 640 spinlock_t gpio_lock;
641#ifdef CONFIG_BCMA_DRIVER_GPIO 641#ifdef CONFIG_BCMA_DRIVER_GPIO
642 struct gpio_chip gpio; 642 struct gpio_chip gpio;
643 struct irq_domain *irq_domain;
643#endif 644#endif
644}; 645};
645 646
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index fd8bf3219ef7..b4a745d7d9a9 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -115,7 +115,6 @@ extern int copy_strings_kernel(int argc, const char *const *argv,
115extern int prepare_bprm_creds(struct linux_binprm *bprm); 115extern int prepare_bprm_creds(struct linux_binprm *bprm);
116extern void install_exec_creds(struct linux_binprm *bprm); 116extern void install_exec_creds(struct linux_binprm *bprm);
117extern void set_binfmt(struct linux_binfmt *new); 117extern void set_binfmt(struct linux_binfmt *new);
118extern void free_bprm(struct linux_binprm *);
119extern ssize_t read_code(struct file *, unsigned long, loff_t, size_t); 118extern ssize_t read_code(struct file *, unsigned long, loff_t, size_t);
120 119
121#endif /* _LINUX_BINFMTS_H */ 120#endif /* _LINUX_BINFMTS_H */
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 060ff695085c..5a4d39b4686b 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -61,25 +61,87 @@
61 * various member access, note that bio_data should of course not be used 61 * various member access, note that bio_data should of course not be used
62 * on highmem page vectors 62 * on highmem page vectors
63 */ 63 */
64#define bio_iovec_idx(bio, idx) (&((bio)->bi_io_vec[(idx)])) 64#define __bvec_iter_bvec(bvec, iter) (&(bvec)[(iter).bi_idx])
65#define bio_iovec(bio) bio_iovec_idx((bio), (bio)->bi_idx) 65
66#define bio_page(bio) bio_iovec((bio))->bv_page 66#define bvec_iter_page(bvec, iter) \
67#define bio_offset(bio) bio_iovec((bio))->bv_offset 67 (__bvec_iter_bvec((bvec), (iter))->bv_page)
68#define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx) 68
69#define bio_sectors(bio) ((bio)->bi_size >> 9) 69#define bvec_iter_len(bvec, iter) \
70#define bio_end_sector(bio) ((bio)->bi_sector + bio_sectors((bio))) 70 min((iter).bi_size, \
71 __bvec_iter_bvec((bvec), (iter))->bv_len - (iter).bi_bvec_done)
72
73#define bvec_iter_offset(bvec, iter) \
74 (__bvec_iter_bvec((bvec), (iter))->bv_offset + (iter).bi_bvec_done)
75
76#define bvec_iter_bvec(bvec, iter) \
77((struct bio_vec) { \
78 .bv_page = bvec_iter_page((bvec), (iter)), \
79 .bv_len = bvec_iter_len((bvec), (iter)), \
80 .bv_offset = bvec_iter_offset((bvec), (iter)), \
81})
82
83#define bio_iter_iovec(bio, iter) \
84 bvec_iter_bvec((bio)->bi_io_vec, (iter))
85
86#define bio_iter_page(bio, iter) \
87 bvec_iter_page((bio)->bi_io_vec, (iter))
88#define bio_iter_len(bio, iter) \
89 bvec_iter_len((bio)->bi_io_vec, (iter))
90#define bio_iter_offset(bio, iter) \
91 bvec_iter_offset((bio)->bi_io_vec, (iter))
92
93#define bio_page(bio) bio_iter_page((bio), (bio)->bi_iter)
94#define bio_offset(bio) bio_iter_offset((bio), (bio)->bi_iter)
95#define bio_iovec(bio) bio_iter_iovec((bio), (bio)->bi_iter)
96
97#define bio_multiple_segments(bio) \
98 ((bio)->bi_iter.bi_size != bio_iovec(bio).bv_len)
99#define bio_sectors(bio) ((bio)->bi_iter.bi_size >> 9)
100#define bio_end_sector(bio) ((bio)->bi_iter.bi_sector + bio_sectors((bio)))
101
102/*
103 * Check whether this bio carries any data or not. A NULL bio is allowed.
104 */
105static inline bool bio_has_data(struct bio *bio)
106{
107 if (bio &&
108 bio->bi_iter.bi_size &&
109 !(bio->bi_rw & REQ_DISCARD))
110 return true;
111
112 return false;
113}
114
115static inline bool bio_is_rw(struct bio *bio)
116{
117 if (!bio_has_data(bio))
118 return false;
119
120 if (bio->bi_rw & BIO_NO_ADVANCE_ITER_MASK)
121 return false;
122
123 return true;
124}
125
126static inline bool bio_mergeable(struct bio *bio)
127{
128 if (bio->bi_rw & REQ_NOMERGE_FLAGS)
129 return false;
130
131 return true;
132}
71 133
72static inline unsigned int bio_cur_bytes(struct bio *bio) 134static inline unsigned int bio_cur_bytes(struct bio *bio)
73{ 135{
74 if (bio->bi_vcnt) 136 if (bio_has_data(bio))
75 return bio_iovec(bio)->bv_len; 137 return bio_iovec(bio).bv_len;
76 else /* dataless requests such as discard */ 138 else /* dataless requests such as discard */
77 return bio->bi_size; 139 return bio->bi_iter.bi_size;
78} 140}
79 141
80static inline void *bio_data(struct bio *bio) 142static inline void *bio_data(struct bio *bio)
81{ 143{
82 if (bio->bi_vcnt) 144 if (bio_has_data(bio))
83 return page_address(bio_page(bio)) + bio_offset(bio); 145 return page_address(bio_page(bio)) + bio_offset(bio);
84 146
85 return NULL; 147 return NULL;
@@ -97,19 +159,16 @@ static inline void *bio_data(struct bio *bio)
97 * permanent PIO fall back, user is probably better off disabling highmem 159 * permanent PIO fall back, user is probably better off disabling highmem
98 * I/O completely on that queue (see ide-dma for example) 160 * I/O completely on that queue (see ide-dma for example)
99 */ 161 */
100#define __bio_kmap_atomic(bio, idx) \ 162#define __bio_kmap_atomic(bio, iter) \
101 (kmap_atomic(bio_iovec_idx((bio), (idx))->bv_page) + \ 163 (kmap_atomic(bio_iter_iovec((bio), (iter)).bv_page) + \
102 bio_iovec_idx((bio), (idx))->bv_offset) 164 bio_iter_iovec((bio), (iter)).bv_offset)
103 165
104#define __bio_kunmap_atomic(addr) kunmap_atomic(addr) 166#define __bio_kunmap_atomic(addr) kunmap_atomic(addr)
105 167
106/* 168/*
107 * merge helpers etc 169 * merge helpers etc
108 */ 170 */
109 171
110#define __BVEC_END(bio) bio_iovec_idx((bio), (bio)->bi_vcnt - 1)
111#define __BVEC_START(bio) bio_iovec_idx((bio), (bio)->bi_idx)
112
113/* Default implementation of BIOVEC_PHYS_MERGEABLE */ 172/* Default implementation of BIOVEC_PHYS_MERGEABLE */
114#define __BIOVEC_PHYS_MERGEABLE(vec1, vec2) \ 173#define __BIOVEC_PHYS_MERGEABLE(vec1, vec2) \
115 ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2))) 174 ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2)))
@@ -126,33 +185,87 @@ static inline void *bio_data(struct bio *bio)
126 (((addr1) | (mask)) == (((addr2) - 1) | (mask))) 185 (((addr1) | (mask)) == (((addr2) - 1) | (mask)))
127#define BIOVEC_SEG_BOUNDARY(q, b1, b2) \ 186#define BIOVEC_SEG_BOUNDARY(q, b1, b2) \
128 __BIO_SEG_BOUNDARY(bvec_to_phys((b1)), bvec_to_phys((b2)) + (b2)->bv_len, queue_segment_boundary((q))) 187 __BIO_SEG_BOUNDARY(bvec_to_phys((b1)), bvec_to_phys((b2)) + (b2)->bv_len, queue_segment_boundary((q)))
129#define BIO_SEG_BOUNDARY(q, b1, b2) \
130 BIOVEC_SEG_BOUNDARY((q), __BVEC_END((b1)), __BVEC_START((b2)))
131 188
132#define bio_io_error(bio) bio_endio((bio), -EIO) 189#define bio_io_error(bio) bio_endio((bio), -EIO)
133 190
134/* 191/*
135 * drivers should not use the __ version unless they _really_ know what
136 * they're doing
137 */
138#define __bio_for_each_segment(bvl, bio, i, start_idx) \
139 for (bvl = bio_iovec_idx((bio), (start_idx)), i = (start_idx); \
140 i < (bio)->bi_vcnt; \
141 bvl++, i++)
142
143/*
144 * drivers should _never_ use the all version - the bio may have been split 192 * drivers should _never_ use the all version - the bio may have been split
145 * before it got to the driver and the driver won't own all of it 193 * before it got to the driver and the driver won't own all of it
146 */ 194 */
147#define bio_for_each_segment_all(bvl, bio, i) \ 195#define bio_for_each_segment_all(bvl, bio, i) \
148 for (i = 0; \ 196 for (i = 0, bvl = (bio)->bi_io_vec; i < (bio)->bi_vcnt; i++, bvl++)
149 bvl = bio_iovec_idx((bio), (i)), i < (bio)->bi_vcnt; \ 197
150 i++) 198static inline void bvec_iter_advance(struct bio_vec *bv, struct bvec_iter *iter,
199 unsigned bytes)
200{
201 WARN_ONCE(bytes > iter->bi_size,
202 "Attempted to advance past end of bvec iter\n");
203
204 while (bytes) {
205 unsigned len = min(bytes, bvec_iter_len(bv, *iter));
206
207 bytes -= len;
208 iter->bi_size -= len;
209 iter->bi_bvec_done += len;
210
211 if (iter->bi_bvec_done == __bvec_iter_bvec(bv, *iter)->bv_len) {
212 iter->bi_bvec_done = 0;
213 iter->bi_idx++;
214 }
215 }
216}
217
218#define for_each_bvec(bvl, bio_vec, iter, start) \
219 for ((iter) = start; \
220 (bvl) = bvec_iter_bvec((bio_vec), (iter)), \
221 (iter).bi_size; \
222 bvec_iter_advance((bio_vec), &(iter), (bvl).bv_len))
223
224
225static inline void bio_advance_iter(struct bio *bio, struct bvec_iter *iter,
226 unsigned bytes)
227{
228 iter->bi_sector += bytes >> 9;
229
230 if (bio->bi_rw & BIO_NO_ADVANCE_ITER_MASK)
231 iter->bi_size -= bytes;
232 else
233 bvec_iter_advance(bio->bi_io_vec, iter, bytes);
234}
235
236#define __bio_for_each_segment(bvl, bio, iter, start) \
237 for (iter = (start); \
238 (iter).bi_size && \
239 ((bvl = bio_iter_iovec((bio), (iter))), 1); \
240 bio_advance_iter((bio), &(iter), (bvl).bv_len))
241
242#define bio_for_each_segment(bvl, bio, iter) \
243 __bio_for_each_segment(bvl, bio, iter, (bio)->bi_iter)
244
245#define bio_iter_last(bvec, iter) ((iter).bi_size == (bvec).bv_len)
151 246
152#define bio_for_each_segment(bvl, bio, i) \ 247static inline unsigned bio_segments(struct bio *bio)
153 for (i = (bio)->bi_idx; \ 248{
154 bvl = bio_iovec_idx((bio), (i)), i < (bio)->bi_vcnt; \ 249 unsigned segs = 0;
155 i++) 250 struct bio_vec bv;
251 struct bvec_iter iter;
252
253 /*
254 * We special case discard/write same, because they interpret bi_size
255 * differently:
256 */
257
258 if (bio->bi_rw & REQ_DISCARD)
259 return 1;
260
261 if (bio->bi_rw & REQ_WRITE_SAME)
262 return 1;
263
264 bio_for_each_segment(bv, bio, iter)
265 segs++;
266
267 return segs;
268}
156 269
157/* 270/*
158 * get a reference to a bio, so it won't disappear. the intended use is 271 * get a reference to a bio, so it won't disappear. the intended use is
@@ -177,16 +290,15 @@ static inline void *bio_data(struct bio *bio)
177struct bio_integrity_payload { 290struct bio_integrity_payload {
178 struct bio *bip_bio; /* parent bio */ 291 struct bio *bip_bio; /* parent bio */
179 292
180 sector_t bip_sector; /* virtual start sector */ 293 struct bvec_iter bip_iter;
181 294
295 /* kill - should just use bip_vec */
182 void *bip_buf; /* generated integrity data */ 296 void *bip_buf; /* generated integrity data */
183 bio_end_io_t *bip_end_io; /* saved I/O completion fn */
184 297
185 unsigned int bip_size; 298 bio_end_io_t *bip_end_io; /* saved I/O completion fn */
186 299
187 unsigned short bip_slab; /* slab the bip came from */ 300 unsigned short bip_slab; /* slab the bip came from */
188 unsigned short bip_vcnt; /* # of integrity bio_vecs */ 301 unsigned short bip_vcnt; /* # of integrity bio_vecs */
189 unsigned short bip_idx; /* current bip_vec index */
190 unsigned bip_owns_buf:1; /* should free bip_buf */ 302 unsigned bip_owns_buf:1; /* should free bip_buf */
191 303
192 struct work_struct bip_work; /* I/O completion */ 304 struct work_struct bip_work; /* I/O completion */
@@ -196,29 +308,28 @@ struct bio_integrity_payload {
196}; 308};
197#endif /* CONFIG_BLK_DEV_INTEGRITY */ 309#endif /* CONFIG_BLK_DEV_INTEGRITY */
198 310
199/* 311extern void bio_trim(struct bio *bio, int offset, int size);
200 * A bio_pair is used when we need to split a bio. 312extern struct bio *bio_split(struct bio *bio, int sectors,
201 * This can only happen for a bio that refers to just one 313 gfp_t gfp, struct bio_set *bs);
202 * page of data, and in the unusual situation when the 314
203 * page crosses a chunk/device boundary 315/**
316 * bio_next_split - get next @sectors from a bio, splitting if necessary
317 * @bio: bio to split
318 * @sectors: number of sectors to split from the front of @bio
319 * @gfp: gfp mask
320 * @bs: bio set to allocate from
204 * 321 *
205 * The address of the master bio is stored in bio1.bi_private 322 * Returns a bio representing the next @sectors of @bio - if the bio is smaller
206 * The address of the pool the pair was allocated from is stored 323 * than @sectors, returns the original bio unchanged.
207 * in bio2.bi_private
208 */ 324 */
209struct bio_pair { 325static inline struct bio *bio_next_split(struct bio *bio, int sectors,
210 struct bio bio1, bio2; 326 gfp_t gfp, struct bio_set *bs)
211 struct bio_vec bv1, bv2; 327{
212#if defined(CONFIG_BLK_DEV_INTEGRITY) 328 if (sectors >= bio_sectors(bio))
213 struct bio_integrity_payload bip1, bip2; 329 return bio;
214 struct bio_vec iv1, iv2; 330
215#endif 331 return bio_split(bio, sectors, gfp, bs);
216 atomic_t cnt; 332}
217 int error;
218};
219extern struct bio_pair *bio_split(struct bio *bi, int first_sectors);
220extern void bio_pair_release(struct bio_pair *dbio);
221extern void bio_trim(struct bio *bio, int offset, int size);
222 333
223extern struct bio_set *bioset_create(unsigned int, unsigned int); 334extern struct bio_set *bioset_create(unsigned int, unsigned int);
224extern void bioset_free(struct bio_set *); 335extern void bioset_free(struct bio_set *);
@@ -227,10 +338,12 @@ extern mempool_t *biovec_create_pool(struct bio_set *bs, int pool_entries);
227extern struct bio *bio_alloc_bioset(gfp_t, int, struct bio_set *); 338extern struct bio *bio_alloc_bioset(gfp_t, int, struct bio_set *);
228extern void bio_put(struct bio *); 339extern void bio_put(struct bio *);
229 340
230extern void __bio_clone(struct bio *, struct bio *); 341extern void __bio_clone_fast(struct bio *, struct bio *);
342extern struct bio *bio_clone_fast(struct bio *, gfp_t, struct bio_set *);
231extern struct bio *bio_clone_bioset(struct bio *, gfp_t, struct bio_set *bs); 343extern struct bio *bio_clone_bioset(struct bio *, gfp_t, struct bio_set *bs);
232 344
233extern struct bio_set *fs_bio_set; 345extern struct bio_set *fs_bio_set;
346unsigned int bio_integrity_tag_size(struct bio *bio);
234 347
235static inline struct bio *bio_alloc(gfp_t gfp_mask, unsigned int nr_iovecs) 348static inline struct bio *bio_alloc(gfp_t gfp_mask, unsigned int nr_iovecs)
236{ 349{
@@ -254,6 +367,7 @@ static inline struct bio *bio_clone_kmalloc(struct bio *bio, gfp_t gfp_mask)
254} 367}
255 368
256extern void bio_endio(struct bio *, int); 369extern void bio_endio(struct bio *, int);
370extern void bio_endio_nodec(struct bio *, int);
257struct request_queue; 371struct request_queue;
258extern int bio_phys_segments(struct request_queue *, struct bio *); 372extern int bio_phys_segments(struct request_queue *, struct bio *);
259 373
@@ -262,12 +376,12 @@ extern void bio_advance(struct bio *, unsigned);
262 376
263extern void bio_init(struct bio *); 377extern void bio_init(struct bio *);
264extern void bio_reset(struct bio *); 378extern void bio_reset(struct bio *);
379void bio_chain(struct bio *, struct bio *);
265 380
266extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int); 381extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int);
267extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *, 382extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *,
268 unsigned int, unsigned int); 383 unsigned int, unsigned int);
269extern int bio_get_nr_vecs(struct block_device *); 384extern int bio_get_nr_vecs(struct block_device *);
270extern sector_t bio_sector_offset(struct bio *, unsigned short, unsigned int);
271extern struct bio *bio_map_user(struct request_queue *, struct block_device *, 385extern struct bio *bio_map_user(struct request_queue *, struct block_device *,
272 unsigned long, unsigned int, int, gfp_t); 386 unsigned long, unsigned int, int, gfp_t);
273struct sg_iovec; 387struct sg_iovec;
@@ -357,48 +471,18 @@ static inline void bvec_kunmap_irq(char *buffer, unsigned long *flags)
357} 471}
358#endif 472#endif
359 473
360static inline char *__bio_kmap_irq(struct bio *bio, unsigned short idx, 474static inline char *__bio_kmap_irq(struct bio *bio, struct bvec_iter iter,
361 unsigned long *flags) 475 unsigned long *flags)
362{ 476{
363 return bvec_kmap_irq(bio_iovec_idx(bio, idx), flags); 477 return bvec_kmap_irq(&bio_iter_iovec(bio, iter), flags);
364} 478}
365#define __bio_kunmap_irq(buf, flags) bvec_kunmap_irq(buf, flags) 479#define __bio_kunmap_irq(buf, flags) bvec_kunmap_irq(buf, flags)
366 480
367#define bio_kmap_irq(bio, flags) \ 481#define bio_kmap_irq(bio, flags) \
368 __bio_kmap_irq((bio), (bio)->bi_idx, (flags)) 482 __bio_kmap_irq((bio), (bio)->bi_iter, (flags))
369#define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags) 483#define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags)
370 484
371/* 485/*
372 * Check whether this bio carries any data or not. A NULL bio is allowed.
373 */
374static inline bool bio_has_data(struct bio *bio)
375{
376 if (bio && bio->bi_vcnt)
377 return true;
378
379 return false;
380}
381
382static inline bool bio_is_rw(struct bio *bio)
383{
384 if (!bio_has_data(bio))
385 return false;
386
387 if (bio->bi_rw & REQ_WRITE_SAME)
388 return false;
389
390 return true;
391}
392
393static inline bool bio_mergeable(struct bio *bio)
394{
395 if (bio->bi_rw & REQ_NOMERGE_FLAGS)
396 return false;
397
398 return true;
399}
400
401/*
402 * BIO list management for use by remapping drivers (e.g. DM or MD) and loop. 486 * BIO list management for use by remapping drivers (e.g. DM or MD) and loop.
403 * 487 *
404 * A bio_list anchors a singly-linked list of bios chained through the bi_next 488 * A bio_list anchors a singly-linked list of bios chained through the bi_next
@@ -559,16 +643,12 @@ struct biovec_slab {
559 643
560#if defined(CONFIG_BLK_DEV_INTEGRITY) 644#if defined(CONFIG_BLK_DEV_INTEGRITY)
561 645
562#define bip_vec_idx(bip, idx) (&(bip->bip_vec[(idx)]))
563#define bip_vec(bip) bip_vec_idx(bip, 0)
564 646
565#define __bip_for_each_vec(bvl, bip, i, start_idx) \
566 for (bvl = bip_vec_idx((bip), (start_idx)), i = (start_idx); \
567 i < (bip)->bip_vcnt; \
568 bvl++, i++)
569 647
570#define bip_for_each_vec(bvl, bip, i) \ 648#define bip_vec_idx(bip, idx) (&(bip->bip_vec[(idx)]))
571 __bip_for_each_vec(bvl, bip, i, (bip)->bip_idx) 649
650#define bip_for_each_vec(bvl, bip, iter) \
651 for_each_bvec(bvl, (bip)->bip_vec, iter, (bip)->bip_iter)
572 652
573#define bio_for_each_integrity_vec(_bvl, _bio, _iter) \ 653#define bio_for_each_integrity_vec(_bvl, _bio, _iter) \
574 for_each_bio(_bio) \ 654 for_each_bio(_bio) \
@@ -586,7 +666,6 @@ extern int bio_integrity_prep(struct bio *);
586extern void bio_integrity_endio(struct bio *, int); 666extern void bio_integrity_endio(struct bio *, int);
587extern void bio_integrity_advance(struct bio *, unsigned int); 667extern void bio_integrity_advance(struct bio *, unsigned int);
588extern void bio_integrity_trim(struct bio *, unsigned int, unsigned int); 668extern void bio_integrity_trim(struct bio *, unsigned int, unsigned int);
589extern void bio_integrity_split(struct bio *, struct bio_pair *, int);
590extern int bio_integrity_clone(struct bio *, struct bio *, gfp_t); 669extern int bio_integrity_clone(struct bio *, struct bio *, gfp_t);
591extern int bioset_integrity_create(struct bio_set *, int); 670extern int bioset_integrity_create(struct bio_set *, int);
592extern void bioset_integrity_free(struct bio_set *); 671extern void bioset_integrity_free(struct bio_set *);
@@ -630,12 +709,6 @@ static inline int bio_integrity_clone(struct bio *bio, struct bio *bio_src,
630 return 0; 709 return 0;
631} 710}
632 711
633static inline void bio_integrity_split(struct bio *bio, struct bio_pair *bp,
634 int sectors)
635{
636 return;
637}
638
639static inline void bio_integrity_advance(struct bio *bio, 712static inline void bio_integrity_advance(struct bio *bio,
640 unsigned int bytes_done) 713 unsigned int bytes_done)
641{ 714{
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index ab0e9b2025b3..18ba8a627f46 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -83,6 +83,8 @@ struct blk_mq_ops {
83 */ 83 */
84 rq_timed_out_fn *timeout; 84 rq_timed_out_fn *timeout;
85 85
86 softirq_done_fn *complete;
87
86 /* 88 /*
87 * Override for hctx allocations (should probably go) 89 * Override for hctx allocations (should probably go)
88 */ 90 */
@@ -113,18 +115,18 @@ enum {
113}; 115};
114 116
115struct request_queue *blk_mq_init_queue(struct blk_mq_reg *, void *); 117struct request_queue *blk_mq_init_queue(struct blk_mq_reg *, void *);
116void blk_mq_free_queue(struct request_queue *);
117int blk_mq_register_disk(struct gendisk *); 118int blk_mq_register_disk(struct gendisk *);
118void blk_mq_unregister_disk(struct gendisk *); 119void blk_mq_unregister_disk(struct gendisk *);
119void blk_mq_init_commands(struct request_queue *, void (*init)(void *data, struct blk_mq_hw_ctx *, struct request *, unsigned int), void *data); 120void blk_mq_init_commands(struct request_queue *, void (*init)(void *data, struct blk_mq_hw_ctx *, struct request *, unsigned int), void *data);
120 121
121void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule); 122void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule);
122 123
123void blk_mq_insert_request(struct request_queue *, struct request *, bool); 124void blk_mq_insert_request(struct request_queue *, struct request *,
125 bool, bool);
124void blk_mq_run_queues(struct request_queue *q, bool async); 126void blk_mq_run_queues(struct request_queue *q, bool async);
125void blk_mq_free_request(struct request *rq); 127void blk_mq_free_request(struct request *rq);
126bool blk_mq_can_queue(struct blk_mq_hw_ctx *); 128bool blk_mq_can_queue(struct blk_mq_hw_ctx *);
127struct request *blk_mq_alloc_request(struct request_queue *q, int rw, gfp_t gfp, bool reserved); 129struct request *blk_mq_alloc_request(struct request_queue *q, int rw, gfp_t gfp);
128struct request *blk_mq_alloc_reserved_request(struct request_queue *q, int rw, gfp_t gfp); 130struct request *blk_mq_alloc_reserved_request(struct request_queue *q, int rw, gfp_t gfp);
129struct request *blk_mq_rq_from_tag(struct request_queue *q, unsigned int tag); 131struct request *blk_mq_rq_from_tag(struct request_queue *q, unsigned int tag);
130 132
@@ -134,6 +136,8 @@ void blk_mq_free_single_hw_queue(struct blk_mq_hw_ctx *, unsigned int);
134 136
135void blk_mq_end_io(struct request *rq, int error); 137void blk_mq_end_io(struct request *rq, int error);
136 138
139void blk_mq_complete_request(struct request *rq);
140
137void blk_mq_stop_hw_queue(struct blk_mq_hw_ctx *hctx); 141void blk_mq_stop_hw_queue(struct blk_mq_hw_ctx *hctx);
138void blk_mq_start_hw_queue(struct blk_mq_hw_ctx *hctx); 142void blk_mq_start_hw_queue(struct blk_mq_hw_ctx *hctx);
139void blk_mq_stop_hw_queues(struct request_queue *q); 143void blk_mq_stop_hw_queues(struct request_queue *q);
@@ -159,16 +163,16 @@ static inline struct request *blk_mq_tag_to_rq(struct blk_mq_hw_ctx *hctx,
159} 163}
160 164
161#define queue_for_each_hw_ctx(q, hctx, i) \ 165#define queue_for_each_hw_ctx(q, hctx, i) \
162 for ((i) = 0, hctx = (q)->queue_hw_ctx[0]; \ 166 for ((i) = 0; (i) < (q)->nr_hw_queues && \
163 (i) < (q)->nr_hw_queues; (i)++, hctx = (q)->queue_hw_ctx[i]) 167 ({ hctx = (q)->queue_hw_ctx[i]; 1; }); (i)++)
164 168
165#define queue_for_each_ctx(q, ctx, i) \ 169#define queue_for_each_ctx(q, ctx, i) \
166 for ((i) = 0, ctx = per_cpu_ptr((q)->queue_ctx, 0); \ 170 for ((i) = 0; (i) < (q)->nr_queues && \
167 (i) < (q)->nr_queues; (i)++, ctx = per_cpu_ptr(q->queue_ctx, (i))) 171 ({ ctx = per_cpu_ptr((q)->queue_ctx, (i)); 1; }); (i)++)
168 172
169#define hctx_for_each_ctx(hctx, ctx, i) \ 173#define hctx_for_each_ctx(hctx, ctx, i) \
170 for ((i) = 0, ctx = (hctx)->ctxs[0]; \ 174 for ((i) = 0; (i) < (hctx)->nr_ctx && \
171 (i) < (hctx)->nr_ctx; (i)++, ctx = (hctx)->ctxs[(i)]) 175 ({ ctx = (hctx)->ctxs[(i)]; 1; }); (i)++)
172 176
173#define blk_ctx_sum(q, sum) \ 177#define blk_ctx_sum(q, sum) \
174({ \ 178({ \
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 238ef0ed62f8..bbc3a6c88fce 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -28,13 +28,22 @@ struct bio_vec {
28 unsigned int bv_offset; 28 unsigned int bv_offset;
29}; 29};
30 30
31struct bvec_iter {
32 sector_t bi_sector; /* device address in 512 byte
33 sectors */
34 unsigned int bi_size; /* residual I/O count */
35
36 unsigned int bi_idx; /* current index into bvl_vec */
37
38 unsigned int bi_bvec_done; /* number of bytes completed in
39 current bvec */
40};
41
31/* 42/*
32 * main unit of I/O for the block layer and lower layers (ie drivers and 43 * main unit of I/O for the block layer and lower layers (ie drivers and
33 * stacking drivers) 44 * stacking drivers)
34 */ 45 */
35struct bio { 46struct bio {
36 sector_t bi_sector; /* device address in 512 byte
37 sectors */
38 struct bio *bi_next; /* request queue link */ 47 struct bio *bi_next; /* request queue link */
39 struct block_device *bi_bdev; 48 struct block_device *bi_bdev;
40 unsigned long bi_flags; /* status, command, etc */ 49 unsigned long bi_flags; /* status, command, etc */
@@ -42,16 +51,13 @@ struct bio {
42 * top bits priority 51 * top bits priority
43 */ 52 */
44 53
45 unsigned short bi_vcnt; /* how many bio_vec's */ 54 struct bvec_iter bi_iter;
46 unsigned short bi_idx; /* current index into bvl_vec */
47 55
48 /* Number of segments in this BIO after 56 /* Number of segments in this BIO after
49 * physical address coalescing is performed. 57 * physical address coalescing is performed.
50 */ 58 */
51 unsigned int bi_phys_segments; 59 unsigned int bi_phys_segments;
52 60
53 unsigned int bi_size; /* residual I/O count */
54
55 /* 61 /*
56 * To keep track of the max segment size, we account for the 62 * To keep track of the max segment size, we account for the
57 * sizes of the first and last mergeable segments in this bio. 63 * sizes of the first and last mergeable segments in this bio.
@@ -59,6 +65,8 @@ struct bio {
59 unsigned int bi_seg_front_size; 65 unsigned int bi_seg_front_size;
60 unsigned int bi_seg_back_size; 66 unsigned int bi_seg_back_size;
61 67
68 atomic_t bi_remaining;
69
62 bio_end_io_t *bi_end_io; 70 bio_end_io_t *bi_end_io;
63 71
64 void *bi_private; 72 void *bi_private;
@@ -74,11 +82,13 @@ struct bio {
74 struct bio_integrity_payload *bi_integrity; /* data integrity */ 82 struct bio_integrity_payload *bi_integrity; /* data integrity */
75#endif 83#endif
76 84
85 unsigned short bi_vcnt; /* how many bio_vec's */
86
77 /* 87 /*
78 * Everything starting with bi_max_vecs will be preserved by bio_reset() 88 * Everything starting with bi_max_vecs will be preserved by bio_reset()
79 */ 89 */
80 90
81 unsigned int bi_max_vecs; /* max bvl_vecs we can hold */ 91 unsigned short bi_max_vecs; /* max bvl_vecs we can hold */
82 92
83 atomic_t bi_cnt; /* pin count */ 93 atomic_t bi_cnt; /* pin count */
84 94
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 1b135d49b279..4afa4f8f6090 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -95,13 +95,10 @@ enum rq_cmd_type_bits {
95 * as well! 95 * as well!
96 */ 96 */
97struct request { 97struct request {
98 union { 98 struct list_head queuelist;
99 struct list_head queuelist;
100 struct llist_node ll_list;
101 };
102 union { 99 union {
103 struct call_single_data csd; 100 struct call_single_data csd;
104 struct work_struct mq_flush_data; 101 struct work_struct mq_flush_work;
105 }; 102 };
106 103
107 struct request_queue *q; 104 struct request_queue *q;
@@ -291,6 +288,7 @@ struct queue_limits {
291 unsigned char discard_misaligned; 288 unsigned char discard_misaligned;
292 unsigned char cluster; 289 unsigned char cluster;
293 unsigned char discard_zeroes_data; 290 unsigned char discard_zeroes_data;
291 unsigned char raid_partial_stripes_expensive;
294}; 292};
295 293
296struct request_queue { 294struct request_queue {
@@ -450,13 +448,8 @@ struct request_queue {
450 unsigned long flush_pending_since; 448 unsigned long flush_pending_since;
451 struct list_head flush_queue[2]; 449 struct list_head flush_queue[2];
452 struct list_head flush_data_in_flight; 450 struct list_head flush_data_in_flight;
453 union { 451 struct request *flush_rq;
454 struct request flush_rq; 452 spinlock_t mq_flush_lock;
455 struct {
456 spinlock_t mq_flush_lock;
457 struct work_struct mq_flush_work;
458 };
459 };
460 453
461 struct mutex sysfs_lock; 454 struct mutex sysfs_lock;
462 455
@@ -735,7 +728,7 @@ struct rq_map_data {
735}; 728};
736 729
737struct req_iterator { 730struct req_iterator {
738 int i; 731 struct bvec_iter iter;
739 struct bio *bio; 732 struct bio *bio;
740}; 733};
741 734
@@ -748,10 +741,11 @@ struct req_iterator {
748 741
749#define rq_for_each_segment(bvl, _rq, _iter) \ 742#define rq_for_each_segment(bvl, _rq, _iter) \
750 __rq_for_each_bio(_iter.bio, _rq) \ 743 __rq_for_each_bio(_iter.bio, _rq) \
751 bio_for_each_segment(bvl, _iter.bio, _iter.i) 744 bio_for_each_segment(bvl, _iter.bio, _iter.iter)
752 745
753#define rq_iter_last(rq, _iter) \ 746#define rq_iter_last(bvec, _iter) \
754 (_iter.bio->bi_next == NULL && _iter.i == _iter.bio->bi_vcnt-1) 747 (_iter.bio->bi_next == NULL && \
748 bio_iter_last(bvec, _iter.iter))
755 749
756#ifndef ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 750#ifndef ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
757# error "You should define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE for your platform" 751# error "You should define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE for your platform"
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index f1f07d31a3af..db51fe4fe317 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -5,6 +5,7 @@
5#define _LINUX_BOOTMEM_H 5#define _LINUX_BOOTMEM_H
6 6
7#include <linux/mmzone.h> 7#include <linux/mmzone.h>
8#include <linux/mm_types.h>
8#include <asm/dma.h> 9#include <asm/dma.h>
9 10
10/* 11/*
@@ -52,7 +53,6 @@ extern void free_bootmem_node(pg_data_t *pgdat,
52 unsigned long size); 53 unsigned long size);
53extern void free_bootmem(unsigned long physaddr, unsigned long size); 54extern void free_bootmem(unsigned long physaddr, unsigned long size);
54extern void free_bootmem_late(unsigned long physaddr, unsigned long size); 55extern void free_bootmem_late(unsigned long physaddr, unsigned long size);
55extern void __free_pages_bootmem(struct page *page, unsigned int order);
56 56
57/* 57/*
58 * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, 58 * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE,
@@ -142,6 +142,194 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat,
142#define alloc_bootmem_low_pages_node(pgdat, x) \ 142#define alloc_bootmem_low_pages_node(pgdat, x) \
143 __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0) 143 __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0)
144 144
145
146#if defined(CONFIG_HAVE_MEMBLOCK) && defined(CONFIG_NO_BOOTMEM)
147
148/* FIXME: use MEMBLOCK_ALLOC_* variants here */
149#define BOOTMEM_ALLOC_ACCESSIBLE 0
150#define BOOTMEM_ALLOC_ANYWHERE (~(phys_addr_t)0)
151
152/* FIXME: Move to memblock.h at a point where we remove nobootmem.c */
153void *memblock_virt_alloc_try_nid_nopanic(phys_addr_t size,
154 phys_addr_t align, phys_addr_t min_addr,
155 phys_addr_t max_addr, int nid);
156void *memblock_virt_alloc_try_nid(phys_addr_t size, phys_addr_t align,
157 phys_addr_t min_addr, phys_addr_t max_addr, int nid);
158void __memblock_free_early(phys_addr_t base, phys_addr_t size);
159void __memblock_free_late(phys_addr_t base, phys_addr_t size);
160
161static inline void * __init memblock_virt_alloc(
162 phys_addr_t size, phys_addr_t align)
163{
164 return memblock_virt_alloc_try_nid(size, align, BOOTMEM_LOW_LIMIT,
165 BOOTMEM_ALLOC_ACCESSIBLE,
166 NUMA_NO_NODE);
167}
168
169static inline void * __init memblock_virt_alloc_nopanic(
170 phys_addr_t size, phys_addr_t align)
171{
172 return memblock_virt_alloc_try_nid_nopanic(size, align,
173 BOOTMEM_LOW_LIMIT,
174 BOOTMEM_ALLOC_ACCESSIBLE,
175 NUMA_NO_NODE);
176}
177
178#ifndef ARCH_LOW_ADDRESS_LIMIT
179#define ARCH_LOW_ADDRESS_LIMIT 0xffffffffUL
180#endif
181
182static inline void * __init memblock_virt_alloc_low(
183 phys_addr_t size, phys_addr_t align)
184{
185 return memblock_virt_alloc_try_nid(size, align,
186 BOOTMEM_LOW_LIMIT,
187 ARCH_LOW_ADDRESS_LIMIT,
188 NUMA_NO_NODE);
189}
190static inline void * __init memblock_virt_alloc_low_nopanic(
191 phys_addr_t size, phys_addr_t align)
192{
193 return memblock_virt_alloc_try_nid_nopanic(size, align,
194 BOOTMEM_LOW_LIMIT,
195 ARCH_LOW_ADDRESS_LIMIT,
196 NUMA_NO_NODE);
197}
198
199static inline void * __init memblock_virt_alloc_from_nopanic(
200 phys_addr_t size, phys_addr_t align, phys_addr_t min_addr)
201{
202 return memblock_virt_alloc_try_nid_nopanic(size, align, min_addr,
203 BOOTMEM_ALLOC_ACCESSIBLE,
204 NUMA_NO_NODE);
205}
206
207static inline void * __init memblock_virt_alloc_node(
208 phys_addr_t size, int nid)
209{
210 return memblock_virt_alloc_try_nid(size, 0, BOOTMEM_LOW_LIMIT,
211 BOOTMEM_ALLOC_ACCESSIBLE, nid);
212}
213
214static inline void * __init memblock_virt_alloc_node_nopanic(
215 phys_addr_t size, int nid)
216{
217 return memblock_virt_alloc_try_nid_nopanic(size, 0, BOOTMEM_LOW_LIMIT,
218 BOOTMEM_ALLOC_ACCESSIBLE,
219 nid);
220}
221
222static inline void __init memblock_free_early(
223 phys_addr_t base, phys_addr_t size)
224{
225 __memblock_free_early(base, size);
226}
227
228static inline void __init memblock_free_early_nid(
229 phys_addr_t base, phys_addr_t size, int nid)
230{
231 __memblock_free_early(base, size);
232}
233
234static inline void __init memblock_free_late(
235 phys_addr_t base, phys_addr_t size)
236{
237 __memblock_free_late(base, size);
238}
239
240#else
241
242#define BOOTMEM_ALLOC_ACCESSIBLE 0
243
244
245/* Fall back to all the existing bootmem APIs */
246static inline void * __init memblock_virt_alloc(
247 phys_addr_t size, phys_addr_t align)
248{
249 if (!align)
250 align = SMP_CACHE_BYTES;
251 return __alloc_bootmem(size, align, BOOTMEM_LOW_LIMIT);
252}
253
254static inline void * __init memblock_virt_alloc_nopanic(
255 phys_addr_t size, phys_addr_t align)
256{
257 if (!align)
258 align = SMP_CACHE_BYTES;
259 return __alloc_bootmem_nopanic(size, align, BOOTMEM_LOW_LIMIT);
260}
261
262static inline void * __init memblock_virt_alloc_low(
263 phys_addr_t size, phys_addr_t align)
264{
265 if (!align)
266 align = SMP_CACHE_BYTES;
267 return __alloc_bootmem_low(size, align, 0);
268}
269
270static inline void * __init memblock_virt_alloc_low_nopanic(
271 phys_addr_t size, phys_addr_t align)
272{
273 if (!align)
274 align = SMP_CACHE_BYTES;
275 return __alloc_bootmem_low_nopanic(size, align, 0);
276}
277
278static inline void * __init memblock_virt_alloc_from_nopanic(
279 phys_addr_t size, phys_addr_t align, phys_addr_t min_addr)
280{
281 return __alloc_bootmem_nopanic(size, align, min_addr);
282}
283
284static inline void * __init memblock_virt_alloc_node(
285 phys_addr_t size, int nid)
286{
287 return __alloc_bootmem_node(NODE_DATA(nid), size, SMP_CACHE_BYTES,
288 BOOTMEM_LOW_LIMIT);
289}
290
291static inline void * __init memblock_virt_alloc_node_nopanic(
292 phys_addr_t size, int nid)
293{
294 return __alloc_bootmem_node_nopanic(NODE_DATA(nid), size,
295 SMP_CACHE_BYTES,
296 BOOTMEM_LOW_LIMIT);
297}
298
299static inline void * __init memblock_virt_alloc_try_nid(phys_addr_t size,
300 phys_addr_t align, phys_addr_t min_addr, phys_addr_t max_addr, int nid)
301{
302 return __alloc_bootmem_node_high(NODE_DATA(nid), size, align,
303 min_addr);
304}
305
306static inline void * __init memblock_virt_alloc_try_nid_nopanic(
307 phys_addr_t size, phys_addr_t align,
308 phys_addr_t min_addr, phys_addr_t max_addr, int nid)
309{
310 return ___alloc_bootmem_node_nopanic(NODE_DATA(nid), size, align,
311 min_addr, max_addr);
312}
313
314static inline void __init memblock_free_early(
315 phys_addr_t base, phys_addr_t size)
316{
317 free_bootmem(base, size);
318}
319
320static inline void __init memblock_free_early_nid(
321 phys_addr_t base, phys_addr_t size, int nid)
322{
323 free_bootmem_node(NODE_DATA(nid), base, size);
324}
325
326static inline void __init memblock_free_late(
327 phys_addr_t base, phys_addr_t size)
328{
329 free_bootmem_late(base, size);
330}
331#endif /* defined(CONFIG_HAVE_MEMBLOCK) && defined(CONFIG_NO_BOOTMEM) */
332
145#ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP 333#ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP
146extern void *alloc_remap(int nid, unsigned long size); 334extern void *alloc_remap(int nid, unsigned long size);
147#else 335#else
diff --git a/include/linux/bottom_half.h b/include/linux/bottom_half.h
index 27b1bcffe408..86c12c93e3cf 100644
--- a/include/linux/bottom_half.h
+++ b/include/linux/bottom_half.h
@@ -1,9 +1,35 @@
1#ifndef _LINUX_BH_H 1#ifndef _LINUX_BH_H
2#define _LINUX_BH_H 2#define _LINUX_BH_H
3 3
4extern void local_bh_disable(void); 4#include <linux/preempt.h>
5#include <linux/preempt_mask.h>
6
7#ifdef CONFIG_TRACE_IRQFLAGS
8extern void __local_bh_disable_ip(unsigned long ip, unsigned int cnt);
9#else
10static __always_inline void __local_bh_disable_ip(unsigned long ip, unsigned int cnt)
11{
12 preempt_count_add(cnt);
13 barrier();
14}
15#endif
16
17static inline void local_bh_disable(void)
18{
19 __local_bh_disable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET);
20}
21
5extern void _local_bh_enable(void); 22extern void _local_bh_enable(void);
6extern void local_bh_enable(void); 23extern void __local_bh_enable_ip(unsigned long ip, unsigned int cnt);
7extern void local_bh_enable_ip(unsigned long ip); 24
25static inline void local_bh_enable_ip(unsigned long ip)
26{
27 __local_bh_enable_ip(ip, SOFTIRQ_DISABLE_OFFSET);
28}
29
30static inline void local_bh_enable(void)
31{
32 __local_bh_enable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET);
33}
8 34
9#endif /* _LINUX_BH_H */ 35#endif /* _LINUX_BH_H */
diff --git a/include/linux/cache.h b/include/linux/cache.h
index 4c570653ab84..17e7e82d2aa7 100644
--- a/include/linux/cache.h
+++ b/include/linux/cache.h
@@ -1,11 +1,11 @@
1#ifndef __LINUX_CACHE_H 1#ifndef __LINUX_CACHE_H
2#define __LINUX_CACHE_H 2#define __LINUX_CACHE_H
3 3
4#include <linux/kernel.h> 4#include <uapi/linux/kernel.h>
5#include <asm/cache.h> 5#include <asm/cache.h>
6 6
7#ifndef L1_CACHE_ALIGN 7#ifndef L1_CACHE_ALIGN
8#define L1_CACHE_ALIGN(x) ALIGN(x, L1_CACHE_BYTES) 8#define L1_CACHE_ALIGN(x) __ALIGN_KERNEL(x, L1_CACHE_BYTES)
9#endif 9#endif
10 10
11#ifndef SMP_CACHE_BYTES 11#ifndef SMP_CACHE_BYTES
diff --git a/include/linux/can/skb.h b/include/linux/can/skb.h
index 2f0543f7510c..f9bbbb472663 100644
--- a/include/linux/can/skb.h
+++ b/include/linux/can/skb.h
@@ -11,7 +11,9 @@
11#define CAN_SKB_H 11#define CAN_SKB_H
12 12
13#include <linux/types.h> 13#include <linux/types.h>
14#include <linux/skbuff.h>
14#include <linux/can.h> 15#include <linux/can.h>
16#include <net/sock.h>
15 17
16/* 18/*
17 * The struct can_skb_priv is used to transport additional information along 19 * The struct can_skb_priv is used to transport additional information along
@@ -42,4 +44,40 @@ static inline void can_skb_reserve(struct sk_buff *skb)
42 skb_reserve(skb, sizeof(struct can_skb_priv)); 44 skb_reserve(skb, sizeof(struct can_skb_priv));
43} 45}
44 46
47static inline void can_skb_destructor(struct sk_buff *skb)
48{
49 sock_put(skb->sk);
50}
51
52static inline void can_skb_set_owner(struct sk_buff *skb, struct sock *sk)
53{
54 if (sk) {
55 sock_hold(sk);
56 skb->destructor = can_skb_destructor;
57 skb->sk = sk;
58 }
59}
60
61/*
62 * returns an unshared skb owned by the original sock to be echo'ed back
63 */
64static inline struct sk_buff *can_create_echo_skb(struct sk_buff *skb)
65{
66 if (skb_shared(skb)) {
67 struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC);
68
69 if (likely(nskb)) {
70 can_skb_set_owner(nskb, skb->sk);
71 consume_skb(skb);
72 return nskb;
73 } else {
74 kfree_skb(skb);
75 return NULL;
76 }
77 }
78
79 /* we can assume to have an unshared skb with proper owner */
80 return skb;
81}
82
45#endif /* CAN_SKB_H */ 83#endif /* CAN_SKB_H */
diff --git a/include/linux/ccp.h b/include/linux/ccp.h
new file mode 100644
index 000000000000..b941ab9f762b
--- /dev/null
+++ b/include/linux/ccp.h
@@ -0,0 +1,537 @@
1/*
2 * AMD Cryptographic Coprocessor (CCP) driver
3 *
4 * Copyright (C) 2013 Advanced Micro Devices, Inc.
5 *
6 * Author: Tom Lendacky <thomas.lendacky@amd.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __CPP_H__
14#define __CPP_H__
15
16#include <linux/scatterlist.h>
17#include <linux/workqueue.h>
18#include <linux/list.h>
19#include <crypto/aes.h>
20#include <crypto/sha.h>
21
22
23struct ccp_device;
24struct ccp_cmd;
25
26#if defined(CONFIG_CRYPTO_DEV_CCP_DD) || \
27 defined(CONFIG_CRYPTO_DEV_CCP_DD_MODULE)
28
29/**
30 * ccp_enqueue_cmd - queue an operation for processing by the CCP
31 *
32 * @cmd: ccp_cmd struct to be processed
33 *
34 * Refer to the ccp_cmd struct below for required fields.
35 *
36 * Queue a cmd to be processed by the CCP. If queueing the cmd
37 * would exceed the defined length of the cmd queue the cmd will
38 * only be queued if the CCP_CMD_MAY_BACKLOG flag is set and will
39 * result in a return code of -EBUSY.
40 *
41 * The callback routine specified in the ccp_cmd struct will be
42 * called to notify the caller of completion (if the cmd was not
43 * backlogged) or advancement out of the backlog. If the cmd has
44 * advanced out of the backlog the "err" value of the callback
45 * will be -EINPROGRESS. Any other "err" value during callback is
46 * the result of the operation.
47 *
48 * The cmd has been successfully queued if:
49 * the return code is -EINPROGRESS or
50 * the return code is -EBUSY and CCP_CMD_MAY_BACKLOG flag is set
51 */
52int ccp_enqueue_cmd(struct ccp_cmd *cmd);
53
54#else /* CONFIG_CRYPTO_DEV_CCP_DD is not enabled */
55
56static inline int ccp_enqueue_cmd(struct ccp_cmd *cmd)
57{
58 return -ENODEV;
59}
60
61#endif /* CONFIG_CRYPTO_DEV_CCP_DD */
62
63
64/***** AES engine *****/
65/**
66 * ccp_aes_type - AES key size
67 *
68 * @CCP_AES_TYPE_128: 128-bit key
69 * @CCP_AES_TYPE_192: 192-bit key
70 * @CCP_AES_TYPE_256: 256-bit key
71 */
72enum ccp_aes_type {
73 CCP_AES_TYPE_128 = 0,
74 CCP_AES_TYPE_192,
75 CCP_AES_TYPE_256,
76 CCP_AES_TYPE__LAST,
77};
78
79/**
80 * ccp_aes_mode - AES operation mode
81 *
82 * @CCP_AES_MODE_ECB: ECB mode
83 * @CCP_AES_MODE_CBC: CBC mode
84 * @CCP_AES_MODE_OFB: OFB mode
85 * @CCP_AES_MODE_CFB: CFB mode
86 * @CCP_AES_MODE_CTR: CTR mode
87 * @CCP_AES_MODE_CMAC: CMAC mode
88 */
89enum ccp_aes_mode {
90 CCP_AES_MODE_ECB = 0,
91 CCP_AES_MODE_CBC,
92 CCP_AES_MODE_OFB,
93 CCP_AES_MODE_CFB,
94 CCP_AES_MODE_CTR,
95 CCP_AES_MODE_CMAC,
96 CCP_AES_MODE__LAST,
97};
98
99/**
100 * ccp_aes_mode - AES operation mode
101 *
102 * @CCP_AES_ACTION_DECRYPT: AES decrypt operation
103 * @CCP_AES_ACTION_ENCRYPT: AES encrypt operation
104 */
105enum ccp_aes_action {
106 CCP_AES_ACTION_DECRYPT = 0,
107 CCP_AES_ACTION_ENCRYPT,
108 CCP_AES_ACTION__LAST,
109};
110
111/**
112 * struct ccp_aes_engine - CCP AES operation
113 * @type: AES operation key size
114 * @mode: AES operation mode
115 * @action: AES operation (decrypt/encrypt)
116 * @key: key to be used for this AES operation
117 * @key_len: length in bytes of key
118 * @iv: IV to be used for this AES operation
119 * @iv_len: length in bytes of iv
120 * @src: data to be used for this operation
121 * @dst: data produced by this operation
122 * @src_len: length in bytes of data used for this operation
123 * @cmac_final: indicates final operation when running in CMAC mode
124 * @cmac_key: K1/K2 key used in final CMAC operation
125 * @cmac_key_len: length in bytes of cmac_key
126 *
127 * Variables required to be set when calling ccp_enqueue_cmd():
128 * - type, mode, action, key, key_len, src, dst, src_len
129 * - iv, iv_len for any mode other than ECB
130 * - cmac_final for CMAC mode
131 * - cmac_key, cmac_key_len for CMAC mode if cmac_final is non-zero
132 *
133 * The iv variable is used as both input and output. On completion of the
134 * AES operation the new IV overwrites the old IV.
135 */
136struct ccp_aes_engine {
137 enum ccp_aes_type type;
138 enum ccp_aes_mode mode;
139 enum ccp_aes_action action;
140
141 struct scatterlist *key;
142 u32 key_len; /* In bytes */
143
144 struct scatterlist *iv;
145 u32 iv_len; /* In bytes */
146
147 struct scatterlist *src, *dst;
148 u64 src_len; /* In bytes */
149
150 u32 cmac_final; /* Indicates final cmac cmd */
151 struct scatterlist *cmac_key; /* K1/K2 cmac key required for
152 * final cmac cmd */
153 u32 cmac_key_len; /* In bytes */
154};
155
156/***** XTS-AES engine *****/
157/**
158 * ccp_xts_aes_unit_size - XTS unit size
159 *
160 * @CCP_XTS_AES_UNIT_SIZE_16: Unit size of 16 bytes
161 * @CCP_XTS_AES_UNIT_SIZE_512: Unit size of 512 bytes
162 * @CCP_XTS_AES_UNIT_SIZE_1024: Unit size of 1024 bytes
163 * @CCP_XTS_AES_UNIT_SIZE_2048: Unit size of 2048 bytes
164 * @CCP_XTS_AES_UNIT_SIZE_4096: Unit size of 4096 bytes
165 */
166enum ccp_xts_aes_unit_size {
167 CCP_XTS_AES_UNIT_SIZE_16 = 0,
168 CCP_XTS_AES_UNIT_SIZE_512,
169 CCP_XTS_AES_UNIT_SIZE_1024,
170 CCP_XTS_AES_UNIT_SIZE_2048,
171 CCP_XTS_AES_UNIT_SIZE_4096,
172 CCP_XTS_AES_UNIT_SIZE__LAST,
173};
174
175/**
176 * struct ccp_xts_aes_engine - CCP XTS AES operation
177 * @action: AES operation (decrypt/encrypt)
178 * @unit_size: unit size of the XTS operation
179 * @key: key to be used for this XTS AES operation
180 * @key_len: length in bytes of key
181 * @iv: IV to be used for this XTS AES operation
182 * @iv_len: length in bytes of iv
183 * @src: data to be used for this operation
184 * @dst: data produced by this operation
185 * @src_len: length in bytes of data used for this operation
186 * @final: indicates final XTS operation
187 *
188 * Variables required to be set when calling ccp_enqueue_cmd():
189 * - action, unit_size, key, key_len, iv, iv_len, src, dst, src_len, final
190 *
191 * The iv variable is used as both input and output. On completion of the
192 * AES operation the new IV overwrites the old IV.
193 */
194struct ccp_xts_aes_engine {
195 enum ccp_aes_action action;
196 enum ccp_xts_aes_unit_size unit_size;
197
198 struct scatterlist *key;
199 u32 key_len; /* In bytes */
200
201 struct scatterlist *iv;
202 u32 iv_len; /* In bytes */
203
204 struct scatterlist *src, *dst;
205 u64 src_len; /* In bytes */
206
207 u32 final;
208};
209
210/***** SHA engine *****/
211#define CCP_SHA_BLOCKSIZE SHA256_BLOCK_SIZE
212#define CCP_SHA_CTXSIZE SHA256_DIGEST_SIZE
213
214/**
215 * ccp_sha_type - type of SHA operation
216 *
217 * @CCP_SHA_TYPE_1: SHA-1 operation
218 * @CCP_SHA_TYPE_224: SHA-224 operation
219 * @CCP_SHA_TYPE_256: SHA-256 operation
220 */
221enum ccp_sha_type {
222 CCP_SHA_TYPE_1 = 1,
223 CCP_SHA_TYPE_224,
224 CCP_SHA_TYPE_256,
225 CCP_SHA_TYPE__LAST,
226};
227
228/**
229 * struct ccp_sha_engine - CCP SHA operation
230 * @type: Type of SHA operation
231 * @ctx: current hash value
232 * @ctx_len: length in bytes of hash value
233 * @src: data to be used for this operation
234 * @src_len: length in bytes of data used for this operation
235 * @final: indicates final SHA operation
236 * @msg_bits: total length of the message in bits used in final SHA operation
237 *
238 * Variables required to be set when calling ccp_enqueue_cmd():
239 * - type, ctx, ctx_len, src, src_len, final
240 * - msg_bits if final is non-zero
241 *
242 * The ctx variable is used as both input and output. On completion of the
243 * SHA operation the new hash value overwrites the old hash value.
244 */
245struct ccp_sha_engine {
246 enum ccp_sha_type type;
247
248 struct scatterlist *ctx;
249 u32 ctx_len; /* In bytes */
250
251 struct scatterlist *src;
252 u64 src_len; /* In bytes */
253
254 u32 final; /* Indicates final sha cmd */
255 u64 msg_bits; /* Message length in bits required for
256 * final sha cmd */
257};
258
259/***** RSA engine *****/
260/**
261 * struct ccp_rsa_engine - CCP RSA operation
262 * @key_size: length in bits of RSA key
263 * @exp: RSA exponent
264 * @exp_len: length in bytes of exponent
265 * @mod: RSA modulus
266 * @mod_len: length in bytes of modulus
267 * @src: data to be used for this operation
268 * @dst: data produced by this operation
269 * @src_len: length in bytes of data used for this operation
270 *
271 * Variables required to be set when calling ccp_enqueue_cmd():
272 * - key_size, exp, exp_len, mod, mod_len, src, dst, src_len
273 */
274struct ccp_rsa_engine {
275 u32 key_size; /* In bits */
276
277 struct scatterlist *exp;
278 u32 exp_len; /* In bytes */
279
280 struct scatterlist *mod;
281 u32 mod_len; /* In bytes */
282
283 struct scatterlist *src, *dst;
284 u32 src_len; /* In bytes */
285};
286
287/***** Passthru engine *****/
288/**
289 * ccp_passthru_bitwise - type of bitwise passthru operation
290 *
291 * @CCP_PASSTHRU_BITWISE_NOOP: no bitwise operation performed
292 * @CCP_PASSTHRU_BITWISE_AND: perform bitwise AND of src with mask
293 * @CCP_PASSTHRU_BITWISE_OR: perform bitwise OR of src with mask
294 * @CCP_PASSTHRU_BITWISE_XOR: perform bitwise XOR of src with mask
295 * @CCP_PASSTHRU_BITWISE_MASK: overwrite with mask
296 */
297enum ccp_passthru_bitwise {
298 CCP_PASSTHRU_BITWISE_NOOP = 0,
299 CCP_PASSTHRU_BITWISE_AND,
300 CCP_PASSTHRU_BITWISE_OR,
301 CCP_PASSTHRU_BITWISE_XOR,
302 CCP_PASSTHRU_BITWISE_MASK,
303 CCP_PASSTHRU_BITWISE__LAST,
304};
305
306/**
307 * ccp_passthru_byteswap - type of byteswap passthru operation
308 *
309 * @CCP_PASSTHRU_BYTESWAP_NOOP: no byte swapping performed
310 * @CCP_PASSTHRU_BYTESWAP_32BIT: swap bytes within 32-bit words
311 * @CCP_PASSTHRU_BYTESWAP_256BIT: swap bytes within 256-bit words
312 */
313enum ccp_passthru_byteswap {
314 CCP_PASSTHRU_BYTESWAP_NOOP = 0,
315 CCP_PASSTHRU_BYTESWAP_32BIT,
316 CCP_PASSTHRU_BYTESWAP_256BIT,
317 CCP_PASSTHRU_BYTESWAP__LAST,
318};
319
320/**
321 * struct ccp_passthru_engine - CCP pass-through operation
322 * @bit_mod: bitwise operation to perform
323 * @byte_swap: byteswap operation to perform
324 * @mask: mask to be applied to data
325 * @mask_len: length in bytes of mask
326 * @src: data to be used for this operation
327 * @dst: data produced by this operation
328 * @src_len: length in bytes of data used for this operation
329 * @final: indicate final pass-through operation
330 *
331 * Variables required to be set when calling ccp_enqueue_cmd():
332 * - bit_mod, byte_swap, src, dst, src_len
333 * - mask, mask_len if bit_mod is not CCP_PASSTHRU_BITWISE_NOOP
334 */
335struct ccp_passthru_engine {
336 enum ccp_passthru_bitwise bit_mod;
337 enum ccp_passthru_byteswap byte_swap;
338
339 struct scatterlist *mask;
340 u32 mask_len; /* In bytes */
341
342 struct scatterlist *src, *dst;
343 u64 src_len; /* In bytes */
344
345 u32 final;
346};
347
348/***** ECC engine *****/
349#define CCP_ECC_MODULUS_BYTES 48 /* 384-bits */
350#define CCP_ECC_MAX_OPERANDS 6
351#define CCP_ECC_MAX_OUTPUTS 3
352
353/**
354 * ccp_ecc_function - type of ECC function
355 *
356 * @CCP_ECC_FUNCTION_MMUL_384BIT: 384-bit modular multiplication
357 * @CCP_ECC_FUNCTION_MADD_384BIT: 384-bit modular addition
358 * @CCP_ECC_FUNCTION_MINV_384BIT: 384-bit multiplicative inverse
359 * @CCP_ECC_FUNCTION_PADD_384BIT: 384-bit point addition
360 * @CCP_ECC_FUNCTION_PMUL_384BIT: 384-bit point multiplication
361 * @CCP_ECC_FUNCTION_PDBL_384BIT: 384-bit point doubling
362 */
363enum ccp_ecc_function {
364 CCP_ECC_FUNCTION_MMUL_384BIT = 0,
365 CCP_ECC_FUNCTION_MADD_384BIT,
366 CCP_ECC_FUNCTION_MINV_384BIT,
367 CCP_ECC_FUNCTION_PADD_384BIT,
368 CCP_ECC_FUNCTION_PMUL_384BIT,
369 CCP_ECC_FUNCTION_PDBL_384BIT,
370};
371
372/**
373 * struct ccp_ecc_modular_math - CCP ECC modular math parameters
374 * @operand_1: first operand for the modular math operation
375 * @operand_1_len: length of the first operand
376 * @operand_2: second operand for the modular math operation
377 * (not used for CCP_ECC_FUNCTION_MINV_384BIT)
378 * @operand_2_len: length of the second operand
379 * (not used for CCP_ECC_FUNCTION_MINV_384BIT)
380 * @result: result of the modular math operation
381 * @result_len: length of the supplied result buffer
382 */
383struct ccp_ecc_modular_math {
384 struct scatterlist *operand_1;
385 unsigned int operand_1_len; /* In bytes */
386
387 struct scatterlist *operand_2;
388 unsigned int operand_2_len; /* In bytes */
389
390 struct scatterlist *result;
391 unsigned int result_len; /* In bytes */
392};
393
394/**
395 * struct ccp_ecc_point - CCP ECC point definition
396 * @x: the x coordinate of the ECC point
397 * @x_len: the length of the x coordinate
398 * @y: the y coordinate of the ECC point
399 * @y_len: the length of the y coordinate
400 */
401struct ccp_ecc_point {
402 struct scatterlist *x;
403 unsigned int x_len; /* In bytes */
404
405 struct scatterlist *y;
406 unsigned int y_len; /* In bytes */
407};
408
409/**
410 * struct ccp_ecc_point_math - CCP ECC point math parameters
411 * @point_1: the first point of the ECC point math operation
412 * @point_2: the second point of the ECC point math operation
413 * (only used for CCP_ECC_FUNCTION_PADD_384BIT)
414 * @domain_a: the a parameter of the ECC curve
415 * @domain_a_len: the length of the a parameter
416 * @scalar: the scalar parameter for the point match operation
417 * (only used for CCP_ECC_FUNCTION_PMUL_384BIT)
418 * @scalar_len: the length of the scalar parameter
419 * (only used for CCP_ECC_FUNCTION_PMUL_384BIT)
420 * @result: the point resulting from the point math operation
421 */
422struct ccp_ecc_point_math {
423 struct ccp_ecc_point point_1;
424 struct ccp_ecc_point point_2;
425
426 struct scatterlist *domain_a;
427 unsigned int domain_a_len; /* In bytes */
428
429 struct scatterlist *scalar;
430 unsigned int scalar_len; /* In bytes */
431
432 struct ccp_ecc_point result;
433};
434
435/**
436 * struct ccp_ecc_engine - CCP ECC operation
437 * @function: ECC function to perform
438 * @mod: ECC modulus
439 * @mod_len: length in bytes of modulus
440 * @mm: module math parameters
441 * @pm: point math parameters
442 * @ecc_result: result of the ECC operation
443 *
444 * Variables required to be set when calling ccp_enqueue_cmd():
445 * - function, mod, mod_len
446 * - operand, operand_len, operand_count, output, output_len, output_count
447 * - ecc_result
448 */
449struct ccp_ecc_engine {
450 enum ccp_ecc_function function;
451
452 struct scatterlist *mod;
453 u32 mod_len; /* In bytes */
454
455 union {
456 struct ccp_ecc_modular_math mm;
457 struct ccp_ecc_point_math pm;
458 } u;
459
460 u16 ecc_result;
461};
462
463
464/**
465 * ccp_engine - CCP operation identifiers
466 *
467 * @CCP_ENGINE_AES: AES operation
468 * @CCP_ENGINE_XTS_AES: 128-bit XTS AES operation
469 * @CCP_ENGINE_RSVD1: unused
470 * @CCP_ENGINE_SHA: SHA operation
471 * @CCP_ENGINE_RSA: RSA operation
472 * @CCP_ENGINE_PASSTHRU: pass-through operation
473 * @CCP_ENGINE_ZLIB_DECOMPRESS: unused
474 * @CCP_ENGINE_ECC: ECC operation
475 */
476enum ccp_engine {
477 CCP_ENGINE_AES = 0,
478 CCP_ENGINE_XTS_AES_128,
479 CCP_ENGINE_RSVD1,
480 CCP_ENGINE_SHA,
481 CCP_ENGINE_RSA,
482 CCP_ENGINE_PASSTHRU,
483 CCP_ENGINE_ZLIB_DECOMPRESS,
484 CCP_ENGINE_ECC,
485 CCP_ENGINE__LAST,
486};
487
488/* Flag values for flags member of ccp_cmd */
489#define CCP_CMD_MAY_BACKLOG 0x00000001
490
491/**
492 * struct ccp_cmd - CPP operation request
493 * @entry: list element (ccp driver use only)
494 * @work: work element used for callbacks (ccp driver use only)
495 * @ccp: CCP device to be run on (ccp driver use only)
496 * @ret: operation return code (ccp driver use only)
497 * @flags: cmd processing flags
498 * @engine: CCP operation to perform
499 * @engine_error: CCP engine return code
500 * @u: engine specific structures, refer to specific engine struct below
501 * @callback: operation completion callback function
502 * @data: parameter value to be supplied to the callback function
503 *
504 * Variables required to be set when calling ccp_enqueue_cmd():
505 * - engine, callback
506 * - See the operation structures below for what is required for each
507 * operation.
508 */
509struct ccp_cmd {
510 /* The list_head, work_struct, ccp and ret variables are for use
511 * by the CCP driver only.
512 */
513 struct list_head entry;
514 struct work_struct work;
515 struct ccp_device *ccp;
516 int ret;
517
518 u32 flags;
519
520 enum ccp_engine engine;
521 u32 engine_error;
522
523 union {
524 struct ccp_aes_engine aes;
525 struct ccp_xts_aes_engine xts;
526 struct ccp_sha_engine sha;
527 struct ccp_rsa_engine rsa;
528 struct ccp_passthru_engine passthru;
529 struct ccp_ecc_engine ecc;
530 } u;
531
532 /* Completion callback support */
533 void (*callback)(void *data, int err);
534 void *data;
535};
536
537#endif
diff --git a/include/linux/ceph/buffer.h b/include/linux/ceph/buffer.h
index 58d19014068f..07ad423cc37f 100644
--- a/include/linux/ceph/buffer.h
+++ b/include/linux/ceph/buffer.h
@@ -17,7 +17,6 @@ struct ceph_buffer {
17 struct kref kref; 17 struct kref kref;
18 struct kvec vec; 18 struct kvec vec;
19 size_t alloc_len; 19 size_t alloc_len;
20 bool is_vmalloc;
21}; 20};
22 21
23extern struct ceph_buffer *ceph_buffer_new(size_t len, gfp_t gfp); 22extern struct ceph_buffer *ceph_buffer_new(size_t len, gfp_t gfp);
diff --git a/include/linux/ceph/ceph_features.h b/include/linux/ceph/ceph_features.h
index 4c42080347af..138448f766b4 100644
--- a/include/linux/ceph/ceph_features.h
+++ b/include/linux/ceph/ceph_features.h
@@ -4,42 +4,73 @@
4/* 4/*
5 * feature bits 5 * feature bits
6 */ 6 */
7#define CEPH_FEATURE_UID (1<<0) 7#define CEPH_FEATURE_UID (1ULL<<0)
8#define CEPH_FEATURE_NOSRCADDR (1<<1) 8#define CEPH_FEATURE_NOSRCADDR (1ULL<<1)
9#define CEPH_FEATURE_MONCLOCKCHECK (1<<2) 9#define CEPH_FEATURE_MONCLOCKCHECK (1ULL<<2)
10#define CEPH_FEATURE_FLOCK (1<<3) 10#define CEPH_FEATURE_FLOCK (1ULL<<3)
11#define CEPH_FEATURE_SUBSCRIBE2 (1<<4) 11#define CEPH_FEATURE_SUBSCRIBE2 (1ULL<<4)
12#define CEPH_FEATURE_MONNAMES (1<<5) 12#define CEPH_FEATURE_MONNAMES (1ULL<<5)
13#define CEPH_FEATURE_RECONNECT_SEQ (1<<6) 13#define CEPH_FEATURE_RECONNECT_SEQ (1ULL<<6)
14#define CEPH_FEATURE_DIRLAYOUTHASH (1<<7) 14#define CEPH_FEATURE_DIRLAYOUTHASH (1ULL<<7)
15#define CEPH_FEATURE_OBJECTLOCATOR (1<<8) 15#define CEPH_FEATURE_OBJECTLOCATOR (1ULL<<8)
16#define CEPH_FEATURE_PGID64 (1<<9) 16#define CEPH_FEATURE_PGID64 (1ULL<<9)
17#define CEPH_FEATURE_INCSUBOSDMAP (1<<10) 17#define CEPH_FEATURE_INCSUBOSDMAP (1ULL<<10)
18#define CEPH_FEATURE_PGPOOL3 (1<<11) 18#define CEPH_FEATURE_PGPOOL3 (1ULL<<11)
19#define CEPH_FEATURE_OSDREPLYMUX (1<<12) 19#define CEPH_FEATURE_OSDREPLYMUX (1ULL<<12)
20#define CEPH_FEATURE_OSDENC (1<<13) 20#define CEPH_FEATURE_OSDENC (1ULL<<13)
21#define CEPH_FEATURE_OMAP (1<<14) 21#define CEPH_FEATURE_OMAP (1ULL<<14)
22#define CEPH_FEATURE_MONENC (1<<15) 22#define CEPH_FEATURE_MONENC (1ULL<<15)
23#define CEPH_FEATURE_QUERY_T (1<<16) 23#define CEPH_FEATURE_QUERY_T (1ULL<<16)
24#define CEPH_FEATURE_INDEP_PG_MAP (1<<17) 24#define CEPH_FEATURE_INDEP_PG_MAP (1ULL<<17)
25#define CEPH_FEATURE_CRUSH_TUNABLES (1<<18) 25#define CEPH_FEATURE_CRUSH_TUNABLES (1ULL<<18)
26#define CEPH_FEATURE_CHUNKY_SCRUB (1<<19) 26#define CEPH_FEATURE_CHUNKY_SCRUB (1ULL<<19)
27#define CEPH_FEATURE_MON_NULLROUTE (1<<20) 27#define CEPH_FEATURE_MON_NULLROUTE (1ULL<<20)
28#define CEPH_FEATURE_MON_GV (1<<21) 28#define CEPH_FEATURE_MON_GV (1ULL<<21)
29#define CEPH_FEATURE_BACKFILL_RESERVATION (1<<22) 29#define CEPH_FEATURE_BACKFILL_RESERVATION (1ULL<<22)
30#define CEPH_FEATURE_MSG_AUTH (1<<23) 30#define CEPH_FEATURE_MSG_AUTH (1ULL<<23)
31#define CEPH_FEATURE_RECOVERY_RESERVATION (1<<24) 31#define CEPH_FEATURE_RECOVERY_RESERVATION (1ULL<<24)
32#define CEPH_FEATURE_CRUSH_TUNABLES2 (1<<25) 32#define CEPH_FEATURE_CRUSH_TUNABLES2 (1ULL<<25)
33#define CEPH_FEATURE_CREATEPOOLID (1<<26) 33#define CEPH_FEATURE_CREATEPOOLID (1ULL<<26)
34#define CEPH_FEATURE_REPLY_CREATE_INODE (1<<27) 34#define CEPH_FEATURE_REPLY_CREATE_INODE (1ULL<<27)
35#define CEPH_FEATURE_OSD_HBMSGS (1<<28) 35#define CEPH_FEATURE_OSD_HBMSGS (1ULL<<28)
36#define CEPH_FEATURE_MDSENC (1<<29) 36#define CEPH_FEATURE_MDSENC (1ULL<<29)
37#define CEPH_FEATURE_OSDHASHPSPOOL (1<<30) 37#define CEPH_FEATURE_OSDHASHPSPOOL (1ULL<<30)
38#define CEPH_FEATURE_MON_SINGLE_PAXOS (1ULL<<31)
39#define CEPH_FEATURE_OSD_SNAPMAPPER (1ULL<<32)
40#define CEPH_FEATURE_MON_SCRUB (1ULL<<33)
41#define CEPH_FEATURE_OSD_PACKED_RECOVERY (1ULL<<34)
42#define CEPH_FEATURE_OSD_CACHEPOOL (1ULL<<35)
43#define CEPH_FEATURE_CRUSH_V2 (1ULL<<36) /* new indep; SET_* steps */
44#define CEPH_FEATURE_EXPORT_PEER (1ULL<<37)
45#define CEPH_FEATURE_OSD_ERASURE_CODES (1ULL<<38)
46
47/*
48 * The introduction of CEPH_FEATURE_OSD_SNAPMAPPER caused the feature
49 * vector to evaluate to 64 bit ~0. To cope, we designate 1ULL << 63
50 * to mean 33 bit ~0, and introduce a helper below to do the
51 * translation.
52 *
53 * This was introduced by ceph.git commit
54 * 9ea02b84104045c2ffd7e7f4e7af512953855ecd v0.58-657-g9ea02b8
55 * and fixed by ceph.git commit
56 * 4255b5c2fb54ae40c53284b3ab700fdfc7e61748 v0.65-263-g4255b5c
57 */
58#define CEPH_FEATURE_RESERVED (1ULL<<63)
59
60static inline u64 ceph_sanitize_features(u64 features)
61{
62 if (features & CEPH_FEATURE_RESERVED) {
63 /* everything through OSD_SNAPMAPPER */
64 return 0x1ffffffffull;
65 } else {
66 return features;
67 }
68}
38 69
39/* 70/*
40 * Features supported. 71 * Features supported.
41 */ 72 */
42#define CEPH_FEATURES_SUPPORTED_DEFAULT \ 73#define CEPH_FEATURES_SUPPORTED_DEFAULT \
43 (CEPH_FEATURE_NOSRCADDR | \ 74 (CEPH_FEATURE_NOSRCADDR | \
44 CEPH_FEATURE_RECONNECT_SEQ | \ 75 CEPH_FEATURE_RECONNECT_SEQ | \
45 CEPH_FEATURE_PGID64 | \ 76 CEPH_FEATURE_PGID64 | \
@@ -48,7 +79,10 @@
48 CEPH_FEATURE_CRUSH_TUNABLES | \ 79 CEPH_FEATURE_CRUSH_TUNABLES | \
49 CEPH_FEATURE_CRUSH_TUNABLES2 | \ 80 CEPH_FEATURE_CRUSH_TUNABLES2 | \
50 CEPH_FEATURE_REPLY_CREATE_INODE | \ 81 CEPH_FEATURE_REPLY_CREATE_INODE | \
51 CEPH_FEATURE_OSDHASHPSPOOL) 82 CEPH_FEATURE_OSDHASHPSPOOL | \
83 CEPH_FEATURE_OSD_CACHEPOOL | \
84 CEPH_FEATURE_CRUSH_V2 | \
85 CEPH_FEATURE_EXPORT_PEER)
52 86
53#define CEPH_FEATURES_REQUIRED_DEFAULT \ 87#define CEPH_FEATURES_REQUIRED_DEFAULT \
54 (CEPH_FEATURE_NOSRCADDR | \ 88 (CEPH_FEATURE_NOSRCADDR | \
@@ -56,4 +90,5 @@
56 CEPH_FEATURE_PGID64 | \ 90 CEPH_FEATURE_PGID64 | \
57 CEPH_FEATURE_PGPOOL3 | \ 91 CEPH_FEATURE_PGPOOL3 | \
58 CEPH_FEATURE_OSDENC) 92 CEPH_FEATURE_OSDENC)
93
59#endif 94#endif
diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h
index 2ad7b860f062..2623cffc73a1 100644
--- a/include/linux/ceph/ceph_fs.h
+++ b/include/linux/ceph/ceph_fs.h
@@ -53,6 +53,29 @@ struct ceph_file_layout {
53 __le32 fl_pg_pool; /* namespace, crush ruleset, rep level */ 53 __le32 fl_pg_pool; /* namespace, crush ruleset, rep level */
54} __attribute__ ((packed)); 54} __attribute__ ((packed));
55 55
56#define ceph_file_layout_su(l) ((__s32)le32_to_cpu((l).fl_stripe_unit))
57#define ceph_file_layout_stripe_count(l) \
58 ((__s32)le32_to_cpu((l).fl_stripe_count))
59#define ceph_file_layout_object_size(l) ((__s32)le32_to_cpu((l).fl_object_size))
60#define ceph_file_layout_cas_hash(l) ((__s32)le32_to_cpu((l).fl_cas_hash))
61#define ceph_file_layout_object_su(l) \
62 ((__s32)le32_to_cpu((l).fl_object_stripe_unit))
63#define ceph_file_layout_pg_pool(l) \
64 ((__s32)le32_to_cpu((l).fl_pg_pool))
65
66static inline unsigned ceph_file_layout_stripe_width(struct ceph_file_layout *l)
67{
68 return le32_to_cpu(l->fl_stripe_unit) *
69 le32_to_cpu(l->fl_stripe_count);
70}
71
72/* "period" == bytes before i start on a new set of objects */
73static inline unsigned ceph_file_layout_period(struct ceph_file_layout *l)
74{
75 return le32_to_cpu(l->fl_object_size) *
76 le32_to_cpu(l->fl_stripe_count);
77}
78
56#define CEPH_MIN_STRIPE_UNIT 65536 79#define CEPH_MIN_STRIPE_UNIT 65536
57 80
58int ceph_file_layout_is_valid(const struct ceph_file_layout *layout); 81int ceph_file_layout_is_valid(const struct ceph_file_layout *layout);
@@ -282,6 +305,8 @@ enum {
282 CEPH_SESSION_RENEWCAPS, 305 CEPH_SESSION_RENEWCAPS,
283 CEPH_SESSION_STALE, 306 CEPH_SESSION_STALE,
284 CEPH_SESSION_RECALL_STATE, 307 CEPH_SESSION_RECALL_STATE,
308 CEPH_SESSION_FLUSHMSG,
309 CEPH_SESSION_FLUSHMSG_ACK,
285}; 310};
286 311
287extern const char *ceph_session_op_name(int op); 312extern const char *ceph_session_op_name(int op);
@@ -457,7 +482,8 @@ struct ceph_mds_reply_cap {
457 __u8 flags; /* CEPH_CAP_FLAG_* */ 482 __u8 flags; /* CEPH_CAP_FLAG_* */
458} __attribute__ ((packed)); 483} __attribute__ ((packed));
459 484
460#define CEPH_CAP_FLAG_AUTH 1 /* cap is issued by auth mds */ 485#define CEPH_CAP_FLAG_AUTH (1 << 0) /* cap is issued by auth mds */
486#define CEPH_CAP_FLAG_RELEASE (1 << 1) /* release the cap */
461 487
462/* inode record, for bundling with mds reply */ 488/* inode record, for bundling with mds reply */
463struct ceph_mds_reply_inode { 489struct ceph_mds_reply_inode {
@@ -658,6 +684,14 @@ struct ceph_mds_caps {
658 __le32 time_warp_seq; 684 __le32 time_warp_seq;
659} __attribute__ ((packed)); 685} __attribute__ ((packed));
660 686
687struct ceph_mds_cap_peer {
688 __le64 cap_id;
689 __le32 seq;
690 __le32 mseq;
691 __le32 mds;
692 __u8 flags;
693} __attribute__ ((packed));
694
661/* cap release msg head */ 695/* cap release msg head */
662struct ceph_mds_cap_release { 696struct ceph_mds_cap_release {
663 __le32 num; /* number of cap_items that follow */ 697 __le32 num; /* number of cap_items that follow */
diff --git a/include/linux/ceph/decode.h b/include/linux/ceph/decode.h
index 0442c3d800f0..a6ef9cc267ec 100644
--- a/include/linux/ceph/decode.h
+++ b/include/linux/ceph/decode.h
@@ -8,23 +8,6 @@
8 8
9#include <linux/ceph/types.h> 9#include <linux/ceph/types.h>
10 10
11/* This seemed to be the easiest place to define these */
12
13#define U8_MAX ((u8)(~0U))
14#define U16_MAX ((u16)(~0U))
15#define U32_MAX ((u32)(~0U))
16#define U64_MAX ((u64)(~0ULL))
17
18#define S8_MAX ((s8)(U8_MAX >> 1))
19#define S16_MAX ((s16)(U16_MAX >> 1))
20#define S32_MAX ((s32)(U32_MAX >> 1))
21#define S64_MAX ((s64)(U64_MAX >> 1LL))
22
23#define S8_MIN ((s8)(-S8_MAX - 1))
24#define S16_MIN ((s16)(-S16_MAX - 1))
25#define S32_MIN ((s32)(-S32_MAX - 1))
26#define S64_MIN ((s64)(-S64_MAX - 1LL))
27
28/* 11/*
29 * in all cases, 12 * in all cases,
30 * void **p pointer to position pointer 13 * void **p pointer to position pointer
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h
index 2e3024881a5e..2f49aa4c4f7f 100644
--- a/include/linux/ceph/libceph.h
+++ b/include/linux/ceph/libceph.h
@@ -122,8 +122,8 @@ struct ceph_client {
122 122
123 int (*extra_mon_dispatch)(struct ceph_client *, struct ceph_msg *); 123 int (*extra_mon_dispatch)(struct ceph_client *, struct ceph_msg *);
124 124
125 u32 supported_features; 125 u64 supported_features;
126 u32 required_features; 126 u64 required_features;
127 127
128 struct ceph_messenger msgr; /* messenger instance */ 128 struct ceph_messenger msgr; /* messenger instance */
129 struct ceph_mon_client monc; 129 struct ceph_mon_client monc;
@@ -173,15 +173,18 @@ static inline int calc_pages_for(u64 off, u64 len)
173 (off >> PAGE_CACHE_SHIFT); 173 (off >> PAGE_CACHE_SHIFT);
174} 174}
175 175
176extern struct kmem_cache *ceph_inode_cachep;
177extern struct kmem_cache *ceph_cap_cachep;
178extern struct kmem_cache *ceph_dentry_cachep;
179extern struct kmem_cache *ceph_file_cachep;
180
176/* ceph_common.c */ 181/* ceph_common.c */
177extern bool libceph_compatible(void *data); 182extern bool libceph_compatible(void *data);
178 183
179extern const char *ceph_msg_type_name(int type); 184extern const char *ceph_msg_type_name(int type);
180extern int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid); 185extern int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid);
181extern struct kmem_cache *ceph_inode_cachep; 186extern void *ceph_kvmalloc(size_t size, gfp_t flags);
182extern struct kmem_cache *ceph_cap_cachep; 187extern void ceph_kvfree(const void *ptr);
183extern struct kmem_cache *ceph_dentry_cachep;
184extern struct kmem_cache *ceph_file_cachep;
185 188
186extern struct ceph_options *ceph_parse_options(char *options, 189extern struct ceph_options *ceph_parse_options(char *options,
187 const char *dev_name, const char *dev_name_end, 190 const char *dev_name, const char *dev_name_end,
@@ -192,8 +195,8 @@ extern int ceph_compare_options(struct ceph_options *new_opt,
192 struct ceph_client *client); 195 struct ceph_client *client);
193extern struct ceph_client *ceph_create_client(struct ceph_options *opt, 196extern struct ceph_client *ceph_create_client(struct ceph_options *opt,
194 void *private, 197 void *private,
195 unsigned supported_features, 198 u64 supported_features,
196 unsigned required_features); 199 u64 required_features);
197extern u64 ceph_client_id(struct ceph_client *client); 200extern u64 ceph_client_id(struct ceph_client *client);
198extern void ceph_destroy_client(struct ceph_client *client); 201extern void ceph_destroy_client(struct ceph_client *client);
199extern int __ceph_open_session(struct ceph_client *client, 202extern int __ceph_open_session(struct ceph_client *client,
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h
index 7c1420bb1dce..d21f2dba0731 100644
--- a/include/linux/ceph/messenger.h
+++ b/include/linux/ceph/messenger.h
@@ -1,6 +1,7 @@
1#ifndef __FS_CEPH_MESSENGER_H 1#ifndef __FS_CEPH_MESSENGER_H
2#define __FS_CEPH_MESSENGER_H 2#define __FS_CEPH_MESSENGER_H
3 3
4#include <linux/blk_types.h>
4#include <linux/kref.h> 5#include <linux/kref.h>
5#include <linux/mutex.h> 6#include <linux/mutex.h>
6#include <linux/net.h> 7#include <linux/net.h>
@@ -60,8 +61,8 @@ struct ceph_messenger {
60 u32 global_seq; 61 u32 global_seq;
61 spinlock_t global_seq_lock; 62 spinlock_t global_seq_lock;
62 63
63 u32 supported_features; 64 u64 supported_features;
64 u32 required_features; 65 u64 required_features;
65}; 66};
66 67
67enum ceph_msg_data_type { 68enum ceph_msg_data_type {
@@ -119,8 +120,7 @@ struct ceph_msg_data_cursor {
119#ifdef CONFIG_BLOCK 120#ifdef CONFIG_BLOCK
120 struct { /* bio */ 121 struct { /* bio */
121 struct bio *bio; /* bio from list */ 122 struct bio *bio; /* bio from list */
122 unsigned int vector_index; /* vector from bio */ 123 struct bvec_iter bvec_iter;
123 unsigned int vector_offset; /* bytes from vector */
124 }; 124 };
125#endif /* CONFIG_BLOCK */ 125#endif /* CONFIG_BLOCK */
126 struct { /* pages */ 126 struct { /* pages */
@@ -154,10 +154,9 @@ struct ceph_msg {
154 struct list_head list_head; /* links for connection lists */ 154 struct list_head list_head; /* links for connection lists */
155 155
156 struct kref kref; 156 struct kref kref;
157 bool front_is_vmalloc;
158 bool more_to_follow; 157 bool more_to_follow;
159 bool needs_out_seq; 158 bool needs_out_seq;
160 int front_max; 159 int front_alloc_len;
161 unsigned long ack_stamp; /* tx: when we were acked */ 160 unsigned long ack_stamp; /* tx: when we were acked */
162 161
163 struct ceph_msgpool *pool; 162 struct ceph_msgpool *pool;
@@ -192,7 +191,7 @@ struct ceph_connection {
192 191
193 struct ceph_entity_name peer_name; /* peer name */ 192 struct ceph_entity_name peer_name; /* peer name */
194 193
195 unsigned peer_features; 194 u64 peer_features;
196 u32 connect_seq; /* identify the most recent connection 195 u32 connect_seq; /* identify the most recent connection
197 attempt for this connection, client */ 196 attempt for this connection, client */
198 u32 peer_global_seq; /* peer's global seq for this connection */ 197 u32 peer_global_seq; /* peer's global seq for this connection */
@@ -256,8 +255,8 @@ extern void ceph_msgr_flush(void);
256 255
257extern void ceph_messenger_init(struct ceph_messenger *msgr, 256extern void ceph_messenger_init(struct ceph_messenger *msgr,
258 struct ceph_entity_addr *myaddr, 257 struct ceph_entity_addr *myaddr,
259 u32 supported_features, 258 u64 supported_features,
260 u32 required_features, 259 u64 required_features,
261 bool nocrc); 260 bool nocrc);
262 261
263extern void ceph_con_init(struct ceph_connection *con, void *private, 262extern void ceph_con_init(struct ceph_connection *con, void *private,
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
index 8f47625a0661..fd47e872ebcc 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -12,12 +12,6 @@
12#include <linux/ceph/auth.h> 12#include <linux/ceph/auth.h>
13#include <linux/ceph/pagelist.h> 13#include <linux/ceph/pagelist.h>
14 14
15/*
16 * Maximum object name size
17 * (must be at least as big as RBD_MAX_MD_NAME_LEN -- currently 100)
18 */
19#define MAX_OBJ_NAME_SIZE 100
20
21struct ceph_msg; 15struct ceph_msg;
22struct ceph_snap_context; 16struct ceph_snap_context;
23struct ceph_osd_request; 17struct ceph_osd_request;
@@ -138,6 +132,7 @@ struct ceph_osd_request {
138 __le64 *r_request_pool; 132 __le64 *r_request_pool;
139 void *r_request_pgid; 133 void *r_request_pgid;
140 __le32 *r_request_attempts; 134 __le32 *r_request_attempts;
135 bool r_paused;
141 struct ceph_eversion *r_request_reassert_version; 136 struct ceph_eversion *r_request_reassert_version;
142 137
143 int r_result; 138 int r_result;
@@ -158,15 +153,21 @@ struct ceph_osd_request {
158 struct inode *r_inode; /* for use by callbacks */ 153 struct inode *r_inode; /* for use by callbacks */
159 void *r_priv; /* ditto */ 154 void *r_priv; /* ditto */
160 155
161 char r_oid[MAX_OBJ_NAME_SIZE]; /* object name */ 156 struct ceph_object_locator r_base_oloc;
162 int r_oid_len; 157 struct ceph_object_id r_base_oid;
158 struct ceph_object_locator r_target_oloc;
159 struct ceph_object_id r_target_oid;
160
163 u64 r_snapid; 161 u64 r_snapid;
164 unsigned long r_stamp; /* send OR check time */ 162 unsigned long r_stamp; /* send OR check time */
165 163
166 struct ceph_file_layout r_file_layout;
167 struct ceph_snap_context *r_snapc; /* snap context for writes */ 164 struct ceph_snap_context *r_snapc; /* snap context for writes */
168}; 165};
169 166
167struct ceph_request_redirect {
168 struct ceph_object_locator oloc;
169};
170
170struct ceph_osd_event { 171struct ceph_osd_event {
171 u64 cookie; 172 u64 cookie;
172 int one_shot; 173 int one_shot;
diff --git a/include/linux/ceph/osdmap.h b/include/linux/ceph/osdmap.h
index d05cc4451af6..49ff69f0746b 100644
--- a/include/linux/ceph/osdmap.h
+++ b/include/linux/ceph/osdmap.h
@@ -35,13 +35,26 @@ struct ceph_pg_pool_info {
35 u8 object_hash; 35 u8 object_hash;
36 u32 pg_num, pgp_num; 36 u32 pg_num, pgp_num;
37 int pg_num_mask, pgp_num_mask; 37 int pg_num_mask, pgp_num_mask;
38 s64 read_tier;
39 s64 write_tier; /* wins for read+write ops */
38 u64 flags; 40 u64 flags;
39 char *name; 41 char *name;
40}; 42};
41 43
42struct ceph_object_locator { 44struct ceph_object_locator {
43 uint64_t pool; 45 s64 pool;
44 char *key; 46};
47
48/*
49 * Maximum supported by kernel client object name length
50 *
51 * (probably outdated: must be >= RBD_MAX_MD_NAME_LEN -- currently 100)
52 */
53#define CEPH_MAX_OID_NAME_LEN 100
54
55struct ceph_object_id {
56 char name[CEPH_MAX_OID_NAME_LEN];
57 int name_len;
45}; 58};
46 59
47struct ceph_pg_mapping { 60struct ceph_pg_mapping {
@@ -73,33 +86,30 @@ struct ceph_osdmap {
73 struct crush_map *crush; 86 struct crush_map *crush;
74}; 87};
75 88
76/* 89static inline void ceph_oid_set_name(struct ceph_object_id *oid,
77 * file layout helpers 90 const char *name)
78 */
79#define ceph_file_layout_su(l) ((__s32)le32_to_cpu((l).fl_stripe_unit))
80#define ceph_file_layout_stripe_count(l) \
81 ((__s32)le32_to_cpu((l).fl_stripe_count))
82#define ceph_file_layout_object_size(l) ((__s32)le32_to_cpu((l).fl_object_size))
83#define ceph_file_layout_cas_hash(l) ((__s32)le32_to_cpu((l).fl_cas_hash))
84#define ceph_file_layout_object_su(l) \
85 ((__s32)le32_to_cpu((l).fl_object_stripe_unit))
86#define ceph_file_layout_pg_pool(l) \
87 ((__s32)le32_to_cpu((l).fl_pg_pool))
88
89static inline unsigned ceph_file_layout_stripe_width(struct ceph_file_layout *l)
90{ 91{
91 return le32_to_cpu(l->fl_stripe_unit) * 92 int len;
92 le32_to_cpu(l->fl_stripe_count); 93
94 len = strlen(name);
95 if (len > sizeof(oid->name)) {
96 WARN(1, "ceph_oid_set_name '%s' len %d vs %zu, truncating\n",
97 name, len, sizeof(oid->name));
98 len = sizeof(oid->name);
99 }
100
101 memcpy(oid->name, name, len);
102 oid->name_len = len;
93} 103}
94 104
95/* "period" == bytes before i start on a new set of objects */ 105static inline void ceph_oid_copy(struct ceph_object_id *dest,
96static inline unsigned ceph_file_layout_period(struct ceph_file_layout *l) 106 struct ceph_object_id *src)
97{ 107{
98 return le32_to_cpu(l->fl_object_size) * 108 BUG_ON(src->name_len > sizeof(dest->name));
99 le32_to_cpu(l->fl_stripe_count); 109 memcpy(dest->name, src->name, src->name_len);
110 dest->name_len = src->name_len;
100} 111}
101 112
102
103static inline int ceph_osd_is_up(struct ceph_osdmap *map, int osd) 113static inline int ceph_osd_is_up(struct ceph_osdmap *map, int osd)
104{ 114{
105 return (osd < map->max_osd) && (map->osd_state[osd] & CEPH_OSD_UP); 115 return (osd < map->max_osd) && (map->osd_state[osd] & CEPH_OSD_UP);
@@ -155,14 +165,20 @@ extern int ceph_calc_file_object_mapping(struct ceph_file_layout *layout,
155 u64 *bno, u64 *oxoff, u64 *oxlen); 165 u64 *bno, u64 *oxoff, u64 *oxlen);
156 166
157/* calculate mapping of object to a placement group */ 167/* calculate mapping of object to a placement group */
158extern int ceph_calc_ceph_pg(struct ceph_pg *pg, const char *oid, 168extern int ceph_oloc_oid_to_pg(struct ceph_osdmap *osdmap,
159 struct ceph_osdmap *osdmap, uint64_t pool); 169 struct ceph_object_locator *oloc,
170 struct ceph_object_id *oid,
171 struct ceph_pg *pg_out);
172
160extern int ceph_calc_pg_acting(struct ceph_osdmap *osdmap, 173extern int ceph_calc_pg_acting(struct ceph_osdmap *osdmap,
161 struct ceph_pg pgid, 174 struct ceph_pg pgid,
162 int *acting); 175 int *acting);
163extern int ceph_calc_pg_primary(struct ceph_osdmap *osdmap, 176extern int ceph_calc_pg_primary(struct ceph_osdmap *osdmap,
164 struct ceph_pg pgid); 177 struct ceph_pg pgid);
165 178
179extern struct ceph_pg_pool_info *ceph_pg_pool_by_id(struct ceph_osdmap *map,
180 u64 id);
181
166extern const char *ceph_pg_pool_name_by_id(struct ceph_osdmap *map, u64 id); 182extern const char *ceph_pg_pool_name_by_id(struct ceph_osdmap *map, u64 id);
167extern int ceph_pg_poolid_by_name(struct ceph_osdmap *map, const char *name); 183extern int ceph_pg_poolid_by_name(struct ceph_osdmap *map, const char *name);
168 184
diff --git a/include/linux/ceph/rados.h b/include/linux/ceph/rados.h
index 68c96a508ac2..96292df4041b 100644
--- a/include/linux/ceph/rados.h
+++ b/include/linux/ceph/rados.h
@@ -344,6 +344,10 @@ enum {
344 CEPH_OSD_FLAG_EXEC_PUBLIC = 0x1000, /* DEPRECATED op may exec (public) */ 344 CEPH_OSD_FLAG_EXEC_PUBLIC = 0x1000, /* DEPRECATED op may exec (public) */
345 CEPH_OSD_FLAG_LOCALIZE_READS = 0x2000, /* read from nearby replica, if any */ 345 CEPH_OSD_FLAG_LOCALIZE_READS = 0x2000, /* read from nearby replica, if any */
346 CEPH_OSD_FLAG_RWORDERED = 0x4000, /* order wrt concurrent reads */ 346 CEPH_OSD_FLAG_RWORDERED = 0x4000, /* order wrt concurrent reads */
347 CEPH_OSD_FLAG_IGNORE_CACHE = 0x8000, /* ignore cache logic */
348 CEPH_OSD_FLAG_SKIPRWLOCKS = 0x10000, /* skip rw locks */
349 CEPH_OSD_FLAG_IGNORE_OVERLAY = 0x20000, /* ignore pool overlay */
350 CEPH_OSD_FLAG_FLUSH = 0x40000, /* this is part of flush */
347}; 351};
348 352
349enum { 353enum {
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 39c1d9469677..5c097596104b 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -21,6 +21,7 @@
21#include <linux/xattr.h> 21#include <linux/xattr.h>
22#include <linux/fs.h> 22#include <linux/fs.h>
23#include <linux/percpu-refcount.h> 23#include <linux/percpu-refcount.h>
24#include <linux/seq_file.h>
24 25
25#ifdef CONFIG_CGROUPS 26#ifdef CONFIG_CGROUPS
26 27
@@ -28,8 +29,6 @@ struct cgroupfs_root;
28struct cgroup_subsys; 29struct cgroup_subsys;
29struct inode; 30struct inode;
30struct cgroup; 31struct cgroup;
31struct css_id;
32struct eventfd_ctx;
33 32
34extern int cgroup_init_early(void); 33extern int cgroup_init_early(void);
35extern int cgroup_init(void); 34extern int cgroup_init(void);
@@ -79,8 +78,6 @@ struct cgroup_subsys_state {
79 struct cgroup_subsys_state *parent; 78 struct cgroup_subsys_state *parent;
80 79
81 unsigned long flags; 80 unsigned long flags;
82 /* ID for this css, if possible */
83 struct css_id __rcu *id;
84 81
85 /* percpu_ref killing and RCU release */ 82 /* percpu_ref killing and RCU release */
86 struct rcu_head rcu_head; 83 struct rcu_head rcu_head;
@@ -239,10 +236,6 @@ struct cgroup {
239 struct rcu_head rcu_head; 236 struct rcu_head rcu_head;
240 struct work_struct destroy_work; 237 struct work_struct destroy_work;
241 238
242 /* List of events which userspace want to receive */
243 struct list_head event_list;
244 spinlock_t event_list_lock;
245
246 /* directory xattrs */ 239 /* directory xattrs */
247 struct simple_xattrs xattrs; 240 struct simple_xattrs xattrs;
248}; 241};
@@ -280,6 +273,9 @@ enum {
280 * - "tasks" is removed. Everything should be at process 273 * - "tasks" is removed. Everything should be at process
281 * granularity. Use "cgroup.procs" instead. 274 * granularity. Use "cgroup.procs" instead.
282 * 275 *
276 * - "cgroup.procs" is not sorted. pids will be unique unless they
277 * got recycled inbetween reads.
278 *
283 * - "release_agent" and "notify_on_release" are removed. 279 * - "release_agent" and "notify_on_release" are removed.
284 * Replacement notification mechanism will be implemented. 280 * Replacement notification mechanism will be implemented.
285 * 281 *
@@ -320,9 +316,6 @@ struct cgroupfs_root {
320 /* Unique id for this hierarchy. */ 316 /* Unique id for this hierarchy. */
321 int hierarchy_id; 317 int hierarchy_id;
322 318
323 /* A list running through the attached subsystems */
324 struct list_head subsys_list;
325
326 /* The root cgroup for this hierarchy */ 319 /* The root cgroup for this hierarchy */
327 struct cgroup top_cgroup; 320 struct cgroup top_cgroup;
328 321
@@ -389,16 +382,6 @@ struct css_set {
389}; 382};
390 383
391/* 384/*
392 * cgroup_map_cb is an abstract callback API for reporting map-valued
393 * control files
394 */
395
396struct cgroup_map_cb {
397 int (*fill)(struct cgroup_map_cb *cb, const char *key, u64 value);
398 void *state;
399};
400
401/*
402 * struct cftype: handler definitions for cgroup control files 385 * struct cftype: handler definitions for cgroup control files
403 * 386 *
404 * When reading/writing to a file: 387 * When reading/writing to a file:
@@ -445,10 +428,6 @@ struct cftype {
445 */ 428 */
446 struct cgroup_subsys *ss; 429 struct cgroup_subsys *ss;
447 430
448 int (*open)(struct inode *inode, struct file *file);
449 ssize_t (*read)(struct cgroup_subsys_state *css, struct cftype *cft,
450 struct file *file,
451 char __user *buf, size_t nbytes, loff_t *ppos);
452 /* 431 /*
453 * read_u64() is a shortcut for the common case of returning a 432 * read_u64() is a shortcut for the common case of returning a
454 * single integer. Use it in place of read() 433 * single integer. Use it in place of read()
@@ -458,24 +437,14 @@ struct cftype {
458 * read_s64() is a signed version of read_u64() 437 * read_s64() is a signed version of read_u64()
459 */ 438 */
460 s64 (*read_s64)(struct cgroup_subsys_state *css, struct cftype *cft); 439 s64 (*read_s64)(struct cgroup_subsys_state *css, struct cftype *cft);
461 /*
462 * read_map() is used for defining a map of key/value
463 * pairs. It should call cb->fill(cb, key, value) for each
464 * entry. The key/value pairs (and their ordering) should not
465 * change between reboots.
466 */
467 int (*read_map)(struct cgroup_subsys_state *css, struct cftype *cft,
468 struct cgroup_map_cb *cb);
469 /*
470 * read_seq_string() is used for outputting a simple sequence
471 * using seqfile.
472 */
473 int (*read_seq_string)(struct cgroup_subsys_state *css,
474 struct cftype *cft, struct seq_file *m);
475 440
476 ssize_t (*write)(struct cgroup_subsys_state *css, struct cftype *cft, 441 /* generic seq_file read interface */
477 struct file *file, 442 int (*seq_show)(struct seq_file *sf, void *v);
478 const char __user *buf, size_t nbytes, loff_t *ppos); 443
444 /* optional ops, implement all or none */
445 void *(*seq_start)(struct seq_file *sf, loff_t *ppos);
446 void *(*seq_next)(struct seq_file *sf, void *v, loff_t *ppos);
447 void (*seq_stop)(struct seq_file *sf, void *v);
479 448
480 /* 449 /*
481 * write_u64() is a shortcut for the common case of accepting 450 * write_u64() is a shortcut for the common case of accepting
@@ -504,27 +473,6 @@ struct cftype {
504 * kick type for multiplexing. 473 * kick type for multiplexing.
505 */ 474 */
506 int (*trigger)(struct cgroup_subsys_state *css, unsigned int event); 475 int (*trigger)(struct cgroup_subsys_state *css, unsigned int event);
507
508 int (*release)(struct inode *inode, struct file *file);
509
510 /*
511 * register_event() callback will be used to add new userspace
512 * waiter for changes related to the cftype. Implement it if
513 * you want to provide this functionality. Use eventfd_signal()
514 * on eventfd to send notification to userspace.
515 */
516 int (*register_event)(struct cgroup_subsys_state *css,
517 struct cftype *cft, struct eventfd_ctx *eventfd,
518 const char *args);
519 /*
520 * unregister_event() callback will be called when userspace
521 * closes the eventfd or on cgroup removing.
522 * This callback must be implemented, if you want provide
523 * notification functionality.
524 */
525 void (*unregister_event)(struct cgroup_subsys_state *css,
526 struct cftype *cft,
527 struct eventfd_ctx *eventfd);
528}; 476};
529 477
530/* 478/*
@@ -538,6 +486,26 @@ struct cftype_set {
538}; 486};
539 487
540/* 488/*
489 * cgroupfs file entry, pointed to from leaf dentry->d_fsdata. Don't
490 * access directly.
491 */
492struct cfent {
493 struct list_head node;
494 struct dentry *dentry;
495 struct cftype *type;
496 struct cgroup_subsys_state *css;
497
498 /* file xattrs */
499 struct simple_xattrs xattrs;
500};
501
502/* seq_file->private points to the following, only ->priv is public */
503struct cgroup_open_file {
504 struct cfent *cfe;
505 void *priv;
506};
507
508/*
541 * See the comment above CGRP_ROOT_SANE_BEHAVIOR for details. This 509 * See the comment above CGRP_ROOT_SANE_BEHAVIOR for details. This
542 * function can be called as long as @cgrp is accessible. 510 * function can be called as long as @cgrp is accessible.
543 */ 511 */
@@ -552,6 +520,18 @@ static inline const char *cgroup_name(const struct cgroup *cgrp)
552 return rcu_dereference(cgrp->name)->name; 520 return rcu_dereference(cgrp->name)->name;
553} 521}
554 522
523static inline struct cgroup_subsys_state *seq_css(struct seq_file *seq)
524{
525 struct cgroup_open_file *of = seq->private;
526 return of->cfe->css;
527}
528
529static inline struct cftype *seq_cft(struct seq_file *seq)
530{
531 struct cgroup_open_file *of = seq->private;
532 return of->cfe->type;
533}
534
555int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); 535int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
556int cgroup_rm_cftypes(struct cftype *cfts); 536int cgroup_rm_cftypes(struct cftype *cfts);
557 537
@@ -631,12 +611,8 @@ struct cgroup_subsys {
631#define MAX_CGROUP_TYPE_NAMELEN 32 611#define MAX_CGROUP_TYPE_NAMELEN 32
632 const char *name; 612 const char *name;
633 613
634 /* 614 /* link to parent, protected by cgroup_lock() */
635 * Link to parent, and list entry in parent's children.
636 * Protected by cgroup_lock()
637 */
638 struct cgroupfs_root *root; 615 struct cgroupfs_root *root;
639 struct list_head sibling;
640 616
641 /* list of cftype_sets */ 617 /* list of cftype_sets */
642 struct list_head cftsets; 618 struct list_head cftsets;
diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h
index b613ffd402d1..7b99d717411d 100644
--- a/include/linux/cgroup_subsys.h
+++ b/include/linux/cgroup_subsys.h
@@ -31,7 +31,7 @@ SUBSYS(devices)
31SUBSYS(freezer) 31SUBSYS(freezer)
32#endif 32#endif
33 33
34#if IS_SUBSYS_ENABLED(CONFIG_NET_CLS_CGROUP) 34#if IS_SUBSYS_ENABLED(CONFIG_CGROUP_NET_CLASSID)
35SUBSYS(net_cls) 35SUBSYS(net_cls)
36#endif 36#endif
37 37
@@ -43,7 +43,7 @@ SUBSYS(blkio)
43SUBSYS(perf) 43SUBSYS(perf)
44#endif 44#endif
45 45
46#if IS_SUBSYS_ENABLED(CONFIG_NETPRIO_CGROUP) 46#if IS_SUBSYS_ENABLED(CONFIG_CGROUP_NET_PRIO)
47SUBSYS(net_prio) 47SUBSYS(net_prio)
48#endif 48#endif
49 49
diff --git a/include/linux/clk-private.h b/include/linux/clk-private.h
index 8138c94409f3..efbf70b9fd84 100644
--- a/include/linux/clk-private.h
+++ b/include/linux/clk-private.h
@@ -12,6 +12,7 @@
12#define __LINUX_CLK_PRIVATE_H 12#define __LINUX_CLK_PRIVATE_H
13 13
14#include <linux/clk-provider.h> 14#include <linux/clk-provider.h>
15#include <linux/kref.h>
15#include <linux/list.h> 16#include <linux/list.h>
16 17
17/* 18/*
@@ -25,10 +26,13 @@
25 26
26#ifdef CONFIG_COMMON_CLK 27#ifdef CONFIG_COMMON_CLK
27 28
29struct module;
30
28struct clk { 31struct clk {
29 const char *name; 32 const char *name;
30 const struct clk_ops *ops; 33 const struct clk_ops *ops;
31 struct clk_hw *hw; 34 struct clk_hw *hw;
35 struct module *owner;
32 struct clk *parent; 36 struct clk *parent;
33 const char **parent_names; 37 const char **parent_names;
34 struct clk **parents; 38 struct clk **parents;
@@ -41,12 +45,14 @@ struct clk {
41 unsigned long flags; 45 unsigned long flags;
42 unsigned int enable_count; 46 unsigned int enable_count;
43 unsigned int prepare_count; 47 unsigned int prepare_count;
48 unsigned long accuracy;
44 struct hlist_head children; 49 struct hlist_head children;
45 struct hlist_node child_node; 50 struct hlist_node child_node;
46 unsigned int notifier_count; 51 unsigned int notifier_count;
47#ifdef CONFIG_COMMON_CLK_DEBUG 52#ifdef CONFIG_DEBUG_FS
48 struct dentry *dentry; 53 struct dentry *dentry;
49#endif 54#endif
55 struct kref ref;
50}; 56};
51 57
52/* 58/*
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 7e59253b8603..939533da93a7 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -29,6 +29,7 @@
29#define CLK_IS_BASIC BIT(5) /* Basic clk, can't do a to_clk_foo() */ 29#define CLK_IS_BASIC BIT(5) /* Basic clk, can't do a to_clk_foo() */
30#define CLK_GET_RATE_NOCACHE BIT(6) /* do not use the cached clk rate */ 30#define CLK_GET_RATE_NOCACHE BIT(6) /* do not use the cached clk rate */
31#define CLK_SET_RATE_NO_REPARENT BIT(7) /* don't re-parent on rate change */ 31#define CLK_SET_RATE_NO_REPARENT BIT(7) /* don't re-parent on rate change */
32#define CLK_GET_ACCURACY_NOCACHE BIT(8) /* do not use the cached clk accuracy */
32 33
33struct clk_hw; 34struct clk_hw;
34 35
@@ -108,6 +109,25 @@ struct clk_hw;
108 * which is likely helpful for most .set_rate implementation. 109 * which is likely helpful for most .set_rate implementation.
109 * Returns 0 on success, -EERROR otherwise. 110 * Returns 0 on success, -EERROR otherwise.
110 * 111 *
112 * @recalc_accuracy: Recalculate the accuracy of this clock. The clock accuracy
113 * is expressed in ppb (parts per billion). The parent accuracy is
114 * an input parameter.
115 * Returns the calculated accuracy. Optional - if this op is not
116 * set then clock accuracy will be initialized to parent accuracy
117 * or 0 (perfect clock) if clock has no parent.
118 *
119 * @set_rate_and_parent: Change the rate and the parent of this clock. The
120 * requested rate is specified by the second argument, which
121 * should typically be the return of .round_rate call. The
122 * third argument gives the parent rate which is likely helpful
123 * for most .set_rate_and_parent implementation. The fourth
124 * argument gives the parent index. This callback is optional (and
125 * unnecessary) for clocks with 0 or 1 parents as well as
126 * for clocks that can tolerate switching the rate and the parent
127 * separately via calls to .set_parent and .set_rate.
128 * Returns 0 on success, -EERROR otherwise.
129 *
130 *
111 * The clk_enable/clk_disable and clk_prepare/clk_unprepare pairs allow 131 * The clk_enable/clk_disable and clk_prepare/clk_unprepare pairs allow
112 * implementations to split any work between atomic (enable) and sleepable 132 * implementations to split any work between atomic (enable) and sleepable
113 * (prepare) contexts. If enabling a clock requires code that might sleep, 133 * (prepare) contexts. If enabling a clock requires code that might sleep,
@@ -139,6 +159,11 @@ struct clk_ops {
139 u8 (*get_parent)(struct clk_hw *hw); 159 u8 (*get_parent)(struct clk_hw *hw);
140 int (*set_rate)(struct clk_hw *hw, unsigned long, 160 int (*set_rate)(struct clk_hw *hw, unsigned long,
141 unsigned long); 161 unsigned long);
162 int (*set_rate_and_parent)(struct clk_hw *hw,
163 unsigned long rate,
164 unsigned long parent_rate, u8 index);
165 unsigned long (*recalc_accuracy)(struct clk_hw *hw,
166 unsigned long parent_accuracy);
142 void (*init)(struct clk_hw *hw); 167 void (*init)(struct clk_hw *hw);
143}; 168};
144 169
@@ -194,6 +219,7 @@ struct clk_hw {
194struct clk_fixed_rate { 219struct clk_fixed_rate {
195 struct clk_hw hw; 220 struct clk_hw hw;
196 unsigned long fixed_rate; 221 unsigned long fixed_rate;
222 unsigned long fixed_accuracy;
197 u8 flags; 223 u8 flags;
198}; 224};
199 225
@@ -201,6 +227,9 @@ extern const struct clk_ops clk_fixed_rate_ops;
201struct clk *clk_register_fixed_rate(struct device *dev, const char *name, 227struct clk *clk_register_fixed_rate(struct device *dev, const char *name,
202 const char *parent_name, unsigned long flags, 228 const char *parent_name, unsigned long flags,
203 unsigned long fixed_rate); 229 unsigned long fixed_rate);
230struct clk *clk_register_fixed_rate_with_accuracy(struct device *dev,
231 const char *name, const char *parent_name, unsigned long flags,
232 unsigned long fixed_rate, unsigned long fixed_accuracy);
204 233
205void of_fixed_clk_setup(struct device_node *np); 234void of_fixed_clk_setup(struct device_node *np);
206 235
@@ -433,6 +462,7 @@ struct clk *clk_get_parent_by_index(struct clk *clk, u8 index);
433unsigned int __clk_get_enable_count(struct clk *clk); 462unsigned int __clk_get_enable_count(struct clk *clk);
434unsigned int __clk_get_prepare_count(struct clk *clk); 463unsigned int __clk_get_prepare_count(struct clk *clk);
435unsigned long __clk_get_rate(struct clk *clk); 464unsigned long __clk_get_rate(struct clk *clk);
465unsigned long __clk_get_accuracy(struct clk *clk);
436unsigned long __clk_get_flags(struct clk *clk); 466unsigned long __clk_get_flags(struct clk *clk);
437bool __clk_is_prepared(struct clk *clk); 467bool __clk_is_prepared(struct clk *clk);
438bool __clk_is_enabled(struct clk *clk); 468bool __clk_is_enabled(struct clk *clk);
@@ -458,6 +488,8 @@ struct clk_onecell_data {
458 unsigned int clk_num; 488 unsigned int clk_num;
459}; 489};
460 490
491extern struct of_device_id __clk_of_table;
492
461#define CLK_OF_DECLARE(name, compat, fn) \ 493#define CLK_OF_DECLARE(name, compat, fn) \
462 static const struct of_device_id __clk_of_table_##name \ 494 static const struct of_device_id __clk_of_table_##name \
463 __used __section(__clk_of_table) \ 495 __used __section(__clk_of_table) \
@@ -512,6 +544,20 @@ static inline const char *of_clk_get_parent_name(struct device_node *np,
512 * for improved portability across platforms 544 * for improved portability across platforms
513 */ 545 */
514 546
547#if IS_ENABLED(CONFIG_PPC)
548
549static inline u32 clk_readl(u32 __iomem *reg)
550{
551 return ioread32be(reg);
552}
553
554static inline void clk_writel(u32 val, u32 __iomem *reg)
555{
556 iowrite32be(val, reg);
557}
558
559#else /* platform dependent I/O accessors */
560
515static inline u32 clk_readl(u32 __iomem *reg) 561static inline u32 clk_readl(u32 __iomem *reg)
516{ 562{
517 return readl(reg); 563 return readl(reg);
@@ -522,5 +568,7 @@ static inline void clk_writel(u32 val, u32 __iomem *reg)
522 writel(val, reg); 568 writel(val, reg);
523} 569}
524 570
571#endif /* platform dependent I/O accessors */
572
525#endif /* CONFIG_COMMON_CLK */ 573#endif /* CONFIG_COMMON_CLK */
526#endif /* CLK_PROVIDER_H */ 574#endif /* CLK_PROVIDER_H */
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 9a6d04524b1a..0dd91148165e 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -82,6 +82,23 @@ int clk_notifier_register(struct clk *clk, struct notifier_block *nb);
82 82
83int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb); 83int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb);
84 84
85/**
86 * clk_get_accuracy - obtain the clock accuracy in ppb (parts per billion)
87 * for a clock source.
88 * @clk: clock source
89 *
90 * This gets the clock source accuracy expressed in ppb.
91 * A perfect clock returns 0.
92 */
93long clk_get_accuracy(struct clk *clk);
94
95#else
96
97static inline long clk_get_accuracy(struct clk *clk)
98{
99 return -ENOTSUPP;
100}
101
85#endif 102#endif
86 103
87/** 104/**
diff --git a/include/linux/clk/at91_pmc.h b/include/linux/clk/at91_pmc.h
new file mode 100644
index 000000000000..a6911ebbd02a
--- /dev/null
+++ b/include/linux/clk/at91_pmc.h
@@ -0,0 +1,192 @@
1/*
2 * include/linux/clk/at91_pmc.h
3 *
4 * Copyright (C) 2005 Ivan Kokshaysky
5 * Copyright (C) SAN People
6 *
7 * Power Management Controller (PMC) - System peripherals registers.
8 * Based on AT91RM9200 datasheet revision E.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 */
15
16#ifndef AT91_PMC_H
17#define AT91_PMC_H
18
19#ifndef __ASSEMBLY__
20extern void __iomem *at91_pmc_base;
21
22#define at91_pmc_read(field) \
23 __raw_readl(at91_pmc_base + field)
24
25#define at91_pmc_write(field, value) \
26 __raw_writel(value, at91_pmc_base + field)
27#else
28.extern at91_pmc_base
29#endif
30
31#define AT91_PMC_SCER 0x00 /* System Clock Enable Register */
32#define AT91_PMC_SCDR 0x04 /* System Clock Disable Register */
33
34#define AT91_PMC_SCSR 0x08 /* System Clock Status Register */
35#define AT91_PMC_PCK (1 << 0) /* Processor Clock */
36#define AT91RM9200_PMC_UDP (1 << 1) /* USB Devcice Port Clock [AT91RM9200 only] */
37#define AT91RM9200_PMC_MCKUDP (1 << 2) /* USB Device Port Master Clock Automatic Disable on Suspend [AT91RM9200 only] */
38#define AT91RM9200_PMC_UHP (1 << 4) /* USB Host Port Clock [AT91RM9200 only] */
39#define AT91SAM926x_PMC_UHP (1 << 6) /* USB Host Port Clock [AT91SAM926x only] */
40#define AT91SAM926x_PMC_UDP (1 << 7) /* USB Devcice Port Clock [AT91SAM926x only] */
41#define AT91_PMC_PCK0 (1 << 8) /* Programmable Clock 0 */
42#define AT91_PMC_PCK1 (1 << 9) /* Programmable Clock 1 */
43#define AT91_PMC_PCK2 (1 << 10) /* Programmable Clock 2 */
44#define AT91_PMC_PCK3 (1 << 11) /* Programmable Clock 3 */
45#define AT91_PMC_PCK4 (1 << 12) /* Programmable Clock 4 [AT572D940HF only] */
46#define AT91_PMC_HCK0 (1 << 16) /* AHB Clock (USB host) [AT91SAM9261 only] */
47#define AT91_PMC_HCK1 (1 << 17) /* AHB Clock (LCD) [AT91SAM9261 only] */
48
49#define AT91_PMC_PCER 0x10 /* Peripheral Clock Enable Register */
50#define AT91_PMC_PCDR 0x14 /* Peripheral Clock Disable Register */
51#define AT91_PMC_PCSR 0x18 /* Peripheral Clock Status Register */
52
53#define AT91_CKGR_UCKR 0x1C /* UTMI Clock Register [some SAM9] */
54#define AT91_PMC_UPLLEN (1 << 16) /* UTMI PLL Enable */
55#define AT91_PMC_UPLLCOUNT (0xf << 20) /* UTMI PLL Start-up Time */
56#define AT91_PMC_BIASEN (1 << 24) /* UTMI BIAS Enable */
57#define AT91_PMC_BIASCOUNT (0xf << 28) /* UTMI BIAS Start-up Time */
58
59#define AT91_CKGR_MOR 0x20 /* Main Oscillator Register [not on SAM9RL] */
60#define AT91_PMC_MOSCEN (1 << 0) /* Main Oscillator Enable */
61#define AT91_PMC_OSCBYPASS (1 << 1) /* Oscillator Bypass */
62#define AT91_PMC_MOSCRCEN (1 << 3) /* Main On-Chip RC Oscillator Enable [some SAM9] */
63#define AT91_PMC_OSCOUNT (0xff << 8) /* Main Oscillator Start-up Time */
64#define AT91_PMC_KEY (0x37 << 16) /* MOR Writing Key */
65#define AT91_PMC_MOSCSEL (1 << 24) /* Main Oscillator Selection [some SAM9] */
66#define AT91_PMC_CFDEN (1 << 25) /* Clock Failure Detector Enable [some SAM9] */
67
68#define AT91_CKGR_MCFR 0x24 /* Main Clock Frequency Register */
69#define AT91_PMC_MAINF (0xffff << 0) /* Main Clock Frequency */
70#define AT91_PMC_MAINRDY (1 << 16) /* Main Clock Ready */
71
72#define AT91_CKGR_PLLAR 0x28 /* PLL A Register */
73#define AT91_CKGR_PLLBR 0x2c /* PLL B Register */
74#define AT91_PMC_DIV (0xff << 0) /* Divider */
75#define AT91_PMC_PLLCOUNT (0x3f << 8) /* PLL Counter */
76#define AT91_PMC_OUT (3 << 14) /* PLL Clock Frequency Range */
77#define AT91_PMC_MUL (0x7ff << 16) /* PLL Multiplier */
78#define AT91_PMC_MUL_GET(n) ((n) >> 16 & 0x7ff)
79#define AT91_PMC3_MUL (0x7f << 18) /* PLL Multiplier [SAMA5 only] */
80#define AT91_PMC3_MUL_GET(n) ((n) >> 18 & 0x7f)
81#define AT91_PMC_USBDIV (3 << 28) /* USB Divisor (PLLB only) */
82#define AT91_PMC_USBDIV_1 (0 << 28)
83#define AT91_PMC_USBDIV_2 (1 << 28)
84#define AT91_PMC_USBDIV_4 (2 << 28)
85#define AT91_PMC_USB96M (1 << 28) /* Divider by 2 Enable (PLLB only) */
86
87#define AT91_PMC_MCKR 0x30 /* Master Clock Register */
88#define AT91_PMC_CSS (3 << 0) /* Master Clock Selection */
89#define AT91_PMC_CSS_SLOW (0 << 0)
90#define AT91_PMC_CSS_MAIN (1 << 0)
91#define AT91_PMC_CSS_PLLA (2 << 0)
92#define AT91_PMC_CSS_PLLB (3 << 0)
93#define AT91_PMC_CSS_UPLL (3 << 0) /* [some SAM9 only] */
94#define PMC_PRES_OFFSET 2
95#define AT91_PMC_PRES (7 << PMC_PRES_OFFSET) /* Master Clock Prescaler */
96#define AT91_PMC_PRES_1 (0 << PMC_PRES_OFFSET)
97#define AT91_PMC_PRES_2 (1 << PMC_PRES_OFFSET)
98#define AT91_PMC_PRES_4 (2 << PMC_PRES_OFFSET)
99#define AT91_PMC_PRES_8 (3 << PMC_PRES_OFFSET)
100#define AT91_PMC_PRES_16 (4 << PMC_PRES_OFFSET)
101#define AT91_PMC_PRES_32 (5 << PMC_PRES_OFFSET)
102#define AT91_PMC_PRES_64 (6 << PMC_PRES_OFFSET)
103#define PMC_ALT_PRES_OFFSET 4
104#define AT91_PMC_ALT_PRES (7 << PMC_ALT_PRES_OFFSET) /* Master Clock Prescaler [alternate location] */
105#define AT91_PMC_ALT_PRES_1 (0 << PMC_ALT_PRES_OFFSET)
106#define AT91_PMC_ALT_PRES_2 (1 << PMC_ALT_PRES_OFFSET)
107#define AT91_PMC_ALT_PRES_4 (2 << PMC_ALT_PRES_OFFSET)
108#define AT91_PMC_ALT_PRES_8 (3 << PMC_ALT_PRES_OFFSET)
109#define AT91_PMC_ALT_PRES_16 (4 << PMC_ALT_PRES_OFFSET)
110#define AT91_PMC_ALT_PRES_32 (5 << PMC_ALT_PRES_OFFSET)
111#define AT91_PMC_ALT_PRES_64 (6 << PMC_ALT_PRES_OFFSET)
112#define AT91_PMC_MDIV (3 << 8) /* Master Clock Division */
113#define AT91RM9200_PMC_MDIV_1 (0 << 8) /* [AT91RM9200 only] */
114#define AT91RM9200_PMC_MDIV_2 (1 << 8)
115#define AT91RM9200_PMC_MDIV_3 (2 << 8)
116#define AT91RM9200_PMC_MDIV_4 (3 << 8)
117#define AT91SAM9_PMC_MDIV_1 (0 << 8) /* [SAM9 only] */
118#define AT91SAM9_PMC_MDIV_2 (1 << 8)
119#define AT91SAM9_PMC_MDIV_4 (2 << 8)
120#define AT91SAM9_PMC_MDIV_6 (3 << 8) /* [some SAM9 only] */
121#define AT91SAM9_PMC_MDIV_3 (3 << 8) /* [some SAM9 only] */
122#define AT91_PMC_PDIV (1 << 12) /* Processor Clock Division [some SAM9 only] */
123#define AT91_PMC_PDIV_1 (0 << 12)
124#define AT91_PMC_PDIV_2 (1 << 12)
125#define AT91_PMC_PLLADIV2 (1 << 12) /* PLLA divisor by 2 [some SAM9 only] */
126#define AT91_PMC_PLLADIV2_OFF (0 << 12)
127#define AT91_PMC_PLLADIV2_ON (1 << 12)
128
129#define AT91_PMC_USB 0x38 /* USB Clock Register [some SAM9 only] */
130#define AT91_PMC_USBS (0x1 << 0) /* USB OHCI Input clock selection */
131#define AT91_PMC_USBS_PLLA (0 << 0)
132#define AT91_PMC_USBS_UPLL (1 << 0)
133#define AT91_PMC_USBS_PLLB (1 << 0) /* [AT91SAMN12 only] */
134#define AT91_PMC_OHCIUSBDIV (0xF << 8) /* Divider for USB OHCI Clock */
135#define AT91_PMC_OHCIUSBDIV_1 (0x0 << 8)
136#define AT91_PMC_OHCIUSBDIV_2 (0x1 << 8)
137
138#define AT91_PMC_SMD 0x3c /* Soft Modem Clock Register [some SAM9 only] */
139#define AT91_PMC_SMDS (0x1 << 0) /* SMD input clock selection */
140#define AT91_PMC_SMD_DIV (0x1f << 8) /* SMD input clock divider */
141#define AT91_PMC_SMDDIV(n) (((n) << 8) & AT91_PMC_SMD_DIV)
142
143#define AT91_PMC_PCKR(n) (0x40 + ((n) * 4)) /* Programmable Clock 0-N Registers */
144#define AT91_PMC_ALT_PCKR_CSS (0x7 << 0) /* Programmable Clock Source Selection [alternate length] */
145#define AT91_PMC_CSS_MASTER (4 << 0) /* [some SAM9 only] */
146#define AT91_PMC_CSSMCK (0x1 << 8) /* CSS or Master Clock Selection */
147#define AT91_PMC_CSSMCK_CSS (0 << 8)
148#define AT91_PMC_CSSMCK_MCK (1 << 8)
149
150#define AT91_PMC_IER 0x60 /* Interrupt Enable Register */
151#define AT91_PMC_IDR 0x64 /* Interrupt Disable Register */
152#define AT91_PMC_SR 0x68 /* Status Register */
153#define AT91_PMC_MOSCS (1 << 0) /* MOSCS Flag */
154#define AT91_PMC_LOCKA (1 << 1) /* PLLA Lock */
155#define AT91_PMC_LOCKB (1 << 2) /* PLLB Lock */
156#define AT91_PMC_MCKRDY (1 << 3) /* Master Clock */
157#define AT91_PMC_LOCKU (1 << 6) /* UPLL Lock [some SAM9] */
158#define AT91_PMC_PCK0RDY (1 << 8) /* Programmable Clock 0 */
159#define AT91_PMC_PCK1RDY (1 << 9) /* Programmable Clock 1 */
160#define AT91_PMC_PCK2RDY (1 << 10) /* Programmable Clock 2 */
161#define AT91_PMC_PCK3RDY (1 << 11) /* Programmable Clock 3 */
162#define AT91_PMC_MOSCSELS (1 << 16) /* Main Oscillator Selection [some SAM9] */
163#define AT91_PMC_MOSCRCS (1 << 17) /* Main On-Chip RC [some SAM9] */
164#define AT91_PMC_CFDEV (1 << 18) /* Clock Failure Detector Event [some SAM9] */
165#define AT91_PMC_IMR 0x6c /* Interrupt Mask Register */
166
167#define AT91_PMC_PLLICPR 0x80 /* PLL Charge Pump Current Register */
168
169#define AT91_PMC_PROT 0xe4 /* Write Protect Mode Register [some SAM9] */
170#define AT91_PMC_WPEN (0x1 << 0) /* Write Protect Enable */
171#define AT91_PMC_WPKEY (0xffffff << 8) /* Write Protect Key */
172#define AT91_PMC_PROTKEY (0x504d43 << 8) /* Activation Code */
173
174#define AT91_PMC_WPSR 0xe8 /* Write Protect Status Register [some SAM9] */
175#define AT91_PMC_WPVS (0x1 << 0) /* Write Protect Violation Status */
176#define AT91_PMC_WPVSRC (0xffff << 8) /* Write Protect Violation Source */
177
178#define AT91_PMC_PCER1 0x100 /* Peripheral Clock Enable Register 1 [SAMA5 only]*/
179#define AT91_PMC_PCDR1 0x104 /* Peripheral Clock Enable Register 1 */
180#define AT91_PMC_PCSR1 0x108 /* Peripheral Clock Enable Register 1 */
181
182#define AT91_PMC_PCR 0x10c /* Peripheral Control Register [some SAM9 and SAMA5] */
183#define AT91_PMC_PCR_PID (0x3f << 0) /* Peripheral ID */
184#define AT91_PMC_PCR_CMD (0x1 << 12) /* Command (read=0, write=1) */
185#define AT91_PMC_PCR_DIV(n) ((n) << 16) /* Divisor Value */
186#define AT91_PMC_PCR_DIV0 0x0 /* Peripheral clock is MCK */
187#define AT91_PMC_PCR_DIV2 0x1 /* Peripheral clock is MCK/2 */
188#define AT91_PMC_PCR_DIV4 0x2 /* Peripheral clock is MCK/4 */
189#define AT91_PMC_PCR_DIV8 0x3 /* Peripheral clock is MCK/8 */
190#define AT91_PMC_PCR_EN (0x1 << 28) /* Enable */
191
192#endif
diff --git a/include/linux/clk/shmobile.h b/include/linux/clk/shmobile.h
new file mode 100644
index 000000000000..f9bf080a1123
--- /dev/null
+++ b/include/linux/clk/shmobile.h
@@ -0,0 +1,19 @@
1/*
2 * Copyright 2013 Ideas On Board SPRL
3 *
4 * Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
12#ifndef __LINUX_CLK_SHMOBILE_H_
13#define __LINUX_CLK_SHMOBILE_H_
14
15#include <linux/types.h>
16
17void rcar_gen2_clocks_init(u32 mode);
18
19#endif
diff --git a/include/linux/clk/tegra.h b/include/linux/clk/tegra.h
index 23a0ceee831f..3ca9fca827a2 100644
--- a/include/linux/clk/tegra.h
+++ b/include/linux/clk/tegra.h
@@ -120,13 +120,6 @@ static inline void tegra_cpu_clock_resume(void)
120} 120}
121#endif 121#endif
122 122
123#ifdef CONFIG_ARCH_TEGRA
124void tegra_periph_reset_deassert(struct clk *c);
125void tegra_periph_reset_assert(struct clk *c);
126#else
127static inline void tegra_periph_reset_deassert(struct clk *c) {}
128static inline void tegra_periph_reset_assert(struct clk *c) {}
129#endif
130void tegra_clocks_apply_init_table(void); 123void tegra_clocks_apply_init_table(void);
131 124
132#endif /* __LINUX_CLK_TEGRA_H_ */ 125#endif /* __LINUX_CLK_TEGRA_H_ */
diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h
new file mode 100644
index 000000000000..092b64168d7f
--- /dev/null
+++ b/include/linux/clk/ti.h
@@ -0,0 +1,298 @@
1/*
2 * TI clock drivers support
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15#ifndef __LINUX_CLK_TI_H__
16#define __LINUX_CLK_TI_H__
17
18#include <linux/clkdev.h>
19
20/**
21 * struct dpll_data - DPLL registers and integration data
22 * @mult_div1_reg: register containing the DPLL M and N bitfields
23 * @mult_mask: mask of the DPLL M bitfield in @mult_div1_reg
24 * @div1_mask: mask of the DPLL N bitfield in @mult_div1_reg
25 * @clk_bypass: struct clk pointer to the clock's bypass clock input
26 * @clk_ref: struct clk pointer to the clock's reference clock input
27 * @control_reg: register containing the DPLL mode bitfield
28 * @enable_mask: mask of the DPLL mode bitfield in @control_reg
29 * @last_rounded_rate: cache of the last rate result of omap2_dpll_round_rate()
30 * @last_rounded_m: cache of the last M result of omap2_dpll_round_rate()
31 * @last_rounded_m4xen: cache of the last M4X result of
32 * omap4_dpll_regm4xen_round_rate()
33 * @last_rounded_lpmode: cache of the last lpmode result of
34 * omap4_dpll_lpmode_recalc()
35 * @max_multiplier: maximum valid non-bypass multiplier value (actual)
36 * @last_rounded_n: cache of the last N result of omap2_dpll_round_rate()
37 * @min_divider: minimum valid non-bypass divider value (actual)
38 * @max_divider: maximum valid non-bypass divider value (actual)
39 * @modes: possible values of @enable_mask
40 * @autoidle_reg: register containing the DPLL autoidle mode bitfield
41 * @idlest_reg: register containing the DPLL idle status bitfield
42 * @autoidle_mask: mask of the DPLL autoidle mode bitfield in @autoidle_reg
43 * @freqsel_mask: mask of the DPLL jitter correction bitfield in @control_reg
44 * @idlest_mask: mask of the DPLL idle status bitfield in @idlest_reg
45 * @lpmode_mask: mask of the DPLL low-power mode bitfield in @control_reg
46 * @m4xen_mask: mask of the DPLL M4X multiplier bitfield in @control_reg
47 * @auto_recal_bit: bitshift of the driftguard enable bit in @control_reg
48 * @recal_en_bit: bitshift of the PRM_IRQENABLE_* bit for recalibration IRQs
49 * @recal_st_bit: bitshift of the PRM_IRQSTATUS_* bit for recalibration IRQs
50 * @flags: DPLL type/features (see below)
51 *
52 * Possible values for @flags:
53 * DPLL_J_TYPE: "J-type DPLL" (only some 36xx, 4xxx DPLLs)
54 *
55 * @freqsel_mask is only used on the OMAP34xx family and AM35xx.
56 *
57 * XXX Some DPLLs have multiple bypass inputs, so it's not technically
58 * correct to only have one @clk_bypass pointer.
59 *
60 * XXX The runtime-variable fields (@last_rounded_rate, @last_rounded_m,
61 * @last_rounded_n) should be separated from the runtime-fixed fields
62 * and placed into a different structure, so that the runtime-fixed data
63 * can be placed into read-only space.
64 */
65struct dpll_data {
66 void __iomem *mult_div1_reg;
67 u32 mult_mask;
68 u32 div1_mask;
69 struct clk *clk_bypass;
70 struct clk *clk_ref;
71 void __iomem *control_reg;
72 u32 enable_mask;
73 unsigned long last_rounded_rate;
74 u16 last_rounded_m;
75 u8 last_rounded_m4xen;
76 u8 last_rounded_lpmode;
77 u16 max_multiplier;
78 u8 last_rounded_n;
79 u8 min_divider;
80 u16 max_divider;
81 u8 modes;
82 void __iomem *autoidle_reg;
83 void __iomem *idlest_reg;
84 u32 autoidle_mask;
85 u32 freqsel_mask;
86 u32 idlest_mask;
87 u32 dco_mask;
88 u32 sddiv_mask;
89 u32 lpmode_mask;
90 u32 m4xen_mask;
91 u8 auto_recal_bit;
92 u8 recal_en_bit;
93 u8 recal_st_bit;
94 u8 flags;
95};
96
97struct clk_hw_omap_ops;
98
99/**
100 * struct clk_hw_omap - OMAP struct clk
101 * @node: list_head connecting this clock into the full clock list
102 * @enable_reg: register to write to enable the clock (see @enable_bit)
103 * @enable_bit: bitshift to write to enable/disable the clock (see @enable_reg)
104 * @flags: see "struct clk.flags possibilities" above
105 * @clksel_reg: for clksel clks, register va containing src/divisor select
106 * @clksel_mask: bitmask in @clksel_reg for the src/divisor selector
107 * @clksel: for clksel clks, pointer to struct clksel for this clock
108 * @dpll_data: for DPLLs, pointer to struct dpll_data for this clock
109 * @clkdm_name: clockdomain name that this clock is contained in
110 * @clkdm: pointer to struct clockdomain, resolved from @clkdm_name at runtime
111 * @ops: clock ops for this clock
112 */
113struct clk_hw_omap {
114 struct clk_hw hw;
115 struct list_head node;
116 unsigned long fixed_rate;
117 u8 fixed_div;
118 void __iomem *enable_reg;
119 u8 enable_bit;
120 u8 flags;
121 void __iomem *clksel_reg;
122 u32 clksel_mask;
123 const struct clksel *clksel;
124 struct dpll_data *dpll_data;
125 const char *clkdm_name;
126 struct clockdomain *clkdm;
127 const struct clk_hw_omap_ops *ops;
128};
129
130/*
131 * struct clk_hw_omap.flags possibilities
132 *
133 * XXX document the rest of the clock flags here
134 *
135 * ENABLE_REG_32BIT: (OMAP1 only) clock control register must be accessed
136 * with 32bit ops, by default OMAP1 uses 16bit ops.
137 * CLOCK_IDLE_CONTROL: (OMAP1 only) clock has autoidle support.
138 * CLOCK_NO_IDLE_PARENT: (OMAP1 only) when clock is enabled, its parent
139 * clock is put to no-idle mode.
140 * ENABLE_ON_INIT: Clock is enabled on init.
141 * INVERT_ENABLE: By default, clock enable bit behavior is '1' enable, '0'
142 * disable. This inverts the behavior making '0' enable and '1' disable.
143 * CLOCK_CLKOUTX2: (OMAP4 only) DPLL CLKOUT and CLKOUTX2 GATE_CTRL
144 * bits share the same register. This flag allows the
145 * omap4_dpllmx*() code to determine which GATE_CTRL bit field
146 * should be used. This is a temporary solution - a better approach
147 * would be to associate clock type-specific data with the clock,
148 * similar to the struct dpll_data approach.
149 * MEMMAP_ADDRESSING: Use memmap addressing to access clock registers.
150 */
151#define ENABLE_REG_32BIT (1 << 0) /* Use 32-bit access */
152#define CLOCK_IDLE_CONTROL (1 << 1)
153#define CLOCK_NO_IDLE_PARENT (1 << 2)
154#define ENABLE_ON_INIT (1 << 3) /* Enable upon framework init */
155#define INVERT_ENABLE (1 << 4) /* 0 enables, 1 disables */
156#define CLOCK_CLKOUTX2 (1 << 5)
157#define MEMMAP_ADDRESSING (1 << 6)
158
159/* CM_CLKEN_PLL*.EN* bit values - not all are available for every DPLL */
160#define DPLL_LOW_POWER_STOP 0x1
161#define DPLL_LOW_POWER_BYPASS 0x5
162#define DPLL_LOCKED 0x7
163
164/* DPLL Type and DCO Selection Flags */
165#define DPLL_J_TYPE 0x1
166
167/* Composite clock component types */
168enum {
169 CLK_COMPONENT_TYPE_GATE = 0,
170 CLK_COMPONENT_TYPE_DIVIDER,
171 CLK_COMPONENT_TYPE_MUX,
172 CLK_COMPONENT_TYPE_MAX,
173};
174
175/**
176 * struct ti_dt_clk - OMAP DT clock alias declarations
177 * @lk: clock lookup definition
178 * @node_name: clock DT node to map to
179 */
180struct ti_dt_clk {
181 struct clk_lookup lk;
182 char *node_name;
183};
184
185#define DT_CLK(dev, con, name) \
186 { \
187 .lk = { \
188 .dev_id = dev, \
189 .con_id = con, \
190 }, \
191 .node_name = name, \
192 }
193
194/* Maximum number of clock memmaps */
195#define CLK_MAX_MEMMAPS 4
196
197typedef void (*ti_of_clk_init_cb_t)(struct clk_hw *, struct device_node *);
198
199/**
200 * struct clk_omap_reg - OMAP register declaration
201 * @offset: offset from the master IP module base address
202 * @index: index of the master IP module
203 */
204struct clk_omap_reg {
205 u16 offset;
206 u16 index;
207};
208
209/**
210 * struct ti_clk_ll_ops - low-level register access ops for a clock
211 * @clk_readl: pointer to register read function
212 * @clk_writel: pointer to register write function
213 *
214 * Low-level register access ops are generally used by the basic clock types
215 * (clk-gate, clk-mux, clk-divider etc.) to provide support for various
216 * low-level hardware interfaces (direct MMIO, regmap etc.), but can also be
217 * used by other hardware-specific clock drivers if needed.
218 */
219struct ti_clk_ll_ops {
220 u32 (*clk_readl)(void __iomem *reg);
221 void (*clk_writel)(u32 val, void __iomem *reg);
222};
223
224extern struct ti_clk_ll_ops *ti_clk_ll_ops;
225
226extern const struct clk_ops ti_clk_divider_ops;
227extern const struct clk_ops ti_clk_mux_ops;
228
229#define to_clk_hw_omap(_hw) container_of(_hw, struct clk_hw_omap, hw)
230
231void omap2_init_clk_hw_omap_clocks(struct clk *clk);
232int omap3_noncore_dpll_enable(struct clk_hw *hw);
233void omap3_noncore_dpll_disable(struct clk_hw *hw);
234int omap3_noncore_dpll_set_rate(struct clk_hw *hw, unsigned long rate,
235 unsigned long parent_rate);
236unsigned long omap4_dpll_regm4xen_recalc(struct clk_hw *hw,
237 unsigned long parent_rate);
238long omap4_dpll_regm4xen_round_rate(struct clk_hw *hw,
239 unsigned long target_rate,
240 unsigned long *parent_rate);
241u8 omap2_init_dpll_parent(struct clk_hw *hw);
242unsigned long omap3_dpll_recalc(struct clk_hw *hw, unsigned long parent_rate);
243long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate,
244 unsigned long *parent_rate);
245void omap2_init_clk_clkdm(struct clk_hw *clk);
246unsigned long omap3_clkoutx2_recalc(struct clk_hw *hw,
247 unsigned long parent_rate);
248int omap2_clkops_enable_clkdm(struct clk_hw *hw);
249void omap2_clkops_disable_clkdm(struct clk_hw *hw);
250int omap2_clk_disable_autoidle_all(void);
251void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks);
252int omap3_dpll4_set_rate(struct clk_hw *clk, unsigned long rate,
253 unsigned long parent_rate);
254int omap2_dflt_clk_enable(struct clk_hw *hw);
255void omap2_dflt_clk_disable(struct clk_hw *hw);
256int omap2_dflt_clk_is_enabled(struct clk_hw *hw);
257void omap3_clk_lock_dpll5(void);
258
259void __iomem *ti_clk_get_reg_addr(struct device_node *node, int index);
260void ti_dt_clocks_register(struct ti_dt_clk *oclks);
261void ti_dt_clk_init_provider(struct device_node *np, int index);
262void ti_dt_clockdomains_setup(void);
263int ti_clk_retry_init(struct device_node *node, struct clk_hw *hw,
264 ti_of_clk_init_cb_t func);
265int of_ti_clk_autoidle_setup(struct device_node *node);
266int ti_clk_add_component(struct device_node *node, struct clk_hw *hw, int type);
267
268int omap3430_dt_clk_init(void);
269int omap3630_dt_clk_init(void);
270int am35xx_dt_clk_init(void);
271int ti81xx_dt_clk_init(void);
272int omap4xxx_dt_clk_init(void);
273int omap5xxx_dt_clk_init(void);
274int dra7xx_dt_clk_init(void);
275int am33xx_dt_clk_init(void);
276int am43xx_dt_clk_init(void);
277
278#ifdef CONFIG_OF
279void of_ti_clk_allow_autoidle_all(void);
280void of_ti_clk_deny_autoidle_all(void);
281#else
282static inline void of_ti_clk_allow_autoidle_all(void) { }
283static inline void of_ti_clk_deny_autoidle_all(void) { }
284#endif
285
286extern const struct clk_hw_omap_ops clkhwops_omap3_dpll;
287extern const struct clk_hw_omap_ops clkhwops_omap4_dpllmx;
288extern const struct clk_hw_omap_ops clkhwops_wait;
289extern const struct clk_hw_omap_ops clkhwops_omap3430es2_dss_usbhost_wait;
290extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_module_wait;
291extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_wait;
292extern const struct clk_hw_omap_ops clkhwops_iclk;
293extern const struct clk_hw_omap_ops clkhwops_iclk_wait;
294extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_ssi_wait;
295extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_dss_usbhost_wait;
296extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_hsotgusb_wait;
297
298#endif
diff --git a/include/linux/clkdev.h b/include/linux/clkdev.h
index a6a6f603103b..94bad77eeb4a 100644
--- a/include/linux/clkdev.h
+++ b/include/linux/clkdev.h
@@ -43,4 +43,9 @@ int clk_add_alias(const char *, const char *, char *, struct device *);
43int clk_register_clkdev(struct clk *, const char *, const char *, ...); 43int clk_register_clkdev(struct clk *, const char *, const char *, ...);
44int clk_register_clkdevs(struct clk *, struct clk_lookup *, size_t); 44int clk_register_clkdevs(struct clk *, struct clk_lookup *, size_t);
45 45
46#ifdef CONFIG_COMMON_CLK
47int __clk_get(struct clk *clk);
48void __clk_put(struct clk *clk);
49#endif
50
46#endif 51#endif
diff --git a/include/linux/cmdline-parser.h b/include/linux/cmdline-parser.h
index a0f9280421ec..2e6dce6e5c2a 100644
--- a/include/linux/cmdline-parser.h
+++ b/include/linux/cmdline-parser.h
@@ -37,9 +37,9 @@ int cmdline_parts_parse(struct cmdline_parts **parts, const char *cmdline);
37struct cmdline_parts *cmdline_parts_find(struct cmdline_parts *parts, 37struct cmdline_parts *cmdline_parts_find(struct cmdline_parts *parts,
38 const char *bdev); 38 const char *bdev);
39 39
40void cmdline_parts_set(struct cmdline_parts *parts, sector_t disk_size, 40int cmdline_parts_set(struct cmdline_parts *parts, sector_t disk_size,
41 int slot, 41 int slot,
42 int (*add_part)(int, struct cmdline_subpart *, void *), 42 int (*add_part)(int, struct cmdline_subpart *, void *),
43 void *param); 43 void *param);
44 44
45#endif /* CMDLINEPARSEH */ 45#endif /* CMDLINEPARSEH */
diff --git a/include/linux/compaction.h b/include/linux/compaction.h
index 091d72e70d8a..7e1c76e3cd68 100644
--- a/include/linux/compaction.h
+++ b/include/linux/compaction.h
@@ -62,6 +62,22 @@ static inline bool compaction_deferred(struct zone *zone, int order)
62 return zone->compact_considered < defer_limit; 62 return zone->compact_considered < defer_limit;
63} 63}
64 64
65/*
66 * Update defer tracking counters after successful compaction of given order,
67 * which means an allocation either succeeded (alloc_success == true) or is
68 * expected to succeed.
69 */
70static inline void compaction_defer_reset(struct zone *zone, int order,
71 bool alloc_success)
72{
73 if (alloc_success) {
74 zone->compact_considered = 0;
75 zone->compact_defer_shift = 0;
76 }
77 if (order >= zone->compact_order_failed)
78 zone->compact_order_failed = order + 1;
79}
80
65/* Returns true if restarting compaction after many failures */ 81/* Returns true if restarting compaction after many failures */
66static inline bool compaction_restarting(struct zone *zone, int order) 82static inline bool compaction_restarting(struct zone *zone, int order)
67{ 83{
diff --git a/include/linux/compat.h b/include/linux/compat.h
index eb8a49d75ab3..3f448c65511b 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -327,17 +327,17 @@ asmlinkage long compat_sys_keyctl(u32 option,
327 u32 arg2, u32 arg3, u32 arg4, u32 arg5); 327 u32 arg2, u32 arg3, u32 arg4, u32 arg5);
328asmlinkage long compat_sys_ustat(unsigned dev, struct compat_ustat __user *u32); 328asmlinkage long compat_sys_ustat(unsigned dev, struct compat_ustat __user *u32);
329 329
330asmlinkage ssize_t compat_sys_readv(unsigned long fd, 330asmlinkage ssize_t compat_sys_readv(compat_ulong_t fd,
331 const struct compat_iovec __user *vec, unsigned long vlen); 331 const struct compat_iovec __user *vec, compat_ulong_t vlen);
332asmlinkage ssize_t compat_sys_writev(unsigned long fd, 332asmlinkage ssize_t compat_sys_writev(compat_ulong_t fd,
333 const struct compat_iovec __user *vec, unsigned long vlen); 333 const struct compat_iovec __user *vec, compat_ulong_t vlen);
334asmlinkage ssize_t compat_sys_preadv(unsigned long fd, 334asmlinkage ssize_t compat_sys_preadv(compat_ulong_t fd,
335 const struct compat_iovec __user *vec, 335 const struct compat_iovec __user *vec,
336 unsigned long vlen, u32 pos_low, u32 pos_high); 336 compat_ulong_t vlen, u32 pos_low, u32 pos_high);
337asmlinkage ssize_t compat_sys_pwritev(unsigned long fd, 337asmlinkage ssize_t compat_sys_pwritev(compat_ulong_t fd,
338 const struct compat_iovec __user *vec, 338 const struct compat_iovec __user *vec,
339 unsigned long vlen, u32 pos_low, u32 pos_high); 339 compat_ulong_t vlen, u32 pos_low, u32 pos_high);
340asmlinkage long comat_sys_lseek(unsigned int, compat_off_t, unsigned int); 340asmlinkage long compat_sys_lseek(unsigned int, compat_off_t, unsigned int);
341 341
342asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv, 342asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv,
343 const compat_uptr_t __user *envp); 343 const compat_uptr_t __user *envp);
@@ -422,7 +422,7 @@ extern long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
422asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid, 422asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid,
423 compat_long_t addr, compat_long_t data); 423 compat_long_t addr, compat_long_t data);
424 424
425asmlinkage long compat_sys_lookup_dcookie(u32, u32, char __user *, size_t); 425asmlinkage long compat_sys_lookup_dcookie(u32, u32, char __user *, compat_size_t);
426/* 426/*
427 * epoll (fs/eventpoll.c) compat bits follow ... 427 * epoll (fs/eventpoll.c) compat bits follow ...
428 */ 428 */
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 24545cd90a25..02ae99e8e6d3 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -37,6 +37,9 @@
37 __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \ 37 __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \
38 (typeof(ptr)) (__ptr + (off)); }) 38 (typeof(ptr)) (__ptr + (off)); })
39 39
40/* Make the optimizer believe the variable can be manipulated arbitrarily. */
41#define OPTIMIZER_HIDE_VAR(var) __asm__ ("" : "=r" (var) : "0" (var))
42
40#ifdef __CHECKER__ 43#ifdef __CHECKER__
41#define __must_be_array(arr) 0 44#define __must_be_array(arr) 0
42#else 45#else
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h
index ded429966c1f..2507fd2a1eb4 100644
--- a/include/linux/compiler-gcc4.h
+++ b/include/linux/compiler-gcc4.h
@@ -75,11 +75,7 @@
75 * 75 *
76 * (asm goto is automatically volatile - the naming reflects this.) 76 * (asm goto is automatically volatile - the naming reflects this.)
77 */ 77 */
78#if GCC_VERSION <= 40801 78#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
79# define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
80#else
81# define asm_volatile_goto(x...) do { asm goto(x); } while (0)
82#endif
83 79
84#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP 80#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
85#if GCC_VERSION >= 40400 81#if GCC_VERSION >= 40400
diff --git a/include/linux/compiler-intel.h b/include/linux/compiler-intel.h
index dc1bd3dcf11f..5529c5239421 100644
--- a/include/linux/compiler-intel.h
+++ b/include/linux/compiler-intel.h
@@ -15,6 +15,7 @@
15 */ 15 */
16#undef barrier 16#undef barrier
17#undef RELOC_HIDE 17#undef RELOC_HIDE
18#undef OPTIMIZER_HIDE_VAR
18 19
19#define barrier() __memory_barrier() 20#define barrier() __memory_barrier()
20 21
@@ -23,6 +24,12 @@
23 __ptr = (unsigned long) (ptr); \ 24 __ptr = (unsigned long) (ptr); \
24 (typeof(ptr)) (__ptr + (off)); }) 25 (typeof(ptr)) (__ptr + (off)); })
25 26
27/* This should act as an optimization barrier on var.
28 * Given that this compiler does not have inline assembly, a compiler barrier
29 * is the best we can do.
30 */
31#define OPTIMIZER_HIDE_VAR(var) barrier()
32
26/* Intel ECC compiler doesn't support __builtin_types_compatible_p() */ 33/* Intel ECC compiler doesn't support __builtin_types_compatible_p() */
27#define __must_be_array(a) 0 34#define __must_be_array(a) 0
28 35
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 92669cd182a6..2472740d7ab2 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -170,6 +170,10 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
170 (typeof(ptr)) (__ptr + (off)); }) 170 (typeof(ptr)) (__ptr + (off)); })
171#endif 171#endif
172 172
173#ifndef OPTIMIZER_HIDE_VAR
174#define OPTIMIZER_HIDE_VAR(var) barrier()
175#endif
176
173/* Not-quite-unique ID. */ 177/* Not-quite-unique ID. */
174#ifndef __UNIQUE_ID 178#ifndef __UNIQUE_ID
175# define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __LINE__) 179# define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __LINE__)
@@ -298,6 +302,11 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
298# define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) 302# define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
299#endif 303#endif
300 304
305/* Is this type a native word size -- useful for atomic operations */
306#ifndef __native_word
307# define __native_word(t) (sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long))
308#endif
309
301/* Compile time object size, -1 for unknown */ 310/* Compile time object size, -1 for unknown */
302#ifndef __compiletime_object_size 311#ifndef __compiletime_object_size
303# define __compiletime_object_size(obj) -1 312# define __compiletime_object_size(obj) -1
@@ -337,6 +346,10 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
337#define compiletime_assert(condition, msg) \ 346#define compiletime_assert(condition, msg) \
338 _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__) 347 _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
339 348
349#define compiletime_assert_atomic_type(t) \
350 compiletime_assert(__native_word(t), \
351 "Need native word sized stores/loads for atomicity.")
352
340/* 353/*
341 * Prevent the compiler from merging or refetching accesses. The compiler 354 * Prevent the compiler from merging or refetching accesses. The compiler
342 * is also forbidden from reordering successive instances of ACCESS_ONCE(), 355 * is also forbidden from reordering successive instances of ACCESS_ONCE(),
diff --git a/include/linux/component.h b/include/linux/component.h
new file mode 100644
index 000000000000..68870182ca1e
--- /dev/null
+++ b/include/linux/component.h
@@ -0,0 +1,32 @@
1#ifndef COMPONENT_H
2#define COMPONENT_H
3
4struct device;
5
6struct component_ops {
7 int (*bind)(struct device *, struct device *, void *);
8 void (*unbind)(struct device *, struct device *, void *);
9};
10
11int component_add(struct device *, const struct component_ops *);
12void component_del(struct device *, const struct component_ops *);
13
14int component_bind_all(struct device *, void *);
15void component_unbind_all(struct device *, void *);
16
17struct master;
18
19struct component_master_ops {
20 int (*add_components)(struct device *, struct master *);
21 int (*bind)(struct device *);
22 void (*unbind)(struct device *);
23};
24
25int component_master_add(struct device *, const struct component_master_ops *);
26void component_master_del(struct device *,
27 const struct component_master_ops *);
28
29int component_master_add_child(struct master *master,
30 int (*compare)(struct device *, void *), void *compare_data);
31
32#endif
diff --git a/include/linux/container.h b/include/linux/container.h
new file mode 100644
index 000000000000..3c03e6fd2035
--- /dev/null
+++ b/include/linux/container.h
@@ -0,0 +1,25 @@
1/*
2 * Definitions for container bus type.
3 *
4 * Copyright (C) 2013, Intel Corporation
5 * Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/device.h>
13
14/* drivers/base/power/container.c */
15extern struct bus_type container_subsys;
16
17struct container_dev {
18 struct device dev;
19 int (*offline)(struct container_dev *cdev);
20};
21
22static inline struct container_dev *to_container_dev(struct device *dev)
23{
24 return container_of(dev, struct container_dev, dev);
25}
diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h
index 158158704c30..37b81bd51ec0 100644
--- a/include/linux/context_tracking.h
+++ b/include/linux/context_tracking.h
@@ -17,13 +17,13 @@ extern void __context_tracking_task_switch(struct task_struct *prev,
17 17
18static inline void user_enter(void) 18static inline void user_enter(void)
19{ 19{
20 if (static_key_false(&context_tracking_enabled)) 20 if (context_tracking_is_enabled())
21 context_tracking_user_enter(); 21 context_tracking_user_enter();
22 22
23} 23}
24static inline void user_exit(void) 24static inline void user_exit(void)
25{ 25{
26 if (static_key_false(&context_tracking_enabled)) 26 if (context_tracking_is_enabled())
27 context_tracking_user_exit(); 27 context_tracking_user_exit();
28} 28}
29 29
@@ -31,7 +31,7 @@ static inline enum ctx_state exception_enter(void)
31{ 31{
32 enum ctx_state prev_ctx; 32 enum ctx_state prev_ctx;
33 33
34 if (!static_key_false(&context_tracking_enabled)) 34 if (!context_tracking_is_enabled())
35 return 0; 35 return 0;
36 36
37 prev_ctx = this_cpu_read(context_tracking.state); 37 prev_ctx = this_cpu_read(context_tracking.state);
@@ -42,7 +42,7 @@ static inline enum ctx_state exception_enter(void)
42 42
43static inline void exception_exit(enum ctx_state prev_ctx) 43static inline void exception_exit(enum ctx_state prev_ctx)
44{ 44{
45 if (static_key_false(&context_tracking_enabled)) { 45 if (context_tracking_is_enabled()) {
46 if (prev_ctx == IN_USER) 46 if (prev_ctx == IN_USER)
47 context_tracking_user_enter(); 47 context_tracking_user_enter();
48 } 48 }
@@ -51,7 +51,7 @@ static inline void exception_exit(enum ctx_state prev_ctx)
51static inline void context_tracking_task_switch(struct task_struct *prev, 51static inline void context_tracking_task_switch(struct task_struct *prev,
52 struct task_struct *next) 52 struct task_struct *next)
53{ 53{
54 if (static_key_false(&context_tracking_enabled)) 54 if (context_tracking_is_enabled())
55 __context_tracking_task_switch(prev, next); 55 __context_tracking_task_switch(prev, next);
56} 56}
57#else 57#else
diff --git a/include/linux/context_tracking_state.h b/include/linux/context_tracking_state.h
index 0f1979d0674f..97a81225d037 100644
--- a/include/linux/context_tracking_state.h
+++ b/include/linux/context_tracking_state.h
@@ -22,15 +22,20 @@ struct context_tracking {
22extern struct static_key context_tracking_enabled; 22extern struct static_key context_tracking_enabled;
23DECLARE_PER_CPU(struct context_tracking, context_tracking); 23DECLARE_PER_CPU(struct context_tracking, context_tracking);
24 24
25static inline bool context_tracking_in_user(void) 25static inline bool context_tracking_is_enabled(void)
26{ 26{
27 return __this_cpu_read(context_tracking.state) == IN_USER; 27 return static_key_false(&context_tracking_enabled);
28} 28}
29 29
30static inline bool context_tracking_active(void) 30static inline bool context_tracking_cpu_is_enabled(void)
31{ 31{
32 return __this_cpu_read(context_tracking.active); 32 return __this_cpu_read(context_tracking.active);
33} 33}
34
35static inline bool context_tracking_in_user(void)
36{
37 return __this_cpu_read(context_tracking.state) == IN_USER;
38}
34#else 39#else
35static inline bool context_tracking_in_user(void) { return false; } 40static inline bool context_tracking_in_user(void) { return false; }
36static inline bool context_tracking_active(void) { return false; } 41static inline bool context_tracking_active(void) { return false; }
diff --git a/include/linux/cpu_cooling.h b/include/linux/cpu_cooling.h
index a5d52eea8232..c303d383def1 100644
--- a/include/linux/cpu_cooling.h
+++ b/include/linux/cpu_cooling.h
@@ -24,6 +24,7 @@
24#ifndef __CPU_COOLING_H__ 24#ifndef __CPU_COOLING_H__
25#define __CPU_COOLING_H__ 25#define __CPU_COOLING_H__
26 26
27#include <linux/of.h>
27#include <linux/thermal.h> 28#include <linux/thermal.h>
28#include <linux/cpumask.h> 29#include <linux/cpumask.h>
29 30
@@ -36,6 +37,24 @@ struct thermal_cooling_device *
36cpufreq_cooling_register(const struct cpumask *clip_cpus); 37cpufreq_cooling_register(const struct cpumask *clip_cpus);
37 38
38/** 39/**
40 * of_cpufreq_cooling_register - create cpufreq cooling device based on DT.
41 * @np: a valid struct device_node to the cooling device device tree node.
42 * @clip_cpus: cpumask of cpus where the frequency constraints will happen
43 */
44#ifdef CONFIG_THERMAL_OF
45struct thermal_cooling_device *
46of_cpufreq_cooling_register(struct device_node *np,
47 const struct cpumask *clip_cpus);
48#else
49static inline struct thermal_cooling_device *
50of_cpufreq_cooling_register(struct device_node *np,
51 const struct cpumask *clip_cpus)
52{
53 return NULL;
54}
55#endif
56
57/**
39 * cpufreq_cooling_unregister - function to remove cpufreq cooling device. 58 * cpufreq_cooling_unregister - function to remove cpufreq cooling device.
40 * @cdev: thermal cooling device pointer. 59 * @cdev: thermal cooling device pointer.
41 */ 60 */
@@ -48,6 +67,12 @@ cpufreq_cooling_register(const struct cpumask *clip_cpus)
48{ 67{
49 return NULL; 68 return NULL;
50} 69}
70static inline struct thermal_cooling_device *
71of_cpufreq_cooling_register(struct device_node *np,
72 const struct cpumask *clip_cpus)
73{
74 return NULL;
75}
51static inline 76static inline
52void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) 77void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)
53{ 78{
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index dc196bbcf227..4d89e0e6f9cc 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -11,6 +11,7 @@
11#ifndef _LINUX_CPUFREQ_H 11#ifndef _LINUX_CPUFREQ_H
12#define _LINUX_CPUFREQ_H 12#define _LINUX_CPUFREQ_H
13 13
14#include <linux/clk.h>
14#include <linux/cpumask.h> 15#include <linux/cpumask.h>
15#include <linux/completion.h> 16#include <linux/completion.h>
16#include <linux/kobject.h> 17#include <linux/kobject.h>
@@ -66,6 +67,7 @@ struct cpufreq_policy {
66 unsigned int cpu; /* cpu nr of CPU managing this policy */ 67 unsigned int cpu; /* cpu nr of CPU managing this policy */
67 unsigned int last_cpu; /* cpu nr of previous CPU that managed 68 unsigned int last_cpu; /* cpu nr of previous CPU that managed
68 * this policy */ 69 * this policy */
70 struct clk *clk;
69 struct cpufreq_cpuinfo cpuinfo;/* see above */ 71 struct cpufreq_cpuinfo cpuinfo;/* see above */
70 72
71 unsigned int min; /* in kHz */ 73 unsigned int min; /* in kHz */
@@ -225,6 +227,11 @@ struct cpufreq_driver {
225 int (*suspend) (struct cpufreq_policy *policy); 227 int (*suspend) (struct cpufreq_policy *policy);
226 int (*resume) (struct cpufreq_policy *policy); 228 int (*resume) (struct cpufreq_policy *policy);
227 struct freq_attr **attr; 229 struct freq_attr **attr;
230
231 /* platform specific boost support code */
232 bool boost_supported;
233 bool boost_enabled;
234 int (*set_boost) (int state);
228}; 235};
229 236
230/* flags */ 237/* flags */
@@ -252,6 +259,15 @@ struct cpufreq_driver {
252 */ 259 */
253#define CPUFREQ_ASYNC_NOTIFICATION (1 << 4) 260#define CPUFREQ_ASYNC_NOTIFICATION (1 << 4)
254 261
262/*
263 * Set by drivers which want cpufreq core to check if CPU is running at a
264 * frequency present in freq-table exposed by the driver. For these drivers if
265 * CPU is found running at an out of table freq, we will try to set it to a freq
266 * from the table. And if that fails, we will stop further boot process by
267 * issuing a BUG_ON().
268 */
269#define CPUFREQ_NEED_INITIAL_FREQ_CHECK (1 << 5)
270
255int cpufreq_register_driver(struct cpufreq_driver *driver_data); 271int cpufreq_register_driver(struct cpufreq_driver *driver_data);
256int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); 272int cpufreq_unregister_driver(struct cpufreq_driver *driver_data);
257 273
@@ -299,6 +315,8 @@ cpufreq_verify_within_cpu_limits(struct cpufreq_policy *policy)
299#define CPUFREQ_NOTIFY (2) 315#define CPUFREQ_NOTIFY (2)
300#define CPUFREQ_START (3) 316#define CPUFREQ_START (3)
301#define CPUFREQ_UPDATE_POLICY_CPU (4) 317#define CPUFREQ_UPDATE_POLICY_CPU (4)
318#define CPUFREQ_CREATE_POLICY (5)
319#define CPUFREQ_REMOVE_POLICY (6)
302 320
303#ifdef CONFIG_CPU_FREQ 321#ifdef CONFIG_CPU_FREQ
304int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list); 322int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list);
@@ -306,6 +324,8 @@ int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list);
306 324
307void cpufreq_notify_transition(struct cpufreq_policy *policy, 325void cpufreq_notify_transition(struct cpufreq_policy *policy,
308 struct cpufreq_freqs *freqs, unsigned int state); 326 struct cpufreq_freqs *freqs, unsigned int state);
327void cpufreq_notify_post_transition(struct cpufreq_policy *policy,
328 struct cpufreq_freqs *freqs, int transition_failed);
309 329
310#else /* CONFIG_CPU_FREQ */ 330#else /* CONFIG_CPU_FREQ */
311static inline int cpufreq_register_notifier(struct notifier_block *nb, 331static inline int cpufreq_register_notifier(struct notifier_block *nb,
@@ -420,6 +440,7 @@ extern struct cpufreq_governor cpufreq_gov_conservative;
420 440
421#define CPUFREQ_ENTRY_INVALID ~0 441#define CPUFREQ_ENTRY_INVALID ~0
422#define CPUFREQ_TABLE_END ~1 442#define CPUFREQ_TABLE_END ~1
443#define CPUFREQ_BOOST_FREQ ~2
423 444
424struct cpufreq_frequency_table { 445struct cpufreq_frequency_table {
425 unsigned int driver_data; /* driver specific data, not used by core */ 446 unsigned int driver_data; /* driver specific data, not used by core */
@@ -439,10 +460,30 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
439 unsigned int target_freq, 460 unsigned int target_freq,
440 unsigned int relation, 461 unsigned int relation,
441 unsigned int *index); 462 unsigned int *index);
463int cpufreq_frequency_table_get_index(struct cpufreq_policy *policy,
464 unsigned int freq);
442 465
443void cpufreq_frequency_table_update_policy_cpu(struct cpufreq_policy *policy); 466void cpufreq_frequency_table_update_policy_cpu(struct cpufreq_policy *policy);
444ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf); 467ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf);
445 468
469#ifdef CONFIG_CPU_FREQ
470int cpufreq_boost_trigger_state(int state);
471int cpufreq_boost_supported(void);
472int cpufreq_boost_enabled(void);
473#else
474static inline int cpufreq_boost_trigger_state(int state)
475{
476 return 0;
477}
478static inline int cpufreq_boost_supported(void)
479{
480 return 0;
481}
482static inline int cpufreq_boost_enabled(void)
483{
484 return 0;
485}
486#endif
446/* the following funtion is for cpufreq core use only */ 487/* the following funtion is for cpufreq core use only */
447struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu); 488struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu);
448 489
@@ -455,6 +496,7 @@ void cpufreq_frequency_table_put_attr(unsigned int cpu);
455int cpufreq_table_validate_and_show(struct cpufreq_policy *policy, 496int cpufreq_table_validate_and_show(struct cpufreq_policy *policy,
456 struct cpufreq_frequency_table *table); 497 struct cpufreq_frequency_table *table);
457 498
499unsigned int cpufreq_generic_get(unsigned int cpu);
458int cpufreq_generic_init(struct cpufreq_policy *policy, 500int cpufreq_generic_init(struct cpufreq_policy *policy,
459 struct cpufreq_frequency_table *table, 501 struct cpufreq_frequency_table *table,
460 unsigned int transition_latency); 502 unsigned int transition_latency);
diff --git a/include/linux/cramfs_fs.h b/include/linux/cramfs_fs.h
deleted file mode 100644
index 133789609f23..000000000000
--- a/include/linux/cramfs_fs.h
+++ /dev/null
@@ -1,10 +0,0 @@
1#ifndef __CRAMFS_H
2#define __CRAMFS_H
3
4#include <uapi/linux/cramfs_fs.h>
5
6/* Uncompression interfaces to the underlying zlib */
7int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen);
8int cramfs_uncompress_init(void);
9void cramfs_uncompress_exit(void);
10#endif
diff --git a/include/linux/cramfs_fs_sb.h b/include/linux/cramfs_fs_sb.h
deleted file mode 100644
index 8390693568fd..000000000000
--- a/include/linux/cramfs_fs_sb.h
+++ /dev/null
@@ -1,20 +0,0 @@
1#ifndef _CRAMFS_FS_SB
2#define _CRAMFS_FS_SB
3
4/*
5 * cramfs super-block data in memory
6 */
7struct cramfs_sb_info {
8 unsigned long magic;
9 unsigned long size;
10 unsigned long blocks;
11 unsigned long files;
12 unsigned long flags;
13};
14
15static inline struct cramfs_sb_info *CRAMFS_SB(struct super_block *sb)
16{
17 return sb->s_fs_info;
18}
19
20#endif
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h
index fe68a5a98583..7032518f8542 100644
--- a/include/linux/crash_dump.h
+++ b/include/linux/crash_dump.h
@@ -6,6 +6,8 @@
6#include <linux/proc_fs.h> 6#include <linux/proc_fs.h>
7#include <linux/elf.h> 7#include <linux/elf.h>
8 8
9#include <asm/pgtable.h> /* for pgprot_t */
10
9#define ELFCORE_ADDR_MAX (-1ULL) 11#define ELFCORE_ADDR_MAX (-1ULL)
10#define ELFCORE_ADDR_ERR (-2ULL) 12#define ELFCORE_ADDR_ERR (-2ULL)
11 13
diff --git a/include/linux/crush/crush.h b/include/linux/crush/crush.h
index 6a1101f24cfb..acaa5615d634 100644
--- a/include/linux/crush/crush.h
+++ b/include/linux/crush/crush.h
@@ -19,11 +19,12 @@
19 19
20#define CRUSH_MAGIC 0x00010000ul /* for detecting algorithm revisions */ 20#define CRUSH_MAGIC 0x00010000ul /* for detecting algorithm revisions */
21 21
22
23#define CRUSH_MAX_DEPTH 10 /* max crush hierarchy depth */ 22#define CRUSH_MAX_DEPTH 10 /* max crush hierarchy depth */
24#define CRUSH_MAX_SET 10 /* max size of a mapping result */
25 23
26 24
25#define CRUSH_ITEM_UNDEF 0x7ffffffe /* undefined result (internal use only) */
26#define CRUSH_ITEM_NONE 0x7fffffff /* no result */
27
27/* 28/*
28 * CRUSH uses user-defined "rules" to describe how inputs should be 29 * CRUSH uses user-defined "rules" to describe how inputs should be
29 * mapped to devices. A rule consists of sequence of steps to perform 30 * mapped to devices. A rule consists of sequence of steps to perform
@@ -43,8 +44,13 @@ enum {
43 /* arg2 = type */ 44 /* arg2 = type */
44 CRUSH_RULE_CHOOSE_INDEP = 3, /* same */ 45 CRUSH_RULE_CHOOSE_INDEP = 3, /* same */
45 CRUSH_RULE_EMIT = 4, /* no args */ 46 CRUSH_RULE_EMIT = 4, /* no args */
46 CRUSH_RULE_CHOOSE_LEAF_FIRSTN = 6, 47 CRUSH_RULE_CHOOSELEAF_FIRSTN = 6,
47 CRUSH_RULE_CHOOSE_LEAF_INDEP = 7, 48 CRUSH_RULE_CHOOSELEAF_INDEP = 7,
49
50 CRUSH_RULE_SET_CHOOSE_TRIES = 8, /* override choose_total_tries */
51 CRUSH_RULE_SET_CHOOSELEAF_TRIES = 9, /* override chooseleaf_descend_once */
52 CRUSH_RULE_SET_CHOOSE_LOCAL_TRIES = 10,
53 CRUSH_RULE_SET_CHOOSE_LOCAL_FALLBACK_TRIES = 11,
48}; 54};
49 55
50/* 56/*
@@ -162,7 +168,10 @@ struct crush_map {
162 __u32 choose_local_fallback_tries; 168 __u32 choose_local_fallback_tries;
163 /* choose attempts before giving up */ 169 /* choose attempts before giving up */
164 __u32 choose_total_tries; 170 __u32 choose_total_tries;
165 /* attempt chooseleaf inner descent once; on failure retry outer descent */ 171 /* attempt chooseleaf inner descent once for firstn mode; on
172 * reject retry outer descent. Note that this does *not*
173 * apply to a collision: in that case we will retry as we used
174 * to. */
166 __u32 chooseleaf_descend_once; 175 __u32 chooseleaf_descend_once;
167}; 176};
168 177
@@ -174,6 +183,7 @@ extern void crush_destroy_bucket_list(struct crush_bucket_list *b);
174extern void crush_destroy_bucket_tree(struct crush_bucket_tree *b); 183extern void crush_destroy_bucket_tree(struct crush_bucket_tree *b);
175extern void crush_destroy_bucket_straw(struct crush_bucket_straw *b); 184extern void crush_destroy_bucket_straw(struct crush_bucket_straw *b);
176extern void crush_destroy_bucket(struct crush_bucket *b); 185extern void crush_destroy_bucket(struct crush_bucket *b);
186extern void crush_destroy_rule(struct crush_rule *r);
177extern void crush_destroy(struct crush_map *map); 187extern void crush_destroy(struct crush_map *map);
178 188
179static inline int crush_calc_tree_node(int i) 189static inline int crush_calc_tree_node(int i)
diff --git a/include/linux/crush/mapper.h b/include/linux/crush/mapper.h
index 5772dee3ecbf..eab367446eea 100644
--- a/include/linux/crush/mapper.h
+++ b/include/linux/crush/mapper.h
@@ -14,6 +14,7 @@ extern int crush_find_rule(const struct crush_map *map, int ruleset, int type, i
14extern int crush_do_rule(const struct crush_map *map, 14extern int crush_do_rule(const struct crush_map *map,
15 int ruleno, 15 int ruleno,
16 int x, int *result, int result_max, 16 int x, int *result, int result_max,
17 const __u32 *weights); 17 const __u32 *weights, int weight_max,
18 int *scratch);
18 19
19#endif 20#endif
diff --git a/include/linux/dm-io.h b/include/linux/dm-io.h
index f4b0aa3126f5..a68cbe59e6ad 100644
--- a/include/linux/dm-io.h
+++ b/include/linux/dm-io.h
@@ -29,7 +29,7 @@ typedef void (*io_notify_fn)(unsigned long error, void *context);
29 29
30enum dm_io_mem_type { 30enum dm_io_mem_type {
31 DM_IO_PAGE_LIST,/* Page list */ 31 DM_IO_PAGE_LIST,/* Page list */
32 DM_IO_BVEC, /* Bio vector */ 32 DM_IO_BIO, /* Bio vector */
33 DM_IO_VMA, /* Virtual memory area */ 33 DM_IO_VMA, /* Virtual memory area */
34 DM_IO_KMEM, /* Kernel memory */ 34 DM_IO_KMEM, /* Kernel memory */
35}; 35};
@@ -41,7 +41,7 @@ struct dm_io_memory {
41 41
42 union { 42 union {
43 struct page_list *pl; 43 struct page_list *pl;
44 struct bio_vec *bvec; 44 struct bio *bio;
45 void *vma; 45 void *vma;
46 void *addr; 46 void *addr;
47 } ptr; 47 } ptr;
diff --git a/include/linux/dma-debug.h b/include/linux/dma-debug.h
index fc0e34ce038f..fe8cb610deac 100644
--- a/include/linux/dma-debug.h
+++ b/include/linux/dma-debug.h
@@ -85,6 +85,8 @@ extern void debug_dma_sync_sg_for_device(struct device *dev,
85 85
86extern void debug_dma_dump_mappings(struct device *dev); 86extern void debug_dma_dump_mappings(struct device *dev);
87 87
88extern void debug_dma_assert_idle(struct page *page);
89
88#else /* CONFIG_DMA_API_DEBUG */ 90#else /* CONFIG_DMA_API_DEBUG */
89 91
90static inline void dma_debug_add_bus(struct bus_type *bus) 92static inline void dma_debug_add_bus(struct bus_type *bus)
@@ -183,6 +185,10 @@ static inline void debug_dma_dump_mappings(struct device *dev)
183{ 185{
184} 186}
185 187
188static inline void debug_dma_assert_idle(struct page *page)
189{
190}
191
186#endif /* CONFIG_DMA_API_DEBUG */ 192#endif /* CONFIG_DMA_API_DEBUG */
187 193
188#endif /* __DMA_DEBUG_H */ 194#endif /* __DMA_DEBUG_H */
diff --git a/include/linux/dma_remapping.h b/include/linux/dma_remapping.h
index 57c9a8ae4f2d..7ac17f57250e 100644
--- a/include/linux/dma_remapping.h
+++ b/include/linux/dma_remapping.h
@@ -27,7 +27,6 @@ struct root_entry;
27 27
28 28
29#ifdef CONFIG_INTEL_IOMMU 29#ifdef CONFIG_INTEL_IOMMU
30extern void free_dmar_iommu(struct intel_iommu *iommu);
31extern int iommu_calculate_agaw(struct intel_iommu *iommu); 30extern int iommu_calculate_agaw(struct intel_iommu *iommu);
32extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu); 31extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu);
33extern int dmar_disabled; 32extern int dmar_disabled;
@@ -41,9 +40,6 @@ static inline int iommu_calculate_max_sagaw(struct intel_iommu *iommu)
41{ 40{
42 return 0; 41 return 0;
43} 42}
44static inline void free_dmar_iommu(struct intel_iommu *iommu)
45{
46}
47#define dmar_disabled (1) 43#define dmar_disabled (1)
48#define intel_iommu_enabled (0) 44#define intel_iommu_enabled (0)
49#endif 45#endif
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 41cf0c399288..c5c92d59e531 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -22,6 +22,7 @@
22#define LINUX_DMAENGINE_H 22#define LINUX_DMAENGINE_H
23 23
24#include <linux/device.h> 24#include <linux/device.h>
25#include <linux/err.h>
25#include <linux/uio.h> 26#include <linux/uio.h>
26#include <linux/bug.h> 27#include <linux/bug.h>
27#include <linux/scatterlist.h> 28#include <linux/scatterlist.h>
@@ -256,7 +257,7 @@ struct dma_chan_percpu {
256 * @dev: class device for sysfs 257 * @dev: class device for sysfs
257 * @device_node: used to add this to the device chan list 258 * @device_node: used to add this to the device chan list
258 * @local: per-cpu pointer to a struct dma_chan_percpu 259 * @local: per-cpu pointer to a struct dma_chan_percpu
259 * @client-count: how many clients are using this channel 260 * @client_count: how many clients are using this channel
260 * @table_count: number of appearances in the mem-to-mem allocation table 261 * @table_count: number of appearances in the mem-to-mem allocation table
261 * @private: private data for certain client-channel associations 262 * @private: private data for certain client-channel associations
262 */ 263 */
@@ -278,10 +279,10 @@ struct dma_chan {
278 279
279/** 280/**
280 * struct dma_chan_dev - relate sysfs device node to backing channel device 281 * struct dma_chan_dev - relate sysfs device node to backing channel device
281 * @chan - driver channel device 282 * @chan: driver channel device
282 * @device - sysfs device 283 * @device: sysfs device
283 * @dev_id - parent dma_device dev_id 284 * @dev_id: parent dma_device dev_id
284 * @idr_ref - reference count to gate release of dma_device dev_id 285 * @idr_ref: reference count to gate release of dma_device dev_id
285 */ 286 */
286struct dma_chan_dev { 287struct dma_chan_dev {
287 struct dma_chan *chan; 288 struct dma_chan *chan;
@@ -305,9 +306,8 @@ enum dma_slave_buswidth {
305/** 306/**
306 * struct dma_slave_config - dma slave channel runtime config 307 * struct dma_slave_config - dma slave channel runtime config
307 * @direction: whether the data shall go in or out on this slave 308 * @direction: whether the data shall go in or out on this slave
308 * channel, right now. DMA_TO_DEVICE and DMA_FROM_DEVICE are 309 * channel, right now. DMA_MEM_TO_DEV and DMA_DEV_TO_MEM are
309 * legal values, DMA_BIDIRECTIONAL is not acceptable since we 310 * legal values.
310 * need to differentiate source and target addresses.
311 * @src_addr: this is the physical address where DMA slave data 311 * @src_addr: this is the physical address where DMA slave data
312 * should be read (RX), if the source is memory this argument is 312 * should be read (RX), if the source is memory this argument is
313 * ignored. 313 * ignored.
@@ -363,6 +363,32 @@ struct dma_slave_config {
363 unsigned int slave_id; 363 unsigned int slave_id;
364}; 364};
365 365
366/**
367 * enum dma_residue_granularity - Granularity of the reported transfer residue
368 * @DMA_RESIDUE_GRANULARITY_DESCRIPTOR: Residue reporting is not support. The
369 * DMA channel is only able to tell whether a descriptor has been completed or
370 * not, which means residue reporting is not supported by this channel. The
371 * residue field of the dma_tx_state field will always be 0.
372 * @DMA_RESIDUE_GRANULARITY_SEGMENT: Residue is updated after each successfully
373 * completed segment of the transfer (For cyclic transfers this is after each
374 * period). This is typically implemented by having the hardware generate an
375 * interrupt after each transferred segment and then the drivers updates the
376 * outstanding residue by the size of the segment. Another possibility is if
377 * the hardware supports scatter-gather and the segment descriptor has a field
378 * which gets set after the segment has been completed. The driver then counts
379 * the number of segments without the flag set to compute the residue.
380 * @DMA_RESIDUE_GRANULARITY_BURST: Residue is updated after each transferred
381 * burst. This is typically only supported if the hardware has a progress
382 * register of some sort (E.g. a register with the current read/write address
383 * or a register with the amount of bursts/beats/bytes that have been
384 * transferred or still need to be transferred).
385 */
386enum dma_residue_granularity {
387 DMA_RESIDUE_GRANULARITY_DESCRIPTOR = 0,
388 DMA_RESIDUE_GRANULARITY_SEGMENT = 1,
389 DMA_RESIDUE_GRANULARITY_BURST = 2,
390};
391
366/* struct dma_slave_caps - expose capabilities of a slave channel only 392/* struct dma_slave_caps - expose capabilities of a slave channel only
367 * 393 *
368 * @src_addr_widths: bit mask of src addr widths the channel supports 394 * @src_addr_widths: bit mask of src addr widths the channel supports
@@ -373,6 +399,7 @@ struct dma_slave_config {
373 * should be checked by controller as well 399 * should be checked by controller as well
374 * @cmd_pause: true, if pause and thereby resume is supported 400 * @cmd_pause: true, if pause and thereby resume is supported
375 * @cmd_terminate: true, if terminate cmd is supported 401 * @cmd_terminate: true, if terminate cmd is supported
402 * @residue_granularity: granularity of the reported transfer residue
376 */ 403 */
377struct dma_slave_caps { 404struct dma_slave_caps {
378 u32 src_addr_widths; 405 u32 src_addr_widths;
@@ -380,6 +407,7 @@ struct dma_slave_caps {
380 u32 directions; 407 u32 directions;
381 bool cmd_pause; 408 bool cmd_pause;
382 bool cmd_terminate; 409 bool cmd_terminate;
410 enum dma_residue_granularity residue_granularity;
383}; 411};
384 412
385static inline const char *dma_chan_name(struct dma_chan *chan) 413static inline const char *dma_chan_name(struct dma_chan *chan)
@@ -1040,6 +1068,8 @@ enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx);
1040void dma_issue_pending_all(void); 1068void dma_issue_pending_all(void);
1041struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask, 1069struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask,
1042 dma_filter_fn fn, void *fn_param); 1070 dma_filter_fn fn, void *fn_param);
1071struct dma_chan *dma_request_slave_channel_reason(struct device *dev,
1072 const char *name);
1043struct dma_chan *dma_request_slave_channel(struct device *dev, const char *name); 1073struct dma_chan *dma_request_slave_channel(struct device *dev, const char *name);
1044void dma_release_channel(struct dma_chan *chan); 1074void dma_release_channel(struct dma_chan *chan);
1045#else 1075#else
@@ -1063,6 +1093,11 @@ static inline struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask,
1063{ 1093{
1064 return NULL; 1094 return NULL;
1065} 1095}
1096static inline struct dma_chan *dma_request_slave_channel_reason(
1097 struct device *dev, const char *name)
1098{
1099 return ERR_PTR(-ENODEV);
1100}
1066static inline struct dma_chan *dma_request_slave_channel(struct device *dev, 1101static inline struct dma_chan *dma_request_slave_channel(struct device *dev,
1067 const char *name) 1102 const char *name)
1068{ 1103{
@@ -1079,6 +1114,7 @@ int dma_async_device_register(struct dma_device *device);
1079void dma_async_device_unregister(struct dma_device *device); 1114void dma_async_device_unregister(struct dma_device *device);
1080void dma_run_dependencies(struct dma_async_tx_descriptor *tx); 1115void dma_run_dependencies(struct dma_async_tx_descriptor *tx);
1081struct dma_chan *dma_get_slave_channel(struct dma_chan *chan); 1116struct dma_chan *dma_get_slave_channel(struct dma_chan *chan);
1117struct dma_chan *dma_get_any_slave_channel(struct dma_device *device);
1082struct dma_chan *net_dma_find_channel(void); 1118struct dma_chan *net_dma_find_channel(void);
1083#define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y) 1119#define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y)
1084#define dma_request_slave_channel_compat(mask, x, y, dev, name) \ 1120#define dma_request_slave_channel_compat(mask, x, y, dev, name) \
diff --git a/include/linux/dmar.h b/include/linux/dmar.h
index b029d1aa2d12..eccb0c0c6cf6 100644
--- a/include/linux/dmar.h
+++ b/include/linux/dmar.h
@@ -33,6 +33,7 @@ struct acpi_dmar_header;
33#define DMAR_X2APIC_OPT_OUT 0x2 33#define DMAR_X2APIC_OPT_OUT 0x2
34 34
35struct intel_iommu; 35struct intel_iommu;
36
36#ifdef CONFIG_DMAR_TABLE 37#ifdef CONFIG_DMAR_TABLE
37extern struct acpi_table_header *dmar_tbl; 38extern struct acpi_table_header *dmar_tbl;
38struct dmar_drhd_unit { 39struct dmar_drhd_unit {
@@ -52,6 +53,10 @@ extern struct list_head dmar_drhd_units;
52#define for_each_drhd_unit(drhd) \ 53#define for_each_drhd_unit(drhd) \
53 list_for_each_entry(drhd, &dmar_drhd_units, list) 54 list_for_each_entry(drhd, &dmar_drhd_units, list)
54 55
56#define for_each_active_drhd_unit(drhd) \
57 list_for_each_entry(drhd, &dmar_drhd_units, list) \
58 if (drhd->ignored) {} else
59
55#define for_each_active_iommu(i, drhd) \ 60#define for_each_active_iommu(i, drhd) \
56 list_for_each_entry(drhd, &dmar_drhd_units, list) \ 61 list_for_each_entry(drhd, &dmar_drhd_units, list) \
57 if (i=drhd->iommu, drhd->ignored) {} else 62 if (i=drhd->iommu, drhd->ignored) {} else
@@ -62,13 +67,13 @@ extern struct list_head dmar_drhd_units;
62 67
63extern int dmar_table_init(void); 68extern int dmar_table_init(void);
64extern int dmar_dev_scope_init(void); 69extern int dmar_dev_scope_init(void);
70extern int dmar_parse_dev_scope(void *start, void *end, int *cnt,
71 struct pci_dev ***devices, u16 segment);
72extern void dmar_free_dev_scope(struct pci_dev ***devices, int *cnt);
65 73
66/* Intel IOMMU detection */ 74/* Intel IOMMU detection */
67extern int detect_intel_iommu(void); 75extern int detect_intel_iommu(void);
68extern int enable_drhd_fault_handling(void); 76extern int enable_drhd_fault_handling(void);
69
70extern int parse_ioapics_under_ir(void);
71extern int alloc_iommu(struct dmar_drhd_unit *);
72#else 77#else
73static inline int detect_intel_iommu(void) 78static inline int detect_intel_iommu(void)
74{ 79{
@@ -157,8 +162,6 @@ struct dmar_atsr_unit {
157int dmar_parse_rmrr_atsr_dev(void); 162int dmar_parse_rmrr_atsr_dev(void);
158extern int dmar_parse_one_rmrr(struct acpi_dmar_header *header); 163extern int dmar_parse_one_rmrr(struct acpi_dmar_header *header);
159extern int dmar_parse_one_atsr(struct acpi_dmar_header *header); 164extern int dmar_parse_one_atsr(struct acpi_dmar_header *header);
160extern int dmar_parse_dev_scope(void *start, void *end, int *cnt,
161 struct pci_dev ***devices, u16 segment);
162extern int intel_iommu_init(void); 165extern int intel_iommu_init(void);
163#else /* !CONFIG_INTEL_IOMMU: */ 166#else /* !CONFIG_INTEL_IOMMU: */
164static inline int intel_iommu_init(void) { return -ENODEV; } 167static inline int intel_iommu_init(void) { return -ENODEV; }
diff --git a/include/linux/edac.h b/include/linux/edac.h
index dbdffe8d4469..8e6c20af11a2 100644
--- a/include/linux/edac.h
+++ b/include/linux/edac.h
@@ -35,6 +35,34 @@ extern void edac_atomic_assert_error(void);
35extern struct bus_type *edac_get_sysfs_subsys(void); 35extern struct bus_type *edac_get_sysfs_subsys(void);
36extern void edac_put_sysfs_subsys(void); 36extern void edac_put_sysfs_subsys(void);
37 37
38enum {
39 EDAC_REPORTING_ENABLED,
40 EDAC_REPORTING_DISABLED,
41 EDAC_REPORTING_FORCE
42};
43
44extern int edac_report_status;
45#ifdef CONFIG_EDAC
46static inline int get_edac_report_status(void)
47{
48 return edac_report_status;
49}
50
51static inline void set_edac_report_status(int new)
52{
53 edac_report_status = new;
54}
55#else
56static inline int get_edac_report_status(void)
57{
58 return EDAC_REPORTING_DISABLED;
59}
60
61static inline void set_edac_report_status(int new)
62{
63}
64#endif
65
38static inline void opstate_init(void) 66static inline void opstate_init(void)
39{ 67{
40 switch (edac_op_state) { 68 switch (edac_op_state) {
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 11ce6784a196..0a819e7a60c9 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -556,6 +556,9 @@ extern struct efi {
556 unsigned long hcdp; /* HCDP table */ 556 unsigned long hcdp; /* HCDP table */
557 unsigned long uga; /* UGA table */ 557 unsigned long uga; /* UGA table */
558 unsigned long uv_systab; /* UV system table */ 558 unsigned long uv_systab; /* UV system table */
559 unsigned long fw_vendor; /* fw_vendor */
560 unsigned long runtime; /* runtime table */
561 unsigned long config_table; /* config tables */
559 efi_get_time_t *get_time; 562 efi_get_time_t *get_time;
560 efi_set_time_t *set_time; 563 efi_set_time_t *set_time;
561 efi_get_wakeup_time_t *get_wakeup_time; 564 efi_get_wakeup_time_t *get_wakeup_time;
@@ -653,6 +656,7 @@ extern int __init efi_setup_pcdp_console(char *);
653#define EFI_RUNTIME_SERVICES 3 /* Can we use runtime services? */ 656#define EFI_RUNTIME_SERVICES 3 /* Can we use runtime services? */
654#define EFI_MEMMAP 4 /* Can we use EFI memory map? */ 657#define EFI_MEMMAP 4 /* Can we use EFI memory map? */
655#define EFI_64BIT 5 /* Is the firmware 64-bit? */ 658#define EFI_64BIT 5 /* Is the firmware 64-bit? */
659#define EFI_ARCH_1 6 /* First arch-specific bit */
656 660
657#ifdef CONFIG_EFI 661#ifdef CONFIG_EFI
658# ifdef CONFIG_X86 662# ifdef CONFIG_X86
@@ -872,4 +876,17 @@ int efivars_sysfs_init(void);
872 876
873#endif /* CONFIG_EFI_VARS */ 877#endif /* CONFIG_EFI_VARS */
874 878
879#ifdef CONFIG_EFI_RUNTIME_MAP
880int efi_runtime_map_init(struct kobject *);
881void efi_runtime_map_setup(void *, int, u32);
882#else
883static inline int efi_runtime_map_init(struct kobject *kobj)
884{
885 return 0;
886}
887
888static inline void
889efi_runtime_map_setup(void *map, int nr_entries, u32 desc_size) {}
890#endif
891
875#endif /* _LINUX_EFI_H */ 892#endif /* _LINUX_EFI_H */
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index fc4a9aa7dd82..9c5529dc6d07 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -26,6 +26,7 @@
26#include <linux/netdevice.h> 26#include <linux/netdevice.h>
27#include <linux/random.h> 27#include <linux/random.h>
28#include <asm/unaligned.h> 28#include <asm/unaligned.h>
29#include <asm/bitsperlong.h>
29 30
30#ifdef __KERNEL__ 31#ifdef __KERNEL__
31__be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev); 32__be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev);
@@ -60,6 +61,8 @@ static const u8 eth_reserved_addr_base[ETH_ALEN] __aligned(2) =
60 * 61 *
61 * Return true if address is link local reserved addr (01:80:c2:00:00:0X) per 62 * Return true if address is link local reserved addr (01:80:c2:00:00:0X) per
62 * IEEE 802.1Q 8.6.3 Frame filtering. 63 * IEEE 802.1Q 8.6.3 Frame filtering.
64 *
65 * Please note: addr must be aligned to u16.
63 */ 66 */
64static inline bool is_link_local_ether_addr(const u8 *addr) 67static inline bool is_link_local_ether_addr(const u8 *addr)
65{ 68{
@@ -67,7 +70,12 @@ static inline bool is_link_local_ether_addr(const u8 *addr)
67 static const __be16 *b = (const __be16 *)eth_reserved_addr_base; 70 static const __be16 *b = (const __be16 *)eth_reserved_addr_base;
68 static const __be16 m = cpu_to_be16(0xfff0); 71 static const __be16 m = cpu_to_be16(0xfff0);
69 72
73#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
74 return (((*(const u32 *)addr) ^ (*(const u32 *)b)) |
75 ((a[2] ^ b[2]) & m)) == 0;
76#else
70 return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | ((a[2] ^ b[2]) & m)) == 0; 77 return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | ((a[2] ^ b[2]) & m)) == 0;
78#endif
71} 79}
72 80
73/** 81/**
@@ -75,10 +83,18 @@ static inline bool is_link_local_ether_addr(const u8 *addr)
75 * @addr: Pointer to a six-byte array containing the Ethernet address 83 * @addr: Pointer to a six-byte array containing the Ethernet address
76 * 84 *
77 * Return true if the address is all zeroes. 85 * Return true if the address is all zeroes.
86 *
87 * Please note: addr must be aligned to u16.
78 */ 88 */
79static inline bool is_zero_ether_addr(const u8 *addr) 89static inline bool is_zero_ether_addr(const u8 *addr)
80{ 90{
81 return !(addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]); 91#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
92 return ((*(const u32 *)addr) | (*(const u16 *)(addr + 4))) == 0;
93#else
94 return (*(const u16 *)(addr + 0) |
95 *(const u16 *)(addr + 2) |
96 *(const u16 *)(addr + 4)) == 0;
97#endif
82} 98}
83 99
84/** 100/**
@@ -109,10 +125,14 @@ static inline bool is_local_ether_addr(const u8 *addr)
109 * @addr: Pointer to a six-byte array containing the Ethernet address 125 * @addr: Pointer to a six-byte array containing the Ethernet address
110 * 126 *
111 * Return true if the address is the broadcast address. 127 * Return true if the address is the broadcast address.
128 *
129 * Please note: addr must be aligned to u16.
112 */ 130 */
113static inline bool is_broadcast_ether_addr(const u8 *addr) 131static inline bool is_broadcast_ether_addr(const u8 *addr)
114{ 132{
115 return (addr[0] & addr[1] & addr[2] & addr[3] & addr[4] & addr[5]) == 0xff; 133 return (*(const u16 *)(addr + 0) &
134 *(const u16 *)(addr + 2) &
135 *(const u16 *)(addr + 4)) == 0xffff;
116} 136}
117 137
118/** 138/**
@@ -134,6 +154,8 @@ static inline bool is_unicast_ether_addr(const u8 *addr)
134 * a multicast address, and is not FF:FF:FF:FF:FF:FF. 154 * a multicast address, and is not FF:FF:FF:FF:FF:FF.
135 * 155 *
136 * Return true if the address is valid. 156 * Return true if the address is valid.
157 *
158 * Please note: addr must be aligned to u16.
137 */ 159 */
138static inline bool is_valid_ether_addr(const u8 *addr) 160static inline bool is_valid_ether_addr(const u8 *addr)
139{ 161{
@@ -196,6 +218,28 @@ static inline void eth_hw_addr_random(struct net_device *dev)
196} 218}
197 219
198/** 220/**
221 * ether_addr_copy - Copy an Ethernet address
222 * @dst: Pointer to a six-byte array Ethernet address destination
223 * @src: Pointer to a six-byte array Ethernet address source
224 *
225 * Please note: dst & src must both be aligned to u16.
226 */
227static inline void ether_addr_copy(u8 *dst, const u8 *src)
228{
229#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
230 *(u32 *)dst = *(const u32 *)src;
231 *(u16 *)(dst + 4) = *(const u16 *)(src + 4);
232#else
233 u16 *a = (u16 *)dst;
234 const u16 *b = (const u16 *)src;
235
236 a[0] = b[0];
237 a[1] = b[1];
238 a[2] = b[2];
239#endif
240}
241
242/**
199 * eth_hw_addr_inherit - Copy dev_addr from another net_device 243 * eth_hw_addr_inherit - Copy dev_addr from another net_device
200 * @dst: pointer to net_device to copy dev_addr to 244 * @dst: pointer to net_device to copy dev_addr to
201 * @src: pointer to net_device to copy dev_addr from 245 * @src: pointer to net_device to copy dev_addr from
@@ -207,24 +251,7 @@ static inline void eth_hw_addr_inherit(struct net_device *dst,
207 struct net_device *src) 251 struct net_device *src)
208{ 252{
209 dst->addr_assign_type = src->addr_assign_type; 253 dst->addr_assign_type = src->addr_assign_type;
210 memcpy(dst->dev_addr, src->dev_addr, ETH_ALEN); 254 ether_addr_copy(dst->dev_addr, src->dev_addr);
211}
212
213/**
214 * compare_ether_addr - Compare two Ethernet addresses
215 * @addr1: Pointer to a six-byte array containing the Ethernet address
216 * @addr2: Pointer other six-byte array containing the Ethernet address
217 *
218 * Compare two Ethernet addresses, returns 0 if equal, non-zero otherwise.
219 * Unlike memcmp(), it doesn't return a value suitable for sorting.
220 */
221static inline unsigned compare_ether_addr(const u8 *addr1, const u8 *addr2)
222{
223 const u16 *a = (const u16 *) addr1;
224 const u16 *b = (const u16 *) addr2;
225
226 BUILD_BUG_ON(ETH_ALEN != 6);
227 return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0;
228} 255}
229 256
230/** 257/**
@@ -233,18 +260,21 @@ static inline unsigned compare_ether_addr(const u8 *addr1, const u8 *addr2)
233 * @addr2: Pointer other six-byte array containing the Ethernet address 260 * @addr2: Pointer other six-byte array containing the Ethernet address
234 * 261 *
235 * Compare two Ethernet addresses, returns true if equal 262 * Compare two Ethernet addresses, returns true if equal
263 *
264 * Please note: addr1 & addr2 must both be aligned to u16.
236 */ 265 */
237static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2) 266static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
238{ 267{
239 return !compare_ether_addr(addr1, addr2); 268#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
240} 269 u32 fold = ((*(const u32 *)addr1) ^ (*(const u32 *)addr2)) |
270 ((*(const u16 *)(addr1 + 4)) ^ (*(const u16 *)(addr2 + 4)));
241 271
242static inline unsigned long zap_last_2bytes(unsigned long value) 272 return fold == 0;
243{
244#ifdef __BIG_ENDIAN
245 return value >> 16;
246#else 273#else
247 return value << 16; 274 const u16 *a = (const u16 *)addr1;
275 const u16 *b = (const u16 *)addr2;
276
277 return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) == 0;
248#endif 278#endif
249} 279}
250 280
@@ -265,22 +295,38 @@ static inline unsigned long zap_last_2bytes(unsigned long value)
265static inline bool ether_addr_equal_64bits(const u8 addr1[6+2], 295static inline bool ether_addr_equal_64bits(const u8 addr1[6+2],
266 const u8 addr2[6+2]) 296 const u8 addr2[6+2])
267{ 297{
268#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS 298#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
269 unsigned long fold = ((*(unsigned long *)addr1) ^ 299 u64 fold = (*(const u64 *)addr1) ^ (*(const u64 *)addr2);
270 (*(unsigned long *)addr2));
271
272 if (sizeof(fold) == 8)
273 return zap_last_2bytes(fold) == 0;
274 300
275 fold |= zap_last_2bytes((*(unsigned long *)(addr1 + 4)) ^ 301#ifdef __BIG_ENDIAN
276 (*(unsigned long *)(addr2 + 4))); 302 return (fold >> 16) == 0;
277 return fold == 0; 303#else
304 return (fold << 16) == 0;
305#endif
278#else 306#else
279 return ether_addr_equal(addr1, addr2); 307 return ether_addr_equal(addr1, addr2);
280#endif 308#endif
281} 309}
282 310
283/** 311/**
312 * ether_addr_equal_unaligned - Compare two not u16 aligned Ethernet addresses
313 * @addr1: Pointer to a six-byte array containing the Ethernet address
314 * @addr2: Pointer other six-byte array containing the Ethernet address
315 *
316 * Compare two Ethernet addresses, returns true if equal
317 *
318 * Please note: Use only when any Ethernet address may not be u16 aligned.
319 */
320static inline bool ether_addr_equal_unaligned(const u8 *addr1, const u8 *addr2)
321{
322#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
323 return ether_addr_equal(addr1, addr2);
324#else
325 return memcmp(addr1, addr2, ETH_ALEN) == 0;
326#endif
327}
328
329/**
284 * is_etherdev_addr - Tell if given Ethernet address belongs to the device. 330 * is_etherdev_addr - Tell if given Ethernet address belongs to the device.
285 * @dev: Pointer to a device structure 331 * @dev: Pointer to a device structure
286 * @addr: Pointer to a six-byte array containing the Ethernet address 332 * @addr: Pointer to a six-byte array containing the Ethernet address
diff --git a/include/linux/export.h b/include/linux/export.h
index 3f2793d51899..96e45ea463e7 100644
--- a/include/linux/export.h
+++ b/include/linux/export.h
@@ -59,6 +59,7 @@ extern struct module __this_module;
59 static const char __kstrtab_##sym[] \ 59 static const char __kstrtab_##sym[] \
60 __attribute__((section("__ksymtab_strings"), aligned(1))) \ 60 __attribute__((section("__ksymtab_strings"), aligned(1))) \
61 = VMLINUX_SYMBOL_STR(sym); \ 61 = VMLINUX_SYMBOL_STR(sym); \
62 extern const struct kernel_symbol __ksymtab_##sym; \
62 __visible const struct kernel_symbol __ksymtab_##sym \ 63 __visible const struct kernel_symbol __ksymtab_##sym \
63 __used \ 64 __used \
64 __attribute__((section("___ksymtab" sec "+" #sym), unused)) \ 65 __attribute__((section("___ksymtab" sec "+" #sym), unused)) \
diff --git a/include/linux/extcon/extcon-gpio.h b/include/linux/extcon/extcon-gpio.h
index 4195810f87fe..8900fdf511c6 100644
--- a/include/linux/extcon/extcon-gpio.h
+++ b/include/linux/extcon/extcon-gpio.h
@@ -51,6 +51,7 @@ struct gpio_extcon_platform_data {
51 /* if NULL, "0" or "1" will be printed */ 51 /* if NULL, "0" or "1" will be printed */
52 const char *state_on; 52 const char *state_on;
53 const char *state_off; 53 const char *state_off;
54 bool check_on_resume;
54}; 55};
55 56
56#endif /* __EXTCON_GPIO_H__ */ 57#endif /* __EXTCON_GPIO_H__ */
diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h
index bb942f6d5702..da74d878dc4f 100644
--- a/include/linux/f2fs_fs.h
+++ b/include/linux/f2fs_fs.h
@@ -153,6 +153,13 @@ struct f2fs_extent {
153#define NODE_DIND_BLOCK (DEF_ADDRS_PER_INODE + 5) 153#define NODE_DIND_BLOCK (DEF_ADDRS_PER_INODE + 5)
154 154
155#define F2FS_INLINE_XATTR 0x01 /* file inline xattr flag */ 155#define F2FS_INLINE_XATTR 0x01 /* file inline xattr flag */
156#define F2FS_INLINE_DATA 0x02 /* file inline data flag */
157
158#define MAX_INLINE_DATA (sizeof(__le32) * (DEF_ADDRS_PER_INODE - \
159 F2FS_INLINE_XATTR_ADDRS - 1))
160
161#define INLINE_DATA_OFFSET (PAGE_CACHE_SIZE - sizeof(struct node_footer) \
162 - sizeof(__le32) * (DEF_ADDRS_PER_INODE + 5 - 1))
156 163
157struct f2fs_inode { 164struct f2fs_inode {
158 __le16 i_mode; /* file mode */ 165 __le16 i_mode; /* file mode */
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 70c4836e4a9f..fe6ac956550e 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -613,8 +613,8 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
613extern int register_framebuffer(struct fb_info *fb_info); 613extern int register_framebuffer(struct fb_info *fb_info);
614extern int unregister_framebuffer(struct fb_info *fb_info); 614extern int unregister_framebuffer(struct fb_info *fb_info);
615extern int unlink_framebuffer(struct fb_info *fb_info); 615extern int unlink_framebuffer(struct fb_info *fb_info);
616extern void remove_conflicting_framebuffers(struct apertures_struct *a, 616extern int remove_conflicting_framebuffers(struct apertures_struct *a,
617 const char *name, bool primary); 617 const char *name, bool primary);
618extern int fb_prepare_logo(struct fb_info *fb_info, int rotate); 618extern int fb_prepare_logo(struct fb_info *fb_info, int rotate);
619extern int fb_show_logo(struct fb_info *fb_info, int rotate); 619extern int fb_show_logo(struct fb_info *fb_info, int rotate);
620extern char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size); 620extern char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size);
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h
index 085197bd8812..70e8e21c0a30 100644
--- a/include/linux/fdtable.h
+++ b/include/linux/fdtable.h
@@ -59,29 +59,36 @@ struct files_struct {
59 struct file __rcu * fd_array[NR_OPEN_DEFAULT]; 59 struct file __rcu * fd_array[NR_OPEN_DEFAULT];
60}; 60};
61 61
62#define rcu_dereference_check_fdtable(files, fdtfd) \
63 (rcu_dereference_check((fdtfd), \
64 lockdep_is_held(&(files)->file_lock) || \
65 atomic_read(&(files)->count) == 1 || \
66 rcu_my_thread_group_empty()))
67
68#define files_fdtable(files) \
69 (rcu_dereference_check_fdtable((files), (files)->fdt))
70
71struct file_operations; 62struct file_operations;
72struct vfsmount; 63struct vfsmount;
73struct dentry; 64struct dentry;
74 65
75extern void __init files_defer_init(void); 66extern void __init files_defer_init(void);
76 67
77static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd) 68#define rcu_dereference_check_fdtable(files, fdtfd) \
69 rcu_dereference_check((fdtfd), lockdep_is_held(&(files)->file_lock))
70
71#define files_fdtable(files) \
72 rcu_dereference_check_fdtable((files), (files)->fdt)
73
74/*
75 * The caller must ensure that fd table isn't shared or hold rcu or file lock
76 */
77static inline struct file *__fcheck_files(struct files_struct *files, unsigned int fd)
78{ 78{
79 struct file * file = NULL; 79 struct fdtable *fdt = rcu_dereference_raw(files->fdt);
80 struct fdtable *fdt = files_fdtable(files);
81 80
82 if (fd < fdt->max_fds) 81 if (fd < fdt->max_fds)
83 file = rcu_dereference_check_fdtable(files, fdt->fd[fd]); 82 return rcu_dereference_raw(fdt->fd[fd]);
84 return file; 83 return NULL;
84}
85
86static inline struct file *fcheck_files(struct files_struct *files, unsigned int fd)
87{
88 rcu_lockdep_assert(rcu_read_lock_held() ||
89 lockdep_is_held(&files->file_lock),
90 "suspicious rcu_dereference_check() usage");
91 return __fcheck_files(files, fd);
85} 92}
86 93
87/* 94/*
diff --git a/include/linux/filter.h b/include/linux/filter.h
index ff4e40cd45b1..e568c8ef896b 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -83,6 +83,11 @@ static inline void bpf_jit_free(struct sk_filter *fp)
83#define SK_RUN_FILTER(FILTER, SKB) sk_run_filter(SKB, FILTER->insns) 83#define SK_RUN_FILTER(FILTER, SKB) sk_run_filter(SKB, FILTER->insns)
84#endif 84#endif
85 85
86static inline int bpf_tell_extensions(void)
87{
88 return SKF_AD_MAX;
89}
90
86enum { 91enum {
87 BPF_S_RET_K = 1, 92 BPF_S_RET_K = 1,
88 BPF_S_RET_A, 93 BPF_S_RET_A,
diff --git a/include/linux/firmware.h b/include/linux/firmware.h
index e154c1005cd1..59529330efd6 100644
--- a/include/linux/firmware.h
+++ b/include/linux/firmware.h
@@ -68,4 +68,11 @@ static inline void release_firmware(const struct firmware *fw)
68 68
69#endif 69#endif
70 70
71#ifdef CONFIG_FW_LOADER_USER_HELPER
72int request_firmware_direct(const struct firmware **fw, const char *name,
73 struct device *device);
74#else
75#define request_firmware_direct request_firmware
76#endif
77
71#endif 78#endif
diff --git a/include/linux/flex_array.h b/include/linux/flex_array.h
index 6843cf193a44..b6efb0c64408 100644
--- a/include/linux/flex_array.h
+++ b/include/linux/flex_array.h
@@ -2,6 +2,7 @@
2#define _FLEX_ARRAY_H 2#define _FLEX_ARRAY_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/reciprocal_div.h>
5#include <asm/page.h> 6#include <asm/page.h>
6 7
7#define FLEX_ARRAY_PART_SIZE PAGE_SIZE 8#define FLEX_ARRAY_PART_SIZE PAGE_SIZE
@@ -22,7 +23,7 @@ struct flex_array {
22 int element_size; 23 int element_size;
23 int total_nr_elements; 24 int total_nr_elements;
24 int elems_per_part; 25 int elems_per_part;
25 u32 reciprocal_elems; 26 struct reciprocal_value reciprocal_elems;
26 struct flex_array_part *parts[]; 27 struct flex_array_part *parts[];
27 }; 28 };
28 /* 29 /*
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 121f11f001c0..60829565e552 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1580,6 +1580,7 @@ struct inode_operations {
1580 struct file *, unsigned open_flag, 1580 struct file *, unsigned open_flag,
1581 umode_t create_mode, int *opened); 1581 umode_t create_mode, int *opened);
1582 int (*tmpfile) (struct inode *, struct dentry *, umode_t); 1582 int (*tmpfile) (struct inode *, struct dentry *, umode_t);
1583 int (*set_acl)(struct inode *, struct posix_acl *, int);
1583} ____cacheline_aligned; 1584} ____cacheline_aligned;
1584 1585
1585ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, 1586ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,
@@ -2078,6 +2079,7 @@ extern struct file * dentry_open(const struct path *, int, const struct cred *);
2078extern int filp_close(struct file *, fl_owner_t id); 2079extern int filp_close(struct file *, fl_owner_t id);
2079 2080
2080extern struct filename *getname(const char __user *); 2081extern struct filename *getname(const char __user *);
2082extern struct filename *getname_kernel(const char *);
2081 2083
2082enum { 2084enum {
2083 FILE_CREATED = 1, 2085 FILE_CREATED = 1,
@@ -2272,7 +2274,13 @@ extern int filemap_fdatawrite_range(struct address_space *mapping,
2272extern int vfs_fsync_range(struct file *file, loff_t start, loff_t end, 2274extern int vfs_fsync_range(struct file *file, loff_t start, loff_t end,
2273 int datasync); 2275 int datasync);
2274extern int vfs_fsync(struct file *file, int datasync); 2276extern int vfs_fsync(struct file *file, int datasync);
2275extern int generic_write_sync(struct file *file, loff_t pos, loff_t count); 2277static inline int generic_write_sync(struct file *file, loff_t pos, loff_t count)
2278{
2279 if (!(file->f_flags & O_DSYNC) && !IS_SYNC(file->f_mapping->host))
2280 return 0;
2281 return vfs_fsync_range(file, pos, pos + count - 1,
2282 (file->f_flags & __O_SYNC) ? 0 : 1);
2283}
2276extern void emergency_sync(void); 2284extern void emergency_sync(void);
2277extern void emergency_remount(void); 2285extern void emergency_remount(void);
2278#ifdef CONFIG_BLOCK 2286#ifdef CONFIG_BLOCK
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
index 4b2ee8d12f5e..3d286ff49ab0 100644
--- a/include/linux/fsnotify_backend.h
+++ b/include/linux/fsnotify_backend.h
@@ -15,7 +15,6 @@
15#include <linux/path.h> /* struct path */ 15#include <linux/path.h> /* struct path */
16#include <linux/spinlock.h> 16#include <linux/spinlock.h>
17#include <linux/types.h> 17#include <linux/types.h>
18
19#include <linux/atomic.h> 18#include <linux/atomic.h>
20 19
21/* 20/*
@@ -79,6 +78,7 @@ struct fsnotify_group;
79struct fsnotify_event; 78struct fsnotify_event;
80struct fsnotify_mark; 79struct fsnotify_mark;
81struct fsnotify_event_private_data; 80struct fsnotify_event_private_data;
81struct fsnotify_fname;
82 82
83/* 83/*
84 * Each group much define these ops. The fsnotify infrastructure will call 84 * Each group much define these ops. The fsnotify infrastructure will call
@@ -94,17 +94,27 @@ struct fsnotify_event_private_data;
94 * userspace messages that marks have been removed. 94 * userspace messages that marks have been removed.
95 */ 95 */
96struct fsnotify_ops { 96struct fsnotify_ops {
97 bool (*should_send_event)(struct fsnotify_group *group, struct inode *inode,
98 struct fsnotify_mark *inode_mark,
99 struct fsnotify_mark *vfsmount_mark,
100 __u32 mask, void *data, int data_type);
101 int (*handle_event)(struct fsnotify_group *group, 97 int (*handle_event)(struct fsnotify_group *group,
98 struct inode *inode,
102 struct fsnotify_mark *inode_mark, 99 struct fsnotify_mark *inode_mark,
103 struct fsnotify_mark *vfsmount_mark, 100 struct fsnotify_mark *vfsmount_mark,
104 struct fsnotify_event *event); 101 u32 mask, void *data, int data_type,
102 const unsigned char *file_name);
105 void (*free_group_priv)(struct fsnotify_group *group); 103 void (*free_group_priv)(struct fsnotify_group *group);
106 void (*freeing_mark)(struct fsnotify_mark *mark, struct fsnotify_group *group); 104 void (*freeing_mark)(struct fsnotify_mark *mark, struct fsnotify_group *group);
107 void (*free_event_priv)(struct fsnotify_event_private_data *priv); 105 void (*free_event)(struct fsnotify_event *event);
106};
107
108/*
109 * all of the information about the original object we want to now send to
110 * a group. If you want to carry more info from the accessing task to the
111 * listener this structure is where you need to be adding fields.
112 */
113struct fsnotify_event {
114 struct list_head list;
115 /* inode may ONLY be dereferenced during handle_event(). */
116 struct inode *inode; /* either the inode the event happened to or its parent */
117 u32 mask; /* the type of access, bitwise OR for FS_* event types */
108}; 118};
109 119
110/* 120/*
@@ -148,7 +158,11 @@ struct fsnotify_group {
148 * a group */ 158 * a group */
149 struct list_head marks_list; /* all inode marks for this group */ 159 struct list_head marks_list; /* all inode marks for this group */
150 160
151 struct fasync_struct *fsn_fa; /* async notification */ 161 struct fasync_struct *fsn_fa; /* async notification */
162
163 struct fsnotify_event overflow_event; /* Event we queue when the
164 * notification list is too
165 * full */
152 166
153 /* groups can define private fields here or use the void *private */ 167 /* groups can define private fields here or use the void *private */
154 union { 168 union {
@@ -177,76 +191,10 @@ struct fsnotify_group {
177 }; 191 };
178}; 192};
179 193
180/*
181 * A single event can be queued in multiple group->notification_lists.
182 *
183 * each group->notification_list will point to an event_holder which in turns points
184 * to the actual event that needs to be sent to userspace.
185 *
186 * Seemed cheaper to create a refcnt'd event and a small holder for every group
187 * than create a different event for every group
188 *
189 */
190struct fsnotify_event_holder {
191 struct fsnotify_event *event;
192 struct list_head event_list;
193};
194
195/*
196 * Inotify needs to tack data onto an event. This struct lets us later find the
197 * correct private data of the correct group.
198 */
199struct fsnotify_event_private_data {
200 struct fsnotify_group *group;
201 struct list_head event_list;
202};
203
204/*
205 * all of the information about the original object we want to now send to
206 * a group. If you want to carry more info from the accessing task to the
207 * listener this structure is where you need to be adding fields.
208 */
209struct fsnotify_event {
210 /*
211 * If we create an event we are also likely going to need a holder
212 * to link to a group. So embed one holder in the event. Means only
213 * one allocation for the common case where we only have one group
214 */
215 struct fsnotify_event_holder holder;
216 spinlock_t lock; /* protection for the associated event_holder and private_list */
217 /* to_tell may ONLY be dereferenced during handle_event(). */
218 struct inode *to_tell; /* either the inode the event happened to or its parent */
219 /*
220 * depending on the event type we should have either a path or inode
221 * We hold a reference on path, but NOT on inode. Since we have the ref on
222 * the path, it may be dereferenced at any point during this object's
223 * lifetime. That reference is dropped when this object's refcnt hits
224 * 0. If this event contains an inode instead of a path, the inode may
225 * ONLY be used during handle_event().
226 */
227 union {
228 struct path path;
229 struct inode *inode;
230 };
231/* when calling fsnotify tell it if the data is a path or inode */ 194/* when calling fsnotify tell it if the data is a path or inode */
232#define FSNOTIFY_EVENT_NONE 0 195#define FSNOTIFY_EVENT_NONE 0
233#define FSNOTIFY_EVENT_PATH 1 196#define FSNOTIFY_EVENT_PATH 1
234#define FSNOTIFY_EVENT_INODE 2 197#define FSNOTIFY_EVENT_INODE 2
235 int data_type; /* which of the above union we have */
236 atomic_t refcnt; /* how many groups still are using/need to send this event */
237 __u32 mask; /* the type of access, bitwise OR for FS_* event types */
238
239 u32 sync_cookie; /* used to corrolate events, namely inotify mv events */
240 const unsigned char *file_name;
241 size_t name_len;
242 struct pid *tgid;
243
244#ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS
245 __u32 response; /* userspace answer to question */
246#endif /* CONFIG_FANOTIFY_ACCESS_PERMISSIONS */
247
248 struct list_head private_data_list; /* groups can store private data here */
249};
250 198
251/* 199/*
252 * Inode specific fields in an fsnotify_mark 200 * Inode specific fields in an fsnotify_mark
@@ -370,19 +318,14 @@ extern void fsnotify_put_group(struct fsnotify_group *group);
370extern void fsnotify_destroy_group(struct fsnotify_group *group); 318extern void fsnotify_destroy_group(struct fsnotify_group *group);
371/* fasync handler function */ 319/* fasync handler function */
372extern int fsnotify_fasync(int fd, struct file *file, int on); 320extern int fsnotify_fasync(int fd, struct file *file, int on);
373/* take a reference to an event */ 321/* Free event from memory */
374extern void fsnotify_get_event(struct fsnotify_event *event); 322extern void fsnotify_destroy_event(struct fsnotify_group *group,
375extern void fsnotify_put_event(struct fsnotify_event *event); 323 struct fsnotify_event *event);
376/* find private data previously attached to an event and unlink it */
377extern struct fsnotify_event_private_data *fsnotify_remove_priv_from_event(struct fsnotify_group *group,
378 struct fsnotify_event *event);
379
380/* attach the event to the group notification queue */ 324/* attach the event to the group notification queue */
381extern struct fsnotify_event *fsnotify_add_notify_event(struct fsnotify_group *group, 325extern int fsnotify_add_notify_event(struct fsnotify_group *group,
382 struct fsnotify_event *event, 326 struct fsnotify_event *event,
383 struct fsnotify_event_private_data *priv, 327 int (*merge)(struct list_head *,
384 struct fsnotify_event *(*merge)(struct list_head *, 328 struct fsnotify_event *));
385 struct fsnotify_event *));
386/* true if the group notification queue is empty */ 329/* true if the group notification queue is empty */
387extern bool fsnotify_notify_queue_is_empty(struct fsnotify_group *group); 330extern bool fsnotify_notify_queue_is_empty(struct fsnotify_group *group);
388/* return, but do not dequeue the first event on the notification queue */ 331/* return, but do not dequeue the first event on the notification queue */
@@ -430,15 +373,8 @@ extern void fsnotify_put_mark(struct fsnotify_mark *mark);
430extern void fsnotify_unmount_inodes(struct list_head *list); 373extern void fsnotify_unmount_inodes(struct list_head *list);
431 374
432/* put here because inotify does some weird stuff when destroying watches */ 375/* put here because inotify does some weird stuff when destroying watches */
433extern struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask, 376extern void fsnotify_init_event(struct fsnotify_event *event,
434 void *data, int data_is, 377 struct inode *to_tell, u32 mask);
435 const unsigned char *name,
436 u32 cookie, gfp_t gfp);
437
438/* fanotify likes to change events after they are on lists... */
439extern struct fsnotify_event *fsnotify_clone_event(struct fsnotify_event *old_event);
440extern int fsnotify_replace_event(struct fsnotify_event_holder *old_holder,
441 struct fsnotify_event *new_event);
442 378
443#else 379#else
444 380
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 31ea4b428360..f4233b195dab 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -570,8 +570,6 @@ static inline int
570ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; } 570ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; }
571#endif /* CONFIG_DYNAMIC_FTRACE */ 571#endif /* CONFIG_DYNAMIC_FTRACE */
572 572
573loff_t ftrace_filter_lseek(struct file *file, loff_t offset, int whence);
574
575/* totally disable ftrace - can not re-enable after this */ 573/* totally disable ftrace - can not re-enable after this */
576void ftrace_kill(void); 574void ftrace_kill(void);
577 575
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 8c9b7a1c4138..4e4cc28623ad 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -1,3 +1,4 @@
1
1#ifndef _LINUX_FTRACE_EVENT_H 2#ifndef _LINUX_FTRACE_EVENT_H
2#define _LINUX_FTRACE_EVENT_H 3#define _LINUX_FTRACE_EVENT_H
3 4
@@ -264,6 +265,8 @@ enum {
264 FTRACE_EVENT_FL_NO_SET_FILTER_BIT, 265 FTRACE_EVENT_FL_NO_SET_FILTER_BIT,
265 FTRACE_EVENT_FL_SOFT_MODE_BIT, 266 FTRACE_EVENT_FL_SOFT_MODE_BIT,
266 FTRACE_EVENT_FL_SOFT_DISABLED_BIT, 267 FTRACE_EVENT_FL_SOFT_DISABLED_BIT,
268 FTRACE_EVENT_FL_TRIGGER_MODE_BIT,
269 FTRACE_EVENT_FL_TRIGGER_COND_BIT,
267}; 270};
268 271
269/* 272/*
@@ -275,6 +278,8 @@ enum {
275 * SOFT_MODE - The event is enabled/disabled by SOFT_DISABLED 278 * SOFT_MODE - The event is enabled/disabled by SOFT_DISABLED
276 * SOFT_DISABLED - When set, do not trace the event (even though its 279 * SOFT_DISABLED - When set, do not trace the event (even though its
277 * tracepoint may be enabled) 280 * tracepoint may be enabled)
281 * TRIGGER_MODE - When set, invoke the triggers associated with the event
282 * TRIGGER_COND - When set, one or more triggers has an associated filter
278 */ 283 */
279enum { 284enum {
280 FTRACE_EVENT_FL_ENABLED = (1 << FTRACE_EVENT_FL_ENABLED_BIT), 285 FTRACE_EVENT_FL_ENABLED = (1 << FTRACE_EVENT_FL_ENABLED_BIT),
@@ -283,6 +288,8 @@ enum {
283 FTRACE_EVENT_FL_NO_SET_FILTER = (1 << FTRACE_EVENT_FL_NO_SET_FILTER_BIT), 288 FTRACE_EVENT_FL_NO_SET_FILTER = (1 << FTRACE_EVENT_FL_NO_SET_FILTER_BIT),
284 FTRACE_EVENT_FL_SOFT_MODE = (1 << FTRACE_EVENT_FL_SOFT_MODE_BIT), 289 FTRACE_EVENT_FL_SOFT_MODE = (1 << FTRACE_EVENT_FL_SOFT_MODE_BIT),
285 FTRACE_EVENT_FL_SOFT_DISABLED = (1 << FTRACE_EVENT_FL_SOFT_DISABLED_BIT), 290 FTRACE_EVENT_FL_SOFT_DISABLED = (1 << FTRACE_EVENT_FL_SOFT_DISABLED_BIT),
291 FTRACE_EVENT_FL_TRIGGER_MODE = (1 << FTRACE_EVENT_FL_TRIGGER_MODE_BIT),
292 FTRACE_EVENT_FL_TRIGGER_COND = (1 << FTRACE_EVENT_FL_TRIGGER_COND_BIT),
286}; 293};
287 294
288struct ftrace_event_file { 295struct ftrace_event_file {
@@ -292,6 +299,7 @@ struct ftrace_event_file {
292 struct dentry *dir; 299 struct dentry *dir;
293 struct trace_array *tr; 300 struct trace_array *tr;
294 struct ftrace_subsystem_dir *system; 301 struct ftrace_subsystem_dir *system;
302 struct list_head triggers;
295 303
296 /* 304 /*
297 * 32 bit flags: 305 * 32 bit flags:
@@ -299,6 +307,7 @@ struct ftrace_event_file {
299 * bit 1: enabled cmd record 307 * bit 1: enabled cmd record
300 * bit 2: enable/disable with the soft disable bit 308 * bit 2: enable/disable with the soft disable bit
301 * bit 3: soft disabled 309 * bit 3: soft disabled
310 * bit 4: trigger enabled
302 * 311 *
303 * Note: The bits must be set atomically to prevent races 312 * Note: The bits must be set atomically to prevent races
304 * from other writers. Reads of flags do not need to be in 313 * from other writers. Reads of flags do not need to be in
@@ -310,6 +319,7 @@ struct ftrace_event_file {
310 */ 319 */
311 unsigned long flags; 320 unsigned long flags;
312 atomic_t sm_ref; /* soft-mode reference counter */ 321 atomic_t sm_ref; /* soft-mode reference counter */
322 atomic_t tm_ref; /* trigger-mode reference counter */
313}; 323};
314 324
315#define __TRACE_EVENT_FLAGS(name, value) \ 325#define __TRACE_EVENT_FLAGS(name, value) \
@@ -337,6 +347,14 @@ struct ftrace_event_file {
337 347
338#define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ 348#define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */
339 349
350enum event_trigger_type {
351 ETT_NONE = (0),
352 ETT_TRACE_ONOFF = (1 << 0),
353 ETT_SNAPSHOT = (1 << 1),
354 ETT_STACKTRACE = (1 << 2),
355 ETT_EVENT_ENABLE = (1 << 3),
356};
357
340extern void destroy_preds(struct ftrace_event_file *file); 358extern void destroy_preds(struct ftrace_event_file *file);
341extern void destroy_call_preds(struct ftrace_event_call *call); 359extern void destroy_call_preds(struct ftrace_event_call *call);
342extern int filter_match_preds(struct event_filter *filter, void *rec); 360extern int filter_match_preds(struct event_filter *filter, void *rec);
@@ -347,6 +365,127 @@ extern int filter_check_discard(struct ftrace_event_file *file, void *rec,
347extern int call_filter_check_discard(struct ftrace_event_call *call, void *rec, 365extern int call_filter_check_discard(struct ftrace_event_call *call, void *rec,
348 struct ring_buffer *buffer, 366 struct ring_buffer *buffer,
349 struct ring_buffer_event *event); 367 struct ring_buffer_event *event);
368extern enum event_trigger_type event_triggers_call(struct ftrace_event_file *file,
369 void *rec);
370extern void event_triggers_post_call(struct ftrace_event_file *file,
371 enum event_trigger_type tt);
372
373/**
374 * ftrace_trigger_soft_disabled - do triggers and test if soft disabled
375 * @file: The file pointer of the event to test
376 *
377 * If any triggers without filters are attached to this event, they
378 * will be called here. If the event is soft disabled and has no
379 * triggers that require testing the fields, it will return true,
380 * otherwise false.
381 */
382static inline bool
383ftrace_trigger_soft_disabled(struct ftrace_event_file *file)
384{
385 unsigned long eflags = file->flags;
386
387 if (!(eflags & FTRACE_EVENT_FL_TRIGGER_COND)) {
388 if (eflags & FTRACE_EVENT_FL_TRIGGER_MODE)
389 event_triggers_call(file, NULL);
390 if (eflags & FTRACE_EVENT_FL_SOFT_DISABLED)
391 return true;
392 }
393 return false;
394}
395
396/*
397 * Helper function for event_trigger_unlock_commit{_regs}().
398 * If there are event triggers attached to this event that requires
399 * filtering against its fields, then they wil be called as the
400 * entry already holds the field information of the current event.
401 *
402 * It also checks if the event should be discarded or not.
403 * It is to be discarded if the event is soft disabled and the
404 * event was only recorded to process triggers, or if the event
405 * filter is active and this event did not match the filters.
406 *
407 * Returns true if the event is discarded, false otherwise.
408 */
409static inline bool
410__event_trigger_test_discard(struct ftrace_event_file *file,
411 struct ring_buffer *buffer,
412 struct ring_buffer_event *event,
413 void *entry,
414 enum event_trigger_type *tt)
415{
416 unsigned long eflags = file->flags;
417
418 if (eflags & FTRACE_EVENT_FL_TRIGGER_COND)
419 *tt = event_triggers_call(file, entry);
420
421 if (test_bit(FTRACE_EVENT_FL_SOFT_DISABLED_BIT, &file->flags))
422 ring_buffer_discard_commit(buffer, event);
423 else if (!filter_check_discard(file, entry, buffer, event))
424 return false;
425
426 return true;
427}
428
429/**
430 * event_trigger_unlock_commit - handle triggers and finish event commit
431 * @file: The file pointer assoctiated to the event
432 * @buffer: The ring buffer that the event is being written to
433 * @event: The event meta data in the ring buffer
434 * @entry: The event itself
435 * @irq_flags: The state of the interrupts at the start of the event
436 * @pc: The state of the preempt count at the start of the event.
437 *
438 * This is a helper function to handle triggers that require data
439 * from the event itself. It also tests the event against filters and
440 * if the event is soft disabled and should be discarded.
441 */
442static inline void
443event_trigger_unlock_commit(struct ftrace_event_file *file,
444 struct ring_buffer *buffer,
445 struct ring_buffer_event *event,
446 void *entry, unsigned long irq_flags, int pc)
447{
448 enum event_trigger_type tt = ETT_NONE;
449
450 if (!__event_trigger_test_discard(file, buffer, event, entry, &tt))
451 trace_buffer_unlock_commit(buffer, event, irq_flags, pc);
452
453 if (tt)
454 event_triggers_post_call(file, tt);
455}
456
457/**
458 * event_trigger_unlock_commit_regs - handle triggers and finish event commit
459 * @file: The file pointer assoctiated to the event
460 * @buffer: The ring buffer that the event is being written to
461 * @event: The event meta data in the ring buffer
462 * @entry: The event itself
463 * @irq_flags: The state of the interrupts at the start of the event
464 * @pc: The state of the preempt count at the start of the event.
465 *
466 * This is a helper function to handle triggers that require data
467 * from the event itself. It also tests the event against filters and
468 * if the event is soft disabled and should be discarded.
469 *
470 * Same as event_trigger_unlock_commit() but calls
471 * trace_buffer_unlock_commit_regs() instead of trace_buffer_unlock_commit().
472 */
473static inline void
474event_trigger_unlock_commit_regs(struct ftrace_event_file *file,
475 struct ring_buffer *buffer,
476 struct ring_buffer_event *event,
477 void *entry, unsigned long irq_flags, int pc,
478 struct pt_regs *regs)
479{
480 enum event_trigger_type tt = ETT_NONE;
481
482 if (!__event_trigger_test_discard(file, buffer, event, entry, &tt))
483 trace_buffer_unlock_commit_regs(buffer, event,
484 irq_flags, pc, regs);
485
486 if (tt)
487 event_triggers_post_call(file, tt);
488}
350 489
351enum { 490enum {
352 FILTER_OTHER = 0, 491 FILTER_OTHER = 0,
diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h
index 1eda33d7cb10..1c2fdaa2ffc3 100644
--- a/include/linux/genalloc.h
+++ b/include/linux/genalloc.h
@@ -30,6 +30,8 @@
30#ifndef __GENALLOC_H__ 30#ifndef __GENALLOC_H__
31#define __GENALLOC_H__ 31#define __GENALLOC_H__
32 32
33#include <linux/spinlock_types.h>
34
33struct device; 35struct device;
34struct device_node; 36struct device_node;
35 37
diff --git a/include/linux/generic_acl.h b/include/linux/generic_acl.h
deleted file mode 100644
index b6d657544ef1..000000000000
--- a/include/linux/generic_acl.h
+++ /dev/null
@@ -1,14 +0,0 @@
1#ifndef LINUX_GENERIC_ACL_H
2#define LINUX_GENERIC_ACL_H
3
4#include <linux/xattr.h>
5
6struct inode;
7
8extern const struct xattr_handler generic_acl_access_handler;
9extern const struct xattr_handler generic_acl_default_handler;
10
11int generic_acl_init(struct inode *, struct inode *);
12int generic_acl_chmod(struct inode *);
13
14#endif /* LINUX_GENERIC_ACL_H */
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 9b4dd491f7e8..0437439bc047 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -1,6 +1,7 @@
1#ifndef __LINUX_GFP_H 1#ifndef __LINUX_GFP_H
2#define __LINUX_GFP_H 2#define __LINUX_GFP_H
3 3
4#include <linux/mmdebug.h>
4#include <linux/mmzone.h> 5#include <linux/mmzone.h>
5#include <linux/stddef.h> 6#include <linux/stddef.h>
6#include <linux/linkage.h> 7#include <linux/linkage.h>
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
index c177c48f60a2..85aa5d0b9357 100644
--- a/include/linux/gpio.h
+++ b/include/linux/gpio.h
@@ -90,7 +90,6 @@ void devm_gpio_free(struct device *dev, unsigned int gpio);
90 90
91#include <linux/kernel.h> 91#include <linux/kernel.h>
92#include <linux/types.h> 92#include <linux/types.h>
93#include <linux/errno.h>
94#include <linux/bug.h> 93#include <linux/bug.h>
95#include <linux/pinctrl/pinctrl.h> 94#include <linux/pinctrl/pinctrl.h>
96 95
diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
index 4d34dbbbad4d..7a8144fef406 100644
--- a/include/linux/gpio/consumer.h
+++ b/include/linux/gpio/consumer.h
@@ -4,8 +4,6 @@
4#include <linux/err.h> 4#include <linux/err.h>
5#include <linux/kernel.h> 5#include <linux/kernel.h>
6 6
7#ifdef CONFIG_GPIOLIB
8
9struct device; 7struct device;
10struct gpio_chip; 8struct gpio_chip;
11 9
@@ -18,6 +16,8 @@ struct gpio_chip;
18 */ 16 */
19struct gpio_desc; 17struct gpio_desc;
20 18
19#ifdef CONFIG_GPIOLIB
20
21/* Acquire and dispose GPIOs */ 21/* Acquire and dispose GPIOs */
22struct gpio_desc *__must_check gpiod_get(struct device *dev, 22struct gpio_desc *__must_check gpiod_get(struct device *dev,
23 const char *con_id); 23 const char *con_id);
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index 3ea2cf6b0e6c..a3e181e09636 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -39,14 +39,15 @@ struct seq_file;
39 * @ngpio: the number of GPIOs handled by this controller; the last GPIO 39 * @ngpio: the number of GPIOs handled by this controller; the last GPIO
40 * handled is (base + ngpio - 1). 40 * handled is (base + ngpio - 1).
41 * @desc: array of ngpio descriptors. Private. 41 * @desc: array of ngpio descriptors. Private.
42 * @can_sleep: flag must be set iff get()/set() methods sleep, as they
43 * must while accessing GPIO expander chips over I2C or SPI
44 * @names: if set, must be an array of strings to use as alternative 42 * @names: if set, must be an array of strings to use as alternative
45 * names for the GPIOs in this chip. Any entry in the array 43 * names for the GPIOs in this chip. Any entry in the array
46 * may be NULL if there is no alias for the GPIO, however the 44 * may be NULL if there is no alias for the GPIO, however the
47 * array must be @ngpio entries long. A name can include a single printk 45 * array must be @ngpio entries long. A name can include a single printk
48 * format specifier for an unsigned int. It is substituted by the actual 46 * format specifier for an unsigned int. It is substituted by the actual
49 * number of the gpio. 47 * number of the gpio.
48 * @can_sleep: flag must be set iff get()/set() methods sleep, as they
49 * must while accessing GPIO expander chips over I2C or SPI
50 * @exported: flags if the gpiochip is exported for use from sysfs. Private.
50 * 51 *
51 * A gpio_chip can help platforms abstract various sources of GPIOs so 52 * A gpio_chip can help platforms abstract various sources of GPIOs so
52 * they can all be accessed through a common programing interface. 53 * they can all be accessed through a common programing interface.
@@ -91,8 +92,8 @@ struct gpio_chip {
91 u16 ngpio; 92 u16 ngpio;
92 struct gpio_desc *desc; 93 struct gpio_desc *desc;
93 const char *const *names; 94 const char *const *names;
94 unsigned can_sleep:1; 95 bool can_sleep;
95 unsigned exported:1; 96 bool exported;
96 97
97#if defined(CONFIG_OF_GPIO) 98#if defined(CONFIG_OF_GPIO)
98 /* 99 /*
@@ -136,59 +137,50 @@ enum gpio_lookup_flags {
136}; 137};
137 138
138/** 139/**
139 * Lookup table for associating GPIOs to specific devices and functions using 140 * struct gpiod_lookup - lookup table
140 * platform data. 141 * @chip_label: name of the chip the GPIO belongs to
142 * @chip_hwnum: hardware number (i.e. relative to the chip) of the GPIO
143 * @con_id: name of the GPIO from the device's point of view
144 * @idx: index of the GPIO in case several GPIOs share the same name
145 * @flags: mask of GPIO_* values
146 *
147 * gpiod_lookup is a lookup table for associating GPIOs to specific devices and
148 * functions using platform data.
141 */ 149 */
142struct gpiod_lookup { 150struct gpiod_lookup {
143 struct list_head list;
144 /*
145 * name of the chip the GPIO belongs to
146 */
147 const char *chip_label; 151 const char *chip_label;
148 /*
149 * hardware number (i.e. relative to the chip) of the GPIO
150 */
151 u16 chip_hwnum; 152 u16 chip_hwnum;
152 /*
153 * name of device that can claim this GPIO
154 */
155 const char *dev_id;
156 /*
157 * name of the GPIO from the device's point of view
158 */
159 const char *con_id; 153 const char *con_id;
160 /*
161 * index of the GPIO in case several GPIOs share the same name
162 */
163 unsigned int idx; 154 unsigned int idx;
164 /*
165 * mask of GPIO_* values
166 */
167 enum gpio_lookup_flags flags; 155 enum gpio_lookup_flags flags;
168}; 156};
169 157
158struct gpiod_lookup_table {
159 struct list_head list;
160 const char *dev_id;
161 struct gpiod_lookup table[];
162};
163
170/* 164/*
171 * Simple definition of a single GPIO under a con_id 165 * Simple definition of a single GPIO under a con_id
172 */ 166 */
173#define GPIO_LOOKUP(_chip_label, _chip_hwnum, _dev_id, _con_id, _flags) \ 167#define GPIO_LOOKUP(_chip_label, _chip_hwnum, _con_id, _flags) \
174 GPIO_LOOKUP_IDX(_chip_label, _chip_hwnum, _dev_id, _con_id, 0, _flags) 168 GPIO_LOOKUP_IDX(_chip_label, _chip_hwnum, _con_id, 0, _flags)
175 169
176/* 170/*
177 * Use this macro if you need to have several GPIOs under the same con_id. 171 * Use this macro if you need to have several GPIOs under the same con_id.
178 * Each GPIO needs to use a different index and can be accessed using 172 * Each GPIO needs to use a different index and can be accessed using
179 * gpiod_get_index() 173 * gpiod_get_index()
180 */ 174 */
181#define GPIO_LOOKUP_IDX(_chip_label, _chip_hwnum, _dev_id, _con_id, _idx, \ 175#define GPIO_LOOKUP_IDX(_chip_label, _chip_hwnum, _con_id, _idx, _flags) \
182 _flags) \
183{ \ 176{ \
184 .chip_label = _chip_label, \ 177 .chip_label = _chip_label, \
185 .chip_hwnum = _chip_hwnum, \ 178 .chip_hwnum = _chip_hwnum, \
186 .dev_id = _dev_id, \
187 .con_id = _con_id, \ 179 .con_id = _con_id, \
188 .idx = _idx, \ 180 .idx = _idx, \
189 .flags = _flags, \ 181 .flags = _flags, \
190} 182}
191 183
192void gpiod_add_table(struct gpiod_lookup *table, size_t size); 184void gpiod_add_lookup_table(struct gpiod_lookup_table *table);
193 185
194#endif 186#endif
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index d9cf963ac832..12d5f972f23f 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -5,6 +5,7 @@
5#include <linux/lockdep.h> 5#include <linux/lockdep.h>
6#include <linux/ftrace_irq.h> 6#include <linux/ftrace_irq.h>
7#include <linux/vtime.h> 7#include <linux/vtime.h>
8#include <asm/hardirq.h>
8 9
9 10
10extern void synchronize_irq(unsigned int irq); 11extern void synchronize_irq(unsigned int irq);
diff --git a/include/linux/hash.h b/include/linux/hash.h
index f09a0ae4d858..bd1754c7ecef 100644
--- a/include/linux/hash.h
+++ b/include/linux/hash.h
@@ -15,6 +15,7 @@
15 */ 15 */
16 16
17#include <asm/types.h> 17#include <asm/types.h>
18#include <asm/hash.h>
18#include <linux/compiler.h> 19#include <linux/compiler.h>
19 20
20/* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */ 21/* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */
@@ -78,4 +79,39 @@ static inline u32 hash32_ptr(const void *ptr)
78#endif 79#endif
79 return (u32)val; 80 return (u32)val;
80} 81}
82
83struct fast_hash_ops {
84 u32 (*hash)(const void *data, u32 len, u32 seed);
85 u32 (*hash2)(const u32 *data, u32 len, u32 seed);
86};
87
88/**
89 * arch_fast_hash - Caclulates a hash over a given buffer that can have
90 * arbitrary size. This function will eventually use an
91 * architecture-optimized hashing implementation if
92 * available, and trades off distribution for speed.
93 *
94 * @data: buffer to hash
95 * @len: length of buffer in bytes
96 * @seed: start seed
97 *
98 * Returns 32bit hash.
99 */
100extern u32 arch_fast_hash(const void *data, u32 len, u32 seed);
101
102/**
103 * arch_fast_hash2 - Caclulates a hash over a given buffer that has a
104 * size that is of a multiple of 32bit words. This
105 * function will eventually use an architecture-
106 * optimized hashing implementation if available,
107 * and trades off distribution for speed.
108 *
109 * @data: buffer to hash (must be 32bit padded)
110 * @len: number of 32bit words
111 * @seed: start seed
112 *
113 * Returns 32bit hash.
114 */
115extern u32 arch_fast_hash2(const u32 *data, u32 len, u32 seed);
116
81#endif /* _LINUX_HASH_H */ 117#endif /* _LINUX_HASH_H */
diff --git a/include/linux/hid-sensor-ids.h b/include/linux/hid-sensor-ids.h
index 8323775ac21d..beaf965621c1 100644
--- a/include/linux/hid-sensor-ids.h
+++ b/include/linux/hid-sensor-ids.h
@@ -23,22 +23,26 @@
23 23
24/* Accel 3D (200073) */ 24/* Accel 3D (200073) */
25#define HID_USAGE_SENSOR_ACCEL_3D 0x200073 25#define HID_USAGE_SENSOR_ACCEL_3D 0x200073
26#define HID_USAGE_SENSOR_DATA_ACCELERATION 0x200452
26#define HID_USAGE_SENSOR_ACCEL_X_AXIS 0x200453 27#define HID_USAGE_SENSOR_ACCEL_X_AXIS 0x200453
27#define HID_USAGE_SENSOR_ACCEL_Y_AXIS 0x200454 28#define HID_USAGE_SENSOR_ACCEL_Y_AXIS 0x200454
28#define HID_USAGE_SENSOR_ACCEL_Z_AXIS 0x200455 29#define HID_USAGE_SENSOR_ACCEL_Z_AXIS 0x200455
29 30
30/* ALS (200041) */ 31/* ALS (200041) */
31#define HID_USAGE_SENSOR_ALS 0x200041 32#define HID_USAGE_SENSOR_ALS 0x200041
33#define HID_USAGE_SENSOR_DATA_LIGHT 0x2004d0
32#define HID_USAGE_SENSOR_LIGHT_ILLUM 0x2004d1 34#define HID_USAGE_SENSOR_LIGHT_ILLUM 0x2004d1
33 35
34/* Gyro 3D: (200076) */ 36/* Gyro 3D: (200076) */
35#define HID_USAGE_SENSOR_GYRO_3D 0x200076 37#define HID_USAGE_SENSOR_GYRO_3D 0x200076
38#define HID_USAGE_SENSOR_DATA_ANGL_VELOCITY 0x200456
36#define HID_USAGE_SENSOR_ANGL_VELOCITY_X_AXIS 0x200457 39#define HID_USAGE_SENSOR_ANGL_VELOCITY_X_AXIS 0x200457
37#define HID_USAGE_SENSOR_ANGL_VELOCITY_Y_AXIS 0x200458 40#define HID_USAGE_SENSOR_ANGL_VELOCITY_Y_AXIS 0x200458
38#define HID_USAGE_SENSOR_ANGL_VELOCITY_Z_AXIS 0x200459 41#define HID_USAGE_SENSOR_ANGL_VELOCITY_Z_AXIS 0x200459
39 42
40/* ORIENTATION: Compass 3D: (200083) */ 43/* ORIENTATION: Compass 3D: (200083) */
41#define HID_USAGE_SENSOR_COMPASS_3D 0x200083 44#define HID_USAGE_SENSOR_COMPASS_3D 0x200083
45#define HID_USAGE_SENSOR_DATA_ORIENTATION 0x200470
42#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING 0x200471 46#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING 0x200471
43#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_X 0x200472 47#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_X 0x200472
44#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_Y 0x200473 48#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_Y 0x200473
@@ -54,10 +58,14 @@
54#define HID_USAGE_SENSOR_ORIENT_DISTANCE_Y 0x20047B 58#define HID_USAGE_SENSOR_ORIENT_DISTANCE_Y 0x20047B
55#define HID_USAGE_SENSOR_ORIENT_DISTANCE_Z 0x20047C 59#define HID_USAGE_SENSOR_ORIENT_DISTANCE_Z 0x20047C
56#define HID_USAGE_SENSOR_ORIENT_DISTANCE_OUT_OF_RANGE 0x20047D 60#define HID_USAGE_SENSOR_ORIENT_DISTANCE_OUT_OF_RANGE 0x20047D
61
62/* ORIENTATION: Inclinometer 3D: (200086) */
63#define HID_USAGE_SENSOR_INCLINOMETER_3D 0x200086
57#define HID_USAGE_SENSOR_ORIENT_TILT 0x20047E 64#define HID_USAGE_SENSOR_ORIENT_TILT 0x20047E
58#define HID_USAGE_SENSOR_ORIENT_TILT_X 0x20047F 65#define HID_USAGE_SENSOR_ORIENT_TILT_X 0x20047F
59#define HID_USAGE_SENSOR_ORIENT_TILT_Y 0x200480 66#define HID_USAGE_SENSOR_ORIENT_TILT_Y 0x200480
60#define HID_USAGE_SENSOR_ORIENT_TILT_Z 0x200481 67#define HID_USAGE_SENSOR_ORIENT_TILT_Z 0x200481
68
61#define HID_USAGE_SENSOR_ORIENT_ROTATION_MATRIX 0x200482 69#define HID_USAGE_SENSOR_ORIENT_ROTATION_MATRIX 0x200482
62#define HID_USAGE_SENSOR_ORIENT_QUATERNION 0x200483 70#define HID_USAGE_SENSOR_ORIENT_QUATERNION 0x200483
63#define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX 0x200484 71#define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX 0x200484
@@ -117,6 +125,10 @@
117#define HID_USAGE_SENSOR_PROP_REPORT_STATE 0x200316 125#define HID_USAGE_SENSOR_PROP_REPORT_STATE 0x200316
118#define HID_USAGE_SENSOR_PROY_POWER_STATE 0x200319 126#define HID_USAGE_SENSOR_PROY_POWER_STATE 0x200319
119 127
128/* Per data field properties */
129#define HID_USAGE_SENSOR_DATA_MOD_NONE 0x00
130#define HID_USAGE_SENSOR_DATA_MOD_CHANGE_SENSITIVITY_ABS 0x1000
131
120/* Power state enumerations */ 132/* Power state enumerations */
121#define HID_USAGE_SENSOR_PROP_POWER_STATE_UNDEFINED_ENUM 0x00 133#define HID_USAGE_SENSOR_PROP_POWER_STATE_UNDEFINED_ENUM 0x00
122#define HID_USAGE_SENSOR_PROP_POWER_STATE_D0_FULL_POWER_ENUM 0x01 134#define HID_USAGE_SENSOR_PROP_POWER_STATE_D0_FULL_POWER_ENUM 0x01
diff --git a/include/linux/host1x.h b/include/linux/host1x.h
index f5b9b87ac9a9..3af847273277 100644
--- a/include/linux/host1x.h
+++ b/include/linux/host1x.h
@@ -281,4 +281,10 @@ int host1x_device_exit(struct host1x_device *device);
281int host1x_client_register(struct host1x_client *client); 281int host1x_client_register(struct host1x_client *client);
282int host1x_client_unregister(struct host1x_client *client); 282int host1x_client_unregister(struct host1x_client *client);
283 283
284struct tegra_mipi_device;
285
286struct tegra_mipi_device *tegra_mipi_request(struct device *device);
287void tegra_mipi_free(struct tegra_mipi_device *device);
288int tegra_mipi_calibrate(struct tegra_mipi_device *device);
289
284#endif 290#endif
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index 91672e2deec3..db512014e061 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -157,6 +157,26 @@ static inline int hpage_nr_pages(struct page *page)
157 return HPAGE_PMD_NR; 157 return HPAGE_PMD_NR;
158 return 1; 158 return 1;
159} 159}
160/*
161 * compound_trans_head() should be used instead of compound_head(),
162 * whenever the "page" passed as parameter could be the tail of a
163 * transparent hugepage that could be undergoing a
164 * __split_huge_page_refcount(). The page structure layout often
165 * changes across releases and it makes extensive use of unions. So if
166 * the page structure layout will change in a way that
167 * page->first_page gets clobbered by __split_huge_page_refcount, the
168 * implementation making use of smp_rmb() will be required.
169 *
170 * Currently we define compound_trans_head as compound_head, because
171 * page->private is in the same union with page->first_page, and
172 * page->private isn't clobbered. However this also means we're
173 * currently leaving dirt into the page->private field of anonymous
174 * pages resulting from a THP split, instead of setting page->private
175 * to zero like for every other page that has PG_private not set. But
176 * anonymous pages don't use page->private so this is not a problem.
177 */
178#if 0
179/* This will be needed if page->private will be clobbered in split_huge_page */
160static inline struct page *compound_trans_head(struct page *page) 180static inline struct page *compound_trans_head(struct page *page)
161{ 181{
162 if (PageTail(page)) { 182 if (PageTail(page)) {
@@ -174,6 +194,9 @@ static inline struct page *compound_trans_head(struct page *page)
174 } 194 }
175 return page; 195 return page;
176} 196}
197#else
198#define compound_trans_head(page) compound_head(page)
199#endif
177 200
178extern int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, 201extern int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma,
179 unsigned long addr, pmd_t pmd, pmd_t *pmdp); 202 unsigned long addr, pmd_t pmd, pmd_t *pmdp);
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index bd7e98752222..8c43cc469d78 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -2,6 +2,7 @@
2#define _LINUX_HUGETLB_H 2#define _LINUX_HUGETLB_H
3 3
4#include <linux/mm_types.h> 4#include <linux/mm_types.h>
5#include <linux/mmdebug.h>
5#include <linux/fs.h> 6#include <linux/fs.h>
6#include <linux/hugetlb_inline.h> 7#include <linux/hugetlb_inline.h>
7#include <linux/cgroup.h> 8#include <linux/cgroup.h>
@@ -31,7 +32,6 @@ struct hugepage_subpool *hugepage_new_subpool(long nr_blocks);
31void hugepage_put_subpool(struct hugepage_subpool *spool); 32void hugepage_put_subpool(struct hugepage_subpool *spool);
32 33
33int PageHuge(struct page *page); 34int PageHuge(struct page *page);
34int PageHeadHuge(struct page *page_head);
35 35
36void reset_vma_resv_huge_pages(struct vm_area_struct *vma); 36void reset_vma_resv_huge_pages(struct vm_area_struct *vma);
37int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); 37int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *);
@@ -104,11 +104,6 @@ static inline int PageHuge(struct page *page)
104 return 0; 104 return 0;
105} 105}
106 106
107static inline int PageHeadHuge(struct page *page_head)
108{
109 return 0;
110}
111
112static inline void reset_vma_resv_huge_pages(struct vm_area_struct *vma) 107static inline void reset_vma_resv_huge_pages(struct vm_area_struct *vma)
113{ 108{
114} 109}
@@ -360,6 +355,7 @@ static inline pte_t arch_make_huge_pte(pte_t entry, struct vm_area_struct *vma,
360 355
361static inline struct hstate *page_hstate(struct page *page) 356static inline struct hstate *page_hstate(struct page *page)
362{ 357{
358 VM_BUG_ON_PAGE(!PageHuge(page), page);
363 return size_to_hstate(PAGE_SIZE << compound_order(page)); 359 return size_to_hstate(PAGE_SIZE << compound_order(page));
364} 360}
365 361
diff --git a/include/linux/hugetlb_cgroup.h b/include/linux/hugetlb_cgroup.h
index ce8217f7b5c2..787bba3bf552 100644
--- a/include/linux/hugetlb_cgroup.h
+++ b/include/linux/hugetlb_cgroup.h
@@ -15,6 +15,7 @@
15#ifndef _LINUX_HUGETLB_CGROUP_H 15#ifndef _LINUX_HUGETLB_CGROUP_H
16#define _LINUX_HUGETLB_CGROUP_H 16#define _LINUX_HUGETLB_CGROUP_H
17 17
18#include <linux/mmdebug.h>
18#include <linux/res_counter.h> 19#include <linux/res_counter.h>
19 20
20struct hugetlb_cgroup; 21struct hugetlb_cgroup;
@@ -28,7 +29,7 @@ struct hugetlb_cgroup;
28 29
29static inline struct hugetlb_cgroup *hugetlb_cgroup_from_page(struct page *page) 30static inline struct hugetlb_cgroup *hugetlb_cgroup_from_page(struct page *page)
30{ 31{
31 VM_BUG_ON(!PageHuge(page)); 32 VM_BUG_ON_PAGE(!PageHuge(page), page);
32 33
33 if (compound_order(page) < HUGETLB_CGROUP_MIN_ORDER) 34 if (compound_order(page) < HUGETLB_CGROUP_MIN_ORDER)
34 return NULL; 35 return NULL;
@@ -38,7 +39,7 @@ static inline struct hugetlb_cgroup *hugetlb_cgroup_from_page(struct page *page)
38static inline 39static inline
39int set_hugetlb_cgroup(struct page *page, struct hugetlb_cgroup *h_cg) 40int set_hugetlb_cgroup(struct page *page, struct hugetlb_cgroup *h_cg)
40{ 41{
41 VM_BUG_ON(!PageHuge(page)); 42 VM_BUG_ON_PAGE(!PageHuge(page), page);
42 43
43 if (compound_order(page) < HUGETLB_CGROUP_MIN_ORDER) 44 if (compound_order(page) < HUGETLB_CGROUP_MIN_ORDER)
44 return -1; 45 return -1;
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index 15da677478dd..344883dce584 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -875,7 +875,7 @@ struct vmbus_channel_relid_released {
875struct vmbus_channel_initiate_contact { 875struct vmbus_channel_initiate_contact {
876 struct vmbus_channel_message_header header; 876 struct vmbus_channel_message_header header;
877 u32 vmbus_version_requested; 877 u32 vmbus_version_requested;
878 u32 padding2; 878 u32 target_vcpu; /* The VCPU the host should respond to */
879 u64 interrupt_page; 879 u64 interrupt_page;
880 u64 monitor_page1; 880 u64 monitor_page1;
881 u64 monitor_page2; 881 u64 monitor_page2;
diff --git a/include/linux/i2c-pnx.h b/include/linux/i2c-pnx.h
index 49ed17fdf055..5388326fbbff 100644
--- a/include/linux/i2c-pnx.h
+++ b/include/linux/i2c-pnx.h
@@ -31,7 +31,6 @@ struct i2c_pnx_algo_data {
31 int last; 31 int last;
32 struct clk *clk; 32 struct clk *clk;
33 struct i2c_adapter adapter; 33 struct i2c_adapter adapter;
34 phys_addr_t base;
35 int irq; 34 int irq;
36 u32 timeout; 35 u32 timeout;
37}; 36};
diff --git a/include/linux/i2c-smbus.h b/include/linux/i2c-smbus.h
index 017fb40f702a..8f1b086ca5bc 100644
--- a/include/linux/i2c-smbus.h
+++ b/include/linux/i2c-smbus.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * i2c-smbus.h - SMBus extensions to the I2C protocol 2 * i2c-smbus.h - SMBus extensions to the I2C protocol
3 * 3 *
4 * Copyright (C) 2010 Jean Delvare <khali@linux-fr.org> 4 * Copyright (C) 2010 Jean Delvare <jdelvare@suse.de>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index eff50e062be8..deddeb8c337c 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -342,11 +342,25 @@ i2c_register_board_info(int busnum, struct i2c_board_info const *info,
342} 342}
343#endif /* I2C_BOARDINFO */ 343#endif /* I2C_BOARDINFO */
344 344
345/* 345/**
346 * struct i2c_algorithm - represent I2C transfer method
347 * @master_xfer: Issue a set of i2c transactions to the given I2C adapter
348 * defined by the msgs array, with num messages available to transfer via
349 * the adapter specified by adap.
350 * @smbus_xfer: Issue smbus transactions to the given I2C adapter. If this
351 * is not present, then the bus layer will try and convert the SMBus calls
352 * into I2C transfers instead.
353 * @functionality: Return the flags that this algorithm/adapter pair supports
354 * from the I2C_FUNC_* flags.
355 *
346 * The following structs are for those who like to implement new bus drivers: 356 * The following structs are for those who like to implement new bus drivers:
347 * i2c_algorithm is the interface to a class of hardware solutions which can 357 * i2c_algorithm is the interface to a class of hardware solutions which can
348 * be addressed using the same bus algorithms - i.e. bit-banging or the PCF8584 358 * be addressed using the same bus algorithms - i.e. bit-banging or the PCF8584
349 * to name two of the most common. 359 * to name two of the most common.
360 *
361 * The return codes from the @master_xfer field should indicate the type of
362 * error code that occured during the transfer, as documented in the kernel
363 * Documentation file Documentation/i2c/fault-codes.
350 */ 364 */
351struct i2c_algorithm { 365struct i2c_algorithm {
352 /* If an adapter algorithm can't do I2C-level access, set master_xfer 366 /* If an adapter algorithm can't do I2C-level access, set master_xfer
@@ -445,7 +459,7 @@ static inline void i2c_set_adapdata(struct i2c_adapter *dev, void *data)
445static inline struct i2c_adapter * 459static inline struct i2c_adapter *
446i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter) 460i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter)
447{ 461{
448#if IS_ENABLED(I2C_MUX) 462#if IS_ENABLED(CONFIG_I2C_MUX)
449 struct device *parent = adapter->dev.parent; 463 struct device *parent = adapter->dev.parent;
450 464
451 if (parent != NULL && parent->type == &i2c_adapter_type) 465 if (parent != NULL && parent->type == &i2c_adapter_type)
diff --git a/include/linux/i2c/tsc2007.h b/include/linux/i2c/tsc2007.h
index 506a9f7af51e..4f35b6ad3889 100644
--- a/include/linux/i2c/tsc2007.h
+++ b/include/linux/i2c/tsc2007.h
@@ -7,16 +7,14 @@ struct tsc2007_platform_data {
7 u16 model; /* 2007. */ 7 u16 model; /* 2007. */
8 u16 x_plate_ohms; /* must be non-zero value */ 8 u16 x_plate_ohms; /* must be non-zero value */
9 u16 max_rt; /* max. resistance above which samples are ignored */ 9 u16 max_rt; /* max. resistance above which samples are ignored */
10 unsigned long poll_delay; /* delay (in ms) after pen-down event
11 before polling starts */
12 unsigned long poll_period; /* time (in ms) between samples */ 10 unsigned long poll_period; /* time (in ms) between samples */
13 int fuzzx; /* fuzz factor for X, Y and pressure axes */ 11 int fuzzx; /* fuzz factor for X, Y and pressure axes */
14 int fuzzy; 12 int fuzzy;
15 int fuzzz; 13 int fuzzz;
16 14
17 int (*get_pendown_state)(void); 15 int (*get_pendown_state)(struct device *);
18 void (*clear_penirq)(void); /* If needed, clear 2nd level 16 /* If needed, clear 2nd level interrupt source */
19 interrupt source */ 17 void (*clear_penirq)(void);
20 int (*init_platform_hw)(void); 18 int (*init_platform_hw)(void);
21 void (*exit_platform_hw)(void); 19 void (*exit_platform_hw)(void);
22}; 20};
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index 673a3ce67f31..ade1c06d4ceb 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -175,6 +175,9 @@ static inline int twl_class_is_ ##class(void) \
175TWL_CLASS_IS(4030, TWL4030_CLASS_ID) 175TWL_CLASS_IS(4030, TWL4030_CLASS_ID)
176TWL_CLASS_IS(6030, TWL6030_CLASS_ID) 176TWL_CLASS_IS(6030, TWL6030_CLASS_ID)
177 177
178/* Set the regcache bypass for the regmap associated with the nodule */
179int twl_set_regcache_bypass(u8 mod_no, bool enable);
180
178/* 181/*
179 * Read and write several 8-bit registers at once. 182 * Read and write several 8-bit registers at once.
180 */ 183 */
@@ -667,8 +670,6 @@ struct twl4030_codec_data {
667 unsigned int digimic_delay; /* in ms */ 670 unsigned int digimic_delay; /* in ms */
668 unsigned int ramp_delay_value; 671 unsigned int ramp_delay_value;
669 unsigned int offset_cncl_path; 672 unsigned int offset_cncl_path;
670 unsigned int check_defaults:1;
671 unsigned int reset_registers:1;
672 unsigned int hs_extmute:1; 673 unsigned int hs_extmute:1;
673 int hs_extmute_gpio; 674 int hs_extmute_gpio;
674}; 675};
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 46a14229a162..93b5ca754b5b 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -18,14 +18,10 @@
18#include <linux/completion.h> 18#include <linux/completion.h>
19#include <linux/pm.h> 19#include <linux/pm.h>
20#include <linux/mutex.h> 20#include <linux/mutex.h>
21#ifdef CONFIG_BLK_DEV_IDEACPI
22#include <acpi/acpi.h>
23#endif
24#include <asm/byteorder.h>
25#include <asm/io.h>
26
27/* for request_sense */ 21/* for request_sense */
28#include <linux/cdrom.h> 22#include <linux/cdrom.h>
23#include <asm/byteorder.h>
24#include <asm/io.h>
29 25
30#if defined(CONFIG_CRIS) || defined(CONFIG_FRV) || defined(CONFIG_MN10300) 26#if defined(CONFIG_CRIS) || defined(CONFIG_FRV) || defined(CONFIG_MN10300)
31# define SUPPORT_VLB_SYNC 0 27# define SUPPORT_VLB_SYNC 0
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 8c3b26a21574..e526a8cecb70 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -1411,8 +1411,12 @@ struct ieee80211_vht_operation {
1411#define IEEE80211_VHT_CAP_RXSTBC_MASK 0x00000700 1411#define IEEE80211_VHT_CAP_RXSTBC_MASK 0x00000700
1412#define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800 1412#define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800
1413#define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000 1413#define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000
1414#define IEEE80211_VHT_CAP_BEAMFORMEE_STS_MAX 0x0000e000 1414#define IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT 13
1415#define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MAX 0x00070000 1415#define IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK \
1416 (7 << IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT)
1417#define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT 16
1418#define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK \
1419 (7 << IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT)
1416#define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000 1420#define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000
1417#define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000 1421#define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000
1418#define IEEE80211_VHT_CAP_VHT_TXOP_PS 0x00200000 1422#define IEEE80211_VHT_CAP_VHT_TXOP_PS 0x00200000
@@ -1853,6 +1857,7 @@ enum ieee80211_key_len {
1853 WLAN_KEY_LEN_CCMP = 16, 1857 WLAN_KEY_LEN_CCMP = 16,
1854 WLAN_KEY_LEN_TKIP = 32, 1858 WLAN_KEY_LEN_TKIP = 32,
1855 WLAN_KEY_LEN_AES_CMAC = 16, 1859 WLAN_KEY_LEN_AES_CMAC = 16,
1860 WLAN_KEY_LEN_SMS4 = 32,
1856}; 1861};
1857 1862
1858#define IEEE80211_WEP_IV_LEN 4 1863#define IEEE80211_WEP_IV_LEN 4
@@ -1898,6 +1903,7 @@ enum ieee80211_tdls_actioncode {
1898#define WLAN_EXT_CAPA5_TDLS_PROHIBITED BIT(6) 1903#define WLAN_EXT_CAPA5_TDLS_PROHIBITED BIT(6)
1899 1904
1900#define WLAN_EXT_CAPA8_OPMODE_NOTIF BIT(6) 1905#define WLAN_EXT_CAPA8_OPMODE_NOTIF BIT(6)
1906#define WLAN_EXT_CAPA8_TDLS_WIDE_BW_ENABLED BIT(7)
1901 1907
1902/* TDLS specific payload type in the LLC/SNAP header */ 1908/* TDLS specific payload type in the LLC/SNAP header */
1903#define WLAN_TDLS_SNAP_RFTYPE 0x2 1909#define WLAN_TDLS_SNAP_RFTYPE 0x2
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
index 84ba5ac39e03..7c8b20b120ea 100644
--- a/include/linux/if_macvlan.h
+++ b/include/linux/if_macvlan.h
@@ -2,6 +2,7 @@
2#define _LINUX_IF_MACVLAN_H 2#define _LINUX_IF_MACVLAN_H
3 3
4#include <linux/if_link.h> 4#include <linux/if_link.h>
5#include <linux/if_vlan.h>
5#include <linux/list.h> 6#include <linux/list.h>
6#include <linux/netdevice.h> 7#include <linux/netdevice.h>
7#include <linux/netlink.h> 8#include <linux/netlink.h>
@@ -24,28 +25,6 @@ static inline struct socket *macvtap_get_socket(struct file *f)
24struct macvlan_port; 25struct macvlan_port;
25struct macvtap_queue; 26struct macvtap_queue;
26 27
27/**
28 * struct macvlan_pcpu_stats - MACVLAN percpu stats
29 * @rx_packets: number of received packets
30 * @rx_bytes: number of received bytes
31 * @rx_multicast: number of received multicast packets
32 * @tx_packets: number of transmitted packets
33 * @tx_bytes: number of transmitted bytes
34 * @syncp: synchronization point for 64bit counters
35 * @rx_errors: number of rx errors
36 * @tx_dropped: number of tx dropped packets
37 */
38struct macvlan_pcpu_stats {
39 u64 rx_packets;
40 u64 rx_bytes;
41 u64 rx_multicast;
42 u64 tx_packets;
43 u64 tx_bytes;
44 struct u64_stats_sync syncp;
45 u32 rx_errors;
46 u32 tx_dropped;
47};
48
49/* 28/*
50 * Maximum times a macvtap device can be opened. This can be used to 29 * Maximum times a macvtap device can be opened. This can be used to
51 * configure the number of receive queue, e.g. for multiqueue virtio. 30 * configure the number of receive queue, e.g. for multiqueue virtio.
@@ -62,15 +41,13 @@ struct macvlan_dev {
62 struct macvlan_port *port; 41 struct macvlan_port *port;
63 struct net_device *lowerdev; 42 struct net_device *lowerdev;
64 void *fwd_priv; 43 void *fwd_priv;
65 struct macvlan_pcpu_stats __percpu *pcpu_stats; 44 struct vlan_pcpu_stats __percpu *pcpu_stats;
66 45
67 DECLARE_BITMAP(mc_filter, MACVLAN_MC_FILTER_SZ); 46 DECLARE_BITMAP(mc_filter, MACVLAN_MC_FILTER_SZ);
68 47
69 netdev_features_t set_features; 48 netdev_features_t set_features;
70 enum macvlan_mode mode; 49 enum macvlan_mode mode;
71 u16 flags; 50 u16 flags;
72 int (*receive)(struct sk_buff *skb);
73 int (*forward)(struct net_device *dev, struct sk_buff *skb);
74 /* This array tracks active taps. */ 51 /* This array tracks active taps. */
75 struct macvtap_queue __rcu *taps[MAX_MACVTAP_QUEUES]; 52 struct macvtap_queue __rcu *taps[MAX_MACVTAP_QUEUES];
76 /* This list tracks all taps (both enabled and disabled) */ 53 /* This list tracks all taps (both enabled and disabled) */
@@ -86,7 +63,7 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan,
86 bool multicast) 63 bool multicast)
87{ 64{
88 if (likely(success)) { 65 if (likely(success)) {
89 struct macvlan_pcpu_stats *pcpu_stats; 66 struct vlan_pcpu_stats *pcpu_stats;
90 67
91 pcpu_stats = this_cpu_ptr(vlan->pcpu_stats); 68 pcpu_stats = this_cpu_ptr(vlan->pcpu_stats);
92 u64_stats_update_begin(&pcpu_stats->syncp); 69 u64_stats_update_begin(&pcpu_stats->syncp);
@@ -103,10 +80,7 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan,
103extern void macvlan_common_setup(struct net_device *dev); 80extern void macvlan_common_setup(struct net_device *dev);
104 81
105extern int macvlan_common_newlink(struct net *src_net, struct net_device *dev, 82extern int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
106 struct nlattr *tb[], struct nlattr *data[], 83 struct nlattr *tb[], struct nlattr *data[]);
107 int (*receive)(struct sk_buff *skb),
108 int (*forward)(struct net_device *dev,
109 struct sk_buff *skb));
110 84
111extern void macvlan_count_rx(const struct macvlan_dev *vlan, 85extern void macvlan_count_rx(const struct macvlan_dev *vlan,
112 unsigned int len, bool success, 86 unsigned int len, bool success,
@@ -116,9 +90,6 @@ extern void macvlan_dellink(struct net_device *dev, struct list_head *head);
116 90
117extern int macvlan_link_register(struct rtnl_link_ops *ops); 91extern int macvlan_link_register(struct rtnl_link_ops *ops);
118 92
119extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb,
120 struct net_device *dev);
121
122#if IS_ENABLED(CONFIG_MACVLAN) 93#if IS_ENABLED(CONFIG_MACVLAN)
123static inline struct net_device * 94static inline struct net_device *
124macvlan_dev_real_dev(const struct net_device *dev) 95macvlan_dev_real_dev(const struct net_device *dev)
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index f4e56ecd0b1a..712710bc0580 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -13,13 +13,4 @@
13#define for_each_ip_tunnel_rcu(pos, start) \ 13#define for_each_ip_tunnel_rcu(pos, start) \
14 for (pos = rcu_dereference(start); pos; pos = rcu_dereference(pos->next)) 14 for (pos = rcu_dereference(start); pos; pos = rcu_dereference(pos->next))
15 15
16/* often modified stats are per cpu, other are shared (netdev->stats) */
17struct pcpu_tstats {
18 u64 rx_packets;
19 u64 rx_bytes;
20 u64 tx_packets;
21 u64 tx_bytes;
22 struct u64_stats_sync syncp;
23};
24
25#endif /* _IF_TUNNEL_H_ */ 16#endif /* _IF_TUNNEL_H_ */
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index f252deb99454..bbedfb56bd66 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -82,25 +82,6 @@ static inline int is_vlan_dev(struct net_device *dev)
82#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) 82#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT)
83#define vlan_tx_tag_get_id(__skb) ((__skb)->vlan_tci & VLAN_VID_MASK) 83#define vlan_tx_tag_get_id(__skb) ((__skb)->vlan_tci & VLAN_VID_MASK)
84 84
85#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
86
87extern struct net_device *__vlan_find_dev_deep(struct net_device *real_dev,
88 __be16 vlan_proto, u16 vlan_id);
89extern struct net_device *vlan_dev_real_dev(const struct net_device *dev);
90extern u16 vlan_dev_vlan_id(const struct net_device *dev);
91
92/**
93 * struct vlan_priority_tci_mapping - vlan egress priority mappings
94 * @priority: skb priority
95 * @vlan_qos: vlan priority: (skb->priority << 13) & 0xE000
96 * @next: pointer to next struct
97 */
98struct vlan_priority_tci_mapping {
99 u32 priority;
100 u16 vlan_qos;
101 struct vlan_priority_tci_mapping *next;
102};
103
104/** 85/**
105 * struct vlan_pcpu_stats - VLAN percpu rx/tx stats 86 * struct vlan_pcpu_stats - VLAN percpu rx/tx stats
106 * @rx_packets: number of received packets 87 * @rx_packets: number of received packets
@@ -123,6 +104,25 @@ struct vlan_pcpu_stats {
123 u32 tx_dropped; 104 u32 tx_dropped;
124}; 105};
125 106
107#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
108
109extern struct net_device *__vlan_find_dev_deep(struct net_device *real_dev,
110 __be16 vlan_proto, u16 vlan_id);
111extern struct net_device *vlan_dev_real_dev(const struct net_device *dev);
112extern u16 vlan_dev_vlan_id(const struct net_device *dev);
113
114/**
115 * struct vlan_priority_tci_mapping - vlan egress priority mappings
116 * @priority: skb priority
117 * @vlan_qos: vlan priority: (skb->priority << 13) & 0xE000
118 * @next: pointer to next struct
119 */
120struct vlan_priority_tci_mapping {
121 u32 priority;
122 u16 vlan_qos;
123 struct vlan_priority_tci_mapping *next;
124};
125
126struct proc_dir_entry; 126struct proc_dir_entry;
127struct netpoll; 127struct netpoll;
128 128
diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h
index 15607b45221a..519392763393 100644
--- a/include/linux/iio/buffer.h
+++ b/include/linux/iio/buffer.h
@@ -21,6 +21,8 @@ struct iio_buffer;
21 * struct iio_buffer_access_funcs - access functions for buffers. 21 * struct iio_buffer_access_funcs - access functions for buffers.
22 * @store_to: actually store stuff to the buffer 22 * @store_to: actually store stuff to the buffer
23 * @read_first_n: try to get a specified number of bytes (must exist) 23 * @read_first_n: try to get a specified number of bytes (must exist)
24 * @data_available: indicates whether data for reading from the buffer is
25 * available.
24 * @request_update: if a parameter change has been marked, update underlying 26 * @request_update: if a parameter change has been marked, update underlying
25 * storage. 27 * storage.
26 * @get_bytes_per_datum:get current bytes per datum 28 * @get_bytes_per_datum:get current bytes per datum
@@ -43,6 +45,7 @@ struct iio_buffer_access_funcs {
43 int (*read_first_n)(struct iio_buffer *buffer, 45 int (*read_first_n)(struct iio_buffer *buffer,
44 size_t n, 46 size_t n,
45 char __user *buf); 47 char __user *buf);
48 bool (*data_available)(struct iio_buffer *buffer);
46 49
47 int (*request_update)(struct iio_buffer *buffer); 50 int (*request_update)(struct iio_buffer *buffer);
48 51
diff --git a/include/linux/iio/events.h b/include/linux/iio/events.h
index 5dab2c41031f..8bbd7bc1043d 100644
--- a/include/linux/iio/events.h
+++ b/include/linux/iio/events.h
@@ -46,10 +46,6 @@ struct iio_event_data {
46 ((u16)chan)) 46 ((u16)chan))
47 47
48 48
49#define IIO_EV_DIR_MAX 4
50#define IIO_EV_BIT(type, direction) \
51 (1 << (type*IIO_EV_DIR_MAX + direction))
52
53/** 49/**
54 * IIO_MOD_EVENT_CODE() - create event identifier for modified channels 50 * IIO_MOD_EVENT_CODE() - create event identifier for modified channels
55 * @chan_type: Type of the channel. Should be one of enum iio_chan_type. 51 * @chan_type: Type of the channel. Should be one of enum iio_chan_type.
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index 256a90a1bea6..75a8a20c8179 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -185,7 +185,6 @@ struct iio_event_spec {
185 * by all channels of the same direction. 185 * by all channels of the same direction.
186 * @info_mask_shared_by_all: What information is to be exported that is shared 186 * @info_mask_shared_by_all: What information is to be exported that is shared
187 * by all channels. 187 * by all channels.
188 * @event_mask: What events can this channel produce.
189 * @event_spec: Array of events which should be registered for this 188 * @event_spec: Array of events which should be registered for this
190 * channel. 189 * channel.
191 * @num_event_specs: Size of the event_spec array. 190 * @num_event_specs: Size of the event_spec array.
@@ -226,7 +225,6 @@ struct iio_chan_spec {
226 long info_mask_shared_by_type; 225 long info_mask_shared_by_type;
227 long info_mask_shared_by_dir; 226 long info_mask_shared_by_dir;
228 long info_mask_shared_by_all; 227 long info_mask_shared_by_all;
229 long event_mask;
230 const struct iio_event_spec *event_spec; 228 const struct iio_event_spec *event_spec;
231 unsigned int num_event_specs; 229 unsigned int num_event_specs;
232 const struct iio_chan_spec_ext_info *ext_info; 230 const struct iio_chan_spec_ext_info *ext_info;
@@ -307,16 +305,8 @@ struct iio_dev;
307 * returns IIO_VAL_INT_PLUS_MICRO. 305 * returns IIO_VAL_INT_PLUS_MICRO.
308 * @read_event_config: find out if the event is enabled. 306 * @read_event_config: find out if the event is enabled.
309 * @write_event_config: set if the event is enabled. 307 * @write_event_config: set if the event is enabled.
310 * @read_event_value: read a value associated with the event. Meaning 308 * @read_event_value: read a configuration value associated with the event.
311 * is event dependant. event_code specifies which event. 309 * @write_event_value: write a configuration value for the event.
312 * @write_event_value: write the value associated with the event.
313 * Meaning is event dependent.
314 * @read_event_config_new: find out if the event is enabled. New style interface.
315 * @write_event_config_new: set if the event is enabled. New style interface.
316 * @read_event_value_new: read a configuration value associated with the event.
317 * New style interface.
318 * @write_event_value_new: write a configuration value for the event. New style
319 * interface.
320 * @validate_trigger: function to validate the trigger when the 310 * @validate_trigger: function to validate the trigger when the
321 * current trigger gets changed. 311 * current trigger gets changed.
322 * @update_scan_mode: function to configure device and scan buffer when 312 * @update_scan_mode: function to configure device and scan buffer when
@@ -345,37 +335,23 @@ struct iio_info {
345 long mask); 335 long mask);
346 336
347 int (*read_event_config)(struct iio_dev *indio_dev, 337 int (*read_event_config)(struct iio_dev *indio_dev,
348 u64 event_code);
349
350 int (*write_event_config)(struct iio_dev *indio_dev,
351 u64 event_code,
352 int state);
353
354 int (*read_event_value)(struct iio_dev *indio_dev,
355 u64 event_code,
356 int *val);
357 int (*write_event_value)(struct iio_dev *indio_dev,
358 u64 event_code,
359 int val);
360
361 int (*read_event_config_new)(struct iio_dev *indio_dev,
362 const struct iio_chan_spec *chan, 338 const struct iio_chan_spec *chan,
363 enum iio_event_type type, 339 enum iio_event_type type,
364 enum iio_event_direction dir); 340 enum iio_event_direction dir);
365 341
366 int (*write_event_config_new)(struct iio_dev *indio_dev, 342 int (*write_event_config)(struct iio_dev *indio_dev,
367 const struct iio_chan_spec *chan, 343 const struct iio_chan_spec *chan,
368 enum iio_event_type type, 344 enum iio_event_type type,
369 enum iio_event_direction dir, 345 enum iio_event_direction dir,
370 int state); 346 int state);
371 347
372 int (*read_event_value_new)(struct iio_dev *indio_dev, 348 int (*read_event_value)(struct iio_dev *indio_dev,
373 const struct iio_chan_spec *chan, 349 const struct iio_chan_spec *chan,
374 enum iio_event_type type, 350 enum iio_event_type type,
375 enum iio_event_direction dir, 351 enum iio_event_direction dir,
376 enum iio_event_info info, int *val, int *val2); 352 enum iio_event_info info, int *val, int *val2);
377 353
378 int (*write_event_value_new)(struct iio_dev *indio_dev, 354 int (*write_event_value)(struct iio_dev *indio_dev,
379 const struct iio_chan_spec *chan, 355 const struct iio_chan_spec *chan,
380 enum iio_event_type type, 356 enum iio_event_type type,
381 enum iio_event_direction dir, 357 enum iio_event_direction dir,
@@ -490,32 +466,12 @@ struct iio_dev {
490#endif 466#endif
491}; 467};
492 468
493/**
494 * iio_find_channel_from_si() - get channel from its scan index
495 * @indio_dev: device
496 * @si: scan index to match
497 */
498const struct iio_chan_spec 469const struct iio_chan_spec
499*iio_find_channel_from_si(struct iio_dev *indio_dev, int si); 470*iio_find_channel_from_si(struct iio_dev *indio_dev, int si);
500
501/**
502 * iio_device_register() - register a device with the IIO subsystem
503 * @indio_dev: Device structure filled by the device driver
504 **/
505int iio_device_register(struct iio_dev *indio_dev); 471int iio_device_register(struct iio_dev *indio_dev);
506
507/**
508 * iio_device_unregister() - unregister a device from the IIO subsystem
509 * @indio_dev: Device structure representing the device.
510 **/
511void iio_device_unregister(struct iio_dev *indio_dev); 472void iio_device_unregister(struct iio_dev *indio_dev);
512 473int devm_iio_device_register(struct device *dev, struct iio_dev *indio_dev);
513/** 474void devm_iio_device_unregister(struct device *dev, struct iio_dev *indio_dev);
514 * iio_push_event() - try to add event to the list for userspace reading
515 * @indio_dev: IIO device structure
516 * @ev_code: What event
517 * @timestamp: When the event occurred
518 **/
519int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp); 475int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp);
520 476
521extern struct bus_type iio_bus_type; 477extern struct bus_type iio_bus_type;
@@ -579,10 +535,6 @@ static inline void *iio_device_get_drvdata(struct iio_dev *indio_dev)
579 535
580/* Can we make this smaller? */ 536/* Can we make this smaller? */
581#define IIO_ALIGN L1_CACHE_BYTES 537#define IIO_ALIGN L1_CACHE_BYTES
582/**
583 * iio_device_alloc() - allocate an iio_dev from a driver
584 * @sizeof_priv: Space to allocate for private structure.
585 **/
586struct iio_dev *iio_device_alloc(int sizeof_priv); 538struct iio_dev *iio_device_alloc(int sizeof_priv);
587 539
588static inline void *iio_priv(const struct iio_dev *indio_dev) 540static inline void *iio_priv(const struct iio_dev *indio_dev)
@@ -596,64 +548,11 @@ static inline struct iio_dev *iio_priv_to_dev(void *priv)
596 ALIGN(sizeof(struct iio_dev), IIO_ALIGN)); 548 ALIGN(sizeof(struct iio_dev), IIO_ALIGN));
597} 549}
598 550
599/**
600 * iio_device_free() - free an iio_dev from a driver
601 * @indio_dev: the iio_dev associated with the device
602 **/
603void iio_device_free(struct iio_dev *indio_dev); 551void iio_device_free(struct iio_dev *indio_dev);
604
605/**
606 * devm_iio_device_alloc - Resource-managed iio_device_alloc()
607 * @dev: Device to allocate iio_dev for
608 * @sizeof_priv: Space to allocate for private structure.
609 *
610 * Managed iio_device_alloc. iio_dev allocated with this function is
611 * automatically freed on driver detach.
612 *
613 * If an iio_dev allocated with this function needs to be freed separately,
614 * devm_iio_device_free() must be used.
615 *
616 * RETURNS:
617 * Pointer to allocated iio_dev on success, NULL on failure.
618 */
619struct iio_dev *devm_iio_device_alloc(struct device *dev, int sizeof_priv); 552struct iio_dev *devm_iio_device_alloc(struct device *dev, int sizeof_priv);
620
621/**
622 * devm_iio_device_free - Resource-managed iio_device_free()
623 * @dev: Device this iio_dev belongs to
624 * @indio_dev: the iio_dev associated with the device
625 *
626 * Free iio_dev allocated with devm_iio_device_alloc().
627 */
628void devm_iio_device_free(struct device *dev, struct iio_dev *indio_dev); 553void devm_iio_device_free(struct device *dev, struct iio_dev *indio_dev);
629
630/**
631 * devm_iio_trigger_alloc - Resource-managed iio_trigger_alloc()
632 * @dev: Device to allocate iio_trigger for
633 * @fmt: trigger name format. If it includes format
634 * specifiers, the additional arguments following
635 * format are formatted and inserted in the resulting
636 * string replacing their respective specifiers.
637 *
638 * Managed iio_trigger_alloc. iio_trigger allocated with this function is
639 * automatically freed on driver detach.
640 *
641 * If an iio_trigger allocated with this function needs to be freed separately,
642 * devm_iio_trigger_free() must be used.
643 *
644 * RETURNS:
645 * Pointer to allocated iio_trigger on success, NULL on failure.
646 */
647struct iio_trigger *devm_iio_trigger_alloc(struct device *dev, 554struct iio_trigger *devm_iio_trigger_alloc(struct device *dev,
648 const char *fmt, ...); 555 const char *fmt, ...);
649
650/**
651 * devm_iio_trigger_free - Resource-managed iio_trigger_free()
652 * @dev: Device this iio_dev belongs to
653 * @iio_trig: the iio_trigger associated with the device
654 *
655 * Free iio_trigger allocated with devm_iio_trigger_alloc().
656 */
657void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig); 556void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig);
658 557
659/** 558/**
diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h
index 4ac928ee31c5..084d882fe01b 100644
--- a/include/linux/iio/types.h
+++ b/include/linux/iio/types.h
@@ -29,6 +29,7 @@ enum iio_chan_type {
29 IIO_ALTVOLTAGE, 29 IIO_ALTVOLTAGE,
30 IIO_CCT, 30 IIO_CCT,
31 IIO_PRESSURE, 31 IIO_PRESSURE,
32 IIO_HUMIDITYRELATIVE,
32}; 33};
33 34
34enum iio_modifier { 35enum iio_modifier {
diff --git a/include/linux/inet_lro.h b/include/linux/inet_lro.h
index 2cf55afbcd4e..9a715cfa1fe3 100644
--- a/include/linux/inet_lro.h
+++ b/include/linux/inet_lro.h
@@ -133,33 +133,10 @@ struct net_lro_mgr {
133void lro_receive_skb(struct net_lro_mgr *lro_mgr, 133void lro_receive_skb(struct net_lro_mgr *lro_mgr,
134 struct sk_buff *skb, 134 struct sk_buff *skb,
135 void *priv); 135 void *priv);
136
137/*
138 * Processes a fragment list
139 *
140 * This functions aggregate fragments and generate SKBs do pass
141 * the packets to the stack.
142 *
143 * @lro_mgr: LRO manager to use
144 * @frags: Fragment to be processed. Must contain entire header in first
145 * element.
146 * @len: Length of received data
147 * @true_size: Actual size of memory the fragment is consuming
148 * @priv: Private data that may be used by driver functions
149 * (for example get_tcp_ip_hdr)
150 */
151
152void lro_receive_frags(struct net_lro_mgr *lro_mgr,
153 struct skb_frag_struct *frags,
154 int len, int true_size, void *priv, __wsum sum);
155
156/* 136/*
157 * Forward all aggregated SKBs held by lro_mgr to network stack 137 * Forward all aggregated SKBs held by lro_mgr to network stack
158 */ 138 */
159 139
160void lro_flush_all(struct net_lro_mgr *lro_mgr); 140void lro_flush_all(struct net_lro_mgr *lro_mgr);
161 141
162void lro_flush_pkt(struct net_lro_mgr *lro_mgr,
163 struct iphdr *iph, struct tcphdr *tcph);
164
165#endif 142#endif
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 0d678aefe69d..0068708161ff 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -136,8 +136,8 @@ struct in_ifaddr {
136 __be32 ifa_mask; 136 __be32 ifa_mask;
137 __be32 ifa_broadcast; 137 __be32 ifa_broadcast;
138 unsigned char ifa_scope; 138 unsigned char ifa_scope;
139 unsigned char ifa_flags;
140 unsigned char ifa_prefixlen; 139 unsigned char ifa_prefixlen;
140 __u32 ifa_flags;
141 char ifa_label[IFNAMSIZ]; 141 char ifa_label[IFNAMSIZ];
142 142
143 /* In seconds, relative to tstamp. Expiry is at tstamp + HZ * lft. */ 143 /* In seconds, relative to tstamp. Expiry is at tstamp + HZ * lft. */
@@ -164,11 +164,10 @@ int devinet_ioctl(struct net *net, unsigned int cmd, void __user *);
164void devinet_init(void); 164void devinet_init(void);
165struct in_device *inetdev_by_index(struct net *, int); 165struct in_device *inetdev_by_index(struct net *, int);
166__be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope); 166__be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope);
167__be32 inet_confirm_addr(struct in_device *in_dev, __be32 dst, __be32 local, 167__be32 inet_confirm_addr(struct net *net, struct in_device *in_dev, __be32 dst,
168 int scope); 168 __be32 local, int scope);
169struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix, 169struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix,
170 __be32 mask); 170 __be32 mask);
171
172static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa) 171static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa)
173{ 172{
174 return !((addr^ifa->ifa_address)&ifa->ifa_mask); 173 return !((addr^ifa->ifa_address)&ifa->ifa_mask);
@@ -220,6 +219,13 @@ static inline struct in_device *__in_dev_get_rtnl(const struct net_device *dev)
220 return rtnl_dereference(dev->ip_ptr); 219 return rtnl_dereference(dev->ip_ptr);
221} 220}
222 221
222static inline struct neigh_parms *__in_dev_arp_parms_get_rcu(const struct net_device *dev)
223{
224 struct in_device *in_dev = __in_dev_get_rcu(dev);
225
226 return in_dev ? in_dev->arp_parms : NULL;
227}
228
223void in_dev_finish_destroy(struct in_device *idev); 229void in_dev_finish_destroy(struct in_device *idev);
224 230
225static inline void in_dev_put(struct in_device *idev) 231static inline void in_dev_put(struct in_device *idev)
diff --git a/include/linux/init.h b/include/linux/init.h
index 8e68a64bfe00..e1688802964f 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -286,9 +286,11 @@ void __init parse_early_options(char *cmdline);
286#define arch_initcall(fn) module_init(fn) 286#define arch_initcall(fn) module_init(fn)
287#define subsys_initcall(fn) module_init(fn) 287#define subsys_initcall(fn) module_init(fn)
288#define fs_initcall(fn) module_init(fn) 288#define fs_initcall(fn) module_init(fn)
289#define rootfs_initcall(fn) module_init(fn)
289#define device_initcall(fn) module_init(fn) 290#define device_initcall(fn) module_init(fn)
290#define late_initcall(fn) module_init(fn) 291#define late_initcall(fn) module_init(fn)
291 292
293#define console_initcall(fn) module_init(fn)
292#define security_initcall(fn) module_init(fn) 294#define security_initcall(fn) module_init(fn)
293 295
294/* Each module must use one module_init(). */ 296/* Each module must use one module_init(). */
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index b0ed422e4e4a..6df7f9fe0d01 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -11,6 +11,7 @@
11#include <linux/user_namespace.h> 11#include <linux/user_namespace.h>
12#include <linux/securebits.h> 12#include <linux/securebits.h>
13#include <linux/seqlock.h> 13#include <linux/seqlock.h>
14#include <linux/rbtree.h>
14#include <net/net_namespace.h> 15#include <net/net_namespace.h>
15#include <linux/sched/rt.h> 16#include <linux/sched/rt.h>
16 17
@@ -40,6 +41,7 @@ extern struct fs_struct init_fs;
40 41
41#define INIT_SIGNALS(sig) { \ 42#define INIT_SIGNALS(sig) { \
42 .nr_threads = 1, \ 43 .nr_threads = 1, \
44 .thread_head = LIST_HEAD_INIT(init_task.thread_node), \
43 .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\ 45 .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\
44 .shared_pending = { \ 46 .shared_pending = { \
45 .list = LIST_HEAD_INIT(sig.shared_pending.list), \ 47 .list = LIST_HEAD_INIT(sig.shared_pending.list), \
@@ -95,7 +97,7 @@ extern struct group_info init_groups;
95#ifdef CONFIG_AUDITSYSCALL 97#ifdef CONFIG_AUDITSYSCALL
96#define INIT_IDS \ 98#define INIT_IDS \
97 .loginuid = INVALID_UID, \ 99 .loginuid = INVALID_UID, \
98 .sessionid = -1, 100 .sessionid = (unsigned int)-1,
99#else 101#else
100#define INIT_IDS 102#define INIT_IDS
101#endif 103#endif
@@ -154,6 +156,14 @@ extern struct task_group root_task_group;
154 156
155#define INIT_TASK_COMM "swapper" 157#define INIT_TASK_COMM "swapper"
156 158
159#ifdef CONFIG_RT_MUTEXES
160# define INIT_RT_MUTEXES(tsk) \
161 .pi_waiters = RB_ROOT, \
162 .pi_waiters_leftmost = NULL,
163#else
164# define INIT_RT_MUTEXES(tsk)
165#endif
166
157/* 167/*
158 * INIT_TASK is used to set up the first task table, touch at 168 * INIT_TASK is used to set up the first task table, touch at
159 * your own risk!. Base=0, limit=0x1fffff (=2MB) 169 * your own risk!. Base=0, limit=0x1fffff (=2MB)
@@ -213,6 +223,7 @@ extern struct task_group root_task_group;
213 [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \ 223 [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \
214 }, \ 224 }, \
215 .thread_group = LIST_HEAD_INIT(tsk.thread_group), \ 225 .thread_group = LIST_HEAD_INIT(tsk.thread_group), \
226 .thread_node = LIST_HEAD_INIT(init_signals.thread_head), \
216 INIT_IDS \ 227 INIT_IDS \
217 INIT_PERF_EVENTS(tsk) \ 228 INIT_PERF_EVENTS(tsk) \
218 INIT_TRACE_IRQFLAGS \ 229 INIT_TRACE_IRQFLAGS \
@@ -221,6 +232,7 @@ extern struct task_group root_task_group;
221 INIT_TRACE_RECURSION \ 232 INIT_TRACE_RECURSION \
222 INIT_TASK_RCU_PREEMPT(tsk) \ 233 INIT_TASK_RCU_PREEMPT(tsk) \
223 INIT_CPUSET_SEQ(tsk) \ 234 INIT_CPUSET_SEQ(tsk) \
235 INIT_RT_MUTEXES(tsk) \
224 INIT_VTIME(tsk) \ 236 INIT_VTIME(tsk) \
225} 237}
226 238
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
index d380c5e68008..2c4bed593b32 100644
--- a/include/linux/intel-iommu.h
+++ b/include/linux/intel-iommu.h
@@ -288,6 +288,7 @@ struct q_inval {
288 288
289struct ir_table { 289struct ir_table {
290 struct irte *base; 290 struct irte *base;
291 unsigned long *bitmap;
291}; 292};
292#endif 293#endif
293 294
@@ -347,8 +348,6 @@ static inline void __iommu_flush_cache(
347extern struct dmar_drhd_unit * dmar_find_matched_drhd_unit(struct pci_dev *dev); 348extern struct dmar_drhd_unit * dmar_find_matched_drhd_unit(struct pci_dev *dev);
348extern int dmar_find_matched_atsr_unit(struct pci_dev *dev); 349extern int dmar_find_matched_atsr_unit(struct pci_dev *dev);
349 350
350extern int alloc_iommu(struct dmar_drhd_unit *drhd);
351extern void free_iommu(struct intel_iommu *iommu);
352extern int dmar_enable_qi(struct intel_iommu *iommu); 351extern int dmar_enable_qi(struct intel_iommu *iommu);
353extern void dmar_disable_qi(struct intel_iommu *iommu); 352extern void dmar_disable_qi(struct intel_iommu *iommu);
354extern int dmar_reenable_qi(struct intel_iommu *iommu); 353extern int dmar_reenable_qi(struct intel_iommu *iommu);
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index db43b58a3355..a2678d35b5a2 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -158,6 +158,11 @@ devm_request_irq(struct device *dev, unsigned int irq, irq_handler_t handler,
158 devname, dev_id); 158 devname, dev_id);
159} 159}
160 160
161extern int __must_check
162devm_request_any_context_irq(struct device *dev, unsigned int irq,
163 irq_handler_t handler, unsigned long irqflags,
164 const char *devname, void *dev_id);
165
161extern void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id); 166extern void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id);
162 167
163/* 168/*
@@ -360,7 +365,7 @@ enum
360/* map softirq index to softirq name. update 'softirq_to_name' in 365/* map softirq index to softirq name. update 'softirq_to_name' in
361 * kernel/softirq.c when adding a new softirq. 366 * kernel/softirq.c when adding a new softirq.
362 */ 367 */
363extern char *softirq_to_name[NR_SOFTIRQS]; 368extern const char * const softirq_to_name[NR_SOFTIRQS];
364 369
365/* softirq mask and active fields moved to irq_cpustat_t in 370/* softirq mask and active fields moved to irq_cpustat_t in
366 * asm/hardirq.h to get better cache usage. KAO 371 * asm/hardirq.h to get better cache usage. KAO
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index a444c790fa72..b96a5b2136e4 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -24,9 +24,10 @@
24#include <linux/types.h> 24#include <linux/types.h>
25#include <trace/events/iommu.h> 25#include <trace/events/iommu.h>
26 26
27#define IOMMU_READ (1) 27#define IOMMU_READ (1 << 0)
28#define IOMMU_WRITE (2) 28#define IOMMU_WRITE (1 << 1)
29#define IOMMU_CACHE (4) /* DMA cache coherency */ 29#define IOMMU_CACHE (1 << 2) /* DMA cache coherency */
30#define IOMMU_EXEC (1 << 3)
30 31
31struct iommu_ops; 32struct iommu_ops;
32struct iommu_group; 33struct iommu_group;
@@ -247,6 +248,11 @@ static inline struct iommu_domain *iommu_domain_alloc(struct bus_type *bus)
247 return NULL; 248 return NULL;
248} 249}
249 250
251static inline struct iommu_group *iommu_group_get_by_id(int id)
252{
253 return NULL;
254}
255
250static inline void iommu_domain_free(struct iommu_domain *domain) 256static inline void iommu_domain_free(struct iommu_domain *domain)
251{ 257{
252} 258}
@@ -291,8 +297,8 @@ static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_ad
291 return 0; 297 return 0;
292} 298}
293 299
294static inline int domain_has_cap(struct iommu_domain *domain, 300static inline int iommu_domain_has_cap(struct iommu_domain *domain,
295 unsigned long cap) 301 unsigned long cap)
296{ 302{
297 return 0; 303 return 0;
298} 304}
diff --git a/include/linux/ipc.h b/include/linux/ipc.h
index 8d861b2651f7..9d84942ae2e5 100644
--- a/include/linux/ipc.h
+++ b/include/linux/ipc.h
@@ -11,7 +11,7 @@
11struct kern_ipc_perm 11struct kern_ipc_perm
12{ 12{
13 spinlock_t lock; 13 spinlock_t lock;
14 int deleted; 14 bool deleted;
15 int id; 15 int id;
16 key_t key; 16 key_t key;
17 kuid_t uid; 17 kuid_t uid;
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h
index f6c82de12541..e7831d203737 100644
--- a/include/linux/ipc_namespace.h
+++ b/include/linux/ipc_namespace.h
@@ -21,7 +21,6 @@ struct user_namespace;
21struct ipc_ids { 21struct ipc_ids {
22 int in_use; 22 int in_use;
23 unsigned short seq; 23 unsigned short seq;
24 unsigned short seq_max;
25 struct rw_semaphore rwsem; 24 struct rw_semaphore rwsem;
26 struct idr ipcs_idr; 25 struct idr ipcs_idr;
27 int next_id; 26 int next_id;
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index c56c350324e4..2faef339d8f2 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -191,7 +191,8 @@ struct ipv6_pinfo {
191 /* sockopt flags */ 191 /* sockopt flags */
192 __u16 recverr:1, 192 __u16 recverr:1,
193 sndflow:1, 193 sndflow:1,
194 pmtudisc:2, 194 repflow:1,
195 pmtudisc:3,
195 ipv6only:1, 196 ipv6only:1,
196 srcprefs:3, /* 001: prefer temporary address 197 srcprefs:3, /* 001: prefer temporary address
197 * 010: prefer public address 198 * 010: prefer public address
@@ -200,7 +201,7 @@ struct ipv6_pinfo {
200 dontfrag:1; 201 dontfrag:1;
201 __u8 min_hopcount; 202 __u8 min_hopcount;
202 __u8 tclass; 203 __u8 tclass;
203 __u8 rcv_tclass; 204 __be32 rcv_flowinfo;
204 205
205 __u32 dst_cookie; 206 __u32 dst_cookie;
206 __u32 rx_dst_cookie; 207 __u32 rx_dst_cookie;
@@ -283,6 +284,8 @@ static inline void inet_sk_copy_descendant(struct sock *sk_to,
283 284
284#define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only) 285#define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only)
285#define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk)) 286#define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk))
287#define ipv6_sk_rxinfo(sk) ((sk)->sk_family == PF_INET6 && \
288 inet6_sk(sk)->rxopt.bits.rxinfo)
286 289
287static inline const struct in6_addr *inet6_rcv_saddr(const struct sock *sk) 290static inline const struct in6_addr *inet6_rcv_saddr(const struct sock *sk)
288{ 291{
@@ -299,6 +302,7 @@ static inline int inet_v6_ipv6only(const struct sock *sk)
299#else 302#else
300#define __ipv6_only_sock(sk) 0 303#define __ipv6_only_sock(sk) 0
301#define ipv6_only_sock(sk) 0 304#define ipv6_only_sock(sk) 0
305#define ipv6_sk_rxinfo(sk) 0
302 306
303static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk) 307static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk)
304{ 308{
diff --git a/include/linux/irqchip/arm-gic.h b/include/linux/irqchip/arm-gic.h
index cac496b1e279..0ceb389dba6c 100644
--- a/include/linux/irqchip/arm-gic.h
+++ b/include/linux/irqchip/arm-gic.h
@@ -17,6 +17,9 @@
17#define GIC_CPU_EOI 0x10 17#define GIC_CPU_EOI 0x10
18#define GIC_CPU_RUNNINGPRI 0x14 18#define GIC_CPU_RUNNINGPRI 0x14
19#define GIC_CPU_HIGHPRI 0x18 19#define GIC_CPU_HIGHPRI 0x18
20#define GIC_CPU_ALIAS_BINPOINT 0x1c
21#define GIC_CPU_ACTIVEPRIO 0xd0
22#define GIC_CPU_IDENT 0xfc
20 23
21#define GIC_DIST_CTRL 0x000 24#define GIC_DIST_CTRL 0x000
22#define GIC_DIST_CTR 0x004 25#define GIC_DIST_CTR 0x004
@@ -56,6 +59,15 @@
56#define GICH_LR_ACTIVE_BIT (1 << 29) 59#define GICH_LR_ACTIVE_BIT (1 << 29)
57#define GICH_LR_EOI (1 << 19) 60#define GICH_LR_EOI (1 << 19)
58 61
62#define GICH_VMCR_CTRL_SHIFT 0
63#define GICH_VMCR_CTRL_MASK (0x21f << GICH_VMCR_CTRL_SHIFT)
64#define GICH_VMCR_PRIMASK_SHIFT 27
65#define GICH_VMCR_PRIMASK_MASK (0x1f << GICH_VMCR_PRIMASK_SHIFT)
66#define GICH_VMCR_BINPOINT_SHIFT 21
67#define GICH_VMCR_BINPOINT_MASK (0x7 << GICH_VMCR_BINPOINT_SHIFT)
68#define GICH_VMCR_ALIAS_BINPOINT_SHIFT 18
69#define GICH_VMCR_ALIAS_BINPOINT_MASK (0x7 << GICH_VMCR_ALIAS_BINPOINT_SHIFT)
70
59#define GICH_MISR_EOI (1 << 0) 71#define GICH_MISR_EOI (1 << 0)
60#define GICH_MISR_U (1 << 1) 72#define GICH_MISR_U (1 << 1)
61 73
diff --git a/include/linux/irqchip/xtensa-mx.h b/include/linux/irqchip/xtensa-mx.h
new file mode 100644
index 000000000000..9c3b6ecc8b2f
--- /dev/null
+++ b/include/linux/irqchip/xtensa-mx.h
@@ -0,0 +1,17 @@
1/*
2 * Xtensa MX interrupt distributor
3 *
4 * Copyright (C) 2002 - 2013 Tensilica, Inc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef __LINUX_IRQCHIP_XTENSA_MX_H
12#define __LINUX_IRQCHIP_XTENSA_MX_H
13
14struct device_node;
15int xtensa_mx_init_legacy(struct device_node *interrupt_parent);
16
17#endif /* __LINUX_IRQCHIP_XTENSA_MX_H */
diff --git a/include/linux/irqchip/xtensa-pic.h b/include/linux/irqchip/xtensa-pic.h
new file mode 100644
index 000000000000..48718ae5ab68
--- /dev/null
+++ b/include/linux/irqchip/xtensa-pic.h
@@ -0,0 +1,18 @@
1/*
2 * Xtensa built-in interrupt controller
3 *
4 * Copyright (C) 2002 - 2013 Tensilica, Inc.
5 * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 */
11
12#ifndef __LINUX_IRQCHIP_XTENSA_PIC_H
13#define __LINUX_IRQCHIP_XTENSA_PIC_H
14
15struct device_node;
16int xtensa_pic_init_legacy(struct device_node *interrupt_parent);
17
18#endif /* __LINUX_IRQCHIP_XTENSA_PIC_H */
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
index 56fb646909dc..26e2661d3935 100644
--- a/include/linux/irqdesc.h
+++ b/include/linux/irqdesc.h
@@ -152,6 +152,14 @@ static inline int irq_balancing_disabled(unsigned int irq)
152 return desc->status_use_accessors & IRQ_NO_BALANCING_MASK; 152 return desc->status_use_accessors & IRQ_NO_BALANCING_MASK;
153} 153}
154 154
155static inline int irq_is_percpu(unsigned int irq)
156{
157 struct irq_desc *desc;
158
159 desc = irq_to_desc(irq);
160 return desc->status_use_accessors & IRQ_PER_CPU;
161}
162
155static inline void 163static inline void
156irq_set_lockdep_class(unsigned int irq, struct lock_class_key *class) 164irq_set_lockdep_class(unsigned int irq, struct lock_class_key *class)
157{ 165{
diff --git a/include/linux/iscsi_ibft.h b/include/linux/iscsi_ibft.h
index 8ba7e5b9d62c..605cc5c333d9 100644
--- a/include/linux/iscsi_ibft.h
+++ b/include/linux/iscsi_ibft.h
@@ -21,7 +21,7 @@
21#ifndef ISCSI_IBFT_H 21#ifndef ISCSI_IBFT_H
22#define ISCSI_IBFT_H 22#define ISCSI_IBFT_H
23 23
24#include <acpi/acpi.h> 24#include <linux/acpi.h>
25 25
26/* 26/*
27 * Logical location of iSCSI Boot Format Table. 27 * Logical location of iSCSI Boot Format Table.
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index d235e88cfd7c..1f44466c1e9d 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -294,6 +294,12 @@ extern unsigned long preset_lpj;
294 */ 294 */
295extern unsigned int jiffies_to_msecs(const unsigned long j); 295extern unsigned int jiffies_to_msecs(const unsigned long j);
296extern unsigned int jiffies_to_usecs(const unsigned long j); 296extern unsigned int jiffies_to_usecs(const unsigned long j);
297
298static inline u64 jiffies_to_nsecs(const unsigned long j)
299{
300 return (u64)jiffies_to_usecs(j) * NSEC_PER_USEC;
301}
302
297extern unsigned long msecs_to_jiffies(const unsigned int m); 303extern unsigned long msecs_to_jiffies(const unsigned int m);
298extern unsigned long usecs_to_jiffies(const unsigned int u); 304extern unsigned long usecs_to_jiffies(const unsigned int u);
299extern unsigned long timespec_to_jiffies(const struct timespec *value); 305extern unsigned long timespec_to_jiffies(const struct timespec *value);
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index 39999775b922..5c1dfb2a9e73 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -81,18 +81,21 @@ struct module;
81#include <linux/atomic.h> 81#include <linux/atomic.h>
82#ifdef HAVE_JUMP_LABEL 82#ifdef HAVE_JUMP_LABEL
83 83
84#define JUMP_LABEL_TRUE_BRANCH 1UL 84#define JUMP_LABEL_TYPE_FALSE_BRANCH 0UL
85#define JUMP_LABEL_TYPE_TRUE_BRANCH 1UL
86#define JUMP_LABEL_TYPE_MASK 1UL
85 87
86static 88static
87inline struct jump_entry *jump_label_get_entries(struct static_key *key) 89inline struct jump_entry *jump_label_get_entries(struct static_key *key)
88{ 90{
89 return (struct jump_entry *)((unsigned long)key->entries 91 return (struct jump_entry *)((unsigned long)key->entries
90 & ~JUMP_LABEL_TRUE_BRANCH); 92 & ~JUMP_LABEL_TYPE_MASK);
91} 93}
92 94
93static inline bool jump_label_get_branch_default(struct static_key *key) 95static inline bool jump_label_get_branch_default(struct static_key *key)
94{ 96{
95 if ((unsigned long)key->entries & JUMP_LABEL_TRUE_BRANCH) 97 if (((unsigned long)key->entries & JUMP_LABEL_TYPE_MASK) ==
98 JUMP_LABEL_TYPE_TRUE_BRANCH)
96 return true; 99 return true;
97 return false; 100 return false;
98} 101}
@@ -122,10 +125,12 @@ extern void static_key_slow_inc(struct static_key *key);
122extern void static_key_slow_dec(struct static_key *key); 125extern void static_key_slow_dec(struct static_key *key);
123extern void jump_label_apply_nops(struct module *mod); 126extern void jump_label_apply_nops(struct module *mod);
124 127
125#define STATIC_KEY_INIT_TRUE ((struct static_key) \ 128#define STATIC_KEY_INIT_TRUE ((struct static_key) \
126 { .enabled = ATOMIC_INIT(1), .entries = (void *)1 }) 129 { .enabled = ATOMIC_INIT(1), \
127#define STATIC_KEY_INIT_FALSE ((struct static_key) \ 130 .entries = (void *)JUMP_LABEL_TYPE_TRUE_BRANCH })
128 { .enabled = ATOMIC_INIT(0), .entries = (void *)0 }) 131#define STATIC_KEY_INIT_FALSE ((struct static_key) \
132 { .enabled = ATOMIC_INIT(0), \
133 .entries = (void *)JUMP_LABEL_TYPE_FALSE_BRANCH })
129 134
130#else /* !HAVE_JUMP_LABEL */ 135#else /* !HAVE_JUMP_LABEL */
131 136
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index ecb87544cc5d..196d1ea86df0 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -29,6 +29,19 @@
29#define ULLONG_MAX (~0ULL) 29#define ULLONG_MAX (~0ULL)
30#define SIZE_MAX (~(size_t)0) 30#define SIZE_MAX (~(size_t)0)
31 31
32#define U8_MAX ((u8)~0U)
33#define S8_MAX ((s8)(U8_MAX>>1))
34#define S8_MIN ((s8)(-S8_MAX - 1))
35#define U16_MAX ((u16)~0U)
36#define S16_MAX ((s16)(U16_MAX>>1))
37#define S16_MIN ((s16)(-S16_MAX - 1))
38#define U32_MAX ((u32)~0U)
39#define S32_MAX ((s32)(U32_MAX>>1))
40#define S32_MIN ((s32)(-S32_MAX - 1))
41#define U64_MAX ((u64)~0ULL)
42#define S64_MAX ((s64)(U64_MAX>>1))
43#define S64_MIN ((s64)(-S64_MAX - 1))
44
32#define STACK_MAGIC 0xdeadbeef 45#define STACK_MAGIC 0xdeadbeef
33 46
34#define REPEAT_BYTE(x) ((~0ul / 0xff) * (x)) 47#define REPEAT_BYTE(x) ((~0ul / 0xff) * (x))
@@ -193,6 +206,25 @@ extern int _cond_resched(void);
193 (__x < 0) ? -__x : __x; \ 206 (__x < 0) ? -__x : __x; \
194 }) 207 })
195 208
209/**
210 * reciprocal_scale - "scale" a value into range [0, ep_ro)
211 * @val: value
212 * @ep_ro: right open interval endpoint
213 *
214 * Perform a "reciprocal multiplication" in order to "scale" a value into
215 * range [0, ep_ro), where the upper interval endpoint is right-open.
216 * This is useful, e.g. for accessing a index of an array containing
217 * ep_ro elements, for example. Think of it as sort of modulus, only that
218 * the result isn't that of modulo. ;) Note that if initial input is a
219 * small value, then result will return 0.
220 *
221 * Return: a result based on val in interval [0, ep_ro).
222 */
223static inline u32 reciprocal_scale(u32 val, u32 ep_ro)
224{
225 return (u32)(((u64) val * ep_ro) >> 32);
226}
227
196#if defined(CONFIG_MMU) && \ 228#if defined(CONFIG_MMU) && \
197 (defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP)) 229 (defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP))
198void might_fault(void); 230void might_fault(void);
@@ -394,6 +426,15 @@ extern int panic_on_oops;
394extern int panic_on_unrecovered_nmi; 426extern int panic_on_unrecovered_nmi;
395extern int panic_on_io_nmi; 427extern int panic_on_io_nmi;
396extern int sysctl_panic_on_stackoverflow; 428extern int sysctl_panic_on_stackoverflow;
429/*
430 * Only to be used by arch init code. If the user over-wrote the default
431 * CONFIG_PANIC_TIMEOUT, honor it.
432 */
433static inline void set_arch_panic_timeout(int timeout, int arch_default_timeout)
434{
435 if (panic_timeout == arch_default_timeout)
436 panic_timeout = timeout;
437}
397extern const char *print_tainted(void); 438extern const char *print_tainted(void);
398enum lockdep_ok { 439enum lockdep_ok {
399 LOCKDEP_STILL_OK, 440 LOCKDEP_STILL_OK,
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h
new file mode 100644
index 000000000000..5be9f0228a3b
--- /dev/null
+++ b/include/linux/kernfs.h
@@ -0,0 +1,376 @@
1/*
2 * kernfs.h - pseudo filesystem decoupled from vfs locking
3 *
4 * This file is released under the GPLv2.
5 */
6
7#ifndef __LINUX_KERNFS_H
8#define __LINUX_KERNFS_H
9
10#include <linux/kernel.h>
11#include <linux/err.h>
12#include <linux/list.h>
13#include <linux/mutex.h>
14#include <linux/idr.h>
15#include <linux/lockdep.h>
16#include <linux/rbtree.h>
17#include <linux/atomic.h>
18#include <linux/completion.h>
19
20struct file;
21struct dentry;
22struct iattr;
23struct seq_file;
24struct vm_area_struct;
25struct super_block;
26struct file_system_type;
27
28struct kernfs_open_node;
29struct kernfs_iattrs;
30
31enum kernfs_node_type {
32 KERNFS_DIR = 0x0001,
33 KERNFS_FILE = 0x0002,
34 KERNFS_LINK = 0x0004,
35};
36
37#define KERNFS_TYPE_MASK 0x000f
38#define KERNFS_ACTIVE_REF KERNFS_FILE
39#define KERNFS_FLAG_MASK ~KERNFS_TYPE_MASK
40
41enum kernfs_node_flag {
42 KERNFS_REMOVED = 0x0010,
43 KERNFS_NS = 0x0020,
44 KERNFS_HAS_SEQ_SHOW = 0x0040,
45 KERNFS_HAS_MMAP = 0x0080,
46 KERNFS_LOCKDEP = 0x0100,
47 KERNFS_STATIC_NAME = 0x0200,
48};
49
50/* type-specific structures for kernfs_node union members */
51struct kernfs_elem_dir {
52 unsigned long subdirs;
53 /* children rbtree starts here and goes through kn->rb */
54 struct rb_root children;
55
56 /*
57 * The kernfs hierarchy this directory belongs to. This fits
58 * better directly in kernfs_node but is here to save space.
59 */
60 struct kernfs_root *root;
61};
62
63struct kernfs_elem_symlink {
64 struct kernfs_node *target_kn;
65};
66
67struct kernfs_elem_attr {
68 const struct kernfs_ops *ops;
69 struct kernfs_open_node *open;
70 loff_t size;
71};
72
73/*
74 * kernfs_node - the building block of kernfs hierarchy. Each and every
75 * kernfs node is represented by single kernfs_node. Most fields are
76 * private to kernfs and shouldn't be accessed directly by kernfs users.
77 *
78 * As long as s_count reference is held, the kernfs_node itself is
79 * accessible. Dereferencing elem or any other outer entity requires
80 * active reference.
81 */
82struct kernfs_node {
83 atomic_t count;
84 atomic_t active;
85#ifdef CONFIG_DEBUG_LOCK_ALLOC
86 struct lockdep_map dep_map;
87#endif
88 /* the following two fields are published */
89 struct kernfs_node *parent;
90 const char *name;
91
92 struct rb_node rb;
93
94 union {
95 struct completion *completion;
96 struct kernfs_node *removed_list;
97 } u;
98
99 const void *ns; /* namespace tag */
100 unsigned int hash; /* ns + name hash */
101 union {
102 struct kernfs_elem_dir dir;
103 struct kernfs_elem_symlink symlink;
104 struct kernfs_elem_attr attr;
105 };
106
107 void *priv;
108
109 unsigned short flags;
110 umode_t mode;
111 unsigned int ino;
112 struct kernfs_iattrs *iattr;
113};
114
115/*
116 * kernfs_dir_ops may be specified on kernfs_create_root() to support
117 * directory manipulation syscalls. These optional callbacks are invoked
118 * on the matching syscalls and can perform any kernfs operations which
119 * don't necessarily have to be the exact operation requested.
120 */
121struct kernfs_dir_ops {
122 int (*mkdir)(struct kernfs_node *parent, const char *name,
123 umode_t mode);
124 int (*rmdir)(struct kernfs_node *kn);
125 int (*rename)(struct kernfs_node *kn, struct kernfs_node *new_parent,
126 const char *new_name);
127};
128
129struct kernfs_root {
130 /* published fields */
131 struct kernfs_node *kn;
132
133 /* private fields, do not use outside kernfs proper */
134 struct ida ino_ida;
135 struct kernfs_dir_ops *dir_ops;
136};
137
138struct kernfs_open_file {
139 /* published fields */
140 struct kernfs_node *kn;
141 struct file *file;
142
143 /* private fields, do not use outside kernfs proper */
144 struct mutex mutex;
145 int event;
146 struct list_head list;
147
148 bool mmapped;
149 const struct vm_operations_struct *vm_ops;
150};
151
152struct kernfs_ops {
153 /*
154 * Read is handled by either seq_file or raw_read().
155 *
156 * If seq_show() is present, seq_file path is active. Other seq
157 * operations are optional and if not implemented, the behavior is
158 * equivalent to single_open(). @sf->private points to the
159 * associated kernfs_open_file.
160 *
161 * read() is bounced through kernel buffer and a read larger than
162 * PAGE_SIZE results in partial operation of PAGE_SIZE.
163 */
164 int (*seq_show)(struct seq_file *sf, void *v);
165
166 void *(*seq_start)(struct seq_file *sf, loff_t *ppos);
167 void *(*seq_next)(struct seq_file *sf, void *v, loff_t *ppos);
168 void (*seq_stop)(struct seq_file *sf, void *v);
169
170 ssize_t (*read)(struct kernfs_open_file *of, char *buf, size_t bytes,
171 loff_t off);
172
173 /*
174 * write() is bounced through kernel buffer and a write larger than
175 * PAGE_SIZE results in partial operation of PAGE_SIZE.
176 */
177 ssize_t (*write)(struct kernfs_open_file *of, char *buf, size_t bytes,
178 loff_t off);
179
180 int (*mmap)(struct kernfs_open_file *of, struct vm_area_struct *vma);
181
182#ifdef CONFIG_DEBUG_LOCK_ALLOC
183 struct lock_class_key lockdep_key;
184#endif
185};
186
187#ifdef CONFIG_SYSFS
188
189static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn)
190{
191 return kn->flags & KERNFS_TYPE_MASK;
192}
193
194/**
195 * kernfs_enable_ns - enable namespace under a directory
196 * @kn: directory of interest, should be empty
197 *
198 * This is to be called right after @kn is created to enable namespace
199 * under it. All children of @kn must have non-NULL namespace tags and
200 * only the ones which match the super_block's tag will be visible.
201 */
202static inline void kernfs_enable_ns(struct kernfs_node *kn)
203{
204 WARN_ON_ONCE(kernfs_type(kn) != KERNFS_DIR);
205 WARN_ON_ONCE(!RB_EMPTY_ROOT(&kn->dir.children));
206 kn->flags |= KERNFS_NS;
207}
208
209/**
210 * kernfs_ns_enabled - test whether namespace is enabled
211 * @kn: the node to test
212 *
213 * Test whether namespace filtering is enabled for the children of @ns.
214 */
215static inline bool kernfs_ns_enabled(struct kernfs_node *kn)
216{
217 return kn->flags & KERNFS_NS;
218}
219
220struct kernfs_node *kernfs_find_and_get_ns(struct kernfs_node *parent,
221 const char *name, const void *ns);
222void kernfs_get(struct kernfs_node *kn);
223void kernfs_put(struct kernfs_node *kn);
224
225struct kernfs_root *kernfs_create_root(struct kernfs_dir_ops *kdops,
226 void *priv);
227void kernfs_destroy_root(struct kernfs_root *root);
228
229struct kernfs_node *kernfs_create_dir_ns(struct kernfs_node *parent,
230 const char *name, umode_t mode,
231 void *priv, const void *ns);
232struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent,
233 const char *name,
234 umode_t mode, loff_t size,
235 const struct kernfs_ops *ops,
236 void *priv, const void *ns,
237 bool name_is_static,
238 struct lock_class_key *key);
239struct kernfs_node *kernfs_create_link(struct kernfs_node *parent,
240 const char *name,
241 struct kernfs_node *target);
242void kernfs_remove(struct kernfs_node *kn);
243int kernfs_remove_by_name_ns(struct kernfs_node *parent, const char *name,
244 const void *ns);
245int kernfs_rename_ns(struct kernfs_node *kn, struct kernfs_node *new_parent,
246 const char *new_name, const void *new_ns);
247int kernfs_setattr(struct kernfs_node *kn, const struct iattr *iattr);
248void kernfs_notify(struct kernfs_node *kn);
249
250const void *kernfs_super_ns(struct super_block *sb);
251struct dentry *kernfs_mount_ns(struct file_system_type *fs_type, int flags,
252 struct kernfs_root *root, const void *ns);
253void kernfs_kill_sb(struct super_block *sb);
254
255void kernfs_init(void);
256
257#else /* CONFIG_SYSFS */
258
259static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn)
260{ return 0; } /* whatever */
261
262static inline void kernfs_enable_ns(struct kernfs_node *kn) { }
263
264static inline bool kernfs_ns_enabled(struct kernfs_node *kn)
265{ return false; }
266
267static inline struct kernfs_node *
268kernfs_find_and_get_ns(struct kernfs_node *parent, const char *name,
269 const void *ns)
270{ return NULL; }
271
272static inline void kernfs_get(struct kernfs_node *kn) { }
273static inline void kernfs_put(struct kernfs_node *kn) { }
274
275static inline struct kernfs_root *
276kernfs_create_root(struct kernfs_dir_ops *kdops, void *priv)
277{ return ERR_PTR(-ENOSYS); }
278
279static inline void kernfs_destroy_root(struct kernfs_root *root) { }
280
281static inline struct kernfs_node *
282kernfs_create_dir_ns(struct kernfs_node *parent, const char *name,
283 umode_t mode, void *priv, const void *ns)
284{ return ERR_PTR(-ENOSYS); }
285
286static inline struct kernfs_node *
287__kernfs_create_file(struct kernfs_node *parent, const char *name,
288 umode_t mode, loff_t size, const struct kernfs_ops *ops,
289 void *priv, const void *ns, bool name_is_static,
290 struct lock_class_key *key)
291{ return ERR_PTR(-ENOSYS); }
292
293static inline struct kernfs_node *
294kernfs_create_link(struct kernfs_node *parent, const char *name,
295 struct kernfs_node *target)
296{ return ERR_PTR(-ENOSYS); }
297
298static inline void kernfs_remove(struct kernfs_node *kn) { }
299
300static inline int kernfs_remove_by_name_ns(struct kernfs_node *kn,
301 const char *name, const void *ns)
302{ return -ENOSYS; }
303
304static inline int kernfs_rename_ns(struct kernfs_node *kn,
305 struct kernfs_node *new_parent,
306 const char *new_name, const void *new_ns)
307{ return -ENOSYS; }
308
309static inline int kernfs_setattr(struct kernfs_node *kn,
310 const struct iattr *iattr)
311{ return -ENOSYS; }
312
313static inline void kernfs_notify(struct kernfs_node *kn) { }
314
315static inline const void *kernfs_super_ns(struct super_block *sb)
316{ return NULL; }
317
318static inline struct dentry *
319kernfs_mount_ns(struct file_system_type *fs_type, int flags,
320 struct kernfs_root *root, const void *ns)
321{ return ERR_PTR(-ENOSYS); }
322
323static inline void kernfs_kill_sb(struct super_block *sb) { }
324
325static inline void kernfs_init(void) { }
326
327#endif /* CONFIG_SYSFS */
328
329static inline struct kernfs_node *
330kernfs_find_and_get(struct kernfs_node *kn, const char *name)
331{
332 return kernfs_find_and_get_ns(kn, name, NULL);
333}
334
335static inline struct kernfs_node *
336kernfs_create_dir(struct kernfs_node *parent, const char *name, umode_t mode,
337 void *priv)
338{
339 return kernfs_create_dir_ns(parent, name, mode, priv, NULL);
340}
341
342static inline struct kernfs_node *
343kernfs_create_file_ns(struct kernfs_node *parent, const char *name,
344 umode_t mode, loff_t size, const struct kernfs_ops *ops,
345 void *priv, const void *ns)
346{
347 struct lock_class_key *key = NULL;
348
349#ifdef CONFIG_DEBUG_LOCK_ALLOC
350 key = (struct lock_class_key *)&ops->lockdep_key;
351#endif
352 return __kernfs_create_file(parent, name, mode, size, ops, priv, ns,
353 false, key);
354}
355
356static inline struct kernfs_node *
357kernfs_create_file(struct kernfs_node *parent, const char *name, umode_t mode,
358 loff_t size, const struct kernfs_ops *ops, void *priv)
359{
360 return kernfs_create_file_ns(parent, name, mode, size, ops, priv, NULL);
361}
362
363static inline int kernfs_remove_by_name(struct kernfs_node *parent,
364 const char *name)
365{
366 return kernfs_remove_by_name_ns(parent, name, NULL);
367}
368
369static inline struct dentry *
370kernfs_mount(struct file_system_type *fs_type, int flags,
371 struct kernfs_root *root)
372{
373 return kernfs_mount_ns(fs_type, flags, root, NULL);
374}
375
376#endif /* __LINUX_KERNFS_H */
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index 5fd33dc1fe3a..6d4066cdb5b5 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -170,6 +170,7 @@ unsigned long paddr_vmcoreinfo_note(void);
170 170
171extern struct kimage *kexec_image; 171extern struct kimage *kexec_image;
172extern struct kimage *kexec_crash_image; 172extern struct kimage *kexec_crash_image;
173extern int kexec_load_disabled;
173 174
174#ifndef kexec_flush_icache_page 175#ifndef kexec_flush_icache_page
175#define kexec_flush_icache_page(page) 176#define kexec_flush_icache_page(page)
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h
index dfb4f2ffdaa2..6b06d378f3df 100644
--- a/include/linux/kgdb.h
+++ b/include/linux/kgdb.h
@@ -310,7 +310,8 @@ extern int
310kgdb_handle_exception(int ex_vector, int signo, int err_code, 310kgdb_handle_exception(int ex_vector, int signo, int err_code,
311 struct pt_regs *regs); 311 struct pt_regs *regs);
312extern int kgdb_nmicallback(int cpu, void *regs); 312extern int kgdb_nmicallback(int cpu, void *regs);
313extern int kgdb_nmicallin(int cpu, int trapnr, void *regs, atomic_t *snd_rdy); 313extern int kgdb_nmicallin(int cpu, int trapnr, void *regs, int err_code,
314 atomic_t *snd_rdy);
314extern void gdbstub_exit(int status); 315extern void gdbstub_exit(int status);
315 316
316extern int kgdb_single_step; 317extern int kgdb_single_step;
diff --git a/include/linux/kobj_completion.h b/include/linux/kobj_completion.h
deleted file mode 100644
index a428f6436063..000000000000
--- a/include/linux/kobj_completion.h
+++ /dev/null
@@ -1,18 +0,0 @@
1#ifndef _KOBJ_COMPLETION_H_
2#define _KOBJ_COMPLETION_H_
3
4#include <linux/kobject.h>
5#include <linux/completion.h>
6
7struct kobj_completion {
8 struct kobject kc_kobj;
9 struct completion kc_unregister;
10};
11
12#define kobj_to_kobj_completion(kobj) \
13 container_of(kobj, struct kobj_completion, kc_kobj)
14
15void kobj_completion_init(struct kobj_completion *kc, struct kobj_type *ktype);
16void kobj_completion_release(struct kobject *kobj);
17void kobj_completion_del_and_wait(struct kobj_completion *kc);
18#endif /* _KOBJ_COMPLETION_H_ */
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index e7ba650086ce..926afb6f6b5f 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -64,7 +64,7 @@ struct kobject {
64 struct kobject *parent; 64 struct kobject *parent;
65 struct kset *kset; 65 struct kset *kset;
66 struct kobj_type *ktype; 66 struct kobj_type *ktype;
67 struct sysfs_dirent *sd; 67 struct kernfs_node *sd;
68 struct kref kref; 68 struct kref kref;
69#ifdef CONFIG_DEBUG_KOBJECT_RELEASE 69#ifdef CONFIG_DEBUG_KOBJECT_RELEASE
70 struct delayed_work release; 70 struct delayed_work release;
diff --git a/include/linux/ksm.h b/include/linux/ksm.h
index 45c9b6a17bcb..3be6bb18562d 100644
--- a/include/linux/ksm.h
+++ b/include/linux/ksm.h
@@ -73,11 +73,7 @@ static inline void set_page_stable_node(struct page *page,
73struct page *ksm_might_need_to_copy(struct page *page, 73struct page *ksm_might_need_to_copy(struct page *page,
74 struct vm_area_struct *vma, unsigned long address); 74 struct vm_area_struct *vma, unsigned long address);
75 75
76int page_referenced_ksm(struct page *page, 76int rmap_walk_ksm(struct page *page, struct rmap_walk_control *rwc);
77 struct mem_cgroup *memcg, unsigned long *vm_flags);
78int try_to_unmap_ksm(struct page *page, enum ttu_flags flags);
79int rmap_walk_ksm(struct page *page, int (*rmap_one)(struct page *,
80 struct vm_area_struct *, unsigned long, void *), void *arg);
81void ksm_migrate_page(struct page *newpage, struct page *oldpage); 77void ksm_migrate_page(struct page *newpage, struct page *oldpage);
82 78
83#else /* !CONFIG_KSM */ 79#else /* !CONFIG_KSM */
@@ -115,13 +111,8 @@ static inline int page_referenced_ksm(struct page *page,
115 return 0; 111 return 0;
116} 112}
117 113
118static inline int try_to_unmap_ksm(struct page *page, enum ttu_flags flags) 114static inline int rmap_walk_ksm(struct page *page,
119{ 115 struct rmap_walk_control *rwc)
120 return 0;
121}
122
123static inline int rmap_walk_ksm(struct page *page, int (*rmap_one)(struct page*,
124 struct vm_area_struct *, unsigned long, void *), void *arg)
125{ 116{
126 return 0; 117 return 0;
127} 118}
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 9523d2ad7535..b8e9a43e501a 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -172,8 +172,6 @@ int kvm_io_bus_write_cookie(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr,
172 int len, const void *val, long cookie); 172 int len, const void *val, long cookie);
173int kvm_io_bus_read(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, int len, 173int kvm_io_bus_read(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, int len,
174 void *val); 174 void *val);
175int kvm_io_bus_read_cookie(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr,
176 int len, void *val, long cookie);
177int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, 175int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr,
178 int len, struct kvm_io_device *dev); 176 int len, struct kvm_io_device *dev);
179int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, 177int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx,
@@ -463,8 +461,6 @@ void kvm_exit(void);
463 461
464void kvm_get_kvm(struct kvm *kvm); 462void kvm_get_kvm(struct kvm *kvm);
465void kvm_put_kvm(struct kvm *kvm); 463void kvm_put_kvm(struct kvm *kvm);
466void update_memslots(struct kvm_memslots *slots, struct kvm_memory_slot *new,
467 u64 last_generation);
468 464
469static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm) 465static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm)
470{ 466{
@@ -537,7 +533,6 @@ unsigned long gfn_to_hva_prot(struct kvm *kvm, gfn_t gfn, bool *writable);
537unsigned long gfn_to_hva_memslot(struct kvm_memory_slot *slot, gfn_t gfn); 533unsigned long gfn_to_hva_memslot(struct kvm_memory_slot *slot, gfn_t gfn);
538void kvm_release_page_clean(struct page *page); 534void kvm_release_page_clean(struct page *page);
539void kvm_release_page_dirty(struct page *page); 535void kvm_release_page_dirty(struct page *page);
540void kvm_set_page_dirty(struct page *page);
541void kvm_set_page_accessed(struct page *page); 536void kvm_set_page_accessed(struct page *page);
542 537
543pfn_t gfn_to_pfn_atomic(struct kvm *kvm, gfn_t gfn); 538pfn_t gfn_to_pfn_atomic(struct kvm *kvm, gfn_t gfn);
@@ -549,7 +544,6 @@ pfn_t gfn_to_pfn_prot(struct kvm *kvm, gfn_t gfn, bool write_fault,
549pfn_t gfn_to_pfn_memslot(struct kvm_memory_slot *slot, gfn_t gfn); 544pfn_t gfn_to_pfn_memslot(struct kvm_memory_slot *slot, gfn_t gfn);
550pfn_t gfn_to_pfn_memslot_atomic(struct kvm_memory_slot *slot, gfn_t gfn); 545pfn_t gfn_to_pfn_memslot_atomic(struct kvm_memory_slot *slot, gfn_t gfn);
551 546
552void kvm_release_pfn_dirty(pfn_t pfn);
553void kvm_release_pfn_clean(pfn_t pfn); 547void kvm_release_pfn_clean(pfn_t pfn);
554void kvm_set_pfn_dirty(pfn_t pfn); 548void kvm_set_pfn_dirty(pfn_t pfn);
555void kvm_set_pfn_accessed(pfn_t pfn); 549void kvm_set_pfn_accessed(pfn_t pfn);
@@ -576,14 +570,11 @@ struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn);
576int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn); 570int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn);
577unsigned long kvm_host_page_size(struct kvm *kvm, gfn_t gfn); 571unsigned long kvm_host_page_size(struct kvm *kvm, gfn_t gfn);
578void mark_page_dirty(struct kvm *kvm, gfn_t gfn); 572void mark_page_dirty(struct kvm *kvm, gfn_t gfn);
579void mark_page_dirty_in_slot(struct kvm *kvm, struct kvm_memory_slot *memslot,
580 gfn_t gfn);
581 573
582void kvm_vcpu_block(struct kvm_vcpu *vcpu); 574void kvm_vcpu_block(struct kvm_vcpu *vcpu);
583void kvm_vcpu_kick(struct kvm_vcpu *vcpu); 575void kvm_vcpu_kick(struct kvm_vcpu *vcpu);
584bool kvm_vcpu_yield_to(struct kvm_vcpu *target); 576bool kvm_vcpu_yield_to(struct kvm_vcpu *target);
585void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu); 577void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu);
586void kvm_resched(struct kvm_vcpu *vcpu);
587void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); 578void kvm_load_guest_fpu(struct kvm_vcpu *vcpu);
588void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); 579void kvm_put_guest_fpu(struct kvm_vcpu *vcpu);
589 580
@@ -605,8 +596,6 @@ int kvm_get_dirty_log(struct kvm *kvm,
605int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, 596int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm,
606 struct kvm_dirty_log *log); 597 struct kvm_dirty_log *log);
607 598
608int kvm_vm_ioctl_set_memory_region(struct kvm *kvm,
609 struct kvm_userspace_memory_region *mem);
610int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_level, 599int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_level,
611 bool line_status); 600 bool line_status);
612long kvm_arch_vm_ioctl(struct file *filp, 601long kvm_arch_vm_ioctl(struct file *filp,
@@ -654,8 +643,6 @@ void kvm_arch_check_processor_compat(void *rtn);
654int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu); 643int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu);
655int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu); 644int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu);
656 645
657void kvm_free_physmem(struct kvm *kvm);
658
659void *kvm_kvzalloc(unsigned long size); 646void *kvm_kvzalloc(unsigned long size);
660void kvm_kvfree(const void *addr); 647void kvm_kvfree(const void *addr);
661 648
@@ -1076,6 +1063,7 @@ struct kvm_device *kvm_device_from_filp(struct file *filp);
1076extern struct kvm_device_ops kvm_mpic_ops; 1063extern struct kvm_device_ops kvm_mpic_ops;
1077extern struct kvm_device_ops kvm_xics_ops; 1064extern struct kvm_device_ops kvm_xics_ops;
1078extern struct kvm_device_ops kvm_vfio_ops; 1065extern struct kvm_device_ops kvm_vfio_ops;
1066extern struct kvm_device_ops kvm_arm_vgic_v2_ops;
1079 1067
1080#ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT 1068#ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT
1081 1069
@@ -1097,12 +1085,6 @@ static inline void kvm_vcpu_set_in_spin_loop(struct kvm_vcpu *vcpu, bool val)
1097static inline void kvm_vcpu_set_dy_eligible(struct kvm_vcpu *vcpu, bool val) 1085static inline void kvm_vcpu_set_dy_eligible(struct kvm_vcpu *vcpu, bool val)
1098{ 1086{
1099} 1087}
1100
1101static inline bool kvm_vcpu_eligible_for_directed_yield(struct kvm_vcpu *vcpu)
1102{
1103 return true;
1104}
1105
1106#endif /* CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT */ 1088#endif /* CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT */
1107#endif 1089#endif
1108 1090
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 0e23c26485f4..bec6dbe939a0 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -418,6 +418,9 @@ enum {
418 ATA_HORKAGE_DUMP_ID = (1 << 16), /* dump IDENTIFY data */ 418 ATA_HORKAGE_DUMP_ID = (1 << 16), /* dump IDENTIFY data */
419 ATA_HORKAGE_MAX_SEC_LBA48 = (1 << 17), /* Set max sects to 65535 */ 419 ATA_HORKAGE_MAX_SEC_LBA48 = (1 << 17), /* Set max sects to 65535 */
420 ATA_HORKAGE_ATAPI_DMADIR = (1 << 18), /* device requires dmadir */ 420 ATA_HORKAGE_ATAPI_DMADIR = (1 << 18), /* device requires dmadir */
421 ATA_HORKAGE_NO_NCQ_TRIM = (1 << 19), /* don't use queued TRIM */
422 ATA_HORKAGE_NOLPM = (1 << 20), /* don't use LPM */
423 ATA_HORKAGE_WD_BROKEN_LPM = (1 << 21), /* some WDs have broken LPM */
421 424
422 /* DMA mask for user DMA control: User visible values; DO NOT 425 /* DMA mask for user DMA control: User visible values; DO NOT
423 renumber */ 426 renumber */
diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index d3e8ad23a8e0..a6a42dd02466 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -6,6 +6,11 @@
6#include <linux/export.h> 6#include <linux/export.h>
7#include <asm/linkage.h> 7#include <asm/linkage.h>
8 8
9/* Some toolchains use other characters (e.g. '`') to mark new line in macro */
10#ifndef ASM_NL
11#define ASM_NL ;
12#endif
13
9#ifdef __cplusplus 14#ifdef __cplusplus
10#define CPP_ASMLINKAGE extern "C" 15#define CPP_ASMLINKAGE extern "C"
11#else 16#else
@@ -75,21 +80,21 @@
75 80
76#ifndef ENTRY 81#ifndef ENTRY
77#define ENTRY(name) \ 82#define ENTRY(name) \
78 .globl name; \ 83 .globl name ASM_NL \
79 ALIGN; \ 84 ALIGN ASM_NL \
80 name: 85 name:
81#endif 86#endif
82#endif /* LINKER_SCRIPT */ 87#endif /* LINKER_SCRIPT */
83 88
84#ifndef WEAK 89#ifndef WEAK
85#define WEAK(name) \ 90#define WEAK(name) \
86 .weak name; \ 91 .weak name ASM_NL \
87 name: 92 name:
88#endif 93#endif
89 94
90#ifndef END 95#ifndef END
91#define END(name) \ 96#define END(name) \
92 .size name, .-name 97 .size name, .-name
93#endif 98#endif
94 99
95/* If symbol 'name' is treated as a subroutine (gets called, and returns) 100/* If symbol 'name' is treated as a subroutine (gets called, and returns)
@@ -98,8 +103,8 @@
98 */ 103 */
99#ifndef ENDPROC 104#ifndef ENDPROC
100#define ENDPROC(name) \ 105#define ENDPROC(name) \
101 .type name, @function; \ 106 .type name, @function ASM_NL \
102 END(name) 107 END(name)
103#endif 108#endif
104 109
105#endif 110#endif
diff --git a/include/linux/lockref.h b/include/linux/lockref.h
index c8929c3832db..4bfde0e99ed5 100644
--- a/include/linux/lockref.h
+++ b/include/linux/lockref.h
@@ -19,7 +19,7 @@
19 19
20#define USE_CMPXCHG_LOCKREF \ 20#define USE_CMPXCHG_LOCKREF \
21 (IS_ENABLED(CONFIG_ARCH_USE_CMPXCHG_LOCKREF) && \ 21 (IS_ENABLED(CONFIG_ARCH_USE_CMPXCHG_LOCKREF) && \
22 IS_ENABLED(CONFIG_SMP) && !BLOATED_SPINLOCKS) 22 IS_ENABLED(CONFIG_SMP) && SPINLOCK_SIZE <= 4)
23 23
24struct lockref { 24struct lockref {
25 union { 25 union {
diff --git a/include/linux/math64.h b/include/linux/math64.h
index 69ed5f5e9f6e..c45c089bfdac 100644
--- a/include/linux/math64.h
+++ b/include/linux/math64.h
@@ -133,4 +133,34 @@ __iter_div_u64_rem(u64 dividend, u32 divisor, u64 *remainder)
133 return ret; 133 return ret;
134} 134}
135 135
136#if defined(CONFIG_ARCH_SUPPORTS_INT128) && defined(__SIZEOF_INT128__)
137
138#ifndef mul_u64_u32_shr
139static inline u64 mul_u64_u32_shr(u64 a, u32 mul, unsigned int shift)
140{
141 return (u64)(((unsigned __int128)a * mul) >> shift);
142}
143#endif /* mul_u64_u32_shr */
144
145#else
146
147#ifndef mul_u64_u32_shr
148static inline u64 mul_u64_u32_shr(u64 a, u32 mul, unsigned int shift)
149{
150 u32 ah, al;
151 u64 ret;
152
153 al = a;
154 ah = a >> 32;
155
156 ret = ((u64)al * mul) >> shift;
157 if (ah)
158 ret += ((u64)ah * mul) << (32 - shift);
159
160 return ret;
161}
162#endif /* mul_u64_u32_shr */
163
164#endif
165
136#endif /* _LINUX_MATH64_H */ 166#endif /* _LINUX_MATH64_H */
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index 3d15c838116c..b42963bc81dd 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -70,9 +70,6 @@ extern int mdio45_nway_restart(const struct mdio_if_info *mdio);
70extern void mdio45_ethtool_gset_npage(const struct mdio_if_info *mdio, 70extern void mdio45_ethtool_gset_npage(const struct mdio_if_info *mdio,
71 struct ethtool_cmd *ecmd, 71 struct ethtool_cmd *ecmd,
72 u32 npage_adv, u32 npage_lpa); 72 u32 npage_adv, u32 npage_lpa);
73extern void
74mdio45_ethtool_spauseparam_an(const struct mdio_if_info *mdio,
75 const struct ethtool_pauseparam *ecmd);
76 73
77/** 74/**
78 * mdio45_ethtool_gset - get settings for ETHTOOL_GSET 75 * mdio45_ethtool_gset - get settings for ETHTOOL_GSET
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index 77c60e52939d..1ef66360f0b0 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -19,9 +19,13 @@
19 19
20#define INIT_MEMBLOCK_REGIONS 128 20#define INIT_MEMBLOCK_REGIONS 128
21 21
22/* Definition of memblock flags. */
23#define MEMBLOCK_HOTPLUG 0x1 /* hotpluggable region */
24
22struct memblock_region { 25struct memblock_region {
23 phys_addr_t base; 26 phys_addr_t base;
24 phys_addr_t size; 27 phys_addr_t size;
28 unsigned long flags;
25#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP 29#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
26 int nid; 30 int nid;
27#endif 31#endif
@@ -43,15 +47,21 @@ struct memblock {
43 47
44extern struct memblock memblock; 48extern struct memblock memblock;
45extern int memblock_debug; 49extern int memblock_debug;
50#ifdef CONFIG_MOVABLE_NODE
51/* If movable_node boot option specified */
52extern bool movable_node_enabled;
53#endif /* CONFIG_MOVABLE_NODE */
46 54
47#define memblock_dbg(fmt, ...) \ 55#define memblock_dbg(fmt, ...) \
48 if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) 56 if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
49 57
50phys_addr_t memblock_find_in_range_node(phys_addr_t start, phys_addr_t end, 58phys_addr_t memblock_find_in_range_node(phys_addr_t size, phys_addr_t align,
51 phys_addr_t size, phys_addr_t align, int nid); 59 phys_addr_t start, phys_addr_t end,
60 int nid);
52phys_addr_t memblock_find_in_range(phys_addr_t start, phys_addr_t end, 61phys_addr_t memblock_find_in_range(phys_addr_t start, phys_addr_t end,
53 phys_addr_t size, phys_addr_t align); 62 phys_addr_t size, phys_addr_t align);
54phys_addr_t get_allocated_memblock_reserved_regions_info(phys_addr_t *addr); 63phys_addr_t get_allocated_memblock_reserved_regions_info(phys_addr_t *addr);
64phys_addr_t get_allocated_memblock_memory_regions_info(phys_addr_t *addr);
55void memblock_allow_resize(void); 65void memblock_allow_resize(void);
56int memblock_add_node(phys_addr_t base, phys_addr_t size, int nid); 66int memblock_add_node(phys_addr_t base, phys_addr_t size, int nid);
57int memblock_add(phys_addr_t base, phys_addr_t size); 67int memblock_add(phys_addr_t base, phys_addr_t size);
@@ -59,6 +69,28 @@ int memblock_remove(phys_addr_t base, phys_addr_t size);
59int memblock_free(phys_addr_t base, phys_addr_t size); 69int memblock_free(phys_addr_t base, phys_addr_t size);
60int memblock_reserve(phys_addr_t base, phys_addr_t size); 70int memblock_reserve(phys_addr_t base, phys_addr_t size);
61void memblock_trim_memory(phys_addr_t align); 71void memblock_trim_memory(phys_addr_t align);
72int memblock_mark_hotplug(phys_addr_t base, phys_addr_t size);
73int memblock_clear_hotplug(phys_addr_t base, phys_addr_t size);
74#ifdef CONFIG_MOVABLE_NODE
75static inline bool memblock_is_hotpluggable(struct memblock_region *m)
76{
77 return m->flags & MEMBLOCK_HOTPLUG;
78}
79
80static inline bool movable_node_is_enabled(void)
81{
82 return movable_node_enabled;
83}
84#else
85static inline bool memblock_is_hotpluggable(struct memblock_region *m)
86{
87 return false;
88}
89static inline bool movable_node_is_enabled(void)
90{
91 return false;
92}
93#endif
62 94
63#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP 95#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
64int memblock_search_pfn_nid(unsigned long pfn, unsigned long *start_pfn, 96int memblock_search_pfn_nid(unsigned long pfn, unsigned long *start_pfn,
@@ -87,7 +119,7 @@ void __next_free_mem_range(u64 *idx, int nid, phys_addr_t *out_start,
87/** 119/**
88 * for_each_free_mem_range - iterate through free memblock areas 120 * for_each_free_mem_range - iterate through free memblock areas
89 * @i: u64 used as loop variable 121 * @i: u64 used as loop variable
90 * @nid: node selector, %MAX_NUMNODES for all nodes 122 * @nid: node selector, %NUMA_NO_NODE for all nodes
91 * @p_start: ptr to phys_addr_t for start address of the range, can be %NULL 123 * @p_start: ptr to phys_addr_t for start address of the range, can be %NULL
92 * @p_end: ptr to phys_addr_t for end address of the range, can be %NULL 124 * @p_end: ptr to phys_addr_t for end address of the range, can be %NULL
93 * @p_nid: ptr to int for nid of the range, can be %NULL 125 * @p_nid: ptr to int for nid of the range, can be %NULL
@@ -107,7 +139,7 @@ void __next_free_mem_range_rev(u64 *idx, int nid, phys_addr_t *out_start,
107/** 139/**
108 * for_each_free_mem_range_reverse - rev-iterate through free memblock areas 140 * for_each_free_mem_range_reverse - rev-iterate through free memblock areas
109 * @i: u64 used as loop variable 141 * @i: u64 used as loop variable
110 * @nid: node selector, %MAX_NUMNODES for all nodes 142 * @nid: node selector, %NUMA_NO_NODE for all nodes
111 * @p_start: ptr to phys_addr_t for start address of the range, can be %NULL 143 * @p_start: ptr to phys_addr_t for start address of the range, can be %NULL
112 * @p_end: ptr to phys_addr_t for end address of the range, can be %NULL 144 * @p_end: ptr to phys_addr_t for end address of the range, can be %NULL
113 * @p_nid: ptr to int for nid of the range, can be %NULL 145 * @p_nid: ptr to int for nid of the range, can be %NULL
@@ -121,8 +153,21 @@ void __next_free_mem_range_rev(u64 *idx, int nid, phys_addr_t *out_start,
121 i != (u64)ULLONG_MAX; \ 153 i != (u64)ULLONG_MAX; \
122 __next_free_mem_range_rev(&i, nid, p_start, p_end, p_nid)) 154 __next_free_mem_range_rev(&i, nid, p_start, p_end, p_nid))
123 155
156static inline void memblock_set_region_flags(struct memblock_region *r,
157 unsigned long flags)
158{
159 r->flags |= flags;
160}
161
162static inline void memblock_clear_region_flags(struct memblock_region *r,
163 unsigned long flags)
164{
165 r->flags &= ~flags;
166}
167
124#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP 168#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
125int memblock_set_node(phys_addr_t base, phys_addr_t size, int nid); 169int memblock_set_node(phys_addr_t base, phys_addr_t size,
170 struct memblock_type *type, int nid);
126 171
127static inline void memblock_set_region_node(struct memblock_region *r, int nid) 172static inline void memblock_set_region_node(struct memblock_region *r, int nid)
128{ 173{
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index b3e7a667e03c..abd0113b6620 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -497,10 +497,11 @@ void __memcg_kmem_commit_charge(struct page *page,
497void __memcg_kmem_uncharge_pages(struct page *page, int order); 497void __memcg_kmem_uncharge_pages(struct page *page, int order);
498 498
499int memcg_cache_id(struct mem_cgroup *memcg); 499int memcg_cache_id(struct mem_cgroup *memcg);
500int memcg_register_cache(struct mem_cgroup *memcg, struct kmem_cache *s, 500int memcg_alloc_cache_params(struct mem_cgroup *memcg, struct kmem_cache *s,
501 struct kmem_cache *root_cache); 501 struct kmem_cache *root_cache);
502void memcg_release_cache(struct kmem_cache *cachep); 502void memcg_free_cache_params(struct kmem_cache *s);
503void memcg_cache_list_add(struct mem_cgroup *memcg, struct kmem_cache *cachep); 503void memcg_register_cache(struct kmem_cache *s);
504void memcg_unregister_cache(struct kmem_cache *s);
504 505
505int memcg_update_cache_size(struct kmem_cache *s, int num_groups); 506int memcg_update_cache_size(struct kmem_cache *s, int num_groups);
506void memcg_update_array_size(int num_groups); 507void memcg_update_array_size(int num_groups);
@@ -640,19 +641,21 @@ static inline int memcg_cache_id(struct mem_cgroup *memcg)
640 return -1; 641 return -1;
641} 642}
642 643
643static inline int 644static inline int memcg_alloc_cache_params(struct mem_cgroup *memcg,
644memcg_register_cache(struct mem_cgroup *memcg, struct kmem_cache *s, 645 struct kmem_cache *s, struct kmem_cache *root_cache)
645 struct kmem_cache *root_cache)
646{ 646{
647 return 0; 647 return 0;
648} 648}
649 649
650static inline void memcg_release_cache(struct kmem_cache *cachep) 650static inline void memcg_free_cache_params(struct kmem_cache *s)
651{
652}
653
654static inline void memcg_register_cache(struct kmem_cache *s)
651{ 655{
652} 656}
653 657
654static inline void memcg_cache_list_add(struct mem_cgroup *memcg, 658static inline void memcg_unregister_cache(struct kmem_cache *s)
655 struct kmem_cache *s)
656{ 659{
657} 660}
658 661
diff --git a/include/linux/memory.h b/include/linux/memory.h
index 9a6bbf76452d..bb7384e3c3d8 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -35,6 +35,7 @@ struct memory_block {
35}; 35};
36 36
37int arch_get_memory_phys_device(unsigned long start_pfn); 37int arch_get_memory_phys_device(unsigned long start_pfn);
38unsigned long __weak memory_block_size_bytes(void);
38 39
39/* These states are exposed to userspace as text strings in sysfs */ 40/* These states are exposed to userspace as text strings in sysfs */
40#define MEM_ONLINE (1<<0) /* exposed to userspace */ 41#define MEM_ONLINE (1<<0) /* exposed to userspace */
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index 9fe426b30a41..5f1ea756aace 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -211,20 +211,8 @@ static inline void mpol_get(struct mempolicy *pol)
211{ 211{
212} 212}
213 213
214static inline struct mempolicy *mpol_dup(struct mempolicy *old)
215{
216 return NULL;
217}
218
219struct shared_policy {}; 214struct shared_policy {};
220 215
221static inline int mpol_set_shared_policy(struct shared_policy *info,
222 struct vm_area_struct *vma,
223 struct mempolicy *new)
224{
225 return -EINVAL;
226}
227
228static inline void mpol_shared_policy_init(struct shared_policy *sp, 216static inline void mpol_shared_policy_init(struct shared_policy *sp,
229 struct mempolicy *mpol) 217 struct mempolicy *mpol)
230{ 218{
@@ -234,12 +222,6 @@ static inline void mpol_free_shared_policy(struct shared_policy *p)
234{ 222{
235} 223}
236 224
237static inline struct mempolicy *
238mpol_shared_policy_lookup(struct shared_policy *sp, unsigned long idx)
239{
240 return NULL;
241}
242
243#define vma_policy(vma) NULL 225#define vma_policy(vma) NULL
244 226
245static inline int 227static inline int
@@ -266,10 +248,6 @@ static inline void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new)
266{ 248{
267} 249}
268 250
269static inline void mpol_fix_fork_child_flag(struct task_struct *p)
270{
271}
272
273static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma, 251static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma,
274 unsigned long addr, gfp_t gfp_flags, 252 unsigned long addr, gfp_t gfp_flags,
275 struct mempolicy **mpol, nodemask_t **nodemask) 253 struct mempolicy **mpol, nodemask_t **nodemask)
@@ -284,12 +262,6 @@ static inline bool init_nodemask_of_mempolicy(nodemask_t *m)
284 return false; 262 return false;
285} 263}
286 264
287static inline bool mempolicy_nodemask_intersects(struct task_struct *tsk,
288 const nodemask_t *mask)
289{
290 return false;
291}
292
293static inline int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from, 265static inline int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from,
294 const nodemask_t *to, int flags) 266 const nodemask_t *to, int flags)
295{ 267{
@@ -307,10 +279,6 @@ static inline int mpol_parse_str(char *str, struct mempolicy **mpol)
307} 279}
308#endif 280#endif
309 281
310static inline void mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol)
311{
312}
313
314static inline int mpol_misplaced(struct page *page, struct vm_area_struct *vma, 282static inline int mpol_misplaced(struct page *page, struct vm_area_struct *vma,
315 unsigned long address) 283 unsigned long address)
316{ 284{
diff --git a/include/linux/mfd/abx500/ab8500-gpio.h b/include/linux/mfd/abx500/ab8500-gpio.h
deleted file mode 100644
index 172b2f201ae0..000000000000
--- a/include/linux/mfd/abx500/ab8500-gpio.h
+++ /dev/null
@@ -1,33 +0,0 @@
1/*
2 * Copyright ST-Ericsson 2010.
3 *
4 * Author: Bibek Basu <bibek.basu@stericsson.com>
5 * Licensed under GPLv2.
6 */
7
8#ifndef _AB8500_GPIO_H
9#define _AB8500_GPIO_H
10
11/*
12 * Platform data to register a block: only the initial gpio/irq number.
13 * Array sizes are large enough to contain all AB8500 and AB9540 GPIO
14 * registers.
15 */
16
17struct abx500_gpio_platform_data {
18 int gpio_base;
19};
20
21enum abx500_gpio_pull_updown {
22 ABX500_GPIO_PULL_DOWN = 0x0,
23 ABX500_GPIO_PULL_NONE = 0x1,
24 ABX500_GPIO_PULL_UP = 0x3,
25};
26
27enum abx500_gpio_vinsel {
28 ABX500_GPIO_VINSEL_VBAT = 0x0,
29 ABX500_GPIO_VINSEL_VIN_1V8 = 0x1,
30 ABX500_GPIO_VINSEL_VDD_BIF = 0x2,
31};
32
33#endif /* _AB8500_GPIO_H */
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h
index f4acd898dac9..a86ca1406fb8 100644
--- a/include/linux/mfd/abx500/ab8500.h
+++ b/include/linux/mfd/abx500/ab8500.h
@@ -368,7 +368,6 @@ struct ab8500 {
368}; 368};
369 369
370struct ab8500_regulator_platform_data; 370struct ab8500_regulator_platform_data;
371struct ab8500_gpio_platform_data;
372struct ab8500_codec_platform_data; 371struct ab8500_codec_platform_data;
373struct ab8500_sysctrl_platform_data; 372struct ab8500_sysctrl_platform_data;
374 373
@@ -382,7 +381,6 @@ struct ab8500_platform_data {
382 int irq_base; 381 int irq_base;
383 void (*init) (struct ab8500 *); 382 void (*init) (struct ab8500 *);
384 struct ab8500_regulator_platform_data *regulator; 383 struct ab8500_regulator_platform_data *regulator;
385 struct abx500_gpio_platform_data *gpio;
386 struct ab8500_codec_platform_data *codec; 384 struct ab8500_codec_platform_data *codec;
387 struct ab8500_sysctrl_platform_data *sysctrl; 385 struct ab8500_sysctrl_platform_data *sysctrl;
388}; 386};
diff --git a/include/linux/mfd/arizona/registers.h b/include/linux/mfd/arizona/registers.h
index cb49417f8ba9..fdf3aa376eb2 100644
--- a/include/linux/mfd/arizona/registers.h
+++ b/include/linux/mfd/arizona/registers.h
@@ -139,6 +139,7 @@
139#define ARIZONA_INPUT_ENABLES_STATUS 0x301 139#define ARIZONA_INPUT_ENABLES_STATUS 0x301
140#define ARIZONA_INPUT_RATE 0x308 140#define ARIZONA_INPUT_RATE 0x308
141#define ARIZONA_INPUT_VOLUME_RAMP 0x309 141#define ARIZONA_INPUT_VOLUME_RAMP 0x309
142#define ARIZONA_HPF_CONTROL 0x30C
142#define ARIZONA_IN1L_CONTROL 0x310 143#define ARIZONA_IN1L_CONTROL 0x310
143#define ARIZONA_ADC_DIGITAL_VOLUME_1L 0x311 144#define ARIZONA_ADC_DIGITAL_VOLUME_1L 0x311
144#define ARIZONA_DMIC1L_CONTROL 0x312 145#define ARIZONA_DMIC1L_CONTROL 0x312
@@ -160,6 +161,7 @@
160#define ARIZONA_IN4L_CONTROL 0x328 161#define ARIZONA_IN4L_CONTROL 0x328
161#define ARIZONA_ADC_DIGITAL_VOLUME_4L 0x329 162#define ARIZONA_ADC_DIGITAL_VOLUME_4L 0x329
162#define ARIZONA_DMIC4L_CONTROL 0x32A 163#define ARIZONA_DMIC4L_CONTROL 0x32A
164#define ARIZONA_IN4R_CONTROL 0x32C
163#define ARIZONA_ADC_DIGITAL_VOLUME_4R 0x32D 165#define ARIZONA_ADC_DIGITAL_VOLUME_4R 0x32D
164#define ARIZONA_DMIC4R_CONTROL 0x32E 166#define ARIZONA_DMIC4R_CONTROL 0x32E
165#define ARIZONA_OUTPUT_ENABLES_1 0x400 167#define ARIZONA_OUTPUT_ENABLES_1 0x400
@@ -224,6 +226,9 @@
224#define ARIZONA_PDM_SPK1_CTRL_2 0x491 226#define ARIZONA_PDM_SPK1_CTRL_2 0x491
225#define ARIZONA_PDM_SPK2_CTRL_1 0x492 227#define ARIZONA_PDM_SPK2_CTRL_1 0x492
226#define ARIZONA_PDM_SPK2_CTRL_2 0x493 228#define ARIZONA_PDM_SPK2_CTRL_2 0x493
229#define ARIZONA_HP1_SHORT_CIRCUIT_CTRL 0x4A0
230#define ARIZONA_HP2_SHORT_CIRCUIT_CTRL 0x4A1
231#define ARIZONA_HP3_SHORT_CIRCUIT_CTRL 0x4A2
227#define ARIZONA_SPK_CTRL_2 0x4B5 232#define ARIZONA_SPK_CTRL_2 0x4B5
228#define ARIZONA_SPK_CTRL_3 0x4B6 233#define ARIZONA_SPK_CTRL_3 0x4B6
229#define ARIZONA_DAC_COMP_1 0x4DC 234#define ARIZONA_DAC_COMP_1 0x4DC
@@ -511,6 +516,38 @@
511#define ARIZONA_AIF2TX2MIX_INPUT_3_VOLUME 0x74D 516#define ARIZONA_AIF2TX2MIX_INPUT_3_VOLUME 0x74D
512#define ARIZONA_AIF2TX2MIX_INPUT_4_SOURCE 0x74E 517#define ARIZONA_AIF2TX2MIX_INPUT_4_SOURCE 0x74E
513#define ARIZONA_AIF2TX2MIX_INPUT_4_VOLUME 0x74F 518#define ARIZONA_AIF2TX2MIX_INPUT_4_VOLUME 0x74F
519#define ARIZONA_AIF2TX3MIX_INPUT_1_SOURCE 0x750
520#define ARIZONA_AIF2TX3MIX_INPUT_1_VOLUME 0x751
521#define ARIZONA_AIF2TX3MIX_INPUT_2_SOURCE 0x752
522#define ARIZONA_AIF2TX3MIX_INPUT_2_VOLUME 0x753
523#define ARIZONA_AIF2TX3MIX_INPUT_3_SOURCE 0x754
524#define ARIZONA_AIF2TX3MIX_INPUT_3_VOLUME 0x755
525#define ARIZONA_AIF2TX3MIX_INPUT_4_SOURCE 0x756
526#define ARIZONA_AIF2TX3MIX_INPUT_4_VOLUME 0x757
527#define ARIZONA_AIF2TX4MIX_INPUT_1_SOURCE 0x758
528#define ARIZONA_AIF2TX4MIX_INPUT_1_VOLUME 0x759
529#define ARIZONA_AIF2TX4MIX_INPUT_2_SOURCE 0x75A
530#define ARIZONA_AIF2TX4MIX_INPUT_2_VOLUME 0x75B
531#define ARIZONA_AIF2TX4MIX_INPUT_3_SOURCE 0x75C
532#define ARIZONA_AIF2TX4MIX_INPUT_3_VOLUME 0x75D
533#define ARIZONA_AIF2TX4MIX_INPUT_4_SOURCE 0x75E
534#define ARIZONA_AIF2TX4MIX_INPUT_4_VOLUME 0x75F
535#define ARIZONA_AIF2TX5MIX_INPUT_1_SOURCE 0x760
536#define ARIZONA_AIF2TX5MIX_INPUT_1_VOLUME 0x761
537#define ARIZONA_AIF2TX5MIX_INPUT_2_SOURCE 0x762
538#define ARIZONA_AIF2TX5MIX_INPUT_2_VOLUME 0x763
539#define ARIZONA_AIF2TX5MIX_INPUT_3_SOURCE 0x764
540#define ARIZONA_AIF2TX5MIX_INPUT_3_VOLUME 0x765
541#define ARIZONA_AIF2TX5MIX_INPUT_4_SOURCE 0x766
542#define ARIZONA_AIF2TX5MIX_INPUT_4_VOLUME 0x767
543#define ARIZONA_AIF2TX6MIX_INPUT_1_SOURCE 0x768
544#define ARIZONA_AIF2TX6MIX_INPUT_1_VOLUME 0x769
545#define ARIZONA_AIF2TX6MIX_INPUT_2_SOURCE 0x76A
546#define ARIZONA_AIF2TX6MIX_INPUT_2_VOLUME 0x76B
547#define ARIZONA_AIF2TX6MIX_INPUT_3_SOURCE 0x76C
548#define ARIZONA_AIF2TX6MIX_INPUT_3_VOLUME 0x76D
549#define ARIZONA_AIF2TX6MIX_INPUT_4_SOURCE 0x76E
550#define ARIZONA_AIF2TX6MIX_INPUT_4_VOLUME 0x76F
514#define ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE 0x780 551#define ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE 0x780
515#define ARIZONA_AIF3TX1MIX_INPUT_1_VOLUME 0x781 552#define ARIZONA_AIF3TX1MIX_INPUT_1_VOLUME 0x781
516#define ARIZONA_AIF3TX1MIX_INPUT_2_SOURCE 0x782 553#define ARIZONA_AIF3TX1MIX_INPUT_2_SOURCE 0x782
@@ -2196,6 +2233,15 @@
2196/* 2233/*
2197 * R677 (0x2A5) - Mic Detect 3 2234 * R677 (0x2A5) - Mic Detect 3
2198 */ 2235 */
2236#define ARIZONA_MICD_LVL_0 0x0004 /* MICD_LVL - [2] */
2237#define ARIZONA_MICD_LVL_1 0x0008 /* MICD_LVL - [3] */
2238#define ARIZONA_MICD_LVL_2 0x0010 /* MICD_LVL - [4] */
2239#define ARIZONA_MICD_LVL_3 0x0020 /* MICD_LVL - [5] */
2240#define ARIZONA_MICD_LVL_4 0x0040 /* MICD_LVL - [6] */
2241#define ARIZONA_MICD_LVL_5 0x0080 /* MICD_LVL - [7] */
2242#define ARIZONA_MICD_LVL_6 0x0100 /* MICD_LVL - [8] */
2243#define ARIZONA_MICD_LVL_7 0x0200 /* MICD_LVL - [9] */
2244#define ARIZONA_MICD_LVL_8 0x0400 /* MICD_LVL - [10] */
2199#define ARIZONA_MICD_LVL_MASK 0x07FC /* MICD_LVL - [10:2] */ 2245#define ARIZONA_MICD_LVL_MASK 0x07FC /* MICD_LVL - [10:2] */
2200#define ARIZONA_MICD_LVL_SHIFT 2 /* MICD_LVL - [10:2] */ 2246#define ARIZONA_MICD_LVL_SHIFT 2 /* MICD_LVL - [10:2] */
2201#define ARIZONA_MICD_LVL_WIDTH 9 /* MICD_LVL - [10:2] */ 2247#define ARIZONA_MICD_LVL_WIDTH 9 /* MICD_LVL - [10:2] */
@@ -2293,8 +2339,18 @@
2293#define ARIZONA_IN_VI_RAMP_WIDTH 3 /* IN_VI_RAMP - [2:0] */ 2339#define ARIZONA_IN_VI_RAMP_WIDTH 3 /* IN_VI_RAMP - [2:0] */
2294 2340
2295/* 2341/*
2342 * R780 (0x30C) - HPF Control
2343 */
2344#define ARIZONA_IN_HPF_CUT_MASK 0x0007 /* IN_HPF_CUT [2:0] */
2345#define ARIZONA_IN_HPF_CUT_SHIFT 0 /* IN_HPF_CUT [2:0] */
2346#define ARIZONA_IN_HPF_CUT_WIDTH 3 /* IN_HPF_CUT [2:0] */
2347
2348/*
2296 * R784 (0x310) - IN1L Control 2349 * R784 (0x310) - IN1L Control
2297 */ 2350 */
2351#define ARIZONA_IN1L_HPF_MASK 0x8000 /* IN1L_HPF - [15] */
2352#define ARIZONA_IN1L_HPF_SHIFT 15 /* IN1L_HPF - [15] */
2353#define ARIZONA_IN1L_HPF_WIDTH 1 /* IN1L_HPF - [15] */
2298#define ARIZONA_IN1_OSR_MASK 0x6000 /* IN1_OSR - [14:13] */ 2354#define ARIZONA_IN1_OSR_MASK 0x6000 /* IN1_OSR - [14:13] */
2299#define ARIZONA_IN1_OSR_SHIFT 13 /* IN1_OSR - [14:13] */ 2355#define ARIZONA_IN1_OSR_SHIFT 13 /* IN1_OSR - [14:13] */
2300#define ARIZONA_IN1_OSR_WIDTH 2 /* IN1_OSR - [14:13] */ 2356#define ARIZONA_IN1_OSR_WIDTH 2 /* IN1_OSR - [14:13] */
@@ -2333,6 +2389,9 @@
2333/* 2389/*
2334 * R788 (0x314) - IN1R Control 2390 * R788 (0x314) - IN1R Control
2335 */ 2391 */
2392#define ARIZONA_IN1R_HPF_MASK 0x8000 /* IN1R_HPF - [15] */
2393#define ARIZONA_IN1R_HPF_SHIFT 15 /* IN1R_HPF - [15] */
2394#define ARIZONA_IN1R_HPF_WIDTH 1 /* IN1R_HPF - [15] */
2336#define ARIZONA_IN1R_PGA_VOL_MASK 0x00FE /* IN1R_PGA_VOL - [7:1] */ 2395#define ARIZONA_IN1R_PGA_VOL_MASK 0x00FE /* IN1R_PGA_VOL - [7:1] */
2337#define ARIZONA_IN1R_PGA_VOL_SHIFT 1 /* IN1R_PGA_VOL - [7:1] */ 2396#define ARIZONA_IN1R_PGA_VOL_SHIFT 1 /* IN1R_PGA_VOL - [7:1] */
2338#define ARIZONA_IN1R_PGA_VOL_WIDTH 7 /* IN1R_PGA_VOL - [7:1] */ 2397#define ARIZONA_IN1R_PGA_VOL_WIDTH 7 /* IN1R_PGA_VOL - [7:1] */
@@ -2362,6 +2421,9 @@
2362/* 2421/*
2363 * R792 (0x318) - IN2L Control 2422 * R792 (0x318) - IN2L Control
2364 */ 2423 */
2424#define ARIZONA_IN2L_HPF_MASK 0x8000 /* IN2L_HPF - [15] */
2425#define ARIZONA_IN2L_HPF_SHIFT 15 /* IN2L_HPF - [15] */
2426#define ARIZONA_IN2L_HPF_WIDTH 1 /* IN2L_HPF - [15] */
2365#define ARIZONA_IN2_OSR_MASK 0x6000 /* IN2_OSR - [14:13] */ 2427#define ARIZONA_IN2_OSR_MASK 0x6000 /* IN2_OSR - [14:13] */
2366#define ARIZONA_IN2_OSR_SHIFT 13 /* IN2_OSR - [14:13] */ 2428#define ARIZONA_IN2_OSR_SHIFT 13 /* IN2_OSR - [14:13] */
2367#define ARIZONA_IN2_OSR_WIDTH 2 /* IN2_OSR - [14:13] */ 2429#define ARIZONA_IN2_OSR_WIDTH 2 /* IN2_OSR - [14:13] */
@@ -2400,6 +2462,9 @@
2400/* 2462/*
2401 * R796 (0x31C) - IN2R Control 2463 * R796 (0x31C) - IN2R Control
2402 */ 2464 */
2465#define ARIZONA_IN2R_HPF_MASK 0x8000 /* IN2R_HPF - [15] */
2466#define ARIZONA_IN2R_HPF_SHIFT 15 /* IN2R_HPF - [15] */
2467#define ARIZONA_IN2R_HPF_WIDTH 1 /* IN2R_HPF - [15] */
2403#define ARIZONA_IN2R_PGA_VOL_MASK 0x00FE /* IN2R_PGA_VOL - [7:1] */ 2468#define ARIZONA_IN2R_PGA_VOL_MASK 0x00FE /* IN2R_PGA_VOL - [7:1] */
2404#define ARIZONA_IN2R_PGA_VOL_SHIFT 1 /* IN2R_PGA_VOL - [7:1] */ 2469#define ARIZONA_IN2R_PGA_VOL_SHIFT 1 /* IN2R_PGA_VOL - [7:1] */
2405#define ARIZONA_IN2R_PGA_VOL_WIDTH 7 /* IN2R_PGA_VOL - [7:1] */ 2470#define ARIZONA_IN2R_PGA_VOL_WIDTH 7 /* IN2R_PGA_VOL - [7:1] */
@@ -2429,6 +2494,9 @@
2429/* 2494/*
2430 * R800 (0x320) - IN3L Control 2495 * R800 (0x320) - IN3L Control
2431 */ 2496 */
2497#define ARIZONA_IN3L_HPF_MASK 0x8000 /* IN3L_HPF - [15] */
2498#define ARIZONA_IN3L_HPF_SHIFT 15 /* IN3L_HPF - [15] */
2499#define ARIZONA_IN3L_HPF_WIDTH 1 /* IN3L_HPF - [15] */
2432#define ARIZONA_IN3_OSR_MASK 0x6000 /* IN3_OSR - [14:13] */ 2500#define ARIZONA_IN3_OSR_MASK 0x6000 /* IN3_OSR - [14:13] */
2433#define ARIZONA_IN3_OSR_SHIFT 13 /* IN3_OSR - [14:13] */ 2501#define ARIZONA_IN3_OSR_SHIFT 13 /* IN3_OSR - [14:13] */
2434#define ARIZONA_IN3_OSR_WIDTH 2 /* IN3_OSR - [14:13] */ 2502#define ARIZONA_IN3_OSR_WIDTH 2 /* IN3_OSR - [14:13] */
@@ -2467,6 +2535,9 @@
2467/* 2535/*
2468 * R804 (0x324) - IN3R Control 2536 * R804 (0x324) - IN3R Control
2469 */ 2537 */
2538#define ARIZONA_IN3R_HPF_MASK 0x8000 /* IN3R_HPF - [15] */
2539#define ARIZONA_IN3R_HPF_SHIFT 15 /* IN3R_HPF - [15] */
2540#define ARIZONA_IN3R_HPF_WIDTH 1 /* IN3R_HPF - [15] */
2470#define ARIZONA_IN3R_PGA_VOL_MASK 0x00FE /* IN3R_PGA_VOL - [7:1] */ 2541#define ARIZONA_IN3R_PGA_VOL_MASK 0x00FE /* IN3R_PGA_VOL - [7:1] */
2471#define ARIZONA_IN3R_PGA_VOL_SHIFT 1 /* IN3R_PGA_VOL - [7:1] */ 2542#define ARIZONA_IN3R_PGA_VOL_SHIFT 1 /* IN3R_PGA_VOL - [7:1] */
2472#define ARIZONA_IN3R_PGA_VOL_WIDTH 7 /* IN3R_PGA_VOL - [7:1] */ 2543#define ARIZONA_IN3R_PGA_VOL_WIDTH 7 /* IN3R_PGA_VOL - [7:1] */
@@ -2496,6 +2567,9 @@
2496/* 2567/*
2497 * R808 (0x328) - IN4 Control 2568 * R808 (0x328) - IN4 Control
2498 */ 2569 */
2570#define ARIZONA_IN4L_HPF_MASK 0x8000 /* IN4L_HPF - [15] */
2571#define ARIZONA_IN4L_HPF_SHIFT 15 /* IN4L_HPF - [15] */
2572#define ARIZONA_IN4L_HPF_WIDTH 1 /* IN4L_HPF - [15] */
2499#define ARIZONA_IN4_OSR_MASK 0x6000 /* IN4_OSR - [14:13] */ 2573#define ARIZONA_IN4_OSR_MASK 0x6000 /* IN4_OSR - [14:13] */
2500#define ARIZONA_IN4_OSR_SHIFT 13 /* IN4_OSR - [14:13] */ 2574#define ARIZONA_IN4_OSR_SHIFT 13 /* IN4_OSR - [14:13] */
2501#define ARIZONA_IN4_OSR_WIDTH 2 /* IN4_OSR - [14:13] */ 2575#define ARIZONA_IN4_OSR_WIDTH 2 /* IN4_OSR - [14:13] */
@@ -2526,6 +2600,13 @@
2526#define ARIZONA_IN4L_DMIC_DLY_WIDTH 6 /* IN4L_DMIC_DLY - [5:0] */ 2600#define ARIZONA_IN4L_DMIC_DLY_WIDTH 6 /* IN4L_DMIC_DLY - [5:0] */
2527 2601
2528/* 2602/*
2603 * R812 (0x32C) - IN4R Control
2604 */
2605#define ARIZONA_IN4R_HPF_MASK 0x8000 /* IN4R_HPF - [15] */
2606#define ARIZONA_IN4R_HPF_SHIFT 15 /* IN4R_HPF - [15] */
2607#define ARIZONA_IN4R_HPF_WIDTH 1 /* IN4R_HPF - [15] */
2608
2609/*
2529 * R813 (0x32D) - ADC Digital Volume 4R 2610 * R813 (0x32D) - ADC Digital Volume 4R
2530 */ 2611 */
2531#define ARIZONA_IN_VU 0x0200 /* IN_VU */ 2612#define ARIZONA_IN_VU 0x0200 /* IN_VU */
@@ -3138,6 +3219,10 @@
3138/* 3219/*
3139 * R1088 (0x440) - DRE Enable 3220 * R1088 (0x440) - DRE Enable
3140 */ 3221 */
3222#define ARIZONA_DRE3R_ENA 0x0020 /* DRE3R_ENA */
3223#define ARIZONA_DRE3R_ENA_MASK 0x0020 /* DRE3R_ENA */
3224#define ARIZONA_DRE3R_ENA_SHIFT 5 /* DRE3R_ENA */
3225#define ARIZONA_DRE3R_ENA_WIDTH 1 /* DRE3R_ENA */
3141#define ARIZONA_DRE3L_ENA 0x0010 /* DRE3L_ENA */ 3226#define ARIZONA_DRE3L_ENA 0x0010 /* DRE3L_ENA */
3142#define ARIZONA_DRE3L_ENA_MASK 0x0010 /* DRE3L_ENA */ 3227#define ARIZONA_DRE3L_ENA_MASK 0x0010 /* DRE3L_ENA */
3143#define ARIZONA_DRE3L_ENA_SHIFT 4 /* DRE3L_ENA */ 3228#define ARIZONA_DRE3L_ENA_SHIFT 4 /* DRE3L_ENA */
@@ -3260,6 +3345,30 @@
3260#define ARIZONA_SPK2_FMT_WIDTH 1 /* SPK2_FMT */ 3345#define ARIZONA_SPK2_FMT_WIDTH 1 /* SPK2_FMT */
3261 3346
3262/* 3347/*
3348 * R1184 (0x4A0) - HP1 Short Circuit Ctrl
3349 */
3350#define ARIZONA_HP1_SC_ENA 0x1000 /* HP1_SC_ENA */
3351#define ARIZONA_HP1_SC_ENA_MASK 0x1000 /* HP1_SC_ENA */
3352#define ARIZONA_HP1_SC_ENA_SHIFT 12 /* HP1_SC_ENA */
3353#define ARIZONA_HP1_SC_ENA_WIDTH 1 /* HP1_SC_ENA */
3354
3355/*
3356 * R1185 (0x4A1) - HP2 Short Circuit Ctrl
3357 */
3358#define ARIZONA_HP2_SC_ENA 0x1000 /* HP2_SC_ENA */
3359#define ARIZONA_HP2_SC_ENA_MASK 0x1000 /* HP2_SC_ENA */
3360#define ARIZONA_HP2_SC_ENA_SHIFT 12 /* HP2_SC_ENA */
3361#define ARIZONA_HP2_SC_ENA_WIDTH 1 /* HP2_SC_ENA */
3362
3363/*
3364 * R1186 (0x4A2) - HP3 Short Circuit Ctrl
3365 */
3366#define ARIZONA_HP3_SC_ENA 0x1000 /* HP3_SC_ENA */
3367#define ARIZONA_HP3_SC_ENA_MASK 0x1000 /* HP3_SC_ENA */
3368#define ARIZONA_HP3_SC_ENA_SHIFT 12 /* HP3_SC_ENA */
3369#define ARIZONA_HP3_SC_ENA_WIDTH 1 /* HP3_SC_ENA */
3370
3371/*
3263 * R1244 (0x4DC) - DAC comp 1 3372 * R1244 (0x4DC) - DAC comp 1
3264 */ 3373 */
3265#define ARIZONA_OUT_COMP_COEFF_MASK 0xFFFF /* OUT_COMP_COEFF - [15:0] */ 3374#define ARIZONA_OUT_COMP_COEFF_MASK 0xFFFF /* OUT_COMP_COEFF - [15:0] */
@@ -3726,6 +3835,35 @@
3726#define ARIZONA_AIF2TX2_SLOT_WIDTH 6 /* AIF2TX2_SLOT - [5:0] */ 3835#define ARIZONA_AIF2TX2_SLOT_WIDTH 6 /* AIF2TX2_SLOT - [5:0] */
3727 3836
3728/* 3837/*
3838 * R1355 (0x54B) - AIF2 Frame Ctrl 5
3839 */
3840#define ARIZONA_AIF2TX3_SLOT_MASK 0x003F /* AIF2TX3_SLOT - [5:0] */
3841#define ARIZONA_AIF2TX3_SLOT_SHIFT 0 /* AIF2TX3_SLOT - [5:0] */
3842#define ARIZONA_AIF2TX3_SLOT_WIDTH 6 /* AIF2TX3_SLOT - [5:0] */
3843
3844/*
3845 * R1356 (0x54C) - AIF2 Frame Ctrl 6
3846 */
3847#define ARIZONA_AIF2TX4_SLOT_MASK 0x003F /* AIF2TX4_SLOT - [5:0] */
3848#define ARIZONA_AIF2TX4_SLOT_SHIFT 0 /* AIF2TX4_SLOT - [5:0] */
3849#define ARIZONA_AIF2TX4_SLOT_WIDTH 6 /* AIF2TX4_SLOT - [5:0] */
3850
3851
3852/*
3853 * R1357 (0x54D) - AIF2 Frame Ctrl 7
3854 */
3855#define ARIZONA_AIF2TX5_SLOT_MASK 0x003F /* AIF2TX5_SLOT - [5:0] */
3856#define ARIZONA_AIF2TX5_SLOT_SHIFT 0 /* AIF2TX5_SLOT - [5:0] */
3857#define ARIZONA_AIF2TX5_SLOT_WIDTH 6 /* AIF2TX5_SLOT - [5:0] */
3858
3859/*
3860 * R1358 (0x54E) - AIF2 Frame Ctrl 8
3861 */
3862#define ARIZONA_AIF2TX6_SLOT_MASK 0x003F /* AIF2TX6_SLOT - [5:0] */
3863#define ARIZONA_AIF2TX6_SLOT_SHIFT 0 /* AIF2TX6_SLOT - [5:0] */
3864#define ARIZONA_AIF2TX6_SLOT_WIDTH 6 /* AIF2TX6_SLOT - [5:0] */
3865
3866/*
3729 * R1361 (0x551) - AIF2 Frame Ctrl 11 3867 * R1361 (0x551) - AIF2 Frame Ctrl 11
3730 */ 3868 */
3731#define ARIZONA_AIF2RX1_SLOT_MASK 0x003F /* AIF2RX1_SLOT - [5:0] */ 3869#define ARIZONA_AIF2RX1_SLOT_MASK 0x003F /* AIF2RX1_SLOT - [5:0] */
@@ -3740,8 +3878,52 @@
3740#define ARIZONA_AIF2RX2_SLOT_WIDTH 6 /* AIF2RX2_SLOT - [5:0] */ 3878#define ARIZONA_AIF2RX2_SLOT_WIDTH 6 /* AIF2RX2_SLOT - [5:0] */
3741 3879
3742/* 3880/*
3881 * R1363 (0x553) - AIF2 Frame Ctrl 13
3882 */
3883#define ARIZONA_AIF2RX3_SLOT_MASK 0x003F /* AIF2RX3_SLOT - [5:0] */
3884#define ARIZONA_AIF2RX3_SLOT_SHIFT 0 /* AIF2RX3_SLOT - [5:0] */
3885#define ARIZONA_AIF2RX3_SLOT_WIDTH 6 /* AIF2RX3_SLOT - [5:0] */
3886
3887/*
3888 * R1364 (0x554) - AIF2 Frame Ctrl 14
3889 */
3890#define ARIZONA_AIF2RX4_SLOT_MASK 0x003F /* AIF2RX4_SLOT - [5:0] */
3891#define ARIZONA_AIF2RX4_SLOT_SHIFT 0 /* AIF2RX4_SLOT - [5:0] */
3892#define ARIZONA_AIF2RX4_SLOT_WIDTH 6 /* AIF2RX4_SLOT - [5:0] */
3893
3894/*
3895 * R1365 (0x555) - AIF2 Frame Ctrl 15
3896 */
3897#define ARIZONA_AIF2RX5_SLOT_MASK 0x003F /* AIF2RX5_SLOT - [5:0] */
3898#define ARIZONA_AIF2RX5_SLOT_SHIFT 0 /* AIF2RX5_SLOT - [5:0] */
3899#define ARIZONA_AIF2RX5_SLOT_WIDTH 6 /* AIF2RX5_SLOT - [5:0] */
3900
3901/*
3902 * R1366 (0x556) - AIF2 Frame Ctrl 16
3903 */
3904#define ARIZONA_AIF2RX6_SLOT_MASK 0x003F /* AIF2RX6_SLOT - [5:0] */
3905#define ARIZONA_AIF2RX6_SLOT_SHIFT 0 /* AIF2RX6_SLOT - [5:0] */
3906#define ARIZONA_AIF2RX6_SLOT_WIDTH 6 /* AIF2RX6_SLOT - [5:0] */
3907
3908/*
3743 * R1369 (0x559) - AIF2 Tx Enables 3909 * R1369 (0x559) - AIF2 Tx Enables
3744 */ 3910 */
3911#define ARIZONA_AIF2TX6_ENA 0x0020 /* AIF2TX6_ENA */
3912#define ARIZONA_AIF2TX6_ENA_MASK 0x0020 /* AIF2TX6_ENA */
3913#define ARIZONA_AIF2TX6_ENA_SHIFT 5 /* AIF2TX6_ENA */
3914#define ARIZONA_AIF2TX6_ENA_WIDTH 1 /* AIF2TX6_ENA */
3915#define ARIZONA_AIF2TX5_ENA 0x0010 /* AIF2TX5_ENA */
3916#define ARIZONA_AIF2TX5_ENA_MASK 0x0010 /* AIF2TX5_ENA */
3917#define ARIZONA_AIF2TX5_ENA_SHIFT 4 /* AIF2TX5_ENA */
3918#define ARIZONA_AIF2TX5_ENA_WIDTH 1 /* AIF2TX5_ENA */
3919#define ARIZONA_AIF2TX4_ENA 0x0008 /* AIF2TX4_ENA */
3920#define ARIZONA_AIF2TX4_ENA_MASK 0x0008 /* AIF2TX4_ENA */
3921#define ARIZONA_AIF2TX4_ENA_SHIFT 3 /* AIF2TX4_ENA */
3922#define ARIZONA_AIF2TX4_ENA_WIDTH 1 /* AIF2TX4_ENA */
3923#define ARIZONA_AIF2TX3_ENA 0x0004 /* AIF2TX3_ENA */
3924#define ARIZONA_AIF2TX3_ENA_MASK 0x0004 /* AIF2TX3_ENA */
3925#define ARIZONA_AIF2TX3_ENA_SHIFT 2 /* AIF2TX3_ENA */
3926#define ARIZONA_AIF2TX3_ENA_WIDTH 1 /* AIF2TX3_ENA */
3745#define ARIZONA_AIF2TX2_ENA 0x0002 /* AIF2TX2_ENA */ 3927#define ARIZONA_AIF2TX2_ENA 0x0002 /* AIF2TX2_ENA */
3746#define ARIZONA_AIF2TX2_ENA_MASK 0x0002 /* AIF2TX2_ENA */ 3928#define ARIZONA_AIF2TX2_ENA_MASK 0x0002 /* AIF2TX2_ENA */
3747#define ARIZONA_AIF2TX2_ENA_SHIFT 1 /* AIF2TX2_ENA */ 3929#define ARIZONA_AIF2TX2_ENA_SHIFT 1 /* AIF2TX2_ENA */
@@ -3754,6 +3936,22 @@
3754/* 3936/*
3755 * R1370 (0x55A) - AIF2 Rx Enables 3937 * R1370 (0x55A) - AIF2 Rx Enables
3756 */ 3938 */
3939#define ARIZONA_AIF2RX6_ENA 0x0020 /* AIF2RX6_ENA */
3940#define ARIZONA_AIF2RX6_ENA_MASK 0x0020 /* AIF2RX6_ENA */
3941#define ARIZONA_AIF2RX6_ENA_SHIFT 5 /* AIF2RX6_ENA */
3942#define ARIZONA_AIF2RX6_ENA_WIDTH 1 /* AIF2RX6_ENA */
3943#define ARIZONA_AIF2RX5_ENA 0x0010 /* AIF2RX5_ENA */
3944#define ARIZONA_AIF2RX5_ENA_MASK 0x0010 /* AIF2RX5_ENA */
3945#define ARIZONA_AIF2RX5_ENA_SHIFT 4 /* AIF2RX5_ENA */
3946#define ARIZONA_AIF2RX5_ENA_WIDTH 1 /* AIF2RX5_ENA */
3947#define ARIZONA_AIF2RX4_ENA 0x0008 /* AIF2RX4_ENA */
3948#define ARIZONA_AIF2RX4_ENA_MASK 0x0008 /* AIF2RX4_ENA */
3949#define ARIZONA_AIF2RX4_ENA_SHIFT 3 /* AIF2RX4_ENA */
3950#define ARIZONA_AIF2RX4_ENA_WIDTH 1 /* AIF2RX4_ENA */
3951#define ARIZONA_AIF2RX3_ENA 0x0004 /* AIF2RX3_ENA */
3952#define ARIZONA_AIF2RX3_ENA_MASK 0x0004 /* AIF2RX3_ENA */
3953#define ARIZONA_AIF2RX3_ENA_SHIFT 2 /* AIF2RX3_ENA */
3954#define ARIZONA_AIF2RX3_ENA_WIDTH 1 /* AIF2RX3_ENA */
3757#define ARIZONA_AIF2RX2_ENA 0x0002 /* AIF2RX2_ENA */ 3955#define ARIZONA_AIF2RX2_ENA 0x0002 /* AIF2RX2_ENA */
3758#define ARIZONA_AIF2RX2_ENA_MASK 0x0002 /* AIF2RX2_ENA */ 3956#define ARIZONA_AIF2RX2_ENA_MASK 0x0002 /* AIF2RX2_ENA */
3759#define ARIZONA_AIF2RX2_ENA_SHIFT 1 /* AIF2RX2_ENA */ 3957#define ARIZONA_AIF2RX2_ENA_SHIFT 1 /* AIF2RX2_ENA */
diff --git a/include/linux/mfd/as3722.h b/include/linux/mfd/as3722.h
index 16bf8a0dcd97..8d43e9f2a842 100644
--- a/include/linux/mfd/as3722.h
+++ b/include/linux/mfd/as3722.h
@@ -151,6 +151,7 @@
151#define AS3722_ASIC_ID1_REG 0x90 151#define AS3722_ASIC_ID1_REG 0x90
152#define AS3722_ASIC_ID2_REG 0x91 152#define AS3722_ASIC_ID2_REG 0x91
153#define AS3722_LOCK_REG 0x9E 153#define AS3722_LOCK_REG 0x9E
154#define AS3722_FUSE7_REG 0xA7
154#define AS3722_MAX_REGISTER 0xF4 155#define AS3722_MAX_REGISTER 0xF4
155 156
156#define AS3722_SD0_EXT_ENABLE_MASK 0x03 157#define AS3722_SD0_EXT_ENABLE_MASK 0x03
@@ -224,6 +225,7 @@
224#define AS3722_SD_VSEL_MASK 0x7F 225#define AS3722_SD_VSEL_MASK 0x7F
225#define AS3722_SD0_VSEL_MIN 0x01 226#define AS3722_SD0_VSEL_MIN 0x01
226#define AS3722_SD0_VSEL_MAX 0x5A 227#define AS3722_SD0_VSEL_MAX 0x5A
228#define AS3722_SD0_VSEL_LOW_VOL_MAX 0x6E
227#define AS3722_SD2_VSEL_MIN 0x01 229#define AS3722_SD2_VSEL_MIN 0x01
228#define AS3722_SD2_VSEL_MAX 0x7F 230#define AS3722_SD2_VSEL_MAX 0x7F
229 231
@@ -314,6 +316,7 @@
314#define AS3722_GPIO_IOSF_GPIO_INTERRUPT_IN AS3722_GPIO_IOSF_VAL(3) 316#define AS3722_GPIO_IOSF_GPIO_INTERRUPT_IN AS3722_GPIO_IOSF_VAL(3)
315#define AS3722_GPIO_IOSF_ISINK_PWM_IN AS3722_GPIO_IOSF_VAL(4) 317#define AS3722_GPIO_IOSF_ISINK_PWM_IN AS3722_GPIO_IOSF_VAL(4)
316#define AS3722_GPIO_IOSF_VOLTAGE_STBY AS3722_GPIO_IOSF_VAL(5) 318#define AS3722_GPIO_IOSF_VOLTAGE_STBY AS3722_GPIO_IOSF_VAL(5)
319#define AS3722_GPIO_IOSF_SD0_OUT AS3722_GPIO_IOSF_VAL(6)
317#define AS3722_GPIO_IOSF_PWR_GOOD_OUT AS3722_GPIO_IOSF_VAL(7) 320#define AS3722_GPIO_IOSF_PWR_GOOD_OUT AS3722_GPIO_IOSF_VAL(7)
318#define AS3722_GPIO_IOSF_Q32K_OUT AS3722_GPIO_IOSF_VAL(8) 321#define AS3722_GPIO_IOSF_Q32K_OUT AS3722_GPIO_IOSF_VAL(8)
319#define AS3722_GPIO_IOSF_WATCHDOG_IN AS3722_GPIO_IOSF_VAL(9) 322#define AS3722_GPIO_IOSF_WATCHDOG_IN AS3722_GPIO_IOSF_VAL(9)
@@ -341,6 +344,8 @@
341#define AS3722_EXT_CONTROL_ENABLE2 0x2 344#define AS3722_EXT_CONTROL_ENABLE2 0x2
342#define AS3722_EXT_CONTROL_ENABLE3 0x3 345#define AS3722_EXT_CONTROL_ENABLE3 0x3
343 346
347#define AS3722_FUSE7_SD0_LOW_VOLTAGE BIT(4)
348
344/* Interrupt IDs */ 349/* Interrupt IDs */
345enum as3722_irq { 350enum as3722_irq {
346 AS3722_IRQ_LID, 351 AS3722_IRQ_LID,
diff --git a/include/linux/mfd/lp3943.h b/include/linux/mfd/lp3943.h
new file mode 100644
index 000000000000..3490db782988
--- /dev/null
+++ b/include/linux/mfd/lp3943.h
@@ -0,0 +1,114 @@
1/*
2 * TI/National Semiconductor LP3943 Device
3 *
4 * Copyright 2013 Texas Instruments
5 *
6 * Author: Milo Kim <milo.kim@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 */
13
14#ifndef __MFD_LP3943_H__
15#define __MFD_LP3943_H__
16
17#include <linux/gpio.h>
18#include <linux/pwm.h>
19#include <linux/regmap.h>
20
21/* Registers */
22#define LP3943_REG_GPIO_A 0x00
23#define LP3943_REG_GPIO_B 0x01
24#define LP3943_REG_PRESCALE0 0x02
25#define LP3943_REG_PWM0 0x03
26#define LP3943_REG_PRESCALE1 0x04
27#define LP3943_REG_PWM1 0x05
28#define LP3943_REG_MUX0 0x06
29#define LP3943_REG_MUX1 0x07
30#define LP3943_REG_MUX2 0x08
31#define LP3943_REG_MUX3 0x09
32
33/* Bit description for LP3943_REG_MUX0 ~ 3 */
34#define LP3943_GPIO_IN 0x00
35#define LP3943_GPIO_OUT_HIGH 0x00
36#define LP3943_GPIO_OUT_LOW 0x01
37#define LP3943_DIM_PWM0 0x02
38#define LP3943_DIM_PWM1 0x03
39
40#define LP3943_NUM_PWMS 2
41
42enum lp3943_pwm_output {
43 LP3943_PWM_OUT0,
44 LP3943_PWM_OUT1,
45 LP3943_PWM_OUT2,
46 LP3943_PWM_OUT3,
47 LP3943_PWM_OUT4,
48 LP3943_PWM_OUT5,
49 LP3943_PWM_OUT6,
50 LP3943_PWM_OUT7,
51 LP3943_PWM_OUT8,
52 LP3943_PWM_OUT9,
53 LP3943_PWM_OUT10,
54 LP3943_PWM_OUT11,
55 LP3943_PWM_OUT12,
56 LP3943_PWM_OUT13,
57 LP3943_PWM_OUT14,
58 LP3943_PWM_OUT15,
59};
60
61/*
62 * struct lp3943_pwm_map
63 * @output: Output pins which are mapped to each PWM channel
64 * @num_outputs: Number of outputs
65 */
66struct lp3943_pwm_map {
67 enum lp3943_pwm_output *output;
68 int num_outputs;
69};
70
71/*
72 * struct lp3943_platform_data
73 * @pwms: Output channel definitions for PWM channel 0 and 1
74 */
75struct lp3943_platform_data {
76 struct lp3943_pwm_map *pwms[LP3943_NUM_PWMS];
77};
78
79/*
80 * struct lp3943_reg_cfg
81 * @reg: Register address
82 * @mask: Register bit mask to be updated
83 * @shift: Register bit shift
84 */
85struct lp3943_reg_cfg {
86 u8 reg;
87 u8 mask;
88 u8 shift;
89};
90
91/*
92 * struct lp3943
93 * @dev: Parent device pointer
94 * @regmap: Used for I2C communication on accessing registers
95 * @pdata: LP3943 platform specific data
96 * @mux_cfg: Register configuration for pin MUX
97 * @pin_used: Bit mask for output pin used.
98 * This bitmask is used for pin assignment management.
99 * 1 = pin used, 0 = available.
100 * Only LSB 16 bits are used, but it is unsigned long type
101 * for atomic bitwise operations.
102 */
103struct lp3943 {
104 struct device *dev;
105 struct regmap *regmap;
106 struct lp3943_platform_data *pdata;
107 const struct lp3943_reg_cfg *mux_cfg;
108 unsigned long pin_used;
109};
110
111int lp3943_read_byte(struct lp3943 *lp3943, u8 reg, u8 *read);
112int lp3943_write_byte(struct lp3943 *lp3943, u8 reg, u8 data);
113int lp3943_update_bits(struct lp3943 *lp3943, u8 reg, u8 mask, u8 data);
114#endif
diff --git a/include/linux/mfd/max14577-private.h b/include/linux/mfd/max14577-private.h
new file mode 100644
index 000000000000..a3d0185196d3
--- /dev/null
+++ b/include/linux/mfd/max14577-private.h
@@ -0,0 +1,330 @@
1/*
2 * max14577-private.h - Common API for the Maxim 14577 internal sub chip
3 *
4 * Copyright (C) 2013 Samsung Electrnoics
5 * Chanwoo Choi <cw00.choi@samsung.com>
6 * Krzysztof Kozlowski <k.kozlowski@samsung.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 */
18
19#ifndef __MAX14577_PRIVATE_H__
20#define __MAX14577_PRIVATE_H__
21
22#include <linux/i2c.h>
23#include <linux/regmap.h>
24
25#define MAX14577_REG_INVALID (0xff)
26
27/* Slave addr = 0x4A: Interrupt */
28enum max14577_reg {
29 MAX14577_REG_DEVICEID = 0x00,
30 MAX14577_REG_INT1 = 0x01,
31 MAX14577_REG_INT2 = 0x02,
32 MAX14577_REG_INT3 = 0x03,
33 MAX14577_REG_STATUS1 = 0x04,
34 MAX14577_REG_STATUS2 = 0x05,
35 MAX14577_REG_STATUS3 = 0x06,
36 MAX14577_REG_INTMASK1 = 0x07,
37 MAX14577_REG_INTMASK2 = 0x08,
38 MAX14577_REG_INTMASK3 = 0x09,
39 MAX14577_REG_CDETCTRL1 = 0x0A,
40 MAX14577_REG_RFU = 0x0B,
41 MAX14577_REG_CONTROL1 = 0x0C,
42 MAX14577_REG_CONTROL2 = 0x0D,
43 MAX14577_REG_CONTROL3 = 0x0E,
44 MAX14577_REG_CHGCTRL1 = 0x0F,
45 MAX14577_REG_CHGCTRL2 = 0x10,
46 MAX14577_REG_CHGCTRL3 = 0x11,
47 MAX14577_REG_CHGCTRL4 = 0x12,
48 MAX14577_REG_CHGCTRL5 = 0x13,
49 MAX14577_REG_CHGCTRL6 = 0x14,
50 MAX14577_REG_CHGCTRL7 = 0x15,
51
52 MAX14577_REG_END,
53};
54
55/* Slave addr = 0x4A: MUIC */
56enum max14577_muic_reg {
57 MAX14577_MUIC_REG_STATUS1 = 0x04,
58 MAX14577_MUIC_REG_STATUS2 = 0x05,
59 MAX14577_MUIC_REG_CONTROL1 = 0x0C,
60 MAX14577_MUIC_REG_CONTROL3 = 0x0E,
61
62 MAX14577_MUIC_REG_END,
63};
64
65enum max14577_muic_charger_type {
66 MAX14577_CHARGER_TYPE_NONE = 0,
67 MAX14577_CHARGER_TYPE_USB,
68 MAX14577_CHARGER_TYPE_DOWNSTREAM_PORT,
69 MAX14577_CHARGER_TYPE_DEDICATED_CHG,
70 MAX14577_CHARGER_TYPE_SPECIAL_500MA,
71 MAX14577_CHARGER_TYPE_SPECIAL_1A,
72 MAX14577_CHARGER_TYPE_RESERVED,
73 MAX14577_CHARGER_TYPE_DEAD_BATTERY = 7,
74};
75
76/* MAX14577 interrupts */
77#define INT1_ADC_MASK (0x1 << 0)
78#define INT1_ADCLOW_MASK (0x1 << 1)
79#define INT1_ADCERR_MASK (0x1 << 2)
80
81#define INT2_CHGTYP_MASK (0x1 << 0)
82#define INT2_CHGDETRUN_MASK (0x1 << 1)
83#define INT2_DCDTMR_MASK (0x1 << 2)
84#define INT2_DBCHG_MASK (0x1 << 3)
85#define INT2_VBVOLT_MASK (0x1 << 4)
86
87#define INT3_EOC_MASK (0x1 << 0)
88#define INT3_CGMBC_MASK (0x1 << 1)
89#define INT3_OVP_MASK (0x1 << 2)
90#define INT3_MBCCHGERR_MASK (0x1 << 3)
91
92/* MAX14577 DEVICE ID register */
93#define DEVID_VENDORID_SHIFT 0
94#define DEVID_DEVICEID_SHIFT 3
95#define DEVID_VENDORID_MASK (0x07 << DEVID_VENDORID_SHIFT)
96#define DEVID_DEVICEID_MASK (0x1f << DEVID_DEVICEID_SHIFT)
97
98/* MAX14577 STATUS1 register */
99#define STATUS1_ADC_SHIFT 0
100#define STATUS1_ADCLOW_SHIFT 5
101#define STATUS1_ADCERR_SHIFT 6
102#define STATUS1_ADC_MASK (0x1f << STATUS1_ADC_SHIFT)
103#define STATUS1_ADCLOW_MASK (0x1 << STATUS1_ADCLOW_SHIFT)
104#define STATUS1_ADCERR_MASK (0x1 << STATUS1_ADCERR_SHIFT)
105
106/* MAX14577 STATUS2 register */
107#define STATUS2_CHGTYP_SHIFT 0
108#define STATUS2_CHGDETRUN_SHIFT 3
109#define STATUS2_DCDTMR_SHIFT 4
110#define STATUS2_DBCHG_SHIFT 5
111#define STATUS2_VBVOLT_SHIFT 6
112#define STATUS2_CHGTYP_MASK (0x7 << STATUS2_CHGTYP_SHIFT)
113#define STATUS2_CHGDETRUN_MASK (0x1 << STATUS2_CHGDETRUN_SHIFT)
114#define STATUS2_DCDTMR_MASK (0x1 << STATUS2_DCDTMR_SHIFT)
115#define STATUS2_DBCHG_MASK (0x1 << STATUS2_DBCHG_SHIFT)
116#define STATUS2_VBVOLT_MASK (0x1 << STATUS2_VBVOLT_SHIFT)
117
118/* MAX14577 CONTROL1 register */
119#define COMN1SW_SHIFT 0
120#define COMP2SW_SHIFT 3
121#define MICEN_SHIFT 6
122#define IDBEN_SHIFT 7
123#define COMN1SW_MASK (0x7 << COMN1SW_SHIFT)
124#define COMP2SW_MASK (0x7 << COMP2SW_SHIFT)
125#define MICEN_MASK (0x1 << MICEN_SHIFT)
126#define IDBEN_MASK (0x1 << IDBEN_SHIFT)
127#define CLEAR_IDBEN_MICEN_MASK (COMN1SW_MASK | COMP2SW_MASK)
128#define CTRL1_SW_USB ((1 << COMP2SW_SHIFT) \
129 | (1 << COMN1SW_SHIFT))
130#define CTRL1_SW_AUDIO ((2 << COMP2SW_SHIFT) \
131 | (2 << COMN1SW_SHIFT))
132#define CTRL1_SW_UART ((3 << COMP2SW_SHIFT) \
133 | (3 << COMN1SW_SHIFT))
134#define CTRL1_SW_OPEN ((0 << COMP2SW_SHIFT) \
135 | (0 << COMN1SW_SHIFT))
136
137/* MAX14577 CONTROL2 register */
138#define CTRL2_LOWPWR_SHIFT (0)
139#define CTRL2_ADCEN_SHIFT (1)
140#define CTRL2_CPEN_SHIFT (2)
141#define CTRL2_SFOUTASRT_SHIFT (3)
142#define CTRL2_SFOUTORD_SHIFT (4)
143#define CTRL2_ACCDET_SHIFT (5)
144#define CTRL2_USBCPINT_SHIFT (6)
145#define CTRL2_RCPS_SHIFT (7)
146#define CTRL2_LOWPWR_MASK (0x1 << CTRL2_LOWPWR_SHIFT)
147#define CTRL2_ADCEN_MASK (0x1 << CTRL2_ADCEN_SHIFT)
148#define CTRL2_CPEN_MASK (0x1 << CTRL2_CPEN_SHIFT)
149#define CTRL2_SFOUTASRT_MASK (0x1 << CTRL2_SFOUTASRT_SHIFT)
150#define CTRL2_SFOUTORD_MASK (0x1 << CTRL2_SFOUTORD_SHIFT)
151#define CTRL2_ACCDET_MASK (0x1 << CTRL2_ACCDET_SHIFT)
152#define CTRL2_USBCPINT_MASK (0x1 << CTRL2_USBCPINT_SHIFT)
153#define CTRL2_RCPS_MASK (0x1 << CTR2_RCPS_SHIFT)
154
155#define CTRL2_CPEN1_LOWPWR0 ((1 << CTRL2_CPEN_SHIFT) | \
156 (0 << CTRL2_LOWPWR_SHIFT))
157#define CTRL2_CPEN0_LOWPWR1 ((0 << CTRL2_CPEN_SHIFT) | \
158 (1 << CTRL2_LOWPWR_SHIFT))
159
160/* MAX14577 CONTROL3 register */
161#define CTRL3_JIGSET_SHIFT 0
162#define CTRL3_BOOTSET_SHIFT 2
163#define CTRL3_ADCDBSET_SHIFT 4
164#define CTRL3_JIGSET_MASK (0x3 << CTRL3_JIGSET_SHIFT)
165#define CTRL3_BOOTSET_MASK (0x3 << CTRL3_BOOTSET_SHIFT)
166#define CTRL3_ADCDBSET_MASK (0x3 << CTRL3_ADCDBSET_SHIFT)
167
168/* Slave addr = 0x4A: Charger */
169enum max14577_charger_reg {
170 MAX14577_CHG_REG_STATUS3 = 0x06,
171 MAX14577_CHG_REG_CHG_CTRL1 = 0x0F,
172 MAX14577_CHG_REG_CHG_CTRL2 = 0x10,
173 MAX14577_CHG_REG_CHG_CTRL3 = 0x11,
174 MAX14577_CHG_REG_CHG_CTRL4 = 0x12,
175 MAX14577_CHG_REG_CHG_CTRL5 = 0x13,
176 MAX14577_CHG_REG_CHG_CTRL6 = 0x14,
177 MAX14577_CHG_REG_CHG_CTRL7 = 0x15,
178
179 MAX14577_CHG_REG_END,
180};
181
182/* MAX14577 STATUS3 register */
183#define STATUS3_EOC_SHIFT 0
184#define STATUS3_CGMBC_SHIFT 1
185#define STATUS3_OVP_SHIFT 2
186#define STATUS3_MBCCHGERR_SHIFT 3
187#define STATUS3_EOC_MASK (0x1 << STATUS3_EOC_SHIFT)
188#define STATUS3_CGMBC_MASK (0x1 << STATUS3_CGMBC_SHIFT)
189#define STATUS3_OVP_MASK (0x1 << STATUS3_OVP_SHIFT)
190#define STATUS3_MBCCHGERR_MASK (0x1 << STATUS3_MBCCHGERR_SHIFT)
191
192/* MAX14577 CDETCTRL1 register */
193#define CDETCTRL1_CHGDETEN_SHIFT 0
194#define CDETCTRL1_CHGTYPMAN_SHIFT 1
195#define CDETCTRL1_DCDEN_SHIFT 2
196#define CDETCTRL1_DCD2SCT_SHIFT 3
197#define CDETCTRL1_DCHKTM_SHIFT 4
198#define CDETCTRL1_DBEXIT_SHIFT 5
199#define CDETCTRL1_DBIDLE_SHIFT 6
200#define CDETCTRL1_CDPDET_SHIFT 7
201#define CDETCTRL1_CHGDETEN_MASK (0x1 << CDETCTRL1_CHGDETEN_SHIFT)
202#define CDETCTRL1_CHGTYPMAN_MASK (0x1 << CDETCTRL1_CHGTYPMAN_SHIFT)
203#define CDETCTRL1_DCDEN_MASK (0x1 << CDETCTRL1_DCDEN_SHIFT)
204#define CDETCTRL1_DCD2SCT_MASK (0x1 << CDETCTRL1_DCD2SCT_SHIFT)
205#define CDETCTRL1_DCHKTM_MASK (0x1 << CDETCTRL1_DCHKTM_SHIFT)
206#define CDETCTRL1_DBEXIT_MASK (0x1 << CDETCTRL1_DBEXIT_SHIFT)
207#define CDETCTRL1_DBIDLE_MASK (0x1 << CDETCTRL1_DBIDLE_SHIFT)
208#define CDETCTRL1_CDPDET_MASK (0x1 << CDETCTRL1_CDPDET_SHIFT)
209
210/* MAX14577 CHGCTRL1 register */
211#define CHGCTRL1_TCHW_SHIFT 4
212#define CHGCTRL1_TCHW_MASK (0x7 << CHGCTRL1_TCHW_SHIFT)
213
214/* MAX14577 CHGCTRL2 register */
215#define CHGCTRL2_MBCHOSTEN_SHIFT 6
216#define CHGCTRL2_MBCHOSTEN_MASK (0x1 << CHGCTRL2_MBCHOSTEN_SHIFT)
217#define CHGCTRL2_VCHGR_RC_SHIFT 7
218#define CHGCTRL2_VCHGR_RC_MASK (0x1 << CHGCTRL2_VCHGR_RC_SHIFT)
219
220/* MAX14577 CHGCTRL3 register */
221#define CHGCTRL3_MBCCVWRC_SHIFT 0
222#define CHGCTRL3_MBCCVWRC_MASK (0xf << CHGCTRL3_MBCCVWRC_SHIFT)
223
224/* MAX14577 CHGCTRL4 register */
225#define CHGCTRL4_MBCICHWRCH_SHIFT 0
226#define CHGCTRL4_MBCICHWRCH_MASK (0xf << CHGCTRL4_MBCICHWRCH_SHIFT)
227#define CHGCTRL4_MBCICHWRCL_SHIFT 4
228#define CHGCTRL4_MBCICHWRCL_MASK (0x1 << CHGCTRL4_MBCICHWRCL_SHIFT)
229
230/* MAX14577 CHGCTRL5 register */
231#define CHGCTRL5_EOCS_SHIFT 0
232#define CHGCTRL5_EOCS_MASK (0xf << CHGCTRL5_EOCS_SHIFT)
233
234/* MAX14577 CHGCTRL6 register */
235#define CHGCTRL6_AUTOSTOP_SHIFT 5
236#define CHGCTRL6_AUTOSTOP_MASK (0x1 << CHGCTRL6_AUTOSTOP_SHIFT)
237
238/* MAX14577 CHGCTRL7 register */
239#define CHGCTRL7_OTPCGHCVS_SHIFT 0
240#define CHGCTRL7_OTPCGHCVS_MASK (0x3 << CHGCTRL7_OTPCGHCVS_SHIFT)
241
242/* MAX14577 regulator current limits (as in CHGCTRL4 register), uA */
243#define MAX14577_REGULATOR_CURRENT_LIMIT_MIN 90000
244#define MAX14577_REGULATOR_CURRENT_LIMIT_HIGH_START 200000
245#define MAX14577_REGULATOR_CURRENT_LIMIT_HIGH_STEP 50000
246#define MAX14577_REGULATOR_CURRENT_LIMIT_MAX 950000
247
248/* MAX14577 regulator SFOUT LDO voltage, fixed, uV */
249#define MAX14577_REGULATOR_SAFEOUT_VOLTAGE 4900000
250
251enum max14577_irq_source {
252 MAX14577_IRQ_INT1 = 0,
253 MAX14577_IRQ_INT2,
254 MAX14577_IRQ_INT3,
255
256 MAX14577_IRQ_REGS_NUM,
257};
258
259enum max14577_irq {
260 /* INT1 */
261 MAX14577_IRQ_INT1_ADC,
262 MAX14577_IRQ_INT1_ADCLOW,
263 MAX14577_IRQ_INT1_ADCERR,
264
265 /* INT2 */
266 MAX14577_IRQ_INT2_CHGTYP,
267 MAX14577_IRQ_INT2_CHGDETRUN,
268 MAX14577_IRQ_INT2_DCDTMR,
269 MAX14577_IRQ_INT2_DBCHG,
270 MAX14577_IRQ_INT2_VBVOLT,
271
272 /* INT3 */
273 MAX14577_IRQ_INT3_EOC,
274 MAX14577_IRQ_INT3_CGMBC,
275 MAX14577_IRQ_INT3_OVP,
276 MAX14577_IRQ_INT3_MBCCHGERR,
277
278 MAX14577_IRQ_NUM,
279};
280
281struct max14577 {
282 struct device *dev;
283 struct i2c_client *i2c; /* Slave addr = 0x4A */
284
285 struct regmap *regmap;
286
287 struct regmap_irq_chip_data *irq_data;
288 int irq;
289
290 /* Device ID */
291 u8 vendor_id; /* Vendor Identification */
292 u8 device_id; /* Chip Version */
293};
294
295/* MAX14577 shared regmap API function */
296static inline int max14577_read_reg(struct regmap *map, u8 reg, u8 *dest)
297{
298 unsigned int val;
299 int ret;
300
301 ret = regmap_read(map, reg, &val);
302 *dest = val;
303
304 return ret;
305}
306
307static inline int max14577_bulk_read(struct regmap *map, u8 reg, u8 *buf,
308 int count)
309{
310 return regmap_bulk_read(map, reg, buf, count);
311}
312
313static inline int max14577_write_reg(struct regmap *map, u8 reg, u8 value)
314{
315 return regmap_write(map, reg, value);
316}
317
318static inline int max14577_bulk_write(struct regmap *map, u8 reg, u8 *buf,
319 int count)
320{
321 return regmap_bulk_write(map, reg, buf, count);
322}
323
324static inline int max14577_update_reg(struct regmap *map, u8 reg, u8 mask,
325 u8 val)
326{
327 return regmap_update_bits(map, reg, mask, val);
328}
329
330#endif /* __MAX14577_PRIVATE_H__ */
diff --git a/include/linux/mfd/max14577.h b/include/linux/mfd/max14577.h
new file mode 100644
index 000000000000..247b021dfaaf
--- /dev/null
+++ b/include/linux/mfd/max14577.h
@@ -0,0 +1,69 @@
1/*
2 * max14577.h - Driver for the Maxim 14577
3 *
4 * Copyright (C) 2013 Samsung Electrnoics
5 * Chanwoo Choi <cw00.choi@samsung.com>
6 * Krzysztof Kozlowski <k.kozlowski@samsung.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * This driver is based on max8997.h
19 *
20 * MAX14577 has MUIC, Charger devices.
21 * The devices share the same I2C bus and interrupt line
22 * included in this mfd driver.
23 */
24
25#ifndef __MAX14577_H__
26#define __MAX14577_H__
27
28#include <linux/mfd/max14577-private.h>
29#include <linux/regulator/consumer.h>
30
31/*
32 * MAX14577 Regulator
33 */
34
35/* MAX14577 regulator IDs */
36enum max14577_regulators {
37 MAX14577_SAFEOUT = 0,
38 MAX14577_CHARGER,
39
40 MAX14577_REG_MAX,
41};
42
43struct max14577_regulator_platform_data {
44 int id;
45 struct regulator_init_data *initdata;
46 struct device_node *of_node;
47};
48
49/*
50 * MAX14577 MFD platform data
51 */
52struct max14577_platform_data {
53 /* IRQ */
54 int irq_base;
55
56 /* current control GPIOs */
57 int gpio_pogo_vbatt_en;
58 int gpio_pogo_vbus_en;
59
60 /* current control GPIO control function */
61 int (*set_gpio_pogo_vbatt_en) (int gpio_val);
62 int (*set_gpio_pogo_vbus_en) (int gpio_val);
63
64 int (*set_gpio_pogo_cb) (int new_dev);
65
66 struct max14577_regulator_platform_data *regulators;
67};
68
69#endif /* __MAX14577_H__ */
diff --git a/include/linux/mfd/max77686-private.h b/include/linux/mfd/max77686-private.h
index d327d4971e4f..8c75a9c8dfab 100644
--- a/include/linux/mfd/max77686-private.h
+++ b/include/linux/mfd/max77686-private.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * max77686.h - Voltage regulator driver for the Maxim 77686 2 * max77686-private.h - Voltage regulator driver for the Maxim 77686
3 * 3 *
4 * Copyright (C) 2012 Samsung Electrnoics 4 * Copyright (C) 2012 Samsung Electrnoics
5 * Chiwoong Byun <woong.byun@samsung.com> 5 * Chiwoong Byun <woong.byun@samsung.com>
diff --git a/include/linux/mfd/max8997-private.h b/include/linux/mfd/max8997-private.h
index fb465dfbb59e..ad1ae7f345ad 100644
--- a/include/linux/mfd/max8997-private.h
+++ b/include/linux/mfd/max8997-private.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * max8997.h - Voltage regulator driver for the Maxim 8997 2 * max8997-private.h - Voltage regulator driver for the Maxim 8997
3 * 3 *
4 * Copyright (C) 2010 Samsung Electrnoics 4 * Copyright (C) 2010 Samsung Electrnoics
5 * MyungJoo Ham <myungjoo.ham@samsung.com> 5 * MyungJoo Ham <myungjoo.ham@samsung.com>
diff --git a/include/linux/mfd/max8998-private.h b/include/linux/mfd/max8998-private.h
index 84844e0a5704..4ecb24b4b863 100644
--- a/include/linux/mfd/max8998-private.h
+++ b/include/linux/mfd/max8998-private.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * max8998.h - Voltage regulator driver for the Maxim 8998 2 * max8998-private.h - Voltage regulator driver for the Maxim 8998
3 * 3 *
4 * Copyright (C) 2009-2010 Samsung Electrnoics 4 * Copyright (C) 2009-2010 Samsung Electrnoics
5 * Kyungmin Park <kyungmin.park@samsung.com> 5 * Kyungmin Park <kyungmin.park@samsung.com>
diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h
index 67c17b5a6f44..ac39d910e70b 100644
--- a/include/linux/mfd/mc13xxx.h
+++ b/include/linux/mfd/mc13xxx.h
@@ -21,8 +21,6 @@ int mc13xxx_reg_write(struct mc13xxx *mc13xxx, unsigned int offset, u32 val);
21int mc13xxx_reg_rmw(struct mc13xxx *mc13xxx, unsigned int offset, 21int mc13xxx_reg_rmw(struct mc13xxx *mc13xxx, unsigned int offset,
22 u32 mask, u32 val); 22 u32 mask, u32 val);
23 23
24int mc13xxx_get_flags(struct mc13xxx *mc13xxx);
25
26int mc13xxx_irq_request(struct mc13xxx *mc13xxx, int irq, 24int mc13xxx_irq_request(struct mc13xxx *mc13xxx, int irq,
27 irq_handler_t handler, const char *name, void *dev); 25 irq_handler_t handler, const char *name, void *dev);
28int mc13xxx_irq_request_nounmask(struct mc13xxx *mc13xxx, int irq, 26int mc13xxx_irq_request_nounmask(struct mc13xxx *mc13xxx, int irq,
@@ -112,9 +110,6 @@ struct mc13xxx_led_platform_data {
112 int id; 110 int id;
113 const char *name; 111 const char *name;
114 const char *default_trigger; 112 const char *default_trigger;
115
116/* Three or two bits current selection depending on the led */
117 char max_current;
118}; 113};
119 114
120#define MAX_LED_CONTROL_REGS 6 115#define MAX_LED_CONTROL_REGS 6
@@ -123,7 +118,7 @@ struct mc13xxx_leds_platform_data {
123 struct mc13xxx_led_platform_data *led; 118 struct mc13xxx_led_platform_data *led;
124 int num_leds; 119 int num_leds;
125 120
126/* LED Control 0 */ 121/* MC13783 LED Control 0 */
127#define MC13783_LED_C0_ENABLE (1 << 0) 122#define MC13783_LED_C0_ENABLE (1 << 0)
128#define MC13783_LED_C0_TRIODE_MD (1 << 7) 123#define MC13783_LED_C0_TRIODE_MD (1 << 7)
129#define MC13783_LED_C0_TRIODE_AD (1 << 8) 124#define MC13783_LED_C0_TRIODE_AD (1 << 8)
@@ -131,21 +126,43 @@ struct mc13xxx_leds_platform_data {
131#define MC13783_LED_C0_BOOST (1 << 10) 126#define MC13783_LED_C0_BOOST (1 << 10)
132#define MC13783_LED_C0_ABMODE(x) (((x) & 0x7) << 11) 127#define MC13783_LED_C0_ABMODE(x) (((x) & 0x7) << 11)
133#define MC13783_LED_C0_ABREF(x) (((x) & 0x3) << 14) 128#define MC13783_LED_C0_ABREF(x) (((x) & 0x3) << 14)
134/* LED Control 1 */ 129/* MC13783 LED Control 1 */
135#define MC13783_LED_C1_TC1HALF (1 << 18) 130#define MC13783_LED_C1_TC1HALF (1 << 18)
136#define MC13783_LED_C1_SLEWLIM (1 << 23) 131#define MC13783_LED_C1_SLEWLIM (1 << 23)
137/* LED Control 2 */ 132/* MC13783 LED Control 2 */
133#define MC13783_LED_C2_CURRENT_MD(x) (((x) & 0x7) << 0)
134#define MC13783_LED_C2_CURRENT_AD(x) (((x) & 0x7) << 3)
135#define MC13783_LED_C2_CURRENT_KP(x) (((x) & 0x7) << 6)
138#define MC13783_LED_C2_PERIOD(x) (((x) & 0x3) << 21) 136#define MC13783_LED_C2_PERIOD(x) (((x) & 0x3) << 21)
139#define MC13783_LED_C2_SLEWLIM (1 << 23) 137#define MC13783_LED_C2_SLEWLIM (1 << 23)
140/* LED Control 3 */ 138/* MC13783 LED Control 3 */
139#define MC13783_LED_C3_CURRENT_R1(x) (((x) & 0x3) << 0)
140#define MC13783_LED_C3_CURRENT_G1(x) (((x) & 0x3) << 2)
141#define MC13783_LED_C3_CURRENT_B1(x) (((x) & 0x3) << 4)
141#define MC13783_LED_C3_PERIOD(x) (((x) & 0x3) << 21) 142#define MC13783_LED_C3_PERIOD(x) (((x) & 0x3) << 21)
142#define MC13783_LED_C3_TRIODE_TC1 (1 << 23) 143#define MC13783_LED_C3_TRIODE_TC1 (1 << 23)
143/* LED Control 4 */ 144/* MC13783 LED Control 4 */
145#define MC13783_LED_C4_CURRENT_R2(x) (((x) & 0x3) << 0)
146#define MC13783_LED_C4_CURRENT_G2(x) (((x) & 0x3) << 2)
147#define MC13783_LED_C4_CURRENT_B2(x) (((x) & 0x3) << 4)
144#define MC13783_LED_C4_PERIOD(x) (((x) & 0x3) << 21) 148#define MC13783_LED_C4_PERIOD(x) (((x) & 0x3) << 21)
145#define MC13783_LED_C4_TRIODE_TC2 (1 << 23) 149#define MC13783_LED_C4_TRIODE_TC2 (1 << 23)
146/* LED Control 5 */ 150/* MC13783 LED Control 5 */
151#define MC13783_LED_C5_CURRENT_R3(x) (((x) & 0x3) << 0)
152#define MC13783_LED_C5_CURRENT_G3(x) (((x) & 0x3) << 2)
153#define MC13783_LED_C5_CURRENT_B3(x) (((x) & 0x3) << 4)
147#define MC13783_LED_C5_PERIOD(x) (((x) & 0x3) << 21) 154#define MC13783_LED_C5_PERIOD(x) (((x) & 0x3) << 21)
148#define MC13783_LED_C5_TRIODE_TC3 (1 << 23) 155#define MC13783_LED_C5_TRIODE_TC3 (1 << 23)
156/* MC13892 LED Control 0 */
157#define MC13892_LED_C0_CURRENT_MD(x) (((x) & 0x7) << 9)
158#define MC13892_LED_C0_CURRENT_AD(x) (((x) & 0x7) << 21)
159/* MC13892 LED Control 1 */
160#define MC13892_LED_C1_CURRENT_KP(x) (((x) & 0x7) << 9)
161/* MC13892 LED Control 2 */
162#define MC13892_LED_C2_CURRENT_R(x) (((x) & 0x7) << 9)
163#define MC13892_LED_C2_CURRENT_G(x) (((x) & 0x7) << 21)
164/* MC13892 LED Control 3 */
165#define MC13892_LED_C3_CURRENT_B(x) (((x) & 0x7) << 9)
149 u32 led_control[MAX_LED_CONTROL_REGS]; 166 u32 led_control[MAX_LED_CONTROL_REGS];
150}; 167};
151 168
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h
index cab2dd279076..41c9bde410c5 100644
--- a/include/linux/mfd/samsung/core.h
+++ b/include/linux/mfd/samsung/core.h
@@ -59,12 +59,6 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic);
59void sec_irq_exit(struct sec_pmic_dev *sec_pmic); 59void sec_irq_exit(struct sec_pmic_dev *sec_pmic);
60int sec_irq_resume(struct sec_pmic_dev *sec_pmic); 60int sec_irq_resume(struct sec_pmic_dev *sec_pmic);
61 61
62extern int sec_reg_read(struct sec_pmic_dev *sec_pmic, u8 reg, void *dest);
63extern int sec_bulk_read(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf);
64extern int sec_reg_write(struct sec_pmic_dev *sec_pmic, u8 reg, u8 value);
65extern int sec_bulk_write(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf);
66extern int sec_reg_update(struct sec_pmic_dev *sec_pmic, u8 reg, u8 val, u8 mask);
67
68struct sec_platform_data { 62struct sec_platform_data {
69 struct sec_regulator_data *regulators; 63 struct sec_regulator_data *regulators;
70 struct sec_opmode_data *opmode; 64 struct sec_opmode_data *opmode;
diff --git a/include/linux/mfd/samsung/s5m8767.h b/include/linux/mfd/samsung/s5m8767.h
index 306a95fc558c..2ab0b0f03641 100644
--- a/include/linux/mfd/samsung/s5m8767.h
+++ b/include/linux/mfd/samsung/s5m8767.h
@@ -183,6 +183,22 @@ enum s5m8767_regulators {
183 S5M8767_REG_MAX, 183 S5M8767_REG_MAX,
184}; 184};
185 185
186#define S5M8767_ENCTRL_SHIFT 6 186#define S5M8767_ENCTRL_SHIFT 6
187#define S5M8767_ENCTRL_MASK (0x3 << S5M8767_ENCTRL_SHIFT)
188
189/*
190 * Values for BUCK_RAMP field in DVS_RAMP register, matching raw values
191 * in mV/us.
192 */
193enum s5m8767_dvs_buck_ramp_values {
194 S5M8767_DVS_BUCK_RAMP_5 = 0x4,
195 S5M8767_DVS_BUCK_RAMP_10 = 0x9,
196 S5M8767_DVS_BUCK_RAMP_12_5 = 0xb,
197 S5M8767_DVS_BUCK_RAMP_25 = 0xd,
198 S5M8767_DVS_BUCK_RAMP_50 = 0xe,
199 S5M8767_DVS_BUCK_RAMP_100 = 0xf,
200};
201#define S5M8767_DVS_BUCK_RAMP_SHIFT 4
202#define S5M8767_DVS_BUCK_RAMP_MASK (0xf << S5M8767_DVS_BUCK_RAMP_SHIFT)
187 203
188#endif /* __LINUX_MFD_S5M8767_H */ 204#endif /* __LINUX_MFD_S5M8767_H */
diff --git a/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h b/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h
index b6d36b38b99c..866e355fa409 100644
--- a/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h
+++ b/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h
@@ -212,6 +212,7 @@
212#define IMX6Q_GPR3_MIPI_MUX_CTL_IPU1_DI1 (0x1 << 4) 212#define IMX6Q_GPR3_MIPI_MUX_CTL_IPU1_DI1 (0x1 << 4)
213#define IMX6Q_GPR3_MIPI_MUX_CTL_IPU2_DI0 (0x2 << 4) 213#define IMX6Q_GPR3_MIPI_MUX_CTL_IPU2_DI0 (0x2 << 4)
214#define IMX6Q_GPR3_MIPI_MUX_CTL_IPU2_DI1 (0x3 << 4) 214#define IMX6Q_GPR3_MIPI_MUX_CTL_IPU2_DI1 (0x3 << 4)
215#define IMX6Q_GPR3_HDMI_MUX_CTL_SHIFT 2
215#define IMX6Q_GPR3_HDMI_MUX_CTL_MASK (0x3 << 2) 216#define IMX6Q_GPR3_HDMI_MUX_CTL_MASK (0x3 << 2)
216#define IMX6Q_GPR3_HDMI_MUX_CTL_IPU1_DI0 (0x0 << 2) 217#define IMX6Q_GPR3_HDMI_MUX_CTL_IPU1_DI0 (0x0 << 2)
217#define IMX6Q_GPR3_HDMI_MUX_CTL_IPU1_DI1 (0x1 << 2) 218#define IMX6Q_GPR3_HDMI_MUX_CTL_IPU1_DI1 (0x1 << 2)
diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h
index d498d98f0c2c..fb96c84dada5 100644
--- a/include/linux/mfd/ti_am335x_tscadc.h
+++ b/include/linux/mfd/ti_am335x_tscadc.h
@@ -159,6 +159,9 @@ struct ti_tscadc_dev {
159 int adc_cell; /* -1 if not used */ 159 int adc_cell; /* -1 if not used */
160 struct mfd_cell cells[TSCADC_CELLS]; 160 struct mfd_cell cells[TSCADC_CELLS];
161 u32 reg_se_cache; 161 u32 reg_se_cache;
162 bool adc_waiting;
163 bool adc_in_use;
164 wait_queue_head_t reg_se_wait;
162 spinlock_t reg_lock; 165 spinlock_t reg_lock;
163 unsigned int clk_div; 166 unsigned int clk_div;
164 167
@@ -176,8 +179,9 @@ static inline struct ti_tscadc_dev *ti_tscadc_dev_get(struct platform_device *p)
176 return *tscadc_dev; 179 return *tscadc_dev;
177} 180}
178 181
179void am335x_tsc_se_update(struct ti_tscadc_dev *tsadc); 182void am335x_tsc_se_set_cache(struct ti_tscadc_dev *tsadc, u32 val);
180void am335x_tsc_se_set(struct ti_tscadc_dev *tsadc, u32 val); 183void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val);
181void am335x_tsc_se_clr(struct ti_tscadc_dev *tsadc, u32 val); 184void am335x_tsc_se_clr(struct ti_tscadc_dev *tsadc, u32 val);
185void am335x_tsc_se_adc_done(struct ti_tscadc_dev *tsadc);
182 186
183#endif 187#endif
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index b22883d60500..8f6f2e91e7ae 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -76,6 +76,13 @@
76 */ 76 */
77#define TMIO_MMC_USE_GPIO_CD (1 << 5) 77#define TMIO_MMC_USE_GPIO_CD (1 << 5)
78 78
79/*
80 * Some controllers doesn't have over 0x100 register.
81 * it is used to checking accessibility of
82 * CTL_SD_CARD_CLK_CTL / CTL_CLK_AND_WAIT_CTL
83 */
84#define TMIO_MMC_HAVE_HIGH_REG (1 << 6)
85
79int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); 86int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
80int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); 87int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
81void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state); 88void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
@@ -102,6 +109,7 @@ struct tmio_mmc_data {
102 unsigned long capabilities; 109 unsigned long capabilities;
103 unsigned long capabilities2; 110 unsigned long capabilities2;
104 unsigned long flags; 111 unsigned long flags;
112 unsigned long bus_shift;
105 u32 ocr_mask; /* available voltages */ 113 u32 ocr_mask; /* available voltages */
106 struct tmio_mmc_dma *dma; 114 struct tmio_mmc_dma *dma;
107 struct device *dev; 115 struct device *dev;
diff --git a/include/linux/mfd/tps6586x.h b/include/linux/mfd/tps6586x.h
index 87994542573b..cbecec2e353a 100644
--- a/include/linux/mfd/tps6586x.h
+++ b/include/linux/mfd/tps6586x.h
@@ -13,6 +13,12 @@
13#define TPS6586X_SLEW_RATE_SET 0x08 13#define TPS6586X_SLEW_RATE_SET 0x08
14#define TPS6586X_SLEW_RATE_MASK 0x07 14#define TPS6586X_SLEW_RATE_MASK 0x07
15 15
16/* VERSION CRC */
17#define TPS658621A 0x15
18#define TPS658621CD 0x2c
19#define TPS658623 0x1b
20#define TPS658643 0x03
21
16enum { 22enum {
17 TPS6586X_ID_SYS, 23 TPS6586X_ID_SYS,
18 TPS6586X_ID_SM_0, 24 TPS6586X_ID_SM_0,
@@ -97,5 +103,6 @@ extern int tps6586x_clr_bits(struct device *dev, int reg, uint8_t bit_mask);
97extern int tps6586x_update(struct device *dev, int reg, uint8_t val, 103extern int tps6586x_update(struct device *dev, int reg, uint8_t val,
98 uint8_t mask); 104 uint8_t mask);
99extern int tps6586x_irq_get_virq(struct device *dev, int irq); 105extern int tps6586x_irq_get_virq(struct device *dev, int irq);
106extern int tps6586x_get_version(struct device *dev);
100 107
101#endif /*__LINUX_MFD_TPS6586X_H */ 108#endif /*__LINUX_MFD_TPS6586X_H */
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h
index 20e433e551e3..16c2335c2856 100644
--- a/include/linux/mfd/tps65910.h
+++ b/include/linux/mfd/tps65910.h
@@ -358,8 +358,6 @@
358/*Register BBCH (0x80) register.RegisterDescription */ 358/*Register BBCH (0x80) register.RegisterDescription */
359#define BBCH_BBSEL_MASK 0x06 359#define BBCH_BBSEL_MASK 0x06
360#define BBCH_BBSEL_SHIFT 1 360#define BBCH_BBSEL_SHIFT 1
361#define BBCH_BBCHEN_MASK 0x01
362#define BBCH_BBCHEN_SHIFT 0
363 361
364 362
365/*Register DCDCCTRL (0x80) register.RegisterDescription */ 363/*Register DCDCCTRL (0x80) register.RegisterDescription */
@@ -833,6 +831,7 @@
833#define TPS65910_REG_VAUX2 10 831#define TPS65910_REG_VAUX2 10
834#define TPS65910_REG_VAUX33 11 832#define TPS65910_REG_VAUX33 11
835#define TPS65910_REG_VMMC 12 833#define TPS65910_REG_VMMC 12
834#define TPS65910_REG_VBB 13
836 835
837#define TPS65911_REG_VDDCTRL 4 836#define TPS65911_REG_VDDCTRL 4
838#define TPS65911_REG_LDO1 5 837#define TPS65911_REG_LDO1 5
@@ -845,7 +844,7 @@
845#define TPS65911_REG_LDO8 12 844#define TPS65911_REG_LDO8 12
846 845
847/* Max number of TPS65910/11 regulators */ 846/* Max number of TPS65910/11 regulators */
848#define TPS65910_NUM_REGS 13 847#define TPS65910_NUM_REGS 14
849 848
850/* External sleep controls through EN1/EN2/EN3/SLEEP inputs */ 849/* External sleep controls through EN1/EN2/EN3/SLEEP inputs */
851#define TPS65910_SLEEP_CONTROL_EXT_INPUT_EN1 0x1 850#define TPS65910_SLEEP_CONTROL_EXT_INPUT_EN1 0x1
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index f5096b58b20d..84a31ad0b791 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -35,16 +35,12 @@ enum migrate_reason {
35 35
36#ifdef CONFIG_MIGRATION 36#ifdef CONFIG_MIGRATION
37 37
38extern void putback_lru_pages(struct list_head *l);
39extern void putback_movable_pages(struct list_head *l); 38extern void putback_movable_pages(struct list_head *l);
40extern int migrate_page(struct address_space *, 39extern int migrate_page(struct address_space *,
41 struct page *, struct page *, enum migrate_mode); 40 struct page *, struct page *, enum migrate_mode);
42extern int migrate_pages(struct list_head *l, new_page_t x, 41extern int migrate_pages(struct list_head *l, new_page_t x,
43 unsigned long private, enum migrate_mode mode, int reason); 42 unsigned long private, enum migrate_mode mode, int reason);
44 43
45extern int fail_migrate_page(struct address_space *,
46 struct page *, struct page *);
47
48extern int migrate_prep(void); 44extern int migrate_prep(void);
49extern int migrate_prep_local(void); 45extern int migrate_prep_local(void);
50extern int migrate_vmas(struct mm_struct *mm, 46extern int migrate_vmas(struct mm_struct *mm,
@@ -55,10 +51,10 @@ extern int migrate_huge_page_move_mapping(struct address_space *mapping,
55 struct page *newpage, struct page *page); 51 struct page *newpage, struct page *page);
56extern int migrate_page_move_mapping(struct address_space *mapping, 52extern int migrate_page_move_mapping(struct address_space *mapping,
57 struct page *newpage, struct page *page, 53 struct page *newpage, struct page *page,
58 struct buffer_head *head, enum migrate_mode mode); 54 struct buffer_head *head, enum migrate_mode mode,
55 int extra_count);
59#else 56#else
60 57
61static inline void putback_lru_pages(struct list_head *l) {}
62static inline void putback_movable_pages(struct list_head *l) {} 58static inline void putback_movable_pages(struct list_head *l) {}
63static inline int migrate_pages(struct list_head *l, new_page_t x, 59static inline int migrate_pages(struct list_head *l, new_page_t x,
64 unsigned long private, enum migrate_mode mode, int reason) 60 unsigned long private, enum migrate_mode mode, int reason)
@@ -85,15 +81,23 @@ static inline int migrate_huge_page_move_mapping(struct address_space *mapping,
85 81
86/* Possible settings for the migrate_page() method in address_operations */ 82/* Possible settings for the migrate_page() method in address_operations */
87#define migrate_page NULL 83#define migrate_page NULL
88#define fail_migrate_page NULL
89 84
90#endif /* CONFIG_MIGRATION */ 85#endif /* CONFIG_MIGRATION */
91 86
92#ifdef CONFIG_NUMA_BALANCING 87#ifdef CONFIG_NUMA_BALANCING
88extern bool pmd_trans_migrating(pmd_t pmd);
89extern void wait_migrate_huge_page(struct anon_vma *anon_vma, pmd_t *pmd);
93extern int migrate_misplaced_page(struct page *page, 90extern int migrate_misplaced_page(struct page *page,
94 struct vm_area_struct *vma, int node); 91 struct vm_area_struct *vma, int node);
95extern bool migrate_ratelimited(int node); 92extern bool migrate_ratelimited(int node);
96#else 93#else
94static inline bool pmd_trans_migrating(pmd_t pmd)
95{
96 return false;
97}
98static inline void wait_migrate_huge_page(struct anon_vma *anon_vma, pmd_t *pmd)
99{
100}
97static inline int migrate_misplaced_page(struct page *page, 101static inline int migrate_misplaced_page(struct page *page,
98 struct vm_area_struct *vma, int node) 102 struct vm_area_struct *vma, int node)
99{ 103{
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index f7eaf2d60083..3737f7218f51 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -30,6 +30,7 @@
30#define STORE_QUEUE_MINOR 155 30#define STORE_QUEUE_MINOR 155
31#define I2O_MINOR 166 31#define I2O_MINOR 166
32#define MICROCODE_MINOR 184 32#define MICROCODE_MINOR 184
33#define VFIO_MINOR 196
33#define TUN_MINOR 200 34#define TUN_MINOR 200
34#define CUSE_MINOR 203 35#define CUSE_MINOR 203
35#define MWAVE_MINOR 219 /* ACP/Mwave Modem */ 36#define MWAVE_MINOR 219 /* ACP/Mwave Modem */
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h
index 8df61bc5da00..79a347238168 100644
--- a/include/linux/mlx4/cmd.h
+++ b/include/linux/mlx4/cmd.h
@@ -157,6 +157,7 @@ enum {
157 /* register/delete flow steering network rules */ 157 /* register/delete flow steering network rules */
158 MLX4_QP_FLOW_STEERING_ATTACH = 0x65, 158 MLX4_QP_FLOW_STEERING_ATTACH = 0x65,
159 MLX4_QP_FLOW_STEERING_DETACH = 0x66, 159 MLX4_QP_FLOW_STEERING_DETACH = 0x66,
160 MLX4_FLOW_STEERING_IB_UC_QP_RANGE = 0x64,
160}; 161};
161 162
162enum { 163enum {
@@ -180,6 +181,7 @@ enum {
180 MLX4_SET_PORT_GID_TABLE = 0x5, 181 MLX4_SET_PORT_GID_TABLE = 0x5,
181 MLX4_SET_PORT_PRIO2TC = 0x8, 182 MLX4_SET_PORT_PRIO2TC = 0x8,
182 MLX4_SET_PORT_SCHEDULER = 0x9, 183 MLX4_SET_PORT_SCHEDULER = 0x9,
184 MLX4_SET_PORT_VXLAN = 0xB
183}; 185};
184 186
185enum { 187enum {
diff --git a/include/linux/mlx4/cq.h b/include/linux/mlx4/cq.h
index 98fa492cf406..e7ecc12a1163 100644
--- a/include/linux/mlx4/cq.h
+++ b/include/linux/mlx4/cq.h
@@ -34,6 +34,7 @@
34#define MLX4_CQ_H 34#define MLX4_CQ_H
35 35
36#include <linux/types.h> 36#include <linux/types.h>
37#include <uapi/linux/if_ether.h>
37 38
38#include <linux/mlx4/device.h> 39#include <linux/mlx4/device.h>
39#include <linux/mlx4/doorbell.h> 40#include <linux/mlx4/doorbell.h>
@@ -43,10 +44,15 @@ struct mlx4_cqe {
43 __be32 immed_rss_invalid; 44 __be32 immed_rss_invalid;
44 __be32 g_mlpath_rqpn; 45 __be32 g_mlpath_rqpn;
45 __be16 sl_vid; 46 __be16 sl_vid;
46 __be16 rlid; 47 union {
47 __be16 status; 48 struct {
48 u8 ipv6_ext_mask; 49 __be16 rlid;
49 u8 badfcs_enc; 50 __be16 status;
51 u8 ipv6_ext_mask;
52 u8 badfcs_enc;
53 };
54 u8 smac[ETH_ALEN];
55 };
50 __be32 byte_cnt; 56 __be32 byte_cnt;
51 __be16 wqe_index; 57 __be16 wqe_index;
52 __be16 checksum; 58 __be16 checksum;
@@ -81,8 +87,14 @@ struct mlx4_ts_cqe {
81} __packed; 87} __packed;
82 88
83enum { 89enum {
90 MLX4_CQE_L2_TUNNEL_IPOK = 1 << 31,
84 MLX4_CQE_VLAN_PRESENT_MASK = 1 << 29, 91 MLX4_CQE_VLAN_PRESENT_MASK = 1 << 29,
92 MLX4_CQE_L2_TUNNEL = 1 << 27,
93 MLX4_CQE_L2_TUNNEL_CSUM = 1 << 26,
94 MLX4_CQE_L2_TUNNEL_IPV4 = 1 << 25,
95
85 MLX4_CQE_QPN_MASK = 0xffffff, 96 MLX4_CQE_QPN_MASK = 0xffffff,
97 MLX4_CQE_VID_MASK = 0xfff,
86}; 98};
87 99
88enum { 100enum {
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 7d3a523160ba..5edd2c68274d 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -119,6 +119,11 @@ static inline const char *mlx4_steering_mode_str(int steering_mode)
119} 119}
120 120
121enum { 121enum {
122 MLX4_TUNNEL_OFFLOAD_MODE_NONE,
123 MLX4_TUNNEL_OFFLOAD_MODE_VXLAN
124};
125
126enum {
122 MLX4_DEV_CAP_FLAG_RC = 1LL << 0, 127 MLX4_DEV_CAP_FLAG_RC = 1LL << 0,
123 MLX4_DEV_CAP_FLAG_UC = 1LL << 1, 128 MLX4_DEV_CAP_FLAG_UC = 1LL << 1,
124 MLX4_DEV_CAP_FLAG_UD = 1LL << 2, 129 MLX4_DEV_CAP_FLAG_UD = 1LL << 2,
@@ -160,7 +165,9 @@ enum {
160 MLX4_DEV_CAP_FLAG2_TS = 1LL << 5, 165 MLX4_DEV_CAP_FLAG2_TS = 1LL << 5,
161 MLX4_DEV_CAP_FLAG2_VLAN_CONTROL = 1LL << 6, 166 MLX4_DEV_CAP_FLAG2_VLAN_CONTROL = 1LL << 6,
162 MLX4_DEV_CAP_FLAG2_FSM = 1LL << 7, 167 MLX4_DEV_CAP_FLAG2_FSM = 1LL << 7,
163 MLX4_DEV_CAP_FLAG2_UPDATE_QP = 1LL << 8 168 MLX4_DEV_CAP_FLAG2_UPDATE_QP = 1LL << 8,
169 MLX4_DEV_CAP_FLAG2_DMFS_IPOIB = 1LL << 9,
170 MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS = 1LL << 10,
164}; 171};
165 172
166enum { 173enum {
@@ -454,6 +461,8 @@ struct mlx4_caps {
454 u32 userspace_caps; /* userspace must be aware of these */ 461 u32 userspace_caps; /* userspace must be aware of these */
455 u32 function_caps; /* VFs must be aware of these */ 462 u32 function_caps; /* VFs must be aware of these */
456 u16 hca_core_clock; 463 u16 hca_core_clock;
464 u64 phys_port_id[MLX4_MAX_PORTS + 1];
465 int tunnel_offload_mode;
457}; 466};
458 467
459struct mlx4_buf_list { 468struct mlx4_buf_list {
@@ -908,6 +917,7 @@ enum mlx4_net_trans_rule_id {
908 MLX4_NET_TRANS_RULE_ID_IPV4, 917 MLX4_NET_TRANS_RULE_ID_IPV4,
909 MLX4_NET_TRANS_RULE_ID_TCP, 918 MLX4_NET_TRANS_RULE_ID_TCP,
910 MLX4_NET_TRANS_RULE_ID_UDP, 919 MLX4_NET_TRANS_RULE_ID_UDP,
920 MLX4_NET_TRANS_RULE_ID_VXLAN,
911 MLX4_NET_TRANS_RULE_NUM, /* should be last */ 921 MLX4_NET_TRANS_RULE_NUM, /* should be last */
912}; 922};
913 923
@@ -965,6 +975,12 @@ struct mlx4_spec_ib {
965 u8 dst_gid_msk[16]; 975 u8 dst_gid_msk[16];
966}; 976};
967 977
978struct mlx4_spec_vxlan {
979 __be32 vni;
980 __be32 vni_mask;
981
982};
983
968struct mlx4_spec_list { 984struct mlx4_spec_list {
969 struct list_head list; 985 struct list_head list;
970 enum mlx4_net_trans_rule_id id; 986 enum mlx4_net_trans_rule_id id;
@@ -973,6 +989,7 @@ struct mlx4_spec_list {
973 struct mlx4_spec_ib ib; 989 struct mlx4_spec_ib ib;
974 struct mlx4_spec_ipv4 ipv4; 990 struct mlx4_spec_ipv4 ipv4;
975 struct mlx4_spec_tcp_udp tcp_udp; 991 struct mlx4_spec_tcp_udp tcp_udp;
992 struct mlx4_spec_vxlan vxlan;
976 }; 993 };
977}; 994};
978 995
@@ -1059,6 +1076,15 @@ struct mlx4_net_trans_rule_hw_ipv4 {
1059 __be32 src_ip_msk; 1076 __be32 src_ip_msk;
1060} __packed; 1077} __packed;
1061 1078
1079struct mlx4_net_trans_rule_hw_vxlan {
1080 u8 size;
1081 u8 rsvd;
1082 __be16 id;
1083 __be32 rsvd1;
1084 __be32 vni;
1085 __be32 vni_mask;
1086} __packed;
1087
1062struct _rule_hw { 1088struct _rule_hw {
1063 union { 1089 union {
1064 struct { 1090 struct {
@@ -1070,9 +1096,19 @@ struct _rule_hw {
1070 struct mlx4_net_trans_rule_hw_ib ib; 1096 struct mlx4_net_trans_rule_hw_ib ib;
1071 struct mlx4_net_trans_rule_hw_ipv4 ipv4; 1097 struct mlx4_net_trans_rule_hw_ipv4 ipv4;
1072 struct mlx4_net_trans_rule_hw_tcp_udp tcp_udp; 1098 struct mlx4_net_trans_rule_hw_tcp_udp tcp_udp;
1099 struct mlx4_net_trans_rule_hw_vxlan vxlan;
1073 }; 1100 };
1074}; 1101};
1075 1102
1103enum {
1104 VXLAN_STEER_BY_OUTER_MAC = 1 << 0,
1105 VXLAN_STEER_BY_OUTER_VLAN = 1 << 1,
1106 VXLAN_STEER_BY_VSID_VNI = 1 << 2,
1107 VXLAN_STEER_BY_INNER_MAC = 1 << 3,
1108 VXLAN_STEER_BY_INNER_VLAN = 1 << 4,
1109};
1110
1111
1076int mlx4_flow_steer_promisc_add(struct mlx4_dev *dev, u8 port, u32 qpn, 1112int mlx4_flow_steer_promisc_add(struct mlx4_dev *dev, u8 port, u32 qpn,
1077 enum mlx4_net_trans_promisc_mode mode); 1113 enum mlx4_net_trans_promisc_mode mode);
1078int mlx4_flow_steer_promisc_remove(struct mlx4_dev *dev, u8 port, 1114int mlx4_flow_steer_promisc_remove(struct mlx4_dev *dev, u8 port,
@@ -1095,6 +1131,8 @@ int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn,
1095int mlx4_SET_PORT_PRIO2TC(struct mlx4_dev *dev, u8 port, u8 *prio2tc); 1131int mlx4_SET_PORT_PRIO2TC(struct mlx4_dev *dev, u8 port, u8 *prio2tc);
1096int mlx4_SET_PORT_SCHEDULER(struct mlx4_dev *dev, u8 port, u8 *tc_tx_bw, 1132int mlx4_SET_PORT_SCHEDULER(struct mlx4_dev *dev, u8 port, u8 *tc_tx_bw,
1097 u8 *pg, u16 *ratelimit); 1133 u8 *pg, u16 *ratelimit);
1134int mlx4_SET_PORT_VXLAN(struct mlx4_dev *dev, u8 port, u8 steering);
1135int mlx4_find_cached_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *idx);
1098int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx); 1136int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx);
1099int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); 1137int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index);
1100void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, u16 vlan); 1138void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, u16 vlan);
@@ -1113,6 +1151,7 @@ int mlx4_assign_eq(struct mlx4_dev *dev, char *name, struct cpu_rmap *rmap,
1113 int *vector); 1151 int *vector);
1114void mlx4_release_eq(struct mlx4_dev *dev, int vec); 1152void mlx4_release_eq(struct mlx4_dev *dev, int vec);
1115 1153
1154int mlx4_get_phys_port_id(struct mlx4_dev *dev);
1116int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port); 1155int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port);
1117int mlx4_wol_write(struct mlx4_dev *dev, u64 config, int port); 1156int mlx4_wol_write(struct mlx4_dev *dev, u64 config, int port);
1118 1157
@@ -1144,6 +1183,9 @@ int set_and_calc_slave_port_state(struct mlx4_dev *dev, int slave, u8 port, int
1144void mlx4_put_slave_node_guid(struct mlx4_dev *dev, int slave, __be64 guid); 1183void mlx4_put_slave_node_guid(struct mlx4_dev *dev, int slave, __be64 guid);
1145__be64 mlx4_get_slave_node_guid(struct mlx4_dev *dev, int slave); 1184__be64 mlx4_get_slave_node_guid(struct mlx4_dev *dev, int slave);
1146 1185
1186int mlx4_FLOW_STEERING_IB_UC_QP_RANGE(struct mlx4_dev *dev, u32 min_range_qpn,
1187 u32 max_range_qpn);
1188
1147cycle_t mlx4_read_clock(struct mlx4_dev *dev); 1189cycle_t mlx4_read_clock(struct mlx4_dev *dev);
1148 1190
1149#endif /* MLX4_DEVICE_H */ 1191#endif /* MLX4_DEVICE_H */
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 6d351473c292..59f8ba84568b 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -109,6 +109,10 @@ enum {
109 MLX4_RSS_TCP_IPV4 = 1 << 4, 109 MLX4_RSS_TCP_IPV4 = 1 << 4,
110 MLX4_RSS_IPV4 = 1 << 5, 110 MLX4_RSS_IPV4 = 1 << 5,
111 111
112 MLX4_RSS_BY_OUTER_HEADERS = 0 << 6,
113 MLX4_RSS_BY_INNER_HEADERS = 2 << 6,
114 MLX4_RSS_BY_INNER_HEADERS_IPONLY = 3 << 6,
115
112 /* offset of mlx4_rss_context within mlx4_qp_context.pri_path */ 116 /* offset of mlx4_rss_context within mlx4_qp_context.pri_path */
113 MLX4_RSS_OFFSET_IN_QPC_PRI_PATH = 0x24, 117 MLX4_RSS_OFFSET_IN_QPC_PRI_PATH = 0x24,
114 /* offset of being RSS indirection QP within mlx4_qp_context.flags */ 118 /* offset of being RSS indirection QP within mlx4_qp_context.flags */
@@ -252,6 +256,8 @@ enum { /* param3 */
252 256
253enum { 257enum {
254 MLX4_WQE_CTRL_NEC = 1 << 29, 258 MLX4_WQE_CTRL_NEC = 1 << 29,
259 MLX4_WQE_CTRL_IIP = 1 << 28,
260 MLX4_WQE_CTRL_ILP = 1 << 27,
255 MLX4_WQE_CTRL_FENCE = 1 << 6, 261 MLX4_WQE_CTRL_FENCE = 1 << 6,
256 MLX4_WQE_CTRL_CQ_UPDATE = 3 << 2, 262 MLX4_WQE_CTRL_CQ_UPDATE = 3 << 2,
257 MLX4_WQE_CTRL_SOLICITED = 1 << 1, 263 MLX4_WQE_CTRL_SOLICITED = 1 << 1,
diff --git a/include/linux/mlx5/cq.h b/include/linux/mlx5/cq.h
index 3db67f73d96d..2202c7f72b75 100644
--- a/include/linux/mlx5/cq.h
+++ b/include/linux/mlx5/cq.h
@@ -79,15 +79,23 @@ enum {
79 MLX5_CQE_RESP_SEND = 2, 79 MLX5_CQE_RESP_SEND = 2,
80 MLX5_CQE_RESP_SEND_IMM = 3, 80 MLX5_CQE_RESP_SEND_IMM = 3,
81 MLX5_CQE_RESP_SEND_INV = 4, 81 MLX5_CQE_RESP_SEND_INV = 4,
82 MLX5_CQE_RESIZE_CQ = 0xff, /* TBD */ 82 MLX5_CQE_RESIZE_CQ = 5,
83 MLX5_CQE_REQ_ERR = 13, 83 MLX5_CQE_REQ_ERR = 13,
84 MLX5_CQE_RESP_ERR = 14, 84 MLX5_CQE_RESP_ERR = 14,
85 MLX5_CQE_INVALID = 15,
85}; 86};
86 87
87enum { 88enum {
88 MLX5_CQ_MODIFY_RESEIZE = 0, 89 MLX5_CQ_MODIFY_PERIOD = 1 << 0,
89 MLX5_CQ_MODIFY_MODER = 1, 90 MLX5_CQ_MODIFY_COUNT = 1 << 1,
90 MLX5_CQ_MODIFY_MAPPING = 2, 91 MLX5_CQ_MODIFY_OVERRUN = 1 << 2,
92};
93
94enum {
95 MLX5_CQ_OPMOD_RESIZE = 1,
96 MLX5_MODIFY_CQ_MASK_LOG_SIZE = 1 << 0,
97 MLX5_MODIFY_CQ_MASK_PG_OFFSET = 1 << 1,
98 MLX5_MODIFY_CQ_MASK_PG_SIZE = 1 << 2,
91}; 99};
92 100
93struct mlx5_cq_modify_params { 101struct mlx5_cq_modify_params {
@@ -158,7 +166,7 @@ int mlx5_core_destroy_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq);
158int mlx5_core_query_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, 166int mlx5_core_query_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq,
159 struct mlx5_query_cq_mbox_out *out); 167 struct mlx5_query_cq_mbox_out *out);
160int mlx5_core_modify_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, 168int mlx5_core_modify_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq,
161 int type, struct mlx5_cq_modify_params *params); 169 struct mlx5_modify_cq_mbox_in *in, int in_sz);
162int mlx5_debug_cq_add(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); 170int mlx5_debug_cq_add(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq);
163void mlx5_debug_cq_remove(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); 171void mlx5_debug_cq_remove(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq);
164 172
diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h
index da78875807fc..817a6fae6d2c 100644
--- a/include/linux/mlx5/device.h
+++ b/include/linux/mlx5/device.h
@@ -104,9 +104,10 @@ enum {
104}; 104};
105 105
106enum { 106enum {
107 MLX5_BF_REGS_PER_PAGE = 4, 107 MLX5_BF_REGS_PER_PAGE = 4,
108 MLX5_MAX_UAR_PAGES = 1 << 8, 108 MLX5_MAX_UAR_PAGES = 1 << 8,
109 MLX5_MAX_UUARS = MLX5_MAX_UAR_PAGES * MLX5_BF_REGS_PER_PAGE, 109 MLX5_NON_FP_BF_REGS_PER_PAGE = 2,
110 MLX5_MAX_UUARS = MLX5_MAX_UAR_PAGES * MLX5_NON_FP_BF_REGS_PER_PAGE,
110}; 111};
111 112
112enum { 113enum {
@@ -176,6 +177,8 @@ enum {
176 MLX5_DEV_CAP_FLAG_APM = 1LL << 17, 177 MLX5_DEV_CAP_FLAG_APM = 1LL << 17,
177 MLX5_DEV_CAP_FLAG_ATOMIC = 1LL << 18, 178 MLX5_DEV_CAP_FLAG_ATOMIC = 1LL << 18,
178 MLX5_DEV_CAP_FLAG_ON_DMND_PG = 1LL << 24, 179 MLX5_DEV_CAP_FLAG_ON_DMND_PG = 1LL << 24,
180 MLX5_DEV_CAP_FLAG_CQ_MODER = 1LL << 29,
181 MLX5_DEV_CAP_FLAG_RESIZE_CQ = 1LL << 30,
179 MLX5_DEV_CAP_FLAG_RESIZE_SRQ = 1LL << 32, 182 MLX5_DEV_CAP_FLAG_RESIZE_SRQ = 1LL << 32,
180 MLX5_DEV_CAP_FLAG_REMOTE_FENCE = 1LL << 38, 183 MLX5_DEV_CAP_FLAG_REMOTE_FENCE = 1LL << 38,
181 MLX5_DEV_CAP_FLAG_TLP_HINTS = 1LL << 39, 184 MLX5_DEV_CAP_FLAG_TLP_HINTS = 1LL << 39,
@@ -231,7 +234,8 @@ enum {
231}; 234};
232 235
233enum { 236enum {
234 MLX5_ADAPTER_PAGE_SHIFT = 12 237 MLX5_ADAPTER_PAGE_SHIFT = 12,
238 MLX5_ADAPTER_PAGE_SIZE = 1 << MLX5_ADAPTER_PAGE_SHIFT,
235}; 239};
236 240
237enum { 241enum {
@@ -697,6 +701,20 @@ struct mlx5_query_cq_mbox_out {
697 __be64 pas[0]; 701 __be64 pas[0];
698}; 702};
699 703
704struct mlx5_modify_cq_mbox_in {
705 struct mlx5_inbox_hdr hdr;
706 __be32 cqn;
707 __be32 field_select;
708 struct mlx5_cq_context ctx;
709 u8 rsvd[192];
710 __be64 pas[0];
711};
712
713struct mlx5_modify_cq_mbox_out {
714 struct mlx5_outbox_hdr hdr;
715 u8 rsvd[8];
716};
717
700struct mlx5_enable_hca_mbox_in { 718struct mlx5_enable_hca_mbox_in {
701 struct mlx5_inbox_hdr hdr; 719 struct mlx5_inbox_hdr hdr;
702 u8 rsvd[8]; 720 u8 rsvd[8];
@@ -831,8 +849,8 @@ struct mlx5_create_mkey_mbox_in {
831 struct mlx5_mkey_seg seg; 849 struct mlx5_mkey_seg seg;
832 u8 rsvd1[16]; 850 u8 rsvd1[16];
833 __be32 xlat_oct_act_size; 851 __be32 xlat_oct_act_size;
834 __be32 bsf_coto_act_size; 852 __be32 rsvd2;
835 u8 rsvd2[168]; 853 u8 rsvd3[168];
836 __be64 pas[0]; 854 __be64 pas[0];
837}; 855};
838 856
@@ -871,6 +889,7 @@ struct mlx5_modify_mkey_mbox_in {
871 889
872struct mlx5_modify_mkey_mbox_out { 890struct mlx5_modify_mkey_mbox_out {
873 struct mlx5_outbox_hdr hdr; 891 struct mlx5_outbox_hdr hdr;
892 u8 rsvd[8];
874}; 893};
875 894
876struct mlx5_dump_mkey_mbox_in { 895struct mlx5_dump_mkey_mbox_in {
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index 554548cd3dd4..130bc8d77fa5 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -38,8 +38,10 @@
38#include <linux/pci.h> 38#include <linux/pci.h>
39#include <linux/spinlock_types.h> 39#include <linux/spinlock_types.h>
40#include <linux/semaphore.h> 40#include <linux/semaphore.h>
41#include <linux/slab.h>
41#include <linux/vmalloc.h> 42#include <linux/vmalloc.h>
42#include <linux/radix-tree.h> 43#include <linux/radix-tree.h>
44
43#include <linux/mlx5/device.h> 45#include <linux/mlx5/device.h>
44#include <linux/mlx5/doorbell.h> 46#include <linux/mlx5/doorbell.h>
45 47
@@ -227,6 +229,7 @@ struct mlx5_uuar_info {
227 * protect uuar allocation data structs 229 * protect uuar allocation data structs
228 */ 230 */
229 struct mutex lock; 231 struct mutex lock;
232 u32 ver;
230}; 233};
231 234
232struct mlx5_bf { 235struct mlx5_bf {
diff --git a/include/linux/mlx5/qp.h b/include/linux/mlx5/qp.h
index d9e3eacb3a7f..d51eff713549 100644
--- a/include/linux/mlx5/qp.h
+++ b/include/linux/mlx5/qp.h
@@ -464,4 +464,49 @@ void mlx5_cleanup_qp_table(struct mlx5_core_dev *dev);
464int mlx5_debug_qp_add(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp); 464int mlx5_debug_qp_add(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp);
465void mlx5_debug_qp_remove(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp); 465void mlx5_debug_qp_remove(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp);
466 466
467static inline const char *mlx5_qp_type_str(int type)
468{
469 switch (type) {
470 case MLX5_QP_ST_RC: return "RC";
471 case MLX5_QP_ST_UC: return "C";
472 case MLX5_QP_ST_UD: return "UD";
473 case MLX5_QP_ST_XRC: return "XRC";
474 case MLX5_QP_ST_MLX: return "MLX";
475 case MLX5_QP_ST_QP0: return "QP0";
476 case MLX5_QP_ST_QP1: return "QP1";
477 case MLX5_QP_ST_RAW_ETHERTYPE: return "RAW_ETHERTYPE";
478 case MLX5_QP_ST_RAW_IPV6: return "RAW_IPV6";
479 case MLX5_QP_ST_SNIFFER: return "SNIFFER";
480 case MLX5_QP_ST_SYNC_UMR: return "SYNC_UMR";
481 case MLX5_QP_ST_PTP_1588: return "PTP_1588";
482 case MLX5_QP_ST_REG_UMR: return "REG_UMR";
483 default: return "Invalid transport type";
484 }
485}
486
487static inline const char *mlx5_qp_state_str(int state)
488{
489 switch (state) {
490 case MLX5_QP_STATE_RST:
491 return "RST";
492 case MLX5_QP_STATE_INIT:
493 return "INIT";
494 case MLX5_QP_STATE_RTR:
495 return "RTR";
496 case MLX5_QP_STATE_RTS:
497 return "RTS";
498 case MLX5_QP_STATE_SQER:
499 return "SQER";
500 case MLX5_QP_STATE_SQD:
501 return "SQD";
502 case MLX5_QP_STATE_ERR:
503 return "ERR";
504 case MLX5_QP_STATE_SQ_DRAINING:
505 return "SQ_DRAINING";
506 case MLX5_QP_STATE_SUSPENDED:
507 return "SUSPENDED";
508 default: return "Invalid QP state";
509 }
510}
511
467#endif /* MLX5_QP_H */ 512#endif /* MLX5_QP_H */
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 1cedd000cf29..f28f46eade6a 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -5,6 +5,7 @@
5 5
6#ifdef __KERNEL__ 6#ifdef __KERNEL__
7 7
8#include <linux/mmdebug.h>
8#include <linux/gfp.h> 9#include <linux/gfp.h>
9#include <linux/bug.h> 10#include <linux/bug.h>
10#include <linux/list.h> 11#include <linux/list.h>
@@ -57,6 +58,15 @@ extern int sysctl_legacy_va_layout;
57extern unsigned long sysctl_user_reserve_kbytes; 58extern unsigned long sysctl_user_reserve_kbytes;
58extern unsigned long sysctl_admin_reserve_kbytes; 59extern unsigned long sysctl_admin_reserve_kbytes;
59 60
61extern int sysctl_overcommit_memory;
62extern int sysctl_overcommit_ratio;
63extern unsigned long sysctl_overcommit_kbytes;
64
65extern int overcommit_ratio_handler(struct ctl_table *, int, void __user *,
66 size_t *, loff_t *);
67extern int overcommit_kbytes_handler(struct ctl_table *, int, void __user *,
68 size_t *, loff_t *);
69
60#define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n)) 70#define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n))
61 71
62/* to align the pointer to the (next) page boundary */ 72/* to align the pointer to the (next) page boundary */
@@ -294,7 +304,7 @@ static inline int get_freepage_migratetype(struct page *page)
294 */ 304 */
295static inline int put_page_testzero(struct page *page) 305static inline int put_page_testzero(struct page *page)
296{ 306{
297 VM_BUG_ON(atomic_read(&page->_count) == 0); 307 VM_BUG_ON_PAGE(atomic_read(&page->_count) == 0, page);
298 return atomic_dec_and_test(&page->_count); 308 return atomic_dec_and_test(&page->_count);
299} 309}
300 310
@@ -355,7 +365,7 @@ static inline int is_vmalloc_or_module_addr(const void *x)
355static inline void compound_lock(struct page *page) 365static inline void compound_lock(struct page *page)
356{ 366{
357#ifdef CONFIG_TRANSPARENT_HUGEPAGE 367#ifdef CONFIG_TRANSPARENT_HUGEPAGE
358 VM_BUG_ON(PageSlab(page)); 368 VM_BUG_ON_PAGE(PageSlab(page), page);
359 bit_spin_lock(PG_compound_lock, &page->flags); 369 bit_spin_lock(PG_compound_lock, &page->flags);
360#endif 370#endif
361} 371}
@@ -363,7 +373,7 @@ static inline void compound_lock(struct page *page)
363static inline void compound_unlock(struct page *page) 373static inline void compound_unlock(struct page *page)
364{ 374{
365#ifdef CONFIG_TRANSPARENT_HUGEPAGE 375#ifdef CONFIG_TRANSPARENT_HUGEPAGE
366 VM_BUG_ON(PageSlab(page)); 376 VM_BUG_ON_PAGE(PageSlab(page), page);
367 bit_spin_unlock(PG_compound_lock, &page->flags); 377 bit_spin_unlock(PG_compound_lock, &page->flags);
368#endif 378#endif
369} 379}
@@ -414,15 +424,44 @@ static inline int page_count(struct page *page)
414 return atomic_read(&compound_head(page)->_count); 424 return atomic_read(&compound_head(page)->_count);
415} 425}
416 426
427#ifdef CONFIG_HUGETLB_PAGE
428extern int PageHeadHuge(struct page *page_head);
429#else /* CONFIG_HUGETLB_PAGE */
430static inline int PageHeadHuge(struct page *page_head)
431{
432 return 0;
433}
434#endif /* CONFIG_HUGETLB_PAGE */
435
436static inline bool __compound_tail_refcounted(struct page *page)
437{
438 return !PageSlab(page) && !PageHeadHuge(page);
439}
440
441/*
442 * This takes a head page as parameter and tells if the
443 * tail page reference counting can be skipped.
444 *
445 * For this to be safe, PageSlab and PageHeadHuge must remain true on
446 * any given page where they return true here, until all tail pins
447 * have been released.
448 */
449static inline bool compound_tail_refcounted(struct page *page)
450{
451 VM_BUG_ON_PAGE(!PageHead(page), page);
452 return __compound_tail_refcounted(page);
453}
454
417static inline void get_huge_page_tail(struct page *page) 455static inline void get_huge_page_tail(struct page *page)
418{ 456{
419 /* 457 /*
420 * __split_huge_page_refcount() cannot run 458 * __split_huge_page_refcount() cannot run from under us.
421 * from under us.
422 */ 459 */
423 VM_BUG_ON(page_mapcount(page) < 0); 460 VM_BUG_ON_PAGE(!PageTail(page), page);
424 VM_BUG_ON(atomic_read(&page->_count) != 0); 461 VM_BUG_ON_PAGE(page_mapcount(page) < 0, page);
425 atomic_inc(&page->_mapcount); 462 VM_BUG_ON_PAGE(atomic_read(&page->_count) != 0, page);
463 if (compound_tail_refcounted(page->first_page))
464 atomic_inc(&page->_mapcount);
426} 465}
427 466
428extern bool __get_page_tail(struct page *page); 467extern bool __get_page_tail(struct page *page);
@@ -436,7 +475,7 @@ static inline void get_page(struct page *page)
436 * Getting a normal page or the head of a compound page 475 * Getting a normal page or the head of a compound page
437 * requires to already have an elevated page->_count. 476 * requires to already have an elevated page->_count.
438 */ 477 */
439 VM_BUG_ON(atomic_read(&page->_count) <= 0); 478 VM_BUG_ON_PAGE(atomic_read(&page->_count) <= 0, page);
440 atomic_inc(&page->_count); 479 atomic_inc(&page->_count);
441} 480}
442 481
@@ -473,13 +512,13 @@ static inline int PageBuddy(struct page *page)
473 512
474static inline void __SetPageBuddy(struct page *page) 513static inline void __SetPageBuddy(struct page *page)
475{ 514{
476 VM_BUG_ON(atomic_read(&page->_mapcount) != -1); 515 VM_BUG_ON_PAGE(atomic_read(&page->_mapcount) != -1, page);
477 atomic_set(&page->_mapcount, PAGE_BUDDY_MAPCOUNT_VALUE); 516 atomic_set(&page->_mapcount, PAGE_BUDDY_MAPCOUNT_VALUE);
478} 517}
479 518
480static inline void __ClearPageBuddy(struct page *page) 519static inline void __ClearPageBuddy(struct page *page)
481{ 520{
482 VM_BUG_ON(!PageBuddy(page)); 521 VM_BUG_ON_PAGE(!PageBuddy(page), page);
483 atomic_set(&page->_mapcount, -1); 522 atomic_set(&page->_mapcount, -1);
484} 523}
485 524
@@ -846,11 +885,14 @@ static __always_inline void *lowmem_page_address(const struct page *page)
846#endif 885#endif
847 886
848#if defined(WANT_PAGE_VIRTUAL) 887#if defined(WANT_PAGE_VIRTUAL)
849#define page_address(page) ((page)->virtual) 888static inline void *page_address(const struct page *page)
850#define set_page_address(page, address) \ 889{
851 do { \ 890 return page->virtual;
852 (page)->virtual = (address); \ 891}
853 } while(0) 892static inline void set_page_address(struct page *page, void *address)
893{
894 page->virtual = address;
895}
854#define page_address_init() do { } while(0) 896#define page_address_init() do { } while(0)
855#endif 897#endif
856 898
@@ -984,7 +1026,6 @@ extern void pagefault_out_of_memory(void);
984 * various contexts. 1026 * various contexts.
985 */ 1027 */
986#define SHOW_MEM_FILTER_NODES (0x0001u) /* disallowed nodes */ 1028#define SHOW_MEM_FILTER_NODES (0x0001u) /* disallowed nodes */
987#define SHOW_MEM_FILTER_PAGE_COUNT (0x0002u) /* page type count */
988 1029
989extern void show_free_areas(unsigned int flags); 1030extern void show_free_areas(unsigned int flags);
990extern bool skip_free_areas_node(unsigned int flags, int nid); 1031extern bool skip_free_areas_node(unsigned int flags, int nid);
@@ -1317,7 +1358,8 @@ static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long a
1317#endif /* CONFIG_MMU && !__ARCH_HAS_4LEVEL_HACK */ 1358#endif /* CONFIG_MMU && !__ARCH_HAS_4LEVEL_HACK */
1318 1359
1319#if USE_SPLIT_PTE_PTLOCKS 1360#if USE_SPLIT_PTE_PTLOCKS
1320#if BLOATED_SPINLOCKS 1361#if ALLOC_SPLIT_PTLOCKS
1362void __init ptlock_cache_init(void);
1321extern bool ptlock_alloc(struct page *page); 1363extern bool ptlock_alloc(struct page *page);
1322extern void ptlock_free(struct page *page); 1364extern void ptlock_free(struct page *page);
1323 1365
@@ -1325,7 +1367,11 @@ static inline spinlock_t *ptlock_ptr(struct page *page)
1325{ 1367{
1326 return page->ptl; 1368 return page->ptl;
1327} 1369}
1328#else /* BLOATED_SPINLOCKS */ 1370#else /* ALLOC_SPLIT_PTLOCKS */
1371static inline void ptlock_cache_init(void)
1372{
1373}
1374
1329static inline bool ptlock_alloc(struct page *page) 1375static inline bool ptlock_alloc(struct page *page)
1330{ 1376{
1331 return true; 1377 return true;
@@ -1339,7 +1385,7 @@ static inline spinlock_t *ptlock_ptr(struct page *page)
1339{ 1385{
1340 return &page->ptl; 1386 return &page->ptl;
1341} 1387}
1342#endif /* BLOATED_SPINLOCKS */ 1388#endif /* ALLOC_SPLIT_PTLOCKS */
1343 1389
1344static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd) 1390static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd)
1345{ 1391{
@@ -1356,7 +1402,7 @@ static inline bool ptlock_init(struct page *page)
1356 * slab code uses page->slab_cache and page->first_page (for tail 1402 * slab code uses page->slab_cache and page->first_page (for tail
1357 * pages), which share storage with page->ptl. 1403 * pages), which share storage with page->ptl.
1358 */ 1404 */
1359 VM_BUG_ON(*(unsigned long *)&page->ptl); 1405 VM_BUG_ON_PAGE(*(unsigned long *)&page->ptl, page);
1360 if (!ptlock_alloc(page)) 1406 if (!ptlock_alloc(page))
1361 return false; 1407 return false;
1362 spin_lock_init(ptlock_ptr(page)); 1408 spin_lock_init(ptlock_ptr(page));
@@ -1378,10 +1424,17 @@ static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd)
1378{ 1424{
1379 return &mm->page_table_lock; 1425 return &mm->page_table_lock;
1380} 1426}
1427static inline void ptlock_cache_init(void) {}
1381static inline bool ptlock_init(struct page *page) { return true; } 1428static inline bool ptlock_init(struct page *page) { return true; }
1382static inline void pte_lock_deinit(struct page *page) {} 1429static inline void pte_lock_deinit(struct page *page) {}
1383#endif /* USE_SPLIT_PTE_PTLOCKS */ 1430#endif /* USE_SPLIT_PTE_PTLOCKS */
1384 1431
1432static inline void pgtable_init(void)
1433{
1434 ptlock_cache_init();
1435 pgtable_cache_init();
1436}
1437
1385static inline bool pgtable_page_ctor(struct page *page) 1438static inline bool pgtable_page_ctor(struct page *page)
1386{ 1439{
1387 inc_zone_page_state(page, NR_PAGETABLE); 1440 inc_zone_page_state(page, NR_PAGETABLE);
@@ -1440,7 +1493,7 @@ static inline bool pgtable_pmd_page_ctor(struct page *page)
1440static inline void pgtable_pmd_page_dtor(struct page *page) 1493static inline void pgtable_pmd_page_dtor(struct page *page)
1441{ 1494{
1442#ifdef CONFIG_TRANSPARENT_HUGEPAGE 1495#ifdef CONFIG_TRANSPARENT_HUGEPAGE
1443 VM_BUG_ON(page->pmd_huge_pte); 1496 VM_BUG_ON_PAGE(page->pmd_huge_pte, page);
1444#endif 1497#endif
1445 ptlock_free(page); 1498 ptlock_free(page);
1446} 1499}
@@ -1842,7 +1895,7 @@ static inline pgprot_t vm_get_page_prot(unsigned long vm_flags)
1842} 1895}
1843#endif 1896#endif
1844 1897
1845#ifdef CONFIG_ARCH_USES_NUMA_PROT_NONE 1898#ifdef CONFIG_NUMA_BALANCING
1846unsigned long change_prot_numa(struct vm_area_struct *vma, 1899unsigned long change_prot_numa(struct vm_area_struct *vma,
1847 unsigned long start, unsigned long end); 1900 unsigned long start, unsigned long end);
1848#endif 1901#endif
@@ -1977,8 +2030,6 @@ extern void shake_page(struct page *p, int access);
1977extern atomic_long_t num_poisoned_pages; 2030extern atomic_long_t num_poisoned_pages;
1978extern int soft_offline_page(struct page *page, int flags); 2031extern int soft_offline_page(struct page *page, int flags);
1979 2032
1980extern void dump_page(struct page *page);
1981
1982#if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLBFS) 2033#if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLBFS)
1983extern void clear_huge_page(struct page *page, 2034extern void clear_huge_page(struct page *page,
1984 unsigned long addr, 2035 unsigned long addr,
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index bd299418a934..290901a8c1de 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -26,6 +26,7 @@ struct address_space;
26#define USE_SPLIT_PTE_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS) 26#define USE_SPLIT_PTE_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS)
27#define USE_SPLIT_PMD_PTLOCKS (USE_SPLIT_PTE_PTLOCKS && \ 27#define USE_SPLIT_PMD_PTLOCKS (USE_SPLIT_PTE_PTLOCKS && \
28 IS_ENABLED(CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK)) 28 IS_ENABLED(CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK))
29#define ALLOC_SPLIT_PTLOCKS (SPINLOCK_SIZE > BITS_PER_LONG/8)
29 30
30/* 31/*
31 * Each physical page in the system has a struct page associated with 32 * Each physical page in the system has a struct page associated with
@@ -155,7 +156,7 @@ struct page {
155 * system if PG_buddy is set. 156 * system if PG_buddy is set.
156 */ 157 */
157#if USE_SPLIT_PTE_PTLOCKS 158#if USE_SPLIT_PTE_PTLOCKS
158#if BLOATED_SPINLOCKS 159#if ALLOC_SPLIT_PTLOCKS
159 spinlock_t *ptl; 160 spinlock_t *ptl;
160#else 161#else
161 spinlock_t ptl; 162 spinlock_t ptl;
@@ -443,6 +444,14 @@ struct mm_struct {
443 /* numa_scan_seq prevents two threads setting pte_numa */ 444 /* numa_scan_seq prevents two threads setting pte_numa */
444 int numa_scan_seq; 445 int numa_scan_seq;
445#endif 446#endif
447#if defined(CONFIG_NUMA_BALANCING) || defined(CONFIG_COMPACTION)
448 /*
449 * An operation with batched TLB flushing is going on. Anything that
450 * can move process memory needs to flush the TLB when moving a
451 * PROT_NONE or PROT_NUMA mapped page.
452 */
453 bool tlb_flush_pending;
454#endif
446 struct uprobes_state uprobes_state; 455 struct uprobes_state uprobes_state;
447}; 456};
448 457
@@ -459,4 +468,45 @@ static inline cpumask_t *mm_cpumask(struct mm_struct *mm)
459 return mm->cpu_vm_mask_var; 468 return mm->cpu_vm_mask_var;
460} 469}
461 470
471#if defined(CONFIG_NUMA_BALANCING) || defined(CONFIG_COMPACTION)
472/*
473 * Memory barriers to keep this state in sync are graciously provided by
474 * the page table locks, outside of which no page table modifications happen.
475 * The barriers below prevent the compiler from re-ordering the instructions
476 * around the memory barriers that are already present in the code.
477 */
478static inline bool mm_tlb_flush_pending(struct mm_struct *mm)
479{
480 barrier();
481 return mm->tlb_flush_pending;
482}
483static inline void set_tlb_flush_pending(struct mm_struct *mm)
484{
485 mm->tlb_flush_pending = true;
486
487 /*
488 * Guarantee that the tlb_flush_pending store does not leak into the
489 * critical section updating the page tables
490 */
491 smp_mb__before_spinlock();
492}
493/* Clearing is done after a TLB flush, which also provides a barrier. */
494static inline void clear_tlb_flush_pending(struct mm_struct *mm)
495{
496 barrier();
497 mm->tlb_flush_pending = false;
498}
499#else
500static inline bool mm_tlb_flush_pending(struct mm_struct *mm)
501{
502 return false;
503}
504static inline void set_tlb_flush_pending(struct mm_struct *mm)
505{
506}
507static inline void clear_tlb_flush_pending(struct mm_struct *mm)
508{
509}
510#endif
511
462#endif /* _LINUX_MM_TYPES_H */ 512#endif /* _LINUX_MM_TYPES_H */
diff --git a/include/linux/mman.h b/include/linux/mman.h
index 7f7f8dae4b1d..16373c8f5f57 100644
--- a/include/linux/mman.h
+++ b/include/linux/mman.h
@@ -9,6 +9,7 @@
9 9
10extern int sysctl_overcommit_memory; 10extern int sysctl_overcommit_memory;
11extern int sysctl_overcommit_ratio; 11extern int sysctl_overcommit_ratio;
12extern unsigned long sysctl_overcommit_kbytes;
12extern struct percpu_counter vm_committed_as; 13extern struct percpu_counter vm_committed_as;
13 14
14#ifdef CONFIG_SMP 15#ifdef CONFIG_SMP
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 176fdf824b14..b73027298b3a 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -271,9 +271,10 @@ struct mmc_card {
271#define MMC_QUIRK_INAND_CMD38 (1<<6) /* iNAND devices have broken CMD38 */ 271#define MMC_QUIRK_INAND_CMD38 (1<<6) /* iNAND devices have broken CMD38 */
272#define MMC_QUIRK_BLK_NO_CMD23 (1<<7) /* Avoid CMD23 for regular multiblock */ 272#define MMC_QUIRK_BLK_NO_CMD23 (1<<7) /* Avoid CMD23 for regular multiblock */
273#define MMC_QUIRK_BROKEN_BYTE_MODE_512 (1<<8) /* Avoid sending 512 bytes in */ 273#define MMC_QUIRK_BROKEN_BYTE_MODE_512 (1<<8) /* Avoid sending 512 bytes in */
274 /* byte mode */
274#define MMC_QUIRK_LONG_READ_TIME (1<<9) /* Data read time > CSD says */ 275#define MMC_QUIRK_LONG_READ_TIME (1<<9) /* Data read time > CSD says */
275#define MMC_QUIRK_SEC_ERASE_TRIM_BROKEN (1<<10) /* Skip secure for erase/trim */ 276#define MMC_QUIRK_SEC_ERASE_TRIM_BROKEN (1<<10) /* Skip secure for erase/trim */
276 /* byte mode */ 277#define MMC_QUIRK_BROKEN_IRQ_POLLING (1<<11) /* Polling SDIO_CCCR_INTx could create a fake interrupt */
277 278
278 unsigned int erase_size; /* erase size in sectors */ 279 unsigned int erase_size; /* erase size in sectors */
279 unsigned int erase_shift; /* if erase unit is power 2 */ 280 unsigned int erase_shift; /* if erase unit is power 2 */
@@ -505,6 +506,11 @@ static inline int mmc_card_long_read_time(const struct mmc_card *c)
505 return c->quirks & MMC_QUIRK_LONG_READ_TIME; 506 return c->quirks & MMC_QUIRK_LONG_READ_TIME;
506} 507}
507 508
509static inline int mmc_card_broken_irq_polling(const struct mmc_card *c)
510{
511 return c->quirks & MMC_QUIRK_BROKEN_IRQ_POLLING;
512}
513
508#define mmc_card_name(c) ((c)->cid.prod_name) 514#define mmc_card_name(c) ((c)->cid.prod_name)
509#define mmc_card_id(c) (dev_name(&(c)->dev)) 515#define mmc_card_id(c) (dev_name(&(c)->dev))
510 516
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index 3e781b8c0be7..362927c48f97 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -98,6 +98,8 @@ struct sdhci_host {
98#define SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON (1<<4) 98#define SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON (1<<4)
99/* Controller has a non-standard host control register */ 99/* Controller has a non-standard host control register */
100#define SDHCI_QUIRK2_BROKEN_HOST_CONTROL (1<<5) 100#define SDHCI_QUIRK2_BROKEN_HOST_CONTROL (1<<5)
101/* Controller does not support HS200 */
102#define SDHCI_QUIRK2_BROKEN_HS200 (1<<6)
101 103
102 int irq; /* Device IRQ */ 104 int irq; /* Device IRQ */
103 void __iomem *ioaddr; /* Mapped address */ 105 void __iomem *ioaddr; /* Mapped address */
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h
index 9f03feedc8e7..d8836623f36a 100644
--- a/include/linux/mmc/sdio_ids.h
+++ b/include/linux/mmc/sdio_ids.h
@@ -23,6 +23,15 @@
23/* 23/*
24 * Vendors and devices. Sort key: vendor first, device next. 24 * Vendors and devices. Sort key: vendor first, device next.
25 */ 25 */
26#define SDIO_VENDOR_ID_BROADCOM 0x02d0
27#define SDIO_DEVICE_ID_BROADCOM_43143 43143
28#define SDIO_DEVICE_ID_BROADCOM_43241 0x4324
29#define SDIO_DEVICE_ID_BROADCOM_4329 0x4329
30#define SDIO_DEVICE_ID_BROADCOM_4330 0x4330
31#define SDIO_DEVICE_ID_BROADCOM_4334 0x4334
32#define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335
33#define SDIO_DEVICE_ID_BROADCOM_43362 43362
34
26#define SDIO_VENDOR_ID_INTEL 0x0089 35#define SDIO_VENDOR_ID_INTEL 0x0089
27#define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX 0x1402 36#define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX 0x1402
28#define SDIO_DEVICE_ID_INTEL_IWMC3200WIFI 0x1403 37#define SDIO_DEVICE_ID_INTEL_IWMC3200WIFI 0x1403
diff --git a/include/linux/mmc/tmio.h b/include/linux/mmc/tmio.h
index a1c1f321e519..84d9053b5dca 100644
--- a/include/linux/mmc/tmio.h
+++ b/include/linux/mmc/tmio.h
@@ -33,6 +33,7 @@
33#define CTL_SDIO_IRQ_MASK 0x38 33#define CTL_SDIO_IRQ_MASK 0x38
34#define CTL_DMA_ENABLE 0xd8 34#define CTL_DMA_ENABLE 0xd8
35#define CTL_RESET_SD 0xe0 35#define CTL_RESET_SD 0xe0
36#define CTL_VERSION 0xe2
36#define CTL_SDIO_REGS 0x100 37#define CTL_SDIO_REGS 0x100
37#define CTL_CLK_AND_WAIT_CTL 0x138 38#define CTL_CLK_AND_WAIT_CTL 0x138
38#define CTL_RESET_SDIO 0x1e0 39#define CTL_RESET_SDIO 0x1e0
diff --git a/include/linux/mmdebug.h b/include/linux/mmdebug.h
index 580bd587d916..5042c036dda9 100644
--- a/include/linux/mmdebug.h
+++ b/include/linux/mmdebug.h
@@ -1,10 +1,19 @@
1#ifndef LINUX_MM_DEBUG_H 1#ifndef LINUX_MM_DEBUG_H
2#define LINUX_MM_DEBUG_H 1 2#define LINUX_MM_DEBUG_H 1
3 3
4struct page;
5
6extern void dump_page(struct page *page, char *reason);
7extern void dump_page_badflags(struct page *page, char *reason,
8 unsigned long badflags);
9
4#ifdef CONFIG_DEBUG_VM 10#ifdef CONFIG_DEBUG_VM
5#define VM_BUG_ON(cond) BUG_ON(cond) 11#define VM_BUG_ON(cond) BUG_ON(cond)
12#define VM_BUG_ON_PAGE(cond, page) \
13 do { if (unlikely(cond)) { dump_page(page, NULL); BUG(); } } while (0)
6#else 14#else
7#define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond) 15#define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond)
16#define VM_BUG_ON_PAGE(cond, page) VM_BUG_ON(cond)
8#endif 17#endif
9 18
10#ifdef CONFIG_DEBUG_VIRTUAL 19#ifdef CONFIG_DEBUG_VIRTUAL
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index bd791e452ad7..5f2052c83154 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -490,6 +490,12 @@ struct zone {
490 unsigned long managed_pages; 490 unsigned long managed_pages;
491 491
492 /* 492 /*
493 * Number of MIGRATE_RESEVE page block. To maintain for just
494 * optimization. Protected by zone->lock.
495 */
496 int nr_migrate_reserve_block;
497
498 /*
493 * rarely used fields: 499 * rarely used fields:
494 */ 500 */
495 const char *name; 501 const char *name;
@@ -758,10 +764,7 @@ typedef struct pglist_data {
758 int kswapd_max_order; 764 int kswapd_max_order;
759 enum zone_type classzone_idx; 765 enum zone_type classzone_idx;
760#ifdef CONFIG_NUMA_BALANCING 766#ifdef CONFIG_NUMA_BALANCING
761 /* 767 /* Lock serializing the migrate rate limiting window */
762 * Lock serializing the per destination node AutoNUMA memory
763 * migration rate limiting data.
764 */
765 spinlock_t numabalancing_migrate_lock; 768 spinlock_t numabalancing_migrate_lock;
766 769
767 /* Rate limiting time interval */ 770 /* Rate limiting time interval */
diff --git a/include/linux/module.h b/include/linux/module.h
index 15cd6b1b211e..eaf60ff9ba94 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -29,8 +29,7 @@
29 29
30#define MODULE_NAME_LEN MAX_PARAM_PREFIX_LEN 30#define MODULE_NAME_LEN MAX_PARAM_PREFIX_LEN
31 31
32struct modversion_info 32struct modversion_info {
33{
34 unsigned long crc; 33 unsigned long crc;
35 char name[MODULE_NAME_LEN]; 34 char name[MODULE_NAME_LEN];
36}; 35};
@@ -84,12 +83,12 @@ void sort_main_extable(void);
84void trim_init_extable(struct module *m); 83void trim_init_extable(struct module *m);
85 84
86#ifdef MODULE 85#ifdef MODULE
87#define MODULE_GENERIC_TABLE(gtype,name) \ 86#define MODULE_GENERIC_TABLE(gtype, name) \
88extern const struct gtype##_id __mod_##gtype##_table \ 87extern const struct gtype##_id __mod_##gtype##_table \
89 __attribute__ ((unused, alias(__stringify(name)))) 88 __attribute__ ((unused, alias(__stringify(name))))
90 89
91#else /* !MODULE */ 90#else /* !MODULE */
92#define MODULE_GENERIC_TABLE(gtype,name) 91#define MODULE_GENERIC_TABLE(gtype, name)
93#endif 92#endif
94 93
95/* Generic info of form tag = "info" */ 94/* Generic info of form tag = "info" */
@@ -126,7 +125,7 @@ extern const struct gtype##_id __mod_##gtype##_table \
126 * is a GPL combined work. 125 * is a GPL combined work.
127 * 126 *
128 * This exists for several reasons 127 * This exists for several reasons
129 * 1. So modinfo can show license info for users wanting to vet their setup 128 * 1. So modinfo can show license info for users wanting to vet their setup
130 * is free 129 * is free
131 * 2. So the community can ignore bug reports including proprietary modules 130 * 2. So the community can ignore bug reports including proprietary modules
132 * 3. So vendors can do likewise based on their own policies 131 * 3. So vendors can do likewise based on their own policies
@@ -138,27 +137,29 @@ extern const struct gtype##_id __mod_##gtype##_table \
138 * authors use multiple MODULE_AUTHOR() statements/lines. 137 * authors use multiple MODULE_AUTHOR() statements/lines.
139 */ 138 */
140#define MODULE_AUTHOR(_author) MODULE_INFO(author, _author) 139#define MODULE_AUTHOR(_author) MODULE_INFO(author, _author)
141 140
142/* What your module does. */ 141/* What your module does. */
143#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description) 142#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description)
144 143
145#define MODULE_DEVICE_TABLE(type,name) \ 144#define MODULE_DEVICE_TABLE(type, name) \
146 MODULE_GENERIC_TABLE(type##_device,name) 145 MODULE_GENERIC_TABLE(type##_device, name)
147 146
148/* Version of form [<epoch>:]<version>[-<extra-version>]. 147/* Version of form [<epoch>:]<version>[-<extra-version>].
149 Or for CVS/RCS ID version, everything but the number is stripped. 148 * Or for CVS/RCS ID version, everything but the number is stripped.
150 <epoch>: A (small) unsigned integer which allows you to start versions 149 * <epoch>: A (small) unsigned integer which allows you to start versions
151 anew. If not mentioned, it's zero. eg. "2:1.0" is after 150 * anew. If not mentioned, it's zero. eg. "2:1.0" is after
152 "1:2.0". 151 * "1:2.0".
153 <version>: The <version> may contain only alphanumerics and the 152
154 character `.'. Ordered by numeric sort for numeric parts, 153 * <version>: The <version> may contain only alphanumerics and the
155 ascii sort for ascii parts (as per RPM or DEB algorithm). 154 * character `.'. Ordered by numeric sort for numeric parts,
156 <extraversion>: Like <version>, but inserted for local 155 * ascii sort for ascii parts (as per RPM or DEB algorithm).
157 customizations, eg "rh3" or "rusty1". 156
158 157 * <extraversion>: Like <version>, but inserted for local
159 Using this automatically adds a checksum of the .c files and the 158 * customizations, eg "rh3" or "rusty1".
160 local headers in "srcversion". 159
161*/ 160 * Using this automatically adds a checksum of the .c files and the
161 * local headers in "srcversion".
162 */
162 163
163#if defined(MODULE) || !defined(CONFIG_SYSFS) 164#if defined(MODULE) || !defined(CONFIG_SYSFS)
164#define MODULE_VERSION(_version) MODULE_INFO(version, _version) 165#define MODULE_VERSION(_version) MODULE_INFO(version, _version)
@@ -226,8 +227,7 @@ struct module_ref {
226 unsigned long decs; 227 unsigned long decs;
227} __attribute((aligned(2 * sizeof(unsigned long)))); 228} __attribute((aligned(2 * sizeof(unsigned long))));
228 229
229struct module 230struct module {
230{
231 enum module_state state; 231 enum module_state state;
232 232
233 /* Member of list of modules */ 233 /* Member of list of modules */
@@ -451,7 +451,7 @@ int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *,
451 451
452extern void __module_put_and_exit(struct module *mod, long code) 452extern void __module_put_and_exit(struct module *mod, long code)
453 __attribute__((noreturn)); 453 __attribute__((noreturn));
454#define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code); 454#define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code)
455 455
456#ifdef CONFIG_MODULE_UNLOAD 456#ifdef CONFIG_MODULE_UNLOAD
457unsigned long module_refcount(struct module *mod); 457unsigned long module_refcount(struct module *mod);
@@ -480,8 +480,8 @@ static inline void module_put(struct module *module)
480static inline void __module_get(struct module *module) 480static inline void __module_get(struct module *module)
481{ 481{
482} 482}
483#define symbol_put(x) do { } while(0) 483#define symbol_put(x) do { } while (0)
484#define symbol_put_addr(p) do { } while(0) 484#define symbol_put_addr(p) do { } while (0)
485 485
486#endif /* CONFIG_MODULE_UNLOAD */ 486#endif /* CONFIG_MODULE_UNLOAD */
487int ref_module(struct module *a, struct module *b); 487int ref_module(struct module *a, struct module *b);
@@ -507,8 +507,8 @@ int lookup_module_symbol_attrs(unsigned long addr, unsigned long *size, unsigned
507/* For extable.c to search modules' exception tables. */ 507/* For extable.c to search modules' exception tables. */
508const struct exception_table_entry *search_module_extables(unsigned long addr); 508const struct exception_table_entry *search_module_extables(unsigned long addr);
509 509
510int register_module_notifier(struct notifier_block * nb); 510int register_module_notifier(struct notifier_block *nb);
511int unregister_module_notifier(struct notifier_block * nb); 511int unregister_module_notifier(struct notifier_block *nb);
512 512
513extern void print_modules(void); 513extern void print_modules(void);
514 514
@@ -548,8 +548,8 @@ static inline bool is_module_text_address(unsigned long addr)
548 548
549/* Get/put a kernel symbol (calls should be symmetric) */ 549/* Get/put a kernel symbol (calls should be symmetric) */
550#define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); }) 550#define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); })
551#define symbol_put(x) do { } while(0) 551#define symbol_put(x) do { } while (0)
552#define symbol_put_addr(x) do { } while(0) 552#define symbol_put_addr(x) do { } while (0)
553 553
554static inline void __module_get(struct module *module) 554static inline void __module_get(struct module *module)
555{ 555{
@@ -606,13 +606,13 @@ static inline int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *,
606 return 0; 606 return 0;
607} 607}
608 608
609static inline int register_module_notifier(struct notifier_block * nb) 609static inline int register_module_notifier(struct notifier_block *nb)
610{ 610{
611 /* no events will happen anyway, so this can always succeed */ 611 /* no events will happen anyway, so this can always succeed */
612 return 0; 612 return 0;
613} 613}
614 614
615static inline int unregister_module_notifier(struct notifier_block * nb) 615static inline int unregister_module_notifier(struct notifier_block *nb)
616{ 616{
617 return 0; 617 return 0;
618} 618}
diff --git a/include/linux/msg.h b/include/linux/msg.h
index e21f9d44307f..f3f302f9c197 100644
--- a/include/linux/msg.h
+++ b/include/linux/msg.h
@@ -9,7 +9,7 @@ struct msg_msg {
9 struct list_head m_list; 9 struct list_head m_list;
10 long m_type; 10 long m_type;
11 size_t m_ts; /* message text size */ 11 size_t m_ts; /* message text size */
12 struct msg_msgseg* next; 12 struct msg_msgseg *next;
13 void *security; 13 void *security;
14 /* the actual message follows immediately */ 14 /* the actual message follows immediately */
15}; 15};
diff --git a/include/linux/msi.h b/include/linux/msi.h
index 009b02481436..92a2f991262a 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -60,10 +60,10 @@ void arch_teardown_msi_irq(unsigned int irq);
60int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type); 60int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type);
61void arch_teardown_msi_irqs(struct pci_dev *dev); 61void arch_teardown_msi_irqs(struct pci_dev *dev);
62int arch_msi_check_device(struct pci_dev* dev, int nvec, int type); 62int arch_msi_check_device(struct pci_dev* dev, int nvec, int type);
63void arch_restore_msi_irqs(struct pci_dev *dev, int irq); 63void arch_restore_msi_irqs(struct pci_dev *dev);
64 64
65void default_teardown_msi_irqs(struct pci_dev *dev); 65void default_teardown_msi_irqs(struct pci_dev *dev);
66void default_restore_msi_irqs(struct pci_dev *dev, int irq); 66void default_restore_msi_irqs(struct pci_dev *dev);
67u32 default_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag); 67u32 default_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag);
68u32 default_msix_mask_irq(struct msi_desc *desc, u32 flag); 68u32 default_msix_mask_irq(struct msi_desc *desc, u32 flag);
69 69
diff --git a/include/linux/mtd/mtdram.h b/include/linux/mtd/mtdram.h
index 68891313875d..628a6a21ddf0 100644
--- a/include/linux/mtd/mtdram.h
+++ b/include/linux/mtd/mtdram.h
@@ -3,6 +3,6 @@
3 3
4#include <linux/mtd/mtd.h> 4#include <linux/mtd/mtd.h>
5int mtdram_init_device(struct mtd_info *mtd, void *mapped_address, 5int mtdram_init_device(struct mtd_info *mtd, void *mapped_address,
6 unsigned long size, char *name); 6 unsigned long size, const char *name);
7 7
8#endif /* __MTD_MTDRAM_H__ */ 8#endif /* __MTD_MTDRAM_H__ */
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 9e6c8f9f306e..32f8612469d8 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -219,6 +219,9 @@ struct nand_chip;
219/* ONFI feature address */ 219/* ONFI feature address */
220#define ONFI_FEATURE_ADDR_TIMING_MODE 0x1 220#define ONFI_FEATURE_ADDR_TIMING_MODE 0x1
221 221
222/* Vendor-specific feature address (Micron) */
223#define ONFI_FEATURE_ADDR_READ_RETRY 0x89
224
222/* ONFI subfeature parameters length */ 225/* ONFI subfeature parameters length */
223#define ONFI_SUBFEATURE_PARAM_LEN 4 226#define ONFI_SUBFEATURE_PARAM_LEN 4
224 227
@@ -279,16 +282,17 @@ struct nand_onfi_params {
279 __le16 io_pin_capacitance_typ; 282 __le16 io_pin_capacitance_typ;
280 __le16 input_pin_capacitance_typ; 283 __le16 input_pin_capacitance_typ;
281 u8 input_pin_capacitance_max; 284 u8 input_pin_capacitance_max;
282 u8 driver_strenght_support; 285 u8 driver_strength_support;
283 __le16 t_int_r; 286 __le16 t_int_r;
284 __le16 t_ald; 287 __le16 t_ald;
285 u8 reserved4[7]; 288 u8 reserved4[7];
286 289
287 /* vendor */ 290 /* vendor */
288 u8 reserved5[90]; 291 __le16 vendor_revision;
292 u8 vendor[88];
289 293
290 __le16 crc; 294 __le16 crc;
291} __attribute__((packed)); 295} __packed;
292 296
293#define ONFI_CRC_BASE 0x4F4E 297#define ONFI_CRC_BASE 0x4F4E
294 298
@@ -326,6 +330,26 @@ struct onfi_ext_param_page {
326 */ 330 */
327} __packed; 331} __packed;
328 332
333struct nand_onfi_vendor_micron {
334 u8 two_plane_read;
335 u8 read_cache;
336 u8 read_unique_id;
337 u8 dq_imped;
338 u8 dq_imped_num_settings;
339 u8 dq_imped_feat_addr;
340 u8 rb_pulldown_strength;
341 u8 rb_pulldown_strength_feat_addr;
342 u8 rb_pulldown_strength_num_settings;
343 u8 otp_mode;
344 u8 otp_page_start;
345 u8 otp_data_prot_addr;
346 u8 otp_num_pages;
347 u8 otp_feat_addr;
348 u8 read_retry_options;
349 u8 reserved[72];
350 u8 param_revision;
351} __packed;
352
329/** 353/**
330 * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independent devices 354 * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independent devices
331 * @lock: protection lock 355 * @lock: protection lock
@@ -432,6 +456,8 @@ struct nand_buffers {
432 * flash device. 456 * flash device.
433 * @read_byte: [REPLACEABLE] read one byte from the chip 457 * @read_byte: [REPLACEABLE] read one byte from the chip
434 * @read_word: [REPLACEABLE] read one word from the chip 458 * @read_word: [REPLACEABLE] read one word from the chip
459 * @write_byte: [REPLACEABLE] write a single byte to the chip on the
460 * low 8 I/O lines
435 * @write_buf: [REPLACEABLE] write data from the buffer to the chip 461 * @write_buf: [REPLACEABLE] write data from the buffer to the chip
436 * @read_buf: [REPLACEABLE] read data from the chip into the buffer 462 * @read_buf: [REPLACEABLE] read data from the chip into the buffer
437 * @select_chip: [REPLACEABLE] select chip nr 463 * @select_chip: [REPLACEABLE] select chip nr
@@ -451,6 +477,8 @@ struct nand_buffers {
451 * commands to the chip. 477 * commands to the chip.
452 * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on 478 * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on
453 * ready. 479 * ready.
480 * @setup_read_retry: [FLASHSPECIFIC] flash (vendor) specific function for
481 * setting the read-retry mode. Mostly needed for MLC NAND.
454 * @ecc: [BOARDSPECIFIC] ECC control structure 482 * @ecc: [BOARDSPECIFIC] ECC control structure
455 * @buffers: buffer structure for read/write 483 * @buffers: buffer structure for read/write
456 * @hwcontrol: platform-specific hardware control structure 484 * @hwcontrol: platform-specific hardware control structure
@@ -497,6 +525,7 @@ struct nand_buffers {
497 * non 0 if ONFI supported. 525 * non 0 if ONFI supported.
498 * @onfi_params: [INTERN] holds the ONFI page parameter when ONFI is 526 * @onfi_params: [INTERN] holds the ONFI page parameter when ONFI is
499 * supported, 0 otherwise. 527 * supported, 0 otherwise.
528 * @read_retries: [INTERN] the number of read retry modes supported
500 * @onfi_set_features: [REPLACEABLE] set the features for ONFI nand 529 * @onfi_set_features: [REPLACEABLE] set the features for ONFI nand
501 * @onfi_get_features: [REPLACEABLE] get the features for ONFI nand 530 * @onfi_get_features: [REPLACEABLE] get the features for ONFI nand
502 * @bbt: [INTERN] bad block table pointer 531 * @bbt: [INTERN] bad block table pointer
@@ -521,6 +550,7 @@ struct nand_chip {
521 550
522 uint8_t (*read_byte)(struct mtd_info *mtd); 551 uint8_t (*read_byte)(struct mtd_info *mtd);
523 u16 (*read_word)(struct mtd_info *mtd); 552 u16 (*read_word)(struct mtd_info *mtd);
553 void (*write_byte)(struct mtd_info *mtd, uint8_t byte);
524 void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len); 554 void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
525 void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len); 555 void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len);
526 void (*select_chip)(struct mtd_info *mtd, int chip); 556 void (*select_chip)(struct mtd_info *mtd, int chip);
@@ -544,6 +574,7 @@ struct nand_chip {
544 int feature_addr, uint8_t *subfeature_para); 574 int feature_addr, uint8_t *subfeature_para);
545 int (*onfi_get_features)(struct mtd_info *mtd, struct nand_chip *chip, 575 int (*onfi_get_features)(struct mtd_info *mtd, struct nand_chip *chip,
546 int feature_addr, uint8_t *subfeature_para); 576 int feature_addr, uint8_t *subfeature_para);
577 int (*setup_read_retry)(struct mtd_info *mtd, int retry_mode);
547 578
548 int chip_delay; 579 int chip_delay;
549 unsigned int options; 580 unsigned int options;
@@ -568,6 +599,8 @@ struct nand_chip {
568 int onfi_version; 599 int onfi_version;
569 struct nand_onfi_params onfi_params; 600 struct nand_onfi_params onfi_params;
570 601
602 int read_retries;
603
571 flstate_t state; 604 flstate_t state;
572 605
573 uint8_t *oob_poi; 606 uint8_t *oob_poi;
@@ -600,6 +633,8 @@ struct nand_chip {
600#define NAND_MFR_AMD 0x01 633#define NAND_MFR_AMD 0x01
601#define NAND_MFR_MACRONIX 0xc2 634#define NAND_MFR_MACRONIX 0xc2
602#define NAND_MFR_EON 0x92 635#define NAND_MFR_EON 0x92
636#define NAND_MFR_SANDISK 0x45
637#define NAND_MFR_INTEL 0x89
603 638
604/* The maximum expected count of bytes in the NAND ID sequence */ 639/* The maximum expected count of bytes in the NAND ID sequence */
605#define NAND_MAX_ID_LEN 8 640#define NAND_MAX_ID_LEN 8
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h
index 1f8d24bdafda..6a35e6de5da1 100644
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
@@ -37,7 +37,7 @@
37 */ 37 */
38 38
39struct mtd_partition { 39struct mtd_partition {
40 char *name; /* identifier string */ 40 const char *name; /* identifier string */
41 uint64_t size; /* partition size */ 41 uint64_t size; /* partition size */
42 uint64_t offset; /* offset within the master MTD space */ 42 uint64_t offset; /* offset within the master MTD space */
43 uint32_t mask_flags; /* master MTD flags to mask out for this partition */ 43 uint32_t mask_flags; /* master MTD flags to mask out for this partition */
@@ -76,11 +76,11 @@ struct mtd_part_parser {
76 struct mtd_part_parser_data *); 76 struct mtd_part_parser_data *);
77}; 77};
78 78
79extern int register_mtd_parser(struct mtd_part_parser *parser); 79extern void register_mtd_parser(struct mtd_part_parser *parser);
80extern int deregister_mtd_parser(struct mtd_part_parser *parser); 80extern void deregister_mtd_parser(struct mtd_part_parser *parser);
81 81
82int mtd_is_partition(const struct mtd_info *mtd); 82int mtd_is_partition(const struct mtd_info *mtd);
83int mtd_add_partition(struct mtd_info *master, char *name, 83int mtd_add_partition(struct mtd_info *master, const char *name,
84 long long offset, long long length); 84 long long offset, long long length);
85int mtd_del_partition(struct mtd_info *master, int partno); 85int mtd_del_partition(struct mtd_info *master, int partno);
86uint64_t mtd_get_device_size(const struct mtd_info *mtd); 86uint64_t mtd_get_device_size(const struct mtd_info *mtd);
diff --git a/include/linux/net.h b/include/linux/net.h
index 69be3e6079c8..94734a6259a4 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -245,9 +245,6 @@ do { \
245#define net_dbg_ratelimited(fmt, ...) \ 245#define net_dbg_ratelimited(fmt, ...) \
246 net_ratelimited_function(pr_debug, fmt, ##__VA_ARGS__) 246 net_ratelimited_function(pr_debug, fmt, ##__VA_ARGS__)
247 247
248#define net_random() prandom_u32()
249#define net_srandom(seed) prandom_seed((__force u32)(seed))
250
251bool __net_get_random_once(void *buf, int nbytes, bool *done, 248bool __net_get_random_once(void *buf, int nbytes, bool *done,
252 struct static_key *done_key); 249 struct static_key *done_key);
253 250
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index d9a550bf3e8e..440a02ee6f92 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -668,15 +668,28 @@ extern struct rps_sock_flow_table __rcu *rps_sock_flow_table;
668bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, u32 flow_id, 668bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, u32 flow_id,
669 u16 filter_id); 669 u16 filter_id);
670#endif 670#endif
671#endif /* CONFIG_RPS */
671 672
672/* This structure contains an instance of an RX queue. */ 673/* This structure contains an instance of an RX queue. */
673struct netdev_rx_queue { 674struct netdev_rx_queue {
675#ifdef CONFIG_RPS
674 struct rps_map __rcu *rps_map; 676 struct rps_map __rcu *rps_map;
675 struct rps_dev_flow_table __rcu *rps_flow_table; 677 struct rps_dev_flow_table __rcu *rps_flow_table;
678#endif
676 struct kobject kobj; 679 struct kobject kobj;
677 struct net_device *dev; 680 struct net_device *dev;
678} ____cacheline_aligned_in_smp; 681} ____cacheline_aligned_in_smp;
679#endif /* CONFIG_RPS */ 682
683/*
684 * RX queue sysfs structures and functions.
685 */
686struct rx_queue_attribute {
687 struct attribute attr;
688 ssize_t (*show)(struct netdev_rx_queue *queue,
689 struct rx_queue_attribute *attr, char *buf);
690 ssize_t (*store)(struct netdev_rx_queue *queue,
691 struct rx_queue_attribute *attr, const char *buf, size_t len);
692};
680 693
681#ifdef CONFIG_XPS 694#ifdef CONFIG_XPS
682/* 695/*
@@ -769,7 +782,8 @@ struct netdev_phys_port_id {
769 * (can also return NETDEV_TX_LOCKED iff NETIF_F_LLTX) 782 * (can also return NETDEV_TX_LOCKED iff NETIF_F_LLTX)
770 * Required can not be NULL. 783 * Required can not be NULL.
771 * 784 *
772 * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb); 785 * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb,
786 * void *accel_priv);
773 * Called to decide which queue to when device supports multiple 787 * Called to decide which queue to when device supports multiple
774 * transmit queues. 788 * transmit queues.
775 * 789 *
@@ -990,7 +1004,8 @@ struct net_device_ops {
990 netdev_tx_t (*ndo_start_xmit) (struct sk_buff *skb, 1004 netdev_tx_t (*ndo_start_xmit) (struct sk_buff *skb,
991 struct net_device *dev); 1005 struct net_device *dev);
992 u16 (*ndo_select_queue)(struct net_device *dev, 1006 u16 (*ndo_select_queue)(struct net_device *dev,
993 struct sk_buff *skb); 1007 struct sk_buff *skb,
1008 void *accel_priv);
994 void (*ndo_change_rx_flags)(struct net_device *dev, 1009 void (*ndo_change_rx_flags)(struct net_device *dev,
995 int flags); 1010 int flags);
996 void (*ndo_set_rx_mode)(struct net_device *dev); 1011 void (*ndo_set_rx_mode)(struct net_device *dev);
@@ -1283,6 +1298,9 @@ struct net_device {
1283#if IS_ENABLED(CONFIG_NET_DSA) 1298#if IS_ENABLED(CONFIG_NET_DSA)
1284 struct dsa_switch_tree *dsa_ptr; /* dsa specific data */ 1299 struct dsa_switch_tree *dsa_ptr; /* dsa specific data */
1285#endif 1300#endif
1301#if IS_ENABLED(CONFIG_TIPC)
1302 struct tipc_bearer __rcu *tipc_ptr; /* TIPC specific data */
1303#endif
1286 void *atalk_ptr; /* AppleTalk link */ 1304 void *atalk_ptr; /* AppleTalk link */
1287 struct in_device __rcu *ip_ptr; /* IPv4 specific data */ 1305 struct in_device __rcu *ip_ptr; /* IPv4 specific data */
1288 struct dn_dev __rcu *dn_ptr; /* DECnet specific data */ 1306 struct dn_dev __rcu *dn_ptr; /* DECnet specific data */
@@ -1308,7 +1326,7 @@ struct net_device {
1308 unicast) */ 1326 unicast) */
1309 1327
1310 1328
1311#ifdef CONFIG_RPS 1329#ifdef CONFIG_SYSFS
1312 struct netdev_rx_queue *_rx; 1330 struct netdev_rx_queue *_rx;
1313 1331
1314 /* Number of RX queues allocated at register_netdev() time */ 1332 /* Number of RX queues allocated at register_netdev() time */
@@ -1406,7 +1424,7 @@ struct net_device {
1406 union { 1424 union {
1407 void *ml_priv; 1425 void *ml_priv;
1408 struct pcpu_lstats __percpu *lstats; /* loopback stats */ 1426 struct pcpu_lstats __percpu *lstats; /* loopback stats */
1409 struct pcpu_tstats __percpu *tstats; /* tunnel stats */ 1427 struct pcpu_sw_netstats __percpu *tstats;
1410 struct pcpu_dstats __percpu *dstats; /* dummy stats */ 1428 struct pcpu_dstats __percpu *dstats; /* dummy stats */
1411 struct pcpu_vstats __percpu *vstats; /* veth stats */ 1429 struct pcpu_vstats __percpu *vstats; /* veth stats */
1412 }; 1430 };
@@ -1419,6 +1437,8 @@ struct net_device {
1419 struct device dev; 1437 struct device dev;
1420 /* space for optional device, statistics, and wireless sysfs groups */ 1438 /* space for optional device, statistics, and wireless sysfs groups */
1421 const struct attribute_group *sysfs_groups[4]; 1439 const struct attribute_group *sysfs_groups[4];
1440 /* space for optional per-rx queue attributes */
1441 const struct attribute_group *sysfs_rx_queue_group;
1422 1442
1423 /* rtnetlink link ops */ 1443 /* rtnetlink link ops */
1424 const struct rtnl_link_ops *rtnl_link_ops; 1444 const struct rtnl_link_ops *rtnl_link_ops;
@@ -1441,7 +1461,7 @@ struct net_device {
1441 /* max exchange id for FCoE LRO by ddp */ 1461 /* max exchange id for FCoE LRO by ddp */
1442 unsigned int fcoe_ddp_xid; 1462 unsigned int fcoe_ddp_xid;
1443#endif 1463#endif
1444#if IS_ENABLED(CONFIG_NETPRIO_CGROUP) 1464#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO)
1445 struct netprio_map __rcu *priomap; 1465 struct netprio_map __rcu *priomap;
1446#endif 1466#endif
1447 /* phy device may attach itself for hardware timestamping */ 1467 /* phy device may attach itself for hardware timestamping */
@@ -1529,7 +1549,8 @@ static inline void netdev_for_each_tx_queue(struct net_device *dev,
1529} 1549}
1530 1550
1531struct netdev_queue *netdev_pick_tx(struct net_device *dev, 1551struct netdev_queue *netdev_pick_tx(struct net_device *dev,
1532 struct sk_buff *skb); 1552 struct sk_buff *skb,
1553 void *accel_priv);
1533u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb); 1554u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb);
1534 1555
1535/* 1556/*
@@ -1629,7 +1650,10 @@ struct napi_gro_cb {
1629 int data_offset; 1650 int data_offset;
1630 1651
1631 /* This is non-zero if the packet cannot be merged with the new skb. */ 1652 /* This is non-zero if the packet cannot be merged with the new skb. */
1632 int flush; 1653 u16 flush;
1654
1655 /* Save the IP ID here and check when we get to the transport layer */
1656 u16 flush_id;
1633 1657
1634 /* Number of segments aggregated. */ 1658 /* Number of segments aggregated. */
1635 u16 count; 1659 u16 count;
@@ -1646,7 +1670,13 @@ struct napi_gro_cb {
1646 unsigned long age; 1670 unsigned long age;
1647 1671
1648 /* Used in ipv6_gro_receive() */ 1672 /* Used in ipv6_gro_receive() */
1649 int proto; 1673 u16 proto;
1674
1675 /* Used in udp_gro_receive */
1676 u16 udp_mark;
1677
1678 /* used to support CHECKSUM_COMPLETE for tunneling protocols */
1679 __wsum csum;
1650 1680
1651 /* used in skb_gro_receive() slow path */ 1681 /* used in skb_gro_receive() slow path */
1652 struct sk_buff *last; 1682 struct sk_buff *last;
@@ -1673,7 +1703,7 @@ struct offload_callbacks {
1673 int (*gso_send_check)(struct sk_buff *skb); 1703 int (*gso_send_check)(struct sk_buff *skb);
1674 struct sk_buff **(*gro_receive)(struct sk_buff **head, 1704 struct sk_buff **(*gro_receive)(struct sk_buff **head,
1675 struct sk_buff *skb); 1705 struct sk_buff *skb);
1676 int (*gro_complete)(struct sk_buff *skb); 1706 int (*gro_complete)(struct sk_buff *skb, int nhoff);
1677}; 1707};
1678 1708
1679struct packet_offload { 1709struct packet_offload {
@@ -1682,6 +1712,20 @@ struct packet_offload {
1682 struct list_head list; 1712 struct list_head list;
1683}; 1713};
1684 1714
1715struct udp_offload {
1716 __be16 port;
1717 struct offload_callbacks callbacks;
1718};
1719
1720/* often modified stats are per cpu, other are shared (netdev->stats) */
1721struct pcpu_sw_netstats {
1722 u64 rx_packets;
1723 u64 rx_bytes;
1724 u64 tx_packets;
1725 u64 tx_bytes;
1726 struct u64_stats_sync syncp;
1727};
1728
1685#include <linux/notifier.h> 1729#include <linux/notifier.h>
1686 1730
1687/* netdevice notifier chain. Please remember to update the rtnetlink 1731/* netdevice notifier chain. Please remember to update the rtnetlink
@@ -1697,7 +1741,7 @@ struct packet_offload {
1697#define NETDEV_CHANGE 0x0004 /* Notify device state change */ 1741#define NETDEV_CHANGE 0x0004 /* Notify device state change */
1698#define NETDEV_REGISTER 0x0005 1742#define NETDEV_REGISTER 0x0005
1699#define NETDEV_UNREGISTER 0x0006 1743#define NETDEV_UNREGISTER 0x0006
1700#define NETDEV_CHANGEMTU 0x0007 1744#define NETDEV_CHANGEMTU 0x0007 /* notify after mtu change happened */
1701#define NETDEV_CHANGEADDR 0x0008 1745#define NETDEV_CHANGEADDR 0x0008
1702#define NETDEV_GOING_DOWN 0x0009 1746#define NETDEV_GOING_DOWN 0x0009
1703#define NETDEV_CHANGENAME 0x000A 1747#define NETDEV_CHANGENAME 0x000A
@@ -1713,6 +1757,7 @@ struct packet_offload {
1713#define NETDEV_JOIN 0x0014 1757#define NETDEV_JOIN 0x0014
1714#define NETDEV_CHANGEUPPER 0x0015 1758#define NETDEV_CHANGEUPPER 0x0015
1715#define NETDEV_RESEND_IGMP 0x0016 1759#define NETDEV_RESEND_IGMP 0x0016
1760#define NETDEV_PRECHANGEMTU 0x0017 /* notify before mtu change happened */
1716 1761
1717int register_netdevice_notifier(struct notifier_block *nb); 1762int register_netdevice_notifier(struct notifier_block *nb);
1718int unregister_netdevice_notifier(struct notifier_block *nb); 1763int unregister_netdevice_notifier(struct notifier_block *nb);
@@ -1738,8 +1783,6 @@ netdev_notifier_info_to_dev(const struct netdev_notifier_info *info)
1738 return info->dev; 1783 return info->dev;
1739} 1784}
1740 1785
1741int call_netdevice_notifiers_info(unsigned long val, struct net_device *dev,
1742 struct netdev_notifier_info *info);
1743int call_netdevice_notifiers(unsigned long val, struct net_device *dev); 1786int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
1744 1787
1745 1788
@@ -1806,7 +1849,6 @@ void dev_remove_pack(struct packet_type *pt);
1806void __dev_remove_pack(struct packet_type *pt); 1849void __dev_remove_pack(struct packet_type *pt);
1807void dev_add_offload(struct packet_offload *po); 1850void dev_add_offload(struct packet_offload *po);
1808void dev_remove_offload(struct packet_offload *po); 1851void dev_remove_offload(struct packet_offload *po);
1809void __dev_remove_offload(struct packet_offload *po);
1810 1852
1811struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags, 1853struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags,
1812 unsigned short mask); 1854 unsigned short mask);
@@ -1819,6 +1861,7 @@ int dev_close(struct net_device *dev);
1819void dev_disable_lro(struct net_device *dev); 1861void dev_disable_lro(struct net_device *dev);
1820int dev_loopback_xmit(struct sk_buff *newskb); 1862int dev_loopback_xmit(struct sk_buff *newskb);
1821int dev_queue_xmit(struct sk_buff *skb); 1863int dev_queue_xmit(struct sk_buff *skb);
1864int dev_queue_xmit_accel(struct sk_buff *skb, void *accel_priv);
1822int register_netdevice(struct net_device *dev); 1865int register_netdevice(struct net_device *dev);
1823void unregister_netdevice_queue(struct net_device *dev, struct list_head *head); 1866void unregister_netdevice_queue(struct net_device *dev, struct list_head *head);
1824void unregister_netdevice_many(struct list_head *head); 1867void unregister_netdevice_many(struct list_head *head);
@@ -1891,6 +1934,14 @@ static inline void *skb_gro_network_header(struct sk_buff *skb)
1891 skb_network_offset(skb); 1934 skb_network_offset(skb);
1892} 1935}
1893 1936
1937static inline void skb_gro_postpull_rcsum(struct sk_buff *skb,
1938 const void *start, unsigned int len)
1939{
1940 if (skb->ip_summed == CHECKSUM_COMPLETE)
1941 NAPI_GRO_CB(skb)->csum = csum_sub(NAPI_GRO_CB(skb)->csum,
1942 csum_partial(start, len, 0));
1943}
1944
1894static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, 1945static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev,
1895 unsigned short type, 1946 unsigned short type,
1896 const void *daddr, const void *saddr, 1947 const void *daddr, const void *saddr,
@@ -1912,6 +1963,15 @@ static inline int dev_parse_header(const struct sk_buff *skb,
1912 return dev->header_ops->parse(skb, haddr); 1963 return dev->header_ops->parse(skb, haddr);
1913} 1964}
1914 1965
1966static inline int dev_rebuild_header(struct sk_buff *skb)
1967{
1968 const struct net_device *dev = skb->dev;
1969
1970 if (!dev->header_ops || !dev->header_ops->rebuild)
1971 return 0;
1972 return dev->header_ops->rebuild(skb);
1973}
1974
1915typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len); 1975typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len);
1916int register_gifconf(unsigned int family, gifconf_func_t *gifconf); 1976int register_gifconf(unsigned int family, gifconf_func_t *gifconf);
1917static inline int unregister_gifconf(unsigned int family) 1977static inline int unregister_gifconf(unsigned int family)
@@ -2338,7 +2398,7 @@ static inline bool netif_is_multiqueue(const struct net_device *dev)
2338 2398
2339int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq); 2399int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq);
2340 2400
2341#ifdef CONFIG_RPS 2401#ifdef CONFIG_SYSFS
2342int netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq); 2402int netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq);
2343#else 2403#else
2344static inline int netif_set_real_num_rx_queues(struct net_device *dev, 2404static inline int netif_set_real_num_rx_queues(struct net_device *dev,
@@ -2357,7 +2417,7 @@ static inline int netif_copy_real_num_queues(struct net_device *to_dev,
2357 from_dev->real_num_tx_queues); 2417 from_dev->real_num_tx_queues);
2358 if (err) 2418 if (err)
2359 return err; 2419 return err;
2360#ifdef CONFIG_RPS 2420#ifdef CONFIG_SYSFS
2361 return netif_set_real_num_rx_queues(to_dev, 2421 return netif_set_real_num_rx_queues(to_dev,
2362 from_dev->real_num_rx_queues); 2422 from_dev->real_num_rx_queues);
2363#else 2423#else
@@ -2365,20 +2425,67 @@ static inline int netif_copy_real_num_queues(struct net_device *to_dev,
2365#endif 2425#endif
2366} 2426}
2367 2427
2428#ifdef CONFIG_SYSFS
2429static inline unsigned int get_netdev_rx_queue_index(
2430 struct netdev_rx_queue *queue)
2431{
2432 struct net_device *dev = queue->dev;
2433 int index = queue - dev->_rx;
2434
2435 BUG_ON(index >= dev->num_rx_queues);
2436 return index;
2437}
2438#endif
2439
2368#define DEFAULT_MAX_NUM_RSS_QUEUES (8) 2440#define DEFAULT_MAX_NUM_RSS_QUEUES (8)
2369int netif_get_num_default_rss_queues(void); 2441int netif_get_num_default_rss_queues(void);
2370 2442
2371/* Use this variant when it is known for sure that it 2443enum skb_free_reason {
2372 * is executing from hardware interrupt context or with hardware interrupts 2444 SKB_REASON_CONSUMED,
2373 * disabled. 2445 SKB_REASON_DROPPED,
2374 */ 2446};
2375void dev_kfree_skb_irq(struct sk_buff *skb); 2447
2448void __dev_kfree_skb_irq(struct sk_buff *skb, enum skb_free_reason reason);
2449void __dev_kfree_skb_any(struct sk_buff *skb, enum skb_free_reason reason);
2376 2450
2377/* Use this variant in places where it could be invoked 2451/*
2378 * from either hardware interrupt or other context, with hardware interrupts 2452 * It is not allowed to call kfree_skb() or consume_skb() from hardware
2379 * either disabled or enabled. 2453 * interrupt context or with hardware interrupts being disabled.
2454 * (in_irq() || irqs_disabled())
2455 *
2456 * We provide four helpers that can be used in following contexts :
2457 *
2458 * dev_kfree_skb_irq(skb) when caller drops a packet from irq context,
2459 * replacing kfree_skb(skb)
2460 *
2461 * dev_consume_skb_irq(skb) when caller consumes a packet from irq context.
2462 * Typically used in place of consume_skb(skb) in TX completion path
2463 *
2464 * dev_kfree_skb_any(skb) when caller doesn't know its current irq context,
2465 * replacing kfree_skb(skb)
2466 *
2467 * dev_consume_skb_any(skb) when caller doesn't know its current irq context,
2468 * and consumed a packet. Used in place of consume_skb(skb)
2380 */ 2469 */
2381void dev_kfree_skb_any(struct sk_buff *skb); 2470static inline void dev_kfree_skb_irq(struct sk_buff *skb)
2471{
2472 __dev_kfree_skb_irq(skb, SKB_REASON_DROPPED);
2473}
2474
2475static inline void dev_consume_skb_irq(struct sk_buff *skb)
2476{
2477 __dev_kfree_skb_irq(skb, SKB_REASON_CONSUMED);
2478}
2479
2480static inline void dev_kfree_skb_any(struct sk_buff *skb)
2481{
2482 __dev_kfree_skb_any(skb, SKB_REASON_DROPPED);
2483}
2484
2485static inline void dev_consume_skb_any(struct sk_buff *skb)
2486{
2487 __dev_kfree_skb_any(skb, SKB_REASON_CONSUMED);
2488}
2382 2489
2383int netif_rx(struct sk_buff *skb); 2490int netif_rx(struct sk_buff *skb);
2384int netif_rx_ni(struct sk_buff *skb); 2491int netif_rx_ni(struct sk_buff *skb);
@@ -2387,6 +2494,8 @@ gro_result_t napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb);
2387void napi_gro_flush(struct napi_struct *napi, bool flush_old); 2494void napi_gro_flush(struct napi_struct *napi, bool flush_old);
2388struct sk_buff *napi_get_frags(struct napi_struct *napi); 2495struct sk_buff *napi_get_frags(struct napi_struct *napi);
2389gro_result_t napi_gro_frags(struct napi_struct *napi); 2496gro_result_t napi_gro_frags(struct napi_struct *napi);
2497struct packet_offload *gro_find_receive_by_type(__be16 type);
2498struct packet_offload *gro_find_complete_by_type(__be16 type);
2390 2499
2391static inline void napi_free_frags(struct napi_struct *napi) 2500static inline void napi_free_frags(struct napi_struct *napi)
2392{ 2501{
@@ -2417,7 +2526,7 @@ int dev_change_carrier(struct net_device *, bool new_carrier);
2417int dev_get_phys_port_id(struct net_device *dev, 2526int dev_get_phys_port_id(struct net_device *dev,
2418 struct netdev_phys_port_id *ppid); 2527 struct netdev_phys_port_id *ppid);
2419int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, 2528int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
2420 struct netdev_queue *txq, void *accel_priv); 2529 struct netdev_queue *txq);
2421int dev_forward_skb(struct net_device *dev, struct sk_buff *skb); 2530int dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
2422 2531
2423extern int netdev_budget; 2532extern int netdev_budget;
@@ -2772,17 +2881,10 @@ int register_netdev(struct net_device *dev);
2772void unregister_netdev(struct net_device *dev); 2881void unregister_netdev(struct net_device *dev);
2773 2882
2774/* General hardware address lists handling functions */ 2883/* General hardware address lists handling functions */
2775int __hw_addr_add_multiple(struct netdev_hw_addr_list *to_list,
2776 struct netdev_hw_addr_list *from_list,
2777 int addr_len, unsigned char addr_type);
2778void __hw_addr_del_multiple(struct netdev_hw_addr_list *to_list,
2779 struct netdev_hw_addr_list *from_list,
2780 int addr_len, unsigned char addr_type);
2781int __hw_addr_sync(struct netdev_hw_addr_list *to_list, 2884int __hw_addr_sync(struct netdev_hw_addr_list *to_list,
2782 struct netdev_hw_addr_list *from_list, int addr_len); 2885 struct netdev_hw_addr_list *from_list, int addr_len);
2783void __hw_addr_unsync(struct netdev_hw_addr_list *to_list, 2886void __hw_addr_unsync(struct netdev_hw_addr_list *to_list,
2784 struct netdev_hw_addr_list *from_list, int addr_len); 2887 struct netdev_hw_addr_list *from_list, int addr_len);
2785void __hw_addr_flush(struct netdev_hw_addr_list *list);
2786void __hw_addr_init(struct netdev_hw_addr_list *list); 2888void __hw_addr_init(struct netdev_hw_addr_list *list);
2787 2889
2788/* Functions used for device addresses handling */ 2890/* Functions used for device addresses handling */
@@ -2790,10 +2892,6 @@ int dev_addr_add(struct net_device *dev, const unsigned char *addr,
2790 unsigned char addr_type); 2892 unsigned char addr_type);
2791int dev_addr_del(struct net_device *dev, const unsigned char *addr, 2893int dev_addr_del(struct net_device *dev, const unsigned char *addr,
2792 unsigned char addr_type); 2894 unsigned char addr_type);
2793int dev_addr_add_multiple(struct net_device *to_dev,
2794 struct net_device *from_dev, unsigned char addr_type);
2795int dev_addr_del_multiple(struct net_device *to_dev,
2796 struct net_device *from_dev, unsigned char addr_type);
2797void dev_addr_flush(struct net_device *dev); 2895void dev_addr_flush(struct net_device *dev);
2798int dev_addr_init(struct net_device *dev); 2896int dev_addr_init(struct net_device *dev);
2799 2897
@@ -2840,7 +2938,6 @@ extern int weight_p;
2840extern int bpf_jit_enable; 2938extern int bpf_jit_enable;
2841 2939
2842bool netdev_has_upper_dev(struct net_device *dev, struct net_device *upper_dev); 2940bool netdev_has_upper_dev(struct net_device *dev, struct net_device *upper_dev);
2843bool netdev_has_any_upper_dev(struct net_device *dev);
2844struct net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *dev, 2941struct net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *dev,
2845 struct list_head **iter); 2942 struct list_head **iter);
2846 2943
@@ -2869,6 +2966,7 @@ void *netdev_lower_get_next_private_rcu(struct net_device *dev,
2869 priv = netdev_lower_get_next_private_rcu(dev, &(iter))) 2966 priv = netdev_lower_get_next_private_rcu(dev, &(iter)))
2870 2967
2871void *netdev_adjacent_get_private(struct list_head *adj_list); 2968void *netdev_adjacent_get_private(struct list_head *adj_list);
2969void *netdev_lower_get_first_private_rcu(struct net_device *dev);
2872struct net_device *netdev_master_upper_dev_get(struct net_device *dev); 2970struct net_device *netdev_master_upper_dev_get(struct net_device *dev);
2873struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev); 2971struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev);
2874int netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev); 2972int netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev);
@@ -2879,8 +2977,7 @@ int netdev_master_upper_dev_link_private(struct net_device *dev,
2879 void *private); 2977 void *private);
2880void netdev_upper_dev_unlink(struct net_device *dev, 2978void netdev_upper_dev_unlink(struct net_device *dev,
2881 struct net_device *upper_dev); 2979 struct net_device *upper_dev);
2882void *netdev_lower_dev_get_private_rcu(struct net_device *dev, 2980void netdev_adjacent_rename_links(struct net_device *dev, char *oldname);
2883 struct net_device *lower_dev);
2884void *netdev_lower_dev_get_private(struct net_device *dev, 2981void *netdev_lower_dev_get_private(struct net_device *dev,
2885 struct net_device *lower_dev); 2982 struct net_device *lower_dev);
2886int skb_checksum_help(struct sk_buff *skb); 2983int skb_checksum_help(struct sk_buff *skb);
@@ -3008,6 +3105,19 @@ static inline void netif_set_gso_max_size(struct net_device *dev,
3008 dev->gso_max_size = size; 3105 dev->gso_max_size = size;
3009} 3106}
3010 3107
3108static inline void skb_gso_error_unwind(struct sk_buff *skb, __be16 protocol,
3109 int pulled_hlen, u16 mac_offset,
3110 int mac_len)
3111{
3112 skb->protocol = protocol;
3113 skb->encapsulation = 1;
3114 skb_push(skb, pulled_hlen);
3115 skb_reset_transport_header(skb);
3116 skb->mac_header = mac_offset;
3117 skb->network_header = skb->mac_header + mac_len;
3118 skb->mac_len = mac_len;
3119}
3120
3011static inline bool netif_is_macvlan(struct net_device *dev) 3121static inline bool netif_is_macvlan(struct net_device *dev)
3012{ 3122{
3013 return dev->priv_flags & IFF_MACVLAN; 3123 return dev->priv_flags & IFF_MACVLAN;
diff --git a/include/linux/netfilter/ipset/ip_set.h b/include/linux/netfilter/ipset/ip_set.h
index c7174b816674..0c7d01eae56c 100644
--- a/include/linux/netfilter/ipset/ip_set.h
+++ b/include/linux/netfilter/ipset/ip_set.h
@@ -331,7 +331,6 @@ extern ip_set_id_t ip_set_get_byname(struct net *net,
331 const char *name, struct ip_set **set); 331 const char *name, struct ip_set **set);
332extern void ip_set_put_byindex(struct net *net, ip_set_id_t index); 332extern void ip_set_put_byindex(struct net *net, ip_set_id_t index);
333extern const char *ip_set_name_byindex(struct net *net, ip_set_id_t index); 333extern const char *ip_set_name_byindex(struct net *net, ip_set_id_t index);
334extern ip_set_id_t ip_set_nfnl_get(struct net *net, const char *name);
335extern ip_set_id_t ip_set_nfnl_get_byindex(struct net *net, ip_set_id_t index); 334extern ip_set_id_t ip_set_nfnl_get_byindex(struct net *net, ip_set_id_t index);
336extern void ip_set_nfnl_put(struct net *net, ip_set_id_t index); 335extern void ip_set_nfnl_put(struct net *net, ip_set_id_t index);
337 336
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 7a6c396a263b..aad8eeaf416d 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -62,7 +62,6 @@ extern void netlink_kernel_release(struct sock *sk);
62extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups); 62extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups);
63extern int netlink_change_ngroups(struct sock *sk, unsigned int groups); 63extern int netlink_change_ngroups(struct sock *sk, unsigned int groups);
64extern void __netlink_clear_multicast_users(struct sock *sk, unsigned int group); 64extern void __netlink_clear_multicast_users(struct sock *sk, unsigned int group);
65extern void netlink_clear_multicast_users(struct sock *sk, unsigned int group);
66extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); 65extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err);
67extern int netlink_has_listeners(struct sock *sk, unsigned int group); 66extern int netlink_has_listeners(struct sock *sk, unsigned int group);
68extern struct sk_buff *netlink_alloc_skb(struct sock *ssk, unsigned int size, 67extern struct sk_buff *netlink_alloc_skb(struct sock *ssk, unsigned int size,
@@ -168,7 +167,6 @@ struct netlink_tap {
168}; 167};
169 168
170extern int netlink_add_tap(struct netlink_tap *nt); 169extern int netlink_add_tap(struct netlink_tap *nt);
171extern int __netlink_remove_tap(struct netlink_tap *nt);
172extern int netlink_remove_tap(struct netlink_tap *nt); 170extern int netlink_remove_tap(struct netlink_tap *nt);
173 171
174#endif /* __LINUX_NETLINK_H */ 172#endif /* __LINUX_NETLINK_H */
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 48997374eaf0..0ae5807480f4 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -154,10 +154,6 @@ struct nfs_inode {
154 struct rb_root access_cache; 154 struct rb_root access_cache;
155 struct list_head access_cache_entry_lru; 155 struct list_head access_cache_entry_lru;
156 struct list_head access_cache_inode_lru; 156 struct list_head access_cache_inode_lru;
157#ifdef CONFIG_NFS_V3_ACL
158 struct posix_acl *acl_access;
159 struct posix_acl *acl_default;
160#endif
161 157
162 /* 158 /*
163 * This is the cookie verifier used for NFSv3 readdir 159 * This is the cookie verifier used for NFSv3 readdir
@@ -215,6 +211,7 @@ struct nfs_inode {
215#define NFS_INO_ADVISE_RDPLUS (0) /* advise readdirplus */ 211#define NFS_INO_ADVISE_RDPLUS (0) /* advise readdirplus */
216#define NFS_INO_STALE (1) /* possible stale inode */ 212#define NFS_INO_STALE (1) /* possible stale inode */
217#define NFS_INO_ACL_LRU_SET (2) /* Inode is on the LRU list */ 213#define NFS_INO_ACL_LRU_SET (2) /* Inode is on the LRU list */
214#define NFS_INO_INVALIDATING (3) /* inode is being invalidated */
218#define NFS_INO_FLUSHING (4) /* inode is flushing out data */ 215#define NFS_INO_FLUSHING (4) /* inode is flushing out data */
219#define NFS_INO_FSCACHE (5) /* inode can be cached by FS-Cache */ 216#define NFS_INO_FSCACHE (5) /* inode can be cached by FS-Cache */
220#define NFS_INO_FSCACHE_LOCK (6) /* FS-Cache cookie management lock */ 217#define NFS_INO_FSCACHE_LOCK (6) /* FS-Cache cookie management lock */
@@ -564,23 +561,17 @@ extern int nfs_readpage_async(struct nfs_open_context *, struct inode *,
564 * linux/fs/nfs3proc.c 561 * linux/fs/nfs3proc.c
565 */ 562 */
566#ifdef CONFIG_NFS_V3_ACL 563#ifdef CONFIG_NFS_V3_ACL
567extern struct posix_acl *nfs3_proc_getacl(struct inode *inode, int type); 564extern struct posix_acl *nfs3_get_acl(struct inode *inode, int type);
568extern int nfs3_proc_setacl(struct inode *inode, int type, 565extern int nfs3_set_acl(struct inode *inode, struct posix_acl *acl, int type);
569 struct posix_acl *acl); 566extern int nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl,
570extern int nfs3_proc_set_default_acl(struct inode *dir, struct inode *inode, 567 struct posix_acl *dfacl);
571 umode_t mode); 568extern const struct xattr_handler *nfs3_xattr_handlers[];
572extern void nfs3_forget_cached_acls(struct inode *inode);
573#else 569#else
574static inline int nfs3_proc_set_default_acl(struct inode *dir, 570static inline int nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl,
575 struct inode *inode, 571 struct posix_acl *dfacl)
576 umode_t mode)
577{ 572{
578 return 0; 573 return 0;
579} 574}
580
581static inline void nfs3_forget_cached_acls(struct inode *inode)
582{
583}
584#endif /* CONFIG_NFS_V3_ACL */ 575#endif /* CONFIG_NFS_V3_ACL */
585 576
586/* 577/*
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 3ccfcecf8999..b2fb167b2e6d 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -379,12 +379,14 @@ struct nfs_openres {
379 * Arguments to the open_confirm call. 379 * Arguments to the open_confirm call.
380 */ 380 */
381struct nfs_open_confirmargs { 381struct nfs_open_confirmargs {
382 struct nfs4_sequence_args seq_args;
382 const struct nfs_fh * fh; 383 const struct nfs_fh * fh;
383 nfs4_stateid * stateid; 384 nfs4_stateid * stateid;
384 struct nfs_seqid * seqid; 385 struct nfs_seqid * seqid;
385}; 386};
386 387
387struct nfs_open_confirmres { 388struct nfs_open_confirmres {
389 struct nfs4_sequence_res seq_res;
388 nfs4_stateid stateid; 390 nfs4_stateid stateid;
389 struct nfs_seqid * seqid; 391 struct nfs_seqid * seqid;
390}; 392};
diff --git a/include/linux/nls.h b/include/linux/nls.h
index 5dc635f8d79e..520681b68208 100644
--- a/include/linux/nls.h
+++ b/include/linux/nls.h
@@ -44,11 +44,12 @@ enum utf16_endian {
44}; 44};
45 45
46/* nls_base.c */ 46/* nls_base.c */
47extern int register_nls(struct nls_table *); 47extern int __register_nls(struct nls_table *, struct module *);
48extern int unregister_nls(struct nls_table *); 48extern int unregister_nls(struct nls_table *);
49extern struct nls_table *load_nls(char *); 49extern struct nls_table *load_nls(char *);
50extern void unload_nls(struct nls_table *); 50extern void unload_nls(struct nls_table *);
51extern struct nls_table *load_nls_default(void); 51extern struct nls_table *load_nls_default(void);
52#define register_nls(nls) __register_nls((nls), THIS_MODULE)
52 53
53extern int utf8_to_utf32(const u8 *s, int len, unicode_t *pu); 54extern int utf8_to_utf32(const u8 *s, int len, unicode_t *pu);
54extern int utf32_to_utf8(unicode_t u, u8 *s, int maxlen); 55extern int utf32_to_utf8(unicode_t u, u8 *s, int maxlen);
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index 26ebcf41c213..69ae03f6eb15 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -80,13 +80,14 @@ struct nvme_dev {
80 struct dma_pool *prp_small_pool; 80 struct dma_pool *prp_small_pool;
81 int instance; 81 int instance;
82 int queue_count; 82 int queue_count;
83 int db_stride; 83 u32 db_stride;
84 u32 ctrl_config; 84 u32 ctrl_config;
85 struct msix_entry *entry; 85 struct msix_entry *entry;
86 struct nvme_bar __iomem *bar; 86 struct nvme_bar __iomem *bar;
87 struct list_head namespaces; 87 struct list_head namespaces;
88 struct kref kref; 88 struct kref kref;
89 struct miscdevice miscdev; 89 struct miscdevice miscdev;
90 struct work_struct reset_work;
90 char name[12]; 91 char name[12];
91 char serial[20]; 92 char serial[20];
92 char model[40]; 93 char model[40];
@@ -94,6 +95,8 @@ struct nvme_dev {
94 u32 max_hw_sectors; 95 u32 max_hw_sectors;
95 u32 stripe_size; 96 u32 stripe_size;
96 u16 oncs; 97 u16 oncs;
98 u16 abort_limit;
99 u8 initialized;
97}; 100};
98 101
99/* 102/*
@@ -165,6 +168,7 @@ int nvme_set_features(struct nvme_dev *dev, unsigned fid, unsigned dword11,
165struct sg_io_hdr; 168struct sg_io_hdr;
166 169
167int nvme_sg_io(struct nvme_ns *ns, struct sg_io_hdr __user *u_hdr); 170int nvme_sg_io(struct nvme_ns *ns, struct sg_io_hdr __user *u_hdr);
171int nvme_sg_io32(struct nvme_ns *ns, unsigned long arg);
168int nvme_sg_get_version_num(int __user *ip); 172int nvme_sg_get_version_num(int __user *ip);
169 173
170#endif /* _LINUX_NVME_H */ 174#endif /* _LINUX_NVME_H */
diff --git a/include/linux/of.h b/include/linux/of.h
index 276c546980d8..435cb995904d 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -169,35 +169,15 @@ static inline const char *of_node_full_name(const struct device_node *np)
169 169
170extern struct device_node *of_find_node_by_name(struct device_node *from, 170extern struct device_node *of_find_node_by_name(struct device_node *from,
171 const char *name); 171 const char *name);
172#define for_each_node_by_name(dn, name) \
173 for (dn = of_find_node_by_name(NULL, name); dn; \
174 dn = of_find_node_by_name(dn, name))
175extern struct device_node *of_find_node_by_type(struct device_node *from, 172extern struct device_node *of_find_node_by_type(struct device_node *from,
176 const char *type); 173 const char *type);
177#define for_each_node_by_type(dn, type) \
178 for (dn = of_find_node_by_type(NULL, type); dn; \
179 dn = of_find_node_by_type(dn, type))
180extern struct device_node *of_find_compatible_node(struct device_node *from, 174extern struct device_node *of_find_compatible_node(struct device_node *from,
181 const char *type, const char *compat); 175 const char *type, const char *compat);
182#define for_each_compatible_node(dn, type, compatible) \
183 for (dn = of_find_compatible_node(NULL, type, compatible); dn; \
184 dn = of_find_compatible_node(dn, type, compatible))
185extern struct device_node *of_find_matching_node_and_match( 176extern struct device_node *of_find_matching_node_and_match(
186 struct device_node *from, 177 struct device_node *from,
187 const struct of_device_id *matches, 178 const struct of_device_id *matches,
188 const struct of_device_id **match); 179 const struct of_device_id **match);
189static inline struct device_node *of_find_matching_node( 180
190 struct device_node *from,
191 const struct of_device_id *matches)
192{
193 return of_find_matching_node_and_match(from, matches, NULL);
194}
195#define for_each_matching_node(dn, matches) \
196 for (dn = of_find_matching_node(NULL, matches); dn; \
197 dn = of_find_matching_node(dn, matches))
198#define for_each_matching_node_and_match(dn, matches, match) \
199 for (dn = of_find_matching_node_and_match(NULL, matches, match); \
200 dn; dn = of_find_matching_node_and_match(dn, matches, match))
201extern struct device_node *of_find_node_by_path(const char *path); 181extern struct device_node *of_find_node_by_path(const char *path);
202extern struct device_node *of_find_node_by_phandle(phandle handle); 182extern struct device_node *of_find_node_by_phandle(phandle handle);
203extern struct device_node *of_get_parent(const struct device_node *node); 183extern struct device_node *of_get_parent(const struct device_node *node);
@@ -209,43 +189,11 @@ extern struct device_node *of_get_next_available_child(
209 189
210extern struct device_node *of_get_child_by_name(const struct device_node *node, 190extern struct device_node *of_get_child_by_name(const struct device_node *node,
211 const char *name); 191 const char *name);
212#define for_each_child_of_node(parent, child) \
213 for (child = of_get_next_child(parent, NULL); child != NULL; \
214 child = of_get_next_child(parent, child))
215
216#define for_each_available_child_of_node(parent, child) \
217 for (child = of_get_next_available_child(parent, NULL); child != NULL; \
218 child = of_get_next_available_child(parent, child))
219
220static inline int of_get_child_count(const struct device_node *np)
221{
222 struct device_node *child;
223 int num = 0;
224
225 for_each_child_of_node(np, child)
226 num++;
227
228 return num;
229}
230
231static inline int of_get_available_child_count(const struct device_node *np)
232{
233 struct device_node *child;
234 int num = 0;
235
236 for_each_available_child_of_node(np, child)
237 num++;
238
239 return num;
240}
241 192
242/* cache lookup */ 193/* cache lookup */
243extern struct device_node *of_find_next_cache_node(const struct device_node *); 194extern struct device_node *of_find_next_cache_node(const struct device_node *);
244extern struct device_node *of_find_node_with_property( 195extern struct device_node *of_find_node_with_property(
245 struct device_node *from, const char *prop_name); 196 struct device_node *from, const char *prop_name);
246#define for_each_node_with_property(dn, prop_name) \
247 for (dn = of_find_node_with_property(NULL, prop_name); dn; \
248 dn = of_find_node_with_property(dn, prop_name))
249 197
250extern struct property *of_find_property(const struct device_node *np, 198extern struct property *of_find_property(const struct device_node *np,
251 const char *name, 199 const char *name,
@@ -367,37 +315,53 @@ static inline struct device_node *of_find_node_by_name(struct device_node *from,
367 return NULL; 315 return NULL;
368} 316}
369 317
370static inline struct device_node *of_get_parent(const struct device_node *node) 318static inline struct device_node *of_find_node_by_type(struct device_node *from,
319 const char *type)
371{ 320{
372 return NULL; 321 return NULL;
373} 322}
374 323
375static inline bool of_have_populated_dt(void) 324static inline struct device_node *of_find_matching_node_and_match(
325 struct device_node *from,
326 const struct of_device_id *matches,
327 const struct of_device_id **match)
376{ 328{
377 return false; 329 return NULL;
378} 330}
379 331
380#define for_each_child_of_node(parent, child) \ 332static inline struct device_node *of_get_parent(const struct device_node *node)
381 while (0) 333{
334 return NULL;
335}
382 336
383#define for_each_available_child_of_node(parent, child) \ 337static inline struct device_node *of_get_next_child(
384 while (0) 338 const struct device_node *node, struct device_node *prev)
339{
340 return NULL;
341}
385 342
386static inline struct device_node *of_get_child_by_name( 343static inline struct device_node *of_get_next_available_child(
387 const struct device_node *node, 344 const struct device_node *node, struct device_node *prev)
388 const char *name)
389{ 345{
390 return NULL; 346 return NULL;
391} 347}
392 348
393static inline int of_get_child_count(const struct device_node *np) 349static inline struct device_node *of_find_node_with_property(
350 struct device_node *from, const char *prop_name)
394{ 351{
395 return 0; 352 return NULL;
396} 353}
397 354
398static inline int of_get_available_child_count(const struct device_node *np) 355static inline bool of_have_populated_dt(void)
399{ 356{
400 return 0; 357 return false;
358}
359
360static inline struct device_node *of_get_child_by_name(
361 const struct device_node *node,
362 const char *name)
363{
364 return NULL;
401} 365}
402 366
403static inline int of_device_is_compatible(const struct device_node *device, 367static inline int of_device_is_compatible(const struct device_node *device,
@@ -564,6 +528,13 @@ extern int of_node_to_nid(struct device_node *np);
564static inline int of_node_to_nid(struct device_node *device) { return 0; } 528static inline int of_node_to_nid(struct device_node *device) { return 0; }
565#endif 529#endif
566 530
531static inline struct device_node *of_find_matching_node(
532 struct device_node *from,
533 const struct of_device_id *matches)
534{
535 return of_find_matching_node_and_match(from, matches, NULL);
536}
537
567/** 538/**
568 * of_property_read_bool - Findfrom a property 539 * of_property_read_bool - Findfrom a property
569 * @np: device node from which the property value is to be read. 540 * @np: device node from which the property value is to be read.
@@ -613,6 +584,55 @@ static inline int of_property_read_u32(const struct device_node *np,
613 s; \ 584 s; \
614 s = of_prop_next_string(prop, s)) 585 s = of_prop_next_string(prop, s))
615 586
587#define for_each_node_by_name(dn, name) \
588 for (dn = of_find_node_by_name(NULL, name); dn; \
589 dn = of_find_node_by_name(dn, name))
590#define for_each_node_by_type(dn, type) \
591 for (dn = of_find_node_by_type(NULL, type); dn; \
592 dn = of_find_node_by_type(dn, type))
593#define for_each_compatible_node(dn, type, compatible) \
594 for (dn = of_find_compatible_node(NULL, type, compatible); dn; \
595 dn = of_find_compatible_node(dn, type, compatible))
596#define for_each_matching_node(dn, matches) \
597 for (dn = of_find_matching_node(NULL, matches); dn; \
598 dn = of_find_matching_node(dn, matches))
599#define for_each_matching_node_and_match(dn, matches, match) \
600 for (dn = of_find_matching_node_and_match(NULL, matches, match); \
601 dn; dn = of_find_matching_node_and_match(dn, matches, match))
602
603#define for_each_child_of_node(parent, child) \
604 for (child = of_get_next_child(parent, NULL); child != NULL; \
605 child = of_get_next_child(parent, child))
606#define for_each_available_child_of_node(parent, child) \
607 for (child = of_get_next_available_child(parent, NULL); child != NULL; \
608 child = of_get_next_available_child(parent, child))
609
610#define for_each_node_with_property(dn, prop_name) \
611 for (dn = of_find_node_with_property(NULL, prop_name); dn; \
612 dn = of_find_node_with_property(dn, prop_name))
613
614static inline int of_get_child_count(const struct device_node *np)
615{
616 struct device_node *child;
617 int num = 0;
618
619 for_each_child_of_node(np, child)
620 num++;
621
622 return num;
623}
624
625static inline int of_get_available_child_count(const struct device_node *np)
626{
627 struct device_node *child;
628 int num = 0;
629
630 for_each_available_child_of_node(np, child)
631 num++;
632
633 return num;
634}
635
616#if defined(CONFIG_PROC_FS) && defined(CONFIG_PROC_DEVICETREE) 636#if defined(CONFIG_PROC_FS) && defined(CONFIG_PROC_DEVICETREE)
617extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *); 637extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *);
618extern void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop); 638extern void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop);
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
index 82ce324fdce7..ef370210ffb2 100644
--- a/include/linux/of_device.h
+++ b/include/linux/of_device.h
@@ -64,6 +64,12 @@ static inline int of_driver_match_device(struct device *dev,
64static inline void of_device_uevent(struct device *dev, 64static inline void of_device_uevent(struct device *dev,
65 struct kobj_uevent_env *env) { } 65 struct kobj_uevent_env *env) { }
66 66
67static inline int of_device_get_modalias(struct device *dev,
68 char *str, ssize_t len)
69{
70 return -ENODEV;
71}
72
67static inline int of_device_uevent_modalias(struct device *dev, 73static inline int of_device_uevent_modalias(struct device *dev,
68 struct kobj_uevent_env *env) 74 struct kobj_uevent_env *env)
69{ 75{
@@ -72,11 +78,13 @@ static inline int of_device_uevent_modalias(struct device *dev,
72 78
73static inline void of_device_node_put(struct device *dev) { } 79static inline void of_device_node_put(struct device *dev) { }
74 80
75static inline const struct of_device_id *of_match_device( 81static inline const struct of_device_id *__of_match_device(
76 const struct of_device_id *matches, const struct device *dev) 82 const struct of_device_id *matches, const struct device *dev)
77{ 83{
78 return NULL; 84 return NULL;
79} 85}
86#define of_match_device(matches, dev) \
87 __of_match_device(of_match_ptr(matches), (dev))
80 88
81static inline struct device_node *of_cpu_device_node_get(int cpu) 89static inline struct device_node *of_cpu_device_node_get(int cpu)
82{ 90{
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
index 0beaee9dac1f..2b77058a7335 100644
--- a/include/linux/of_fdt.h
+++ b/include/linux/of_fdt.h
@@ -116,6 +116,7 @@ extern const void *of_flat_dt_match_machine(const void *default_match,
116extern void unflatten_device_tree(void); 116extern void unflatten_device_tree(void);
117extern void unflatten_and_copy_device_tree(void); 117extern void unflatten_and_copy_device_tree(void);
118extern void early_init_devtree(void *); 118extern void early_init_devtree(void *);
119extern void early_get_first_memblock_info(void *, phys_addr_t *);
119#else /* CONFIG_OF_FLATTREE */ 120#else /* CONFIG_OF_FLATTREE */
120static inline const char *of_flat_dt_get_machine_name(void) { return NULL; } 121static inline const char *of_flat_dt_get_machine_name(void) { return NULL; }
121static inline void unflatten_device_tree(void) {} 122static inline void unflatten_device_tree(void) {}
diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h
index 8163107b94b4..6fe8464ed767 100644
--- a/include/linux/of_mdio.h
+++ b/include/linux/of_mdio.h
@@ -19,6 +19,9 @@ extern struct phy_device *of_phy_connect(struct net_device *dev,
19 struct device_node *phy_np, 19 struct device_node *phy_np,
20 void (*hndlr)(struct net_device *), 20 void (*hndlr)(struct net_device *),
21 u32 flags, phy_interface_t iface); 21 u32 flags, phy_interface_t iface);
22struct phy_device *of_phy_attach(struct net_device *dev,
23 struct device_node *phy_np, u32 flags,
24 phy_interface_t iface);
22extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev, 25extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
23 void (*hndlr)(struct net_device *), 26 void (*hndlr)(struct net_device *),
24 phy_interface_t iface); 27 phy_interface_t iface);
@@ -44,6 +47,13 @@ static inline struct phy_device *of_phy_connect(struct net_device *dev,
44 return NULL; 47 return NULL;
45} 48}
46 49
50static inline struct phy_device *of_phy_attach(struct net_device *dev,
51 struct device_node *phy_np,
52 u32 flags, phy_interface_t iface)
53{
54 return NULL;
55}
56
47static inline struct phy_device *of_phy_connect_fixed_link(struct net_device *dev, 57static inline struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
48 void (*hndlr)(struct net_device *), 58 void (*hndlr)(struct net_device *),
49 phy_interface_t iface) 59 phy_interface_t iface)
diff --git a/include/linux/of_mtd.h b/include/linux/of_mtd.h
index 6f10e938ff7e..cb32d9c1e8dc 100644
--- a/include/linux/of_mtd.h
+++ b/include/linux/of_mtd.h
@@ -7,7 +7,7 @@
7 */ 7 */
8 8
9#ifndef __LINUX_OF_MTD_H 9#ifndef __LINUX_OF_MTD_H
10#define __LINUX_OF_NET_H 10#define __LINUX_OF_MTD_H
11 11
12#ifdef CONFIG_OF_MTD 12#ifdef CONFIG_OF_MTD
13 13
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 98ada58f9942..d1fe1a761047 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -228,9 +228,9 @@ PAGEFLAG(OwnerPriv1, owner_priv_1) TESTCLEARFLAG(OwnerPriv1, owner_priv_1)
228TESTPAGEFLAG(Writeback, writeback) TESTSCFLAG(Writeback, writeback) 228TESTPAGEFLAG(Writeback, writeback) TESTSCFLAG(Writeback, writeback)
229PAGEFLAG(MappedToDisk, mappedtodisk) 229PAGEFLAG(MappedToDisk, mappedtodisk)
230 230
231/* PG_readahead is only used for file reads; PG_reclaim is only for writes */ 231/* PG_readahead is only used for reads; PG_reclaim is only for writes */
232PAGEFLAG(Reclaim, reclaim) TESTCLEARFLAG(Reclaim, reclaim) 232PAGEFLAG(Reclaim, reclaim) TESTCLEARFLAG(Reclaim, reclaim)
233PAGEFLAG(Readahead, reclaim) /* Reminder to do async read-ahead */ 233PAGEFLAG(Readahead, reclaim) TESTCLEARFLAG(Readahead, reclaim)
234 234
235#ifdef CONFIG_HIGHMEM 235#ifdef CONFIG_HIGHMEM
236/* 236/*
@@ -412,7 +412,7 @@ static inline void ClearPageCompound(struct page *page)
412 */ 412 */
413static inline int PageTransHuge(struct page *page) 413static inline int PageTransHuge(struct page *page)
414{ 414{
415 VM_BUG_ON(PageTail(page)); 415 VM_BUG_ON_PAGE(PageTail(page), page);
416 return PageHead(page); 416 return PageHead(page);
417} 417}
418 418
@@ -460,25 +460,25 @@ static inline int PageTransTail(struct page *page)
460 */ 460 */
461static inline int PageSlabPfmemalloc(struct page *page) 461static inline int PageSlabPfmemalloc(struct page *page)
462{ 462{
463 VM_BUG_ON(!PageSlab(page)); 463 VM_BUG_ON_PAGE(!PageSlab(page), page);
464 return PageActive(page); 464 return PageActive(page);
465} 465}
466 466
467static inline void SetPageSlabPfmemalloc(struct page *page) 467static inline void SetPageSlabPfmemalloc(struct page *page)
468{ 468{
469 VM_BUG_ON(!PageSlab(page)); 469 VM_BUG_ON_PAGE(!PageSlab(page), page);
470 SetPageActive(page); 470 SetPageActive(page);
471} 471}
472 472
473static inline void __ClearPageSlabPfmemalloc(struct page *page) 473static inline void __ClearPageSlabPfmemalloc(struct page *page)
474{ 474{
475 VM_BUG_ON(!PageSlab(page)); 475 VM_BUG_ON_PAGE(!PageSlab(page), page);
476 __ClearPageActive(page); 476 __ClearPageActive(page);
477} 477}
478 478
479static inline void ClearPageSlabPfmemalloc(struct page *page) 479static inline void ClearPageSlabPfmemalloc(struct page *page)
480{ 480{
481 VM_BUG_ON(!PageSlab(page)); 481 VM_BUG_ON_PAGE(!PageSlab(page), page);
482 ClearPageActive(page); 482 ClearPageActive(page);
483} 483}
484 484
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index e3dea75a078b..1710d1b060ba 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -162,7 +162,7 @@ static inline int page_cache_get_speculative(struct page *page)
162 * disabling preempt, and hence no need for the "speculative get" that 162 * disabling preempt, and hence no need for the "speculative get" that
163 * SMP requires. 163 * SMP requires.
164 */ 164 */
165 VM_BUG_ON(page_count(page) == 0); 165 VM_BUG_ON_PAGE(page_count(page) == 0, page);
166 atomic_inc(&page->_count); 166 atomic_inc(&page->_count);
167 167
168#else 168#else
@@ -175,7 +175,7 @@ static inline int page_cache_get_speculative(struct page *page)
175 return 0; 175 return 0;
176 } 176 }
177#endif 177#endif
178 VM_BUG_ON(PageTail(page)); 178 VM_BUG_ON_PAGE(PageTail(page), page);
179 179
180 return 1; 180 return 1;
181} 181}
@@ -191,14 +191,14 @@ static inline int page_cache_add_speculative(struct page *page, int count)
191# ifdef CONFIG_PREEMPT_COUNT 191# ifdef CONFIG_PREEMPT_COUNT
192 VM_BUG_ON(!in_atomic()); 192 VM_BUG_ON(!in_atomic());
193# endif 193# endif
194 VM_BUG_ON(page_count(page) == 0); 194 VM_BUG_ON_PAGE(page_count(page) == 0, page);
195 atomic_add(count, &page->_count); 195 atomic_add(count, &page->_count);
196 196
197#else 197#else
198 if (unlikely(!atomic_add_unless(&page->_count, count, 0))) 198 if (unlikely(!atomic_add_unless(&page->_count, count, 0)))
199 return 0; 199 return 0;
200#endif 200#endif
201 VM_BUG_ON(PageCompound(page) && page != compound_head(page)); 201 VM_BUG_ON_PAGE(PageCompound(page) && page != compound_head(page), page);
202 202
203 return 1; 203 return 1;
204} 204}
@@ -210,7 +210,7 @@ static inline int page_freeze_refs(struct page *page, int count)
210 210
211static inline void page_unfreeze_refs(struct page *page, int count) 211static inline void page_unfreeze_refs(struct page *page, int count)
212{ 212{
213 VM_BUG_ON(page_count(page) != 0); 213 VM_BUG_ON_PAGE(page_count(page) != 0, page);
214 VM_BUG_ON(count == 0); 214 VM_BUG_ON(count == 0);
215 215
216 atomic_set(&page->_count, count); 216 atomic_set(&page->_count, count);
diff --git a/include/linux/parser.h b/include/linux/parser.h
index ea2281e726f6..39d5b7955b23 100644
--- a/include/linux/parser.h
+++ b/include/linux/parser.h
@@ -29,5 +29,6 @@ int match_token(char *, const match_table_t table, substring_t args[]);
29int match_int(substring_t *, int *result); 29int match_int(substring_t *, int *result);
30int match_octal(substring_t *, int *result); 30int match_octal(substring_t *, int *result);
31int match_hex(substring_t *, int *result); 31int match_hex(substring_t *, int *result);
32bool match_wildcard(const char *pattern, const char *str);
32size_t match_strlcpy(char *, const substring_t *, size_t); 33size_t match_strlcpy(char *, const substring_t *, size_t);
33char *match_strdup(const substring_t *); 34char *match_strdup(const substring_t *);
diff --git a/include/linux/pci-ats.h b/include/linux/pci-ats.h
index 68bcefd7fca0..72031785fe1d 100644
--- a/include/linux/pci-ats.h
+++ b/include/linux/pci-ats.h
@@ -56,10 +56,7 @@ static inline int pci_ats_enabled(struct pci_dev *dev)
56 56
57int pci_enable_pri(struct pci_dev *pdev, u32 reqs); 57int pci_enable_pri(struct pci_dev *pdev, u32 reqs);
58void pci_disable_pri(struct pci_dev *pdev); 58void pci_disable_pri(struct pci_dev *pdev);
59bool pci_pri_enabled(struct pci_dev *pdev);
60int pci_reset_pri(struct pci_dev *pdev); 59int pci_reset_pri(struct pci_dev *pdev);
61bool pci_pri_stopped(struct pci_dev *pdev);
62int pci_pri_status(struct pci_dev *pdev);
63 60
64#else /* CONFIG_PCI_PRI */ 61#else /* CONFIG_PCI_PRI */
65 62
@@ -72,25 +69,11 @@ static inline void pci_disable_pri(struct pci_dev *pdev)
72{ 69{
73} 70}
74 71
75static inline bool pci_pri_enabled(struct pci_dev *pdev)
76{
77 return false;
78}
79
80static inline int pci_reset_pri(struct pci_dev *pdev) 72static inline int pci_reset_pri(struct pci_dev *pdev)
81{ 73{
82 return -ENODEV; 74 return -ENODEV;
83} 75}
84 76
85static inline bool pci_pri_stopped(struct pci_dev *pdev)
86{
87 return true;
88}
89
90static inline int pci_pri_status(struct pci_dev *pdev)
91{
92 return -ENODEV;
93}
94#endif /* CONFIG_PCI_PRI */ 77#endif /* CONFIG_PCI_PRI */
95 78
96#ifdef CONFIG_PCI_PASID 79#ifdef CONFIG_PCI_PASID
diff --git a/include/linux/pci.h b/include/linux/pci.h
index a13d6825e586..fb57c892b214 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -224,7 +224,8 @@ enum pci_bus_speed {
224}; 224};
225 225
226struct pci_cap_saved_data { 226struct pci_cap_saved_data {
227 char cap_nr; 227 u16 cap_nr;
228 bool cap_extended;
228 unsigned int size; 229 unsigned int size;
229 u32 data[0]; 230 u32 data[0];
230}; 231};
@@ -351,7 +352,7 @@ struct pci_dev {
351 struct bin_attribute *res_attr_wc[DEVICE_COUNT_RESOURCE]; /* sysfs file for WC mapping of resources */ 352 struct bin_attribute *res_attr_wc[DEVICE_COUNT_RESOURCE]; /* sysfs file for WC mapping of resources */
352#ifdef CONFIG_PCI_MSI 353#ifdef CONFIG_PCI_MSI
353 struct list_head msi_list; 354 struct list_head msi_list;
354 struct kset *msi_kset; 355 const struct attribute_group **msi_irq_groups;
355#endif 356#endif
356 struct pci_vpd *vpd; 357 struct pci_vpd *vpd;
357#ifdef CONFIG_PCI_ATS 358#ifdef CONFIG_PCI_ATS
@@ -375,7 +376,6 @@ static inline struct pci_dev *pci_physfn(struct pci_dev *dev)
375} 376}
376 377
377struct pci_dev *pci_alloc_dev(struct pci_bus *bus); 378struct pci_dev *pci_alloc_dev(struct pci_bus *bus);
378struct pci_dev * __deprecated alloc_pci_dev(void);
379 379
380#define to_pci_dev(n) container_of(n, struct pci_dev, dev) 380#define to_pci_dev(n) container_of(n, struct pci_dev, dev)
381#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) 381#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL)
@@ -385,8 +385,6 @@ static inline int pci_channel_offline(struct pci_dev *pdev)
385 return (pdev->error_state != pci_channel_io_normal); 385 return (pdev->error_state != pci_channel_io_normal);
386} 386}
387 387
388extern struct resource busn_resource;
389
390struct pci_host_bridge_window { 388struct pci_host_bridge_window {
391 struct list_head list; 389 struct list_head list;
392 struct resource *res; /* host bridge aperture (CPU address) */ 390 struct resource *res; /* host bridge aperture (CPU address) */
@@ -551,8 +549,8 @@ int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn,
551 int reg, int len, u32 val); 549 int reg, int len, u32 val);
552 550
553struct pci_bus_region { 551struct pci_bus_region {
554 resource_size_t start; 552 dma_addr_t start;
555 resource_size_t end; 553 dma_addr_t end;
556}; 554};
557 555
558struct pci_dynids { 556struct pci_dynids {
@@ -634,8 +632,7 @@ struct pci_driver {
634 * DEFINE_PCI_DEVICE_TABLE - macro used to describe a pci device table 632 * DEFINE_PCI_DEVICE_TABLE - macro used to describe a pci device table
635 * @_table: device table name 633 * @_table: device table name
636 * 634 *
637 * This macro is used to create a struct pci_device_id array (a device table) 635 * This macro is deprecated and should not be used in new code.
638 * in a generic manner.
639 */ 636 */
640#define DEFINE_PCI_DEVICE_TABLE(_table) \ 637#define DEFINE_PCI_DEVICE_TABLE(_table) \
641 const struct pci_device_id _table[] 638 const struct pci_device_id _table[]
@@ -737,9 +734,9 @@ void pci_fixup_cardbus(struct pci_bus *);
737 734
738/* Generic PCI functions used internally */ 735/* Generic PCI functions used internally */
739 736
740void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, 737void pcibios_resource_to_bus(struct pci_bus *bus, struct pci_bus_region *region,
741 struct resource *res); 738 struct resource *res);
742void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, 739void pcibios_bus_to_resource(struct pci_bus *bus, struct resource *res,
743 struct pci_bus_region *region); 740 struct pci_bus_region *region);
744void pcibios_scan_specific_bus(int busn); 741void pcibios_scan_specific_bus(int busn);
745struct pci_bus *pci_find_bus(int domain, int busnr); 742struct pci_bus *pci_find_bus(int domain, int busnr);
@@ -763,7 +760,6 @@ struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr,
763 const char *name, 760 const char *name,
764 struct hotplug_slot *hotplug); 761 struct hotplug_slot *hotplug);
765void pci_destroy_slot(struct pci_slot *slot); 762void pci_destroy_slot(struct pci_slot *slot);
766void pci_renumber_slot(struct pci_slot *slot, int slot_nr);
767int pci_scan_slot(struct pci_bus *bus, int devfn); 763int pci_scan_slot(struct pci_bus *bus, int devfn);
768struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn); 764struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn);
769void pci_device_add(struct pci_dev *dev, struct pci_bus *bus); 765void pci_device_add(struct pci_dev *dev, struct pci_bus *bus);
@@ -779,6 +775,7 @@ struct pci_dev *pci_dev_get(struct pci_dev *dev);
779void pci_dev_put(struct pci_dev *dev); 775void pci_dev_put(struct pci_dev *dev);
780void pci_remove_bus(struct pci_bus *b); 776void pci_remove_bus(struct pci_bus *b);
781void pci_stop_and_remove_bus_device(struct pci_dev *dev); 777void pci_stop_and_remove_bus_device(struct pci_dev *dev);
778void pci_stop_and_remove_bus_device_locked(struct pci_dev *dev);
782void pci_stop_root_bus(struct pci_bus *bus); 779void pci_stop_root_bus(struct pci_bus *bus);
783void pci_remove_root_bus(struct pci_bus *bus); 780void pci_remove_root_bus(struct pci_bus *bus);
784void pci_setup_cardbus(struct pci_bus *bus); 781void pci_setup_cardbus(struct pci_bus *bus);
@@ -938,6 +935,7 @@ bool pci_check_and_unmask_intx(struct pci_dev *dev);
938void pci_msi_off(struct pci_dev *dev); 935void pci_msi_off(struct pci_dev *dev);
939int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size); 936int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size);
940int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask); 937int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask);
938int pci_wait_for_pending(struct pci_dev *dev, int pos, u16 mask);
941int pci_wait_for_pending_transaction(struct pci_dev *dev); 939int pci_wait_for_pending_transaction(struct pci_dev *dev);
942int pcix_get_max_mmrbc(struct pci_dev *dev); 940int pcix_get_max_mmrbc(struct pci_dev *dev);
943int pcix_get_mmrbc(struct pci_dev *dev); 941int pcix_get_mmrbc(struct pci_dev *dev);
@@ -951,10 +949,13 @@ int pcie_get_minimum_link(struct pci_dev *dev, enum pci_bus_speed *speed,
951int __pci_reset_function(struct pci_dev *dev); 949int __pci_reset_function(struct pci_dev *dev);
952int __pci_reset_function_locked(struct pci_dev *dev); 950int __pci_reset_function_locked(struct pci_dev *dev);
953int pci_reset_function(struct pci_dev *dev); 951int pci_reset_function(struct pci_dev *dev);
952int pci_try_reset_function(struct pci_dev *dev);
954int pci_probe_reset_slot(struct pci_slot *slot); 953int pci_probe_reset_slot(struct pci_slot *slot);
955int pci_reset_slot(struct pci_slot *slot); 954int pci_reset_slot(struct pci_slot *slot);
955int pci_try_reset_slot(struct pci_slot *slot);
956int pci_probe_reset_bus(struct pci_bus *bus); 956int pci_probe_reset_bus(struct pci_bus *bus);
957int pci_reset_bus(struct pci_bus *bus); 957int pci_reset_bus(struct pci_bus *bus);
958int pci_try_reset_bus(struct pci_bus *bus);
958void pci_reset_bridge_secondary_bus(struct pci_dev *dev); 959void pci_reset_bridge_secondary_bus(struct pci_dev *dev);
959void pci_update_resource(struct pci_dev *dev, int resno); 960void pci_update_resource(struct pci_dev *dev, int resno);
960int __must_check pci_assign_resource(struct pci_dev *dev, int i); 961int __must_check pci_assign_resource(struct pci_dev *dev, int i);
@@ -974,9 +975,14 @@ void __iomem __must_check *pci_platform_rom(struct pci_dev *pdev, size_t *size);
974int pci_save_state(struct pci_dev *dev); 975int pci_save_state(struct pci_dev *dev);
975void pci_restore_state(struct pci_dev *dev); 976void pci_restore_state(struct pci_dev *dev);
976struct pci_saved_state *pci_store_saved_state(struct pci_dev *dev); 977struct pci_saved_state *pci_store_saved_state(struct pci_dev *dev);
977int pci_load_saved_state(struct pci_dev *dev, struct pci_saved_state *state);
978int pci_load_and_free_saved_state(struct pci_dev *dev, 978int pci_load_and_free_saved_state(struct pci_dev *dev,
979 struct pci_saved_state **state); 979 struct pci_saved_state **state);
980struct pci_cap_saved_state *pci_find_saved_cap(struct pci_dev *dev, char cap);
981struct pci_cap_saved_state *pci_find_saved_ext_cap(struct pci_dev *dev,
982 u16 cap);
983int pci_add_cap_save_buffer(struct pci_dev *dev, char cap, unsigned int size);
984int pci_add_ext_cap_save_buffer(struct pci_dev *dev,
985 u16 cap, unsigned int size);
980int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state); 986int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state);
981int pci_set_power_state(struct pci_dev *dev, pci_power_t state); 987int pci_set_power_state(struct pci_dev *dev, pci_power_t state);
982pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); 988pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state);
@@ -985,7 +991,6 @@ void pci_pme_active(struct pci_dev *dev, bool enable);
985int __pci_enable_wake(struct pci_dev *dev, pci_power_t state, 991int __pci_enable_wake(struct pci_dev *dev, pci_power_t state,
986 bool runtime, bool enable); 992 bool runtime, bool enable);
987int pci_wake_from_d3(struct pci_dev *dev, bool enable); 993int pci_wake_from_d3(struct pci_dev *dev, bool enable);
988pci_power_t pci_target_state(struct pci_dev *dev);
989int pci_prepare_to_sleep(struct pci_dev *dev); 994int pci_prepare_to_sleep(struct pci_dev *dev);
990int pci_back_from_sleep(struct pci_dev *dev); 995int pci_back_from_sleep(struct pci_dev *dev);
991bool pci_dev_run_wake(struct pci_dev *dev); 996bool pci_dev_run_wake(struct pci_dev *dev);
@@ -998,21 +1003,10 @@ static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state,
998 return __pci_enable_wake(dev, state, false, enable); 1003 return __pci_enable_wake(dev, state, false, enable);
999} 1004}
1000 1005
1001#define PCI_EXP_IDO_REQUEST (1<<0) 1006/* PCI Virtual Channel */
1002#define PCI_EXP_IDO_COMPLETION (1<<1) 1007int pci_save_vc_state(struct pci_dev *dev);
1003void pci_enable_ido(struct pci_dev *dev, unsigned long type); 1008void pci_restore_vc_state(struct pci_dev *dev);
1004void pci_disable_ido(struct pci_dev *dev, unsigned long type); 1009void pci_allocate_vc_save_buffers(struct pci_dev *dev);
1005
1006enum pci_obff_signal_type {
1007 PCI_EXP_OBFF_SIGNAL_L0 = 0,
1008 PCI_EXP_OBFF_SIGNAL_ALWAYS = 1,
1009};
1010int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type);
1011void pci_disable_obff(struct pci_dev *dev);
1012
1013int pci_enable_ltr(struct pci_dev *dev);
1014void pci_disable_ltr(struct pci_dev *dev);
1015int pci_set_ltr(struct pci_dev *dev, int snoop_lat_ns, int nosnoop_lat_ns);
1016 1010
1017/* For use by arch with custom probe code */ 1011/* For use by arch with custom probe code */
1018void set_pcie_port_type(struct pci_dev *pdev); 1012void set_pcie_port_type(struct pci_dev *pdev);
@@ -1022,11 +1016,12 @@ void set_pcie_hotplug_bridge(struct pci_dev *pdev);
1022int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); 1016int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap);
1023unsigned int pci_rescan_bus_bridge_resize(struct pci_dev *bridge); 1017unsigned int pci_rescan_bus_bridge_resize(struct pci_dev *bridge);
1024unsigned int pci_rescan_bus(struct pci_bus *bus); 1018unsigned int pci_rescan_bus(struct pci_bus *bus);
1019void pci_lock_rescan_remove(void);
1020void pci_unlock_rescan_remove(void);
1025 1021
1026/* Vital product data routines */ 1022/* Vital product data routines */
1027ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf); 1023ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf);
1028ssize_t pci_write_vpd(struct pci_dev *dev, loff_t pos, size_t count, const void *buf); 1024ssize_t pci_write_vpd(struct pci_dev *dev, loff_t pos, size_t count, const void *buf);
1029int pci_vpd_truncate(struct pci_dev *dev, size_t size);
1030 1025
1031/* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */ 1026/* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */
1032resource_size_t pcibios_retrieve_fw_addr(struct pci_dev *dev, int idx); 1027resource_size_t pcibios_retrieve_fw_addr(struct pci_dev *dev, int idx);
@@ -1078,6 +1073,14 @@ int __must_check pci_bus_alloc_resource(struct pci_bus *bus,
1078 resource_size_t), 1073 resource_size_t),
1079 void *alignf_data); 1074 void *alignf_data);
1080 1075
1076static inline dma_addr_t pci_bus_address(struct pci_dev *pdev, int bar)
1077{
1078 struct pci_bus_region region;
1079
1080 pcibios_resource_to_bus(pdev->bus, &region, &pdev->resource[bar]);
1081 return region.start;
1082}
1083
1081/* Proper probing supporting hot-pluggable devices */ 1084/* Proper probing supporting hot-pluggable devices */
1082int __must_check __pci_register_driver(struct pci_driver *, struct module *, 1085int __must_check __pci_register_driver(struct pci_driver *, struct module *,
1083 const char *mod_name); 1086 const char *mod_name);
@@ -1115,7 +1118,6 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max,
1115 1118
1116void pci_walk_bus(struct pci_bus *top, int (*cb)(struct pci_dev *, void *), 1119void pci_walk_bus(struct pci_bus *top, int (*cb)(struct pci_dev *, void *),
1117 void *userdata); 1120 void *userdata);
1118int pci_cfg_space_size_ext(struct pci_dev *dev);
1119int pci_cfg_space_size(struct pci_dev *dev); 1121int pci_cfg_space_size(struct pci_dev *dev);
1120unsigned char pci_bus_max_busnr(struct pci_bus *bus); 1122unsigned char pci_bus_max_busnr(struct pci_bus *bus);
1121void pci_setup_bridge(struct pci_bus *bus); 1123void pci_setup_bridge(struct pci_bus *bus);
@@ -1154,59 +1156,42 @@ struct msix_entry {
1154}; 1156};
1155 1157
1156 1158
1157#ifndef CONFIG_PCI_MSI 1159#ifdef CONFIG_PCI_MSI
1158static inline int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec) 1160int pci_msi_vec_count(struct pci_dev *dev);
1159{ 1161int pci_enable_msi_block(struct pci_dev *dev, int nvec);
1160 return -1;
1161}
1162
1163static inline int
1164pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec)
1165{
1166 return -1;
1167}
1168
1169static inline void pci_msi_shutdown(struct pci_dev *dev)
1170{ }
1171static inline void pci_disable_msi(struct pci_dev *dev)
1172{ }
1173
1174static inline int pci_msix_table_size(struct pci_dev *dev)
1175{
1176 return 0;
1177}
1178static inline int pci_enable_msix(struct pci_dev *dev,
1179 struct msix_entry *entries, int nvec)
1180{
1181 return -1;
1182}
1183
1184static inline void pci_msix_shutdown(struct pci_dev *dev)
1185{ }
1186static inline void pci_disable_msix(struct pci_dev *dev)
1187{ }
1188
1189static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev)
1190{ }
1191
1192static inline void pci_restore_msi_state(struct pci_dev *dev)
1193{ }
1194static inline int pci_msi_enabled(void)
1195{
1196 return 0;
1197}
1198#else
1199int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec);
1200int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec);
1201void pci_msi_shutdown(struct pci_dev *dev); 1162void pci_msi_shutdown(struct pci_dev *dev);
1202void pci_disable_msi(struct pci_dev *dev); 1163void pci_disable_msi(struct pci_dev *dev);
1203int pci_msix_table_size(struct pci_dev *dev); 1164int pci_msix_vec_count(struct pci_dev *dev);
1204int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec); 1165int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec);
1205void pci_msix_shutdown(struct pci_dev *dev); 1166void pci_msix_shutdown(struct pci_dev *dev);
1206void pci_disable_msix(struct pci_dev *dev); 1167void pci_disable_msix(struct pci_dev *dev);
1207void msi_remove_pci_irq_vectors(struct pci_dev *dev); 1168void msi_remove_pci_irq_vectors(struct pci_dev *dev);
1208void pci_restore_msi_state(struct pci_dev *dev); 1169void pci_restore_msi_state(struct pci_dev *dev);
1209int pci_msi_enabled(void); 1170int pci_msi_enabled(void);
1171int pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec);
1172int pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries,
1173 int minvec, int maxvec);
1174#else
1175static inline int pci_msi_vec_count(struct pci_dev *dev) { return -ENOSYS; }
1176static inline int pci_enable_msi_block(struct pci_dev *dev, int nvec)
1177{ return -ENOSYS; }
1178static inline void pci_msi_shutdown(struct pci_dev *dev) { }
1179static inline void pci_disable_msi(struct pci_dev *dev) { }
1180static inline int pci_msix_vec_count(struct pci_dev *dev) { return -ENOSYS; }
1181static inline int pci_enable_msix(struct pci_dev *dev,
1182 struct msix_entry *entries, int nvec)
1183{ return -ENOSYS; }
1184static inline void pci_msix_shutdown(struct pci_dev *dev) { }
1185static inline void pci_disable_msix(struct pci_dev *dev) { }
1186static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) { }
1187static inline void pci_restore_msi_state(struct pci_dev *dev) { }
1188static inline int pci_msi_enabled(void) { return 0; }
1189static inline int pci_enable_msi_range(struct pci_dev *dev, int minvec,
1190 int maxvec)
1191{ return -ENOSYS; }
1192static inline int pci_enable_msix_range(struct pci_dev *dev,
1193 struct msix_entry *entries, int minvec, int maxvec)
1194{ return -ENOSYS; }
1210#endif 1195#endif
1211 1196
1212#ifdef CONFIG_PCIEPORTBUS 1197#ifdef CONFIG_PCIEPORTBUS
@@ -1217,12 +1202,10 @@ extern bool pcie_ports_auto;
1217#define pcie_ports_auto false 1202#define pcie_ports_auto false
1218#endif 1203#endif
1219 1204
1220#ifndef CONFIG_PCIEASPM 1205#ifdef CONFIG_PCIEASPM
1221static inline int pcie_aspm_enabled(void) { return 0; }
1222static inline bool pcie_aspm_support_enabled(void) { return false; }
1223#else
1224int pcie_aspm_enabled(void);
1225bool pcie_aspm_support_enabled(void); 1206bool pcie_aspm_support_enabled(void);
1207#else
1208static inline bool pcie_aspm_support_enabled(void) { return false; }
1226#endif 1209#endif
1227 1210
1228#ifdef CONFIG_PCIEAER 1211#ifdef CONFIG_PCIEAER
@@ -1233,15 +1216,12 @@ static inline void pci_no_aer(void) { }
1233static inline bool pci_aer_available(void) { return false; } 1216static inline bool pci_aer_available(void) { return false; }
1234#endif 1217#endif
1235 1218
1236#ifndef CONFIG_PCIE_ECRC 1219#ifdef CONFIG_PCIE_ECRC
1237static inline void pcie_set_ecrc_checking(struct pci_dev *dev)
1238{
1239 return;
1240}
1241static inline void pcie_ecrc_get_policy(char *str) {};
1242#else
1243void pcie_set_ecrc_checking(struct pci_dev *dev); 1220void pcie_set_ecrc_checking(struct pci_dev *dev);
1244void pcie_ecrc_get_policy(char *str); 1221void pcie_ecrc_get_policy(char *str);
1222#else
1223static inline void pcie_set_ecrc_checking(struct pci_dev *dev) { }
1224static inline void pcie_ecrc_get_policy(char *str) { }
1245#endif 1225#endif
1246 1226
1247#define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1) 1227#define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1)
@@ -1265,15 +1245,8 @@ void pci_cfg_access_unlock(struct pci_dev *dev);
1265extern int pci_domains_supported; 1245extern int pci_domains_supported;
1266#else 1246#else
1267enum { pci_domains_supported = 0 }; 1247enum { pci_domains_supported = 0 };
1268static inline int pci_domain_nr(struct pci_bus *bus) 1248static inline int pci_domain_nr(struct pci_bus *bus) { return 0; }
1269{ 1249static inline int pci_proc_domain(struct pci_bus *bus) { return 0; }
1270 return 0;
1271}
1272
1273static inline int pci_proc_domain(struct pci_bus *bus)
1274{
1275 return 0;
1276}
1277#endif /* CONFIG_PCI_DOMAINS */ 1250#endif /* CONFIG_PCI_DOMAINS */
1278 1251
1279/* some architectures require additional setup to direct VGA traffic */ 1252/* some architectures require additional setup to direct VGA traffic */
@@ -1302,180 +1275,88 @@ _PCI_NOP_ALL(write,)
1302static inline struct pci_dev *pci_get_device(unsigned int vendor, 1275static inline struct pci_dev *pci_get_device(unsigned int vendor,
1303 unsigned int device, 1276 unsigned int device,
1304 struct pci_dev *from) 1277 struct pci_dev *from)
1305{ 1278{ return NULL; }
1306 return NULL;
1307}
1308 1279
1309static inline struct pci_dev *pci_get_subsys(unsigned int vendor, 1280static inline struct pci_dev *pci_get_subsys(unsigned int vendor,
1310 unsigned int device, 1281 unsigned int device,
1311 unsigned int ss_vendor, 1282 unsigned int ss_vendor,
1312 unsigned int ss_device, 1283 unsigned int ss_device,
1313 struct pci_dev *from) 1284 struct pci_dev *from)
1314{ 1285{ return NULL; }
1315 return NULL;
1316}
1317 1286
1318static inline struct pci_dev *pci_get_class(unsigned int class, 1287static inline struct pci_dev *pci_get_class(unsigned int class,
1319 struct pci_dev *from) 1288 struct pci_dev *from)
1320{ 1289{ return NULL; }
1321 return NULL;
1322}
1323 1290
1324#define pci_dev_present(ids) (0) 1291#define pci_dev_present(ids) (0)
1325#define no_pci_devices() (1) 1292#define no_pci_devices() (1)
1326#define pci_dev_put(dev) do { } while (0) 1293#define pci_dev_put(dev) do { } while (0)
1327 1294
1328static inline void pci_set_master(struct pci_dev *dev) 1295static inline void pci_set_master(struct pci_dev *dev) { }
1329{ } 1296static inline int pci_enable_device(struct pci_dev *dev) { return -EIO; }
1330 1297static inline void pci_disable_device(struct pci_dev *dev) { }
1331static inline int pci_enable_device(struct pci_dev *dev)
1332{
1333 return -EIO;
1334}
1335
1336static inline void pci_disable_device(struct pci_dev *dev)
1337{ }
1338
1339static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) 1298static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask)
1340{ 1299{ return -EIO; }
1341 return -EIO;
1342}
1343
1344static inline int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) 1300static inline int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
1345{ 1301{ return -EIO; }
1346 return -EIO;
1347}
1348
1349static inline int pci_set_dma_max_seg_size(struct pci_dev *dev, 1302static inline int pci_set_dma_max_seg_size(struct pci_dev *dev,
1350 unsigned int size) 1303 unsigned int size)
1351{ 1304{ return -EIO; }
1352 return -EIO;
1353}
1354
1355static inline int pci_set_dma_seg_boundary(struct pci_dev *dev, 1305static inline int pci_set_dma_seg_boundary(struct pci_dev *dev,
1356 unsigned long mask) 1306 unsigned long mask)
1357{ 1307{ return -EIO; }
1358 return -EIO;
1359}
1360
1361static inline int pci_assign_resource(struct pci_dev *dev, int i) 1308static inline int pci_assign_resource(struct pci_dev *dev, int i)
1362{ 1309{ return -EBUSY; }
1363 return -EBUSY;
1364}
1365
1366static inline int __pci_register_driver(struct pci_driver *drv, 1310static inline int __pci_register_driver(struct pci_driver *drv,
1367 struct module *owner) 1311 struct module *owner)
1368{ 1312{ return 0; }
1369 return 0;
1370}
1371
1372static inline int pci_register_driver(struct pci_driver *drv) 1313static inline int pci_register_driver(struct pci_driver *drv)
1373{ 1314{ return 0; }
1374 return 0; 1315static inline void pci_unregister_driver(struct pci_driver *drv) { }
1375}
1376
1377static inline void pci_unregister_driver(struct pci_driver *drv)
1378{ }
1379
1380static inline int pci_find_capability(struct pci_dev *dev, int cap) 1316static inline int pci_find_capability(struct pci_dev *dev, int cap)
1381{ 1317{ return 0; }
1382 return 0;
1383}
1384
1385static inline int pci_find_next_capability(struct pci_dev *dev, u8 post, 1318static inline int pci_find_next_capability(struct pci_dev *dev, u8 post,
1386 int cap) 1319 int cap)
1387{ 1320{ return 0; }
1388 return 0;
1389}
1390
1391static inline int pci_find_ext_capability(struct pci_dev *dev, int cap) 1321static inline int pci_find_ext_capability(struct pci_dev *dev, int cap)
1392{ 1322{ return 0; }
1393 return 0;
1394}
1395 1323
1396/* Power management related routines */ 1324/* Power management related routines */
1397static inline int pci_save_state(struct pci_dev *dev) 1325static inline int pci_save_state(struct pci_dev *dev) { return 0; }
1398{ 1326static inline void pci_restore_state(struct pci_dev *dev) { }
1399 return 0;
1400}
1401
1402static inline void pci_restore_state(struct pci_dev *dev)
1403{ }
1404
1405static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state) 1327static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state)
1406{ 1328{ return 0; }
1407 return 0;
1408}
1409
1410static inline int pci_wake_from_d3(struct pci_dev *dev, bool enable) 1329static inline int pci_wake_from_d3(struct pci_dev *dev, bool enable)
1411{ 1330{ return 0; }
1412 return 0;
1413}
1414
1415static inline pci_power_t pci_choose_state(struct pci_dev *dev, 1331static inline pci_power_t pci_choose_state(struct pci_dev *dev,
1416 pm_message_t state) 1332 pm_message_t state)
1417{ 1333{ return PCI_D0; }
1418 return PCI_D0;
1419}
1420
1421static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, 1334static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state,
1422 int enable) 1335 int enable)
1423{ 1336{ return 0; }
1424 return 0;
1425}
1426
1427static inline void pci_enable_ido(struct pci_dev *dev, unsigned long type)
1428{
1429}
1430
1431static inline void pci_disable_ido(struct pci_dev *dev, unsigned long type)
1432{
1433}
1434
1435static inline int pci_enable_obff(struct pci_dev *dev, unsigned long type)
1436{
1437 return 0;
1438}
1439
1440static inline void pci_disable_obff(struct pci_dev *dev)
1441{
1442}
1443 1337
1444static inline int pci_request_regions(struct pci_dev *dev, const char *res_name) 1338static inline int pci_request_regions(struct pci_dev *dev, const char *res_name)
1445{ 1339{ return -EIO; }
1446 return -EIO; 1340static inline void pci_release_regions(struct pci_dev *dev) { }
1447}
1448
1449static inline void pci_release_regions(struct pci_dev *dev)
1450{ }
1451 1341
1452#define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) 1342#define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0)
1453 1343
1454static inline void pci_block_cfg_access(struct pci_dev *dev) 1344static inline void pci_block_cfg_access(struct pci_dev *dev) { }
1455{ }
1456
1457static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev) 1345static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev)
1458{ return 0; } 1346{ return 0; }
1459 1347static inline void pci_unblock_cfg_access(struct pci_dev *dev) { }
1460static inline void pci_unblock_cfg_access(struct pci_dev *dev)
1461{ }
1462 1348
1463static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from) 1349static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from)
1464{ return NULL; } 1350{ return NULL; }
1465
1466static inline struct pci_dev *pci_get_slot(struct pci_bus *bus, 1351static inline struct pci_dev *pci_get_slot(struct pci_bus *bus,
1467 unsigned int devfn) 1352 unsigned int devfn)
1468{ return NULL; } 1353{ return NULL; }
1469
1470static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus, 1354static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus,
1471 unsigned int devfn) 1355 unsigned int devfn)
1472{ return NULL; } 1356{ return NULL; }
1473 1357
1474static inline int pci_domain_nr(struct pci_bus *bus) 1358static inline int pci_domain_nr(struct pci_bus *bus) { return 0; }
1475{ return 0; } 1359static inline struct pci_dev *pci_dev_get(struct pci_dev *dev) { return NULL; }
1476
1477static inline struct pci_dev *pci_dev_get(struct pci_dev *dev)
1478{ return NULL; }
1479 1360
1480#define dev_is_pci(d) (false) 1361#define dev_is_pci(d) (false)
1481#define dev_is_pf(d) (false) 1362#define dev_is_pf(d) (false)
@@ -1486,10 +1367,6 @@ static inline struct pci_dev *pci_dev_get(struct pci_dev *dev)
1486 1367
1487#include <asm/pci.h> 1368#include <asm/pci.h>
1488 1369
1489#ifndef PCIBIOS_MAX_MEM_32
1490#define PCIBIOS_MAX_MEM_32 (-1)
1491#endif
1492
1493/* these helpers provide future and backwards compatibility 1370/* these helpers provide future and backwards compatibility
1494 * for accessing popular PCI BAR info */ 1371 * for accessing popular PCI BAR info */
1495#define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start) 1372#define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start)
@@ -1635,7 +1512,7 @@ struct pci_dev *pci_get_dma_source(struct pci_dev *dev);
1635int pci_dev_specific_acs_enabled(struct pci_dev *dev, u16 acs_flags); 1512int pci_dev_specific_acs_enabled(struct pci_dev *dev, u16 acs_flags);
1636#else 1513#else
1637static inline void pci_fixup_device(enum pci_fixup_pass pass, 1514static inline void pci_fixup_device(enum pci_fixup_pass pass,
1638 struct pci_dev *dev) {} 1515 struct pci_dev *dev) { }
1639static inline struct pci_dev *pci_get_dma_source(struct pci_dev *dev) 1516static inline struct pci_dev *pci_get_dma_source(struct pci_dev *dev)
1640{ 1517{
1641 return pci_dev_get(dev); 1518 return pci_dev_get(dev);
@@ -1707,32 +1584,17 @@ int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs);
1707int pci_sriov_get_totalvfs(struct pci_dev *dev); 1584int pci_sriov_get_totalvfs(struct pci_dev *dev);
1708#else 1585#else
1709static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) 1586static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)
1710{ 1587{ return -ENODEV; }
1711 return -ENODEV; 1588static inline void pci_disable_sriov(struct pci_dev *dev) { }
1712}
1713static inline void pci_disable_sriov(struct pci_dev *dev)
1714{
1715}
1716static inline irqreturn_t pci_sriov_migration(struct pci_dev *dev) 1589static inline irqreturn_t pci_sriov_migration(struct pci_dev *dev)
1717{ 1590{ return IRQ_NONE; }
1718 return IRQ_NONE; 1591static inline int pci_num_vf(struct pci_dev *dev) { return 0; }
1719}
1720static inline int pci_num_vf(struct pci_dev *dev)
1721{
1722 return 0;
1723}
1724static inline int pci_vfs_assigned(struct pci_dev *dev) 1592static inline int pci_vfs_assigned(struct pci_dev *dev)
1725{ 1593{ return 0; }
1726 return 0;
1727}
1728static inline int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs) 1594static inline int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs)
1729{ 1595{ return 0; }
1730 return 0;
1731}
1732static inline int pci_sriov_get_totalvfs(struct pci_dev *dev) 1596static inline int pci_sriov_get_totalvfs(struct pci_dev *dev)
1733{ 1597{ return 0; }
1734 return 0;
1735}
1736#endif 1598#endif
1737 1599
1738#if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) 1600#if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE)
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h
index a2e2f1d17e16..5f2e559af6b0 100644
--- a/include/linux/pci_hotplug.h
+++ b/include/linux/pci_hotplug.h
@@ -175,8 +175,7 @@ struct hotplug_params {
175}; 175};
176 176
177#ifdef CONFIG_ACPI 177#ifdef CONFIG_ACPI
178#include <acpi/acpi.h> 178#include <linux/acpi.h>
179#include <acpi/acpi_bus.h>
180int pci_get_hp_params(struct pci_dev *dev, struct hotplug_params *hpp); 179int pci_get_hp_params(struct pci_dev *dev, struct hotplug_params *hpp);
181int acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev, u32 flags); 180int acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev, u32 flags);
182int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle); 181int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle);
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h
index 57e890abe1f0..a5fc7d01aad6 100644
--- a/include/linux/percpu-defs.h
+++ b/include/linux/percpu-defs.h
@@ -69,6 +69,7 @@
69 __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \ 69 __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \
70 extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ 70 extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \
71 __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ 71 __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \
72 extern __PCPU_ATTRS(sec) __typeof__(type) name; \
72 __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES __weak \ 73 __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES __weak \
73 __typeof__(type) name 74 __typeof__(type) name
74#else 75#else
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 9e4761caa80c..e3817d2441b6 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -1,6 +1,7 @@
1#ifndef __LINUX_PERCPU_H 1#ifndef __LINUX_PERCPU_H
2#define __LINUX_PERCPU_H 2#define __LINUX_PERCPU_H
3 3
4#include <linux/mmdebug.h>
4#include <linux/preempt.h> 5#include <linux/preempt.h>
5#include <linux/smp.h> 6#include <linux/smp.h>
6#include <linux/cpumask.h> 7#include <linux/cpumask.h>
diff --git a/include/linux/percpu_ida.h b/include/linux/percpu_ida.h
index 1900bd0fa639..f5cfdd6a5539 100644
--- a/include/linux/percpu_ida.h
+++ b/include/linux/percpu_ida.h
@@ -4,6 +4,7 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/bitops.h> 5#include <linux/bitops.h>
6#include <linux/init.h> 6#include <linux/init.h>
7#include <linux/sched.h>
7#include <linux/spinlock_types.h> 8#include <linux/spinlock_types.h>
8#include <linux/wait.h> 9#include <linux/wait.h>
9#include <linux/cpumask.h> 10#include <linux/cpumask.h>
@@ -61,7 +62,7 @@ struct percpu_ida {
61/* Max size of percpu freelist, */ 62/* Max size of percpu freelist, */
62#define IDA_DEFAULT_PCPU_SIZE ((IDA_DEFAULT_PCPU_BATCH_MOVE * 3) / 2) 63#define IDA_DEFAULT_PCPU_SIZE ((IDA_DEFAULT_PCPU_BATCH_MOVE * 3) / 2)
63 64
64int percpu_ida_alloc(struct percpu_ida *pool, gfp_t gfp); 65int percpu_ida_alloc(struct percpu_ida *pool, int state);
65void percpu_ida_free(struct percpu_ida *pool, unsigned tag); 66void percpu_ida_free(struct percpu_ida *pool, unsigned tag);
66 67
67void percpu_ida_destroy(struct percpu_ida *pool); 68void percpu_ida_destroy(struct percpu_ida *pool);
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 2e069d1288df..e56b07f5c9b6 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -320,6 +320,7 @@ struct perf_event {
320 struct list_head migrate_entry; 320 struct list_head migrate_entry;
321 321
322 struct hlist_node hlist_entry; 322 struct hlist_node hlist_entry;
323 struct list_head active_entry;
323 int nr_siblings; 324 int nr_siblings;
324 int group_flags; 325 int group_flags;
325 struct perf_event *group_leader; 326 struct perf_event *group_leader;
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 48a4dc3cb8cf..565188ca328f 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * include/linux/phy.h
3 *
4 * Framework and drivers for configuring and reading different PHYs 2 * Framework and drivers for configuring and reading different PHYs
5 * Based on code in sungem_phy.c and gianfar_phy.c 3 * Based on code in sungem_phy.c and gianfar_phy.c
6 * 4 *
@@ -27,18 +25,27 @@
27 25
28#include <linux/atomic.h> 26#include <linux/atomic.h>
29 27
30#define PHY_BASIC_FEATURES (SUPPORTED_10baseT_Half | \ 28#define PHY_DEFAULT_FEATURES (SUPPORTED_Autoneg | \
31 SUPPORTED_10baseT_Full | \
32 SUPPORTED_100baseT_Half | \
33 SUPPORTED_100baseT_Full | \
34 SUPPORTED_Autoneg | \
35 SUPPORTED_TP | \ 29 SUPPORTED_TP | \
36 SUPPORTED_MII) 30 SUPPORTED_MII)
37 31
38#define PHY_GBIT_FEATURES (PHY_BASIC_FEATURES | \ 32#define PHY_10BT_FEATURES (SUPPORTED_10baseT_Half | \
39 SUPPORTED_1000baseT_Half | \ 33 SUPPORTED_10baseT_Full)
34
35#define PHY_100BT_FEATURES (SUPPORTED_100baseT_Half | \
36 SUPPORTED_100baseT_Full)
37
38#define PHY_1000BT_FEATURES (SUPPORTED_1000baseT_Half | \
40 SUPPORTED_1000baseT_Full) 39 SUPPORTED_1000baseT_Full)
41 40
41#define PHY_BASIC_FEATURES (PHY_10BT_FEATURES | \
42 PHY_100BT_FEATURES | \
43 PHY_DEFAULT_FEATURES)
44
45#define PHY_GBIT_FEATURES (PHY_BASIC_FEATURES | \
46 PHY_1000BT_FEATURES)
47
48
42/* 49/*
43 * Set phydev->irq to PHY_POLL if interrupts are not supported, 50 * Set phydev->irq to PHY_POLL if interrupts are not supported,
44 * or not desired for this PHY. Set to PHY_IGNORE_INTERRUPT if 51 * or not desired for this PHY. Set to PHY_IGNORE_INTERRUPT if
@@ -66,6 +73,7 @@ typedef enum {
66 PHY_INTERFACE_MODE_RGMII_TXID, 73 PHY_INTERFACE_MODE_RGMII_TXID,
67 PHY_INTERFACE_MODE_RTBI, 74 PHY_INTERFACE_MODE_RTBI,
68 PHY_INTERFACE_MODE_SMII, 75 PHY_INTERFACE_MODE_SMII,
76 PHY_INTERFACE_MODE_XGMII,
69} phy_interface_t; 77} phy_interface_t;
70 78
71 79
@@ -231,7 +239,7 @@ int mdiobus_write(struct mii_bus *bus, int addr, u32 regnum, u16 val);
231 * - phy_stop moves to HALTED 239 * - phy_stop moves to HALTED
232 */ 240 */
233enum phy_state { 241enum phy_state {
234 PHY_DOWN=0, 242 PHY_DOWN = 0,
235 PHY_STARTING, 243 PHY_STARTING,
236 PHY_READY, 244 PHY_READY,
237 PHY_PENDING, 245 PHY_PENDING,
@@ -275,11 +283,9 @@ struct phy_c45_device_ids {
275 * attached_dev: The attached enet driver's device instance ptr 283 * attached_dev: The attached enet driver's device instance ptr
276 * adjust_link: Callback for the enet controller to respond to 284 * adjust_link: Callback for the enet controller to respond to
277 * changes in the link state. 285 * changes in the link state.
278 * adjust_state: Callback for the enet driver to respond to
279 * changes in the state machine.
280 * 286 *
281 * speed, duplex, pause, supported, advertising, and 287 * speed, duplex, pause, supported, advertising, lp_advertising,
282 * autoneg are used like in mii_if_info 288 * and autoneg are used like in mii_if_info
283 * 289 *
284 * interrupts currently only supports enabled or disabled, 290 * interrupts currently only supports enabled or disabled,
285 * but could be changed in the future to support enabling 291 * but could be changed in the future to support enabling
@@ -331,6 +337,7 @@ struct phy_device {
331 /* See mii.h for more info */ 337 /* See mii.h for more info */
332 u32 supported; 338 u32 supported;
333 u32 advertising; 339 u32 advertising;
340 u32 lp_advertising;
334 341
335 int autoneg; 342 int autoneg;
336 343
@@ -356,8 +363,6 @@ struct phy_device {
356 struct net_device *attached_dev; 363 struct net_device *attached_dev;
357 364
358 void (*adjust_link)(struct net_device *dev); 365 void (*adjust_link)(struct net_device *dev);
359
360 void (*adjust_state)(struct net_device *dev);
361}; 366};
362#define to_phy_device(d) container_of(d, struct phy_device, dev) 367#define to_phy_device(d) container_of(d, struct phy_device, dev)
363 368
@@ -484,6 +489,24 @@ struct phy_fixup {
484}; 489};
485 490
486/** 491/**
492 * phy_read_mmd - Convenience function for reading a register
493 * from an MMD on a given PHY.
494 * @phydev: The phy_device struct
495 * @devad: The MMD to read from
496 * @regnum: The register on the MMD to read
497 *
498 * Same rules as for phy_read();
499 */
500static inline int phy_read_mmd(struct phy_device *phydev, int devad, u32 regnum)
501{
502 if (!phydev->is_c45)
503 return -EOPNOTSUPP;
504
505 return mdiobus_read(phydev->bus, phydev->addr,
506 MII_ADDR_C45 | (devad << 16) | (regnum & 0xffff));
507}
508
509/**
487 * phy_read - Convenience function for reading a given PHY register 510 * phy_read - Convenience function for reading a given PHY register
488 * @phydev: the phy_device struct 511 * @phydev: the phy_device struct
489 * @regnum: register number to read 512 * @regnum: register number to read
@@ -533,20 +556,46 @@ static inline bool phy_is_internal(struct phy_device *phydev)
533 return phydev->is_internal; 556 return phydev->is_internal;
534} 557}
535 558
559/**
560 * phy_write_mmd - Convenience function for writing a register
561 * on an MMD on a given PHY.
562 * @phydev: The phy_device struct
563 * @devad: The MMD to read from
564 * @regnum: The register on the MMD to read
565 * @val: value to write to @regnum
566 *
567 * Same rules as for phy_write();
568 */
569static inline int phy_write_mmd(struct phy_device *phydev, int devad,
570 u32 regnum, u16 val)
571{
572 if (!phydev->is_c45)
573 return -EOPNOTSUPP;
574
575 regnum = MII_ADDR_C45 | ((devad & 0x1f) << 16) | (regnum & 0xffff);
576
577 return mdiobus_write(phydev->bus, phydev->addr, regnum, val);
578}
579
536struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id, 580struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id,
537 bool is_c45, struct phy_c45_device_ids *c45_ids); 581 bool is_c45,
582 struct phy_c45_device_ids *c45_ids);
538struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45); 583struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45);
539int phy_device_register(struct phy_device *phy); 584int phy_device_register(struct phy_device *phy);
540int phy_init_hw(struct phy_device *phydev); 585int phy_init_hw(struct phy_device *phydev);
541struct phy_device * phy_attach(struct net_device *dev, 586int phy_suspend(struct phy_device *phydev);
542 const char *bus_id, phy_interface_t interface); 587int phy_resume(struct phy_device *phydev);
588struct phy_device *phy_attach(struct net_device *dev, const char *bus_id,
589 phy_interface_t interface);
543struct phy_device *phy_find_first(struct mii_bus *bus); 590struct phy_device *phy_find_first(struct mii_bus *bus);
591int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
592 u32 flags, phy_interface_t interface);
544int phy_connect_direct(struct net_device *dev, struct phy_device *phydev, 593int phy_connect_direct(struct net_device *dev, struct phy_device *phydev,
545 void (*handler)(struct net_device *), 594 void (*handler)(struct net_device *),
546 phy_interface_t interface); 595 phy_interface_t interface);
547struct phy_device * phy_connect(struct net_device *dev, const char *bus_id, 596struct phy_device *phy_connect(struct net_device *dev, const char *bus_id,
548 void (*handler)(struct net_device *), 597 void (*handler)(struct net_device *),
549 phy_interface_t interface); 598 phy_interface_t interface);
550void phy_disconnect(struct phy_device *phydev); 599void phy_disconnect(struct phy_device *phydev);
551void phy_detach(struct phy_device *phydev); 600void phy_detach(struct phy_device *phydev);
552void phy_start(struct phy_device *phydev); 601void phy_start(struct phy_device *phydev);
@@ -555,7 +604,8 @@ int phy_start_aneg(struct phy_device *phydev);
555 604
556int phy_stop_interrupts(struct phy_device *phydev); 605int phy_stop_interrupts(struct phy_device *phydev);
557 606
558static inline int phy_read_status(struct phy_device *phydev) { 607static inline int phy_read_status(struct phy_device *phydev)
608{
559 return phydev->drv->read_status(phydev); 609 return phydev->drv->read_status(phydev);
560} 610}
561 611
@@ -573,31 +623,29 @@ int phy_drivers_register(struct phy_driver *new_driver, int n);
573void phy_state_machine(struct work_struct *work); 623void phy_state_machine(struct work_struct *work);
574void phy_change(struct work_struct *work); 624void phy_change(struct work_struct *work);
575void phy_mac_interrupt(struct phy_device *phydev, int new_link); 625void phy_mac_interrupt(struct phy_device *phydev, int new_link);
576void phy_start_machine(struct phy_device *phydev, 626void phy_start_machine(struct phy_device *phydev);
577 void (*handler)(struct net_device *));
578void phy_stop_machine(struct phy_device *phydev); 627void phy_stop_machine(struct phy_device *phydev);
579int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); 628int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd);
580int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd); 629int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd);
581int phy_mii_ioctl(struct phy_device *phydev, 630int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd);
582 struct ifreq *ifr, int cmd);
583int phy_start_interrupts(struct phy_device *phydev); 631int phy_start_interrupts(struct phy_device *phydev);
584void phy_print_status(struct phy_device *phydev); 632void phy_print_status(struct phy_device *phydev);
585void phy_device_free(struct phy_device *phydev); 633void phy_device_free(struct phy_device *phydev);
586 634
587int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask, 635int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask,
588 int (*run)(struct phy_device *)); 636 int (*run)(struct phy_device *));
589int phy_register_fixup_for_id(const char *bus_id, 637int phy_register_fixup_for_id(const char *bus_id,
590 int (*run)(struct phy_device *)); 638 int (*run)(struct phy_device *));
591int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask, 639int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask,
592 int (*run)(struct phy_device *)); 640 int (*run)(struct phy_device *));
593int phy_scan_fixups(struct phy_device *phydev);
594 641
595int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable); 642int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable);
596int phy_get_eee_err(struct phy_device *phydev); 643int phy_get_eee_err(struct phy_device *phydev);
597int phy_ethtool_set_eee(struct phy_device *phydev, struct ethtool_eee *data); 644int phy_ethtool_set_eee(struct phy_device *phydev, struct ethtool_eee *data);
598int phy_ethtool_get_eee(struct phy_device *phydev, struct ethtool_eee *data); 645int phy_ethtool_get_eee(struct phy_device *phydev, struct ethtool_eee *data);
599int phy_ethtool_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol); 646int phy_ethtool_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol);
600void phy_ethtool_get_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol); 647void phy_ethtool_get_wol(struct phy_device *phydev,
648 struct ethtool_wolinfo *wol);
601 649
602int __init mdio_bus_init(void); 650int __init mdio_bus_init(void);
603void mdio_bus_exit(void); 651void mdio_bus_exit(void);
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
index 6d722695e027..3f83459dbb20 100644
--- a/include/linux/phy/phy.h
+++ b/include/linux/phy/phy.h
@@ -38,6 +38,14 @@ struct phy_ops {
38}; 38};
39 39
40/** 40/**
41 * struct phy_attrs - represents phy attributes
42 * @bus_width: Data path width implemented by PHY
43 */
44struct phy_attrs {
45 u32 bus_width;
46};
47
48/**
41 * struct phy - represents the phy device 49 * struct phy - represents the phy device
42 * @dev: phy device 50 * @dev: phy device
43 * @id: id of the phy device 51 * @id: id of the phy device
@@ -46,6 +54,7 @@ struct phy_ops {
46 * @mutex: mutex to protect phy_ops 54 * @mutex: mutex to protect phy_ops
47 * @init_count: used to protect when the PHY is used by multiple consumers 55 * @init_count: used to protect when the PHY is used by multiple consumers
48 * @power_count: used to protect when the PHY is used by multiple consumers 56 * @power_count: used to protect when the PHY is used by multiple consumers
57 * @phy_attrs: used to specify PHY specific attributes
49 */ 58 */
50struct phy { 59struct phy {
51 struct device dev; 60 struct device dev;
@@ -55,6 +64,7 @@ struct phy {
55 struct mutex mutex; 64 struct mutex mutex;
56 int init_count; 65 int init_count;
57 int power_count; 66 int power_count;
67 struct phy_attrs attrs;
58}; 68};
59 69
60/** 70/**
@@ -127,8 +137,18 @@ int phy_init(struct phy *phy);
127int phy_exit(struct phy *phy); 137int phy_exit(struct phy *phy);
128int phy_power_on(struct phy *phy); 138int phy_power_on(struct phy *phy);
129int phy_power_off(struct phy *phy); 139int phy_power_off(struct phy *phy);
140static inline int phy_get_bus_width(struct phy *phy)
141{
142 return phy->attrs.bus_width;
143}
144static inline void phy_set_bus_width(struct phy *phy, int bus_width)
145{
146 phy->attrs.bus_width = bus_width;
147}
130struct phy *phy_get(struct device *dev, const char *string); 148struct phy *phy_get(struct device *dev, const char *string);
149struct phy *phy_optional_get(struct device *dev, const char *string);
131struct phy *devm_phy_get(struct device *dev, const char *string); 150struct phy *devm_phy_get(struct device *dev, const char *string);
151struct phy *devm_phy_optional_get(struct device *dev, const char *string);
132void phy_put(struct phy *phy); 152void phy_put(struct phy *phy);
133void devm_phy_put(struct device *dev, struct phy *phy); 153void devm_phy_put(struct device *dev, struct phy *phy);
134struct phy *of_phy_simple_xlate(struct device *dev, 154struct phy *of_phy_simple_xlate(struct device *dev,
@@ -199,16 +219,38 @@ static inline int phy_power_off(struct phy *phy)
199 return -ENOSYS; 219 return -ENOSYS;
200} 220}
201 221
222static inline int phy_get_bus_width(struct phy *phy)
223{
224 return -ENOSYS;
225}
226
227static inline void phy_set_bus_width(struct phy *phy, int bus_width)
228{
229 return;
230}
231
202static inline struct phy *phy_get(struct device *dev, const char *string) 232static inline struct phy *phy_get(struct device *dev, const char *string)
203{ 233{
204 return ERR_PTR(-ENOSYS); 234 return ERR_PTR(-ENOSYS);
205} 235}
206 236
237static inline struct phy *phy_optional_get(struct device *dev,
238 const char *string)
239{
240 return ERR_PTR(-ENOSYS);
241}
242
207static inline struct phy *devm_phy_get(struct device *dev, const char *string) 243static inline struct phy *devm_phy_get(struct device *dev, const char *string)
208{ 244{
209 return ERR_PTR(-ENOSYS); 245 return ERR_PTR(-ENOSYS);
210} 246}
211 247
248static inline struct phy *devm_phy_optional_get(struct device *dev,
249 const char *string)
250{
251 return ERR_PTR(-ENOSYS);
252}
253
212static inline void phy_put(struct phy *phy) 254static inline void phy_put(struct phy *phy)
213{ 255{
214} 256}
diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h
index fb90ef5eb038..a15f10727eb8 100644
--- a/include/linux/pinctrl/pinconf-generic.h
+++ b/include/linux/pinctrl/pinconf-generic.h
@@ -61,6 +61,9 @@
61 * argument is ignored. 61 * argument is ignored.
62 * @PIN_CONFIG_DRIVE_STRENGTH: the pin will sink or source at most the current 62 * @PIN_CONFIG_DRIVE_STRENGTH: the pin will sink or source at most the current
63 * passed as argument. The argument is in mA. 63 * passed as argument. The argument is in mA.
64 * @PIN_CONFIG_INPUT_ENABLE: enable the pin's input. Note that this does not
65 * affect the pin's ability to drive output. 1 enables input, 0 disables
66 * input.
64 * @PIN_CONFIG_INPUT_SCHMITT_ENABLE: control schmitt-trigger mode on the pin. 67 * @PIN_CONFIG_INPUT_SCHMITT_ENABLE: control schmitt-trigger mode on the pin.
65 * If the argument != 0, schmitt-trigger mode is enabled. If it's 0, 68 * If the argument != 0, schmitt-trigger mode is enabled. If it's 0,
66 * schmitt-trigger mode is disabled. 69 * schmitt-trigger mode is disabled.
@@ -82,8 +85,10 @@
82 * operation, if several modes of operation are supported these can be 85 * operation, if several modes of operation are supported these can be
83 * passed in the argument on a custom form, else just use argument 1 86 * passed in the argument on a custom form, else just use argument 1
84 * to indicate low power mode, argument 0 turns low power mode off. 87 * to indicate low power mode, argument 0 turns low power mode off.
85 * @PIN_CONFIG_OUTPUT: this will configure the pin in output, use argument 88 * @PIN_CONFIG_OUTPUT: this will configure the pin as an output. Use argument
86 * 1 to indicate high level, argument 0 to indicate low level. 89 * 1 to indicate high level, argument 0 to indicate low level. (Please
90 * see Documentation/pinctrl.txt, section "GPIO mode pitfalls" for a
91 * discussion around this parameter.)
87 * @PIN_CONFIG_END: this is the last enumerator for pin configurations, if 92 * @PIN_CONFIG_END: this is the last enumerator for pin configurations, if
88 * you need to pass in custom configurations to the pin controller, use 93 * you need to pass in custom configurations to the pin controller, use
89 * PIN_CONFIG_END+1 as the base offset. 94 * PIN_CONFIG_END+1 as the base offset.
@@ -99,6 +104,7 @@ enum pin_config_param {
99 PIN_CONFIG_DRIVE_OPEN_DRAIN, 104 PIN_CONFIG_DRIVE_OPEN_DRAIN,
100 PIN_CONFIG_DRIVE_OPEN_SOURCE, 105 PIN_CONFIG_DRIVE_OPEN_SOURCE,
101 PIN_CONFIG_DRIVE_STRENGTH, 106 PIN_CONFIG_DRIVE_STRENGTH,
107 PIN_CONFIG_INPUT_ENABLE,
102 PIN_CONFIG_INPUT_SCHMITT_ENABLE, 108 PIN_CONFIG_INPUT_SCHMITT_ENABLE,
103 PIN_CONFIG_INPUT_SCHMITT, 109 PIN_CONFIG_INPUT_SCHMITT,
104 PIN_CONFIG_INPUT_DEBOUNCE, 110 PIN_CONFIG_INPUT_DEBOUNCE,
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h
index fefb88663975..cc8e1aff0e28 100644
--- a/include/linux/pinctrl/pinctrl.h
+++ b/include/linux/pinctrl/pinctrl.h
@@ -32,10 +32,12 @@ struct device_node;
32 * pins, pads or other muxable units in this struct 32 * pins, pads or other muxable units in this struct
33 * @number: unique pin number from the global pin number space 33 * @number: unique pin number from the global pin number space
34 * @name: a name for this pin 34 * @name: a name for this pin
35 * @drv_data: driver-defined per-pin data. pinctrl core does not touch this
35 */ 36 */
36struct pinctrl_pin_desc { 37struct pinctrl_pin_desc {
37 unsigned number; 38 unsigned number;
38 const char *name; 39 const char *name;
40 void *drv_data;
39}; 41};
40 42
41/* Convenience macro to define a single named or anonymous pin descriptor */ 43/* Convenience macro to define a single named or anonymous pin descriptor */
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index 11982d0ce11b..4d9389c79e61 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -157,6 +157,8 @@ int generic_pipe_buf_confirm(struct pipe_inode_info *, struct pipe_buffer *);
157int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *); 157int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *);
158void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *); 158void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *);
159 159
160extern const struct pipe_buf_operations nosteal_pipe_buf_ops;
161
160/* for F_SETPIPE_SZ and F_GETPIPE_SZ */ 162/* for F_SETPIPE_SZ and F_GETPIPE_SZ */
161long pipe_fcntl(struct file *, unsigned int, unsigned long arg); 163long pipe_fcntl(struct file *, unsigned int, unsigned long arg);
162struct pipe_inode_info *get_pipe_info(struct file *file); 164struct pipe_inode_info *get_pipe_info(struct file *file);
diff --git a/include/linux/platform_data/asoc-ti-mcbsp.h b/include/linux/platform_data/asoc-ti-mcbsp.h
index c78d90b28b19..3c73c045f8da 100644
--- a/include/linux/platform_data/asoc-ti-mcbsp.h
+++ b/include/linux/platform_data/asoc-ti-mcbsp.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/plat-omap/include/mach/mcbsp.h
3 *
4 * Defines for Multi-Channel Buffered Serial Port 2 * Defines for Multi-Channel Buffered Serial Port
5 * 3 *
6 * Copyright (C) 2002 RidgeRun, Inc. 4 * Copyright (C) 2002 RidgeRun, Inc.
@@ -21,8 +19,8 @@
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 * 20 *
23 */ 21 */
24#ifndef __ASM_ARCH_OMAP_MCBSP_H 22#ifndef __ASOC_TI_MCBSP_H
25#define __ASM_ARCH_OMAP_MCBSP_H 23#define __ASOC_TI_MCBSP_H
26 24
27#include <linux/spinlock.h> 25#include <linux/spinlock.h>
28#include <linux/clk.h> 26#include <linux/clk.h>
diff --git a/include/linux/platform_data/asoc-ux500-msp.h b/include/linux/platform_data/asoc-ux500-msp.h
index 9991aea3d577..2f34bb98fe2a 100644
--- a/include/linux/platform_data/asoc-ux500-msp.h
+++ b/include/linux/platform_data/asoc-ux500-msp.h
@@ -10,16 +10,9 @@
10 10
11#include <linux/platform_data/dma-ste-dma40.h> 11#include <linux/platform_data/dma-ste-dma40.h>
12 12
13enum msp_i2s_id {
14 MSP_I2S_0 = 0,
15 MSP_I2S_1,
16 MSP_I2S_2,
17 MSP_I2S_3,
18};
19
20/* Platform data structure for a MSP I2S-device */ 13/* Platform data structure for a MSP I2S-device */
21struct msp_i2s_platform_data { 14struct msp_i2s_platform_data {
22 enum msp_i2s_id id; 15 int id;
23 struct stedma40_chan_cfg *msp_i2s_dma_rx; 16 struct stedma40_chan_cfg *msp_i2s_dma_rx;
24 struct stedma40_chan_cfg *msp_i2s_dma_tx; 17 struct stedma40_chan_cfg *msp_i2s_dma_tx;
25}; 18};
diff --git a/include/linux/platform_data/clocksource-nomadik-mtu.h b/include/linux/platform_data/clocksource-nomadik-mtu.h
deleted file mode 100644
index 80088973b734..000000000000
--- a/include/linux/platform_data/clocksource-nomadik-mtu.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef __PLAT_MTU_H
2#define __PLAT_MTU_H
3
4void nmdk_timer_init(void __iomem *base, int irq);
5void nmdk_clkevt_reset(void);
6void nmdk_clksrc_reset(void);
7
8#endif /* __PLAT_MTU_H */
9
diff --git a/include/linux/platform_data/davinci_asp.h b/include/linux/platform_data/davinci_asp.h
index 689a856b86f9..5245992b0367 100644
--- a/include/linux/platform_data/davinci_asp.h
+++ b/include/linux/platform_data/davinci_asp.h
@@ -92,6 +92,7 @@ enum {
92 MCASP_VERSION_1 = 0, /* DM646x */ 92 MCASP_VERSION_1 = 0, /* DM646x */
93 MCASP_VERSION_2, /* DA8xx/OMAPL1x */ 93 MCASP_VERSION_2, /* DA8xx/OMAPL1x */
94 MCASP_VERSION_3, /* TI81xx/AM33xx */ 94 MCASP_VERSION_3, /* TI81xx/AM33xx */
95 MCASP_VERSION_4, /* DRA7xxx */
95}; 96};
96 97
97enum mcbsp_clk_input_pin { 98enum mcbsp_clk_input_pin {
diff --git a/include/linux/platform_data/dma-imx-sdma.h b/include/linux/platform_data/dma-imx-sdma.h
index 3a3942823c20..eabac4e2fc99 100644
--- a/include/linux/platform_data/dma-imx-sdma.h
+++ b/include/linux/platform_data/dma-imx-sdma.h
@@ -43,6 +43,11 @@ struct sdma_script_start_addrs {
43 s32 dptc_dvfs_addr; 43 s32 dptc_dvfs_addr;
44 s32 utra_addr; 44 s32 utra_addr;
45 s32 ram_code_start_addr; 45 s32 ram_code_start_addr;
46 /* End of v1 array */
47 s32 mcu_2_ssish_addr;
48 s32 ssish_2_mcu_addr;
49 s32 hdmi_dma_addr;
50 /* End of v2 array */
46}; 51};
47 52
48/** 53/**
diff --git a/include/linux/platform_data/dma-imx.h b/include/linux/platform_data/dma-imx.h
index beac6b8b6a7b..bcbc6c3c14c0 100644
--- a/include/linux/platform_data/dma-imx.h
+++ b/include/linux/platform_data/dma-imx.h
@@ -39,6 +39,7 @@ enum sdma_peripheral_type {
39 IMX_DMATYPE_IPU_MEMORY, /* IPU Memory */ 39 IMX_DMATYPE_IPU_MEMORY, /* IPU Memory */
40 IMX_DMATYPE_ASRC, /* ASRC */ 40 IMX_DMATYPE_ASRC, /* ASRC */
41 IMX_DMATYPE_ESAI, /* ESAI */ 41 IMX_DMATYPE_ESAI, /* ESAI */
42 IMX_DMATYPE_SSI_DUAL, /* SSI Dual FIFO */
42}; 43};
43 44
44enum imx_dma_prio { 45enum imx_dma_prio {
diff --git a/include/linux/platform_data/dma-mmp_tdma.h b/include/linux/platform_data/dma-mmp_tdma.h
index 239e0fc1bb1f..66574ea39f97 100644
--- a/include/linux/platform_data/dma-mmp_tdma.h
+++ b/include/linux/platform_data/dma-mmp_tdma.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * linux/arch/arm/mach-mmp/include/mach/sram.h
3 *
4 * SRAM Memory Management 2 * SRAM Memory Management
5 * 3 *
6 * Copyright (c) 2011 Marvell Semiconductors Inc. 4 * Copyright (c) 2011 Marvell Semiconductors Inc.
@@ -11,8 +9,8 @@
11 * 9 *
12 */ 10 */
13 11
14#ifndef __ASM_ARCH_SRAM_H 12#ifndef __DMA_MMP_TDMA_H
15#define __ASM_ARCH_SRAM_H 13#define __DMA_MMP_TDMA_H
16 14
17#include <linux/genalloc.h> 15#include <linux/genalloc.h>
18 16
@@ -32,4 +30,4 @@ struct sram_platdata {
32 30
33extern struct gen_pool *sram_get_gpool(char *pool_name); 31extern struct gen_pool *sram_get_gpool(char *pool_name);
34 32
35#endif /* __ASM_ARCH_SRAM_H */ 33#endif /* __DMA_MMP_TDMA_H */
diff --git a/include/linux/platform_data/dma-mv_xor.h b/include/linux/platform_data/dma-mv_xor.h
index 8ec18f64e396..92ffd3245f76 100644
--- a/include/linux/platform_data/dma-mv_xor.h
+++ b/include/linux/platform_data/dma-mv_xor.h
@@ -1,11 +1,9 @@
1/* 1/*
2 * arch/arm/plat-orion/include/plat/mv_xor.h
3 *
4 * Marvell XOR platform device data definition file. 2 * Marvell XOR platform device data definition file.
5 */ 3 */
6 4
7#ifndef __PLAT_MV_XOR_H 5#ifndef __DMA_MV_XOR_H
8#define __PLAT_MV_XOR_H 6#define __DMA_MV_XOR_H
9 7
10#include <linux/dmaengine.h> 8#include <linux/dmaengine.h>
11#include <linux/mbus.h> 9#include <linux/mbus.h>
diff --git a/include/linux/platform_data/eth-netx.h b/include/linux/platform_data/eth-netx.h
index 88af1ac28ead..a395159725d5 100644
--- a/include/linux/platform_data/eth-netx.h
+++ b/include/linux/platform_data/eth-netx.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/mach-netx/include/mach/eth.h
3 *
4 * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix 2 * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
5 * 3 *
6 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
@@ -17,8 +15,8 @@
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 16 */
19 17
20#ifndef ASMARM_ARCH_ETH_H 18#ifndef __ETH_NETX_H
21#define ASMARM_ARCH_ETH_H 19#define __ETH_NETX_H
22 20
23struct netxeth_platform_data { 21struct netxeth_platform_data {
24 unsigned int xcno; /* number of xmac/xpec engine this eth uses */ 22 unsigned int xcno; /* number of xmac/xpec engine this eth uses */
diff --git a/include/linux/platform_data/gpio-davinci.h b/include/linux/platform_data/gpio-davinci.h
index 6efd20264585..fbe2f7535741 100644
--- a/include/linux/platform_data/gpio-davinci.h
+++ b/include/linux/platform_data/gpio-davinci.h
@@ -28,13 +28,12 @@ enum davinci_gpio_type {
28struct davinci_gpio_platform_data { 28struct davinci_gpio_platform_data {
29 u32 ngpio; 29 u32 ngpio;
30 u32 gpio_unbanked; 30 u32 gpio_unbanked;
31 u32 intc_irq_num;
32}; 31};
33 32
34 33
35struct davinci_gpio_controller { 34struct davinci_gpio_controller {
36 struct gpio_chip chip; 35 struct gpio_chip chip;
37 int irq_base; 36 struct irq_domain *irq_domain;
38 /* Serialize access to GPIO registers */ 37 /* Serialize access to GPIO registers */
39 spinlock_t lock; 38 spinlock_t lock;
40 void __iomem *regs; 39 void __iomem *regs;
diff --git a/include/linux/platform_data/gpio-lpc32xx.h b/include/linux/platform_data/gpio-lpc32xx.h
new file mode 100644
index 000000000000..a544e962a818
--- /dev/null
+++ b/include/linux/platform_data/gpio-lpc32xx.h
@@ -0,0 +1,50 @@
1/*
2 * Author: Kevin Wells <kevin.wells@nxp.com>
3 *
4 * Copyright (C) 2010 NXP Semiconductors
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#ifndef __MACH_GPIO_LPC32XX_H
18#define __MACH_GPIO_LPC32XX_H
19
20/*
21 * Note!
22 * Muxed GP pins need to be setup to the GP state in the board level
23 * code prior to using this driver.
24 * GPI pins : 28xP3 group
25 * GPO pins : 24xP3 group
26 * GPIO pins: 8xP0 group, 24xP1 group, 13xP2 group, 6xP3 group
27 */
28
29#define LPC32XX_GPIO_P0_MAX 8
30#define LPC32XX_GPIO_P1_MAX 24
31#define LPC32XX_GPIO_P2_MAX 13
32#define LPC32XX_GPIO_P3_MAX 6
33#define LPC32XX_GPI_P3_MAX 29
34#define LPC32XX_GPO_P3_MAX 24
35
36#define LPC32XX_GPIO_P0_GRP 0
37#define LPC32XX_GPIO_P1_GRP (LPC32XX_GPIO_P0_GRP + LPC32XX_GPIO_P0_MAX)
38#define LPC32XX_GPIO_P2_GRP (LPC32XX_GPIO_P1_GRP + LPC32XX_GPIO_P1_MAX)
39#define LPC32XX_GPIO_P3_GRP (LPC32XX_GPIO_P2_GRP + LPC32XX_GPIO_P2_MAX)
40#define LPC32XX_GPI_P3_GRP (LPC32XX_GPIO_P3_GRP + LPC32XX_GPIO_P3_MAX)
41#define LPC32XX_GPO_P3_GRP (LPC32XX_GPI_P3_GRP + LPC32XX_GPI_P3_MAX)
42
43/*
44 * A specific GPIO can be selected with this macro
45 * ie, GPIO_05 can be selected with LPC32XX_GPIO(LPC32XX_GPIO_P3_GRP, 5)
46 * See the LPC32x0 User's guide for GPIO group numbers
47 */
48#define LPC32XX_GPIO(x, y) ((x) + (y))
49
50#endif /* __MACH_GPIO_LPC32XX_H */
diff --git a/include/linux/platform_data/hwmon-s3c.h b/include/linux/platform_data/hwmon-s3c.h
index c167e4429bc7..0e3cce130fe2 100644
--- a/include/linux/platform_data/hwmon-s3c.h
+++ b/include/linux/platform_data/hwmon-s3c.h
@@ -1,5 +1,4 @@
1/* linux/arch/arm/plat-s3c/include/plat/hwmon.h 1/*
2 *
3 * Copyright 2005 Simtec Electronics 2 * Copyright 2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 3 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
@@ -11,8 +10,8 @@
11 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
12*/ 11*/
13 12
14#ifndef __ASM_ARCH_ADC_HWMON_H 13#ifndef __HWMON_S3C_H__
15#define __ASM_ARCH_ADC_HWMON_H __FILE__ 14#define __HWMON_S3C_H__
16 15
17/** 16/**
18 * s3c_hwmon_chcfg - channel configuration 17 * s3c_hwmon_chcfg - channel configuration
@@ -47,5 +46,4 @@ struct s3c_hwmon_pdata {
47 */ 46 */
48extern void __init s3c_hwmon_set_platdata(struct s3c_hwmon_pdata *pd); 47extern void __init s3c_hwmon_set_platdata(struct s3c_hwmon_pdata *pd);
49 48
50#endif /* __ASM_ARCH_ADC_HWMON_H */ 49#endif /* __HWMON_S3C_H__ */
51
diff --git a/include/linux/platform_data/i2c-nomadik.h b/include/linux/platform_data/i2c-nomadik.h
deleted file mode 100644
index 3a8be9cdc95c..000000000000
--- a/include/linux/platform_data/i2c-nomadik.h
+++ /dev/null
@@ -1,39 +0,0 @@
1/*
2 * Copyright (C) 2009 ST-Ericsson
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2, as
6 * published by the Free Software Foundation.
7 */
8#ifndef __PDATA_I2C_NOMADIK_H
9#define __PDATA_I2C_NOMADIK_H
10
11enum i2c_freq_mode {
12 I2C_FREQ_MODE_STANDARD, /* up to 100 Kb/s */
13 I2C_FREQ_MODE_FAST, /* up to 400 Kb/s */
14 I2C_FREQ_MODE_HIGH_SPEED, /* up to 3.4 Mb/s */
15 I2C_FREQ_MODE_FAST_PLUS, /* up to 1 Mb/s */
16};
17
18/**
19 * struct nmk_i2c_controller - client specific controller configuration
20 * @clk_freq: clock frequency for the operation mode
21 * @slsu: Slave data setup time in ns.
22 * The needed setup time for three modes of operation
23 * are 250ns, 100ns and 10ns respectively thus leading
24 * to the values of 14, 6, 2 for a 48 MHz i2c clk
25 * @tft: Tx FIFO Threshold in bytes
26 * @rft: Rx FIFO Threshold in bytes
27 * @timeout Slave response timeout(ms)
28 * @sm: speed mode
29 */
30struct nmk_i2c_controller {
31 u32 clk_freq;
32 unsigned short slsu;
33 unsigned char tft;
34 unsigned char rft;
35 int timeout;
36 enum i2c_freq_mode sm;
37};
38
39#endif /* __PDATA_I2C_NOMADIK_H */
diff --git a/include/linux/platform_data/keypad-ep93xx.h b/include/linux/platform_data/keypad-ep93xx.h
index 1e2f4e97f428..adccee25b162 100644
--- a/include/linux/platform_data/keypad-ep93xx.h
+++ b/include/linux/platform_data/keypad-ep93xx.h
@@ -1,9 +1,5 @@
1/* 1#ifndef __KEYPAD_EP93XX_H
2 * arch/arm/mach-ep93xx/include/mach/ep93xx_keypad.h 2#define __KEYPAD_EP93XX_H
3 */
4
5#ifndef __ASM_ARCH_EP93XX_KEYPAD_H
6#define __ASM_ARCH_EP93XX_KEYPAD_H
7 3
8struct matrix_keymap_data; 4struct matrix_keymap_data;
9 5
@@ -32,4 +28,4 @@ struct ep93xx_keypad_platform_data {
32#define EP93XX_MATRIX_ROWS (8) 28#define EP93XX_MATRIX_ROWS (8)
33#define EP93XX_MATRIX_COLS (8) 29#define EP93XX_MATRIX_COLS (8)
34 30
35#endif /* __ASM_ARCH_EP93XX_KEYPAD_H */ 31#endif /* __KEYPAD_EP93XX_H */
diff --git a/include/linux/platform_data/keypad-omap.h b/include/linux/platform_data/keypad-omap.h
index a6b21eddb212..c3a3abae98f0 100644
--- a/include/linux/platform_data/keypad-omap.h
+++ b/include/linux/platform_data/keypad-omap.h
@@ -1,14 +1,12 @@
1/* 1/*
2 * arch/arm/plat-omap/include/mach/keypad.h
3 *
4 * Copyright (C) 2006 Komal Shah <komal_shah802003@yahoo.com> 2 * Copyright (C) 2006 Komal Shah <komal_shah802003@yahoo.com>
5 * 3 *
6 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as 5 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
9 */ 7 */
10#ifndef ASMARM_ARCH_KEYPAD_H 8#ifndef __KEYPAD_OMAP_H
11#define ASMARM_ARCH_KEYPAD_H 9#define __KEYPAD_OMAP_H
12 10
13#ifndef CONFIG_ARCH_OMAP1 11#ifndef CONFIG_ARCH_OMAP1
14#warning Please update the board to use matrix-keypad driver 12#warning Please update the board to use matrix-keypad driver
diff --git a/include/linux/platform_data/leds-kirkwood-netxbig.h b/include/linux/platform_data/leds-kirkwood-netxbig.h
index 24b536ebdf13..d2be19a51acd 100644
--- a/include/linux/platform_data/leds-kirkwood-netxbig.h
+++ b/include/linux/platform_data/leds-kirkwood-netxbig.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/mach-kirkwood/include/mach/leds-netxbig.h
3 *
4 * Platform data structure for netxbig LED driver 2 * Platform data structure for netxbig LED driver
5 * 3 *
6 * This file is licensed under the terms of the GNU General Public 4 * This file is licensed under the terms of the GNU General Public
@@ -8,8 +6,8 @@
8 * warranty of any kind, whether express or implied. 6 * warranty of any kind, whether express or implied.
9 */ 7 */
10 8
11#ifndef __MACH_LEDS_NETXBIG_H 9#ifndef __LEDS_KIRKWOOD_NETXBIG_H
12#define __MACH_LEDS_NETXBIG_H 10#define __LEDS_KIRKWOOD_NETXBIG_H
13 11
14struct netxbig_gpio_ext { 12struct netxbig_gpio_ext {
15 unsigned *addr; 13 unsigned *addr;
@@ -52,4 +50,4 @@ struct netxbig_led_platform_data {
52 int num_leds; 50 int num_leds;
53}; 51};
54 52
55#endif /* __MACH_LEDS_NETXBIG_H */ 53#endif /* __LEDS_KIRKWOOD_NETXBIG_H */
diff --git a/include/linux/platform_data/leds-kirkwood-ns2.h b/include/linux/platform_data/leds-kirkwood-ns2.h
index e21272e5f668..6a9fed57f346 100644
--- a/include/linux/platform_data/leds-kirkwood-ns2.h
+++ b/include/linux/platform_data/leds-kirkwood-ns2.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/mach-kirkwood/include/mach/leds-ns2.h
3 *
4 * Platform data structure for Network Space v2 LED driver 2 * Platform data structure for Network Space v2 LED driver
5 * 3 *
6 * This file is licensed under the terms of the GNU General Public 4 * This file is licensed under the terms of the GNU General Public
@@ -8,8 +6,8 @@
8 * warranty of any kind, whether express or implied. 6 * warranty of any kind, whether express or implied.
9 */ 7 */
10 8
11#ifndef __MACH_LEDS_NS2_H 9#ifndef __LEDS_KIRKWOOD_NS2_H
12#define __MACH_LEDS_NS2_H 10#define __LEDS_KIRKWOOD_NS2_H
13 11
14struct ns2_led { 12struct ns2_led {
15 const char *name; 13 const char *name;
@@ -23,4 +21,4 @@ struct ns2_led_platform_data {
23 struct ns2_led *leds; 21 struct ns2_led *leds;
24}; 22};
25 23
26#endif /* __MACH_LEDS_NS2_H */ 24#endif /* __LEDS_KIRKWOOD_NS2_H */
diff --git a/include/linux/platform_data/max197.h b/include/linux/platform_data/max197.h
index e2a41dd7690c..8da8f94ee15c 100644
--- a/include/linux/platform_data/max197.h
+++ b/include/linux/platform_data/max197.h
@@ -11,6 +11,9 @@
11 * For further information, see the Documentation/hwmon/max197 file. 11 * For further information, see the Documentation/hwmon/max197 file.
12 */ 12 */
13 13
14#ifndef _PDATA_MAX197_H
15#define _PDATA_MAX197_H
16
14/** 17/**
15 * struct max197_platform_data - MAX197 connectivity info 18 * struct max197_platform_data - MAX197 connectivity info
16 * @convert: Function used to start a conversion with control byte ctrl. 19 * @convert: Function used to start a conversion with control byte ctrl.
@@ -19,3 +22,5 @@
19struct max197_platform_data { 22struct max197_platform_data {
20 int (*convert)(u8 ctrl); 23 int (*convert)(u8 ctrl);
21}; 24};
25
26#endif /* _PDATA_MAX197_H */
diff --git a/include/linux/platform_data/mfd-mcp-sa11x0.h b/include/linux/platform_data/mfd-mcp-sa11x0.h
index 4b2860ae3828..747cd6baf711 100644
--- a/include/linux/platform_data/mfd-mcp-sa11x0.h
+++ b/include/linux/platform_data/mfd-mcp-sa11x0.h
@@ -1,14 +1,12 @@
1/* 1/*
2 * arch/arm/mach-sa1100/include/mach/mcp.h
3 *
4 * Copyright (C) 2005 Russell King. 2 * Copyright (C) 2005 Russell King.
5 * 3 *
6 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as 5 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
9 */ 7 */
10#ifndef __ASM_ARM_ARCH_MCP_H 8#ifndef __MFD_MCP_SA11X0_H
11#define __ASM_ARM_ARCH_MCP_H 9#define __MFD_MCP_SA11X0_H
12 10
13#include <linux/types.h> 11#include <linux/types.h>
14 12
diff --git a/include/linux/platform_data/mtd-nand-omap2.h b/include/linux/platform_data/mtd-nand-omap2.h
index 4da5bfa2147f..3e9dd6676b97 100644
--- a/include/linux/platform_data/mtd-nand-omap2.h
+++ b/include/linux/platform_data/mtd-nand-omap2.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/plat-omap/include/mach/nand.h
3 *
4 * Copyright (C) 2006 Micron Technology Inc. 2 * Copyright (C) 2006 Micron Technology Inc.
5 * 3 *
6 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
diff --git a/include/linux/platform_data/mtd-nand-pxa3xx.h b/include/linux/platform_data/mtd-nand-pxa3xx.h
index ffb801998e5d..a94147124929 100644
--- a/include/linux/platform_data/mtd-nand-pxa3xx.h
+++ b/include/linux/platform_data/mtd-nand-pxa3xx.h
@@ -55,6 +55,9 @@ struct pxa3xx_nand_platform_data {
55 /* indicate how many chip selects will be used */ 55 /* indicate how many chip selects will be used */
56 int num_cs; 56 int num_cs;
57 57
58 /* use an flash-based bad block table */
59 bool flash_bbt;
60
58 const struct mtd_partition *parts[NUM_CHIP_SELECT]; 61 const struct mtd_partition *parts[NUM_CHIP_SELECT];
59 unsigned int nr_parts[NUM_CHIP_SELECT]; 62 unsigned int nr_parts[NUM_CHIP_SELECT];
60 63
diff --git a/include/linux/platform_data/mtd-onenand-omap2.h b/include/linux/platform_data/mtd-onenand-omap2.h
index e9a9fb188f97..56ff0e6f5ad1 100644
--- a/include/linux/platform_data/mtd-onenand-omap2.h
+++ b/include/linux/platform_data/mtd-onenand-omap2.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/plat-omap/include/mach/onenand.h
3 *
4 * Copyright (C) 2006 Nokia Corporation 2 * Copyright (C) 2006 Nokia Corporation
5 * Author: Juha Yrjola 3 * Author: Juha Yrjola
6 * 4 *
diff --git a/include/linux/platform_data/mtd-orion_nand.h b/include/linux/platform_data/mtd-orion_nand.h
index 9f3c180834d1..a7ce77c7c1a8 100644
--- a/include/linux/platform_data/mtd-orion_nand.h
+++ b/include/linux/platform_data/mtd-orion_nand.h
@@ -1,13 +1,11 @@
1/* 1/*
2 * arch/arm/plat-orion/include/plat/orion_nand.h
3 *
4 * This file is licensed under the terms of the GNU General Public 2 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any 3 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied. 4 * warranty of any kind, whether express or implied.
7 */ 5 */
8 6
9#ifndef __PLAT_ORION_NAND_H 7#ifndef __MTD_ORION_NAND_H
10#define __PLAT_ORION_NAND_H 8#define __MTD_ORION_NAND_H
11 9
12/* 10/*
13 * Device bus NAND private data 11 * Device bus NAND private data
diff --git a/include/linux/platform_data/pinctrl-nomadik.h b/include/linux/platform_data/pinctrl-nomadik.h
deleted file mode 100644
index abf5bed84df3..000000000000
--- a/include/linux/platform_data/pinctrl-nomadik.h
+++ /dev/null
@@ -1,242 +0,0 @@
1/*
2 * Structures and registers for GPIO access in the Nomadik SoC
3 *
4 * Copyright (C) 2008 STMicroelectronics
5 * Author: Prafulla WADASKAR <prafulla.wadaskar@st.com>
6 * Copyright (C) 2009 Alessandro Rubini <rubini@unipv.it>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __PLAT_NOMADIK_GPIO
14#define __PLAT_NOMADIK_GPIO
15
16/*
17 * pin configurations are represented by 32-bit integers:
18 *
19 * bit 0.. 8 - Pin Number (512 Pins Maximum)
20 * bit 9..10 - Alternate Function Selection
21 * bit 11..12 - Pull up/down state
22 * bit 13 - Sleep mode behaviour
23 * bit 14 - Direction
24 * bit 15 - Value (if output)
25 * bit 16..18 - SLPM pull up/down state
26 * bit 19..20 - SLPM direction
27 * bit 21..22 - SLPM Value (if output)
28 * bit 23..25 - PDIS value (if input)
29 * bit 26 - Gpio mode
30 * bit 27 - Sleep mode
31 *
32 * to facilitate the definition, the following macros are provided
33 *
34 * PIN_CFG_DEFAULT - default config (0):
35 * pull up/down = disabled
36 * sleep mode = input/wakeup
37 * direction = input
38 * value = low
39 * SLPM direction = same as normal
40 * SLPM pull = same as normal
41 * SLPM value = same as normal
42 *
43 * PIN_CFG - default config with alternate function
44 */
45
46typedef unsigned long pin_cfg_t;
47
48#define PIN_NUM_MASK 0x1ff
49#define PIN_NUM(x) ((x) & PIN_NUM_MASK)
50
51#define PIN_ALT_SHIFT 9
52#define PIN_ALT_MASK (0x3 << PIN_ALT_SHIFT)
53#define PIN_ALT(x) (((x) & PIN_ALT_MASK) >> PIN_ALT_SHIFT)
54#define PIN_GPIO (NMK_GPIO_ALT_GPIO << PIN_ALT_SHIFT)
55#define PIN_ALT_A (NMK_GPIO_ALT_A << PIN_ALT_SHIFT)
56#define PIN_ALT_B (NMK_GPIO_ALT_B << PIN_ALT_SHIFT)
57#define PIN_ALT_C (NMK_GPIO_ALT_C << PIN_ALT_SHIFT)
58
59#define PIN_PULL_SHIFT 11
60#define PIN_PULL_MASK (0x3 << PIN_PULL_SHIFT)
61#define PIN_PULL(x) (((x) & PIN_PULL_MASK) >> PIN_PULL_SHIFT)
62#define PIN_PULL_NONE (NMK_GPIO_PULL_NONE << PIN_PULL_SHIFT)
63#define PIN_PULL_UP (NMK_GPIO_PULL_UP << PIN_PULL_SHIFT)
64#define PIN_PULL_DOWN (NMK_GPIO_PULL_DOWN << PIN_PULL_SHIFT)
65
66#define PIN_SLPM_SHIFT 13
67#define PIN_SLPM_MASK (0x1 << PIN_SLPM_SHIFT)
68#define PIN_SLPM(x) (((x) & PIN_SLPM_MASK) >> PIN_SLPM_SHIFT)
69#define PIN_SLPM_MAKE_INPUT (NMK_GPIO_SLPM_INPUT << PIN_SLPM_SHIFT)
70#define PIN_SLPM_NOCHANGE (NMK_GPIO_SLPM_NOCHANGE << PIN_SLPM_SHIFT)
71/* These two replace the above in DB8500v2+ */
72#define PIN_SLPM_WAKEUP_ENABLE (NMK_GPIO_SLPM_WAKEUP_ENABLE << PIN_SLPM_SHIFT)
73#define PIN_SLPM_WAKEUP_DISABLE (NMK_GPIO_SLPM_WAKEUP_DISABLE << PIN_SLPM_SHIFT)
74#define PIN_SLPM_USE_MUX_SETTINGS_IN_SLEEP PIN_SLPM_WAKEUP_DISABLE
75
76#define PIN_SLPM_GPIO PIN_SLPM_WAKEUP_ENABLE /* In SLPM, pin is a gpio */
77#define PIN_SLPM_ALTFUNC PIN_SLPM_WAKEUP_DISABLE /* In SLPM, pin is altfunc */
78
79#define PIN_DIR_SHIFT 14
80#define PIN_DIR_MASK (0x1 << PIN_DIR_SHIFT)
81#define PIN_DIR(x) (((x) & PIN_DIR_MASK) >> PIN_DIR_SHIFT)
82#define PIN_DIR_INPUT (0 << PIN_DIR_SHIFT)
83#define PIN_DIR_OUTPUT (1 << PIN_DIR_SHIFT)
84
85#define PIN_VAL_SHIFT 15
86#define PIN_VAL_MASK (0x1 << PIN_VAL_SHIFT)
87#define PIN_VAL(x) (((x) & PIN_VAL_MASK) >> PIN_VAL_SHIFT)
88#define PIN_VAL_LOW (0 << PIN_VAL_SHIFT)
89#define PIN_VAL_HIGH (1 << PIN_VAL_SHIFT)
90
91#define PIN_SLPM_PULL_SHIFT 16
92#define PIN_SLPM_PULL_MASK (0x7 << PIN_SLPM_PULL_SHIFT)
93#define PIN_SLPM_PULL(x) \
94 (((x) & PIN_SLPM_PULL_MASK) >> PIN_SLPM_PULL_SHIFT)
95#define PIN_SLPM_PULL_NONE \
96 ((1 + NMK_GPIO_PULL_NONE) << PIN_SLPM_PULL_SHIFT)
97#define PIN_SLPM_PULL_UP \
98 ((1 + NMK_GPIO_PULL_UP) << PIN_SLPM_PULL_SHIFT)
99#define PIN_SLPM_PULL_DOWN \
100 ((1 + NMK_GPIO_PULL_DOWN) << PIN_SLPM_PULL_SHIFT)
101
102#define PIN_SLPM_DIR_SHIFT 19
103#define PIN_SLPM_DIR_MASK (0x3 << PIN_SLPM_DIR_SHIFT)
104#define PIN_SLPM_DIR(x) \
105 (((x) & PIN_SLPM_DIR_MASK) >> PIN_SLPM_DIR_SHIFT)
106#define PIN_SLPM_DIR_INPUT ((1 + 0) << PIN_SLPM_DIR_SHIFT)
107#define PIN_SLPM_DIR_OUTPUT ((1 + 1) << PIN_SLPM_DIR_SHIFT)
108
109#define PIN_SLPM_VAL_SHIFT 21
110#define PIN_SLPM_VAL_MASK (0x3 << PIN_SLPM_VAL_SHIFT)
111#define PIN_SLPM_VAL(x) \
112 (((x) & PIN_SLPM_VAL_MASK) >> PIN_SLPM_VAL_SHIFT)
113#define PIN_SLPM_VAL_LOW ((1 + 0) << PIN_SLPM_VAL_SHIFT)
114#define PIN_SLPM_VAL_HIGH ((1 + 1) << PIN_SLPM_VAL_SHIFT)
115
116#define PIN_SLPM_PDIS_SHIFT 23
117#define PIN_SLPM_PDIS_MASK (0x3 << PIN_SLPM_PDIS_SHIFT)
118#define PIN_SLPM_PDIS(x) \
119 (((x) & PIN_SLPM_PDIS_MASK) >> PIN_SLPM_PDIS_SHIFT)
120#define PIN_SLPM_PDIS_NO_CHANGE (0 << PIN_SLPM_PDIS_SHIFT)
121#define PIN_SLPM_PDIS_DISABLED (1 << PIN_SLPM_PDIS_SHIFT)
122#define PIN_SLPM_PDIS_ENABLED (2 << PIN_SLPM_PDIS_SHIFT)
123
124#define PIN_LOWEMI_SHIFT 25
125#define PIN_LOWEMI_MASK (0x1 << PIN_LOWEMI_SHIFT)
126#define PIN_LOWEMI(x) (((x) & PIN_LOWEMI_MASK) >> PIN_LOWEMI_SHIFT)
127#define PIN_LOWEMI_DISABLED (0 << PIN_LOWEMI_SHIFT)
128#define PIN_LOWEMI_ENABLED (1 << PIN_LOWEMI_SHIFT)
129
130#define PIN_GPIOMODE_SHIFT 26
131#define PIN_GPIOMODE_MASK (0x1 << PIN_GPIOMODE_SHIFT)
132#define PIN_GPIOMODE(x) (((x) & PIN_GPIOMODE_MASK) >> PIN_GPIOMODE_SHIFT)
133#define PIN_GPIOMODE_DISABLED (0 << PIN_GPIOMODE_SHIFT)
134#define PIN_GPIOMODE_ENABLED (1 << PIN_GPIOMODE_SHIFT)
135
136#define PIN_SLEEPMODE_SHIFT 27
137#define PIN_SLEEPMODE_MASK (0x1 << PIN_SLEEPMODE_SHIFT)
138#define PIN_SLEEPMODE(x) (((x) & PIN_SLEEPMODE_MASK) >> PIN_SLEEPMODE_SHIFT)
139#define PIN_SLEEPMODE_DISABLED (0 << PIN_SLEEPMODE_SHIFT)
140#define PIN_SLEEPMODE_ENABLED (1 << PIN_SLEEPMODE_SHIFT)
141
142
143/* Shortcuts. Use these instead of separate DIR, PULL, and VAL. */
144#define PIN_INPUT_PULLDOWN (PIN_DIR_INPUT | PIN_PULL_DOWN)
145#define PIN_INPUT_PULLUP (PIN_DIR_INPUT | PIN_PULL_UP)
146#define PIN_INPUT_NOPULL (PIN_DIR_INPUT | PIN_PULL_NONE)
147#define PIN_OUTPUT_LOW (PIN_DIR_OUTPUT | PIN_VAL_LOW)
148#define PIN_OUTPUT_HIGH (PIN_DIR_OUTPUT | PIN_VAL_HIGH)
149
150#define PIN_SLPM_INPUT_PULLDOWN (PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_DOWN)
151#define PIN_SLPM_INPUT_PULLUP (PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_UP)
152#define PIN_SLPM_INPUT_NOPULL (PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_NONE)
153#define PIN_SLPM_OUTPUT_LOW (PIN_SLPM_DIR_OUTPUT | PIN_SLPM_VAL_LOW)
154#define PIN_SLPM_OUTPUT_HIGH (PIN_SLPM_DIR_OUTPUT | PIN_SLPM_VAL_HIGH)
155
156#define PIN_CFG_DEFAULT (0)
157
158#define PIN_CFG(num, alt) \
159 (PIN_CFG_DEFAULT |\
160 (PIN_NUM(num) | PIN_##alt))
161
162#define PIN_CFG_INPUT(num, alt, pull) \
163 (PIN_CFG_DEFAULT |\
164 (PIN_NUM(num) | PIN_##alt | PIN_INPUT_##pull))
165
166#define PIN_CFG_OUTPUT(num, alt, val) \
167 (PIN_CFG_DEFAULT |\
168 (PIN_NUM(num) | PIN_##alt | PIN_OUTPUT_##val))
169
170/*
171 * "nmk_gpio" and "NMK_GPIO" stand for "Nomadik GPIO", leaving
172 * the "gpio" namespace for generic and cross-machine functions
173 */
174
175#define GPIO_BLOCK_SHIFT 5
176#define NMK_GPIO_PER_CHIP (1 << GPIO_BLOCK_SHIFT)
177
178/* Register in the logic block */
179#define NMK_GPIO_DAT 0x00
180#define NMK_GPIO_DATS 0x04
181#define NMK_GPIO_DATC 0x08
182#define NMK_GPIO_PDIS 0x0c
183#define NMK_GPIO_DIR 0x10
184#define NMK_GPIO_DIRS 0x14
185#define NMK_GPIO_DIRC 0x18
186#define NMK_GPIO_SLPC 0x1c
187#define NMK_GPIO_AFSLA 0x20
188#define NMK_GPIO_AFSLB 0x24
189#define NMK_GPIO_LOWEMI 0x28
190
191#define NMK_GPIO_RIMSC 0x40
192#define NMK_GPIO_FIMSC 0x44
193#define NMK_GPIO_IS 0x48
194#define NMK_GPIO_IC 0x4c
195#define NMK_GPIO_RWIMSC 0x50
196#define NMK_GPIO_FWIMSC 0x54
197#define NMK_GPIO_WKS 0x58
198/* These appear in DB8540 and later ASICs */
199#define NMK_GPIO_EDGELEVEL 0x5C
200#define NMK_GPIO_LEVEL 0x60
201
202/* Alternate functions: function C is set in hw by setting both A and B */
203#define NMK_GPIO_ALT_GPIO 0
204#define NMK_GPIO_ALT_A 1
205#define NMK_GPIO_ALT_B 2
206#define NMK_GPIO_ALT_C (NMK_GPIO_ALT_A | NMK_GPIO_ALT_B)
207
208#define NMK_GPIO_ALT_CX_SHIFT 2
209#define NMK_GPIO_ALT_C1 ((1<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
210#define NMK_GPIO_ALT_C2 ((2<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
211#define NMK_GPIO_ALT_C3 ((3<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
212#define NMK_GPIO_ALT_C4 ((4<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
213
214/* Pull up/down values */
215enum nmk_gpio_pull {
216 NMK_GPIO_PULL_NONE,
217 NMK_GPIO_PULL_UP,
218 NMK_GPIO_PULL_DOWN,
219};
220
221/* Sleep mode */
222enum nmk_gpio_slpm {
223 NMK_GPIO_SLPM_INPUT,
224 NMK_GPIO_SLPM_WAKEUP_ENABLE = NMK_GPIO_SLPM_INPUT,
225 NMK_GPIO_SLPM_NOCHANGE,
226 NMK_GPIO_SLPM_WAKEUP_DISABLE = NMK_GPIO_SLPM_NOCHANGE,
227};
228
229/*
230 * Platform data to register a block: only the initial gpio/irq number.
231 */
232struct nmk_gpio_platform_data {
233 char *name;
234 int first_gpio;
235 int first_irq;
236 int num_gpio;
237 u32 (*get_secondary_status)(unsigned int bank);
238 void (*set_ioforce)(bool enable);
239 bool supports_sleepmode;
240};
241
242#endif /* __PLAT_NOMADIK_GPIO */
diff --git a/include/linux/platform_data/pn544.h b/include/linux/platform_data/pn544.h
index 713bfd703342..5ce1ab983f44 100644
--- a/include/linux/platform_data/pn544.h
+++ b/include/linux/platform_data/pn544.h
@@ -16,8 +16,7 @@
16 * GNU General Public License for more details. 16 * GNU General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU General Public License 18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software 19 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */ 20 */
22 21
23#ifndef _PN544_H_ 22#ifndef _PN544_H_
diff --git a/include/linux/platform_data/sht15.h b/include/linux/platform_data/sht15.h
index 33e0fd27225e..12289c1e9413 100644
--- a/include/linux/platform_data/sht15.h
+++ b/include/linux/platform_data/sht15.h
@@ -12,6 +12,9 @@
12 * For further information, see the Documentation/hwmon/sht15 file. 12 * For further information, see the Documentation/hwmon/sht15 file.
13 */ 13 */
14 14
15#ifndef _PDATA_SHT15_H
16#define _PDATA_SHT15_H
17
15/** 18/**
16 * struct sht15_platform_data - sht15 connectivity info 19 * struct sht15_platform_data - sht15 connectivity info
17 * @gpio_data: no. of gpio to which bidirectional data line is 20 * @gpio_data: no. of gpio to which bidirectional data line is
@@ -31,3 +34,5 @@ struct sht15_platform_data {
31 bool no_otp_reload; 34 bool no_otp_reload;
32 bool low_resolution; 35 bool low_resolution;
33}; 36};
37
38#endif /* _PDATA_SHT15_H */
diff --git a/include/linux/platform_data/si5351.h b/include/linux/platform_data/si5351.h
index 54334393ab92..a947ab8b441a 100644
--- a/include/linux/platform_data/si5351.h
+++ b/include/linux/platform_data/si5351.h
@@ -8,20 +8,6 @@
8struct clk; 8struct clk;
9 9
10/** 10/**
11 * enum si5351_variant - SiLabs Si5351 chip variant
12 * @SI5351_VARIANT_A: Si5351A (8 output clocks, XTAL input)
13 * @SI5351_VARIANT_A3: Si5351A MSOP10 (3 output clocks, XTAL input)
14 * @SI5351_VARIANT_B: Si5351B (8 output clocks, XTAL/VXCO input)
15 * @SI5351_VARIANT_C: Si5351C (8 output clocks, XTAL/CLKIN input)
16 */
17enum si5351_variant {
18 SI5351_VARIANT_A = 1,
19 SI5351_VARIANT_A3 = 2,
20 SI5351_VARIANT_B = 3,
21 SI5351_VARIANT_C = 4,
22};
23
24/**
25 * enum si5351_pll_src - Si5351 pll clock source 11 * enum si5351_pll_src - Si5351 pll clock source
26 * @SI5351_PLL_SRC_DEFAULT: default, do not change eeprom config 12 * @SI5351_PLL_SRC_DEFAULT: default, do not change eeprom config
27 * @SI5351_PLL_SRC_XTAL: pll source clock is XTAL input 13 * @SI5351_PLL_SRC_XTAL: pll source clock is XTAL input
@@ -115,14 +101,12 @@ struct si5351_clkout_config {
115 101
116/** 102/**
117 * struct si5351_platform_data - Platform data for the Si5351 clock driver 103 * struct si5351_platform_data - Platform data for the Si5351 clock driver
118 * @variant: Si5351 chip variant
119 * @clk_xtal: xtal input clock 104 * @clk_xtal: xtal input clock
120 * @clk_clkin: clkin input clock 105 * @clk_clkin: clkin input clock
121 * @pll_src: array of pll source clock setting 106 * @pll_src: array of pll source clock setting
122 * @clkout: array of clkout configuration 107 * @clkout: array of clkout configuration
123 */ 108 */
124struct si5351_platform_data { 109struct si5351_platform_data {
125 enum si5351_variant variant;
126 struct clk *clk_xtal; 110 struct clk *clk_xtal;
127 struct clk *clk_clkin; 111 struct clk *clk_clkin;
128 enum si5351_pll_src pll_src[2]; 112 enum si5351_pll_src pll_src[2];
diff --git a/include/linux/platform_data/spi-nuc900.h b/include/linux/platform_data/spi-nuc900.h
index 2c4e0c128501..4b3f46832e19 100644
--- a/include/linux/platform_data/spi-nuc900.h
+++ b/include/linux/platform_data/spi-nuc900.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/mach-w90x900/include/mach/nuc900_spi.h
3 *
4 * Copyright (c) 2009 Nuvoton technology corporation. 2 * Copyright (c) 2009 Nuvoton technology corporation.
5 * 3 *
6 * Wan ZongShun <mcuos.com@gmail.com> 4 * Wan ZongShun <mcuos.com@gmail.com>
@@ -11,8 +9,8 @@
11 * 9 *
12 */ 10 */
13 11
14#ifndef __ASM_ARCH_SPI_H 12#ifndef __SPI_NUC900_H
15#define __ASM_ARCH_SPI_H 13#define __SPI_NUC900_H
16 14
17extern void mfp_set_groupg(struct device *dev, const char *subname); 15extern void mfp_set_groupg(struct device *dev, const char *subname);
18 16
@@ -32,4 +30,4 @@ struct nuc900_spi_chip {
32 unsigned char bits_per_word; 30 unsigned char bits_per_word;
33}; 31};
34 32
35#endif /* __ASM_ARCH_SPI_H */ 33#endif /* __SPI_NUC900_H */
diff --git a/include/linux/platform_data/usb-ehci-orion.h b/include/linux/platform_data/usb-ehci-orion.h
index 6fc78e430420..52b0acb35fd7 100644
--- a/include/linux/platform_data/usb-ehci-orion.h
+++ b/include/linux/platform_data/usb-ehci-orion.h
@@ -1,13 +1,11 @@
1/* 1/*
2 * arch/arm/plat-orion/include/plat/ehci-orion.h
3 *
4 * This file is licensed under the terms of the GNU General Public 2 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any 3 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied. 4 * warranty of any kind, whether express or implied.
7 */ 5 */
8 6
9#ifndef __PLAT_EHCI_ORION_H 7#ifndef __USB_EHCI_ORION_H
10#define __PLAT_EHCI_ORION_H 8#define __USB_EHCI_ORION_H
11 9
12#include <linux/mbus.h> 10#include <linux/mbus.h>
13 11
diff --git a/include/linux/platform_data/usb-omap1.h b/include/linux/platform_data/usb-omap1.h
new file mode 100644
index 000000000000..43b5ce139c37
--- /dev/null
+++ b/include/linux/platform_data/usb-omap1.h
@@ -0,0 +1,53 @@
1/*
2 * Platform data for OMAP1 USB
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive for
6 * more details.
7 */
8#ifndef __LINUX_USB_OMAP1_H
9#define __LINUX_USB_OMAP1_H
10
11#include <linux/platform_device.h>
12
13struct omap_usb_config {
14 /* Configure drivers according to the connectors on your board:
15 * - "A" connector (rectagular)
16 * ... for host/OHCI use, set "register_host".
17 * - "B" connector (squarish) or "Mini-B"
18 * ... for device/gadget use, set "register_dev".
19 * - "Mini-AB" connector (very similar to Mini-B)
20 * ... for OTG use as device OR host, initialize "otg"
21 */
22 unsigned register_host:1;
23 unsigned register_dev:1;
24 u8 otg; /* port number, 1-based: usb1 == 2 */
25
26 const char *extcon; /* extcon device for OTG */
27
28 u8 hmc_mode;
29
30 /* implicitly true if otg: host supports remote wakeup? */
31 u8 rwc;
32
33 /* signaling pins used to talk to transceiver on usbN:
34 * 0 == usbN unused
35 * 2 == usb0-only, using internal transceiver
36 * 3 == 3 wire bidirectional
37 * 4 == 4 wire bidirectional
38 * 6 == 6 wire unidirectional (or TLL)
39 */
40 u8 pins[3];
41
42 struct platform_device *udc_device;
43 struct platform_device *ohci_device;
44 struct platform_device *otg_device;
45
46 u32 (*usb0_init)(unsigned nwires, unsigned is_device);
47 u32 (*usb1_init)(unsigned nwires);
48 u32 (*usb2_init)(unsigned nwires, unsigned alt_pingroup);
49
50 int (*ocpi_enable)(void);
51};
52
53#endif /* __LINUX_USB_OMAP1_H */
diff --git a/include/linux/platform_data/video-ep93xx.h b/include/linux/platform_data/video-ep93xx.h
index d5ae11d7c453..92fc2b2232e7 100644
--- a/include/linux/platform_data/video-ep93xx.h
+++ b/include/linux/platform_data/video-ep93xx.h
@@ -1,9 +1,5 @@
1/* 1#ifndef __VIDEO_EP93XX_H
2 * arch/arm/mach-ep93xx/include/mach/fb.h 2#define __VIDEO_EP93XX_H
3 */
4
5#ifndef __ASM_ARCH_EP93XXFB_H
6#define __ASM_ARCH_EP93XXFB_H
7 3
8struct platform_device; 4struct platform_device;
9struct fb_videomode; 5struct fb_videomode;
@@ -53,4 +49,4 @@ struct ep93xxfb_mach_info {
53 void (*blank)(int blank_mode, struct fb_info *info); 49 void (*blank)(int blank_mode, struct fb_info *info);
54}; 50};
55 51
56#endif /* __ASM_ARCH_EP93XXFB_H */ 52#endif /* __VIDEO_EP93XX_H */
diff --git a/include/linux/platform_data/video-msm_fb.h b/include/linux/platform_data/video-msm_fb.h
index 1f4fc81b3d8f..31449be3eadb 100644
--- a/include/linux/platform_data/video-msm_fb.h
+++ b/include/linux/platform_data/video-msm_fb.h
@@ -1,5 +1,4 @@
1/* arch/arm/mach-msm/include/mach/msm_fb.h 1/*
2 *
3 * Internal shared definitions for various MSM framebuffer parts. 2 * Internal shared definitions for various MSM framebuffer parts.
4 * 3 *
5 * Copyright (C) 2007 Google Incorporated 4 * Copyright (C) 2007 Google Incorporated
diff --git a/include/linux/platform_data/video-pxafb.h b/include/linux/platform_data/video-pxafb.h
index 486b4c519ae2..07c6c1e153f8 100644
--- a/include/linux/platform_data/video-pxafb.h
+++ b/include/linux/platform_data/video-pxafb.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/mach-pxa/include/mach/pxafb.h
3 *
4 * Support for the xscale frame buffer. 2 * Support for the xscale frame buffer.
5 * 3 *
6 * Author: Jean-Frederic Clere 4 * Author: Jean-Frederic Clere
diff --git a/include/linux/platform_data/vsp1.h b/include/linux/platform_data/vsp1.h
index a73a456d7f11..63170e2614b3 100644
--- a/include/linux/platform_data/vsp1.h
+++ b/include/linux/platform_data/vsp1.h
@@ -14,6 +14,8 @@
14#define __PLATFORM_VSP1_H__ 14#define __PLATFORM_VSP1_H__
15 15
16#define VSP1_HAS_LIF (1 << 0) 16#define VSP1_HAS_LIF (1 << 0)
17#define VSP1_HAS_LUT (1 << 1)
18#define VSP1_HAS_SRU (1 << 2)
17 19
18struct vsp1_platform_data { 20struct vsp1_platform_data {
19 unsigned int features; 21 unsigned int features;
diff --git a/include/linux/pm.h b/include/linux/pm.h
index a224c7f5c377..8c6583a53a06 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -311,6 +311,18 @@ struct dev_pm_ops {
311#define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) 311#define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
312#endif 312#endif
313 313
314#ifdef CONFIG_PM_SLEEP
315#define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
316 .suspend_late = suspend_fn, \
317 .resume_early = resume_fn, \
318 .freeze_late = suspend_fn, \
319 .thaw_early = resume_fn, \
320 .poweroff_late = suspend_fn, \
321 .restore_early = resume_fn,
322#else
323#define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
324#endif
325
314#ifdef CONFIG_PM_RUNTIME 326#ifdef CONFIG_PM_RUNTIME
315#define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ 327#define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
316 .runtime_suspend = suspend_fn, \ 328 .runtime_suspend = suspend_fn, \
@@ -320,6 +332,15 @@ struct dev_pm_ops {
320#define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) 332#define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn)
321#endif 333#endif
322 334
335#ifdef CONFIG_PM
336#define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
337 .runtime_suspend = suspend_fn, \
338 .runtime_resume = resume_fn, \
339 .runtime_idle = idle_fn,
340#else
341#define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn)
342#endif
343
323/* 344/*
324 * Use this if you want to use the same suspend and resume callbacks for suspend 345 * Use this if you want to use the same suspend and resume callbacks for suspend
325 * to RAM and hibernation. 346 * to RAM and hibernation.
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index 6fa7cea25da9..16c9a62fa1c0 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -23,6 +23,14 @@
23 usage_count */ 23 usage_count */
24#define RPM_AUTO 0x08 /* Use autosuspend_delay */ 24#define RPM_AUTO 0x08 /* Use autosuspend_delay */
25 25
26#ifdef CONFIG_PM
27extern int pm_generic_runtime_suspend(struct device *dev);
28extern int pm_generic_runtime_resume(struct device *dev);
29#else
30static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; }
31static inline int pm_generic_runtime_resume(struct device *dev) { return 0; }
32#endif
33
26#ifdef CONFIG_PM_RUNTIME 34#ifdef CONFIG_PM_RUNTIME
27 35
28extern struct workqueue_struct *pm_wq; 36extern struct workqueue_struct *pm_wq;
@@ -37,8 +45,6 @@ extern void pm_runtime_enable(struct device *dev);
37extern void __pm_runtime_disable(struct device *dev, bool check_resume); 45extern void __pm_runtime_disable(struct device *dev, bool check_resume);
38extern void pm_runtime_allow(struct device *dev); 46extern void pm_runtime_allow(struct device *dev);
39extern void pm_runtime_forbid(struct device *dev); 47extern void pm_runtime_forbid(struct device *dev);
40extern int pm_generic_runtime_suspend(struct device *dev);
41extern int pm_generic_runtime_resume(struct device *dev);
42extern void pm_runtime_no_callbacks(struct device *dev); 48extern void pm_runtime_no_callbacks(struct device *dev);
43extern void pm_runtime_irq_safe(struct device *dev); 49extern void pm_runtime_irq_safe(struct device *dev);
44extern void __pm_runtime_use_autosuspend(struct device *dev, bool use); 50extern void __pm_runtime_use_autosuspend(struct device *dev, bool use);
@@ -142,8 +148,6 @@ static inline bool pm_runtime_active(struct device *dev) { return true; }
142static inline bool pm_runtime_status_suspended(struct device *dev) { return false; } 148static inline bool pm_runtime_status_suspended(struct device *dev) { return false; }
143static inline bool pm_runtime_enabled(struct device *dev) { return false; } 149static inline bool pm_runtime_enabled(struct device *dev) { return false; }
144 150
145static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; }
146static inline int pm_generic_runtime_resume(struct device *dev) { return 0; }
147static inline void pm_runtime_no_callbacks(struct device *dev) {} 151static inline void pm_runtime_no_callbacks(struct device *dev) {}
148static inline void pm_runtime_irq_safe(struct device *dev) {} 152static inline void pm_runtime_irq_safe(struct device *dev) {}
149 153
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h
index 7931efe71175..3e96a6a76103 100644
--- a/include/linux/posix_acl.h
+++ b/include/linux/posix_acl.h
@@ -39,9 +39,6 @@ struct posix_acl_entry {
39 union { 39 union {
40 kuid_t e_uid; 40 kuid_t e_uid;
41 kgid_t e_gid; 41 kgid_t e_gid;
42#ifndef CONFIG_UIDGID_STRICT_TYPE_CHECKS
43 unsigned int e_id;
44#endif
45 }; 42 };
46}; 43};
47 44
@@ -88,91 +85,60 @@ extern int posix_acl_valid(const struct posix_acl *);
88extern int posix_acl_permission(struct inode *, const struct posix_acl *, int); 85extern int posix_acl_permission(struct inode *, const struct posix_acl *, int);
89extern struct posix_acl *posix_acl_from_mode(umode_t, gfp_t); 86extern struct posix_acl *posix_acl_from_mode(umode_t, gfp_t);
90extern int posix_acl_equiv_mode(const struct posix_acl *, umode_t *); 87extern int posix_acl_equiv_mode(const struct posix_acl *, umode_t *);
91extern int posix_acl_create(struct posix_acl **, gfp_t, umode_t *); 88extern int __posix_acl_create(struct posix_acl **, gfp_t, umode_t *);
92extern int posix_acl_chmod(struct posix_acl **, gfp_t, umode_t); 89extern int __posix_acl_chmod(struct posix_acl **, gfp_t, umode_t);
93 90
94extern struct posix_acl *get_posix_acl(struct inode *, int); 91extern struct posix_acl *get_posix_acl(struct inode *, int);
95extern int set_posix_acl(struct inode *, int, struct posix_acl *); 92extern int set_posix_acl(struct inode *, int, struct posix_acl *);
96 93
97#ifdef CONFIG_FS_POSIX_ACL 94#ifdef CONFIG_FS_POSIX_ACL
98static inline struct posix_acl **acl_by_type(struct inode *inode, int type) 95extern int posix_acl_chmod(struct inode *, umode_t);
96extern int posix_acl_create(struct inode *, umode_t *, struct posix_acl **,
97 struct posix_acl **);
98
99extern int simple_set_acl(struct inode *, struct posix_acl *, int);
100extern int simple_acl_create(struct inode *, struct inode *);
101
102struct posix_acl **acl_by_type(struct inode *inode, int type);
103struct posix_acl *get_cached_acl(struct inode *inode, int type);
104struct posix_acl *get_cached_acl_rcu(struct inode *inode, int type);
105void set_cached_acl(struct inode *inode, int type, struct posix_acl *acl);
106void forget_cached_acl(struct inode *inode, int type);
107void forget_all_cached_acls(struct inode *inode);
108
109static inline void cache_no_acl(struct inode *inode)
99{ 110{
100 switch (type) { 111 inode->i_acl = NULL;
101 case ACL_TYPE_ACCESS: 112 inode->i_default_acl = NULL;
102 return &inode->i_acl;
103 case ACL_TYPE_DEFAULT:
104 return &inode->i_default_acl;
105 default:
106 BUG();
107 }
108} 113}
109 114#else
110static inline struct posix_acl *get_cached_acl(struct inode *inode, int type) 115static inline int posix_acl_chmod(struct inode *inode, umode_t mode)
111{ 116{
112 struct posix_acl **p = acl_by_type(inode, type); 117 return 0;
113 struct posix_acl *acl = ACCESS_ONCE(*p);
114 if (acl) {
115 spin_lock(&inode->i_lock);
116 acl = *p;
117 if (acl != ACL_NOT_CACHED)
118 acl = posix_acl_dup(acl);
119 spin_unlock(&inode->i_lock);
120 }
121 return acl;
122} 118}
123 119
124static inline struct posix_acl *get_cached_acl_rcu(struct inode *inode, int type) 120#define simple_set_acl NULL
121
122static inline int simple_acl_create(struct inode *dir, struct inode *inode)
125{ 123{
126 return rcu_dereference(*acl_by_type(inode, type)); 124 return 0;
127} 125}
128 126static inline void cache_no_acl(struct inode *inode)
129static inline void set_cached_acl(struct inode *inode,
130 int type,
131 struct posix_acl *acl)
132{ 127{
133 struct posix_acl **p = acl_by_type(inode, type);
134 struct posix_acl *old;
135 spin_lock(&inode->i_lock);
136 old = *p;
137 rcu_assign_pointer(*p, posix_acl_dup(acl));
138 spin_unlock(&inode->i_lock);
139 if (old != ACL_NOT_CACHED)
140 posix_acl_release(old);
141} 128}
142 129
143static inline void forget_cached_acl(struct inode *inode, int type) 130static inline int posix_acl_create(struct inode *inode, umode_t *mode,
131 struct posix_acl **default_acl, struct posix_acl **acl)
144{ 132{
145 struct posix_acl **p = acl_by_type(inode, type); 133 *default_acl = *acl = NULL;
146 struct posix_acl *old; 134 return 0;
147 spin_lock(&inode->i_lock);
148 old = *p;
149 *p = ACL_NOT_CACHED;
150 spin_unlock(&inode->i_lock);
151 if (old != ACL_NOT_CACHED)
152 posix_acl_release(old);
153} 135}
154 136
155static inline void forget_all_cached_acls(struct inode *inode) 137static inline void forget_all_cached_acls(struct inode *inode)
156{ 138{
157 struct posix_acl *old_access, *old_default;
158 spin_lock(&inode->i_lock);
159 old_access = inode->i_acl;
160 old_default = inode->i_default_acl;
161 inode->i_acl = inode->i_default_acl = ACL_NOT_CACHED;
162 spin_unlock(&inode->i_lock);
163 if (old_access != ACL_NOT_CACHED)
164 posix_acl_release(old_access);
165 if (old_default != ACL_NOT_CACHED)
166 posix_acl_release(old_default);
167} 139}
168#endif 140#endif /* CONFIG_FS_POSIX_ACL */
169 141
170static inline void cache_no_acl(struct inode *inode) 142struct posix_acl *get_acl(struct inode *inode, int type);
171{
172#ifdef CONFIG_FS_POSIX_ACL
173 inode->i_acl = NULL;
174 inode->i_default_acl = NULL;
175#endif
176}
177 143
178#endif /* __LINUX_POSIX_ACL_H */ 144#endif /* __LINUX_POSIX_ACL_H */
diff --git a/include/linux/posix_acl_xattr.h b/include/linux/posix_acl_xattr.h
index ad93ad0f1db0..6f14ee295822 100644
--- a/include/linux/posix_acl_xattr.h
+++ b/include/linux/posix_acl_xattr.h
@@ -69,4 +69,7 @@ struct posix_acl *posix_acl_from_xattr(struct user_namespace *user_ns,
69int posix_acl_to_xattr(struct user_namespace *user_ns, 69int posix_acl_to_xattr(struct user_namespace *user_ns,
70 const struct posix_acl *acl, void *buffer, size_t size); 70 const struct posix_acl *acl, void *buffer, size_t size);
71 71
72extern const struct xattr_handler posix_acl_access_xattr_handler;
73extern const struct xattr_handler posix_acl_default_xattr_handler;
74
72#endif /* _POSIX_ACL_XATTR_H */ 75#endif /* _POSIX_ACL_XATTR_H */
diff --git a/include/linux/power/bq2415x_charger.h b/include/linux/power/bq2415x_charger.h
index 8dcc0f46fc0a..50762af8b834 100644
--- a/include/linux/power/bq2415x_charger.h
+++ b/include/linux/power/bq2415x_charger.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * bq2415x charger driver 2 * bq2415x charger driver
3 * 3 *
4 * Copyright (C) 2011-2012 Pali Rohár <pali.rohar@gmail.com> 4 * Copyright (C) 2011-2013 Pali Rohár <pali.rohar@gmail.com>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
@@ -31,46 +31,9 @@
31 * termination current. It it is less or equal to zero, configuring charge 31 * termination current. It it is less or equal to zero, configuring charge
32 * and termination current will not be possible. 32 * and termination current will not be possible.
33 * 33 *
34 * Function set_mode_hook is needed for automode (setting correct current 34 * For automode support is needed to provide name of power supply device
35 * limit when charger is connected/disconnected or setting boost mode). 35 * in value notify_device. Device driver must immediately report property
36 * When is NULL, automode function is disabled. When is not NULL, it must 36 * POWER_SUPPLY_PROP_CURRENT_MAX when current changed.
37 * have this prototype:
38 *
39 * int (*set_mode_hook)(
40 * void (*hook)(enum bq2415x_mode mode, void *data),
41 * void *data)
42 *
43 * hook is hook function (see below) and data is pointer to driver private
44 * data
45 *
46 * bq2415x driver will call it as:
47 *
48 * platform_data->set_mode_hook(bq2415x_hook_function, bq2415x_device);
49 *
50 * Board/platform function set_mode_hook return non zero value when hook
51 * function was successful registered. Platform code should call that hook
52 * function (which get from pointer, with data) every time when charger
53 * was connected/disconnected or require to enable boost mode. bq2415x
54 * driver then will set correct current limit, enable/disable charger or
55 * boost mode.
56 *
57 * Hook function has this prototype:
58 *
59 * void hook(enum bq2415x_mode mode, void *data);
60 *
61 * mode is bq2415x mode (charger or boost)
62 * data is pointer to driver private data (which get from
63 * set_charger_type_hook)
64 *
65 * When bq driver is being unloaded, it call function:
66 *
67 * platform_data->set_mode_hook(NULL, NULL);
68 *
69 * (hook function and driver private data are NULL)
70 *
71 * After that board/platform code must not call driver hook function! It
72 * is possible that pointer to hook function will not be valid and calling
73 * will cause undefined result.
74 */ 37 */
75 38
76/* Supported modes with maximal current limit */ 39/* Supported modes with maximal current limit */
@@ -89,8 +52,7 @@ struct bq2415x_platform_data {
89 int charge_current; /* mA */ 52 int charge_current; /* mA */
90 int termination_current; /* mA */ 53 int termination_current; /* mA */
91 int resistor_sense; /* m ohm */ 54 int resistor_sense; /* m ohm */
92 int (*set_mode_hook)(void (*hook)(enum bq2415x_mode mode, void *data), 55 const char *notify_device; /* name */
93 void *data);
94}; 56};
95 57
96#endif 58#endif
diff --git a/include/linux/power/charger-manager.h b/include/linux/power/charger-manager.h
index 0e86840eb603..07e7945a1ff2 100644
--- a/include/linux/power/charger-manager.h
+++ b/include/linux/power/charger-manager.h
@@ -37,6 +37,8 @@ enum cm_event_types {
37 CM_EVENT_BATT_FULL, 37 CM_EVENT_BATT_FULL,
38 CM_EVENT_BATT_IN, 38 CM_EVENT_BATT_IN,
39 CM_EVENT_BATT_OUT, 39 CM_EVENT_BATT_OUT,
40 CM_EVENT_BATT_OVERHEAT,
41 CM_EVENT_BATT_COLD,
40 CM_EVENT_EXT_PWR_IN_OUT, 42 CM_EVENT_EXT_PWR_IN_OUT,
41 CM_EVENT_CHG_START_STOP, 43 CM_EVENT_CHG_START_STOP,
42 CM_EVENT_OTHERS, 44 CM_EVENT_OTHERS,
@@ -173,11 +175,10 @@ struct charger_regulator {
173 * @num_charger_regulator: the number of entries in charger_regulators 175 * @num_charger_regulator: the number of entries in charger_regulators
174 * @charger_regulators: array of charger regulators 176 * @charger_regulators: array of charger regulators
175 * @psy_fuel_gauge: the name of power-supply for fuel gauge 177 * @psy_fuel_gauge: the name of power-supply for fuel gauge
176 * @temperature_out_of_range: 178 * @thermal_zone : the name of thermal zone for battery
177 * Determine whether the status is overheat or cold or normal. 179 * @temp_min : Minimum battery temperature for charging.
178 * return_value > 0: overheat 180 * @temp_max : Maximum battery temperature for charging.
179 * return_value == 0: normal 181 * @temp_diff : Temperature diffential to restart charging.
180 * return_value < 0: cold
181 * @measure_battery_temp: 182 * @measure_battery_temp:
182 * true: measure battery temperature 183 * true: measure battery temperature
183 * false: measure ambient temperature 184 * false: measure ambient temperature
@@ -190,7 +191,7 @@ struct charger_regulator {
190 * max_duration_ms', cm start charging. 191 * max_duration_ms', cm start charging.
191 */ 192 */
192struct charger_desc { 193struct charger_desc {
193 char *psy_name; 194 const char *psy_name;
194 195
195 enum polling_modes polling_mode; 196 enum polling_modes polling_mode;
196 unsigned int polling_interval_ms; 197 unsigned int polling_interval_ms;
@@ -203,18 +204,23 @@ struct charger_desc {
203 204
204 enum data_source battery_present; 205 enum data_source battery_present;
205 206
206 char **psy_charger_stat; 207 const char **psy_charger_stat;
207 208
208 int num_charger_regulators; 209 int num_charger_regulators;
209 struct charger_regulator *charger_regulators; 210 struct charger_regulator *charger_regulators;
210 211
211 char *psy_fuel_gauge; 212 const char *psy_fuel_gauge;
213
214 const char *thermal_zone;
215
216 int temp_min;
217 int temp_max;
218 int temp_diff;
212 219
213 int (*temperature_out_of_range)(int *mC);
214 bool measure_battery_temp; 220 bool measure_battery_temp;
215 221
216 u64 charging_max_duration_ms; 222 u32 charging_max_duration_ms;
217 u64 discharging_max_duration_ms; 223 u32 discharging_max_duration_ms;
218}; 224};
219 225
220#define PSY_NAME_MAX 30 226#define PSY_NAME_MAX 30
@@ -226,13 +232,13 @@ struct charger_desc {
226 * @desc: instance of charger_desc 232 * @desc: instance of charger_desc
227 * @fuel_gauge: power_supply for fuel gauge 233 * @fuel_gauge: power_supply for fuel gauge
228 * @charger_stat: array of power_supply for chargers 234 * @charger_stat: array of power_supply for chargers
235 * @tzd_batt : thermal zone device for battery
229 * @charger_enabled: the state of charger 236 * @charger_enabled: the state of charger
230 * @fullbatt_vchk_jiffies_at: 237 * @fullbatt_vchk_jiffies_at:
231 * jiffies at the time full battery check will occur. 238 * jiffies at the time full battery check will occur.
232 * @fullbatt_vchk_work: work queue for full battery check 239 * @fullbatt_vchk_work: work queue for full battery check
233 * @emergency_stop: 240 * @emergency_stop:
234 * When setting true, stop charging 241 * When setting true, stop charging
235 * @last_temp_mC: the measured temperature in milli-Celsius
236 * @psy_name_buf: the name of power-supply-class for charger manager 242 * @psy_name_buf: the name of power-supply-class for charger manager
237 * @charger_psy: power_supply for charger manager 243 * @charger_psy: power_supply for charger manager
238 * @status_save_ext_pwr_inserted: 244 * @status_save_ext_pwr_inserted:
@@ -250,13 +256,15 @@ struct charger_manager {
250 struct power_supply *fuel_gauge; 256 struct power_supply *fuel_gauge;
251 struct power_supply **charger_stat; 257 struct power_supply **charger_stat;
252 258
259#ifdef CONFIG_THERMAL
260 struct thermal_zone_device *tzd_batt;
261#endif
253 bool charger_enabled; 262 bool charger_enabled;
254 263
255 unsigned long fullbatt_vchk_jiffies_at; 264 unsigned long fullbatt_vchk_jiffies_at;
256 struct delayed_work fullbatt_vchk_work; 265 struct delayed_work fullbatt_vchk_work;
257 266
258 int emergency_stop; 267 int emergency_stop;
259 int last_temp_mC;
260 268
261 char psy_name_buf[PSY_NAME_MAX + 1]; 269 char psy_name_buf[PSY_NAME_MAX + 1];
262 struct power_supply charger_psy; 270 struct power_supply charger_psy;
diff --git a/include/linux/power/isp1704_charger.h b/include/linux/power/isp1704_charger.h
index 68096a6aa2d7..0105d9e7af85 100644
--- a/include/linux/power/isp1704_charger.h
+++ b/include/linux/power/isp1704_charger.h
@@ -24,6 +24,7 @@
24 24
25struct isp1704_charger_data { 25struct isp1704_charger_data {
26 void (*set_power)(bool on); 26 void (*set_power)(bool on);
27 int enable_gpio;
27}; 28};
28 29
29#endif 30#endif
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 5c2600630dc9..c9dc4e09854c 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -16,6 +16,7 @@
16#include <linux/workqueue.h> 16#include <linux/workqueue.h>
17#include <linux/leds.h> 17#include <linux/leds.h>
18#include <linux/spinlock.h> 18#include <linux/spinlock.h>
19#include <linux/notifier.h>
19 20
20struct device; 21struct device;
21 22
@@ -158,6 +159,10 @@ enum power_supply_type {
158 POWER_SUPPLY_TYPE_USB_ACA, /* Accessory Charger Adapters */ 159 POWER_SUPPLY_TYPE_USB_ACA, /* Accessory Charger Adapters */
159}; 160};
160 161
162enum power_supply_notifier_events {
163 PSY_EVENT_PROP_CHANGED,
164};
165
161union power_supply_propval { 166union power_supply_propval {
162 int intval; 167 int intval;
163 const char *strval; 168 const char *strval;
@@ -235,7 +240,18 @@ struct power_supply_info {
235 int use_for_apm; 240 int use_for_apm;
236}; 241};
237 242
243extern struct atomic_notifier_head power_supply_notifier;
244extern int power_supply_reg_notifier(struct notifier_block *nb);
245extern void power_supply_unreg_notifier(struct notifier_block *nb);
238extern struct power_supply *power_supply_get_by_name(const char *name); 246extern struct power_supply *power_supply_get_by_name(const char *name);
247#ifdef CONFIG_OF
248extern struct power_supply *power_supply_get_by_phandle(struct device_node *np,
249 const char *property);
250#else /* !CONFIG_OF */
251static inline struct power_supply *
252power_supply_get_by_phandle(struct device_node *np, const char *property)
253{ return NULL; }
254#endif /* CONFIG_OF */
239extern void power_supply_changed(struct power_supply *psy); 255extern void power_supply_changed(struct power_supply *psy);
240extern int power_supply_am_i_supplied(struct power_supply *psy); 256extern int power_supply_am_i_supplied(struct power_supply *psy);
241extern int power_supply_set_battery_charged(struct power_supply *psy); 257extern int power_supply_set_battery_charged(struct power_supply *psy);
diff --git a/include/linux/preempt.h b/include/linux/preempt.h
index a3d9dc8c2c00..de83b4eb1642 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -64,7 +64,11 @@ do { \
64} while (0) 64} while (0)
65 65
66#else 66#else
67#define preempt_enable() preempt_enable_no_resched() 67#define preempt_enable() \
68do { \
69 barrier(); \
70 preempt_count_dec(); \
71} while (0)
68#define preempt_check_resched() do { } while (0) 72#define preempt_check_resched() do { } while (0)
69#endif 73#endif
70 74
@@ -93,7 +97,11 @@ do { \
93 __preempt_schedule_context(); \ 97 __preempt_schedule_context(); \
94} while (0) 98} while (0)
95#else 99#else
96#define preempt_enable_notrace() preempt_enable_no_resched_notrace() 100#define preempt_enable_notrace() \
101do { \
102 barrier(); \
103 __preempt_count_dec(); \
104} while (0)
97#endif 105#endif
98 106
99#else /* !CONFIG_PREEMPT_COUNT */ 107#else /* !CONFIG_PREEMPT_COUNT */
@@ -116,6 +124,26 @@ do { \
116 124
117#endif /* CONFIG_PREEMPT_COUNT */ 125#endif /* CONFIG_PREEMPT_COUNT */
118 126
127#ifdef MODULE
128/*
129 * Modules have no business playing preemption tricks.
130 */
131#undef sched_preempt_enable_no_resched
132#undef preempt_enable_no_resched
133#undef preempt_enable_no_resched_notrace
134#undef preempt_check_resched
135#endif
136
137#define preempt_set_need_resched() \
138do { \
139 set_preempt_need_resched(); \
140} while (0)
141#define preempt_fold_need_resched() \
142do { \
143 if (tif_need_resched()) \
144 set_preempt_need_resched(); \
145} while (0)
146
119#ifdef CONFIG_PREEMPT_NOTIFIERS 147#ifdef CONFIG_PREEMPT_NOTIFIERS
120 148
121struct preempt_notifier; 149struct preempt_notifier;
diff --git a/include/linux/preempt_mask.h b/include/linux/preempt_mask.h
index d169820203dd..dbeec4d4a3be 100644
--- a/include/linux/preempt_mask.h
+++ b/include/linux/preempt_mask.h
@@ -2,7 +2,6 @@
2#define LINUX_PREEMPT_MASK_H 2#define LINUX_PREEMPT_MASK_H
3 3
4#include <linux/preempt.h> 4#include <linux/preempt.h>
5#include <asm/hardirq.h>
6 5
7/* 6/*
8 * We put the hardirq and softirq counter into the preemption 7 * We put the hardirq and softirq counter into the preemption
@@ -79,6 +78,21 @@
79#endif 78#endif
80 79
81/* 80/*
81 * The preempt_count offset needed for things like:
82 *
83 * spin_lock_bh()
84 *
85 * Which need to disable both preemption (CONFIG_PREEMPT_COUNT) and
86 * softirqs, such that unlock sequences of:
87 *
88 * spin_unlock();
89 * local_bh_enable();
90 *
91 * Work as expected.
92 */
93#define SOFTIRQ_LOCK_OFFSET (SOFTIRQ_DISABLE_OFFSET + PREEMPT_CHECK_OFFSET)
94
95/*
82 * Are we running in atomic context? WARNING: this macro cannot 96 * Are we running in atomic context? WARNING: this macro cannot
83 * always detect atomic context; in particular, it cannot know about 97 * always detect atomic context; in particular, it cannot know about
84 * held spinlocks in non-preemptible kernels. Thus it should not be 98 * held spinlocks in non-preemptible kernels. Thus it should not be
diff --git a/include/linux/printk.h b/include/linux/printk.h
index 694925837a16..fa47e2708c01 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -5,6 +5,7 @@
5#include <linux/init.h> 5#include <linux/init.h>
6#include <linux/kern_levels.h> 6#include <linux/kern_levels.h>
7#include <linux/linkage.h> 7#include <linux/linkage.h>
8#include <linux/cache.h>
8 9
9extern const char linux_banner[]; 10extern const char linux_banner[];
10extern const char linux_proc_banner[]; 11extern const char linux_proc_banner[];
@@ -88,6 +89,13 @@ struct va_format {
88#define HW_ERR "[Hardware Error]: " 89#define HW_ERR "[Hardware Error]: "
89 90
90/* 91/*
92 * DEPRECATED
93 * Add this to a message whenever you want to warn user space about the use
94 * of a deprecated aspect of an API so they can stop using it
95 */
96#define DEPRECATED "[Deprecated]: "
97
98/*
91 * Dummy printk for disabled debugging statements to use whilst maintaining 99 * Dummy printk for disabled debugging statements to use whilst maintaining
92 * gcc's format and side-effect checking. 100 * gcc's format and side-effect checking.
93 */ 101 */
@@ -253,17 +261,17 @@ extern asmlinkage void dump_stack(void) __cold;
253 */ 261 */
254 262
255#ifdef CONFIG_PRINTK 263#ifdef CONFIG_PRINTK
256#define printk_once(fmt, ...) \ 264#define printk_once(fmt, ...) \
257({ \ 265({ \
258 static bool __print_once; \ 266 static bool __print_once __read_mostly; \
259 \ 267 \
260 if (!__print_once) { \ 268 if (!__print_once) { \
261 __print_once = true; \ 269 __print_once = true; \
262 printk(fmt, ##__VA_ARGS__); \ 270 printk(fmt, ##__VA_ARGS__); \
263 } \ 271 } \
264}) 272})
265#else 273#else
266#define printk_once(fmt, ...) \ 274#define printk_once(fmt, ...) \
267 no_printk(fmt, ##__VA_ARGS__) 275 no_printk(fmt, ##__VA_ARGS__)
268#endif 276#endif
269 277
diff --git a/include/linux/projid.h b/include/linux/projid.h
index 36517b95be5c..8c1f2c55226d 100644
--- a/include/linux/projid.h
+++ b/include/linux/projid.h
@@ -18,8 +18,6 @@ extern struct user_namespace init_user_ns;
18 18
19typedef __kernel_uid32_t projid_t; 19typedef __kernel_uid32_t projid_t;
20 20
21#ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS
22
23typedef struct { 21typedef struct {
24 projid_t val; 22 projid_t val;
25} kprojid_t; 23} kprojid_t;
@@ -31,19 +29,6 @@ static inline projid_t __kprojid_val(kprojid_t projid)
31 29
32#define KPROJIDT_INIT(value) (kprojid_t){ value } 30#define KPROJIDT_INIT(value) (kprojid_t){ value }
33 31
34#else
35
36typedef projid_t kprojid_t;
37
38static inline projid_t __kprojid_val(kprojid_t projid)
39{
40 return projid;
41}
42
43#define KPROJIDT_INIT(value) ((kprojid_t) value )
44
45#endif
46
47#define INVALID_PROJID KPROJIDT_INIT(-1) 32#define INVALID_PROJID KPROJIDT_INIT(-1)
48#define OVERFLOW_PROJID 65534 33#define OVERFLOW_PROJID 65534
49 34
diff --git a/include/linux/pstore.h b/include/linux/pstore.h
index abd437d0a8a7..ece0c6bbfcc5 100644
--- a/include/linux/pstore.h
+++ b/include/linux/pstore.h
@@ -51,6 +51,7 @@ struct pstore_info {
51 char *buf; 51 char *buf;
52 size_t bufsize; 52 size_t bufsize;
53 struct mutex read_mutex; /* serialize open/read/close */ 53 struct mutex read_mutex; /* serialize open/read/close */
54 int flags;
54 int (*open)(struct pstore_info *psi); 55 int (*open)(struct pstore_info *psi);
55 int (*close)(struct pstore_info *psi); 56 int (*close)(struct pstore_info *psi);
56 ssize_t (*read)(u64 *id, enum pstore_type_id *type, 57 ssize_t (*read)(u64 *id, enum pstore_type_id *type,
@@ -70,6 +71,8 @@ struct pstore_info {
70 void *data; 71 void *data;
71}; 72};
72 73
74#define PSTORE_FLAGS_FRAGILE 1
75
73#ifdef CONFIG_PSTORE 76#ifdef CONFIG_PSTORE
74extern int pstore_register(struct pstore_info *); 77extern int pstore_register(struct pstore_info *);
75extern bool pstore_cannot_block_path(enum kmsg_dump_reason reason); 78extern bool pstore_cannot_block_path(enum kmsg_dump_reason reason);
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h
index 753207c8ce20..ecc730977a5a 100644
--- a/include/linux/ramfs.h
+++ b/include/linux/ramfs.h
@@ -14,13 +14,6 @@ ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize)
14} 14}
15#else 15#else
16extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize); 16extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize);
17extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file,
18 unsigned long addr,
19 unsigned long len,
20 unsigned long pgoff,
21 unsigned long flags);
22
23extern int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma);
24#endif 17#endif
25 18
26extern const struct file_operations ramfs_file_operations; 19extern const struct file_operations ramfs_file_operations;
diff --git a/include/linux/random.h b/include/linux/random.h
index 4002b3df4c85..1cfce0e24dbd 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -8,7 +8,6 @@
8 8
9#include <uapi/linux/random.h> 9#include <uapi/linux/random.h>
10 10
11
12extern void add_device_randomness(const void *, unsigned int); 11extern void add_device_randomness(const void *, unsigned int);
13extern void add_input_randomness(unsigned int type, unsigned int code, 12extern void add_input_randomness(unsigned int type, unsigned int code,
14 unsigned int value); 13 unsigned int value);
@@ -38,6 +37,23 @@ struct rnd_state {
38u32 prandom_u32_state(struct rnd_state *state); 37u32 prandom_u32_state(struct rnd_state *state);
39void prandom_bytes_state(struct rnd_state *state, void *buf, int nbytes); 38void prandom_bytes_state(struct rnd_state *state, void *buf, int nbytes);
40 39
40/**
41 * prandom_u32_max - returns a pseudo-random number in interval [0, ep_ro)
42 * @ep_ro: right open interval endpoint
43 *
44 * Returns a pseudo-random number that is in interval [0, ep_ro). Note
45 * that the result depends on PRNG being well distributed in [0, ~0U]
46 * u32 space. Here we use maximally equidistributed combined Tausworthe
47 * generator, that is, prandom_u32(). This is useful when requesting a
48 * random index of an array containing ep_ro elements, for example.
49 *
50 * Returns: pseudo-random number in interval [0, ep_ro)
51 */
52static inline u32 prandom_u32_max(u32 ep_ro)
53{
54 return (u32)(((u64) prandom_u32() * ep_ro) >> 32);
55}
56
41/* 57/*
42 * Handle minimum values for seeds 58 * Handle minimum values for seeds
43 */ 59 */
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index 45a0a9e81478..dbaf99084112 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -55,8 +55,8 @@ static inline void __list_add_rcu(struct list_head *new,
55 next->prev = new; 55 next->prev = new;
56} 56}
57#else 57#else
58extern void __list_add_rcu(struct list_head *new, 58void __list_add_rcu(struct list_head *new,
59 struct list_head *prev, struct list_head *next); 59 struct list_head *prev, struct list_head *next);
60#endif 60#endif
61 61
62/** 62/**
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 39cbb889e20d..72bf3a01a4ee 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -50,13 +50,13 @@ extern int rcutorture_runnable; /* for sysctl */
50#endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ 50#endif /* #ifdef CONFIG_RCU_TORTURE_TEST */
51 51
52#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) 52#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
53extern void rcutorture_record_test_transition(void); 53void rcutorture_record_test_transition(void);
54extern void rcutorture_record_progress(unsigned long vernum); 54void rcutorture_record_progress(unsigned long vernum);
55extern void do_trace_rcu_torture_read(const char *rcutorturename, 55void do_trace_rcu_torture_read(const char *rcutorturename,
56 struct rcu_head *rhp, 56 struct rcu_head *rhp,
57 unsigned long secs, 57 unsigned long secs,
58 unsigned long c_old, 58 unsigned long c_old,
59 unsigned long c); 59 unsigned long c);
60#else 60#else
61static inline void rcutorture_record_test_transition(void) 61static inline void rcutorture_record_test_transition(void)
62{ 62{
@@ -65,11 +65,11 @@ static inline void rcutorture_record_progress(unsigned long vernum)
65{ 65{
66} 66}
67#ifdef CONFIG_RCU_TRACE 67#ifdef CONFIG_RCU_TRACE
68extern void do_trace_rcu_torture_read(const char *rcutorturename, 68void do_trace_rcu_torture_read(const char *rcutorturename,
69 struct rcu_head *rhp, 69 struct rcu_head *rhp,
70 unsigned long secs, 70 unsigned long secs,
71 unsigned long c_old, 71 unsigned long c_old,
72 unsigned long c); 72 unsigned long c);
73#else 73#else
74#define do_trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \ 74#define do_trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \
75 do { } while (0) 75 do { } while (0)
@@ -118,8 +118,8 @@ extern void do_trace_rcu_torture_read(const char *rcutorturename,
118 * if CPU A and CPU B are the same CPU (but again only if the system has 118 * if CPU A and CPU B are the same CPU (but again only if the system has
119 * more than one CPU). 119 * more than one CPU).
120 */ 120 */
121extern void call_rcu(struct rcu_head *head, 121void call_rcu(struct rcu_head *head,
122 void (*func)(struct rcu_head *head)); 122 void (*func)(struct rcu_head *head));
123 123
124#else /* #ifdef CONFIG_PREEMPT_RCU */ 124#else /* #ifdef CONFIG_PREEMPT_RCU */
125 125
@@ -149,8 +149,8 @@ extern void call_rcu(struct rcu_head *head,
149 * See the description of call_rcu() for more detailed information on 149 * See the description of call_rcu() for more detailed information on
150 * memory ordering guarantees. 150 * memory ordering guarantees.
151 */ 151 */
152extern void call_rcu_bh(struct rcu_head *head, 152void call_rcu_bh(struct rcu_head *head,
153 void (*func)(struct rcu_head *head)); 153 void (*func)(struct rcu_head *head));
154 154
155/** 155/**
156 * call_rcu_sched() - Queue an RCU for invocation after sched grace period. 156 * call_rcu_sched() - Queue an RCU for invocation after sched grace period.
@@ -171,16 +171,16 @@ extern void call_rcu_bh(struct rcu_head *head,
171 * See the description of call_rcu() for more detailed information on 171 * See the description of call_rcu() for more detailed information on
172 * memory ordering guarantees. 172 * memory ordering guarantees.
173 */ 173 */
174extern void call_rcu_sched(struct rcu_head *head, 174void call_rcu_sched(struct rcu_head *head,
175 void (*func)(struct rcu_head *rcu)); 175 void (*func)(struct rcu_head *rcu));
176 176
177extern void synchronize_sched(void); 177void synchronize_sched(void);
178 178
179#ifdef CONFIG_PREEMPT_RCU 179#ifdef CONFIG_PREEMPT_RCU
180 180
181extern void __rcu_read_lock(void); 181void __rcu_read_lock(void);
182extern void __rcu_read_unlock(void); 182void __rcu_read_unlock(void);
183extern void rcu_read_unlock_special(struct task_struct *t); 183void rcu_read_unlock_special(struct task_struct *t);
184void synchronize_rcu(void); 184void synchronize_rcu(void);
185 185
186/* 186/*
@@ -216,19 +216,19 @@ static inline int rcu_preempt_depth(void)
216#endif /* #else #ifdef CONFIG_PREEMPT_RCU */ 216#endif /* #else #ifdef CONFIG_PREEMPT_RCU */
217 217
218/* Internal to kernel */ 218/* Internal to kernel */
219extern void rcu_init(void); 219void rcu_init(void);
220extern void rcu_sched_qs(int cpu); 220void rcu_sched_qs(int cpu);
221extern void rcu_bh_qs(int cpu); 221void rcu_bh_qs(int cpu);
222extern void rcu_check_callbacks(int cpu, int user); 222void rcu_check_callbacks(int cpu, int user);
223struct notifier_block; 223struct notifier_block;
224extern void rcu_idle_enter(void); 224void rcu_idle_enter(void);
225extern void rcu_idle_exit(void); 225void rcu_idle_exit(void);
226extern void rcu_irq_enter(void); 226void rcu_irq_enter(void);
227extern void rcu_irq_exit(void); 227void rcu_irq_exit(void);
228 228
229#ifdef CONFIG_RCU_USER_QS 229#ifdef CONFIG_RCU_USER_QS
230extern void rcu_user_enter(void); 230void rcu_user_enter(void);
231extern void rcu_user_exit(void); 231void rcu_user_exit(void);
232#else 232#else
233static inline void rcu_user_enter(void) { } 233static inline void rcu_user_enter(void) { }
234static inline void rcu_user_exit(void) { } 234static inline void rcu_user_exit(void) { }
@@ -262,7 +262,7 @@ static inline void rcu_user_hooks_switch(struct task_struct *prev,
262 } while (0) 262 } while (0)
263 263
264#if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) 264#if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP)
265extern bool __rcu_is_watching(void); 265bool __rcu_is_watching(void);
266#endif /* #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) */ 266#endif /* #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) */
267 267
268/* 268/*
@@ -289,8 +289,8 @@ void wait_rcu_gp(call_rcu_func_t crf);
289 * initialization. 289 * initialization.
290 */ 290 */
291#ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD 291#ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD
292extern void init_rcu_head_on_stack(struct rcu_head *head); 292void init_rcu_head_on_stack(struct rcu_head *head);
293extern void destroy_rcu_head_on_stack(struct rcu_head *head); 293void destroy_rcu_head_on_stack(struct rcu_head *head);
294#else /* !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ 294#else /* !CONFIG_DEBUG_OBJECTS_RCU_HEAD */
295static inline void init_rcu_head_on_stack(struct rcu_head *head) 295static inline void init_rcu_head_on_stack(struct rcu_head *head)
296{ 296{
@@ -325,6 +325,7 @@ static inline void rcu_lock_release(struct lockdep_map *map)
325extern struct lockdep_map rcu_lock_map; 325extern struct lockdep_map rcu_lock_map;
326extern struct lockdep_map rcu_bh_lock_map; 326extern struct lockdep_map rcu_bh_lock_map;
327extern struct lockdep_map rcu_sched_lock_map; 327extern struct lockdep_map rcu_sched_lock_map;
328extern struct lockdep_map rcu_callback_map;
328extern int debug_lockdep_rcu_enabled(void); 329extern int debug_lockdep_rcu_enabled(void);
329 330
330/** 331/**
@@ -362,7 +363,7 @@ static inline int rcu_read_lock_held(void)
362 * rcu_read_lock_bh_held() is defined out of line to avoid #include-file 363 * rcu_read_lock_bh_held() is defined out of line to avoid #include-file
363 * hell. 364 * hell.
364 */ 365 */
365extern int rcu_read_lock_bh_held(void); 366int rcu_read_lock_bh_held(void);
366 367
367/** 368/**
368 * rcu_read_lock_sched_held() - might we be in RCU-sched read-side critical section? 369 * rcu_read_lock_sched_held() - might we be in RCU-sched read-side critical section?
@@ -448,8 +449,6 @@ static inline int rcu_read_lock_sched_held(void)
448 449
449#ifdef CONFIG_PROVE_RCU 450#ifdef CONFIG_PROVE_RCU
450 451
451extern int rcu_my_thread_group_empty(void);
452
453/** 452/**
454 * rcu_lockdep_assert - emit lockdep splat if specified condition not met 453 * rcu_lockdep_assert - emit lockdep splat if specified condition not met
455 * @c: condition to check 454 * @c: condition to check
@@ -548,10 +547,48 @@ static inline void rcu_preempt_sleep_check(void)
548 smp_read_barrier_depends(); \ 547 smp_read_barrier_depends(); \
549 (_________p1); \ 548 (_________p1); \
550 }) 549 })
551#define __rcu_assign_pointer(p, v, space) \ 550
551/**
552 * RCU_INITIALIZER() - statically initialize an RCU-protected global variable
553 * @v: The value to statically initialize with.
554 */
555#define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
556
557/**
558 * rcu_assign_pointer() - assign to RCU-protected pointer
559 * @p: pointer to assign to
560 * @v: value to assign (publish)
561 *
562 * Assigns the specified value to the specified RCU-protected
563 * pointer, ensuring that any concurrent RCU readers will see
564 * any prior initialization.
565 *
566 * Inserts memory barriers on architectures that require them
567 * (which is most of them), and also prevents the compiler from
568 * reordering the code that initializes the structure after the pointer
569 * assignment. More importantly, this call documents which pointers
570 * will be dereferenced by RCU read-side code.
571 *
572 * In some special cases, you may use RCU_INIT_POINTER() instead
573 * of rcu_assign_pointer(). RCU_INIT_POINTER() is a bit faster due
574 * to the fact that it does not constrain either the CPU or the compiler.
575 * That said, using RCU_INIT_POINTER() when you should have used
576 * rcu_assign_pointer() is a very bad thing that results in
577 * impossible-to-diagnose memory corruption. So please be careful.
578 * See the RCU_INIT_POINTER() comment header for details.
579 *
580 * Note that rcu_assign_pointer() evaluates each of its arguments only
581 * once, appearances notwithstanding. One of the "extra" evaluations
582 * is in typeof() and the other visible only to sparse (__CHECKER__),
583 * neither of which actually execute the argument. As with most cpp
584 * macros, this execute-arguments-only-once property is important, so
585 * please be careful when making changes to rcu_assign_pointer() and the
586 * other macros that it invokes.
587 */
588#define rcu_assign_pointer(p, v) \
552 do { \ 589 do { \
553 smp_wmb(); \ 590 smp_wmb(); \
554 (p) = (typeof(*v) __force space *)(v); \ 591 ACCESS_ONCE(p) = RCU_INITIALIZER(v); \
555 } while (0) 592 } while (0)
556 593
557 594
@@ -890,32 +927,6 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
890} 927}
891 928
892/** 929/**
893 * rcu_assign_pointer() - assign to RCU-protected pointer
894 * @p: pointer to assign to
895 * @v: value to assign (publish)
896 *
897 * Assigns the specified value to the specified RCU-protected
898 * pointer, ensuring that any concurrent RCU readers will see
899 * any prior initialization.
900 *
901 * Inserts memory barriers on architectures that require them
902 * (which is most of them), and also prevents the compiler from
903 * reordering the code that initializes the structure after the pointer
904 * assignment. More importantly, this call documents which pointers
905 * will be dereferenced by RCU read-side code.
906 *
907 * In some special cases, you may use RCU_INIT_POINTER() instead
908 * of rcu_assign_pointer(). RCU_INIT_POINTER() is a bit faster due
909 * to the fact that it does not constrain either the CPU or the compiler.
910 * That said, using RCU_INIT_POINTER() when you should have used
911 * rcu_assign_pointer() is a very bad thing that results in
912 * impossible-to-diagnose memory corruption. So please be careful.
913 * See the RCU_INIT_POINTER() comment header for details.
914 */
915#define rcu_assign_pointer(p, v) \
916 __rcu_assign_pointer((p), (v), __rcu)
917
918/**
919 * RCU_INIT_POINTER() - initialize an RCU protected pointer 930 * RCU_INIT_POINTER() - initialize an RCU protected pointer
920 * 931 *
921 * Initialize an RCU-protected pointer in special cases where readers 932 * Initialize an RCU-protected pointer in special cases where readers
@@ -949,7 +960,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
949 */ 960 */
950#define RCU_INIT_POINTER(p, v) \ 961#define RCU_INIT_POINTER(p, v) \
951 do { \ 962 do { \
952 p = (typeof(*v) __force __rcu *)(v); \ 963 p = RCU_INITIALIZER(v); \
953 } while (0) 964 } while (0)
954 965
955/** 966/**
@@ -958,7 +969,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
958 * GCC-style initialization for an RCU-protected pointer in a structure field. 969 * GCC-style initialization for an RCU-protected pointer in a structure field.
959 */ 970 */
960#define RCU_POINTER_INITIALIZER(p, v) \ 971#define RCU_POINTER_INITIALIZER(p, v) \
961 .p = (typeof(*v) __force __rcu *)(v) 972 .p = RCU_INITIALIZER(v)
962 973
963/* 974/*
964 * Does the specified offset indicate that the corresponding rcu_head 975 * Does the specified offset indicate that the corresponding rcu_head
@@ -1005,7 +1016,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
1005 __kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head)) 1016 __kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head))
1006 1017
1007#ifdef CONFIG_RCU_NOCB_CPU 1018#ifdef CONFIG_RCU_NOCB_CPU
1008extern bool rcu_is_nocb_cpu(int cpu); 1019bool rcu_is_nocb_cpu(int cpu);
1009#else 1020#else
1010static inline bool rcu_is_nocb_cpu(int cpu) { return false; } 1021static inline bool rcu_is_nocb_cpu(int cpu) { return false; }
1011#endif /* #else #ifdef CONFIG_RCU_NOCB_CPU */ 1022#endif /* #else #ifdef CONFIG_RCU_NOCB_CPU */
@@ -1013,8 +1024,8 @@ static inline bool rcu_is_nocb_cpu(int cpu) { return false; }
1013 1024
1014/* Only for use by adaptive-ticks code. */ 1025/* Only for use by adaptive-ticks code. */
1015#ifdef CONFIG_NO_HZ_FULL_SYSIDLE 1026#ifdef CONFIG_NO_HZ_FULL_SYSIDLE
1016extern bool rcu_sys_is_idle(void); 1027bool rcu_sys_is_idle(void);
1017extern void rcu_sysidle_force_exit(void); 1028void rcu_sysidle_force_exit(void);
1018#else /* #ifdef CONFIG_NO_HZ_FULL_SYSIDLE */ 1029#else /* #ifdef CONFIG_NO_HZ_FULL_SYSIDLE */
1019 1030
1020static inline bool rcu_sys_is_idle(void) 1031static inline bool rcu_sys_is_idle(void)
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
index 09ebcbe9fd78..6f01771b571c 100644
--- a/include/linux/rcutiny.h
+++ b/include/linux/rcutiny.h
@@ -125,7 +125,7 @@ static inline void exit_rcu(void)
125 125
126#ifdef CONFIG_DEBUG_LOCK_ALLOC 126#ifdef CONFIG_DEBUG_LOCK_ALLOC
127extern int rcu_scheduler_active __read_mostly; 127extern int rcu_scheduler_active __read_mostly;
128extern void rcu_scheduler_starting(void); 128void rcu_scheduler_starting(void);
129#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ 129#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
130static inline void rcu_scheduler_starting(void) 130static inline void rcu_scheduler_starting(void)
131{ 131{
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index 4b9c81548742..72137ee8c603 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -30,9 +30,9 @@
30#ifndef __LINUX_RCUTREE_H 30#ifndef __LINUX_RCUTREE_H
31#define __LINUX_RCUTREE_H 31#define __LINUX_RCUTREE_H
32 32
33extern void rcu_note_context_switch(int cpu); 33void rcu_note_context_switch(int cpu);
34extern int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies); 34int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies);
35extern void rcu_cpu_stall_reset(void); 35void rcu_cpu_stall_reset(void);
36 36
37/* 37/*
38 * Note a virtualization-based context switch. This is simply a 38 * Note a virtualization-based context switch. This is simply a
@@ -44,9 +44,9 @@ static inline void rcu_virt_note_context_switch(int cpu)
44 rcu_note_context_switch(cpu); 44 rcu_note_context_switch(cpu);
45} 45}
46 46
47extern void synchronize_rcu_bh(void); 47void synchronize_rcu_bh(void);
48extern void synchronize_sched_expedited(void); 48void synchronize_sched_expedited(void);
49extern void synchronize_rcu_expedited(void); 49void synchronize_rcu_expedited(void);
50 50
51void kfree_call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu)); 51void kfree_call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu));
52 52
@@ -71,25 +71,25 @@ static inline void synchronize_rcu_bh_expedited(void)
71 synchronize_sched_expedited(); 71 synchronize_sched_expedited();
72} 72}
73 73
74extern void rcu_barrier(void); 74void rcu_barrier(void);
75extern void rcu_barrier_bh(void); 75void rcu_barrier_bh(void);
76extern void rcu_barrier_sched(void); 76void rcu_barrier_sched(void);
77 77
78extern unsigned long rcutorture_testseq; 78extern unsigned long rcutorture_testseq;
79extern unsigned long rcutorture_vernum; 79extern unsigned long rcutorture_vernum;
80extern long rcu_batches_completed(void); 80long rcu_batches_completed(void);
81extern long rcu_batches_completed_bh(void); 81long rcu_batches_completed_bh(void);
82extern long rcu_batches_completed_sched(void); 82long rcu_batches_completed_sched(void);
83 83
84extern void rcu_force_quiescent_state(void); 84void rcu_force_quiescent_state(void);
85extern void rcu_bh_force_quiescent_state(void); 85void rcu_bh_force_quiescent_state(void);
86extern void rcu_sched_force_quiescent_state(void); 86void rcu_sched_force_quiescent_state(void);
87 87
88extern void exit_rcu(void); 88void exit_rcu(void);
89 89
90extern void rcu_scheduler_starting(void); 90void rcu_scheduler_starting(void);
91extern int rcu_scheduler_active __read_mostly; 91extern int rcu_scheduler_active __read_mostly;
92 92
93extern bool rcu_is_watching(void); 93bool rcu_is_watching(void);
94 94
95#endif /* __LINUX_RCUTREE_H */ 95#endif /* __LINUX_RCUTREE_H */
diff --git a/include/linux/reboot.h b/include/linux/reboot.h
index 8e00f9f6f963..9e7db9e73cc1 100644
--- a/include/linux/reboot.h
+++ b/include/linux/reboot.h
@@ -43,6 +43,7 @@ extern int unregister_reboot_notifier(struct notifier_block *);
43 * Architecture-specific implementations of sys_reboot commands. 43 * Architecture-specific implementations of sys_reboot commands.
44 */ 44 */
45 45
46extern void migrate_to_reboot_cpu(void);
46extern void machine_restart(char *cmd); 47extern void machine_restart(char *cmd);
47extern void machine_halt(void); 48extern void machine_halt(void);
48extern void machine_power_off(void); 49extern void machine_power_off(void);
diff --git a/include/linux/reciprocal_div.h b/include/linux/reciprocal_div.h
index f9c90b33285b..8c5a3fb6c6c5 100644
--- a/include/linux/reciprocal_div.h
+++ b/include/linux/reciprocal_div.h
@@ -4,29 +4,32 @@
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6/* 6/*
7 * This file describes reciprocical division. 7 * This algorithm is based on the paper "Division by Invariant
8 * Integers Using Multiplication" by Torbjörn Granlund and Peter
9 * L. Montgomery.
8 * 10 *
9 * This optimizes the (A/B) problem, when A and B are two u32 11 * The assembler implementation from Agner Fog, which this code is
10 * and B is a known value (but not known at compile time) 12 * based on, can be found here:
13 * http://www.agner.org/optimize/asmlib.zip
11 * 14 *
12 * The math principle used is : 15 * This optimization for A/B is helpful if the divisor B is mostly
13 * Let RECIPROCAL_VALUE(B) be (((1LL << 32) + (B - 1))/ B) 16 * runtime invariant. The reciprocal of B is calculated in the
14 * Then A / B = (u32)(((u64)(A) * (R)) >> 32) 17 * slow-path with reciprocal_value(). The fast-path can then just use
15 * 18 * a much faster multiplication operation with a variable dividend A
16 * This replaces a divide by a multiply (and a shift), and 19 * to calculate the division A/B.
17 * is generally less expensive in CPU cycles.
18 */ 20 */
19 21
20/* 22struct reciprocal_value {
21 * Computes the reciprocal value (R) for the value B of the divisor. 23 u32 m;
22 * Should not be called before each reciprocal_divide(), 24 u8 sh1, sh2;
23 * or else the performance is slower than a normal divide. 25};
24 */
25extern u32 reciprocal_value(u32 B);
26 26
27struct reciprocal_value reciprocal_value(u32 d);
27 28
28static inline u32 reciprocal_divide(u32 A, u32 R) 29static inline u32 reciprocal_divide(u32 a, struct reciprocal_value R)
29{ 30{
30 return (u32)(((u64)A * R) >> 32); 31 u32 t = (u32)(((u64)a * R.m) >> 32);
32 return (t + ((a - t) >> R.sh1)) >> R.sh2;
31} 33}
32#endif 34
35#endif /* _LINUX_RECIPROCAL_DIV_H */
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index e55907804d39..4149f1a9b003 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -122,9 +122,9 @@ typedef void (*regmap_unlock)(void *);
122 * volatile_table (see below) is not, the check is performed on 122 * volatile_table (see below) is not, the check is performed on
123 * such table (a register is volatile if it belongs to one of 123 * such table (a register is volatile if it belongs to one of
124 * the ranges specified by volatile_table). 124 * the ranges specified by volatile_table).
125 * @precious_reg: Optional callback returning true if the rgister 125 * @precious_reg: Optional callback returning true if the register
126 * should not be read outside of a call from the driver 126 * should not be read outside of a call from the driver
127 * (eg, a clear on read interrupt status register). If this 127 * (e.g., a clear on read interrupt status register). If this
128 * field is NULL but precious_table (see below) is not, the 128 * field is NULL but precious_table (see below) is not, the
129 * check is performed on such table (a register is precious if 129 * check is performed on such table (a register is precious if
130 * it belongs to one of the ranges specified by precious_table). 130 * it belongs to one of the ranges specified by precious_table).
@@ -136,9 +136,9 @@ typedef void (*regmap_unlock)(void *);
136 * are not overridden). 136 * are not overridden).
137 * @reg_read: Optional callback that if filled will be used to perform 137 * @reg_read: Optional callback that if filled will be used to perform
138 * all the reads from the registers. Should only be provided for 138 * all the reads from the registers. Should only be provided for
139 * devices whos read operation cannot be represented as a simple read 139 * devices whose read operation cannot be represented as a simple
140 * operation on a bus such as SPI, I2C, etc. Most of the devices do 140 * read operation on a bus such as SPI, I2C, etc. Most of the
141 * not need this. 141 * devices do not need this.
142 * @reg_write: Same as above for writing. 142 * @reg_write: Same as above for writing.
143 * @fast_io: Register IO is fast. Use a spinlock instead of a mutex 143 * @fast_io: Register IO is fast. Use a spinlock instead of a mutex
144 * to perform locking. This field is ignored if custom lock/unlock 144 * to perform locking. This field is ignored if custom lock/unlock
@@ -497,11 +497,13 @@ struct regmap_irq {
497 * 497 *
498 * @status_base: Base status register address. 498 * @status_base: Base status register address.
499 * @mask_base: Base mask register address. 499 * @mask_base: Base mask register address.
500 * @ack_base: Base ack address. If zero then the chip is clear on read. 500 * @ack_base: Base ack address. If zero then the chip is clear on read.
501 * Using zero value is possible with @use_ack bit.
501 * @wake_base: Base address for wake enables. If zero unsupported. 502 * @wake_base: Base address for wake enables. If zero unsupported.
502 * @irq_reg_stride: Stride to use for chips where registers are not contiguous. 503 * @irq_reg_stride: Stride to use for chips where registers are not contiguous.
503 * @init_ack_masked: Ack all masked interrupts once during initalization. 504 * @init_ack_masked: Ack all masked interrupts once during initalization.
504 * @mask_invert: Inverted mask register: cleared bits are masked out. 505 * @mask_invert: Inverted mask register: cleared bits are masked out.
506 * @use_ack: Use @ack register even if it is zero.
505 * @wake_invert: Inverted wake register: cleared bits are wake enabled. 507 * @wake_invert: Inverted wake register: cleared bits are wake enabled.
506 * @runtime_pm: Hold a runtime PM lock on the device when accessing it. 508 * @runtime_pm: Hold a runtime PM lock on the device when accessing it.
507 * 509 *
@@ -520,6 +522,7 @@ struct regmap_irq_chip {
520 unsigned int irq_reg_stride; 522 unsigned int irq_reg_stride;
521 bool init_ack_masked:1; 523 bool init_ack_masked:1;
522 bool mask_invert:1; 524 bool mask_invert:1;
525 bool use_ack:1;
523 bool wake_invert:1; 526 bool wake_invert:1;
524 bool runtime_pm:1; 527 bool runtime_pm:1;
525 528
diff --git a/include/linux/regulator/act8865.h b/include/linux/regulator/act8865.h
new file mode 100644
index 000000000000..49206c1b4905
--- /dev/null
+++ b/include/linux/regulator/act8865.h
@@ -0,0 +1,53 @@
1/*
2 * act8865.h -- Voltage regulation for the active-semi act8865
3 *
4 * Copyright (C) 2013 Atmel Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#ifndef __LINUX_REGULATOR_ACT8865_H
17#define __LINUX_REGULATOR_ACT8865_H
18
19#include <linux/regulator/machine.h>
20
21enum {
22 ACT8865_ID_DCDC1,
23 ACT8865_ID_DCDC2,
24 ACT8865_ID_DCDC3,
25 ACT8865_ID_LDO1,
26 ACT8865_ID_LDO2,
27 ACT8865_ID_LDO3,
28 ACT8865_ID_LDO4,
29 ACT8865_REG_NUM,
30};
31
32/**
33 * act8865_regulator_data - regulator data
34 * @id: regulator id
35 * @name: regulator name
36 * @platform_data: regulator init data
37 */
38struct act8865_regulator_data {
39 int id;
40 const char *name;
41 struct regulator_init_data *platform_data;
42};
43
44/**
45 * act8865_platform_data - platform data for act8865
46 * @num_regulators: number of regulators used
47 * @regulators: pointer to regulators used
48 */
49struct act8865_platform_data {
50 int num_regulators;
51 struct act8865_regulator_data *regulators;
52};
53#endif
diff --git a/include/linux/reset-controller.h b/include/linux/reset-controller.h
index 2f61311ae3e0..41a4695fde08 100644
--- a/include/linux/reset-controller.h
+++ b/include/linux/reset-controller.h
@@ -21,6 +21,7 @@ struct reset_control_ops {
21 21
22struct module; 22struct module;
23struct device_node; 23struct device_node;
24struct of_phandle_args;
24 25
25/** 26/**
26 * struct reset_controller_dev - reset controller entity that might 27 * struct reset_controller_dev - reset controller entity that might
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index 6dacb93a6d94..1da693d51255 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -184,13 +184,13 @@ static inline void page_dup_rmap(struct page *page)
184int page_referenced(struct page *, int is_locked, 184int page_referenced(struct page *, int is_locked,
185 struct mem_cgroup *memcg, unsigned long *vm_flags); 185 struct mem_cgroup *memcg, unsigned long *vm_flags);
186int page_referenced_one(struct page *, struct vm_area_struct *, 186int page_referenced_one(struct page *, struct vm_area_struct *,
187 unsigned long address, unsigned int *mapcount, unsigned long *vm_flags); 187 unsigned long address, void *arg);
188 188
189#define TTU_ACTION(x) ((x) & TTU_ACTION_MASK) 189#define TTU_ACTION(x) ((x) & TTU_ACTION_MASK)
190 190
191int try_to_unmap(struct page *, enum ttu_flags flags); 191int try_to_unmap(struct page *, enum ttu_flags flags);
192int try_to_unmap_one(struct page *, struct vm_area_struct *, 192int try_to_unmap_one(struct page *, struct vm_area_struct *,
193 unsigned long address, enum ttu_flags flags); 193 unsigned long address, void *arg);
194 194
195/* 195/*
196 * Called from mm/filemap_xip.c to unmap empty zero page 196 * Called from mm/filemap_xip.c to unmap empty zero page
@@ -236,10 +236,27 @@ void page_unlock_anon_vma_read(struct anon_vma *anon_vma);
236int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); 236int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma);
237 237
238/* 238/*
239 * Called by migrate.c to remove migration ptes, but might be used more later. 239 * rmap_walk_control: To control rmap traversing for specific needs
240 *
241 * arg: passed to rmap_one() and invalid_vma()
242 * rmap_one: executed on each vma where page is mapped
243 * done: for checking traversing termination condition
244 * file_nonlinear: for handling file nonlinear mapping
245 * anon_lock: for getting anon_lock by optimized way rather than default
246 * invalid_vma: for skipping uninterested vma
240 */ 247 */
241int rmap_walk(struct page *page, int (*rmap_one)(struct page *, 248struct rmap_walk_control {
242 struct vm_area_struct *, unsigned long, void *), void *arg); 249 void *arg;
250 int (*rmap_one)(struct page *page, struct vm_area_struct *vma,
251 unsigned long addr, void *arg);
252 int (*done)(struct page *page);
253 int (*file_nonlinear)(struct page *, struct address_space *,
254 struct vm_area_struct *vma);
255 struct anon_vma *(*anon_lock)(struct page *page);
256 bool (*invalid_vma)(struct vm_area_struct *vma, void *arg);
257};
258
259int rmap_walk(struct page *page, struct rmap_walk_control *rwc);
243 260
244#else /* !CONFIG_MMU */ 261#else /* !CONFIG_MMU */
245 262
diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h
index de17134244f3..3aed8d737e1a 100644
--- a/include/linux/rtmutex.h
+++ b/include/linux/rtmutex.h
@@ -13,7 +13,7 @@
13#define __LINUX_RT_MUTEX_H 13#define __LINUX_RT_MUTEX_H
14 14
15#include <linux/linkage.h> 15#include <linux/linkage.h>
16#include <linux/plist.h> 16#include <linux/rbtree.h>
17#include <linux/spinlock_types.h> 17#include <linux/spinlock_types.h>
18 18
19extern int max_lock_depth; /* for sysctl */ 19extern int max_lock_depth; /* for sysctl */
@@ -22,12 +22,14 @@ extern int max_lock_depth; /* for sysctl */
22 * The rt_mutex structure 22 * The rt_mutex structure
23 * 23 *
24 * @wait_lock: spinlock to protect the structure 24 * @wait_lock: spinlock to protect the structure
25 * @wait_list: pilist head to enqueue waiters in priority order 25 * @waiters: rbtree root to enqueue waiters in priority order
26 * @waiters_leftmost: top waiter
26 * @owner: the mutex owner 27 * @owner: the mutex owner
27 */ 28 */
28struct rt_mutex { 29struct rt_mutex {
29 raw_spinlock_t wait_lock; 30 raw_spinlock_t wait_lock;
30 struct plist_head wait_list; 31 struct rb_root waiters;
32 struct rb_node *waiters_leftmost;
31 struct task_struct *owner; 33 struct task_struct *owner;
32#ifdef CONFIG_DEBUG_RT_MUTEXES 34#ifdef CONFIG_DEBUG_RT_MUTEXES
33 int save_state; 35 int save_state;
@@ -66,7 +68,7 @@ struct hrtimer_sleeper;
66 68
67#define __RT_MUTEX_INITIALIZER(mutexname) \ 69#define __RT_MUTEX_INITIALIZER(mutexname) \
68 { .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \ 70 { .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \
69 , .wait_list = PLIST_HEAD_INIT(mutexname.wait_list) \ 71 , .waiters = RB_ROOT \
70 , .owner = NULL \ 72 , .owner = NULL \
71 __DEBUG_RT_MUTEX_INITIALIZER(mutexname)} 73 __DEBUG_RT_MUTEX_INITIALIZER(mutexname)}
72 74
@@ -98,12 +100,4 @@ extern int rt_mutex_trylock(struct rt_mutex *lock);
98 100
99extern void rt_mutex_unlock(struct rt_mutex *lock); 101extern void rt_mutex_unlock(struct rt_mutex *lock);
100 102
101#ifdef CONFIG_RT_MUTEXES
102# define INIT_RT_MUTEXES(tsk) \
103 .pi_waiters = PLIST_HEAD_INIT(tsk.pi_waiters), \
104 INIT_RT_MUTEX_DEBUG(tsk)
105#else
106# define INIT_RT_MUTEXES(tsk)
107#endif
108
109#endif 103#endif
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 939428ad25ac..8e3e66ac0a52 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -24,6 +24,11 @@ extern int rtnl_trylock(void);
24extern int rtnl_is_locked(void); 24extern int rtnl_is_locked(void);
25#ifdef CONFIG_PROVE_LOCKING 25#ifdef CONFIG_PROVE_LOCKING
26extern int lockdep_rtnl_is_held(void); 26extern int lockdep_rtnl_is_held(void);
27#else
28static inline int lockdep_rtnl_is_held(void)
29{
30 return 1;
31}
27#endif /* #ifdef CONFIG_PROVE_LOCKING */ 32#endif /* #ifdef CONFIG_PROVE_LOCKING */
28 33
29/** 34/**
diff --git a/include/linux/rwlock_api_smp.h b/include/linux/rwlock_api_smp.h
index 9c9f0495d37c..5b9b84b20407 100644
--- a/include/linux/rwlock_api_smp.h
+++ b/include/linux/rwlock_api_smp.h
@@ -172,8 +172,7 @@ static inline void __raw_read_lock_irq(rwlock_t *lock)
172 172
173static inline void __raw_read_lock_bh(rwlock_t *lock) 173static inline void __raw_read_lock_bh(rwlock_t *lock)
174{ 174{
175 local_bh_disable(); 175 __local_bh_disable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET);
176 preempt_disable();
177 rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); 176 rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_);
178 LOCK_CONTENDED(lock, do_raw_read_trylock, do_raw_read_lock); 177 LOCK_CONTENDED(lock, do_raw_read_trylock, do_raw_read_lock);
179} 178}
@@ -200,8 +199,7 @@ static inline void __raw_write_lock_irq(rwlock_t *lock)
200 199
201static inline void __raw_write_lock_bh(rwlock_t *lock) 200static inline void __raw_write_lock_bh(rwlock_t *lock)
202{ 201{
203 local_bh_disable(); 202 __local_bh_disable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET);
204 preempt_disable();
205 rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); 203 rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_);
206 LOCK_CONTENDED(lock, do_raw_write_trylock, do_raw_write_lock); 204 LOCK_CONTENDED(lock, do_raw_write_trylock, do_raw_write_lock);
207} 205}
@@ -250,8 +248,7 @@ static inline void __raw_read_unlock_bh(rwlock_t *lock)
250{ 248{
251 rwlock_release(&lock->dep_map, 1, _RET_IP_); 249 rwlock_release(&lock->dep_map, 1, _RET_IP_);
252 do_raw_read_unlock(lock); 250 do_raw_read_unlock(lock);
253 preempt_enable_no_resched(); 251 __local_bh_enable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET);
254 local_bh_enable_ip((unsigned long)__builtin_return_address(0));
255} 252}
256 253
257static inline void __raw_write_unlock_irqrestore(rwlock_t *lock, 254static inline void __raw_write_unlock_irqrestore(rwlock_t *lock,
@@ -275,8 +272,7 @@ static inline void __raw_write_unlock_bh(rwlock_t *lock)
275{ 272{
276 rwlock_release(&lock->dep_map, 1, _RET_IP_); 273 rwlock_release(&lock->dep_map, 1, _RET_IP_);
277 do_raw_write_unlock(lock); 274 do_raw_write_unlock(lock);
278 preempt_enable_no_resched(); 275 __local_bh_enable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET);
279 local_bh_enable_ip((unsigned long)__builtin_return_address(0));
280} 276}
281 277
282#endif /* __LINUX_RWLOCK_API_SMP_H */ 278#endif /* __LINUX_RWLOCK_API_SMP_H */
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h
index 0616ffe45702..03f3b05e8ec1 100644
--- a/include/linux/rwsem.h
+++ b/include/linux/rwsem.h
@@ -75,6 +75,17 @@ do { \
75} while (0) 75} while (0)
76 76
77/* 77/*
78 * This is the same regardless of which rwsem implementation that is being used.
79 * It is just a heuristic meant to be called by somebody alreadying holding the
80 * rwsem to see if somebody from an incompatible type is wanting access to the
81 * lock.
82 */
83static inline int rwsem_is_contended(struct rw_semaphore *sem)
84{
85 return !list_empty(&sem->wait_list);
86}
87
88/*
78 * lock for reading 89 * lock for reading
79 */ 90 */
80extern void down_read(struct rw_semaphore *sem); 91extern void down_read(struct rw_semaphore *sem);
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index adae88f5b0ab..a964f7285600 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -345,6 +345,7 @@ struct sg_mapping_iter {
345 345
346void sg_miter_start(struct sg_mapping_iter *miter, struct scatterlist *sgl, 346void sg_miter_start(struct sg_mapping_iter *miter, struct scatterlist *sgl,
347 unsigned int nents, unsigned int flags); 347 unsigned int nents, unsigned int flags);
348bool sg_miter_skip(struct sg_mapping_iter *miter, off_t offset);
348bool sg_miter_next(struct sg_mapping_iter *miter); 349bool sg_miter_next(struct sg_mapping_iter *miter);
349void sg_miter_stop(struct sg_mapping_iter *miter); 350void sg_miter_stop(struct sg_mapping_iter *miter);
350 351
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 768b037dfacb..a781dec1cd0b 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -16,6 +16,7 @@ struct sched_param {
16#include <linux/types.h> 16#include <linux/types.h>
17#include <linux/timex.h> 17#include <linux/timex.h>
18#include <linux/jiffies.h> 18#include <linux/jiffies.h>
19#include <linux/plist.h>
19#include <linux/rbtree.h> 20#include <linux/rbtree.h>
20#include <linux/thread_info.h> 21#include <linux/thread_info.h>
21#include <linux/cpumask.h> 22#include <linux/cpumask.h>
@@ -56,6 +57,70 @@ struct sched_param {
56 57
57#include <asm/processor.h> 58#include <asm/processor.h>
58 59
60#define SCHED_ATTR_SIZE_VER0 48 /* sizeof first published struct */
61
62/*
63 * Extended scheduling parameters data structure.
64 *
65 * This is needed because the original struct sched_param can not be
66 * altered without introducing ABI issues with legacy applications
67 * (e.g., in sched_getparam()).
68 *
69 * However, the possibility of specifying more than just a priority for
70 * the tasks may be useful for a wide variety of application fields, e.g.,
71 * multimedia, streaming, automation and control, and many others.
72 *
73 * This variant (sched_attr) is meant at describing a so-called
74 * sporadic time-constrained task. In such model a task is specified by:
75 * - the activation period or minimum instance inter-arrival time;
76 * - the maximum (or average, depending on the actual scheduling
77 * discipline) computation time of all instances, a.k.a. runtime;
78 * - the deadline (relative to the actual activation time) of each
79 * instance.
80 * Very briefly, a periodic (sporadic) task asks for the execution of
81 * some specific computation --which is typically called an instance--
82 * (at most) every period. Moreover, each instance typically lasts no more
83 * than the runtime and must be completed by time instant t equal to
84 * the instance activation time + the deadline.
85 *
86 * This is reflected by the actual fields of the sched_attr structure:
87 *
88 * @size size of the structure, for fwd/bwd compat.
89 *
90 * @sched_policy task's scheduling policy
91 * @sched_flags for customizing the scheduler behaviour
92 * @sched_nice task's nice value (SCHED_NORMAL/BATCH)
93 * @sched_priority task's static priority (SCHED_FIFO/RR)
94 * @sched_deadline representative of the task's deadline
95 * @sched_runtime representative of the task's runtime
96 * @sched_period representative of the task's period
97 *
98 * Given this task model, there are a multiplicity of scheduling algorithms
99 * and policies, that can be used to ensure all the tasks will make their
100 * timing constraints.
101 *
102 * As of now, the SCHED_DEADLINE policy (sched_dl scheduling class) is the
103 * only user of this new interface. More information about the algorithm
104 * available in the scheduling class file or in Documentation/.
105 */
106struct sched_attr {
107 u32 size;
108
109 u32 sched_policy;
110 u64 sched_flags;
111
112 /* SCHED_NORMAL, SCHED_BATCH */
113 s32 sched_nice;
114
115 /* SCHED_FIFO, SCHED_RR */
116 u32 sched_priority;
117
118 /* SCHED_DEADLINE */
119 u64 sched_runtime;
120 u64 sched_deadline;
121 u64 sched_period;
122};
123
59struct exec_domain; 124struct exec_domain;
60struct futex_pi_state; 125struct futex_pi_state;
61struct robust_list_head; 126struct robust_list_head;
@@ -63,6 +128,7 @@ struct bio_list;
63struct fs_struct; 128struct fs_struct;
64struct perf_event_context; 129struct perf_event_context;
65struct blk_plug; 130struct blk_plug;
131struct filename;
66 132
67/* 133/*
68 * List of flags we want to share for kernel threads, 134 * List of flags we want to share for kernel threads,
@@ -164,11 +230,10 @@ extern char ___assert_task_state[1 - 2*!!(
164/* get_task_state() */ 230/* get_task_state() */
165#define TASK_REPORT (TASK_RUNNING | TASK_INTERRUPTIBLE | \ 231#define TASK_REPORT (TASK_RUNNING | TASK_INTERRUPTIBLE | \
166 TASK_UNINTERRUPTIBLE | __TASK_STOPPED | \ 232 TASK_UNINTERRUPTIBLE | __TASK_STOPPED | \
167 __TASK_TRACED) 233 __TASK_TRACED | EXIT_ZOMBIE | EXIT_DEAD)
168 234
169#define task_is_traced(task) ((task->state & __TASK_TRACED) != 0) 235#define task_is_traced(task) ((task->state & __TASK_TRACED) != 0)
170#define task_is_stopped(task) ((task->state & __TASK_STOPPED) != 0) 236#define task_is_stopped(task) ((task->state & __TASK_STOPPED) != 0)
171#define task_is_dead(task) ((task)->exit_state != 0)
172#define task_is_stopped_or_traced(task) \ 237#define task_is_stopped_or_traced(task) \
173 ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0) 238 ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0)
174#define task_contributes_to_load(task) \ 239#define task_contributes_to_load(task) \
@@ -327,22 +392,33 @@ arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
327static inline void arch_pick_mmap_layout(struct mm_struct *mm) {} 392static inline void arch_pick_mmap_layout(struct mm_struct *mm) {}
328#endif 393#endif
329 394
330
331extern void set_dumpable(struct mm_struct *mm, int value);
332extern int get_dumpable(struct mm_struct *mm);
333
334#define SUID_DUMP_DISABLE 0 /* No setuid dumping */ 395#define SUID_DUMP_DISABLE 0 /* No setuid dumping */
335#define SUID_DUMP_USER 1 /* Dump as user of process */ 396#define SUID_DUMP_USER 1 /* Dump as user of process */
336#define SUID_DUMP_ROOT 2 /* Dump as root */ 397#define SUID_DUMP_ROOT 2 /* Dump as root */
337 398
338/* mm flags */ 399/* mm flags */
339/* dumpable bits */
340#define MMF_DUMPABLE 0 /* core dump is permitted */
341#define MMF_DUMP_SECURELY 1 /* core file is readable only by root */
342 400
401/* for SUID_DUMP_* above */
343#define MMF_DUMPABLE_BITS 2 402#define MMF_DUMPABLE_BITS 2
344#define MMF_DUMPABLE_MASK ((1 << MMF_DUMPABLE_BITS) - 1) 403#define MMF_DUMPABLE_MASK ((1 << MMF_DUMPABLE_BITS) - 1)
345 404
405extern void set_dumpable(struct mm_struct *mm, int value);
406/*
407 * This returns the actual value of the suid_dumpable flag. For things
408 * that are using this for checking for privilege transitions, it must
409 * test against SUID_DUMP_USER rather than treating it as a boolean
410 * value.
411 */
412static inline int __get_dumpable(unsigned long mm_flags)
413{
414 return mm_flags & MMF_DUMPABLE_MASK;
415}
416
417static inline int get_dumpable(struct mm_struct *mm)
418{
419 return __get_dumpable(mm->flags);
420}
421
346/* coredump filter bits */ 422/* coredump filter bits */
347#define MMF_DUMP_ANON_PRIVATE 2 423#define MMF_DUMP_ANON_PRIVATE 2
348#define MMF_DUMP_ANON_SHARED 3 424#define MMF_DUMP_ANON_SHARED 3
@@ -440,8 +516,6 @@ struct task_cputime {
440 .sum_exec_runtime = 0, \ 516 .sum_exec_runtime = 0, \
441 } 517 }
442 518
443#define PREEMPT_ENABLED (PREEMPT_NEED_RESCHED)
444
445#ifdef CONFIG_PREEMPT_COUNT 519#ifdef CONFIG_PREEMPT_COUNT
446#define PREEMPT_DISABLED (1 + PREEMPT_ENABLED) 520#define PREEMPT_DISABLED (1 + PREEMPT_ENABLED)
447#else 521#else
@@ -487,6 +561,7 @@ struct signal_struct {
487 atomic_t sigcnt; 561 atomic_t sigcnt;
488 atomic_t live; 562 atomic_t live;
489 int nr_threads; 563 int nr_threads;
564 struct list_head thread_head;
490 565
491 wait_queue_head_t wait_chldexit; /* for wait4() */ 566 wait_queue_head_t wait_chldexit; /* for wait4() */
492 567
@@ -932,7 +1007,8 @@ struct pipe_inode_info;
932struct uts_namespace; 1007struct uts_namespace;
933 1008
934struct load_weight { 1009struct load_weight {
935 unsigned long weight, inv_weight; 1010 unsigned long weight;
1011 u32 inv_weight;
936}; 1012};
937 1013
938struct sched_avg { 1014struct sched_avg {
@@ -1030,6 +1106,51 @@ struct sched_rt_entity {
1030#endif 1106#endif
1031}; 1107};
1032 1108
1109struct sched_dl_entity {
1110 struct rb_node rb_node;
1111
1112 /*
1113 * Original scheduling parameters. Copied here from sched_attr
1114 * during sched_setscheduler2(), they will remain the same until
1115 * the next sched_setscheduler2().
1116 */
1117 u64 dl_runtime; /* maximum runtime for each instance */
1118 u64 dl_deadline; /* relative deadline of each instance */
1119 u64 dl_period; /* separation of two instances (period) */
1120 u64 dl_bw; /* dl_runtime / dl_deadline */
1121
1122 /*
1123 * Actual scheduling parameters. Initialized with the values above,
1124 * they are continously updated during task execution. Note that
1125 * the remaining runtime could be < 0 in case we are in overrun.
1126 */
1127 s64 runtime; /* remaining runtime for this instance */
1128 u64 deadline; /* absolute deadline for this instance */
1129 unsigned int flags; /* specifying the scheduler behaviour */
1130
1131 /*
1132 * Some bool flags:
1133 *
1134 * @dl_throttled tells if we exhausted the runtime. If so, the
1135 * task has to wait for a replenishment to be performed at the
1136 * next firing of dl_timer.
1137 *
1138 * @dl_new tells if a new instance arrived. If so we must
1139 * start executing it with full runtime and reset its absolute
1140 * deadline;
1141 *
1142 * @dl_boosted tells if we are boosted due to DI. If so we are
1143 * outside bandwidth enforcement mechanism (but only until we
1144 * exit the critical section).
1145 */
1146 int dl_throttled, dl_new, dl_boosted;
1147
1148 /*
1149 * Bandwidth enforcement timer. Each -deadline task has its
1150 * own bandwidth to be enforced, thus we need one timer per task.
1151 */
1152 struct hrtimer dl_timer;
1153};
1033 1154
1034struct rcu_node; 1155struct rcu_node;
1035 1156
@@ -1066,6 +1187,7 @@ struct task_struct {
1066#ifdef CONFIG_CGROUP_SCHED 1187#ifdef CONFIG_CGROUP_SCHED
1067 struct task_group *sched_task_group; 1188 struct task_group *sched_task_group;
1068#endif 1189#endif
1190 struct sched_dl_entity dl;
1069 1191
1070#ifdef CONFIG_PREEMPT_NOTIFIERS 1192#ifdef CONFIG_PREEMPT_NOTIFIERS
1071 /* list of struct preempt_notifier: */ 1193 /* list of struct preempt_notifier: */
@@ -1099,6 +1221,7 @@ struct task_struct {
1099 struct list_head tasks; 1221 struct list_head tasks;
1100#ifdef CONFIG_SMP 1222#ifdef CONFIG_SMP
1101 struct plist_node pushable_tasks; 1223 struct plist_node pushable_tasks;
1224 struct rb_node pushable_dl_tasks;
1102#endif 1225#endif
1103 1226
1104 struct mm_struct *mm, *active_mm; 1227 struct mm_struct *mm, *active_mm;
@@ -1117,7 +1240,6 @@ struct task_struct {
1117 /* Used for emulating ABI behavior of previous Linux versions */ 1240 /* Used for emulating ABI behavior of previous Linux versions */
1118 unsigned int personality; 1241 unsigned int personality;
1119 1242
1120 unsigned did_exec:1;
1121 unsigned in_execve:1; /* Tell the LSMs that the process is doing an 1243 unsigned in_execve:1; /* Tell the LSMs that the process is doing an
1122 * execve */ 1244 * execve */
1123 unsigned in_iowait:1; 1245 unsigned in_iowait:1;
@@ -1161,6 +1283,7 @@ struct task_struct {
1161 /* PID/PID hash table linkage. */ 1283 /* PID/PID hash table linkage. */
1162 struct pid_link pids[PIDTYPE_MAX]; 1284 struct pid_link pids[PIDTYPE_MAX];
1163 struct list_head thread_group; 1285 struct list_head thread_group;
1286 struct list_head thread_node;
1164 1287
1165 struct completion *vfork_done; /* for vfork() */ 1288 struct completion *vfork_done; /* for vfork() */
1166 int __user *set_child_tid; /* CLONE_CHILD_SETTID */ 1289 int __user *set_child_tid; /* CLONE_CHILD_SETTID */
@@ -1250,9 +1373,12 @@ struct task_struct {
1250 1373
1251#ifdef CONFIG_RT_MUTEXES 1374#ifdef CONFIG_RT_MUTEXES
1252 /* PI waiters blocked on a rt_mutex held by this task */ 1375 /* PI waiters blocked on a rt_mutex held by this task */
1253 struct plist_head pi_waiters; 1376 struct rb_root pi_waiters;
1377 struct rb_node *pi_waiters_leftmost;
1254 /* Deadlock detection and priority inheritance handling */ 1378 /* Deadlock detection and priority inheritance handling */
1255 struct rt_mutex_waiter *pi_blocked_on; 1379 struct rt_mutex_waiter *pi_blocked_on;
1380 /* Top pi_waiters task */
1381 struct task_struct *pi_top_task;
1256#endif 1382#endif
1257 1383
1258#ifdef CONFIG_DEBUG_MUTEXES 1384#ifdef CONFIG_DEBUG_MUTEXES
@@ -1881,7 +2007,9 @@ static inline void sched_clock_idle_wakeup_event(u64 delta_ns)
1881 * but then during bootup it turns out that sched_clock() 2007 * but then during bootup it turns out that sched_clock()
1882 * is reliable after all: 2008 * is reliable after all:
1883 */ 2009 */
1884extern int sched_clock_stable; 2010extern int sched_clock_stable(void);
2011extern void set_sched_clock_stable(void);
2012extern void clear_sched_clock_stable(void);
1885 2013
1886extern void sched_clock_tick(void); 2014extern void sched_clock_tick(void);
1887extern void sched_clock_idle_sleep_event(void); 2015extern void sched_clock_idle_sleep_event(void);
@@ -1960,6 +2088,8 @@ extern int sched_setscheduler(struct task_struct *, int,
1960 const struct sched_param *); 2088 const struct sched_param *);
1961extern int sched_setscheduler_nocheck(struct task_struct *, int, 2089extern int sched_setscheduler_nocheck(struct task_struct *, int,
1962 const struct sched_param *); 2090 const struct sched_param *);
2091extern int sched_setattr(struct task_struct *,
2092 const struct sched_attr *);
1963extern struct task_struct *idle_task(int cpu); 2093extern struct task_struct *idle_task(int cpu);
1964/** 2094/**
1965 * is_idle_task - is the specified task an idle task? 2095 * is_idle_task - is the specified task an idle task?
@@ -2039,7 +2169,7 @@ extern void wake_up_new_task(struct task_struct *tsk);
2039#else 2169#else
2040 static inline void kick_process(struct task_struct *tsk) { } 2170 static inline void kick_process(struct task_struct *tsk) { }
2041#endif 2171#endif
2042extern void sched_fork(unsigned long clone_flags, struct task_struct *p); 2172extern int sched_fork(unsigned long clone_flags, struct task_struct *p);
2043extern void sched_dead(struct task_struct *p); 2173extern void sched_dead(struct task_struct *p);
2044 2174
2045extern void proc_caches_init(void); 2175extern void proc_caches_init(void);
@@ -2165,8 +2295,6 @@ extern struct mm_struct *get_task_mm(struct task_struct *task);
2165extern struct mm_struct *mm_access(struct task_struct *task, unsigned int mode); 2295extern struct mm_struct *mm_access(struct task_struct *task, unsigned int mode);
2166/* Remove the current tasks stale references to the old mm_struct */ 2296/* Remove the current tasks stale references to the old mm_struct */
2167extern void mm_release(struct task_struct *, struct mm_struct *); 2297extern void mm_release(struct task_struct *, struct mm_struct *);
2168/* Allocate a new mm structure and copy contents from tsk->mm */
2169extern struct mm_struct *dup_mm(struct task_struct *tsk);
2170 2298
2171extern int copy_thread(unsigned long, unsigned long, unsigned long, 2299extern int copy_thread(unsigned long, unsigned long, unsigned long,
2172 struct task_struct *); 2300 struct task_struct *);
@@ -2184,7 +2312,7 @@ extern void do_group_exit(int);
2184extern int allow_signal(int); 2312extern int allow_signal(int);
2185extern int disallow_signal(int); 2313extern int disallow_signal(int);
2186 2314
2187extern int do_execve(const char *, 2315extern int do_execve(struct filename *,
2188 const char __user * const __user *, 2316 const char __user * const __user *,
2189 const char __user * const __user *); 2317 const char __user * const __user *);
2190extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *); 2318extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *);
@@ -2224,6 +2352,16 @@ extern bool current_is_single_threaded(void);
2224#define while_each_thread(g, t) \ 2352#define while_each_thread(g, t) \
2225 while ((t = next_thread(t)) != g) 2353 while ((t = next_thread(t)) != g)
2226 2354
2355#define __for_each_thread(signal, t) \
2356 list_for_each_entry_rcu(t, &(signal)->thread_head, thread_node)
2357
2358#define for_each_thread(p, t) \
2359 __for_each_thread((p)->signal, t)
2360
2361/* Careful: this is a double loop, 'break' won't work as expected. */
2362#define for_each_process_thread(p, t) \
2363 for_each_process(p) for_each_thread(p, t)
2364
2227static inline int get_nr_threads(struct task_struct *tsk) 2365static inline int get_nr_threads(struct task_struct *tsk)
2228{ 2366{
2229 return tsk->signal->nr_threads; 2367 return tsk->signal->nr_threads;
@@ -2628,6 +2766,21 @@ static inline bool __must_check current_clr_polling_and_test(void)
2628} 2766}
2629#endif 2767#endif
2630 2768
2769static inline void current_clr_polling(void)
2770{
2771 __current_clr_polling();
2772
2773 /*
2774 * Ensure we check TIF_NEED_RESCHED after we clear the polling bit.
2775 * Once the bit is cleared, we'll get IPIs with every new
2776 * TIF_NEED_RESCHED and the IPI handler, scheduler_ipi(), will also
2777 * fold.
2778 */
2779 smp_mb(); /* paired with resched_task() */
2780
2781 preempt_fold_need_resched();
2782}
2783
2631static __always_inline bool need_resched(void) 2784static __always_inline bool need_resched(void)
2632{ 2785{
2633 return unlikely(tif_need_resched()); 2786 return unlikely(tif_need_resched());
diff --git a/include/linux/sched/deadline.h b/include/linux/sched/deadline.h
new file mode 100644
index 000000000000..9d303b8847df
--- /dev/null
+++ b/include/linux/sched/deadline.h
@@ -0,0 +1,24 @@
1#ifndef _SCHED_DEADLINE_H
2#define _SCHED_DEADLINE_H
3
4/*
5 * SCHED_DEADLINE tasks has negative priorities, reflecting
6 * the fact that any of them has higher prio than RT and
7 * NORMAL/BATCH tasks.
8 */
9
10#define MAX_DL_PRIO 0
11
12static inline int dl_prio(int prio)
13{
14 if (unlikely(prio < MAX_DL_PRIO))
15 return 1;
16 return 0;
17}
18
19static inline int dl_task(struct task_struct *p)
20{
21 return dl_prio(p->prio);
22}
23
24#endif /* _SCHED_DEADLINE_H */
diff --git a/include/linux/sched/rt.h b/include/linux/sched/rt.h
index 440434df3627..34e4ebea8fce 100644
--- a/include/linux/sched/rt.h
+++ b/include/linux/sched/rt.h
@@ -35,6 +35,7 @@ static inline int rt_task(struct task_struct *p)
35#ifdef CONFIG_RT_MUTEXES 35#ifdef CONFIG_RT_MUTEXES
36extern int rt_mutex_getprio(struct task_struct *p); 36extern int rt_mutex_getprio(struct task_struct *p);
37extern void rt_mutex_setprio(struct task_struct *p, int prio); 37extern void rt_mutex_setprio(struct task_struct *p, int prio);
38extern struct task_struct *rt_mutex_get_top_task(struct task_struct *task);
38extern void rt_mutex_adjust_pi(struct task_struct *p); 39extern void rt_mutex_adjust_pi(struct task_struct *p);
39static inline bool tsk_is_pi_blocked(struct task_struct *tsk) 40static inline bool tsk_is_pi_blocked(struct task_struct *tsk)
40{ 41{
@@ -45,6 +46,10 @@ static inline int rt_mutex_getprio(struct task_struct *p)
45{ 46{
46 return p->normal_prio; 47 return p->normal_prio;
47} 48}
49static inline struct task_struct *rt_mutex_get_top_task(struct task_struct *task)
50{
51 return NULL;
52}
48# define rt_mutex_adjust_pi(p) do { } while (0) 53# define rt_mutex_adjust_pi(p) do { } while (0)
49static inline bool tsk_is_pi_blocked(struct task_struct *tsk) 54static inline bool tsk_is_pi_blocked(struct task_struct *tsk)
50{ 55{
diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h
index 41467f8ff8ec..8045a554cafb 100644
--- a/include/linux/sched/sysctl.h
+++ b/include/linux/sched/sysctl.h
@@ -5,7 +5,7 @@
5extern int sysctl_hung_task_check_count; 5extern int sysctl_hung_task_check_count;
6extern unsigned int sysctl_hung_task_panic; 6extern unsigned int sysctl_hung_task_panic;
7extern unsigned long sysctl_hung_task_timeout_secs; 7extern unsigned long sysctl_hung_task_timeout_secs;
8extern unsigned long sysctl_hung_task_warnings; 8extern int sysctl_hung_task_warnings;
9extern int proc_dohung_task_timeout_secs(struct ctl_table *table, int write, 9extern int proc_dohung_task_timeout_secs(struct ctl_table *table, int write,
10 void __user *buffer, 10 void __user *buffer,
11 size_t *lenp, loff_t *ppos); 11 size_t *lenp, loff_t *ppos);
@@ -48,7 +48,6 @@ extern unsigned int sysctl_numa_balancing_scan_delay;
48extern unsigned int sysctl_numa_balancing_scan_period_min; 48extern unsigned int sysctl_numa_balancing_scan_period_min;
49extern unsigned int sysctl_numa_balancing_scan_period_max; 49extern unsigned int sysctl_numa_balancing_scan_period_max;
50extern unsigned int sysctl_numa_balancing_scan_size; 50extern unsigned int sysctl_numa_balancing_scan_size;
51extern unsigned int sysctl_numa_balancing_settle_count;
52 51
53#ifdef CONFIG_SCHED_DEBUG 52#ifdef CONFIG_SCHED_DEBUG
54extern unsigned int sysctl_sched_migration_cost; 53extern unsigned int sysctl_sched_migration_cost;
@@ -100,4 +99,8 @@ extern int sched_rt_handler(struct ctl_table *table, int write,
100 void __user *buffer, size_t *lenp, 99 void __user *buffer, size_t *lenp,
101 loff_t *ppos); 100 loff_t *ppos);
102 101
102extern int sysctl_numa_balancing(struct ctl_table *table, int write,
103 void __user *buffer, size_t *lenp,
104 loff_t *ppos);
105
103#endif /* _SCHED_SYSCTL_H */ 106#endif /* _SCHED_SYSCTL_H */
diff --git a/include/linux/sctp.h b/include/linux/sctp.h
index 3bfe8d6ee248..a9414fd49dc6 100644
--- a/include/linux/sctp.h
+++ b/include/linux/sctp.h
@@ -23,13 +23,12 @@
23 * See the GNU General Public License for more details. 23 * See the GNU General Public License for more details.
24 * 24 *
25 * You should have received a copy of the GNU General Public License 25 * You should have received a copy of the GNU General Public License
26 * along with GNU CC; see the file COPYING. If not, write to 26 * along with GNU CC; see the file COPYING. If not, see
27 * the Free Software Foundation, 59 Temple Place - Suite 330, 27 * <http://www.gnu.org/licenses/>.
28 * Boston, MA 02111-1307, USA.
29 * 28 *
30 * Please send any bug reports or fixes you make to the 29 * Please send any bug reports or fixes you make to the
31 * email address(es): 30 * email address(es):
32 * lksctp developers <lksctp-developerst@lists.sourceforge.net> 31 * lksctp developers <linux-sctp@vger.kernel.org>
33 * 32 *
34 * Or submit a bug report through the following website: 33 * Or submit a bug report through the following website:
35 * http://www.sf.net/projects/lksctp 34 * http://www.sf.net/projects/lksctp
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h
index cf87a24c0f92..535f158977b9 100644
--- a/include/linux/seqlock.h
+++ b/include/linux/seqlock.h
@@ -117,15 +117,15 @@ repeat:
117} 117}
118 118
119/** 119/**
120 * read_seqcount_begin_no_lockdep - start seq-read critical section w/o lockdep 120 * raw_read_seqcount_begin - start seq-read critical section w/o lockdep
121 * @s: pointer to seqcount_t 121 * @s: pointer to seqcount_t
122 * Returns: count to be passed to read_seqcount_retry 122 * Returns: count to be passed to read_seqcount_retry
123 * 123 *
124 * read_seqcount_begin_no_lockdep opens a read critical section of the given 124 * raw_read_seqcount_begin opens a read critical section of the given
125 * seqcount, but without any lockdep checking. Validity of the critical 125 * seqcount, but without any lockdep checking. Validity of the critical
126 * section is tested by checking read_seqcount_retry function. 126 * section is tested by checking read_seqcount_retry function.
127 */ 127 */
128static inline unsigned read_seqcount_begin_no_lockdep(const seqcount_t *s) 128static inline unsigned raw_read_seqcount_begin(const seqcount_t *s)
129{ 129{
130 unsigned ret = __read_seqcount_begin(s); 130 unsigned ret = __read_seqcount_begin(s);
131 smp_rmb(); 131 smp_rmb();
@@ -144,7 +144,7 @@ static inline unsigned read_seqcount_begin_no_lockdep(const seqcount_t *s)
144static inline unsigned read_seqcount_begin(const seqcount_t *s) 144static inline unsigned read_seqcount_begin(const seqcount_t *s)
145{ 145{
146 seqcount_lockdep_reader_access(s); 146 seqcount_lockdep_reader_access(s);
147 return read_seqcount_begin_no_lockdep(s); 147 return raw_read_seqcount_begin(s);
148} 148}
149 149
150/** 150/**
@@ -206,14 +206,26 @@ static inline int read_seqcount_retry(const seqcount_t *s, unsigned start)
206} 206}
207 207
208 208
209
210static inline void raw_write_seqcount_begin(seqcount_t *s)
211{
212 s->sequence++;
213 smp_wmb();
214}
215
216static inline void raw_write_seqcount_end(seqcount_t *s)
217{
218 smp_wmb();
219 s->sequence++;
220}
221
209/* 222/*
210 * Sequence counter only version assumes that callers are using their 223 * Sequence counter only version assumes that callers are using their
211 * own mutexing. 224 * own mutexing.
212 */ 225 */
213static inline void write_seqcount_begin_nested(seqcount_t *s, int subclass) 226static inline void write_seqcount_begin_nested(seqcount_t *s, int subclass)
214{ 227{
215 s->sequence++; 228 raw_write_seqcount_begin(s);
216 smp_wmb();
217 seqcount_acquire(&s->dep_map, subclass, 0, _RET_IP_); 229 seqcount_acquire(&s->dep_map, subclass, 0, _RET_IP_);
218} 230}
219 231
@@ -225,8 +237,7 @@ static inline void write_seqcount_begin(seqcount_t *s)
225static inline void write_seqcount_end(seqcount_t *s) 237static inline void write_seqcount_end(seqcount_t *s)
226{ 238{
227 seqcount_release(&s->dep_map, 1, _RET_IP_); 239 seqcount_release(&s->dep_map, 1, _RET_IP_);
228 smp_wmb(); 240 raw_write_seqcount_end(s);
229 s->sequence++;
230} 241}
231 242
232/** 243/**
diff --git a/include/linux/serial_bcm63xx.h b/include/linux/serial_bcm63xx.h
new file mode 100644
index 000000000000..570e964dc899
--- /dev/null
+++ b/include/linux/serial_bcm63xx.h
@@ -0,0 +1,119 @@
1#ifndef _LINUX_SERIAL_BCM63XX_H
2#define _LINUX_SERIAL_BCM63XX_H
3
4/* UART Control Register */
5#define UART_CTL_REG 0x0
6#define UART_CTL_RXTMOUTCNT_SHIFT 0
7#define UART_CTL_RXTMOUTCNT_MASK (0x1f << UART_CTL_RXTMOUTCNT_SHIFT)
8#define UART_CTL_RSTTXDN_SHIFT 5
9#define UART_CTL_RSTTXDN_MASK (1 << UART_CTL_RSTTXDN_SHIFT)
10#define UART_CTL_RSTRXFIFO_SHIFT 6
11#define UART_CTL_RSTRXFIFO_MASK (1 << UART_CTL_RSTRXFIFO_SHIFT)
12#define UART_CTL_RSTTXFIFO_SHIFT 7
13#define UART_CTL_RSTTXFIFO_MASK (1 << UART_CTL_RSTTXFIFO_SHIFT)
14#define UART_CTL_STOPBITS_SHIFT 8
15#define UART_CTL_STOPBITS_MASK (0xf << UART_CTL_STOPBITS_SHIFT)
16#define UART_CTL_STOPBITS_1 (0x7 << UART_CTL_STOPBITS_SHIFT)
17#define UART_CTL_STOPBITS_2 (0xf << UART_CTL_STOPBITS_SHIFT)
18#define UART_CTL_BITSPERSYM_SHIFT 12
19#define UART_CTL_BITSPERSYM_MASK (0x3 << UART_CTL_BITSPERSYM_SHIFT)
20#define UART_CTL_XMITBRK_SHIFT 14
21#define UART_CTL_XMITBRK_MASK (1 << UART_CTL_XMITBRK_SHIFT)
22#define UART_CTL_RSVD_SHIFT 15
23#define UART_CTL_RSVD_MASK (1 << UART_CTL_RSVD_SHIFT)
24#define UART_CTL_RXPAREVEN_SHIFT 16
25#define UART_CTL_RXPAREVEN_MASK (1 << UART_CTL_RXPAREVEN_SHIFT)
26#define UART_CTL_RXPAREN_SHIFT 17
27#define UART_CTL_RXPAREN_MASK (1 << UART_CTL_RXPAREN_SHIFT)
28#define UART_CTL_TXPAREVEN_SHIFT 18
29#define UART_CTL_TXPAREVEN_MASK (1 << UART_CTL_TXPAREVEN_SHIFT)
30#define UART_CTL_TXPAREN_SHIFT 18
31#define UART_CTL_TXPAREN_MASK (1 << UART_CTL_TXPAREN_SHIFT)
32#define UART_CTL_LOOPBACK_SHIFT 20
33#define UART_CTL_LOOPBACK_MASK (1 << UART_CTL_LOOPBACK_SHIFT)
34#define UART_CTL_RXEN_SHIFT 21
35#define UART_CTL_RXEN_MASK (1 << UART_CTL_RXEN_SHIFT)
36#define UART_CTL_TXEN_SHIFT 22
37#define UART_CTL_TXEN_MASK (1 << UART_CTL_TXEN_SHIFT)
38#define UART_CTL_BRGEN_SHIFT 23
39#define UART_CTL_BRGEN_MASK (1 << UART_CTL_BRGEN_SHIFT)
40
41/* UART Baudword register */
42#define UART_BAUD_REG 0x4
43
44/* UART Misc Control register */
45#define UART_MCTL_REG 0x8
46#define UART_MCTL_DTR_SHIFT 0
47#define UART_MCTL_DTR_MASK (1 << UART_MCTL_DTR_SHIFT)
48#define UART_MCTL_RTS_SHIFT 1
49#define UART_MCTL_RTS_MASK (1 << UART_MCTL_RTS_SHIFT)
50#define UART_MCTL_RXFIFOTHRESH_SHIFT 8
51#define UART_MCTL_RXFIFOTHRESH_MASK (0xf << UART_MCTL_RXFIFOTHRESH_SHIFT)
52#define UART_MCTL_TXFIFOTHRESH_SHIFT 12
53#define UART_MCTL_TXFIFOTHRESH_MASK (0xf << UART_MCTL_TXFIFOTHRESH_SHIFT)
54#define UART_MCTL_RXFIFOFILL_SHIFT 16
55#define UART_MCTL_RXFIFOFILL_MASK (0x1f << UART_MCTL_RXFIFOFILL_SHIFT)
56#define UART_MCTL_TXFIFOFILL_SHIFT 24
57#define UART_MCTL_TXFIFOFILL_MASK (0x1f << UART_MCTL_TXFIFOFILL_SHIFT)
58
59/* UART External Input Configuration register */
60#define UART_EXTINP_REG 0xc
61#define UART_EXTINP_RI_SHIFT 0
62#define UART_EXTINP_RI_MASK (1 << UART_EXTINP_RI_SHIFT)
63#define UART_EXTINP_CTS_SHIFT 1
64#define UART_EXTINP_CTS_MASK (1 << UART_EXTINP_CTS_SHIFT)
65#define UART_EXTINP_DCD_SHIFT 2
66#define UART_EXTINP_DCD_MASK (1 << UART_EXTINP_DCD_SHIFT)
67#define UART_EXTINP_DSR_SHIFT 3
68#define UART_EXTINP_DSR_MASK (1 << UART_EXTINP_DSR_SHIFT)
69#define UART_EXTINP_IRSTAT(x) (1 << (x + 4))
70#define UART_EXTINP_IRMASK(x) (1 << (x + 8))
71#define UART_EXTINP_IR_RI 0
72#define UART_EXTINP_IR_CTS 1
73#define UART_EXTINP_IR_DCD 2
74#define UART_EXTINP_IR_DSR 3
75#define UART_EXTINP_RI_NOSENSE_SHIFT 16
76#define UART_EXTINP_RI_NOSENSE_MASK (1 << UART_EXTINP_RI_NOSENSE_SHIFT)
77#define UART_EXTINP_CTS_NOSENSE_SHIFT 17
78#define UART_EXTINP_CTS_NOSENSE_MASK (1 << UART_EXTINP_CTS_NOSENSE_SHIFT)
79#define UART_EXTINP_DCD_NOSENSE_SHIFT 18
80#define UART_EXTINP_DCD_NOSENSE_MASK (1 << UART_EXTINP_DCD_NOSENSE_SHIFT)
81#define UART_EXTINP_DSR_NOSENSE_SHIFT 19
82#define UART_EXTINP_DSR_NOSENSE_MASK (1 << UART_EXTINP_DSR_NOSENSE_SHIFT)
83
84/* UART Interrupt register */
85#define UART_IR_REG 0x10
86#define UART_IR_MASK(x) (1 << (x + 16))
87#define UART_IR_STAT(x) (1 << (x))
88#define UART_IR_EXTIP 0
89#define UART_IR_TXUNDER 1
90#define UART_IR_TXOVER 2
91#define UART_IR_TXTRESH 3
92#define UART_IR_TXRDLATCH 4
93#define UART_IR_TXEMPTY 5
94#define UART_IR_RXUNDER 6
95#define UART_IR_RXOVER 7
96#define UART_IR_RXTIMEOUT 8
97#define UART_IR_RXFULL 9
98#define UART_IR_RXTHRESH 10
99#define UART_IR_RXNOTEMPTY 11
100#define UART_IR_RXFRAMEERR 12
101#define UART_IR_RXPARERR 13
102#define UART_IR_RXBRK 14
103#define UART_IR_TXDONE 15
104
105/* UART Fifo register */
106#define UART_FIFO_REG 0x14
107#define UART_FIFO_VALID_SHIFT 0
108#define UART_FIFO_VALID_MASK 0xff
109#define UART_FIFO_FRAMEERR_SHIFT 8
110#define UART_FIFO_FRAMEERR_MASK (1 << UART_FIFO_FRAMEERR_SHIFT)
111#define UART_FIFO_PARERR_SHIFT 9
112#define UART_FIFO_PARERR_MASK (1 << UART_FIFO_PARERR_SHIFT)
113#define UART_FIFO_BRKDET_SHIFT 10
114#define UART_FIFO_BRKDET_MASK (1 << UART_FIFO_BRKDET_SHIFT)
115#define UART_FIFO_ANYERR_MASK (UART_FIFO_FRAMEERR_MASK | \
116 UART_FIFO_PARERR_MASK | \
117 UART_FIFO_BRKDET_MASK)
118
119#endif /* _LINUX_SERIAL_BCM63XX_H */
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h
index 50fe651da965..22b3640c9424 100644
--- a/include/linux/serial_sci.h
+++ b/include/linux/serial_sci.h
@@ -10,15 +10,6 @@
10 10
11#define SCIx_NOT_SUPPORTED (-1) 11#define SCIx_NOT_SUPPORTED (-1)
12 12
13enum {
14 SCBRR_ALGO_1, /* ((clk + 16 * bps) / (16 * bps) - 1) */
15 SCBRR_ALGO_2, /* ((clk + 16 * bps) / (32 * bps) - 1) */
16 SCBRR_ALGO_3, /* (((clk * 2) + 16 * bps) / (16 * bps) - 1) */
17 SCBRR_ALGO_4, /* (((clk * 2) + 16 * bps) / (32 * bps) - 1) */
18 SCBRR_ALGO_5, /* (((clk * 1000 / 32) / bps) - 1) */
19 SCBRR_ALGO_6, /* HSCIF variable sample rate algorithm */
20};
21
22#define SCSCR_TIE (1 << 7) 13#define SCSCR_TIE (1 << 7)
23#define SCSCR_RIE (1 << 6) 14#define SCSCR_RIE (1 << 6)
24#define SCSCR_TE (1 << 5) 15#define SCSCR_TE (1 << 5)
@@ -59,28 +50,6 @@ enum {
59/* HSSRR HSCIF */ 50/* HSSRR HSCIF */
60#define HSCIF_SRE 0x8000 51#define HSCIF_SRE 0x8000
61 52
62/* Offsets into the sci_port->irqs array */
63enum {
64 SCIx_ERI_IRQ,
65 SCIx_RXI_IRQ,
66 SCIx_TXI_IRQ,
67 SCIx_BRI_IRQ,
68 SCIx_NR_IRQS,
69
70 SCIx_MUX_IRQ = SCIx_NR_IRQS, /* special case */
71};
72
73/* Offsets into the sci_port->gpios array */
74enum {
75 SCIx_SCK,
76 SCIx_RXD,
77 SCIx_TXD,
78 SCIx_CTS,
79 SCIx_RTS,
80
81 SCIx_NR_FNS,
82};
83
84enum { 53enum {
85 SCIx_PROBE_REGTYPE, 54 SCIx_PROBE_REGTYPE,
86 55
@@ -99,19 +68,6 @@ enum {
99 SCIx_NR_REGTYPES, 68 SCIx_NR_REGTYPES,
100}; 69};
101 70
102#define SCIx_IRQ_MUXED(irq) \
103{ \
104 [SCIx_ERI_IRQ] = (irq), \
105 [SCIx_RXI_IRQ] = (irq), \
106 [SCIx_TXI_IRQ] = (irq), \
107 [SCIx_BRI_IRQ] = (irq), \
108}
109
110#define SCIx_IRQ_IS_MUXED(port) \
111 ((port)->cfg->irqs[SCIx_ERI_IRQ] == \
112 (port)->cfg->irqs[SCIx_RXI_IRQ]) || \
113 ((port)->cfg->irqs[SCIx_ERI_IRQ] && \
114 !(port)->cfg->irqs[SCIx_RXI_IRQ])
115/* 71/*
116 * SCI register subset common for all port types. 72 * SCI register subset common for all port types.
117 * Not all registers will exist on all parts. 73 * Not all registers will exist on all parts.
@@ -140,22 +96,16 @@ struct plat_sci_port_ops {
140 * Platform device specific platform_data struct 96 * Platform device specific platform_data struct
141 */ 97 */
142struct plat_sci_port { 98struct plat_sci_port {
143 unsigned long mapbase; /* resource base */
144 unsigned int irqs[SCIx_NR_IRQS]; /* ERI, RXI, TXI, BRI */
145 unsigned int gpios[SCIx_NR_FNS]; /* SCK, RXD, TXD, CTS, RTS */
146 unsigned int type; /* SCI / SCIF / IRDA / HSCIF */ 99 unsigned int type; /* SCI / SCIF / IRDA / HSCIF */
147 upf_t flags; /* UPF_* flags */ 100 upf_t flags; /* UPF_* flags */
148 unsigned long capabilities; /* Port features/capabilities */ 101 unsigned long capabilities; /* Port features/capabilities */
149 102
150 unsigned int scbrr_algo_id; /* SCBRR calculation algo */ 103 unsigned int sampling_rate;
151 unsigned int scscr; /* SCSCR initialization */ 104 unsigned int scscr; /* SCSCR initialization */
152 105
153 /* 106 /*
154 * Platform overrides if necessary, defaults otherwise. 107 * Platform overrides if necessary, defaults otherwise.
155 */ 108 */
156 int overrun_bit;
157 unsigned int error_mask;
158
159 int port_reg; 109 int port_reg;
160 unsigned char regshift; 110 unsigned char regshift;
161 unsigned char regtype; 111 unsigned char regtype;
diff --git a/include/linux/sfi_acpi.h b/include/linux/sfi_acpi.h
index 631af63af42d..4723bbfa1c26 100644
--- a/include/linux/sfi_acpi.h
+++ b/include/linux/sfi_acpi.h
@@ -59,8 +59,11 @@
59#ifndef _LINUX_SFI_ACPI_H 59#ifndef _LINUX_SFI_ACPI_H
60#define _LINUX_SFI_ACPI_H 60#define _LINUX_SFI_ACPI_H
61 61
62#include <linux/acpi.h>
63#include <linux/sfi.h>
64
62#ifdef CONFIG_SFI 65#ifdef CONFIG_SFI
63#include <acpi/acpi.h> /* struct acpi_table_header */ 66#include <acpi/acpi.h> /* FIXME: inclusion should be removed */
64 67
65extern int sfi_acpi_table_parse(char *signature, char *oem_id, 68extern int sfi_acpi_table_parse(char *signature, char *oem_id,
66 char *oem_table_id, 69 char *oem_table_id,
diff --git a/include/linux/sh_eth.h b/include/linux/sh_eth.h
index 90b5e30c2f22..8c9131db2b25 100644
--- a/include/linux/sh_eth.h
+++ b/include/linux/sh_eth.h
@@ -8,6 +8,7 @@ enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN};
8 8
9struct sh_eth_plat_data { 9struct sh_eth_plat_data {
10 int phy; 10 int phy;
11 int phy_irq;
11 int edmac_endian; 12 int edmac_endian;
12 phy_interface_t phy_interface; 13 phy_interface_t phy_interface;
13 void (*set_mdio_gate)(void *addr); 14 void (*set_mdio_gate)(void *addr);
diff --git a/include/linux/shm.h b/include/linux/shm.h
index 429c1995d756..1e2cd2e6b540 100644
--- a/include/linux/shm.h
+++ b/include/linux/shm.h
@@ -9,7 +9,7 @@
9struct shmid_kernel /* private to the kernel */ 9struct shmid_kernel /* private to the kernel */
10{ 10{
11 struct kern_ipc_perm shm_perm; 11 struct kern_ipc_perm shm_perm;
12 struct file * shm_file; 12 struct file *shm_file;
13 unsigned long shm_nattch; 13 unsigned long shm_nattch;
14 unsigned long shm_segsz; 14 unsigned long shm_segsz;
15 time_t shm_atim; 15 time_t shm_atim;
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index cde842513df2..fc71710fba45 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -34,11 +34,82 @@
34#include <linux/netdev_features.h> 34#include <linux/netdev_features.h>
35#include <net/flow_keys.h> 35#include <net/flow_keys.h>
36 36
37/* A. Checksumming of received packets by device.
38 *
39 * CHECKSUM_NONE:
40 *
41 * Device failed to checksum this packet e.g. due to lack of capabilities.
42 * The packet contains full (though not verified) checksum in packet but
43 * not in skb->csum. Thus, skb->csum is undefined in this case.
44 *
45 * CHECKSUM_UNNECESSARY:
46 *
47 * The hardware you're dealing with doesn't calculate the full checksum
48 * (as in CHECKSUM_COMPLETE), but it does parse headers and verify checksums
49 * for specific protocols e.g. TCP/UDP/SCTP, then, for such packets it will
50 * set CHECKSUM_UNNECESSARY if their checksums are okay. skb->csum is still
51 * undefined in this case though. It is a bad option, but, unfortunately,
52 * nowadays most vendors do this. Apparently with the secret goal to sell
53 * you new devices, when you will add new protocol to your host, f.e. IPv6 8)
54 *
55 * CHECKSUM_COMPLETE:
56 *
57 * This is the most generic way. The device supplied checksum of the _whole_
58 * packet as seen by netif_rx() and fills out in skb->csum. Meaning, the
59 * hardware doesn't need to parse L3/L4 headers to implement this.
60 *
61 * Note: Even if device supports only some protocols, but is able to produce
62 * skb->csum, it MUST use CHECKSUM_COMPLETE, not CHECKSUM_UNNECESSARY.
63 *
64 * CHECKSUM_PARTIAL:
65 *
66 * This is identical to the case for output below. This may occur on a packet
67 * received directly from another Linux OS, e.g., a virtualized Linux kernel
68 * on the same host. The packet can be treated in the same way as
69 * CHECKSUM_UNNECESSARY, except that on output (i.e., forwarding) the
70 * checksum must be filled in by the OS or the hardware.
71 *
72 * B. Checksumming on output.
73 *
74 * CHECKSUM_NONE:
75 *
76 * The skb was already checksummed by the protocol, or a checksum is not
77 * required.
78 *
79 * CHECKSUM_PARTIAL:
80 *
81 * The device is required to checksum the packet as seen by hard_start_xmit()
82 * from skb->csum_start up to the end, and to record/write the checksum at
83 * offset skb->csum_start + skb->csum_offset.
84 *
85 * The device must show its capabilities in dev->features, set up at device
86 * setup time, e.g. netdev_features.h:
87 *
88 * NETIF_F_HW_CSUM - It's a clever device, it's able to checksum everything.
89 * NETIF_F_IP_CSUM - Device is dumb, it's able to checksum only TCP/UDP over
90 * IPv4. Sigh. Vendors like this way for an unknown reason.
91 * Though, see comment above about CHECKSUM_UNNECESSARY. 8)
92 * NETIF_F_IPV6_CSUM - About as dumb as the last one but does IPv6 instead.
93 * NETIF_F_... - Well, you get the picture.
94 *
95 * CHECKSUM_UNNECESSARY:
96 *
97 * Normally, the device will do per protocol specific checksumming. Protocol
98 * implementations that do not want the NIC to perform the checksum
99 * calculation should use this flag in their outgoing skbs.
100 *
101 * NETIF_F_FCOE_CRC - This indicates that the device can do FCoE FC CRC
102 * offload. Correspondingly, the FCoE protocol driver
103 * stack should use CHECKSUM_UNNECESSARY.
104 *
105 * Any questions? No questions, good. --ANK
106 */
107
37/* Don't change this without changing skb_csum_unnecessary! */ 108/* Don't change this without changing skb_csum_unnecessary! */
38#define CHECKSUM_NONE 0 109#define CHECKSUM_NONE 0
39#define CHECKSUM_UNNECESSARY 1 110#define CHECKSUM_UNNECESSARY 1
40#define CHECKSUM_COMPLETE 2 111#define CHECKSUM_COMPLETE 2
41#define CHECKSUM_PARTIAL 3 112#define CHECKSUM_PARTIAL 3
42 113
43#define SKB_DATA_ALIGN(X) (((X) + (SMP_CACHE_BYTES - 1)) & \ 114#define SKB_DATA_ALIGN(X) (((X) + (SMP_CACHE_BYTES - 1)) & \
44 ~(SMP_CACHE_BYTES - 1)) 115 ~(SMP_CACHE_BYTES - 1))
@@ -54,58 +125,6 @@
54 SKB_DATA_ALIGN(sizeof(struct sk_buff)) + \ 125 SKB_DATA_ALIGN(sizeof(struct sk_buff)) + \
55 SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) 126 SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
56 127
57/* A. Checksumming of received packets by device.
58 *
59 * NONE: device failed to checksum this packet.
60 * skb->csum is undefined.
61 *
62 * UNNECESSARY: device parsed packet and wouldbe verified checksum.
63 * skb->csum is undefined.
64 * It is bad option, but, unfortunately, many of vendors do this.
65 * Apparently with secret goal to sell you new device, when you
66 * will add new protocol to your host. F.e. IPv6. 8)
67 *
68 * COMPLETE: the most generic way. Device supplied checksum of _all_
69 * the packet as seen by netif_rx in skb->csum.
70 * NOTE: Even if device supports only some protocols, but
71 * is able to produce some skb->csum, it MUST use COMPLETE,
72 * not UNNECESSARY.
73 *
74 * PARTIAL: identical to the case for output below. This may occur
75 * on a packet received directly from another Linux OS, e.g.,
76 * a virtualised Linux kernel on the same host. The packet can
77 * be treated in the same way as UNNECESSARY except that on
78 * output (i.e., forwarding) the checksum must be filled in
79 * by the OS or the hardware.
80 *
81 * B. Checksumming on output.
82 *
83 * NONE: skb is checksummed by protocol or csum is not required.
84 *
85 * PARTIAL: device is required to csum packet as seen by hard_start_xmit
86 * from skb->csum_start to the end and to record the checksum
87 * at skb->csum_start + skb->csum_offset.
88 *
89 * Device must show its capabilities in dev->features, set
90 * at device setup time.
91 * NETIF_F_HW_CSUM - it is clever device, it is able to checksum
92 * everything.
93 * NETIF_F_IP_CSUM - device is dumb. It is able to csum only
94 * TCP/UDP over IPv4. Sigh. Vendors like this
95 * way by an unknown reason. Though, see comment above
96 * about CHECKSUM_UNNECESSARY. 8)
97 * NETIF_F_IPV6_CSUM about as dumb as the last one but does IPv6 instead.
98 *
99 * UNNECESSARY: device will do per protocol specific csum. Protocol drivers
100 * that do not want net to perform the checksum calculation should use
101 * this flag in their outgoing skbs.
102 * NETIF_F_FCOE_CRC this indicates the device can do FCoE FC CRC
103 * offload. Correspondingly, the FCoE protocol driver
104 * stack should use CHECKSUM_UNNECESSARY.
105 *
106 * Any questions? No questions, good. --ANK
107 */
108
109struct net_device; 128struct net_device;
110struct scatterlist; 129struct scatterlist;
111struct pipe_inode_info; 130struct pipe_inode_info;
@@ -703,15 +722,78 @@ unsigned int skb_find_text(struct sk_buff *skb, unsigned int from,
703 unsigned int to, struct ts_config *config, 722 unsigned int to, struct ts_config *config,
704 struct ts_state *state); 723 struct ts_state *state);
705 724
706void __skb_get_rxhash(struct sk_buff *skb); 725/*
707static inline __u32 skb_get_rxhash(struct sk_buff *skb) 726 * Packet hash types specify the type of hash in skb_set_hash.
727 *
728 * Hash types refer to the protocol layer addresses which are used to
729 * construct a packet's hash. The hashes are used to differentiate or identify
730 * flows of the protocol layer for the hash type. Hash types are either
731 * layer-2 (L2), layer-3 (L3), or layer-4 (L4).
732 *
733 * Properties of hashes:
734 *
735 * 1) Two packets in different flows have different hash values
736 * 2) Two packets in the same flow should have the same hash value
737 *
738 * A hash at a higher layer is considered to be more specific. A driver should
739 * set the most specific hash possible.
740 *
741 * A driver cannot indicate a more specific hash than the layer at which a hash
742 * was computed. For instance an L3 hash cannot be set as an L4 hash.
743 *
744 * A driver may indicate a hash level which is less specific than the
745 * actual layer the hash was computed on. For instance, a hash computed
746 * at L4 may be considered an L3 hash. This should only be done if the
747 * driver can't unambiguously determine that the HW computed the hash at
748 * the higher layer. Note that the "should" in the second property above
749 * permits this.
750 */
751enum pkt_hash_types {
752 PKT_HASH_TYPE_NONE, /* Undefined type */
753 PKT_HASH_TYPE_L2, /* Input: src_MAC, dest_MAC */
754 PKT_HASH_TYPE_L3, /* Input: src_IP, dst_IP */
755 PKT_HASH_TYPE_L4, /* Input: src_IP, dst_IP, src_port, dst_port */
756};
757
758static inline void
759skb_set_hash(struct sk_buff *skb, __u32 hash, enum pkt_hash_types type)
760{
761 skb->l4_rxhash = (type == PKT_HASH_TYPE_L4);
762 skb->rxhash = hash;
763}
764
765void __skb_get_hash(struct sk_buff *skb);
766static inline __u32 skb_get_hash(struct sk_buff *skb)
708{ 767{
709 if (!skb->l4_rxhash) 768 if (!skb->l4_rxhash)
710 __skb_get_rxhash(skb); 769 __skb_get_hash(skb);
711 770
712 return skb->rxhash; 771 return skb->rxhash;
713} 772}
714 773
774static inline __u32 skb_get_hash_raw(const struct sk_buff *skb)
775{
776 return skb->rxhash;
777}
778
779static inline void skb_clear_hash(struct sk_buff *skb)
780{
781 skb->rxhash = 0;
782 skb->l4_rxhash = 0;
783}
784
785static inline void skb_clear_hash_if_not_l4(struct sk_buff *skb)
786{
787 if (!skb->l4_rxhash)
788 skb_clear_hash(skb);
789}
790
791static inline void skb_copy_hash(struct sk_buff *to, const struct sk_buff *from)
792{
793 to->rxhash = from->rxhash;
794 to->l4_rxhash = from->l4_rxhash;
795};
796
715#ifdef NET_SKBUFF_DATA_USES_OFFSET 797#ifdef NET_SKBUFF_DATA_USES_OFFSET
716static inline unsigned char *skb_end_pointer(const struct sk_buff *skb) 798static inline unsigned char *skb_end_pointer(const struct sk_buff *skb)
717{ 799{
@@ -750,7 +832,7 @@ static inline struct skb_shared_hwtstamps *skb_hwtstamps(struct sk_buff *skb)
750 */ 832 */
751static inline int skb_queue_empty(const struct sk_buff_head *list) 833static inline int skb_queue_empty(const struct sk_buff_head *list)
752{ 834{
753 return list->next == (struct sk_buff *)list; 835 return list->next == (const struct sk_buff *) list;
754} 836}
755 837
756/** 838/**
@@ -763,7 +845,7 @@ static inline int skb_queue_empty(const struct sk_buff_head *list)
763static inline bool skb_queue_is_last(const struct sk_buff_head *list, 845static inline bool skb_queue_is_last(const struct sk_buff_head *list,
764 const struct sk_buff *skb) 846 const struct sk_buff *skb)
765{ 847{
766 return skb->next == (struct sk_buff *)list; 848 return skb->next == (const struct sk_buff *) list;
767} 849}
768 850
769/** 851/**
@@ -776,7 +858,7 @@ static inline bool skb_queue_is_last(const struct sk_buff_head *list,
776static inline bool skb_queue_is_first(const struct sk_buff_head *list, 858static inline bool skb_queue_is_first(const struct sk_buff_head *list,
777 const struct sk_buff *skb) 859 const struct sk_buff *skb)
778{ 860{
779 return skb->prev == (struct sk_buff *)list; 861 return skb->prev == (const struct sk_buff *) list;
780} 862}
781 863
782/** 864/**
@@ -1638,6 +1720,11 @@ static inline void skb_set_mac_header(struct sk_buff *skb, const int offset)
1638 skb->mac_header += offset; 1720 skb->mac_header += offset;
1639} 1721}
1640 1722
1723static inline void skb_pop_mac_header(struct sk_buff *skb)
1724{
1725 skb->mac_header = skb->network_header;
1726}
1727
1641static inline void skb_probe_transport_header(struct sk_buff *skb, 1728static inline void skb_probe_transport_header(struct sk_buff *skb,
1642 const int offset_hint) 1729 const int offset_hint)
1643{ 1730{
@@ -2363,9 +2450,13 @@ int skb_splice_bits(struct sk_buff *skb, unsigned int offset,
2363 struct pipe_inode_info *pipe, unsigned int len, 2450 struct pipe_inode_info *pipe, unsigned int len,
2364 unsigned int flags); 2451 unsigned int flags);
2365void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to); 2452void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to);
2453unsigned int skb_zerocopy_headlen(const struct sk_buff *from);
2454void skb_zerocopy(struct sk_buff *to, const struct sk_buff *from,
2455 int len, int hlen);
2366void skb_split(struct sk_buff *skb, struct sk_buff *skb1, const u32 len); 2456void skb_split(struct sk_buff *skb, struct sk_buff *skb1, const u32 len);
2367int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen); 2457int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen);
2368void skb_scrub_packet(struct sk_buff *skb, bool xnet); 2458void skb_scrub_packet(struct sk_buff *skb, bool xnet);
2459unsigned int skb_gso_transport_seglen(const struct sk_buff *skb);
2369struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features); 2460struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features);
2370 2461
2371struct skb_checksum_ops { 2462struct skb_checksum_ops {
@@ -2392,6 +2483,24 @@ static inline void *skb_header_pointer(const struct sk_buff *skb, int offset,
2392 return buffer; 2483 return buffer;
2393} 2484}
2394 2485
2486/**
2487 * skb_needs_linearize - check if we need to linearize a given skb
2488 * depending on the given device features.
2489 * @skb: socket buffer to check
2490 * @features: net device features
2491 *
2492 * Returns true if either:
2493 * 1. skb has frag_list and the device doesn't support FRAGLIST, or
2494 * 2. skb is fragmented and the device does not support SG.
2495 */
2496static inline bool skb_needs_linearize(struct sk_buff *skb,
2497 netdev_features_t features)
2498{
2499 return skb_is_nonlinear(skb) &&
2500 ((skb_has_frag_list(skb) && !(features & NETIF_F_FRAGLIST)) ||
2501 (skb_shinfo(skb)->nr_frags && !(features & NETIF_F_SG)));
2502}
2503
2395static inline void skb_copy_from_linear_data(const struct sk_buff *skb, 2504static inline void skb_copy_from_linear_data(const struct sk_buff *skb,
2396 void *to, 2505 void *to,
2397 const unsigned int len) 2506 const unsigned int len)
@@ -2526,6 +2635,10 @@ static inline void sw_tx_timestamp(struct sk_buff *skb)
2526 * Ethernet MAC Drivers should call this function in their hard_xmit() 2635 * Ethernet MAC Drivers should call this function in their hard_xmit()
2527 * function immediately before giving the sk_buff to the MAC hardware. 2636 * function immediately before giving the sk_buff to the MAC hardware.
2528 * 2637 *
2638 * Specifically, one should make absolutely sure that this function is
2639 * called before TX completion of this packet can trigger. Otherwise
2640 * the packet could potentially already be freed.
2641 *
2529 * @skb: A socket buffer. 2642 * @skb: A socket buffer.
2530 */ 2643 */
2531static inline void skb_tx_timestamp(struct sk_buff *skb) 2644static inline void skb_tx_timestamp(struct sk_buff *skb)
@@ -2786,6 +2899,8 @@ static inline void skb_checksum_none_assert(const struct sk_buff *skb)
2786 2899
2787bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off); 2900bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off);
2788 2901
2902int skb_checksum_setup(struct sk_buff *skb, bool recalculate);
2903
2789u32 __skb_get_poff(const struct sk_buff *skb); 2904u32 __skb_get_poff(const struct sk_buff *skb);
2790 2905
2791/** 2906/**
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 1e2f4fe12773..9260abdd67df 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -205,8 +205,8 @@ struct kmem_cache {
205 205
206#ifdef CONFIG_SLUB 206#ifdef CONFIG_SLUB
207/* 207/*
208 * SLUB allocates up to order 2 pages directly and otherwise 208 * SLUB directly allocates requests fitting in to an order-1 page
209 * passes the request to the page allocator. 209 * (PAGE_SIZE*2). Larger requests are passed to the page allocator.
210 */ 210 */
211#define KMALLOC_SHIFT_HIGH (PAGE_SHIFT + 1) 211#define KMALLOC_SHIFT_HIGH (PAGE_SHIFT + 1)
212#define KMALLOC_SHIFT_MAX (MAX_ORDER + PAGE_SHIFT) 212#define KMALLOC_SHIFT_MAX (MAX_ORDER + PAGE_SHIFT)
@@ -217,12 +217,12 @@ struct kmem_cache {
217 217
218#ifdef CONFIG_SLOB 218#ifdef CONFIG_SLOB
219/* 219/*
220 * SLOB passes all page size and larger requests to the page allocator. 220 * SLOB passes all requests larger than one page to the page allocator.
221 * No kmalloc array is necessary since objects of different sizes can 221 * No kmalloc array is necessary since objects of different sizes can
222 * be allocated from the same page. 222 * be allocated from the same page.
223 */ 223 */
224#define KMALLOC_SHIFT_MAX 30
225#define KMALLOC_SHIFT_HIGH PAGE_SHIFT 224#define KMALLOC_SHIFT_HIGH PAGE_SHIFT
225#define KMALLOC_SHIFT_MAX 30
226#ifndef KMALLOC_SHIFT_LOW 226#ifndef KMALLOC_SHIFT_LOW
227#define KMALLOC_SHIFT_LOW 3 227#define KMALLOC_SHIFT_LOW 3
228#endif 228#endif
@@ -513,7 +513,9 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node)
513 * 513 *
514 * Both the root cache and the child caches will have it. For the root cache, 514 * Both the root cache and the child caches will have it. For the root cache,
515 * this will hold a dynamically allocated array large enough to hold 515 * this will hold a dynamically allocated array large enough to hold
516 * information about the currently limited memcgs in the system. 516 * information about the currently limited memcgs in the system. To allow the
517 * array to be accessed without taking any locks, on relocation we free the old
518 * version only after a grace period.
517 * 519 *
518 * Child caches will hold extra metadata needed for its operation. Fields are: 520 * Child caches will hold extra metadata needed for its operation. Fields are:
519 * 521 *
@@ -528,7 +530,10 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node)
528struct memcg_cache_params { 530struct memcg_cache_params {
529 bool is_root_cache; 531 bool is_root_cache;
530 union { 532 union {
531 struct kmem_cache *memcg_caches[0]; 533 struct {
534 struct rcu_head rcu_head;
535 struct kmem_cache *memcg_caches[0];
536 };
532 struct { 537 struct {
533 struct mem_cgroup *memcg; 538 struct mem_cgroup *memcg;
534 struct list_head list; 539 struct list_head list;
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
index 40fc39d22d53..8235dfbb3b05 100644
--- a/include/linux/slab_def.h
+++ b/include/linux/slab_def.h
@@ -1,6 +1,8 @@
1#ifndef _LINUX_SLAB_DEF_H 1#ifndef _LINUX_SLAB_DEF_H
2#define _LINUX_SLAB_DEF_H 2#define _LINUX_SLAB_DEF_H
3 3
4#include <linux/reciprocal_div.h>
5
4/* 6/*
5 * Definitions unique to the original Linux SLAB allocator. 7 * Definitions unique to the original Linux SLAB allocator.
6 */ 8 */
@@ -12,7 +14,7 @@ struct kmem_cache {
12 unsigned int shared; 14 unsigned int shared;
13 15
14 unsigned int size; 16 unsigned int size;
15 u32 reciprocal_buffer_size; 17 struct reciprocal_value reciprocal_buffer_size;
16/* 2) touched by every alloc & free from the backend */ 18/* 2) touched by every alloc & free from the backend */
17 19
18 unsigned int flags; /* constant flags */ 20 unsigned int flags; /* constant flags */
diff --git a/include/linux/smp.h b/include/linux/smp.h
index 5da22ee42e16..6ae004e437ea 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -11,12 +11,16 @@
11#include <linux/list.h> 11#include <linux/list.h>
12#include <linux/cpumask.h> 12#include <linux/cpumask.h>
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/llist.h>
14 15
15extern void cpu_idle(void); 16extern void cpu_idle(void);
16 17
17typedef void (*smp_call_func_t)(void *info); 18typedef void (*smp_call_func_t)(void *info);
18struct call_single_data { 19struct call_single_data {
19 struct list_head list; 20 union {
21 struct list_head list;
22 struct llist_node llist;
23 };
20 smp_call_func_t func; 24 smp_call_func_t func;
21 void *info; 25 void *info;
22 u16 flags; 26 u16 flags;
@@ -184,6 +188,9 @@ static inline void kick_all_cpus_sync(void) { }
184 */ 188 */
185extern void arch_disable_smp_support(void); 189extern void arch_disable_smp_support(void);
186 190
191extern void arch_enable_nonboot_cpus_begin(void);
192extern void arch_enable_nonboot_cpus_end(void);
193
187void smp_setup_processor_id(void); 194void smp_setup_processor_id(void);
188 195
189#endif /* __LINUX_SMP_H */ 196#endif /* __LINUX_SMP_H */
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 445ef7519dc2..8e98297f1388 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -45,13 +45,13 @@ struct linger {
45 */ 45 */
46 46
47struct msghdr { 47struct msghdr {
48 void * msg_name; /* Socket name */ 48 void *msg_name; /* ptr to socket address structure */
49 int msg_namelen; /* Length of name */ 49 int msg_namelen; /* size of socket address structure */
50 struct iovec * msg_iov; /* Data blocks */ 50 struct iovec *msg_iov; /* scatter/gather array */
51 __kernel_size_t msg_iovlen; /* Number of blocks */ 51 __kernel_size_t msg_iovlen; /* # elements in msg_iov */
52 void * msg_control; /* Per protocol magic (eg BSD file descriptor passing) */ 52 void *msg_control; /* ancillary data */
53 __kernel_size_t msg_controllen; /* Length of cmsg list */ 53 __kernel_size_t msg_controllen; /* ancillary data buffer length */
54 unsigned int msg_flags; 54 unsigned int msg_flags; /* flags on received message */
55}; 55};
56 56
57/* For recvmmsg/sendmmsg */ 57/* For recvmmsg/sendmmsg */
@@ -305,8 +305,6 @@ struct ucred {
305/* IPX options */ 305/* IPX options */
306#define IPX_TYPE 1 306#define IPX_TYPE 1
307 307
308extern void cred_to_ucred(struct pid *pid, const struct cred *cred, struct ucred *ucred);
309
310extern int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov, 308extern int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov,
311 int offset, int len); 309 int offset, int len);
312extern int csum_partial_copy_fromiovecend(unsigned char *kdata, 310extern int csum_partial_copy_fromiovecend(unsigned char *kdata,
diff --git a/include/linux/spi/74x164.h b/include/linux/spi/74x164.h
deleted file mode 100644
index 0aa6acc73317..000000000000
--- a/include/linux/spi/74x164.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef LINUX_SPI_74X164_H
2#define LINUX_SPI_74X164_H
3
4struct gen_74x164_chip_platform_data {
5 /* number assigned to the first GPIO */
6 unsigned base;
7};
8
9#endif
diff --git a/include/linux/spi/s3c24xx.h b/include/linux/spi/s3c24xx.h
index c23b923e493b..ca271c06c591 100644
--- a/include/linux/spi/s3c24xx.h
+++ b/include/linux/spi/s3c24xx.h
@@ -23,4 +23,6 @@ struct s3c2410_spi_info {
23 void (*set_cs)(struct s3c2410_spi_info *spi, int cs, int pol); 23 void (*set_cs)(struct s3c2410_spi_info *spi, int cs, int pol);
24}; 24};
25 25
26extern int s3c24xx_set_fiq(unsigned int irq, bool on);
27
26#endif /* __LINUX_SPI_S3C24XX_H */ 28#endif /* __LINUX_SPI_S3C24XX_H */
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 8d3a37bc6110..2c9cdef0598f 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -75,6 +75,7 @@ struct spi_device {
75 struct spi_master *master; 75 struct spi_master *master;
76 u32 max_speed_hz; 76 u32 max_speed_hz;
77 u8 chip_select; 77 u8 chip_select;
78 u8 bits_per_word;
78 u16 mode; 79 u16 mode;
79#define SPI_CPHA 0x01 /* clock phase */ 80#define SPI_CPHA 0x01 /* clock phase */
80#define SPI_CPOL 0x02 /* clock polarity */ 81#define SPI_CPOL 0x02 /* clock polarity */
@@ -92,7 +93,6 @@ struct spi_device {
92#define SPI_TX_QUAD 0x200 /* transmit with 4 wires */ 93#define SPI_TX_QUAD 0x200 /* transmit with 4 wires */
93#define SPI_RX_DUAL 0x400 /* receive with 2 wires */ 94#define SPI_RX_DUAL 0x400 /* receive with 2 wires */
94#define SPI_RX_QUAD 0x800 /* receive with 4 wires */ 95#define SPI_RX_QUAD 0x800 /* receive with 4 wires */
95 u8 bits_per_word;
96 int irq; 96 int irq;
97 void *controller_state; 97 void *controller_state;
98 void *controller_data; 98 void *controller_data;
@@ -273,19 +273,24 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
273 * message while queuing transfers that arrive in the meantime. When the 273 * message while queuing transfers that arrive in the meantime. When the
274 * driver is finished with this message, it must call 274 * driver is finished with this message, it must call
275 * spi_finalize_current_message() so the subsystem can issue the next 275 * spi_finalize_current_message() so the subsystem can issue the next
276 * transfer 276 * message
277 * @unprepare_transfer_hardware: there are currently no more messages on the 277 * @unprepare_transfer_hardware: there are currently no more messages on the
278 * queue so the subsystem notifies the driver that it may relax the 278 * queue so the subsystem notifies the driver that it may relax the
279 * hardware by issuing this call 279 * hardware by issuing this call
280 * @set_cs: assert or deassert chip select, true to assert. May be called 280 * @set_cs: set the logic level of the chip select line. May be called
281 * from interrupt context. 281 * from interrupt context.
282 * @prepare_message: set up the controller to transfer a single message, 282 * @prepare_message: set up the controller to transfer a single message,
283 * for example doing DMA mapping. Called from threaded 283 * for example doing DMA mapping. Called from threaded
284 * context. 284 * context.
285 * @transfer_one: transfer a single spi_transfer. When the 285 * @transfer_one: transfer a single spi_transfer.
286 * driver is finished with this transfer it must call 286 * - return 0 if the transfer is finished,
287 * spi_finalize_current_transfer() so the subsystem can issue 287 * - return 1 if the transfer is still in progress. When
288 * the next transfer 288 * the driver is finished with this transfer it must
289 * call spi_finalize_current_transfer() so the subsystem
290 * can issue the next transfer. Note: transfer_one and
291 * transfer_one_message are mutually exclusive; when both
292 * are set, the generic subsystem does not call your
293 * transfer_one callback.
289 * @unprepare_message: undo any work done by prepare_message(). 294 * @unprepare_message: undo any work done by prepare_message().
290 * @cs_gpios: Array of GPIOs to use as chip select lines; one per CS 295 * @cs_gpios: Array of GPIOs to use as chip select lines; one per CS
291 * number. Any individual value may be -ENOENT for CS lines that 296 * number. Any individual value may be -ENOENT for CS lines that
@@ -576,8 +581,8 @@ struct spi_transfer {
576 dma_addr_t rx_dma; 581 dma_addr_t rx_dma;
577 582
578 unsigned cs_change:1; 583 unsigned cs_change:1;
579 u8 tx_nbits; 584 unsigned tx_nbits:3;
580 u8 rx_nbits; 585 unsigned rx_nbits:3;
581#define SPI_NBITS_SINGLE 0x01 /* 1bit transfer */ 586#define SPI_NBITS_SINGLE 0x01 /* 1bit transfer */
582#define SPI_NBITS_DUAL 0x02 /* 2bits transfer */ 587#define SPI_NBITS_DUAL 0x02 /* 2bits transfer */
583#define SPI_NBITS_QUAD 0x04 /* 4bits transfer */ 588#define SPI_NBITS_QUAD 0x04 /* 4bits transfer */
@@ -847,7 +852,7 @@ static inline ssize_t spi_w8r16(struct spi_device *spi, u8 cmd)
847 ssize_t status; 852 ssize_t status;
848 u16 result; 853 u16 result;
849 854
850 status = spi_write_then_read(spi, &cmd, 1, (u8 *) &result, 2); 855 status = spi_write_then_read(spi, &cmd, 1, &result, 2);
851 856
852 /* return negative errno or unsigned value */ 857 /* return negative errno or unsigned value */
853 return (status < 0) ? status : result; 858 return (status < 0) ? status : result;
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 75f34949d9ab..3f2867ff0ced 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -130,6 +130,16 @@ do { \
130#define smp_mb__before_spinlock() smp_wmb() 130#define smp_mb__before_spinlock() smp_wmb()
131#endif 131#endif
132 132
133/*
134 * Place this after a lock-acquisition primitive to guarantee that
135 * an UNLOCK+LOCK pair act as a full barrier. This guarantee applies
136 * if the UNLOCK and LOCK are executed by the same CPU or if the
137 * UNLOCK and LOCK operate on the same lock variable.
138 */
139#ifndef smp_mb__after_unlock_lock
140#define smp_mb__after_unlock_lock() do { } while (0)
141#endif
142
133/** 143/**
134 * raw_spin_unlock_wait - wait until the spinlock gets unlocked 144 * raw_spin_unlock_wait - wait until the spinlock gets unlocked
135 * @lock: the spinlock in question. 145 * @lock: the spinlock in question.
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h
index bdb9993f0fda..42dfab89e740 100644
--- a/include/linux/spinlock_api_smp.h
+++ b/include/linux/spinlock_api_smp.h
@@ -131,8 +131,7 @@ static inline void __raw_spin_lock_irq(raw_spinlock_t *lock)
131 131
132static inline void __raw_spin_lock_bh(raw_spinlock_t *lock) 132static inline void __raw_spin_lock_bh(raw_spinlock_t *lock)
133{ 133{
134 local_bh_disable(); 134 __local_bh_disable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET);
135 preempt_disable();
136 spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); 135 spin_acquire(&lock->dep_map, 0, 0, _RET_IP_);
137 LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); 136 LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock);
138} 137}
@@ -174,20 +173,17 @@ static inline void __raw_spin_unlock_bh(raw_spinlock_t *lock)
174{ 173{
175 spin_release(&lock->dep_map, 1, _RET_IP_); 174 spin_release(&lock->dep_map, 1, _RET_IP_);
176 do_raw_spin_unlock(lock); 175 do_raw_spin_unlock(lock);
177 preempt_enable_no_resched(); 176 __local_bh_enable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET);
178 local_bh_enable_ip((unsigned long)__builtin_return_address(0));
179} 177}
180 178
181static inline int __raw_spin_trylock_bh(raw_spinlock_t *lock) 179static inline int __raw_spin_trylock_bh(raw_spinlock_t *lock)
182{ 180{
183 local_bh_disable(); 181 __local_bh_disable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET);
184 preempt_disable();
185 if (do_raw_spin_trylock(lock)) { 182 if (do_raw_spin_trylock(lock)) {
186 spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); 183 spin_acquire(&lock->dep_map, 0, 1, _RET_IP_);
187 return 1; 184 return 1;
188 } 185 }
189 preempt_enable_no_resched(); 186 __local_bh_enable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET);
190 local_bh_enable_ip((unsigned long)__builtin_return_address(0));
191 return 0; 187 return 0;
192} 188}
193 189
diff --git a/include/linux/spinlock_api_up.h b/include/linux/spinlock_api_up.h
index af1f47229e70..d0d188861ad6 100644
--- a/include/linux/spinlock_api_up.h
+++ b/include/linux/spinlock_api_up.h
@@ -24,11 +24,14 @@
24 * flags straight, to suppress compiler warnings of unused lock 24 * flags straight, to suppress compiler warnings of unused lock
25 * variables, and to add the proper checker annotations: 25 * variables, and to add the proper checker annotations:
26 */ 26 */
27#define ___LOCK(lock) \
28 do { __acquire(lock); (void)(lock); } while (0)
29
27#define __LOCK(lock) \ 30#define __LOCK(lock) \
28 do { preempt_disable(); __acquire(lock); (void)(lock); } while (0) 31 do { preempt_disable(); ___LOCK(lock); } while (0)
29 32
30#define __LOCK_BH(lock) \ 33#define __LOCK_BH(lock) \
31 do { local_bh_disable(); __LOCK(lock); } while (0) 34 do { __local_bh_disable_ip(_THIS_IP_, SOFTIRQ_LOCK_OFFSET); ___LOCK(lock); } while (0)
32 35
33#define __LOCK_IRQ(lock) \ 36#define __LOCK_IRQ(lock) \
34 do { local_irq_disable(); __LOCK(lock); } while (0) 37 do { local_irq_disable(); __LOCK(lock); } while (0)
@@ -36,12 +39,15 @@
36#define __LOCK_IRQSAVE(lock, flags) \ 39#define __LOCK_IRQSAVE(lock, flags) \
37 do { local_irq_save(flags); __LOCK(lock); } while (0) 40 do { local_irq_save(flags); __LOCK(lock); } while (0)
38 41
42#define ___UNLOCK(lock) \
43 do { __release(lock); (void)(lock); } while (0)
44
39#define __UNLOCK(lock) \ 45#define __UNLOCK(lock) \
40 do { preempt_enable(); __release(lock); (void)(lock); } while (0) 46 do { preempt_enable(); ___UNLOCK(lock); } while (0)
41 47
42#define __UNLOCK_BH(lock) \ 48#define __UNLOCK_BH(lock) \
43 do { preempt_enable_no_resched(); local_bh_enable(); \ 49 do { __local_bh_enable_ip(_THIS_IP_, SOFTIRQ_LOCK_OFFSET); \
44 __release(lock); (void)(lock); } while (0) 50 ___UNLOCK(lock); } while (0)
45 51
46#define __UNLOCK_IRQ(lock) \ 52#define __UNLOCK_IRQ(lock) \
47 do { local_irq_enable(); __UNLOCK(lock); } while (0) 53 do { local_irq_enable(); __UNLOCK(lock); } while (0)
diff --git a/include/linux/splice.h b/include/linux/splice.h
index 74575cbf2d6f..0e43906d2fda 100644
--- a/include/linux/splice.h
+++ b/include/linux/splice.h
@@ -24,7 +24,8 @@
24 * Passed to the actors 24 * Passed to the actors
25 */ 25 */
26struct splice_desc { 26struct splice_desc {
27 unsigned int len, total_len; /* current and remaining length */ 27 size_t total_len; /* remaining length */
28 unsigned int len; /* current length */
28 unsigned int flags; /* splice flags */ 29 unsigned int flags; /* splice flags */
29 /* 30 /*
30 * actor() private data 31 * actor() private data
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index c64999fd1660..07ef9b82b66d 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -486,6 +486,7 @@ struct ssb_bus {
486#endif /* EMBEDDED */ 486#endif /* EMBEDDED */
487#ifdef CONFIG_SSB_DRIVER_GPIO 487#ifdef CONFIG_SSB_DRIVER_GPIO
488 struct gpio_chip gpio; 488 struct gpio_chip gpio;
489 struct irq_domain *irq_domain;
489#endif /* DRIVER_GPIO */ 490#endif /* DRIVER_GPIO */
490 491
491 /* Internal-only stuff follows. Do not touch. */ 492 /* Internal-only stuff follows. Do not touch. */
diff --git a/include/linux/ssbi.h b/include/linux/ssbi.h
index 44ef5da21470..bcbb642a7641 100644
--- a/include/linux/ssbi.h
+++ b/include/linux/ssbi.h
@@ -17,22 +17,7 @@
17 17
18#include <linux/types.h> 18#include <linux/types.h>
19 19
20struct ssbi_slave_info { 20int ssbi_write(struct device *dev, u16 addr, const u8 *buf, int len);
21 const char *name;
22 void *platform_data;
23};
24
25enum ssbi_controller_type {
26 MSM_SBI_CTRL_SSBI = 0,
27 MSM_SBI_CTRL_SSBI2,
28 MSM_SBI_CTRL_PMIC_ARBITER,
29};
30
31struct ssbi_platform_data {
32 struct ssbi_slave_info slave;
33 enum ssbi_controller_type controller_type;
34};
35
36int ssbi_write(struct device *dev, u16 addr, u8 *buf, int len);
37int ssbi_read(struct device *dev, u16 addr, u8 *buf, int len); 21int ssbi_read(struct device *dev, u16 addr, u8 *buf, int len);
22
38#endif 23#endif
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index bb5deb0feb6b..6f27d4f957bd 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -110,12 +110,34 @@ struct plat_stmmacenet_data {
110 int force_sf_dma_mode; 110 int force_sf_dma_mode;
111 int force_thresh_dma_mode; 111 int force_thresh_dma_mode;
112 int riwt_off; 112 int riwt_off;
113 int max_speed;
114 int maxmtu;
113 void (*fix_mac_speed)(void *priv, unsigned int speed); 115 void (*fix_mac_speed)(void *priv, unsigned int speed);
114 void (*bus_setup)(void __iomem *ioaddr); 116 void (*bus_setup)(void __iomem *ioaddr);
115 int (*init)(struct platform_device *pdev); 117 void *(*setup)(struct platform_device *pdev);
116 void (*exit)(struct platform_device *pdev); 118 void (*free)(struct platform_device *pdev, void *priv);
119 int (*init)(struct platform_device *pdev, void *priv);
120 void (*exit)(struct platform_device *pdev, void *priv);
117 void *custom_cfg; 121 void *custom_cfg;
118 void *custom_data; 122 void *custom_data;
119 void *bsp_priv; 123 void *bsp_priv;
120}; 124};
125
126/* of_data for SoC glue layer device tree bindings */
127
128struct stmmac_of_data {
129 int has_gmac;
130 int enh_desc;
131 int tx_coe;
132 int rx_coe;
133 int bugged_jumbo;
134 int pmt;
135 int riwt_off;
136 void (*fix_mac_speed)(void *priv, unsigned int speed);
137 void (*bus_setup)(void __iomem *ioaddr);
138 void *(*setup)(struct platform_device *pdev);
139 void (*free)(struct platform_device *pdev, void *priv);
140 int (*init)(struct platform_device *pdev, void *priv);
141 void (*exit)(struct platform_device *pdev, void *priv);
142};
121#endif 143#endif
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h
index a353e0300b54..7f490bef9e99 100644
--- a/include/linux/sunrpc/rpc_pipe_fs.h
+++ b/include/linux/sunrpc/rpc_pipe_fs.h
@@ -84,7 +84,8 @@ enum {
84 84
85extern struct dentry *rpc_d_lookup_sb(const struct super_block *sb, 85extern struct dentry *rpc_d_lookup_sb(const struct super_block *sb,
86 const unsigned char *dir_name); 86 const unsigned char *dir_name);
87extern void rpc_pipefs_init_net(struct net *net); 87extern int rpc_pipefs_init_net(struct net *net);
88extern void rpc_pipefs_exit_net(struct net *net);
88extern struct super_block *rpc_get_sb_net(const struct net *net); 89extern struct super_block *rpc_get_sb_net(const struct net *net);
89extern void rpc_put_sb_net(const struct net *net); 90extern void rpc_put_sb_net(const struct net *net);
90 91
@@ -130,5 +131,7 @@ extern int rpc_unlink(struct dentry *);
130extern int register_rpc_pipefs(void); 131extern int register_rpc_pipefs(void);
131extern void unregister_rpc_pipefs(void); 132extern void unregister_rpc_pipefs(void);
132 133
134extern bool gssd_running(struct net *net);
135
133#endif 136#endif
134#endif 137#endif
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 6eecfc2e4f98..04e763221246 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -368,7 +368,7 @@ struct svc_program {
368 struct svc_program * pg_next; /* other programs (same xprt) */ 368 struct svc_program * pg_next; /* other programs (same xprt) */
369 u32 pg_prog; /* program number */ 369 u32 pg_prog; /* program number */
370 unsigned int pg_lovers; /* lowest version */ 370 unsigned int pg_lovers; /* lowest version */
371 unsigned int pg_hivers; /* lowest version */ 371 unsigned int pg_hivers; /* highest version */
372 unsigned int pg_nvers; /* number of versions */ 372 unsigned int pg_nvers; /* number of versions */
373 struct svc_version ** pg_vers; /* version array */ 373 struct svc_version ** pg_vers; /* version array */
374 char * pg_name; /* service name */ 374 char * pg_name; /* service name */
@@ -386,8 +386,10 @@ struct svc_version {
386 struct svc_procedure * vs_proc; /* per-procedure info */ 386 struct svc_procedure * vs_proc; /* per-procedure info */
387 u32 vs_xdrsize; /* xdrsize needed for this version */ 387 u32 vs_xdrsize; /* xdrsize needed for this version */
388 388
389 unsigned int vs_hidden : 1; /* Don't register with portmapper. 389 unsigned int vs_hidden : 1, /* Don't register with portmapper.
390 * Only used for nfsacl so far. */ 390 * Only used for nfsacl so far. */
391 vs_rpcb_optnl:1;/* Don't care the result of register.
392 * Only used for nfsv4. */
391 393
392 /* Override dispatch function (e.g. when caching replies). 394 /* Override dispatch function (e.g. when caching replies).
393 * A return value of 0 means drop the request. 395 * A return value of 0 means drop the request.
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 94273bbe6050..40ed9e9a77e5 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -38,6 +38,7 @@ struct rlimit;
38struct rlimit64; 38struct rlimit64;
39struct rusage; 39struct rusage;
40struct sched_param; 40struct sched_param;
41struct sched_attr;
41struct sel_arg_struct; 42struct sel_arg_struct;
42struct semaphore; 43struct semaphore;
43struct sembuf; 44struct sembuf;
@@ -279,9 +280,14 @@ asmlinkage long sys_sched_setscheduler(pid_t pid, int policy,
279 struct sched_param __user *param); 280 struct sched_param __user *param);
280asmlinkage long sys_sched_setparam(pid_t pid, 281asmlinkage long sys_sched_setparam(pid_t pid,
281 struct sched_param __user *param); 282 struct sched_param __user *param);
283asmlinkage long sys_sched_setattr(pid_t pid,
284 struct sched_attr __user *attr);
282asmlinkage long sys_sched_getscheduler(pid_t pid); 285asmlinkage long sys_sched_getscheduler(pid_t pid);
283asmlinkage long sys_sched_getparam(pid_t pid, 286asmlinkage long sys_sched_getparam(pid_t pid,
284 struct sched_param __user *param); 287 struct sched_param __user *param);
288asmlinkage long sys_sched_getattr(pid_t pid,
289 struct sched_attr __user *attr,
290 unsigned int size);
285asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len, 291asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len,
286 unsigned long __user *user_mask_ptr); 292 unsigned long __user *user_mask_ptr);
287asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len, 293asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len,
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 6695040a0317..30b2ebee6439 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -12,6 +12,7 @@
12#ifndef _SYSFS_H_ 12#ifndef _SYSFS_H_
13#define _SYSFS_H_ 13#define _SYSFS_H_
14 14
15#include <linux/kernfs.h>
15#include <linux/compiler.h> 16#include <linux/compiler.h>
16#include <linux/errno.h> 17#include <linux/errno.h>
17#include <linux/list.h> 18#include <linux/list.h>
@@ -175,8 +176,6 @@ struct sysfs_ops {
175 ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t); 176 ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t);
176}; 177};
177 178
178struct sysfs_dirent;
179
180#ifdef CONFIG_SYSFS 179#ifdef CONFIG_SYSFS
181 180
182int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *), 181int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *),
@@ -244,12 +243,6 @@ void sysfs_remove_link_from_group(struct kobject *kobj, const char *group_name,
244 const char *link_name); 243 const char *link_name);
245 244
246void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); 245void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr);
247void sysfs_notify_dirent(struct sysfs_dirent *sd);
248struct sysfs_dirent *sysfs_get_dirent_ns(struct sysfs_dirent *parent_sd,
249 const unsigned char *name,
250 const void *ns);
251struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd);
252void sysfs_put(struct sysfs_dirent *sd);
253 246
254int __must_check sysfs_init(void); 247int __must_check sysfs_init(void);
255 248
@@ -419,22 +412,6 @@ static inline void sysfs_notify(struct kobject *kobj, const char *dir,
419 const char *attr) 412 const char *attr)
420{ 413{
421} 414}
422static inline void sysfs_notify_dirent(struct sysfs_dirent *sd)
423{
424}
425static inline struct sysfs_dirent *
426sysfs_get_dirent_ns(struct sysfs_dirent *parent_sd, const unsigned char *name,
427 const void *ns)
428{
429 return NULL;
430}
431static inline struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd)
432{
433 return NULL;
434}
435static inline void sysfs_put(struct sysfs_dirent *sd)
436{
437}
438 415
439static inline int __must_check sysfs_init(void) 416static inline int __must_check sysfs_init(void)
440{ 417{
@@ -461,10 +438,26 @@ static inline int sysfs_rename_link(struct kobject *kobj, struct kobject *target
461 return sysfs_rename_link_ns(kobj, target, old_name, new_name, NULL); 438 return sysfs_rename_link_ns(kobj, target, old_name, new_name, NULL);
462} 439}
463 440
464static inline struct sysfs_dirent * 441static inline void sysfs_notify_dirent(struct kernfs_node *kn)
465sysfs_get_dirent(struct sysfs_dirent *parent_sd, const unsigned char *name) 442{
443 kernfs_notify(kn);
444}
445
446static inline struct kernfs_node *sysfs_get_dirent(struct kernfs_node *parent,
447 const unsigned char *name)
448{
449 return kernfs_find_and_get(parent, name);
450}
451
452static inline struct kernfs_node *sysfs_get(struct kernfs_node *kn)
453{
454 kernfs_get(kn);
455 return kn;
456}
457
458static inline void sysfs_put(struct kernfs_node *kn)
466{ 459{
467 return sysfs_get_dirent_ns(parent_sd, name, NULL); 460 kernfs_put(kn);
468} 461}
469 462
470#endif /* _SYSFS_H_ */ 463#endif /* _SYSFS_H_ */
diff --git a/include/linux/tboot.h b/include/linux/tboot.h
index c75128bed5fa..9a54b331f938 100644
--- a/include/linux/tboot.h
+++ b/include/linux/tboot.h
@@ -34,7 +34,7 @@ enum {
34}; 34};
35 35
36#ifdef CONFIG_INTEL_TXT 36#ifdef CONFIG_INTEL_TXT
37#include <acpi/acpi.h> 37#include <linux/acpi.h>
38/* used to communicate between tboot and the launched kernel */ 38/* used to communicate between tboot and the launched kernel */
39 39
40#define TB_KEY_SIZE 64 /* 512 bits */ 40#define TB_KEY_SIZE 64 /* 512 bits */
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index d68633452d9b..4ad0706d40eb 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -248,7 +248,10 @@ struct tcp_sock {
248 struct sk_buff* lost_skb_hint; 248 struct sk_buff* lost_skb_hint;
249 struct sk_buff *retransmit_skb_hint; 249 struct sk_buff *retransmit_skb_hint;
250 250
251 struct sk_buff_head out_of_order_queue; /* Out of order segments go here */ 251 /* OOO segments go in this list. Note that socket lock must be held,
252 * as we do not use sk_buff_head lock.
253 */
254 struct sk_buff_head out_of_order_queue;
252 255
253 /* SACKs data, these 2 need to be together (see tcp_options_write) */ 256 /* SACKs data, these 2 need to be together (see tcp_options_write) */
254 struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */ 257 struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */
diff --git a/include/linux/tegra-powergate.h b/include/linux/tegra-powergate.h
index fd4498329c7c..46f0a07812b4 100644
--- a/include/linux/tegra-powergate.h
+++ b/include/linux/tegra-powergate.h
@@ -19,6 +19,7 @@
19#define _MACH_TEGRA_POWERGATE_H_ 19#define _MACH_TEGRA_POWERGATE_H_
20 20
21struct clk; 21struct clk;
22struct reset_control;
22 23
23#define TEGRA_POWERGATE_CPU 0 24#define TEGRA_POWERGATE_CPU 0
24#define TEGRA_POWERGATE_3D 1 25#define TEGRA_POWERGATE_3D 1
@@ -37,14 +38,49 @@ struct clk;
37#define TEGRA_POWERGATE_CPU0 14 38#define TEGRA_POWERGATE_CPU0 14
38#define TEGRA_POWERGATE_C0NC 15 39#define TEGRA_POWERGATE_C0NC 15
39#define TEGRA_POWERGATE_C1NC 16 40#define TEGRA_POWERGATE_C1NC 16
41#define TEGRA_POWERGATE_SOR 17
40#define TEGRA_POWERGATE_DIS 18 42#define TEGRA_POWERGATE_DIS 18
41#define TEGRA_POWERGATE_DISB 19 43#define TEGRA_POWERGATE_DISB 19
42#define TEGRA_POWERGATE_XUSBA 20 44#define TEGRA_POWERGATE_XUSBA 20
43#define TEGRA_POWERGATE_XUSBB 21 45#define TEGRA_POWERGATE_XUSBB 21
44#define TEGRA_POWERGATE_XUSBC 22 46#define TEGRA_POWERGATE_XUSBC 22
47#define TEGRA_POWERGATE_VIC 23
48#define TEGRA_POWERGATE_IRAM 24
45 49
46#define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D 50#define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D
47 51
52#define TEGRA_IO_RAIL_CSIA 0
53#define TEGRA_IO_RAIL_CSIB 1
54#define TEGRA_IO_RAIL_DSI 2
55#define TEGRA_IO_RAIL_MIPI_BIAS 3
56#define TEGRA_IO_RAIL_PEX_BIAS 4
57#define TEGRA_IO_RAIL_PEX_CLK1 5
58#define TEGRA_IO_RAIL_PEX_CLK2 6
59#define TEGRA_IO_RAIL_USB0 9
60#define TEGRA_IO_RAIL_USB1 10
61#define TEGRA_IO_RAIL_USB2 11
62#define TEGRA_IO_RAIL_USB_BIAS 12
63#define TEGRA_IO_RAIL_NAND 13
64#define TEGRA_IO_RAIL_UART 14
65#define TEGRA_IO_RAIL_BB 15
66#define TEGRA_IO_RAIL_AUDIO 17
67#define TEGRA_IO_RAIL_HSIC 19
68#define TEGRA_IO_RAIL_COMP 22
69#define TEGRA_IO_RAIL_HDMI 28
70#define TEGRA_IO_RAIL_PEX_CNTRL 32
71#define TEGRA_IO_RAIL_SDMMC1 33
72#define TEGRA_IO_RAIL_SDMMC3 34
73#define TEGRA_IO_RAIL_SDMMC4 35
74#define TEGRA_IO_RAIL_CAM 36
75#define TEGRA_IO_RAIL_RES 37
76#define TEGRA_IO_RAIL_HV 38
77#define TEGRA_IO_RAIL_DSIB 39
78#define TEGRA_IO_RAIL_DSIC 40
79#define TEGRA_IO_RAIL_DSID 41
80#define TEGRA_IO_RAIL_CSIE 44
81#define TEGRA_IO_RAIL_LVDS 57
82#define TEGRA_IO_RAIL_SYS_DDC 58
83
48#ifdef CONFIG_ARCH_TEGRA 84#ifdef CONFIG_ARCH_TEGRA
49int tegra_powergate_is_powered(int id); 85int tegra_powergate_is_powered(int id);
50int tegra_powergate_power_on(int id); 86int tegra_powergate_power_on(int id);
@@ -52,7 +88,11 @@ int tegra_powergate_power_off(int id);
52int tegra_powergate_remove_clamping(int id); 88int tegra_powergate_remove_clamping(int id);
53 89
54/* Must be called with clk disabled, and returns with clk enabled */ 90/* Must be called with clk disabled, and returns with clk enabled */
55int tegra_powergate_sequence_power_up(int id, struct clk *clk); 91int tegra_powergate_sequence_power_up(int id, struct clk *clk,
92 struct reset_control *rst);
93
94int tegra_io_rail_power_on(int id);
95int tegra_io_rail_power_off(int id);
56#else 96#else
57static inline int tegra_powergate_is_powered(int id) 97static inline int tegra_powergate_is_powered(int id)
58{ 98{
@@ -74,7 +114,18 @@ static inline int tegra_powergate_remove_clamping(int id)
74 return -ENOSYS; 114 return -ENOSYS;
75} 115}
76 116
77static inline int tegra_powergate_sequence_power_up(int id, struct clk *clk) 117static inline int tegra_powergate_sequence_power_up(int id, struct clk *clk,
118 struct reset_control *rst)
119{
120 return -ENOSYS;
121}
122
123static inline int tegra_io_rail_power_on(int id)
124{
125 return -ENOSYS;
126}
127
128static inline int tegra_io_rail_power_off(int id)
78{ 129{
79 return -ENOSYS; 130 return -ENOSYS;
80} 131}
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index b268d3cf7ae3..f7e11c7ea7d9 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -25,6 +25,7 @@
25#ifndef __THERMAL_H__ 25#ifndef __THERMAL_H__
26#define __THERMAL_H__ 26#define __THERMAL_H__
27 27
28#include <linux/of.h>
28#include <linux/idr.h> 29#include <linux/idr.h>
29#include <linux/device.h> 30#include <linux/device.h>
30#include <linux/workqueue.h> 31#include <linux/workqueue.h>
@@ -143,6 +144,7 @@ struct thermal_cooling_device {
143 int id; 144 int id;
144 char type[THERMAL_NAME_LENGTH]; 145 char type[THERMAL_NAME_LENGTH];
145 struct device device; 146 struct device device;
147 struct device_node *np;
146 void *devdata; 148 void *devdata;
147 const struct thermal_cooling_device_ops *ops; 149 const struct thermal_cooling_device_ops *ops;
148 bool updated; /* true if the cooling device does not need update */ 150 bool updated; /* true if the cooling device does not need update */
@@ -172,7 +174,7 @@ struct thermal_zone_device {
172 int emul_temperature; 174 int emul_temperature;
173 int passive; 175 int passive;
174 unsigned int forced_passive; 176 unsigned int forced_passive;
175 const struct thermal_zone_device_ops *ops; 177 struct thermal_zone_device_ops *ops;
176 const struct thermal_zone_params *tzp; 178 const struct thermal_zone_params *tzp;
177 struct thermal_governor *governor; 179 struct thermal_governor *governor;
178 struct list_head thermal_instances; 180 struct list_head thermal_instances;
@@ -242,8 +244,31 @@ struct thermal_genl_event {
242}; 244};
243 245
244/* Function declarations */ 246/* Function declarations */
247#ifdef CONFIG_THERMAL_OF
248struct thermal_zone_device *
249thermal_zone_of_sensor_register(struct device *dev, int id,
250 void *data, int (*get_temp)(void *, long *),
251 int (*get_trend)(void *, long *));
252void thermal_zone_of_sensor_unregister(struct device *dev,
253 struct thermal_zone_device *tz);
254#else
255static inline struct thermal_zone_device *
256thermal_zone_of_sensor_register(struct device *dev, int id,
257 void *data, int (*get_temp)(void *, long *),
258 int (*get_trend)(void *, long *))
259{
260 return NULL;
261}
262
263static inline
264void thermal_zone_of_sensor_unregister(struct device *dev,
265 struct thermal_zone_device *tz)
266{
267}
268
269#endif
245struct thermal_zone_device *thermal_zone_device_register(const char *, int, int, 270struct thermal_zone_device *thermal_zone_device_register(const char *, int, int,
246 void *, const struct thermal_zone_device_ops *, 271 void *, struct thermal_zone_device_ops *,
247 const struct thermal_zone_params *, int, int); 272 const struct thermal_zone_params *, int, int);
248void thermal_zone_device_unregister(struct thermal_zone_device *); 273void thermal_zone_device_unregister(struct thermal_zone_device *);
249 274
@@ -256,6 +281,9 @@ void thermal_zone_device_update(struct thermal_zone_device *);
256 281
257struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, 282struct thermal_cooling_device *thermal_cooling_device_register(char *, void *,
258 const struct thermal_cooling_device_ops *); 283 const struct thermal_cooling_device_ops *);
284struct thermal_cooling_device *
285thermal_of_cooling_device_register(struct device_node *np, char *, void *,
286 const struct thermal_cooling_device_ops *);
259void thermal_cooling_device_unregister(struct thermal_cooling_device *); 287void thermal_cooling_device_unregister(struct thermal_cooling_device *);
260struct thermal_zone_device *thermal_zone_get_zone_by_name(const char *name); 288struct thermal_zone_device *thermal_zone_get_zone_by_name(const char *name);
261int thermal_zone_get_temp(struct thermal_zone_device *tz, unsigned long *temp); 289int thermal_zone_get_temp(struct thermal_zone_device *tz, unsigned long *temp);
diff --git a/include/linux/tick.h b/include/linux/tick.h
index 5128d33bbb39..b84773cb9f4c 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -104,7 +104,7 @@ extern struct cpumask *tick_get_broadcast_oneshot_mask(void);
104extern void tick_clock_notify(void); 104extern void tick_clock_notify(void);
105extern int tick_check_oneshot_change(int allow_nohz); 105extern int tick_check_oneshot_change(int allow_nohz);
106extern struct tick_sched *tick_get_tick_sched(int cpu); 106extern struct tick_sched *tick_get_tick_sched(int cpu);
107extern void tick_check_idle(int cpu); 107extern void tick_irq_enter(void);
108extern int tick_oneshot_mode_active(void); 108extern int tick_oneshot_mode_active(void);
109# ifndef arch_needs_cpu 109# ifndef arch_needs_cpu
110# define arch_needs_cpu(cpu) (0) 110# define arch_needs_cpu(cpu) (0)
@@ -112,7 +112,7 @@ extern int tick_oneshot_mode_active(void);
112# else 112# else
113static inline void tick_clock_notify(void) { } 113static inline void tick_clock_notify(void) { }
114static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } 114static inline int tick_check_oneshot_change(int allow_nohz) { return 0; }
115static inline void tick_check_idle(int cpu) { } 115static inline void tick_irq_enter(void) { }
116static inline int tick_oneshot_mode_active(void) { return 0; } 116static inline int tick_oneshot_mode_active(void) { return 0; }
117# endif 117# endif
118 118
@@ -121,7 +121,7 @@ static inline void tick_init(void) { }
121static inline void tick_cancel_sched_timer(int cpu) { } 121static inline void tick_cancel_sched_timer(int cpu) { }
122static inline void tick_clock_notify(void) { } 122static inline void tick_clock_notify(void) { }
123static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } 123static inline int tick_check_oneshot_change(int allow_nohz) { return 0; }
124static inline void tick_check_idle(int cpu) { } 124static inline void tick_irq_enter(void) { }
125static inline int tick_oneshot_mode_active(void) { return 0; } 125static inline int tick_oneshot_mode_active(void) { return 0; }
126#endif /* !CONFIG_GENERIC_CLOCKEVENTS */ 126#endif /* !CONFIG_GENERIC_CLOCKEVENTS */
127 127
@@ -165,7 +165,7 @@ extern cpumask_var_t tick_nohz_full_mask;
165 165
166static inline bool tick_nohz_full_enabled(void) 166static inline bool tick_nohz_full_enabled(void)
167{ 167{
168 if (!static_key_false(&context_tracking_enabled)) 168 if (!context_tracking_is_enabled())
169 return false; 169 return false;
170 170
171 return tick_nohz_full_running; 171 return tick_nohz_full_running;
diff --git a/include/linux/tpm.h b/include/linux/tpm.h
index 9a9051bb1a03..fff1d0976f80 100644
--- a/include/linux/tpm.h
+++ b/include/linux/tpm.h
@@ -29,6 +29,18 @@
29 */ 29 */
30#define TPM_ANY_NUM 0xFFFF 30#define TPM_ANY_NUM 0xFFFF
31 31
32struct tpm_chip;
33
34struct tpm_class_ops {
35 const u8 req_complete_mask;
36 const u8 req_complete_val;
37 bool (*req_canceled)(struct tpm_chip *chip, u8 status);
38 int (*recv) (struct tpm_chip *chip, u8 *buf, size_t len);
39 int (*send) (struct tpm_chip *chip, u8 *buf, size_t len);
40 void (*cancel) (struct tpm_chip *chip);
41 u8 (*status) (struct tpm_chip *chip);
42};
43
32#if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE) 44#if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE)
33 45
34extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf); 46extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf);
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 97d660ed70c1..90b4fdc8a61f 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -39,10 +39,14 @@ struct tty_buffer {
39 int size; 39 int size;
40 int commit; 40 int commit;
41 int read; 41 int read;
42 int flags;
42 /* Data points here */ 43 /* Data points here */
43 unsigned long data[0]; 44 unsigned long data[0];
44}; 45};
45 46
47/* Values for .flags field of tty_buffer */
48#define TTYB_NORMAL 1 /* buffer has no flags buffer */
49
46static inline unsigned char *char_buf_ptr(struct tty_buffer *b, int ofs) 50static inline unsigned char *char_buf_ptr(struct tty_buffer *b, int ofs)
47{ 51{
48 return ((unsigned char *)b->data) + ofs; 52 return ((unsigned char *)b->data) + ofs;
@@ -60,7 +64,8 @@ struct tty_bufhead {
60 atomic_t priority; 64 atomic_t priority;
61 struct tty_buffer sentinel; 65 struct tty_buffer sentinel;
62 struct llist_head free; /* Free queue head */ 66 struct llist_head free; /* Free queue head */
63 atomic_t memory_used; /* In-use buffers excluding free list */ 67 atomic_t mem_used; /* In-use buffers excluding free list */
68 int mem_limit;
64 struct tty_buffer *tail; /* Active buffer */ 69 struct tty_buffer *tail; /* Active buffer */
65}; 70};
66/* 71/*
@@ -137,6 +142,7 @@ struct tty_bufhead {
137#define C_CLOCAL(tty) _C_FLAG((tty), CLOCAL) 142#define C_CLOCAL(tty) _C_FLAG((tty), CLOCAL)
138#define C_CIBAUD(tty) _C_FLAG((tty), CIBAUD) 143#define C_CIBAUD(tty) _C_FLAG((tty), CIBAUD)
139#define C_CRTSCTS(tty) _C_FLAG((tty), CRTSCTS) 144#define C_CRTSCTS(tty) _C_FLAG((tty), CRTSCTS)
145#define C_CMSPAR(tty) _C_FLAG((tty), CMSPAR)
140 146
141#define L_ISIG(tty) _L_FLAG((tty), ISIG) 147#define L_ISIG(tty) _L_FLAG((tty), ISIG)
142#define L_ICANON(tty) _L_FLAG((tty), ICANON) 148#define L_ICANON(tty) _L_FLAG((tty), ICANON)
@@ -422,7 +428,6 @@ extern int is_ignored(int sig);
422extern int tty_signal(int sig, struct tty_struct *tty); 428extern int tty_signal(int sig, struct tty_struct *tty);
423extern void tty_hangup(struct tty_struct *tty); 429extern void tty_hangup(struct tty_struct *tty);
424extern void tty_vhangup(struct tty_struct *tty); 430extern void tty_vhangup(struct tty_struct *tty);
425extern void tty_vhangup_locked(struct tty_struct *tty);
426extern void tty_unhangup(struct file *filp); 431extern void tty_unhangup(struct file *filp);
427extern int tty_hung_up_p(struct file *filp); 432extern int tty_hung_up_p(struct file *filp);
428extern void do_SAK(struct tty_struct *tty); 433extern void do_SAK(struct tty_struct *tty);
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h
index 21ddd7d9ea1f..c28dd523f96e 100644
--- a/include/linux/tty_flip.h
+++ b/include/linux/tty_flip.h
@@ -1,6 +1,7 @@
1#ifndef _LINUX_TTY_FLIP_H 1#ifndef _LINUX_TTY_FLIP_H
2#define _LINUX_TTY_FLIP_H 2#define _LINUX_TTY_FLIP_H
3 3
4extern int tty_buffer_set_limit(struct tty_port *port, int limit);
4extern int tty_buffer_space_avail(struct tty_port *port); 5extern int tty_buffer_space_avail(struct tty_port *port);
5extern int tty_buffer_request_room(struct tty_port *port, size_t size); 6extern int tty_buffer_request_room(struct tty_port *port, size_t size);
6extern int tty_insert_flip_string_flags(struct tty_port *port, 7extern int tty_insert_flip_string_flags(struct tty_port *port,
@@ -9,8 +10,6 @@ extern int tty_insert_flip_string_fixed_flag(struct tty_port *port,
9 const unsigned char *chars, char flag, size_t size); 10 const unsigned char *chars, char flag, size_t size);
10extern int tty_prepare_flip_string(struct tty_port *port, 11extern int tty_prepare_flip_string(struct tty_port *port,
11 unsigned char **chars, size_t size); 12 unsigned char **chars, size_t size);
12extern int tty_prepare_flip_string_flags(struct tty_port *port,
13 unsigned char **chars, char **flags, size_t size);
14extern void tty_flip_buffer_push(struct tty_port *port); 13extern void tty_flip_buffer_push(struct tty_port *port);
15void tty_schedule_flip(struct tty_port *port); 14void tty_schedule_flip(struct tty_port *port);
16 15
@@ -18,8 +17,12 @@ static inline int tty_insert_flip_char(struct tty_port *port,
18 unsigned char ch, char flag) 17 unsigned char ch, char flag)
19{ 18{
20 struct tty_buffer *tb = port->buf.tail; 19 struct tty_buffer *tb = port->buf.tail;
21 if (tb && tb->used < tb->size) { 20 int change;
22 *flag_buf_ptr(tb, tb->used) = flag; 21
22 change = (tb->flags & TTYB_NORMAL) && (flag != TTY_NORMAL);
23 if (!change && tb->used < tb->size) {
24 if (~tb->flags & TTYB_NORMAL)
25 *flag_buf_ptr(tb, tb->used) = flag;
23 *char_buf_ptr(tb, tb->used++) = ch; 26 *char_buf_ptr(tb, tb->used++) = ch;
24 return 1; 27 return 1;
25 } 28 }
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h
index f15c898ff462..b8347c207cb8 100644
--- a/include/linux/tty_ldisc.h
+++ b/include/linux/tty_ldisc.h
@@ -84,7 +84,8 @@
84 * processing. <cp> is a pointer to the buffer of input 84 * processing. <cp> is a pointer to the buffer of input
85 * character received by the device. <fp> is a pointer to a 85 * character received by the device. <fp> is a pointer to a
86 * pointer of flag bytes which indicate whether a character was 86 * pointer of flag bytes which indicate whether a character was
87 * received with a parity error, etc. 87 * received with a parity error, etc. <fp> may be NULL to indicate
88 * all data received is TTY_NORMAL.
88 * 89 *
89 * void (*write_wakeup)(struct tty_struct *); 90 * void (*write_wakeup)(struct tty_struct *);
90 * 91 *
@@ -118,7 +119,8 @@
118 * processing. <cp> is a pointer to the buffer of input 119 * processing. <cp> is a pointer to the buffer of input
119 * character received by the device. <fp> is a pointer to a 120 * character received by the device. <fp> is a pointer to a
120 * pointer of flag bytes which indicate whether a character was 121 * pointer of flag bytes which indicate whether a character was
121 * received with a parity error, etc. 122 * received with a parity error, etc. <fp> may be NULL to indicate
123 * all data received is TTY_NORMAL.
122 * If assigned, prefer this function for automatic flow control. 124 * If assigned, prefer this function for automatic flow control.
123 */ 125 */
124 126
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h
index 9d8cf056e661..ecd3319dac33 100644
--- a/include/linux/uaccess.h
+++ b/include/linux/uaccess.h
@@ -25,13 +25,16 @@ static inline void pagefault_disable(void)
25 25
26static inline void pagefault_enable(void) 26static inline void pagefault_enable(void)
27{ 27{
28#ifndef CONFIG_PREEMPT
28 /* 29 /*
29 * make sure to issue those last loads/stores before enabling 30 * make sure to issue those last loads/stores before enabling
30 * the pagefault handler again. 31 * the pagefault handler again.
31 */ 32 */
32 barrier(); 33 barrier();
33 preempt_count_dec(); 34 preempt_count_dec();
34 preempt_check_resched(); 35#else
36 preempt_enable();
37#endif
35} 38}
36 39
37#ifndef ARCH_HAS_NOCACHE_UACCESS 40#ifndef ARCH_HAS_NOCACHE_UACCESS
diff --git a/include/linux/uidgid.h b/include/linux/uidgid.h
index 8e522cbcef29..2d1f9b627f91 100644
--- a/include/linux/uidgid.h
+++ b/include/linux/uidgid.h
@@ -17,8 +17,6 @@
17struct user_namespace; 17struct user_namespace;
18extern struct user_namespace init_user_ns; 18extern struct user_namespace init_user_ns;
19 19
20#ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS
21
22typedef struct { 20typedef struct {
23 uid_t val; 21 uid_t val;
24} kuid_t; 22} kuid_t;
@@ -41,26 +39,6 @@ static inline gid_t __kgid_val(kgid_t gid)
41 return gid.val; 39 return gid.val;
42} 40}
43 41
44#else
45
46typedef uid_t kuid_t;
47typedef gid_t kgid_t;
48
49static inline uid_t __kuid_val(kuid_t uid)
50{
51 return uid;
52}
53
54static inline gid_t __kgid_val(kgid_t gid)
55{
56 return gid;
57}
58
59#define KUIDT_INIT(value) ((kuid_t) value )
60#define KGIDT_INIT(value) ((kgid_t) value )
61
62#endif
63
64#define GLOBAL_ROOT_UID KUIDT_INIT(0) 42#define GLOBAL_ROOT_UID KUIDT_INIT(0)
65#define GLOBAL_ROOT_GID KGIDT_INIT(0) 43#define GLOBAL_ROOT_GID KGIDT_INIT(0)
66 44
diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h
index 319eae70fe84..e32251e00e62 100644
--- a/include/linux/uprobes.h
+++ b/include/linux/uprobes.h
@@ -26,16 +26,13 @@
26 26
27#include <linux/errno.h> 27#include <linux/errno.h>
28#include <linux/rbtree.h> 28#include <linux/rbtree.h>
29#include <linux/types.h>
29 30
30struct vm_area_struct; 31struct vm_area_struct;
31struct mm_struct; 32struct mm_struct;
32struct inode; 33struct inode;
33struct notifier_block; 34struct notifier_block;
34 35
35#ifdef CONFIG_ARCH_SUPPORTS_UPROBES
36# include <asm/uprobes.h>
37#endif
38
39#define UPROBE_HANDLER_REMOVE 1 36#define UPROBE_HANDLER_REMOVE 1
40#define UPROBE_HANDLER_MASK 1 37#define UPROBE_HANDLER_MASK 1
41 38
@@ -60,6 +57,8 @@ struct uprobe_consumer {
60}; 57};
61 58
62#ifdef CONFIG_UPROBES 59#ifdef CONFIG_UPROBES
60#include <asm/uprobes.h>
61
63enum uprobe_task_state { 62enum uprobe_task_state {
64 UTASK_RUNNING, 63 UTASK_RUNNING,
65 UTASK_SSTEP, 64 UTASK_SSTEP,
@@ -72,35 +71,28 @@ enum uprobe_task_state {
72 */ 71 */
73struct uprobe_task { 72struct uprobe_task {
74 enum uprobe_task_state state; 73 enum uprobe_task_state state;
75 struct arch_uprobe_task autask;
76 74
77 struct return_instance *return_instances; 75 union {
78 unsigned int depth; 76 struct {
79 struct uprobe *active_uprobe; 77 struct arch_uprobe_task autask;
78 unsigned long vaddr;
79 };
80 80
81 struct {
82 struct callback_head dup_xol_work;
83 unsigned long dup_xol_addr;
84 };
85 };
86
87 struct uprobe *active_uprobe;
81 unsigned long xol_vaddr; 88 unsigned long xol_vaddr;
82 unsigned long vaddr;
83};
84 89
85/* 90 struct return_instance *return_instances;
86 * On a breakpoint hit, thread contests for a slot. It frees the 91 unsigned int depth;
87 * slot after singlestep. Currently a fixed number of slots are
88 * allocated.
89 */
90struct xol_area {
91 wait_queue_head_t wq; /* if all slots are busy */
92 atomic_t slot_count; /* number of in-use slots */
93 unsigned long *bitmap; /* 0 = free slot */
94 struct page *page;
95
96 /*
97 * We keep the vma's vm_start rather than a pointer to the vma
98 * itself. The probed process or a naughty kernel module could make
99 * the vma go away, and we must handle that reasonably gracefully.
100 */
101 unsigned long vaddr; /* Page(s) of instruction slots */
102}; 92};
103 93
94struct xol_area;
95
104struct uprobes_state { 96struct uprobes_state {
105 struct xol_area *xol_area; 97 struct xol_area *xol_area;
106}; 98};
@@ -109,6 +101,7 @@ extern int __weak set_swbp(struct arch_uprobe *aup, struct mm_struct *mm, unsign
109extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); 101extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr);
110extern bool __weak is_swbp_insn(uprobe_opcode_t *insn); 102extern bool __weak is_swbp_insn(uprobe_opcode_t *insn);
111extern bool __weak is_trap_insn(uprobe_opcode_t *insn); 103extern bool __weak is_trap_insn(uprobe_opcode_t *insn);
104extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs);
112extern int uprobe_write_opcode(struct mm_struct *mm, unsigned long vaddr, uprobe_opcode_t); 105extern int uprobe_write_opcode(struct mm_struct *mm, unsigned long vaddr, uprobe_opcode_t);
113extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); 106extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc);
114extern int uprobe_apply(struct inode *inode, loff_t offset, struct uprobe_consumer *uc, bool); 107extern int uprobe_apply(struct inode *inode, loff_t offset, struct uprobe_consumer *uc, bool);
@@ -120,7 +113,6 @@ extern void uprobe_end_dup_mmap(void);
120extern void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm); 113extern void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm);
121extern void uprobe_free_utask(struct task_struct *t); 114extern void uprobe_free_utask(struct task_struct *t);
122extern void uprobe_copy_process(struct task_struct *t, unsigned long flags); 115extern void uprobe_copy_process(struct task_struct *t, unsigned long flags);
123extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs);
124extern int uprobe_post_sstep_notifier(struct pt_regs *regs); 116extern int uprobe_post_sstep_notifier(struct pt_regs *regs);
125extern int uprobe_pre_sstep_notifier(struct pt_regs *regs); 117extern int uprobe_pre_sstep_notifier(struct pt_regs *regs);
126extern void uprobe_notify_resume(struct pt_regs *regs); 118extern void uprobe_notify_resume(struct pt_regs *regs);
@@ -176,10 +168,6 @@ static inline bool uprobe_deny_signal(void)
176{ 168{
177 return false; 169 return false;
178} 170}
179static inline unsigned long uprobe_get_swbp_addr(struct pt_regs *regs)
180{
181 return 0;
182}
183static inline void uprobe_free_utask(struct task_struct *t) 171static inline void uprobe_free_utask(struct task_struct *t)
184{ 172{
185} 173}
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 512ab162832c..7f6eb859873e 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -965,6 +965,7 @@ struct usb_dynid {
965}; 965};
966 966
967extern ssize_t usb_store_new_id(struct usb_dynids *dynids, 967extern ssize_t usb_store_new_id(struct usb_dynids *dynids,
968 const struct usb_device_id *id_table,
968 struct device_driver *driver, 969 struct device_driver *driver,
969 const char *buf, size_t count); 970 const char *buf, size_t count);
970 971
@@ -1264,8 +1265,6 @@ typedef void (*usb_complete_t)(struct urb *);
1264 * @sg: scatter gather buffer list, the buffer size of each element in 1265 * @sg: scatter gather buffer list, the buffer size of each element in
1265 * the list (except the last) must be divisible by the endpoint's 1266 * the list (except the last) must be divisible by the endpoint's
1266 * max packet size if no_sg_constraint isn't set in 'struct usb_bus' 1267 * max packet size if no_sg_constraint isn't set in 'struct usb_bus'
1267 * (FIXME: scatter-gather under xHCI is broken for periodic transfers.
1268 * Do not use urb->sg for interrupt endpoints for now, only bulk.)
1269 * @num_mapped_sgs: (internal) number of mapped sg entries 1268 * @num_mapped_sgs: (internal) number of mapped sg entries
1270 * @num_sgs: number of entries in the sg list 1269 * @num_sgs: number of entries in the sg list
1271 * @transfer_buffer_length: How big is transfer_buffer. The transfer may 1270 * @transfer_buffer_length: How big is transfer_buffer. The transfer may
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h
index 7d399671a566..708bd119627f 100644
--- a/include/linux/usb/chipidea.h
+++ b/include/linux/usb/chipidea.h
@@ -24,6 +24,7 @@ struct ci_hdrc_platform_data {
24 * but otg is not supported (no register otgsc). 24 * but otg is not supported (no register otgsc).
25 */ 25 */
26#define CI_HDRC_DUAL_ROLE_NOT_OTG BIT(4) 26#define CI_HDRC_DUAL_ROLE_NOT_OTG BIT(4)
27#define CI_HDRC_IMX28_WRITE_FIX BIT(5)
27 enum usb_dr_mode dr_mode; 28 enum usb_dr_mode dr_mode;
28#define CI_HDRC_CONTROLLER_RESET_EVENT 0 29#define CI_HDRC_CONTROLLER_RESET_EVENT 0
29#define CI_HDRC_CONTROLLER_STOPPED_EVENT 1 30#define CI_HDRC_CONTROLLER_STOPPED_EVENT 1
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index 0e7a555cab1e..d3ca3b53837c 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -468,6 +468,8 @@ struct usb_function_instance {
468 struct config_group group; 468 struct config_group group;
469 struct list_head cfs_list; 469 struct list_head cfs_list;
470 struct usb_function_driver *fd; 470 struct usb_function_driver *fd;
471 int (*set_inst_name)(struct usb_function_instance *inst,
472 const char *name);
471 void (*free_func_inst)(struct usb_function_instance *inst); 473 void (*free_func_inst)(struct usb_function_instance *inst);
472}; 474};
473 475
diff --git a/include/linux/usb/functionfs.h b/include/linux/usb/functionfs.h
index 65d0a88dbc67..71190663f1ee 100644
--- a/include/linux/usb/functionfs.h
+++ b/include/linux/usb/functionfs.h
@@ -3,34 +3,4 @@
3 3
4#include <uapi/linux/usb/functionfs.h> 4#include <uapi/linux/usb/functionfs.h>
5 5
6
7struct ffs_data;
8struct usb_composite_dev;
9struct usb_configuration;
10
11
12static int functionfs_init(void) __attribute__((warn_unused_result));
13static void functionfs_cleanup(void);
14
15static int functionfs_bind(struct ffs_data *ffs, struct usb_composite_dev *cdev)
16 __attribute__((warn_unused_result, nonnull));
17static void functionfs_unbind(struct ffs_data *ffs)
18 __attribute__((nonnull));
19
20static int functionfs_bind_config(struct usb_composite_dev *cdev,
21 struct usb_configuration *c,
22 struct ffs_data *ffs)
23 __attribute__((warn_unused_result, nonnull));
24
25
26static int functionfs_ready_callback(struct ffs_data *ffs)
27 __attribute__((warn_unused_result, nonnull));
28static void functionfs_closed_callback(struct ffs_data *ffs)
29 __attribute__((nonnull));
30static void *functionfs_acquire_dev_callback(const char *dev_name)
31 __attribute__((warn_unused_result, nonnull));
32static void functionfs_release_dev_callback(struct ffs_data *ffs_data)
33 __attribute__((nonnull));
34
35
36#endif 6#endif
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 942ef5e053bf..c3a61853cd13 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -148,6 +148,9 @@ struct usb_ep_ops {
148 * @maxpacket:The maximum packet size used on this endpoint. The initial 148 * @maxpacket:The maximum packet size used on this endpoint. The initial
149 * value can sometimes be reduced (hardware allowing), according to 149 * value can sometimes be reduced (hardware allowing), according to
150 * the endpoint descriptor used to configure the endpoint. 150 * the endpoint descriptor used to configure the endpoint.
151 * @maxpacket_limit:The maximum packet size value which can be handled by this
152 * endpoint. It's set once by UDC driver when endpoint is initialized, and
153 * should not be changed. Should not be confused with maxpacket.
151 * @max_streams: The maximum number of streams supported 154 * @max_streams: The maximum number of streams supported
152 * by this EP (0 - 16, actual number is 2^n) 155 * by this EP (0 - 16, actual number is 2^n)
153 * @mult: multiplier, 'mult' value for SS Isoc EPs 156 * @mult: multiplier, 'mult' value for SS Isoc EPs
@@ -171,6 +174,7 @@ struct usb_ep {
171 const struct usb_ep_ops *ops; 174 const struct usb_ep_ops *ops;
172 struct list_head ep_list; 175 struct list_head ep_list;
173 unsigned maxpacket:16; 176 unsigned maxpacket:16;
177 unsigned maxpacket_limit:16;
174 unsigned max_streams:16; 178 unsigned max_streams:16;
175 unsigned mult:2; 179 unsigned mult:2;
176 unsigned maxburst:5; 180 unsigned maxburst:5;
@@ -182,6 +186,21 @@ struct usb_ep {
182/*-------------------------------------------------------------------------*/ 186/*-------------------------------------------------------------------------*/
183 187
184/** 188/**
189 * usb_ep_set_maxpacket_limit - set maximum packet size limit for endpoint
190 * @ep:the endpoint being configured
191 * @maxpacket_limit:value of maximum packet size limit
192 *
193 * This function shoud be used only in UDC drivers to initialize endpoint
194 * (usually in probe function).
195 */
196static inline void usb_ep_set_maxpacket_limit(struct usb_ep *ep,
197 unsigned maxpacket_limit)
198{
199 ep->maxpacket_limit = maxpacket_limit;
200 ep->maxpacket = maxpacket_limit;
201}
202
203/**
185 * usb_ep_enable - configure endpoint, making it usable 204 * usb_ep_enable - configure endpoint, making it usable
186 * @ep:the endpoint being configured. may not be the endpoint named "ep0". 205 * @ep:the endpoint being configured. may not be the endpoint named "ep0".
187 * drivers discover endpoints through the ep_list of a usb_gadget. 206 * drivers discover endpoints through the ep_list of a usb_gadget.
@@ -485,6 +504,11 @@ struct usb_gadget_ops {
485 * @max_speed: Maximal speed the UDC can handle. UDC must support this 504 * @max_speed: Maximal speed the UDC can handle. UDC must support this
486 * and all slower speeds. 505 * and all slower speeds.
487 * @state: the state we are now (attached, suspended, configured, etc) 506 * @state: the state we are now (attached, suspended, configured, etc)
507 * @name: Identifies the controller hardware type. Used in diagnostics
508 * and sometimes configuration.
509 * @dev: Driver model state for this abstract device.
510 * @out_epnum: last used out ep number
511 * @in_epnum: last used in ep number
488 * @sg_supported: true if we can handle scatter-gather 512 * @sg_supported: true if we can handle scatter-gather
489 * @is_otg: True if the USB device port uses a Mini-AB jack, so that the 513 * @is_otg: True if the USB device port uses a Mini-AB jack, so that the
490 * gadget driver must provide a USB OTG descriptor. 514 * gadget driver must provide a USB OTG descriptor.
@@ -497,11 +521,8 @@ struct usb_gadget_ops {
497 * only supports HNP on a different root port. 521 * only supports HNP on a different root port.
498 * @b_hnp_enable: OTG device feature flag, indicating that the A-Host 522 * @b_hnp_enable: OTG device feature flag, indicating that the A-Host
499 * enabled HNP support. 523 * enabled HNP support.
500 * @name: Identifies the controller hardware type. Used in diagnostics 524 * @quirk_ep_out_aligned_size: epout requires buffer size to be aligned to
501 * and sometimes configuration. 525 * MaxPacketSize.
502 * @dev: Driver model state for this abstract device.
503 * @out_epnum: last used out ep number
504 * @in_epnum: last used in ep number
505 * 526 *
506 * Gadgets have a mostly-portable "gadget driver" implementing device 527 * Gadgets have a mostly-portable "gadget driver" implementing device
507 * functions, handling all usb configurations and interfaces. Gadget 528 * functions, handling all usb configurations and interfaces. Gadget
@@ -530,16 +551,18 @@ struct usb_gadget {
530 enum usb_device_speed speed; 551 enum usb_device_speed speed;
531 enum usb_device_speed max_speed; 552 enum usb_device_speed max_speed;
532 enum usb_device_state state; 553 enum usb_device_state state;
554 const char *name;
555 struct device dev;
556 unsigned out_epnum;
557 unsigned in_epnum;
558
533 unsigned sg_supported:1; 559 unsigned sg_supported:1;
534 unsigned is_otg:1; 560 unsigned is_otg:1;
535 unsigned is_a_peripheral:1; 561 unsigned is_a_peripheral:1;
536 unsigned b_hnp_enable:1; 562 unsigned b_hnp_enable:1;
537 unsigned a_hnp_support:1; 563 unsigned a_hnp_support:1;
538 unsigned a_alt_hnp_support:1; 564 unsigned a_alt_hnp_support:1;
539 const char *name; 565 unsigned quirk_ep_out_aligned_size:1;
540 struct device dev;
541 unsigned out_epnum;
542 unsigned in_epnum;
543}; 566};
544#define work_to_gadget(w) (container_of((w), struct usb_gadget, work)) 567#define work_to_gadget(w) (container_of((w), struct usb_gadget, work))
545 568
@@ -558,6 +581,23 @@ static inline struct usb_gadget *dev_to_usb_gadget(struct device *dev)
558 581
559 582
560/** 583/**
584 * usb_ep_align_maybe - returns @len aligned to ep's maxpacketsize if gadget
585 * requires quirk_ep_out_aligned_size, otherwise reguens len.
586 * @g: controller to check for quirk
587 * @ep: the endpoint whose maxpacketsize is used to align @len
588 * @len: buffer size's length to align to @ep's maxpacketsize
589 *
590 * This helper is used in case it's required for any reason to check and maybe
591 * align buffer's size to an ep's maxpacketsize.
592 */
593static inline size_t
594usb_ep_align_maybe(struct usb_gadget *g, struct usb_ep *ep, size_t len)
595{
596 return !g->quirk_ep_out_aligned_size ? len :
597 round_up(len, (size_t)ep->desc->wMaxPacketSize);
598}
599
600/**
561 * gadget_is_dualspeed - return true iff the hardware handles high speed 601 * gadget_is_dualspeed - return true iff the hardware handles high speed
562 * @g: controller that might support both high and full speeds 602 * @g: controller that might support both high and full speeds
563 */ 603 */
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index b8aba196f7f1..efe8d8a7c7ad 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -134,6 +134,7 @@ struct usb_hcd {
134 unsigned rh_registered:1;/* is root hub registered? */ 134 unsigned rh_registered:1;/* is root hub registered? */
135 unsigned rh_pollable:1; /* may we poll the root hub? */ 135 unsigned rh_pollable:1; /* may we poll the root hub? */
136 unsigned msix_enabled:1; /* driver has MSI-X enabled? */ 136 unsigned msix_enabled:1; /* driver has MSI-X enabled? */
137 unsigned remove_phy:1; /* auto-remove USB phy */
137 138
138 /* The next flag is a stopgap, to be removed when all the HCDs 139 /* The next flag is a stopgap, to be removed when all the HCDs
139 * support the new root-hub polling mechanism. */ 140 * support the new root-hub polling mechanism. */
@@ -352,6 +353,8 @@ struct hc_driver {
352 void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *); 353 void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *);
353 /* Returns the hardware-chosen device address */ 354 /* Returns the hardware-chosen device address */
354 int (*address_device)(struct usb_hcd *, struct usb_device *udev); 355 int (*address_device)(struct usb_hcd *, struct usb_device *udev);
356 /* prepares the hardware to send commands to the device */
357 int (*enable_device)(struct usb_hcd *, struct usb_device *udev);
355 /* Notifies the HCD after a hub descriptor is fetched. 358 /* Notifies the HCD after a hub descriptor is fetched.
356 * Will block. 359 * Will block.
357 */ 360 */
diff --git a/include/linux/usb/msm_hsusb.h b/include/linux/usb/msm_hsusb.h
index 22a396c13f3a..32754835a39b 100644
--- a/include/linux/usb/msm_hsusb.h
+++ b/include/linux/usb/msm_hsusb.h
@@ -20,6 +20,7 @@
20 20
21#include <linux/types.h> 21#include <linux/types.h>
22#include <linux/usb/otg.h> 22#include <linux/usb/otg.h>
23#include <linux/clk.h>
23 24
24/** 25/**
25 * Supported USB modes 26 * Supported USB modes
@@ -135,6 +136,8 @@ struct msm_otg_platform_data {
135 enum msm_usb_phy_type phy_type; 136 enum msm_usb_phy_type phy_type;
136 void (*setup_gpio)(enum usb_otg_state state); 137 void (*setup_gpio)(enum usb_otg_state state);
137 char *pclk_src_name; 138 char *pclk_src_name;
139 int (*link_clk_reset)(struct clk *link_clk, bool assert);
140 int (*phy_clk_reset)(struct clk *phy_clk);
138}; 141};
139 142
140/** 143/**
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h
index eb505250940a..a4ee1b582183 100644
--- a/include/linux/usb/musb.h
+++ b/include/linux/usb/musb.h
@@ -76,6 +76,9 @@ struct musb_hdrc_config {
76 unsigned dma:1 __deprecated; /* supports DMA */ 76 unsigned dma:1 __deprecated; /* supports DMA */
77 unsigned vendor_req:1 __deprecated; /* vendor registers required */ 77 unsigned vendor_req:1 __deprecated; /* vendor registers required */
78 78
79 /* need to explicitly de-assert the port reset after resume? */
80 unsigned host_port_deassert_reset_at_resume:1;
81
79 u8 num_eps; /* number of endpoints _with_ ep0 */ 82 u8 num_eps; /* number of endpoints _with_ ep0 */
80 u8 dma_channels __deprecated; /* number of dma channels */ 83 u8 dma_channels __deprecated; /* number of dma channels */
81 u8 dyn_fifo_size; /* dynamic size in bytes */ 84 u8 dyn_fifo_size; /* dynamic size in bytes */
diff --git a/include/linux/usb/omap_control_usb.h b/include/linux/usb/omap_control_usb.h
index 596b01918813..69ae383ee3cc 100644
--- a/include/linux/usb/omap_control_usb.h
+++ b/include/linux/usb/omap_control_usb.h
@@ -24,6 +24,7 @@ enum omap_control_usb_type {
24 OMAP_CTRL_TYPE_USB2, /* USB2_PHY, power down in CONTROL_DEV_CONF */ 24 OMAP_CTRL_TYPE_USB2, /* USB2_PHY, power down in CONTROL_DEV_CONF */
25 OMAP_CTRL_TYPE_PIPE3, /* PIPE3 PHY, DPLL & seperate Rx/Tx power */ 25 OMAP_CTRL_TYPE_PIPE3, /* PIPE3 PHY, DPLL & seperate Rx/Tx power */
26 OMAP_CTRL_TYPE_DRA7USB2, /* USB2 PHY, power and power_aux e.g. DRA7 */ 26 OMAP_CTRL_TYPE_DRA7USB2, /* USB2 PHY, power and power_aux e.g. DRA7 */
27 OMAP_CTRL_TYPE_AM437USB2, /* USB2 PHY, power e.g. AM437x */
27}; 28};
28 29
29struct omap_control_usb { 30struct omap_control_usb {
@@ -64,6 +65,11 @@ enum omap_control_usb_mode {
64 65
65#define OMAP_CTRL_USB2_PHY_PD BIT(28) 66#define OMAP_CTRL_USB2_PHY_PD BIT(28)
66 67
68#define AM437X_CTRL_USB2_PHY_PD BIT(0)
69#define AM437X_CTRL_USB2_OTG_PD BIT(1)
70#define AM437X_CTRL_USB2_OTGVDET_EN BIT(19)
71#define AM437X_CTRL_USB2_OTGSESSEND_EN BIT(20)
72
67#if IS_ENABLED(CONFIG_OMAP_CONTROL_USB) 73#if IS_ENABLED(CONFIG_OMAP_CONTROL_USB)
68extern void omap_control_usb_phy_power(struct device *dev, int on); 74extern void omap_control_usb_phy_power(struct device *dev, int on);
69extern void omap_control_usb_set_mode(struct device *dev, 75extern void omap_control_usb_set_mode(struct device *dev,
diff --git a/include/linux/usb/otg-fsm.h b/include/linux/usb/otg-fsm.h
new file mode 100644
index 000000000000..b6ba1bfb86f2
--- /dev/null
+++ b/include/linux/usb/otg-fsm.h
@@ -0,0 +1,244 @@
1/* Copyright (C) 2007,2008 Freescale Semiconductor, Inc.
2 *
3 * This program is free software; you can redistribute it and/or modify it
4 * under the terms of the GNU General Public License as published by the
5 * Free Software Foundation; either version 2 of the License, or (at your
6 * option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 675 Mass Ave, Cambridge, MA 02139, USA.
16 */
17
18#ifndef __LINUX_USB_OTG_FSM_H
19#define __LINUX_USB_OTG_FSM_H
20
21#include <linux/mutex.h>
22#include <linux/errno.h>
23
24#undef VERBOSE
25
26#ifdef VERBOSE
27#define VDBG(fmt, args...) pr_debug("[%s] " fmt , \
28 __func__, ## args)
29#else
30#define VDBG(stuff...) do {} while (0)
31#endif
32
33#ifdef VERBOSE
34#define MPC_LOC printk("Current Location [%s]:[%d]\n", __FILE__, __LINE__)
35#else
36#define MPC_LOC do {} while (0)
37#endif
38
39#define PROTO_UNDEF (0)
40#define PROTO_HOST (1)
41#define PROTO_GADGET (2)
42
43enum otg_fsm_timer {
44 /* Standard OTG timers */
45 A_WAIT_VRISE,
46 A_WAIT_VFALL,
47 A_WAIT_BCON,
48 A_AIDL_BDIS,
49 B_ASE0_BRST,
50 A_BIDL_ADIS,
51
52 /* Auxiliary timers */
53 B_SE0_SRP,
54 B_SRP_FAIL,
55 A_WAIT_ENUM,
56
57 NUM_OTG_FSM_TIMERS,
58};
59
60/* OTG state machine according to the OTG spec */
61struct otg_fsm {
62 /* Input */
63 int id;
64 int adp_change;
65 int power_up;
66 int test_device;
67 int a_bus_drop;
68 int a_bus_req;
69 int a_srp_det;
70 int a_vbus_vld;
71 int b_conn;
72 int a_bus_resume;
73 int a_bus_suspend;
74 int a_conn;
75 int b_bus_req;
76 int b_se0_srp;
77 int b_ssend_srp;
78 int b_sess_vld;
79 /* Auxilary inputs */
80 int a_sess_vld;
81 int b_bus_resume;
82 int b_bus_suspend;
83
84 /* Output */
85 int data_pulse;
86 int drv_vbus;
87 int loc_conn;
88 int loc_sof;
89 int adp_prb;
90 int adp_sns;
91
92 /* Internal variables */
93 int a_set_b_hnp_en;
94 int b_srp_done;
95 int b_hnp_enable;
96 int a_clr_err;
97
98 /* Informative variables */
99 int a_bus_drop_inf;
100 int a_bus_req_inf;
101 int a_clr_err_inf;
102 int b_bus_req_inf;
103 /* Auxilary informative variables */
104 int a_suspend_req_inf;
105
106 /* Timeout indicator for timers */
107 int a_wait_vrise_tmout;
108 int a_wait_vfall_tmout;
109 int a_wait_bcon_tmout;
110 int a_aidl_bdis_tmout;
111 int b_ase0_brst_tmout;
112 int a_bidl_adis_tmout;
113
114 struct otg_fsm_ops *ops;
115 struct usb_otg *otg;
116
117 /* Current usb protocol used: 0:undefine; 1:host; 2:client */
118 int protocol;
119 struct mutex lock;
120};
121
122struct otg_fsm_ops {
123 void (*chrg_vbus)(struct otg_fsm *fsm, int on);
124 void (*drv_vbus)(struct otg_fsm *fsm, int on);
125 void (*loc_conn)(struct otg_fsm *fsm, int on);
126 void (*loc_sof)(struct otg_fsm *fsm, int on);
127 void (*start_pulse)(struct otg_fsm *fsm);
128 void (*start_adp_prb)(struct otg_fsm *fsm);
129 void (*start_adp_sns)(struct otg_fsm *fsm);
130 void (*add_timer)(struct otg_fsm *fsm, enum otg_fsm_timer timer);
131 void (*del_timer)(struct otg_fsm *fsm, enum otg_fsm_timer timer);
132 int (*start_host)(struct otg_fsm *fsm, int on);
133 int (*start_gadget)(struct otg_fsm *fsm, int on);
134};
135
136
137static inline int otg_chrg_vbus(struct otg_fsm *fsm, int on)
138{
139 if (!fsm->ops->chrg_vbus)
140 return -EOPNOTSUPP;
141 fsm->ops->chrg_vbus(fsm, on);
142 return 0;
143}
144
145static inline int otg_drv_vbus(struct otg_fsm *fsm, int on)
146{
147 if (!fsm->ops->drv_vbus)
148 return -EOPNOTSUPP;
149 if (fsm->drv_vbus != on) {
150 fsm->drv_vbus = on;
151 fsm->ops->drv_vbus(fsm, on);
152 }
153 return 0;
154}
155
156static inline int otg_loc_conn(struct otg_fsm *fsm, int on)
157{
158 if (!fsm->ops->loc_conn)
159 return -EOPNOTSUPP;
160 if (fsm->loc_conn != on) {
161 fsm->loc_conn = on;
162 fsm->ops->loc_conn(fsm, on);
163 }
164 return 0;
165}
166
167static inline int otg_loc_sof(struct otg_fsm *fsm, int on)
168{
169 if (!fsm->ops->loc_sof)
170 return -EOPNOTSUPP;
171 if (fsm->loc_sof != on) {
172 fsm->loc_sof = on;
173 fsm->ops->loc_sof(fsm, on);
174 }
175 return 0;
176}
177
178static inline int otg_start_pulse(struct otg_fsm *fsm)
179{
180 if (!fsm->ops->start_pulse)
181 return -EOPNOTSUPP;
182 if (!fsm->data_pulse) {
183 fsm->data_pulse = 1;
184 fsm->ops->start_pulse(fsm);
185 }
186 return 0;
187}
188
189static inline int otg_start_adp_prb(struct otg_fsm *fsm)
190{
191 if (!fsm->ops->start_adp_prb)
192 return -EOPNOTSUPP;
193 if (!fsm->adp_prb) {
194 fsm->adp_sns = 0;
195 fsm->adp_prb = 1;
196 fsm->ops->start_adp_prb(fsm);
197 }
198 return 0;
199}
200
201static inline int otg_start_adp_sns(struct otg_fsm *fsm)
202{
203 if (!fsm->ops->start_adp_sns)
204 return -EOPNOTSUPP;
205 if (!fsm->adp_sns) {
206 fsm->adp_sns = 1;
207 fsm->ops->start_adp_sns(fsm);
208 }
209 return 0;
210}
211
212static inline int otg_add_timer(struct otg_fsm *fsm, enum otg_fsm_timer timer)
213{
214 if (!fsm->ops->add_timer)
215 return -EOPNOTSUPP;
216 fsm->ops->add_timer(fsm, timer);
217 return 0;
218}
219
220static inline int otg_del_timer(struct otg_fsm *fsm, enum otg_fsm_timer timer)
221{
222 if (!fsm->ops->del_timer)
223 return -EOPNOTSUPP;
224 fsm->ops->del_timer(fsm, timer);
225 return 0;
226}
227
228static inline int otg_start_host(struct otg_fsm *fsm, int on)
229{
230 if (!fsm->ops->start_host)
231 return -EOPNOTSUPP;
232 return fsm->ops->start_host(fsm, on);
233}
234
235static inline int otg_start_gadget(struct otg_fsm *fsm, int on)
236{
237 if (!fsm->ops->start_gadget)
238 return -EOPNOTSUPP;
239 return fsm->ops->start_gadget(fsm, on);
240}
241
242int otg_statemachine(struct otg_fsm *fsm);
243
244#endif /* __LINUX_USB_OTG_FSM_H */
diff --git a/include/linux/uwb/umc.h b/include/linux/uwb/umc.h
index 891d1d5f3947..ba82f03d8287 100644
--- a/include/linux/uwb/umc.h
+++ b/include/linux/uwb/umc.h
@@ -143,7 +143,7 @@ int umc_match_pci_id(struct umc_driver *umc_drv, struct umc_dev *umc);
143static inline struct pci_dev *umc_parent_pci_dev(struct umc_dev *umc_dev) 143static inline struct pci_dev *umc_parent_pci_dev(struct umc_dev *umc_dev)
144{ 144{
145 struct pci_dev *pci_dev = NULL; 145 struct pci_dev *pci_dev = NULL;
146 if (umc_dev->dev.parent->bus == &pci_bus_type) 146 if (dev_is_pci(umc_dev->dev.parent))
147 pci_dev = to_pci_dev(umc_dev->dev.parent); 147 pci_dev = to_pci_dev(umc_dev->dev.parent);
148 return pci_dev; 148 return pci_dev;
149} 149}
diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h
index c557c6d096de..3a712e2e7d76 100644
--- a/include/linux/vm_event_item.h
+++ b/include/linux/vm_event_item.h
@@ -71,12 +71,14 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
71 THP_ZERO_PAGE_ALLOC, 71 THP_ZERO_PAGE_ALLOC,
72 THP_ZERO_PAGE_ALLOC_FAILED, 72 THP_ZERO_PAGE_ALLOC_FAILED,
73#endif 73#endif
74#ifdef CONFIG_DEBUG_TLBFLUSH
74#ifdef CONFIG_SMP 75#ifdef CONFIG_SMP
75 NR_TLB_REMOTE_FLUSH, /* cpu tried to flush others' tlbs */ 76 NR_TLB_REMOTE_FLUSH, /* cpu tried to flush others' tlbs */
76 NR_TLB_REMOTE_FLUSH_RECEIVED,/* cpu received ipi for flush */ 77 NR_TLB_REMOTE_FLUSH_RECEIVED,/* cpu received ipi for flush */
77#endif 78#endif /* CONFIG_SMP */
78 NR_TLB_LOCAL_FLUSH_ALL, 79 NR_TLB_LOCAL_FLUSH_ALL,
79 NR_TLB_LOCAL_FLUSH_ONE, 80 NR_TLB_LOCAL_FLUSH_ONE,
81#endif /* CONFIG_DEBUG_TLBFLUSH */
80 NR_VM_EVENT_ITEMS 82 NR_VM_EVENT_ITEMS
81}; 83};
82 84
diff --git a/include/linux/vme.h b/include/linux/vme.h
index c9d65bf14cec..8cd6f19ca518 100644
--- a/include/linux/vme.h
+++ b/include/linux/vme.h
@@ -164,7 +164,8 @@ int vme_lm_attach(struct vme_resource *, int, void (*callback)(int));
164int vme_lm_detach(struct vme_resource *, int); 164int vme_lm_detach(struct vme_resource *, int);
165void vme_lm_free(struct vme_resource *); 165void vme_lm_free(struct vme_resource *);
166 166
167int vme_slot_get(struct vme_dev *); 167int vme_slot_num(struct vme_dev *);
168int vme_bus_num(struct vme_dev *);
168 169
169int vme_register_driver(struct vme_driver *, unsigned int); 170int vme_register_driver(struct vme_driver *, unsigned int);
170void vme_unregister_driver(struct vme_driver *); 171void vme_unregister_driver(struct vme_driver *);
diff --git a/include/linux/vmpressure.h b/include/linux/vmpressure.h
index 3f3788d49362..3e4535876d37 100644
--- a/include/linux/vmpressure.h
+++ b/include/linux/vmpressure.h
@@ -7,6 +7,7 @@
7#include <linux/gfp.h> 7#include <linux/gfp.h>
8#include <linux/types.h> 8#include <linux/types.h>
9#include <linux/cgroup.h> 9#include <linux/cgroup.h>
10#include <linux/eventfd.h>
10 11
11struct vmpressure { 12struct vmpressure {
12 unsigned long scanned; 13 unsigned long scanned;
@@ -33,13 +34,10 @@ extern void vmpressure_init(struct vmpressure *vmpr);
33extern void vmpressure_cleanup(struct vmpressure *vmpr); 34extern void vmpressure_cleanup(struct vmpressure *vmpr);
34extern struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg); 35extern struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg);
35extern struct cgroup_subsys_state *vmpressure_to_css(struct vmpressure *vmpr); 36extern struct cgroup_subsys_state *vmpressure_to_css(struct vmpressure *vmpr);
36extern struct vmpressure *css_to_vmpressure(struct cgroup_subsys_state *css); 37extern int vmpressure_register_event(struct mem_cgroup *memcg,
37extern int vmpressure_register_event(struct cgroup_subsys_state *css,
38 struct cftype *cft,
39 struct eventfd_ctx *eventfd, 38 struct eventfd_ctx *eventfd,
40 const char *args); 39 const char *args);
41extern void vmpressure_unregister_event(struct cgroup_subsys_state *css, 40extern void vmpressure_unregister_event(struct mem_cgroup *memcg,
42 struct cftype *cft,
43 struct eventfd_ctx *eventfd); 41 struct eventfd_ctx *eventfd);
44#else 42#else
45static inline void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, 43static inline void vmpressure(gfp_t gfp, struct mem_cgroup *memcg,
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index e4b948080d20..67ce70c8279b 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -83,6 +83,14 @@ static inline void vm_events_fold_cpu(int cpu)
83#define count_vm_numa_events(x, y) do { (void)(y); } while (0) 83#define count_vm_numa_events(x, y) do { (void)(y); } while (0)
84#endif /* CONFIG_NUMA_BALANCING */ 84#endif /* CONFIG_NUMA_BALANCING */
85 85
86#ifdef CONFIG_DEBUG_TLBFLUSH
87#define count_vm_tlb_event(x) count_vm_event(x)
88#define count_vm_tlb_events(x, y) count_vm_events(x, y)
89#else
90#define count_vm_tlb_event(x) do {} while (0)
91#define count_vm_tlb_events(x, y) do { (void)(y); } while (0)
92#endif
93
86#define __count_zone_vm_events(item, zone, delta) \ 94#define __count_zone_vm_events(item, zone, delta) \
87 __count_vm_events(item##_NORMAL - ZONE_NORMAL + \ 95 __count_vm_events(item##_NORMAL - ZONE_NORMAL + \
88 zone_idx(zone), delta) 96 zone_idx(zone), delta)
@@ -142,8 +150,6 @@ static inline unsigned long zone_page_state_snapshot(struct zone *zone,
142 return x; 150 return x;
143} 151}
144 152
145extern unsigned long global_reclaimable_pages(void);
146
147#ifdef CONFIG_NUMA 153#ifdef CONFIG_NUMA
148/* 154/*
149 * Determine the per node value of a stat item. This function 155 * Determine the per node value of a stat item. This function
diff --git a/include/linux/vtime.h b/include/linux/vtime.h
index f5b72b364bda..c5165fd256f9 100644
--- a/include/linux/vtime.h
+++ b/include/linux/vtime.h
@@ -19,8 +19,8 @@ static inline bool vtime_accounting_enabled(void) { return true; }
19#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN 19#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
20static inline bool vtime_accounting_enabled(void) 20static inline bool vtime_accounting_enabled(void)
21{ 21{
22 if (static_key_false(&context_tracking_enabled)) { 22 if (context_tracking_is_enabled()) {
23 if (context_tracking_active()) 23 if (context_tracking_cpu_is_enabled())
24 return true; 24 return true;
25 } 25 }
26 26
diff --git a/include/linux/w1-gpio.h b/include/linux/w1-gpio.h
index 065e3ae79ab0..d58594a32324 100644
--- a/include/linux/w1-gpio.h
+++ b/include/linux/w1-gpio.h
@@ -20,6 +20,7 @@ struct w1_gpio_platform_data {
20 unsigned int is_open_drain:1; 20 unsigned int is_open_drain:1;
21 void (*enable_external_pullup)(int enable); 21 void (*enable_external_pullup)(int enable);
22 unsigned int ext_pullup_enable_pin; 22 unsigned int ext_pullup_enable_pin;
23 unsigned int pullup_duration;
23}; 24};
24 25
25#endif /* _LINUX_W1_GPIO_H */ 26#endif /* _LINUX_W1_GPIO_H */
diff --git a/include/linux/zorro.h b/include/linux/zorro.h
index dff42025649b..63fbba0740c2 100644
--- a/include/linux/zorro.h
+++ b/include/linux/zorro.h
@@ -11,107 +11,10 @@
11#ifndef _LINUX_ZORRO_H 11#ifndef _LINUX_ZORRO_H
12#define _LINUX_ZORRO_H 12#define _LINUX_ZORRO_H
13 13
14#include <linux/device.h>
15
16
17 /*
18 * Each Zorro board has a 32-bit ID of the form
19 *
20 * mmmmmmmmmmmmmmmmppppppppeeeeeeee
21 *
22 * with
23 *
24 * mmmmmmmmmmmmmmmm 16-bit Manufacturer ID (assigned by CBM (sigh))
25 * pppppppp 8-bit Product ID (assigned by manufacturer)
26 * eeeeeeee 8-bit Extended Product ID (currently only used
27 * for some GVP boards)
28 */
29
30
31#define ZORRO_MANUF(id) ((id) >> 16)
32#define ZORRO_PROD(id) (((id) >> 8) & 0xff)
33#define ZORRO_EPC(id) ((id) & 0xff)
34
35#define ZORRO_ID(manuf, prod, epc) \
36 ((ZORRO_MANUF_##manuf << 16) | ((prod) << 8) | (epc))
37
38typedef __u32 zorro_id;
39
40
41/* Include the ID list */
42#include <linux/zorro_ids.h>
43
44 14
45 /* 15#include <uapi/linux/zorro.h>
46 * GVP identifies most of its products through the 'extended product code'
47 * (epc). The epc has to be ANDed with the GVP_PRODMASK before the
48 * identification.
49 */
50
51#define GVP_PRODMASK (0xf8)
52#define GVP_SCSICLKMASK (0x01)
53
54enum GVP_flags {
55 GVP_IO = 0x01,
56 GVP_ACCEL = 0x02,
57 GVP_SCSI = 0x04,
58 GVP_24BITDMA = 0x08,
59 GVP_25BITDMA = 0x10,
60 GVP_NOBANK = 0x20,
61 GVP_14MHZ = 0x40,
62};
63
64
65struct Node {
66 struct Node *ln_Succ; /* Pointer to next (successor) */
67 struct Node *ln_Pred; /* Pointer to previous (predecessor) */
68 __u8 ln_Type;
69 __s8 ln_Pri; /* Priority, for sorting */
70 __s8 *ln_Name; /* ID string, null terminated */
71} __attribute__ ((packed));
72
73struct ExpansionRom {
74 /* -First 16 bytes of the expansion ROM */
75 __u8 er_Type; /* Board type, size and flags */
76 __u8 er_Product; /* Product number, assigned by manufacturer */
77 __u8 er_Flags; /* Flags */
78 __u8 er_Reserved03; /* Must be zero ($ff inverted) */
79 __u16 er_Manufacturer; /* Unique ID, ASSIGNED BY COMMODORE-AMIGA! */
80 __u32 er_SerialNumber; /* Available for use by manufacturer */
81 __u16 er_InitDiagVec; /* Offset to optional "DiagArea" structure */
82 __u8 er_Reserved0c;
83 __u8 er_Reserved0d;
84 __u8 er_Reserved0e;
85 __u8 er_Reserved0f;
86} __attribute__ ((packed));
87
88/* er_Type board type bits */
89#define ERT_TYPEMASK 0xc0
90#define ERT_ZORROII 0xc0
91#define ERT_ZORROIII 0x80
92
93/* other bits defined in er_Type */
94#define ERTB_MEMLIST 5 /* Link RAM into free memory list */
95#define ERTF_MEMLIST (1<<5)
96
97struct ConfigDev {
98 struct Node cd_Node;
99 __u8 cd_Flags; /* (read/write) */
100 __u8 cd_Pad; /* reserved */
101 struct ExpansionRom cd_Rom; /* copy of board's expansion ROM */
102 void *cd_BoardAddr; /* where in memory the board was placed */
103 __u32 cd_BoardSize; /* size of board in bytes */
104 __u16 cd_SlotAddr; /* which slot number (PRIVATE) */
105 __u16 cd_SlotSize; /* number of slots (PRIVATE) */
106 void *cd_Driver; /* pointer to node of driver */
107 struct ConfigDev *cd_NextCD; /* linked list of drivers to config */
108 __u32 cd_Unused[4]; /* for whatever the driver wants */
109} __attribute__ ((packed));
110
111#define ZORRO_NUM_AUTO 16
112
113#ifdef __KERNEL__
114 16
17#include <linux/device.h>
115#include <linux/init.h> 18#include <linux/init.h>
116#include <linux/ioport.h> 19#include <linux/ioport.h>
117#include <linux/mod_devicetable.h> 20#include <linux/mod_devicetable.h>
@@ -175,7 +78,23 @@ static inline struct zorro_driver *zorro_dev_driver(const struct zorro_dev *z)
175 78
176 79
177extern unsigned int zorro_num_autocon; /* # of autoconfig devices found */ 80extern unsigned int zorro_num_autocon; /* # of autoconfig devices found */
178extern struct zorro_dev zorro_autocon[ZORRO_NUM_AUTO]; 81extern struct zorro_dev *zorro_autocon;
82
83
84 /*
85 * Minimal information about a Zorro device, passed from bootinfo
86 * Only available temporarily, i.e. until initmem has been freed!
87 */
88
89struct zorro_dev_init {
90 struct ExpansionRom rom;
91 u16 slotaddr;
92 u16 slotsize;
93 u32 boardaddr;
94 u32 boardsize;
95};
96
97extern struct zorro_dev_init zorro_autocon_init[ZORRO_NUM_AUTO] __initdata;
179 98
180 99
181 /* 100 /*
@@ -229,6 +148,4 @@ extern DECLARE_BITMAP(zorro_unused_z2ram, 128);
229#define Z2RAM_CHUNKSHIFT (16) 148#define Z2RAM_CHUNKSHIFT (16)
230 149
231 150
232#endif /* __KERNEL__ */
233
234#endif /* _LINUX_ZORRO_H */ 151#endif /* _LINUX_ZORRO_H */
diff --git a/include/linux/zorro_ids.h b/include/linux/zorro_ids.h
deleted file mode 100644
index 74bc53bcfdcf..000000000000
--- a/include/linux/zorro_ids.h
+++ /dev/null
@@ -1,552 +0,0 @@
1/*
2 * Zorro board IDs
3 *
4 * Please keep sorted.
5 */
6
7
8#define ZORRO_MANUF_PACIFIC_PERIPHERALS 0x00D3
9#define ZORRO_PROD_PACIFIC_PERIPHERALS_SE_2000_A500 ZORRO_ID(PACIFIC_PERIPHERALS, 0x00, 0)
10#define ZORRO_PROD_PACIFIC_PERIPHERALS_SCSI ZORRO_ID(PACIFIC_PERIPHERALS, 0x0A, 0)
11
12#define ZORRO_MANUF_MACROSYSTEMS_USA_2 0x0100
13#define ZORRO_PROD_MACROSYSTEMS_WARP_ENGINE ZORRO_ID(MACROSYSTEMS_USA_2, 0x13, 0)
14
15#define ZORRO_MANUF_KUPKE_1 0x00DD
16#define ZORRO_PROD_KUPKE_GOLEM_RAM_BOX_2MB ZORRO_ID(KUPKE_1, 0x00, 0)
17
18#define ZORRO_MANUF_MEMPHIS 0x0100
19#define ZORRO_PROD_MEMPHIS_STORMBRINGER ZORRO_ID(MEMPHIS, 0x00, 0)
20
21#define ZORRO_MANUF_3_STATE 0x0200
22#define ZORRO_PROD_3_STATE_MEGAMIX_2000 ZORRO_ID(3_STATE, 0x02, 0)
23
24#define ZORRO_MANUF_COMMODORE_BRAUNSCHWEIG 0x0201
25#define ZORRO_PROD_CBM_A2088_A2286 ZORRO_ID(COMMODORE_BRAUNSCHWEIG, 0x01, 0)
26#define ZORRO_PROD_CBM_A2286 ZORRO_ID(COMMODORE_BRAUNSCHWEIG, 0x02, 0)
27#define ZORRO_PROD_CBM_A4091_1 ZORRO_ID(COMMODORE_BRAUNSCHWEIG, 0x54, 0)
28#define ZORRO_PROD_CBM_A2386SX_1 ZORRO_ID(COMMODORE_BRAUNSCHWEIG, 0x67, 0)
29
30#define ZORRO_MANUF_COMMODORE_WEST_CHESTER_1 0x0202
31#define ZORRO_PROD_CBM_A2090A ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x01, 0)
32#define ZORRO_PROD_CBM_A590_A2091_1 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x02, 0)
33#define ZORRO_PROD_CBM_A590_A2091_2 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x03, 0)
34#define ZORRO_PROD_CBM_A2090B ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x04, 0)
35#define ZORRO_PROD_CBM_A2060 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x09, 0)
36#define ZORRO_PROD_CBM_A590_A2052_A2058_A2091 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x0A, 0)
37#define ZORRO_PROD_CBM_A560_RAM ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x20, 0)
38#define ZORRO_PROD_CBM_A2232_PROTOTYPE ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x45, 0)
39#define ZORRO_PROD_CBM_A2232 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x46, 0)
40#define ZORRO_PROD_CBM_A2620 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x50, 0)
41#define ZORRO_PROD_CBM_A2630 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x51, 0)
42#define ZORRO_PROD_CBM_A4091_2 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x54, 0)
43#define ZORRO_PROD_CBM_A2065_1 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x5A, 0)
44#define ZORRO_PROD_CBM_ROMULATOR ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x60, 0)
45#define ZORRO_PROD_CBM_A3000_TEST_FIXTURE ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x61, 0)
46#define ZORRO_PROD_CBM_A2386SX_2 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x67, 0)
47#define ZORRO_PROD_CBM_A2065_2 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x70, 0)
48
49#define ZORRO_MANUF_COMMODORE_WEST_CHESTER_2 0x0203
50#define ZORRO_PROD_CBM_A2090A_CM ZORRO_ID(COMMODORE_WEST_CHESTER_2, 0x03, 0)
51
52#define ZORRO_MANUF_PROGRESSIVE_PERIPHERALS_AND_SYSTEMS_2 0x02F4
53#define ZORRO_PROD_PPS_EXP8000 ZORRO_ID(PROGRESSIVE_PERIPHERALS_AND_SYSTEMS_2, 0x02, 0)
54
55#define ZORRO_MANUF_KOLFF_COMPUTER_SUPPLIES 0x02FF
56#define ZORRO_PROD_KCS_POWER_PC_BOARD ZORRO_ID(KOLFF_COMPUTER_SUPPLIES, 0x00, 0)
57
58#define ZORRO_MANUF_CARDCO_1 0x03EC
59#define ZORRO_PROD_CARDCO_KRONOS_2000_1 ZORRO_ID(CARDCO_1, 0x04, 0)
60#define ZORRO_PROD_CARDCO_A1000_1 ZORRO_ID(CARDCO_1, 0x0C, 0)
61#define ZORRO_PROD_CARDCO_ESCORT ZORRO_ID(CARDCO_1, 0x0E, 0)
62#define ZORRO_PROD_CARDCO_A2410 ZORRO_ID(CARDCO_1, 0xF5, 0)
63
64#define ZORRO_MANUF_A_SQUARED 0x03ED
65#define ZORRO_PROD_A_SQUARED_LIVE_2000 ZORRO_ID(A_SQUARED, 0x01, 0)
66
67#define ZORRO_MANUF_COMSPEC_COMMUNICATIONS 0x03EE
68#define ZORRO_PROD_COMSPEC_COMMUNICATIONS_AX2000 ZORRO_ID(COMSPEC_COMMUNICATIONS, 0x01, 0)
69
70#define ZORRO_MANUF_ANAKIN_RESEARCH 0x03F1
71#define ZORRO_PROD_ANAKIN_RESEARCH_EASYL ZORRO_ID(ANAKIN_RESEARCH, 0x01, 0)
72
73#define ZORRO_MANUF_MICROBOTICS 0x03F2
74#define ZORRO_PROD_MICROBOTICS_STARBOARD_II ZORRO_ID(MICROBOTICS, 0x00, 0)
75#define ZORRO_PROD_MICROBOTICS_STARDRIVE ZORRO_ID(MICROBOTICS, 0x02, 0)
76#define ZORRO_PROD_MICROBOTICS_8_UP_A ZORRO_ID(MICROBOTICS, 0x03, 0)
77#define ZORRO_PROD_MICROBOTICS_8_UP_Z ZORRO_ID(MICROBOTICS, 0x04, 0)
78#define ZORRO_PROD_MICROBOTICS_DELTA_RAM ZORRO_ID(MICROBOTICS, 0x20, 0)
79#define ZORRO_PROD_MICROBOTICS_8_STAR_RAM ZORRO_ID(MICROBOTICS, 0x40, 0)
80#define ZORRO_PROD_MICROBOTICS_8_STAR ZORRO_ID(MICROBOTICS, 0x41, 0)
81#define ZORRO_PROD_MICROBOTICS_VXL_RAM_32 ZORRO_ID(MICROBOTICS, 0x44, 0)
82#define ZORRO_PROD_MICROBOTICS_VXL_68030 ZORRO_ID(MICROBOTICS, 0x45, 0)
83#define ZORRO_PROD_MICROBOTICS_DELTA ZORRO_ID(MICROBOTICS, 0x60, 0)
84#define ZORRO_PROD_MICROBOTICS_MBX_1200_1200Z_RAM ZORRO_ID(MICROBOTICS, 0x81, 0)
85#define ZORRO_PROD_MICROBOTICS_HARDFRAME_2000_1 ZORRO_ID(MICROBOTICS, 0x96, 0)
86#define ZORRO_PROD_MICROBOTICS_HARDFRAME_2000_2 ZORRO_ID(MICROBOTICS, 0x9E, 0)
87#define ZORRO_PROD_MICROBOTICS_MBX_1200_1200Z ZORRO_ID(MICROBOTICS, 0xC1, 0)
88
89#define ZORRO_MANUF_ACCESS_ASSOCIATES_ALEGRA 0x03F4
90
91#define ZORRO_MANUF_EXPANSION_TECHNOLOGIES 0x03F6
92
93#define ZORRO_MANUF_ASDG 0x03FF
94#define ZORRO_PROD_ASDG_MEMORY_1 ZORRO_ID(ASDG, 0x01, 0)
95#define ZORRO_PROD_ASDG_MEMORY_2 ZORRO_ID(ASDG, 0x02, 0)
96#define ZORRO_PROD_ASDG_EB920_LAN_ROVER ZORRO_ID(ASDG, 0xFE, 0)
97#define ZORRO_PROD_ASDG_GPIB_DUALIEEE488_TWIN_X ZORRO_ID(ASDG, 0xFF, 0)
98
99#define ZORRO_MANUF_IMTRONICS_1 0x0404
100#define ZORRO_PROD_IMTRONICS_HURRICANE_2800_1 ZORRO_ID(IMTRONICS_1, 0x39, 0)
101#define ZORRO_PROD_IMTRONICS_HURRICANE_2800_2 ZORRO_ID(IMTRONICS_1, 0x57, 0)
102
103#define ZORRO_MANUF_CBM_UNIVERSITY_OF_LOWELL 0x0406
104#define ZORRO_PROD_CBM_A2410 ZORRO_ID(CBM_UNIVERSITY_OF_LOWELL, 0x00, 0)
105
106#define ZORRO_MANUF_AMERISTAR 0x041D
107#define ZORRO_PROD_AMERISTAR_A2065 ZORRO_ID(AMERISTAR, 0x01, 0)
108#define ZORRO_PROD_AMERISTAR_A560 ZORRO_ID(AMERISTAR, 0x09, 0)
109#define ZORRO_PROD_AMERISTAR_A4066 ZORRO_ID(AMERISTAR, 0x0A, 0)
110
111#define ZORRO_MANUF_SUPRA 0x0420
112#define ZORRO_PROD_SUPRA_SUPRADRIVE_4x4 ZORRO_ID(SUPRA, 0x01, 0)
113#define ZORRO_PROD_SUPRA_1000_RAM ZORRO_ID(SUPRA, 0x02, 0)
114#define ZORRO_PROD_SUPRA_2000_DMA ZORRO_ID(SUPRA, 0x03, 0)
115#define ZORRO_PROD_SUPRA_500 ZORRO_ID(SUPRA, 0x05, 0)
116#define ZORRO_PROD_SUPRA_500_SCSI ZORRO_ID(SUPRA, 0x08, 0)
117#define ZORRO_PROD_SUPRA_500XP_2000_RAM ZORRO_ID(SUPRA, 0x09, 0)
118#define ZORRO_PROD_SUPRA_500RX_2000_RAM ZORRO_ID(SUPRA, 0x0A, 0)
119#define ZORRO_PROD_SUPRA_2400ZI ZORRO_ID(SUPRA, 0x0B, 0)
120#define ZORRO_PROD_SUPRA_500XP_SUPRADRIVE_WORDSYNC ZORRO_ID(SUPRA, 0x0C, 0)
121#define ZORRO_PROD_SUPRA_SUPRADRIVE_WORDSYNC_II ZORRO_ID(SUPRA, 0x0D, 0)
122#define ZORRO_PROD_SUPRA_2400ZIPLUS ZORRO_ID(SUPRA, 0x10, 0)
123
124#define ZORRO_MANUF_COMPUTER_SYSTEMS_ASSOCIATES 0x0422
125#define ZORRO_PROD_CSA_MAGNUM ZORRO_ID(COMPUTER_SYSTEMS_ASSOCIATES, 0x11, 0)
126#define ZORRO_PROD_CSA_12_GAUGE ZORRO_ID(COMPUTER_SYSTEMS_ASSOCIATES, 0x15, 0)
127
128#define ZORRO_MANUF_MARC_MICHAEL_GROTH 0x0439
129
130#define ZORRO_MANUF_M_TECH 0x0502
131#define ZORRO_PROD_MTEC_AT500_1 ZORRO_ID(M_TECH, 0x03, 0)
132
133#define ZORRO_MANUF_GREAT_VALLEY_PRODUCTS_1 0x06E1
134#define ZORRO_PROD_GVP_IMPACT_SERIES_I ZORRO_ID(GREAT_VALLEY_PRODUCTS_1, 0x08, 0)
135
136#define ZORRO_MANUF_BYTEBOX 0x07DA
137#define ZORRO_PROD_BYTEBOX_A500 ZORRO_ID(BYTEBOX, 0x00, 0)
138
139#define ZORRO_MANUF_DKB_POWER_COMPUTING 0x07DC
140#define ZORRO_PROD_DKB_POWER_COMPUTING_SECUREKEY ZORRO_ID(DKB_POWER_COMPUTING, 0x09, 0)
141#define ZORRO_PROD_DKB_POWER_COMPUTING_DKM_3128 ZORRO_ID(DKB_POWER_COMPUTING, 0x0E, 0)
142#define ZORRO_PROD_DKB_POWER_COMPUTING_RAPID_FIRE ZORRO_ID(DKB_POWER_COMPUTING, 0x0F, 0)
143#define ZORRO_PROD_DKB_POWER_COMPUTING_DKM_1202 ZORRO_ID(DKB_POWER_COMPUTING, 0x10, 0)
144#define ZORRO_PROD_DKB_POWER_COMPUTING_COBRA_VIPER_II_68EC030 ZORRO_ID(DKB_POWER_COMPUTING, 0x12, 0)
145#define ZORRO_PROD_DKB_POWER_COMPUTING_WILDFIRE_060_1 ZORRO_ID(DKB_POWER_COMPUTING, 0x17, 0)
146#define ZORRO_PROD_DKB_POWER_COMPUTING_WILDFIRE_060_2 ZORRO_ID(DKB_POWER_COMPUTING, 0xFF, 0)
147
148#define ZORRO_MANUF_GREAT_VALLEY_PRODUCTS_2 0x07E1
149#define ZORRO_PROD_GVP_IMPACT_SERIES_I_4K ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x01, 0)
150#define ZORRO_PROD_GVP_IMPACT_SERIES_I_16K_2 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x02, 0)
151#define ZORRO_PROD_GVP_IMPACT_SERIES_I_16K_3 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x03, 0)
152#define ZORRO_PROD_GVP_IMPACT_3001_IDE_1 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x08, 0)
153#define ZORRO_PROD_GVP_IMPACT_3001_RAM ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x09, 0)
154#define ZORRO_PROD_GVP_IMPACT_SERIES_II_RAM_1 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0A, 0)
155#define ZORRO_PROD_GVP_EPC_BASE ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0)
156#define ZORRO_PROD_GVP_GFORCE_040_1 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x20)
157#define ZORRO_PROD_GVP_GFORCE_040_SCSI_1 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x30)
158#define ZORRO_PROD_GVP_A1291 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x40)
159#define ZORRO_PROD_GVP_COMBO_030_R4 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x60)
160#define ZORRO_PROD_GVP_COMBO_030_R4_SCSI ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x70)
161#define ZORRO_PROD_GVP_PHONEPAK ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x78)
162#define ZORRO_PROD_GVP_IO_EXTENDER ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x98)
163#define ZORRO_PROD_GVP_GFORCE_030 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xa0)
164#define ZORRO_PROD_GVP_GFORCE_030_SCSI ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xb0)
165#define ZORRO_PROD_GVP_A530 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xc0)
166#define ZORRO_PROD_GVP_A530_SCSI ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xd0)
167#define ZORRO_PROD_GVP_COMBO_030_R3 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xe0)
168#define ZORRO_PROD_GVP_COMBO_030_R3_SCSI ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xf0)
169#define ZORRO_PROD_GVP_SERIES_II ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xf8)
170#define ZORRO_PROD_GVP_IMPACT_3001_IDE_2 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0D, 0)
171/*#define ZORRO_PROD_GVP_A2000_030 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0D, 0)*/
172/*#define ZORRO_PROD_GVP_GFORCE_040_SCSI_2 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0D, 0)*/
173#define ZORRO_PROD_GVP_GFORCE_040_060 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x16, 0)
174#define ZORRO_PROD_GVP_IMPACT_VISION_24 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x20, 0)
175#define ZORRO_PROD_GVP_GFORCE_040_2 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0xFF, 0)
176
177#define ZORRO_MANUF_CALIFORNIA_ACCESS_SYNERGY 0x07E5
178#define ZORRO_PROD_CALIFORNIA_ACCESS_SYNERGY_MALIBU ZORRO_ID(CALIFORNIA_ACCESS_SYNERGY, 0x01, 0)
179
180#define ZORRO_MANUF_XETEC 0x07E6
181#define ZORRO_PROD_XETEC_FASTCARD ZORRO_ID(XETEC, 0x01, 0)
182#define ZORRO_PROD_XETEC_FASTCARD_RAM ZORRO_ID(XETEC, 0x02, 0)
183#define ZORRO_PROD_XETEC_FASTCARD_PLUS ZORRO_ID(XETEC, 0x03, 0)
184
185#define ZORRO_MANUF_PROGRESSIVE_PERIPHERALS_AND_SYSTEMS 0x07EA
186#define ZORRO_PROD_PPS_MERCURY ZORRO_ID(PROGRESSIVE_PERIPHERALS_AND_SYSTEMS, 0x00, 0)
187#define ZORRO_PROD_PPS_A3000_68040 ZORRO_ID(PROGRESSIVE_PERIPHERALS_AND_SYSTEMS, 0x01, 0)
188#define ZORRO_PROD_PPS_A2000_68040 ZORRO_ID(PROGRESSIVE_PERIPHERALS_AND_SYSTEMS, 0x69, 0)
189#define ZORRO_PROD_PPS_ZEUS ZORRO_ID(PROGRESSIVE_PERIPHERALS_AND_SYSTEMS, 0x96, 0)
190#define ZORRO_PROD_PPS_A500_68040 ZORRO_ID(PROGRESSIVE_PERIPHERALS_AND_SYSTEMS, 0xBB, 0)
191
192#define ZORRO_MANUF_XEBEC 0x07EC
193
194#define ZORRO_MANUF_SPIRIT_TECHNOLOGY 0x07F2
195#define ZORRO_PROD_SPIRIT_TECHNOLOGY_INSIDER_IN1000 ZORRO_ID(SPIRIT_TECHNOLOGY, 0x01, 0)
196#define ZORRO_PROD_SPIRIT_TECHNOLOGY_INSIDER_IN500 ZORRO_ID(SPIRIT_TECHNOLOGY, 0x02, 0)
197#define ZORRO_PROD_SPIRIT_TECHNOLOGY_SIN500 ZORRO_ID(SPIRIT_TECHNOLOGY, 0x03, 0)
198#define ZORRO_PROD_SPIRIT_TECHNOLOGY_HDA_506 ZORRO_ID(SPIRIT_TECHNOLOGY, 0x04, 0)
199#define ZORRO_PROD_SPIRIT_TECHNOLOGY_AX_S ZORRO_ID(SPIRIT_TECHNOLOGY, 0x05, 0)
200#define ZORRO_PROD_SPIRIT_TECHNOLOGY_OCTABYTE ZORRO_ID(SPIRIT_TECHNOLOGY, 0x06, 0)
201#define ZORRO_PROD_SPIRIT_TECHNOLOGY_INMATE ZORRO_ID(SPIRIT_TECHNOLOGY, 0x08, 0)
202
203#define ZORRO_MANUF_SPIRIT_TECHNOLOGY_2 0x07F3
204
205#define ZORRO_MANUF_BSC_ALFADATA_1 0x07FE
206#define ZORRO_PROD_BSC_ALF_3_1 ZORRO_ID(BSC_ALFADATA_1, 0x03, 0)
207
208#define ZORRO_MANUF_BSC_ALFADATA_2 0x0801
209#define ZORRO_PROD_BSC_ALF_2_1 ZORRO_ID(BSC_ALFADATA_2, 0x01, 0)
210#define ZORRO_PROD_BSC_ALF_2_2 ZORRO_ID(BSC_ALFADATA_2, 0x02, 0)
211#define ZORRO_PROD_BSC_ALF_3_2 ZORRO_ID(BSC_ALFADATA_2, 0x03, 0)
212
213#define ZORRO_MANUF_CARDCO_2 0x0802
214#define ZORRO_PROD_CARDCO_KRONOS_2000_2 ZORRO_ID(CARDCO_2, 0x04, 0)
215#define ZORRO_PROD_CARDCO_A1000_2 ZORRO_ID(CARDCO_2, 0x0C, 0)
216
217#define ZORRO_MANUF_JOCHHEIM 0x0804
218#define ZORRO_PROD_JOCHHEIM_RAM ZORRO_ID(JOCHHEIM, 0x01, 0)
219
220#define ZORRO_MANUF_CHECKPOINT_TECHNOLOGIES 0x0807
221#define ZORRO_PROD_CHECKPOINT_TECHNOLOGIES_SERIAL_SOLUTION ZORRO_ID(CHECKPOINT_TECHNOLOGIES, 0x00, 0)
222
223#define ZORRO_MANUF_EDOTRONIK 0x0810
224#define ZORRO_PROD_EDOTRONIK_IEEE_488 ZORRO_ID(EDOTRONIK, 0x01, 0)
225#define ZORRO_PROD_EDOTRONIK_8032 ZORRO_ID(EDOTRONIK, 0x02, 0)
226#define ZORRO_PROD_EDOTRONIK_MULTISERIAL ZORRO_ID(EDOTRONIK, 0x03, 0)
227#define ZORRO_PROD_EDOTRONIK_VIDEODIGITIZER ZORRO_ID(EDOTRONIK, 0x04, 0)
228#define ZORRO_PROD_EDOTRONIK_PARALLEL_IO ZORRO_ID(EDOTRONIK, 0x05, 0)
229#define ZORRO_PROD_EDOTRONIK_PIC_PROTOYPING ZORRO_ID(EDOTRONIK, 0x06, 0)
230#define ZORRO_PROD_EDOTRONIK_ADC ZORRO_ID(EDOTRONIK, 0x07, 0)
231#define ZORRO_PROD_EDOTRONIK_VME ZORRO_ID(EDOTRONIK, 0x08, 0)
232#define ZORRO_PROD_EDOTRONIK_DSP96000 ZORRO_ID(EDOTRONIK, 0x09, 0)
233
234#define ZORRO_MANUF_NES_INC 0x0813
235#define ZORRO_PROD_NES_INC_RAM ZORRO_ID(NES_INC, 0x00, 0)
236
237#define ZORRO_MANUF_ICD 0x0817
238#define ZORRO_PROD_ICD_ADVANTAGE_2000_SCSI ZORRO_ID(ICD, 0x01, 0)
239#define ZORRO_PROD_ICD_ADVANTAGE_IDE ZORRO_ID(ICD, 0x03, 0)
240#define ZORRO_PROD_ICD_ADVANTAGE_2080_RAM ZORRO_ID(ICD, 0x04, 0)
241
242#define ZORRO_MANUF_KUPKE_2 0x0819
243#define ZORRO_PROD_KUPKE_OMTI ZORRO_ID(KUPKE_2, 0x01, 0)
244#define ZORRO_PROD_KUPKE_SCSI_II ZORRO_ID(KUPKE_2, 0x02, 0)
245#define ZORRO_PROD_KUPKE_GOLEM_BOX ZORRO_ID(KUPKE_2, 0x03, 0)
246#define ZORRO_PROD_KUPKE_030_882 ZORRO_ID(KUPKE_2, 0x04, 0)
247#define ZORRO_PROD_KUPKE_SCSI_AT ZORRO_ID(KUPKE_2, 0x05, 0)
248
249#define ZORRO_MANUF_GREAT_VALLEY_PRODUCTS_3 0x081D
250#define ZORRO_PROD_GVP_A2000_RAM8 ZORRO_ID(GREAT_VALLEY_PRODUCTS_3, 0x09, 0)
251#define ZORRO_PROD_GVP_IMPACT_SERIES_II_RAM_2 ZORRO_ID(GREAT_VALLEY_PRODUCTS_3, 0x0A, 0)
252
253#define ZORRO_MANUF_INTERWORKS_NETWORK 0x081E
254
255#define ZORRO_MANUF_HARDITAL_SYNTHESIS 0x0820
256#define ZORRO_PROD_HARDITAL_SYNTHESIS_TQM_68030_68882 ZORRO_ID(HARDITAL_SYNTHESIS, 0x14, 0)
257
258#define ZORRO_MANUF_APPLIED_ENGINEERING 0x0828
259#define ZORRO_PROD_APPLIED_ENGINEERING_DL2000 ZORRO_ID(APPLIED_ENGINEERING, 0x10, 0)
260#define ZORRO_PROD_APPLIED_ENGINEERING_RAM_WORKS ZORRO_ID(APPLIED_ENGINEERING, 0xE0, 0)
261
262#define ZORRO_MANUF_BSC_ALFADATA_3 0x082C
263#define ZORRO_PROD_BSC_OKTAGON_2008 ZORRO_ID(BSC_ALFADATA_3, 0x05, 0)
264#define ZORRO_PROD_BSC_TANDEM_AT_2008_508 ZORRO_ID(BSC_ALFADATA_3, 0x06, 0)
265#define ZORRO_PROD_BSC_ALFA_RAM_1200 ZORRO_ID(BSC_ALFADATA_3, 0x07, 0)
266#define ZORRO_PROD_BSC_OKTAGON_2008_RAM ZORRO_ID(BSC_ALFADATA_3, 0x08, 0)
267#define ZORRO_PROD_BSC_MULTIFACE_I ZORRO_ID(BSC_ALFADATA_3, 0x10, 0)
268#define ZORRO_PROD_BSC_MULTIFACE_II ZORRO_ID(BSC_ALFADATA_3, 0x11, 0)
269#define ZORRO_PROD_BSC_MULTIFACE_III ZORRO_ID(BSC_ALFADATA_3, 0x12, 0)
270#define ZORRO_PROD_BSC_FRAMEMASTER_II ZORRO_ID(BSC_ALFADATA_3, 0x20, 0)
271#define ZORRO_PROD_BSC_GRAFFITI_RAM ZORRO_ID(BSC_ALFADATA_3, 0x21, 0)
272#define ZORRO_PROD_BSC_GRAFFITI_REG ZORRO_ID(BSC_ALFADATA_3, 0x22, 0)
273#define ZORRO_PROD_BSC_ISDN_MASTERCARD ZORRO_ID(BSC_ALFADATA_3, 0x40, 0)
274#define ZORRO_PROD_BSC_ISDN_MASTERCARD_II ZORRO_ID(BSC_ALFADATA_3, 0x41, 0)
275
276#define ZORRO_MANUF_PHOENIX 0x0835
277#define ZORRO_PROD_PHOENIX_ST506 ZORRO_ID(PHOENIX, 0x21, 0)
278#define ZORRO_PROD_PHOENIX_SCSI ZORRO_ID(PHOENIX, 0x22, 0)
279#define ZORRO_PROD_PHOENIX_RAM ZORRO_ID(PHOENIX, 0xBE, 0)
280
281#define ZORRO_MANUF_ADVANCED_STORAGE_SYSTEMS 0x0836
282#define ZORRO_PROD_ADVANCED_STORAGE_SYSTEMS_NEXUS ZORRO_ID(ADVANCED_STORAGE_SYSTEMS, 0x01, 0)
283#define ZORRO_PROD_ADVANCED_STORAGE_SYSTEMS_NEXUS_RAM ZORRO_ID(ADVANCED_STORAGE_SYSTEMS, 0x08, 0)
284
285#define ZORRO_MANUF_IMPULSE 0x0838
286#define ZORRO_PROD_IMPULSE_FIRECRACKER_24 ZORRO_ID(IMPULSE, 0x00, 0)
287
288#define ZORRO_MANUF_IVS 0x0840
289#define ZORRO_PROD_IVS_GRANDSLAM_PIC_2 ZORRO_ID(IVS, 0x02, 0)
290#define ZORRO_PROD_IVS_GRANDSLAM_PIC_1 ZORRO_ID(IVS, 0x04, 0)
291#define ZORRO_PROD_IVS_OVERDRIVE ZORRO_ID(IVS, 0x10, 0)
292#define ZORRO_PROD_IVS_TRUMPCARD_CLASSIC ZORRO_ID(IVS, 0x30, 0)
293#define ZORRO_PROD_IVS_TRUMPCARD_PRO_GRANDSLAM ZORRO_ID(IVS, 0x34, 0)
294#define ZORRO_PROD_IVS_META_4 ZORRO_ID(IVS, 0x40, 0)
295#define ZORRO_PROD_IVS_WAVETOOLS ZORRO_ID(IVS, 0xBF, 0)
296#define ZORRO_PROD_IVS_VECTOR_1 ZORRO_ID(IVS, 0xF3, 0)
297#define ZORRO_PROD_IVS_VECTOR_2 ZORRO_ID(IVS, 0xF4, 0)
298
299#define ZORRO_MANUF_VECTOR_1 0x0841
300#define ZORRO_PROD_VECTOR_CONNECTION_1 ZORRO_ID(VECTOR_1, 0xE3, 0)
301
302#define ZORRO_MANUF_XPERT_PRODEV 0x0845
303#define ZORRO_PROD_XPERT_PRODEV_VISIONA_RAM ZORRO_ID(XPERT_PRODEV, 0x01, 0)
304#define ZORRO_PROD_XPERT_PRODEV_VISIONA_REG ZORRO_ID(XPERT_PRODEV, 0x02, 0)
305#define ZORRO_PROD_XPERT_PRODEV_MERLIN_RAM ZORRO_ID(XPERT_PRODEV, 0x03, 0)
306#define ZORRO_PROD_XPERT_PRODEV_MERLIN_REG_1 ZORRO_ID(XPERT_PRODEV, 0x04, 0)
307#define ZORRO_PROD_XPERT_PRODEV_MERLIN_REG_2 ZORRO_ID(XPERT_PRODEV, 0xC9, 0)
308
309#define ZORRO_MANUF_HYDRA_SYSTEMS 0x0849
310#define ZORRO_PROD_HYDRA_SYSTEMS_AMIGANET ZORRO_ID(HYDRA_SYSTEMS, 0x01, 0)
311
312#define ZORRO_MANUF_SUNRIZE_INDUSTRIES 0x084F
313#define ZORRO_PROD_SUNRIZE_INDUSTRIES_AD1012 ZORRO_ID(SUNRIZE_INDUSTRIES, 0x01, 0)
314#define ZORRO_PROD_SUNRIZE_INDUSTRIES_AD516 ZORRO_ID(SUNRIZE_INDUSTRIES, 0x02, 0)
315#define ZORRO_PROD_SUNRIZE_INDUSTRIES_DD512 ZORRO_ID(SUNRIZE_INDUSTRIES, 0x03, 0)
316
317#define ZORRO_MANUF_TRICERATOPS 0x0850
318#define ZORRO_PROD_TRICERATOPS_MULTI_IO ZORRO_ID(TRICERATOPS, 0x01, 0)
319
320#define ZORRO_MANUF_APPLIED_MAGIC 0x0851
321#define ZORRO_PROD_APPLIED_MAGIC_DMI_RESOLVER ZORRO_ID(APPLIED_MAGIC, 0x01, 0)
322#define ZORRO_PROD_APPLIED_MAGIC_DIGITAL_BROADCASTER ZORRO_ID(APPLIED_MAGIC, 0x06, 0)
323
324#define ZORRO_MANUF_GFX_BASE 0x085E
325#define ZORRO_PROD_GFX_BASE_GDA_1_VRAM ZORRO_ID(GFX_BASE, 0x00, 0)
326#define ZORRO_PROD_GFX_BASE_GDA_1 ZORRO_ID(GFX_BASE, 0x01, 0)
327
328#define ZORRO_MANUF_ROCTEC 0x0860
329#define ZORRO_PROD_ROCTEC_RH_800C ZORRO_ID(ROCTEC, 0x01, 0)
330#define ZORRO_PROD_ROCTEC_RH_800C_RAM ZORRO_ID(ROCTEC, 0x01, 0)
331
332#define ZORRO_MANUF_KATO 0x0861
333#define ZORRO_PROD_KATO_MELODY ZORRO_ID(KATO, 0x80, 0)
334/* ID clash!! */
335#define ZORRO_MANUF_HELFRICH_1 0x0861
336#define ZORRO_PROD_HELFRICH_RAINBOW_II ZORRO_ID(HELFRICH_1, 0x20, 0)
337#define ZORRO_PROD_HELFRICH_RAINBOW_III ZORRO_ID(HELFRICH_1, 0x21, 0)
338
339#define ZORRO_MANUF_ATLANTIS 0x0862
340
341#define ZORRO_MANUF_PROTAR 0x0864
342
343#define ZORRO_MANUF_ACS 0x0865
344
345#define ZORRO_MANUF_SOFTWARE_RESULTS_ENTERPRISES 0x0866
346#define ZORRO_PROD_SOFTWARE_RESULTS_ENTERPRISES_GOLDEN_GATE_2_BUS_PLUS ZORRO_ID(SOFTWARE_RESULTS_ENTERPRISES, 0x01, 0)
347
348#define ZORRO_MANUF_MASOBOSHI 0x086D
349#define ZORRO_PROD_MASOBOSHI_MASTER_CARD_SC201 ZORRO_ID(MASOBOSHI, 0x03, 0)
350#define ZORRO_PROD_MASOBOSHI_MASTER_CARD_MC702 ZORRO_ID(MASOBOSHI, 0x04, 0)
351#define ZORRO_PROD_MASOBOSHI_MVD_819 ZORRO_ID(MASOBOSHI, 0x07, 0)
352
353#define ZORRO_MANUF_MAINHATTAN_DATA 0x086F
354#define ZORRO_PROD_MAINHATTAN_DATA_IDE ZORRO_ID(MAINHATTAN_DATA, 0x01, 0)
355
356#define ZORRO_MANUF_VILLAGE_TRONIC 0x0877
357#define ZORRO_PROD_VILLAGE_TRONIC_DOMINO_RAM ZORRO_ID(VILLAGE_TRONIC, 0x01, 0)
358#define ZORRO_PROD_VILLAGE_TRONIC_DOMINO_REG ZORRO_ID(VILLAGE_TRONIC, 0x02, 0)
359#define ZORRO_PROD_VILLAGE_TRONIC_DOMINO_16M_PROTOTYPE ZORRO_ID(VILLAGE_TRONIC, 0x03, 0)
360#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_RAM ZORRO_ID(VILLAGE_TRONIC, 0x0B, 0)
361#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_REG ZORRO_ID(VILLAGE_TRONIC, 0x0C, 0)
362#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_SEGMENTED_MODE ZORRO_ID(VILLAGE_TRONIC, 0x0D, 0)
363#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_RAM1 ZORRO_ID(VILLAGE_TRONIC, 0x15, 0)
364#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_RAM2 ZORRO_ID(VILLAGE_TRONIC, 0x16, 0)
365#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_REG ZORRO_ID(VILLAGE_TRONIC, 0x17, 0)
366#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z3 ZORRO_ID(VILLAGE_TRONIC, 0x18, 0)
367#define ZORRO_PROD_VILLAGE_TRONIC_ARIADNE ZORRO_ID(VILLAGE_TRONIC, 0xC9, 0)
368#define ZORRO_PROD_VILLAGE_TRONIC_ARIADNE2 ZORRO_ID(VILLAGE_TRONIC, 0xCA, 0)
369
370#define ZORRO_MANUF_UTILITIES_UNLIMITED 0x087B
371#define ZORRO_PROD_UTILITIES_UNLIMITED_EMPLANT_DELUXE ZORRO_ID(UTILITIES_UNLIMITED, 0x15, 0)
372#define ZORRO_PROD_UTILITIES_UNLIMITED_EMPLANT_DELUXE2 ZORRO_ID(UTILITIES_UNLIMITED, 0x20, 0)
373
374#define ZORRO_MANUF_AMITRIX 0x0880
375#define ZORRO_PROD_AMITRIX_MULTI_IO ZORRO_ID(AMITRIX, 0x01, 0)
376#define ZORRO_PROD_AMITRIX_CD_RAM ZORRO_ID(AMITRIX, 0x02, 0)
377
378#define ZORRO_MANUF_ARMAX 0x0885
379#define ZORRO_PROD_ARMAX_OMNIBUS ZORRO_ID(ARMAX, 0x00, 0)
380
381#define ZORRO_MANUF_ZEUS 0x088D
382#define ZORRO_PROD_ZEUS_SPIDER ZORRO_ID(ZEUS, 0x04, 0)
383
384#define ZORRO_MANUF_NEWTEK 0x088F
385#define ZORRO_PROD_NEWTEK_VIDEOTOASTER ZORRO_ID(NEWTEK, 0x00, 0)
386
387#define ZORRO_MANUF_M_TECH_GERMANY 0x0890
388#define ZORRO_PROD_MTEC_AT500_2 ZORRO_ID(M_TECH_GERMANY, 0x01, 0)
389#define ZORRO_PROD_MTEC_68030 ZORRO_ID(M_TECH_GERMANY, 0x03, 0)
390#define ZORRO_PROD_MTEC_68020I ZORRO_ID(M_TECH_GERMANY, 0x06, 0)
391#define ZORRO_PROD_MTEC_A1200_T68030_RTC ZORRO_ID(M_TECH_GERMANY, 0x20, 0)
392#define ZORRO_PROD_MTEC_VIPER_MK_V_E_MATRIX_530 ZORRO_ID(M_TECH_GERMANY, 0x21, 0)
393#define ZORRO_PROD_MTEC_8_MB_RAM ZORRO_ID(M_TECH_GERMANY, 0x22, 0)
394#define ZORRO_PROD_MTEC_VIPER_MK_V_E_MATRIX_530_SCSI_IDE ZORRO_ID(M_TECH_GERMANY, 0x24, 0)
395
396#define ZORRO_MANUF_GREAT_VALLEY_PRODUCTS_4 0x0891
397#define ZORRO_PROD_GVP_EGS_28_24_SPECTRUM_RAM ZORRO_ID(GREAT_VALLEY_PRODUCTS_4, 0x01, 0)
398#define ZORRO_PROD_GVP_EGS_28_24_SPECTRUM_REG ZORRO_ID(GREAT_VALLEY_PRODUCTS_4, 0x02, 0)
399
400#define ZORRO_MANUF_APOLLO_1 0x0892
401#define ZORRO_PROD_APOLLO_A1200 ZORRO_ID(APOLLO_1, 0x01, 0)
402
403#define ZORRO_MANUF_HELFRICH_2 0x0893
404#define ZORRO_PROD_HELFRICH_PICCOLO_RAM ZORRO_ID(HELFRICH_2, 0x05, 0)
405#define ZORRO_PROD_HELFRICH_PICCOLO_REG ZORRO_ID(HELFRICH_2, 0x06, 0)
406#define ZORRO_PROD_HELFRICH_PEGGY_PLUS_MPEG ZORRO_ID(HELFRICH_2, 0x07, 0)
407#define ZORRO_PROD_HELFRICH_VIDEOCRUNCHER ZORRO_ID(HELFRICH_2, 0x08, 0)
408#define ZORRO_PROD_HELFRICH_SD64_RAM ZORRO_ID(HELFRICH_2, 0x0A, 0)
409#define ZORRO_PROD_HELFRICH_SD64_REG ZORRO_ID(HELFRICH_2, 0x0B, 0)
410
411#define ZORRO_MANUF_MACROSYSTEMS_USA 0x089B
412#define ZORRO_PROD_MACROSYSTEMS_WARP_ENGINE_40xx ZORRO_ID(MACROSYSTEMS_USA, 0x13, 0)
413
414#define ZORRO_MANUF_ELBOX_COMPUTER 0x089E
415#define ZORRO_PROD_ELBOX_COMPUTER_1200_4 ZORRO_ID(ELBOX_COMPUTER, 0x06, 0)
416
417#define ZORRO_MANUF_HARMS_PROFESSIONAL 0x0A00
418#define ZORRO_PROD_HARMS_PROFESSIONAL_030_PLUS ZORRO_ID(HARMS_PROFESSIONAL, 0x10, 0)
419#define ZORRO_PROD_HARMS_PROFESSIONAL_3500 ZORRO_ID(HARMS_PROFESSIONAL, 0xD0, 0)
420
421#define ZORRO_MANUF_MICRONIK 0x0A50
422#define ZORRO_PROD_MICRONIK_RCA_120 ZORRO_ID(MICRONIK, 0x0A, 0)
423
424#define ZORRO_MANUF_MICRONIK2 0x0F0F
425#define ZORRO_PROD_MICRONIK2_Z3I ZORRO_ID(MICRONIK2, 0x01, 0)
426
427#define ZORRO_MANUF_MEGAMICRO 0x1000
428#define ZORRO_PROD_MEGAMICRO_SCRAM_500 ZORRO_ID(MEGAMICRO, 0x03, 0)
429#define ZORRO_PROD_MEGAMICRO_SCRAM_500_RAM ZORRO_ID(MEGAMICRO, 0x04, 0)
430
431#define ZORRO_MANUF_IMTRONICS_2 0x1028
432#define ZORRO_PROD_IMTRONICS_HURRICANE_2800_3 ZORRO_ID(IMTRONICS_2, 0x39, 0)
433#define ZORRO_PROD_IMTRONICS_HURRICANE_2800_4 ZORRO_ID(IMTRONICS_2, 0x57, 0)
434
435/* unofficial ID */
436#define ZORRO_MANUF_INDIVIDUAL_COMPUTERS 0x1212
437#define ZORRO_PROD_INDIVIDUAL_COMPUTERS_BUDDHA ZORRO_ID(INDIVIDUAL_COMPUTERS, 0x00, 0)
438#define ZORRO_PROD_INDIVIDUAL_COMPUTERS_X_SURF ZORRO_ID(INDIVIDUAL_COMPUTERS, 0x17, 0)
439#define ZORRO_PROD_INDIVIDUAL_COMPUTERS_CATWEASEL ZORRO_ID(INDIVIDUAL_COMPUTERS, 0x2A, 0)
440
441#define ZORRO_MANUF_KUPKE_3 0x1248
442#define ZORRO_PROD_KUPKE_GOLEM_HD_3000 ZORRO_ID(KUPKE_3, 0x01, 0)
443
444#define ZORRO_MANUF_ITH 0x1388
445#define ZORRO_PROD_ITH_ISDN_MASTER_II ZORRO_ID(ITH, 0x01, 0)
446
447#define ZORRO_MANUF_VMC 0x1389
448#define ZORRO_PROD_VMC_ISDN_BLASTER_Z2 ZORRO_ID(VMC, 0x01, 0)
449#define ZORRO_PROD_VMC_HYPERCOM_4 ZORRO_ID(VMC, 0x02, 0)
450
451#define ZORRO_MANUF_INFORMATION 0x157C
452#define ZORRO_PROD_INFORMATION_ISDN_ENGINE_I ZORRO_ID(INFORMATION, 0x64, 0)
453
454#define ZORRO_MANUF_VORTEX 0x2017
455#define ZORRO_PROD_VORTEX_GOLDEN_GATE_80386SX ZORRO_ID(VORTEX, 0x07, 0)
456#define ZORRO_PROD_VORTEX_GOLDEN_GATE_RAM ZORRO_ID(VORTEX, 0x08, 0)
457#define ZORRO_PROD_VORTEX_GOLDEN_GATE_80486 ZORRO_ID(VORTEX, 0x09, 0)
458
459#define ZORRO_MANUF_EXPANSION_SYSTEMS 0x2062
460#define ZORRO_PROD_EXPANSION_SYSTEMS_DATAFLYER_4000SX ZORRO_ID(EXPANSION_SYSTEMS, 0x01, 0)
461#define ZORRO_PROD_EXPANSION_SYSTEMS_DATAFLYER_4000SX_RAM ZORRO_ID(EXPANSION_SYSTEMS, 0x02, 0)
462
463#define ZORRO_MANUF_READYSOFT 0x2100
464#define ZORRO_PROD_READYSOFT_AMAX_II_IV ZORRO_ID(READYSOFT, 0x01, 0)
465
466#define ZORRO_MANUF_PHASE5 0x2140
467#define ZORRO_PROD_PHASE5_BLIZZARD_RAM ZORRO_ID(PHASE5, 0x01, 0)
468#define ZORRO_PROD_PHASE5_BLIZZARD ZORRO_ID(PHASE5, 0x02, 0)
469#define ZORRO_PROD_PHASE5_BLIZZARD_1220_IV ZORRO_ID(PHASE5, 0x06, 0)
470#define ZORRO_PROD_PHASE5_FASTLANE_Z3_RAM ZORRO_ID(PHASE5, 0x0A, 0)
471#define ZORRO_PROD_PHASE5_BLIZZARD_1230_II_FASTLANE_Z3_CYBERSCSI_CYBERSTORM060 ZORRO_ID(PHASE5, 0x0B, 0)
472#define ZORRO_PROD_PHASE5_BLIZZARD_1220_CYBERSTORM ZORRO_ID(PHASE5, 0x0C, 0)
473#define ZORRO_PROD_PHASE5_BLIZZARD_1230 ZORRO_ID(PHASE5, 0x0D, 0)
474#define ZORRO_PROD_PHASE5_BLIZZARD_1230_IV_1260 ZORRO_ID(PHASE5, 0x11, 0)
475#define ZORRO_PROD_PHASE5_BLIZZARD_2060 ZORRO_ID(PHASE5, 0x18, 0)
476#define ZORRO_PROD_PHASE5_CYBERSTORM_MK_II ZORRO_ID(PHASE5, 0x19, 0)
477#define ZORRO_PROD_PHASE5_CYBERVISION64 ZORRO_ID(PHASE5, 0x22, 0)
478#define ZORRO_PROD_PHASE5_CYBERVISION64_3D_PROTOTYPE ZORRO_ID(PHASE5, 0x32, 0)
479#define ZORRO_PROD_PHASE5_CYBERVISION64_3D ZORRO_ID(PHASE5, 0x43, 0)
480#define ZORRO_PROD_PHASE5_CYBERSTORM_MK_III ZORRO_ID(PHASE5, 0x64, 0)
481#define ZORRO_PROD_PHASE5_BLIZZARD_603E_PLUS ZORRO_ID(PHASE5, 0x6e, 0)
482
483#define ZORRO_MANUF_DPS 0x2169
484#define ZORRO_PROD_DPS_PERSONAL_ANIMATION_RECORDER ZORRO_ID(DPS, 0x01, 0)
485
486#define ZORRO_MANUF_APOLLO_2 0x2200
487#define ZORRO_PROD_APOLLO_A620_68020_1 ZORRO_ID(APOLLO_2, 0x00, 0)
488#define ZORRO_PROD_APOLLO_A620_68020_2 ZORRO_ID(APOLLO_2, 0x01, 0)
489
490#define ZORRO_MANUF_APOLLO_3 0x2222
491#define ZORRO_PROD_APOLLO_AT_APOLLO ZORRO_ID(APOLLO_3, 0x22, 0)
492#define ZORRO_PROD_APOLLO_1230_1240_1260_2030_4040_4060 ZORRO_ID(APOLLO_3, 0x23, 0)
493
494#define ZORRO_MANUF_PETSOFF_LP 0x38A5
495#define ZORRO_PROD_PETSOFF_LP_DELFINA ZORRO_ID(PETSOFF_LP, 0x00, 0)
496#define ZORRO_PROD_PETSOFF_LP_DELFINA_LITE ZORRO_ID(PETSOFF_LP, 0x01, 0)
497
498#define ZORRO_MANUF_UWE_GERLACH 0x3FF7
499#define ZORRO_PROD_UWE_GERLACH_RAM_ROM ZORRO_ID(UWE_GERLACH, 0xd4, 0)
500
501#define ZORRO_MANUF_ACT 0x4231
502#define ZORRO_PROD_ACT_PRELUDE ZORRO_ID(ACT, 0x01, 0)
503
504#define ZORRO_MANUF_MACROSYSTEMS_GERMANY 0x4754
505#define ZORRO_PROD_MACROSYSTEMS_MAESTRO ZORRO_ID(MACROSYSTEMS_GERMANY, 0x03, 0)
506#define ZORRO_PROD_MACROSYSTEMS_VLAB ZORRO_ID(MACROSYSTEMS_GERMANY, 0x04, 0)
507#define ZORRO_PROD_MACROSYSTEMS_MAESTRO_PRO ZORRO_ID(MACROSYSTEMS_GERMANY, 0x05, 0)
508#define ZORRO_PROD_MACROSYSTEMS_RETINA ZORRO_ID(MACROSYSTEMS_GERMANY, 0x06, 0)
509#define ZORRO_PROD_MACROSYSTEMS_MULTI_EVOLUTION ZORRO_ID(MACROSYSTEMS_GERMANY, 0x08, 0)
510#define ZORRO_PROD_MACROSYSTEMS_TOCCATA ZORRO_ID(MACROSYSTEMS_GERMANY, 0x0C, 0)
511#define ZORRO_PROD_MACROSYSTEMS_RETINA_Z3 ZORRO_ID(MACROSYSTEMS_GERMANY, 0x10, 0)
512#define ZORRO_PROD_MACROSYSTEMS_VLAB_MOTION ZORRO_ID(MACROSYSTEMS_GERMANY, 0x12, 0)
513#define ZORRO_PROD_MACROSYSTEMS_ALTAIS ZORRO_ID(MACROSYSTEMS_GERMANY, 0x13, 0)
514#define ZORRO_PROD_MACROSYSTEMS_FALCON_040 ZORRO_ID(MACROSYSTEMS_GERMANY, 0xFD, 0)
515
516#define ZORRO_MANUF_COMBITEC 0x6766
517
518#define ZORRO_MANUF_SKI_PERIPHERALS 0x8000
519#define ZORRO_PROD_SKI_PERIPHERALS_MAST_FIREBALL ZORRO_ID(SKI_PERIPHERALS, 0x08, 0)
520#define ZORRO_PROD_SKI_PERIPHERALS_SCSI_DUAL_SERIAL ZORRO_ID(SKI_PERIPHERALS, 0x80, 0)
521
522#define ZORRO_MANUF_REIS_WARE_2 0xA9AD
523#define ZORRO_PROD_REIS_WARE_SCAN_KING ZORRO_ID(REIS_WARE_2, 0x11, 0)
524
525#define ZORRO_MANUF_CAMERON 0xAA01
526#define ZORRO_PROD_CAMERON_PERSONAL_A4 ZORRO_ID(CAMERON, 0x10, 0)
527
528#define ZORRO_MANUF_REIS_WARE 0xAA11
529#define ZORRO_PROD_REIS_WARE_HANDYSCANNER ZORRO_ID(REIS_WARE, 0x11, 0)
530
531#define ZORRO_MANUF_PHOENIX_2 0xB5A8
532#define ZORRO_PROD_PHOENIX_ST506_2 ZORRO_ID(PHOENIX_2, 0x21, 0)
533#define ZORRO_PROD_PHOENIX_SCSI_2 ZORRO_ID(PHOENIX_2, 0x22, 0)
534#define ZORRO_PROD_PHOENIX_RAM_2 ZORRO_ID(PHOENIX_2, 0xBE, 0)
535
536#define ZORRO_MANUF_COMBITEC_2 0xC008
537#define ZORRO_PROD_COMBITEC_HD ZORRO_ID(COMBITEC_2, 0x2A, 0)
538#define ZORRO_PROD_COMBITEC_SRAM ZORRO_ID(COMBITEC_2, 0x2B, 0)
539
540
541 /*
542 * Test and illegal Manufacturer IDs.
543 */
544
545#define ZORRO_MANUF_HACKER 0x07DB
546#define ZORRO_PROD_GENERAL_PROTOTYPE ZORRO_ID(HACKER, 0x00, 0)
547#define ZORRO_PROD_HACKER_SCSI ZORRO_ID(HACKER, 0x01, 0)
548#define ZORRO_PROD_RESOURCE_MANAGEMENT_FORCE_QUICKNET_QN2000 ZORRO_ID(HACKER, 0x02, 0)
549#define ZORRO_PROD_VECTOR_CONNECTION_2 ZORRO_ID(HACKER, 0xE0, 0)
550#define ZORRO_PROD_VECTOR_CONNECTION_3 ZORRO_ID(HACKER, 0xE1, 0)
551#define ZORRO_PROD_VECTOR_CONNECTION_4 ZORRO_ID(HACKER, 0xE2, 0)
552#define ZORRO_PROD_VECTOR_CONNECTION_5 ZORRO_ID(HACKER, 0xE3, 0)
diff --git a/include/linux/zsmalloc.h b/include/linux/zsmalloc.h
new file mode 100644
index 000000000000..e44d634e7fb7
--- /dev/null
+++ b/include/linux/zsmalloc.h
@@ -0,0 +1,51 @@
1/*
2 * zsmalloc memory allocator
3 *
4 * Copyright (C) 2011 Nitin Gupta
5 * Copyright (C) 2012, 2013 Minchan Kim
6 *
7 * This code is released using a dual license strategy: BSD/GPL
8 * You can choose the license that better fits your requirements.
9 *
10 * Released under the terms of 3-clause BSD License
11 * Released under the terms of GNU General Public License Version 2.0
12 */
13
14#ifndef _ZS_MALLOC_H_
15#define _ZS_MALLOC_H_
16
17#include <linux/types.h>
18
19/*
20 * zsmalloc mapping modes
21 *
22 * NOTE: These only make a difference when a mapped object spans pages.
23 * They also have no effect when PGTABLE_MAPPING is selected.
24 */
25enum zs_mapmode {
26 ZS_MM_RW, /* normal read-write mapping */
27 ZS_MM_RO, /* read-only (no copy-out at unmap time) */
28 ZS_MM_WO /* write-only (no copy-in at map time) */
29 /*
30 * NOTE: ZS_MM_WO should only be used for initializing new
31 * (uninitialized) allocations. Partial writes to already
32 * initialized allocations should use ZS_MM_RW to preserve the
33 * existing data.
34 */
35};
36
37struct zs_pool;
38
39struct zs_pool *zs_create_pool(gfp_t flags);
40void zs_destroy_pool(struct zs_pool *pool);
41
42unsigned long zs_malloc(struct zs_pool *pool, size_t size);
43void zs_free(struct zs_pool *pool, unsigned long obj);
44
45void *zs_map_object(struct zs_pool *pool, unsigned long handle,
46 enum zs_mapmode mm);
47void zs_unmap_object(struct zs_pool *pool, unsigned long handle);
48
49u64 zs_get_total_size_bytes(struct zs_pool *pool);
50
51#endif