Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp588563lqs; Tue, 5 Mar 2024 10:14:55 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVG7CN97c8riyBrtBDly7RgAicYP/GnlupoKqjJBA8KQmoxGWoiaaQySblgQQrJeLhdFFev0GYEjuD5MvVHWtJfr2JPISgOiJP5kO68Pg== X-Google-Smtp-Source: AGHT+IGSgOgeqdQ8nqiVY5xEYP26jVMIla6pYQIdvCFfj7hyGkRK0rl4UjjZJzy8ZQ4Amk0M7rL/ X-Received: by 2002:a17:90a:a516:b0:29a:2d0f:6418 with SMTP id a22-20020a17090aa51600b0029a2d0f6418mr11800097pjq.9.1709662495220; Tue, 05 Mar 2024 10:14:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709662495; cv=pass; d=google.com; s=arc-20160816; b=ftmW8MBZ2wa1mRQakFYCZR6dpZgp2x8Zz0WzVX/l/FyFWEQ3T+7rSGpmL9YhRM0fGi Oua9i0iILwwVJ4pwsbzO8h8ydFNHSr1s1nAqoygUAv55vwxWiNZd9hAT2d1cQf4jgQyi ZOy7e+iJiaKlp2yeHsaWTTfHdr3adT27AwuA6cMfUa+GgC2QMtJ4hWcT6KY0CT8cLbU8 AtE8QSKlaXTauEDHOeQ6Q4ygva7+lLGtFkUjV/NrLzZ8z5Pobpqte14+1D5IZVD3WNvE ZbMRJJ/ZqhQJJyzJ1EjI8ttD7ji9Kpk3HYBrsmqtcJ+0Adqt51cZBVvv5y32T/Ybf/hG N5fw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature:message-id; bh=4mCLjnlt6q90qUCq4m5luMROvGFxl/z1bFGYicutzgw=; fh=5C8v9sN26rRCoe7AF4+kXw4kcw4GwlcYgcbvV8d71Zg=; b=Zw8GaeEAH7skOrAf+XMWMFBT/7QorM388rHmkeR2xRP6pN7k+nhZCcOuJBfomGX5zT Hn/1QZfNqtrvR3uTQiSg0RdIYNQLccVEsJQ9W2l6UXzRSq8wKl8YR8uGORz6vFxylFex ZLb34VtmBrDS7Qx8/zAOFlC8cjAlATAIYvMURNqWarphXKFMHaCpFf+UDsNZvA0pRL4L EWfaH1qfFAaLf1/YDDlKWCefJtljIWI+nOUfLZOgtoJrhHC2rlawkh1ATO8PnzeeJwWS jwk4OJXUTGNO3VN4dcsxh0wvo7jk52LWFht0pycFbobS0l9DRojy38l6enf8OoVfgnsz HIWQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=TIDrRuHA; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-92813-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92813-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id l11-20020a17090a49cb00b0029724b7788fsi1006641pjm.9.2024.03.05.10.14.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 10:14:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-92813-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=TIDrRuHA; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-92813-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92813-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9B57E28B0B0 for ; Tue, 5 Mar 2024 18:14:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DAAE918AED; Tue, 5 Mar 2024 18:14:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="TIDrRuHA" Received: from out-189.mta1.migadu.com (out-189.mta1.migadu.com [95.215.58.189]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B78F17C98 for ; Tue, 5 Mar 2024 18:14:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709662459; cv=none; b=aTUlYVfcdhs01ovQEbT/O8etQppxCyKIFv2ddENQJ/2akLU+kqaQvQLGNg8ZZpXw5uIEZElGoF/CQb06pVjbjP9rO0dqzzHnSqbiBLFbxuNgcCoTaQqIvzih7oWUymlDQpP7BL4NQsx7ma0kaSBCa8dOqSgVyG7vmT+7IG/m2ss= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709662459; c=relaxed/simple; bh=CLb6htEM8BQ4wkYj4Mfxot1eztyH01EK5KTKnTSNh54=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=bgpYl9lzznCBnBLWuGCbT8FACEgPl8XpMS+UZ/96+KK+JgyCPFxzY0nW2jNQr3G1x4UsWVxvY08Aza9c2X4C1jUqALuqbXzQrQKjRZodyqSig9nqLJibU8fu4kJZY3lueqAzpHJillf9MctT8ZRDcOaw4SO/ISA/HUg2Drn3EbE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=TIDrRuHA; arc=none smtp.client-ip=95.215.58.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Message-ID: <6764b9c5-b61a-4f20-a41a-125d5015a3e6@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1709662455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4mCLjnlt6q90qUCq4m5luMROvGFxl/z1bFGYicutzgw=; b=TIDrRuHAB3Fwdib4sKxYLlkNs/TwItDMIceZL4vZyE4Carkes4zEYbdAlyJQ4dcCUxPpyF 6rbx5Zlju5IHwZLJLPCTrfuGz8914F21k9UnY4jBL9g2kqJvjQCD3ROpdK7tcPjKdbpgRy reYNOMlidxSNyyW8Jc7aInmHfsV4vK8= Date: Tue, 5 Mar 2024 13:14:09 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [RESEND2 PATCH net v4 2/2] soc: fsl: qbman: Use raw spinlock for cgr_lock Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Sean Anderson To: Christophe Leroy , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "netdev@vger.kernel.org" Cc: Vladimir Oltean , Roy Pledge , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" , Li Yang , Scott Wood , Claudiu Manoil , Camelia Groza , Steffen Trumtrar , "linuxppc-dev@lists.ozlabs.org" , "linux-arm-kernel@lists.infradead.org" References: <20240222170749.2607485-1-sean.anderson@linux.dev> <20240222170749.2607485-2-sean.anderson@linux.dev> <53b401d7-934c-4937-ab83-6732af47668d@csgroup.eu> <34da1e7b-029e-410b-8735-a10d6d267e2b@linux.dev> In-Reply-To: <34da1e7b-029e-410b-8735-a10d6d267e2b@linux.dev> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Hi, On 2/23/24 11:02, Sean Anderson wrote: > On 2/23/24 00:38, Christophe Leroy wrote: >> Le 22/02/2024 à 18:07, Sean Anderson a écrit : >>> [Vous ne recevez pas souvent de courriers de sean.anderson@linux.dev. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ] >>> >>> 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. >> >> Why a raw spinlock to avoid problems on PREEMPT_RT, can you elaborate ? > > smp_call_function always runs its callback in hard IRQ context, even on > PREEMPT_RT, where spinlocks can sleep. So we need to use raw spinlocks > to ensure we aren't waiting on a sleeping task. See the first bug report > for more discussion. > > In the longer term it would be better to switch to some other > abstraction. Does this make sense to you? --Sean