From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F20CF606A32A for ; Sun, 22 Nov 2026 15:54:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=SC1f106v; dkim=pass (2048-bit key) header.d=resnulli.us header.i=@resnulli.us header.a=rsa-sha256 header.s=google header.b=gpNV+EvH Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id C339080D30; Sun, 22 Nov 2026 15:54:17 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 1USmiaSmK2SD; Sun, 22 Nov 2026 15:54:17 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp1.osuosl.org F2A4B80D1E Authentication-Results: smtp1.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 ARC-Seal: i=1; d=osuosl.org; s=arc; a=rsa-sha256; cv=none; t=1795362857; b=NGg+E2L5yhxJbgSVfRg+O4Sl4YvnxMqGihdjd1eLqL0bnqt1ZAnkAw951CUvuVyrY7a8 DZK9M/gZVrsNsl9YaohL5T3mX+Op6ZNII1gjhz0Kj5wMzYGURM/5h0JcAHoaqudh3wHsn yJ3dtFwsxHJFR1UwZdfeQ3FVKlqJET9zAZDCjhVcHs81WjHImh9O2R8eOqnHnl+tU4vO9 fo+vlUmt36PKDNdIhKiTZt/z3MNVP70dhz26YP3NcfuQtf9CUFgAlTu+XN0t7tQjSTRTw jPHXhpdJ8tvdA016vG9ay3mkVFeX6i4+Yl9i6BCUQ/9w2uJT57IcmF0fNPkl6M6UoMA== ARC-Message-Signature: i=1; d=osuosl.org; s=arc; a=rsa-sha256; c=relaxed/relaxed; t=1795362857; h=X-Comment:DKIM-Signature:X-Original-To:Delivered-To:Received: Received:X-Virus-Scanned:X-Spam-Flag:X-Spam-Score:X-Spam-Level: X-Spam-Status:Received:ARC-Filter:Received-SPF:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:Content-Transfer-Encoding:In-Reply-To:X-BeenThere: X-Mailman-Version:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Errors-To; bh=oAH/5Ektz81ojOZdHN4K4NLybO43vkB7oJL3F3Dgs+c=; b=ZsbLjZ+u5EA6jr01m+VSMTwxkk7OU5OyXEH8+tlaiy0guVFI99zNHgBxfbfkOMM6lVOL fioldGYV3Bo/qgHFIZeQlqZK9uO3cE4RvXKEFCvb5S6gi/SipKaRWvMyME2dADvcCBarl djp+HPfVUEqqHzFas2kBiR/W4/cUkGxK8UhpVxQKc/HxZHnhqV7nLUZi+uWwJQfWwO361 UOkKMjfgPZF1+fBUotTnUbE+IqGpUSOsrVvnJiPkH3Pk4ykii5cm6Mixn2dPAAGjoGoxt gNSaV+p4o7yBQGrvU9m8xfkLySQz9yCkFUDzTSgj/y1nE+GkMw825jUBck9f5G7eUAg== ARC-Authentication-Results: i=1; smtp1.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1795362857; bh=oAH/5Ektz81ojOZdHN4K4NLybO43vkB7oJL3F3Dgs+c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=SC1f106vfR6XaubxGhRMxSnVPQpGqtmB50iioHP6dW3lF6Mmf3unJVI+9Dvb9w/G/ fI0imwNMOeSJiWvEaYgOmDg/DUrr13lXQSH8XCSo4MnnCLv38k/slsYZJQwdHTqqmS +deaP916dHWUkeuGjGmuw8f07QXl26SpNANfxgahi659f059kcYvejbtsZ+ixi7IO5 AysI77RTmQ2B697TDCBTd8tMCNdhueKCvNgoA/rpYcQXSxzOOVFdCDX0HOUiIhghnH zVBCb+yXdv+EQ1gE5gs1ek9MP02Xyyb7L9POQ7AyC+P21GD2X3B/HAhaRd5MmtcNKm SYCpfbf9pVnrg== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp1.osuosl.org (Postfix) with ESMTP id F2A4B80D1E; Sun, 22 Nov 2026 15:54:16 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists1.osuosl.org (Postfix) with ESMTP id 13B5C465 for ; Sun, 22 Nov 2026 15:54:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id EE504400BC for ; Sun, 22 Nov 2026 15:54:15 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id rqVriWM0oYer for ; Sun, 22 Nov 2026 15:54:15 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp2.osuosl.org A52F4400B3 Authentication-Results: smtp2.osuosl.org; arc=none smtp.remote-ip="2a00:1450:4864:20::433" Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::433; helo=mail-wr1-x433.google.com; envelope-from=jiri@resnulli.us; receiver= Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=none dis=none) header.from=resnulli.us Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=resnulli.us header.i=@resnulli.us header.a=rsa-sha256 header.s=google header.b=gpNV+EvH Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by smtp2.osuosl.org (Postfix) with ESMTPS id A52F4400B3 for ; Sun, 22 Nov 2026 15:54:12 +0000 (UTC) Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-48e3b22e971so1268803f8f.0 for ; Sun, 22 Nov 2026 07:54:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli.us; s=google; t=1795362850; x=1795967650; darn=lists.osuosl.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=oAH/5Ektz81ojOZdHN4K4NLybO43vkB7oJL3F3Dgs+c=; b=gpNV+EvHbir8MGc9ZwlCyu3j7jHueGJ941nFmHO+mGEKTorFD2L2iCvUy/BPKYEWJH hgUqcd50ZeH7vsv3AtwqYGmSAkYfZNY/8TqAPrHFcRxIueQQ0Dhd3fPPrUFqH5mtr+Hg cfCZ4lBVZ4BgOeh3KZKeYZF+8k0wIdm7SdB6qYfcjP4wVgLADSdgnjOO7UIiOEMYVSUh KQDJMeBhBqBCJhiWGNZh2EEABJPT9t7jeOgcPdyaMMNp5cGIHcUOkBrKKBs27CTRfQu0 zfY2IkbjpWz7EIXhPzeRlV2lJBsP4i9gf+k4luEw06Dsy23Cw5GI/VWAME8iNY7v2Ix6 AqqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795362850; x=1795967650; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=oAH/5Ektz81ojOZdHN4K4NLybO43vkB7oJL3F3Dgs+c=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QLUnBtvwwl31TQI6qOAN08vzd2VP/sMzCSp1s0hw0T4twbpX1GYgeIhct168W st8jEPi1uNSLu8QXiHbrN+VMyT1sjFQyzMhI2gncdXDfGg39CMExtQ6csB/ZanN2JeDIHqQzhQg lI6uvL8cfaIrlqWSX63GT1LN8sIJ5nwF5TI0OQ== X-Received: by 2002:a5d:64c9:0:b0:4a7:69c3:94d5 with SMTP id ffacd0b85a97d-4abb0e469cfmr16973589f8f.28.1795362850015; Sun, 22 Nov 2026 07:54:10 -0800 (PST) Received: from localhost ([128.77.52.126]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab69bf61e8sm18394509f8f.11.2026.11.22.07.54.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Nov 2026 07:54:09 -0800 (PST) Date: Sun, 22 Nov 2026 16:54:05 +0100 From: Jiri Pirko To: Vadim Fedorenko Cc: Ivan Vecera , Jakub Kicinski , Arkadiusz Kubalewski , netdev@vger.kernel.org, Jonathan Corbet , Shuah Khan , Randy Dunlap , Min Li , Tony Nguyen , Przemek Kitszel , Andrew Lunn , "David S. Miller" , Eric Dumazet , Paolo Abeni , Richard Cochran , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org, Grzegorz Nitka , Karol Kolacinski , Saeed Mahameed , Tariq Toukan , Petr Oros Subject: Re: [PATCH net-next v2 0/9] dpll: do not serialize driver callbacks under global dpll_lock Message-ID: References: <20261111164021.273409-1-ivecera@redhat.com> <20261116181612.107a4b57@kernel.org> <20261118174424.32e9f130@kernel.org> <20261119133851.3f25074c@kernel.org> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-5.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Fri, Nov 20, 2026 at 09:00:27PM +0100, vadim.fedorenko@linux.dev wrote: >On 20/11/2026 07:39, Ivan Vecera wrote: >> On 11/19/26 22:38, Jakub Kicinski wrote: >> > Well, I'm not convinced. The relations between objects in DPLL are >> > already quite hard to follow, and objects from one driver routinely >> > "plug" into objects from another. The explanation of the locking >> > rules in patch 9 does not look clean or clear. The driver facing >> > API needs to be much more "dummy-proof". >> >> Fair enough. The complicated part of the rules comes exactly from >> that: a pin registered by another driver, like the zl3073x pins that >> ice registers with its TXC DPLL or uses as parents of its RCLK pins. >> A message about such a pin runs callbacks of both drivers. I have >> prototypes of the first four ways below to lock this, each with KUnit >> tests, and would like your opinion before going further. >> >> In all of them a domain is the set of objects created with the same >> module and clock_id, dpll_lock becomes an rwsem for the topology and >> lifetime, and a mutex per domain serializes the callbacks. >> >> A) Pin's domain (this series) >> >>    Callbacks of a pin run under the domain of the pin, whichever >>    driver registered them. >> >>    Pros: >>    * one domain lock at a time, so no lock order >>    * a request or a message about a pin is atomic >>    Cons: >>    * the callbacks of a foreign pin are serialized with the driver >>      that created the pin, not with the other callbacks of the driver >>      that registered it, so that driver has to protect the shared >>      state itself, and lockdep cannot check it >>    * restrictions for measured_freq_get, reference sync pairs and the >>      private data of a parent pin, which patch 9 has to explain >> >> B) Registrant's domain, deferred notifications >> >>    Each callback runs under the domain of the driver that registered >>    it. A message about a pin takes the domain locks one after another, >>    and notifications from callbacks are queued and sent once the >>    domain lock is dropped. >> >>    Pros: >>    * callbacks registered by one driver instance are always >>      serialized with each other >>    * one domain lock at a time, so no lock order >>    Cons: >>    * a request or a message about a pin registered across domains is >>      not atomic >>    * the most complex core: a notification queue per domain, a lock >>      per object to keep its messages in order, and pin setters split >>      into validation and apply parts >> >> C) Registrant's domain nested under the pin's domain >> >>    Pros: >>    * callbacks registered by one driver instance are serialized with >>      each other and with the driver that created the pin >>    * a request or a message about a pin is atomic >>    Cons: >>    * the lock order comes from the topology, so a pin of A registered >>      with a DPLL of B together with a pin of B registered with a DPLL >>      of A deadlocks, and lockdep sees it only with a lockdep class per >>      domain >>    * a stuck foreign registrant stops the domain of the pin >> >> D) Merged domains (your suggestion) >> >>    Registering a pin with a DPLL or a parent pin of another domain >>    merges both domains. They are not split again. >> >>    Pros: >>    * the rules for drivers stay as they are with the global lock >>      today, and lockdep checks them; the only new one is that state >>      shared between chips not connected by a pin needs a driver lock >>    * a request or a message is atomic >>    Cons: >>    * only hardware not connected by pins runs in parallel; on the >>      GNR-D system the zl3073x and all ice PFs end up in one domain >>    * a callback that waits for the hardware, like the planned resync >>      for up to 1 s, or for firmware still stalls all DPLL devices in >>      the merged domain >> >> E) Global dpll_lock, slow callbacks asynchronous >> >>    Pros: >>    * no change in the core >>    Cons: >>    * the resync problems from my previous mail, and a callback that >>      waits for firmware still stalls all DPLL devices in the system >> >> I wrote before that stretching the domains would not improve >> anything on that system. That holds for the ToD stall I measured, >> but the zl3073x does not need to hold its channel lock across the >> edge waits. Without that, the remaining waits are the planned resync >> and output state callbacks, and with D they stall only the devices >> wired to that chip, which depend on it anyway. >> >> So I lean towards D, as it gives drivers nothing new to get right. >> Would that address your concern, or do you see a better way? >> >> It would be good to hear from the other DPLL maintainers as well. >> Jiri, Vadim, Arkadiusz, what do you think? > >I totally agree with Jakub. Current implementation of DPLL subsystem is >over complicated, and all these complications came just to completely >model what was designed for Intel NICs, basically ice driver. But now we >are again back to the discussion how to complicate things further just >to fit what was implemented in the new generation of the same hardware. > >Maybe it's time to step back and think if we really need all this, or >find simpler way to express/model things? Agreed.