From patchwork Mon Aug 9 10:20:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 10475425 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 F03AD60230 for ; Tue, 19 Jun 2018 20:27:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DFC1828BE7 for ; Tue, 19 Jun 2018 20:27:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D499028BF0; Tue, 19 Jun 2018 20:27:11 +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=-5.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 73D6128BE7 for ; Tue, 19 Jun 2018 20:27:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5974A6E5DD; Tue, 19 Jun 2018 20:27:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by gabe.freedesktop.org (Postfix) with ESMTPS id DB2746E5DD for ; Tue, 19 Jun 2018 20:27:08 +0000 (UTC) Received: from mchehab by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fVNDT-00062W-MD; Tue, 19 Jun 2018 20:27:03 +0000 Received: from vger.kernel.org ([209.132.180.67]) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1OiPTr-0003hO-D4; Mon, 09 Aug 2010 10:21:19 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756095Ab0HIKVM (ORCPT + 8 others); Mon, 9 Aug 2010 06:21:12 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:55178 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755835Ab0HIKVK (ORCPT ); Mon, 9 Aug 2010 06:21:10 -0400 Received: by bwz3 with SMTP id 3so1057555bwz.19 for ; Mon, 09 Aug 2010 03:21:09 -0700 (PDT) Received: by 10.204.79.221 with SMTP id q29mr10699495bkk.49.1281349269555; Mon, 09 Aug 2010 03:21:09 -0700 (PDT) Received: from htj.dyndns.org ([130.75.117.88]) by mx.google.com with ESMTPS id v9sm3149065bkb.14.2010.08.09.03.21.08 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 09 Aug 2010 03:21:08 -0700 (PDT) Received: from [127.0.0.2] (htj.dyndns.org [127.0.0.2]) by htj.dyndns.org (Postfix) with ESMTPSA id 94B241CC05F8; Mon, 9 Aug 2010 12:20:11 +0200 (CEST) Message-ID: <4C5FD65B.8080800@gmail.com> Date: Mon, 09 Aug 2010 12:20:11 +0200 From: Tejun Heo User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2 MIME-Version: 1.0 To: Markus Trippelsdorf Subject: [PATCH] drm: fix fallouts from slow-work -> wq conversion References: <20100809063742.GA1632@arch.tripp.de> <20100809083053.GB2169@osiris.boeblingen.de.ibm.com> <20100809083451.GC2169@osiris.boeblingen.de.ibm.com> <4C5FC49B.9040208@kernel.org> <4C5FCC14.6030901@gmail.com> <20100809094630.GA1603@arch.tripp.de> <4C5FCF0C.2000100@gmail.com> <4C5FD1D1.9060302@gmail.com> <20100809101406.GA1633@arch.tripp.de> In-Reply-To: <20100809101406.GA1633@arch.tripp.de> X-Enigmail-Version: 1.1.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org Status: O X-Keywords: X-UID: 247 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Suresh Siddha , David Airlie , Heiko Carstens , linux-kernel@vger.kernel.org, DRI , walt Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP >From 9a919c46dfa48a9c1f465174609b90253eb8ffc1 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Mon, 9 Aug 2010 12:01:27 +0200 Commit 991ea75c (drm: use workqueue instead of slow-work), which made drm to use wq instead of slow-work, didn't account for the return value difference between delayed_slow_work_enqueue() and queue_delayed_work(). The former returns 0 on success and -errno on failures while the latter never fails and only uses the return value to indicate whether the work was already pending or not. This misconversion triggered spurious error messages. Remove the now unnecessary return value check and error message. Markus: caught another incorrect conversion in drm_kms_helper_poll_enable() Signed-off-by: Tejun Heo Reported-by: Markus Trippelsdorf Tested-by: Markus Trippelsdorf Cc: David Airlie Cc: dri-devel@lists.freedesktop.org Acked-by: David Airlie --- Oops, you're right. So, this should do it. Thank you. drivers/gpu/drm/drm_crtc_helper.c | 16 ++++------------ 1 files changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 4598130..b9e4dbf 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -839,7 +839,6 @@ static void output_poll_execute(struct work_struct *work) struct drm_connector *connector; enum drm_connector_status old_status, status; bool repoll = false, changed = false; - int ret; mutex_lock(&dev->mode_config.mutex); list_for_each_entry(connector, &dev->mode_config.connector_list, head) { @@ -874,11 +873,8 @@ static void output_poll_execute(struct work_struct *work) dev->mode_config.funcs->output_poll_changed(dev); } - if (repoll) { - ret = queue_delayed_work(system_nrt_wq, delayed_work, DRM_OUTPUT_POLL_PERIOD); - if (ret) - DRM_ERROR("delayed enqueue failed %d\n", ret); - } + if (repoll) + queue_delayed_work(system_nrt_wq, delayed_work, DRM_OUTPUT_POLL_PERIOD); } void drm_kms_helper_poll_disable(struct drm_device *dev) @@ -893,18 +889,14 @@ void drm_kms_helper_poll_enable(struct drm_device *dev) { bool poll = false; struct drm_connector *connector; - int ret; list_for_each_entry(connector, &dev->mode_config.connector_list, head) { if (connector->polled) poll = true; } - if (poll) { - ret = queue_delayed_work(system_nrt_wq, &dev->mode_config.output_poll_work, DRM_OUTPUT_POLL_PERIOD); - if (ret) - DRM_ERROR("delayed enqueue failed %d\n", ret); - } + if (poll) + queue_delayed_work(system_nrt_wq, &dev->mode_config.output_poll_work, DRM_OUTPUT_POLL_PERIOD); } EXPORT_SYMBOL(drm_kms_helper_poll_enable);