Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3510346pxb; Mon, 4 Apr 2022 19:19:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw01c4LDravWWQc7On7jFMGIE2r4n8Vs8WgYJzVE3cQxKZem2QDemRtLCTcm1k1gfsBz6mz X-Received: by 2002:a17:902:e949:b0:14b:1f32:e926 with SMTP id b9-20020a170902e94900b0014b1f32e926mr1111248pll.170.1649125165182; Mon, 04 Apr 2022 19:19:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649125165; cv=none; d=google.com; s=arc-20160816; b=umVCo+vlKsg1C2IPp6LB3tyWOY/r0CMBwHBcXPeJpbUHkFkqdmVbITV0AdMDhV8gyu apKOBp03lxVhqq+9/Lmtmel/49FaHuFt3BLPuGD7A8EaexZg/fhdd5niMCGMmOTMLVg4 ozgI1VOd/C1SEqnBqSj0Mjey/7SYHdOfq0t1MKQPlquLTWisWPfwVwI8WuLLs7sxNXDZ Pw0mYSpuQYXs1cE/dQ2cNnt3gGMm3gei47QzdBQ/XBluFN/ZmVUiino73q/IC13XWXip oD4IeJZOKpGvUFWwje2UF5p5OzGd9e6coPOTwq3QUlIqzYKxurZjtzKVOVZS2/fCdsj2 bs5Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=D0V3FAXi2F7Z1cTpV83SVV34Sk2IcKqxpfkfJ+czeT4=; b=sGdM3GlHStexwpe8cNgex0/99LsM68bIjbzduDqCnxgl4A7BI4RprVh7habDTsX/nx rsLTyTZMbGhNw0+HiOR4S0LotwubTkobsLWOwUxJVTZAYhHwJc4YID52cPKAxAB46u/P lN/3Z0vLIoyvyxfcAOJoRf81s4jm9csI5w+ZFj0Ej+8PHJhnsiK3e70WyDrq6qi2L34s m1awU8halPSzoL75cZs8F1neTpz2yf73FZ2Err25Qun15UgyEQsnyBjEY/OIkZF6RWxq GZbIU/nCFQ1Q/DiitQB1f4ERuykBitp2nnp39yzA0yUYE6uBcz98d5ghNsdtjYPjjWNC 9OBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QZRSHu+g; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id r10-20020a63d90a000000b00399149a5d14si5557313pgg.205.2022.04.04.19.19.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 19:19:25 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QZRSHu+g; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 53C6329A579; Mon, 4 Apr 2022 17:41:13 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347982AbiDAOyq (ORCPT + 99 others); Fri, 1 Apr 2022 10:54:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348363AbiDAOeN (ORCPT ); Fri, 1 Apr 2022 10:34:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E512BC7; Fri, 1 Apr 2022 07:32:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2AF0761AFD; Fri, 1 Apr 2022 14:32:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87CB7C34111; Fri, 1 Apr 2022 14:32:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648823543; bh=BQ+000fsdHVkiRIowF2xgMLddbyFXjMD5fDA8h5TuYY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QZRSHu+gPK2a1twv+3sLHURoUB7liQOCEmYerFyuei/rXmhtB22TpMiC7sN1xztoP 86r1jK8phxCQZ9pZLp/dcrGYxssHa1or4RbmTMef76K8XEuL5xqWUQwCjpTAKQO+qm R+s9yOYOdqTOLdOYojVLpNo5A37z0qNJ1FcJYwWlfe2JTY4WNhMA/2r1zJykNvEtsr P4AKbE6ojWexCe5cY2zdJup0oGZvXZlkBbcKH4Tx5VvOnS5V+W6mfrEbCF3G2EUzUQ jV+o/cIQSktFoAUQYn3TIgcznhKkQTG/l2APezrV7Mo7GlaoqPR0Rqt6RVeohK9Q/D twy787NUi7Fxg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "H. Nikolaus Schaller" , Greg Kroah-Hartman , Sasha Levin , balbi@kernel.org, linux-usb@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH AUTOSEL 5.17 136/149] usb: dwc3: omap: fix "unbalanced disables for smps10_out1" on omap5evm Date: Fri, 1 Apr 2022 10:25:23 -0400 Message-Id: <20220401142536.1948161-136-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220401142536.1948161-1-sashal@kernel.org> References: <20220401142536.1948161-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: "H. Nikolaus Schaller" [ Upstream commit ac01df343e5a6c6bcead2ed421af1fde30f73e7e ] Usually, the vbus_regulator (smps10 on omap5evm) boots up disabled. Hence calling regulator_disable() indirectly through dwc3_omap_set_mailbox() during probe leads to: [ 10.332764] WARNING: CPU: 0 PID: 1628 at drivers/regulator/core.c:2853 _regulator_disable+0x40/0x164 [ 10.351919] unbalanced disables for smps10_out1 [ 10.361298] Modules linked in: dwc3_omap(+) clk_twl6040 at24 gpio_twl6040 palmas_gpadc palmas_pwrbutton industrialio snd_soc_omap_mcbsp(+) snd_soc_ti_sdma display_connector ti_tpd12s015 drm leds_gpio drm_panel_orientation_quirks ip_tables x_tables ipv6 autofs4 [ 10.387818] CPU: 0 PID: 1628 Comm: systemd-udevd Not tainted 5.17.0-rc1-letux-lpae+ #8139 [ 10.405129] Hardware name: Generic OMAP5 (Flattened Device Tree) [ 10.411455] unwind_backtrace from show_stack+0x10/0x14 [ 10.416970] show_stack from dump_stack_lvl+0x40/0x4c [ 10.422313] dump_stack_lvl from __warn+0xb8/0x170 [ 10.427377] __warn from warn_slowpath_fmt+0x70/0x9c [ 10.432595] warn_slowpath_fmt from _regulator_disable+0x40/0x164 [ 10.439037] _regulator_disable from regulator_disable+0x30/0x64 [ 10.445382] regulator_disable from dwc3_omap_set_mailbox+0x8c/0xf0 [dwc3_omap] [ 10.453116] dwc3_omap_set_mailbox [dwc3_omap] from dwc3_omap_probe+0x2b8/0x394 [dwc3_omap] [ 10.467021] dwc3_omap_probe [dwc3_omap] from platform_probe+0x58/0xa8 [ 10.481762] platform_probe from really_probe+0x168/0x2fc [ 10.481782] really_probe from __driver_probe_device+0xc4/0xd8 [ 10.481782] __driver_probe_device from driver_probe_device+0x24/0xa4 [ 10.503762] driver_probe_device from __driver_attach+0xc4/0xd8 [ 10.510018] __driver_attach from bus_for_each_dev+0x64/0xa0 [ 10.516001] bus_for_each_dev from bus_add_driver+0x148/0x1a4 [ 10.524880] bus_add_driver from driver_register+0xb4/0xf8 [ 10.530678] driver_register from do_one_initcall+0x90/0x1c4 [ 10.536661] do_one_initcall from do_init_module+0x4c/0x200 [ 10.536683] do_init_module from load_module+0x13dc/0x1910 [ 10.551159] load_module from sys_finit_module+0xc8/0xd8 [ 10.561319] sys_finit_module from __sys_trace_return+0x0/0x18 [ 10.561336] Exception stack(0xc344bfa8 to 0xc344bff0) [ 10.561341] bfa0: b6fb5778 b6fab8d8 00000007 b6ecfbb8 00000000 b6ed0398 [ 10.561341] bfc0: b6fb5778 b6fab8d8 855c0500 0000017b 00020000 b6f9a3cc 00000000 b6fb5778 [ 10.595500] bfe0: bede18f8 bede18e8 b6ec9aeb b6dda1c2 [ 10.601345] ---[ end trace 0000000000000000 ]--- Fix this unnecessary warning by checking if the regulator is enabled. Signed-off-by: H. Nikolaus Schaller Link: https://lore.kernel.org/r/af3b750dc2265d875deaabcf5f80098c9645da45.1646744616.git.hns@goldelico.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/dwc3/dwc3-omap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c index e196673f5c64..efaf0db595f4 100644 --- a/drivers/usb/dwc3/dwc3-omap.c +++ b/drivers/usb/dwc3/dwc3-omap.c @@ -242,7 +242,7 @@ static void dwc3_omap_set_mailbox(struct dwc3_omap *omap, break; case OMAP_DWC3_ID_FLOAT: - if (omap->vbus_reg) + if (omap->vbus_reg && regulator_is_enabled(omap->vbus_reg)) regulator_disable(omap->vbus_reg); val = dwc3_omap_read_utmi_ctrl(omap); val |= USBOTGSS_UTMI_OTG_CTRL_IDDIG; -- 2.34.1