Received: by 10.192.165.148 with SMTP id m20csp1142908imm; Sat, 21 Apr 2018 02:03:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+zZR6zqllzcH3wt+A+bADkycBPI59xoGdszGEfRZovUGFfjqb4DMhv/L6QYCIV7J02i1F6 X-Received: by 2002:a17:902:a5cb:: with SMTP id t11-v6mr13178595plq.265.1524301431011; Sat, 21 Apr 2018 02:03:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524301430; cv=none; d=google.com; s=arc-20160816; b=0A6eU8Y6End+BPIZNrd7MgFfJwRHJMYV7o3CDu1529SEf27YIMMxlKWb4zWI3GFmy1 68+pBiHqAP7aRqnoVQrX0v1VH8gqyOuYIRVT7odGsOsrI9eiSv4wADzB8CwxKJKmTdrG 4xe8C+HU9VsCpQtltEbxJPGSglAg8vQqAC+Lh+mtJENemdQGKvNpjKvFK8fxk3gz8V8I LLcx0tISiZ6rMCSllNh2/TYgc/Rwo8lQ7ontmMxcauzYdQOSIn5y0M63LC0k4TO7Me8M y8OMD/T7texgH01TjZZlSrd0Tg9rgMCIrFMiBAIZO8SZ9B4kcOgFBtHRMZVoHzcIAiBl iJAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=0PP8UHtdq9cu03A7CpsqW0xdgHjA2BRxbZXobeKzP5I=; b=Suhvz6FkpCtrSrh5mMFB8XC2sph8CsQrsmQEs7DhWjKh5kT4I3jYCfEVpWON9qYXK6 dKlbAr5YGAxd7MzbDAN4jYxnaKRY5O5+XWVPQVja+CxDqYDzZxFa/iTA4YfiiS6x8VpR pKksjE79N6oxqHuC+4UVlz4j9PUwtFkTYdYOCceEN20G0UtX7b2xO0whHfC/ap5XwCib OHNR62/jVHzMmCKMPGM2dZ0BoCaxsSijmX8KyAKux7wnvMezS7mhG8qRi5WbTeAsIJC7 t9kkmO30tQ2O1Mc4PQ8oNM4BfphJVx3PJY055KVTaf2KIib1zYFnnixnJFrnmBIjBKwa hDvA== 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 32-v6si7494377plc.252.2018.04.21.02.03.13; Sat, 21 Apr 2018 02:03: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 S1752633AbeDUJAH (ORCPT + 99 others); Sat, 21 Apr 2018 05:00:07 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40096 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751052AbeDUJAF (ORCPT ); Sat, 21 Apr 2018 05:00:05 -0400 Received: from localhost (ip-213-127-148-58.ip.prioritytelecom.net [213.127.148.58]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 4C54DE5B; Sat, 21 Apr 2018 09:00:04 +0000 (UTC) Date: Sat, 21 Apr 2018 10:59:56 +0200 From: Greg KH To: Ravi Chandra Sadineni Cc: stern@rowland.harvard.edu, martin.blumenstingl@googlemail.com, ravisadineni@google.com, chunfeng.yun@mediatek.com, johan@kernel.org, arvind.yadav.cs@gmail.com, dtor@google.com, anton.bondarenko.sama@gmail.com, f.fainelli@gmail.com, keescook@chromium.org, mathias.nyman@linux.intel.com, felipe.balbi@linux.intel.com, ekorenevsky@gmail.com, peter.chen@nxp.com, joe@perches.com, tbroch@google.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, rajatja@google.com, bleung@google.com Subject: Re: [PATCH V5] USB: Increment wakeup count on remote wakeup. Message-ID: <20180421085956.GA8081@kroah.com> References: <20180420180821.194380-1-ravisadineni@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180420180821.194380-1-ravisadineni@chromium.org> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 20, 2018 at 11:08:21AM -0700, Ravi Chandra Sadineni wrote: > On chromebooks we depend on wakeup count to identify the wakeup source. > But currently USB devices do not increment the wakeup count when they > trigger the remote wake. This patch addresses the same. > > Resume condition is reported differently on USB 2.0 and USB 3.0 devices. > > On USB 2.0 devices, a wake capable device, if wake enabled, drives > resume signal to indicate a remote wake (USB 2.0 spec section 7.1.7.7). > The upstream facing port then sets C_PORT_SUSPEND bit and reports a > port change event (USB 2.0 spec section 11.24.2.7.2.3). Thus if a port > has resumed before driving the resume signal from the host and > C_PORT_SUSPEND is set, then the device attached to the given port might > be the reason for the last system wakeup. Increment the wakeup count for > the same. > > On USB 3.0 devices, a function may signal that it wants to exit from device > suspend by sending a Function Wake Device Notification to the host (USB3.0 > spec section 8.5.6.4) Thus on receiving the Function Wake, increment the > wakeup count. > > Signed-off-by: Ravi Chandra Sadineni > --- > > V5: Added the description of changes between different versions of patches. > V4: Moved the wakeup count increment logic to the existing if which is > safegaurded by hcd_root_hub_lock spinlock. > V3: Added a gaurd to check if rh_registered is set before accessing > root_hub pointer. > V2: Fixed the build failure error due to uninitialized dev pointer. Is this needed in older kernels? Should I submit it to the stable trees? thanks, greg k-h