Skip to contentSkip to conversation

bus/fslmc: fix dpio close

PATCH Applied [email protected] 3 participants 3 messages Jul 28, 2020 – Oct 6, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bus/fslmc: fix dpio close

From: Rohit Raj <[email protected]>

The current state of the DPIO object should be checked before trying to close/disable the object.

Fixes 293c0ca94c36 ("bus/fslmc: support memory backed portals with QBMAN 5.0")
---
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +7 -2
index 97be76116..b0055b164 100644
@@ -528,8 +528,13 @@ dpaa2_create_dpio_device(int vdev_fd,
 
 err:
 	if (dpio_dev->dpio) {
-		dpio_disable(dpio_dev->dpio, CMD_PRI_LOW, dpio_dev->token);
-		dpio_close(dpio_dev->dpio, CMD_PRI_LOW,  dpio_dev->token);
+		if (dpio_dev->token) {
+			dpio_disable(dpio_dev->dpio, CMD_PRI_LOW,
+				     dpio_dev->token);
+			dpio_close(dpio_dev->dpio, CMD_PRI_LOW,
+				   dpio_dev->token);
+		}
+
 		rte_free(dpio_dev->eqresp);
 		rte_free(dpio_dev->dpio);
 	}
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 33 lines · On 28-Jul-20 9:54 PM, [email protected] wrote:

From: Rohit Raj <[email protected]>

The current state of the DPIO object should be checked before trying to close/disable the object.

Fixes 293c0ca94c36 ("bus/fslmc: support memory backed portals with QBMAN 5.0")
---
  drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 9 +++++++--
  1 file changed, 7 insertions(+), 2 deletions(-)
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +7 -2
index 97be76116..b0055b164 100644
@@ -528,8 +528,13 @@ dpaa2_create_dpio_device(int vdev_fd,
 
  err:
  	if (dpio_dev->dpio) {
-		dpio_disable(dpio_dev->dpio, CMD_PRI_LOW, dpio_dev->token);
-		dpio_close(dpio_dev->dpio, CMD_PRI_LOW,  dpio_dev->token);
+		if (dpio_dev->token) {
+			dpio_disable(dpio_dev->dpio, CMD_PRI_LOW,
+				     dpio_dev->token);
+			dpio_close(dpio_dev->dpio, CMD_PRI_LOW,
+				   dpio_dev->token);
+		}
+
  		rte_free(dpio_dev->eqresp);
  		rte_free(dpio_dev->dpio);
  	}
#2 lore raw

06/08/2020 16:32, Sachin Saxena (OSS):

Quoted 6 lines · On 28-Jul-20 9:54 PM, [email protected] wrote:
Quoted 5 lines

From: Rohit Raj <[email protected]>

The current state of the DPIO object should be checked before trying to close/disable the object.

Quoted 6 lines
Quoted 4 lines
Fixes 293c0ca94c36 ("bus/fslmc: support memory backed portals with QBMAN 5.0")

Applied, thanks