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 9E1BF45CF8; Wed, 13 Nov 2024 17:15:17 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2E1F040290; Wed, 13 Nov 2024 17:15:17 +0100 (CET) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2045.outbound.protection.outlook.com [40.107.20.45]) by mails.dpdk.org (Postfix) with ESMTP id BB5E84025E; Wed, 13 Nov 2024 17:15:15 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZS879vwxE95BGgG7bmtAZ9tggsTZwuNMLWZszLcHyGlwji7OkTRc3QL7uLjbwhXTem3rgLq14zT7p6hpdSk1q1W2lQ6jvOpG7sXDBhlgyqhEyFijvPneyLRDQtPalq5gvw0SLVzyyDs350Y/lHMXhWIH0/C2tvKMa9024EhGA0F3RObvrcTz6JBCaxHKXR7n06qLhoXZsPAbyFgu/ocvojsDvaXttslAQbDeMuvPH98gMY+sMg2PcfTLLhkzjZ5CpHpRBY6ymWtoUPCtyJHwxzkbYmpAaZl01/F09GwVZDoK7zUsdrQrr0ItSxXgP2vDbzAVvD1YMvrFx4dAQ8qtbA== 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=Trap39tFfDAl3cUHiv+jxTp+dFfHr7u6n3EYd4HRofY=; b=llkj4wU1n3efEHW0LPe3uwcMDQTnUeQ7VF9B1F5QN3c/aCJ1rrDoEHsH0xyi9MxIglWUzjXjGcaOUobETnTxOT9B6o+52726QA7/uqYaBz26UBS6AVKN6ZqIeHXOzhJ+c+Pj41cjkP6RK2eKMxI0da466m5pnOeTFbb0h6/MrRB0Q82fFZiarDG5AofzWZwwfO+s6JI9x5YQfWspu+3/AP1XZa/bwp+GtuTiagjtVXC/ukayhIq2yov3RQo/R2UGWDPrDnUsrDEWWe8aglAcbsBVJ1pnjt65VHw3VoCyBMdCk3oR0ng1y6++gzVnzz0MTwl0Bwvf9iU3rtra/O3eoA== 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=Trap39tFfDAl3cUHiv+jxTp+dFfHr7u6n3EYd4HRofY=; b=BzjUxMNBa+wc24J1mxhLp0zv8ij39n/Wh2rSOvq0U2GcH+SIP+BfZsG3Fs7lepNIsX+DOGnRWIBxLiXtWdSP2xuhDpNSFaLx/jFRRgFD179Qwj+D5C2v5cuAlykh4NG0dL3uzNO1ET81TWWA5E/dbpi7oLsZZL4kyytW5Xn9ARIkqlm8tSHalBIEocEOgEge3VShXNJH7F2wii9NFPL6kFC8wkrjqob7p03djm5t103tVN0yrmWMr250qQFpfGJeyz0yOQfDICXdkPLNM3t/CN7gzy08rXp7223CYDRaN1Wm9UWg2RduisJZoSbJ8J66Au0VGrpe0LjgpaLrOuWXGg== 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 AM8PR04MB7921.eurprd04.prod.outlook.com (2603:10a6:20b:247::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.17; Wed, 13 Nov 2024 16:15:14 +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; Wed, 13 Nov 2024 16:15:14 +0000 From: Hemant Agrawal To: thomas@monjalon.net, dev@dpdk.org Cc: stephen@networkplumber.org, stable@dpdk.org Subject: [PATCH 1/2] bus/dpaa: fix lock condition during error handling Date: Wed, 13 Nov 2024 21:44:54 +0530 Message-Id: <20241113161455.2649551-1-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0019.apcprd02.prod.outlook.com (2603:1096:3:17::31) To PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9328:EE_|AM8PR04MB7921:EE_ X-MS-Office365-Filtering-Correlation-Id: 91c7c155-c689-4c11-792a-08dd03fe5af4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|52116014|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?8A2gDpWe9Z9K4EgqEcI0mAx7mZLux7ruZsStLCxWo2wrvh411tdHdPsA/rcv?= =?us-ascii?Q?0e5Rf5F9dqyP2kaQ1s5nohJszXOG9Oc6R82vz1wJibmiQmZbh7Buz2WGyVey?= =?us-ascii?Q?3fXHW7Y4y/nTJ6wj3J+OGDi5rmUSCz6vRpunuPWAIETNKGVD3NYbEHfF/ZtE?= =?us-ascii?Q?DWju+G5yLFwPr/GyjPepeF7apbr4aOT+UMFz9BMAkceuhFeruZBeBk9NFXX5?= =?us-ascii?Q?n9v9GmqA+hKedQkYz6f1G4UlkkT+F2jmo7UnU/VqA2lOZcGctMTV+r0ZNfcH?= =?us-ascii?Q?vFGjctG5WIHUp1eUad09Y/eWGyhaTvqJagN3ouDyB6lLeGDrtV8i0r4epN5q?= =?us-ascii?Q?dM/wtoHJZ4MKbx+KpgBMagEneZ8QkYxKWE1z4hqJn/Bfe2mJq//HRQiH5Kff?= =?us-ascii?Q?IUc7/FxCcsqNyFMLfQ2NHaB1OYzgRo4gdls5/Iyu9Xu8g/efGDN3TTikkEnM?= =?us-ascii?Q?M82KZsOs/e+MclsEi0iH+m5yyZknG6OzCZySEHhQBABOvyH1mpGrtmch1Gtg?= =?us-ascii?Q?5fSafvpSmUI4VkG/by681i644lgM4ZQXAzTjwtLcB5hHmwlH4DiLbP3WORxw?= =?us-ascii?Q?XOcgEkY0SeBSaTIXBVUyjscznB0UckmH9cz13og2v1R6GloNimHaosYG4Ro5?= =?us-ascii?Q?ZWihCsywGNIg2x0toIlJEPLzY/CH3vC/NUONsw/GShDM5gc5oc6o1jjyufgW?= =?us-ascii?Q?j9B7nUykjXOHc/Rwl6MBNPW/WtZbt6Eua2C6hUDpDjz+SgziJ732TMiDxYpS?= =?us-ascii?Q?zJ7wTgWlevFVIyZnxdUWBHH7BoYzcTG+uELV2c7QClaWbJOLAnLUSx/93nZP?= =?us-ascii?Q?inAnFSl1UK0H7UWdhvwrGnNcnoVo5W1ylnIxQZpLimbjKiyGLMEVSVuJhN46?= =?us-ascii?Q?UgEOJeMX7mqRx+1C3kxc9jpL8LK+Qbb+S3GJGv4vb7Bf9hrji+n56XHetkQ9?= =?us-ascii?Q?d2958py4uIVttsyc2R95NlzanvX5+R9IwvC5stCaneh6wruxbNDOvBTtu0nE?= =?us-ascii?Q?fV4OexVtuoruknAjWQ7194jXHh4e6smSvrD/haIoQTm248AmI906zy1p095K?= =?us-ascii?Q?ezXOYiNoxWOIHdedERcnHlwdC+G79tZny6PgnntoAkT/5Yn9KEuf5Tcl7yXI?= =?us-ascii?Q?3I5W2Zi/sRkGwaxaqv2mCd+F6jeWwgIyi83ihlh/kgUgikrC8JTncywKCVqD?= =?us-ascii?Q?Tj/vPeEaH6bShP8sew7IqrFp/PxI2JLjMnr1nwAB28YNrKI20SXb8kecgrkF?= =?us-ascii?Q?e7ScXvlIJWimQoB0JRtsH9hUsj7wz3u8bn1hvUcNbv2T5F3C993EFsW5xM+V?= =?us-ascii?Q?l75id9RlVkUJWwuh76RX2OXI3R2VzGrMe6vAL9osxpbn8pJA6y/lSdEd5ZQ2?= =?us-ascii?Q?WZSx3Uc=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)(366016)(52116014)(376014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?4O1fKXHhrVxrK7MYlFMc6GuRg5Z1UuUrxArpniIE6CsudoEfWotc2KWtSnbS?= =?us-ascii?Q?sr+/i07N4GMpDtiRz7GbJFbTuy5QGiQs7EdVZ6S92zLqB/nihYqI4T7USDU1?= =?us-ascii?Q?IwmLdQq8ppocekGA0+Pe2FFJCAiAEtT0XJ82Q3Z0M9nlhLr5+5lTrscvy/Gh?= =?us-ascii?Q?3V6SOhkz8t6U54of4QrcXlokj2dgu5A6b8Z8LgtOuAqaFKGObOd/SM6gQlqQ?= =?us-ascii?Q?xNkPQzcljWulhuB0z//vAGbfy6MBE9Bc3ais2Mjh0piryrtOQHdY4jwqeFxI?= =?us-ascii?Q?laeKKra8ni+dh5+yJ3P+XJXeWx48PbRncMh2W0k5Ih8w4l3lmCFb9QRD97bX?= =?us-ascii?Q?KRRgpiwWqw2T8IqnsiNK0+XdbiR2yQ/1xYC3Ym8dOZy0XlC4NuYO9yekzn+6?= =?us-ascii?Q?lIK9kLJdr6Wq9dRkrU2eDQKB2f7p/C3guGxQGCD0mSU6mZQjiQWa4XN9ez4L?= =?us-ascii?Q?yRKZpLKoIOsBEOMyjOnBZU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?PPpJE4PeiZJ9c9lJbhKBFovVD7XPV/Fli16WZS2pCtz+6kyu6JayOgCTPvYZ?= =?us-ascii?Q?SR4ad1ZbJL0ek3+N/Mx3dnYRVvkztMq2SacYtK6/053jBxy5g5m/Q2eiPKst?= =?us-ascii?Q?MdTWu98p0WFQJimpihiJ3Ryu6Hb+5GNqas54paB948AvszW9jAR+F8xwRCgL?= =?us-ascii?Q?hFfnWLb0PbbB4y0ps+qvepIcsjJepRp9ple4YBsNW0FT7XrcEb40yGjDnQrT?= =?us-ascii?Q?JA=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 91c7c155-c689-4c11-792a-08dd03fe5af4 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9328.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2024 16:15:14.2286 (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: /A1ER9KWx/iKytZNOHGgzsxXozzLrHX8h9mOzJ6sJE+uR5eiuy793612rxNGjndzNsXUesqljF1KabDnac0OjA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7921 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 pvr-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