Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp1984341rdb; Sun, 24 Dec 2023 10:37:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IHlzLdNH+kg98weKWbDde/HN5IQ4XnmrQjM4Bpd3AdnByY3Y73CP/idxMfdu8X5C3Z3Crvb X-Received: by 2002:a17:90a:b108:b0:28b:de86:15ef with SMTP id z8-20020a17090ab10800b0028bde8615efmr1580920pjq.91.1703443032726; Sun, 24 Dec 2023 10:37:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703443032; cv=none; d=google.com; s=arc-20160816; b=fYRZS/n1HMrdug1N7SHJ5D8duRvyIhBWcHDrG/lRPGzaTTiy80hloJt7fy64k25d7K bRh3TZN4fdWFAsdWpYR8XEArMWTsUWs7+QMwepOl1bB25pOFNa/vraJwO7k/iUYD+FvK iyTw6yBXG5VoSgym2Oyi6KAz38L6fMZYw0DLahFE7AGxDJfvvvONWepFonwCNVt10691 6CqRU/3TRyv2WXPWlvYwHcSUVBuUo923WEFfGcKHVsmXeesvQHBGnzjGa8Aw74ZLpe4L gOVfXswn88/CD4JtRSRCV7WuqWHngUBz4uCEFzwLObsMS0nxiKG8g1CzK227xX8EhBcQ 4h/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=zvZOHxWVh/mJiCQHlq/7UwzyMBE7eRNX3nk6Uoehacw=; fh=mAP6OjvWItsuYmlxI3oGuIcHHyhFdjhD5nj/wT7LofM=; b=aJRuszZuOEjavdyL2bnje2xWWFJytbmpTVYJdw1sNgoPn9yknyzL70nwR785XZIowE TBAfcGuNVwuCLza0wR7+S4GJc4TdcYtvSB6lWo2Kdy8ZDPEysoe4BL1bkQzV7E+jNcja bkpNePmKJEpD+tnj+4SnMmXG0Cagr25Wo7Cib3bd/Fap4C/GEZcA4A1WtIIolKM3gD8Y ZVjik438DQyVlxAvE9wnUJBuOYl7bd3Ba81tHHCCy07+3ia3/87rH96Fwi0ogJCQqHPF DDpKGTnFiAphsMJsQO7tY3KAEOUWIdG5hCdyX8Uq7HTgaAMILKThPsgUO2re9l5dPFkE cQFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GA7iF933; spf=pass (google.com: domain of linux-kernel+bounces-10799-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10799-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id fy5-20020a17090b020500b0028bef40be44si6299948pjb.41.2023.12.24.10.37.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Dec 2023 10:37:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10799-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=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GA7iF933; spf=pass (google.com: domain of linux-kernel+bounces-10799-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10799-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 A34C9B20B47 for ; Sun, 24 Dec 2023 18:37:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 20BD918C38; Sun, 24 Dec 2023 18:34:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="GA7iF933" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 6E30418C17 for ; Sun, 24 Dec 2023 18:34:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1703442856; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=zvZOHxWVh/mJiCQHlq/7UwzyMBE7eRNX3nk6Uoehacw=; b=GA7iF9339OKz6TJhZuD623+BSyK2mXpcLq4aGEl7Oal1uS2Nutq2OJ+15N/PiWd9PQlhoJ 10AeeUrXpALIqcco5x9nI5HA3sI0gH+S77Z7XpYN5faYsX3zDGQ0FpQ2qdwlynyglAAt5x EAOHjL/8Hb3Ni8GpZur4+6ZjWQ1s76c= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-661-PpWDDgHrPOimc3FcWeExTg-1; Sun, 24 Dec 2023 13:34:11 -0500 X-MC-Unique: PpWDDgHrPOimc3FcWeExTg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D592738562C1; Sun, 24 Dec 2023 18:34:10 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id EE44A51D5; Sun, 24 Dec 2023 18:34:09 +0000 (UTC) From: Hans de Goede To: Eric Piel , Greg Kroah-Hartman Cc: Hans de Goede , Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH] misc: lis3lv02d_i2c: Add missing setting of the reg_ctrl callback Date: Sun, 24 Dec 2023 19:34:02 +0100 Message-ID: <20231224183402.95640-1-hdegoede@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 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 --- Note I've deliberately left out Fixes && Cc:stable tags, this driver has not been touched in ages so apparently this bug has been with us for ages and has never really been a problem. So lets play it safe and not backport this. --- 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 3882e97e96a7..c6eb27d46cb0 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c +++ b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c @@ -150,6 +150,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