-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
linux-iot2050: Add two fixes for icssg-prueth
Minor ones, just affecting the error paths, but who knows. Signed-off-by: Jan Kiszka <[email protected]>
- Loading branch information
1 parent
96acfeb
commit e15fe5a
Showing
10 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
...l/linux/files/patches-6.1/0068-net-ti-icssg-prueth-Add-missing-icss_iep_put-to-erro.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Jan Kiszka <[email protected]> | ||
Date: Thu, 2 Nov 2023 16:54:32 +0100 | ||
Subject: [PATCH] net: ti: icssg-prueth: Add missing icss_iep_put to error path | ||
|
||
Analogously to prueth_remove, just also taking care for NULL'ing the | ||
iep pointers. | ||
|
||
Fixes: 186734c15886 ("net: ti: icssg-prueth: add packet timestamping and ptp support") | ||
Fixes: 443a2367ba3c ("net: ti: icssg-prueth: am65x SR2.0 add 10M full duplex support") | ||
Signed-off-by: Jan Kiszka <[email protected]> | ||
--- | ||
drivers/net/ethernet/ti/icssg/icssg_prueth.c | 11 +++++++---- | ||
1 file changed, 7 insertions(+), 4 deletions(-) | ||
|
||
diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.c b/drivers/net/ethernet/ti/icssg/icssg_prueth.c | ||
index 3557749322df..fb445823b434 100644 | ||
--- a/drivers/net/ethernet/ti/icssg/icssg_prueth.c | ||
+++ b/drivers/net/ethernet/ti/icssg/icssg_prueth.c | ||
@@ -2112,10 +2112,7 @@ static int prueth_probe(struct platform_device *pdev) | ||
prueth->iep1 = icss_iep_get_idx(np, 1); | ||
if (IS_ERR(prueth->iep1)) { | ||
ret = dev_err_probe(dev, PTR_ERR(prueth->iep1), "iep1 get failed\n"); | ||
- icss_iep_put(prueth->iep0); | ||
- prueth->iep0 = NULL; | ||
- prueth->iep1 = NULL; | ||
- goto free_pool; | ||
+ goto put_iep0; | ||
} | ||
|
||
if (prueth->pdata.quirk_10m_link_issue) { | ||
@@ -2212,6 +2209,12 @@ static int prueth_probe(struct platform_device *pdev) | ||
exit_iep: | ||
if (prueth->pdata.quirk_10m_link_issue) | ||
icss_iep_exit_fw(prueth->iep1); | ||
+ icss_iep_put(prueth->iep1); | ||
+ | ||
+put_iep0: | ||
+ icss_iep_put(prueth->iep0); | ||
+ prueth->iep0 = NULL; | ||
+ prueth->iep1 = NULL; | ||
|
||
free_pool: | ||
gen_pool_free(prueth->sram_pool, |
37 changes: 37 additions & 0 deletions
37
...l/linux/files/patches-6.1/0069-net-ti-icssg-prueth-Fix-error-cleanup-on-failing-pru.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Jan Kiszka <[email protected]> | ||
Date: Fri, 3 Nov 2023 10:09:50 +0100 | ||
Subject: [PATCH] net: ti: icssg-prueth: Fix error cleanup on failing | ||
pruss_request_mem_region | ||
|
||
We were just continuing in this case, surely not desired. | ||
|
||
Fixes: 128d5874c082 ("net: ti: icssg-prueth: Add ICSSG ethernet driver") | ||
Signed-off-by: Jan Kiszka <[email protected]> | ||
[Taken from https://lore.kernel.org/lkml/[email protected]/] | ||
--- | ||
drivers/net/ethernet/ti/icssg/icssg_prueth.c | 4 +++- | ||
1 file changed, 3 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.c b/drivers/net/ethernet/ti/icssg/icssg_prueth.c | ||
index fb445823b434..2b22e98dd677 100644 | ||
--- a/drivers/net/ethernet/ti/icssg/icssg_prueth.c | ||
+++ b/drivers/net/ethernet/ti/icssg/icssg_prueth.c | ||
@@ -2070,7 +2070,7 @@ static int prueth_probe(struct platform_device *pdev) | ||
&prueth->shram); | ||
if (ret) { | ||
dev_err(dev, "unable to get PRUSS SHRD RAM2: %d\n", ret); | ||
- pruss_put(prueth->pruss); | ||
+ goto put_pruss; | ||
} | ||
|
||
prueth->sram_pool = of_gen_pool_get(np, "sram", 0); | ||
@@ -2222,6 +2222,8 @@ static int prueth_probe(struct platform_device *pdev) | ||
|
||
put_mem: | ||
pruss_release_mem_region(prueth->pruss, &prueth->shram); | ||
+ | ||
+put_pruss: | ||
pruss_put(prueth->pruss); | ||
|
||
put_cores: |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.