From patchwork Thu Jul 30 09:53:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 247272 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2252856ilg; Thu, 30 Jul 2020 02:54:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGl9S5mdSWzXhe1g0OHsc/JNrHQFRppTPhTKBcAgje9cAGDUUW7UqOhsivhjIZFdmRxncC X-Received: by 2002:a50:af45:: with SMTP id g63mr1939860edd.52.1596102875222; Thu, 30 Jul 2020 02:54:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596102875; cv=none; d=google.com; s=arc-20160816; b=ECDCir7+562MfpffZYte4jAn/kBR1TdtjAUXoFLpSOFNEZ2gX4PS3ZF887ygIlbT5s ktLnl8k6+l4EVtYZ6w9gwcj9D/SedfpXukUlNWCvSCgE9eUHZ4WEFzg4NOKtL/xtKqNv dBUFf/IL+2b+G4eamu1POS6arY15Je6p26ix2uckTwz3MLfX6Ea9NA4OhZIIxwtlc+x+ vlE5kLOlQ/zxRdFazX3CU7TlPXYZsxv/1x8DDbiU0rZk0VnbKyljkKG0sRjH81KQBUrB uq/unJyVaVd09SqC1C8SbCnRCOzOhD8fVyPe3eQBEL/+dfxqa2hmN6mdd4vclfWSrAhT fGmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=yCtoTmQBVaA8gm6t22/gL7cKLjCk2p79iKqAR6+EKu4=; b=D4bTMPtcVsUxRmI+Gg9F3+6G7bgbqR5mjXjJ1sujqHmkVw+qMlvaLbq6xKlpkm4zD0 ySusNFEWp4Kan9RHjIRc/TRiZe+i6WG/y/KZlFvhRxSwGcgIi5RDmiMTt8Va5uuSczzM nQ5/20X02K8zKAsEdrN+/w1uJCDaozCmSR2JbFke606BIzAbF9ngYquYTRwbMXDSQcn+ kIoHyfe+0IBEhtNFWpVYiXL53cufA7Cr2uzVEA5kEKccisClIwwf5sEoIDKn/8yigKNc yJo71vMWuVvqdNgMzaO17gC0c9+cmSM+i+rwaY0MHxqdsoIAh0RcUC+fRAhDAnADGoED 57iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a6IA+Hkt; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r18si323007edo.272.2020.07.30.02.54.35; Thu, 30 Jul 2020 02:54:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a6IA+Hkt; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729200AbgG3Jyc (ORCPT + 4 others); Thu, 30 Jul 2020 05:54:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729137AbgG3Jyb (ORCPT ); Thu, 30 Jul 2020 05:54:31 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0EB4C0619D2 for ; Thu, 30 Jul 2020 02:54:30 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id q76so4407554wme.4 for ; Thu, 30 Jul 2020 02:54:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=yCtoTmQBVaA8gm6t22/gL7cKLjCk2p79iKqAR6+EKu4=; b=a6IA+HktRFMnS647jLsgICsCzXuX5wzRyWIUj+jWA9npia1VbLV/V41MGtbXsfLfdt SjIz2R1GBGuPBojbfEQ2u0ZtmNBxo4Lm8YVU5/4JewLngMqfHQojf/65WZriYt93qQkC Mf9Q3OZS0H2N1lat19Rhno6hQQTxs5RBYAGxXbRezj4phfD/f4C8OmPyzei/kJEd/qcI CfMNAkeSuyjnBRL5TxpVq7A1g/2T1E2ap2w5RCCB1Tvp0Xg9aGhvI+cgkVsKfFgekka1 1gG6SnVMsI1XChee4WJ6smY8aQr13H78sxSiELGnKo+4RGG+qt6OO40878oGeI+EFElE gc7Q== 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; bh=yCtoTmQBVaA8gm6t22/gL7cKLjCk2p79iKqAR6+EKu4=; b=fwP/BgJITPChIsCfCNWuqlkoHjcBYyv4fodjxc6J2DtbthbVCQFNjNYWJ2Pzt/WiK9 uH4DtWQn7+4gcPeGAb+tVIoffvyiDz5N4GHsU1hHDVsuRrCmH+y9zmHpU5CxKX2PAcqp Fp0e3Ih524v2NNlhprGG5d5J7xypdBbkBHv44LTOgb0m+ZFJs/7O21x/xJx+d8bf6QNT dI60pM1f3nrOQv+DJXQ+fVkdpSf5NH5RjBPQYov6rFRHs2QkbNgSHE0Zoxiy9c9wFsPA yWYHYGgO9t/O4xilaBSX2xn1tDuLabIFaH9IE0HP3GokqUxorcxp5qLwUJV7jLDoQM0R Mc0A== X-Gm-Message-State: AOAM5322aiDnbUxgEF80cC2Npc6nyvEP7oBvxwe5s2gX/lNvokeAT3kz 5+erJp03OnCTKI3mjvZjxTiUUg== X-Received: by 2002:a1c:28c4:: with SMTP id o187mr12029262wmo.62.1596102869374; Thu, 30 Jul 2020 02:54:29 -0700 (PDT) Received: from localhost.localdomain ([195.24.90.54]) by smtp.gmail.com with ESMTPSA id u1sm10623139wrb.78.2020.07.30.02.54.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2020 02:54:28 -0700 (PDT) From: Stanimir Varbanov To: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: jim.cromie@gmail.com, Joe Perches , Jason Baron , Greg Kroah-Hartman , Stanimir Varbanov Subject: [PATCH v5 1/3] venus: Add debugfs interface to set firmware log level Date: Thu, 30 Jul 2020 12:53:48 +0300 Message-Id: <20200730095350.13925-2-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200730095350.13925-1-stanimir.varbanov@linaro.org> References: <20200730095350.13925-1-stanimir.varbanov@linaro.org> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This will be useful when debugging specific issues related to firmware HFI interface. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/Makefile | 2 +- drivers/media/platform/qcom/venus/core.c | 3 +++ drivers/media/platform/qcom/venus/core.h | 3 +++ drivers/media/platform/qcom/venus/dbgfs.c | 21 +++++++++++++++++++ drivers/media/platform/qcom/venus/dbgfs.h | 12 +++++++++++ drivers/media/platform/qcom/venus/hfi_venus.c | 6 +++++- 6 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 drivers/media/platform/qcom/venus/dbgfs.c create mode 100644 drivers/media/platform/qcom/venus/dbgfs.h -- 2.17.1 diff --git a/drivers/media/platform/qcom/venus/Makefile b/drivers/media/platform/qcom/venus/Makefile index 64af0bc1edae..dfc636865709 100644 --- a/drivers/media/platform/qcom/venus/Makefile +++ b/drivers/media/platform/qcom/venus/Makefile @@ -3,7 +3,7 @@ venus-core-objs += core.o helpers.o firmware.o \ hfi_venus.o hfi_msgs.o hfi_cmds.o hfi.o \ - hfi_parser.o pm_helpers.o + hfi_parser.o pm_helpers.o dbgfs.o venus-dec-objs += vdec.o vdec_ctrls.o venus-enc-objs += venc.o venc_ctrls.o diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 203c6538044f..249141e27fea 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -290,6 +290,8 @@ static int venus_probe(struct platform_device *pdev) if (ret) goto err_dev_unregister; + venus_dbgfs_init(core); + return 0; err_dev_unregister: @@ -337,6 +339,7 @@ static int venus_remove(struct platform_device *pdev) v4l2_device_unregister(&core->v4l2_dev); mutex_destroy(&core->pm_lock); mutex_destroy(&core->lock); + venus_dbgfs_deinit(core); return ret; } diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index 7118612673c9..b48782f9aa95 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -12,6 +12,7 @@ #include #include +#include "dbgfs.h" #include "hfi.h" #define VIDC_CLKS_NUM_MAX 4 @@ -136,6 +137,7 @@ struct venus_caps { * @priv: a private filed for HFI operations * @ops: the core HFI operations * @work: a delayed work for handling system fatal error + * @root: debugfs root directory */ struct venus_core { void __iomem *base; @@ -185,6 +187,7 @@ struct venus_core { unsigned int codecs_count; unsigned int core0_usage_count; unsigned int core1_usage_count; + struct dentry *root; }; struct vdec_controls { diff --git a/drivers/media/platform/qcom/venus/dbgfs.c b/drivers/media/platform/qcom/venus/dbgfs.c new file mode 100644 index 000000000000..782d54ac1b8f --- /dev/null +++ b/drivers/media/platform/qcom/venus/dbgfs.c @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (C) 2020 Linaro Ltd. + */ + +#include + +#include "core.h" + +extern int venus_fw_debug; + +void venus_dbgfs_init(struct venus_core *core) +{ + core->root = debugfs_create_dir("venus", NULL); + debugfs_create_x32("fw_level", 0644, core->root, &venus_fw_debug); +} + +void venus_dbgfs_deinit(struct venus_core *core) +{ + debugfs_remove_recursive(core->root); +} diff --git a/drivers/media/platform/qcom/venus/dbgfs.h b/drivers/media/platform/qcom/venus/dbgfs.h new file mode 100644 index 000000000000..b7b621a8472f --- /dev/null +++ b/drivers/media/platform/qcom/venus/dbgfs.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* Copyright (C) 2020 Linaro Ltd. */ + +#ifndef __VENUS_DBGFS_H__ +#define __VENUS_DBGFS_H__ + +struct venus_core; + +void venus_dbgfs_init(struct venus_core *core); +void venus_dbgfs_deinit(struct venus_core *core); + +#endif diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 0d8855014ab3..450c4800c12e 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -130,7 +130,7 @@ struct venus_hfi_device { }; static bool venus_pkt_debug; -static int venus_fw_debug = HFI_DEBUG_MSG_ERROR | HFI_DEBUG_MSG_FATAL; +int venus_fw_debug = HFI_DEBUG_MSG_ERROR | HFI_DEBUG_MSG_FATAL; static bool venus_sys_idle_indicator; static bool venus_fw_low_power_mode = true; static int venus_hw_rsp_timeout = 1000; @@ -1133,6 +1133,10 @@ static int venus_session_init(struct venus_inst *inst, u32 session_type, struct hfi_session_init_pkt pkt; int ret; + ret = venus_sys_set_debug(hdev, venus_fw_debug); + if (ret) + goto err; + ret = pkt_session_init(&pkt, inst, session_type, codec); if (ret) goto err; From patchwork Thu Jul 30 09:53:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 247273 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2252866ilg; Thu, 30 Jul 2020 02:54:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGYKZ9j+C8LyU3/kgai2pt0ysbi9xHfYgncDPiGYlbWKEzOWCt5D4U9GWOtInodzbogwWq X-Received: by 2002:a17:906:1e43:: with SMTP id i3mr1736775ejj.92.1596102875897; Thu, 30 Jul 2020 02:54:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596102875; cv=none; d=google.com; s=arc-20160816; b=xmRtAw5r2Eaj9jcSLwRWnirCT/5mgWf7ZBXng5U6ARu9trKJN1l0Zij0c4t0/oPlZx Opkhgh6POe+9IjrsC+W+j4l6GYmzV8Yy82vS/VFk2nmKW42t2GrRU6vmxCoSF1HlBp67 xSAlmSo9WWoaKhTyAOOATQAaWZoP3oVP/c7Bb6ypzNTC5twvXFQVdeqGi2JVS9bqCzXb cEXwEm5h+qD7y4LdzQJFlqeW7KO01zzae/iA9Q3NJOnBG7IMtUdsEE4c3djJ+T9kV1kx xvHkV0T1/h63fT0hXcwDOfDYW72LhaPdAFse3pFgGwwXNGqe0YpaIGGRH8eECT2Df88M akRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=AUdOHKBSFKpTj40WJgkPwcDzGagUihc/mu7zxNsYZ+k=; b=HqTmu5puyRgwpLu4J3qZMkNKQPig4L/7LLCOP+4GLV8T8orVdpjDa2K4/6GUVahQvV TUWW1L8fB8ocLzK/jBzQ7YrT+3FRTfRR79MM7/SxlBuFn54gefq3NlAPGHZmY2iT9tJO F6W1VNLiIvRwCptRZLIqpQMTTpF1vOwxk9f5jIvkRaooq45cgPGDEmfLvo4fqAgXo082 csL8nbTHvdrRatbEAA2cnpvBhaOJJg6aV40HxUfb8nrM6WIcPLHDF2Oy67NiAqfpbOY3 PzmsKaVpxR/KdvHhnVwjkWjGgGqWx3+flXstzer/m67ozEYyRykMK6Y708Q0Qa1rqASh hFAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LfvJup6o; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r18si323007edo.272.2020.07.30.02.54.35; Thu, 30 Jul 2020 02:54:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LfvJup6o; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729392AbgG3Jyf (ORCPT + 4 others); Thu, 30 Jul 2020 05:54:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729137AbgG3Jye (ORCPT ); Thu, 30 Jul 2020 05:54:34 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2947C0619D2 for ; Thu, 30 Jul 2020 02:54:33 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id 3so5626432wmi.1 for ; Thu, 30 Jul 2020 02:54:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AUdOHKBSFKpTj40WJgkPwcDzGagUihc/mu7zxNsYZ+k=; b=LfvJup6ovWiwAucvKZVQFk1CwI7buQN2T1r+dQ6oB6Y9OXRHdh2ia0LkWSZQm/HJGy 28edLScXxl/nFAygtX+andMgAEDNdZzl294AwcOdk34IoozNgT+1XTlfbcQHE0bTO1g5 6cmQV+vZo2eVuUx7lvUZ4zb9qHJvS/iMBf0ymbLFujgr46o9drobClO/VtKP6dnUFQ4w NnFIiKiXFJos9qfmi3OBbIROMi63tzS99nhh8SbMx7+I0J14pFLognQoy/3wpSlVjvAF mxHn5t0oEEAd9LDh6237j12wSQeZ0yvmlaJZ31q8hftrRcvypvmNNDv+Tq/SlsG0YXG2 L2EQ== 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; bh=AUdOHKBSFKpTj40WJgkPwcDzGagUihc/mu7zxNsYZ+k=; b=L6IkR5E43DCnityHJ1cJ5V8jsJ97mPkLwiU2mAedprf9VV1cRkQh4QDul+YwhtBiy9 THG3uksqw+AFLLtkND/AMZ8Ky7iSMjXTAlai0OqKkg+vSXVuZbfUlorsyeXelhDCDywz YV2yCXxbXg55kksdm6IcFOXck0FdyXUxal4bvLOS79tBiI6IW4BJvcjSm/0y8jexMwL3 ArTbki05uM2CP3w5Q9zstQzNxY6QN7ynZJ6wESu7Mszyov2cekU35jXkK6vZvwl6qG9x Hw9LtGtxgRr9B6h8M1uU8yAm2ADIXdjHr5LQUjDmCPZcayuAkcW0GTWhrUlcBodfVeCv HDvQ== X-Gm-Message-State: AOAM531MPxYswB24KyGknf/pnPleUt5SvYLeyoPCE8falOhxXCPPodfh DhyTWBj48cBIJ1bWVSSyaIKzaA== X-Received: by 2002:a1c:5451:: with SMTP id p17mr13612609wmi.180.1596102872621; Thu, 30 Jul 2020 02:54:32 -0700 (PDT) Received: from localhost.localdomain ([195.24.90.54]) by smtp.gmail.com with ESMTPSA id u1sm10623139wrb.78.2020.07.30.02.54.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2020 02:54:32 -0700 (PDT) From: Stanimir Varbanov To: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: jim.cromie@gmail.com, Joe Perches , Jason Baron , Greg Kroah-Hartman , Stanimir Varbanov Subject: [PATCH v5 2/3] venus: Add a debugfs file for SSR trigger Date: Thu, 30 Jul 2020 12:53:49 +0300 Message-Id: <20200730095350.13925-3-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200730095350.13925-1-stanimir.varbanov@linaro.org> References: <20200730095350.13925-1-stanimir.varbanov@linaro.org> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The SSR (SubSystem Restart) is used to simulate an error on FW side of Venus. We support following type of triggers - fatal error, div by zero and watchdog IRQ. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/dbgfs.c | 30 +++++++++++++++++++++++ 1 file changed, 30 insertions(+) -- 2.17.1 diff --git a/drivers/media/platform/qcom/venus/dbgfs.c b/drivers/media/platform/qcom/venus/dbgfs.c index 782d54ac1b8f..f95b7b1febe5 100644 --- a/drivers/media/platform/qcom/venus/dbgfs.c +++ b/drivers/media/platform/qcom/venus/dbgfs.c @@ -9,10 +9,40 @@ extern int venus_fw_debug; +static int trigger_ssr_open(struct inode *inode, struct file *file) +{ + file->private_data = inode->i_private; + return 0; +} + +static ssize_t trigger_ssr_write(struct file *filp, const char __user *buf, + size_t count, loff_t *ppos) +{ + struct venus_core *core = filp->private_data; + u32 ssr_type; + int ret; + + ret = kstrtou32_from_user(buf, count, 4, &ssr_type); + if (ret) + return ret; + + ret = hfi_core_trigger_ssr(core, ssr_type); + if (ret < 0) + return ret; + + return count; +} + +static const struct file_operations ssr_fops = { + .open = trigger_ssr_open, + .write = trigger_ssr_write, +}; + void venus_dbgfs_init(struct venus_core *core) { core->root = debugfs_create_dir("venus", NULL); debugfs_create_x32("fw_level", 0644, core->root, &venus_fw_debug); + debugfs_create_file("trigger_ssr", 0200, core->root, core, &ssr_fops); } void venus_dbgfs_deinit(struct venus_core *core) From patchwork Thu Jul 30 09:53:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 247274 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2252956ilg; Thu, 30 Jul 2020 02:54:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrfgSQPIe2V0qKaIWAhls9KrQNTNkas0DbUBbKHIDJc053bXbDDeT0X7zUw+UD4/LuYO+z X-Received: by 2002:a17:906:d102:: with SMTP id b2mr1679335ejz.465.1596102882796; Thu, 30 Jul 2020 02:54:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596102882; cv=none; d=google.com; s=arc-20160816; b=BUqtBP5bzKtI+RaADJ3xM42QFcQW02QtGJmFHdOWlfjKaciz+gsiaZLKlc0eeuvdwW duGNV4WYIjFvPrIqc/Ly7HNuIOS4epjBi0yDXky1x+nWmPzHVcEZsiPvHb4Sl4zc3RSd RawHsQ8hwV6wTpEomIN63yblo8nYpds9bf0G2suFCre4yN4sFqo41Slplh/CnU/ieCcW EnEAJ3qhsTC3erCB/dqorNqbPjVkYrEYmjyWzhWMhFJfzHo6hyi8NRUcTJbOhcV8+NIV Z21NX4YpGnKUHpQv6aoL2QWrzSeXVMY71S4C81m0nVck1heDWGeFvP/0M05PAc5GTwUS +0TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=CDZdaQ0UzaVPAl4BrEXf3VptjqZf7e9m4ADVCxDxrwM=; b=SRSdOOMn6TOP4I7AcokxqcIvtKsqG630y44bGAx+a5Sf+qZXUL1d+LjWXs0E7Vn3RL nw2YXLtvmedctUn2K6PL6R9EQLjX7RHS4uLqZnuAP5oi8vh4OkCxk9UjtMVPFULZLSh0 /N6P76zbhvUfMcK1PlnQdb2XGiQ9tfYHZO7wDQ7G+Y7gAUmrz8gzw9eN7JnFVg0qiAev yMMiHeWcovEethF1FYDtnmeui4eXy2PdkByyK2Hkg9cLmTJqlIfD++B50m/aXNR+QcUh JES1/vFvdmNBRBiJUw5jU+NJ2g0r1YJ+BFXWfRMDZO16Y8K9SaU7nxFax68vF4Ttp6ne Of2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aBctt9hN; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z15si2861222ejr.250.2020.07.30.02.54.42; Thu, 30 Jul 2020 02:54:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aBctt9hN; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729507AbgG3Jyl (ORCPT + 4 others); Thu, 30 Jul 2020 05:54:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729478AbgG3Jyi (ORCPT ); Thu, 30 Jul 2020 05:54:38 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E9BEC0619D2 for ; Thu, 30 Jul 2020 02:54:38 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id r4so21316579wrx.9 for ; Thu, 30 Jul 2020 02:54:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CDZdaQ0UzaVPAl4BrEXf3VptjqZf7e9m4ADVCxDxrwM=; b=aBctt9hN1SEHEjvnjyq5z/vDwrSXncytca2M31s3l66fzbVxOfEZ6K2WrM0pxShQAG /bDxhTI1jfWBaQdqV1DHm6tZA2Pq2AVmnh0CkhKMV+6JiqmRsNa4XUVqnc+xBLcmoyZ7 zkWKBfaORiXExgzZErl7Lrq39Mv5kygheDtUP6dlWdR7w4go9C6b6iaqowpp8IYjHKQz 4np2mGlKZfZltwY62qgby9+r6jIjuV4X1sJUmsssNu+Ty4nJov6ozXIwf56J7yzckley dDcDKNe/p9KHT2VVlRJNipdtwGtZTM/XxH7Ws+iYgbOhSLvQp/orR2PEjhz5ksYkCvkQ T3Zg== 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; bh=CDZdaQ0UzaVPAl4BrEXf3VptjqZf7e9m4ADVCxDxrwM=; b=FJjR77tSIlyjmTQTSwtZi82926Bxyy9Fhb43uvZSKMp4bx95hX+ntmKv3BSi8h4sCP uL3EB40XbU/r7TSt67R8RTtrVbnLFHfU7nFyL5+qHbz/aoKCCUEj84XoowyPNfrFsgOp lU3z674RfRXWL0qvx3nTdfCFE9rY58klGWiSQL8cMOySA3CTWk4owleEGbkshmVv86I0 rhEIbdAXK3iKe0fpqCJVXj/0FAM1F8YwyDbDari6YyrfKNmQ2AYyUioo1X+McgQEqvBL 7vGUbMtFgZ5yCrNa8O42X1NCO952ljDPBTVIglk2AWcfp2g34g1neBbHlb6zLxIBtBcn R7/A== X-Gm-Message-State: AOAM531U6qbPFuQYfG3zChM1ymwSzMh5MadizaND6tJ0cOODu8lZq2Ki xRE9Rj8XE/ZSfAnNblozavs25A== X-Received: by 2002:a05:6000:124c:: with SMTP id j12mr2097457wrx.83.1596102876865; Thu, 30 Jul 2020 02:54:36 -0700 (PDT) Received: from localhost.localdomain ([195.24.90.54]) by smtp.gmail.com with ESMTPSA id u1sm10623139wrb.78.2020.07.30.02.54.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2020 02:54:36 -0700 (PDT) From: Stanimir Varbanov To: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: jim.cromie@gmail.com, Joe Perches , Jason Baron , Greg Kroah-Hartman , Stanimir Varbanov Subject: [PATCH v5 3/3] venus: Make debug infrastructure more flexible Date: Thu, 30 Jul 2020 12:53:50 +0300 Message-Id: <20200730095350.13925-4-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200730095350.13925-1-stanimir.varbanov@linaro.org> References: <20200730095350.13925-1-stanimir.varbanov@linaro.org> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Here we introduce debug prefixes for dev_dbg groups by level of importance - Venus{Low,Med,High,FW} Enabling the particular level will be done by dynamic debug. For example to enable debug messages with low level: echo 'format "VenusLow" +p' > debugfs/dynamic_debug/control If you want to enable all levels: echo 'format "Venus" +p' > debugfs/dynamic_debug/control All the features which dynamic debugging provide are preserved. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/core.h | 5 +++++ drivers/media/platform/qcom/venus/helpers.c | 2 +- drivers/media/platform/qcom/venus/hfi_msgs.c | 18 +++++++++--------- drivers/media/platform/qcom/venus/hfi_venus.c | 4 ++-- drivers/media/platform/qcom/venus/pm_helpers.c | 2 +- drivers/media/platform/qcom/venus/vdec.c | 6 +++--- 6 files changed, 21 insertions(+), 16 deletions(-) -- 2.17.1 diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index b48782f9aa95..b1c94316a553 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -15,6 +15,11 @@ #include "dbgfs.h" #include "hfi.h" +#define VDBGL "VenusLow : " +#define VDBGM "VenusMed : " +#define VDBGH "VenusHigh: " +#define VDBGFW "VenusFW : " + #define VIDC_CLKS_NUM_MAX 4 #define VIDC_VCODEC_CLKS_NUM_MAX 2 #define VIDC_PMDOMAINS_NUM_MAX 3 diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 0143af7822b2..7147871d9dc1 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -396,7 +396,7 @@ put_ts_metadata(struct venus_inst *inst, struct vb2_v4l2_buffer *vbuf) } if (slot == -1) { - dev_dbg(inst->core->dev, "%s: no free slot\n", __func__); + dev_dbg(inst->core->dev, VDBGL "no free slot\n"); return; } diff --git a/drivers/media/platform/qcom/venus/hfi_msgs.c b/drivers/media/platform/qcom/venus/hfi_msgs.c index 279a9d6fe737..06a1908ca225 100644 --- a/drivers/media/platform/qcom/venus/hfi_msgs.c +++ b/drivers/media/platform/qcom/venus/hfi_msgs.c @@ -138,7 +138,7 @@ static void event_sys_error(struct venus_core *core, u32 event, struct hfi_msg_event_notify_pkt *pkt) { if (pkt) - dev_dbg(core->dev, + dev_dbg(core->dev, VDBGH "sys error (session id:%x, data1:%x, data2:%x)\n", pkt->shdr.session_id, pkt->event_data1, pkt->event_data2); @@ -152,7 +152,7 @@ event_session_error(struct venus_core *core, struct venus_inst *inst, { struct device *dev = core->dev; - dev_dbg(dev, "session error: event id:%x, session id:%x\n", + dev_dbg(dev, VDBGH "session error: event id:%x, session id:%x\n", pkt->event_data1, pkt->shdr.session_id); if (!inst) @@ -247,7 +247,7 @@ sys_get_prop_image_version(struct device *dev, /* bad packet */ return; - dev_dbg(dev, "F/W version: %s\n", (u8 *)&pkt->data[1]); + dev_dbg(dev, VDBGL "F/W version: %s\n", (u8 *)&pkt->data[1]); } static void hfi_sys_property_info(struct venus_core *core, @@ -257,7 +257,7 @@ static void hfi_sys_property_info(struct venus_core *core, struct device *dev = core->dev; if (!pkt->num_properties) { - dev_dbg(dev, "%s: no properties\n", __func__); + dev_dbg(dev, VDBGL "no properties\n"); return; } @@ -266,7 +266,7 @@ static void hfi_sys_property_info(struct venus_core *core, sys_get_prop_image_version(dev, pkt); break; default: - dev_dbg(dev, "%s: unknown property data\n", __func__); + dev_dbg(dev, VDBGL "unknown property data\n"); break; } } @@ -297,7 +297,7 @@ static void hfi_sys_ping_done(struct venus_core *core, struct venus_inst *inst, static void hfi_sys_idle_done(struct venus_core *core, struct venus_inst *inst, void *packet) { - dev_dbg(core->dev, "sys idle\n"); + dev_dbg(core->dev, VDBGL "sys idle\n"); } static void hfi_sys_pc_prepare_done(struct venus_core *core, @@ -305,7 +305,8 @@ static void hfi_sys_pc_prepare_done(struct venus_core *core, { struct hfi_msg_sys_pc_prep_done_pkt *pkt = packet; - dev_dbg(core->dev, "pc prepare done (error %x)\n", pkt->error_type); + dev_dbg(core->dev, VDBGL "pc prepare done (error %x)\n", + pkt->error_type); } static unsigned int @@ -387,8 +388,7 @@ static void hfi_session_prop_info(struct venus_core *core, case HFI_PROPERTY_CONFIG_VDEC_ENTROPY: break; default: - dev_dbg(dev, "%s: unknown property id:%x\n", __func__, - pkt->data[0]); + dev_dbg(dev, VDBGM "unknown property id:%x\n", pkt->data[0]); return; } diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 450c4800c12e..cb9367254c4e 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -477,7 +477,7 @@ static u32 venus_hwversion(struct venus_hfi_device *hdev) minor = minor >> WRAPPER_HW_VERSION_MINOR_VERSION_SHIFT; step = ver & WRAPPER_HW_VERSION_STEP_VERSION_MASK; - dev_dbg(dev, "venus hw version %x.%x.%x\n", major, minor, step); + dev_dbg(dev, VDBGL "venus hw version %x.%x.%x\n", major, minor, step); return major; } @@ -906,7 +906,7 @@ static void venus_flush_debug_queue(struct venus_hfi_device *hdev) if (pkt->hdr.pkt_type != HFI_MSG_SYS_COV) { struct hfi_msg_sys_debug_pkt *pkt = packet; - dev_dbg(dev, "%s", pkt->msg_data); + dev_dbg(dev, VDBGFW "%s", pkt->msg_data); } } } diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index 531e7a41658f..cecf079cf0b8 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -212,7 +212,7 @@ static int load_scale_bw(struct venus_core *core) } mutex_unlock(&core->lock); - dev_dbg(core->dev, "total: avg_bw: %u, peak_bw: %u\n", + dev_dbg(core->dev, VDBGL "total: avg_bw: %u, peak_bw: %u\n", total_avg, total_peak); return icc_set_bw(core->video_path, total_avg, total_peak); diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 7c4c483d5438..6a71fc47273e 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -225,7 +225,7 @@ static int vdec_check_src_change(struct venus_inst *inst) if (!(inst->codec_state == VENUS_DEC_STATE_CAPTURE_SETUP) || !inst->reconfig) - dev_dbg(inst->core->dev, "%s: wrong state\n", __func__); + dev_dbg(inst->core->dev, VDBGH "wrong state\n"); done: return 0; @@ -1310,7 +1310,7 @@ static void vdec_event_change(struct venus_inst *inst, if (inst->bit_depth != ev_data->bit_depth) inst->bit_depth = ev_data->bit_depth; - dev_dbg(dev, "event %s sufficient resources (%ux%u)\n", + dev_dbg(dev, VDBGM "event %s sufficient resources (%ux%u)\n", sufficient ? "" : "not", ev_data->width, ev_data->height); if (sufficient) { @@ -1344,7 +1344,7 @@ static void vdec_event_change(struct venus_inst *inst, ret = hfi_session_flush(inst, HFI_FLUSH_OUTPUT, false); if (ret) - dev_dbg(dev, "flush output error %d\n", ret); + dev_dbg(dev, VDBGH "flush output error %d\n", ret); } inst->reconfig = true;