From patchwork Mon Jul 13 16:05:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Robertson X-Patchwork-Id: 11660167 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BE876618 for ; Mon, 13 Jul 2020 16:07:53 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 98238206F0 for ; Mon, 13 Jul 2020 16:07:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="eDIrSZ0S" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 98238206F0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=dlrobertson.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Date:Subject:Message-ID:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=M20+7dItxvyfiAhGW3JRnthq4Y3zINhKXiy7soH8SnU=; b=eDIrSZ0SkcXAYb6ouyQdH4Wf3M BrvATNG9kKrIBysFkU33ps3GBe2S+kBKRM+EK1To1hQi443xkdRz5hER0r5LeO/x7HQ2PXRKzCY7b d3HWQtawUWj+yQsdxkfle/hQkfeIx085eP/1CSGO6sVvDAKu1DlfxyQVwsA6zNgc6R5HzRU5FQWc8 uQWtioBcBm3EG64/niyHBxOF0yQ3HeyfviH+XNPlDWsSxVvdX/N/WyXNMFGO4Ur0lQHOluH469biA LV6qY1WJnbcB/o1sugHOxVNjcLINBDVLSDtWLs9Px+4+WbFR+45A6ivxzwI5VT5znxgt1jR0N6/bz ab1Hrh5w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jv0yD-0004ug-K7; Mon, 13 Jul 2020 16:06:21 +0000 Received: from sender4-op-o17.zoho.com ([136.143.188.17]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jv0y9-0004tS-Gv; Mon, 13 Jul 2020 16:06:18 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1594656370; cv=none; d=zohomail.com; s=zohoarc; b=Ha7k+CCN6jQjNKDb9ZYB9YU+RHDYozuTji9vMqqkS7jG0IuxNO3WiNBnxfIM4c5/Rg0r8G48GlemAobS3waazvNhRBeRYlTKFVGEeC2KdekLQWmAzIBAHsxdQWo3kPSlnn/tIYd707Gh6/abNU/UadVBlbpHylcKIAmG+1jMwpo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594656370; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=7KSZTOs+/hEim4hLOZbcVt3SaaLm51cMpcgcMyNKHMI=; b=PQ1bMLrOEE/yW35Dr8naMJFU5An/qYubYn4i55Xq2fC4Rbx8KaGfmBErywraGRNOZDNaeJIuhe8DnUMjj/vADSZ2kF9kl1oOcmiF0lX+tJ03KpeojWmX1aXXttNCzz1p+MlcaQlLiqpxePRg8PzQjOx+pYhMJRO5L6b/WSD7rBE= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass smtp.mailfrom=dan@dlrobertson.com; dmarc=pass header.from= header.from= Received: from gothmog.test (pool-108-28-30-30.washdc.fios.verizon.net [108.28.30.30]) by mx.zohomail.com with SMTPS id 1594656369264747.1241619546078; Mon, 13 Jul 2020 09:06:09 -0700 (PDT) From: Dan Robertson To: Martin Blumenstingl , Neil Armstrong , Kevin Hilman Message-ID: <20200713160522.19345-1-dan@dlrobertson.com> Subject: [PATCH 0/1] usb: dwc3: meson-g12a: fix shared reset control use Date: Mon, 13 Jul 2020 12:05:21 -0400 X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-ZohoMailClient: External X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200713_120617_728557_961E3342 X-CRM114-Status: UNSURE ( 9.69 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [136.143.188.17 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, linux-usb@vger.kernel.org, Dan Robertson , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org When testing suspend for another driver I noticed the following warning: WARNING: CPU: 1 PID: 5530 at drivers/reset/core.c:355 reset_control_assert+0x184/0x19c Hardware name: Hardkernel ODROID-N2 (DT) [..] pc : reset_control_assert+0x184/0x19c lr : dwc3_meson_g12a_suspend+0x68/0x7c [..] Call trace: reset_control_assert+0x184/0x19c dwc3_meson_g12a_suspend+0x68/0x7c platform_pm_suspend+0x28/0x54 __device_suspend+0x590/0xabc dpm_suspend+0x104/0x404 dpm_suspend_start+0x84/0x1bc suspend_devices_and_enter+0xc4/0x4fc In my limited experience and knowlege it appears that we hit this because the reset control was switched to shared and the the use of the reset control was not changed. > * Calling reset_control_assert without first calling reset_control_deassert > * is not allowed on a shared reset control. Calling reset_control_reset is > * also not allowed on a shared reset control. The above snippet from reset_control_get_shared() seems to indicate that this is due to the use of reset_control_reset() in dwc3_meson_g12a_probe() and reset_control_deassert is not guaranteed to have been called before dwc3_meson_g12a_suspend() and reset_control_assert(). After some basic tests with the following patch I no longer hit the warning. Comments and critiques on the patch are welcome. If there is a reason for the current use of the reset control, I'd love to learn why! Like I said before, I have not really looked at this driver before and have verify limited experience with reset controls... Was working on another driver, hit the warning, and thought I'd take a shot at the fix :-) Cheers, - Dan Dan Robertson (1): usb: dwc3: meson-g12a: fix shared reset control use drivers/usb/dwc3/dwc3-meson-g12a.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)