From patchwork Thu Aug 20 09:14:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Boichat X-Patchwork-Id: 11725961 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4FB0014F6 for ; Thu, 20 Aug 2020 09:15:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 30BDA2078D for ; Thu, 20 Aug 2020 09:15:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="etECKGb7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726962AbgHTJPG (ORCPT ); Thu, 20 Aug 2020 05:15:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726959AbgHTJOT (ORCPT ); Thu, 20 Aug 2020 05:14:19 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C56AC061757 for ; Thu, 20 Aug 2020 02:14:19 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id s14so759616plp.4 for ; Thu, 20 Aug 2020 02:14:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fteDDvG0lAwDUKEWhtTwY7pAZbLV3gpQe5mpBnV9oBQ=; b=etECKGb7kbalwLBAoTrpPMX3ZW67xpLBEkM9fyGckTzOZQc9DC0gGPbOm/C35mHFUm 0SUiqk7LBNR7opllyTOPxqomZuk4ireVz+J8Ga3shwzH4euw0XT3cv65tWQwR+27OhjE LtA3zSxIdezdqeHB0ICydm6cDZ3QF3utr7BKE= 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:mime-version :content-transfer-encoding; bh=fteDDvG0lAwDUKEWhtTwY7pAZbLV3gpQe5mpBnV9oBQ=; b=qjgaRB2j4q3UkTUfN49y69lkuk11Idsf8fRX7QuT7cYD1682dGdNJlaKr1r72F69Ob otgOhg5YBXSgEzBwn7OOMOmnjt9U2Xw/a+49qGErhi5Kz4YmLzJuqvZuHPqOdQ6aiKmZ yqEkmU46spvcYZ9WkxsnC20OI7xHw9S+/LD/Ai0Wn8lmlc8o6dZPZhtcKkJKRChr5Mv0 577JApJCF/4nAKHXBrfec1tr4K8QqIGR3Pltvahf1gFB+dKvpMiMzOPdEfTf3gGOrD47 k7oQAvY/aDs1IVHN4yfn61yJvG99XxfztK8ZgotM33/iprIdqFdXy1UrU2CVfrHXZ09L mqtA== X-Gm-Message-State: AOAM530lneZbZHdLxguhT+nKsAzk108ZBksnSNf7VdBfqZR+KRar0mEP LbC0Y0Xt2eoy1+HY7JMKLIoouA== X-Google-Smtp-Source: ABdhPJwipjFEnEYG5Qh0oqH5IY0sSRTeSp67cThk/5qNE520m8larxCy1jbleF0kZrX6bBQPlpO9VQ== X-Received: by 2002:a17:90a:7488:: with SMTP id p8mr1884427pjk.158.1597914858908; Thu, 20 Aug 2020 02:14:18 -0700 (PDT) Received: from drinkcat2.tpe.corp.google.com ([2401:fa00:1:b:7220:84ff:fe09:41dc]) by smtp.gmail.com with ESMTPSA id o15sm1954448pfu.167.2020.08.20.02.14.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Aug 2020 02:14:17 -0700 (PDT) From: Nicolas Boichat To: Mauro Carvalho Chehab , Steven Rostedt , Greg Kroah-Hartman Cc: Nicolas Boichat , Andy Gross , Bjorn Andersson , Todor Tomov , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v4 1/3, RESEND] media: camss: vfe: Use trace_printk for debugging only Date: Thu, 20 Aug 2020 17:14:10 +0800 Message-Id: <20200820170951.v4.1.Ia54fe801f246a0b0aee36fb1f3bfb0922a8842b0@changeid> X-Mailer: git-send-email 2.28.0.220.ged08abb693-goog MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org trace_printk should not be used in production code. Since tracing interrupts is presumably latency sensitive, pr_dbg is not appropriate, so guard the call with a preprocessor symbol that can be defined for debugging purpose. Signed-off-by: Nicolas Boichat --- (resending this patch as part of the whole series, since we need a new patch 3/3 now). drivers/media/platform/qcom/camss/camss-vfe-4-1.c | 2 ++ drivers/media/platform/qcom/camss/camss-vfe-4-7.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/media/platform/qcom/camss/camss-vfe-4-1.c b/drivers/media/platform/qcom/camss/camss-vfe-4-1.c index 174a36be6f5d866..0c57171fae4f9e9 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe-4-1.c +++ b/drivers/media/platform/qcom/camss/camss-vfe-4-1.c @@ -936,8 +936,10 @@ static irqreturn_t vfe_isr(int irq, void *dev) vfe->ops->isr_read(vfe, &value0, &value1); +#ifdef CAMSS_VFE_TRACE_IRQ trace_printk("VFE: status0 = 0x%08x, status1 = 0x%08x\n", value0, value1); +#endif if (value0 & VFE_0_IRQ_STATUS_0_RESET_ACK) vfe->isr_ops.reset_ack(vfe); diff --git a/drivers/media/platform/qcom/camss/camss-vfe-4-7.c b/drivers/media/platform/qcom/camss/camss-vfe-4-7.c index 0dca8bf9281e774..307675925e5c779 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe-4-7.c +++ b/drivers/media/platform/qcom/camss/camss-vfe-4-7.c @@ -1058,8 +1058,10 @@ static irqreturn_t vfe_isr(int irq, void *dev) vfe->ops->isr_read(vfe, &value0, &value1); +#ifdef CAMSS_VFE_TRACE_IRQ trace_printk("VFE: status0 = 0x%08x, status1 = 0x%08x\n", value0, value1); +#endif if (value0 & VFE_0_IRQ_STATUS_0_RESET_ACK) vfe->isr_ops.reset_ack(vfe); From patchwork Thu Aug 20 09:14:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Boichat X-Patchwork-Id: 11725967 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5766F16B1 for ; Thu, 20 Aug 2020 09:15:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3F6AE21744 for ; Thu, 20 Aug 2020 09:15:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="f53NuOrs" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726701AbgHTJPt (ORCPT ); Thu, 20 Aug 2020 05:15:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727006AbgHTJOo (ORCPT ); Thu, 20 Aug 2020 05:14:44 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70292C061344 for ; Thu, 20 Aug 2020 02:14:27 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id k18so718897pfp.7 for ; Thu, 20 Aug 2020 02:14:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iKNU74NJdZK5cyzQFbM7uQHSgaBwB5CboR+e0oglByo=; b=f53NuOrsS3mDzLLgHf/lVcMv2rI0XJgW2xMiLctDDBFzrksxOqhcTxm1XIVQnBQkE5 +kMAMDdXzLKtSit04ro2JszrQPyd+kMW6DQyX3Fqi5F4PZDe779pikdz44FcUDrjmvQc jjFTXmzw429GB5mNaBH2Jij5WbpAtdFvjw+D8= 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:mime-version:content-transfer-encoding; bh=iKNU74NJdZK5cyzQFbM7uQHSgaBwB5CboR+e0oglByo=; b=UY4sCROrEld11hixta50n1mxxJ1EwY8kgdtMdBL6GYeno1bEkbxIr4uVHiDHGSsmbF JhqfZyk74+qtqUVuYuzPBDIHWDo2mhO+iHU0PE/XBTJZF4eqRsWs8HjyUzzeyPbEovE9 c3B8+++yw0pteUpqnTPWYWW/xfxEJg7UUEpuOrCBjXVLdv7ZvPbQUDr8wMTUPWxjd6Zu AeJkOYvi8KTtEvNhBB64nbbp0fUYq2nMCxQqVXVXii59xpZbwRkdQF4oAjSegJuOpke3 6F2wnpYQgFqIQxxAOgNbVhr68fhA140vB5onpZBM2Bsbz4XBpPOrgnzGhVEEWQmy2E07 TeOQ== X-Gm-Message-State: AOAM532asb6mkcq0jwOw6mPaWnMnRlGsXQb0AneSMxuAomUvtUf6GYYV 3UEKTgfnktLz+ycD2/NgLS0yuQ== X-Google-Smtp-Source: ABdhPJxP50eTeBITIcRQC6yWdtCxNMHAvn0Wises0b5yFF9JV14XlN/Ry4qvDKlv1dBi9YhOxSAgjA== X-Received: by 2002:a62:7bcf:: with SMTP id w198mr1569326pfc.90.1597914866996; Thu, 20 Aug 2020 02:14:26 -0700 (PDT) Received: from drinkcat2.tpe.corp.google.com ([2401:fa00:1:b:7220:84ff:fe09:41dc]) by smtp.gmail.com with ESMTPSA id o15sm1954448pfu.167.2020.08.20.02.14.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Aug 2020 02:14:26 -0700 (PDT) From: Nicolas Boichat To: Mauro Carvalho Chehab , Steven Rostedt , Greg Kroah-Hartman Cc: Nicolas Boichat , Andy Shevchenko , Sakari Ailus , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v4 3/3] media: atomisp: Only use trace_printk if allowed Date: Thu, 20 Aug 2020 17:14:12 +0800 Message-Id: <20200820170951.v4.3.I066d89f39023956c47fb0a42edf196b3950ffbf7@changeid> X-Mailer: git-send-email 2.28.0.220.ged08abb693-goog In-Reply-To: <20200820170951.v4.1.Ia54fe801f246a0b0aee36fb1f3bfb0922a8842b0@changeid> References: <20200820170951.v4.1.Ia54fe801f246a0b0aee36fb1f3bfb0922a8842b0@changeid> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org We added a config option CONFIG_TRACING_ALLOW_PRINTK to make sure that no extra trace_printk gets added to the kernel, let's use that in this driver to guard the trace_printk call. Signed-off-by: Nicolas Boichat --- Technically, we could only initialize the trace_printk buffers when the print env is switched, to avoid the build error and unconditional boot-time warning, but I assume this printing framework will eventually get removed when the driver moves out of staging? drivers/staging/media/atomisp/pci/atomisp_compat_css20.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c index 1b2b2c68025b4cc..020519dca1324ab 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c +++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c @@ -165,11 +165,13 @@ static int atomisp_css2_dbg_print(const char *fmt, va_list args) return 0; } +#ifdef CONFIG_TRACING_ALLOW_PRINTK static int atomisp_css2_dbg_ftrace_print(const char *fmt, va_list args) { ftrace_vprintk(fmt, args); return 0; } +#endif static int atomisp_css2_err_print(const char *fmt, va_list args) { @@ -865,9 +867,11 @@ static inline int __set_css_print_env(struct atomisp_device *isp, int opt) if (opt == 0) isp->css_env.isp_css_env.print_env.debug_print = NULL; +#ifdef CONFIG_TRACING_ALLOW_PRINTK else if (opt == 1) isp->css_env.isp_css_env.print_env.debug_print = atomisp_css2_dbg_ftrace_print; +#endif else if (opt == 2) isp->css_env.isp_css_env.print_env.debug_print = atomisp_css2_dbg_print;