From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932734AbcECJfo (ORCPT ); Tue, 3 May 2016 05:35:44 -0400 Received: from mga03.intel.com ([134.134.136.65]:37132 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932407AbcECJfj (ORCPT ); Tue, 3 May 2016 05:35:39 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,572,1455004800"; d="asc'?scan'208";a="696009250" From: Felipe Balbi To: chunfeng yun Cc: Mathias Nyman , Matthias Brugger , Felipe Balbi , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, linux-mediatek@lists.infradead.org, Daniel Kurtz , Greg Kroah-Hartman Subject: Re: [PATCH] usb: xhci-mtk: fixup mouse wakeup failure during system suspend In-Reply-To: <1462266591.11651.34.camel@mhfsdcap03> References: <1461204293-18243-1-git-send-email-chunfeng.yun@mediatek.com> <1462261458.11651.7.camel@mhfsdcap03> <87vb2vfujq.fsf@intel.com> <1462266591.11651.34.camel@mhfsdcap03> User-Agent: Notmuch/0.21+96~g9bbc54b (http://notmuchmail.org) Emacs/25.0.90.3 (x86_64-pc-linux-gnu) Date: Tue, 03 May 2016 12:33:31 +0300 Message-ID: <87mvo7fpuc.fsf@intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, chunfeng yun writes: >> chunfeng yun writes: >> > On Thu, 2016-04-21 at 10:04 +0800, Chunfeng Yun wrote: >> >> Click mouse after xhci suspend completion but before system suspend >> >> completion, system will not be waken up by mouse if the duration of >> >> them is larger than 20ms which is the device UFP's resume signaling >>=20 >> what is "them" here ? The duration of what is longer than 20ms ? > They are "xhci suspend completion" and "system suspend completion"; > > It's time duration okay. So if xhci suspend takes longer than 20ms your SPM doesn't see a wakeup ? >> >> lasted. Another reason is that the SPM is not enabled before system >>=20 >> what's SPM ? > It is System Power Management which is powered off when system is > running in normal mode, and is powered on when system enters suspend > mode. It is used to wakeup system when some wakeup sources, such as > bluetooth or powerkey etc, tigger wakeup event. okay, thanks >> >> suspend compeltion, this causes SPM also not notice the resume signal. >> ^^^^^^^^^^ >> completion >>=20 >> >> So in order to reduce the duration less than 20ms, make use of >> >> syscore's suspend/resume interface. >>=20 >> no, this is the wrong approach > But it seems only one workable approach from software side I wouldn't say that. It seems to me SPM should be enabled earlier. >> >> Because the syscore runs on irq disabled context, and xhci's >> >> suspend/resume calls some sleeping functions, enable local irq >> >> and then disable it during suspend/resume. This may be not a problem, >> >> since only boot CPU is runing. >>=20 >> another problem :) calling local_irq_{enable,disable}() is an indication >> that something's wrong. > Oh! > > BTW: There will be warning logs if they are not called. yeah, I got that :-) But it's still wrong to use local_irq_{enable,disable}() the way you're using them :-) =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXKHBsAAoJEIaOsuA1yqREvnkP/iV8gMUF9XtNZR7Xe4LYpy/4 vZIEGlYsQojlhJTLLIVQspllAUePKgL7ar1TmFMFtIP3jQ4eOCUqDCPpArD6VRDT O87ev5hLjQRj2NnzCjvb44tBdzatDT+dR/VmRcV6YlOPVrxhYbwPaG/ym4FwyyCN Ukcdmlld/kGIMxFOj2ttHqNosx0/Vqp6sASYU6fu1pj36EhOxB9VlSjuaJ4V0Riz 2g1Nzj3tlsJoU/175PJU1oQ60boi04UnAkUSII5pgDrz1bXE9FYaudr8IGpTGf3s RAQjAA+Bmg9hzOQAxYsx6EBcgZLWYPw0jpKQ3tqlfeWQWePVAvWT3/XXYypN0GyG c7uu0BBi49fQdnqy9W7zJn3/+dkYb/s6Rh8M9hOK8vDO/pkn0/FEsCesU+3hJtjo jEhdoNB5mAEKgwuk5jx0h7J8Y5WUydMsusGZHVQL/xeOxZqun2z8ENiP9uzadOFM huLPdRAYjyGeoGYAcnCpRZjDeOvhbd94gDXnZrUPipp8ea/FIQ+94C0hqflXbNXN CVm4pXqFEt8xiHD0sHtIC1Cgodn6nZJpvs/l5BB3d88AWEZVFPXPZ3xePW1+1fxy DraXl3mghG6by0hvCbNJQkpTMOico/jnTIY1DBfFqnsQ+FyPZ0XFy7YKcNqjG2gE ZY3z006wQzNAwMa746o6 =HQXL -----END PGP SIGNATURE----- --=-=-=--