Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3768627pxt; Tue, 10 Aug 2021 10:53:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnvqZUfVz9rqgpBgXpzCdUgTWEmmk1YUFCrAuHnI6mwUt2RicH+TkjyW5dgIlbFg4HlKCb X-Received: by 2002:a05:6402:148:: with SMTP id s8mr6412543edu.298.1628617996720; Tue, 10 Aug 2021 10:53:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628617996; cv=none; d=google.com; s=arc-20160816; b=kzuoKXSK+Ul9N0zMhYbRDCfE8WnzZ0My/rr1Rn4pHG5I5qyeTUMCtW3ZQHy4849Ju7 Cu/uzdkb3GmwWbcmdI0SmUFHJ+fSgWOk23TE7BdWP8bYinlcy9++icRDUrNfKtCTJtdv 8L5mzyKvrcuGr8BTzISYZhRe559ZlS4KGBeqysxuYfUShVx/h+9YWg+WVbNGskJqfo2n dll3VOAkpwjqe8htofsRvJw9kytG85C6JkXx9cSj0j18M9gfGsLEmHABOye1OLRGEBSa njkUOQfoLnbsHFo0H/kuDqIMNPvXPMidvoH8Vhnda7JskZ8/6xGNb4R+rRi78YjGfksP wW/w== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=V9zdVUHQuNeJ7qN2lmFv+JYgq1zIa2GFZOncJzzQ85Y=; b=hwePa4/TlnODF6h98o4GK6Nww9OA40LHau64HQCghS3qnrfMC/0u4KdWx/FKgBoYwZ pm09/ojdoZz0zVVf5Vmdu+gLJ0HUbyzl3YDGKw0ZQueQ7rX7/XJqdWc6dm5ffjGlgBvV GcQHjOqONFFa8NI1CQx1d5cLK/KIPP444pbqwUMqoYNZE2VJPVP3zyUniWbuCLYkoV1r W1eEMjl+5AibAcw6X90SuJBeYCUHhG6HLzfyYiiZ6hBiNgpX06sVYKgjGNNvIRPcxz9S qG7g/gGI8bC0uBmU4NxaM8p2SiLRA1FSZsilslDuBBgO1OKuRPsZUjE9JIccrrjdDWSf df6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pEvUqV3M; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s5si8023763edy.388.2021.08.10.10.52.51; Tue, 10 Aug 2021 10:53:16 -0700 (PDT) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pEvUqV3M; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235894AbhHJRub (ORCPT + 99 others); Tue, 10 Aug 2021 13:50:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:54476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234353AbhHJRrK (ORCPT ); Tue, 10 Aug 2021 13:47:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D555A61261; Tue, 10 Aug 2021 17:40:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628617254; bh=RDMc6f6+oHGp9OQZkfFNST22NUvsvoZ6295xLgFaI/8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pEvUqV3MRyZ1UO9UPQlGwFzwiyJJhNQe/lSpij02LLvt5BEc4cPwLePaMRcwwcHJw hFHASQUrk2af8JMbN8GnFO3zG8iNQiql3TETBymuZJ21eRIuPVoF5VhU0OINWVHNV9 hxJebPnuTR2hAkzLaPuNxxTXfCFSqwSGJIjF4POM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alan Stern , Claudiu Beznea Subject: [PATCH 5.10 070/135] usb: host: ohci-at91: suspend/resume ports after/before OHCI accesses Date: Tue, 10 Aug 2021 19:30:04 +0200 Message-Id: <20210810172958.101008340@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810172955.660225700@linuxfoundation.org> References: <20210810172955.660225700@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Claudiu Beznea commit 00de6a572f30ee93cad7e0704ec4232e5e72bda8 upstream. 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 Cc: stable Link: https://lore.kernel.org/r/20210721132905.1970713-1-claudiu.beznea@microchip.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/ohci-at91.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c @@ -606,8 +606,6 @@ ohci_hcd_at91_drv_suspend(struct device 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) @@ -627,7 +625,10 @@ ohci_hcd_at91_drv_suspend(struct device /* 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; @@ -639,6 +640,8 @@ ohci_hcd_at91_drv_resume(struct device * 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 @@ -646,8 +649,6 @@ ohci_hcd_at91_drv_resume(struct device * ohci_resume(hcd, false); - ohci_at91_port_suspend(ohci_at91->sfr_regmap, 0); - return 0; }