From nobody Sun Jan 23 19:50:35 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id ED1741980D7C; Sun, 23 Jan 2022 19:50:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JhkHc1GWYz3w3Z; Sun, 23 Jan 2022 19:50:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642967436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SqGOQjGPetPslciXn8+jGooV/5bArodoUqtG/VHIOXo=; b=aOWx49gzq4kOLfCtCooQzv1lkr7H6G2oFR5+NHW1ZU3hcsBYNzBNlgJQdflMzQfnH4asrE rCRRnD53/+7ZGcckZlx+TRmTubYu0UCrcPN1iOOgR/IoR2MpJ1pqu8qu0EbyWE+Bp7rwNE n4zyON8+6dS4Ql9uBAc25LAXVcOtbkiZ0tL8+T88w5pT5Cgp+tYiS0bCyrLFoH6xf4EYi+ rv+0g2GJNuWGhD5LRGf6F2OzlE5AMUHfe3p4e2JlHcAp3j63pkdCxe1UWcF0JNukqhpeZD 8PxLB2pElvFcdQToBdNJHxUwYA6wwYk2D5mvXDfVGKtTATqWKHCnsXjBViSoEw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF91527BF8; Sun, 23 Jan 2022 19:50:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20NJoZop058402; Sun, 23 Jan 2022 19:50:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20NJoZMi058401; Sun, 23 Jan 2022 19:50:35 GMT (envelope-from git) Date: Sun, 23 Jan 2022 19:50:35 GMT Message-Id: <202201231950.20NJoZMi058401@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: d10ec3ad7739 - main - ena: do not call reset if device is unresponsive List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d10ec3ad7739a6f621d398d034632f68f647d72f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642967436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SqGOQjGPetPslciXn8+jGooV/5bArodoUqtG/VHIOXo=; b=N2l/wBGGmkrgGyraJEVy6WcrzqWAjc6K6gWPSDNnSobVlSbjd/2dQ1aAeoKblSyadoi+Lq mCbxG32k+yFWL12MepsVS5b+EfTAkoz7+SqgDpg6U/lG9Y3FF2AQKXrA96C8kASeLqlkoh k/cDX5QYT2ECZJVMZm7WJ2IRHCpOCX3wiGd2GmXx1R1gxHR1qEa45JA2E9hDbJXy0eakyn 2zykDtIt7w9IXHcupZNydgSCItF6UngYohv+8qz7a9ZVimMt9vxWZ+7MvCIkxcXk3wbs8g kBuf9bMSnUSCmD9QHv/2UMSQYLppvUtXeUyT2sLxNtJd1kNISxMlaFSvtLJRaw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642967436; a=rsa-sha256; cv=none; b=fYRx2spifZ9usVZ3OOSNDx5A56pZF/ZLqOTzEzdKGau2+AfIMmAXqGF1+lUwq/3mx/3Hbu Tph1BeWBgfDpBs4LpUvsrdim0wnHyI2seDDOO5ypm5VWyM5eoPU/W9/GJmpU/gfn9ZckCu rfhEFM35o3X/NEnOjArUqHnoMV4iXlsCX2xUjHEB3DQFWFJkI7iq0mytaYcVWrdjf47RR2 Cphnq5tjnOunnjABaQt+5WrNa7lXftPaS9Mjip+FW1EqRHsrzoDWw6MpYHC+Te74sQlOVA NjvYoDZZ83Ojfw6Aocs+BwY/I2akEuwvQnzBgu7FNTG7tkk3DrvLEMkGVqiqRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=d10ec3ad7739a6f621d398d034632f68f647d72f commit d10ec3ad7739a6f621d398d034632f68f647d72f Author: Dawid Gorecki AuthorDate: 2022-01-03 13:50:29 +0000 Commit: Marcin Wojtas CommitDate: 2022-01-23 19:48:33 +0000 ena: do not call reset if device is unresponsive If the device becomes unresponsive, the driver will not be able to finish the reset process correctly. Timeout during version validation indicates that the device is currently not responding. In that case do not perform the reset and instead reschedule timer service. Because of that the driver will continue trying to reset the device until it succeeds or is detached. Submitted by: Dawid Gorecki Obtained from: Semihalf MFC after: 2 weeks Sponsored by: Amazon, Inc. --- sys/dev/ena/ena.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index f4abe61f08ae..1b26a91c5d9e 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -3278,6 +3278,18 @@ ena_timer_service(void *data) ena_update_host_info(host_info, adapter->ifp); if (unlikely(ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter))) { + /* + * Timeout when validating version indicates that the device + * became unresponsive. If that happens skip the reset and + * reschedule timer service, so the reset can be retried later. + */ + if (ena_com_validate_version(adapter->ena_dev) == + ENA_COM_TIMER_EXPIRED) { + ena_log(adapter->pdev, WARN, + "FW unresponsive, skipping reset\n"); + ENA_TIMER_RESET(adapter); + return; + } ena_log(adapter->pdev, WARN, "Trigger reset is on\n"); taskqueue_enqueue(adapter->reset_tq, &adapter->reset_task); return;