Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5522491ybi; Tue, 30 Jul 2019 22:41:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqyyTdEN9Wc5XT1kJfmb/3ZjJ/6pJFF5yqZaA+Jjfbxhry1Wyan+SGu6DWLsdfb7cPm9R9Em X-Received: by 2002:a17:902:7791:: with SMTP id o17mr120087650pll.27.1564551681275; Tue, 30 Jul 2019 22:41:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564551681; cv=none; d=google.com; s=arc-20160816; b=ckcw+ZCWZ8BjT2x2I5J3tgIBnEABX6FZYUV6CKIHJ/Cu8al9UNwFy/OOezTwCgwBtE Xdkio00Y7KLD4evelOy3TpcFQ7m53H8KDEkNwlrh9C1fbucz0GY3Uid4cIRveTis53Gx Prjzc2dmo9jWma6Qgwf7tuEnmeWXn5i4vxvPjAQnJVkKO/Ju8ZOyU+Us42UVzJ1zxkhM RFG9AWnN1lK8FUu2kqX+mm7fKZysNNe1flx7jDVBo5HnL66bBDn5o5FMDwKa+TVekEbE euQNFE8c2URZNKySIBrn6/whBQM3JEsGkylC0hrM5gMCp1usNiKmIbXDhKHcltdK5t1e qO6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:message-id:date:subject:cc:from :dkim-signature; bh=w5cOyOxhAUID1tCPC1X8j3Oj8XkaYtpNz6fVEgap7bY=; b=wvJERpW1sNERvkYxyDx6Ug+i78EZ+9ZvWczz6F4vpeAC9RZ9jRp0WkRBO2oyZvjt7M stuS3hS6onOe6K5Amn3y5PKiMze0S6GTcn8E08bpDMA9Rz4ISxGPLWooLNF4Z9vOx/eV tCze+AAYtoiM8fbeqoyGdA8TTm/2FP+XKHycNBT5oeBJOMCHsIkvpy6HCk6KGk+WxYP0 69ecp8rOM5qTPWLoeWLZ9nALqWH7/47FaXdJWax7vVpnGlmJmLYHShovh9Zr0Ce9Ja0V kwxBNMyEs9H4xkhHOjJZZKf7++s0QfgTx745mh/cUFo0I7X4l2hIxDFSqGagmczBJJ9J 2r+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=rnp1qCHc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o9si31900357pfp.158.2019.07.30.22.41.06; Tue, 30 Jul 2019 22:41:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=rnp1qCHc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727535AbfGaCqA (ORCPT + 99 others); Tue, 30 Jul 2019 22:46:00 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:42514 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726908AbfGaCqA (ORCPT ); Tue, 30 Jul 2019 22:46:00 -0400 Received: by mail-pl1-f195.google.com with SMTP id ay6so29800316plb.9 for ; Tue, 30 Jul 2019 19:46:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=w5cOyOxhAUID1tCPC1X8j3Oj8XkaYtpNz6fVEgap7bY=; b=rnp1qCHcYJAwRdiabKV6cNpufFzp/A6Vxrprvi6fx4IJ8mS+WV2U6/yDr6/9+8xoY0 VF5vHB0iDUOSz1JdcfyQVrrrpjJZjDPNUt/gTa59VrBZ+1PzA2n1Ulwyz4vqPPSyJljk i/MNLD59hZ+Tl+aC1fziE60Tdsxe7YvKmO88pQaQAoNIfEgYf5iHGvOBabPbUHhQuCNo ZEkAan+pqyvT5kmtZqR+0Bnx7DMNkzsAIBBRfGmPUUTlsZyeecKeCOT+qpxj6aVXJxGc QReanCXCCqmRJV3MFvkQBMu3pgnqs+aDI0rFoLyCe3OXABJ4+W1/BBgIAI0ko56UEtxM vDWg== 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=w5cOyOxhAUID1tCPC1X8j3Oj8XkaYtpNz6fVEgap7bY=; b=FY31TQ14u0gc4kJwbIj/VuSRo8UzooDK6lA7tHZ56dDoip0K5q5mkBXohW2GH2rKKW vO8AVtNSzy3+5dOpwWru/eLoFNjkS6bzXGA20+HtfWF5AkVQpDAmPRNRa0l/m52It9jS 8o5aJ74IiYNjWnKmsyRAXkSBmHlK+/DoydMMmwmfnCzCT/rfTFWDTg+/JW+nQSGD5SoM GWswxHWSMEjQslw66QueOa8xv1hySychSxN2VAVCGW3YIYBsDCa7j49RUHh6SbrG37rB Isuyuafdi3ztmDtcXYGlzHMiDA3aBfHa3nP5jhJsGzn3Jfu4q2bvMr7GUjrAIbDueA1l b2pg== X-Gm-Message-State: APjAAAUjaDBUgFyqlcgIrx4YTjryxfX4vnAmTpsUryBVDc/cmqhSNPnS UFemyYbGoLnnW4rrFb8x4pVDn3khfpY= X-Received: by 2002:a17:902:106:: with SMTP id 6mr120329921plb.64.1564541159865; Tue, 30 Jul 2019 19:45:59 -0700 (PDT) Received: from hfq-skylake.ipads-lab.se.sjtu.edu.cn ([202.120.40.82]) by smtp.googlemail.com with ESMTPSA id q69sm230530pjb.0.2019.07.30.19.45.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jul 2019 19:45:57 -0700 (PDT) From: Fuqian Huang Cc: Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Fuqian Huang Subject: [PATCH] drm: use trace_printk rather than printk in drm_dbg. Date: Wed, 31 Jul 2019 10:45:33 +0800 Message-Id: <20190731024533.22264-1-huangfq.daxian@gmail.com> X-Mailer: git-send-email 2.11.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c, amdgpu_ih_process calls DRM_DEBUG which calls drm_dbg and finally calls printk. As amdgpu_ih_process is called from an interrupt handler, and interrupt handler should be short as possible. As printk may lead to bogging down the system or can even create a live lock. printk should not be used in IRQ context. Instead, trace_printk is recommended. Link: https://lwn.net/Articles/365835 Signed-off-by: Fuqian Huang --- drivers/gpu/drm/drm_print.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index a17c8a14dba4..90cded140146 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -236,7 +236,7 @@ void drm_dbg(unsigned int category, const char *format, ...) vaf.fmt = format; vaf.va = &args; - printk(KERN_DEBUG "[" DRM_NAME ":%ps] %pV", + trace_printk(KERN_DEBUG "[" DRM_NAME ":%ps] %pV", __builtin_return_address(0), &vaf); va_end(args); -- 2.11.0