mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: alexander.levin@verizon.com
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Cc: Shashank Sharma <shashank.sharma@intel.com>,
	Ville Syrjala <ville.syrjala@linux.intel.com>,
	Imre Deak <imre.deak@intel.com>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Jani Nikula <jani.nikula@intel.com>,
	alexander.levin@verizon.com
Subject: [PATCH AUTOSEL for 4.14 02/60] drm: Add retries for lspcon mode detection
Date: Wed, 13 Dec 2017 01:55:10 +0000	[thread overview]
Message-ID: <20171213015455.6455-2-alexander.levin@verizon.com> (raw)
In-Reply-To: <20171213015455.6455-1-alexander.levin@verizon.com>

From: Shashank Sharma <shashank.sharma@intel.com>

[ Upstream commit f687e25a7a245952349f1f9f9cc238ac5a3be258 ]

>From the CI builds, its been observed that during a driver
reload/insert, dp dual mode read function sometimes fails to
read from LSPCON device over i2c-over-aux channel.

This patch:
- adds some delay and few retries, allowing a scope for these
  devices to settle down and respond.
- changes one error log's level from ERROR->DEBUG as we want
  to call it an error only after all the retries are exhausted.

V2: Addressed review comments from Jani (for loop for retry)
V3: Addressed review comments from Imre (break on partial read too)
V3: Addressed review comments from Ville/Imre (Add the retries
    exclusively for LSPCON, not for all dp_dual_mode devices)
