This is a note to let you know that I've just added the patch titled
HID: clamp input to logical range if no null state
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
hid-clamp-input-to-logical-range-if-no-null-state.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From foo@baz Sun Mar 18 16:55:33 CET 2018
From: Tomasz Kramkowski <tk(a)the-tk.com>
Date: Tue, 14 Mar 2017 13:29:13 +0000
Subject: HID: clamp input to logical range if no null state
From: Tomasz Kramkowski <tk(a)the-tk.com>
[ Upstream commit c3883fe06488a483658ba5d849b70e49bee15e7c ]
This patch fixes an issue in drivers/hid/hid-input.c where values
outside of the logical range are not clamped when "null state" bit of
the input control is not set.
This was discussed on the lists [1] and this change stems from the fact
due to the ambiguity of the HID specification it might be appropriate to
follow Microsoft's own interpretation of the specification. As noted in
Microsoft's documentation [2] in the section titled "Required HID usages
for digitizers" it is noted that values reported outside the logical
range "will be considered as invalid data and the value will be changed
to the nearest boundary value (logical min/max)."
This patch fixes an issue where the (1292:4745) Innomedia INNEX
GENESIS/ATARI reports out of range values for its X and Y axis of the
DPad which, due to the null state bit being unset, are forwarded to
userspace as is. Now these values will get clamped to the logical range
before being forwarded to userspace. This device was also used to test
this patch.
This patch expands on commit 3f3752705dbd ("HID: reject input outside
logical range only if null state is set").
[1]: http://lkml.kernel.org/r/20170307131036.GA853@gaia.local
[2]: https://msdn.microsoft.com/en-us/library/windows/hardware/dn672278(v=vs.85)…
Signed-off-by: Tomasz Kramkowski <tk(a)the-tk.com>
Acked-by: Benjamin Tissoires <benjamin.tissoires(a)redhat.com>
Signed-off-by: Jiri Kosina <jkosina(a)suse.cz>
Signed-off-by: Sasha Levin <alexander.levin(a)microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/hid/hid-input.c | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1149,19 +1149,26 @@ void hidinput_hid_event(struct hid_devic
/*
* Ignore out-of-range values as per HID specification,
- * section 5.10 and 6.2.25.
+ * section 5.10 and 6.2.25, when NULL state bit is present.
+ * When it's not, clamp the value to match Microsoft's input
+ * driver as mentioned in "Required HID usages for digitizers":
+ * https://msdn.microsoft.com/en-us/library/windows/hardware/dn672278(v=vs.85)…
*
* The logical_minimum < logical_maximum check is done so that we
* don't unintentionally discard values sent by devices which
* don't specify logical min and max.
*/
if ((field->flags & HID_MAIN_ITEM_VARIABLE) &&
- (field->flags & HID_MAIN_ITEM_NULL_STATE) &&
- (field->logical_minimum < field->logical_maximum) &&
- (value < field->logical_minimum ||
- value > field->logical_maximum)) {
- dbg_hid("Ignoring out-of-range value %x\n", value);
- return;
+ (field->logical_minimum < field->logical_maximum)) {
+ if (field->flags & HID_MAIN_ITEM_NULL_STATE &&
+ (value < field->logical_minimum ||
+ value > field->logical_maximum)) {
+ dbg_hid("Ignoring out-of-range value %x\n", value);
+ return;
+ }
+ value = clamp(value,
+ field->logical_minimum,
+ field->logical_maximum);
}
/*
Patches currently in stable-queue which might be from tk(a)the-tk.com are
queue-4.9/hid-clamp-input-to-logical-range-if-no-null-state.patch
queue-4.9/hid-reject-input-outside-logical-range-only-if-null-state-is-set.patch
This is a note to let you know that I've just added the patch titled
fm10k: correctly check if interface is removed
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
fm10k-correctly-check-if-interface-is-removed.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From foo@baz Sun Mar 18 16:55:33 CET 2018
From: Phil Turnbull <phil.turnbull(a)oracle.com>
Date: Wed, 23 Nov 2016 13:33:58 -0500
Subject: fm10k: correctly check if interface is removed
From: Phil Turnbull <phil.turnbull(a)oracle.com>
[ Upstream commit 540fca35e38d15777b310f450f63f056e63039f5 ]
FM10K_REMOVED expects a hardware address, not a 'struct fm10k_hw'.
Fixes: 5cb8db4a4cbc ("fm10k: Add support for VF")
Signed-off-by: Phil Turnbull <phil.turnbull(a)oracle.com>
Tested-by: Krishneil Singh <krishneil.k.singh(a)intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher(a)intel.com>
Signed-off-by: Sasha Levin <alexander.levin(a)microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c
@@ -942,7 +942,7 @@ static void fm10k_self_test(struct net_d
memset(data, 0, sizeof(*data) * FM10K_TEST_LEN);
- if (FM10K_REMOVED(hw)) {
+ if (FM10K_REMOVED(hw->hw_addr)) {
netif_err(interface, drv, dev,
"Interface removed - test blocked\n");
eth_test->flags |= ETH_TEST_FL_FAILED;
Patches currently in stable-queue which might be from phil.turnbull(a)oracle.com are
queue-4.9/fm10k-correctly-check-if-interface-is-removed.patch
This is a note to let you know that I've just added the patch titled
f2fs: relax node version check for victim data in gc
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
f2fs-relax-node-version-check-for-victim-data-in-gc.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From foo@baz Sun Mar 18 16:55:33 CET 2018
From: Jaegeuk Kim <jaegeuk(a)kernel.org>
Date: Tue, 21 Mar 2017 10:59:50 -0400
Subject: f2fs: relax node version check for victim data in gc
From: Jaegeuk Kim <jaegeuk(a)kernel.org>
[ Upstream commit c13ff37e359bb3eacf4e1760dcea8d9760aa7459 ]
- has_not_enough_free_secs
node_secs: 0 dent_secs: 0 freed:0 free_segments:103 reserved:104
- f2fs_gc
- get_victim_by_default
alloc_mode 0, gc_mode 1, max_search 2672, offset 4654, ofs_unit 1
- do_garbage_collect
start_segno 3976, end_segno 3977 type 0
- is_alive
nid 22797, blkaddr 2131882, ofs_in_node 0, version 0x8/0x0
- gc_data_segment 766, segno 3976, block 512/426 not alive
So, this patch fixes subtle corrupted case where node version does not match
to summary version which results in infinite loop by gc.
Reported-by: Yunlei He <heyunlei(a)huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk(a)kernel.org>
Signed-off-by: Sasha Levin <alexander.levin(a)microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
fs/f2fs/gc.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -538,8 +538,10 @@ static bool is_alive(struct f2fs_sb_info
get_node_info(sbi, nid, dni);
if (sum->version != dni->version) {
- f2fs_put_page(node_page, 1);
- return false;
+ f2fs_msg(sbi->sb, KERN_WARNING,
+ "%s: valid data with mismatched node version.",
+ __func__);
+ set_sbi_flag(sbi, SBI_NEED_FSCK);
}
*nofs = ofs_of_node(node_page);
Patches currently in stable-queue which might be from jaegeuk(a)kernel.org are
queue-4.9/f2fs-relax-node-version-check-for-victim-data-in-gc.patch
This is a note to let you know that I've just added the patch titled
eventpoll.h: fix epoll event masks
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
eventpoll.h-fix-epoll-event-masks.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From foo@baz Sun Mar 18 16:55:33 CET 2018
From: Greg KH <gregkh(a)linuxfoundation.org>
Date: Wed, 8 Mar 2017 19:03:03 +0100
Subject: eventpoll.h: fix epoll event masks
From: Greg KH <gregkh(a)linuxfoundation.org>
[ Upstream commit 6f051e4a685b768f3704c7c069aa1edee3010622 ]
[resend due to me forgetting to cc: linux-api the first time around I
posted these back on Feb 23]
From: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
When userspace tries to use these defines, it complains that it needs to
be an unsigned 1 that is shifted, so libc implementations have to create
their own version. Fix this by defining it properly so that libcs can
just use the kernel uapi header.
Reported-by: Elliott Hughes <enh(a)google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin(a)microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
include/uapi/linux/eventpoll.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/include/uapi/linux/eventpoll.h
+++ b/include/uapi/linux/eventpoll.h
@@ -40,7 +40,7 @@
#define EPOLLRDHUP 0x00002000
/* Set exclusive wakeup mode for the target file descriptor */
-#define EPOLLEXCLUSIVE (1 << 28)
+#define EPOLLEXCLUSIVE (1U << 28)
/*
* Request the handling of system wakeup events so as to prevent system suspends
@@ -52,13 +52,13 @@
*
* Requires CAP_BLOCK_SUSPEND
*/
-#define EPOLLWAKEUP (1 << 29)
+#define EPOLLWAKEUP (1U << 29)
/* Set the One Shot behaviour for the target file descriptor */
-#define EPOLLONESHOT (1 << 30)
+#define EPOLLONESHOT (1U << 30)
/* Set the Edge Triggered behaviour for the target file descriptor */
-#define EPOLLET (1 << 31)
+#define EPOLLET (1U << 31)
/*
* On x86-64 make the 64bit structure have the same alignment as the
Patches currently in stable-queue which might be from gregkh(a)linuxfoundation.org are
queue-4.9/nfc-pn533-change-order-of-free_irq-and-dev-unregistration.patch
queue-4.9/dmaengine-bcm2835-dma-use-vchan_terminate_vdesc-instead-of-desc_free.patch
queue-4.9/asoc-rt5677-add-of-device-id-table.patch
queue-4.9/arm-dra7-hwmod_data-prevent-wait_target_disable-error-for-usb_otg_ss.patch
queue-4.9/arm-dts-omap3-n900-fix-the-audio-codec-s-reset-pin.patch
queue-4.9/hid-elo-clear-btn_left-mapping.patch
queue-4.9/sched-stop-resched_cpu-from-sending-ipis-to-offline-cpus.patch
queue-4.9/arm64-dts-r8a7796-remove-unit-address-and-reg-from-integrated-cache.patch
queue-4.9/mips-bpf-quit-clobbering-callee-saved-registers-in-jit-code.patch
queue-4.9/net-faraday-add-missing-include-of-of.h.patch
queue-4.9/asoc-rcar-ssi-don-t-set-ssicr.ckdv-000-with-ssiwsr.cont.patch
queue-4.9/selinux-check-for-address-length-in-selinux_socket_bind.patch
queue-4.9/drm-ttm-never-add-bo-that-failed-to-validate-to-the-lru-list.patch
queue-4.9/alsa-hda-add-geminilake-id-to-skl_plus.patch
queue-4.9/arm-dts-r8a7791-remove-unit-address-and-reg-from-integrated-cache.patch
queue-4.9/perf-buildid-do-not-assume-that-readlink-returns-a-null-terminated-string.patch
queue-4.9/v4l-vsp1-prevent-multiple-streamon-race-commencing-pipeline-early.patch
queue-4.9/net-thunderx-set-max-queue-count-taking-xdp_tx-into-account.patch
queue-4.9/arm-dts-adjust-moxart-irq-controller-and-flags.patch
queue-4.9/drm-defer-disabling-the-vblank-irq-until-the-next-interrupt-for-instant-off.patch
queue-4.9/spi-omap2-mcspi-poll-omap2_mcspi_chstat_rxs-for-pio-transfer.patch
queue-4.9/ath10k-fix-invalid-sts_cap_offset_mask.patch
queue-4.9/drm-sun4i-fix-up-error-path-cleanup-for-master-bind-function.patch
queue-4.9/qed-always-publish-vf-link-from-leading-hwfn.patch
queue-4.9/qed-fix-tm-block-ilt-allocation.patch
queue-4.9/printk-correctly-handle-preemption-in-console_unlock.patch
queue-4.9/powerpc-nohash-fix-use-of-mmu_has_feature-in-setup_initial_memory_limit.patch
queue-4.9/media-cpia2-fix-a-couple-off-by-one-bugs.patch
queue-4.9/arm-dts-r7s72100-fix-ethernet-clock-parent.patch
queue-4.9/net-hns-correct-hns-rss-key-set-function.patch
queue-4.9/bonding-make-speed-duplex-setting-consistent-with-link-state.patch
queue-4.9/sched-stop-switched_to_rt-from-sending-ipis-to-offline-cpus.patch
queue-4.9/mac80211-remove-bug-when-interface-type-is-invalid.patch
queue-4.9/perf-session-don-t-rely-on-evlist-in-pipe-mode.patch
queue-4.9/net-fec-add-phy-reset-gpios-probe_defer-check.patch
queue-4.9/vfio-spapr_tce-check-kzalloc-return-when-preregistering-memory.patch
queue-4.9/kvm-nvmx-disallow-userspace-injected-exceptions-in-guest-mode.patch
queue-4.9/sched-act_csum-don-t-mangle-tcp-and-udp-gso-packets.patch
queue-4.9/arm-dts-r8a7791-correct-parent-of-ssi-clocks.patch
queue-4.9/powerpc-avoid-taking-a-data-miss-on-every-userspace-instruction-miss.patch
queue-4.9/net-xfrm-allow-clearing-socket-xfrm-policies.patch
queue-4.9/omapfb-dss-handle-return-errors-in-dss_init_ports.patch
queue-4.9/mtd-nand-ifc-update-bufnum-mask-for-ver-2.0.0.patch
queue-4.9/mips-r2-on-r6-emu-clear-bltzall-and-bgezall-debugfs-counters.patch
queue-4.9/regulator-core-limit-propagation-of-parent-voltage-count-and-list.patch
queue-4.9/dmaengine-imx-sdma-add-1ms-delay-to-ensure-sdma-channel-is-stopped.patch
queue-4.9/wil6210-fix-protection-against-connections-during-reset.patch
queue-4.9/md.c-didn-t-unlock-the-mddev-before-return-einval-in-array_size_store.patch
queue-4.9/net-8021q-create-device-with-all-possible-features-in-wanted_features.patch
queue-4.9/lkdtm-turn-off-kcov-for-lkdtm_rodata_do_nothing.patch
queue-4.9/drivers-net-xgene-fix-wrong-logical-operation.patch
queue-4.9/pci-hv-lock-pci-bus-on-device-eject.patch
queue-4.9/ath10k-fix-fetching-channel-during-potential-radar-detection.patch
queue-4.9/net-ethernet-bgmac-allow-mac-address-to-be-specified-in-dtb.patch
queue-4.9/powerpc-modules-don-t-try-to-restore-r2-after-a-sibling-call.patch
queue-4.9/rtmutex-fix-pi-chain-order-integrity.patch
queue-4.9/alsa-firewire-digi00x-handle-all-midi-messages-on-streaming-packets.patch
queue-4.9/drm-amdgpu-fail-fb-creation-from-imported-dma-bufs.-v2.patch
queue-4.9/leds-pm8058-silence-pointer-to-integer-size-warning.patch
queue-4.9/qed-correct-msi-x-for-storage.patch
queue-4.9/s390-topology-fix-typo-in-early-topology-code.patch
queue-4.9/ath10k-fix-compile-time-sanity-check-for-ce4-buffer-size.patch
queue-4.9/arm-dts-silk-correct-clock-of-du1.patch
queue-4.9/of-fix-of_device_get_modalias-returned-length-when-truncating-buffers.patch
queue-4.9/clk-qcom-msm8916-fix-mnd_width-for-codec_digcodec.patch
queue-4.9/alsa-firewire-digi00x-add-support-for-console-models-of-digi00x-series.patch
queue-4.9/arm-dts-exynos-correct-trats2-panel-reset-line.patch
queue-4.9/power-supply-ab8500_charger-fix-an-error-handling-path.patch
queue-4.9/perf-tools-make-perf_event__synthesize_mmap_events-scale.patch
queue-4.9/perf-annotate-fix-a-bug-following-symbolic-link-of-a-build-id-file.patch
queue-4.9/usb-dwc2-make-sure-we-disconnect-the-gadget-state.patch
queue-4.9/veth-set-peer-gso-values.patch
queue-4.9/arm-dts-r8a7792-remove-unit-address-and-reg-from-integrated-cache.patch
queue-4.9/mips-r2-on-r6-emu-fix-blezl-and-bgtzl-identification.patch
queue-4.9/i40e-acquire-nvm-lock-before-reads-on-all-devices.patch
queue-4.9/drivers-net-xgene-fix-hardware-checksum-setting.patch
queue-4.9/usb-misc-lvs-fix-race-condition-in-disconnect-handling.patch
queue-4.9/bonding-refine-bond_fold_stats-wrap-detection.patch
queue-4.9/mac80211_hwsim-enforce-ps_manual_poll-to-be-set-after-ps_enabled.patch
queue-4.9/driver-adm1275-set-the-m-b-and-r-coefficients-correctly-for-power.patch
queue-4.9/pwm-stmpe-fix-wrong-register-offset-for-hwpwm-2-case.patch
queue-4.9/scsi-sg-check-for-valid-direction-before-starting-the-request.patch
queue-4.9/x86-mce-handle-broadcasted-mce-gracefully-with-kexec.patch
queue-4.9/drm-radeon-fail-fb-creation-from-imported-dma-bufs.patch
queue-4.9/clk-meson-gxbb-fix-wrong-clock-for-saradc-sana.patch
queue-4.9/iwlwifi-mvm-rs-don-t-override-the-rate-history-in-the-search-cycle.patch
queue-4.9/mm-fix-false-positive-vm_bug_on-in-page_cache_-get-add-_speculative.patch
queue-4.9/sysrq-reset-the-watchdog-timers-while-displaying-high-resolution-timers.patch
queue-4.9/locking-locktorture-fix-num-reader-writer-corner-cases.patch
queue-4.9/ath10k-update-tdls-teardown-state-to-target.patch
queue-4.9/nfc-nfcmrvl-include-unaligned.h-instead-of-access_ok.h.patch
queue-4.9/v4l-vsp1-register-pipe-with-output-wpf.patch
queue-4.9/rcutorture-configinit-fix-build-directory-error-message.patch
queue-4.9/ath10k-fix-a-warning-during-channel-switch-with-multiple-vaps.patch
queue-4.9/netem-apply-correct-delay-when-rate-throttling.patch
queue-4.9/zd1211rw-fix-null-deref-at-probe.patch
queue-4.9/mac80211_hwsim-use-per-interface-power-level.patch
queue-4.9/scsi-devinfo-apply-to-hp-xp-the-same-flags-as-hitachi-vsp.patch
queue-4.9/tty-amba-pl011-fix-spurious-tx-interrupts.patch
queue-4.9/kprobes-x86-set-kprobes-pages-read-only.patch
queue-4.9/batman-adv-handle-race-condition-for-claims-between-gateways.patch
queue-4.9/input-qt1070-add-of-device-id-table.patch
queue-4.9/hid-clamp-input-to-logical-range-if-no-null-state.patch
queue-4.9/input-tsc2007-check-for-presence-and-power-down-tsc2007-during-probe.patch
queue-4.9/perf-stat-issue-a-hw-watchdog-disable-hint.patch
queue-4.9/vxlan-vxlan-dev-should-inherit-lowerdev-s-gso_max_size.patch
queue-4.9/braille-console-fix-value-returned-by-_braille_console_setup.patch
queue-4.9/drm-sun4i-set-drm_crtc.port-to-the-underlying-tcon-s-output-port-node.patch
queue-4.9/fm10k-correctly-check-if-interface-is-removed.patch
queue-4.9/x86-mm-make-mmap-map_32bit-work-correctly.patch
queue-4.9/drm-sun4i-fix-tcon-clock-and-regmap-initialization-sequence.patch
queue-4.9/drm-rcar-du-handle-event-when-disabling-crtcs.patch
queue-4.9/regulator-isl9305-fix-array-size.patch
queue-4.9/kprobes-x86-fix-kprobe-booster-not-to-boost-far-call-instructions.patch
queue-4.9/arm-dts-koelsch-correct-clock-frequency-of-x2-du-clock-input.patch
queue-4.9/arm-dts-r8a7794-correct-clock-of-du1.patch
queue-4.9/arm-brcmstb-enable-zone_dma-for-non-64-bit-capable-peripherals.patch
queue-4.9/arm-dts-r8a7794-remove-unit-address-and-reg-from-integrated-cache.patch
queue-4.9/scsi-ipr-fix-missed-eh-wakeup.patch
queue-4.9/perf-sort-fix-segfault-with-basic-block-cycles-sort-dimension.patch
queue-4.9/iommu-iova-fix-underflow-bug-in-__alloc_and_insert_iova_range.patch
queue-4.9/timers-sched_clock-update-timeout-for-clock-wrap.patch
queue-4.9/perf-trace-handle-unpaired-raw_syscalls-sys_exit-event.patch
queue-4.9/reiserfs-make-cancel_old_flush-reliable.patch
queue-4.9/nfc-nfcmrvl-double-free-on-error-path.patch
queue-4.9/clk-sunxi-ng-a33-add-offset-and-minimum-value-for-ddr1-pll-n-factor.patch
queue-4.9/md-raid6-fix-anomily-when-recovering-a-single-device-in-raid6.patch
queue-4.9/perf-probe-fix-concat_probe_trace_events.patch
queue-4.9/bnxt_en-don-t-print-link-speed-1-no-longer-supported-messages.patch
queue-4.9/drm-qxl-don-t-alloc-fbdev-if-emulation-is-not-supported.patch
queue-4.9/arm-dts-bcm2835-add-index-to-the-ethernet-alias.patch
queue-4.9/userns-don-t-fail-follow_automount-based-on-s_user_ns.patch
queue-4.9/blk-throttle-make-sure-expire-time-isn-t-too-big.patch
queue-4.9/blkcg-fix-double-free-of-new_blkg-in-blkcg_init_queue.patch
queue-4.9/wil6210-fix-memory-access-violation-in-wil_memcpy_from-toio_32.patch
queue-4.9/video-hdmi-allow-empty-hdmi-infoframes.patch
queue-4.9/powerpc-xmon-fix-an-unexpected-xmon-on-off-state-change.patch
queue-4.9/serial-imx-setup-dcedte-early-and-ensure-dcd-and-ri-irqs-to-be-off.patch
queue-4.9/bluetooth-6lowpan-fix-delay-work-init-in-add_peer_chan.patch
queue-4.9/soc-tegra-fix-link-errors-with-pmc-disabled.patch
queue-4.9/test_firmware-fix-setting-old-custom-fw-path-back-on-exit.patch
queue-4.9/scsi-fnic-fix-for-number-of-active-ios-in-fnicstats-becoming-negative.patch
queue-4.9/arm-dts-r8a7793-remove-unit-address-and-reg-from-integrated-cache.patch
queue-4.9/staging-speakup-replace-bug_on-with-warn_on.patch
queue-4.9/hid-reject-input-outside-logical-range-only-if-null-state-is-set.patch
queue-4.9/scsi-sg-close-race-condition-in-sg_remove_sfp_usercontext.patch
queue-4.9/ima-relax-requiring-a-file-signature-for-new-files-with-zero-length.patch
queue-4.9/edac-altera-fix-peripheral-warnings-for-cyclone5.patch
queue-4.9/arm-dts-r8a7793-correct-parent-of-ssi-clocks.patch
queue-4.9/x86-boot-32-defer-resyncing-initial_page_table-until-per-cpu-is-set-up.patch
queue-4.9/pci-msi-stop-disabling-msi-msi-x-in-pci_device_shutdown.patch
queue-4.9/staging-wilc1000-add-check-for-kmalloc-allocation-failure.patch
queue-4.9/scsi-be2iscsi-check-tag-in-beiscsi_mccq_compl_wait.patch
queue-4.9/kvm-svm-setup-mcg_cap-on-amd-properly.patch
queue-4.9/usb-gadget-dummy_hcd-fix-wrong-power-status-bit-clear-reset-in-dummy_hub_control.patch
queue-4.9/ib-hfi1-check-for-qsfp-presence-before-attempting-reads.patch
queue-4.9/usb-dwc3-make-sure-ux_exit_px-is-cleared.patch
queue-4.9/perf-inject-copy-events-when-reordering-events-in-pipe-mode.patch
queue-4.9/power-supply-ab8500_charger-bail-out-in-case-of-error-in-ab8500_charger_init_hw_registers.patch
queue-4.9/media-vsp1-prevent-suspending-and-resuming-drm-pipelines.patch
queue-4.9/scsi-ses-don-t-get-power-status-of-ses-device-slot-on-probe.patch
queue-4.9/drm-vmwgfx-fixes-to-vmwgfx_fb.patch
queue-4.9/eventpoll.h-fix-epoll-event-masks.patch
queue-4.9/clk-qcom-msm8996-fix-the-vfe1-powerdomain-name.patch
queue-4.9/pci-apply-cavium-acs-quirk-only-to-cn81xx-cn83xx-cn88xx-devices.patch
queue-4.9/perf-probe-return-errno-when-not-hitting-any-event.patch
queue-4.9/spi-sun6i-disable-unprepare-clocks-on-remove.patch
queue-4.9/x86-mce-init-some-cpu-features-early.patch
queue-4.9/arm-dts-r8a7790-correct-parent-of-ssi-clocks.patch
queue-4.9/mips-bpf-fix-multiple-problems-in-jit-skb-access-helpers.patch
queue-4.9/net-mvpp2-set-dma-mask-and-coherent-dma-mask-on-ppv2.2.patch
queue-4.9/mwifiex-cfg80211-do-not-change-virtual-interface-during-scan-processing.patch
queue-4.9/ipvlan-add-l2-check-for-packets-arriving-via-virtual-devices.patch
queue-4.9/video-arm-clcd-fix-dma-allocation-size.patch
queue-4.9/drm-edid-set-eld-connector-type-in-drm_edid_to_eld.patch
queue-4.9/iwlwifi-mvm-fix-rx-skb-header-size-and-align-it-properly.patch
queue-4.9/drm-amdkfd-fix-memory-leaks-in-kfd-topology.patch
queue-4.9/pci-hv-properly-handle-pci-bus-remove.patch
queue-4.9/drivers-net-xgene-fix-rx-checksum-validation-logic.patch
queue-4.9/media-i2c-soc_camera-fix-ov6650-sensor-getting-wrong-clock.patch
queue-4.9/pwm-tegra-increase-precision-in-pwm-rate-calculation.patch
queue-4.9/net-ieee802154-adf7242-fix-bug-if-defined-debug.patch
queue-4.9/arm-bcm2835-enable-missing-cma-settings-for-vc4-driver.patch
queue-4.9/agp-intel-flush-all-chipset-writes-after-updating-the-ggtt.patch
queue-4.9/arm-dts-am335x-pepper-fix-the-audio-codec-s-reset-pin.patch
queue-4.9/drivers-net-phy-xgene-fix-mdio-write.patch
queue-4.9/apparmor-make-path_max-parameter-readonly.patch
queue-4.9/perf-evsel-return-exact-sub-event-which-failed-with-eperm-for-wildcards.patch
queue-4.9/powerpc-mm-hugetlb-filter-out-hugepage-size-not-supported-by-page-table-layout.patch
queue-4.9/scsi-core-scsi_get_device_flags_keyed-always-return-device-flags.patch
queue-4.9/f2fs-relax-node-version-check-for-victim-data-in-gc.patch
queue-4.9/scsi-dh-add-new-rdac-devices.patch
queue-4.9/scsi-ses-don-t-ask-for-diagnostic-pages-repeatedly-during-probe.patch
queue-4.9/mwifiex-fix-invalid-port-issue.patch
queue-4.9/solo6x10-release-vb2-buffers-in-solo_stop_streaming.patch
queue-4.9/i40e-fix-ethtool-to-get-eeprom-data-from-x722-interface.patch
queue-4.9/drm-rockchip-vop-enable-pm-domain-before-vop_initial.patch
queue-4.9/bluetooth-avoid-bt_accept_unlink-double-unlinking.patch
queue-4.9/i40e-only-register-client-on-iwarp-capable-devices.patch
queue-4.9/alsa-firewire-lib-add-a-quirk-of-packet-without-valid-eoh-in-cip-format.patch
queue-4.9/drivers-perf-arm_pmu-handle-no-platform_device.patch
queue-4.9/tcp-sysctl-fix-a-race-to-avoid-unexpected-0-window-from-space.patch
queue-4.9/i40e-i40evf-fix-use-after-free-in-rx-cleanup-path.patch
queue-4.9/asoc-nuc900-fix-a-loop-timeout-test.patch
queue-4.9/tools-usbip-fixes-build-with-musl-libc-toolchain.patch
queue-4.9/coresight-fixes-coresight-dt-parse-to-get-correct-output-port-id.patch
queue-4.9/mtd-nand-fix-interpretation-of-nand_cmd_none-in-nand_command.patch
queue-4.9/perf-stat-fix-bug-in-handling-events-in-error-state.patch
queue-4.9/vfio-powerpc-spapr_tce-enforce-iommu-type-compatibility-check.patch
queue-4.9/ath10k-disallow-dfs-simulation-if-dfs-channel-is-not-enabled.patch
This is a note to let you know that I've just added the patch titled
EDAC, altera: Fix peripheral warnings for Cyclone5
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
edac-altera-fix-peripheral-warnings-for-cyclone5.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From foo@baz Sun Mar 18 16:55:33 CET 2018
From: Thor Thayer <thor.thayer(a)linux.intel.com>
Date: Wed, 5 Apr 2017 13:01:02 -0500
Subject: EDAC, altera: Fix peripheral warnings for Cyclone5
From: Thor Thayer <thor.thayer(a)linux.intel.com>
[ Upstream commit 25b223ddfe2a557307c05fe673e09d94ae950877 ]
The peripherals' RAS functionality only exist on the Arria10 SoCFPGA.
The Cyclone5 initialization generates EDAC warnings when the peripherals
aren't found in the device tree. Fix by checking for Arria10 in the init
functions.
Signed-off-by: Thor Thayer <thor.thayer(a)linux.intel.com>
Cc: linux-edac <linux-edac(a)vger.kernel.org>
Link: http://lkml.kernel.org/r/1491415262-5018-1-git-send-email-thor.thayer@linux…
Signed-off-by: Borislav Petkov <bp(a)suse.de>
Signed-off-by: Sasha Levin <alexander.levin(a)microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/edac/altera_edac.c | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -1020,13 +1020,23 @@ out:
return ret;
}
+static int socfpga_is_a10(void)
+{
+ return of_machine_is_compatible("altr,socfpga-arria10");
+}
+
static int validate_parent_available(struct device_node *np);
static const struct of_device_id altr_edac_a10_device_of_match[];
static int __init __maybe_unused altr_init_a10_ecc_device_type(char *compat)
{
int irq;
- struct device_node *child, *np = of_find_compatible_node(NULL, NULL,
- "altr,socfpga-a10-ecc-manager");
+ struct device_node *child, *np;
+
+ if (!socfpga_is_a10())
+ return -ENODEV;
+
+ np = of_find_compatible_node(NULL, NULL,
+ "altr,socfpga-a10-ecc-manager");
if (!np) {
edac_printk(KERN_ERR, EDAC_DEVICE, "ECC Manager not found\n");
return -ENODEV;
@@ -1542,8 +1552,12 @@ static const struct edac_device_prv_data
static int __init socfpga_init_sdmmc_ecc(void)
{
int rc = -ENODEV;
- struct device_node *child = of_find_compatible_node(NULL, NULL,
- "altr,socfpga-sdmmc-ecc");
+ struct device_node *child;
+
+ if (!socfpga_is_a10())
+ return -ENODEV;
+
+ child = of_find_compatible_node(NULL, NULL, "altr,socfpga-sdmmc-ecc");
if (!child) {
edac_printk(KERN_WARNING, EDAC_DEVICE, "SDMMC node not found\n");
return -ENODEV;
Patches currently in stable-queue which might be from thor.thayer(a)linux.intel.com are
queue-4.9/edac-altera-fix-peripheral-warnings-for-cyclone5.patch
This is a note to let you know that I've just added the patch titled
drm/vmwgfx: Fixes to vmwgfx_fb
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
drm-vmwgfx-fixes-to-vmwgfx_fb.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From foo@baz Sun Mar 18 16:55:33 CET 2018
From: Sinclair Yeh <syeh(a)vmware.com>
Date: Thu, 23 Mar 2017 14:28:21 -0700
Subject: drm/vmwgfx: Fixes to vmwgfx_fb
From: Sinclair Yeh <syeh(a)vmware.com>
[ Upstream commit aa74f0687cfe998e59b20d6454f45e8aa4403c45 ]
1. When unsetting a mode, num_connector should be set to zero
2. The pixel_format field needs to be initialized as newer DRM internal
functions checks this field
3. Take the drm_modeset_lock_all() because vmw_fb_kms_detach() can
change current mode
Signed-off-by: Sinclair Yeh <syeh(a)vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom(a)vmware.com>
Signed-off-by: Sasha Levin <alexander.levin(a)microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
@@ -433,7 +433,7 @@ static int vmw_fb_kms_detach(struct vmw_
set.y = 0;
set.mode = NULL;
set.fb = NULL;
- set.num_connectors = 1;
+ set.num_connectors = 0;
set.connectors = &par->con;
ret = drm_mode_set_config_internal(&set);
if (ret) {
@@ -821,7 +821,9 @@ int vmw_fb_off(struct vmw_private *vmw_p
flush_delayed_work(&par->local_work);
mutex_lock(&par->bo_mutex);
+ drm_modeset_lock_all(vmw_priv->dev);
(void) vmw_fb_kms_detach(par, true, false);
+ drm_modeset_unlock_all(vmw_priv->dev);
mutex_unlock(&par->bo_mutex);
return 0;
Patches currently in stable-queue which might be from syeh(a)vmware.com are
queue-4.9/drm-vmwgfx-fixes-to-vmwgfx_fb.patch
This is a note to let you know that I've just added the patch titled
drm/ttm: never add BO that failed to validate to the LRU list
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
drm-ttm-never-add-bo-that-failed-to-validate-to-the-lru-list.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From foo@baz Sun Mar 18 16:55:33 CET 2018
From: "Nicolai Hähnle" <nicolai.haehnle(a)amd.com>
Date: Tue, 14 Feb 2017 09:37:12 +0100
Subject: drm/ttm: never add BO that failed to validate to the LRU list
From: "Nicolai Hähnle" <nicolai.haehnle(a)amd.com>
[ Upstream commit c2c139cf435b18939204800fa72c53a7207bdd68 ]
Fixes a potential race condition in amdgpu that looks as follows:
Task 1: attempt ttm_bo_init, but ttm_bo_validate fails
Task 1: add BO to global list anyway
Task 2: grabs hold of the BO, waits on its reservation lock
Task 1: releases its reference of the BO; never gives up the
reservation lock
The patch "drm/amdgpu: fix a potential deadlock in
amdgpu_bo_create_restricted()" attempts to fix that by releasing
the reservation lock in amdgpu code; unfortunately, it introduces
a use-after-free when this race _doesn't_ happen.
This patch should fix the race properly by never adding the BO
to the global list in the first place.
Cc: zhoucm1 <david1.zhou(a)amd.com>
Signed-off-by: Nicolai Hähnle <nicolai.haehnle(a)amd.com>
Tested-by: Samuel Pitoiset <samuel.pitoiset(a)gmail.com>
Reviewed-by: Christian König <christian.koenig(a)amd.com>
Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com>
Signed-off-by: Sasha Levin <alexander.levin(a)microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/gpu/drm/ttm/ttm_bo.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -1209,18 +1209,20 @@ int ttm_bo_init(struct ttm_bo_device *bd
if (likely(!ret))
ret = ttm_bo_validate(bo, placement, interruptible, false);
- if (!resv) {
+ if (!resv)
ttm_bo_unreserve(bo);
- } else if (!(bo->mem.placement & TTM_PL_FLAG_NO_EVICT)) {
+ if (unlikely(ret)) {
+ ttm_bo_unref(&bo);
+ return ret;
+ }
+
+ if (resv && !(bo->mem.placement & TTM_PL_FLAG_NO_EVICT)) {
spin_lock(&bo->glob->lru_lock);
ttm_bo_add_to_lru(bo);
spin_unlock(&bo->glob->lru_lock);
}
- if (unlikely(ret))
- ttm_bo_unref(&bo);
-
return ret;
}
EXPORT_SYMBOL(ttm_bo_init);
Patches currently in stable-queue which might be from nicolai.haehnle(a)amd.com are
queue-4.9/drm-ttm-never-add-bo-that-failed-to-validate-to-the-lru-list.patch
This is a note to let you know that I've just added the patch titled
drm/sun4i: Set drm_crtc.port to the underlying TCON's output port node
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
drm-sun4i-set-drm_crtc.port-to-the-underlying-tcon-s-output-port-node.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From foo@baz Sun Mar 18 16:55:33 CET 2018
From: Chen-Yu Tsai <wens(a)csie.org>
Date: Thu, 23 Feb 2017 16:05:34 +0800
Subject: drm/sun4i: Set drm_crtc.port to the underlying TCON's output port node
From: Chen-Yu Tsai <wens(a)csie.org>
[ Upstream commit 7544860733d158e3edbf309f27e79e258c8f66bd ]
The way drm_of_find_possible_crtcs works is it tries to match the
remote-endpoint of the given node's various endpoints to all the
crtc's .port field. Thus we need to set drm_crtc.port to the output
port node of the underlying TCON.
Signed-off-by: Chen-Yu Tsai <wens(a)csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard(a)free-electrons.com>
Signed-off-by: Sasha Levin <alexander.levin(a)microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/gpu/drm/sun4i/sun4i_crtc.c | 5 +++++
1 file changed, 5 insertions(+)
--- a/drivers/gpu/drm/sun4i/sun4i_crtc.c
+++ b/drivers/gpu/drm/sun4i/sun4i_crtc.c
@@ -19,6 +19,7 @@
#include <linux/clk-provider.h>
#include <linux/ioport.h>
#include <linux/of_address.h>
+#include <linux/of_graph.h>
#include <linux/of_irq.h>
#include <linux/regmap.h>
@@ -136,5 +137,9 @@ struct sun4i_crtc *sun4i_crtc_init(struc
drm_crtc_helper_add(&scrtc->crtc, &sun4i_crtc_helper_funcs);
+ /* Set crtc.port to output port node of the tcon */
+ scrtc->crtc.port = of_graph_get_port_by_id(drv->tcon->dev->of_node,
+ 1);
+
return scrtc;
}
Patches currently in stable-queue which might be from wens(a)csie.org are
queue-4.9/drm-sun4i-fix-up-error-path-cleanup-for-master-bind-function.patch
queue-4.9/drm-sun4i-set-drm_crtc.port-to-the-underlying-tcon-s-output-port-node.patch
queue-4.9/drm-sun4i-fix-tcon-clock-and-regmap-initialization-sequence.patch
queue-4.9/clk-sunxi-ng-a33-add-offset-and-minimum-value-for-ddr1-pll-n-factor.patch
This is a note to let you know that I've just added the patch titled
drm/sun4i: Fix up error path cleanup for master bind function
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
drm-sun4i-fix-up-error-path-cleanup-for-master-bind-function.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From foo@baz Sun Mar 18 16:55:33 CET 2018
From: Chen-Yu Tsai <wens(a)csie.org>
Date: Fri, 17 Feb 2017 11:13:25 +0800
Subject: drm/sun4i: Fix up error path cleanup for master bind function
From: Chen-Yu Tsai <wens(a)csie.org>
[ Upstream commit 9d56defb44b15427f4342c543a70fb7886fc06f5 ]
The master bind function calls numerous drm functions which initialize
underlying structures. It also tries to bind the various components
of the display pipeline, some of which may add additional drm objects.
This patch adds proper cleanup functions in the error path of the
master bind function.
This requires the patch "drm/sun4i: Move drm_mode_config_cleanup call
to main driver", which splits out drm_mode_config_cleanup from
sun4i_framebuffer_free so we can call it separately.
Signed-off-by: Chen-Yu Tsai <wens(a)csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard(a)free-electrons.com>
Signed-off-by: Sasha Levin <alexander.levin(a)microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/gpu/drm/sun4i/sun4i_drv.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
--- a/drivers/gpu/drm/sun4i/sun4i_drv.c
+++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
@@ -145,7 +145,7 @@ static int sun4i_drv_bind(struct device
ret = component_bind_all(drm->dev, drm);
if (ret) {
dev_err(drm->dev, "Couldn't bind all pipelines components\n");
- goto free_drm;
+ goto cleanup_mode_config;
}
/* Create our layers */
@@ -153,7 +153,7 @@ static int sun4i_drv_bind(struct device
if (IS_ERR(drv->layers)) {
dev_err(drm->dev, "Couldn't create the planes\n");
ret = PTR_ERR(drv->layers);
- goto free_drm;
+ goto cleanup_mode_config;
}
/* Create our CRTC */
@@ -161,7 +161,7 @@ static int sun4i_drv_bind(struct device
if (!drv->crtc) {
dev_err(drm->dev, "Couldn't create the CRTC\n");
ret = -EINVAL;
- goto free_drm;
+ goto cleanup_mode_config;
}
drm->irq_enabled = true;
@@ -173,7 +173,7 @@ static int sun4i_drv_bind(struct device
if (IS_ERR(drv->fbdev)) {
dev_err(drm->dev, "Couldn't create our framebuffer\n");
ret = PTR_ERR(drv->fbdev);
- goto free_drm;
+ goto cleanup_mode_config;
}
/* Enable connectors polling */
@@ -181,10 +181,16 @@ static int sun4i_drv_bind(struct device
ret = drm_dev_register(drm, 0);
if (ret)
- goto free_drm;
+ goto finish_poll;
return 0;
+finish_poll:
+ drm_kms_helper_poll_fini(drm);
+ sun4i_framebuffer_free(drm);
+cleanup_mode_config:
+ drm_mode_config_cleanup(drm);
+ drm_vblank_cleanup(drm);
free_drm:
drm_dev_unref(drm);
return ret;
Patches currently in stable-queue which might be from wens(a)csie.org are
queue-4.9/drm-sun4i-fix-up-error-path-cleanup-for-master-bind-function.patch
queue-4.9/drm-sun4i-set-drm_crtc.port-to-the-underlying-tcon-s-output-port-node.patch
queue-4.9/drm-sun4i-fix-tcon-clock-and-regmap-initialization-sequence.patch
queue-4.9/clk-sunxi-ng-a33-add-offset-and-minimum-value-for-ddr1-pll-n-factor.patch
This is a note to let you know that I've just added the patch titled
drm/sun4i: Fix TCON clock and regmap initialization sequence
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
drm-sun4i-fix-tcon-clock-and-regmap-initialization-sequence.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From foo@baz Sun Mar 18 16:55:33 CET 2018
From: Chen-Yu Tsai <wens(a)csie.org>
Date: Thu, 9 Mar 2017 18:05:24 +0800
Subject: drm/sun4i: Fix TCON clock and regmap initialization sequence
From: Chen-Yu Tsai <wens(a)csie.org>
[ Upstream commit 4c7f16d14a33a9cfb4af9cb780d8a73bcca64a92 ]
The TCON driver calls sun4i_tcon_init_regmap and sun4i_tcon_init_clocks
in its bind function. The former creates a regmap and writes to several
register to clear its configuration to a known default. The latter
initializes various clocks. This includes enabling the bus clock for
register access and creating the dotclock.
In order for the first step's writes to work, the bus clock must be
enabled which is done in the second step. but the dotclock's ops use
the regmap created in the first step.
Rearrange the function calls such that the clocks are initialized before
the regmap, and split out the dot clock creation to after the regmap is
initialized.
Fixes: 9026e0d122ac ("drm: Add Allwinner A10 Display Engine support")
Signed-off-by: Chen-Yu Tsai <wens(a)csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard(a)free-electrons.com>
Signed-off-by: Sasha Levin <alexander.levin(a)microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/gpu/drm/sun4i/sun4i_tcon.c | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
@@ -336,12 +336,11 @@ static int sun4i_tcon_init_clocks(struct
}
}
- return sun4i_dclk_create(dev, tcon);
+ return 0;
}
static void sun4i_tcon_free_clocks(struct sun4i_tcon *tcon)
{
- sun4i_dclk_free(tcon);
clk_disable_unprepare(tcon->clk);
}
@@ -506,22 +505,28 @@ static int sun4i_tcon_bind(struct device
return ret;
}
+ ret = sun4i_tcon_init_clocks(dev, tcon);
+ if (ret) {
+ dev_err(dev, "Couldn't init our TCON clocks\n");
+ goto err_assert_reset;
+ }
+
ret = sun4i_tcon_init_regmap(dev, tcon);
if (ret) {
dev_err(dev, "Couldn't init our TCON regmap\n");
- goto err_assert_reset;
+ goto err_free_clocks;
}
- ret = sun4i_tcon_init_clocks(dev, tcon);
+ ret = sun4i_dclk_create(dev, tcon);
if (ret) {
- dev_err(dev, "Couldn't init our TCON clocks\n");
- goto err_assert_reset;
+ dev_err(dev, "Couldn't create our TCON dot clock\n");
+ goto err_free_clocks;
}
ret = sun4i_tcon_init_irq(dev, tcon);
if (ret) {
dev_err(dev, "Couldn't init our TCON interrupts\n");
- goto err_free_clocks;
+ goto err_free_dotclock;
}
ret = sun4i_rgb_init(drm);
@@ -530,6 +535,8 @@ static int sun4i_tcon_bind(struct device
return 0;
+err_free_dotclock:
+ sun4i_dclk_free(tcon);
err_free_clocks:
sun4i_tcon_free_clocks(tcon);
err_assert_reset:
@@ -542,6 +549,7 @@ static void sun4i_tcon_unbind(struct dev
{
struct sun4i_tcon *tcon = dev_get_drvdata(dev);
+ sun4i_dclk_free(tcon);
sun4i_tcon_free_clocks(tcon);
}
Patches currently in stable-queue which might be from wens(a)csie.org are
queue-4.9/drm-sun4i-fix-up-error-path-cleanup-for-master-bind-function.patch
queue-4.9/drm-sun4i-set-drm_crtc.port-to-the-underlying-tcon-s-output-port-node.patch
queue-4.9/drm-sun4i-fix-tcon-clock-and-regmap-initialization-sequence.patch
queue-4.9/clk-sunxi-ng-a33-add-offset-and-minimum-value-for-ddr1-pll-n-factor.patch