From 2c380b0401f74f86864eadaa8cc0d42b4c68c566 Mon Sep 17 00:00:00 2001 From: basamaryan Date: Sat, 12 Oct 2024 17:27:50 +0200 Subject: [PATCH] Merge remote-tracking branch 'kernel-lts/linux-4.14.y' into PerfKernel * kernel-lts/linux-4.14.y: LTS: Update to 4.14.353 net: fix __dst_negative_advice() race selftests: make order checking verbose in msg_zerocopy selftest selftests: fix OOM in msg_zerocopy selftest Revert "selftests/net: reap zerocopy completions passed up as ancillary data." Revert "selftests: fix OOM in msg_zerocopy selftest" Revert "selftests: make order checking verbose in msg_zerocopy selftest" nvme/pci: Add APST quirk for Lenovo N60z laptop exec: Fix ToCToU between perm check and set-uid/gid usage drm/i915/gem: Fix Virtual Memory mapping boundaries calculation drm/i915: Try GGTT mmapping whole object as partial netfilter: nf_tables: set element extended ACK reporting support kbuild: Fix '-S -c' in x86 stack protector scripts drm/mgag200: Set DDC timeout in milliseconds drm/bridge: analogix_dp: properly handle zero sized AUX transactions drm/bridge: analogix_dp: Properly log AUX CH errors drm/bridge: analogix_dp: Reset aux channel if an error occurred drm/bridge: analogix_dp: Check AUX_EN status when doing AUX transfer x86/mtrr: Check if fixed MTRRs exist before saving them tracing: Fix overflow in get_free_elt() power: supply: axp288_charger: Round constant_charge_voltage writes down power: supply: axp288_charger: Fix constant_charge_voltage writes serial: core: check uartclk for zero to avoid divide by zero ntp: Safeguard against time_constant overflow driver core: Fix uevent_show() vs driver detach race ntp: Clamp maxerror and esterror to operating range tick/broadcast: Move per CPU pointer access into the atomic section scsi: ufs: core: Fix hba->last_dme_cmd_tstamp timestamp updating logic usb: gadget: core: Check for unset descriptor USB: serial: debug: do not echo input by default usb: vhci-hcd: Do not drop references before new references are gained ALSA: line6: Fix racy access to midibuf spi: spi-fsl-lpspi: Fix scldiv calculation spi: fsl-lpspi: remove unneeded array spi: lpspi: add the error info of transfer speed setting spi: lpspi: Add i.MX8 boards support for lpspi spi: lpspi: Let watermark change with send data length spi: lpspi: Add slave mode support spi: lpspi: Replace all "master" with "controller" spi: lpspi: Switch to SPDX identifier i2c: smbus: Send alert notifications to all devices if source not found i2c: smbus: Improve handling of stuck alerts i2c: smbus: Don't filter out duplicate alerts ext4: fix wrong unit use in ext4_mb_find_by_goal SUNRPC: Fix a race to wake a sync task jbd2: avoid memleak in jbd2_journal_write_metadata_buffer media: uvcvideo: Fix the bandwdith quirk on USB 3.x media: uvcvideo: Ignore empty TS packets btrfs: fix bitmap leak when loading free space cache on duplicate entry wifi: nl80211: don't give key data to userspace udf: prevent integer overflow in udf_bitmap_free_blocks() udf: Fix signed/unsigned format specifiers PCI: Add Edimax Vendor ID to pci_ids.h clocksource/drivers/sh_cmt: Address race condition for clock events md/raid5: avoid BUG_ON() while continue reshape after reassembling net: fec: Stop PPS on driver remove Bluetooth: l2cap: always unlock channel in l2cap_conless_channel() net: linkwatch: use system_unbound_wq net: usb: qmi_wwan: fix memory leak for not ip packets irqchip/mbigen: Fix mbigen node address layout net: usb: sr9700: fix uninitialized variable use in sr_mdio_read ALSA: usb-audio: Correct surround channels in UAC1 channel map protect the fetch of ->fd[fd] in do_dup2() from mispredictions ipv6: fix ndisc_is_useropt() handling for PIO net/iucv: fix use after free in iucv_sock_close() drm/vmwgfx: Fix overlay when using Screen Targets remoteproc: imx_rproc: Skip over memory region when node value is NULL remoteproc: imx_rproc: Fix ignoring mapping vdev regions remoteproc: imx_rproc: ignore mapping vdev regions perf/x86/intel/pt: Fix a topa_entry base address calculation perf/x86/intel/pt: Split ToPA metadata and page layout perf/x86/intel/pt: Use pointer arithmetics instead in ToPA entry calculation perf/x86/intel/pt: Use helpers to obtain ToPA entry size perf/x86/intel/pt: Export pt_cap_get() devres: Fix memory leakage caused by driver API devm_free_percpu() driver core: Cast to (void *) with __force for __percpu pointer dev/parport: fix the array out-of-bounds risk parport: Standardize use of printmode parport: Convert printk(KERN_ to pr_( parport: parport_pc: Mark expected switch fall-through PCI: rockchip: Use GPIOD_OUT_LOW flag while requesting ep_gpio PCI: rockchip: Make 'ep-gpios' DT property optional mm: avoid overflows in dirty throttling logic mISDN: Fix a use after free in hfcmulti_tx() tipc: Return non-zero value from tipc_udp_addr2str() on error net: bonding: correctly annotate RCU in bond_should_notify_peers() ipv4: Fix incorrect source address in Record Route option net: ip_rt_get_source() - use new style struct initializer instead of memset MIPS: SMP-CPS: Fix address for GCR_ACCESS register for CM3 and later dma: fix call order in dmam_free_coherent jfs: Fix array-index-out-of-bounds in diFree kdb: Use the passed prompt in kdb_position_cursor() kdb: address -Wformat-security warnings kdb: Fix bound check compiler warning nilfs2: handle inconsistent state in nilfs_btnode_create_block() selftests/sigaltstack: Fix ppc64 GCC build RDMA/iwcm: Fix a use-after-free related to destroying CM IDs RDMA/iwcm: Remove a set-but-not-used variable platform: mips: cpu_hwmon: Disable driver on unsupported hardware watchdog/perf: properly initialize the turbo mode timestamp and rearm counter perf/x86/intel/pt: Fix topa_entry base length scsi: qla2xxx: During vport delete send async logout explicitly decompress_bunzip2: fix rare decompression failure ubi: eba: properly rollback inside self_check_eba f2fs: fix to don't dirty inode for readonly filesystem f2fs: prevent newly created inode from being dirtied incorrectly scsi: qla2xxx: Return ENOBUFS if sg_cnt is more than one for ELS cmds binder: fix hang of unregistered readers PCI: hv: Return zero, not garbage, when reading PCI_INTERRUPT_PIN hwrng: amd - Convert PCIBIOS_* return codes to errnos leds: ss4200: Convert PCIBIOS_* return codes to errnos wifi: mwifiex: Fix interface type change ext4: make sure the first directory block is not a hole ext4: check dot and dotdot of dx_root before making dir indexed m68k: amiga: Turn off Warp1260 interrupts during boot drm/gma500: fix null pointer dereference in psb_intel_lvds_get_modes drm/gma500: fix null pointer dereference in cdv_intel_lvds_get_modes hfs: fix to initialize fields of hfs_inode_info after hfs_alloc_inode() media: venus: fix use after free in vdec_close ipv6: take care of scope when choosing the src addr af_packet: Handle outgoing VLAN packets without hardware offloading net: netconsole: Disable target before netpoll cleanup tick/broadcast: Make takeover of broadcast hrtimer reliable nilfs2: avoid undefined behavior in nilfs_cnt32_ge macro fs/nilfs2: remove some unused macros to tame gcc pinctrl: freescale: mxs: Fix refcount of child pinctrl: ti: ti-iodelay: fix possible memory leak when pinctrl_enable() fails pinctrl: ti: ti-iodelay: Drop if block with always false condition pinctrl: single: fix possible memory leak when pinctrl_enable() fails pinctrl: core: fix possible memory leak when pinctrl_enable() fails netfilter: ctnetlink: use helper function to calculate expect ID bnxt_re: Fix imm_data endianness macintosh/therm_windtunnel: fix module unload. powerpc/xmon: Fix disassembly CPU feature checks MIPS: Octeron: remove source file executable bit Input: elan_i2c - do not leave interrupt disabled on suspend failure mtd: make mtd_test.c a separate module RDMA/rxe: Don't set BTH_ACK_MASK for UC or UD QPs RDMA/mlx4: Fix truncated output warning in alias_GUID.c RDMA/mlx4: Fix truncated output warning in mad.c PCI: Fix resource double counting on remove & rescan PCI: Equalize hotplug memory and io for occupied and empty slots sparc64: Fix incorrect function signature and add prototype for prom_cif_init ext4: avoid writing unitialized memory to disk in EA inodes drm/etnaviv: fix DMA direction handling for cached RW buffers perf report: Fix condition in sort__sym_cmp() media: renesas: vsp1: Store RPF partition configuration per RPF instance media: renesas: vsp1: Fix _irqsave and _irq mix media: v4l: vsp1: Store pipeline pointer in vsp1_entity saa7134: Unchecked i2c_transfer function result fixed media: imon: Fix race getting ictx->lock bna: adjust 'name' buf size of bna_tcb and bna_ccb structures perf: Prevent passing zero nr_pages to rb_alloc_aux() perf: Fix perf_aux_size() for greater-than 32-bit size ipvs: Avoid unnecessary calls to skb_is_gso_sctp net: fec: Fix FEC_ECR_EN1588 being cleared on link-down net: fec: Refactor: #define magic constants wifi: brcmsmac: LCN PHY code is used for BCM4313 2G-only device m68k: cmpxchg: Fix return value for default case in __arch_xchg() x86/xen: Convert comma to semicolon m68k: atari: Fix TT bootup freeze / unexpected (SCU) interrupt messages arm64: dts: rockchip: Increase VOP clk rate on RK3328 hwmon: (max6697) Fix swapped temp{1,8} critical alarms hwmon: (max6697) Auto-convert to use SENSOR_DEVICE_ATTR_{RO, RW, WO} hwmon: Introduce SENSOR_DEVICE_ATTR_{RO, RW, WO} and variants hwmon: (max6697) Fix underflow when writing limit attributes pwm: stm32: Always do lazy disabling hwmon: (adt7475) Fix default duty on fan is disabled x86/platform/iosf_mbi: Convert PCIBIOS_* return codes to errnos x86/pci/xen: Fix PCIBIOS_* return code handling x86/pci/intel_mid_pci: Fix PCIBIOS_* return code handling x86/of: Return consistent error type from x86_of_pci_irq_enable() platform/chrome: cros_ec_debugfs: fix wrong EC message version Change-Id: I1c0f149d39e83ed9c022b51c809a663fc7bca6a7 --- .elts/config.yaml | 4 +- .elts/meta/4.14.353.yaml | 661 +++++++++++++++ .elts/upstream/4.19.320.yaml | 784 ++++++++++++++++++ Documentation/hwmon/hwmon-kernel-api.txt | 24 +- Makefile | 2 +- arch/arm64/boot/dts/rockchip/rk3328.dtsi | 4 +- arch/m68k/amiga/config.c | 9 + arch/m68k/atari/ataints.c | 6 +- arch/m68k/include/asm/cmpxchg.h | 2 +- arch/mips/include/asm/mips-cm.h | 4 + arch/mips/kernel/smp-cps.c | 5 +- arch/mips/pci/pcie-octeon.c | 0 arch/powerpc/xmon/ppc-dis.c | 33 +- arch/sparc/include/asm/oplib_64.h | 1 + arch/sparc/prom/init_64.c | 3 - arch/sparc/prom/p1275.c | 2 +- arch/x86/events/intel/pt.c | 157 ++-- arch/x86/events/intel/pt.h | 25 +- arch/x86/include/asm/intel_pt.h | 23 + arch/x86/kernel/cpu/mtrr/main.c | 2 +- arch/x86/kernel/devicetree.c | 2 +- arch/x86/pci/intel_mid_pci.c | 4 +- arch/x86/pci/xen.c | 4 +- arch/x86/platform/intel/iosf_mbi.c | 4 +- arch/x86/xen/p2m.c | 4 +- drivers/android/binder.c | 4 +- drivers/base/core.c | 13 +- drivers/base/devres.c | 8 +- drivers/base/dma-mapping.c | 2 +- drivers/base/module.c | 4 + drivers/char/hw_random/amd-rng.c | 4 +- drivers/clocksource/sh_cmt.c | 13 +- .../gpu/drm/bridge/analogix/analogix_dp_reg.c | 56 +- drivers/gpu/drm/etnaviv/etnaviv_gem.c | 6 +- drivers/gpu/drm/gma500/cdv_intel_lvds.c | 3 + drivers/gpu/drm/gma500/psb_intel_lvds.c | 3 + drivers/gpu/drm/i915/i915_gem.c | 75 +- drivers/gpu/drm/i915/i915_vma.c | 2 +- drivers/gpu/drm/mgag200/mgag200_i2c.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c | 2 +- drivers/hwmon/adt7475.c | 2 +- drivers/hwmon/max6697.c | 145 ++-- drivers/i2c/i2c-smbus.c | 69 +- drivers/infiniband/core/iwcm.c | 14 +- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 8 +- drivers/infiniband/hw/bnxt_re/qplib_fp.h | 6 +- drivers/infiniband/hw/mlx4/alias_GUID.c | 2 +- drivers/infiniband/hw/mlx4/mad.c | 2 +- drivers/infiniband/sw/rxe/rxe_req.c | 7 +- drivers/input/mouse/elan_i2c_core.c | 2 + drivers/irqchip/irq-mbigen.c | 20 +- drivers/isdn/hardware/mISDN/hfcmulti.c | 7 +- drivers/leds/leds-ss4200.c | 7 +- drivers/macintosh/therm_windtunnel.c | 2 +- drivers/md/raid5.c | 20 +- drivers/media/pci/saa7134/saa7134-dvb.c | 8 +- drivers/media/platform/qcom/venus/vdec.c | 1 + drivers/media/platform/vsp1/vsp1_drm.c | 20 +- drivers/media/platform/vsp1/vsp1_drv.c | 2 +- drivers/media/platform/vsp1/vsp1_entity.h | 2 + drivers/media/platform/vsp1/vsp1_histo.c | 22 +- drivers/media/platform/vsp1/vsp1_histo.h | 3 - drivers/media/platform/vsp1/vsp1_pipe.c | 33 +- drivers/media/platform/vsp1/vsp1_pipe.h | 2 +- drivers/media/platform/vsp1/vsp1_rpf.c | 8 +- drivers/media/platform/vsp1/vsp1_rwpf.h | 2 - drivers/media/platform/vsp1/vsp1_video.c | 17 +- drivers/media/rc/imon.c | 5 +- drivers/media/usb/uvc/uvc_video.c | 37 +- drivers/mtd/tests/Makefile | 34 +- drivers/mtd/tests/mtd_test.c | 9 + drivers/mtd/ubi/eba.c | 3 +- drivers/net/bonding/bond_main.c | 7 +- drivers/net/ethernet/brocade/bna/bna_types.h | 2 +- drivers/net/ethernet/brocade/bna/bnad.c | 11 +- drivers/net/ethernet/freescale/fec_main.c | 52 +- drivers/net/ethernet/freescale/fec_ptp.c | 3 + drivers/net/netconsole.c | 2 +- drivers/net/usb/qmi_wwan.c | 1 + drivers/net/usb/sr9700.c | 11 +- .../broadcom/brcm80211/brcmsmac/phy/phy_lcn.c | 18 +- .../net/wireless/marvell/mwifiex/cfg80211.c | 2 + drivers/nvme/host/pci.c | 7 + drivers/parport/daisy.c | 6 +- drivers/parport/ieee1284.c | 4 +- drivers/parport/ieee1284_ops.c | 3 +- drivers/parport/parport_amiga.c | 2 +- drivers/parport/parport_atari.c | 2 +- drivers/parport/parport_cs.c | 6 +- drivers/parport/parport_gsc.c | 15 +- drivers/parport/parport_ip32.c | 25 +- drivers/parport/parport_mfc3.c | 2 +- drivers/parport/parport_pc.c | 180 ++-- drivers/parport/parport_sunbpp.c | 2 +- drivers/parport/probe.c | 7 +- drivers/parport/procfs.c | 28 +- drivers/parport/share.c | 24 +- drivers/pci/host/pci-hyperv.c | 4 +- drivers/pci/host/pcie-rockchip.c | 7 +- drivers/pci/setup-bus.c | 32 +- drivers/pinctrl/core.c | 12 +- drivers/pinctrl/freescale/pinctrl-mxs.c | 4 +- drivers/pinctrl/pinctrl-single.c | 7 +- drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 14 +- drivers/platform/chrome/cros_ec_debugfs.c | 1 + drivers/platform/mips/cpu_hwmon.c | 3 + drivers/power/supply/axp288_charger.c | 22 +- drivers/pwm/pwm-stm32.c | 5 +- drivers/remoteproc/imx_rproc.c | 5 + drivers/scsi/qla2xxx/qla_bsg.c | 2 +- drivers/scsi/qla2xxx/qla_mid.c | 2 +- drivers/scsi/ufs/ufshcd.c | 11 +- drivers/spi/spi-fsl-lpspi.c | 302 ++++--- drivers/tty/serial/serial_core.c | 8 + drivers/usb/gadget/udc/core.c | 10 +- drivers/usb/serial/usb_debug.c | 7 + drivers/usb/usbip/vhci_hcd.c | 9 +- fs/btrfs/free-space-cache.c | 1 + fs/exec.c | 8 +- fs/ext4/mballoc.c | 3 +- fs/ext4/namei.c | 73 +- fs/ext4/xattr.c | 6 + fs/f2fs/inode.c | 3 + fs/file.c | 1 + fs/hfs/inode.c | 3 + fs/jbd2/journal.c | 1 + fs/jfs/jfs_imap.c | 5 +- fs/nilfs2/btnode.c | 25 +- fs/nilfs2/btree.c | 4 +- fs/nilfs2/segment.c | 7 +- fs/udf/balloc.c | 44 +- fs/udf/directory.c | 2 +- fs/udf/inode.c | 16 +- fs/udf/misc.c | 4 +- fs/udf/namei.c | 4 +- fs/udf/partition.c | 6 +- fs/udf/super.c | 52 +- fs/udf/unicode.c | 2 +- include/linux/hwmon-sysfs.h | 39 + include/linux/pci_ids.h | 2 + include/uapi/linux/zorro_ids.h | 3 + kernel/debug/kdb/kdb_io.c | 8 +- kernel/events/core.c | 2 + kernel/events/internal.h | 2 +- kernel/time/ntp.c | 9 +- kernel/time/tick-broadcast.c | 24 + kernel/trace/tracing_map.c | 6 +- kernel/watchdog_hld.c | 11 +- lib/decompress_bunzip2.c | 3 +- mm/page-writeback.c | 30 +- net/bluetooth/l2cap_core.c | 1 + net/core/link_watch.c | 4 +- net/ipv4/route.c | 21 +- net/ipv6/addrconf.c | 3 +- net/ipv6/ndisc.c | 34 +- net/iucv/af_iucv.c | 4 +- net/netfilter/ipvs/ip_vs_proto_sctp.c | 4 +- net/netfilter/nf_conntrack_netlink.c | 3 +- net/netfilter/nf_tables_api.c | 9 +- net/packet/af_packet.c | 86 +- net/sunrpc/sched.c | 4 +- net/tipc/udp_media.c | 5 +- net/wireless/nl80211.c | 10 +- scripts/gcc-x86_32-has-stack-protector.sh | 2 +- scripts/gcc-x86_64-has-stack-protector.sh | 2 +- sound/usb/line6/driver.c | 5 + sound/usb/stream.c | 4 +- tools/perf/util/sort.c | 2 +- tools/testing/selftests/net/msg_zerocopy.c | 67 +- .../sigaltstack/current_stack_pointer.h | 2 +- 170 files changed, 3023 insertions(+), 1034 deletions(-) create mode 100644 .elts/meta/4.14.353.yaml create mode 100644 .elts/upstream/4.19.320.yaml mode change 100755 => 100644 arch/mips/pci/pcie-octeon.c diff --git a/.elts/config.yaml b/.elts/config.yaml index 43a7d46ea912..b8e21a3286c0 100644 --- a/.elts/config.yaml +++ b/.elts/config.yaml @@ -1,5 +1,5 @@ upstream_repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git upstream_base: 4.19.304 base: 4.14.336 -upstream_version: 4.19.319 -version: 4.14.352 +upstream_version: 4.19.320 +version: 4.14.353 diff --git a/.elts/meta/4.14.353.yaml b/.elts/meta/4.14.353.yaml new file mode 100644 index 000000000000..0a1c8d23affd --- /dev/null +++ b/.elts/meta/4.14.353.yaml @@ -0,0 +1,661 @@ +dd6caa8da1ace4e2e4f02eb5284addebf4c5c2bb: + title: 'platform/chrome: cros_ec_debugfs: fix wrong EC message version' + mainline: c2a28647bbb4e0894e8824362410f72b06ac57a4 + upstream: c0e53e36452d1b2a3ec71bf0586251245a5686c0 +78659ded3dbb7237c1582e91776e86a6b3247515: + title: 'x86/of: Return consistent error type from x86_of_pci_irq_enable()' + mainline: ec0b4c4d45cf7cf9a6c9626a494a89cb1ae7c645 + upstream: 56d64c36b2aac95c9c24e303fb746591ecfa096a +5f1342ecebaf8161a43bcc1b8958c280452c8171: + title: 'x86/pci/intel_mid_pci: Fix PCIBIOS_* return code handling' + mainline: 724852059e97c48557151b3aa4af424614819752 + upstream: 600a520cc4e661aa712415e4a733924e9d22777d +125df213ac935a71782e5c091206853ff9cb5556: + title: 'x86/pci/xen: Fix PCIBIOS_* return code handling' + mainline: e9d7b435dfaec58432f4106aaa632bf39f52ce9f + upstream: 5294b91618250c7719e4c85096cafe8f76a1bc20 +21be2282360c7df8b2535f9c2883674234dc7de2: + title: 'x86/platform/iosf_mbi: Convert PCIBIOS_* return codes to errnos' + mainline: 7821fa101eab529521aa4b724bf708149d70820c + upstream: 3f4f08e59ddf359da5bc4226ba865a59177a3a50 +1dd63dd3a8a7617a90bc1a9068fedb6adf5f5aac: + title: 'hwmon: (adt7475) Fix default duty on fan is disabled' + mainline: 39b24cced70fdc336dbc0070f8b3bde61d8513a8 + upstream: d9c01877d4ba1e39bbdc43faeeceeef2768be8e7 +25d404099dccdfe51abb9f810a864ced8b9d912b: + title: 'pwm: stm32: Always do lazy disabling' + mainline: 7346e7a058a2c9aa9ff1cc699c7bf18a402d9f84 + upstream: 383729f057245972e13fb0708c5ec7dd985fc50d +42cc04b6ae182a372082afc1c28d67f92fed5c29: + title: 'hwmon: (max6697) Fix underflow when writing limit attributes' + mainline: cbf7467828cd4ec7ceac7a8b5b5ddb2f69f07b0e + upstream: 21998f2c68edd4a7922875f34b39ce2bb78fabc0 +625dffc4eaba4191520fb296a0e55743836bab4b: + title: 'hwmon: Introduce SENSOR_DEVICE_ATTR_{RO, RW, WO} and variants' + mainline: a5c47c0d388b939dd578fd466aa804b7f2445390 + upstream: eb04482acd9870b84970fe1549203fedc1bbcc79 +64785dce17bc282c55ed7f21c3fbc4391cdb1ab0: + title: 'hwmon: (max6697) Auto-convert to use SENSOR_DEVICE_ATTR_{RO, RW, WO}' + mainline: 740c2f2b86a71ad673f329241ac25cfe647aacd4 + upstream: 7a72d79eef89ce242e08edb18f64106374117295 +cb9e33d36836000d9a79d3b0121beee91c3323b9: + title: 'hwmon: (max6697) Fix swapped temp{1,8} critical alarms' + mainline: 1ea3fd1eb9869fcdcbc9c68f9728bfc47b9503f1 + upstream: 6b52603ed8bdcceb9b8c16d2db7abd19e024fbe2 +c731a44f2487b720039473b6255fba3ad26d7753: + title: 'arm64: dts: rockchip: Increase VOP clk rate on RK3328' + mainline: 0f2ddb128fa20f8441d903285632f2c69e90fae1 + upstream: 513fff3e8574d3c5b54ef71b6514cda12123879e +266d74e904f119b2251094862e9f7d56c3fb74fe: + title: 'm68k: atari: Fix TT bootup freeze / unexpected (SCU) interrupt messages' + mainline: f70065a9fd988983b2c693631b801f25a615fc04 + upstream: b6c2b179b6908e439b2385c25d7b3477e4be4dce +0d26a6a5f0bb7e82bfebf44b060294eec5a72b73: + title: 'x86/xen: Convert comma to semicolon' + mainline: 349d271416c61f82b853336509b1d0dc04c1fcbb + upstream: cb9ad82cf270ce5bdcf5e768af48966833cc3caa +8bc40077dd7c321cc45107a639c176d317892413: + title: 'm68k: cmpxchg: Fix return value for default case in __arch_xchg()' + mainline: 21b9e722ad28c19c2bc83f18f540b3dbd89bf762 + upstream: 8c43fbd39500ce7bdc779a772752cc2b436a692c +5fa524af8685b00160e9e766bbe196804a007844: + title: 'wifi: brcmsmac: LCN PHY code is used for BCM4313 2G-only device' + mainline: c636fa85feb450ca414a10010ed05361a73c93a6 + upstream: f33757e8db8f33aba783b88120245ec53e5fa88a +1a85ab4b601786019135c37ec3f11927ba4a561d: + title: 'net: fec: Refactor: #define magic constants' + mainline: ff049886671ccd4e624a30ec464cb20e4c39a313 + upstream: b072c604d58b1cd1079c4e2f0d22b1f469dda347 +c3996b8fae20c268b6c49e70ea078bceb96d0c27: + title: 'net: fec: Fix FEC_ECR_EN1588 being cleared on link-down' + mainline: c32fe1986f27cac329767d3497986e306cad1d5e + upstream: 18074367ad100e129d0dccdaa64af6642363680b +2a3559125bd5fc024c30b1655b626abc0c2fa3eb: + title: 'ipvs: Avoid unnecessary calls to skb_is_gso_sctp' + mainline: 53796b03295cf7ab1fc8600016fa6dfbf4a494a0 + upstream: 9340804ea465de0509a9afaeaaccf3fb74b14f9b +6f7bc617b3b66436641dba5329718933aea4b889: + title: 'perf: Fix perf_aux_size() for greater-than 32-bit size' + mainline: 3df94a5b1078dfe2b0c03f027d018800faf44c82 + upstream: 542abbf58e88f34dfc659b63476a5976acf52c0e +26864f03cc21aaa1b9f2dbed5c8ad7bf676f2df4: + title: 'perf: Prevent passing zero nr_pages to rb_alloc_aux()' + mainline: dbc48c8f41c208082cfa95e973560134489e3309 + upstream: d7b1a76f33e6fc93924725b4410126740c890c44 +be35c98c5aa383407f62428c4169a79d5c243c26: + title: 'bna: adjust ''name'' buf size of bna_tcb and bna_ccb structures' + mainline: c9741a03dc8e491e57b95fba0058ab46b7e506da + upstream: f121740f69eda4da2de9a20a6687a13593e72540 +ce58b8f17bfc9cfad7fafb57ebb626850d4802ba: + title: 'media: imon: Fix race getting ictx->lock' + mainline: 24147897507cd3a7d63745d1518a638bf4132238 + upstream: 01b44d9e50a68ac3c645cc98a474455668dc8e70 +e0b07e242c61e819acf0143bb2c23d4859b135db: + title: 'saa7134: Unchecked i2c_transfer function result fixed' + mainline: 9d8683b3fd93f0e378f24dc3d9604e5d7d3e0a17 + upstream: 001583ad640c70987efd5af70566a69f146dc99c +0ae6e736f858e4c42ecf27fd1e8ecae18988ad81: + title: 'media: v4l: vsp1: Store pipeline pointer in vsp1_entity' +f0a224ecf4ca80033edee705bd34405dae4ea20a: + title: 'media: renesas: vsp1: Fix _irqsave and _irq mix' + mainline: 57edbbcf5258c378a9b9d0c80d33b03a010b22c8 + upstream: ab1325f1074da2cfa1259417fb6c93a0886e74c8 +49db8c90eba2da9ddc6f9a203a6d20984d1658a7: + title: 'media: renesas: vsp1: Store RPF partition configuration per RPF instance' + mainline: a213bc09b1025c771ee722ee341af1d84375db8a + upstream: ae16866626ecae26a7317e0372224d5480211ff7 +39632d1c383813e9ddb20088f6e9a3b44ee70569: + title: 'perf report: Fix condition in sort__sym_cmp()' + mainline: cb39d05e67dc24985ff9f5150e71040fa4d60ab8 + upstream: 2e6abffcb52a36c89c0a70499b86e0a99df15d1e +fa7e07d7ebb21ec8b937faeb3254a608c4d2eea2: + title: 'drm/etnaviv: fix DMA direction handling for cached RW buffers' + mainline: 58979ad6330a70450ed78837be3095107d022ea9 + upstream: c7c74c8256206ffc27212ada1f998f5a05b8c54f +5e8bf661518b825696c6ee219e62292e6bc8df93: + title: 'ext4: avoid writing unitialized memory to disk in EA inodes' + mainline: 65121eff3e4c8c90f8126debf3c369228691c591 + upstream: 282e8d4e9d33182a5ca25fe6333beafdc5282946 +0549d286c615b284448fa4d449c322f3ae2aa55f: + title: 'sparc64: Fix incorrect function signature and add prototype for prom_cif_init' + mainline: a6c3ea1ec96307dbfbb2f16d96c674c5cc80f445 + upstream: 6b4f676006a390edffd6a00f2ebc23276dd05031 +02a0104454d95405c65536870fdc426e8663512d: + title: 'PCI: Equalize hotplug memory and io for occupied and empty slots' + mainline: de3ffa301142bf8802a7b0de17f9985acde5c223 + upstream: 0012438a122c56d727712169df42fd0e297a42b0 +0a5d6964e9374945dfef1227972e8cc1a2a6d5ef: + title: 'PCI: Fix resource double counting on remove & rescan' + mainline: 903534fa7d30214d8ba840ab1cd9e917e0c88e41 + upstream: 2044071c6e42d041e3656bad105be5879f6b70f1 +8e50a9f8175582f34a709024496217f3fca864e5: + title: 'RDMA/mlx4: Fix truncated output warning in mad.c' + mainline: 0d2e6992fc956e3308cd5376c18567def4cb3967 + upstream: c4eaaf28068a99d8363bf02a20a32bf207be13e1 +e9d4656f8f0c014de2ffcf8d4903c4630c43c72b: + title: 'RDMA/mlx4: Fix truncated output warning in alias_GUID.c' + mainline: 5953e0647cec703ef436ead37fed48943507b433 + upstream: 087abc7e244700f741c0431af59b28e910a82dc1 +117e5c14bbbb75364fabcb7d2e70e19167efc931: + title: 'RDMA/rxe: Don''t set BTH_ACK_MASK for UC or UD QPs' + mainline: 4adcaf969d77d3d3aa3871bbadc196258a38aec6 + upstream: 796c0f32fc956b88c345195472e2d74823be0d03 +550d6bbd2dedbc88697932ddbe5f930b20a4d7c1: + title: 'mtd: make mtd_test.c a separate module' + mainline: a5cf054d325e6f362e82fe6d124a1871a4af8174 + upstream: 17b016971c27ee1e884da3ce502801cb95f84ff1 +e547f41337badd93753b4fe3ae3817ed8400abd6: + title: 'Input: elan_i2c - do not leave interrupt disabled on suspend failure' + mainline: 5f82c1e04721e7cd98e604eb4e58f0724d8e5a65 + upstream: 2ee59e846895b6b061defbc6cde83126f91b7abd +fd5b433d1390c5586bc367f3e10fbb226ad9e2ac: + title: 'MIPS: Octeron: remove source file executable bit' + mainline: 89c7f5078935872cf47a713a645affb5037be694 + upstream: 12bc3aca7d100a8f749c2a6fcdb6be08ad41c105 +971a6101e844da8bcbdd4bd046a826c6cc44d861: + title: 'powerpc/xmon: Fix disassembly CPU feature checks' + mainline: 14196e47c5ffe32af7ed5a51c9e421c5ea5bccce + upstream: 5b84d47a0baee13434fadb3b9506c39f51f9ab98 +20b6b7a306d9487bb507af81df8e926b8141d902: + title: 'macintosh/therm_windtunnel: fix module unload.' + mainline: fd748e177194ebcbbaf98df75152a30e08230cc6 + upstream: eeb9a0f79d8e4ea27b4f85a73f3765dc0046ab01 +4f51eb5763820de8cf9bc32b26b20d19f7ccfc5d: + title: 'bnxt_re: Fix imm_data endianness' + mainline: 95b087f87b780daafad1dbb2c84e81b729d5d33f + upstream: dfb40b2535b298b34b37780fe8eced6d38e28c5c +ccfb620ebf3085fca54472461544c796cbd7db5d: + title: 'netfilter: ctnetlink: use helper function to calculate expect ID' + mainline: 782161895eb4ac45cf7cfa8db375bd4766cb8299 + upstream: 66e7650dbbb8e236e781c670b167edc81e771450 +ee8bf45248bc530e2dc9a0a7f833febbe89fd2e1: + title: 'pinctrl: core: fix possible memory leak when pinctrl_enable() fails' + mainline: ae1cf4759972c5fe665ee4c5e0c29de66fe3cf4a + upstream: 636f8fe03a14b0994a3dbdc05c8fa8c8296c1357 +fbd206c9e544f6e8fbb844534d05817ab6ed637a: + title: 'pinctrl: single: fix possible memory leak when pinctrl_enable() fails' + mainline: 8f773bfbdd428819328a2d185976cfc6ae811cd3 + upstream: 9dad82c7c7424c240db65f10ad999266f2967479 +9521c0b13c94c6ad389f9a5d7f8213891d8924a7: + title: 'pinctrl: ti: ti-iodelay: Drop if block with always false condition' + mainline: 88b3f108502bc45e6ebd005702add46759f3f45a + upstream: 268b3ff414ae8942af9d6c981b5df8667c2b76b6 +78e3f7ec45416b8b0a25ef8fcbf85b653f49d5bb: + title: 'pinctrl: ti: ti-iodelay: fix possible memory leak when pinctrl_enable() fails' + mainline: 9b401f4a7170125365160c9af267a41ff6b39001 + upstream: 7d720f351714dcbeb578af67bb7e66326504826c +251acaffa0bd813f67f7a92082bdbd101c395f4d: + title: 'pinctrl: freescale: mxs: Fix refcount of child' + mainline: 7f500f2011c0bbb6e1cacab74b4c99222e60248e + upstream: c90d81a6e1f3daab4c06f7f8aba346abc76ae07a +2891e08c6f20e3c7b4b09dac8e949a195b46ff8c: + title: 'fs/nilfs2: remove some unused macros to tame gcc' + mainline: e7920b3e9d9f5470d5ff7d883e72a47addc0a137 + upstream: 175ac70d8af52bc0f5b100901702fdb2bc662885 +440e5d6b0d782ee0786d780761f57a117c904288: + title: 'nilfs2: avoid undefined behavior in nilfs_cnt32_ge macro' + mainline: 0f3819e8c483771a59cf9d3190cd68a7a990083c + upstream: d2b9bc7dfd6b0fa1a37eb91e68bca3175cb5ef50 +3065612975c688a1ea3f759a23856a4b9eefdc12: + title: 'tick/broadcast: Make takeover of broadcast hrtimer reliable' + mainline: f7d43dd206e7e18c182f200e67a8db8c209907fa + upstream: dfe19aa91378972f10530635ad83b2d77f481044 +d5744057122276d5d9c9b33a8e567e963897d502: + title: 'net: netconsole: Disable target before netpoll cleanup' + mainline: 97d9fba9a812cada5484667a46e14a4c976ca330 + upstream: 608a07143563a2a0d1edd57b2f4e95b0199fb497 +6d8fa691e6733006d5c061a297fe601d126d748b: + title: 'af_packet: Handle outgoing VLAN packets without hardware offloading' + mainline: 79eecf631c14e7f4057186570ac20e2cfac3802e + upstream: 3dfd84aa72fa7329ed4a257c8f40e0c9aff4dc8f +f58439a91781f888dce8463243b4d83be380d21c: + title: 'ipv6: take care of scope when choosing the src addr' + mainline: abb9a68d2c64dd9b128ae1f2e635e4d805e7ce64 + upstream: b4f67f09287392e0a2f7422199a193e37f2737af +058c66e9aa0cd80581ff06b9294521e05ea1d0dd: + title: 'media: venus: fix use after free in vdec_close' + mainline: a0157b5aa34eb43ec4c5510f9c260bbb03be937e + upstream: ad8cf035baf29467158e0550c7a42b7bb43d1db6 +26722f11717342d8f7deeb0c23fa6814bc31a48c: + title: 'hfs: fix to initialize fields of hfs_inode_info after hfs_alloc_inode()' + mainline: 26a2ed107929a855155429b11e1293b83e6b2a8b + upstream: f7316b2b2f11cf0c6de917beee8d3de728be24db +d92238c8b1116bff1babca839d923d345128c202: + title: 'drm/gma500: fix null pointer dereference in cdv_intel_lvds_get_modes' + mainline: cb520c3f366c77e8d69e4e2e2781a8ce48d98e79 + upstream: f392c36cebf4c1d6997a4cc2c0f205254acef42a +2c7d6f35aea17924ebb60002a151c8e4909cb226: + title: 'drm/gma500: fix null pointer dereference in psb_intel_lvds_get_modes' + mainline: 2df7aac81070987b0f052985856aa325a38debf6 + upstream: 13b5f3ee94bdbdc4b5f40582aab62977905aedee +1ac49c559cf87bd78734f326ef6db4c2d876d804: + title: 'm68k: amiga: Turn off Warp1260 interrupts during boot' + mainline: 1d8491d3e726984343dd8c3cdbe2f2b47cfdd928 + upstream: 296185ef87e6184e364bd9e7c983089b8e606a55 +4ed99f550b6316ae9cfa1ffdb6c4f053631117e6: + title: 'ext4: check dot and dotdot of dx_root before making dir indexed' + mainline: 50ea741def587a64e08879ce6c6a30131f7111e7 + upstream: b80575ffa98b5bb3a5d4d392bfe4c2e03e9557db +839f30000100e2b3fb252f1755c4434cad12da0c: + title: 'ext4: make sure the first directory block is not a hole' + mainline: f9ca51596bbfd0f9c386dd1c613c394c78d9e5e6 + upstream: d81d7e347d1f1f48a5634607d39eb90c161c8afe +b9bb3e4e90d4b44dc0667e7e5e24a8c4cd9eb9f5: + title: 'wifi: mwifiex: Fix interface type change' + mainline: a17b9f590f6ec2b9f1b12b1db3bf1d181de6b272 + upstream: 98cf9959a20dc374b7bba4b9357203e54484be58 +4e71b875b885df71c21f8f1fa380064b59fdd414: + title: 'leds: ss4200: Convert PCIBIOS_* return codes to errnos' + mainline: ce068e83976140badb19c7f1307926b4b562fac4 + upstream: db1871789f3018c5b0788318d3b1c685f2decceb +63576e19060aa3b515c02583870bde5d75260ed8: + title: 'hwrng: amd - Convert PCIBIOS_* return codes to errnos' + mainline: 14cba6ace79627a57fb9058582b03f0ed3832390 + upstream: d48e11483e3eb8ade86c57f4145644725cd33eed +31754844f0fd1fbfd0a6fd857ec7021240b6d3a3: + title: 'PCI: hv: Return zero, not garbage, when reading PCI_INTERRUPT_PIN' + mainline: fea93a3e5d5e6a09eb153866d2ce60ea3287a70d + upstream: e9cafb31aa498558d6ff7b28baed894db7d801f3 +080400d0031e6b30ae84fa1722d55cb6a3376f8c: + title: 'binder: fix hang of unregistered readers' + mainline: 31643d84b8c3d9c846aa0e20bc033e46c68c7e7d + upstream: 229670361c29381b0e1677763590e4dbc209ecbe +0900cd07eb9119e80a55a97784e8cc1ca6390402: + title: 'scsi: qla2xxx: Return ENOBUFS if sg_cnt is more than one for ELS cmds' + mainline: ce2065c4cc4f05635413f63f6dc038d7d4842e31 + upstream: 5c9d1ac649469feaab4240c0c1b5920ea8649b50 +24eb54283c4effe2b0c2d94401d19e0ff004e357: + title: 'f2fs: prevent newly created inode from being dirtied incorrectly' +27f9505abcdef5527ce43c5c21ecf89bc76f2278: + title: 'f2fs: fix to don''t dirty inode for readonly filesystem' + mainline: 192b8fb8d1c8ca3c87366ebbef599fa80bb626b8 + upstream: 2d2916516577f2239b3377d9e8d12da5e6ccdfcf +e38af31723db1861d58b71410895872b72abc272: + title: 'ubi: eba: properly rollback inside self_check_eba' + mainline: 745d9f4a31defec731119ee8aad8ba9f2536dd9a + upstream: 29f2c831822fde87b78c73e5db6ecfb106473cff +a01900bb7d4f831a50f19c58b1b9e3c9aa9dd9d9: + title: 'decompress_bunzip2: fix rare decompression failure' + mainline: bf6acd5d16057d7accbbb1bf7dc6d8c56eeb4ecc + upstream: 16b92b031b4da174342bd909130731c55f20c7ea +930865dbd92b29bc57364695d561c289d693f72d: + title: 'scsi: qla2xxx: During vport delete send async logout explicitly' + mainline: 76f480d7c717368f29a3870f7d64471ce0ff8fb2 + upstream: 086489256696eb774654a5410e86381c346356fe +b212bfa809f6d1235bbbb6c491621ce314b073a6: + title: 'perf/x86/intel/pt: Fix topa_entry base length' + mainline: 5638bd722a44bbe97c1a7b3fae5b9efddb3e70ff + upstream: b4030b619066aa1c20e075ce9382f103e0168145 +dbffea43e8b704e5cb23e776be21c12a3e0f0b65: + title: 'watchdog/perf: properly initialize the turbo mode timestamp and rearm counter' + mainline: f944ffcbc2e1c759764850261670586ddf3bdabb + upstream: 6d94ca5d571dfdb34f12dc3f63273ea275e8f40c +8e28810fed0aaf5624155ae6974d1cc95623edf2: + title: 'platform: mips: cpu_hwmon: Disable driver on unsupported hardware' + mainline: f4d430db17b4ef4e9c3c352a04b2fe3c93011978 + upstream: 0818a768c96a10343d08a622906adab54da6e014 +4a7a97d0ef008b684e246ead6e1474949cb0b579: + title: 'RDMA/iwcm: Remove a set-but-not-used variable' +b4099074459a9baa637aba3a5fa6d814f32e5eb2: + title: 'RDMA/iwcm: Fix a use-after-free related to destroying CM IDs' + mainline: aee2424246f9f1dadc33faa78990c1e2eb7826e4 + upstream: d91d253c87fd1efece521ff2612078a35af673c6 +0a35556f0aa6435749d819919639e400943a3430: + title: 'selftests/sigaltstack: Fix ppc64 GCC build' + mainline: 17c743b9da9e0d073ff19fd5313f521744514939 + upstream: 8010e0748cca059187021d194bb6d883d159e172 +0e318baa084d870466c8cefaab8d2689e56d21e7: + title: 'nilfs2: handle inconsistent state in nilfs_btnode_create_block()' + mainline: 4811f7af6090e8f5a398fbdd766f903ef6c0d787 + upstream: 19cce46238ffe3546e44b9c74057103ff8b24c62 +2527458f09eb86ba89b673081c8a408c8a3f7591: + title: 'kdb: Fix bound check compiler warning' + mainline: ca976bfb3154c7bc67c4651ecd144fdf67ccaee7 + upstream: b15593e2904d2ff0094b7170f806dba0eeefac75 +fbcf6bbfac542e249d92ce80277a03dde0699305: + title: 'kdb: address -Wformat-security warnings' + mainline: 70867efacf4370b6c7cdfc7a5b11300e9ef7de64 + upstream: 22a100556ceab8b906ad180788bd6bdc07390f50 +4925aa995a5cf9f49c04fdd1257b1d8f341dd4f5: + title: 'kdb: Use the passed prompt in kdb_position_cursor()' + mainline: e2e821095949cde46256034975a90f88626a2a73 + upstream: 90f2409c1d552f27a2b2bf8dc598d147c4173128 +4c2dc9502e8728f3a9ba9029aeaa08fc01e420d1: + title: 'jfs: Fix array-index-out-of-bounds in diFree' + mainline: f73f969b2eb39ad8056f6c7f3a295fa2f85e313a + upstream: 55b732c8b09b41148eaab2fa8e31b0af47671e00 +5a9dbd8f70793aba9e12d6d5216ce45cd9597a78: + title: 'dma: fix call order in dmam_free_coherent' + mainline: 28e8b7406d3a1f5329a03aa25a43aa28e087cb20 + upstream: fe2d246080f035e0af5793cb79067ba125e4fb63 +1184f039bc84987937ac8144df7a5daaffb0795c: + title: 'MIPS: SMP-CPS: Fix address for GCR_ACCESS register for CM3 and later' + mainline: a263e5f309f32301e1f3ad113293f4e68a82a646 + upstream: 3213ac4e85945c54350ac06c09902d1c82211100 +5b3e5dc382a0cab89cea2c533a0e5b65ae4d686e: + title: 'net: ip_rt_get_source() - use new style struct initializer instead of memset' + mainline: e351bb6227fbe2bb5da6f38a4cf5bd18810b0557 + upstream: 0e8712254b48a7c6ebb76dce414a9539e772d406 +ef5a6f1d6d270c55e210ed3775352ff75e2aa48e: + title: 'ipv4: Fix incorrect source address in Record Route option' + mainline: cc73bbab4b1fb8a4f53a24645871dafa5f81266a + upstream: 5c65e55e41e1300c4ebf4dda22a704b2beed2423 +f204855673caa3a17b49c8b9642edcd269a4fac7: + title: 'net: bonding: correctly annotate RCU in bond_should_notify_peers()' + mainline: 3ba359c0cd6eb5ea772125a7aededb4a2d516684 + upstream: 6c9261a2bdf614b376dbefa01e0c6bb32d14e019 +1ae654c0cdf7bfcd142367568d3a1afbed7d54e8: + title: 'tipc: Return non-zero value from tipc_udp_addr2str() on error' + mainline: fa96c6baef1b5385e2f0c0677b32b3839e716076 + upstream: 7ec3335dd89c8d169e9650e4bac64fde71fdf15b +70609fe847bf6600554b6f511b10015f76834d58: + title: 'mISDN: Fix a use after free in hfcmulti_tx()' + mainline: 61ab751451f5ebd0b98e02276a44e23a10110402 + upstream: 70db2c84631f50e02e6b32b543700699dd395803 +1967ea8b282b3b05c9da41c1e2426c3bfb04bf54: + title: 'mm: avoid overflows in dirty throttling logic' + mainline: 385d838df280eba6c8680f9777bfa0d0bfe7e8b2 + upstream: 2b2d2b8766db028bd827af34075f221ae9e9efff +aff1d3ed73ce5882235d9f42c4510c642b9e1dac: + title: 'PCI: rockchip: Make ''ep-gpios'' DT property optional' + mainline: 58adbfb3ebec460e8b58875c682bafd866808e80 + upstream: 11f71f0c562dbfbc3f3e2c56053bca42f7e8d71c +5a659bbb75dd76c32388a8b4c8ea8dff2aa79c12: + title: 'PCI: rockchip: Use GPIOD_OUT_LOW flag while requesting ep_gpio' + mainline: 840b7a5edf88fe678c60dee88a135647c0ea4375 + upstream: 8de378d17e5b737907c04acc2fab6d966a129f70 +d34a87ca6e4c611b125d238c3a56b712a612acd6: + title: 'parport: parport_pc: Mark expected switch fall-through' + mainline: aa1f0fa374ed23528b915a693a11b0f275a299c0 + upstream: f1af18ba5925abb275de8bf387fceb9fbf93a096 +af0192bb58b539ec732125a76fe4d69660147cca: + title: 'parport: Convert printk(KERN_ to pr_(' + mainline: decf26f6ec25dac868782dc1751623a87d147831 + upstream: cb2a998b88d173ec23423fa13ae2da463449728a +4582fe6f2d5fddcf7a63b59b666e8837f2cecf9a: + title: 'parport: Standardize use of printmode' + mainline: a6abfdff4fe5dd19d1f1b37d72ba34cd4492fd4d + upstream: 884ab25dbf115938facb91be85ffed9266e26f8b +598e7acd167941653c0a54d5732bad40db488504: + title: 'dev/parport: fix the array out-of-bounds risk' + mainline: ab11dac93d2d568d151b1918d7b84c2d02bacbd5 + upstream: 166a0bddcc27de41fe13f861c8348e8e53e988c8 +bdec7b3d4ccbcbd78fd4b6a2c6fe7a849754af52: + title: 'driver core: Cast to (void *) with __force for __percpu pointer' + mainline: d7aa44f5a1f86cb40659eef06035d8d92604b9d5 + upstream: b9c258b2a02ba8d6d004f45a1eafa23fd810746b +9b6f7f34aae733309a35d9990d4a0cdf2d2eea3b: + title: 'devres: Fix memory leakage caused by driver API devm_free_percpu()' + mainline: bd50a974097bb82d52a458bd3ee39fb723129a0c + upstream: 700e8abd65b10792b2f179ce4e858f2ca2880f85 +9ce7856eccc159df29f62b1e5ff0c6239422bf63: + title: 'perf/x86/intel/pt: Export pt_cap_get()' + mainline: f6d079ce867d679e4dffef5b3112c7634215fd88 + upstream: bea2d4588e90f56da62b0dd9099484a42498b08a +2de7be6b1893e070e92da91bbaa35ce22950b189: + title: 'perf/x86/intel/pt: Use helpers to obtain ToPA entry size' + mainline: fffec50f541ace292383c0cbe9a2a97d16d201c6 + upstream: e3fb71f7ecbf87228148c3287eac965927ef49be +ab03429ae696126f00509dac54b632bfb2282240: + title: 'perf/x86/intel/pt: Use pointer arithmetics instead in ToPA entry calculation' + mainline: 539f7c26b41d4ed7d88dd9756de3966ae7ca07b4 + upstream: 67968b8c7603007751f140f3f9f8aa8e64fc26b2 +a87ac310cc99adff1aa8315d829ce984dfc0cda6: + title: 'perf/x86/intel/pt: Split ToPA metadata and page layout' + mainline: 38bb8d77d0b932a0773b5de2ef42479409314f96 + upstream: e9d9ec1019a90aafdb54765a3b46f36f402b481a +d6c356954a61ce5a5f851b9aa858f9d906e4228d: + title: 'perf/x86/intel/pt: Fix a topa_entry base address calculation' + mainline: ad97196379d0b8cb24ef3d5006978a6554e6467f + upstream: 418f7db13405953c2d9223275d365d9828169076 +5d99fd6160cb1a1ecd0163220164b8d1fe2cecf6: + title: 'remoteproc: imx_rproc: ignore mapping vdev regions' + mainline: 8f2d8961640f0346cbe892273c3260a0d30c1931 + upstream: 35df377f38fb516111933f132b51a386b4d4892f +c1239a005bbf4c6b43aec1155ac3d8466b640051: + title: 'remoteproc: imx_rproc: Fix ignoring mapping vdev regions' + mainline: afe670e23af91d8a74a8d7049f6e0984bbf6ea11 + upstream: a80423f6566bc5085d6bbdd2acdb80aa20c0e915 +3e1715ba7291483690f92608e08aba0d12c5ef70: + title: 'remoteproc: imx_rproc: Skip over memory region when node value is NULL' + mainline: 2fa26ca8b786888673689ccc9da6094150939982 + upstream: 6884fd0283e0831be153fb8d82d9eda8a55acaaa +4aff76137ef2fa40ec1f424eb8e743673ffe5434: + title: 'drm/vmwgfx: Fix overlay when using Screen Targets' + mainline: cb372a505a994cb39aa75acfb8b3bcf94787cf94 + upstream: 6f4bc8b021d3436e5dda88350d8e0ac3c8df400f +582d87d965d3600b178bbaf8947523e5478da1d1: + title: 'net/iucv: fix use after free in iucv_sock_close()' + mainline: f558120cd709682b739207b48cf7479fd9568431 + upstream: 84f40b46787ecb67c7ad08a5bb1376141fa10c01 +c04add3c9adf1402f47ff8f51dd2ee533e863a00: + title: 'ipv6: fix ndisc_is_useropt() handling for PIO' + mainline: a46c68debf3be3a477a69ccbf0a1d050df841676 + upstream: 97a4f78feadc431a050cc26355f95ac3d73a4d4c +f4c005cc381764f082f66825073bb6c43f54fe14: + title: protect the fetch of ->fd[fd] in do_dup2() from mispredictions + mainline: 8aa37bde1a7b645816cda8b80df4753ecf172bf1 + upstream: ed42e8ff509d2a61c6642d1825032072dab79f26 +71a0712ba842211e6dc1a4f7e91dd6c7502eebe5: + title: 'ALSA: usb-audio: Correct surround channels in UAC1 channel map' + mainline: b7b7e1ab7619deb3b299b5e5c619c3e6f183a12d + upstream: f4eb853103674698416ba66d41317b1d869d4bdc +3f465b02b4b919181c45ef14fe5ca3638b87ac5c: + title: 'net: usb: sr9700: fix uninitialized variable use in sr_mdio_read' + mainline: 08f3a5c38087d1569e982a121aad1e6acbf145ce + upstream: 9f04dbd139aa1988fc8b7984ffbce7849be73f21 +6f4e6f1f7e5d27fa977d9900aba67c9cc3c15d4e: + title: 'irqchip/mbigen: Fix mbigen node address layout' + mainline: 6be6cba9c4371d27f78d900ccfe34bb880d9ee20 + upstream: 2f61f0c6b7411212acd6490c5629b0049e8eaefa +193653bb5bb78ddaa2698760912db0248833cccc: + title: 'net: usb: qmi_wwan: fix memory leak for not ip packets' + mainline: 7ab107544b777c3bd7feb9fe447367d8edd5b202 + upstream: 3c90a69533b5bba73401ef884d033ea49ee99662 +928a0513e3f0353f456c9734695c47a94f423c54: + title: 'net: linkwatch: use system_unbound_wq' + mainline: 3e7917c0cdad835a5121520fc5686d954b7a61ab + upstream: 3840189e4619af11f558e6faff80813f008246a6 +0c7df8f6eff3aa1044d3f97dd249112dc4301778: + title: 'Bluetooth: l2cap: always unlock channel in l2cap_conless_channel()' + mainline: c531e63871c0b50c8c4e62c048535a08886fba3e + upstream: 64f4938368f4be563b7652d6b18d37b317913b47 +20cb64898909ba7ccad47d1e52e980ba859c29c0: + title: 'net: fec: Stop PPS on driver remove' + mainline: 8fee6d5ad5fa18c270eedb2a2cdf58dbadefb94b + upstream: 7762f5317db83b70099ed1b2c100df54abddaec1 +a10b1779aca24535b14edba941cb59fbd35ce7c9: + title: 'md/raid5: avoid BUG_ON() while continue reshape after reassembling' + mainline: 305a5170dc5cf3d395bb4c4e9239bca6d0b54b49 + upstream: 2c92f8c1c456d556f15cbf51667b385026b2e6a0 +f9ec6971715991696e49430547551697f1153be6: + title: 'clocksource/drivers/sh_cmt: Address race condition for clock events' + mainline: db19d3aa77612983a02bd223b3f273f896b243cf + upstream: 026befb502ce41384e5119df12c9f2d4067cb23c +ca0a3431163788b838bdccff1eac2b84a30bee91: + title: 'PCI: Add Edimax Vendor ID to pci_ids.h' + mainline: eee5528890d54b22b46f833002355a5ee94c3bb4 + upstream: a35a163cd56b583ef698eadef9b856b0fe6e2727 +ed09bb9292ca0c02ada12cd5f17ef9e976cb5f8c: + title: 'udf: Fix signed/unsigned format specifiers' +12ce9c96b15650623040f0d999b91b5d12f9936f: + title: 'udf: prevent integer overflow in udf_bitmap_free_blocks()' + mainline: 56e69e59751d20993f243fb7dd6991c4e522424c + upstream: 097420e48e30f51e8f4f650b5c946f5af63ec1a3 +a253db7576fd90aaa15b1dabec335f2f9df7c21e: + title: 'wifi: nl80211: don''t give key data to userspace' + mainline: a7e5793035792cc46a1a4b0a783655ffa897dfe9 + upstream: f4d99b55dca90ca703bdd57ee8d557cd8d6c1639 +dd102bb94b5dba7e5376f09504503f3bc2cf16da: + title: 'btrfs: fix bitmap leak when loading free space cache on duplicate entry' + mainline: 320d8dc612660da84c3b70a28658bb38069e5a9a + upstream: fad0bb34cfcea693903409356693988f04715b8e +feddc92ee4859f5e6c5a69135f94547740b292a9: + title: 'media: uvcvideo: Ignore empty TS packets' + mainline: 5cd7c25f6f0576073b3d03bc4cfb1e8ca63a1195 + upstream: 019f538f9fe0b48bb436135edba69aa3a5156cdb +00a39f4e0adbb1b194e0a1ba2219e26c57042dc7: + title: 'media: uvcvideo: Fix the bandwdith quirk on USB 3.x' + mainline: 9e3d55fbd160b3ca376599a68b4cddfdc67d4153 + upstream: eada6212c055089962ca3ee7b8ab11d8f4d0e4f5 +82f1f40db08d606f0538e4a88e06a919b8656645: + title: 'jbd2: avoid memleak in jbd2_journal_write_metadata_buffer' + mainline: cc102aa24638b90e04364d64e4f58a1fa91a1976 + upstream: 831db95409cc12589c14a71b9bf6c3e7f70bf5a0 +6062fd1ee48c6cb081cbc525e31fd43fa9632dbc: + title: 'SUNRPC: Fix a race to wake a sync task' + mainline: ed0172af5d6fc07d1b40ca82f5ca3979300369f7 + upstream: 06d281f0ad7504e9f250c6a9ef78d9e48cea5717 +fb37e57b6e2f8217b201737f10af809289674469: + title: 'ext4: fix wrong unit use in ext4_mb_find_by_goal' + mainline: 99c515e3a860576ba90c11acbc1d6488dfca6463 + upstream: 585b8d86c39882425f737b800e7552fb42a4785f +7a346f1ce3ab37134f2365ab6a74422747285fdb: + title: 'i2c: smbus: Don''t filter out duplicate alerts' + mainline: dca0dd28fa5e0a1ec41a623dbaf667601fc62331 + upstream: 6adca954fc039151ef4f9c1ea1f201e12a24593d +c364d250ada36665ea06f204449d1162cb5e1432: + title: 'i2c: smbus: Improve handling of stuck alerts' + mainline: 37c526f00bc1c4f847fc800085f8f009d2e11be6 + upstream: 9540badee607a99cc07bddbd0a7d4a01fd3b9661 +a0bb631d7d0a1773ebbb427ac8564ae8818b4dfe: + title: 'i2c: smbus: Send alert notifications to all devices if source not found' + mainline: f6c29f710c1ff2590109f83be3e212b86c01e0f3 + upstream: 3b20631d0704fe4f6bf4cf9a49fd19871ebaeffb +5ec8022d2f6ecf35ce105eafaf28b73c46619207: + title: 'spi: lpspi: Switch to SPDX identifier' +0ef61696a9fff3915fb5aa6f7bb9f89682d10ad9: + title: 'spi: lpspi: Replace all "master" with "controller"' + mainline: 07d71557494c05b0651def1651bf6d7e7f47bbbb + upstream: bebc69b574d6a3c54e8951dd891e78a20e2a3f54 +12bfab716ae4cd47449d7636a25326099daa10a9: + title: 'spi: lpspi: Add slave mode support' + mainline: bcd87317aae26b9ac497cbc1232783aaea1aeed4 + upstream: b1b5a04eadd9b786dcd4bc82e726498a8f6fd50a +6a6c19da1d3917fc8c51d2fd69b667a5e7b192ec: + title: 'spi: lpspi: Let watermark change with send data length' + mainline: cf86874bb9bdb99ba3620428b59b0408fbc703d0 + upstream: 8f8b12339ef7cc8e15989f6445aad5a9bf8c00f5 +dc2d2de15c66a8e41275b4d59e6082955e477991: + title: 'spi: lpspi: Add i.MX8 boards support for lpspi' + mainline: f5e5afdb0e56e81123e02b6a64dd32adc19a90d4 + upstream: 0b536d6c52a88b6a5a7f40d1ac91ffe170b8df87 +030b58b3539d0fdccf6284113c29f60c76b60916: + title: 'spi: lpspi: add the error info of transfer speed setting' + mainline: 77736a98b859e2c64aebbd0f90b2ce4b17682396 + upstream: 3bb46e26783c3c86e67172f695908a066be69e12 +d859e0255cb169a2d7aa96b42defafd7c515df0c: + title: 'spi: fsl-lpspi: remove unneeded array' + mainline: 2fa98705a9289c758b6154a22174aa8d4041a285 + upstream: da6cc32c245500f417e4b96d67722b8a0a07fd94 +dcde078eb1be234c810305963c845eaa63f20813: + title: 'spi: spi-fsl-lpspi: Fix scldiv calculation' + mainline: 730bbfaf7d4890bd99e637db7767dc68cfeb24e7 + upstream: 81964823116357a636201afa4010fa30f050446e +9ab8902f51b8ac3c51666922a9719c1e4d81f105: + title: 'ALSA: line6: Fix racy access to midibuf' + mainline: 15b7a03205b31bc5623378c190d22b7ff60026f1 + upstream: 643293b68fbb6c03f5e907736498da17d43f0d81 +d41cf1c7bc4e9706d684d3fb2c24046f673ffb78: + title: 'usb: vhci-hcd: Do not drop references before new references are gained' + mainline: afdcfd3d6fcdeca2735ca8d994c5f2d24a368f0a + upstream: 5a3c473b28ae1c1f7c4dc129e30cb19ae6e96f89 +95314b1272d1d96f5737c5b1e208fabd1128db3c: + title: 'USB: serial: debug: do not echo input by default' + mainline: 00af4f3dda1461ec90d892edc10bec6d3c50c554 + upstream: 1907ed1be026c771086e6adc560f38dc50e82382 +551fbbddb6f5ff52bdb1c0cdb3d096e359e088da: + title: 'usb: gadget: core: Check for unset descriptor' + mainline: 973a57891608a98e894db2887f278777f564de18 + upstream: ba15815dd24cc5ec0d23e2170dc58c7db1e03b4a +b41af170f9ad55d4780688b92c032579655218fe: + title: 'scsi: ufs: core: Fix hba->last_dme_cmd_tstamp timestamp updating logic' + mainline: ab9fd06cb8f0db0854291833fc40c789e43a361f + upstream: c4da5b5deb343346909920c41645ad85adff4c6c +6fad54cc7a6c8c4750209bfcff1b54dd60b086db: + title: 'tick/broadcast: Move per CPU pointer access into the atomic section' + mainline: 6881e75237a84093d0986f56223db3724619f26e + upstream: f54abf332a2bc0413cfa8bd6a8511f7aa99faea0 +07f7f40df90538c4bacb06d64ededc68b6d6e9bf: + title: 'ntp: Clamp maxerror and esterror to operating range' + mainline: 87d571d6fb77ec342a985afa8744bb9bb75b3622 + upstream: 9dfe2eef1ecfbb1f29e678700247de6010784eb9 +c72f8e96b8386d50894df2faed9718d7cbfc312d: + title: 'driver core: Fix uevent_show() vs driver detach race' + mainline: 15fffc6a5624b13b428bb1c6e9088e32a55eb82c + upstream: 49ea4e0d862632d51667da5e7a9c88a560e9c5a1 +53390d85b1f4fca100eca68612fe9ae736ef5caf: + title: 'ntp: Safeguard against time_constant overflow' + mainline: 06c03c8edce333b9ad9c6b207d93d3a5ae7c10c0 + upstream: a13f8b269b6f4c9371ab149ecb65d2edb52e9669 +1d33b86b2b99774eae26926b2f5f4900f826638f: + title: 'serial: core: check uartclk for zero to avoid divide by zero' + mainline: 6eabce6608d6f3440f4c03aa3d3ef50a47a3d193 + upstream: 3bbd90fca824e6fd61fb20f6dd2b0fa5f8b14bba +d9b1fa9a24e5ba3115a289421d535abf954efd7a: + title: 'power: supply: axp288_charger: Fix constant_charge_voltage writes' + mainline: b34ce4a59cfe9cd0d6f870e6408e8ec88a964585 + upstream: f1aa9f19da35f72ce8ec3196f0a7bc06e296aaeb +bd9bfbcc05c1c7af22dfa9ca8b2ff1d6395db661: + title: 'power: supply: axp288_charger: Round constant_charge_voltage writes down' + mainline: 81af7f2342d162e24ac820c10e68684d9f927663 + upstream: e3cb8400a72a9e5e25365d380b290cdd50ccdb5c +b28271a4428daf3c20b71a8e7cf218a4c38c698b: + title: 'tracing: Fix overflow in get_free_elt()' + mainline: bcf86c01ca4676316557dd482c8416ece8c2e143 + upstream: 302ceb625d7b990db205a15e371f9a71238de91c +4f0b886693fe2a82d8896cd431eb529777e1bbdc: + title: 'x86/mtrr: Check if fixed MTRRs exist before saving them' + mainline: 919f18f961c03d6694aa726c514184f2311a4614 + upstream: 34f36e6ee5bd7eff8b2adcd9fcaef369f752d82e +d5775da332c5377cc22a6e497a9b324c1f2fe2a1: + title: 'drm/bridge: analogix_dp: Check AUX_EN status when doing AUX transfer' +a413584fad9b551cb6e15f5e8a05f94d16871585: + title: 'drm/bridge: analogix_dp: Reset aux channel if an error occurred' +9f77a8ee77d6ec538dbccfc03c463586323300d0: + title: 'drm/bridge: analogix_dp: Properly log AUX CH errors' +5dfe0cc24eab4d1e640e3cfc7ef155216fb29f2a: + title: 'drm/bridge: analogix_dp: properly handle zero sized AUX transactions' + mainline: e82290a2e0e8ec5e836ecad1ca025021b3855c2d + upstream: 52f05898629b25fc382754d837be624205ce67f8 +e391c9f51faaf4a35bb29343af0d29164938363a: + title: 'drm/mgag200: Set DDC timeout in milliseconds' + mainline: ecde5db1598aecab54cc392282c15114f526f05f + upstream: 7db72e8e538e10afefe589d6203ffb4f5a1cbd9a +6bd6cf1374f27ba771760e53caf8c276e794b638: + title: 'kbuild: Fix ''-S -c'' in x86 stack protector scripts' + mainline: 3415b10a03945b0da4a635e146750dfe5ce0f448 + upstream: 9dd6e5296c8ad1bbb88933b8150383bc0eba9488 +9aee9974b20b6907210221aba005ec36135348a4: + title: 'netfilter: nf_tables: set element extended ACK reporting support' + mainline: b53c116642502b0c85ecef78bff4f826a7dd4145 + upstream: 61fbbac22c8ce73d0c492caf45a286c3f021c0fd +827a69923a6dddeb669678005299af5144147452: + title: 'drm/i915: Try GGTT mmapping whole object as partial' +3ccfe379cab98c308e84733885655b1c7c956b80: + title: 'drm/i915/gem: Fix Virtual Memory mapping boundaries calculation' + mainline: 8bdd9ef7e9b1b2a73e394712b72b22055e0e26c3 + upstream: 3e06073d24807f04b4694108a8474decb7b99e60 +02acb3b20db4e8372b854be6ce9846446def401c: + title: 'exec: Fix ToCToU between perm check and set-uid/gid usage' + mainline: f50733b45d865f91db90919f8311e2127ce5a0cb + upstream: d5c3c7e26275a2d83b894d30f7582a42853a958f +92af3424a5a42e8014f39c82996fe01a8ba6aaf0: + title: 'nvme/pci: Add APST quirk for Lenovo N60z laptop' + mainline: ab091ec536cb7b271983c0c063b17f62f3591583 + upstream: 9cc0878c7d7f12c10b3cc40197668816c918b465 +af183b69eaca031e9e4833d356ba1ef6c2adbaba: + title: 'Revert "selftests: make order checking verbose in msg_zerocopy selftest"' +2cb49c145133dc3d8b38832afe4be57ffc94836a: + title: 'Revert "selftests: fix OOM in msg_zerocopy selftest"' +d110d6dd927f5a2911fc5e697a14026eacc5da69: + title: 'Revert "selftests/net: reap zerocopy completions passed up as ancillary data."' +2d49c59f9120bc00d0cf6f055311d8f9ab7bb90d: + title: 'selftests: fix OOM in msg_zerocopy selftest' + mainline: af2b7e5b741aaae9ffbba2c660def434e07aa241 +144aa689351646efa81ec2ad9f0ba41599d9ffc8: + title: 'selftests: make order checking verbose in msg_zerocopy selftest' + mainline: 7d6d8f0c8b700c9493f2839abccb6d29028b4219 +795faf9727a66039c7c80e011fe0bad5bd88dd83: + title: 'net: fix __dst_negative_advice() race' + mainline: 92f1655aa2b2294d0b49925f3b875a634bd3b59e diff --git a/.elts/upstream/4.19.320.yaml b/.elts/upstream/4.19.320.yaml new file mode 100644 index 000000000000..71a503e22bb7 --- /dev/null +++ b/.elts/upstream/4.19.320.yaml @@ -0,0 +1,784 @@ +c0e53e36452d1b2a3ec71bf0586251245a5686c0: + title: 'platform/chrome: cros_ec_debugfs: fix wrong EC message version' + mainline: c2a28647bbb4e0894e8824362410f72b06ac57a4 + backport: dd6caa8da1ace4e2e4f02eb5284addebf4c5c2bb +fa4c26ce47b050d4988d8d5a7390e205abe4a2bc: + title: 'hfsplus: fix to avoid false alarm of circular locking' + mainline: be4edd1642ee205ed7bbf66edc0453b1be1fb8d7 + skipped: fixes patch not in branch +56d64c36b2aac95c9c24e303fb746591ecfa096a: + title: 'x86/of: Return consistent error type from x86_of_pci_irq_enable()' + mainline: ec0b4c4d45cf7cf9a6c9626a494a89cb1ae7c645 + backport: 78659ded3dbb7237c1582e91776e86a6b3247515 +600a520cc4e661aa712415e4a733924e9d22777d: + title: 'x86/pci/intel_mid_pci: Fix PCIBIOS_* return code handling' + mainline: 724852059e97c48557151b3aa4af424614819752 + backport: 5f1342ecebaf8161a43bcc1b8958c280452c8171 +5294b91618250c7719e4c85096cafe8f76a1bc20: + title: 'x86/pci/xen: Fix PCIBIOS_* return code handling' + mainline: e9d7b435dfaec58432f4106aaa632bf39f52ce9f + backport: 125df213ac935a71782e5c091206853ff9cb5556 +3f4f08e59ddf359da5bc4226ba865a59177a3a50: + title: 'x86/platform/iosf_mbi: Convert PCIBIOS_* return codes to errnos' + mainline: 7821fa101eab529521aa4b724bf708149d70820c + backport: 21be2282360c7df8b2535f9c2883674234dc7de2 +d9c01877d4ba1e39bbdc43faeeceeef2768be8e7: + title: 'hwmon: (adt7475) Fix default duty on fan is disabled' + mainline: 39b24cced70fdc336dbc0070f8b3bde61d8513a8 + backport: 1dd63dd3a8a7617a90bc1a9068fedb6adf5f5aac +383729f057245972e13fb0708c5ec7dd985fc50d: + title: 'pwm: stm32: Always do lazy disabling' + mainline: 7346e7a058a2c9aa9ff1cc699c7bf18a402d9f84 + backport: 25d404099dccdfe51abb9f810a864ced8b9d912b +21998f2c68edd4a7922875f34b39ce2bb78fabc0: + title: 'hwmon: (max6697) Fix underflow when writing limit attributes' + mainline: cbf7467828cd4ec7ceac7a8b5b5ddb2f69f07b0e + backport: 42cc04b6ae182a372082afc1c28d67f92fed5c29 +eb04482acd9870b84970fe1549203fedc1bbcc79: + title: 'hwmon: Introduce SENSOR_DEVICE_ATTR_{RO, RW, WO} and variants' + mainline: a5c47c0d388b939dd578fd466aa804b7f2445390 + backport: 625dffc4eaba4191520fb296a0e55743836bab4b +7a72d79eef89ce242e08edb18f64106374117295: + title: 'hwmon: (max6697) Auto-convert to use SENSOR_DEVICE_ATTR_{RO, RW, WO}' + mainline: 740c2f2b86a71ad673f329241ac25cfe647aacd4 + backport: 64785dce17bc282c55ed7f21c3fbc4391cdb1ab0 +6b52603ed8bdcceb9b8c16d2db7abd19e024fbe2: + title: 'hwmon: (max6697) Fix swapped temp{1,8} critical alarms' + mainline: 1ea3fd1eb9869fcdcbc9c68f9728bfc47b9503f1 + backport: cb9e33d36836000d9a79d3b0121beee91c3323b9 +513fff3e8574d3c5b54ef71b6514cda12123879e: + title: 'arm64: dts: rockchip: Increase VOP clk rate on RK3328' + mainline: 0f2ddb128fa20f8441d903285632f2c69e90fae1 + backport: c731a44f2487b720039473b6255fba3ad26d7753 +b6c2b179b6908e439b2385c25d7b3477e4be4dce: + title: 'm68k: atari: Fix TT bootup freeze / unexpected (SCU) interrupt messages' + mainline: f70065a9fd988983b2c693631b801f25a615fc04 + backport: 266d74e904f119b2251094862e9f7d56c3fb74fe +cb9ad82cf270ce5bdcf5e768af48966833cc3caa: + title: 'x86/xen: Convert comma to semicolon' + mainline: 349d271416c61f82b853336509b1d0dc04c1fcbb + backport: 0d26a6a5f0bb7e82bfebf44b060294eec5a72b73 +8c43fbd39500ce7bdc779a772752cc2b436a692c: + title: 'm68k: cmpxchg: Fix return value for default case in __arch_xchg()' + mainline: 21b9e722ad28c19c2bc83f18f540b3dbd89bf762 + backport: 8bc40077dd7c321cc45107a639c176d317892413 +f33757e8db8f33aba783b88120245ec53e5fa88a: + title: 'wifi: brcmsmac: LCN PHY code is used for BCM4313 2G-only device' + mainline: c636fa85feb450ca414a10010ed05361a73c93a6 + backport: 5fa524af8685b00160e9e766bbe196804a007844 +7fbbfd88613287ec01a54215b09aad3b05e4c070: + title: 'net/smc: Allow SMC-D 1MB DMB allocations' + mainline: 67161779a9ea926fccee8de047ae66cbd3482b91 + skipped: commit did not cherry-pick cleanly +248ded655e0b64e2a4c2f1ef6d052954ed88ed05: + title: 'net/smc: set rmb''s SG_MAX_SINGLE_ALLOC limitation only when CONFIG_ARCH_NO_SG_CHAIN is defined' + mainline: 3ac14b9dfbd345e891d48d89f6c2fa519848f0f4 + skipped: commit did not cherry-pick cleanly +d92eac4db41d059554efdf3ba7415a196bc7b437: + title: 'selftests/bpf: Check length of recv in test_sockmap' + mainline: de1b5ea789dc28066cc8dc634b6825bd6148f38b + skipped: fixes patch not in branch +0166ece82068d6fa9739a677ac3884941fc35153: + title: 'wifi: cfg80211: fix typo in cfg80211_calculate_bitrate_he()' + mainline: 9ee0d44f055276fe2802b2f65058e920853f4f99 + skipped: fixes patch not in branch +45d20a1c54be4f3173862c7b950d4468447814c9: + title: 'wifi: cfg80211: handle 2x996 RU allocation in cfg80211_calculate_bitrate_he()' + mainline: bcbd771cd5d68c0c52567556097d75f9fc4e7cd6 + skipped: fixes patch not in branch +b072c604d58b1cd1079c4e2f0d22b1f469dda347: + title: 'net: fec: Refactor: #define magic constants' + mainline: ff049886671ccd4e624a30ec464cb20e4c39a313 + backport: 1a85ab4b601786019135c37ec3f11927ba4a561d +18074367ad100e129d0dccdaa64af6642363680b: + title: 'net: fec: Fix FEC_ECR_EN1588 being cleared on link-down' + mainline: c32fe1986f27cac329767d3497986e306cad1d5e + backport: c3996b8fae20c268b6c49e70ea078bceb96d0c27 +9340804ea465de0509a9afaeaaccf3fb74b14f9b: + title: 'ipvs: Avoid unnecessary calls to skb_is_gso_sctp' + mainline: 53796b03295cf7ab1fc8600016fa6dfbf4a494a0 + backport: 2a3559125bd5fc024c30b1655b626abc0c2fa3eb +542abbf58e88f34dfc659b63476a5976acf52c0e: + title: 'perf: Fix perf_aux_size() for greater-than 32-bit size' + mainline: 3df94a5b1078dfe2b0c03f027d018800faf44c82 + backport: 6f7bc617b3b66436641dba5329718933aea4b889 +d7b1a76f33e6fc93924725b4410126740c890c44: + title: 'perf: Prevent passing zero nr_pages to rb_alloc_aux()' + mainline: dbc48c8f41c208082cfa95e973560134489e3309 + backport: 26864f03cc21aaa1b9f2dbed5c8ad7bf676f2df4 +f121740f69eda4da2de9a20a6687a13593e72540: + title: 'bna: adjust ''name'' buf size of bna_tcb and bna_ccb structures' + mainline: c9741a03dc8e491e57b95fba0058ab46b7e506da + backport: be35c98c5aa383407f62428c4169a79d5c243c26 +e061713d466b9be56b66dd6fb50538ad2c5564ac: + title: 'selftests: forwarding: devlink_lib: Wait for udev events after reloading' + mainline: f67a90a0c8f5b3d0acc18f10650d90fec44775f9 + skipped: fixes patch not in branch +01b44d9e50a68ac3c645cc98a474455668dc8e70: + title: 'media: imon: Fix race getting ictx->lock' + mainline: 24147897507cd3a7d63745d1518a638bf4132238 + backport: ce58b8f17bfc9cfad7fafb57ebb626850d4802ba +001583ad640c70987efd5af70566a69f146dc99c: + title: 'saa7134: Unchecked i2c_transfer function result fixed' + mainline: 9d8683b3fd93f0e378f24dc3d9604e5d7d3e0a17 + backport: e0b07e242c61e819acf0143bb2c23d4859b135db +1e4347cf14496f33bd26f0401404fd6de51e4fc4: + title: 'media: uvcvideo: Allow entity-defined get_info and get_cur' + mainline: 65900c581d014499f0f8ceabfc02c652e9a88771 + skipped: commit did not cherry-pick cleanly +b8e307747242d3e692c6ad98ff30d315683f2a00: + title: 'media: uvcvideo: Override default flags' + mainline: 86419686e66da5b90a07fb8a40ab138fe97189b5 + skipped: fixes patch not in branch +ab1325f1074da2cfa1259417fb6c93a0886e74c8: + title: 'media: renesas: vsp1: Fix _irqsave and _irq mix' + mainline: 57edbbcf5258c378a9b9d0c80d33b03a010b22c8 + backport: f0a224ecf4ca80033edee705bd34405dae4ea20a +ae16866626ecae26a7317e0372224d5480211ff7: + title: 'media: renesas: vsp1: Store RPF partition configuration per RPF instance' + mainline: a213bc09b1025c771ee722ee341af1d84375db8a + backport: 49db8c90eba2da9ddc6f9a203a6d20984d1658a7 +c3b7a650c8717aa89df318364609c86cbc040156: + title: 'leds: trigger: Unregister sysfs attributes before calling deactivate()' + mainline: c0dc9adf9474ecb7106e60e5472577375aedaed3 + skipped: fixes patch not in branch +2e6abffcb52a36c89c0a70499b86e0a99df15d1e: + title: 'perf report: Fix condition in sort__sym_cmp()' + mainline: cb39d05e67dc24985ff9f5150e71040fa4d60ab8 + backport: 39632d1c383813e9ddb20088f6e9a3b44ee70569 +c7c74c8256206ffc27212ada1f998f5a05b8c54f: + title: 'drm/etnaviv: fix DMA direction handling for cached RW buffers' + mainline: 58979ad6330a70450ed78837be3095107d022ea9 + backport: fa7e07d7ebb21ec8b937faeb3254a608c4d2eea2 +4be759d6d5da05b76a19785defe0f312926dcb5b: + title: 'mfd: omap-usb-tll: Use struct_size to allocate tll' + mainline: 40176714c818b0b6a2ca8213cdb7654fbd49b742 + skipped: fixes patch not in branch +282e8d4e9d33182a5ca25fe6333beafdc5282946: + title: 'ext4: avoid writing unitialized memory to disk in EA inodes' + mainline: 65121eff3e4c8c90f8126debf3c369228691c591 + backport: 5e8bf661518b825696c6ee219e62292e6bc8df93 +6b4f676006a390edffd6a00f2ebc23276dd05031: + title: 'sparc64: Fix incorrect function signature and add prototype for prom_cif_init' + mainline: a6c3ea1ec96307dbfbb2f16d96c674c5cc80f445 + backport: 0549d286c615b284448fa4d449c322f3ae2aa55f +0012438a122c56d727712169df42fd0e297a42b0: + title: 'PCI: Equalize hotplug memory and io for occupied and empty slots' + mainline: de3ffa301142bf8802a7b0de17f9985acde5c223 + backport: 02a0104454d95405c65536870fdc426e8663512d +2044071c6e42d041e3656bad105be5879f6b70f1: + title: 'PCI: Fix resource double counting on remove & rescan' + mainline: 903534fa7d30214d8ba840ab1cd9e917e0c88e41 + backport: 0a5d6964e9374945dfef1227972e8cc1a2a6d5ef +c4eaaf28068a99d8363bf02a20a32bf207be13e1: + title: 'RDMA/mlx4: Fix truncated output warning in mad.c' + mainline: 0d2e6992fc956e3308cd5376c18567def4cb3967 + backport: 8e50a9f8175582f34a709024496217f3fca864e5 +087abc7e244700f741c0431af59b28e910a82dc1: + title: 'RDMA/mlx4: Fix truncated output warning in alias_GUID.c' + mainline: 5953e0647cec703ef436ead37fed48943507b433 + backport: e9d4656f8f0c014de2ffcf8d4903c4630c43c72b +796c0f32fc956b88c345195472e2d74823be0d03: + title: 'RDMA/rxe: Don''t set BTH_ACK_MASK for UC or UD QPs' + mainline: 4adcaf969d77d3d3aa3871bbadc196258a38aec6 + backport: 117e5c14bbbb75364fabcb7d2e70e19167efc931 +17b016971c27ee1e884da3ce502801cb95f84ff1: + title: 'mtd: make mtd_test.c a separate module' + mainline: a5cf054d325e6f362e82fe6d124a1871a4af8174 + backport: 550d6bbd2dedbc88697932ddbe5f930b20a4d7c1 +2ee59e846895b6b061defbc6cde83126f91b7abd: + title: 'Input: elan_i2c - do not leave interrupt disabled on suspend failure' + mainline: 5f82c1e04721e7cd98e604eb4e58f0724d8e5a65 + backport: e547f41337badd93753b4fe3ae3817ed8400abd6 +12bc3aca7d100a8f749c2a6fcdb6be08ad41c105: + title: 'MIPS: Octeron: remove source file executable bit' + mainline: 89c7f5078935872cf47a713a645affb5037be694 + backport: fd5b433d1390c5586bc367f3e10fbb226ad9e2ac +5b84d47a0baee13434fadb3b9506c39f51f9ab98: + title: 'powerpc/xmon: Fix disassembly CPU feature checks' + mainline: 14196e47c5ffe32af7ed5a51c9e421c5ea5bccce + backport: 971a6101e844da8bcbdd4bd046a826c6cc44d861 +eeb9a0f79d8e4ea27b4f85a73f3765dc0046ab01: + title: 'macintosh/therm_windtunnel: fix module unload.' + mainline: fd748e177194ebcbbaf98df75152a30e08230cc6 + backport: 20b6b7a306d9487bb507af81df8e926b8141d902 +dfb40b2535b298b34b37780fe8eced6d38e28c5c: + title: 'bnxt_re: Fix imm_data endianness' + mainline: 95b087f87b780daafad1dbb2c84e81b729d5d33f + backport: 4f51eb5763820de8cf9bc32b26b20d19f7ccfc5d +576862647ae00d67b09961f84629aea09736c047: + title: 'ice: Rework flex descriptor programming' + mainline: 22ef683b48182f4d6125a2fb2725eb8a141514ff + skipped: code does not exist in 4.14 +66e7650dbbb8e236e781c670b167edc81e771450: + title: 'netfilter: ctnetlink: use helper function to calculate expect ID' + mainline: 782161895eb4ac45cf7cfa8db375bd4766cb8299 + backport: ccfb620ebf3085fca54472461544c796cbd7db5d +636f8fe03a14b0994a3dbdc05c8fa8c8296c1357: + title: 'pinctrl: core: fix possible memory leak when pinctrl_enable() fails' + mainline: ae1cf4759972c5fe665ee4c5e0c29de66fe3cf4a + backport: ee8bf45248bc530e2dc9a0a7f833febbe89fd2e1 +9dad82c7c7424c240db65f10ad999266f2967479: + title: 'pinctrl: single: fix possible memory leak when pinctrl_enable() fails' + mainline: 8f773bfbdd428819328a2d185976cfc6ae811cd3 + backport: fbd206c9e544f6e8fbb844534d05817ab6ed637a +268b3ff414ae8942af9d6c981b5df8667c2b76b6: + title: 'pinctrl: ti: ti-iodelay: Drop if block with always false condition' + mainline: 88b3f108502bc45e6ebd005702add46759f3f45a + backport: 9521c0b13c94c6ad389f9a5d7f8213891d8924a7 +7d720f351714dcbeb578af67bb7e66326504826c: + title: 'pinctrl: ti: ti-iodelay: fix possible memory leak when pinctrl_enable() fails' + mainline: 9b401f4a7170125365160c9af267a41ff6b39001 + backport: 78e3f7ec45416b8b0a25ef8fcbf85b653f49d5bb +c90d81a6e1f3daab4c06f7f8aba346abc76ae07a: + title: 'pinctrl: freescale: mxs: Fix refcount of child' + mainline: 7f500f2011c0bbb6e1cacab74b4c99222e60248e + backport: 251acaffa0bd813f67f7a92082bdbd101c395f4d +175ac70d8af52bc0f5b100901702fdb2bc662885: + title: 'fs/nilfs2: remove some unused macros to tame gcc' + mainline: e7920b3e9d9f5470d5ff7d883e72a47addc0a137 + backport: 2891e08c6f20e3c7b4b09dac8e949a195b46ff8c +d2b9bc7dfd6b0fa1a37eb91e68bca3175cb5ef50: + title: 'nilfs2: avoid undefined behavior in nilfs_cnt32_ge macro' + mainline: 0f3819e8c483771a59cf9d3190cd68a7a990083c + backport: 440e5d6b0d782ee0786d780761f57a117c904288 +dfe19aa91378972f10530635ad83b2d77f481044: + title: 'tick/broadcast: Make takeover of broadcast hrtimer reliable' + mainline: f7d43dd206e7e18c182f200e67a8db8c209907fa + backport: 3065612975c688a1ea3f759a23856a4b9eefdc12 +608a07143563a2a0d1edd57b2f4e95b0199fb497: + title: 'net: netconsole: Disable target before netpoll cleanup' + mainline: 97d9fba9a812cada5484667a46e14a4c976ca330 + backport: d5744057122276d5d9c9b33a8e567e963897d502 +3dfd84aa72fa7329ed4a257c8f40e0c9aff4dc8f: + title: 'af_packet: Handle outgoing VLAN packets without hardware offloading' + mainline: 79eecf631c14e7f4057186570ac20e2cfac3802e + backport: 6d8fa691e6733006d5c061a297fe601d126d748b +b4f67f09287392e0a2f7422199a193e37f2737af: + title: 'ipv6: take care of scope when choosing the src addr' + mainline: abb9a68d2c64dd9b128ae1f2e635e4d805e7ce64 + backport: f58439a91781f888dce8463243b4d83be380d21c +a97e1082454f45513bc5f7ee0d9cc4e9a6869a81: + title: 'char: tpm: Fix possible memory leak in tpm_bios_measurements_open()' + mainline: 5d8e2971e817bb64225fc0b6327a78752f58a9aa + skipped: fixes patch not in branch +ad8cf035baf29467158e0550c7a42b7bb43d1db6: + title: 'media: venus: fix use after free in vdec_close' + mainline: a0157b5aa34eb43ec4c5510f9c260bbb03be937e + backport: 058c66e9aa0cd80581ff06b9294521e05ea1d0dd +f7316b2b2f11cf0c6de917beee8d3de728be24db: + title: 'hfs: fix to initialize fields of hfs_inode_info after hfs_alloc_inode()' + mainline: 26a2ed107929a855155429b11e1293b83e6b2a8b + backport: 26722f11717342d8f7deeb0c23fa6814bc31a48c +f392c36cebf4c1d6997a4cc2c0f205254acef42a: + title: 'drm/gma500: fix null pointer dereference in cdv_intel_lvds_get_modes' + mainline: cb520c3f366c77e8d69e4e2e2781a8ce48d98e79 + backport: d92238c8b1116bff1babca839d923d345128c202 +13b5f3ee94bdbdc4b5f40582aab62977905aedee: + title: 'drm/gma500: fix null pointer dereference in psb_intel_lvds_get_modes' + mainline: 2df7aac81070987b0f052985856aa325a38debf6 + backport: 2c7d6f35aea17924ebb60002a151c8e4909cb226 +296185ef87e6184e364bd9e7c983089b8e606a55: + title: 'm68k: amiga: Turn off Warp1260 interrupts during boot' + mainline: 1d8491d3e726984343dd8c3cdbe2f2b47cfdd928 + backport: 1ac49c559cf87bd78734f326ef6db4c2d876d804 +b80575ffa98b5bb3a5d4d392bfe4c2e03e9557db: + title: 'ext4: check dot and dotdot of dx_root before making dir indexed' + mainline: 50ea741def587a64e08879ce6c6a30131f7111e7 + backport: 4ed99f550b6316ae9cfa1ffdb6c4f053631117e6 +d81d7e347d1f1f48a5634607d39eb90c161c8afe: + title: 'ext4: make sure the first directory block is not a hole' + mainline: f9ca51596bbfd0f9c386dd1c613c394c78d9e5e6 + backport: 839f30000100e2b3fb252f1755c4434cad12da0c +98cf9959a20dc374b7bba4b9357203e54484be58: + title: 'wifi: mwifiex: Fix interface type change' + mainline: a17b9f590f6ec2b9f1b12b1db3bf1d181de6b272 + backport: b9bb3e4e90d4b44dc0667e7e5e24a8c4cd9eb9f5 +db1871789f3018c5b0788318d3b1c685f2decceb: + title: 'leds: ss4200: Convert PCIBIOS_* return codes to errnos' + mainline: ce068e83976140badb19c7f1307926b4b562fac4 + backport: 4e71b875b885df71c21f8f1fa380064b59fdd414 +2e070bec9580702206281fc06178dea4836f2e1f: + title: 'tools/memory-model: Fix bug in lock.cat' + mainline: 4c830eef806679dc243e191f962c488dd9d00708 + skipped: fixes patch not in branch +d48e11483e3eb8ade86c57f4145644725cd33eed: + title: 'hwrng: amd - Convert PCIBIOS_* return codes to errnos' + mainline: 14cba6ace79627a57fb9058582b03f0ed3832390 + backport: 63576e19060aa3b515c02583870bde5d75260ed8 +e9cafb31aa498558d6ff7b28baed894db7d801f3: + title: 'PCI: hv: Return zero, not garbage, when reading PCI_INTERRUPT_PIN' + mainline: fea93a3e5d5e6a09eb153866d2ce60ea3287a70d + backport: 31754844f0fd1fbfd0a6fd857ec7021240b6d3a3 +229670361c29381b0e1677763590e4dbc209ecbe: + title: 'binder: fix hang of unregistered readers' + mainline: 31643d84b8c3d9c846aa0e20bc033e46c68c7e7d + backport: 080400d0031e6b30ae84fa1722d55cb6a3376f8c +5c9d1ac649469feaab4240c0c1b5920ea8649b50: + title: 'scsi: qla2xxx: Return ENOBUFS if sg_cnt is more than one for ELS cmds' + mainline: ce2065c4cc4f05635413f63f6dc038d7d4842e31 + backport: 0900cd07eb9119e80a55a97784e8cc1ca6390402 +2d2916516577f2239b3377d9e8d12da5e6ccdfcf: + title: 'f2fs: fix to don''t dirty inode for readonly filesystem' + mainline: 192b8fb8d1c8ca3c87366ebbef599fa80bb626b8 + backport: 27f9505abcdef5527ce43c5c21ecf89bc76f2278 +2f35342e709ccf655c4927aa97cf16944cfe7344: + title: 'clk: davinci: da8xx-cfgchip: Initialize clk_init_data before use' + mainline: a83b22754e351f13fb46596c85f667dc33da71ec + skipped: fixes patch not in branch +29f2c831822fde87b78c73e5db6ecfb106473cff: + title: 'ubi: eba: properly rollback inside self_check_eba' + mainline: 745d9f4a31defec731119ee8aad8ba9f2536dd9a + backport: e38af31723db1861d58b71410895872b72abc272 +16b92b031b4da174342bd909130731c55f20c7ea: + title: 'decompress_bunzip2: fix rare decompression failure' + mainline: bf6acd5d16057d7accbbb1bf7dc6d8c56eeb4ecc + backport: a01900bb7d4f831a50f19c58b1b9e3c9aa9dd9d9 +81a15d28f32af01493ae8c5457e0d55314a4167d: + title: 'kobject_uevent: Fix OOB access within zap_modalias_env()' + mainline: dd6e9894b451e7c85cceb8e9dc5432679a70e7dc + skipped: fixes patch not in branch +e08ec1587f576e55b855449d793eb2a3add54c44: + title: 'rtc: cmos: Fix return value of nvmem callbacks' + mainline: 1c184baccf0d5e2ef4cc1562261d0e48508a1c2b + skipped: fixes patch not in branch +086489256696eb774654a5410e86381c346356fe: + title: 'scsi: qla2xxx: During vport delete send async logout explicitly' + mainline: 76f480d7c717368f29a3870f7d64471ce0ff8fb2 + backport: 930865dbd92b29bc57364695d561c289d693f72d +549aac9655320c9b245a24271b204668c5d40430: + title: 'scsi: qla2xxx: validate nvme_local_port correctly' + mainline: eb1d4ce2609584eeb7694866f34d4b213caa3af9 + skipped: fixes code not in 4.14.y +b4030b619066aa1c20e075ce9382f103e0168145: + title: 'perf/x86/intel/pt: Fix topa_entry base length' + mainline: 5638bd722a44bbe97c1a7b3fae5b9efddb3e70ff + backport: b212bfa809f6d1235bbbb6c491621ce314b073a6 +6d94ca5d571dfdb34f12dc3f63273ea275e8f40c: + title: 'watchdog/perf: properly initialize the turbo mode timestamp and rearm counter' + mainline: f944ffcbc2e1c759764850261670586ddf3bdabb + backport: dbffea43e8b704e5cb23e776be21c12a3e0f0b65 +0818a768c96a10343d08a622906adab54da6e014: + title: 'platform: mips: cpu_hwmon: Disable driver on unsupported hardware' + mainline: f4d430db17b4ef4e9c3c352a04b2fe3c93011978 + backport: 8e28810fed0aaf5624155ae6974d1cc95623edf2 +d91d253c87fd1efece521ff2612078a35af673c6: + title: 'RDMA/iwcm: Fix a use-after-free related to destroying CM IDs' + mainline: aee2424246f9f1dadc33faa78990c1e2eb7826e4 + backport: b4099074459a9baa637aba3a5fa6d814f32e5eb2 +8010e0748cca059187021d194bb6d883d159e172: + title: 'selftests/sigaltstack: Fix ppc64 GCC build' + mainline: 17c743b9da9e0d073ff19fd5313f521744514939 + backport: 0a35556f0aa6435749d819919639e400943a3430 +19cce46238ffe3546e44b9c74057103ff8b24c62: + title: 'nilfs2: handle inconsistent state in nilfs_btnode_create_block()' + mainline: 4811f7af6090e8f5a398fbdd766f903ef6c0d787 + backport: 0e318baa084d870466c8cefaab8d2689e56d21e7 +b15593e2904d2ff0094b7170f806dba0eeefac75: + title: 'kdb: Fix bound check compiler warning' + mainline: ca976bfb3154c7bc67c4651ecd144fdf67ccaee7 + backport: 2527458f09eb86ba89b673081c8a408c8a3f7591 +22a100556ceab8b906ad180788bd6bdc07390f50: + title: 'kdb: address -Wformat-security warnings' + mainline: 70867efacf4370b6c7cdfc7a5b11300e9ef7de64 + backport: fbcf6bbfac542e249d92ce80277a03dde0699305 +90f2409c1d552f27a2b2bf8dc598d147c4173128: + title: 'kdb: Use the passed prompt in kdb_position_cursor()' + mainline: e2e821095949cde46256034975a90f88626a2a73 + backport: 4925aa995a5cf9f49c04fdd1257b1d8f341dd4f5 +55b732c8b09b41148eaab2fa8e31b0af47671e00: + title: 'jfs: Fix array-index-out-of-bounds in diFree' + mainline: f73f969b2eb39ad8056f6c7f3a295fa2f85e313a + backport: 4c2dc9502e8728f3a9ba9029aeaa08fc01e420d1 +fe2d246080f035e0af5793cb79067ba125e4fb63: + title: 'dma: fix call order in dmam_free_coherent' + mainline: 28e8b7406d3a1f5329a03aa25a43aa28e087cb20 + backport: 5a9dbd8f70793aba9e12d6d5216ce45cd9597a78 +3213ac4e85945c54350ac06c09902d1c82211100: + title: 'MIPS: SMP-CPS: Fix address for GCR_ACCESS register for CM3 and later' + mainline: a263e5f309f32301e1f3ad113293f4e68a82a646 + backport: 1184f039bc84987937ac8144df7a5daaffb0795c +0e8712254b48a7c6ebb76dce414a9539e772d406: + title: 'net: ip_rt_get_source() - use new style struct initializer instead of memset' + mainline: e351bb6227fbe2bb5da6f38a4cf5bd18810b0557 + backport: 5b3e5dc382a0cab89cea2c533a0e5b65ae4d686e +5c65e55e41e1300c4ebf4dda22a704b2beed2423: + title: 'ipv4: Fix incorrect source address in Record Route option' + mainline: cc73bbab4b1fb8a4f53a24645871dafa5f81266a + backport: ef5a6f1d6d270c55e210ed3775352ff75e2aa48e +6c9261a2bdf614b376dbefa01e0c6bb32d14e019: + title: 'net: bonding: correctly annotate RCU in bond_should_notify_peers()' + mainline: 3ba359c0cd6eb5ea772125a7aededb4a2d516684 + backport: f204855673caa3a17b49c8b9642edcd269a4fac7 +7ec3335dd89c8d169e9650e4bac64fde71fdf15b: + title: 'tipc: Return non-zero value from tipc_udp_addr2str() on error' + mainline: fa96c6baef1b5385e2f0c0677b32b3839e716076 + backport: 1ae654c0cdf7bfcd142367568d3a1afbed7d54e8 +70db2c84631f50e02e6b32b543700699dd395803: + title: 'mISDN: Fix a use after free in hfcmulti_tx()' + mainline: 61ab751451f5ebd0b98e02276a44e23a10110402 + backport: 70609fe847bf6600554b6f511b10015f76834d58 +2b2d2b8766db028bd827af34075f221ae9e9efff: + title: 'mm: avoid overflows in dirty throttling logic' + mainline: 385d838df280eba6c8680f9777bfa0d0bfe7e8b2 + backport: 1967ea8b282b3b05c9da41c1e2426c3bfb04bf54 +11f71f0c562dbfbc3f3e2c56053bca42f7e8d71c: + title: 'PCI: rockchip: Make ''ep-gpios'' DT property optional' + mainline: 58adbfb3ebec460e8b58875c682bafd866808e80 + backport: aff1d3ed73ce5882235d9f42c4510c642b9e1dac +8de378d17e5b737907c04acc2fab6d966a129f70: + title: 'PCI: rockchip: Use GPIOD_OUT_LOW flag while requesting ep_gpio' + mainline: 840b7a5edf88fe678c60dee88a135647c0ea4375 + backport: 5a659bbb75dd76c32388a8b4c8ea8dff2aa79c12 +f1af18ba5925abb275de8bf387fceb9fbf93a096: + title: 'parport: parport_pc: Mark expected switch fall-through' + mainline: aa1f0fa374ed23528b915a693a11b0f275a299c0 + backport: d34a87ca6e4c611b125d238c3a56b712a612acd6 +cb2a998b88d173ec23423fa13ae2da463449728a: + title: 'parport: Convert printk(KERN_ to pr_(' + mainline: decf26f6ec25dac868782dc1751623a87d147831 + backport: af0192bb58b539ec732125a76fe4d69660147cca +884ab25dbf115938facb91be85ffed9266e26f8b: + title: 'parport: Standardize use of printmode' + mainline: a6abfdff4fe5dd19d1f1b37d72ba34cd4492fd4d + backport: 4582fe6f2d5fddcf7a63b59b666e8837f2cecf9a +166a0bddcc27de41fe13f861c8348e8e53e988c8: + title: 'dev/parport: fix the array out-of-bounds risk' + mainline: ab11dac93d2d568d151b1918d7b84c2d02bacbd5 + backport: 598e7acd167941653c0a54d5732bad40db488504 +b9c258b2a02ba8d6d004f45a1eafa23fd810746b: + title: 'driver core: Cast to (void *) with __force for __percpu pointer' + mainline: d7aa44f5a1f86cb40659eef06035d8d92604b9d5 + backport: bdec7b3d4ccbcbd78fd4b6a2c6fe7a849754af52 +700e8abd65b10792b2f179ce4e858f2ca2880f85: + title: 'devres: Fix memory leakage caused by driver API devm_free_percpu()' + mainline: bd50a974097bb82d52a458bd3ee39fb723129a0c + backport: 9b6f7f34aae733309a35d9990d4a0cdf2d2eea3b +bea2d4588e90f56da62b0dd9099484a42498b08a: + title: 'perf/x86/intel/pt: Export pt_cap_get()' + mainline: f6d079ce867d679e4dffef5b3112c7634215fd88 + backport: 9ce7856eccc159df29f62b1e5ff0c6239422bf63 +e3fb71f7ecbf87228148c3287eac965927ef49be: + title: 'perf/x86/intel/pt: Use helpers to obtain ToPA entry size' + mainline: fffec50f541ace292383c0cbe9a2a97d16d201c6 + backport: 2de7be6b1893e070e92da91bbaa35ce22950b189 +67968b8c7603007751f140f3f9f8aa8e64fc26b2: + title: 'perf/x86/intel/pt: Use pointer arithmetics instead in ToPA entry calculation' + mainline: 539f7c26b41d4ed7d88dd9756de3966ae7ca07b4 + backport: ab03429ae696126f00509dac54b632bfb2282240 +e9d9ec1019a90aafdb54765a3b46f36f402b481a: + title: 'perf/x86/intel/pt: Split ToPA metadata and page layout' + mainline: 38bb8d77d0b932a0773b5de2ef42479409314f96 + backport: a87ac310cc99adff1aa8315d829ce984dfc0cda6 +418f7db13405953c2d9223275d365d9828169076: + title: 'perf/x86/intel/pt: Fix a topa_entry base address calculation' + mainline: ad97196379d0b8cb24ef3d5006978a6554e6467f + backport: d6c356954a61ce5a5f851b9aa858f9d906e4228d +35df377f38fb516111933f132b51a386b4d4892f: + title: 'remoteproc: imx_rproc: ignore mapping vdev regions' + mainline: 8f2d8961640f0346cbe892273c3260a0d30c1931 + backport: 5d99fd6160cb1a1ecd0163220164b8d1fe2cecf6 +a80423f6566bc5085d6bbdd2acdb80aa20c0e915: + title: 'remoteproc: imx_rproc: Fix ignoring mapping vdev regions' + mainline: afe670e23af91d8a74a8d7049f6e0984bbf6ea11 + backport: c1239a005bbf4c6b43aec1155ac3d8466b640051 +6884fd0283e0831be153fb8d82d9eda8a55acaaa: + title: 'remoteproc: imx_rproc: Skip over memory region when node value is NULL' + mainline: 2fa26ca8b786888673689ccc9da6094150939982 + backport: 3e1715ba7291483690f92608e08aba0d12c5ef70 +6f4bc8b021d3436e5dda88350d8e0ac3c8df400f: + title: 'drm/vmwgfx: Fix overlay when using Screen Targets' + mainline: cb372a505a994cb39aa75acfb8b3bcf94787cf94 + backport: 4aff76137ef2fa40ec1f424eb8e743673ffe5434 +84f40b46787ecb67c7ad08a5bb1376141fa10c01: + title: 'net/iucv: fix use after free in iucv_sock_close()' + mainline: f558120cd709682b739207b48cf7479fd9568431 + backport: 582d87d965d3600b178bbaf8947523e5478da1d1 +97a4f78feadc431a050cc26355f95ac3d73a4d4c: + title: 'ipv6: fix ndisc_is_useropt() handling for PIO' + mainline: a46c68debf3be3a477a69ccbf0a1d050df841676 + backport: c04add3c9adf1402f47ff8f51dd2ee533e863a00 +ed42e8ff509d2a61c6642d1825032072dab79f26: + title: protect the fetch of ->fd[fd] in do_dup2() from mispredictions + mainline: 8aa37bde1a7b645816cda8b80df4753ecf172bf1 + backport: f4c005cc381764f082f66825073bb6c43f54fe14 +f4eb853103674698416ba66d41317b1d869d4bdc: + title: 'ALSA: usb-audio: Correct surround channels in UAC1 channel map' + mainline: b7b7e1ab7619deb3b299b5e5c619c3e6f183a12d + backport: 71a0712ba842211e6dc1a4f7e91dd6c7502eebe5 +9f04dbd139aa1988fc8b7984ffbce7849be73f21: + title: 'net: usb: sr9700: fix uninitialized variable use in sr_mdio_read' + mainline: 08f3a5c38087d1569e982a121aad1e6acbf145ce + backport: 3f465b02b4b919181c45ef14fe5ca3638b87ac5c +2f61f0c6b7411212acd6490c5629b0049e8eaefa: + title: 'irqchip/mbigen: Fix mbigen node address layout' + mainline: 6be6cba9c4371d27f78d900ccfe34bb880d9ee20 + backport: 6f4e6f1f7e5d27fa977d9900aba67c9cc3c15d4e +18da1b27ce16a14a9b636af9232acb4fb24f4c9e: + title: 'x86/mm: Fix pti_clone_pgtable() alignment assumption' + mainline: 41e71dbb0e0a0fe214545fe64af031303a08524c + skipped: fixes patch not in branch +3c90a69533b5bba73401ef884d033ea49ee99662: + title: 'net: usb: qmi_wwan: fix memory leak for not ip packets' + mainline: 7ab107544b777c3bd7feb9fe447367d8edd5b202 + backport: 193653bb5bb78ddaa2698760912db0248833cccc +3840189e4619af11f558e6faff80813f008246a6: + title: 'net: linkwatch: use system_unbound_wq' + mainline: 3e7917c0cdad835a5121520fc5686d954b7a61ab + backport: 928a0513e3f0353f456c9734695c47a94f423c54 +64f4938368f4be563b7652d6b18d37b317913b47: + title: 'Bluetooth: l2cap: always unlock channel in l2cap_conless_channel()' + mainline: c531e63871c0b50c8c4e62c048535a08886fba3e + backport: 0c7df8f6eff3aa1044d3f97dd249112dc4301778 +7762f5317db83b70099ed1b2c100df54abddaec1: + title: 'net: fec: Stop PPS on driver remove' + mainline: 8fee6d5ad5fa18c270eedb2a2cdf58dbadefb94b + backport: 20cb64898909ba7ccad47d1e52e980ba859c29c0 +2c92f8c1c456d556f15cbf51667b385026b2e6a0: + title: 'md/raid5: avoid BUG_ON() while continue reshape after reassembling' + mainline: 305a5170dc5cf3d395bb4c4e9239bca6d0b54b49 + backport: a10b1779aca24535b14edba941cb59fbd35ce7c9 +026befb502ce41384e5119df12c9f2d4067cb23c: + title: 'clocksource/drivers/sh_cmt: Address race condition for clock events' + mainline: db19d3aa77612983a02bd223b3f273f896b243cf + backport: f9ec6971715991696e49430547551697f1153be6 +a35a163cd56b583ef698eadef9b856b0fe6e2727: + title: 'PCI: Add Edimax Vendor ID to pci_ids.h' + mainline: eee5528890d54b22b46f833002355a5ee94c3bb4 + backport: ca0a3431163788b838bdccff1eac2b84a30bee91 +097420e48e30f51e8f4f650b5c946f5af63ec1a3: + title: 'udf: prevent integer overflow in udf_bitmap_free_blocks()' + mainline: 56e69e59751d20993f243fb7dd6991c4e522424c + backport: 12ce9c96b15650623040f0d999b91b5d12f9936f +f4d99b55dca90ca703bdd57ee8d557cd8d6c1639: + title: 'wifi: nl80211: don''t give key data to userspace' + mainline: a7e5793035792cc46a1a4b0a783655ffa897dfe9 + backport: a253db7576fd90aaa15b1dabec335f2f9df7c21e +fad0bb34cfcea693903409356693988f04715b8e: + title: 'btrfs: fix bitmap leak when loading free space cache on duplicate entry' + mainline: 320d8dc612660da84c3b70a28658bb38069e5a9a + backport: dd102bb94b5dba7e5376f09504503f3bc2cf16da +019f538f9fe0b48bb436135edba69aa3a5156cdb: + title: 'media: uvcvideo: Ignore empty TS packets' + mainline: 5cd7c25f6f0576073b3d03bc4cfb1e8ca63a1195 + backport: feddc92ee4859f5e6c5a69135f94547740b292a9 +eada6212c055089962ca3ee7b8ab11d8f4d0e4f5: + title: 'media: uvcvideo: Fix the bandwdith quirk on USB 3.x' + mainline: 9e3d55fbd160b3ca376599a68b4cddfdc67d4153 + backport: 00a39f4e0adbb1b194e0a1ba2219e26c57042dc7 +831db95409cc12589c14a71b9bf6c3e7f70bf5a0: + title: 'jbd2: avoid memleak in jbd2_journal_write_metadata_buffer' + mainline: cc102aa24638b90e04364d64e4f58a1fa91a1976 + backport: 82f1f40db08d606f0538e4a88e06a919b8656645 +7a7e60ed23d471a07dbbe72565d2992ee8244bbe: + title: 's390/sclp: Prevent release of buffer in I/O' + mainline: bf365071ea92b9579d5a272679b74052a5643e35 + skipped: fixes code not in 4.14.y +06d281f0ad7504e9f250c6a9ef78d9e48cea5717: + title: 'SUNRPC: Fix a race to wake a sync task' + mainline: ed0172af5d6fc07d1b40ca82f5ca3979300369f7 + backport: 6062fd1ee48c6cb081cbc525e31fd43fa9632dbc +585b8d86c39882425f737b800e7552fb42a4785f: + title: 'ext4: fix wrong unit use in ext4_mb_find_by_goal' + mainline: 99c515e3a860576ba90c11acbc1d6488dfca6463 + backport: fb37e57b6e2f8217b201737f10af809289674469 +ced08f48bdc3f7d4b13d9355283cfeee523220ce: + title: 'arm64: Add support for SB barrier and patch in over DSB; ISB sequences' + mainline: bd4fb6d270bc423a9a4098108784f7f9254c4e6d + skipped: new feature +6ad94963c7bf76085eaf852a104afa0a272a7c3c: + title: 'arm64: cpufeature: Force HWCAP to be based on the sysreg visible to user-space' + mainline: 237405ebef580a7352a52129b2465c117145eafa + skipped: new feature +ab807f3011075a045c2e6944a3c5fc22ed29532d: + title: 'arm64: Add Neoverse-V2 part' + mainline: f4d9d9dcc70b96b5e5d7801bd5fbf8491b07b13d + skipped: new feature +622c917154477948203f7f0871dbf528f48635cc: + title: 'arm64: cputype: Add Cortex-X4 definitions' + mainline: 02a0a04676fa7796d9cbc9eb5ca120aaa194d2dd + skipped: new feature +588fd573491287b3ebc84c51cfb6b357bdb9a002: + title: 'arm64: cputype: Add Neoverse-V3 definitions' + mainline: 0ce85db6c2141b7ffb95709d76fc55a27ff3cdc1 + skipped: new feature +213506584d4422288b73d1f99097a5fc39207b46: + title: 'arm64: errata: Add workaround for Arm errata 3194386 and 3312417' + mainline: 7187bb7d0b5c7dfa18ca82e9e5c75e13861b1d88 + skipped: new feature +a11ef811b9763002b41ad44185654f8e70da68d5: + title: 'arm64: cputype: Add Cortex-X3 definitions' + mainline: be5a6f238700f38b534456608588723fba96c5ab + skipped: new feature +b1759d12e00cbced653c450adc2bfa9c04ce3cc2: + title: 'arm64: cputype: Add Cortex-A720 definitions' + mainline: add332c40328cf06fe35e4b3cde8ec315c4629e5 + skipped: new feature +9c376afba7d9a787f8452052dc3af479253c5678: + title: 'arm64: cputype: Add Cortex-X925 definitions' + mainline: fd2ff5f0b320f418288e7a1f919f648fbc8a0dfc + skipped: new feature +023c0f2e7f168e0c9e6f04c126d404bef6ca3130: + title: 'arm64: errata: Unify speculative SSBS errata logic' + mainline: ec768766608092087dfb5c1fc45a16a6f524dee2 + skipped: new feature +873b451ffbd4a438d470ec1c95aba110610c09cd: + title: 'arm64: errata: Expand speculative SSBS workaround' + mainline: 75b3c43eab594bfbd8184ec8ee1a6b820950819a + skipped: new feature +e9a2bed4156d0504ad19cdf283194d63909b8d7c: + title: 'arm64: cputype: Add Cortex-X1C definitions' + mainline: 58d245e03c324d083a0ec3b9ab8ebd46ec9848d7 + skipped: new feature +6dbc0fbaa6f3db35c1ae78e381fa5f06327f0acf: + title: 'arm64: cputype: Add Cortex-A725 definitions' + mainline: 9ef54a384526911095db465e77acc1cb5266b32c + skipped: new feature +236f749edbd6c194f6dc8bd1393c8e56fd773f32: + title: 'arm64: errata: Expand speculative SSBS workaround (again)' + mainline: adeec61a4723fd3e39da68db4cc4d924e6d7f641 + skipped: new feature +6adca954fc039151ef4f9c1ea1f201e12a24593d: + title: 'i2c: smbus: Don''t filter out duplicate alerts' + mainline: dca0dd28fa5e0a1ec41a623dbaf667601fc62331 + backport: 7a346f1ce3ab37134f2365ab6a74422747285fdb +9540badee607a99cc07bddbd0a7d4a01fd3b9661: + title: 'i2c: smbus: Improve handling of stuck alerts' + mainline: 37c526f00bc1c4f847fc800085f8f009d2e11be6 + backport: c364d250ada36665ea06f204449d1162cb5e1432 +3b20631d0704fe4f6bf4cf9a49fd19871ebaeffb: + title: 'i2c: smbus: Send alert notifications to all devices if source not found' + mainline: f6c29f710c1ff2590109f83be3e212b86c01e0f3 + backport: a0bb631d7d0a1773ebbb427ac8564ae8818b4dfe +0b8cf71c2c1b9a6e8f7acd620d8e4b0c24a12920: + title: 'bpf: kprobe: remove unused declaring of bpf_kprobe_override' + mainline: 0e8b53979ac86eddb3fd76264025a70071a25574 + skipped: fixes patch not in branch +bebc69b574d6a3c54e8951dd891e78a20e2a3f54: + title: 'spi: lpspi: Replace all "master" with "controller"' + mainline: 07d71557494c05b0651def1651bf6d7e7f47bbbb + backport: 0ef61696a9fff3915fb5aa6f7bb9f89682d10ad9 +b1b5a04eadd9b786dcd4bc82e726498a8f6fd50a: + title: 'spi: lpspi: Add slave mode support' + mainline: bcd87317aae26b9ac497cbc1232783aaea1aeed4 + backport: 12bfab716ae4cd47449d7636a25326099daa10a9 +8f8b12339ef7cc8e15989f6445aad5a9bf8c00f5: + title: 'spi: lpspi: Let watermark change with send data length' + mainline: cf86874bb9bdb99ba3620428b59b0408fbc703d0 + backport: 6a6c19da1d3917fc8c51d2fd69b667a5e7b192ec +0b536d6c52a88b6a5a7f40d1ac91ffe170b8df87: + title: 'spi: lpspi: Add i.MX8 boards support for lpspi' + mainline: f5e5afdb0e56e81123e02b6a64dd32adc19a90d4 + backport: dc2d2de15c66a8e41275b4d59e6082955e477991 +3bb46e26783c3c86e67172f695908a066be69e12: + title: 'spi: lpspi: add the error info of transfer speed setting' + mainline: 77736a98b859e2c64aebbd0f90b2ce4b17682396 + backport: 030b58b3539d0fdccf6284113c29f60c76b60916 +da6cc32c245500f417e4b96d67722b8a0a07fd94: + title: 'spi: fsl-lpspi: remove unneeded array' + mainline: 2fa98705a9289c758b6154a22174aa8d4041a285 + backport: d859e0255cb169a2d7aa96b42defafd7c515df0c +81964823116357a636201afa4010fa30f050446e: + title: 'spi: spi-fsl-lpspi: Fix scldiv calculation' + mainline: 730bbfaf7d4890bd99e637db7767dc68cfeb24e7 + backport: dcde078eb1be234c810305963c845eaa63f20813 +643293b68fbb6c03f5e907736498da17d43f0d81: + title: 'ALSA: line6: Fix racy access to midibuf' + mainline: 15b7a03205b31bc5623378c190d22b7ff60026f1 + backport: 9ab8902f51b8ac3c51666922a9719c1e4d81f105 +5a3c473b28ae1c1f7c4dc129e30cb19ae6e96f89: + title: 'usb: vhci-hcd: Do not drop references before new references are gained' + mainline: afdcfd3d6fcdeca2735ca8d994c5f2d24a368f0a + backport: d41cf1c7bc4e9706d684d3fb2c24046f673ffb78 +1907ed1be026c771086e6adc560f38dc50e82382: + title: 'USB: serial: debug: do not echo input by default' + mainline: 00af4f3dda1461ec90d892edc10bec6d3c50c554 + backport: 95314b1272d1d96f5737c5b1e208fabd1128db3c +ba15815dd24cc5ec0d23e2170dc58c7db1e03b4a: + title: 'usb: gadget: core: Check for unset descriptor' + mainline: 973a57891608a98e894db2887f278777f564de18 + backport: 551fbbddb6f5ff52bdb1c0cdb3d096e359e088da +c4da5b5deb343346909920c41645ad85adff4c6c: + title: 'scsi: ufs: core: Fix hba->last_dme_cmd_tstamp timestamp updating logic' + mainline: ab9fd06cb8f0db0854291833fc40c789e43a361f + backport: b41af170f9ad55d4780688b92c032579655218fe +f54abf332a2bc0413cfa8bd6a8511f7aa99faea0: + title: 'tick/broadcast: Move per CPU pointer access into the atomic section' + mainline: 6881e75237a84093d0986f56223db3724619f26e + backport: 6fad54cc7a6c8c4750209bfcff1b54dd60b086db +9dfe2eef1ecfbb1f29e678700247de6010784eb9: + title: 'ntp: Clamp maxerror and esterror to operating range' + mainline: 87d571d6fb77ec342a985afa8744bb9bb75b3622 + backport: 07f7f40df90538c4bacb06d64ededc68b6d6e9bf +49ea4e0d862632d51667da5e7a9c88a560e9c5a1: + title: 'driver core: Fix uevent_show() vs driver detach race' + mainline: 15fffc6a5624b13b428bb1c6e9088e32a55eb82c + backport: c72f8e96b8386d50894df2faed9718d7cbfc312d +a13f8b269b6f4c9371ab149ecb65d2edb52e9669: + title: 'ntp: Safeguard against time_constant overflow' + mainline: 06c03c8edce333b9ad9c6b207d93d3a5ae7c10c0 + backport: 53390d85b1f4fca100eca68612fe9ae736ef5caf +3bbd90fca824e6fd61fb20f6dd2b0fa5f8b14bba: + title: 'serial: core: check uartclk for zero to avoid divide by zero' + mainline: 6eabce6608d6f3440f4c03aa3d3ef50a47a3d193 + backport: 1d33b86b2b99774eae26926b2f5f4900f826638f +f1aa9f19da35f72ce8ec3196f0a7bc06e296aaeb: + title: 'power: supply: axp288_charger: Fix constant_charge_voltage writes' + mainline: b34ce4a59cfe9cd0d6f870e6408e8ec88a964585 + backport: d9b1fa9a24e5ba3115a289421d535abf954efd7a +e3cb8400a72a9e5e25365d380b290cdd50ccdb5c: + title: 'power: supply: axp288_charger: Round constant_charge_voltage writes down' + mainline: 81af7f2342d162e24ac820c10e68684d9f927663 + backport: bd9bfbcc05c1c7af22dfa9ca8b2ff1d6395db661 +302ceb625d7b990db205a15e371f9a71238de91c: + title: 'tracing: Fix overflow in get_free_elt()' + mainline: bcf86c01ca4676316557dd482c8416ece8c2e143 + backport: b28271a4428daf3c20b71a8e7cf218a4c38c698b +34f36e6ee5bd7eff8b2adcd9fcaef369f752d82e: + title: 'x86/mtrr: Check if fixed MTRRs exist before saving them' + mainline: 919f18f961c03d6694aa726c514184f2311a4614 + backport: 4f0b886693fe2a82d8896cd431eb529777e1bbdc +52f05898629b25fc382754d837be624205ce67f8: + title: 'drm/bridge: analogix_dp: properly handle zero sized AUX transactions' + mainline: e82290a2e0e8ec5e836ecad1ca025021b3855c2d + backport: 5dfe0cc24eab4d1e640e3cfc7ef155216fb29f2a +7db72e8e538e10afefe589d6203ffb4f5a1cbd9a: + title: 'drm/mgag200: Set DDC timeout in milliseconds' + mainline: ecde5db1598aecab54cc392282c15114f526f05f + backport: e391c9f51faaf4a35bb29343af0d29164938363a +9dd6e5296c8ad1bbb88933b8150383bc0eba9488: + title: 'kbuild: Fix ''-S -c'' in x86 stack protector scripts' + mainline: 3415b10a03945b0da4a635e146750dfe5ce0f448 + backport: 6bd6cf1374f27ba771760e53caf8c276e794b638 +61fbbac22c8ce73d0c492caf45a286c3f021c0fd: + title: 'netfilter: nf_tables: set element extended ACK reporting support' + mainline: b53c116642502b0c85ecef78bff4f826a7dd4145 + backport: 9aee9974b20b6907210221aba005ec36135348a4 +f8dfda798650241c1692058713ca4fef8e429061: + title: 'netfilter: nf_tables: use timestamp to check for set element timeout' + mainline: 7395dfacfff65e9938ac0889dafa1ab01e987d15 + skipped: too risky to backport +1947e4c3346faa8ac7e343652c0fd3b3e394202f: + title: 'netfilter: nf_tables: prefer nft_chain_validate' + mainline: cff3bd012a9512ac5ed858d38e6ed65f6391008c + skipped: missing nft_chain_validate() and related code +5e1d9d92c5ef03c177422262cce31863af964ef3: + title: 'arm64: cpufeature: Fix the visibility of compat hwcaps' + mainline: 85f1506337f0c79a4955edfeee86a18628e3735f + skipped: (unknown reason) +92d206c404e4b1780a7d188aac2c7c34c3f15ac3: + title: 'media: uvcvideo: Use entity get_cur in uvc_ctrl_set' + mainline: 5f36851c36b30f713f588ed2b60aa7b4512e2c76 + skipped: revert fixed patch instead +3e06073d24807f04b4694108a8474decb7b99e60: + title: 'drm/i915/gem: Fix Virtual Memory mapping boundaries calculation' + mainline: 8bdd9ef7e9b1b2a73e394712b72b22055e0e26c3 + backport: 3ccfe379cab98c308e84733885655b1c7c956b80 +d5c3c7e26275a2d83b894d30f7582a42853a958f: + title: 'exec: Fix ToCToU between perm check and set-uid/gid usage' + mainline: f50733b45d865f91db90919f8311e2127ce5a0cb + backport: 02acb3b20db4e8372b854be6ce9846446def401c +9cc0878c7d7f12c10b3cc40197668816c918b465: + title: 'nvme/pci: Add APST quirk for Lenovo N60z laptop' + mainline: ab091ec536cb7b271983c0c063b17f62f3591583 + backport: 92af3424a5a42e8014f39c82996fe01a8ba6aaf0 diff --git a/Documentation/hwmon/hwmon-kernel-api.txt b/Documentation/hwmon/hwmon-kernel-api.txt index 53a806696c64..364f016fb022 100644 --- a/Documentation/hwmon/hwmon-kernel-api.txt +++ b/Documentation/hwmon/hwmon-kernel-api.txt @@ -298,17 +298,25 @@ functions is used. The header file linux/hwmon-sysfs.h provides a number of useful macros to declare and use hardware monitoring sysfs attributes. -In many cases, you can use the exsting define DEVICE_ATTR to declare such -attributes. This is feasible if an attribute has no additional context. However, -in many cases there will be additional information such as a sensor index which -will need to be passed to the sysfs attribute handling function. +In many cases, you can use the exsting define DEVICE_ATTR or its variants +DEVICE_ATTR_{RW,RO,WO} to declare such attributes. This is feasible if an +attribute has no additional context. However, in many cases there will be +additional information such as a sensor index which will need to be passed +to the sysfs attribute handling function. SENSOR_DEVICE_ATTR and SENSOR_DEVICE_ATTR_2 can be used to define attributes which need such additional context information. SENSOR_DEVICE_ATTR requires one additional argument, SENSOR_DEVICE_ATTR_2 requires two. -SENSOR_DEVICE_ATTR defines a struct sensor_device_attribute variable. -This structure has the following fields. +Simplified variants of SENSOR_DEVICE_ATTR and SENSOR_DEVICE_ATTR_2 are available +and should be used if standard attribute permissions and function names are +feasible. Standard permissions are 0644 for SENSOR_DEVICE_ATTR[_2]_RW, +0444 for SENSOR_DEVICE_ATTR[_2]_RO, and 0200 for SENSOR_DEVICE_ATTR[_2]_WO. +Standard functions, similar to DEVICE_ATTR_{RW,RO,WO}, have _show and _store +appended to the provided function name. + +SENSOR_DEVICE_ATTR and its variants define a struct sensor_device_attribute +variable. This structure has the following fields. struct sensor_device_attribute { struct device_attribute dev_attr; @@ -319,8 +327,8 @@ You can use to_sensor_dev_attr to get the pointer to this structure from the attribute read or write function. Its parameter is the device to which the attribute is attached. -SENSOR_DEVICE_ATTR_2 defines a struct sensor_device_attribute_2 variable, -which is defined as follows. +SENSOR_DEVICE_ATTR_2 and its variants define a struct sensor_device_attribute_2 +variable, which is defined as follows. struct sensor_device_attribute_2 { struct device_attribute dev_attr; diff --git a/Makefile b/Makefile index cd5d3bfe1a5c..faaffaa77bf2 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 14 -SUBLEVEL = 352 +SUBLEVEL = 353 EXTRAVERSION = -openela NAME = Petit Gorille diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi index a3fb072f20ba..d3ce9e0010a3 100644 --- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi @@ -626,8 +626,8 @@ <0>, <24000000>, <24000000>, <24000000>, <15000000>, <15000000>, - <100000000>, <100000000>, - <100000000>, <100000000>, + <300000000>, <100000000>, + <400000000>, <100000000>, <50000000>, <100000000>, <100000000>, <100000000>, <50000000>, <50000000>, diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c index 65f63a457130..52dec92614e8 100644 --- a/arch/m68k/amiga/config.c +++ b/arch/m68k/amiga/config.c @@ -181,6 +181,15 @@ int __init amiga_parse_bootinfo(const struct bi_record *record) dev->slotsize = be16_to_cpu(cd->cd_SlotSize); dev->boardaddr = be32_to_cpu(cd->cd_BoardAddr); dev->boardsize = be32_to_cpu(cd->cd_BoardSize); + + /* CS-LAB Warp 1260 workaround */ + if (be16_to_cpu(dev->rom.er_Manufacturer) == ZORRO_MANUF(ZORRO_PROD_CSLAB_WARP_1260) && + dev->rom.er_Product == ZORRO_PROD(ZORRO_PROD_CSLAB_WARP_1260)) { + + /* turn off all interrupts */ + pr_info("Warp 1260 card detected: applying interrupt storm workaround\n"); + *(uint32_t *)(dev->boardaddr + 0x1000) = 0xfff; + } } else pr_warn("amiga_parse_bootinfo: too many AutoConfig devices\n"); #endif /* CONFIG_ZORRO */ diff --git a/arch/m68k/atari/ataints.c b/arch/m68k/atari/ataints.c index 56f02ea2c248..715d1e0d973e 100644 --- a/arch/m68k/atari/ataints.c +++ b/arch/m68k/atari/ataints.c @@ -302,11 +302,7 @@ void __init atari_init_IRQ(void) if (ATARIHW_PRESENT(SCU)) { /* init the SCU if present */ - tt_scu.sys_mask = 0x10; /* enable VBL (for the cursor) and - * disable HSYNC interrupts (who - * needs them?) MFP and SCC are - * enabled in VME mask - */ + tt_scu.sys_mask = 0x0; /* disable all interrupts */ tt_scu.vme_mask = 0x60; /* enable MFP and SCC ints */ } else { /* If no SCU and no Hades, the HSYNC interrupt needs to be diff --git a/arch/m68k/include/asm/cmpxchg.h b/arch/m68k/include/asm/cmpxchg.h index 38e1d7acc44d..1f996713ce87 100644 --- a/arch/m68k/include/asm/cmpxchg.h +++ b/arch/m68k/include/asm/cmpxchg.h @@ -33,7 +33,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz x = tmp; break; default: - tmp = __invalid_xchg_size(x, ptr, size); + x = __invalid_xchg_size(x, ptr, size); break; } diff --git a/arch/mips/include/asm/mips-cm.h b/arch/mips/include/asm/mips-cm.h index 890e51b159e0..11a3d5120e2b 100644 --- a/arch/mips/include/asm/mips-cm.h +++ b/arch/mips/include/asm/mips-cm.h @@ -232,6 +232,10 @@ GCR_ACCESSOR_RO(32, 0x0d0, gic_status) GCR_ACCESSOR_RO(32, 0x0f0, cpc_status) #define CM_GCR_CPC_STATUS_EX BIT(0) +/* GCR_ACCESS - Controls core/IOCU access to GCRs */ +GCR_ACCESSOR_RW(32, 0x120, access_cm3) +#define CM_GCR_ACCESS_ACCESSEN GENMASK(7, 0) + /* GCR_L2_CONFIG - Indicates L2 cache configuration when Config5.L2C=1 */ GCR_ACCESSOR_RW(32, 0x130, l2_config) #define CM_GCR_L2_CONFIG_BYPASS BIT(20) diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c index ecc1a853f48d..55b478c9af0e 100644 --- a/arch/mips/kernel/smp-cps.c +++ b/arch/mips/kernel/smp-cps.c @@ -233,7 +233,10 @@ static void boot_core(unsigned int core, unsigned int vpe_id) write_gcr_co_reset_ext_base(CM_GCR_Cx_RESET_EXT_BASE_UEB); /* Ensure the core can access the GCRs */ - set_gcr_access(1 << core); + if (mips_cm_revision() < CM_REV_CM3) + set_gcr_access(1 << core); + else + set_gcr_access_cm3(1 << core); if (mips_cpc_present()) { /* Reset the core */ diff --git a/arch/mips/pci/pcie-octeon.c b/arch/mips/pci/pcie-octeon.c old mode 100755 new mode 100644 diff --git a/arch/powerpc/xmon/ppc-dis.c b/arch/powerpc/xmon/ppc-dis.c index 006c7f864f65..32c03f7d4412 100644 --- a/arch/powerpc/xmon/ppc-dis.c +++ b/arch/powerpc/xmon/ppc-dis.c @@ -137,32 +137,21 @@ int print_insn_powerpc (unsigned long insn, unsigned long memaddr) bool insn_is_short; ppc_cpu_t dialect; - dialect = PPC_OPCODE_PPC | PPC_OPCODE_COMMON - | PPC_OPCODE_64 | PPC_OPCODE_POWER4 | PPC_OPCODE_ALTIVEC; + dialect = PPC_OPCODE_PPC | PPC_OPCODE_COMMON; - if (cpu_has_feature(CPU_FTRS_POWER5)) - dialect |= PPC_OPCODE_POWER5; + if (IS_ENABLED(CONFIG_PPC64)) + dialect |= PPC_OPCODE_64 | PPC_OPCODE_POWER4 | PPC_OPCODE_CELL | + PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6 | PPC_OPCODE_POWER7 | PPC_OPCODE_POWER8 | + PPC_OPCODE_POWER9; - if (cpu_has_feature(CPU_FTRS_CELL)) - dialect |= (PPC_OPCODE_CELL | PPC_OPCODE_ALTIVEC); + if (cpu_has_feature(CPU_FTR_TM)) + dialect |= PPC_OPCODE_HTM; - if (cpu_has_feature(CPU_FTRS_POWER6)) - dialect |= (PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6 | PPC_OPCODE_ALTIVEC); + if (cpu_has_feature(CPU_FTR_ALTIVEC)) + dialect |= PPC_OPCODE_ALTIVEC | PPC_OPCODE_ALTIVEC2; - if (cpu_has_feature(CPU_FTRS_POWER7)) - dialect |= (PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6 | PPC_OPCODE_POWER7 - | PPC_OPCODE_ALTIVEC | PPC_OPCODE_VSX); - - if (cpu_has_feature(CPU_FTRS_POWER8)) - dialect |= (PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6 | PPC_OPCODE_POWER7 - | PPC_OPCODE_POWER8 | PPC_OPCODE_HTM - | PPC_OPCODE_ALTIVEC | PPC_OPCODE_ALTIVEC2 | PPC_OPCODE_VSX); - - if (cpu_has_feature(CPU_FTRS_POWER9)) - dialect |= (PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6 | PPC_OPCODE_POWER7 - | PPC_OPCODE_POWER8 | PPC_OPCODE_POWER9 | PPC_OPCODE_HTM - | PPC_OPCODE_ALTIVEC | PPC_OPCODE_ALTIVEC2 - | PPC_OPCODE_VSX | PPC_OPCODE_VSX3); + if (cpu_has_feature(CPU_FTR_VSX)) + dialect |= PPC_OPCODE_VSX | PPC_OPCODE_VSX3; /* Get the major opcode of the insn. */ opcode = NULL; diff --git a/arch/sparc/include/asm/oplib_64.h b/arch/sparc/include/asm/oplib_64.h index a67abebd4359..1b86d02a8455 100644 --- a/arch/sparc/include/asm/oplib_64.h +++ b/arch/sparc/include/asm/oplib_64.h @@ -247,6 +247,7 @@ void prom_sun4v_guest_soft_state(void); int prom_ihandle2path(int handle, char *buffer, int bufsize); /* Client interface level routines. */ +void prom_cif_init(void *cif_handler); void p1275_cmd_direct(unsigned long *); #endif /* !(__SPARC64_OPLIB_H) */ diff --git a/arch/sparc/prom/init_64.c b/arch/sparc/prom/init_64.c index 103aa9104318..f7b8a1a865b8 100644 --- a/arch/sparc/prom/init_64.c +++ b/arch/sparc/prom/init_64.c @@ -26,9 +26,6 @@ phandle prom_chosen_node; * routines in the prom library. * It gets passed the pointer to the PROM vector. */ - -extern void prom_cif_init(void *); - void __init prom_init(void *cif_handler) { phandle node; diff --git a/arch/sparc/prom/p1275.c b/arch/sparc/prom/p1275.c index 889aa602f8d8..51c3f984bbf7 100644 --- a/arch/sparc/prom/p1275.c +++ b/arch/sparc/prom/p1275.c @@ -49,7 +49,7 @@ void p1275_cmd_direct(unsigned long *args) local_irq_restore(flags); } -void prom_cif_init(void *cif_handler, void *cif_stack) +void prom_cif_init(void *cif_handler) { p1275buf.prom_cif_handler = (void (*)(long *))cif_handler; } diff --git a/arch/x86/events/intel/pt.c b/arch/x86/events/intel/pt.c index 22deb736d472..2c82a39d8e35 100644 --- a/arch/x86/events/intel/pt.c +++ b/arch/x86/events/intel/pt.c @@ -75,7 +75,7 @@ static struct pt_cap_desc { PT_CAP(psb_periods, 1, CPUID_EBX, 0xffff0000), }; -static u32 pt_cap_get(enum pt_capabilities cap) +u32 intel_pt_validate_hw_cap(enum pt_capabilities cap) { struct pt_cap_desc *cd = &pt_caps[cap]; u32 c = pt_pmu.caps[cd->leaf * PT_CPUID_REGS_NUM + cd->reg]; @@ -83,6 +83,7 @@ static u32 pt_cap_get(enum pt_capabilities cap) return (c & cd->mask) >> shift; } +EXPORT_SYMBOL_GPL(intel_pt_validate_hw_cap); static ssize_t pt_cap_show(struct device *cdev, struct device_attribute *attr, @@ -92,7 +93,7 @@ static ssize_t pt_cap_show(struct device *cdev, container_of(attr, struct dev_ext_attribute, attr); enum pt_capabilities cap = (long)ea->var; - return snprintf(buf, PAGE_SIZE, "%x\n", pt_cap_get(cap)); + return snprintf(buf, PAGE_SIZE, "%x\n", intel_pt_validate_hw_cap(cap)); } static struct attribute_group pt_cap_group = { @@ -310,16 +311,16 @@ static bool pt_event_valid(struct perf_event *event) return false; if (config & RTIT_CTL_CYC_PSB) { - if (!pt_cap_get(PT_CAP_psb_cyc)) + if (!intel_pt_validate_hw_cap(PT_CAP_psb_cyc)) return false; - allowed = pt_cap_get(PT_CAP_psb_periods); + allowed = intel_pt_validate_hw_cap(PT_CAP_psb_periods); requested = (config & RTIT_CTL_PSB_FREQ) >> RTIT_CTL_PSB_FREQ_OFFSET; if (requested && (!(allowed & BIT(requested)))) return false; - allowed = pt_cap_get(PT_CAP_cycle_thresholds); + allowed = intel_pt_validate_hw_cap(PT_CAP_cycle_thresholds); requested = (config & RTIT_CTL_CYC_THRESH) >> RTIT_CTL_CYC_THRESH_OFFSET; if (requested && (!(allowed & BIT(requested)))) @@ -334,10 +335,10 @@ static bool pt_event_valid(struct perf_event *event) * Spec says that setting mtc period bits while mtc bit in * CPUID is 0 will #GP, so better safe than sorry. */ - if (!pt_cap_get(PT_CAP_mtc)) + if (!intel_pt_validate_hw_cap(PT_CAP_mtc)) return false; - allowed = pt_cap_get(PT_CAP_mtc_periods); + allowed = intel_pt_validate_hw_cap(PT_CAP_mtc_periods); if (!allowed) return false; @@ -349,11 +350,11 @@ static bool pt_event_valid(struct perf_event *event) } if (config & RTIT_CTL_PWR_EVT_EN && - !pt_cap_get(PT_CAP_power_event_trace)) + !intel_pt_validate_hw_cap(PT_CAP_power_event_trace)) return false; if (config & RTIT_CTL_PTW) { - if (!pt_cap_get(PT_CAP_ptwrite)) + if (!intel_pt_validate_hw_cap(PT_CAP_ptwrite)) return false; /* FUPonPTW without PTW doesn't make sense */ @@ -545,16 +546,8 @@ static void pt_config_buffer(void *buf, unsigned int topa_idx, wrmsrl(MSR_IA32_RTIT_OUTPUT_MASK, reg); } -/* - * Keep ToPA table-related metadata on the same page as the actual table, - * taking up a few words from the top - */ - -#define TENTS_PER_PAGE (((PAGE_SIZE - 40) / sizeof(struct topa_entry)) - 1) - /** - * struct topa - page-sized ToPA table with metadata at the top - * @table: actual ToPA table entries, as understood by PT hardware + * struct topa - ToPA metadata * @list: linkage to struct pt_buffer's list of tables * @phys: physical address of this page * @offset: offset of the first entry in this table in the buffer @@ -562,7 +555,6 @@ static void pt_config_buffer(void *buf, unsigned int topa_idx, * @last: index of the last initialized entry in this table */ struct topa { - struct topa_entry table[TENTS_PER_PAGE]; struct list_head list; u64 phys; u64 offset; @@ -570,8 +562,40 @@ struct topa { int last; }; +/* + * Keep ToPA table-related metadata on the same page as the actual table, + * taking up a few words from the top + */ + +#define TENTS_PER_PAGE \ + ((PAGE_SIZE - sizeof(struct topa)) / sizeof(struct topa_entry)) + +/** + * struct topa_page - page-sized ToPA table with metadata at the top + * @table: actual ToPA table entries, as understood by PT hardware + * @topa: metadata + */ +struct topa_page { + struct topa_entry table[TENTS_PER_PAGE]; + struct topa topa; +}; + +static inline struct topa_page *topa_to_page(struct topa *topa) +{ + return container_of(topa, struct topa_page, topa); +} + +static inline struct topa_page *topa_entry_to_page(struct topa_entry *te) +{ + return (struct topa_page *)((unsigned long)te & PAGE_MASK); +} + /* make -1 stand for the last table entry */ -#define TOPA_ENTRY(t, i) ((i) == -1 ? &(t)->table[(t)->last] : &(t)->table[(i)]) +#define TOPA_ENTRY(t, i) \ + ((i) == -1 \ + ? &topa_to_page(t)->table[(t)->last] \ + : &topa_to_page(t)->table[(i)]) +#define TOPA_ENTRY_SIZE(t, i) (sizes(TOPA_ENTRY((t), (i))->size)) /** * topa_alloc() - allocate page-sized ToPA table @@ -583,27 +607,27 @@ struct topa { static struct topa *topa_alloc(int cpu, gfp_t gfp) { int node = cpu_to_node(cpu); - struct topa *topa; + struct topa_page *tp; struct page *p; p = alloc_pages_node(node, gfp | __GFP_ZERO, 0); if (!p) return NULL; - topa = page_address(p); - topa->last = 0; - topa->phys = page_to_phys(p); + tp = page_address(p); + tp->topa.last = 0; + tp->topa.phys = page_to_phys(p); /* * In case of singe-entry ToPA, always put the self-referencing END * link as the 2nd entry in the table */ - if (!pt_cap_get(PT_CAP_topa_multiple_entries)) { - TOPA_ENTRY(topa, 1)->base = topa->phys >> TOPA_SHIFT; - TOPA_ENTRY(topa, 1)->end = 1; + if (!intel_pt_validate_hw_cap(PT_CAP_topa_multiple_entries)) { + TOPA_ENTRY(&tp->topa, 1)->base = tp->topa.phys; + TOPA_ENTRY(&tp->topa, 1)->end = 1; } - return topa; + return &tp->topa; } /** @@ -638,7 +662,7 @@ static void topa_insert_table(struct pt_buffer *buf, struct topa *topa) topa->offset = last->offset + last->size; buf->last = topa; - if (!pt_cap_get(PT_CAP_topa_multiple_entries)) + if (!intel_pt_validate_hw_cap(PT_CAP_topa_multiple_entries)) return; BUG_ON(last->last != TENTS_PER_PAGE - 1); @@ -654,7 +678,7 @@ static void topa_insert_table(struct pt_buffer *buf, struct topa *topa) static bool topa_table_full(struct topa *topa) { /* single-entry ToPA is a special case */ - if (!pt_cap_get(PT_CAP_topa_multiple_entries)) + if (!intel_pt_validate_hw_cap(PT_CAP_topa_multiple_entries)) return !!topa->last; return topa->last == TENTS_PER_PAGE - 1; @@ -690,7 +714,8 @@ static int topa_insert_pages(struct pt_buffer *buf, gfp_t gfp) TOPA_ENTRY(topa, -1)->base = page_to_phys(p) >> TOPA_SHIFT; TOPA_ENTRY(topa, -1)->size = order; - if (!buf->snapshot && !pt_cap_get(PT_CAP_topa_multiple_entries)) { + if (!buf->snapshot && + !intel_pt_validate_hw_cap(PT_CAP_topa_multiple_entries)) { TOPA_ENTRY(topa, -1)->intr = 1; TOPA_ENTRY(topa, -1)->stop = 1; } @@ -712,22 +737,23 @@ static void pt_topa_dump(struct pt_buffer *buf) struct topa *topa; list_for_each_entry(topa, &buf->tables, list) { + struct topa_page *tp = topa_to_page(topa); int i; - pr_debug("# table @%p (%016Lx), off %llx size %zx\n", topa->table, + pr_debug("# table @%p (%016Lx), off %llx size %zx\n", tp->table, topa->phys, topa->offset, topa->size); for (i = 0; i < TENTS_PER_PAGE; i++) { pr_debug("# entry @%p (%lx sz %u %c%c%c) raw=%16llx\n", - &topa->table[i], - (unsigned long)topa->table[i].base << TOPA_SHIFT, - sizes(topa->table[i].size), - topa->table[i].end ? 'E' : ' ', - topa->table[i].intr ? 'I' : ' ', - topa->table[i].stop ? 'S' : ' ', - *(u64 *)&topa->table[i]); - if ((pt_cap_get(PT_CAP_topa_multiple_entries) && - topa->table[i].stop) || - topa->table[i].end) + &tp->table[i], + (unsigned long)tp->table[i].base << TOPA_SHIFT, + sizes(tp->table[i].size), + tp->table[i].end ? 'E' : ' ', + tp->table[i].intr ? 'I' : ' ', + tp->table[i].stop ? 'S' : ' ', + *(u64 *)&tp->table[i]); + if ((intel_pt_validate_hw_cap(PT_CAP_topa_multiple_entries) && + tp->table[i].stop) || + tp->table[i].end) break; } } @@ -770,7 +796,7 @@ static void pt_update_head(struct pt *pt) /* offset of the current output region within this table */ for (topa_idx = 0; topa_idx < buf->cur_idx; topa_idx++) - base += sizes(buf->cur->table[topa_idx].size); + base += TOPA_ENTRY_SIZE(buf->cur, topa_idx); if (buf->snapshot) { local_set(&buf->data_size, base); @@ -790,7 +816,7 @@ static void pt_update_head(struct pt *pt) */ static void *pt_buffer_region(struct pt_buffer *buf) { - return phys_to_virt(buf->cur->table[buf->cur_idx].base << TOPA_SHIFT); + return phys_to_virt((phys_addr_t)TOPA_ENTRY(buf->cur, buf->cur_idx)->base << TOPA_SHIFT); } /** @@ -799,7 +825,7 @@ static void *pt_buffer_region(struct pt_buffer *buf) */ static size_t pt_buffer_region_size(struct pt_buffer *buf) { - return sizes(buf->cur->table[buf->cur_idx].size); + return TOPA_ENTRY_SIZE(buf->cur, buf->cur_idx); } /** @@ -828,8 +854,8 @@ static void pt_handle_status(struct pt *pt) * means we are already losing data; need to let the decoder * know. */ - if (!pt_cap_get(PT_CAP_topa_multiple_entries) || - buf->output_off == sizes(TOPA_ENTRY(buf->cur, buf->cur_idx)->size)) { + if (!intel_pt_validate_hw_cap(PT_CAP_topa_multiple_entries) || + buf->output_off == pt_buffer_region_size(buf)) { perf_aux_output_flag(&pt->handle, PERF_AUX_FLAG_TRUNCATED); advance++; @@ -840,7 +866,8 @@ static void pt_handle_status(struct pt *pt) * Also on single-entry ToPA implementations, interrupt will come * before the output reaches its output region's boundary. */ - if (!pt_cap_get(PT_CAP_topa_multiple_entries) && !buf->snapshot && + if (!intel_pt_validate_hw_cap(PT_CAP_topa_multiple_entries) && + !buf->snapshot && pt_buffer_region_size(buf) - buf->output_off <= TOPA_PMI_MARGIN) { void *head = pt_buffer_region(buf); @@ -866,9 +893,11 @@ static void pt_handle_status(struct pt *pt) static void pt_read_offset(struct pt_buffer *buf) { u64 offset, base_topa; + struct topa_page *tp; rdmsrl(MSR_IA32_RTIT_OUTPUT_BASE, base_topa); - buf->cur = phys_to_virt(base_topa); + tp = phys_to_virt(base_topa); + buf->cur = &tp->topa; rdmsrl(MSR_IA32_RTIT_OUTPUT_MASK, offset); /* offset within current output region */ @@ -923,15 +952,14 @@ static int pt_buffer_reset_markers(struct pt_buffer *buf, unsigned long idx, npages, wakeup; /* can't stop in the middle of an output region */ - if (buf->output_off + handle->size + 1 < - sizes(TOPA_ENTRY(buf->cur, buf->cur_idx)->size)) { + if (buf->output_off + handle->size + 1 < pt_buffer_region_size(buf)) { perf_aux_output_flag(handle, PERF_AUX_FLAG_TRUNCATED); return -EINVAL; } /* single entry ToPA is handled by marking all regions STOP=1 INT=1 */ - if (!pt_cap_get(PT_CAP_topa_multiple_entries)) + if (!intel_pt_validate_hw_cap(PT_CAP_topa_multiple_entries)) return 0; /* clear STOP and INT from current entry */ @@ -1019,6 +1047,7 @@ static void pt_buffer_setup_topa_index(struct pt_buffer *buf) */ static void pt_buffer_reset_offsets(struct pt_buffer *buf, unsigned long head) { + struct topa_page *cur_tp; int pg; if (buf->snapshot) @@ -1027,10 +1056,10 @@ static void pt_buffer_reset_offsets(struct pt_buffer *buf, unsigned long head) pg = (head >> PAGE_SHIFT) & (buf->nr_pages - 1); pg = pt_topa_next_entry(buf, pg); - buf->cur = (struct topa *)((unsigned long)buf->topa_index[pg] & PAGE_MASK); - buf->cur_idx = ((unsigned long)buf->topa_index[pg] - - (unsigned long)buf->cur) / sizeof(struct topa_entry); - buf->output_off = head & (sizes(buf->cur->table[buf->cur_idx].size) - 1); + cur_tp = topa_entry_to_page(buf->topa_index[pg]); + buf->cur = &cur_tp->topa; + buf->cur_idx = buf->topa_index[pg] - TOPA_ENTRY(buf->cur, 0); + buf->output_off = head & (pt_buffer_region_size(buf) - 1); local64_set(&buf->head, head); local_set(&buf->data_size, 0); @@ -1082,7 +1111,7 @@ static int pt_buffer_init_topa(struct pt_buffer *buf, unsigned long nr_pages, pt_buffer_setup_topa_index(buf); /* link last table to the first one, unless we're double buffering */ - if (pt_cap_get(PT_CAP_topa_multiple_entries)) { + if (intel_pt_validate_hw_cap(PT_CAP_topa_multiple_entries)) { TOPA_ENTRY(buf->last, -1)->base = buf->first->phys >> TOPA_SHIFT; TOPA_ENTRY(buf->last, -1)->end = 1; } @@ -1154,7 +1183,7 @@ static int pt_addr_filters_init(struct perf_event *event) struct pt_filters *filters; int node = event->cpu == -1 ? -1 : cpu_to_node(event->cpu); - if (!pt_cap_get(PT_CAP_num_address_ranges)) + if (!intel_pt_validate_hw_cap(PT_CAP_num_address_ranges)) return 0; filters = kzalloc_node(sizeof(struct pt_filters), GFP_KERNEL, node); @@ -1199,7 +1228,7 @@ static int pt_event_addr_filters_validate(struct list_head *filters) return -EINVAL; } - if (++range > pt_cap_get(PT_CAP_num_address_ranges)) + if (++range > intel_pt_validate_hw_cap(PT_CAP_num_address_ranges)) return -EOPNOTSUPP; } @@ -1287,7 +1316,7 @@ void intel_pt_interrupt(void) return; } - pt_config_buffer(buf->cur->table, buf->cur_idx, + pt_config_buffer(topa_to_page(buf->cur)->table, buf->cur_idx, buf->output_off); pt_config(event); } @@ -1352,7 +1381,7 @@ static void pt_event_start(struct perf_event *event, int mode) WRITE_ONCE(pt->handle_nmi, 1); hwc->state = 0; - pt_config_buffer(buf->cur->table, buf->cur_idx, + pt_config_buffer(topa_to_page(buf->cur)->table, buf->cur_idx, buf->output_off); pt_config(event); @@ -1502,12 +1531,12 @@ static __init int pt_init(void) if (ret) return ret; - if (!pt_cap_get(PT_CAP_topa_output)) { + if (!intel_pt_validate_hw_cap(PT_CAP_topa_output)) { pr_warn("ToPA output is not supported on this CPU\n"); return -ENODEV; } - if (!pt_cap_get(PT_CAP_topa_multiple_entries)) + if (!intel_pt_validate_hw_cap(PT_CAP_topa_multiple_entries)) pt_pmu.pmu.capabilities = PERF_PMU_CAP_AUX_NO_SG | PERF_PMU_CAP_AUX_SW_DOUBLEBUF; @@ -1525,7 +1554,7 @@ static __init int pt_init(void) pt_pmu.pmu.addr_filters_sync = pt_event_addr_filters_sync; pt_pmu.pmu.addr_filters_validate = pt_event_addr_filters_validate; pt_pmu.pmu.nr_addr_filters = - pt_cap_get(PT_CAP_num_address_ranges); + intel_pt_validate_hw_cap(PT_CAP_num_address_ranges); ret = perf_pmu_register(&pt_pmu.pmu, "intel_pt", -1); diff --git a/arch/x86/events/intel/pt.h b/arch/x86/events/intel/pt.h index 0eb41d07b79a..ad4ac27f0468 100644 --- a/arch/x86/events/intel/pt.h +++ b/arch/x86/events/intel/pt.h @@ -78,34 +78,13 @@ struct topa_entry { u64 rsvd2 : 1; u64 size : 4; u64 rsvd3 : 2; - u64 base : 36; - u64 rsvd4 : 16; + u64 base : 40; + u64 rsvd4 : 12; }; -#define PT_CPUID_LEAVES 2 -#define PT_CPUID_REGS_NUM 4 /* number of regsters (eax, ebx, ecx, edx) */ - /* TSC to Core Crystal Clock Ratio */ #define CPUID_TSC_LEAF 0x15 -enum pt_capabilities { - PT_CAP_max_subleaf = 0, - PT_CAP_cr3_filtering, - PT_CAP_psb_cyc, - PT_CAP_ip_filtering, - PT_CAP_mtc, - PT_CAP_ptwrite, - PT_CAP_power_event_trace, - PT_CAP_topa_output, - PT_CAP_topa_multiple_entries, - PT_CAP_single_range_output, - PT_CAP_payloads_lip, - PT_CAP_num_address_ranges, - PT_CAP_mtc_periods, - PT_CAP_cycle_thresholds, - PT_CAP_psb_periods, -}; - struct pt_pmu { struct pmu pmu; u32 caps[PT_CPUID_REGS_NUM * PT_CPUID_LEAVES]; diff --git a/arch/x86/include/asm/intel_pt.h b/arch/x86/include/asm/intel_pt.h index b523f51c5400..fa4b4fd2dbed 100644 --- a/arch/x86/include/asm/intel_pt.h +++ b/arch/x86/include/asm/intel_pt.h @@ -2,10 +2,33 @@ #ifndef _ASM_X86_INTEL_PT_H #define _ASM_X86_INTEL_PT_H +#define PT_CPUID_LEAVES 2 +#define PT_CPUID_REGS_NUM 4 /* number of regsters (eax, ebx, ecx, edx) */ + +enum pt_capabilities { + PT_CAP_max_subleaf = 0, + PT_CAP_cr3_filtering, + PT_CAP_psb_cyc, + PT_CAP_ip_filtering, + PT_CAP_mtc, + PT_CAP_ptwrite, + PT_CAP_power_event_trace, + PT_CAP_topa_output, + PT_CAP_topa_multiple_entries, + PT_CAP_single_range_output, + PT_CAP_payloads_lip, + PT_CAP_num_address_ranges, + PT_CAP_mtc_periods, + PT_CAP_cycle_thresholds, + PT_CAP_psb_periods, +}; + #if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_CPU_SUP_INTEL) void cpu_emergency_stop_pt(void); +extern u32 intel_pt_validate_hw_cap(enum pt_capabilities cap); #else static inline void cpu_emergency_stop_pt(void) {} +static inline u32 intel_pt_validate_hw_cap(enum pt_capabilities cap) { return 0; } #endif #endif /* _ASM_X86_INTEL_PT_H */ diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c index 7468de429087..41da59446ef8 100644 --- a/arch/x86/kernel/cpu/mtrr/main.c +++ b/arch/x86/kernel/cpu/mtrr/main.c @@ -816,7 +816,7 @@ void mtrr_save_state(void) { int first_cpu; - if (!mtrr_enabled()) + if (!mtrr_enabled() || !mtrr_state.have_fixed) return; first_cpu = cpumask_first(cpu_online_mask); diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c index 7fa0855e4b9a..717ba4b2e8d0 100644 --- a/arch/x86/kernel/devicetree.c +++ b/arch/x86/kernel/devicetree.c @@ -96,7 +96,7 @@ static int x86_of_pci_irq_enable(struct pci_dev *dev) ret = pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); if (ret) - return ret; + return pcibios_err_to_errno(ret); if (!pin) return 0; diff --git a/arch/x86/pci/intel_mid_pci.c b/arch/x86/pci/intel_mid_pci.c index 1012a5f0f98d..e5042a0413fb 100644 --- a/arch/x86/pci/intel_mid_pci.c +++ b/arch/x86/pci/intel_mid_pci.c @@ -222,9 +222,9 @@ static int intel_mid_pci_irq_enable(struct pci_dev *dev) return 0; ret = pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &gsi); - if (ret < 0) { + if (ret) { dev_warn(&dev->dev, "Failed to read interrupt line: %d\n", ret); - return ret; + return pcibios_err_to_errno(ret); } switch (intel_mid_identify_cpu()) { diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c index 7135f35f9de7..a77b73ee727e 100644 --- a/arch/x86/pci/xen.c +++ b/arch/x86/pci/xen.c @@ -35,10 +35,10 @@ static int xen_pcifront_enable_irq(struct pci_dev *dev) u8 gsi; rc = pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &gsi); - if (rc < 0) { + if (rc) { dev_warn(&dev->dev, "Xen PCI: failed to read interrupt line: %d\n", rc); - return rc; + return pcibios_err_to_errno(rc); } /* In PV DomU the Xen PCI backend puts the PIRQ in the interrupt line.*/ pirq = gsi; diff --git a/arch/x86/platform/intel/iosf_mbi.c b/arch/x86/platform/intel/iosf_mbi.c index a952ac199741..5e2a6ca4368c 100644 --- a/arch/x86/platform/intel/iosf_mbi.c +++ b/arch/x86/platform/intel/iosf_mbi.c @@ -68,7 +68,7 @@ static int iosf_mbi_pci_read_mdr(u32 mcrx, u32 mcr, u32 *mdr) fail_read: dev_err(&mbi_pdev->dev, "PCI config access failed with %d\n", result); - return result; + return pcibios_err_to_errno(result); } static int iosf_mbi_pci_write_mdr(u32 mcrx, u32 mcr, u32 mdr) @@ -97,7 +97,7 @@ static int iosf_mbi_pci_write_mdr(u32 mcrx, u32 mcr, u32 mdr) fail_write: dev_err(&mbi_pdev->dev, "PCI config access failed with %d\n", result); - return result; + return pcibios_err_to_errno(result); } int iosf_mbi_read(u8 port, u8 opcode, u32 offset, u32 *mdr) diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c index 0d83f25ac8ac..9043d200b97f 100644 --- a/arch/x86/xen/p2m.c +++ b/arch/x86/xen/p2m.c @@ -733,7 +733,7 @@ int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops, * immediate unmapping. */ map_ops[i].status = GNTST_general_error; - unmap[0].host_addr = map_ops[i].host_addr, + unmap[0].host_addr = map_ops[i].host_addr; unmap[0].handle = map_ops[i].handle; map_ops[i].handle = ~0; if (map_ops[i].flags & GNTMAP_device_map) @@ -743,7 +743,7 @@ int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops, if (kmap_ops) { kmap_ops[i].status = GNTST_general_error; - unmap[1].host_addr = kmap_ops[i].host_addr, + unmap[1].host_addr = kmap_ops[i].host_addr; unmap[1].handle = kmap_ops[i].handle; kmap_ops[i].handle = ~0; if (kmap_ops[i].flags & GNTMAP_device_map) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index b968f457f332..10649f2b4a86 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -1018,9 +1018,7 @@ static bool binder_has_work(struct binder_thread *thread, bool do_proc_work) static bool binder_available_for_proc_work_ilocked(struct binder_thread *thread) { return !thread->transaction_stack && - binder_worklist_empty_ilocked(&thread->todo) && - (thread->looper & (BINDER_LOOPER_STATE_ENTERED | - BINDER_LOOPER_STATE_REGISTERED)); + binder_worklist_empty_ilocked(&thread->todo); } static void binder_wakeup_poll_threads_ilocked(struct binder_proc *proc, diff --git a/drivers/base/core.c b/drivers/base/core.c index 110da991653a..d0ab742c3507 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -905,6 +906,7 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj, struct kobj_uevent_env *env) { struct device *dev = kobj_to_dev(kobj); + struct device_driver *driver; int retval = 0; /* add device node properties if present */ @@ -933,8 +935,12 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj, if (dev->type && dev->type->name) add_uevent_var(env, "DEVTYPE=%s", dev->type->name); - if (dev->driver) - add_uevent_var(env, "DRIVER=%s", dev->driver->name); + /* Synchronize with module_remove_driver() */ + rcu_read_lock(); + driver = READ_ONCE(dev->driver); + if (driver) + add_uevent_var(env, "DRIVER=%s", driver->name); + rcu_read_unlock(); /* Add common DT information about the device */ of_device_uevent(dev, env); @@ -1004,11 +1010,8 @@ static ssize_t uevent_show(struct device *dev, struct device_attribute *attr, if (!env) return -ENOMEM; - /* Synchronize with really_probe() */ - device_lock(dev); /* let the kset specific function add its keys */ retval = kset->uevent_ops->uevent(kset, &dev->kobj, env); - device_unlock(dev); if (retval) goto out; diff --git a/drivers/base/devres.c b/drivers/base/devres.c index e43a04a495a3..f6b54161aeea 100644 --- a/drivers/base/devres.c +++ b/drivers/base/devres.c @@ -1053,7 +1053,11 @@ EXPORT_SYMBOL_GPL(__devm_alloc_percpu); */ void devm_free_percpu(struct device *dev, void __percpu *pdata) { - WARN_ON(devres_destroy(dev, devm_percpu_release, devm_percpu_match, - (void *)pdata)); + /* + * Use devres_release() to prevent memory leakage as + * devm_free_pages() does. + */ + WARN_ON(devres_release(dev, devm_percpu_release, devm_percpu_match, + (__force void *)pdata)); } EXPORT_SYMBOL_GPL(devm_free_percpu); diff --git a/drivers/base/dma-mapping.c b/drivers/base/dma-mapping.c index c5963415c1c5..40617c3810b0 100644 --- a/drivers/base/dma-mapping.c +++ b/drivers/base/dma-mapping.c @@ -98,8 +98,8 @@ void dmam_free_coherent(struct device *dev, size_t size, void *vaddr, { struct dma_devres match_data = { size, vaddr, dma_handle }; - dma_free_coherent(dev, size, vaddr, dma_handle); WARN_ON(devres_destroy(dev, dmam_release, dmam_match, &match_data)); + dma_free_coherent(dev, size, vaddr, dma_handle); } EXPORT_SYMBOL(dmam_free_coherent); diff --git a/drivers/base/module.c b/drivers/base/module.c index 2a215780eda2..48ad0e7c1fa8 100644 --- a/drivers/base/module.c +++ b/drivers/base/module.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "base.h" static char *make_driver_name(struct device_driver *drv) @@ -79,6 +80,9 @@ void module_remove_driver(struct device_driver *drv) if (!drv) return; + /* Synchronize with dev_uevent() */ + synchronize_rcu(); + sysfs_remove_link(&drv->p->kobj, "module"); if (drv->owner) diff --git a/drivers/char/hw_random/amd-rng.c b/drivers/char/hw_random/amd-rng.c index db3dd467194c..3f3fdf6ee3d5 100644 --- a/drivers/char/hw_random/amd-rng.c +++ b/drivers/char/hw_random/amd-rng.c @@ -142,8 +142,10 @@ static int __init mod_init(void) found: err = pci_read_config_dword(pdev, 0x58, &pmbase); - if (err) + if (err) { + err = pcibios_err_to_errno(err); goto put_dev; + } pmbase &= 0x0000FF00; if (pmbase == 0) { diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c index 48eeee53a586..fea5749240ce 100644 --- a/drivers/clocksource/sh_cmt.c +++ b/drivers/clocksource/sh_cmt.c @@ -510,6 +510,7 @@ static void sh_cmt_set_next(struct sh_cmt_channel *ch, unsigned long delta) static irqreturn_t sh_cmt_interrupt(int irq, void *dev_id) { struct sh_cmt_channel *ch = dev_id; + unsigned long flags; /* clear flags */ sh_cmt_write_cmcsr(ch, sh_cmt_read_cmcsr(ch) & @@ -540,6 +541,8 @@ static irqreturn_t sh_cmt_interrupt(int irq, void *dev_id) ch->flags &= ~FLAG_SKIPEVENT; + raw_spin_lock_irqsave(&ch->lock, flags); + if (ch->flags & FLAG_REPROGRAM) { ch->flags &= ~FLAG_REPROGRAM; sh_cmt_clock_event_program_verify(ch, 1); @@ -552,6 +555,8 @@ static irqreturn_t sh_cmt_interrupt(int irq, void *dev_id) ch->flags &= ~FLAG_IRQCONTEXT; + raw_spin_unlock_irqrestore(&ch->lock, flags); + return IRQ_HANDLED; } @@ -750,12 +755,18 @@ static int sh_cmt_clock_event_next(unsigned long delta, struct clock_event_device *ced) { struct sh_cmt_channel *ch = ced_to_sh_cmt(ced); + unsigned long flags; BUG_ON(!clockevent_state_oneshot(ced)); + + raw_spin_lock_irqsave(&ch->lock, flags); + if (likely(ch->flags & FLAG_IRQCONTEXT)) ch->next_match_value = delta - 1; else - sh_cmt_set_next(ch, delta - 1); + __sh_cmt_set_next(ch, delta - 1); + + raw_spin_unlock_irqrestore(&ch->lock, flags); return 0; } diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c index 303083ad28e3..75a4aabbaebc 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c @@ -14,6 +14,7 @@ #include #include #include +#include #include @@ -449,6 +450,10 @@ void analogix_dp_init_aux(struct analogix_dp_device *dp) reg = RPLY_RECEIV | AUX_ERR; writel(reg, dp->reg_base + ANALOGIX_DP_INT_STA); + analogix_dp_set_analog_power_down(dp, AUX_BLOCK, true); + usleep_range(10, 11); + analogix_dp_set_analog_power_down(dp, AUX_BLOCK, false); + analogix_dp_reset_aux(dp); /* Disable AUX transaction H/W retry */ @@ -1042,10 +1047,10 @@ ssize_t analogix_dp_transfer(struct analogix_dp_device *dp, struct drm_dp_aux_msg *msg) { u32 reg; + u32 status_reg; u8 *buffer = msg->buffer; - int timeout_loop = 0; unsigned int i; - int num_transferred = 0; + int ret; /* Buffer size of AUX CH is 16 bytes */ if (WARN_ON(msg->size > 16)) @@ -1096,7 +1101,6 @@ ssize_t analogix_dp_transfer(struct analogix_dp_device *dp, reg = buffer[i]; writel(reg, dp->reg_base + ANALOGIX_DP_BUF_DATA_0 + 4 * i); - num_transferred++; } } @@ -1109,17 +1113,20 @@ ssize_t analogix_dp_transfer(struct analogix_dp_device *dp, writel(reg, dp->reg_base + ANALOGIX_DP_AUX_CH_CTL_2); - /* Is AUX CH command reply received? */ + ret = readx_poll_timeout(readl, dp->reg_base + ANALOGIX_DP_AUX_CH_CTL_2, + reg, !(reg & AUX_EN), 25, 500 * 1000); + if (ret) { + dev_err(dp->dev, "AUX CH enable timeout!\n"); + goto aux_error; + } + /* TODO: Wait for an interrupt instead of looping? */ - reg = readl(dp->reg_base + ANALOGIX_DP_INT_STA); - while (!(reg & RPLY_RECEIV)) { - timeout_loop++; - if (timeout_loop > DP_TIMEOUT_LOOP_COUNT) { - dev_err(dp->dev, "AUX CH command reply failed!\n"); - return -ETIMEDOUT; - } - reg = readl(dp->reg_base + ANALOGIX_DP_INT_STA); - usleep_range(10, 11); + /* Is AUX CH command reply received? */ + ret = readx_poll_timeout(readl, dp->reg_base + ANALOGIX_DP_INT_STA, + reg, reg & RPLY_RECEIV, 10, 20 * 1000); + if (ret) { + dev_err(dp->dev, "AUX CH cmd reply timeout!\n"); + goto aux_error; } /* Clear interrupt source for AUX CH command reply */ @@ -1127,17 +1134,13 @@ ssize_t analogix_dp_transfer(struct analogix_dp_device *dp, /* Clear interrupt source for AUX CH access error */ reg = readl(dp->reg_base + ANALOGIX_DP_INT_STA); - if (reg & AUX_ERR) { + status_reg = readl(dp->reg_base + ANALOGIX_DP_AUX_CH_STA); + if ((reg & AUX_ERR) || (status_reg & AUX_STATUS_MASK)) { writel(AUX_ERR, dp->reg_base + ANALOGIX_DP_INT_STA); - return -EREMOTEIO; - } - /* Check AUX CH error access status */ - reg = readl(dp->reg_base + ANALOGIX_DP_AUX_CH_STA); - if ((reg & AUX_STATUS_MASK)) { - dev_err(dp->dev, "AUX CH error happened: %d\n\n", - reg & AUX_STATUS_MASK); - return -EREMOTEIO; + dev_warn(dp->dev, "AUX CH error happened: %#x (%d)\n", + status_reg & AUX_STATUS_MASK, !!(reg & AUX_ERR)); + goto aux_error; } if (msg->request & DP_AUX_I2C_READ) { @@ -1145,7 +1148,6 @@ ssize_t analogix_dp_transfer(struct analogix_dp_device *dp, reg = readl(dp->reg_base + ANALOGIX_DP_BUF_DATA_0 + 4 * i); buffer[i] = (unsigned char)reg; - num_transferred++; } } @@ -1162,5 +1164,11 @@ ssize_t analogix_dp_transfer(struct analogix_dp_device *dp, (msg->request & ~DP_AUX_I2C_MOT) == DP_AUX_NATIVE_READ) msg->reply = DP_AUX_NATIVE_REPLY_ACK; - return num_transferred > 0 ? num_transferred : -EBUSY; + return msg->size; + +aux_error: + /* if aux err happen, reset aux */ + analogix_dp_init_aux(dp); + + return -EREMOTEIO; } diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c index 57881167ccd2..d0bc792038b5 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c @@ -397,9 +397,11 @@ static void *etnaviv_gem_vmap_impl(struct etnaviv_gem_object *obj) static inline enum dma_data_direction etnaviv_op_to_dma_dir(u32 op) { - if (op & ETNA_PREP_READ) + op &= ETNA_PREP_READ | ETNA_PREP_WRITE; + + if (op == ETNA_PREP_READ) return DMA_FROM_DEVICE; - else if (op & ETNA_PREP_WRITE) + else if (op == ETNA_PREP_WRITE) return DMA_TO_DEVICE; else return DMA_BIDIRECTIONAL; diff --git a/drivers/gpu/drm/gma500/cdv_intel_lvds.c b/drivers/gpu/drm/gma500/cdv_intel_lvds.c index e022951894e3..2f71382c300a 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_lvds.c +++ b/drivers/gpu/drm/gma500/cdv_intel_lvds.c @@ -404,6 +404,9 @@ static int cdv_intel_lvds_get_modes(struct drm_connector *connector) if (mode_dev->panel_fixed_mode != NULL) { struct drm_display_mode *mode = drm_mode_duplicate(dev, mode_dev->panel_fixed_mode); + if (!mode) + return 0; + drm_mode_probed_add(connector, mode); return 1; } diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c b/drivers/gpu/drm/gma500/psb_intel_lvds.c index 8baf6325c6e4..5e5b05cde0f4 100644 --- a/drivers/gpu/drm/gma500/psb_intel_lvds.c +++ b/drivers/gpu/drm/gma500/psb_intel_lvds.c @@ -519,6 +519,9 @@ static int psb_intel_lvds_get_modes(struct drm_connector *connector) if (mode_dev->panel_fixed_mode != NULL) { struct drm_display_mode *mode = drm_mode_duplicate(dev, mode_dev->panel_fixed_mode); + if (!mode) + return 0; + drm_mode_probed_add(connector, mode); return 1; } diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 08d31744e2d9..6dca9b4ecb92 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1802,6 +1802,39 @@ compute_partial_view(struct drm_i915_gem_object *obj, return view; } +static void set_address_limits(struct vm_area_struct *area, + struct i915_vma *vma, + unsigned long *start_vaddr, + unsigned long *end_vaddr) +{ + unsigned long vm_start, vm_end, vma_size; /* user's memory parameters */ + long start, end; /* memory boundaries */ + + /* + * Let's move into the ">> PAGE_SHIFT" + * domain to be sure not to lose bits + */ + vm_start = area->vm_start >> PAGE_SHIFT; + vm_end = area->vm_end >> PAGE_SHIFT; + vma_size = vma->size >> PAGE_SHIFT; + + /* + * Calculate the memory boundaries by considering the offset + * provided by the user during memory mapping and the offset + * provided for the partial mapping. + */ + start = vm_start; + start += vma->ggtt_view.partial.offset; + end = start + vma_size; + + start = max_t(long, start, vm_start); + end = min_t(long, end, vm_end); + + /* Let's move back into the "<< PAGE_SHIFT" domain */ + *start_vaddr = (unsigned long)start << PAGE_SHIFT; + *end_vaddr = (unsigned long)end << PAGE_SHIFT; +} + /** * i915_gem_fault - fault a page into the GTT * @vmf: fault info @@ -1829,9 +1862,10 @@ int i915_gem_fault(struct vm_fault *vmf) struct drm_i915_private *dev_priv = to_i915(dev); struct i915_ggtt *ggtt = &dev_priv->ggtt; bool write = !!(vmf->flags & FAULT_FLAG_WRITE); + unsigned long start, end; /* memory boundaries */ struct i915_vma *vma; pgoff_t page_offset; - unsigned int flags; + unsigned long pfn; int ret; /* Sanity check that we allow writing into this object */ @@ -1871,27 +1905,34 @@ int i915_gem_fault(struct vm_fault *vmf) goto err_unlock; } - /* If the object is smaller than a couple of partial vma, it is - * not worth only creating a single partial vma - we may as well - * clear enough space for the full object. - */ - flags = PIN_MAPPABLE; - if (obj->base.size > 2 * MIN_CHUNK_PAGES << PAGE_SHIFT) - flags |= PIN_NONBLOCK | PIN_NONFAULT; /* Now pin it into the GTT as needed */ - vma = i915_gem_object_ggtt_pin(obj, NULL, 0, 0, flags); + vma = i915_gem_object_ggtt_pin(obj, NULL, 0, 0, + PIN_MAPPABLE | + PIN_NONBLOCK | + PIN_NONFAULT); if (IS_ERR(vma)) { /* Use a partial view if it is bigger than available space */ struct i915_ggtt_view view = compute_partial_view(obj, page_offset, MIN_CHUNK_PAGES); + unsigned int flags; + + flags = PIN_MAPPABLE; + if (view.type == I915_GGTT_VIEW_NORMAL) + flags |= PIN_NONBLOCK; /* avoid warnings for pinned */ - /* Userspace is now writing through an untracked VMA, abandon + /* + * Userspace is now writing through an untracked VMA, abandon * all hope that the hardware is able to track future writes. */ obj->frontbuffer_ggtt_origin = ORIGIN_CPU; - vma = i915_gem_object_ggtt_pin(obj, &view, 0, 0, PIN_MAPPABLE); + vma = i915_gem_object_ggtt_pin(obj, &view, 0, 0, flags); + if (IS_ERR(vma) && !view.type) { + flags = PIN_MAPPABLE; + view.type = I915_GGTT_VIEW_PARTIAL; + vma = i915_gem_object_ggtt_pin(obj, &view, 0, 0, flags); + } } if (IS_ERR(vma)) { ret = PTR_ERR(vma); @@ -1911,12 +1952,14 @@ int i915_gem_fault(struct vm_fault *vmf) if (list_empty(&obj->userfault_link)) list_add(&obj->userfault_link, &dev_priv->mm.userfault_list); + set_address_limits(area, vma, &start, &end); + + pfn = (ggtt->mappable_base + i915_ggtt_offset(vma)) >> PAGE_SHIFT; + pfn += (start - area->vm_start) >> PAGE_SHIFT; + pfn -= vma->ggtt_view.partial.offset; + /* Finally, remap it using the new GTT offset */ - ret = remap_io_mapping(area, - area->vm_start + (vma->ggtt_view.partial.offset << PAGE_SHIFT), - (ggtt->mappable_base + vma->node.start) >> PAGE_SHIFT, - min_t(u64, vma->size, area->vm_end - area->vm_start), - &ggtt->mappable); + ret = remap_io_mapping(area, start, pfn, end - start, &ggtt->mappable); err_unpin: __i915_vma_unpin(vma); diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c index 5653e7bac914..fe61e8ff7764 100644 --- a/drivers/gpu/drm/i915/i915_vma.c +++ b/drivers/gpu/drm/i915/i915_vma.c @@ -103,7 +103,7 @@ vma_create(struct drm_i915_gem_object *obj, obj->base.size >> PAGE_SHIFT)); vma->size = view->partial.size; vma->size <<= PAGE_SHIFT; - GEM_BUG_ON(vma->size >= obj->base.size); + GEM_BUG_ON(vma->size > obj->base.size); } else if (view->type == I915_GGTT_VIEW_ROTATED) { vma->size = intel_rotation_info_size(&view->rotated); vma->size <<= PAGE_SHIFT; diff --git a/drivers/gpu/drm/mgag200/mgag200_i2c.c b/drivers/gpu/drm/mgag200/mgag200_i2c.c index 77d1c4771786..0919021168e1 100644 --- a/drivers/gpu/drm/mgag200/mgag200_i2c.c +++ b/drivers/gpu/drm/mgag200/mgag200_i2c.c @@ -133,7 +133,7 @@ struct mga_i2c_chan *mgag200_i2c_create(struct drm_device *dev) i2c->adapter.algo_data = &i2c->bit; i2c->bit.udelay = 10; - i2c->bit.timeout = 2; + i2c->bit.timeout = usecs_to_jiffies(2200); i2c->bit.data = i2c; i2c->bit.setsda = mga_gpio_setsda; i2c->bit.setscl = mga_gpio_setscl; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c b/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c index 222c9c2123a1..ed15d795906d 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c @@ -100,7 +100,7 @@ static int vmw_overlay_send_put(struct vmw_private *dev_priv, { struct vmw_escape_video_flush *flush; size_t fifo_size; - bool have_so = (dev_priv->active_display_unit == vmw_du_screen_object); + bool have_so = (dev_priv->active_display_unit != vmw_du_legacy); int i, num_items; SVGAGuestPtr ptr; diff --git a/drivers/hwmon/adt7475.c b/drivers/hwmon/adt7475.c index 51bc70e6ec3f..b5bfbe145da2 100644 --- a/drivers/hwmon/adt7475.c +++ b/drivers/hwmon/adt7475.c @@ -1633,7 +1633,7 @@ static void adt7475_read_pwm(struct i2c_client *client, int index) data->pwm[CONTROL][index] &= ~0xE0; data->pwm[CONTROL][index] |= (7 << 5); - i2c_smbus_write_byte_data(client, PWM_CONFIG_REG(index), + i2c_smbus_write_byte_data(client, PWM_REG(index), data->pwm[INPUT][index]); i2c_smbus_write_byte_data(client, PWM_CONFIG_REG(index), diff --git a/drivers/hwmon/max6697.c b/drivers/hwmon/max6697.c index 6df28fe0577d..14c34a2d36af 100644 --- a/drivers/hwmon/max6697.c +++ b/drivers/hwmon/max6697.c @@ -251,7 +251,7 @@ static struct max6697_data *max6697_update_device(struct device *dev) return ret; } -static ssize_t show_temp_input(struct device *dev, +static ssize_t temp_input_show(struct device *dev, struct device_attribute *devattr, char *buf) { int index = to_sensor_dev_attr(devattr)->index; @@ -267,8 +267,8 @@ static ssize_t show_temp_input(struct device *dev, return sprintf(buf, "%d\n", temp * 125); } -static ssize_t show_temp(struct device *dev, - struct device_attribute *devattr, char *buf) +static ssize_t temp_show(struct device *dev, struct device_attribute *devattr, + char *buf) { int nr = to_sensor_dev_attr_2(devattr)->nr; int index = to_sensor_dev_attr_2(devattr)->index; @@ -284,7 +284,7 @@ static ssize_t show_temp(struct device *dev, return sprintf(buf, "%d\n", temp * 1000); } -static ssize_t show_alarm(struct device *dev, struct device_attribute *attr, +static ssize_t alarm_show(struct device *dev, struct device_attribute *attr, char *buf) { int index = to_sensor_dev_attr(attr)->index; @@ -299,9 +299,9 @@ static ssize_t show_alarm(struct device *dev, struct device_attribute *attr, return sprintf(buf, "%u\n", (data->alarms >> index) & 0x1); } -static ssize_t set_temp(struct device *dev, - struct device_attribute *devattr, - const char *buf, size_t count) +static ssize_t temp_store(struct device *dev, + struct device_attribute *devattr, const char *buf, + size_t count) { int nr = to_sensor_dev_attr_2(devattr)->nr; int index = to_sensor_dev_attr_2(devattr)->index; @@ -314,6 +314,7 @@ static ssize_t set_temp(struct device *dev, return ret; mutex_lock(&data->update_lock); + temp = clamp_val(temp, -1000000, 1000000); /* prevent underflow */ temp = DIV_ROUND_CLOSEST(temp, 1000) + data->temp_offset; temp = clamp_val(temp, 0, data->type == max6581 ? 255 : 127); data->temp[nr][index] = temp; @@ -326,79 +327,63 @@ static ssize_t set_temp(struct device *dev, return ret < 0 ? ret : count; } -static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, show_temp_input, NULL, 0); -static SENSOR_DEVICE_ATTR_2(temp1_max, S_IRUGO | S_IWUSR, show_temp, set_temp, - 0, MAX6697_TEMP_MAX); -static SENSOR_DEVICE_ATTR_2(temp1_crit, S_IRUGO | S_IWUSR, show_temp, set_temp, - 0, MAX6697_TEMP_CRIT); - -static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO, show_temp_input, NULL, 1); -static SENSOR_DEVICE_ATTR_2(temp2_max, S_IRUGO | S_IWUSR, show_temp, set_temp, - 1, MAX6697_TEMP_MAX); -static SENSOR_DEVICE_ATTR_2(temp2_crit, S_IRUGO | S_IWUSR, show_temp, set_temp, - 1, MAX6697_TEMP_CRIT); - -static SENSOR_DEVICE_ATTR(temp3_input, S_IRUGO, show_temp_input, NULL, 2); -static SENSOR_DEVICE_ATTR_2(temp3_max, S_IRUGO | S_IWUSR, show_temp, set_temp, - 2, MAX6697_TEMP_MAX); -static SENSOR_DEVICE_ATTR_2(temp3_crit, S_IRUGO | S_IWUSR, show_temp, set_temp, - 2, MAX6697_TEMP_CRIT); - -static SENSOR_DEVICE_ATTR(temp4_input, S_IRUGO, show_temp_input, NULL, 3); -static SENSOR_DEVICE_ATTR_2(temp4_max, S_IRUGO | S_IWUSR, show_temp, set_temp, - 3, MAX6697_TEMP_MAX); -static SENSOR_DEVICE_ATTR_2(temp4_crit, S_IRUGO | S_IWUSR, show_temp, set_temp, - 3, MAX6697_TEMP_CRIT); - -static SENSOR_DEVICE_ATTR(temp5_input, S_IRUGO, show_temp_input, NULL, 4); -static SENSOR_DEVICE_ATTR_2(temp5_max, S_IRUGO | S_IWUSR, show_temp, set_temp, - 4, MAX6697_TEMP_MAX); -static SENSOR_DEVICE_ATTR_2(temp5_crit, S_IRUGO | S_IWUSR, show_temp, set_temp, - 4, MAX6697_TEMP_CRIT); - -static SENSOR_DEVICE_ATTR(temp6_input, S_IRUGO, show_temp_input, NULL, 5); -static SENSOR_DEVICE_ATTR_2(temp6_max, S_IRUGO | S_IWUSR, show_temp, set_temp, - 5, MAX6697_TEMP_MAX); -static SENSOR_DEVICE_ATTR_2(temp6_crit, S_IRUGO | S_IWUSR, show_temp, set_temp, - 5, MAX6697_TEMP_CRIT); - -static SENSOR_DEVICE_ATTR(temp7_input, S_IRUGO, show_temp_input, NULL, 6); -static SENSOR_DEVICE_ATTR_2(temp7_max, S_IRUGO | S_IWUSR, show_temp, set_temp, - 6, MAX6697_TEMP_MAX); -static SENSOR_DEVICE_ATTR_2(temp7_crit, S_IRUGO | S_IWUSR, show_temp, set_temp, - 6, MAX6697_TEMP_CRIT); - -static SENSOR_DEVICE_ATTR(temp8_input, S_IRUGO, show_temp_input, NULL, 7); -static SENSOR_DEVICE_ATTR_2(temp8_max, S_IRUGO | S_IWUSR, show_temp, set_temp, - 7, MAX6697_TEMP_MAX); -static SENSOR_DEVICE_ATTR_2(temp8_crit, S_IRUGO | S_IWUSR, show_temp, set_temp, - 7, MAX6697_TEMP_CRIT); - -static SENSOR_DEVICE_ATTR(temp1_max_alarm, S_IRUGO, show_alarm, NULL, 22); -static SENSOR_DEVICE_ATTR(temp2_max_alarm, S_IRUGO, show_alarm, NULL, 16); -static SENSOR_DEVICE_ATTR(temp3_max_alarm, S_IRUGO, show_alarm, NULL, 17); -static SENSOR_DEVICE_ATTR(temp4_max_alarm, S_IRUGO, show_alarm, NULL, 18); -static SENSOR_DEVICE_ATTR(temp5_max_alarm, S_IRUGO, show_alarm, NULL, 19); -static SENSOR_DEVICE_ATTR(temp6_max_alarm, S_IRUGO, show_alarm, NULL, 20); -static SENSOR_DEVICE_ATTR(temp7_max_alarm, S_IRUGO, show_alarm, NULL, 21); -static SENSOR_DEVICE_ATTR(temp8_max_alarm, S_IRUGO, show_alarm, NULL, 23); - -static SENSOR_DEVICE_ATTR(temp1_crit_alarm, S_IRUGO, show_alarm, NULL, 14); -static SENSOR_DEVICE_ATTR(temp2_crit_alarm, S_IRUGO, show_alarm, NULL, 8); -static SENSOR_DEVICE_ATTR(temp3_crit_alarm, S_IRUGO, show_alarm, NULL, 9); -static SENSOR_DEVICE_ATTR(temp4_crit_alarm, S_IRUGO, show_alarm, NULL, 10); -static SENSOR_DEVICE_ATTR(temp5_crit_alarm, S_IRUGO, show_alarm, NULL, 11); -static SENSOR_DEVICE_ATTR(temp6_crit_alarm, S_IRUGO, show_alarm, NULL, 12); -static SENSOR_DEVICE_ATTR(temp7_crit_alarm, S_IRUGO, show_alarm, NULL, 13); -static SENSOR_DEVICE_ATTR(temp8_crit_alarm, S_IRUGO, show_alarm, NULL, 15); - -static SENSOR_DEVICE_ATTR(temp2_fault, S_IRUGO, show_alarm, NULL, 1); -static SENSOR_DEVICE_ATTR(temp3_fault, S_IRUGO, show_alarm, NULL, 2); -static SENSOR_DEVICE_ATTR(temp4_fault, S_IRUGO, show_alarm, NULL, 3); -static SENSOR_DEVICE_ATTR(temp5_fault, S_IRUGO, show_alarm, NULL, 4); -static SENSOR_DEVICE_ATTR(temp6_fault, S_IRUGO, show_alarm, NULL, 5); -static SENSOR_DEVICE_ATTR(temp7_fault, S_IRUGO, show_alarm, NULL, 6); -static SENSOR_DEVICE_ATTR(temp8_fault, S_IRUGO, show_alarm, NULL, 7); +static SENSOR_DEVICE_ATTR_RO(temp1_input, temp_input, 0); +static SENSOR_DEVICE_ATTR_2_RW(temp1_max, temp, 0, MAX6697_TEMP_MAX); +static SENSOR_DEVICE_ATTR_2_RW(temp1_crit, temp, 0, MAX6697_TEMP_CRIT); + +static SENSOR_DEVICE_ATTR_RO(temp2_input, temp_input, 1); +static SENSOR_DEVICE_ATTR_2_RW(temp2_max, temp, 1, MAX6697_TEMP_MAX); +static SENSOR_DEVICE_ATTR_2_RW(temp2_crit, temp, 1, MAX6697_TEMP_CRIT); + +static SENSOR_DEVICE_ATTR_RO(temp3_input, temp_input, 2); +static SENSOR_DEVICE_ATTR_2_RW(temp3_max, temp, 2, MAX6697_TEMP_MAX); +static SENSOR_DEVICE_ATTR_2_RW(temp3_crit, temp, 2, MAX6697_TEMP_CRIT); + +static SENSOR_DEVICE_ATTR_RO(temp4_input, temp_input, 3); +static SENSOR_DEVICE_ATTR_2_RW(temp4_max, temp, 3, MAX6697_TEMP_MAX); +static SENSOR_DEVICE_ATTR_2_RW(temp4_crit, temp, 3, MAX6697_TEMP_CRIT); + +static SENSOR_DEVICE_ATTR_RO(temp5_input, temp_input, 4); +static SENSOR_DEVICE_ATTR_2_RW(temp5_max, temp, 4, MAX6697_TEMP_MAX); +static SENSOR_DEVICE_ATTR_2_RW(temp5_crit, temp, 4, MAX6697_TEMP_CRIT); + +static SENSOR_DEVICE_ATTR_RO(temp6_input, temp_input, 5); +static SENSOR_DEVICE_ATTR_2_RW(temp6_max, temp, 5, MAX6697_TEMP_MAX); +static SENSOR_DEVICE_ATTR_2_RW(temp6_crit, temp, 5, MAX6697_TEMP_CRIT); + +static SENSOR_DEVICE_ATTR_RO(temp7_input, temp_input, 6); +static SENSOR_DEVICE_ATTR_2_RW(temp7_max, temp, 6, MAX6697_TEMP_MAX); +static SENSOR_DEVICE_ATTR_2_RW(temp7_crit, temp, 6, MAX6697_TEMP_CRIT); + +static SENSOR_DEVICE_ATTR_RO(temp8_input, temp_input, 7); +static SENSOR_DEVICE_ATTR_2_RW(temp8_max, temp, 7, MAX6697_TEMP_MAX); +static SENSOR_DEVICE_ATTR_2_RW(temp8_crit, temp, 7, MAX6697_TEMP_CRIT); + +static SENSOR_DEVICE_ATTR_RO(temp1_max_alarm, alarm, 22); +static SENSOR_DEVICE_ATTR_RO(temp2_max_alarm, alarm, 16); +static SENSOR_DEVICE_ATTR_RO(temp3_max_alarm, alarm, 17); +static SENSOR_DEVICE_ATTR_RO(temp4_max_alarm, alarm, 18); +static SENSOR_DEVICE_ATTR_RO(temp5_max_alarm, alarm, 19); +static SENSOR_DEVICE_ATTR_RO(temp6_max_alarm, alarm, 20); +static SENSOR_DEVICE_ATTR_RO(temp7_max_alarm, alarm, 21); +static SENSOR_DEVICE_ATTR_RO(temp8_max_alarm, alarm, 23); + +static SENSOR_DEVICE_ATTR_RO(temp1_crit_alarm, alarm, 15); +static SENSOR_DEVICE_ATTR_RO(temp2_crit_alarm, alarm, 8); +static SENSOR_DEVICE_ATTR_RO(temp3_crit_alarm, alarm, 9); +static SENSOR_DEVICE_ATTR_RO(temp4_crit_alarm, alarm, 10); +static SENSOR_DEVICE_ATTR_RO(temp5_crit_alarm, alarm, 11); +static SENSOR_DEVICE_ATTR_RO(temp6_crit_alarm, alarm, 12); +static SENSOR_DEVICE_ATTR_RO(temp7_crit_alarm, alarm, 13); +static SENSOR_DEVICE_ATTR_RO(temp8_crit_alarm, alarm, 14); + +static SENSOR_DEVICE_ATTR_RO(temp2_fault, alarm, 1); +static SENSOR_DEVICE_ATTR_RO(temp3_fault, alarm, 2); +static SENSOR_DEVICE_ATTR_RO(temp4_fault, alarm, 3); +static SENSOR_DEVICE_ATTR_RO(temp5_fault, alarm, 4); +static SENSOR_DEVICE_ATTR_RO(temp6_fault, alarm, 5); +static SENSOR_DEVICE_ATTR_RO(temp7_fault, alarm, 6); +static SENSOR_DEVICE_ATTR_RO(temp8_fault, alarm, 7); static DEVICE_ATTR(dummy, 0, NULL, NULL); diff --git a/drivers/i2c/i2c-smbus.c b/drivers/i2c/i2c-smbus.c index f9271c713d20..2f55fb417eba 100644 --- a/drivers/i2c/i2c-smbus.c +++ b/drivers/i2c/i2c-smbus.c @@ -43,6 +43,7 @@ static int smbus_do_alert(struct device *dev, void *addrp) struct i2c_client *client = i2c_verify_client(dev); struct alert_data *data = addrp; struct i2c_driver *driver; + int ret; if (!client || client->addr != data->addr) return 0; @@ -56,16 +57,47 @@ static int smbus_do_alert(struct device *dev, void *addrp) device_lock(dev); if (client->dev.driver) { driver = to_i2c_driver(client->dev.driver); - if (driver->alert) + if (driver->alert) { + /* Stop iterating after we find the device */ driver->alert(client, data->type, data->data); - else + ret = -EBUSY; + } else { dev_warn(&client->dev, "no driver alert()!\n"); - } else + ret = -EOPNOTSUPP; + } + } else { dev_dbg(&client->dev, "alert with no driver\n"); + ret = -ENODEV; + } device_unlock(dev); - /* Stop iterating after we find the device */ - return -EBUSY; + return ret; +} + +/* Same as above, but call back all drivers with alert handler */ + +static int smbus_do_alert_force(struct device *dev, void *addrp) +{ + struct i2c_client *client = i2c_verify_client(dev); + struct alert_data *data = addrp; + struct i2c_driver *driver; + + if (!client || (client->flags & I2C_CLIENT_TEN)) + return 0; + + /* + * Drivers should either disable alerts, or provide at least + * a minimal handler. Lock so the driver won't change. + */ + device_lock(dev); + if (client->dev.driver) { + driver = to_i2c_driver(client->dev.driver); + if (driver->alert) + driver->alert(client, data->type, data->data); + } + device_unlock(dev); + + return 0; } /* @@ -76,7 +108,7 @@ static void smbus_alert(struct work_struct *work) { struct i2c_smbus_alert *alert; struct i2c_client *ara; - unsigned short prev_addr = 0; /* Not a valid address */ + unsigned short prev_addr = I2C_CLIENT_END; /* Not a valid address */ alert = container_of(work, struct i2c_smbus_alert, alert); ara = alert->ara; @@ -101,17 +133,28 @@ static void smbus_alert(struct work_struct *work) data.addr = status >> 1; data.type = I2C_PROTOCOL_SMBUS_ALERT; - if (data.addr == prev_addr) { - dev_warn(&ara->dev, "Duplicate SMBALERT# from dev " - "0x%02x, skipping\n", data.addr); - break; - } dev_dbg(&ara->dev, "SMBALERT# from dev 0x%02x, flag %d\n", data.addr, data.data); /* Notify driver for the device which issued the alert */ - device_for_each_child(&ara->adapter->dev, &data, - smbus_do_alert); + status = device_for_each_child(&ara->adapter->dev, &data, + smbus_do_alert); + /* + * If we read the same address more than once, and the alert + * was not handled by a driver, it won't do any good to repeat + * the loop because it will never terminate. Try again, this + * time calling the alert handlers of all devices connected to + * the bus, and abort the loop afterwards. If this helps, we + * are all set. If it doesn't, there is nothing else we can do, + * so we might as well abort the loop. + * Note: This assumes that a driver with alert handler handles + * the alert properly and clears it if necessary. + */ + if (data.addr == prev_addr && status != -EBUSY) { + device_for_each_child(&ara->adapter->dev, &data, + smbus_do_alert_force); + break; + } prev_addr = data.addr; } diff --git a/drivers/infiniband/core/iwcm.c b/drivers/infiniband/core/iwcm.c index 66204e08ce5a..84fa7b727a2b 100644 --- a/drivers/infiniband/core/iwcm.c +++ b/drivers/infiniband/core/iwcm.c @@ -369,8 +369,10 @@ EXPORT_SYMBOL(iw_cm_disconnect); * * Clean up all resources associated with the connection and release * the initial reference taken by iw_create_cm_id. + * + * Returns true if and only if the last cm_id_priv reference has been dropped. */ -static void destroy_cm_id(struct iw_cm_id *cm_id) +static bool destroy_cm_id(struct iw_cm_id *cm_id) { struct iwcm_id_private *cm_id_priv; unsigned long flags; @@ -438,7 +440,7 @@ static void destroy_cm_id(struct iw_cm_id *cm_id) iwpm_remove_mapping(&cm_id->local_addr, RDMA_NL_IWCM); } - (void)iwcm_deref_id(cm_id_priv); + return iwcm_deref_id(cm_id_priv); } /* @@ -449,10 +451,8 @@ static void destroy_cm_id(struct iw_cm_id *cm_id) */ void iw_destroy_cm_id(struct iw_cm_id *cm_id) { - struct iwcm_id_private *cm_id_priv; - - cm_id_priv = container_of(cm_id, struct iwcm_id_private, id); - destroy_cm_id(cm_id); + if (!destroy_cm_id(cm_id)) + flush_workqueue(iwcm_wq); } EXPORT_SYMBOL(iw_destroy_cm_id); @@ -1025,7 +1025,7 @@ static void cm_work_handler(struct work_struct *_work) if (!test_bit(IWCM_F_DROP_EVENTS, &cm_id_priv->flags)) { ret = process_event(cm_id_priv, &levent); if (ret) - destroy_cm_id(&cm_id_priv->id); + WARN_ON_ONCE(destroy_cm_id(&cm_id_priv->id)); } else pr_debug("dropping event %d\n", levent.event); if (iwcm_deref_id(cm_id_priv)) diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index ab218767bf05..489a404aa8ce 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -1878,7 +1878,7 @@ static int bnxt_re_build_send_wqe(struct bnxt_re_qp *qp, break; case IB_WR_SEND_WITH_IMM: wqe->type = BNXT_QPLIB_SWQE_TYPE_SEND_WITH_IMM; - wqe->send.imm_data = wr->ex.imm_data; + wqe->send.imm_data = be32_to_cpu(wr->ex.imm_data); break; case IB_WR_SEND_WITH_INV: wqe->type = BNXT_QPLIB_SWQE_TYPE_SEND_WITH_INV; @@ -1908,7 +1908,7 @@ static int bnxt_re_build_rdma_wqe(struct ib_send_wr *wr, break; case IB_WR_RDMA_WRITE_WITH_IMM: wqe->type = BNXT_QPLIB_SWQE_TYPE_RDMA_WRITE_WITH_IMM; - wqe->rdma.imm_data = wr->ex.imm_data; + wqe->rdma.imm_data = be32_to_cpu(wr->ex.imm_data); break; case IB_WR_RDMA_READ: wqe->type = BNXT_QPLIB_SWQE_TYPE_RDMA_READ; @@ -2833,7 +2833,7 @@ static void bnxt_re_process_res_shadow_qp_wc(struct bnxt_re_qp *qp, wc->byte_len = orig_cqe->length; wc->qp = &qp1_qp->ib_qp; - wc->ex.imm_data = orig_cqe->immdata; + wc->ex.imm_data = cpu_to_be32(le32_to_cpu(orig_cqe->immdata)); wc->src_qp = orig_cqe->src_qp; memcpy(wc->smac, orig_cqe->smac, ETH_ALEN); wc->port_num = 1; @@ -2947,7 +2947,7 @@ int bnxt_re_poll_cq(struct ib_cq *ib_cq, int num_entries, struct ib_wc *wc) continue; } wc->qp = &qp->ib_qp; - wc->ex.imm_data = cqe->immdata; + wc->ex.imm_data = cpu_to_be32(le32_to_cpu(cqe->immdata)); wc->src_qp = cqe->src_qp; memcpy(wc->smac, cqe->smac, ETH_ALEN); wc->port_num = 1; diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.h b/drivers/infiniband/hw/bnxt_re/qplib_fp.h index 8ead70ca1c1d..30e0af39a1ee 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_fp.h +++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.h @@ -123,7 +123,7 @@ struct bnxt_qplib_swqe { /* Send, with imm, inval key */ struct { union { - __be32 imm_data; + u32 imm_data; u32 inv_key; }; u32 q_key; @@ -141,7 +141,7 @@ struct bnxt_qplib_swqe { /* RDMA write, with imm, read */ struct { union { - __be32 imm_data; + u32 imm_data; u32 inv_key; }; u64 remote_va; @@ -327,7 +327,7 @@ struct bnxt_qplib_cqe { u32 length; u64 wr_id; union { - __be32 immdata; + __le32 immdata; u32 invrkey; }; u64 qp_handle; diff --git a/drivers/infiniband/hw/mlx4/alias_GUID.c b/drivers/infiniband/hw/mlx4/alias_GUID.c index baab9afa9174..f2d975c2659d 100644 --- a/drivers/infiniband/hw/mlx4/alias_GUID.c +++ b/drivers/infiniband/hw/mlx4/alias_GUID.c @@ -832,7 +832,7 @@ void mlx4_ib_destroy_alias_guid_service(struct mlx4_ib_dev *dev) int mlx4_ib_init_alias_guid_service(struct mlx4_ib_dev *dev) { - char alias_wq_name[15]; + char alias_wq_name[22]; int ret = 0; int i, j; union ib_gid gid; diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c index 60d4f2c9c24d..46b33244f0bc 100644 --- a/drivers/infiniband/hw/mlx4/mad.c +++ b/drivers/infiniband/hw/mlx4/mad.c @@ -2170,7 +2170,7 @@ static int mlx4_ib_alloc_demux_ctx(struct mlx4_ib_dev *dev, struct mlx4_ib_demux_ctx *ctx, int port) { - char name[12]; + char name[21]; int ret = 0; int i; diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c index 5d0f4c0120ac..3543c1bf048f 100644 --- a/drivers/infiniband/sw/rxe/rxe_req.c +++ b/drivers/infiniband/sw/rxe/rxe_req.c @@ -390,7 +390,7 @@ static struct sk_buff *init_req_packet(struct rxe_qp *qp, int solicited; u16 pkey; u32 qp_num; - int ack_req; + int ack_req = 0; /* length from start of bth to end of icrc */ paylen = rxe_opcode[opcode].length + payload + pad + RXE_ICRC_SIZE; @@ -426,8 +426,9 @@ static struct sk_buff *init_req_packet(struct rxe_qp *qp, qp_num = (pkt->mask & RXE_DETH_MASK) ? ibwr->wr.ud.remote_qpn : qp->attr.dest_qp_num; - ack_req = ((pkt->mask & RXE_END_MASK) || - (qp->req.noack_pkts++ > RXE_MAX_PKT_PER_ACK)); + if (qp_type(qp) != IB_QPT_UD && qp_type(qp) != IB_QPT_UC) + ack_req = ((pkt->mask & RXE_END_MASK) || + (qp->req.noack_pkts++ > RXE_MAX_PKT_PER_ACK)); if (ack_req) qp->req.noack_pkts = 0; diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c index 3c7281248432..ec610e81e724 100644 --- a/drivers/input/mouse/elan_i2c_core.c +++ b/drivers/input/mouse/elan_i2c_core.c @@ -1185,6 +1185,8 @@ static int __maybe_unused elan_suspend(struct device *dev) } err: + if (ret) + enable_irq(client->irq); mutex_unlock(&data->sysfs_mutex); return ret; } diff --git a/drivers/irqchip/irq-mbigen.c b/drivers/irqchip/irq-mbigen.c index c98358be0bc8..19cf1239c7d3 100644 --- a/drivers/irqchip/irq-mbigen.c +++ b/drivers/irqchip/irq-mbigen.c @@ -75,6 +75,20 @@ struct mbigen_device { void __iomem *base; }; +static inline unsigned int get_mbigen_node_offset(unsigned int nid) +{ + unsigned int offset = nid * MBIGEN_NODE_OFFSET; + + /* + * To avoid touched clear register in unexpected way, we need to directly + * skip clear register when access to more than 10 mbigen nodes. + */ + if (nid >= (REG_MBIGEN_CLEAR_OFFSET / MBIGEN_NODE_OFFSET)) + offset += MBIGEN_NODE_OFFSET; + + return offset; +} + static inline unsigned int get_mbigen_vec_reg(irq_hw_number_t hwirq) { unsigned int nid, pin; @@ -83,8 +97,7 @@ static inline unsigned int get_mbigen_vec_reg(irq_hw_number_t hwirq) nid = hwirq / IRQS_PER_MBIGEN_NODE + 1; pin = hwirq % IRQS_PER_MBIGEN_NODE; - return pin * 4 + nid * MBIGEN_NODE_OFFSET - + REG_MBIGEN_VEC_OFFSET; + return pin * 4 + get_mbigen_node_offset(nid) + REG_MBIGEN_VEC_OFFSET; } static inline void get_mbigen_type_reg(irq_hw_number_t hwirq, @@ -99,8 +112,7 @@ static inline void get_mbigen_type_reg(irq_hw_number_t hwirq, *mask = 1 << (irq_ofst % 32); ofst = irq_ofst / 32 * 4; - *addr = ofst + nid * MBIGEN_NODE_OFFSET - + REG_MBIGEN_TYPE_OFFSET; + *addr = ofst + get_mbigen_node_offset(nid) + REG_MBIGEN_TYPE_OFFSET; } static inline void get_mbigen_clear_reg(irq_hw_number_t hwirq, diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c b/drivers/isdn/hardware/mISDN/hfcmulti.c index cb86b9bd5c7c..e856f90464e1 100644 --- a/drivers/isdn/hardware/mISDN/hfcmulti.c +++ b/drivers/isdn/hardware/mISDN/hfcmulti.c @@ -1945,7 +1945,7 @@ hfcmulti_dtmf(struct hfc_multi *hc) static void hfcmulti_tx(struct hfc_multi *hc, int ch) { - int i, ii, temp, len = 0; + int i, ii, temp, tmp_len, len = 0; int Zspace, z1, z2; /* must be int for calculation */ int Fspace, f1, f2; u_char *d; @@ -2166,14 +2166,15 @@ hfcmulti_tx(struct hfc_multi *hc, int ch) HFC_wait_nodebug(hc); } + tmp_len = (*sp)->len; dev_kfree_skb(*sp); /* check for next frame */ if (bch && get_next_bframe(bch)) { - len = (*sp)->len; + len = tmp_len; goto next_frame; } if (dch && get_next_dframe(dch)) { - len = (*sp)->len; + len = tmp_len; goto next_frame; } diff --git a/drivers/leds/leds-ss4200.c b/drivers/leds/leds-ss4200.c index a9db8674cd02..0e19fceb3769 100644 --- a/drivers/leds/leds-ss4200.c +++ b/drivers/leds/leds-ss4200.c @@ -368,8 +368,10 @@ static int ich7_lpc_probe(struct pci_dev *dev, nas_gpio_pci_dev = dev; status = pci_read_config_dword(dev, PMBASE, &g_pm_io_base); - if (status) + if (status) { + status = pcibios_err_to_errno(status); goto out; + } g_pm_io_base &= 0x00000ff80; status = pci_read_config_dword(dev, GPIO_CTRL, &gc); @@ -381,8 +383,9 @@ static int ich7_lpc_probe(struct pci_dev *dev, } status = pci_read_config_dword(dev, GPIO_BASE, &nas_gpio_io_base); - if (0 > status) { + if (status) { dev_info(&dev->dev, "Unable to read GPIOBASE.\n"); + status = pcibios_err_to_errno(status); goto out; } dev_dbg(&dev->dev, ": GPIOBASE = 0x%08x\n", nas_gpio_io_base); diff --git a/drivers/macintosh/therm_windtunnel.c b/drivers/macintosh/therm_windtunnel.c index 68dcbcb4fc5b..d4cb53e65186 100644 --- a/drivers/macintosh/therm_windtunnel.c +++ b/drivers/macintosh/therm_windtunnel.c @@ -518,7 +518,7 @@ g4fan_exit( void ) platform_driver_unregister( &therm_of_driver ); if( x.of_dev ) - of_device_unregister( x.of_dev ); + of_platform_device_destroy(&x.of_dev->dev, NULL); } module_init(g4fan_init); diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index a8b3beb0aa3a..f38c87ea435c 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -5814,7 +5814,9 @@ static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr, int *sk safepos = conf->reshape_safe; sector_div(safepos, data_disks); if (mddev->reshape_backwards) { - BUG_ON(writepos < reshape_sectors); + if (WARN_ON(writepos < reshape_sectors)) + return MaxSector; + writepos -= reshape_sectors; readpos += reshape_sectors; safepos += reshape_sectors; @@ -5832,14 +5834,18 @@ static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr, int *sk * to set 'stripe_addr' which is where we will write to. */ if (mddev->reshape_backwards) { - BUG_ON(conf->reshape_progress == 0); + if (WARN_ON(conf->reshape_progress == 0)) + return MaxSector; + stripe_addr = writepos; - BUG_ON((mddev->dev_sectors & - ~((sector_t)reshape_sectors - 1)) - - reshape_sectors - stripe_addr - != sector_nr); + if (WARN_ON((mddev->dev_sectors & + ~((sector_t)reshape_sectors - 1)) - + reshape_sectors - stripe_addr != sector_nr)) + return MaxSector; } else { - BUG_ON(writepos != sector_nr + reshape_sectors); + if (WARN_ON(writepos != sector_nr + reshape_sectors)) + return MaxSector; + stripe_addr = sector_nr; } diff --git a/drivers/media/pci/saa7134/saa7134-dvb.c b/drivers/media/pci/saa7134/saa7134-dvb.c index 731dee0a66e7..b41d747d42ba 100644 --- a/drivers/media/pci/saa7134/saa7134-dvb.c +++ b/drivers/media/pci/saa7134/saa7134-dvb.c @@ -475,7 +475,9 @@ static int philips_europa_tuner_sleep(struct dvb_frontend *fe) /* switch the board to analog mode */ if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 1); - i2c_transfer(&dev->i2c_adap, &analog_msg, 1); + if (i2c_transfer(&dev->i2c_adap, &analog_msg, 1) != 1) + return -EIO; + return 0; } @@ -1027,7 +1029,9 @@ static int md8800_set_voltage2(struct dvb_frontend *fe, else wbuf[1] = rbuf & 0xef; msg[0].len = 2; - i2c_transfer(&dev->i2c_adap, msg, 1); + if (i2c_transfer(&dev->i2c_adap, msg, 1) != 1) + return -EIO; + return 0; } diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 5f0965593a0d..c97f60588361 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -1039,6 +1039,7 @@ static int vdec_close(struct file *file) { struct venus_inst *inst = to_inst(file); + cancel_work_sync(&inst->delayed_process_work); v4l2_m2m_ctx_release(inst->m2m_ctx); v4l2_m2m_release(inst->m2m_dev); vdec_ctrl_deinit(inst); diff --git a/drivers/media/platform/vsp1/vsp1_drm.c b/drivers/media/platform/vsp1/vsp1_drm.c index d3cd57f6ba52..037b694f469f 100644 --- a/drivers/media/platform/vsp1/vsp1_drm.c +++ b/drivers/media/platform/vsp1/vsp1_drm.c @@ -119,6 +119,7 @@ int vsp1_du_setup_lif(struct device *dev, unsigned int pipe_index, * inputs. */ WARN_ON(list_empty(&rpf->entity.list_pipe)); + rpf->entity.pipe = NULL; list_del_init(&rpf->entity.list_pipe); pipe->inputs[i] = NULL; @@ -535,8 +536,10 @@ void vsp1_du_atomic_flush(struct device *dev, unsigned int pipe_index) continue; } - if (list_empty(&rpf->entity.list_pipe)) + if (list_empty(&rpf->entity.list_pipe)) { + rpf->entity.pipe = pipe; list_add_tail(&rpf->entity.list_pipe, &pipe->entities); + } bru->inputs[i].rpf = rpf; rpf->bru_input = i; @@ -561,6 +564,7 @@ void vsp1_du_atomic_flush(struct device *dev, unsigned int pipe_index) vsp1_dl_list_write(dl, entity->route->reg, VI6_DPR_NODE_UNUSED); + entity->pipe = NULL; list_del_init(&entity->list_pipe); continue; @@ -633,24 +637,28 @@ int vsp1_drm_init(struct vsp1_device *vsp1) vsp1_pipeline_init(pipe); + pipe->frame_end = vsp1_du_pipeline_frame_end; + /* * The DRM pipeline is static, add entities manually. The first * pipeline uses the BRU and the second pipeline the BRS. */ pipe->bru = i == 0 ? &vsp1->bru->entity : &vsp1->brs->entity; - pipe->lif = &vsp1->lif[i]->entity; pipe->output = vsp1->wpf[i]; - pipe->output->pipe = pipe; - pipe->frame_end = vsp1_du_pipeline_frame_end; + pipe->lif = &vsp1->lif[i]->entity; + pipe->bru->pipe = pipe; pipe->bru->sink = &pipe->output->entity; pipe->bru->sink_pad = 0; + list_add_tail(&pipe->bru->list_pipe, &pipe->entities); + + pipe->output->entity.pipe = pipe; pipe->output->entity.sink = pipe->lif; pipe->output->entity.sink_pad = 0; + list_add_tail(&pipe->output->entity.list_pipe, &pipe->entities); - list_add_tail(&pipe->bru->list_pipe, &pipe->entities); + pipe->lif->pipe = pipe; list_add_tail(&pipe->lif->list_pipe, &pipe->entities); - list_add_tail(&pipe->output->entity.list_pipe, &pipe->entities); } /* Disable all RPFs initially. */ diff --git a/drivers/media/platform/vsp1/vsp1_drv.c b/drivers/media/platform/vsp1/vsp1_drv.c index 1b0c236e70fd..bd46d3203fbd 100644 --- a/drivers/media/platform/vsp1/vsp1_drv.c +++ b/drivers/media/platform/vsp1/vsp1_drv.c @@ -63,7 +63,7 @@ static irqreturn_t vsp1_irq_handler(int irq, void *data) vsp1_write(vsp1, VI6_WPF_IRQ_STA(i), ~status & mask); if (status & VI6_WFP_IRQ_STA_DFE) { - vsp1_pipeline_frame_end(wpf->pipe); + vsp1_pipeline_frame_end(wpf->entity.pipe); ret = IRQ_HANDLED; } } diff --git a/drivers/media/platform/vsp1/vsp1_entity.h b/drivers/media/platform/vsp1/vsp1_entity.h index 408602ebeb97..c26523c56c05 100644 --- a/drivers/media/platform/vsp1/vsp1_entity.h +++ b/drivers/media/platform/vsp1/vsp1_entity.h @@ -106,6 +106,8 @@ struct vsp1_entity { unsigned int index; const struct vsp1_route *route; + struct vsp1_pipeline *pipe; + struct list_head list_dev; struct list_head list_pipe; diff --git a/drivers/media/platform/vsp1/vsp1_histo.c b/drivers/media/platform/vsp1/vsp1_histo.c index afab77cf4fa5..142a55298a44 100644 --- a/drivers/media/platform/vsp1/vsp1_histo.c +++ b/drivers/media/platform/vsp1/vsp1_histo.c @@ -40,9 +40,8 @@ struct vsp1_histogram_buffer * vsp1_histogram_buffer_get(struct vsp1_histogram *histo) { struct vsp1_histogram_buffer *buf = NULL; - unsigned long flags; - spin_lock_irqsave(&histo->irqlock, flags); + spin_lock(&histo->irqlock); if (list_empty(&histo->irqqueue)) goto done; @@ -53,7 +52,7 @@ vsp1_histogram_buffer_get(struct vsp1_histogram *histo) histo->readout = true; done: - spin_unlock_irqrestore(&histo->irqlock, flags); + spin_unlock(&histo->irqlock); return buf; } @@ -61,8 +60,7 @@ void vsp1_histogram_buffer_complete(struct vsp1_histogram *histo, struct vsp1_histogram_buffer *buf, size_t size) { - struct vsp1_pipeline *pipe = histo->pipe; - unsigned long flags; + struct vsp1_pipeline *pipe = histo->entity.pipe; /* * The pipeline pointer is guaranteed to be valid as this function is @@ -74,10 +72,10 @@ void vsp1_histogram_buffer_complete(struct vsp1_histogram *histo, vb2_set_plane_payload(&buf->buf.vb2_buf, 0, size); vb2_buffer_done(&buf->buf.vb2_buf, VB2_BUF_STATE_DONE); - spin_lock_irqsave(&histo->irqlock, flags); + spin_lock(&histo->irqlock); histo->readout = false; wake_up(&histo->wait_queue); - spin_unlock_irqrestore(&histo->irqlock, flags); + spin_unlock(&histo->irqlock); } /* ----------------------------------------------------------------------------- @@ -128,11 +126,10 @@ static void histo_buffer_queue(struct vb2_buffer *vb) struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); struct vsp1_histogram *histo = vb2_get_drv_priv(vb->vb2_queue); struct vsp1_histogram_buffer *buf = to_vsp1_histogram_buffer(vbuf); - unsigned long flags; - spin_lock_irqsave(&histo->irqlock, flags); + spin_lock_irq(&histo->irqlock); list_add_tail(&buf->queue, &histo->irqqueue); - spin_unlock_irqrestore(&histo->irqlock, flags); + spin_unlock_irq(&histo->irqlock); } static int histo_start_streaming(struct vb2_queue *vq, unsigned int count) @@ -144,9 +141,8 @@ static void histo_stop_streaming(struct vb2_queue *vq) { struct vsp1_histogram *histo = vb2_get_drv_priv(vq); struct vsp1_histogram_buffer *buffer; - unsigned long flags; - spin_lock_irqsave(&histo->irqlock, flags); + spin_lock_irq(&histo->irqlock); /* Remove all buffers from the IRQ queue. */ list_for_each_entry(buffer, &histo->irqqueue, queue) @@ -156,7 +152,7 @@ static void histo_stop_streaming(struct vb2_queue *vq) /* Wait for the buffer being read out (if any) to complete. */ wait_event_lock_irq(histo->wait_queue, !histo->readout, histo->irqlock); - spin_unlock_irqrestore(&histo->irqlock, flags); + spin_unlock_irq(&histo->irqlock); } static const struct vb2_ops histo_video_queue_qops = { diff --git a/drivers/media/platform/vsp1/vsp1_histo.h b/drivers/media/platform/vsp1/vsp1_histo.h index af2874f6031d..e774adbf251f 100644 --- a/drivers/media/platform/vsp1/vsp1_histo.h +++ b/drivers/media/platform/vsp1/vsp1_histo.h @@ -25,7 +25,6 @@ #include "vsp1_entity.h" struct vsp1_device; -struct vsp1_pipeline; #define HISTO_PAD_SINK 0 #define HISTO_PAD_SOURCE 1 @@ -37,8 +36,6 @@ struct vsp1_histogram_buffer { }; struct vsp1_histogram { - struct vsp1_pipeline *pipe; - struct vsp1_entity entity; struct video_device video; struct media_pad pad; diff --git a/drivers/media/platform/vsp1/vsp1_pipe.c b/drivers/media/platform/vsp1/vsp1_pipe.c index 44944ac86d9b..99ccbac3256a 100644 --- a/drivers/media/platform/vsp1/vsp1_pipe.c +++ b/drivers/media/platform/vsp1/vsp1_pipe.c @@ -185,6 +185,7 @@ const struct vsp1_format_info *vsp1_get_format_info(struct vsp1_device *vsp1, void vsp1_pipeline_reset(struct vsp1_pipeline *pipe) { + struct vsp1_entity *entity; unsigned int i; if (pipe->bru) { @@ -194,29 +195,13 @@ void vsp1_pipeline_reset(struct vsp1_pipeline *pipe) bru->inputs[i].rpf = NULL; } - for (i = 0; i < ARRAY_SIZE(pipe->inputs); ++i) { - if (pipe->inputs[i]) { - pipe->inputs[i]->pipe = NULL; - pipe->inputs[i] = NULL; - } - } - - if (pipe->output) { - pipe->output->pipe = NULL; - pipe->output = NULL; - } + for (i = 0; i < ARRAY_SIZE(pipe->inputs); ++i) + pipe->inputs[i] = NULL; - if (pipe->hgo) { - struct vsp1_hgo *hgo = to_hgo(&pipe->hgo->subdev); + pipe->output = NULL; - hgo->histo.pipe = NULL; - } - - if (pipe->hgt) { - struct vsp1_hgt *hgt = to_hgt(&pipe->hgt->subdev); - - hgt->histo.pipe = NULL; - } + list_for_each_entry(entity, &pipe->entities, list_pipe) + entity->pipe = NULL; INIT_LIST_HEAD(&pipe->entities); pipe->state = VSP1_PIPELINE_STOPPED; @@ -423,7 +408,7 @@ void vsp1_pipelines_suspend(struct vsp1_device *vsp1) if (wpf == NULL) continue; - pipe = wpf->pipe; + pipe = wpf->entity.pipe; if (pipe == NULL) continue; @@ -440,7 +425,7 @@ void vsp1_pipelines_suspend(struct vsp1_device *vsp1) if (wpf == NULL) continue; - pipe = wpf->pipe; + pipe = wpf->entity.pipe; if (pipe == NULL) continue; @@ -465,7 +450,7 @@ void vsp1_pipelines_resume(struct vsp1_device *vsp1) if (wpf == NULL) continue; - pipe = wpf->pipe; + pipe = wpf->entity.pipe; if (pipe == NULL) continue; diff --git a/drivers/media/platform/vsp1/vsp1_pipe.h b/drivers/media/platform/vsp1/vsp1_pipe.h index dfff9b5685fe..5361b0ba3164 100644 --- a/drivers/media/platform/vsp1/vsp1_pipe.h +++ b/drivers/media/platform/vsp1/vsp1_pipe.h @@ -77,7 +77,7 @@ struct vsp1_partition_window { * @wpf: The WPF partition window configuration */ struct vsp1_partition { - struct vsp1_partition_window rpf; + struct vsp1_partition_window rpf[VSP1_MAX_RPF]; struct vsp1_partition_window uds_sink; struct vsp1_partition_window uds_source; struct vsp1_partition_window sru; diff --git a/drivers/media/platform/vsp1/vsp1_rpf.c b/drivers/media/platform/vsp1/vsp1_rpf.c index fe0633da5a5f..f586b5726bdd 100644 --- a/drivers/media/platform/vsp1/vsp1_rpf.c +++ b/drivers/media/platform/vsp1/vsp1_rpf.c @@ -97,8 +97,8 @@ static void rpf_configure(struct vsp1_entity *entity, * 'width' need to be adjusted. */ if (pipe->partitions > 1) { - crop.width = pipe->partition->rpf.width; - crop.left += pipe->partition->rpf.left; + crop.width = pipe->partition->rpf[rpf->entity.index].width; + crop.left += pipe->partition->rpf[rpf->entity.index].left; } vsp1_rpf_write(rpf, dl, VI6_RPF_SRC_BSIZE, @@ -253,7 +253,9 @@ static void rpf_partition(struct vsp1_entity *entity, unsigned int partition_idx, struct vsp1_partition_window *window) { - partition->rpf = *window; + struct vsp1_rwpf *rpf = to_rwpf(&entity->subdev); + + partition->rpf[rpf->entity.index] = *window; } static const struct vsp1_entity_operations rpf_entity_ops = { diff --git a/drivers/media/platform/vsp1/vsp1_rwpf.h b/drivers/media/platform/vsp1/vsp1_rwpf.h index 58215a7ab631..c94ac89abfa7 100644 --- a/drivers/media/platform/vsp1/vsp1_rwpf.h +++ b/drivers/media/platform/vsp1/vsp1_rwpf.h @@ -27,7 +27,6 @@ struct v4l2_ctrl; struct vsp1_dl_manager; -struct vsp1_pipeline; struct vsp1_rwpf; struct vsp1_video; @@ -39,7 +38,6 @@ struct vsp1_rwpf { struct vsp1_entity entity; struct v4l2_ctrl_handler ctrls; - struct vsp1_pipeline *pipe; struct vsp1_video *video; unsigned int max_width; diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c index 93f69b3ac911..e88be9cd2a0f 100644 --- a/drivers/media/platform/vsp1/vsp1_video.c +++ b/drivers/media/platform/vsp1/vsp1_video.c @@ -324,7 +324,7 @@ static int vsp1_video_pipeline_setup_partitions(struct vsp1_pipeline *pipe) static struct vsp1_vb2_buffer * vsp1_video_complete_buffer(struct vsp1_video *video) { - struct vsp1_pipeline *pipe = video->rwpf->pipe; + struct vsp1_pipeline *pipe = video->rwpf->entity.pipe; struct vsp1_vb2_buffer *next = NULL; struct vsp1_vb2_buffer *done; unsigned long flags; @@ -598,20 +598,19 @@ static int vsp1_video_pipeline_build(struct vsp1_pipeline *pipe, subdev = media_entity_to_v4l2_subdev(entity); e = to_vsp1_entity(subdev); list_add_tail(&e->list_pipe, &pipe->entities); + e->pipe = pipe; switch (e->type) { case VSP1_ENTITY_RPF: rwpf = to_rwpf(subdev); pipe->inputs[rwpf->entity.index] = rwpf; rwpf->video->pipe_index = ++pipe->num_inputs; - rwpf->pipe = pipe; break; case VSP1_ENTITY_WPF: rwpf = to_rwpf(subdev); pipe->output = rwpf; rwpf->video->pipe_index = 0; - rwpf->pipe = pipe; break; case VSP1_ENTITY_LIF: @@ -625,12 +624,10 @@ static int vsp1_video_pipeline_build(struct vsp1_pipeline *pipe, case VSP1_ENTITY_HGO: pipe->hgo = e; - to_hgo(subdev)->histo.pipe = pipe; break; case VSP1_ENTITY_HGT: pipe->hgt = e; - to_hgt(subdev)->histo.pipe = pipe; break; default: @@ -682,7 +679,7 @@ static struct vsp1_pipeline *vsp1_video_pipeline_get(struct vsp1_video *video) * Otherwise allocate a new pipeline and initialize it, it will be freed * when the last reference is released. */ - if (!video->rwpf->pipe) { + if (!video->rwpf->entity.pipe) { pipe = kzalloc(sizeof(*pipe), GFP_KERNEL); if (!pipe) return ERR_PTR(-ENOMEM); @@ -694,7 +691,7 @@ static struct vsp1_pipeline *vsp1_video_pipeline_get(struct vsp1_video *video) return ERR_PTR(ret); } } else { - pipe = video->rwpf->pipe; + pipe = video->rwpf->entity.pipe; kref_get(&pipe->kref); } @@ -777,7 +774,7 @@ static void vsp1_video_buffer_queue(struct vb2_buffer *vb) { struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); struct vsp1_video *video = vb2_get_drv_priv(vb->vb2_queue); - struct vsp1_pipeline *pipe = video->rwpf->pipe; + struct vsp1_pipeline *pipe = video->rwpf->entity.pipe; struct vsp1_vb2_buffer *buf = to_vsp1_vb2_buffer(vbuf); unsigned long flags; bool empty; @@ -877,7 +874,7 @@ static void vsp1_video_cleanup_pipeline(struct vsp1_pipeline *pipe) static int vsp1_video_start_streaming(struct vb2_queue *vq, unsigned int count) { struct vsp1_video *video = vb2_get_drv_priv(vq); - struct vsp1_pipeline *pipe = video->rwpf->pipe; + struct vsp1_pipeline *pipe = video->rwpf->entity.pipe; bool start_pipeline = false; unsigned long flags; int ret; @@ -919,7 +916,7 @@ static int vsp1_video_start_streaming(struct vb2_queue *vq, unsigned int count) static void vsp1_video_stop_streaming(struct vb2_queue *vq) { struct vsp1_video *video = vb2_get_drv_priv(vq); - struct vsp1_pipeline *pipe = video->rwpf->pipe; + struct vsp1_pipeline *pipe = video->rwpf->entity.pipe; unsigned long flags; int ret; diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index 50951c31ff5b..875e00e4a8a0 100644 --- a/drivers/media/rc/imon.c +++ b/drivers/media/rc/imon.c @@ -1150,10 +1150,7 @@ static int imon_ir_change_protocol(struct rc_dev *rc, u64 *rc_proto) memcpy(ictx->usb_tx_buf, &ir_proto_packet, sizeof(ir_proto_packet)); - if (!mutex_is_locked(&ictx->lock)) { - unlock = true; - mutex_lock(&ictx->lock); - } + unlock = mutex_trylock(&ictx->lock); retval = send_packet(ictx); if (retval) diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c index a0440f095515..9703b76a77b8 100644 --- a/drivers/media/usb/uvc/uvc_video.c +++ b/drivers/media/usb/uvc/uvc_video.c @@ -167,13 +167,13 @@ static void uvc_fixup_video_ctrl(struct uvc_streaming *stream, /* Compute a bandwidth estimation by multiplying the frame * size by the number of video frames per second, divide the * result by the number of USB frames (or micro-frames for - * high-speed devices) per second and add the UVC header size - * (assumed to be 12 bytes long). + * high- and super-speed devices) per second and add the UVC + * header size (assumed to be 12 bytes long). */ bandwidth = frame->wWidth * frame->wHeight / 8 * format->bpp; bandwidth *= 10000000 / interval + 1; bandwidth /= 1000; - if (stream->dev->udev->speed == USB_SPEED_HIGH) + if (stream->dev->udev->speed >= USB_SPEED_HIGH) bandwidth /= 8; bandwidth += 12; @@ -428,6 +428,7 @@ uvc_video_clock_decode(struct uvc_streaming *stream, struct uvc_buffer *buf, struct timespec ts; u16 host_sof; u16 dev_sof; + u32 dev_stc; switch (data[1] & (UVC_STREAM_PTS | UVC_STREAM_SCR)) { case UVC_STREAM_PTS | UVC_STREAM_SCR: @@ -472,6 +473,34 @@ uvc_video_clock_decode(struct uvc_streaming *stream, struct uvc_buffer *buf, if (dev_sof == stream->clock.last_sof) return; + dev_stc = get_unaligned_le32(&data[header_size - 6]); + + /* + * STC (Source Time Clock) is the clock used by the camera. The UVC 1.5 + * standard states that it "must be captured when the first video data + * of a video frame is put on the USB bus". This is generally understood + * as requiring devices to clear the payload header's SCR bit before + * the first packet containing video data. + * + * Most vendors follow that interpretation, but some (namely SunplusIT + * on some devices) always set the `UVC_STREAM_SCR` bit, fill the SCR + * field with 0's,and expect that the driver only processes the SCR if + * there is data in the packet. + * + * Ignore all the hardware timestamp information if we haven't received + * any data for this frame yet, the packet contains no data, and both + * STC and SOF are zero. This heuristics should be safe on compliant + * devices. This should be safe with compliant devices, as in the very + * unlikely case where a UVC 1.1 device would send timing information + * only before the first packet containing data, and both STC and SOF + * happen to be zero for a particular frame, we would only miss one + * clock sample from many and the clock recovery algorithm wouldn't + * suffer from this condition. + */ + if (buf && buf->bytesused == 0 && len == header_size && + dev_stc == 0 && dev_sof == 0) + return; + stream->clock.last_sof = dev_sof; host_sof = usb_get_current_frame_number(stream->dev->udev); @@ -509,7 +538,7 @@ uvc_video_clock_decode(struct uvc_streaming *stream, struct uvc_buffer *buf, spin_lock_irqsave(&stream->clock.lock, flags); sample = &stream->clock.samples[stream->clock.head]; - sample->dev_stc = get_unaligned_le32(&data[header_size - 6]); + sample->dev_stc = dev_stc; sample->dev_sof = dev_sof; sample->host_sof = host_sof; sample->host_ts = ts; diff --git a/drivers/mtd/tests/Makefile b/drivers/mtd/tests/Makefile index 5de0378f90db..7dae831ee8b6 100644 --- a/drivers/mtd/tests/Makefile +++ b/drivers/mtd/tests/Makefile @@ -1,19 +1,19 @@ # SPDX-License-Identifier: GPL-2.0 -obj-$(CONFIG_MTD_TESTS) += mtd_oobtest.o -obj-$(CONFIG_MTD_TESTS) += mtd_pagetest.o -obj-$(CONFIG_MTD_TESTS) += mtd_readtest.o -obj-$(CONFIG_MTD_TESTS) += mtd_speedtest.o -obj-$(CONFIG_MTD_TESTS) += mtd_stresstest.o -obj-$(CONFIG_MTD_TESTS) += mtd_subpagetest.o -obj-$(CONFIG_MTD_TESTS) += mtd_torturetest.o -obj-$(CONFIG_MTD_TESTS) += mtd_nandecctest.o -obj-$(CONFIG_MTD_TESTS) += mtd_nandbiterrs.o +obj-$(CONFIG_MTD_TESTS) += mtd_oobtest.o mtd_test.o +obj-$(CONFIG_MTD_TESTS) += mtd_pagetest.o mtd_test.o +obj-$(CONFIG_MTD_TESTS) += mtd_readtest.o mtd_test.o +obj-$(CONFIG_MTD_TESTS) += mtd_speedtest.o mtd_test.o +obj-$(CONFIG_MTD_TESTS) += mtd_stresstest.o mtd_test.o +obj-$(CONFIG_MTD_TESTS) += mtd_subpagetest.o mtd_test.o +obj-$(CONFIG_MTD_TESTS) += mtd_torturetest.o mtd_test.o +obj-$(CONFIG_MTD_TESTS) += mtd_nandecctest.o mtd_test.o +obj-$(CONFIG_MTD_TESTS) += mtd_nandbiterrs.o mtd_test.o -mtd_oobtest-objs := oobtest.o mtd_test.o -mtd_pagetest-objs := pagetest.o mtd_test.o -mtd_readtest-objs := readtest.o mtd_test.o -mtd_speedtest-objs := speedtest.o mtd_test.o -mtd_stresstest-objs := stresstest.o mtd_test.o -mtd_subpagetest-objs := subpagetest.o mtd_test.o -mtd_torturetest-objs := torturetest.o mtd_test.o -mtd_nandbiterrs-objs := nandbiterrs.o mtd_test.o +mtd_oobtest-objs := oobtest.o +mtd_pagetest-objs := pagetest.o +mtd_readtest-objs := readtest.o +mtd_speedtest-objs := speedtest.o +mtd_stresstest-objs := stresstest.o +mtd_subpagetest-objs := subpagetest.o +mtd_torturetest-objs := torturetest.o +mtd_nandbiterrs-objs := nandbiterrs.o diff --git a/drivers/mtd/tests/mtd_test.c b/drivers/mtd/tests/mtd_test.c index 3d0b8b5c1a53..ab508a224b49 100644 --- a/drivers/mtd/tests/mtd_test.c +++ b/drivers/mtd/tests/mtd_test.c @@ -30,6 +30,7 @@ int mtdtest_erase_eraseblock(struct mtd_info *mtd, unsigned int ebnum) } return 0; } +EXPORT_SYMBOL_GPL(mtdtest_erase_eraseblock); static int is_block_bad(struct mtd_info *mtd, unsigned int ebnum) { @@ -62,6 +63,7 @@ int mtdtest_scan_for_bad_eraseblocks(struct mtd_info *mtd, unsigned char *bbt, return 0; } +EXPORT_SYMBOL_GPL(mtdtest_scan_for_bad_eraseblocks); int mtdtest_erase_good_eraseblocks(struct mtd_info *mtd, unsigned char *bbt, unsigned int eb, int ebcnt) @@ -80,6 +82,7 @@ int mtdtest_erase_good_eraseblocks(struct mtd_info *mtd, unsigned char *bbt, return 0; } +EXPORT_SYMBOL_GPL(mtdtest_erase_good_eraseblocks); int mtdtest_read(struct mtd_info *mtd, loff_t addr, size_t size, void *buf) { @@ -97,6 +100,7 @@ int mtdtest_read(struct mtd_info *mtd, loff_t addr, size_t size, void *buf) return err; } +EXPORT_SYMBOL_GPL(mtdtest_read); int mtdtest_write(struct mtd_info *mtd, loff_t addr, size_t size, const void *buf) @@ -112,3 +116,8 @@ int mtdtest_write(struct mtd_info *mtd, loff_t addr, size_t size, return err; } +EXPORT_SYMBOL_GPL(mtdtest_write); + +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("MTD function test helpers"); +MODULE_AUTHOR("Akinobu Mita"); diff --git a/drivers/mtd/ubi/eba.c b/drivers/mtd/ubi/eba.c index b7aa8cf2c3d7..489fc36fe8cb 100644 --- a/drivers/mtd/ubi/eba.c +++ b/drivers/mtd/ubi/eba.c @@ -1554,6 +1554,7 @@ int self_check_eba(struct ubi_device *ubi, struct ubi_attach_info *ai_fastmap, GFP_KERNEL); if (!fm_eba[i]) { ret = -ENOMEM; + kfree(scan_eba[i]); goto out_free; } @@ -1589,7 +1590,7 @@ int self_check_eba(struct ubi_device *ubi, struct ubi_attach_info *ai_fastmap, } out_free: - for (i = 0; i < num_volumes; i++) { + while (--i >= 0) { if (!ubi->volumes[i]) continue; diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 3b5518276ef0..7540340d504c 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -774,13 +774,10 @@ static struct slave *bond_find_best_slave(struct bonding *bond) return bestslave; } +/* must be called in RCU critical section or with RTNL held */ static bool bond_should_notify_peers(struct bonding *bond) { - struct slave *slave; - - rcu_read_lock(); - slave = rcu_dereference(bond->curr_active_slave); - rcu_read_unlock(); + struct slave *slave = rcu_dereference_rtnl(bond->curr_active_slave); if (!slave || !bond->send_peer_notif || !netif_carrier_ok(bond->dev) || diff --git a/drivers/net/ethernet/brocade/bna/bna_types.h b/drivers/net/ethernet/brocade/bna/bna_types.h index c438d032e8bf..1af883c849ad 100644 --- a/drivers/net/ethernet/brocade/bna/bna_types.h +++ b/drivers/net/ethernet/brocade/bna/bna_types.h @@ -418,7 +418,7 @@ struct bna_ib { /* Tx object */ /* Tx datapath control structure */ -#define BNA_Q_NAME_SIZE 16 +#define BNA_Q_NAME_SIZE (IFNAMSIZ + 6) struct bna_tcb { /* Fast path */ void **sw_qpt; diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c index 38a77a5d9a44..dc59733ea03d 100644 --- a/drivers/net/ethernet/brocade/bna/bnad.c +++ b/drivers/net/ethernet/brocade/bna/bnad.c @@ -1543,8 +1543,9 @@ bnad_tx_msix_register(struct bnad *bnad, struct bnad_tx_info *tx_info, for (i = 0; i < num_txqs; i++) { vector_num = tx_info->tcb[i]->intr_vector; - sprintf(tx_info->tcb[i]->name, "%s TXQ %d", bnad->netdev->name, - tx_id + tx_info->tcb[i]->id); + snprintf(tx_info->tcb[i]->name, BNA_Q_NAME_SIZE, "%s TXQ %d", + bnad->netdev->name, + tx_id + tx_info->tcb[i]->id); err = request_irq(bnad->msix_table[vector_num].vector, (irq_handler_t)bnad_msix_tx, 0, tx_info->tcb[i]->name, @@ -1594,9 +1595,9 @@ bnad_rx_msix_register(struct bnad *bnad, struct bnad_rx_info *rx_info, for (i = 0; i < num_rxps; i++) { vector_num = rx_info->rx_ctrl[i].ccb->intr_vector; - sprintf(rx_info->rx_ctrl[i].ccb->name, "%s CQ %d", - bnad->netdev->name, - rx_id + rx_info->rx_ctrl[i].ccb->id); + snprintf(rx_info->rx_ctrl[i].ccb->name, BNA_Q_NAME_SIZE, + "%s CQ %d", bnad->netdev->name, + rx_id + rx_info->rx_ctrl[i].ccb->id); err = request_irq(bnad->msix_table[vector_num].vector, (irq_handler_t)bnad_msix_rx, 0, rx_info->rx_ctrl[i].ccb->name, diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 22cec349dead..272498401dbb 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -183,8 +183,8 @@ MODULE_PARM_DESC(macaddr, "FEC Ethernet MAC address"); #define PKT_MINBUF_SIZE 64 /* FEC receive acceleration */ -#define FEC_RACC_IPDIS (1 << 1) -#define FEC_RACC_PRODIS (1 << 2) +#define FEC_RACC_IPDIS BIT(1) +#define FEC_RACC_PRODIS BIT(2) #define FEC_RACC_SHIFT16 BIT(7) #define FEC_RACC_OPTIONS (FEC_RACC_IPDIS | FEC_RACC_PRODIS) @@ -212,8 +212,23 @@ MODULE_PARM_DESC(macaddr, "FEC Ethernet MAC address"); #define FEC_MMFR_TA (2 << 16) #define FEC_MMFR_DATA(v) (v & 0xffff) /* FEC ECR bits definition */ -#define FEC_ECR_MAGICEN (1 << 2) -#define FEC_ECR_SLEEP (1 << 3) +#define FEC_ECR_RESET BIT(0) +#define FEC_ECR_ETHEREN BIT(1) +#define FEC_ECR_MAGICEN BIT(2) +#define FEC_ECR_SLEEP BIT(3) +#define FEC_ECR_EN1588 BIT(4) +#define FEC_ECR_BYTESWP BIT(8) +/* FEC RCR bits definition */ +#define FEC_RCR_LOOP BIT(0) +#define FEC_RCR_HALFDPX BIT(1) +#define FEC_RCR_MII BIT(2) +#define FEC_RCR_PROMISC BIT(3) +#define FEC_RCR_BC_REJ BIT(4) +#define FEC_RCR_FLOWCTL BIT(5) +#define FEC_RCR_RMII BIT(8) +#define FEC_RCR_10BASET BIT(9) +/* TX WMARK bits */ +#define FEC_TXWMRK_STRFWD BIT(8) #define FEC_MII_TIMEOUT 30000 /* us */ @@ -909,7 +924,7 @@ fec_restart(struct net_device *ndev) u32 val; u32 temp_mac[2]; u32 rcntl = OPT_FRAME_SIZE | 0x04; - u32 ecntl = 0x2; /* ETHEREN */ + u32 ecntl = FEC_ECR_ETHEREN; /* Whack a reset. We should wait for this. * For i.MX6SX SOC, enet use AXI bus, we use disable MAC @@ -985,18 +1000,18 @@ fec_restart(struct net_device *ndev) fep->phy_interface == PHY_INTERFACE_MODE_RGMII_TXID) rcntl |= (1 << 6); else if (fep->phy_interface == PHY_INTERFACE_MODE_RMII) - rcntl |= (1 << 8); + rcntl |= FEC_RCR_RMII; else - rcntl &= ~(1 << 8); + rcntl &= ~FEC_RCR_RMII; /* 1G, 100M or 10M */ if (ndev->phydev) { if (ndev->phydev->speed == SPEED_1000) ecntl |= (1 << 5); else if (ndev->phydev->speed == SPEED_100) - rcntl &= ~(1 << 9); + rcntl &= ~FEC_RCR_10BASET; else - rcntl |= (1 << 9); + rcntl |= FEC_RCR_10BASET; } } else { #ifdef FEC_MIIGSK_ENR @@ -1055,13 +1070,13 @@ fec_restart(struct net_device *ndev) if (fep->quirks & FEC_QUIRK_ENET_MAC) { /* enable ENET endian swap */ - ecntl |= (1 << 8); + ecntl |= FEC_ECR_BYTESWP; /* enable ENET store and forward mode */ - writel(1 << 8, fep->hwp + FEC_X_WMRK); + writel(FEC_TXWMRK_STRFWD, fep->hwp + FEC_X_WMRK); } if (fep->bufdesc_ex) - ecntl |= (1 << 4); + ecntl |= FEC_ECR_EN1588; #ifndef CONFIG_M5272 /* Enable the MIB statistic event counters */ @@ -1091,7 +1106,7 @@ fec_stop(struct net_device *ndev) { struct fec_enet_private *fep = netdev_priv(ndev); struct fec_platform_data *pdata = fep->pdev->dev.platform_data; - u32 rmii_mode = readl(fep->hwp + FEC_R_CNTRL) & (1 << 8); + u32 rmii_mode = readl(fep->hwp + FEC_R_CNTRL) & FEC_RCR_RMII; u32 val; /* We cannot expect a graceful transmit stop without link !!! */ @@ -1110,7 +1125,7 @@ fec_stop(struct net_device *ndev) if (fep->quirks & FEC_QUIRK_HAS_AVB) { writel(0, fep->hwp + FEC_ECNTRL); } else { - writel(1, fep->hwp + FEC_ECNTRL); + writel(FEC_ECR_RESET, fep->hwp + FEC_ECNTRL); udelay(10); } writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK); @@ -1128,11 +1143,16 @@ fec_stop(struct net_device *ndev) /* We have to keep ENET enabled to have MII interrupt stay working */ if (fep->quirks & FEC_QUIRK_ENET_MAC && !(fep->wol_flag & FEC_WOL_FLAG_SLEEP_ON)) { - writel(2, fep->hwp + FEC_ECNTRL); + writel(FEC_ECR_ETHEREN, fep->hwp + FEC_ECNTRL); writel(rmii_mode, fep->hwp + FEC_R_CNTRL); } -} + if (fep->bufdesc_ex) { + val = readl(fep->hwp + FEC_ECNTRL); + val |= FEC_ECR_EN1588; + writel(val, fep->hwp + FEC_ECNTRL); + } +} static void fec_timeout(struct net_device *ndev) diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c index b42c68833292..53b9ce4af965 100644 --- a/drivers/net/ethernet/freescale/fec_ptp.c +++ b/drivers/net/ethernet/freescale/fec_ptp.c @@ -608,6 +608,9 @@ void fec_ptp_stop(struct platform_device *pdev) struct net_device *ndev = platform_get_drvdata(pdev); struct fec_enet_private *fep = netdev_priv(ndev); + if (fep->pps_enable) + fec_ptp_enable_pps(fep, 0); + cancel_delayed_work_sync(&fep->time_keep); if (fep->ptp_clock) ptp_clock_unregister(fep->ptp_clock); diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index 0e27920c2b6b..db45b7a51716 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -727,6 +727,7 @@ static int netconsole_netdev_event(struct notifier_block *this, /* rtnl_lock already held * we might sleep in __netpoll_cleanup() */ + nt->enabled = false; spin_unlock_irqrestore(&target_list_lock, flags); __netpoll_cleanup(&nt->np); @@ -734,7 +735,6 @@ static int netconsole_netdev_event(struct notifier_block *this, spin_lock_irqsave(&target_list_lock, flags); dev_put(nt->np.dev); nt->np.dev = NULL; - nt->enabled = false; stopped = true; netconsole_target_put(nt); goto restart; diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index facd37cae259..489cc388d9bf 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c @@ -241,6 +241,7 @@ static int qmimux_rx_fixup(struct usbnet *dev, struct sk_buff *skb) break; default: /* not ip - do not know what to do */ + kfree_skb(skbn); goto skip; } diff --git a/drivers/net/usb/sr9700.c b/drivers/net/usb/sr9700.c index 4a723696103b..7ca6911b2c83 100644 --- a/drivers/net/usb/sr9700.c +++ b/drivers/net/usb/sr9700.c @@ -178,6 +178,7 @@ static int sr_mdio_read(struct net_device *netdev, int phy_id, int loc) struct usbnet *dev = netdev_priv(netdev); __le16 res; int rc = 0; + int err; if (phy_id) { netdev_dbg(netdev, "Only internal phy supported\n"); @@ -188,11 +189,17 @@ static int sr_mdio_read(struct net_device *netdev, int phy_id, int loc) if (loc == MII_BMSR) { u8 value; - sr_read_reg(dev, SR_NSR, &value); + err = sr_read_reg(dev, SR_NSR, &value); + if (err < 0) + return err; + if (value & NSR_LINKST) rc = 1; } - sr_share_read_word(dev, 1, loc, &res); + err = sr_share_read_word(dev, 1, loc, &res); + if (err < 0) + return err; + if (rc == 1) res = le16_to_cpu(res) | BMSR_LSTATUS; else diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c index c9f48ec46f4a..7086a47d91a5 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c @@ -2638,7 +2638,6 @@ wlc_lcnphy_tx_iqlo_cal(struct brcms_phy *pi, struct lcnphy_txgains cal_gains, temp_gains; u16 hash; - u8 band_idx; int j; u16 ncorr_override[5]; u16 syst_coeffs[] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -2670,6 +2669,9 @@ wlc_lcnphy_tx_iqlo_cal(struct brcms_phy *pi, u16 *values_to_save; struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy; + if (WARN_ON(CHSPEC_IS5G(pi->radio_chanspec))) + return; + values_to_save = kmalloc(sizeof(u16) * 20, GFP_ATOMIC); if (NULL == values_to_save) return; @@ -2733,20 +2735,18 @@ wlc_lcnphy_tx_iqlo_cal(struct brcms_phy *pi, hash = (target_gains->gm_gain << 8) | (target_gains->pga_gain << 4) | (target_gains->pad_gain); - band_idx = (CHSPEC_IS5G(pi->radio_chanspec) ? 1 : 0); - cal_gains = *target_gains; memset(ncorr_override, 0, sizeof(ncorr_override)); - for (j = 0; j < iqcal_gainparams_numgains_lcnphy[band_idx]; j++) { - if (hash == tbl_iqcal_gainparams_lcnphy[band_idx][j][0]) { + for (j = 0; j < iqcal_gainparams_numgains_lcnphy[0]; j++) { + if (hash == tbl_iqcal_gainparams_lcnphy[0][j][0]) { cal_gains.gm_gain = - tbl_iqcal_gainparams_lcnphy[band_idx][j][1]; + tbl_iqcal_gainparams_lcnphy[0][j][1]; cal_gains.pga_gain = - tbl_iqcal_gainparams_lcnphy[band_idx][j][2]; + tbl_iqcal_gainparams_lcnphy[0][j][2]; cal_gains.pad_gain = - tbl_iqcal_gainparams_lcnphy[band_idx][j][3]; + tbl_iqcal_gainparams_lcnphy[0][j][3]; memcpy(ncorr_override, - &tbl_iqcal_gainparams_lcnphy[band_idx][j][3], + &tbl_iqcal_gainparams_lcnphy[0][j][3], sizeof(ncorr_override)); break; } diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c index 76205d6b2f9c..aa5d1a5cbd52 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c @@ -920,6 +920,8 @@ mwifiex_init_new_priv_params(struct mwifiex_private *priv, return -EOPNOTSUPP; } + priv->bss_num = mwifiex_get_unused_bss_num(adapter, priv->bss_type); + spin_lock_irqsave(&adapter->main_proc_lock, flags); adapter->main_locked = false; spin_unlock_irqrestore(&adapter->main_proc_lock, flags); diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index abe4c947ec41..6374aefa6535 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -2351,6 +2351,13 @@ static unsigned long check_vendor_combination_bug(struct pci_dev *pdev) return NVME_QUIRK_NO_APST; } + /* + * NVMe SSD drops off the PCIe bus after system idle + * for 10 hours on a Lenovo N60z board. + */ + if (dmi_match(DMI_BOARD_NAME, "LXKT-ZXEG-N6")) + return NVME_QUIRK_NO_APST; + return 0; } diff --git a/drivers/parport/daisy.c b/drivers/parport/daisy.c index 5484a46dafda..465acebd6438 100644 --- a/drivers/parport/daisy.c +++ b/drivers/parport/daisy.c @@ -109,8 +109,7 @@ int parport_daisy_init(struct parport *port) ((num_ports = num_mux_ports(port)) == 2 || num_ports == 4)) { /* Leave original as port zero. */ port->muxport = 0; - printk(KERN_INFO - "%s: 1st (default) port of %d-way multiplexor\n", + pr_info("%s: 1st (default) port of %d-way multiplexor\n", port->name, num_ports); for (i = 1; i < num_ports; i++) { /* Clone the port. */ @@ -123,8 +122,7 @@ int parport_daisy_init(struct parport *port) continue; } - printk(KERN_INFO - "%s: %d%s port of %d-way multiplexor on %s\n", + pr_info("%s: %d%s port of %d-way multiplexor on %s\n", extra->name, i + 1, th[i + 1], num_ports, port->name); diff --git a/drivers/parport/ieee1284.c b/drivers/parport/ieee1284.c index 74cc6dd982d2..9b5a97fb6a60 100644 --- a/drivers/parport/ieee1284.c +++ b/drivers/parport/ieee1284.c @@ -336,7 +336,7 @@ int parport_negotiate (struct parport *port, int mode) #ifndef CONFIG_PARPORT_1284 if (mode == IEEE1284_MODE_COMPAT) return 0; - printk (KERN_ERR "parport: IEEE1284 not supported in this kernel\n"); + pr_err("parport: IEEE1284 not supported in this kernel\n"); return -1; #else int m = mode & ~IEEE1284_ADDR; @@ -700,7 +700,7 @@ ssize_t parport_write (struct parport *port, const void *buffer, size_t len) ssize_t parport_read (struct parport *port, void *buffer, size_t len) { #ifndef CONFIG_PARPORT_1284 - printk (KERN_ERR "parport: IEEE1284 not supported in this kernel\n"); + pr_err("parport: IEEE1284 not supported in this kernel\n"); return -ENODEV; #else int mode = port->physport->ieee1284.mode; diff --git a/drivers/parport/ieee1284_ops.c b/drivers/parport/ieee1284_ops.c index 75daa16f38b7..58ec484c7305 100644 --- a/drivers/parport/ieee1284_ops.c +++ b/drivers/parport/ieee1284_ops.c @@ -599,8 +599,7 @@ size_t parport_ieee1284_ecp_read_data (struct parport *port, DPRINTK (KERN_DEBUG "ECP read timed out at 45\n"); if (command) - printk (KERN_WARNING - "%s: command ignored (%02x)\n", + pr_warn("%s: command ignored (%02x)\n", port->name, byte); break; diff --git a/drivers/parport/parport_amiga.c b/drivers/parport/parport_amiga.c index 9c68f2aec4ff..75779725f638 100644 --- a/drivers/parport/parport_amiga.c +++ b/drivers/parport/parport_amiga.c @@ -211,7 +211,7 @@ static int __init amiga_parallel_probe(struct platform_device *pdev) if (err) goto out_irq; - printk(KERN_INFO "%s: Amiga built-in port using irq\n", p->name); + pr_info("%s: Amiga built-in port using irq\n", p->name); /* XXX: set operating mode */ parport_announce_port(p); diff --git a/drivers/parport/parport_atari.c b/drivers/parport/parport_atari.c index 9fbf6ccd54de..2f8c7f6617d7 100644 --- a/drivers/parport/parport_atari.c +++ b/drivers/parport/parport_atari.c @@ -199,7 +199,7 @@ static int __init parport_atari_init(void) } this_port = p; - printk(KERN_INFO "%s: Atari built-in port using irq\n", p->name); + pr_info("%s: Atari built-in port using irq\n", p->name); parport_announce_port (p); return 0; diff --git a/drivers/parport/parport_cs.c b/drivers/parport/parport_cs.c index e9b52e4a4648..755207ca155f 100644 --- a/drivers/parport/parport_cs.c +++ b/drivers/parport/parport_cs.c @@ -142,10 +142,8 @@ static int parport_config(struct pcmcia_device *link) link->irq, PARPORT_DMA_NONE, &link->dev, IRQF_SHARED); if (p == NULL) { - printk(KERN_NOTICE "parport_cs: parport_pc_probe_port() at " - "0x%3x, irq %u failed\n", - (unsigned int) link->resource[0]->start, - link->irq); + pr_notice("parport_cs: parport_pc_probe_port() at 0x%3x, irq %u failed\n", + (unsigned int)link->resource[0]->start, link->irq); goto failed; } diff --git a/drivers/parport/parport_gsc.c b/drivers/parport/parport_gsc.c index 5f710aaaf3da..b9cab25343aa 100644 --- a/drivers/parport/parport_gsc.c +++ b/drivers/parport/parport_gsc.c @@ -287,7 +287,7 @@ struct parport *parport_gsc_probe_port(unsigned long base, p->size = (p->modes & PARPORT_MODE_EPP)?8:3; p->private_data = priv; - printk(KERN_INFO "%s: PC-style at 0x%lx", p->name, p->base); + pr_info("%s: PC-style at 0x%lx", p->name, p->base); p->irq = irq; if (p->irq == PARPORT_IRQ_AUTO) { p->irq = PARPORT_IRQ_NONE; @@ -304,12 +304,16 @@ struct parport *parport_gsc_probe_port(unsigned long base, p->dma = PARPORT_DMA_NONE; pr_cont(" ["); -#define printmode(x) {if(p->modes&PARPORT_MODE_##x){pr_cont("%s%s",f?",":"",#x);f++;}} +#define printmode(x) \ +do { \ + if (p->modes & PARPORT_MODE_##x) \ + pr_cont("%s%s", f++ ? "," : "", #x); \ +} while (0) { int f = 0; printmode(PCSPP); printmode(TRISTATE); - printmode(COMPAT) + printmode(COMPAT); printmode(EPP); // printmode(ECP); // printmode(DMA); @@ -320,8 +324,7 @@ struct parport *parport_gsc_probe_port(unsigned long base, if (p->irq != PARPORT_IRQ_NONE) { if (request_irq (p->irq, parport_irq_handler, 0, p->name, p)) { - printk (KERN_WARNING "%s: irq %d in use, " - "resorting to polled operation\n", + pr_warn("%s: irq %d in use, resorting to polled operation\n", p->name, p->irq); p->irq = PARPORT_IRQ_NONE; p->dma = PARPORT_DMA_NONE; @@ -352,7 +355,7 @@ static int __init parport_init_chip(struct parisc_device *dev) unsigned long port; if (!dev->irq) { - printk(KERN_WARNING "IRQ not found for parallel device at 0x%llx\n", + pr_warn("IRQ not found for parallel device at 0x%llx\n", (unsigned long long)dev->hpa.start); return -ENODEV; } diff --git a/drivers/parport/parport_ip32.c b/drivers/parport/parport_ip32.c index 0186db7680d4..05436c316b39 100644 --- a/drivers/parport/parport_ip32.c +++ b/drivers/parport/parport_ip32.c @@ -1348,9 +1348,8 @@ static unsigned int parport_ip32_fwp_wait_interrupt(struct parport *p) ecr = parport_ip32_read_econtrol(p); if ((ecr & ECR_F_EMPTY) && !(ecr & ECR_SERVINTR) && !lost_interrupt) { - printk(KERN_WARNING PPIP32 - "%s: lost interrupt in %s\n", - p->name, __func__); + pr_warn(PPIP32 "%s: lost interrupt in %s\n", + p->name, __func__); lost_interrupt = 1; } } @@ -1654,8 +1653,8 @@ static size_t parport_ip32_compat_write_data(struct parport *p, DSR_nBUSY | DSR_nFAULT)) { /* Avoid to flood the logs */ if (ready_before) - printk(KERN_INFO PPIP32 "%s: not ready in %s\n", - p->name, __func__); + pr_info(PPIP32 "%s: not ready in %s\n", + p->name, __func__); ready_before = 0; goto stop; } @@ -1735,8 +1734,8 @@ static size_t parport_ip32_ecp_write_data(struct parport *p, DSR_nBUSY | DSR_nFAULT)) { /* Avoid to flood the logs */ if (ready_before) - printk(KERN_INFO PPIP32 "%s: not ready in %s\n", - p->name, __func__); + pr_info(PPIP32 "%s: not ready in %s\n", + p->name, __func__); ready_before = 0; goto stop; } @@ -2075,8 +2074,7 @@ static __init struct parport *parport_ip32_probe_port(void) p->modes |= PARPORT_MODE_TRISTATE; if (!parport_ip32_fifo_supported(p)) { - printk(KERN_WARNING PPIP32 - "%s: error: FIFO disabled\n", p->name); + pr_warn(PPIP32 "%s: error: FIFO disabled\n", p->name); /* Disable hardware modes depending on a working FIFO. */ features &= ~PARPORT_IP32_ENABLE_SPP; features &= ~PARPORT_IP32_ENABLE_ECP; @@ -2088,8 +2086,7 @@ static __init struct parport *parport_ip32_probe_port(void) if (features & PARPORT_IP32_ENABLE_IRQ) { int irq = MACEISA_PARALLEL_IRQ; if (request_irq(irq, parport_ip32_interrupt, 0, p->name, p)) { - printk(KERN_WARNING PPIP32 - "%s: error: IRQ disabled\n", p->name); + pr_warn(PPIP32 "%s: error: IRQ disabled\n", p->name); /* DMA cannot work without interrupts. */ features &= ~PARPORT_IP32_ENABLE_DMA; } else { @@ -2102,8 +2099,7 @@ static __init struct parport *parport_ip32_probe_port(void) /* Allocate DMA resources */ if (features & PARPORT_IP32_ENABLE_DMA) { if (parport_ip32_dma_register()) - printk(KERN_WARNING PPIP32 - "%s: error: DMA disabled\n", p->name); + pr_warn(PPIP32 "%s: error: DMA disabled\n", p->name); else { pr_probe(p, "DMA support enabled\n"); p->dma = 0; /* arbitrary value != PARPORT_DMA_NONE */ @@ -2145,8 +2141,7 @@ static __init struct parport *parport_ip32_probe_port(void) parport_ip32_dump_state(p, "end init", 0); /* Print out what we found */ - printk(KERN_INFO "%s: SGI IP32 at 0x%lx (0x%lx)", - p->name, p->base, p->base_hi); + pr_info("%s: SGI IP32 at 0x%lx (0x%lx)", p->name, p->base, p->base_hi); if (p->irq != PARPORT_IRQ_NONE) printk(", irq %d", p->irq); printk(" ["); diff --git a/drivers/parport/parport_mfc3.c b/drivers/parport/parport_mfc3.c index 7f4be0e484c7..378b6bce3ae7 100644 --- a/drivers/parport/parport_mfc3.c +++ b/drivers/parport/parport_mfc3.c @@ -324,7 +324,7 @@ static int __init parport_mfc3_init(void) p->dev = &z->dev; this_port[pias++] = p; - printk(KERN_INFO "%s: Multiface III port using irq\n", p->name); + pr_info("%s: Multiface III port using irq\n", p->name); /* XXX: set operating mode */ p->private_data = (void *)piabase; diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c index c34ad5dd62e3..ad2acafb6850 100644 --- a/drivers/parport/parport_pc.c +++ b/drivers/parport/parport_pc.c @@ -981,28 +981,24 @@ static void show_parconfig_smsc37c669(int io, int key) outb(0xaa, io); if (verbose_probing) { - printk(KERN_INFO - "SMSC 37c669 LPT Config: cr_1=0x%02x, 4=0x%02x, " - "A=0x%2x, 23=0x%02x, 26=0x%02x, 27=0x%02x\n", + pr_info("SMSC 37c669 LPT Config: cr_1=0x%02x, 4=0x%02x, A=0x%2x, 23=0x%02x, 26=0x%02x, 27=0x%02x\n", cr1, cr4, cra, cr23, cr26, cr27); /* The documentation calls DMA and IRQ-Lines by letters, so the board maker can/will wire them appropriately/randomly... G=reserved H=IDE-irq, */ - printk(KERN_INFO - "SMSC LPT Config: io=0x%04x, irq=%c, dma=%c, fifo threshold=%d\n", - cr23 * 4, - (cr27 & 0x0f) ? 'A' - 1 + (cr27 & 0x0f) : '-', - (cr26 & 0x0f) ? 'A' - 1 + (cr26 & 0x0f) : '-', - cra & 0x0f); - printk(KERN_INFO "SMSC LPT Config: enabled=%s power=%s\n", - (cr23 * 4 >= 0x100) ? "yes" : "no", - (cr1 & 4) ? "yes" : "no"); - printk(KERN_INFO - "SMSC LPT Config: Port mode=%s, EPP version =%s\n", - (cr1 & 0x08) ? "Standard mode only (SPP)" - : modes[cr4 & 0x03], - (cr4 & 0x40) ? "1.7" : "1.9"); + pr_info("SMSC LPT Config: io=0x%04x, irq=%c, dma=%c, fifo threshold=%d\n", + cr23 * 4, + (cr27 & 0x0f) ? 'A' - 1 + (cr27 & 0x0f) : '-', + (cr26 & 0x0f) ? 'A' - 1 + (cr26 & 0x0f) : '-', + cra & 0x0f); + pr_info("SMSC LPT Config: enabled=%s power=%s\n", + (cr23 * 4 >= 0x100) ? "yes" : "no", + (cr1 & 4) ? "yes" : "no"); + pr_info("SMSC LPT Config: Port mode=%s, EPP version =%s\n", + (cr1 & 0x08) ? "Standard mode only (SPP)" + : modes[cr4 & 0x03], + (cr4 & 0x40) ? "1.7" : "1.9"); } /* Heuristics ! BIOS setup for this mainboard device limits @@ -1012,7 +1008,7 @@ static void show_parconfig_smsc37c669(int io, int key) if (cr23 * 4 >= 0x100) { /* if active */ s = find_free_superio(); if (s == NULL) - printk(KERN_INFO "Super-IO: too many chips!\n"); + pr_info("Super-IO: too many chips!\n"); else { int d; switch (cr23 * 4) { @@ -1077,26 +1073,24 @@ static void show_parconfig_winbond(int io, int key) outb(0xaa, io); if (verbose_probing) { - printk(KERN_INFO - "Winbond LPT Config: cr_30=%02x 60,61=%02x%02x 70=%02x 74=%02x, f0=%02x\n", - cr30, cr60, cr61, cr70, cr74, crf0); - printk(KERN_INFO "Winbond LPT Config: active=%s, io=0x%02x%02x irq=%d, ", - (cr30 & 0x01) ? "yes" : "no", cr60, cr61, cr70 & 0x0f); + pr_info("Winbond LPT Config: cr_30=%02x 60,61=%02x%02x 70=%02x 74=%02x, f0=%02x\n", + cr30, cr60, cr61, cr70, cr74, crf0); + pr_info("Winbond LPT Config: active=%s, io=0x%02x%02x irq=%d, ", + (cr30 & 0x01) ? "yes" : "no", cr60, cr61, cr70 & 0x0f); if ((cr74 & 0x07) > 3) pr_cont("dma=none\n"); else pr_cont("dma=%d\n", cr74 & 0x07); - printk(KERN_INFO - "Winbond LPT Config: irqtype=%s, ECP fifo threshold=%d\n", - irqtypes[crf0>>7], (crf0>>3)&0x0f); - printk(KERN_INFO "Winbond LPT Config: Port mode=%s\n", - modes[crf0 & 0x07]); + pr_info("Winbond LPT Config: irqtype=%s, ECP fifo threshold=%d\n", + irqtypes[crf0 >> 7], (crf0 >> 3) & 0x0f); + pr_info("Winbond LPT Config: Port mode=%s\n", + modes[crf0 & 0x07]); } if (cr30 & 0x01) { /* the settings can be interrogated later ... */ s = find_free_superio(); if (s == NULL) - printk(KERN_INFO "Super-IO: too many chips!\n"); + pr_info("Super-IO: too many chips!\n"); else { s->io = (cr60 << 8) | cr61; s->irq = cr70 & 0x0f; @@ -1150,9 +1144,8 @@ static void decode_winbond(int efer, int key, int devid, int devrev, int oldid) progif = 0; if (verbose_probing) - printk(KERN_INFO "Winbond chip at EFER=0x%x key=0x%02x " - "devid=%02x devrev=%02x oldid=%02x type=%s\n", - efer, key, devid, devrev, oldid, type); + pr_info("Winbond chip at EFER=0x%x key=0x%02x devid=%02x devrev=%02x oldid=%02x type=%s\n", + efer, key, devid, devrev, oldid, type); if (progif == 2) show_parconfig_winbond(efer, key); @@ -1183,9 +1176,8 @@ static void decode_smsc(int efer, int key, int devid, int devrev) type = "37c666GT"; if (verbose_probing) - printk(KERN_INFO "SMSC chip at EFER=0x%x " - "key=0x%02x devid=%02x devrev=%02x type=%s\n", - efer, key, devid, devrev, type); + pr_info("SMSC chip at EFER=0x%x key=0x%02x devid=%02x devrev=%02x type=%s\n", + efer, key, devid, devrev, type); if (func) func(efer, key); @@ -1357,7 +1349,7 @@ static void detect_and_report_it87(void) dev |= inb(0x2f); if (dev == 0x8712 || dev == 0x8705 || dev == 0x8715 || dev == 0x8716 || dev == 0x8718 || dev == 0x8726) { - printk(KERN_INFO "IT%04X SuperIO detected.\n", dev); + pr_info("IT%04X SuperIO detected\n", dev); outb(0x07, 0x2E); /* Parallel Port */ outb(0x03, 0x2F); outb(0xF0, 0x2E); /* BOOT 0x80 off */ @@ -1444,8 +1436,8 @@ static int parport_SPP_supported(struct parport *pb) if (user_specified) /* That didn't work, but the user thinks there's a * port here. */ - printk(KERN_INFO "parport 0x%lx (WARNING): CTR: " - "wrote 0x%02x, read 0x%02x\n", pb->base, w, r); + pr_info("parport 0x%lx (WARNING): CTR: wrote 0x%02x, read 0x%02x\n", + pb->base, w, r); /* Try the data register. The data lines aren't tri-stated at * this stage, so we expect back what we wrote. */ @@ -1463,10 +1455,9 @@ static int parport_SPP_supported(struct parport *pb) if (user_specified) { /* Didn't work, but the user is convinced this is the * place. */ - printk(KERN_INFO "parport 0x%lx (WARNING): DATA: " - "wrote 0x%02x, read 0x%02x\n", pb->base, w, r); - printk(KERN_INFO "parport 0x%lx: You gave this address, " - "but there is probably no parallel port there!\n", + pr_info("parport 0x%lx (WARNING): DATA: wrote 0x%02x, read 0x%02x\n", + pb->base, w, r); + pr_info("parport 0x%lx: You gave this address, but there is probably no parallel port there!\n", pb->base); } @@ -1641,7 +1632,7 @@ static int parport_ECP_supported(struct parport *pb) if (i <= priv->fifo_depth) { if (verbose_probing) - printk(KERN_INFO "0x%lx: readIntrThreshold is %d\n", + pr_info("0x%lx: readIntrThreshold is %d\n", pb->base, i); } else /* Number of bytes we can read if we get an interrupt. */ @@ -1656,18 +1647,15 @@ static int parport_ECP_supported(struct parport *pb) switch (pword) { case 0: pword = 2; - printk(KERN_WARNING "0x%lx: Unsupported pword size!\n", - pb->base); + pr_warn("0x%lx: Unsupported pword size!\n", pb->base); break; case 2: pword = 4; - printk(KERN_WARNING "0x%lx: Unsupported pword size!\n", - pb->base); + pr_warn("0x%lx: Unsupported pword size!\n", pb->base); break; default: - printk(KERN_WARNING "0x%lx: Unknown implementation ID\n", - pb->base); - /* Assume 1 */ + pr_warn("0x%lx: Unknown implementation ID\n", pb->base); + /* Fall through - Assume 1 */ case 1: pword = 1; } @@ -2106,9 +2094,9 @@ struct parport *parport_pc_probe_port(unsigned long int base, p->size = (p->modes & PARPORT_MODE_EPP) ? 8 : 3; - printk(KERN_INFO "%s: PC-style at 0x%lx", p->name, p->base); + pr_info("%s: PC-style at 0x%lx", p->name, p->base); if (p->base_hi && priv->ecr) - printk(KERN_CONT " (0x%lx)", p->base_hi); + pr_cont(" (0x%lx)", p->base_hi); if (p->irq == PARPORT_IRQ_AUTO) { p->irq = PARPORT_IRQ_NONE; parport_irq_probe(p); @@ -2119,7 +2107,7 @@ struct parport *parport_pc_probe_port(unsigned long int base, p->irq = PARPORT_IRQ_NONE; } if (p->irq != PARPORT_IRQ_NONE) { - printk(KERN_CONT ", irq %d", p->irq); + pr_cont(", irq %d", p->irq); priv->ctr_writable |= 0x10; if (p->dma == PARPORT_DMA_AUTO) { @@ -2143,41 +2131,39 @@ struct parport *parport_pc_probe_port(unsigned long int base, /* p->ops->ecp_read_data = parport_pc_ecp_read_block_pio; */ #endif /* IEEE 1284 support */ if (p->dma != PARPORT_DMA_NONE) { - printk(KERN_CONT ", dma %d", p->dma); + pr_cont(", dma %d", p->dma); p->modes |= PARPORT_MODE_DMA; } else - printk(KERN_CONT ", using FIFO"); + pr_cont(", using FIFO"); } else /* We can't use the DMA channel after all. */ p->dma = PARPORT_DMA_NONE; #endif /* Allowed to use FIFO/DMA */ - printk(KERN_CONT " ["); + pr_cont(" ["); -#define printmode(x) \ - {\ - if (p->modes & PARPORT_MODE_##x) {\ - printk(KERN_CONT "%s%s", f ? "," : "", #x);\ - f++;\ - } \ - } +#define printmode(x) \ +do { \ + if (p->modes & PARPORT_MODE_##x) \ + pr_cont("%s%s", f++ ? "," : "", #x); \ +} while (0) { int f = 0; printmode(PCSPP); printmode(TRISTATE); - printmode(COMPAT) + printmode(COMPAT); printmode(EPP); printmode(ECP); printmode(DMA); } #undef printmode #ifndef CONFIG_PARPORT_1284 - printk(KERN_CONT "(,...)"); + pr_cont("(,...)"); #endif /* CONFIG_PARPORT_1284 */ - printk(KERN_CONT "]\n"); + pr_cont("]\n"); if (probedirq != PARPORT_IRQ_NONE) - printk(KERN_INFO "%s: irq %d detected\n", p->name, probedirq); + pr_info("%s: irq %d detected\n", p->name, probedirq); /* If No ECP release the ports grabbed above. */ if (ECR_res && (p->modes & PARPORT_MODE_ECP) == 0) { @@ -2192,8 +2178,7 @@ struct parport *parport_pc_probe_port(unsigned long int base, if (p->irq != PARPORT_IRQ_NONE) { if (request_irq(p->irq, parport_irq_handler, irqflags, p->name, p)) { - printk(KERN_WARNING "%s: irq %d in use, " - "resorting to polled operation\n", + pr_warn("%s: irq %d in use, resorting to polled operation\n", p->name, p->irq); p->irq = PARPORT_IRQ_NONE; p->dma = PARPORT_DMA_NONE; @@ -2203,8 +2188,7 @@ struct parport *parport_pc_probe_port(unsigned long int base, #ifdef HAS_DMA if (p->dma != PARPORT_DMA_NONE) { if (request_dma(p->dma, p->name)) { - printk(KERN_WARNING "%s: dma %d in use, " - "resorting to PIO operation\n", + pr_warn("%s: dma %d in use, resorting to PIO operation\n", p->name, p->dma); p->dma = PARPORT_DMA_NONE; } else { @@ -2214,9 +2198,7 @@ struct parport *parport_pc_probe_port(unsigned long int base, &priv->dma_handle, GFP_KERNEL); if (!priv->dma_buf) { - printk(KERN_WARNING "%s: " - "cannot get buffer for DMA, " - "resorting to PIO operation\n", + pr_warn("%s: cannot get buffer for DMA, resorting to PIO operation\n", p->name); free_dma(p->dma); p->dma = PARPORT_DMA_NONE; @@ -2329,7 +2311,7 @@ static int sio_ite_8872_probe(struct pci_dev *pdev, int autoirq, int autodma, } } if (i >= 5) { - printk(KERN_INFO "parport_pc: cannot find ITE8872 INTA\n"); + pr_info("parport_pc: cannot find ITE8872 INTA\n"); return 0; } @@ -2338,29 +2320,28 @@ static int sio_ite_8872_probe(struct pci_dev *pdev, int autoirq, int autodma, switch (type) { case 0x2: - printk(KERN_INFO "parport_pc: ITE8871 found (1P)\n"); + pr_info("parport_pc: ITE8871 found (1P)\n"); ite8872set = 0x64200000; break; case 0xa: - printk(KERN_INFO "parport_pc: ITE8875 found (1P)\n"); + pr_info("parport_pc: ITE8875 found (1P)\n"); ite8872set = 0x64200000; break; case 0xe: - printk(KERN_INFO "parport_pc: ITE8872 found (2S1P)\n"); + pr_info("parport_pc: ITE8872 found (2S1P)\n"); ite8872set = 0x64e00000; break; case 0x6: - printk(KERN_INFO "parport_pc: ITE8873 found (1S)\n"); + pr_info("parport_pc: ITE8873 found (1S)\n"); release_region(inta_addr[i], 32); return 0; case 0x8: - printk(KERN_INFO "parport_pc: ITE8874 found (2S)\n"); + pr_info("parport_pc: ITE8874 found (2S)\n"); release_region(inta_addr[i], 32); return 0; default: - printk(KERN_INFO "parport_pc: unknown ITE887x\n"); - printk(KERN_INFO "parport_pc: please mail 'lspci -nvv' " - "output to Rich.Liu@ite.com.tw\n"); + pr_info("parport_pc: unknown ITE887x\n"); + pr_info("parport_pc: please mail 'lspci -nvv' output to Rich.Liu@ite.com.tw\n"); release_region(inta_addr[i], 32); return 0; } @@ -2395,9 +2376,8 @@ static int sio_ite_8872_probe(struct pci_dev *pdev, int autoirq, int autodma, release_region(inta_addr[i], 32); if (parport_pc_probe_port(ite8872_lpt, ite8872_lpthi, irq, PARPORT_DMA_NONE, &pdev->dev, 0)) { - printk(KERN_INFO - "parport_pc: ITE 8872 parallel port: io=0x%X", - ite8872_lpt); + pr_info("parport_pc: ITE 8872 parallel port: io=0x%X", + ite8872_lpt); if (irq != PARPORT_IRQ_NONE) pr_cont(", irq=%d", irq); pr_cont("\n"); @@ -2524,7 +2504,7 @@ static int sio_via_probe(struct pci_dev *pdev, int autoirq, int autodma, pci_write_config_byte(pdev, via->via_pci_superio_config_reg, tmp); if (siofunc == VIA_FUNCTION_PARPORT_DISABLE) { - printk(KERN_INFO "parport_pc: VIA parallel port disabled in BIOS\n"); + pr_info("parport_pc: VIA parallel port disabled in BIOS\n"); return 0; } @@ -2557,9 +2537,8 @@ static int sio_via_probe(struct pci_dev *pdev, int autoirq, int autodma, case 0x278: port2 = 0x678; break; default: - printk(KERN_INFO - "parport_pc: Weird VIA parport base 0x%X, ignoring\n", - port1); + pr_info("parport_pc: Weird VIA parport base 0x%X, ignoring\n", + port1); return 0; } @@ -2578,8 +2557,7 @@ static int sio_via_probe(struct pci_dev *pdev, int autoirq, int autodma, /* finally, do the probe with values obtained */ if (parport_pc_probe_port(port1, port2, irq, dma, &pdev->dev, 0)) { - printk(KERN_INFO - "parport_pc: VIA parallel port: io=0x%X", port1); + pr_info("parport_pc: VIA parallel port: io=0x%X", port1); if (irq != PARPORT_IRQ_NONE) pr_cont(", irq=%d", irq); if (dma != PARPORT_DMA_NONE) @@ -2588,7 +2566,7 @@ static int sio_via_probe(struct pci_dev *pdev, int autoirq, int autodma, return 1; } - printk(KERN_WARNING "parport_pc: Strange, can't probe VIA parallel port: io=0x%X, irq=%d, dma=%d\n", + pr_warn("parport_pc: Strange, can't probe VIA parallel port: io=0x%X, irq=%d, dma=%d\n", port1, irq, dma); return 0; } @@ -3131,7 +3109,7 @@ static int __init parport_parse_param(const char *s, int *val, if (ep != s) *val = r; else { - printk(KERN_ERR "parport: bad specifier `%s'\n", s); + pr_err("parport: bad specifier `%s'\n", s); return -1; } } @@ -3221,10 +3199,7 @@ static int __init parse_parport_params(void) irqval[0] = val; break; default: - printk(KERN_WARNING - "parport_pc: irq specified " - "without base address. Use 'io=' " - "to specify one\n"); + pr_warn("parport_pc: irq specified without base address. Use 'io=' to specify one\n"); } if (dma[0] && !parport_parse_dma(dma[0], &val)) @@ -3234,10 +3209,7 @@ static int __init parse_parport_params(void) dmaval[0] = val; break; default: - printk(KERN_WARNING - "parport_pc: dma specified " - "without base address. Use 'io=' " - "to specify one\n"); + pr_warn("parport_pc: dma specified without base address. Use 'io=' to specify one\n"); } } return 0; @@ -3276,12 +3248,12 @@ static int __init parport_setup(char *str) val = simple_strtoul(str, &endptr, 0); if (endptr == str) { - printk(KERN_WARNING "parport=%s not understood\n", str); + pr_warn("parport=%s not understood\n", str); return 1; } if (parport_setup_ptr == PARPORT_PC_MAX_PORTS) { - printk(KERN_ERR "parport=%s ignored, too many ports\n", str); + pr_err("parport=%s ignored, too many ports\n", str); return 1; } diff --git a/drivers/parport/parport_sunbpp.c b/drivers/parport/parport_sunbpp.c index 8de329546b82..77671b7ad421 100644 --- a/drivers/parport/parport_sunbpp.c +++ b/drivers/parport/parport_sunbpp.c @@ -313,7 +313,7 @@ static int bpp_probe(struct platform_device *op) value_tcr &= ~P_TCR_DIR; sbus_writeb(value_tcr, ®s->p_tcr); - printk(KERN_INFO "%s: sunbpp at 0x%lx\n", p->name, p->base); + pr_info("%s: sunbpp at 0x%lx\n", p->name, p->base); dev_set_drvdata(&op->dev, p); diff --git a/drivers/parport/probe.c b/drivers/parport/probe.c index e035174ba205..650206c71875 100644 --- a/drivers/parport/probe.c +++ b/drivers/parport/probe.c @@ -38,7 +38,7 @@ static void pretty_print(struct parport *port, int device) { struct parport_device_info *info = &port->probe_info[device + 1]; - printk(KERN_INFO "%s", port->name); + pr_info("%s", port->name); if (device >= 0) printk (" (addr %d)", device); @@ -58,7 +58,7 @@ static void parse_data(struct parport *port, int device, char *str) struct parport_device_info *info = &port->probe_info[device + 1]; if (!txt) { - printk(KERN_WARNING "%s probe: memory squeeze\n", port->name); + pr_warn("%s probe: memory squeeze\n", port->name); return; } strcpy(txt, str); @@ -98,7 +98,8 @@ static void parse_data(struct parport *port, int device, char *str) goto rock_on; } } - printk(KERN_WARNING "%s probe: warning, class '%s' not understood.\n", port->name, sep); + pr_warn("%s probe: warning, class '%s' not understood\n", + port->name, sep); info->class = PARPORT_CLASS_OTHER; } else if (!strcmp(p, "CMD") || !strcmp(p, "COMMAND SET")) { diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c index 48804049d697..595e23e6859b 100644 --- a/drivers/parport/procfs.c +++ b/drivers/parport/procfs.c @@ -51,12 +51,12 @@ static int do_active_device(struct ctl_table *table, int write, for (dev = port->devices; dev ; dev = dev->next) { if(dev == port->cad) { - len += sprintf(buffer, "%s\n", dev->name); + len += snprintf(buffer, sizeof(buffer), "%s\n", dev->name); } } if(!len) { - len += sprintf(buffer, "%s\n", "none"); + len += snprintf(buffer, sizeof(buffer), "%s\n", "none"); } if (len > *lenp) @@ -87,19 +87,19 @@ static int do_autoprobe(struct ctl_table *table, int write, } if ((str = info->class_name) != NULL) - len += sprintf (buffer + len, "CLASS:%s;\n", str); + len += snprintf (buffer + len, sizeof(buffer) - len, "CLASS:%s;\n", str); if ((str = info->model) != NULL) - len += sprintf (buffer + len, "MODEL:%s;\n", str); + len += snprintf (buffer + len, sizeof(buffer) - len, "MODEL:%s;\n", str); if ((str = info->mfr) != NULL) - len += sprintf (buffer + len, "MANUFACTURER:%s;\n", str); + len += snprintf (buffer + len, sizeof(buffer) - len, "MANUFACTURER:%s;\n", str); if ((str = info->description) != NULL) - len += sprintf (buffer + len, "DESCRIPTION:%s;\n", str); + len += snprintf (buffer + len, sizeof(buffer) - len, "DESCRIPTION:%s;\n", str); if ((str = info->cmdset) != NULL) - len += sprintf (buffer + len, "COMMAND SET:%s;\n", str); + len += snprintf (buffer + len, sizeof(buffer) - len, "COMMAND SET:%s;\n", str); if (len > *lenp) len = *lenp; @@ -117,7 +117,7 @@ static int do_hardware_base_addr(struct ctl_table *table, int write, size_t *lenp, loff_t *ppos) { struct parport *port = (struct parport *)table->extra1; - char buffer[20]; + char buffer[64]; int len = 0; if (*ppos) { @@ -128,7 +128,7 @@ static int do_hardware_base_addr(struct ctl_table *table, int write, if (write) /* permissions prevent this anyway */ return -EACCES; - len += sprintf (buffer, "%lu\t%lu\n", port->base, port->base_hi); + len += snprintf (buffer, sizeof(buffer), "%lu\t%lu\n", port->base, port->base_hi); if (len > *lenp) len = *lenp; @@ -156,7 +156,7 @@ static int do_hardware_irq(struct ctl_table *table, int write, if (write) /* permissions prevent this anyway */ return -EACCES; - len += sprintf (buffer, "%d\n", port->irq); + len += snprintf (buffer, sizeof(buffer), "%d\n", port->irq); if (len > *lenp) len = *lenp; @@ -184,7 +184,7 @@ static int do_hardware_dma(struct ctl_table *table, int write, if (write) /* permissions prevent this anyway */ return -EACCES; - len += sprintf (buffer, "%d\n", port->dma); + len += snprintf (buffer, sizeof(buffer), "%d\n", port->dma); if (len > *lenp) len = *lenp; @@ -213,7 +213,11 @@ static int do_hardware_modes(struct ctl_table *table, int write, return -EACCES; { -#define printmode(x) {if(port->modes&PARPORT_MODE_##x){len+=sprintf(buffer+len,"%s%s",f?",":"",#x);f++;}} +#define printmode(x) \ +do { \ + if (port->modes & PARPORT_MODE_##x) \ + len += snprintf(buffer + len, sizeof(buffer) - len, "%s%s", f++ ? "," : "", #x); \ +} while (0) int f = 0; printmode(PCSPP); printmode(TRISTATE); diff --git a/drivers/parport/share.c b/drivers/parport/share.c index 15c81cffd2de..fc2930fb9bee 100644 --- a/drivers/parport/share.c +++ b/drivers/parport/share.c @@ -555,8 +555,8 @@ void parport_announce_port(struct parport *port) #endif if (!port->dev) - printk(KERN_WARNING "%s: fix this legacy no-device port driver!\n", - port->name); + pr_warn("%s: fix this legacy no-device port driver!\n", + port->name); parport_proc_register(port); mutex_lock(®istration_lock); @@ -728,7 +728,8 @@ parport_register_device(struct parport *port, const char *name, if (flags & PARPORT_DEV_LURK) { if (!pf || !kf) { - printk(KERN_INFO "%s: refused to register lurking device (%s) without callbacks\n", port->name, name); + pr_info("%s: refused to register lurking device (%s) without callbacks\n", + port->name, name); return NULL; } } @@ -997,7 +998,7 @@ void parport_unregister_device(struct pardevice *dev) #ifdef PARPORT_PARANOID if (!dev) { - printk(KERN_ERR "parport_unregister_device: passed NULL\n"); + pr_err("%s: passed NULL\n", __func__); return; } #endif @@ -1138,8 +1139,7 @@ int parport_claim(struct pardevice *dev) unsigned long flags; if (port->cad == dev) { - printk(KERN_INFO "%s: %s already owner\n", - dev->port->name,dev->name); + pr_info("%s: %s already owner\n", dev->port->name, dev->name); return 0; } @@ -1159,9 +1159,8 @@ int parport_claim(struct pardevice *dev) * I think we'll actually deadlock rather than * get here, but just in case.. */ - printk(KERN_WARNING - "%s: %s released port when preempted!\n", - port->name, oldcad->name); + pr_warn("%s: %s released port when preempted!\n", + port->name, oldcad->name); if (port->cad) goto blocked; } @@ -1321,8 +1320,8 @@ void parport_release(struct pardevice *dev) write_lock_irqsave(&port->cad_lock, flags); if (port->cad != dev) { write_unlock_irqrestore(&port->cad_lock, flags); - printk(KERN_WARNING "%s: %s tried to release parport when not owner\n", - port->name, dev->name); + pr_warn("%s: %s tried to release parport when not owner\n", + port->name, dev->name); return; } @@ -1362,7 +1361,8 @@ void parport_release(struct pardevice *dev) if (dev->port->cad) /* racy but no matter */ return; } else { - printk(KERN_ERR "%s: don't know how to wake %s\n", port->name, pd->name); + pr_err("%s: don't know how to wake %s\n", + port->name, pd->name); } } diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c index 7c872f71459c..602cf05a8e3f 100644 --- a/drivers/pci/host/pci-hyperv.c +++ b/drivers/pci/host/pci-hyperv.c @@ -665,8 +665,8 @@ static void _hv_pcifront_read_config(struct hv_pci_dev *hpdev, int where, PCI_CAPABILITY_LIST) { /* ROM BARs are unimplemented */ *val = 0; - } else if (where >= PCI_INTERRUPT_LINE && where + size <= - PCI_INTERRUPT_PIN) { + } else if ((where >= PCI_INTERRUPT_LINE && where + size <= PCI_INTERRUPT_PIN) || + (where >= PCI_INTERRUPT_PIN && where + size <= PCI_MIN_GNT)) { /* * Interrupt Line and Interrupt PIN are hard-wired to zero * because this front-end only supports message-signaled diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c index d3f9e7d24727..1859c9721623 100644 --- a/drivers/pci/host/pcie-rockchip.c +++ b/drivers/pci/host/pcie-rockchip.c @@ -1093,10 +1093,11 @@ static int rockchip_pcie_parse_dt(struct rockchip_pcie *rockchip) return PTR_ERR(rockchip->aclk_rst); } - rockchip->ep_gpio = devm_gpiod_get(dev, "ep", GPIOD_OUT_HIGH); + rockchip->ep_gpio = devm_gpiod_get_optional(dev, "ep", + GPIOD_OUT_LOW); if (IS_ERR(rockchip->ep_gpio)) { - dev_err(dev, "missing ep-gpios property in node\n"); - return PTR_ERR(rockchip->ep_gpio); + return dev_err_probe(dev, PTR_ERR(rockchip->ep_gpio), + "failed to get ep GPIO\n"); } rockchip->aclk_pcie = devm_clk_get(dev, "aclk"); diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index fb73e975d22b..28af1a14e0eb 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -816,6 +816,8 @@ static struct resource *find_free_bus_resource(struct pci_bus *bus, static resource_size_t calculate_iosize(resource_size_t size, resource_size_t min_size, resource_size_t size1, + resource_size_t add_size, + resource_size_t children_add_size, resource_size_t old_size, resource_size_t align) { @@ -828,15 +830,18 @@ static resource_size_t calculate_iosize(resource_size_t size, #if defined(CONFIG_ISA) || defined(CONFIG_EISA) size = (size & 0xff) + ((size & ~0xffUL) << 2); #endif - size = ALIGN(size + size1, align); + size = size + size1; if (size < old_size) size = old_size; + + size = ALIGN(max(size, add_size) + children_add_size, align); return size; } static resource_size_t calculate_memsize(resource_size_t size, resource_size_t min_size, - resource_size_t size1, + resource_size_t add_size, + resource_size_t children_add_size, resource_size_t old_size, resource_size_t align) { @@ -844,10 +849,9 @@ static resource_size_t calculate_memsize(resource_size_t size, size = min_size; if (old_size == 1) old_size = 0; - if (size < old_size) - size = old_size; - size = ALIGN(size + size1, align); - return size; + + size = max(size, add_size) + children_add_size; + return ALIGN(max(size, old_size), align); } resource_size_t __weak pcibios_window_alignment(struct pci_bus *bus, @@ -935,12 +939,10 @@ static void pbus_size_io(struct pci_bus *bus, resource_size_t min_size, } } - size0 = calculate_iosize(size, min_size, size1, + size0 = calculate_iosize(size, min_size, size1, 0, 0, resource_size(b_res), min_align); - if (children_add_size > add_size) - add_size = children_add_size; - size1 = (!realloc_head || (realloc_head && !add_size)) ? size0 : - calculate_iosize(size, min_size, add_size + size1, + size1 = (!realloc_head || (realloc_head && !add_size && !children_add_size)) ? size0 : + calculate_iosize(size, min_size, size1, add_size, children_add_size, resource_size(b_res), min_align); if (!size0 && !size1) { if (b_res->start || b_res->end) @@ -1084,12 +1086,10 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask, min_align = calculate_mem_align(aligns, max_order); min_align = max(min_align, window_alignment(bus, b_res->flags)); - size0 = calculate_memsize(size, min_size, 0, resource_size(b_res), min_align); + size0 = calculate_memsize(size, min_size, 0, 0, resource_size(b_res), min_align); add_align = max(min_align, add_align); - if (children_add_size > add_size) - add_size = children_add_size; - size1 = (!realloc_head || (realloc_head && !add_size)) ? size0 : - calculate_memsize(size, min_size, add_size, + size1 = (!realloc_head || (realloc_head && !add_size && !children_add_size)) ? size0 : + calculate_memsize(size, min_size, add_size, children_add_size, resource_size(b_res), add_align); if (!size0 && !size1) { if (b_res->start || b_res->end) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 5a6e23c74c22..4433ce25e623 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -2015,6 +2015,14 @@ pinctrl_init_controller(struct pinctrl_desc *pctldesc, struct device *dev, return ERR_PTR(ret); } +static void pinctrl_uninit_controller(struct pinctrl_dev *pctldev, struct pinctrl_desc *pctldesc) +{ + pinctrl_free_pindescs(pctldev, pctldesc->pins, + pctldesc->npins); + mutex_destroy(&pctldev->mutex); + kfree(pctldev); +} + static int pinctrl_claim_hogs(struct pinctrl_dev *pctldev) { pctldev->p = create_pinctrl(pctldev->dev, pctldev); @@ -2095,8 +2103,10 @@ struct pinctrl_dev *pinctrl_register(struct pinctrl_desc *pctldesc, return pctldev; error = pinctrl_enable(pctldev); - if (error) + if (error) { + pinctrl_uninit_controller(pctldev, pctldesc); return ERR_PTR(error); + } return pctldev; diff --git a/drivers/pinctrl/freescale/pinctrl-mxs.c b/drivers/pinctrl/freescale/pinctrl-mxs.c index 6852010a6d70..244a0c78f7a4 100644 --- a/drivers/pinctrl/freescale/pinctrl-mxs.c +++ b/drivers/pinctrl/freescale/pinctrl-mxs.c @@ -412,8 +412,8 @@ static int mxs_pinctrl_probe_dt(struct platform_device *pdev, int ret; u32 val; - child = of_get_next_child(np, NULL); - if (!child) { + val = of_get_child_count(np); + if (val == 0) { dev_err(&pdev->dev, "no group is defined\n"); return -ENOENT; } diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c index 44936fca576e..4deb20d8291c 100644 --- a/drivers/pinctrl/pinctrl-single.c +++ b/drivers/pinctrl/pinctrl-single.c @@ -1268,7 +1268,6 @@ static void pcs_irq_free(struct pcs_device *pcs) static void pcs_free_resources(struct pcs_device *pcs) { pcs_irq_free(pcs); - pinctrl_unregister(pcs->pctl); #if IS_BUILTIN(CONFIG_PINCTRL_SINGLE) if (pcs->missing_nr_pinctrl_cells) @@ -1749,7 +1748,7 @@ static int pcs_probe(struct platform_device *pdev) if (ret < 0) goto free; - ret = pinctrl_register_and_init(&pcs->desc, pcs->dev, pcs, &pcs->pctl); + ret = devm_pinctrl_register_and_init(pcs->dev, &pcs->desc, pcs, &pcs->pctl); if (ret) { dev_err(pcs->dev, "could not register single pinctrl driver\n"); goto free; @@ -1783,8 +1782,10 @@ static int pcs_probe(struct platform_device *pdev) dev_info(pcs->dev, "%i pins at pa %p size %u\n", pcs->desc.npins, pcs->base, pcs->size); - return pinctrl_enable(pcs->pctl); + if (pinctrl_enable(pcs->pctl)) + goto free; + return 0; free: pcs_free_resources(pcs); diff --git a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c index 8ac1f1ce4442..eb3d7a02fcf6 100644 --- a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c +++ b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c @@ -885,7 +885,7 @@ static int ti_iodelay_probe(struct platform_device *pdev) iod->desc.name = dev_name(dev); iod->desc.owner = THIS_MODULE; - ret = pinctrl_register_and_init(&iod->desc, dev, iod, &iod->pctl); + ret = devm_pinctrl_register_and_init(dev, &iod->desc, iod, &iod->pctl); if (ret) { dev_err(dev, "Failed to register pinctrl\n"); goto exit_out; @@ -893,7 +893,11 @@ static int ti_iodelay_probe(struct platform_device *pdev) platform_set_drvdata(pdev, iod); - return pinctrl_enable(iod->pctl); + ret = pinctrl_enable(iod->pctl); + if (ret) + goto exit_out; + + return 0; exit_out: of_node_put(np); @@ -910,12 +914,6 @@ static int ti_iodelay_remove(struct platform_device *pdev) { struct ti_iodelay_device *iod = platform_get_drvdata(pdev); - if (!iod) - return 0; - - if (iod->pctl) - pinctrl_unregister(iod->pctl); - ti_iodelay_pinconf_deinit_dev(iod); /* Expect other allocations to be freed by devm */ diff --git a/drivers/platform/chrome/cros_ec_debugfs.c b/drivers/platform/chrome/cros_ec_debugfs.c index 4cc66f405760..d15c2f9df3c0 100644 --- a/drivers/platform/chrome/cros_ec_debugfs.c +++ b/drivers/platform/chrome/cros_ec_debugfs.c @@ -236,6 +236,7 @@ static int ec_read_version_supported(struct cros_ec_dev *ec) if (!msg) return 0; + msg->version = 1; msg->command = EC_CMD_GET_CMD_VERSIONS + ec->cmd_offset; msg->outsize = sizeof(*params); msg->insize = sizeof(*response); diff --git a/drivers/platform/mips/cpu_hwmon.c b/drivers/platform/mips/cpu_hwmon.c index 02484ae9a116..89249986ea00 100644 --- a/drivers/platform/mips/cpu_hwmon.c +++ b/drivers/platform/mips/cpu_hwmon.c @@ -163,6 +163,9 @@ static int __init loongson_hwmon_init(void) goto fail_hwmon_device_register; } + if (!csr_temp_enable && !loongson_chiptemp[0]) + return -ENODEV; + nr_packages = loongson_sysconf.nr_cpus / loongson_sysconf.cores_per_package; diff --git a/drivers/power/supply/axp288_charger.c b/drivers/power/supply/axp288_charger.c index b8f7da57c78a..32c5408cd6aa 100644 --- a/drivers/power/supply/axp288_charger.c +++ b/drivers/power/supply/axp288_charger.c @@ -194,18 +194,18 @@ static inline int axp288_charger_set_cv(struct axp288_chrg_info *info, int cv) u8 reg_val; int ret; - if (cv <= CV_4100MV) { - reg_val = CHRG_CCCV_CV_4100MV; - cv = CV_4100MV; - } else if (cv <= CV_4150MV) { - reg_val = CHRG_CCCV_CV_4150MV; - cv = CV_4150MV; - } else if (cv <= CV_4200MV) { + if (cv >= CV_4350MV) { + reg_val = CHRG_CCCV_CV_4350MV; + cv = CV_4350MV; + } else if (cv >= CV_4200MV) { reg_val = CHRG_CCCV_CV_4200MV; cv = CV_4200MV; + } else if (cv >= CV_4150MV) { + reg_val = CHRG_CCCV_CV_4150MV; + cv = CV_4150MV; } else { - reg_val = CHRG_CCCV_CV_4350MV; - cv = CV_4350MV; + reg_val = CHRG_CCCV_CV_4100MV; + cv = CV_4100MV; } reg_val = reg_val << CHRG_CCCV_CV_BIT_POS; @@ -387,8 +387,8 @@ static int axp288_charger_usb_set_property(struct power_supply *psy, dev_warn(&info->pdev->dev, "set charge current failed\n"); break; case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE: - scaled_val = min(val->intval, info->max_cv); - scaled_val = DIV_ROUND_CLOSEST(scaled_val, 1000); + scaled_val = DIV_ROUND_CLOSEST(val->intval, 1000); + scaled_val = min(scaled_val, info->max_cv); ret = axp288_charger_set_cv(info, scaled_val); if (ret < 0) dev_warn(&info->pdev->dev, "set charge voltage failed\n"); diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/pwm-stm32.c index 5668e3a2f0ea..81451623a246 100644 --- a/drivers/pwm/pwm-stm32.c +++ b/drivers/pwm/pwm-stm32.c @@ -198,8 +198,9 @@ static int stm32_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, enabled = pwm->state.enabled; - if (enabled && !state->enabled) { - stm32_pwm_disable(priv, pwm->hwpwm); + if (!state->enabled) { + if (enabled) + stm32_pwm_disable(priv, pwm->hwpwm); return 0; } diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 05bcbce2013a..358cfe7be20a 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -289,6 +289,11 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, struct resource res; node = of_parse_phandle(np, "memory-region", a); + if (!node) + continue; + /* Not map vdevbuffer, vdevring region */ + if (!strncmp(node->name, "vdev", strlen("vdev"))) + continue; err = of_address_to_resource(node, 0, &res); if (err) { dev_err(dev, "unable to resolve memory region\n"); diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c index f051da3288c3..4f8e7602e050 100644 --- a/drivers/scsi/qla2xxx/qla_bsg.c +++ b/drivers/scsi/qla2xxx/qla_bsg.c @@ -302,7 +302,7 @@ qla2x00_process_els(struct bsg_job *bsg_job) "request_sg_cnt=%x reply_sg_cnt=%x.\n", bsg_job->request_payload.sg_cnt, bsg_job->reply_payload.sg_cnt); - rval = -EPERM; + rval = -ENOBUFS; goto done; } diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c index 375a88e18afe..7cff59188b9c 100644 --- a/drivers/scsi/qla2xxx/qla_mid.c +++ b/drivers/scsi/qla2xxx/qla_mid.c @@ -158,7 +158,7 @@ qla24xx_disable_vp(scsi_qla_host_t *vha) atomic_set(&vha->loop_state, LOOP_DOWN); atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); list_for_each_entry(fcport, &vha->vp_fcports, list) - fcport->logout_on_delete = 0; + fcport->logout_on_delete = 1; qla2x00_mark_all_devices_lost(vha, 0); diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 21b1143728ea..35846f617cbf 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -5154,11 +5154,16 @@ static inline void ufshcd_add_delay_before_dme_cmd(struct ufs_hba *hba) min_sleep_time_us = MIN_DELAY_BEFORE_DME_CMDS_US - delta; else - return; /* no more delay required */ + min_sleep_time_us = 0; /* no more delay required */ } - /* allow sleep for extra 50us if needed */ - usleep_range(min_sleep_time_us, min_sleep_time_us + 50); + if (min_sleep_time_us > 0) { + /* allow sleep for extra 50us if needed */ + usleep_range(min_sleep_time_us, min_sleep_time_us + 50); + } + + /* update the last_dme_cmd_tstamp */ + hba->last_dme_cmd_tstamp = ktime_get(); } static inline void ufshcd_save_tstamp_of_last_dme_cmd( diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c index 8fe51f7541bb..695034e076c5 100644 --- a/drivers/spi/spi-fsl-lpspi.c +++ b/drivers/spi/spi-fsl-lpspi.c @@ -1,19 +1,9 @@ -/* - * Freescale i.MX7ULP LPSPI driver - * - * Copyright 2016 Freescale Semiconductor, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ +// SPDX-License-Identifier: GPL-2.0+ +// +// Freescale i.MX7ULP LPSPI driver +// +// Copyright 2016 Freescale Semiconductor, Inc. +// Copyright 2018 NXP Semiconductors #include #include @@ -65,6 +55,7 @@ #define IER_RDIE BIT(1) #define IER_TDIE BIT(0) #define CFGR1_PCSCFG BIT(27) +#define CFGR1_PINCFG (BIT(24)|BIT(25)) #define CFGR1_PCSPOL BIT(8) #define CFGR1_NOSTALL BIT(3) #define CFGR1_MASTER BIT(0) @@ -76,8 +67,6 @@ #define TCR_RXMSK BIT(19) #define TCR_TXMSK BIT(18) -static int clkdivs[] = {1, 2, 4, 8, 16, 32, 64, 128}; - struct lpspi_config { u8 bpw; u8 chip_select; @@ -89,7 +78,9 @@ struct lpspi_config { struct fsl_lpspi_data { struct device *dev; void __iomem *base; - struct clk *clk; + struct clk *clk_ipg; + struct clk *clk_per; + bool is_slave; void *rx_buf; const void *tx_buf; @@ -97,11 +88,14 @@ struct fsl_lpspi_data { void (*rx)(struct fsl_lpspi_data *); u32 remain; + u8 watermark; u8 txfifosize; u8 rxfifosize; struct lpspi_config config; struct completion xfer_done; + + bool slave_aborted; }; static const struct of_device_id fsl_lpspi_dt_ids[] = { @@ -148,18 +142,32 @@ static void fsl_lpspi_intctrl(struct fsl_lpspi_data *fsl_lpspi, writel(enable, fsl_lpspi->base + IMX7ULP_IER); } -static int lpspi_prepare_xfer_hardware(struct spi_master *master) +static int lpspi_prepare_xfer_hardware(struct spi_controller *controller) { - struct fsl_lpspi_data *fsl_lpspi = spi_master_get_devdata(master); + struct fsl_lpspi_data *fsl_lpspi = + spi_controller_get_devdata(controller); + int ret; + + ret = clk_prepare_enable(fsl_lpspi->clk_ipg); + if (ret) + return ret; - return clk_prepare_enable(fsl_lpspi->clk); + ret = clk_prepare_enable(fsl_lpspi->clk_per); + if (ret) { + clk_disable_unprepare(fsl_lpspi->clk_ipg); + return ret; + } + + return 0; } -static int lpspi_unprepare_xfer_hardware(struct spi_master *master) +static int lpspi_unprepare_xfer_hardware(struct spi_controller *controller) { - struct fsl_lpspi_data *fsl_lpspi = spi_master_get_devdata(master); + struct fsl_lpspi_data *fsl_lpspi = + spi_controller_get_devdata(controller); - clk_disable_unprepare(fsl_lpspi->clk); + clk_disable_unprepare(fsl_lpspi->clk_ipg); + clk_disable_unprepare(fsl_lpspi->clk_per); return 0; } @@ -214,21 +222,22 @@ static void fsl_lpspi_set_cmd(struct fsl_lpspi_data *fsl_lpspi, u32 temp = 0; temp |= fsl_lpspi->config.bpw - 1; - temp |= fsl_lpspi->config.prescale << 27; temp |= (fsl_lpspi->config.mode & 0x3) << 30; - temp |= (fsl_lpspi->config.chip_select & 0x3) << 24; - - /* - * Set TCR_CONT will keep SS asserted after current transfer. - * For the first transfer, clear TCR_CONTC to assert SS. - * For subsequent transfer, set TCR_CONTC to keep SS asserted. - */ - temp |= TCR_CONT; - if (is_first_xfer) - temp &= ~TCR_CONTC; - else - temp |= TCR_CONTC; - + if (!fsl_lpspi->is_slave) { + temp |= fsl_lpspi->config.prescale << 27; + temp |= (fsl_lpspi->config.chip_select & 0x3) << 24; + + /* + * Set TCR_CONT will keep SS asserted after current transfer. + * For the first transfer, clear TCR_CONTC to assert SS. + * For subsequent transfer, set TCR_CONTC to keep SS asserted. + */ + temp |= TCR_CONT; + if (is_first_xfer) + temp &= ~TCR_CONTC; + else + temp |= TCR_CONTC; + } writel(temp, fsl_lpspi->base + IMX7ULP_TCR); dev_dbg(fsl_lpspi->dev, "TCR=0x%x\n", temp); @@ -238,7 +247,7 @@ static void fsl_lpspi_set_watermark(struct fsl_lpspi_data *fsl_lpspi) { u32 temp; - temp = fsl_lpspi->txfifosize >> 1 | (fsl_lpspi->rxfifosize >> 1) << 16; + temp = fsl_lpspi->watermark >> 1 | (fsl_lpspi->watermark >> 1) << 16; writel(temp, fsl_lpspi->base + IMX7ULP_FCR); @@ -248,23 +257,32 @@ static void fsl_lpspi_set_watermark(struct fsl_lpspi_data *fsl_lpspi) static int fsl_lpspi_set_bitrate(struct fsl_lpspi_data *fsl_lpspi) { struct lpspi_config config = fsl_lpspi->config; - unsigned int perclk_rate, scldiv; + unsigned int perclk_rate, scldiv, div; u8 prescale; - perclk_rate = clk_get_rate(fsl_lpspi->clk); + perclk_rate = clk_get_rate(fsl_lpspi->clk_per); + + if (config.speed_hz > perclk_rate / 2) { + dev_err(fsl_lpspi->dev, + "per-clk should be at least two times of transfer speed"); + return -EINVAL; + } + + div = DIV_ROUND_UP(perclk_rate, config.speed_hz); + for (prescale = 0; prescale < 8; prescale++) { - scldiv = perclk_rate / - (clkdivs[prescale] * config.speed_hz) - 2; + scldiv = div / (1 << prescale) - 2; if (scldiv < 256) { fsl_lpspi->config.prescale = prescale; break; } } - if (prescale == 8 && scldiv >= 256) + if (scldiv >= 256) return -EINVAL; - writel(scldiv, fsl_lpspi->base + IMX7ULP_CCR); + writel(scldiv | (scldiv << 8) | ((scldiv >> 1) << 16), + fsl_lpspi->base + IMX7ULP_CCR); dev_dbg(fsl_lpspi->dev, "perclk=%d, speed=%d, prescale =%d, scldiv=%d\n", perclk_rate, config.speed_hz, prescale, scldiv); @@ -281,13 +299,18 @@ static int fsl_lpspi_config(struct fsl_lpspi_data *fsl_lpspi) writel(temp, fsl_lpspi->base + IMX7ULP_CR); writel(0, fsl_lpspi->base + IMX7ULP_CR); - ret = fsl_lpspi_set_bitrate(fsl_lpspi); - if (ret) - return ret; + if (!fsl_lpspi->is_slave) { + ret = fsl_lpspi_set_bitrate(fsl_lpspi); + if (ret) + return ret; + } fsl_lpspi_set_watermark(fsl_lpspi); - temp = CFGR1_PCSCFG | CFGR1_MASTER; + if (!fsl_lpspi->is_slave) + temp = CFGR1_MASTER; + else + temp = CFGR1_PINCFG; if (fsl_lpspi->config.mode & SPI_CS_HIGH) temp |= CFGR1_PCSPOL; writel(temp, fsl_lpspi->base + IMX7ULP_CFGR1); @@ -299,10 +322,11 @@ static int fsl_lpspi_config(struct fsl_lpspi_data *fsl_lpspi) return 0; } -static void fsl_lpspi_setup_transfer(struct spi_device *spi, +static int fsl_lpspi_setup_transfer(struct spi_device *spi, struct spi_transfer *t) { - struct fsl_lpspi_data *fsl_lpspi = spi_master_get_devdata(spi->master); + struct fsl_lpspi_data *fsl_lpspi = + spi_controller_get_devdata(spi->controller); fsl_lpspi->config.mode = spi->mode; fsl_lpspi->config.bpw = t ? t->bits_per_word : spi->bits_per_word; @@ -326,14 +350,51 @@ static void fsl_lpspi_setup_transfer(struct spi_device *spi, fsl_lpspi->tx = fsl_lpspi_buf_tx_u32; } - fsl_lpspi_config(fsl_lpspi); + if (t->len <= fsl_lpspi->txfifosize) + fsl_lpspi->watermark = t->len; + else + fsl_lpspi->watermark = fsl_lpspi->txfifosize; + + return fsl_lpspi_config(fsl_lpspi); } -static int fsl_lpspi_transfer_one(struct spi_master *master, +static int fsl_lpspi_slave_abort(struct spi_controller *controller) +{ + struct fsl_lpspi_data *fsl_lpspi = + spi_controller_get_devdata(controller); + + fsl_lpspi->slave_aborted = true; + complete(&fsl_lpspi->xfer_done); + return 0; +} + +static int fsl_lpspi_wait_for_completion(struct spi_controller *controller) +{ + struct fsl_lpspi_data *fsl_lpspi = + spi_controller_get_devdata(controller); + + if (fsl_lpspi->is_slave) { + if (wait_for_completion_interruptible(&fsl_lpspi->xfer_done) || + fsl_lpspi->slave_aborted) { + dev_dbg(fsl_lpspi->dev, "interrupted\n"); + return -EINTR; + } + } else { + if (!wait_for_completion_timeout(&fsl_lpspi->xfer_done, HZ)) { + dev_dbg(fsl_lpspi->dev, "wait for completion timeout\n"); + return -ETIMEDOUT; + } + } + + return 0; +} + +static int fsl_lpspi_transfer_one(struct spi_controller *controller, struct spi_device *spi, struct spi_transfer *t) { - struct fsl_lpspi_data *fsl_lpspi = spi_master_get_devdata(master); + struct fsl_lpspi_data *fsl_lpspi = + spi_controller_get_devdata(controller); int ret; fsl_lpspi->tx_buf = t->tx_buf; @@ -341,13 +402,13 @@ static int fsl_lpspi_transfer_one(struct spi_master *master, fsl_lpspi->remain = t->len; reinit_completion(&fsl_lpspi->xfer_done); + fsl_lpspi->slave_aborted = false; + fsl_lpspi_write_tx_fifo(fsl_lpspi); - ret = wait_for_completion_timeout(&fsl_lpspi->xfer_done, HZ); - if (!ret) { - dev_dbg(fsl_lpspi->dev, "wait for completion timeout\n"); - return -ETIMEDOUT; - } + ret = fsl_lpspi_wait_for_completion(controller); + if (ret) + return ret; ret = fsl_lpspi_txfifo_empty(fsl_lpspi); if (ret) @@ -358,10 +419,11 @@ static int fsl_lpspi_transfer_one(struct spi_master *master, return 0; } -static int fsl_lpspi_transfer_one_msg(struct spi_master *master, +static int fsl_lpspi_transfer_one_msg(struct spi_controller *controller, struct spi_message *msg) { - struct fsl_lpspi_data *fsl_lpspi = spi_master_get_devdata(master); + struct fsl_lpspi_data *fsl_lpspi = + spi_controller_get_devdata(controller); struct spi_device *spi = msg->spi; struct spi_transfer *xfer; bool is_first_xfer = true; @@ -372,12 +434,15 @@ static int fsl_lpspi_transfer_one_msg(struct spi_master *master, msg->actual_length = 0; list_for_each_entry(xfer, &msg->transfers, transfer_list) { - fsl_lpspi_setup_transfer(spi, xfer); + ret = fsl_lpspi_setup_transfer(spi, xfer); + if (ret < 0) + goto complete; + fsl_lpspi_set_cmd(fsl_lpspi, is_first_xfer); is_first_xfer = false; - ret = fsl_lpspi_transfer_one(master, spi, xfer); + ret = fsl_lpspi_transfer_one(controller, spi, xfer); if (ret < 0) goto complete; @@ -385,13 +450,15 @@ static int fsl_lpspi_transfer_one_msg(struct spi_master *master, } complete: - /* de-assert SS, then finalize current message */ - temp = readl(fsl_lpspi->base + IMX7ULP_TCR); - temp &= ~TCR_CONTC; - writel(temp, fsl_lpspi->base + IMX7ULP_TCR); + if (!fsl_lpspi->is_slave) { + /* de-assert SS, then finalize current message */ + temp = readl(fsl_lpspi->base + IMX7ULP_TCR); + temp &= ~TCR_CONTC; + writel(temp, fsl_lpspi->base + IMX7ULP_TCR); + } msg->status = ret; - spi_finalize_current_message(master); + spi_finalize_current_message(controller); return ret; } @@ -421,30 +488,39 @@ static irqreturn_t fsl_lpspi_isr(int irq, void *dev_id) static int fsl_lpspi_probe(struct platform_device *pdev) { struct fsl_lpspi_data *fsl_lpspi; - struct spi_master *master; + struct spi_controller *controller; struct resource *res; int ret, irq; u32 temp; - master = spi_alloc_master(&pdev->dev, sizeof(struct fsl_lpspi_data)); - if (!master) + if (of_property_read_bool((&pdev->dev)->of_node, "spi-slave")) + controller = spi_alloc_slave(&pdev->dev, + sizeof(struct fsl_lpspi_data)); + else + controller = spi_alloc_master(&pdev->dev, + sizeof(struct fsl_lpspi_data)); + + if (!controller) return -ENOMEM; - platform_set_drvdata(pdev, master); + platform_set_drvdata(pdev, controller); - master->bits_per_word_mask = SPI_BPW_RANGE_MASK(8, 32); - master->bus_num = pdev->id; + controller->bits_per_word_mask = SPI_BPW_RANGE_MASK(8, 32); + controller->bus_num = pdev->id; - fsl_lpspi = spi_master_get_devdata(master); + fsl_lpspi = spi_controller_get_devdata(controller); fsl_lpspi->dev = &pdev->dev; - - master->transfer_one_message = fsl_lpspi_transfer_one_msg; - master->prepare_transfer_hardware = lpspi_prepare_xfer_hardware; - master->unprepare_transfer_hardware = lpspi_unprepare_xfer_hardware; - master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH; - master->flags = SPI_MASTER_MUST_RX | SPI_MASTER_MUST_TX; - master->dev.of_node = pdev->dev.of_node; - master->bus_num = pdev->id; + fsl_lpspi->is_slave = of_property_read_bool((&pdev->dev)->of_node, + "spi-slave"); + + controller->transfer_one_message = fsl_lpspi_transfer_one_msg; + controller->prepare_transfer_hardware = lpspi_prepare_xfer_hardware; + controller->unprepare_transfer_hardware = lpspi_unprepare_xfer_hardware; + controller->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH; + controller->flags = SPI_MASTER_MUST_RX | SPI_MASTER_MUST_TX; + controller->dev.of_node = pdev->dev.of_node; + controller->bus_num = pdev->id; + controller->slave_abort = fsl_lpspi_slave_abort; init_completion(&fsl_lpspi->xfer_done); @@ -452,60 +528,78 @@ static int fsl_lpspi_probe(struct platform_device *pdev) fsl_lpspi->base = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(fsl_lpspi->base)) { ret = PTR_ERR(fsl_lpspi->base); - goto out_master_put; + goto out_controller_put; } irq = platform_get_irq(pdev, 0); if (irq < 0) { ret = irq; - goto out_master_put; + goto out_controller_put; } ret = devm_request_irq(&pdev->dev, irq, fsl_lpspi_isr, 0, dev_name(&pdev->dev), fsl_lpspi); if (ret) { dev_err(&pdev->dev, "can't get irq%d: %d\n", irq, ret); - goto out_master_put; + goto out_controller_put; + } + + fsl_lpspi->clk_per = devm_clk_get(&pdev->dev, "per"); + if (IS_ERR(fsl_lpspi->clk_per)) { + ret = PTR_ERR(fsl_lpspi->clk_per); + goto out_controller_put; } - fsl_lpspi->clk = devm_clk_get(&pdev->dev, "ipg"); - if (IS_ERR(fsl_lpspi->clk)) { - ret = PTR_ERR(fsl_lpspi->clk); - goto out_master_put; + fsl_lpspi->clk_ipg = devm_clk_get(&pdev->dev, "ipg"); + if (IS_ERR(fsl_lpspi->clk_ipg)) { + ret = PTR_ERR(fsl_lpspi->clk_ipg); + goto out_controller_put; + } + + ret = clk_prepare_enable(fsl_lpspi->clk_ipg); + if (ret) { + dev_err(&pdev->dev, + "can't enable lpspi ipg clock, ret=%d\n", ret); + goto out_controller_put; } - ret = clk_prepare_enable(fsl_lpspi->clk); + ret = clk_prepare_enable(fsl_lpspi->clk_per); if (ret) { - dev_err(&pdev->dev, "can't enable lpspi clock, ret=%d\n", ret); - goto out_master_put; + dev_err(&pdev->dev, + "can't enable lpspi per clock, ret=%d\n", ret); + clk_disable_unprepare(fsl_lpspi->clk_ipg); + goto out_controller_put; } temp = readl(fsl_lpspi->base + IMX7ULP_PARAM); fsl_lpspi->txfifosize = 1 << (temp & 0x0f); fsl_lpspi->rxfifosize = 1 << ((temp >> 8) & 0x0f); - clk_disable_unprepare(fsl_lpspi->clk); + clk_disable_unprepare(fsl_lpspi->clk_per); + clk_disable_unprepare(fsl_lpspi->clk_ipg); - ret = devm_spi_register_master(&pdev->dev, master); + ret = devm_spi_register_controller(&pdev->dev, controller); if (ret < 0) { - dev_err(&pdev->dev, "spi_register_master error.\n"); - goto out_master_put; + dev_err(&pdev->dev, "spi_register_controller error.\n"); + goto out_controller_put; } return 0; -out_master_put: - spi_master_put(master); +out_controller_put: + spi_controller_put(controller); return ret; } static int fsl_lpspi_remove(struct platform_device *pdev) { - struct spi_master *master = platform_get_drvdata(pdev); - struct fsl_lpspi_data *fsl_lpspi = spi_master_get_devdata(master); + struct spi_controller *controller = platform_get_drvdata(pdev); + struct fsl_lpspi_data *fsl_lpspi = + spi_controller_get_devdata(controller); - clk_disable_unprepare(fsl_lpspi->clk); + clk_disable_unprepare(fsl_lpspi->clk_per); + clk_disable_unprepare(fsl_lpspi->clk_ipg); return 0; } @@ -520,6 +614,6 @@ static struct platform_driver fsl_lpspi_driver = { }; module_platform_driver(fsl_lpspi_driver); -MODULE_DESCRIPTION("LPSPI Master Controller driver"); +MODULE_DESCRIPTION("LPSPI Controller driver"); MODULE_AUTHOR("Gao Pan "); MODULE_LICENSE("GPL"); diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 5c9e03aba654..e87caaee84b9 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -873,6 +873,14 @@ static int uart_set_info(struct tty_struct *tty, struct tty_port *port, new_flags = (__force upf_t)new_info->flags; old_custom_divisor = uport->custom_divisor; + if (!(uport->flags & UPF_FIXED_PORT)) { + unsigned int uartclk = new_info->baud_base * 16; + /* check needs to be done here before other settings made */ + if (uartclk == 0) { + retval = -EINVAL; + goto exit; + } + } if (!capable(CAP_SYS_ADMIN)) { retval = -EPERM; if (change_irq || change_port || diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c index b0ef0113a232..2f8042843c90 100644 --- a/drivers/usb/gadget/udc/core.c +++ b/drivers/usb/gadget/udc/core.c @@ -108,12 +108,10 @@ int usb_ep_enable(struct usb_ep *ep) goto out; /* UDC drivers can't handle endpoints with maxpacket size 0 */ - if (usb_endpoint_maxp(ep->desc) == 0) { - /* - * We should log an error message here, but we can't call - * dev_err() because there's no way to find the gadget - * given only ep. - */ + if (!ep->desc || usb_endpoint_maxp(ep->desc) == 0) { + WARN_ONCE(1, "%s: ep%d (%s) has %s\n", __func__, ep->address, ep->name, + (!ep->desc) ? "NULL descriptor" : "maxpacket 0"); + ret = -EINVAL; goto out; } diff --git a/drivers/usb/serial/usb_debug.c b/drivers/usb/serial/usb_debug.c index c593ca8800e5..b9d27cdf3b82 100644 --- a/drivers/usb/serial/usb_debug.c +++ b/drivers/usb/serial/usb_debug.c @@ -72,6 +72,11 @@ static void usb_debug_process_read_urb(struct urb *urb) usb_serial_generic_process_read_urb(urb); } +static void usb_debug_init_termios(struct tty_struct *tty) +{ + tty->termios.c_lflag &= ~(ECHO | ECHONL); +} + static struct usb_serial_driver debug_device = { .driver = { .owner = THIS_MODULE, @@ -81,6 +86,7 @@ static struct usb_serial_driver debug_device = { .num_ports = 1, .bulk_out_size = USB_DEBUG_MAX_PACKET_SIZE, .break_ctl = usb_debug_break_ctl, + .init_termios = usb_debug_init_termios, .process_read_urb = usb_debug_process_read_urb, }; @@ -92,6 +98,7 @@ static struct usb_serial_driver dbc_device = { .id_table = dbc_id_table, .num_ports = 1, .break_ctl = usb_debug_break_ctl, + .init_termios = usb_debug_init_termios, .process_read_urb = usb_debug_process_read_urb, }; diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 22e8cda7a137..e8b120f63e92 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -765,6 +765,7 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flag * */ if (usb_pipedevice(urb->pipe) == 0) { + struct usb_device *old; __u8 type = usb_pipetype(urb->pipe); struct usb_ctrlrequest *ctrlreq = (struct usb_ctrlrequest *) urb->setup_packet; @@ -775,14 +776,15 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flag goto no_need_xmit; } + old = vdev->udev; switch (ctrlreq->bRequest) { case USB_REQ_SET_ADDRESS: /* set_address may come when a device is reset */ dev_info(dev, "SetAddress Request (%d) to port %d\n", ctrlreq->wValue, vdev->rhport); - usb_put_dev(vdev->udev); vdev->udev = usb_get_dev(urb->dev); + usb_put_dev(old); spin_lock(&vdev->ud.lock); vdev->ud.status = VDEV_ST_USED; @@ -801,8 +803,8 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flag usbip_dbg_vhci_hc( "Not yet?:Get_Descriptor to device 0 (get max pipe size)\n"); - usb_put_dev(vdev->udev); vdev->udev = usb_get_dev(urb->dev); + usb_put_dev(old); goto out; default: @@ -1109,6 +1111,7 @@ static void vhci_shutdown_connection(struct usbip_device *ud) static void vhci_device_reset(struct usbip_device *ud) { struct vhci_device *vdev = container_of(ud, struct vhci_device, ud); + struct usb_device *old = vdev->udev; unsigned long flags; spin_lock_irqsave(&ud->lock, flags); @@ -1116,8 +1119,8 @@ static void vhci_device_reset(struct usbip_device *ud) vdev->speed = 0; vdev->devid = 0; - usb_put_dev(vdev->udev); vdev->udev = NULL; + usb_put_dev(old); if (ud->tcp_socket) { sockfd_put(ud->tcp_socket); diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index b272299afb67..d8395431a2f4 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c @@ -804,6 +804,7 @@ static int __load_free_space_cache(struct btrfs_root *root, struct inode *inode, if (ret) { btrfs_err(fs_info, "Duplicate entries in free space cache, dumping"); + kfree(e->bitmap); kmem_cache_free(btrfs_free_space_cachep, e); goto free_cache; } diff --git a/fs/exec.c b/fs/exec.c index 27daccaf8953..0d5512c0de33 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -1515,6 +1515,7 @@ static void bprm_fill_uid(struct linux_binprm *bprm) unsigned int mode; kuid_t uid; kgid_t gid; + int err; /* * Since this can be called multiple times (via prepare_binprm), @@ -1539,12 +1540,17 @@ static void bprm_fill_uid(struct linux_binprm *bprm) /* Be careful if suid/sgid is set */ inode_lock(inode); - /* reload atomically mode/uid/gid now that lock held */ + /* Atomically reload and check mode/uid/gid now that lock held. */ mode = inode->i_mode; uid = inode->i_uid; gid = inode->i_gid; + err = inode_permission(inode, MAY_EXEC); inode_unlock(inode); + /* Did the exec bit vanish out from under us? Give up. */ + if (err) + return; + /* We ignore suid/sgid if there are no mappings for them in the ns */ if (!kuid_has_mapping(bprm->cred->user_ns, uid) || !kgid_has_mapping(bprm->cred->user_ns, gid)) diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 316d508473c9..cc15c995b4e9 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -1865,8 +1865,7 @@ int ext4_mb_find_by_goal(struct ext4_allocation_context *ac, if (max >= ac->ac_g_ex.fe_len && ac->ac_g_ex.fe_len == sbi->s_stripe) { ext4_fsblk_t start; - start = ext4_group_first_block_no(ac->ac_sb, e4b->bd_group) + - ex.fe_start; + start = ext4_grp_offs_to_block(ac->ac_sb, &ex); /* use do_div to get remainder (would be 64-bit modulo) */ if (do_div(start, sbi->s_stripe) == 0) { ac->ac_found++; diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 52bd8a72bc6a..150aa1408122 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -134,10 +134,11 @@ static struct buffer_head *__ext4_read_dirblock(struct inode *inode, return bh; } - if (!bh && (type == INDEX || type == DIRENT_HTREE)) { + /* The first directory block must not be a hole. */ + if (!bh && (type == INDEX || type == DIRENT_HTREE || block == 0)) { ext4_error_inode(inode, func, line, block, - "Directory hole found for htree %s block", - (type == INDEX) ? "index" : "leaf"); + "Directory hole found for htree %s block %u", + (type == INDEX) ? "index" : "leaf", block); return ERR_PTR(-EFSCORRUPTED); } if (!bh) @@ -2187,6 +2188,52 @@ static int add_dirent_to_buf(handle_t *handle, struct ext4_filename *fname, return 0; } +static bool ext4_check_dx_root(struct inode *dir, struct dx_root *root) +{ + struct fake_dirent *fde; + const char *error_msg; + unsigned int rlen; + unsigned int blocksize = dir->i_sb->s_blocksize; + char *blockend = (char *)root + dir->i_sb->s_blocksize; + + fde = &root->dot; + if (unlikely(fde->name_len != 1)) { + error_msg = "invalid name_len for '.'"; + goto corrupted; + } + if (unlikely(strncmp(root->dot_name, ".", fde->name_len))) { + error_msg = "invalid name for '.'"; + goto corrupted; + } + rlen = ext4_rec_len_from_disk(fde->rec_len, blocksize); + if (unlikely((char *)fde + rlen >= blockend)) { + error_msg = "invalid rec_len for '.'"; + goto corrupted; + } + + fde = &root->dotdot; + if (unlikely(fde->name_len != 2)) { + error_msg = "invalid name_len for '..'"; + goto corrupted; + } + if (unlikely(strncmp(root->dotdot_name, "..", fde->name_len))) { + error_msg = "invalid name for '..'"; + goto corrupted; + } + rlen = ext4_rec_len_from_disk(fde->rec_len, blocksize); + if (unlikely((char *)fde + rlen >= blockend)) { + error_msg = "invalid rec_len for '..'"; + goto corrupted; + } + + return true; + +corrupted: + EXT4_ERROR_INODE(dir, "Corrupt dir, %s, running e2fsck is recommended", + error_msg); + return false; +} + /* * This converts a one block unindexed directory to a 3 block indexed * directory, and adds the dentry to the indexed directory. @@ -2221,17 +2268,17 @@ static int make_indexed_dir(handle_t *handle, struct ext4_filename *fname, brelse(bh); return retval; } + root = (struct dx_root *) bh->b_data; + if (!ext4_check_dx_root(dir, root)) { + brelse(bh); + return -EFSCORRUPTED; + } /* The 0th block becomes the root, move the dirents out */ fde = &root->dotdot; de = (struct ext4_dir_entry_2 *)((char *)fde + ext4_rec_len_from_disk(fde->rec_len, blocksize)); - if ((char *) de >= (((char *) root) + blocksize)) { - EXT4_ERROR_INODE(dir, "invalid rec_len for '..'"); - brelse(bh); - return -EFSCORRUPTED; - } len = ((char *) root) + (blocksize - csum_size) - (char *) de; /* Allocate new block for the 0th block's dirents */ @@ -3012,10 +3059,7 @@ bool ext4_empty_dir(struct inode *inode) EXT4_ERROR_INODE(inode, "invalid size"); return true; } - /* The first directory block must not be a hole, - * so treat it as DIRENT_HTREE - */ - bh = ext4_read_dirblock(inode, 0, DIRENT_HTREE); + bh = ext4_read_dirblock(inode, 0, EITHER); if (IS_ERR(bh)) return true; @@ -3612,10 +3656,7 @@ static struct buffer_head *ext4_get_first_dir_block(handle_t *handle, struct ext4_dir_entry_2 *de; unsigned int offset; - /* The first directory block must not be a hole, so - * treat it as DIRENT_HTREE - */ - bh = ext4_read_dirblock(inode, 0, DIRENT_HTREE); + bh = ext4_read_dirblock(inode, 0, EITHER); if (IS_ERR(bh)) { *retval = PTR_ERR(bh); return NULL; diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index f529ced0b692..80cc5bef1a65 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -1410,6 +1410,12 @@ static int ext4_xattr_inode_write(handle_t *handle, struct inode *ea_inode, goto out; memcpy(bh->b_data, buf, csize); + /* + * Zero out block tail to avoid writing uninitialized memory + * to disk. + */ + if (csize < blocksize) + memset(bh->b_data + csize, 0, blocksize - csize); set_buffer_uptodate(bh); ext4_handle_dirty_metadata(handle, ea_inode, bh); diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index 784daba65c31..d61e44a02328 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -27,6 +27,9 @@ void f2fs_mark_inode_dirty_sync(struct inode *inode, bool sync) if (is_inode_flag_set(inode, FI_NEW_INODE)) return; + if (f2fs_readonly(F2FS_I_SB(inode)->sb)) + return; + if (f2fs_inode_dirtied(inode, sync)) return; diff --git a/fs/file.c b/fs/file.c index 281c34963b2b..5d3fe555cfb1 100644 --- a/fs/file.c +++ b/fs/file.c @@ -881,6 +881,7 @@ __releases(&files->file_lock) * tables and this condition does not arise without those. */ fdt = files_fdtable(files); + fd = array_index_nospec(fd, fdt->max_fds); tofree = fdt->fd[fd]; if (!tofree && fd_is_open(fd, fdt)) goto Ebusy; diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c index 9718e7409c2b..fb416af35896 100644 --- a/fs/hfs/inode.c +++ b/fs/hfs/inode.c @@ -199,6 +199,7 @@ struct inode *hfs_new_inode(struct inode *dir, const struct qstr *name, umode_t HFS_I(inode)->flags = 0; HFS_I(inode)->rsrc_inode = NULL; HFS_I(inode)->fs_blocks = 0; + HFS_I(inode)->tz_secondswest = sys_tz.tz_minuteswest * 60; if (S_ISDIR(mode)) { inode->i_size = 2; HFS_SB(sb)->folder_count++; @@ -274,6 +275,8 @@ void hfs_inode_read_fork(struct inode *inode, struct hfs_extent *ext, for (count = 0, i = 0; i < 3; i++) count += be16_to_cpu(ext[i].count); HFS_I(inode)->first_blocks = count; + HFS_I(inode)->cached_start = 0; + HFS_I(inode)->cached_blocks = 0; inode->i_size = HFS_I(inode)->phys_size = log_size; HFS_I(inode)->fs_blocks = (log_size + sb->s_blocksize - 1) >> sb->s_blocksize_bits; diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 8d651b7f6e41..f96da7ed4189 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -434,6 +434,7 @@ int jbd2_journal_write_metadata_buffer(transaction_t *transaction, tmp = jbd2_alloc(bh_in->b_size, GFP_NOFS); if (!tmp) { brelse(new_bh); + free_buffer_head(new_bh); return -ENOMEM; } jbd_lock_bh_state(bh_in); diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c index 5cdcf68a4803..7f66c12a7962 100644 --- a/fs/jfs/jfs_imap.c +++ b/fs/jfs/jfs_imap.c @@ -305,7 +305,7 @@ int diSync(struct inode *ipimap) int diRead(struct inode *ip) { struct jfs_sb_info *sbi = JFS_SBI(ip->i_sb); - int iagno, ino, extno, rc; + int iagno, ino, extno, rc, agno; struct inode *ipimap; struct dinode *dp; struct iag *iagp; @@ -354,8 +354,11 @@ int diRead(struct inode *ip) /* get the ag for the iag */ agstart = le64_to_cpu(iagp->agstart); + agno = BLKTOAG(agstart, JFS_SBI(ip->i_sb)); release_metapage(mp); + if (agno >= MAXAG || agno < 0) + return -EIO; rel_inode = (ino & (INOSPERPAGE - 1)); pageno = blkno >> sbi->l2nbperpage; diff --git a/fs/nilfs2/btnode.c b/fs/nilfs2/btnode.c index f0a5e0a42ca7..4109caecf42e 100644 --- a/fs/nilfs2/btnode.c +++ b/fs/nilfs2/btnode.c @@ -60,12 +60,21 @@ nilfs_btnode_create_block(struct address_space *btnc, __u64 blocknr) bh = nilfs_grab_buffer(inode, btnc, blocknr, BIT(BH_NILFS_Node)); if (unlikely(!bh)) - return NULL; + return ERR_PTR(-ENOMEM); if (unlikely(buffer_mapped(bh) || buffer_uptodate(bh) || buffer_dirty(bh))) { - brelse(bh); - BUG(); + /* + * The block buffer at the specified new address was already + * in use. This can happen if it is a virtual block number + * and has been reallocated due to corruption of the bitmap + * used to manage its allocation state (if not, the buffer + * clearing of an abandoned b-tree node is missing somewhere). + */ + nilfs_error(inode->i_sb, + "state inconsistency probably due to duplicate use of b-tree node block address %llu (ino=%lu)", + (unsigned long long)blocknr, inode->i_ino); + goto failed; } memset(bh->b_data, 0, i_blocksize(inode)); bh->b_bdev = inode->i_sb->s_bdev; @@ -76,6 +85,12 @@ nilfs_btnode_create_block(struct address_space *btnc, __u64 blocknr) unlock_page(bh->b_page); put_page(bh->b_page); return bh; + +failed: + unlock_page(bh->b_page); + put_page(bh->b_page); + brelse(bh); + return ERR_PTR(-EIO); } int nilfs_btnode_submit_block(struct address_space *btnc, __u64 blocknr, @@ -233,8 +248,8 @@ int nilfs_btnode_prepare_change_key(struct address_space *btnc, } nbh = nilfs_btnode_create_block(btnc, newkey); - if (!nbh) - return -ENOMEM; + if (IS_ERR(nbh)) + return PTR_ERR(nbh); BUG_ON(nbh == obh); ctxt->newbh = nbh; diff --git a/fs/nilfs2/btree.c b/fs/nilfs2/btree.c index ea8e2e87191c..c22884238282 100644 --- a/fs/nilfs2/btree.c +++ b/fs/nilfs2/btree.c @@ -72,8 +72,8 @@ static int nilfs_btree_get_new_block(const struct nilfs_bmap *btree, struct buffer_head *bh; bh = nilfs_btnode_create_block(btnc, ptr); - if (!bh) - return -ENOMEM; + if (IS_ERR(bh)) + return PTR_ERR(bh); set_buffer_nilfs_volatile(bh); *bhp = bh; diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index 2ba676511c22..19689ace214b 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c @@ -143,14 +143,9 @@ static void nilfs_segctor_do_flush(struct nilfs_sc_info *, int); static void nilfs_segctor_do_immediate_flush(struct nilfs_sc_info *); static void nilfs_dispose_list(struct the_nilfs *, struct list_head *, int); -#define nilfs_cnt32_gt(a, b) \ - (typecheck(__u32, a) && typecheck(__u32, b) && \ - ((__s32)(b) - (__s32)(a) < 0)) #define nilfs_cnt32_ge(a, b) \ (typecheck(__u32, a) && typecheck(__u32, b) && \ - ((__s32)(a) - (__s32)(b) >= 0)) -#define nilfs_cnt32_lt(a, b) nilfs_cnt32_gt(b, a) -#define nilfs_cnt32_le(a, b) nilfs_cnt32_ge(b, a) + ((__s32)((a) - (b)) >= 0)) static int nilfs_prepare_segment_lock(struct super_block *sb, struct nilfs_transaction_info *ti) diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c index 6aaca99dcc9d..97c9047bb3dc 100644 --- a/fs/udf/balloc.c +++ b/fs/udf/balloc.c @@ -22,6 +22,7 @@ #include "udfdecl.h" #include +#include #include "udf_i.h" #include "udf_sb.h" @@ -81,7 +82,7 @@ static int __load_block_bitmap(struct super_block *sb, int nr_groups = bitmap->s_nr_groups; if (block_group >= nr_groups) { - udf_debug("block_group (%d) > nr_groups (%d)\n", + udf_debug("block_group (%u) > nr_groups (%d)\n", block_group, nr_groups); } @@ -133,7 +134,6 @@ static void udf_bitmap_free_blocks(struct super_block *sb, { struct udf_sb_info *sbi = UDF_SB(sb); struct buffer_head *bh = NULL; - struct udf_part_map *partmap; unsigned long block; unsigned long block_group; unsigned long bit; @@ -142,19 +142,9 @@ static void udf_bitmap_free_blocks(struct super_block *sb, unsigned long overflow; mutex_lock(&sbi->s_alloc_mutex); - partmap = &sbi->s_partmaps[bloc->partitionReferenceNum]; - if (bloc->logicalBlockNum + count < count || - (bloc->logicalBlockNum + count) > partmap->s_partition_len) { - udf_debug("%d < %d || %d + %d > %d\n", - bloc->logicalBlockNum, 0, - bloc->logicalBlockNum, count, - partmap->s_partition_len); - goto error_return; - } - + /* We make sure this cannot overflow when mounting the filesystem */ block = bloc->logicalBlockNum + offset + (sizeof(struct spaceBitmapDesc) << 3); - do { overflow = 0; block_group = block >> (sb->s_blocksize_bits + 3); @@ -174,9 +164,9 @@ static void udf_bitmap_free_blocks(struct super_block *sb, bh = bitmap->s_block_bitmap[bitmap_nr]; for (i = 0; i < count; i++) { if (udf_set_bit(bit + i, bh->b_data)) { - udf_debug("bit %ld already set\n", bit + i); + udf_debug("bit %lu already set\n", bit + i); udf_debug("byte=%2x\n", - ((char *)bh->b_data)[(bit + i) >> 3]); + ((__u8 *)bh->b_data)[(bit + i) >> 3]); } } udf_add_free_space(sb, sbi->s_partition, count); @@ -373,7 +363,6 @@ static void udf_table_free_blocks(struct super_block *sb, uint32_t count) { struct udf_sb_info *sbi = UDF_SB(sb); - struct udf_part_map *partmap; uint32_t start, end; uint32_t elen; struct kernel_lb_addr eloc; @@ -382,16 +371,6 @@ static void udf_table_free_blocks(struct super_block *sb, struct udf_inode_info *iinfo; mutex_lock(&sbi->s_alloc_mutex); - partmap = &sbi->s_partmaps[bloc->partitionReferenceNum]; - if (bloc->logicalBlockNum + count < count || - (bloc->logicalBlockNum + count) > partmap->s_partition_len) { - udf_debug("%d < %d || %d + %d > %d\n", - bloc->logicalBlockNum, 0, - bloc->logicalBlockNum, count, - partmap->s_partition_len); - goto error_return; - } - iinfo = UDF_I(table); udf_add_free_space(sb, sbi->s_partition, count); @@ -538,7 +517,7 @@ static int udf_table_prealloc_blocks(struct super_block *sb, while (first_block != eloc.logicalBlockNum && (etype = udf_next_aext(table, &epos, &eloc, &elen, 1)) != -1) { - udf_debug("eloc=%d, elen=%d, first_block=%d\n", + udf_debug("eloc=%u, elen=%u, first_block=%u\n", eloc.logicalBlockNum, elen, first_block); ; /* empty loop body */ } @@ -665,6 +644,17 @@ void udf_free_blocks(struct super_block *sb, struct inode *inode, { uint16_t partition = bloc->partitionReferenceNum; struct udf_part_map *map = &UDF_SB(sb)->s_partmaps[partition]; + uint32_t blk; + + if (check_add_overflow(bloc->logicalBlockNum, offset, &blk) || + check_add_overflow(blk, count, &blk) || + bloc->logicalBlockNum + count > map->s_partition_len) { + udf_debug("Invalid request to free blocks: (%d, %u), off %u, " + "len %u, partition len %u\n", + partition, bloc->logicalBlockNum, offset, count, + map->s_partition_len); + return; + } if (map->s_partition_flags & UDF_PART_FLAG_UNALLOC_BITMAP) { udf_bitmap_free_blocks(sb, map->s_uspace.s_bitmap, diff --git a/fs/udf/directory.c b/fs/udf/directory.c index a636b3b17219..12cffe417cfd 100644 --- a/fs/udf/directory.c +++ b/fs/udf/directory.c @@ -178,7 +178,7 @@ struct fileIdentDesc *udf_get_fileident(void *buffer, int bufsize, int *offset) if (fi->descTag.tagIdent != cpu_to_le16(TAG_IDENT_FID)) { udf_debug("0x%x != TAG_IDENT_FID\n", le16_to_cpu(fi->descTag.tagIdent)); - udf_debug("offset: %u sizeof: %lu bufsize: %u\n", + udf_debug("offset: %d sizeof: %lu bufsize: %d\n", *offset, (unsigned long)sizeof(struct fileIdentDesc), bufsize); return NULL; diff --git a/fs/udf/inode.c b/fs/udf/inode.c index f402189909d2..b2564517e348 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -1303,14 +1303,14 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode) reread: if (iloc->partitionReferenceNum >= sbi->s_partitions) { - udf_debug("partition reference: %d > logical volume partitions: %d\n", + udf_debug("partition reference: %u > logical volume partitions: %u\n", iloc->partitionReferenceNum, sbi->s_partitions); return -EIO; } if (iloc->logicalBlockNum >= sbi->s_partmaps[iloc->partitionReferenceNum].s_partition_len) { - udf_debug("block=%d, partition=%d out of range\n", + udf_debug("block=%u, partition=%u out of range\n", iloc->logicalBlockNum, iloc->partitionReferenceNum); return -EIO; } @@ -1329,13 +1329,13 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode) */ bh = udf_read_ptagged(inode->i_sb, iloc, 0, &ident); if (!bh) { - udf_err(inode->i_sb, "(ino %ld) failed !bh\n", inode->i_ino); + udf_err(inode->i_sb, "(ino %lu) failed !bh\n", inode->i_ino); return -EIO; } if (ident != TAG_IDENT_FE && ident != TAG_IDENT_EFE && ident != TAG_IDENT_USE) { - udf_err(inode->i_sb, "(ino %ld) failed ident=%d\n", + udf_err(inode->i_sb, "(ino %lu) failed ident=%u\n", inode->i_ino, ident); goto out; } @@ -1371,7 +1371,7 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode) } brelse(ibh); } else if (fe->icbTag.strategyType != cpu_to_le16(4)) { - udf_err(inode->i_sb, "unsupported strategy type: %d\n", + udf_err(inode->i_sb, "unsupported strategy type: %u\n", le16_to_cpu(fe->icbTag.strategyType)); goto out; } @@ -1564,7 +1564,7 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode) udf_debug("METADATA BITMAP FILE-----\n"); break; default: - udf_err(inode->i_sb, "(ino %ld) failed unknown file type=%d\n", + udf_err(inode->i_sb, "(ino %lu) failed unknown file type=%u\n", inode->i_ino, fe->icbTag.fileType); goto out; } @@ -2108,7 +2108,7 @@ int8_t udf_next_aext(struct inode *inode, struct extent_position *epos, block = udf_get_lb_pblock(inode->i_sb, &epos->block, 0); epos->bh = udf_tread(inode->i_sb, block); if (!epos->bh) { - udf_debug("reading block %d failed!\n", block); + udf_debug("reading block %u failed!\n", block); return -1; } } @@ -2163,7 +2163,7 @@ int8_t udf_current_aext(struct inode *inode, struct extent_position *epos, *elen = le32_to_cpu(lad->extLength) & UDF_EXTENT_LENGTH_MASK; break; default: - udf_debug("alloc_type = %d unsupported\n", iinfo->i_alloc_type); + udf_debug("alloc_type = %u unsupported\n", iinfo->i_alloc_type); return -1; } diff --git a/fs/udf/misc.c b/fs/udf/misc.c index e5f4dcde309f..277ce94fe370 100644 --- a/fs/udf/misc.c +++ b/fs/udf/misc.c @@ -218,7 +218,7 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block, bh = udf_tread(sb, block); if (!bh) { - udf_err(sb, "read failed, block=%u, location=%d\n", + udf_err(sb, "read failed, block=%u, location=%u\n", block, location); return NULL; } @@ -256,7 +256,7 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block, le16_to_cpu(tag_p->descCRCLength))) return bh; - udf_debug("Crc failure block %d: crc = %d, crclen = %d\n", block, + udf_debug("Crc failure block %u: crc = %u, crclen = %u\n", block, le16_to_cpu(tag_p->descCRC), le16_to_cpu(tag_p->descCRCLength)); error_out: diff --git a/fs/udf/namei.c b/fs/udf/namei.c index 72957b1acb1a..da67b8123de3 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c @@ -837,7 +837,7 @@ static int udf_rmdir(struct inode *dir, struct dentry *dentry) if (retval) goto end_rmdir; if (inode->i_nlink != 2) - udf_warn(inode->i_sb, "empty directory has nlink != 2 (%d)\n", + udf_warn(inode->i_sb, "empty directory has nlink != 2 (%u)\n", inode->i_nlink); clear_nlink(inode); inode->i_size = 0; @@ -879,7 +879,7 @@ static int udf_unlink(struct inode *dir, struct dentry *dentry) goto end_unlink; if (!inode->i_nlink) { - udf_debug("Deleting nonexistent file (%lu), %d\n", + udf_debug("Deleting nonexistent file (%lu), %u\n", inode->i_ino, inode->i_nlink); set_nlink(inode, 1); } diff --git a/fs/udf/partition.c b/fs/udf/partition.c index 888c364b2fe9..090baff83990 100644 --- a/fs/udf/partition.c +++ b/fs/udf/partition.c @@ -32,7 +32,7 @@ uint32_t udf_get_pblock(struct super_block *sb, uint32_t block, struct udf_sb_info *sbi = UDF_SB(sb); struct udf_part_map *map; if (partition >= sbi->s_partitions) { - udf_debug("block=%d, partition=%d, offset=%d: invalid partition\n", + udf_debug("block=%u, partition=%u, offset=%u: invalid partition\n", block, partition, offset); return 0xFFFFFFFF; } @@ -59,7 +59,7 @@ uint32_t udf_get_pblock_virt15(struct super_block *sb, uint32_t block, vdata = &map->s_type_specific.s_virtual; if (block > vdata->s_num_entries) { - udf_debug("Trying to access block beyond end of VAT (%d max %d)\n", + udf_debug("Trying to access block beyond end of VAT (%u max %u)\n", block, vdata->s_num_entries); return 0xFFFFFFFF; } @@ -83,7 +83,7 @@ uint32_t udf_get_pblock_virt15(struct super_block *sb, uint32_t block, bh = sb_bread(sb, loc); if (!bh) { - udf_debug("get_pblock(UDF_VIRTUAL_MAP:%p,%d,%d) VAT: %d[%d]\n", + udf_debug("get_pblock(UDF_VIRTUAL_MAP:%p,%u,%u) VAT: %u[%u]\n", sb, block, partition, loc, index); return 0xFFFFFFFF; } diff --git a/fs/udf/super.c b/fs/udf/super.c index e9afabc99d62..e69b2b92542f 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -360,7 +360,7 @@ static int udf_show_options(struct seq_file *seq, struct dentry *root) if (sbi->s_dmode != UDF_INVALID_MODE) seq_printf(seq, ",dmode=%ho", sbi->s_dmode); if (UDF_QUERY_FLAG(sb, UDF_FLAG_SESSION_SET)) - seq_printf(seq, ",session=%u", sbi->s_session); + seq_printf(seq, ",session=%d", sbi->s_session); if (UDF_QUERY_FLAG(sb, UDF_FLAG_LASTBLOCK_SET)) seq_printf(seq, ",lastblock=%u", sbi->s_last_block); if (sbi->s_anchor != 0) @@ -699,7 +699,7 @@ static loff_t udf_check_vsd(struct super_block *sb) sector += (((loff_t)sbi->s_session) << sb->s_blocksize_bits); - udf_debug("Starting at sector %u (%ld byte sectors)\n", + udf_debug("Starting at sector %u (%lu byte sectors)\n", (unsigned int)(sector >> sb->s_blocksize_bits), sb->s_blocksize); /* Process the sequence (if applicable). The hard limit on the sector @@ -862,7 +862,7 @@ static int udf_find_fileset(struct super_block *sb, if ((fileset->logicalBlockNum != 0xFFFFFFFF || fileset->partitionReferenceNum != 0xFFFF) && bh) { - udf_debug("Fileset at block=%d, partition=%d\n", + udf_debug("Fileset at block=%u, partition=%u\n", fileset->logicalBlockNum, fileset->partitionReferenceNum); @@ -982,14 +982,14 @@ static int udf_load_metadata_files(struct super_block *sb, int partition, mdata->s_phys_partition_ref = type1_index; /* metadata address */ - udf_debug("Metadata file location: block = %d part = %d\n", + udf_debug("Metadata file location: block = %u part = %u\n", mdata->s_meta_file_loc, mdata->s_phys_partition_ref); fe = udf_find_metadata_inode_efe(sb, mdata->s_meta_file_loc, mdata->s_phys_partition_ref); if (IS_ERR(fe)) { /* mirror file entry */ - udf_debug("Mirror metadata file location: block = %d part = %d\n", + udf_debug("Mirror metadata file location: block = %u part = %u\n", mdata->s_mirror_file_loc, mdata->s_phys_partition_ref); fe = udf_find_metadata_inode_efe(sb, mdata->s_mirror_file_loc, @@ -1013,7 +1013,7 @@ static int udf_load_metadata_files(struct super_block *sb, int partition, addr.logicalBlockNum = mdata->s_bitmap_file_loc; addr.partitionReferenceNum = mdata->s_phys_partition_ref; - udf_debug("Bitmap file location: block = %d part = %d\n", + udf_debug("Bitmap file location: block = %u part = %u\n", addr.logicalBlockNum, addr.partitionReferenceNum); fe = udf_iget_special(sb, &addr); @@ -1043,7 +1043,7 @@ static void udf_load_fileset(struct super_block *sb, struct buffer_head *bh, UDF_SB(sb)->s_serial_number = le16_to_cpu(fset->descTag.tagSerialNum); - udf_debug("Rootdir at block=%d, partition=%d\n", + udf_debug("Rootdir at block=%u, partition=%u\n", root->logicalBlockNum, root->partitionReferenceNum); } @@ -1098,7 +1098,7 @@ static int udf_fill_partdesc_info(struct super_block *sb, if (p->accessType == cpu_to_le32(PD_ACCESS_TYPE_OVERWRITABLE)) map->s_partition_flags |= UDF_PART_FLAG_OVERWRITABLE; - udf_debug("Partition (%d type %x) starts at physical %d, block length %d\n", + udf_debug("Partition (%d type %x) starts at physical %u, block length %u\n", p_index, map->s_partition_type, map->s_partition_root, map->s_partition_len); @@ -1123,7 +1123,7 @@ static int udf_fill_partdesc_info(struct super_block *sb, } map->s_uspace.s_table = inode; map->s_partition_flags |= UDF_PART_FLAG_UNALLOC_TABLE; - udf_debug("unallocSpaceTable (part %d) @ %ld\n", + udf_debug("unallocSpaceTable (part %d) @ %lu\n", p_index, map->s_uspace.s_table->i_ino); } @@ -1135,7 +1135,7 @@ static int udf_fill_partdesc_info(struct super_block *sb, bitmap->s_extPosition = le32_to_cpu( phd->unallocSpaceBitmap.extPosition); map->s_partition_flags |= UDF_PART_FLAG_UNALLOC_BITMAP; - udf_debug("unallocSpaceBitmap (part %d) @ %d\n", + udf_debug("unallocSpaceBitmap (part %d) @ %u\n", p_index, bitmap->s_extPosition); } @@ -1158,7 +1158,7 @@ static int udf_fill_partdesc_info(struct super_block *sb, } map->s_fspace.s_table = inode; map->s_partition_flags |= UDF_PART_FLAG_FREED_TABLE; - udf_debug("freedSpaceTable (part %d) @ %ld\n", + udf_debug("freedSpaceTable (part %d) @ %lu\n", p_index, map->s_fspace.s_table->i_ino); } @@ -1170,7 +1170,7 @@ static int udf_fill_partdesc_info(struct super_block *sb, bitmap->s_extPosition = le32_to_cpu( phd->freedSpaceBitmap.extPosition); map->s_partition_flags |= UDF_PART_FLAG_FREED_BITMAP; - udf_debug("freedSpaceBitmap (part %d) @ %d\n", + udf_debug("freedSpaceBitmap (part %d) @ %u\n", p_index, bitmap->s_extPosition); } return 0; @@ -1283,7 +1283,7 @@ static int udf_load_partdesc(struct super_block *sb, sector_t block) /* First scan for TYPE1 and SPARABLE partitions */ for (i = 0; i < sbi->s_partitions; i++) { map = &sbi->s_partmaps[i]; - udf_debug("Searching map: (%d == %d)\n", + udf_debug("Searching map: (%u == %u)\n", map->s_partition_num, partitionNumber); if (map->s_partition_num == partitionNumber && (map->s_partition_type == UDF_TYPE1_MAP15 || @@ -1292,7 +1292,7 @@ static int udf_load_partdesc(struct super_block *sb, sector_t block) } if (i >= sbi->s_partitions) { - udf_debug("Partition (%d) not found in partition map\n", + udf_debug("Partition (%u) not found in partition map\n", partitionNumber); ret = 0; goto out_bh; @@ -1490,7 +1490,7 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block, struct metadataPartitionMap *mdm = (struct metadataPartitionMap *) &(lvd->partitionMaps[offset]); - udf_debug("Parsing Logical vol part %d type %d id=%s\n", + udf_debug("Parsing Logical vol part %d type %u id=%s\n", i, type, UDF_ID_METADATA); map->s_partition_type = UDF_METADATA_MAP25; @@ -1512,17 +1512,17 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block, udf_debug("Metadata Ident suffix=0x%x\n", le16_to_cpu(*(__le16 *) mdm->partIdent.identSuffix)); - udf_debug("Metadata part num=%d\n", + udf_debug("Metadata part num=%u\n", le16_to_cpu(mdm->partitionNum)); - udf_debug("Metadata part alloc unit size=%d\n", + udf_debug("Metadata part alloc unit size=%u\n", le32_to_cpu(mdm->allocUnitSize)); - udf_debug("Metadata file loc=%d\n", + udf_debug("Metadata file loc=%u\n", le32_to_cpu(mdm->metadataFileLoc)); - udf_debug("Mirror file loc=%d\n", + udf_debug("Mirror file loc=%u\n", le32_to_cpu(mdm->metadataMirrorFileLoc)); - udf_debug("Bitmap file loc=%d\n", + udf_debug("Bitmap file loc=%u\n", le32_to_cpu(mdm->metadataBitmapFileLoc)); - udf_debug("Flags: %d %d\n", + udf_debug("Flags: %d %u\n", mdata->s_flags, mdm->flags); } else { udf_debug("Unknown ident: %s\n", @@ -1532,7 +1532,7 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block, map->s_volumeseqnum = le16_to_cpu(upm2->volSeqNum); map->s_partition_num = le16_to_cpu(upm2->partitionNum); } - udf_debug("Partition (%d:%d) type %d on volume %d\n", + udf_debug("Partition (%d:%u) type %u on volume %u\n", i, map->s_partition_num, type, map->s_volumeseqnum); } @@ -1540,7 +1540,7 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block, struct long_ad *la = (struct long_ad *)&(lvd->logicalVolContentsUse[0]); *fileset = lelb_to_cpu(la->extLocation); - udf_debug("FileSet found in LogicalVolDesc at block=%d, partition=%d\n", + udf_debug("FileSet found in LogicalVolDesc at block=%u, partition=%u\n", fileset->logicalBlockNum, fileset->partitionReferenceNum); } @@ -2180,7 +2180,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) ret = udf_load_vrs(sb, &uopt, silent, &fileset); if (ret < 0) { if (!silent && ret != -EACCES) { - pr_notice("Scanning with blocksize %d failed\n", + pr_notice("Scanning with blocksize %u failed\n", uopt.blocksize); } brelse(sbi->s_lvid_bh); @@ -2205,7 +2205,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) goto error_out; } - udf_debug("Lastblock=%d\n", sbi->s_last_block); + udf_debug("Lastblock=%u\n", sbi->s_last_block); if (sbi->s_lvid_bh) { struct logicalVolIntegrityDescImpUse *lvidiu = @@ -2276,7 +2276,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) /* perhaps it's not extensible enough, but for now ... */ inode = udf_iget(sb, &rootdir); if (IS_ERR(inode)) { - udf_err(sb, "Error in udf_iget, block=%d, partition=%d\n", + udf_err(sb, "Error in udf_iget, block=%u, partition=%u\n", rootdir.logicalBlockNum, rootdir.partitionReferenceNum); ret = PTR_ERR(inode); goto error_out; diff --git a/fs/udf/unicode.c b/fs/udf/unicode.c index ad04dc227833..b52df1dbb3b3 100644 --- a/fs/udf/unicode.c +++ b/fs/udf/unicode.c @@ -206,7 +206,7 @@ static int udf_name_from_CS0(uint8_t *str_o, int str_max_len, cmp_id = ocu[0]; if (cmp_id != 8 && cmp_id != 16) { memset(str_o, 0, str_max_len); - pr_err("unknown compression code (%d)\n", cmp_id); + pr_err("unknown compression code (%u)\n", cmp_id); return -EINVAL; } u_ch = cmp_id >> 3; diff --git a/include/linux/hwmon-sysfs.h b/include/linux/hwmon-sysfs.h index 1c7b89ae6bdc..473897bbd898 100644 --- a/include/linux/hwmon-sysfs.h +++ b/include/linux/hwmon-sysfs.h @@ -33,10 +33,28 @@ struct sensor_device_attribute{ { .dev_attr = __ATTR(_name, _mode, _show, _store), \ .index = _index } +#define SENSOR_ATTR_RO(_name, _func, _index) \ + SENSOR_ATTR(_name, 0444, _func##_show, NULL, _index) + +#define SENSOR_ATTR_RW(_name, _func, _index) \ + SENSOR_ATTR(_name, 0644, _func##_show, _func##_store, _index) + +#define SENSOR_ATTR_WO(_name, _func, _index) \ + SENSOR_ATTR(_name, 0200, NULL, _func##_store, _index) + #define SENSOR_DEVICE_ATTR(_name, _mode, _show, _store, _index) \ struct sensor_device_attribute sensor_dev_attr_##_name \ = SENSOR_ATTR(_name, _mode, _show, _store, _index) +#define SENSOR_DEVICE_ATTR_RO(_name, _func, _index) \ + SENSOR_DEVICE_ATTR(_name, 0444, _func##_show, NULL, _index) + +#define SENSOR_DEVICE_ATTR_RW(_name, _func, _index) \ + SENSOR_DEVICE_ATTR(_name, 0644, _func##_show, _func##_store, _index) + +#define SENSOR_DEVICE_ATTR_WO(_name, _func, _index) \ + SENSOR_DEVICE_ATTR(_name, 0200, NULL, _func##_store, _index) + struct sensor_device_attribute_2 { struct device_attribute dev_attr; u8 index; @@ -50,8 +68,29 @@ struct sensor_device_attribute_2 { .index = _index, \ .nr = _nr } +#define SENSOR_ATTR_2_RO(_name, _func, _nr, _index) \ + SENSOR_ATTR_2(_name, 0444, _func##_show, NULL, _nr, _index) + +#define SENSOR_ATTR_2_RW(_name, _func, _nr, _index) \ + SENSOR_ATTR_2(_name, 0644, _func##_show, _func##_store, _nr, _index) + +#define SENSOR_ATTR_2_WO(_name, _func, _nr, _index) \ + SENSOR_ATTR_2(_name, 0200, NULL, _func##_store, _nr, _index) + #define SENSOR_DEVICE_ATTR_2(_name,_mode,_show,_store,_nr,_index) \ struct sensor_device_attribute_2 sensor_dev_attr_##_name \ = SENSOR_ATTR_2(_name, _mode, _show, _store, _nr, _index) +#define SENSOR_DEVICE_ATTR_2_RO(_name, _func, _nr, _index) \ + SENSOR_DEVICE_ATTR_2(_name, 0444, _func##_show, NULL, \ + _nr, _index) + +#define SENSOR_DEVICE_ATTR_2_RW(_name, _func, _nr, _index) \ + SENSOR_DEVICE_ATTR_2(_name, 0644, _func##_show, _func##_store, \ + _nr, _index) + +#define SENSOR_DEVICE_ATTR_2_WO(_name, _func, _nr, _index) \ + SENSOR_DEVICE_ATTR_2(_name, 0200, NULL, _func##_store, \ + _nr, _index) + #endif /* _LINUX_HWMON_SYSFS_H */ diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 861a60e0ab70..a5aeb52e83be 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -2110,6 +2110,8 @@ #define PCI_VENDOR_ID_CHELSIO 0x1425 +#define PCI_VENDOR_ID_EDIMAX 0x1432 + #define PCI_VENDOR_ID_ADLINK 0x144a #define PCI_VENDOR_ID_SAMSUNG 0x144d diff --git a/include/uapi/linux/zorro_ids.h b/include/uapi/linux/zorro_ids.h index 6e574d7b7d79..393f2ee9c042 100644 --- a/include/uapi/linux/zorro_ids.h +++ b/include/uapi/linux/zorro_ids.h @@ -449,6 +449,9 @@ #define ZORRO_PROD_VMC_ISDN_BLASTER_Z2 ZORRO_ID(VMC, 0x01, 0) #define ZORRO_PROD_VMC_HYPERCOM_4 ZORRO_ID(VMC, 0x02, 0) +#define ZORRO_MANUF_CSLAB 0x1400 +#define ZORRO_PROD_CSLAB_WARP_1260 ZORRO_ID(CSLAB, 0x65, 0) + #define ZORRO_MANUF_INFORMATION 0x157C #define ZORRO_PROD_INFORMATION_ISDN_ENGINE_I ZORRO_ID(INFORMATION, 0x64, 0) diff --git a/kernel/debug/kdb/kdb_io.c b/kernel/debug/kdb/kdb_io.c index 40d01c78fa4b..831a248d3194 100644 --- a/kernel/debug/kdb/kdb_io.c +++ b/kernel/debug/kdb/kdb_io.c @@ -192,7 +192,7 @@ static int kdb_read_get_key(char *buffer, size_t bufsize) */ static void kdb_position_cursor(char *prompt, char *buffer, char *cp) { - kdb_printf("\r%s", kdb_prompt_str); + kdb_printf("\r%s", prompt); if (cp > buffer) kdb_printf("%.*s", (int)(cp - buffer), buffer); } @@ -376,7 +376,7 @@ static char *kdb_read(char *buffer, size_t bufsize) if (i >= dtab_count) kdb_printf("..."); kdb_printf("\n"); - kdb_printf(kdb_prompt_str); + kdb_printf("%s", kdb_prompt_str); kdb_printf("%s", buffer); if (cp != lastchar) kdb_position_cursor(kdb_prompt_str, buffer, cp); @@ -467,8 +467,8 @@ static char *kdb_read(char *buffer, size_t bufsize) char *kdb_getstr(char *buffer, size_t bufsize, const char *prompt) { if (prompt && kdb_prompt_str != prompt) - strncpy(kdb_prompt_str, prompt, CMD_BUFLEN); - kdb_printf(kdb_prompt_str); + strscpy(kdb_prompt_str, prompt, CMD_BUFLEN); + kdb_printf("%s", kdb_prompt_str); kdb_nextline = 1; /* Prompt and input resets line number */ return kdb_read(buffer, bufsize); } diff --git a/kernel/events/core.c b/kernel/events/core.c index 8497746310a7..afd845f625f6 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -5596,6 +5596,8 @@ static int perf_mmap(struct file *file, struct vm_area_struct *vma) return -EINVAL; nr_pages = vma_size / PAGE_SIZE; + if (nr_pages > INT_MAX) + return -ENOMEM; mutex_lock(&event->mmap_mutex); ret = -EINVAL; diff --git a/kernel/events/internal.h b/kernel/events/internal.h index 41317d04eeae..bb1c0eeca4d6 100644 --- a/kernel/events/internal.h +++ b/kernel/events/internal.h @@ -121,7 +121,7 @@ static inline unsigned long perf_data_size(struct ring_buffer *rb) static inline unsigned long perf_aux_size(struct ring_buffer *rb) { - return rb->aux_nr_pages << PAGE_SHIFT; + return (unsigned long)rb->aux_nr_pages << PAGE_SHIFT; } #define __DEFINE_OUTPUT_COPY_BODY(advance_buf, memcpy_func, ...) \ diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c index d0eaf99c3ef1..cb27cb8ff33b 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c @@ -628,17 +628,16 @@ static inline void process_adjtimex_modes(struct timex *txc, } if (txc->modes & ADJ_MAXERROR) - time_maxerror = txc->maxerror; + time_maxerror = clamp(txc->maxerror, (__kernel_long_t)0, (__kernel_long_t)NTP_PHASE_LIMIT); if (txc->modes & ADJ_ESTERROR) - time_esterror = txc->esterror; + time_esterror = clamp(txc->esterror, (__kernel_long_t)0, (__kernel_long_t)NTP_PHASE_LIMIT); if (txc->modes & ADJ_TIMECONST) { - time_constant = txc->constant; + time_constant = clamp(txc->constant, (__kernel_long_t)0, (__kernel_long_t)MAXTC); if (!(time_status & STA_NANO)) time_constant += 4; - time_constant = min(time_constant, (long)MAXTC); - time_constant = max(time_constant, 0l); + time_constant = clamp(time_constant, (long)0, (long)MAXTC); } if (txc->modes & ADJ_TAI && diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c index aa2094d5dd27..e1ce02931b38 100644 --- a/kernel/time/tick-broadcast.c +++ b/kernel/time/tick-broadcast.c @@ -948,6 +948,30 @@ void hotplug_cpu__broadcast_tick_pull(int deadcpu) bc = tick_broadcast_device.evtdev; if (bc && broadcast_needs_cpu(bc, deadcpu)) { + /* + * If the broadcast force bit of the current CPU is set, + * then the current CPU has not yet reprogrammed the local + * timer device to avoid a ping-pong race. See + * ___tick_broadcast_oneshot_control(). + * + * If the broadcast device is hrtimer based then + * programming the broadcast event below does not have any + * effect because the local clockevent device is not + * running and not programmed because the broadcast event + * is not earlier than the pending event of the local clock + * event device. As a consequence all CPUs waiting for a + * broadcast event are stuck forever. + * + * Detect this condition and reprogram the cpu local timer + * device to avoid the starvation. + */ + if (tick_check_broadcast_expired()) { + struct tick_device *td = this_cpu_ptr(&tick_cpu_device); + + cpumask_clear_cpu(smp_processor_id(), tick_broadcast_force_mask); + tick_program_event(td->evtdev->next_event, 1); + } + /* This moves the broadcast assignment to this CPU: */ clockevents_program_event(bc, bc->next_event, 1); } diff --git a/kernel/trace/tracing_map.c b/kernel/trace/tracing_map.c index 572c0854d631..6354c5f24c7e 100644 --- a/kernel/trace/tracing_map.c +++ b/kernel/trace/tracing_map.c @@ -355,7 +355,7 @@ static struct tracing_map_elt *get_free_elt(struct tracing_map *map) struct tracing_map_elt *elt = NULL; int idx; - idx = atomic_inc_return(&map->next_elt); + idx = __atomic_add_unless(&map->next_elt, 1, map->max_elts); if (idx < map->max_elts) { elt = *(TRACING_MAP_ELT(map->elts, idx)); if (map->ops && map->ops->elt_init) @@ -563,7 +563,7 @@ void tracing_map_clear(struct tracing_map *map) { unsigned int i; - atomic_set(&map->next_elt, -1); + atomic_set(&map->next_elt, 0); atomic64_set(&map->hits, 0); atomic64_set(&map->drops, 0); @@ -647,7 +647,7 @@ struct tracing_map *tracing_map_create(unsigned int map_bits, map->map_bits = map_bits; map->max_elts = (1 << map_bits); - atomic_set(&map->next_elt, -1); + atomic_set(&map->next_elt, 0); map->map_size = (1 << (map_bits + 1)); map->ops = ops; diff --git a/kernel/watchdog_hld.c b/kernel/watchdog_hld.c index 4c2cd69013a6..9e95d27093a9 100644 --- a/kernel/watchdog_hld.c +++ b/kernel/watchdog_hld.c @@ -91,11 +91,15 @@ static bool watchdog_check_timestamp(void) __this_cpu_write(last_timestamp, now); return true; } -#else -static inline bool watchdog_check_timestamp(void) + +static void watchdog_init_timestamp(void) { - return true; + __this_cpu_write(nmi_rearmed, 0); + __this_cpu_write(last_timestamp, ktime_get_mono_fast_ns()); } +#else +static inline bool watchdog_check_timestamp(void) { return true; } +static inline void watchdog_init_timestamp(void) { } #endif static struct perf_event_attr wd_hw_attr = { @@ -195,6 +199,7 @@ void hardlockup_detector_perf_enable(void) if (!atomic_fetch_inc(&watchdog_cpus)) pr_info("Enabled. Permanently consumes one hw-PMU counter.\n"); + watchdog_init_timestamp(); perf_event_enable(this_cpu_read(watchdog_ev)); } diff --git a/lib/decompress_bunzip2.c b/lib/decompress_bunzip2.c index 0234361b24b8..992ee6388a45 100644 --- a/lib/decompress_bunzip2.c +++ b/lib/decompress_bunzip2.c @@ -231,7 +231,8 @@ static int INIT get_next_block(struct bunzip_data *bd) RUNB) */ symCount = symTotal+2; for (j = 0; j < groupCount; j++) { - unsigned char length[MAX_SYMBOLS], temp[MAX_HUFCODE_BITS+1]; + unsigned char length[MAX_SYMBOLS]; + unsigned short temp[MAX_HUFCODE_BITS+1]; int minLen, maxLen, pp; /* Read Huffman code lengths for each symbol. They're stored in a way similar to mtf; record a starting diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 55ef8f7d6b3b..bcd19fd83582 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -433,13 +433,20 @@ static void domain_dirty_limits(struct dirty_throttle_control *dtc) else bg_thresh = (bg_ratio * available_memory) / PAGE_SIZE; - if (bg_thresh >= thresh) - bg_thresh = thresh / 2; tsk = current; if (tsk->flags & PF_LESS_THROTTLE || rt_task(tsk)) { bg_thresh += bg_thresh / 4 + global_wb_domain.dirty_limit / 32; thresh += thresh / 4 + global_wb_domain.dirty_limit / 32; } + /* + * Dirty throttling logic assumes the limits in page units fit into + * 32-bits. This gives 16TB dirty limits max which is hopefully enough. + */ + if (thresh > UINT_MAX) + thresh = UINT_MAX; + /* This makes sure bg_thresh is within 32-bits as well */ + if (bg_thresh >= thresh) + bg_thresh = thresh / 2; dtc->thresh = thresh; dtc->bg_thresh = bg_thresh; @@ -489,7 +496,11 @@ static unsigned long node_dirty_limit(struct pglist_data *pgdat) if (tsk->flags & PF_LESS_THROTTLE || rt_task(tsk)) dirty += dirty / 4; - return dirty; + /* + * Dirty throttling logic assumes the limits in page units fit into + * 32-bits. This gives 16TB dirty limits max which is hopefully enough. + */ + return min_t(unsigned long, dirty, UINT_MAX); } /** @@ -528,10 +539,17 @@ int dirty_background_bytes_handler(struct ctl_table *table, int write, loff_t *ppos) { int ret; + unsigned long old_bytes = dirty_background_bytes; ret = proc_doulongvec_minmax(table, write, buffer, lenp, ppos); - if (ret == 0 && write) + if (ret == 0 && write) { + if (DIV_ROUND_UP(dirty_background_bytes, PAGE_SIZE) > + UINT_MAX) { + dirty_background_bytes = old_bytes; + return -ERANGE; + } dirty_background_ratio = 0; + } return ret; } @@ -559,6 +577,10 @@ int dirty_bytes_handler(struct ctl_table *table, int write, ret = proc_doulongvec_minmax(table, write, buffer, lenp, ppos); if (ret == 0 && write && vm_dirty_bytes != old_bytes) { + if (DIV_ROUND_UP(vm_dirty_bytes, PAGE_SIZE) > UINT_MAX) { + vm_dirty_bytes = old_bytes; + return -ERANGE; + } writeback_set_ratelimit(); vm_dirty_ratio = 0; } diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 4886a37a4811..c438fc8bf624 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -7055,6 +7055,7 @@ static void l2cap_conless_channel(struct l2cap_conn *conn, __le16 psm, bt_cb(skb)->l2cap.psm = psm; if (!chan->ops->recv(chan, skb)) { + l2cap_chan_unlock(chan); l2cap_chan_put(chan); return; } diff --git a/net/core/link_watch.c b/net/core/link_watch.c index 982861607f88..e1973c0a12c5 100644 --- a/net/core/link_watch.c +++ b/net/core/link_watch.c @@ -135,9 +135,9 @@ static void linkwatch_schedule_work(int urgent) * override the existing timer. */ if (test_bit(LW_URGENT, &linkwatch_flags)) - mod_delayed_work(system_wq, &linkwatch_work, 0); + mod_delayed_work(system_unbound_wq, &linkwatch_work, 0); else - schedule_delayed_work(&linkwatch_work, delay); + queue_delayed_work(system_unbound_wq, &linkwatch_work, delay); } diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 45fa7f2e07cf..c4d628d72b90 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -1279,18 +1279,15 @@ void ip_rt_get_source(u8 *addr, struct sk_buff *skb, struct rtable *rt) src = ip_hdr(skb)->saddr; else { struct fib_result res; - struct flowi4 fl4; - struct iphdr *iph; - - iph = ip_hdr(skb); - - memset(&fl4, 0, sizeof(fl4)); - fl4.daddr = iph->daddr; - fl4.saddr = iph->saddr; - fl4.flowi4_tos = RT_TOS(iph->tos); - fl4.flowi4_oif = rt->dst.dev->ifindex; - fl4.flowi4_iif = skb->dev->ifindex; - fl4.flowi4_mark = skb->mark; + struct iphdr *iph = ip_hdr(skb); + struct flowi4 fl4 = { + .daddr = iph->daddr, + .saddr = iph->saddr, + .flowi4_tos = iph->tos & IPTOS_RT_MASK, + .flowi4_oif = rt->dst.dev->ifindex, + .flowi4_iif = skb->dev->ifindex, + .flowi4_mark = skb->mark, + }; rcu_read_lock(); if (fib_lookup(dev_net(rt->dst.dev), &fl4, &res, 0) == 0) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 5b085f48a8dd..b1ee20d261a4 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -1724,7 +1724,8 @@ int ipv6_dev_get_saddr(struct net *net, const struct net_device *dst_dev, master, &dst, scores, hiscore_idx); - if (scores[hiscore_idx].ifa) + if (scores[hiscore_idx].ifa && + scores[hiscore_idx].scopedist >= 0) goto out; } diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 64808a96978f..adcf6dbb9a95 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c @@ -224,6 +224,7 @@ struct ndisc_options *ndisc_parse_options(const struct net_device *dev, return NULL; memset(ndopts, 0, sizeof(*ndopts)); while (opt_len) { + bool unknown = false; int l; if (opt_len < sizeof(struct nd_opt_hdr)) return NULL; @@ -259,22 +260,23 @@ struct ndisc_options *ndisc_parse_options(const struct net_device *dev, break; #endif default: - if (ndisc_is_useropt(dev, nd_opt)) { - ndopts->nd_useropts_end = nd_opt; - if (!ndopts->nd_useropts) - ndopts->nd_useropts = nd_opt; - } else { - /* - * Unknown options must be silently ignored, - * to accommodate future extension to the - * protocol. - */ - ND_PRINTK(2, notice, - "%s: ignored unsupported option; type=%d, len=%d\n", - __func__, - nd_opt->nd_opt_type, - nd_opt->nd_opt_len); - } + unknown = true; + } + if (ndisc_is_useropt(dev, nd_opt)) { + ndopts->nd_useropts_end = nd_opt; + if (!ndopts->nd_useropts) + ndopts->nd_useropts = nd_opt; + } else if (unknown) { + /* + * Unknown options must be silently ignored, + * to accommodate future extension to the + * protocol. + */ + ND_PRINTK(2, notice, + "%s: ignored unsupported option; type=%d, len=%d\n", + __func__, + nd_opt->nd_opt_type, + nd_opt->nd_opt_len); } next_opt: opt_len -= l; diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c index d7dd92274957..fc8a86ca7596 100644 --- a/net/iucv/af_iucv.c +++ b/net/iucv/af_iucv.c @@ -439,8 +439,8 @@ static void iucv_sever_path(struct sock *sk, int with_user_data) struct iucv_sock *iucv = iucv_sk(sk); struct iucv_path *path = iucv->path; - if (iucv->path) { - iucv->path = NULL; + /* Whoever resets the path pointer, must sever and free it. */ + if (xchg(&iucv->path, NULL)) { if (with_user_data) { low_nmcpy(user_data, iucv->src_name); high_nmcpy(user_data, iucv->dst_name); diff --git a/net/netfilter/ipvs/ip_vs_proto_sctp.c b/net/netfilter/ipvs/ip_vs_proto_sctp.c index aaf04e47e06a..9f1a1fb0e98d 100644 --- a/net/netfilter/ipvs/ip_vs_proto_sctp.c +++ b/net/netfilter/ipvs/ip_vs_proto_sctp.c @@ -123,7 +123,7 @@ sctp_snat_handler(struct sk_buff *skb, struct ip_vs_protocol *pp, if (sctph->source != cp->vport || payload_csum || skb->ip_summed == CHECKSUM_PARTIAL) { sctph->source = cp->vport; - if (!skb_is_gso(skb) || !skb_is_gso_sctp(skb)) + if (!skb_is_gso(skb)) sctp_nat_csum(skb, sctph, sctphoff); } else { skb->ip_summed = CHECKSUM_UNNECESSARY; @@ -172,7 +172,7 @@ sctp_dnat_handler(struct sk_buff *skb, struct ip_vs_protocol *pp, (skb->ip_summed == CHECKSUM_PARTIAL && !(skb_dst(skb)->dev->features & NETIF_F_SCTP_CRC))) { sctph->dest = cp->dport; - if (!skb_is_gso(skb) || !skb_is_gso_sctp(skb)) + if (!skb_is_gso(skb)) sctp_nat_csum(skb, sctph, sctphoff); } else if (skb->ip_summed != CHECKSUM_PARTIAL) { skb->ip_summed = CHECKSUM_UNNECESSARY; diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index e48db5a53225..4d1f9c6294f7 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c @@ -3001,7 +3001,8 @@ static int ctnetlink_del_expect(struct net *net, struct sock *ctnl, if (cda[CTA_EXPECT_ID]) { __be32 id = nla_get_be32(cda[CTA_EXPECT_ID]); - if (ntohl(id) != (u32)(unsigned long)exp) { + + if (id != nf_expect_get_id(exp)) { nf_ct_expect_put(exp); return -ENOENT; } diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 0d71f607a4c6..aa4ab5cb7c32 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -4394,8 +4394,10 @@ static int nf_tables_newsetelem(struct net *net, struct sock *nlsk, nla_for_each_nested(attr, nla[NFTA_SET_ELEM_LIST_ELEMENTS], rem) { err = nft_add_set_elem(&ctx, set, attr, nlh->nlmsg_flags); - if (err < 0) + if (err < 0) { + NL_SET_BAD_ATTR(extack, attr); break; + } } return err; } @@ -4588,9 +4590,10 @@ static int nf_tables_delsetelem(struct net *net, struct sock *nlsk, nla_for_each_nested(attr, nla[NFTA_SET_ELEM_LIST_ELEMENTS], rem) { err = nft_del_setelem(&ctx, set, attr); - if (err < 0) + if (err < 0) { + NL_SET_BAD_ATTR(extack, attr); break; - + } set->ndeact++; } return err; diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index a02a07f9fe22..e3edf0c7e2e4 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -532,6 +532,61 @@ static void *packet_current_frame(struct packet_sock *po, return packet_lookup_frame(po, rb, rb->head, status); } +static u16 vlan_get_tci(struct sk_buff *skb, struct net_device *dev) +{ + u8 *skb_orig_data = skb->data; + int skb_orig_len = skb->len; + struct vlan_hdr vhdr, *vh; + unsigned int header_len; + + if (!dev) + return 0; + + /* In the SOCK_DGRAM scenario, skb data starts at the network + * protocol, which is after the VLAN headers. The outer VLAN + * header is at the hard_header_len offset in non-variable + * length link layer headers. If it's a VLAN device, the + * min_header_len should be used to exclude the VLAN header + * size. + */ + if (dev->min_header_len == dev->hard_header_len) + header_len = dev->hard_header_len; + else if (is_vlan_dev(dev)) + header_len = dev->min_header_len; + else + return 0; + + skb_push(skb, skb->data - skb_mac_header(skb)); + vh = skb_header_pointer(skb, header_len, sizeof(vhdr), &vhdr); + if (skb_orig_data != skb->data) { + skb->data = skb_orig_data; + skb->len = skb_orig_len; + } + if (unlikely(!vh)) + return 0; + + return ntohs(vh->h_vlan_TCI); +} + +static __be16 vlan_get_protocol_dgram(struct sk_buff *skb) +{ + __be16 proto = skb->protocol; + + if (unlikely(eth_type_vlan(proto))) { + u8 *skb_orig_data = skb->data; + int skb_orig_len = skb->len; + + skb_push(skb, skb->data - skb_mac_header(skb)); + proto = __vlan_get_protocol(skb, proto, NULL); + if (skb_orig_data != skb->data) { + skb->data = skb_orig_data; + skb->len = skb_orig_len; + } + } + + return proto; +} + static void prb_del_retire_blk_timer(struct tpacket_kbdq_core *pkc) { del_timer_sync(&pkc->retire_blk_timer); @@ -1014,10 +1069,16 @@ static void prb_clear_rxhash(struct tpacket_kbdq_core *pkc, static void prb_fill_vlan_info(struct tpacket_kbdq_core *pkc, struct tpacket3_hdr *ppd) { + struct packet_sock *po = container_of(pkc, struct packet_sock, rx_ring.prb_bdqc); + if (skb_vlan_tag_present(pkc->skb)) { ppd->hv1.tp_vlan_tci = skb_vlan_tag_get(pkc->skb); ppd->hv1.tp_vlan_tpid = ntohs(pkc->skb->vlan_proto); ppd->tp_status = TP_STATUS_VLAN_VALID | TP_STATUS_VLAN_TPID_VALID; + } else if (unlikely(po->sk.sk_type == SOCK_DGRAM && eth_type_vlan(pkc->skb->protocol))) { + ppd->hv1.tp_vlan_tci = vlan_get_tci(pkc->skb, pkc->skb->dev); + ppd->hv1.tp_vlan_tpid = ntohs(pkc->skb->protocol); + ppd->tp_status = TP_STATUS_VLAN_VALID | TP_STATUS_VLAN_TPID_VALID; } else { ppd->hv1.tp_vlan_tci = 0; ppd->hv1.tp_vlan_tpid = 0; @@ -2383,6 +2444,10 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, h.h2->tp_vlan_tci = skb_vlan_tag_get(skb); h.h2->tp_vlan_tpid = ntohs(skb->vlan_proto); status |= TP_STATUS_VLAN_VALID | TP_STATUS_VLAN_TPID_VALID; + } else if (unlikely(sk->sk_type == SOCK_DGRAM && eth_type_vlan(skb->protocol))) { + h.h2->tp_vlan_tci = vlan_get_tci(skb, skb->dev); + h.h2->tp_vlan_tpid = ntohs(skb->protocol); + status |= TP_STATUS_VLAN_VALID | TP_STATUS_VLAN_TPID_VALID; } else { h.h2->tp_vlan_tci = 0; h.h2->tp_vlan_tpid = 0; @@ -2412,7 +2477,8 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, sll->sll_halen = dev_parse_header(skb, sll->sll_addr); sll->sll_family = AF_PACKET; sll->sll_hatype = dev->type; - sll->sll_protocol = skb->protocol; + sll->sll_protocol = (sk->sk_type == SOCK_DGRAM) ? + vlan_get_protocol_dgram(skb) : skb->protocol; sll->sll_pkttype = skb->pkt_type; if (unlikely(packet_sock_flag(po, PACKET_SOCK_ORIGDEV))) sll->sll_ifindex = orig_dev->ifindex; @@ -3448,7 +3514,8 @@ static int packet_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, /* Original length was stored in sockaddr_ll fields */ origlen = PACKET_SKB_CB(skb)->sa.origlen; sll->sll_family = AF_PACKET; - sll->sll_protocol = skb->protocol; + sll->sll_protocol = (sock->type == SOCK_DGRAM) ? + vlan_get_protocol_dgram(skb) : skb->protocol; } sock_recv_ts_and_drops(msg, sk, skb); @@ -3503,6 +3570,21 @@ static int packet_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, aux.tp_vlan_tci = skb_vlan_tag_get(skb); aux.tp_vlan_tpid = ntohs(skb->vlan_proto); aux.tp_status |= TP_STATUS_VLAN_VALID | TP_STATUS_VLAN_TPID_VALID; + } else if (unlikely(sock->type == SOCK_DGRAM && eth_type_vlan(skb->protocol))) { + struct sockaddr_ll *sll = &PACKET_SKB_CB(skb)->sa.ll; + struct net_device *dev; + + rcu_read_lock(); + dev = dev_get_by_index_rcu(sock_net(sk), sll->sll_ifindex); + if (dev) { + aux.tp_vlan_tci = vlan_get_tci(skb, dev); + aux.tp_vlan_tpid = ntohs(skb->protocol); + aux.tp_status |= TP_STATUS_VLAN_VALID | TP_STATUS_VLAN_TPID_VALID; + } else { + aux.tp_vlan_tci = 0; + aux.tp_vlan_tpid = 0; + } + rcu_read_unlock(); } else { aux.tp_vlan_tci = 0; aux.tp_vlan_tpid = 0; diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index b368f5aabe29..47ebd4839d47 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c @@ -349,8 +349,10 @@ static void rpc_make_runnable(struct workqueue_struct *wq, if (RPC_IS_ASYNC(task)) { INIT_WORK(&task->u.tk_work, rpc_async_schedule); queue_work(wq, &task->u.tk_work); - } else + } else { + smp_mb__after_atomic(); wake_up_bit(&task->tk_runstate, RPC_TASK_QUEUED); + } } /* diff --git a/net/tipc/udp_media.c b/net/tipc/udp_media.c index 4d0eb41efebe..07b3d413d5a0 100644 --- a/net/tipc/udp_media.c +++ b/net/tipc/udp_media.c @@ -125,8 +125,11 @@ static int tipc_udp_addr2str(struct tipc_media_addr *a, char *buf, int size) snprintf(buf, size, "%pI4:%u", &ua->ipv4, ntohs(ua->port)); else if (ntohs(ua->proto) == ETH_P_IPV6) snprintf(buf, size, "%pI6:%u", &ua->ipv6, ntohs(ua->port)); - else + else { pr_err("Invalid UDP media address\n"); + return 1; + } + return 0; } diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 90fe845ad888..bdddc2ec3311 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -3215,10 +3215,7 @@ static void get_key_callback(void *c, struct key_params *params) struct nlattr *key; struct get_key_cookie *cookie = c; - if ((params->key && - nla_put(cookie->msg, NL80211_ATTR_KEY_DATA, - params->key_len, params->key)) || - (params->seq && + if ((params->seq && nla_put(cookie->msg, NL80211_ATTR_KEY_SEQ, params->seq_len, params->seq)) || (params->cipher && @@ -3230,10 +3227,7 @@ static void get_key_callback(void *c, struct key_params *params) if (!key) goto nla_put_failure; - if ((params->key && - nla_put(cookie->msg, NL80211_KEY_DATA, - params->key_len, params->key)) || - (params->seq && + if ((params->seq && nla_put(cookie->msg, NL80211_KEY_SEQ, params->seq_len, params->seq)) || (params->cipher && diff --git a/scripts/gcc-x86_32-has-stack-protector.sh b/scripts/gcc-x86_32-has-stack-protector.sh index 6b2aeefb9cd3..e714e7f7cf9b 100755 --- a/scripts/gcc-x86_32-has-stack-protector.sh +++ b/scripts/gcc-x86_32-has-stack-protector.sh @@ -1,7 +1,7 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0 -echo "int foo(void) { char X[200]; return 3; }" | $* -S -x c -c -O0 -fstack-protector - -o - 2> /dev/null | grep -q "%gs" +echo "int foo(void) { char X[200]; return 3; }" | $* -S -x c -O0 -fstack-protector - -o - 2> /dev/null | grep -q "%gs" if [ "$?" -eq "0" ] ; then echo y else diff --git a/scripts/gcc-x86_64-has-stack-protector.sh b/scripts/gcc-x86_64-has-stack-protector.sh index 4a48bdcd4d6b..c1428d7723ca 100755 --- a/scripts/gcc-x86_64-has-stack-protector.sh +++ b/scripts/gcc-x86_64-has-stack-protector.sh @@ -1,7 +1,7 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0 -echo "int foo(void) { char X[200]; return 3; }" | $* -S -x c -c -O0 -mcmodel=kernel -fno-PIE -fstack-protector - -o - 2> /dev/null | grep -q "%gs" +echo "int foo(void) { char X[200]; return 3; }" | $* -S -x c -O0 -mcmodel=kernel -fno-PIE -fstack-protector - -o - 2> /dev/null | grep -q "%gs" if [ "$?" -eq "0" ] ; then echo y else diff --git a/sound/usb/line6/driver.c b/sound/usb/line6/driver.c index 818fed746082..9e94c3a9072a 100644 --- a/sound/usb/line6/driver.c +++ b/sound/usb/line6/driver.c @@ -293,12 +293,14 @@ static void line6_data_received(struct urb *urb) { struct usb_line6 *line6 = (struct usb_line6 *)urb->context; struct midi_buffer *mb = &line6->line6midi->midibuf_in; + unsigned long flags; int done; if (urb->status == -ESHUTDOWN) return; if (line6->properties->capabilities & LINE6_CAP_CONTROL_MIDI) { + spin_lock_irqsave(&line6->line6midi->lock, flags); done = line6_midibuf_write(mb, urb->transfer_buffer, urb->actual_length); @@ -307,12 +309,15 @@ static void line6_data_received(struct urb *urb) dev_dbg(line6->ifcdev, "%d %d buffer overflow - message skipped\n", done, urb->actual_length); } + spin_unlock_irqrestore(&line6->line6midi->lock, flags); for (;;) { + spin_lock_irqsave(&line6->line6midi->lock, flags); done = line6_midibuf_read(mb, line6->buffer_message, LINE6_MIDI_MESSAGE_MAXLEN, LINE6_MIDIBUF_READ_RX); + spin_unlock_irqrestore(&line6->line6midi->lock, flags); if (done <= 0) break; diff --git a/sound/usb/stream.c b/sound/usb/stream.c index 101525be24b2..297f2e2465e4 100644 --- a/sound/usb/stream.c +++ b/sound/usb/stream.c @@ -243,8 +243,8 @@ static struct snd_pcm_chmap_elem *convert_chmap(int channels, unsigned int bits, SNDRV_CHMAP_FR, /* right front */ SNDRV_CHMAP_FC, /* center front */ SNDRV_CHMAP_LFE, /* LFE */ - SNDRV_CHMAP_SL, /* left surround */ - SNDRV_CHMAP_SR, /* right surround */ + SNDRV_CHMAP_RL, /* left surround */ + SNDRV_CHMAP_RR, /* right surround */ SNDRV_CHMAP_FLC, /* left of center */ SNDRV_CHMAP_FRC, /* right of center */ SNDRV_CHMAP_RC, /* surround */ diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index 4fe2f3f92ab1..199c400779e2 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c @@ -244,7 +244,7 @@ sort__sym_cmp(struct hist_entry *left, struct hist_entry *right) * comparing symbol address alone is not enough since it's a * relative address within a dso. */ - if (!hists__has(left->hists, dso) || hists__has(right->hists, dso)) { + if (!hists__has(left->hists, dso)) { ret = sort__dso_cmp(left, right); if (ret != 0) return ret; diff --git a/tools/testing/selftests/net/msg_zerocopy.c b/tools/testing/selftests/net/msg_zerocopy.c index 7cfc7713ca7f..8e1d1bab697a 100644 --- a/tools/testing/selftests/net/msg_zerocopy.c +++ b/tools/testing/selftests/net/msg_zerocopy.c @@ -309,53 +309,7 @@ static int do_setup_tx(int domain, int type, int protocol) return fd; } -static uint32_t do_process_zerocopy_cookies(struct rds_zcopy_cookies *ck) -{ - int i; - - if (ck->num > RDS_MAX_ZCOOKIES) - error(1, 0, "Returned %d cookies, max expected %d\n", - ck->num, RDS_MAX_ZCOOKIES); - for (i = 0; i < ck->num; i++) - if (cfg_verbose >= 2) - fprintf(stderr, "%d\n", ck->cookies[i]); - return ck->num; -} - -static bool do_recvmsg_completion(int fd) -{ - char cmsgbuf[CMSG_SPACE(sizeof(struct rds_zcopy_cookies))]; - struct rds_zcopy_cookies *ck; - struct cmsghdr *cmsg; - struct msghdr msg; - bool ret = false; - - memset(&msg, 0, sizeof(msg)); - msg.msg_control = cmsgbuf; - msg.msg_controllen = sizeof(cmsgbuf); - - if (recvmsg(fd, &msg, MSG_DONTWAIT)) - return ret; - - if (msg.msg_flags & MSG_CTRUNC) - error(1, errno, "recvmsg notification: truncated"); - - for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) { - if (cmsg->cmsg_level == SOL_RDS && - cmsg->cmsg_type == RDS_CMSG_ZCOPY_COMPLETION) { - - ck = (struct rds_zcopy_cookies *)CMSG_DATA(cmsg); - completions += do_process_zerocopy_cookies(ck); - ret = true; - break; - } - error(0, 0, "ignoring cmsg at level %d type %d\n", - cmsg->cmsg_level, cmsg->cmsg_type); - } - return ret; -} - -static bool do_recv_completion(int fd, int domain) +static bool do_recv_completion(int fd) { struct sock_extended_err *serr; struct msghdr msg = {}; @@ -364,9 +318,6 @@ static bool do_recv_completion(int fd, int domain) int ret, zerocopy; char control[100]; - if (domain == PF_RDS) - return do_recvmsg_completion(fd); - msg.msg_control = control; msg.msg_controllen = sizeof(control); @@ -422,21 +373,21 @@ static bool do_recv_completion(int fd, int domain) } /* Read all outstanding messages on the errqueue */ -static void do_recv_completions(int fd, int domain) +static void do_recv_completions(int fd) { - while (do_recv_completion(fd, domain)) {} + while (do_recv_completion(fd)) {} sends_since_notify = 0; } /* Wait for all remaining completions on the errqueue */ -static void do_recv_remaining_completions(int fd, int domain) +static void do_recv_remaining_completions(int fd) { int64_t tstop = gettimeofday_ms() + cfg_waittime_ms; while (completions < expected_completions && gettimeofday_ms() < tstop) { - if (do_poll(fd, domain == PF_RDS ? POLLIN : POLLERR)) - do_recv_completions(fd, domain); + if (do_poll(fd, POLLERR)) + do_recv_completions(fd); } if (completions < expected_completions) @@ -509,17 +460,17 @@ static void do_tx(int domain, int type, int protocol) do_sendmsg(fd, &msg, cfg_zerocopy); if (cfg_zerocopy && sends_since_notify >= cfg_notification_limit) - do_recv_completions(fd, domain); + do_recv_completions(fd); while (!do_poll(fd, POLLOUT)) { if (cfg_zerocopy) - do_recv_completions(fd, domain); + do_recv_completions(fd); } } while (gettimeofday_ms() < tstop); if (cfg_zerocopy) - do_recv_remaining_completions(fd, domain); + do_recv_remaining_completions(fd); if (close(fd)) error(1, errno, "close"); diff --git a/tools/testing/selftests/sigaltstack/current_stack_pointer.h b/tools/testing/selftests/sigaltstack/current_stack_pointer.h index ea9bdf3a90b1..09da8f1011ce 100644 --- a/tools/testing/selftests/sigaltstack/current_stack_pointer.h +++ b/tools/testing/selftests/sigaltstack/current_stack_pointer.h @@ -8,7 +8,7 @@ register unsigned long sp asm("sp"); register unsigned long sp asm("esp"); #elif __loongarch64 register unsigned long sp asm("$sp"); -#elif __ppc__ +#elif __powerpc__ register unsigned long sp asm("r1"); #elif __s390x__ register unsigned long sp asm("%15");