Skip to contentSkip to conversation

Linux 4.19.130

DISCUSSION Greg Kroah-Hartman 1 participant 2 messages Jun 25, 2020 Stable branch

lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

I'm announcing the release of the 4.19.130 kernel.

All users of the 4.19 kernel series must upgrade.

The updated 4.19.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.19.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary

thanks,

greg k-h

------------

 Documentation/driver-api/mtdnand.rst                           |    4 
 Makefile                                                       |    2 
 arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts           |    2 
 arch/arm/mach-integrator/Kconfig                               |    7 
 arch/arm64/boot/dts/mediatek/mt8173.dtsi                       |   22 -
 arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi                 |    2 
 arch/arm64/kernel/hw_breakpoint.c                              |   44 +-
 arch/m68k/coldfire/pci.c                                       |    4 
 arch/openrisc/kernel/entry.S                                   |    4 
 arch/powerpc/include/asm/book3s/64/pgtable.h                   |   23 +
 arch/powerpc/include/asm/processor.h                           |    1 
 arch/powerpc/kernel/head_64.S                                  |    9 
 arch/powerpc/kernel/machine_kexec.c                            |    8 
 arch/powerpc/kvm/book3s_64_mmu_radix.c                         |   16 -
 arch/powerpc/perf/hv-24x7.c                                    |   10 
 arch/powerpc/platforms/4xx/pci.c                               |    4 
 arch/powerpc/platforms/ps3/mm.c                                |   22 -
 arch/powerpc/platforms/pseries/ras.c                           |    5 
 arch/s390/include/asm/syscall.h                                |   12 
 arch/x86/boot/Makefile                                         |    2 
 arch/x86/kernel/apic/apic.c                                    |    2 
 arch/x86/kernel/idt.c                                          |    6 
 arch/x86/kernel/kprobes/core.c                                 |   16 -
 arch/x86/kvm/mmu.c                                             |   51 +++
 arch/x86/kvm/x86.c                                             |   31 --
 arch/x86/purgatory/Makefile                                    |    5 
 crypto/algboss.c                                               |    2 
 crypto/algif_skcipher.c                                        |    6 
 drivers/ata/libata-core.c                                      |   11 
 drivers/base/platform.c                                        |    2 
 drivers/block/ps3disk.c                                        |    1 
 drivers/char/ipmi/ipmi_msghandler.c                            |    7 
 drivers/clk/bcm/clk-bcm2835.c                                  |   10 
 drivers/clk/qcom/gcc-msm8916.c                                 |    8 
 drivers/clk/samsung/clk-exynos5420.c                           |   16 -
 drivers/clk/samsung/clk-exynos5433.c                           |    3 
 drivers/clk/sprd/pll.c                                         |    2 
 drivers/clk/st/clk-flexgen.c                                   |    1 
 drivers/clk/sunxi/clk-sunxi.c                                  |    2 
 drivers/clk/ti/composite.c                                     |    1 
 drivers/crypto/omap-sham.c                                     |   64 ++--
 drivers/extcon/extcon-adc-jack.c                               |    3 
 drivers/firmware/qcom_scm.c                                    |    9 
 drivers/fpga/dfl-afu-dma-region.c                              |    4 
 drivers/gpio/gpio-dwapb.c                                      |   34 +-
 drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c               |    2 
 drivers/gpu/drm/drm_dp_mst_topology.c                          |   58 ++-
 drivers/gpu/drm/drm_encoder_slave.c                            |    5 
 drivers/gpu/drm/i915/i915_cmd_parser.c                         |    4 
 drivers/gpu/drm/i915/i915_irq.c                                |    1 
 drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c                       |    3 
 drivers/gpu/drm/qxl/qxl_kms.c                                  |    2 
 drivers/gpu/drm/sun4i/sun4i_hdmi.h                             |    2 
 drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c                     |    2 
 drivers/hid/hid-ids.h                                          |    3 
 drivers/hid/hid-quirks.c                                       |    1 
 drivers/i2c/busses/i2c-piix4.c                                 |    3 
 drivers/i2c/busses/i2c-pxa.c                                   |   13 
 drivers/iio/pressure/bmp280-core.c                             |    7 
 drivers/infiniband/core/cma_configfs.c                         |   13 
 drivers/infiniband/hw/cxgb4/device.c                           |    1 
 drivers/infiniband/hw/mlx5/devx.c                              |    1 
 drivers/md/bcache/btree.c                                      |    8 
 drivers/md/dm-mpath.c                                          |    2 
 drivers/md/dm-zoned-metadata.c                                 |    4 
 drivers/md/dm-zoned-reclaim.c                                  |    4 
 drivers/md/md.c                                                |   13 
 drivers/md/raid0.c                                             |    3 
 drivers/mfd/wm8994-core.c                                      |    1 
 drivers/mtd/nand/raw/ams-delta.c                               |    4 
 drivers/mtd/nand/raw/atmel/nand-controller.c                   |    2 
 drivers/mtd/nand/raw/au1550nd.c                                |    4 
 drivers/mtd/nand/raw/bcm47xxnflash/main.c                      |    2 
 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c               |    2 
 drivers/mtd/nand/raw/brcmnand/brcmnand.c                       |    4 
 drivers/mtd/nand/raw/cafe_nand.c                               |    4 
 drivers/mtd/nand/raw/cmx270_nand.c                             |    4 
 drivers/mtd/nand/raw/cs553x_nand.c                             |    4 
 drivers/mtd/nand/raw/davinci_nand.c                            |    4 
 drivers/mtd/nand/raw/denali.c                                  |    6 
 drivers/mtd/nand/raw/diskonchip.c                              |   11 
 drivers/mtd/nand/raw/docg4.c                                   |    4 
 drivers/mtd/nand/raw/fsl_elbc_nand.c                           |    5 
 drivers/mtd/nand/raw/fsl_ifc_nand.c                            |    5 
 drivers/mtd/nand/raw/fsl_upm.c                                 |    4 
 drivers/mtd/nand/raw/fsmc_nand.c                               |    4 
 drivers/mtd/nand/raw/gpio.c                                    |    4 
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c                     |    4 
 drivers/mtd/nand/raw/hisi504_nand.c                            |    5 
 drivers/mtd/nand/raw/jz4740_nand.c                             |    4 
 drivers/mtd/nand/raw/jz4780_nand.c                             |    6 
 drivers/mtd/nand/raw/lpc32xx_mlc.c                             |    5 
 drivers/mtd/nand/raw/lpc32xx_slc.c                             |    5 
 drivers/mtd/nand/raw/marvell_nand.c                            |    6 
 drivers/mtd/nand/raw/mpc5121_nfc.c                             |    4 
 drivers/mtd/nand/raw/mtk_nand.c                                |    6 
 drivers/mtd/nand/raw/mxc_nand.c                                |    4 
 drivers/mtd/nand/raw/nand_base.c                               |   29 -
 drivers/mtd/nand/raw/nandsim.c                                 |    6 
 drivers/mtd/nand/raw/ndfc.c                                    |    4 
 drivers/mtd/nand/raw/nuc900_nand.c                             |    4 
 drivers/mtd/nand/raw/omap2.c                                   |    4 
 drivers/mtd/nand/raw/orion_nand.c                              |    7 
 drivers/mtd/nand/raw/oxnas_nand.c                              |   18 -
 drivers/mtd/nand/raw/pasemi_nand.c                             |    4 
 drivers/mtd/nand/raw/plat_nand.c                               |    6 
 drivers/mtd/nand/raw/qcom_nandc.c                              |    4 
 drivers/mtd/nand/raw/r852.c                                    |    4 
 drivers/mtd/nand/raw/s3c2410.c                                 |    4 
 drivers/mtd/nand/raw/sh_flctl.c                                |    4 
 drivers/mtd/nand/raw/sharpsl.c                                 |    6 
 drivers/mtd/nand/raw/sm_common.c                               |    2 
 drivers/mtd/nand/raw/socrates_nand.c                           |    7 
 drivers/mtd/nand/raw/sunxi_nand.c                              |    6 
 drivers/mtd/nand/raw/tango_nand.c                              |    4 
 drivers/mtd/nand/raw/tegra_nand.c                              |    2 
 drivers/mtd/nand/raw/tmio_nand.c                               |    6 
 drivers/mtd/nand/raw/txx9ndfmc.c                               |    4 
 drivers/mtd/nand/raw/vf610_nfc.c                               |    4 
 drivers/mtd/nand/raw/xway_nand.c                               |    6 
 drivers/net/ethernet/cavium/octeon/octeon_mgmt.c               |    5 
 drivers/net/ethernet/freescale/dpaa/dpaa_eth.c                 |    2 
 drivers/net/ethernet/intel/e1000e/netdev.c                     |   14 
 drivers/net/geneve.c                                           |    7 
 drivers/net/hamradio/yam.c                                     |    1 
 drivers/ntb/ntb.c                                              |    9 
 drivers/ntb/test/ntb_perf.c                                    |   30 +
 drivers/ntb/test/ntb_pingpong.c                                |   14 
 drivers/ntb/test/ntb_tool.c                                    |    9 
 drivers/of/kobj.c                                              |    3 
 drivers/pci/controller/dwc/pcie-designware-host.c              |    2 
 drivers/pci/controller/pci-aardvark.c                          |    4 
 drivers/pci/controller/pci-v3-semi.c                           |    2 
 drivers/pci/controller/pcie-rcar.c                             |    9 
 drivers/pci/controller/vmd.c                                   |    6 
 drivers/pci/pcie/aspm.c                                        |   10 
 drivers/pci/pcie/ptm.c                                         |   22 +
 drivers/pci/probe.c                                            |    5 
 drivers/pci/setup-res.c                                        |    9 
 drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c                   |    2 
 drivers/pinctrl/freescale/pinctrl-imx.c                        |   19 -
 drivers/pinctrl/freescale/pinctrl-imx1-core.c                  |    1 
 drivers/pinctrl/pinctrl-rockchip.c                             |    7 
 drivers/pinctrl/pinctrl-rza1.c                                 |    2 
 drivers/power/supply/Kconfig                                   |    2 
 drivers/power/supply/lp8788-charger.c                          |   18 -
 drivers/power/supply/smb347-charger.c                          |    1 
 drivers/pwm/pwm-img.c                                          |    8 
 drivers/remoteproc/remoteproc_core.c                           |    3 
 drivers/s390/cio/qdio.h                                        |    1 
 drivers/s390/cio/qdio_setup.c                                  |    1 
 drivers/s390/cio/qdio_thinint.c                                |   14 
 drivers/scsi/arm/acornscsi.c                                   |    4 
 drivers/scsi/ibmvscsi/ibmvscsi.c                               |    2 
 drivers/scsi/iscsi_boot_sysfs.c                                |    2 
 drivers/scsi/lpfc/lpfc_els.c                                   |    2 
 drivers/scsi/mpt3sas/mpt3sas_base.c                            |    2 
 drivers/scsi/qedf/qedf.h                                       |    1 
 drivers/scsi/qedf/qedf_main.c                                  |   35 ++
 drivers/scsi/qedi/qedi_iscsi.c                                 |    7 
 drivers/scsi/qla2xxx/qla_os.c                                  |    1 
 drivers/scsi/qla2xxx/tcm_qla2xxx.c                             |    2 
 drivers/scsi/sr.c                                              |    6 
 drivers/scsi/ufs/ufs-qcom.c                                    |    6 
 drivers/scsi/ufs/ufshcd.c                                      |    1 
 drivers/slimbus/qcom-ngd-ctrl.c                                |    4 
 drivers/staging/gasket/gasket_sysfs.c                          |    2 
 drivers/staging/greybus/light.c                                |    3 
 drivers/staging/mt29f_spinand/mt29f_spinand.c                  |    2 
 drivers/staging/sm750fb/sm750.c                                |    1 
 drivers/target/target_core_user.c                              |  154 ++++------
 drivers/thermal/ti-soc-thermal/ti-thermal-common.c             |    6 
 drivers/tty/hvc/hvc_console.c                                  |   16 -
 drivers/tty/n_gsm.c                                            |   26 -
 drivers/tty/serial/8250/8250_port.c                            |    4 
 drivers/tty/serial/amba-pl011.c                                |    1 
 drivers/usb/class/usblp.c                                      |    5 
 drivers/usb/dwc2/core_intr.c                                   |    7 
 drivers/usb/dwc3/gadget.c                                      |   24 +
 drivers/usb/gadget/composite.c                                 |   78 +++--
 drivers/usb/gadget/udc/lpc32xx_udc.c                           |   11 
 drivers/usb/gadget/udc/m66592-udc.c                            |    2 
 drivers/usb/gadget/udc/s3c2410_udc.c                           |    4 
 drivers/usb/host/ehci-mxc.c                                    |    2 
 drivers/usb/host/ehci-platform.c                               |  131 ++++++++
 drivers/usb/host/ohci-platform.c                               |    5 
 drivers/usb/host/xhci-plat.c                                   |   10 
 drivers/vfio/mdev/mdev_sysfs.c                                 |    2 
 drivers/vfio/pci/vfio_pci_config.c                             |   14 
 drivers/video/backlight/lp855x_bl.c                            |   20 +
 drivers/watchdog/da9062_wdt.c                                  |    5 
 fs/afs/proc.c                                                  |    1 
 fs/afs/write.c                                                 |    5 
 fs/block_dev.c                                                 |   12 
 fs/dlm/dlm_internal.h                                          |    1 
 fs/ext4/extents.c                                              |    2 
 fs/ext4/super.c                                                |   23 -
 fs/f2fs/super.c                                                |    3 
 fs/gfs2/log.c                                                  |   11 
 fs/gfs2/ops_fstype.c                                           |    2 
 fs/nfs/nfs4proc.c                                              |    2 
 fs/nfsd/nfs4callback.c                                         |    2 
 include/linux/bitops.h                                         |    2 
 include/linux/elfnote.h                                        |    2 
 include/linux/genhd.h                                          |    2 
 include/linux/kprobes.h                                        |    4 
 include/linux/libata.h                                         |    3 
 include/linux/mtd/rawnand.h                                    |    9 
 include/linux/usb/composite.h                                  |    3 
 include/linux/usb/ehci_def.h                                   |    2 
 include/uapi/linux/raid/md_p.h                                 |    2 
 kernel/kprobes.c                                               |   27 +
 kernel/trace/blktrace.c                                        |   30 -
 lib/zlib_inflate/inffast.c                                     |   91 ++---
 net/core/dev.c                                                 |   40 +-
 net/core/filter.c                                              |   16 -
 net/rxrpc/proc.c                                               |    6 
 net/sunrpc/addr.c                                              |    4 
 net/xdp/xsk.c                                                  |    4 
 scripts/mksysmap                                               |    2 
 security/apparmor/domain.c                                     |    9 
 security/apparmor/include/label.h                              |    1 
 security/apparmor/label.c                                      |   37 ++
 security/apparmor/lsm.c                                        |    5 
 security/selinux/ss/services.c                                 |    4 
 sound/isa/wavefront/wavefront_synth.c                          |    8 
 sound/pci/hda/patch_realtek.c                                  |   14 
 sound/soc/codecs/rt5645.c                                      |   14 
 sound/soc/davinci/davinci-mcasp.c                              |    4 
 sound/soc/fsl/fsl_asrc_dma.c                                   |    1 
 sound/soc/img/img-i2s-in.c                                     |    1 
 sound/soc/intel/boards/bytcr_rt5640.c                          |   24 +
 sound/soc/meson/axg-fifo.c                                     |   10 
 sound/soc/soc-core.c                                           |   22 +
 sound/soc/tegra/tegra_wm8903.c                                 |    6 
 sound/usb/card.h                                               |    4 
 sound/usb/endpoint.c                                           |   49 ++-
 sound/usb/endpoint.h                                           |    1 
 sound/usb/pcm.c                                                |    2 
 tools/perf/builtin-report.c                                    |    3 
 tools/testing/selftests/networking/timestamping/timestamping.c |   10 
 tools/testing/selftests/ntb/ntb_test.sh                        |    2 
 tools/testing/selftests/x86/protection_keys.c                  |    3 
 243 files changed, 1439 insertions(+), 887 deletions(-)

Adam Honse (1):
i2c: piix4: Detect secondary SMBus controller on AMD AM4 chipsets

Aharon Landau (1):
RDMA/mlx5: Add init2init as a modify command

Ahmed S. Darwish (2):
block: nr_sects_write(): Disable preemption on seqcount write
net: core: device_rename: Use rwsem instead of a seqcount

Alain Volmat (1):
clk: clk-flexgen: fix clock-critical handling

Alex Elder (1):
remoteproc: Fix IDR initialisation in rproc_alloc()

Alex Williamson (1):
vfio-pci: Mask cap zero

Alexander Sverdlin (1):
net: octeon: mgmt: Repair filling of RX ring

Alexander Tsoy (1):
ALSA: usb-audio: Improve frames size computation

Andreas Klinger (1):
iio: bmp280: fix compensation of humidity

Andrew Murray (1):
PCI: rcar: Fix incorrect programming of OB windows

Andy Shevchenko (3):
iio: pressure: bmp280: Tolerate IRQ before registering
gpio: dwapb: Call acpi_gpiochip_free_interrupts() on GPIO chip de-registration
gpio: dwapb: Append MODULE_ALIAS for platform driver

Ard Biesheuvel (2):
PCI: Allow pci_resize_resource() for devices on root bus x86/boot/compressed: Relax sed symbol type regex for LLVM ld.lld

Arnd Bergmann (2):
dlm: remove BUG() before panic() include/linux/bitops.h: avoid clang shift-count-overflow warnings

Bard Liao (1):
ASoC: core: only convert non DPCM link to DPCM link

Bjorn Helgaas (1):
PCI/PTM: Inherit Switch Downstream Port PTM settings from Upstream Port

Bob Peterson (2):
gfs2: Allow lock_nolock mount to specify jid=X
gfs2: fix use-after-free on transaction ail lists

Bodo Stroesser (1):
scsi: target: tcmu: Userspace must not complete queued commands

Boris Brezillon (2):
mtd: rawnand: Pass a nand_chip object to nand_scan()
mtd: rawnand: Pass a nand_chip object to nand_release()

Borislav Petkov (1):
x86/apic: Make TSC deadline timer detection message visible

Bryan O'Donoghue (1):

      clk: qcom: msm8916: Fix the address location of pll->config_reg

Can Guo (1):
scsi: ufs: Don't update urgent bkops level when toggling auto bkops

Chad Dupuis (1):
scsi: qedf: Fix crash when MFW calls for protocol stats while function is still probing

Chaitanya Kulkarni (3):
blktrace: use errno instead of bi_status
blktrace: fix endianness in get_pdu_int()
blktrace: fix endianness for blk_log_remap()

Chen Yu (1):
e1000e: Do not wake up the system via WOL if device wakeup is disabled

Chen Zhou (1):
staging: greybus: fix a missing-check bug in gb_lights_light_config()

Chris Wilson (1):
drm/i915: Whitelist context-local timestamp in the gen9 cmdparser

Christoph Hellwig (1):
firmware: qcom_scm: fix bogous abuse of dma-direct internals

Christophe JAILLET (7):
m68k/PCI: Fix a memory leak in an error handling path
PCI: v3-semi: Fix a memory leak in v3_pci_probe() error handling paths
power: supply: lp8788: Fix an error handling path in 'lp8788_charger_probe()'
extcon: adc-jack: Fix an error handling path in 'adc_jack_probe()'
pinctrl: imxl: Fix an error handling path in 'imx1_pinctrl_core_probe()'
pinctrl: freescale: imx: Fix an error handling path in 'imx_pinctrl_probe()'
scsi: acornscsi: Fix an error handling path in acornscsi_probe()

Chunyan Zhang (1):
clk: sprd: return correct type of value for _sprd_pll_recalc_rate

Colin Ian King (1):
usb: gadget: lpc32xx_udc: don't dereference ep pointer before null check

Cristian Klein (1):
HID: Add quirks for Trust Panora Graphic Tablet

Dafna Hirschfeld (1):
pinctrl: rockchip: fix memleak in rockchip_dt_node_to_map

Dan Carpenter (4):
scsi: qedi: Check for buffer overflow in qedi_set_path()
ALSA: isa/wavefront: prevent out of bounds write in ioctl
scsi: target: tcmu: Fix a use after free in tcmu_check_expired_queue_cmd()
of: Fix a refcounting bug in __of_attach_node_sysfs()

David Howells (3):
rxrpc: Adjust /proc/net/rxrpc/calls to display call->debug_id not user_ID
afs: Fix non-setting of mtime when writing into mmap
afs: afs_write_end() should change i_size under the right lock

Dmitry Osipenko (2):
ASoC: tegra: tegra_wm8903: Support nvidia, headset property
power: supply: smb347-charger: IRQSTAT_D is volatile

Dmitry V. Levin (1):
s390: fix syscall_get_error for compat processes

Emmanuel Nicolet (1):
ps3disk: use the default segment boundary

Enric Balletbo i Serra (1):
power: supply: bq24257_charger: Replace depends on REGMAP_I2C with select

Eric Biggers (1):
crypto: algboss - don't wait during notifier callback

Fabrice Gasnier (1):
usb: dwc2: gadget: move gadget resume after the core is in L0 state

Fedor Tokarev (1):
net: sunrpc: Fix off-by-one issues in 'rpc_ntop6'

Feng Tang (1):
ipmi: use vzalloc instead of kmalloc for user creation

Gaurav Singh (1):
perf report: Fix NULL pointer dereference in hists__fprintf_nr_sample_events()

Geoff Levand (1):
powerpc/ps3: Fix kexec shutdown hang

Greg Kroah-Hartman (1):

      Linux 4.19.130

Gregory CLEMENT (3):
tty: n_gsm: Fix SOF skipping
tty: n_gsm: Fix waking up upper tty layer when room available
tty: n_gsm: Fix bogus i++ in gsm_data_kick

Hannes Reinecke (1):
dm zoned: return NULL if dmz_get_zone_for_reclaim() fails to find a zone

Hans de Goede (4):
x86/purgatory: Disable various profiling and sanitizing options
ASoC: Intel: bytcr_rt5640: Add quirk for Toshiba Encore WT8-A tablet
ASoC: Intel: bytcr_rt5640: Add quirk for Toshiba Encore WT10-A tablet
ASoC: rt5645: Add platform-data for Asus T101HA

Herbert Xu (1):

      crypto: algif_skcipher - Cap recv SG list at ctx->used

Hsin-Yi Wang (1):
arm64: dts: mt8173: fix unit name warnings

Huacai Chen (1):
drm/qxl: Use correct notify port address when creating cursor ring

Imre Deak (1):
drm/i915/icl+: Fix hotplug interrupt disabling after storm detection

Jann Horn (1):
lib/zlib: remove outdated and incorrect pre-increment optimization

Jason Yan (2):
pinctrl: rza1: Fix wrong array assignment of rza1l_swio_entries
block: Fix use-after-free in blkdev_get()

Jeffrey Hugo (1):
scsi: ufs-qcom: Fix scheduling while atomic issue

Jernej Skrabec (1):
drm/sun4i: hdmi ddc clk: Fix size of m divider

Jiri Benc (1):
geneve: change from tx_error to tx_dropped on missing metadata

Jiri Olsa (1):
kretprobe: Prevent triggering kretprobe from within kprobe_flush_task

John Johansen (2):
apparmor: fix introspection of of task mode for unconfined tasks
apparmor: fix nnp subset test for unconfined

