mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luis Henriques <luis.henriques@canonical.com>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	kernel-team@lists.ubuntu.com
Cc: Jani Nikula <jani.nikula@intel.com>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Luis Henriques <luis.henriques@canonical.com>
Subject: [PATCH 3.5 08/62] drm/i915/dp: add native aux defer retry limit
Date: Wed,  5 Mar 2014 14:36:12 +0000	[thread overview]
Message-ID: <1394030226-26652-9-git-send-email-luis.henriques@canonical.com> (raw)
In-Reply-To: <1394030226-26652-1-git-send-email-luis.henriques@canonical.com>

3.5.7.32 -stable review patch.  If anyone has any objections, please let me know.

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

From: Jani Nikula <jani.nikula@intel.com>

commit f51a44b9a6c4982cc25bfb3727de9bb893621ebc upstream.

Retrying indefinitely places too much trust on the aux implementation of
the sink devices.

Reported-by: Daniel Martin <consume.noise@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71267
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Tested-by: Theodore Ts'o <tytso@mit.edu>
Tested-by: Sree Harsha Totakura <freedesktop@h.totakura.in>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
[ luis: backported to 3.5: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index fa14b42..7632aa0 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -493,6 +493,7 @@ intel_dp_aux_native_write(struct intel_dp *intel_dp,
 	uint8_t	msg[20];
 	int msg_bytes;
 	uint8_t	ack;
+	int retry;
 
 	intel_dp_check_edp(intel_dp);
 	if (send_bytes > 16)
@@ -503,18 +504,20 @@ intel_dp_aux_native_write(struct intel_dp *intel_dp,
 	msg[3] = send_bytes - 1;
 	memcpy(&msg[4], send, send_bytes);
 	msg_bytes = send_bytes + 4;
-	for (;;) {
+	for (retry = 0; retry < 7; retry++) {
 		ret = intel_dp_aux_ch(intel_dp, msg, msg_bytes, &ack, 1);
 		if (ret < 0)
 			return ret;
 		if ((ack & AUX_NATIVE_REPLY_MASK) == AUX_NATIVE_REPLY_ACK)
-			break;
+			return send_bytes;
 		else if ((ack & AUX_NATIVE_REPLY_MASK) == AUX_NATIVE_REPLY_DEFER)
 			usleep_range(400, 500);
 		else
 			return -EIO;
 	}
-	return send_bytes;
+
+	DRM_ERROR("too many retries, giving up\n");
+	return -EIO;
 }
 
 /* Write a single byte to the aux channel in native mode */
@@ -536,6 +539,7 @@ intel_dp_aux_native_read(struct intel_dp *intel_dp,
 	int reply_bytes;
 	uint8_t ack;
 	int ret;
+	int retry;
 
 	intel_dp_check_edp(intel_dp);
 	msg[0] = AUX_NATIVE_READ << 4;
@@ -546,7 +550,7 @@ intel_dp_aux_native_read(struct intel_dp *intel_dp,
 	msg_bytes = 4;
 	reply_bytes = recv_bytes + 1;
 
-	for (;;) {
+	for (retry = 0; retry < 7; retry++) {
 		ret = intel_dp_aux_ch(intel_dp, msg, msg_bytes,
 				      reply, reply_bytes);
 		if (ret == 0)
@@ -563,6 +567,9 @@ intel_dp_aux_native_read(struct intel_dp *intel_dp,
 		else
 			return -EIO;
 	}
+
+	DRM_ERROR("too many retries, giving up\n");
+	return -EIO;
 }
 
 static int
-- 
1.9.0


  parent reply	other threads:[~2014-03-05 14:57 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-05 14:36 [3.5.y.z extended stable] Linux 3.5.7.32 stable review Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 01/62] ata: enable quirk from jmicron JMB350 for JMB394 Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 02/62] sata_sil: apply MOD15WRITE quirk to TOSHIBA MK2561GSYN Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 03/62] ARM: 7953/1: mm: ensure TLB invalidation is complete before enabling MMU Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 04/62] x86: dma-mapping: fix GFP_ATOMIC macro usage Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 05/62] SUNRPC: Fix races in xs_nospace() Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 06/62] ext4: don't try to modify s_flags if the the file system is read-only Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 07/62] drm/i915/dp: increase native aux defer retry timeout Luis Henriques
2014-03-05 14:36 ` Luis Henriques [this message]
2014-03-05 14:36 ` [PATCH 3.5 09/62] rtlwifi: rtl8192ce: Fix too long disable of IRQs Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 10/62] rtlwifi: Fix incorrect return from rtl_ps_enable_nic() Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 11/62] rtl8187: fix regression on MIPS without coherent DMA Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 12/62] PCI: Enable INTx if BIOS left them disabled Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 13/62] cifs: ensure that uncached writes handle unmapped areas correctly Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 14/62] ext4: fix online resize with a non-standard blocks per group setting Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 15/62] ext4: don't leave i_crtime.tv_sec uninitialized Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 16/62] ALSA: usb-audio: work around KEF X300A firmware bug Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 17/62] avr32: fix missing module.h causing build failure in mimc200/fram.c Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 18/62] avr32: Makefile: add '-D__linux__' flag for gcc-4.4.7 use Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 19/62] ARM: 7957/1: add DSB after icache flush in __flush_icache_all() Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 20/62] ahci: disable NCQ on Samsung pci-e SSDs on macbooks Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 21/62] USB: serial: option: blacklist interface 4 for Cinterion PHS8 and PXS8 Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 22/62] workqueue: ensure @task is valid across kthread_stop() Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 23/62] cgroup: update cgroup_enable_task_cg_lists() to grab siglock Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 24/62] hwmon: (max1668) Fix writing the minimum temperature Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 25/62] cpufreq: powernow-k8: Initialize per-cpu data-structures properly Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 26/62] ACPI / video: Filter the _BCL table for duplicate brightness values Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 27/62] perf tools: Remove extraneous newline when parsing hardware cache events Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 28/62] perf tools: Fix cache event name generation Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 29/62] net: fix 'ip rule' iif/oif device rename Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 30/62] tg3: Fix deadlock in tg3_change_mtu() Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 31/62] bonding: 802.3ad: make aggregator_identifier bond-private Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 32/62] usbnet: remove generic hard_header_len check Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 33/62] net: sctp: fix sctp_connectx abi for ia32 emulation/compat mode Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 34/62] net: add and use skb_gso_transport_seglen() Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 35/62] net: ip, ipv6: handle gso skbs in forwarding path Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 36/62] net: asix: handle packets crossing URB boundaries Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 37/62] net: asix: add missing flag to struct driver_info Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 38/62] fs/proc/proc_devtree.c: remove empty /proc/device-tree when no openfirmware exists Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 39/62] Input: elantech - improve clickpad detection Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 40/62] KVM: MMU: handle invalid root_hpa at __direct_map Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 41/62] KVM: VMX: fix use after free of vmx->loaded_vmcs Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 42/62] e100: Fix "disabling already-disabled device" warning Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 43/62] dma: ste_dma40: don't dereference free:d descriptor Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 44/62] ASoC: sta32x: Fix array access overflow Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 45/62] ASoC: wm8770: Fix wrong number of enum items Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 46/62] SELinux: bigendian problems with filename trans rules Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 47/62] quota: Fix race between dqput() and dquot_scan_active() Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 48/62] qla2xxx: Fix kernel panic on selective retransmission request Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 49/62] ASoC: wm8958-dsp: Fix firmware block loading Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 50/62] i7core_edac: Fix PCI device reference count Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 51/62] i7300_edac: Fix " Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 52/62] ipc,mqueue: remove limits for the amount of system-wide queues Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 53/62] dm mpath: fix stalls when handling invalid ioctls Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 54/62] ACPI / processor: Rework processor throttling with work_on_cpu() Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 55/62] USB: ftdi_sio: add Cressi Leonardo PID Luis Henriques
2014-03-05 14:37 ` [PATCH 3.5 56/62] usb: ehci: fix deadlock when threadirqs option is used Luis Henriques
2014-03-05 14:37 ` [PATCH 3.5 57/62] ASoC: sta32x: Fix wrong enum for limiter2 release rate Luis Henriques
2014-03-05 14:37 ` [PATCH 3.5 58/62] perf/x86: Fix event scheduling Luis Henriques
2014-03-05 14:37 ` [PATCH 3.5 59/62] perf: Fix hotplug splat Luis Henriques
2014-03-05 14:37 ` [PATCH 3.5 60/62] kvm: x86: fix emulator buffer overflow (CVE-2014-0049) Luis Henriques
2014-03-05 14:37 ` [PATCH 3.5 61/62] powerpc/le: Ensure that the 'stop-self' RTAS token is handled correctly Luis Henriques
2014-03-06 13:14   ` Luís Henriques
2014-03-05 14:37 ` [PATCH 3.5 62/62] powerpc/crashdump : Fix page frame number check in copy_oldmem_page Luis Henriques

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1394030226-26652-9-git-send-email-luis.henriques@canonical.com \
    --to=luis.henriques@canonical.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=jani.nikula@intel.com \
    --cc=kernel-team@lists.ubuntu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®