From mboxrd@z Thu Jan 1 00:00:00 1970 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 AA85D6088F; Mon, 6 Jan 2025 15:48:51 +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=1736178531; cv=none; b=RTW/CifxjThn6z7/IUbLmaqI/fNSUgoLiox4/NL/lhXb87ZpQbLt5+yi23yHwYUbSZCn+SiuX3v1IAmcEGE6kh1uBzBoYjzcFwh/kgj2wwGjTP8SVtvQHQCK18DWnhCE/sX8fY+lAsH+D57wmCfBa66LFi8Mlh4KkcKHTb3dlmE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736178531; c=relaxed/simple; bh=n+FHlN0IMS75guDQCM7ZZgcvrBS39JI6nq9gthr2bJ4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=n7IsW7Ngv/OTNgyzwLJzlOHXOYRjrdYHCD0TnW/La9hTPnzWB8zlo2h1Zo9im9z/ZacaU88lbvK71w+btxzdswppKwVfZNuCnEQebnmtCUuHOOvrOxscXSkAHdejxpfhRc1EJ081YqTkaEo9GOhOjAlTjRy1EoNGzmCEw2rSiMM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Zua8DBF3; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Zua8DBF3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33A55C4CED2; Mon, 6 Jan 2025 15:48:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1736178531; bh=n+FHlN0IMS75guDQCM7ZZgcvrBS39JI6nq9gthr2bJ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zua8DBF3D7h/lTalwt8qxtcDXjFJAWzCGDuWr+JVlWjKyZ6MjA1f0sgcBKTW4MUKd K3TpQnVkPhbzDEnjgV0YNIF9q5cX51dfQvaJ7i86u3fbNRY8zAwTpGsAqTuDos9+xA DtfPIBnuqMVF0KyVX1/jJVWpxOYaLUaX1JTurv+A= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Vladimir Riabchun , Andi Shyti , Sasha Levin Subject: [PATCH 5.15 011/168] i2c: pnx: Fix timeout in wait functions Date: Mon, 6 Jan 2025 16:15:19 +0100 Message-ID: <20250106151138.889110855@linuxfoundation.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250106151138.451846855@linuxfoundation.org> References: <20250106151138.451846855@linuxfoundation.org> User-Agent: quilt/0.68 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 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Vladimir Riabchun [ Upstream commit 7363f2d4c18557c99c536b70489187bb4e05c412 ] Since commit f63b94be6942 ("i2c: pnx: Fix potential deadlock warning from del_timer_sync() call in isr") jiffies are stored in i2c_pnx_algo_data.timeout, but wait_timeout and wait_reset are still using it as milliseconds. Convert jiffies back to milliseconds to wait for the expected amount of time. Fixes: f63b94be6942 ("i2c: pnx: Fix potential deadlock warning from del_timer_sync() call in isr") Signed-off-by: Vladimir Riabchun Signed-off-by: Andi Shyti Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-pnx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-pnx.c b/drivers/i2c/busses/i2c-pnx.c index d2c09b0fdf52..ab87bef50402 100644 --- a/drivers/i2c/busses/i2c-pnx.c +++ b/drivers/i2c/busses/i2c-pnx.c @@ -95,7 +95,7 @@ enum { static inline int wait_timeout(struct i2c_pnx_algo_data *data) { - long timeout = data->timeout; + long timeout = jiffies_to_msecs(data->timeout); while (timeout > 0 && (ioread32(I2C_REG_STS(data)) & mstatus_active)) { mdelay(1); @@ -106,7 +106,7 @@ static inline int wait_timeout(struct i2c_pnx_algo_data *data) static inline int wait_reset(struct i2c_pnx_algo_data *data) { - long timeout = data->timeout; + long timeout = jiffies_to_msecs(data->timeout); while (timeout > 0 && (ioread32(I2C_REG_CTL(data)) & mcntrl_reset)) { mdelay(1); -- 2.39.5