Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2010304lqb; Mon, 27 May 2024 05:13:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUU9JXV7/DB29knsFy1jz1eNxU5MMdeXQweLuYxEpBUhoGf6W9RvQqIsVlvUZ9YQXB3jQEdT4wbzlKCYdsaH6cJIfhx/n7Cj6Fp87h4+A== X-Google-Smtp-Source: AGHT+IHj6g4MdABN5Q7B9G7adUenZT+KwqEyRQeakBNMykV5VpTuBg0WKKIykUFgTgkxJ0EYobGR X-Received: by 2002:a05:6a00:44cc:b0:6f8:d8a5:d468 with SMTP id d2e1a72fcca58-6f8f307ee22mr15680993b3a.13.1716812006070; Mon, 27 May 2024 05:13:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716812006; cv=pass; d=google.com; s=arc-20160816; b=vTOUZNxPwQZdlpVkYKJg5elOb8kwV1BflyyF8x26nUyJlQP+dlu6SgZBE1GBexCuB0 05GixImVfzwtd8S8oXvc/PPUheIA1jGT5ag/Pz3yYFv05e5/ybkMmRl89h+Lu7ZghH1b RT7aRfpxAgK95vh4ok9am52KFceDNcI9L96099Y9FjBVHxQcTFZu9LqqN6nt6h5aXokH DN5F65L3HPPjWSztV++LhOwaSeJzEtSa87sr6ig/4Y+ndHRphQJJ8zpZrRFueBr6qKK1 ZWUKR2MYLC3LCTJOx1169LnaoZ1SDFuQZbyQ5SBwe+dU362+wbMk/WQOnNSnCo/GTMIj K5DA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=U5TCLloeW5ylpTuzPqpCIOT86iIw6tm8waPDK2ewcdY=; fh=iVfC0mk7m8Umji1eu/vyg2DdFQ7a+rfs2/XS/fJBy3w=; b=uDLV5VTezBzoHLYQQRMWv1D5frMTSoqhY0MJkaAmppeiP5HNkKozo8vO7DUTkISaav o2mf1PzmcNhcQ8hAXvDu8NTau5i4HABlbyR/wSYf57Q+GiqlcVNQ6HKvCtMYyD45vt74 KOE5xfpGyK0MHIBKo+GRA23+TC/Lyz1p0geeK5cu6C6h4l25ih1Mse2eEpQGmZ4jy9S5 rDVALTb2d9Z1sgGBGmxjVzkp45lEKmuQRr+rQ0H73tvJc2MBq6BJbPiVrXhqCARL8WHm 6q/D7mY39IwP9VvYYUIEpV5kXLDRdijc0kZqQuw+TmnqkxaVaLeiiq2TC5FyF4HYlJgJ vBRA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@habana.ai header.s=default header.b=kksWOI0+; arc=pass (i=1 spf=pass spfdomain=habana.ai dkim=pass dkdomain=habana.ai dmarc=pass fromdomain=habana.ai); spf=pass (google.com: domain of linux-kernel+bounces-190500-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190500-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=habana.ai Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-68221b73f86si6752628a12.69.2024.05.27.05.13.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 05:13:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-190500-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@habana.ai header.s=default header.b=kksWOI0+; arc=pass (i=1 spf=pass spfdomain=habana.ai dkim=pass dkdomain=habana.ai dmarc=pass fromdomain=habana.ai); spf=pass (google.com: domain of linux-kernel+bounces-190500-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190500-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=habana.ai Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 6F924B22DEE for ; Mon, 27 May 2024 11:49:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0EE7915DBB9; Mon, 27 May 2024 11:48:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=habana.ai header.i=@habana.ai header.b="kksWOI0+" Received: from mail02.habana.ai (habanamailrelay.habana.ai [213.57.90.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B670815ECDF for ; Mon, 27 May 2024 11:48:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.57.90.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716810520; cv=none; b=j7DBh9rrhowZ+vdWdljReRvacJH2DQ1fYzeCWkm8qidn1EbbhVCq8SKt6ihXMEuv5iCt7EqmTnuAWix7My63rWJT/9LUrzg0411DhGX2vpfQKyW8eaeSQ6VaIHdeCSkXqZa0NkzCyKnVh1mr3/j4d/UR2Ceju8iIEGCIcOiK7z4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716810520; c=relaxed/simple; bh=pXheFYeAWfi+J/oHigZFL4ImqWPHDuO3tD3An/fuwbA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=H4riCJFAzrHE/USxOop4GtF8lkgLbhQrgt6qmpGtAClXl9dpxwouqJ88XiNLvTTttmpVgUFNNSGA/fiBU8Z96+qQgiXEif5kKxupQadpTc83Lrya0fp7kZcyV08PO/p0se1Cc/syCuGz2h604DRgYusxjAYhhB+WUlPRSYmuUuo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=habana.ai; spf=pass smtp.mailfrom=habana.ai; dkim=pass (2048-bit key) header.d=habana.ai header.i=@habana.ai header.b=kksWOI0+; arc=none smtp.client-ip=213.57.90.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=habana.ai Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=habana.ai Received: internal info suppressed DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=habana.ai; s=default; t=1716810492; bh=pXheFYeAWfi+J/oHigZFL4ImqWPHDuO3tD3An/fuwbA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kksWOI0+lODuu7gon+aY5FVIRM6zlYgSD/dXWUpWYaF5BKIMaW/A0N0nM1CdejpMa obTxpSrIYEkJToFjUfEipDx+gFGVs+pWfCwrTrOimwiwPQsmlQPa50ATEerFn+KZ/v jEfxbCtPftQ7WGRfIHmDLNjAScPRWrJin/ARvnSymg+7uvIqpsu/90n/pVHN5Vu2gj 9s483rN/xP0CqlUFEDqiJwchacB3glQhpns4rXESAH7gix6B//PKMu/7y0HLmlYiM3 h5kyEPO6B5Ub31+0znDFn3IlAA/u//ZMdr95YIOaQ7xmusqpLqUxez/BSZexGTNGXl sEEj2W6VRWuGw== Received: from obitton-vm-u22.habana-labs.com (localhost [127.0.0.1]) by obitton-vm-u22.habana-labs.com (8.15.2/8.15.2/Debian-22ubuntu3) with ESMTP id 44RBltNl1919357; Mon, 27 May 2024 14:47:55 +0300 From: Ofir Bitton To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Tal Risin Subject: [PATCH 7/9] accel/habanalabs: expose server type in debugfs Date: Mon, 27 May 2024 14:47:44 +0300 Message-Id: <20240527114746.1919292-7-obitton@habana.ai> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527114746.1919292-1-obitton@habana.ai> References: <20240527114746.1919292-1-obitton@habana.ai> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Tal Risin Exposing server type through debugfs to enable easier access via scripts. Signed-off-by: Tal Risin Reviewed-by: Ofir Bitton --- Documentation/ABI/testing/debugfs-driver-habanalabs | 6 ++++++ drivers/accel/habanalabs/common/debugfs.c | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/Documentation/ABI/testing/debugfs-driver-habanalabs b/Documentation/ABI/testing/debugfs-driver-habanalabs index a7a432dc4015..efbb78bedb8b 100644 --- a/Documentation/ABI/testing/debugfs-driver-habanalabs +++ b/Documentation/ABI/testing/debugfs-driver-habanalabs @@ -253,6 +253,12 @@ Description: Triggers dump of monitor data. The value to trigger the operatio When the write is finished, the user can read the "monitor_dump" blob +What: /sys/kernel/debug/accel//server_type +Date: Feb 2024 +KernelVersion: 6.11 +Contact: trisin@habana.ai +Description: Exposes the device's server type, maps to enum hl_server_type. + What: /sys/kernel/debug/accel//set_power_state Date: Jan 2019 KernelVersion: 5.1 diff --git a/drivers/accel/habanalabs/common/debugfs.c b/drivers/accel/habanalabs/common/debugfs.c index de3ae2e47ec4..ca7677293a55 100644 --- a/drivers/accel/habanalabs/common/debugfs.c +++ b/drivers/accel/habanalabs/common/debugfs.c @@ -1717,6 +1717,11 @@ static void add_files_to_device(struct hl_device *hdev, struct hl_dbg_device_ent root, &hdev->device_release_watchdog_timeout_sec); + debugfs_create_u16("server_type", + 0444, + root, + &hdev->asic_prop.server_type); + for (i = 0, entry = dev_entry->entry_arr ; i < count ; i++, entry++) { debugfs_create_file(hl_debugfs_list[i].name, 0644, -- 2.34.1