Received: by 10.192.165.148 with SMTP id m20csp1351925imm; Sat, 21 Apr 2018 06:41:26 -0700 (PDT) X-Google-Smtp-Source: AIpwx49//FWfLNDQHUJt42BTkfP5vlOClP88GKu5E0fKFIBTSDTyT9eqUxruOAVVxFg440zyllc8 X-Received: by 10.99.125.19 with SMTP id y19mr11397133pgc.160.1524318086805; Sat, 21 Apr 2018 06:41:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524318086; cv=none; d=google.com; s=arc-20160816; b=GVpRW7ONTZ7jT1ynf3rRak3cnHTGh5FZkpcTrC6oj4r81d90Wb3IeNikkblFnDqqdz JpEzlOAsyfMpSJG6ibJNQ1CJQJSFHbpDjtJ+OYa4Gh06SMmcYpuXHpfnlI4zLOxOnCVu bosURtdEi1bZluRZT4Y9jJX75nWGVAbRdUbldTbem95f9TJZQf3yg+TsGxuCO/o7SpGo ZmNDqNNWRcb9aaHvA8+ZhseVTUU/la7vNkMFu5nQeMDQXhV59S2uwiS5uusBJUc42mvG oFfrIkT3SzGBnwhPYCFYn4hL4o8XR+jaG9+vZGfpGeF1LTmtgb0D3GCRZOCoCVAvHmU9 Kh6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=UF8oAZVuLTYWfQ/FfCjEFCULPy2HEp8GoWEuL65aZBA=; b=Q7XT9nj6ODr9S6+0/o21m6Y8TyEthtY3DJFkGUtL2g0jaSQ9Uiek+igUmwmI/xTy1u xSwz0oxeRov4p4RIewEg5GdG2bHB5Eqyd4J7QnZSjIWUz81/konzicSbpPJCRt7UNCRQ HesPCXvmRD1Bn31htTCVFFLWR2dpBil1MQWzQwBMa5DrnlZv0ZBGopLV1Hlj43uvryb0 k+pUYrWj1GzPrQrfnlAPsDs9ug4T9mxpCgDNKTgf9kaNw7s+/QxBB2PSyFD/1fdHjnqV 1zKH4KuA5wofyHyf0IQPK4V2II0kN7HmfNE8+407eFgsfEkFMwWrI584V3YoME0QtJ54 qyyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=FYttoztN; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1si7458308pfi.355.2018.04.21.06.40.49; Sat, 21 Apr 2018 06:41:26 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=FYttoztN; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752819AbeDUNiK (ORCPT + 99 others); Sat, 21 Apr 2018 09:38:10 -0400 Received: from mail-vk0-f44.google.com ([209.85.213.44]:37030 "EHLO mail-vk0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752633AbeDUNiI (ORCPT ); Sat, 21 Apr 2018 09:38:08 -0400 Received: by mail-vk0-f44.google.com with SMTP id d9so6872765vka.4 for ; Sat, 21 Apr 2018 06:38:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=UF8oAZVuLTYWfQ/FfCjEFCULPy2HEp8GoWEuL65aZBA=; b=FYttoztNEUswB5ED4NNfoGrBw7yvQ3RQ7HWoLVR7GV53bXw+4Ll4lv6WHglk1dGNPU ZG5LX4jy1bWCUWJUUwzehl4Wjmn9vAE/rxJnGnVFpYScPH5bpTR9Is5pP6fAvPQKobnL NG0p5yCgKI0qkqtVs5/A+clMJzt1UyCu1N3D+S3gBF8NO49pj1xbDxO+ofMFWLuu6M78 KdToU08wbtE8PiqTkUrIoExJZlhjz6sFOmDhvjLNhQxdHu6MZ7ltKZ9mEchccGT14UEP yxuDt5TytYIj6VKc2fRJpxiCNZGUCx+wUUF5zfFHeC5VrRM/D0V+vVoAckDS/O+JSD02 UPXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=UF8oAZVuLTYWfQ/FfCjEFCULPy2HEp8GoWEuL65aZBA=; b=kO/7DQRJaysC+9caleT+DQ1CPWpbC1HyjIhyDnl5LFta5htQtq473wAlY8Gi/lDUxP KEe2eaajuzQY/yeFR0Tm58y8hyboW/v2JFHiuEP4ZIAhaobdPlRcQkmzNTTzzuzv1YGC +OXI2C4pN7cXL3VdXXHBR4n/1BBtqaJKs3NJcrbNGDTgDoRWsG+SMPRYuHOHZNa/7ckQ p84ifWQa+cQJR+22aUwrXfa4eQKdBGto5YJFa5bYoQ+AkNS63MlKNo0AkQYjfzjOrOYI QYeXjsskglid02HwXPIvgUIAwTXepb9M7ku8iWbtFoyL+wRtJ7vmx3r+Teb1em+LvqHt TJQg== X-Gm-Message-State: ALQs6tCj98DlgFJbNWyeeZT7kGOAr0yi8mcSU3DVH/DMZ4RBjcCT/tJ3 qf7hXuXb0KSR3nKuk2ba2vwg/A6no3cZE9S8E6EGqw== X-Received: by 10.31.107.17 with SMTP id g17mr4436473vkc.69.1524317887076; Sat, 21 Apr 2018 06:38:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.116.199 with HTTP; Sat, 21 Apr 2018 06:37:46 -0700 (PDT) In-Reply-To: <20180421085956.GA8081@kroah.com> References: <20180420180821.194380-1-ravisadineni@chromium.org> <20180421085956.GA8081@kroah.com> From: Ravi Chandra Sadineni Date: Sat, 21 Apr 2018 06:37:46 -0700 Message-ID: Subject: Re: [PATCH V5] USB: Increment wakeup count on remote wakeup. To: Greg KH Cc: Ravi Chandra Sadineni , Alan Stern , Martin Blumenstingl , chunfeng.yun@mediatek.com, johan@kernel.org, Arvind Yadav , Dmitry Torokhov , Anton Bondarenko , Florian Fainelli , Kees Cook , mathias.nyman@linux.intel.com, felipe.balbi@linux.intel.com, Eugene Korenevsky , peter.chen@nxp.com, joe@perches.com, Todd Broch , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Rajat Jain , Benson Leung Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sure. Pushing it to the older kernels will definitely help. Thanks, Ravi On Sat, Apr 21, 2018 at 1:59 AM, Greg KH wrote: > 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