Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7351373pxb; Thu, 18 Feb 2021 07:57:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJwwnpfery4tItYKjaBDfl1Hg/1iVuHaokwwfzDL3T0ERa1QLKWq1FiVw2NqV0HpAgkqWQn3 X-Received: by 2002:a17:906:25c4:: with SMTP id n4mr4644417ejb.359.1613663864393; Thu, 18 Feb 2021 07:57:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613663864; cv=none; d=google.com; s=arc-20160816; b=KBImdJm2iVCUf5D7PZ8rL1APERqeKsEyIkGKzIEJwJXiHDvIlMmMojvLqKqxslnmbd bYXVhO24Ss7hm6gKzDnyHjyC7J+8RLzHAaKVkpFhuoI9oDtM1ESpcCq1MZhShR6bk72k pvyOntVKU8c51AlgbjNfiYEODte/4rAH5Tn8na3PqhVAMYw/MuAG0YRv5mqYQYOGyEBk g4iLtNwGiprTkWMFcicCpty5CT/YSTjrernK2sXd1JO4cZpVBYEQGRAASF1XU2pcxtJk KPd+sO3YCTHMXuqtG1LQoBvmUK867W5IDchhOVjF5QxSMAp7yO8m5flqseLuzUw9mMQi E3zw== 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; bh=yTYRFMRRPjdl/9cpKf8Q3tMQjxHWSvWp1tMYZOva+Ts=; b=BSx0X0sNe6mwIphZ6zCqL06EwUyFKg4WAlFHZxFfY3PlK0WYVh3Hg4rui++NTlaNoT I1n/2Xbl4VvlU8pwMK24kOarcVoLq4bAQH5+Yopafyu4hYkmRV66mNe+LgPekV9SABIi hQsFrLG89aLgNKhE8yP+JqhZHBT9Njmr8O3G6vIgKlCzzesl+k7GlJOObdZIYudnrefh XCI1nHhCV0fs0jDASHBQEO8fN4mgmN04mcjpVY7Pd5Tf8U7O/ZgGsYA+pWKmCh0qWIH+ StsmgTZl6vl7pHibjwDBJ7GfTJNRxvoqoXiy4Tz96XRwW52jsvcWMGEpZaaWx5/92B4U P1uw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hb4si4081686ejb.642.2021.02.18.07.57.18; Thu, 18 Feb 2021 07:57:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232569AbhBRPyP (ORCPT + 99 others); Thu, 18 Feb 2021 10:54:15 -0500 Received: from muru.com ([72.249.23.125]:35026 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233526AbhBRNZi (ORCPT ); Thu, 18 Feb 2021 08:25:38 -0500 Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id BD83880AA; Thu, 18 Feb 2021 13:24:25 +0000 (UTC) From: Tony Lindgren To: linux-omap@vger.kernel.org Cc: Dave Gerlach , Faiz Abbas , Greg Kroah-Hartman , Grygorii Strashko , Keerthy , Nishanth Menon , Suman Anna , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] bus: ti-sysc: Fix warning on unbind if reset is not deasserted Date: Thu, 18 Feb 2021 15:23:57 +0200 Message-Id: <20210218132357.46074-1-tony@atomide.com> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We currently get thefollowing on driver unbind if a reset is configured and asserted: WARNING: CPU: 0 PID: 993 at drivers/reset/core.c:432 reset_control_assert ... (reset_control_assert) from [] (sysc_remove+0x190/0x1e4) (sysc_remove) from [] (platform_remove+0x24/0x3c) (platform_remove) from [] (__device_release_driver+0x154/0x214) (__device_release_driver) from [] (device_driver_detach+0x3c/0x8c) (device_driver_detach) from [] (unbind_store+0x60/0xd4) (unbind_store) from [] (kernfs_fop_write_iter+0x10c/0x1cc) Let's fix it by checking the reset status. Signed-off-by: Tony Lindgren --- drivers/bus/ti-sysc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -3053,7 +3053,9 @@ static int sysc_remove(struct platform_device *pdev) pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); - reset_control_assert(ddata->rsts); + + if (!reset_control_status(ddata->rsts)) + reset_control_assert(ddata->rsts); unprepare: sysc_unprepare(ddata); -- 2.30.1