Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp7034460imm; Tue, 24 Jul 2018 07:22:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfz+Ka1Cpdol4eF8C/xRNkzIa/kd0IzBIU6hIqu9E3stvyI+XpsRK1E+TFMuCzbO+qbyVBG X-Received: by 2002:a17:902:9042:: with SMTP id w2-v6mr8959511plz.61.1532442170946; Tue, 24 Jul 2018 07:22:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532442170; cv=none; d=google.com; s=arc-20160816; b=zh9TdYvgPjzX30TK9lljeear+mUxz/huQrzq/S7LzcHCx8TU48w++gUr23DJyZBlgb FWYSRS1HtD8nF06mfNybNcoRRzq0EIus0e9iqPJJnUSGW1ptI+ubiJdxC/VV1K94QFs2 8UpgzmFEGQaBUsqlUHU7f5/MDDmyRx/5lcsC2mmsVRIHfTe01O3qaY82TqThx41otkk1 bExXZBpa5mO1lSeV1pAeMFPWVRTyi5JRjrmNZVJsaHx4PbZz9JK8sw0e3NUIa41hZBDe SM7lyI4v314Hyb6d2Efo5KJ2dXWYG9XCTDFwoypn6NqXe5XzA6ciFCsSTNich/wJ20NQ jKjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date:arc-authentication-results; bh=bTHAG1GozaIvWQnIYJIbRDdpMDcSlTT1vLivvtp4HRI=; b=eHK6pQrfVnQtmyhdl9kFRUUxzaXpXnbHZqyGKYMPc0j0Yl6XnNRg09GDDWSfryZZ0E 6yKxENg8BsH9AA3XujriZfD9G7S/6T/8NkcixfDiNPoVqlmLc3L6LOTVKtK9aLvXGFVS CUYvtMAz6033XMDuQC7jTuZ9mfUK6Ben99y7VAPUtBa6pzJRoalA332tSH9qv3tOTTim Lgl5AQXwHKbH4jxEPVXc4tZsWpISbj1AuiQjFqX9rS0IlcXBnZkhMDCwi4sVvhwq5wlt eTBr6ZJeKtt1KljvWs+7+6E7lVrPzSqteRw/7uMl+VaeyjAD/eXbWxlIORGUNtxcDfS1 vQZQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a140-v6si12140745pfd.35.2018.07.24.07.22.35; Tue, 24 Jul 2018 07:22:50 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388486AbeGXP22 (ORCPT + 99 others); Tue, 24 Jul 2018 11:28:28 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:34406 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S2388430AbeGXP22 (ORCPT ); Tue, 24 Jul 2018 11:28:28 -0400 Received: (qmail 3100 invoked by uid 2102); 24 Jul 2018 10:21:45 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 24 Jul 2018 10:21:45 -0400 Date: Tue, 24 Jul 2018 10:21:45 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Paul Menzel cc: linux-usb@vger.kernel.org, Subject: Re: `ohci_rh_resume()` called during `usb_dev_suspend()` In-Reply-To: <4d24d2f7-6123-ae18-7055-b5d2f50bb964@molgen.mpg.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 24 Jul 2018, Paul Menzel wrote: > Dear Linux folks, > > > Profiling the suspend to and resume/wake-up from ACPI S3 with > `sleepgraph.py` on an ASRock E350M1, I noticed that resume methods are > called during suspend. > > Here is an excerpt from the callgraph. > > > 600.376906 | 0) kworker-81 | | /* device_pm_callback_start: usb usb5, parent: 0000:00:14.5, type [suspend] */ > > 600.376909 | 0) kworker-81 | | usb_dev_suspend() { > > 600.376911 | 0) kworker-81 | | usb_suspend() { > > 600.376913 | 0) kworker-81 | | __pm_runtime_resume() { > > 600.376915 | 0) kworker-81 | | _cond_resched() { > > 600.376917 | 0) kworker-81 | 0.565 us | rcu_all_qs(); > > 600.376921 | 0) kworker-81 | 4.034 us | } /* _cond_resched */ > > 600.376922 | 0) kworker-81 | 0.505 us | _raw_spin_lock_irqsave(); > > 600.376926 | 0) kworker-81 | | rpm_resume() { > > 600.376928 | 0) kworker-81 | 0.573 us | _raw_spin_lock(); > > 600.376934 | 0) kworker-81 | 0.706 us | rpm_resume(); > > 600.376937 | 0) kworker-81 | 0.556 us | _raw_spin_lock(); > > 600.376942 | 0) kworker-81 | 0.721 us | __rpm_get_callback(); > > 600.376946 | 0) kworker-81 | 0.564 us | dev_pm_disable_wake_irq_check(); > > 600.376949 | 0) kworker-81 | | rpm_callback() { > > 600.376952 | 0) kworker-81 | | __rpm_callback() { > > 600.376954 | 0) kworker-81 | | usb_runtime_resume() { > > 600.376956 | 0) kworker-81 | | usb_resume_both() { > > 600.376959 | 0) kworker-81 | | generic_resume() { > > 600.376960 | 0) kworker-81 | | hcd_bus_resume() { > > 600.376963 | 0) kworker-81 | | ohci_bus_resume [ohci_hcd]() { > > 600.376964 | 0) kworker-81 | 0.588 us | _raw_spin_lock_irq(); > > 600.376968 | 0) kworker-81 | | ohci_rh_resume [ohci_hcd]() { > > 600.377043 | 0) kworker-81 | | msleep() { > > Please find the full callgraph and the HTML output attached. > > Is that expected? I can't tell exactly what's happening from your callgraph and HTML, but yes, in general it is expected. The reason is because some devices have different wakeup settings for runtime suspend and system suspend: A device that is enabled for wakeup signalling during runtime suspend often is not enabled for wakeup during system suspend. As a result, the device's wakeup setting has to be changed when the system goes to sleep, and to do that, we have to wake the device up temporarily if it is already in runtime suspend. Alan Stern