Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1795500ybg; Thu, 30 Jul 2020 02:55:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6GJcrqpy0gFIJMnR0xQMxndTlLEoNeNeTQs8f4FY/997KMHEIOoyXcRjiTMGuWEJrQnB9 X-Received: by 2002:aa7:d410:: with SMTP id z16mr1756103edq.287.1596102918417; Thu, 30 Jul 2020 02:55:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596102918; cv=none; d=google.com; s=arc-20160816; b=anvI5TXgof86mRZ7HXJCVSKTgPfJDQSjGDVpxdleDnSWa0WOPth9qnFgS9mZ21lgXh +YqT4UUVSytdfBFC1r1ur4df1GOs+sim4olp5bRPj+70yw/3km0KA5itMAlq0KZ+uJDh 8aarGjXruw78pbDHmq5FYtG8Hj4ezTguOM/5j2hfDfB0exqh7fLO53T+jK8r/koWUz4Z W4fkhG3seW5lvPm/iOEcCw3HsTk4w02ADBYvB88N4ljpGZc5YOqyOjSVUtJI3vAWFesL iB2kwiQy4xSQxS9LX/gzTs9Uligh/cunAXAm4P1h0HTgcn61V7ZQBVhCTUzWEyTsOOXI 4Y2w== 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=J5tHXA2U3uFy6imwLttCtFfftG/nSUh4E5BDJyNkixsB/B8PV3AcFXS2k+K/cGovSo ZqPlVVBz1d2io+omXCYqpnvWDe7EIYRvWugKWtHbBDLESZelNhw9yX7rPJvBeC6M2AMk S7Uw70iYEgS7Kq2/+B5LQZU/yz2OdnXaTgcqDhB+v/gdeQ5RMM2kRIunTeEfwlfpS2rD 7pYUIrxuox+wpvNXjgx2FJKnkWBe4fYkbqr07bvYjkyWwqkFSaN2/mUdOWyX8EIdqCYQ exZ7UUaGsie7gfJ6hgloE6uWozoLiWGDZVricEJBmCG9CLt5avgqKTXdb1yRqOMcWlx0 XUtw== 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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 l22si2774606ejg.450.2020.07.30.02.54.56; Thu, 30 Jul 2020 02:55:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S1729473AbgG3Jyi (ORCPT + 99 others); Thu, 30 Jul 2020 05:54:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729416AbgG3Jyf (ORCPT ); Thu, 30 Jul 2020 05:54:35 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 139A8C0619D4 for ; Thu, 30 Jul 2020 02:54:34 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id k8so5632253wma.2 for ; Thu, 30 Jul 2020 02:54:34 -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=dgpqCceSgjhByDKMFuw/B3SmN/vm3u4sTKdh2txy8Rj4vPE6gXrD3pKdk+ps1zs0L5 NFUpDMJiYjoVax3K9+fWgk3QoWDZQf6D1m9+FLH34P+DayLudwPLAOUzyYeBtrWJjbc4 tzhEWT3LVGyIjQ3RzOKa6N016PbC0058C33rHNUcKM3/d+/uyS010uc7AeCg+b4wy9eV WinLpihG1nQuf3+mUswMsYE5ixinDs7P0KsT6Ri1BIhK/Josp+b09I/h0F/v9vA3yZ8R etyq3n92PhdkVZIqlyTOTmKlG/F8BG6QqQ0GR3ZzytQdbJnADwsSa/YjQKDBWL+wlEuP e/bQ== X-Gm-Message-State: AOAM532f3aaEYMNI8aS99r5TjiEx4JuEQwns6mYwLYcuemTRPI3QgE8a WpPKINHctJXwjpmIh2eDu2dCSjGmql3L+w== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(+) 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) -- 2.17.1