From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 913514534A3; Tue, 16 Jun 2026 16:08:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781626094; cv=none; b=LshNz2cqX9GSnCx6GfTLOjB2S/pLA21jgyRIbVSFA2WZZ+AqIxmA8sedbj0fUQbFpKvB3pCDVspSGyHCQtOIGHuFNQQrm21CzhPfbCRJ/GVZUVapDgKQYNQAGfSBjPkdTeMqUtf8my7mEfXAi/m6/+Wtvmo1EWgS+KPLGvtpQto= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781626094; c=relaxed/simple; bh=E9+KP37NnGUMPnf6Y00nxRf5guDEHbVqX3c3IEd5X6A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AQJoV5sHmNlNM9iuJAuhh7Pr8sjzWQU0ZJY+ZtXlUM3CxZ7JdyvE3IrCT+1ryexG2bpFG3MAju4IyeBfB7/fCxF6ZdakQ2mtYYV0YnHOY3LCFJgKZs8mGnz8+4aMvRGSf/zNgu0bI0vWFyIjOBG2YPen1sozxkG8mpHOCuPF6wk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=MVJT0Mzd; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="MVJT0Mzd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 902FA1F000E9; Tue, 16 Jun 2026 16:08:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1781626093; bh=CanB+2k4BofoweGGGFsz679FvH+kNiql/sKNjUwnXlk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=MVJT0MzdI0QeAT7GM8lF5KdechM4ry/TD6qTmzAyNqLjrtQf1RQfAs6ojYEFnlxlG 6m2EpgK8UnwS7b4/v0MJ0/dT7Shp0+wL6lF18T9g5xcAC9XjfsE/8uJQTOmfGlrttz VMo5IZBI4qEee/536EWlbzYsqaRo9miAELA6PqSs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Justin Lai , Jakub Kicinski Subject: [PATCH 6.18 264/325] rtase: Avoid sleeping in get_stats64() Date: Tue, 16 Jun 2026 20:31:00 +0530 Message-ID: <20260616145111.777072980@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260616145057.827196531@linuxfoundation.org> References: <20260616145057.827196531@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Justin Lai commit 9fc237f8d49f06d05f0f8e80361047b718894e81 upstream. The .ndo_get_stats64 callback must not sleep because it can be called when reading /proc/net/dev. rtase_get_stats64() calls rtase_dump_tally_counter(), which polls the tally counter dump bit with read_poll_timeout(). This may sleep while waiting for the hardware counter dump to complete. Use read_poll_timeout_atomic() instead to avoid sleeping in the get_stats64() path. Fixes: 079600489960 ("rtase: Implement net_device_ops") Cc: stable@vger.kernel.org Signed-off-by: Justin Lai Link: https://patch.msgid.link/20260603061816.31356-1-justinlai0215@realtek.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/realtek/rtase/rtase_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/realtek/rtase/rtase_main.c +++ b/drivers/net/ethernet/realtek/rtase/rtase_main.c @@ -1563,8 +1563,9 @@ static void rtase_dump_tally_counter(con rtase_w32(tp, RTASE_DTCCR0, cmd); rtase_w32(tp, RTASE_DTCCR0, cmd | RTASE_COUNTER_DUMP); - err = read_poll_timeout(rtase_r32, val, !(val & RTASE_COUNTER_DUMP), - 10, 250, false, tp, RTASE_DTCCR0); + err = read_poll_timeout_atomic(rtase_r32, val, + !(val & RTASE_COUNTER_DUMP), + 10, 250, false, tp, RTASE_DTCCR0); if (err == -ETIMEDOUT) netdev_err(tp->dev, "error occurred in dump tally counter\n");