From d635711daa98be86d4c7fd01499c34f566b54ccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Fabian=20Silva=20Delgado?= Date: Fri, 10 Jun 2016 05:30:17 -0300 Subject: Linux-libre 4.6.2-gnu --- include/acpi/acoutput.h | 2 +- include/acpi/acpi_bus.h | 4 +- include/acpi/acpixf.h | 6 +- include/acpi/processor.h | 9 +- include/asm-generic/atomic-long.h | 6 +- include/asm-generic/bug.h | 29 +- include/asm-generic/checksum.h | 8 +- include/asm-generic/fixmap.h | 12 +- include/asm-generic/gpio.h | 4 + include/asm-generic/io-64-nonatomic-hi-lo.h | 2 - include/asm-generic/io-64-nonatomic-lo-hi.h | 2 - include/asm-generic/mm_hooks.h | 12 + include/asm-generic/page.h | 3 - include/asm-generic/pci-bridge.h | 74 -- include/asm-generic/pci-dma-compat.h | 118 -- include/asm-generic/pgtable.h | 17 + include/asm-generic/qspinlock.h | 32 +- include/asm-generic/qspinlock_types.h | 5 + include/asm-generic/siginfo.h | 15 - include/asm-generic/vmlinux.lds.h | 19 +- include/crypto/aead.h | 6 +- include/crypto/akcipher.h | 28 +- include/crypto/algapi.h | 92 +- include/crypto/compress.h | 145 --- include/crypto/drbg.h | 4 - include/crypto/hash.h | 45 + include/crypto/internal/aead.h | 6 + include/crypto/internal/compress.h | 28 - include/crypto/internal/hash.h | 3 - include/crypto/public_key.h | 76 +- include/crypto/skcipher.h | 24 +- include/crypto/xts.h | 27 + include/drm/drmP.h | 30 +- include/drm/drm_atomic_helper.h | 3 + include/drm/drm_crtc.h | 74 +- include/drm/drm_crtc_helper.h | 3 + include/drm/drm_dp_aux_dev.h | 62 + include/drm/drm_dp_dual_mode_helper.h | 92 ++ include/drm/drm_edid.h | 12 + include/drm/drm_fb_helper.h | 6 + include/drm/drm_mipi_dsi.h | 26 + include/drm/drm_modeset_helper_vtables.h | 2 +- include/drm/drm_of.h | 33 + include/drm/exynos_drm.h | 101 -- include/drm/i915_pciids.h | 6 +- include/drm/ttm/ttm_bo_api.h | 2 +- include/dt-bindings/clock/bcm-cygnus.h | 6 + include/dt-bindings/clock/exynos5433.h | 9 +- include/dt-bindings/clock/imx6qdl-clock.h | 16 +- include/dt-bindings/clock/imx6ul-clock.h | 149 +-- include/dt-bindings/clock/lpc32xx-clock.h | 1 + include/dt-bindings/clock/qcom,gcc-ipq4019.h | 158 +++ include/dt-bindings/clock/qcom,gcc-msm8916.h | 1 + include/dt-bindings/clock/qcom,gcc-msm8996.h | 11 + include/dt-bindings/clock/qcom,mmcc-msm8996.h | 17 + include/dt-bindings/clock/r8a7793-clock.h | 2 + include/dt-bindings/clock/r8a7794-clock.h | 1 + include/dt-bindings/clock/rk3036-cru.h | 2 + include/dt-bindings/clock/rk3188-cru-common.h | 1 + include/dt-bindings/clock/rk3228-cru.h | 12 + include/dt-bindings/iio/adc/fsl-imx25-gcq.h | 18 + include/dt-bindings/media/tvp5150.h | 35 + include/dt-bindings/memory/mt8173-larb-port.h | 111 ++ include/dt-bindings/pinctrl/mt7623-pinfunc.h | 520 ++++++++ include/dt-bindings/pinctrl/stm32f429-pinfunc.h | 1239 ++++++++++++++++++++ include/dt-bindings/power/rk3368-power.h | 28 + include/dt-bindings/reset/pistachio-resets.h | 36 + include/kvm/arm_arch_timer.h | 5 + include/kvm/arm_pmu.h | 110 ++ include/kvm/arm_vgic.h | 8 +- include/linux/amba/bus.h | 9 + include/linux/apple-gmux.h | 50 + include/linux/atmel_serial.h | 3 +- include/linux/atomic.h | 31 + include/linux/audit.h | 4 + include/linux/auto_dev-ioctl.h | 6 - include/linux/auto_fs.h | 10 +- include/linux/backing-dev-defs.h | 2 +- include/linux/bcma/bcma.h | 3 + include/linux/bcma/bcma_driver_chipcommon.h | 42 +- include/linux/bio.h | 2 +- include/linux/bitmap.h | 10 + include/linux/blk-mq.h | 16 +- include/linux/blkdev.h | 7 +- include/linux/bpf.h | 35 +- include/linux/brcmphy.h | 2 + include/linux/buffer_head.h | 14 +- include/linux/bug.h | 9 + include/linux/cache.h | 14 + include/linux/can/dev.h | 22 +- include/linux/capability.h | 2 - include/linux/ccp.h | 17 + include/linux/ceph/auth.h | 10 +- include/linux/ceph/ceph_features.h | 2 + include/linux/ceph/ceph_fs.h | 7 +- include/linux/ceph/libceph.h | 12 +- include/linux/ceph/mon_client.h | 31 +- include/linux/ceph/osd_client.h | 16 +- include/linux/cgroup-defs.h | 43 +- include/linux/cgroup.h | 49 + include/linux/clk-provider.h | 29 +- include/linux/clk/at91_pmc.h | 12 - include/linux/clk/renesas.h | 35 + include/linux/clk/shmobile.h | 35 - include/linux/clk/ti.h | 8 +- include/linux/clkdev.h | 3 +- include/linux/clockchips.h | 4 +- include/linux/clocksource.h | 45 +- include/linux/compaction.h | 16 + include/linux/compat.h | 21 + include/linux/compiler-clang.h | 5 + include/linux/compiler-gcc.h | 2 +- include/linux/compiler.h | 17 +- include/linux/configfs.h | 15 +- include/linux/coresight-pmu.h | 39 + include/linux/coresight.h | 34 +- include/linux/cpu.h | 27 +- include/linux/cpufreq.h | 47 +- include/linux/cpuhotplug.h | 93 ++ include/linux/cpumask.h | 2 - include/linux/cred.h | 5 +- include/linux/crypto.h | 252 ---- include/linux/davinci_emac.h | 4 +- include/linux/dcache.h | 47 +- include/linux/debugfs.h | 8 + include/linux/device-mapper.h | 13 +- include/linux/device.h | 24 +- include/linux/devpts_fs.h | 38 +- include/linux/dma-attrs.h | 1 + include/linux/dma-buf.h | 14 +- include/linux/dma-mapping.h | 27 +- include/linux/dmaengine.h | 8 +- include/linux/dqblk_qtree.h | 2 + include/linux/eeprom_93xx46.h | 9 + include/linux/efi.h | 91 +- include/linux/ethtool.h | 102 +- include/linux/exportfs.h | 6 + include/linux/f2fs_fs.h | 38 +- include/linux/fault-inject.h | 5 +- include/linux/fb.h | 3 - include/linux/fence.h | 4 +- include/linux/frame.h | 23 + include/linux/freezer.h | 2 +- include/linux/fs.h | 39 +- include/linux/fscrypto.h | 436 +++++++ include/linux/fsl/guts.h | 105 ++ include/linux/fsnotify.h | 9 - include/linux/fsnotify_backend.h | 9 +- include/linux/ftrace.h | 11 - include/linux/gfp.h | 49 +- include/linux/gpio/driver.h | 39 +- include/linux/hrtimer.h | 12 +- include/linux/huge_mm.h | 32 +- include/linux/hyperv.h | 96 ++ include/linux/ieee80211.h | 26 + include/linux/if_ether.h | 5 + include/linux/if_team.h | 1 + include/linux/igmp.h | 5 - include/linux/iio/common/st_sensors.h | 4 + include/linux/iio/iio.h | 8 +- include/linux/ima.h | 10 +- include/linux/inet_lro.h | 142 --- include/linux/init.h | 4 + include/linux/input/cyttsp.h | 15 - include/linux/interrupt.h | 30 + include/linux/io.h | 1 + include/linux/iommu.h | 2 - include/linux/ioport.h | 38 +- include/linux/ipv6.h | 3 + include/linux/irq.h | 27 +- include/linux/irqchip/mips-gic.h | 3 - include/linux/irqdomain.h | 46 + include/linux/iscsi_boot_sysfs.h | 1 + include/linux/isdn.h | 1 + include/linux/jbd2.h | 16 +- include/linux/kasan.h | 31 +- include/linux/kcov.h | 29 + include/linux/kernel.h | 25 +- include/linux/kernfs.h | 13 +- include/linux/key.h | 1 + include/linux/kfifo.h | 2 +- include/linux/leds.h | 8 +- include/linux/libnvdimm.h | 5 +- include/linux/lightnvm.h | 22 +- include/linux/list_bl.h | 4 +- include/linux/livepatch.h | 9 + include/linux/lockdep.h | 10 +- include/linux/lsm_hooks.h | 35 +- include/linux/mISDNif.h | 2 +- include/linux/mbcache.h | 93 +- include/linux/mbus.h | 3 + include/linux/memcontrol.h | 147 ++- include/linux/memory.h | 14 +- include/linux/memory_hotplug.h | 7 +- include/linux/mfd/as3711.h | 3 +- include/linux/mfd/axp20x.h | 34 +- include/linux/mfd/cros_ec.h | 2 +- include/linux/mfd/imx25-tsadc.h | 140 +++ include/linux/mfd/max77686-private.h | 3 - include/linux/mfd/mt6323/core.h | 36 + include/linux/mfd/mt6323/registers.h | 408 +++++++ include/linux/mfd/mt6397/core.h | 2 + include/linux/mfd/palmas.h | 3 + include/linux/mfd/rc5t583.h | 5 +- include/linux/mfd/samsung/s2mps11.h | 2 + include/linux/mfd/syscon.h | 8 +- include/linux/mfd/syscon/imx6q-iomuxc-gpr.h | 5 + include/linux/mfd/tmio.h | 4 + include/linux/mfd/tps65086.h | 117 ++ include/linux/mfd/tps65090.h | 5 + include/linux/mfd/tps65912.h | 209 ++-- include/linux/migrate.h | 6 +- include/linux/mlx4/device.h | 10 + include/linux/mlx4/driver.h | 3 + include/linux/mlx5/device.h | 56 +- include/linux/mlx5/driver.h | 81 +- include/linux/mlx5/fs.h | 5 + include/linux/mlx5/mlx5_ifc.h | 195 ++- include/linux/mlx5/port.h | 87 ++ include/linux/mlx5/qp.h | 7 +- include/linux/mlx5/vport.h | 9 + include/linux/mm.h | 164 ++- include/linux/mm_types.h | 24 +- include/linux/mman.h | 6 +- include/linux/mmc/core.h | 1 - include/linux/mmc/dw_mmc.h | 12 +- include/linux/mmc/tmio.h | 5 + include/linux/mmdebug.h | 3 +- include/linux/mmzone.h | 26 +- include/linux/msi.h | 9 + include/linux/mtd/bbm.h | 1 - include/linux/mtd/inftl.h | 1 - include/linux/mtd/map.h | 7 +- include/linux/mtd/mtd.h | 6 +- include/linux/mtd/nand.h | 10 +- include/linux/mtd/nand_bch.h | 8 +- include/linux/mtd/nftl.h | 1 - include/linux/mtd/spi-nor.h | 2 + include/linux/namei.h | 3 + include/linux/nd.h | 7 + include/linux/net.h | 11 +- include/linux/netdev_features.h | 3 + include/linux/netdevice.h | 315 +++-- include/linux/netfilter.h | 29 +- include/linux/netfilter/ipset/ip_set.h | 4 + include/linux/netfilter/nfnetlink.h | 2 - include/linux/netfilter/x_tables.h | 6 +- include/linux/netfilter_arp/arp_tables.h | 9 +- include/linux/netfilter_ipv4/ip_tables.h | 9 +- include/linux/netfilter_ipv6/ip6_tables.h | 9 +- include/linux/netlink.h | 10 - include/linux/nfs4.h | 19 + include/linux/nfs_page.h | 6 +- include/linux/nilfs2_fs.h | 4 +- include/linux/nmi.h | 1 - include/linux/notifier.h | 2 + include/linux/nsproxy.h | 2 + include/linux/ntb.h | 10 +- include/linux/nvmem-provider.h | 5 +- include/linux/of.h | 20 +- include/linux/of_fdt.h | 2 +- include/linux/omap-gpmc.h | 5 + include/linux/oom.h | 4 +- include/linux/page-flags-layout.h | 2 + include/linux/page-flags.h | 56 +- include/linux/page_ext.h | 1 + include/linux/page_owner.h | 50 +- include/linux/page_ref.h | 173 +++ include/linux/pagemap.h | 54 +- include/linux/pci-dma-compat.h | 147 +++ include/linux/pci.h | 88 +- include/linux/pci_ids.h | 5 + include/linux/perf/arm_pmu.h | 2 + include/linux/perf_event.h | 25 +- include/linux/phy.h | 3 - include/linux/phy_fixed.h | 5 +- include/linux/pkeys.h | 33 + include/linux/platform_data/ad5761.h | 44 + include/linux/platform_data/ad7879.h | 41 + include/linux/platform_data/adau17x1.h | 2 +- include/linux/platform_data/at24.h | 10 +- include/linux/platform_data/brcmfmac-sdio.h | 135 --- include/linux/platform_data/brcmfmac.h | 185 +++ include/linux/platform_data/microread.h | 35 - include/linux/platform_data/mtd-nand-s3c2410.h | 1 - include/linux/platform_data/ntc_thermistor.h | 1 + include/linux/platform_data/sa11x0-serial.h | 8 +- include/linux/platform_data/serial-omap.h | 2 +- include/linux/pm_clock.h | 9 + include/linux/pm_domain.h | 13 +- include/linux/pm_opp.h | 27 + include/linux/pmem.h | 57 +- include/linux/poison.h | 4 + include/linux/poll.h | 2 +- include/linux/posix-timers.h | 3 - include/linux/power/bq24735-charger.h | 2 + include/linux/power_supply.h | 3 + include/linux/pps_kernel.h | 17 +- include/linux/proc_ns.h | 4 + include/linux/psci.h | 3 + include/linux/pstore_ram.h | 2 +- include/linux/ptp_clock_kernel.h | 8 + include/linux/pxa2xx_ssp.h | 1 + include/linux/qed/common_hsi.h | 36 +- include/linux/qed/eth_common.h | 171 ++- include/linux/qed/qed_chain.h | 4 + include/linux/qed/qed_eth_if.h | 14 +- include/linux/qed/qed_if.h | 14 +- include/linux/quicklist.h | 2 +- include/linux/quota.h | 5 + include/linux/quotaops.h | 3 + include/linux/radix-tree.h | 28 +- include/linux/rculist.h | 21 + include/linux/rculist_nulls.h | 39 + include/linux/rcupdate.h | 6 +- include/linux/regmap.h | 107 +- include/linux/regulator/act8865.h | 4 +- include/linux/regulator/driver.h | 17 + include/linux/regulator/lp872x.h | 5 + include/linux/regulator/machine.h | 12 + include/linux/reset-controller.h | 2 +- include/linux/rfkill-gpio.h | 37 - include/linux/rfkill.h | 18 +- include/linux/rio.h | 98 +- include/linux/rio_drv.h | 15 +- include/linux/rio_regs.h | 3 + include/linux/rmap.h | 6 + include/linux/rmi.h | 359 ++++++ include/linux/rotary_encoder.h | 17 - include/linux/rtc.h | 4 + include/linux/sched.h | 48 +- include/linux/sched/sysctl.h | 21 - include/linux/scpi_protocol.h | 3 +- include/linux/security.h | 16 +- include/linux/seq_file.h | 13 +- include/linux/serial_8250.h | 8 + include/linux/serial_core.h | 25 +- include/linux/signal.h | 15 + include/linux/skbuff.h | 69 +- include/linux/slab.h | 23 +- include/linux/slab_def.h | 17 + include/linux/slub_def.h | 12 + include/linux/soc/samsung/exynos-pmu.h | 24 + include/linux/soc/samsung/exynos-regs-pmu.h | 693 +++++++++++ include/linux/soc/ti/ti-msgmgr.h | 35 + include/linux/socket.h | 7 +- include/linux/spi/ad7879.h | 41 - include/linux/spi/eeprom.h | 2 - include/linux/spi/spi.h | 145 +++ include/linux/srcu.h | 19 +- include/linux/stackdepot.h | 32 + include/linux/stm.h | 10 + include/linux/stmmac.h | 18 +- include/linux/string.h | 8 +- include/linux/sunrpc/auth.h | 7 + include/linux/sunrpc/clnt.h | 18 +- include/linux/sunrpc/gss_krb5.h | 32 +- include/linux/sunrpc/rpc_rdma.h | 12 +- include/linux/sunrpc/sched.h | 32 +- include/linux/sunrpc/svc.h | 2 +- include/linux/sunrpc/svc_rdma.h | 20 +- include/linux/sunrpc/xprt.h | 22 +- include/linux/sunrpc/xprtmultipath.h | 69 ++ include/linux/sunrpc/xprtrdma.h | 2 - include/linux/swap.h | 10 +- include/linux/syscalls.h | 6 + include/linux/tcp.h | 14 +- include/linux/thermal.h | 22 +- include/linux/thread_info.h | 6 +- include/linux/tick.h | 99 +- include/linux/timekeeper_internal.h | 2 + include/linux/timekeeping.h | 58 + include/linux/trace_events.h | 17 +- include/linux/tracepoint-defs.h | 14 +- include/linux/tty.h | 60 +- include/linux/tty_driver.h | 4 +- include/linux/tty_ldisc.h | 13 - include/linux/uio.h | 1 + include/linux/unaligned/access_ok.h | 24 +- include/linux/usb.h | 16 +- include/linux/usb/composite.h | 6 + include/linux/usb/gadget.h | 20 +- include/linux/usb/hcd.h | 6 +- include/linux/usb/msm_hsusb_hw.h | 1 + include/linux/usb/musb.h | 2 +- include/linux/usb/of.h | 7 + include/linux/usb/otg-fsm.h | 15 + include/linux/usb/renesas_usbhs.h | 1 + include/linux/usb/storage.h | 12 +- include/linux/vfio.h | 11 + include/linux/vga_switcheroo.h | 36 +- include/linux/virtio.h | 23 +- include/linux/virtio_ring.h | 35 + include/linux/vm_event_item.h | 2 + include/linux/vmw_vmci_defs.h | 43 +- include/linux/watchdog.h | 43 +- include/media/i2c/tvp5150.h | 33 - include/media/media-device.h | 149 +++ include/media/media-entity.h | 20 + include/media/rc-core.h | 2 + include/media/tuner.h | 9 +- include/media/v4l2-ctrls.h | 12 - include/media/v4l2-dev.h | 1 + include/media/v4l2-mc.h | 243 ++++ include/media/v4l2-subdev.h | 3 + include/media/videobuf2-dma-contig.h | 11 +- include/media/videobuf2-dvb.h | 5 + include/media/vsp1.h | 33 + include/misc/cxl.h | 8 +- include/net/6lowpan.h | 32 + include/net/act_api.h | 85 +- include/net/addrconf.h | 2 + include/net/bluetooth/hci.h | 1 + include/net/bluetooth/hci_core.h | 3 + include/net/bond_3ad.h | 1 + include/net/cfg80211.h | 8 + include/net/checksum.h | 17 +- include/net/cls_cgroup.h | 7 +- include/net/codel.h | 4 + include/net/devlink.h | 140 +++ include/net/dsa.h | 15 +- include/net/dst.h | 12 + include/net/dst_cache.h | 97 ++ include/net/dst_metadata.h | 6 +- include/net/flow.h | 2 +- include/net/flow_dissector.h | 13 + include/net/genetlink.h | 4 - include/net/hwbm.h | 28 + include/net/inet6_connection_sock.h | 1 - include/net/inet6_hashtables.h | 13 +- include/net/inet_frag.h | 1 + include/net/inet_hashtables.h | 25 +- include/net/ip.h | 8 +- include/net/ip6_checksum.h | 3 +- include/net/ip6_route.h | 3 + include/net/ip6_tunnel.h | 14 +- include/net/ip_tunnels.h | 71 +- include/net/ipv6.h | 16 +- include/net/kcm.h | 226 ++++ include/net/l3mdev.h | 4 +- include/net/lwtunnel.h | 4 +- include/net/mac80211.h | 200 +++- include/net/mac802154.h | 15 +- include/net/netfilter/nft_masq.h | 4 +- include/net/netns/ipv4.h | 19 + include/net/netns/ipv6.h | 3 + include/net/netns/xfrm.h | 1 + include/net/phonet/phonet.h | 2 +- include/net/ping.h | 3 +- include/net/pkt_cls.h | 65 + include/net/raw.h | 2 +- include/net/route.h | 8 +- include/net/sch_generic.h | 26 +- include/net/sctp/auth.h | 4 +- include/net/sctp/sctp.h | 16 +- include/net/sctp/sm.h | 2 +- include/net/sctp/structs.h | 27 +- include/net/sock.h | 12 +- include/net/switchdev.h | 4 + include/net/tc_act/tc_gact.h | 16 + include/net/tc_act/tc_ife.h | 61 + include/net/tc_act/tc_skbedit.h | 16 + include/net/tcp.h | 61 +- include/net/udp.h | 3 +- include/net/udp_tunnel.h | 15 +- include/net/vxlan.h | 191 ++- include/rdma/ib_addr.h | 14 +- include/rdma/ib_mad.h | 4 +- include/rdma/ib_verbs.h | 48 +- include/rdma/iw_cm.h | 6 +- include/rdma/opa_port_info.h | 2 +- include/rdma/rdma_vt.h | 481 ++++++++ include/rdma/rdmavt_cq.h | 99 ++ include/rdma/rdmavt_mr.h | 139 +++ include/rdma/rdmavt_qp.h | 446 +++++++ include/rxrpc/packet.h | 15 +- include/scsi/iscsi_if.h | 2 + include/scsi/libiscsi_tcp.h | 13 +- include/scsi/scsi_device.h | 4 + include/scsi/scsi_devinfo.h | 1 + include/scsi/scsi_dh.h | 2 + include/scsi/scsi_proto.h | 12 + include/scsi/scsi_transport_fc.h | 15 +- include/soc/fsl/qe/qe.h | 2 - include/soc/mediatek/smi.h | 58 + include/sound/hda_chmap.h | 76 ++ include/sound/hda_regmap.h | 2 + include/sound/jack.h | 23 +- include/sound/pcm.h | 2 + include/sound/soc-topology.h | 21 +- include/sound/soc.h | 2 +- include/target/iscsi/iscsi_target_core.h | 4 +- include/target/target_core_base.h | 14 +- include/target/target_core_fabric.h | 8 +- include/trace/events/btrfs.h | 91 +- include/trace/events/compaction.h | 57 +- include/trace/events/cpuhp.h | 66 ++ include/trace/events/f2fs.h | 12 +- include/trace/events/fib6.h | 2 +- include/trace/events/gfpflags.h | 43 - include/trace/events/huge_memory.h | 2 - include/trace/events/kmem.h | 44 +- include/trace/events/kvm.h | 9 +- include/trace/events/mmflags.h | 183 +++ include/trace/events/page_isolation.h | 2 +- include/trace/events/page_ref.h | 134 +++ include/trace/events/power.h | 22 + include/trace/events/sunvnet.h | 139 +++ include/trace/events/thermal.h | 16 +- include/trace/events/timer.h | 36 +- include/trace/events/tlb.h | 4 +- include/trace/events/vmscan.h | 2 +- include/trace/events/writeback.h | 121 +- include/uapi/asm-generic/siginfo.h | 17 +- include/uapi/asm-generic/socket.h | 2 + include/uapi/asm-generic/unistd.h | 6 +- include/uapi/drm/drm.h | 1 + include/uapi/drm/drm_mode.h | 15 + include/uapi/drm/exynos_drm.h | 43 +- include/uapi/drm/i915_drm.h | 43 +- include/uapi/drm/msm_drm.h | 2 + include/uapi/linux/Kbuild | 4 + include/uapi/linux/audit.h | 1 + include/uapi/linux/aufs_type.h | 2 +- include/uapi/linux/auto_fs.h | 21 +- include/uapi/linux/auto_fs4.h | 17 +- include/uapi/linux/bpf.h | 53 + include/uapi/linux/byteorder/big_endian.h | 24 +- include/uapi/linux/byteorder/little_endian.h | 24 +- include/uapi/linux/devlink.h | 72 ++ include/uapi/linux/dma-buf.h | 40 + include/uapi/linux/dqblk_xfs.h | 1 + include/uapi/linux/elf-em.h | 3 - include/uapi/linux/ethtool.h | 437 +++++-- include/uapi/linux/fs.h | 21 + include/uapi/linux/genetlink.h | 1 + include/uapi/linux/gpio.h | 58 + include/uapi/linux/if.h | 30 +- include/uapi/linux/if_bridge.h | 37 +- include/uapi/linux/if_ether.h | 1 + include/uapi/linux/if_link.h | 52 + include/uapi/linux/if_macsec.h | 163 +++ include/uapi/linux/iio/types.h | 1 + include/uapi/linux/input.h | 1 + include/uapi/linux/ip.h | 2 + include/uapi/linux/ipv6.h | 3 + include/uapi/linux/kcm.h | 40 + include/uapi/linux/kcov.h | 10 + include/uapi/linux/kernel.h | 1 + include/uapi/linux/kvm.h | 19 +- include/uapi/linux/libc-compat.h | 44 + include/uapi/linux/media.h | 45 +- include/uapi/linux/mroute6.h | 9 +- include/uapi/linux/ndctl.h | 13 + include/uapi/linux/netconf.h | 1 + include/uapi/linux/netfilter/nf_conntrack_common.h | 12 +- include/uapi/linux/netfilter/nf_tables.h | 6 + include/uapi/linux/netlink.h | 4 + include/uapi/linux/netlink_diag.h | 2 + include/uapi/linux/nl80211.h | 14 + include/uapi/linux/openvswitch.h | 49 + include/uapi/linux/pkt_cls.h | 3 + include/uapi/linux/ptp_clock.h | 13 +- include/uapi/linux/quota.h | 14 + include/uapi/linux/rfkill.h | 2 + include/uapi/linux/rio_mport_cdev.h | 277 +++++ include/uapi/linux/sched.h | 3 +- include/uapi/linux/serial_core.h | 3 + include/uapi/linux/stddef.h | 4 + include/uapi/linux/swab.h | 34 +- include/uapi/linux/target_core_user.h | 1 + include/uapi/linux/tc_act/Kbuild | 1 + include/uapi/linux/tc_act/tc_ife.h | 38 + include/uapi/linux/tcp.h | 5 + include/uapi/linux/usb/ch11.h | 21 + include/uapi/linux/usb/ch9.h | 38 +- include/uapi/linux/usb/tmc.h | 29 +- include/uapi/linux/usbdevice_fs.h | 3 + include/uapi/linux/v4l2-common.h | 46 +- include/uapi/linux/v4l2-controls.h | 11 + include/uapi/linux/vfio.h | 92 +- include/uapi/linux/vhost.h | 6 + include/uapi/linux/videodev2.h | 7 + include/uapi/linux/virtio_balloon.h | 3 +- include/uapi/linux/virtio_blk.h | 6 +- include/uapi/linux/virtio_config.h | 2 + include/uapi/misc/cxl.h | 24 + include/uapi/rdma/hfi/hfi1_user.h | 14 +- include/uapi/rdma/rdma_netlink.h | 5 +- include/uapi/sound/asequencer.h | 12 +- include/uapi/sound/asound.h | 4 + include/video/imx-ipu-v3.h | 9 +- include/video/omap-panel-data.h | 15 - include/video/omapdss.h | 89 +- include/xen/interface/io/netif.h | 861 ++++++++++++-- 595 files changed, 17600 insertions(+), 4111 deletions(-) delete mode 100644 include/asm-generic/io-64-nonatomic-hi-lo.h delete mode 100644 include/asm-generic/io-64-nonatomic-lo-hi.h delete mode 100644 include/asm-generic/pci-bridge.h delete mode 100644 include/asm-generic/pci-dma-compat.h delete mode 100644 include/crypto/compress.h delete mode 100644 include/crypto/internal/compress.h create mode 100644 include/drm/drm_dp_aux_dev.h create mode 100644 include/drm/drm_dp_dual_mode_helper.h delete mode 100644 include/drm/exynos_drm.h create mode 100644 include/dt-bindings/clock/qcom,gcc-ipq4019.h create mode 100644 include/dt-bindings/iio/adc/fsl-imx25-gcq.h create mode 100644 include/dt-bindings/media/tvp5150.h create mode 100644 include/dt-bindings/memory/mt8173-larb-port.h create mode 100644 include/dt-bindings/pinctrl/mt7623-pinfunc.h create mode 100644 include/dt-bindings/pinctrl/stm32f429-pinfunc.h create mode 100644 include/dt-bindings/power/rk3368-power.h create mode 100644 include/dt-bindings/reset/pistachio-resets.h create mode 100644 include/kvm/arm_pmu.h create mode 100644 include/linux/apple-gmux.h create mode 100644 include/linux/clk/renesas.h delete mode 100644 include/linux/clk/shmobile.h create mode 100644 include/linux/coresight-pmu.h create mode 100644 include/linux/cpuhotplug.h create mode 100644 include/linux/frame.h create mode 100644 include/linux/fscrypto.h delete mode 100644 include/linux/inet_lro.h create mode 100644 include/linux/kcov.h create mode 100644 include/linux/mfd/imx25-tsadc.h create mode 100644 include/linux/mfd/mt6323/core.h create mode 100644 include/linux/mfd/mt6323/registers.h create mode 100644 include/linux/mfd/tps65086.h create mode 100644 include/linux/mlx5/port.h create mode 100644 include/linux/page_ref.h create mode 100644 include/linux/pci-dma-compat.h create mode 100644 include/linux/pkeys.h create mode 100644 include/linux/platform_data/ad5761.h create mode 100644 include/linux/platform_data/ad7879.h delete mode 100644 include/linux/platform_data/brcmfmac-sdio.h create mode 100644 include/linux/platform_data/brcmfmac.h delete mode 100644 include/linux/platform_data/microread.h delete mode 100644 include/linux/rfkill-gpio.h create mode 100644 include/linux/rmi.h delete mode 100644 include/linux/rotary_encoder.h create mode 100644 include/linux/soc/samsung/exynos-pmu.h create mode 100644 include/linux/soc/samsung/exynos-regs-pmu.h create mode 100644 include/linux/soc/ti/ti-msgmgr.h delete mode 100644 include/linux/spi/ad7879.h create mode 100644 include/linux/stackdepot.h create mode 100644 include/linux/sunrpc/xprtmultipath.h delete mode 100644 include/media/i2c/tvp5150.h create mode 100644 include/media/v4l2-mc.h create mode 100644 include/media/vsp1.h create mode 100644 include/net/devlink.h create mode 100644 include/net/dst_cache.h create mode 100644 include/net/hwbm.h create mode 100644 include/net/kcm.h create mode 100644 include/net/tc_act/tc_ife.h create mode 100644 include/rdma/rdma_vt.h create mode 100644 include/rdma/rdmavt_cq.h create mode 100644 include/rdma/rdmavt_mr.h create mode 100644 include/rdma/rdmavt_qp.h create mode 100644 include/soc/mediatek/smi.h create mode 100644 include/sound/hda_chmap.h create mode 100644 include/trace/events/cpuhp.h delete mode 100644 include/trace/events/gfpflags.h create mode 100644 include/trace/events/mmflags.h create mode 100644 include/trace/events/page_ref.h create mode 100644 include/trace/events/sunvnet.h create mode 100644 include/uapi/linux/devlink.h create mode 100644 include/uapi/linux/dma-buf.h create mode 100644 include/uapi/linux/gpio.h create mode 100644 include/uapi/linux/if_macsec.h create mode 100644 include/uapi/linux/kcm.h create mode 100644 include/uapi/linux/kcov.h create mode 100644 include/uapi/linux/rio_mport_cdev.h create mode 100644 include/uapi/linux/tc_act/tc_ife.h (limited to 'include') diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h index 5bfc61943..34f601e7b 100644 --- a/include/acpi/acoutput.h +++ b/include/acpi/acoutput.h @@ -262,7 +262,7 @@ #define ACPI_GET_FUNCTION_NAME _acpi_function_name /* - * The Name parameter should be the procedure name as a quoted string. + * The Name parameter should be the procedure name as a non-quoted string. * The function name is also used by the function exit macros below. * Note: (const char) is used to be compatible with the debug interfaces * and macros such as __func__. diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 14362a84c..3a932501d 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -394,13 +394,13 @@ struct acpi_data_node { static inline bool is_acpi_node(struct fwnode_handle *fwnode) { - return fwnode && (fwnode->type == FWNODE_ACPI + return !IS_ERR_OR_NULL(fwnode) && (fwnode->type == FWNODE_ACPI || fwnode->type == FWNODE_ACPI_DATA); } static inline bool is_acpi_device_node(struct fwnode_handle *fwnode) { - return fwnode && fwnode->type == FWNODE_ACPI; + return !IS_ERR_OR_NULL(fwnode) && fwnode->type == FWNODE_ACPI; } static inline struct acpi_device *to_acpi_device_node(struct fwnode_handle *fwnode) diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index c96621e87..17556979d 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h @@ -897,11 +897,9 @@ ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3) acpi_warning(const char *module_name, u32 line_number, const char *format, ...)) -ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3) +ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(1) void ACPI_INTERNAL_VAR_XFACE - acpi_info(const char *module_name, - u32 line_number, - const char *format, ...)) + acpi_info(const char *format, ...)) ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3) void ACPI_INTERNAL_VAR_XFACE acpi_bios_error(const char *module_name, diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 07fb100bc..6f1805dd5 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h @@ -9,6 +9,7 @@ #define ACPI_PROCESSOR_CLASS "processor" #define ACPI_PROCESSOR_DEVICE_NAME "Processor" #define ACPI_PROCESSOR_DEVICE_HID "ACPI0007" +#define ACPI_PROCESSOR_CONTAINER_HID "ACPI0010" #define ACPI_PROCESSOR_BUSY_METRIC 10 @@ -394,14 +395,6 @@ static inline int acpi_processor_hotplug(struct acpi_processor *pr) } #endif /* CONFIG_ACPI_PROCESSOR_IDLE */ -#if defined(CONFIG_PM_SLEEP) & defined(CONFIG_ACPI_PROCESSOR_IDLE) -void acpi_processor_syscore_init(void); -void acpi_processor_syscore_exit(void); -#else -static inline void acpi_processor_syscore_init(void) {} -static inline void acpi_processor_syscore_exit(void) {} -#endif - /* in processor_thermal.c */ int acpi_processor_get_limit_info(struct acpi_processor *pr); extern const struct thermal_cooling_device_ops processor_cooling_ops; diff --git a/include/asm-generic/atomic-long.h b/include/asm-generic/atomic-long.h index eb1973bad..5e1f345b5 100644 --- a/include/asm-generic/atomic-long.h +++ b/include/asm-generic/atomic-long.h @@ -98,14 +98,14 @@ ATOMIC_LONG_ADD_SUB_OP(sub, _release) #define atomic_long_xchg(v, new) \ (ATOMIC_LONG_PFX(_xchg)((ATOMIC_LONG_PFX(_t) *)(v), (new))) -static inline void atomic_long_inc(atomic_long_t *l) +static __always_inline void atomic_long_inc(atomic_long_t *l) { ATOMIC_LONG_PFX(_t) *v = (ATOMIC_LONG_PFX(_t) *)l; ATOMIC_LONG_PFX(_inc)(v); } -static inline void atomic_long_dec(atomic_long_t *l) +static __always_inline void atomic_long_dec(atomic_long_t *l) { ATOMIC_LONG_PFX(_t) *v = (ATOMIC_LONG_PFX(_t) *)l; @@ -113,7 +113,7 @@ static inline void atomic_long_dec(atomic_long_t *l) } #define ATOMIC_LONG_OP(op) \ -static inline void \ +static __always_inline void \ atomic_long_##op(long i, atomic_long_t *l) \ { \ ATOMIC_LONG_PFX(_t) *v = (ATOMIC_LONG_PFX(_t) *)l; \ diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index 630dd2372..6f9624722 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h @@ -81,6 +81,12 @@ extern void warn_slowpath_null(const char *file, const int line); do { printk(arg); __WARN_TAINT(taint); } while (0) #endif +/* used internally by panic.c */ +struct warn_args; + +void __warn(const char *file, int line, void *caller, unsigned taint, + struct pt_regs *regs, struct warn_args *args); + #ifndef WARN_ON #define WARN_ON(condition) ({ \ int __ret_warn_on = !!(condition); \ @@ -110,9 +116,10 @@ extern void warn_slowpath_null(const char *file, const int line); static bool __section(.data.unlikely) __warned; \ int __ret_warn_once = !!(condition); \ \ - if (unlikely(__ret_warn_once)) \ - if (WARN_ON(!__warned)) \ - __warned = true; \ + if (unlikely(__ret_warn_once && !__warned)) { \ + __warned = true; \ + WARN_ON(1); \ + } \ unlikely(__ret_warn_once); \ }) @@ -120,9 +127,10 @@ extern void warn_slowpath_null(const char *file, const int line); static bool __section(.data.unlikely) __warned; \ int __ret_warn_once = !!(condition); \ \ - if (unlikely(__ret_warn_once)) \ - if (WARN(!__warned, format)) \ - __warned = true; \ + if (unlikely(__ret_warn_once && !__warned)) { \ + __warned = true; \ + WARN(1, format); \ + } \ unlikely(__ret_warn_once); \ }) @@ -130,9 +138,10 @@ extern void warn_slowpath_null(const char *file, const int line); static bool __section(.data.unlikely) __warned; \ int __ret_warn_once = !!(condition); \ \ - if (unlikely(__ret_warn_once)) \ - if (WARN_TAINT(!__warned, taint, format)) \ - __warned = true; \ + if (unlikely(__ret_warn_once && !__warned)) { \ + __warned = true; \ + WARN_TAINT(1, taint, format); \ + } \ unlikely(__ret_warn_once); \ }) @@ -142,7 +151,7 @@ extern void warn_slowpath_null(const char *file, const int line); #endif #ifndef HAVE_ARCH_BUG_ON -#define BUG_ON(condition) do { if (condition) ; } while (0) +#define BUG_ON(condition) do { if (condition) BUG(); } while (0) #endif #ifndef HAVE_ARCH_WARN_ON diff --git a/include/asm-generic/checksum.h b/include/asm-generic/checksum.h index 59811df58..3150cbd8e 100644 --- a/include/asm-generic/checksum.h +++ b/include/asm-generic/checksum.h @@ -65,14 +65,14 @@ static inline __sum16 csum_fold(__wsum csum) * returns a 16-bit checksum, already complemented */ extern __wsum -csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len, - unsigned short proto, __wsum sum); +csum_tcpudp_nofold(__be32 saddr, __be32 daddr, __u32 len, + __u8 proto, __wsum sum); #endif #ifndef csum_tcpudp_magic static inline __sum16 -csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len, - unsigned short proto, __wsum sum) +csum_tcpudp_magic(__be32 saddr, __be32 daddr, __u32 len, + __u8 proto, __wsum sum) { return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum)); } diff --git a/include/asm-generic/fixmap.h b/include/asm-generic/fixmap.h index 1cbb8338e..827e4d3bb 100644 --- a/include/asm-generic/fixmap.h +++ b/include/asm-generic/fixmap.h @@ -70,12 +70,12 @@ static inline unsigned long virt_to_fix(const unsigned long vaddr) #endif /* Return a pointer with offset calculated */ -#define __set_fixmap_offset(idx, phys, flags) \ -({ \ - unsigned long addr; \ - __set_fixmap(idx, phys, flags); \ - addr = fix_to_virt(idx) + ((phys) & (PAGE_SIZE - 1)); \ - addr; \ +#define __set_fixmap_offset(idx, phys, flags) \ +({ \ + unsigned long ________addr; \ + __set_fixmap(idx, phys, flags); \ + ________addr = fix_to_virt(idx) + ((phys) & (PAGE_SIZE - 1)); \ + ________addr; \ }) #define set_fixmap_offset(idx, phys) \ diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index 40ec1433f..8ca627dce 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h @@ -26,8 +26,12 @@ */ #ifndef ARCH_NR_GPIOS +#if defined(CONFIG_ARCH_NR_GPIO) && CONFIG_ARCH_NR_GPIO > 0 +#define ARCH_NR_GPIOS CONFIG_ARCH_NR_GPIO +#else #define ARCH_NR_GPIOS 512 #endif +#endif /* * "valid" GPIO numbers are nonnegative and may be passed to diff --git a/include/asm-generic/io-64-nonatomic-hi-lo.h b/include/asm-generic/io-64-nonatomic-hi-lo.h deleted file mode 100644 index 32b73abce..000000000 --- a/include/asm-generic/io-64-nonatomic-hi-lo.h +++ /dev/null @@ -1,2 +0,0 @@ -/* XXX: delete asm-generic/io-64-nonatomic-hi-lo.h after converting new users */ -#include diff --git a/include/asm-generic/io-64-nonatomic-lo-hi.h b/include/asm-generic/io-64-nonatomic-lo-hi.h deleted file mode 100644 index 55a627c37..000000000 --- a/include/asm-generic/io-64-nonatomic-lo-hi.h +++ /dev/null @@ -1,2 +0,0 @@ -/* XXX: delete asm-generic/io-64-nonatomic-lo-hi.h after converting new users */ -#include diff --git a/include/asm-generic/mm_hooks.h b/include/asm-generic/mm_hooks.h index 866aa461e..cc5d9a140 100644 --- a/include/asm-generic/mm_hooks.h +++ b/include/asm-generic/mm_hooks.h @@ -26,4 +26,16 @@ static inline void arch_bprm_mm_init(struct mm_struct *mm, { } +static inline bool arch_vma_access_permitted(struct vm_area_struct *vma, + bool write, bool execute, bool foreign) +{ + /* by default, allow everything */ + return true; +} + +static inline bool arch_pte_access_permitted(pte_t pte, bool write) +{ + /* by default, allow everything */ + return true; +} #endif /* _ASM_GENERIC_MM_HOOKS_H */ diff --git a/include/asm-generic/page.h b/include/asm-generic/page.h index 37d1fe289..67cfb7dbc 100644 --- a/include/asm-generic/page.h +++ b/include/asm-generic/page.h @@ -24,9 +24,6 @@ #ifndef __ASSEMBLY__ -#define get_user_page(vaddr) __get_free_page(GFP_KERNEL) -#define free_user_page(page, addr) free_page(addr) - #define clear_page(page) memset((page), 0, PAGE_SIZE) #define copy_page(to,from) memcpy((to), (from), PAGE_SIZE) diff --git a/include/asm-generic/pci-bridge.h b/include/asm-generic/pci-bridge.h deleted file mode 100644 index 20db2e5a0..000000000 --- a/include/asm-generic/pci-bridge.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#ifndef _ASM_GENERIC_PCI_BRIDGE_H -#define _ASM_GENERIC_PCI_BRIDGE_H - -#ifdef __KERNEL__ - -enum { - /* Force re-assigning all resources (ignore firmware - * setup completely) - */ - PCI_REASSIGN_ALL_RSRC = 0x00000001, - - /* Re-assign all bus numbers */ - PCI_REASSIGN_ALL_BUS = 0x00000002, - - /* Do not try to assign, just use existing setup */ - PCI_PROBE_ONLY = 0x00000004, - - /* Don't bother with ISA alignment unless the bridge has - * ISA forwarding enabled - */ - PCI_CAN_SKIP_ISA_ALIGN = 0x00000008, - - /* Enable domain numbers in /proc */ - PCI_ENABLE_PROC_DOMAINS = 0x00000010, - /* ... except for domain 0 */ - PCI_COMPAT_DOMAIN_0 = 0x00000020, - - /* PCIe downstream ports are bridges that normally lead to only a - * device 0, but if this is set, we scan all possible devices, not - * just device 0. - */ - PCI_SCAN_ALL_PCIE_DEVS = 0x00000040, -}; - -#ifdef CONFIG_PCI -extern unsigned int pci_flags; - -static inline void pci_set_flags(int flags) -{ - pci_flags = flags; -} - -static inline void pci_add_flags(int flags) -{ - pci_flags |= flags; -} - -static inline void pci_clear_flags(int flags) -{ - pci_flags &= ~flags; -} - -static inline int pci_has_flag(int flag) -{ - return pci_flags & flag; -} -#else -static inline void pci_set_flags(int flags) { } -static inline void pci_add_flags(int flags) { } -static inline void pci_clear_flags(int flags) { } -static inline int pci_has_flag(int flag) -{ - return 0; -} -#endif /* CONFIG_PCI */ - -#endif /* __KERNEL__ */ -#endif /* _ASM_GENERIC_PCI_BRIDGE_H */ diff --git a/include/asm-generic/pci-dma-compat.h b/include/asm-generic/pci-dma-compat.h deleted file mode 100644 index eafce7b6f..000000000 --- a/include/asm-generic/pci-dma-compat.h +++ /dev/null @@ -1,118 +0,0 @@ -/* include this file if the platform implements the dma_ DMA Mapping API - * and wants to provide the pci_ DMA Mapping API in terms of it */ - -#ifndef _ASM_GENERIC_PCI_DMA_COMPAT_H -#define _ASM_GENERIC_PCI_DMA_COMPAT_H - -#include - -static inline void * -pci_alloc_consistent(struct pci_dev *hwdev, size_t size, - dma_addr_t *dma_handle) -{ - return dma_alloc_coherent(hwdev == NULL ? NULL : &hwdev->dev, size, dma_handle, GFP_ATOMIC); -} - -static inline void * -pci_zalloc_consistent(struct pci_dev *hwdev, size_t size, - dma_addr_t *dma_handle) -{ - return dma_zalloc_coherent(hwdev == NULL ? NULL : &hwdev->dev, - size, dma_handle, GFP_ATOMIC); -} - -static inline void -pci_free_consistent(struct pci_dev *hwdev, size_t size, - void *vaddr, dma_addr_t dma_handle) -{ - dma_free_coherent(hwdev == NULL ? NULL : &hwdev->dev, size, vaddr, dma_handle); -} - -static inline dma_addr_t -pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction) -{ - return dma_map_single(hwdev == NULL ? NULL : &hwdev->dev, ptr, size, (enum dma_data_direction)direction); -} - -static inline void -pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, - size_t size, int direction) -{ - dma_unmap_single(hwdev == NULL ? NULL : &hwdev->dev, dma_addr, size, (enum dma_data_direction)direction); -} - -static inline dma_addr_t -pci_map_page(struct pci_dev *hwdev, struct page *page, - unsigned long offset, size_t size, int direction) -{ - return dma_map_page(hwdev == NULL ? NULL : &hwdev->dev, page, offset, size, (enum dma_data_direction)direction); -} - -static inline void -pci_unmap_page(struct pci_dev *hwdev, dma_addr_t dma_address, - size_t size, int direction) -{ - dma_unmap_page(hwdev == NULL ? NULL : &hwdev->dev, dma_address, size, (enum dma_data_direction)direction); -} - -static inline int -pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, - int nents, int direction) -{ - return dma_map_sg(hwdev == NULL ? NULL : &hwdev->dev, sg, nents, (enum dma_data_direction)direction); -} - -static inline void -pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, - int nents, int direction) -{ - dma_unmap_sg(hwdev == NULL ? NULL : &hwdev->dev, sg, nents, (enum dma_data_direction)direction); -} - -static inline void -pci_dma_sync_single_for_cpu(struct pci_dev *hwdev, dma_addr_t dma_handle, - size_t size, int direction) -{ - dma_sync_single_for_cpu(hwdev == NULL ? NULL : &hwdev->dev, dma_handle, size, (enum dma_data_direction)direction); -} - -static inline void -pci_dma_sync_single_for_device(struct pci_dev *hwdev, dma_addr_t dma_handle, - size_t size, int direction) -{ - dma_sync_single_for_device(hwdev == NULL ? NULL : &hwdev->dev, dma_handle, size, (enum dma_data_direction)direction); -} - -static inline void -pci_dma_sync_sg_for_cpu(struct pci_dev *hwdev, struct scatterlist *sg, - int nelems, int direction) -{ - dma_sync_sg_for_cpu(hwdev == NULL ? NULL : &hwdev->dev, sg, nelems, (enum dma_data_direction)direction); -} - -static inline void -pci_dma_sync_sg_for_device(struct pci_dev *hwdev, struct scatterlist *sg, - int nelems, int direction) -{ - dma_sync_sg_for_device(hwdev == NULL ? NULL : &hwdev->dev, sg, nelems, (enum dma_data_direction)direction); -} - -static inline int -pci_dma_mapping_error(struct pci_dev *pdev, dma_addr_t dma_addr) -{ - return dma_mapping_error(&pdev->dev, dma_addr); -} - -#ifdef CONFIG_PCI -static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) -{ - return dma_set_mask(&dev->dev, mask); -} - -static inline int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) -{ - return dma_set_coherent_mask(&dev->dev, mask); -} -#endif - -#endif diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index c370b261c..9401f4819 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h @@ -783,6 +783,23 @@ static inline int pmd_clear_huge(pmd_t *pmd) } #endif /* CONFIG_HAVE_ARCH_HUGE_VMAP */ +#ifndef __HAVE_ARCH_FLUSH_PMD_TLB_RANGE +#ifdef CONFIG_TRANSPARENT_HUGEPAGE +/* + * ARCHes with special requirements for evicting THP backing TLB entries can + * implement this. Otherwise also, it can help optimize normal TLB flush in + * THP regime. stock flush_tlb_range() typically has optimization to nuke the + * entire TLB TLB if flush span is greater than a threshold, which will + * likely be true for a single huge page. Thus a single thp flush will + * invalidate the entire TLB which is not desitable. + * e.g. see arch/arc: flush_pmd_tlb_range + */ +#define flush_pmd_tlb_range(vma, addr, end) flush_tlb_range(vma, addr, end) +#else +#define flush_pmd_tlb_range(vma, addr, end) BUILD_BUG() +#endif +#endif + #endif /* !__ASSEMBLY__ */ #ifndef io_remap_pfn_range diff --git a/include/asm-generic/qspinlock.h b/include/asm-generic/qspinlock.h index 39e1cb201..6bd05700d 100644 --- a/include/asm-generic/qspinlock.h +++ b/include/asm-generic/qspinlock.h @@ -28,7 +28,30 @@ */ static __always_inline int queued_spin_is_locked(struct qspinlock *lock) { - return atomic_read(&lock->val); + /* + * queued_spin_lock_slowpath() can ACQUIRE the lock before + * issuing the unordered store that sets _Q_LOCKED_VAL. + * + * See both smp_cond_acquire() sites for more detail. + * + * This however means that in code like: + * + * spin_lock(A) spin_lock(B) + * spin_unlock_wait(B) spin_is_locked(A) + * do_something() do_something() + * + * Both CPUs can end up running do_something() because the store + * setting _Q_LOCKED_VAL will pass through the loads in + * spin_unlock_wait() and/or spin_is_locked(). + * + * Avoid this by issuing a full memory barrier between the spin_lock() + * and the loads in spin_unlock_wait() and spin_is_locked(). + * + * Note that regular mutual exclusion doesn't care about this + * delayed store. + */ + smp_mb(); + return atomic_read(&lock->val) & _Q_LOCKED_MASK; } /** @@ -108,6 +131,8 @@ static __always_inline void queued_spin_unlock(struct qspinlock *lock) */ static inline void queued_spin_unlock_wait(struct qspinlock *lock) { + /* See queued_spin_is_locked() */ + smp_mb(); while (atomic_read(&lock->val) & _Q_LOCKED_MASK) cpu_relax(); } @@ -119,11 +144,6 @@ static __always_inline bool virt_spin_lock(struct qspinlock *lock) } #endif -/* - * Initializier - */ -#define __ARCH_SPIN_LOCK_UNLOCKED { ATOMIC_INIT(0) } - /* * Remapping spinlock architecture specific functions to the corresponding * queued spinlock functions. diff --git a/include/asm-generic/qspinlock_types.h b/include/asm-generic/qspinlock_types.h index 85f888e86..034acd0c4 100644 --- a/include/asm-generic/qspinlock_types.h +++ b/include/asm-generic/qspinlock_types.h @@ -32,6 +32,11 @@ typedef struct qspinlock { atomic_t val; } arch_spinlock_t; +/* + * Initializier + */ +#define __ARCH_SPIN_LOCK_UNLOCKED { ATOMIC_INIT(0) } + /* * Bitfields in the atomic value: * diff --git a/include/asm-generic/siginfo.h b/include/asm-generic/siginfo.h index 3d1a3af5c..a2508a8f9 100644 --- a/include/asm-generic/siginfo.h +++ b/include/asm-generic/siginfo.h @@ -17,21 +17,6 @@ struct siginfo; void do_schedule_next_timer(struct siginfo *info); -#ifndef HAVE_ARCH_COPY_SIGINFO - -#include - -static inline void copy_siginfo(struct siginfo *to, struct siginfo *from) -{ - if (from->si_code < 0) - memcpy(to, from, sizeof(*to)); - else - /* _sigchld is currently the largest know union member */ - memcpy(to, from, __ARCH_SI_PREAMBLE_SIZE + sizeof(from->_sifields._sigchld)); -} - -#endif - extern int copy_siginfo_to_user(struct siginfo __user *to, const struct siginfo *from); #endif diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index c4bd0e2c1..339125bb4 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -157,7 +157,7 @@ #define EARLYCON_TABLE() STRUCT_ALIGN(); \ VMLINUX_SYMBOL(__earlycon_table) = .; \ *(__earlycon_table) \ - *(__earlycon_table_end) + VMLINUX_SYMBOL(__earlycon_table_end) = .; #else #define EARLYCON_TABLE() #endif @@ -179,7 +179,6 @@ #define RESERVEDMEM_OF_TABLES() OF_TABLE(CONFIG_OF_RESERVED_MEM, reservedmem) #define CPU_METHOD_OF_TABLES() OF_TABLE(CONFIG_SMP, cpu_method) #define CPUIDLE_METHOD_OF_TABLES() OF_TABLE(CONFIG_CPU_IDLE, cpuidle_method) -#define EARLYCON_OF_TABLES() OF_TABLE(CONFIG_SERIAL_EARLYCON, earlycon) #ifdef CONFIG_ACPI #define ACPI_PROBE_TABLE(name) \ @@ -256,6 +255,7 @@ .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \ VMLINUX_SYMBOL(__start_rodata) = .; \ *(.rodata) *(.rodata.*) \ + *(.data..ro_after_init) /* Read only after init */ \ *(__vermagic) /* Kernel version magic */ \ . = ALIGN(8); \ VMLINUX_SYMBOL(__start___tracepoints_ptrs) = .; \ @@ -456,7 +456,7 @@ *(.entry.text) \ VMLINUX_SYMBOL(__entry_text_end) = .; -#ifdef CONFIG_FUNCTION_GRAPH_TRACER +#if defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_KASAN) #define IRQENTRY_TEXT \ ALIGN_FUNCTION(); \ VMLINUX_SYMBOL(__irqentry_text_start) = .; \ @@ -466,6 +466,16 @@ #define IRQENTRY_TEXT #endif +#if defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_KASAN) +#define SOFTIRQENTRY_TEXT \ + ALIGN_FUNCTION(); \ + VMLINUX_SYMBOL(__softirqentry_text_start) = .; \ + *(.softirqentry.text) \ + VMLINUX_SYMBOL(__softirqentry_text_end) = .; +#else +#define SOFTIRQENTRY_TEXT +#endif + /* Section used for early init (in .S files) */ #define HEAD_TEXT *(.head.text) @@ -526,8 +536,7 @@ IRQCHIP_OF_MATCH_TABLE() \ ACPI_PROBE_TABLE(irqchip) \ ACPI_PROBE_TABLE(clksrc) \ - EARLYCON_TABLE() \ - EARLYCON_OF_TABLES() + EARLYCON_TABLE() #define INIT_TEXT \ *(.init.text) \ diff --git a/include/crypto/aead.h b/include/crypto/aead.h index 84d13b11a..957bb8763 100644 --- a/include/crypto/aead.h +++ b/include/crypto/aead.h @@ -31,10 +31,10 @@ * * For example: authenc(hmac(sha256), cbc(aes)) * - * The example code provided for the asynchronous block cipher operation - * applies here as well. Naturally all *ablkcipher* symbols must be exchanged + * The example code provided for the symmetric key cipher operation + * applies here as well. Naturally all *skcipher* symbols must be exchanged * the *aead* pendants discussed in the following. In addition, for the AEAD - * operation, the aead_request_set_assoc function must be used to set the + * operation, the aead_request_set_ad function must be used to set the * pointer to the associated data memory location before performing the * encryption or decryption operation. In case of an encryption, the associated * data memory is filled during the encryption operation. For decryption, the diff --git a/include/crypto/akcipher.h b/include/crypto/akcipher.h index 354de15ce..c37cc59e9 100644 --- a/include/crypto/akcipher.h +++ b/include/crypto/akcipher.h @@ -114,7 +114,7 @@ struct akcipher_alg { */ /** - * crypto_alloc_akcipher() -- allocate AKCIPHER tfm handle + * crypto_alloc_akcipher() - allocate AKCIPHER tfm handle * @alg_name: is the cra_name / name or cra_driver_name / driver name of the * public key algorithm e.g. "rsa" * @type: specifies the type of the algorithm @@ -171,7 +171,7 @@ static inline struct crypto_akcipher *crypto_akcipher_reqtfm( } /** - * crypto_free_akcipher() -- free AKCIPHER tfm handle + * crypto_free_akcipher() - free AKCIPHER tfm handle * * @tfm: AKCIPHER tfm handle allocated with crypto_alloc_akcipher() */ @@ -181,7 +181,7 @@ static inline void crypto_free_akcipher(struct crypto_akcipher *tfm) } /** - * akcipher_request_alloc() -- allocates public key request + * akcipher_request_alloc() - allocates public key request * * @tfm: AKCIPHER tfm handle allocated with crypto_alloc_akcipher() * @gfp: allocation flags @@ -201,7 +201,7 @@ static inline struct akcipher_request *akcipher_request_alloc( } /** - * akcipher_request_free() -- zeroize and free public key request + * akcipher_request_free() - zeroize and free public key request * * @req: request to free */ @@ -211,14 +211,14 @@ static inline void akcipher_request_free(struct akcipher_request *req) } /** - * akcipher_request_set_callback() -- Sets an asynchronous callback. + * akcipher_request_set_callback() - Sets an asynchronous callback. * * Callback will be called when an asynchronous operation on a given * request is finished. * * @req: request that the callback will be set for * @flgs: specify for instance if the operation may backlog - * @cmlp: callback which will be called + * @cmpl: callback which will be called * @data: private data used by the caller */ static inline void akcipher_request_set_callback(struct akcipher_request *req, @@ -232,7 +232,7 @@ static inline void akcipher_request_set_callback(struct akcipher_request *req, } /** - * akcipher_request_set_crypt() -- Sets request parameters + * akcipher_request_set_crypt() - Sets request parameters * * Sets parameters required by crypto operation * @@ -255,7 +255,7 @@ static inline void akcipher_request_set_crypt(struct akcipher_request *req, } /** - * crypto_akcipher_maxsize() -- Get len for output buffer + * crypto_akcipher_maxsize() - Get len for output buffer * * Function returns the dest buffer size required for a given key * @@ -271,7 +271,7 @@ static inline int crypto_akcipher_maxsize(struct crypto_akcipher *tfm) } /** - * crypto_akcipher_encrypt() -- Invoke public key encrypt operation + * crypto_akcipher_encrypt() - Invoke public key encrypt operation * * Function invokes the specific public key encrypt operation for a given * public key algorithm @@ -289,7 +289,7 @@ static inline int crypto_akcipher_encrypt(struct akcipher_request *req) } /** - * crypto_akcipher_decrypt() -- Invoke public key decrypt operation + * crypto_akcipher_decrypt() - Invoke public key decrypt operation * * Function invokes the specific public key decrypt operation for a given * public key algorithm @@ -307,7 +307,7 @@ static inline int crypto_akcipher_decrypt(struct akcipher_request *req) } /** - * crypto_akcipher_sign() -- Invoke public key sign operation + * crypto_akcipher_sign() - Invoke public key sign operation * * Function invokes the specific public key sign operation for a given * public key algorithm @@ -325,7 +325,7 @@ static inline int crypto_akcipher_sign(struct akcipher_request *req) } /** - * crypto_akcipher_verify() -- Invoke public key verify operation + * crypto_akcipher_verify() - Invoke public key verify operation * * Function invokes the specific public key verify operation for a given * public key algorithm @@ -343,7 +343,7 @@ static inline int crypto_akcipher_verify(struct akcipher_request *req) } /** - * crypto_akcipher_set_pub_key() -- Invoke set public key operation + * crypto_akcipher_set_pub_key() - Invoke set public key operation * * Function invokes the algorithm specific set key function, which knows * how to decode and interpret the encoded key @@ -364,7 +364,7 @@ static inline int crypto_akcipher_set_pub_key(struct crypto_akcipher *tfm, } /** - * crypto_akcipher_set_priv_key() -- Invoke set private key operation + * crypto_akcipher_set_priv_key() - Invoke set private key operation * * Function invokes the algorithm specific set key function, which knows * how to decode and interpret the encoded key diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h index c9fe145f7..eeafd21af 100644 --- a/include/crypto/algapi.h +++ b/include/crypto/algapi.h @@ -15,6 +15,7 @@ #include #include #include +#include #include struct crypto_aead; @@ -128,6 +129,75 @@ struct ablkcipher_walk { unsigned int blocksize; }; +#define ENGINE_NAME_LEN 30 +/* + * struct crypto_engine - crypto hardware engine + * @name: the engine name + * @idling: the engine is entering idle state + * @busy: request pump is busy + * @running: the engine is on working + * @cur_req_prepared: current request is prepared + * @list: link with the global crypto engine list + * @queue_lock: spinlock to syncronise access to request queue + * @queue: the crypto queue of the engine + * @rt: whether this queue is set to run as a realtime task + * @prepare_crypt_hardware: a request will soon arrive from the queue + * so the subsystem requests the driver to prepare the hardware + * by issuing this call + * @unprepare_crypt_hardware: there are currently no more requests on the + * queue so the subsystem notifies the driver that it may relax the + * hardware by issuing this call + * @prepare_request: do some prepare if need before handle the current request + * @unprepare_request: undo any work done by prepare_message() + * @crypt_one_request: do encryption for current request + * @kworker: thread struct for request pump + * @kworker_task: pointer to task for request pump kworker thread + * @pump_requests: work struct for scheduling work to the request pump + * @priv_data: the engine private data + * @cur_req: the current request which is on processing + */ +struct crypto_engine { + char name[ENGINE_NAME_LEN]; + bool idling; + bool busy; + bool running; + bool cur_req_prepared; + + struct list_head list; + spinlock_t queue_lock; + struct crypto_queue queue; + + bool rt; + + int (*prepare_crypt_hardware)(struct crypto_engine *engine); + int (*unprepare_crypt_hardware)(struct crypto_engine *engine); + + int (*prepare_request)(struct crypto_engine *engine, + struct ablkcipher_request *req); + int (*unprepare_request)(struct crypto_engine *engine, + struct ablkcipher_request *req); + int (*crypt_one_request)(struct crypto_engine *engine, + struct ablkcipher_request *req); + + struct kthread_worker kworker; + struct task_struct *kworker_task; + struct kthread_work pump_requests; + + void *priv_data; + struct ablkcipher_request *cur_req; +}; + +int crypto_transfer_request(struct crypto_engine *engine, + struct ablkcipher_request *req, bool need_pump); +int crypto_transfer_request_to_engine(struct crypto_engine *engine, + struct ablkcipher_request *req); +void crypto_finalize_request(struct crypto_engine *engine, + struct ablkcipher_request *req, int err); +int crypto_engine_start(struct crypto_engine *engine); +int crypto_engine_stop(struct crypto_engine *engine); +struct crypto_engine *crypto_engine_alloc_init(struct device *dev, bool rt); +int crypto_engine_exit(struct crypto_engine *engine); + extern const struct crypto_type crypto_ablkcipher_type; extern const struct crypto_type crypto_blkcipher_type; @@ -184,6 +254,10 @@ int crypto_enqueue_request(struct crypto_queue *queue, struct crypto_async_request *request); struct crypto_async_request *crypto_dequeue_request(struct crypto_queue *queue); int crypto_tfm_in_queue(struct crypto_queue *queue, struct crypto_tfm *tfm); +static inline unsigned int crypto_queue_len(struct crypto_queue *queue) +{ + return queue->qlen; +} /* These functions require the input/output to be aligned as u32. */ void crypto_inc(u8 *a, unsigned int size); @@ -275,24 +349,6 @@ static inline struct cipher_alg *crypto_cipher_alg(struct crypto_cipher *tfm) return &crypto_cipher_tfm(tfm)->__crt_alg->cra_cipher; } -static inline struct crypto_hash *crypto_spawn_hash(struct crypto_spawn *spawn) -{ - u32 type = CRYPTO_ALG_TYPE_HASH; - u32 mask = CRYPTO_ALG_TYPE_HASH_MASK; - - return __crypto_hash_cast(crypto_spawn_tfm(spawn, type, mask)); -} - -static inline void *crypto_hash_ctx(struct crypto_hash *tfm) -{ - return crypto_tfm_ctx(&tfm->base); -} - -static inline void *crypto_hash_ctx_aligned(struct crypto_hash *tfm) -{ - return crypto_tfm_ctx_aligned(&tfm->base); -} - static inline void blkcipher_walk_init(struct blkcipher_walk *walk, struct scatterlist *dst, struct scatterlist *src, diff --git a/include/crypto/compress.h b/include/crypto/compress.h deleted file mode 100644 index 5b67af834..000000000 --- a/include/crypto/compress.h +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Compress: Compression algorithms under the cryptographic API. - * - * Copyright 2008 Sony Corporation - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. - * If not, see . - */ - -#ifndef _CRYPTO_COMPRESS_H -#define _CRYPTO_COMPRESS_H - -#include - - -struct comp_request { - const void *next_in; /* next input byte */ - void *next_out; /* next output byte */ - unsigned int avail_in; /* bytes available at next_in */ - unsigned int avail_out; /* bytes available at next_out */ -}; - -enum zlib_comp_params { - ZLIB_COMP_LEVEL = 1, /* e.g. Z_DEFAULT_COMPRESSION */ - ZLIB_COMP_METHOD, /* e.g. Z_DEFLATED */ - ZLIB_COMP_WINDOWBITS, /* e.g. MAX_WBITS */ - ZLIB_COMP_MEMLEVEL, /* e.g. DEF_MEM_LEVEL */ - ZLIB_COMP_STRATEGY, /* e.g. Z_DEFAULT_STRATEGY */ - __ZLIB_COMP_MAX, -}; - -#define ZLIB_COMP_MAX (__ZLIB_COMP_MAX - 1) - - -enum zlib_decomp_params { - ZLIB_DECOMP_WINDOWBITS = 1, /* e.g. DEF_WBITS */ - __ZLIB_DECOMP_MAX, -}; - -#define ZLIB_DECOMP_MAX (__ZLIB_DECOMP_MAX - 1) - - -struct crypto_pcomp { - struct crypto_tfm base; -}; - -struct pcomp_alg { - int (*compress_setup)(struct crypto_pcomp *tfm, const void *params, - unsigned int len); - int (*compress_init)(struct crypto_pcomp *tfm); - int (*compress_update)(struct crypto_pcomp *tfm, - struct comp_request *req); - int (*compress_final)(struct crypto_pcomp *tfm, - struct comp_request *req); - int (*decompress_setup)(struct crypto_pcomp *tfm, const void *params, - unsigned int len); - int (*decompress_init)(struct crypto_pcomp *tfm); - int (*decompress_update)(struct crypto_pcomp *tfm, - struct comp_request *req); - int (*decompress_final)(struct crypto_pcomp *tfm, - struct comp_request *req); - - struct crypto_alg base; -}; - -extern struct crypto_pcomp *crypto_alloc_pcomp(const char *alg_name, u32 type, - u32 mask); - -static inline struct crypto_tfm *crypto_pcomp_tfm(struct crypto_pcomp *tfm) -{ - return &tfm->base; -} - -static inline void crypto_free_pcomp(struct crypto_pcomp *tfm) -{ - crypto_destroy_tfm(tfm, crypto_pcomp_tfm(tfm)); -} - -static inline struct pcomp_alg *__crypto_pcomp_alg(struct crypto_alg *alg) -{ - return container_of(alg, struct pcomp_alg, base); -} - -static inline struct pcomp_alg *crypto_pcomp_alg(struct crypto_pcomp *tfm) -{ - return __crypto_pcomp_alg(crypto_pcomp_tfm(tfm)->__crt_alg); -} - -static inline int crypto_compress_setup(struct crypto_pcomp *tfm, - const void *params, unsigned int len) -{ - return crypto_pcomp_alg(tfm)->compress_setup(tfm, params, len); -} - -static inline int crypto_compress_init(struct crypto_pcomp *tfm) -{ - return crypto_pcomp_alg(tfm)->compress_init(tfm); -} - -static inline int crypto_compress_update(struct crypto_pcomp *tfm, - struct comp_request *req) -{ - return crypto_pcomp_alg(tfm)->compress_update(tfm, req); -} - -static inline int crypto_compress_final(struct crypto_pcomp *tfm, - struct comp_request *req) -{ - return crypto_pcomp_alg(tfm)->compress_final(tfm, req); -} - -static inline int crypto_decompress_setup(struct crypto_pcomp *tfm, - const void *params, unsigned int len) -{ - return crypto_pcomp_alg(tfm)->decompress_setup(tfm, params, len); -} - -static inline int crypto_decompress_init(struct crypto_pcomp *tfm) -{ - return crypto_pcomp_alg(tfm)->decompress_init(tfm); -} - -static inline int crypto_decompress_update(struct crypto_pcomp *tfm, - struct comp_request *req) -{ - return crypto_pcomp_alg(tfm)->decompress_update(tfm, req); -} - -static inline int crypto_decompress_final(struct crypto_pcomp *tfm, - struct comp_request *req) -{ - return crypto_pcomp_alg(tfm)->decompress_final(tfm, req); -} - -#endif /* _CRYPTO_COMPRESS_H */ diff --git a/include/crypto/drbg.h b/include/crypto/drbg.h index 9756c7089..d961b2b16 100644 --- a/include/crypto/drbg.h +++ b/include/crypto/drbg.h @@ -117,10 +117,6 @@ struct drbg_state { void *priv_data; /* Cipher handle */ bool seeded; /* DRBG fully seeded? */ bool pr; /* Prediction resistance enabled? */ -#ifdef CONFIG_CRYPTO_FIPS - bool fips_primed; /* Continuous test primed? */ - unsigned char *prev; /* FIPS 140-2 continuous test value */ -#endif struct work_struct seed_work; /* asynchronous seeding support */ struct crypto_rng *jent; const struct drbg_state_ops *d_ops; diff --git a/include/crypto/hash.h b/include/crypto/hash.h index 6361892ea..1969f1416 100644 --- a/include/crypto/hash.h +++ b/include/crypto/hash.h @@ -14,6 +14,7 @@ #define _CRYPTO_HASH_H #include +#include struct crypto_ahash; @@ -259,6 +260,28 @@ static inline void crypto_free_ahash(struct crypto_ahash *tfm) crypto_destroy_tfm(tfm, crypto_ahash_tfm(tfm)); } +/** + * crypto_has_ahash() - Search for the availability of an ahash. + * @alg_name: is the cra_name / name or cra_driver_name / driver name of the + * ahash + * @type: specifies the type of the ahash + * @mask: specifies the mask for the ahash + * + * Return: true when the ahash is known to the kernel crypto API; false + * otherwise + */ +int crypto_has_ahash(const char *alg_name, u32 type, u32 mask); + +static inline const char *crypto_ahash_alg_name(struct crypto_ahash *tfm) +{ + return crypto_tfm_alg_name(crypto_ahash_tfm(tfm)); +} + +static inline const char *crypto_ahash_driver_name(struct crypto_ahash *tfm) +{ + return crypto_tfm_alg_driver_name(crypto_ahash_tfm(tfm)); +} + static inline unsigned int crypto_ahash_alignmask( struct crypto_ahash *tfm) { @@ -550,6 +573,12 @@ static inline void ahash_request_free(struct ahash_request *req) kzfree(req); } +static inline void ahash_request_zero(struct ahash_request *req) +{ + memzero_explicit(req, sizeof(*req) + + crypto_ahash_reqsize(crypto_ahash_reqtfm(req))); +} + static inline struct ahash_request *ahash_request_cast( struct crypto_async_request *req) { @@ -657,6 +686,16 @@ static inline void crypto_free_shash(struct crypto_shash *tfm) crypto_destroy_tfm(tfm, crypto_shash_tfm(tfm)); } +static inline const char *crypto_shash_alg_name(struct crypto_shash *tfm) +{ + return crypto_tfm_alg_name(crypto_shash_tfm(tfm)); +} + +static inline const char *crypto_shash_driver_name(struct crypto_shash *tfm) +{ + return crypto_tfm_alg_driver_name(crypto_shash_tfm(tfm)); +} + static inline unsigned int crypto_shash_alignmask( struct crypto_shash *tfm) { @@ -872,4 +911,10 @@ int crypto_shash_final(struct shash_desc *desc, u8 *out); int crypto_shash_finup(struct shash_desc *desc, const u8 *data, unsigned int len, u8 *out); +static inline void shash_desc_zero(struct shash_desc *desc) +{ + memzero_explicit(desc, + sizeof(*desc) + crypto_shash_descsize(desc->tfm)); +} + #endif /* _CRYPTO_HASH_H */ diff --git a/include/crypto/internal/aead.h b/include/crypto/internal/aead.h index 5554cdd8d..da3864991 100644 --- a/include/crypto/internal/aead.h +++ b/include/crypto/internal/aead.h @@ -80,6 +80,12 @@ static inline u32 aead_request_flags(struct aead_request *req) return req->base.flags; } +static inline struct aead_request *aead_request_cast( + struct crypto_async_request *req) +{ + return container_of(req, struct aead_request, base); +} + static inline void crypto_set_aead_spawn( struct crypto_aead_spawn *spawn, struct crypto_instance *inst) { diff --git a/include/crypto/internal/compress.h b/include/crypto/internal/compress.h deleted file mode 100644 index 178a888d1..000000000 --- a/include/crypto/internal/compress.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Compress: Compression algorithms under the cryptographic API. - * - * Copyright 2008 Sony Corporation - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. - * If not, see . - */ - -#ifndef _CRYPTO_INTERNAL_COMPRESS_H -#define _CRYPTO_INTERNAL_COMPRESS_H - -#include - -extern int crypto_register_pcomp(struct pcomp_alg *alg); -extern int crypto_unregister_pcomp(struct pcomp_alg *alg); - -#endif /* _CRYPTO_INTERNAL_COMPRESS_H */ diff --git a/include/crypto/internal/hash.h b/include/crypto/internal/hash.h index 3b4af1d7c..49dae16f8 100644 --- a/include/crypto/internal/hash.h +++ b/include/crypto/internal/hash.h @@ -57,9 +57,6 @@ int crypto_hash_walk_first(struct ahash_request *req, struct crypto_hash_walk *walk); int crypto_ahash_walk_first(struct ahash_request *req, struct crypto_hash_walk *walk); -int crypto_hash_walk_first_compat(struct hash_desc *hdesc, - struct crypto_hash_walk *walk, - struct scatterlist *sg, unsigned int len); static inline int crypto_ahash_walk_done(struct crypto_hash_walk *walk, int err) diff --git a/include/crypto/public_key.h b/include/crypto/public_key.h index cc2516df0..aa730ea7f 100644 --- a/include/crypto/public_key.h +++ b/include/crypto/public_key.h @@ -14,30 +14,6 @@ #ifndef _LINUX_PUBLIC_KEY_H #define _LINUX_PUBLIC_KEY_H -#include -#include - -enum pkey_algo { - PKEY_ALGO_DSA, - PKEY_ALGO_RSA, - PKEY_ALGO__LAST -}; - -extern const char *const pkey_algo_name[PKEY_ALGO__LAST]; -extern const struct public_key_algorithm *pkey_algo[PKEY_ALGO__LAST]; - -/* asymmetric key implementation supports only up to SHA224 */ -#define PKEY_HASH__LAST (HASH_ALGO_SHA224 + 1) - -enum pkey_id_type { - PKEY_ID_PGP, /* OpenPGP generated key ID */ - PKEY_ID_X509, /* X.509 arbitrary subjectKeyIdentifier */ - PKEY_ID_PKCS7, /* Signature in PKCS#7 message */ - PKEY_ID_TYPE__LAST -}; - -extern const char *const pkey_id_type_name[PKEY_ID_TYPE__LAST]; - /* * The use to which an asymmetric key is being put. */ @@ -59,31 +35,10 @@ extern const char *const key_being_used_for[NR__KEY_BEING_USED_FOR]; * part. */ struct public_key { - const struct public_key_algorithm *algo; - u8 capabilities; -#define PKEY_CAN_ENCRYPT 0x01 -#define PKEY_CAN_DECRYPT 0x02 -#define PKEY_CAN_SIGN 0x04 -#define PKEY_CAN_VERIFY 0x08 - enum pkey_algo pkey_algo : 8; - enum pkey_id_type id_type : 8; - union { - MPI mpi[5]; - struct { - MPI p; /* DSA prime */ - MPI q; /* DSA group order */ - MPI g; /* DSA group generator */ - MPI y; /* DSA public-key value = g^x mod p */ - MPI x; /* DSA secret exponent (if present) */ - } dsa; - struct { - MPI n; /* RSA public modulus */ - MPI e; /* RSA public encryption exponent */ - MPI d; /* RSA secret encryption exponent (if present) */ - MPI p; /* RSA secret prime (if present) */ - MPI q; /* RSA secret prime (if present) */ - } rsa; - }; + void *key; + u32 keylen; + const char *id_type; + const char *pkey_algo; }; extern void public_key_destroy(void *payload); @@ -92,23 +47,15 @@ extern void public_key_destroy(void *payload); * Public key cryptography signature data */ struct public_key_signature { + u8 *s; /* Signature */ + u32 s_size; /* Number of bytes in signature */ u8 *digest; - u8 digest_size; /* Number of bytes in digest */ - u8 nr_mpi; /* Occupancy of mpi[] */ - enum pkey_algo pkey_algo : 8; - enum hash_algo pkey_hash_algo : 8; - union { - MPI mpi[2]; - struct { - MPI s; /* m^d mod n */ - } rsa; - struct { - MPI r; - MPI s; - } dsa; - }; + u8 digest_size; /* Number of bytes in digest */ + const char *pkey_algo; + const char *hash_algo; }; +extern struct asymmetric_key_subtype public_key_subtype; struct key; extern int verify_signature(const struct key *key, const struct public_key_signature *sig); @@ -119,4 +66,7 @@ extern struct key *x509_request_asymmetric_key(struct key *keyring, const struct asymmetric_key_id *skid, bool partial); +int public_key_verify_signature(const struct public_key *pkey, + const struct public_key_signature *sig); + #endif /* _LINUX_PUBLIC_KEY_H */ diff --git a/include/crypto/skcipher.h b/include/crypto/skcipher.h index fd8742a40..905490c1d 100644 --- a/include/crypto/skcipher.h +++ b/include/crypto/skcipher.h @@ -60,8 +60,7 @@ struct crypto_skcipher { unsigned int ivsize; unsigned int reqsize; - - bool has_setkey; + unsigned int keysize; struct crypto_tfm base; }; @@ -232,6 +231,12 @@ static inline int crypto_has_skcipher(const char *alg_name, u32 type, crypto_skcipher_mask(mask)); } +static inline const char *crypto_skcipher_driver_name( + struct crypto_skcipher *tfm) +{ + return crypto_tfm_alg_driver_name(crypto_skcipher_tfm(tfm)); +} + /** * crypto_skcipher_ivsize() - obtain IV size * @tfm: cipher handle @@ -309,7 +314,13 @@ static inline int crypto_skcipher_setkey(struct crypto_skcipher *tfm, static inline bool crypto_skcipher_has_setkey(struct crypto_skcipher *tfm) { - return tfm->has_setkey; + return tfm->keysize; +} + +static inline unsigned int crypto_skcipher_default_keysize( + struct crypto_skcipher *tfm) +{ + return tfm->keysize; } /** @@ -440,6 +451,13 @@ static inline void skcipher_request_free(struct skcipher_request *req) kzfree(req); } +static inline void skcipher_request_zero(struct skcipher_request *req) +{ + struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); + + memzero_explicit(req, sizeof(*req) + crypto_skcipher_reqsize(tfm)); +} + /** * skcipher_request_set_callback() - set asynchronous callback function * @req: request handle diff --git a/include/crypto/xts.h b/include/crypto/xts.h index 72c09eb56..ede6b97b2 100644 --- a/include/crypto/xts.h +++ b/include/crypto/xts.h @@ -2,6 +2,9 @@ #define _CRYPTO_XTS_H #include +#include +#include +#include struct scatterlist; struct blkcipher_desc; @@ -24,4 +27,28 @@ int xts_crypt(struct blkcipher_desc *desc, struct scatterlist *dst, struct scatterlist *src, unsigned int nbytes, struct xts_crypt_req *req); +static inline int xts_check_key(struct crypto_tfm *tfm, + const u8 *key, unsigned int keylen) +{ + u32 *flags = &tfm->crt_flags; + + /* + * key consists of keys of equal size concatenated, therefore + * the length must be even. + */ + if (keylen % 2) { + *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; + return -EINVAL; + } + + /* ensure that the AES and tweak key are not identical */ + if (fips_enabled && + !crypto_memneq(key, key + (keylen / 2), keylen / 2)) { + *flags |= CRYPTO_TFM_RES_WEAK_KEY; + return -EINVAL; + } + + return 0; +} + #endif /* _CRYPTO_XTS_H */ diff --git a/include/drm/drmP.h b/include/drm/drmP.h index d7162cf1c..3c8422c69 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -283,6 +283,7 @@ struct drm_ioctl_desc { struct drm_pending_event { struct drm_event *event; struct list_head link; + struct list_head pending_link; struct drm_file *file_priv; pid_t pid; /* pid of requester, no guarantee it's valid by the time we deliver the event, for tracing only */ @@ -346,6 +347,7 @@ struct drm_file { struct list_head blobs; wait_queue_head_t event_wait; + struct list_head pending_event_list; struct list_head event_list; int event_space; @@ -919,15 +921,25 @@ extern long drm_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); extern bool drm_ioctl_flags(unsigned int nr, unsigned int *flags); - /* Device support (drm_fops.h) */ -extern int drm_open(struct inode *inode, struct file *filp); -extern ssize_t drm_read(struct file *filp, char __user *buffer, - size_t count, loff_t *offset); -extern int drm_release(struct inode *inode, struct file *filp); -extern int drm_new_set_master(struct drm_device *dev, struct drm_file *fpriv); - - /* Mapping support (drm_vm.h) */ -extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); +/* File Operations (drm_fops.c) */ +int drm_open(struct inode *inode, struct file *filp); +ssize_t drm_read(struct file *filp, char __user *buffer, + size_t count, loff_t *offset); +int drm_release(struct inode *inode, struct file *filp); +int drm_new_set_master(struct drm_device *dev, struct drm_file *fpriv); +unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); +int drm_event_reserve_init_locked(struct drm_device *dev, + struct drm_file *file_priv, + struct drm_pending_event *p, + struct drm_event *e); +int drm_event_reserve_init(struct drm_device *dev, + struct drm_file *file_priv, + struct drm_pending_event *p, + struct drm_event *e); +void drm_event_cancel_free(struct drm_device *dev, + struct drm_pending_event *p); +void drm_send_event_locked(struct drm_device *dev, struct drm_pending_event *e); +void drm_send_event(struct drm_device *dev, struct drm_pending_event *e); /* Misc. IOCTL support (drm_ioctl.c) */ int drm_noop(struct drm_device *dev, void *data, diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h index fe5efada9..9054598c9 100644 --- a/include/drm/drm_atomic_helper.h +++ b/include/drm/drm_atomic_helper.h @@ -146,6 +146,9 @@ __drm_atomic_helper_connector_destroy_state(struct drm_connector *connector, struct drm_connector_state *state); void drm_atomic_helper_connector_destroy_state(struct drm_connector *connector, struct drm_connector_state *state); +void drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc, + u16 *red, u16 *green, u16 *blue, + uint32_t start, uint32_t size); /** * drm_atomic_crtc_for_each_plane - iterate over planes currently attached to CRTC diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index c5b4b81a8..e0170bf80 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -305,12 +305,20 @@ struct drm_plane_helper_funcs; * @mode_changed: crtc_state->mode or crtc_state->enable has been changed * @active_changed: crtc_state->active has been toggled. * @connectors_changed: connectors to this crtc have been updated + * @color_mgmt_changed: color management properties have changed (degamma or + * gamma LUT or CSC matrix) * @plane_mask: bitmask of (1 << drm_plane_index(plane)) of attached planes * @connector_mask: bitmask of (1 << drm_connector_index(connector)) of attached connectors + * @encoder_mask: bitmask of (1 << drm_encoder_index(encoder)) of attached encoders * @last_vblank_count: for helpers and drivers to capture the vblank of the * update to ensure framebuffer cleanup isn't done too early * @adjusted_mode: for use by helpers and drivers to compute adjusted mode timings * @mode: current mode timings + * @degamma_lut: Lookup table for converting framebuffer pixel data + * before apply the conversion matrix + * @ctm: Transformation matrix + * @gamma_lut: Lookup table for converting pixel data after the + * conversion matrix * @event: optional pointer to a DRM event to signal upon completion of the * state update * @state: backpointer to global drm_atomic_state @@ -332,6 +340,7 @@ struct drm_crtc_state { bool mode_changed : 1; bool active_changed : 1; bool connectors_changed : 1; + bool color_mgmt_changed : 1; /* attached planes bitmask: * WARNING: transitional helpers do not maintain plane_mask so @@ -341,6 +350,7 @@ struct drm_crtc_state { u32 plane_mask; u32 connector_mask; + u32 encoder_mask; /* last_vblank_count: for vblank waits before cleanup */ u32 last_vblank_count; @@ -353,6 +363,11 @@ struct drm_crtc_state { /* blob property to expose current mode to atomic userspace */ struct drm_property_blob *mode_blob; + /* blob property to expose color management to userspace */ + struct drm_property_blob *degamma_lut; + struct drm_property_blob *ctm; + struct drm_property_blob *gamma_lut; + struct drm_pending_vblank_event *event; struct drm_atomic_state *state; @@ -755,7 +770,7 @@ struct drm_crtc { int x, y; const struct drm_crtc_funcs *funcs; - /* CRTC gamma size for reporting to userspace */ + /* Legacy FB CRTC gamma size for reporting to userspace */ uint32_t gamma_size; uint16_t *gamma_store; @@ -1582,6 +1597,8 @@ struct drm_bridge_funcs { * * The bridge can assume that the display pipe (i.e. clocks and timing * signals) feeding it is still running when this callback is called. + * + * The disable callback is optional. */ void (*disable)(struct drm_bridge *bridge); @@ -1598,6 +1615,8 @@ struct drm_bridge_funcs { * The bridge must assume that the display pipe (i.e. clocks and timing * singals) feeding it is no longer running when this callback is * called. + * + * The post_disable callback is optional. */ void (*post_disable)(struct drm_bridge *bridge); @@ -1626,6 +1645,8 @@ struct drm_bridge_funcs { * will not yet be running when this callback is called. The bridge must * not enable the display link feeding the next bridge in the chain (if * there is one) when this callback is called. + * + * The pre_enable callback is optional. */ void (*pre_enable)(struct drm_bridge *bridge); @@ -1643,6 +1664,8 @@ struct drm_bridge_funcs { * signals) feeding it is running when this callback is called. This * callback must enable the display link feeding the next bridge in the * chain if there is one. + * + * The enable callback is optional. */ void (*enable)(struct drm_bridge *bridge); }; @@ -1675,6 +1698,7 @@ struct drm_bridge { * @dev: parent DRM device * @allow_modeset: allow full modeset * @legacy_cursor_update: hint to enforce legacy cursor IOCTL semantics + * @legacy_set_config: Disable conflicting encoders instead of failing with -EINVAL. * @planes: pointer to array of plane pointers * @plane_states: pointer to array of plane states pointers * @crtcs: pointer to array of CRTC pointers @@ -1688,6 +1712,7 @@ struct drm_atomic_state { struct drm_device *dev; bool allow_modeset : 1; bool legacy_cursor_update : 1; + bool legacy_set_config : 1; struct drm_plane **planes; struct drm_plane_state **plane_states; struct drm_crtc **crtcs; @@ -2024,6 +2049,15 @@ struct drm_mode_config_funcs { * @property_blob_list: list of all the blob property objects * @blob_lock: mutex for blob property allocation and management * @*_property: core property tracking + * @degamma_lut_property: LUT used to convert the framebuffer's colors to linear + * gamma + * @degamma_lut_size_property: size of the degamma LUT as supported by the + * driver (read-only) + * @ctm_property: Matrix used to convert colors after the lookup in the + * degamma LUT + * @gamma_lut_property: LUT used to convert the colors, after the CSC matrix, to + * the gamma space of the connected screen (read-only) + * @gamma_lut_size_property: size of the gamma LUT as supported by the driver * @preferred_depth: preferred RBG pixel depth, used by fb helpers * @prefer_shadow: hint to userspace to prefer shadow-fb rendering * @async_page_flip: does this device support async flips on the primary plane? @@ -2126,6 +2160,13 @@ struct drm_mode_config { struct drm_property *aspect_ratio_property; struct drm_property *dirty_info_property; + /* Optional color correction properties */ + struct drm_property *degamma_lut_property; + struct drm_property *degamma_lut_size_property; + struct drm_property *ctm_property; + struct drm_property *gamma_lut_property; + struct drm_property *gamma_lut_size_property; + /* properties for virtual machine layout */ struct drm_property *suggested_x_property; struct drm_property *suggested_y_property; @@ -2155,6 +2196,17 @@ struct drm_mode_config { list_for_each_entry((plane), &(dev)->mode_config.plane_list, head) \ for_each_if ((plane_mask) & (1 << drm_plane_index(plane))) +/** + * drm_for_each_encoder_mask - iterate over encoders specified by bitmask + * @encoder: the loop cursor + * @dev: the DRM device + * @encoder_mask: bitmask of encoder indices + * + * Iterate over all encoders specified by bitmask. + */ +#define drm_for_each_encoder_mask(encoder, dev, encoder_mask) \ + list_for_each_entry((encoder), &(dev)->mode_config.encoder_list, head) \ + for_each_if ((encoder_mask) & (1 << drm_encoder_index(encoder))) #define obj_to_crtc(x) container_of(x, struct drm_crtc, base) #define obj_to_connector(x) container_of(x, struct drm_connector, base) @@ -2231,6 +2283,7 @@ int drm_encoder_init(struct drm_device *dev, struct drm_encoder *encoder, const struct drm_encoder_funcs *funcs, int encoder_type, const char *name, ...); +extern unsigned int drm_encoder_index(struct drm_encoder *encoder); /** * drm_encoder_crtc_ok - can a given crtc drive a given encoder? @@ -2288,6 +2341,8 @@ extern void drm_property_destroy_user_blobs(struct drm_device *dev, extern bool drm_probe_ddc(struct i2c_adapter *adapter); extern struct edid *drm_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter); +extern struct edid *drm_get_edid_switcheroo(struct drm_connector *connector, + struct i2c_adapter *adapter); extern struct edid *drm_edid_duplicate(const struct edid *edid); extern int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid); extern void drm_mode_config_init(struct drm_device *dev); @@ -2488,6 +2543,8 @@ extern int drm_format_num_planes(uint32_t format); extern int drm_format_plane_cpp(uint32_t format, int plane); extern int drm_format_horz_chroma_subsampling(uint32_t format); extern int drm_format_vert_chroma_subsampling(uint32_t format); +extern int drm_format_plane_width(int width, uint32_t format, int plane); +extern int drm_format_plane_height(int height, uint32_t format, int plane); extern const char *drm_get_format_name(uint32_t format); extern struct drm_property *drm_mode_create_rotation_property(struct drm_device *dev, unsigned int supported_rotations); @@ -2536,6 +2593,21 @@ static inline struct drm_property *drm_property_find(struct drm_device *dev, return mo ? obj_to_property(mo) : NULL; } +/* + * Extract a degamma/gamma LUT value provided by user and round it to the + * precision supported by the hardware. + */ +static inline uint32_t drm_color_lut_extract(uint32_t user_input, + uint32_t bit_precision) +{ + uint32_t val = user_input + (1 << (16 - bit_precision - 1)); + uint32_t max = 0xffff >> (16 - bit_precision); + + val >>= 16 - bit_precision; + + return clamp_val(val, 0, max); +} + /* Plane list iterator for legacy (overlay only) planes. */ #define drm_for_each_legacy_plane(plane, dev) \ list_for_each_entry(plane, &(dev)->mode_config.plane_list, head) \ diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h index 4b37afa2b..97fa894d4 100644 --- a/include/drm/drm_crtc_helper.h +++ b/include/drm/drm_crtc_helper.h @@ -48,6 +48,9 @@ extern bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, struct drm_display_mode *mode, int x, int y, struct drm_framebuffer *old_fb); +extern void drm_helper_crtc_enable_color_mgmt(struct drm_crtc *crtc, + int degamma_lut_size, + int gamma_lut_size); extern bool drm_helper_crtc_in_use(struct drm_crtc *crtc); extern bool drm_helper_encoder_in_use(struct drm_encoder *encoder); diff --git a/include/drm/drm_dp_aux_dev.h b/include/drm/drm_dp_aux_dev.h new file mode 100644 index 000000000..1b76d990d --- /dev/null +++ b/include/drm/drm_dp_aux_dev.h @@ -0,0 +1,62 @@ +/* + * Copyright © 2015 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Authors: + * Rafael Antognolli + * + */ + +#ifndef DRM_DP_AUX_DEV +#define DRM_DP_AUX_DEV + +#include + +#ifdef CONFIG_DRM_DP_AUX_CHARDEV + +int drm_dp_aux_dev_init(void); +void drm_dp_aux_dev_exit(void); +int drm_dp_aux_register_devnode(struct drm_dp_aux *aux); +void drm_dp_aux_unregister_devnode(struct drm_dp_aux *aux); + +#else + +static inline int drm_dp_aux_dev_init(void) +{ + return 0; +} + +static inline void drm_dp_aux_dev_exit(void) +{ +} + +static inline int drm_dp_aux_register_devnode(struct drm_dp_aux *aux) +{ + return 0; +} + +static inline void drm_dp_aux_unregister_devnode(struct drm_dp_aux *aux) +{ +} + +#endif + +#endif diff --git a/include/drm/drm_dp_dual_mode_helper.h b/include/drm/drm_dp_dual_mode_helper.h new file mode 100644 index 000000000..e8a9dfd0e --- /dev/null +++ b/include/drm/drm_dp_dual_mode_helper.h @@ -0,0 +1,92 @@ +/* + * Copyright © 2016 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef DRM_DP_DUAL_MODE_HELPER_H +#define DRM_DP_DUAL_MODE_HELPER_H + +#include + +/* + * Optional for type 1 DVI adaptors + * Mandatory for type 1 HDMI and type 2 adaptors + */ +#define DP_DUAL_MODE_HDMI_ID 0x00 /* 00-0f */ +#define DP_DUAL_MODE_HDMI_ID_LEN 16 +/* + * Optional for type 1 adaptors + * Mandatory for type 2 adaptors + */ +#define DP_DUAL_MODE_ADAPTOR_ID 0x10 +#define DP_DUAL_MODE_REV_MASK 0x07 +#define DP_DUAL_MODE_REV_TYPE2 0x00 +#define DP_DUAL_MODE_TYPE_MASK 0xf0 +#define DP_DUAL_MODE_TYPE_TYPE2 0xa0 +#define DP_DUAL_MODE_IEEE_OUI 0x11 /* 11-13*/ +#define DP_DUAL_IEEE_OUI_LEN 3 +#define DP_DUAL_DEVICE_ID 0x14 /* 14-19 */ +#define DP_DUAL_DEVICE_ID_LEN 6 +#define DP_DUAL_MODE_HARDWARE_REV 0x1a +#define DP_DUAL_MODE_FIRMWARE_MAJOR_REV 0x1b +#define DP_DUAL_MODE_FIRMWARE_MINOR_REV 0x1c +#define DP_DUAL_MODE_MAX_TMDS_CLOCK 0x1d +#define DP_DUAL_MODE_I2C_SPEED_CAP 0x1e +#define DP_DUAL_MODE_TMDS_OEN 0x20 +#define DP_DUAL_MODE_TMDS_DISABLE 0x01 +#define DP_DUAL_MODE_HDMI_PIN_CTRL 0x21 +#define DP_DUAL_MODE_CEC_ENABLE 0x01 +#define DP_DUAL_MODE_I2C_SPEED_CTRL 0x22 + +struct i2c_adapter; + +ssize_t drm_dp_dual_mode_read(struct i2c_adapter *adapter, + u8 offset, void *buffer, size_t size); +ssize_t drm_dp_dual_mode_write(struct i2c_adapter *adapter, + u8 offset, const void *buffer, size_t size); + +/** + * enum drm_dp_dual_mode_type - Type of the DP dual mode adaptor + * @DRM_DP_DUAL_MODE_NONE: No DP dual mode adaptor + * @DRM_DP_DUAL_MODE_UNKNOWN: Could be either none or type 1 DVI adaptor + * @DRM_DP_DUAL_MODE_TYPE1_DVI: Type 1 DVI adaptor + * @DRM_DP_DUAL_MODE_TYPE1_HDMI: Type 1 HDMI adaptor + * @DRM_DP_DUAL_MODE_TYPE2_DVI: Type 2 DVI adaptor + * @DRM_DP_DUAL_MODE_TYPE2_HDMI: Type 2 HDMI adaptor + */ +enum drm_dp_dual_mode_type { + DRM_DP_DUAL_MODE_NONE, + DRM_DP_DUAL_MODE_UNKNOWN, + DRM_DP_DUAL_MODE_TYPE1_DVI, + DRM_DP_DUAL_MODE_TYPE1_HDMI, + DRM_DP_DUAL_MODE_TYPE2_DVI, + DRM_DP_DUAL_MODE_TYPE2_HDMI, +}; + +enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter); +int drm_dp_dual_mode_max_tmds_clock(enum drm_dp_dual_mode_type type, + struct i2c_adapter *adapter); +int drm_dp_dual_mode_get_tmds_output(enum drm_dp_dual_mode_type type, + struct i2c_adapter *adapter, bool *enabled); +int drm_dp_dual_mode_set_tmds_output(enum drm_dp_dual_mode_type type, + struct i2c_adapter *adapter, bool enable); +const char *drm_dp_get_dual_mode_type_name(enum drm_dp_dual_mode_type type); + +#endif diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index 2af97691e..dec6221e8 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h @@ -403,6 +403,18 @@ static inline int drm_eld_size(const uint8_t *eld) return DRM_ELD_HEADER_BLOCK_SIZE + eld[DRM_ELD_BASELINE_ELD_LEN] * 4; } +/** + * drm_eld_get_conn_type - Get device type hdmi/dp connected + * @eld: pointer to an ELD memory structure + * + * The caller need to use %DRM_ELD_CONN_TYPE_HDMI or %DRM_ELD_CONN_TYPE_DP to + * identify the display type connected. + */ +static inline u8 drm_eld_get_conn_type(const uint8_t *eld) +{ + return eld[DRM_ELD_SAD_COUNT_CONN_TYPE] & DRM_ELD_CONN_TYPE_MASK; +} + struct edid *drm_do_get_edid(struct drm_connector *connector, int (*get_edid_block)(void *data, u8 *buf, unsigned int block, size_t len), diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h index d8a40dff0..062723bdc 100644 --- a/include/drm/drm_fb_helper.h +++ b/include/drm/drm_fb_helper.h @@ -219,6 +219,7 @@ struct drm_fb_helper { }; #ifdef CONFIG_DRM_FBDEV_EMULATION +int drm_fb_helper_modinit(void); void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper, const struct drm_fb_helper_funcs *funcs); int drm_fb_helper_init(struct drm_device *dev, @@ -283,6 +284,11 @@ int drm_fb_helper_add_one_connector(struct drm_fb_helper *fb_helper, struct drm_ int drm_fb_helper_remove_one_connector(struct drm_fb_helper *fb_helper, struct drm_connector *connector); #else +static inline int drm_fb_helper_modinit(void) +{ + return 0; +} + static inline void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper, const struct drm_fb_helper_funcs *funcs) diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h index 1b3b1f8c8..7a9840f8b 100644 --- a/include/drm/drm_mipi_dsi.h +++ b/include/drm/drm_mipi_dsi.h @@ -96,14 +96,17 @@ struct mipi_dsi_host_ops { * struct mipi_dsi_host - DSI host device * @dev: driver model device node for this DSI host * @ops: DSI host operations + * @list: list management */ struct mipi_dsi_host { struct device *dev; const struct mipi_dsi_host_ops *ops; + struct list_head list; }; int mipi_dsi_host_register(struct mipi_dsi_host *host); void mipi_dsi_host_unregister(struct mipi_dsi_host *host); +struct mipi_dsi_host *of_find_mipi_dsi_host_by_node(struct device_node *node); /* DSI mode flags */ @@ -139,10 +142,28 @@ enum mipi_dsi_pixel_format { MIPI_DSI_FMT_RGB565, }; +#define DSI_DEV_NAME_SIZE 20 + +/** + * struct mipi_dsi_device_info - template for creating a mipi_dsi_device + * @type: DSI peripheral chip type + * @channel: DSI virtual channel assigned to peripheral + * @node: pointer to OF device node or NULL + * + * This is populated and passed to mipi_dsi_device_new to create a new + * DSI device + */ +struct mipi_dsi_device_info { + char type[DSI_DEV_NAME_SIZE]; + u32 channel; + struct device_node *node; +}; + /** * struct mipi_dsi_device - DSI peripheral device * @host: DSI host for this peripheral * @dev: driver model device node for this peripheral + * @name: DSI peripheral chip type * @channel: virtual channel assigned to the peripheral * @format: pixel format for video mode * @lanes: number of active data lanes @@ -152,6 +173,7 @@ struct mipi_dsi_device { struct mipi_dsi_host *host; struct device dev; + char name[DSI_DEV_NAME_SIZE]; unsigned int channel; unsigned int lanes; enum mipi_dsi_pixel_format format; @@ -188,6 +210,10 @@ static inline int mipi_dsi_pixel_format_to_bpp(enum mipi_dsi_pixel_format fmt) return -EINVAL; } +struct mipi_dsi_device * +mipi_dsi_device_register_full(struct mipi_dsi_host *host, + const struct mipi_dsi_device_info *info); +void mipi_dsi_device_unregister(struct mipi_dsi_device *dsi); struct mipi_dsi_device *of_find_mipi_dsi_device_by_node(struct device_node *np); int mipi_dsi_attach(struct mipi_dsi_device *dsi); int mipi_dsi_detach(struct mipi_dsi_device *dsi); diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h index a126a0d7a..b61c2d451 100644 --- a/include/drm/drm_modeset_helper_vtables.h +++ b/include/drm/drm_modeset_helper_vtables.h @@ -439,7 +439,7 @@ struct drm_encoder_helper_funcs { * can be modified by this callback and does not need to match mode. * * This function is used by both legacy CRTC helpers and atomic helpers. - * With atomic helpers it is optional. + * This hook is optional. * * NOTE: * diff --git a/include/drm/drm_of.h b/include/drm/drm_of.h index 8544665ee..3fd87b386 100644 --- a/include/drm/drm_of.h +++ b/include/drm/drm_of.h @@ -1,9 +1,12 @@ #ifndef __DRM_OF_H__ #define __DRM_OF_H__ +#include + struct component_master_ops; struct device; struct drm_device; +struct drm_encoder; struct device_node; #ifdef CONFIG_OF @@ -12,6 +15,9 @@ extern uint32_t drm_of_find_possible_crtcs(struct drm_device *dev, extern int drm_of_component_probe(struct device *dev, int (*compare_of)(struct device *, void *), const struct component_master_ops *m_ops); +extern int drm_of_encoder_active_endpoint(struct device_node *node, + struct drm_encoder *encoder, + struct of_endpoint *endpoint); #else static inline uint32_t drm_of_find_possible_crtcs(struct drm_device *dev, struct device_node *port) @@ -26,6 +32,33 @@ drm_of_component_probe(struct device *dev, { return -EINVAL; } + +static inline int drm_of_encoder_active_endpoint(struct device_node *node, + struct drm_encoder *encoder, + struct of_endpoint *endpoint) +{ + return -EINVAL; +} #endif +static inline int drm_of_encoder_active_endpoint_id(struct device_node *node, + struct drm_encoder *encoder) +{ + struct of_endpoint endpoint; + int ret = drm_of_encoder_active_endpoint(node, encoder, + &endpoint); + + return ret ?: endpoint.id; +} + +static inline int drm_of_encoder_active_port_id(struct device_node *node, + struct drm_encoder *encoder) +{ + struct of_endpoint endpoint; + int ret = drm_of_encoder_active_endpoint(node, encoder, + &endpoint); + + return ret ?: endpoint.port; +} + #endif /* __DRM_OF_H__ */ diff --git a/include/drm/exynos_drm.h b/include/drm/exynos_drm.h deleted file mode 100644 index cb65fa14a..000000000 --- a/include/drm/exynos_drm.h +++ /dev/null @@ -1,101 +0,0 @@ -/* exynos_drm.h - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. - * Authors: - * Inki Dae - * Joonyoung Shim - * Seung-Woo Kim - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - */ -#ifndef _EXYNOS_DRM_H_ -#define _EXYNOS_DRM_H_ - -#include -#include