From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4329945D01; Thu, 14 Nov 2024 08:44:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2C71842D76; Thu, 14 Nov 2024 08:44:56 +0100 (CET) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2070.outbound.protection.outlook.com [40.107.22.70]) by mails.dpdk.org (Postfix) with ESMTP id 05F40400D5; Thu, 14 Nov 2024 08:44:55 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QvqKMZE6PDDQk8RTz0FQv+towBJBrgrLGmPNDdlrDZOuSNP/if3jIJ2G4jdwANCD6ANnun/dpIaYxzMKS8cuFyU9S3ma54+r/431npIqEohNJ4+D37TvDrOTKKYItKttdpmFfJKsDf9N4fM3iFNW+6URcwzfdHF99z/OqMaDdlE4Z+agdqwm8d2wL17hN1WA9Bq5ftLfib8Ef7Ls/Ux84efrOnl395uDWkVOkMS2l2n1R5WsZVTT+I0H99LTfU+rHZmqd2P781WGmUlf7R2+ub4nOmyF454BYxlj3Vj/2WkcIQP5rqjz5R5rBgIjiSj8ytk7v1EBF/IEjX7JBtjAEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cUNx4u9c7my9DKMq4F6bwz6wO6EmFdw/KspzSkjD0U8=; b=CMfafTa7ViVMqOK2anlR2pDvtbXLB3grzr8CQXcB8PFHST7aSqWus95JOyGNYui28rYZEDI65BZBnQGD/sd4GEERBLg2CVvnFxJ92DtHnCB2C09lRpaKsHDqo3G3O9h+I7OWN+xz559hxm9llmNHcOM4Ky8p6MChjhwJduQRM5w2Q3TSlhcrkpjxbvIlD9X4Vkcoc6HV5rbAqWuoWw/R4zPLD8TCaRTTxb81Ld+n5kLevFSRqcg2QfgXdZxhHIMiV+XRhYXuW9kGeTQyTj4wLIAqvLw00zGNz2a37o0NYWQ6qvca0wd4n1uJNpgCjsg2T673nfV9ZPRjYePPF4GuRg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cUNx4u9c7my9DKMq4F6bwz6wO6EmFdw/KspzSkjD0U8=; b=L1BAgkUTypvuFDNbrkUCCnNmovBwNylLujFKi0h3DiYNAi36v+RUVijcT/ot8Iqf35BMEFmLIAydMU10pgKlfUOHECpcUXSWxh6ZnhQIpL1AHcI8Qo9h2x0hB/En/BsXho/Cj6bx88UF5ZC5qJsBjpUn0NnEGy0Gq1ERQuOBAOKQe4IaZDWqT9s5nNrhfZvWCkknqOM4hCBDpihi4e7pVet4SCE2+njq4eiqbC8oDeEPWZVRdoJjkI9f+J7Ob3CUZzvA4tE0BlWAQVFf0Rt7mFxyBsXm8gAksxdFKHBTm5wt9rdbT4nSJVjrDwWFPRRNHcLo2pAcvQbTWUFlR9l0bQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) by GVXPR04MB10708.eurprd04.prod.outlook.com (2603:10a6:150:225::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.17; Thu, 14 Nov 2024 07:44:53 +0000 Received: from PAXPR04MB9328.eurprd04.prod.outlook.com ([fe80::367:d59:375:fb87]) by PAXPR04MB9328.eurprd04.prod.outlook.com ([fe80::367:d59:375:fb87%4]) with mapi id 15.20.8137.027; Thu, 14 Nov 2024 07:44:52 +0000 From: Hemant Agrawal To: thomas@monjalon.net, dev@dpdk.org, david.marchand@redhat.com Cc: stephen@networkplumber.org, stable@dpdk.org Subject: [PATCH v2 1/3] bus/dpaa: fix lock condition during error handling Date: Thu, 14 Nov 2024 13:14:35 +0530 Message-Id: <20241114074437.2943885-1-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241113161455.2649551-1-hemant.agrawal@nxp.com> References: <20241113161455.2649551-1-hemant.agrawal@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR02CA0007.apcprd02.prod.outlook.com (2603:1096:4:194::23) To PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9328:EE_|GVXPR04MB10708:EE_ X-MS-Office365-Filtering-Correlation-Id: a3deb61d-a3c8-417e-1ed5-08dd048039a2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?9ukd2mRTIM/81uX42sA3yiOvSf/gLW4mc16zMoRXaCfuBGHUrkQRE2/mej1U?= =?us-ascii?Q?LCH5EYip3ej3c3xU753Cdwod4F5qL8eUFlS+1j92Qrz7toZsYAZ7W0vxhhNl?= =?us-ascii?Q?fiPAVjzQDnDxV/Mc/JckwJATrEcxH1+cAfw1thgpPZB9aIStDWSSG8iFciY3?= =?us-ascii?Q?dED3g3mhaYLWkyZK0HKA1PQH+EehzPlS42SiPiowwp1PHT+AN7qUtMjmdxzj?= =?us-ascii?Q?VFZeKlZi0o5P98Icv/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s8p?= =?us-ascii?Q?CNCjvVYiBje03gIKEHtNz8b89mwRCfWL5QyAX/hnCsWapuViuMEIhsfXrdoh?= =?us-ascii?Q?XAgViF42FfFX/zmS1HOnMaxBo+OrouQcWsbmWZVcbYqWCC2UTItA8otjCOwO?= =?us-ascii?Q?U16TsqoUPBWyn0aq9J1B//RGLFQsWQLoGdypUsxKyYVECsKpkmF/EtJIrG7z?= =?us-ascii?Q?VTayZH1B1vTJAQ564bl6p1MEVvDgAd0dmw93Wb3gFraB/brhfQqKtwoeFgBB?= =?us-ascii?Q?fMriNZE=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB9328.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(52116014)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?d/svwCzCQ7Oe/GfEMbkPg+7gsyr83o3kV96/rmqySGEDf94huzbxoQoAE/eR?= =?us-ascii?Q?w2Q4fJgkL5OXyyK0xX0dR6fpjch9NZ0xI6ux46d8+NwIV1DbacVlSYPTWpBr?= =?us-ascii?Q?Fs0/ydS+wn/49CHMbFAidfzcrCgzplv9CgclQqSyiH7IaU/ATxSzyPsI7KsL?= =?us-ascii?Q?nAxHXD7YHZfSmJ+EbazbRYqGh2jZ3pIwJ7ipz1Jp4W1eBa0kSZ85I1WizQ+K?= =?us-ascii?Q?VlAQKJZAkNXudswxZdO5I45tDD14FUsti0bn2wq6VQslDigs3rp/8dsKfncb?= =?us-ascii?Q?m9NzZNcNpEtEB3X+KYa6H6Gwp056HwCnFdHngXONyr8EXzhEfYcNbUItmCGP?= =?us-ascii?Q?gRF+NmxZ2rsszhhid+AFzbxjMQvTVEI1V0WWNsn3CsHgLPSfOnk64F830wwl?= =?us-ascii?Q?49m2cPngMnR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?Q?OKPObjBPwr7Hrbgoh8eWGoeuyAzvURtOkTbo+6NkgeOsN4+RBZ+hwPBHytq0?= =?us-ascii?Q?cdJlB27EGrPhH0au017jWVAf0ZueWgKdNa5DmIEVl+OQJ6pEydtte5Lcbl75?= =?us-ascii?Q?YC7RvNft8TGovAQgVJLa77JvqoYdwUzs4oRFIDFx0IfWlSi6xFBEIEWcAi7i?= =?us-ascii?Q?pF7qFVKATsK9OQW8TkcJTfi+Izsr8fnr9/5w7GkFq/J3WW4JyIJOqkNfLs8g?= =?us-ascii?Q?hRcjF6pvfli7XNpJCxNGmXoKLoYKEXiqoQO/qoSfdwJ5DJXfx1z7n7br1ozE?= =?us-ascii?Q?aw=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a3deb61d-a3c8-417e-1ed5-08dd048039a2 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9328.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2024 07:44:52.9101 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HGi/7KfCPP2reg6fOm5dF9p474ihZa0WgEKWUyGY8sB5MwuCE+z9rxm4i4mWV4VC5eizJBD8TRRaNB5IRIdHbg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB10708 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The error handling is missing FQ unlock code. Detected by pvs-studio Bug 89-93: very suspicious synchronization The analyzer issued a pack of V1020 warnings that a resource might remain blocked. Fixes: c47ff048b99a ("bus/dpaa: add QMAN driver core routines") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal --- drivers/bus/dpaa/base/qbman/qman.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index 9c90ee25a6..c48fa3e073 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -2138,8 +2138,10 @@ int qman_set_vdq(struct qman_fq *fq, u16 num, uint32_t vdqcr_flags) if (!p->vdqcr_owned) { FQLOCK(fq); - if (fq_isset(fq, QMAN_FQ_STATE_VDQCR)) + if (fq_isset(fq, QMAN_FQ_STATE_VDQCR)) { + FQUNLOCK(fq); goto escape; + } fq_set(fq, QMAN_FQ_STATE_VDQCR); FQUNLOCK(fq); p->vdqcr_owned = fq; @@ -2172,8 +2174,10 @@ int qman_volatile_dequeue(struct qman_fq *fq, u32 flags __maybe_unused, if (!p->vdqcr_owned) { FQLOCK(fq); - if (fq_isset(fq, QMAN_FQ_STATE_VDQCR)) + if (fq_isset(fq, QMAN_FQ_STATE_VDQCR)) { + FQUNLOCK(fq); goto escape; + } fq_set(fq, QMAN_FQ_STATE_VDQCR); FQUNLOCK(fq); p->vdqcr_owned = fq; -- 2.25.1