From patchwork Sat Mar 9 04:33:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kangjie Lu X-Patchwork-Id: 10845891 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C90AC1390 for ; Sat, 9 Mar 2019 09:39:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B75C52BA06 for ; Sat, 9 Mar 2019 09:39:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A73F52EDCF; Sat, 9 Mar 2019 09:39:08 +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,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 A947E2BA06 for ; Sat, 9 Mar 2019 09:39:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DCC6F6E44B; Sat, 9 Mar 2019 09:38:53 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mta-p8.oit.umn.edu (mta-p8.oit.umn.edu [134.84.196.208]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4E6D26E34B for ; Sat, 9 Mar 2019 04:33:39 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-p8.oit.umn.edu (Postfix) with ESMTP id D69AFC49 for ; Sat, 9 Mar 2019 04:33:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at umn.edu Received: from mta-p8.oit.umn.edu ([127.0.0.1]) by localhost (mta-p8.oit.umn.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wE7K76IR0AIl for ; Fri, 8 Mar 2019 22:33:38 -0600 (CST) Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mta-p8.oit.umn.edu (Postfix) with ESMTPS id B1BA4C21 for ; Fri, 8 Mar 2019 22:33:37 -0600 (CST) Received: by mail-io1-f71.google.com with SMTP id e9so17129519iob.4 for ; Fri, 08 Mar 2019 20:33:37 -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; bh=wluJat1PksApvfWP7fcLVGHB4CEce/r4mb44xD+uFwA=; b=YUKQoRycLn4lgTvdmC1sV77qDFM4fuNOzbEiX5xHMOnMU11U5MiAC4T4NW6svz0I5l PmOGZzox6JTUmlBnVFWzdWeKUm0fl/NzvkDEdMQXwba+GhOufLwv4ztLz6VGpDCvHdhr CXTl1yUvmx0V3BuHI253TCnyndfBYdGGxHiIwrD4iyUhtqvCK9LvFkYMk183P/yQtsZC HVgpoFEtCOZ96Sb6BV///WzpiJzuobOlEe8qNuLkL3bmmFgI01I3Fr93XHCH2BhAC2rJ hDA4nFrm3T2GYIDx7Y3kLM/zPIj66IxquUWsPsPeEi80EffiwG0KEkfBWlasVkrJ+Y8F v+jQ== X-Gm-Message-State: APjAAAVn5yaA7Ziz3hjXN5eBCzS8fSelIqyEW8z+GlqZzpk7Z4xMdgYu Y3Pn6qvSX2mI6nmhLEkilmofYWdPVmY1aDngV+CeXeqjEY6Z14Y5FFzBg+UENNTM2pD0i/K4oBV ScikpUnx5aayhG17+kK5YRWfPjefgUlWp X-Received: by 2002:a05:660c:6c3:: with SMTP id z3mr10333103itk.83.1552106017327; Fri, 08 Mar 2019 20:33:37 -0800 (PST) X-Google-Smtp-Source: APXvYqyEtZ0DXnOD4/CgXAKq8XZ9u/p3Tb9wm96LQw5r9KK9ItjnQCjbDdWDXobWF9oqqOFjWIIZWA== X-Received: by 2002:a05:660c:6c3:: with SMTP id z3mr10333093itk.83.1552106017082; Fri, 08 Mar 2019 20:33:37 -0800 (PST) Received: from bee.dtc.umn.edu (cs-bee-u.cs.umn.edu. [128.101.106.63]) by smtp.gmail.com with ESMTPSA id e5sm5088529ite.33.2019.03.08.20.33.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 20:33:36 -0800 (PST) From: Kangjie Lu To: kjlu@umn.edu Subject: [PATCH] drm: check if alloc_workqueue fails Date: Fri, 8 Mar 2019 22:33:31 -0600 Message-Id: <20190309043331.5210-1-kjlu@umn.edu> X-Mailer: git-send-email 2.17.1 X-Mailman-Approved-At: Sat, 09 Mar 2019 09:38:30 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umn.edu; s=google; h=from:to:cc:subject:date:message-id; bh=wluJat1PksApvfWP7fcLVGHB4CEce/r4mb44xD+uFwA=; b=NtlSNdWGNpa1fk01M//0Z728WBas1o9a9pTaYGcjKjtts1eLz5G7g9UFQlu62OQgc0 w5lItOENRnyTWkbheFY/m9EuSi3KHZrGDDeehiSaV/CoS1HkdvbuT7wNQvaBgviB1tIi IGLTzmvWuteLavy3czdWIvAItnTZdmbj7hV4syXTSyHZanzUQwKfeMhuqQQptwnmBLHi jxhUeWseanLolVuF7glLWckrb7+B3CdiE9tHt0VL/KqLWkQ0Uel/IyO3HP6o67tiuEAX Y3jdsY4N9UXm8n9HYJsqCMRsewpATXgshb+RpNigiM4ZyICAWiVztkFTDQcZr3edzNCf Drww== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, pakki001@umn.edu, Alex Deucher , =?utf-8?q?Chris?= =?utf-8?q?tian_K=C3=B6nig?= MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP alloc_workqueue may fail. The fix checks its status. We probably need to add a return value for radeon_crtc_init, so that we can pass an error code upstream. Signed-off-by: Kangjie Lu --- drivers/gpu/drm/radeon/radeon_display.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index aa898c699101..16f95bde8c2e 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c @@ -678,6 +678,8 @@ static void radeon_crtc_init(struct drm_device *dev, int index) drm_mode_crtc_set_gamma_size(&radeon_crtc->base, 256); radeon_crtc->crtc_id = index; radeon_crtc->flip_queue = alloc_workqueue("radeon-crtc", WQ_HIGHPRI, 0); + if (!radeon_crtc->flip_queue) + DRM_ERROR("failed to allocate the flip queue\n"); rdev->mode_info.crtcs[index] = radeon_crtc; if (rdev->family >= CHIP_BONAIRE) {