Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3683948imm; Mon, 17 Sep 2018 01:08:05 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaygD7E02B4JLEByte39pD4ae+Gn3Vx4IAyLwzcoj7ZtKBP7u+cFmZ8lnGC0iqdJu8gq4iA X-Received: by 2002:a17:902:9b92:: with SMTP id y18-v6mr23430419plp.239.1537171685861; Mon, 17 Sep 2018 01:08:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537171685; cv=none; d=google.com; s=arc-20160816; b=VuSQwBmqfRWi5jQR6BUbLcdhayk5Z/2hXXyHPhuVkupFFnVkqNvUC1R4xWww9BtE56 bbiE4fEn5b2HQBUVa3qQnzJRsqS1qZc7P8dHT74O/C0YPYyOYnAU5AxdJrS/6J59s3/J evPJhs2A/8aJR9FwK8JHU4ajYX3uQcDD6caSifdUVQmhrN3UmlSPbgGurssJk/P8Enxx QzflDDnf4D6sgo0BzNY8vZZOMbBCp2joIuHzZm8dkG8eyS0wETVMWFu+LmbArjn7Kjd9 IsiG5IUEqysWnjyl+KcFSUFZwyc2M4AxxJFEEYy+NcIJepgFP3Fh7Dbh3IZzeFfPgC4Z ReAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=Mh3Noc8E1gwQPDa/UuRCxD+AUUpZR7sVVJkX5vnZaQs=; b=juY77TlVMS6rgmcL9/3fu0trU1s2QLcHChjHfOEvsjBQt5HAB8hyK6htNYkx8uf1Ml 56PDiHWB/tUuwrtfvh9ylmgRoqV7JrmYC5A+plVkKiiSPowSVIX3WflZN4jmtFniuaex bbNU15gqc8a+yF0KwWZu2Mp/XIpafVqDT1k/fWl7zI9mnJzjdxDalGm4gKtU3q+ET5PR DCty7gL7gdnm6dPb1FQ4A2yQV681K8rbizYfCbHIqL6J72SVRiBmbWBXOIT0kh0Ur7py eg6kRc3EIGsWrNC14DaO6U/wTm1OFx+yzDb02MzwiiAxVEBzUhQrJHa8nLrcCugq0l+J EbBQ== 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=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v3-v6si13896527pgc.447.2018.09.17.01.07.50; Mon, 17 Sep 2018 01:08:05 -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=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727547AbeIQNdw (ORCPT + 99 others); Mon, 17 Sep 2018 09:33:52 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:43292 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726865AbeIQNdw (ORCPT ); Mon, 17 Sep 2018 09:33:52 -0400 Received: from mail-pl1-f197.google.com ([209.85.214.197]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1g1oZC-0007Eo-1r for linux-kernel@vger.kernel.org; Mon, 17 Sep 2018 08:07:34 +0000 Received: by mail-pl1-f197.google.com with SMTP id g12-v6so7573798plo.1 for ; Mon, 17 Sep 2018 01:07:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Mh3Noc8E1gwQPDa/UuRCxD+AUUpZR7sVVJkX5vnZaQs=; b=a8jHarXkQYV9m+vTWqVN/RCkMOIvr0R4VqqOXBupplS6O9P4sEi1McVNCADonEFqkO kYKDhY6CkHsbw01eSAFQpZp9XMeUxpxbjmOQ1WURFWMItSZVNFB/PS3W9269MH3ReE3J hDKq3g0rPJR4sJMjk0sZBdrcNPe2Y/JArnJB1r+hhK6jCTwJWOtzTfvrryfejNWOr90A Lt3Nmc8iq6vYapz6E7LsHtAXt/4/H+Zi1oI4yW47oKzUguGtGrptdyAD5Y5ct20hJ0B2 UNcoOMCasWAmSmLlo48U6jLC0UrC+OZ1k2t7phAaOPi87zHj0TSsSC0eufwefhdJ8IFe B2jg== X-Gm-Message-State: APzg51B7LUO0U7eseyF/FJTirrId0/YFrC6G8PpTExwgR/XHRixuKcmI SZUiOKaiKdMKhpjTmAq6f/Zn947XuZ+f+1eIszUSd4tuwSQ9GTEP3DM6cwDwY7Vy+FHFXz8PGkg gY9wtWPtHUN0RMkvAnqBU8hQfYf1nuj7q1wbBQbNqtw== X-Received: by 2002:a62:59d5:: with SMTP id k82-v6mr24454964pfj.143.1537171652667; Mon, 17 Sep 2018 01:07:32 -0700 (PDT) X-Received: by 2002:a62:59d5:: with SMTP id k82-v6mr24454938pfj.143.1537171652301; Mon, 17 Sep 2018 01:07:32 -0700 (PDT) Received: from [192.168.1.206] (220-133-187-190.HINET-IP.hinet.net. [220.133.187.190]) by smtp.gmail.com with ESMTPSA id v140-v6sm18707136pgb.45.2018.09.17.01.07.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Sep 2018 01:07:31 -0700 (PDT) Content-Type: text/plain; charset=us-ascii; delsp=yes; format=flowed Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: [PATCH 1/5] misc: rtsx_usb: Use USB remote wakeup signaling for card insertion detection From: Kai-Heng Feng In-Reply-To: Date: Mon, 17 Sep 2018 16:07:27 +0800 Cc: Ulf Hansson , Linux Kernel Mailing List , Linux USB Mailing List Content-Transfer-Encoding: 7bit Message-Id: <481937DD-FB33-4086-B478-32491A01B51A@canonical.com> References: To: Alan Stern X-Mailer: Apple Mail (2.3445.9.1) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org at 21:41, Alan Stern wrote: > On Thu, 13 Sep 2018, Kai-Heng Feng wrote: > >> I am working on the next version of this series, and the last missing >> puzzle is to differentiate system-wide resume from runtime resume in >> usb_driver's resume() and reset_resume() callback. >> >> The parent device, rtsx_usb, has two child devices, rtsx_usb_ms and >> rtsx_usb_sdmmc. >> pm_request_resume() is used in rtsx_usb's resume() to facilitate USB >> remote >> wakeup signaling, so we don't need to poll the card slot status. >> But this has a side effect: during system resume the rtsx_usb calls >> pm_request_resume() in its resume(), so child devices calls their >> runtime_resume() instead of resume() callback. > > Have you actually observed this? It shouldn't happen. > pm_request_resume() schedules a runtime resume on the PM work queue, > but this work queue is frozen during system sleep. It doesn't unfreeze > until after all the devices have been restored to full power. Thus the > child device's resume() callback should be invoked before > runtime_resume(). You are right, I read the trace wrong. It happens right before system-wide suspension, when the PM core resumes it to fully functional state. > >> So, is it reasonable to pass pm_message_t to resume() and reset_resume() >> callbacks and use PMSG_IS_AUTO() to differentiate them? > > It should not be necessary to do this. Understood, thanks. Kai-Heng > > Alan Stern