Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp12423987rwl; Tue, 3 Jan 2023 14:18:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXunpvaiYTWWgl7orc2XgORJgf2CCEwzEkIn9hrV804nKCaqFGYNoojitlfl8EVw/msh0ZiC X-Received: by 2002:a05:6402:1819:b0:463:c960:7589 with SMTP id g25-20020a056402181900b00463c9607589mr37399184edy.40.1672784303266; Tue, 03 Jan 2023 14:18:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672784303; cv=none; d=google.com; s=arc-20160816; b=UedDzTt+vXFdvZ6h3Vnk4um4WBOrq6WDq1HsIP3wpGX/AToWtWHPmgABiLp8UqedSe 1mfyFFUW/1y79vxxeRsFKl2+gmEvtAxoV7hoomVjqzJ+ZPSJIqhYVP50VfhWI0s4gXRg KapXdNhR/pOXbMbbz0msWeeOAMeqRaAaAKTOiKxIPTlTo+fUL3fqYUHuibMD7ylNBtIb cYsw8YKNmHCKM1WMePzFgoUPcdvQef90dDPcBWDMGdP1i6aQhHm9n1KStrwpcIxcRxiT +4C/1R/l353lNm62DB6ZCVLpyG+0wC4AEuL7zKXLL8HszdzR/kKFcwh6/bB9mcq6lwgR 6kpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=B69Mxv4OYvnu+oYUZaX6wp8uon3z08Dc9pWJfcsHKpM=; b=n25ZpfVaKcDIZND7kXaMpZnJjtmX7/EWnGsu+qt/M+fLJiWR2zVtU+qDrAmeWxH3gi sEtMOGsoh1FPerOOJhjVuGIUuxFvDTT26KRA+YrGUsk8IW1mJmRSj7B3TGR0BmFodvIq MMGyv6YMfC1NzpUJOuw2QzCEC1HawpRUBfz5hGhM13l4tRBCmF692CGSHP3UniSW69dT doz6NwI68oXD9BRmtHAINLlKGsFJyEVhH8K2prx2lC8AnfzWJLEAJ6QtP1SYYrzEZfW0 mVvFG/3S7llbLxkUuFEh4LqCAq1SgRpY2vKamUba0cQTSFTSg2lLo3wGRwrpsvrzhzFI bqXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=DiFduzu2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ww5-20020a170907084500b0084cbf5552a1si8316693ejb.876.2023.01.03.14.18.09; Tue, 03 Jan 2023 14:18:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=DiFduzu2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233881AbjACU4q (ORCPT + 59 others); Tue, 3 Jan 2023 15:56:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234125AbjACU4n (ORCPT ); Tue, 3 Jan 2023 15:56:43 -0500 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B67219C for ; Tue, 3 Jan 2023 12:56:42 -0800 (PST) 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-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding: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=B69Mxv4OYvnu+oYUZaX6wp8uon3z08Dc9pWJfcsHKpM=; b=DiFduzu2Xtgm6JqneAWhTJF8qY OX4p3jCeeL1DPWHsA65o+cr5wMFRhr83wGAkyoxpUB8fnIQFFHGRrJRfHPBdww//2GHssyAt0wJ3c 77Fyh9xGCvUfCUU4GwnqQFTHa6wu719DhGBWGddqjQV0FVP2IHpukJ45zhR6voKOkKwyZx+/FBvK3 DAitqEjqMaXsCeWs62rUuxzRJDwZRLGZkEkJWMV0lX5dPzTF0kZtdqd6oSIyX7bLUzlJUAAQDAWFQ rZ43FKNBui//kig1zehADjB8jGKnoKV3g8yVm446BOzkl9cHMs0gjJF4X9SUbdlGhJeNrCdU4bQve 4wGmBaWw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:35954) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pCoKq-0005rk-Jo; Tue, 03 Jan 2023 20:56:36 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1pCoKm-0002PL-VL; Tue, 03 Jan 2023 20:56:32 +0000 Date: Tue, 3 Jan 2023 20:56:32 +0000 From: "Russell King (Oracle)" To: Hector Martin Cc: Srinivas Kandagatla , Bartosz Golaszewski , Gaosheng Cui , Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Maxime Ripard Subject: Re: [PATCH v3 0/5] Fix a whole host of nvmem registration/cleanup issues Message-ID: References: <5333ed0e-010c-178a-beb2-e8a4338f2d43@marcan.st> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5333ed0e-010c-178a-beb2-e8a4338f2d43@marcan.st> Sender: Russell King (Oracle) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Really not interested in your politics. Not interested in fixing this problem. I'll use these patches to fix the problem in my tree. I don't care about mainline. On Wed, Jan 04, 2023 at 03:12:44AM +0900, Hector Martin wrote: > On 04/01/2023 01.58, Russell King (Oracle) wrote: > > Hi, > > > > This series fixes a whole host of nvmem registration/error cleanup > > issues that have been identified by both Hector and myself. It is a > > substantial rework of my original patch fixing the first problem. > > > > The first most obvious problem is the race between nvmem registration > > and use, which leads to sporadic failures of drivers to probe at boot > > time. > > > > While fixing this, it has been noticed that a recent fix to check the > > return value of dev_set_name() introduced a new bug where wp_gpio was > > not being put in that newly introduced error path. > > > > Then there's a fix for a previous fix which itself purports to fix > > another bug, but results in the allocated ID being leaked. Fix for a > > fix for a fix is not good! > > > > Then there's an error in the docbook documentation for wp_gpio (it's > > listed as wp-gpio instead) but as nothing seems to set wp_gpio, we > > might as well get rid of it - which also solves the issue that we > > call gpiod_put() on this whether we own it or not. > > > > Lastly, there's a fix for yet another spurious white-space in this > > code, one of what seems to be a long history of past white-space > > fixes. > > > > These patches have been individually build-tested in the order of > > posting, but not run-time tested except for the entire series. > > > > drivers/nvmem/core.c | 51 ++++++++++++++++++------------------------ > > include/linux/nvmem-provider.h | 2 -- > > 2 files changed, 22 insertions(+), 31 deletions(-) > > > > Uhh. The series itself looks fine as far as fixing the problems, but I > fail to see how this is any better than my attempt as far as backporting > or commit atomicity goes. Patch #4 fixes the newer gpio leak bug *and* > half fixes the race condition bug, then patch #5 completes the race > condition fix but now depends on #4, meaning you're left with exactly > the same backporting mess since now you can't apply #5 to older kernels > and #4 only to newer ones. Splitting the commits like this buys you nothing. > > I thought we were doing minimal backportable fixes to solve this, but > your commit message for #4 literally says "While a minimal fix for this > would be to add the gpiod_put() call, we can do better if we split > device_register() [...]"... and then that whole "let's do better" part > is what breaks the backportability again. > > And then of course if you *do* manage to queue at least #4 to be > backported to a newer subset of stable trees, #3 certainly isn't going > to get backported itself (since it's just removing dead code, not > eligible for stable since it fixes no actual bugs), but then you're left > with the same > broken-on-paper-except-nobody-uses-it-anyway-so-it-doesn't-matter > situation my v2 left us in for those stable kernels. > > That said, thanks for identifying that nobody uses the functionality I > supposedly regressed (in a tiny corner case code path where it was > already broken anyway) in my v2, and therefore I didn't actually regress > anything in practice and strictly fixed real bugs. > > - Hector > -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!