Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1821442imm; Mon, 3 Sep 2018 10:18:01 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb1qlChdsWsFVpV/vy6jz8Xb3lSkWu02S55chsAMHR7L4NrqyI7Kz8E9o58prFqYjE0NFF7 X-Received: by 2002:a65:6243:: with SMTP id q3-v6mr26984563pgv.273.1535995081311; Mon, 03 Sep 2018 10:18:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535995081; cv=none; d=google.com; s=arc-20160816; b=c5PRwzx2YQov+QSLTXn7Emf+xCQXYinFJeCVH4CMAJLCaIiBgb9qKf1cjorMD8DnVX KNX6X1o04/cTAzq9gPbUew0GUSMocIVZunbTjwfLhStUZwzAQUsgNB4UThanuLpPI99W XdASnuWl+yP+L4JG+//M8+7cL3iJMD4t8NxYB9JatstXPkOyguIFC6/zvqtf7Q2q701M m0BSwHfjB71SDuRaL9FoHPbPOfOqeKkLhP/Vh5P3iXTvhTOMGojPpgI8UOhHkOEvgsg5 5KZaenJWW/5JuT2kwEGFiZngJY8WxfGYD1fV3xc9x42ryN9OfGcDxHlTUrGWT9NexUlU s0gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=ZSp3UzOdJAyJY4cZVxM/t5i4kca6dCE+S9UFBIYuj34=; b=Gbsj8Wv4KnTu4+rrDNFrGDJwK/zwmh7g77XoOph2fblvQrqndDl0X4cqqY/SnswzB8 upBlS5lqNpa7RX23WT5uxmznNuuZfvREKLP2CCCXkHF4QCY8RlMj///8H6irCyRRKqqo PZS1d4qhNSbkT/TWjQ+6rcJUjyzpIoMjy7vteue6WmWHZMRw+wrj/FZXQP67/IR9gyF3 YR0DwUE9cwyz027bPN4xUVBchaNjtNSGmSlHNI9D7YM07J9rbo/ZmeVyoAFejVyZ1sMy Me4bqPwPUGO7q2NmgBenB0aH9B88lZUxgqqyX17Dgu8JCoOqzIPH9M7kl25xWkf5ifwL Halg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e9-v6si18675731pls.132.2018.09.03.10.17.46; Mon, 03 Sep 2018 10:18:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729871AbeICVhX (ORCPT + 99 others); Mon, 3 Sep 2018 17:37:23 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42538 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727942AbeICVhW (ORCPT ); Mon, 3 Sep 2018 17:37:22 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 249DED06; Mon, 3 Sep 2018 17:16:17 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rob Clark , Archit Taneja , Sean Paul , Sasha Levin Subject: [PATCH 4.14 009/165] drm/bridge: adv7511: Reset registers on hotplug Date: Mon, 3 Sep 2018 18:54:55 +0200 Message-Id: <20180903165655.483772992@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903165655.003605184@linuxfoundation.org> References: <20180903165655.003605184@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sean Paul [ Upstream commit 5f3417569165a8ee57654217f73e0160312f409c ] The bridge loses its hw state when the cable is unplugged. If we detect this case in the hpd handler, reset its state. Reported-by: Rob Clark Tested-by: Rob Clark Reviewed-by: Archit Taneja Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20180703165648.120401-1-seanpaul@chromium.org Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c @@ -424,6 +424,18 @@ static void adv7511_hpd_work(struct work else status = connector_status_disconnected; + /* + * The bridge resets its registers on unplug. So when we get a plug + * event and we're already supposed to be powered, cycle the bridge to + * restore its state. + */ + if (status == connector_status_connected && + adv7511->connector.status == connector_status_disconnected && + adv7511->powered) { + regcache_mark_dirty(adv7511->regmap); + adv7511_power_on(adv7511); + } + if (adv7511->connector.status != status) { adv7511->connector.status = status; drm_kms_helper_hotplug_event(adv7511->connector.dev);