Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp504437ybe; Tue, 10 Sep 2019 23:45:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqy9c2adz271Umu2O/w+oW3gajcVUcp8+b2sQKMnIr9BxCG1I7qKLphtSrtyYqHkg6CDLmH+ X-Received: by 2002:a50:908c:: with SMTP id c12mr35734505eda.45.1568184322181; Tue, 10 Sep 2019 23:45:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568184322; cv=none; d=google.com; s=arc-20160816; b=X+DB40aMWxlbnOyaRpIaEcttBV0PPwQD1VVOpizWa7ZkvhH4GvCJaeCTfA9TDJkuJw IDrLJBb76ydMyaMgKRr2msiN6L7t38AquGRNS/Vb5pWn88mn7TUrzD3fjV3TTcHHXmtW ok3Eh+MCxxZ0De2UBgKetUMl+UqkoS3KoYGwB5RNhBofjR2GQH0gbozlUMAoC9WzhVZs 9cWSSE7xjB8r+x19aZkYBVrrvgGHbs6+YKWs6Qrg75i3q/oeCH0jLnH4EX35cyWctiIh nZKcERY7zxwYUm7R7ctJAOTyNYFMygRGiBQYw8u4GPg7eY6xiUqb9i9li+HW7i3B2Cy6 OJeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr; bh=YwmgVdGf2Q27/rkJc2M47vmTZszai8bvkGOGOTw4jGA=; b=lurAaDvJdsectQ6iXhLwLXCcpfM/GrBkZRxTdjrkOdkKekhFk/lPlm2oSjTsZEyaGk D0LBqFxYa1lEy/pr1a7D06NmcYO1PHJlP7cFlHEgkS0AAAVhjzqhuIp6Vo30BFR1vvll YDbU64Sg9Jswi5hBHhT92E4R3oewftGrdpTzuhV7/PFTVH3rbjBpWH69YexYQlzH7YAM SQFIEIBtYzSQ6jqd4w1DZdjLzxh57Z/9khLoIJGPLjEKp57TGysvmwLNXBrRmXnUO8xb GCcXwab2YEEhDZC4xAbL2bG7YXd1Y3mL/ArPtZieYJ298Bt9OZAtEIFqDw+8qdHcVFX6 asxA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=microchip.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o12si10074151edr.193.2019.09.10.23.44.56; Tue, 10 Sep 2019 23:45:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727014AbfIKGmg (ORCPT + 99 others); Wed, 11 Sep 2019 02:42:36 -0400 Received: from esa2.microchip.iphmx.com ([68.232.149.84]:38951 "EHLO esa2.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725747AbfIKGme (ORCPT ); Wed, 11 Sep 2019 02:42:34 -0400 Received-SPF: Pass (esa2.microchip.iphmx.com: domain of Nicolas.Ferre@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa2.microchip.iphmx.com; envelope-from="Nicolas.Ferre@microchip.com"; x-sender="Nicolas.Ferre@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com a:mx1.microchip.iphmx.com a:mx2.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa2.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa2.microchip.iphmx.com; envelope-from="Nicolas.Ferre@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa2.microchip.iphmx.com; dkim=none (message not signed) header.i=none; spf=Pass smtp.mailfrom=Nicolas.Ferre@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: oVL/De3qJ0eO2V641n5mVglNnEflb5buSfjyBElXkHLnlgZ2Ubshz3su221izQyQZlRtDipJEC A5Pxx19x16XpoBvUNOwYN9SGQK0clb/ZncuqGT6nDW8lKVWHJ+nWOzG04y/Q3SkKlAqhUkbi8+ rzr9UWetZkdPY1u7GmIUWkxT6odcbSYStYpC9/trJJkReeBrPID98furAQnAlQzj/rLaWPsViv KVKQ/uOJ8VbXYf1HSEG1IXRt37WijuS27k79ikdJ/7GH/wEVf8Rsl/g6jYveXJZ2hOzkG4CLdl M7w= X-IronPort-AV: E=Sophos;i="5.64,492,1559545200"; d="scan'208";a="48466723" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 10 Sep 2019 23:42:32 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 10 Sep 2019 23:42:32 -0700 Received: from tenerife.corp.atmel.com (10.10.85.251) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Tue, 10 Sep 2019 23:42:30 -0700 From: Nicolas Ferre To: , , , CC: Alexandre Belloni , Ludovic Desroches , , , Nicolas Ferre Subject: [PATCH 3/3] USB: host: ohci-at91: resume: balance the clock start call Date: Wed, 11 Sep 2019 08:41:54 +0200 Message-ID: <20190911064154.28633-4-nicolas.ferre@microchip.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190911064154.28633-1-nicolas.ferre@microchip.com> References: <20190911064154.28633-1-nicolas.ferre@microchip.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Boris Krasnovskiy There is a clock enable counter run away problem in resume ohci_at91. Code enables clock that was never disabled in case of non wakeup interface. That would make clock unstoppable in future. Use proper alternative to start clocks only if they were stopped before. Signed-off-by: Boris Krasnovskiy Signed-off-by: Nicolas Ferre --- drivers/usb/host/ohci-at91.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index 85d67fe42d59..513e48397743 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c @@ -643,8 +643,8 @@ ohci_hcd_at91_drv_resume(struct device *dev) if (ohci_at91->wakeup) disable_irq_wake(hcd->irq); - - at91_start_clock(ohci_at91); + else + at91_start_clock(ohci_at91); ohci_resume(hcd, false); -- 2.17.1