From patchwork Tue Jan 3 16:58:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13087830 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 15057C3DA7D for ; Tue, 3 Jan 2023 18:23:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=IUV+3WYwr34KdNk8PSkjZXYG0OBtbMB62MIU5pzaaVY=; b=OfXGyrVqu/XZEK XQzE+Xs5U0TXW7M4tjS9UYqgByMOwT6x3wC+u8Yztrvhy/EBh9jElaXn9FmBi5LizN4QiG2FGYSYV A3OSTzqlE60JC6cj9iYrblBwImfreChDH4RjUBvnoaS9Iy/+/XPyTHgAv11OIupKJypjFhii53d7B aV9Gd8UTjlFqovSyOOipHCoayvnPzzDPCBKNGNrmuWUsUNrXjmHSw3ehkGTNIrnzZTQx6HyPzfh2j X3Ff2RCOKNP28OagdNSyf94+qbQj+rMsthYgACeA9JTsApjbBmAeUqoj+5iKKjEDEA9QSc0r3Nto0 PO19VY9bD9J3oFWUjURg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pCluh-003pRH-9U; Tue, 03 Jan 2023 18:21:28 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pCkcz-003Aih-Vr for linux-arm-kernel@lists.infradead.org; Tue, 03 Jan 2023 16:59:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:Content-Type:MIME-Version: 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:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=mxDcbg9196yYDc4/nWFTQPBwp/sgfGLK/oSLrLpBDOI=; b=IGa6eXA7tCe5Q+39nOMcg2hp9j 4h0v2Z7M8Mpuh9jI+Ejhhzs5tTmuKOzwNU1pgJeCWtPpKJUC11fh5Jn/5YjdIqlF1X4dAsmABcdBY MpQKu7kITSU1HkF5iWgjJ0zJXfNMOWQnbXAljM+4YTtBsj+6cfvRofi7JwpK7JVufP2IXy54ZFps2 oCq7DKnsX0WInHFkNpp44YFq66VL+O8EvUcHb3wHLDuIKE5NCKyhaJKQ5XV1rmhpkQwjtSbj5WTT1 0SxDD+BuMHZHgDiE/r35nHQzsT95s346bZGQ+zCfkE3twtviIVlsXz0axlp2v4CId1TuMYNeyqdUt 3EkVJl7w==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:35948) 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 1pCkcr-0005bj-B9; Tue, 03 Jan 2023 16:58:56 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1pCkcn-0002GF-DC; Tue, 03 Jan 2023 16:58:53 +0000 Date: Tue, 3 Jan 2023 16:58:53 +0000 From: "Russell King (Oracle)" To: Srinivas Kandagatla Cc: Bartosz Golaszewski , Gaosheng Cui , Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Maxime Ripard , Hector Martin Subject: [PATCH v3 0/5] Fix a whole host of nvmem registration/cleanup issues Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230103_085906_093011_F55350A9 X-CRM114-Status: GOOD ( 16.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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(-)