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 49F501607AA; Mon, 6 Jan 2025 15:42:39 +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=1736178159; cv=none; b=IdUvTnKdWUTBm2TjxcYZn+2Cix4k3BUyzJ9DUUmTZXDrkJo5PlcQyeDv7NVspHKtQXkz/23F90oCA8WJ/Ih17NvqV1PF8D3o5riKyKZ24tUXJTX6JFN1kSwPu5Z65/DUIIM4qdejr9jmwnmBzI5H4cx9Mye6HUg92l5j3pyIBO0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736178159; c=relaxed/simple; bh=SjYFVGVoMx1ky94z2kOaCpbHewG3Xg6I+lgTkvsJ6mo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cjuGhWGIBk1L2meJNUz3+1F9GA651Lkg4DZ6v7tQ82kMhJCpYZxQoxk3bckl9VB5jFDoyY4IhMHL1MpoGwSKHbmle/k0NhVdUMYwt3wrSNfPm6FQKiyzmjocLW6bvxKT+VmTlDZ/DuecdhFhPZCosUPHS7je29Ssm5xPixCuFGg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=K7zc2QTb; 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="K7zc2QTb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB67FC4CED2; Mon, 6 Jan 2025 15:42:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1736178159; bh=SjYFVGVoMx1ky94z2kOaCpbHewG3Xg6I+lgTkvsJ6mo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K7zc2QTbL/XlA0fMBDjjwWJCV35S0ZcCF47q/9P4eEKEd1sT+l0hpUD4LgQ7VOfGX dbFM2EZ/uqq+z074oA/pZcoIWrLOwgIRhY2VlIRTRpD/buspCJkzdAN9kn/x7T855B F8PGWSOITf1SSdAYWUp7npRC/xE6Zh2tV1UTe1l0= 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.10 009/138] i2c: pnx: Fix timeout in wait functions Date: Mon, 6 Jan 2025 16:15:33 +0100 Message-ID: <20250106151133.569427341@linuxfoundation.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250106151133.209718681@linuxfoundation.org> References: <20250106151133.209718681@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-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 b6b5a65efcbb..5ff9218b4a62 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