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: 9555949 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 CC12F604DA for ; Sun, 5 Feb 2017 07:56:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD27926B41 for ; Sun, 5 Feb 2017 07:56:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B240F26E96; Sun, 5 Feb 2017 07:56:32 +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=-3.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0EDBD26B41 for ; Sun, 5 Feb 2017 07:56:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 173686E1FC; Sun, 5 Feb 2017 07:56:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg0-f68.google.com (mail-pg0-f68.google.com [74.125.83.68]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8BBFA6E1FA for ; Sun, 5 Feb 2017 07:56:25 +0000 (UTC) Received: by mail-pg0-f68.google.com with SMTP id 194so6107309pgd.0 for ; 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=PQJiR4C6TneOyAwClpJIKyv0KVuEJDHugxgpHfky0pnmcD1epOpi75tN8zndedXqdV L7UPr3E6u0JRrF0qVzcoLoEuYmX3SkpGVMbLZZ1qvG37SmBR+7KgfIaFFXOjvzz4Shqa WXkvQjtyNf0agdhgV/g8qQDIaDKZ4nZ5nwzt0Uoo1sAhvIIPvjHwPECXbRY6+FDkeDi4 muJRUaFpuZymkDdE4pI9FaqlSuYrQyzrQmScKIDSWXXEhhTlW2r0IBC92xloUGX5kedx 4rXYC0uxRq7expsaod7GnE9YtNXhzX73urZZNgBCkJXo0p1MhTkG+OEiBZZJAur/olih PIaQ== X-Gm-Message-State: AIkVDXJA0KdnjKLHM87r38OVp3J8cjqOkAWrQoGcwZ8x6KdD9dIH3ZES9S4u3WTGea+kDw== 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> Cc: linux-kernel@vger.kernel.org, zyw@rock-chips.com, groeck@chromium.org, linux-arm-kernel@lists.infradead.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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;