V4: Added r-b from Imre, sending it to dri-devel (Jani)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102294
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102295
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102359
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103186
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: Imre Deak <imre.deak@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Acked-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1507826408-19322-1-git-send-email-shashank.sharma@intel.com
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/gpu/drm/drm_dp_dual_mode_helper.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_dp_dual_mode_helper.c b/drivers/gpu/drm/drm_dp_dual_mode_helper.c
index 0ef9011a1856..02a50929af67 100644
--- a/drivers/gpu/drm/drm_dp_dual_mode_helper.c
+++ b/drivers/gpu/drm/drm_dp_dual_mode_helper.c
@@ -410,6 +410,7 @@ int drm_lspcon_get_mode(struct i2c_adapter *adapter,
 {
 	u8 data;
 	int ret = 0;
+	int retry;
 
 	if (!mode) {
 		DRM_ERROR("NULL input\n");
@@ -417,10 +418,19 @@ int drm_lspcon_get_mode(struct i2c_adapter *adapter,
 	}
 
 	/* Read Status: i2c over aux */
-	ret = drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_LSPCON_CURRENT_MODE,
-				    &data, sizeof(data));
+	for (retry = 0; retry < 6; retry++) {
+		if (retry)
+			usleep_range(500, 1000);
+
+		ret = drm_dp_dual_mode_read(adapter,
+					    DP_DUAL_MODE_LSPCON_CURRENT_MODE,
+					    &data, sizeof(data));
+		if (!ret)
+			break;
+	}
+
 	if (ret < 0) {
-		DRM_ERROR("LSPCON read(0x80, 0x41) failed\n");
+		DRM_DEBUG_KMS("LSPCON read(0x80, 0x41) failed\n");
 		return -EFAULT;
 	}
 
-- 
2.11.0

  parent reply	other threads:[~2017-12-13  1:56 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-13  1:55 [PATCH AUTOSEL for 4.14 01/60] backlight: pwm_bl: Fix overflow condition alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 03/60] clk: sunxi-ng: nm: Check if requested rate is supported by fractional clock alexander.levin
2017-12-13  1:55 ` alexander.levin [this message]
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 07/60] crypto: talitos - fix memory corruption on SEC2 alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 04/60] clk: sunxi-ng: sun5i: Fix bit offset of audio PLL post-divider alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 05/60] crypto: talitos - fix ctr-aes-talitos alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 06/60] crypto: talitos - fix AEAD test failures alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 08/60] crypto: crypto4xx - increase context and scatter ring buffer elements alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 09/60] crypto: lrw - Fix an error handling path in 'create()' alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 10/60] rtc: pl031: make interrupt optional alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 11/60] kvm, mm: account kvm related kmem slabs to kmemcg alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 13/60] PCI: Avoid bus reset if bridge itself is broken alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 14/60] scsi: cxgb4i: fix Tx skb leak alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 12/60] net: phy: at803x: Change error to EINVAL for invalid MAC alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 15/60] scsi: mpt3sas: Fix IO error occurs on pulling out a drive from RAID1 volume created on two SATA drive alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 16/60] PCI: Create SR-IOV virtfn/physfn links before attaching driver alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 19/60] Bluetooth: avoid silent hci_bcm ACPI PM regression alexander.levin
2017-12-13  8:14   ` Johan Hovold
2017-12-13 13:37     ` alexander.levin
2017-12-13 14:05       ` Johan Hovold
2017-12-13 14:18         ` alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 18/60] igb: check memory allocation failure alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 17/60] PM / OPP: Move error message to debug level alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 21/60] i40e: use the safe hash table iterator when deleting mac filters alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 20/60] kbuild: re-order the code to not parse unnecessary variables alexander.levin
2017-12-20 17:13   ` Greg KH
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 22/60] iio: st_sensors: add register mask for status register alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 25/60] block,bfq: Disable writeback throttling alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 26/60] md: always set THREAD_WAKEUP and wake up wqueue if thread existed alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 24/60] IB/rxe: check for allocation failure on elem alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 23/60] ixgbe: fix use of uninitialized padding alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 27/60] ip_gre: check packet length and mtu correctly in erspan tx alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 28/60] ipv6: grab rt->rt6i_ref before allocating pcpu rt alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 29/60] leds: pca955x: Don't invert requested value in pca955x_gpio_set_value() alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 30/60] Bluetooth: hci_uart_set_flow_control: Fix NULL deref when using serdev alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 33/60] PCI/AER: Report non-fatal errors only to the affected endpoint alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 34/60] tracing: Exclude 'generic fields' from histograms alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 32/60] i40e/i40evf: spread CPU affinity hints across online CPUs only alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 31/60] Bluetooth: hci_bcm: Fix setting of irq trigger type alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 36/60] ASoC: codecs: msm8916-wcd-analog: fix micbias level alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 38/60] powerpc/xmon: Avoid tripping SMP hardlockup watchdog alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 35/60] percpu: don't forget to free the temporary struct pcpu_alloc_info alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 37/60] ASoC: img-parallel-out: Add pm_runtime_get/put to set_fmt callback alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 42/60] fm10k: fix mis-ordered parameters in declaration for .ndo_set_vf_bw alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 40/60] sctp: silence warns on sctp_stream_init allocations alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 39/60] powerpc/watchdog: Do not trigger SMP crash from touch_nmi_watchdog alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 41/60] ASoC: codecs: msm8916-wcd-analog: fix module autoload alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 43/60] scsi: lpfc: Fix secure firmware updates alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 44/60] scsi: lpfc: PLOGI failures during NPIV testing alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 45/60] scsi: lpfc: Fix warning messages when NVME_TARGET_FC not defined alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 46/60] i40e: fix client notify of VF reset alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 50/60] ibmvnic: Set state UP alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 48/60] ARM: exynos_defconfig: Enable UAS support for Odroid HC1 board alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 47/60] vfio/pci: Virtualize Maximum Payload Size alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 49/60] fm10k: ensure we process SM mbx when processing VF mbx alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 52/60] RDMA/hns: Avoid NULL pointer exception alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 54/60] clk: sunxi-ng: sun6i: Rename HDMI DDC clock to avoid name collision alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 53/60] staging: greybus: light: Release memory obtained by kasprintf alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 51/60] net: ipv6: send NS for DAD when link operationally up alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 57/60] cpuidle: fix broadcast control when broadcast can not be entered alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 55/60] tcp: fix under-evaluated ssthresh in TCP Vegas alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 58/60] drm/vc4: Avoid using vrefresh==0 mode in DSI htotal math alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 56/60] rtc: set the alarm to the next expiring timer alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 59/60] IB/opa_vnic: Properly clear Mac Table Digest alexander.levin
2017-12-13  1:55 ` [PATCH AUTOSEL for 4.14 60/60] IB/opa_vnic: Properly return the total MACs in UC MAC list alexander.levin

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=20171213015455.6455-2-alexander.levin@verizon.com \
    --to=alexander.levin@verizon.com \
    --cc=imre.deak@intel.com \
    --cc=jani.nikula@intel.com \
    --cc=jani.nikula@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shashank.sharma@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=ville.syrjala@linux.intel.com \
    /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®