Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2010899lqb; Mon, 27 May 2024 05:14:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWg6FXdWuFDu1nLVqRkDUfDTjNKW1R8oIKffRVCHiKT2+2Um0EBb6a+jxKAD1BpKbP6GY8+zVfAkzwtVhfnut8iJA6gbBsd2Z7RIVEvZg== X-Google-Smtp-Source: AGHT+IEpb3D4Qyjsbehtj+EyGrWDfzVK2NM0xWDg9QJPhvncr6q6tc36E9ZcSmq/LUomL7ds4msV X-Received: by 2002:a50:9355:0:b0:578:55f5:1980 with SMTP id 4fb4d7f45d1cf-57855f519e6mr4963858a12.0.1716812063253; Mon, 27 May 2024 05:14:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716812063; cv=pass; d=google.com; s=arc-20160816; b=fRa0xUBpjaxgQpmnyURO/31+UlVULi9DO5B2btj9mIrkQKEepo+F/DNhtcuexGCrxC 5IX3ZSKSieToKJ0Cu373vYaHL3PjANkmm2xEDxcZsTOVo/p2ohtHv1S98JMQbOBgYfVB 7DnCdmnyOIo7zuuK18RNUSJydvv/szinBJ7hVrIvv/7p+kycN9eEEcyFUM9XucLIS9V/ jB+cWO9/nPBl7F+4uJR6bcLElqD+hic90oPgejBSzYnnIgTYVtINYVf0kSCVWYI4C2vu /1m3aG9ajjL2NSCD+bPgv5wqpwtzN5Mtk1oxeWHNrDZO5XwBBjRj966Zeaij9OZRnKun iOrA== 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=s9uBMb41QJGZV0yJNnlm9PGbu4pf0DlHoO3cPii6dk4=; fh=PceJZ/KGF6ujSpGwn68DXpj5qiXzqwvBM4Q702GUgLM=; b=pflabQHihmU+sIVJ7sRoYPZXOcTvnSJofAlaRdnaMEYfMP7umErZctH8gyGXOYEiEi /pMvSl4prfKqWttdsz2djw3y9hYWQ/BQg3n6osVCwlmz7Ku1hGrsJxO9Jo41s/vax7Gt zplz6BA1IX1SebesVkGM3yr4csTzculDdrIXxxr8VK0r/H6Ew+lv6nFBhoQbGaL9Yz0Q vUh7pnpMWJZuC1kgZNys6PIwlgYG6LgdqXksFypPEzKnvtHbyYmKXCGOX29CZbd8IlOH 6x2I+1/C3Fja0V7qHaWChR0h45nGJJHp6I/y+PndCH5u40r5YiiFmFBTVvIaZK3mKu+F DG6A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@habana.ai header.s=default header.b=hJPjxmUc; 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-190544-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190544-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=habana.ai Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5786294728esi3276708a12.351.2024.05.27.05.14.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 05:14:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-190544-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@habana.ai header.s=default header.b=hJPjxmUc; 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-190544-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190544-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 010E41F22652 for ; Mon, 27 May 2024 12:14:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DD03815EFB1; Mon, 27 May 2024 12:13:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=habana.ai header.i=@habana.ai header.b="hJPjxmUc" 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 D69CF15DBCC for ; Mon, 27 May 2024 12:13:12 +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=1716811994; cv=none; b=KqmF49aLE/rc8wdy2Ms0LI9hOA1IFV2NJ5uxGxH2BMZhaUzleN6SC81DQpXD345NhNWabOpPVHAI1Gxz5KS+Np/ibQ7URGDX6YtiZ1S4oOuwmytdNSa2IuNf3fhWbGd29jYjNLpVyiN4jRjxc+/c+n2E7wHjMXd22JUMakaPbYg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716811994; c=relaxed/simple; bh=HA3Ew5tpL7ApKKFbeZ+k1CKifd7ompu4unxRVvUSSkU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GhgzYqbGulhnn11Ol4vPfnyasdRGLfzmTM2q/jNxZ+KM5oFAg9J9Hb2DPjoL6trvGXFi+AZ2D+KAR2YVyrFYRPDB5hjeUcS4BSU2b8aVOvfJcqg2OH6slqZK/nVqOWaOVZ5VqQfYwYLbgrVyO8VHjJn3HpOKCDg0IVExBwc1i2I= 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=hJPjxmUc; 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=1716811993; bh=HA3Ew5tpL7ApKKFbeZ+k1CKifd7ompu4unxRVvUSSkU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hJPjxmUciGCeDmYTn82I0pH8ClJhQRo8Ku/9DqJTCAyoxQzt/DBzC3TAzhh+aq1Ou I4eV1MaPXENiqYOJWp7wJpkbtalz5Sy02v0dXXOnvePNY7Sfp4jMVtwMHYT7dWxAOf 1t/Z/tINg6YYTXNeZMIOX4dx87+VOnlCQl89Z1eusBxC7Qvn0jhivLGtzFPQo5uh0X b4uhNP9O2OSZadK8AVqoQs5Pm6cWRcMICojKTKM/ZE81NrO6DDMl+cA9m6X149aIxA Kc+L+uWd2rwrfwAL+BE7MqkB8p3Zz9EYF5BrT8XiTq2iPNhHGrupEvQuK0EcYKcKPB TINOv+umpz6nw== 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 44RCCub01921351; Mon, 27 May 2024 15:12:57 +0300 From: Ofir Bitton To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Tomer Tayar Subject: [PATCH 8/8] accel/habanalabs: move hl_eq_heartbeat_event_handle() to common code Date: Mon, 27 May 2024 15:12:54 +0300 Message-Id: <20240527121254.1921306-8-obitton@habana.ai> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527121254.1921306-1-obitton@habana.ai> References: <20240527121254.1921306-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: Tomer Tayar hl_eq_heartbeat_event_handle() doesn't have ASIC specific code, and therefore can be moved from Gaudi2-only code to common code, and possibly used for other ASICs. Signed-off-by: Tomer Tayar Reviewed-by: Ofir Bitton --- drivers/accel/habanalabs/common/device.c | 6 ++++++ drivers/accel/habanalabs/common/habanalabs.h | 1 + drivers/accel/habanalabs/gaudi2/gaudi2.c | 6 ------ 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/accel/habanalabs/common/device.c b/drivers/accel/habanalabs/common/device.c index 35502e938b5d..f9b8601c4396 100644 --- a/drivers/accel/habanalabs/common/device.c +++ b/drivers/accel/habanalabs/common/device.c @@ -2850,3 +2850,9 @@ void hl_set_irq_affinity(struct hl_device *hdev, int irq) if (irq_set_affinity_and_hint(irq, &hdev->irq_affinity_mask)) dev_err(hdev->dev, "Failed setting irq %d affinity\n", irq); } + +void hl_eq_heartbeat_event_handle(struct hl_device *hdev) +{ + hdev->heartbeat_debug_info.heartbeat_event_counter++; + hdev->eq_heartbeat_received = true; +} diff --git a/drivers/accel/habanalabs/common/habanalabs.h b/drivers/accel/habanalabs/common/habanalabs.h index 8d0df685e627..057087dc8592 100644 --- a/drivers/accel/habanalabs/common/habanalabs.h +++ b/drivers/accel/habanalabs/common/habanalabs.h @@ -4059,6 +4059,7 @@ void hl_capture_engine_err(struct hl_device *hdev, u16 engine_id, u16 error_coun void hl_enable_err_info_capture(struct hl_error_info *captured_err_info); void hl_init_cpu_for_irq(struct hl_device *hdev); void hl_set_irq_affinity(struct hl_device *hdev, int irq); +void hl_eq_heartbeat_event_handle(struct hl_device *hdev); #ifdef CONFIG_DEBUG_FS diff --git a/drivers/accel/habanalabs/gaudi2/gaudi2.c b/drivers/accel/habanalabs/gaudi2/gaudi2.c index 4791582d157c..a38b88baadf2 100644 --- a/drivers/accel/habanalabs/gaudi2/gaudi2.c +++ b/drivers/accel/habanalabs/gaudi2/gaudi2.c @@ -9777,12 +9777,6 @@ static u16 event_id_to_engine_id(struct hl_device *hdev, u16 event_type) return U16_MAX; } -static void hl_eq_heartbeat_event_handle(struct hl_device *hdev) -{ - hdev->heartbeat_debug_info.heartbeat_event_counter++; - hdev->eq_heartbeat_received = true; -} - static void gaudi2_handle_eqe(struct hl_device *hdev, struct hl_eq_entry *eq_entry) { struct gaudi2_device *gaudi2 = hdev->asic_specific; -- 2.34.1