Message ID | 20231020153017.759926-1-herve.codina@bootlin.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp1138312vqb; Fri, 20 Oct 2023 08:31:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGQbwfSVFSeM+n7/a4ac7Ns9bJYzt3mE5E/gXbHIrcYcKHgJaFVED0iR67rbu/ykrMqUIxR X-Received: by 2002:a05:6a00:1ad0:b0:692:af9c:d96f with SMTP id f16-20020a056a001ad000b00692af9cd96fmr2306237pfv.1.1697815891081; Fri, 20 Oct 2023 08:31:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697815891; cv=none; d=google.com; s=arc-20160816; b=AaY112H8xLs5ErhSXP7KlE2F2KcmZAmmsEkgv0uY3Vm5i/r83Oss2p0smoTsz5/TEs cTndejGyNV1m+Uh9z8Z7IbuT6Q5/O1kVG4QpArpAPPX53go2pNlx3nXDVsAxF9gByc4z 1IFYUAKjh9wjdQHvklQ/jkhvZDMw3c+hSgCic0omfz3AaRasfz9pn6+SuEVmPUmNyRnL YwMon4zZlrsugCby0uzj8OqEkIz/TOKQPdFX2q1zeuydDmMFZEkiWo+xiH8QVbL+csFB juhwDVxrgWnKjjPWS83TaLEKFnOLx6D/NbEsmxmXOa5W7P7YAXamwuciB/XpF6f33R1g JxdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=UnpnmeYe94FI9Jfaf1RckC7fZwJT75cGxhssDXRtfLA=; fh=i3WS+6AgTKP10/eUP7j46CA4B/XR5qlEIT9hV1ltHe4=; b=hmiEvujRsuBEt9ipta3IW2G3NGpPTXdO/wI7BZp5uf7Zt7dye1xGeTU1a4v6Zl0ob0 tli20J4es5g4DikgVzW553YV8ZQyr2Xl05S8ezt7U5GhIPenSHBTB8NnUinTcNgYdm83 IRMh6oCU+z7i0CrAChy6FEeeK0sT9IrMCTrA0RHkQLc5aUmMCdo69WikNYxIfAMnluCd IAs4ikgERA8EP6C1jGKVKH6IcMI7/sZDGsKcOC6ZK5I4XbvQc2vD7/NhJ+fWdQaMb15i +PuKhnIM/Dto5+fYGASf7YwYQqtTMsbK8DTuhQouB7fRbp47iLRrCMg/tvHeqidCXOyi RE2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="a6if/b3S"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id h17-20020a056a001a5100b006bde4f430afsi2220248pfv.70.2023.10.20.08.31.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 08:31:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="a6if/b3S"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 5129B80AC379; Fri, 20 Oct 2023 08:30:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377727AbjJTPaa (ORCPT <rfc822;a1648639935@gmail.com> + 26 others); Fri, 20 Oct 2023 11:30:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377601AbjJTPa0 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 20 Oct 2023 11:30:26 -0400 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::226]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8168D1A8; Fri, 20 Oct 2023 08:30:23 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPA id 98EF4C000A; Fri, 20 Oct 2023 15:30:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1697815821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UnpnmeYe94FI9Jfaf1RckC7fZwJT75cGxhssDXRtfLA=; b=a6if/b3SxaI+6gCiPw/KJlnsg/xbge9hbOApvWT9BcBUmIPuNcGXH4DVGZmJtFBBofYzD4 Sc8ahz78YsknF/xDUjPRcktF3h4jDhnneh86GA7DcoTHq44B7yu+92+EBMVFjKS+hQDPL2 a/gKqbAcwAojaTnznhpm2O6POVI2OoXow+3FFr65mMWTpKg4Y1f4zMeq64dT1RSKLp95u3 cDx0gUMG/qk5lY0IHks90EsEUYgu7rPdZfmMhQ2aAUFs8KYHVKLaxt83Qv9+q72CMexeIA QQf1HHc5tyaFfqDYQJ7AjooUAmOVAl4sKJprFDrgaxxIlBPjpCSvY15RXcjpGg== From: Herve Codina <herve.codina@bootlin.com> To: Wolfram Sang <wsa+renesas@sang-engineering.com>, Peter Rosin <peda@axentia.se>, Stephen Warren <swarren@nvidia.com>, Rob Herring <robh@kernel.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Jonathan Cameron <jic23@kernel.org> Cc: Wolfram Sang <wsa@kernel.org>, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Allan Nielsen <allan.nielsen@microchip.com>, Horatiu Vultur <horatiu.vultur@microchip.com>, Steen Hegelund <steen.hegelund@microchip.com>, Thomas Petazzoni <thomas.petazzoni@bootlin.com>, Herve Codina <herve.codina@bootlin.com> Subject: [PATCH v3 0/3] Fix i2c mux module refcount issues Date: Fri, 20 Oct 2023 17:30:10 +0200 Message-ID: <20231020153017.759926-1-herve.codina@bootlin.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, 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 morse.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 20 Oct 2023 08:30:55 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780288995880478571 X-GMAIL-MSGID: 1780288995880478571 |
Series | Fix i2c mux module refcount issues | |
Message
Herve Codina
Oct. 20, 2023, 3:30 p.m. UTC
Hi, Some i2c mux drivers wrongly use the pair of_find_i2c_adapter_by_node() / i2c_put_adapter() to lock the parent adapter. Indeed, i2c_put_adapter() decrements the module refcount while of_find_i2c_adapter_by_node() does not increment it. This leads to an overflow over zero of the parent adapter user counter. Identified mux drivers impacted are: - i2c-mux-gpmux - i2c-demux-pinctrl - i2c-mux-pinctrl Commit 48e9743dd648 ("i2c: core: add and export of_get_i2c_adapter_by_node() interface") introduces of_get_i2c_adapter_by_node() to correctly handle this refcount issue. This series fixes the 3 identified mux drivers replacing the of_find_i2c_adapter_by_node() call by an of_get_i2c_adapter_by_node() call. Compare to the previous iteration https://lore.kernel.org/linux-kernel/20231019101017.425284-1-herve.codina@bootlin.com/ This v3 series: - Fixes a wrong <tab> char in a commit log message - Add 'Cc: stable@vger.kernel.org' - Add Reviewed-by tags Best regards, Hervé Changes v2 -> v3 - Patch 2 Replace a wrong <tab> char by a <space> char in commit message - All patches Add 'Cc: stable@vger.kernel.org' Add 'Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>' Changes v1 -> v2: - All patches Fix commit log Add relevant Fixes tag Add 'Acked-by: Peter Rosin <peda@axentia.se>' Herve Codina (3): i2c: muxes: i2c-mux-pinctrl: Use of_get_i2c_adapter_by_node() i2c: muxes: i2c-demux-pinctrl: Use of_get_i2c_adapter_by_node() i2c: muxes: i2c-mux-gpmux: Use of_get_i2c_adapter_by_node() drivers/i2c/muxes/i2c-demux-pinctrl.c | 2 +- drivers/i2c/muxes/i2c-mux-gpmux.c | 2 +- drivers/i2c/muxes/i2c-mux-pinctrl.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)