From nobody Sun Jun 14 08:33:53 2026 Received: from mail-pf1-f201.google.com (mail-pf1-f201.google.com [209.85.210.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 45E222853F3 for ; Thu, 2 Apr 2026 01:11:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775092269; cv=none; b=HA//jC6nosvb9XvWGNEn7KAcX12EvJpoK+Pec4p4xqDol1M5YK+RV0lCAVdIGkVi//aRS3uyhlk2sdyhzD+5fNz+rc89naBmUeGxFMXkAGfcYS4zdjAb0ojKGwuOadMqcR9l3fzOuie4blv7UUHpBPq1x3TVmhnBFNy6PLc7Dyg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775092269; c=relaxed/simple; bh=LpyxEI2XHeXWT2ODp48J7yCs6+1uKO9aiwq4iFZO5g0=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=ioI0mr9JQX3z/GBzNJnbvr/x9L60VG3F11wZIO16oAw+PO3TrVNlD1+Om80N5LkTe40+T68npf/mc+MFDzXSlpEhv9k3bxu1wOCd+OltA4cUk1RlEpT0fYVtTKbv4cJnTjhlK3t/a3vz8liOThIN+QzkYeLsViMlyxRLXxbRbeI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ipylypiv.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=K7XyvQ8C; arc=none smtp.client-ip=209.85.210.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ipylypiv.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="K7XyvQ8C" Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-82c649dc145so176667b3a.3 for ; Wed, 01 Apr 2026 18:11:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1775092267; x=1775697067; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=b5vlh7nRu2VO+uZc0moAtUj0d3hwd9HOdLTCGjwE1js=; b=K7XyvQ8C18Rf/5CMUjgcac2wNIpaplbEeHyDOK1ryUg2Q2a/xXo2BeQEV/3ZYkeJaQ ehOOsT7wLePqItZiMuMl+u+cWxK2aO4oHwLsJsCewwCeywJB3d9HT+YOXWCeeejmsQ2t +F18QuBkk1ekHrdjOqzTOQHgiTAgd80Dt4DtuArDgBdJv4cM4inTU2C1Y3bN1nVPTum+ W+5gKJn5nO4UTcHIJYsDFjNHTL0o24DvEF3WKJ5ueOUUn5rhz9QP8pzKRLDu5LR8MZU4 HsBlgE/MI0OKclt67uA31FjeUnSZXlXheZRXqozXLJduF1d5u6eE7QJYV6nQgvpMhWLn LPZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775092267; x=1775697067; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=b5vlh7nRu2VO+uZc0moAtUj0d3hwd9HOdLTCGjwE1js=; b=nST8EnPL0GP5y4LRdJYeijTFLNB5kCrb1+7wjb+92Tww7zIsmtVPMOD358neYTmqCQ LiwjoAT7qnEuzXQtmaBxlJJGqJmjqdOnXGcH90LR41PNfg36zQuxUcoOBwBZpmJiht06 zw10AMdCW/qYwFIxoWzx2L7vnLUcRcT3XlamLUItcAPTfbNjak8JAFAwVPvaGbkkB2KO RZvBvpW8d/lcIzWvU5ER6zoeCIwILE60ePGfK7ReIYy9nMzWKTAq/6DKbvaYovzIjJXg MlPCu2jS6wvsYRUolp3Amqj3XGXPq6dZV6wSMe6G8cgPdaM3mKvzJTZBg+hDMtzMEN2g eqfQ== X-Forwarded-Encrypted: i=1; AJvYcCVIBX2OpokImbhSwRxSaLc8OOb2HUg1EvKRuz5/812duqKfMBCykBkPWBc+IsKYlPs7nhH0nRcGyMrHftQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyMWRrvlU5wbhkLKPBY8hvBkvfQYKTeP/SgsQOFbxMersS7XrIF W/C09VS4hsbWffg0piEIzW7CIeh82+jOuABQe0ETonTpQM6WKnZUVQ3KZUwC+wpWf9vszof4M1E v+nXoObZGcDRDCA== X-Received: from pfdf3.prod.google.com ([2002:aa7:8b03:0:b0:82c:20b9:f6a6]) (user=ipylypiv job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:94c9:b0:82a:6d3d:9ba1 with SMTP id d2e1a72fcca58-82ce8909407mr5994631b3a.24.1775092266394; Wed, 01 Apr 2026 18:11:06 -0700 (PDT) Date: Wed, 1 Apr 2026 18:11:01 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.53.0.1185.g05d4b7b318-goog Message-ID: <20260402011101.676267-1-ipylypiv@google.com> Subject: [PATCH] ata: libata-eh: Do not retry reset if the device is gone From: Igor Pylypiv To: Damien Le Moal , Niklas Cassel Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, Igor Pylypiv Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" If a device is hot-unplugged or otherwise disappears during error handling, ata_eh_reset() may fail with -ENODEV. Currently, the error handler will continue to retry the reset operation up to max_tries times. Prevent unnecessary reset retries by exiting the loop early when ata_eh_reset() returns -ENODEV. Signed-off-by: Igor Pylypiv Reviewed-by: Damien Le Moal --- drivers/ata/libata-eh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 23be85418b3b..e97a842005e9 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -3171,7 +3171,7 @@ int ata_eh_reset(struct ata_link *link, int classify, sata_scr_read(link, SCR_STATUS, &sstatus)) rc =3D -ERESTART; =20 - if (try >=3D max_tries) { + if (try >=3D max_tries || rc =3D=3D -ENODEV) { /* * Thaw host port even if reset failed, so that the port * can be retried on the next phy event. This risks --=20 2.53.0.1185.g05d4b7b318-goog