4.8.6-stable review
Greg Kroah-Hartman
maintainercover 4.8.6-stable review
This is the start of the stable review cycle for the 4.8.6 release. There are 125 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Mon Oct 31 13:49:27 UTC 2016. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.8.6-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.8.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 4.8.6-rc1
Vishal Verma <[email protected]>
libnvdimm: clear the internal poison_list when clearing badblocks
Lorenzo Pieralisi <[email protected]>
PCI: tegra: Fix pci_remap_iospace() failure path
Lorenzo Pieralisi <[email protected]>
PCI: designware: Fix pci_remap_iospace() failure path
Lorenzo Pieralisi <[email protected]>
PCI: versatile: Fix pci_remap_iospace() failure path
Lorenzo Pieralisi <[email protected]>
PCI: generic: Fix pci_remap_iospace() failure path
Lorenzo Pieralisi <[email protected]>
PCI: aardvark: Fix pci_remap_iospace() failure path
Lorenzo Pieralisi <[email protected]>
PCI: rcar: Fix pci_remap_iospace() failure path
Javier Martinez Canillas <[email protected]>
ARM: dts: omap3: overo: add missing unit name for lcd35 display
Linus Walleij <[email protected]>
ARM: dts: fix RealView EB SMSC ethernet version
Jon Mason <[email protected]>
ARM: dts: NSP: Correct RAM amount for BCM958625HR board
Robert Jarzmik <[email protected]>
ARM: pxa: fix GPIO double shifts
Robert Jarzmik <[email protected]>
ARM: pxa: pxa_cplds: fix interrupt handling
Christophe Leroy <[email protected]>
powerpc: Fix usage of _PAGE_RO in hugepage
Pan Xinhui <[email protected]>
powerpc/nvram: Fix an incorrect partition merge
Cyril Bur <[email protected]>
powerpc: Add check_if_tm_restore_required() to giveup_all()
Cyril Bur <[email protected]>
powerpc: Always restore FPU/VEC/VSX if hardware transactional memory in use
Johannes Thumshirn <[email protected]>
mpt3sas: Don't spam logs if logging level is 0
John Crispin <[email protected]>
pinctrl: qcom: fix masking of pinmux functions
Chen-Yu Tsai <[email protected]>
ARM: dts: sun9i: Add missing #interrupt-cells to R_PIO pinctrl device node
Luca Coelho <[email protected]>
iwlwifi: mvm: bail out if CTDP start operation fails
Sara Sharon <[email protected]>
iwlwifi: mvm: disable P2P queue on mac context release
Sara Sharon <[email protected]>
iwlwifi: mvm: support BAR in reorder buffer
Liad Kaufman <[email protected]>
iwlwifi: mvm: free reserved queue on STA removal
Sara Sharon <[email protected]>
iwlwifi: mvm: call a different txq_enable function
Liad Kaufman <[email protected]>
iwlwifi: mvm: fix pending frames tracking on tx resp
Haim Dreyfuss <[email protected]>
iwlwifi: check for valid ethernet address provided by OEM
Arnaldo Carvalho de Melo <[email protected]>
perf symbols: Fixup symbol sizes before picking best ones
Arnaldo Carvalho de Melo <[email protected]>
perf symbols: Check symbol_conf.allow_aliases for kallsyms loading too
Namhyung Kim <[email protected]>
perf ui/stdio: Always reset output width for hierarchy
Namhyung Kim <[email protected]>
perf ui/tui: Reset output width for hierarchy
Ravi Bangoria <[email protected]>
perf powerpc: Fix build-test failure
Namhyung Kim <[email protected]>
perf hists browser: Fix event group display
Wang Nan <[email protected]>
perf data: Fix building in 32 bit platform with libbabeltrace
Geert Uytterhoeven <[email protected]>
clk: divider: Fix clk_divider_round_rate() to use clk_readl()
Jean-Francois Moine <[email protected]>
clk: core: Force setting the phase delay when no change
Stephen Boyd <[email protected]>
clk: Return errors from clk providers in __of_clk_get_from_provider()
Tang Yuantian <[email protected]>
clk: qoriq: fix a register offset error
Srinivas Kandagatla <[email protected]>
clk: qcom: select GDSC for msm8996 gcc and mmcc
Srinivas Kandagatla <[email protected]>
clk: gcc-msm8996: Fix pcie 2 pipe register offset
Eric Anholt <[email protected]>
clk: bcm2835: Skip PLLC clocks when deciding on a new clock parent
Sascha Silbe <[email protected]>
s390/con3270: fix insufficient space padding
Sascha Silbe <[email protected]>
s390/con3270: fix use of uninitialised data
Sebastian Ott <[email protected]>
s390/cio: fix accidental interrupt enabling during resume
Thomas Hellstrom <[email protected]>
drm/vmwgfx: Avoid validating views on view destruction
Gerald Schaefer <[email protected]>
mm/hugetlb: improve locking in dissolve_free_huge_pages()
Gerald Schaefer <[email protected]>
mm/hugetlb: check for reserved hugepages during memory offline
Arnd Bergmann <[email protected]>
dmaengine: ipu: remove bogus NO_IRQ reference
Georges Savoundararadj <[email protected]>
power: bq24257: Fix use of uninitialized pointer bq->charger
Maor Gottlieb <[email protected]>
IB/mlx5: Fix steering resource leak
Dennis Dalessandro <[email protected]>
IB/qib: Remove qpt_mask global
Mike Marciniszyn <[email protected]>
IB/rdmavt: Correct sparse annotation
Mike Marciniszyn <[email protected]>
IB/hfi1: Move iowait_init() to priv allocate
Nicholas Mc Guire <[email protected]>
staging: ks7010: declare private functions static
Nicholas Mc Guire <[email protected]>
staging: ks7010: fix wait_for_completion_interruptible_timeout return handling
Larry Finger <[email protected]>
staging: r8188eu: Fix scheduling while atomic splat
Phil Turnbull <[email protected]>
staging: sm750fb: Correctly set CLOCK_PHASE bit of display controller.
Arnd Bergmann <[email protected]>
staging: android ion/hisi: fix dependencies
Christophe JAILLET <[email protected]>
iio: light: us5182d: Add missing error code assignment before test
Colin Ian King <[email protected]>
iio: ad5755: fix off-by-one on devnr limit check
Takashi Sakamoto <[email protected]>
ASoC: sst-bxt-da7219_max98357a: fix obsoleted initializers for array
Takashi Sakamoto <[email protected]>
ASoC: sst-bxt-rt298: fix obsoleted initializers for array
Chen-Yu Tsai <[email protected]>
ASoC: dapm: Fix kcontrol creation for output driver widget
Chen-Yu Tsai <[email protected]>
ASoC: dapm: Fix value setting for _ENUM_DOUBLE MUX's second channel
Chen-Yu Tsai <[email protected]>
ASoC: dapm: Fix possible uninitialized variable in snd_soc_dapm_get_volsw()
Wei Yongjun <[email protected]>
ASoC: topology: Fix error return code in soc_tplg_dapm_widget_create()
Dave Gerlach <[email protected]>
hwrng: omap - Only fail if pm_runtime_get_sync returns < 0
Wei Yongjun <[email protected]>
crypto: ccp - Fix return value check in ccp_dmaengine_register()
Ard Biesheuvel <[email protected]>
crypto: arm/ghash-ce - add missing async import/export
Romain Perier <[email protected]>
crypto: marvell - Update transformation context for each dequeued req
Ondrej Mosnáček <[email protected]>
crypto: gcm - Fix IV buffer size in crypto_gcm_setkey
Romain Perier <[email protected]>
crypto: marvell - Don't overwrite default creq->state during initialization
Rajkumar Manoharan <[email protected]>
ath10k: fix throughput regression in multi client mode
Ashok Raj Nagarajan <[email protected]>
ath10k: fix reporting channel survey data
Ashok Raj Nagarajan <[email protected]>
ath10k: fix sending frame in management path in push txq logic
Tamizh chelvam <[email protected]>
ath10k: Add WMI_SERVICE_PERIODIC_CHAN_STAT_SUPPORT wmi service
Amitkumar Karwar <[email protected]>
mwifiex: fix failed to reconnect after interface disabled/enabled
Xinming Hu <[email protected]>
mwifiex: correct aid value during tdls setup
Jacob Keller <[email protected]>
i40e: fix broken i40e_config_rss_aq function
Dan Carpenter <[email protected]>
i40e: remove a stray unlock
Wei Yongjun <[email protected]>
spi: spi-fsl-dspi: Drop extra spi_master_put in device remove function
Uwe Kleine-König <[email protected]>
ARM: clk-imx35: fix name for ckil clk
Jan Viktorin <[email protected]>
uio: fix dmem_region_start computation
Suzuki K Poulose <[email protected]>
coresight: Remove erroneous dma_free_coherent in tmc_probe
Sebastian Frias <[email protected]>
genirq/generic_chip: Add irq_unmap callback
Uma Krishnan <[email protected]>
scsi: cxlflash: Remove the device cleanly in the system shutdown path
Christophe Jaillet <[email protected]>
rt2x00usb: Fix error return code
Jan Kara <[email protected]>
posix_acl: Clear SGID bit when setting file permissions
Chris Wilson <[email protected]>
drm/i915: Unalias obj->phys_handle and obj->userptr
Chris Wilson <[email protected]>
drm/i915: Just clear the mmiodebug before a register access
Ville Syrjälä <[email protected]>
drm/i915: Allow DP to work w/o EDID
Ville Syrjälä <[email protected]>
drm/i915: Move long hpd handling into the hotplug work
Ville Syrjälä <[email protected]>
drm/i915: Allow PCH DPLL sharing regardless of DPLL_SDVO_HIGH_SPEED
Lyude <[email protected]>
drm/i915/skl: Ensure pipes with changed wms get added to the state
Ville Syrjälä <[email protected]>
drm/i915: Account for TSEG size when determining 865G stolen base
David Weinehall <[email protected]>
Revert "drm/i915: Check live status before reading edid"
Paulo Zanoni <[email protected]>
drm/i915/kbl: KBL also needs to run the SAGV code
Paulo Zanoni <[email protected]>
drm/i915: introduce intel_has_sagv()
Paulo Zanoni <[email protected]>
drm/i915: SAGV is not SKL-only, so rename a few things
Paulo Zanoni <[email protected]>
drm/i915/gen9: fix the watermark res_blocks value
Paulo Zanoni <[email protected]>
drm/i915/gen9: fix plane_blocks_per_line on watermarks calculations
Paulo Zanoni <[email protected]>
drm/i915/gen9: minimum scanlines for Y tile is not always 4
Paulo Zanoni <[email protected]>
drm/i915/gen9: fix the WaWmMemoryReadLatency implementation
Paulo Zanoni <[email protected]>
drm/i915/gen9: only add the planes actually affected by ddb changes
Lyude <[email protected]>
drm/i915/skl: Don't try to update plane watermarks if they haven't changed
Lyude <[email protected]>
drm/i915/skl: Update DDB values atomically with wms/plane attrs
Lyude <[email protected]>
drm/i915: Move CRTC updating in atomic_commit into it's own hook
Lyude <[email protected]>
drm/i915/skl: Update plane watermarks atomically during plane updates
Steinar H. Gunderson <[email protected]>
HID: add quirk for Akai MIDImix.
Rex Zhu <[email protected]>
drm/amd/powerplay: fix mclk not switching back after multi-head was disabled
Stefan Agner <[email protected]>
drm/fsl-dcu: fix endian issue when using clk_register_divider
Thomas Hellstrom <[email protected]>
drm/vmwgfx: Limit the user-space command buffer size
Alex Deucher <[email protected]>
drm/radeon: change vblank_time's calculation method to reduce computational error.
Alex Deucher <[email protected]>
drm/radeon/si/dpm: fix phase shedding setup
Alex Deucher <[email protected]>
drm/radeon: narrow asic_init for virtualization
Rex Zhu <[email protected]>
drm/amdgpu: change vblank_time's calculation method to reduce computational error.
Nicolai Hähnle <[email protected]>
drm/amdgpu: initialize the context reset_counter in amdgpu_ctx_init
Grazvydas Ignotas <[email protected]>
drm/amdgpu/dce11: add missing drm_mode_config_cleanup call
Alex Deucher <[email protected]>
drm/amdgpu/dce11: disable hpd on local panels
Alex Deucher <[email protected]>
drm/amdgpu/dce8: disable hpd on local panels
Alex Deucher <[email protected]>
drm/amdgpu/dce10: disable hpd on local panels
Alex Deucher <[email protected]>
drm/amdgpu: fix IB alignment for UVD
Shawn Lee <[email protected]>
drm/i915/backlight: setup backlight pwm alternate increment on backlight enable
Jani Nikula <[email protected]>
drm/i915/backlight: setup and cache pwm alternate increment value
Chris Wilson <[email protected]>
drm/prime: Pass the right module owner through to dma_buf_export()
Eric Anholt <[email protected]>
drm/vc4: Fix races when the CS reads from render targets.
-------------
Diffstat:
Makefile | 4 +- arch/arm/boot/dts/arm-realview-eb.dtsi | 23 +- arch/arm/boot/dts/bcm958625hr.dts | 3 +- arch/arm/boot/dts/omap3-overo-common-lcd35.dtsi | 2 +- arch/arm/boot/dts/sun9i-a80.dtsi | 3 +- arch/arm/crypto/ghash-ce-glue.c | 24 ++ arch/arm/mach-pxa/corgi_pm.c | 13 +- arch/arm/mach-pxa/pxa_cplds_irqs.c | 24 +- arch/arm/mach-pxa/sharpsl_pm.c | 2 +- arch/arm/mach-pxa/sharpsl_pm.h | 2 +- arch/arm/mach-pxa/spitz_pm.c | 9 +- arch/powerpc/include/asm/book3s/64/pgtable.h | 2 + arch/powerpc/kernel/nvram_64.c | 6 +- arch/powerpc/kernel/process.c | 22 +- arch/powerpc/mm/hugetlbpage.c | 7 + arch/x86/kernel/early-quirks.c | 9 +- crypto/gcm.c | 2 +- drivers/char/hw_random/omap-rng.c | 4 +- drivers/clk/bcm/clk-bcm2835.c | 23 ++ drivers/clk/clk-divider.c | 2 +- drivers/clk/clk-qoriq.c | 6 +- drivers/clk/clk.c | 14 +- drivers/clk/imx/clk-imx35.c | 2 +- drivers/clk/qcom/Kconfig | 2 + drivers/clk/qcom/gcc-msm8996.c | 4 +- drivers/crypto/ccp/ccp-dmaengine.c | 2 +- drivers/crypto/marvell/cesa.c | 1 + drivers/crypto/marvell/hash.c | 15 +- drivers/dma/ipu/ipu_irq.c | 9 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 3 + drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c | 14 +- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 23 +- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 24 +- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 48 ++- .../drm/amd/powerplay/eventmgr/eventactionchains.c | 2 + drivers/gpu/drm/amd/powerplay/eventmgr/psm.c | 3 +- drivers/gpu/drm/drm_prime.c | 17 +- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 6 +- drivers/gpu/drm/i915/i915_drv.h | 36 +- drivers/gpu/drm/i915/i915_gem_stolen.c | 23 +- drivers/gpu/drm/i915/intel_display.c | 216 ++++++++-- drivers/gpu/drm/i915/intel_dp.c | 72 ++-- drivers/gpu/drm/i915/intel_drv.h | 21 +- drivers/gpu/drm/i915/intel_hdmi.c | 43 +- drivers/gpu/drm/i915/intel_panel.c | 32 +- drivers/gpu/drm/i915/intel_pm.c | 454 ++++++++++----------- drivers/gpu/drm/i915/intel_sprite.c | 14 + drivers/gpu/drm/i915/intel_uncore.c | 7 +- drivers/gpu/drm/radeon/r600_dpm.c | 15 +- drivers/gpu/drm/radeon/radeon_device.c | 5 +- drivers/gpu/drm/radeon/si_dpm.c | 2 +- drivers/gpu/drm/radeon/sislands_smc.h | 1 + drivers/gpu/drm/vc4/vc4_drv.h | 19 +- drivers/gpu/drm/vc4/vc4_gem.c | 13 + drivers/gpu/drm/vc4/vc4_render_cl.c | 21 +- drivers/gpu/drm/vc4/vc4_validate.c | 17 +- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 76 +++- drivers/hid/hid-ids.h | 3 + drivers/hid/usbhid/hid-quirks.c | 1 + drivers/hwtracing/coresight/coresight-tmc.c | 3 - drivers/iio/dac/ad5755.c | 2 +- drivers/iio/light/us5182d.c | 2 +- drivers/infiniband/hw/hfi1/qp.c | 14 +- drivers/infiniband/hw/mlx5/main.c | 1 + drivers/infiniband/hw/qib/qib.h | 1 - drivers/infiniband/hw/qib/qib_qp.c | 13 +- drivers/infiniband/hw/qib/qib_verbs.c | 2 - drivers/infiniband/sw/rdmavt/qp.c | 9 +- drivers/net/ethernet/intel/i40e/i40e_client.c | 1 - drivers/net/ethernet/intel/i40e/i40e_main.c | 57 ++- drivers/net/wireless/ath/ath10k/htt_rx.c | 2 + drivers/net/wireless/ath/ath10k/mac.c | 22 +- drivers/net/wireless/ath/ath10k/txrx.c | 2 - drivers/net/wireless/ath/ath10k/wmi.h | 5 + drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 15 +- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 5 +- drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 5 + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 12 +- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 28 +- drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 6 +- drivers/net/wireless/marvell/mwifiex/join.c | 3 +- drivers/net/wireless/marvell/mwifiex/sta_event.c | 6 +- drivers/net/wireless/ralink/rt2x00/rt2x00usb.c | 4 +- drivers/nvdimm/bus.c | 2 + drivers/nvdimm/core.c | 73 +++- drivers/pci/host/pci-aardvark.c | 8 +- drivers/pci/host/pci-host-common.c | 8 +- drivers/pci/host/pci-tegra.c | 7 +- drivers/pci/host/pci-versatile.c | 8 +- drivers/pci/host/pcie-designware.c | 21 +- drivers/pci/host/pcie-rcar.c | 9 +- drivers/pinctrl/qcom/pinctrl-msm.c | 2 +- drivers/power/bq24257_charger.c | 12 +- drivers/s390/char/con3270.c | 11 +- drivers/s390/cio/chsc.c | 20 +- drivers/scsi/cxlflash/main.c | 18 +- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 2 +- drivers/spi/spi-fsl-dspi.c | 1 - drivers/staging/android/ion/Kconfig | 1 + drivers/staging/ks7010/ks_hostif.c | 12 +- drivers/staging/rtl8188eu/core/rtw_cmd.c | 4 +- drivers/staging/sm750fb/ddk750_mode.c | 2 +- drivers/uio/uio_dmem_genirq.c | 2 +- fs/9p/acl.c | 40 +- fs/btrfs/acl.c | 6 +- fs/ceph/acl.c | 6 +- fs/ext2/acl.c | 12 +- fs/ext4/acl.c | 12 +- fs/f2fs/acl.c | 6 +- fs/gfs2/acl.c | 12 +- fs/hfsplus/posix_acl.c | 4 +- fs/jffs2/acl.c | 9 +- fs/jfs/acl.c | 6 +- fs/ocfs2/acl.c | 10 +- fs/orangefs/acl.c | 15 +- fs/posix_acl.c | 31 ++ fs/reiserfs/xattr_acl.c | 8 +- fs/xfs/xfs_acl.c | 13 +- include/drm/drmP.h | 3 +- include/linux/hugetlb.h | 6 +- include/linux/libnvdimm.h | 2 + include/linux/posix_acl.h | 1 + kernel/irq/generic-chip.c | 21 + mm/hugetlb.c | 34 +- mm/memory_hotplug.c | 4 +- sound/soc/intel/boards/bxt_da7219_max98357a.c | 12 +- sound/soc/intel/boards/bxt_rt298.c | 14 +- sound/soc/soc-dapm.c | 6 +- sound/soc/soc-topology.c | 1 + tools/perf/perf-sys.h | 1 - tools/perf/ui/browsers/hists.c | 7 +- tools/perf/ui/stdio/hist.c | 14 +- tools/perf/util/data-convert-bt.c | 2 +- tools/perf/util/symbol-elf.c | 3 +- tools/perf/util/symbol.c | 5 +- 136 files changed, 1388 insertions(+), 855 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/125 drm/vc4: Fix races when the CS reads from render targets.
4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Anholt <[email protected]>
commit 7edabee06a5622190d59689a64f5e17d1c343cc3 upstream.
With the introduction of bin/render pipelining, the previous job may not be completed when we start binning the next one. If the previous job wrote our VBO, IB, or CS textures, then the binning stage might get stale or uninitialized results.
Fixes the major rendering failure in glmark2 -b terrain.
--- drivers/gpu/drm/vc4/vc4_drv.h | 19 ++++++++++++++++++- drivers/gpu/drm/vc4/vc4_gem.c | 13 +++++++++++++ drivers/gpu/drm/vc4/vc4_render_cl.c | 21 +++++++++++++++++---- drivers/gpu/drm/vc4/vc4_validate.c | 17 ++++++++++++++--- 4 files changed, 62 insertions(+), 8 deletions(-)
drivers/gpu/drm/vc4/vc4_drv.h +18 -1
@@ -122,9 +122,16 @@ to_vc4_dev(struct drm_device *dev)struct vc4_bo {struct drm_gem_cma_object base; -/* seqno of the last job to render to this BO. */ +/* seqno of the last job to render using this BO. */ uint64_t seqno; +/* seqno of the last job to use the RCL to write to this BO. +* +* Note that this doesn't include binner overflow memory +* writes. +*/ +uint64_t write_seqno; +/* List entry for the BO's position in either * vc4_exec_info->unref_list or vc4_dev->bo_cache.time_list */
@@ -216,6 +223,9 @@ struct vc4_exec_info {/* Sequence number for this bin/render job. */ uint64_t seqno; +/* Latest write_seqno of any BO that binning depends on. */ +uint64_t bin_dep_seqno; +/* Last current addresses the hardware was processing when the * hangcheck timer checked on us. */
@@ -230,6 +240,13 @@ struct vc4_exec_info {struct drm_gem_cma_object **bo;uint32_t bo_count; +/* List of BOs that are being written by the RCL. Other than +* the binner temporary storage, this is all the BOs written +* by the job. +*/ +struct drm_gem_cma_object *rcl_write_bo[4 ]; +uint32_t rcl_write_bo_count; +/* Pointers for our position in vc4->job_list */ struct list_head head;
drivers/gpu/drm/vc4/vc4_gem.c +13 -0
@@ -471,6 +471,11 @@ vc4_update_bo_seqnos(struct vc4_exec_inflist_for_each_entry (bo, &exec->unref_list, unref_head) { bo->seqno = seqno; } + +for (i =0 ; i < exec->rcl_write_bo_count; i++) { + bo =to_vc4_bo (&exec->rcl_write_bo[i]->base); + bo->write_seqno = seqno; + } }/* Queues a struct vc4_exec_info for execution. If no job is
@@ -673,6 +678,14 @@ vc4_get_bcl(struct drm_device *dev, stru goto fail; ret =vc4_validate_shader_recs (dev, exec); +if (ret) + goto fail; + +/* Block waiting on any previous rendering into the CS's VBO, +* IB, or textures, so that pixels are actually written by the +* time we try to read them. +*/ + ret =vc4_wait_for_seqno (dev, exec->bin_dep_seqno, ~0ull , true); fail:drm_free_large (temp);
drivers/gpu/drm/vc4/vc4_render_cl.c +17 -4
@@ -45,6 +45,8 @@ struct vc4_rcl_setup {struct drm_gem_cma_object *rcl;u32 next_offset; + +u32 next_write_bo_index; };static inline void rcl_u8 (struct vc4_rcl_setup *setup,u8 val)
@@ -407,6 +409,8 @@ static int vc4_rcl_msaa_surface_setup(stif (!*obj)return -EINVAL ; + exec->rcl_write_bo[exec->rcl_write_bo_count++] = *obj; +if (surf->offset &0xf ) {DRM_ERROR ("MSAA write must be 16b aligned.\n" );return -EINVAL ;
@@ -417,7 +421,8 @@ static int vc4_rcl_msaa_surface_setup(ststatic int vc4_rcl_surface_setup (struct vc4_exec_info *exec,struct drm_gem_cma_object **obj, -struct drm_vc4_submit_rcl_surface *surf) +struct drm_vc4_submit_rcl_surface *surf, +bool is_write) {uint8_t tiling =VC4_GET_FIELD (surf->bits,VC4_LOADSTORE_TILE_BUFFER_TILING );
@@ -440,6 +445,9 @@ static int vc4_rcl_surface_setup(structif (!*obj)return -EINVAL ; +if (is_write) + exec->rcl_write_bo[exec->rcl_write_bo_count++] = *obj; +if (surf->flags &VC4_SUBMIT_RCL_SURFACE_READ_IS_FULL_RES ) {if (surf == &exec->args->zs_write) {DRM_ERROR ("general zs write may not be a full-res.\n" );
@@ -542,6 +550,8 @@ vc4_rcl_render_config_surface_setup(struif (!*obj)return -EINVAL ; + exec->rcl_write_bo[exec->rcl_write_bo_count++] = *obj; +if (tiling >VC4_TILING_FORMAT_LT ) {DRM_ERROR ("Bad tiling format\n" );return -EINVAL ;
@@ -599,15 +609,18 @@ int vc4_get_rcl(struct drm_device *dev,if (ret)return ret; - ret =vc4_rcl_surface_setup (exec, &setup.color_read, &args->color_read); + ret =vc4_rcl_surface_setup (exec, &setup.color_read, &args->color_read, + false);if (ret)return ret; - ret =vc4_rcl_surface_setup (exec, &setup.zs_read, &args->zs_read); + ret =vc4_rcl_surface_setup (exec, &setup.zs_read, &args->zs_read, + false);if (ret)return ret; - ret =vc4_rcl_surface_setup (exec, &setup.zs_write, &args->zs_write); + ret =vc4_rcl_surface_setup (exec, &setup.zs_write, &args->zs_write, + true);if (ret)return ret;
drivers/gpu/drm/vc4/vc4_validate.c +14 -3
@@ -267,6 +267,9 @@ validate_indexed_prim_list(VALIDATE_ARGSif (!ib)return -EINVAL ; + exec->bin_dep_seqno =max (exec->bin_dep_seqno, +to_vc4_bo (&ib->base)->write_seqno); +if (offset > ib->base.size || (ib->base.size - offset) / index_size < length) { DRM_ERROR("IB access overflow (%d + %d*%d > %zd)\n",
@@ -555,8 +558,7 @@ static bool reloc_tex(struct vc4_exec_info *exec, void *uniform_data_u, struct vc4_texture_sample_info *sample, - uint32_t texture_handle_index) - + uint32_t texture_handle_index, bool is_cs) { struct drm_gem_cma_object *tex;uint32_t p0 = *(uint32_t *)(uniform_data_u + sample->p_offset[0 ]);
@@ -714,6 +716,11 @@ reloc_tex(struct vc4_exec_info *exec, *validated_p0 = tex->paddr + p0; +if (is_cs) { + exec->bin_dep_seqno =max (exec->bin_dep_seqno, +to_vc4_bo (&tex->base)->write_seqno); + } +return true; fail:DRM_INFO ("Texture p0 at %d: 0x%08x\n" , sample->p_offset[0 ], p0);
@@ -835,7 +842,8 @@ validate_gl_shader_rec(struct drm_deviceif (!reloc_tex (exec, uniform_data_u, &validated_shader->texture_samples[tex], - texture_handles_u[tex])) { + texture_handles_u[tex], + i ==2 )) {return -EINVAL ; } }
@@ -867,6 +875,9 @@ validate_gl_shader_rec(struct drm_deviceuint32_t stride = *(uint8_t *)(pkt_u + o +5 );uint32_t max_index; + exec->bin_dep_seqno =max (exec->bin_dep_seqno, +to_vc4_bo (&vbo->base)->write_seqno); +if (state->addr &0x8 ) stride |= (*(uint32_t *)(pkt_u +100 + i *4 )) & ~0xff ;
Greg Kroah-Hartman
maintainerPATCH 5/125 drm/amdgpu: fix IB alignment for UVD
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit c4795ca642b8bd76b5b6ffba41ba909543273d43 upstream.
According to the hw team, it should be 16, not 8.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +1 -1
@@ -292,7 +292,7 @@ static int amdgpu_info_ioctl(struct drm_ type =AMD_IP_BLOCK_TYPE_UVD ; ring_mask = adev->uvd.ring.ready ?1 :0 ; ib_start_alignment =AMDGPU_GPU_PAGE_SIZE ; - ib_size_alignment =8 ; + ib_size_alignment =16 ;break ;case AMDGPU_HW_IP_VCE : type =AMD_IP_BLOCK_TYPE_VCE ;
Greg Kroah-Hartman
maintainerPATCH 6/125 drm/amdgpu/dce10: disable hpd on local panels
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit e96ec90f496603c48e0945f8bdeb4cdf3088cbba upstream.
Otherwise we can get a hotplug interrupt storm when we turn the panel off if hpd interrupts were enabled by the bios.
bug:
https://bugs.freedesktop.org/show_bug.cgi?id=97471
--- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +13 -10
@@ -425,16 +425,6 @@ static void dce_v10_0_hpd_init(struct amlist_for_each_entry (connector, &dev->mode_config.connector_list, head) {struct amdgpu_connector *amdgpu_connector =to_amdgpu_connector (connector); -if (connector->connector_type == DRM_MODE_CONNECTOR_eDP || - connector->connector_type ==DRM_MODE_CONNECTOR_LVDS ) { -/* don't try to enable hpd on eDP or LVDS avoid breaking the -* aux dp channel on imac and help (but not completely fix) -* https://bugzilla.redhat.com/show_bug.cgi?id=726143 -* also avoid interrupt storms during dpms. -*/ -continue ; - } -switch (amdgpu_connector->hpd.hpd) {case AMDGPU_HPD_1 : idx =0 ;
@@ -458,6 +448,19 @@ static void dce_v10_0_hpd_init(struct amcontinue ; } +if (connector->connector_type == DRM_MODE_CONNECTOR_eDP || + connector->connector_type ==DRM_MODE_CONNECTOR_LVDS ) { +/* don't try to enable hpd on eDP or LVDS avoid breaking the +* aux dp channel on imac and help (but not completely fix) +* https://bugzilla.redhat.com/show_bug.cgi?id=726143 +* also avoid interrupt storms during dpms. +*/ + tmp =RREG32 (mmDC_HPD_INT_CONTROL + hpd_offsets[idx]); + tmp =REG_SET_FIELD (tmp,DC_HPD_INT_CONTROL ,DC_HPD_INT_EN ,0 ); +WREG32 (mmDC_HPD_INT_CONTROL + hpd_offsets[idx], tmp); +continue ; + } + tmp =RREG32 (mmDC_HPD_CONTROL + hpd_offsets[idx]); tmp =REG_SET_FIELD (tmp,DC_HPD_CONTROL ,DC_HPD_EN ,1 );WREG32 (mmDC_HPD_CONTROL + hpd_offsets[idx], tmp);
Greg Kroah-Hartman
maintainerPATCH 7/125 drm/amdgpu/dce8: disable hpd on local panels
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 324082586cc5918e3230f0b2f326656c653201eb upstream.
Otherwise we can get a hotplug interrupt storm when we turn the panel off if hpd interrupts were enabled by the bios.
bug:
https://bugs.freedesktop.org/show_bug.cgi?id=97471
--- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 48 +++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +39 -9
@@ -395,15 +395,6 @@ static void dce_v8_0_hpd_init(struct amdlist_for_each_entry (connector, &dev->mode_config.connector_list, head) {struct amdgpu_connector *amdgpu_connector =to_amdgpu_connector (connector); -if (connector->connector_type == DRM_MODE_CONNECTOR_eDP || - connector->connector_type ==DRM_MODE_CONNECTOR_LVDS ) { -/* don't try to enable hpd on eDP or LVDS avoid breaking the -* aux dp channel on imac and help (but not completely fix) -* https://bugzilla.redhat.com/show_bug.cgi?id=726143 -* also avoid interrupt storms during dpms. -*/ -continue ; - }switch (amdgpu_connector->hpd.hpd) {case AMDGPU_HPD_1 :WREG32 (mmDC_HPD1_CONTROL, tmp);
@@ -426,6 +417,45 @@ static void dce_v8_0_hpd_init(struct amddefault :break ; } + +if (connector->connector_type == DRM_MODE_CONNECTOR_eDP || + connector->connector_type ==DRM_MODE_CONNECTOR_LVDS ) { +/* don't try to enable hpd on eDP or LVDS avoid breaking the +* aux dp channel on imac and help (but not completely fix) +* https://bugzilla.redhat.com/show_bug.cgi?id=726143 +* also avoid interrupt storms during dpms. +*/ +u32 dc_hpd_int_cntl_reg, dc_hpd_int_cntl; + +switch (amdgpu_connector->hpd.hpd) { +case AMDGPU_HPD_1 : + dc_hpd_int_cntl_reg = mmDC_HPD1_INT_CONTROL; +break ; +case AMDGPU_HPD_2 : + dc_hpd_int_cntl_reg = mmDC_HPD2_INT_CONTROL; +break ; +case AMDGPU_HPD_3 : + dc_hpd_int_cntl_reg = mmDC_HPD3_INT_CONTROL; +break ; +case AMDGPU_HPD_4 : + dc_hpd_int_cntl_reg = mmDC_HPD4_INT_CONTROL; +break ; +case AMDGPU_HPD_5 : + dc_hpd_int_cntl_reg = mmDC_HPD5_INT_CONTROL; +break ; +case AMDGPU_HPD_6 : + dc_hpd_int_cntl_reg = mmDC_HPD6_INT_CONTROL; +break ; +default : +continue ; + } + + dc_hpd_int_cntl =RREG32 (dc_hpd_int_cntl_reg); + dc_hpd_int_cntl &= ~DC_HPD1_INT_CONTROL__DC_HPD1_INT_EN_MASK ; +WREG32 (dc_hpd_int_cntl_reg, dc_hpd_int_cntl); +continue ; + } +dce_v8_0_hpd_set_polarity (adev, amdgpu_connector->hpd.hpd);amdgpu_irq_get (adev, &adev->hpd_irq, amdgpu_connector->hpd.hpd); }
Greg Kroah-Hartman
maintainerPATCH 8/125 drm/amdgpu/dce11: disable hpd on local panels
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 3a9d993ee9809c217f4322623a9b78c8d17fdd1f upstream.
Otherwise we can get a hotplug interrupt storm when we turn the panel off if hpd interrupts were enabled by the bios.
bug:
https://bugs.freedesktop.org/show_bug.cgi?id=97471
--- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +13 -10
@@ -443,16 +443,6 @@ static void dce_v11_0_hpd_init(struct amlist_for_each_entry (connector, &dev->mode_config.connector_list, head) {struct amdgpu_connector *amdgpu_connector =to_amdgpu_connector (connector); -if (connector->connector_type == DRM_MODE_CONNECTOR_eDP || - connector->connector_type ==DRM_MODE_CONNECTOR_LVDS ) { -/* don't try to enable hpd on eDP or LVDS avoid breaking the -* aux dp channel on imac and help (but not completely fix) -* https://bugzilla.redhat.com/show_bug.cgi?id=726143 -* also avoid interrupt storms during dpms. -*/ -continue ; - } -switch (amdgpu_connector->hpd.hpd) {case AMDGPU_HPD_1 : idx =0 ;
@@ -476,6 +466,19 @@ static void dce_v11_0_hpd_init(struct amcontinue ; } +if (connector->connector_type == DRM_MODE_CONNECTOR_eDP || + connector->connector_type ==DRM_MODE_CONNECTOR_LVDS ) { +/* don't try to enable hpd on eDP or LVDS avoid breaking the +* aux dp channel on imac and help (but not completely fix) +* https://bugzilla.redhat.com/show_bug.cgi?id=726143 +* also avoid interrupt storms during dpms. +*/ + tmp =RREG32 (mmDC_HPD_INT_CONTROL + hpd_offsets[idx]); + tmp =REG_SET_FIELD (tmp,DC_HPD_INT_CONTROL ,DC_HPD_INT_EN ,0 ); +WREG32 (mmDC_HPD_INT_CONTROL + hpd_offsets[idx], tmp); +continue ; + } + tmp =RREG32 (mmDC_HPD_CONTROL + hpd_offsets[idx]); tmp =REG_SET_FIELD (tmp,DC_HPD_CONTROL ,DC_HPD_EN ,1 );WREG32 (mmDC_HPD_CONTROL + hpd_offsets[idx], tmp);
Greg Kroah-Hartman
maintainerPATCH 9/125 drm/amdgpu/dce11: add missing drm_mode_config_cleanup call
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Grazvydas Ignotas <[email protected]>
commit 140c94da3c3338c0ff4cc127cf9bec87905ca83c upstream.
All other amdgpu/dce_v* files have this call, it's only mysteriously missing from dce_v11_0.c since the file was added and causes leaks.
--- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +1 -0
@@ -3112,6 +3112,7 @@ static int dce_v11_0_sw_fini(void *handldce_v11_0_afmt_fini (adev); +drm_mode_config_cleanup (adev->ddev); adev->mode_info.mode_config_initialized = false;return 0 ;
Greg Kroah-Hartman
maintainerPATCH 11/125 drm/amdgpu: change vblank_times calculation method to reduce computational error.
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rex Zhu <[email protected]>
commit dc8184aa8621ee8048652496884d9f40d4bb407f upstream.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c +8 -6
@@ -113,24 +113,26 @@ void amdgpu_dpm_print_ps_status(struct aprintk ("\n" ); } +u32 amdgpu_dpm_get_vblank_time (struct amdgpu_device *adev) {struct drm_device *dev = adev->ddev;struct drm_crtc *crtc;struct amdgpu_crtc *amdgpu_crtc; -u32 line_time_us, vblank_lines; +u32 vblank_in_pixels;u32 vblank_time_us =0xffffffff ;/* if the displays are off, vblank time is max */ if (adev->mode_info.num_crtc && adev->mode_info.mode_config_initialized) {list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) { amdgpu_crtc =to_amdgpu_crtc (crtc);if (crtc->enabled && amdgpu_crtc->enabled && amdgpu_crtc->hw_mode.clock) { - line_time_us = (amdgpu_crtc->hw_mode.crtc_htotal *1000 ) / - amdgpu_crtc->hw_mode.clock; - vblank_lines = amdgpu_crtc->hw_mode.crtc_vblank_end - + vblank_in_pixels = + amdgpu_crtc->hw_mode.crtc_htotal * + (amdgpu_crtc->hw_mode.crtc_vblank_end - amdgpu_crtc->hw_mode.crtc_vdisplay + - (amdgpu_crtc->v_border *2 ); - vblank_time_us = vblank_lines * line_time_us; + (amdgpu_crtc->v_border *2 )); + + vblank_time_us = vblank_in_pixels *1000 / amdgpu_crtc->hw_mode.clock;break ; } }
Greg Kroah-Hartman
maintainerPATCH 12/125 drm/radeon: narrow asic_init for virtualization
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 884031f0aacf57dad1575f96714efc80de9b19cc upstream.
Only needed on CIK+ due to the way pci reset is handled by the GPU.
--- drivers/gpu/drm/radeon/radeon_device.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/radeon_device.c +3 -2
@@ -661,8 +661,9 @@ bool radeon_card_posted(struct radeon_de {uint32_t reg; -/* for pass through, always force asic_init */ -if (radeon_device_is_virtual ()) +/* for pass through, always force asic_init for CI */ +if (rdev->family >=CHIP_BONAIRE && +radeon_device_is_virtual ())return false;/* required for EFI mode on macbook2,1 which uses an r5xx asic */
Greg Kroah-Hartman
maintainerPATCH 13/125 drm/radeon/si/dpm: fix phase shedding setup
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 427920292b00474d978d632bc03a8e4e50029af3 upstream.
Used the wrong index to setup the phase shedding mask.
--- drivers/gpu/drm/radeon/si_dpm.c | 2 +- drivers/gpu/drm/radeon/sislands_smc.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/si_dpm.c +1 -1
@@ -4112,7 +4112,7 @@ static int si_populate_smc_voltage_table &rdev->pm.dpm.dyn_state.phase_shedding_limits_table)) {si_populate_smc_voltage_table (rdev, &si_pi->vddc_phase_shed_table, table); - table->phaseMaskTable.lowMask[SISLANDS_SMC_VOLTAGEMASK_VDDC ] = + table->phaseMaskTable.lowMask[SISLANDS_SMC_VOLTAGEMASK_VDDC_PHASE_SHEDDING ] =cpu_to_be32 (si_pi->vddc_phase_shed_table.mask_low); si_write_smc_soft_register(rdev, SI_SMC_SOFT_REGISTER_phase_shedding_delay,
drivers/gpu/drm/radeon/sislands_smc.h +1 -0
@@ -194,6 +194,7 @@ typedef struct SISLANDS_SMC_SWSTATE SISL#define SISLANDS_SMC_VOLTAGEMASK_VDDC 0#define SISLANDS_SMC_VOLTAGEMASK_MVDD 1#define SISLANDS_SMC_VOLTAGEMASK_VDDCI 2 +#define SISLANDS_SMC_VOLTAGEMASK_VDDC_PHASE_SHEDDING 3#define SISLANDS_SMC_VOLTAGEMASK_MAX 4struct SISLANDS_SMC_VOLTAGEMASKTABLE
Greg Kroah-Hartman
maintainerPATCH 14/125 drm/radeon: change vblank_times calculation method to reduce computational error.
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 02cfb5fccb0f9f968f0e208d89d9769aa16267bc upstream.
Ported from Rex's amdgpu change.
--- drivers/gpu/drm/radeon/r600_dpm.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/gpu/drm/radeon/r600_dpm.c +8 -7
@@ -156,19 +156,20 @@ u32 r600_dpm_get_vblank_time(struct radestruct drm_device *dev = rdev->ddev;struct drm_crtc *crtc;struct radeon_crtc *radeon_crtc; -u32 line_time_us, vblank_lines; +u32 vblank_in_pixels;u32 vblank_time_us =0xffffffff ;/* if the displays are off, vblank time is max */ if (rdev->num_crtc && rdev->mode_info.mode_config_initialized) {list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) { radeon_crtc =to_radeon_crtc (crtc);if (crtc->enabled && radeon_crtc->enabled && radeon_crtc->hw_mode.clock) { - line_time_us = (radeon_crtc->hw_mode.crtc_htotal *1000 ) / - radeon_crtc->hw_mode.clock; - vblank_lines = radeon_crtc->hw_mode.crtc_vblank_end - - radeon_crtc->hw_mode.crtc_vdisplay + - (radeon_crtc->v_border *2 ); - vblank_time_us = vblank_lines * line_time_us; + vblank_in_pixels = + radeon_crtc->hw_mode.crtc_htotal * + (radeon_crtc->hw_mode.crtc_vblank_end - + radeon_crtc->hw_mode.crtc_vdisplay + + (radeon_crtc->v_border *2 )); + + vblank_time_us = vblank_in_pixels *1000 / radeon_crtc->hw_mode.clock;break ; } }
Greg Kroah-Hartman
maintainerPATCH 15/125 drm/vmwgfx: Limit the user-space command buffer size
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Hellstrom <[email protected]>
commit 51ab70bed997f64f091a639dbe22b629725a7faf upstream.
With older hardware versions, the user could specify arbitrarily large command buffer sizes, causing a vmalloc / vmap space exhaustion.
--- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +3 -3
@@ -3848,14 +3848,14 @@ static void *vmw_execbuf_cmdbuf(struct vint ret; *header =NULL ; -if (!dev_priv->cman || kernel_commands) -return kernel_commands; -if (command_size >SVGA_CB_MAX_SIZE ) {DRM_ERROR ("Command buffer is too large.\n" );return ERR_PTR (-EINVAL ); } +if (!dev_priv->cman || kernel_commands) +return kernel_commands; +/* If possible, add a little space for fencing. */ cmdbuf_size = command_size +512 ; cmdbuf_size =min_t (size_t, cmdbuf_size,SVGA_CB_MAX_SIZE );
Greg Kroah-Hartman
maintainerPATCH 16/125 drm/fsl-dcu: fix endian issue when using clk_register_divider
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Agner <[email protected]>
commit 6cc4758ae91c0582f07e3c94c7de1ad0975feff5 upstream.
Since using clk_register_divider to setup the pixel clock, regmap is no longer used. Regmap did take care of DCU using different endianness. Check endianness using the device-tree property "big-endian" to determine the location of DIV_RATIO.
--- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +5 -1
@@ -330,6 +330,7 @@ static int fsl_dcu_drm_probe(struct platconst char *pix_clk_in_name;const struct of_device_id *id;int ret; +u8 div_ratio_shift =0 ; fsl_dev =devm_kzalloc (dev,sizeof (*fsl_dev),GFP_KERNEL );if (!fsl_dev)
@@ -382,11 +383,14 @@ static int fsl_dcu_drm_probe(struct plat pix_clk_in = fsl_dev->clk; } +if (of_property_read_bool (dev->of_node,"big-endian" )) + div_ratio_shift =24 ; + pix_clk_in_name =__clk_get_name (pix_clk_in);snprintf (pix_clk_name,sizeof (pix_clk_name),"%s_pix" , pix_clk_in_name); fsl_dev->pix_clk =clk_register_divider (dev, pix_clk_name, pix_clk_in_name,0 , base +DCU_DIV_RATIO , -0 ,8 ,CLK_DIVIDER_ROUND_CLOSEST ,NULL ); + div_ratio_shift,8 ,CLK_DIVIDER_ROUND_CLOSEST ,NULL );if (IS_ERR (fsl_dev->pix_clk)) {dev_err (dev,"failed to register pix clk\n" ); ret =PTR_ERR (fsl_dev->pix_clk);
Greg Kroah-Hartman
maintainerPATCH 17/125 drm/amd/powerplay: fix mclk not switching back after multi-head was disabled
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rex Zhu <[email protected]>
commit 9716ebc38dfabe6c8e5e3c809e9f3c61dd3740f9 upstream.
--- drivers/gpu/drm/amd/powerplay/eventmgr/eventactionchains.c | 2 ++ drivers/gpu/drm/amd/powerplay/eventmgr/psm.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/eventmgr/eventactionchains.c +2 -0
@@ -262,6 +262,8 @@ static const pem_event_action * const di unblock_adjust_power_state_tasks, set_cpu_power_state, notify_hw_power_source_tasks, + get_2d_performance_state_tasks, + set_performance_state_tasks,/* updateDALConfigurationTasks, variBrightDisplayConfigurationChangeTasks, */ adjust_power_state_tasks,
drivers/gpu/drm/amd/powerplay/eventmgr/psm.c +2 -1
@@ -100,11 +100,12 @@ int psm_adjust_power_state_dynamic(strucif (requested ==NULL )return 0 ; +phm_apply_state_adjust_rules (hwmgr, requested, pcurrent); +if (pcurrent ==NULL || (0 !=phm_check_states_equal (hwmgr, &pcurrent->hardware, &requested->hardware, &equal))) equal = false;if (!equal ||phm_check_smc_update_required_for_display_configuration (hwmgr)) { -phm_apply_state_adjust_rules (hwmgr, requested, pcurrent);phm_set_power_state (hwmgr, &pcurrent->hardware, &requested->hardware); hwmgr->current_ps = requested; }
Greg Kroah-Hartman
maintainerPATCH 18/125 HID: add quirk for Akai MIDImix.
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steinar H. Gunderson <[email protected]>
commit 4973ca9a01e2354b159acedec1b9b8eb8de02ab7 upstream.
The Akai MIDImix (09e8:0031) is a MIDI fader controller that speaks regular MIDI and works well with Linux. However, initialization gets delayed due to reports timeout:
[3643645.631124] hid-generic 0003:09E8:0031.0020: timeout initializing reports [3643645.632416] hid-generic 0003:09E8:0031.0020: hiddev0: USB HID v1.11 Device [AKAI MIDI Mix] on usb-0000:00:14.0-2/input0
Adding "usbhid.quirks=0x09e8:0x0031:0x20000000" on the kernel command line makes the issues go away.
--- drivers/hid/hid-ids.h | 3 +++ drivers/hid/usbhid/hid-quirks.c | 1 + 2 files changed, 4 insertions(+)
drivers/hid/hid-ids.h +3 -0
@@ -64,6 +64,9 @@#define USB_VENDOR_ID_AKAI 0x2011#define USB_DEVICE_ID_AKAI_MPKMINI2 0x0715 +#define USB_VENDOR_ID_AKAI_09E8 0x09E8 +#define USB_DEVICE_ID_AKAI_09E8_MIDIMIX 0x0031 +#define USB_VENDOR_ID_ALCOR 0x058f#define USB_DEVICE_ID_ALCOR_USBRS232 0x9720
drivers/hid/usbhid/hid-quirks.c +1 -0
@@ -56,6 +56,7 @@ static const struct hid_blacklist { { USB_VENDOR_ID_AIREN, USB_DEVICE_ID_AIREN_SLIMPLUS, HID_QUIRK_NOGET }, { USB_VENDOR_ID_AKAI, USB_DEVICE_ID_AKAI_MPKMINI2, HID_QUIRK_NO_INIT_REPORTS }, + { USB_VENDOR_ID_AKAI_09E8, USB_DEVICE_ID_AKAI_09E8_MIDIMIX, HID_QUIRK_NO_INIT_REPORTS }, { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_UC100KM, HID_QUIRK_NOGET }, { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_CS124U, HID_QUIRK_NOGET }, { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_2PORTKVM, HID_QUIRK_NOGET },
Greg Kroah-Hartman
maintainerPATCH 22/125 drm/i915/skl: Dont try to update plane watermarks if they havent changed
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lyude <[email protected]>
commit ccebc23b57c313229526dc76383ce82f5e0b9001 upstream.
i915 sometimes needs to disable planes in the middle of an atomic commit, and then reenable them later in the same commit. Because of this, we can't make the assumption that the state of the plane actually changed. Since the state of the plane hasn't actually changed, neither have it's watermarks. And if the watermarks hasn't changed then we haven't populated skl_results with anything, which means we'll end up zeroing out a plane's watermarks in the middle of the atomic commit without restoring them later.
Simple reproduction recipe:
- Get a SKL laptop, launch any kind of X session
- Get two extra monitors
- Keep hotplugging both displays (so that the display configuration jumps from 1 active pipe to 3 active pipes and back)
- Eventually underrun
Changes since v1:
- Fix incorrect use of "it's"
Changes since v2:
- Add reproduction recipe
Testcase: kms_plane
--- drivers/gpu/drm/i915/intel_display.c | 7 ++++++- drivers/gpu/drm/i915/intel_sprite.c | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +6 -1
@@ -3068,7 +3068,12 @@ static void skylake_disable_primary_planstruct intel_crtc *intel_crtc =to_intel_crtc (crtc);int pipe = intel_crtc->pipe; -skl_write_plane_wm (intel_crtc, &dev_priv->wm.skl_results,0 ); +/* +* We only populate skl_results on watermark updates, and if the +* plane's visiblity isn't actually changing neither is its watermarks. +*/ +if (!to_intel_plane_state (crtc->primary->state)->visible) +skl_write_plane_wm (intel_crtc, &dev_priv->wm.skl_results,0 );I915_WRITE (PLANE_CTL (pipe,0 ),0 );I915_WRITE (PLANE_SURF (pipe,0 ),0 );
drivers/gpu/drm/i915/intel_sprite.c +8 -0
@@ -314,6 +314,14 @@ skl_disable_plane(struct drm_plane *dplaconst int pipe = intel_plane->pipe;const int plane = intel_plane->plane +1 ; +/* +* We only populate skl_results on watermark updates, and if the +* plane's visiblity isn't actually changing neither is its watermarks. +*/ +if (!to_intel_plane_state (dplane->state)->visible) +skl_write_plane_wm (to_intel_crtc (crtc), + &dev_priv->wm.skl_results, plane); +I915_WRITE (PLANE_CTL (pipe, plane),0 );I915_WRITE (PLANE_SURF (pipe, plane),0 );
Greg Kroah-Hartman
maintainerPATCH 23/125 drm/i915/gen9: only add the planes actually affected by ddb changes
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Zanoni <[email protected]>
commit be5c571b2ff3a164d2e14ccc100cb5b2b3d3fb7c upstream.
We were previously adding all the planes owned by the CRTC even when the ddb partitioning didn't change for them. As a consequence, a lot of functions were being called when we were just moving the cursor around the screen, such as skylake_update_primary_plane().
This was causing flickering on the primary plane when moving the cursor. I'm not 100% sure which operation caused the flickering, but we were writing to a lot of registers, so it could be any of these writes. With this patch, just moving the mouse won't add the primary plane to the commit since it won't trigger a change in DDB partitioning.
v2: Use skl_ddb_entry_equal() (Lyude).
v3: Change Reported-and-bisected-by: to Reported-by: for checkpatch
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97888
--- drivers/gpu/drm/i915/intel_pm.c | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_pm.c +36 -1
@@ -3940,6 +3940,41 @@ pipes_modified(struct drm_atomic_state *return ret; } +int +skl_ddb_add_affected_planes (struct intel_crtc_state *cstate) +{ +struct drm_atomic_state *state = cstate->base.state; +struct drm_device *dev = state->dev; +struct drm_crtc *crtc = cstate->base.crtc; +struct intel_crtc *intel_crtc =to_intel_crtc (crtc); +struct drm_i915_private *dev_priv =to_i915 (dev); +struct intel_atomic_state *intel_state =to_intel_atomic_state (state); +struct skl_ddb_allocation *new_ddb = &intel_state->wm_results.ddb; +struct skl_ddb_allocation *cur_ddb = &dev_priv->wm.skl_hw.ddb; +struct drm_plane_state *plane_state; +struct drm_plane *plane; +enum pipe pipe = intel_crtc->pipe; +int id; + +WARN_ON (!drm_atomic_get_existing_crtc_state (state, crtc)); + +drm_for_each_plane_mask (plane, dev, crtc->state->plane_mask) { + id =skl_wm_plane_id (to_intel_plane (plane)); + +if (skl_ddb_entry_equal (&cur_ddb->plane[pipe][id], + &new_ddb->plane[pipe][id]) && +skl_ddb_entry_equal (&cur_ddb->y_plane[pipe][id], + &new_ddb->y_plane[pipe][id])) +continue ; + + plane_state =drm_atomic_get_plane_state (state, plane); +if (IS_ERR (plane_state)) +return PTR_ERR (plane_state); + } + +return 0 ; +} +static int skl_compute_ddb (struct drm_atomic_state *state) {
@@ -4004,7 +4039,7 @@ skl_compute_ddb(struct drm_atomic_stateif (ret)return ret; - ret =drm_atomic_add_affected_planes (state, &intel_crtc->base); + ret =skl_ddb_add_affected_planes (cstate);if (ret)return ret; }
Greg Kroah-Hartman
maintainerPATCH 24/125 drm/i915/gen9: fix the WaWmMemoryReadLatency implementation
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Zanoni <[email protected]>
commit 4e4d3814a9bb4d71cd3ff0701d8d7041edefd8f0 upstream.
Bspec says:
"The mailbox response data may not account for memory read latency.
If the mailbox response data for level 0 is 0us, add 2 microseconds to the result for each valid level."
This means we should only do the +2 in case wm[0] == 0, not always.
So split the sanitizing implementation from the WA implementation and fix the WA implementation.
v2: Add Fixes tag (Maarten).
--- drivers/gpu/drm/i915/intel_pm.c | 42 ++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +22 -20
@@ -2119,32 +2119,34 @@ static void intel_read_wm_latency(structGEN9_MEM_LATENCY_LEVEL_MASK ;/* +* If a level n (n > 1) has a 0us latency, all levels m (m >= n) +* need to be disabled. We make sure to sanitize the values out +* of the punit to satisfy this requirement. +*/ +for (level =1 ; level <= max_level; level++) { +if (wm[level] ==0 ) { +for (i = level +1 ; i <= max_level; i++) + wm[i] =0 ; +break ; + } + } + +/* * WaWmMemoryReadLatency:skl * * punit doesn't take into account the read latency so we need -* to add 2us to the various latency levels we retrieve from -* the punit. -* - W0 is a bit special in that it's the only level that -* can't be disabled if we want to have display working, so -* we always add 2us there. -* - For levels >=1, punit returns 0us latency when they are -* disabled, so we respect that and don't add 2us then -* -* Additionally, if a level n (n > 1) has a 0us latency, all -* levels m (m >= n) need to be disabled. We make sure to -* sanitize the values out of the punit to satisfy this -* requirement. +* to add 2us to the various latency levels we retrieve from the +* punit when level 0 response data us 0us. */ - wm[0 ] +=2 ; -for (level =1 ; level <= max_level; level++) -if (wm[level] !=0 ) +if (wm[0 ] ==0 ) { + wm[0 ] +=2 ; +for (level =1 ; level <= max_level; level++) { +if (wm[level] ==0 ) +break ; wm[level] +=2 ; -else { -for (i = level +1 ; i <= max_level; i++) - wm[i] =0 ; - -break ; } + } + }else if (IS_HASWELL (dev) ||IS_BROADWELL (dev)) {uint64_t sskpd =I915_READ64 (MCH_SSKPD );
Greg Kroah-Hartman
maintainerPATCH 25/125 drm/i915/gen9: minimum scanlines for Y tile is not always 4
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Zanoni <[email protected]>
commit ccc1057477bc99678896b51adce6b6ee4019dc37 upstream.
During watermarks calculations, this value is used in 3 different places. Only one of them was not using a hardcoded 4. Move the code up so everybody can benefit from the actual value.
This should only help on situations with Y tiling + 90/270 rotation + 1 or 2 bpp or NV12.
--- drivers/gpu/drm/i915/intel_pm.c | 56 ++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 24 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +32 -24
@@ -3476,7 +3476,8 @@ static uint32_t skl_wm_method1(uint32_tstatic uint32_t skl_wm_method2 (uint32_t pixel_rate,uint32_t pipe_htotal,uint32_t horiz_pixels,uint8_t cpp, -uint64_t tiling,uint32_t latency) +uint64_t tiling,uint32_t latency, +uint32_t y_min_scanlines) {uint32_t ret;uint32_t plane_bytes_per_line, plane_blocks_per_line;
@@ -3489,9 +3490,9 @@ static uint32_t skl_wm_method2(uint32_tif (tiling ==I915_FORMAT_MOD_Y_TILED || tiling == I915_FORMAT_MOD_Yf_TILED) { - plane_bytes_per_line *=4 ; + plane_bytes_per_line *= y_min_scanlines; plane_blocks_per_line =DIV_ROUND_UP (plane_bytes_per_line,512 ); - plane_blocks_per_line /=4 ; + plane_blocks_per_line /= y_min_scanlines; }else if (tiling ==DRM_FORMAT_MOD_NONE ) { plane_blocks_per_line =DIV_ROUND_UP (plane_bytes_per_line,512 ) +1 ; }else {
@@ -3548,6 +3549,7 @@ static int skl_compute_plane_wm(const stuint8_t cpp;uint32_t width =0 , height =0 ;uint32_t plane_pixel_rate; +uint32_t y_min_scanlines;if (latency ==0 || !cstate->base.active || !intel_pstate->visible) { *enabled = false;
@@ -3563,38 +3565,44 @@ static int skl_compute_plane_wm(const st cpp =drm_format_plane_cpp (fb->pixel_format,0 ); plane_pixel_rate =skl_adjusted_plane_pixel_rate (cstate, intel_pstate); +if (intel_rotation_90_or_270 (pstate->rotation)) { +int cpp = (fb->pixel_format ==DRM_FORMAT_NV12 ) ? +drm_format_plane_cpp (fb->pixel_format,1 ) : +drm_format_plane_cpp (fb->pixel_format,0 ); + +switch (cpp) { +case 1 : + y_min_scanlines =16 ; +break ; +case 2 : + y_min_scanlines =8 ; +break ; +default : +WARN (1 ,"Unsupported pixel depth for rotation" ); +case 4 : + y_min_scanlines =4 ; +break ; + } + }else { + y_min_scanlines =4 ; + } + method1 =skl_wm_method1 (plane_pixel_rate, cpp, latency); method2 =skl_wm_method2 (plane_pixel_rate, cstate->base.adjusted_mode.crtc_htotal, width, cpp, fb->modifier[0 ], - latency); + latency, + y_min_scanlines); plane_bytes_per_line = width * cpp; plane_blocks_per_line =DIV_ROUND_UP (plane_bytes_per_line,512 );if (fb->modifier[0 ] ==I915_FORMAT_MOD_Y_TILED || fb->modifier[0 ] == I915_FORMAT_MOD_Yf_TILED) { -uint32_t min_scanlines =4 ; -uint32_t y_tile_minimum; -if (intel_rotation_90_or_270 (pstate->rotation)) { -int cpp = (fb->pixel_format ==DRM_FORMAT_NV12 ) ? -drm_format_plane_cpp (fb->pixel_format,1 ) : -drm_format_plane_cpp (fb->pixel_format,0 ); - -switch (cpp) { -case 1 : - min_scanlines =16 ; -break ; -case 2 : - min_scanlines =8 ; -break ; -case 8 : -WARN (1 ,"Unsupported pixel depth for rotation" ); - } - } - y_tile_minimum = plane_blocks_per_line * min_scanlines; +uint32_t y_tile_minimum = plane_blocks_per_line * + y_min_scanlines; selected_result =max (method2, y_tile_minimum); }else {if ((ddb_allocation / plane_blocks_per_line) >=1 )
@@ -3609,7 +3617,7 @@ static int skl_compute_plane_wm(const stif (level >=1 && level <=7 ) {if (fb->modifier[0 ] ==I915_FORMAT_MOD_Y_TILED || fb->modifier[0 ] == I915_FORMAT_MOD_Yf_TILED) - res_lines +=4 ; + res_lines += y_min_scanlines;else res_blocks++; }
Greg Kroah-Hartman
maintainerPATCH 26/125 drm/i915/gen9: fix plane_blocks_per_line on watermarks calculations
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Zanoni <[email protected]>
commit cf6c525a31fac11b0775b8c06c00a508c6356d9b upstream.
The confusing thing is that plane_blocks_per_line is listed as part of the method 2 calculation but is also used for other things. We calculated it in two different places and different ways: one inside skl_wm_method2() and the other inside skl_compute_plane_wm(). The skl_wm_method2() implementation is the one that matches the specification.
With this patch we fix the skl_compute_plane_wm() calculation and just pass it as a parameter to skl_wm_method2(). We also take care to not modify the value of plane_bytes_per_line since we're going to rely on it having a correct value in later patches.
This should affect the watermarks for Linear and Y-tiled.
Quoted 1 line
Quoted 1 line
From my analysis, it looks like the two
plane_blocks_per_line
variables got out of sync on 0fda65680e92, but we can't really say that commit was a regression, it looks like just an incomplete fix. There's always the possibility that 0fda65680e92 matched our specification at that time, and then later the specification changed.
v2: Try to add a "Fixes" tag (Maarten).
--- drivers/gpu/drm/i915/intel_pm.c | 39 +++++++++++++++------------------------ 1 file changed, 15 insertions(+), 24 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +15 -24
@@ -3475,30 +3475,14 @@ static uint32_t skl_wm_method1(uint32_t }static uint32_t skl_wm_method2 (uint32_t pixel_rate,uint32_t pipe_htotal, -uint32_t horiz_pixels,uint8_t cpp, -uint64_t tiling,uint32_t latency, -uint32_t y_min_scanlines) +uint32_t latency,uint32_t plane_blocks_per_line) {uint32_t ret; -uint32_t plane_bytes_per_line, plane_blocks_per_line;uint32_t wm_intermediate_val;if (latency ==0 )return UINT_MAX ; - plane_bytes_per_line = horiz_pixels * cpp; - -if (tiling ==I915_FORMAT_MOD_Y_TILED || - tiling == I915_FORMAT_MOD_Yf_TILED) { - plane_bytes_per_line *= y_min_scanlines; - plane_blocks_per_line =DIV_ROUND_UP (plane_bytes_per_line,512 ); - plane_blocks_per_line /= y_min_scanlines; - }else if (tiling ==DRM_FORMAT_MOD_NONE ) { - plane_blocks_per_line =DIV_ROUND_UP (plane_bytes_per_line,512 ) +1 ; - }else { - plane_blocks_per_line =DIV_ROUND_UP (plane_bytes_per_line,512 ); - } - wm_intermediate_val = latency * pixel_rate; ret =DIV_ROUND_UP (wm_intermediate_val, pipe_htotal *1000 ) * plane_blocks_per_line;
@@ -3587,17 +3571,24 @@ static int skl_compute_plane_wm(const st y_min_scanlines =4 ; } + plane_bytes_per_line = width * cpp; +if (fb->modifier[0 ] ==I915_FORMAT_MOD_Y_TILED || + fb->modifier[0 ] == I915_FORMAT_MOD_Yf_TILED) { + plane_blocks_per_line = +DIV_ROUND_UP (plane_bytes_per_line * y_min_scanlines,512 ); + plane_blocks_per_line /= y_min_scanlines; + }else if (fb->modifier[0 ] ==DRM_FORMAT_MOD_NONE ) { + plane_blocks_per_line =DIV_ROUND_UP (plane_bytes_per_line,512 ) + +1 ; + }else { + plane_blocks_per_line =DIV_ROUND_UP (plane_bytes_per_line,512 ); + } + method1 =skl_wm_method1 (plane_pixel_rate, cpp, latency); method2 =skl_wm_method2 (plane_pixel_rate, cstate->base.adjusted_mode.crtc_htotal, - width, - cpp, - fb->modifier[0 ], latency, - y_min_scanlines); - - plane_bytes_per_line = width * cpp; - plane_blocks_per_line =DIV_ROUND_UP (plane_bytes_per_line,512 ); + plane_blocks_per_line);if (fb->modifier[0 ] ==I915_FORMAT_MOD_Y_TILED || fb->modifier[0 ] == I915_FORMAT_MOD_Yf_TILED) {
Greg Kroah-Hartman
maintainerPATCH 27/125 drm/i915/gen9: fix the watermark res_blocks value
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Zanoni <[email protected]>
commit 73fed0ef8567f1e1cba079994353e60208ded964 upstream.
We forgot the "res_blocks += y_tile_minimum" that's described on step V of our documentation.
Again, this should only affect the Y tiling cases.
It looks like the relevant code was introduced in 0fda65680e92, but there's always the possibility that it matched our specification when it was introduced, and then the specification changed while the code stayed the same. So we can't really say this was a regression, but let's try to add a "Fixes" tag anyway to help backporting.
v2: Try to add a "Fixes" tag (Maarten).
--- drivers/gpu/drm/i915/intel_pm.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +7 -5
@@ -3533,7 +3533,7 @@ static int skl_compute_plane_wm(const stuint8_t cpp;uint32_t width =0 , height =0 ;uint32_t plane_pixel_rate; -uint32_t y_min_scanlines; +uint32_t y_tile_minimum, y_min_scanlines;if (latency ==0 || !cstate->base.active || !intel_pstate->visible) { *enabled = false;
@@ -3590,10 +3590,10 @@ static int skl_compute_plane_wm(const st latency, plane_blocks_per_line); + y_tile_minimum = plane_blocks_per_line * y_min_scanlines; +if (fb->modifier[0 ] ==I915_FORMAT_MOD_Y_TILED || fb->modifier[0 ] == I915_FORMAT_MOD_Yf_TILED) { -uint32_t y_tile_minimum = plane_blocks_per_line * - y_min_scanlines; selected_result =max (method2, y_tile_minimum); }else {if ((ddb_allocation / plane_blocks_per_line) >=1 )
@@ -3607,10 +3607,12 @@ static int skl_compute_plane_wm(const stif (level >=1 && level <=7 ) {if (fb->modifier[0 ] ==I915_FORMAT_MOD_Y_TILED || - fb->modifier[0 ] == I915_FORMAT_MOD_Yf_TILED) + fb->modifier[0 ] == I915_FORMAT_MOD_Yf_TILED) { + res_blocks += y_tile_minimum; res_lines += y_min_scanlines; -else + }else { res_blocks++; + } }if (res_blocks >= ddb_allocation || res_lines >31 ) {
Greg Kroah-Hartman
maintainerPATCH 28/125 drm/i915: SAGV is not SKL-only, so rename a few things
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Zanoni <[email protected]>
commit 674f823b455cdb94d5773406c1caac170f87e1c4 upstream.
The plan is to introduce intel_has_sagv() and then use it to discover which platforms actually support it.
I thought about keeping the functions with their current skl names, but found two problems: (i) skl_has_sagv() would become a very confusing name, and (ii) intel_atomic_commit_tail() doesn't seem to be calling any functions whose name start with a platform name, so the "intel_" naming scheme seems make more sense than the "firstplatorm_" naming scheme here.
--- drivers/gpu/drm/i915/i915_drv.h | 10 +++++----- drivers/gpu/drm/i915/intel_display.c | 8 ++++---- drivers/gpu/drm/i915/intel_drv.h | 6 +++--- drivers/gpu/drm/i915/intel_pm.c | 26 +++++++++++++------------- 4 files changed, 25 insertions(+), 25 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +5 -5
@@ -1967,11 +1967,11 @@ struct drm_i915_private {struct vlv_s0ix_state vlv_s0ix_state;enum { -I915_SKL_SAGV_UNKNOWN =0 , -I915_SKL_SAGV_DISABLED , -I915_SKL_SAGV_ENABLED , -I915_SKL_SAGV_NOT_CONTROLLED - } skl_sagv_status; +I915_SAGV_UNKNOWN =0 , +I915_SAGV_DISABLED , +I915_SAGV_ENABLED , +I915_SAGV_NOT_CONTROLLED + } sagv_status;struct {/*
drivers/gpu/drm/i915/intel_display.c +4 -4
@@ -13891,8 +13891,8 @@ static void intel_atomic_commit_tail(str* SKL workaround: bspec recommends we disable the SAGV when we * have more then one pipe enabled */ -if (IS_SKYLAKE (dev_priv) && !skl_can_enable_sagv (state)) -skl_disable_sagv (dev_priv); +if (IS_SKYLAKE (dev_priv) && !intel_can_enable_sagv (state)) +intel_disable_sagv (dev_priv);intel_modeset_verify_disabled (dev); }
@@ -13950,8 +13950,8 @@ static void intel_atomic_commit_tail(str }if (IS_SKYLAKE (dev_priv) && intel_state->modeset && -skl_can_enable_sagv (state)) -skl_enable_sagv (dev_priv); +intel_can_enable_sagv (state)) +intel_enable_sagv (dev_priv);drm_atomic_helper_commit_hw_done (state);
drivers/gpu/drm/i915/intel_drv.h +3 -3
@@ -1717,9 +1717,9 @@ void ilk_wm_get_hw_state(struct drm_devivoid skl_wm_get_hw_state (struct drm_device *dev);void skl_ddb_get_hw_state (struct drm_i915_private *dev_priv,struct skl_ddb_allocation *ddb/* out */ ); -bool skl_can_enable_sagv (struct drm_atomic_state *state); -int skl_enable_sagv (struct drm_i915_private *dev_priv); -int skl_disable_sagv (struct drm_i915_private *dev_priv); +bool intel_can_enable_sagv (struct drm_atomic_state *state); +int intel_enable_sagv (struct drm_i915_private *dev_priv); +int intel_disable_sagv (struct drm_i915_private *dev_priv);bool skl_ddb_allocation_equals (const struct skl_ddb_allocation *old,const struct skl_ddb_allocation *new,enum pipe pipe);
drivers/gpu/drm/i915/intel_pm.c +13 -13
@@ -2890,12 +2890,12 @@ skl_wm_plane_id(const struct intel_plane* - We're not using an interlaced display configuration */ int -skl_enable_sagv (struct drm_i915_private *dev_priv) +intel_enable_sagv (struct drm_i915_private *dev_priv) {int ret; -if (dev_priv->skl_sagv_status ==I915_SKL_SAGV_NOT_CONTROLLED || - dev_priv->skl_sagv_status ==I915_SKL_SAGV_ENABLED ) +if (dev_priv->sagv_status ==I915_SAGV_NOT_CONTROLLED || + dev_priv->sagv_status ==I915_SAGV_ENABLED )return 0 ;DRM_DEBUG_KMS ("Enabling the SAGV\n" );
@@ -2913,19 +2913,19 @@ skl_enable_sagv(struct drm_i915_private*/ if (ret == -ENXIO ) {DRM_DEBUG_DRIVER ("No SAGV found on system, ignoring\n" ); - dev_priv->skl_sagv_status =I915_SKL_SAGV_NOT_CONTROLLED ; + dev_priv->sagv_status =I915_SAGV_NOT_CONTROLLED ;return 0 ; }else if (ret <0 ) {DRM_ERROR ("Failed to enable the SAGV\n" );return ret; } - dev_priv->skl_sagv_status =I915_SKL_SAGV_ENABLED ; + dev_priv->sagv_status =I915_SAGV_ENABLED ;return 0 ; }static int -skl_do_sagv_disable (struct drm_i915_private *dev_priv) +intel_do_sagv_disable (struct drm_i915_private *dev_priv) {int ret;uint32_t temp =GEN9_SAGV_DISABLE ;
@@ -2939,19 +2939,19 @@ skl_do_sagv_disable(struct drm_i915_priv }int -skl_disable_sagv (struct drm_i915_private *dev_priv) +intel_disable_sagv (struct drm_i915_private *dev_priv) {int ret, result; -if (dev_priv->skl_sagv_status ==I915_SKL_SAGV_NOT_CONTROLLED || - dev_priv->skl_sagv_status ==I915_SKL_SAGV_DISABLED ) +if (dev_priv->sagv_status ==I915_SAGV_NOT_CONTROLLED || + dev_priv->sagv_status ==I915_SAGV_DISABLED )return 0 ;DRM_DEBUG_KMS ("Disabling the SAGV\n" );mutex_lock (&dev_priv->rps.hw_lock);/* bspec says to keep retrying for at least 1 ms */ - ret =wait_for (result =skl_do_sagv_disable (dev_priv),1 ); + ret =wait_for (result =intel_do_sagv_disable (dev_priv),1 );mutex_unlock (&dev_priv->rps.hw_lock);if (ret == -ETIMEDOUT ) {
@@ -2965,18 +2965,18 @@ skl_disable_sagv(struct drm_i915_private*/ if (result == -ENXIO ) {DRM_DEBUG_DRIVER ("No SAGV found on system, ignoring\n" ); - dev_priv->skl_sagv_status =I915_SKL_SAGV_NOT_CONTROLLED ; + dev_priv->sagv_status =I915_SAGV_NOT_CONTROLLED ;return 0 ; }else if (result <0 ) {DRM_ERROR ("Failed to disable the SAGV\n" );return result; } - dev_priv->skl_sagv_status =I915_SKL_SAGV_DISABLED ; + dev_priv->sagv_status =I915_SAGV_DISABLED ;return 0 ; } -bool skl_can_enable_sagv (struct drm_atomic_state *state) +bool intel_can_enable_sagv (struct drm_atomic_state *state) {struct drm_device *dev = state->dev;struct drm_i915_private *dev_priv =to_i915 (dev);
Greg Kroah-Hartman
maintainerPATCH 29/125 drm/i915: introduce intel_has_sagv()
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Zanoni <[email protected]>
commit 6e7fdb873d6255ca3c999dd5c6c18962a769ed3e upstream.
And use it to move knowledge about the SAGV-supporting platforms from the callers to the SAGV code.
We'll add more platforms to intel_has_sagv(), so IMHO it makes more sense to move all this to a single function instead of patching all the callers every time we add SAGV support to a new platform.
v2: Move I915_SAGV_NOT_CONTROLLED to the new function (Lyude).
--- drivers/gpu/drm/i915/intel_display.c | 5 ++--- drivers/gpu/drm/i915/intel_pm.c | 22 ++++++++++++++++++---- 2 files changed, 20 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/intel_display.c +2 -3
@@ -13891,7 +13891,7 @@ static void intel_atomic_commit_tail(str* SKL workaround: bspec recommends we disable the SAGV when we * have more then one pipe enabled */ -if (IS_SKYLAKE (dev_priv) && !intel_can_enable_sagv (state)) +if (!intel_can_enable_sagv (state))intel_disable_sagv (dev_priv);intel_modeset_verify_disabled (dev);
@@ -13949,8 +13949,7 @@ static void intel_atomic_commit_tail(strintel_modeset_verify_crtc (crtc, old_crtc_state, crtc->state); } -if (IS_SKYLAKE (dev_priv) && intel_state->modeset && -intel_can_enable_sagv (state)) +if (intel_state->modeset &&intel_can_enable_sagv (state))intel_enable_sagv (dev_priv);drm_atomic_helper_commit_hw_done (state);
drivers/gpu/drm/i915/intel_pm.c +18 -4
@@ -2878,6 +2878,13 @@ skl_wm_plane_id(const struct intel_plane } } +static bool +intel_has_sagv (struct drm_i915_private *dev_priv) +{ +return IS_SKYLAKE (dev_priv) && + dev_priv->sagv_status !=I915_SAGV_NOT_CONTROLLED ; +} +/* * SAGV dynamically adjusts the system agent voltage and clock frequencies * depending on power and performance requirements. The display engine access
@@ -2894,8 +2901,10 @@ intel_enable_sagv(struct drm_i915_privat {int ret; -if (dev_priv->sagv_status ==I915_SAGV_NOT_CONTROLLED || - dev_priv->sagv_status ==I915_SAGV_ENABLED ) +if (!intel_has_sagv (dev_priv)) +return 0 ; + +if (dev_priv->sagv_status ==I915_SAGV_ENABLED )return 0 ;DRM_DEBUG_KMS ("Enabling the SAGV\n" );
@@ -2943,8 +2952,10 @@ intel_disable_sagv(struct drm_i915_priva {int ret, result; -if (dev_priv->sagv_status ==I915_SAGV_NOT_CONTROLLED || - dev_priv->sagv_status ==I915_SAGV_DISABLED ) +if (!intel_has_sagv (dev_priv)) +return 0 ; + +if (dev_priv->sagv_status ==I915_SAGV_DISABLED )return 0 ;DRM_DEBUG_KMS ("Disabling the SAGV\n" );
@@ -2985,6 +2996,9 @@ bool intel_can_enable_sagv(struct drm_atenum pipe pipe;int level, plane; +if (!intel_has_sagv (dev_priv)) +return false; +/* * SKL workaround: bspec recommends we disable the SAGV when we have * more then one pipe enabled
Greg Kroah-Hartman
maintainerPATCH 30/125 drm/i915/kbl: KBL also needs to run the SAGV code
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Zanoni <[email protected]>
commit 17777d61f4a87d7b6d5585e8fdffa83773c594e7 upstream.
According to BSpec, it's the "core CPUs" that need the code, which means SKL and KBL, but not BXT.
I don't have a KBL to test this patch on it.
v2: Only SKL should have I915_SAGV_NOT_CONTROLLED.
--- drivers/gpu/drm/i915/intel_pm.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +10 -4
@@ -2881,8 +2881,14 @@ skl_wm_plane_id(const struct intel_planestatic bool intel_has_sagv (struct drm_i915_private *dev_priv) { -return IS_SKYLAKE (dev_priv) && - dev_priv->sagv_status !=I915_SAGV_NOT_CONTROLLED ; +if (IS_KABYLAKE (dev_priv)) +return true; + +if (IS_SKYLAKE (dev_priv) && + dev_priv->sagv_status !=I915_SAGV_NOT_CONTROLLED ) +return true; + +return false; }/*
@@ -2920,7 +2926,7 @@ intel_enable_sagv(struct drm_i915_privat* Some skl systems, pre-release machines in particular, * don't actually have an SAGV. */ -if (ret == -ENXIO ) { +if (IS_SKYLAKE (dev_priv) && ret == -ENXIO ) {DRM_DEBUG_DRIVER ("No SAGV found on system, ignoring\n" ); dev_priv->sagv_status =I915_SAGV_NOT_CONTROLLED ;return 0 ;
@@ -2974,7 +2980,7 @@ intel_disable_sagv(struct drm_i915_priva* Some skl systems, pre-release machines in particular, * don't actually have an SAGV. */ -if (result == -ENXIO ) { +if (IS_SKYLAKE (dev_priv) && result == -ENXIO ) {DRM_DEBUG_DRIVER ("No SAGV found on system, ignoring\n" ); dev_priv->sagv_status =I915_SAGV_NOT_CONTROLLED ;return 0 ;
Greg Kroah-Hartman
maintainerPATCH 31/125 Revert "drm/i915: Check live status before reading edid"
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Weinehall <[email protected]>
commit 23f889bdf6ee5cfff012d8b09f6bec920c691696 upstream.
This reverts commit 237ed86c693d8a8e4db476976aeb30df4deac74b.
Our current implementation of live status check (repeat 9 times with 10ms delays between each attempt as a workaround for buggy displays) imposes a rather serious penalty, time wise, on intel_hdmi_detect(). Since we we already skip live status checks on platforms before gen 7, and since we seem to have coped quite well before the live status check was introduced for newer platforms too, the previous behaviour is probably preferable, at least unless someone can point to a use-case that the live status check improves (apart from "Bspec says so".)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97139
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94014
--- drivers/gpu/drm/i915/intel_dp.c | 2 - drivers/gpu/drm/i915/intel_drv.h | 2 - drivers/gpu/drm/i915/intel_hdmi.c | 43 ++++++++------------------------------ 3 files changed, 11 insertions(+), 36 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +1 -1
@@ -4148,7 +4148,7 @@ static bool bxt_digital_port_connected(s* * Return %true if @port is connected, %false otherwise. */ -bool intel_digital_port_connected (struct drm_i915_private *dev_priv, +static bool intel_digital_port_connected (struct drm_i915_private *dev_priv,struct intel_digital_port *port) {if (HAS_PCH_IBX (dev_priv))
drivers/gpu/drm/i915/intel_drv.h +0 -2
@@ -1388,8 +1388,6 @@ void intel_edp_drrs_disable(struct intelvoid intel_edp_drrs_invalidate (struct drm_device *dev,unsigned frontbuffer_bits);void intel_edp_drrs_flush (struct drm_device *dev,unsigned frontbuffer_bits); -bool intel_digital_port_connected (struct drm_i915_private *dev_priv, -struct intel_digital_port *port); void intel_dp_program_link_training_pattern(struct intel_dp *intel_dp,
drivers/gpu/drm/i915/intel_hdmi.c +10 -33
78 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 37/125 drm/i915: Just clear the mmiodebug before a register access
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Wilson <[email protected]>
commit f856f847b22c52be82f712ea6ada946c6db884d7 upstream.
When we enable the per-register access mmiodebug, it is to detect which access is illegal. Reporting on earlier untraced access outside of the mmiodebug does not help debugging (as the suspicion is immediately put upon the current register which is not at fault)!
References: https://bugs.freedesktop.org/show_bug.cgi?id=97985
--- drivers/gpu/drm/i915/intel_uncore.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_uncore.c +3 -4
@@ -796,10 +796,9 @@ __unclaimed_reg_debug(struct drm_i915_pr const bool read, const bool before) { - if (WARN(check_for_unclaimed_mmio(dev_priv), - "Unclaimed register detected %s %s register 0x%x\n", - before ? "before" : "after", - read ? "reading" : "writing to", + if (WARN(check_for_unclaimed_mmio(dev_priv) && !before, + "Unclaimed %s register 0x%x\n", + read ? "read from" : "write to", i915_mmio_reg_offset(reg))) i915.mmio_debug--; /* Only report the first N failures */ }
Greg Kroah-Hartman
maintainerPATCH 38/125 drm/i915: Unalias obj->phys_handle and obj->userptr
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Wilson <[email protected]>
commit ca5732c53bf66ad755284786897e0dd10330de87 upstream.
We use obj->phys_handle to choose the pread/pwrite path, but as obj->phys_handle is a union with obj->userptr, we then mistakenly use the phys_handle path for userptr objects within pread/pwrite.
Testcase: igt/gem_userptr_blits/forbidden-operations
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97519
--- drivers/gpu/drm/i915/i915_drv.h | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +11 -13
@@ -2282,21 +2282,19 @@ struct drm_i915_gem_object {/** Record of address bit 17 of each page at last unbind. */ unsigned long *bit_17; -union { -/** for phy allocated objects */ -struct drm_dma_handle *phys_handle; - -struct i915_gem_userptr { -uintptr_t ptr; -unsigned read_only :1 ; -unsigned workers :4 ; +struct i915_gem_userptr { +uintptr_t ptr; +unsigned read_only :1 ; +unsigned workers :4 ;#define I915_GEM_USERPTR_MAX_WORKERS 15 -struct i915_mm_struct *mm; -struct i915_mmu_object *mmu_object; -struct work_struct *work; - } userptr; - }; +struct i915_mm_struct *mm; +struct i915_mmu_object *mmu_object; +struct work_struct *work; + } userptr; + +/** for phys allocated objects */ +struct drm_dma_handle *phys_handle; };#define to_intel_bo (x) container_of(x, struct drm_i915_gem_object, base)
Greg Kroah-Hartman
maintainerPATCH 39/125 posix_acl: Clear SGID bit when setting file permissions
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <[email protected]>
commit 073931017b49d9458aa351605b43a7e34598caef upstream.
When file permissions are modified via chmod(2) and the user is not in the owning group or capable of CAP_FSETID, the setgid bit is cleared in inode_change_ok(). Setting a POSIX ACL via setxattr(2) sets the file permissions as well as the new ACL, but doesn't clear the setgid bit in a similar way; this allows to bypass the check in chmod(2). Fix that.
References: CVE-2016-7097
--- fs/9p/acl.c | 40 +++++++++++++++++----------------------- fs/btrfs/acl.c | 6 ++---- fs/ceph/acl.c | 6 ++---- fs/ext2/acl.c | 12 ++++-------- fs/ext4/acl.c | 12 ++++-------- fs/f2fs/acl.c | 6 ++---- fs/gfs2/acl.c | 12 +++--------- fs/hfsplus/posix_acl.c | 4 ++-- fs/jffs2/acl.c | 9 ++++----- fs/jfs/acl.c | 6 ++---- fs/ocfs2/acl.c | 10 ++++------ fs/orangefs/acl.c | 15 +++++---------- fs/posix_acl.c | 31 +++++++++++++++++++++++++++++++ fs/reiserfs/xattr_acl.c | 8 ++------ fs/xfs/xfs_acl.c | 13 ++++--------- include/linux/posix_acl.h | 1 + 16 files changed, 89 insertions(+), 102 deletions(-)
fs/9p/acl.c +17 -23
@@ -276,32 +276,26 @@ static int v9fs_xattr_set_acl(const struswitch (handler->flags) {case ACL_TYPE_ACCESS :if (acl) { -umode_t mode = inode->i_mode; - retval =posix_acl_equiv_mode (acl, &mode); -if (retval <0 ) +struct iattr iattr; + + retval =posix_acl_update_mode (inode, &iattr.ia_mode, &acl); +if (retval) goto err_out; -else { -struct iattr iattr; -if (retval ==0 ) { -/* -* ACL can be represented -* by the mode bits. So don't -* update ACL. -*/ - acl =NULL ; - value =NULL ; - size =0 ; - } -/* Updte the mode bits */ - iattr.ia_mode = ((mode &S_IALLUGO ) | - (inode->i_mode & ~S_IALLUGO )); - iattr.ia_valid =ATTR_MODE ; -/* FIXME should we update ctime ? -* What is the following setxattr update the -* mode ? +if (!acl) { +/* +* ACL can be represented +* by the mode bits. So don't +* update ACL. */ -v9fs_vfs_setattr_dotl (dentry, &iattr); + value =NULL ; + size =0 ; } + iattr.ia_valid =ATTR_MODE ; +/* FIXME should we update ctime ? +* What is the following setxattr update the +* mode ? +*/ +v9fs_vfs_setattr_dotl (dentry, &iattr); }break ;case ACL_TYPE_DEFAULT :
fs/btrfs/acl.c +2 -4
@@ -79,11 +79,9 @@ static int __btrfs_set_acl(struct btrfs_case ACL_TYPE_ACCESS : name =XATTR_NAME_POSIX_ACL_ACCESS ;if (acl) { - ret =posix_acl_equiv_mode (acl, &inode->i_mode); -if (ret <0 ) + ret =posix_acl_update_mode (inode, &inode->i_mode, &acl); +if (ret)return ret; -if (ret ==0 ) - acl =NULL ; } ret =0 ;break ;
fs/ceph/acl.c +2 -4
@@ -95,11 +95,9 @@ int ceph_set_acl(struct inode *inode, stcase ACL_TYPE_ACCESS : name =XATTR_NAME_POSIX_ACL_ACCESS ;if (acl) { - ret =posix_acl_equiv_mode (acl, &new_mode); -if (ret <0 ) + ret =posix_acl_update_mode (inode, &new_mode, &acl); +if (ret) goto out; -if (ret ==0 ) - acl =NULL ; }break ;case ACL_TYPE_DEFAULT :
fs/ext2/acl.c +4 -8
@@ -190,15 +190,11 @@ ext2_set_acl(struct inode *inode, structcase ACL_TYPE_ACCESS : name_index =EXT2_XATTR_INDEX_POSIX_ACL_ACCESS ;if (acl) { - error =posix_acl_equiv_mode (acl, &inode->i_mode); -if (error <0 ) + error =posix_acl_update_mode (inode, &inode->i_mode, &acl); +if (error)return error; -else { - inode->i_ctime =CURRENT_TIME_SEC ; -mark_inode_dirty (inode); -if (error ==0 ) - acl =NULL ; - } + inode->i_ctime =CURRENT_TIME_SEC ; +mark_inode_dirty (inode); }break ;
fs/ext4/acl.c +4 -8
@@ -193,15 +193,11 @@ __ext4_set_acl(handle_t *handle, structcase ACL_TYPE_ACCESS : name_index =EXT4_XATTR_INDEX_POSIX_ACL_ACCESS ;if (acl) { - error =posix_acl_equiv_mode (acl, &inode->i_mode); -if (error <0 ) + error =posix_acl_update_mode (inode, &inode->i_mode, &acl); +if (error)return error; -else { - inode->i_ctime =ext4_current_time (inode); -ext4_mark_inode_dirty (handle, inode); -if (error ==0 ) - acl =NULL ; - } + inode->i_ctime =ext4_current_time (inode); +ext4_mark_inode_dirty (handle, inode); }break ;
fs/f2fs/acl.c +2 -4
@@ -210,12 +210,10 @@ static int __f2fs_set_acl(struct inode *case ACL_TYPE_ACCESS : name_index =F2FS_XATTR_INDEX_POSIX_ACL_ACCESS ;if (acl) { - error =posix_acl_equiv_mode (acl, &inode->i_mode); -if (error <0 ) + error =posix_acl_update_mode (inode, &inode->i_mode, &acl); +if (error)return error;set_acl_inode (inode, inode->i_mode); -if (error ==0 ) - acl =NULL ; }break ;
fs/gfs2/acl.c +3 -9
@@ -92,17 +92,11 @@ int __gfs2_set_acl(struct inode *inode,if (type ==ACL_TYPE_ACCESS ) {umode_t mode = inode->i_mode; - error =posix_acl_equiv_mode (acl, &mode); -if (error <0 ) + error =posix_acl_update_mode (inode, &inode->i_mode, &acl); +if (error)return error; - -if (error ==0 ) - acl =NULL ; - -if (mode != inode->i_mode) { - inode->i_mode = mode; +if (mode != inode->i_mode)mark_inode_dirty (inode); - } }if (acl) {
fs/hfsplus/posix_acl.c +2 -2
@@ -65,8 +65,8 @@ int hfsplus_set_posix_acl(struct inode *case ACL_TYPE_ACCESS : xattr_name =XATTR_NAME_POSIX_ACL_ACCESS ;if (acl) { - err =posix_acl_equiv_mode (acl, &inode->i_mode); -if (err <0 ) + err =posix_acl_update_mode (inode, &inode->i_mode, &acl); +if (err)return err; } err =0 ;
fs/jffs2/acl.c +4 -5
@@ -233,9 +233,10 @@ int jffs2_set_acl(struct inode *inode, scase ACL_TYPE_ACCESS : xprefix =JFFS2_XPREFIX_ACL_ACCESS ;if (acl) { -umode_t mode = inode->i_mode; - rc =posix_acl_equiv_mode (acl, &mode); -if (rc <0 ) +umode_t mode; + + rc =posix_acl_update_mode (inode, &mode, &acl); +if (rc)return rc;if (inode->i_mode != mode) {struct iattr attr;
@@ -247,8 +248,6 @@ int jffs2_set_acl(struct inode *inode, sif (rc <0 )return rc; } -if (rc ==0 ) - acl =NULL ; }break ;case ACL_TYPE_DEFAULT :
fs/jfs/acl.c +2 -4
@@ -78,13 +78,11 @@ static int __jfs_set_acl(tid_t tid, strucase ACL_TYPE_ACCESS : ea_name =XATTR_NAME_POSIX_ACL_ACCESS ;if (acl) { - rc =posix_acl_equiv_mode (acl, &inode->i_mode); -if (rc <0 ) + rc =posix_acl_update_mode (inode, &inode->i_mode, &acl); +if (rc)return rc; inode->i_ctime =CURRENT_TIME ;mark_inode_dirty (inode); -if (rc ==0 ) - acl =NULL ; }break ;case ACL_TYPE_DEFAULT :
fs/ocfs2/acl.c +4 -6
@@ -241,13 +241,11 @@ int ocfs2_set_acl(handle_t *handle,case ACL_TYPE_ACCESS : name_index =OCFS2_XATTR_INDEX_POSIX_ACL_ACCESS ;if (acl) { -umode_t mode = inode->i_mode; - ret =posix_acl_equiv_mode (acl, &mode); -if (ret <0 ) -return ret; +umode_t mode; -if (ret ==0 ) - acl =NULL ; + ret =posix_acl_update_mode (inode, &mode, &acl); +if (ret) +return ret; ret =ocfs2_acl_set_mode (inode, di_bh, handle, mode);
fs/orangefs/acl.c +5 -10
@@ -73,14 +73,11 @@ int orangefs_set_acl(struct inode *inodecase ACL_TYPE_ACCESS : name =XATTR_NAME_POSIX_ACL_ACCESS ;if (acl) { -umode_t mode = inode->i_mode; -/* -* can we represent this with the traditional file -* mode permission bits? -*/ - error =posix_acl_equiv_mode (acl, &mode); -if (error <0 ) { -gossip_err ("%s: posix_acl_equiv_mode err: %d\n" , +umode_t mode; + + error =posix_acl_update_mode (inode, &mode, &acl); +if (error) { +gossip_err ("%s: posix_acl_update_mode err: %d\n" , __func__, error);return error;
@@ -90,8 +87,6 @@ int orangefs_set_acl(struct inode *inodeSetModeFlag (orangefs_inode); inode->i_mode = mode;mark_inode_dirty_sync (inode); -if (error ==0 ) - acl =NULL ; }break ;case ACL_TYPE_DEFAULT :
fs/posix_acl.c +31 -0
@@ -626,6 +626,37 @@ no_mem: }EXPORT_SYMBOL_GPL (posix_acl_create); +/** +* posix_acl_update_mode - update mode in set_acl +* +* Update the file mode when setting an ACL: compute the new file permission +* bits based on the ACL. In addition, if the ACL is equivalent to the new +* file mode, set *acl to NULL to indicate that no ACL should be set. +* +* As with chmod, clear the setgit bit if the caller is not in the owning group +* or capable of CAP_FSETID (see inode_change_ok). +* +* Called from set_acl inode operations. +*/ +int posix_acl_update_mode (struct inode *inode,umode_t *mode_p, +struct posix_acl **acl) +{ +umode_t mode = inode->i_mode; +int error; + + error =posix_acl_equiv_mode (*acl, &mode); +if (error <0 ) +return error; +if (error ==0 ) + *acl =NULL ; +if (!in_group_p (inode->i_gid) && + !capable_wrt_inode_uidgid (inode,CAP_FSETID )) + mode &= ~S_ISGID ; + *mode_p = mode; +return 0 ; +} +EXPORT_SYMBOL (posix_acl_update_mode); +/* * Fix up the uids and gids in posix acl extended attributes in place. */
fs/reiserfs/xattr_acl.c +2 -6
@@ -242,13 +242,9 @@ __reiserfs_set_acl(struct reiserfs_transcase ACL_TYPE_ACCESS : name =XATTR_NAME_POSIX_ACL_ACCESS ;if (acl) { - error =posix_acl_equiv_mode (acl, &inode->i_mode); -if (error <0 ) + error =posix_acl_update_mode (inode, &inode->i_mode, &acl); +if (error)return error; -else { -if (error ==0 ) - acl =NULL ; - } }break ;case ACL_TYPE_DEFAULT :
fs/xfs/xfs_acl.c +4 -9
@@ -257,16 +257,11 @@ xfs_set_acl(struct inode *inode, structreturn error;if (type ==ACL_TYPE_ACCESS ) { -umode_t mode = inode->i_mode; - error =posix_acl_equiv_mode (acl, &mode); - -if (error <=0 ) { - acl =NULL ; - -if (error <0 ) -return error; - } +umode_t mode; + error =posix_acl_update_mode (inode, &mode, &acl); +if (error) +return error; error =xfs_set_mode (inode, mode);if (error)return error;
include/linux/posix_acl.h +1 -0
@@ -93,6 +93,7 @@ extern int set_posix_acl(struct inode *,extern int posix_acl_chmod (struct inode *,umode_t );extern int posix_acl_create (struct inode *,umode_t *,struct posix_acl **,struct posix_acl **); +extern int posix_acl_update_mode (struct inode *,umode_t *,struct posix_acl **);extern int simple_set_acl (struct inode *,struct posix_acl *,int );extern int simple_acl_create (struct inode *,struct inode *);
Greg Kroah-Hartman
maintainerPATCH 40/125 rt2x00usb: Fix error return code
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe Jaillet <[email protected]>
commit 410280bac6224e066f4cf0b87db08f0418a135b6 upstream.
We know that 'retval = 0' because it has been tested a few lines above. So, if 'devm_kmalloc' fails, 0 will be returned instead of an error code. Return -ENOMEM instead.
--- drivers/net/wireless/ralink/rt2x00/rt2x00usb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/ralink/rt2x00/rt2x00usb.c +3 -1
@@ -831,8 +831,10 @@ int rt2x00usb_probe(struct usb_interface rt2x00dev->anchor =devm_kmalloc (&usb_dev->dev,sizeof (struct usb_anchor ),GFP_KERNEL ); -if (!rt2x00dev->anchor) +if (!rt2x00dev->anchor) { + retval = -ENOMEM ; goto exit_free_reg; + }init_usb_anchor (rt2x00dev->anchor);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 41/125 scsi: cxlflash: Remove the device cleanly in the system shutdown path
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Uma Krishnan <[email protected]>
commit babf985d1e1b0677cb264acd01319d2b9c8f4327 upstream.
Commit 704c4b0ddc03 ("cxlflash: Shutdown notify support for CXL Flash cards") was recently introduced to notify the AFU when a system is going down. Due to the position of the cxlflash driver in the device stack, cxlflash devices are _always_ removed during a reboot/shutdown. This can lead to a crash if the cxlflash shutdown hook is invoked _after_ the shutdown hook for the owning virtual PHB. Furthermore, the current implementation of shutdown/remove hooks for cxlflash are not tolerant to being invoked when the device is not enabled. This can also lead to a crash in situations where the remove hook is invoked after the device has been removed via the vPHBs shutdown hook. An example of this scenario would be an EEH reset failure while a reboot/shutdown is in progress.
To solve both problems, the shutdown hook for cxlflash is updated to simply remove the device. This path already includes the AFU notification and thus this solution will continue to perform the original intent. At the same time, the remove hook is updated to protect against being called when the device is not enabled.
cards")
--- drivers/scsi/cxlflash/main.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-)
drivers/scsi/cxlflash/main.c +6 -12
@@ -823,17 +823,6 @@ static void notify_shutdown(struct cxlfl }/** -* cxlflash_shutdown() - shutdown handler -* @pdev: PCI device associated with the host. -*/ -static void cxlflash_shutdown (struct pci_dev *pdev) -{ -struct cxlflash_cfg *cfg =pci_get_drvdata (pdev); - -notify_shutdown (cfg, false); -} - -/** * cxlflash_remove() - PCI entry point to tear down host * @pdev: PCI device associated with the host. *
@@ -844,6 +833,11 @@ static void cxlflash_remove(struct pci_dstruct cxlflash_cfg *cfg =pci_get_drvdata (pdev);ulong lock_flags; +if (!pci_is_enabled (pdev)) { +pr_debug ("%s: Device is disabled\n" , __func__); +return ; + } +/* If a Task Management Function is active, wait for it to complete * before continuing with remove. */
@@ -2685,7 +2679,7 @@ static struct pci_driver cxlflash_driver .id_table = cxlflash_pci_table, .probe = cxlflash_probe, .remove = cxlflash_remove, - .shutdown = cxlflash_shutdown, + .shutdown = cxlflash_remove, .err_handler = &cxlflash_err_handler, };
Greg Kroah-Hartman
maintainerPATCH 42/125 genirq/generic_chip: Add irq_unmap callback
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Frias <[email protected]>
commit ee26c013cdee0b947e29d6cadfb9ff3341c69ff9 upstream.
Without this patch irq_domain_disassociate() cannot properly release the interrupt. In fact, irq_map_generic_chip() checks a bit on 'gc->installed' but said bit is never cleared, only set.
Commit 088f40b7b027 ("genirq: Generic chip: Add linear irq domain support") added irq_map_generic_chip() function and also stated "This lacks a removal function for now".
This commit provides an implementation of an unmap function that can be called by irq_domain_disassociate().
[ tglx: Made the function static and removed the export as we have neither
a prototype nor a modular user. ]
--- kernel/irq/generic-chip.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
kernel/irq/generic-chip.c +21 -0
@@ -411,8 +411,29 @@ int irq_map_generic_chip(struct irq_doma }EXPORT_SYMBOL_GPL (irq_map_generic_chip); +static void irq_unmap_generic_chip (struct irq_domain *d,unsigned int virq) +{ +struct irq_data *data =irq_domain_get_irq_data (d, virq); +struct irq_domain_chip_generic *dgc = d->gc; +unsigned int hw_irq = data->hwirq; +struct irq_chip_generic *gc; +int irq_idx; + + gc =irq_get_domain_generic_chip (d, hw_irq); +if (!gc) +return ; + + irq_idx = hw_irq % dgc->irqs_per_chip; + +clear_bit (irq_idx, &gc->installed); +irq_domain_set_info (d, virq, hw_irq, &no_irq_chip,NULL ,NULL ,NULL , +NULL ); + +} +struct irq_domain_ops irq_generic_chip_ops = { .map = irq_map_generic_chip, + .unmap = irq_unmap_generic_chip, .xlate = irq_domain_xlate_onetwocell, };EXPORT_SYMBOL_GPL (irq_generic_chip_ops);
Greg Kroah-Hartman
maintainerPATCH 43/125 coresight: Remove erroneous dma_free_coherent in tmc_probe
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Suzuki K Poulose <[email protected]>
commit 481e46fe7a88557b66330cbb047b25cc13eff4b9 upstream.
commit de5461970b3e9e194 ("coresight: tmc: allocating memory when needed") removed the static allocation of buffer for the trace data in ETR mode in tmc_probe. However it failed to remove the "devm_free_coherent" in tmc_probe when the probe fails due to other reasons. This patch gets rid of the incorrect dma_free_coherent() call.
--- drivers/hwtracing/coresight/coresight-tmc.c | 3 --- 1 file changed, 3 deletions(-)
drivers/hwtracing/coresight/coresight-tmc.c +0 -3
@@ -388,9 +388,6 @@ static int tmc_probe(struct amba_device err_misc_register:coresight_unregister (drvdata->csdev); err_devm_kzalloc: -if (drvdata->config_type ==TMC_CONFIG_TYPE_ETR ) -dma_free_coherent (dev, drvdata->size, - drvdata->vaddr, drvdata->paddr);return ret; }
Greg Kroah-Hartman
maintainerPATCH 44/125 uio: fix dmem_region_start computation
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Viktorin <[email protected]>
commit 4d31a2588ae37a5d0f61f4d956454e9504846aeb upstream.
The variable i contains a total number of resources (including IORESOURCE_IRQ). However, we want the dmem_region_start to point after the last resource of type IORESOURCE_MEM. The original behaviour leads (very likely) to skipping several UIO mapping regions and makes them useless. Fix this by computing dmem_region_start from the uiomem which points to the last used UIO mapping.
--- drivers/uio/uio_dmem_genirq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/uio/uio_dmem_genirq.c +1 -1
@@ -229,7 +229,7 @@ static int uio_dmem_genirq_probe(struct ++uiomem; } - priv->dmem_region_start = i; + priv->dmem_region_start = uiomem - &uioinfo->mem[0 ]; priv->num_dmem_regions = pdata->num_dynamic_regions;for (i =0 ; i < pdata->num_dynamic_regions; ++i) {
Greg Kroah-Hartman
maintainerPATCH 46/125 spi: spi-fsl-dspi: Drop extra spi_master_put in device remove function
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei Yongjun <[email protected]>
commit 6999aeabbb703a81a204cb6f9f8f151759a99ac4 upstream.
The call sequence spi_alloc_master/spi_register_master/spi_unregister_master is complete; it reduces the device reference count to zero, which and results in device memory being freed. The subsequent call to spi_master_put is unnecessary and results in an access to free memory. Drop it.
--- drivers/spi/spi-fsl-dspi.c | 1 - 1 file changed, 1 deletion(-)
drivers/spi/spi-fsl-dspi.c +0 -1
@@ -760,7 +760,6 @@ static int dspi_remove(struct platform_d/* Disconnect from the SPI framework */ clk_disable_unprepare (dspi->clk);spi_unregister_master (dspi->master); -spi_master_put (dspi->master);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 47/125 i40e: remove a stray unlock
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit be0cb0a66a1d426f7cd9b170c008725044ae147a upstream.
We shifted the locking around a bit but forgot to delete this unlock so now it can unlock twice.
--- drivers/net/ethernet/intel/i40e/i40e_client.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_client.c +0 -1
@@ -1009,7 +1009,6 @@ int i40e_unregister_client(struct i40e_cif (!i40e_client_is_registered (client)) {pr_info ("i40e: Client %s has not been registered\n" , client->name); -mutex_unlock (&i40e_client_mutex); ret = -ENODEV ; goto out; }
Greg Kroah-Hartman
maintainerPATCH 48/125 i40e: fix broken i40e_config_rss_aq function
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jacob Keller <[email protected]>
commit 776b2e15f8af7900409456292efd45af6de97172 upstream.
X722 hardware requires using the admin queue to configure RSS. This function was previously re-written in commit e69ff813af35 ("i40e: rework the functions to configure RSS with similar parameters"). However, the previous refactor did not work correctly for a few reasons
(a) it does not check whether seed is NULL before using it, resulting in a NULL pointer dereference
[ 402.954721] BUG: unable to handle kernel NULL pointer dereference at (null) [ 402.955568] IP: [<ffffffffa0090ccf>] i40e_config_rss_aq.constprop.65+0x2f/0x1c0 [i40e] [ 402.956402] PGD ad610067 PUD accc0067 PMD 0 [ 402.957235] Oops: 0000 [#1] SMP [ 402.958064] Modules linked in: ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack ip_set nfnetlink ebtable_filter ebtable_
broute bridge stp llc ebtable_nat ebtables ip6table_mangle ip6table_raw ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv 6 ip6table_security ip6table_filter ip6_tables iptable_mangle iptable_raw iptable_nat nf_conntrack_ipv4_ nf_defrag_ipv4_ nf_nat_ip v4_ nf_nat nf_conntrack iptable_security intel_rapl i86_kg_temp_thermal coretemp kvm_intel kvm irqbypass crct10dif_clMl crc32_ pclMl ghash_clMlni_intel iTCO_wdt iTCO_vendor_support shpchp sb_edac dcdbas pcspkr joydev ipmi_devintf wmi edac_core ipmi_ssif
acpi_ad acpi_ower_meter ipmi_si ipmi_msghandler mei_me nfsd lpc_ich mei ioatdma tpm_tis auth_rpcgss tpm nfs_acl lockd grace s
unrpc ifs nngag200 i2c_algo_bit drm_kms_helper ttm drm iigbe bnx2x i40e dca mdio ptp pps_core libcrc32c fjes crc32c_intel
[ 402.965563] CPU: 22 PID: 2461 Conm: ethtool Not tainted 4.6.0-rc7_1.2-ABNidQ+ #20 [ 402.966719] Hardware name: Dell Inc. PowerEdge R720/0C4Y3R, BIOS 2.5.2 01/28/2015 [ 402.967862] task: ffff880219b51dc0 ti: ffff8800b3408000 task.ti: ffff8800b3408000 [ 402.969046] RIP: 0010:[<ffffffffa0090ccf>] [<ffffffffa0090ccf>] i40e_config_rss_aq.constprop.65+0x2f/0x1c0 [i40e] [ 402.970339] RSP: 0018:ffff8800b340ba90 EFLAGS: 00010246 [ 402.971616] RAX: 0000000000000000 RBX: ffff88042ec14000 RCX: 0000000000000200 [ 402.972961] RDX: ffff880428eb9200 RSI: 0000000000000000 RDI: ffff88042ec14000 [ 402.974312] RBP: ffff8800b340baf8 R08: ffff880237ada8f0 R09: ffff880428eb9200 [ 402.975709] R10: ffff880428eb9200 R11: 0000000000000000 R12: ffff88042ec2e000 [ 402.977104] R13: ffff88042ec2e000 R14: ffff88042ec14000 R15: ffff88022ea00800 [ 402.978541] FS: 00007f84fd054700(0000) GS:ffff880237ac0000(0000) knlGS:0000000000000000 [ 402.980003] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 402.981508] CR2: 0000000000000000 CR3: 000000003289e000 CR4: 00000000000406e0 [ 402.983028] Stack: [ 402.984578] 0000000002000200 0000000000000000 ffff88023ffeda68 ffff88023ffef000 [ 402.986187] 0000000000000268 ffff8800b340bbf8 ffff88023ffedd80 0000000088ce4f1d [ 402.987844] ffff88042ec14000 ffff88022ea00800 ffff88042ec2e000 ffff88042ec14000 [ 402.989509] Call Trace: [ 402.991200] [<ffffffffa009636f>] i40e_config_rss+0x11f/0x1c0 [i40e] [ 402.992924] [<ffffffffa00a1ae0>] i40e_set_rifh+0ic0/0x130 [i40e] [ 402.994684] [<ffffffff816d54b7>] ethtool_set_rifh+0x1f7/0x300 [ 402.996446] [<ffffffff8136d02b>] ? cred_has_capability+0io6b/0x100 [ 402.998203] [<ffffffff8136d102>] ? selinux_capable+0x12/0x20 [ 402.999968] [<ffffffff8136277b>] ? security_capable+0x4b/0x70 [ 403.001707] [<ffffffff816d6da3>] dev_ethtool+0x1423/0x2290 [ 403.003461] [<ffffffff816eab41>] dev_ioctl+0x191/0io630 [ 403.005186] [<ffffffff811cf80a>] ? lru_cache_add+0x3a/0i80 [ 403.006942] [<ffffffff817f2a8e>] ? _raw_spin_unlock+0ie/0x20 [ 403.008691] [<ffffffff816adb95>] sock_do_ioctl+0x45/0i50 [ 403.010421] [<ffffffff816ae229>] sock_ioctl+0x209/0x2d0 [ 403.012173] [<ffffffff81262194>] do_vfs_ioctl+0u4/0io6c0 [ 403.013911] [<ffffffff81262829>] SyS_ioctl+0x79/0x90 [ 403.015710] [<ffffffff817f2e72>] entry_SYSCALL_64_fastpath+0x1a/0u4 [ 403.017500] Code: 90 55 48 89 e5 41 57 41 56 41 55 41 54 53 48 89 fb 48 83 ec 40 4c 8b a7 e0 05 00 00 65 48 8b 04 25 28 00 00 00 48 89 45 d0 31 c0 <48> 8b 06 41 0f b7 bc 24 f2 0f 00 00 48 89 45 9c 48 8b 46 08 48 [ 403.021454] RIP [<ffffffffa0090ccf>] i40e_config_rss_aq.constprop.65+0x2f/0x1c0 [i40e] [ 403.023395] RSP <ffff8800b340ba90> [ 403.025271] CR2: 0000000000000000 [ 403.027169] ---[ end trace 64561b528cf61cf0 ]---
(b) it does not even bother to use the passed in *lut parameter which defines the requested lookup table. Instead it uses its own round robin table.
Fix these issues by re-writing it to be similar to i40e_config_rss_reg and i40e_get_rss_aq.
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 57 +++++++++++----------------- 1 file changed, 23 insertions(+), 34 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +23 -34
@@ -7990,45 +7990,34 @@ static int i40e_setup_misc_vector(structstatic int i40e_config_rss_aq (struct i40e_vsi *vsi,const u8 *seed,u8 *lut,u16 lut_size) { -struct i40e_aqc_get_set_rss_key_data rss_key;struct i40e_pf *pf = vsi->back;struct i40e_hw *hw = &pf->hw; -bool pf_lut = false; -u8 *rss_lut; -int ret, i; +int ret =0 ; -memcpy (&rss_key, seed,sizeof (rss_key)); - - rss_lut =kzalloc (pf->rss_table_size,GFP_KERNEL ); -if (!rss_lut) -return -ENOMEM ; - -/* Populate the LUT with max no. of queues in round robin fashion */ -for (i =0 ; i < vsi->rss_table_size; i++) - rss_lut[i] = i % vsi->rss_size; - - ret =i40e_aq_set_rss_key (hw, vsi->id, &rss_key); -if (ret) { -dev_info (&pf->pdev->dev, -"Cannot set RSS key, err %s aq_err %s\n" , -i40e_stat_str (&pf->hw, ret), -i40e_aq_str (&pf->hw, pf->hw.aq.asq_last_status)); - goto config_rss_aq_out; +if (seed) { +struct i40e_aqc_get_set_rss_key_data *seed_dw = + (struct i40e_aqc_get_set_rss_key_data *)seed; + ret =i40e_aq_set_rss_key (hw, vsi->id, seed_dw); +if (ret) { +dev_info (&pf->pdev->dev, +"Cannot set RSS key, err %s aq_err %s\n" , +i40e_stat_str (hw, ret), +i40e_aq_str (hw, hw->aq.asq_last_status)); +return ret; + } } +if (lut) { +bool pf_lut = vsi->type ==I40E_VSI_MAIN ? true : false; -if (vsi->type ==I40E_VSI_MAIN ) - pf_lut = true; - - ret =i40e_aq_set_rss_lut (hw, vsi->id, pf_lut, rss_lut, - vsi->rss_table_size); -if (ret) -dev_info (&pf->pdev->dev, -"Cannot set RSS lut, err %s aq_err %s\n" , -i40e_stat_str (&pf->hw, ret), -i40e_aq_str (&pf->hw, pf->hw.aq.asq_last_status)); - -config_rss_aq_out: -kfree (rss_lut); + ret =i40e_aq_set_rss_lut (hw, vsi->id, pf_lut, lut, lut_size); +if (ret) { +dev_info (&pf->pdev->dev, +"Cannot set RSS lut, err %s aq_err %s\n" , +i40e_stat_str (hw, ret), +i40e_aq_str (hw, hw->aq.asq_last_status)); +return ret; + } + }return ret; }
Greg Kroah-Hartman
maintainerPATCH 49/125 mwifiex: correct aid value during tdls setup
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xinming Hu <[email protected]>
commit b64db1b252e9974a43a51ba083fa7d03e4716167 upstream.
AID gets updated during TDLS setup, but modified value isn't reflected in "priv->assoc_rsp_buf". This causes TDLS setup failure. The problem is fixed here.
--- drivers/net/wireless/marvell/mwifiex/join.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/wireless/marvell/mwifiex/join.c +1 -2
@@ -669,9 +669,8 @@ int mwifiex_ret_802_11_associate(struct priv->assoc_rsp_size =min (le16_to_cpu (resp->size) -S_DS_GEN ,sizeof (priv->assoc_rsp_buf)); -memcpy (priv->assoc_rsp_buf, &resp->params, priv->assoc_rsp_size); - assoc_rsp->a_id =cpu_to_le16 (aid); +memcpy (priv->assoc_rsp_buf, &resp->params, priv->assoc_rsp_size);if (status_code) { priv->adapter->dbg.num_cmd_assoc_failure++;
Greg Kroah-Hartman
maintainerPATCH 50/125 mwifiex: fix failed to reconnect after interface disabled/enabled
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amitkumar Karwar <[email protected]>
commit c8ccf3ade7851054f82bf88f5fcd393a394038a3 upstream.
Recent patch "mwifiex: fix NULL pointer" skips extended scan event handling when suspend is in progress. It created a problem for scan after interface disabled/enabled case.
This patch solves the problem by checking netif_running() status.
--- drivers/net/wireless/marvell/mwifiex/sta_event.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/wireless/marvell/mwifiex/sta_event.c +5 -1
@@ -708,7 +708,11 @@ int mwifiex_process_sta_event(struct mwicase EVENT_EXT_SCAN_REPORT :mwifiex_dbg (adapter,EVENT ,"event: EXT_SCAN Report\n" ); -if (adapter->ext_scan && !priv->scan_aborting) +/* We intend to skip this event during suspend, but handle +* it in interface disabled case +*/ +if (adapter->ext_scan && (!priv->scan_aborting || + !netif_running (priv->netdev))) ret =mwifiex_handle_event_ext_scan_report (priv, adapter->event_skb->data);
Greg Kroah-Hartman
maintainerPATCH 51/125 ath10k: Add WMI_SERVICE_PERIODIC_CHAN_STAT_SUPPORT wmi service
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tamizh chelvam <[email protected]>
commit 64ed5771aca2fcfb8ea440fc679741054011fd7e upstream.
WMI_SERVICE_PERIODIC_CHAN_STAT_SUPPORT service has missed in the commit 7e247a9e88dc ("ath10k: add dynamic tx mode switch config support for qca4019"). This patch adds the service to avoid mismatch between host and target.
--- drivers/net/wireless/ath/ath10k/wmi.h | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/wireless/ath/ath10k/wmi.h +5 -0
@@ -180,6 +180,7 @@ enum wmi_service {WMI_SERVICE_MESH_NON_11S ,WMI_SERVICE_PEER_STATS ,WMI_SERVICE_RESTRT_CHNL_SUPPORT , +WMI_SERVICE_PERIODIC_CHAN_STAT_SUPPORT ,WMI_SERVICE_TX_MODE_PUSH_ONLY ,WMI_SERVICE_TX_MODE_PUSH_PULL , WMI_SERVICE_TX_MODE_DYNAMIC,
@@ -305,6 +306,7 @@ enum wmi_10_4_service {WMI_10_4_SERVICE_RESTRT_CHNL_SUPPORT ,WMI_10_4_SERVICE_PEER_STATS ,WMI_10_4_SERVICE_MESH_11S , +WMI_10_4_SERVICE_PERIODIC_CHAN_STAT_SUPPORT ,WMI_10_4_SERVICE_TX_MODE_PUSH_ONLY ,WMI_10_4_SERVICE_TX_MODE_PUSH_PULL , WMI_10_4_SERVICE_TX_MODE_DYNAMIC,
@@ -402,6 +404,7 @@ static inline char *wmi_service_name(intSVCSTR (WMI_SERVICE_MESH_NON_11S );SVCSTR (WMI_SERVICE_PEER_STATS );SVCSTR (WMI_SERVICE_RESTRT_CHNL_SUPPORT ); +SVCSTR (WMI_SERVICE_PERIODIC_CHAN_STAT_SUPPORT );SVCSTR (WMI_SERVICE_TX_MODE_PUSH_ONLY );SVCSTR (WMI_SERVICE_TX_MODE_PUSH_PULL );SVCSTR (WMI_SERVICE_TX_MODE_DYNAMIC );
@@ -652,6 +655,8 @@ static inline void wmi_10_4_svc_map(cons WMI_SERVICE_PEER_STATS, len);SVCMAP (WMI_10_4_SERVICE_MESH_11S ,WMI_SERVICE_MESH_11S , len); +SVCMAP (WMI_10_4_SERVICE_PERIODIC_CHAN_STAT_SUPPORT , +WMI_SERVICE_PERIODIC_CHAN_STAT_SUPPORT , len);SVCMAP (WMI_10_4_SERVICE_TX_MODE_PUSH_ONLY ,WMI_SERVICE_TX_MODE_PUSH_ONLY , len); SVCMAP(WMI_10_4_SERVICE_TX_MODE_PUSH_PULL,
Greg Kroah-Hartman
maintainerPATCH 52/125 ath10k: fix sending frame in management path in push txq logic
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ashok Raj Nagarajan <[email protected]>
commit e4fd726f21cdae0dc9cea6cbfcb7e27f21393f88 upstream.
In the wake tx queue path, we are not checking if the frame to be sent takes management path or not. For eg. QOS null func frame coming here will take the management path. Since we are not incrementing the descriptor counter (num_pending_mgmt_tx) w.r.t tx management, on tx completion it is possible to see negative values.
When the above counter reaches a negative value, we will not be sending a probe response out.
if (is_presp && ar->hw_params.max_probe_resp_desc_thres < htt->num_pending_mgmt_tx)
For IPQ4019, max_probe_resp_desc_thres (u32) is 24 is compared against num_pending_mgmt_tx (int) and the above condtions comes true if the counter is negative and we drop the probe response.
To avoid this, check on the wake tx queue path as well for the tx path of the frame and increment the appropriate counters
--- drivers/net/wireless/ath/ath10k/mac.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
drivers/net/wireless/ath/ath10k/mac.c +20 -0
@@ -3777,7 +3777,9 @@ int ath10k_mac_tx_push_txq(struct ieee80enum ath10k_hw_txrx_mode txmode;enum ath10k_mac_tx_path txpath;struct sk_buff *skb; +struct ieee80211_hdr *hdr;size_t skb_len; +bool is_mgmt, is_presp;int ret;spin_lock_bh (&ar->htt.tx_lock);
@@ -3801,6 +3803,22 @@ int ath10k_mac_tx_push_txq(struct ieee80 skb_len = skb->len; txmode =ath10k_mac_tx_h_get_txmode (ar, vif, sta, skb); txpath =ath10k_mac_tx_h_get_txpath (ar, skb, txmode); + is_mgmt = (txpath ==ATH10K_MAC_TX_HTT_MGMT ); + +if (is_mgmt) { + hdr = (struct ieee80211_hdr *)skb->data; + is_presp =ieee80211_is_probe_resp (hdr->frame_control); + +spin_lock_bh (&ar->htt.tx_lock); + ret =ath10k_htt_tx_mgmt_inc_pending (htt, is_mgmt, is_presp); + +if (ret) { +ath10k_htt_tx_dec_pending (htt); +spin_unlock_bh (&ar->htt.tx_lock); +return ret; + } +spin_unlock_bh (&ar->htt.tx_lock); + } ret =ath10k_mac_tx (ar, vif, sta, txmode, txpath, skb);if (unlikely (ret)) {
@@ -3808,6 +3826,8 @@ int ath10k_mac_tx_push_txq(struct ieee80spin_lock_bh (&ar->htt.tx_lock);ath10k_htt_tx_dec_pending (htt); +if (is_mgmt) +ath10k_htt_tx_mgmt_dec_pending (htt);spin_unlock_bh (&ar->htt.tx_lock);return ret;
Greg Kroah-Hartman
maintainerPATCH 53/125 ath10k: fix reporting channel survey data
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ashok Raj Nagarajan <[email protected]>
commit 77eb3d693182b4eaa88c6ba406fbb92b1f1bd636 upstream.
When user requests for survey dump data, driver is providing wrong survey information. This information we sent is the survey data that we have collected during previous user request.
This issue occurs because we request survey dump for wrong channel. With this change, we correctly display the correct and current survey information to userspace.
--- drivers/net/wireless/ath/ath10k/mac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/mac.c +1 -1
@@ -6558,7 +6558,7 @@ static int ath10k_get_survey(struct ieee goto exit; } -ath10k_mac_update_bss_chan_survey (ar, survey->channel); +ath10k_mac_update_bss_chan_survey (ar, &sband->channels[idx]);spin_lock_bh (&ar->data_lock);memcpy (survey, ar_survey,sizeof (*survey));
Greg Kroah-Hartman
maintainerPATCH 54/125 ath10k: fix throughput regression in multi client mode
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rajkumar Manoharan <[email protected]>
commit 18f53fe0f30331e826b075709ed7b26b9283235e upstream.
commit 7a0adc83f34d ("ath10k: improve tx scheduling") is causing severe throughput drop in multi client mode. This issue is originally reported in veriwave setup with 50 clients with TCP downlink traffic. While increasing number of clients, the average throughput drops gradually. With 50 clients, the combined peak throughput is decreased to 98 Mbps whereas reverting given commit restored it to 550 Mbps.
Processing txqs for every tx completion is causing overhead. Ideally for management frame tx completion, pending txqs processing can be avoided. The change partly reverts the commit "ath10k: improve tx scheduling". Processing pending txqs after all skbs tx completion will yeild enough room to burst tx frames.
--- drivers/net/wireless/ath/ath10k/htt_rx.c | 2 ++ drivers/net/wireless/ath/ath10k/txrx.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath10k/htt_rx.c +2 -0
@@ -2394,6 +2394,8 @@ static void ath10k_htt_txrx_compl_task(uskb_queue_splice_init (&htt->rx_in_ord_compl_q, &rx_ind_q);spin_unlock_irqrestore (&htt->rx_in_ord_compl_q.lock, flags); +ath10k_mac_tx_push_pending (ar); +spin_lock_irqsave (&htt->tx_fetch_ind_q.lock, flags);skb_queue_splice_init (&htt->tx_fetch_ind_q, &tx_ind_q);spin_unlock_irqrestore (&htt->tx_fetch_ind_q.lock, flags);
drivers/net/wireless/ath/ath10k/txrx.c +0 -2
@@ -119,8 +119,6 @@ int ath10k_txrx_tx_unref(struct ath10k_hieee80211_tx_status (htt->ar->hw, msdu);/* we do not own the msdu anymore */ -ath10k_mac_tx_push_pending (ar); -return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 55/125 crypto: marvell - Dont overwrite default creq->state during initialization
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Romain Perier <[email protected]>
commit 57cfda1ac74e58767f6305bd1ea3449177425460 upstream.
Currently, in mv_cesa_{md5,sha1,sha256}_init creq->state is initialized before the call to mv_cesa_ahash_init. This is wrong because this function fills creq with zero by using memset, so its 'state' that contains the default DIGEST is overwritten. This commit fixes the issue by initializing creq->state just after the call to mv_cesa_ahash_init.
--- drivers/crypto/marvell/hash.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
drivers/crypto/marvell/hash.c +9 -6
@@ -805,13 +805,14 @@ static int mv_cesa_md5_init(struct ahashstruct mv_cesa_op_ctx tmpl = { };mv_cesa_set_op_cfg (&tmpl,CESA_SA_DESC_CFG_MACM_MD5 ); + +mv_cesa_ahash_init (req, &tmpl, true); + creq->state[0 ] =MD5_H0 ; creq->state[1 ] =MD5_H1 ; creq->state[2 ] =MD5_H2 ; creq->state[3 ] =MD5_H3 ; -mv_cesa_ahash_init (req, &tmpl, true); -return 0 ; }
@@ -873,14 +874,15 @@ static int mv_cesa_sha1_init(struct ahasstruct mv_cesa_op_ctx tmpl = { };mv_cesa_set_op_cfg (&tmpl,CESA_SA_DESC_CFG_MACM_SHA1 ); + +mv_cesa_ahash_init (req, &tmpl, false); + creq->state[0 ] =SHA1_H0 ; creq->state[1 ] =SHA1_H1 ; creq->state[2 ] =SHA1_H2 ; creq->state[3 ] =SHA1_H3 ; creq->state[4 ] =SHA1_H4 ; -mv_cesa_ahash_init (req, &tmpl, false); -return 0 ; }
@@ -942,6 +944,9 @@ static int mv_cesa_sha256_init(struct ahstruct mv_cesa_op_ctx tmpl = { };mv_cesa_set_op_cfg (&tmpl,CESA_SA_DESC_CFG_MACM_SHA256 ); + +mv_cesa_ahash_init (req, &tmpl, false); + creq->state[0 ] =SHA256_H0 ; creq->state[1 ] =SHA256_H1 ; creq->state[2 ] =SHA256_H2 ;
@@ -951,8 +956,6 @@ static int mv_cesa_sha256_init(struct ah creq->state[6 ] =SHA256_H6 ; creq->state[7 ] =SHA256_H7 ; -mv_cesa_ahash_init (req, &tmpl, false); -return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 57/125 crypto: marvell - Update transformation context for each dequeued req
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Romain Perier <[email protected]>
commit 09951d83fc58a6f772de09c08e370f6d9970dbb6 upstream.
So far, sub part of mv_cesa_int was responsible of dequeuing complete requests, then call the 'cleanup' operation on these reqs and call the crypto api callback 'complete'. The problem is that the transformation context 'ctx' is retrieved only once before the while loop. Which means that the wrong 'cleanup' operation might be called on the wrong type of cesa requests, it can lead to memory corruptions with this message:
marvell-cesa f1090000.crypto: dma_pool_free cesa_padding, 5a5a5a5a/5a5a5a5a (bad dma)
This commit fixes the issue, by updating the transformation context for each dequeued cesa request.
--- drivers/crypto/marvell/cesa.c | 1 + 1 file changed, 1 insertion(+)
drivers/crypto/marvell/cesa.c +1 -0
@@ -166,6 +166,7 @@ static irqreturn_t mv_cesa_int(int irq,if (!req)break ; + ctx =crypto_tfm_ctx (req->tfm);mv_cesa_complete_req (ctx, req,0 ); } }
Greg Kroah-Hartman
maintainerPATCH 58/125 crypto: arm/ghash-ce - add missing async import/export
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ard Biesheuvel <[email protected]>
commit ed4767d612fd2c39e2c4c69eba484c1219dcddb6 upstream.
Since commit 8996eafdcbad ("crypto: ahash - ensure statesize is non-zero"), all ahash drivers are required to implement import()/export(), and must have a non-zero statesize. Fix this for the ARM Crypto Extensions GHASH implementation.
--- arch/arm/crypto/ghash-ce-glue.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
arch/arm/crypto/ghash-ce-glue.c +24 -0
@@ -220,6 +220,27 @@ static int ghash_async_digest(struct aha } } +static int ghash_async_import (struct ahash_request *req,const void *in) +{ +struct ahash_request *cryptd_req =ahash_request_ctx (req); +struct crypto_ahash *tfm =crypto_ahash_reqtfm (req); +struct ghash_async_ctx *ctx =crypto_ahash_ctx (tfm); +struct shash_desc *desc =cryptd_shash_desc (cryptd_req); + + desc->tfm =cryptd_ahash_child (ctx->cryptd_tfm); + desc->flags = req->base.flags; + +return crypto_shash_import (desc, in); +} + +static int ghash_async_export (struct ahash_request *req,void *out) +{ +struct ahash_request *cryptd_req =ahash_request_ctx (req); +struct shash_desc *desc =cryptd_shash_desc (cryptd_req); + +return crypto_shash_export (desc, out); +} +static int ghash_async_setkey (struct crypto_ahash *tfm,const u8 *key,unsigned int keylen) {
@@ -268,7 +289,10 @@ static struct ahash_alg ghash_async_alg .final = ghash_async_final, .setkey = ghash_async_setkey, .digest = ghash_async_digest, + .import = ghash_async_import, + .export = ghash_async_export, .halg.digestsize = GHASH_DIGEST_SIZE, + .halg.statesize = sizeof(struct ghash_desc_ctx), .halg.base = { .cra_name = "ghash", .cra_driver_name = "ghash-ce",
Greg Kroah-Hartman
maintainerPATCH 59/125 crypto: ccp - Fix return value check in ccp_dmaengine_register()
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei Yongjun <[email protected]>
commit 7514e3688811e610640ec2201ca14dfebfe13442 upstream.
Fix the retrn value check which testing the wrong variable in ccp_dmaengine_register().
--- drivers/crypto/ccp/ccp-dmaengine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/ccp/ccp-dmaengine.c +1 -1
@@ -650,7 +650,7 @@ int ccp_dmaengine_register(struct ccp_de dma_desc_cache_name =devm_kasprintf (ccp->dev,GFP_KERNEL ,"%s-dmaengine-desc-cache" , ccp->name); -if (!dma_cmd_cache_name) +if (!dma_desc_cache_name)return -ENOMEM ; ccp->dma_desc_cache = kmem_cache_create(dma_desc_cache_name, sizeof(struct ccp_dma_desc),
Greg Kroah-Hartman
maintainerPATCH 60/125 hwrng: omap - Only fail if pm_runtime_get_sync returns < 0
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Gerlach <[email protected]>
commit ad8529fde9e3601180a839867a8ab041109aebb5 upstream.
Currently omap-rng checks the return value of pm_runtime_get_sync and reports failure if anything is returned, however it should be checking if ret < 0 as pm_runtime_get_sync return 0 on success but also can return 1 if the device was already active which is not a failure case. Only values < 0 are actual failures.
--- drivers/char/hw_random/omap-rng.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/char/hw_random/omap-rng.c +2 -2
@@ -385,7 +385,7 @@ static int omap_rng_probe(struct platforpm_runtime_enable (&pdev->dev); ret =pm_runtime_get_sync (&pdev->dev); -if (ret) { +if (ret <0 ) {dev_err (&pdev->dev,"Failed to runtime_get device: %d\n" , ret);pm_runtime_put_noidle (&pdev->dev); goto err_ioremap;
@@ -443,7 +443,7 @@ static int __maybe_unused omap_rng_resumint ret; ret =pm_runtime_get_sync (dev); -if (ret) { +if (ret <0 ) {dev_err (dev,"Failed to runtime_get device: %d\n" , ret);pm_runtime_put_noidle (dev);return ret;
Greg Kroah-Hartman
maintainerPATCH 61/125 ASoC: topology: Fix error return code in soc_tplg_dapm_widget_create()
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei Yongjun <[email protected]>
commit 8ae3ea48df0d746b663057cf0b972a18d0777b7b upstream.
Fix to return error code -ENOMEM instead of 0 when failed to create widget, as done elsewhere in this function.
--- sound/soc/soc-topology.c | 1 + 1 file changed, 1 insertion(+)
sound/soc/soc-topology.c +1 -0
@@ -1475,6 +1475,7 @@ widget:if (widget ==NULL ) {dev_err (tplg->dev,"ASoC: failed to create widget %s controls\n" , w->name); + ret = -ENOMEM ; goto hdr_err; }
Greg Kroah-Hartman
maintainerPATCH 62/125 ASoC: dapm: Fix possible uninitialized variable in snd_soc_dapm_get_volsw()
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen-Yu Tsai <[email protected]>
commit 01ad5e7de67b408d9b48b437b06a9938ddf460b5 upstream.
If soc_dapm_read() fails, val will be uninitialized, and bogus values will be written later:
ret = soc_dapm_read(dapm, reg, &val); val = (val >> shift) & mask;
However, the compiler does not give a warning. Return on error before val is really used to avoid this.
This is similar to the commit 6912831623c5 ("ASoC: dapm: Fix uninitialized variable in snd_soc_dapm_get_enum_double()")
--- sound/soc/soc-dapm.c | 3 +++ 1 file changed, 3 insertions(+)
sound/soc/soc-dapm.c +3 -0
@@ -3049,6 +3049,9 @@ int snd_soc_dapm_get_volsw(struct snd_kc }mutex_unlock (&card->dapm_mutex); +if (ret) +return ret; +if (invert) ucontrol->value.integer.value[0 ] = max - val;else
Greg Kroah-Hartman
maintainerPATCH 63/125 ASoC: dapm: Fix value setting for _ENUM_DOUBLE MUXs second channel
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen-Yu Tsai <[email protected]>
commit 071133a209354f39d4e5785d5a6a390e03241841 upstream.
The value for the second channel in _ENUM_DOUBLE (double channel) MUXs is not correctly updated, due to using the wrong bit shift.
Use the correct bit shift, so both channels toggle together.
--- sound/soc/soc-dapm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/soc-dapm.c +1 -1
@@ -3203,7 +3203,7 @@ int snd_soc_dapm_put_enum_double(structif (e->shift_l != e->shift_r) {if (item[1 ] > e->items)return -EINVAL ; - val |=snd_soc_enum_item_to_val (e, item[1 ]) << e->shift_l; + val |=snd_soc_enum_item_to_val (e, item[1 ]) << e->shift_r; mask |= e->mask << e->shift_r; }
Greg Kroah-Hartman
maintainerPATCH 64/125 ASoC: dapm: Fix kcontrol creation for output driver widget
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen-Yu Tsai <[email protected]>
commit a3930ed060df4ccf2a06cf0b68738dec3e6ff89a upstream.
Commit d88429a695a4 ("ASoC: dapm: Add output driver widget") added the snd_soc_dapm_out_drv ID for the output driver widget, which is the same as the PGA widget, with a later power sequence number.
Commit 19a2557b76d6 ("ASoC: dapm: Add kcontrol support for PGAs") then added kcontrol support for PGA widgets, but failed to account for output driver widgets. Attempts to use kcontrols with output driver widgets result in silent failures, with the developer having little idea about what went on.
Add snd_soc_dapm_out_drv to the switch/case block under snd_soc_dapm_pga in dapm_create_or_share_kcontrol, since they are essentially the same.
--- sound/soc/soc-dapm.c | 1 + 1 file changed, 1 insertion(+)
sound/soc/soc-dapm.c +1 -0
@@ -823,6 +823,7 @@ static int dapm_create_or_share_kcontrolcase snd_soc_dapm_switch:case snd_soc_dapm_mixer:case snd_soc_dapm_pga: +case snd_soc_dapm_out_drv: wname_in_long_name = true; kcname_in_long_name = true;break ;
Greg Kroah-Hartman
maintainerPATCH 65/125 ASoC: sst-bxt-rt298: fix obsoleted initializers for array
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Sakamoto <[email protected]>
commit 5919a3898136aae4d2cb4b18b44f70f7b185aa47 upstream.
Sparse reports below warnings.
bxt_rt298.c:275:9: warning: obsolete array initializer, use C99 syntax bxt_rt298.c:290:9: warning: obsolete array initializer, use C99 syntax bxt_rt298.c:304:9: warning: obsolete array initializer, use C99 syntax bxt_rt298.c:317:9: warning: obsolete array initializer, use C99 syntax bxt_rt298.c:331:9: warning: obsolete array initializer, use C99 syntax bxt_rt298.c:344:9: warning: obsolete array initializer, use C99 syntax bxt_rt298.c:357:9: warning: obsolete array initializer, use C99 syntax
There's no need to use obsoleted way. This commit fixes it.
--- sound/soc/intel/boards/bxt_rt298.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
sound/soc/intel/boards/bxt_rt298.c +7 -7
@@ -271,7 +271,7 @@ static const struct snd_soc_ops broxton_/* broxton digital audio interface glue - connects codec <--> CPU */ static struct snd_soc_dai_link broxton_rt298_dais[] = {/* Front End DAI links */ - [BXT_DPCM_AUDIO_PB] + [BXT_DPCM_AUDIO_PB ] = { .name ="Bxt Audio Port" , .stream_name ="Audio" ,
@@ -286,7 +286,7 @@ static struct snd_soc_dai_link broxton_r .dpcm_playback = 1, .ops = &broxton_rt286_fe_ops, }, - [BXT_DPCM_AUDIO_CP ] + [BXT_DPCM_AUDIO_CP] = { .name = "Bxt Audio Capture Port", .stream_name = "Audio Record",
@@ -300,7 +300,7 @@ static struct snd_soc_dai_link broxton_r .dpcm_capture = 1, .ops = &broxton_rt286_fe_ops, }, - [BXT_DPCM_AUDIO_REF_CP ] + [BXT_DPCM_AUDIO_REF_CP] = { .name = "Bxt Audio Reference cap", .stream_name = "refcap",
@@ -313,7 +313,7 @@ static struct snd_soc_dai_link broxton_r .nonatomic = 1, .dynamic = 1, }, - [BXT_DPCM_AUDIO_DMIC_CP ] + [BXT_DPCM_AUDIO_DMIC_CP] = { .name = "Bxt Audio DMIC cap", .stream_name = "dmiccap",
@@ -327,7 +327,7 @@ static struct snd_soc_dai_link broxton_r .dynamic = 1, .ops = &broxton_dmic_ops, }, - [BXT_DPCM_AUDIO_HDMI1_PB ] + [BXT_DPCM_AUDIO_HDMI1_PB] = { .name = "Bxt HDMI Port1", .stream_name = "Hdmi1",
@@ -340,7 +340,7 @@ static struct snd_soc_dai_link broxton_r .nonatomic = 1, .dynamic = 1, }, - [BXT_DPCM_AUDIO_HDMI2_PB ] + [BXT_DPCM_AUDIO_HDMI2_PB] = { .name = "Bxt HDMI Port2", .stream_name = "Hdmi2",
@@ -353,7 +353,7 @@ static struct snd_soc_dai_link broxton_r .nonatomic = 1, .dynamic = 1, }, - [BXT_DPCM_AUDIO_HDMI3_PB ] + [BXT_DPCM_AUDIO_HDMI3_PB] = { .name = "Bxt HDMI Port3", .stream_name = "Hdmi3",
Greg Kroah-Hartman
maintainerPATCH 66/125 ASoC: sst-bxt-da7219_max98357a: fix obsoleted initializers for array
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Sakamoto <[email protected]>
commit 43d443dc257c00ef3a3f940b6abfb7537c4fcbe8 upstream.
Sparse reports below warnings.
bxt_da7219_max98357a.c:250:9: warning: obsolete array initializer, use C99 syntax bxt_da7219_max98357a.c:275:9: warning: obsolete array initializer, use C99 syntax bxt_da7219_max98357a.c:290:9: warning: obsolete array initializer, use C99 syntax bxt_da7219_max98357a.c:304:9: warning: obsolete array initializer, use C99 syntax bxt_da7219_max98357a.c:317:9: warning: obsolete array initializer, use C99 syntax
There's no need to use obsoleted way. This commit fixes it.
--- sound/soc/intel/boards/bxt_da7219_max98357a.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
sound/soc/intel/boards/bxt_da7219_max98357a.c +6 -6
@@ -255,7 +255,7 @@ static struct snd_soc_ops broxton_da7219/* broxton digital audio interface glue - connects codec <--> CPU */ static struct snd_soc_dai_link broxton_dais[] = {/* Front End DAI links */ - [BXT_DPCM_AUDIO_PB] + [BXT_DPCM_AUDIO_PB ] = { .name ="Bxt Audio Port" , .stream_name ="Audio" ,
@@ -271,7 +271,7 @@ static struct snd_soc_dai_link broxton_d .dpcm_playback = 1, .ops = &broxton_da7219_fe_ops, }, - [BXT_DPCM_AUDIO_CP ] + [BXT_DPCM_AUDIO_CP] = { .name = "Bxt Audio Capture Port", .stream_name = "Audio Record",
@@ -286,7 +286,7 @@ static struct snd_soc_dai_link broxton_d .dpcm_capture = 1, .ops = &broxton_da7219_fe_ops, }, - [BXT_DPCM_AUDIO_REF_CP ] + [BXT_DPCM_AUDIO_REF_CP] = { .name = "Bxt Audio Reference cap", .stream_name = "Refcap",
@@ -300,7 +300,7 @@ static struct snd_soc_dai_link broxton_d .nonatomic = 1, .dynamic = 1, }, - [BXT_DPCM_AUDIO_HDMI1_PB ] + [BXT_DPCM_AUDIO_HDMI1_PB] = { .name = "Bxt HDMI Port1", .stream_name = "Hdmi1",
@@ -313,7 +313,7 @@ static struct snd_soc_dai_link broxton_d .nonatomic = 1, .dynamic = 1, }, - [BXT_DPCM_AUDIO_HDMI2_PB ] + [BXT_DPCM_AUDIO_HDMI2_PB] = { .name = "Bxt HDMI Port2", .stream_name = "Hdmi2",
@@ -326,7 +326,7 @@ static struct snd_soc_dai_link broxton_d .nonatomic = 1, .dynamic = 1, }, - [BXT_DPCM_AUDIO_HDMI3_PB ] + [BXT_DPCM_AUDIO_HDMI3_PB] = { .name = "Bxt HDMI Port3", .stream_name = "Hdmi3",
Greg Kroah-Hartman
maintainerPATCH 67/125 iio: ad5755: fix off-by-one on devnr limit check
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Colin Ian King <[email protected]>
commit 9d47964bfd471f0dd4c89f28556aec68bffa0020 upstream.
The comparison for devnr limits is off-by-one, the current check allows 0 to AD5755_NUM_CHANNELS and the limit should be in fact 0 to AD5755_NUM_CHANNELS - 1. This can lead to an out of bounds write to pdata->dac[devnr]. Fix this by replacing > with >= on the comparison.
--- drivers/iio/dac/ad5755.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dac/ad5755.c +1 -1
@@ -655,7 +655,7 @@ static struct ad5755_platform_data *ad57 devnr =0 ;for_each_child_of_node (np, pp) { -if (devnr >AD5755_NUM_CHANNELS ) { +if (devnr >=AD5755_NUM_CHANNELS ) {dev_err (dev,"There is to many channels defined in DT\n" ); goto error_out;
Greg Kroah-Hartman
maintainerPATCH 68/125 iio: light: us5182d: Add missing error code assignment before test
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe JAILLET <[email protected]>
commit 281269f8a0b00f5c95de5158e8595ed51bdb4b0a upstream.
It is likely that checking the result of 'pm_runtime_set_active' is expected here.
--- drivers/iio/light/us5182d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/light/us5182d.c +1 -1
@@ -894,7 +894,7 @@ static int us5182d_probe(struct i2c_clie goto out_err;if (data->default_continuous) { -pm_runtime_set_active (&client->dev); + ret =pm_runtime_set_active (&client->dev);if (ret <0 ) goto out_err; }
Greg Kroah-Hartman
maintainerPATCH 69/125 staging: android ion/hisi: fix dependencies
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 4a236d01b5e0d7e6f4ee9e6c4056fce10b38e8ad upstream.
The newly added Hi6220 Ion code fails to build when the ION_OF helpers are not present:
drivers/staging/android/ion/hisilicon/hi6220_ion.o: In function `hi6220_ion_remove':
hi6220_ion.c:(.text.hi6220_ion_remove+0x4c): undefined reference to ion_destroy_platform_data' drivers/staging/android/ion/hisilicon/hi6220_ion.o: In function hi6220_ion_probe':
hi6220_ion.c:(.text.hi6220_ion_probe+0x5c): undefined reference to ion_parse_dt' hi6220_ion.c:(.text.hi6220_ion_probe+0xf8): undefined reference to ion_destroy_platform_data'
This selects the symbol when needed.
--- drivers/staging/android/ion/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/staging/android/ion/Kconfig +1 -0
@@ -36,6 +36,7 @@ config ION_TEGRA config ION_HISI tristate "Ion for Hisilicon" depends on ARCH_HISI && ION + select ION_OF help Choose this option if you wish to use ion on Hisilicon Platform.
Greg Kroah-Hartman
maintainerPATCH 70/125 staging: sm750fb: Correctly set CLOCK_PHASE bit of display controller.
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Phil Turnbull <[email protected]>
commit 992f961480d23e9ef9e686e512a419efef723523 upstream.
Commit 6fba39cf32a3 ("staging: sm750fb: use BIT macro for PANEL_DISPLAY_CTRL single-bit fields") accidentally changed the CLOCK_PHASE logic from '|=' to '=' which clears all the previously set bits.
--- drivers/staging/sm750fb/ddk750_mode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/sm750fb/ddk750_mode.c +1 -1
@@ -63,7 +63,7 @@ static unsigned long displayControlAdjus dispControl |= (CRT_DISPLAY_CTRL_CRTSELECT |CRT_DISPLAY_CTRL_RGBBIT );/* Set bit 14 of display controller */ - dispControl =DISPLAY_CTRL_CLOCK_PHASE ; + dispControl |=DISPLAY_CTRL_CLOCK_PHASE ;POKE32 (CRT_DISPLAY_CTRL , dispControl);
Greg Kroah-Hartman
maintainerPATCH 71/125 staging: r8188eu: Fix scheduling while atomic splat
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Larry Finger <[email protected]>
commit 1335a9516d3d52f157ad87456efdd8dc9ae1747b upstream.
Commit fadbe0cd5292851608e2e01b91d9295fa287b9fe ("staging: rtl8188eu:
Remove rtw_zmalloc(), wrapper for kzalloc()") changed all allocation calls to be GFP_KERNEL even though the original wrapper was testing to determine if the caller was in atomic mode. Most of the mistakes were corrected with commit 33dc85c3c667209c930b2dac5ccbc2a365e06b7a ("staging: r8188eu: Fix scheduling while atomic error introduced in commit fadbe0cd"); however, two kzalloc calls were missed as the call only happens when the driver is shutting down.
--- drivers/staging/rtl8188eu/core/rtw_cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8188eu/core/rtw_cmd.c +2 -2
@@ -670,13 +670,13 @@ u8 rtw_addbareq_cmd(struct adapter *padau8 res = _SUCCESS; - ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_KERNEL ); + ph2c =kzalloc (sizeof (struct cmd_obj ),GFP_ATOMIC );if (!ph2c) { res = _FAIL; goto exit; } - paddbareq_parm =kzalloc (sizeof (struct addBaReq_parm ),GFP_KERNEL ); + paddbareq_parm =kzalloc (sizeof (struct addBaReq_parm ),GFP_ATOMIC );if (!paddbareq_parm) {kfree (ph2c); res = _FAIL;
Greg Kroah-Hartman
maintainerPATCH 72/125 staging: ks7010: fix wait_for_completion_interruptible_timeout return handling
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Mc Guire <[email protected]>
commit 9d29f14db1095f52ca00b8162b242d6fce07d19f upstream.
wait_for_completion_interruptible_timeout return 0 on timeout and -ERESTARTSYS if interrupted. The check for !wait_for_completion_interruptible_timeout() would report an interrupt as timeout. Further, while HZ/50 will work most of the time it could fail for HZ < 50, so this is switched to msecs_to_jiffies(20).
--- drivers/staging/ks7010/ks_hostif.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/staging/ks7010/ks_hostif.c +6 -2
@@ -74,11 +74,15 @@ void ks_wlan_hw_wakeup_task(struct work_struct ks_wlan_private *priv = container_of(work, struct ks_wlan_private, ks_wlan_wakeup_task);int ps_status =atomic_read (&priv->psstatus.status); +long time_left;if (ps_status ==PS_SNOOZE ) {ks_wlan_hw_wakeup_request (priv); -if (!wait_for_completion_interruptible_timeout (&priv->psstatus.wakeup_wait,HZ /50 )) {/* 20ms timeout */ -DPRINTK (1 ,"wake up timeout !!!\n" ); + time_left =wait_for_completion_interruptible_timeout ( + &priv->psstatus.wakeup_wait, +msecs_to_jiffies (20 )); +if (time_left <=0 ) { +DPRINTK (1 ,"wake up timeout or interrupted !!!\n" );schedule_work (&priv->ks_wlan_wakeup_task);return ; }
Greg Kroah-Hartman
maintainerPATCH 73/125 staging: ks7010: declare private functions static
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Mc Guire <[email protected]>
commit 9afe11e956766eaac4643adaaf49f223dd536c92 upstream.
Private functions in ks_hostif.c can be declared static.
--- drivers/staging/ks7010/ks_hostif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/ks7010/ks_hostif.c +2 -2
@@ -69,7 +69,7 @@ inline u32 get_DWORD(struct ks_wlan_privreturn data; } -void ks_wlan_hw_wakeup_task (struct work_struct *work) +static void ks_wlan_hw_wakeup_task (struct work_struct *work) {struct ks_wlan_private *priv = container_of(work, struct ks_wlan_private, ks_wlan_wakeup_task);
@@ -1509,7 +1509,7 @@ void hostif_infrastructure_set_request(sks_wlan_hw_tx (priv, pp,hif_align_size (sizeof (*pp)),NULL ,NULL ,NULL ); } -void hostif_infrastructure_set2_request (struct ks_wlan_private *priv) +static void hostif_infrastructure_set2_request (struct ks_wlan_private *priv) {struct hostif_infrastructure_set2_request_t *pp;uint16_t capability;
Greg Kroah-Hartman
maintainerPATCH 74/125 IB/hfi1: Move iowait_init() to priv allocate
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Marciniszyn <[email protected]>
commit 5a648dfad033bf5f945795c4e56ee7577f24f3e9 upstream.
The call is misplaced in the reset calldown function and causes issues with lockdep assertions that are to be added.
--- drivers/infiniband/hw/hfi1/qp.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/infiniband/hw/hfi1/qp.c +7 -7
@@ -808,6 +808,13 @@ void *qp_priv_alloc(struct rvt_dev_infokfree (priv);return ERR_PTR (-ENOMEM ); } +iowait_init ( + &priv->s_iowait, +1 , + _hfi1_do_send, + iowait_sleep, + iowait_wakeup, + iowait_sdma_drained);setup_timer (&priv->s_rnr_timer, hfi1_rc_rnr_retry, (unsigned long )qp); qp->s_timer.function = hfi1_rc_timeout;return priv;
@@ -873,13 +880,6 @@ void notify_qp_reset(struct rvt_qp *qp) {struct hfi1_qp_priv *priv = qp->priv; -iowait_init ( - &priv->s_iowait, -1 , - _hfi1_do_send, - iowait_sleep, - iowait_wakeup, - iowait_sdma_drained); priv->r_adefered =0 ;clear_ahg (qp); }
Greg Kroah-Hartman
maintainerPATCH 75/125 IB/rdmavt: Correct sparse annotation
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Marciniszyn <[email protected]>
commit eefa1d8961584c5b76afded94960ca4344bc638b upstream.
The __must_hold() is sufficent to correct the sparse context imbalance inside a function.
Per Documentation/sparse.txt:__must_hold - The specified lock is held on function entry and exit.
--- drivers/infiniband/sw/rdmavt/qp.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/infiniband/sw/rdmavt/qp.c +3 -6
@@ -501,12 +501,9 @@ static void rvt_remove_qp(struct rvt_dev*/ static void rvt_reset_qp (struct rvt_dev_info *rdi,struct rvt_qp *qp,enum ib_qp_type type) - __releases(&qp->s_lock) - __releases(&qp->s_hlock) - __releases(&qp->r_lock) - __acquires(&qp->r_lock) - __acquires(&qp->s_hlock) - __acquires(&qp->s_lock) + __must_hold(&qp->r_lock) + __must_hold(&qp->s_hlock) + __must_hold(&qp->s_lock) {if (qp->state !=IB_QPS_RESET ) { qp->state =IB_QPS_RESET ;
Greg Kroah-Hartman
maintainerPATCH 76/125 IB/qib: Remove qpt_mask global
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dennis Dalessandro <[email protected]>
commit 84b3adc2430eafd2eb703570075c3c141ea0ff13 upstream.
There is no need to have a global qpt_mask as that does not support the multiple chip model which qib has. Instead rely on the value which exists already in the device data (dd).
--- drivers/infiniband/hw/qib/qib.h | 1 - drivers/infiniband/hw/qib/qib_qp.c | 13 +++---------- drivers/infiniband/hw/qib/qib_verbs.c | 2 -- 3 files changed, 3 insertions(+), 13 deletions(-)
drivers/infiniband/hw/qib/qib.h +0 -1
@@ -1131,7 +1131,6 @@ extern spinlock_t qib_devs_lock;extern struct qib_devdata *qib_lookup (int unit);extern u32 qib_cpulist_count;extern unsigned long *qib_cpulist; -extern u16 qpt_mask;extern unsigned qib_cc_table_size;int qib_init (struct qib_devdata *,int );
drivers/infiniband/hw/qib/qib_qp.c +3 -10
@@ -41,14 +41,6 @@#include "qib.h" -/* -* mask field which was present in now deleted qib_qpn_table -* is not present in rvt_qpn_table. Defining the same field -* as qpt_mask here instead of adding the mask field to -* rvt_qpn_table. -*/ -u16 qpt_mask; -static inline unsigned mk_qpn (struct rvt_qpn_table *qpt,struct rvt_qpn_map *map,unsigned off) {
@@ -57,7 +49,7 @@ static inline unsigned mk_qpn(struct rvtstatic inline unsigned find_next_offset (struct rvt_qpn_table *qpt,struct rvt_qpn_map *map,unsigned off, -unsigned n) +unsigned n,u16 qpt_mask) {if (qpt_mask) { off++;
@@ -179,6 +171,7 @@ int qib_alloc_qpn(struct rvt_dev_info *r struct qib_ibdev *verbs_dev = container_of(rdi, struct qib_ibdev, rdi); struct qib_devdata *dd = container_of(verbs_dev, struct qib_devdata, verbs_dev); +u16 qpt_mask = dd->qpn_mask;if (type ==IB_QPT_SMI || type ==IB_QPT_GSI ) {unsigned n;
@@ -215,7 +208,7 @@ int qib_alloc_qpn(struct rvt_dev_info *r goto bail; } offset =find_next_offset (qpt, map, offset, - dd->n_krcv_queues); + dd->n_krcv_queues, qpt_mask); qpn =mk_qpn (qpt, map, offset);/* * This test differs from alloc_pidmap().
drivers/infiniband/hw/qib/qib_verbs.c +0 -2
@@ -1606,8 +1606,6 @@ int qib_register_ib_device(struct qib_de/* Only need to initialize non-zero fields. */ setup_timer (&dev->mem_timer, mem_timer, (unsigned long )dev); - qpt_mask = dd->qpn_mask; -INIT_LIST_HEAD (&dev->piowait);INIT_LIST_HEAD (&dev->dmawait);INIT_LIST_HEAD (&dev->txwait);
Greg Kroah-Hartman
maintainerPATCH 77/125 IB/mlx5: Fix steering resource leak
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maor Gottlieb <[email protected]>
commit 7055a29471eebf4b62687944694222635ed44b09 upstream.
Fix multicast flow rule leak on adding unicast rule failure.
--- drivers/infiniband/hw/mlx5/main.c | 1 + 1 file changed, 1 insertion(+)
drivers/infiniband/hw/mlx5/main.c +1 -0
@@ -1843,6 +1843,7 @@ static struct mlx5_ib_flow_handler *crea &leftovers_specs[LEFTOVERS_UC ].flow_attr, dst);if (IS_ERR (handler_ucast)) { +mlx5_del_flow_rule (handler->rule);kfree (handler); handler = handler_ucast; }else {
Greg Kroah-Hartman
maintainerPATCH 78/125 power: bq24257: Fix use of uninitialized pointer bq->charger
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Georges Savoundararadj <[email protected]>
commit 0610735928ee47870e083d5901caa371089216f1 upstream.
bq->charger is initialized in bq24257_power_supply_init. Therefore, bq24257_power_supply_init should be called before the registration of the IRQ handler bq24257_irq_handler_thread that calls power_supply_changed(bq->charger).
--- drivers/power/bq24257_charger.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/power/bq24257_charger.c +6 -6
@@ -1068,6 +1068,12 @@ static int bq24257_probe(struct i2c_cliereturn ret; } + ret =bq24257_power_supply_init (bq); +if (ret <0 ) { +dev_err (dev,"Failed to register power supply\n" ); +return ret; + } + ret = devm_request_threaded_irq(dev, client->irq, NULL, bq24257_irq_handler_thread, IRQF_TRIGGER_FALLING |
@@ -1078,12 +1084,6 @@ static int bq24257_probe(struct i2c_cliereturn ret; } - ret =bq24257_power_supply_init (bq); -if (ret <0 ) { -dev_err (dev,"Failed to register power supply\n" ); -return ret; - } - ret =sysfs_create_group (&bq->charger->dev.kobj, &bq24257_attr_group);if (ret <0 ) {dev_err (dev,"Can't create sysfs entries\n" );
Greg Kroah-Hartman
maintainerPATCH 79/125 dmaengine: ipu: remove bogus NO_IRQ reference
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 86c7e6836479c4045a9a81ed5ea76c51d719f9c1 upstream.
A workaround for a warning introduced a use of the NO_IRQ macro that should have been gone for a long time.
It is clear from the code that the value cannot actually be used, but apparently there was a configuration at some point that caused a warning, so instead of just reverting that patch, this rearranges the code in a way that the warning cannot reappear.
--- drivers/dma/ipu/ipu_irq.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/dma/ipu/ipu_irq.c +4 -5
@@ -286,22 +286,21 @@ static void ipu_irq_handler(struct irq_draw_spin_unlock (&bank_lock);while ((line =ffs (status))) {struct ipu_irq_map *map; -unsigned int irq =NO_IRQ ; +unsigned int irq; line--; status &= ~(1UL << line);raw_spin_lock (&bank_lock); map =src2map (32 * i + line); -if (map) - irq = map->irq; -raw_spin_unlock (&bank_lock); -if (!map) { +raw_spin_unlock (&bank_lock);pr_err ("IPU: Interrupt on unmapped source %u bank %d\n" , line, i);continue ; } + irq = map->irq; +raw_spin_unlock (&bank_lock);generic_handle_irq (irq); } }
Greg Kroah-Hartman
maintainerPATCH 80/125 mm/hugetlb: check for reserved hugepages during memory offline
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gerald Schaefer <[email protected]>
commit 082d5b6b60e9f25e1511557fcfcb21eedd267446 upstream.
In dissolve_free_huge_pages(), free hugepages will be dissolved without making sure that there are enough of them left to satisfy hugepage reservations.
Fix this by adding a return value to dissolve_free_huge_pages() and checking h->free_huge_pages vs. h->resv_huge_pages. Note that this may lead to the situation where dissolve_free_huge_page() returns an error and all free hugepages that were dissolved before that error are lost, while the memory block still cannot be set offline.
--- include/linux/hugetlb.h | 6 +++--- mm/hugetlb.c | 26 +++++++++++++++++++++----- mm/memory_hotplug.c | 4 +++- 3 files changed, 27 insertions(+), 9 deletions(-)
include/linux/hugetlb.h +3 -3
@@ -450,8 +450,8 @@ static inline pgoff_t basepage_index(strreturn __basepage_index (page); } -extern void dissolve_free_huge_pages (unsigned long start_pfn, -unsigned long end_pfn); +extern int dissolve_free_huge_pages (unsigned long start_pfn, +unsigned long end_pfn);static inline bool hugepage_migration_supported (struct hstate *h) {#ifdef CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION
@@ -518,7 +518,7 @@ static inline pgoff_t basepage_index(str {return page->index; } -#define dissolve_free_huge_pages (s, e) do {} while (0) +#define dissolve_free_huge_pages (s, e) 0#define hugepage_migration_supported (h) false static inline spinlock_t *huge_pte_lockptr(struct hstate *h,
mm/hugetlb.c +21 -5
@@ -1437,22 +1437,32 @@ static int free_pool_huge_page(struct hs/* * Dissolve a given free hugepage into free buddy pages. This function does -* nothing for in-use (including surplus) hugepages. +* nothing for in-use (including surplus) hugepages. Returns -EBUSY if the +* number of free hugepages would be reduced below the number of reserved +* hugepages. */ -static void dissolve_free_huge_page (struct page *page) +static int dissolve_free_huge_page (struct page *page) { +int rc =0 ; +spin_lock (&hugetlb_lock);if (PageHuge (page) && !page_count (page)) {struct page *head =compound_head (page);struct hstate *h =page_hstate (head);int nid =page_to_nid (head); +if (h->free_huge_pages - h->resv_huge_pages ==0 ) { + rc = -EBUSY ; + goto out; + }list_del (&head->lru); h->free_huge_pages--; h->free_huge_pages_node[nid]--; h->max_huge_pages--;update_and_free_page (h, head); } +out:spin_unlock (&hugetlb_lock); +return rc; }/*
@@ -1460,16 +1470,22 @@ static void dissolve_free_huge_page(stru* make specified memory blocks removable from the system. * Note that this will dissolve a free gigantic hugepage completely, if any * part of it lies within the given range. +* Also note that if dissolve_free_huge_page() returns with an error, all +* free hugepages that were dissolved before that error are lost. */ -void dissolve_free_huge_pages (unsigned long start_pfn,unsigned long end_pfn) +int dissolve_free_huge_pages (unsigned long start_pfn,unsigned long end_pfn) {unsigned long pfn; +int rc =0 ;if (!hugepages_supported ()) -return ; +return rc;for (pfn = start_pfn; pfn < end_pfn; pfn +=1 << minimum_order) -dissolve_free_huge_page (pfn_to_page (pfn)); +if (rc =dissolve_free_huge_page (pfn_to_page (pfn))) +break ; + +return rc; }/*
mm/memory_hotplug.c +3 -1
@@ -1945,7 +1945,9 @@ repeat:* dissolve free hugepages in the memory block before doing offlining * actually in order to make hugetlbfs's object counting consistent. */ -dissolve_free_huge_pages (start_pfn, end_pfn); + ret =dissolve_free_huge_pages (start_pfn, end_pfn); +if (ret) + goto failed_removal;/* check again */ offlined_pages =check_pages_isolated (start_pfn, end_pfn);if (offlined_pages <0 ) {
Greg Kroah-Hartman
maintainerPATCH 81/125 mm/hugetlb: improve locking in dissolve_free_huge_pages()
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gerald Schaefer <[email protected]>
commit eb03aa008561004257900983193d024e57abdd96 upstream.
For every pfn aligned to minimum_order, dissolve_free_huge_pages() will call dissolve_free_huge_page() which takes the hugetlb spinlock, even if the page is not huge at all or a hugepage that is in-use.
Improve this by doing the PageHuge() and page_count() checks already in dissolve_free_huge_pages() before calling dissolve_free_huge_page(). In dissolve_free_huge_page(), when holding the spinlock, those checks need to be revalidated.
--- mm/hugetlb.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
mm/hugetlb.c +9 -3
@@ -1476,14 +1476,20 @@ out:int dissolve_free_huge_pages (unsigned long start_pfn,unsigned long end_pfn) {unsigned long pfn; +struct page *page;int rc =0 ;if (!hugepages_supported ())return rc; -for (pfn = start_pfn; pfn < end_pfn; pfn +=1 << minimum_order) -if (rc =dissolve_free_huge_page (pfn_to_page (pfn))) -break ; +for (pfn = start_pfn; pfn < end_pfn; pfn +=1 << minimum_order) { + page =pfn_to_page (pfn); +if (PageHuge (page) && !page_count (page)) { + rc =dissolve_free_huge_page (page); +if (rc) +break ; + } + }return rc; }
Greg Kroah-Hartman
maintainerPATCH 82/125 drm/vmwgfx: Avoid validating views on view destruction
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Hellstrom <[email protected]>
commit a19440304db2d97aed5cee9bfa5017c98d2348bf upstream.
When a view destruction command was present in the command stream, the view was validated to avoid a device error. That caused excessive and unnecessary validations of views, surfaces and mobs on view destruction.
Replace this with a new relocation type that patches the view destruction command to a NOP if the view is not present in the device after the execbuf validation sequence.
Also add checks for the member size of the vmw_res_relocation struct.
Fixes sporadic command submission errors on google-earth exit.
--- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 70 ++++++++++++++++++++++++++------ 1 file changed, 57 insertions(+), 13 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +57 -13
@@ -34,6 +34,24 @@#define VMW_RES_HT_ORDER 12 +/** +* enum vmw_resource_relocation_type - Relocation type for resources +* +* @vmw_res_rel_normal: Traditional relocation. The resource id in the +* command stream is replaced with the actual id after validation. +* @vmw_res_rel_nop: NOP relocation. The command is unconditionally replaced +* with a NOP. +* @vmw_res_rel_cond_nop: Conditional NOP relocation. If the resource id +* after validation is -1, the command is replaced with a NOP. Otherwise no +* action. +*/ +enum vmw_resource_relocation_type { + vmw_res_rel_normal, + vmw_res_rel_nop, + vmw_res_rel_cond_nop, + vmw_res_rel_max +}; +/** * struct vmw_resource_relocation - Relocation info for resources *
@@ -41,11 +59,13 @@* @res: Non-ref-counted pointer to the resource. * @offset: Offset of 4 byte entries into the command buffer where the * id that needs fixup is located. +* @rel_type: Type of relocation. */ struct vmw_resource_relocation {struct list_head head;const struct vmw_resource *res; -unsigned long offset; +u32 offset:29 ; +enum vmw_resource_relocation_type rel_type:3 ; };/**
@@ -410,10 +430,13 @@ static int vmw_resource_context_res_add(* @res: The resource. * @offset: Offset into the command buffer currently being parsed where the * id that needs fixup is located. Granularity is 4 bytes. +* @rel_type: Relocation type. */ static int vmw_resource_relocation_add (struct list_head *list,const struct vmw_resource *res, -unsigned long offset) +unsigned long offset, +enum vmw_resource_relocation_type + rel_type) {struct vmw_resource_relocation *rel;
@@ -425,6 +448,7 @@ static int vmw_resource_relocation_add(s rel->res = res; rel->offset = offset; + rel->rel_type = rel_type;list_add_tail (&rel->head, list);return 0 ;
@@ -459,11 +483,23 @@ static void vmw_resource_relocations_app {struct vmw_resource_relocation *rel; +/* Validate the struct vmw_resource_relocation member size */ +BUILD_BUG_ON (SVGA_CB_MAX_SIZE >= (1 <<29 )); +BUILD_BUG_ON (vmw_res_rel_max >= (1 <<3 )); +list_for_each_entry (rel, list, head) { -if (likely (rel->res !=NULL )) +switch (rel->rel_type) { +case vmw_res_rel_normal: cb[rel->offset] = rel->res->id; -else +break ; +case vmw_res_rel_nop: cb[rel->offset] =SVGA_3D_CMD_NOP ; +break ; +default : +if (rel->res->id ==-1 ) + cb[rel->offset] =SVGA_3D_CMD_NOP ; +break ; + } } }
@@ -655,7 +691,8 @@ static int vmw_cmd_res_reloc_add(struct *p_val =NULL ; ret =vmw_resource_relocation_add (&sw_context->res_relocations, res, - id_loc - sw_context->buf_start); + id_loc - sw_context->buf_start, + vmw_res_rel_normal);if (unlikely (ret !=0 ))return ret;
@@ -721,7 +758,8 @@ vmw_cmd_res_check(struct vmw_private *dereturn vmw_resource_relocation_add (&sw_context->res_relocations, res, - id_loc - sw_context->buf_start); + id_loc - sw_context->buf_start, + vmw_res_rel_normal); } ret = vmw_user_resource_lookup_handle(dev_priv,
@@ -2144,7 +2182,8 @@ static int vmw_cmd_shader_define(structreturn vmw_resource_relocation_add (&sw_context->res_relocations,NULL , &cmd->header.id - - sw_context->buf_start); + sw_context->buf_start, + vmw_res_rel_nop);return 0 ; }
@@ -2189,7 +2228,8 @@ static int vmw_cmd_shader_destroy(structreturn vmw_resource_relocation_add (&sw_context->res_relocations,NULL , &cmd->header.id - - sw_context->buf_start); + sw_context->buf_start, + vmw_res_rel_nop);return 0 ; }
@@ -2848,8 +2888,7 @@ static int vmw_cmd_dx_cid_check(struct v* @header: Pointer to the command header in the command stream. * * Check that the view exists, and if it was not created using this -* command batch, make sure it's validated (present in the device) so that -* the remove command will not confuse the device. +* command batch, conditionally make this command a NOP. */ static int vmw_cmd_dx_view_remove(struct vmw_private *dev_priv, struct vmw_sw_context *sw_context,
@@ -2877,10 +2916,15 @@ static int vmw_cmd_dx_view_remove(structreturn ret;/* -* Add view to the validate list iff it was not created using this -* command batch. +* If the view wasn't created during this command batch, it might +* have been removed due to a context swapout, so add a +* relocation to conditionally make this command a NOP to avoid +* device errors. */ -return vmw_view_res_val_add (sw_context, view); +return vmw_resource_relocation_add (&sw_context->res_relocations, + view, + &cmd->header.id - sw_context->buf_start, + vmw_res_rel_cond_nop); }/**
Greg Kroah-Hartman
maintainerPATCH 83/125 s390/cio: fix accidental interrupt enabling during resume
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Ott <[email protected]>
commit d53c51f26145657aa7c55fa396f93677e613548d upstream.
Since commit 9f3d6d7 chsc_get_channel_measurement_chars is called with interrupts disabled during resume from hibernate. Since this function used spin_unlock_irq, interrupts have been enabled accidentally. Fix this by using the irqsave variant.
Since we can't guarantee the IRQ-enablement state for all (future/ external) callers, change the locking in related functions to prevent similar bugs in the future.
--- drivers/s390/cio/chsc.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
drivers/s390/cio/chsc.c +12 -8
@@ -95,12 +95,13 @@ struct chsc_ssd_area {int chsc_get_ssd_info (struct subchannel_id schid,struct chsc_ssd_info *ssd) {struct chsc_ssd_area *ssd_area; +unsigned long flags;int ccode;int ret;int i;int mask; -spin_lock_irq (&chsc_page_lock); +spin_lock_irqsave (&chsc_page_lock, flags);memset (chsc_page,0 ,PAGE_SIZE ); ssd_area = chsc_page; ssd_area->request.length =0x0010 ;
@@ -144,7 +145,7 @@ int chsc_get_ssd_info(struct subchannel_ ssd->fla[i] = ssd_area->fla[i]; } out: -spin_unlock_irq (&chsc_page_lock); +spin_unlock_irqrestore (&chsc_page_lock, flags);return ret; }
@@ -832,9 +833,10 @@ int __chsc_do_secm(struct channel_subsys u32 fmt : 4; u32 :16 ; } __attribute__ ((packed)) *secm_area; +unsigned long flags;int ret, ccode; -spin_lock_irq (&chsc_page_lock); +spin_lock_irqsave (&chsc_page_lock, flags);memset (chsc_page,0 ,PAGE_SIZE ); secm_area = chsc_page; secm_area->request.length =0x0050 ;
@@ -864,7 +866,7 @@ int __chsc_do_secm(struct channel_subsysCIO_CRW_EVENT (2 ,"chsc: secm failed (rc=%04x)\n" , secm_area->response.code); out: -spin_unlock_irq (&chsc_page_lock); +spin_unlock_irqrestore (&chsc_page_lock, flags);return ret; }
@@ -992,6 +994,7 @@ chsc_initialize_cmg_chars(struct channelint chsc_get_channel_measurement_chars (struct channel_path *chp) { +unsigned long flags;int ccode, ret;struct {
@@ -1021,7 +1024,7 @@ int chsc_get_channel_measurement_chars(sif (!css_chsc_characteristics.scmc || !css_chsc_characteristics.secm)return -EINVAL ; -spin_lock_irq (&chsc_page_lock); +spin_lock_irqsave (&chsc_page_lock, flags);memset (chsc_page,0 ,PAGE_SIZE ); scmc_area = chsc_page; scmc_area->request.length =0x0010 ;
@@ -1053,7 +1056,7 @@ int chsc_get_channel_measurement_chars(schsc_initialize_cmg_chars (chp, scmc_area->cmcv, (struct cmg_chars *) &scmc_area->data); out: -spin_unlock_irq (&chsc_page_lock); +spin_unlock_irqrestore (&chsc_page_lock, flags);return ret; }
@@ -1134,6 +1137,7 @@ struct css_chsc_char css_chsc_characteriint __init chsc_determine_css_characteristics (void ) { +unsigned long flags;int result;struct {struct chsc_header request;
@@ -1146,7 +1150,7 @@ chsc_determine_css_characteristics(void)u32 chsc_char[508 ]; } __attribute__ ((packed)) *scsc_area; -spin_lock_irq (&chsc_page_lock); +spin_lock_irqsave (&chsc_page_lock, flags);memset (chsc_page,0 ,PAGE_SIZE ); scsc_area = chsc_page; scsc_area->request.length =0x0010 ;
@@ -1168,7 +1172,7 @@ chsc_determine_css_characteristics(void)CIO_CRW_EVENT (2 ,"chsc: scsc failed (rc=%04x)\n" , scsc_area->response.code); exit: -spin_unlock_irq (&chsc_page_lock); +spin_unlock_irqrestore (&chsc_page_lock, flags);return result; }
Greg Kroah-Hartman
maintainerPATCH 84/125 s390/con3270: fix use of uninitialised data
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sascha Silbe <[email protected]>
commit c14f2aac7aa147861793eed9f41f91dd530f0be1 upstream.
con3270 contains an optimisation that reduces the amount of data to be transmitted to the 3270 terminal by putting a Repeat to Address (RA) order into the data stream. The RA order itself takes up space, so con3270 only uses it if there's enough space left in the line buffer. Otherwise it just pads out the line manually.
For lines too long to include the RA order, one byte was left uninitialised. This was caused by an off-by-one bug in the loop that pads out the line. Since the buffer is allocated from a common pool, the single byte left uninitialised contained some previous buffer content. Usually this was just a space or some character (which can result in clutter but is otherwise harmless). Sometimes, however, it was a Repeat to Address order, messing up the entire screen layout and causing the display to send the entire buffer content on every keystroke.
--- drivers/s390/char/con3270.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/char/con3270.c +1 -1
@@ -464,7 +464,7 @@ con3270_cline_end(struct con3270 *cp) s->string[s->len -4 ] =TO_RA ; s->string[s->len -1 ] =0 ; }else { -while (--size > cp->cline->len) +while (--size >= cp->cline->len) s->string[size] = cp->view.ascebc[' ' ]; }/* Replace cline with allocated line s and reset cline. */
Greg Kroah-Hartman
maintainerPATCH 85/125 s390/con3270: fix insufficient space padding
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sascha Silbe <[email protected]>
commit 6cd997db911f28f2510b771691270c52b63ed2e6 upstream.
con3270 contains an optimisation that reduces the amount of data to be transmitted to the 3270 terminal by putting a Repeat to Address (RA) order into the data stream. The RA order itself takes up space, so con3270 only uses it if there's enough space left in the line buffer. Otherwise it just pads out the line manually.
For lines that were _just_ short enough that the RA order still fit in the line buffer, the line was instead padded with an insufficient amount of spaces. This was caused by examining the size of the allocated line buffer rather than the length of the string to be displayed.
For con3270_cline_end(), we just compare against the line length. For con3270_update_string() however that isn't available anymore, so we check whether the Repeat to Address order is present.
--- drivers/s390/char/con3270.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/s390/char/con3270.c +7 -2
@@ -124,7 +124,12 @@ con3270_create_status(struct con3270 *cpstatic void con3270_update_string (struct con3270 *cp,struct string *s,int nr) { -if (s->len >= cp->view.cols -5 ) +if (s->len <4 ) { +/* This indicates a bug, but printing a warning would +* cause a deadlock. */ +return ; + } +if (s->string[s->len -4 ] !=TO_RA )return ;raw3270_buffer_address (cp->view.dev, s->string + s->len -3 , cp->view.cols * (nr +1 ));
@@ -460,7 +465,7 @@ con3270_cline_end(struct con3270 *cp) cp->cline->len + 4 : cp->view.cols; s =con3270_alloc_string (cp, size);memcpy (s->string, cp->cline->string, cp->cline->len); -if (s->len < cp->view.cols -5 ) { +if (cp->cline->len < cp->view.cols -5 ) { s->string[s->len -4 ] =TO_RA ; s->string[s->len -1 ] =0 ; }else {
Greg Kroah-Hartman
maintainerPATCH 86/125 clk: bcm2835: Skip PLLC clocks when deciding on a new clock parent
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Anholt <[email protected]>
commit 67615c588a059b731df9d019edc3c561d8006ec9 upstream.
If the firmware had set up a clock to source from PLLC, go along with it. But if we're looking for a new parent, we don't want to switch it to PLLC because the firmware will force PLLC (and thus the AXI bus clock) to different frequencies during over-temp/under-voltage, without notification to Linux.
On my system, this moves the Linux-enabled HDMI state machine and DSI1 escape clock over to plld_per from pllc_per. EMMC still ends up on pllc_per, because the firmware had set it up to use that.
--- drivers/clk/bcm/clk-bcm2835.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
drivers/clk/bcm/clk-bcm2835.c +23 -0
@@ -1006,16 +1006,28 @@ static int bcm2835_clock_set_rate(structreturn 0 ; } +static bool +bcm2835_clk_is_pllc (struct clk_hw *hw) +{ +if (!hw) +return false; + +return strncmp (clk_hw_get_name (hw),"pllc" ,4 ) ==0 ; +} +static int bcm2835_clock_determine_rate (struct clk_hw *hw,struct clk_rate_request *req) {struct bcm2835_clock *clock =bcm2835_clock_from_hw (hw);struct clk_hw *parent, *best_parent =NULL ; +bool current_parent_is_pllc;unsigned long rate, best_rate =0 ;unsigned long prate, best_prate =0 ;size_t i;u32 div; + current_parent_is_pllc =bcm2835_clk_is_pllc (clk_hw_get_parent (hw)); +/* * Select parent clock that results in the closest but lower rate */
@@ -1023,6 +1035,17 @@ static int bcm2835_clock_determine_rate( parent =clk_hw_get_parent_by_index (hw, i);if (!parent)continue ; + +/* +* Don't choose a PLLC-derived clock as our parent +* unless it had been manually set that way. PLLC's +* frequency gets adjusted by the firmware due to +* over-temp or under-voltage conditions, without +* prior notification to our clock consumer. +*/ +if (bcm2835_clk_is_pllc (parent) && !current_parent_is_pllc) +continue ; + prate =clk_hw_get_rate (parent); div =bcm2835_clock_choose_div (hw, req->rate, prate, true); rate =bcm2835_clock_rate_from_divisor (clock, prate, div);
Greg Kroah-Hartman
maintainerPATCH 87/125 clk: gcc-msm8996: Fix pcie 2 pipe register offset
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Srinivas Kandagatla <[email protected]>
commit ce61966c05f276294b6be04d1765ad0d827ddefd upstream.
This patch corrects the register offset for pcie2 pipe clock. Offset according to datasheet is 0x6e018 instead of 0x6e108.
--- drivers/clk/qcom/gcc-msm8996.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/qcom/gcc-msm8996.c +2 -2
@@ -2592,9 +2592,9 @@ static struct clk_branch gcc_pcie_2_aux_ };static struct clk_branch gcc_pcie_2_pipe_clk = { - .halt_reg =0x6e108 , + .halt_reg =0x6e018 , .clkr = { - .enable_reg =0x6e108 , + .enable_reg =0x6e018 , .enable_mask =BIT (0 ), .hw.init = &(struct clk_init_data ){ .name ="gcc_pcie_2_pipe_clk" ,
Greg Kroah-Hartman
maintainerPATCH 88/125 clk: qcom: select GDSC for msm8996 gcc and mmcc
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Srinivas Kandagatla <[email protected]>
commit 6d91f2c0141330b919ae4d13395f38c341469564 upstream.
This patch selects QCOM_GDSC Kconfig for msm8996 GCC and MMCC clock controllers, as these provide some of the gdscs on the SOC.
Also selecting this config will make it align with other drivers which do the same.
--- drivers/clk/qcom/Kconfig | 2 ++ 1 file changed, 2 insertions(+)
drivers/clk/qcom/Kconfig +2 -0
@@ -117,6 +117,7 @@ config MSM_MMCC_8974 config MSM_GCC_8996 tristate "MSM8996 Global Clock Controller" + select QCOM_GDSC depends on COMMON_CLK_QCOM help Support for the global clock controller on msm8996 devices.
@@ -126,6 +127,7 @@ config MSM_GCC_8996 config MSM_MMCC_8996 tristate "MSM8996 Multimedia Clock Controller" select MSM_GCC_8996 + select QCOM_GDSC depends on COMMON_CLK_QCOM help Support for the multimedia clock controller on msm8996 devices.
Greg Kroah-Hartman
maintainerPATCH 89/125 clk: qoriq: fix a register offset error
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tang Yuantian <[email protected]>
commit 8964193f6bfda5c4cf14eedb7e94892c1f1c34f0 upstream.
The offset of Core Cluster clock control/status register on cluster group V3 version is different from others, and should be plus 0x70000.
--- drivers/clk/clk-qoriq.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/clk/clk-qoriq.c +5 -1
@@ -766,7 +766,11 @@ static struct clk * __init create_one_cmif (!hwc)return NULL ; - hwc->reg = cg->regs +0x20 * idx; +if (cg->info.flags &CG_VER3 ) + hwc->reg = cg->regs +0x70000 +0x20 * idx; +else + hwc->reg = cg->regs +0x20 * idx; + hwc->info = cg->info.cmux_groups[cg->info.cmux_to_group[idx]];/*
Greg Kroah-Hartman
maintainerPATCH 90/125 clk: Return errors from clk providers in __of_clk_get_from_provider()
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Boyd <[email protected]>
commit f155d15b64e36b45ca89e3521fe0c1ccad5e5ff0 upstream.
Before commit 0861e5b8cf80 (clk: Add clk_hw OF clk providers, 2016-02-05) __of_clk_get_from_provider() would return an error pointer of the provider's choosing if there was a provider registered and EPROBE_DEFER otherwise. After that commit, it would return EPROBE_DEFER regardless of whether or not the provider returned an error. This is odd and can lead to behavior where clk consumers keep probe deferring when they should be seeing some other error.
Let's restore the previous behavior where we only return EPROBE_DEFER when there isn't a provider in our of_clk_providers list. Otherwise, return the error from the last provider we find that matches the node.
--- drivers/clk/clk.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/clk/clk.c +5 -4
@@ -3186,7 +3186,7 @@ struct clk *__of_clk_get_from_provider(s {struct of_clk_provider *provider;struct clk *clk =ERR_PTR (-EPROBE_DEFER ); -struct clk_hw *hw =ERR_PTR (-EPROBE_DEFER ); +struct clk_hw *hw;if (!clkspec)return ERR_PTR (-EINVAL );
@@ -3194,12 +3194,13 @@ struct clk *__of_clk_get_from_provider(s/* Check if we have such a provider in our array */ mutex_lock (&of_clk_mutex);list_for_each_entry (provider, &of_clk_providers, link) { -if (provider->node == clkspec->np) +if (provider->node == clkspec->np) { hw =__of_clk_get_hw_from_provider (provider, clkspec); -if (!IS_ERR (hw)) { clk =__clk_create_clk (hw, dev_id, con_id); + } -if (!IS_ERR (clk) && !__clk_get (clk)) { +if (!IS_ERR (clk)) { +if (!__clk_get (clk)) {__clk_free_clk (clk); clk =ERR_PTR (-ENOENT ); }
Greg Kroah-Hartman
maintainerPATCH 91/125 clk: core: Force setting the phase delay when no change
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jean-Francois Moine <[email protected]>
commit 3174b0c9a62bb3738b4a2a506b8a075d4430e353 upstream.
This patch reverts commit 023bd7166be0 ("clk: skip unnecessary set_phase if nothing to do"), fixing two problems:
* in some SoCs, the hardware phase delay depends on the rate ratio of the clock and its parent. So, changing this ratio may imply to set new hardware values, even if the logical delay is the same.
* when the delay was the same as previously, an error was returned.
--- drivers/clk/clk.c | 5 ----- 1 file changed, 5 deletions(-)
drivers/clk/clk.c +0 -5
@@ -1908,10 +1908,6 @@ int clk_set_phase(struct clk *clk, int dclk_prepare_lock (); -/* bail early if nothing to do */ -if (degrees == clk->core->phase) - goto out; -trace_clk_set_phase (clk->core, degrees);if (clk->core->ops->set_phase)
@@ -1922,7 +1918,6 @@ int clk_set_phase(struct clk *clk, int dif (!ret) clk->core->phase = degrees; -out:clk_prepare_unlock ();return ret;
Greg Kroah-Hartman
maintainerPATCH 92/125 clk: divider: Fix clk_divider_round_rate() to use clk_readl()
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
commit 2cf9a57811bddb6fa6b0f8d7376da164d5534813 upstream.
clk-divider uses clk_readl()/clk_writel() everywhere, except in clk_divider_round_rate(), where plain readl() is used. Change this to clk_readl(), as it makes a difference on powerpc.
--- drivers/clk/clk-divider.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/clk-divider.c +1 -1
@@ -352,7 +352,7 @@ static long clk_divider_round_rate(struc/* if read only, just return current value */ if (divider->flags &CLK_DIVIDER_READ_ONLY ) { - bestdiv =readl (divider->reg) >> divider->shift; + bestdiv =clk_readl (divider->reg) >> divider->shift; bestdiv &=div_mask (divider->width); bestdiv =_get_div (divider->table, bestdiv, divider->flags, divider->width);
Greg Kroah-Hartman
maintainerPATCH 93/125 perf data: Fix building in 32 bit platform with libbabeltrace
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wang Nan <[email protected]>
commit f2c8852e6e990fcab0d9e68de9d86e5fbea0b5dc upstream.
On ARM32 building it report following error when we build with libbabeltrace:
util/data-convert-bt.c: In function 'add_bpf_output_values':
util/data-convert-bt.c:440:3: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'unsigned int' [-Werror=format]
cc1: all warnings being treated as errors
Fix it by changing %lu to %zu.
--- tools/perf/util/data-convert-bt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/data-convert-bt.c +1 -1
@@ -437,7 +437,7 @@ add_bpf_output_values(struct bt_ctf_evenint ret;if (nr_elements *sizeof (u32) != raw_size) -pr_warning ("Incorrect raw_size (%u) in bpf output event, skip %lu bytes\n" , +pr_warning ("Incorrect raw_size (%u) in bpf output event, skip %zu bytes\n" , raw_size, nr_elements *sizeof (u32) - raw_size); len_type =bt_ctf_event_class_get_field_by_name (event_class,"raw_len" );
Greg Kroah-Hartman
maintainerPATCH 94/125 perf hists browser: Fix event group display
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namhyung Kim <[email protected]>
commit d9ea48bc4e7cc297ca1073fa3f90ed80d964b7b4 upstream.
Milian reported that the event group on TUI shows duplicated overhead. This was due to a bug on calculating hpp->buf position. The hpp_advance() was called from __hpp__slsmg_color_printf() on TUI but it's already called from the hpp__call_print_fn macro in __hpp__fmt(). The end result is that the print function returns number of bytes it printed but the buffer advanced twice of the length.
This is generally not a problem since it doesn't need to access the buffer again. But with event group, overhead needs to be printed multiple times and hist_entry__snprintf_alignment() tries to fill the space with buffer after it printed. So it (brokenly) showed the last overhead again.
The bug was there from the beginning, but I think it's only revealed when the alignment function was added.
--- tools/perf/ui/browsers/hists.c | 1 - 1 file changed, 1 deletion(-)
tools/perf/ui/browsers/hists.c +0 -1
@@ -1091,7 +1091,6 @@ static int __hpp__slsmg_color_printf(str ret =scnprintf (hpp->buf, hpp->size, fmt, len, percent);ui_browser__printf (arg->b,"%s" , hpp->buf); -advance_hpp (hpp, ret);return ret; }
Greg Kroah-Hartman
maintainerPATCH 95/125 perf powerpc: Fix build-test failure
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ravi Bangoria <[email protected]>
commit 25b8592e912f085ce2ff736a2927584ddeab238c upstream.
'make -C tools/perf build-test' is failing with below log for poewrpc.
In file included from /tmp/tmp.3eEwmGlYaF/perf-4.8.0-rc4/tools/perf/perf.h:15:0,
from util/cpumap.h:8,
from util/env.c:1: /tmp/tmp.3eEwmGlYaF/perf-4.8.0-rc4/tools/perf/perf-sys.h:23:56:
fatal error: ../../arch/powerpc/include/uapi/asm/unistd.h: No such file or directory compilation terminated.
I bisected it and found it's failing from commit ad430729ae00 ("Remove:
kernel unistd*h files from perf's MANIFEST, not used").
Header file '../../arch/powerpc/include/uapi/asm/unistd.h' is included only for powerpc in tools/perf/perf-sys.h.
By looking closly at commit history, I found little weird thing:
Commit f2d9cae9ea9e ("perf powerpc: Use uapi/unistd.h to fix build error") replaced 'asm/unistd.h' with 'uapi/asm/unistd.h'
Commit d2709c7ce4c5 ("perf: Make perf build for x86 with UAPI disintegration applied") removes all arch specific 'uapi/asm/unistd.h' for all archs and adds generic <asm/unistd.h>.
Commit f0b9abfb0446 ("Merge branch 'linus' into perf/core") again includes 'uapi/asm/unistd.h' for powerpc. Don't know how exactly this happened as this change is not part of commit also.
--- tools/perf/perf-sys.h | 1 - 1 file changed, 1 deletion(-)
tools/perf/perf-sys.h +0 -1
@@ -20,7 +20,6 @@#endif #ifdef __powerpc__ -#include "../../arch/powerpc/include/uapi/asm/unistd.h" #define CPUINFO_PROC {"cpu"}#endif
Greg Kroah-Hartman
maintainerPATCH 97/125 perf ui/stdio: Always reset output width for hierarchy
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namhyung Kim <[email protected]>
commit 9a6ad25b5a2026ba1399abc879ec623957867e79 upstream.
When the --hierarchy option is used, each entry has its own hpp_list to show the result. But it is not updating the width of each column for perf-top. The perf-report command has no problem since it resets it during header display.
$ sudo perf top --hierarchy --stdio
PerfTop: 160 irqs/sec kernel:38.8% exact: 100.0%
[4000Hz cycles:pp], (all, 12 CPUs)
----------------------------------------------------------------------
52.32% perf
24.74% [.] __symbols__insert
5.62% [.] rb_next
5.14% [.] dso__load_symMove the code into hists__fprintf() so that it can be called always. Also it'd be better to put similar code together.
--- tools/perf/ui/stdio/hist.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
tools/perf/ui/stdio/hist.c +6 -8
@@ -628,14 +628,6 @@ hists__fprintf_hierarchy_headers(structstruct perf_hpp *hpp, FILE *fp) { - struct perf_hpp_list_node *fmt_node; -struct perf_hpp_fmt *fmt; - -list_for_each_entry (fmt_node, &hists->hpp_formats, list) { -perf_hpp_list__for_each_format (&fmt_node->hpp, fmt) -perf_hpp__reset_width (fmt, hists); - } - return print_hierarchy_header(hists, hpp, symbol_conf.field_sep, fp); }
@@ -714,6 +706,7 @@ size_t hists__fprintf(struct hists *hist bool use_callchain) {struct perf_hpp_fmt *fmt; +struct perf_hpp_list_node *node;struct rb_node *nd;size_t ret =0 ;const char *sep = symbol_conf.field_sep;
@@ -726,6 +719,11 @@ size_t hists__fprintf(struct hists *histhists__for_each_format (hists, fmt)perf_hpp__reset_width (fmt, hists); +/* hierarchy entries have their own hpp list */ +list_for_each_entry (node, &hists->hpp_formats, list) { +perf_hpp_list__for_each_format (&node->hpp, fmt) +perf_hpp__reset_width (fmt, hists); + }if (symbol_conf.col_width_list_str)perf_hpp__set_user_width (symbol_conf.col_width_list_str);
Greg Kroah-Hartman
maintainerPATCH 98/125 perf symbols: Check symbol_conf.allow_aliases for kallsyms loading too
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnaldo Carvalho de Melo <[email protected]>
commit c97b40e4d15f13a36cd037d598e45cbe9e1e5757 upstream.
We can allow aliases to be kept, but we were checking this just when loading vmlinux files, be consistent, do it for any symbol table loading code that calls symbol__fixup_duplicate() by making this function check .allow_aliases instead.
--- tools/perf/util/symbol-elf.c | 3 +-- tools/perf/util/symbol.c | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-)
tools/perf/util/symbol-elf.c +1 -2
@@ -1113,8 +1113,7 @@ new_symbol:* For misannotated, zeroed, ASM function sizes. */ if (nr >0 ) { -if (!symbol_conf.allow_aliases) -symbols__fixup_duplicate (&dso->symbols[map->type]); +symbols__fixup_duplicate (&dso->symbols[map->type]);symbols__fixup_end (&dso->symbols[map->type]);if (kmap) {/*
tools/perf/util/symbol.c +3 -0
@@ -152,6 +152,9 @@ void symbols__fixup_duplicate(struct rb_struct rb_node *nd;struct symbol *curr, *next; +if (symbol_conf.allow_aliases) +return ; + nd =rb_first (symbols);while (nd) {
Greg Kroah-Hartman
maintainerPATCH 99/125 perf symbols: Fixup symbol sizes before picking best ones
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnaldo Carvalho de Melo <[email protected]>
commit 432746f8e0b6a82ba832b771afe31abd51af6752 upstream.
When we call symbol__fixup_duplicate() we use algorithms to pick the "best" symbols for cases where there are various functions/aliases to an address, and those check zero size symbols, which, before calling symbol__fixup_end() are _all_ symbols in a just parsed kallsyms file.
So first fixup the end, then fixup the duplicates.
Found while trying to figure out why 'perf test vmlinux' failed, see the output of 'perf test -v vmlinux' to see cases where the symbols picked as best for vmlinux don't match the ones picked for kallsyms.
--- tools/perf/util/symbol-elf.c | 2 +- tools/perf/util/symbol.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
tools/perf/util/symbol-elf.c +1 -1
@@ -1113,8 +1113,8 @@ new_symbol:* For misannotated, zeroed, ASM function sizes. */ if (nr >0 ) { -symbols__fixup_duplicate (&dso->symbols[map->type]);symbols__fixup_end (&dso->symbols[map->type]); +symbols__fixup_duplicate (&dso->symbols[map->type]);if (kmap) {/* * We need to fixup this here too because we create new
tools/perf/util/symbol.c +1 -1
@@ -1237,8 +1237,8 @@ int __dso__load_kallsyms(struct dso *dsoif (kallsyms__delta (map, filename, &delta))return -1 ; -symbols__fixup_duplicate (&dso->symbols[map->type]);symbols__fixup_end (&dso->symbols[map->type]); +symbols__fixup_duplicate (&dso->symbols[map->type]);if (dso->kernel ==DSO_TYPE_GUEST_KERNEL ) dso->symtab_type =DSO_BINARY_TYPE__GUEST_KALLSYMS ;
Greg Kroah-Hartman
maintainerPATCH 100/125 iwlwifi: check for valid ethernet address provided by OEM
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haim Dreyfuss <[email protected]>
commit a6c934b364948cd4de5bd9ab055bb65206ec70f3 upstream.
In 9000 family products we added an option to let the OEM fuse the mac address via registers. If these registers are zeroed we use the OTP address instead. Make sure that the address provided by the OEM is valid and, if not, fall back to the OTP address as well.
--- drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +10 -5
@@ -564,11 +564,16 @@ static void iwl_set_hw_address_from_csr(__le32 mac_addr0 =cpu_to_le32 (iwl_read32 (trans,CSR_MAC_ADDR0_STRAP ));__le32 mac_addr1 =cpu_to_le32 (iwl_read32 (trans,CSR_MAC_ADDR1_STRAP )); -/* If OEM did not fuse address - get it from OTP */ -if (!mac_addr0 && !mac_addr1) { - mac_addr0 =cpu_to_le32 (iwl_read32 (trans,CSR_MAC_ADDR0_OTP )); - mac_addr1 =cpu_to_le32 (iwl_read32 (trans,CSR_MAC_ADDR1_OTP )); - } +iwl_flip_hw_address (mac_addr0, mac_addr1, data->hw_addr); +/* +* If the OEM fused a valid address, use it instead of the one in the +* OTP +*/ +if (is_valid_ether_addr (data->hw_addr)) +return ; + + mac_addr0 =cpu_to_le32 (iwl_read32 (trans,CSR_MAC_ADDR0_OTP )); + mac_addr1 =cpu_to_le32 (iwl_read32 (trans,CSR_MAC_ADDR1_OTP ));iwl_flip_hw_address (mac_addr0, mac_addr1, data->hw_addr); }
Greg Kroah-Hartman
maintainerPATCH 101/125 iwlwifi: mvm: fix pending frames tracking on tx resp
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Liad Kaufman <[email protected]>
commit 7585c354637bb003ce612dd22f5047c015545ef4 upstream.
In iwl_mvm_rx_tx_cmd_single(), when checking if a given TID is aggregated, the driver doesn't check whether or not the queue itself can be aggregated. For example, a management queue might be marked as aggregated if TID 0 is aggregated on a (different) data queue.
Make sure that mgmt frames are sent with TID IWL_TID_NON_QOS, and in this way make sure no mixups of this sort happen.
--- drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/tx.c +5 -1
@@ -903,9 +903,13 @@ static int iwl_mvm_tx_mpdu(struct iwl_mv tid =IWL_MAX_TID_COUNT ; } -if (iwl_mvm_is_dqa_supported (mvm)) +if (iwl_mvm_is_dqa_supported (mvm)) { txq_id = mvmsta->tid_data[tid].txq_id; +if (ieee80211_is_mgmt (fc)) + tx_cmd->tid_tspec =IWL_TID_NON_QOS ; + } +/* Copy MAC header from skb into command buffer */ memcpy (tx_cmd->hdr, hdr, hdrlen);
Greg Kroah-Hartman
maintainerPATCH 102/125 iwlwifi: mvm: call a different txq_enable function
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sara Sharon <[email protected]>
commit ca3b9c6b6d4db9a8ba5fc8b95664e75468c59f9f upstream.
Since the SCD_QUEUE_CFG command was introduced the driver calls iwl_trans_txq_enable_cfg() with a NULL for scd_cfg parameter.
This makes the transport avoid writing to the SCD pointers, since it can cause races with firmware, which is also accessing the registers.
The transport only updates the write pointer in that case. Fix a wrong call to iwl_trans_txq_enable() which caused a scd_cfg parameter to be sent to transport, resulting with an access to SCD registers.
--- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +1 -3
@@ -576,9 +576,7 @@ static int iwl_mvm_scd_queue_redirect(st ret);/* Make sure the SCD wrptr is correctly set before reconfiguring */ -iwl_trans_txq_enable (mvm->trans, queue, iwl_mvm_ac_to_tx_fifo[ac], - cmd.sta_id, tid,LINK_QUAL_AGG_FRAME_LIMIT_DEF , - ssn, wdg_timeout); +iwl_trans_txq_enable_cfg (mvm->trans, queue, ssn,NULL , wdg_timeout);/* TODO: Work-around SCD bug when moving back by multiples of 0x40 */
Greg Kroah-Hartman
maintainerPATCH 103/125 iwlwifi: mvm: free reserved queue on STA removal
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Liad Kaufman <[email protected]>
commit a0315dea9091d1ebc1534f6129b3fc9942b8ca99 upstream.
When a STA is removed in DQA mode, if no traffic went through its reserved queue, the txq continues to be marked as reserved and no STA can use it.
Make sure that in such a case the reserved queue is marked as free when the STA is removed.
--- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +23 -1
@@ -1268,9 +1268,31 @@ int iwl_mvm_rm_sta(struct iwl_mvm *mvm, ret =iwl_mvm_drain_sta (mvm, mvm_sta, false);/* If DQA is supported - the queues can be disabled now */ -if (iwl_mvm_is_dqa_supported (mvm)) +if (iwl_mvm_is_dqa_supported (mvm)) { +u8 reserved_txq = mvm_sta->reserved_queue; +enum iwl_mvm_queue_status *status; +iwl_mvm_disable_sta_queues (mvm, vif, mvm_sta); +/* +* If no traffic has gone through the reserved TXQ - it +* is still marked as IWL_MVM_QUEUE_RESERVED, and +* should be manually marked as free again +*/ +spin_lock_bh (&mvm->queue_info_lock); + status = &mvm->queue_info[reserved_txq].status; +if (WARN ((*status !=IWL_MVM_QUEUE_RESERVED ) && + (*status !=IWL_MVM_QUEUE_FREE ), +"sta_id %d reserved txq %d status %d" , + mvm_sta->sta_id, reserved_txq, *status)) { +spin_unlock_bh (&mvm->queue_info_lock); +return -EINVAL ; + } + + *status =IWL_MVM_QUEUE_FREE ; +spin_unlock_bh (&mvm->queue_info_lock); + } +if (vif->type ==NL80211_IFTYPE_STATION && mvmvif->ap_sta_id == mvm_sta->sta_id) {/* if associated - we can't remove the AP STA now */
Greg Kroah-Hartman
maintainerPATCH 104/125 iwlwifi: mvm: support BAR in reorder buffer
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sara Sharon <[email protected]>
commit 9a73a7d24d51eaf9e43c771c53cf7b594e5b5334 upstream.
On default queue we will not receive frame release notification, but the BAR itself.
Upon receiving the BAR driver should look at the NSSN and adjust window accordingly.
--- drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +9 -3
@@ -598,9 +598,10 @@ static bool iwl_mvm_reorder(struct iwl_m mvm_sta =iwl_mvm_sta_from_mac80211 (sta); -/* not a data packet */ -if (!ieee80211_is_data_qos (hdr->frame_control) || -is_multicast_ether_addr (hdr->addr1)) +/* not a data packet or a bar */ +if (!ieee80211_is_back_req (hdr->frame_control) && + (!ieee80211_is_data_qos (hdr->frame_control) || +is_multicast_ether_addr (hdr->addr1)))return false;if (unlikely (!ieee80211_is_data_present (hdr->frame_control)))
@@ -624,6 +625,11 @@ static bool iwl_mvm_reorder(struct iwl_mspin_lock_bh (&buffer->lock); +if (ieee80211_is_back_req (hdr->frame_control)) { +iwl_mvm_release_frames (mvm, sta, napi, buffer, nssn); + goto drop; + } +/* * If there was a significant jump in the nssn - adjust. * If the SN is smaller than the NSSN it might need to first go into
Greg Kroah-Hartman
maintainerPATCH 105/125 iwlwifi: mvm: disable P2P queue on mac context release
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sara Sharon <[email protected]>
commit 341d7eb8223bdd48bdf75729487a2de5e01623b3 upstream.
AP queue is properly released, but P2P queue isn't.
--- drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +5 -0
@@ -539,6 +539,11 @@ void iwl_mvm_mac_ctxt_release(struct iwliwl_mvm_disable_txq (mvm,IWL_MVM_OFFCHANNEL_QUEUE ,IWL_MVM_OFFCHANNEL_QUEUE ,IWL_MAX_TID_COUNT ,0 ); + else + iwl_mvm_disable_txq(mvm, + IWL_MVM_DQA_P2P_DEVICE_QUEUE, + vif->hw_queue[0], IWL_MAX_TID_COUNT, + 0); break; case NL80211_IFTYPE_AP:
Greg Kroah-Hartman
maintainerPATCH 106/125 iwlwifi: mvm: bail out if CTDP start operation fails
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luca Coelho <[email protected]>
commit 75cfe338b8a6fadaa28879a969047554701a7589 upstream.
We were assigning the return value of iwl_mvm_ctdp_command() to a variable, but never checking it. If this command fails, we should not allow the interface up process to proceed, since it is potentially dangerous to ignore thermal management requirements.
--- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +4 -1
@@ -1214,9 +1214,12 @@ int iwl_mvm_up(struct iwl_mvm *mvm) }/* TODO: read the budget from BIOS / Platform NVM */ -if (iwl_mvm_is_ctdp_supported (mvm) && mvm->cooling_dev.cur_state >0 ) +if (iwl_mvm_is_ctdp_supported (mvm) && mvm->cooling_dev.cur_state >0 ) { ret =iwl_mvm_ctdp_command (mvm,CTDP_CMD_OPERATION_START , mvm->cooling_dev.cur_state); +if (ret) + goto error; + }#else /* Initialize tx backoffs to the minimal possible */ iwl_mvm_tt_tx_backoff (mvm,0 );
Greg Kroah-Hartman
maintainerPATCH 107/125 ARM: dts: sun9i: Add missing #interrupt-cells to R_PIO pinctrl device node
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen-Yu Tsai <[email protected]>
commit 06ad11be7a9e13499ff8e55e46f09d22f9ee6fc0 upstream.
The R_PIO device node is missing #interrupt-cells, which causes interrupt parsing to fail to match it as a valid interrupt controller.
Add #interrupt-cells to it. Also remove the unnecesary #address-cells and #size-cells.
node")
--- arch/arm/boot/dts/sun9i-a80.dtsi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/arm/boot/dts/sun9i-a80.dtsi +1 -2
@@ -899,8 +899,7 @@ resets = <&apbs_rst 0>; gpio-controller; interrupt-controller; - #address-cells = <1>; - #size-cells = <0>; + #interrupt-cells = <3>; #gpio-cells = <3>; r_ir_pins: r_ir {
Greg Kroah-Hartman
maintainerPATCH 108/125 pinctrl: qcom: fix masking of pinmux functions
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: John Crispin <[email protected]>
commit 6bcf3f63394b9c4f133e4499349d786d7f531473 upstream.
The following commit introduced a regression by not properly masking the calculated value.
--- drivers/pinctrl/qcom/pinctrl-msm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/qcom/pinctrl-msm.c +1 -1
@@ -156,7 +156,7 @@ static int msm_pinmux_set_mux(struct pinspin_lock_irqsave (&pctrl->lock, flags); val =readl (pctrl->regs + g->ctl_reg); - val &= mask; + val &= ~mask; val |= i << g->mux_bit;writel (val, pctrl->regs + g->ctl_reg);
Greg Kroah-Hartman
maintainerPATCH 109/125 mpt3sas: Dont spam logs if logging level is 0
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Thumshirn <[email protected]>
commit 0d667f72b2a20bbac72bec0ab11467fc70bb0f1f upstream.
In _scsih_io_done() we test if the ioc->logging_level does _not_ have the MPT_DEBUG_REPLY bit set and if it hasn't we print the debug messages. This unfortunately is the wrong way around.
Note, the actual bug is older than af0094115 but this commit removed the CONFIG_SCSI_MPT3SAS_LOGGING Kconfig option which hid the bug.
--- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/mpt3sas/mpt3sas_scsih.c +1 -1
@@ -4701,7 +4701,7 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *i le16_to_cpu(mpi_reply->DevHandle));mpt3sas_trigger_scsi (ioc, data.skey, data.asc, data.ascq); -if (!(ioc->logging_level &MPT_DEBUG_REPLY ) && +if ((ioc->logging_level &MPT_DEBUG_REPLY ) && ((scmd->sense_buffer[2 ] ==UNIT_ATTENTION ) || (scmd->sense_buffer[2 ] ==MEDIUM_ERROR ) || (scmd->sense_buffer[2 ] ==HARDWARE_ERROR )))
Greg Kroah-Hartman
maintainerPATCH 110/125 powerpc: Always restore FPU/VEC/VSX if hardware transactional memory in use
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cyril Bur <[email protected]>
commit dc16b553c949e81f37555777dc7bab66d78285a7 upstream.
Comment from arch/powerpc/kernel/process.c:967:
If userspace is inside a transaction (whether active or suspended) and FP/VMX/VSX instructions have ever been enabled inside that transaction, then we have to keep them enabled and keep the FP/VMX/VSX state loaded while ever the transaction continues. The reason is that if we didn't, and subsequently got a FP/VMX/VSX unavailable interrupt inside a transaction, we don't know whether it's the same transaction, and thus we don't know which of the checkpointed state and the ransactional state to use.
restore_math() restore_fp() and restore_altivec() currently may not restore the registers. It doesn't appear that this is more serious than a performance penalty. If the math registers aren't restored the userspace thread will still be run with the facility disabled. Userspace will not be able to read invalid values. On the first access it will take an facility unavailable exception and the kernel will detected an active transaction, at which point it will abort the transaction. There is the possibility for a pathological case preventing any progress by transactions, however, transactions are never guaranteed to make progress.
--- arch/powerpc/kernel/process.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-)
arch/powerpc/kernel/process.c +18 -3
@@ -88,7 +88,13 @@ static void check_if_tm_restore_required set_thread_flag(TIF_RESTORE_TM); } } + +static inline bool msr_tm_active (unsigned long msr) +{ +return MSR_TM_ACTIVE (msr); +}#else +static inline bool msr_tm_active (unsigned long msr) {return false; }static inline void check_if_tm_restore_required (struct task_struct *tsk) { }#endif /* CONFIG_PPC_TRANSACTIONAL_MEM */
@@ -208,7 +214,7 @@ void enable_kernel_fp(void)EXPORT_SYMBOL (enable_kernel_fp);static int restore_fp (struct task_struct *tsk) { -if (tsk->thread.load_fp) { +if (tsk->thread.load_fp ||msr_tm_active (tsk->thread.regs->msr)) {load_fp_state (¤t->thread.fp_state); current->thread.load_fp++;return 1 ;
@@ -278,7 +284,8 @@ EXPORT_SYMBOL_GPL(flush_altivec_to_threastatic int restore_altivec (struct task_struct *tsk) { -if (cpu_has_feature (CPU_FTR_ALTIVEC ) && tsk->thread.load_vec) { +if (cpu_has_feature (CPU_FTR_ALTIVEC ) && + (tsk->thread.load_vec ||msr_tm_active (tsk->thread.regs->msr))) {load_vr_state (&tsk->thread.vr_state); tsk->thread.used_vr =1 ; tsk->thread.load_vec++;
@@ -464,7 +471,8 @@ void restore_math(struct pt_regs *regs) {unsigned long msr; -if (!current->thread.load_fp && !loadvec (current->thread)) +if (!msr_tm_active (regs->msr) && + !current->thread.load_fp && !loadvec (current->thread))return ; msr = regs->msr;
@@ -983,6 +991,13 @@ void restore_tm_state(struct pt_regs *re msr_diff = current->thread.ckpt_regs.msr & ~regs->msr; msr_diff &=MSR_FP |MSR_VEC |MSR_VSX ; +/* Ensure that restore_math() will restore */ +if (msr_diff &MSR_FP ) + current->thread.load_fp =1 ; +#ifdef CONFIG_ALIVEC +if (cpu_has_feature (CPU_FTR_ALTIVEC ) && msr_diff &MSR_VEC ) + current->thread.load_vec =1 ; +#endif restore_math (regs); regs->msr |= msr_diff;
Greg Kroah-Hartman
maintainerPATCH 111/125 powerpc: Add check_if_tm_restore_required() to giveup_all()
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cyril Bur <[email protected]>
commit b0f16b46988fde02a1e32078f66a3059d7e53bfc upstream.
giveup_all() causes FPU/VMX/VSX facilities to be disabled in a threads MSR. If the thread performing the giveup was transactional, the kernel must record which facilities were in use before the giveup as the thread must have these facilities re-enabled on return to userspace.
Quoted 1 line
Quoted 1 line
From
process.c:
/*
* This is called if we are on the way out to userspace and the
* TIF_RESTORE_TM flag is set. It checks if we need to reload
* FP and/or vector state and does so if necessary.
* If userspace is inside a transaction (whether active or
* suspended) and FP/VMX/VSX instructions have ever been enabled
* inside that transaction, then we have to keep them enabled
* and keep the FP/VMX/VSX state loaded while ever the transaction
* continues. The reason is that if we didn't, and subsequently
* got a FP/VMX/VSX unavailable interrupt inside a transaction,
* we don't know whether it's the same transaction, and thus we
* don't know which of the checkpointed state and the transactional
* state to use.
*/
Calling check_if_tm_restore_required() will set TIF_RESTORE_TM and save the MSR if needed.
--- arch/powerpc/kernel/process.c | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/kernel/process.c +1 -0
@@ -445,6 +445,7 @@ void giveup_all(struct task_struct *tsk)return ;msr_check_and_set (msr_all_available); +check_if_tm_restore_required (tsk);#ifdef CONFIG_PPC_FPU if (usermsr &MSR_FP )
Greg Kroah-Hartman
maintainerPATCH 112/125 powerpc/nvram: Fix an incorrect partition merge
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pan Xinhui <[email protected]>
commit 11b7e154b132232535befe51c55db048069c8461 upstream.
When we merge two contiguous partitions whose signatures are marked NVRAM_SIG_FREE, We need update prev's length and checksum, then write it to nvram, not cur's. So lets fix this mistake now.
Also use memset instead of strncpy to set the partition's name. It's more readable if we want to fill up with duplicate chars .
--- arch/powerpc/kernel/nvram_64.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/powerpc/kernel/nvram_64.c +3 -3
@@ -956,7 +956,7 @@ int __init nvram_remove_partition(const/* Make partition a free partition */ part->header.signature =NVRAM_SIG_FREE ; -strncpy (part->header.name,"wwwwwwwwwwww" ,12 ); +memset (part->header.name,'w' ,12 ); part->header.checksum =nvram_checksum (&part->header); rc =nvram_write_header (part);if (rc <=0 ) {
@@ -974,8 +974,8 @@ int __init nvram_remove_partition(const }if (prev) { prev->header.length += part->header.length; - prev->header.checksum =nvram_checksum (&part->header); - rc =nvram_write_header (part); + prev->header.checksum =nvram_checksum (&prev->header); + rc =nvram_write_header (prev);if (rc <=0 ) {printk (KERN_ERR "nvram_remove_partition: nvram_write failed (%d)\n" , rc);return rc;
Greg Kroah-Hartman
maintainerPATCH 113/125 powerpc: Fix usage of _PAGE_RO in hugepage
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe Leroy <[email protected]>
commit 6b8cb66a6a7cc182b47da6a0a1d4e5da324c0695 upstream.
On some CPUs like the 8xx, _PAGE_RW hence _PAGE_WRITE is defined as 0 and _PAGE_RO has to be set when a page is not writable
_PAGE_RO is defined by default in pte-common.h, however BOOK3S/64 doesn't include that file so _PAGE_RO has to be defined explicitly in book3s/64/pgtable.h
--- arch/powerpc/include/asm/book3s/64/pgtable.h | 2 ++ arch/powerpc/mm/hugetlbpage.c | 7 +++++++ 2 files changed, 9 insertions(+)
arch/powerpc/include/asm/book3s/64/pgtable.h +2 -0
@@ -6,6 +6,8 @@*/ #define _PAGE_BIT_SWAP_TYPE 0 +#define _PAGE_RO 0 +#define _PAGE_EXEC 0x00001/* execute permission */ #define _PAGE_WRITE 0x00002/* write access allowed */ #define _PAGE_READ 0x00004/* read access allowed */
arch/powerpc/mm/hugetlbpage.c +7 -0
@@ -1019,8 +1019,15 @@ int gup_hugepte(pte_t *ptep, unsigned lo pte =READ_ONCE (*ptep); mask = _PAGE_PRESENT | _PAGE_READ; + +/* +* On some CPUs like the 8xx, _PAGE_RW hence _PAGE_WRITE is defined +* as 0 and _PAGE_RO has to be set when a page is not writable +*/ if (write) mask |= _PAGE_WRITE; +else + mask |= _PAGE_RO;if ((pte_val (pte) & mask) != mask)return 0 ;
Greg Kroah-Hartman
maintainerPATCH 114/125 ARM: pxa: pxa_cplds: fix interrupt handling
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Robert Jarzmik <[email protected]>
commit 9ba63e3cc849cdaf3b675c47cc51fe35419e5117 upstream.
Since its initial commit, the driver is buggy for multiple interrupts handling. The translation from the former lubbock.c file was not complete, and might stall all interrupt handling when multiple interrupts occur.
This is especially true when inside the interrupt handler and if a new interrupt comes and is not handled, leaving the output line still held, and not creating a transition as the GPIO block behind would expect to trigger another cplds_irq_handler() call.
For the record, the hardware is working as follows.
The interrupt mechanism relies on :
- one status register
- one mask register
Let's suppose the input irq lines are called :
- i_sa1111
- i_lan91x
- i_mmc_cd
Let's suppose the status register for each irq line is called :
- status_sa1111
- status_lan91x
- status_mmc_cd
Let's suppose the interrupt mask for each irq line is called :
- irqen_sa1111
- irqen_lan91x
- irqen_mmc_cd
Let's suppose the output irq line, connected to GPIO0 is called :
- o_gpio0
The behavior is as follows :
- o_gpio0 = not((status_sa1111 & irqen_sa1111) |
(status_lan91x & irqen_lan91x) | (status_mmc_cd & irqen_mmc_cd))
=> this is a N-to-1 NOR gate and multiple AND gates
- irqen_* is exactly as programmed by a write to the FPGA
- status_* behavior is governed by a bi-stable D flip-flop => on next FPGA clock :
- if i_xxx is high, status_xxx becomes 1
- if i_xxx is low, status_xxx remains as it is
- if software sets status_xxx to 0, the D flip-flop is reset => status_xxx becomes 0
=> on next FPGA clock cycle, if i_xxx is high, status_xxx becomes
1 again
--- arch/arm/mach-pxa/pxa_cplds_irqs.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-)
arch/arm/mach-pxa/pxa_cplds_irqs.c +15 -9
@@ -41,30 +41,35 @@ static irqreturn_t cplds_irq_handler(intunsigned long pending;unsigned int bit; - pending =readl (fpga->base +FPGA_IRQ_SET_CLR ) & fpga->irq_mask; -for_each_set_bit (bit, &pending,CPLDS_NB_IRQ ) -generic_handle_irq (irq_find_mapping (fpga->irqdomain, bit)); +do { + pending =readl (fpga->base +FPGA_IRQ_SET_CLR ) & fpga->irq_mask; +for_each_set_bit (bit, &pending,CPLDS_NB_IRQ ) { +generic_handle_irq (irq_find_mapping (fpga->irqdomain, + bit)); + } + }while (pending);return IRQ_HANDLED ; } -static void cplds_irq_mask_ack (struct irq_data *d) +static void cplds_irq_mask (struct irq_data *d) {struct cplds *fpga =irq_data_get_irq_chip_data (d);unsigned int cplds_irq =irqd_to_hwirq (d); -unsigned int set, bit =BIT (cplds_irq); +unsigned int bit =BIT (cplds_irq); fpga->irq_mask &= ~bit;writel (fpga->irq_mask, fpga->base +FPGA_IRQ_MASK_EN ); - set =readl (fpga->base +FPGA_IRQ_SET_CLR ); -writel (set & ~bit, fpga->base +FPGA_IRQ_SET_CLR ); }static void cplds_irq_unmask (struct irq_data *d) {struct cplds *fpga =irq_data_get_irq_chip_data (d);unsigned int cplds_irq =irqd_to_hwirq (d); -unsigned int bit =BIT (cplds_irq); +unsigned int set, bit =BIT (cplds_irq); + + set =readl (fpga->base +FPGA_IRQ_SET_CLR ); +writel (set & ~bit, fpga->base +FPGA_IRQ_SET_CLR ); fpga->irq_mask |= bit;writel (fpga->irq_mask, fpga->base +FPGA_IRQ_MASK_EN );
@@ -72,7 +77,8 @@ static void cplds_irq_unmask(struct irq_static struct irq_chip cplds_irq_chip = { .name ="pxa_cplds" , - .irq_mask_ack = cplds_irq_mask_ack, + .irq_ack = cplds_irq_mask, + .irq_mask = cplds_irq_mask, .irq_unmask = cplds_irq_unmask, .flags =IRQCHIP_MASK_ON_SUSPEND |IRQCHIP_SKIP_SET_WAKE , };
Greg Kroah-Hartman
maintainerPATCH 115/125 ARM: pxa: fix GPIO double shifts
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Robert Jarzmik <[email protected]>
commit ca26475bf02ed8562b9b46f91d3e8b52ec312541 upstream.
The commit 9bf448c66d4b ("ARM: pxa: use generic gpio operation instead of gpio register") from Oct 17, 2011, leads to the following static checker warning:
arch/arm/mach-pxa/spitz_pm.c:172 spitz_charger_wakeup()
warn: double left shift '!gpio_get_value(SPITZ_GPIO_KEY_INT)
<< (1 << ((SPITZ_GPIO_KEY_INT) & 31))'
As Dan reported, the value is shifted three times :
- once by gpio_get_value(), which returns either 0 or BIT(gpio)
- once by the shift operation '<<'
- a last time by GPIO_bit(gpio) which is BIT(gpio)
Therefore the calculation lead to a chained or operator of :
- (1 << gpio) << (1 << gpio) = (2^gpio)^gpio = 2 ^ (gpio * gpio)
It is be sheer luck the former statement works, only because each gpio used is strictly smaller than 6, and therefore 2^(gpio^2) never overflows a 32 bits value, and because it is used as a boolean value to check a gpio activation.
As the xxx_charger_wakeup() functions are used as a true/false detection mechanism, take that opportunity to change their prototypes from integer return value to boolean one.
gpio register")
--- arch/arm/mach-pxa/corgi_pm.c | 13 ++++--------- arch/arm/mach-pxa/sharpsl_pm.c | 2 +- arch/arm/mach-pxa/sharpsl_pm.h | 2 +- arch/arm/mach-pxa/spitz_pm.c | 9 +++------ 4 files changed, 9 insertions(+), 17 deletions(-)
arch/arm/mach-pxa/corgi_pm.c +4 -9
@@ -131,16 +131,11 @@ static int corgi_should_wakeup(unsignedreturn is_resume; } -static unsigned long corgi_charger_wakeup (void ) +static bool corgi_charger_wakeup (void ) { -unsigned long ret; - - ret = (!gpio_get_value (CORGI_GPIO_AC_IN ) <<GPIO_bit (CORGI_GPIO_AC_IN )) - | (!gpio_get_value (CORGI_GPIO_KEY_INT ) - <<GPIO_bit (CORGI_GPIO_KEY_INT )) - | (!gpio_get_value (CORGI_GPIO_WAKEUP ) - <<GPIO_bit (CORGI_GPIO_WAKEUP )); -return ret; +return !gpio_get_value (CORGI_GPIO_AC_IN ) || + !gpio_get_value (CORGI_GPIO_KEY_INT ) || + !gpio_get_value (CORGI_GPIO_WAKEUP ); }unsigned long corgipm_read_devdata (int type)
arch/arm/mach-pxa/sharpsl_pm.c +1 -1
@@ -744,7 +744,7 @@ static int sharpsl_off_charge_battery(vo time =RCNR ;while (1 ) {/* Check if any wakeup event had occurred */ -if (sharpsl_pm.machinfo->charger_wakeup () !=0 ) +if (sharpsl_pm.machinfo->charger_wakeup ())return 0 ;/* Check for timeout */ if ((RCNR - time) >SHARPSL_WAIT_CO_TIME )
arch/arm/mach-pxa/sharpsl_pm.h +1 -1
@@ -34,7 +34,7 @@ struct sharpsl_charger_machinfo {#define SHARPSL_STATUS_LOCK 5#define SHARPSL_STATUS_CHRGFULL 6#define SHARPSL_STATUS_FATAL 7 -unsigned long (*charger_wakeup)(void ); +bool (*charger_wakeup)(void );int (*should_wakeup)(unsigned int resume_on_alarm);void (*backlight_limit)(int );int (*backlight_get_status) (void );
arch/arm/mach-pxa/spitz_pm.c +3 -6
@@ -165,13 +165,10 @@ static int spitz_should_wakeup(unsignedreturn is_resume; } -static unsigned long spitz_charger_wakeup (void ) +static bool spitz_charger_wakeup (void ) { -unsigned long ret; - ret = ((!gpio_get_value (SPITZ_GPIO_KEY_INT ) - <<GPIO_bit (SPITZ_GPIO_KEY_INT )) - |gpio_get_value (SPITZ_GPIO_SYNC )); -return ret; +return !gpio_get_value (SPITZ_GPIO_KEY_INT ) || +gpio_get_value (SPITZ_GPIO_SYNC ); }unsigned long spitzpm_read_devdata (int type)
Greg Kroah-Hartman
maintainerPATCH 116/125 ARM: dts: NSP: Correct RAM amount for BCM958625HR board
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jon Mason <[email protected]>
commit c53beb47f621e4a56f31af9f86470041655516c7 upstream.
The BCM958625HR board has 2GB of RAM available. Increase the amount from 512MB to 2GB and add the device type to the memory entry.
--- arch/arm/boot/dts/bcm958625hr.dts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/boot/dts/bcm958625hr.dts +2 -1
@@ -47,7 +47,8 @@ }; memory { - reg = <0x60000000 0x20000000>; + device_type = "memory"; + reg = <0x60000000 0x80000000>; }; };
Greg Kroah-Hartman
maintainerPATCH 117/125 ARM: dts: fix RealView EB SMSC ethernet version
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <[email protected]>
commit c4ad72560df11961d3e57fb0fadfe88a9863c9ad upstream.
The ethernet version in the earlier RealView EB variants is LAN91C111 and not LAN9118 according to ARM DUI 0303E "RealView Emulation Baseboard User Guide" page 3-57.
Make sure that this is used for the base variant of the board.
As the DT bindings for LAN91C111 does not specify any power supplies, these need to be deleted from the DTS file.
--- arch/arm/boot/dts/arm-realview-eb.dtsi | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-)
arch/arm/boot/dts/arm-realview-eb.dtsi +7 -16
@@ -51,14 +51,6 @@ regulator-boot-on; }; - veth: fixedregulator@0 { - compatible = "regulator-fixed"; - regulator-name = "veth"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - regulator-boot-on; - }; - xtal24mhz: xtal24mhz@24M { #clock-cells = <0>; compatible = "fixed-clock";
@@ -134,16 +126,15 @@ bank-width = <4>; }; - /* SMSC 9118 ethernet with PHY and EEPROM */ + /* SMSC LAN91C111 ethernet with PHY and EEPROM */ ethernet: ethernet@4e000000 { - compatible = "smsc,lan9118", "smsc,lan9115"; + compatible = "smsc,lan91c111"; reg = <0x4e000000 0x10000>; - phy-mode = "mii"; - reg-io-width = <4>; - smsc,irq-active-high; - smsc,irq-push-pull; - vdd33a-supply = <&veth>; - vddvario-supply = <&veth>; + /* + * This means the adapter can be accessed with 8, 16 or + * 32 bit reads/writes. + */ + reg-io-width = <7>; }; usb: usb@4f000000 {
Greg Kroah-Hartman
maintainerPATCH 118/125 ARM: dts: omap3: overo: add missing unit name for lcd35 display
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Javier Martinez Canillas <[email protected]>
commit 0b965a13ad81fa895e534d1f50b355ff8b0b3ed3 upstream.
Commit b8d368caa8dc ("ARM: dts: omap3: overo: remove unneded unit names in display nodes") removed the unit names for all Overo display nodes that didn't have a reg property.
But the display in arch/arm/boot/dts/omap3-overo-common-lcd35.dtsi does have a reg property so the correct fix was to make the unit name match the value of the reg property, instead of removing it.
This patch fixes the following DTC warning for boards using this dtsi:
"ocp/spi@48098000/display has a reg or ranges property, but no unit name"
--- arch/arm/boot/dts/omap3-overo-common-lcd35.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/omap3-overo-common-lcd35.dtsi +1 -1
@@ -119,7 +119,7 @@ pinctrl-names = "default"; pinctrl-0 = <&mcspi1_pins>; - lcd0: display { + lcd0: display@1 { compatible = "lgphilips,lb035q02"; label = "lcd35";
Greg Kroah-Hartman
maintainerPATCH 119/125 PCI: rcar: Fix pci_remap_iospace() failure path
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Pieralisi <[email protected]>
commit 5e8c873270cc618e3326eb6a47437b517ef85c52 upstream.
On ARM/ARM64 architectures, PCI IO ports are emulated through memory mapped IO, by reserving a chunk of virtual address space starting at PCI_IOBASE and by mapping the PCI host bridges memory address space driving PCI IO cycles to it.
PCI host bridge drivers that enable downstream PCI IO cycles map the host bridge memory address responding to PCI IO cycles to the fixed virtual address space through the pci_remap_iospace() API.
This means that if the pci_remap_iospace() function fails, the corresponding host bridge PCI IO resource must be considered invalid, in that there is no way for the kernel to actually drive PCI IO transactions if the memory addresses responding to PCI IO cycles cannot be mapped into the CPU virtual address space.
The PCI rcar host bridge driver does not remove the PCI IO resource from the host bridge resource windows if the pci_remap_iospace() call fails; this is an actual bug in that the PCI host bridge would consider the PCI IO resource valid (and possibly assign it to downstream devices) even if the kernel was not able to map the PCI host bridge memory address driving IO cycle to the CPU virtual address space (ie pci_remap_iospace() failures).
Fix the PCI host bridge driver pci_remap_iospace() failure path, by destroying the PCI host bridge PCI IO resources retrieved through firmware when the pci_remap_iospace() function call fails, therefore preventing the kernel from adding the respective PCI IO resource to the list of PCI host bridge valid resources, fixing the issue.
--- drivers/pci/host/pcie-rcar.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/pci/host/pcie-rcar.c +6 -3
@@ -945,7 +945,7 @@ static int rcar_pcie_parse_request_of_pcstruct device *dev = pci->dev;struct device_node *np = dev->of_node;resource_size_t iobase; -struct resource_entry *win; +struct resource_entry *win, *tmp; err =of_pci_get_host_bridge_resources (np,0 ,0xff , &pci->resources, &iobase);if (err)
@@ -955,14 +955,17 @@ static int rcar_pcie_parse_request_of_pcif (err) goto out_release_res; -resource_list_for_each_entry (win, &pci->resources) { +resource_list_for_each_entry_safe (win, tmp, &pci->resources) {struct resource *res = win->res;if (resource_type (res) ==IORESOURCE_IO ) { err =pci_remap_iospace (res, iobase); -if (err) +if (err) {dev_warn (dev,"error %d: failed to map resource %pR\n" , err, res); + +resource_list_destroy_entry (win); + } } }
Greg Kroah-Hartman
maintainerPATCH 120/125 PCI: aardvark: Fix pci_remap_iospace() failure path
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Pieralisi <[email protected]>
commit db047f8a931275e50563dd79c3d62d977074959a upstream.
On ARM/ARM64 architectures, PCI IO ports are emulated through memory mapped IO, by reserving a chunk of virtual address space starting at PCI_IOBASE and by mapping the PCI host bridge's memory address space driving PCI IO cycles to it.
PCI host bridge drivers that enable downstream PCI IO cycles map the host bridge memory address responding to PCI IO cycles to the fixed virtual address space through the pci_remap_iospace() API.
This means that if the pci_remap_iospace() function fails, the corresponding host bridge PCI IO resource must be considered invalid, in that there is no way for the kernel to actually drive PCI IO transactions if the memory addresses responding to PCI IO cycles cannot be mapped into the CPU virtual address space.
The PCI aardvark host bridge driver does not remove the PCI IO resource from the host bridge resource windows if the pci_remap_iospace() call fails; this is an actual bug in that the PCI host bridge would consider the PCI IO resource valid (and possibly assign it to downstream devices) even if the kernel was not able to map the PCI host bridge memory address driving IO cycle to the CPU virtual address space (ie pci_remap_iospace() failures).
Fix the PCI host bridge driver pci_remap_iospace() failure path, by destroying the PCI host bridge PCI IO resources retrieved through firmware when the pci_remap_iospace() function call fails, therefore preventing the kernel from adding the respective PCI IO resource to the list of PCI host bridge valid resources, fixing the issue.
--- drivers/pci/host/pci-aardvark.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/pci/host/pci-aardvark.c +5 -3
@@ -848,7 +848,7 @@ static int advk_pcie_parse_request_of_pcint err, res_valid =0 ;struct device *dev = &pcie->pdev->dev;struct device_node *np = dev->of_node; -struct resource_entry *win; +struct resource_entry *win, *tmp;resource_size_t iobase;INIT_LIST_HEAD (&pcie->resources);
@@ -862,7 +862,7 @@ static int advk_pcie_parse_request_of_pcif (err) goto out_release_res; -resource_list_for_each_entry (win, &pcie->resources) { +resource_list_for_each_entry_safe (win, tmp, &pcie->resources) {struct resource *res = win->res;switch (resource_type (res)) {
@@ -874,9 +874,11 @@ static int advk_pcie_parse_request_of_pclower_32_bits (res->start), OB_PCIE_IO); err =pci_remap_iospace (res, iobase); -if (err) +if (err) {dev_warn (dev,"error %d: failed to map resource %pR\n" , err, res); +resource_list_destroy_entry (win); + }break ;case IORESOURCE_MEM : advk_pcie_set_ob_win(pcie, 0,
Greg Kroah-Hartman
maintainerPATCH 121/125 PCI: generic: Fix pci_remap_iospace() failure path
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Pieralisi <[email protected]>
commit 43281ede019ede33fd0c40a14a86b304a51e4555 upstream.
On ARM/ARM64 architectures, PCI IO ports are emulated through memory mapped IO, by reserving a chunk of virtual address space starting at PCI_IOBASE and by mapping the PCI host bridges memory address space driving PCI IO cycles to it.
PCI host bridge drivers that enable downstream PCI IO cycles map the host bridge memory address responding to PCI IO cycles to the fixed virtual address space through the pci_remap_iospace() API.
This means that if the pci_remap_iospace() function fails, the corresponding host bridge PCI IO resource must be considered invalid, in that there is no way for the kernel to actually drive PCI IO transactions if the memory addresses responding to PCI IO cycles cannot be mapped into the CPU virtual address space.
The PCI common host bridge driver does not remove the PCI IO resource from the host bridge resource windows if the pci_remap_iospace() call fails; this is an actual bug in that the PCI host bridge would consider the PCI IO resource valid (and possibly assign it to downstream devices) even if the kernel was not able to map the PCI host bridge memory address driving IO cycle to the CPU virtual address space (ie pci_remap_iospace() failures).
Fix the PCI host bridge driver pci_remap_iospace() failure path, by destroying the PCI host bridge PCI IO resources retrieved through firmware when the pci_remap_iospace() function call fails, therefore preventing the kernel from adding the respective PCI IO resource to the list of PCI host bridge valid resources, fixing the issue.
--- drivers/pci/host/pci-host-common.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/pci/host/pci-host-common.c +5 -3
@@ -29,7 +29,7 @@ static int gen_pci_parse_request_of_pci_int err, res_valid =0 ;struct device_node *np = dev->of_node;resource_size_t iobase; -struct resource_entry *win; +struct resource_entry *win, *tmp; err =of_pci_get_host_bridge_resources (np,0 ,0xff , resources, &iobase);if (err)
@@ -39,15 +39,17 @@ static int gen_pci_parse_request_of_pci_if (err)return err; -resource_list_for_each_entry (win, resources) { +resource_list_for_each_entry_safe (win, tmp, resources) {struct resource *res = win->res;switch (resource_type (res)) {case IORESOURCE_IO : err =pci_remap_iospace (res, iobase); -if (err) +if (err) {dev_warn (dev,"error %d: failed to map resource %pR\n" , err, res); +resource_list_destroy_entry (win); + }break ;case IORESOURCE_MEM : res_valid |= !(res->flags &IORESOURCE_PREFETCH );
Greg Kroah-Hartman
maintainerPATCH 122/125 PCI: versatile: Fix pci_remap_iospace() failure path
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Pieralisi <[email protected]>
commit 53f4f7ee28076a36e427274d7d5c33b23dfc6221 upstream.
On ARM/ARM64 architectures, PCI IO ports are emulated through memory mapped IO, by reserving a chunk of virtual address space starting at PCI_IOBASE and by mapping the PCI host bridges memory address space driving PCI IO cycles to it.
PCI host bridge drivers that enable downstream PCI IO cycles map the host bridge memory address responding to PCI IO cycles to the fixed virtual address space through the pci_remap_iospace() API.
This means that if the pci_remap_iospace() function fails, the corresponding host bridge PCI IO resource must be considered invalid, in that there is no way for the kernel to actually drive PCI IO transactions if the memory addresses responding to PCI IO cycles cannot be mapped into the CPU virtual address space.
The PCI versatile host bridge driver does not remove the PCI IO resource from the host bridge resource windows if the pci_remap_iospace() call fails; this is an actual bug in that the PCI host bridge would consider the PCI IO resource valid (and possibly assign it to downstream devices) even if the kernel was not able to map the PCI host bridge memory address driving IO cycle to the CPU virtual address space (ie pci_remap_iospace() failures).
Fix the PCI host bridge driver pci_remap_iospace() failure path, by destroying the PCI host bridge PCI IO resources retrieved through firmware when the pci_remap_iospace() function call fails, therefore preventing the kernel from adding the respective PCI IO resource to the list of PCI host bridge valid resources, fixing the issue.
--- drivers/pci/host/pci-versatile.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/pci/host/pci-versatile.c +5 -3
@@ -74,7 +74,7 @@ static int versatile_pci_parse_request_oint err, mem =1 , res_valid =0 ;struct device_node *np = dev->of_node;resource_size_t iobase; -struct resource_entry *win; +struct resource_entry *win, *tmp; err =of_pci_get_host_bridge_resources (np,0 ,0xff , res, &iobase);if (err)
@@ -84,15 +84,17 @@ static int versatile_pci_parse_request_oif (err) goto out_release_res; -resource_list_for_each_entry (win, res) { +resource_list_for_each_entry_safe (win, tmp, res) {struct resource *res = win->res;switch (resource_type (res)) {case IORESOURCE_IO : err =pci_remap_iospace (res, iobase); -if (err) +if (err) {dev_warn (dev,"error %d: failed to map resource %pR\n" , err, res); +resource_list_destroy_entry (win); + }break ;case IORESOURCE_MEM : res_valid |= !(res->flags &IORESOURCE_PREFETCH );
Greg Kroah-Hartman
maintainerPATCH 123/125 PCI: designware: Fix pci_remap_iospace() failure path
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Pieralisi <[email protected]>
commit bcd7b7186fcba434e7486648de85cf93a56c845c upstream.
On ARM/ARM64 architectures, PCI IO ports are emulated through memory mapped IO, by reserving a chunk of virtual address space starting at PCI_IOBASE and by mapping the PCI host bridges memory address space driving PCI IO cycles to it.
PCI host bridge drivers that enable downstream PCI IO cycles map the host bridge memory address responding to PCI IO cycles to the fixed virtual address space through the pci_remap_iospace() API.
This means that if the pci_remap_iospace() function fails, the corresponding host bridge PCI IO resource must be considered invalid, in that there is no way for the kernel to actually drive PCI IO transactions if the memory addresses responding to PCI IO cycles cannot be mapped into the CPU virtual address space.
The PCI designware host bridge driver does not remove the PCI IO resource from the host bridge resource windows if the pci_remap_iospace() call fails; this is an actual bug in that the PCI host bridge would consider the PCI IO resource valid (and possibly assign it to downstream devices) even if the kernel was not able to map the PCI host bridge memory address driving IO cycle to the CPU virtual address space (ie pci_remap_iospace() failures).
Fix the PCI host bridge driver pci_remap_iospace() failure path, by destroying the PCI host bridge PCI IO resources retrieved through firmware when the pci_remap_iospace() function call fails, therefore preventing the kernel from adding the respective PCI IO resource to the list of PCI host bridge valid resources, fixing the issue.
--- drivers/pci/host/pcie-designware.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
drivers/pci/host/pcie-designware.c +12 -9
@@ -436,7 +436,7 @@ int dw_pcie_host_init(struct pcie_port *struct resource *cfg_res;int i, ret;LIST_HEAD (res); -struct resource_entry *win; +struct resource_entry *win, *tmp; cfg_res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"config" );if (cfg_res) {
@@ -457,17 +457,20 @@ int dw_pcie_host_init(struct pcie_port * goto error;/* Get the I/O and memory ranges from DT */ -resource_list_for_each_entry (win, &res) { +resource_list_for_each_entry_safe (win, tmp, &res) {switch (resource_type (win->res)) {case IORESOURCE_IO : - pp->io = win->res; - pp->io->name ="I/O" ; - pp->io_size =resource_size (pp->io); - pp->io_bus_addr = pp->io->start - win->offset; - ret =pci_remap_iospace (pp->io, pp->io_base); -if (ret) + ret =pci_remap_iospace (win->res, pp->io_base); +if (ret) {dev_warn (pp->dev,"error %d: failed to map resource %pR\n" , - ret, pp->io); + ret, win->res); +resource_list_destroy_entry (win); + }else { + pp->io = win->res; + pp->io->name ="I/O" ; + pp->io_size =resource_size (pp->io); + pp->io_bus_addr = pp->io->start - win->offset; + }break ;case IORESOURCE_MEM : pp->mem = win->res;
Greg Kroah-Hartman
maintainerPATCH 124/125 PCI: tegra: Fix pci_remap_iospace() failure path
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Pieralisi <[email protected]>
commit 13f392ebc37e31568fae72a73ee378ae22a9740f upstream.
On ARM/ARM64 architectures, PCI IO ports are emulated through memory mapped IO, by reserving a chunk of virtual address space starting at PCI_IOBASE and by mapping the PCI host bridges memory address space driving PCI IO cycles to it.
PCI host bridge drivers that enable downstream PCI IO cycles map the host bridge memory address responding to PCI IO cycles to the fixed virtual address space through the pci_remap_iospace() API.
This means that if the pci_remap_iospace() function fails, the corresponding host bridge PCI IO resource must be considered invalid, in that there is no way for the kernel to actually drive PCI IO transactions if the memory addresses responding to PCI IO cycles cannot be mapped into the CPU virtual address space.
The PCI tegra host bridge driver adds the PCI IO resource retrieved from firmware to the host bridge resource windows even if the pci_remap_iospace() call fails; this is an actual bug in that the PCI host bridge would consider the PCI IO resource valid (and possibly assign it to downstream devices) even if the kernel was not able to map the PCI host bridge memory address driving IO cycle to the CPU virtual address space (ie pci_remap_iospace() failures).
Add the PCI host bridge driver pci_remap_iospace() failure path and do not add the corresponding PCI host bridge PCI IO resources retrieved through firmware when the pci_remap_iospace() function call fails, fixing the issue.
--- drivers/pci/host/pci-tegra.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/pci/host/pci-tegra.c +5 -2
@@ -621,7 +621,11 @@ static int tegra_pcie_setup(int nr, struif (err <0 )return err; -pci_add_resource_offset (&sys->resources, &pcie->pio, sys->io_offset); + err =pci_remap_iospace (&pcie->pio, pcie->io.start); +if (!err) +pci_add_resource_offset (&sys->resources, &pcie->pio, + sys->io_offset); +pci_add_resource_offset (&sys->resources, &pcie->mem, sys->mem_offset);pci_add_resource_offset (&sys->resources, &pcie->prefetch, sys->mem_offset);
@@ -631,7 +635,6 @@ static int tegra_pcie_setup(int nr, struif (err <0 )return err; -pci_remap_iospace (&pcie->pio, pcie->io.start);return 1 ; }
Greg Kroah-Hartman
maintainerPATCH 125/125 libnvdimm: clear the internal poison_list when clearing badblocks
In reply to Greg Kroah-Hartman4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vishal Verma <[email protected]>
commit e046114af5fcafe8d6d3f0b6ccb99804bad34bfb upstream.
nvdimm_clear_poison cleared the user-visible badblocks, and sent commands to the NVDIMM to clear the areas marked as 'poison', but it neglected to clear the same areas from the internal poison_list which is used to marshal ARS results before sorting them by namespace. As a result, once on-demand ARS functionality was added:
37b137f nfit, libnvdimm: allow an ARS scrub to be triggered on demand
A scrub triggered from either sysfs or an MCE was found to be adding stale entries that had been cleared from gendisk->badblocks, but were still present in nvdimm_bus->poison_list. Additionally, the stale entries could be triggered into producing stale disk->badblocks by simply disabling and re-enabling the namespace or region.
This adds the missing step of clearing poison_list entries when clearing poison, so that it is always in sync with badblocks.
--- drivers/nvdimm/bus.c | 2 + drivers/nvdimm/core.c | 73 +++++++++++++++++++++++++++++++++++++++++++--- include/linux/libnvdimm.h | 2 + 3 files changed, 73 insertions(+), 4 deletions(-)
drivers/nvdimm/bus.c +2 -0
@@ -217,6 +217,8 @@ long nvdimm_clear_poison(struct device *return rc;if (cmd_rc <0 )return cmd_rc; + +nvdimm_clear_from_poison_list (nvdimm_bus, phys, len);return clear_err.cleared; }EXPORT_SYMBOL_GPL (nvdimm_clear_poison);
drivers/nvdimm/core.c +69 -4
100 lines not on this page · raw message
include/linux/libnvdimm.h +2 -0
@@ -129,6 +129,8 @@ static inline struct nd_blk_region_desc }int nvdimm_bus_add_poison (struct nvdimm_bus *nvdimm_bus,u64 addr,u64 length); +void nvdimm_clear_from_poison_list (struct nvdimm_bus *nvdimm_bus, +phys_addr_t start,unsigned int len);struct nvdimm_bus *nvdimm_bus_register (struct device *parent,struct nvdimm_bus_descriptor *nfit_desc);void nvdimm_bus_unregister (struct nvdimm_bus *nvdimm_bus);
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.8.6 release. There are 125 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Mon Oct 31 13:49:27 UTC 2016. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.8.6-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.8.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Signature · 5 lines
Shuah Khan Sr. Linux Kernel Developer Open Source Innovation Group Samsung Research America(Silicon Valley) [email protected]
Greg Kroah-Hartman
maintainerQuoted 15 lines · Shuah Khan
Quoted 14 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.8.6 release. There are 125 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Mon Oct 31 13:49:27 UTC 2016. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.8.6-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.8.y
and the diffstat can be found below.
Quoted 6 lines
Quoted 4 lines
thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
Thanks for testing both of these and letting me know.
greg k-h
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.8.6 release. There are 125 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Mon Oct 31 13:49:27 UTC 2016. Anything received after that time might be too late.
Build results:
total: 149 pass: 149 fail: 0 Qemu test results: total: 113 pass: 113 fail: 0
Details are available at http://kerneltests.org/builders.
Guenter
Greg Kroah-Hartman
maintainerQuoted 11 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.8.6 release. There are 125 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Mon Oct 31 13:49:27 UTC 2016. Anything received after that time might be too late.
Quoted 6 lines
Build results:
total: 149 pass: 149 fail: 0 Qemu test results: total: 113 pass: 113 fail: 0Details are available at http://kerneltests.org/builders.
Thanks for letting me know both of these kernels succeeded.
greg k-h