From patchwork Sun Feb 5 07:54:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Zhong X-Patchwork-Id: 9555973 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 7D416604DA for ; Sun, 5 Feb 2017 07:56:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DF0C23E64 for ; Sun, 5 Feb 2017 07:56:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 627FF26D08; Sun, 5 Feb 2017 07:56:56 +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 D4A6026B41 for ; Sun, 5 Feb 2017 07:56:52 +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 1caHgq-000488-Ci; Sun, 05 Feb 2017 07:56:52 +0000 Received: from mail-pg0-f67.google.com ([74.125.83.67]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1caHgi-0003uR-RC; Sun, 05 Feb 2017 07:56:46 +0000 Received: by mail-pg0-f67.google.com with SMTP id v184so6095755pgv.1; Sat, 04 Feb 2017 23:56:25 -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=9uEpmocUKPcmmn0yqRJnOs+oUppalpY1uyoR247ydk0=; b=ACigQzyQ6dD9aYTfF54Q+vv68I2NwPTCFOKPf5xEV/7VgJS8ShDe3+zTI7qwOGwbOA UL99YGR6aSF8dqq3HBPjomiVMrsOyctWntB9d2Cx//HBMlyroB0Q1gzZOO5g5N/qNbMP ARDNtKCsWGwsavDl5Xn+C36VsGYAxbLDgwrie1yxG2AZktTYiopEfXMrT2WsKRdKmmoQ vkB01tHJcbXx0brAYD5AVtijoCtDR+dKvxV2i11hlxhu2xrfzkD4oNEiVN1cV9z27n18 gQhsUgk3/AE003l//uQ5VoiHXgy8RiA8tdcGRkos4/1iUtljnHgH9i1VETEgqffC4LYj RwOg== X-Gm-Message-State: AIkVDXLN69lCtBw/wIW14S275Q57eXS3/IlZcWlunRAviAR29fCU8SwasNcnDkyEVr3ktQ== X-Received: by 10.84.216.89 with SMTP id f25mr8646981plj.6.1486281385206; Sat, 04 Feb 2017 23:56:25 -0800 (PST) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id o18sm80321582pgn.36.2017.02.04.23.56.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 04 Feb 2017 23:56:24 -0800 (PST) From: Chris Zhong To: dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org Subject: [PATCH v17 2/7] drm/rockchip: cdn-dp: Load firmware if no monitor connected Date: Sun, 5 Feb 2017 15:54:57 +0800 Message-Id: <1486281302-28200-3-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_235644_995818_C13BFCA5 X-CRM114-Status: UNSURE ( 9.75 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms 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-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Guenter Roeck If no monitor is connected, suspend/resume cycles result in firmware load errors because the driver attempts to load the firmware while the system is in suspend state. This results in a kernel warning and traceback. Loading the firmware during boot fixes the problem. Note that we can not just call schedule_work conditionally in cdn_dp_pd_event() if the insertion status changed. The problem would still be seen if a monitor is connected for the first time during suspend. Signed-off-by: Guenter Roeck Signed-off-by: Sean Paul Signed-off-by: Chris Zhong --- Changes in v17: None drivers/gpu/drm/rockchip/cdn-dp-core.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c index 7db2508..b8d0dd7 100644 --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c @@ -1021,7 +1021,6 @@ static int cdn_dp_bind(struct device *dev, struct device *master, void *data) struct cdn_dp_port *port; struct drm_device *drm_dev = data; int ret, i; - bool schedule_event = false; ret = cdn_dp_parse_dt(dp); if (ret < 0) @@ -1083,15 +1082,11 @@ static int cdn_dp_bind(struct device *dev, struct device *master, void *data) "register EXTCON_DISP_DP notifier err\n"); goto err_free_connector; } - - if (extcon_get_state(port->extcon, EXTCON_DISP_DP)) - schedule_event = true; } pm_runtime_enable(dev); - if (schedule_event) - schedule_work(&dp->event_work); + schedule_work(&dp->event_work); return 0;