Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2058501ybl; Sat, 24 Aug 2019 09:25:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqylTZvOl87ZtZzc8gK6lWPAm5TdTnZal2JkyKSw5qB1a9xeD6gGrF6kRnw78RiR86hQWMhc X-Received: by 2002:a63:d315:: with SMTP id b21mr8973466pgg.326.1566663935718; Sat, 24 Aug 2019 09:25:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566663935; cv=none; d=google.com; s=arc-20160816; b=UVKH5INEpFW6jmotje08J3VDAWoZXQ3AkoMIIqzPbl8jv724F945XlCJfLkWfqnMFd 8cG3hjNOaQMeZwhFVzSf36waFTDHFxaE953YkBJNP28vlP2Y1fsC9umZFbdj8l+r+qTb cuUU0kGW9S7LVKjfveudTjFhSmqmdihUezAD033kbMw+e9wCl0gbCTQW1tCLLcJAV1Sv DPfdst1SZwUUWRru+Ox2c/AWU2/WcenANPeN6ALlAHfqW4iNRNexF4hHGS0euV72NhoV 4ufKMlCVF+2WOybgk0gN0DHYTMTX0LwMVFQZeL7L7iceutLKSfdS18bznI0fJm94Omyl nn6A== 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=5KUerDlSmB77Lo12oQ8r4Q4eH+L8kNrW2/kTpeARao4=; b=l2uxGlf4Kpy3JL66gtX2Ehf8nASxstEZABrHIZYgKIY6dCQHbiRW0c1F3st3tVPlev ewPFVoKiotocpjZUQFwFARbYJt2eVI0Khxj8kXNxhBcncTGEeqPSpO4T22FQzurJmJ1y Urom0Xy0e9xD6MmG1lZHDesL5AtyyP0QXiPz8EvXzKmVuw9qnE8eKEc3WwkTqSgaobrT cT37oPx8vH9Qz8VgohAMvWAZ9U9hNq5k5cETopuprMe6wyGsZwq14KEjJwRmfCJXcbXJ vwFtJoHEGNE9yMudzEh8BT1oS6KwoYHLUTXC0YE14ZGE+psKGOYDGfA4SYvXpPtzEb6j AUBA== 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 b3si5193093plb.367.2019.08.24.09.25.18; Sat, 24 Aug 2019 09:25:35 -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 S1727505AbfHXQW6 (ORCPT + 99 others); Sat, 24 Aug 2019 12:22:58 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:46042 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726343AbfHXQW6 (ORCPT ); Sat, 24 Aug 2019 12:22:58 -0400 Received: from mail-pf1-f197.google.com ([209.85.210.197]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1i1Yoa-00058e-Ng for linux-kernel@vger.kernel.org; Sat, 24 Aug 2019 16:22:56 +0000 Received: by mail-pf1-f197.google.com with SMTP id b8so417300pfd.5 for ; Sat, 24 Aug 2019 09:22:56 -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=5KUerDlSmB77Lo12oQ8r4Q4eH+L8kNrW2/kTpeARao4=; b=LlnIFFJwg52Godd5vi09vM4Iwjwwh1OsuRP1dyk/5D7+riIvr/055zgIE2LrvxckTU 3aw73Cdow1JL+GlRRWvshix7iENPedKrbqfyCLaas2c/cjIURSjSeTZj6r0Vk9Z0EOlv uiOVSjfFV7xC2b1p9sFKuTwHDUjjzmutc9Tv3I9I0ZAgbiKaF2ioL6haunmsG5XGs9AU 5Tdnn+77M/7mejQ6enOKGyQztoaC6AVYZX2IsKKG2PL6XOo5kWn8myDoavVhKtnHwziH iyHL5ts2ZYKy4TUutS3Nv/Wacz/J29+C9IOFB6tn3Aa6k1JrAJ/3x//SR1BSiZN+amwD PYuA== X-Gm-Message-State: APjAAAWc2Es7JZJA3x8evm9Em6gNArJnNlVouWuH6uZxtdWhCtlJvjAO gzO35SlXHHS90cdr05CCIm7d1LyFKcR1Fud8/4HWfJx0QaeQQvFi/SHS8auuf6N8oOdq0aNMreL woRUR43u+CZYuhlOcHY7r7fYQ5CZ1vG8eS81Y4AlwCQ== X-Received: by 2002:a17:902:1024:: with SMTP id b33mr9858060pla.325.1566663775426; Sat, 24 Aug 2019 09:22:55 -0700 (PDT) X-Received: by 2002:a17:902:1024:: with SMTP id b33mr9858041pla.325.1566663775217; Sat, 24 Aug 2019 09:22:55 -0700 (PDT) Received: from 2001-b011-380f-3c42-54b0-44c4-6d25-80e5.dynamic-ip6.hinet.net (2001-b011-380f-3c42-54b0-44c4-6d25-80e5.dynamic-ip6.hinet.net. [2001:b011:380f:3c42:54b0:44c4:6d25:80e5]) by smtp.gmail.com with ESMTPSA id g19sm7073182pfh.27.2019.08.24.09.22.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Aug 2019 09:22:54 -0700 (PDT) Content-Type: text/plain; charset=utf-8; delsp=yes; format=flowed Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: [PATCH] HID: quirks: Disable runtime suspend on Microsoft Corp. Basic Optical Mouse v2.0 From: Kai-Heng Feng In-Reply-To: <1566481032.8347.44.camel@suse.com> Date: Sun, 25 Aug 2019 00:22:51 +0800 Cc: jikos@kernel.org, benjamin.tissoires@redhat.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Content-Transfer-Encoding: 8bit Message-Id: References: <20190822091744.3451-1-kai.heng.feng@canonical.com> <1566467151.8347.23.camel@suse.com> <1566470325.8347.35.camel@suse.com> <1566481032.8347.44.camel@suse.com> To: Oliver Neukum X-Mailer: Apple Mail (2.3445.104.11) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org at 21:37, Oliver Neukum wrote: > Am Donnerstag, den 22.08.2019, 21:23 +0800 schrieb Kai-Heng Feng: >> at 18:38, Oliver Neukum wrote: >>> Well, sort of. The USB spec merely states how to enter and exit >>> a suspended state and that device state must not be lost. >>> It does not tell you what a suspended device must be able to do. >> >> But shouldn’t remote wakeup signaling wakes the device up and let it exit >> suspend state? > > Yes. Have you tested using a button? If they indeed do not work, then > the device lies about supporting remote wakeup. That would warrant a > quirk, but for remote wakeup. Button click can wake the mouse up but not movement. > >> Or it’s okay to let the device be suspended when remote wakeup is needed >> but broken? > > Again, the HID spec does not specify what should trigger a remote > wakeup. Limiting this to mouse buttons but not movements is > inconvinient, but not buggy. Ok, I still find the behavior really surprising. > > This is indeed what Windows does. The device is suspended when the > screen saver switches on. That we do not do that is a deficiency > of X. > To use runtime PM regularly you need an .ini file Thanks for the explanation. I guess we can mimic the behavior in systemd or upower. > > >>> In other words, if on your system it is on, you need to look >>> at udev, not the kernel. >> >> So if a device is broken when “power/control” is flipped by user, we >> should >> deal it at userspace? That doesn’t sound right to me. > > If it is broken, as in crashing we could talk about it. If it merely > does not do what you want, then, yes, that is for user space to deal > with. Ok, I’ll take a look at userspace then. > >>> Well, no. Runtime PM is a trade off. You lose something if you use >>> it. If it worked just as well as full power, you would never use >>> full power, would you? >> >> I am not asking the suspended state to work as full power, but to >> prevent a >> device enters suspend state because of broken remote wakeup. > > What then would be the difference between suspended and active? A small > delay in data transfer? Non-operational but with wakeup capability and vise versa. > >>> Whether the loss of functionality or performance is worth the energy >>> savings is a policy decision. Hence it belongs into udev. >>> Ideally the kernel would tell user space what will work in a >>> suspended state. Unfortunately HID does not provide support for that. >> >> I really don’t think “loss of functionally” belongs to policy decision. >> But >> that’s just my opinion. > > That is just what we do if, for example, you choose between the configs > of a USB device or when you use authorization. > >> Maybe just calling usb_autopm_put_interface() in usbhid_close() to balance >> the refcount? > > No, the refcount is good. If remote wakeup is totally broken, you need > to introduce a quirk that will prevent the kernel from believing the > device when it claims to support it. Ok. I’ll see if it’s possible to mimic other OS under current Linux Desktop. Kai-Heng > > Regards > Oliver