John Stultz (1):
serial: amba-pl011: Make sure we initialize the port.lock spinlock

Jon Derrick (1):
PCI: vmd: Filter resource type bits from shadow register

Jon Hunter (2):
backlight: lp855x: Ensure regulators are disabled on probe failure
arm64: tegra: Fix ethernet phy-mode for Jetson Xavier

Julian Wiedmann (1):
s390/qdio: put thinint indicator after early error

Kai Huang (2):
kvm: x86: Move kvm_set_mmio_spte_mask() from x86.c to mmu.c
kvm: x86: Fix reserved bits related calculation errors caused by MKTME

Kai-Heng Feng (3):
ALSA: hda/realtek - Introduce polarity for micmute LED GPIO PCI/ASPM: Allow ASPM on links to PCIe-to-PCI/PCI-X Bridges
libata: Use per port sync for detach

Kajol Jain (1):
powerpc/perf/hv-24x7: Fix inconsistent output values incase multiple hv-24x7 events run

Konstantin Khlebnikov (1):
f2fs: report delalloc reserve as non-free in statfs for project quota

Kuppuswamy Sathyanarayanan (1):
drivers: base: Fix NULL pointer exception in __platform_driver_probe() if a driver developer is foolish

Li RongQing (1):
xdp: Fix xsk_generic_xmit errno

Linus Walleij (1):
ARM: integrator: Add some Kconfig selections

Logan Gunthorpe (8):
NTB: ntb_pingpong: Choose doorbells based on port number
NTB: Fix the default port and peer numbers for legacy drivers
NTB: ntb_tool: reading the link file should not end in a NULL byte
NTB: Revert the change to use the NTB device dev for DMA allocations
NTB: perf: Don't require one more memory window than number of peers
NTB: perf: Fix support for hardware that doesn't have port numbers
NTB: perf: Fix race condition when run with ntb_test
NTB: ntb_test: Fix bug when counting remote files

Lyude Paul (2):
drm/dp_mst: Reformat drm_dp_check_act_status() a bit drm/dp_mst: Increase ACT retry timeout to 3s

Maor Gottlieb (1):
IB/cma: Fix ports memory leak in cma_configfs

Marc Zyngier (1):
PCI: dwc: Fix inner MSI IRQ domain registration

Marek Szyprowski (3):
clk: samsung: Mark top ISP and CAM clocks on Exynos542x as critical
mfd: wm8994: Fix driver operation if loaded as modules
clk: samsung: exynos5433: Add IGNORE_UNUSED flag to sclk_i2s1

Martin Wilck (1):
dm mpath: switch paths in dm_blk_ioctl() code path

Masami Hiramatsu (1):
kprobes: Fix to protect kick_kprobe_optimizer() by kprobe_mutex

Matej Dujava (1):
staging: sm750fb: add missing case while setting FB_VISUAL

Mauricio Faria de Oliveira (1):
apparmor: check/put label on apparmor_sk_clone_security()

Michael Ellerman (1):

      powerpc/64: Don't initialise init_task->thread.regs

Miquel Raynal (9):
mtd: rawnand: diskonchip: Fix the probe error path
mtd: rawnand: sharpsl: Fix the probe error path
mtd: rawnand: xway: Fix the probe error path
mtd: rawnand: orion: Fix the probe error path
mtd: rawnand: oxnas: Fix the probe error path
mtd: rawnand: socrates: Fix the probe error path
mtd: rawnand: plat_nand: Fix the probe error path
mtd: rawnand: mtk: Fix the probe error path
mtd: rawnand: tmio: Fix the probe error path

Nathan Chancellor (2):
USB: gadget: udc: s3c2410_udc: Remove pointless NULL check in s3c2410_udc_nuke
clk: bcm2835: Fix return type of bcm2835_register_gate

Navid Emamdoost (1):
pwm: img: Call pm_runtime_put() in pm_runtime_get_sync() failed case

NeilBrown (1):
md: add feature flag MD_FEATURE_RAID0_LAYOUT

Nicholas Piggin (1):
powerpc/pseries/ras: Fix FWNMI_VALID off by one

Nick Desaulniers (1):
elfnote: mark all .note sections SHF_ALLOC

Nilesh Javali (1):
scsi: qedi: Do not flush offload work if ARP not resolved

Nishka Dasgupta (1):
mtd: rawnand: oxnas: Add of_node_put()

Olga Kornievskaia (1):
NFSv4.1 fix rpc_call_done assignment for BIND_CONN_TO_SESSION

Oliver Neukum (1):
usblp: poison URBs upon disconnect

Pali Rohár (1):
PCI: aardvark: Don't blindly enable ASPM L0s and don't write to read-only register

Pavel Machek (CIP) (1):
ASoC: meson: add missing free_irq() in error path

Pawel Laszczak (1):
usb: gadget: Fix issue with config_ep_by_speed function

Pingfan Liu (1):
powerpc/crashkernel: Take "mem=" option into account

Potnuri Bharat Teja (1):
RDMA/iw_cxgb4: cleanup device debugfs entries on ULD remove

Qais Yousef (3):
usb/ohci-platform: Fix a warning when hibernating usb/xhci-plat: Set PM runtime as active on resume usb/ehci-platform: Set PM runtime as active on resume

Qian Cai (3):
vfio/pci: fix memory leaks in alloc_perm_bits() powerpc/64s/pgtable: fix an undefined behaviour
KVM: PPC: Book3S HV: Ignore kmemleak false positives

Qiushi Wu (4):
usb: gadget: fix potential double-free in m66592_probe.
ASoC: fix incomplete error-handling in img_i2s_in_probe. vfio/mdev: Fix reference count leak in add_mdev_supported_type
scsi: iscsi: Fix reference count leak in iscsi_boot_create_kobj

Raghavendra Rao Ananta (1):
tty: hvc: Fix data abort due to race in hvc_open

Ram Pai (1):
selftests/vm/pkeys: fix alloc_random_pkey() to make it really random

Rikard Falkeborn (1):
clk: sunxi: Fix incorrect usage of round_down()

Rob Herring (1):
PCI: Fix pci_register_host_bridge() device_register() error handling

Roy Spliet (1):
drm/msm/mdp5: Fix mdp5_init error path for failed mdp5_kms allocation

Russell King (2):
i2c: pxa: clear all master action bits in i2c_pxa_stop_message()
i2c: pxa: fix i2c_pxa_scream_blue_murder() debug output

Sandeep Raghuraman (1):
drm/amdgpu: Replace invalid device ID with a valid device ID

Sanjay R Mehta (2):
ntb_perf: pass correct struct device to dma_alloc_coherent
ntb_tool: pass correct struct device to dma_alloc_coherent

Sasha Levin (1):
ext4: fix partial cluster initialization when splitting extent

Sean Christopherson (1):
KVM: x86/mmu: Set mmio_value to '0' if reserved #PF can't be generated

Serge Semin (1):
serial: 8250: Fix max baud limit in generic 8250 port

Shaokun Zhang (1):
drivers/perf: hisi: Fix wrong value for all counters enable

Simon Arlott (1):
scsi: sr: Fix sr_probe() missing deallocate of device minor

Souptick Joarder (1):
fpga: dfl: afu: Corrected error handling levels

Srinivas Kandagatla (1):
slimbus: ngd: get drvdata from correct device

Stafford Horne (1):
openrisc: Fix issue with argument clobbering for clone/fork

Stefan Riedmueller (1):
watchdog: da9062: No need to ping manually before setting timeout

Sudip Mukherjee (1):
thermal/drivers/ti-soc-thermal: Avoid dereferencing ERR_PTR

Suganath Prabu S (1):
scsi: mpt3sas: Fix double free warnings

Takashi Iwai (1):
ALSA: usb-audio: Fix racy list management in output queue

Tang Bin (1):
USB: host: ehci-mxc: Add error handling in ehci_mxc_drv_probe()

Tero Kristo (2):
clk: ti: composite: fix memory leak
crypto: omap-sham - add proper load balancing support for multicore

Theodore Ts'o (1):
ext4: avoid race conditions when remounting with options that change dax

Thinh Nguyen (1):
usb: dwc3: gadget: Properly handle failed kick_transfer

Thomas Gleixner (1):
sched/rt, net: Use CONFIG_PREEMPTION.patch

Tom Rix (1):
selinux: fix double free

Tyrel Datwyler (1):
scsi: ibmvscsi: Don't send host info in adapter info MAD after LPM

Viacheslav Dubeyko (2):
scsi: qla2xxx: Fix issue with adapter's stopping state
scsi: qla2xxx: Fix warning after FC target reset

Vincent Stehlé (1):
ARM: dts: sun8i-h2-plus-bananapi-m2-zero: Fix led polarity

Vitaly Kuznetsov (1):
x86/idt: Keep spurious entries unset in system_vectors

Vladimir Oltean (1):
Revert "dpaa_eth: fix usage as DSA master, try 3"

Wang Hai (1):
yam: fix possible memory leak in yam_init_driver

Will Deacon (1):
arm64: hw_breakpoint: Don't invoke overflow handler on uaccess watchpoints

Wolfram Sang (1):
drm: encoder_slave: fix refcouting error for modules

Xiyu Yang (6):
ASoC: davinci-mcasp: Fix dma_chan refcnt leak when getting dma type
scsi: lpfc: Fix lpfc_nodelist leak when processing unsolicited event
nfsd: Fix svc_xprt refcnt leak when setup callback client failed
staging: gasket: Fix mapping refcnt leak when put attribute fails
staging: gasket: Fix mapping refcnt leak when register/store fails
ASoC: fsl_asrc_dma: Fix dma_chan leak when config DMA channel failed

YiFei Zhu (1):
net/filter: Permit reading NET in load_bytes_relative when MAC not set

Yoshihiro Shimoda (1):
usb: host: ehci-platform: add a quirk to avoid stuck

Zhihao Cheng (1):
afs: Fix memory leak in afs_put_sysnames()

Zhiqiang Liu (1):
bcache: fix potential deadlock problem in btree_gc_coalesce

ashimida (1):
mksysmap: Fix the mismatch of '.L' symbols in System.map

huhai (1):
powerpc/4xx: Don't unmap NULL mbase

tannerlove (1):
selftests/net: in timestamping, strncpy needs to preserve null byte

yangerkun (1):
ext4: stop overwrite the errcode in ext4_setup_super

author maintainer
#1 lore raw
Documentation/driver-api/mtdnand.rst +2 -2
index c55a6034c397..5470a3d6bd9e 100644
@@ -246,7 +246,7 @@ necessary information about the device.
         this->eccmode = NAND_ECC_SOFT;
 
         /* Scan to find existence of the device */
-        if (nand_scan (board_mtd, 1)) {
+        if (nand_scan (this, 1)) {
             err = -ENXIO;
             goto out_ior;
         }
@@ -277,7 +277,7 @@ unregisters the partitions in the MTD layer.
     static void __exit board_cleanup (void)
     {
         /* Release resources, unregister device */
-        nand_release (board_mtd);
+        nand_release (mtd_to_nand(board_mtd));
 
         /* unmap physical address */
         iounmap(baseaddr);
Makefile +1 -1
index e6066502e9cc..6443cbd51f70 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 VERSION = 4
 PATCHLEVEL = 19
-SUBLEVEL = 129
+SUBLEVEL = 130
 EXTRAVERSION =
 NAME = "People's Front"
 
arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts +1 -1
index 1db2541135a7..00e0d6940c30 100644
@@ -32,7 +32,7 @@
 
 		pwr_led {
 			label = "bananapi-m2-zero:red:pwr";
-			gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */
+			gpios = <&r_pio 0 10 GPIO_ACTIVE_LOW>; /* PL10 */
 			default-state = "on";
 		};
 	};
arch/arm/mach-integrator/Kconfig +4 -3
index cefe44f6889b..ba124f8704fa 100644
@@ -3,6 +3,8 @@ menuconfig ARCH_INTEGRATOR
 	depends on ARCH_MULTI_V4T || ARCH_MULTI_V5 || ARCH_MULTI_V6
 	select ARM_AMBA
 	select COMMON_CLK_VERSATILE
+	select CMA
+	select DMA_CMA
 	select HAVE_TCM
 	select ICST
 	select MFD_SYSCON
@@ -34,14 +36,13 @@ config INTEGRATOR_IMPD1
 	select ARM_VIC
 	select GPIO_PL061
 	select GPIOLIB
+	select REGULATOR
+	select REGULATOR_FIXED_VOLTAGE
 	help
 	  The IM-PD1 is an add-on logic module for the Integrator which
 	  allows ARM(R) Ltd PrimeCells to be developed and evaluated.
 	  The IM-PD1 can be found on the Integrator/PP2 platform.
 
-	  To compile this driver as a module, choose M here: the
-	  module will be called impd1.
-
 config INTEGRATOR_CM7TDMI
 	bool "Integrator/CM7TDMI core module"
 	depends on ARCH_INTEGRATOR_AP
arch/arm64/boot/dts/mediatek/mt8173.dtsi +11 -11
index abd2f15a544b..bd9fc50ac154 100644
@@ -223,21 +223,21 @@
 		cpu_on	      = <0x84000003>;
 	};
 
