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=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_NONE, USER_AGENT_SANE_1 autolearn=no 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 C123BC48BCD for ; Wed, 9 Jun 2021 23:07:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A85AD613EA for ; Wed, 9 Jun 2021 23:07:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229740AbhFIXJc (ORCPT ); Wed, 9 Jun 2021 19:09:32 -0400 Received: from netrider.rowland.org ([192.131.102.5]:49757 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S229507AbhFIXJb (ORCPT ); Wed, 9 Jun 2021 19:09:31 -0400 Received: (qmail 1862035 invoked by uid 1000); 9 Jun 2021 19:07:35 -0400 Date: Wed, 9 Jun 2021 19:07:35 -0400 From: Alan Stern To: Claudiu Beznea Cc: gregkh@linuxfoundation.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, ludovic.desroches@microchip.com, cristian.birsan@microchip.com, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: host: ohci-at91: suspend/resume ports after/before OHCI accesses Message-ID: <20210609230735.GA1861855@rowland.harvard.edu> References: <20210609121027.70951-1-claudiu.beznea@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210609121027.70951-1-claudiu.beznea@microchip.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 09, 2021 at 03:10:27PM +0300, Claudiu Beznea wrote: > 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(). That sounds very strange. Suppose one of the ports is suspended, so access to the OHCI registers is blocked. Then how can you resume the port? Don't you have to access the OHCI registers in order to tell the controller to do the port resume? What happens when there's more than one port, and one of them is suspended while the other one is still running? How can you communicate with the active port if access to the OHCI registers is blocked? Alan Stern 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=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 4155FC48BCF for ; Wed, 9 Jun 2021 23:11:43 +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 053C4613EE for ; Wed, 9 Jun 2021 23:11:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 053C4613EE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rowland.harvard.edu 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=sVfhj00CuXLI2PSFp+HWUNzAQDtgxGwe7RkIVUE0oco=; b=0aVJLtEQjdCKAK B1jc2sxyD3QnkiHIOKmSJtXC8HxcAkSdVk5piUREsaHhSJDTcq27tY8AUJtSql86guLeKHeR+wpYI 3wMZwYMv7JVDtyI6UCi0tU5DQzSlDSXlaDh/UmR4+OX2pKopfNXdEtM2ylcDjyizJ2NXq8UgmhjkA lVN67kE51AS892fGifhJHGNMjgxpm3PLiLPhqziyKhLB573jxnb0u9u6JfU3EScGrjhSCg7Y0uml/ UhKmI5xGrxzr2yb2nRDpr5/Ae4i08xDqKq6KHD+CIU/NsNrnuY1QHzRwGGZ42TSa6MBGCnNDeT9g3 qGO9U2vmgYfql8QBGelQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lr7IU-00G4AK-1G; Wed, 09 Jun 2021 23:07:42 +0000 Received: from netrider.rowland.org ([192.131.102.5]) by bombadil.infradead.org with smtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lr7IP-00G49U-Gn for linux-arm-kernel@lists.infradead.org; Wed, 09 Jun 2021 23:07:38 +0000 Received: (qmail 1862035 invoked by uid 1000); 9 Jun 2021 19:07:35 -0400 Date: Wed, 9 Jun 2021 19:07:35 -0400 From: Alan Stern To: Claudiu Beznea Subject: Re: [PATCH] usb: host: ohci-at91: suspend/resume ports after/before OHCI accesses Message-ID: <20210609230735.GA1861855@rowland.harvard.edu> References: <20210609121027.70951-1-claudiu.beznea@microchip.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210609121027.70951-1-claudiu.beznea@microchip.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210609_160737_724367_D9BD3EF1 X-CRM114-Status: GOOD ( 10.63 ) 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: , Cc: alexandre.belloni@bootlin.com, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, ludovic.desroches@microchip.com, linux-arm-kernel@lists.infradead.org, cristian.birsan@microchip.com 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 Wed, Jun 09, 2021 at 03:10:27PM +0300, Claudiu Beznea wrote: > 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(). That sounds very strange. Suppose one of the ports is suspended, so access to the OHCI registers is blocked. Then how can you resume the port? Don't you have to access the OHCI registers in order to tell the controller to do the port resume? What happens when there's more than one port, and one of them is suspended while the other one is still running? How can you communicate with the active port if access to the OHCI registers is blocked? Alan Stern _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel