Received: by 2002:a05:7412:9c07:b0:fa:6e18:a558 with SMTP id lr7csp780290rdb; Sun, 28 Jan 2024 08:36:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IFc8/CkE/m600ZZM2nNRaKEDG61obz4poacH0Guu9VzNMAqrj3c/SN8J2xVwY5sthPIF36g X-Received: by 2002:a05:6a20:c411:b0:19c:7690:12ec with SMTP id en17-20020a056a20c41100b0019c769012ecmr1380324pzb.5.1706459802682; Sun, 28 Jan 2024 08:36:42 -0800 (PST) Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id y6-20020a633206000000b005cf5895bfa6si4456330pgy.814.2024.01.28.08.36.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 08:36:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41769-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=k20201202 header.b=iVZyrJF4; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-41769-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41769-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id A95FAB220C8 for ; Sun, 28 Jan 2024 16:35:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D3DB87A707; Sun, 28 Jan 2024 16:14:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iVZyrJF4" 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 0262876905; Sun, 28 Jan 2024 16:14:49 +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=1706458489; cv=none; b=RFqCqOtm6rZl+p0VwXaJ76r+B7KtFx8Dfg4aagBnog+Ekw6qQKdwWJolR1inTsmUlbCtb4+xNqaEXbvuSALGDnHaj8r/m8EHC22ihCDe9L3zit/n/ArUyIGZ67NAgNr/zv3sBkjDKSgbJYAhs96DxxF1bSLO4Obq6Q6P+jidy2E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706458489; c=relaxed/simple; bh=9i+0tRrR8f46mV2RIqb8UCpriaU90/nhEmq3OzI7EcU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MSRyjZRIuQdV1lN8l2aBVV+EAgIHNP3Q83xeNePdgaKBD4LfPPrNxQD+hRfVU7OArgwPNkg5wJPW0/NFqbrPFufn0nAmOUDdGI4zIP6bGmO6xUUp8MOBr3rQOU2nhe6KbuzCF0/xmBZG5FcI08Vhzs5cQD/CZ9JikVDbEji/U9k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iVZyrJF4; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2045EC433A6; Sun, 28 Jan 2024 16:14:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706458488; bh=9i+0tRrR8f46mV2RIqb8UCpriaU90/nhEmq3OzI7EcU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iVZyrJF4KmPPJjHo8DhifkyWcqiFte55nPn6B3cEPUgwdw+d5v2JrQ+L0ZWuEiOp5 BOul7v4I92vPYPSsX/2skkdtYU++09/dDAzQN0Uu78mYqoSHXTuDcxLBbF+Pt7tbj7 pxYFgGrsSu5qf8VMGLP8zY+c6j6KtAPB17Gpau/P9As8ZaQ/kVTvGPgC7KBp6HpicZ KsPSGmxmRqStPg7J7cPjdr4rFYuz7B7l0tqQCg6My2v3L1pyA2IsNTfHwpY1X1lbQs 0JzwhftWFyi5ROrYzjCn6BIZfbqK3o/yzMQwIsiPxYrDJPe4RmABlL5wyyb9DJmdRF 5N32KJzEsIAAQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Hans de Goede , Greg Kroah-Hartman , Sasha Levin , eric.piel@tremplin-utc.net Subject: [PATCH AUTOSEL 6.1 14/27] misc: lis3lv02d_i2c: Add missing setting of the reg_ctrl callback Date: Sun, 28 Jan 2024 11:13:59 -0500 Message-ID: <20240128161424.203600-14-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240128161424.203600-1-sashal@kernel.org> References: <20240128161424.203600-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.1.75 Content-Transfer-Encoding: 8bit From: Hans de Goede [ Upstream commit b1b9f7a494400c0c39f8cd83de3aaa6111c55087 ] The lis3lv02d_i2c driver was missing a line to set the lis3_dev's reg_ctrl callback. lis3_reg_ctrl(on) is called from the init callback, but due to the missing reg_ctrl callback the regulators where never turned off again leading to the following oops/backtrace when detaching the driver: [ 82.313527] ------------[ cut here ]------------ [ 82.313546] WARNING: CPU: 1 PID: 1724 at drivers/regulator/core.c:2396 _regulator_put+0x219/0x230 .. [ 82.313695] RIP: 0010:_regulator_put+0x219/0x230 .. [ 82.314767] Call Trace: [ 82.314770] [ 82.314772] ? _regulator_put+0x219/0x230 [ 82.314777] ? __warn+0x81/0x170 [ 82.314784] ? _regulator_put+0x219/0x230 [ 82.314791] ? report_bug+0x18d/0x1c0 [ 82.314801] ? handle_bug+0x3c/0x80 [ 82.314806] ? exc_invalid_op+0x13/0x60 [ 82.314812] ? asm_exc_invalid_op+0x16/0x20 [ 82.314845] ? _regulator_put+0x219/0x230 [ 82.314857] regulator_bulk_free+0x39/0x60 [ 82.314865] i2c_device_remove+0x22/0xb0 Add the missing setting of the callback so that the regulators properly get turned off again when not used. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231224183402.95640-1-hdegoede@redhat.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/misc/lis3lv02d/lis3lv02d_i2c.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c index d7daa01fe7ca..fdec2c30eb16 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c +++ b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c @@ -151,6 +151,7 @@ static int lis3lv02d_i2c_probe(struct i2c_client *client, lis3_dev.init = lis3_i2c_init; lis3_dev.read = lis3_i2c_read; lis3_dev.write = lis3_i2c_write; + lis3_dev.reg_ctrl = lis3_reg_ctrl; lis3_dev.irq = client->irq; lis3_dev.ac = lis3lv02d_axis_map; lis3_dev.pm_dev = &client->dev; -- 2.43.0