From patchwork Sat Sep 23 19:04:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 9967603 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 89687604D3 for ; Sat, 23 Sep 2017 19:09:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9344E29461 for ; Sat, 23 Sep 2017 19:09:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 87B8429489; Sat, 23 Sep 2017 19:09:33 +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=-4.2 required=2.0 tests=BAYES_00, 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 4A4D429461 for ; Sat, 23 Sep 2017 19:09:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5604A6E0DF; Sat, 23 Sep 2017 19:09:24 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 313 seconds by postgrey-1.35 at gabe; Sat, 23 Sep 2017 19:09:23 UTC Received: from atrey.karlin.mff.cuni.cz (atrey.karlin.mff.cuni.cz [195.113.26.193]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6AA8B6E0DF; Sat, 23 Sep 2017 19:09:23 +0000 (UTC) Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 4CC2E81871; Sat, 23 Sep 2017 21:04:07 +0200 (CEST) Date: Sat, 23 Sep 2017 21:04:06 +0200 From: Pavel Machek To: bskeggs@redhat.com, airlied@linux.ie, colin.king@canonical.com, martin.peres@free.fr, dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c: broken emergency poweroff handling Message-ID: <20170923190406.GA21587@amd> MIME-Version: 1.0 User-Agent: Mutt/1.5.23 (2014-03-12) 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Hi! Not only it is unneccessarily complex, it is also broken; GFP_ATOMIC allocation can fail.. and then you fail to shut down the machine. Someone please fix this. Thanks, Pavel --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c @@ -120,6 +120,11 @@ nvkm_therm_sensor_event(struct nvkm_therm *therm, enum nvkm_therm_thrs thrs, struct work_struct *work; work = kmalloc(sizeof(*work), GFP_ATOMIC); + /* FIXME: + 1) this is total overkill, orderly_poweroff() already + uses schedule_work internally + 2) it would be good to at least printk what is going on + */ if (work) { INIT_WORK(work, nv_poweroff_work); schedule_work(work);