From patchwork Sun Feb 5 07:54:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Zhong X-Patchwork-Id: 9555995 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2A3C9604DA for ; Sun, 5 Feb 2017 07:58:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1ACFC23E64 for ; Sun, 5 Feb 2017 07:58:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0FA3E26CFF; Sun, 5 Feb 2017 07:58:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.4 required=2.0 tests=BAYES_00, RCVD_IN_SORBS_SPAM autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A518123E64 for ; Sun, 5 Feb 2017 07:58:00 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1caHhv-0005X5-OH; Sun, 05 Feb 2017 07:57:59 +0000 Received: from mail-pg0-f68.google.com ([74.125.83.68]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1caHgp-0003uq-3z; Sun, 05 Feb 2017 07:56:53 +0000 Received: by mail-pg0-f68.google.com with SMTP id 204so6098643pge.2; Sat, 04 Feb 2017 23:56:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GyArI2w9m6XX74x8lcqg2GgWcbAQ3govlcbvDVbGvFI=; b=k52LTRguXIJ76rbYA7X12CrGVmBOuP6QxXNSwAF9Xb8OxxWlIRcNP2F/LA07OdyL+l KwtV3jEaKnnt0qQmOIuUbKBBTIcoXVsCn+tZ0P5tNyl9oncUTvaVy6OI4n06YBlMrzZA Cob0fivi39RSjJhzvIu+ZuWziSwtNjuh6CkDan8KXJK+i+1SHoYxvSsAyCcXLahjXTQ1 6N6T4tlTu/oDjrKLHGXXzn6/aZ2f7BNTr7qRR7NpdZ0MX2h+k5dusWzMwfuwSE44GU5F +TyPp7X3Hx3GLhLFWV+nKcDyLYju1ik2ehtUlSyPaShtBsRzhFJuK45JOYFckaJgw+Hb r1dw== X-Gm-Message-State: AIkVDXKxg19C9hOQ0Pg1aZmQK04Avyi25iPk6IZP4H4+3bmRKo6s++sSM9khRsiSZqCzLA== X-Received: by 10.84.196.36 with SMTP id k33mr8724007pld.125.1486281390648; Sat, 04 Feb 2017 23:56:30 -0800 (PST) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id o18sm80321582pgn.36.2017.02.04.23.56.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 04 Feb 2017 23:56:30 -0800 (PST) From: Chris Zhong To: dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org Subject: [PATCH v17 4/7] drm/rockchip: cdn-dp: do not use drm_helper_hpd_irq_event Date: Sun, 5 Feb 2017 15:54:59 +0800 Message-Id: <1486281302-28200-5-git-send-email-zyw@rock-chips.com> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1486281302-28200-1-git-send-email-zyw@rock-chips.com> References: <1486281302-28200-1-git-send-email-zyw@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170204_235651_443131_AAA96C76 X-CRM114-Status: UNSURE ( 9.83 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Stuebner , David Airlie , linux-kernel@vger.kernel.org, zyw@rock-chips.com, seanpaul@chromium.org, groeck@chromium.org, linux-arm-kernel@lists.infradead.org, mark.yao@rock-chips.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The cdn_dp_pd_event_work is using drm_helper_hpd_irq_event to update the connector status, this function is used to update all connectors of drm_device. Therefore, the detect of other connector will be call, when cdn_dp_pd_event_work is triggered, every time. It is not necessary, and it may cause system crash. replace drm_helper_hpd_irq_event with drm_kms_helper_hotplug_event, only update cdn-dp status. Signed-off-by: Chris Zhong Tested-by: Guenter Roeck Reviewed-by: Guenter Roeck --- Changes in v17: None drivers/gpu/drm/rockchip/cdn-dp-core.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c index a70eedc..62e02a4 100644 --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c @@ -935,6 +935,9 @@ static void cdn_dp_pd_event_work(struct work_struct *work) { struct cdn_dp_device *dp = container_of(work, struct cdn_dp_device, event_work); + struct drm_connector *connector = &dp->connector; + enum drm_connector_status old_status; + int ret; u8 sink_count; @@ -997,7 +1000,11 @@ static void cdn_dp_pd_event_work(struct work_struct *work) out: mutex_unlock(&dp->lock); - drm_helper_hpd_irq_event(dp->drm_dev); + + old_status = connector->status; + connector->status = connector->funcs->detect(connector, false); + if (old_status != connector->status) + drm_kms_helper_hotplug_event(dp->drm_dev); } static int cdn_dp_pd_event(struct notifier_block *nb,