From nobody Thu Feb 24 13:04:28 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 E083B19E014D; Thu, 24 Feb 2022 13:04:29 +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 4K4CmF4PSlz4W8J; Thu, 24 Feb 2022 13:04:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645707869; 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=e2hX6B4ImWe/OUmEW8b+EQgP82TtbilkSid6uoDXwis=; b=yQFlVCkT9QjymfVznMC12aNJ6in1hCeOQ7Y7OccPk6siMsE9s/89NCtR0GIpT813W1pKti zoIOQ/sh2Qq9zWQXfS3ociY6ml7BatFJAl12Yxi07377yBwIre9UOgZseBiniUEuRlFh5t k/6vCGrE3j2yv2TRdVXMqI5Gv7VAhLBEtC2zPpif1dnUtgULdxh2y3+vzK+BKHVW5wncAt UDHOf3BP0l/lAtnqwHNIZ9difz8ib8f+7y01R1aiefmd0ngTxQJ4JIjL0xKrv0NVTTV6ZC Tvi52Y0HDTsVjDj0Qzj7xYmOSwbnTP7qpCEu7RPJTz+qJpiIUPujDOKwn4SIQw== 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 16F43499A; Thu, 24 Feb 2022 13:04:29 +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 21OD4SQO044197; Thu, 24 Feb 2022 13:04:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21OD4SYJ044196; Thu, 24 Feb 2022 13:04:28 GMT (envelope-from git) Date: Thu, 24 Feb 2022 13:04:28 GMT Message-Id: <202202241304.21OD4SYJ044196@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marcin Wojtas Subject: git: e0edb7f3aad5 - stable/12 - 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/stable/12 X-Git-Reftype: branch X-Git-Commit: e0edb7f3aad5dc4443e921e0bf4e7fbbba3e8f65 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645707869; 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=e2hX6B4ImWe/OUmEW8b+EQgP82TtbilkSid6uoDXwis=; b=nKMstL2Y1U6q4/XYNrW6xiLmrjnPn0UfnVm6mGKOi0fyA7mh9MIOAz0Za2/Eco67x2hH70 O1r+mNfIRvTbr/nZSDk9e462vetxflYZK9sk9HPGq3joKFcQj4mYD6hj18r430u40GSdas hyQY+FONOTIAGhw23aQVCbitdx3jKlgm+ZjI57cJY5ooNqnU/I2cosBva9JvcdUykZj+ur yLRzDub90FAunaaeH7RsUhgEYMoCuhuQ2G6xP4Pxu5n8C2jhtqTgjLI3UcbVBuLz5OzLVv ETu4xPUp7Hjy+EJ046z8ZyP2VrT1+DKdkj5XMIrVVWWXRo5+M/27TrJ/hJsSUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645707869; a=rsa-sha256; cv=none; b=rj3G3yvWdxoqrk0t11/mYUsBMxMz1GkWGg5iiSMplKPypDfcZkuptqc5xB4n6vXsTI96op 5ECrM7MiOFhCVGyzAtdLiwYdWZrIUpf+jh/xiYBa6/UeXpD/Q5H0YHnCIS9fuv8TbfTbO0 YeDRIzPTMMArlOj5QENFr5arn1n3BoEJOx8fKlBmIzNbia+qAxl43vC+zLujCyIxtkZaoe 2vYvFpCrkWUNWDtWc902ikkXcH93UVv2fPR56V+Eye+i5s40+6ctSof67MeLySqybDL51K 99NGLXBF4nYvXOHivCLjpxawUeKDFV+JlTnIwbe1WN393idcgopBqK9IxyMuxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=e0edb7f3aad5dc4443e921e0bf4e7fbbba3e8f65 commit e0edb7f3aad5dc4443e921e0bf4e7fbbba3e8f65 Author: Dawid Gorecki AuthorDate: 2022-01-03 13:50:29 +0000 Commit: Marcin Wojtas CommitDate: 2022-02-24 13:04:05 +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. (cherry picked from commit d10ec3ad7739a6f621d398d034632f68f647d72f) --- 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 c069d04874ba..fe3bcac6c6ab 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -3282,6 +3282,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;