-	clk26m: oscillator@0 {
+	clk26m: oscillator0 {
 		compatible = "fixed-clock";
 		#clock-cells = <0>;
 		clock-frequency = <26000000>;
 		clock-output-names = "clk26m";
 	};
 
-	clk32k: oscillator@1 {
+	clk32k: oscillator1 {
 		compatible = "fixed-clock";
 		#clock-cells = <0>;
 		clock-frequency = <32000>;
 		clock-output-names = "clk32k";
 	};
 
-	cpum_ck: oscillator@2 {
+	cpum_ck: oscillator2 {
 		compatible = "fixed-clock";
 		#clock-cells = <0>;
 		clock-frequency = <0>;
@@ -253,19 +253,19 @@
 			sustainable-power = <1500>; /* milliwatts */
 
 			trips {
-				threshold: trip-point@0 {
+				threshold: trip-point0 {
 					temperature = <68000>;
 					hysteresis = <2000>;
 					type = "passive";
 				};
 
-				target: trip-point@1 {
+				target: trip-point1 {
 					temperature = <85000>;
 					hysteresis = <2000>;
 					type = "passive";
 				};
 
-				cpu_crit: cpu_crit@0 {
+				cpu_crit: cpu_crit0 {
 					temperature = <115000>;
 					hysteresis = <2000>;
 					type = "critical";
@@ -273,12 +273,12 @@
 			};
 
 			cooling-maps {
-				map@0 {
+				map0 {
 					trip = <&target>;
 					cooling-device = <&cpu0 0 0>;
 					contribution = <3072>;
 				};
-				map@1 {
+				map1 {
 					trip = <&target>;
 					cooling-device = <&cpu2 0 0>;
 					contribution = <1024>;
@@ -291,7 +291,7 @@
 		#address-cells = <2>;
 		#size-cells = <2>;
 		ranges;
-		vpu_dma_reserved: vpu_dma_mem_region {
+		vpu_dma_reserved: vpu_dma_mem_region@b7000000 {
 			compatible = "shared-dma-pool";
 			reg = <0 0xb7000000 0 0x500000>;
 			alignment = <0x1000>;
@@ -343,7 +343,7 @@
 			reg = <0 0x10005000 0 0x1000>;
 		};
 
-		pio: pinctrl@10005000 {
+		pio: pinctrl@1000b000 {
 			compatible = "mediatek,mt8173-pinctrl";
 			reg = <0 0x1000b000 0 0x1000>;
 			mediatek,pctl-regmap = <&syscfg_pctl_a>;
@@ -541,7 +541,7 @@
 			status = "disabled";
 		};
 
-		gic: interrupt-controller@10220000 {
+		gic: interrupt-controller@10221000 {
 			compatible = "arm,gic-400";
 			#interrupt-cells = <3>;
 			interrupt-parent = <&gic>;
arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi +1 -1
index 57d3f00464ce..7352954e12be 100644
@@ -32,7 +32,7 @@
 
 			phy-reset-gpios = <&gpio TEGRA194_MAIN_GPIO(G, 5) GPIO_ACTIVE_LOW>;
 			phy-handle = <&phy>;
-			phy-mode = "rgmii";
+			phy-mode = "rgmii-id";
 
 			mdio {
 				#address-cells = <1>;
arch/arm64/kernel/hw_breakpoint.c +26 -18

64 lines not on this page · raw message

arch/m68k/coldfire/pci.c +3 -1
index 62b0eb6cf69a..84eab0f5e00a 100644
@@ -216,8 +216,10 @@ static int __init mcf_pci_init(void)
 
 	/* Keep a virtual mapping to IO/config space active */
 	iospace = (unsigned long) ioremap(PCI_IO_PA, PCI_IO_SIZE);
-	if (iospace == 0)
+	if (iospace == 0) {
+		pci_free_host_bridge(bridge);
 		return -ENODEV;
+	}
 	pr_info("Coldfire: PCI IO/config window mapped to 0x%x\n",
 		(u32) iospace);
 
arch/openrisc/kernel/entry.S +2 -2
index ee6159d2ed22..01b59d2ce174 100644
@@ -1170,13 +1170,13 @@ ENTRY(__sys_clone)
 	l.movhi	r29,hi(sys_clone)
 	l.ori	r29,r29,lo(sys_clone)
 	l.j	_fork_save_extra_regs_and_call
-	 l.addi	r7,r1,0
+	 l.nop
 
 ENTRY(__sys_fork)
 	l.movhi	r29,hi(sys_fork)
 	l.ori	r29,r29,lo(sys_fork)
 	l.j	_fork_save_extra_regs_and_call
-	 l.addi	r3,r1,0
+	 l.nop
 
 ENTRY(sys_rt_sigreturn)
 	l.jal	_sys_rt_sigreturn
arch/powerpc/include/asm/book3s/64/pgtable.h +19 -4
index 2aea6efc2e63..008eb63fa851 100644
@@ -985,10 +985,25 @@ extern struct page *pgd_page(pgd_t pgd);
 #define pud_page_vaddr(pud)	__va(pud_val(pud) & ~PUD_MASKED_BITS)
 #define pgd_page_vaddr(pgd)	__va(pgd_val(pgd) & ~PGD_MASKED_BITS)
 
-#define pgd_index(address) (((address) >> (PGDIR_SHIFT)) & (PTRS_PER_PGD - 1))
-#define pud_index(address) (((address) >> (PUD_SHIFT)) & (PTRS_PER_PUD - 1))
-#define pmd_index(address) (((address) >> (PMD_SHIFT)) & (PTRS_PER_PMD - 1))
-#define pte_index(address) (((address) >> (PAGE_SHIFT)) & (PTRS_PER_PTE - 1))
+static inline unsigned long pgd_index(unsigned long address)
+{
+	return (address >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1);
+}
+
+static inline unsigned long pud_index(unsigned long address)
+{
+	return (address >> PUD_SHIFT) & (PTRS_PER_PUD - 1);
+}
+
+static inline unsigned long pmd_index(unsigned long address)
+{
+	return (address >> PMD_SHIFT) & (PTRS_PER_PMD - 1);
+}
+
+static inline unsigned long pte_index(unsigned long address)
+{
+	return (address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1);
+}
 
 /*
  * Find an entry in a page-table-directory.  We combine the address region
arch/powerpc/include/asm/processor.h +0 -1
index 52fadded5c1e..45bbcffcb7b6 100644
@@ -386,7 +386,6 @@ struct thread_struct {
 #else
 #define INIT_THREAD  { \
 	.ksp = INIT_SP, \
-	.regs = (struct pt_regs *)INIT_SP - 1, /* XXX bogus, I think */ \
 	.addr_limit = KERNEL_DS, \
 	.fpexc_mode = 0, \
 	.ppr = INIT_PPR, \
arch/powerpc/kernel/head_64.S +1 -8
index 3fb564f3e887..389da790c129 100644
@@ -950,15 +950,8 @@ start_here_multiplatform:
 	std	r0,0(r4)
 #endif
 
-	/* The following gets the stack set up with the regs */
-	/* pointing to the real addr of the kernel stack.  This is   */
-	/* all done to support the C function call below which sets  */
-	/* up the htab.  This is done because we have relocated the  */
-	/* kernel but are still running in real mode. */
-
-	LOAD_REG_ADDR(r3,init_thread_union)
-
 	/* set up a stack pointer */
+	LOAD_REG_ADDR(r3,init_thread_union)
 	LOAD_REG_IMMEDIATE(r1,THREAD_SIZE)
 	add	r1,r3,r1
 	li	r0,0
arch/powerpc/kernel/machine_kexec.c +5 -3
index 63f5a9311a29..094c37fb07a9 100644
@@ -116,11 +116,12 @@ void machine_kexec(struct kimage *image)
 
 void __init reserve_crashkernel(void)
 {
-	unsigned long long crash_size, crash_base;
+	unsigned long long crash_size, crash_base, total_mem_sz;
 	int ret;
 
+	total_mem_sz = memory_limit ? memory_limit : memblock_phys_mem_size();
 	/* use common parsing */
-	ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(),
+	ret = parse_crashkernel(boot_command_line, total_mem_sz,
 			&crash_size, &crash_base);
 	if (ret == 0 && crash_size > 0) {
 		crashk_res.start = crash_base;
@@ -179,6 +180,7 @@ void __init reserve_crashkernel(void)
 	/* Crash kernel trumps memory limit */
 	if (memory_limit && memory_limit <= crashk_res.end) {
 		memory_limit = crashk_res.end + 1;
+		total_mem_sz = memory_limit;
 		printk("Adjusted memory limit for crashkernel, now 0x%llx\n",
 		       memory_limit);
 	}
@@ -187,7 +189,7 @@ void __init reserve_crashkernel(void)
 			"for crashkernel (System RAM: %ldMB)\n",
 			(unsigned long)(crash_size >> 20),
 			(unsigned long)(crashk_res.start >> 20),
-			(unsigned long)(memblock_phys_mem_size() >> 20));
+			(unsigned long)(total_mem_sz >> 20));
 
 	if (!memblock_is_region_memory(crashk_res.start, crash_size) ||
 	    memblock_reserve(crashk_res.start, crash_size)) {
arch/powerpc/kvm/book3s_64_mmu_radix.c +14 -2
index 998f8d089ac7..df0f08cb821b 100644
@@ -171,7 +171,13 @@ static struct kmem_cache *kvm_pmd_cache;
 
 static pte_t *kvmppc_pte_alloc(void)
 {
-	return kmem_cache_alloc(kvm_pte_cache, GFP_KERNEL);
+	pte_t *pte;
+
+	pte = kmem_cache_alloc(kvm_pte_cache, GFP_KERNEL);
+	/* pmd_populate() will only reference _pa(pte). */
+	kmemleak_ignore(pte);
+
+	return pte;
 }
 
 static void kvmppc_pte_free(pte_t *ptep)
@@ -187,7 +193,13 @@ static inline int pmd_is_leaf(pmd_t pmd)
 
 static pmd_t *kvmppc_pmd_alloc(void)
 {
-	return kmem_cache_alloc(kvm_pmd_cache, GFP_KERNEL);
+	pmd_t *pmd;
+
+	pmd = kmem_cache_alloc(kvm_pmd_cache, GFP_KERNEL);
+	/* pud_populate() will only reference _pa(pmd). */
+	kmemleak_ignore(pmd);
+
+	return pmd;
 }
 
 static void kvmppc_pmd_free(pmd_t *pmdp)
arch/powerpc/perf/hv-24x7.c +0 -10
index 72238eedc360..2bb798918483 100644
@@ -1413,16 +1413,6 @@ static void h_24x7_event_read(struct perf_event *event)
 			h24x7hw = &get_cpu_var(hv_24x7_hw);
 			h24x7hw->events[i] = event;
 			put_cpu_var(h24x7hw);
-			/*
-			 * Clear the event count so we can compute the _change_
-			 * in the 24x7 raw counter value at the end of the txn.
-			 *
-			 * Note that we could alternatively read the 24x7 value
-			 * now and save its value in event->hw.prev_count. But
-			 * that would require issuing a hcall, which would then
-			 * defeat the purpose of using the txn interface.
-			 */
-			local64_set(&event->count, 0);
 		}
 
 		put_cpu_var(hv_24x7_reqb);
arch/powerpc/platforms/4xx/pci.c +1 -3
index 5aca523551ae..2f237027fdcc 100644
@@ -1242,7 +1242,7 @@ static void __init ppc460sx_pciex_check_link(struct ppc4xx_pciex_port *port)
 	if (mbase == NULL) {
 		printk(KERN_ERR "%pOF: Can't map internal config space !",
 			port->node);
-		goto done;
+		return;
 	}
 
 	while (attempt && (0 == (in_le32(mbase + PECFG_460SX_DLLSTA)
@@ -1252,9 +1252,7 @@ static void __init ppc460sx_pciex_check_link(struct ppc4xx_pciex_port *port)
 	}
 	if (attempt)
 		port->link = 1;
-done:
 	iounmap(mbase);
-
 }
 
 static struct ppc4xx_pciex_hwops ppc460sx_pcie_hwops __initdata = {
arch/powerpc/platforms/ps3/mm.c +12 -10
index 8c7009d001d9..894f62d77a77 100644
@@ -212,13 +212,14 @@ void ps3_mm_vas_destroy(void)
 {
 	int result;
 
-	DBG("%s:%d: map.vas_id    = %llu\n", __func__, __LINE__, map.vas_id);
-
 	if (map.vas_id) {
 		result = lv1_select_virtual_address_space(0);
-		BUG_ON(result);
-		result = lv1_destruct_virtual_address_space(map.vas_id);
-		BUG_ON(result);
+		result += lv1_destruct_virtual_address_space(map.vas_id);
+
+		if (result) {
+			lv1_panic(0);
+		}
+
 		map.vas_id = 0;
 	}
 }
@@ -316,19 +317,20 @@ static void ps3_mm_region_destroy(struct mem_region *r)
 	int result;
 
 	if (!r->destroy) {
-		pr_info("%s:%d: Not destroying high region: %llxh %llxh\n",
-			__func__, __LINE__, r->base, r->size);
 		return;
 	}
 
-	DBG("%s:%d: r->base = %llxh\n", __func__, __LINE__, r->base);
-
 	if (r->base) {
 		result = lv1_release_memory(r->base);
-		BUG_ON(result);
+
+		if (result) {
+			lv1_panic(0);
+		}
+
 		r->size = r->base = r->offset = 0;
 		map.total = map.rm.size;
 	}
+
 	ps3_mm_set_repository_highmem(NULL);
 }
 
arch/powerpc/platforms/pseries/ras.c +3 -2
index 851ce326874a..e81a285f3a6c 100644
@@ -328,10 +328,11 @@ static irqreturn_t ras_error_interrupt(int irq, void *dev_id)
 /*
  * Some versions of FWNMI place the buffer inside the 4kB page starting at
  * 0x7000. Other versions place it inside the rtas buffer. We check both.
+ * Minimum size of the buffer is 16 bytes.
  */
 #define VALID_FWNMI_BUFFER(A) \
-	((((A) >= 0x7000) && ((A) < 0x7ff0)) || \
-	(((A) >= rtas.base) && ((A) < (rtas.base + rtas.size - 16))))
+	((((A) >= 0x7000) && ((A) <= 0x8000 - 16)) || \
+	(((A) >= rtas.base) && ((A) <= (rtas.base + rtas.size - 16))))
 
 static inline struct rtas_error_log *fwnmi_get_errlog(void)
 {
arch/s390/include/asm/syscall.h +11 -1
index 96f9a9151fde..2becba8008c4 100644
@@ -38,7 +38,17 @@ static inline void syscall_rollback(struct task_struct *task,
 static inline long syscall_get_error(struct task_struct *task,
 				     struct pt_regs *regs)
 {
-	return IS_ERR_VALUE(regs->gprs[2]) ? regs->gprs[2] : 0;
+	unsigned long error = regs->gprs[2];
+#ifdef CONFIG_COMPAT
+	if (test_tsk_thread_flag(task, TIF_31BIT)) {
+		/*
+		 * Sign-extend the value so (int)-EFOO becomes (long)-EFOO
+		 * and will match correctly in comparisons.
+		 */
+		error = (long)(int)error;
+	}
+#endif
+	return IS_ERR_VALUE(error) ? error : 0;
 }
 
 static inline long syscall_get_return_value(struct task_struct *task,
arch/x86/boot/Makefile +1 -1
index e2839b5c246c..6539c50fb9aa 100644
@@ -87,7 +87,7 @@ $(obj)/vmlinux.bin: $(obj)/compressed/vmlinux FORCE
 
 SETUP_OBJS = $(addprefix $(obj)/,$(setup-y))
 
-sed-zoffset := -e 's/^\([0-9a-fA-F]*\) [ABCDGRSTVW] \(startup_32\|startup_64\|efi32_stub_entry\|efi64_stub_entry\|efi_pe_entry\|input_data\|_end\|_ehead\|_text\|z_.*\)$$/\#define ZO_\2 0x\1/p'
+sed-zoffset := -e 's/^\([0-9a-fA-F]*\) [a-zA-Z] \(startup_32\|startup_64\|efi32_stub_entry\|efi64_stub_entry\|efi_pe_entry\|input_data\|_end\|_ehead\|_text\|z_.*\)$$/\#define ZO_\2 0x\1/p'
 
 quiet_cmd_zoffset = ZOFFSET $@
       cmd_zoffset = $(NM) $< | sed -n $(sed-zoffset) > $@
arch/x86/kernel/apic/apic.c +1 -1
index 53dc8492f02f..e9456a2eef58 100644
@@ -2024,7 +2024,7 @@ void __init init_apic_mappings(void)
 	unsigned int new_apicid;
 
 	if (apic_validate_deadline_timer())
-		pr_debug("TSC deadline timer available\n");
+		pr_info("TSC deadline timer available\n");
 
 	if (x2apic_mode) {
 		boot_cpu_physical_apicid = read_apic_id();
arch/x86/kernel/idt.c +5 -1
index a7e0e975043f..e1f9355307b8 100644
@@ -320,7 +320,11 @@ void __init idt_setup_apic_and_irq_gates(void)
 
 #ifdef CONFIG_X86_LOCAL_APIC
 	for_each_clear_bit_from(i, system_vectors, NR_VECTORS) {
-		set_bit(i, system_vectors);
+		/*
+		 * Don't set the non assigned system vectors in the
+		 * system_vectors bitmap. Otherwise they show up in
+		 * /proc/interrupts.
+		 */
 		entry = spurious_entries_start + 8 * (i - FIRST_SYSTEM_VECTOR);
 		set_intr_gate(i, entry);
 	}
arch/x86/kernel/kprobes/core.c +3 -13
index 173e915e11d5..07e290244ca9 100644
@@ -765,16 +765,11 @@ asm(
 NOKPROBE_SYMBOL(kretprobe_trampoline);
 STACK_FRAME_NON_STANDARD(kretprobe_trampoline);
 
-static struct kprobe kretprobe_kprobe = {
-	.addr = (void *)kretprobe_trampoline,
-};
-
 /*
  * Called from kretprobe_trampoline
  */
 __visible __used void *trampoline_handler(struct pt_regs *regs)
 {
-	struct kprobe_ctlblk *kcb;
 	struct kretprobe_instance *ri = NULL;
 	struct hlist_head *head, empty_rp;
 	struct hlist_node *tmp;
@@ -784,16 +779,12 @@ __visible __used void *trampoline_handler(struct pt_regs *regs)
 	void *frame_pointer;
 	bool skipped = false;
 
-	preempt_disable();
-
 	/*
 	 * Set a dummy kprobe for avoiding kretprobe recursion.
 	 * Since kretprobe never run in kprobe handler, kprobe must not
 	 * be running at this point.
 	 */
-	kcb = get_kprobe_ctlblk();
-	__this_cpu_write(current_kprobe, &kretprobe_kprobe);
-	kcb->kprobe_status = KPROBE_HIT_ACTIVE;
+	kprobe_busy_begin();
 
 	INIT_HLIST_HEAD(&empty_rp);
 	kretprobe_hash_lock(current, &head, &flags);
@@ -872,7 +863,7 @@ __visible __used void *trampoline_handler(struct pt_regs *regs)
 			__this_cpu_write(current_kprobe, &ri->rp->kp);
 			ri->ret_addr = correct_ret_addr;
 			ri->rp->handler(ri, regs);
-			__this_cpu_write(current_kprobe, &kretprobe_kprobe);
+			__this_cpu_write(current_kprobe, &kprobe_busy);
 		}
 
 		recycle_rp_inst(ri, &empty_rp);
@@ -888,8 +879,7 @@ __visible __used void *trampoline_handler(struct pt_regs *regs)
 
 	kretprobe_hash_unlock(current, &flags);
 
-	__this_cpu_write(current_kprobe, NULL);
-	preempt_enable();
+	kprobe_busy_end();
 
 	hlist_for_each_entry_safe(ri, tmp, &empty_rp, hlist) {
 		hlist_del(&ri->hlist);
arch/x86/kvm/mmu.c +47 -4

104 lines not on this page · raw message

arch/x86/kvm/x86.c +0 -31
index c53df0b95385..50d59ad34619 100644
@@ -6775,35 +6775,6 @@ static struct perf_guest_info_callbacks kvm_guest_cbs = {
 	.get_guest_ip		= kvm_get_guest_ip,
 };
 
-static void kvm_set_mmio_spte_mask(void)
-{
-	u64 mask;
-	int maxphyaddr = boot_cpu_data.x86_phys_bits;
-
-	/*
-	 * Set the reserved bits and the present bit of an paging-structure
-	 * entry to generate page fault with PFER.RSV = 1.
-	 */
-
-	/*
-	 * Mask the uppermost physical address bit, which would be reserved as
-	 * long as the supported physical address width is less than 52.
-	 */
-	mask = 1ull << 51;
-
-	/* Set the present bit. */
-	mask |= 1ull;
-
-	/*
-	 * If reserved bit is not supported, clear the present bit to disable
-	 * mmio page fault.
-	 */
-	if (maxphyaddr == 52)
-		mask &= ~1ull;
-
-	kvm_mmu_set_mmio_spte_mask(mask, mask);
-}
-
 #ifdef CONFIG_X86_64
 static void pvclock_gtod_update_fn(struct work_struct *work)
 {
@@ -6881,8 +6852,6 @@ int kvm_arch_init(void *opaque)
 	if (r)
 		goto out_free_percpu;
 
-	kvm_set_mmio_spte_mask();
-
 	kvm_x86_ops = ops;
 
 	kvm_mmu_set_mask_ptes(PT_USER_MASK, PT_ACCESSED_MASK,
arch/x86/purgatory/Makefile +4 -1
index b81b5172cf99..2cfa0caef133 100644
@@ -15,7 +15,10 @@ $(obj)/sha256.o: $(srctree)/lib/sha256.c FORCE
 LDFLAGS_purgatory.ro := -e purgatory_start -r --no-undefined -nostdlib -z nodefaultlib
 targets += purgatory.ro
 
+# Sanitizer, etc. runtimes are unavailable and cannot be linked here.
+GCOV_PROFILE	:= n
 KASAN_SANITIZE	:= n
+UBSAN_SANITIZE	:= n
 KCOV_INSTRUMENT := n
 
 # These are adjustments to the compiler flags used for objects that
@@ -23,7 +26,7 @@ KCOV_INSTRUMENT := n
 
 PURGATORY_CFLAGS_REMOVE := -mcmodel=kernel
 PURGATORY_CFLAGS := -mcmodel=large -ffreestanding -fno-zero-initialized-in-bss
-PURGATORY_CFLAGS += $(DISABLE_STACKLEAK_PLUGIN)
+PURGATORY_CFLAGS += $(DISABLE_STACKLEAK_PLUGIN) -DDISABLE_BRANCH_PROFILING
 
 # Default KBUILD_CFLAGS can have -pg option set when FTRACE is enabled. That
 # in turn leaves some undefined symbols like __fentry__ in purgatory and not
crypto/algboss.c +0 -2
index 5e6df2a087fa..445da4a0618f 100644
@@ -193,8 +193,6 @@ static int cryptomgr_schedule_probe(struct crypto_larval *larval)
 	if (IS_ERR(thread))
 		goto err_put_larval;
 
-	wait_for_completion_interruptible(&larval->completion);
-
 	return NOTIFY_STOP;
 
 err_put_larval:
crypto/algif_skcipher.c +1 -5
index cfdaab2b7d76..1380a208b8ca 100644
@@ -78,14 +78,10 @@ static int _skcipher_recvmsg(struct socket *sock, struct msghdr *msg,
 		return PTR_ERR(areq);
 
 	/* convert iovecs of output buffers into RX SGL */
-	err = af_alg_get_rsgl(sk, msg, flags, areq, -1, &len);
+	err = af_alg_get_rsgl(sk, msg, flags, areq, ctx->used, &len);
 	if (err)
 		goto free;
 
-	/* Process only as much RX buffers for which we have TX data */
-	if (len > ctx->used)
-		len = ctx->used;
-
 	/*
 	 * If more buffers are to be expected to be processed, process only
 	 * full block size buffers.
drivers/ata/libata-core.c +5 -6
index 75d582ca917f..6b372fa58382 100644
@@ -57,7 +57,6 @@
 #include <linux/workqueue.h>
 #include <linux/scatterlist.h>
 #include <linux/io.h>
-#include <linux/async.h>
 #include <linux/log2.h>
 #include <linux/slab.h>
 #include <linux/glob.h>
@@ -6610,7 +6609,7 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
 	/* perform each probe asynchronously */
 	for (i = 0; i < host->n_ports; i++) {
 		struct ata_port *ap = host->ports[i];
-		async_schedule(async_port_probe, ap);
+		ap->cookie = async_schedule(async_port_probe, ap);
 	}
 
 	return 0;
@@ -6750,11 +6749,11 @@ void ata_host_detach(struct ata_host *host)
 {
 	int i;
 
-	/* Ensure ata_port probe has completed */
-	async_synchronize_full();
-
-	for (i = 0; i < host->n_ports; i++)
+	for (i = 0; i < host->n_ports; i++) {
+		/* Ensure ata_port probe has completed */
+		async_synchronize_cookie(host->ports[i]->cookie + 1);
 		ata_port_detach(host->ports[i]);
+	}
 
 	/* the host is dead now, dissociate ACPI */
 	ata_acpi_dissociate(host);
drivers/base/platform.c +2 -0
index d1f901b58f75..349c2754eed7 100644
@@ -700,6 +700,8 @@ int __init_or_module __platform_driver_probe(struct platform_driver *drv,
 	/* temporary section violation during probe() */
 	drv->probe = probe;
 	retval = code = __platform_driver_register(drv, module);
+	if (retval)
+		return retval;
 
 	/*
 	 * Fixup that section violation, being paranoid about code scanning
drivers/block/ps3disk.c +0 -1
index afe1508d82c6..bd1c66f5631a 100644
@@ -466,7 +466,6 @@ static int ps3disk_probe(struct ps3_system_bus_device *_dev)
 	queue->queuedata = dev;
 
 	blk_queue_max_hw_sectors(queue, dev->bounce_size >> 9);
-	blk_queue_segment_boundary(queue, -1UL);
 	blk_queue_dma_alignment(queue, dev->blk_size-1);
 	blk_queue_logical_block_size(queue, dev->blk_size);
 
drivers/char/ipmi/ipmi_msghandler.c +4 -3
index 69734b1df792..cb85516e1eb3 100644
@@ -30,6 +30,7 @@
 #include <linux/workqueue.h>
 #include <linux/uuid.h>
 #include <linux/nospec.h>
+#include <linux/vmalloc.h>
 
 #define PFX "IPMI message handler: "
 
@@ -1089,7 +1090,7 @@ static void free_user_work(struct work_struct *work)
 					      remove_work);
 
 	cleanup_srcu_struct(&user->release_barrier);
-	kfree(user);
+	vfree(user);
 }
 
 int ipmi_create_user(unsigned int          if_num,
@@ -1121,7 +1122,7 @@ int ipmi_create_user(unsigned int          if_num,
 	if (rv)
 		return rv;
 
-	new_user = kmalloc(sizeof(*new_user), GFP_KERNEL);
+	new_user = vzalloc(sizeof(*new_user));
 	if (!new_user)
 		return -ENOMEM;
 
@@ -1170,7 +1171,7 @@ int ipmi_create_user(unsigned int          if_num,
 
 out_kfree:
 	srcu_read_unlock(&ipmi_interfaces_srcu, index);
-	kfree(new_user);
+	vfree(new_user);
 	return rv;
 }
 EXPORT_SYMBOL(ipmi_create_user);
drivers/clk/bcm/clk-bcm2835.c +5 -5
index 7bef0666ae7e..1c093fb35ebe 100644
@@ -1447,13 +1447,13 @@ static struct clk_hw *bcm2835_register_clock(struct bcm2835_cprman *cprman,
 	return &clock->hw;
 }
 
-static struct clk *bcm2835_register_gate(struct bcm2835_cprman *cprman,
+static struct clk_hw *bcm2835_register_gate(struct bcm2835_cprman *cprman,
 					 const struct bcm2835_gate_data *data)
 {
-	return clk_register_gate(cprman->dev, data->name, data->parent,
-				 CLK_IGNORE_UNUSED | CLK_SET_RATE_GATE,
-				 cprman->regs + data->ctl_reg,
-				 CM_GATE_BIT, 0, &cprman->regs_lock);
+	return clk_hw_register_gate(cprman->dev, data->name, data->parent,
+				    CLK_IGNORE_UNUSED | CLK_SET_RATE_GATE,
+				    cprman->regs + data->ctl_reg,
+				    CM_GATE_BIT, 0, &cprman->regs_lock);
 }
 
 typedef struct clk_hw *(*bcm2835_clk_register)(struct bcm2835_cprman *cprman,
drivers/clk/qcom/gcc-msm8916.c +4 -4
index ac2b0aa1e8b5..03e0ade7a6f3 100644
@@ -268,7 +268,7 @@ static struct clk_pll gpll0 = {
 	.l_reg = 0x21004,
 	.m_reg = 0x21008,
 	.n_reg = 0x2100c,
-	.config_reg = 0x21014,
+	.config_reg = 0x21010,
 	.mode_reg = 0x21000,
 	.status_reg = 0x2101c,
 	.status_bit = 17,
@@ -295,7 +295,7 @@ static struct clk_pll gpll1 = {
 	.l_reg = 0x20004,
 	.m_reg = 0x20008,
 	.n_reg = 0x2000c,
-	.config_reg = 0x20014,
+	.config_reg = 0x20010,
 	.mode_reg = 0x20000,
 	.status_reg = 0x2001c,
 	.status_bit = 17,
@@ -322,7 +322,7 @@ static struct clk_pll gpll2 = {
 	.l_reg = 0x4a004,
 	.m_reg = 0x4a008,
 	.n_reg = 0x4a00c,
-	.config_reg = 0x4a014,
+	.config_reg = 0x4a010,
 	.mode_reg = 0x4a000,
 	.status_reg = 0x4a01c,
 	.status_bit = 17,
@@ -349,7 +349,7 @@ static struct clk_pll bimc_pll = {
 	.l_reg = 0x23004,
 	.m_reg = 0x23008,
 	.n_reg = 0x2300c,
-	.config_reg = 0x23014,
+	.config_reg = 0x23010,
 	.mode_reg = 0x23000,
 	.status_reg = 0x2301c,
 	.status_bit = 17,
drivers/clk/samsung/clk-exynos5420.c +9 -7
index 6473af8903c5..662bb441f139 100644
@@ -597,7 +597,7 @@ static const struct samsung_div_clock exynos5800_div_clks[] __initconst = {
 
 static const struct samsung_gate_clock exynos5800_gate_clks[] __initconst = {
 	GATE(CLK_ACLK550_CAM, "aclk550_cam", "mout_user_aclk550_cam",
-				GATE_BUS_TOP, 24, 0, 0),
+				GATE_BUS_TOP, 24, CLK_IS_CRITICAL, 0),
 	GATE(CLK_ACLK432_SCALER, "aclk432_scaler", "mout_user_aclk432_scaler",
 				GATE_BUS_TOP, 27, CLK_IS_CRITICAL, 0),
 	GATE(CLK_MAU_EPLL, "mau_epll", "mout_user_mau_epll",
@@ -984,25 +984,25 @@ static const struct samsung_gate_clock exynos5x_gate_clks[] __initconst = {
 	GATE(0, "aclk300_jpeg", "mout_user_aclk300_jpeg",
 			GATE_BUS_TOP, 4, CLK_IGNORE_UNUSED, 0),
 	GATE(0, "aclk333_432_isp0", "mout_user_aclk333_432_isp0",
-			GATE_BUS_TOP, 5, 0, 0),
+			GATE_BUS_TOP, 5, CLK_IS_CRITICAL, 0),
 	GATE(0, "aclk300_gscl", "mout_user_aclk300_gscl",
 			GATE_BUS_TOP, 6, CLK_IS_CRITICAL, 0),
 	GATE(0, "aclk333_432_gscl", "mout_user_aclk333_432_gscl",
 			GATE_BUS_TOP, 7, CLK_IGNORE_UNUSED, 0),
 	GATE(0, "aclk333_432_isp", "mout_user_aclk333_432_isp",
-			GATE_BUS_TOP, 8, 0, 0),
+			GATE_BUS_TOP, 8, CLK_IS_CRITICAL, 0),
 	GATE(CLK_PCLK66_GPIO, "pclk66_gpio", "mout_user_pclk66_gpio",
 			GATE_BUS_TOP, 9, CLK_IGNORE_UNUSED, 0),
 	GATE(0, "aclk66_psgen", "mout_user_aclk66_psgen",
 			GATE_BUS_TOP, 10, CLK_IGNORE_UNUSED, 0),
 	GATE(0, "aclk266_isp", "mout_user_aclk266_isp",
-			GATE_BUS_TOP, 13, 0, 0),
+			GATE_BUS_TOP, 13, CLK_IS_CRITICAL, 0),
 	GATE(0, "aclk166", "mout_user_aclk166",
 			GATE_BUS_TOP, 14, CLK_IGNORE_UNUSED, 0),
 	GATE(CLK_ACLK333, "aclk333", "mout_user_aclk333",
 			GATE_BUS_TOP, 15, CLK_IS_CRITICAL, 0),
 	GATE(0, "aclk400_isp", "mout_user_aclk400_isp",
-			GATE_BUS_TOP, 16, 0, 0),
+			GATE_BUS_TOP, 16, CLK_IS_CRITICAL, 0),
 	GATE(0, "aclk400_mscl", "mout_user_aclk400_mscl",
 			GATE_BUS_TOP, 17, CLK_IS_CRITICAL, 0),
 	GATE(0, "aclk200_disp1", "mout_user_aclk200_disp1",
@@ -1208,8 +1208,10 @@ static const struct samsung_gate_clock exynos5x_gate_clks[] __initconst = {
 			GATE_IP_GSCL1, 3, 0, 0),
 	GATE(CLK_SMMU_FIMCL1, "smmu_fimcl1", "dout_gscl_blk_333",
 			GATE_IP_GSCL1, 4, 0, 0),
-	GATE(CLK_GSCL_WA, "gscl_wa", "sclk_gscl_wa", GATE_IP_GSCL1, 12, 0, 0),
-	GATE(CLK_GSCL_WB, "gscl_wb", "sclk_gscl_wb", GATE_IP_GSCL1, 13, 0, 0),
+	GATE(CLK_GSCL_WA, "gscl_wa", "sclk_gscl_wa", GATE_IP_GSCL1, 12,
+			CLK_IS_CRITICAL, 0),
+	GATE(CLK_GSCL_WB, "gscl_wb", "sclk_gscl_wb", GATE_IP_GSCL1, 13,
+			CLK_IS_CRITICAL, 0),
 	GATE(CLK_SMMU_FIMCL3, "smmu_fimcl3,", "dout_gscl_blk_333",
 			GATE_IP_GSCL1, 16, 0, 0),
 	GATE(CLK_FIMC_LITE3, "fimc_lite3", "aclk333_432_gscl",
drivers/clk/samsung/clk-exynos5433.c +2 -1
index 302596dc79a2..0f2a9d767eef 100644
@@ -1680,7 +1680,8 @@ static const struct samsung_gate_clock peric_gate_clks[] __initconst = {
 	GATE(CLK_SCLK_PCM1, "sclk_pcm1", "sclk_pcm1_peric",
 			ENABLE_SCLK_PERIC, 7, CLK_SET_RATE_PARENT, 0),
 	GATE(CLK_SCLK_I2S1, "sclk_i2s1", "sclk_i2s1_peric",
-			ENABLE_SCLK_PERIC, 6, CLK_SET_RATE_PARENT, 0),
+			ENABLE_SCLK_PERIC, 6,
+			CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
 	GATE(CLK_SCLK_SPI2, "sclk_spi2", "sclk_spi2_peric", ENABLE_SCLK_PERIC,
 			5, CLK_SET_RATE_PARENT, 0),
 	GATE(CLK_SCLK_SPI1, "sclk_spi1", "sclk_spi1_peric", ENABLE_SCLK_PERIC,
drivers/clk/sprd/pll.c +1 -1
index 640270f51aa5..eb8862752c2b 100644
@@ -105,7 +105,7 @@ static unsigned long _sprd_pll_recalc_rate(const struct sprd_pll *pll,
 
 	cfg = kcalloc(regs_num, sizeof(*cfg), GFP_KERNEL);
 	if (!cfg)
-		return -ENOMEM;
+		return parent_rate;
 
 	for (i = 0; i < regs_num; i++)
 		cfg[i] = sprd_pll_read(pll, i);
drivers/clk/st/clk-flexgen.c +1 -0
index 918ba3164da9..cd856210db58 100644
@@ -373,6 +373,7 @@ static void __init st_of_flexgen_setup(struct device_node *np)
 			break;
 		}
 
+		flex_flags &= ~CLK_IS_CRITICAL;
 		of_clk_detect_critical(np, i, &flex_flags);
 
 		/*
drivers/clk/sunxi/clk-sunxi.c +1 -1
index 004b411b640b..2bd035d48816 100644
@@ -98,7 +98,7 @@ static void sun6i_a31_get_pll1_factors(struct factors_request *req)
 	 * Round down the frequency to the closest multiple of either
 	 * 6 or 16
 	 */
-	u32 round_freq_6 = round_down(freq_mhz, 6);
+	u32 round_freq_6 = rounddown(freq_mhz, 6);
 	u32 round_freq_16 = round_down(freq_mhz, 16);
 
 	if (round_freq_6 > round_freq_16)
drivers/clk/ti/composite.c +1 -0
index 030e8b2c1050..c6478d0b996b 100644
@@ -196,6 +196,7 @@ static void __init _register_composite(void *user,
 		if (!cclk->comp_clks[i])
 			continue;
 		list_del(&cclk->comp_clks[i]->link);
+		kfree(cclk->comp_clks[i]->parent_names);
 		kfree(cclk->comp_clks[i]);
 	}
 
drivers/crypto/omap-sham.c +31 -33

130 lines not on this page · raw message

drivers/extcon/extcon-adc-jack.c +1 -2
index 18026354c332..b1fb38b7f270 100644
@@ -128,7 +128,7 @@ static int adc_jack_probe(struct platform_device *pdev)
 	for (i = 0; data->adc_conditions[i].id != EXTCON_NONE; i++);
 	data->num_conditions = i;
 
-	data->chan = iio_channel_get(&pdev->dev, pdata->consumer_channel);
+	data->chan = devm_iio_channel_get(&pdev->dev, pdata->consumer_channel);
 	if (IS_ERR(data->chan))
 		return PTR_ERR(data->chan);
 
@@ -170,7 +170,6 @@ static int adc_jack_remove(struct platform_device *pdev)
 
 	free_irq(data->irq, data);
 	cancel_work_sync(&data->handler.work);
-	iio_channel_release(data->chan);
 
 	return 0;
 }
drivers/firmware/qcom_scm.c +3 -6
index 98c987188835..513908a0c262 100644
@@ -18,7 +18,6 @@
 #include <linux/init.h>
 #include <linux/cpumask.h>
 #include <linux/export.h>
-#include <linux/dma-direct.h>
 #include <linux/dma-mapping.h>
 #include <linux/module.h>
 #include <linux/types.h>
@@ -449,8 +448,7 @@ int qcom_scm_assign_mem(phys_addr_t mem_addr, size_t mem_sz,
 	struct qcom_scm_mem_map_info *mem_to_map;
 	phys_addr_t mem_to_map_phys;
 	phys_addr_t dest_phys;
-	phys_addr_t ptr_phys;
-	dma_addr_t ptr_dma;
+	dma_addr_t ptr_phys;
 	size_t mem_to_map_sz;
 	size_t dest_sz;
 	size_t src_sz;
@@ -468,10 +466,9 @@ int qcom_scm_assign_mem(phys_addr_t mem_addr, size_t mem_sz,
 	ptr_sz = ALIGN(src_sz, SZ_64) + ALIGN(mem_to_map_sz, SZ_64) +
 			ALIGN(dest_sz, SZ_64);
 
-	ptr = dma_alloc_coherent(__scm->dev, ptr_sz, &ptr_dma, GFP_KERNEL);
+	ptr = dma_alloc_coherent(__scm->dev, ptr_sz, &ptr_phys, GFP_KERNEL);
 	if (!ptr)
 		return -ENOMEM;
-	ptr_phys = dma_to_phys(__scm->dev, ptr_dma);
 
 	/* Fill source vmid detail */
 	src = ptr;
@@ -501,7 +498,7 @@ int qcom_scm_assign_mem(phys_addr_t mem_addr, size_t mem_sz,
 
 	ret = __qcom_scm_assign_mem(__scm->dev, mem_to_map_phys, mem_to_map_sz,
 				    ptr_phys, src_sz, dest_phys, dest_sz);
-	dma_free_coherent(__scm->dev, ptr_sz, ptr, ptr_dma);
+	dma_free_coherent(__scm->dev, ptr_sz, ptr, ptr_phys);
 	if (ret) {
 		dev_err(__scm->dev,
 			"Assign memory protection call failed %d.\n", ret);
drivers/fpga/dfl-afu-dma-region.c +2 -2
index c9a613dc9eb7..e056965ef97b 100644
@@ -106,10 +106,10 @@ static int afu_dma_pin_pages(struct dfl_feature_platform_data *pdata,
 				     region->pages);
 	if (pinned < 0) {
 		ret = pinned;
-		goto put_pages;
+		goto free_pages;
 	} else if (pinned != npages) {
 		ret = -EFAULT;
-		goto free_pages;
+		goto put_pages;
 	}
 
 	dev_dbg(dev, "%d pages pinned\n", pinned);
drivers/gpio/gpio-dwapb.c +22 -12
index 044888fd96a1..2a56efced798 100644
@@ -51,7 +51,9 @@
 #define GPIO_EXT_PORTC		0x58
 #define GPIO_EXT_PORTD		0x5c
 
+#define DWAPB_DRIVER_NAME	"gpio-dwapb"
 #define DWAPB_MAX_PORTS		4
+
 #define GPIO_EXT_PORT_STRIDE	0x04 /* register stride 32 bits */
 #define GPIO_SWPORT_DR_STRIDE	0x0c /* register stride 3*32 bits */
 #define GPIO_SWPORT_DDR_STRIDE	0x0c /* register stride 3*32 bits */
@@ -400,7 +402,7 @@ static void dwapb_configure_irqs(struct dwapb_gpio *gpio,
 		return;
 
 	err = irq_alloc_domain_generic_chips(gpio->domain, ngpio, 2,
-					     "gpio-dwapb", handle_level_irq,
+					     DWAPB_DRIVER_NAME, handle_level_irq,
 					     IRQ_NOREQUEST, 0,
 					     IRQ_GC_INIT_NESTED_LOCK);
 	if (err) {
@@ -457,7 +459,7 @@ static void dwapb_configure_irqs(struct dwapb_gpio *gpio,
 		 */
 		err = devm_request_irq(gpio->dev, pp->irq[0],
 				       dwapb_irq_handler_mfd,
-				       IRQF_SHARED, "gpio-dwapb-mfd", gpio);
+				       IRQF_SHARED, DWAPB_DRIVER_NAME, gpio);
 		if (err) {
 			dev_err(gpio->dev, "error requesting IRQ\n");
 			irq_domain_remove(gpio->domain);
@@ -535,26 +537,33 @@ static int dwapb_gpio_add_port(struct dwapb_gpio *gpio,
 		dwapb_configure_irqs(gpio, port, pp);
 
 	err = gpiochip_add_data(&port->gc, port);
-	if (err)
+	if (err) {
 		dev_err(gpio->dev, "failed to register gpiochip for port%d\n",
 			port->idx);
-	else
-		port->is_registered = true;
+		return err;
+	}
 
 	/* Add GPIO-signaled ACPI event support */
-	if (pp->has_irq)
-		acpi_gpiochip_request_interrupts(&port->gc);
+	acpi_gpiochip_request_interrupts(&port->gc);
 
-	return err;
+	port->is_registered = true;
+
+	return 0;
 }
 
 static void dwapb_gpio_unregister(struct dwapb_gpio *gpio)
 {
 	unsigned int m;
 
-	for (m = 0; m < gpio->nr_ports; ++m)
-		if (gpio->ports[m].is_registered)
-			gpiochip_remove(&gpio->ports[m].gc);
+	for (m = 0; m < gpio->nr_ports; ++m) {
+		struct dwapb_gpio_port *port = &gpio->ports[m];
+
+		if (!port->is_registered)
+			continue;
+
+		acpi_gpiochip_free_interrupts(&port->gc);
+		gpiochip_remove(&port->gc);
+	}
 }
 
 static struct dwapb_platform_data *
@@ -842,7 +851,7 @@ static SIMPLE_DEV_PM_OPS(dwapb_gpio_pm_ops, dwapb_gpio_suspend,
 
 static struct platform_driver dwapb_gpio_driver = {
 	.driver		= {
-		.name	= "gpio-dwapb",
+		.name	= DWAPB_DRIVER_NAME,
 		.pm	= &dwapb_gpio_pm_ops,
 		.of_match_table = of_match_ptr(dwapb_of_match),
 		.acpi_match_table = ACPI_PTR(dwapb_acpi_match),
@@ -856,3 +865,4 @@ module_platform_driver(dwapb_gpio_driver);
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Jamie Iles");
 MODULE_DESCRIPTION("Synopsys DesignWare APB GPIO driver");
+MODULE_ALIAS("platform:" DWAPB_DRIVER_NAME);
drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c +1 -1
index 924788772b07..083aa71487e8 100644
@@ -238,7 +238,7 @@ static void ci_initialize_power_tune_defaults(struct pp_hwmgr *hwmgr)
 
 	switch (dev_id) {
 	case 0x67BA:
-	case 0x66B1:
+	case 0x67B1:
 		smu_data->power_tune_defaults = &defaults_hawaii_pro;
 		break;
 	case 0x67B8:
drivers/gpu/drm/drm_dp_mst_topology.c +33 -25

78 lines not on this page · raw message

drivers/gpu/drm/drm_encoder_slave.c +3 -2
index cf804389f5ec..d50a7884e69e 100644
@@ -84,7 +84,7 @@ int drm_i2c_encoder_init(struct drm_device *dev,
 
 	err = encoder_drv->encoder_init(client, dev, encoder);
 	if (err)
-		goto fail_unregister;
+		goto fail_module_put;
 
 	if (info->platform_data)
 		encoder->slave_funcs->set_config(&encoder->base,
@@ -92,9 +92,10 @@ int drm_i2c_encoder_init(struct drm_device *dev,
 
 	return 0;
 
+fail_module_put:
+	module_put(module);
 fail_unregister:
 	i2c_unregister_device(client);
-	module_put(module);
 fail:
 	return err;
 }
drivers/gpu/drm/i915/i915_cmd_parser.c +4 -0
index e4b9eb1f6b60..f6b81f3256cf 100644
@@ -570,6 +570,9 @@ struct drm_i915_reg_descriptor {
 #define REG32(_reg, ...) \
 	{ .addr = (_reg), __VA_ARGS__ }
 
+#define REG32_IDX(_reg, idx) \
+	{ .addr = _reg(idx) }
+
 /*
  * Convenience macro for adding 64-bit registers.
  *
@@ -667,6 +670,7 @@ static const struct drm_i915_reg_descriptor gen9_blt_regs[] = {
 	REG64_IDX(RING_TIMESTAMP, BSD_RING_BASE),
 	REG32(BCS_SWCTRL),
 	REG64_IDX(RING_TIMESTAMP, BLT_RING_BASE),
+	REG32_IDX(RING_CTX_TIMESTAMP, BLT_RING_BASE),
 	REG64_IDX(BCS_GPR, 0),
 	REG64_IDX(BCS_GPR, 1),
 	REG64_IDX(BCS_GPR, 2),
drivers/gpu/drm/i915/i915_irq.c +1 -0
index 29877969310d..b7c398232136 100644
@@ -3821,6 +3821,7 @@ static void gen11_hpd_irq_setup(struct drm_i915_private *dev_priv)
 
 	val = I915_READ(GEN11_DE_HPD_IMR);
 	val &= ~hotplug_irqs;
+	val |= ~enabled_irqs & hotplug_irqs;
 	I915_WRITE(GEN11_DE_HPD_IMR, val);
 	POSTING_READ(GEN11_DE_HPD_IMR);
 
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +2 -1
index bddd625ab91b..25691b7cece1 100644
@@ -1021,7 +1021,8 @@ static int mdp5_init(struct platform_device *pdev, struct drm_device *dev)
 
 	return 0;
 fail:
-	mdp5_destroy(pdev);
+	if (mdp5_kms)
+		mdp5_destroy(pdev);
 	return ret;
 }
 
drivers/gpu/drm/qxl/qxl_kms.c +1 -1
index 771250aed78d..2412d317d992 100644
@@ -181,7 +181,7 @@ int qxl_device_init(struct qxl_device *qdev,
 				&(qdev->ram_header->cursor_ring_hdr),
 				sizeof(struct qxl_command),
 				QXL_CURSOR_RING_SIZE,
-				qdev->io_base + QXL_IO_NOTIFY_CMD,
+				qdev->io_base + QXL_IO_NOTIFY_CURSOR,
 				false,
 				&qdev->cursor_event);
 
drivers/gpu/drm/sun4i/sun4i_hdmi.h +1 -1
index b685ee11623d..a13e14dd7746 100644
@@ -152,7 +152,7 @@
 #define SUN4I_HDMI_DDC_CMD_IMPLICIT_WRITE	3
 
 #define SUN4I_HDMI_DDC_CLK_REG		0x528
-#define SUN4I_HDMI_DDC_CLK_M(m)			(((m) & 0x7) << 3)
+#define SUN4I_HDMI_DDC_CLK_M(m)			(((m) & 0xf) << 3)
 #define SUN4I_HDMI_DDC_CLK_N(n)			((n) & 0x7)
 
 #define SUN4I_HDMI_DDC_LINE_CTRL_REG	0x540
drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c +1 -1
index e826da34e919..14b6762567fb 100644
@@ -37,7 +37,7 @@ static unsigned long sun4i_ddc_calc_divider(unsigned long rate,
 	unsigned long best_rate = 0;
 	u8 best_m = 0, best_n = 0, _m, _n;
 
-	for (_m = 0; _m < 8; _m++) {
+	for (_m = 0; _m < 16; _m++) {
 		for (_n = 0; _n < 8; _n++) {
 			unsigned long tmp_rate;
 
drivers/hid/hid-ids.h +3 -0
index c1fed1aaecdf..f8026c71e2e4 100644
@@ -1121,6 +1121,9 @@
 #define USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN_8882	0x8882
 #define USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN_8883	0x8883
 
+#define USB_VENDOR_ID_TRUST             0x145f
+#define USB_DEVICE_ID_TRUST_PANORA_TABLET   0x0212
+
 #define USB_VENDOR_ID_TURBOX		0x062a
 #define USB_DEVICE_ID_TURBOX_KEYBOARD	0x0201
 #define USB_DEVICE_ID_ASUS_MD_5110	0x5110
drivers/hid/hid-quirks.c +1 -0
index e5beee3e8582..f4bab7004aff 100644
@@ -168,6 +168,7 @@ static const struct hid_device_id hid_quirks[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_TOUCHPACK, USB_DEVICE_ID_TOUCHPACK_RTS), HID_QUIRK_MULTI_INPUT },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_TPV, USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN_8882), HID_QUIRK_NOGET },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_TPV, USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN_8883), HID_QUIRK_NOGET },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_TRUST, USB_DEVICE_ID_TRUST_PANORA_TABLET), HID_QUIRK_MULTI_INPUT | HID_QUIRK_HIDINPUT_FORCE },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_KEYBOARD), HID_QUIRK_NOGET },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_KNA5), HID_QUIRK_MULTI_INPUT },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_TWA60), HID_QUIRK_MULTI_INPUT },
drivers/i2c/busses/i2c-piix4.c +2 -1
index 9ff3371ec385..f1c79f9b3919 100644
@@ -958,7 +958,8 @@ static int piix4_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	}
 
 	if (dev->vendor == PCI_VENDOR_ID_AMD &&
-	    dev->device == PCI_DEVICE_ID_AMD_HUDSON2_SMBUS) {
+	    (dev->device == PCI_DEVICE_ID_AMD_HUDSON2_SMBUS ||
+	     dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS)) {
 		retval = piix4_setup_sb800(dev, id, 1);
 	}
 
drivers/i2c/busses/i2c-pxa.c +5 -8
index fbf91d383b40..c10ae4778d35 100644
@@ -315,11 +315,10 @@ static void i2c_pxa_scream_blue_murder(struct pxa_i2c *i2c, const char *why)
 	dev_err(dev, "IBMR: %08x IDBR: %08x ICR: %08x ISR: %08x\n",
 		readl(_IBMR(i2c)), readl(_IDBR(i2c)), readl(_ICR(i2c)),
 		readl(_ISR(i2c)));
-	dev_dbg(dev, "log: ");
+	dev_err(dev, "log:");
 	for (i = 0; i < i2c->irqlogidx; i++)
-		pr_debug("[%08x:%08x] ", i2c->isrlog[i], i2c->icrlog[i]);
-
-	pr_debug("\n");
+		pr_cont(" [%03x:%05x]", i2c->isrlog[i], i2c->icrlog[i]);
+	pr_cont("\n");
 }
 
 #else /* ifdef DEBUG */
@@ -709,11 +708,9 @@ static inline void i2c_pxa_stop_message(struct pxa_i2c *i2c)
 {
 	u32 icr;
 
-	/*
-	 * Clear the STOP and ACK flags
-	 */
+	/* Clear the START, STOP, ACK, TB and MA flags */
 	icr = readl(_ICR(i2c));
-	icr &= ~(ICR_STOP | ICR_ACKNAK);
+	icr &= ~(ICR_START | ICR_STOP | ICR_ACKNAK | ICR_TB | ICR_MA);
 	writel(icr, _ICR(i2c));
 }
 
drivers/iio/pressure/bmp280-core.c +6 -1
index fe87d27779d9..074f6f865008 100644
@@ -261,6 +261,8 @@ static u32 bmp280_compensate_humidity(struct bmp280_data *data,
 		+ (s32)2097152) * calib->H2 + 8192) >> 14);
 	var -= ((((var >> 15) * (var >> 15)) >> 7) * (s32)calib->H1) >> 4;
 
+	var = clamp_val(var, 0, 419430400);
+
 	return var >> 12;
 };
 
@@ -703,7 +705,7 @@ static int bmp180_measure(struct bmp280_data *data, u8 ctrl_meas)
 	unsigned int ctrl;
 
 	if (data->use_eoc)
-		init_completion(&data->done);
+		reinit_completion(&data->done);
 
 	ret = regmap_write(data->regmap, BMP280_REG_CTRL_MEAS, ctrl_meas);
 	if (ret)
@@ -959,6 +961,9 @@ static int bmp085_fetch_eoc_irq(struct device *dev,
 			"trying to enforce it\n");
 		irq_trig = IRQF_TRIGGER_RISING;
 	}
+
+	init_completion(&data->done);
+
 	ret = devm_request_threaded_irq(dev,
 			irq,
 			bmp085_eoc_irq,
drivers/infiniband/core/cma_configfs.c +13 -0
index eee38b40be99..ce183d054785 100644
@@ -319,8 +319,21 @@ static struct config_group *make_cma_dev(struct config_group *group,
 	return ERR_PTR(err);
 }
 
+static void drop_cma_dev(struct config_group *cgroup, struct config_item *item)
+{
+	struct config_group *group =
+		container_of(item, struct config_group, cg_item);
+	struct cma_dev_group *cma_dev_group =
+		container_of(group, struct cma_dev_group, device_group);
+
+	configfs_remove_default_groups(&cma_dev_group->ports_group);
+	configfs_remove_default_groups(&cma_dev_group->device_group);
+	config_item_put(item);
+}
+
 static struct configfs_group_operations cma_subsys_group_ops = {
 	.make_group	= make_cma_dev,
+	.drop_item	= drop_cma_dev,
 };
 
 static const struct config_item_type cma_subsys_type = {
drivers/infiniband/hw/cxgb4/device.c +1 -0
index c13c0ba30f63..af974a257086 100644
@@ -945,6 +945,7 @@ void c4iw_dealloc(struct uld_ctx *ctx)
 static void c4iw_remove(struct uld_ctx *ctx)
 {
 	pr_debug("c4iw_dev %p\n", ctx->dev);
+	debugfs_remove_recursive(ctx->dev->debugfs_root);
 	c4iw_unregister_device(ctx->dev);
 	c4iw_dealloc(ctx);
 }
drivers/infiniband/hw/mlx5/devx.c +1 -0
index 02f36ab72ad4..4c90a007e09d 100644
@@ -328,6 +328,7 @@ static bool devx_is_obj_modify_cmd(const void *in)
 	case MLX5_CMD_OP_SET_L2_TABLE_ENTRY:
 	case MLX5_CMD_OP_RST2INIT_QP:
 	case MLX5_CMD_OP_INIT2RTR_QP:
+	case MLX5_CMD_OP_INIT2INIT_QP:
 	case MLX5_CMD_OP_RTR2RTS_QP:
 	case MLX5_CMD_OP_RTS2RTS_QP:
 	case MLX5_CMD_OP_SQERR2RTS_QP:
drivers/md/bcache/btree.c +6 -2
index bb40bd66a10e..38a8f8d2a908 100644
@@ -1432,7 +1432,7 @@ static int btree_gc_coalesce(struct btree *b, struct btree_op *op,
 			if (__set_blocks(n1, n1->keys + n2->keys,
 					 block_bytes(b->c)) >
 			    btree_blocks(new_nodes[i]))
-				goto out_nocoalesce;
+				goto out_unlock_nocoalesce;
 
 			keys = n2->keys;
 			/* Take the key of the node we're getting rid of */
@@ -1461,7 +1461,7 @@ static int btree_gc_coalesce(struct btree *b, struct btree_op *op,
 
 		if (__bch_keylist_realloc(&keylist,
 					  bkey_u64s(&new_nodes[i]->key)))
-			goto out_nocoalesce;
+			goto out_unlock_nocoalesce;
 
 		bch_btree_node_write(new_nodes[i], &cl);
 		bch_keylist_add(&keylist, &new_nodes[i]->key);
@@ -1507,6 +1507,10 @@ static int btree_gc_coalesce(struct btree *b, struct btree_op *op,
 	/* Invalidated our iterator */
 	return -EINTR;
 
+out_unlock_nocoalesce:
+	for (i = 0; i < nodes; i++)
+		mutex_unlock(&new_nodes[i]->write_lock);
+
 out_nocoalesce:
 	closure_sync(&cl);
 	bch_keylist_free(&keylist);
drivers/md/dm-mpath.c +1 -1
index 207ca0ad0b59..c1ad84f3414c 100644
@@ -1868,7 +1868,7 @@ static int multipath_prepare_ioctl(struct dm_target *ti,
 	int r;
 
 	current_pgpath = READ_ONCE(m->current_pgpath);
-	if (!current_pgpath)
+	if (!current_pgpath || !test_bit(MPATHF_QUEUE_IO, &m->flags))
 		current_pgpath = choose_pgpath(m, 0);
 
 	if (current_pgpath) {
drivers/md/dm-zoned-metadata.c +2 -2
index 53eb21343b11..5c2bbdf67f25 100644
@@ -1580,7 +1580,7 @@ static struct dm_zone *dmz_get_rnd_zone_for_reclaim(struct dmz_metadata *zmd)
 			return dzone;
 	}
 
-	return ERR_PTR(-EBUSY);
+	return NULL;
 }
 
 /*
@@ -1600,7 +1600,7 @@ static struct dm_zone *dmz_get_seq_zone_for_reclaim(struct dmz_metadata *zmd)
 			return zone;
 	}
 
-	return ERR_PTR(-EBUSY);
+	return NULL;
 }
 
 /*
drivers/md/dm-zoned-reclaim.c +2 -2
index 84ac671acd2e..879848aad97a 100644
@@ -348,8 +348,8 @@ static int dmz_do_reclaim(struct dmz_reclaim *zrc)
 
 	/* Get a data zone */
 	dzone = dmz_get_zone_for_reclaim(zmd);
-	if (IS_ERR(dzone))
-		return PTR_ERR(dzone);
+	if (!dzone)
+		return -EBUSY;
 
 	start = jiffies;
 
drivers/md/md.c +13 -0
index a6db4fd267aa..a4e7e6c025d9 100644
@@ -1182,6 +1182,8 @@ static int super_90_validate(struct mddev *mddev, struct md_rdev *rdev)
 			mddev->new_layout = mddev->layout;
 			mddev->new_chunk_sectors = mddev->chunk_sectors;
 		}
+		if (mddev->level == 0)
+			mddev->layout = -1;
 
 		if (sb->state & (1<<MD_SB_CLEAN))
 			mddev->recovery_cp = MaxSector;
@@ -1598,6 +1600,10 @@ static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_
 		rdev->ppl.sector = rdev->sb_start + rdev->ppl.offset;
 	}
 
+	if ((le32_to_cpu(sb->feature_map) & MD_FEATURE_RAID0_LAYOUT) &&
+	    sb->level != 0)
+		return -EINVAL;
+
 	if (!refdev) {
 		ret = 1;
 	} else {
@@ -1708,6 +1714,10 @@ static int super_1_validate(struct mddev *mddev, struct md_rdev *rdev)
 			mddev->new_chunk_sectors = mddev->chunk_sectors;
 		}
 
+		if (mddev->level == 0 &&
+		    !(le32_to_cpu(sb->feature_map) & MD_FEATURE_RAID0_LAYOUT))
+			mddev->layout = -1;
+
 		if (le32_to_cpu(sb->feature_map) & MD_FEATURE_JOURNAL)
 			set_bit(MD_HAS_JOURNAL, &mddev->flags);
 
@@ -6784,6 +6794,9 @@ static int set_array_info(struct mddev *mddev, mdu_array_info_t *info)
 	mddev->external	     = 0;
 
 	mddev->layout        = info->layout;
+	if (mddev->level == 0)
+		/* Cannot trust RAID0 layout info here */
+		mddev->layout = -1;
 	mddev->chunk_sectors = info->chunk_size >> 9;
 
 	if (mddev->persistent) {
drivers/md/raid0.c +3 -0
index efa9df2336da..0272102b207e 100644
@@ -152,6 +152,9 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf)
 
 	if (conf->nr_strip_zones == 1) {
 		conf->layout = RAID0_ORIG_LAYOUT;
+	} else if (mddev->layout == RAID0_ORIG_LAYOUT ||
+		   mddev->layout == RAID0_ALT_MULTIZONE_LAYOUT) {
+		conf->layout = mddev->layout;
 	} else if (default_layout == RAID0_ORIG_LAYOUT ||
 		   default_layout == RAID0_ALT_MULTIZONE_LAYOUT) {
 		conf->layout = default_layout;
drivers/mfd/wm8994-core.c +1 -0
index 22bd6525e09c..933a50049d72 100644
@@ -704,3 +704,4 @@ module_i2c_driver(wm8994_i2c_driver);
 MODULE_DESCRIPTION("Core support for the WM8994 audio CODEC");
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Mark Brown <[email protected]>");
+MODULE_SOFTDEP("pre: wm8994_regulator");
drivers/mtd/nand/raw/ams-delta.c +2 -2
index 37a3cc21c7bc..acf7971e815d 100644
@@ -235,7 +235,7 @@ static int ams_delta_init(struct platform_device *pdev)
 		goto out_gpio;
 
 	/* Scan to find existence of the device */
-	err = nand_scan(ams_delta_mtd, 1);
+	err = nand_scan(this, 1);
 	if (err)
 		goto out_mtd;
 
@@ -264,7 +264,7 @@ static int ams_delta_cleanup(struct platform_device *pdev)
 	void __iomem *io_base = platform_get_drvdata(pdev);
 
 	/* Release resources, unregister device */
-	nand_release(ams_delta_mtd);
+	nand_release(mtd_to_nand(ams_delta_mtd));
 
 	gpio_free_array(_mandatory_gpio, ARRAY_SIZE(_mandatory_gpio));
 	gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB);
drivers/mtd/nand/raw/atmel/nand-controller.c +1 -1
index ea022712edee..ee1c401f131f 100644
@@ -1694,7 +1694,7 @@ atmel_nand_controller_add_nand(struct atmel_nand_controller *nc,
 
 	nc->caps->ops->nand_init(nc, nand);
 
-	ret = nand_scan(mtd, nand->numcs);
+	ret = nand_scan(chip, nand->numcs);
 	if (ret) {
 		dev_err(nc->dev, "NAND scan failed: %d\n", ret);
 		return ret;
drivers/mtd/nand/raw/au1550nd.c +2 -2
index 35f5c84cd331..b45fb36537e7 100644
@@ -466,7 +466,7 @@ static int au1550nd_probe(struct platform_device *pdev)
 	this->write_buf = (pd->devwidth) ? au_write_buf16 : au_write_buf;
 	this->read_buf = (pd->devwidth) ? au_read_buf16 : au_read_buf;
 
-	ret = nand_scan(mtd, 1);
+	ret = nand_scan(this, 1);
 	if (ret) {
 		dev_err(&pdev->dev, "NAND scan failed with %d\n", ret);
 		goto out3;
@@ -492,7 +492,7 @@ static int au1550nd_remove(struct platform_device *pdev)
 	struct au1550nd_ctx *ctx = platform_get_drvdata(pdev);
 	struct resource *r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 
-	nand_release(nand_to_mtd(&ctx->chip));
+	nand_release(&ctx->chip);
 	iounmap(ctx->base);
 	release_mem_region(r->start, 0x1000);
 	kfree(ctx);
drivers/mtd/nand/raw/bcm47xxnflash/main.c +1 -1
index fb31429b70a9..d79694160845 100644
@@ -65,7 +65,7 @@ static int bcm47xxnflash_remove(struct platform_device *pdev)
 {
 	struct bcm47xxnflash *nflash = platform_get_drvdata(pdev);
 
-	nand_release(nand_to_mtd(&nflash->nand_chip));
+	nand_release(&nflash->nand_chip);
 
 	return 0;
 }
drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c +1 -1
index 60874de430eb..9b62bc2d25a0 100644
@@ -423,7 +423,7 @@ int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n)
 			(w4 << 24 | w3 << 18 | w2 << 12 | w1 << 6 | w0));
 
 	/* Scan NAND */
-	err = nand_scan(nand_to_mtd(&b47n->nand_chip), 1);
+	err = nand_scan(&b47n->nand_chip, 1);
 	if (err) {
 		pr_err("Could not scan NAND flash: %d\n", err);
 		goto exit;
drivers/mtd/nand/raw/brcmnand/brcmnand.c +2 -2
index 8002a2a390e5..bd20f4521036 100644
@@ -2304,7 +2304,7 @@ static int brcmnand_init_cs(struct brcmnand_host *host, struct device_node *dn)
 	nand_writereg(ctrl, cfg_offs,
 		      nand_readreg(ctrl, cfg_offs) & ~CFG_BUS_WIDTH);
 
-	ret = nand_scan(mtd, 1);
+	ret = nand_scan(chip, 1);
 	if (ret)
 		return ret;
 
@@ -2619,7 +2619,7 @@ int brcmnand_remove(struct platform_device *pdev)
 	struct brcmnand_host *host;
 
 	list_for_each_entry(host, &ctrl->host_list, node)
-		nand_release(nand_to_mtd(&host->chip));
+		nand_release(&host->chip);
 
 	clk_disable_unprepare(ctrl->clk);
 
drivers/mtd/nand/raw/cafe_nand.c +2 -2
index 1dbe43adcfe7..3304594177c6 100644
@@ -783,7 +783,7 @@ static int cafe_nand_probe(struct pci_dev *pdev,
 
 	/* Scan to find existence of the device */
 	cafe->nand.dummy_controller.ops = &cafe_nand_controller_ops;
-	err = nand_scan(mtd, 2);
+	err = nand_scan(&cafe->nand, 2);
 	if (err)
 		goto out_irq;
 
@@ -819,7 +819,7 @@ static void cafe_nand_remove(struct pci_dev *pdev)
 	/* Disable NAND IRQ in global IRQ mask register */
 	cafe_writel(cafe, ~1 & cafe_readl(cafe, GLOBAL_IRQ_MASK), GLOBAL_IRQ_MASK);
 	free_irq(pdev->irq, mtd);
-	nand_release(mtd);
+	nand_release(chip);
 	free_rs(cafe->rs);
 	pci_iounmap(pdev, cafe->mmio);
 	dma_free_coherent(&cafe->pdev->dev, 2112, cafe->dmabuf, cafe->dmaaddr);
drivers/mtd/nand/raw/cmx270_nand.c +2 -2
index b66e254b6802..2eb933a8f99e 100644
@@ -193,7 +193,7 @@ static int __init cmx270_init(void)
 	this->write_buf = cmx270_write_buf;
 
 	/* Scan to find existence of the device */
-	ret = nand_scan(cmx270_nand_mtd, 1);
+	ret = nand_scan(this, 1);
 	if (ret) {
 		pr_notice("No NAND device\n");
 		goto err_scan;
@@ -228,7 +228,7 @@ module_init(cmx270_init);
 static void __exit cmx270_cleanup(void)
 {
 	/* Release resources, unregister device */
-	nand_release(cmx270_nand_mtd);
+	nand_release(mtd_to_nand(cmx270_nand_mtd));
 
 	gpio_free(GPIO_NAND_RB);
 	gpio_free(GPIO_NAND_CS);
drivers/mtd/nand/raw/cs553x_nand.c +2 -2
index beafad62e7d5..d4be416bb2fa 100644
@@ -241,7 +241,7 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr)
 	}
 
 	/* Scan to find existence of the device */
-	err = nand_scan(new_mtd, 1);
+	err = nand_scan(this, 1);
 	if (err)
 		goto out_free;
 
@@ -336,7 +336,7 @@ static void __exit cs553x_cleanup(void)
 		mmio_base = this->IO_ADDR_R;
 
 		/* Release resources, unregister device */
-		nand_release(mtd);
+		nand_release(this);
 		kfree(mtd->name);
 		cs553x_mtd[i] = NULL;
 
drivers/mtd/nand/raw/davinci_nand.c +2 -2
index 40145e206a6b..66d3d5966013 100644
@@ -807,7 +807,7 @@ static int nand_davinci_probe(struct platform_device *pdev)
 
 	/* Scan to find existence of the device(s) */
 	info->chip.dummy_controller.ops = &davinci_nand_controller_ops;
-	ret = nand_scan(mtd, pdata->mask_chipsel ? 2 : 1);
+	ret = nand_scan(&info->chip, pdata->mask_chipsel ? 2 : 1);
 	if (ret < 0) {
 		dev_dbg(&pdev->dev, "no NAND chip(s) found\n");
 		return ret;
@@ -841,7 +841,7 @@ static int nand_davinci_remove(struct platform_device *pdev)
 		ecc4_busy = false;
 	spin_unlock_irq(&davinci_nand_lock);
 
-	nand_release(nand_to_mtd(&info->chip));
+	nand_release(&info->chip);
 
 	return 0;
 }
drivers/mtd/nand/raw/denali.c +2 -4
index 2242e999a76b..277e84aa6166 100644
@@ -1384,7 +1384,7 @@ int denali_init(struct denali_nand_info *denali)
 		chip->setup_data_interface = denali_setup_data_interface;
 
 	chip->dummy_controller.ops = &denali_controller_ops;
-	ret = nand_scan(mtd, denali->max_banks);
+	ret = nand_scan(chip, denali->max_banks);
 	if (ret)
 		goto disable_irq;
 
@@ -1407,9 +1407,7 @@ EXPORT_SYMBOL(denali_init);
 
 void denali_remove(struct denali_nand_info *denali)
 {
-	struct mtd_info *mtd = nand_to_mtd(&denali->nand);
-
-	nand_release(mtd);
+	nand_release(&denali->nand);
 	denali_disable_irq(denali);
 }
 EXPORT_SYMBOL(denali_remove);
drivers/mtd/nand/raw/diskonchip.c +4 -7
index 3c46188dd6d2..ac3792b6fb33 100644
@@ -1620,14 +1620,11 @@ static int __init doc_probe(unsigned long physadr)
 	else
 		numchips = doc2001_init(mtd);
 
-	if ((ret = nand_scan(mtd, numchips)) || (ret = doc->late_init(mtd))) {
-		/* DBB note: i believe nand_release is necessary here, as
+	if ((ret = nand_scan(nand, numchips)) || (ret = doc->late_init(mtd))) {
+		/* DBB note: i believe nand_cleanup is necessary here, as
 		   buffers may have been allocated in nand_base.  Check with
 		   Thomas. FIX ME! */
-		/* nand_release will call mtd_device_unregister, but we
-		   haven't yet added it.  This is handled without incident by
-		   mtd_device_unregister, as far as I can tell. */
-		nand_release(mtd);
+		nand_cleanup(nand);
 		goto fail;
 	}
 
@@ -1662,7 +1659,7 @@ static void release_nanddoc(void)
 		doc = nand_get_controller_data(nand);
 
 		nextmtd = doc->nextdoc;
-		nand_release(mtd);
+		nand_release(nand);
 		iounmap(doc->virtadr);
 		release_mem_region(doc->physadr, DOC_IOREMAP_LEN);
 		free_rs(doc->rs_decoder);
drivers/mtd/nand/raw/docg4.c +2 -2
index 427fcbc1b71c..2d86bc5a886d 100644
@@ -1391,7 +1391,7 @@ static int __init probe_docg4(struct platform_device *pdev)
 	 * ->attach_chip callback.
 	 */
 	nand->dummy_controller.ops = &docg4_controller_ops;
-	retval = nand_scan(mtd, 0);
+	retval = nand_scan(nand, 0);
 	if (retval)
 		goto free_nand;
 
@@ -1420,7 +1420,7 @@ static int __init probe_docg4(struct platform_device *pdev)
 static int __exit cleanup_docg4(struct platform_device *pdev)
 {
 	struct docg4_priv *doc = platform_get_drvdata(pdev);
-	nand_release(doc->mtd);
+	nand_release(mtd_to_nand(doc->mtd));
 	kfree(mtd_to_nand(doc->mtd));
 	iounmap(doc->virtadr);
 	return 0;
drivers/mtd/nand/raw/fsl_elbc_nand.c +2 -3
index 55f449b711fd..22bcd64a66c8 100644
@@ -915,7 +915,7 @@ static int fsl_elbc_nand_probe(struct platform_device *pdev)
 		goto err;
 
 	priv->chip.controller->ops = &fsl_elbc_controller_ops;
-	ret = nand_scan(mtd, 1);
+	ret = nand_scan(&priv->chip, 1);
 	if (ret)
 		goto err;
 
@@ -942,9 +942,8 @@ static int fsl_elbc_nand_remove(struct platform_device *pdev)
 {
 	struct fsl_elbc_fcm_ctrl *elbc_fcm_ctrl = fsl_lbc_ctrl_dev->nand;
 	struct fsl_elbc_mtd *priv = dev_get_drvdata(&pdev->dev);
-	struct mtd_info *mtd = nand_to_mtd(&priv->chip);
 
-	nand_release(mtd);
+	nand_release(&priv->chip);
 	fsl_elbc_chip_remove(priv);
 
 	mutex_lock(&fsl_elbc_nand_mutex);
drivers/mtd/nand/raw/fsl_ifc_nand.c +2 -3
index 7e7729df7827..70bf8e1552a5 100644
@@ -1079,7 +1079,7 @@ static int fsl_ifc_nand_probe(struct platform_device *dev)
 		goto err;
 
 	priv->chip.controller->ops = &fsl_ifc_controller_ops;
-	ret = nand_scan(mtd, 1);
+	ret = nand_scan(&priv->chip, 1);
 	if (ret)
 		goto err;
 
@@ -1105,9 +1105,8 @@ static int fsl_ifc_nand_probe(struct platform_device *dev)
 static int fsl_ifc_nand_remove(struct platform_device *dev)
 {
 	struct fsl_ifc_mtd *priv = dev_get_drvdata(&dev->dev);
-	struct mtd_info *mtd = nand_to_mtd(&priv->chip);
 
-	nand_release(mtd);
+	nand_release(&priv->chip);
 	fsl_ifc_chip_remove(priv);
 
 	mutex_lock(&fsl_ifc_nand_mutex);
drivers/mtd/nand/raw/fsl_upm.c +2 -2
index a88e2cf66e0f..2763fd3ad512 100644
@@ -191,7 +191,7 @@ static int fun_chip_init(struct fsl_upm_nand *fun,
 		goto err;
 	}
 
-	ret = nand_scan(mtd, fun->mchip_count);
+	ret = nand_scan(&fun->chip, fun->mchip_count);
 	if (ret)
 		goto err;
 
@@ -326,7 +326,7 @@ static int fun_remove(struct platform_device *ofdev)
 	struct mtd_info *mtd = nand_to_mtd(&fun->chip);
 	int i;
 
-	nand_release(mtd);
+	nand_release(&fun->chip);
 	kfree(mtd->name);
 
 	for (i = 0; i < fun->mchip_count; i++) {
drivers/mtd/nand/raw/fsmc_nand.c +2 -2
index f418236fa020..25d354e9448e 100644
@@ -1125,7 +1125,7 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
 	 * Scan to find existence of the device
 	 */
 	nand->dummy_controller.ops = &fsmc_nand_controller_ops;
-	ret = nand_scan(mtd, 1);
+	ret = nand_scan(nand, 1);
 	if (ret)
 		goto release_dma_write_chan;
 
@@ -1161,7 +1161,7 @@ static int fsmc_nand_remove(struct platform_device *pdev)
 	struct fsmc_nand_data *host = platform_get_drvdata(pdev);
 
 	if (host) {
-		nand_release(nand_to_mtd(&host->nand));
+		nand_release(&host->nand);
 
 		if (host->mode == USE_DMA_ACCESS) {
 			dma_release_channel(host->write_dma_chan);
drivers/mtd/nand/raw/gpio.c +2 -2
index 2780af26d9ab..0e7d00faf33c 100644
@@ -194,7 +194,7 @@ static int gpio_nand_remove(struct platform_device *pdev)
 {
 	struct gpiomtd *gpiomtd = platform_get_drvdata(pdev);
 
-	nand_release(nand_to_mtd(&gpiomtd->nand_chip));
+	nand_release(&gpiomtd->nand_chip);
 
 	/* Enable write protection and disable the chip */
 	if (gpiomtd->nwp && !IS_ERR(gpiomtd->nwp))
@@ -289,7 +289,7 @@ static int gpio_nand_probe(struct platform_device *pdev)
 	if (gpiomtd->nwp && !IS_ERR(gpiomtd->nwp))
 		gpiod_direction_output(gpiomtd->nwp, 1);
 
-	ret = nand_scan(mtd, 1);
+	ret = nand_scan(chip, 1);
 	if (ret)
 		goto err_wp;
 
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +2 -2
index 1c1ebbc82824..fe99d9323d4a 100644
@@ -1934,7 +1934,7 @@ static int gpmi_nand_init(struct gpmi_nand_data *this)
 		goto err_out;
 
 	chip->dummy_controller.ops = &gpmi_nand_controller_ops;
-	ret = nand_scan(mtd, GPMI_IS_MX6(this) ? 2 : 1);
+	ret = nand_scan(chip, GPMI_IS_MX6(this) ? 2 : 1);
 	if (ret)
 		goto err_out;
 
@@ -2026,7 +2026,7 @@ static int gpmi_nand_remove(struct platform_device *pdev)
 {
 	struct gpmi_nand_data *this = platform_get_drvdata(pdev);
 
-	nand_release(nand_to_mtd(&this->nand));
+	nand_release(&this->nand);
 	gpmi_free_dma_buffer(this);
 	release_resources(this);
 	return 0;
drivers/mtd/nand/raw/hisi504_nand.c +2 -3
index 950dc7789296..6833fc82e6b1 100644
@@ -811,7 +811,7 @@ static int hisi_nfc_probe(struct platform_device *pdev)
 	}
 
 	chip->dummy_controller.ops = &hisi_nfc_controller_ops;
-	ret = nand_scan(mtd, max_chips);
+	ret = nand_scan(chip, max_chips);
 	if (ret)
 		return ret;
 
@@ -828,9 +828,8 @@ static int hisi_nfc_probe(struct platform_device *pdev)
 static int hisi_nfc_remove(struct platform_device *pdev)
 {
 	struct hinfc_host *host = platform_get_drvdata(pdev);
-	struct mtd_info *mtd = nand_to_mtd(&host->chip);
 
-	nand_release(mtd);
+	nand_release(&host->chip);
 
 	return 0;
 }
drivers/mtd/nand/raw/jz4740_nand.c +2 -2
index a7515452bc59..27603d78b157 100644
@@ -331,7 +331,7 @@ static int jz_nand_detect_bank(struct platform_device *pdev,
 
 	if (chipnr == 0) {
 		/* Detect first chip. */
-		ret = nand_scan(mtd, 1);
+		ret = nand_scan(chip, 1);
 		if (ret)
 			goto notfound_id;
 
@@ -507,7 +507,7 @@ static int jz_nand_remove(struct platform_device *pdev)
 	struct jz_nand *nand = platform_get_drvdata(pdev);
 	size_t i;
 
-	nand_release(nand_to_mtd(&nand->chip));
+	nand_release(&nand->chip);
 
 	/* Deassert and disable all chips */
 	writel(0, nand->base + JZ_REG_NAND_CTRL);
drivers/mtd/nand/raw/jz4780_nand.c +3 -3
index db4fa60bd52a..b072bd5dd7a0 100644
@@ -286,13 +286,13 @@ static int jz4780_nand_init_chip(struct platform_device *pdev,
 	nand_set_flash_node(chip, np);
 
 	chip->controller->ops = &jz4780_nand_controller_ops;
-	ret = nand_scan(mtd, 1);
+	ret = nand_scan(chip, 1);
 	if (ret)
 		return ret;
 
 	ret = mtd_device_register(mtd, NULL, 0);
 	if (ret) {
-		nand_release(mtd);
+		nand_release(chip);
 		return ret;
 	}
 
@@ -307,7 +307,7 @@ static void jz4780_nand_cleanup_chips(struct jz4780_nand_controller *nfc)
 
 	while (!list_empty(&nfc->chips)) {
 		chip = list_first_entry(&nfc->chips, struct jz4780_nand_chip, chip_list);
-		nand_release(nand_to_mtd(&chip->chip));
+		nand_release(&chip->chip);
 		list_del(&chip->chip_list);
 	}
 }
drivers/mtd/nand/raw/lpc32xx_mlc.c +2 -3
index e82abada130a..d240b8ff40ca 100644
@@ -802,7 +802,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
 	 * SMALL block or LARGE block.
 	 */
 	nand_chip->dummy_controller.ops = &lpc32xx_nand_controller_ops;
-	res = nand_scan(mtd, 1);
+	res = nand_scan(nand_chip, 1);
 	if (res)
 		goto free_irq;
 
@@ -839,9 +839,8 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
 static int lpc32xx_nand_remove(struct platform_device *pdev)
 {
 	struct lpc32xx_nand_host *host = platform_get_drvdata(pdev);
-	struct mtd_info *mtd = nand_to_mtd(&host->nand_chip);
 
-	nand_release(mtd);
+	nand_release(&host->nand_chip);
 	free_irq(host->irq, host);
 	if (use_dma)
 		dma_release_channel(host->dma_chan);
drivers/mtd/nand/raw/lpc32xx_slc.c +2 -3
index a4e8b7e75135..607e4bdfae03 100644
@@ -925,7 +925,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
 
 	/* Find NAND device */
 	chip->dummy_controller.ops = &lpc32xx_nand_controller_ops;
-	res = nand_scan(mtd, 1);
+	res = nand_scan(chip, 1);
 	if (res)
 		goto release_dma;
 
@@ -956,9 +956,8 @@ static int lpc32xx_nand_remove(struct platform_device *pdev)
 {
 	uint32_t tmp;
 	struct lpc32xx_nand_host *host = platform_get_drvdata(pdev);
-	struct mtd_info *mtd = nand_to_mtd(&host->nand_chip);
 
-	nand_release(mtd);
+	nand_release(&host->nand_chip);
 	dma_release_channel(host->dma_chan);
 
 	/* Force CE high */
drivers/mtd/nand/raw/marvell_nand.c +3 -3
index 7a84a8f05b46..3e542224dd11 100644
@@ -2551,7 +2551,7 @@ static int marvell_nand_chip_init(struct device *dev, struct marvell_nfc *nfc,
 
 	chip->options |= NAND_BUSWIDTH_AUTO;
 
-	ret = nand_scan(mtd, marvell_nand->nsels);
+	ret = nand_scan(chip, marvell_nand->nsels);
 	if (ret) {
 		dev_err(dev, "could not scan the nand chip\n");
 		return ret;
@@ -2564,7 +2564,7 @@ static int marvell_nand_chip_init(struct device *dev, struct marvell_nfc *nfc,
 		ret = mtd_device_register(mtd, NULL, 0);
 	if (ret) {
 		dev_err(dev, "failed to register mtd device: %d\n", ret);
-		nand_release(mtd);
+		nand_release(chip);
 		return ret;
 	}
 
@@ -2619,7 +2619,7 @@ static void marvell_nand_chips_cleanup(struct marvell_nfc *nfc)
 	struct marvell_nand_chip *entry, *temp;
 
 	list_for_each_entry_safe(entry, temp, &nfc->chips, node) {
-		nand_release(nand_to_mtd(&entry->chip));
+		nand_release(&entry->chip);
 		list_del(&entry->node);
 	}
 }
drivers/mtd/nand/raw/mpc5121_nfc.c +2 -2
index 6d1740d54e0d..b3d6effb3486 100644
@@ -778,7 +778,7 @@ static int mpc5121_nfc_probe(struct platform_device *op)
 	}
 
 	/* Detect NAND chips */
-	retval = nand_scan(mtd, be32_to_cpup(chips_no));
+	retval = nand_scan(chip, be32_to_cpup(chips_no));
 	if (retval) {
 		dev_err(dev, "NAND Flash not found !\n");
 		goto error;
@@ -828,7 +828,7 @@ static int mpc5121_nfc_remove(struct platform_device *op)
 	struct device *dev = &op->dev;
 	struct mtd_info *mtd = dev_get_drvdata(dev);
 
-	nand_release(mtd);
+	nand_release(mtd_to_nand(mtd));
 	mpc5121_nfc_free(dev, mtd);
 
 	return 0;
drivers/mtd/nand/raw/mtk_nand.c +3 -3
index ab5a8778c4b2..bb40022e109f 100644
@@ -1382,14 +1382,14 @@ static int mtk_nfc_nand_chip_init(struct device *dev, struct mtk_nfc *nfc,
 
 	mtk_nfc_hw_init(nfc);
 
-	ret = nand_scan(mtd, nsels);
+	ret = nand_scan(nand, nsels);
 	if (ret)
 		return ret;
 
 	ret = mtd_device_register(mtd, NULL, 0);
 	if (ret) {
 		dev_err(dev, "mtd parse partition error\n");
-		nand_release(mtd);
+		nand_cleanup(nand);
 		return ret;
 	}
 
@@ -1555,7 +1555,7 @@ static int mtk_nfc_remove(struct platform_device *pdev)
 	while (!list_empty(&nfc->chips)) {
 		chip = list_first_entry(&nfc->chips, struct mtk_nfc_nand_chip,
 					node);
-		nand_release(nand_to_mtd(&chip->nand));
+		nand_release(&chip->nand);
 		list_del(&chip->node);
 	}
 
drivers/mtd/nand/raw/mxc_nand.c +2 -2
index 4c9214dea424..334578d9f4a8 100644
@@ -1900,7 +1900,7 @@ static int mxcnd_probe(struct platform_device *pdev)
 
 	/* Scan the NAND device */
 	this->dummy_controller.ops = &mxcnd_controller_ops;
-	err = nand_scan(mtd, is_imx25_nfc(host) ? 4 : 1);
+	err = nand_scan(this, is_imx25_nfc(host) ? 4 : 1);
 	if (err)
 		goto escan;
 
@@ -1928,7 +1928,7 @@ static int mxcnd_remove(struct platform_device *pdev)
 {
 	struct mxc_nand_host *host = platform_get_drvdata(pdev);
 
-	nand_release(nand_to_mtd(&host->nand));
+	nand_release(&host->nand);
 	if (host->clk_act)
 		clk_disable_unprepare(host->clk);
 
drivers/mtd/nand/raw/nand_base.c +14 -15
index d527e448ce19..de3926eaec13 100644
@@ -5953,7 +5953,7 @@ static int nand_dt_init(struct nand_chip *chip)
 
 /**
  * nand_scan_ident - Scan for the NAND device
- * @mtd: MTD device structure
+ * @chip: NAND chip object
  * @maxchips: number of chips to scan for
  * @table: alternative NAND ID table
  *
@@ -5965,11 +5965,11 @@ static int nand_dt_init(struct nand_chip *chip)
  * prevented dynamic allocations during this phase which was unconvenient and
  * as been banned for the benefit of the ->init_ecc()/cleanup_ecc() hooks.
  */
-static int nand_scan_ident(struct mtd_info *mtd, int maxchips,
+static int nand_scan_ident(struct nand_chip *chip, int maxchips,
 			   struct nand_flash_dev *table)
 {
+	struct mtd_info *mtd = nand_to_mtd(chip);
 	int i, nand_maf_id, nand_dev_id;
-	struct nand_chip *chip = mtd_to_nand(mtd);
 	int ret;
 
 	/* Enforce the right timings for reset/detection */
@@ -6423,15 +6423,15 @@ static bool nand_ecc_strength_good(struct mtd_info *mtd)
 
 /**
  * nand_scan_tail - Scan for the NAND device
- * @mtd: MTD device structure
+ * @chip: NAND chip object
  *
  * This is the second phase of the normal nand_scan() function. It fills out
  * all the uninitialized function pointers with the defaults and scans for a
  * bad block table if appropriate.
  */
-static int nand_scan_tail(struct mtd_info *mtd)
+static int nand_scan_tail(struct nand_chip *chip)
 {
-	struct nand_chip *chip = mtd_to_nand(mtd);
+	struct mtd_info *mtd = nand_to_mtd(chip);
 	struct nand_ecc_ctrl *ecc = &chip->ecc;
 	int ret, i;
 
@@ -6770,7 +6770,7 @@ static void nand_detach(struct nand_chip *chip)
 
 /**
  * nand_scan_with_ids - [NAND Interface] Scan for the NAND device
- * @mtd: MTD device structure
+ * @chip: NAND chip object
  * @maxchips: number of chips to scan for. @nand_scan_ident() will not be run if
  *	      this parameter is zero (useful for specific drivers that must
  *	      handle this part of the process themselves, e.g docg4).
@@ -6780,14 +6780,13 @@ static void nand_detach(struct nand_chip *chip)
  * The flash ID is read and the mtd/chip structures are filled with the
  * appropriate values.
  */
-int nand_scan_with_ids(struct mtd_info *mtd, int maxchips,
+int nand_scan_with_ids(struct nand_chip *chip, int maxchips,
 		       struct nand_flash_dev *ids)
 {
-	struct nand_chip *chip = mtd_to_nand(mtd);
 	int ret;
 
 	if (maxchips) {
-		ret = nand_scan_ident(mtd, maxchips, ids);
+		ret = nand_scan_ident(chip, maxchips, ids);
 		if (ret)
 			return ret;
 	}
@@ -6796,7 +6795,7 @@ int nand_scan_with_ids(struct mtd_info *mtd, int maxchips,
 	if (ret)
 		goto cleanup_ident;
 
-	ret = nand_scan_tail(mtd);
+	ret = nand_scan_tail(chip);
 	if (ret)
 		goto detach_chip;
 
@@ -6847,12 +6846,12 @@ EXPORT_SYMBOL_GPL(nand_cleanup);
 /**
  * nand_release - [NAND Interface] Unregister the MTD device and free resources
  *		  held by the NAND device
- * @mtd: MTD device structure
+ * @chip: NAND chip object
  */
-void nand_release(struct mtd_info *mtd)
+void nand_release(struct nand_chip *chip)
 {
-	mtd_device_unregister(mtd);
-	nand_cleanup(mtd_to_nand(mtd));
+	mtd_device_unregister(nand_to_mtd(chip));
+	nand_cleanup(chip);
 }
 EXPORT_SYMBOL_GPL(nand_release);
 
drivers/mtd/nand/raw/nandsim.c +3 -3
index 71ac034aee9c..6e908e4fa8e8 100644
@@ -2319,7 +2319,7 @@ static int __init ns_init_module(void)
 		goto error;
 
 	chip->dummy_controller.ops = &ns_controller_ops;
-	retval = nand_scan(nsmtd, 1);
+	retval = nand_scan(chip, 1);
 	if (retval) {
 		NS_ERR("Could not scan NAND Simulator device\n");
 		goto error;
@@ -2364,7 +2364,7 @@ static int __init ns_init_module(void)
 
 err_exit:
 	free_nandsim(nand);
-	nand_release(nsmtd);
+	nand_release(chip);
 	for (i = 0;i < ARRAY_SIZE(nand->partitions); ++i)
 		kfree(nand->partitions[i].name);
 error:
@@ -2386,7 +2386,7 @@ static void __exit ns_cleanup_module(void)
 	int i;
 
 	free_nandsim(ns);    /* Free nandsim private resources */
-	nand_release(nsmtd); /* Unregister driver */
+	nand_release(chip); /* Unregister driver */
 	for (i = 0;i < ARRAY_SIZE(ns->partitions); ++i)
 		kfree(ns->partitions[i].name);
 	kfree(mtd_to_nand(nsmtd));        /* Free other structures */
drivers/mtd/nand/raw/ndfc.c +2 -2
index 540fa1a0ea24..6e96c633ac29 100644
@@ -181,7 +181,7 @@ static int ndfc_chip_init(struct ndfc_controller *ndfc,
 		goto err;
 	}
 
-	ret = nand_scan(mtd, 1);
+	ret = nand_scan(chip, 1);
 	if (ret)
 		goto err;
 
@@ -258,7 +258,7 @@ static int ndfc_remove(struct platform_device *ofdev)
 	struct ndfc_controller *ndfc = dev_get_drvdata(&ofdev->dev);
 	struct mtd_info *mtd = nand_to_mtd(&ndfc->chip);
 
-	nand_release(mtd);
+	nand_release(&ndfc->chip);
 	kfree(mtd->name);
 
 	return 0;
drivers/mtd/nand/raw/nuc900_nand.c +2 -2
index af5b32c9a791..0c675b6c0b6e 100644
@@ -270,7 +270,7 @@ static int nuc900_nand_probe(struct platform_device *pdev)
 
 	nuc900_nand_enable(nuc900_nand);
 
-	if (nand_scan(mtd, 1))
+	if (nand_scan(chip, 1))
 		return -ENXIO;
 
 	mtd_device_register(mtd, partitions, ARRAY_SIZE(partitions));
@@ -284,7 +284,7 @@ static int nuc900_nand_remove(struct platform_device *pdev)
 {
 	struct nuc900_nand *nuc900_nand = platform_get_drvdata(pdev);
 
-	nand_release(nand_to_mtd(&nuc900_nand->chip));
+	nand_release(&nuc900_nand->chip);
 	clk_disable(nuc900_nand->clk);
 
 	return 0;
drivers/mtd/nand/raw/omap2.c +2 -2
index b1683d7a7e04..7a4af5f3e3d3 100644
@@ -2254,7 +2254,7 @@ static int omap_nand_probe(struct platform_device *pdev)
 	/* scan NAND device connected to chip controller */
 	nand_chip->options |= info->devsize & NAND_BUSWIDTH_16;
 
-	err = nand_scan(mtd, 1);
+	err = nand_scan(nand_chip, 1);
 	if (err)
 		goto return_error;
 
@@ -2290,7 +2290,7 @@ static int omap_nand_remove(struct platform_device *pdev)
 	}
 	if (info->dma)
 		dma_release_channel(info->dma);
-	nand_release(mtd);
+	nand_release(nand_chip);
 	return 0;
 }
 
drivers/mtd/nand/raw/orion_nand.c +3 -4
index 52d435285a3f..caffebab6c9b 100644
@@ -174,14 +174,14 @@ static int __init orion_nand_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	ret = nand_scan(mtd, 1);
+	ret = nand_scan(nc, 1);
 	if (ret)
 		goto no_dev;
 
 	mtd->name = "orion_nand";
 	ret = mtd_device_register(mtd, board->parts, board->nr_parts);
 	if (ret) {
-		nand_release(mtd);
+		nand_cleanup(nc);
 		goto no_dev;
 	}
 
@@ -196,9 +196,8 @@ static int orion_nand_remove(struct platform_device *pdev)
 {
 	struct orion_nand_info *info = platform_get_drvdata(pdev);
 	struct nand_chip *chip = &info->chip;
-	struct mtd_info *mtd = nand_to_mtd(chip);
 
-	nand_release(mtd);
+	nand_release(chip);
 
 	clk_disable_unprepare(info->clk);
 
drivers/mtd/nand/raw/oxnas_nand.c +10 -8
index 01b00bb69c1e..d3f274b2e56d 100644
@@ -123,7 +123,7 @@ static int oxnas_nand_probe(struct platform_device *pdev)
 				    GFP_KERNEL);
 		if (!chip) {
 			err = -ENOMEM;
-			goto err_clk_unprepare;
+			goto err_release_child;
 		}
 
 		chip->controller = &oxnas->base;
@@ -142,15 +142,13 @@ static int oxnas_nand_probe(struct platform_device *pdev)
 		chip->chip_delay = 30;
 
 		/* Scan to find existence of the device */
-		err = nand_scan(mtd, 1);
+		err = nand_scan(chip, 1);
 		if (err)
-			goto err_clk_unprepare;
+			goto err_release_child;
 
 		err = mtd_device_register(mtd, NULL, 0);
-		if (err) {
-			nand_release(mtd);
-			goto err_clk_unprepare;
-		}
+		if (err)
+			goto err_cleanup_nand;
 
 		oxnas->chips[nchips] = chip;
 		++nchips;
@@ -166,6 +164,10 @@ static int oxnas_nand_probe(struct platform_device *pdev)
 
 	return 0;
 
+err_cleanup_nand:
+	nand_cleanup(chip);
+err_release_child:
+	of_node_put(nand_np);
 err_clk_unprepare:
 	clk_disable_unprepare(oxnas->clk);
 	return err;
@@ -176,7 +178,7 @@ static int oxnas_nand_remove(struct platform_device *pdev)
 	struct oxnas_nand_ctrl *oxnas = platform_get_drvdata(pdev);
 
 	if (oxnas->chips[0])
-		nand_release(nand_to_mtd(oxnas->chips[0]));
+		nand_release(oxnas->chips[0]);
 
 	clk_disable_unprepare(oxnas->clk);
 
drivers/mtd/nand/raw/pasemi_nand.c +2 -2
index d69e5bae541e..8713ea770006 100644
@@ -156,7 +156,7 @@ static int pasemi_nand_probe(struct platform_device *ofdev)
 	chip->bbt_options = NAND_BBT_USE_FLASH;
 
 	/* Scan to find existence of the device */
-	err = nand_scan(pasemi_nand_mtd, 1);
+	err = nand_scan(chip, 1);
 	if (err)
 		goto out_lpc;
 
@@ -193,7 +193,7 @@ static int pasemi_nand_remove(struct platform_device *ofdev)
 	chip = mtd_to_nand(pasemi_nand_mtd);
 
 	/* Release resources, unregister device */
-	nand_release(pasemi_nand_mtd);
+	nand_release(chip);
 
 	release_region(lpcctl, 4);
 
drivers/mtd/nand/raw/plat_nand.c +3 -3
index 222626df4b96..27365bd8675c 100644
@@ -84,7 +84,7 @@ static int plat_nand_probe(struct platform_device *pdev)
 	}
 
 	/* Scan to find existence of the device */
-	err = nand_scan(mtd, pdata->chip.nr_chips);
+	err = nand_scan(&data->chip, pdata->chip.nr_chips);
 	if (err)
 		goto out;
 
@@ -97,7 +97,7 @@ static int plat_nand_probe(struct platform_device *pdev)
 	if (!err)
 		return err;
 
-	nand_release(mtd);
+	nand_cleanup(&data->chip);
 out:
 	if (pdata->ctrl.remove)
 		pdata->ctrl.remove(pdev);
@@ -112,7 +112,7 @@ static int plat_nand_remove(struct platform_device *pdev)
 	struct plat_nand_data *data = platform_get_drvdata(pdev);
 	struct platform_nand_data *pdata = dev_get_platdata(&pdev->dev);
 
-	nand_release(nand_to_mtd(&data->chip));
+	nand_release(&data->chip);
 	if (pdata->ctrl.remove)
 		pdata->ctrl.remove(pdev);
 
drivers/mtd/nand/raw/qcom_nandc.c +2 -2
index 07d8750313fd..1f9d64aeb863 100644
@@ -2834,7 +2834,7 @@ static int qcom_nand_host_init_and_register(struct qcom_nand_controller *nandc,
 	/* set up initial status value */
 	host->status = NAND_STATUS_READY | NAND_STATUS_WP;
 
-	ret = nand_scan(mtd, 1);
+	ret = nand_scan(chip, 1);
 	if (ret)
 		return ret;
 
@@ -2999,7 +2999,7 @@ static int qcom_nandc_remove(struct platform_device *pdev)
 	struct qcom_nand_host *host;
 
 	list_for_each_entry(host, &nandc->host_list, node)
-		nand_release(nand_to_mtd(&host->chip));
+		nand_release(&host->chip);
 
 
 	qcom_nandc_unalloc(nandc);
drivers/mtd/nand/raw/r852.c +2 -2
index dcdeb0660e5e..bb74a0ac697e 100644
@@ -656,7 +656,7 @@ static int r852_register_nand_device(struct r852_device *dev)
 	dev->card_registred = 1;
 	return 0;
 error3:
-	nand_release(mtd);
+	nand_release(dev->chip);
 error1:
 	/* Force card redetect */
 	dev->card_detected = 0;
@@ -675,7 +675,7 @@ static void r852_unregister_nand_device(struct r852_device *dev)
 		return;
 
 	device_remove_file(&mtd->dev, &dev_attr_media_type);
-	nand_release(mtd);
+	nand_release(dev->chip);
 	r852_engine_disable(dev);
 	dev->card_registred = 0;
 }
drivers/mtd/nand/raw/s3c2410.c +2 -2
index c21e8892394a..cf045813c160 100644
@@ -781,7 +781,7 @@ static int s3c24xx_nand_remove(struct platform_device *pdev)
 
 		for (mtdno = 0; mtdno < info->mtd_count; mtdno++, ptr++) {
 			pr_debug("releasing mtd %d (%p)\n", mtdno, ptr);
-			nand_release(nand_to_mtd(&ptr->chip));
+			nand_release(&ptr->chip);
 		}
 	}
 
@@ -1170,7 +1170,7 @@ static int s3c24xx_nand_probe(struct platform_device *pdev)
 		mtd->dev.parent = &pdev->dev;
 		s3c2410_nand_init_chip(info, nmtd, sets);
 
-		err = nand_scan(mtd, sets ? sets->nr_chips : 1);
+		err = nand_scan(&nmtd->chip, sets ? sets->nr_chips : 1);
 		if (err)
 			goto exit_error;
 
drivers/mtd/nand/raw/sh_flctl.c +2 -2
index 1e7273263c4b..683df1a12989 100644
@@ -1203,7 +1203,7 @@ static int flctl_probe(struct platform_device *pdev)
 	flctl_setup_dma(flctl);
 
 	nand->dummy_controller.ops = &flctl_nand_controller_ops;
-	ret = nand_scan(flctl_mtd, 1);
+	ret = nand_scan(nand, 1);
 	if (ret)
 		goto err_chip;
 
@@ -1226,7 +1226,7 @@ static int flctl_remove(struct platform_device *pdev)
 	struct sh_flctl *flctl = platform_get_drvdata(pdev);
 
 	flctl_release_dma(flctl);
-	nand_release(nand_to_mtd(&flctl->chip));
+	nand_release(&flctl->chip);
 	pm_runtime_disable(&pdev->dev);
 
 	return 0;
drivers/mtd/nand/raw/sharpsl.c +3 -3
index fc171b17a39b..4544753e6a1b 100644
@@ -171,7 +171,7 @@ static int sharpsl_nand_probe(struct platform_device *pdev)
 	this->ecc.correct = nand_correct_data;
 
 	/* Scan to find existence of the device */
-	err = nand_scan(mtd, 1);
+	err = nand_scan(this, 1);
 	if (err)
 		goto err_scan;
 
@@ -187,7 +187,7 @@ static int sharpsl_nand_probe(struct platform_device *pdev)
 	return 0;
 
 err_add:
-	nand_release(mtd);
+	nand_cleanup(this);
 
 err_scan:
 	iounmap(sharpsl->io);
@@ -205,7 +205,7 @@ static int sharpsl_nand_remove(struct platform_device *pdev)
 	struct sharpsl_nand *sharpsl = platform_get_drvdata(pdev);
 
 	/* Release resources, unregister device */
-	nand_release(nand_to_mtd(&sharpsl->chip));
+	nand_release(&sharpsl->chip);
 
 	iounmap(sharpsl->io);
 
drivers/mtd/nand/raw/sm_common.c +1 -1
index 73aafe8c3ef3..02ac6e9b2d16 100644
@@ -195,7 +195,7 @@ int sm_register_device(struct mtd_info *mtd, int smartmedia)
 	/* Scan for card properties */
 	chip->dummy_controller.ops = &sm_controller_ops;
 	flash_ids = smartmedia ? nand_smartmedia_flash_ids : nand_xd_flash_ids;
-	ret = nand_scan_with_ids(mtd, 1, flash_ids);
+	ret = nand_scan_with_ids(chip, 1, flash_ids);
 	if (ret)
 		return ret;
 
drivers/mtd/nand/raw/socrates_nand.c +3 -4
index 9824a9923583..274b3521a1dc 100644
@@ -185,7 +185,7 @@ static int socrates_nand_probe(struct platform_device *ofdev)
 
 	dev_set_drvdata(&ofdev->dev, host);
 
-	res = nand_scan(mtd, 1);
+	res = nand_scan(nand_chip, 1);
 	if (res)
 		goto out;
 
@@ -193,7 +193,7 @@ static int socrates_nand_probe(struct platform_device *ofdev)
 	if (!res)
 		return res;
 
-	nand_release(mtd);
+	nand_cleanup(nand_chip);
 
 out:
 	iounmap(host->io_base);
@@ -206,9 +206,8 @@ static int socrates_nand_probe(struct platform_device *ofdev)
 static int socrates_nand_remove(struct platform_device *ofdev)
 {
 	struct socrates_nand_host *host = dev_get_drvdata(&ofdev->dev);
-	struct mtd_info *mtd = nand_to_mtd(&host->nand_chip);
 
-	nand_release(mtd);
+	nand_release(&host->nand_chip);
 
 	iounmap(host->io_base);
 
drivers/mtd/nand/raw/sunxi_nand.c +3 -3
index 5b5f4d25a3e1..5b8502fd50cb 100644
@@ -1940,14 +1940,14 @@ static int sunxi_nand_chip_init(struct device *dev, struct sunxi_nfc *nfc,
 	mtd = nand_to_mtd(nand);
 	mtd->dev.parent = dev;
 
-	ret = nand_scan(mtd, nsels);
+	ret = nand_scan(nand, nsels);
 	if (ret)
 		return ret;
 
 	ret = mtd_device_register(mtd, NULL, 0);
 	if (ret) {
 		dev_err(dev, "failed to register mtd device: %d\n", ret);
-		nand_release(mtd);
+		nand_release(nand);
 		return ret;
 	}
 
@@ -1986,7 +1986,7 @@ static void sunxi_nand_chips_cleanup(struct sunxi_nfc *nfc)
 	while (!list_empty(&nfc->chips)) {
 		chip = list_first_entry(&nfc->chips, struct sunxi_nand_chip,
 					node);
-		nand_release(nand_to_mtd(&chip->nand));
+		nand_release(&chip->nand);
 		sunxi_nand_ecc_cleanup(&chip->nand.ecc);
 		list_del(&chip->node);
 	}
drivers/mtd/nand/raw/tango_nand.c +2 -2
index 72698691727d..1061eb60ee60 100644
@@ -588,7 +588,7 @@ static int chip_init(struct device *dev, struct device_node *np)
 	mtd_set_ooblayout(mtd, &tango_nand_ooblayout_ops);
 	mtd->dev.parent = dev;
 
-	err = nand_scan(mtd, 1);
+	err = nand_scan(chip, 1);
 	if (err)
 		return err;
 
@@ -617,7 +617,7 @@ static int tango_nand_remove(struct platform_device *pdev)
 
 	for (cs = 0; cs < MAX_CS; ++cs) {
 		if (nfc->chips[cs])
-			nand_release(nand_to_mtd(&nfc->chips[cs]->nand_chip));
+			nand_release(&nfc->chips[cs]->nand_chip);
 	}
 
 	return 0;
drivers/mtd/nand/raw/tegra_nand.c +1 -1
index 79da1efc88d1..5dcee20e2a8c 100644
@@ -1119,7 +1119,7 @@ static int tegra_nand_chips_init(struct device *dev,
 	chip->select_chip = tegra_nand_select_chip;
 	chip->setup_data_interface = tegra_nand_setup_data_interface;
 
-	ret = nand_scan(mtd, 1);
+	ret = nand_scan(chip, 1);
 	if (ret)
 		return ret;
 
drivers/mtd/nand/raw/tmio_nand.c +3 -3
index dcaa924502de..2a9a966ff2b9 100644
@@ -436,7 +436,7 @@ static int tmio_probe(struct platform_device *dev)
 	nand_chip->waitfunc = tmio_nand_wait;
 
 	/* Scan to find existence of the device */
-	retval = nand_scan(mtd, 1);
+	retval = nand_scan(nand_chip, 1);
 	if (retval)
 		goto err_irq;
 
@@ -449,7 +449,7 @@ static int tmio_probe(struct platform_device *dev)
 	if (!retval)
 		return retval;
 
-	nand_release(mtd);
+	nand_cleanup(nand_chip);
 
 err_irq:
 	tmio_hw_stop(dev, tmio);
@@ -460,7 +460,7 @@ static int tmio_remove(struct platform_device *dev)
 {
 	struct tmio_nand *tmio = platform_get_drvdata(dev);
 
-	nand_release(nand_to_mtd(&tmio->chip));
+	nand_release(&tmio->chip);
 	tmio_hw_stop(dev, tmio);
 	return 0;
 }
drivers/mtd/nand/raw/txx9ndfmc.c +2 -2
index 4d61a14fcb65..f722aae2b244 100644
@@ -359,7 +359,7 @@ static int __init txx9ndfmc_probe(struct platform_device *dev)
 		if (plat->wide_mask & (1 << i))
 			chip->options |= NAND_BUSWIDTH_16;
 
-		if (nand_scan(mtd, 1)) {
+		if (nand_scan(chip, 1)) {
 			kfree(txx9_priv->mtdname);
 			kfree(txx9_priv);
 			continue;
@@ -390,7 +390,7 @@ static int __exit txx9ndfmc_remove(struct platform_device *dev)
 		chip = mtd_to_nand(mtd);
 		txx9_priv = nand_get_controller_data(chip);
 
-		nand_release(mtd);
+		nand_release(chip);
 		kfree(txx9_priv->mtdname);
 		kfree(txx9_priv);
 	}
drivers/mtd/nand/raw/vf610_nfc.c +2 -2
index 6f6dcbf9095b..a73213c835a5 100644
@@ -892,7 +892,7 @@ static int vf610_nfc_probe(struct platform_device *pdev)
 
 	/* Scan the NAND chip */
 	chip->dummy_controller.ops = &vf610_nfc_controller_ops;
-	err = nand_scan(mtd, 1);
+	err = nand_scan(chip, 1);
 	if (err)
 		goto err_disable_clk;
 
@@ -916,7 +916,7 @@ static int vf610_nfc_remove(struct platform_device *pdev)
 	struct mtd_info *mtd = platform_get_drvdata(pdev);
 	struct vf610_nfc *nfc = mtd_to_nfc(mtd);
 
-	nand_release(mtd);
+	nand_release(mtd_to_nand(mtd));
 	clk_disable_unprepare(nfc->clk);
 	return 0;
 }
drivers/mtd/nand/raw/xway_nand.c +3 -3
index 9926b4e3d69d..bfa43fdc3c54 100644
@@ -205,13 +205,13 @@ static int xway_nand_probe(struct platform_device *pdev)
 		    | cs_flag, EBU_NAND_CON);
 
 	/* Scan to find existence of the device */
-	err = nand_scan(mtd, 1);
+	err = nand_scan(&data->chip, 1);
 	if (err)
 		return err;
 
 	err = mtd_device_register(mtd, NULL, 0);
 	if (err)
-		nand_release(mtd);
+		nand_cleanup(&data->chip);
 
 	return err;
 }
@@ -223,7 +223,7 @@ static int xway_nand_remove(struct platform_device *pdev)
 {
 	struct xway_nand_data *data = platform_get_drvdata(pdev);
 
-	nand_release(nand_to_mtd(&data->chip));
+	nand_release(&data->chip);
 
 	return 0;
 }
drivers/net/ethernet/cavium/octeon/octeon_mgmt.c +5 -0
index 0957e735cdc4..cf4c92bdd9b8 100644
@@ -235,6 +235,11 @@ static void octeon_mgmt_rx_fill_ring(struct net_device *netdev)
 
 		/* Put it in the ring.  */
 		p->rx_ring[p->rx_next_fill] = re.d64;
+		/* Make sure there is no reorder of filling the ring and ringing
+		 * the bell
+		 */
+		wmb();
+
 		dma_sync_single_for_device(p->dev, p->rx_ring_handle,
 					   ring_size_to_bytes(OCTEON_MGMT_RX_RING_SIZE),
 					   DMA_BIDIRECTIONAL);
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +1 -1
index 6683409fbd4a..4b21ae27a9fd 100644
@@ -2796,7 +2796,7 @@ static int dpaa_eth_probe(struct platform_device *pdev)
 	}
 
 	/* Do this here, so we can be verbose early */
-	SET_NETDEV_DEV(net_dev, dev->parent);
+	SET_NETDEV_DEV(net_dev, dev);
 	dev_set_drvdata(dev, net_dev);
 
 	priv = netdev_priv(net_dev);
drivers/net/ethernet/intel/e1000e/netdev.c +10 -4
index 589a5296da4b..7216825e049c 100644
@@ -6308,11 +6308,17 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool runtime)
 	struct net_device *netdev = pci_get_drvdata(pdev);
 	struct e1000_adapter *adapter = netdev_priv(netdev);
 	struct e1000_hw *hw = &adapter->hw;
-	u32 ctrl, ctrl_ext, rctl, status;
-	/* Runtime suspend should only enable wakeup for link changes */
-	u32 wufc = runtime ? E1000_WUFC_LNKC : adapter->wol;
+	u32 ctrl, ctrl_ext, rctl, status, wufc;
 	int retval = 0;
 
+	/* Runtime suspend should only enable wakeup for link changes */
+	if (runtime)
+		wufc = E1000_WUFC_LNKC;
+	else if (device_may_wakeup(&pdev->dev))
+		wufc = adapter->wol;
+	else
+		wufc = 0;
+
 	status = er32(STATUS);
 	if (status & E1000_STATUS_LU)
 		wufc &= ~E1000_WUFC_LNKC;
@@ -6369,7 +6375,7 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool runtime)
 	if (adapter->hw.phy.type == e1000_phy_igp_3) {
 		e1000e_igp3_phy_powerdown_workaround_ich8lan(&adapter->hw);
 	} else if (hw->mac.type >= e1000_pch_lpt) {
-		if (!(wufc & (E1000_WUFC_EX | E1000_WUFC_MC | E1000_WUFC_BC)))
+		if (wufc && !(wufc & (E1000_WUFC_EX | E1000_WUFC_MC | E1000_WUFC_BC)))
 			/* ULP does not support wake from unicast, multicast
 			 * or broadcast.
 			 */
drivers/net/geneve.c +4 -3
index 36444de701cd..817c290b78cd 100644
@@ -911,9 +911,10 @@ static netdev_tx_t geneve_xmit(struct sk_buff *skb, struct net_device *dev)
 	if (geneve->collect_md) {
 		info = skb_tunnel_info(skb);
 		if (unlikely(!info || !(info->mode & IP_TUNNEL_INFO_TX))) {
-			err = -EINVAL;
 			netdev_dbg(dev, "no tunnel metadata\n");
-			goto tx_error;
+			dev_kfree_skb(skb);
+			dev->stats.tx_dropped++;
+			return NETDEV_TX_OK;
 		}
 	} else {
 		info = &geneve->info;
@@ -930,7 +931,7 @@ static netdev_tx_t geneve_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	if (likely(!err))
 		return NETDEV_TX_OK;
-tx_error:
+
 	dev_kfree_skb(skb);
 
 	if (err == -ELOOP)
drivers/net/hamradio/yam.c +1 -0
index ba9df430fca6..fdab49872587 100644
@@ -1148,6 +1148,7 @@ static int __init yam_init_driver(void)
 		err = register_netdev(dev);
 		if (err) {
 			printk(KERN_WARNING "yam: cannot register net device %s\n", dev->name);
+			free_netdev(dev);
 			goto error;
 		}
 		yam_devs[i] = dev;
drivers/ntb/ntb.c +2 -7
index 2581ab724c34..f8f75a504a58 100644
@@ -214,10 +214,8 @@ int ntb_default_port_number(struct ntb_dev *ntb)
 	case NTB_TOPO_B2B_DSD:
 		return NTB_PORT_SEC_DSD;
 	default:
-		break;
+		return 0;
 	}
-
-	return -EINVAL;
 }
 EXPORT_SYMBOL(ntb_default_port_number);
 
@@ -240,10 +238,8 @@ int ntb_default_peer_port_number(struct ntb_dev *ntb, int pidx)
 	case NTB_TOPO_B2B_DSD:
 		return NTB_PORT_PRI_USD;
 	default:
-		break;
+		return 0;
 	}
-
-	return -EINVAL;
 }
 EXPORT_SYMBOL(ntb_default_peer_port_number);
 
@@ -315,4 +311,3 @@ static void __exit ntb_driver_exit(void)
 	bus_unregister(&ntb_bus);
 }
 module_exit(ntb_driver_exit);
-
drivers/ntb/test/ntb_perf.c +23 -7
index 80508da3c8b5..ad5d3919435c 100644
@@ -158,6 +158,8 @@ struct perf_peer {
 	/* NTB connection setup service */
 	struct work_struct	service;
 	unsigned long		sts;
+
+	struct completion init_comp;
 };
 #define to_peer_service(__work) \
 	container_of(__work, struct perf_peer, service)
@@ -549,6 +551,7 @@ static int perf_setup_outbuf(struct perf_peer *peer)
 
 	/* Initialization is finally done */
 	set_bit(PERF_STS_DONE, &peer->sts);
+	complete_all(&peer->init_comp);
 
 	return 0;
 }
@@ -559,7 +562,7 @@ static void perf_free_inbuf(struct perf_peer *peer)
 		return;
 
 	(void)ntb_mw_clear_trans(peer->perf->ntb, peer->pidx, peer->gidx);
-	dma_free_coherent(&peer->perf->ntb->dev, peer->inbuf_size,
+	dma_free_coherent(&peer->perf->ntb->pdev->dev, peer->inbuf_size,
 			  peer->inbuf, peer->inbuf_xlat);
 	peer->inbuf = NULL;
 }
@@ -588,8 +591,9 @@ static int perf_setup_inbuf(struct perf_peer *peer)
 
 	perf_free_inbuf(peer);
 
-	peer->inbuf = dma_alloc_coherent(&perf->ntb->dev, peer->inbuf_size,
-					 &peer->inbuf_xlat, GFP_KERNEL);
+	peer->inbuf = dma_alloc_coherent(&perf->ntb->pdev->dev,
+					 peer->inbuf_size, &peer->inbuf_xlat,
+					 GFP_KERNEL);
 	if (!peer->inbuf) {
 		dev_err(&perf->ntb->dev, "Failed to alloc inbuf of %pa\n",
 			&peer->inbuf_size);
@@ -639,6 +643,7 @@ static void perf_service_work(struct work_struct *work)
 		perf_setup_outbuf(peer);
 
 	if (test_and_clear_bit(PERF_CMD_CLEAR, &peer->sts)) {
+		init_completion(&peer->init_comp);
 		clear_bit(PERF_STS_DONE, &peer->sts);
 		if (test_bit(0, &peer->perf->busy_flag) &&
 		    peer == peer->perf->test_peer) {
@@ -655,7 +660,7 @@ static int perf_init_service(struct perf_ctx *perf)
 {
 	u64 mask;
 
-	if (ntb_peer_mw_count(perf->ntb) < perf->pcnt + 1) {
+	if (ntb_peer_mw_count(perf->ntb) < perf->pcnt) {
 		dev_err(&perf->ntb->dev, "Not enough memory windows\n");
 		return -EINVAL;
 	}
@@ -1046,8 +1051,9 @@ static int perf_submit_test(struct perf_peer *peer)
 	struct perf_thread *pthr;
 	int tidx, ret;
 
-	if (!test_bit(PERF_STS_DONE, &peer->sts))
-		return -ENOLINK;
+	ret = wait_for_completion_interruptible(&peer->init_comp);
+	if (ret < 0)
+		return ret;
 
 	if (test_and_set_bit_lock(0, &perf->busy_flag))
 		return -EBUSY;
@@ -1413,10 +1419,21 @@ static int perf_init_peers(struct perf_ctx *perf)
 			peer->gidx = pidx;
 		}
 		INIT_WORK(&peer->service, perf_service_work);
+		init_completion(&peer->init_comp);
 	}
 	if (perf->gidx == -1)
 		perf->gidx = pidx;
 
+	/*
+	 * Hardware with only two ports may not have unique port
+	 * numbers. In this case, the gidxs should all be zero.
+	 */
+	if (perf->pcnt == 1 &&  ntb_port_number(perf->ntb) == 0 &&
+	    ntb_peer_port_number(perf->ntb, 0) == 0) {
+		perf->gidx = 0;
+		perf->peers[0].gidx = 0;
+	}
+
 	for (pidx = 0; pidx < perf->pcnt; pidx++) {
 		ret = perf_setup_peer_mw(&perf->peers[pidx]);
 		if (ret)
@@ -1512,4 +1529,3 @@ static void __exit perf_exit(void)
 	destroy_workqueue(perf_wq);
 }
 module_exit(perf_exit);
-
drivers/ntb/test/ntb_pingpong.c +6 -8
index 65865e460ab8..18d00eec7b02 100644
@@ -121,15 +121,14 @@ static int pp_find_next_peer(struct pp_ctx *pp)
 	link = ntb_link_is_up(pp->ntb, NULL, NULL);
 
 	/* Find next available peer */
-	if (link & pp->nmask) {
+	if (link & pp->nmask)
 		pidx = __ffs64(link & pp->nmask);
-		out_db = BIT_ULL(pidx + 1);
-	} else if (link & pp->pmask) {
+	else if (link & pp->pmask)
 		pidx = __ffs64(link & pp->pmask);
-		out_db = BIT_ULL(pidx);
-	} else {
+	else
 		return -ENODEV;
-	}
+
+	out_db = BIT_ULL(ntb_peer_port_number(pp->ntb, pidx));
 
 	spin_lock(&pp->lock);
 	pp->out_pidx = pidx;
@@ -303,7 +302,7 @@ static void pp_init_flds(struct pp_ctx *pp)
 			break;
 	}
 
-	pp->in_db = BIT_ULL(pidx);
+	pp->in_db = BIT_ULL(lport);
 	pp->pmask = GENMASK_ULL(pidx, 0) >> 1;
 	pp->nmask = GENMASK_ULL(pcnt - 1, pidx);
 
@@ -435,4 +434,3 @@ static void __exit pp_exit(void)
 	debugfs_remove_recursive(pp_dbgfs_topdir);
 }
 module_exit(pp_exit);
-
drivers/ntb/test/ntb_tool.c +4 -5
index d592c0ffbd19..311d6ab8d016 100644
@@ -504,7 +504,7 @@ static ssize_t tool_peer_link_read(struct file *filep, char __user *ubuf,
 	buf[1] = '\n';
 	buf[2] = '\0';
 
-	return simple_read_from_buffer(ubuf, size, offp, buf, 3);
+	return simple_read_from_buffer(ubuf, size, offp, buf, 2);
 }
 
 static TOOL_FOPS_RDWR(tool_peer_link_fops,
@@ -590,7 +590,7 @@ static int tool_setup_mw(struct tool_ctx *tc, int pidx, int widx,
 	inmw->size = min_t(resource_size_t, req_size, size);
 	inmw->size = round_up(inmw->size, addr_align);
 	inmw->size = round_up(inmw->size, size_align);
-	inmw->mm_base = dma_alloc_coherent(&tc->ntb->dev, inmw->size,
+	inmw->mm_base = dma_alloc_coherent(&tc->ntb->pdev->dev, inmw->size,
 					   &inmw->dma_base, GFP_KERNEL);
 	if (!inmw->mm_base)
 		return -ENOMEM;
@@ -612,7 +612,7 @@ static int tool_setup_mw(struct tool_ctx *tc, int pidx, int widx,
 	return 0;
 
 err_free_dma:
-	dma_free_coherent(&tc->ntb->dev, inmw->size, inmw->mm_base,
+	dma_free_coherent(&tc->ntb->pdev->dev, inmw->size, inmw->mm_base,
 			  inmw->dma_base);
 	inmw->mm_base = NULL;
 	inmw->dma_base = 0;
@@ -629,7 +629,7 @@ static void tool_free_mw(struct tool_ctx *tc, int pidx, int widx)
 
 	if (inmw->mm_base != NULL) {
 		ntb_mw_clear_trans(tc->ntb, pidx, widx);
-		dma_free_coherent(&tc->ntb->dev, inmw->size,
+		dma_free_coherent(&tc->ntb->pdev->dev, inmw->size,
 				  inmw->mm_base, inmw->dma_base);
 	}
 
@@ -1690,4 +1690,3 @@ static void __exit tool_exit(void)
 	debugfs_remove_recursive(tool_dbgfs_topdir);
 }
 module_exit(tool_exit);
-
drivers/of/kobj.c +1 -2
index c72eef988041..a32e60b024b8 100644
@@ -134,8 +134,6 @@ int __of_attach_node_sysfs(struct device_node *np)
 	if (!name)
 		return -ENOMEM;
 
-	of_node_get(np);
-
 	rc = kobject_add(&np->kobj, parent, "%s", name);
 	kfree(name);
 	if (rc)
@@ -144,6 +142,7 @@ int __of_attach_node_sysfs(struct device_node *np)
 	for_each_property_of_node(np, pp)
 		__of_add_property_sysfs(np, pp);
 
+	of_node_get(np);
 	return 0;
 }
 
drivers/pci/controller/dwc/pcie-designware-host.c +2 -0
index 6d4ef0101ef6..be62f654c8eb 100644
@@ -285,6 +285,8 @@ int dw_pcie_allocate_domains(struct pcie_port *pp)
 		return -ENOMEM;
 	}
 
+	irq_domain_update_bus_token(pp->irq_domain, DOMAIN_BUS_NEXUS);
+
 	pp->msi_domain = pci_msi_create_irq_domain(fwnode,
 						   &dw_pcie_msi_domain_info,
 						   pp->irq_domain);
drivers/pci/controller/pci-aardvark.c +0 -4
index 6b4555ff2548..0235b6e7dcd1 100644
@@ -321,10 +321,6 @@ static void advk_pcie_setup_hw(struct advk_pcie *pcie)
 
 	advk_pcie_wait_for_link(pcie);
 
-	reg = PCIE_CORE_LINK_L0S_ENTRY |
-		(1 << PCIE_CORE_LINK_WIDTH_SHIFT);
-	advk_writel(pcie, reg, PCIE_CORE_LINK_CTRL_STAT_REG);
-
 	reg = advk_readl(pcie, PCIE_CORE_CMD_STATUS_REG);
 	reg |= PCIE_CORE_CMD_MEM_ACCESS_EN |
 		PCIE_CORE_CMD_IO_ACCESS_EN |
drivers/pci/controller/pci-v3-semi.c +1 -1
index d219404bad92..9a86bb7448ac 100644
@@ -743,7 +743,7 @@ static int v3_pci_probe(struct platform_device *pdev)
 	int ret;
 	LIST_HEAD(res);
 
-	host = pci_alloc_host_bridge(sizeof(*v3));
+	host = devm_pci_alloc_host_bridge(dev, sizeof(*v3));
 	if (!host)
 		return -ENOMEM;
 
drivers/pci/controller/pcie-rcar.c +5 -4
index 333ab6092f17..00296c5eacb9 100644
@@ -335,11 +335,12 @@ static struct pci_ops rcar_pcie_ops = {
 };
 
 static void rcar_pcie_setup_window(int win, struct rcar_pcie *pcie,
-				   struct resource *res)
+				   struct resource_entry *window)
 {
 	/* Setup PCIe address space mappings for each resource */
 	resource_size_t size;
 	resource_size_t res_start;
+	struct resource *res = window->res;
 	u32 mask;
 
 	rcar_pci_write_reg(pcie, 0x00000000, PCIEPTCTLR(win));
@@ -353,9 +354,9 @@ static void rcar_pcie_setup_window(int win, struct rcar_pcie *pcie,
 	rcar_pci_write_reg(pcie, mask << 7, PCIEPAMR(win));
 
 	if (res->flags & IORESOURCE_IO)
-		res_start = pci_pio_to_address(res->start);
+		res_start = pci_pio_to_address(res->start) - window->offset;
 	else
-		res_start = res->start;
+		res_start = res->start - window->offset;
 
 	rcar_pci_write_reg(pcie, upper_32_bits(res_start), PCIEPAUR(win));
 	rcar_pci_write_reg(pcie, lower_32_bits(res_start) & ~0x7F,
@@ -384,7 +385,7 @@ static int rcar_pcie_setup(struct list_head *resource, struct rcar_pcie *pci)
 		switch (resource_type(res)) {
 		case IORESOURCE_IO:
 		case IORESOURCE_MEM:
-			rcar_pcie_setup_window(i, pci, res);
+			rcar_pcie_setup_window(i, pci, win);
 			i++;
 			break;
 		case IORESOURCE_BUS:
drivers/pci/controller/vmd.c +4 -2
index b52885020c85..c3ac7f094a39 100644
@@ -617,9 +617,11 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features)
 			if (!membar2)
 				return -ENOMEM;
 			offset[0] = vmd->dev->resource[VMD_MEMBAR1].start -
-					readq(membar2 + MB2_SHADOW_OFFSET);
+					(readq(membar2 + MB2_SHADOW_OFFSET) &
+					 PCI_BASE_ADDRESS_MEM_MASK);
 			offset[1] = vmd->dev->resource[VMD_MEMBAR2].start -
-					readq(membar2 + MB2_SHADOW_OFFSET + 8);
+					(readq(membar2 + MB2_SHADOW_OFFSET + 8) &
+					 PCI_BASE_ADDRESS_MEM_MASK);
 			pci_iounmap(vmd->dev, membar2);
 		}
 	}
drivers/pci/pcie/aspm.c +0 -10
index db2efa219028..6e50f84733b7 100644
@@ -633,16 +633,6 @@ static void pcie_aspm_cap_init(struct pcie_link_state *link, int blacklist)
 
 	/* Setup initial capable state. Will be updated later */
 	link->aspm_capable = link->aspm_support;
-	/*
-	 * If the downstream component has pci bridge function, don't
-	 * do ASPM for now.
-	 */
-	list_for_each_entry(child, &linkbus->devices, bus_list) {
-		if (pci_pcie_type(child) == PCI_EXP_TYPE_PCI_BRIDGE) {
-			link->aspm_disable = ASPM_STATE_ALL;
-			break;
-		}
-	}
 
 	/* Get and check endpoint acceptable latencies */
 	list_for_each_entry(child, &linkbus->devices, bus_list) {
drivers/pci/pcie/ptm.c +17 -5
index 9361f3aa26ab..357a454cafa0 100644
@@ -39,10 +39,6 @@ void pci_ptm_init(struct pci_dev *dev)
 	if (!pci_is_pcie(dev))
 		return;
 
-	pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_PTM);
-	if (!pos)
-		return;
-
 	/*
 	 * Enable PTM only on interior devices (root ports, switch ports,
 	 * etc.) on the assumption that it causes no link traffic until an
@@ -52,6 +48,23 @@ void pci_ptm_init(struct pci_dev *dev)
 	     pci_pcie_type(dev) == PCI_EXP_TYPE_RC_END))
 		return;
 
+	/*
+	 * Switch Downstream Ports are not permitted to have a PTM
+	 * capability; their PTM behavior is controlled by the Upstream
+	 * Port (PCIe r5.0, sec 7.9.16).
+	 */
+	ups = pci_upstream_bridge(dev);
+	if (pci_pcie_type(dev) == PCI_EXP_TYPE_DOWNSTREAM &&
+	    ups && ups->ptm_enabled) {
+		dev->ptm_granularity = ups->ptm_granularity;
+		dev->ptm_enabled = 1;
+		return;
+	}
+
+	pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_PTM);
+	if (!pos)
+		return;
+
 	pci_read_config_dword(dev, pos + PCI_PTM_CAP, &cap);
 	local_clock = (cap & PCI_PTM_GRANULARITY_MASK) >> 8;
 
@@ -61,7 +74,6 @@ void pci_ptm_init(struct pci_dev *dev)
 	 * the spec recommendation (PCIe r3.1, sec 7.32.3), select the
 	 * furthest upstream Time Source as the PTM Root.
 	 */
-	ups = pci_upstream_bridge(dev);
 	if (ups && ups->ptm_enabled) {
 		ctrl = PCI_PTM_CTRL_ENABLE;
 		if (ups->ptm_granularity == 0)
drivers/pci/probe.c +3 -2
index 243b65f3c282..cbc0d8da7483 100644
@@ -818,9 +818,10 @@ static int pci_register_host_bridge(struct pci_host_bridge *bridge)
 		goto free;
 
 	err = device_register(&bridge->dev);
-	if (err)
+	if (err) {
 		put_device(&bridge->dev);
-
+		goto free;
+	}
 	bus->bridge = get_device(&bridge->dev);
 	device_enable_async_suspend(bus->bridge);
 	pci_set_bus_of_node(bus);
drivers/pci/setup-res.c +5 -4
index d8ca40a97693..d21fa04fa44d 100644
@@ -439,10 +439,11 @@ int pci_resize_resource(struct pci_dev *dev, int resno, int size)
 	res->end = res->start + pci_rebar_size_to_bytes(size) - 1;
 
 	/* Check if the new config works by trying to assign everything. */
-	ret = pci_reassign_bridge_resources(dev->bus->self, res->flags);
-	if (ret)
-		goto error_resize;
-
+	if (dev->bus->self) {
+		ret = pci_reassign_bridge_resources(dev->bus->self, res->flags);
+		if (ret)
+			goto error_resize;
+	}
 	return 0;
 
 error_resize:
drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c +1 -1
index 0bde5d919b2e..4aff69cbb903 100644
@@ -38,7 +38,7 @@
 /* L3C has 8-counters */
 #define L3C_NR_COUNTERS		0x8
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

drivers/pinctrl/freescale/pinctrl-imx.c +2 -17
index b04edc22dad7..90d414dd792c 100644

Lines of this file are not shown. View the raw message.

drivers/pinctrl/freescale/pinctrl-imx1-core.c +0 -1
index deb7870b3d1a..961c24e0cc8f 100644

Lines of this file are not shown. View the raw message.

drivers/pinctrl/pinctrl-rockchip.c +4 -3
index 8d83817935da..005df24f5b3f 100644

Lines of this file are not shown. View the raw message.

drivers/pinctrl/pinctrl-rza1.c +1 -1
index f76edf664539..021c19eaf12d 100644

Lines of this file are not shown. View the raw message.

drivers/power/supply/Kconfig +1 -1
index ff6dab0bf0dd..76c699b5abda 100644

Lines of this file are not shown. View the raw message.

drivers/power/supply/lp8788-charger.c +2 -16
index 0f3432795f3c..b8f7dac7ac3f 100644

Lines of this file are not shown. View the raw message.

drivers/power/supply/smb347-charger.c +1 -0
index 072c5189bd6d..0655dbdc7000 100644

Lines of this file are not shown. View the raw message.

drivers/pwm/pwm-img.c +6 -2
index 815f5333bb8f..da72b2866e88 100644

Lines of this file are not shown. View the raw message.

drivers/remoteproc/remoteproc_core.c +1 -2
index d5ff272fde34..e48069db1703 100644

Lines of this file are not shown. View the raw message.

drivers/s390/cio/qdio.h +0 -1
index a6f7c2986b94..ed60b8d4efe6 100644

Lines of this file are not shown. View the raw message.

drivers/s390/cio/qdio_setup.c +0 -1
index d040c4920ee7..b8955e20f246 100644

Lines of this file are not shown. View the raw message.

drivers/s390/cio/qdio_thinint.c +8 -6
index 6628e0c9e70e..e6b22a58150a 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/arm/acornscsi.c +3 -1
index 421fe869a11e..ef9d907f2df5 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/ibmvscsi/ibmvscsi.c +2 -0
index b99ded6b9e0b..036508a4bd5a 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/iscsi_boot_sysfs.c +1 -1
index d453667612f8..15d64f96e623 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/lpfc/lpfc_els.c +2 -0
index 7398350b08b4..9032793c405e 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/mpt3sas/mpt3sas_base.c +2 -0
index 2c556c7fcf0d..9fbe20e38ad0 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/qedf/qedf.h +1 -0
index 2c78d8fb9122..fc06be4fd10c 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/qedf/qedf_main.c +31 -4
index cd61905ca2f5..b253523217b8 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/qedi/qedi_iscsi.c +6 -1
index 1b7049dce169..751941a3ed30 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/qla2xxx/qla_os.c +1 -0
index 59b8681842be..b56cf790587e 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/qla2xxx/tcm_qla2xxx.c +2 -0
index 654e1af7f542..b51dba35bcf7 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/sr.c +5 -1
index d0389b20574d..5be3d6b7991b 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/ufs/ufs-qcom.c +3 -3
index 75ee5906b966..21e3ff590ec9 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/ufs/ufshcd.c +0 -1
index 803d67b3a166..bd21c9cdf818 100644

Lines of this file are not shown. View the raw message.

drivers/slimbus/qcom-ngd-ctrl.c +2 -2
index 9221ba7b7863..f40ac8dcb081 100644

Lines of this file are not shown. View the raw message.

drivers/staging/gasket/gasket_sysfs.c +2 -0
index fc45f0d13e87..5986c67bc7ec 100644

Lines of this file are not shown. View the raw message.

drivers/staging/greybus/light.c +2 -1
index 40680eaf3974..db06cd544af5 100644

Lines of this file are not shown. View the raw message.

drivers/staging/mt29f_spinand/mt29f_spinand.c +1 -1
index 448478451c4c..b50788b2d1d9 100644

Lines of this file are not shown. View the raw message.

drivers/staging/sm750fb/sm750.c +1 -0
index 846d7d243994..3972e215128e 100644

Lines of this file are not shown. View the raw message.

drivers/target/target_core_user.c +71 -83

154 lines not on this page · raw message

drivers/thermal/ti-soc-thermal/ti-thermal-common.c +3 -3
index b4f981daeaf2..452e034aedc1 100644

Lines of this file are not shown. View the raw message.

drivers/tty/hvc/hvc_console.c +14 -2
index cdcc64ea2554..f8e43a6faea9 100644

Lines of this file are not shown. View the raw message.

drivers/tty/n_gsm.c +15 -11
index 86b7e20ffd7f..5e9457d19927 100644

Lines of this file are not shown. View the raw message.

drivers/tty/serial/8250/8250_port.c +3 -1
index 5a04d4ddca73..20b799219826 100644

Lines of this file are not shown. View the raw message.

drivers/tty/serial/amba-pl011.c +1 -0
index af21122dfade..1d501154e9f7 100644

Lines of this file are not shown. View the raw message.

drivers/usb/class/usblp.c +4 -1
index 4a80103675d5..419804c9c974 100644

Lines of this file are not shown. View the raw message.

drivers/usb/dwc2/core_intr.c +5 -2
index 19ae2595f1c3..b23ce535c12e 100644

Lines of this file are not shown. View the raw message.

drivers/usb/dwc3/gadget.c +16 -8
index 8e66954dfcd4..2f5f4ca5c0d0 100644

Lines of this file are not shown. View the raw message.

drivers/usb/gadget/composite.c +61 -17

78 lines not on this page · raw message

drivers/usb/gadget/udc/lpc32xx_udc.c +6 -5
index 21921db068f6..cf56819f16e4 100644

Lines of this file are not shown. View the raw message.

drivers/usb/gadget/udc/m66592-udc.c +1 -1
index a8288df6aadf..ea59b56e5402 100644

Lines of this file are not shown. View the raw message.

drivers/usb/gadget/udc/s3c2410_udc.c +0 -4
index 8bf5ad7a59ad..6cc63e317aba 100644

Lines of this file are not shown. View the raw message.

drivers/usb/host/ehci-mxc.c +2 -0
index c9f91e6c72b6..7f65c86047dd 100644

Lines of this file are not shown. View the raw message.

drivers/usb/host/ehci-platform.c +131 -0

131 lines not on this page · raw message

drivers/usb/host/ohci-platform.c +5 -0
index 65a1c3fdc88c..f40112c5920d 100644

Lines of this file are not shown. View the raw message.

drivers/usb/host/xhci-plat.c +9 -1
index adc437ca83b8..65972c186c64 100644

Lines of this file are not shown. View the raw message.

drivers/vfio/mdev/mdev_sysfs.c +1 -1
index e7770b511d03..1692a0cc3036 100644

Lines of this file are not shown. View the raw message.

drivers/vfio/pci/vfio_pci_config.c +11 -3
index 423ea1f98441..36bc8f104e42 100644

Lines of this file are not shown. View the raw message.

drivers/video/backlight/lp855x_bl.c +16 -4
index 73612485ed07..bd43d8cff389 100644

Lines of this file are not shown. View the raw message.

drivers/watchdog/da9062_wdt.c +0 -5
index 7f0a8e635286..132d45d003ce 100644

Lines of this file are not shown. View the raw message.

fs/afs/proc.c +1 -0
index 9101f62707af..e445c02dea3d 100644

Lines of this file are not shown. View the raw message.

fs/afs/write.c +3 -2
index e00461a6de9a..ec8d27cf92a5 100644

Lines of this file are not shown. View the raw message.

fs/block_dev.c +7 -5
index c158bad9a075..8ac8f7469354 100644

Lines of this file are not shown. View the raw message.

fs/dlm/dlm_internal.h +0 -1
index 748e8d59e611..cb287df13a7a 100644

Lines of this file are not shown. View the raw message.

fs/ext4/extents.c +1 -1
index 6e8049031c1a..3a4570e37cb0 100644

Lines of this file are not shown. View the raw message.

fs/ext4/super.c +11 -12
index 93c14ecac831..1428dab2afff 100644

Lines of this file are not shown. View the raw message.

fs/f2fs/super.c +2 -1
index 45f8f6ec22a5..9782250c9815 100644

Lines of this file are not shown. View the raw message.

fs/gfs2/log.c +9 -2
index d3f0612e3347..06752db213d2 100644

Lines of this file are not shown. View the raw message.

fs/gfs2/ops_fstype.c +1 -1
index b041cb8ae383..ed77b10bdfb5 100644

Lines of this file are not shown. View the raw message.

fs/nfs/nfs4proc.c +1 -1
index 668b648064b7..05cb68ca1ba1 100644

Lines of this file are not shown. View the raw message.

fs/nfsd/nfs4callback.c +2 -0
index ebbb0285addb..7ee417b685e9 100644

Lines of this file are not shown. View the raw message.

include/linux/bitops.h +1 -1
index e02cbca3cfaf..5c1522ed2d7c 100644

Lines of this file are not shown. View the raw message.

include/linux/elfnote.h +1 -1
index f236f5b931b2..7fdd7f355b52 100644

Lines of this file are not shown. View the raw message.

include/linux/genhd.h +2 -0
index f13272d84332..f993bc86f3ba 100644

Lines of this file are not shown. View the raw message.

include/linux/kprobes.h +4 -0
index 9adb92ad24d3..9f22652d69bb 100644

Lines of this file are not shown. View the raw message.

include/linux/libata.h +3 -0
index 75a916d7ab2a..ed1453c15041 100644

Lines of this file are not shown. View the raw message.

include/linux/mtd/rawnand.h +5 -4
index efb2345359bb..a4be6b2bcc35 100644

Lines of this file are not shown. View the raw message.

include/linux/usb/composite.h +3 -0
index 8675e145ea8b..2040696d75b6 100644

Lines of this file are not shown. View the raw message.

include/linux/usb/ehci_def.h +1 -1
index a15ce99dfc2d..78e006355557 100644

Lines of this file are not shown. View the raw message.

include/uapi/linux/raid/md_p.h +2 -0
index b0d15c73f6d7..1f2d8c81f0e0 100644

Lines of this file are not shown. View the raw message.

kernel/kprobes.c +26 -1
index 92aad49b82f9..97de04a52c9f 100644

Lines of this file are not shown. View the raw message.

kernel/trace/blktrace.c +11 -19
index 6cea8bbca03c..b7e1e09a0bef 100644

Lines of this file are not shown. View the raw message.

lib/zlib_inflate/inffast.c +35 -56

91 lines not on this page · raw message

net/core/dev.c +18 -22
index 50498a75c04b..1618d5a676c4 100644

Lines of this file are not shown. View the raw message.

net/core/filter.c +9 -7
index 40b3af05c883..b5521b60a2d4 100644

Lines of this file are not shown. View the raw message.

net/rxrpc/proc.c +3 -3
index 9805e3b85c36..81a765dd8c9b 100644

Lines of this file are not shown. View the raw message.

net/sunrpc/addr.c +2 -2
index 2e0a6f92e563..8391c2785550 100644

Lines of this file are not shown. View the raw message.

net/xdp/xsk.c +1 -3
index 72caa4fb13f4..9ff2ab63e639 100644

Lines of this file are not shown. View the raw message.

scripts/mksysmap +1 -1
index a35acc0d0b82..9aa23d15862a 100755

Lines of this file are not shown. View the raw message.

security/apparmor/domain.c +5 -4
index b9d5b3459705..13b33490e079 100644

Lines of this file are not shown. View the raw message.

security/apparmor/include/label.h +1 -0
index 7ce5fe73ae7f..cecbd3f5429c 100644

Lines of this file are not shown. View the raw message.

security/apparmor/label.c +35 -2
index 2469549842d2..6727e6fb69df 100644

Lines of this file are not shown. View the raw message.

security/apparmor/lsm.c +5 -0
index 730de4638b4e..5e32fe434140 100644

Lines of this file are not shown. View the raw message.

security/selinux/ss/services.c +4 -0
index f3def298a90e..a9f2bc8443bd 100644

Lines of this file are not shown. View the raw message.

sound/isa/wavefront/wavefront_synth.c +7 -1
index 0b1e4b34b299..13c8e6542a2f 100644

Lines of this file are not shown. View the raw message.

sound/pci/hda/patch_realtek.c +8 -6
index b4f802013f74..623ebe2e7db4 100644

Lines of this file are not shown. View the raw message.

sound/soc/codecs/rt5645.c +14 -0
index 7e3b47eeea04..9185bd7c5a6d 100644

Lines of this file are not shown. View the raw message.

sound/soc/davinci/davinci-mcasp.c +3 -1
index 14ab16e1369f..1203de8aab99 100644

Lines of this file are not shown. View the raw message.

sound/soc/fsl/fsl_asrc_dma.c +1 -0
index 1033ac6631b0..b9ac448989ed 100644

Lines of this file are not shown. View the raw message.

sound/soc/img/img-i2s-in.c +1 -0
index 388cefd7340a..c22880aea82a 100644

Lines of this file are not shown. View the raw message.

sound/soc/intel/boards/bytcr_rt5640.c +24 -0
index f29014a7d672..0dcd249877c5 100644

Lines of this file are not shown. View the raw message.

sound/soc/meson/axg-fifo.c +8 -2
index 0e4f65e654c4..b229c182b7c3 100644

Lines of this file are not shown. View the raw message.

sound/soc/soc-core.c +19 -3
index e45dfcb62b6a..595fe20bbc6d 100644

Lines of this file are not shown. View the raw message.

sound/soc/tegra/tegra_wm8903.c +5 -1
index 69bc9461974b..301850df368d 100644

Lines of this file are not shown. View the raw message.

sound/usb/card.h +4 -0
index 7f11655bde50..36198ddb4754 100644

Lines of this file are not shown. View the raw message.

sound/usb/endpoint.c +41 -8

49 lines not on this page · raw message

sound/usb/endpoint.h +1 -0
index 63a39d4fa8d8..d23fa0a8c11b 100644

Lines of this file are not shown. View the raw message.

sound/usb/pcm.c +2 -0
index 8b91be394407..42ae774f6db7 100644

Lines of this file are not shown. View the raw message.

tools/perf/builtin-report.c +1 -2
index 5312c761a5db..05eae94d09cb 100644

Lines of this file are not shown. View the raw message.

tools/testing/selftests/networking/timestamping/timestamping.c +8 -2
index 5cdfd743447b..900ed4b47899 100644

Lines of this file are not shown. View the raw message.

tools/testing/selftests/ntb/ntb_test.sh +1 -1
index 08cbfbbc7029..17ca36403d04 100755

Lines of this file are not shown. View the raw message.

tools/testing/selftests/x86/protection_keys.c +2 -1
index 5d546dcdbc80..b8778960da10 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.