patch 'net/axgbe: fix unreleased lock in I2C transfer' has been queued to stable release 19.11.11

christian.ehrhardt at canonical.com christian.ehrhardt at canonical.com
Tue Nov 30 17:33:43 CET 2021


Hi,

FYI, your patch has been queued to stable release 19.11.11

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before December 10th 2021. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/306226d765c0cba6f065f49761bcf9f0d37e4fc8

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From 306226d765c0cba6f065f49761bcf9f0d37e4fc8 Mon Sep 17 00:00:00 2001
From: Chengfeng Ye <cyeaa at connect.ust.hk>
Date: Thu, 26 Aug 2021 11:55:59 -0700
Subject: [PATCH] net/axgbe: fix unreleased lock in I2C transfer

[ upstream commit 30b4d95a29b1bf7e868d799952aa1fa1348d5e25 ]

The lock pdata->i2c_mutex is not released if the function return in
these two patched branches, which may lead to deadlock problem if
this lock is acquired again.

Bugzilla ID: 777
Fixes: 4ac7516b8b39 ("net/axgbe: add phy init and related APIs")

Signed-off-by: Chengfeng Ye <cyeaa at connect.ust.hk>
Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
---
 drivers/net/axgbe/axgbe_i2c.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/axgbe/axgbe_i2c.c b/drivers/net/axgbe/axgbe_i2c.c
index 204ec36798..1b6094d6f0 100644
--- a/drivers/net/axgbe/axgbe_i2c.c
+++ b/drivers/net/axgbe/axgbe_i2c.c
@@ -227,6 +227,7 @@ static int axgbe_i2c_xfer(struct axgbe_port *pdata, struct axgbe_i2c_op *op)
 	ret = axgbe_i2c_disable(pdata);
 	if (ret) {
 		PMD_DRV_LOG(ERR, "failed to disable i2c master\n");
+		pthread_mutex_unlock(&pdata->i2c_mutex);
 		return ret;
 	}
 
@@ -243,6 +244,7 @@ static int axgbe_i2c_xfer(struct axgbe_port *pdata, struct axgbe_i2c_op *op)
 	ret = axgbe_i2c_enable(pdata);
 	if (ret) {
 		PMD_DRV_LOG(ERR, "failed to enable i2c master\n");
+		pthread_mutex_unlock(&pdata->i2c_mutex);
 		return ret;
 	}
 
-- 
2.34.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-30 16:50:07.238735447 +0100
+++ 0019-net-axgbe-fix-unreleased-lock-in-I2C-transfer.patch	2021-11-30 16:50:05.558871827 +0100
@@ -1 +1 @@
-From 30b4d95a29b1bf7e868d799952aa1fa1348d5e25 Mon Sep 17 00:00:00 2001
+From 306226d765c0cba6f065f49761bcf9f0d37e4fc8 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 30b4d95a29b1bf7e868d799952aa1fa1348d5e25 ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -21 +22 @@
-index ab3738a12e..a2798f484e 100644
+index 204ec36798..1b6094d6f0 100644
@@ -24 +25 @@
-@@ -233,6 +233,7 @@ static int axgbe_i2c_xfer(struct axgbe_port *pdata, struct axgbe_i2c_op *op)
+@@ -227,6 +227,7 @@ static int axgbe_i2c_xfer(struct axgbe_port *pdata, struct axgbe_i2c_op *op)
@@ -32 +33 @@
-@@ -249,6 +250,7 @@ static int axgbe_i2c_xfer(struct axgbe_port *pdata, struct axgbe_i2c_op *op)
+@@ -243,6 +244,7 @@ static int axgbe_i2c_xfer(struct axgbe_port *pdata, struct axgbe_i2c_op *op)


More information about the stable mailing list