From patchwork Mon Jan 8 16:19:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13513700 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2B404C3DA6E for ; Mon, 8 Jan 2024 16:20:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=HIkdc3W1CcqbstUVVZbdcrtxmYmDlCEUZP0KQCwLs9o=; b=TpiIYRQ6NZFMfr H8cb8o7g7aK0pBE5jINoitElnWiP3VxVdqn/ezfEyww+v3ai3N9Bn7/xzXtrObsQnR3l8csT0c3Ou +DCdrHhG2KegyAQ5C5KDYm28kistI0d3B5TuJ5BIOktuXURSGlEwSgKGJHROrqWPaOTiANUXvaolF Y5x93Pw8xZpzDbcj1aby9TDwMzmjhy0Bmv+si2B+nkL1eQlXGR7wGaGjFzzCp9Q46GBIIdC35ZnLF JcO7dcvYPSYvYKYI1emYPTKkK+cNOpXctMVmFG4VTf+KVR1RuWVRR4UtyOUnoUP0d+49JqQYAUMB5 sBU9+xUUNYsYARCGKZew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rMsLq-005c9v-1m; Mon, 08 Jan 2024 16:19:46 +0000 Received: from mail-am6eur05on20601.outbound.protection.outlook.com ([2a01:111:f403:2612::601] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rMsLn-005c8q-1G for linux-arm-kernel@lists.infradead.org; Mon, 08 Jan 2024 16:19:45 +0000 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=jPrbxWBMn2XZF9rcOISR2x62yae90lSWXZo5cZvGgJC+JaWBM5aT9yPGhA0v/gPaPzvDtKjkOOyf/y+1xrp3DMW4huJ+0SpMTDEgOnwz5BzjS+qO81nXunxiEPM6IptXVb1c6Hc5iY3KJ+4gIBItyN+KBuUftiTstVNsnNebjbgV7kkjM8cO1uqhHsL2Ea8DMEO5ULWOdJ5Yk6HDdZPin4poZ+EPKPntl9CUjA6meuauouwMdEWgi0zeLN0fcadz/xsbTwOmWBjBDym0bcAd8T/pwFINJMNRK2xmUqnbzurLqXpBHozRQjpwLwXBIP3rFap7N8hb7Cm6DF72XuxdxA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=pixmnLbXNbip/EXeeU9LFdbGucmjLJZZ99g/BvzipEc=; b=MElIpvU7J+7+tKsxINiWdjhv148V/NMWbxHevj1ob0Q+V3tgInY+j4sK+zMAsG6flSMskw/crzXdsYJyCYpvvnpg6RZMFF52flFA8wveKyNzx9WfGHSXCryFDzxFvrAdB+T8NF1wkmxEqc5BKjEOLsSZtPHTPIDJ0nnqNG6E9qK37lZ25LARWjqYOTS/8c6dM6+2l2gL3zjugIwKKjibDdak8hS8mnX1XI9dQNDqeI7vycrSJkWdBeeUixWJljZPNYw//3/JdmdgCF5l/K4CEzCGLpjicfBuLPB79dhe5Cr+NwM7m80zgAYX9GIYvnJSv3MdAxmoHolpxsNGWYu16Q== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 20.160.56.81) smtp.rcpttodomain=buserror.net smtp.mailfrom=seco.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=seco.com; dkim=pass (signature was verified) header.d=seco.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=seco.com] dkim=[1,1,header.d=seco.com] dmarc=[1,1,header.from=seco.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pixmnLbXNbip/EXeeU9LFdbGucmjLJZZ99g/BvzipEc=; b=YADa23rurcan3RJ/VGSL+zSXRbwY/WqzYQ6BHuwdq2pKd2mjeQoliFrzdJfSeGJ5DmaYK7lg0aA29bOUcJ4PUFaG/jzWXiZkAXDO1/bnjlL/dgyNfqkaTUxdxdVKm0VhIp+jWvAwcLqeMxFd9/SeS39JmqaC30NFLOv7kooCxZRh/iJS2WHTv5RuFauIjR14LVGipmUa2Jo3qIrsCfs1BPQCFBaLSAio416gVWsLlx8rohRi4qvtGhRVIb5a+Z5gihtE3vgBpgX1fWuFohlRw4m2Ik3T9FLsQqRSTwUy3nCoXNfVoCrynAZMY43dCcHzUMzIST7/7QAmtgobLeHw8w== Received: from FR0P281CA0110.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a8::6) by GV2PR03MB8679.eurprd03.prod.outlook.com (2603:10a6:150:7a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21; Mon, 8 Jan 2024 16:19:30 +0000 Received: from VI1EUR05FT049.eop-eur05.prod.protection.outlook.com (2603:10a6:d10:a8:cafe::d8) by FR0P281CA0110.outlook.office365.com (2603:10a6:d10:a8::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.14 via Frontend Transport; Mon, 8 Jan 2024 16:19:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 20.160.56.81) smtp.mailfrom=seco.com; dkim=pass (signature was verified) header.d=seco.com;dmarc=pass action=none header.from=seco.com; Received-SPF: Pass (protection.outlook.com: domain of seco.com designates 20.160.56.81 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.81; helo=repost-eu.tmcas.trendmicro.com; pr=C Received: from repost-eu.tmcas.trendmicro.com (20.160.56.81) by VI1EUR05FT049.mail.protection.outlook.com (10.233.242.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.32 via Frontend Transport; Mon, 8 Jan 2024 16:19:30 +0000 Received: from outmta (unknown [192.168.82.135]) by repost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id F14792008009D; Mon, 8 Jan 2024 16:19:29 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (unknown [104.47.17.104]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id ABC0A20080073; Mon, 8 Jan 2024 16:19:27 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VtsT80xnI5ZKXUSIilSzJUynNOwldaP/oW3B2YxdZ0Gc8KcmPUGbOm2zF8Io/K8BAYVMZaNYpVJB3XZICqqHKbmnkMd6h5v9EbWiMEp2175wwdhmh062HL8BcOqMmmpyXNND8X0J9CbNrzF0BMKhanBtvW53wKQKJkTQy4TvNSUhrKRkHmLCU0NrSYWPfycBr0HZzgvqzmTskKJTES0nsr0BNh63kI6IvWsBd+fmsi7zh+EdrFVisn2zAD8UkpJWqsEu+y9clllHd1Dgo9xIAOR302JCpTSupOOsZjV/ULOQPfIoFZKouh1KNnhUxqt6PT2ivZKCAa9F4MszyfiMIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=pixmnLbXNbip/EXeeU9LFdbGucmjLJZZ99g/BvzipEc=; b=jTyy3gwjvWvbE1hOuP8+B5ssEcU+9PGlZD25Z5+FxvLkER+X6KiFABuOQLBsMTw2DiQBh3gt7jImcXM8CykDduMxiCiLuUOIYsyAm7OMRT2wCipQOzYps3be1WNhqVTdrp13/If734KWDdeA93oUemV76ya/th7KN6X/MtEYLtxFHWe2TeTp4tFWSS4mit5dULpyxsoy1IW2RqaAli+SCic4k3tzfeMM7hWipELo7aPazsDMESAC6jDEDN0EFXLY/b9eV8EYTOYIkpIFkCxoSmAqDatIW8i8y5SJKHFNByjfFxcyWrU1DCBhLfFzMoiI3kAbXojeFr9aGGEFWserOA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pixmnLbXNbip/EXeeU9LFdbGucmjLJZZ99g/BvzipEc=; b=YADa23rurcan3RJ/VGSL+zSXRbwY/WqzYQ6BHuwdq2pKd2mjeQoliFrzdJfSeGJ5DmaYK7lg0aA29bOUcJ4PUFaG/jzWXiZkAXDO1/bnjlL/dgyNfqkaTUxdxdVKm0VhIp+jWvAwcLqeMxFd9/SeS39JmqaC30NFLOv7kooCxZRh/iJS2WHTv5RuFauIjR14LVGipmUa2Jo3qIrsCfs1BPQCFBaLSAio416gVWsLlx8rohRi4qvtGhRVIb5a+Z5gihtE3vgBpgX1fWuFohlRw4m2Ik3T9FLsQqRSTwUy3nCoXNfVoCrynAZMY43dCcHzUMzIST7/7QAmtgobLeHw8w== Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) by PAWPR03MB9858.eurprd03.prod.outlook.com (2603:10a6:102:2e3::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21; Mon, 8 Jan 2024 16:19:25 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::5cfa:9e05:d8dc:ba0f]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::5cfa:9e05:d8dc:ba0f%7]) with mapi id 15.20.7159.020; Mon, 8 Jan 2024 16:19:25 +0000 From: Sean Anderson To: Li Yang , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Cc: Roy Pledge , Camelia Groza , "David S . Miller" , Claudiu Manoil , linux-kernel@vger.kernel.org, Scott Wood , Steffen Trumtrar , stable@vger.kernel.org, Vladimir Oltean , Sean Anderson Subject: [PATCH v4 1/2] soc: fsl: qbman: Always disable interrupts when taking cgr_lock Date: Mon, 8 Jan 2024 11:19:03 -0500 Message-Id: <20240108161904.2865093-1-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty X-ClientProxiedBy: BL1P222CA0022.NAMP222.PROD.OUTLOOK.COM (2603:10b6:208:2c7::27) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|PAWPR03MB9858:EE_|VI1EUR05FT049:EE_|GV2PR03MB8679:EE_ X-MS-Office365-Filtering-Correlation-Id: f1e9c52f-f69f-4de3-1d03-08dc106597bb X-TrendMicro-CAS-OUT-LOOP-IDENTIFIER: 656f966764b7fb185830381c646b41a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: HrGX7/LAASLMhDD55CMV/MRC1j+/NKDYjOaQqswu7CwePZhvnFzgVFCzhXCewEuoWlSF1G9eZB/f2Y0OF9a5r1em9qa5yu2D9vgnYpOYulwY808AvJ5Q36fi8U9fJidr6MPAJbHrjRF8Yg7L5X+zreUYMFo3v5lKvY5+aK63fvBLa7zJNTvsOGd7f8Yr5DU4CPYqhX3Px2Nc+ca40ijvfe5KyLrpuPjt6FSafKuRsnOFQZ2uUwk032iZ/T/Yd1/znOBfovoFFcKiloJnR6+HQxu08vSg01pvLfWo2NQ45Ss94zC6vGmKsAKqXAoNS0VPT+H7b5o1yKl0Y5Dy0In+2pkgmNeAYtbabiFJLfm7jCUS2El3hIPvv+VY1/2YiY2nL75xvPfDENvWuz1hASG1c1UoX1lrKQhGZ9e5L5MbiYqtGmcoKyieh7zKhXLrwr4YSLIRjYGYmAProuKDZTGwhwAwCWIiceVTIcyGxplKqHKelKOtpFHjHEQ6a1VXqgIXLHT4rmoVz8oiO7b17wDIMk5uEANC4Azq5OW/I3ShOMz+rc+D2V8w/xXWqKIGBj1sKtFi+ivp0NKO0PgKl2ChQlsgQLx30mVHdDvGXb1oZWv2FO2lEupEEsKS0wpjgl6d X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR03MB8847.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39850400004)(136003)(396003)(366004)(346002)(376002)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(6666004)(2616005)(26005)(1076003)(52116002)(478600001)(6486002)(6506007)(6512007)(83380400001)(66476007)(107886003)(5660300002)(2906002)(41300700001)(7416002)(316002)(66556008)(54906003)(8676002)(4326008)(44832011)(8936002)(66946007)(38350700005)(38100700002)(36756003)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR03MB9858 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR05FT049.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 8602ca66-4b72-4fb2-b014-08dc10659487 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lSVlmRzTL8OoTo6yVVodfNjK2rQfvx8e0KfAXbqc4E6RvyQ5+ydD+nQjyQ5sOLM/89hDhoYN96JgfuK328KpXFbOvwjGiB9ZKbYN1wmv9q7xPuKGW5GBZ0tpvCWMfFd+QykVB3ZpEJ2ycsc84egS5Sy3nEBqAs3AHMRBTfV1aV9ff05z1q3iAx5mgLllbDiSlbz/8Q946zz6w41cGvzAe7OhjT/hEqoxZ3wGQC2SKX3+SrAOK2zohw7V4yLeH6Po4hZ/cCO5tRtOWFJkxXrC8aBn2VAJfaktUYgCnfBBg16oOvHsFCYvMwafvuHyLVCv6MLcZumyJUabAGqnEQ8/3pfrAOAbW2tIWndWF/pVjRQlnCALZ0EKwmHEqTEsyr3tkUvelsMvYn8TN1Padq6P3a8u/pAVRGW7JmQBIJaccLxav5QCPChf2MQB0sy7kGVVIoMExl2LJyuYcFyvT7eLbccd5Qp/rYasAdrlR0Ym7iRyjKi6vcRjC4RgAQBudljYXsaIqZ/2UHIVjmqEc3ckNfuU29pf13B5Q1o4a7GMMtd78md3qWThnv51q2bIaSj6KHinys8xswZrteVhomJNk0trZCp+itvpzw44123e4uipuiBjv/VQl8paDYSG55BbUMWYodQ86b9B7BSkQspxMjHX569NadV8QNCivDTBWQnQOT1H2viZ+j4r6/X3U2xVS+Gpv83I2kp73AGPORtMynFW1NnwyV3WzfbAxGQjOjNMmi3B1e5r52BHCjUg2/UNdK0Ombp0FCoTkUU67wg7ZA== X-Forefront-Antispam-Report: CIP:20.160.56.81;CTRY:NL;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:repost-eu.tmcas.trendmicro.com;PTR:repost-eu.tmcas.trendmicro.com;CAT:NONE;SFS:(13230031)(136003)(39850400004)(376002)(346002)(396003)(230922051799003)(82310400011)(186009)(64100799003)(451199024)(1800799012)(36840700001)(46966006)(40470700004)(40480700001)(40460700003)(6506007)(1076003)(2616005)(336012)(47076005)(6666004)(6512007)(478600001)(26005)(6486002)(34070700002)(86362001)(82740400003)(356005)(36756003)(7596003)(7636003)(7416002)(41300700001)(5660300002)(36860700001)(107886003)(83380400001)(2906002)(70586007)(54906003)(316002)(4326008)(70206006)(8676002)(44832011)(8936002);DIR:OUT;SFP:1101; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2024 16:19:30.2350 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f1e9c52f-f69f-4de3-1d03-08dc106597bb X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bebe97c3-6438-442e-ade3-ff17aa50e733;Ip=[20.160.56.81];Helo=[repost-eu.tmcas.trendmicro.com] X-MS-Exchange-CrossTenant-AuthSource: VI1EUR05FT049.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR03MB8679 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240108_081943_801124_BC8434C3 X-CRM114-Status: GOOD ( 12.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org smp_call_function_single disables IRQs when executing the callback. To prevent deadlocks, we must disable IRQs when taking cgr_lock elsewhere. This is already done by qman_update_cgr and qman_delete_cgr; fix the other lockers. Fixes: 96f413f47677 ("soc/fsl/qbman: fix issue in qman_delete_cgr_safe()") Signed-off-by: Sean Anderson Reviewed-by: Camelia Groza Tested-by: Vladimir Oltean --- (no changes since v3) Changes in v3: - Change blamed commit to something more appropriate Changes in v2: - Fix one additional call to spin_unlock drivers/soc/fsl/qbman/qman.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c index 739e4eee6b75..1bf1f1ea67f0 100644 --- a/drivers/soc/fsl/qbman/qman.c +++ b/drivers/soc/fsl/qbman/qman.c @@ -1456,11 +1456,11 @@ static void qm_congestion_task(struct work_struct *work) union qm_mc_result *mcr; struct qman_cgr *cgr; - spin_lock(&p->cgr_lock); + spin_lock_irq(&p->cgr_lock); qm_mc_start(&p->p); qm_mc_commit(&p->p, QM_MCC_VERB_QUERYCONGESTION); if (!qm_mc_result_timeout(&p->p, &mcr)) { - spin_unlock(&p->cgr_lock); + spin_unlock_irq(&p->cgr_lock); dev_crit(p->config->dev, "QUERYCONGESTION timeout\n"); qman_p_irqsource_add(p, QM_PIRQ_CSCI); return; @@ -1476,7 +1476,7 @@ static void qm_congestion_task(struct work_struct *work) list_for_each_entry(cgr, &p->cgr_cbs, node) if (cgr->cb && qman_cgrs_get(&c, cgr->cgrid)) cgr->cb(p, cgr, qman_cgrs_get(&rr, cgr->cgrid)); - spin_unlock(&p->cgr_lock); + spin_unlock_irq(&p->cgr_lock); qman_p_irqsource_add(p, QM_PIRQ_CSCI); } @@ -2440,7 +2440,7 @@ int qman_create_cgr(struct qman_cgr *cgr, u32 flags, preempt_enable(); cgr->chan = p->config->channel; - spin_lock(&p->cgr_lock); + spin_lock_irq(&p->cgr_lock); if (opts) { struct qm_mcc_initcgr local_opts = *opts; @@ -2477,7 +2477,7 @@ int qman_create_cgr(struct qman_cgr *cgr, u32 flags, qman_cgrs_get(&p->cgrs[1], cgr->cgrid)) cgr->cb(p, cgr, 1); out: - spin_unlock(&p->cgr_lock); + spin_unlock_irq(&p->cgr_lock); put_affine_portal(); return ret; } From patchwork Mon Jan 8 16:19:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13513701 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5BA6DC47073 for ; Mon, 8 Jan 2024 16:20:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Q7h0DlqpFCZrX/85jeKNtD/40+qNeZj5W64Bp+T43ls=; b=nbRU5OMhv2GUsR HPyo8Tr72xVK27viHRaX2HzctBe4LcTm0Nrz8b1/nm2NM4h+E4VLmOipdw3IPbzJRJGAGnlcHI/dj vYfYwrpxkHO6ejKx3o40peWETQ63nrmpoKJPxylOz1ywXEGKWeNYH+QXDMnnnwHFkAn8/g85sKCbm l3m71f405saCxtkzRlYSRDthB8okbOdVQ3jtNeeziww+H57h5AeFM0Wlb2NikCW2zzRSsVmN1EOjw KNpWPlDn1QHDqd2l5Q+ZO1fRHwvpoPQ/0zVEAL8UFPvkAwRnAu6IsLRuMNPa+TmK5dhGYFqTLvh2T cE2KJ+3/HMmAQu4nhRpg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rMsLs-005cAb-2d; Mon, 08 Jan 2024 16:19:48 +0000 Received: from mail-am6eur05on20600.outbound.protection.outlook.com ([2a01:111:f403:2612::600] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rMsLp-005c91-0a for linux-arm-kernel@lists.infradead.org; Mon, 08 Jan 2024 16:19:47 +0000 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=InP1XfeXX/PqWVxh4vC364aDQhAtWSUyVUg1h7bW75uG+yKkVlI6MbgcRH4zI+Mbwu0ghCPv9eMIDoaZ5a6dzQ7pH6YZcWlLNP5tK6Gcs16YLU8lvdsXP+FqIuUTbt8weD9lsyQQR4ZZBquOreOZkSt1YJbUnlJ+WG2BGtjLV5/qoZAAHCZtPuJMedpJiv43ROMnh6wtcwV61lhBwJWBf6EwnzbygdYDnFqyBuVTg5yZFlCDuk5AIlHA1k5Og6b6gOASjAnFqbq8tYOjUMGDa9oI8WO7OiEEiRr5BvIdWOCAtiljKG5VyPMJI26VcEFqdsF+Xbsfenj0qVKZXDnHkg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=ZnrvgF5J9pAlxkMmdOmVrj7HVJWTM1JEmjzZiXVfaCs=; b=cgBoQwO+eWV5Jc4Ycp2V4scLzX2K0ge6CYjd4JsRhXCLkFYGI7in0kRcgl9yBAOdYe9XYMcxW2rlmRRucel+TDNhouHC0oZ54TEBJHJc6/O3z0bfdhWggYAKRj4OaCHngSPuEavWPfo6xbwlqYt+0ICxup+E+aDEypMbDnF0F8KxxCBzV9eD+qUaVgztSxso6lyufXg+NF77HNYclosM2cN722RozRY02Zbqz3opqvAiBI+P+PCoEhAQtCZ+n+Bf2GXNTpySqo6Kp/lXvelyNHnC3mP9g+WxHmwNnfzHO0mlmIGjjXB6beHcvhWkEOavZM5Qm1A46K6Q3Nqb8s72vw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 20.160.56.82) smtp.rcpttodomain=buserror.net smtp.mailfrom=seco.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=seco.com; dkim=pass (signature was verified) header.d=seco.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=seco.com] dkim=[1,1,header.d=seco.com] dmarc=[1,1,header.from=seco.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZnrvgF5J9pAlxkMmdOmVrj7HVJWTM1JEmjzZiXVfaCs=; b=PhFn8G0fIhZsRK93i69Fy4cVSslHMpN076tYlrud9WF8LE1aYa8rlnSm6HCm0iDr+QJLUiC3dDuOBrLg3nXbnYVyFlRkMYCpc6k+IpWr0AZeuvK9B1JWlUYsjJO3jtsRC6H6r44yN2V4Y51xirIL85kRRPAxtFWdKNIk2YRBb2an9qNmaRZKDp8ovLqVEibHoZQfVJtiuKWZhhoLfwNIM5CgAkdD7PM+H60/LcdVdI3nDmoBdGw7wna/Ps1PUjZNuzIajaaO/aKpGU0FI4f0E6pHpuLYfrtdDJqCYUHB2q9qMWy5NkUoBGF7NX1Tg44I14hFO+OXZ4plVXNlFfRynA== Received: from DU7PR01CA0008.eurprd01.prod.exchangelabs.com (2603:10a6:10:50f::29) by DU0PR03MB9708.eurprd03.prod.outlook.com (2603:10a6:10:44c::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21; Mon, 8 Jan 2024 16:19:38 +0000 Received: from DB8EUR05FT028.eop-eur05.prod.protection.outlook.com (2603:10a6:10:50f:cafe::c5) by DU7PR01CA0008.outlook.office365.com (2603:10a6:10:50f::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21 via Frontend Transport; Mon, 8 Jan 2024 16:19:37 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 20.160.56.82) smtp.mailfrom=seco.com; dkim=pass (signature was verified) header.d=seco.com;dmarc=pass action=none header.from=seco.com; Received-SPF: Pass (protection.outlook.com: domain of seco.com designates 20.160.56.82 as permitted sender) receiver=protection.outlook.com; client-ip=20.160.56.82; helo=repost-eu.tmcas.trendmicro.com; pr=C Received: from repost-eu.tmcas.trendmicro.com (20.160.56.82) by DB8EUR05FT028.mail.protection.outlook.com (10.233.238.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.29 via Frontend Transport; Mon, 8 Jan 2024 16:19:37 +0000 Received: from outmta (unknown [192.168.82.135]) by repost-eu.tmcas.trendmicro.com (Trend Micro CAS) with ESMTP id 497112008009D; Mon, 8 Jan 2024 16:19:37 +0000 (UTC) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (unknown [104.47.0.50]) by repre.tmcas.trendmicro.com (Trend Micro CAS) with ESMTPS id 864522008006E; Mon, 8 Jan 2024 16:19:29 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dInTO86FAcXzNyAe4uynZ+ER+9sZS+H/5a3TcHV6/uyTex6vy8HXhZETnZ+PPD/jGIV2hKI0bzkqYOlQgD6A4HodhwCRRqdFznFnqeHC79bFOFuW+NYXTjYANZZeejIe/zd/eTca/678iBlaCmpMmXeetGFOUIbIuGwCiJBeOxfKtMZhpxpwpi4CdzhbYw6Q16IwC/n+xJi97/RrssPjMZOtH63INVPus/bom3dL7i2exEXG2fhXxg5BJwt8UoW95u6+B645c4xI/Qmru4ZOQ7UQAs46Nwumyr1QqekICrGBiNPdRlpYDtFUzvvRYnxfYmod30lxi/40VCCZmC8UPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=ZnrvgF5J9pAlxkMmdOmVrj7HVJWTM1JEmjzZiXVfaCs=; b=YgwChIDukoVbuhtCDbvgW0h7CuI9hY9NF0j7STUFTuz0qVntUplq3Lv88isR3RsVc+3748UIcUfDg/SGco4F5WNnhW9yc26I1Yn5H7LRAZ/rXs/nLkbukAlwYUIIHIkDqOQwq0UZrDNr89RUUyDax8RUho7hZypfcFuSkQ0129PsWONuhlCo0IKCsWEw9FIMKHKBPmVrtXCUJM0y8QbpdnY+DlGqS087Lny2WDIVlVPKFXWgwS6qDntSZIGOSN096+YprAqwWnL0v2NKSx4b2qQimb1G/JxQte/d/iS07zn2kbKemA0jiZFSBa0Egk9IoBNTh9rL/nUeVDBCy0mnvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZnrvgF5J9pAlxkMmdOmVrj7HVJWTM1JEmjzZiXVfaCs=; b=PhFn8G0fIhZsRK93i69Fy4cVSslHMpN076tYlrud9WF8LE1aYa8rlnSm6HCm0iDr+QJLUiC3dDuOBrLg3nXbnYVyFlRkMYCpc6k+IpWr0AZeuvK9B1JWlUYsjJO3jtsRC6H6r44yN2V4Y51xirIL85kRRPAxtFWdKNIk2YRBb2an9qNmaRZKDp8ovLqVEibHoZQfVJtiuKWZhhoLfwNIM5CgAkdD7PM+H60/LcdVdI3nDmoBdGw7wna/Ps1PUjZNuzIajaaO/aKpGU0FI4f0E6pHpuLYfrtdDJqCYUHB2q9qMWy5NkUoBGF7NX1Tg44I14hFO+OXZ4plVXNlFfRynA== Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) by PAWPR03MB9858.eurprd03.prod.outlook.com (2603:10a6:102:2e3::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21; Mon, 8 Jan 2024 16:19:27 +0000 Received: from DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::5cfa:9e05:d8dc:ba0f]) by DB9PR03MB8847.eurprd03.prod.outlook.com ([fe80::5cfa:9e05:d8dc:ba0f%7]) with mapi id 15.20.7159.020; Mon, 8 Jan 2024 16:19:27 +0000 From: Sean Anderson To: Li Yang , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Cc: Roy Pledge , Camelia Groza , "David S . Miller" , Claudiu Manoil , linux-kernel@vger.kernel.org, Scott Wood , Steffen Trumtrar , stable@vger.kernel.org, Vladimir Oltean , Sean Anderson Subject: [PATCH v4 2/2] soc: fsl: qbman: Use raw spinlock for cgr_lock Date: Mon, 8 Jan 2024 11:19:04 -0500 Message-Id: <20240108161904.2865093-2-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20240108161904.2865093-1-sean.anderson@seco.com> References: <20240108161904.2865093-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1P222CA0022.NAMP222.PROD.OUTLOOK.COM (2603:10b6:208:2c7::27) To DB9PR03MB8847.eurprd03.prod.outlook.com (2603:10a6:10:3dd::13) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR03MB8847:EE_|PAWPR03MB9858:EE_|DB8EUR05FT028:EE_|DU0PR03MB9708:EE_ X-MS-Office365-Filtering-Correlation-Id: fc7e8839-e641-454d-160f-08dc10659c0f X-TrendMicro-CAS-OUT-LOOP-IDENTIFIER: 656f966764b7fb185830381c646b41a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 7RevYU7OWBDopUQDUYLsl9s/Ac2VZcfTVTIbufS1NYcx9rjBuvwo8Q3fTePwsfH82MbldfVhcj0KHjwINyE0U0nQwrHeexOPIGMZIqxvh/h3IU1GD4tuZek+C/AWZSRKxJNtQpCyban6LkevO/Cg+yl4z7U9r/g2TRQLMEhhEsDbODbuB1QKOfA10bhoo4lCZ2zhdiX4QBSrwFGtd0Jg2G7/23eaUTbiwVM2r4dmXF8QLFZAYxf1xgBTxXxW2ol/VSkR0LrNPISt7ddfiTPC80vqDE5ohAtK2CNqyac8gs72ity0byEzgzkieALW4Xfx1Y2P4Lj7tSiSKsDKskHFDq5tH1JNLXH5rBcGMihNbIXxRHXuNjzuVr6zxKuAlOyaX9jb/4EnwtXvJtVoq1N+ONh6t59Q+br9ZfSBpNgLdGJfXCOuFyO+ACgZpwxam0+/bR/lh8ySC6C41FN8ALy5GP4jLgEVI9AskEUkRTm2Jpq0ItduuG1qkcf1wlm93RNR37Vb9Y0mLSmyA6M0sSiBwZIkmeBR5YFoQ2kKXzjs5ykq2y/dVAXMd4XxeEHmPFrWc+iwiNEZ6fCr/5ax88N1y799UEnUQNoN1BojkGtu4cc= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR03MB8847.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39850400004)(136003)(396003)(366004)(346002)(376002)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(6666004)(2616005)(26005)(1076003)(966005)(52116002)(478600001)(6486002)(6506007)(6512007)(83380400001)(66476007)(107886003)(5660300002)(2906002)(41300700001)(7416002)(316002)(66556008)(54906003)(8676002)(4326008)(44832011)(8936002)(66946007)(38350700005)(38100700002)(36756003)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR03MB9858 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB8EUR05FT028.eop-eur05.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 46a89d09-a91e-4918-3b5e-08dc10659618 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3g9yNprucK2DBC4h77ZBbAkUnspz6VBeXUxHSVTFcMQbWCnDctigcl96qZyOsBIAx5l3iRpZ03fJ3UqJcbvVc0LZcKjEJlRbY72qGP76ozGCNQFXltw1RfoNwsT9rU/vKjXhkdWPJMnd/5i3HpJXk4LJhC1Yo9goNyhDeM3dlccW1tKGQTbmHpPhttMCwa3RUbU7T0X7w9xhIYcIXYHQdJ+6DwACIH5JCPo2Rhe89yaARHpQ49b/DY5ZWviIayN4BZqo4wH0yVQqvVdtORkTRmIb4+joad+AYNI1cIFUn/e7eLrFRHktR8hysvg0JXbMq+0eOZRzSifmacSdDgTKg2dYhPnocZ8TbmGbOSXAziWgyz/3Nfvu1sKKO8tRyvAsOabE3yM/hctQ6baUMRHTlEQ4JE6J1701DMNwslBd0/WmrQRmuD3rY5pYzscTA3AE+7fJ9J2/xuh1a4nuEXZ2xJ1XZ7S0tcGVLpacoXGs7yERNUjn/N7DDY4g6crBNMV+smXFqoIb3bzwgZjNb9YY7A1031cwuZcd5lHwB/+V6nweeezxVt1+SC4+aakuVKkTbEjb7X4H6vr804Z/ZKOUV3cQfW7HiKKDnUVweGFKhdfVdmdGoQjr9rfQQhXq0WcR6zT/ZAh5VVZhvuDVmcg5jJEyipNNi5nW8jsdGo/7VG+WFD2sXu0zdEsoacyrqwr2TFSaAWClL3rcPMXj/Fdcjm0Z7kM7DImnA/XZsf6pnXDhIa2OKvXYHejBYsYUgT1KdOJ/fnMU7Tg4ELkskaPSRw== X-Forefront-Antispam-Report: CIP:20.160.56.82;CTRY:NL;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:repost-eu.tmcas.trendmicro.com;PTR:repost-eu.tmcas.trendmicro.com;CAT:NONE;SFS:(13230031)(376002)(346002)(136003)(396003)(39850400004)(230922051799003)(451199024)(64100799003)(1800799012)(186009)(82310400011)(40470700004)(36840700001)(46966006)(7636003)(356005)(82740400003)(7596003)(36756003)(8676002)(8936002)(83380400001)(54906003)(336012)(316002)(5660300002)(4326008)(6506007)(478600001)(44832011)(966005)(6512007)(6666004)(26005)(1076003)(70586007)(70206006)(107886003)(6486002)(2616005)(34070700002)(41300700001)(7416002)(47076005)(2906002)(36860700001)(40460700003)(86362001)(40480700001);DIR:OUT;SFP:1101; X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2024 16:19:37.4962 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fc7e8839-e641-454d-160f-08dc10659c0f X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bebe97c3-6438-442e-ade3-ff17aa50e733;Ip=[20.160.56.82];Helo=[repost-eu.tmcas.trendmicro.com] X-MS-Exchange-CrossTenant-AuthSource: DB8EUR05FT028.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR03MB9708 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240108_081945_366232_1BF3C6E7 X-CRM114-Status: GOOD ( 16.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org cgr_lock may be locked with interrupts already disabled by smp_call_function_single. As such, we must use a raw spinlock to avoid problems on PREEMPT_RT kernels. Although this bug has existed for a while, it was not apparent until commit ef2a8d5478b9 ("net: dpaa: Adjust queue depth on rate change") which invokes smp_call_function_single via qman_update_cgr_safe every time a link goes up or down. Fixes: 96f413f47677 ("soc/fsl/qbman: fix issue in qman_delete_cgr_safe()") Reported-by: Vladimir Oltean Closes: https://lore.kernel.org/all/20230323153935.nofnjucqjqnz34ej@skbuf/ Reported-by: Steffen Trumtrar Closes: https://lore.kernel.org/linux-arm-kernel/87wmsyvclu.fsf@pengutronix.de/ Signed-off-by: Sean Anderson Reviewed-by: Camelia Groza Tested-by: Vladimir Oltean --- Please backport these fixes when applied. This bug has been reported multiple times (see links above). Changes in v4: - Add a note about how raw spinlocks aren't quite right Changes in v3: - Change blamed commit to something more appropriate drivers/soc/fsl/qbman/qman.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c index 1bf1f1ea67f0..7e9074519ad2 100644 --- a/drivers/soc/fsl/qbman/qman.c +++ b/drivers/soc/fsl/qbman/qman.c @@ -991,7 +991,7 @@ struct qman_portal { /* linked-list of CSCN handlers. */ struct list_head cgr_cbs; /* list lock */ - spinlock_t cgr_lock; + raw_spinlock_t cgr_lock; struct work_struct congestion_work; struct work_struct mr_work; char irqname[MAX_IRQNAME]; @@ -1281,7 +1281,7 @@ static int qman_create_portal(struct qman_portal *portal, /* if the given mask is NULL, assume all CGRs can be seen */ qman_cgrs_fill(&portal->cgrs[0]); INIT_LIST_HEAD(&portal->cgr_cbs); - spin_lock_init(&portal->cgr_lock); + raw_spin_lock_init(&portal->cgr_lock); INIT_WORK(&portal->congestion_work, qm_congestion_task); INIT_WORK(&portal->mr_work, qm_mr_process_task); portal->bits = 0; @@ -1456,11 +1456,14 @@ static void qm_congestion_task(struct work_struct *work) union qm_mc_result *mcr; struct qman_cgr *cgr; - spin_lock_irq(&p->cgr_lock); + /* + * FIXME: QM_MCR_TIMEOUT is 10ms, which is too long for a raw spinlock! + */ + raw_spin_lock_irq(&p->cgr_lock); qm_mc_start(&p->p); qm_mc_commit(&p->p, QM_MCC_VERB_QUERYCONGESTION); if (!qm_mc_result_timeout(&p->p, &mcr)) { - spin_unlock_irq(&p->cgr_lock); + raw_spin_unlock_irq(&p->cgr_lock); dev_crit(p->config->dev, "QUERYCONGESTION timeout\n"); qman_p_irqsource_add(p, QM_PIRQ_CSCI); return; @@ -1476,7 +1479,7 @@ static void qm_congestion_task(struct work_struct *work) list_for_each_entry(cgr, &p->cgr_cbs, node) if (cgr->cb && qman_cgrs_get(&c, cgr->cgrid)) cgr->cb(p, cgr, qman_cgrs_get(&rr, cgr->cgrid)); - spin_unlock_irq(&p->cgr_lock); + raw_spin_unlock_irq(&p->cgr_lock); qman_p_irqsource_add(p, QM_PIRQ_CSCI); } @@ -2440,7 +2443,7 @@ int qman_create_cgr(struct qman_cgr *cgr, u32 flags, preempt_enable(); cgr->chan = p->config->channel; - spin_lock_irq(&p->cgr_lock); + raw_spin_lock_irq(&p->cgr_lock); if (opts) { struct qm_mcc_initcgr local_opts = *opts; @@ -2477,7 +2480,7 @@ int qman_create_cgr(struct qman_cgr *cgr, u32 flags, qman_cgrs_get(&p->cgrs[1], cgr->cgrid)) cgr->cb(p, cgr, 1); out: - spin_unlock_irq(&p->cgr_lock); + raw_spin_unlock_irq(&p->cgr_lock); put_affine_portal(); return ret; } @@ -2512,7 +2515,7 @@ int qman_delete_cgr(struct qman_cgr *cgr) return -EINVAL; memset(&local_opts, 0, sizeof(struct qm_mcc_initcgr)); - spin_lock_irqsave(&p->cgr_lock, irqflags); + raw_spin_lock_irqsave(&p->cgr_lock, irqflags); list_del(&cgr->node); /* * If there are no other CGR objects for this CGRID in the list, @@ -2537,7 +2540,7 @@ int qman_delete_cgr(struct qman_cgr *cgr) /* add back to the list */ list_add(&cgr->node, &p->cgr_cbs); release_lock: - spin_unlock_irqrestore(&p->cgr_lock, irqflags); + raw_spin_unlock_irqrestore(&p->cgr_lock, irqflags); put_affine_portal(); return ret; } @@ -2577,9 +2580,9 @@ static int qman_update_cgr(struct qman_cgr *cgr, struct qm_mcc_initcgr *opts) if (!p) return -EINVAL; - spin_lock_irqsave(&p->cgr_lock, irqflags); + raw_spin_lock_irqsave(&p->cgr_lock, irqflags); ret = qm_modify_cgr(cgr, 0, opts); - spin_unlock_irqrestore(&p->cgr_lock, irqflags); + raw_spin_unlock_irqrestore(&p->cgr_lock, irqflags); put_affine_portal(); return ret; }