From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23CBCC12002 for ; Wed, 21 Jul 2021 13:32:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 DAE9D61241 for ; Wed, 21 Jul 2021 13:32:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DAE9D61241 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :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=zDU0FT/4wg6f7k6q9vYsluV58cy7m4XiOGk2uorfNlM=; b=tyKe+3lI3I8xgn +H7CkhApZqFUFAlNvhsBP7y3RU3mJGFnsU8gmPhqVhcHsJyBt94rW+V9wjUspVKAWt3NjgdSGWXFG 2GQU3YQSZnQZI4lNba3C8ymV1dp4CZyqBDSoS9JnWvJjstj0W7QJOsd1V1ogiimJ5Mc6vz86HAGve erGiOQnZ0ixxO03cGsX9coKNfUzsxE2DyfP/oiNQPclZMtzfo7qZAaQVLDz7nslz0hl4UJ1Cri13S 3GopOsXzULZdjaKJYKEnUXJtHo39WbwEgV7sjbWpbxg8XyBDYvGu4DRXuUaMTIsREfDMi/vK3n7oB NkdauIlm2XeS8LYmblCA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m6CJo-00Fkvh-49; Wed, 21 Jul 2021 13:31:24 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m6CJj-00FkuP-RT for linux-arm-kernel@lists.infradead.org; Wed, 21 Jul 2021 13:31:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1626874279; x=1658410279; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=I7WNKuI7+/pCzxmkLSNPPRi3rAKXl6Cc8hkgas1mvPw=; b=nM8ZTmt0elEwxwfvWWazAe9/ha9zUqRW2quhQ4qGBxGtCVngAd9KzUDr InzY8OyXkE8RQsr6ciaL0rMki27uGL3Tb8a2uSerERckdhUgdz3TGDMNB wQKoiW/kAxMxNBMI8qHeftsyhdhQog3IJZ8RmFxKtYUIbEhmy6IQRH5/T avDaexm9+ExAYjsCBUuthWYz1cabnURvo+mKW+L3viaJJDveRN1QbiU+B dvkK8sq2g9nNaF3tKDOuOjQsmD6gwNRuuEkn8LCGRVpBcqdFrg2X1ZV0w j27ZdvcHHYvmp5IohoGCJaEgsfb6sHGmIhLLbfM8Wowf4VlrKq4KP/GVn g==; IronPort-SDR: TB1f9NIV08DZNaBwaSYx0KT7fE2RjAj4o1xmO1rb/uIqteCgZuXpCb3ciqzIVcFSGpjmcNym7B TUjxXRU9v7s5+Do9hjAIWwJ/tUWTF+isqlvkw0bqLNXslQcwrXGvHlAyY/fU03cyMgFm/Qr6/S I/kK/oWmzGwHbKikYlhSzHPLP69NZbpfGQJh9JsAi7Y10CuyqyKm9v2CGFRD96XPqBkSstRTva mINJqJ1r3t9le8gfd+xXTZIFezdi5aitZZbyQfWPawXSWLv3KNdqRrp5z790I0d+HZBFgSif5N LHwMqRsu8gK7vknZNp/RCYO0 X-IronPort-AV: E=Sophos;i="5.84,258,1620716400"; d="scan'208";a="122877766" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 21 Jul 2021 06:31:15 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) 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.2176.2; Wed, 21 Jul 2021 06:31:15 -0700 Received: from m18063-ThinkPad-T460p.mchp-main.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Wed, 21 Jul 2021 06:31:09 -0700 From: Claudiu Beznea To: , , , , CC: , , , Claudiu Beznea Subject: [PATCH v2] usb: host: ohci-at91: suspend/resume ports after/before OHCI accesses Date: Wed, 21 Jul 2021 16:29:05 +0300 Message-ID: <20210721132905.1970713-1-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210721_063119_999446_C4700A78 X-CRM114-Status: GOOD ( 11.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On SAMA7G5 suspending ports will cut the access to OHCI registers and any subsequent access to them will lead to CPU being blocked trying to access that memory. Same thing happens on resume: if OHCI memory is accessed before resuming ports the CPU will block on that access. The OCHI memory is accessed on suspend/resume though ohci_suspend()/ohci_resume(). Acked-by: Alan Stern Signed-off-by: Claudiu Beznea --- Changes in v2: - rebase on top of v5.14-rc2 - collected tag drivers/usb/host/ohci-at91.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index 9bbd7ddd0003..a24aea3d2759 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c @@ -611,8 +611,6 @@ ohci_hcd_at91_drv_suspend(struct device *dev) if (ohci_at91->wakeup) enable_irq_wake(hcd->irq); - ohci_at91_port_suspend(ohci_at91->sfr_regmap, 1); - ret = ohci_suspend(hcd, ohci_at91->wakeup); if (ret) { if (ohci_at91->wakeup) @@ -632,7 +630,10 @@ ohci_hcd_at91_drv_suspend(struct device *dev) /* flush the writes */ (void) ohci_readl (ohci, &ohci->regs->control); msleep(1); + ohci_at91_port_suspend(ohci_at91->sfr_regmap, 1); at91_stop_clock(ohci_at91); + } else { + ohci_at91_port_suspend(ohci_at91->sfr_regmap, 1); } return ret; @@ -644,6 +645,8 @@ ohci_hcd_at91_drv_resume(struct device *dev) struct usb_hcd *hcd = dev_get_drvdata(dev); struct ohci_at91_priv *ohci_at91 = hcd_to_ohci_at91_priv(hcd); + ohci_at91_port_suspend(ohci_at91->sfr_regmap, 0); + if (ohci_at91->wakeup) disable_irq_wake(hcd->irq); else @@ -651,8 +654,6 @@ ohci_hcd_at91_drv_resume(struct device *dev) ohci_resume(hcd, false); - ohci_at91_port_suspend(ohci_at91->sfr_regmap, 0); - return 0; } -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel