From patchwork Thu Oct 27 09:09:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 11680 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp119446wru; Thu, 27 Oct 2022 02:12:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4uIE29bA+6A6XD6REnRo/WU4DEDGwaEM43oI3adO1qiDqa3meaHzJJgbVHzt5jBMYvn5QI X-Received: by 2002:a17:907:7208:b0:78e:176e:e0c6 with SMTP id dr8-20020a170907720800b0078e176ee0c6mr41286193ejc.594.1666861922816; Thu, 27 Oct 2022 02:12:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666861922; cv=none; d=google.com; s=arc-20160816; b=mL9S+tffdzisAUp1MbcFAxktrj4Ihr2zFUuFLb1mUvtKNpTK/DaghVY0yg1aRi0wsU hbj+rIlSYutueWFvRrCNBbKAci5c0ozOlxUjsCXX5f6pwHe2cVG5+4moQNvzj5/VyX2B J1r+R+pNQeJwgwAzR1iuPSUB6xCu7JozHYCS2GSYymEFN0POPKTqRCKb/jS8PFYhjcwE Nf65zdcW6vdGp40xmgykjHMME4P3tvnzuTu0uKqMh7W76ky+Znbqg/pmtishqRXAQtMK OTSPdxHXr9RicBSvJ38vYC9+4oAZO5zwiyfSeqTmqDo30+dOnTIxBU5ozn1gLs2LAm+i NNbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vTpuAnvbplSWD6aYfiKV5Nlty+0OqV7EH+cvbz/aK5o=; b=RJn0INsFDgcNr3R6hUJn8KQOVPdHNuMtYOrzq1ECH1n/jpp793UufB4unmL7bc5GrO 6deyJ+AVVYaWR+enGaMHXlUnrvNo0VVgzd6fc8iwFfghbrxNBw4n1bep9DUz3v6Q3iWi rDZuUOTXn9PqXE9429vG9s2t4SvFvFT+4Wd7YXvrnSHd5+EGFX5Ip1QI/wpGadVFmsvp L54NSDlUqTgxp7a284YOMUq/sVm/whNSRKoIqKZahZq2srx5kvE8J2auXJMKGBNJFG0u /0jCKsRI/Y2u+I2T/4+e9LoDJrKHtgb6YpohRpwaCDw85Iiz0RSE6lISit3eJHG7I5mW k5vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CWIGtmJN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y16-20020a50e610000000b004596db363c4si975529edm.264.2022.10.27.02.11.38; Thu, 27 Oct 2022 02:12:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CWIGtmJN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235263AbiJ0JLF (ORCPT + 99 others); Thu, 27 Oct 2022 05:11:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233283AbiJ0JK3 (ORCPT ); Thu, 27 Oct 2022 05:10:29 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A529214009 for ; Thu, 27 Oct 2022 02:10:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4A855B82558 for ; Thu, 27 Oct 2022 09:10:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C682C433C1; Thu, 27 Oct 2022 09:10:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666861822; bh=icNef8V1Wwx19GOqo5GRCHNJaynBT3OZ8JCWz9XdCL8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CWIGtmJNdolosGku/LZRDxMGIjCIlfsFvnMMxjTsdJpwXJWWXeD0NRotiRngDYccd 5rMlKB2aT2QXDc1buosX9Wq3hvP1huAKAYTtYXUWm8abhVgdNA5DWrvwMIxSr13E6p OBwvYOkgmqvktRyIq6doMXR81hJao7cA5A7RDW90noXkLgnzrUj/HqHXyVGaR0oAI+ Yl1KiVODNGsEJ3t9gUvcn4NmnPl+RKiWl6ugFMpPPW6ghsUiZdQfYHw3KdmOpnfPhX sfkQyQJzb/hYF6q9GlJmffbfKlPUOIRwPQZcqwxgeEs/Svbcfemjg2q5QedXEUAPXa 0jFqcHxOAET4A== From: Oded Gabbay To: linux-kernel@vger.kernel.org Cc: Tomer Tayar Subject: [PATCH 07/15] habanalabs: add an option to control watchdog timeout via debugfs Date: Thu, 27 Oct 2022 12:09:59 +0300 Message-Id: <20221027091007.664797-7-ogabbay@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221027091007.664797-1-ogabbay@kernel.org> References: <20221027091007.664797-1-ogabbay@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747831407059403411?= X-GMAIL-MSGID: =?utf-8?q?1747831407059403411?= From: Tomer Tayar Add an option to control the timeout value for the driver's watchdog of the reset process. The timeout represents the amount of the user has to close his process once he gets a device reset notification from the driver. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- Documentation/ABI/testing/debugfs-driver-habanalabs | 7 +++++++ drivers/misc/habanalabs/common/debugfs.c | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/Documentation/ABI/testing/debugfs-driver-habanalabs b/Documentation/ABI/testing/debugfs-driver-habanalabs index c915bf17b293..85f6d04f528b 100644 --- a/Documentation/ABI/testing/debugfs-driver-habanalabs +++ b/Documentation/ABI/testing/debugfs-driver-habanalabs @@ -91,6 +91,13 @@ Description: Enables the root user to set the device to specific state. Valid values are "disable", "enable", "suspend", "resume". User can read this property to see the valid values +What: /sys/kernel/debug/habanalabs/hl/device_release_watchdog_timeout +Date: Oct 2022 +KernelVersion: 6.2 +Contact: ttayar@habana.ai +Description: The watchdog timeout value in seconds for a device relese upon + certain error cases, after which the device is reset. + What: /sys/kernel/debug/habanalabs/hl/dma_size Date: Apr 2021 KernelVersion: 5.13 diff --git a/drivers/misc/habanalabs/common/debugfs.c b/drivers/misc/habanalabs/common/debugfs.c index 48d3ec8b5c82..945c0e6758ca 100644 --- a/drivers/misc/habanalabs/common/debugfs.c +++ b/drivers/misc/habanalabs/common/debugfs.c @@ -1769,6 +1769,11 @@ void hl_debugfs_add_device(struct hl_device *hdev) dev_entry, &hl_timeout_locked_fops); + debugfs_create_u32("device_release_watchdog_timeout", + 0644, + dev_entry->root, + &hdev->device_release_watchdog_timeout_sec); + for (i = 0, entry = dev_entry->entry_arr ; i < count ; i++, entry++) { debugfs_create_file(hl_debugfs_list[i].name, 0444,