Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp395347rdb; Mon, 22 Jan 2024 07:31:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IEASTC6U0lsJ+puflU8L6golrvgfEkPAMAxqI+9Zo+erg5LIZIrQh7kqK5NFCjOoXvqa2oT X-Received: by 2002:a05:6a00:1255:b0:6d9:b42a:a6f with SMTP id u21-20020a056a00125500b006d9b42a0a6fmr4997350pfi.29.1705937477669; Mon, 22 Jan 2024 07:31:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705937477; cv=pass; d=google.com; s=arc-20160816; b=XpJnMzzZqpViFOwIqPiynUqHdvbxJavp2lF6mlVFdv7HziA+5/jvenXfKumKwy9sMl c5ckf1314hUQJazzBw8iuRYA1FnUl/uzAcbtyXGtpxFVTNwazyss6dwDmXYw1EkPQTsR Qo6UdBTSifMNnp5ZdYeHhAEz3ankMwgof+VIy6G5joAXsexj8BQk03kqHJOVUdBbLhnJ lSQQkr/Ze7J6JCEdUebitDkB2e5zM5R9Z4wbcQ1T1T1MGABMNNjQdn5H2a9ZAdwA8y2w LGrSWtcTgD1SLW3uveYP5eDCR1gTFPHoyBd6h6KdKn31GeUKRJbA/c0FE8Ixrq/5ea3P mTKw== 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=B6l6XITAYGcKPccLSpdWkLdWXnw4wuNzDqTl+PlDpG0=; fh=gav6eqApb8Xnzfgl89KMqi2FOmbTvGmkaZydQFKmEvU=; b=vAHjjn99RtqhS9D++8zNbf0UzevcpUWe+FE2PDZ8FIHMjUqn5OYncLtIEGMz3bPs/J iYrv1Fuu6nu5oCsEo9HSpFDhCgPqBR1jrsIw5KG6w1Ft63nYHZ147f9tQ3rd2v/PTaZ3 KwmIEs12FZcykUd4pSymixPl+/AYCtuYESgbM1I/g/lhHvQYND4IoA6Ayw7rnViRObsr lLKd/T13of/7Pq20W1GRvF71umroSnOEZi7/Nny2xyd5BJsqwSd0iJvFLUf9cpBlaAPR CoDZG6GNcna5CA76w4HZgqR8V0z5PcDW5VnVrXYf50GqW4W9qTNtvNIJTEJYTeWpeUX9 i4oA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rva5Fze+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-33287-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33287-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 38-20020a630c66000000b005ce004c1886si8239443pgm.468.2024.01.22.07.31.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 07:31:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33287-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rva5Fze+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-33287-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33287-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 915922889B3 for ; Mon, 22 Jan 2024 15:24:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 755DF5C605; Mon, 22 Jan 2024 15:00:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rva5Fze+" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 9FD7E5C5E1; Mon, 22 Jan 2024 15:00:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705935618; cv=none; b=mg+mXFATAMH8eL3KyD1MmDVHKAPN8YWucIJ5HH/8Wky+7Aitw3mY4/Ntxy390raQqvFB015jykPciPMJxnqLXIGHzWtfzIsHTp4K075H+Xy/spOSmfwyJvV7rPTekZVVhEm0EkyVF5Iks6h698E8f/m3OXlaWGaUGxkNAfa//OM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705935618; c=relaxed/simple; bh=A/TAgBJ5S5ecaDYVh/AFraU1HRZT/Ni7tZ1z5SbonRY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LiBqFpGPQ05dN+qakgUF+7l3iyQyk8BtW4pRXSfRMwTiUqGytjo4++hX7QaT8/M3YcyynxzHlRfVnjT9lp+pSpkTifGrwXR7N8JUhoU9A9Ro+ba5un/fa7TOQzvDCaL512glpKcGpZyG+VENq+3GDaELFMX/PAp5NRv5mY6Ow5c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rva5Fze+; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8F22C433B2; Mon, 22 Jan 2024 15:00:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705935618; bh=A/TAgBJ5S5ecaDYVh/AFraU1HRZT/Ni7tZ1z5SbonRY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rva5Fze+at2e9tFOQNipgKgKvmiXEph2CNTxMnE0G2Jk8iB4Q7Gf1rXZzNIjnkp6g a5yoAw0XjIGIW0jazdALoeEbjCZtBN5QIJXBTX5+5Ee9EToK8Og8Ky0DUjL9HCNr5R V4Mcngj75R5ygRW287MXDyjY95YtI+YrZBtVsUrrmtX5aGgQnXPyZ5mcRi43mKHICR NH532Ip8R4F8CUpgB4/sNiRCY5KpTZ2f3cv1SA/SWX7Dybgu0hTBPRHBSoDlVYady0 tuaV+vzkKVDIWJ57UI+14oTAjW1mPFPvKdWcxvGYE3rOwk+mbLMMvJG3GHmf3zfcZc xLd4aiiXawXeQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dafna Hirschfeld , Oded Gabbay , Sasha Levin , obitton@habana.ai, dliberman@habana.ai, ttayar@habana.ai, kelbaz@habana.ai, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 6.7 65/88] accel/habanalabs/gaudi2: fix undef opcode reporting Date: Mon, 22 Jan 2024 09:51:38 -0500 Message-ID: <20240122145608.990137-65-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122145608.990137-1-sashal@kernel.org> References: <20240122145608.990137-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.7.1 Content-Transfer-Encoding: 8bit From: Dafna Hirschfeld [ Upstream commit 0ec346779644039c4c05cfa7f071b1a24e54d8d9 ] currently the undefined opcode event bit in set only for lower cp and only if 'write_enable' is true. It should be set anyway and for all streams in order to report that event to userspace. Signed-off-by: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Sasha Levin --- drivers/accel/habanalabs/gaudi2/gaudi2.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/accel/habanalabs/gaudi2/gaudi2.c b/drivers/accel/habanalabs/gaudi2/gaudi2.c index 819660c684cf..bc6e338ef2fd 100644 --- a/drivers/accel/habanalabs/gaudi2/gaudi2.c +++ b/drivers/accel/habanalabs/gaudi2/gaudi2.c @@ -7929,21 +7929,19 @@ static int gaudi2_handle_qman_err_generic(struct hl_device *hdev, u16 event_type error_count++; } - if (i == QMAN_STREAMS && error_count) { - /* check for undefined opcode */ - if (glbl_sts_val & PDMA0_QM_GLBL_ERR_STS_CP_UNDEF_CMD_ERR_MASK && - hdev->captured_err_info.undef_opcode.write_enable) { + /* check for undefined opcode */ + if (glbl_sts_val & PDMA0_QM_GLBL_ERR_STS_CP_UNDEF_CMD_ERR_MASK) { + *event_mask |= HL_NOTIFIER_EVENT_UNDEFINED_OPCODE; + if (hdev->captured_err_info.undef_opcode.write_enable) { memset(&hdev->captured_err_info.undef_opcode, 0, sizeof(hdev->captured_err_info.undef_opcode)); - - hdev->captured_err_info.undef_opcode.write_enable = false; hdev->captured_err_info.undef_opcode.timestamp = ktime_get(); hdev->captured_err_info.undef_opcode.engine_id = gaudi2_queue_id_to_engine_id[qid_base]; - *event_mask |= HL_NOTIFIER_EVENT_UNDEFINED_OPCODE; } - handle_lower_qman_data_on_err(hdev, qman_base, *event_mask); + if (i == QMAN_STREAMS) + handle_lower_qman_data_on_err(hdev, qman_base, *event_mask); } } -- 2.43.0