Re: [PATCH v2 1/2] mm: huge_memory: disallow hugepages if the system-wide THP sysfs settings are disabled
From: Dev Jain
Date: Fri Jun 06 2025 - 12:50:11 EST
On 05/06/25 1:30 pm, Baolin Wang wrote:
The MADV_COLLAPSE will ignore the system-wide Anon THP sysfs settings, which
means that even though we have disabled the Anon THP configuration, MADV_COLLAPSE
will still attempt to collapse into a Anon THP. This violates the rule we have
agreed upon: never means never.
Another rule for madvise, referring to David's suggestion: “allowing for collapsing
in a VM without VM_HUGEPAGE in the "madvise" mode would be fine".
To address this issue, should check whether the Anon THP configuration is disabled
in thp_vma_allowable_orders(), even when the TVA_ENFORCE_SYSFS flag is set.
Did you mean to say "even when the TVA_ENFORCE_SYSFS flag is *not* set"? Because if
is set, then we have to check the anon THP sysfs config.
In summary, the current strategy is:
1. If always & orders == 0, and madvise & orders == 0, and hugepage_global_enabled() == false
(global THP settings are not enabled), it means mTHP of that orders are prohibited
from being used, then madvise_collapse() is forbidden for that orders.
2. If always & orders == 0, and madvise & orders == 0, and hugepage_global_enabled() == true
(global THP settings are enabled), and inherit & orders == 0, it means mTHP of that
orders are still prohibited from being used, thus madvise_collapse() is not allowed
for that orders.
Reviewed-by: Zi Yan <ziy@xxxxxxxxxx>
Signed-off-by: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx>
---
include/linux/huge_mm.h | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index 2f190c90192d..199ddc9f04a1 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -287,20 +287,35 @@ unsigned long thp_vma_allowable_orders(struct vm_area_struct *vma,
unsigned long orders)
{
/* Optimization to check if required orders are enabled early. */
- if ((tva_flags & TVA_ENFORCE_SYSFS) && vma_is_anonymous(vma)) {
- unsigned long mask = READ_ONCE(huge_anon_orders_always);
+ if (vma_is_anonymous(vma)) {
+ unsigned long always = READ_ONCE(huge_anon_orders_always);
+ unsigned long madvise = READ_ONCE(huge_anon_orders_madvise);
+ unsigned long inherit = READ_ONCE(huge_anon_orders_inherit);
+ unsigned long mask = always | madvise;
+
+ /*
+ * If the system-wide THP/mTHP sysfs settings are disabled,
+ * then we should never allow hugepages.
+ */
+ if (!(mask & orders) && !(hugepage_global_enabled() && (inherit & orders)))
+ return 0;
+
+ if (!(tva_flags & TVA_ENFORCE_SYSFS))
+ goto skip;
+ mask = always;
if (vm_flags & VM_HUGEPAGE)
- mask |= READ_ONCE(huge_anon_orders_madvise);
+ mask |= madvise;
if (hugepage_global_always() ||
((vm_flags & VM_HUGEPAGE) && hugepage_global_enabled()))
- mask |= READ_ONCE(huge_anon_orders_inherit);
+ mask |= inherit;
orders &= mask;
if (!orders)
return 0;
}
+skip:
return __thp_vma_allowable_orders(vma, vm_flags, tva_flags, orders);
}
Return-Path: <linux-kernel+bounces-665914-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [147.75.80.249])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id C3EF041E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 13:46:05 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by am.mirrors.kernel.org (Postfix) with ESMTPS id 032691C02127
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:46:19 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id DF96828DF53;
Wed, 28 May 2025 17:45:56 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b="A4+5FNp7"
Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173])
(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 63A671B6D06;
Wed, 28 May 2025 17:45:52 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.89.141.173
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748454356; cv=none; b=hsj6HO8QUlEUsVBdMPdCDeIqCy4Sq2xN3GwOWyZBt9BXYmgyhyu1LqVd7a/IPM1HAjAij+0UwRcMgxygFl100pgL/8H64k/+m3x8601Zsc1/17Q3qQ0RftbC5+SJz7ZMdPvyYHcaEykfnzn/LfQ0Q5LaIyEvuua76cOo1AibJRA=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748454356; c=relaxed/simple;
bh=HYHkALbXo3pnLVUrs+6b3S7pMKN/XYoSOkMG6JfxG6I=;
h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
Content-Type:Content-Disposition:In-Reply-To; b=MV2izN3IOe3JJluMIeqY/l31btC/XEVm/DTpo5QHD0JsHimdYbbkMujkV4mT340TYLwEKh1eQvZVEmhN3HwKMB7aAREAP78uToqQtLxL/Sn5/ZmoiSbjRxuTN8PSSVpwRUQiE2hK6I558rPFHxMOh2sETWWOFx5/kOCn41RoI/Y=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk; spf=none smtp.mailfrom=ftp.linux.org.uk; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b=A4+5FNp7; arc=none smtp.client-ip=62.89.141.173
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk
Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ftp.linux.org.uk
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type:
MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To:
Content-Transfer-Encoding:Content-ID:Content-Description;
bh=5WyBr0ASdpvAFCWr18lM8e8ssQr82+v2ps7SNoOuuGk=; b=A4+5FNp7Jp3OY3LPC2nM7n28l7
LO1OZChVBlk/8JjBkvtFKKLGaD2EvXkokSX0h1flzskpgFtm0zlAP1Y2rNf+jrFhRJowGdhkOlIkM
ukz396ZCEm6xb3WuOgC+qbdy6m6HD9cistodIQmRHCmPeAIcBvzF8NmUEVMjVl8X6e7Vz7/9E5jXy
Ae+TR9HP/kOuR2CARGJkuwSHHOb3f+khFi2c2HCv+Eb4MPDVAhDeuocmgDtGlPUHri0sqKyMipXMF
9ktHbwBT6PqLEga4Az3FH868qJBDj5fa8gM2DnRsRw0t04HosYSlMxIOm4dZ2ojGWC7h9Klfhx9PH
P15ULvMg==;
Received: from viro by zeniv.linux.org.uk with local (Exim 4.98.2 #2 (Red Hat Linux))
id 1uKKqY-00000007yio-1e8O;
Wed, 28 May 2025 17:45:46 +0000
Date: Wed, 28 May 2025 18:45:46 +0100
From: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
To: Alice Ryhl <aliceryhl@xxxxxxxxxx>
Cc: Miguel Ojeda <ojeda@xxxxxxxxxx>,
Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>,
Arnd Bergmann <arnd@xxxxxxxx>,
Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>,
Boqun Feng <boqun.feng@xxxxxxxxx>, Gary Guo <gary@xxxxxxxxxxx>,
=?iso-8859-1?Q?Bj=F6rn?= Roy Baron <bjorn3_gh@xxxxxxxxxxxxxx>,
Benno Lossin <benno.lossin@xxxxxxxxx>,
Andreas Hindborg <a.hindborg@xxxxxxxxxx>,
Trevor Gross <tmgross@xxxxxxxxx>,
Danilo Krummrich <dakr@xxxxxxxxxx>, rust-for-linux@xxxxxxxxxxxxxxx,
linux-kernel@xxxxxxxxxxxxxxx
Subject: Re: [PATCH v2] uaccess: rust: use newtype for user pointers
Message-ID: <20250528174546.GC2023217@ZenIV>
References: <20250527-userptr-newtype-v2-1-a789d266f6b0@xxxxxxxxxx>
<20250527221211.GB2023217@ZenIV>
<aDbpsB3ayj6tFfbI@xxxxxxxxxx>
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <aDbpsB3ayj6tFfbI@xxxxxxxxxx>
Sender: Al Viro <viro@xxxxxxxxxxxxxxxx>
X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
On Wed, May 28, 2025 at 10:47:12AM +0000, Alice Ryhl wrote:
We don't currently have any way to perform that kind of pointer-math on
user pointers, nor do we have any users of it. I imagine that this type
checking is only useful if you can actually perform pointer math in the
first place?
What you want is something like
x->field::UserPtr(beta) iff
x::UserPtr(alpha) and
_.field::beta where _::alpha
Generated code would be "add offset and cast to pointer to type of...",
but doing that manually would really invite headache.
Return-Path: <linux-kernel+bounces-665915-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [147.75.80.249])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id D8E3E41E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 13:48:46 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by am.mirrors.kernel.org (Postfix) with ESMTPS id 7CCEE1BA2E04
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:48:59 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 0BEBA28E561;
Wed, 28 May 2025 17:48:37 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.b="jGL4wvld"
Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44])
(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 58A4B1B6D06;
Wed, 28 May 2025 17:48:30 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=208.88.110.44
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748454516; cv=none; b=i5pkhgVCPWkPYSv3/GwMkRRY27JIgKXwOUCeMy96INxJJ+S2j0xV2PBmEawTEGiYQPgA6GwtXHdDEuIYcv+8nFh8Nr22Nxc5A8umbDSKKp3CRAL9GZB4lSa49gjbAX05i9i8ephd5WtZwpKv94z0zDvVSvOVwk9f08rU6eK565s=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748454516; c=relaxed/simple;
bh=oCM+4Vgs42XHFi0Q/Yw0LwFfT7ORF04eoTofghmj170=;
h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
Content-Type:Content-Disposition:In-Reply-To; b=b1kkTmnKS79EAi6T9TE7pbQ8ypFhAFf4aLfwA87FhGzjUJDQod3qMM3u6L7GleqMVAnHSDftgaD7BKPFIaYOaNmZ4lz4pfGJpZUnLme1rJWe2/agY99sQ+89xTEG4NWe1z+vHRuYRFL2pVzGr2tjDNZ5CgZDcMxCsn0FYgeOSSs=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=savoirfairelinux.com; spf=pass smtp.mailfrom=savoirfairelinux.com; dkim=pass (2048-bit key) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.b=jGL4wvld; arc=none smtp.client-ip=208.88.110.44
Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=savoirfairelinux.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=savoirfairelinux.com
Received: from localhost (localhost [127.0.0.1])
by mail.savoirfairelinux.com (Postfix) with ESMTP id 868F59C9227;
Wed, 28 May 2025 13:48:24 -0400 (EDT)
Received: from mail.savoirfairelinux.com ([127.0.0.1])
by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10032)
with ESMTP id G0zVtnKNW432; Wed, 28 May 2025 13:48:24 -0400 (EDT)
Received: from localhost (localhost [127.0.0.1])
by mail.savoirfairelinux.com (Postfix) with ESMTP id D64AF9C8FCB;
Wed, 28 May 2025 13:48:23 -0400 (EDT)
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com D64AF9C8FCB
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2;
t=1748454503; bh=KpmI7Pi+aSOUO0HqHzu9340E24hqvfaUnrw9F71PejE=;
h=Date:From:To:Message-ID:MIME-Version;
b=jGL4wvlddFcvnAxrAVR54BGXFMF3BPRMVKyJiTSLy3hH6C689YQAULoVp/HKyo5RK
aPXN+XRJNqnhi2NmweXkDyBahmZvzPy8WvCEY9eHTDLdO9WBHHGKBiypZwM7ji1NYP
Hd+xrVUZz3lBquYRGD8XnHh1rwrHcFmF/XHhe1e5w4L0szhxIdc3p+CZBjeyA0Vlv7
QhATr3OuqsrIDNTcW/tsjsHj3kS1/Y6GG+ZtK8jwFwAOJ5UUkGAnWSMGxdwp7VRASt
1yMoK7UdHFWvqMxNEmI5dgIJa/lmCAHsUcsHVqFCfSFuYoESt2qAsAb6wll6kKnGCP
oib7Ig2t3bI5w==
X-Virus-Scanned: amavis at mail.savoirfairelinux.com
Received: from mail.savoirfairelinux.com ([127.0.0.1])
by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10026)
with ESMTP id s24kzK8CnL84; Wed, 28 May 2025 13:48:23 -0400 (EDT)
Received: from fedora (unknown [192.168.51.254])
by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 7E30B9C84CB;
Wed, 28 May 2025 13:48:23 -0400 (EDT)
Date: Wed, 28 May 2025 13:48:22 -0400
From: Samuel Kayode <samuel.kayode@xxxxxxxxxxxxxxxxxxxx>
To: Krzysztof Kozlowski <krzk@xxxxxxxxxx>
Cc: Lee Jones <lee@xxxxxxxxxx>, Rob Herring <robh@xxxxxxxxxx>,
Krzysztof Kozlowski <krzk+dt@xxxxxxxxxx>,
Conor Dooley <conor+dt@xxxxxxxxxx>,
Liam Girdwood <lgirdwood@xxxxxxxxx>,
Mark Brown <broonie@xxxxxxxxxx>,
Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>,
Sebastian Reichel <sre@xxxxxxxxxx>, devicetree@xxxxxxxxxxxxxxx,
linux-kernel@xxxxxxxxxxxxxxx, linux-input@xxxxxxxxxxxxxxx,
linux-pm@xxxxxxxxxxxxxxx, eballetbo@xxxxxxxxx, abelvesa@xxxxxxxxx,
b38343@xxxxxxxxxxxxx, yibin.gong@xxxxxxx,
Abel Vesa <abelvesa@xxxxxxxxxx>
Subject: Re: [PATCH v3 1/6] dt-bindings: mfd: add pf1550
Message-ID: <aDdMZoIOqlYcvbGg@fedora>
References: <20250527-pf1550-v3-0-45f69453cd51@xxxxxxxxxxxxxxxxxxxx>
<20250527-pf1550-v3-1-45f69453cd51@xxxxxxxxxxxxxxxxxxxx>
<250c9bf7-c958-4383-9b3f-45b4174585c5@xxxxxxxxxx>
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <250c9bf7-c958-4383-9b3f-45b4174585c5@xxxxxxxxxx>
X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,
RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,
RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
On Wed, May 28, 2025 at 08:08:17AM +0200, Krzysztof Kozlowski wrote:
> + description:
> + Temperature threshold for thermal regulation of charger in celsius.
But this now makes me wonder whether this should be just part of thermal
zone and get the threshold from there. I assume this is temperature of
CHARGER, not the battery. If battery, you have such properties in
battery.yaml (monitored-batter).
Yes, it is the charger junction temperature.
@Sebastian,
Are there existing bindings or devices which regulate temperature based
on thermal-zones in DT?
> +examples:
> + - |
> + battery: battery-cell {
> + compatible = "simple-battery";
> + constant-charge-voltage-max-microvolt = <4400000>;
> + operating-range-celsius = <0 75>;
So this looks like duplicating thermal-regulation property.
Yes, thermal-regulation should suffice.
Thanks,
Sam
Return-Path: <linux-kernel+bounces-665916-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [139.178.88.99])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 4C8AC41E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 13:51:48 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by sv.mirrors.kernel.org (Postfix) with ESMTPS id DA1D83A3B46
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:51:21 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 70EF628E561;
Wed, 28 May 2025 17:51:35 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="U9nx6qrv"
Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5412A1B6D06;
Wed, 28 May 2025 17:51:32 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.174
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748454694; cv=none; b=jXf8pCoc5Et8CFMNg7adJlowl6ypEGU5nBhWApYE7xkeSg8PuaguyO5irUsKKHCuuxzp7vh+D68/8Upj0x7k1yWHB3iRfLEhUNtBQEtOpqb9NiNf4izsGXXDvheCkDH+uVSx80g9qZKrpExFkGp8gktKKycVknQRfF3y3L0ob4w=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748454694; c=relaxed/simple;
bh=pKrP+SJ4LaJNwfbkiX7iV0LUuK6iL+pWws8KTlHLUeg=;
h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=brgbEGL91gLTlHslKtAm879I2aGBxbStRvDKVJM2Yc5qvTkQH8ITUICsM1YOOSM9ygKGCcvrNK9L8SI5iJEZIyizN8El8ixE4XMSGhoQTmL+tULZJ6YZKwsjnHvpfmtgsVbVLtE5WmdkUVCID8kiiIxdmeIbd3Bf5pPZ1Iharrk=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=U9nx6qrv; arc=none smtp.client-ip=209.85.210.174
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-742c9907967so4057b3a.1;
Wed, 28 May 2025 10:51:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1748454691; x=1749059491; darn=vger.kernel.org;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:from:to:cc:subject:date:message-id:reply-to;
bh=E1+IwopJU0lv/yXFu4CFGB0kRxCi/XJPpkkbxvoT8Jg=;
b=U9nx6qrvwTBTE0E9FH9Ud+sUx4t7XjL3vqdo+kYeAFs9xHExMxImYHPCGQj5sTxFAY
rbKOnNFDmzjAORPD3IXxmnebNuA6g2r4Lt44DEihGeuva3NFqm8yE98GhMBYrFYHXiIb
Yt4NalcYlOVskTY6axOz4fOtmLLTlEitfTvYZ3VrhUXZmrovyoJjmHB6tW4U+xk1kOt0
DMvnOU5pB4CcBkwaTyAPPYXVYYk7giI55dlxa8b+2uhBq2rFgnnQeNGRU9R+is0SaZ+L
ZzCam0HWRRju5jqSAt3A0M07RV+IkxDUM4hNAYVDOXbFMdOf7iEJ7O9+xeRYALLHQTcq
ZyCA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1748454691; x=1749059491;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to;
bh=E1+IwopJU0lv/yXFu4CFGB0kRxCi/XJPpkkbxvoT8Jg=;
b=K0wo3IIszrGeWtE3j2UGHOrN3XyXA/gjIQXcXdgKCGqskn5rmo0DdE0OldO9Ws2HbX
ThahkK9x5iN9ZJNj7Sr0MIwFqLPmYpJKGgozT8xWgZKvdJeSZ+hP/pUUTdivb6kciKEr
rjz+SuDBn17RjTXaADOF2CnM3FLCk9wTcNrbb9YpH4RHHWF6q3N/X8zK1uX4g8YEp0CT
TFQGlX7ln0f24oEnzM4XA+rj/JwHqG4TB2aUMxrjZO4i6iYFhiLB9XBZUiOV+u1I7ICE
rsFks7V108W13E7XnmZr5jWM9t6Vr4+VzGZF3E8D5eMdPDMF6wTgEk0U2jFrn64UHbE0
YdWQ==
X-Forwarded-Encrypted: i=1; AJvYcCW6TNbAPMHcHBFKCgZ3JjUDm+779i6VT+YQm/tmepKh7d0z3t48XhpRI2Kldb5OsVpKzilre4BCT0gxzTaRwxU=@vger.kernel.org, AJvYcCXZJXhS2bpeov8hzU//nf5FBmQvvDzI3+mRFpy7dYaIvzHaSQ3+lg6ESFJM55NVd1w0NlSlNGVXRCvnuXs=@vger.kernel.org
X-Gm-Message-State: AOJu0Yw7l45LYRNzKuOuIt8wPPMfKNY7GtI2apg7eBIfmt2F6jfSPYrj
AnZqnfGO09eE5kRyQgsvcn43W/kI7BeNqEoZwBH+KeQkmg8QUTNl+oWO
X-Gm-Gg: ASbGncu65p8PtlEN/reOOFyvDi9FOrbGWuy64HRc3xXaWxhRF6xJIFEe8+Pcw45cjUr
vKoe8RWiNmHMGAOHQNejj9lKjbnHnTjjo9T+dPxcVAADtSD418tlADBedpoz1/9blqXFi357Hs+
B9UQNqbVEH6XLqNsEptpVlnqQlc22D2vmP0kY+OMgtdaigRdXFkelccSb8x+nYHGXlgWy4B4NyV
1cPkCoWzrlDk6KF2c7FrFBcVQ1ChQlAN/ANDSYY8RBGX5PQcUxZxtvczkRZMJG4djSiKXsOUH5n
1Rifi/VJv6lYkjpgdF0j91VDlJNP8WbdBhzXP9fLzAwwpVRSW+IbNOKqqNB/k+MumiInhbT7CB7
E7BIMyHHlOv0mM51OFA==
X-Google-Smtp-Source: AGHT+IFVO7KOkICyQIQM0olRxVieRE+++FIRGraoGJUL+14X0dln5wxY/fKxuitqFepnzJOlCJVoBQ==
X-Received: by 2002:aa7:888d:0:b0:742:a82c:d832 with SMTP id d2e1a72fcca58-745fe05d238mr29975839b3a.24.1748454691493;
Wed, 28 May 2025 10:51:31 -0700 (PDT)
Received: from localhost.localdomain ([112.149.32.52])
by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-746e343c015sm1544696b3a.138.2025.05.28.10.51.26
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 28 May 2025 10:51:31 -0700 (PDT)
From: Jesung Yang <y.j3ms.n@xxxxxxxxx>
To: Brendan Higgins <brendan.higgins@xxxxxxxxx>,
David Gow <davidgow@xxxxxxxxxx>,
Rae Moar <rmoar@xxxxxxxxxx>,
Miguel Ojeda <ojeda@xxxxxxxxxx>,
Alex Gaynor <alex.gaynor@xxxxxxxxx>,
Boqun Feng <boqun.feng@xxxxxxxxx>,
Gary Guo <gary@xxxxxxxxxxx>,
=?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= <bjorn3_gh@xxxxxxxxxxxxxx>,
Benno Lossin <lossin@xxxxxxxxxx>,
Andreas Hindborg <a.hindborg@xxxxxxxxxx>,
Alice Ryhl <aliceryhl@xxxxxxxxxx>,
Trevor Gross <tmgross@xxxxxxxxx>,
Danilo Krummrich <dakr@xxxxxxxxxx>
Cc: linux-kselftest@xxxxxxxxxxxxxxx,
kunit-dev@xxxxxxxxxxxxxxxx,
rust-for-linux@xxxxxxxxxxxxxxx,
linux-kernel@xxxxxxxxxxxxxxx,
Jesung Yang <y.j3ms.n@xxxxxxxxx>
Subject: [PATCH v3] rust: kunit: use crate-level mapping for `c_void`
Date: Wed, 28 May 2025 17:49:55 +0000
Message-Id: <20250528174953.2948570-1-y.j3ms.n@xxxxxxxxx>
X-Mailer: git-send-email 2.39.5
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,
HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
Remove `use core::ffi::c_void`, which shadows `kernel::ffi::c_void`
brought in via `use crate::prelude::*`, to maintain consistency and
centralize the abstraction.
Since `kernel::ffi::c_void` is a straightforward re-export of
`core::ffi::c_void`, both are functionally equivalent. However, using
`kernel::ffi::c_void` improves consistency across the kernel's Rust code
and provides a unified reference point in case the definition ever needs
to change, even if such a change is unlikely.
Reviewed-by: Benno Lossin <lossin@xxxxxxxxxx>
Signed-off-by: Jesung Yang <y.j3ms.n@xxxxxxxxx>
Link: https://rust-for-linux.zulipchat.com/#narrow/channel/288089/topic/x/near/520452733
---
Changes in v3:
- Rebase on a3b2347343e0
- Remove the explicit import of `kernel::ffi::c_void`
- Reword the commit message accordingly
- Link to v2: https://lore.kernel.org/rust-for-linux/20250528155147.2793921-1-y.j3ms.n@xxxxxxxxx/
Changes in v2:
- Add "Link" tag to the related discussion on Zulip
- Reword the commit message to clarify `kernel::ffi::c_void` is a re-export
- Link to v1: https://lore.kernel.org/rust-for-linux/20250526162429.1114862-1-y.j3ms.n@xxxxxxxxx/
---
rust/kernel/kunit.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/kernel/kunit.rs b/rust/kernel/kunit.rs
index 4b8cdcb21e77..603330f247c7 100644
--- a/rust/kernel/kunit.rs
+++ b/rust/kernel/kunit.rs
@@ -7,7 +7,7 @@
//! Reference: <https://docs.kernel.org/dev-tools/kunit/index.html>
use crate::prelude::*;
-use core::{ffi::c_void, fmt};
+use core::fmt;
/// Prints a KUnit error-level message.
///
base-commit: a3b2347343e077e81d3c169f32c9b2cb1364f4cc
--
2.39.5
Return-Path: <linux-kernel+bounces-665917-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [147.75.80.249])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 026CD41E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 13:53:35 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by am.mirrors.kernel.org (Postfix) with ESMTPS id 83FF81BC448E
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:53:48 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 845EA28DF56;
Wed, 28 May 2025 17:53:27 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jEb3o9Dg"
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201])
(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 C2625286D74;
Wed, 28 May 2025 17:53:26 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748454806; cv=none; b=iyaTiNuHwQl88psVaLIXSPCER+w1oaGP08SBnFF1u9/ijw391xsT269dm+nD/C0J/i5/cmr4w1sbHKHxMlC7oy8ihvoAkmun4uIX7EEasIMX4uNBXxMATCr4ZfULr3EgZDEluZ4LrsNDkr5Ehz7k0nLo080ckR2Zp2W+OaiwLEI=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748454806; c=relaxed/simple;
bh=txwMqlXNU9+DDo1w9gEc1+xw1vo/6bNTsoaIA2zH9nM=;
h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
Content-Type:Content-Disposition:In-Reply-To; b=KjtWBF1mdLu3fhRjp4DC0LbBw5+bSQsRVAIwapSPEhLgMwjqPe675JtVVx3y55fFepCAFDagD4rof38jfeKnX1uuKtHPCDZhrfJyZ1AHZ+9x2kENh+dNLUq6KG2wY1YA2V30CrigO/GFb5FZlkVmJ1f6a2bL5QZpUOXbO7HA3gI=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jEb3o9Dg; arc=none smtp.client-ip=10.30.226.201
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C7F8C4CEE3;
Wed, 28 May 2025 17:53:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
s=k20201202; t=1748454806;
bh=txwMqlXNU9+DDo1w9gEc1+xw1vo/6bNTsoaIA2zH9nM=;
h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
b=jEb3o9DgCaiGjyTJfIoKbrlt3oW0FNUtBTIODtBd6j9Fqt+8LvHPEyoFqN2rD+oqk
1eH8g/wsHv3/LGRzjkNit86QX/x2l7Yabd0xP/fzsTMmNbQvewI6UVYU4yP8FFbt1y
2akAv9ylAzuRGgFn+bMoexXxp27GD8WRkHK02s1IaVT4+rkSwHfUCzS4IWHBk7R08z
PzRGjLqBPvlkx7kjQPMbAiqB5AXN+XYUHYAfuS9XV7ibVv8/PswMISFyFR+VOT4O+M
uHL8aHLH8KJkwptFwNfJou/ZcAMgC8ZobId5/gjueBPh6f0ggKsT+8wZaRV8xdH+hc
UwiIJU/RKZ4Og==
Date: Wed, 28 May 2025 10:53:23 -0700
From: Namhyung Kim <namhyung@xxxxxxxxxx>
To: Ian Rogers <irogers@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>,
Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>,
Mark Rutland <mark.rutland@xxxxxxx>,
Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>,
Jiri Olsa <jolsa@xxxxxxxxxx>,
Adrian Hunter <adrian.hunter@xxxxxxxxx>,
Kan Liang <kan.liang@xxxxxxxxxxxxxxx>,
Miguel Ojeda <ojeda@xxxxxxxxxx>,
Alex Gaynor <alex.gaynor@xxxxxxxxx>,
Boqun Feng <boqun.feng@xxxxxxxxx>, Gary Guo <gary@xxxxxxxxxxx>,
=?utf-8?B?QmrDtnJu?= Roy Baron <bjorn3_gh@xxxxxxxxxxxxxx>,
Benno Lossin <benno.lossin@xxxxxxxxx>,
Andreas Hindborg <a.hindborg@xxxxxxxxxx>,
Alice Ryhl <aliceryhl@xxxxxxxxxx>, Trevor Gross <tmgross@xxxxxxxxx>,
Danilo Krummrich <dakr@xxxxxxxxxx>,
Jiapeng Chong <jiapeng.chong@xxxxxxxxxxxxxxxxx>,
James Clark <james.clark@xxxxxxxxxx>,
Howard Chu <howardchu95@xxxxxxxxx>,
Weilin Wang <weilin.wang@xxxxxxxxx>,
Stephen Brennan <stephen.s.brennan@xxxxxxxxxx>,
Andi Kleen <ak@xxxxxxxxxxxxxxx>, Dmitry Vyukov <dvyukov@xxxxxxxxxx>,
linux-perf-users@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
Subject: Re: [PATCH v2 4/7] perf intel-tpebs: Avoid race when evlist is being
deleted
Message-ID: <aDdNk1IOqtyM44AX@xxxxxxxxxx>
References: <20250528032637.198960-1-irogers@xxxxxxxxxx>
<20250528032637.198960-5-irogers@xxxxxxxxxx>
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20250528032637.198960-5-irogers@xxxxxxxxxx>
X-Spam-Status: No, score=-6.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,
RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,
RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
Hi Ian,
On Tue, May 27, 2025 at 08:26:34PM -0700, Ian Rogers wrote:
Reading through the evsel->evlist may seg fault if a sample arrives
when the evlist is being deleted. Detect this case and ignore samples
arriving when the evlist is being deleted.
Fixes: bcfab08db7fb ("perf intel-tpebs: Filter non-workload samples")
Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
---
tools/perf/util/intel-tpebs.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/intel-tpebs.c b/tools/perf/util/intel-tpebs.c
index 4ad4bc118ea5..3b92ebf5c112 100644
--- a/tools/perf/util/intel-tpebs.c
+++ b/tools/perf/util/intel-tpebs.c
@@ -162,9 +162,17 @@ static bool is_child_pid(pid_t parent, pid_t child)
static bool should_ignore_sample(const struct perf_sample *sample, const struct tpebs_retire_lat *t)
{
- pid_t workload_pid = t->evsel->evlist->workload.pid;
- pid_t sample_pid = sample->pid;
+ pid_t workload_pid, sample_pid = sample->pid;
+ /*
+ * During evlist__purge the evlist will be removed prior to the
+ * evsel__exit calling evsel__tpebs_close and taking the
+ * tpebs_mtx. Avoid a segfault by ignoring samples in this case.
+ */
+ if (t->evsel->evlist == NULL)
+ return true;
+
+ workload_pid = t->evsel->evlist->workload.pid;
I'm curious if there's a chance of TOCTOU race. It'd certainly help
the segfault but would this code prevent it completely?
Thanks,
Namhyung
if (workload_pid < 0 || workload_pid == sample_pid)
return false;
--
2.49.0.1238.gf8c92423fb-goog
Return-Path: <linux-kernel+bounces-665918-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 790B941E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 13:55:22 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by ny.mirrors.kernel.org (Postfix) with ESMTPS id 9C18F4A45B9
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:55:23 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 38B0028E566;
Wed, 28 May 2025 17:55:17 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="hcUHt/OC"
Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72F9928DF4A
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:55:14 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748454916; cv=none; b=sJjwhskdcoesr0subilluppre5a5AzpzUnLJN2zx+w0iSPX3K1Nbl3ESOS1I9mVu/GfpZHYKQQ4sVZAJIZeYLbbQi3zjxdXvV0Qha4bAaXt2kQHKYQ16nheVfcM6JyA52v3iP0LhyRENjWvbTQGvdz1cQgWsmowHlXAN5MZadhc=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748454916; c=relaxed/simple;
bh=01h+MyEc/wstGESUh023BnZ4kD40ov+K84ec2celARQ=;
h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References:
In-Reply-To:Content-Type; b=tfzA8+iVjpA6bOtHZmiv0xMfZ63TgdDDG5HJNRV2lUhoJqyKumS9ARWRFZfgQee0xSOK+9fhsoTQhHJMdq6EiyaVSWFfsZxzeo9Cxc+xNfFkrrzISvcRFJq2y+BG9A5MeY+wESFmexEXBk7r7iHAMLqjIasvgXR0Uitpz41wHJg=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=hcUHt/OC; arc=none smtp.client-ip=209.85.218.54
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org
Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-ad55464ba80so357566b.0
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 10:55:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=linaro.org; s=google; t=1748454913; x=1749059713; darn=vger.kernel.org;
h=content-transfer-encoding:in-reply-to:autocrypt:content-language
:references:cc:to:subject:from:user-agent:mime-version:date
:message-id:from:to:cc:subject:date:message-id:reply-to;
bh=zKq72M/qEBv2XF5kG5Js6DEWdgDDhp+0iFQY6DFj+VY=;
b=hcUHt/OCFbWIiXlhqPx7FjeCCLeAOapcOSIKmdFpq4RSxENpEjiavt6nE7W5nyIV5I
feOZ+vbLR0B3j58w/5L8B7TtIYG9mcKZcnIpnnvakq9UYYAS9BiW2GemtXFJ98jMhDdG
XqMsu1DN0ayd2tJQZxuyBtd2BFEhh1zLEosrIfGJzBKNoSjX151x8oVad+KawS3Kww13
wL1qlyo1e2s1zsZLhjNA1ehmIRcXC7a4EhiW1f5bXsgTtxj8qi3V1KV8N7z9k3SNWqMj
0oCKc2Njd4q4ksm6VhYNrjL3syHbFKFE4oIsaMQLjzTg2luOe/NlJi/lVAoKwU2+mgXh
NWUA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1748454913; x=1749059713;
h=content-transfer-encoding:in-reply-to:autocrypt:content-language
:references:cc:to:subject:from:user-agent:mime-version:date
:message-id:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to;
bh=zKq72M/qEBv2XF5kG5Js6DEWdgDDhp+0iFQY6DFj+VY=;
b=pJgSpNFXWVVmpNAr1h9BZxrd9QBTsuFtNl4GIm3NnNIIt/BZs6ZBr8bnw+kCqp+Vce
QmPyaRR7NGiFNy/EuSKO1HzGFa3RD/l7NU6udrTJUk6of6iFS8bNwyZ9Kyxr3oLDUeIu
ZIgEeOS9r+UifBmmPoCpzhucSNI8DSbtkL6tH1C+yPNdEyrCyKhHIBy88K4hv1mctByY
+GOPbQAf1V+mnv6XQflbDht3ilLaBOG4M+EQ4DUsGm8EPaHlWynNUDcQV6HaT0LH6M1e
vqsPUgwXT9+Js9KiQoOywhkIbAhfoWf0rwuZQOJ04vO/Wmus11FzLyldK0Slp+AFUmLc
5T/g==
X-Forwarded-Encrypted: i=1; AJvYcCUHqsN0BJf/NJhcBT4ti9ayA+JuW3/6XN0RfLBLcPGoqDuftLe9zRIzJk8tUTj76sOosOJ4yfa1aAA53uo=@vger.kernel.org
X-Gm-Message-State: AOJu0YwJ+OcN9RA3bWuNtw6Cm3RIzLxyWVRxKu1pXPDAlbODtrZSspRj
UzD7zgEvVWvZXxA1kjXt552LQfhtdrIBOvypCWSLb7BEyk1+k++mv8uNHAnWiO8gU2E=
X-Gm-Gg: ASbGnctmixu3SVGUgUIEyoA3THwqJIRUtDy4XuveHsE+aF7YmX/dFNDDak04TmjU5ad
HsIjLtF1xbhAFqPklPuyhGb+c23BqRbu60NHs7Tgw9CCbw7LStduY7Fn7nZS1hfAuG4JZwAHYoQ
oDfsq9r9dxNRBvzBQPPM+tQRQKI8nm0pp0stHWJVf+FYzNnDxXh4holqgmPhgavSDBU91/gTeoK
MVv/gBpDUS4MGbUw1cDMIIrZBPHvCH0A/WV3PvITj5r/RI8Kz1K6kBwX5Tt+a/BBhmsnxMW/VJ3
oTlwfoKXOyFt7VtlGBSAekbyDe34UZj47cSBHkt5V4ffj9jjPfAGEqFvdCiTnQGwZWl+YLM=
X-Google-Smtp-Source: AGHT+IH95g1w/ws+xXJBLuOV0eOuE1EWZf0NM3t92WzHnu25SknjKy+douiXLWJfZWhRht3yMBhn3Q==
X-Received: by 2002:a17:907:2ceb:b0:ad8:9b31:290c with SMTP id a640c23a62f3a-ad89b312d7emr148533866b.14.1748454912580;
Wed, 28 May 2025 10:55:12 -0700 (PDT)
Received: from [192.168.1.29] ([178.197.223.125])
by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ad8a1b5d89bsm141117166b.183.2025.05.28.10.55.08
(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
Wed, 28 May 2025 10:55:11 -0700 (PDT)
Message-ID: <b6b7fb61-878e-4407-b964-564efb3524b1@xxxxxxxxxx>
Date: Wed, 28 May 2025 19:55:07 +0200
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>
Subject: Re: [PATCH 14/17] pinctrl: renesas: Move fixed assignments to
'pinctrl_desc' definition
To: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
Cc: Linus Walleij <linus.walleij@xxxxxxxxxx>,
Basavaraj Natikar <Basavaraj.Natikar@xxxxxxx>,
Shyam Sundar S K <Shyam-sundar.S-k@xxxxxxx>,
Andrew Jeffery <andrew@xxxxxxxxxxxxxxxxxxxx>, Joel Stanley <joel@xxxxxxxxx>,
Avi Fishman <avifishman70@xxxxxxxxx>, Tomer Maimon <tmaimon77@xxxxxxxxx>,
Tali Perry <tali.perry1@xxxxxxxxx>, Patrick Venture <venture@xxxxxxxxxx>,
Nancy Yuen <yuenn@xxxxxxxxxx>, Benjamin Fair <benjaminfair@xxxxxxxxxx>,
=?UTF-8?Q?Jonathan_Neusch=C3=A4fer?= <j.neuschaefer@xxxxxxx>,
=?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= <rafal@xxxxxxxxxx>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@xxxxxxxxxxxx>, Ray Jui <rjui@xxxxxxxxxxxx>,
Scott Branden <sbranden@xxxxxxxxxxxx>,
Geert Uytterhoeven <geert+renesas@xxxxxxxxx>,
David Rhodes <david.rhodes@xxxxxxxxxx>,
Richard Fitzgerald <rf@xxxxxxxxxxxxxxxxxxxxx>,
Charles Keepax <ckeepax@xxxxxxxxxxxxxxxxxxxxx>,
Lorenzo Bianconi <lorenzo@xxxxxxxxxx>, Sean Wang <sean.wang@xxxxxxxxxx>,
Jesper Nilsson <jesper.nilsson@xxxxxxxx>,
Lars Persson <lars.persson@xxxxxxxx>,
Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx>,
Damien Le Moal <dlemoal@xxxxxxxxxx>, Vladimir Zapolskiy <vz@xxxxxxxxx>,
Michal Simek <michal.simek@xxxxxxx>, Emil Renner Berthing <kernel@xxxxxxxx>,
Jianlong Huang <jianlong.huang@xxxxxxxxxxxxxxxx>,
Hal Feng <hal.feng@xxxxxxxxxxxxxxxx>,
Matthias Brugger <matthias.bgg@xxxxxxxxx>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx>,
Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>,
Maxime Coquelin <mcoquelin.stm32@xxxxxxxxx>,
Alexandre Torgue <alexandre.torgue@xxxxxxxxxxx>, linux-gpio@xxxxxxxxxxxxxxx,
linux-kernel@xxxxxxxxxxxxxxx, linux-aspeed@xxxxxxxxxxxxxxxx,
openbmc@xxxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx,
linux-renesas-soc@xxxxxxxxxxxxxxx, linux-sound@xxxxxxxxxxxxxxx,
patches@xxxxxxxxxxxxxxxxxxxxx, linux-mediatek@xxxxxxxxxxxxxxxxxxx,
linux-arm-kernel@xxxxxxxx, linux-riscv@xxxxxxxxxxxxxxxxxxx,
linux-rtc@xxxxxxxxxxxxxxx, linux-stm32@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
References: <20250528-pinctrl-const-desc-v1-0-76fe97899945@xxxxxxxxxx>
<20250528-pinctrl-const-desc-v1-14-76fe97899945@xxxxxxxxxx>
<CAMuHMdUGDf5n_Fg7pwiPumm95nPUXyH15geAy2ULwY3U+OtZJA@xxxxxxxxxxxxxx>
Content-Language: en-US
Autocrypt: addr=krzysztof.kozlowski@xxxxxxxxxx; keydata=
xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79
cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu
JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH
gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE
J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj
NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS
BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU
vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM
Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD
TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8KfN01X5SExAoVTr09ewARAQABzTRLcnp5c3p0b2Yg
S296bG93c2tpIDxrcnp5c3p0b2Yua296bG93c2tpQGxpbmFyby5vcmc+wsGUBBMBCgA+AhsD
BQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAFiEEm9B+DgxR+NWWd7dUG5NDfTtBYpsFAmgXUEoF
CRaWdJoACgkQG5NDfTtBYpudig/+Inb3Kjx1B7w2IpPKmpCT20QQQstx14Wi+rh2FcnV6+/9
tyHtYwdirraBGGerrNY1c14MX0Tsmzqu9NyZ43heQB2uJuQb35rmI4dn1G+ZH0BD7cwR+M9m
lSV9YlF7z3Ycz2zHjxL1QXBVvwJRyE0sCIoe+0O9AW9Xj8L/dmvmRfDdtRhYVGyU7fze+lsH
1pXaq9fdef8QsAETCg5q0zxD+VS+OoZFx4ZtFqvzmhCs0eFvM7gNqiyczeVGUciVlO3+1ZUn
eqQnxTXnqfJHptZTtK05uXGBwxjTHJrlSKnDslhZNkzv4JfTQhmERyx8BPHDkzpuPjfZ5Jp3
INcYsxgttyeDS4prv+XWlT7DUjIzcKih0tFDoW5/k6OZeFPba5PATHO78rcWFcduN8xB23B4
WFQAt5jpsP7/ngKQR9drMXfQGcEmqBq+aoVHobwOfEJTErdku05zjFmm1VnD55CzFJvG7Ll9
OsRfZD/1MKbl0k39NiRuf8IYFOxVCKrMSgnqED1eacLgj3AWnmfPlyB3Xka0FimVu5Q7r1H/
9CCfHiOjjPsTAjE+Woh+/8Q0IyHzr+2sCe4g9w2tlsMQJhixykXC1KvzqMdUYKuE00CT+wdK
nXj0hlNnThRfcA9VPYzKlx3W6GLlyB6umd6WBGGKyiOmOcPqUK3GIvnLzfTXR5DOwU0EVUNc
NAEQAM2StBhJERQvgPcbCzjokShn0cRA4q2SvCOvOXD+0KapXMRFE+/PZeDyfv4dEKuCqeh0
hihSHlaxTzg3TcqUu54w2xYskG8Fq5tg3gm4kh1Gvh1LijIXX99ABA8eHxOGmLPRIBkXHqJY
oHtCvPc6sYKNM9xbp6I4yF56xVLmHGJ61KaWKf5KKWYgA9kfHufbja7qR0c6H79LIsiYqf92
H1HNq1WlQpu/fh4/XAAaV1axHFt/dY/2kU05tLMj8GjeQDz1fHas7augL4argt4e+jum3Nwt
yupodQBxncKAUbzwKcDrPqUFmfRbJ7ARw8491xQHZDsP82JRj4cOJX32sBg8nO2N5OsFJOcd
5IE9v6qfllkZDAh1Rb1h6DFYq9dcdPAHl4zOj9EHq99/CpyccOh7SrtWDNFFknCmLpowhct9
5ZnlavBrDbOV0W47gO33WkXMFI4il4y1+Bv89979rVYn8aBohEgET41SpyQz7fMkcaZU+ok/
+HYjC/qfDxT7tjKXqBQEscVODaFicsUkjheOD4BfWEcVUqa+XdUEciwG/SgNyxBZepj41oVq
FPSVE+Ni2tNrW/e16b8mgXNngHSnbsr6pAIXZH3qFW+4TKPMGZ2rZ6zITrMip+12jgw4mGjy
5y06JZvA02rZT2k9aa7i9dUUFggaanI09jNGbRA/ABEBAAHCwXwEGAEKACYCGwwWIQSb0H4O
DFH41ZZ3t1Qbk0N9O0FimwUCaBdQXwUJFpZbKgAKCRAbk0N9O0Fim07TD/92Vcmzn/jaEBcq
yT48ODfDIQVvg2nIDW+qbHtJ8DOT0d/qVbBTU7oBuo0xuHo+MTBp0pSTWbThLsSN1AuyP8wF
KChC0JPcwOZZRS0dl3lFgg+c+rdZUHjsa247r+7fvm2zGG1/u+33lBJgnAIH5lSCjhP4VXiG
q5ngCxGRuBq+0jNCKyAOC/vq2cS/dgdXwmf2aL8G7QVREX7mSl0x+CjWyrpFc1D/9NV/zIWB
G1NR1fFb+oeOVhRGubYfiS62htUQjGLK7qbTmrd715kH9Noww1U5HH7WQzePt/SvC0RhQXNj
XKBB+lwwM+XulFigmMF1KybRm7MNoLBrGDa3yGpAkHMkJ7NM4iSMdSxYAr60RtThnhKc2kLI
zd8GqyBh0nGPIL+1ZVMBDXw1Eu0/Du0rWt1zAKXQYVAfBLCTmkOnPU0fjR7qVT41xdJ6KqQM
NGQeV+0o9X91X6VBeK6Na3zt5y4eWkve65DRlk1aoeBmhAteioLZlXkqu0pZv+PKIVf+zFKu
h0At/TN/618e/QVlZPbMeNSp3S3ieMP9Q6y4gw5CfgiDRJ2K9g99m6Rvlx1qwom6QbU06ltb
vJE2K9oKd9nPp1NrBfBdEhX8oOwdCLJXEq83vdtOEqE42RxfYta4P3by0BHpcwzYbmi/Et7T
2+47PN9NZAOyb771QoVr8A==
In-Reply-To: <CAMuHMdUGDf5n_Fg7pwiPumm95nPUXyH15geAy2ULwY3U+OtZJA@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,
RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,
RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
On 28/05/2025 14:54, Geert Uytterhoeven wrote:
.pmxops = &rzn1_pmx_ops,
.confops = &rzn1_pinconf_ops,
.owner = THIS_MODULE,
+ .pins = rzn1_pins,
+ .npins = ARRAY_SIZE(rzn1_pins),
};
static int rzn1_pinctrl_parse_groups(struct device_node *np,
@@ -878,8 +880,6 @@ static int rzn1_pinctrl_probe(struct platform_device *pdev)
ipctl->dev = &pdev->dev;
rzn1_pinctrl_desc.name = dev_name(&pdev->dev);
... if you would replace this assignment by a hardcoded name
like "pinctrl-rzn1".
I saw it, but this would not be equivalent. dev_name includes platform
bus id, e.g. pinctrl-rzn1.0 which might matter here - conflict of names.
Are you sure this would work fine?
Best regards,
Krzysztof
Return-Path: <linux-kernel+bounces-665919-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [147.75.80.249])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 60DA241E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 13:56:09 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by am.mirrors.kernel.org (Postfix) with ESMTPS id 2FC5D1BC4D62
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:56:22 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 949CD28DF5F;
Wed, 28 May 2025 17:56:02 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Y+qYLXN2"
Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0DA3428B4F0
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:55:58 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.180
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748454961; cv=none; b=iRMb2zyqD5PxP8QYDkUdCFgAXGGpFVeU7Vlt+J1gtUv8T+nwUnAzb/ADdJ4YxhbmkEDTsVW+PvlJ50wuGmi7pbKOh0JP0jGYmowknMzJv5FBKe/l/n0UOC/Ky9E9TQGHg5nLGh6p6BX0LxRbiFCTC8OpW3POhv9WGO+GX8PoKi0=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748454961; c=relaxed/simple;
bh=ndd8CEHICzgGNBaKkbdfnWB2emvXv9H0Ry9SqsgyBPE=;
h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:
To:Cc:Content-Type; b=iMNhtlKPd+5ZRDxpbQKCJOlej2WFF6E7yAZrnqcnkI9GN+FhZ7btmcUQCSdoILQ31HEKPxyL52EdVNJpkJkpJwa8LOciOF+mRGn2ArM7k5Boun51KL3sZUIzrOmr+jJFyHkqnuTetjGq9BZ887xuBv7LQScF5qpFBmi3kQF/fzM=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Y+qYLXN2; arc=none smtp.client-ip=209.85.166.180
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com
Received: by mail-il1-f180.google.com with SMTP id e9e14a558f8ab-3dd89a85414so20555ab.0
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 10:55:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=google.com; s=20230601; t=1748454958; x=1749059758; darn=vger.kernel.org;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:from:to:cc:subject:date
:message-id:reply-to;
bh=Qb1MJmvZqyIrdb/IicxGAXgYqynABNU/RaCtZ3VgB1w=;
b=Y+qYLXN21hgfKwxG/kOEup2cPECvXpiJnh6jwneh+L458h2f3r9H8qQxYtP9eUdoxI
8uWmw6+OvIIxNiS0ZKeRA6Rm6W32Wgz8GKZ5ORcJuF3BkogbQ+kNWxnvnHbAxiPrXYBH
hHWMKjC7fdb+//M/8DuddtaVMQAJX0fwcv5G0/p5HR2Zm/obVXvP5rm258/uBidjxO6y
DiIoLur4NuMGw832QX99iVhdSGXGmAQjZYtyzDgbCMfp/T1vVsFW/06GKzFYAwkLITdt
lQhnaZDmvvns8pV8KIbw0tYJTN7rCJPPK3Jw3B/kuOkYrXop9Zgin3bXNViCqDFIgK86
8duw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1748454958; x=1749059758;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=Qb1MJmvZqyIrdb/IicxGAXgYqynABNU/RaCtZ3VgB1w=;
b=OGfPowSJi158SgSXjOaVic/gOUgqinpFP1xRzAhCMoqovNiGfH6lYdDGsCN0JTsYjJ
vTe0O3s8XJ4baJceTqPZrOtdg27xkJbU+Lh6RdiPa1DLy1340r8OGin9xikTvuYjrTFB
p5DCF2GOlUMGdH0/8cv0S8kMNCTQL0V2SAqcdXvPoiWvsqahGK/Y6v+fNGhz4ImE/8IF
3MDSa6E7Y6xVshSRMBPMY1HcCzSZpMNmlB24wSibGpfGWXEewlVnftWCQU+RgBNFrrNP
HOW+yJZbUS60/ujUrt0F7cFibQBb+N8DQYte6c8iVhMrxOATNNTTxWlwzMakgdiBPAq5
WwOA==
X-Forwarded-Encrypted: i=1; AJvYcCWbjN5VI2UpsUYqShhx8I4vdjrsFlSkJqyUUQ62Xu1aZYmwa1+6VBAiZ9h8430IhsgJJtXjYqqq4XJjLiE=@vger.kernel.org
X-Gm-Message-State: AOJu0YzZGwbXUdc9rGVztH3sNDFACkiIYjEmsl9uuBBt1bqArVcr3L6v
Aba/p9BM/N9dqfOABpw6DGZmYbgX2QyzTckMyjtoJ6Y9AkfinwYgjLULbyvSq5MJJoB72aWeSBU
0xSmtJHYYm71LHkLO1ZHb/J7W/YVeTBce6Tt2wUis
X-Gm-Gg: ASbGncukoe3Q5y83UebEdTfINohlO6BFRdeWw1usbATUPnG+WCTwpEf2gjAJASWTLsT
+zAy5VJChNI1qZad3R+gzecB9u6YkyEb6s/hFgXMmrKBdUNGYTb/Y7ylBTzo8uQavKztLXL7Cv0
Gsusq3JrN8G83OuVdHo02wquVCh4j8RVEh7d9TVaz1sUb71g9UdRPBmM9QV9mvjqjNOgo5M0ae
X-Google-Smtp-Source: AGHT+IH8H9kdP5QgNHZg9x8SBiy3fEuCuWHxdNZGKht1ofEPXj/3aOU+qzO0C3AcAPo9t/kw6XvTikpgovzRYTXUnTU=
X-Received: by 2002:a05:6e02:3cc1:b0:3dc:8100:5436 with SMTP id
e9e14a558f8ab-3dd919125c1mr210375ab.0.1748454957779; Wed, 28 May 2025
10:55:57 -0700 (PDT)
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
References: <aDcyVLVpZRui1ole@x1> <aDcyvvOKZkRYbjul@x1>
In-Reply-To: <aDcyvvOKZkRYbjul@x1>
From: Ian Rogers <irogers@xxxxxxxxxx>
Date: Wed, 28 May 2025 10:55:45 -0700
X-Gm-Features: AX0GCFu7zK8Os33MqQ2qdqVh8G85GK6V6-l0Hpk2vsnuoLB9Ll6jxi_CYYzViB4
Message-ID: <CAP-5=fWo2eM+aATScvQsBZKj7mZKug6HBW5bEw1Xp_Hqk3m3Vg@xxxxxxxxxxxxxx>
Subject: Re: [PATCH 1/1] Revert "perf thread: Ensure comm_lock held for comm_list"
To: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>, Adrian Hunter <adrian.hunter@xxxxxxxxx>,
Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>,
Athira Rajeev <atrajeev@xxxxxxxxxxxxxxxxxx>, Bill Wendling <morbo@xxxxxxxxxx>,
Chaitanya S Prakash <chaitanyas.prakash@xxxxxxx>, Fei Lang <langfei@xxxxxxxxxx>,
Howard Chu <howardchu95@xxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>,
James Clark <james.clark@xxxxxxxxxx>, Jiri Olsa <jolsa@xxxxxxxxxx>,
Justin Stitt <justinstitt@xxxxxxxxxx>, Kan Liang <kan.liang@xxxxxxxxxxxxxxx>,
Mark Rutland <mark.rutland@xxxxxxx>, Nathan Chancellor <nathan@xxxxxxxxxx>,
Nick Desaulniers <nick.desaulniers+lkml@xxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>,
Stephen Brennan <stephen.s.brennan@xxxxxxxxxx>,
Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, linux-perf-users@xxxxxxxxxxxxxxx
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Status: No, score=-11.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,
MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
On Wed, May 28, 2025 at 8:58=E2=80=AFAM Arnaldo Carvalho de Melo
<acme@xxxxxxxxxx> wrote:
Hi Ian,
This one had hit perf-tools-next, so I'm reverting it till we
figure out, since I'm trying to finish processing patches real soon now
for this window, to give it some time to soak in linux-next.
I noticed that sometimes when trying to exit 'perf top' it just
sat there, so doing a bisect I ended up on this one, had no time to
properly investigate it.
Hi Arnaldo,
I believe it is fixed by:
https://lore.kernel.org/lkml/20250528032637.198960-8-irogers@xxxxxxxxxx/
I was actually trying to repro a DEBUG=3D1 issue I'd seen in `perf top`
with this assert failing:
https://web.git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.gi=
t/tree/tools/perf/util/maps.c?h=3Dperf-tools-next#n80
```
assert(RC_CHK_EQUAL(map__kmap(map)->kmaps, maps));
```
but no dice on that - I suspect it has something to do with modules or
BPF or something.
Anyway, with the patch above `perf top` for me I wasn't able to make
it crash even when being aggressive and running with both address and
memory sanitizer.
Thanks,
Ian
- Arnaldo
On Wed, May 28, 2025 at 12:57:11PM -0300, Arnaldo Carvalho de Melo wrote:
> This reverts commit 8f454c95817d15ee529d58389612ea4b34f5ffb3.
>
> 'perf top' is freezing on exit sometimes, bisected to this one, revert.
>
> Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
> Cc: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
> Cc: Athira Rajeev <atrajeev@xxxxxxxxxxxxxxxxxx>
> Cc: Bill Wendling <morbo@xxxxxxxxxx>
> Cc: Chaitanya S Prakash <chaitanyas.prakash@xxxxxxx>
> Cc: Fei Lang <langfei@xxxxxxxxxx>
> Cc: Howard Chu <howardchu95@xxxxxxxxx>
> Cc: Ian Rogers <irogers@xxxxxxxxxx>
> Cc: Ingo Molnar <mingo@xxxxxxxxxx>
> Cc: James Clark <james.clark@xxxxxxxxxx>
> Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
> Cc: Justin Stitt <justinstitt@xxxxxxxxxx>
> Cc: Kan Liang <kan.liang@xxxxxxxxxxxxxxx>
> Cc: Mark Rutland <mark.rutland@xxxxxxx>
> Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
> Cc: Nathan Chancellor <nathan@xxxxxxxxxx>
> Cc: Nick Desaulniers <nick.desaulniers+lkml@xxxxxxxxx>
> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> Cc: Stephen Brennan <stephen.s.brennan@xxxxxxxxxx>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
> ---
> tools/perf/util/comm.c | 2 --
> tools/perf/util/thread.c | 17 ++++-------------
> tools/perf/util/thread.h | 9 ++++-----
> 3 files changed, 8 insertions(+), 20 deletions(-)
>
> diff --git a/tools/perf/util/comm.c b/tools/perf/util/comm.c
> index 9880247a2c3364cb..8aa456d7c2cd2d74 100644
> --- a/tools/perf/util/comm.c
> +++ b/tools/perf/util/comm.c
> @@ -24,7 +24,6 @@ static struct comm_strs {
> static void comm_strs__remove_if_last(struct comm_str *cs);
>
> static void comm_strs__init(void)
> - NO_THREAD_SAFETY_ANALYSIS /* Inherently single threaded due to pt=
hread_once. */
> {
> init_rwsem(&_comm_strs.lock);
> _comm_strs.capacity =3D 16;
> @@ -120,7 +119,6 @@ static void comm_strs__remove_if_last(struct comm_s=
tr *cs)
> }
>
> static struct comm_str *__comm_strs__find(struct comm_strs *comm_strs,=
const char *str)
> - SHARED_LOCKS_REQUIRED(comm_strs->lock)
> {
> struct comm_str **result;
>
> diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
> index c202b98b36c29215..415c0e5d1e751a47 100644
> --- a/tools/perf/util/thread.c
> +++ b/tools/perf/util/thread.c
> @@ -41,7 +41,6 @@ int thread__init_maps(struct thread *thread, struct m=
achine *machine)
> }
>
> struct thread *thread__new(pid_t pid, pid_t tid)
> - NO_THREAD_SAFETY_ANALYSIS /* Allocation/creation is inherently si=
ngle threaded. */
> {
> RC_STRUCT(thread) *_thread =3D zalloc(sizeof(*_thread));
> struct thread *thread;
> @@ -203,29 +202,22 @@ int thread__set_namespaces(struct thread *thread,=
u64 timestamp,
>
> struct comm *thread__comm(struct thread *thread)
> {
> - struct comm *res =3D NULL;
> + if (list_empty(thread__comm_list(thread)))
> + return NULL;
>
> - down_read(thread__comm_lock(thread));
> - if (!list_empty(thread__comm_list(thread)))
> - res =3D list_first_entry(thread__comm_list(thread), struc=
t comm, list);
> - up_read(thread__comm_lock(thread));
> - return res;
> + return list_first_entry(thread__comm_list(thread), struct comm, l=
ist);
> }
>
> struct comm *thread__exec_comm(struct thread *thread)
> {
> struct comm *comm, *last =3D NULL, *second_last =3D NULL;
>
> - down_read(thread__comm_lock(thread));
> list_for_each_entry(comm, thread__comm_list(thread), list) {
> - if (comm->exec) {
> - up_read(thread__comm_lock(thread));
> + if (comm->exec)
> return comm;
> - }
> second_last =3D last;
> last =3D comm;
> }
> - up_read(thread__comm_lock(thread));
>
> /*
> * 'last' with no start time might be the parent's comm of a synt=
hesized
> @@ -241,7 +233,6 @@ struct comm *thread__exec_comm(struct thread *threa=
d)
>
> static int ____thread__set_comm(struct thread *thread, const char *str=
,
> u64 timestamp, bool exec)
> - EXCLUSIVE_LOCKS_REQUIRED(thread__comm_lock(thread))
> {
> struct comm *new, *curr =3D thread__comm(thread);
>
> diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h
> index 56e08c8ae005e82b..cd574a896418ac94 100644
> --- a/tools/perf/util/thread.h
> +++ b/tools/perf/util/thread.h
> @@ -236,15 +236,14 @@ static inline struct rw_semaphore *thread__namesp=
aces_lock(struct thread *thread
> return &RC_CHK_ACCESS(thread)->namespaces_lock;
> }
>
> -static inline struct rw_semaphore *thread__comm_lock(struct thread *th=
read)
> +static inline struct list_head *thread__comm_list(struct thread *threa=
d)
> {
> - return &RC_CHK_ACCESS(thread)->comm_lock;
> + return &RC_CHK_ACCESS(thread)->comm_list;
> }
>
> -static inline struct list_head *thread__comm_list(struct thread *threa=
d)
> - SHARED_LOCKS_REQUIRED(thread__comm_lock(thread))
> +static inline struct rw_semaphore *thread__comm_lock(struct thread *th=
read)
> {
> - return &RC_CHK_ACCESS(thread)->comm_list;
> + return &RC_CHK_ACCESS(thread)->comm_lock;
> }
>
> static inline u64 thread__db_id(const struct thread *thread)
> --
> 2.49.0
>
Return-Path: <linux-kernel+bounces-665920-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 7A32841E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 13:57:16 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by ny.mirrors.kernel.org (Postfix) with ESMTPS id A3F0C4A4EAB
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:57:17 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 311FC28DF5F;
Wed, 28 May 2025 17:57:11 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hjYUKwoL"
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201])
(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 6F8C91F37D3;
Wed, 28 May 2025 17:57:10 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748455030; cv=none; b=QcrnSTx6aJcD00hBGrVTfQHcnt0igkISWPW5z2t3XmnUVFP3uvSWnwd7zsPM0RY5CiWohERfYLoW7THaQNqBHOxSU+HajZwIQdWmQmM30prittm2eCEtR1qO/LI0szhxxCGBXX8x6IczLJnPbH4mFcMoXoWBLM1271wgynZQVLU=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748455030; c=relaxed/simple;
bh=VcMITpVr5gWwvB865s/OTvpGuzUj1bOsEtSF/dD4XZY=;
h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=d5ec/rGInKCFUIA4WkcvsJNmHS8yylcmTcoiEuqxqibhzROED6twDrmWuYI3TbliwoSTObwF1Y/QYMroYS1UgyRrft5htOEcmn7bT435emg8vjsalhxQTpVsVCSOQOkUSZVoVhowPIp8EQHPloDeCoof89RWKcQlbANMSELC804=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hjYUKwoL; arc=none smtp.client-ip=10.30.226.201
Received: by smtp.kernel.org (Postfix) with ESMTPS id D5558C4CEE3;
Wed, 28 May 2025 17:57:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
s=k20201202; t=1748455029;
bh=VcMITpVr5gWwvB865s/OTvpGuzUj1bOsEtSF/dD4XZY=;
h=From:Date:Subject:To:Cc:Reply-To:From;
b=hjYUKwoLJ0SCGq7IOOtEC3HIsb7/6992uKIsixcRsoF9+TXNNvivw6YDE540ZNLDK
NMWFrW6RQfLzJVPyA6CyQD1r6RDPD0toM2Ema4cJoAU/dWCVS+n4DvpOcIbkFDlwN3
HcRtz+3MyTZM/qjeXBLhJjX74PIK35tUp6tYKJolCQsiy9eIfsfqrZUWUb4msn8Xgq
zHYBknm4gjEIp0e0q+Y5SXZCb26a3Q0ragUQS/cDptrmcbBaAXjAbmGgcAmzGDNwh/
dyQDl4NRlmES5ulplAUroYpF9XXvtAQ0nHjvs8w40GrbOKzZNIGoingiY225GNV9VK
m77psZn0ZYNHA==
Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1])
by smtp.lore.kernel.org (Postfix) with ESMTP id C3D2CC3ABB2;
Wed, 28 May 2025 17:57:09 +0000 (UTC)
From: meowmeowbeanz via B4 Relay <devnull+meowmeowbeanz.gmx.com@xxxxxxxxxx>
Date: Wed, 28 May 2025 10:56:58 -0700
Subject: [PATCH] ASoC: amd: yc: Add support for Lenovo Yoga 7 16ARP8
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20250528-yoga-7-16arp8-microphone-fix-v1-1-bfeed2ecd0c2@xxxxxxx>
X-B4-Tracking: v=1; b=H4sIAGlON2gC/x3MTQqAIBBA4avIrBsw+6WrRAvRqWaRyghRRHdPW
n5v8R7IJEwZJvWA0MmZYyioKwVut2EjZF8MRptOd2bEO24WB6x7K2nEg53EtMdAuPKFpAfv2r5
tSBsoiyRU8r+fl/f9AJXfnF1uAAAA
X-Change-ID: 20250528-yoga-7-16arp8-microphone-fix-e07dc4643e02
To: Liam Girdwood <lgirdwood@xxxxxxxxx>, Mark Brown <broonie@xxxxxxxxxx>,
Jaroslav Kysela <perex@xxxxxxxx>, Takashi Iwai <tiwai@xxxxxxxx>
Cc: linux-sound@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx,
mario.limonciello@xxxxxxx, alsa-devel@xxxxxxxxxxxxxxxx,
meowmeowbeanz <meowmeowbeanz@xxxxxxx>
X-Mailer: b4 0.14.2
X-Developer-Signature: v=1; a=ed25519-sha256; t=1748455029; l=1199;
i=meowmeowbeanz@xxxxxxx; s=20250528; h=from:subject:message-id;
bh=pwC5yCZaXPRUyPuizllISjCOfre1eAHhzXvSoc3WKtk=;
b=JdOuKTlrwAqDQaZnvlonVdIhlTPvxaOs7dr5et2hG5rqVyEKcXes5mNivLjLvz99mNAPqMp06
KB/7zo6ufxxBiPBOsw3yUubthEW1aCB2WNPc+VfsoGaaUcvddWrzXJn
X-Developer-Key: i=meowmeowbeanz@xxxxxxx; a=ed25519;
pk=gUBt2QAUfouneGh4/++G7dhBBU8WNcaw4woqB/QUV5M=
X-Endpoint-Received: by B4 Relay for meowmeowbeanz@xxxxxxx/20250528 with
auth_id=415
X-Original-From: meowmeowbeanz <meowmeowbeanz@xxxxxxx>
Reply-To: meowmeowbeanz@xxxxxxx
X-Spam-Status: No, score=-6.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,
RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,
RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
From: meowmeowbeanz <meowmeowbeanz@xxxxxxx>
Add DMI quirk entry for Lenovo Yoga 7 16ARP8 (83BS) to enable
digital microphone support via ACP driver.
Fixes microphone detection on this specific model which was
previously falling back to non-functional generic audio paths.
Tested-by: meowmeowbeanz <meowmeowbeanz@xxxxxxx>
Signed-off-by: meowmeowbeanz <meowmeowbeanz@xxxxxxx>
---
sound/soc/amd/yc/acp6x-mach.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/sound/soc/amd/yc/acp6x-mach.c b/sound/soc/amd/yc/acp6x-mach.c
index 3d9da93d22ee84914a92cfdc1de7b977dfd3bfa4..7e62445e02c1d0632f5f5e35cf97265f42829ba0 100644
--- a/sound/soc/amd/yc/acp6x-mach.c
+++ b/sound/soc/amd/yc/acp6x-mach.c
@@ -311,6 +311,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "83AS"),
}
},
+ {
+ .driver_data = &acp6x_card,
+ .matches = {
+ DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "83BS"),
+ }
+ },
{
.driver_data = &acp6x_card,
.matches = {
---
base-commit: 76f8d35964e4de1b464de22e4f3fdc14937ed854
change-id: 20250528-yoga-7-16arp8-microphone-fix-e07dc4643e02
Best regards,
--
meowmeowbeanz <meowmeowbeanz@xxxxxxx>
Return-Path: <linux-kernel+bounces-665921-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 04A6941E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 13:58:26 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by ny.mirrors.kernel.org (Postfix) with ESMTPS id A7BB04E4AC4
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:58:26 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B43F28E58F;
Wed, 28 May 2025 17:58:17 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="ZImflwET"
Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 912AF284B37
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:58:14 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.50
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748455096; cv=none; b=TycdYWnUQzJX0oFYgg/B6g/98YXleLuzoOcbuXPrc+nwERCwPfWVZrENhMGsaVLBi40PgiwkPyHAENzoG074SZKgBpaKQYpvrtSiHXrijwzvUGsfRvQS5KYkSX/0bud5QVhlAajyUIZSFvFp4TOPkneBFaJCUzyF+GWzs9KWZc0=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748455096; c=relaxed/simple;
bh=Wu8Qd9FiU6inqCzueW3NRzh0omS6N0fenEqb36T6nFw=;
h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=h2Vyz/IHUzdysmQxmxM9yWZxUs2HinZnFfQzKRXXpbFtv/u3AatCBkWFaxRiZy6QW3IpPbhMZSdrgh0eNgyks/lz51b/8FtjPIeZSNMf97KD+avxYM0iiRJ77XJSBbDf43+qn1ivNY1rQOlALmsuWzUu6JQlr9PzcR9JT0GQmEg=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=ZImflwET; arc=none smtp.client-ip=209.85.167.50
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org
Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-551fe46934eso152172e87.1
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 10:58:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=chromium.org; s=google; t=1748455093; x=1749059893; darn=vger.kernel.org;
h=cc:to:content-transfer-encoding:mime-version:message-id:date
:subject:from:from:to:cc:subject:date:message-id:reply-to;
bh=kzFgavdSyDqHHNXkt2J4xgZKm3j7gao2JNbhpmib1do=;
b=ZImflwETacRDOChq28AYpDpHWZ3OFKOcYbveJlg/FqC/5dwpuvGC1FWjEXtQ3as8PX
vkx4mhMHzMseMZ1eK+g3Gk4wATIBRbBuMCjeerLnZuyc7MesGV0ua8wdyFQwx/p7MfEU
234nBbG1GQRpyvPvlxchprmujHe6fXe1KKO50=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1748455093; x=1749059893;
h=cc:to:content-transfer-encoding:mime-version:message-id:date
:subject:from:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to;
bh=kzFgavdSyDqHHNXkt2J4xgZKm3j7gao2JNbhpmib1do=;
b=VLR+es+J5yynewQLGd51xLiK3jR+3aXmNZfKZn3MQtVEOMsF0YJRee0XkmnHDcC15r
eFC6DU+ZP2Rtb63fTmHqNZUuis/2Tw5qXKmPShqOOkSpnRcnmL89cq4I9su6zQjJX+Pp
Tj4cnhtxEeIZgp6/XT2zTn34Yyh7WQPsvy1K1l56rlxUyVfZ27rOH/DO2V+1IfrP+wiW
SYVAcm+qz1Rs72fGfzCAD+lDOo1NbjUru6ucAanQ4aT82ZZ2TCOPRspkm5ei/CnInM3J
l2sNjTSXMOZbMeWjKtKAYpJGbkeWqU6NyNVYeaXuZaYAnzD6M1PZleuzlNUslAQnfq+S
a5cw==
X-Forwarded-Encrypted: i=1; AJvYcCUpdrAC62gyFw27bDd/070/2VE0mqJCG/tsr3Ju3qm+1ZeVFekQRPhFNOhgYEFycojqkami1bQs3fG5k5E=@vger.kernel.org
X-Gm-Message-State: AOJu0YyNzn9/04vevg8AYSMcOCVFekCCAAHUBdGCIQZUpR/873CNsZf2
NV+wkh3T2Y/OxrOVqXTXfdq4wy8Gn9j7UrcVQJKXT+19lpg4AXFASzLjrQYsVqpxjA==
X-Gm-Gg: ASbGncvSX0RnPBkvoTkPaq5+BVje0sPSx3lL4bKGiPzgYNw2n7UOZ7EqZedrhayNDyO
pfTbzKjM+FcLX3AC066mk05RxaIz1lchjthihr6yDCK0aoSyo6H9X8f+IoekbKlk38BjxrN3Bf5
+HdTQMrFnk8VX9Guci5M9+W/cYCHvZuRYJtEjqlPF3tgeFoaztfQteQc7ls2617dq6AJD/RWdYb
M/lf7rgJC+W7KNGLqzz0OKTNOxFz0CVJQ443IgNWgtAbIqBoZg6EKhcn/sV1GZbsymC+3YWeeHf
XvAYuRJd4WttKgcCzqpXNrA3m8dc5ErO7JIqlZwyzPRvw16WEbrMw1nKDPmiKd9Wm4ImHT1AJ2u
3Wn26nZR9EJA8acD8skhChXOzeQ==
X-Google-Smtp-Source: AGHT+IFmXNA1x3cKGkohmbscbqDVnwjr1zoq1zU6zt0PGtiaKkkbxw9BXda045Z3E4GwMNEGnr5Krg==
X-Received: by 2002:a05:6512:138d:b0:549:8c0c:ea15 with SMTP id 2adb3069b0e04-55335ac3bc8mr222761e87.0.1748455092601;
Wed, 28 May 2025 10:58:12 -0700 (PDT)
Received: from ribalda.c.googlers.com (90.52.88.34.bc.googleusercontent.com. [34.88.52.90])
by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5532f62a6eesm376805e87.98.2025.05.28.10.58.12
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 28 May 2025 10:58:12 -0700 (PDT)
From: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
Subject: [PATCH 0/9] media: uvcvideo: Invert granular PM logic + PM fix
Date: Wed, 28 May 2025 17:57:55 +0000
Message-Id: <20250528-uvc-grannular-invert-v1-0-d01581f9cc25@xxxxxxxxxxxx>
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
X-B4-Tracking: v=1; b=H4sIAKRON2gC/x3MQQqEMAxA0atI1gZsa8HOVQYXpUYNSBzSsQji3
S0u3+L/CzIpU4ZPc4FS4cy7VJi2gbRGWQh5qgbbWd95O+BREi4aRY4tKrIU0j+aECfXJx9cMFD
Tn9LM57v9jvf9AHOO1o9mAAAA
X-Change-ID: 20250528-uvc-grannular-invert-19ad34c59391
To: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>,
Hans de Goede <hdegoede@xxxxxxxxxx>,
Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>,
Hans Verkuil <hverkuil@xxxxxxxxx>
Cc: linux-media@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx,
Ricardo Ribalda <ribalda@xxxxxxxxxxxx>, Hans Verkuil <hans@xxxxxxxxxxxx>,
Hans de Goede <hansg@xxxxxxxxxx>
X-Mailer: b4 0.14.2
X-Spam-Status: No, score=-6.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,
MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
It makes more sense to have a list of the ioctls that need power than
the other way around. This patchset takes care of this.
It also fixes one error in the PM logic introduced in a recent patchset.
To support CI I have included two patches that are in uvc/next but not
in media-committer:
media: uvcvideo: Refactor uvc_queue_streamon
media: uvcvideo: Refactor uvc_v4l2_compat_ioctl32
Do not review them again.
To avoid conflicts I am adding the fop patchset as well:
media: uvcvideo: Use vb2 ioctl and fop helpers
media: uvcvideo: Remove stream->is_streaming field
Please review them in https://patchwork.linuxtv.org/project/linux-media/list/?series=15514
Signed-off-by: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
---
Hans Verkuil (1):
media: uvcvideo: Use vb2 ioctl and fop helpers
Ricardo Ribalda (8):
media: uvcvideo: Refactor uvc_queue_streamon
media: uvcvideo: Refactor uvc_v4l2_compat_ioctl32
media: uvcvideo: Remove stream->is_streaming field
media: uvcvideo: Turn on the camera if V4L2_EVENT_SUB_FL_SEND_INITIAL
media: uvcvideo: Do not enable camera during UVCIOC_CTRL_MAP32
media: uvcvideo: uvc_v4l2_unlocked_ioctl: Invert PM logic
media: uvcvideo: Do not turn on the camera unless is needed
media: uvcvideo: Support granular power saving for compat syscalls
drivers/media/usb/uvc/uvc_ctrl.c | 8 +
drivers/media/usb/uvc/uvc_driver.c | 34 +---
drivers/media/usb/uvc/uvc_metadata.c | 8 +-
drivers/media/usb/uvc/uvc_queue.c | 143 ---------------
drivers/media/usb/uvc/uvc_v4l2.c | 339 +++++++----------------------------
drivers/media/usb/uvc/uvcvideo.h | 38 +---
drivers/media/v4l2-core/v4l2-ioctl.c | 3 +-
include/media/v4l2-ioctl.h | 1 +
8 files changed, 87 insertions(+), 487 deletions(-)
---
base-commit: 5e1ff2314797bf53636468a97719a8222deca9ae
change-id: 20250528-uvc-grannular-invert-19ad34c59391
Best regards,
--
Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
Return-Path: <linux-kernel+bounces-665922-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id C78DE41E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 13:58:32 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by ny.mirrors.kernel.org (Postfix) with ESMTPS id 0EFAE4E4C1D
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:58:33 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 9790E28E5E3;
Wed, 28 May 2025 17:58:17 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="hEioQEYj"
Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0CD8F17B50A
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:58:14 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.47
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748455096; cv=none; b=L3JWz08UU6bRmFhS55oik6xibILYtP+dqRj2x+SnGGgueB/kHDRUWBGw2HRxjgyICOBA59+xaBybFdPSoSlMSSuQugO5+NPp9utPIA+Uu87csuxoSTXsLEUCJZe+ExEihe8dcem0zbGgCptC3gCBCkvbBcnigdxtOxNCNIUijLo=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748455096; c=relaxed/simple;
bh=GiBxw+zm//U/C+YTQyovbdu6MSyJ+bZDAcgLx/2Kbzg=;
h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:
In-Reply-To:To:Cc; b=KF7oP80z7de9zfFEdYBriLOnZHuJOTAOyiPoU5SIZxMY9y+ciFsybGp/KVIFMEut5n3a5qo8uyHWKwObt7Ixloe3y5j9lAmmBIJPCI0GVVHDsT2WXeS4DExVngPq+UuyZTf8BhenngRxFBFyRSWttYH6+QElrMU9ygHEY3RTZy4=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=hEioQEYj; arc=none smtp.client-ip=209.85.167.47
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org
Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-5533303070cso968090e87.2
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 10:58:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=chromium.org; s=google; t=1748455093; x=1749059893; darn=vger.kernel.org;
h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
:mime-version:subject:date:from:from:to:cc:subject:date:message-id
:reply-to;
bh=B3ix9DwpCMClF3M2JTkGqryLw82zMUUM9JySNSXWuyo=;
b=hEioQEYj+rHQRZDZqjzH9Bftp1Av0E/CC5Ab8HjlwowUY6T0Pf78V6LKhtOontDeVT
KL1AMkSKCCmuVvk+YyWYLu5d1pPBSSYIiSfqwjqeq/ewfDXnGPYoQah3sh6e3W8YUNcN
GsdLtMz46mMay2HfVZn/Go9WPlcfi/bvORwxA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1748455093; x=1749059893;
h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
:mime-version:subject:date:from:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=B3ix9DwpCMClF3M2JTkGqryLw82zMUUM9JySNSXWuyo=;
b=Bil3KI+r0EgEbN+fNdvStVmNLuivd8PaAwSGXAfjl9Wlmm3I5Xguit8DjHQBmZmGS1
cG5JHti344iTcjfE9ZSsuqKNAhVVAupi3w78slVcseq2N1sA3xLj9I3iNAgJEJyFrUe/
oFPrfMhvZyNNudskSPTp40PivPb+G2QbAZv6TVX6HULd8WnrPZSK+Hl7KG89Unl4shHu
Qxu1vPkykymkELwYhWBx/QM//xhg5vHsBaQ3ZxIDtwDTlDVvZCL0jrWmrWC+SAS1SHFK
/er8vK22Y8vcxKeDlwXRXi/HlmS+q4sg/jZJmdYzfNUXa0ktnRYOxiVMHTGwf1deSazm
z7Jw==
X-Forwarded-Encrypted: i=1; AJvYcCW/XD3Oow+YHLvXh90rD9VKqbRnpaW5NfKtN1quYK/YC9jMfRt8H4kqnximvQ6RKubZeerdzOETqAGvYtw=@vger.kernel.org
X-Gm-Message-State: AOJu0YxUb2y3xeyg8u7lFOU6kOArJoinXjr+r5/1KL2qbUpe/Lj3PY8V
+nUaXhCiI8FeENStGulcF88EXkLJBsXAM/RALrmPUkdYM6iPJe+lToeVsQJwZbFPFQ==
X-Gm-Gg: ASbGncubM+rtt4h58R0zNxVJkFbTJolFwNMJJziXBg1ec6gjHxz9Ru+R0BHRwHZS7Wo
MPinKcVAKDj2BwmlHlr5Flo+dY8DEIGN9geWnS3xMKWgvzVJi7t55nOlkLbYEPePXPPUdDukhnN
aZPhFxf2tnz+F6oJnOCRIWR9jN6JkMnjxOjw3BtoExeTe9a/0mwVKdzJSI0u5VPmtGQZV+OStHV
NH704V+H0Zfj3CzNiqqiZFFOulYU5mNxsaadg+6sqr8CG8oc/v+ipwxssO+4nAVYfUDnGNRS4d9
Q15dlhE29ok4ZysrlUD5fBxql7IZRL8dR/vXtVQNdI/vzY7xYA8tFTNVeo8TW/OBtxsHV3J0YE2
nJtyfOsRH1JZZqJrd6LRpu0YNUQ==
X-Google-Smtp-Source: AGHT+IG8Ik02jUgFA76IfXTO5TiYpbVuuWGX8ycRq2oZO4GvQe/uL9xzy0M7+OF/XwRGSYiVVuG2tA==
X-Received: by 2002:a05:6512:31cd:b0:553:34b7:5731 with SMTP id 2adb3069b0e04-55334b7581bmr712001e87.3.1748455093108;
Wed, 28 May 2025 10:58:13 -0700 (PDT)
Received: from ribalda.c.googlers.com (90.52.88.34.bc.googleusercontent.com. [34.88.52.90])
by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5532f62a6eesm376805e87.98.2025.05.28.10.58.12
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 28 May 2025 10:58:12 -0700 (PDT)
From: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
Date: Wed, 28 May 2025 17:57:56 +0000
Subject: [PATCH 1/9] media: uvcvideo: Refactor uvc_queue_streamon
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20250528-uvc-grannular-invert-v1-1-d01581f9cc25@xxxxxxxxxxxx>
References: <20250528-uvc-grannular-invert-v1-0-d01581f9cc25@xxxxxxxxxxxx>
In-Reply-To: <20250528-uvc-grannular-invert-v1-0-d01581f9cc25@xxxxxxxxxxxx>
To: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>,
Hans de Goede <hdegoede@xxxxxxxxxx>,
Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>,
Hans Verkuil <hverkuil@xxxxxxxxx>
Cc: linux-media@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx,
Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
X-Mailer: b4 0.14.2
X-Spam-Status: No, score=-6.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,
MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
Do uvc_pm_get before we call uvc_queue_streamon. Although the current
code is correct, uvc_ioctl_streamon is allways called after uvc_pm_get,
this change makes the code more resiliant to future changes.
Suggested-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
Signed-off-by: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
Reviewed-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
Link: https://lore.kernel.org/r/20250509-uvc-followup-v1-2-73bcde30d2b5@xxxxxxxxxxxx
Signed-off-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
---
drivers/media/usb/uvc/uvc_v4l2.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
index 668a4e9d772c6d91f045ca75e2744b3a6c69da6b..862b4e34e5b629cf324479a9bb59ebe8784ccd5d 100644
--- a/drivers/media/usb/uvc/uvc_v4l2.c
+++ b/drivers/media/usb/uvc/uvc_v4l2.c
@@ -853,15 +853,16 @@ static int uvc_ioctl_streamon(struct file *file, void *fh,
if (handle->is_streaming)
return 0;
- ret = uvc_queue_streamon(&stream->queue, type);
+ ret = uvc_pm_get(stream->dev);
if (ret)
return ret;
- ret = uvc_pm_get(stream->dev);
+ ret = uvc_queue_streamon(&stream->queue, type);
if (ret) {
- uvc_queue_streamoff(&stream->queue, type);
+ uvc_pm_put(stream->dev);
return ret;
}
+
handle->is_streaming = true;
return 0;
--
2.49.0.1266.g31b7d2e469-goog
Return-Path: <linux-kernel+bounces-665923-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 739B941E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 13:58:41 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by ny.mirrors.kernel.org (Postfix) with ESMTPS id E67F74E4C7E
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:58:39 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 328E128E5FA;
Wed, 28 May 2025 17:58:18 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="R4bOeQyY"
Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C36128B4F0
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:58:15 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.53
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748455097; cv=none; b=cYvKf0eMbJgKJFcI8XP1Co1XibhAgaiSEyOLDjf2ZF2tOM8RoRAeWzh5dJTh6dEPAot0oDzOkP1aV7x6vI/RmWe4X3IyJPwUivKEtCPdUOyz0RExTAGUtuV7nlqIvAP/mWefhp2NAzpIT+IEqBGef81Hh4lj933baegv+wRO7wc=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748455097; c=relaxed/simple;
bh=B0jNGSufNvPJuCam1LbtuPADRfe/FotYKW4NrWm/oXQ=;
h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:
In-Reply-To:To:Cc; b=HFViTSBEEN7W32nQa7Fnb34EB9lFbG0f0gtqDUNoHiX94lZTITRyW6hu7AXdQ0OFQo89qH5q7UBxCX8pZCp5u4bUA7CdGqNk1M1HPc1F1ZWi36CEETr6Ajj4f5jKcSrPY1VSyBcirr/pBM3/kSbn9Q3pbTCMYr6HdMGGvI6t5A8=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=R4bOeQyY; arc=none smtp.client-ip=209.85.167.53
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org
Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-553280c345cso22523e87.0
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 10:58:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=chromium.org; s=google; t=1748455093; x=1749059893; darn=vger.kernel.org;
h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
:mime-version:subject:date:from:from:to:cc:subject:date:message-id
:reply-to;
bh=ZuqigEavLUIFRcdMGWtAXF6BHoROJfpc2OWkY3rCm9o=;
b=R4bOeQyYUuNLTp0YCbwEKuNm5OnjTvnhLt1Ql4cgb6qEHX/Ylp4IXy1cnbIZHJg+BE
MYz+KRHzxTCSi7bwgaux4QrwcQLw4nJ5S8wuaY4d4AYbPDhFVwhjBEWpBcDbwTiJsMIv
F7s+euQi2VxiwIYzGp21+52LWugrbg31D4gDk=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1748455093; x=1749059893;
h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
:mime-version:subject:date:from:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=ZuqigEavLUIFRcdMGWtAXF6BHoROJfpc2OWkY3rCm9o=;
b=jVOGraIyKKWpWjG6bFZbf9dybnWxdSvjy3PwZAR3x/t3Z+uMwedMvh+CWcYyyB4T/x
A8Ngsr8oIK7xHupsqqC6CHZx92hLlC36Ywc68wwP0eJVeLAcMDObJjaIHtoMwpOBxfZE
cJnQYobSmoVwBfP6UD0Jhu3fkIGiA5uJe3ZKYIUi7fyj1yqm+DKpWETUsohet0v8rkD6
MoPnZ7auTa8kbqh+FEykoxUM39u4LdcQs2PclF5Uz8mZC/FsDjep8n12dHAzAvt6duYT
qDCfpiQGLHqYIK6yWR7/++w/u7L/kPWscaevu3m/gkNH8Z/ROZzsi2kkCi+grQ/jNhxj
KcAg==
X-Forwarded-Encrypted: i=1; AJvYcCUac52iq4QsBuYEWN1qz7vB5xlggNHUJVsC3O2X6j3Qa4t51/k1lwELlhclsG3HBfciqGsXthF2d4++T2c=@vger.kernel.org
X-Gm-Message-State: AOJu0YyKdXv1gPv5rZ2ftKSSKbooUpWVIK0sM6cN+rpWQIjB9o5w7zuP
fMF3Gs6H22wHI5u479raEr4puVs/VdcZ6QwJfzZBDGkOQpenQvErAWXv3xG1HlDa9A==
X-Gm-Gg: ASbGnct1ek/hu8PNfCF5CxyKNAIdF4pWoI9SWsdFu2tBVUZpZKowwHfKg3yTHmCOXbS
xRVJmAyL7UExIxporRAdzSSYm1DWYH9E1zRy4tIIMAddsPzkFt1X1Xy4dtQZOaocjEI1cKQOG7g
CtSlGxfgMnbEQZQsI3Hrl6MBg6GWKczM2vJvspFu/hMyQPeByvn9evIWRfrxbASIwkiQ8sDhzW6
bYRgSH9U9YGqWeDfrWoTv3wt5tdeLlWUlALlbIJPvxXIZ9PeDOts/1TeSYOShqy+bg8EyuXakrt
K+au2WUJkuBrmWQ7/q3c+N3nec7jDTH2OJGFFp0AgoVuJDIsUfwYRBlYGEpiQ4o5aT2tSANxHYp
7XwN1jTo44S7gXH7ddqAUqnD8oQ==
X-Google-Smtp-Source: AGHT+IGtfA2QUrrwfNGeJ51zXmyU21n4oPCCQEdOZj56bSgqq99gARUJkrRoMcxAFmVr9Wh8ebDDmg==
X-Received: by 2002:a05:6512:3da7:b0:553:2e10:a79e with SMTP id 2adb3069b0e04-5532e10a9ebmr1533023e87.14.1748455093493;
Wed, 28 May 2025 10:58:13 -0700 (PDT)
Received: from ribalda.c.googlers.com (90.52.88.34.bc.googleusercontent.com. [34.88.52.90])
by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5532f62a6eesm376805e87.98.2025.05.28.10.58.13
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 28 May 2025 10:58:13 -0700 (PDT)
From: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
Date: Wed, 28 May 2025 17:57:57 +0000
Subject: [PATCH 2/9] media: uvcvideo: Refactor uvc_v4l2_compat_ioctl32
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20250528-uvc-grannular-invert-v1-2-d01581f9cc25@xxxxxxxxxxxx>
References: <20250528-uvc-grannular-invert-v1-0-d01581f9cc25@xxxxxxxxxxxx>
In-Reply-To: <20250528-uvc-grannular-invert-v1-0-d01581f9cc25@xxxxxxxxxxxx>
To: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>,
Hans de Goede <hdegoede@xxxxxxxxxx>,
Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>,
Hans Verkuil <hverkuil@xxxxxxxxx>
Cc: linux-media@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx,
Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
X-Mailer: b4 0.14.2
X-Spam-Status: No, score=-6.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,
MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
Declaring a variable for doing automatic cleanup is not a very common
pattern. Replace the cleanup macro with manual cleanup to make the code
simpler.
Suggested-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
Signed-off-by: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
Reviewed-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
Link: https://lore.kernel.org/r/20250509-uvc-followup-v1-3-73bcde30d2b5@xxxxxxxxxxxx
Signed-off-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
---
drivers/media/usb/uvc/uvc_v4l2.c | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
index 862b4e34e5b629cf324479a9bb59ebe8784ccd5d..1abdf1ea39956bbbadd3f166f37bdac518068648 100644
--- a/drivers/media/usb/uvc/uvc_v4l2.c
+++ b/drivers/media/usb/uvc/uvc_v4l2.c
@@ -1382,11 +1382,9 @@ static int uvc_v4l2_put_xu_query(const struct uvc_xu_control_query *kp,
#define UVCIOC_CTRL_MAP32 _IOWR('u', 0x20, struct uvc_xu_control_mapping32)
#define UVCIOC_CTRL_QUERY32 _IOWR('u', 0x21, struct uvc_xu_control_query32)
-DEFINE_FREE(uvc_pm_put, struct uvc_device *, if (_T) uvc_pm_put(_T))
static long uvc_v4l2_compat_ioctl32(struct file *file,
unsigned int cmd, unsigned long arg)
{
- struct uvc_device *uvc_device __free(uvc_pm_put) = NULL;
struct uvc_fh *handle = file->private_data;
union {
struct uvc_xu_control_mapping xmap;
@@ -1399,38 +1397,38 @@ static long uvc_v4l2_compat_ioctl32(struct file *file,
if (ret)
return ret;
- uvc_device = handle->stream->dev;
-
switch (cmd) {
case UVCIOC_CTRL_MAP32:
ret = uvc_v4l2_get_xu_mapping(&karg.xmap, up);
if (ret)
- return ret;
+ break;
ret = uvc_ioctl_xu_ctrl_map(handle->chain, &karg.xmap);
if (ret)
- return ret;
+ break;
ret = uvc_v4l2_put_xu_mapping(&karg.xmap, up);
if (ret)
- return ret;
-
+ break;
break;
case UVCIOC_CTRL_QUERY32:
ret = uvc_v4l2_get_xu_query(&karg.xqry, up);
if (ret)
- return ret;
+ break;
ret = uvc_xu_ctrl_query(handle->chain, &karg.xqry);
if (ret)
- return ret;
+ break;
ret = uvc_v4l2_put_xu_query(&karg.xqry, up);
if (ret)
- return ret;
+ break;
break;
default:
- return -ENOIOCTLCMD;
+ ret = -ENOIOCTLCMD;
+ break;
}
+ uvc_pm_put(handle->stream->dev);
+
return ret;
}
#endif
--
2.49.0.1266.g31b7d2e469-goog
Return-Path: <linux-kernel+bounces-665924-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [147.75.80.249])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 97D8C41E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 13:59:08 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by am.mirrors.kernel.org (Postfix) with ESMTPS id 6667B1BC5176
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:59:20 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 4FA3428EA7D;
Wed, 28 May 2025 17:58:20 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="OpB4pEm8"
Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id ACAB728E570
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:58:16 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.47
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748455099; cv=none; b=e7qefdsgeZvhNBBxIvf6fW1OZRyd2Gh6axHT4CoD8Ou2srKNTwSJoA6iLgPdyc8xmFScFpPBHAHL0fGIeCxeexIJdvXDq0Em4SZxOy0mOxz9IA69c+rGVyeyVU/E3Xa/OaOtPv9tDWqLyQUy9hzxoPb/mXQ6Vx7TksURWxrMuGs=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748455099; c=relaxed/simple;
bh=jqykq6B/kJzsStcArhfP2exmz11fn7LB6mdjY5eqB4Y=;
h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:
In-Reply-To:To:Cc; b=FqlP1+GZqkXaIg3h34dS15O8czQ5kFK3DUtkwua1iYEJvFxyCprVVRCmSWlQOIu2aobV5FoH4ZLccTdHJoAxQsoYMoF8rdMLR+7c1ViqEMJZVl+GLJkqnyTrFdaWSkruwbNG3pZ7iTGPzN/ToL1aiyV8uPeF021ulq07r6iDO4Y=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=OpB4pEm8; arc=none smtp.client-ip=209.85.167.47
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org
Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-551fe46934eso152214e87.1
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 10:58:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=chromium.org; s=google; t=1748455095; x=1749059895; darn=vger.kernel.org;
h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
:mime-version:subject:date:from:from:to:cc:subject:date:message-id
:reply-to;
bh=3TMQfG/b+RrG3RPI5Hk1oXSiQtb/gQB19d4Z/Tsqyas=;
b=OpB4pEm8hK6RclpuKqliAbMPbxpm5fWV9gw92ejeV8ZqNPMp5pG6PEU/DJMCrY5xJu
V6JQ66cFtGbpeQ6LI7pK2S1QnyC/wv4REc8b72v9dT+K+hkfuMfvZb589TkCFlBVPO62
QS8Jfy4xmxXwkCwUTKWqhImHZOlTwL5JmfE84=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1748455095; x=1749059895;
h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
:mime-version:subject:date:from:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=3TMQfG/b+RrG3RPI5Hk1oXSiQtb/gQB19d4Z/Tsqyas=;
b=kbj1p2hw6jzycHO77Wys8pDVp8N4PEdtWuaTSnSx7b/Qc9d0j0gRaWVn337806U4Cu
WyrIN4AgBgV0TsaY06x1rUoQqgaMSXr9qxlVmCe1Oi/4k4Q8XXH6dVkSZyagssfckcsp
UKmTJRYxSPDcWfVy+Qmq4NjENzypfeLj+f9N9ww7erS4ZksAhdye12zSrLHBZJQWWTpI
TZhluRPPD2Q3QjQf4p0MWMJwemfqA1LxxS0FOpY4VoN8Z4TLBP30o7X0Pe8qNUrF06hc
A9FH1ewyLPdEu0GtiiJLhpHUB/wsmXkncdFz1MC+0Sc9jABu2wiU2ZnxXZu6mRSgJ5yq
YNSA==
X-Forwarded-Encrypted: i=1; AJvYcCUX7mFuuanYp4BOv0oEIVWsLWiflGz2XSqw3HQNtk7bawkwgIiR8+AgBJ7j4uJSW+sckPvHxu1gv29Dt30=@vger.kernel.org
X-Gm-Message-State: AOJu0YyaxtPAhvaRO/9HA2GmcJnKlmaW0RucaMoGpi14dE6katDTisvJ
Tym06gMY7Jt2taqy3jjeZpYmtc05C0bFR8EIQzwZTLOFUcsLEEaeLqRpaaWMqOdYGg==
X-Gm-Gg: ASbGnctIiZVkSE+i+D+BsqrpyZ/R2SQA4WhtVN51WZLas755TtRmYRC3CaPzZjsRd6+
CE5Vza69nmEBTm2okmdSB3uV/VpNr4ulL7XMRYWX6201qhRodmr8/jz0UODNwgxeFpWHhgQb0ve
L90SROz7zfrUuCF5jkd5O4PZmsU6YLKBLRF7BSW/+FAu7ERFjXgyZmHoLNea8m3eie0Tmjd0Xxp
aDoEQe8VhxTDM70ZJwX0/0cwf9NzQuvP0z09gLNEHMIxfEkzvwwllid3H8cwb0YSc/+MhYfHRTk
dd5OOIEXQJ9fvb859TT4j4UZZeoqUVWFmP1XuBr1pc/GD8MQUClmnnxVXGPhHh6MLLoLQjloEe+
2ZXSXC/H12fUqeqL6NvdGlVj50Q==
X-Google-Smtp-Source: AGHT+IHHwo3xql0dM/NDDGD2B5GCCQgwSRpZcvv2I4srv82vxwYj8aiHY3T6f0CcxKjZR6ZAHHBXAg==
X-Received: by 2002:a05:6512:1314:b0:552:21db:8f5b with SMTP id 2adb3069b0e04-55335b3239emr194102e87.27.1748455094821;
Wed, 28 May 2025 10:58:14 -0700 (PDT)
Received: from ribalda.c.googlers.com (90.52.88.34.bc.googleusercontent.com. [34.88.52.90])
by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5532f62a6eesm376805e87.98.2025.05.28.10.58.14
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 28 May 2025 10:58:14 -0700 (PDT)
From: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
Date: Wed, 28 May 2025 17:57:59 +0000
Subject: [PATCH 4/9] media: uvcvideo: Remove stream->is_streaming field
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20250528-uvc-grannular-invert-v1-4-d01581f9cc25@xxxxxxxxxxxx>
References: <20250528-uvc-grannular-invert-v1-0-d01581f9cc25@xxxxxxxxxxxx>
In-Reply-To: <20250528-uvc-grannular-invert-v1-0-d01581f9cc25@xxxxxxxxxxxx>
To: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>,
Hans de Goede <hdegoede@xxxxxxxxxx>,
Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>,
Hans Verkuil <hverkuil@xxxxxxxxx>
Cc: linux-media@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx,
Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
X-Mailer: b4 0.14.2
X-Spam-Status: No, score=-6.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,
MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
The is_streaming field is used by modular PM to know if the device is
currently streaming or not.
With the transition to vb2 and fop helpers, we can use vb2 functions for
the same functionality.
Signed-off-by: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
---
drivers/media/usb/uvc/uvc_v4l2.c | 12 +++++-------
drivers/media/usb/uvc/uvcvideo.h | 1 -
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
index 49cc64dd7e2e737f431b9df9df68921d9c543751..65c708b3fb1066bf2e8f12ab7cdf119452ad40f9 100644
--- a/drivers/media/usb/uvc/uvc_v4l2.c
+++ b/drivers/media/usb/uvc/uvc_v4l2.c
@@ -617,7 +617,8 @@ static int uvc_v4l2_release(struct file *file)
uvc_ctrl_cleanup_fh(handle);
- if (handle->is_streaming)
+ if (stream->queue.queue.owner == file->private_data &&
+ uvc_queue_streaming(&stream->queue))
uvc_pm_put(stream->dev);
/* Release the file handle. */
@@ -684,7 +685,7 @@ static int uvc_ioctl_streamon(struct file *file, void *fh,
struct uvc_streaming *stream = handle->stream;
int ret;
- if (handle->is_streaming)
+ if (uvc_queue_streaming(&stream->queue))
return 0;
ret = uvc_pm_get(stream->dev);
@@ -697,8 +698,6 @@ static int uvc_ioctl_streamon(struct file *file, void *fh,
return ret;
}
- handle->is_streaming = true;
-
return 0;
}
@@ -707,16 +706,15 @@ static int uvc_ioctl_streamoff(struct file *file, void *fh,
{
struct uvc_fh *handle = fh;
struct uvc_streaming *stream = handle->stream;
+ bool was_streaming = uvc_queue_streaming(&stream->queue);
int ret;
ret = vb2_ioctl_streamoff(file, fh, type);
if (ret)
return ret;
- if (handle->is_streaming) {
- handle->is_streaming = false;
+ if (was_streaming)
uvc_pm_put(stream->dev);
- }
return 0;
}
diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
index 3ddbf065a2cbae40ee48cb06f84ca8f0052990c4..f895f690f7cdc1af942d5f3a5f10e9dd1c956a35 100644
--- a/drivers/media/usb/uvc/uvcvideo.h
+++ b/drivers/media/usb/uvc/uvcvideo.h
@@ -626,7 +626,6 @@ struct uvc_fh {
struct uvc_video_chain *chain;
struct uvc_streaming *stream;
unsigned int pending_async_ctrls;
- bool is_streaming;
};
/* ------------------------------------------------------------------------
--
2.49.0.1266.g31b7d2e469-goog
Return-Path: <linux-kernel+bounces-665927-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [147.75.80.249])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 1C8B341E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 13:59:22 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by am.mirrors.kernel.org (Postfix) with ESMTPS id 5242B1BC4CEE
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:59:35 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 2849E28ECDF;
Wed, 28 May 2025 17:58:21 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Ych1TWEw"
Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4409F28E601
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:58:18 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.48
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748455100; cv=none; b=CkMAOltuaNP/lE2eW8aAxlg3fPBYIhwiUjOZoht4n7QT0iRj3ie9Y0R3izEe2q1RCVyY63vyZp9rdEceymzAfyo2IPNcEj8f47XZ1yINB5A3rXnvdquLKwDz8Ehc/L9bZbePfQyNLZBTwrXE9hyzHQvWvJGHJV1/cRknwylaUkc=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748455100; c=relaxed/simple;
bh=UEBuYkRXWdWQnJ0xRRALcILURlb3/sc/+uI8fqdHllI=;
h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:
In-Reply-To:To:Cc; b=lrvomhq1w6dOvoSbpK8byp/LhrmuPVC8O3G81phmLrCNQ9GZ4RGIfP7Uq7GgmabI6rwpP6nHpCWdLeRtkP39hpeQeDze/HtZ/y3E1iFPrW8AhsDOYrUngku+ln/lI2EU0wgYBK+URqDKyXU7i+rvesZ3gI0eYDzg3QcrIBzQdUQ=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=Ych1TWEw; arc=none smtp.client-ip=209.85.167.48
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org
Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-54b0d638e86so10207e87.1
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 10:58:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=chromium.org; s=google; t=1748455096; x=1749059896; darn=vger.kernel.org;
h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
:mime-version:subject:date:from:from:to:cc:subject:date:message-id
:reply-to;
bh=qqqzc4JWCwHMyJVbZCLvTBytETKRAUUhg+vp/MQs9Og=;
b=Ych1TWEwiLuwVrBaMS/kWZWEgAvBDX7MI5Ofe0wGT7Ffrvxyl7GGO9XSFQI6C1gHWU
Q4DboNV94Tw9qoEfgbHQXN+/jULJ4OGEbo6fl8adoEU5DtWRbJIxV3u569c1JhG7Y7v/
nzbKh+IZ/ZHTmhfSgUOqN5iAei1lH+BUyeiCc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1748455096; x=1749059896;
h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
:mime-version:subject:date:from:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=qqqzc4JWCwHMyJVbZCLvTBytETKRAUUhg+vp/MQs9Og=;
b=nsaznWmWCZgcz8EBQ9OzcXA3k3xSxJ9ABKOeBmC7gsjkj+UkE9GI+ZU6Q+e/9bnJxd
yfSj6jfMZMBgZUL7L5sUbPqQbPHD028UfOhBB+p1xYdFZyYsQQJsVdOlUr2sNjetIO9k
qqwcCuM0zfLhgMi5pvCKUWGdxHppk4YurGGrsofFt8TQgGumR0gke2kuLMzooJ7HqoBk
TQV5ITEK268jq6ShoHIwmIAdqHvxDjs6qxSw+I/RSkUrVL7KBFt9ooy5fReLz1D2ILy8
2mG9hZb5ZXOxyquGDYYKTI4ihKFMOVKL6DMz3VkI+A9afnK3vwFHPUZdpwrCjikwSAOK
0upA==
X-Forwarded-Encrypted: i=1; AJvYcCXuNdp6X/7c9H8t7spdsCzCUUxQdgG0Tq3u0VRJrd+jgZ4g75knLYznVqWy35XXi0SQrciMDpzQF9t8nQ0=@vger.kernel.org
X-Gm-Message-State: AOJu0Yx6yk8ySq/s3aZyDaoCA9SVaPB9P0eVQ7K2bry6zislAatfWxep
D7gbaUsGNKOxtpnX+wma2s45lTSTKNIQCzCMy6DbyfgoTGx50b7Y5VMPrImenAEvug==
X-Gm-Gg: ASbGnctUUqIiLGIZYxpKgWtU+t1pFtWw4mXbNtuzT+yRU4HYi79xM9PZEW55IleYAXD
HYMxyJVgTAKPsfB3dihgozgUQAzPGnB9FpwgJiUH8iB95oif59dLS/lxekbQ+fOxPZuwYu1u/5N
tsY7+6ks/caAHEw++zixmZZMveqbzdsp3pdU6DHP3VqRY3a/6yvpARRuOKzvIN2/0/uvrl3w6CZ
aJozYNUXAY8i5wV+f4g2yHcqY/xQJhKBQ/ISGhR2O1bb0DJbnnfiWCLolZ4bz+ISf4RlPAuMkct
t4KffzNokzLj/mb26D6bEo1IhollSRu1f7VJ5Ie34Y8xK+tA1QUWLmq+pvHD97IfCfIVZ7V3w4Z
SoI3cw8nrr8eN8i+4y7G4asPUfQ==
X-Google-Smtp-Source: AGHT+IHJoSbZmVCM0+OaR+drNPKZH3L2vkLptaYk24BZYjh1TfGUyjz9xyXLOq0xMcSeyU9sLHySbQ==
X-Received: by 2002:a05:6512:2c0a:b0:553:2bdc:e36a with SMTP id 2adb3069b0e04-5532bdce59dmr2042225e87.34.1748455096305;
Wed, 28 May 2025 10:58:16 -0700 (PDT)
Received: from ribalda.c.googlers.com (90.52.88.34.bc.googleusercontent.com. [34.88.52.90])
by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5532f62a6eesm376805e87.98.2025.05.28.10.58.15
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 28 May 2025 10:58:15 -0700 (PDT)
From: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
Date: Wed, 28 May 2025 17:58:01 +0000
Subject: [PATCH 6/9] media: uvcvideo: Do not enable camera during
UVCIOC_CTRL_MAP32
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20250528-uvc-grannular-invert-v1-6-d01581f9cc25@xxxxxxxxxxxx>
References: <20250528-uvc-grannular-invert-v1-0-d01581f9cc25@xxxxxxxxxxxx>
In-Reply-To: <20250528-uvc-grannular-invert-v1-0-d01581f9cc25@xxxxxxxxxxxx>
To: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>,
Hans de Goede <hdegoede@xxxxxxxxxx>,
Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>,
Hans Verkuil <hverkuil@xxxxxxxxx>
Cc: linux-media@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx,
Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
X-Mailer: b4 0.14.2
X-Spam-Status: No, score=-6.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,
MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
The device does not need to be enabled to do this, it is merely an
internal data operation.
Signed-off-by: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
---
drivers/media/usb/uvc/uvc_v4l2.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
index 65c708b3fb1066bf2e8f12ab7cdf119452ad40f9..2c6f3cf6bcc3f116bbdb3383d9af7d5be9832537 100644
--- a/drivers/media/usb/uvc/uvc_v4l2.c
+++ b/drivers/media/usb/uvc/uvc_v4l2.c
@@ -1224,10 +1224,6 @@ static long uvc_v4l2_compat_ioctl32(struct file *file,
void __user *up = compat_ptr(arg);
long ret;
- ret = uvc_pm_get(handle->stream->dev);
- if (ret)
- return ret;
-
switch (cmd) {
case UVCIOC_CTRL_MAP32:
ret = uvc_v4l2_get_xu_mapping(&karg.xmap, up);
@@ -1245,7 +1241,13 @@ static long uvc_v4l2_compat_ioctl32(struct file *file,
ret = uvc_v4l2_get_xu_query(&karg.xqry, up);
if (ret)
break;
+
+ ret = uvc_pm_get(handle->stream->dev);
+ if (ret)
+ return ret;
ret = uvc_xu_ctrl_query(handle->chain, &karg.xqry);
+ uvc_pm_put(handle->stream->dev);
+
if (ret)
break;
ret = uvc_v4l2_put_xu_query(&karg.xqry, up);
@@ -1258,8 +1260,6 @@ static long uvc_v4l2_compat_ioctl32(struct file *file,
break;
}
- uvc_pm_put(handle->stream->dev);
-
return ret;
}
#endif
--
2.49.0.1266.g31b7d2e469-goog
Return-Path: <linux-kernel+bounces-665925-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [139.178.88.99])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 8913941E003FB
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 13:59:22 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0D2C93BC294
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:58:51 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id A469328ECC7;
Wed, 28 May 2025 17:58:20 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="fUmqRmHK"
Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id B977328E5EC
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:58:17 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.50
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748455099; cv=none; b=shkoupcGTq6MowcJWAxsPsmtXwrescwYTEUqfNpDvSmGOiskEwECCwCz5qbqwbmBoFeWPvnjM15XDMbYNmm6cK0VQAfx2V80ndz464NORC/epnzMpZ9FGF9Q8h0R8GFovhfcucRfyGf2asJm1Yke11B2QJgryAFQdcjG8hM7WqE=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748455099; c=relaxed/simple;
bh=F/97iF/ItJJa7/aRxsY5F4HPpR4b4coIcvx15QKghxg=;
h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:
In-Reply-To:To:Cc; b=UZekwpOiAOp/ym+Bq8R956JI8/CtKbPcj7cqQj+kiNDvyuYZS3qu3Z+6gRKhiQpVn14r2FdGQOOlEBfrf8jJZpocP55d4q86HVwiY+1sduZaBAQ4Vvf1zEleWQJofInP3+yZ9kYE59iBG1DuspMw4vdk5/VOlBW1yQrjuhN38l8=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=fUmqRmHK; arc=none smtp.client-ip=209.85.167.50
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org
Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-54e7967cf67so26450e87.0
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 10:58:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=chromium.org; s=google; t=1748455096; x=1749059896; darn=vger.kernel.org;
h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
:mime-version:subject:date:from:from:to:cc:subject:date:message-id
:reply-to;
bh=AvYmz65GXYt3jp4V315G3baP5IGhVnkC1QR+lx5dgJA=;
b=fUmqRmHKV2RqCT5o9rbhkOTCf1Re83wlojqzEecc1CfRpccJAPJrbj1t2FiRopbvUh
Rhc4WgGGpuzj20SnDHzvSYfks0efHFub5OWsif5yITkDga1NpHWdP/G1+ottLhvxmCL7
PRpIDTWbja+anEHJZFpdRQFfHOxWsg2quxoT8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1748455096; x=1749059896;
h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
:mime-version:subject:date:from:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=AvYmz65GXYt3jp4V315G3baP5IGhVnkC1QR+lx5dgJA=;
b=lZPQopRNhF6tRAmE+eOQ7PvEnGf5JeaiAt5/8tcwWlii0DqMNlRjCmhKP3uR+/SRPs
AroXNfKXhuhJ864hqgs5Ea+7PukCdNv5ei2xfe3zSqnT38A0w/14+KkvJ8VFCzXIAa78
3WYttM5xzrzDaLOnCGen/QJKoAZSeqCFQ0xon+zAuIzdUaFgijdeVXHenXaMXZitCUu/
AXIxVp8uQIWX1kRvZWOj8oabtl8wKrxfAkh4bASX/l5m0temmN5hxQEsXEg8dw0exTO0
ztJtyTOWTH/KdVatEPV4IC5ivrVJfAN2oA/qOVb+1I67yZ0kpZaQfs01qCqWkWKyCbSO
h/Tg==
X-Forwarded-Encrypted: i=1; AJvYcCVyTRQNnED2W2TyHBiOWRE2ldHWry8bqhXGev2BllQOt2E0vYUWBtL5dMCH9QIFa0kYkfp7pkqJQTMY1Vo=@vger.kernel.org
X-Gm-Message-State: AOJu0Yz9jtn7isIodkD720xckMVcW+y/wwn67Yf12V8EqGc1Fz2xU6Zd
iRb0FtTpCWSi/sUKwMDWcncQbPQQeqaxFbULWcO/PSO4We1m91+k641ybXvfyPEwuw==
X-Gm-Gg: ASbGncvnJ2aFFwq23DwI4w9Wnz5zI4Reh0N0lbOiyEikxjKwkAvk+X+ZSuPqqfHrYJn
apn4eyMYgsN7fpBFSqtcNBl8NGR8xv2fr5ctp+cs3am92qXw1c5H5cHkSn7PD50YpI7rBwxMA0S
a16Vtz0yimR/chK6kaVyunZ8Rg+n0AzcNBr8FT6YcqW23pTiNzvYX9JjRgRKvNKmqQiRi68q+8e
FAb4qB8/P3hpv2PIzgqgCaa8covuNQtEp4VodSF1+EZB7aiY7rLUpoQBygvZ0jMXuVyzNwlqQJm
iIDbGb2nQkbPAWL1bvToQ6AKE6BnqFx8/3maspKBPazNAs6ik95UeTtcVLgNZhMLRnvF6Ic/u60
L9RrguaFf6i0wI+mMAIgooS6o5Q==
X-Google-Smtp-Source: AGHT+IFoG83ruA8rtMIVQn+vU7qG8UmWXw9OexU7JHNlvvCvw+i3UNkVyAeah4qU6pfBrGgO8yn+LA==
X-Received: by 2002:a05:6512:3b28:b0:553:3492:b717 with SMTP id 2adb3069b0e04-5533492b8ecmr818896e87.51.1748455095737;
Wed, 28 May 2025 10:58:15 -0700 (PDT)
Received: from ribalda.c.googlers.com (90.52.88.34.bc.googleusercontent.com. [34.88.52.90])
by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5532f62a6eesm376805e87.98.2025.05.28.10.58.14
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 28 May 2025 10:58:15 -0700 (PDT)
From: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
Date: Wed, 28 May 2025 17:58:00 +0000
Subject: [PATCH 5/9] media: uvcvideo: Turn on the camera if
V4L2_EVENT_SUB_FL_SEND_INITIAL
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20250528-uvc-grannular-invert-v1-5-d01581f9cc25@xxxxxxxxxxxx>
References: <20250528-uvc-grannular-invert-v1-0-d01581f9cc25@xxxxxxxxxxxx>
In-Reply-To: <20250528-uvc-grannular-invert-v1-0-d01581f9cc25@xxxxxxxxxxxx>
To: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>,
Hans de Goede <hdegoede@xxxxxxxxxx>,
Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>,
Hans Verkuil <hverkuil@xxxxxxxxx>
Cc: linux-media@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx,
Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
X-Mailer: b4 0.14.2
X-Spam-Status: No, score=-6.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,
MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
If we subscribe to an event with V4L2_EVENT_SUB_FL_SEND_INITIAL, the
driver needs to report back some values that require the camera to be
powered on. But VIDIOC_SUBSCRIBE_EVENT is not part of the ioctls that
turn on the camera.
We could unconditionally turn on the camera during
VIDIOC_SUBSCRIBE_EVENT, but it is more efficient to turn it on only
during V4L2_EVENT_SUB_FL_SEND_INITIAL, which we believe is not a common
usecase.
Fixes: d1b618e79548 ("media: uvcvideo: Do not turn on the camera for some ioctls")
Signed-off-by: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
---
drivers/media/usb/uvc/uvc_ctrl.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
index 44b6513c526421943bb9841fb53dc5f8e9f93f02..a7b8f3ea01edd8157e0d8cc36351d511225f89d7 100644
--- a/drivers/media/usb/uvc/uvc_ctrl.c
+++ b/drivers/media/usb/uvc/uvc_ctrl.c
@@ -2039,6 +2039,12 @@ static int uvc_ctrl_add_event(struct v4l2_subscribed_event *sev, unsigned elems)
u32 changes = V4L2_EVENT_CTRL_CH_FLAGS;
s32 val = 0;
+ ret = uvc_pm_get(handle->chain->dev);
+ if (ret) {
+ list_del(&sev->node);
+ goto done;
+ }
+
if (uvc_ctrl_mapping_is_compound(mapping) ||
__uvc_ctrl_get(handle->chain, ctrl, mapping, &val) == 0)
changes |= V4L2_EVENT_CTRL_CH_VALUE;
@@ -2051,6 +2057,8 @@ static int uvc_ctrl_add_event(struct v4l2_subscribed_event *sev, unsigned elems)
*/
sev->elems = elems;
v4l2_event_queue_fh(sev->fh, &ev);
+
+ uvc_pm_put(handle->chain->dev);
}
done:
--
2.49.0.1266.g31b7d2e469-goog
Return-Path: <linux-kernel+bounces-665928-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id E35F141E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 13:59:30 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by ny.mirrors.kernel.org (Postfix) with ESMTPS id D8C304E4D80
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:59:25 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 65D4728ECEB;
Wed, 28 May 2025 17:58:21 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="hEioQEYj"
Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6657028E607
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:58:18 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748455100; cv=none; b=oAUD1k/pAwvHEBVov6U757bvgFqdc5/hwqGGl9g+wXzyMEIUItDhYUbgYHeze986Lsod2+9M9U/AeQHU5Wozjw3e6vAHwNdkcr31SflVU86UDlZ+iBA+gr33nLjFm6DL/3UalI5MYuBtv1fY47JYJc8A+gUjDFtv0NGbLRopJ60=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748455100; c=relaxed/simple;
bh=GiBxw+zm//U/C+YTQyovbdu6MSyJ+bZDAcgLx/2Kbzg=;
h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:
In-Reply-To:To:Cc; b=fzDDi/jLzM17M6ihQfWK8L92wylSeDGKHeQjoXdv9/7S+tsf+NbHUh70OTAOpDF5+ju7VmgybC0cOVgf/WLtNQa4ZCvzrTV6b6DBCn/BW3bX/533TT8MszUTCGkJji1ycrpgLPLUtq9EfextaSnQL9o6/21//sloxEhW+G/UF38=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=hEioQEYj; arc=none smtp.client-ip=209.85.167.45
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org
Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-553241d30b3so3717931e87.3
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 10:58:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=chromium.org; s=google; t=1748455093; x=1749059893; darn=vger.kernel.org;
h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
:mime-version:subject:date:from:from:to:cc:subject:date:message-id
:reply-to;
bh=B3ix9DwpCMClF3M2JTkGqryLw82zMUUM9JySNSXWuyo=;
b=hEioQEYj+rHQRZDZqjzH9Bftp1Av0E/CC5Ab8HjlwowUY6T0Pf78V6LKhtOontDeVT
KL1AMkSKCCmuVvk+YyWYLu5d1pPBSSYIiSfqwjqeq/ewfDXnGPYoQah3sh6e3W8YUNcN
GsdLtMz46mMay2HfVZn/Go9WPlcfi/bvORwxA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1748455093; x=1749059893;
h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
:mime-version:subject:date:from:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=B3ix9DwpCMClF3M2JTkGqryLw82zMUUM9JySNSXWuyo=;
b=Bil3KI+r0EgEbN+fNdvStVmNLuivd8PaAwSGXAfjl9Wlmm3I5Xguit8DjHQBmZmGS1
cG5JHti344iTcjfE9ZSsuqKNAhVVAupi3w78slVcseq2N1sA3xLj9I3iNAgJEJyFrUe/
oFPrfMhvZyNNudskSPTp40PivPb+G2QbAZv6TVX6HULd8WnrPZSK+Hl7KG89Unl4shHu
Qxu1vPkykymkELwYhWBx/QM//xhg5vHsBaQ3ZxIDtwDTlDVvZCL0jrWmrWC+SAS1SHFK
/er8vK22Y8vcxKeDlwXRXi/HlmS+q4sg/jZJmdYzfNUXa0ktnRYOxiVMHTGwf1deSazm
z7Jw==
X-Forwarded-Encrypted: i=1; AJvYcCW/XD3Oow+YHLvXh90rD9VKqbRnpaW5NfKtN1quYK/YC9jMfRt8H4kqnximvQ6RKubZeerdzOETqAGvYtw=@vger.kernel.org
X-Gm-Message-State: AOJu0YxUb2y3xeyg8u7lFOU6kOArJoinXjr+r5/1KL2qbUpe/Lj3PY8V
+nUaXhCiI8FeENStGulcF88EXkLJBsXAM/RALrmPUkdYM6iPJe+lToeVsQJwZbFPFQ==
X-Gm-Gg: ASbGncubM+rtt4h58R0zNxVJkFbTJolFwNMJJziXBg1ec6gjHxz9Ru+R0BHRwHZS7Wo
MPinKcVAKDj2BwmlHlr5Flo+dY8DEIGN9geWnS3xMKWgvzVJi7t55nOlkLbYEPePXPPUdDukhnN
aZPhFxf2tnz+F6oJnOCRIWR9jN6JkMnjxOjw3BtoExeTe9a/0mwVKdzJSI0u5VPmtGQZV+OStHV
NH704V+H0Zfj3CzNiqqiZFFOulYU5mNxsaadg+6sqr8CG8oc/v+ipwxssO+4nAVYfUDnGNRS4d9
Q15dlhE29ok4ZysrlUD5fBxql7IZRL8dR/vXtVQNdI/vzY7xYA8tFTNVeo8TW/OBtxsHV3J0YE2
nJtyfOsRH1JZZqJrd6LRpu0YNUQ==
X-Google-Smtp-Source: AGHT+IG8Ik02jUgFA76IfXTO5TiYpbVuuWGX8ycRq2oZO4GvQe/uL9xzy0M7+OF/XwRGSYiVVuG2tA==
X-Received: by 2002:a05:6512:31cd:b0:553:34b7:5731 with SMTP id 2adb3069b0e04-55334b7581bmr712001e87.3.1748455093108;
Wed, 28 May 2025 10:58:13 -0700 (PDT)
Received: from ribalda.c.googlers.com (90.52.88.34.bc.googleusercontent.com. [34.88.52.90])
by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5532f62a6eesm376805e87.98.2025.05.28.10.58.12
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 28 May 2025 10:58:12 -0700 (PDT)
From: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
Date: Wed, 28 May 2025 17:57:56 +0000
Subject: [PATCH 1/9] media: uvcvideo: Refactor uvc_queue_streamon
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20250528-uvc-grannular-invert-v1-1-d01581f9cc25@xxxxxxxxxxxx>
References: <20250528-uvc-grannular-invert-v1-0-d01581f9cc25@xxxxxxxxxxxx>
In-Reply-To: <20250528-uvc-grannular-invert-v1-0-d01581f9cc25@xxxxxxxxxxxx>
To: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>,
Hans de Goede <hdegoede@xxxxxxxxxx>,
Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>,
Hans Verkuil <hverkuil@xxxxxxxxx>
Cc: linux-media@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx,
Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
X-Mailer: b4 0.14.2
X-Spam-Status: No, score=-6.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,
MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no
version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
Do uvc_pm_get before we call uvc_queue_streamon. Although the current
code is correct, uvc_ioctl_streamon is allways called after uvc_pm_get,
this change makes the code more resiliant to future changes.
Suggested-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
Signed-off-by: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
Reviewed-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
Link: https://lore.kernel.org/r/20250509-uvc-followup-v1-2-73bcde30d2b5@xxxxxxxxxxxx
Signed-off-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
---
drivers/media/usb/uvc/uvc_v4l2.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
index 668a4e9d772c6d91f045ca75e2744b3a6c69da6b..862b4e34e5b629cf324479a9bb59ebe8784ccd5d 100644
--- a/drivers/media/usb/uvc/uvc_v4l2.c
+++ b/drivers/media/usb/uvc/uvc_v4l2.c
@@ -853,15 +853,16 @@ static int uvc_ioctl_streamon(struct file *file, void *fh,
if (handle->is_streaming)
return 0;
- ret = uvc_queue_streamon(&stream->queue, type);
+ ret = uvc_pm_get(stream->dev);
if (ret)
return ret;
- ret = uvc_pm_get(stream->dev);
+ ret = uvc_queue_streamon(&stream->queue, type);
if (ret) {
- uvc_queue_streamoff(&stream->queue, type);
+ uvc_pm_put(stream->dev);
return ret;
}
+
handle->is_streaming = true;
return 0;
--
2.49.0.1266.g31b7d2e469-goog
Return-Path: <linux-kernel+bounces-665929-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [139.178.88.99])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 3C7AE41E003FB
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 13:59:50 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by sv.mirrors.kernel.org (Postfix) with ESMTPS id 8A671A2599A
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:59:13 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id D076528F50F;
Wed, 28 May 2025 17:58:21 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Sw1JDG/i"
Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id B15AF28E613
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:58:18 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.48
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748455100; cv=none; b=asVNDkk/glwXVl6cAGZHn86VTxqq/FQ2oRt0GlOY0kAdHy49tK6GJR/hw/R2JLKZKy/CY528rCQeZ56hXU1XWjvdIjlqSEUFINCYE5OVCkcG5204Cq0RXFyoy37lMVF/zvZYLexQ++vN+TeO/IZlOyPrJCzoR7fKMZxZO00LnVM=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748455100; c=relaxed/simple;
bh=2f6SktVhzvBFpgR1QtGNdHQVCvywmEcSZBqzBzwzFe8=;
h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:
In-Reply-To:To:Cc; b=MZSUN7Tr8qJD3FiVUjux/wcPBC2A6f9KzK6HHzsmQFYkbxiSsmkuGfjsVRufzmJWJeU9R+Rc46P3ktDiismJGNyjJ41OighDtQwECxtdKw6qpuZc/D9Fiz8Fxw6mxcr52OkXZLIFKaGnbGfIzq4P5dNg23LF9zqilI2zXM4UVMs=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=Sw1JDG/i; arc=none smtp.client-ip=209.85.167.48
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org
Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-54b09cb06b0so8402e87.1
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 10:58:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=chromium.org; s=google; t=1748455097; x=1749059897; darn=vger.kernel.org;
h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
:mime-version:subject:date:from:from:to:cc:subject:date:message-id
:reply-to;
bh=KqTrMRI5OIQAm7mZwle2g0uzyDFHgfV3lxxsg/wvy3w=;
b=Sw1JDG/iX/na7gkgP396BXwVLHaN9t462D4FFBOK1QFwkQYb5HgGCpj7WObjB2nW26
YvkKPl4rPTDPgoSbhDNbtaFnKYdqiB9sc/Y99+hlh3dQdTsSeLvCZDCHgWfxWIWkZYV8
ZWj2bnZU04ZiGjgblea5eyiVDNWO6F6ppjA7s=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1748455097; x=1749059897;
h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
:mime-version:subject:date:from:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=KqTrMRI5OIQAm7mZwle2g0uzyDFHgfV3lxxsg/wvy3w=;
b=dCJz2EGbiieuyQ2lZirUlSM4u8iytjVIBGwQ9Ck3be8+xa+JiJUScIw8YMFsNVhgui
UWx2nwJ5y+UpVWTTf+8oFILN/FsX38pCHTT4CJAg+7Flv+G3eIEK7jT5TR8/R/XTAz/K
koCLj7lh8NsY3oTll6h7dAd++DI9HLyYVYAfvA3EECqCO+CMkE6EZHRF37FbotFzA/eY
PuFIVcHPjDJFmEB2s0AwyOMtA6ZzFouB1U7qMjWzbxt2h/mDXApY3DBQgPQURvl1ANO2
OkNojg0pFtmdR1i3YQ0PweILW4antcxUBZwR4xteiD113NKM9eBfefl+HzFVqPbJYuRL
++Bg==
X-Forwarded-Encrypted: i=1; AJvYcCW20PL52lA1v0SO6cHkMMsbEwdwiq/wwqb6AC+3QG3zfGfjbsJ9W1nCNJnRhNtMvqQ/REJ9/vFFVG/o2ws=@vger.kernel.org
X-Gm-Message-State: AOJu0Yzgy536z1Ub+n2nPI7mA7HPEOzmRXvQpDc0l3mhuGpoXkxnUvQ9
jQafV3zFepdcztj8TWGDghs8Bp+0pt9fhQiMj5w+zPwXABfC+nqETPdDXKwqFSOe1A==
X-Gm-Gg: ASbGnctvTYJMIVODHC4iS+S/gtpM2ovEHQh0EYwWmm7HkdpPSV3/dawgG3YYZ+iwRtB
ny+0Anw0qqRFP00Mg0SPpxDlWCbubQFKlFd9RUZlUXQGhVx+UfcT9H4qNX9VzavmBerh8nG5XGd
HpXDgezFyLhRiCkul/k6GA9ZMT+KVLKMwDtMI1pfAs/zAONInO3zF9k6D9TWtSLr1JOC9z6Bqkn
/VTlsWmAq66Hr7pvrNKGI+4hrCH44ysH/qf8mwXnf/XJ05xYrAb2doJc9OtPQy8JwUySeYhu/Ed
7wFP3ZN7+UOZsBtGvQHoFrUBqTPGn/ubUyN/ANWwiJX2uqUlk4pU6Ijqer66EadMBrP6SKMOft5
EwYaAkbtBcpjHQTE7hiD5Qx1sYQ==
X-Google-Smtp-Source: AGHT+IFLbRdcK50b32H+0EevYHhTFLdC4eKjsez3lYSIcEs4Sn6AmtjYSRVxhWJ+sOP5xI2Ue4MToQ==
X-Received: by 2002:a05:6512:1112:b0:553:2f4a:7479 with SMTP id 2adb3069b0e04-5532f4a7696mr1156331e87.9.1748455096802;
Wed, 28 May 2025 10:58:16 -0700 (PDT)
Received: from ribalda.c.googlers.com (90.52.88.34.bc.googleusercontent.com. [34.88.52.90])
by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5532f62a6eesm376805e87.98.2025.05.28.10.58.16
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 28 May 2025 10:58:16 -0700 (PDT)
From: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
Date: Wed, 28 May 2025 17:58:02 +0000
Subject: [PATCH 7/9] media: uvcvideo: uvc_v4l2_unlocked_ioctl: Invert PM
logic
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20250528-uvc-grannular-invert-v1-7-d01581f9cc25@xxxxxxxxxxxx>
References: <20250528-uvc-grannular-invert-v1-0-d01581f9cc25@xxxxxxxxxxxx>
In-Reply-To: <20250528-uvc-grannular-invert-v1-0-d01581f9cc25@xxxxxxxxxxxx>
To: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>,
Hans de Goede <hdegoede@xxxxxxxxxx>,
Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>,
Hans Verkuil <hverkuil@xxxxxxxxx>
Cc: linux-media@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx,
Ricardo Ribalda <ribalda@xxxxxxxxxxxx>, Hans Verkuil <hans@xxxxxxxxxxxx>
X-Mailer: b4 0.14.2
X-Spam-Status: No, score=-6.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,
MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
Instead of listing the IOCTLs that do not need to turn on the camera,
list the IOCTLs that need to turn it on. This makes the code more
maintainable.
This patch is designed to be a NOP. Non relevant IOCTLs will be removed
in future patches.
Suggested-by: Hans Verkuil <hans@xxxxxxxxxxxx>
Signed-off-by: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
---
drivers/media/usb/uvc/uvc_v4l2.c | 117 +++++++++++++++++++++++++++++++--------
1 file changed, 93 insertions(+), 24 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
index 2c6f3cf6bcc3f116bbdb3383d9af7d5be9832537..e7373a2ae3c37ca02f9076773154901a603820ac 100644
--- a/drivers/media/usb/uvc/uvc_v4l2.c
+++ b/drivers/media/usb/uvc/uvc_v4l2.c
@@ -1264,42 +1264,111 @@ static long uvc_v4l2_compat_ioctl32(struct file *file,
}
#endif
-static long uvc_v4l2_unlocked_ioctl(struct file *file,
- unsigned int cmd, unsigned long arg)
+static long uvc_v4l2_pm_ioctl(struct file *file,
+ unsigned int cmd, unsigned long arg)
{
struct uvc_fh *handle = file->private_data;
int ret;
- /* The following IOCTLs do not need to turn on the camera. */
- switch (cmd) {
- case VIDIOC_CREATE_BUFS:
- case VIDIOC_DQBUF:
- case VIDIOC_ENUM_FMT:
- case VIDIOC_ENUM_FRAMEINTERVALS:
- case VIDIOC_ENUM_FRAMESIZES:
- case VIDIOC_ENUMINPUT:
- case VIDIOC_EXPBUF:
- case VIDIOC_G_FMT:
- case VIDIOC_G_PARM:
- case VIDIOC_G_SELECTION:
- case VIDIOC_QBUF:
- case VIDIOC_QUERYCAP:
- case VIDIOC_REQBUFS:
- case VIDIOC_SUBSCRIBE_EVENT:
- case VIDIOC_UNSUBSCRIBE_EVENT:
- return video_ioctl2(file, cmd, arg);
- }
-
ret = uvc_pm_get(handle->stream->dev);
if (ret)
return ret;
-
ret = video_ioctl2(file, cmd, arg);
-
uvc_pm_put(handle->stream->dev);
+
return ret;
}
+static long uvc_v4l2_unlocked_ioctl(struct file *file,
+ unsigned int cmd, unsigned long arg)
+{
+ /*
+ * For now, we do not support granular power saving for compat
+ * syscalls.
+ */
+ if (in_compat_syscall())
+ return uvc_v4l2_pm_ioctl(file, cmd, arg);
+
+ /* The following IOCTLs do need to turn on the camera. */
+ switch (cmd) {
+ case UVCIOC_CTRL_MAP:
+ case UVCIOC_CTRL_QUERY:
+ case VIDIOC_CROPCAP:
+ case VIDIOC_DBG_G_CHIP_INFO:
+ case VIDIOC_DBG_G_REGISTER:
+ case VIDIOC_DBG_S_REGISTER:
+ case VIDIOC_DECODER_CMD:
+ case VIDIOC_DQEVENT:
+ case VIDIOC_DV_TIMINGS_CAP:
+ case VIDIOC_ENCODER_CMD:
+ case VIDIOC_ENUMAUDIO:
+ case VIDIOC_ENUMAUDOUT:
+ case VIDIOC_ENUMOUTPUT:
+ case VIDIOC_ENUMSTD:
+ case VIDIOC_ENUM_DV_TIMINGS:
+ case VIDIOC_ENUM_FREQ_BANDS:
+ case VIDIOC_G_AUDIO:
+ case VIDIOC_G_AUDOUT:
+ case VIDIOC_G_CROP:
+ case VIDIOC_G_CTRL:
+ case VIDIOC_G_DV_TIMINGS:
+ case VIDIOC_G_EDID:
+ case VIDIOC_G_ENC_INDEX:
+ case VIDIOC_G_EXT_CTRLS:
+ case VIDIOC_G_FBUF:
+ case VIDIOC_G_FREQUENCY:
+ case VIDIOC_G_INPUT:
+ case VIDIOC_G_JPEGCOMP:
+ case VIDIOC_G_MODULATOR:
+ case VIDIOC_G_OUTPUT:
+ case VIDIOC_G_PRIORITY:
+ case VIDIOC_G_SLICED_VBI_CAP:
+ case VIDIOC_G_STD:
+ case VIDIOC_G_TUNER:
+ case VIDIOC_LOG_STATUS:
+ case VIDIOC_OVERLAY:
+ case VIDIOC_PREPARE_BUF:
+ case VIDIOC_QUERYBUF:
+ case VIDIOC_QUERYCAP:
+ case VIDIOC_QUERYCTRL:
+ case VIDIOC_QUERYMENU:
+ case VIDIOC_QUERYSTD:
+ case VIDIOC_QUERY_DV_TIMINGS:
+ case VIDIOC_QUERY_EXT_CTRL:
+ case VIDIOC_REMOVE_BUFS:
+ case VIDIOC_STREAMOFF:
+ case VIDIOC_STREAMON:
+ case VIDIOC_S_AUDIO:
+ case VIDIOC_S_AUDOUT:
+ case VIDIOC_S_CROP:
+ case VIDIOC_S_CTRL:
+ case VIDIOC_S_DV_TIMINGS:
+ case VIDIOC_S_EDID:
+ case VIDIOC_S_EXT_CTRLS:
+ case VIDIOC_S_FBUF:
+ case VIDIOC_S_FMT:
+ case VIDIOC_S_FREQUENCY:
+ case VIDIOC_S_HW_FREQ_SEEK:
+ case VIDIOC_S_INPUT:
+ case VIDIOC_S_JPEGCOMP:
+ case VIDIOC_S_MODULATOR:
+ case VIDIOC_S_OUTPUT:
+ case VIDIOC_S_PARM:
+ case VIDIOC_S_PRIORITY:
+ case VIDIOC_S_SELECTION:
+ case VIDIOC_S_STD:
+ case VIDIOC_S_TUNER:
+ case VIDIOC_TRY_DECODER_CMD:
+ case VIDIOC_TRY_ENCODER_CMD:
+ case VIDIOC_TRY_EXT_CTRLS:
+ case VIDIOC_TRY_FMT:
+ return uvc_v4l2_pm_ioctl(file, cmd, arg);
+ }
+
+ /* The other IOCTLs can run with the camera off. */
+ return video_ioctl2(file, cmd, arg);
+}
+
const struct v4l2_ioctl_ops uvc_ioctl_ops = {
.vidioc_g_fmt_vid_cap = uvc_ioctl_g_fmt,
.vidioc_g_fmt_vid_out = uvc_ioctl_g_fmt,
--
2.49.0.1266.g31b7d2e469-goog
Return-Path: <linux-kernel+bounces-665926-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [147.75.80.249])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id B71C841E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 13:59:49 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by am.mirrors.kernel.org (Postfix) with ESMTPS id C1DBB1BC722A
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:00:02 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 1C61B28F52D;
Wed, 28 May 2025 17:58:22 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="h2Ye3kdL"
Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6DBD628E561
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:58:16 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.48
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748455100; cv=none; b=PujTInOCA6d8kOF6Z44yupRMD0vRKp8zY5J1I9f1AbYkcT3uU9cjavBRuy5tX9NmjdfTsgdJddyFWuTFqixn+twsjN9xydFWgHlIxuEMB+Gk/UARspqL2xcJ4ChQxSiWhN3oadOSo1ULecAXQkNXRZbt23qMQU6MTAAJqPpOg4s=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748455100; c=relaxed/simple;
bh=GOnwR2KJtqAeiJqyC79f3wFIo2SjRh/wiltLqAHylcg=;
h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:
In-Reply-To:To:Cc; b=SIJnxxtDKlFMMdPare22L7OfS5pE033kgFAo2QQotBxEWrBxhajm1N9VBoHKYMc/DZeJ+mcxlmxM1u1hEyO+VqKqg8XZ4C6QtD7XoqQRQDWRLv4GPXwmyUo6z8MfpQwvW8xg/g/zE/rzYhkA9OJHmaQU9UIMa3ML47pa3WQT9NY=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=h2Ye3kdL; arc=none smtp.client-ip=209.85.167.48
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org
Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-553233211d3so4532570e87.2
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 10:58:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=chromium.org; s=google; t=1748455094; x=1749059894; darn=vger.kernel.org;
h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
:mime-version:subject:date:from:from:to:cc:subject:date:message-id
:reply-to;
bh=r6ZdFC6Ythz4loEfSX3UpFuPzlbXiWvOPTc7vSzbMBg=;
b=h2Ye3kdL1LBa+d3VGn/M+StemtXTdugv48DROSytFM7R9yf0Bjh/MK3alYDVSpGINa
h0Wog2+/5NYZRxOYU/XosCkBH9EE+L++TZ52IxOJK8nRldkyKe1x3UFix22lbQL+WDe6
2TeoYfPjQIuj/GExXMiwO1qc5mIolT0rkJJFo=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1748455094; x=1749059894;
h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
:mime-version:subject:date:from:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=r6ZdFC6Ythz4loEfSX3UpFuPzlbXiWvOPTc7vSzbMBg=;
b=UrfyGAF0AIRLF5xZDLOz+jibpY2JNK9d5rLeHSkl5Pqvb/rU/BheE1tLkeK5Z1Fuvl
xifQyl0w+wFkmFPsl+a8m2Fl/Dyuna2ULgARE1IN5+CKdoqMEgb+kiv81pKjHveNcOPq
iOUpBb9TfewaJ/YwSxt9Wbr7PM4xvRvPi6txGnyLa2+uirIkwfEe6okz8BJbou4ZZVX/
mlNPO/T3vSUxBO0ONP/KUGo46oHqcVVypKdXweRgm6NOagw+cRlLpOXCBybufWMJGLlg
48LbodbhJl+irxQuW1Mv+52zO1lLblNXTscG9ZAbQwiY65fhqNLdtjhGHL1hfEhf4Qx4
96JQ==
X-Forwarded-Encrypted: i=1; AJvYcCWLBvuhJM/J7i2twUd7ssYfaBdZTq5maLBulvMHI4haONw5zYjV62FZbewPzqIJ/BwplhgdV7Pfbf+50rE=@vger.kernel.org
X-Gm-Message-State: AOJu0YzWEdso+UOmBmCwMJ8OTQwBoUlbgkxn0gdOFR2cYmHNJPoaGS68
WLDLQXylouQWrpozMNon9STMA+nPObkOayfFVs+Q0BNTDNCCyja2euDN3uqZmpSsbQ==
X-Gm-Gg: ASbGnctS1LJjCb0CfuJ8J6xTDOYWNJKRVP/YZimpjnciVieBSP0uk9XESXSGBeULyqI
HfL3hdx7LdluCBFavwZzxBAV/DvSd+Z5dEk/+WD4BGsO7d84U2e0/kEtkuSmwiSQnv44mA2/Vnf
sPhD8pASbtzf4NxX/5z/fOhKBVUx3wM5B/Mw/nbTSq1a/ymuJxBoYFR4vyF1BDa4k++7ThnFk5s
Y5gzWHpLs8hahzZyJqDcjwBRK9Pq0Cbyvz/uGqoIKY5AT4xDQhelySDyUkQ1xnpI5JNoQE23aSU
6MwIANDZQgRy3rxlNeaCiIzkGtb+OkM+Txh35GH2d5l9+SieIGqHxrzNtz2iW7POxQyRuAwSFFt
D8uZGjNcpb/zor8fTFay4reyjzg==
X-Google-Smtp-Source: AGHT+IFwdhuUJxjYc3nOaPs2RVUFqHfbZ+dZLYDziM2t3vXZ14MxYKMFE3UeBWd/ByHWSWGU/BmNQA==
X-Received: by 2002:a05:6512:4150:b0:552:20e1:ee25 with SMTP id 2adb3069b0e04-55220e1ef6amr3142014e87.55.1748455094273;
Wed, 28 May 2025 10:58:14 -0700 (PDT)
Received: from ribalda.c.googlers.com (90.52.88.34.bc.googleusercontent.com. [34.88.52.90])
by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5532f62a6eesm376805e87.98.2025.05.28.10.58.13
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 28 May 2025 10:58:13 -0700 (PDT)
From: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
Date: Wed, 28 May 2025 17:57:58 +0000
Subject: [PATCH 3/9] media: uvcvideo: Use vb2 ioctl and fop helpers
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20250528-uvc-grannular-invert-v1-3-d01581f9cc25@xxxxxxxxxxxx>
References: <20250528-uvc-grannular-invert-v1-0-d01581f9cc25@xxxxxxxxxxxx>
In-Reply-To: <20250528-uvc-grannular-invert-v1-0-d01581f9cc25@xxxxxxxxxxxx>
To: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>,
Hans de Goede <hdegoede@xxxxxxxxxx>,
Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>,
Hans Verkuil <hverkuil@xxxxxxxxx>
Cc: linux-media@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx,
Ricardo Ribalda <ribalda@xxxxxxxxxxxx>, Hans Verkuil <hans@xxxxxxxxxxxx>,
Hans de Goede <hansg@xxxxxxxxxx>
X-Mailer: b4 0.14.2
X-Spam-Status: No, score=-6.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,
MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
From: Hans Verkuil <hans@xxxxxxxxxxxx>
When uvc was written the vb2 ioctl and file operation helpers didn't exist.
This patch switches uvc over to those helpers, which removes a lot of
boilerplatecode and simplifies VIDIOC_G/S_PRIORITY handling and allows us
to drop the 'privileges' scheme, since that's now handled inside the vb2
helpers.
This makes it possible for uvc to fix the v4l2-compliance streaming tests:
warn: v4l2-test-formats.cpp(1075): Could not set fmt2
This patch introduces a change on behavior on the uvcdriver to be
aligned with the rest of the subsystem. Now S_INPUT, S_PARM and
S_FORMAT do no gran exclusive ownership of the device.
Reviewed-by: Hans de Goede <hansg@xxxxxxxxxx>
Signed-off-by: Hans Verkuil <hans@xxxxxxxxxxxx>
Co-developed-by: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
Signed-off-by: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
---
drivers/media/usb/uvc/uvc_driver.c | 34 +----
drivers/media/usb/uvc/uvc_metadata.c | 8 +-
drivers/media/usb/uvc/uvc_queue.c | 143 --------------------
drivers/media/usb/uvc/uvc_v4l2.c | 251 +++--------------------------------
drivers/media/usb/uvc/uvcvideo.h | 37 +-----
5 files changed, 30 insertions(+), 443 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index da24a655ab68cc0957762f2b67387677c22224d1..4eeedab93b90939fc4c925012a18b7d018ade39f 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -1725,7 +1725,6 @@ static struct uvc_video_chain *uvc_alloc_chain(struct uvc_device *dev)
INIT_LIST_HEAD(&chain->entities);
mutex_init(&chain->ctrl_mutex);
chain->dev = dev;
- v4l2_prio_init(&chain->prio);
return chain;
}
@@ -1958,31 +1957,7 @@ static void uvc_unregister_video(struct uvc_device *dev)
if (!video_is_registered(&stream->vdev))
continue;
- /*
- * For stream->vdev we follow the same logic as:
- * vb2_video_unregister_device().
- */
-
- /* 1. Take a reference to vdev */
- get_device(&stream->vdev.dev);
-
- /* 2. Ensure that no new ioctls can be called. */
- video_unregister_device(&stream->vdev);
-
- /* 3. Wait for old ioctls to finish. */
- mutex_lock(&stream->mutex);
-
- /* 4. Stop streaming. */
- uvc_queue_release(&stream->queue);
-
- mutex_unlock(&stream->mutex);
-
- put_device(&stream->vdev.dev);
-
- /*
- * For stream->meta.vdev we can directly call:
- * vb2_video_unregister_device().
- */
+ vb2_video_unregister_device(&stream->vdev);
vb2_video_unregister_device(&stream->meta.vdev);
/*
@@ -2029,7 +2004,8 @@ int uvc_register_video_device(struct uvc_device *dev,
vdev->fops = fops;
vdev->ioctl_ops = ioctl_ops;
vdev->release = uvc_release;
- vdev->prio = &stream->chain->prio;
+ vdev->queue = &queue->queue;
+ vdev->lock = &queue->mutex;
if (type == V4L2_BUF_TYPE_VIDEO_OUTPUT)
vdev->vfl_dir = VFL_DIR_TX;
else
@@ -2399,8 +2375,8 @@ static int __uvc_resume(struct usb_interface *intf, int reset)
if (stream->intf == intf) {
ret = uvc_video_resume(stream, reset);
if (ret < 0)
- uvc_queue_streamoff(&stream->queue,
- stream->queue.queue.type);
+ vb2_streamoff(&stream->queue.queue,
+ stream->queue.queue.type);
return ret;
}
}
diff --git a/drivers/media/usb/uvc/uvc_metadata.c b/drivers/media/usb/uvc/uvc_metadata.c
index 82de7781f5b6b70c5ba16bcba9e0741231231904..d3aab22f91cea21aefc56409924dfa1451aec914 100644
--- a/drivers/media/usb/uvc/uvc_metadata.c
+++ b/drivers/media/usb/uvc/uvc_metadata.c
@@ -96,7 +96,7 @@ static int uvc_meta_v4l2_set_format(struct file *file, void *fh,
*/
mutex_lock(&stream->mutex);
- if (uvc_queue_allocated(&stream->queue))
+ if (vb2_is_busy(&stream->meta.queue.queue))
ret = -EBUSY;
else
stream->meta.format = fmt->dataformat;
@@ -164,12 +164,6 @@ int uvc_meta_register(struct uvc_streaming *stream)
stream->meta.format = V4L2_META_FMT_UVC;
- /*
- * The video interface queue uses manual locking and thus does not set
- * the queue pointer. Set it manually here.
- */
- vdev->queue = &queue->queue;
-
return uvc_register_video_device(dev, stream, vdev, queue,
V4L2_BUF_TYPE_META_CAPTURE,
&uvc_meta_fops, &uvc_meta_ioctl_ops);
diff --git a/drivers/media/usb/uvc/uvc_queue.c b/drivers/media/usb/uvc/uvc_queue.c
index 2ee142621042167c2587b6a6fdd51c1a46d31c11..72c5494dee9f46ff61072e7d293bfaddda40e615 100644
--- a/drivers/media/usb/uvc/uvc_queue.c
+++ b/drivers/media/usb/uvc/uvc_queue.c
@@ -242,153 +242,10 @@ int uvc_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type)
return 0;
}
-void uvc_queue_release(struct uvc_video_queue *queue)
-{
- mutex_lock(&queue->mutex);
- vb2_queue_release(&queue->queue);
- mutex_unlock(&queue->mutex);
-}
-
-/* -----------------------------------------------------------------------------
- * V4L2 queue operations
- */
-
-int uvc_request_buffers(struct uvc_video_queue *queue,
- struct v4l2_requestbuffers *rb)
-{
- int ret;
-
- mutex_lock(&queue->mutex);
- ret = vb2_reqbufs(&queue->queue, rb);
- mutex_unlock(&queue->mutex);
-
- return ret ? ret : rb->count;
-}
-
-int uvc_query_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *buf)
-{
- int ret;
-
- mutex_lock(&queue->mutex);
- ret = vb2_querybuf(&queue->queue, buf);
- mutex_unlock(&queue->mutex);
-
- return ret;
-}
-
-int uvc_create_buffers(struct uvc_video_queue *queue,
- struct v4l2_create_buffers *cb)
-{
- int ret;
-
- mutex_lock(&queue->mutex);
- ret = vb2_create_bufs(&queue->queue, cb);
- mutex_unlock(&queue->mutex);
-
- return ret;
-}
-
-int uvc_queue_buffer(struct uvc_video_queue *queue,
- struct media_device *mdev, struct v4l2_buffer *buf)
-{
- int ret;
-
- mutex_lock(&queue->mutex);
- ret = vb2_qbuf(&queue->queue, mdev, buf);
- mutex_unlock(&queue->mutex);
-
- return ret;
-}
-
-int uvc_export_buffer(struct uvc_video_queue *queue,
- struct v4l2_exportbuffer *exp)
-{
- int ret;
-
- mutex_lock(&queue->mutex);
- ret = vb2_expbuf(&queue->queue, exp);
- mutex_unlock(&queue->mutex);
-
- return ret;
-}
-
-int uvc_dequeue_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *buf,
- int nonblocking)
-{
- int ret;
-
- mutex_lock(&queue->mutex);
- ret = vb2_dqbuf(&queue->queue, buf, nonblocking);
- mutex_unlock(&queue->mutex);
-
- return ret;
-}
-
-int uvc_queue_streamon(struct uvc_video_queue *queue, enum v4l2_buf_type type)
-{
- int ret;
-
- mutex_lock(&queue->mutex);
- ret = vb2_streamon(&queue->queue, type);
- mutex_unlock(&queue->mutex);
-
- return ret;
-}
-
-int uvc_queue_streamoff(struct uvc_video_queue *queue, enum v4l2_buf_type type)
-{
- int ret;
-
- mutex_lock(&queue->mutex);
- ret = vb2_streamoff(&queue->queue, type);
- mutex_unlock(&queue->mutex);
-
- return ret;
-}
-
-int uvc_queue_mmap(struct uvc_video_queue *queue, struct vm_area_struct *vma)
-{
- return vb2_mmap(&queue->queue, vma);
-}
-
-#ifndef CONFIG_MMU
-unsigned long uvc_queue_get_unmapped_area(struct uvc_video_queue *queue,
- unsigned long pgoff)
-{
- return vb2_get_unmapped_area(&queue->queue, 0, 0, pgoff, 0);
-}
-#endif
-
-__poll_t uvc_queue_poll(struct uvc_video_queue *queue, struct file *file,
- poll_table *wait)
-{
- __poll_t ret;
-
- mutex_lock(&queue->mutex);
- ret = vb2_poll(&queue->queue, file, wait);
- mutex_unlock(&queue->mutex);
-
- return ret;
-}
-
/* -----------------------------------------------------------------------------
*
*/
-/*
- * Check if buffers have been allocated.
- */
-int uvc_queue_allocated(struct uvc_video_queue *queue)
-{
- int allocated;
-
- mutex_lock(&queue->mutex);
- allocated = vb2_is_busy(&queue->queue);
- mutex_unlock(&queue->mutex);
-
- return allocated;
-}
-
/*
* Cancel the video buffers queue.
*
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
index 1abdf1ea39956bbbadd3f166f37bdac518068648..49cc64dd7e2e737f431b9df9df68921d9c543751 100644
--- a/drivers/media/usb/uvc/uvc_v4l2.c
+++ b/drivers/media/usb/uvc/uvc_v4l2.c
@@ -47,8 +47,6 @@ void uvc_pm_put(struct uvc_device *dev)
usb_autopm_put_interface(dev->intf);
}
-static int uvc_acquire_privileges(struct uvc_fh *handle);
-
static int uvc_control_add_xu_mapping(struct uvc_video_chain *chain,
struct uvc_control_mapping *map,
const struct uvc_xu_control_mapping *xmap)
@@ -436,10 +434,6 @@ static int uvc_ioctl_s_fmt(struct file *file, void *fh,
const struct uvc_frame *frame;
int ret;
- ret = uvc_acquire_privileges(handle);
- if (ret < 0)
- return ret;
-
if (fmt->type != stream->type)
return -EINVAL;
@@ -448,8 +442,7 @@ static int uvc_ioctl_s_fmt(struct file *file, void *fh,
return ret;
mutex_lock(&stream->mutex);
-
- if (uvc_queue_allocated(&stream->queue)) {
+ if (vb2_is_busy(&stream->queue.queue)) {
ret = -EBUSY;
goto done;
}
@@ -513,10 +506,6 @@ static int uvc_ioctl_s_parm(struct file *file, void *fh,
unsigned int i;
int ret;
- ret = uvc_acquire_privileges(handle);
- if (ret < 0)
- return ret;
-
if (parm->type != stream->type)
return -EINVAL;
@@ -593,63 +582,6 @@ static int uvc_ioctl_s_parm(struct file *file, void *fh,
return 0;
}
-/* ------------------------------------------------------------------------
- * Privilege management
- */
-
-/*
- * Privilege management is the multiple-open implementation basis. The current
- * implementation is completely transparent for the end-user and doesn't
- * require explicit use of the VIDIOC_G_PRIORITY and VIDIOC_S_PRIORITY ioctls.
- * Those ioctls enable finer control on the device (by making possible for a
- * user to request exclusive access to a device), but are not mature yet.
- * Switching to the V4L2 priority mechanism might be considered in the future
- * if this situation changes.
- *
- * Each open instance of a UVC device can either be in a privileged or
- * unprivileged state. Only a single instance can be in a privileged state at
- * a given time. Trying to perform an operation that requires privileges will
- * automatically acquire the required privileges if possible, or return -EBUSY
- * otherwise. Privileges are dismissed when closing the instance or when
- * freeing the video buffers using VIDIOC_REQBUFS.
- *
- * Operations that require privileges are:
- *
- * - VIDIOC_S_INPUT
- * - VIDIOC_S_PARM
- * - VIDIOC_S_FMT
- * - VIDIOC_CREATE_BUFS
- * - VIDIOC_REQBUFS
- */
-static int uvc_acquire_privileges(struct uvc_fh *handle)
-{
- /* Always succeed if the handle is already privileged. */
- if (handle->state == UVC_HANDLE_ACTIVE)
- return 0;
-
- /* Check if the device already has a privileged handle. */
- if (atomic_inc_return(&handle->stream->active) != 1) {
- atomic_dec(&handle->stream->active);
- return -EBUSY;
- }
-
- handle->state = UVC_HANDLE_ACTIVE;
- return 0;
-}
-
-static void uvc_dismiss_privileges(struct uvc_fh *handle)
-{
- if (handle->state == UVC_HANDLE_ACTIVE)
- atomic_dec(&handle->stream->active);
-
- handle->state = UVC_HANDLE_PASSIVE;
-}
-
-static int uvc_has_privileges(struct uvc_fh *handle)
-{
- return handle->state == UVC_HANDLE_ACTIVE;
-}
-
/* ------------------------------------------------------------------------
* V4L2 file operations
*/
@@ -671,7 +603,6 @@ static int uvc_v4l2_open(struct file *file)
v4l2_fh_add(&handle->vfh);
handle->chain = stream->chain;
handle->stream = stream;
- handle->state = UVC_HANDLE_PASSIVE;
file->private_data = handle;
return 0;
@@ -686,18 +617,11 @@ static int uvc_v4l2_release(struct file *file)
uvc_ctrl_cleanup_fh(handle);
- /* Only free resources if this is a privileged handle. */
- if (uvc_has_privileges(handle))
- uvc_queue_release(&stream->queue);
-
if (handle->is_streaming)
uvc_pm_put(stream->dev);
/* Release the file handle. */
- uvc_dismiss_privileges(handle);
- v4l2_fh_del(&handle->vfh);
- v4l2_fh_exit(&handle->vfh);
- kfree(handle);
+ vb2_fop_release(file);
file->private_data = NULL;
return 0;
@@ -753,91 +677,6 @@ static int uvc_ioctl_try_fmt(struct file *file, void *fh,
return uvc_v4l2_try_format(stream, fmt, &probe, NULL, NULL);
}
-static int uvc_ioctl_reqbufs(struct file *file, void *fh,
- struct v4l2_requestbuffers *rb)
-{
- struct uvc_fh *handle = fh;
- struct uvc_streaming *stream = handle->stream;
- int ret;
-
- ret = uvc_acquire_privileges(handle);
- if (ret < 0)
- return ret;
-
- mutex_lock(&stream->mutex);
- ret = uvc_request_buffers(&stream->queue, rb);
- mutex_unlock(&stream->mutex);
- if (ret < 0)
- return ret;
-
- if (ret == 0)
- uvc_dismiss_privileges(handle);
-
- return 0;
-}
-
-static int uvc_ioctl_querybuf(struct file *file, void *fh,
- struct v4l2_buffer *buf)
-{
- struct uvc_fh *handle = fh;
- struct uvc_streaming *stream = handle->stream;
-
- if (!uvc_has_privileges(handle))
- return -EBUSY;
-
- return uvc_query_buffer(&stream->queue, buf);
-}
-
-static int uvc_ioctl_qbuf(struct file *file, void *fh, struct v4l2_buffer *buf)
-{
- struct uvc_fh *handle = fh;
- struct uvc_streaming *stream = handle->stream;
-
- if (!uvc_has_privileges(handle))
- return -EBUSY;
-
- return uvc_queue_buffer(&stream->queue,
- stream->vdev.v4l2_dev->mdev, buf);
-}
-
-static int uvc_ioctl_expbuf(struct file *file, void *fh,
- struct v4l2_exportbuffer *exp)
-{
- struct uvc_fh *handle = fh;
- struct uvc_streaming *stream = handle->stream;
-
- if (!uvc_has_privileges(handle))
- return -EBUSY;
-
- return uvc_export_buffer(&stream->queue, exp);
-}
-
-static int uvc_ioctl_dqbuf(struct file *file, void *fh, struct v4l2_buffer *buf)
-{
- struct uvc_fh *handle = fh;
- struct uvc_streaming *stream = handle->stream;
-
- if (!uvc_has_privileges(handle))
- return -EBUSY;
-
- return uvc_dequeue_buffer(&stream->queue, buf,
- file->f_flags & O_NONBLOCK);
-}
-
-static int uvc_ioctl_create_bufs(struct file *file, void *fh,
- struct v4l2_create_buffers *cb)
-{
- struct uvc_fh *handle = fh;
- struct uvc_streaming *stream = handle->stream;
- int ret;
-
- ret = uvc_acquire_privileges(handle);
- if (ret < 0)
- return ret;
-
- return uvc_create_buffers(&stream->queue, cb);
-}
-
static int uvc_ioctl_streamon(struct file *file, void *fh,
enum v4l2_buf_type type)
{
@@ -845,11 +684,6 @@ static int uvc_ioctl_streamon(struct file *file, void *fh,
struct uvc_streaming *stream = handle->stream;
int ret;
- if (!uvc_has_privileges(handle))
- return -EBUSY;
-
- guard(mutex)(&stream->mutex);
-
if (handle->is_streaming)
return 0;
@@ -857,7 +691,7 @@ static int uvc_ioctl_streamon(struct file *file, void *fh,
if (ret)
return ret;
- ret = uvc_queue_streamon(&stream->queue, type);
+ ret = vb2_ioctl_streamon(file, fh, type);
if (ret) {
uvc_pm_put(stream->dev);
return ret;
@@ -873,13 +707,12 @@ static int uvc_ioctl_streamoff(struct file *file, void *fh,
{
struct uvc_fh *handle = fh;
struct uvc_streaming *stream = handle->stream;
+ int ret;
- if (!uvc_has_privileges(handle))
- return -EBUSY;
-
- guard(mutex)(&stream->mutex);
+ ret = vb2_ioctl_streamoff(file, fh, type);
+ if (ret)
+ return ret;
- uvc_queue_streamoff(&stream->queue, type);
if (handle->is_streaming) {
handle->is_streaming = false;
uvc_pm_put(stream->dev);
@@ -962,13 +795,13 @@ static int uvc_ioctl_g_input(struct file *file, void *fh, unsigned int *input)
static int uvc_ioctl_s_input(struct file *file, void *fh, unsigned int input)
{
struct uvc_fh *handle = fh;
+ struct uvc_streaming *stream = handle->stream;
struct uvc_video_chain *chain = handle->chain;
u8 *buf;
int ret;
- ret = uvc_acquire_privileges(handle);
- if (ret < 0)
- return ret;
+ if (vb2_is_busy(&stream->queue.queue))
+ return -EBUSY;
if (chain->selector == NULL ||
(chain->dev->quirks & UVC_QUIRK_IGNORE_SELECTOR_UNIT)) {
@@ -1469,50 +1302,6 @@ static long uvc_v4l2_unlocked_ioctl(struct file *file,
return ret;
}
-static ssize_t uvc_v4l2_read(struct file *file, char __user *data,
- size_t count, loff_t *ppos)
-{
- struct uvc_fh *handle = file->private_data;
- struct uvc_streaming *stream = handle->stream;
-
- uvc_dbg(stream->dev, CALLS, "%s: not implemented\n", __func__);
- return -EINVAL;
-}
-
-static int uvc_v4l2_mmap(struct file *file, struct vm_area_struct *vma)
-{
- struct uvc_fh *handle = file->private_data;
- struct uvc_streaming *stream = handle->stream;
-
- uvc_dbg(stream->dev, CALLS, "%s\n", __func__);
-
- return uvc_queue_mmap(&stream->queue, vma);
-}
-
-static __poll_t uvc_v4l2_poll(struct file *file, poll_table *wait)
-{
- struct uvc_fh *handle = file->private_data;
- struct uvc_streaming *stream = handle->stream;
-
- uvc_dbg(stream->dev, CALLS, "%s\n", __func__);
-
- return uvc_queue_poll(&stream->queue, file, wait);
-}
-
-#ifndef CONFIG_MMU
-static unsigned long uvc_v4l2_get_unmapped_area(struct file *file,
- unsigned long addr, unsigned long len, unsigned long pgoff,
- unsigned long flags)
-{
- struct uvc_fh *handle = file->private_data;
- struct uvc_streaming *stream = handle->stream;
-
- uvc_dbg(stream->dev, CALLS, "%s\n", __func__);
-
- return uvc_queue_get_unmapped_area(&stream->queue, pgoff);
-}
-#endif
-
const struct v4l2_ioctl_ops uvc_ioctl_ops = {
.vidioc_g_fmt_vid_cap = uvc_ioctl_g_fmt,
.vidioc_g_fmt_vid_out = uvc_ioctl_g_fmt,
@@ -1525,12 +1314,13 @@ const struct v4l2_ioctl_ops uvc_ioctl_ops = {
.vidioc_enum_fmt_vid_out = uvc_ioctl_enum_fmt,
.vidioc_try_fmt_vid_cap = uvc_ioctl_try_fmt,
.vidioc_try_fmt_vid_out = uvc_ioctl_try_fmt,
- .vidioc_reqbufs = uvc_ioctl_reqbufs,
- .vidioc_querybuf = uvc_ioctl_querybuf,
- .vidioc_qbuf = uvc_ioctl_qbuf,
- .vidioc_expbuf = uvc_ioctl_expbuf,
- .vidioc_dqbuf = uvc_ioctl_dqbuf,
- .vidioc_create_bufs = uvc_ioctl_create_bufs,
+ .vidioc_reqbufs = vb2_ioctl_reqbufs,
+ .vidioc_querybuf = vb2_ioctl_querybuf,
+ .vidioc_prepare_buf = vb2_ioctl_prepare_buf,
+ .vidioc_qbuf = vb2_ioctl_qbuf,
+ .vidioc_expbuf = vb2_ioctl_expbuf,
+ .vidioc_dqbuf = vb2_ioctl_dqbuf,
+ .vidioc_create_bufs = vb2_ioctl_create_bufs,
.vidioc_streamon = uvc_ioctl_streamon,
.vidioc_streamoff = uvc_ioctl_streamoff,
.vidioc_enum_input = uvc_ioctl_enum_input,
@@ -1557,11 +1347,10 @@ const struct v4l2_file_operations uvc_fops = {
#ifdef CONFIG_COMPAT
.compat_ioctl32 = uvc_v4l2_compat_ioctl32,
#endif
- .read = uvc_v4l2_read,
- .mmap = uvc_v4l2_mmap,
- .poll = uvc_v4l2_poll,
+ .mmap = vb2_fop_mmap,
+ .poll = vb2_fop_poll,
#ifndef CONFIG_MMU
- .get_unmapped_area = uvc_v4l2_get_unmapped_area,
+ .get_unmapped_area = vb2_fop_get_unmapped_area,
#endif
};
diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
index b9f8eb62ba1d82ea7788cf6c10cc838a429dbc9e..3ddbf065a2cbae40ee48cb06f84ca8f0052990c4 100644
--- a/drivers/media/usb/uvc/uvcvideo.h
+++ b/drivers/media/usb/uvc/uvcvideo.h
@@ -326,7 +326,10 @@ struct uvc_buffer {
struct uvc_video_queue {
struct vb2_queue queue;
- struct mutex mutex; /* Protects queue */
+ struct mutex mutex; /*
+ * Serializes vb2_queue and
+ * fops
+ */
unsigned int flags;
unsigned int buf_used;
@@ -349,7 +352,6 @@ struct uvc_video_chain {
* uvc_fh.pending_async_ctrls
*/
- struct v4l2_prio_state prio; /* V4L2 priority state */
u32 caps; /* V4L2 chain-wide caps */
u8 ctrl_class_bitmap; /* Bitmap of valid classes */
};
@@ -619,16 +621,10 @@ struct uvc_device {
struct uvc_entity *gpio_unit;
};
-enum uvc_handle_state {
- UVC_HANDLE_PASSIVE = 0,
- UVC_HANDLE_ACTIVE = 1,
-};
-
struct uvc_fh {
struct v4l2_fh vfh;
struct uvc_video_chain *chain;
struct uvc_streaming *stream;
- enum uvc_handle_state state;
unsigned int pending_async_ctrls;
bool is_streaming;
};
@@ -687,36 +683,11 @@ struct uvc_entity *uvc_entity_by_id(struct uvc_device *dev, int id);
/* Video buffers queue management. */
int uvc_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type);
-void uvc_queue_release(struct uvc_video_queue *queue);
-int uvc_request_buffers(struct uvc_video_queue *queue,
- struct v4l2_requestbuffers *rb);
-int uvc_query_buffer(struct uvc_video_queue *queue,
- struct v4l2_buffer *v4l2_buf);
-int uvc_create_buffers(struct uvc_video_queue *queue,
- struct v4l2_create_buffers *v4l2_cb);
-int uvc_queue_buffer(struct uvc_video_queue *queue,
- struct media_device *mdev,
- struct v4l2_buffer *v4l2_buf);
-int uvc_export_buffer(struct uvc_video_queue *queue,
- struct v4l2_exportbuffer *exp);
-int uvc_dequeue_buffer(struct uvc_video_queue *queue,
- struct v4l2_buffer *v4l2_buf, int nonblocking);
-int uvc_queue_streamon(struct uvc_video_queue *queue, enum v4l2_buf_type type);
-int uvc_queue_streamoff(struct uvc_video_queue *queue, enum v4l2_buf_type type);
void uvc_queue_cancel(struct uvc_video_queue *queue, int disconnect);
struct uvc_buffer *uvc_queue_next_buffer(struct uvc_video_queue *queue,
struct uvc_buffer *buf);
struct uvc_buffer *uvc_queue_get_current_buffer(struct uvc_video_queue *queue);
void uvc_queue_buffer_release(struct uvc_buffer *buf);
-int uvc_queue_mmap(struct uvc_video_queue *queue,
- struct vm_area_struct *vma);
-__poll_t uvc_queue_poll(struct uvc_video_queue *queue, struct file *file,
- poll_table *wait);
-#ifndef CONFIG_MMU
-unsigned long uvc_queue_get_unmapped_area(struct uvc_video_queue *queue,
- unsigned long pgoff);
-#endif
-int uvc_queue_allocated(struct uvc_video_queue *queue);
static inline int uvc_queue_streaming(struct uvc_video_queue *queue)
{
return vb2_is_streaming(&queue->queue);
--
2.49.0.1266.g31b7d2e469-goog
Return-Path: <linux-kernel+bounces-665930-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 45C2541E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 13:59:53 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by ny.mirrors.kernel.org (Postfix) with ESMTPS id 26EBC4E4E48
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:59:48 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 447B028F931;
Wed, 28 May 2025 17:58:22 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="fVxEhKAY"
Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3951328EA44
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:58:19 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.41
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748455101; cv=none; b=WgHodVHJ+EPkFEshXwykrkfgZAsC8gS6vBvdN+3hSQALVyZoolN/Pq0SqBPHC+u472HWxOczdRW1+m7xiiQyFq7i+/RM+xwYW410jUz3/BrRQZvLxGz4KRCHyKfbItrJgOhyWidmRf03RcvQdU8Zcse4x4EBFUlR1QmUGk6/HgQ=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748455101; c=relaxed/simple;
bh=HA5ZQn5fQPLOOloa5F6rQaFQ9FTy8GVrXJ6ypXARzQk=;
h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:
In-Reply-To:To:Cc; b=GjNgl76thxEr6MQqypogdnASW0sSb5D8H/oTVZOyPit7lwfNt/aNeczi+sHiMNuBJOmMdfVXq22GbOvTLaUUPl2tsaz8l9vmAdvy0JLp8EeAuELshdD+qlvRX5kWmnj6Zh7BAGVabQc94Q36O/JNPR551LgmBOefMv4ejfrq88M=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=fVxEhKAY; arc=none smtp.client-ip=209.85.167.41
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org
Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-553246e975fso25106e87.0
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 10:58:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=chromium.org; s=google; t=1748455097; x=1749059897; darn=vger.kernel.org;
h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
:mime-version:subject:date:from:from:to:cc:subject:date:message-id
:reply-to;
bh=tCuIJR/iChkHw0yEIzz8Ln6RB6qmCdhlawG29rZoR8U=;
b=fVxEhKAYkteC/GmhLOQRS9CdyTGTW7VFyGZ5pGSaPKQBvO83pUc3JAhf6erkAJxYKq
pApgD6o10uMLuJ3EJuZiwIqhRcyri0moiUsULKc7waR6VaYzseDI0eV6mA1Iwlcy2iGX
UPc+mOZVOz60NuwcvXgtXcipml+gc6442gtCY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1748455097; x=1749059897;
h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
:mime-version:subject:date:from:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=tCuIJR/iChkHw0yEIzz8Ln6RB6qmCdhlawG29rZoR8U=;
b=ioUA1FIQx1tZQwc32OCTR2pDiAa/3d8PvA1yVUiEFan/rCvQvglGDViPPDRX7cuppY
P3q3GMTG+aCXnktnxJS4HDD8IwT1aoLXje42i1roUEoBrvRmENS+RFME0ywdhhXbKTcD
BTZtgkFzZ7J2UNAgQrXvKq5oNWvdrLU3IwKW0B5RkCL70rG/z5sc1kCfSoZ2ukEN27U9
OZO68w1MN03USeul82UIQCFytPP2DQk9he8i1bAO/Za58L49bq0nFioPqKpARwnytSxK
60f2PARsOv89UMz6y+G5EzsmuzQtiWJOsIXNWKg2PHsBK9yI7ub2SdXFljZQOJ64meqn
YhcQ==
X-Forwarded-Encrypted: i=1; AJvYcCUjnU2bBTVjXtQqC1cT0l9MvdvLW36vnZ0EHG5LUwXZpFYPOLmSSWLOKnhXGKDM5wrdu0at5haGkuVGZAk=@vger.kernel.org
X-Gm-Message-State: AOJu0YyhkDZDHVtaq0B/5vVqMVZY+79ga1BkdZaf4OqFRytA1j22hA/Z
aLKIH6QNzKuBPLjRhLcWPgO8czhdUOG67l2OojGna9IGJz/6yAPHbj/AYiArBKcaDw==
X-Gm-Gg: ASbGncu1PookgISDNOPA4xQzeSYLj8YwwVg5Pv5LvCsTsmZifnHbWlJEWetXA+OsrhN
bz1tQWAEXqvWXtcRxMBPim1O1tGXPhlT17fnxqWRXP4B7ViyVhaxtATUbE3mRNFk7MBspcPBTL0
6EP6btR4fkTffU84OCy5FIZtWu1u6nmqmI64lBPsaRE9JQFgzTmABRxsHmGMeeqpcD9vu1Fua/L
2T6b4esrgl/7sJip8VzZlqVYk6x8k63vhh3FxWGo3MqMAOCYBYXGUSXZW27gaYIdjwXCULVXbHj
XKVhlKSsiaQz2nZ1ga62Euk7B7gewIbZrOdfUcL5ioQPjrg8efUbiw48IhenOX3dMg1+BucX629
piS/dX7/Xx2oES8Q/myZURXMwEQ==
X-Google-Smtp-Source: AGHT+IEfb/5c0hVCUbJITUofOqtObUG+Si5mZBkEHtSmk+GA/XRbpdGOGTWRjSo++W26qr16iDNv9w==
X-Received: by 2002:a05:6512:23aa:b0:553:2480:2309 with SMTP id 2adb3069b0e04-553248024ffmr3984960e87.3.1748455097320;
Wed, 28 May 2025 10:58:17 -0700 (PDT)
Received: from ribalda.c.googlers.com (90.52.88.34.bc.googleusercontent.com. [34.88.52.90])
by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5532f62a6eesm376805e87.98.2025.05.28.10.58.16
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 28 May 2025 10:58:16 -0700 (PDT)
From: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
Date: Wed, 28 May 2025 17:58:03 +0000
Subject: [PATCH 8/9] media: uvcvideo: Do not turn on the camera unless is
needed
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20250528-uvc-grannular-invert-v1-8-d01581f9cc25@xxxxxxxxxxxx>
References: <20250528-uvc-grannular-invert-v1-0-d01581f9cc25@xxxxxxxxxxxx>
In-Reply-To: <20250528-uvc-grannular-invert-v1-0-d01581f9cc25@xxxxxxxxxxxx>
To: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>,
Hans de Goede <hdegoede@xxxxxxxxxx>,
Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>,
Hans Verkuil <hverkuil@xxxxxxxxx>
Cc: linux-media@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx,
Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
X-Mailer: b4 0.14.2
X-Spam-Status: No, score=-5.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,
MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS,UPPERCASE_50_75 autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
There are a lot of IOCTLs that do not need to turn on the camera. Eg:
- They only operate to internal data, like UVCIOC_CTRL_MAP.
- They are not applicable to the uvc driver, like VIDIOC_G_AUDIO.
- They are handled by the uvc framework, like VIDIOC_STREAMON.
Remove them from the turn-on list.
Signed-off-by: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
---
drivers/media/usb/uvc/uvc_v4l2.c | 57 ----------------------------------------
1 file changed, 57 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
index e7373a2ae3c37ca02f9076773154901a603820ac..fcb1b79c214849ce4da96a86a688d777b32cc688 100644
--- a/drivers/media/usb/uvc/uvc_v4l2.c
+++ b/drivers/media/usb/uvc/uvc_v4l2.c
@@ -1291,75 +1291,18 @@ static long uvc_v4l2_unlocked_ioctl(struct file *file,
/* The following IOCTLs do need to turn on the camera. */
switch (cmd) {
- case UVCIOC_CTRL_MAP:
case UVCIOC_CTRL_QUERY:
- case VIDIOC_CROPCAP:
- case VIDIOC_DBG_G_CHIP_INFO:
- case VIDIOC_DBG_G_REGISTER:
- case VIDIOC_DBG_S_REGISTER:
- case VIDIOC_DECODER_CMD:
- case VIDIOC_DQEVENT:
- case VIDIOC_DV_TIMINGS_CAP:
- case VIDIOC_ENCODER_CMD:
- case VIDIOC_ENUMAUDIO:
- case VIDIOC_ENUMAUDOUT:
- case VIDIOC_ENUMOUTPUT:
- case VIDIOC_ENUMSTD:
- case VIDIOC_ENUM_DV_TIMINGS:
- case VIDIOC_ENUM_FREQ_BANDS:
- case VIDIOC_G_AUDIO:
- case VIDIOC_G_AUDOUT:
- case VIDIOC_G_CROP:
case VIDIOC_G_CTRL:
- case VIDIOC_G_DV_TIMINGS:
- case VIDIOC_G_EDID:
- case VIDIOC_G_ENC_INDEX:
case VIDIOC_G_EXT_CTRLS:
- case VIDIOC_G_FBUF:
- case VIDIOC_G_FREQUENCY:
case VIDIOC_G_INPUT:
- case VIDIOC_G_JPEGCOMP:
- case VIDIOC_G_MODULATOR:
- case VIDIOC_G_OUTPUT:
- case VIDIOC_G_PRIORITY:
- case VIDIOC_G_SLICED_VBI_CAP:
- case VIDIOC_G_STD:
- case VIDIOC_G_TUNER:
- case VIDIOC_LOG_STATUS:
- case VIDIOC_OVERLAY:
- case VIDIOC_PREPARE_BUF:
- case VIDIOC_QUERYBUF:
- case VIDIOC_QUERYCAP:
case VIDIOC_QUERYCTRL:
case VIDIOC_QUERYMENU:
- case VIDIOC_QUERYSTD:
- case VIDIOC_QUERY_DV_TIMINGS:
case VIDIOC_QUERY_EXT_CTRL:
- case VIDIOC_REMOVE_BUFS:
- case VIDIOC_STREAMOFF:
- case VIDIOC_STREAMON:
- case VIDIOC_S_AUDIO:
- case VIDIOC_S_AUDOUT:
- case VIDIOC_S_CROP:
case VIDIOC_S_CTRL:
- case VIDIOC_S_DV_TIMINGS:
- case VIDIOC_S_EDID:
case VIDIOC_S_EXT_CTRLS:
- case VIDIOC_S_FBUF:
case VIDIOC_S_FMT:
- case VIDIOC_S_FREQUENCY:
- case VIDIOC_S_HW_FREQ_SEEK:
case VIDIOC_S_INPUT:
- case VIDIOC_S_JPEGCOMP:
- case VIDIOC_S_MODULATOR:
- case VIDIOC_S_OUTPUT:
case VIDIOC_S_PARM:
- case VIDIOC_S_PRIORITY:
- case VIDIOC_S_SELECTION:
- case VIDIOC_S_STD:
- case VIDIOC_S_TUNER:
- case VIDIOC_TRY_DECODER_CMD:
- case VIDIOC_TRY_ENCODER_CMD:
case VIDIOC_TRY_EXT_CTRLS:
case VIDIOC_TRY_FMT:
return uvc_v4l2_pm_ioctl(file, cmd, arg);
--
2.49.0.1266.g31b7d2e469-goog
Return-Path: <linux-kernel+bounces-665931-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [139.178.88.99])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 22E1D41E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:00:18 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by sv.mirrors.kernel.org (Postfix) with ESMTPS id BDC56A267A1
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:59:40 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id CA05128FA85;
Wed, 28 May 2025 17:58:22 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Dz3ENNmK"
Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id BCBD128EA63
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 17:58:19 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.46
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748455101; cv=none; b=IZZ+z8sjvuY6kG+6XwuKvwN6HS7QKBfmJgs9aslrWcQlccBeMUD4L176nkDfaQne6JK6kt8MqGaRBFKS6LyrPuv+59Lx049XyLKb7ZvFyc6OmoOqseKYqNBiLu7UfxxU56BCpkAN0oGjYPBBWDODFdOYb9foQaU1SI3tF+Obj/Y=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748455101; c=relaxed/simple;
bh=0tY2vHO1hSHETEU5NJ28ZPlV9OSEuEIkkxCtmk8GL9A=;
h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:
In-Reply-To:To:Cc; b=PV15SBUfa/8dbgc0unE0b1AzqccrObXxL00T6jNqBsQP5ky+cNoV72pIovhiW5YhYB/H73aMrIVTAYc4d58z54Chgmfx/iWN+kCxl6qcu4RcCmJK50UoCISXZGFN7f1aWACEHwJ5aTkHrfe1o3bSsLBPbDxqMZALZypLt7RVO4o=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=Dz3ENNmK; arc=none smtp.client-ip=209.85.167.46
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org
Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-54998f865b8so1486e87.3
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 10:58:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=chromium.org; s=google; t=1748455098; x=1749059898; darn=vger.kernel.org;
h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
:mime-version:subject:date:from:from:to:cc:subject:date:message-id
:reply-to;
bh=iGJ1fPweFHWMTsg0HgqwvAn1DtJjgjoW0O70zAHXxoM=;
b=Dz3ENNmKoU+mAMXgz8KIWjqTGBN8zmTObQjYBzI21qU84i+VLiF7YKYLToF5nTOjRk
VmNnVcYhbjTF9BmG4rtUHxu8vc95ritG9Am2+O8OQp4F28KNENBECNk5oQUZGyk/YEkD
Db5pxNDQcgO8wZ+ftDnMw0n+A9J7HswAOqd74=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1748455098; x=1749059898;
h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
:mime-version:subject:date:from:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=iGJ1fPweFHWMTsg0HgqwvAn1DtJjgjoW0O70zAHXxoM=;
b=ecrDJYSXZX0M3ghPVMIH3ny39YNrlk6djU/121fXm86rasLDyoiVzHe8daCcf0Q5bd
7IbFy9kpmGoDcRsOOb9zVzPKsIVmxRC72vZi9mjpPCcbSWBw9C1fuQMKfdQRChkSJpAO
PQllXB4lYeLUVSiWJPCLmDGTeDbmt/YJnotv0vf0TWULTjx6xyqlMH33oUfHcH5bgNxS
9rFiykyxeIpzM7kEwiLimnpHWGKoBN44pXQuUGcZpXCYx4v8IExIsprBrja1Qld1C/am
rQPWMFWdm9rorTAfnr21rU+t0NHjZtTw/r2Jjf77+7r5E+aFcjvC4xk3EiwUGKIuguEX
lVsw==
X-Forwarded-Encrypted: i=1; AJvYcCUQO2podO6KPcy2LOuLv89dB3s39plaRF6n204rZKqHSVpr5nEMeifV/uMfaOdllsxuW3NYgt2469ZZqSo=@vger.kernel.org
X-Gm-Message-State: AOJu0Yxkz7wHU9mNnFnT8F0elgV4dPwhTL+cmYsegUqssXuA0wHkvv8m
2DHXXr5YP6IURqXP2h8tXw9Xl0nfSOb9YCnmnREMkT1x9RZuFNLmpnB+fPqvbAhaYg==
X-Gm-Gg: ASbGncvI9aFhAQ807Wm4VHTt12Z+2tSCxWzdHuD8z8eA2wCtHThXpNIRCqGopM4fk9Q
g+Yn3B3d0+yY2gfGnBK4rPJVsaguzexmL+i/MejYkBraQQhHBlgMn/vNDYY2tzTgL1iEqK0LAkJ
Zn9njzkJt2BD02ihWu+EY3iJpEhbH+EpzQXzpU6TSnapCKPb2ojDbItSDJ19HGkaHfUulmqdKqR
W/aYEcE431wYBnpZazbFmc0lUqLv/QKTCETwYtKdZlc2tpXmb2xBHe/S4W2HVCPRfmTelA4xNwd
9E3stGVw+PpdAfO6KGwBX0AHzHLhlXOrrkQ9sh7mNHztcjBqzayEu9CTyFmifNGmlkM+yHImFkL
P/lbIFo+iigpxwmytWj3zfe5ulw==
X-Google-Smtp-Source: AGHT+IHg4uwY5pHE8HQz7g2AWH8xW287i0HnJpxZMDaAgSGjEn7J8TG2eBQXfzqvF/9EN1laDtI8Ew==
X-Received: by 2002:a05:6512:2388:b0:553:252f:ade9 with SMTP id 2adb3069b0e04-553252fafc9mr3783218e87.4.1748455097777;
Wed, 28 May 2025 10:58:17 -0700 (PDT)
Received: from ribalda.c.googlers.com (90.52.88.34.bc.googleusercontent.com. [34.88.52.90])
by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5532f62a6eesm376805e87.98.2025.05.28.10.58.17
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 28 May 2025 10:58:17 -0700 (PDT)
From: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
Date: Wed, 28 May 2025 17:58:04 +0000
Subject: [PATCH 9/9] media: uvcvideo: Support granular power saving for
compat syscalls
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20250528-uvc-grannular-invert-v1-9-d01581f9cc25@xxxxxxxxxxxx>
References: <20250528-uvc-grannular-invert-v1-0-d01581f9cc25@xxxxxxxxxxxx>
In-Reply-To: <20250528-uvc-grannular-invert-v1-0-d01581f9cc25@xxxxxxxxxxxx>
To: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>,
Hans de Goede <hdegoede@xxxxxxxxxx>,
Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>,
Hans Verkuil <hverkuil@xxxxxxxxx>
Cc: linux-media@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx,
Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
X-Mailer: b4 0.14.2
X-Spam-Status: No, score=-6.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,
MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
Right now we cannot support granular power saving on compat syscalls
because the VIDIOC_*32 NRs defines are not accessible to drivers.
Use the video_translate_cmd() helper to convert the compat syscall NRs
into syscall NRs.
Signed-off-by: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
---
drivers/media/usb/uvc/uvc_v4l2.c | 9 ++-------
drivers/media/v4l2-core/v4l2-ioctl.c | 3 ++-
include/media/v4l2-ioctl.h | 1 +
3 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
index fcb1b79c214849ce4da96a86a688d777b32cc688..048ee7e01808c8944f9bd46e5df2931b9c146ad5 100644
--- a/drivers/media/usb/uvc/uvc_v4l2.c
+++ b/drivers/media/usb/uvc/uvc_v4l2.c
@@ -1282,15 +1282,10 @@ static long uvc_v4l2_pm_ioctl(struct file *file,
static long uvc_v4l2_unlocked_ioctl(struct file *file,
unsigned int cmd, unsigned long arg)
{
- /*
- * For now, we do not support granular power saving for compat
- * syscalls.
- */
- if (in_compat_syscall())
- return uvc_v4l2_pm_ioctl(file, cmd, arg);
+ unsigned int converted_cmd = video_translate_cmd(cmd);
/* The following IOCTLs do need to turn on the camera. */
- switch (cmd) {
+ switch (converted_cmd) {
case UVCIOC_CTRL_QUERY:
case VIDIOC_G_CTRL:
case VIDIOC_G_EXT_CTRLS:
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index 650dc1956f73d2f1943b56c42140c7b8d757259f..6fbd28f911cf23eec43ef1adcf64bd46ef067c81 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -3245,7 +3245,7 @@ static int check_array_args(unsigned int cmd, void *parg, size_t *array_size,
return ret;
}
-static unsigned int video_translate_cmd(unsigned int cmd)
+unsigned int video_translate_cmd(unsigned int cmd)
{
#if !defined(CONFIG_64BIT) && defined(CONFIG_COMPAT_32BIT_TIME)
switch (cmd) {
@@ -3266,6 +3266,7 @@ static unsigned int video_translate_cmd(unsigned int cmd)
return cmd;
}
+EXPORT_SYMBOL(video_translate_cmd);
static int video_get_user(void __user *arg, void *parg,
unsigned int real_cmd, unsigned int cmd,
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
index c6ec87e88dfef9e6cfe1d1fb587c1600882fb14d..437b9f90714c62e0ba434ce47391ef64d88110aa 100644
--- a/include/media/v4l2-ioctl.h
+++ b/include/media/v4l2-ioctl.h
@@ -687,6 +687,7 @@ int v4l2_compat_get_array_args(struct file *file, void *mbuf,
int v4l2_compat_put_array_args(struct file *file, void __user *user_ptr,
void *mbuf, size_t array_size,
unsigned int cmd, void *arg);
+unsigned int video_translate_cmd(unsigned int cmd);
/**
* typedef v4l2_kioctl - Typedef used to pass an ioctl handler.
--
2.49.0.1266.g31b7d2e469-goog
Return-Path: <linux-kernel+bounces-665932-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 6CDB641E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:00:58 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by ny.mirrors.kernel.org (Postfix) with ESMTPS id A39A04E4C29
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:00:49 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id F2930280CD6;
Wed, 28 May 2025 17:59:01 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ge5Nqd/f"
Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18])
(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 4A8391B87C0;
Wed, 28 May 2025 17:58:58 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.18
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748455141; cv=none; b=fWETkTAGiEMQigmVKG1nUb0eIre9U0ljtF5EyrsLCBsZRxv/hb+0a9AapyyITT7MAv1+jbzTBglOV4FDLQX4U0n0pC8JWXlqMVDuo/G3OXdyRu6BzlLMWH+HBT5uX3Ufqz5xubZ2H+VaCIS3FZQn3AENc2gqmwDbBkTuCUi50W8=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748455141; c=relaxed/simple;
bh=dWdT/BynBBuDSCyma1X+cQB7xQLt4r1AGcNl9ltXRbQ=;
h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=E+mdwKqAXmIF8AHvff1n5fhoEkN0rOV63z4LcqZJ+FWzIYn32EDcf5WihvToZBzFd6bPSHL8ADM4nV6uxlpC+jdYdo8Zb3RgzJXjqd1hWSHAUJUxGZWxHq6e52p7D3SNOraZ7T2cDqn1Wy6HAS8lZwLwLyj9z5aAGckQTJslYkg=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ge5Nqd/f; arc=none smtp.client-ip=198.175.65.18
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com
Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
t=1748455139; x=1779991139;
h=from:to:cc:subject:date:message-id:mime-version:
content-transfer-encoding;
bh=dWdT/BynBBuDSCyma1X+cQB7xQLt4r1AGcNl9ltXRbQ=;
b=ge5Nqd/fbZj2s6JHiBG448/m4yMMJRHODKngqxJCKWtseWVm17ldlJVE
PcEls/ewhNMqTbdbcQw9jJpzI/CyL6EXYG3zIfqmUby34HVZOKLg5OXSc
c5nRTNOTqd6Qfh8aIyD7ya/PSUmD/Q51SBzXizAiKu8/KUq7ZA55j1Ijc
LRpcTQOcS1mTXUv5Fb6ZhOogKqNmseEwVEjSXBj1uDHeA/bi48t961vx/
iLDdWDrZBZW4lmVo2happI7KBdgW/P7nQcSE+mBaTA2nuCMZ58iibebo2
eyVu3GkXHxPac3nBVad0nJyTbnlCN9KzFYF5go4GtxtMrJbDeOiIw2VRn
Q==;
X-CSE-ConnectionGUID: BfMO+r4URxe9XcMmBXSYfA==
X-CSE-MsgGUID: d3mFRUadSrebLDgEqzsqtg==
X-IronPort-AV: E=McAfee;i="6700,10204,11447"; a="50648745"
X-IronPort-AV: E=Sophos;i="6.15,321,1739865600";
d="scan'208";a="50648745"
Received: from fmviesa003.fm.intel.com ([10.60.135.143])
by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2025 10:58:58 -0700
X-CSE-ConnectionGUID: Zy20/L1sTQyvQQjMFfqx/Q==
X-CSE-MsgGUID: ikwD+7d6Tsi3LwndxkjWXQ==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.15,321,1739865600";
d="scan'208";a="147193272"
Received: from kanliang-dev.jf.intel.com ([10.165.154.102])
by fmviesa003.fm.intel.com with ESMTP; 28 May 2025 10:58:58 -0700
From: kan.liang@xxxxxxxxxxxxxxx
To: peterz@xxxxxxxxxxxxx,
mingo@xxxxxxxxxx,
namhyung@xxxxxxxxxx,
irogers@xxxxxxxxxx,
mark.rutland@xxxxxxx,
linux-kernel@xxxxxxxxxxxxxxx,
linux-perf-users@xxxxxxxxxxxxxxx
Cc: eranian@xxxxxxxxxx,
ctshao@xxxxxxxxxx,
tmricht@xxxxxxxxxxxxx,
leo.yan@xxxxxxx,
Kan Liang <kan.liang@xxxxxxxxxxxxxxx>,
Aishwarya TCV <aishwarya.tcv@xxxxxxx>
Subject: [PATCH V2] perf: Fix the throttle error of some clock events
Date: Wed, 28 May 2025 10:58:32 -0700
Message-Id: <20250528175832.2999139-1-kan.liang@xxxxxxxxxxxxxxx>
X-Mailer: git-send-email 2.38.1
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Status: No, score=-6.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,
RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,
RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
From: Kan Liang <kan.liang@xxxxxxxxxxxxxxx>
The Arm CI reports RCU stall, which can be reproduced by the below perf
command.
perf record -a -e cpu-clock -- sleep 2
The cpu-clock and task_clock are two special SW events, which rely on
the hrtimer. Instead of invoking the stop(), the HRTIMER_NORESTART is
returned to stop the timer. Because the hrtimer interrupt handler cannot
cancel itself, which causes infinite loop.
There may be two ways to fix it.
- Add a check of MAX_INTERRUPTS in the event_stop. Return immediately if
the stop is invoked by the throttle.
- Introduce a PMU flag to track the case. Avoid the event_stop in
perf_event_throttle() if the flag is detected.
The latter looks more generic. It may be used if there are more other
cases that want to avoid the stop later. The latter is implemented.
Reported-by: Leo Yan <leo.yan@xxxxxxx>
Reported-by: Aishwarya TCV <aishwarya.tcv@xxxxxxx>
Closes: https://lore.kernel.org/lkml/20250527161656.GJ2566836@xxxxxxxxxxxxxxx/
Tested-by: Leo Yan <leo.yan@xxxxxxx>
Signed-off-by: Kan Liang <kan.liang@xxxxxxxxxxxxxxx>
---
Changes since V1:
- Rebase on top of the latest tip.git
- Add Tested-by from Leo
include/linux/perf_event.h | 1 +
kernel/events/core.c | 23 ++++++++++++++++++++---
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 52dc7cfab0e0..97a747a97a50 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -305,6 +305,7 @@ struct perf_event_pmu_context;
#define PERF_PMU_CAP_EXTENDED_HW_TYPE 0x0100
#define PERF_PMU_CAP_AUX_PAUSE 0x0200
#define PERF_PMU_CAP_AUX_PREFER_LARGE 0x0400
+#define PERF_PMU_CAP_NO_THROTTLE_STOP 0x0800
/**
* pmu::scope
diff --git a/kernel/events/core.c b/kernel/events/core.c
index f34c99f8ce8f..abd19bb571e3 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -2656,7 +2656,22 @@ static void perf_event_unthrottle(struct perf_event *event, bool start)
static void perf_event_throttle(struct perf_event *event)
{
- event->pmu->stop(event, 0);
+ /*
+ * Some PMUs, e.g., cpu-clock and task_clock, may rely on
+ * a special mechanism (hrtimer) to manipulate counters.
+ * The regular stop doesn't work, since the hrtimer interrupt
+ * handler cannot cancel itself.
+ *
+ * The stop should be avoided for such cases. Let the
+ * driver-specific code handle it.
+ *
+ * The counters will eventually be disabled in the driver-specific
+ * code. In unthrottle, they still need to be re-enabled.
+ * There is no handling for PERF_PMU_CAP_NO_THROTTLE_STOP in
+ * the perf_event_unthrottle().
+ */
+ if (!(event->pmu->capabilities & PERF_PMU_CAP_NO_THROTTLE_STOP))
+ event->pmu->stop(event, 0);
event->hw.interrupts = MAX_INTERRUPTS;
if (event == event->group_leader)
perf_log_throttle(event, 0);
@@ -11848,7 +11863,8 @@ static int cpu_clock_event_init(struct perf_event *event)
static struct pmu perf_cpu_clock = {
.task_ctx_nr = perf_sw_context,
- .capabilities = PERF_PMU_CAP_NO_NMI,
+ .capabilities = PERF_PMU_CAP_NO_NMI |
+ PERF_PMU_CAP_NO_THROTTLE_STOP,
.dev = PMU_NULL_DEV,
.event_init = cpu_clock_event_init,
@@ -11930,7 +11946,8 @@ static int task_clock_event_init(struct perf_event *event)
static struct pmu perf_task_clock = {
.task_ctx_nr = perf_sw_context,
- .capabilities = PERF_PMU_CAP_NO_NMI,
+ .capabilities = PERF_PMU_CAP_NO_NMI |
+ PERF_PMU_CAP_NO_THROTTLE_STOP,
.dev = PMU_NULL_DEV,
.event_init = task_clock_event_init,
--
2.38.1
Return-Path: <linux-kernel+bounces-665933-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 48B6541E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:01:14 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by ny.mirrors.kernel.org (Postfix) with ESMTPS id 3CB774E64DC
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:01:01 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 482A328E605;
Wed, 28 May 2025 17:59:59 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=semtech.com header.i=@semtech.com header.b="OQuijwmK";
dkim=fail reason="signature verification failed" (1024-bit key) header.d=SemtechCorp.onmicrosoft.com header.i=@SemtechCorp.onmicrosoft.com header.b="BdopeI+h"
Received: from mail1.bemta44.messagelabs.com (mail1.bemta44.messagelabs.com [67.219.246.114])
(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 2F023284B37;
Wed, 28 May 2025 17:59:55 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=67.219.246.114
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748455198; cv=fail; b=lUIaarXsJz1W09jWFfKbqjwe0on2ty4ARdH5q3lT97jWZG5nDKv8iHTkyL4WUEorJ/G8qmBF7t/nz3lNYTtTg+aDYLvPLG4O6pc1UplLCfuVJEQvaR6wFffx4IQi1pQSYyTJo01ANxYkWxNUCTdrqxKiSWC0WKnNvptoG6papmQ=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748455198; c=relaxed/simple;
bh=cdfwOby0l3/9746vq3GHpu0O+eJeMlwBMYIPSd5sspw=;
h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=TRaZ8PX+D1p4ivLW4ffxugvoE1tFlEVJBsXD06hTAozgTL8BPRelqN4P55sA6LzGAlkfXaGyk2ShFN+//MRjxZ9Lssq2PXYo9HC/L63YamcTA8k1ujisGtCGmk2DuZrMQzCScK7SZVv52ZLERnudHU+YHeG16VlGwWrwZuS42cQ=
ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=semtech.com; spf=pass smtp.mailfrom=semtech.com; dkim=pass (2048-bit key) header.d=semtech.com header.i=@semtech.com header.b=OQuijwmK; dkim=fail (1024-bit key) header.d=SemtechCorp.onmicrosoft.com header.i=@SemtechCorp.onmicrosoft.com header.b=BdopeI+h reason="signature verification failed"; arc=fail smtp.client-ip=67.219.246.114
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=semtech.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=semtech.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semtech.com; s=k1;
t=1748455195; i=@semtech.com;
bh=NiWm2qQOyJMNR7Xp+qeVrOO8SyuhU/0vuFW4UpU6r2Q=;
h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:
Content-Transfer-Encoding:Content-Type;
b=OQuijwmKsPfn/xDu6HBx4H1tuSzTv0dpKFHzBqoUDmNKm1it2Zkza495rrGbnOTwt
khmWrulT2EzeIDmSnXN8QsjqHpb6BssjZGefmkJ4dhTfOzw8xxdvGTNbYdydJwGt98
fXC9UTBeA4kfv9AYHkiFmbyriutQMHegZ7WZlby1w2TYhYFUieH5G+YcSgWyTEka2u
BIsUrJKfYfRSrF+9AsjKP4+rCzHfF+Oi4ZcfrXKCmqRBLBtsAo8UpqITdvc47R9bmM
F05HGkCMieJ008sV+WXy4aXsjoTYl/+Tbms6eU/sA3wa3In0e9YVSToteRVcLKUzUJ
+7pD+JmHD+wOg==
X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprHJsWRWlGSWpSXmKPExsWikX0/XVfK3zz
D4FWnicXE/WfZLS7vmsPmwOTxeZNcAGMUa2ZeUn5FAmvGiwOTWQpWcVec+rOcpYHxOWcXIxcH
o8AyZonuNcvZIJzFrBKfF39hgnCmMUk8bjoL5rAIbGeWmN59gx3EERJYxiRx4OlhZghnDZNE2
8ofYAMkBI4ySlz6PJEFInOWUeJW83+ontuMEi+/TwWaxgnkTGaUOHq4EsRmE1CUaP1yGmyLiE
A/k0TnxKmMIAlmAS2Jn49vgtnCAiUSW3fvBrNZBFQlHnUfAJrKwcErYCpxaJUTSFhCQF5i8Y7
lzCA2r4CgxMmZT1ggxshLNG+dzQyxV1ZixYReNoj6YIk5p39A2ZIS125eYIewZSWOnp3DAjJe
QsBZ4vauQIgxEhIHX7xghgj7Six9GQRRLSdxqvccE8wFOzfeZoGwoyV6+34yQQKlU0Di7MJGq
MQ7Romt0zIhbBmJ9ssLWCcwasxCcvUsJFfPQrJ6ASPzKkaL4tSistQiXWMTvaSizPSMktzEzB
y9xCrdRL3SYt3k1LySosQcQ7305AK91OJiveLK3OScFL281JJNjMCkwvWhYsIOxlNTmvUPMUp
yMCmJ8rL+NcsQ4kvKT6nMSCzOiC8qzUktPsQow8GhJMFb62OeISRYlJqeWpGWmQNMcDBpCQ4e
JRFeHSGgNG9xQWJucWY6ROoUoy7H94Mn9zILseTl56VKifOe9QUqEgApyijNgxsBS7aXGGWlh
HkZGRgYhHgKUotyM0tQ5V8xinMwKgnzavgBTeHJzCuB2/QK6AgmoCPEI0xBjihJREhJNTD5BU
Y2SW0X+X19aZB4oPuq1vB/Zxnt7V+brZNUT5x1ak214cXYuSKMwf2BTtMV5skFvtZx0ebg/em
aqV2y1juiRtVcUkz4sdZhM8tbJcU+8+571vut6w6eVveFiXXWhL4pUi4Bf7SYpW2Mmrj3P5EJ
2PnzQqXaxqVPrrBfuN7SqiW8/IL964wPE73WMbS0rLAOvFQdeVg0ZJpy6qL/0Uwy1TvsU8IyP
L7uaTK5p3cuYULkTId5gSxeB9NdpWdfsLomm3tI6a79sQO29xa1nMs577Gz9a+xzvMHEnf29+
xIf7lx/etpr20fnirTuy7x6MvPfObpu68mvXjad7alQtHkE/s2OWuHbwGHVtx68VuJpTgj0VC
Luag4EQATnTdUMQQAAA==
X-Env-Sender: zxue@xxxxxxxxxxx
X-Msg-Ref: server-12.tower-904.messagelabs.com!1748455194!181576!1
X-SYMC-ESS-Client-Auth: mailfrom-relay-check=pass
X-StarScan-Received:
X-StarScan-Version: 9.117.2; banners=semtech.com,-,-
X-VirusChecked: Checked
Received: (qmail 3107 invoked from network); 28 May 2025 17:59:54 -0000
Received: from mail-dm6nam11on2103.outbound.protection.outlook.com (HELO NAM11-DM6-obe.outbound.protection.outlook.com) (40.107.223.103)
by server-12.tower-904.messagelabs.com with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 28 May 2025 17:59:54 -0000
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
b=q3AbiVnBxhfgWeye7sKTxPEKm2W38n0hhkSvOoCfSZctAAaPbfGF3kVySySr+8fH+vyivHSHeX6Q1aDgqJkjlsjLjZAD+0zzFOlSx78jY/X3g2Pq53hXAAd8IzQGulNRGUFmyVjxTeyWUfsAvRMQDLD0WATs/QzzhdzeMfQEwWp0IO3PkcIaLuDVOQTzhxFs/M9gkvooOMXBNQYYtqnaeWk/I893wz/8VD8pi+TGdEpCEVMJpDSDOIKRe0A/6XJTA6AVCClslVMbIsDdzWke9uePBMnzs+lTlbIAw3fwzPNziXlWaBwkzYaTkGluViE3HP9wvtenGFg+eKhnX46k/A==
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=tgfXmplSujZqKAN+4qyFq4IDDhrFttOHqvoQ4is65oI=;
b=OXYStTveWMMFLlE7QmrklzEW4lHUJS0LgiRU3zC0JmAHCM1aoV4LfvmJn0aPBXTaUyG9kUG1QaRXBdDQN8citOsLwcT9/iPs/TLWGskF55es5BM3zmpf5yupCE9F9fp/xS+RM+AM9qqRRQmeIYYvuN7r6NZeQ9Uc4DzTYcTKSteuePhTZBRjk9+qsxrkRb115eZt/gdoB9HTs7sCy20Up+Oe+UEXqU0SmI9VJ7qBpmKFullrATIdU3YRNMMSf1ctBICZluZIL2Nr+ADczlfU6qJbatDqEw5VxS/8W6EsZxnrd9jvGEeuUL8urOLhp+737Q2a/tVcUwl96/OCdKaXrg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
38.104.251.66) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=semtech.com;
dmarc=pass (p=quarantine sp=none pct=100) action=none
header.from=semtech.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=SemtechCorp.onmicrosoft.com; s=selector1-SemtechCorp-onmicrosoft-com;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=tgfXmplSujZqKAN+4qyFq4IDDhrFttOHqvoQ4is65oI=;
b=BdopeI+h6XH858UP4vaSGwPEPvElxif8BOpDM1IcczVFYMCGYK6djTzRsfKRnjvolNbFFP/7g8o8KzGXiwsX36p+TfMFaIGlNPH+5sI9nNyjIa7R0r7GbR7VAaWynOXdhWkZdBipP3wLu+/Jdw83SBhJ7NSV/d8H/RpWntyeEtw=
Received: from SN4PR0501CA0125.namprd05.prod.outlook.com
(2603:10b6:803:42::42) by SJ5PPF4CF2DDE10.namprd20.prod.outlook.com
(2603:10b6:a0f:fc02::a91) with Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8746.38; Wed, 28 May
2025 17:59:52 +0000
Received: from SA2PEPF0000150B.namprd04.prod.outlook.com
(2603:10b6:803:42:cafe::2d) by SN4PR0501CA0125.outlook.office365.com
(2603:10b6:803:42::42) with Microsoft SMTP Server (version=TLS1_3,
cipher=TLS_AES_256_GCM_SHA384) id 15.20.8769.16 via Frontend Transport; Wed,
28 May 2025 17:59:52 +0000
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 38.104.251.66)
smtp.mailfrom=semtech.com; dkim=none (message not signed)
header.d=none;dmarc=pass action=none header.from=semtech.com;
Received-SPF: Pass (protection.outlook.com: domain of semtech.com designates
38.104.251.66 as permitted sender) receiver=protection.outlook.com;
client-ip=38.104.251.66; helo=CA07RELAY1.semtech.com; pr=C
Received: from CA07RELAY1.semtech.com (38.104.251.66) by
SA2PEPF0000150B.mail.protection.outlook.com (10.167.242.43) with Microsoft
SMTP Server id 15.20.8769.18 via Frontend Transport; Wed, 28 May 2025
17:59:50 +0000
Received: from ca08gitmail.local ([10.23.50.249]) by CA07RELAY1.semtech.com with Microsoft SMTPSVC(10.0.20348.1);
Wed, 28 May 2025 13:59:50 -0400
From: Adam Xue <zxue@xxxxxxxxxxx>
To: manivannan.sadhasivam@xxxxxxxxxx,
slark_xiao@xxxxxxx,
johan+linaro@xxxxxxxxxx,
quic_vpernami@xxxxxxxxxxx,
tglx@xxxxxxxxxxxxx,
fabio.porcedda@xxxxxxxxx,
quic_msarkar@xxxxxxxxxxx,
mhi@xxxxxxxxxxxxxxx,
linux-arm-msm@xxxxxxxxxxxxxxx,
linux-kernel@xxxxxxxxxxxxxxx
Cc: zxue@xxxxxxxxxxx,
imocanu@xxxxxxxxxxx
Subject: [PATCH v1] bus: mhi: host: pci_generic: Add support for EM929x and set MRU to 32768 for better performance.
Date: Wed, 28 May 2025 10:59:43 -0700
Message-ID: <20250528175943.12739-1-zxue@xxxxxxxxxxx>
X-Mailer: git-send-email 2.43.0
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-OriginalArrivalTime: 28 May 2025 17:59:50.0142 (UTC) FILETIME=[4E6299E0:01DBCFFA]
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SA2PEPF0000150B:EE_|SJ5PPF4CF2DDE10:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: b992184c-ff87-4533-96d8-08dd9e117139
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
BCL:0;ARA:13230040|36860700013|82310400026|1800799024|376014|921020;
X-Microsoft-Antispam-Message-Info:
=?us-ascii?Q?dWVnRe7dF7DHPDQetDtp0UX0JHNpiB6ui2Tchx5JT2yPIkuQOSUMjxiXzwIs?=
=?us-ascii?Q?7NYBGUgpoveGI6McfMHmtDM+wPiMy4yl18t6fIc8tbXUj8LBELmYBOxD80UQ?=
=?us-ascii?Q?ePtFsbjq6RSg6KuAwPb4vZbqzNF6a8JE2wVJXEXKZWdA0i0toGWTc7pMBlkW?=
=?us-ascii?Q?OUwl5D0NeIWjgz95K0s1Vq3uDnQ6DMeetHVHaIHPrzNPDmtSyqwxk6DC+vgL?=
=?us-ascii?Q?ovoNkSSV9fvon5VUANAC+u5k10PfB9wwHWdD6bLLsplMrOyv3s8CAc1D6H1i?=
=?us-ascii?Q?47jfEtQhk87QDZ+y1GAxmaWqftgaSIxbARx3JiRSTAAwXwTiM7e/KzBiN05e?=
=?us-ascii?Q?ZSdD6gmREIcRReEqZh3YX/3wlJV8FpK2PfAJ0IDR1TCZTQ23PbKZc/MLFBOy?=
=?us-ascii?Q?SQETIcobXQcHCiIrMHltD89SgLzpNsoRq5FZmZb8aLZiRGFRNIKxeIK6lMfv?=
=?us-ascii?Q?XuSLhrXA6acaYFEQ0hQ+LGSiECR+cbBRD4VtdEbxzgUvhwH15p/oAj+QDgdv?=
=?us-ascii?Q?t2zRZ6quHiL1Uqw9EOXuD/1yhHTz3VX4gcjd06C4mftj6C/Jjg1qFTJVMDqn?=
=?us-ascii?Q?exuza3tlSZaW/jLDLGG5GPTdLziJzBme0RuIneB7/AjzXH67jYiTUxwpOcrY?=
=?us-ascii?Q?duArmp5avWzpABpK8a4YBYRLpCZymjt0cU+aB5N3R5EGGj+jvExBRTyM/sL1?=
=?us-ascii?Q?QQx1ID1tnp8zcJUTzMZx17D2wqosgAyNTwaDA7EpNgTaGqdJPRL2YQwfUVr9?=
=?us-ascii?Q?M8q+e8FQRYNMSBkTpM93prRo6rYdke+r7j9/9U6vAMPTfBwVqMgOFvckNwDM?=
=?us-ascii?Q?9EYgmEO82WV+XYEvACgUZ/XznECAPlsBVHKMYmSQL9x46En5T3snQ9tCtn65?=
=?us-ascii?Q?gxNHvx2KyTUGkas5BT/9OyNby2jxfOjfwqhnvw65tiuAFjisWGdxttQ7Ynmf?=
=?us-ascii?Q?THnY8mZaqQV6gU2C90QyvEXab+ya9yOHJF87jRRR/rwZwLUEnscf5VBjky0/?=
=?us-ascii?Q?FeZ9zc54C3Pygdv5EbTkNM4esYpPVsLrKKp/nE5D9hsLwYEbErba5DRAoswC?=
=?us-ascii?Q?7C21/DW8Z5PnGQMWUsir8ERdS/XDRhvDMOhNiQ5QFykur8wmNo8BdwKXbTXl?=
=?us-ascii?Q?/0VYNN1Tw5tOIoVct8HlBWVsQXOtBPuZXvpeM0Lljk9l2o3Lc1UrxFwG8+4q?=
=?us-ascii?Q?YpZZkbOmC0V3JxYtHECA5HoMY9MqMT5A4feBtVpbatSY2JvVUocr50S4R7ZE?=
=?us-ascii?Q?kNyq7xQLRK0yeSiovw+uOLoU21Tcm7PbqUNW96l0W2xT60CTOm7Iif/WrwJl?=
=?us-ascii?Q?5TgMQVQGT91eJ519ErhXFYUiLyvPSQ7z157AAfGkykDYecC2IwjEfhA2t5pq?=
=?us-ascii?Q?h65iq4wARwWhxIcNvGQRPNXGkY/r7hZ2DNPXsj65Q9y9G0ZHdh35ySG3VQTA?=
=?us-ascii?Q?IWvwsX8o0i4pvvVJeED6e9g7M6iW3c9Z8IF3JlmTBM0z3xr/v6t1eathInhH?=
=?us-ascii?Q?6sUxix0lNqH7Zbgb6bCyOV0QC2iAc45cHCHi7PTx79NAXGqddsu/RwAqAQ?=
=?us-ascii?Q?=3D=3D?=
X-Forefront-Antispam-Report:
CIP:38.104.251.66;CTRY:CA;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CA07RELAY1.semtech.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(1800799024)(376014)(921020);DIR:OUT;SFP:1102;
X-OriginatorOrg: semtech.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2025 17:59:50.5711
(UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: b992184c-ff87-4533-96d8-08dd9e117139
X-MS-Exchange-CrossTenant-Id: b105310d-dc1a-4d6e-bf0d-b11c10c47b0f
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=b105310d-dc1a-4d6e-bf0d-b11c10c47b0f;Ip=[38.104.251.66];Helo=[CA07RELAY1.semtech.com]
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: TreatMessagesAsInternal-SA2PEPF0000150B.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ5PPF4CF2DDE10
X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,
RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,
RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
Add MHI controller config for EM929x. It uses the same configuration
as EM919x. Also set the MRU to 32768 to improve downlink throughput.
02:00.0 Unassigned class [ff00]: Qualcomm Technologies, Inc Device 0308
Subsystem: Device 18d7:0301
Signed-off-by: Adam Xue <zxue@xxxxxxxxxxx>
---
drivers/bus/mhi/host/pci_generic.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c
index 03aa88795209..9bf8e7991745 100644
--- a/drivers/bus/mhi/host/pci_generic.c
+++ b/drivers/bus/mhi/host/pci_generic.c
@@ -695,6 +695,7 @@ static const struct mhi_pci_dev_info mhi_sierra_em919x_info = {
.config = &modem_sierra_em919x_config,
.bar_num = MHI_PCI_DEFAULT_BAR_NUM,
.dma_data_width = 32,
+ .mru_default = 32768,
.sideband_wake = false,
};
@@ -813,6 +814,9 @@ static const struct pci_device_id mhi_pci_id_table[] = {
/* EM919x (sdx55), use the same vid:pid as qcom-sdx55m */
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0306, 0x18d7, 0x0200),
.driver_data = (kernel_ulong_t) &mhi_sierra_em919x_info },
+ /* EM929x (sdx65), use the same configuration as EM919x */
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0308, 0x18d7, 0x0301),
+ .driver_data = (kernel_ulong_t) &mhi_sierra_em919x_info },
/* Telit FN980 hardware revision v1 */
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0306, 0x1C5D, 0x2000),
.driver_data = (kernel_ulong_t) &mhi_telit_fn980_hw_v1_info },
--
2.45.2
To view our privacy policy, including the types of personal information we collect, process and share, and the rights and options you have in this respect, see www.semtech.com/legal.
Return-Path: <linux-kernel+bounces-665934-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [139.178.88.99])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 40AAD41E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:02:04 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9FE2E3A710C
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:01:39 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id EE8351F3FDC;
Wed, 28 May 2025 18:01:54 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="SBImEGzM"
Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2055.outbound.protection.outlook.com [40.107.94.55])
(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 539C4207DE2;
Wed, 28 May 2025 18:01:51 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.55
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748455313; cv=fail; b=pRoDMGa2H+ox3Gz0lOmHxS7ycJD/H8oRry4b5/8iOw+aFaaVrAVYbaeZ4q8a42Pu4C//0lMN2kSyqW0hewa2hbw+IIJHLNkNje0A8c4TMMqQycI4z5xaW7WJnrMt0ZDrpna6awOpkAwGe7v7QFvZnqFuapPia4fr7Sb39cV2MEU=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748455313; c=relaxed/simple;
bh=PK5rl/1dte9AJyspm42aurn7n9Gi0dznZQenQKMQCeY=;
h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version:
Content-Type:Content-Disposition:In-Reply-To; b=P/N4rKPnuOJqtCTGWVV4QHNh0aWVP7TjlCJlilYWRdyzV9O7M8fTosDkSWHHhFyX3aPPnRYbXylohrYx+RoEMwVHs0cB75laGLjFAm4OgVLeo5H3gKQ2ej0fsCt6FJrrB6rjBA3MNwW7cQjRdTsS0utqnN0mNZ+1/xVTQo5ua0s=
ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=SBImEGzM; arc=fail smtp.client-ip=40.107.94.55
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com
Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
b=PcUyTZ/tSP9FvYk/OwUff9znqc+kfwvKz/cyswszWN6lvNVcFDe3Xq2r8HCtfHGTl4DTT70sVMUEFXE3zmbsyN/U1xfIUauKhtdNogWkzgTMC/nBRnLz+40G6vSqJdPj4+JKiJ1Y+qrDc0bdFJhnV53dTkM6W/Ae8mqLXOHPihIu2+tFysYpvFJhgzMMapiS6kzKtpIrZ4mG14ZFfuaeDRIVEAI4gSNPY2VpWWnJeChCTlzYlnYX1r+7pRlYd3OGFXwQyhS1j7MXDZ+NPuchYXIgXBqopPmlqti8sGVbMeYyf18h2iTwG9NiEMqExsOzxwRtgWnW08ShQdyjo0dbGQ==
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=pxShEtpkvRDBUpu0orOGm4w9j8Q+swviZOJ0wA3ng1M=;
b=AqBNhBLIIrssEh1ejnx/uN0pJWTahmfge+FlH0DyDZMX4geMSP0TYnizyNPTBklCOg3bIH2zkm91djS2MiaFVlJX4GFHBGaa/SnWAdoPcVWgi4hEc+nKeThOeYmK+IIrOeF9ktQs7/3ypnNSZJfX1c8LjeH1BgV9oPOBadUecCXBLi419RLf2l2rpowK8MkP2Khk6fvvHR2NCXtNtbSm1AuuxVkWJlEye9OoiOVabYswHqwb8YZNks8ywB4v1YI9VInlT9b9KsSxK2QLTbJAxsg47GqiggEitG0gUrppktj86nFanbJs5qQa09C6QRE5c5Z0/6c/e/BJTKx1n/9xHg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
216.228.117.161) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com;
dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com;
dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;
s=selector2;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=pxShEtpkvRDBUpu0orOGm4w9j8Q+swviZOJ0wA3ng1M=;
b=SBImEGzMVCVBBS7U+JDAlzkUWpGMadVoytiwxRDxSePOc6P8wHOwaak1Q3qpGYTUx+v7E1KaQ2QPlNOL9USrVI5V8zwHq/xRQ1TTIIY6DhLXIR/5tIW/Jwz+ms1KPz/A6LvB/6vdGjyoudsrj2wSJthq91EMGgmRuzaxkJD4hfxI2zpqG7c2ZyDvYv8o6ugnAWkONb0Ch6K9wk/fRVgygjXOFNp1/pHVzXgLEMuuVy0WDHbBrRhp/BODRvfneJuTiYN9iTirCDDWjro3KXRKx1A0nSZsT/tpv4WwDlvg0sXurqzTxlKYP2SlnqOUMBS8HjFT4FFcnbhqdF9ybB1LGQ==
Received: from BY3PR05CA0021.namprd05.prod.outlook.com (2603:10b6:a03:254::26)
by PH7PR12MB9223.namprd12.prod.outlook.com (2603:10b6:510:2f2::18) with
Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8769.27; Wed, 28 May
2025 18:01:49 +0000
Received: from CO1PEPF000044F5.namprd05.prod.outlook.com
(2603:10b6:a03:254:cafe::49) by BY3PR05CA0021.outlook.office365.com
(2603:10b6:a03:254::26) with Microsoft SMTP Server (version=TLS1_3,
cipher=TLS_AES_256_GCM_SHA384) id 15.20.8792.19 via Frontend Transport; Wed,
28 May 2025 18:01:49 +0000
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161)
smtp.mailfrom=nvidia.com; dkim=none (message not signed)
header.d=none;dmarc=pass action=none header.from=nvidia.com;
Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates
216.228.117.161 as permitted sender) receiver=protection.outlook.com;
client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C
Received: from mail.nvidia.com (216.228.117.161) by
CO1PEPF000044F5.mail.protection.outlook.com (10.167.241.75) with Microsoft
SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
15.20.8769.18 via Frontend Transport; Wed, 28 May 2025 18:01:49 +0000
Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com
(10.129.200.67) with Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 28 May
2025 11:01:25 -0700
Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail205.nvidia.com
(10.129.68.10) with Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Wed, 28 May
2025 11:01:25 -0700
Received: from Asurada-Nvidia (10.127.8.11) by mail.nvidia.com (10.129.68.8)
with Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14 via Frontend
Transport; Wed, 28 May 2025 11:01:23 -0700
Date: Wed, 28 May 2025 11:01:22 -0700
From: Nicolin Chen <nicolinc@xxxxxxxxxx>
To: "Tian, Kevin" <kevin.tian@xxxxxxxxx>
CC: "jgg@xxxxxxxxxx" <jgg@xxxxxxxxxx>, "corbet@xxxxxxx" <corbet@xxxxxxx>,
"will@xxxxxxxxxx" <will@xxxxxxxxxx>, "bagasdotme@xxxxxxxxx"
<bagasdotme@xxxxxxxxx>, "robin.murphy@xxxxxxx" <robin.murphy@xxxxxxx>,
"joro@xxxxxxxxxx" <joro@xxxxxxxxxx>, "thierry.reding@xxxxxxxxx"
<thierry.reding@xxxxxxxxx>, "vdumpa@xxxxxxxxxx" <vdumpa@xxxxxxxxxx>,
"jonathanh@xxxxxxxxxx" <jonathanh@xxxxxxxxxx>, "shuah@xxxxxxxxxx"
<shuah@xxxxxxxxxx>, "jsnitsel@xxxxxxxxxx" <jsnitsel@xxxxxxxxxx>,
"nathan@xxxxxxxxxx" <nathan@xxxxxxxxxx>, "peterz@xxxxxxxxxxxxx"
<peterz@xxxxxxxxxxxxx>, "Liu, Yi L" <yi.l.liu@xxxxxxxxx>,
"mshavit@xxxxxxxxxx" <mshavit@xxxxxxxxxx>, "praan@xxxxxxxxxx"
<praan@xxxxxxxxxx>, "zhangzekun11@xxxxxxxxxx" <zhangzekun11@xxxxxxxxxx>,
"iommu@xxxxxxxxxxxxxxx" <iommu@xxxxxxxxxxxxxxx>, "linux-doc@xxxxxxxxxxxxxxx"
<linux-doc@xxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx"
<linux-kernel@xxxxxxxxxxxxxxx>, "linux-arm-kernel@xxxxxxxxxxxxxxxxxxx"
<linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, "linux-tegra@xxxxxxxxxxxxxxx"
<linux-tegra@xxxxxxxxxxxxxxx>, "linux-kselftest@xxxxxxxxxxxxxxx"
<linux-kselftest@xxxxxxxxxxxxxxx>, "patches@xxxxxxxxxxxxxxx"
<patches@xxxxxxxxxxxxxxx>, "mochs@xxxxxxxxxx" <mochs@xxxxxxxxxx>,
"alok.a.tiwari@xxxxxxxxxx" <alok.a.tiwari@xxxxxxxxxx>, "vasant.hegde@xxxxxxx"
<vasant.hegde@xxxxxxx>, "dwmw2@xxxxxxxxxxxxx" <dwmw2@xxxxxxxxxxxxx>,
"baolu.lu@xxxxxxxxxxxxxxx" <baolu.lu@xxxxxxxxxxxxxxx>
Subject: Re: [PATCH v5 13/29] iommufd/viommu: Introduce IOMMUFD_OBJ_HW_QUEUE
and its related struct
Message-ID: <aDdPcu50/hfLpRoz@Asurada-Nvidia>
References: <cover.1747537752.git.nicolinc@xxxxxxxxxx>
<580a36f629402506d232052ddd20ef21ec91d5bc.1747537752.git.nicolinc@xxxxxxxxxx>
<BN9PR11MB5276C599F23964E423CCA2738C98A@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
<aDDslV6ZJpxJNuaG@Asurada-Nvidia>
<BN9PR11MB52767BB0CA36643D957BD2CC8C67A@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <BN9PR11MB52767BB0CA36643D957BD2CC8C67A@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
X-NV-OnPremToCloud: AnonymousSubmission
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF000044F5:EE_|PH7PR12MB9223:EE_
X-MS-Office365-Filtering-Correlation-Id: 1255b6ee-4102-4310-b1a3-08dd9e11b7d8
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
BCL:0;ARA:13230040|36860700013|376014|7416014|82310400026|1800799024;
X-Microsoft-Antispam-Message-Info:
=?us-ascii?Q?IpBPmUsFxT0hONmnmAd1KZ31Jru6oUkQrs4+Ta6G9UtEDzy7mmCyO34RjYMI?=
=?us-ascii?Q?wmts5CimQw5B00QecJz97MQ8HLFAECMnRhzMYE9SIL+MFXY3knv1At/FMPts?=
=?us-ascii?Q?Z4qcDUsco7SR6KeMrStGDp81Z9niqNQC/ld3ho6uDV6xcpSiJFa9NH1ihdih?=
=?us-ascii?Q?1OpBwdpP3Pss/43KFFxFeu6dPg7Sv/ZOC11TKrojMe5RVF7RyMxn/owVQkJh?=
=?us-ascii?Q?uzMwXoSRqKLQg3BghnaU7q05af5RqWSbEwma9H082aFRzYiRkLMk6bFAdOn+?=
=?us-ascii?Q?ok4B53WU8UP1MzY646bMPWGSjHeGfcpPxuatKyM2pdfr1k7Y+Fi4KNarNjst?=
=?us-ascii?Q?Y9NQry8FhIy8pYNz5zdpmDaADIeNbBWwPpS4fCI1ioQ5SplWFBnN232Sxb2I?=
=?us-ascii?Q?jyAHDmp7FNLM4H5A86F4GOl55XlKVGUQwI24RcGu6J7u1oitjEap+iDVWW5Q?=
=?us-ascii?Q?9ZRfuCJ50HrR8lRIiKhvHsOsEWG5EcTaLvsXbwlZFVpmpcDFX0xaF7I2cPXC?=
=?us-ascii?Q?76YKbGDJCEWVSFfQk2lbC6fcbuoOnnVHceWOo5xZplGUjhAWt6oPIxQK2eko?=
=?us-ascii?Q?jlUJSl+/o+jnt+tBl7rVclo0m3UdqPPF5m5tdB81HG+tRZm5voe0Wk/vzv2X?=
=?us-ascii?Q?/GjksyfaQTFpJB6P9oYTwW5wba+viBB3lVFjb+ylV7NVQJq277wQyodRhH8L?=
=?us-ascii?Q?3tzMzS3AH7uCt0isZDZ5dYIaaBIUUyhmRBpfbEqXoEwSqCezI7a/U2VsCpDi?=
=?us-ascii?Q?qV1vCK06ShJiSEBMR3ioeSlsRDoGtZMT+6xWIXzW5viZE0aH/VOtFLYObNQJ?=
=?us-ascii?Q?lyl/MVF317QLL0983L1hxukNihWFE5Zca0RX6gJCE/xJsiEuK2K8/BxO/2mI?=
=?us-ascii?Q?3/+erbv2goLtDNFYpkxbJMXXyZvOl04Fgf4Lm052Xc2xXSYpDdjY3szjKBud?=
=?us-ascii?Q?nwwu31GQl9kkENfTLwTM2zoZQdufmFDcHsY7CJk/wUTkxYHwyqKU6e7yu6Kk?=
=?us-ascii?Q?gG9VIdhRBGzMivZYgdDre81bUteDXy5aV2zto3kjGWFQ//cBV0DVy3vyiUaO?=
=?us-ascii?Q?mM2WKRn/ukBss2iee8Gc53qAhGjUUu/ba5EIYWQuvI0iH2K/WzSvF5KH4AMq?=
=?us-ascii?Q?nV/q30S1Ztyqe2qCJf/E9mO7YAlyDnxVRS3ZVPgz/12PxMsfvlxSOOG/peVW?=
=?us-ascii?Q?CM/eh9DcC2AQ6AJ6jPbBQNhbEnoMFw7b0ErK3pyvZQIySQvoCA9s88EkM9od?=
=?us-ascii?Q?jjVhPDtrEdbq31eqd2tyUEmJ0gIHuUM3HvwlFW9JLrnxg4gRi/fqNrHcvJ+t?=
=?us-ascii?Q?xnrvBC89eCu/l8rQ7iiu4aHbaAm2zBcgwuVhnspCyL6s+mmm47sqgQ3Qy3xo?=
=?us-ascii?Q?GPrxsIi7LZ0ECQHA2xg4dLfXzm+sPswiKW825CXRbLOWoD07LnU//4JbTbGF?=
=?us-ascii?Q?0+zVDSYoPgzcFCESVJX3oScmM1rZn0wxLqq5pkB1OSJcuu79OgYMiumvrf8P?=
=?us-ascii?Q?U/8KT9yNKRsi6quO6LDecjq2FNG3/Oe7+bNs?=
X-Forefront-Antispam-Report:
CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(36860700013)(376014)(7416014)(82310400026)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: Nvidia.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2025 18:01:49.1392
(UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 1255b6ee-4102-4310-b1a3-08dd9e11b7d8
X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com]
X-MS-Exchange-CrossTenant-AuthSource:
CO1PEPF000044F5.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB9223
X-Spam-Status: No, score=-6.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,
MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
On Wed, May 28, 2025 at 08:12:41AM +0000, Tian, Kevin wrote:
> From: Nicolin Chen <nicolinc@xxxxxxxxxx>
> Sent: Saturday, May 24, 2025 5:46 AM
>
> On Fri, May 23, 2025 at 07:55:18AM +0000, Tian, Kevin wrote:
> > > From: Nicolin Chen <nicolinc@xxxxxxxxxx>
> > > Sent: Sunday, May 18, 2025 11:22 AM
> > >
> > > +
> > > +enum iommufd_viommu_flags {
> > > + /*
> > > + * The HW does not go through an address translation table but
> > > reads the
> > > + * physical address space directly: iommufd core should pin the
> > > physical
> > > + * pages backing the queue memory that's allocated for the HW
> > > QUEUE, and
> > > + * ensure those physical pages are contiguous in the physical space.
> > > + */
> > > + IOMMUFD_VIOMMU_FLAG_HW_QUEUE_READS_PA = 1 << 0,
> > > +};
> >
> > The queue itself doesn't read an address.
> >
> > What about 'QUEUE_BASE_PA'?
>
> But the HW queue object represents the HW feature, not the guest
> queue memory. So, it is accurate to say that it reads an address?
>
> We have this in doc:
> - IOMMUFD_OBJ_HW_QUEUE, representing a hardware accelerated queue,
> as a subset
> of IOMMU's virtualization features, for the IOMMU HW to directly read or
> write
> the virtual queue memory owned by a guest OS. This HW-acceleration
> feature can
> ...
>
Okay. Then ACCESS_PA means both read/write?
OK. IOMMUFD_VIOMMU_FLAG_HW_QUEUE_ACCESS_PA
Return-Path: <linux-kernel+bounces-665935-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [147.75.80.249])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 91A0F41E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:02:47 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by am.mirrors.kernel.org (Postfix) with ESMTPS id 89F5B18997E4
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:03:00 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id CA60528C862;
Wed, 28 May 2025 18:02:40 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GhqpWeCZ"
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201])
(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 16E30111AD;
Wed, 28 May 2025 18:02:39 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748455360; cv=none; b=jc4bJgIYNA7NXzoqrv+6X7yKgqCrPX09JCNOkxzFj5oahhwcqPFtHgAOTdkQZJrVAsqRchSdrmxjQCEGHSxBqa/EMKdATCQzyhjy5g97Au7XXslq6SVhvohJKQ+y07gicUFFSgk3rbKk8ht/v3qzgphsKp0fxR8119s+62VCQeE=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748455360; c=relaxed/simple;
bh=7/N7kn9RRXKq6KqqskQq3WvBRPAvJG2NaFJSdCXo8LQ=;
h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
Content-Type:Content-Disposition:In-Reply-To; b=kLvAEDfsHp7nD2AU/tVWafGXl6OfJMTMDocYQbUrhw/4WbYEm47odcNjs4yW7TAL1NvAiVWfPskp6RJhHcQbvRIvqYASeLTmxc+pYltUR379BRA1oOvHquzSv8deYnGqcaNv2tgaRTLqaN4LyJsmSBJuG2DikX9tmp2+9u1s5q0=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GhqpWeCZ; arc=none smtp.client-ip=10.30.226.201
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 677B7C4CEE3;
Wed, 28 May 2025 18:02:38 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
s=k20201202; t=1748455359;
bh=7/N7kn9RRXKq6KqqskQq3WvBRPAvJG2NaFJSdCXo8LQ=;
h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
b=GhqpWeCZes79lHl8+Um6pC3HgwPQKhZM2/CZGQxxSuOyck59xHzjdiujxHpUIsl2s
xzh/YWnvj3MB5dslZx/xjzntBYRjah2OufArbZp9hJuVCvHL/H93AmSrRdsW73olYS
0eYyBMVcDxtJSrsZWBtWmu1k6DP+46iS+7uyfWidWGLMNJLt0Ba0wZ46S8J5xY9asi
RPwgGE2qmANUNf3MsMXGoAFjUQ4sgVfCOzUmx+1s6r0FafT0LSNbEcLLqGaZc0/Thm
aJLSoqZR29XsVEmhm3SNbBYIlQ6SozUvTKUE5FotvkUBvFRkWJDLM9cN8gPkadF5nu
oGo0gK4MuHZGQ==
Date: Wed, 28 May 2025 11:02:36 -0700
From: Namhyung Kim <namhyung@xxxxxxxxxx>
To: Ian Rogers <irogers@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>,
Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>,
Mark Rutland <mark.rutland@xxxxxxx>,
Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>,
Jiri Olsa <jolsa@xxxxxxxxxx>,
Adrian Hunter <adrian.hunter@xxxxxxxxx>,
Kan Liang <kan.liang@xxxxxxxxxxxxxxx>,
Miguel Ojeda <ojeda@xxxxxxxxxx>,
Alex Gaynor <alex.gaynor@xxxxxxxxx>,
Boqun Feng <boqun.feng@xxxxxxxxx>, Gary Guo <gary@xxxxxxxxxxx>,
=?utf-8?B?QmrDtnJu?= Roy Baron <bjorn3_gh@xxxxxxxxxxxxxx>,
Benno Lossin <benno.lossin@xxxxxxxxx>,
Andreas Hindborg <a.hindborg@xxxxxxxxxx>,
Alice Ryhl <aliceryhl@xxxxxxxxxx>, Trevor Gross <tmgross@xxxxxxxxx>,
Danilo Krummrich <dakr@xxxxxxxxxx>,
Jiapeng Chong <jiapeng.chong@xxxxxxxxxxxxxxxxx>,
James Clark <james.clark@xxxxxxxxxx>,
Howard Chu <howardchu95@xxxxxxxxx>,
Weilin Wang <weilin.wang@xxxxxxxxx>,
Stephen Brennan <stephen.s.brennan@xxxxxxxxxx>,
Andi Kleen <ak@xxxxxxxxxxxxxxx>, Dmitry Vyukov <dvyukov@xxxxxxxxxx>,
linux-perf-users@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
Subject: Re: [PATCH v2 0/7] Various asan and test fixes
Message-ID: <aDdPvCIYmSPXmBJG@xxxxxxxxxx>
References: <20250528032637.198960-1-irogers@xxxxxxxxxx>
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20250528032637.198960-1-irogers@xxxxxxxxxx>
X-Spam-Status: No, score=-6.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,
RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,
RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
On Tue, May 27, 2025 at 08:26:30PM -0700, Ian Rogers wrote:
When testing removing perf_env with asan I noticed a number of test
failures either because of asan issues or because of building with
NO_LIBELF=1 and NO_LIBBPF=1 to avoid false memory leaks. Address these
issues so that real test failures stand out.
v2: Fix wrong elf size use in filename__read_build_id fix. Add
thread__comm_lock fix.
Ian Rogers (7):
perf symbol: Fix use-after-free in filename__read_build_id
perf test demangle-java: Don't segv if demangling fails
perf symbol: Move demangling code out of symbol-elf.c
perf intel-tpebs: Avoid race when evlist is being deleted
perf test intel-pt: Skip jitdump test if no libelf
perf test trace_summary: Skip --bpf-summary tests if no libbpf
perf thread: Avoid recursively taking thread__comm_lock
Acked-by: Namhyung Kim <namhyung@xxxxxxxxxx>
Thanks,
Namhyung
tools/perf/tests/demangle-java-test.c | 5 +
tools/perf/tests/shell/test_intel_pt.sh | 5 +
tools/perf/tests/shell/trace_summary.sh | 6 +
tools/perf/util/demangle-cxx.h | 2 +
tools/perf/util/intel-tpebs.c | 12 +-
tools/perf/util/symbol-elf.c | 86 ------------
tools/perf/util/symbol-minimal.c | 175 ++++++++++--------------
tools/perf/util/symbol.c | 87 ++++++++++++
tools/perf/util/thread.c | 17 ++-
9 files changed, 198 insertions(+), 197 deletions(-)
--
2.49.0.1238.gf8c92423fb-goog
Return-Path: <linux-kernel+bounces-665936-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [139.178.88.99])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id BADB641E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:03:07 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by sv.mirrors.kernel.org (Postfix) with ESMTPS id 88F76A2441F
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:02:39 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id E6ACE111AD;
Wed, 28 May 2025 18:02:54 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="MaeStp27"
Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131])
(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 D254228C86C
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:02:51 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748455373; cv=none; b=oewhvtcochnIbGEbDxuZwhyIbAWawhawA1MxPzf25QMIoAxKaD3XAuQ46amiQ4w2TB9UxbThof/YpVE4fBKkvsa1B6/6KlcnJPWGv8K+VsXMM7AvBiZgCdMVFOap37IvVnnso6+P+L0KyExMe52KrDbTFeKciEIHNqPu33cApxE=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748455373; c=relaxed/simple;
bh=gxUDH75Bxi5SvxKp09Z5LhGrAVF3n2fLET8soCrnXhE=;
h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
Content-Type:Content-Disposition:In-Reply-To; b=BpgTkH8ecZsj+zwRbKRKTCrcbmq4lN3sHES3ym8tyKyDF3HgRJy3bxVNGe1a3HMg2C9B2TU+0sTSYRtueJ99BIEsh05CSAZ+qBjvJotXkpO3p28UEp49iK2CWbemQgQgj1yo0xXuyX/CGGl6VNn/SXm0H2wogtqZgcj26Ke9Vn4=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=MaeStp27; arc=none smtp.client-ip=205.220.168.131
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com
Received: from pps.filterd (m0279865.ppops.net [127.0.0.1])
by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 54SDpSZd029130
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:02:51 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
cc:content-transfer-encoding:content-type:date:from:in-reply-to
:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
mt94scoMpGBlHkRfDjr/0ZaH4cqB4nVNpigo9K1BPzI=; b=MaeStp27orB5w35D
QO0Llp38kkYe1PnLLuvWzuBuw66WDoKqFgD55Yq/aekHqZHhYWfzcRQ6lYA9X2cg
AxRvFj12qWO8JB0OpQgqkjemz3G1CA3UUmn7g0juiro4iGYjy9Q3l+snjC3avDUW
9dPLzjqaiYu1nIMS43JD+YhbKTHIa4DYlta/S2f2vp2SA6XLK5TYQeFSkcuisWnL
6XLBHR5V98f6WW29lGtZLQ7zdfPshXgnsYco86XnAtO+kYhGBUzR775ofwpz3rA0
NBsr/wFAA/FP6ltO8JhyJgGAAprGF2r/EVg5YP+eixt1vU0U2CINetYK+CfQeGA7
R/w9Hg==
Received: from mail-vs1-f71.google.com (mail-vs1-f71.google.com [209.85.217.71])
by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46w992n6mw-1
(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT)
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:02:50 +0000 (GMT)
Received: by mail-vs1-f71.google.com with SMTP id ada2fe7eead31-4e591aa8801so728104137.1
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 11:02:50 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1748455369; x=1749060169;
h=in-reply-to:content-transfer-encoding:content-disposition
:mime-version:references:message-id:subject:cc:to:from:date
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
bh=mt94scoMpGBlHkRfDjr/0ZaH4cqB4nVNpigo9K1BPzI=;
b=DjtijEiWnD5JGnTLGUncYTcaKQPt0GxxU2arauIMw0gaGXs4F5FUpE29bHT7TCvHu2
cs3XschMuzc7TFMBf8EnZZLOfDatG6z7ZDnNWWSLXdHL5B9LYgEttccClIqP02SLHPRs
tUEDXpo6ErCQt6gp8MQhPXUX6df2pHqCr8nF+b+K4SwhVbZU6SQ6UvjQF077JwpDQc9V
Rf4esVuMSZO7X8mhJa2EXnxwTW+qoiVG/8Q3GSmstp6tXSi1vsFLY19XcaWhJhNwxKqX
CnRZ5fMGBeYbFZTrrzJ/rvstF/4hcukMdJExRimsrOPShBNdZhmdaNPiWunzt3HzWTBD
0pOQ==
X-Forwarded-Encrypted: i=1; AJvYcCXc0Ap72OkFPyAl6XDfHLB0Z77FK+s9/jCSsPt6ahKdkv/QmQx1hXylvUssqJNE+By4tTSsqODnze0wj8w=@vger.kernel.org
X-Gm-Message-State: AOJu0YwrdmAGvW3x2S/+ujVzMCKki/bv+0OzpJDPqWYf0fWVPFGI4+wD
JbFWu90zvJXn6gIYyu7/dCo2rllKG3kpnofk0XDpbbjwS/plVe7Hz0WV4vrw3qLbj+0Vx4xIu7m
iGK1BjeXeGurcsdilKXHmdS7o1OA3m5WTNDur4yGCleOxjt2dTutlfYjrAJaO3Ht8tAGlJQnvv2
g=
X-Gm-Gg: ASbGncsdNN9dxNhFXmxJT6rouGKlyUoCPdvW+i0vyHwbJcNkLiiNfDr6zwidNJBLVrH
9Unv1qlSZIkVi2kHe6uQLNDyIaxveP8HHcJbqLhSv7QmtqZ/nEY7UWwZhB/N/7hG9vUokIDvWhW
6W9DAlP2xj/w8r4f7EUPrDtMRmgsPyxa7qeg8fLN59kSyBh7wevbyGtkpk7uzTE/NDMwzN8RHxo
cJm63b6LE9Gy/9sdTW4hQmvJCFGnzmokAHlueU6uFsh/xfmWufVHp/t+CWiK5UV0+QMUlpy0r5Y
BJsZIyrA9E5850+qZ/kTSEXFg0eGM6CaQi470qTxP2l5xNIvg7KvCcPsO9t8Fu+TbPmxq6vLb2g
2cFIfkj8o3g==
X-Received: by 2002:a05:620a:2994:b0:7c2:f39d:d0e0 with SMTP id af79cd13be357-7d098762690mr82814785a.3.1748455358440;
Wed, 28 May 2025 11:02:38 -0700 (PDT)
X-Google-Smtp-Source: AGHT+IELc/vRTL5HOf4+VrKbUzHnWp0OBTAbQJHqlFy1eblVpmeIMAnJvUcYCEHijRPc3YXDAGhdqg==
X-Received: by 2002:a9d:6c98:0:b0:735:a98d:a4c9 with SMTP id 46e09a7af769-735acea2225mr244432a34.7.1748455347211;
Wed, 28 May 2025 11:02:27 -0700 (PDT)
Received: from eriador.lumag.spb.ru (2001-14ba-a0c3-3a00--7a1.rev.dnainternet.fi. [2001:14ba:a0c3:3a00::7a1])
by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5532f61ca28sm379055e87.50.2025.05.28.11.02.23
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 28 May 2025 11:02:25 -0700 (PDT)
Date: Wed, 28 May 2025 21:02:22 +0300
From: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxxxxxxxx>
To: Yongxing Mou <quic_yongmou@xxxxxxxxxxx>
Cc: Abhinav Kumar <quic_abhinavk@xxxxxxxxxxx>, Rob Clark <robdclark@xxxxxxxxx>,
Sean Paul <sean@xxxxxxxxxx>,
Marijn Suijten <marijn.suijten@xxxxxxxxxxxxxx>,
David Airlie <airlied@xxxxxxxxx>, Simona Vetter <simona@xxxxxxxx>,
Stephen Boyd <swboyd@xxxxxxxxxxxx>,
Chandan Uddaraju <chandanu@xxxxxxxxxxxxxx>,
Guenter Roeck <groeck@xxxxxxxxxxxx>,
Kuogee Hsieh <quic_khsieh@xxxxxxxxxxx>,
Bjorn Andersson <andersson@xxxxxxxxxx>,
Konrad Dybcio <konradybcio@xxxxxxxxxx>, Rob Herring <robh@xxxxxxxxxx>,
Krzysztof Kozlowski <krzk+dt@xxxxxxxxxx>,
Conor Dooley <conor+dt@xxxxxxxxxx>,
Vara Reddy <quic_varar@xxxxxxxxxxx>,
Rob Clark <robdclark@xxxxxxxxxxxx>,
Tanmay Shah <tanmay@xxxxxxxxxxxxxx>, linux-arm-msm@xxxxxxxxxxxxxxx,
dri-devel@xxxxxxxxxxxxxxxxxxxxx, freedreno@xxxxxxxxxxxxxxxxxxxxx,
linux-kernel@xxxxxxxxxxxxxxx, devicetree@xxxxxxxxxxxxxxx,
Jessica Zhang <quic_jesszhan@xxxxxxxxxxx>,
Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
Subject: Re: [PATCH 31/45] drm/msm/dp: add dp_mst_drm to manage DP MST bridge
operations
Message-ID: <n5g44odmls5yg4vwb6rfvdxeyy43d4ba4cahanwxe7f5scw7dv@btvb2crhjlbp>
References: <20241205-dp_mst-v1-0-f8618d42a99a@xxxxxxxxxxx>
<20241205-dp_mst-v1-31-f8618d42a99a@xxxxxxxxxxx>
<4unizv5vi7ve7qdpzmcxj6vvxwxrpcppg3y72csi7ga2jqwhrm@5eu74nuopyqf>
<318ee4bc-b39a-43d3-abcb-22588a9a765c@xxxxxxxxxxx>
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <318ee4bc-b39a-43d3-abcb-22588a9a765c@xxxxxxxxxxx>
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTI4MDE1NyBTYWx0ZWRfXz6+p3gaZlptC
jHoTV9ET5lWiIt97SDw9RdIJ/BgiPvtb3uG/A2FHB6sf2ACvbJFiAN2MMaw4JNoYk/R2UqILLeD
Ib1a4reQDz7w9okkH+o+0RVMUiWCF6kB5ReQ32HbZKUnIQWfCYndAox5tEvvbvPbcHHGCzXQkCW
qf89MyHWtH1XvrRcQFX2eViMO4r/777XI0XqA0WWsuNtC75/28sqaag0hbhZEfTN8B5Cq8RY5el
l37blIghXamfTbEiVQIe0Z1BTdnQ21qp76ejfbxwnJVUdV9OrQi9Ir8+l6Q51Mro1boM/H0z51I
PIbQyO12aNY3ZOrkUSqgNAEKS32JAFZAaBwNzG4idRjAhHXROUcp3s9h7A3Jb1MMAHBeDhlM0Oi
0SkRFaNOMBYNRaQo4zBE6aYuAlOLMJzO4jacBXm5wx4aNpsaghcsnHZCJnm8qO6FZm7aQiXZ
X-Authority-Analysis: v=2.4 cv=Fes3xI+6 c=1 sm=1 tr=0 ts=68374fca cx=c_pps
a=P2rfLEam3zuxRRdjJWA2cw==:117 a=xqWC_Br6kY4A:10 a=8nJEP1OIZ-IA:10
a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=AkxkYSyKjySzLiMMLVoA:9 a=3ZKOabzyN94A:10
a=wPNLvfGTeEIA:10 a=ODZdjJIeia2B_SHc_B0f:22 a=TjNXssC_j7lpFel5tvFf:22
X-Proofpoint-GUID: AVmbRiY7LcCIpUKbmVE5nhSGqpynRjQn
X-Proofpoint-ORIG-GUID: AVmbRiY7LcCIpUKbmVE5nhSGqpynRjQn
X-Proofpoint-Virus-Version: vendor=baseguard
engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40
definitions=2025-05-28_09,2025-05-27_01,2025-03-28_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
mlxscore=0 malwarescore=0 impostorscore=0 phishscore=0 clxscore=1015
lowpriorityscore=0 bulkscore=0 priorityscore=1501 mlxlogscore=999 spamscore=0
adultscore=0 suspectscore=0 classifier=spam authscore=0 authtc=n/a authcc=
route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505160000
definitions=main-2505280157
X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
On Tue, May 27, 2025 at 06:29:49PM +0800, Yongxing Mou wrote:
On 2024/12/6 18:12, Dmitry Baryshkov wrote:
> On Thu, Dec 05, 2024 at 08:32:02PM -0800, Abhinav Kumar wrote:
> > Add a new file dp_mst_drm to manage the DP MST bridge operations
> > similar to the dp_drm file which manages the SST bridge operations.
> > Each MST encoder creates one bridge and each bridge is bound to its
> > own dp_panel abstraction to manage the operations of its pipeline.
> >
> > Signed-off-by: Abhinav Kumar <quic_abhinavk@xxxxxxxxxxx>
> > ---
> > drivers/gpu/drm/msm/Makefile | 3 +-
> > drivers/gpu/drm/msm/dp/dp_display.h | 2 +
> > drivers/gpu/drm/msm/dp/dp_mst_drm.c | 490 ++++++++++++++++++++++++++++++++++++
> > drivers/gpu/drm/msm/dp/dp_mst_drm.h | 102 ++++++++
> > 4 files changed, 596 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/msm/Makefile b/drivers/gpu/drm/msm/Makefile
> > index f274d9430cc311405f890074c1466ffe2ec45ac9..b1e01b3123d9afc4818f059c5d4e7ca70dca3754 100644
> > --- a/drivers/gpu/drm/msm/Makefile
> > +++ b/drivers/gpu/drm/msm/Makefile
> > @@ -142,7 +142,8 @@ msm-display-$(CONFIG_DRM_MSM_DP)+= dp/dp_aux.o \
> > dp/dp_link.o \
> > dp/dp_panel.o \
> > dp/dp_audio.o \
> > - dp/dp_utils.o
> > + dp/dp_utils.o \
> > + dp/dp_mst_drm.o
> > msm-display-$(CONFIG_DRM_MSM_HDMI_HDCP) += hdmi/hdmi_hdcp.o
> > diff --git a/drivers/gpu/drm/msm/dp/dp_display.h b/drivers/gpu/drm/msm/dp/dp_display.h
> > index 6ab14e969bce0fd07b3a550bae17e99652479232..a5d4893f689c6afbbe622c9b7dfa98d23d754831 100644
> > --- a/drivers/gpu/drm/msm/dp/dp_display.h
> > +++ b/drivers/gpu/drm/msm/dp/dp_display.h
> > @@ -7,6 +7,7 @@
> > #define _DP_DISPLAY_H_
> > #include "dp_panel.h"
> > +#include "dp_mst_drm.h"
> > #include <sound/hdmi-codec.h>
> > #include "disp/msm_disp_snapshot.h"
> > @@ -26,6 +27,7 @@ struct msm_dp {
> > bool is_edp;
> > bool internal_hpd;
> > + struct msm_dp_mst *msm_dp_mst;
> > hdmi_codec_plugged_cb plugged_cb;
> > struct msm_dp_audio *msm_dp_audio;
> > diff --git a/drivers/gpu/drm/msm/dp/dp_mst_drm.c b/drivers/gpu/drm/msm/dp/dp_mst_drm.c
> > new file mode 100644
> > index 0000000000000000000000000000000000000000..e66bd1e565aeb4da3d636eb5f4aa75504d60fd40
> > --- /dev/null
> > +++ b/drivers/gpu/drm/msm/dp/dp_mst_drm.c
> > @@ -0,0 +1,490 @@
> > +// SPDX-License-Identifier: GPL-2.0-only
> > +/*
> > + * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
> > + * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
> > + */
> > +
> > +/*
> > + * Copyright � 2014 Red Hat.
> > + *
> > + * Permission to use, copy, modify, distribute, and sell this software and its
> > + * documentation for any purpose is hereby granted without fee, provided that
> > + * the above copyright notice appear in all copies and that both that copyright
> > + * notice and this permission notice appear in supporting documentation, and
> > + * that the name of the copyright holders not be used in advertising or
> > + * publicity pertaining to distribution of the software without specific,
> > + * written prior permission. The copyright holders make no representations
> > + * about the suitability of this software for any purpose. It is provided "as
> > + * is" without express or implied warranty.
> > + *
> > + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
> > + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
> > + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
> > + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
> > + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
> > + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
> > + * OF THIS SOFTWARE.
> > + */
> > +
> > +#include "dp_mst_drm.h"
> > +
> > +static struct drm_private_state *msm_dp_mst_duplicate_bridge_state(struct drm_private_obj *obj)
> > +{
> > + struct msm_dp_mst_bridge_state *state;
> > +
> > + state = kmemdup(obj->state, sizeof(*state), GFP_KERNEL);
> > + if (!state)
> > + return NULL;
> > +
> > + __drm_atomic_helper_private_obj_duplicate_state(obj, &state->base);
> > +
> > + return &state->base;
> > +}
> > +
> > +static void msm_dp_mst_destroy_bridge_state(struct drm_private_obj *obj,
> > + struct drm_private_state *state)
> > +{
> > + struct msm_dp_mst_bridge_state *priv_state =
> > + to_msm_dp_mst_bridge_priv_state(state);
> > +
> > + kfree(priv_state);
> > +}
> > +
> > +static const struct drm_private_state_funcs msm_dp_mst_bridge_state_funcs = {
> > + .atomic_duplicate_state = msm_dp_mst_duplicate_bridge_state,
> > + .atomic_destroy_state = msm_dp_mst_destroy_bridge_state,
> > +};
> > +
> > +/**
> > + * dp_mst_find_vcpi_slots() - Find VCPI slots for this PBN value
> > + * @mgr: manager to use
> > + * @pbn: payload bandwidth to convert into slots.
> > + *
> > + * Calculate the number of VCPI slots that will be required for the given PBN
> > + * value.
> > + *
> > + * RETURNS:
> > + * The total slots required for this port, or error.
> > + */
> > +static int msm_dp_mst_find_vcpi_slots(struct drm_dp_mst_topology_mgr *mgr, int pbn)
> > +{
> > + int num_slots;
> > + struct drm_dp_mst_topology_state *state;
> > +
> > + state = to_drm_dp_mst_topology_state(mgr->base.state);
> > + num_slots = DIV_ROUND_UP(pbn, dfixed_trunc(state->pbn_div));
>
> drm_dp_atomic_find_time_slots() uses slightly different maths here, with
> the different precision. Can we use the data that is set by that function
> instead (payload->time_slots)?
>
Note that drm_dp_atomic_find_time_slots all call in atomic_check func, not
in other place.So can we call this func in atomic_pre_enable? Also, amg
driver also have similar usage pattern.
Well, granted that this function can return ENOSPC, it is an error to
call it in atomic_pre_enable(). Nothing in atomic_pre_enable() /
atomic_enable() is allowed to fail.
I think this answers my question: drm_dp_atomic_find_time_slots()
should be called from atomic_check(), this function must be dropped.
> > +
> > + /* max. time slots - one slot for MTP header */
> > + if (num_slots > 63)
> > + return -ENOSPC;
> > + return num_slots;
> > +}
> > +
> > +static void _msm_dp_mst_update_timeslots(struct msm_dp_mst *mst,
> > + struct msm_dp_mst_bridge *mst_bridge,
> > + struct drm_dp_mst_port *port)
> > +{
> > + int i;
> > + struct msm_dp_mst_bridge *msm_dp_bridge;
> > + struct drm_dp_mst_topology_state *mst_state;
> > + struct drm_dp_mst_atomic_payload *payload;
> > + int prev_start = 0;
> > + int prev_slots = 0;
> > +
> > + mst_state = to_drm_dp_mst_topology_state(mst->mst_mgr.base.state);
> > + payload = drm_atomic_get_mst_payload_state(mst_state, port);
> > +
> > + if (!payload) {
> > + DRM_ERROR("mst bridge [%d] update_timeslots failed, null payload\n",
> > + mst_bridge->id);
> > + return;
> > + }
> > +
> > + for (i = 0; i < mst->max_streams; i++) {
> > + msm_dp_bridge = &mst->mst_bridge[i];
> > + if (mst_bridge == msm_dp_bridge) {
> > + /*
> > + * When a payload was removed make sure to move any payloads after it
> > + * to the left so all payloads are aligned to the left.
> > + */
>
> Please don't. drm_dp_remove_payload_part2() should take care of that for
> us. What is the reason for caching the data if we have to manually
> handle the cache?
>
MST framework is managing the port's bandwidth, but we have a bridhge for
each stream, so we need to keep track of the payload allcation status for
each bridge, how much we used and how much we left. So maybe they are manage
two different part.
Well, still no. MST topology master should handle all payload
allocation. If you need any data, enhance its API instead of duplicating
its functionality.
> > + if (payload->vc_start_slot < 0) {
> > + // cache the payload
> > + prev_start = msm_dp_bridge->start_slot;
> > + prev_slots = msm_dp_bridge->num_slots;
> > + msm_dp_bridge->pbn = 0;
> > + msm_dp_bridge->start_slot = 1;
> > + msm_dp_bridge->num_slots = 0;
> > + msm_dp_bridge->vcpi = 0;
> > + } else { //add payload
> > + msm_dp_bridge->pbn = payload->pbn;
> > + msm_dp_bridge->start_slot = payload->vc_start_slot;
> > + msm_dp_bridge->num_slots = payload->time_slots;
> > + msm_dp_bridge->vcpi = payload->vcpi;
> > + }
> > + }
> > + }
> > +
> > + // Now commit all the updated payloads
> > + for (i = 0; i < mst->max_streams; i++) {
> > + msm_dp_bridge = &mst->mst_bridge[i];
> > +
> > + //Shift payloads to the left if there was a removed payload.
> > + if (payload->vc_start_slot < 0 && msm_dp_bridge->start_slot > prev_start)
> > + msm_dp_bridge->start_slot -= prev_slots;
> > +
> > + msm_dp_display_set_stream_info(mst->msm_dp, msm_dp_bridge->msm_dp_panel,
> > + msm_dp_bridge->id, msm_dp_bridge->start_slot,
> > + msm_dp_bridge->num_slots,
> > + msm_dp_bridge->pbn, msm_dp_bridge->vcpi);
> > + drm_dbg_dp(mst->msm_dp->drm_dev,
> > + "conn:%d vcpi:%d start_slot:%d num_slots:%d, pbn:%d\n",
> > + DP_MST_CONN_ID(msm_dp_bridge), msm_dp_bridge->vcpi,
> > + msm_dp_bridge->start_slot,
> > + msm_dp_bridge->num_slots, msm_dp_bridge->pbn);
> > + }
> > +}
> > +
[...]
> > + struct msm_dp_panel *msm_dp_panel;
> > +
> > + int vcpi;
> > + int pbn;
> > + int num_slots;
> > + int start_slot;
>
> Which of the fields (including in_use) are long-lived and which are a
> part of the current state? Can we move all state ones to bridge's state?
>
in_use only used in bridge_init, so it is long-lived. Looking at it together
with the next patch, only num_slots changes during atomic_check, so it is in
bridge_state. pbn/vcpi/start_slots only change during bridge enable/disable,
so they are placed in the bridge.
Let's look how it will look after refactoring. I'd still push all
changing fields to state. It make a lot of things much easier.
> > +};
> > +
> > +struct msm_dp_mst_bridge_state {
> > + struct drm_private_state base;
> > + struct drm_connector *connector;
> > + struct msm_dp_panel *msm_dp_panel;
> > + int num_slots;
> > +};
> > +
> > +struct msm_dp_mst {
> > + bool mst_initialized;
> > + struct drm_dp_mst_topology_mgr mst_mgr;
> > + struct msm_dp_mst_bridge *mst_bridge;
> > + struct msm_dp *msm_dp;
> > + bool mst_session_hpd_state;
> > + u32 max_streams;
> > +};
> > +
> > +struct msm_dp_mst_connector {
> > + struct drm_connector connector;
> > + struct drm_dp_mst_port *mst_port;
> > + struct msm_dp *msm_dp;
> > + struct msm_dp_panel *dp_panel;
> > +};
> > +
> > +#define to_msm_dp_mst_bridge(x) container_of((x), struct msm_dp_mst_bridge, base)
> > +#define to_msm_dp_mst_bridge_priv(x) \
> > + container_of((x), struct msm_dp_mst_bridge, obj)
> > +#define to_msm_dp_mst_bridge_priv_state(x) \
> > + container_of((x), struct msm_dp_mst_bridge_state, base)
> > +#define to_msm_dp_mst_bridge_state(x) \
> > + to_msm_dp_mst_bridge_priv_state((x)->obj.state)
> > +#define to_msm_dp_mst_connector(x) \
> > + container_of((x), struct msm_dp_mst_connector, connector)
> > +int msm_dp_mst_drm_bridge_init(struct msm_dp *dp, struct drm_encoder *encoder);
> > +
> > +#endif /* _DP_MST_DRM_H_ */
> >
> > --
> > 2.34.1
> >
>
--
With best wishes
Dmitry
Return-Path: <linux-kernel+bounces-665937-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [147.75.80.249])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 224A641E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:03:14 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by am.mirrors.kernel.org (Postfix) with ESMTPS id 884101899AB5
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:03:26 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 8E23428E59F;
Wed, 28 May 2025 18:02:59 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="yV7ogBkV"
Received: from mail-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C0BD28E56D
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:02:56 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.173
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748455378; cv=none; b=g/0CWf1jB2WEGYOizNlnK+TzuIiQm/NGCQYs9b7kziVPcOTrY5ge9N6mf2IB7SPZx90iraoaInmUkRW/snHnby2RiYPrA4I15oonUWM4yyC6W/8K1nvUY7GvgL5JcViv1FOfROWoKriQQyPbfatNWNJAtMYGKpLwl5yUE8ajr7c=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748455378; c=relaxed/simple;
bh=m4h+499vGYh+iYxijfsahqG0vZFEdsOg94f6d1R6aEM=;
h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:
To:Cc:Content-Type; b=J+YaaVble0dnx2q/leZaU78w/0xdPULxJIbaUtegtRMNp3uvpHAx1XjCfzj9OuuWLvC74/Ff7j5Ig8QnH5OIo8fuHT1EHszTRQ6BluCOpz8aAfirM4ZyTuG65gajTchcyD97/n7o5rVAzXuUBDeWlkz6On6InVjyKRx/xCQTsMA=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=yV7ogBkV; arc=none smtp.client-ip=209.85.166.173
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com
Received: by mail-il1-f173.google.com with SMTP id e9e14a558f8ab-3dc8897f64cso25595ab.1
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 11:02:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=google.com; s=20230601; t=1748455376; x=1749060176; darn=vger.kernel.org;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:from:to:cc:subject:date
:message-id:reply-to;
bh=NZwa7gPGfpqcfVjfPBpJgP+00qIL0eiwvLWJGKbrQm4=;
b=yV7ogBkVSA7gEHPdaF+f0rHFiIfJHztong+rXRbKiSYnaNryKGZchS6odeVdA+gehc
nPVKsORPw8fbus8DyDBeAN6f47RYpyK8EeXMNVNDOFtM0j2vGomhQprtZD268XrE0QSj
BXA+BCnaNQx0n4+XD6PlN6mjI3jHYcarA7IjIkSFDrMyy7vY/wqXB9bE5hjbx6tHevnV
0TGFW1vnRLNKaBx9R8K8jexqyukWFvMk7dS8vXktdKIW2eddw21jcqjXueYhr9d9olGC
GsrT77JmiIgLvoWdcB8HE/HDKabEPRgFqkNR6sRVDyQeoB+K93stGsmaOklUYF3wwsCh
sn3g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1748455376; x=1749060176;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=NZwa7gPGfpqcfVjfPBpJgP+00qIL0eiwvLWJGKbrQm4=;
b=P9aWoeThTppiVZTv7K37WojRpV5I7xhgd9cdC3U93R9QwGYOV+JucmF34R7QYVO+sM
U9s7LzZQwqS1bG4/O8dByFKiubDMZQfyE6JrpCMUpysirrEVdiE160T7+ZJCACJQotqO
LKyDkAye9fPtrQ8wiffk9uYQrvdAmSEYnsmNWFcyP7b29nhiN1cIk3QiYjbHBebQNbUk
/Da5CEw1Qq6u6CaOMCoWPsRf4c908vk8FO2Mdnl/LP1zy7k2Rfu13vsUYatsNUSBbOuo
x3Sjth+qmrroPLk5fV4jhyOC9GepdoCkD0MLSRkFRLdq3g+n6igFZQBAKo1oKM0wgLAP
Og5Q==
X-Forwarded-Encrypted: i=1; AJvYcCUwyVLphU5AX0QL+ENrEQ5aLiqMsVWvpgiJ//E1a22DW/dO6O/nI1VbdQvkOB2Jyx/eskkCu9hWnEKQV08=@vger.kernel.org
X-Gm-Message-State: AOJu0Yz8AW8nSXi260U1iu/PHm79MaHITs8cbCXwqGQ5wRX9YoKfAS/O
CGRoiLL2g+p5zpEDPK6Sixj8gVV9a8ipqqutiPmSyZXeuinpZNxRWV5OMPnB4UzC3mKRX6UG2n9
bXh0g4Dqcmh/XBGEuR2JrgSusrvlFrPT/o2ltHTqt
X-Gm-Gg: ASbGncvht7cxl0Y8goHzChZszHf0kw0bjuUCkhllM4XVloAFfwaecFZXB8YloSezGWL
MwROZUHzmo5A5veFBJLjPqIJLWg1KAAwR7Rws44Bkh8460MlfR0SBXdzGuq4wtu6ljVkcagJSTr
dzZqrA4VL3OukG0qaWsnt6Hmg4w/s2cyzCQ1A4AQSvbEK1agQ5dGgk9n0s0RRj+WgQgEJyYILv
X-Google-Smtp-Source: AGHT+IHXVQtYnSEhg9S6Ul4Dw2KI+kuRxxZduzNu/XhB4JQvv3y5qplcavKDXgnjzk+dDGCqQiJHpne8h1TEyjl/eck=
X-Received: by 2002:a05:6e02:1185:b0:3dc:7e19:fcc4 with SMTP id
e9e14a558f8ab-3dd91bb281bmr133785ab.8.1748455375252; Wed, 28 May 2025
11:02:55 -0700 (PDT)
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
References: <20250528032637.198960-1-irogers@xxxxxxxxxx> <20250528032637.198960-5-irogers@xxxxxxxxxx>
<aDdNk1IOqtyM44AX@xxxxxxxxxx>
In-Reply-To: <aDdNk1IOqtyM44AX@xxxxxxxxxx>
From: Ian Rogers <irogers@xxxxxxxxxx>
Date: Wed, 28 May 2025 11:02:44 -0700
X-Gm-Features: AX0GCFvrd4KaGrUHxBiOU6BspUaFU5sD2jWIH0NE1i9_H57R3df7_M2FSm5zBYI
Message-ID: <CAP-5=fUmrnOUOBWcypD=Q7bCSQ3HTnicRXhr8nmSRqcbZv7Mmw@xxxxxxxxxxxxxx>
Subject: Re: [PATCH v2 4/7] perf intel-tpebs: Avoid race when evlist is being deleted
To: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>,
Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>, Mark Rutland <mark.rutland@xxxxxxx>,
Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>, Jiri Olsa <jolsa@xxxxxxxxxx>,
Adrian Hunter <adrian.hunter@xxxxxxxxx>, Kan Liang <kan.liang@xxxxxxxxxxxxxxx>,
Miguel Ojeda <ojeda@xxxxxxxxxx>, Alex Gaynor <alex.gaynor@xxxxxxxxx>,
Boqun Feng <boqun.feng@xxxxxxxxx>, Gary Guo <gary@xxxxxxxxxxx>,
=?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= <bjorn3_gh@xxxxxxxxxxxxxx>,
Benno Lossin <benno.lossin@xxxxxxxxx>, Andreas Hindborg <a.hindborg@xxxxxxxxxx>,
Alice Ryhl <aliceryhl@xxxxxxxxxx>, Trevor Gross <tmgross@xxxxxxxxx>,
Danilo Krummrich <dakr@xxxxxxxxxx>, Jiapeng Chong <jiapeng.chong@xxxxxxxxxxxxxxxxx>,
James Clark <james.clark@xxxxxxxxxx>, Howard Chu <howardchu95@xxxxxxxxx>,
Weilin Wang <weilin.wang@xxxxxxxxx>, Stephen Brennan <stephen.s.brennan@xxxxxxxxxx>,
Andi Kleen <ak@xxxxxxxxxxxxxxx>, Dmitry Vyukov <dvyukov@xxxxxxxxxx>,
linux-perf-users@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Status: No, score=-11.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,
MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
On Wed, May 28, 2025 at 10:53=E2=80=AFAM Namhyung Kim <namhyung@xxxxxxxxxx>=
wrote:
Hi Ian,
On Tue, May 27, 2025 at 08:26:34PM -0700, Ian Rogers wrote:
> Reading through the evsel->evlist may seg fault if a sample arrives
> when the evlist is being deleted. Detect this case and ignore samples
> arriving when the evlist is being deleted.
>
> Fixes: bcfab08db7fb ("perf intel-tpebs: Filter non-workload samples")
> Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
> ---
> tools/perf/util/intel-tpebs.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/util/intel-tpebs.c b/tools/perf/util/intel-tpeb=
s.c
> index 4ad4bc118ea5..3b92ebf5c112 100644
> --- a/tools/perf/util/intel-tpebs.c
> +++ b/tools/perf/util/intel-tpebs.c
> @@ -162,9 +162,17 @@ static bool is_child_pid(pid_t parent, pid_t child=
)
>
> static bool should_ignore_sample(const struct perf_sample *sample, con=
st struct tpebs_retire_lat *t)
> {
> - pid_t workload_pid =3D t->evsel->evlist->workload.pid;
> - pid_t sample_pid =3D sample->pid;
> + pid_t workload_pid, sample_pid =3D sample->pid;
>
> + /*
> + * During evlist__purge the evlist will be removed prior to the
> + * evsel__exit calling evsel__tpebs_close and taking the
> + * tpebs_mtx. Avoid a segfault by ignoring samples in this case.
> + */
> + if (t->evsel->evlist =3D=3D NULL)
> + return true;
> +
> + workload_pid =3D t->evsel->evlist->workload.pid;
I'm curious if there's a chance of TOCTOU race. It'd certainly help
the segfault but would this code prevent it completely?
Good point. I think the race is already small as it doesn't happen
without sanitizers for me.
Thinking about the evlist problem. When a destructor (evlist__delete)
it is generally assumed the code is being single threaded and in C++
clang's -Wthread-safety will ignore destructors for this reason
(annoying imo as it hides bugs). I don't see a good way to solve that
for the evlist and evsel for the TPEBS case without using reference
counting. Adding reference counts to evlist and evsel would be do-able
as we could use reference count checking, but it would be a large and
invasive change. Wdyt?
Thanks,
Ian
Thanks,
Namhyung
> if (workload_pid < 0 || workload_pid =3D=3D sample_pid)
> return false;
>
> --
> 2.49.0.1238.gf8c92423fb-goog
>
Return-Path: <linux-kernel+bounces-665938-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id ABE6441E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:04:06 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by ny.mirrors.kernel.org (Postfix) with ESMTPS id DD9251653AB
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:04:07 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 78A1028DF1C;
Wed, 28 May 2025 18:04:00 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="NpIImjmx"
Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C46628643A
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:03:57 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.172
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748455439; cv=none; b=PZ3gyVKM0LgaNEx5vrhBY3uz0CHKPiEJgcoEN4g4Ptc4vVrixdnyAUsJIrqVBbjwI6GtINIarvpeplwiR6qiX8P8aJKYMD8mYOOOZGy+X62t42oN0umhtPFVrZoWgzEEjbb9ooG4gaHr08epT6KQ7xzdk+Tk7V/0Nv6ykbLr/co=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748455439; c=relaxed/simple;
bh=y3gDfBvmW3cfiD0V313GhN2HKcJE858T1+tCRVjO7pE=;
h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:
To:Cc:Content-Type; b=CiFqAsbyJSd6x54myMi/PDHTG1S3EFQw66X9n3J82Yexc+b+G+ZACH22pq4XmsdK8hn9nnA062Q2jbARaIMG7T+RKibQRCb0e9jL0dPtlveLR8EBMMdwpNvgk1GKNFSOjT0OFO+Fo9Mcbgx6PxvEjjEO5HNSci3PMEIhMizlCQA=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=NpIImjmx; arc=none smtp.client-ip=209.85.166.172
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com
Received: by mail-il1-f172.google.com with SMTP id e9e14a558f8ab-3dd89a85414so22525ab.0
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 11:03:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=google.com; s=20230601; t=1748455437; x=1749060237; darn=vger.kernel.org;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:from:to:cc:subject:date
:message-id:reply-to;
bh=lxCBPuzPZYMMQyoxJpdKY9mjMg1Fs4mGiYtoajGbWLo=;
b=NpIImjmxO3QK2VXIBbYHWE45CKGliLsftWOZgUCWXoMt7CWgS04faOW/r7He0xFK3u
zFSGWrNAsld9k2ejOJiMDJzQhZ/F60Z8xXNK0cwmtWIN90hwkBl9hc/Rrb+qf+WUgyy/
MQZAKTxDgz/ufwecMdhpJgc1ralWbOqCbHRM0/F5x2WtHY/EvjnFcCxgwBzPbnL6o+Yv
OPe1/znPv0bqcrF8aIMTWo70TI1DVVuxlw5X09hASwPTvSBk9Z4oV4tiJvYGVcLar+d8
3Hvf2xxguKsTRJvCKXpEeiz89TwG2+eXDEUI3mYczG274UyMtzOJvJLGXnAUArVyptfq
3TkQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1748455437; x=1749060237;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=lxCBPuzPZYMMQyoxJpdKY9mjMg1Fs4mGiYtoajGbWLo=;
b=fDoNOf5OiKbkx3vnGU1nVlIvSTb42v8CPq6KePld72ZEOE3ELWzN3/sYklIO4VNDte
JVSZ+D4dymKddeHIc5OrbaG4jgIv4yYq7Fr0OljYuLPByZ7T+fUULy22Zks0QlOf4C+F
iDLrdNEq0Bb5lg6953XBXmFzXapo/boaXrCpSVMwv4+1Xis60qzCJKHKbuLFM4azwmJf
sKWN7AuzrKrC5xJg0gw+FH3vQP9YiUhldHKdqzPJDiHqXD/2j0AMvVXuI5DqqNR5raYX
hI+7KhSljyO81bCgqGIwpKvBMB345ZzO/qjXhsq+CZ2TPQOGPbhH8/cEii6oZl1jnXTe
Cvww==
X-Forwarded-Encrypted: i=1; AJvYcCXr7WjvIR3laMDORWGhyv72B60eBnYsh/jSFg1qcbJVMsGtlLbEroywbJFBsKZLGa7UavyuZjRauVtWsoc=@vger.kernel.org
X-Gm-Message-State: AOJu0YxGPiiySMKYNyZxN6arj974b32QEerVDQI6og0gMEV/pUryIm6q
0Vbm4xHawaMhcdPPrEerLyrgR8UPvZo1Wexg714KaEbffycMZdtODiEmjQq4KzNQtNotbj6Z6FJ
I7vfJ4W/M38nK89ituIt8EZ9ylVvu08mugGK2KmKx
X-Gm-Gg: ASbGncu5pufP7n/lur4dnR0YJ93+EelmFR9N3qFiIkkVcVcrdKd06p2zdZbfpaN6m/3
YG7EWC3bQf7Hn6ioVONi5nzNnIWjeputPY8dLziq5NhUbIMgbJRRHmPNxFszjd9vRgLnLx9X7AI
xUOpH6ygJ4/6j/TemBNoxT5GwmidbJ3185jgOot3kfOnpRLp0sboRjYuOlNLw535tRmtIzwOYv
X-Google-Smtp-Source: AGHT+IFZ63PJyaMXkDMN2RPPrQh1dWrNucQH4ctX9WtR0X20S4rMRW+kY0QVFHH5e0k98gRk3nOHrX/SoDRyfIExzVg=
X-Received: by 2002:a05:6e02:2587:b0:3dc:6151:5903 with SMTP id
e9e14a558f8ab-3dd91bb286bmr219855ab.10.1748455436707; Wed, 28 May 2025
11:03:56 -0700 (PDT)
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
References: <20250527180703.129336-1-irogers@xxxxxxxxxx> <20250527180703.129336-4-irogers@xxxxxxxxxx>
<aDcF7_pIU5M_XEAs@x1>
In-Reply-To: <aDcF7_pIU5M_XEAs@x1>
From: Ian Rogers <irogers@xxxxxxxxxx>
Date: Wed, 28 May 2025 11:03:45 -0700
X-Gm-Features: AX0GCFvdKyVA368LKetlo9s4uYxP2lbsSg2xZ2-A7hEEtYGI2AEq5-UvDX1LzO0
Message-ID: <CAP-5=fU6vnbLUbUr=+ZsmKyPo+u3w3F-2qM_6tBxeF=F0C+w1A@xxxxxxxxxxxxxx>
Subject: Re: [PATCH v1 3/6] perf symbol: Move demangling code out of symbol-elf.c
To: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>,
Namhyung Kim <namhyung@xxxxxxxxxx>, Mark Rutland <mark.rutland@xxxxxxx>,
Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>, Jiri Olsa <jolsa@xxxxxxxxxx>,
Adrian Hunter <adrian.hunter@xxxxxxxxx>, Kan Liang <kan.liang@xxxxxxxxxxxxxxx>,
Miguel Ojeda <ojeda@xxxxxxxxxx>, Alex Gaynor <alex.gaynor@xxxxxxxxx>,
Boqun Feng <boqun.feng@xxxxxxxxx>, Gary Guo <gary@xxxxxxxxxxx>,
=?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= <bjorn3_gh@xxxxxxxxxxxxxx>,
Benno Lossin <benno.lossin@xxxxxxxxx>, Andreas Hindborg <a.hindborg@xxxxxxxxxx>,
Alice Ryhl <aliceryhl@xxxxxxxxxx>, Trevor Gross <tmgross@xxxxxxxxx>,
Danilo Krummrich <dakr@xxxxxxxxxx>, Jiapeng Chong <jiapeng.chong@xxxxxxxxxxxxxxxxx>,
James Clark <james.clark@xxxxxxxxxx>, Howard Chu <howardchu95@xxxxxxxxx>,
Weilin Wang <weilin.wang@xxxxxxxxx>, Stephen Brennan <stephen.s.brennan@xxxxxxxxxx>,
Andi Kleen <ak@xxxxxxxxxxxxxxx>, Dmitry Vyukov <dvyukov@xxxxxxxxxx>,
linux-perf-users@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Status: No, score=-11.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,
MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
On Wed, May 28, 2025 at 5:47=E2=80=AFAM Arnaldo Carvalho de Melo
<acme@xxxxxxxxxx> wrote:
On Tue, May 27, 2025 at 11:07:00AM -0700, Ian Rogers wrote:
> symbol-elf.c is used when building with libelf, symbol-minimal is used
> otherwise. There is no reason the demangling code with no dependencies
> on libelf is part of symbol-elf.c so move to symbol.c. This allows
> demangling tests to pass with NO_LIBELF=3D1.
At this point:
=E2=AC=A2 [acme@toolbx perf-tools-next]$ alias m=3D'rm -rf ~/libexec/perf=
-core/ ; make -k O=3D/tmp/build/$(basename $PWD)/ -C tools/perf install-bin=
&& perf test python && cat /tmp/build/$(basename $PWD)/feature/test-all.ma=
ke.output'
=E2=AC=A2 [acme@toolbx perf-tools-next]$ m
rm: cannot remove '/home/acme/libexec/perf-core/scripts/python/Perf-Trace=
-Util/lib/Perf/Trace/__pycache__/Core.cpython-313.pyc': Permission denied
make: Entering directory '/home/acme/git/perf-tools-next/tools/perf'
BUILD: Doing 'make -j32' parallel build
Warning: Kernel ABI header differences:
diff -u tools/arch/arm64/include/asm/cputype.h arch/arm64/include/asm/c=
putype.h
Auto-detecting system features:
... libdw: [ on ]
... glibc: [ on ]
... libelf: [ on ]
... libnuma: [ on ]
... numa_num_possible_cpus: [ on ]
... libperl: [ on ]
... libpython: [ on ]
... libcrypto: [ on ]
... libcapstone: [ on ]
... llvm-perf: [ on ]
... zlib: [ on ]
... lzma: [ on ]
... get_cpuid: [ on ]
... bpf: [ on ]
... libaio: [ on ]
... libzstd: [ on ]
INSTALL libsubcmd_headers
INSTALL libperf_headers
INSTALL libapi_headers
INSTALL libsymbol_headers
INSTALL libbpf_headers
AR /tmp/build/perf-tools-next/libpmu-events.a
CC /tmp/build/perf-tools-next/util/symbol-elf.o
util/symbol-elf.c: In function =E2=80=98get_plt_got_name=E2=80=99:
util/symbol-elf.c:563:21: error: implicit declaration of function =E2=80=
=98demangle_sym=E2=80=99; did you mean =E2=80=98dso__demangle_sym=E2=80=99?=
[-Wimplicit-function-declaration]
563 | demangled =3D demangle_sym(di->dso, 0, sym_name);
| ^~~~~~~~~~~~
| dso__demangle_sym
util/symbol-elf.c:563:19: error: assignment to =E2=80=98char *=E2=80=99 f=
rom =E2=80=98int=E2=80=99 makes pointer from integer without a cast [-Wint-=
conversion]
563 | demangled =3D demangle_sym(di->dso, 0, sym_name);
| ^
util/symbol-elf.c: In function =E2=80=98dso__synthesize_plt_symbols=E2=80=
=99:
util/symbol-elf.c:761:27: error: assignment to =E2=80=98char *=E2=80=99 f=
rom =E2=80=98int=E2=80=99 makes pointer from integer without a cast [-Wint-=
conversion]
761 | demangled =3D demangle_sym(dso, 0, elf_name);
| ^
util/symbol-elf.c: In function =E2=80=98dso__load_sym_internal=E2=80=99:
util/symbol-elf.c:1778:27: error: assignment to =E2=80=98char *=E2=80=99 =
from =E2=80=98int=E2=80=99 makes pointer from integer without a cast [-Wint=
-conversion]
1778 | demangled =3D demangle_sym(dso, kmodule, elf_name=
);
| ^
make[4]: *** [/home/acme/git/perf-tools-next/tools/build/Makefile.build:8=
5: /tmp/build/perf-tools-next/util/symbol-elf.o] Error 1
make[3]: *** [/home/acme/git/perf-tools-next/tools/build/Makefile.build:1=
42: util] Error 2
make[2]: *** [Makefile.perf:798: /tmp/build/perf-tools-next/perf-util-in.=
o] Error 2
make[1]: *** [Makefile.perf:290: sub-make] Error 2
make: *** [Makefile:119: install-bin] Error 2
make: Leaving directory '/home/acme/git/perf-tools-next/tools/perf'
=E2=AC=A2 [acme@toolbx perf-tools-next]$
Sorry, was so focussed on getting the sanitizers clean I'd missed the
non-sanitizer build. Will fix in v3.
Thanks,
Ian
- Arnaldo
Return-Path: <linux-kernel+bounces-665939-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id DFB1F41E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:06:21 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by ny.mirrors.kernel.org (Postfix) with ESMTPS id 12178167C6F
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:06:23 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 18F46111AD;
Wed, 28 May 2025 18:06:14 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="L5G4AwX9"
Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id D01A320458A
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:06:11 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748455573; cv=none; b=fPhpJIWOtT7cuSR+vXCjxcAhwOIR3krvGEAMKSAbMHdsTMZs+8SJ12vaCoXeTl8SHNfU8ZaUHubS2q6UVbEDsgO7RvI6FXAMbq7rbIuOIp5CKFvl5H400ZSQVb+Pwx43IlcB9VKPW/U6WjNtl+FS7AZm9YoLg38CICzX0SsoIbs=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748455573; c=relaxed/simple;
bh=VRd1lkT9N5ACH+1BjDwXdFBCq75yta6YVidqEhnw3us=;
h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:
To:Cc:Content-Type; b=eIWU/4NhhI1XLInYLGaZIDXStoS4UVYBOe2+6FjNQVYqKCd8y34dQodgr0Cj7ziXUUxjHDWVgIev/pCg5aO5knoZb+kQdvzY8c0M/xkOMFI6nR5xWsWXT31FOlk0xV23QTZ7grHuzsTRuIwJau7xYx6MzYm+R2fSl+/L+nyuY2I=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=L5G4AwX9; arc=none smtp.client-ip=209.85.214.180
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org
Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-2349282084bso1860455ad.1
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 11:06:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=chromium.org; s=google; t=1748455571; x=1749060371; darn=vger.kernel.org;
h=cc:to:subject:message-id:date:from:in-reply-to:references
:mime-version:from:to:cc:subject:date:message-id:reply-to;
bh=V+fgzLhtoA+AV7JPQdrF/lZ8VWpagMNnkYPcAKrhW+k=;
b=L5G4AwX95c2PoEuPtyhKEiy2TDc7+q6vD69iWF6eZc7Tk5OCpGYmrU4P2RA/DN4Zuk
kLHXZRUlDd4RrpwXA3cHwdwHzNXDSsMLatXcF2/jCcNn0gKuSXxw2YI56Geo2maQkc+J
6VAwo3Osx3ZiT971UMGPvrBf06tGxNp3i5r2I=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1748455571; x=1749060371;
h=cc:to:subject:message-id:date:from:in-reply-to:references
:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to;
bh=V+fgzLhtoA+AV7JPQdrF/lZ8VWpagMNnkYPcAKrhW+k=;
b=cgj/iwPpLz2R3YVCpkF1iMbY8gQ8MWg0TuRV65uvhH6xgdh9+RzqEyxVTYFCWbMBBD
1lAvSg2novFyRSX2TKtc/tlahH2Wr7ptu/v6aUGm4W5nCzBI5h4yXgSCWElV5dSxYS67
eHiXRqNb82/QlTgvnf3s8vOztr9EOBkPPlJS8Jxl1TT1+DOw2Kf2UqHksJlTklicKSZg
DDRmHAvYBeGupvshz/e30FabUYqbFkFRiMyqqlwEtuPx86+q3hWg9WIhrinhZfF01iov
ItbpnZKwa/oObI4BObleKTH9GPiqrO/QFaj2za/HZeJPI51B6/fkrnhw+yK62J4j5Ale
baFg==
X-Forwarded-Encrypted: i=1; AJvYcCXMxlTAH1CQsUbO3RG1oW1GMGDlUeuiwA/QF1ZqOJ81EnGn6r85wcZJuESv+5c9005xcGe0nFhuzC6TZSw=@vger.kernel.org
X-Gm-Message-State: AOJu0YzfdlObW1q2RLVVkNFsu108jmDoSceaPyUjU1xCdzCWwYcytZ07
mFqAxCCSyUDomI1oQvsfHeALxXDnzAc8Mj+nQST4xsT1kydxuteOKsEjA0g/Xw+zNpQ55agCPpz
/TAVR/KXI
X-Gm-Gg: ASbGncvcWERUla4sFAyWujCCTqfqVQdnyNXEEsxSKsKlHo4i8PbvO6ztUP+T0m4+Jee
ZEH/1c1fpEWLZerZl2gKOKshwPS4JSONKqGr7XVpfhstEUjiA48iozCeYy8963uzdu+X1KSTUWi
VTt7kTDntTBvK3bS8glgBdbtXa3SHRsv+QX3Hn5/X5mE8T2uEtTzP3kMzkTx5zlKgriUyco9kTT
h5PLMYL6ASAJCVBl+grDum35QWbVNEwetKcUXvdCzOHYc+/LbQFvKtK3F3Jp0UJ5rqzECcKe1Li
ZrF+dTPGQbV599Wi5dQVs3gq3i80SJ05FV0rNcdgeX//eCklzTVUnscKIm/k+CDq9+awJKOSyXx
mNeBYzRQLVxGeLvbI2A==
X-Google-Smtp-Source: AGHT+IE0MbcL7TCwRAJqHBFLnBzuD7OWqOUxL6t6VrEH0kdYZvzZFqAYUKIm3J6LXZPT04e+9H+S+w==
X-Received: by 2002:a17:902:ecc3:b0:234:d7b2:2ab2 with SMTP id d9443c01a7336-234d7b22bb6mr35506185ad.8.1748455570906;
Wed, 28 May 2025 11:06:10 -0700 (PDT)
Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com. [209.85.215.170])
by smtp.gmail.com with ESMTPSA id d9443c01a7336-234d35ac75fsm14640865ad.167.2025.05.28.11.06.08
for <linux-kernel@xxxxxxxxxxxxxxx>
(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
Wed, 28 May 2025 11:06:08 -0700 (PDT)
Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-b2c40a7ca6eso149184a12.1
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 11:06:08 -0700 (PDT)
X-Forwarded-Encrypted: i=1; AJvYcCUbmyiYWSXxGmWLNkc35dE8DMPGgqITZE7kUh2JInu9DQTfnYOvivSracBKM/9g+7w9IY4SOabTthE/7Lg=@vger.kernel.org
X-Received: by 2002:a17:90b:1e11:b0:311:fde5:e224 with SMTP id
98e67ed59e1d1-311fde5e3a7mr2621369a91.6.1748455567945; Wed, 28 May 2025
11:06:07 -0700 (PDT)
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
References: <20250327-uvc-granpower-ng-v6-0-35a2357ff348@xxxxxxxxxxxx>
<20250327-uvc-granpower-ng-v6-5-35a2357ff348@xxxxxxxxxxxx>
<64c00146-e6d2-448d-a416-19d5ae7ae3f6@xxxxxxxxxxxx> <CANiDSCvM_V0Pv+cxd31AwcXjG-etJ3imsDYfRb7W2t0NKT67OA@xxxxxxxxxxxxxx>
In-Reply-To: <CANiDSCvM_V0Pv+cxd31AwcXjG-etJ3imsDYfRb7W2t0NKT67OA@xxxxxxxxxxxxxx>
From: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
Date: Wed, 28 May 2025 20:05:50 +0200
X-Gmail-Original-Message-ID: <CANiDSCv6vb=o-gizVr33XX2sVfBookaze2S1hkzshUyNNnzTbw@xxxxxxxxxxxxxx>
X-Gm-Features: AX0GCFtPgVMd2juZVahO7Uk3bU64vKS_xa1UhEfT0crKE5AC7K-BWl6NWKkoiUE
Message-ID: <CANiDSCv6vb=o-gizVr33XX2sVfBookaze2S1hkzshUyNNnzTbw@xxxxxxxxxxxxxx>
Subject: Re: [PATCH v6 5/5] media: uvcvideo: Do not turn on the camera for
some ioctls
To: Hans Verkuil <hans@xxxxxxxxxxxx>
Cc: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>, Hans de Goede <hdegoede@xxxxxxxxxx>,
Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>,
Guennadi Liakhovetski <guennadi.liakhovetski@xxxxxxxxx>, linux-media@xxxxxxxxxxxxxxx,
linux-kernel@xxxxxxxxxxxxxxx,
Mauro Carvalho Chehab <mchehab+samsung@xxxxxxxxxx>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Status: No, score=-6.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,
MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
On Fri, 9 May 2025 at 15:51, Ricardo Ribalda <ribalda@xxxxxxxxxxxx> wrote:
Hi Hans
On Fri, 9 May 2025 at 15:44, Hans Verkuil <hans@xxxxxxxxxxxx> wrote:
>
> On 27/03/2025 22:05, Ricardo Ribalda wrote:
> > There are some ioctls that do not need to turn on the camera. Do not
> > call uvc_pm_get in those cases.
> >
> > Reviewed-by: Hans de Goede <hdegoede@xxxxxxxxxx>
> > Reviewed-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
> > Signed-off-by: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
> > ---
> > drivers/media/usb/uvc/uvc_v4l2.c | 20 ++++++++++++++++++++
> > 1 file changed, 20 insertions(+)
> >
> > diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
> > index 0f1ed0387b2611c8d21e211afe21a35101071d93..668a4e9d772c6d91f045ca75e2744b3a6c69da6b 100644
> > --- a/drivers/media/usb/uvc/uvc_v4l2.c
> > +++ b/drivers/media/usb/uvc/uvc_v4l2.c
> > @@ -1440,6 +1440,26 @@ static long uvc_v4l2_unlocked_ioctl(struct file *file,
> > struct uvc_fh *handle = file->private_data;
> > int ret;
> >
> > + /* The following IOCTLs do not need to turn on the camera. */
> > + switch (cmd) {
> > + case VIDIOC_CREATE_BUFS:
> > + case VIDIOC_DQBUF:
> > + case VIDIOC_ENUM_FMT:
> > + case VIDIOC_ENUM_FRAMEINTERVALS:
> > + case VIDIOC_ENUM_FRAMESIZES:
> > + case VIDIOC_ENUMINPUT:
> > + case VIDIOC_EXPBUF:
> > + case VIDIOC_G_FMT:
> > + case VIDIOC_G_PARM:
> > + case VIDIOC_G_SELECTION:
> > + case VIDIOC_QBUF:
> > + case VIDIOC_QUERYCAP:
> > + case VIDIOC_REQBUFS:
> > + case VIDIOC_SUBSCRIBE_EVENT:
> > + case VIDIOC_UNSUBSCRIBE_EVENT:
>
> Wouldn't it be better to check against the ioctls that DO need to turn on the camera?
I thought it was safer this way. I will look into inverting the logic
in a follow-up patch.
https://patchwork.linuxtv.org/project/linux-media/list/?series=15601
Regards!
>
> That is more future proof IMHO.
>
> If a new ioctl is created, and uvc implements it and that needs to turn on the camera,
> then presumably you will realize that when you add that ioctl in uvc.
>
> If a new ioctl is created and uvc does not need to turn on the camera, then you will
> almost certainly forget to add it to this list.
>
> I'm not blocking this patch, but I think it will be hard to keep this list up to date.
> Inverting the test is probably much easier to handle in the future.
>
> Apologies if this has been discussed before, if so, just point to that discussion so I
> can read through it.
>
> Regards,
>
> Hans
>
> > + return video_ioctl2(file, cmd, arg);
> > + }
> > +
> > ret = uvc_pm_get(handle->stream->dev);
> > if (ret)
> > return ret;
> >
>
--
Ricardo Ribalda
--
Ricardo Ribalda
Return-Path: <linux-kernel+bounces-665940-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id D5AAA41E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:06:34 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by ny.mirrors.kernel.org (Postfix) with ESMTPS id EBF1F1689B8
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:06:35 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 8E87A28E561;
Wed, 28 May 2025 18:06:24 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tPYy9JI5"
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201])
(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 C495A111AD;
Wed, 28 May 2025 18:06:23 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748455583; cv=none; b=I0DGH0oUwC1vztlYifPcbYUt01UWgFUhWO0lYSvFauvVcepyABr5b9HkeZxl2mrBn7a1HJ225327sUr1YIeebrjPN16r38CSvV495uztzvANfLUD1zZtLiwQSBfXzyn8/QwBZriUDLEy0K1gZ+6HodII5PK0QjnjHHM/yY2nNvk=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748455583; c=relaxed/simple;
bh=SwYQFIc7r2JHQ2hnmDJnXLD9YNcIS11EmU+W4n5WpnE=;
h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
Content-Type:Content-Disposition:In-Reply-To; b=ioTWUxN7Qflcgv4wD+BORdChkgsBa0Ung05XWhUbr3OR8AE2Tt7c7XqcXM5XOeZLXioqcR2bXnNItVxzG7L3JPESpwSKEjloUjTHs44x6SzMNhvoaRALzqnZcbKR7fVSI2UkHwzi6M5Gi1x5tG0dCCMSts9CmSlT5oXnMkcCHtM=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tPYy9JI5; arc=none smtp.client-ip=10.30.226.201
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35DC1C4CEE3;
Wed, 28 May 2025 18:06:19 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
s=k20201202; t=1748455583;
bh=SwYQFIc7r2JHQ2hnmDJnXLD9YNcIS11EmU+W4n5WpnE=;
h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
b=tPYy9JI5+Gq5oIXon40EQ7pZd9jgDOyyAG7rfA1wIsXVU6Qg1E7TFYs9rekn7ijcZ
czdAEjOqRjbCaQC5a1Zf4ZXBhNSpGOM39Oj+BUsp0Ckgzc7oP4wjVoJpmhgSzBO8UY
5oUxUni4HiriTQY9fnXq7QAo5h55D801ScHz80ztdfprIIDTx7TDfUn9rwRHrCdzi+
ysZHBygnTEMVto2mSjV+I5Ulb/YBHAebj1cxrloW8JxHyYDno1597lDZ496iqVPqrU
ZtE5dX013juINIBqTO3C/BtjYmsX30k0MKDhpZ0Hec8EXu8wiVsfefoMfdmdpninH4
pmAXzwCsHDwEQ==
Date: Wed, 28 May 2025 20:06:16 +0200
From: Danilo Krummrich <dakr@xxxxxxxxxx>
To: Daniel Almeida <daniel.almeida@xxxxxxxxxxxxx>
Cc: Miguel Ojeda <ojeda@xxxxxxxxxx>, Alex Gaynor <alex.gaynor@xxxxxxxxx>,
Boqun Feng <boqun.feng@xxxxxxxxx>, Gary Guo <gary@xxxxxxxxxxx>,
=?iso-8859-1?Q?Bj=F6rn?= Roy Baron <bjorn3_gh@xxxxxxxxxxxxxx>,
Benno Lossin <benno.lossin@xxxxxxxxx>,
Andreas Hindborg <a.hindborg@xxxxxxxxxx>,
Alice Ryhl <aliceryhl@xxxxxxxxxx>, Trevor Gross <tmgross@xxxxxxxxx>,
Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>,
"Rafael J. Wysocki" <rafael@xxxxxxxxxx>,
Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>,
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>,
Ilpo =?iso-8859-1?Q?J=E4rvinen?= <ilpo.jarvinen@xxxxxxxxxxxxxxx>,
Bjorn Helgaas <bhelgaas@xxxxxxxxxx>,
Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>,
Ying Huang <huang.ying.caritas@xxxxxxxxx>,
linux-kernel@xxxxxxxxxxxxxxx, rust-for-linux@xxxxxxxxxxxxxxx
Subject: Re: [PATCH v8 3/3] rust: platform: allow ioremap of platform
resources
Message-ID: <aDdQmJ-pen_MQNDB@cassiopeiae>
References: <20250509-topics-tyr-platform_iomem-v8-0-e9f1725a40da@xxxxxxxxxxxxx>
<20250509-topics-tyr-platform_iomem-v8-3-e9f1725a40da@xxxxxxxxxxxxx>
<aCYVG-VVdJXYnSTt@pollux>
<5B875DFB-D655-4BAC-A475-43AE309520E2@xxxxxxxxxxxxx>
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <5B875DFB-D655-4BAC-A475-43AE309520E2@xxxxxxxxxxxxx>
X-Spam-Status: No, score=-6.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,
RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,
RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
On Wed, May 28, 2025 at 02:29:44PM -0300, Daniel Almeida wrote:
Hi Danilo,
[…]
>
>> + /// let offset = 0; // Some offset.
>> + ///
>> + /// // If the size is known at compile time, use `ioremap_resource_sized`.
>> + /// // No runtime checks will apply when reading and writing.
>> + /// let resource = pdev.resource(0).ok_or(ENODEV)?;
>> + /// let iomem = pdev.ioremap_resource_sized::<42>(&resource)?;
>> + ///
>> + /// // Read and write a 32-bit value at `offset`. Calling `try_access()` on
>> + /// // the `Devres` makes sure that the resource is still valid.
>> + /// let data = iomem.try_access().ok_or(ENODEV)?.read32_relaxed(offset);
>> + ///
>> + /// iomem.try_access().ok_or(ENODEV)?.write32_relaxed(data, offset);
>
> Since this won't land for v6.16, can you please use Devres::access() [1]
> instead? I.e.
>
> let iomem = pdev.ioremap_resource_sized::<42>(&resource)?;
> let io = Devres::access(pdev.as_ref())?;
>
> let data = io.read32_relaxed(offset);
> io.write32_relaxed(data, offset);
>
> Devres::access() is in nova-next and lands in v6.16.
>
> [1] https://gitlab.freedesktop.org/drm/nova/-/commit/f301cb978c068faa8fcd630be2cb317a2d0ec063
Devres:access takes &Device<Bound>, but the argument in probe() is
&Device<Core>.
Are these two types supposed to convert between them? I see no explicit
function to do so.
Yes, it comes from impl_device_context_deref!() [1], which, as the name implies,
implements the corresponding Deref traits.
Device dereference in the following way:
&Device<Core> -> &Device<Bound> -> &Device (i.e. &Device<Normal>)
You can just pass in the &Device<Core>, it will work.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git/tree/rust/kernel/device.rs?h=driver-core-next#n284
Return-Path: <linux-kernel+bounces-665941-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id E373A41E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:07:15 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by ny.mirrors.kernel.org (Postfix) with ESMTPS id 2FCD616503A
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:07:17 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 00875283C8E;
Wed, 28 May 2025 18:07:09 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ekUJQKQe"
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201])
(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 3519BEAD7;
Wed, 28 May 2025 18:07:07 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748455628; cv=none; b=KGxaJJg8tcceSz+8qWu+LHu+oPEdYPhWGB4GNnQ+qufIMWN+r2qzQOokIyCcZ7AcKZj69K5uFxIgR1Vkq4asLMbjBtPNKpCLOP8Atxtzmp7DjVc/ivFNTO/gc2IiHxYfNGrdCPZInjH0Fqqyu88RdSHnES6JYPQhqo8+XkDzU0M=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748455628; c=relaxed/simple;
bh=n1jaTc09zu8RAZsHSVnrZVQ4yyD+khqHCH7iV6CHfjs=;
h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
Content-Type:Content-Disposition:In-Reply-To; b=n7+Z73ty+0Oh3ZuYxIG5lRBWwvJ4H8O+eaVfAqVyViL3IfzqJXXpqPs9UmyYHozb7Z+wC2Wv3cq45roLHuF/YMUKbiwmyDJI3iymYhd/gPT1wCK0Vkl2CqS7EZ7dmVqW7bzIfWIY4VcB5FZdhG82bnB3RH0//tXRNedBSegFbjE=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ekUJQKQe; arc=none smtp.client-ip=10.30.226.201
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D0B2C4CEE3;
Wed, 28 May 2025 18:07:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
s=k20201202; t=1748455627;
bh=n1jaTc09zu8RAZsHSVnrZVQ4yyD+khqHCH7iV6CHfjs=;
h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
b=ekUJQKQeHM9EXOmJDZydfKsoPIxDQlvT/v1hThSkSO1n/k8/Hz41baXXpT0UPNkBj
ir2dVwEiQFVDpxsE3Oyo45sg0WzDKtcz08smQ+jY6UTcB7mbGllcbIdLaZF0Iy7dqm
v3S/dDhnzVwogBjmawhVnyjJauRuiOE7MNY0W0ocZQxSWdiMijoAy3+NkfHWcrKNww
9xZ3cEgmvWrS4qJw2BCENWZCIH8z1wxf9f6KvwrAZPm8MRNOmJDdIIdOiEmGvvMUI3
8YREgHo5xu+oVEvEt9hC8NtlTZwjx8U+TVxN7JHzL2XULvFZ9bXfNw77WbwXYiWBU7
5ES1rAmz04/Uw==
Date: Wed, 28 May 2025 15:07:04 -0300
From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
To: Suchit Karunakaran <suchitkarunakaran@xxxxxxxxx>
Cc: Yicong Yang <yangyicong@xxxxxxxxxxxxx>,
Jonathan Cameron <jonathan.cameron@xxxxxxxxxx>,
Junhao He <hejunhao3@xxxxxxxxxx>,
Mark Rutland <mark.rutland@xxxxxxx>,
Peter Zijlstra <peterz@xxxxxxxxxxxxx>,
Shameerali Kolothum Thodi <shameerali.kolothum.thodi@xxxxxxxxxx>,
Ingo Molnar <mingo@xxxxxxxxxx>, Namhyung Kim <namhyung@xxxxxxxxxx>,
alexander.shishkin@xxxxxxxxxxxxxxx,
linux-perf-users@xxxxxxxxxxxxxxx,
linux-kernel-mentees@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx,
skhan@xxxxxxxxxxxxxxxxxxx
Subject: Re: [PATCH RESEND] perf stat: Fix JSON output formatting in
iostat_prefix()
Message-ID: <aDdQyPNrnd4b-qWg@x1>
References: <20250520094525.97706-1-suchitkarunakaran@xxxxxxxxx>
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20250520094525.97706-1-suchitkarunakaran@xxxxxxxxx>
X-Spam-Status: No, score=-6.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,
RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,
RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
On Tue, May 20, 2025 at 03:15:25PM +0530, Suchit Karunakaran wrote:
The iostat_prefix() function previously included a TODO noting that its output
format was incorrect in JSON mode. This patch corrects that by conditionally
formatting the prefix string based on the output mode specified in
perf_stat_config.
O don't have how to test this as I dont have:
access("/sys/bus/event_source/devices/uncore_iio_0", F_OK) = -1 ENOENT (No such file or directory)
write(2, ""..., 37Unsupported uncore pmu configuration
) = 37
write(2, ""..., 43
Usage: perf stat [<options>] [<command>]
) = 43
write(2, ""..., 1
<SNIP>
write(2, ""..., 84 measure I/O performance metrics provided by arch/platform
) = 84
exit_group(129) = ?
+++ exited with 129 +++
root@x1:~# strace -s0 perf stat --iostat --timeout 1000
Could someone with access to hardware with this capability to try this
patch and provide a Tested-by?
- Arnaldo
Signed-off-by: Suchit Karunakaran <suchitkarunakaran@xxxxxxxxx>
---
tools/perf/arch/x86/util/iostat.c | 35 ++++++++++++++++++++-----------
1 file changed, 23 insertions(+), 12 deletions(-)
diff --git a/tools/perf/arch/x86/util/iostat.c b/tools/perf/arch/x86/util/iostat.c
index 7442a2cd87ed..1d9c20dab5c7 100644
--- a/tools/perf/arch/x86/util/iostat.c
+++ b/tools/perf/arch/x86/util/iostat.c
@@ -403,18 +403,29 @@ void iostat_prefix(struct evlist *evlist,
struct iio_root_port *rp = evlist->selected->priv;
if (rp) {
- /*
- * TODO: This is the incorrect format in JSON mode.
- * See prepare_timestamp()
- */
- if (ts)
- sprintf(prefix, "%6lu.%09lu%s%04x:%02x%s",
- ts->tv_sec, ts->tv_nsec,
- config->csv_sep, rp->domain, rp->bus,
- config->csv_sep);
- else
- sprintf(prefix, "%04x:%02x%s", rp->domain, rp->bus,
- config->csv_sep);
+ if (ts) {
+ if (config->json_output)
+ sprintf(prefix,
+ "\"interval\" : %lu.%09lu, \"device\" : \"%04x:%02x\"",
+ (unsigned long)ts->tv_sec, ts->tv_nsec,
+ rp->domain, rp->bus);
+ else if (config->csv_output)
+ sprintf(prefix, "%lu.%09lu%s%04x:%02x%s",
+ (unsigned long)ts->tv_sec, ts->tv_nsec,
+ config->csv_sep,
+ rp->domain, rp->bus, config->csv_sep);
+ else
+ sprintf(prefix, "%6lu.%09lu %04x:%02x%s",
+ (unsigned long)ts->tv_sec, ts->tv_nsec,
+ rp->domain, rp->bus, config->csv_sep);
+ } else {
+ if (config->json_output)
+ sprintf(prefix, "\"device\" : \"%04x:%02x\"",
+ rp->domain, rp->bus);
+ else
+ sprintf(prefix, "%04x:%02x%s", rp->domain,
+ rp->bus, config->csv_sep);
+ }
}
}
--
2.49.0
Return-Path: <linux-kernel+bounces-665942-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 7502941E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:08:22 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by ny.mirrors.kernel.org (Postfix) with ESMTPS id CF2954E1A08
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:08:20 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id B7E1B28E57F;
Wed, 28 May 2025 18:08:13 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="qhLpHU6k"
Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2082.outbound.protection.outlook.com [40.107.92.82])
(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 33629288527;
Wed, 28 May 2025 18:08:09 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.82
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748455692; cv=fail; b=uowdvWcWfDJxxtR3B4XcC4VROZaGaFFDpOUhKGa0KXUwISXicEfHMEzSYBufKpw1Wy/VKFoE99eZTigpSnxA9M3ikFHu90iOwQGoriuivypQewgYtbr9XjjOC5aagiWmbqITaPUbSsZPRsZjd4ZP3daNgxU5FbjULAQ7pQ6ipS8=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748455692; c=relaxed/simple;
bh=eeIosDLclYUwj28PrLn1VzvdyT1Imu1N0BnQ0+n0w4w=;
h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version:
Content-Type:Content-Disposition:In-Reply-To; b=kVUivaRxFVBqRNCjKVRvdEpzG9MAM9v1RjLT6hnsNBuh835Zij8dYu/vXzqrSRg8AEl1ULV/E09jlK+iQzzVXQehIgSJqjW037RqQAWVHbEBQ2ozXOfmysptUYrxHQTjjbQJ08Bk0KzcMjxs2Qwd04tBnTgXDaLzBUMlpUcYVBA=
ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=qhLpHU6k; arc=fail smtp.client-ip=40.107.92.82
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com
Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
b=Rzw/yeEEv/sjitQMPUz556j3OtzS7QO2eIfaAMBXYUcyGktqbvwMPuHR5nqluzQsDqp36M9PJdKHUJk9XvY4KjGxJ2K4yPjiVlIgWUcvcwEPlAma82d5dx3xfz5dKSIcW+PcBtOyIbZccD8v14J+gubK9ES6VR6mciYRwWS1wyfmvfc1eBeiFVDCfFDZL/NjF3pUzCcTB9HKnK0qmYu5AD0Jf/PZnCDNMicYoo8uzRkyENI2FjcYp1vHL+KQ8ntEJRXAHQtAaTgPcvefTFDodYcFz5qmyG82vcD0z7ohslxNvelSOrRm6vuoCMYqBeso6VvUZeI8TeY1VOmijVH2Fg==
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=eeIosDLclYUwj28PrLn1VzvdyT1Imu1N0BnQ0+n0w4w=;
b=TkUb60iYmUgepHbc2qiMQY1z6t/DB2yZ8s6Ch7fZf3NU5yJERZrPCStB8YFvRgDz9y8x4rgWaZcueapMDuoTsiS2HupDj6MBCq50WM+8gWCUeWCyxk83oDqgYbrnR1v9ArxzVljJEqRepkogBGbQg8ihJGeNwFL75tAEvp3FK8tc1DWkTZeiIyexjlNdY5jk9O7lzlyk3OOcdQS+FXqJG9rfd7E4AbLjUWLfkO/T/PFbrrGeUhH+CLq5PkmJ4Iad6RCvFFKG4Rr6sxjVWRgb/r4+iCFCwWZnrRYph4Hs4wGTm1RWaT8KGV3woljwZbCS7DlNxFTItJBLLsRj6HGSdg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
216.228.117.160) smtp.rcpttodomain=amd.com smtp.mailfrom=nvidia.com;
dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com;
dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;
s=selector2;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=eeIosDLclYUwj28PrLn1VzvdyT1Imu1N0BnQ0+n0w4w=;
b=qhLpHU6kfeaA66twVqbbHtE8zh3ZWGs1eiaNU8X5S1Lf3Kp/CcP3Xm/MbN/msrhqIT8kgeYQVtiQr44Ap/l+VzSQL6taiwpXSoLSP2bqcv8KAn+YfzeayxrKoxcOZoWW8sOwspFEBYExiWctyo2nH4qDRg2WZNCf+fSKu5S+vkNNlP9rbMOk5fZMWxgPL2Lv0SuHnbX9mYcq2ahAlxQkfd9to4SK9Bb45V0UCnDIBH15yCLxGDPmo7JX7+y6WmlRt/JZTTyE6WE1sOwcd8MkJPTNXa9OFXtkqRoLziKm5+PYGZtTQSAjAnhtcSFBBFq6U0k5G5AoxfZrDKj1nDgCTQ==
Received: from BL0PR02CA0032.namprd02.prod.outlook.com (2603:10b6:207:3c::45)
by MW3PR12MB4492.namprd12.prod.outlook.com (2603:10b6:303:57::10) with
Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8769.26; Wed, 28 May
2025 18:08:06 +0000
Received: from MN1PEPF0000ECD4.namprd02.prod.outlook.com
(2603:10b6:207:3c:cafe::87) by BL0PR02CA0032.outlook.office365.com
(2603:10b6:207:3c::45) with Microsoft SMTP Server (version=TLS1_3,
cipher=TLS_AES_256_GCM_SHA384) id 15.20.8769.18 via Frontend Transport; Wed,
28 May 2025 18:08:06 +0000
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160)
smtp.mailfrom=nvidia.com; dkim=none (message not signed)
header.d=none;dmarc=pass action=none header.from=nvidia.com;
Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates
216.228.117.160 as permitted sender) receiver=protection.outlook.com;
client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C
Received: from mail.nvidia.com (216.228.117.160) by
MN1PEPF0000ECD4.mail.protection.outlook.com (10.167.242.132) with Microsoft
SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
15.20.8769.18 via Frontend Transport; Wed, 28 May 2025 18:08:05 +0000
Received: from rnnvmail202.nvidia.com (10.129.68.7) by mail.nvidia.com
(10.129.200.66) with Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 28 May
2025 11:07:48 -0700
Received: from rnnvmail202.nvidia.com (10.129.68.7) by rnnvmail202.nvidia.com
(10.129.68.7) with Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Wed, 28 May
2025 11:07:47 -0700
Received: from Asurada-Nvidia (10.127.8.11) by mail.nvidia.com (10.129.68.7)
with Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14 via Frontend
Transport; Wed, 28 May 2025 11:07:45 -0700
Date: Wed, 28 May 2025 11:07:43 -0700
From: Nicolin Chen <nicolinc@xxxxxxxxxx>
To: Jason Gunthorpe <jgg@xxxxxxxxxx>
CC: <kevin.tian@xxxxxxxxx>, <corbet@xxxxxxx>, <will@xxxxxxxxxx>,
<bagasdotme@xxxxxxxxx>, <robin.murphy@xxxxxxx>, <joro@xxxxxxxxxx>,
<thierry.reding@xxxxxxxxx>, <vdumpa@xxxxxxxxxx>, <jonathanh@xxxxxxxxxx>,
<shuah@xxxxxxxxxx>, <jsnitsel@xxxxxxxxxx>, <nathan@xxxxxxxxxx>,
<peterz@xxxxxxxxxxxxx>, <yi.l.liu@xxxxxxxxx>, <mshavit@xxxxxxxxxx>,
<praan@xxxxxxxxxx>, <zhangzekun11@xxxxxxxxxx>, <iommu@xxxxxxxxxxxxxxx>,
<linux-doc@xxxxxxxxxxxxxxx>, <linux-kernel@xxxxxxxxxxxxxxx>,
<linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, <linux-tegra@xxxxxxxxxxxxxxx>,
<linux-kselftest@xxxxxxxxxxxxxxx>, <patches@xxxxxxxxxxxxxxx>,
<mochs@xxxxxxxxxx>, <alok.a.tiwari@xxxxxxxxxx>, <vasant.hegde@xxxxxxx>,
<dwmw2@xxxxxxxxxxxxx>, <baolu.lu@xxxxxxxxxxxxxxx>
Subject: Re: [PATCH v5 09/29] iommufd: Do not unmap an owned iopt_area
Message-ID: <aDdQ78ZPXexJILR4@Asurada-Nvidia>
References: <cover.1747537752.git.nicolinc@xxxxxxxxxx>
<3ddc8c678406772a8358a265912bb1c064f4c796.1747537752.git.nicolinc@xxxxxxxxxx>
<20250528170845.GX61950@xxxxxxxxxx>
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20250528170845.GX61950@xxxxxxxxxx>
X-NV-OnPremToCloud: AnonymousSubmission
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECD4:EE_|MW3PR12MB4492:EE_
X-MS-Office365-Filtering-Correlation-Id: 5f56261f-7834-4720-4a06-08dd9e12986d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
BCL:0;ARA:13230040|376014|7416014|82310400026|36860700013|1800799024;
X-Microsoft-Antispam-Message-Info:
=?us-ascii?Q?9QluxvScCz268DfQKpx8VYZgKsh1SOdQYMODK7V35DTz0RL7sap/zwxqoASF?=
=?us-ascii?Q?Z5q7R58RcMrQf8ouLcwCTGogjZiQhDWNDtGi/TDwTasMxkJJ4IOoUlUPCDlN?=
=?us-ascii?Q?JmpVhxGmDaDly8fiH+NhsnugpStnIsPKNLd72SWcpOG3EbT7GDOCjYLBh7RT?=
=?us-ascii?Q?qngzokrsSqct0zRidQ7iJ1IpaqNjB0X2jrjVlRB8tAZchtmk8NWCQhFkEQVh?=
=?us-ascii?Q?cETW/BYkDj4Lb1OOM20Otva1PB/ZgsDSFwHBIOEe26kU1gLQ44oT9qhKbui5?=
=?us-ascii?Q?tz/gkqeCVHZDlhUsbGHqkaAvW+oZmicnqmf9jeWmeMG9ywtDAQ/eFlkjsVJU?=
=?us-ascii?Q?426tH+72zJfTFa4+L668/3Ax51t5aa/kVBMVryYiyifP7B86l1UIKusMCrXf?=
=?us-ascii?Q?FED6t5akBEUfQOA89nUefNKQU7dYcgRD6WQor8nPNuN7Ui2yiYZ7207aR2m8?=
=?us-ascii?Q?DpVjM4eqXgPIdD027JYJY3dP/rqDudBN68YSgkj+1clR7Nmi2RUccpFr/772?=
=?us-ascii?Q?TiP/pI/DNs+S8VqO09dww1s6W2ehqbnJN475lfD4zwWrXQZPNAPE3Rl0j44f?=
=?us-ascii?Q?e1P/mkx/v6Fbnp7GOnVgEFOqMU2rEGNAvog44Vjj7rYTLnndfeXbgqX6Xtws?=
=?us-ascii?Q?7VkDAQem7QOCDaHvmiKeGOVNjj43fVJQcby6TlTjXviEniN3GdWwSQkyLKni?=
=?us-ascii?Q?cftF7+VkVUAmzK6AfYVrN9m0m0slfbOLD+y6WeOqHl2CaI12hqKLfJjME2T/?=
=?us-ascii?Q?D8jvktDbVS0l40Tb0cJ42Vc+a2gEc6Qxz5canOHcgG1HZnrcns7s0QiXy53i?=
=?us-ascii?Q?KaphKi3WcJNiyu7tUV/UtzbvvcxsdRUZFrnkM/ftVlFOrE9Cjgh12J28qK8w?=
=?us-ascii?Q?ec3YQttiQOisI+gz7gM07Qc24ZpdVZFqckUVyeN5PvoshMTXRSMCGf7ZE2dZ?=
=?us-ascii?Q?7Oos5NfiS6QnxxIjjolZe86awPEEJiwyrn6NbCTX5l/+Ygvm6/YHJJ+n/LWg?=
=?us-ascii?Q?kavc9r9za7aVCdK1rUaAkt+5WQcZYbZf+KnsFmlvstTgRmfHgpCnGvl0nQDN?=
=?us-ascii?Q?6Wuryhjk5vfxbL/r3Et1+jbve+H3fAT6UeCABzWLA/q27FrMFeEOqzOgNQSr?=
=?us-ascii?Q?tOeTeFuYuz6rqXD7ULxdATDdtiAGL7Fqm/ydWzjKgCG2S3coGtOgca3FaX5/?=
=?us-ascii?Q?1m4ppVletNcsRRuZyxxPNDZE4D3Tm8u5rZTZv8Z8DFIuKYexkucKEHzEw879?=
=?us-ascii?Q?d01tLqRL6Nfkc3wXmbUS96l+VahOv6HIGRVzk79W+QHSjd06VxkWBIdz1ik6?=
=?us-ascii?Q?Uf9fV2a3Mio4M2T3/PqiAfxtNk2PpusxGngfbEiBsFd4AdVOFHcn/yutHfiG?=
=?us-ascii?Q?aAlu8nnz2E+cALpU+HeHgr7N+R4EwQpjqagek+7X8aMjn9mwpQ/1vuTAsssb?=
=?us-ascii?Q?kPKrQA6j3ClyrkQIap1EcUz1l78ad06TnKzurTXvTdVAqlXCFZUNaMm7w4yj?=
=?us-ascii?Q?dWbfFvFuCmxGccl7bPX/5wBO8myRxnnLth+S?=
X-Forefront-Antispam-Report:
CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(376014)(7416014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: Nvidia.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2025 18:08:05.8391
(UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 5f56261f-7834-4720-4a06-08dd9e12986d
X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com]
X-MS-Exchange-CrossTenant-AuthSource:
MN1PEPF0000ECD4.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4492
X-Spam-Status: No, score=-6.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,
MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
On Wed, May 28, 2025 at 02:08:45PM -0300, Jason Gunthorpe wrote:
Fundamentally this is supporting accesses that don't have an unmap op
callback.
Ah, I see.
It could be done differently, with the below just create your access
with a null ops. Prevent mdev drivers from doing this when they create
their accesses. We don't need to optimize this failure case so it is
fine to scan the xarray. All we really need to do here is eliminate
the WARN_ON.
Yes. That approach looks much cleaner.
Will replace the iopt_pin_pages patch.
Thanks
Nicolin
Return-Path: <linux-kernel+bounces-665943-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [139.178.88.99])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 3521441E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:08:30 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5300AA22376
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:08:07 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 89C1428E5E6;
Wed, 28 May 2025 18:08:15 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="ALGUjlWf"
Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1])
(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 3BFA928E573;
Wed, 28 May 2025 18:08:12 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748455694; cv=none; b=f5PA+OLy62+62KXtB5qswl1iUEiaEC2axUPQuGPCo559viB3OhAZIjoGDt1IFkmMkj5umWiEo/RiYjmQHB24e24GRbinMfbyS/7pmTflti53+Nl3MGexvqSPJX7roClKeLi6kVyAFOdXfmm+6kxtvjc8QBo5SjZn3lbNnHg6L1I=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748455694; c=relaxed/simple;
bh=n7qvY25wzU4LBN1V7seQQRsvaX0gcd8CSYPUS3iqD3U=;
h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
Content-Type:Content-Disposition:In-Reply-To; b=m/6u/d5kL5nSGjwT6keTspB2+KKK2RbQF7sWzA2IDr3kR1DJdpxriJ6eAlXAM6AjUr4mhsg4Rh1ssgYvEGDYljkqextnwI7yWAk7gzSKkTJvyw7OUuZ32PIp+V4zk2pogRofmt7MnoGuEQdBsfD0WJMlqnQh7kMuphD0h3iLTro=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=ALGUjlWf; arc=none smtp.client-ip=148.163.156.1
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com
Received: from pps.filterd (m0356517.ppops.net [127.0.0.1])
by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 54SE9Zie032044;
Wed, 28 May 2025 18:08:08 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc
:content-transfer-encoding:content-type:date:from:in-reply-to
:message-id:mime-version:references:subject:to; s=pp1; bh=SXk6xY
TCJrBiRraj2g3E97hdrA+qVzMbgY3MR8FW4gA=; b=ALGUjlWf8ERxczbOOQZIIQ
uhjC1OUxMQqHGYtb834u0O1o5EmvANTZ5SEa3j3gTbwhkhcUxi1p+FMDpfIEI9u+
dLiZhvmjX4ZR+AJoZhTS1+jOyISg9m9xQ/BlBbwcEJyJXgKVxnQPNFh6QKRj1bpQ
fPqP0WvE0RM8xKeNFDWLCz48+nJ8zOtnywSQW0KAE7odQODAd9crtauRn3H4VNH1
ihAFDdT4sNyUrbt+hLPeGs8KKB59XXTuKljd7TBZF+Xvl1yxkjXgkYyvIVcxau4r
RuqZTlTp1UlZXxGCJcYcAGE8zuwD2uUjcRHhhjRzAVSddq69oFhulqcpr8Fkcf4A
==
Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219])
by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 46x40js81e-1
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
Wed, 28 May 2025 18:08:08 +0000 (GMT)
Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1])
by ppma11.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 54SElXZt015798;
Wed, 28 May 2025 18:08:07 GMT
Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226])
by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 46uu538d9w-1
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
Wed, 28 May 2025 18:08:07 +0000
Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106])
by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 54SI85np34013522
(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
Wed, 28 May 2025 18:08:05 GMT
Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1])
by IMSVA (Postfix) with ESMTP id 6266D20040;
Wed, 28 May 2025 18:08:05 +0000 (GMT)
Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1])
by IMSVA (Postfix) with ESMTP id 6A93D20043;
Wed, 28 May 2025 18:08:03 +0000 (GMT)
Received: from linux.ibm.com (unknown [9.124.209.136])
by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTPS;
Wed, 28 May 2025 18:08:03 +0000 (GMT)
Date: Wed, 28 May 2025 23:38:00 +0530
From: Vishal Chourasia <vishalc@xxxxxxxxxxxxx>
To: Michal =?iso-8859-1?Q?Koutn=FD?= <mkoutny@xxxxxxxx>
Cc: Tejun Heo <tj@xxxxxxxxxx>, Johannes Weiner <hannes@xxxxxxxxxxx>,
Jonathan Corbet <corbet@xxxxxxx>, cgroups@xxxxxxxxxxxxxxx,
linux-doc@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
Subject: Re: [PATCH] Documentation: cgroup: clarify controller enabling
semantics
Message-ID: <aDdRAFMFY5hI2uNn@xxxxxxxxxxxxx>
References: <20250527085335.256045-2-vishalc@xxxxxxxxxxxxx>
<vzdrzqphpjnvrfynx7ajdrgfraavebig4edipde3kulxp2euqh@7p32zx7ql6k6>
<aDcNLTA2JfoLXdIM@xxxxxxxxxxxxx>
<bdstku24kbgj2oalpbzw62uohq7centgaz7fbeatnuymjr2qct@gp2vah7mumk3>
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <bdstku24kbgj2oalpbzw62uohq7centgaz7fbeatnuymjr2qct@gp2vah7mumk3>
X-TM-AS-GCONF: 00
X-Authority-Analysis: v=2.4 cv=SdL3duRu c=1 sm=1 tr=0 ts=68375108 cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=8nJEP1OIZ-IA:10 a=dt9VzEwgFbYA:10 a=KSb9T-wMAAAA:8 a=VnNF1IyMAAAA:8 a=fKiKOXW4520yZCUzCKYA:9 a=3ZKOabzyN94A:10
a=wPNLvfGTeEIA:10 a=KF4VuIdXkMyp4E_ug72i:22
X-Proofpoint-GUID: yBv1QbkSCPABfv32Vs5UbabjPFZrMY4Q
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTI4MDE1NyBTYWx0ZWRfX7Y0ha3Ip/EK0 r7HpOSWDq3b/bM7Q0Y/81nx88O+SoPRF8urRF9BZY6He6lTjOeOVBAOIWCNjsa39ExQbwoyvjgu WJP71cjwVZ1/hTvOgQ9wc0KvlacFG+63mDojoNcYMc1bYqqTPc0jL94+O8t+Tux1uNgcuY53Qlh
Shym0lz+BISWiNk3XkJpsg0KFbRHlknMTFCfbEzMlR6TZWN9FXNYPr0GuF+sOFuqmauMz29Vv72 wFqBb59h1ABSr4jGy9QZFKqXiT03GqNd41cLXKKQsmHj+tEuFFBb4jDfUETXMJWsd8V5DmvffZp MRLcio/xd/q2o68rvjEKZrcvIChW6YdJg1d2thni7uCDgvEDcK7HHmuhvvhlANTaFurhq+VhHV2
SOdyeqR5p8eyPUPVHTtzaUbzb/tRTO5Cgb7F8Ae4fhXv3b9abZKASK9F96jsSks1Wg35dCF1
X-Proofpoint-ORIG-GUID: yBv1QbkSCPABfv32Vs5UbabjPFZrMY4Q
X-Proofpoint-Virus-Version: vendor=baseguard
engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40
definitions=2025-05-28_09,2025-05-27_01,2025-03-28_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0
lowpriorityscore=0 mlxscore=0 adultscore=0 priorityscore=1501
impostorscore=0 malwarescore=0 mlxlogscore=354 suspectscore=0 bulkscore=0
spamscore=0 clxscore=1015 classifier=spam authscore=0 authtc=n/a authcc=
route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505160000
definitions=main-2505280157
X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
On Wed, May 28, 2025 at 07:05:06PM +0200, Michal Koutn�e:
On Wed, May 28, 2025 at 06:48:37PM +0530, Vishal Chourasia <vishalc@xxxxxxxxxxxxx> wrote:
> The part that was confused me, was the meaning behind controller being
> available vs. enabled in a cgroup.
>
> Though, the documentation does mention what it means for a controller to
> be enabled in a cgroup later in the text. But at the point of the
> change it is unclear.
There's a picture [1] that may be more descriptive than the docs (on
which it is based).
Thanks for the reference.
I didn't get the part about "io controller enabling memory controller
too". Is it referring to the fact that multiple controller can work
together in a cgroup? Because, enabling just the io controller does not
automatically enable memory controller too.
Okay, what do you suggest, should I send out V2 taking corrections from
others?
Regards,
Vishal
HTH,
Michal
[1] https://paste.opensuse.org/pastes/987b665209bb
Return-Path: <linux-kernel+bounces-665944-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [147.75.80.249])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 2899341E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:10:59 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by am.mirrors.kernel.org (Postfix) with ESMTPS id 0A4201BC5FA2
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:11:12 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B8F628E57B;
Wed, 28 May 2025 18:10:51 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="N2vKWmS6"
Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182])
by smtp.subspace.kernel.org (Postfix) with ESMTP id F1175199939;
Wed, 28 May 2025 18:10:48 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748455850; cv=none; b=jFhqdn6dFz7S1q6ACDz11WsBC2TiE+Hb2nkjbFrF9mk6BKRjZHkfY6nAwLJPx9+n80D8Xm1P6soI6b9/fR3SfBHiPmoHFCs55n87nO0dHKptvvC7RpX7ULuAOMf29F7P2szI7ZJf/W/eFqKDIuiB4WYS1twlr3TPQi9Sp/LeTSk=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748455850; c=relaxed/simple;
bh=tJgGaeL8lDq9uscvebOcn4+6B6FshQVjhO0hl3B3BdA=;
h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=pq6a3+O/6wcFdt4EKskPYEY3bLUITIxAGeW8UfrOLjIaL2JIdeh8322cY401qT49lQm31sZN1VEM6B2RjHEWWRwrslaQsaUJE/0pbZY7BG61ALs5j3Ei8z4cxiUOoTmNTh7lgghh0jWykdLrJIYu508Zjr8+8d2MInpX+PNEXAk=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=N2vKWmS6; arc=none smtp.client-ip=13.77.154.182
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com
Received: from CPC-grwhy-1BDK8.redmond.corp.microsoft.com (unknown [70.37.26.37])
by linux.microsoft.com (Postfix) with ESMTPSA id 65C62207860A;
Wed, 28 May 2025 11:10:48 -0700 (PDT)
DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 65C62207860A
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;
s=default; t=1748455848;
bh=BN4btWrgT6mTRx8CSI6Tnm6/WQ8RUzdUec/ttgLYXhY=;
h=From:To:Cc:Subject:Date:From;
b=N2vKWmS6UItT4oQ1mziW5lSnPP3CcGCEpdMKxoVnYFrgfIFgpZ+1EXwAv2gAMqeBb
Co8n0qAUWkV6ND2NgIEK3RgSu5M3zd4OmYs63LXBYB3+yNh1MMs8ktxnCbpfUADsd/
pyqQEL3zEAAhJFCKQYCxCuyNe5A0fp7DVmBXZsi8=
From: grwhyte@xxxxxxxxxxxxxxxxxxx
To: linux-pci@xxxxxxxxxxxxxxx
Cc: shyamsaini@xxxxxxxxxxxxxxxxxxx,
code@xxxxxxxxxxx,
Okaya@xxxxxxxxxx,
bhelgaas@xxxxxxxxxx,
linux-kernel@xxxxxxxxxxxxxxx
Subject: [PATCH v2] PCI: Reduce delay after FLR of Microsoft MANA devices
Date: Wed, 28 May 2025 18:10:47 +0000
Message-Id: <20250528181047.1748794-1-grwhyte@xxxxxxxxxxxxxxxxxxx>
X-Mailer: git-send-email 2.25.1
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,
RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,
RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
From: Graham Whyte <grwhyte@xxxxxxxxxxxxxxxxxxx>
Add a device-specific reset for Microsoft MANA devices with the FLR
delay reduced from 100ms to 10ms. While this is not compliant with the pci
spec, these devices safely complete the FLR much quicker than 100ms and
this can be reduced to optimize certain scenarios
Signed-off-by: Graham Whyte <grwhyte@xxxxxxxxxxxxxxxxxxx>
---
Changes in v2:
- Removed unnecessary EXPORT_SYMBOL_GPL for function pci_dev_wait
- Link to v1:https://lore.kernel.org/linux-pci/20250522085253.GN7435@unreal/T/#m7453647902a1b22840f5e39434a631fd7b2515ce
---
drivers/pci/pci.c | 2 +-
drivers/pci/pci.h | 1 +
drivers/pci/quirks.c | 55 ++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 57 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 9cb1de7658b5..28f3bfd24357 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1262,7 +1262,7 @@ void pci_resume_bus(struct pci_bus *bus)
pci_walk_bus(bus, pci_resume_one, NULL);
}
-static int pci_dev_wait(struct pci_dev *dev, char *reset_type, int timeout)
+int pci_dev_wait(struct pci_dev *dev, char *reset_type, int timeout)
{
int delay = 1;
bool retrain = false;
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index f2958318d259..3a98e00eb02a 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -109,6 +109,7 @@ void pci_init_reset_methods(struct pci_dev *dev);
int pci_bridge_secondary_bus_reset(struct pci_dev *dev);
int pci_bus_error_reset(struct pci_dev *dev);
int __pci_reset_bus(struct pci_bus *bus);
+int pci_dev_wait(struct pci_dev *dev, char *reset_type, int timeout);
struct pci_cap_saved_data {
u16 cap_nr;
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index c354276d4bac..94bd2c82cbbd 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -4205,6 +4205,55 @@ static int reset_hinic_vf_dev(struct pci_dev *pdev, bool probe)
return 0;
}
+#define MSFT_PCIE_RESET_READY_POLL_MS 60000 /* msec */
+#define MICROSOFT_2051_SVC 0xb210
+#define MICROSOFT_2051_MANA_MGMT 0x00b8
+#define MICROSOFT_2051_MANA_MGMT_GFT 0xb290
+
+/* Device specific reset for msft GFT and gdma devices */
+static int msft_pcie_flr(struct pci_dev *dev)
+{
+ if (!pci_wait_for_pending_transaction(dev))
+ pci_err(dev, "timed out waiting for pending transaction; "
+ "performing function level reset anyway\n");
+
+ pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_BCR_FLR);
+
+ if (dev->imm_ready)
+ return 0;
+
+ /*
+ * Per PCIe r4.0, sec 6.6.2, a device must complete an FLR within
+ * 100ms, but may silently discard requests while the FLR is in
+ * progress. However, 100ms is much longer than required for modern
+ * devices, so we can afford to reduce the timeout to 10ms.
+ */
+ usleep_range(10000, 10001);
+
+ return pci_dev_wait(dev, "FLR", MSFT_PCIE_RESET_READY_POLL_MS);
+}
+
+/*
+ * msft_pcie_reset_flr - initiate a PCIe function level reset
+ * @dev: device to reset
+ * @probe: if true, return 0 if device can be reset this way
+ *
+ * Initiate a function level reset on @dev.
+ */
+static int msft_pcie_reset_flr(struct pci_dev *dev, bool probe)
+{
+ if (dev->dev_flags & PCI_DEV_FLAGS_NO_FLR_RESET)
+ return -ENOTTY;
+
+ if (!(dev->devcap & PCI_EXP_DEVCAP_FLR))
+ return -ENOTTY;
+
+ if (probe)
+ return 0;
+
+ return msft_pcie_flr(dev);
+}
+
static const struct pci_dev_reset_methods pci_dev_reset_methods[] = {
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82599_SFP_VF,
reset_intel_82599_sfp_virtfn },
@@ -4220,6 +4269,12 @@ static const struct pci_dev_reset_methods pci_dev_reset_methods[] = {
reset_chelsio_generic_dev },
{ PCI_VENDOR_ID_HUAWEI, PCI_DEVICE_ID_HINIC_VF,
reset_hinic_vf_dev },
+ { PCI_VENDOR_ID_MICROSOFT, MICROSOFT_2051_SVC,
+ msft_pcie_reset_flr},
+ { PCI_VENDOR_ID_MICROSOFT, MICROSOFT_2051_MANA_MGMT,
+ msft_pcie_reset_flr},
+ { PCI_VENDOR_ID_MICROSOFT, MICROSOFT_2051_MANA_MGMT_GFT,
+ msft_pcie_reset_flr},
{ 0 }
};
--
2.25.1
Return-Path: <linux-kernel+bounces-665945-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 68ED141E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:11:39 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by ny.mirrors.kernel.org (Postfix) with ESMTPS id 82F7B4E20E6
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:11:40 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id AA29928E580;
Wed, 28 May 2025 18:11:33 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iYacyj/Y"
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201])
(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 EC9B9199939;
Wed, 28 May 2025 18:11:32 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748455893; cv=none; b=hZPZH8Xe3+HxjYF83grFQNJK6AMBjNBnwf+T/BHuOfKKFBnN2DADwd+5CTaoHbVrgzovxfmSbbVE1PhNiMuD6Yzkq42I1I4p21ThuMHlTK9qvBqmMyrbBgG6NznAKof2n7ilw8hyXiIRkAvUQbqpEZVwj20xKM3+zH6H01J33AQ=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748455893; c=relaxed/simple;
bh=pA6/+lW7KQ8D9sdiQUAJgFyLpd7301C+JPUAiDBNi6Y=;
h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
Content-Type:Content-Disposition:In-Reply-To; b=bn3JNKTVSNX9JjkNsqRzrfe3mTwRSJtz7B7uIvgMlcZeVyRC67tvFPSFHlb3cpFsmR1lUS6ldoNb1mW6mwXiSw49shSWl7t8fJyfKDeaa38C5Tde6ZxZ2hgONdOsQh9TpE9+SF1TwBkJ0MuZYNDPzzHyY76l8StL2MRf5nKiUis=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iYacyj/Y; arc=none smtp.client-ip=10.30.226.201
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E3EDC4CEE3;
Wed, 28 May 2025 18:11:31 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
s=k20201202; t=1748455892;
bh=pA6/+lW7KQ8D9sdiQUAJgFyLpd7301C+JPUAiDBNi6Y=;
h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
b=iYacyj/YCQ5Npy3F3wheC1SzvhJOVNjtyG2ed/DUVuv5KCpM3AxcKT/uRHRTd3i3Y
oEjEJWzWjzKLulrMma0UtJqtgVj1PMCkKUha9gdzGNPaT/7yis2Hiakx0otvueg0Bd
wSjQFO4SHn96l7uhhCGEOJruMurOtNpPun/a82ry8IiP2b9MZ3XEevJ6Zt9jhzYgdt
toJAgmwx/RyNVOKmGahgN52nYyHIaplqoECEJSy5zOrOgoFaYA4m/+E5w3Ejjr+OUy
tyxk/Xq9GfKJ6Hu19dG4VR4fOofQz2Qzl5jkYwrKnYixI8PxZ/eHEqNDEWq3/VEgJ4
4O9Uw1w7rTQtQ==
Date: Wed, 28 May 2025 11:11:30 -0700
From: Namhyung Kim <namhyung@xxxxxxxxxx>
To: Ian Rogers <irogers@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>,
Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>,
Mark Rutland <mark.rutland@xxxxxxx>,
Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>,
Jiri Olsa <jolsa@xxxxxxxxxx>,
Adrian Hunter <adrian.hunter@xxxxxxxxx>,
Kan Liang <kan.liang@xxxxxxxxxxxxxxx>,
James Clark <james.clark@xxxxxxxxxx>,
"Masami Hiramatsu (Google)" <mhiramat@xxxxxxxxxx>,
Ravi Bangoria <ravi.bangoria@xxxxxxx>, Leo Yan <leo.yan@xxxxxxx>,
Yujie Liu <yujie.liu@xxxxxxxxx>,
Graham Woodward <graham.woodward@xxxxxxx>,
Howard Chu <howardchu95@xxxxxxxxx>,
Weilin Wang <weilin.wang@xxxxxxxxx>,
Dmitry Vyukov <dvyukov@xxxxxxxxxx>, Andi Kleen <ak@xxxxxxxxxxxxxxx>,
Thomas Falcon <thomas.falcon@xxxxxxxxx>,
Matt Fleming <matt@xxxxxxxxxxxxxxxx>,
Chun-Tse Shao <ctshao@xxxxxxxxxx>, Ben Gainey <ben.gainey@xxxxxxx>,
Song Liu <song@xxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx,
linux-perf-users@xxxxxxxxxxxxxxx, Kajol Jain <kjain@xxxxxxxxxxxxx>,
Athira Rajeev <atrajeev@xxxxxxxxxxxxxxxxxx>
Subject: Re: [PATCH v3 1/3] perf sample: Remove arch notion of sample parsing
Message-ID: <aDdR0pCNSmxCEyEZ@xxxxxxxxxx>
References: <20250521165317.713463-1-irogers@xxxxxxxxxx>
<20250521165317.713463-2-irogers@xxxxxxxxxx>
<aC43Et06tyrBOrsT@xxxxxxxxxx>
<CAP-5=fUYUDq6hmd+e3_E7HCRPYuy-0KLE+gLuSCWAHh3A5wJLA@xxxxxxxxxxxxxx>
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <CAP-5=fUYUDq6hmd+e3_E7HCRPYuy-0KLE+gLuSCWAHh3A5wJLA@xxxxxxxxxxxxxx>
X-Spam-Status: No, score=-6.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,
RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,
RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
On Wed, May 21, 2025 at 02:15:24PM -0700, Ian Rogers wrote:
On Wed, May 21, 2025 at 1:27 PM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
>
> On Wed, May 21, 2025 at 09:53:15AM -0700, Ian Rogers wrote:
> > By definition arch sample parsing and synthesis will inhibit certain
> > kinds of cross-platform record then analysis (report, script,
> > etc.). Remove arch_perf_parse_sample_weight and
> > arch_perf_synthesize_sample_weight replacing with a common
> > implementation. Combine perf_sample p_stage_cyc and retire_lat to
> > capture the differing uses regardless of compiled for architecture.
>
> Can you please do this without renaming? It can be a separate patch but
> I think we can just leave it.
It is not clear what the use of the union is. Presumably it is a
tagged union but there is no tag as the union value to use is implied
by either being built on x86_64 or powerpc. The change removes the
notion of this code being built for x86_64 or powerpc and so the union
value to use isn't clear (e.g. should arm use p_stage_cyc or
retire_lat from the union), hence combining to show that it could be
one or the other. The code could be:
```
#ifdef __x86_64__
u16 p_stage_cyc;
#elif defined(powerpc)
u16 retire_lat;
#endif
```
but this isn't cross-platform.
Right, we probably don't want it.
The change in hist.h of
```
@@ -255,7 +255,7 @@ struct hist_entry {
u64 code_page_size;
u64 weight;
u64 ins_lat;
- u64 p_stage_cyc;
+ u64 p_stage_cyc_or_retire_lat;
```
could be a follow up CL, but then we lose something of what the field
is holding given the value is just a copy of that same named value in
perf_sample. The code only inserts 34 lines and so the churn of doing
that seemed worse than having the change in a single patch for
clarity.
Assuming other archs can add something later, we won't rename the field
again. So I can live with the ugly union fields. If we really want to
rename it, I prefer calling it just 'weight3' and let the archs handle
the display name only.
Thanks,
Namhyung
Return-Path: <linux-kernel+bounces-665946-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [139.178.88.99])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id D6C7941E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:12:22 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by sv.mirrors.kernel.org (Postfix) with ESMTPS id A4B043B1B88
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:11:52 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 2CCB728E5E7;
Wed, 28 May 2025 18:12:02 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NXcBIlIV"
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201])
(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 638F428E573;
Wed, 28 May 2025 18:12:01 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748455921; cv=none; b=uzOJMIi28Tcxh42uMx7f+QaCreZwlpg8SpBhmTdrjtDKVYe6Wqx+uhaC21ROoNYusAEobYsS7DQtD1Ng+L1sMZYfFPePtnzm9vPb3/wN8EF2Q2dxAf4H4fcmBxVal3LMs3obHMgurz89U2QWdnNSckHfHAO3uiBjt01YSZve84g=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748455921; c=relaxed/simple;
bh=hxcBVVt/dT1aFY9T1MdNfnDvaZdZ7UKvOnkx2IJSPOY=;
h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:
MIME-Version:Content-Type; b=FfhiTiOUpKLELc62sF3++/n6JNPg+F/FJ+Hsb1ehqIXn/ERnQIIO7NTaOgrpgZ4gFIZ91ZTmWOfzylAZi6aOhtbLBWm8qcB5jakl5QySbztfFkuroghIQOkogm+7CxvPoyFQnD9yF3fkpVKFH3KG/O5gukljnmAuUkeJmeAmYUU=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NXcBIlIV; arc=none smtp.client-ip=10.30.226.201
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CBBFC4CEE3;
Wed, 28 May 2025 18:11:59 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
s=k20201202; t=1748455920;
bh=hxcBVVt/dT1aFY9T1MdNfnDvaZdZ7UKvOnkx2IJSPOY=;
h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
b=NXcBIlIVynu5FMeJskRun3YbPT+MHYULMWaV0dfeh+ZnjVg3/BNj2FCXzE0ExnMGo
Wnc+HS0ahq7E4WYejyv5Dn/KCZ6pNy1jnixQC/ZTNkWOZbSMh9XV1e+O729KnxgToc
1UWxDPOlJfXDJnCnQtheM7nhg2S2R22JkIjVHWFbng3ZSejgTb6ypl82FTen3wDz/c
FjyZYiyr4Bg6PTGlWlxWqbAa5eeLz7D2a9xaPswVPX7J885XROg8jpS9LjC9u3Ju2Z
F9cud6uESqcFVJFbnmcEUgPNMSV/mg4TR9ZX6VG1+F23MCzHIpbMMojhsKKTOFQqXe
qPqL1zQzdB8qw==
From: cel@xxxxxxxxxx
To: Olga Kornievskaia <okorniev@xxxxxxxxxx>,
Dai Ngo <Dai.Ngo@xxxxxxxxxx>,
Tom Talpey <tom@xxxxxxxxxx>,
Steven Rostedt <rostedt@xxxxxxxxxxx>,
Masami Hiramatsu <mhiramat@xxxxxxxxxx>,
Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>,
Trond Myklebust <trondmy@xxxxxxxxxx>,
Anna Schumaker <anna@xxxxxxxxxx>,
"David S. Miller" <davem@xxxxxxxxxxxxx>,
Eric Dumazet <edumazet@xxxxxxxxxx>,
Jakub Kicinski <kuba@xxxxxxxxxx>,
Paolo Abeni <pabeni@xxxxxxxxxx>,
Simon Horman <horms@xxxxxxxxxx>,
NeilBrown <neil@xxxxxxxxxx>,
Jeff Layton <jlayton@xxxxxxxxxx>
Cc: Chuck Lever <chuck.lever@xxxxxxxxxx>,
Mike Snitzer <snitzer@xxxxxxxxxx>,
linux-nfs@xxxxxxxxxxxxxxx,
linux-kernel@xxxxxxxxxxxxxxx,
linux-trace-kernel@xxxxxxxxxxxxxxx,
netdev@xxxxxxxxxxxxxxx
Subject: Re: [PATCH 0/2] nfsd: use threads array as-is in netlink thread set interface
Date: Wed, 28 May 2025 14:11:53 -0400
Message-ID: <174845587080.200069.9203268802136145057.b4-ty@xxxxxxxxxx>
X-Mailer: git-send-email 2.49.0
In-Reply-To: <20250527-rpc-numa-v1-0-fa1d98e9a900@xxxxxxxxxx>
References: <20250527-rpc-numa-v1-0-fa1d98e9a900@xxxxxxxxxx>
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
X-Spam-Status: No, score=-6.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,
RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,
RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
From: Chuck Lever <chuck.lever@xxxxxxxxxx>
On Tue, 27 May 2025 20:12:46 -0400, Jeff Layton wrote:
The first patch is probably appropriate for stable. It should fix
problems when someone sets the pool_mode to pernode, without userland
sending down a fully-populated thread array.
The second patch just adds a couple of new tracepoints that I ended up
using to track this down.
[...]
Applied to nfsd-testing, thanks!
[1/2] nfsd: use threads array as-is in netlink interface
commit: b2a9a114a3c7f5abfa2875b70ce9b73525a74291
[2/2] sunrpc: new tracepoints around svc thread wakeups
commit: 65b8babe551bddf00aac69bc905f88a4e0371766
--
Chuck Lever
Return-Path: <linux-kernel+bounces-665947-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [147.75.80.249])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 4C95341E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:13:41 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by am.mirrors.kernel.org (Postfix) with ESMTPS id F2C6D1C001C0
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:13:53 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F8A228E58E;
Wed, 28 May 2025 18:13:33 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=pdp7-com.20230601.gappssmtp.com header.i=@pdp7-com.20230601.gappssmtp.com header.b="WSRUVhIX"
Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 357CD246772
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:13:30 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748456012; cv=none; b=fFtrExj6TOijCnmskqpBUaxVSenXZYyNg+dAxOkHBcsA9zsWIHWEqtgs6UJI63JIQO1EsXpvZ7l48C29/Gf2sjtKi7Wwy6D2MvOlymxm7nBJ4GWR8jxMFfDIVvA4hkT47xP4feXzHs6sTvhUpFkWC9YVTdeqwACRxvV+EQZdj2E=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748456012; c=relaxed/simple;
bh=U4kfnRSN59WkHY9Ler2V9T7GAxjBXkqvdf0hrH9hz68=;
h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
Content-Type:Content-Disposition:In-Reply-To; b=OD79UrZleR89cAmSEMZi9bLujZVMk/K3alt/Glk3496TEpNMW7rCqEYtSzBrRO/RMfUFaNIJd99R/hP8OSFqxisxeMJjGsZQB4rhv/UMIF5n9ew8pyDWjM59CoehxspsyeN4N/DolfhX1nzqxMxGgILH73fJBN2a4pLipxqEW+I=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pdp7.com; spf=none smtp.mailfrom=pdp7.com; dkim=pass (2048-bit key) header.d=pdp7-com.20230601.gappssmtp.com header.i=@pdp7-com.20230601.gappssmtp.com header.b=WSRUVhIX; arc=none smtp.client-ip=209.85.210.173
Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pdp7.com
Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=pdp7.com
Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-7426c44e014so9338b3a.3
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 11:13:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=pdp7-com.20230601.gappssmtp.com; s=20230601; t=1748456010; x=1749060810; darn=vger.kernel.org;
h=in-reply-to:content-disposition:mime-version:references:message-id
:subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
bh=VfQ5QF4QrPtGjwJGXo+I+tvoV3Ek+wsqmkmzYgFTPno=;
b=WSRUVhIXZIuu6k3StI3+dhZR2b4IsExDcJBCTzQIt6FNNjawaTNeCqRwywga1I/dCH
/TW/63eWoFfqKbLq8B3s8AWpKWmOLn3UQ/CekPPLUnvJKJsPhhoInTplUyjiEqRwRR7+
lclkNML2hM8IUMLdNccb/Wk4jYXsoTbCqviZB7uhWde+7TNxzCMCOqvzW6QpXk6+b4p+
tvXCotL2kFIRX5Rgf4JBK08mrbjCHKLVrwixdyOyg9cujon7ysyfqctD09M7a8fbOOAW
Axd3XMz+Sn1uxXv+jBYW3dA6LhF5EdbKjef5lEGX44qyXABVis6zUcJVPF0DAigcTOpx
ffEA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1748456010; x=1749060810;
h=in-reply-to:content-disposition:mime-version:references:message-id
:subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
:message-id:reply-to;
bh=VfQ5QF4QrPtGjwJGXo+I+tvoV3Ek+wsqmkmzYgFTPno=;
b=SjH+SnK8yK3EJWs3x/UDyZKIjNlHgj2QUAfLsV7MssPYWBbM8SVRDWRaAQYGdmaexj
edy5DJ7kLoDVIb/owkKpD1LqjQqnGCOQCHQO4QkF6aBiLym9i8UbZVwFczkfPYLcbgw8
MwfaRq1qMqHuin4B02TZIXOAuIJvsqJdJQnv/UrXipHvR1d7oi0CVA9g+jeZkvQYoN8f
7PPKwbu3336ccM1VTXW4cAYQNyQ2ZxQXJXFizgt4VcAVXTioMoL9EoNfRimfHf99/06A
EkpWOWKwOOnLnjwnWF87N22XsW102RHXcEcBOLRDPwySx7y/WdRMnPo3uyPlgh/ksq3/
R/mA==
X-Forwarded-Encrypted: i=1; AJvYcCVRMxlKL4bfV56/k1iyHz5eOiWGKV2+iNxZoaVOTZmU3fOc8qkN9FdWnpZWXns3yEruPCxBn7XhVeajszw=@vger.kernel.org
X-Gm-Message-State: AOJu0YyEfnmxjEMpEpUkQJWYhw9F0iglSN++1o7XEhGVkfxpWzrdQPW2
pa6K6hVfCbEPVqv/rX4WxSZc6FPIopQw3S8oQVLb9LMCOlUH4KRalrDqw1+3pGIfiao=
X-Gm-Gg: ASbGncuGW5104NauseAPvhU2175bbOPWqM94GrEynkdw8TGAYZc+jYS5WepsOHK5yZa
EACQOLDKi7H9vyKbIe7hhggd8iZDkq01bF1mw1qGSrLDnNvSMIrfhpOjDoo4Tl5j6CQaGfLlXkh
GxsZUJ5fStEV5hGAMUp82n1ENJyGKX0u/qMkcojXjcZ4SKkxUNFqDR3OQVxviX+90AHSWDa7HLs
3k55tSxL44DSL2rPlUN92MhgfhYwCyfWxbSkK7seDTWhOKfK3zima5y9KsRAwCtt5hgbp7wO3iB
LHbd3aCWjSMtFwd8faDzt4bczc8mHHjbywlbJevyPFGezDY11YnJ+Wb3+TjcJ/A=
X-Google-Smtp-Source: AGHT+IGoXH5nWNXVter/7FoojUs8PwU60p8upKHgzmtsaMD1s8dITxfPj8ze1St+uUzaNtQ6OA7rQA==
X-Received: by 2002:a05:6a21:46c4:b0:1f5:6abb:7cbb with SMTP id adf61e73a8af0-21aad87d03emr5439458637.23.1748456010381;
Wed, 28 May 2025 11:13:30 -0700 (PDT)
Received: from x1 (97-120-251-212.ptld.qwest.net. [97.120.251.212])
by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-746e345fe8dsm1571589b3a.174.2025.05.28.11.13.29
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 28 May 2025 11:13:29 -0700 (PDT)
Date: Wed, 28 May 2025 11:13:28 -0700
From: Drew Fustini <drew@xxxxxxxx>
To: Conor Dooley <conor@xxxxxxxxxx>
Cc: Oliver O'Halloran <oohall@xxxxxxxxx>, Rob Herring <robh@xxxxxxxxxx>,
Krzysztof Kozlowski <krzk+dt@xxxxxxxxxx>,
Conor Dooley <conor+dt@xxxxxxxxxx>, nvdimm@xxxxxxxxxxxxxxx,
devicetree@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
Subject: Re: [RESEND PATCH v2] dt-bindings: pmem: Convert binding to YAML
Message-ID: <aDdSSNeiveSrM9NE@x1>
References: <20250520021440.24324-1-drew@xxxxxxxx>
<20250528-repulsive-osmosis-d473fbc61716@spud>
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
protocol="application/pgp-signature"; boundary="39RrpW82KPLL21NE"
Content-Disposition: inline
In-Reply-To: <20250528-repulsive-osmosis-d473fbc61716@spud>
X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
--39RrpW82KPLL21NE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Wed, May 28, 2025 at 02:43:27PM +0100, Conor Dooley wrote:
On Tue, May 27, 2025 at 11:17:04PM -0700, Drew Fustini wrote:
> Convert the PMEM device tree binding from text to YAML. This will allow
> device trees with pmem-region nodes to pass dtbs_check.
>=20
> Signed-off-by: Drew Fustini <drew@xxxxxxxx>
> ---
> v2 resend:
> - actually put v2 in the Subject
> - add Conor's Acked-by
> - https://lore.kernel.org/all/20250520-refract-fling-d064e11ddbdf@sp=
ud/
=20
I guess this is the one you mentioned on irc?
Acked-by: Conor Dooley <conor.dooley@xxxxxxxxxxxxx>
Thanks, yeah, I've become too used to `b4 send --reflect` and managed to bo=
th
duplicate the message id and not actually include your tag when using
git send-email - d'oh! ;)
Drew
--39RrpW82KPLL21NE
Content-Type: application/pgp-signature; name="signature.asc"
-----BEGIN PGP SIGNATURE-----
iHUEABYIAB0WIQSy8G7QpEpV9aCf6Lbb7CzD2SixDAUCaDdSOAAKCRDb7CzD2Six
DHbhAP9XlQng+snuCwTSEULcb16UVf5k2n1W3hLLrDVfGt4ZTAD/ZE3wUuc6HIbm
UMX2OND4pLWeegQhzQyiJYCOPJ/k8wg=
=3wuH
-----END PGP SIGNATURE-----
--39RrpW82KPLL21NE--
Return-Path: <linux-kernel+bounces-665948-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 66FC041E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:16:19 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8D96A4E593A
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:16:20 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E13E20A5DD;
Wed, 28 May 2025 18:16:13 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KkWpQ1DL"
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201])
(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 970C327450;
Wed, 28 May 2025 18:16:12 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748456172; cv=none; b=LdPR0hJHsSQpdy4qwb5lrcTf0NLMMlJH5lQAe7keSjpPJNUq/gCHzxd18TSJyb2vdfsGq985OxRNOgplXWlShvZ8fIFbpunFAZiRPmpv9f4z04fLyed0FpQqI7ELZWB095mQnLRn4JB7OyOTtY2iqb4lW5qIJdZ6B0nlTlnFOZA=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748456172; c=relaxed/simple;
bh=06Kkx5fpHL8G7g8fwV5lNs2DBz108eD4awwjeVfVyvE=;
h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
Content-Type:Content-Disposition:In-Reply-To; b=oWXlPvRKo+Uu8lPFLdT8pdxcsMwW7BZz6Vj0kMuUt33bil4pWBzwcpb1pIFGj0PE0yTKc1n06sWZIefd9e3imzOZIU4GhJL/sOpMQL5dvAlKiZ2eB+r+J323/beVqXRkbRIqjjTssUIqKCcYYQ3R/OqJxwcmRTshQMiLETu8PrQ=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KkWpQ1DL; arc=none smtp.client-ip=10.30.226.201
Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF5A8C4CEE3;
Wed, 28 May 2025 18:16:08 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
s=k20201202; t=1748456172;
bh=06Kkx5fpHL8G7g8fwV5lNs2DBz108eD4awwjeVfVyvE=;
h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
b=KkWpQ1DLhunF70Di8HrYsEA5RMqJIldApxKDcf23sYfw4VxPUl8/WwU2VFzwBogNF
HvlXlX3l93ACoy16d+pUXba4k6O6RsKEF4ku8EYu0GeMQEvaFAobNoom9Moli7HLBW
z2mI4XXfrgZdc6HHxRFd3kxwhAcbdvKpRjDnJU1HH3F77jki9wptCiRpo8J6R9CuDC
Qras3IRa5pRwnbT3q4LZSpsSUNL+EgjLRCtWQ45856Yj3HypezaydCwql2UlCghX6I
cWfEyy9YzMstPioPd8/c7kp6fMAQJ20vRiEzuNUIL/V7S0Ga0ThdeBmO5EKqafpqS6
SgyY5G92HF8wQ==
Date: Wed, 28 May 2025 19:16:04 +0100
From: Mark Brown <broonie@xxxxxxxxxx>
To: Daniel Okazaki <dtokazaki@xxxxxxxxxx>
Cc: Liam Girdwood <lgirdwood@xxxxxxxxx>, Rob Herring <robh@xxxxxxxxxx>,
Krzysztof Kozlowski <krzk+dt@xxxxxxxxxx>,
Conor Dooley <conor+dt@xxxxxxxxxx>,
Zev Weiss <zev@xxxxxxxxxxxxxxxxx>, kernel-team@xxxxxxxxxxx,
linux-kernel@xxxxxxxxxxxxxxx, devicetree@xxxxxxxxxxxxxxx
Subject: Re: [PATCH v1 0/2] userspace-consumer: adding is_shared flag
Message-ID: <a0bf24c6-58da-42e7-b686-03a893b38ecb@xxxxxxxxxxxxx>
References: <20250528174426.3318110-1-dtokazaki@xxxxxxxxxx>
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
protocol="application/pgp-signature"; boundary="yf9j6Ew/8eSP7Prm"
Content-Disposition: inline
In-Reply-To: <20250528174426.3318110-1-dtokazaki@xxxxxxxxxx>
X-Cookie: Keep away from edge.
X-Spam-Status: No, score=-6.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,
RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,
RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
--yf9j6Ew/8eSP7Prm
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On Wed, May 28, 2025 at 05:44:23PM +0000, Daniel Okazaki wrote:
Currently this userspace regulator driver requires exclusive control
of the regulator to operate. This patch adds an optional flag to
remove that constraint, and allow the regulator to be shared by other
modules. This allows for userspace to share control over a regulator
with kernel space.
What is the use case here? This is a debug tool intended mainly for
when you're developing a regulator driver and have something like a
development board with no consumers at all.
--yf9j6Ew/8eSP7Prm
Content-Type: application/pgp-signature; name="signature.asc"
-----BEGIN PGP SIGNATURE-----
iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmg3UuQACgkQJNaLcl1U
h9Cligf/eRNSCfhAuPHM4/ocG3R+mI+WoS9FgYm7yddNGEdWxY40EnlQkfluFWLj
JESPxrpHpdVYeou8nzB8P6pSTwidv/wgDBJcIcxnIz3/eiY7Tm7g2EjhMY3jrbxH
Fj+rt6GbCzbC5XVEzh+XUAh1jOlefXJa0GPt6qgbg9q+6Jsi4YgPygzqGuxpjxqp
K8zw1JYvB79g2xUsU3OGBc9TBvN6ZVgGVqGP/HFtvnMF4Nh7CaMu+eii7wxqcE9O
GL7Y1Uvws23ckdJQ2CMgFFrJ48TAYWuS0aCv4oJ/HZtmpdKOb5ecBeGzSIso3tC1
dvUg/BshSNrt5iGIDUI5b+jxOntskw==
=X7d1
-----END PGP SIGNATURE-----
--yf9j6Ew/8eSP7Prm--
Return-Path: <linux-kernel+bounces-665949-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 5111C41E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:22:22 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by ny.mirrors.kernel.org (Postfix) with ESMTPS id 54A8D4E1177
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:22:23 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 7708F28A415;
Wed, 28 May 2025 18:22:15 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="WqqAoPNS"
Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id C26251D6195
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:22:11 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748456534; cv=none; b=tNxyg+HkciOkoZEHNZAT2ytyaiOrj9faUNEC1spVNGAgvPHrsWndAgxVODKXoVRQqB/V0qEh3LM335gr4H87vWm7Eyc4KquKjX9NZl3iQIDIivKkXvLamGKlAjLfSL81kD0xwWq8dMkV93uhrybIVvYbekMfvfJ5151Am49aqWU=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748456534; c=relaxed/simple;
bh=g9Uij2wLtuQhXOCGoStG5OmI/vXOT+cSxhUXvGV0hlc=;
h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:
In-Reply-To:Content-Type; b=VMvg6NCVN0lQVV4YtIf350+ZzLMJ9uriGCAQ6H9XhqFO9sQupehcIZlOH1+4DIuiKLFQaNbes718R/8eH9zjasurYuER4yO/Jz+YMMUOfdeWdNRnGBHMrf8W+GzZEHGCJLvVOWTsthLLNjDvt+oLF0BkQlRPZECrwEVNtRn7NPo=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=WqqAoPNS; arc=none smtp.client-ip=209.85.221.44
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com
Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-3a375888297so110513f8f.1
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 11:22:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=suse.com; s=google; t=1748456530; x=1749061330; darn=vger.kernel.org;
h=in-reply-to:autocrypt:from:content-language:references:cc:to
:subject:user-agent:mime-version:date:message-id:from:to:cc:subject
:date:message-id:reply-to;
bh=g9Uij2wLtuQhXOCGoStG5OmI/vXOT+cSxhUXvGV0hlc=;
b=WqqAoPNSNxuAR3PqT4ij7Cq3MillF4T50EfpA5J4dOzAq33++n5/3sal6ZZZ5DeVqL
zb/s9Tmf1X7riSw2/yzvnZKD47tD3SJh8Lj0sy2aNvNCZx5slWbWh36XEiulo4ESZhsy
hLEFKR8wvWkzeo7JRhc/aaZiKpadqvvPYteR4rDovqiPlRQ9dHo0BYcCYpBXDaFlfbCX
c8XYCy0qoG+alHf7JeHn8rlGxCvG6bPVt4/heAEx1p6cmuMk6ZqyWlS82rigyqUU+7ug
PfXFF2RvRjOGcrUp1819O+WxjTJ4v86YaLS+Gv/rNuJxECBppW0hYKRiy/DzP0N6i6xT
joIg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1748456530; x=1749061330;
h=in-reply-to:autocrypt:from:content-language:references:cc:to
:subject:user-agent:mime-version:date:message-id:x-gm-message-state
:from:to:cc:subject:date:message-id:reply-to;
bh=g9Uij2wLtuQhXOCGoStG5OmI/vXOT+cSxhUXvGV0hlc=;
b=M76so4F+H1/1LsNp8RgxhvfU8hTBNNJG+gOIaEE8FwBOwqHsFI18YQJac0hkSnKq/+
qwyxC6hWvyJnB2dSrw/NwSy0cgYiCxrm2QvKa9irchBxFPVFjcDC+bQyBHwo+JKMaIQa
yv15ImsW+TMjUSE7GibrRboTuEibB0l+11LwV3mpN6nezgT+SYDrHp1yyfjs8msAZUUe
r3YM1nvU248WGaeIvVT3XWM8qB/gXXaKKjyXYNk75ARO+N/1ercHoh2JboPpeY8vExVJ
iy6Udz98abgVSyJpNmutyKbewY9Nj/7RgnlJunJBWGp9apJXygQg8ZW/SgY5+mK61A60
6tkQ==
X-Gm-Message-State: AOJu0YxOqbuI/apZl1e69Vj/Z12EEkdUVsBLlColrCQBIsjXVt61/pZc
U24L1fL/6EckwULL+hJJLvk8yZ49d0yIv0jAtRbtFzSBZJ/F8wDBuBQwcvLxx9GFP0I=
X-Gm-Gg: ASbGnctqzafnG+3X2cvm+0mVrui29mM4ijeBHoMe8YDQsIuZ7rDniXdoQz4MxzSI7pV
kkg3h8TOtZK3wzGiIKZC1jb4WSO1kJR4qhHAcMYvJqqsta01ijsWQZgo/PULs4Lc8Nm7+w76o2k
7rMOIpQgZjWDMQ84t/h/ZWIpYjWSPFA44tHPSPwvs5umg5zToAd4BCZ9idOAnvCXVxw2Hi/SUsE
PTJyE3UR1yKsiGjOUw5nS9QWEHHK1VoTC6VjljJUoBoOzTFjUUjsKjpkoO3mPjfNNJFCKQ8FEAM
XGL+vCUlMPlzu8jI9B/e9X2ErAaiZssx1ve1RePCnQqTIoKXtyPqYIZGlQDO5sX6QNIGtf10b3W
nTh1otm1sB91K6iupQgzHK0jbSEV0XmLU9B++M86nL+SJ1Uq2co/4Pjpex9kICcd1f/N64lhDoo
LD9yZ/vBvnPRQ=
X-Google-Smtp-Source: AGHT+IHTOE0+PFMYz990jpg9Oe0N7CBnAi3AYUtP4/dXlixK8CwlJULu/dNKcHyCmmvXjdwh0Z/kUw==
X-Received: by 2002:a05:6000:2289:b0:3a3:7675:902 with SMTP id ffacd0b85a97d-3a4eedada59mr621835f8f.21.1748456529856;
Wed, 28 May 2025 11:22:09 -0700 (PDT)
Received: from ?IPV6:2003:e5:872a:8800:5c7b:1ac1:4fa0:423b? (p200300e5872a88005c7b1ac14fa0423b.dip0.t-ipconnect.de. [2003:e5:872a:8800:5c7b:1ac1:4fa0:423b])
by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a4eacd6f1bsm2109613f8f.80.2025.05.28.11.22.09
(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
Wed, 28 May 2025 11:22:09 -0700 (PDT)
Message-ID: <137571b5-0665-4ddd-ae78-0b8530daa549@xxxxxxxx>
Date: Wed, 28 May 2025 20:22:08 +0200
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/3] x86/execmem: don't use PAGE_KERNEL protection for
code pages
To: Mike Rapoport <rppt@xxxxxxxxxx>
Cc: linux-kernel@xxxxxxxxxxxxxxx, x86@xxxxxxxxxx, xin@xxxxxxxxx,
Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, Andy Lutomirski
<luto@xxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>,
Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>,
Borislav Petkov <bp@xxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>,
stable@xxxxxxxxxxxxxxx
References: <20250528123557.12847-1-jgross@xxxxxxxx>
<20250528123557.12847-2-jgross@xxxxxxxx> <aDdHdwf8REvdu5FF@xxxxxxxxxx>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@xxxxxxxx>
Autocrypt: addr=jgross@xxxxxxxx; keydata=
xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh
mE9U+iA1VsLhgDqVbsOtZ/S14LRFHczNd/Lqkn7souCSoyWsBs3/wO+OjPvxf7m+Ef+sMtr0
G5lCWEWa9wa0IXx5HRPW/ScL+e4AVUbL7rurYMfwCzco+7TfjhMEOkC+va5gzi1KrErgNRHH
kg3PhlnRY0Udyqx++UYkAsN4TQuEhNN32MvN0Np3WlBJOgKcuXpIElmMM5f1BBzJSKBkW0Jc
Wy3h2Wy912vHKpPV/Xv7ZwVJ27v7KcuZcErtptDevAljxJtE7aJG6WiBzm+v9EswyWxwMCIO
RoVBYuiocc51872tRGywc03xaQydB+9R7BHPzsBNBFOMcBYBCADLMfoA44MwGOB9YT1V4KCy
vAfd7E0BTfaAurbG+Olacciz3yd09QOmejFZC6AnoykydyvTFLAWYcSCdISMr88COmmCbJzn
sHAogjexXiif6ANUUlHpjxlHCCcELmZUzomNDnEOTxZFeWMTFF9Rf2k2F0Tl4E5kmsNGgtSa
aMO0rNZoOEiD/7UfPP3dfh8JCQ1VtUUsQtT1sxos8Eb/HmriJhnaTZ7Hp3jtgTVkV0ybpgFg
w6WMaRkrBh17mV0z2ajjmabB7SJxcouSkR0hcpNl4oM74d2/VqoW4BxxxOD1FcNCObCELfIS
auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d
1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <aDdHdwf8REvdu5FF@xxxxxxxxxx>
Content-Type: multipart/signed; micalg=pgp-sha256;
protocol="application/pgp-signature";
boundary="------------UsuyoDqOVngPVJZQPUnQdaoT"
X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,
RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,
RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------UsuyoDqOVngPVJZQPUnQdaoT
Content-Type: multipart/mixed; boundary="------------qYBFV4fxCGWNE5BE1KOr8YrG";
protected-headers="v1"
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@xxxxxxxx>
To: Mike Rapoport <rppt@xxxxxxxxxx>
Cc: linux-kernel@xxxxxxxxxxxxxxx, x86@xxxxxxxxxx, xin@xxxxxxxxx,
Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, Andy Lutomirski
<luto@xxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>,
Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>,
Borislav Petkov <bp@xxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>,
stable@xxxxxxxxxxxxxxx
Message-ID: <137571b5-0665-4ddd-ae78-0b8530daa549@xxxxxxxx>
Subject: Re: [PATCH 1/3] x86/execmem: don't use PAGE_KERNEL protection for
code pages
References: <20250528123557.12847-1-jgross@xxxxxxxx>
<20250528123557.12847-2-jgross@xxxxxxxx> <aDdHdwf8REvdu5FF@xxxxxxxxxx>
In-Reply-To: <aDdHdwf8REvdu5FF@xxxxxxxxxx>
--------------qYBFV4fxCGWNE5BE1KOr8YrG
Content-Type: multipart/mixed; boundary="------------WLDyLAPat7iV2ru9hIIK7gDk"
--------------WLDyLAPat7iV2ru9hIIK7gDk
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64
T24gMjguMDUuMjUgMTk6MjcsIE1pa2UgUmFwb3BvcnQgd3JvdGU6DQo+IE9uIFdlZCwgTWF5
IDI4LCAyMDI1IGF0IDAyOjM1OjU1UE0gKzAyMDAsIEp1ZXJnZW4gR3Jvc3Mgd3JvdGU6DQo+
PiBJbiBjYXNlIFg4Nl9GRUFUVVJFX1BTRSBpc24ndCBhdmFpbGFibGUgKGUuZy4gd2hlbiBy
dW5uaW5nIGFzIGEgWGVuDQo+PiBQViBndWVzdCksIGV4ZWNtZW1fYXJjaF9zZXR1cCgpIHdp
bGwgZmFsbCBiYWNrIHRvIHVzZSBQQUdFX0tFUk5FTA0KPj4gcHJvdGVjdGlvbiBmb3IgdGhl
IEVYRUNNRU1fTU9EVUxFX1RFWFQgcmFuZ2UuDQo+Pg0KPj4gVGhpcyB3aWxsIHJlc3VsdCBp
biBhdHRlbXB0cyB0byBleGVjdXRlIGNvZGUgd2l0aCB0aGUgTlggYml0IHNldCBpbg0KPj4g
Y2FzZSBvZiBJVFMgbWl0aWdhdGlvbiBiZWluZyBhcHBsaWVkLg0KPj4NCj4+IEF2b2lkIHRo
aXMgcHJvYmxlbSBieSB1c2luZyBQQUdFX0tFUk5FTF9FWEVDIHByb3RlY3Rpb24gaW5zdGVh
ZCwNCj4+IHdoaWNoIHdpbGwgbm90IHNldCB0aGUgTlggYml0Lg0KPj4NCj4+IENjOiA8c3Rh
YmxlQHZnZXIua2VybmVsLm9yZz4NCj4+IFJlcG9ydGVkLWJ5OiBYaW4gTGkgPHhpbkB6eXRv
ci5jb20+DQo+PiBGaXhlczogNTE4NWU3ZjlmM2JkICgieDg2L21vZHVsZTogZW5hYmxlIFJP
WCBjYWNoZXMgZm9yIG1vZHVsZSB0ZXh0IG9uIDY0IGJpdCIpDQo+PiBTaWduZWQtb2ZmLWJ5
OiBKdWVyZ2VuIEdyb3NzIDxqZ3Jvc3NAc3VzZS5jb20+DQo+PiAtLS0NCj4+ICAgYXJjaC94
ODYvbW0vaW5pdC5jIHwgMiArLQ0KPj4gICAxIGZpbGUgY2hhbmdlZCwgMSBpbnNlcnRpb24o
KyksIDEgZGVsZXRpb24oLSkNCj4+DQo+PiBkaWZmIC0tZ2l0IGEvYXJjaC94ODYvbW0vaW5p
dC5jIGIvYXJjaC94ODYvbW0vaW5pdC5jDQo+PiBpbmRleCA3NDU2ZGY5ODVkOTYuLmY1MDEy
YWUzMWQ4YiAxMDA2NDQNCj4+IC0tLSBhL2FyY2gveDg2L21tL2luaXQuYw0KPj4gKysrIGIv
YXJjaC94ODYvbW0vaW5pdC5jDQo+PiBAQCAtMTA4OSw3ICsxMDg5LDcgQEAgc3RydWN0IGV4
ZWNtZW1faW5mbyBfX2luaXQgKmV4ZWNtZW1fYXJjaF9zZXR1cCh2b2lkKQ0KPj4gICAJCXBn
cHJvdCA9IFBBR0VfS0VSTkVMX1JPWDsNCj4+ICAgCQlmbGFncyA9IEVYRUNNRU1fS0FTQU5f
U0hBRE9XIHwgRVhFQ01FTV9ST1hfQ0FDSEU7DQo+PiAgIAl9IGVsc2Ugew0KPj4gLQkJcGdw
cm90ID0gUEFHRV9LRVJORUw7DQo+PiArCQlwZ3Byb3QgPSBQQUdFX0tFUk5FTF9FWEVDOw0K
PiANCj4gUGxlYXNlIGRvbid0LiBFdmVyeXRoaW5nIGV4Y2VwdCBJVFMgY2FuIHdvcmsgd2l0
aCBQQUdFX0tFTlJFTCBzbyB0aGUgZml4DQo+IHNob3VsZCBiZSBvbiBJVFMgc2lkZS4NCg0K
SG1tLCBtYXliZSBhZGRpbmcgYW5vdGhlciBlbGVtZW50IHRvIGV4ZWNtZW1faW5mb1tdIHdp
dGggdGhlIG5ldw0KdHlwZSBFWEVDTUVNX0tFUk5FTF9URVhULCBzcGVjaWZ5aW5nIFBBR0Vf
S0VSTkVMX0VYRUMgaWYgIVBTRT8NCg0KDQpKdWVyZ2VuDQo=
--------------WLDyLAPat7iV2ru9hIIK7gDk
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable
-----BEGIN PGP PUBLIC KEY BLOCK-----
xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjri
oyspZKOBycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2
kaV2KL9650I1SJvedYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i
1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/B
BLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xqG7/377qptDmrk42GlSK
N4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR3Jvc3Mg
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsE
FgIDAQIeAQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4F
UGNQH2lvWAUy+dnyThpwdtF/jQ6j9RwE8VP0+NXcYpGJDWlNb9/JmYqLiX2Q3Tye
vpB0CA3dbBQp0OW0fgCetToGIQrg0MbD1C/sEOv8Mr4NAfbauXjZlvTj30H2jO0u
+6WGM6nHwbh2l5O8ZiHkH32iaSTfN7Eu5RnNVUJbvoPHZ8SlM4KWm8rG+lIkGurq
qu5gu8q8ZMKdsdGC4bBxdQKDKHEFExLJK/nRPFmAuGlId1E3fe10v5QL+qHI3EIP
tyfE7i9Hz6rVwi7lWKgh7pe0ZvatAudZ+JNIlBKptb64FaiIOAWDCx1SzR9KdWVy
Z2VuIEdyb3NzIDxqZ3Jvc3NAc3VzZS5jb20+wsB5BBMBAgAjBQJTjHCvAhsDBwsJ
CAcDAgEGFQgCCQoLBBYCAwECHgECF4AACgkQsN6d1ii/Ey/HmQf/RtI7kv5A2PS4
RF7HoZhPVPogNVbC4YA6lW7DrWf0teC0RR3MzXfy6pJ+7KLgkqMlrAbN/8Dvjoz7
8X+5vhH/rDLa9BuZQlhFmvcGtCF8eR0T1v0nC/nuAFVGy+67q2DH8As3KPu0344T
BDpAvr2uYM4tSqxK4DURx5INz4ZZ0WNFHcqsfvlGJALDeE0LhITTd9jLzdDad1pQ
SToCnLl6SBJZjDOX9QQcyUigZFtCXFst4dlsvddrxyqT1f17+2cFSdu7+ynLmXBK
7abQ3rwJY8SbRO2iRulogc5vr/RLMMlscDAiDkaFQWLoqHHOdfO9rURssHNN8WkM
nQfvUewRz80hSnVlcmdlbiBHcm9zcyA8amdyb3NzQG5vdmVsbC5jb20+wsB5BBMB
AgAjBQJTjHDXAhsDBwsJCAcDAgEGFQgCCQoLBBYCAwECHgECF4AACgkQsN6d1ii/
Ey8PUQf/ehmgCI9jB9hlgexLvgOtf7PJnFOXgMLdBQgBlVPO3/D9R8LtF9DBAFPN
hlrsfIG/SqICoRCqUcJ96Pn3P7UUinFG/I0ECGF4EvTE1jnDkfJZr6jrbjgyoZHi
w/4BNwSTL9rWASyLgqlA8u1mf+c2yUwcGhgkRAd1gOwungxcwzwqgljf0N51N5Jf
VRHRtyfwq/ge+YEkDGcTU6Y0sPOuj4Dyfm8fJzdfHNQsWq3PnczLVELStJNdapwP
OoE+lotufe3AM2vAEYJ9rTz3Cki4JFUsgLkHFqGZarrPGi1eyQcXeluldO3m91NK
/1xMI3/+8jbO0tsn1tqSEUGIJi7ox80eSnVlcmdlbiBHcm9zcyA8amdyb3NzQHN1
c2UuZGU+wsB5BBMBAgAjBQJTjHDrAhsDBwsJCAcDAgEGFQgCCQoLBBYCAwECHgEC
F4AACgkQsN6d1ii/Ey+LhQf9GL45eU5vOowA2u5N3g3OZUEBmDHVVbqMtzwlmNC4
k9Kx39r5s2vcFl4tXqW7g9/ViXYuiDXb0RfUpZiIUW89siKrkzmQ5dM7wRqzgJpJ
wK8Bn2MIxAKArekWpiCKvBOB/Cc+3EXE78XdlxLyOi/NrmSGRIov0karw2RzMNOu
5D+jLRZQd1Sv27AR+IP3I8U4aqnhLpwhK7MEy9oCILlgZ1QZe49kpcumcZKORmzB
TNh30FVKK1EvmV2xAKDoaEOgQB4iFQLhJCdP1I5aSgM5IVFdn7v5YgEYuJYx37Io
N1EblHI//x/e2AaIHpzK5h88NEawQsaNRpNSrcfbFmAg987ATQRTjHAWAQgAyzH6
AOODMBjgfWE9VeCgsrwH3exNAU32gLq2xvjpWnHIs98ndPUDpnoxWQugJ6MpMncr
0xSwFmHEgnSEjK/PAjppgmyc57BwKII3sV4on+gDVFJR6Y8ZRwgnBC5mVM6JjQ5x
Dk8WRXljExRfUX9pNhdE5eBOZJrDRoLUmmjDtKzWaDhIg/+1Hzz93X4fCQkNVbVF
LELU9bMaLPBG/x5q4iYZ2k2ex6d47YE1ZFdMm6YBYMOljGkZKwYde5ldM9mo45mm
we0icXKLkpEdIXKTZeKDO+Hdv1aqFuAcccTg9RXDQjmwhC3yEmrmcfl0+rPghO0I
v3OOImwTEe4co3c1mwARAQABwsBfBBgBAgAJBQJTjHAWAhsMAAoJELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R3/CwO0EGAEIACAWIQSFEmdy6PYElKXQl/ew3p3W
KL8TLwUCWt3w0AIbAgCBCRCw3p3WKL8TL3YgBBkWCAAdFiEEUy2wekH2OPMeOLge
gFxhu0/YY74FAlrd8NAACgkQgFxhu0/YY75NiwD/fQf/RXpyv9ZX4n8UJrKDq422
bcwkujisT6jix2mOOwYBAKiip9+mAD6W5NPXdhk1XraECcIspcf2ff5kCAlG0DIN
aTUH/RIwNWzXDG58yQoLdD/UPcFgi8GWtNUp0Fhc/GeBxGipXYnvuWxwS+Qs1Qay
7/Nbal/v4/eZZaWs8wl2VtrHTS96/IF6q2o0qMey0dq2AxnZbQIULiEndgR625EF
RFg+IbO4ldSkB3trsF2ypYLij4ZObm2casLIP7iB8NKmQ5PndL8Y07TtiQ+Sb/wn
g4GgV+BJoKdDWLPCAlCMilwbZ88Ijb+HF/aipc9hsqvW/hnXC2GajJSAY3Qs9Mib
4Hm91jzbAjmp7243pQ4bJMfYHemFFBRaoLC7ayqQjcsttN2ufINlqLFPZPR/i3IX
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----
--------------WLDyLAPat7iV2ru9hIIK7gDk--
--------------qYBFV4fxCGWNE5BE1KOr8YrG--
--------------UsuyoDqOVngPVJZQPUnQdaoT
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature.asc"
-----BEGIN PGP SIGNATURE-----
wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmg3VFAFAwAAAAAACgkQsN6d1ii/Ey/E
cgf9HRi/AUlT/PCZ9hF6vBahfHdlNPASDJOnfCGPtL8frn28VN6qnsVsRzyX/DWDXJWwGvHmgYlp
TqZE6yodTXoUnZ1BzxoYYbp/t5Rkr+BM8iciOvvrMFXOOHnIpzxpSr1ne4LksCBNnx6jWmIvO+/H
W2NKgHagfSl/iSPHW4bzebWP7DIAUBwFsyG+RJQ6v1pGsSuDFJDrm7pHPJPOVNhlqrdTJOQBaA38
wIVku11yvIeBWX35AV0vkzo2jCvCM3KDqTtSivlmP2+YyeU1/PTKoMkUZrRm0rj74E46wUwgAxst
Art9F25zxwgKv8r0/4Q+ore+g7gWvQdcOZHs2KFnEQ==
=8AsH
-----END PGP SIGNATURE-----
--------------UsuyoDqOVngPVJZQPUnQdaoT--
Return-Path: <linux-kernel+bounces-665950-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org [147.75.48.161])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id D9D9A41E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:22:50 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by sy.mirrors.kernel.org (Postfix) with ESMTPS id DA05F7B1C3F
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:21:28 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 681C028E569;
Wed, 28 May 2025 18:22:42 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="SR0X2GWM"
Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131])
(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 5BD501D6195
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:22:38 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748456561; cv=none; b=EpQrs+N0h3muICJrbNpDstkLEe5F1OYEXvAW1btAJ8hk50LykwHEyBElJ47daPYrsL9OAJlVeyBOx4nuxDeC40JWQAltMogHDpG5TnY9UkfuRYdFKPdVc9oBWynxOBnSOCuNB6CVXCXzSVoHO81XOSpglqvCpEvHrAsLVXUt1Ho=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748456561; c=relaxed/simple;
bh=m2bWizstM8R2IyWJ5UZGzimLBXaHf+NXg+15yOIEsvY=;
h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
Content-Type:Content-Disposition:In-Reply-To; b=n0pgXcDgnv3aBW86oSZVnqxiOEQ0gnzGJPjLlsd6rSni0eleL84Az9gv4U7EyiultQgsjUMcBx99i8jJURU6BR3yedaIBUzqgCnUNVLB3DHpdrdY+jjsFZIYIQvW960JLh3ewAL1Csx1ADA4jxJ4YoUDehP+8112W5aWEJZUiNo=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=SR0X2GWM; arc=none smtp.client-ip=205.220.180.131
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com
Received: from pps.filterd (m0279872.ppops.net [127.0.0.1])
by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 54SAI3XT021578
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:22:38 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
cc:content-type:date:from:in-reply-to:message-id:mime-version
:references:subject:to; s=qcppdkim1; bh=VSqQFgb0vNsBP9uzJZGqkiym
8JmNyD9K1JA4p69RyL4=; b=SR0X2GWMZdeo5YIMfu1V5VWPXhm5fizEiLOyztxn
Z31tpRZ5q6jNRWmaYP+x8IHw0ufMx5363oFhVUhFnrTxk/zjJSVSuVK8PnZFR5gC
bE6BeHJJii2czVgO5uOnjNSdNYYzEjsPtxzE/32hPxmLoj4VYG44PYcu8s5p+elY
zgT2AtngHJT+lduDoIt+ig4bjYQ1aPEZXmgHNLWTZM7Z6hBrMT0lmR45xlg6Brjd
7uqgILGSKM7p14GZDFhBQx9fPQsMH0NfhpV6K+MQzR9m534ylmFFbY8mJVgeF1ua
SA8D7ZH8KXzbFEpvb8Tisqc0VasR+SX0gANBDJKCvyj70A==
Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71])
by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46u6g935pf-1
(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT)
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:22:37 +0000 (GMT)
Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-6f8d3f48f35so2898986d6.0
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 11:22:37 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1748456557; x=1749061357;
h=in-reply-to:content-disposition:mime-version:references:message-id
:subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
:message-id:reply-to;
bh=VSqQFgb0vNsBP9uzJZGqkiym8JmNyD9K1JA4p69RyL4=;
b=Gi0XHeSyVg0/QlJp8KdVJxM3ODcVYatBg+px2+NcQUKUfHSYJG66SMEtZ3eaeWFond
gDPoeHlrgrZaPdFtj0GXcooorLt9R5iVbfYPga44geSmlbEd+b8fqh8cZ/EbsKilSu2e
Qbtzj86L0bmUi+fs5zf7Um2MMcLxHBFTUEYqkUzFvhZLn5zt/SETvYsQ9yVrJuS25Ag0
02IqleODm4BNyHWzmbjYfvqk0JALwSU/6mS9FDl1ThUcHzlzhCQrG9eizeH/MxXlLS8v
YaLWGf8If1a1Cj+C+VO1Tr/HyYsXfnlGg5ITdwcYTtCDSu4DTHITMriQMksJRQpm5Lcl
XPcA==
X-Forwarded-Encrypted: i=1; AJvYcCXBfHcJ3v0sdN35XoPk/3e2/xfFkb2RX0JDDXWdoP/zylGn6/h93I/24hxEt1KJwmj1xT1FK/2NcUvIggE=@vger.kernel.org
X-Gm-Message-State: AOJu0YwMYM9tZFHO4wrf3aoIVVI8LzJZ3/77rCZfeFyXvY0vlkV/kBkp
xmV8x8SI0HAOKYAXXMzOK1NfyNoGLXFT3Z1F4rw+UmoI0zyWO+0rqlwFZTOfuSn81ykNGeF2vAr
7wx6H/Wcf7CCTgxKd1hsI/sBOdEWT9ahhPKlEK7347VJEigXU30FWWCj0buO2+H49cFjZ+XIJPN
8=
X-Gm-Gg: ASbGnct2bVr+qrm8ZlTaOst3zyxAGRGlD/00z/DgSeDl0JheL+iRidVuFWoNnJ1BsBW
Q4JIEdzxaRn3azcE/tmKG0JS4widLnwYvtoV8Tvh8uO/Zh0UhUeCRBeF01HBFapWJflwyVuA2Lo
9Rgir1vF0CkKFPWfMVXHDfj1gGCHzqyi9CRi9YjyGctlcmP6P/5nPWd4qe5ZJu4qyaVyPx+Njqx
rakk3Q13wrYh13/SsgcBibAQ+RcwuHPf8a7CUdjxFFDrQ81mJtQBbXtRLrdDg3GY7XsilxODMea
P3Wp+xlEnGfvFBWjB0ujHV5T8eZw/ulv2ULBXcJY6Rzn1HyMdVf1W2Af0yUtw3/t8FF+AkidZZA
=
X-Received: by 2002:a05:622a:10d:b0:48a:4465:bfd8 with SMTP id d75a77b69052e-49f47fd22a3mr268804841cf.49.1748456552243;
Wed, 28 May 2025 11:22:32 -0700 (PDT)
X-Google-Smtp-Source: AGHT+IHBgHDOWO+XsRhKCVgZVBb0vNNcV9Fn1O7FSP1azZt5CGQL4wmPuRN66m2zfRg/m3rWXeXP6g==
X-Received: by 2002:a05:620a:4587:b0:7c5:61b2:b95 with SMTP id af79cd13be357-7ceecc33813mr2659680885a.30.1748456539153;
Wed, 28 May 2025 11:22:19 -0700 (PDT)
Received: from eriador.lumag.spb.ru (2001-14ba-a0c3-3a00--7a1.rev.dnainternet.fi. [2001:14ba:a0c3:3a00::7a1])
by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5532f69a484sm378762e87.116.2025.05.28.11.22.16
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 28 May 2025 11:22:16 -0700 (PDT)
Date: Wed, 28 May 2025 21:22:15 +0300
From: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxxxxxxxx>
To: Jun Nie <jun.nie@xxxxxxxxxx>
Cc: Rob Clark <robdclark@xxxxxxxxx>, Abhinav Kumar <quic_abhinavk@xxxxxxxxxxx>,
Sean Paul <sean@xxxxxxxxxx>,
Marijn Suijten <marijn.suijten@xxxxxxxxxxxxxx>,
David Airlie <airlied@xxxxxxxxx>, Simona Vetter <simona@xxxxxxxx>,
Jessica Zhang <quic_jesszhan@xxxxxxxxxxx>,
Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>,
Maxime Ripard <mripard@xxxxxxxxxx>,
Thomas Zimmermann <tzimmermann@xxxxxxx>, linux-arm-msm@xxxxxxxxxxxxxxx,
dri-devel@xxxxxxxxxxxxxxxxxxxxx, freedreno@xxxxxxxxxxxxxxxxxxxxx,
linux-kernel@xxxxxxxxxxxxxxx
Subject: Re: [PATCH v10 10/12] drm/msm/dpu: support SSPP assignment for
quad-pipe case
Message-ID: <45hk22fdghaqnilukvqayjcbnf3btntknqrwf5ivx346vrgag3@aebzt76tkjzw>
References: <20250526-v6-15-quad-pipe-upstream-v10-0-5fed4f8897c4@xxxxxxxxxx>
<20250526-v6-15-quad-pipe-upstream-v10-10-5fed4f8897c4@xxxxxxxxxx>
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20250526-v6-15-quad-pipe-upstream-v10-10-5fed4f8897c4@xxxxxxxxxx>
X-Authority-Analysis: v=2.4 cv=d4b1yQjE c=1 sm=1 tr=0 ts=6837546e cx=c_pps
a=UgVkIMxJMSkC9lv97toC5g==:117 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10
a=dt9VzEwgFbYA:10 a=sWKEhP36mHoA:10 a=KKAkSRfTAAAA:8 a=giFwS8THduiqBY6JDEUA:9
a=CjuIK1q_8ugA:10 a=1HOtulTD9v-eNWfpl4qZ:22 a=cvBusfyB2V15izCimMoJ:22
X-Proofpoint-ORIG-GUID: iAldZnUdqOy1MmCBbVhO9wCqXnb-xfT8
X-Proofpoint-GUID: iAldZnUdqOy1MmCBbVhO9wCqXnb-xfT8
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTI4MDE2MCBTYWx0ZWRfX0nifCmxfBw09
VFN5VUpek1dGrzF0vB9xA4Sk88i6Oh4BEzSB+y4w+xduvpcX8M9GuzS7SEfz8FUuULEXLdUhpkW
PSY5d6cNm9CH3hg61KUjDepRSRkta93yvU4PYUeyhIx3t25sKxSOZqWB4Xi7jDeW10nwXuLLfnw
o/sz116nX493ANhWUZmGhpLo9DUG9A3DIeoWl8jK6oM9VztUDgAemjFbdarPmYzquV//MMN42wo
TPJWYgcOBrL3ZQ27wJdUvZKpQYj26KGPyDLPCBa+3xrnomnTIBmI8fLVYBOsdmi+JQ0kdgcuDRd
nTJWlpIbjkb2vWXyRyjqf/Mzjv4NCWQznXUcHz8yNDwL9P/6LUi8tgyXjR6jLub3upE6oJ9ILAj
f0i1tpj4efTyq+9QPxFzSyJcGD6QAISDx4/hq1EdcuY0IiAOZn6ulElAr4z8jhFkYOacgYfU
X-Proofpoint-Virus-Version: vendor=baseguard
engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40
definitions=2025-05-28_09,2025-05-27_01,2025-03-28_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
adultscore=0 suspectscore=0 malwarescore=0 phishscore=0 mlxlogscore=999
lowpriorityscore=0 priorityscore=1501 bulkscore=0 spamscore=0 clxscore=1015
impostorscore=0 mlxscore=0 classifier=spam authscore=0 authtc=n/a authcc=
route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505160000
definitions=main-2505280160
X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
On Mon, May 26, 2025 at 05:28:28PM +0800, Jun Nie wrote:
Currently, SSPPs are assigned to a maximum of two pipes. However,
quad-pipe usage scenarios require four pipes and involve configuring
two stages. In quad-pipe case, the first two pipes share a set of
mixer configurations and enable multi-rect mode when certain
conditions are met. The same applies to the subsequent two pipes.
Assign SSPPs to the pipes in each stage using a unified method and
to loop the stages accordingly.
Signed-off-by: Jun Nie <jun.nie@xxxxxxxxxx>
---
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 11 +++
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h | 2 +
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 126 ++++++++++++++++++------------
3 files changed, 88 insertions(+), 51 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index 85f585206218f4578e18b00452762dbada060e9c..47ab43dfec76acc058fb275d1928603e8e8e7fc6 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -1562,6 +1562,17 @@ int dpu_crtc_vblank(struct drm_crtc *crtc, bool en)
return 0;
}
+/**
+ * dpu_crtc_get_num_lm - Get mixer number in this CRTC pipeline
+ * @state: Pointer to drm crtc state object
+ */
+unsigned int dpu_crtc_get_num_lm(const struct drm_crtc_state *state)
+{
+ struct dpu_crtc_state *cstate = to_dpu_crtc_state(state);
+
+ return cstate->num_mixers;
+}
+
#ifdef CONFIG_DEBUG_FS
static int _dpu_debugfs_status_show(struct seq_file *s, void *data)
{
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
index 94392b9b924546f96e738ae20920cf9afd568e6b..6eaba5696e8e6bd1246a9895c4c8714ca6589b10 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
@@ -267,4 +267,6 @@ static inline enum dpu_crtc_client_type dpu_crtc_get_client_type(
void dpu_crtc_frame_event_cb(struct drm_crtc *crtc, u32 event);
+unsigned int dpu_crtc_get_num_lm(const struct drm_crtc_state *state);
+
#endif /* _DPU_CRTC_H_ */
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
index 0bb153a71353ca9eaca138ebbee4cd699414771d..f721dc504bbbe3a49986239adee113bfb6790f70 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
@@ -961,6 +961,33 @@ static int dpu_plane_is_multirect_parallel_capable(struct dpu_hw_sspp *sspp,
dpu_plane_is_parallel_capable(pipe_cfg, fmt, max_linewidth);
}
+static bool dpu_plane_check_single_pipe(struct dpu_plane_state *pstate,
+ struct dpu_sw_pipe **single_pipe,
+ struct dpu_sw_pipe_cfg **single_pipe_cfg,
+ bool config_pipe)
+{
+ int i, valid_pipe = 0;
+ struct dpu_sw_pipe *pipe;
+
+ for (i = 0; i < PIPES_PER_PLANE; i++) {
+ if (drm_rect_width(&pstate->pipe_cfg[i].src_rect) != 0) {
+ valid_pipe++;
+ if (valid_pipe > 1)
+ return false;
+ *single_pipe = &pstate->pipe[i];
+ *single_pipe_cfg = &pstate->pipe_cfg[i];
+ } else {
+ if (!config_pipe)
+ continue;
+ pipe = &pstate->pipe[i];
+ pipe->multirect_index = DPU_SSPP_RECT_SOLO;
+ pipe->multirect_mode = DPU_SSPP_MULTIRECT_NONE;
+ pipe->sspp = NULL;
If this function is 'check', then why does it change something in the
pipe configuration?
+ }
+ }
+
+ return true;
+}
static int dpu_plane_atomic_check_sspp(struct drm_plane *plane,
struct drm_atomic_state *state,
@@ -1028,15 +1055,15 @@ static int dpu_plane_try_multirect_shared(struct dpu_plane_state *pstate,
const struct msm_format *fmt,
uint32_t max_linewidth)
{
- struct dpu_sw_pipe *pipe = &pstate->pipe[0];
- struct dpu_sw_pipe *r_pipe = &pstate->pipe[1];
- struct dpu_sw_pipe_cfg *pipe_cfg = &pstate->pipe_cfg[0];
- struct dpu_sw_pipe *prev_pipe = &prev_adjacent_pstate->pipe[0];
- struct dpu_sw_pipe_cfg *prev_pipe_cfg = &prev_adjacent_pstate->pipe_cfg[0];
+ struct dpu_sw_pipe *pipe, *prev_pipe;
+ struct dpu_sw_pipe_cfg *pipe_cfg, *prev_pipe_cfg;
const struct msm_format *prev_fmt = msm_framebuffer_format(prev_adjacent_pstate->base.fb);
u16 max_tile_height = 1;
- if (prev_adjacent_pstate->pipe[1].sspp != NULL ||
+ if (!dpu_plane_check_single_pipe(pstate, &pipe, &pipe_cfg, true))
+ return false;
+
+ if (!dpu_plane_check_single_pipe(prev_adjacent_pstate, &prev_pipe, &prev_pipe_cfg, false) ||
prev_pipe->multirect_mode != DPU_SSPP_MULTIRECT_NONE)
return false;
@@ -1050,11 +1077,6 @@ static int dpu_plane_try_multirect_shared(struct dpu_plane_state *pstate,
if (MSM_FORMAT_IS_UBWC(prev_fmt))
max_tile_height = max(max_tile_height, prev_fmt->tile_height);
- r_pipe->multirect_index = DPU_SSPP_RECT_SOLO;
- r_pipe->multirect_mode = DPU_SSPP_MULTIRECT_NONE;
-
- r_pipe->sspp = NULL;
-
if (dpu_plane_is_parallel_capable(pipe_cfg, fmt, max_linewidth) &&
dpu_plane_is_parallel_capable(prev_pipe_cfg, prev_fmt, max_linewidth) &&
(pipe_cfg->dst_rect.x1 >= prev_pipe_cfg->dst_rect.x2 ||
@@ -1194,12 +1216,11 @@ static int dpu_plane_virtual_assign_resources(struct drm_crtc *crtc,
struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane);
struct dpu_rm_sspp_requirements reqs;
struct dpu_plane_state *pstate, *prev_adjacent_pstate;
- struct dpu_sw_pipe *pipe;
- struct dpu_sw_pipe *r_pipe;
- struct dpu_sw_pipe_cfg *pipe_cfg;
- struct dpu_sw_pipe_cfg *r_pipe_cfg;
+ struct dpu_sw_pipe *pipe, *r_pipe;
+ struct dpu_sw_pipe_cfg *pipe_cfg, *r_pipe_cfg;
+ struct dpu_plane *pdpu = to_dpu_plane(plane);
const struct msm_format *fmt;
- int i;
+ int i, num_lm, stage_id, num_stages;
if (plane_state->crtc)
crtc_state = drm_atomic_get_new_crtc_state(state,
@@ -1209,11 +1230,6 @@ static int dpu_plane_virtual_assign_resources(struct drm_crtc *crtc,
prev_adjacent_pstate = prev_adjacent_plane_state ?
to_dpu_plane_state(prev_adjacent_plane_state) : NULL;
- pipe = &pstate->pipe[0];
- r_pipe = &pstate->pipe[1];
- pipe_cfg = &pstate->pipe_cfg[0];
- r_pipe_cfg = &pstate->pipe_cfg[1];
-
for (i = 0; i < PIPES_PER_PLANE; i++)
pstate->pipe[i].sspp = NULL;
@@ -1227,44 +1243,52 @@ static int dpu_plane_virtual_assign_resources(struct drm_crtc *crtc,
reqs.rot90 = drm_rotation_90_or_270(plane_state->rotation);
- if (drm_rect_width(&r_pipe_cfg->src_rect) == 0) {
- if (!prev_adjacent_pstate ||
- !dpu_plane_try_multirect_shared(pstate, prev_adjacent_pstate, fmt,
- dpu_kms->catalog->caps->max_linewidth)) {
- pipe->sspp = dpu_rm_reserve_sspp(&dpu_kms->rm, global_state, crtc, &reqs);
- if (!pipe->sspp)
- return -ENODEV;
+ if (prev_adjacent_pstate &&
+ dpu_plane_try_multirect_shared(pstate, prev_adjacent_pstate, fmt,
+ dpu_kms->catalog->caps->max_linewidth)) {
+ goto assigned;
+ }
- r_pipe->sspp = NULL;
+ num_lm = dpu_crtc_get_num_lm(crtc_state);
+ num_stages = (num_lm + 1) / 2;
+ for (stage_id = 0; stage_id < num_stages; stage_id++) {
Can't we just loop through all possible stages? Same result, but makes
the logic somewhat easier.
+ for (i = stage_id * PIPES_PER_STAGE; i < (stage_id + 1) * PIPES_PER_STAGE; i++) {
I still really don't like this idea (and especially the part with
(i % PIPES_PER_STAGE == 0) condition). Extract current code which deals
with two planes and a single stage. Call it for each stage. That's it.
+ pipe = &pstate->pipe[i];
+ pipe_cfg = &pstate->pipe_cfg[i];
- pipe->multirect_index = DPU_SSPP_RECT_SOLO;
- pipe->multirect_mode = DPU_SSPP_MULTIRECT_NONE;
+ if (drm_rect_width(&pipe_cfg->src_rect) == 0)
+ break;
- r_pipe->multirect_index = DPU_SSPP_RECT_SOLO;
- r_pipe->multirect_mode = DPU_SSPP_MULTIRECT_NONE;
- }
- } else {
- pipe->sspp = dpu_rm_reserve_sspp(&dpu_kms->rm, global_state, crtc, &reqs);
- if (!pipe->sspp)
- return -ENODEV;
-
- if (!dpu_plane_try_multirect_parallel(pipe, pipe_cfg, r_pipe, r_pipe_cfg,
- pipe->sspp,
- msm_framebuffer_format(plane_state->fb),
- dpu_kms->catalog->caps->max_linewidth)) {
- /* multirect is not possible, use two SSPP blocks */
- r_pipe->sspp = dpu_rm_reserve_sspp(&dpu_kms->rm, global_state, crtc, &reqs);
- if (!r_pipe->sspp)
+ pipe->sspp = dpu_rm_reserve_sspp(&dpu_kms->rm, global_state, crtc, &reqs);
+ if (!pipe->sspp)
return -ENODEV;
- pipe->multirect_index = DPU_SSPP_RECT_SOLO;
- pipe->multirect_mode = DPU_SSPP_MULTIRECT_NONE;
-
- r_pipe->multirect_index = DPU_SSPP_RECT_SOLO;
- r_pipe->multirect_mode = DPU_SSPP_MULTIRECT_NONE;
+ r_pipe = &pstate->pipe[i + 1];
+ r_pipe_cfg = &pstate->pipe_cfg[i + 1];
+
+ /*
+ * If current pipe is the first pipe in pipe pair, check
+ * multi-rect opportunity for the 2nd pipe in the pair.
+ * SSPP multi-rect mode cross mixer pairs is not supported.
+ */
+ if ((i % PIPES_PER_STAGE == 0) &&
+ drm_rect_width(&r_pipe_cfg->src_rect) != 0 &&
+ dpu_plane_try_multirect_parallel(pipe, pipe_cfg, r_pipe, r_pipe_cfg,
+ pipe->sspp,
+ msm_framebuffer_format(plane_state->fb),
+ dpu_kms->catalog->caps->max_linewidth)) {
+ i++;
+ } else {
+ /* multirect is not possible, use two SSPP blocks */
+ pipe->multirect_index = DPU_SSPP_RECT_SOLO;
+ pipe->multirect_mode = DPU_SSPP_MULTIRECT_NONE;
+ DPU_DEBUG_PLANE(pdpu, "allocating sspp_%d for pipe %d.\n",
+ pipe->sspp->idx - SSPP_NONE, i);
+ }
}
}
+assigned:
return dpu_plane_atomic_check_sspp(plane, state, crtc_state);
}
--
2.34.1
--
With best wishes
Dmitry
Return-Path: <linux-kernel+bounces-665951-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [147.75.80.249])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id F3ECD41E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:23:09 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by am.mirrors.kernel.org (Postfix) with ESMTPS id 96A731C010DB
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:23:22 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 8439F28E585;
Wed, 28 May 2025 18:22:56 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dyusX8Ry"
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201])
(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 7C40420E6E6;
Wed, 28 May 2025 18:22:54 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748456575; cv=none; b=q0usNN79G63QvxfjycLTRDb9U3/GtMHSywGOSmWOkvSH+kg1u43ihF15AIGNC6modrFQdz8lvN1w+f3EHUSAtlZgC6yBeoCka98s2zS9XNL7FBqw20d2sPfGLxQqnU57VQ46UzcL2IHhgotvzeKzmk47Kv2PsW81+qL11fro3Ig=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748456575; c=relaxed/simple;
bh=ne/ZE2VF5l1MSacUXD6JrEN8nuZvqiA58njs1em7rTg=;
h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References:
Content-Type:MIME-Version; b=VS7l4+Zgd5H6I44eai3h4gahqH1NdPw+3txk3uKZUuZAgxWiNHvYOzX1ETqv9GAxoYLpYmFzw6J+YNAuwJY8CcfVe1YmRSD3t3rHsHBa9HuLwvNlTPs24xUItwCAgMVhoDTk/KH0myAd3BC06aq5xy0In6Eh5HhCm00VQOpsWuY=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dyusX8Ry; arc=none smtp.client-ip=10.30.226.201
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 519F2C4CEE3;
Wed, 28 May 2025 18:22:52 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
s=k20201202; t=1748456574;
bh=ne/ZE2VF5l1MSacUXD6JrEN8nuZvqiA58njs1em7rTg=;
h=Subject:From:To:Cc:Date:In-Reply-To:References:From;
b=dyusX8RyqLoe0WB0vz/Pr4ZUDMNcTGrUauCumm1ycklEs5DbECqCfxt255p+UmJOA
uWYeVGdtjsaTvhxgqTQMkA4LZxGwBiX4R0AP0CieTbgzzoCgSUuXCWEZHjFl3tn7ZB
hpOy5qSPQHTcdO1sZrvLfmkyKQ7fs0QfjS/lGyIV8cwjAaW8LZlnAyg182jZVM4mMi
i7SgVI6E8rgpgVE+lZeVIXaKuyiDEVUjU24Q5wvCPOmboHAONNDPlb2xiAFNx63CED
/Y1KLuy63yNYsqUtsHFszwk5AzY4yFlR8mMxYyBiP1Ndyge0faSu43UkZ+8Sv13XXo
P8QMIHjX2W2rA==
Message-ID: <298ef5505e7abb9a0ca5f151090a42f8bf330c43.camel@xxxxxxxxxx>
Subject: Re: [PATCH 0/2] nfsd: use threads array as-is in netlink thread set
interface
From: Jeff Layton <jlayton@xxxxxxxxxx>
To: cel@xxxxxxxxxx, Olga Kornievskaia <okorniev@xxxxxxxxxx>, Dai Ngo
<Dai.Ngo@xxxxxxxxxx>, Tom Talpey <tom@xxxxxxxxxx>, Steven Rostedt
<rostedt@xxxxxxxxxxx>, Masami Hiramatsu <mhiramat@xxxxxxxxxx>, Mathieu
Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>, Trond Myklebust
<trondmy@xxxxxxxxxx>, Anna Schumaker <anna@xxxxxxxxxx>, "David S. Miller"
<davem@xxxxxxxxxxxxx>, Eric Dumazet <edumazet@xxxxxxxxxx>, Jakub Kicinski
<kuba@xxxxxxxxxx>, Paolo Abeni <pabeni@xxxxxxxxxx>, Simon Horman
<horms@xxxxxxxxxx>, NeilBrown <neil@xxxxxxxxxx>
Cc: Chuck Lever <chuck.lever@xxxxxxxxxx>, Mike Snitzer <snitzer@xxxxxxxxxx>,
linux-nfs@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx,
linux-trace-kernel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx
Date: Wed, 28 May 2025 14:22:51 -0400
In-Reply-To: <174845587080.200069.9203268802136145057.b4-ty@xxxxxxxxxx>
References: <20250527-rpc-numa-v1-0-fa1d98e9a900@xxxxxxxxxx>
<174845587080.200069.9203268802136145057.b4-ty@xxxxxxxxxx>
Autocrypt: addr=jlayton@xxxxxxxxxx; prefer-encrypt=mutual;
keydata=mQINBE6V0TwBEADXhJg7s8wFDwBMEvn0qyhAnzFLTOCHooMZyx7XO7dAiIhDSi7G1NPxw
n8jdFUQMCR/GlpozMFlSFiZXiObE7sef9rTtM68ukUyZM4pJ9l0KjQNgDJ6Fr342Htkjxu/kFV1Wv
egyjnSsFt7EGoDjdKqr1TS9syJYFjagYtvWk/UfHlW09X+jOh4vYtfX7iYSx/NfqV3W1D7EDi0PqV
T2h6v8i8YqsATFPwO4nuiTmL6I40ZofxVd+9wdRI4Db8yUNA4ZSP2nqLcLtFjClYRBoJvRWvsv4lm
0OX6MYPtv76hka8lW4mnRmZqqx3UtfHX/hF/zH24Gj7A6sYKYLCU3YrI2Ogiu7/ksKcl7goQjpvtV
YrOOI5VGLHge0awt7bhMCTM9KAfPc+xL/ZxAMVWd3NCk5SamL2cE99UWgtvNOIYU8m6EjTLhsj8sn
VluJH0/RcxEeFbnSaswVChNSGa7mXJrTR22lRL6ZPjdMgS2Km90haWPRc8Wolcz07Y2se0xpGVLEQ
cDEsvv5IMmeMe1/qLZ6NaVkNuL3WOXvxaVT9USW1+/SGipO2IpKJjeDZfehlB/kpfF24+RrK+seQf
CBYyUE8QJpvTZyfUHNYldXlrjO6n5MdOempLqWpfOmcGkwnyNRBR46g/jf8KnPRwXs509yAqDB6sE
LZH+yWr9LQZEwARAQABtCVKZWZmIExheXRvbiA8amxheXRvbkBwb29jaGllcmVkcy5uZXQ+iQI7BB
MBAgAlAhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAUCTpXWPAIZAQAKCRAADmhBGVaCFc65D/4
gBLNMHopQYgG/9RIM3kgFCCQV0pLv0hcg1cjr+bPI5f1PzJoOVi9s0wBDHwp8+vtHgYhM54yt43uI
7Htij0RHFL5eFqoVT4TSfAg2qlvNemJEOY0e4daljjmZM7UtmpGs9NN0r9r50W82eb5Kw5bc/r0km
R/arUS2st+ecRsCnwAOj6HiURwIgfDMHGPtSkoPpu3DDp/cjcYUg3HaOJuTjtGHFH963B+f+hyQ2B
rQZBBE76ErgTDJ2Db9Ey0kw7VEZ4I2nnVUY9B5dE2pJFVO5HJBMp30fUGKvwaKqYCU2iAKxdmJXRI
ONb7dSde8LqZahuunPDMZyMA5+mkQl7kpIpR6kVDIiqmxzRuPeiMP7O2FCUlS2DnJnRVrHmCljLkZ
Wf7ZUA22wJpepBligemtSRSbqCyZ3B48zJ8g5B8xLEntPo/NknSJaYRvfEQqGxgk5kkNWMIMDkfQO
lDSXZvoxqU9wFH/9jTv1/6p8dHeGM0BsbBLMqQaqnWiVt5mG92E1zkOW69LnoozE6Le+12DsNW7Rj
iR5K+27MObjXEYIW7FIvNN/TQ6U1EOsdxwB8o//Yfc3p2QqPr5uS93SDDan5ehH59BnHpguTc27Xi
QQZ9EGiieCUx6Zh2ze3X2UW9YNzE15uKwkkuEIj60NvQRmEDfweYfOfPVOueC+iFifbQgSmVmZiBM
YXl0b24gPGpsYXl0b25AcmVkaGF0LmNvbT6JAjgEEwECACIFAk6V0q0CGwMGCwkIBwMCBhUIAgkKC
wQWAgMBAh4BAheAAAoJEAAOaEEZVoIViKUQALpvsacTMWWOd7SlPFzIYy2/fjvKlfB/Xs4YdNcf9q
LqF+lk2RBUHdR/dGwZpvw/OLmnZ8TryDo2zXVJNWEEUFNc7wQpl3i78r6UU/GUY/RQmOgPhs3epQC
3PMJj4xFx+VuVcf/MXgDDdBUHaCTT793hyBeDbQuciARDJAW24Q1RCmjcwWIV/pgrlFa4lAXsmhoa
c8UPc82Ijrs6ivlTweFf16VBc4nSLX5FB3ls7S5noRhm5/Zsd4PGPgIHgCZcPgkAnU1S/A/rSqf3F
LpU+CbVBDvlVAnOq9gfNF+QiTlOHdZVIe4gEYAU3CUjbleywQqV02BKxPVM0C5/oVjMVx3bri75n1
TkBYGmqAXy9usCkHIsG5CBHmphv9MHmqMZQVsxvCzfnI5IO1+7MoloeeW/lxuyd0pU88dZsV/riHw
87i2GJUJtVlMl5IGBNFpqoNUoqmvRfEMeXhy/kUX4Xc03I1coZIgmwLmCSXwx9MaCPFzV/dOOrju2
xjO+2sYyB5BNtxRqUEyXglpujFZqJxxau7E0eXoYgoY9gtFGsspzFkVNntamVXEWVVgzJJr/EWW0y
+jNd54MfPRqH+eCGuqlnNLktSAVz1MvVRY1dxUltSlDZT7P2bUoMorIPu8p7ZCg9dyX1+9T6Muc5d
Hxf/BBP/ir+3e8JTFQBFOiLNdFtB9KZWZmIExheXRvbiA8amxheXRvbkBzYW1iYS5vcmc+iQI4BBM
BAgAiBQJOldK9AhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRAADmhBGVaCFWgWD/0ZRi4h
N9FK2BdQs9RwNnFZUr7JidAWfCrs37XrA/56olQl3ojn0fQtrP4DbTmCuh0SfMijB24psy1GnkPep
naQ6VRf7Dxg/Y8muZELSOtsv2CKt3/02J1BBitrkkqmHyni5fLLYYg6fub0T/8Kwo1qGPdu1hx2BQ
RERYtQ/S5d/T0cACdlzi6w8rs5f09hU9Tu4qV1JLKmBTgUWKN969HPRkxiojLQziHVyM/weR5Reu6
FZVNuVBGqBD+sfk/c98VJHjsQhYJijcsmgMb1NohAzwrBKcSGKOWJToGEO/1RkIN8tqGnYNp2G+aR
685D0chgTl1WzPRM6mFG1+n2b2RR95DxumKVpwBwdLPoCkI24JkeDJ7lXSe3uFWISstFGt0HL8Eew
P8RuGC8s5h7Ct91HMNQTbjgA+Vi1foWUVXpEintAKgoywaIDlJfTZIl6Ew8ETN/7DLy8bXYgq0Xzh
aKg3CnOUuGQV5/nl4OAX/3jocT5Cz/OtAiNYj5mLPeL5z2ZszjoCAH6caqsF2oLyAnLqRgDgR+wTQ
T6gMhr2IRsl+cp8gPHBwQ4uZMb+X00c/Amm9VfviT+BI7B66cnC7Zv6Gvmtu2rEjWDGWPqUgccB7h
dMKnKDthkA227/82tYoFiFMb/NwtgGrn5n2vwJyKN6SEoygGrNt0SI84y6hEVbQlSmVmZiBMYXl0b
24gPGpsYXl0b25AcHJpbWFyeWRhdGEuY29tPokCOQQTAQIAIwUCU4xmKQIbAwcLCQgHAwIBBhUIAg
kKCwQWAgMBAh4BAheAAAoJEAAOaEEZVoIV1H0P/j4OUTwFd7BBbpoSp695qb6HqCzWMuExsp8nZjr
uymMaeZbGr3OWMNEXRI1FWNHMtcMHWLP/RaDqCJil28proO+PQ/yPhsr2QqJcW4nr91tBrv/MqItu
AXLYlsgXqp4BxLP67bzRJ1Bd2x0bWXurpEXY//VBOLnODqThGEcL7jouwjmnRh9FTKZfBDpFRaEfD
FOXIfAkMKBa/c9TQwRpx2DPsl3eFWVCNuNGKeGsirLqCxUg5kWTxEorROppz9oU4HPicL6rRH22Ce
6nOAON2vHvhkUuO3GbffhrcsPD4DaYup4ic+DxWm+DaSSRJ+e1yJvwi6NmQ9P9UAuLG93S2MdNNbo
sZ9P8k2mTOVKMc+GooI9Ve/vH8unwitwo7ORMVXhJeU6Q0X7zf3SjwDq2lBhn1DSuTsn2DbsNTiDv
qrAaCvbsTsw+SZRwF85eG67eAwouYk+dnKmp1q57LDKMyzysij2oDKbcBlwB/TeX16p8+LxECv51a
sjS9TInnipssssUDrHIvoTTXWcz7Y5wIngxDFwT8rPY3EggzLGfK5Zx2Q5S/N0FfmADmKknG/D8qG
IcJE574D956tiUDKN4I+/g125ORR1v7bP+OIaayAvq17RP+qcAqkxc0x8iCYVCYDouDyNvWPGRhbL
UO7mlBpjW9jK9e2fvZY9iw3QzIPGKtClKZWZmIExheXRvbiA8amVmZi5sYXl0b25AcHJpbWFyeWRh
dGEuY29tPokCOQQTAQIAIwUCU4xmUAIbAwcLCQgHAwIBBhUIAgkKCwQWAgMBAh4BAheAAAoJEAAOa
EEZVoIVzJoQALFCS6n/FHQS+hIzHIb56JbokhK0AFqoLVzLKzrnaeXhE5isWcVg0eoV2oTScIwUSU
apy94if69tnUo4Q7YNt8/6yFM6hwZAxFjOXR0ciGE3Q+Z1zi49Ox51yjGMQGxlakV9ep4sV/d5a50
M+LFTmYSAFp6HY23JN9PkjVJC4PUv5DYRbOZ6Y1+TfXKBAewMVqtwT1Y+LPlfmI8dbbbuUX/kKZ5d
dhV2736fgyfpslvJKYl0YifUOVy4D1G/oSycyHkJG78OvX4JKcf2kKzVvg7/Rnv+AueCfFQ6nGwPn
0P91I7TEOC4XfZ6a1K3uTp4fPPs1Wn75X7K8lzJP/p8lme40uqwAyBjk+IA5VGd+CVRiyJTpGZwA0
jwSYLyXboX+Dqm9pSYzmC9+/AE7lIgpWj+3iNisp1SWtHc4pdtQ5EU2SEz8yKvDbD0lNDbv4ljI7e
flPsvN6vOrxz24mCliEco5DwhpaaSnzWnbAPXhQDWb/lUgs/JNk8dtwmvWnqCwRqElMLVisAbJmC0
BhZ/Ab4sph3EaiZfdXKhiQqSGdK4La3OTJOJYZphPdGgnkvDV9Pl1QZ0ijXQrVIy3zd6VCNaKYq7B
AKidn5g/2Q8oio9Tf4XfdZ9dtwcB+bwDJFgvvDYaZ5bI3ln4V3EyW5i2NfXazz/GA/I/ZtbsigCFc
8ftCBKZWZmIExheXRvbiA8amxheXRvbkBrZXJuZWwub3JnPokCOAQTAQIAIgUCWe8u6AIbAwYLCQg
HAwIGFQgCCQoLBBYCAwECHgECF4AACgkQAA5oQRlWghUuCg/+Lb/xGxZD2Q1oJVAE37uW308UpVSD
2tAMJUvFTdDbfe3zKlPDTuVsyNsALBGclPLagJ5ZTP+Vp2irAN9uwBuacBOTtmOdz4ZN2tdvNgozz
uxp4CHBDVzAslUi2idy+xpsp47DWPxYFIRP3M8QG/aNW052LaPc0cedYxp8+9eiVUNpxF4SiU4i9J
DfX/sn9XcfoVZIxMpCRE750zvJvcCUz9HojsrMQ1NFc7MFT1z3MOW2/RlzPcog7xvR5ENPH19ojRD
CHqumUHRry+RF0lH00clzX/W8OrQJZtoBPXv9ahka/Vp7kEulcBJr1cH5Wz/WprhsIM7U9pse1f1g
Yy9YbXtWctUz8uvDR7shsQxAhX3qO7DilMtuGo1v97I/Kx4gXQ52syh/w6EBny71CZrOgD6kJwPVV
AaM1LRC28muq91WCFhs/nzHozpbzcheyGtMUI2Ao4K6mnY+3zIuXPygZMFr9KXE6fF7HzKxKuZMJO
aEZCiDOq0anx6FmOzs5E6Jqdpo/mtI8beK+BE7Va6ni7YrQlnT0i3vaTVMTiCThbqsB20VrbMjlhp
f8lfK1XVNbRq/R7GZ9zHESlsa35ha60yd/j3pu5hT2xyy8krV8vGhHvnJ1XRMJBAB/UYb6FyC7S+m
QZIQXVeAA+smfTT0tDrisj1U5x6ZB9b3nBg65kc=
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.56.2 (3.56.2-1.fc42)
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
X-Spam-Status: No, score=-6.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,
RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,
RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
On Wed, 2025-05-28 at 14:11 -0400, cel@xxxxxxxxxx wrote:
From: Chuck Lever <chuck.lever@xxxxxxxxxx>
=20
On Tue, 27 May 2025 20:12:46 -0400, Jeff Layton wrote:
> The first patch is probably appropriate for stable. It should fix
> problems when someone sets the pool_mode to pernode, without userland
> sending down a fully-populated thread array.
>=20
> The second patch just adds a couple of new tracepoints that I ended up
> using to track this down.
>=20
> [...]
=20
Applied to nfsd-testing, thanks!
=20
[1/2] nfsd: use threads array as-is in netlink interface
commit: b2a9a114a3c7f5abfa2875b70ce9b73525a74291
[2/2] sunrpc: new tracepoints around svc thread wakeups
commit: 65b8babe551bddf00aac69bc905f88a4e0371766
=20
My apologies, Chuck. Patch #2 has a bug in it:
+ trace_svc_pool_thread_noidle(pool, rqstp->rq_task->pid);
In the call above, the rqstp will be undefined. That should be:
+ trace_svc_pool_thread_noidle(pool, 0);
You can fix that up in tree, or I can resend if you prefer.
Thanks!
--=20
Jeff Layton <jlayton@xxxxxxxxxx>
Return-Path: <linux-kernel+bounces-665952-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id C5BA641E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:24:04 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8C5D217B23C
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:24:04 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id ED5DB28E569;
Wed, 28 May 2025 18:23:56 +0000 (UTC)
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 3BA901EE7B7;
Wed, 28 May 2025 18:23:53 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748456636; cv=none; b=Gkn8XQfY+IAf1Cl25JBHrO6fx6ZOGLuFQQqTeNpo4oSDFfb8Aon2wGE0+3oTN0jSGp6A88h/yoapG0OmP8AlJ9RLiIIV5GtAWN+pibtXoQ9j+Y+c8S3hDv5j0TEFOVJypkTHg2At63HoOOQa3nFuycJMuyauRJoeLwHgW48Vpp0=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748456636; c=relaxed/simple;
bh=enDF2O25sGb/ee6lJKY2ZZOjnEtQA80nowgFOkJZplU=;
h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:
MIME-Version; b=ezb6P728vLpnkZrcQXA4SdfQHf7iGhXHdDqegNBRJZfV8hgWILf0qJnJJmesiuKnpThvmbOmPxKG6SwmWODQH8pPjAzzNjMQImI2iTyqymg88ceMcZGGQQqplumR5t8OWdesayCcpE1uYKFgjYP74tfeQwE3/5UAU5oO4rApmEY=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com; spf=none smtp.mailfrom=foss.arm.com; arc=none smtp.client-ip=217.140.110.172
Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com
Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=foss.arm.com
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D2BBF1A2D;
Wed, 28 May 2025 11:23:36 -0700 (PDT)
Received: from usa.arm.com (unknown [10.57.48.131])
by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 638B93F673;
Wed, 28 May 2025 11:23:51 -0700 (PDT)
From: Aishwarya <aishwarya.tcv@xxxxxxx>
To: david@xxxxxxxxxx
Cc: ryan.roberts@xxxxxxx,
Aishwarya.TCV@xxxxxxx,
akpm@xxxxxxxxxxxxxxxxxxxx,
dev.jain@xxxxxxx,
linux-kernel@xxxxxxxxxxxxxxx,
linux-kselftest@xxxxxxxxxxxxxxx,
linux-mm@xxxxxxxxx,
lorenzo.stoakes@xxxxxxxxxx,
mingo@xxxxxxxxxx,
peterx@xxxxxxxxxx,
shuah@xxxxxxxxxx,
Aishwarya TCV <aishwarya.tcv@xxxxxxx>
Subject: Re: [PATCH v2] selftests/mm: add simple VM_PFNMAP tests based on mmap'ing /dev/mem
Date: Wed, 28 May 2025 19:23:38 +0100
Message-Id: <20250528182338.30117-1-aishwarya.tcv@xxxxxxx>
X-Mailer: git-send-email 2.39.5 (Apple Git-154)
In-Reply-To: <7df6ecb7-0aa8-4f18-ba8a-ce6d095cbd42@xxxxxxx>
References: <7df6ecb7-0aa8-4f18-ba8a-ce6d095cbd42@xxxxxxx>
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Status: No, score=-3.3 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS,
MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
Hi David,
I applied the patch on next-20250515 and ran the test. The issue is no
longer observed, and the test completed successfully. I can confirm
that the patch resolves the problem.
Tested-by: Aishwarya TCV <aishwarya.tcv@xxxxxxx>
Thanks,
Aishwarya
Return-Path: <linux-kernel+bounces-665953-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [139.178.88.99])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 541A441E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:24:29 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by sv.mirrors.kernel.org (Postfix) with ESMTPS id B74253B63F7
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:24:06 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id D7D9728E56E;
Wed, 28 May 2025 18:24:22 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="hPQQXk/Y"
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201])
(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 B01E7286D69
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:24:21 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748456662; cv=none; b=pjs2GtwJOiFTnTcL3p1lg5JO3a9RHQn3gn6UmZJFnnd1dbPOs10sU+b2lgh+C1OJLIjDt5NU/bSga8PvaFIW76qBF6GXM/J/BvRvoi417RyRqL2Olfqr0F2o0n7o0+2MixOBCiLVsMtUsvDOu2dxuscRX5ELsqHvr36J4pk3Ukc=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748456662; c=relaxed/simple;
bh=WLFHdokIEiKAduh/NqbqXIeup1v2VNaeRhhmYuC35/c=;
h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References:
Mime-Version:Content-Type; b=isanSaC1Kkuzfdlmio75zwm6Nc+mTdFNQDmC6VrZso4/hMhqHxnwVDBsWgBinks2S/AaCp/Ng+0U4c5kJ+QzQPCsmccc0upsFBWZ/srQv1gYMXl66TTKsH/eMOLawSVNU2l/cTTJWQHVrYIb4AKh7hfPiaiflgCJA/DHCzU1P8w=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=hPQQXk/Y; arc=none smtp.client-ip=10.30.226.201
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81DE1C4CEE3;
Wed, 28 May 2025 18:24:20 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org;
s=korg; t=1748456661;
bh=WLFHdokIEiKAduh/NqbqXIeup1v2VNaeRhhmYuC35/c=;
h=Date:From:To:Cc:Subject:In-Reply-To:References:From;
b=hPQQXk/YGUcpo9h7DrJc4gpim2zo0jIW6pdigAYLBQXwe75OVG5RhWK4TWM9jot01
y6KwGDQzIvXKETbFYAgg17f6PuE6lU6xN4O0DRWcFd6oQZy2zm5duMfuAfWH4w2dF1
ZSzncBUnuZWx4q8ngqHenMmrnNd4Inwz7Qlnbhpk=
Date: Wed, 28 May 2025 11:24:19 -0700
From: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
To: Vlastimil Babka <vbabka@xxxxxxx>
Cc: Juan Yescas <jyescas@xxxxxxxxxx>, David Hildenbrand <david@xxxxxxxxxx>,
Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx>, "Liam R. Howlett"
<Liam.Howlett@xxxxxxxxxx>, Mike Rapoport <rppt@xxxxxxxxxx>, Suren
Baghdasaryan <surenb@xxxxxxxxxx>, Michal Hocko <mhocko@xxxxxxxx>, Zi Yan
<ziy@xxxxxxxxxx>, linux-mm@xxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx,
tjmercier@xxxxxxxxxx, isaacmanjarres@xxxxxxxxxx, kaleshsingh@xxxxxxxxxx,
masahiroy@xxxxxxxxxx, Minchan Kim <minchan@xxxxxxxxxx>
Subject: Re: [PATCH v7] mm: Add CONFIG_PAGE_BLOCK_ORDER to select page block
order
Message-Id: <20250528112419.cac43a6abff2c0e005764a79@xxxxxxxxxxxxxxxxxxxx>
In-Reply-To: <77f9dd55-fc5c-44c8-b7ac-eac68c1d378f@xxxxxxx>
References: <20250521215807.1860663-1-jyescas@xxxxxxxxxx>
<77f9dd55-fc5c-44c8-b7ac-eac68c1d378f@xxxxxxx>
X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu)
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Spam-Status: No, score=-6.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,
NICE_REPLY_A,RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,
RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
On Wed, 28 May 2025 10:21:46 +0200 Vlastimil Babka <vbabka@xxxxxxx> wrote:
Reviewed-by: Vlastimil Babka <vbabka@xxxxxxx>
Great, thanks. I'll move this patch into mm-stable. I'll be sending
two MM pull requests to Linus this cycle. The below patches will be in
the second batch, next week.
#
m68k-remove-use-of-page-index.patch
mm-rename-page-index-to-page-__folio_index.patch
#
ntfs3-use-folios-more-in-ntfs_compress_write.patch
iov-remove-copy_page_from_iter_atomic.patch
#
zram-rename-zcomp_param_no_level.patch
zram-support-deflate-specific-params.patch
#
selftests-mm-deduplicate-test-logging-in-test_mlock_lock.patch
#
selftests-mm-deduplicate-default-page-size-test-results-in-thuge-gen.patch
#
memcg-disable-kmem-charging-in-nmi-for-unsupported-arch.patch
memcg-nmi-safe-memcg-stats-for-specific-archs.patch
memcg-add-nmi-safe-update-for-memcg_kmem.patch
memcg-nmi-safe-slab-stats-updates.patch
memcg-make-memcg_rstat_updated-nmi-safe.patch
#
mm-damon-core-avoid-destroyed-target-reference-from-damos-quota.patch
#
mm-shmem-avoid-unpaired-folio_unlock-in-shmem_swapin_folio.patch
mm-shmem-add-missing-shmem_unacct_size-in-__shmem_file_setup.patch
mm-shmem-fix-potential-dead-loop-in-shmem_unuse.patch
mm-shmem-only-remove-inode-from-swaplist-when-its-swapped-page-count-is-0.patch
mm-shmem-remove-unneeded-xa_is_value-check-in-shmem_unuse_swap_entries.patch
#
selftests-mm-skip-guard_regionsuffd-tests-when-uffd-is-not-present.patch
selftests-mm-skip-hugevm-test-if-kernel-config-file-is-not-present.patch
#
hugetlb-show-nr_huge_pages-in-report_hugepages.patch
#
#
mm-damon-kconfig-set-damon_vaddrpaddrsysfs-default-to-damon.patch
mm-damon-kconfig-enable-config_damon-by-default.patch
#
mmu_gather-move-tlb-flush-for-vm_pfnmap-vm_mixedmap-vmas-into-free_pgtables.patch
#
mm-rust-make-config_mmu-ifdefs-more-narrow.patch
#
kcov-rust-add-flags-for-kcov-with-rust.patch
#
#
selftests-mm-deduplicate-test-names-in-madv_populate.patch
#
mmu_notifiers-remove-leftover-stub-macros.patch
#
mm-add-config_page_block_order-to-select-page-block-order.patch
#
Return-Path: <linux-kernel+bounces-665954-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [147.75.80.249])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 268BC41E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:24:41 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by am.mirrors.kernel.org (Postfix) with ESMTPS id 0078D1C0121A
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:24:54 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 9CC9B286D69;
Wed, 28 May 2025 18:24:25 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SPhtmiXc"
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201])
(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 DCDD128E585;
Wed, 28 May 2025 18:24:24 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748456665; cv=none; b=pJ7pdaY1m37unCd/RgQn4ZZ7nb2sevJV3Y0Q2KmhcZlkYGjcW2F/7LLIDsoQxsdm5JPlfEZTmFGrBdj9vgNPwVWyXxdYq/X0bMrWA5x3H2w3Y+D+xblUMj9CB1YScnetkLPKPxJIOQjlBL5DDZ7YjxiA/TKrjkhVPMG+7ieFwQk=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748456665; c=relaxed/simple;
bh=VdtY8LqEyBJypLL5p9nIDE+rbyWPhX/d8Y9T4l0C3Ek=;
h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
Content-Type:Content-Disposition:In-Reply-To; b=WNPYiHS8pDsjGE/t2iv+PBOiRKdAIgsoojaBcD8I2ly825ZSM4iwtbw+a8xAboFOjasC1TYpqbHjVF07IIMRmijRSmYVJPT4Ff/xrGdd90yJidN5RH4VXMV/pOi42Itb/1ZypFrnV2902OwoLg5DcoU9fCCEEKFareJlJelnD9Q=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SPhtmiXc; arc=none smtp.client-ip=10.30.226.201
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B35BC4CEED;
Wed, 28 May 2025 18:24:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
s=k20201202; t=1748456664;
bh=VdtY8LqEyBJypLL5p9nIDE+rbyWPhX/d8Y9T4l0C3Ek=;
h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
b=SPhtmiXcJ/CDPHmkzH6ZeAnm3VOouWW2jo1NU2cVzU3XJE407CBJfkWNI5VyQsf2L
i9yC07kM3ppoQQupL20LMvolMMAyM4SnACNStq/4aszjmi0q6rR8i9Dg0zc6RkDdr1
aacxX5by0RYlMcjexBLDZBZQCmp4JAakfLjPv6B6CXGyEGT5TvscgWxw9IGjUAsyej
xedLpE+tVuEGln0jEe1qTHubC1DAxouNvZggEUXnISkxTEueiGlVaJlQDQzmQlB6Dr
Gt7ih24VuOPw5/c8OXBdnZAuJKRH7vpFso4l2lvkIi8R80nsaTMbVPxC4t5ASbKzOK
LmV5pOSONMBcw==
Date: Wed, 28 May 2025 11:24:22 -0700
From: Namhyung Kim <namhyung@xxxxxxxxxx>
To: Ian Rogers <irogers@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>,
Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>,
Mark Rutland <mark.rutland@xxxxxxx>,
Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>,
Adrian Hunter <adrian.hunter@xxxxxxxxx>,
Kan Liang <kan.liang@xxxxxxxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx,
linux-perf-users@xxxxxxxxxxxxxxx
Subject: Re: [RFC PATCH v1] perf build: Fix build for clang's
-Wunreachable-code
Message-ID: <aDdU1npHL2Vczhsa@xxxxxxxxxx>
References: <20250410202647.1899125-1-irogers@xxxxxxxxxx>
<Z_mK9BVv16MT7shL@z2>
<CAP-5=fWykL-01S=35zz-6JASbM_cQkx6PHdKS7pJAX0=JBTuNQ@xxxxxxxxxxxxxx>
<CAP-5=fWFYS7-FcbyJ5Z5U2rqA7eYwwJ4dMf90TUzwJ0Shh2yxA@xxxxxxxxxxxxxx>
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <CAP-5=fWFYS7-FcbyJ5Z5U2rqA7eYwwJ4dMf90TUzwJ0Shh2yxA@xxxxxxxxxxxxxx>
X-Spam-Status: No, score=-6.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,
RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,
RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
On Tue, May 27, 2025 at 01:53:37PM -0700, Ian Rogers wrote:
On Fri, Apr 11, 2025 at 3:14 PM Ian Rogers <irogers@xxxxxxxxxx> wrote:
>
> On Fri, Apr 11, 2025 at 2:34 PM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
> >
> > Hi Ian,
> >
> > On Thu, Apr 10, 2025 at 01:26:47PM -0700, Ian Rogers wrote:
> > > Clang's unreachable code warning is able to catch bugs like the famous
> > > "goto fail" which gcc's unreachable code warning fails to warn about
> > > (it will complain about misleading indent). The changes here are
> > > sufficient to get perf building with clang with -Wunreachable code,
> > > but they don't really fix any bugs. Posting as an RFC to see if anyone
> > > things this is worth pursuing.
> >
> > I'm not sure if it's useful and don't see what kind of bugs it can
> > address. The proposed changes don't look like an improvement.
>
> The goto fail case was in OpenSSL the code from a bad merge:
> ```
> if (...)
> goto fail;
> goto fail;
> ```
> Meaning the fail path was always taken and checking on the non-fail
> code never executed. Newer GCCs will warn of this because of the
> "misleading indent" but clang won't. It is easy to imagine similar
> mistakes creeping in, so using compiler warnings to avoid the bug
> could be useful.
It doesn't look very convincing to me but it might be valuable in some
rare cases. But the proposed changes - basically replace exit() to
__builtin_unreachable() - seem weird. Why is calling it a problem? I
guess it already has some kind of annotation like "noreturn"?
Thanks,
Namhyung
Return-Path: <linux-kernel+bounces-665955-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [139.178.88.99])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id C24DB41E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:25:18 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0A1183BF592
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:24:58 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 32B0D28E583;
Wed, 28 May 2025 18:25:08 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lm6NlCxb"
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201])
(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 660921EE7B7;
Wed, 28 May 2025 18:25:07 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748456707; cv=none; b=mdVfVDhB81QmVBynbn2trAbf564azOcTiMj8Y5LJCtVp977tuBaYoDMA5z4NKCD16j4OegShKABpKHj51zo/Y2s2V+uUT8bmVp/6/smfwI8F7s9dolrPCmVnq37jFuqmzCC7lo8w6esfWLMiMFH6LGDPhW84RkxkRecwWKtQE58=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748456707; c=relaxed/simple;
bh=9R7rQjswLIJrPgJWl6lP8SrIEa2p86XfG8Anl84D21U=;
h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:
In-Reply-To:Content-Type; b=cEXbjy1D4ncB4JQ+BQY/Ud94SxQL/Brf7+9txqymDITR32wOedAA5BEvwvfl/MRBeO+E2mbmByr6Yahu43H3NTO3sqrqSw6MrH8SZ9cVoo+ZUVkpyKldKErwQH6vgQzXVx4vch97BXDTSJTm4wjT9WRzjJd4tp22hi3NCFEslyE=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lm6NlCxb; arc=none smtp.client-ip=10.30.226.201
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17B4DC4CEEB;
Wed, 28 May 2025 18:25:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
s=k20201202; t=1748456706;
bh=9R7rQjswLIJrPgJWl6lP8SrIEa2p86XfG8Anl84D21U=;
h=Date:Subject:To:Cc:References:From:In-Reply-To:From;
b=lm6NlCxb4vJfwwDcN3M2IJMcH6XVEBaOsoyVhSjaFO6iaP8Fvlf+oxupHzRawfPff
Q8hd7RaxLTWOMi4ZI3RPk2rdJUrOd4tDzZjbV5Ni4ETaLsyBGIWHbitCyhJFG0+3tw
cY2PQXrv743zvL+0Ey9h0Aoe0I8PTQRCspi2+YABHXwzqRv5qp59euZuZFvV9PJWdT
sr2uPrzcpf7DhWTlvHAJJpeE44NYZxC6iPI1nYibsBO2wRTG9VL5imJ9f8FJg3E68B
ZY2oA7BKjVHApGbiHAjegPoQiaFpANf3Uf1q9IHnSFY5R72sX1uIA303KVUJeYVKTe
J5pBf/3lIn1Cg==
Message-ID: <b8061efa-83ef-4a7a-a39e-0475dce42614@xxxxxxxxxx>
Date: Wed, 28 May 2025 14:25:04 -0400
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 0/2] nfsd: use threads array as-is in netlink thread set
interface
To: Jeff Layton <jlayton@xxxxxxxxxx>, Olga Kornievskaia
<okorniev@xxxxxxxxxx>, Dai Ngo <Dai.Ngo@xxxxxxxxxx>,
Tom Talpey <tom@xxxxxxxxxx>, Steven Rostedt <rostedt@xxxxxxxxxxx>,
Masami Hiramatsu <mhiramat@xxxxxxxxxx>,
Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>,
Trond Myklebust <trondmy@xxxxxxxxxx>, Anna Schumaker <anna@xxxxxxxxxx>,
"David S. Miller" <davem@xxxxxxxxxxxxx>, Eric Dumazet <edumazet@xxxxxxxxxx>,
Jakub Kicinski <kuba@xxxxxxxxxx>, Paolo Abeni <pabeni@xxxxxxxxxx>,
Simon Horman <horms@xxxxxxxxxx>, NeilBrown <neil@xxxxxxxxxx>
Cc: Chuck Lever <chuck.lever@xxxxxxxxxx>, Mike Snitzer <snitzer@xxxxxxxxxx>,
linux-nfs@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx,
linux-trace-kernel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx
References: <20250527-rpc-numa-v1-0-fa1d98e9a900@xxxxxxxxxx>
<174845587080.200069.9203268802136145057.b4-ty@xxxxxxxxxx>
<298ef5505e7abb9a0ca5f151090a42f8bf330c43.camel@xxxxxxxxxx>
Content-Language: en-US
From: Chuck Lever <cel@xxxxxxxxxx>
Organization: kernel.org
In-Reply-To: <298ef5505e7abb9a0ca5f151090a42f8bf330c43.camel@xxxxxxxxxx>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Status: No, score=-6.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,
RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,
RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
On 5/28/25 2:22 PM, Jeff Layton wrote:
On Wed, 2025-05-28 at 14:11 -0400, cel@xxxxxxxxxx wrote:
From: Chuck Lever <chuck.lever@xxxxxxxxxx>
On Tue, 27 May 2025 20:12:46 -0400, Jeff Layton wrote:
The first patch is probably appropriate for stable. It should fix
problems when someone sets the pool_mode to pernode, without userland
sending down a fully-populated thread array.
The second patch just adds a couple of new tracepoints that I ended up
using to track this down.
[...]
Applied to nfsd-testing, thanks!
[1/2] nfsd: use threads array as-is in netlink interface
commit: b2a9a114a3c7f5abfa2875b70ce9b73525a74291
[2/2] sunrpc: new tracepoints around svc thread wakeups
commit: 65b8babe551bddf00aac69bc905f88a4e0371766
My apologies, Chuck. Patch #2 has a bug in it:
+ trace_svc_pool_thread_noidle(pool, rqstp->rq_task->pid);
In the call above, the rqstp will be undefined. That should be:
+ trace_svc_pool_thread_noidle(pool, 0);
You can fix that up in tree, or I can resend if you prefer.
Fixed.
--
Chuck Lever
Return-Path: <linux-kernel+bounces-665956-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 933FB41E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:25:33 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by ny.mirrors.kernel.org (Postfix) with ESMTPS id 721274E0371
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:25:34 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id CB76828E5FA;
Wed, 28 May 2025 18:25:09 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="W0FQyEv/"
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201])
(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 18CAE28E5E2;
Wed, 28 May 2025 18:25:08 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748456709; cv=none; b=mGG+5ZHk4i8A19EWQP8UUhlARuB3LI5gG3iupXck91cV47uV8CPfxw4GR9mLrSiSAJ3/5I6Wc6hU64VcCiRq+USkeoEMLBy25L3q8816oNEZSMydLu5AC2T+Ib3lUGiTytp2IKeQgZS4YG+06deBPzpvXRDsEGAGbjHPFYVpJrQ=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748456709; c=relaxed/simple;
bh=uyZuRX4Nw7zrA3erUec/G18l0Gbl/4E+/efJ+fXP/Os=;
h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID:
MIME-Version:Content-Type; b=BGNwLUw7T+2dvm3Y6VqdF4MJHcTvlD+sQ8Hl0zdlL9R+YylgmcNuUBk8ebVl6DsZNmWyKdlCzv3+z2HfosYR1mRpanQY5IYbvuT2u8T0E3M7jwE+gpiDic6TfkzhR082bJStRmpiNNbMdbpHM30E5LPD3jycLshXf88dWGe3Tz0=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=W0FQyEv/; arc=none smtp.client-ip=10.30.226.201
Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE678C4CEE3;
Wed, 28 May 2025 18:25:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
s=k20201202; t=1748456708;
bh=uyZuRX4Nw7zrA3erUec/G18l0Gbl/4E+/efJ+fXP/Os=;
h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
b=W0FQyEv/QioiuwoXwBKXsKDlVluV9IVTUhLest3VzzvccYmh5FG0+vlM4kH/YaQv8
Gfo3A0Pazh0yR6NnJvrrMfuxXf8i8FuzMBFqASaOuU3D/VZ47b+4HtxIzmPvQYyG2M
ZzikGfb1lXIJ++r53dmE4OlkmFSNZr7FONgbSLSwgJt/V8eimYx1u6V5SKNEsvt83O
S6Kf8mRaD6yjEgaqZ4pClowcAFOdqt2SY/eiLwDcXhCI+1ezcZghoj6GOXuTqCcZ7M
N5Xo66QWz4K5GzMaQdVKUB2eVK1jdqj1VV0iuXS7rYdlEDPiX2vz5MoiEWlYKoeg1B
EKQ39xNYlM5uw==
From: Andreas Hindborg <a.hindborg@xxxxxxxxxx>
To: FUJITA Tomonori <fujita.tomonori@xxxxxxxxx>
Cc: rust-for-linux@xxxxxxxxxxxxxxx, Arnd Bergmann <arnd@xxxxxxxx>, Boqun
Feng <boqun.feng@xxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx,
a.hindborg@xxxxxxxxxxx, frederic@xxxxxxxxxx, lyude@xxxxxxxxxx,
tglx@xxxxxxxxxxxxx, anna-maria@xxxxxxxxxxxxx, jstultz@xxxxxxxxxx,
sboyd@xxxxxxxxxx, ojeda@xxxxxxxxxx, alex.gaynor@xxxxxxxxx,
gary@xxxxxxxxxxx, bjorn3_gh@xxxxxxxxxxxxxx, benno.lossin@xxxxxxxxx,
aliceryhl@xxxxxxxxxx, tmgross@xxxxxxxxx, chrisi.schrefl@xxxxxxxxx,
linux@xxxxxxxxxxxxxxx
Subject: Re: [PATCH v2] rust: time: Avoid 64-bit integer division on 32-bit
architectures
In-Reply-To: <20250502004524.230553-1-fujita.tomonori@xxxxxxxxx> (FUJITA
Tomonori's message of "Fri, 2 May 2025 09:45:24 +0900")
References: <20250502004524.230553-1-fujita.tomonori@xxxxxxxxx>
User-Agent: mu4e 1.12.7; emacs 30.1
Date: Wed, 28 May 2025 20:24:50 +0200
Message-ID: <87seko1tl9.fsf@xxxxxxxxxx>
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Status: No, score=-6.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,
RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,
RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
FUJITA Tomonori <fujita.tomonori@xxxxxxxxx> writes:
Avoid 64-bit integer division that 32-bit architectures don't
implement generally. This uses ktime_to_us() and ktime_to_ms()
instead.
The time abstraction needs i64 / u32 division so C's div_s64() can be
used but ktime_to_us() and ktime_to_ms() provide a simpler solution
for this time abstraction problem on 32-bit architectures.
32-bit ARM is the only 32-bit architecture currently supported by
Rust. Using the cfg attribute, only 32-bit architectures will call
ktime_to_us() and ktime_to_ms(), while the other 64-bit architectures
will continue to use the current code as-is to avoid the overhead.
One downside of calling the C's functions is that the as_micros/millis
methods can no longer be const fn. We stick with the simpler approach
unless there's a compelling need for a const fn.
Suggested-by: Arnd Bergmann <arnd@xxxxxxxx>
Suggested-by: Boqun Feng <boqun.feng@xxxxxxxxx>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxx>
Looks good to me.
Reviewed-by: Andreas Hindborg <a.hindborg@xxxxxxxxxx>
Best regards,
Andreas Hindborg
Return-Path: <linux-kernel+bounces-665957-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org [147.75.48.161])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 89BF341E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:25:55 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by sy.mirrors.kernel.org (Postfix) with ESMTPS id 7E8687B2764
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:24:36 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id A4E3C28E5E5;
Wed, 28 May 2025 18:25:40 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="gSb6Q8lw"
Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 110DD28E56E
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:25:37 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748456739; cv=none; b=hCr74COO6qeAA3fg9iDPG3PrqmX0Y6z9yDjiIFzi4NnxBwxW5vrFbhCn6Clg6w5jhReHorw/Clq2CzFNncLDd4QRqsoVHjD9GVIGepg8OvGOPL3PXfyXU7ghXjesa61Uu8b4jgguBSPi6HVpOBR3Qmj246+dSepeKSXZgisT4qw=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748456739; c=relaxed/simple;
bh=TrwTeeb3eSq6peBGpyS2fjLOHTgsDFfooNNEDI35gec=;
h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:
To:Cc:Content-Type; b=RN3RZG7+piJM5dG9wN0A+YgJ40OdSAVwjb4ssqW9x/XGuucu7unssZi13l+OhJiqtcVcIywkWsWkrvVeMMMOtU1HsqX9bafoR19/Jn/daJRO7VrVPjJ0XHbGB87HqHL0b0ghWs/cw5Pg5lQ27q9roZz9uOUGr5HAiAiNvIru7jg=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=gSb6Q8lw; arc=none smtp.client-ip=209.85.216.53
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com
Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-3114b7e89a6so49043a91.2
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 11:25:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=google.com; s=20230601; t=1748456737; x=1749061537; darn=vger.kernel.org;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:from:to:cc:subject:date
:message-id:reply-to;
bh=lVVqFr1BE8q6eml8zA1z0lK7aGNcSUfClXnZn98OgHk=;
b=gSb6Q8lw7pXUBBIqXjElAS7OXbzu82FDWVRV3vh6FJWCWMqO45j0aiu9z7xaVFKrPr
K9mfYHPbGDYrShdyVXl2hTdJQIw5THDggbaiK8U1FREaSToTACTR4Swjbps8QxZgW854
cO/+7Q2Cevo+4StQO+zeeSq6RuILwl7zKGk3DBm7ng4mwaSGOf14GX6vvjzfPo+NiJ7w
qgxL253czsdTsjp6p36f13uW0ojgCeGPSwztettCeRJSPzT97SWTp++FwuL6CAyS9zyV
7Py6Y09VAIQpiNsze0f8IS7B1D+JR76kAbe6GE6CiTMlZq4gLCqqHhObh9pqjwamfjXW
Svag==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1748456737; x=1749061537;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=lVVqFr1BE8q6eml8zA1z0lK7aGNcSUfClXnZn98OgHk=;
b=dPcSh550huhN1mSGYYFKxilDJp4yeUj/p0eZDyaEQixGpB7QAco/MEP9zo0iPgfche
dsuWRIeVCNntyzY/L7P8a5yjagIkThAkXL0X88g7VIaFk3iS8GdpQj3wUvfjVSDW7pUY
gSGR/FUhJQZC3hf5ObJSWc/yqTq2e9GMOHBR5sYedg7JhikEKgP+m4q9Flvq5fKt1bpF
EoLhtc/G0Q0LFbHBO204sCmXuZgfg76P3Us9cU0cgv3qJOxwEUzxbY/vN2OJMBfa4jlR
2oKrpeWwuyR/xdqVqvjvO+UsM0eZvGAVTsnV4Yvrij50i6He2QCmq+4u7NC6DeEzYaey
oADw==
X-Forwarded-Encrypted: i=1; AJvYcCVfEVDx7h9iSDjC40YZBKSc2v3GJpnSfZUfpXKaeVGLwBUVjHOZGod9oLre9hcmk3LYoYrDykbhGrUZYzs=@vger.kernel.org
X-Gm-Message-State: AOJu0Ywomg5bwbv9AXXlHRjz19Xz/L3D9wSng6ZdslTsf40ymaTaR/YU
P5nT/TA4rONixReNnRXXMP35PJJRdQNbb23yr/0nPwfwyBlq+Upta20YRfCFW5n1DcXVnK3/0bS
ghsEEMNiITU4Z82K2ypCmR3KIDnra5nHJ7Py/Z/OD
X-Gm-Gg: ASbGncsfKNZe8TyaXxa8B5mCvbr2geNa/P0cXJMtOwonuXltsG+l5T6eqYGY8RRy25C
VJckyqkDfuvv6QtJlBxeDXsSmBuQuN6VI42XQsKSNagPQWP+regQ3yTPmUlxWBDkuik/8GLjkfy
BvmEOrDGHZkk6X5OKjs8KZlufO6tjO6Kg7fsVpz+mU3R5C6ioccLLwPTom8b+Dvf5oFaocMfacv
w==
X-Google-Smtp-Source: AGHT+IFijwOh+awYdgO4HAk/X8m/A4OWZUBHS7nOP52Vw8xKVE09sTMEC6FE21p5hEzwxtb4ty4X3loZKiHFU1jBNbA=
X-Received: by 2002:a17:90b:3852:b0:30e:8c5d:8ed with SMTP id
98e67ed59e1d1-3110f31a4fbmr26532549a91.19.1748456737021; Wed, 28 May 2025
11:25:37 -0700 (PDT)
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
References: <20250515220400.1096945-1-dionnaglaze@xxxxxxxxxx>
<20250515220400.1096945-2-dionnaglaze@xxxxxxxxxx> <aCZtdN0LhkRqm1Vn@xxxxxxxxxx>
<CAAH4kHai8JStj+=HUiPVxbH9P79GorviG2GykEP7jQ=NB2MbUQ@xxxxxxxxxxxxxx> <aC4ZJyRPpX6eLKsC@xxxxxxxxxx>
In-Reply-To: <aC4ZJyRPpX6eLKsC@xxxxxxxxxx>
From: Dionna Amalie Glaze <dionnaglaze@xxxxxxxxxx>
Date: Wed, 28 May 2025 11:25:23 -0700
X-Gm-Features: AX0GCFte05v61MvXwGYneIeTEvRS5b_Es3A7BflZae2g4_6rbG1Vveaf5-F60xY
Message-ID: <CAAH4kHZkuD4UsXRGED6qecfAkeFpd8sLc+0osDhnKP4T5VmSYQ@xxxxxxxxxxxxxx>
Subject: Re: [PATCH v5 1/2] kvm: sev: Add SEV-SNP guest request throttling
To: Sean Christopherson <seanjc@xxxxxxxxxx>
Cc: kvm@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx,
linux-coco@xxxxxxxxxxxxxxx, Thomas Lendacky <Thomas.Lendacky@xxxxxxx>,
Paolo Bonzini <pbonzini@xxxxxxxxxx>, Joerg Roedel <jroedel@xxxxxxx>, Peter Gonda <pgonda@xxxxxxxxxx>,
Borislav Petkov <bp@xxxxxxxxx>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Status: No, score=-11.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,
MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
On Wed, May 21, 2025 at 11:19=E2=80=AFAM Sean Christopherson <seanjc@google=
.com> wrote:
On Fri, May 16, 2025, Dionna Amalie Glaze wrote:
> > > @@ -4015,6 +4042,12 @@ static int snp_handle_guest_req(struct vcpu_=
svm *svm, gpa_t req_gpa, gpa_t resp_
> > >
> > > mutex_lock(&sev->guest_req_mutex);
> > >
> > > + if (!__ratelimit(&sev->snp_guest_msg_rs)) {
> > > + svm_vmgexit_no_action(svm, SNP_GUEST_ERR(SNP_GUEST_VM=
M_ERR_BUSY, 0));
> > > + ret =3D 1;
> > > + goto out_unlock;
> >
> > Can you (or anyone) explain what a well-behaved guest will do in in r=
esponse to
> > BUSY? And/or explain why KVM injecting an error into the guest is be=
tter than
> > exiting to userspace.
>
> Ah, I missed this question. The guest is meant to back off and try agai=
n
> after waiting a bit. This is the behavior added in
> https://lore.kernel.org/all/20230214164638.1189804-2-dionnaglaze@google=
.com/
Nice, it's already landed and considered legal VMM behavior.
> If KVM returns to userspace with an exit type that the guest request wa=
s
> throttled, then what is user space supposed to do with that?
The userspace exit doesn't have to notify userspace that the guest was th=
rottled,
e.g. KVM could exit on _every_ request and let userspace do its own throt=
tling.
I have no idea whether or not that's sane/useful, which is why I'm asking=
. The
cover letter, changelog, and documentation are all painfully sparse with =
respect
to explaining why *this* uAPI is the right uAPI.
> It could wait a bit before trying KVM_RUN again, but with the enlighten=
ed
> method, the guest could at least work on other kernel tasks while it wa=
its
> for its turn to get an attestation report.
Nothing prevents KVM from providing userspace a way to communicate VMM_ER=
R_BUSY,
e.g. as done for KVM_EXIT_SNP_REQ_CERTS:
https://lore.kernel.org/all/20250428195113.392303-2-michael.roth@xxxxxxx
> Perhaps this is me not understanding the preferred KVM way of doing thi=
ngs.
The only real preference at play is to not end up with uAPI and ABI that =
doesn't
fit "everyone's" needs. It's impossible to fully future-proof KVM's ABI,=
but we
can at least perform due diligence to ensure we didn't simply pick the th=
e path
of least resistance.
The bar gets lowered a tiny bit if we go with a module param (which I thi=
nk we
should do), but I'd still like an explanation of why a fairly simple rate=
limiting
mechanism is the best overall approach.
Before I send out a revised patchset with changed commit text, what do
you think about the following
The AMD-SP is a precious resource that doesn't have a scheduler other
than a mutex lock queue. To avoid customers from causing a DoS, a
kernel module parameter for rate limiting guest requests is added.
[Addition:]
The kernel module parameter is a lower bound kernel-imposed rate limit
for any SEV-SNP VM-initiated guest request. This does not preclude the
addition of a new KVM exit type for SEV-SNP guest requests for
userspace to impose any additional throttling logic. The default value =
of
0 maintains the previous behavior that there is no imposed rate limit o=
n
guest requests.
We could still ask Michael to change KVM_EXIT_SNP_REQ_CERTS to
KVM_EXIT_SNP_GUEST_REQ
and for the exit structure to include msg_type as well as the
gfn+npages when the kind is an extended request for an attestation
report so that we don't need to have two exit types.
Regardless of that change for additional throttling opportunities, I
think the system-wide imposed lower bound is important for quelling
noisy neighbors to some degree.
--=20
-Dionna Glaze, PhD, CISSP, CCSP (she/her)
Return-Path: <linux-kernel+bounces-665958-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [147.75.80.249])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 4F87B41E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:26:03 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by am.mirrors.kernel.org (Postfix) with ESMTPS id 310A81C01297
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:26:16 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 4C0B728E59B;
Wed, 28 May 2025 18:25:41 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b="DI/xfSLk"
Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8ACC028E57B
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:25:38 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748456740; cv=none; b=XqXsLFH3vhelU3rRaIdk0vG0gEuveth1ZsXXSCKeFPoraWRtj+oB5kD8nTueE5lYlCD5YJsyMUbCDZpgSMZow+BfSSEraXEoqXmHNJ6v18RP3WzG4vmfrJUMstIKnA+ujhAK/tdim4kH1ZFpK8J3TEUecaVoOoGH6XE2GEgzl84=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748456740; c=relaxed/simple;
bh=2c4RyGcyTBBIaHhq5vhbuQx07DTDPoo7PyvHV+koXWY=;
h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:
To:Cc:Content-Type; b=hBb/2M9khttFqrlPPwROkv887+QEI0EQ9eNBG59T+bAqtjBeUqsAtaGCjf+SCbu4vgEaUpUow5jUEQOeRL+bE6T4H4itjbZRO6CCjnmXoQxk77nKg8hPJNLB1hrl7x6FXU5tBNwBQr8UwsUJiYon5FIpHM2t8CLWpedxRnRpYWc=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com; spf=fail smtp.mailfrom=purestorage.com; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b=DI/xfSLk; arc=none smtp.client-ip=209.85.216.53
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com
Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=purestorage.com
Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-30eccc61f96so6200a91.2
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 11:25:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=purestorage.com; s=google2022; t=1748456738; x=1749061538; darn=vger.kernel.org;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:from:to:cc:subject:date
:message-id:reply-to;
bh=y1DgNtNfVgtxZCoAyIGz18OP4Bo5orqBMpRuB4iTX3k=;
b=DI/xfSLkwhD9aAt4kDul2oUw0gTKuCrXvB6WHkm1SqcP/WsGxfkH1KQKcq2+30nTWL
H183cIIig3Z6cDaqylzGpk4g4xyYdc9AwKTSROa+/le3geGgYMTqMRAtC2Na9KsigHsP
nNwGCZVADf9g773SF/gM6mDOwU8gsMarp63m46ZfWyCu1o6T5vEdiaGY7SUNNFkdnE0d
+1l9z/Kt2Y/N+w0UxcY1jhcZDzJ4zt96VwmVrxjI/0+AYty/duSEiiI/VL7scj7LVVVq
1UtPja1h7tdsLI5KkKCf+BgYIbEhhlb943vga9rjLqhUu3m0wxfzHtfefzBJ9aopIdrg
d0FA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1748456738; x=1749061538;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=y1DgNtNfVgtxZCoAyIGz18OP4Bo5orqBMpRuB4iTX3k=;
b=QUodWzwQ90GU2pQUQl46mUBCDBeV2YdI3gsGJfcDT833Hy2ifEtFESzHKRmjYv4KBg
tYGC+MuPEQGWTP17UhMep5r3SMX3gwYakPpx1pCbPy5tCXj6u+hyzUDPUvsheJzsmCzK
+2QrGfrXsUIeQBW987/73/aPQmzjvcYMp/coZnkpHpNTfG+2BR/ZZ6laHCh6i3c1xaUd
9cA7ZgUSBVNquBIuVWwD31cfNBTGj64VNsjBHRIMfWUsDsGKtumoee9ZI7g3LdJBVFVJ
13ATg3jHQ15M595ONsAfAwJxsCGbVE/rkZvOeAhFPTfnFOs3bkgE0cKsiWHKu7TU5yyq
oeQA==
X-Forwarded-Encrypted: i=1; AJvYcCWZSgL+uKOxpAQIVocYmLTWT6fZi8EiJ2Seia1ObPibCzawMUM5h+7q+uG6SoOOR02V88lhJPTF4IOw7ag=@vger.kernel.org
X-Gm-Message-State: AOJu0YyU/ApoIUPfuDQVKDmZImRMh1WkCECxFaqAWsk7TY5IGC6WOneM
XwcxXYmItIvBt/D1rtg0ouqgeevCH7IDD1XmvZk6WVc20WcoDMVmzRFOh/XpAwK2ECSh04eEigS
51Gqcjxoga+OKMpgGloHh1DLQkofcqHGu008f3NWYHA==
X-Gm-Gg: ASbGnctm898Mqm24DKwKgfE8i5LWBRKqEWGpPMZG0i5UxjJy4tXJyQwj1lRS9nseBCw
Iqe6cJx8BqsKkte14gcYo9c6y8L9b0Yi21HGFQ3QWyvYVzNRWPRjHk+Jv39QFfRHfu1NgPtv2ZH
I84o+MofP2eqrJU7h+OlnLLnx9cNAELdQ/
X-Google-Smtp-Source: AGHT+IEL1ZmsyEu0mOM9uUeenWGvWnw6r/IpkOg2ZOyaSFG+h5gtxxKjC4pS8VpZXgUHmiU0tBsXCbt6CaOavzqbLmM=
X-Received: by 2002:a17:90b:384a:b0:310:8d79:dfe4 with SMTP id
98e67ed59e1d1-311e18132a2mr2095484a91.4.1748456737764; Wed, 28 May 2025
11:25:37 -0700 (PDT)
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
References: <20250527-ublk_task_per_io-v7-0-cbdbaf283baa@xxxxxxxxxxxxxxx> <20250527-ublk_task_per_io-v7-1-cbdbaf283baa@xxxxxxxxxxxxxxx>
In-Reply-To: <20250527-ublk_task_per_io-v7-1-cbdbaf283baa@xxxxxxxxxxxxxxx>
From: Caleb Sander Mateos <csander@xxxxxxxxxxxxxxx>
Date: Wed, 28 May 2025 11:25:26 -0700
X-Gm-Features: AX0GCFuRsiYqORRMNhWkxx1ChAuVZ4WWAaGZPWCcLkLjY7VGBp6_rK8DXEjxOFM
Message-ID: <CADUfDZp9CpghO7vXjhptPoxHgO8HFEa5WF=oyiKS=BoPn8pirQ@xxxxxxxxxxxxxx>
Subject: Re: [PATCH v7 1/8] ublk: have a per-io daemon instead of a per-queue daemon
To: Uday Shankar <ushankar@xxxxxxxxxxxxxxx>
Cc: Ming Lei <ming.lei@xxxxxxxxxx>, Jens Axboe <axboe@xxxxxxxxx>,
Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Shuah Khan <shuah@xxxxxxxxxx>,
Jonathan Corbet <corbet@xxxxxxx>, linux-block@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx,
linux-kselftest@xxxxxxxxxxxxxxx, linux-doc@xxxxxxxxxxxxxxx
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,
RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,
RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
On Tue, May 27, 2025 at 4:01=E2=80=AFPM Uday Shankar <ushankar@purestorage.=
com> wrote:
Currently, ublk_drv associates to each hardware queue (hctx) a unique
task (called the queue's ubq_daemon) which is allowed to issue
COMMIT_AND_FETCH commands against the hctx. If any other task attempts
to do so, the command fails immediately with EINVAL. When considered
together with the block layer architecture, the result is that for each
CPU C on the system, there is a unique ublk server thread which is
allowed to handle I/O submitted on CPU C. This can lead to suboptimal
performance under imbalanced load generation. For an extreme example,
suppose all the load is generated on CPUs mapping to a single ublk
server thread. Then that thread may be fully utilized and become the
bottleneck in the system, while other ublk server threads are totally
idle.
This issue can also be addressed directly in the ublk server without
kernel support by having threads dequeue I/Os and pass them around to
ensure even load. But this solution requires inter-thread communication
at least twice for each I/O (submission and completion), which is
generally a bad pattern for performance. The problem gets even worse
with zero copy, as more inter-thread communication would be required to
have the buffer register/unregister calls to come from the correct
thread.
Therefore, address this issue in ublk_drv by allowing each I/O to have
its own daemon task. Two I/Os in the same queue are now allowed to be
serviced by different daemon tasks - this was not possible before.
Imbalanced load can then be balanced across all ublk server threads by
having the ublk server threads issue FETCH_REQs in a round-robin manner.
As a small toy example, consider a system with a single ublk device
having 2 queues, each of depth 4. A ublk server having 4 threads could
issue its FETCH_REQs against this device as follows (where each entry is
the qid,tag pair that the FETCH_REQ targets):
ublk server thread: T0 T1 T2 T3
0,0 0,1 0,2 0,3
1,3 1,0 1,1 1,2
This setup allows for load that is concentrated on one hctx/ublk_queue
to be spread out across all ublk server threads, alleviating the issue
described above.
Add the new UBLK_F_PER_IO_DAEMON feature to ublk_drv, which ublk servers
can use to essentially test for the presence of this change and tailor
their behavior accordingly.
Signed-off-by: Uday Shankar <ushankar@xxxxxxxxxxxxxxx>
Reviewed-by: Caleb Sander Mateos <csander@xxxxxxxxxxxxxxx>
Still looks good to me.
Best,
Caleb
Return-Path: <linux-kernel+bounces-665959-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org [147.75.48.161])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 0AC9141E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:26:27 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by sy.mirrors.kernel.org (Postfix) with ESMTPS id 6036E7B3B77
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:25:08 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id B6ADC28EA53;
Wed, 28 May 2025 18:25:46 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b="bcdf9GzU"
Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD47328EA4C
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:25:43 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748456746; cv=none; b=EVQUUIJbMkgoRykKUVxKYuYkwWnViIQw829HwnSn2PfTga1By3tUuoIEzbBrE+YYGWac3iUg/aHSfUjAt9Ga/qMegHleIykyLY6O06T6lwaahal8hhTJ/jOM6NU3a97FLpnITJNFhTvNomqbVz2L8jRosoO9yF3HNPGxigIIpWI=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748456746; c=relaxed/simple;
bh=AcwcyGpDrfErPsyWm8xAfFlcYZSyGNfZutLD4QklKxk=;
h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:
To:Cc:Content-Type; b=H7TAzuNMU6hWbL9yW2WDhAwgHeCWPbKWgW/q3rs0v5mcoMITJMok7DIs8IYpmHwZdy57Sar+rArfQyORGVMqLA0zQv4qPIOslU5cBYAwH+rtiVm4hCgcZxl5fbcmrU+cY6joxWK7/lyokEgB/R0Yq8nz6afT29pzRtQg65SCEjQ=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com; spf=fail smtp.mailfrom=purestorage.com; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b=bcdf9GzU; arc=none smtp.client-ip=209.85.214.170
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com
Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=purestorage.com
Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-2322d8316f6so234825ad.3
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 11:25:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=purestorage.com; s=google2022; t=1748456743; x=1749061543; darn=vger.kernel.org;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:from:to:cc:subject:date
:message-id:reply-to;
bh=AcwcyGpDrfErPsyWm8xAfFlcYZSyGNfZutLD4QklKxk=;
b=bcdf9GzUH/qkvrQSKiVwX3UGs1vEkrTQECdy0fa2oyHOgsyjRl9EharQdf1hrOxT5S
aOgqVAhiFy38epz8gLWuFNKnZVI87uDMvm2Czhz4ACUQFWufFrAm7cNj4iMzmIstrJdR
6SPaI1NtnmZ5amQbOuuBLlGr90UEvwq/Ox33pfIIwfce/Fa/0xkO7KIziJEhtVGxloz8
sZDwmrFOgsPCuqm2GwgExxbVBxsf/lhbSYNJXoaAdlIhhETa4mvvzVv2CZCp95SE3KoU
JrNM1aTQQpngAB/1d1KJdpyUyAeq7PyX/U8XqoPUhJwHvShnK5vz4AEn0LIcbBA8gBB2
+9yA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1748456743; x=1749061543;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=AcwcyGpDrfErPsyWm8xAfFlcYZSyGNfZutLD4QklKxk=;
b=H2/h9qYgIK5inm9Q0cDok8xGc8He9SXboP9J5BeEuOVmnFYcfEKo0ntWZ6AVci93y1
ruYADKgXlzdzchfymvph89pcNmcS6adc1hPa4QEUfuOsmhmzlbeFY8RsIQtCeGTEKiZp
mutoD00sy1HEdNArlTOh0OZnqag+JKv7omaIzFbNG7sWSTfwuh2DPdmD6Q3qPHF9o7d2
b306p/71h2GwX17PUHZoEeVLEf41MbhH181/uTEqctKrTBZSl6MfogDbHKF3xGhHv/9W
C64EzQHJBYTy9odQIrdt/CtnkCkM8UC7BjqlcYez5sLmVxIMQtcZTgEGTMuGw3xKVKV2
9BvQ==
X-Forwarded-Encrypted: i=1; AJvYcCUHd+acW7tyKKmlxqVzJMYmhNHW/QFXanDeu4jnRJfq/vshZhUT4eGRQdPqJdDuPI/ViyaTmO3b9AHwEvY=@vger.kernel.org
X-Gm-Message-State: AOJu0YzbeJ7N+OsXREiDzvd+03I6TcO8FtuuDBsKYXv1bb5EFzQrwHc4
z2NjQ8L/YyuXBtg8+ddiI3HGgtLzay7aTpyVK5aNVYyIAEg5r9ubMAO9r88T9c73Him2R0YC7oG
UqhStltv0RW9UKKuexjbSAMm44aM23VI5HRWq0a6/Sw==
X-Gm-Gg: ASbGncteOJKGDwouIUkXzFJvT5RImY8989scKzJbAqLHyxw8tUo5U4QOF9SJOTZameM
RiKVcSuObqp11asL6B5cuJoHBUJ5Mqz68uXRN0nZO+vVxyA3jXNac/1KGHJKD0i8gUTGks4ni9x
n6uqJj82HXG1x623ouwJgHvvIKi0O9mNEL
X-Google-Smtp-Source: AGHT+IEqPgJEvwuKzLiSxyyIQ81so3lXBN15LCeb6qSM07Ix99PnGXOOlMeJsGGG1A/YckjG2+wZSDm+qfUtj+1ifm4=
X-Received: by 2002:a17:903:1b6d:b0:21b:b115:1dd9 with SMTP id
d9443c01a7336-23414f53285mr102307925ad.5.1748456742958; Wed, 28 May 2025
11:25:42 -0700 (PDT)
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
References: <20250527-ublk_task_per_io-v7-0-cbdbaf283baa@xxxxxxxxxxxxxxx> <20250527-ublk_task_per_io-v7-8-cbdbaf283baa@xxxxxxxxxxxxxxx>
In-Reply-To: <20250527-ublk_task_per_io-v7-8-cbdbaf283baa@xxxxxxxxxxxxxxx>
From: Caleb Sander Mateos <csander@xxxxxxxxxxxxxxx>
Date: Wed, 28 May 2025 11:25:31 -0700
X-Gm-Features: AX0GCFtwLbawvnl7mK2nPLXhDZ3ch13VYeZVtizo1aZXU9QSxG4dusWwjli_jhE
Message-ID: <CADUfDZpjFv9Vo1H2rzeCyYo2nsnP_k1prkTCQqTtpk1YjL==zg@xxxxxxxxxxxxxx>
Subject: Re: [PATCH v7 8/8] Documentation: ublk: document UBLK_F_PER_IO_DAEMON
To: Uday Shankar <ushankar@xxxxxxxxxxxxxxx>
Cc: Ming Lei <ming.lei@xxxxxxxxxx>, Jens Axboe <axboe@xxxxxxxxx>,
Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Shuah Khan <shuah@xxxxxxxxxx>,
Jonathan Corbet <corbet@xxxxxxx>, linux-block@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx,
linux-kselftest@xxxxxxxxxxxxxxx, linux-doc@xxxxxxxxxxxxxxx
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,
RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,
RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
On Tue, May 27, 2025 at 4:01=E2=80=AFPM Uday Shankar <ushankar@purestorage.=
com> wrote:
Explain the restrictions imposed on ublk servers in two cases:
1. When UBLK_F_PER_IO_DAEMON is set (current ublk_drv)
2. When UBLK_F_PER_IO_DAEMON is not set (legacy)
Remove most references to per-queue daemons, as the new
UBLK_F_PER_IO_DAEMON feature renders that concept obsolete.
Signed-off-by: Uday Shankar <ushankar@xxxxxxxxxxxxxxx>
Reviewed-by: Caleb Sander Mateos <csander@xxxxxxxxxxxxxxx>
Return-Path: <linux-kernel+bounces-665960-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 460D841E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:26:38 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by ny.mirrors.kernel.org (Postfix) with ESMTPS id 893454E8014
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:26:39 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 78C0428E58E;
Wed, 28 May 2025 18:26:27 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="P6xC55NK"
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201])
(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 A430728DF50;
Wed, 28 May 2025 18:26:26 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748456786; cv=none; b=B5WwGY/W7vbQCwTC00lG+fqFATTwZMvuLN8QC4vpfZ4VePQzqfLbEEBCjPVesGV3rajLeV6q/9e3hlwC09w57jvETTVeqMerojTX9Y2fwqU9o4Kwjc0lxQnFtUnr+y/BDF+zYLM4ugo26jyVUv8+l/XvHdBUvxIA6gXvPFsruJQ=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748456786; c=relaxed/simple;
bh=mEfXzcnqDNQheuyLIWUHO0vVqugIkry0kL3KxVq/byg=;
h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=sI9eqoT0E54wUATfM9q1N7PFRLysXnItqR757WBL4l8k0Xq2t7kjNl9Jx9KmFoPBsbSv6ulPJP/dL7E4lvwQFLtdaglsBgPhYmDZpO3BUhAivjCKfSRm6CDelPxICHWhMOOdl7s/HRc+n2Y6UYrVFLErHlP3XgQC1uxxSZtlUF0=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=P6xC55NK; arc=none smtp.client-ip=10.30.226.201
Received: by smtp.kernel.org (Postfix) with ESMTPSA id E17C6C4CEE3;
Wed, 28 May 2025 18:26:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
s=k20201202; t=1748456785;
bh=mEfXzcnqDNQheuyLIWUHO0vVqugIkry0kL3KxVq/byg=;
h=From:To:Cc:Subject:Date:From;
b=P6xC55NKD6rWiTE8l4AGmFtl6Y09SrdUutWPVAk5TpsfdnCeh+w4FGGxrhPcI8hQ2
iGWVJApyBVCqyGrx5o9B/UzamVdi9T1/KEdl/dKjyhHBvFcNBETZ3PEPs0GvAC/o2M
5/BtVVFU8Zw7DhSwmNJiFp5ZghQddn4MctbAm/P0hWTekKmgOeEgdc5JeSc0dvKJqW
9JTFuGnGO+Wt4Z8UBFdBTYqOrGJ4rWQ1p9vXGYDnaDls/JnOub2XoYFc/N8I3Vi+7q
98CQt6M/PdSjHfTJrWTQQ8SvuoCMZgzatuUOvz8r1rKs5tQwi7XHFKq96fRCqlOJoJ
BhWUxHlkO0zuQ==
From: Kees Cook <kees@xxxxxxxxxx>
To: Justin Stitt <justinstitt@xxxxxxxxxx>
Cc: Kees Cook <kees@xxxxxxxxxx>,
Eric Biggers <ebiggers@xxxxxxxxxx>,
Arnd Bergmann <arnd@xxxxxxxx>,
Jann Horn <jannh@xxxxxxxxxx>,
Marco Elver <elver@xxxxxxxxxx>,
llvm@xxxxxxxxxxxxxxx,
linux-hardening@xxxxxxxxxxxxxxx,
linux-kernel@xxxxxxxxxxxxxxx
Subject: [PATCH] ubsan: integer-overflow: depend on BROKEN to keep this out of CI
Date: Wed, 28 May 2025 11:26:22 -0700
Message-Id: <20250528182616.work.296-kees@xxxxxxxxxx>
X-Mailer: git-send-email 2.34.1
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
X-Developer-Signature: v=1; a=openpgp-sha256; l=1397; i=kees@xxxxxxxxxx; h=from:subject:message-id; bh=mEfXzcnqDNQheuyLIWUHO0vVqugIkry0kL3KxVq/byg=; b=owGbwMvMwCVmps19z/KJym7G02pJDBnmob7Z0YytHhlTTn6VXleWGLZxwxRZDZuHa19LbbX7m O9srB3QUcrCIMbFICumyBJk5x7n4vG2Pdx9riLMHFYmkCEMXJwCMJGjRgy/WeYmZ0Sl3NbgOvLj jojXOyPO6Hn+OdEKnisUfHXOP1l+leEX843DKnbrHx7O/Tbly7UTuWqbWlxfZk+Q/XSWbYfG9k9 eXAA=
X-Developer-Key: i=kees@xxxxxxxxxx; a=openpgp; fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026
Content-Transfer-Encoding: 8bit
X-Spam-Status: No, score=-6.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,
RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,
RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
Depending on !COMPILE_TEST isn't sufficient to keep this feature out of
CI because we can't stop it from being included in randconfig builds.
This feature is still highly experimental, and is developed in lock-step
with Clang's Overflow Behavior Types[1]. Depend on BROKEN to keep it
from being enabled by anyone not expecting it.
Link: https://discourse.llvm.org/t/rfc-v2-clang-introduce-overflowbehaviortypes-for-wrapping-and-non-wrapping-arithmetic/86507 [1]
Signed-off-by: Kees Cook <kees@xxxxxxxxxx>
---
Cc: Justin Stitt <justinstitt@xxxxxxxxxx>
Cc: Eric Biggers <ebiggers@xxxxxxxxxx>
Cc: Arnd Bergmann <arnd@xxxxxxxx>
Cc: Jann Horn <jannh@xxxxxxxxxx>
Cc: Marco Elver <elver@xxxxxxxxxx>
Cc: llvm@xxxxxxxxxxxxxxx
Cc: <linux-hardening@xxxxxxxxxxxxxxx>
---
lib/Kconfig.ubsan | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/Kconfig.ubsan b/lib/Kconfig.ubsan
index f6ea0c5b5da3..96cd89668467 100644
--- a/lib/Kconfig.ubsan
+++ b/lib/Kconfig.ubsan
@@ -118,6 +118,8 @@ config UBSAN_UNREACHABLE
config UBSAN_INTEGER_WRAP
bool "Perform checking for integer arithmetic wrap-around"
+ # This is very experimental so drop the next line if you really want it
+ depends on BROKEN
depends on !COMPILE_TEST
depends on $(cc-option,-fsanitize-undefined-ignore-overflow-pattern=all)
depends on $(cc-option,-fsanitize=signed-integer-overflow)
--
2.34.1
Return-Path: <linux-kernel+bounces-665961-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [147.75.80.249])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 3E97541E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:27:32 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by am.mirrors.kernel.org (Postfix) with ESMTPS id 2F6721BA8B21
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:27:45 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 7682B28E573;
Wed, 28 May 2025 18:27:23 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="DXuQizHS"
Received: from mail-il1-f182.google.com (mail-il1-f182.google.com [209.85.166.182])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29DE31EB5FA
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:27:20 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.182
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748456842; cv=none; b=FuNjm+SChasGrJy+ONdSx/T5k6rCSfbXtC2R6NidflxtlH00nklHjKuS+Kd4FZ/zPiitMQ+6nloLZvSMYuI0lkcy8B3HBw5BxVEIpL8xZgziocrVU5Qs7TEQQh5x0HGAhTD/S5Q6vsu4dC3jggVqSzN918zZthb6wbSZxP5MlEA=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748456842; c=relaxed/simple;
bh=Dyae6p0XkCLn3cY+5hqYXijVKH5spBJwwTcKDEsPWZs=;
h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:
To:Cc:Content-Type; b=uw/EOCYthw34re+d4o116+fN+YCht9GIkQn2ZbbInyauT1u+bP3k/XHjl36MGA6DFmrexKYpB/WUERFLjsSlhdCHvROycr5BjI7Fxrc2y9W0idKnRD3Hhe4XwPFRZ0otWON8028DquY8mxzUYtwlxid7Bk5HWUjWaiRrvgc4awM=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=DXuQizHS; arc=none smtp.client-ip=209.85.166.182
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com
Received: by mail-il1-f182.google.com with SMTP id e9e14a558f8ab-3dd89a85414so31045ab.0
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 11:27:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=google.com; s=20230601; t=1748456840; x=1749061640; darn=vger.kernel.org;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:from:to:cc:subject:date
:message-id:reply-to;
bh=HM8Rc18VEtFQ1Tssf3yJOD2mv0SdQCHfqzTOhoG5MKk=;
b=DXuQizHSxGQpsJ+zUO0aRy0XK3YKLt3G+bSqLxVaSDK8VqtfRxceRgp1gM84QYqh/p
7um39EWW2pl6zRpcj+YW5mPbWL6Q+9BjGNQWJd0FRDXko30N6J2oP34Wn1svHsShBrXx
erwEizo5qJE4SA7YNZs7aoDhiqIFJhN2A5D7drQEFoXIF6Uj7RLnjdnwkeQw0NA6w2uJ
ty+6ySL938/vB2KEWcAaT5jpNYLzl5NzIFJNl4LcdfEizhrl8IAKmR2ggT/4V6SstHAB
QtSRqB9I+DR5v+Vcsu4niSWIgyGSu+eZNM16spNBNXAKyxBfrEJWe3ayRQ/SpUi/11RS
5WGA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1748456840; x=1749061640;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=HM8Rc18VEtFQ1Tssf3yJOD2mv0SdQCHfqzTOhoG5MKk=;
b=nIioL8WFNX9JSGk3kyO8+VaotVctcQCKzoU+oW1iU04Z5d03nDjvm97PWOVhzH+vpE
CgKekj0wU23Jlwjjm6tIip0q9XcvLod7qibAPoWllev0UQXG+NymjD7YXfXpFNt8j3sl
C6LOPEBfpmAZiSR2uAbJtXe6LaL3nfaLdPfMR0YeeKTwReEt1fMBfEu2iTomRTUoJ8rg
SsSPtQVMmJLjF54oQoakMrmpTHfEb7yCeF59XJemFtahQ/Pdmb/5jC26pq97bnj/Mrkh
yOlnU+GbXTafF7lH3KbJp/GEEte8JIsO1evUfQBEN3W5rghCBWfws+rD+vjKuwult2gS
qYSQ==
X-Forwarded-Encrypted: i=1; AJvYcCX/O5uWGC7BkGIq0BWEFSOny7AmTveCfCFnJ5MniHi2/80Wk3Q7JzUz/iCvrpBr9bcsrB8L94z1e13HJ6k=@vger.kernel.org
X-Gm-Message-State: AOJu0Yx2hQDihoBvrFMVgNojrTwnYvVUhsEGIaAp83KpmmA+Fyg4OOV4
FJEEMBaU6hZwT7OSVsILYdd7cP0lH44E61RxvxMoiuJaZ4TadnVma7J4VP9NlmuIfgp8WP7RNk/
BLu9kdsPYcR5dXAdVe2TIkiIHIzmKNTuy77GPBciZ
X-Gm-Gg: ASbGncsJi5YY3iwGKUkhx/hLseJYajmRd5gjaFtKIu+hcdNQA6m788IB605SDtXC6kq
yCUWRZCIClMoASeUlTZfG51HChpg7jYkjaxA720b4tNsoY6GqT1rlgKSzI7O6lf87VYmP/Xy2rk
ZBSG6afxtkO9B3QVqYWRNHsfnmGuhcZr+JIEROgw97K6LlRHsktcvc9q1NM6wj4+DGi7rNmAlS
X-Google-Smtp-Source: AGHT+IFd4Kl8836dzc9vu4lsDYW2giR8SUOs2tR/CZqf56ma4yrC4qckrBhCAKDN/A1HjkQ/GfxZV1Ot/qkm+uGI84Y=
X-Received: by 2002:a05:6e02:790:b0:3dc:7c30:c6d2 with SMTP id
e9e14a558f8ab-3dd928079c9mr152535ab.27.1748456839970; Wed, 28 May 2025
11:27:19 -0700 (PDT)
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
References: <20250521165317.713463-1-irogers@xxxxxxxxxx> <20250521165317.713463-2-irogers@xxxxxxxxxx>
<aC43Et06tyrBOrsT@xxxxxxxxxx> <CAP-5=fUYUDq6hmd+e3_E7HCRPYuy-0KLE+gLuSCWAHh3A5wJLA@xxxxxxxxxxxxxx>
<aDdR0pCNSmxCEyEZ@xxxxxxxxxx>
In-Reply-To: <aDdR0pCNSmxCEyEZ@xxxxxxxxxx>
From: Ian Rogers <irogers@xxxxxxxxxx>
Date: Wed, 28 May 2025 11:27:06 -0700
X-Gm-Features: AX0GCFvWI1R9REX5VoYYVsZyhaRf2cKWzDmoyux_Rz-w7siJZVQd-yB4sdzLp9s
Message-ID: <CAP-5=fVv9+0UdYDNQ52T-QgKfUYBL-pgRwd_ac3jp7KW8sxrRw@xxxxxxxxxxxxxx>
Subject: Re: [PATCH v3 1/3] perf sample: Remove arch notion of sample parsing
To: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>,
Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>, Mark Rutland <mark.rutland@xxxxxxx>,
Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>, Jiri Olsa <jolsa@xxxxxxxxxx>,
Adrian Hunter <adrian.hunter@xxxxxxxxx>, Kan Liang <kan.liang@xxxxxxxxxxxxxxx>,
James Clark <james.clark@xxxxxxxxxx>, "Masami Hiramatsu (Google)" <mhiramat@xxxxxxxxxx>,
Ravi Bangoria <ravi.bangoria@xxxxxxx>, Leo Yan <leo.yan@xxxxxxx>, Yujie Liu <yujie.liu@xxxxxxxxx>,
Graham Woodward <graham.woodward@xxxxxxx>, Howard Chu <howardchu95@xxxxxxxxx>,
Weilin Wang <weilin.wang@xxxxxxxxx>, Dmitry Vyukov <dvyukov@xxxxxxxxxx>,
Andi Kleen <ak@xxxxxxxxxxxxxxx>, Thomas Falcon <thomas.falcon@xxxxxxxxx>,
Matt Fleming <matt@xxxxxxxxxxxxxxxx>, Chun-Tse Shao <ctshao@xxxxxxxxxx>,
Ben Gainey <ben.gainey@xxxxxxx>, Song Liu <song@xxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx,
linux-perf-users@xxxxxxxxxxxxxxx, Kajol Jain <kjain@xxxxxxxxxxxxx>,
Athira Rajeev <atrajeev@xxxxxxxxxxxxxxxxxx>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Status: No, score=-11.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,
MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
On Wed, May 28, 2025 at 11:11=E2=80=AFAM Namhyung Kim <namhyung@xxxxxxxxxx>=
wrote:
On Wed, May 21, 2025 at 02:15:24PM -0700, Ian Rogers wrote:
> On Wed, May 21, 2025 at 1:27=E2=80=AFPM Namhyung Kim <namhyung@kernel.o=
rg> wrote:
> >
> > On Wed, May 21, 2025 at 09:53:15AM -0700, Ian Rogers wrote:
> > > By definition arch sample parsing and synthesis will inhibit certai=
n
> > > kinds of cross-platform record then analysis (report, script,
> > > etc.). Remove arch_perf_parse_sample_weight and
> > > arch_perf_synthesize_sample_weight replacing with a common
> > > implementation. Combine perf_sample p_stage_cyc and retire_lat to
> > > capture the differing uses regardless of compiled for architecture.
> >
> > Can you please do this without renaming? It can be a separate patch =
but
> > I think we can just leave it.
>
> It is not clear what the use of the union is. Presumably it is a
> tagged union but there is no tag as the union value to use is implied
> by either being built on x86_64 or powerpc. The change removes the
> notion of this code being built for x86_64 or powerpc and so the union
> value to use isn't clear (e.g. should arm use p_stage_cyc or
> retire_lat from the union), hence combining to show that it could be
> one or the other. The code could be:
> ```
> #ifdef __x86_64__
> u16 p_stage_cyc;
> #elif defined(powerpc)
> u16 retire_lat;
> #endif
> ```
> but this isn't cross-platform.
Right, we probably don't want it.
> The change in hist.h of
> ```
> @@ -255,7 +255,7 @@ struct hist_entry {
> u64 code_page_size;
> u64 weight;
> u64 ins_lat;
> - u64 p_stage_cyc;
> + u64 p_stage_cyc_or_retire_lat;
> ```
> could be a follow up CL, but then we lose something of what the field
> is holding given the value is just a copy of that same named value in
> perf_sample. The code only inserts 34 lines and so the churn of doing
> that seemed worse than having the change in a single patch for
> clarity.
Assuming other archs can add something later, we won't rename the field
again. So I can live with the ugly union fields. If we really want to
rename it, I prefer calling it just 'weight3' and let the archs handle
the display name only.
But that's my point (or in other words maybe you've missed my point) .
Regardless of arch we should display p_stage_cyc if processing a
perf.data file from a PowerPC as determined from the perf_env in the
perf.data file, or retire_lat if processing a perf.data file from x86.
The arch of the perf build is entirely irrelevant and calling the
variable an opaque weight3 will require something that will need to be
disambiguate it elsewhere in the code. The goal in variable names
should be to be intention revealing, which I think
p_stage_cyc_or_retire_lat is doing better than weight3, which is
something of a regression from the existing but inaccurate
p_stage_cyc.
Thanks,
Ian
Thanks,
Namhyung
Return-Path: <linux-kernel+bounces-665962-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org [147.75.48.161])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 6CC4841E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:31:09 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by sy.mirrors.kernel.org (Postfix) with ESMTPS id 447A27A6AE1
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:29:49 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F129286880;
Wed, 28 May 2025 18:30:58 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=phytec.de header.i=@phytec.de header.b="dlK0EZsr"
Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2120.outbound.protection.outlook.com [40.107.249.120])
(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 CAA1143147;
Wed, 28 May 2025 18:30:52 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.249.120
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748457057; cv=fail; b=NHP9VA+rosuEenhwFbW+XDvIxsp0cLm03xopvOwoJjf7GaD/c+4HLKjPiteY38iFWwwQdWRw6cZ2Ryl035M4uHypTgkyIlnuIoxOz/4L7nqDqx5/IDMRVPIhZFxmWhf+e9YCxfUN0SfEIoEO7CoWT0lA23sgj40A49DGNZ+vysI=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748457057; c=relaxed/simple;
bh=IxfDTGCpGVLB+ehDE33Cz410rqNpJnpddBaXX0PHess=;
h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To:
Content-Type:MIME-Version; b=R99fCNMjpLpcF66Jndt4bC/jhd3kPI1ymJkzFZtKC8B183g9x1kOWcL4Es+4N2a5gSDOYfFtyVoR+OSx7PLOlHYuAvsUzEEhwcKgXJgpWuEQXtS0MhaUwAY8JywzYNGorlFuLN+5c8QbZgx2vvDA7cBLPogA8GJ8nBR2rY6h7hw=
ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=phytec.de; spf=pass smtp.mailfrom=phytec.de; dkim=pass (2048-bit key) header.d=phytec.de header.i=@phytec.de header.b=dlK0EZsr; arc=fail smtp.client-ip=40.107.249.120
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=phytec.de
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=phytec.de
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
b=H2oiVrhZd3iIRuGn3Ud6YGcbs/0s60fzPSvQHjHJfnkdpsLyBnxhixX82F+y9xPY49hVBh8ei0GndB6VRLQFt66ejjQMlebD5IQBUPHhdC7EurRHzv7/TyJUkm0Yaalx8xx+ao+bdszUqSSUhi09+3d5nIqEEwLjvJLXSh8UsKmnbSYjW3viPYmhjC8fbu05sp1B9uyGkvLxrXKLM9KPrwBijUxg2b0EL30wtxWi4cF8rXFCX60Iwo1VSKd7WX4K8chuRCobgc1lc+/Bp0/TtscfIFXrk0i14ib23+YWz1wThHEE74gSXWppB7EGz/emEWBqV1LI4x8RS0ilgZO33w==
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=IxfDTGCpGVLB+ehDE33Cz410rqNpJnpddBaXX0PHess=;
b=goc6moljtSdypsgZhNzDdbBXhj9NrTRnj+u4A5hpFq+RGWffVmuxm8nkvE6zw0bl0bM8LKToY+Vbgz8zrHss4pFa0bW7phYOfS7har6ZVg2uZ+4OfkW3rWY2q9dGMYxvXtbPzVj8ybkKhQUT/SyOFe4hjfJypx4DD3i9Ubn7KRXdYJbISkslae9sOTTlnKxTH+fN27NvOtZeXGZ/B8vCUruTagAFVVroGooTO7MamJJHAkGWi2fvzL8JumCKKLuNpExG1hRWPGN8oJNQDIr/DcqLo1XZgyD3+isi0rRO6gHk/DZIycBVTPT04LQzxhA6JgrmoeGL2bAdlxuEyyA9fw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
smtp.mailfrom=phytec.de; dmarc=pass action=none header.from=phytec.de;
dkim=pass header.d=phytec.de; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=phytec.de;
s=selector2;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=IxfDTGCpGVLB+ehDE33Cz410rqNpJnpddBaXX0PHess=;
b=dlK0EZsrgqRLO2uI5tNmTXrEWdFKaRpLgcTAwQII0eJ3wwMjNZCA9IoMtmbo5wDIewIZtzLLy6buS4+a5pV5m47TvG5HLBpIveOzgfyvBemv9qwCNYWlbAPUGnSegh9UR4tBOAz8i40iVG4Ygdu7goYkOSPDKjqAQn1zFF01oyBlAG9qGJeYjm3j5c0/HlhPfS8w2FMLHk+TX3CknGl4IC9i2jLzqcu3FbPbjRxf+OUbR231jO670brKgm8DnM9WibYee2DOmB3lfoTPwUwFTHuFJ+yhkJkaknQpYUatmk3GHsaGX0KUZ77NYqlXMdOEImnd0O7j0TJrUcfkywBybA==
Received: from AM0P195MB0257.EURP195.PROD.OUTLOOK.COM (2603:10a6:208:b7::25)
by PAVP195MB2260.EURP195.PROD.OUTLOOK.COM (2603:10a6:102:2f4::21) with
Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8769.24; Wed, 28 May
2025 18:30:48 +0000
Received: from AM0P195MB0257.EURP195.PROD.OUTLOOK.COM
([fe80::9b92:3cc:22b3:4c59]) by AM0P195MB0257.EURP195.PROD.OUTLOOK.COM
([fe80::9b92:3cc:22b3:4c59%3]) with mapi id 15.20.8769.022; Wed, 28 May 2025
18:30:48 +0000
From: Christoph Stoidner <C.Stoidner@xxxxxxxxx>
To: Stefan Wahren <wahrenst@xxxxxxx>, Andrew Lunn <andrew@xxxxxxx>
CC: Rob Herring <robh@xxxxxxxxxx>, Krzysztof Kozlowski <krzk+dt@xxxxxxxxxx>,
Conor Dooley <conor+dt@xxxxxxxxxx>, Shawn Guo <shawnguo@xxxxxxxxxx>, Sascha
Hauer <s.hauer@xxxxxxxxxxxxxx>, Pengutronix Kernel Team
<kernel@xxxxxxxxxxxxxx>, Fabio Estevam <festevam@xxxxxxxxx>,
"devicetree@xxxxxxxxxxxxxxx" <devicetree@xxxxxxxxxxxxxxx>,
"imx@xxxxxxxxxxxxxxx" <imx@xxxxxxxxxxxxxxx>,
"linux-arm-kernel@xxxxxxxxxxxxxxxxxxx"
<linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx"
<linux-kernel@xxxxxxxxxxxxxxx>, "upstream@xxxxxxxxxxxxxxx"
<upstream@xxxxxxxxxxxxxxx>
Subject: Re: [PATCH v3] arm64: dts: freescale: imx93-phycore-som: Delay the
phy reset by a gpio
Thread-Topic: [PATCH v3] arm64: dts: freescale: imx93-phycore-som: Delay the
phy reset by a gpio
Thread-Index:
AQHbzJ5IkKiCUrqPH06p42f/+549BbPiDcKAgAJsSwCAAChcgIAABDUAgAALOQCAACRcAIADjdKA
Date: Wed, 28 May 2025 18:30:48 +0000
Message-ID: <517be266ebc3b55da53372a76a139245f8945cd8.camel@xxxxxxxxx>
References: <20250524112315.695376-1-c.stoidner@xxxxxxxxx>
<047c963e-f24d-4995-aea0-4a8cf8e343f5@xxxxxxx>
<b2ea6b7f-3623-4486-82a0-cab97053a53e@xxxxxxx>
<34a4441d4b4ed8db7cac585ce93ec2357738cc11.camel@xxxxxxxxx>
<7f6d7199-0a20-4370-a8b0-1d05326af052@xxxxxxx>
<bf0eb48fc72f4b0abbf62077c2f1fe4438579746.camel@xxxxxxxxx>
<967484d9-4165-4b75-bbb7-a203c36e8beb@xxxxxxx>
In-Reply-To: <967484d9-4165-4b75-bbb7-a203c36e8beb@xxxxxxx>
Accept-Language: de-DE, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
header.d=none;dmarc=none action=none header.from=phytec.de;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AM0P195MB0257:EE_|PAVP195MB2260:EE_
x-ms-office365-filtering-correlation-id: 067db444-f2a9-4a11-e848-08dd9e15c497
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
BCL:0;ARA:13230040|1800799024|366016|376014|7416014|38070700018;
x-microsoft-antispam-message-info:
=?utf-8?B?RldyZkpXMFhIWlYrUDhOQmNhWElJUGozTlZRRXlpVGcycXNJNmkrNVNIUCs3?=
=?utf-8?B?WWF4ay82ODQrcFhxeUhXbVp5Qm15TEZ0R2Rydis1YVlFRXIrY0w1c0FTWDdI?=
=?utf-8?B?a1plbG1XbXoxcjdTd0QyVzZDNHY5cU5sTlFvRW1Qa0U4bS9RYzlnRnZhMWhj?=
=?utf-8?B?RnVuelg0a29DQXRxcFFwM0xESTVwS3M3ZXprM2gxb3pPOHFicWVmNlhhZXdL?=
=?utf-8?B?Wk90N1k3bHlNaStheGxjSjUwOXBtTWZSMVJhNWlFZWpScHM5QUJXaGd0aVZw?=
=?utf-8?B?VWpER1BybU05RC80eWtuR3IvYVF5a2dmMThnMk4wUm1ldnArWmQ4Tm9RdDRS?=
=?utf-8?B?VkVPYlFpbHRaZG5TcHZIcDRoM3ZRUjFSNlFpeVhYNXZUV25uU3o0VWVxRFEr?=
=?utf-8?B?Qm9qaWlMNHVMMUxnWXROUC9kS0lqa0lnczlheHhYYU5oYWYyUzdlMXA1Y3ZQ?=
=?utf-8?B?MG10MXdzTGxPSkFNLzVTMkd3QTJoRUxuYklpdzVDeHhEVVdzV1BiWmIzcFNH?=
=?utf-8?B?SU1NczE4TWdPKzU1QzB0T2VOOXNtb09NZU1mZk83OTNBTmphUEhFWWUxS2dw?=
=?utf-8?B?cGtBUjRUWEVhVHc2MHZaQ3ViU2VJK2hCMEdsN1ZFUXFYN3Y2MlZ5anBQZUp0?=
=?utf-8?B?bzFoOWRnc2FNaTZVUWxFWGNZcTIzVUpBSzFhVXRIUCtnWmxuY1Y3VWhLendN?=
=?utf-8?B?bExUbjRvNmM1MmkwRDUxK1QwSjVJL0VLQmprR2xOS1BhRU04ODZMZFRFU2Jl?=
=?utf-8?B?SURCb0tCYmVtQXFCWVY2M3JGd0lrQTZ0Z1ByUVRKeGl2a2w0S1lWdU1EbTB2?=
=?utf-8?B?V1RLMVN3SWluUXdaOWU2di9FalRxd3ltVi96NEhuWDlBeW1MNUtFZ3NLbVZp?=
=?utf-8?B?aU5yMHNtYTZ2b1BnZWsyRVRJbGp6RmJRZ0pxc1ZlbzR3MUs3MUFucHBxREpP?=
=?utf-8?B?VFpTZ0NiRCsvdjFUbG4yTVlFdDZVbmhTMHdSSzBUQ0tlNXI4MFR0dGZEdkF5?=
=?utf-8?B?R0x2Q2ZVYmY3WWFlbXBlTDkvcVBMTnFSRURCUHU0Q2FZbkFMOGlFMWZadldv?=
=?utf-8?B?UTJlVHFDbWFSTzBpNGplV3M5bUdwQjZjVUU4ZmxHaWdKeDNZT2dzRVI0VzNB?=
=?utf-8?B?cU5YWms3UlJWOEZxQ3k5ZmhJWEpnNkcwdTBwcXhiOTc0WWVIczEvcmkzTmYv?=
=?utf-8?B?VFpLSmNEMC9sKzhNbWJ4MjJ0RlhPclhBNEdQalBCVFcwTTlWUTVXd0lnaERj?=
=?utf-8?B?UWlKWm42RURaMURsNDJQYm5VeW1udlc0OHFWYU4wTlQ3d1poaUUwSUJHV09j?=
=?utf-8?B?TldOOVZzaCtPYzIxN2xlZFRaNllUR1c4R2FsK2J1OTlBOU9MZVBLQmxIQ203?=
=?utf-8?B?c2FFMDVFaHlGR0pDNHcwZzdKeVlJTTJkNFdnUUpQTlRhM29vZk9tTXFOdk55?=
=?utf-8?B?WWhKTERhM3UyU1k4T1pGblBVd29wMlZSRTNySk9kRE50dzBHMFdIUEJtd2hV?=
=?utf-8?B?WG9aZ3ZjeXhiRzF3MExtSGpaTjdDN1FhQmsrMFdqN09jMFJFZHdTV1VZYkZS?=
=?utf-8?B?bVhiK3RBVHJNR0hicVd5UzBpdVg3SlgwN3RzN0p2WDc0WHVUN1RhMENGc0Jk?=
=?utf-8?B?NWVBMFZISzJmK2hVMXFpRkIzMjJBWTlVLzZETGlhRU1vVGdxVVdNZEhSNjgv?=
=?utf-8?B?YWlkejBTcnBLT3dJSjB6SENIaG9scDAyRVR3R3M3bUViNFo1ZVoxUUpZekFF?=
=?utf-8?B?bTUwODgvQXg4dGlTdFZaTCtFamRiUDVzMXlTUUhFNzduYjY5M2ZFeDM1R3hi?=
=?utf-8?B?aDZOckU5TkROQ2Q4aXA3Tk44bnNHRDVUaCsxbXZEWG95SzBOK0hmSWlBMHBh?=
=?utf-8?B?MEdHdHFIVmhqTDZDci9zQkp5TXdYZ1VnV3lFSTRxQXVaSWdQNVhaVmFtbWV2?=
=?utf-8?B?UnBDTnlyWmhydFpFeXJFRTZrakZMZ0Q5bG0vaWtKeEJZWjVBcHB1bEoyYlNJ?=
=?utf-8?Q?7IOfEbhcO9BYxdydMvcJ4DWs1y810o=3D?=
x-forefront-antispam-report:
CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0P195MB0257.EURP195.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(7416014)(38070700018);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
=?utf-8?B?TE5mc0hDL0kxNkNnc0RabUNaT0NJSGFCMWpUeTBneVpXNktIWEdCdGpwc3N0?=
=?utf-8?B?WU9ZRzBmQ29mTkRWbW5POFlFWU9rQXZZdEVUZmUzN3BodmFTbVhSdmFqN0g3?=
=?utf-8?B?WG5NSk1pSk5ZQitTQUZoMEJlc1FVTW1tQW85bnl2QTFJV1l5eHhqbzhRbjdh?=
=?utf-8?B?YUxyRE5XTzJ5YzArQ05DTjRYRlVjUStaZWFMWXVZV01aNy9DQlpucXhIb25l?=
=?utf-8?B?cXdIVTZuTnlZR1QzZ2pNTU1yVEIzNWZycFFWaUoyRFVHT3o2SDdvQmNwbzZ3?=
=?utf-8?B?VEh2K082SUNZbTI4QWloRXJWaTNSSGJqSmxFZytabmVlLzVnZXpxVTdzdEdp?=
=?utf-8?B?VVp5Q0ZVMS8wU1JJSnUwU0hvOWcrem5wc3J1SUlVZVBjdGw2Z3ZiZUJGbStt?=
=?utf-8?B?TkN6dVJuUW9RTEl5TEFBc0plTGQzeDFBTFBmSmlmMDlHMnllbDJZWDdlQzRa?=
=?utf-8?B?Rk1MY2xnbjhrZG9Tb1A4ajFaVjVHeU9Bei9jdjFseHFaVzRvWHNmUGpOU2h2?=
=?utf-8?B?L0lVUFJxY0ZlbGt4QzgwNEZGVmRzRjlHaHNLWTE0M1BSQnhvYXhJc2MvdXM0?=
=?utf-8?B?Z0FZL0xBbjZpejBnSVQ4bU11TjQ1NHVXRXFmWkt6QjRNR3ZQQnE2cGNKU0FT?=
=?utf-8?B?b2MxWU92eWdpUWhkRjVDSFNvOWVVRUtVMzlIZjJ1QnZWdk5tTXV4OXVsdm1Q?=
=?utf-8?B?OTE2WVloZ3BHRlRTRjJDTHdqUkhuMjhrcjVEMTFPbDB4em9vV0dpYmZLSyt5?=
=?utf-8?B?VDFZTU1TMWlaYzhEYnIrMGh3Zmx0NmN3TmpjYUJtK2c2dHlTVEpTRCsyaUhi?=
=?utf-8?B?eHc5d25BZ0ZESUZiWXdkcDMwV3pOQ1lkdEZpSUIzakpPc04ydmI5TTZ6YWM2?=
=?utf-8?B?a0p4Slk4eGlzd0NpZ0F6NmNZVElWeitpcXQwT25QSlhlTEVEZmRmZWZ3YTd3?=
=?utf-8?B?MDJUeGQ2U1hCVnZNdlFjQ054ckNKT1ZZSWJqWVh5cERrQkJKZ1AwOE1DTWhw?=
=?utf-8?B?U3hkOWZXa1pTelY5Y0s3TThaWkNjU3d1M2VyV0pRYVdqTlNwdFZIM0pNR01a?=
=?utf-8?B?cDdEZ3VvTnVCL0poNlVtOG1tcDJKTGVLa2YzT1MweVlvSEZhaVV2UlhtSmpP?=
=?utf-8?B?dHVhK0N3NlEzaGxqWitjbnVQUkpkUUFPc1lLWlBFa1JZUzdHMHcwaDNyMElN?=
=?utf-8?B?NlZibmJWUmZLdnZRcUpVaC9ONi9LeFhaakZkR3liRTFUMDVMaXZMYUFFamFZ?=
=?utf-8?B?OWJlbXU3U1hGTFZoc3dtSFcyRVAwN1lrRTdCNEl1V0JrQUJUdkM4QWtieDlw?=
=?utf-8?B?VTJRZUxOV3pROXVhVURPUENmWEg2Q0ZGZUg1UElrdkIyU2VNdXIwUVU2S3Nt?=
=?utf-8?B?ZFFEdDdwdmEwU3cwczQ2cjNEWnVtczRLWkc1K0lnUWo0L1l2b1RsYmQ4TW1Z?=
=?utf-8?B?T1k3dXNocUxGRUs2WDJ5S1Urd3owczhvQWlWbDJNakpWUnExa2xrMnNSaURM?=
=?utf-8?B?empHQnVUMVpYMGR4cU9pcHR3NGlMRDRCZ2tUZllwaUg2MXJNbFptc3NBMm1P?=
=?utf-8?B?bjVOS0ZCbUg1Vk5wc08yV3RxcVZ0V002TjUyTEt0UFAvOTJIT3M2R0VBcFBO?=
=?utf-8?B?RkE0WDRJQ2JIY3NYYWc2STV2amVWNHN0RzBxN1B5NXFVQ2RGdHdCbHZDZW9z?=
=?utf-8?B?UTZQTHB3UHlUZnFzdkpkeUJ5VXIrSkFrSFV2TTZuUWw1ckxINENreEZBTWFj?=
=?utf-8?B?ZWtlV0NFbkdaU1p4WHB2N3VDTk12Z0h2ek9PYXExUVZEK1pSWE4xQTlySEhv?=
=?utf-8?B?bmFzVDdDT3duQktUMjVNdnVQcklaTi9hVlZLb2Nzd3Nha2hsVENRS3VEMnhU?=
=?utf-8?B?MXJZaUw0c3Nxc3ZOeWdoM24wVlNXU2dCc2FwdGpqMFprUE5TaEdXbU9acTFa?=
=?utf-8?B?RTBOcS9uWGFIQmtoREhNbndDZ1MrNTM3ZEg4ZTdJb2dHRlJvRzNSS0pZNzJV?=
=?utf-8?B?VlNtZ2YwekhWMFpQK2lQWkJEc090aUg0ZFhnNktON21pWDEyMk5FenZNN2ZV?=
=?utf-8?B?LytDN2pxZzI3c2o5SlgrS3dvREtaU0xoSzVKMDE3QUpjVnpUN2VEMXhDbzlp?=
=?utf-8?Q?s797221e9M+owyKABrFxGQ5bd?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <95ADB2AD62867D4E8FE6E26697DB761E@xxxxxxxxxxxxxxxxxxxxxxxx>
Content-Transfer-Encoding: base64
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
X-OriginatorOrg: phytec.de
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: AM0P195MB0257.EURP195.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: 067db444-f2a9-4a11-e848-08dd9e15c497
X-MS-Exchange-CrossTenant-originalarrivaltime: 28 May 2025 18:30:48.6062
(UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: e609157c-80e2-446d-9be3-9c99c2399d29
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: oktuFis8N++q/j1GhqIrfDFulp77PNVaRZWn3pZs9j32Zh+ty6HmxFhYjVEDkRfWpaAIdFdb6ewzKkd1RifQpQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVP195MB2260
X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,
RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,
RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
CgpPbiBNbywgMjAyNS0wNS0yNiBhdCAxNDoxNCArMDIwMCwgU3RlZmFuIFdhaHJlbiB3cm90ZToK
PiBBbSAyNi4wNS4yNSB1bSAxMjowNCBzY2hyaWViIENocmlzdG9waCBTdG9pZG5lcjoKPiA+IE9u
IE1vLCAyMDI1LTA1LTI2IGF0IDExOjI0ICswMjAwLCBTdGVmYW4gV2FocmVuIHdyb3RlOgo+ID4g
PiBBbSAyNi4wNS4yNSB1bSAxMTowOSBzY2hyaWViIENocmlzdG9waCBTdG9pZG5lcjoKPiA+ID4g
PiBIaSBTdGVmYW4sCj4gPiA+ID4gCj4gPiA+ID4gT24gTW8sIDIwMjUtMDUtMjYgYXQgMDg6NDQg
KzAyMDAsIFN0ZWZhbiBXYWhyZW4gd3JvdGU6Cj4gPiA+ID4gPiBIaSBBbmRyZXcsCj4gPiA+ID4g
PiBoaSBDaHJpc3RvcGgKPiA+ID4gPiA+IAo+ID4gPiA+ID4gQW0gMjQuMDUuMjUgdW0gMTk6NDQg
c2NocmllYiBBbmRyZXcgTHVubjoKPiA+ID4gPiA+ID4gPiBkaWZmIC0tZ2l0IGEvYXJjaC9hcm02
NC9ib290L2R0cy9mcmVlc2NhbGUvaW14OTMtcGh5Y29yZS0KPiA+ID4gPiA+ID4gPiBzb20uZHRz
aQo+ID4gPiA+ID4gPiA+IGIvYXJjaC9hcm02NC9ib290L2R0cy9mcmVlc2NhbGUvaW14OTMtcGh5
Y29yZS1zb20uZHRzaQo+ID4gPiA+ID4gPiA+IGluZGV4IDg4YzI2NTdiNTBlNi4uYjQ4MTA5N2Yw
OGE0IDEwMDY0NAo+ID4gPiA+ID4gPiA+IC0tLSBhL2FyY2gvYXJtNjQvYm9vdC9kdHMvZnJlZXNj
YWxlL2lteDkzLXBoeWNvcmUtCj4gPiA+ID4gPiA+ID4gc29tLmR0c2kKPiA+ID4gPiA+ID4gPiAr
KysgYi9hcmNoL2FybTY0L2Jvb3QvZHRzL2ZyZWVzY2FsZS9pbXg5My1waHljb3JlLQo+ID4gPiA+
ID4gPiA+IHNvbS5kdHNpCj4gPiA+ID4gPiA+ID4gQEAgLTY4LDYgKzY4LDggQEAgbWRpbzogbWRp
byB7Cj4gPiA+ID4gPiA+ID4gwqDCoMKgwqAgZXRocGh5MTogZXRoZXJuZXQtcGh5QDEgewo+ID4g
PiA+ID4gPiA+IMKgwqDCoMKgIGNvbXBhdGlibGUgPSAiZXRoZXJuZXQtcGh5LWllZWU4MDIuMy1j
MjIiOwo+ID4gPiA+ID4gPiA+IMKgwqDCoMKgIHJlZyA9IDwxPjsKPiA+ID4gPiA+ID4gPiArIHJl
c2V0LWdwaW9zID0gPCZncGlvNCAyMyBHUElPX0FDVElWRV9ISUdIPjsKPiA+ID4gPiA+ID4gPiAr
IHJlc2V0LWFzc2VydC11cyA9IDwzMD47Cj4gPiA+ID4gPiA+IElzIHRoZXJlIGFueXRoaW5nIGlu
IHRoZSBkYXRhc2hlZXQgYWJvdXQgbmVlZGluZyBhIGRlbGF5Cj4gPiA+ID4gPiA+IGFmdGVyCj4g
PiA+ID4gPiA+IHRoZQo+ID4gPiA+ID4gPiByZXNldD8gVGhlcmUgaXMgYSBEVCBwcm9wZXJ0eSBm
b3IgdGhpczoKPiA+ID4gPiA+ID4gCj4gPiA+ID4gPiA+IMKgwqDCoMKgIHJlc2V0LWRlYXNzZXJ0
LXVzOgo+ID4gPiA+ID4gPiDCoMKgwqDCoMKgwqAgZGVzY3JpcHRpb246Cj4gPiA+ID4gPiA+IMKg
wqDCoMKgwqDCoMKgwqAgRGVsYXkgYWZ0ZXIgdGhlIHJlc2V0IHdhcyBkZWFzc2VydGVkIGluCj4g
PiA+ID4gPiA+IG1pY3Jvc2Vjb25kcy4KPiA+ID4gPiA+ID4gSWYKPiA+ID4gPiA+ID4gwqDCoMKg
wqDCoMKgwqDCoCB0aGlzIHByb3BlcnR5IGlzIG1pc3NpbmcgdGhlIGRlbGF5IHdpbGwgYmUKPiA+
ID4gPiA+ID4gc2tpcHBlZC4KPiA+ID4gPiA+IGlzIGl0IHRoZSB0aW1lIHVudGlsIHRoZSBQSFkg
ZmluaXNoZWQgaXRzIHBvc3QgcmVzZXQKPiA+ID4gPiA+IHN0YWJpbGl6YXRpb24KPiA+ID4gPiA+
IChkYXRhc2hlZXQgdG8gY2FsbCBpdCBUMiAicmVzZXQgdG8gU01JIHJlYWR5Iik/Cj4gPiA+ID4g
VGhlIFQyICgiUG9zdCByZXNldCBzdGFiaWxpemF0aW9uIHRpbWUiKSBpbiB0aGUgZGF0YXNoZWV0
IGlzCj4gPiA+ID4gdGhlCj4gPiA+ID4gdGltZQo+ID4gPiA+ICJwcmlvciB0byBNREMgcHJlYW1i
bGUgZm9yIHJlZ2lzdGVyIGFjY2VzcyIsIHRoYXQgaXMgZGVmaW5lZAo+ID4gPiA+IHdpdGgKPiA+
ID4gPiAybXMuCj4gPiA+ID4gSSBkaWQgbm90IHVzZSByZXNldC1kZWFzc2VydC11cyBmb3IgaXQs
IGJlY2F1c2UgdGhlIGZpcnN0Cj4gPiA+ID4gcmVnaXN0ZXIKPiA+ID4gPiBhY2Nlc3MgZG9lcyBh
bnl3YXkgb2NjdXIgbXVjaCBsYXRlciAoSSBtZWFzdXJlZCA0MDAwbXMpLgo+IEp1c3QgdG8gYmUg
c3VyZSwgZG8geW91IHJlYWxseSBtZWFuIDQwMDAgbWlsbGlzZWNvbmRzID8KPiAKWWVzLCB0aGF0
J3Mgd2hhdCBJIG1lYXN1cmVkLiBGb3IgYW5hbHlzaXMsIEkgYWRkZWQgc29tZSBkZWJ1Z8Kgb3V0
cHV0cwp0bwp0aGUgcGh5IHJlc2V0IGFuZCB0aGUgMXN0IHBoeSByZWdpc3RlciBhY2Nlc3MuIEFu
ZCBhcyBJIGNhbiBzZWUsIHRoZQpwaHkgcmVnaXN0ZXIgYWNjZXNzwqBoYXBwZW5zIHdoZW7CoHVz
ZXJsYW5kIHNldHMgdXAgdGhlIG5ldHdvcms6CgoKICAgICAgIFsgICAxLjcyMzI5OF0gREVCLVBI
WTogbWRpbyByZXNldCBleGV1Y3RlZAogICAgICAgLi4uCiAgICAgICAuLi4KICAgICAgIC4uLgog
ICAgICAgWyAgT0sgIF0gU3RhcnRlZCBOZXR3b3JrIENvbmZpZ3VyYXRpb24uCiAgICAgICBbICAg
NS43OTI3MDVdIERFQi1QSFk6IHJlZ2lzdGVyIGFjY2VzcwoKClRoZSBjYWxjdWxhdGVkIGRlbHRh
IG9mIDQsMDY5NDA3IHNlY29uZHMgZml0cyB0byB3aGF0IEkgbWVhc3VyZWQgd2l0aAp0aGUgb3Nj
aWxsb3Njb3BlICg0MDQwbXMpLgoKUmVnYXJkcywKQ2hyaXN0b3BoCgoKPiA+ID4gPiAKPiA+ID4g
PiBBbmQgd2UgaGF2ZSB0aGUgc2FtZSBmb3IgVDQsIHRoZSAiUG9zdCBwb3dlci11cCBzdGFiaWxp
emF0aW9uCj4gPiA+ID4gdGltZSIuCj4gPiA+ID4gSXQgaXMgZGVmaW5lZCB3aXRoIGEgdGltZSBv
ZiA1MG1zIGFzICJwcmlvciB0byBNREMgcHJlYW1ibGUgZm9yCj4gPiA+ID4gcmVnaXN0ZXIgYWNj
ZXNzIi4gQnV0IGFsc28gaGVyZSB3ZSBqdXN0IGtub3csIHRoZSByZWdpc3Rlcgo+ID4gPiA+IGFj
Y2Vzcwo+ID4gPiA+IGhhcHBlbnMgbXVjaMKgbGF0ZXIgLSBhbmQgdHJlYXRlZCBpdCBhcyBlbm91
Z2guCj4gPiA+ID4gCj4gPiA+ID4gRm9ybWFsbHksIHRoaXMgbWF5IGJlIHZhbGlkIHRvIHNwZWNp
ZnkgdGhlIDJtcyBhcyByZXNldC0KPiA+ID4gPiBkZWFzc2VydC0KPiA+ID4gPiB1cy4KPiA+ID4g
PiBCdXQgc2luY2UgdGhlIGZpcnN0IHJlZ2lzdGVyIGFjY2VzcyBpcyBzbyBtdWNoIGxhdGVyLCBJ
IHRob3VnaHQKPiA+ID4gPiB3ZQo+ID4gPiA+IGNhbgo+ID4gPiA+IHNhdmUgdGhvc2UgMm1zLgo+
ID4gPiA+IAo+ID4gPiA+IEFyZSB5b3UgZmluZSB3aXRoIHRoYXQ/Cj4gPiA+IEkgZG9uJ3QgaW5z
aXN0IG9uIGFuIGFkZGl0aW9uYWwgInJlc2V0LWRlYXNzZXJ0LXVzIi4gVGhlIHF1ZXN0aW9uCj4g
PiA+IHdhcwo+ID4gPiBtb3JlIGFib3V0IHVuZGVyc3RhbmRpbmcuCj4gPiBHcmVhdCwgdGhhbmtz
IGZvciB0aHIgZmVlZGJhY2suCj4gPiAKPiA+ID4gPiBSZWdhcmRzLAo+ID4gPiA+IENocmlzdG9w
aAo+ID4gPiA+IAo+ID4gPiA+IAo+ID4gPiA+ID4gPiBBbnl3YXk6Cj4gPiA+ID4gPiA+IAo+ID4g
PiA+ID4gPiBSZXZpZXdlZC1ieTogQW5kcmV3IEx1bm4gPGFuZHJld0BsdW5uLmNoPgo+ID4gPiA+
ID4gPiAKPiA+ID4gPiA+ID4gwqDCoMKgwqDCoMKgIEFuZHJldwo+ID4gPiA+ID4gPiAKPiAK
Return-Path: <linux-kernel+bounces-665963-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org [147.75.48.161])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id A545541E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:32:43 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by sy.mirrors.kernel.org (Postfix) with ESMTPS id C56D57B0396
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:31:25 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C11A28E569;
Wed, 28 May 2025 18:32:34 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="3TAyPiLS"
Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6124E286880
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:32:32 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.176
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748457153; cv=none; b=STuzLdjSVR7EDyHuG+sQaVOwhslyOn3zP8qh0UY40nbRZpPK9JWmvYSJjq16cHyrt/8gtAfqAGVz2yPAB2ZfmYQAzqOM+MKJjKsdQoZDN0H9sf+E/an7BH7uez4dalVv8SoaC/bzeLTim63vCifRFZCpD4353nUFopxZLoBfWyQ=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748457153; c=relaxed/simple;
bh=boyL95hUBCZDIgAKwsOxvCQrcsFMOD06ow6l9kom5z0=;
h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:
To:Cc:Content-Type; b=tp7Gj67jJCYiqL/eg/q+yfJGA1FINe0GMM0PPeXtTceJNR/NAJpUaQVSwphf6EIDgYh1lEwWRUOCZr+fDClqX6m3rhh+vNQHLFCwxuhVAlCuS3OVE8wKg2WrM5xuXyT5+crDot4GlVxYPYDytP5dgivZdHGQIN2xGfgG1HnjpFA=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=3TAyPiLS; arc=none smtp.client-ip=209.85.222.176
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com
Received: by mail-qk1-f176.google.com with SMTP id af79cd13be357-7c922734cc2so19484185a.1
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 11:32:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=google.com; s=20230601; t=1748457151; x=1749061951; darn=vger.kernel.org;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:from:to:cc:subject:date
:message-id:reply-to;
bh=0NGTzYMC2G2yNr8MqPcsRm4OyQAyOvCBgCRC7moKcIA=;
b=3TAyPiLSY3kyl2SgzZkx2uLb8gp+61VdzbYo0DmRt1cMd1hVKn/Dv986W/+eNSwd9l
F23ReAGw6nLFNa5gC6LDbbubtsfoIp2FjtNzmo2GkmJyGwHgdU1KlsWBWoVSAWxNNvvP
ApcLH8rbQBOoP0XFwVF7alNNmLBqzW9IQSrTMWSvyRycWzaV0xQSnTMofMx8XeSGVqLz
DKSeiC1PfHUTZewKwut++8T3SazDZXsHSvnzyh7UWDvKbzbJ44ECCIfxNJYnH1Q2mlU5
j1vj06ULk4nq8J2GNZjXvf+bAHnohDi/F3q2KA12khSh03GJ/bavKjUu/4JbiU7OvfoQ
S7mg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1748457151; x=1749061951;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=0NGTzYMC2G2yNr8MqPcsRm4OyQAyOvCBgCRC7moKcIA=;
b=MZwEBTocDzE0H7ZYdO0I17escKk8FwVeeKkhn4FiubK+9qj6jZyY4/pyvA/OzzaQhM
AKN7SEJmpsByrrtRl7WpsJMQ8qIq1Xu+Ywf6G5WT3Rt7CG13k5RSjM8R+OctsibwVDkH
/L9MxFXoYG7US/du71o0wU//WiVORopWxJmtcEnbUdU+1DAQh8kDCZsdCrE2z3VfdMwr
F+ETClYce9nNacWp+ygHM2uMcNCADgm9OXMReCGeyWoHDevxS1Oqb95sNwxHgJam2auN
5p752nbH+FaO2x7hR5sBBMTz/E/7kF8tH6wCPH6a+cVzWbtLEhg5NMO3UWe3B41H7TV7
PpHg==
X-Forwarded-Encrypted: i=1; AJvYcCUI90Vm5m+e1Gnd4EReEsj/A2fcMf9JUNDbi3BujQ4Gbl/nUjMiwbHIgSQuToOmQZoMU/DDkeHrFGij8F0=@vger.kernel.org
X-Gm-Message-State: AOJu0Yyj5Jil7/05GGypGsLE3DXows6FV3P5LYeaau3GRS1MtPJ4kWTs
uDvDilRS3GDPRagbBq+mN6mNjRVFj6wJMgS99qk8TXCKYgKNy05IMKAx3q4rDyNiut4gXDv1G+U
xvVeYVlGBO44fspNDMdfK+SLjxHdu20MnCeR7mvoT
X-Gm-Gg: ASbGncsJ1hwKPU8MjPPxxAb58t99TibuLDEXJgVLs6lplmFoUZxx2clAUhm6TwvRWmn
URezVUM1czHcU622yfcyRDTuXnM6MjfOIJH5ctG5HQldWojVDh/KgfnnNZEuP5nc+ExFDFhe7sM
07MqtY6efJbUenSfg1UatTO17TqI/534Xsb0EmmMn61Z59NrTwCJs6AvvFgo7ZGznY7fEVF8D5
X-Google-Smtp-Source: AGHT+IExjLW+OCGUhyxB4Yj2HCQdswSJI1K1nORrngON2Q1ifDySpWD7ARMRv/RfZaNcmXfycQASxLW8zdGbiWFQIMU=
X-Received: by 2002:a05:620a:190c:b0:7ce:eab8:7c77 with SMTP id
af79cd13be357-7d09879c863mr89879785a.16.1748457150880; Wed, 28 May 2025
11:32:30 -0700 (PDT)
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
References: <20250528174426.3318110-1-dtokazaki@xxxxxxxxxx> <a0bf24c6-58da-42e7-b686-03a893b38ecb@xxxxxxxxxxxxx>
In-Reply-To: <a0bf24c6-58da-42e7-b686-03a893b38ecb@xxxxxxxxxxxxx>
From: Daniel Okazaki <dtokazaki@xxxxxxxxxx>
Date: Wed, 28 May 2025 11:32:19 -0700
X-Gm-Features: AX0GCFsIvW1B8OF9VcWbdG8SdgyKuzexjZNYqZSwytZ6BMidZ9l57KoXhMWZKQE
Message-ID: <CAOC4094v+MyrWgbkDJZ5KJhzuTmmgAuS-XacbFt5jHK3aYtOrg@xxxxxxxxxxxxxx>
Subject: Re: [PATCH v1 0/2] userspace-consumer: adding is_shared flag
To: Mark Brown <broonie@xxxxxxxxxx>
Cc: Liam Girdwood <lgirdwood@xxxxxxxxx>, Rob Herring <robh@xxxxxxxxxx>,
Krzysztof Kozlowski <krzk+dt@xxxxxxxxxx>, Conor Dooley <conor+dt@xxxxxxxxxx>,
Zev Weiss <zev@xxxxxxxxxxxxxxxxx>, kernel-team@xxxxxxxxxxx,
linux-kernel@xxxxxxxxxxxxxxx, devicetree@xxxxxxxxxxxxxxx
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Status: No, score=-11.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,
MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
What is the use case here?
The request is for a regulator to be controlled by two different
subsystems. One is a userspace HAL and the other is
a kernel driver.
Alternatively I could expose sysfs nodes in the kernel driver
for the HAL layer to connect to, but it would add coupling
between userspace and the kernel driver that might not
otherwise be necessary. The userspace regulator driver
would add some abstraction between the actual hardware
and the sysfs interface.
On Wed, May 28, 2025 at 11:16=E2=80=AFAM Mark Brown <broonie@xxxxxxxxxx> wr=
ote:
On Wed, May 28, 2025 at 05:44:23PM +0000, Daniel Okazaki wrote:
> Currently this userspace regulator driver requires exclusive control
> of the regulator to operate. This patch adds an optional flag to
> remove that constraint, and allow the regulator to be shared by other
> modules. This allows for userspace to share control over a regulator
> with kernel space.
What is the use case here? This is a debug tool intended mainly for
when you're developing a regulator driver and have something like a
development board with no consumers at all.
Return-Path: <linux-kernel+bounces-665964-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [147.75.80.249])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 7548841E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:35:16 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by am.mirrors.kernel.org (Postfix) with ESMTPS id EABDB1C0171A
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:35:28 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 0FF5028E580;
Wed, 28 May 2025 18:35:04 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="Wosndm3Q"
Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218])
(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 2EE9D2AD00;
Wed, 28 May 2025 18:34:58 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748457303; cv=none; b=fDQgaXJ6YlooQVqjjaVU+ZmoLl7oO/AtAdbgc9kXZiJ/p2oTHQ20c+1rAKE0huPFvBk5Js0Re3QuIrZTe5bXGZYDQzw0rx+zdoRNYENqcTXFzG1ZPjJ1rz7TOvOIOwysRYIOG0O7zt/T+gFv9PGYDXDZyopYHsyxqK6g7Qlw/rU=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748457303; c=relaxed/simple;
bh=o9psRuqLrZuh6dkcqaKQG63amKvh7ilq2Ah+aLkz5sM=;
h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
Content-Type:Content-Disposition:In-Reply-To; b=Bu8p+KFWL1NfXLxdpz2xYWVwyp9nqqxo9vPcQSuZ54Z4Ty94oZjy+CfndDkCSws7YTuVlLtGnnVkS+bSgR3vUXolNqcHYzi4+VOHRVe0JYxfFjHa/TTl6IclQpIcHbaLKEg8pz4v0G4ai9GP/FvgZhV8GmlPTUBWUbuDMG7bBJs=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=Wosndm3Q; arc=none smtp.client-ip=78.32.30.218
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk
Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:
Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID:
Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:
Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:
List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive;
bh=oEfLgoqZZlV3CauhRyPut9aS8+kFBL6RAy2mXOuaG1k=; b=Wosndm3QpTZVvNqtddTO/EUoXb
G2aSMfofpfTs0Lj9HH36ZoGLLfL29XW2NdZptgFMhsLa4HiLJmIRkdeqv7/651xgC0r0P/ve6nFjK
QFQxC/4Ql5Bi0PD/gU1UHyqdJMizemvlygAL97MKyKy/l31HXEXeKcuTqXtchmTqSG3u7BbvuNwUl
wR4TI0dfDpSr3+Keyxz27/QnzYt/qxEsxU02bJbw0JG54MYdZwnf6PKG2ee1/3m98EsDkdlnl5nGy
wu5BiJNG0PHlg6yVdKWTnIIuO7RJ8l0+gdQCwwtIoYJo7bvIaE1s1Cqc1C9Mg9iX9fpnKBjlFABZS
jcD17Cog==;
Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:50888)
by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
(Exim 4.96)
(envelope-from <linux@xxxxxxxxxxxxxxx>)
id 1uKLc2-0000ci-1Y;
Wed, 28 May 2025 19:34:50 +0100
Received: from linux by shell.armlinux.org.uk with local (Exim 4.96)
(envelope-from <linux@xxxxxxxxxxxxxxxxxxxxx>)
id 1uKLbx-0002d3-0P;
Wed, 28 May 2025 19:34:45 +0100
Date: Wed, 28 May 2025 19:34:44 +0100
From: "Russell King (Oracle)" <linux@xxxxxxxxxxxxxxx>
To: James Hilliard <james.hilliard1@xxxxxxxxx>
Cc: wens@xxxxxxxx, Andrew Lunn <andrew@xxxxxxx>, netdev@xxxxxxxxxxxxxxx,
linux-sunxi@xxxxxxxxxxxxxxx, Andrew Lunn <andrew+netdev@xxxxxxx>,
"David S. Miller" <davem@xxxxxxxxxxxxx>,
Eric Dumazet <edumazet@xxxxxxxxxx>,
Jakub Kicinski <kuba@xxxxxxxxxx>, Paolo Abeni <pabeni@xxxxxxxxxx>,
Maxime Coquelin <mcoquelin.stm32@xxxxxxxxx>,
Alexandre Torgue <alexandre.torgue@xxxxxxxxxxx>,
Furong Xu <0x1207@xxxxxxxxx>,
Kunihiko Hayashi <hayashi.kunihiko@xxxxxxxxxxxxx>,
linux-stm32@xxxxxxxxxxxxxxxxxxxxxxxxxxxx,
linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
Subject: Re: [PATCH v2 1/3] net: stmmac: allow drivers to explicitly select
PHY device
Message-ID: <aDdXRPD2NpiZMsfZ@xxxxxxxxxxxxxxxxxxxxx>
References: <CADvTj4rGdb_kHV_gjKTJNkzYEPMzqLcHY_1xw7wy5r-ryqDfNQ@xxxxxxxxxxxxxx>
<fe8fb314-de99-45c2-b71e-5cedffe590b0@xxxxxxx>
<CADvTj4qRmjUQJnhamkWNpHGNAtvFyOJnbaQ5RZ6NYYqSNhxshA@xxxxxxxxxxxxxx>
<014d8d63-bfb1-4911-9ea6-6f4cdabc46e5@xxxxxxx>
<CADvTj4oVj-38ohw7Na9rkXLTGEEFkLv=4S40GPvHM5eZnN7KyA@xxxxxxxxxxxxxx>
<aDbA5l5iXNntTN6n@xxxxxxxxxxxxxxxxxxxxx>
<CADvTj4qP_enKCG-xpNG44ddMOJj42c+yiuMjV_N9LPJPMJqyOg@xxxxxxxxxxxxxx>
<f915a0ca-35c9-4a95-8274-8215a9a3e8f5@xxxxxxx>
<CAGb2v66PEA4OJxs2rHrYFAxx8bw4zab7TUXQr+DM-+ERBO-UyQ@xxxxxxxxxxxxxx>
<CADvTj4qyRRCSnvvYHLvTq73P0YOjqZ=Z7kyjPMm206ezMePTpQ@xxxxxxxxxxxxxx>
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <CADvTj4qyRRCSnvvYHLvTq73P0YOjqZ=Z7kyjPMm206ezMePTpQ@xxxxxxxxxxxxxx>
Sender: Russell King (Oracle) <linux@xxxxxxxxxxxxxxx>
X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED,
HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
On Wed, May 28, 2025 at 11:25:20AM -0600, James Hilliard wrote:
On Wed, May 28, 2025 at 8:12 AM Chen-Yu Tsai <wens@xxxxxxxx> wrote:
>
> On Wed, May 28, 2025 at 9:25 PM Andrew Lunn <andrew@xxxxxxx> wrote:
> >
> > On Wed, May 28, 2025 at 05:57:38AM -0600, James Hilliard wrote:
> > > On Wed, May 28, 2025 at 1:53 AM Russell King (Oracle)
> > > <linux@xxxxxxxxxxxxxxx> wrote:
> > > >
> > > > On Tue, May 27, 2025 at 02:37:03PM -0600, James Hilliard wrote:
> > > > > On Tue, May 27, 2025 at 2:30 PM Andrew Lunn <andrew@xxxxxxx> wrote:
> > > > > >
> > > > > > > Sure, that may make sense to do as well, but I still don't see
> > > > > > > how that impacts the need to runtime select the PHY which
> > > > > > > is configured for the correct MFD.
> > > > > >
> > > > > > If you know what variant you have, you only include the one PHY you
> > > > > > actually have, and phy-handle points to it, just as normal. No runtime
> > > > > > selection.
> > > > >
> > > > > Oh, so here's the issue, we have both PHY variants, older hardware
> > > > > generally has AC200 PHY's while newer ships AC300 PHY's, but
> > > > > when I surveyed our deployed hardware using these boards many
> > > > > systems of similar age would randomly mix AC200 and AC300 PHY's.
> > > > >
> > > > > It appears there was a fairly long transition period where both variants
> > > > > were being shipped.
> > > >
> > > > Given that DT is supposed to describe the hardware that is being run on,
> > > > it should _describe_ _the_ _hardware_ that the kernel is being run on.
> > > >
> > > > That means not enumerating all possibilities in DT and then having magic
> > > > in the kernel to select the right variant. That means having a correct
> > > > description in DT for the kernel to use.
> > >
> > > The approach I'm using is IMO quite similar to say other hardware
> > > variant runtime detection DT features like this:
> > > https://github.com/torvalds/linux/commit/157ce8f381efe264933e9366db828d845bade3a1
> >
> > That is for things link a HAT on a RPi. It is something which is easy
> > to replace, and is expected to be replaced.
>
> Actually it's for second sourced components that are modules _within_
> the device (a tablet or a laptop) that get swapped in at the factory.
> Definitely not something easy to replace and not expected to be replaced
> by the end user.
Yeah, to me it seems like the PHY situation is similar, it's not replaceable
due to being copackaged, it seems the vendor just switched over to a
second source for the PHY partway through the production run without
distinguishing different SoC variants with new model numbers.
Keep in mind stmmac itself implements mdio PHY scanning already,
which is a form of runtime PHY autodetection, so I don't really see
how doing nvmem/efuse based PHY autodetection is all that different
from that as both are forms of PHY runtime autodetection.
What is different is using "phys" and "phy-names" which historically
has never been used for ethernet PHYs. These have been used for serdes
PHYs (e.g. multi-protocol PHYs that support PCIe, SATA, and ethernet
protocols but do not provide ethernet PHY capability).
Historically, "phys" and "phy-names" have been the domain of
drivers/phy and not drivers/net/phy. drivers/net/phy PHYs have
been described using "phy-handle".
So, you're deviating from the common usage pattern, and I'm not sure
whether that has been made clear to the DT maintainers that that is
what is going on in this patch series.
As for the PHY scanning is a driver implementation issue; it doesn't
have any effect on device tree, it doesn't "abuse" DT properties to
do so. The PHY scanning is likely historical, probably from times
where the stmmac platform data was provided by board files (thus
having the first detected PHY made things simpler.) Therefore, I
don't think using it as a justification for more "autodetection"
stands up.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Return-Path: <linux-kernel+bounces-665965-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 4E98B41E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:35:30 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by ny.mirrors.kernel.org (Postfix) with ESMTPS id 78583501F6C
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:35:31 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id D50B12AD00;
Wed, 28 May 2025 18:35:16 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="YWRioj7l"
Received: from mail-il1-f178.google.com (mail-il1-f178.google.com [209.85.166.178])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id A081528DEE0
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:35:14 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.178
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748457316; cv=none; b=EEcgebQksNI2w1vQ2NZo3ifjUy072lydHQOJWG5rdL53S7Whw5SGr6R9XXBW01srKjdl2QACxvBWNm7tyJxXdwalLtaGuHpO5zT/e3S+SxCVgne1y7h9z8I+5qmnVhhPcsddWjYg3i2WDa71jOBixf088x9gf965oM9F4wr4zpc=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748457316; c=relaxed/simple;
bh=Jz7Nai9JFiOirN09TRvaGuuwtMD049NqJp7EUjquMVU=;
h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:
To:Cc:Content-Type; b=BldxXJQZ/FzREJpuoE69NoI1ZP2bgJMA1B9Zdal3UKkVmwlS5Qz/3dhLyZUCSvNiKmMspiaHpOa9Q3b6hoCbtW9n5lKuAC+Y+Pw5xaiccc0Z3mwd4Z9hjGBDpOoworaCoehWRxgSJlmk4tujqhRfp8wKQl16ZZm23wPARp2j33Q=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=YWRioj7l; arc=none smtp.client-ip=209.85.166.178
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com
Received: by mail-il1-f178.google.com with SMTP id e9e14a558f8ab-3da76aea6d5so18155ab.1
for <linux-kernel@xxxxxxxxxxxxxxx>; Wed, 28 May 2025 11:35:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=google.com; s=20230601; t=1748457313; x=1749062113; darn=vger.kernel.org;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:from:to:cc:subject:date
:message-id:reply-to;
bh=2cVLMwY4AxanVU8F/mVt2OHuXPMKbrtS0JnadrXFkYs=;
b=YWRioj7lDUZBh61XThc8rxbgIqVywLZ6oNeTGKZXZOEV6A9X4reI8bzBkwwcL6ZeQC
dtU+60ycwHyWiWOsjvR+An02+17mZo5xYYRLarL7B8IGYd+cr1L6weLcph+WMwyauR7M
ELkR1NU1xg4Rtt7fddCDVcjRFjpdurarcfNXvdCxQchYCbEbgirskQwIUldoRmKEzgwT
nP1WL0w67LH+ftBGRYcIMCBS9kMW5SX+Ml7YFZra99DeKCgOCopcrO7EkiNhThFFW6s8
oKvcrLv7HlepCVzOUtmMuitaIynv948HhfBYMdFFF9MQqZE4jN9fU1fdyyZ43U8JtX/q
QSzw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1748457313; x=1749062113;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=2cVLMwY4AxanVU8F/mVt2OHuXPMKbrtS0JnadrXFkYs=;
b=Rxq7ZITAjrNuMz5Q72En+qfpfaYwyuDXMkiyRqY6ETCPRNizJYPF118U+lllPOSoGr
DqX9QEhIsNr8KJvdOxEqXBeI67+0Cvtpl9gNi/rtpUOFYbFvp+shteZqZLQyfjYXFFKp
LimWooy1F4qW15RKpapG+MrfB4gBJgQfC6sNuk9kiV0LgVXcGAsLGChslUEKcqhpys1Y
yHdNdeMXj8kZcgzzypP43XWzimYxgyhmvvKpSDhtCLvWo9qZcfRv4szYEuFikFmJUENE
LO7UYeAivZyvpatiyWCbDq+VvhEJych1uH1WTeo0KaNV7hMYRcltrinsVpDgwyO9QELA
4H0A==
X-Forwarded-Encrypted: i=1; AJvYcCUZhggL4PPOedpa4GwQMZOu9sl29LVb2iHDjZZBHxb4/DFE+2H9RpGz/1ovZH3cltV7/s5K9C4jQg61ur8=@vger.kernel.org
X-Gm-Message-State: AOJu0Yzal0AhHZFwgx3ZeQ1lceWeWEfQhQZWxKxYM0TkTqsOw/ZWkHT1
8C3ZcqUOaHZbx3dvlpHx20Sq/dp/QCx2SzqXm+bEOhCkCSuGslyQaFQ5su/BArWHtSazOfhOIjW
omhfkaEGpYhikWInsFuiT3mtI8+Zy97RBf77W60oM
X-Gm-Gg: ASbGncsHe+9x8kZa53SA1BExPFSHCszdgEFYSoJHz2bXISswK7IuEjNbSJgPFLhyuPT
QiZtpzMVN3bGdRwD+8BXya6zVepnVYnU9AqAWYBC4l4bP2zXfyhiRpIH8vQXCR3OdYdj0bSPQJq
MB+IH7IQktoo0wlyTxQ3aqbzgwPEsBdDvLRM+olQeJZ+2ihl9olTanrfn9Ci3QNIruu+r2hNvy
X-Google-Smtp-Source: AGHT+IGYXX0WDoz2XCkffg330kupFU0jreTbKLaIcJ3R/pK8nBp48fujSFr5wR2xC39RxHnZaH4b1vXmghZ5HEoyCok=
X-Received: by 2002:a05:6e02:1a08:b0:3dc:830e:1ce6 with SMTP id
e9e14a558f8ab-3dd920f5e16mr384695ab.22.1748457312709; Wed, 28 May 2025
11:35:12 -0700 (PDT)
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
References: <20250410202647.1899125-1-irogers@xxxxxxxxxx> <Z_mK9BVv16MT7shL@z2>
<CAP-5=fWykL-01S=35zz-6JASbM_cQkx6PHdKS7pJAX0=JBTuNQ@xxxxxxxxxxxxxx>
<CAP-5=fWFYS7-FcbyJ5Z5U2rqA7eYwwJ4dMf90TUzwJ0Shh2yxA@xxxxxxxxxxxxxx> <aDdU1npHL2Vczhsa@xxxxxxxxxx>
In-Reply-To: <aDdU1npHL2Vczhsa@xxxxxxxxxx>
From: Ian Rogers <irogers@xxxxxxxxxx>
Date: Wed, 28 May 2025 11:35:00 -0700
X-Gm-Features: AX0GCFuOWPXoPpHqCzIaOBkJlXVpLQKsGRF_N94G7uJ_0dqi9rbnNFLaxAn8bjI
Message-ID: <CAP-5=fUycjUUWW=hoSSvxfUVPXcqAk5KHnknFuUDOr7+Zf=M2A@xxxxxxxxxxxxxx>
Subject: Re: [RFC PATCH v1] perf build: Fix build for clang's -Wunreachable-code
To: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>,
Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>, Mark Rutland <mark.rutland@xxxxxxx>,
Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>,
Adrian Hunter <adrian.hunter@xxxxxxxxx>, Kan Liang <kan.liang@xxxxxxxxxxxxxxx>,
linux-kernel@xxxxxxxxxxxxxxx, linux-perf-users@xxxxxxxxxxxxxxx
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Status: No, score=-11.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,
MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,
SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
On Wed, May 28, 2025 at 11:24=E2=80=AFAM Namhyung Kim <namhyung@xxxxxxxxxx>=
wrote:
On Tue, May 27, 2025 at 01:53:37PM -0700, Ian Rogers wrote:
> On Fri, Apr 11, 2025 at 3:14=E2=80=AFPM Ian Rogers <irogers@xxxxxxxxxx>=
wrote:
> >
> > On Fri, Apr 11, 2025 at 2:34=E2=80=AFPM Namhyung Kim <namhyung@kernel=
.org> wrote:
> > >
> > > Hi Ian,
> > >
> > > On Thu, Apr 10, 2025 at 01:26:47PM -0700, Ian Rogers wrote:
> > > > Clang's unreachable code warning is able to catch bugs like the f=
amous
> > > > "goto fail" which gcc's unreachable code warning fails to warn ab=
out
> > > > (it will complain about misleading indent). The changes here are
> > > > sufficient to get perf building with clang with -Wunreachable cod=
e,
> > > > but they don't really fix any bugs. Posting as an RFC to see if a=
nyone
> > > > things this is worth pursuing.
> > >
> > > I'm not sure if it's useful and don't see what kind of bugs it can
> > > address. The proposed changes don't look like an improvement.
> >
> > The goto fail case was in OpenSSL the code from a bad merge:
> > ```
> > if (...)
> > goto fail;
> > goto fail;
> > ```
> > Meaning the fail path was always taken and checking on the non-fail
> > code never executed. Newer GCCs will warn of this because of the
> > "misleading indent" but clang won't. It is easy to imagine similar
> > mistakes creeping in, so using compiler warnings to avoid the bug
> > could be useful.
It doesn't look very convincing to me but it might be valuable in some
rare cases. But the proposed changes - basically replace exit() to
__builtin_unreachable() - seem weird. Why is calling it a problem? I
guess it already has some kind of annotation like "noreturn"?
Yep. The exit is incorrect (depending on your notion of correct, I'd
go with clang's notion as they've had to consider this for a while) as
it can never be executed. I've added the __builtin_unreachable() to
document that you can never get to that statement, as otherwise it can
make the code readability harder with the code looking like it will
fall through after calling something like usage_with_options (which is
noreturn). In unoptimized builds __builtin_unreachable() will fail if
executed, so it is a bit more active than just a comment.
Thanks,
Ian
Thanks,
Namhyung
Return-Path: <linux-kernel+bounces-665966-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id BE46C41E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:35:43 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by ny.mirrors.kernel.org (Postfix) with ESMTPS id 19F0E501FEA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:35:45 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 7ECB928E60A;
Wed, 28 May 2025 18:35:21 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EyxoTjOY"
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201])
(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 BA12C28E59E;
Wed, 28 May 2025 18:35:19 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748457320; cv=none; b=ULzxRsVmw/t5eR60OTpSk7sNDEHqdbBRx2ZyCWzDw7Fh4WtBLlumeu0leQ1WzEeAkI24sSOSh8MaX9m/fMlKNF/HfcJpSpi3nlimTVKyVQeK3r/33mMnbvPbBHGoK9oLdPzywLbimkrOkMlHkEF0Y0cF7Bumne8kTtZujNGdbok=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748457320; c=relaxed/simple;
bh=sXCVV6kdPgQbjpG0tMeOMWH6XXP1dpXHjjuJ3paPNsk=;
h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
Content-Type:Content-Disposition:In-Reply-To; b=Y0tk6CD6FrNQUs+iDbbChSDzSoHyAPWt1MXxuQgw4MxBSAgOxs1dcYT1KKX0z80ppFEpJcA3D1emIU90jtQ/6zhGTQKi9bWdJ6O33L5tW1eCmq4/rmAAciFNqxeLImcsHTRED5nt9gaZF6HhoM20TlC1L9/tPPnyIIb/HF4Bdww=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EyxoTjOY; arc=none smtp.client-ip=10.30.226.201
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4961CC4CEE3;
Wed, 28 May 2025 18:35:18 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
s=k20201202; t=1748457319;
bh=sXCVV6kdPgQbjpG0tMeOMWH6XXP1dpXHjjuJ3paPNsk=;
h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
b=EyxoTjOYzd2GBs/jjMwThPF5Jd3ZClDUvT3+7wSgJADitXdj0cnK2tsACSTRlwNj7
BF/2vi9mc/C4F/5New6v+8vKN86Zy2Qfl+rT9Ru8QfothPDJ3yOcTp9wZPnTIvo2Oe
e60IoR9IwQlvxhbTucbKQpHaaqpQ6DcXyKhIetLH2VQn5+jIwRXUl3CaUM/MSY2w/F
qCiw4I/uGpea6/6hZ+QNbCS5GgTH4e0HF4xfyqYzGE7UGmE3dw2aJYtu1B8izNfb+j
+FQHhIjf6Ww+Pk1RcZf/IsQ2vgNlxJCX08tQpuYQ2sEr5YsbVNMlFEgSLBZIJjj0kp
5H5rJxo9SEEjQ==
Date: Wed, 28 May 2025 11:35:16 -0700
From: Namhyung Kim <namhyung@xxxxxxxxxx>
To: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: Ravi Bangoria <ravi.bangoria@xxxxxxx>, Ian Rogers <irogers@xxxxxxxxxx>,
Kan Liang <kan.liang@xxxxxxxxxxxxxxx>, Jiri Olsa <jolsa@xxxxxxxxxx>,
Adrian Hunter <adrian.hunter@xxxxxxxxx>,
Peter Zijlstra <peterz@xxxxxxxxxxxxx>,
Ingo Molnar <mingo@xxxxxxxxxx>, LKML <linux-kernel@xxxxxxxxxxxxxxx>,
linux-perf-users@xxxxxxxxxxxxxxx
Subject: Re: [PATCH v2] perf test: Add AMD IBS sw filter test
Message-ID: <aDdXZJrPSJlCAcTs@xxxxxxxxxx>
References: <20250524002754.1266681-1-namhyung@xxxxxxxxxx>
<960adb81-2c77-4e77-b685-b3f3005cb286@xxxxxxx>
<aDYlyY2UbBxcMb9f@x1>
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <aDYlyY2UbBxcMb9f@x1>
X-Spam-Status: No, score=-6.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,
RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,
RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
On Tue, May 27, 2025 at 05:51:21PM -0300, Arnaldo Carvalho de Melo wrote:
On Sat, May 24, 2025 at 03:17:13PM +0530, Ravi Bangoria wrote:
> Hi Namhyung,
>
> On 24-May-25 5:57 AM, Namhyung Kim wrote:
> > The kernel v6.14 added 'swfilt' to support privilege filtering in
> > software so that IBS can be used by regular users. Add a test case in
> > x86 to verify the behavior.
> >
> > $ sudo perf test -vv 'IBS software filter'
> > 113: AMD IBS software filtering:
> > --- start ---
> > test child forked, pid 178826
> > check availability of IBS swfilt
> > run perf record with modifier and swfilt
> > [ perf record: Woken up 3 times to write data ]
> > [ perf record: Captured and wrote 0.000 MB /dev/null ]
> > [ perf record: Woken up 3 times to write data ]
> > [ perf record: Captured and wrote 0.000 MB /dev/null ]
> > [ perf record: Woken up 3 times to write data ]
> > [ perf record: Captured and wrote 0.000 MB /dev/null ]
> > [ perf record: Woken up 0 times to write data ]
> > [ perf record: Captured and wrote 0.000 MB /dev/null ]
> > check number of samples with swfilt
> > [ perf record: Woken up 3 times to write data ]
> > [ perf record: Captured and wrote 0.037 MB - ]
> > [ perf record: Woken up 3 times to write data ]
> > [ perf record: Captured and wrote 0.041 MB - ]
> > ---- end(0) ----
> > 113: AMD IBS software filtering : Ok
> >
> > Cc: Ravi Bangoria <ravi.bangoria@xxxxxxx>
> > Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
>
> Reviewed-by: Ravi Bangoria <ravi.bangoria@xxxxxxx>
>
> A minor nit below ...
>
> > +echo "check number of samples with swfilt"
> > +
> > +kernel_sample=$(perf record -e ibs_op/swfilt/u -o- true | perf script -i- -F misc | grep -c ^K)
>
> "true" barely runs in userspace. So, many a times this "perf record"
> generates no samples :)
Right, something else, maybe one of those workloads:
acme@number:~/git/perf-tools-next$ perf test --list-workloads
noploop
thloop
leafloop
sqrtloop
brstack
datasym
landlock
acme@number:~/git/perf-tools-next$
root@number:~# time perf record -e ibs_op/swfilt/u perf test -w sqrtloop
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.160 MB perf.data (3976 samples) ]
real 0m1.588s
user 0m1.407s
sys 0m0.161s
root@number:~# perf script | wc -l
3976
root@number:~#
But I'm applying the patch as is, we can replace the workload later.
Thanks, I can add some workload to create both kernel and user traffic.
I think the current workloads run in user space mostly.
Thanks,
Namhyung
Return-Path: <linux-kernel+bounces-665967-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org [147.75.48.161])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id 962DD41E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:36:20 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by sy.mirrors.kernel.org (Postfix) with ESMTPS id 22B8E7AEE30
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:35:02 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id BE35928E56D;
Wed, 28 May 2025 18:36:12 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="l9LaOCz7"
Received: from PA4PR04CU001.outbound.protection.outlook.com (mail-francecentralazon11013033.outbound.protection.outlook.com [40.107.162.33])
(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 41EED2AD00;
Wed, 28 May 2025 18:36:07 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.162.33
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748457371; cv=fail; b=IjydcgGMxy8jS2PjNigLRwFWA6VC5wuiU1+4vqfOpVJc09O9+Jir+q7jULsuwQvXD6rZblyavwvaQ3mPnHnVrLf2mx21JTaoCCKvaJsh21a9W/vbSV73vhPOfdzD7C7lSEr4QTb/sOXTLWe8BG7z6z1gksEKnoNqyE2OSM6Rvmk=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748457371; c=relaxed/simple;
bh=9lfWmqdeKdWKQSUUw3Xt+wdGUey2H/vV21OA9P8TpaU=;
h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=eVVwS8IbyV83Fb4PKFSjd0iwbrzsGGiCWgD+XOXoYD0OsquToLtfo/Wgb+xF5lXlrtjuFRF74LLsBF/+vK+Xq5/2vjKnNjzzUcrd9W1DEiyjgcwW2V0j3iJJ1fPmNdO0OmkvXSfwDZXvrbnfuUyPJqtA4r7E9em2hB2diiBMfsU=
ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=l9LaOCz7; arc=fail smtp.client-ip=40.107.162.33
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
b=rR1sEqPQ2Xw/Ri9jAHEAQtXQsfmiRaavWpT7DUUD9CUOSJ1sk83QFces5R7tPGtW6clhZRZoNP3guZpy00fViQJ7e9munWKNdUiyXYpApXpfmQy7/VHeShnLwrgCWDv9DB/girxB3xi932bYLm3Xb7NZaLAg8RvPrF71XVcOZUchgC4a/J++03e5+VMgvfo4mZ4io68q2X7sQ9OWpUOK5zEmpdZCWOo3rrpFfPZTeHeu+l453XTPcGF6KaWyo3+HRrlIIG3R7dG4Cc+WCg2pPqdKnYGGt2iGba8L0U5sHlqJAbOOk0WQHBdo4nhiEWB9kG19fGd/uWzTVK5oc97+XQ==
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=YlT4lXXXLoiE3qAKFOidzSRR+dXCGrkIesfiqB226vw=;
b=fPGXhDf/E+aZcfLqNsYWmxSSZFQUTbfg94iwI8jUuV226jvPQoCUkZDxk+zkS+ZeUPBP4JmhdXPy2DWr9ewjqXiEK59i0J9zQZVHfQwBdBh8srSZKHaj2wpjowDS8PwLs7ehj7YXqpIM+opXtb+trTKArWHnHm8JoGxQQIU46B7ItqiXMcV9o9z9Ks/UpcnZov/ilY94xMmtx/VEoAD6WSuCZb2sL6a2vDmFWvyi8Wtpi+J76nUuH9A6GU2xFPdPHOkZG7okVLQBoIXTHczD9poW4H8yZbdtx/9LHzf+gV48eTXt/YGbYMZHBHEjpVJnUz7EkiVJhCnRew3JPfPrjQ==
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=YlT4lXXXLoiE3qAKFOidzSRR+dXCGrkIesfiqB226vw=;
b=l9LaOCz7At3PXoPKpjLbKqYNmcf6yvJ5isbfxXH7XggqL0iNaWCXvfU7/JWpMS9qRoXB3kjVHBKmKG5enzmSC9h/Q0QbQ9NcmIU3ow408qv6M8XM1xxjHj7vm3/HH8O/1dj0WoPH1n+mQF4O9KBlkySe6OLKXLsoeFs0xcqZEQp9+yfyNhGBlQV/jyIdLl9O7Vd1XOeX2ahHCkBlzcBTjkei1N+haroTJzn2Usp5W/Z/ZjEVlTe8OCZV4hOZiXL0ln6VPxthuZ5HFt6V1g6k6nFL2dW89g3mIuowF4hKMXMzvjV0mosNSLd5Qn7JHdJCD0B8Oc13flsPgjzEpOgZeg==
Authentication-Results: dkim=none (message not signed)
header.d=none;dmarc=none action=none header.from=nxp.com;
Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14)
by AS8PR04MB7590.eurprd04.prod.outlook.com (2603:10a6:20b:23d::24) with
Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8769.27; Wed, 28 May
2025 18:36:04 +0000
Received: from PAXPR04MB9642.eurprd04.prod.outlook.com
([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com
([fe80::9126:a61e:341d:4b06%2]) with mapi id 15.20.8746.030; Wed, 28 May 2025
18:36:04 +0000
From: Frank Li <Frank.Li@xxxxxxx>
To: Christophe Leroy <christophe.leroy@xxxxxxxxxx>,
Rob Herring <robh@xxxxxxxxxx>,
Krzysztof Kozlowski <krzk+dt@xxxxxxxxxx>,
Conor Dooley <conor+dt@xxxxxxxxxx>,
Shawn Guo <shawnguo@xxxxxxxxxx>,
Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>,
Pengutronix Kernel Team <kernel@xxxxxxxxxxxxxx>,
Fabio Estevam <festevam@xxxxxxxxx>,
linuxppc-dev@xxxxxxxxxxxxxxxx (open list:FREESCALE SOC DRIVERS),
linux-arm-kernel@xxxxxxxxxxxxxxxxxxx (moderated list:FREESCALE SOC DRIVERS),
devicetree@xxxxxxxxxxxxxxx (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS),
imx@xxxxxxxxxxxxxxx (open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE),
linux-kernel@xxxxxxxxxxxxxxx (open list)
Cc: imx@xxxxxxxxxxxxxxx
Subject: [PATCH v2 1/1] dt-bindings: soc: Add fsl,imx23-digctl.yaml for i.MX23 and i.MX28
Date: Wed, 28 May 2025 14:35:48 -0400
Message-Id: <20250528183549.694434-1-Frank.Li@xxxxxxx>
X-Mailer: git-send-email 2.34.1
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: SJ0PR13CA0192.namprd13.prod.outlook.com
(2603:10b6:a03:2c3::17) To PAXPR04MB9642.eurprd04.prod.outlook.com
(2603:10a6:102:240::14)
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|AS8PR04MB7590:EE_
X-MS-Office365-Filtering-Correlation-Id: ea182c1d-945a-4168-30b6-08dd9e1680e5
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
BCL:0;ARA:13230040|7416014|376014|1800799024|52116014|366016|921020|38350700014;
X-Microsoft-Antispam-Message-Info:
=?us-ascii?Q?nMWD15kfxzSq+1Ii4iy67C3S1V9B+//eeiL0WQERti9u6Qbrkf5DG8ORo8gX?=
=?us-ascii?Q?7U5vjr8Q0cYw9z1z0dqXScfavFeyskbcxOznHch4zS8zdWEmCrhAeGdSiypm?=
=?us-ascii?Q?xv5YuOArnE5Yt+9sB43ubYimZwHpv1yYDpAGJKA3KcLZ7Q3jCJnGDnfk1EW/?=
=?us-ascii?Q?P13DDzzoOSXFbclWCMg5EsGMiGqQjKv3U8jLP887q0XJogkHxyUWHWVP1CSF?=
=?us-ascii?Q?Mp/RtoxrRC4qnDI3cd/ydfBmWfyclNB/CH0ngVs9WKGs24PesngGr5lgxhA8?=
=?us-ascii?Q?7z5wwlL77wIf7T5vw3ddTyogV4YyWlSu4Wuo7jADKdSuZJU059NrN+P1Y14h?=
=?us-ascii?Q?7sZFEzRSj5UyQKm7i4wshJEYZNXVXQURFbxn6EtyW7jsPF7mqNoyoOgeGMuV?=
=?us-ascii?Q?6bpMVsHCkS8Fn/06LueKGeV20jASxkkEhaBqNPDmBANPhZtyeYWT6brMY12b?=
=?us-ascii?Q?D0Qpb8ZDDUmplGh/f05ha6WpfPHuOLFgxMhdWXftA+Mi3UNCbkSKPhgNCXvc?=
=?us-ascii?Q?snQFROjh6GJriXNhvzBLRojz7gtR48O8upR2THn/rJrDglMvtmTqG1OEnkS0?=
=?us-ascii?Q?Km1grAR4zucDrbvKr92eHvJohq5r9NiG8jITIvZbNo/TsCZvIz2G60Pyx/A+?=
=?us-ascii?Q?EBAv+O35o4dlE0dvS9P9iGIT6IywXMo5xlEJQ5A05Vpba8nX1n2TDVqTz9Uz?=
=?us-ascii?Q?Te33MtmARjQEwFvlImmJar9narECpFf7RncdGw5tX285B4QXe8kfQLDdwvqS?=
=?us-ascii?Q?rptDnsjkie7pkwWqxje0ZzLY211V9ADEghS0buV2ZZcvmwmHnVQaSeinRIGy?=
=?us-ascii?Q?Krybh+xpdUnSfItSLLKZy6ch+x0nQP93XIjS6IXI2Q9pmq7yLue2bSPRoyox?=
=?us-ascii?Q?nywsG2JYNVy/LSbDwT3xFw9EgPQ/+3I3HEYbDWO2GXmeIVrDtc222XwBe1kZ?=
=?us-ascii?Q?ryA20oc+HZWP8TILF4ExFQsG3urixydWbotESWKNGMIRQoYlw09LUc5CuNli?=
=?us-ascii?Q?G9durFx2YgZPDpPDiH4E7CdW2wHP6swv8L7M2o5YUWXbHx8zBmprQ/cLSWe1?=
=?us-ascii?Q?uiPdmCamq9+lTDJFvrzuXmHgcJN9CckBFjtejGwSDHtYgKfqwGtxvt2eABeQ?=
=?us-ascii?Q?aVNRNHKJICSUTlhn7O/oQ3+J8WEBDtgbDdzzxkx+rH6vLTOq89ZG+rgH4pzZ?=
=?us-ascii?Q?OMb4cFVusWMqM+lL8vArErZGdn3P9lqV8QRfJtsX+VnzEYcdblg/U26FZbu9?=
=?us-ascii?Q?UOQm0A2YlTMsbl81lh/toFKzl1vnVdCfhuJ0e2ixkc1OB2qzYusQlFiHrUTr?=
=?us-ascii?Q?5T8V8SXYNBxm+2MEO2d9+4tnwODwTeBTkSRFqs18SOm85rpNLc4kbVpwZfrs?=
=?us-ascii?Q?3KLtwUkvFCrWFTPw0PntZvr0DQdrGop5mRvqm8qOvOwJMTWQ+gIhMAutnx0d?=
=?us-ascii?Q?7bBE40clgEaRyZNXh4rZtKxWWFPNXGixjEpQ3nU7UR+SXttBahmfcw=3D=3D?=
X-Forefront-Antispam-Report:
CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(1800799024)(52116014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
=?us-ascii?Q?3obKLU4A7+lZNDZxCwGrQsa+O7jB8QfdcwHqpibm5HgY/ghcXMElhp7btZAH?=
=?us-ascii?Q?lCrFqfKOxxvBWryp+IpcLiCPavU1wGx6vU712TC0JQBZAJs5QBh7FQdeVFfq?=
=?us-ascii?Q?JrSiP/Ov6lbMdy1wET6cBb4IksCkQbABNJ5GNUkRGoIYQJatXnqNo8N4k1dU?=
=?us-ascii?Q?ysbv17O3f0cqGTdFOK89tStYrVsrSKBocQDFUlp3/zlGPYtOiRe9fs8X8BFa?=
=?us-ascii?Q?u5JJNmAfUcjt0xwYPNSTFmz2QJbiM0TX+o7oKxIUY6iRRrOw2GBuea/7NzRk?=
=?us-ascii?Q?s4FuVrWcvAZ9A1zWmgKPNK0mF1hgm7MnS6Uxo+rbHvxoSsy7tNL4JGjDBWqt?=
=?us-ascii?Q?7nPySmfbmKSWHHeKZyu6SYUlcXWYLunBnuTzS2VblPAp1UbkyZro6lq9FBf9?=
=?us-ascii?Q?nzi0uuza4wTKjVx8+rMOfSBS6MEeCDD14e21PTIvknHi859gk8qtnH9yRopC?=
=?us-ascii?Q?AUNORvIsGA1GO57mEhq3n6XyZAsmqdS1UeIgAzuPosoiaUnndzCX938frFzr?=
=?us-ascii?Q?pKvGgPUzr3BHyVnGpIf2amrGUt0NNzJ7E8jKWsNgChUPbPh7668SMHXhKMx/?=
=?us-ascii?Q?cwPjV4rzJwDngK/ZZvutst2dAWWEAL1afSXvL/3NsEsT5uwAF9YKyTkAfHei?=
=?us-ascii?Q?EzvdUazYb1LJ9/Oie2N9L/iVsUjqE7jEjPW5kLw/MhbfonDkaGmGXAQUbA3P?=
=?us-ascii?Q?2ldyTbJUDiCl4CbiprzzT+h1xGPhL99mYnACSnL3gmFzylI+kdcMNHQQrGNC?=
=?us-ascii?Q?E6jDr/End7ahucr2DgNTsL3Ms7lzMBMdAZw9ADHUFNXqVsy5Ybn7qpFvzEgD?=
=?us-ascii?Q?2h3PlfPe8kSuwCxUIZ2cQU4U9MRi/xaXREAklRD/TRPM4SbcfYRIs7gnn+bf?=
=?us-ascii?Q?9pXAW4WVTvG9A4a/ibEngmM5wEdHw0UPW6A6b4aXjgemy3GJuQ3LT3oiBYEU?=
=?us-ascii?Q?D+L8rhvYq3tCog2xnMk3X4A6BUvDBhcQTiCEA9MUpLhbhXbqjs0xsw8rZ7Lx?=
=?us-ascii?Q?6WREPsbVcvAXb1Sfq8K2+qPi/Pr3z/vegSTfgXoIASOJGLm1ONunGvjhL0ij?=
=?us-ascii?Q?JS19BqkOI9LAV+xQSLQMfcw//xGs8IDm6Ke8gMykWpxfYChiYVSTejWpRTKB?=
=?us-ascii?Q?JAgh8mvROv3NW7thCwnbJqIa8+M9HEKElEslZM7jTPxjalnF2J2SV15fA9pR?=
=?us-ascii?Q?7yBMWlfriukWeRDaxKFnr/9mlJ58WvNrlmG/S8obqHfyJl31hFnAAoBJSfTL?=
=?us-ascii?Q?nu0LTSQqZn+jaqqL3eO++7jB7fr05TWW3xuzXACM+ZwyXUexhW37QUEEjlMu?=
=?us-ascii?Q?sTpdeS/OEt47iMFZCbmuZKlKoi68GUKeOM6GSqeRCds/CVmKRGtz5NgF5+K1?=
=?us-ascii?Q?34rSjjocOFqBGZqE9l1pGJ74WMNyMmV+QiVKnZgt0PpaFFE84Lb4q3aCilm/?=
=?us-ascii?Q?adkv9yB2N30vnLiAKHY5umguhViIyci3N2qTJHM9UDFbUyo8/F/JP5amsJEZ?=
=?us-ascii?Q?OyqII1s0pzJntjgeYMfl4hDZ4Xf/F6Y0nSkKaz26bipgyCMOjo9sFm+QPU7z?=
=?us-ascii?Q?faMJm6dogZtz/ZJmtUBs/fL/pcNrU7LwxQsF2R3H?=
X-OriginatorOrg: nxp.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ea182c1d-945a-4168-30b6-08dd9e1680e5
X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2025 18:36:04.7717
(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: HiLVEvpNsojlmwHImSIiYdMdo+cz72GsA5T/BzGn/kK+tojVxLWXMhUWPsR3D5F6iZoe3+wxPJc4eKBxJ27Ifg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7590
X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,
RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,
RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
Add fsl,imx23-digctl.yaml for i.MX23 and i.MX28 to fix below CHECK_DTB
warning:
arch/arm/boot/dts/nxp/mxs/imx23-sansa.dtb: /apb@80000000/apbh-bus@80000000/digctl@8001c000:
failed to match any schema with compatible: ['fsl,imx23-digctl']
Signed-off-by: Frank Li <Frank.Li@xxxxxxx>
---
change in v2
- add more description about digctrl hardware module
- fix double /
---
.../bindings/soc/fsl/fsl,imx23-digctl.yaml | 53 +++++++++++++++++++
1 file changed, 53 insertions(+)
create mode 100644 Documentation/devicetree/bindings/soc/fsl/fsl,imx23-digctl.yaml
diff --git a/Documentation/devicetree/bindings/soc/fsl/fsl,imx23-digctl.yaml b/Documentation/devicetree/bindings/soc/fsl/fsl,imx23-digctl.yaml
new file mode 100644
index 0000000000000..3de135a70579a
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/fsl/fsl,imx23-digctl.yaml
@@ -0,0 +1,53 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/fsl/fsl,imx23-digctl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale mxs digctrl for i.MX23/i.MX28
+
+description: |
+ The digital control block provides overall control of various items within
+ the top digital block of the chip, including:
+ - Default first-level page table (DFLPT) controls
+ - HCLK performance counter
+ - Free-running microseconds counter
+ - Entropy control
+ - BIST controls for ARM Core and On-Chip RAM
+ - Chip Revision register
+ - USB loop back congtrol
+ - Other miscellaneous controls
+
+maintainers:
+ - Frank Li <Frank.Li@xxxxxxx>
+
+properties:
+ compatible:
+ oneOf:
+ - items:
+ - enum:
+ - fsl,imx28-digctl
+ - const: fsl,imx23-digctl
+ - const: fsl,imx23-digctl
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+ - interrupts
+
+additionalProperties: false
+
+examples:
+ - |
+ digctl@8001c000 {
+ compatible = "fsl,imx28-digctl", "fsl,imx23-digctl";
+ reg = <0x8001c000 0x2000>;
+ interrupts = <89>;
+ };
+
--
2.34.1
Return-Path: <linux-kernel+bounces-665968-lkml=lkml.rescloud.iu.edu@xxxxxxxxxxxxxxx>
X-Original-To: lkml@xxxxxxxxxxxxxxxxxxxx
Delivered-To: lkml@xxxxxxxxxxxxxxxxxxxx
Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223])
by lkml.rescloud.iu.edu (Postfix) with ESMTPS id F146D41E003FA
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 14:38:18 -0400 (EDT)
Received: from smtp.subspace.kernel.org (relay.kernel.org [52.25.139.140])
(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by ny.mirrors.kernel.org (Postfix) with ESMTPS id AFBE617D5D2
for <lkml@xxxxxxxxxxxxxxxxxxxx>; Wed, 28 May 2025 18:38:19 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 10AD528E57F;
Wed, 28 May 2025 18:38:12 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AeyGfCim"
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201])
(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 CC6DD1D6195;
Wed, 28 May 2025 18:38:10 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1748457490; cv=none; b=YlPvLl6Z2554e/2GTRmxbouXbjJEW8KxHLcIbHhsdlMkg0hNkCYYRftAyM54w/GvX1/Ej/H5E9dCo9pbIlglGBE4PO9iT146UmGfoCcpDIeAJh63WuWihKna9VfVsXaReilqaHyUORbxdRrBfkDE93u0T6YxoibNSEJs4/aigkQ=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1748457490; c=relaxed/simple;
bh=W5acOlEAdjgfenO8dPOfN7GtgEzKg0IXWTAug1aAJ2A=;
h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
Content-Type:Content-Disposition:In-Reply-To; b=GSJdSU9pxlQOSCsiAPLLpIN0tm3vDcx1rPHRezlB6tpYRR/FXFPeaRo9lc6XH/6s18uohDRs6UYyc/mFQw/luLfU+3WMDXFsC80Ni2Fu3fgn88V9EQkzJ6XDmEXvsugJADftZTTKDPLzaSRGhl0m0KAHRXRY7hx9fNCNjyla1cQ=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AeyGfCim; arc=none smtp.client-ip=10.30.226.201
Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC58FC4CEE3;
Wed, 28 May 2025 18:38:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
s=k20201202; t=1748457490;
bh=W5acOlEAdjgfenO8dPOfN7GtgEzKg0IXWTAug1aAJ2A=;
h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
b=AeyGfCimPY2kT4QHRa3RfqddiICw8gUD7MZQyDOto75vRL141UGAWJEf1vuFtyPE/
hcVF1KRPz58f4bFHJwXc/dHDhCgTNc8xmrTbDP8LX+oPC4GQ0x2Bk0xkme3BL56Hoa
cZvYmnw1PvJMfhqXXZ1c1992gX/jTKrtq7wplKixbB01fVlpHY6IdyOrhXbWtR9ByO
IEAggndjvS6rFI66xmre0pDw3m0j4+FS9+3UcxzzlfAnp7Z3fUBA988KQlkQuNXZO8
Ql+hn1Hc6LsJP7SKZBbOJeOWSVp0e9M/97dsp4HVC8DxUaazM9yqrld/DqIOJys4i5
hqq/t5peApKaw==
Date: Wed, 28 May 2025 11:38:08 -0700
From: Namhyung Kim <namhyung@xxxxxxxxxx>
To: Dmitry Vyukov <dvyukov@xxxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>,
Ian Rogers <irogers@xxxxxxxxxx>,
Kan Liang <kan.liang@xxxxxxxxxxxxxxx>, Jiri Olsa <jolsa@xxxxxxxxxx>,
Adrian Hunter <adrian.hunter@xxxxxxxxx>,
Peter Zijlstra <peterz@xxxxxxxxxxxxx>,
Ingo Molnar <mingo@xxxxxxxxxx>, LKML <linux-kernel@xxxxxxxxxxxxxxx>,
linux-perf-users@xxxxxxxxxxxxxxx, Andi Kleen <ak@xxxxxxxxxxxxxxx>
Subject: Re: [RFC/PATCH] perf report: Support latency profiling in
system-wide mode
Message-ID: <aDdYEH3lIYHAB-lk@xxxxxxxxxx>
References: <CACT4Y+aiU-dHVgTKEpyJtn=RUUyYJp8U5BjyWSOHm6b2ODp9cA@xxxxxxxxxxxxxx>
<aBvwFPRwA2LVQJkO@xxxxxxxxxx>
<CACT4Y+YacgzrUL1uTqxkPOjQm6ryn2R_nPs8dgnrP_iKA9yasQ@xxxxxxxxxxxxxx>
<aCdo6Vz2MVv3N0kk@xxxxxxxxxx>
<CACT4Y+YHxXjCU2jySTUO5kH=xC8scdzTTuP2qEBc5zMber44Aw@xxxxxxxxxxxxxx>
<aCveO4qQGy03ow5p@xxxxxxxxxx>
<CACT4Y+YdnQebkGTQJ9yhLs2j12WBYk2ReiBAq5cE+wtu1RRU5A@xxxxxxxxxxxxxx>
<aC0HH45JCBTchZMc@xxxxxxxxxx>
<CACT4Y+apAJ_m9W=P2hsGvWrGZnTzxB+9qgJg=ujjU8OWCVcUoQ@xxxxxxxxxxxxxx>
<CACT4Y+Z3Bbn3KcwhjOYAmzHWqRSZ4ywCrw8FNNxj5MrDUzFtVg@xxxxxxxxxxxxxx>
Precedence: bulk
X-Mailing-List: linux-kernel@xxxxxxxxxxxxxxx
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@xxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@xxxxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <CACT4Y+Z3Bbn3KcwhjOYAmzHWqRSZ4ywCrw8FNNxj5MrDUzFtVg@xxxxxxxxxxxxxx>
X-Spam-Status: No, score=-6.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,
RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,
RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham
autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lkml.rescloud.iu.edu
Hello,
On Tue, May 27, 2025 at 09:14:34AM +0200, Dmitry Vyukov wrote:
On Wed, 21 May 2025 at 09:30, Dmitry Vyukov <dvyukov@xxxxxxxxxx> wrote:
>
> On Wed, 21 May 2025 at 00:50, Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
> > > > > > Hello,
> > > > > >
> > > > > > Sorry for the delay.
> > > > > >
> > > > > > On Thu, May 08, 2025 at 02:24:08PM +0200, Dmitry Vyukov wrote:
> > > > > > > On Thu, 8 May 2025 at 01:43, Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
> > > > > > > >
> > > > > > > > On Tue, May 06, 2025 at 09:40:52AM +0200, Dmitry Vyukov wrote:
> > > > > > > > > On Tue, 6 May 2025 at 09:10, Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
> > > > > > > > > > > > > Where does the patch check that this mode is used only for system-wide profiles?
> > > > > > > > > > > > > Is it that PERF_SAMPLE_CPU present only for system-wide profiles?
> > > > > > > > > > > >
> > > > > > > > > > > > Basically yes, but you can use --sample-cpu to add it.
> > > > > > > > > > >
> > > > > > > > > > > Are you sure? --sample-cpu seems to work for non-system-wide profiles too.
> > > > > > > > > >
> > > > > > > > > > Yep, that's why I said "Basically". So it's not 100% guarantee.
> > > > > > > > > >
> > > > > > > > > > We may disable latency column by default in this case and show warning
> > > > > > > > > > if it's requested. Or we may add a new attribute to emit sched-switch
> > > > > > > > > > records only for idle tasks and enable the latency report only if the
> > > > > > > > > > data has sched-switch records.
> > > > > > > > > >
> > > > > > > > > > What do you think?
> > > > > > > > >
> > > > > > > > > Depends on what problem we are trying to solve:
> > > > > > > > >
> > > > > > > > > 1. Enabling latency profiling for system-wide mode.
> > > > > > > > >
> > > > > > > > > 2. Switch events bloating trace too much.
> > > > > > > > >
> > > > > > > > > 3. Lost switch events lead to imprecise accounting.
> > > > > > > > >
> > > > > > > > > The patch mentions all 3 :)
> > > > > > > > > But I think 2 and 3 are not really specific to system-wide mode.
> > > > > > > > > An active single process profile can emit more samples than a
> > > > > > > > > system-wide profile on a lightly loaded system.
> > > > > > > >
> > > > > > > > True. But we don't need to care about lightly loaded systems as they
> > > > > > > > won't cause problems.
> > > > > > > >
> > > > > > > >
> > > > > > > > > Similarly, if we rely on switch events for system-wide mode, then it's
> > > > > > > > > equally subject to the lost events problem.
> > > > > > > >
> > > > > > > > Right, but I'm afraid practically it'll increase the chance of lost
> > > > > > > > in system-wide mode. The default size of the sample for system-wide
> > > > > > > > is 56 byte and the size of the switch is 48 byte. And the default
> > > > > > > > sample frequency is 4000 Hz but it cannot control the rate of the
> > > > > > > > switch. I saw around 10000 Hz of switches per CPU on my work env.
> > > > > > > >
> > > > > > > > >
> > > > > > > > > For problem 1: we can just permit --latency for system wide mode and
> > > > > > > > > fully rely on switch events.
> > > > > > > > > It's not any worse than we do now (wrt both profile size and lost events).
> > > > > > > >
> > > > > > > > This can be an option and it'd work well on lightly loaded systems.
> > > > > > > > Maybe we can just try it first. But I think it's better to have an
> > > > > > > > option to make it work on heavily loaded systems.
> > > > > > > >
> > > > > > > > >
> > > > > > > > > For problem 2: yes, we could emit only switches to idle tasks. Or
> > > > > > > > > maybe just a fake CPU sample for an idle task? That's effectively what
> > > > > > > > > we want, then your current accounting code will work w/o any changes.
> > > > > > > > > This should help wrt trace size only for system-wide mode (provided
> > > > > > > > > that user already enables CPU accounting for other reasons, otherwise
> > > > > > > > > it's unclear what's better -- attaching CPU to each sample, or writing
> > > > > > > > > switch events).
> > > > > > > >
> > > > > > > > I'm not sure how we can add the fake samples. The switch events will be
> > > > > > > > from the kernel and we may add the condition in the attribute.
> > > > > > > >
> > > > > > > > And PERF_SAMPLE_CPU is on by default in system-wide mode.
> > > > > > > >
> > > > > > > > >
> > > > > > > > > For problem 3: switches to idle task won't really help. There can be
> > > > > > > > > lots of them, and missing any will lead to wrong accounting.
> > > > > > > >
> > > > > > > > I don't know how severe the situation will be. On heavily loaded
> > > > > > > > systems, the idle task won't run much and data size won't increase.
> > > > > > > > On lightly loaded systems, increased data will likely be handled well.
> > > > > > > >
> > > > > > > >
> > > > > > > > > A principled approach would be to attach a per-thread scheduler
> > > > > > > > > quantum sequence number to each CPU sample. The sequence number would
> > > > > > > > > be incremented on every context switch. Then any subset of CPU should
> > > > > > > > > be enough to understand when a task was scheduled in and out
> > > > > > > > > (scheduled in on the first CPU sample with sequence number N, and
> > > > > > > > > switched out on the last sample with sequence number N).
> > > > > > > >
> > > > > > > > I'm not sure how it can help. We don't need the switch info itself.
> > > > > > > > What's needed is when the CPU was idle, right?
> > > > > > >
> > > > > > > I mean the following.
> > > > > > > Each sample has a TID.
> > > > > > > We add a SEQ field, which is per-thread and is incremented after every
> > > > > > > rescheduling of the thread.
> > > > > > >
> > > > > > > When we see the last sample for (TID,SEQ), we pretend there is SCHED
> > > > > > > OUT event for this thread at this timestamp. When we see the first
> > > > > > > sample for (TID,SEQ+1), we pretend there is SCHED IN event for this
> > > > > > > thread at this timestamp.
> > > > > > >
> > > > > > > These SCHED IN/OUT events are not injected by the kernel. We just
> > > > > > > pretend they happen for accounting purposes. We may actually
> > > > > > > materialize them in the perf tool, or me may just update parallelism
> > > > > > > as if they happen.
> > > > > >
> > > > > > Thanks for the explanation. But I don't think it needs the SEQ and
> > > > > > SCHED IN/OUT generated from it to track lost records. Please see below.
> > > > > >
> > > > > > >
> > > > > > > With this scheme we can lose absolutely any subset of samples, and
> > > > > > > still get very precise accounting. When we lose samples, the profile
> > > > > > > of course becomes a bit less precise, but the effect is local and
> > > > > > > recoverable.
> > > > > > >
> > > > > > > If we lose the last/first event for (TID,SEQ), then we slightly
> > > > > > > shorten/postpone the thread accounting in the process parallelism
> > > > > > > level. If we lose a middle (TID,SEQ), then parallelism is not
> > > > > > > affected.
> > > > > >
> > > > > > I'm afraid it cannot check parallelism by just seeing the current thread.
> > > > > > I guess it would need information from other threads even if it has same
> > > > > > SEQ.
> > > > >
> > > > > Yes, we still count parallelism like you do in this patch, we just use
> > > > > the SEQ info instead of CPU numbers and explicit switch events.
> > > >
> > > > I mean after record lost, let's say
> > > >
> > > > t1: SAMPLE for TID 1234, seq 10 (parallelism = 4)
> > > > t2: LOST
> > > > t3: SAMPLE for TID 1234, seq 10 (parallelism = ?)
> > > >
> > > > I don't think we can continue to use parallelism of 4 after LOST even if
> > > > it has the same seq because it cannot know if other threads switched on
> > > > other CPUs. Then do we need really the seq?
> > >
> > > I do not understand the problem you describe.
> > > We just keep updating parallelism according to the algorithm I
> > > described. It works fine in the presence of lost events.
> >
> > Do you think it's ok to use 4 if seq is the same? I'm afraid it'd be
> > inaccurate.
>
> It will be inaccurate briefly for the period of 1 sample if we lost
> specifically the last/first sample of a thread scheduling quantum. And
> then it will recover and will be precise.
>
> But it's exactly the same in your scheme, right. If we stopped seeing
> events on a CPU due to lost events, we will assume it's not running.
>
> And generally lost events will always lead to imprecision. That's
> unavoidable. It's only important if the imprecision is limited and
> proportional to the number of lost events. And this is the case for
> the SEQ scheme.
>
>
> > > > > > Also postpone thread accounting can be complex. I think it should wait
> > > > > > for all other threads to get a sample. Maybe some threads exited and
> > > > > > lost too.
> > > > >
> > > > > Yes, in order to understand what's the last event for (TID,SEQ) we
> > > > > need to look ahead and find the event (TID,SEQ+1). The easiest way to
> > > > > do it would be to do 2 passes over the trace. That's the cost of
> > > > > saving trace space + being resilient to lost events.
> > > > >
> > > > > Do you see any other issues with this scheme besides requiring 2 passes?
> > > >
> > > > Well.. 2 pass itself can be a problem due to slowness it'd bring. Some
> > > > people complain about the speed of perf report as of now.
> > >
> > > Is trace processing CPU-bound or memory-bound? If it's CPU-bound, then
> > > the second pass may be OK-ish, since we will need minimal CPU
> > > processing during the first pass.
> >
> > It depends on the size of data, but I guess it's CPU-bound in most cases.
> >
> > >
> > >
> > > > I think we can simply reset the parallelism in all processes after LOST
> > > > and set current process to the idle task. It'll catch up as soon as it
> > > > sees samples from all CPUs.
> > >
> > > I guess we can approximate parallelism as you described here:
> > >
> > > > Hmm.. ok. Maybe we can save the timestamp of the last sample on each
> > > > CPU and clear the current thread after some period (2x of given freq?).
> > >
> > > We probably don't need to do anything special for lost events in this
> > > scheme at all. If the gap caused by lost events is tiny, then we
> > > consider nothing happened. If the gap is large enough, then we
> > > consider the CPU as idle for the duration of the gap. Either way it
> > > will be handled on common grounds.
> >
> > How do you know if it's tiny? Do you mean the seq remains after lost?
>
> I was talking about your scheme based on CPU numbers.
>
>
> > > But tuning of these heuristics + testing and verification may be a bit
> > > of a problem. I would hate to end up with a tool which I won't trust.
> > >
> > > Here:
> > > "after some period (2x of given freq?)"
> > > do you mean 2x average/median period, or 1/2 average/median period?
> > > (2x freq is 1/2 period)
> >
> > Oh, sorry. It's 2x period.
> >
> > >
> > > Ideally, we consider a CPU idle after 1/2 period after it switched to
> > > the idle task and we stop receiving samples.
> > > But on the other hand, we don't want to consider it constantly
> > > becoming idle, when it's just doing normal sampling with the normal
> > > period...
> > >
> > > So ideally the algorithm should be something like:
> > > let's say average/median sampling period is P
> > > we got last sample for CPU X at time T
> > > if by time T+2P we have not seen any other sample on CPU X, then
> > > consider CPU X idle since T+0.5P
> > >
> > > But this would also require either 2 passes over the data, or some
> > > kind of look ahead similar to the algo I proposed...
> >
> > I think we can do it in 1 pass. For each sample,
> >
> > for_each_cpu(cpu) {
> > if (current[cpu]->last_timestamp + 2*period < sample->timestamp) {
> > if (current[cpu]->thread != idle) {
> > current[cpu]->thread->parallelism--;
> > current[cpu]->thread = idle;
> > }
> > }
> > }
> >
> > leader = machine__findnew_thread(machine, sample->pid);
> > current[sample->cpu]->last_timestamp = sample->timestamp;
> >
> > if (current[sample->cpu]->thread != leader) {
> > if (current[sample->cpu]->thread != idle)
> > current[sample->cpu]->thread->parallelism--;
> >
> > current[sample->cpu]->thread = leader;
> > leader->parallelism++;
> > }
> >
> > sample->parallelism = leader->parallelism;
>
> As I described, for this simple 1 pass algorithm, I am afraid of imprecision.
> The thread has not continued to run for 2 periods. I run for 0-1 period.
>
>
>
> > > Also, do we take the median period? or average? do we update it over
> > > time (say, if CPU freq changes)? do we count it globally, or per CPU
> > > (in case CPUs run at different freqs)?
> >
> > Oh, perf tools use default frequency of 4000 Hz.
>
> Is the actual sample rate reasonably precise across time/CPUs?
>
> > Maybe we can use this
> > only for the frequency mode which means user didn't use -c option or
> > similar in the event description.
All-in-all I think the best option for now is using CPU IDs to track
parallelism as you suggested, but be more precise with idle detection.
2 passes over the trace may be fine to detect idle points. I see the
most time now spent in hist_entry__cmp, which accesses other entries
and is like a part of O(N*logN) processing, so a simple O(N) pass
shouldn't slow it down much.
That's what I would try. But I would also try to assess the precision
of this approach by comparing with results of using explicit switch
events.
It's not clear to me how you want to maintain the idle info in the 2
pass approach. Please feel free to propose something based on this
work.
Thanks,
Namhyung