Received: by 10.223.176.5 with SMTP id f5csp1088176wra; Sat, 3 Feb 2018 18:05:56 -0800 (PST) X-Google-Smtp-Source: AH8x225VwssU6J18vgZ0POY6a/w0ZI0WcJHNtZgXJ/61Ta3+oWkMT5DYXBLZfT8KWK1+oA5Icvjp X-Received: by 10.98.217.141 with SMTP id b13mr9450120pfl.239.1517709956701; Sat, 03 Feb 2018 18:05:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517709956; cv=none; d=google.com; s=arc-20160816; b=GQ8evaRn6Bne+bIuGptA0Pr6vGtS7Na1h6Z6OwI0ZZdro2SmMxIcnxiNWhE4SFKmTd k19obp6ae/79hVF/kffaOLuMOQAYiWI7lYI4ZZrH/H8ibgcZiPF/WmOvipzYF8oxQ/pp tOko9CLePr2v1vPvCjqRHsPbGCSwGymIxQshwk2a7idBJ+GY/RZhyKzDZ+0WYYzpUGaI jEuIGiGJU3lEwvBOhX8AhxG+sFlvND+aGDC0t9yIMyjydLaqRb0oOw0ED4ZQk2gsaGUV vzIJUXyxtQQMOcuGKAvkqGeNxyB8uJmJ+eXcqXgs8n6S2lxbmaf7TMAPFIm5AZXO1htL vzNA== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=X8drONYTLsahQoXVIq1oLLptS6nRE8WqfzPsvexrUBs=; b=kAQHAbBsrA+AlNvnsnaUnI6QtmcjdYeCOeYZq1gpDz41eq1TyWO1BXuLDpNrgNZ8u2 OHNdTlOWkqubCXRxHD/0NI5sxTiH66CuThgvkiRWq+nx+SVyIqwL6KizF9USUKdJ3uVW YcTcvWX4pfFfnqUMNsLXQjHdXyxwXgQOZhjurzWHPY7Su9ynocSNwDERyPLbk1EgcKEq UTRMljeM9n/f93h3wdF0z3h31AkB0F9g287MNa7epe6WqAppCr7k5Cj6bgMFu5P/fUol f23tMfr+jMpVhtWt9MZlb0ZGHD/Y+YCZNrVPxFulMuRfM7K6bqOZ5dT+Sdsa7+cVw7dB 1O+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=CIKvcwsP; 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 i84si4560000pfj.10.2018.02.03.18.05.42; Sat, 03 Feb 2018 18:05:56 -0800 (PST) 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=fail header.i=@gmail.com header.s=20161025 header.b=CIKvcwsP; 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 S1750776AbeBDBrF (ORCPT + 99 others); Sat, 3 Feb 2018 20:47:05 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:37988 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752753AbeBDBq5 (ORCPT ); Sat, 3 Feb 2018 20:46:57 -0500 Received: by mail-pf0-f195.google.com with SMTP id q79so2811500pfl.5; Sat, 03 Feb 2018 17:46:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=X8drONYTLsahQoXVIq1oLLptS6nRE8WqfzPsvexrUBs=; b=CIKvcwsP2wswnv2qoCow/YdOckMu48CJbUgJorD2wMtuNwU6kXA3Y9fTVrCR69itpw xfCqcl+4xke1BqztUQb8d5yI2mF12chzi0lJmo9AK8QvQvuDn6eJED4zjw+RyAsO1qNu 8f0miDZ0BJb0sU/dJeOL9DFUXdg52sZTa1BN/FNA6lEY8frly9QMGRtgE1P7DuZWCboT RzuonwMyXCTuo5wJOFKf+3awduoMI5Jxr2+mZ1FbNQ7G9OCPwVoklMeWO7Y32uqNZPr3 s3YeqwMxC0RMjp5mK+PQMs828cH/BlSoUSC76gJ7GcByg5M6gLSv8JcgkR+eBfuFvozT PNTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=X8drONYTLsahQoXVIq1oLLptS6nRE8WqfzPsvexrUBs=; b=sfHaEU4pePuJM3N2fttKvXVB8VkLYkca322bmlLEhs5GK9oEQ1bFiYpzVFxeQAZ3dJ 6GpbKgqvCT9K9VliH5/o8XIEetwbEeVgrQCRtJVvzixHc1XHX5xRChqUYzBw/uILx7k/ haUQiN0TwcfRFWYSskDUMHQnAxKyHDiokE0XpNgxSiAqo2U+S/2I2eJo60w4O0OFpGBM BXg731fWliYC1NruNzToRE2I7Gvc2wVDCvUwNh9Jo0rhjv4/Cqp2bvRqMaJveTufV/e8 vKpDCA7q+/DbvKwQAT6fxOg7BIhOnBU2CGxrkzrr44JAp5JGO0PdJ5DBa+Wx6uCCo+fu AS6A== X-Gm-Message-State: AKwxytc1L1uW/I6kdSJ1qIvT7s7LGwzHa6gLK4DhH4SNMz1ZIs3Oy+wW xcajel9x++tjCmsXkEbrxDM= X-Received: by 10.98.236.156 with SMTP id e28mr6469929pfm.152.1517708816685; Sat, 03 Feb 2018 17:46:56 -0800 (PST) Received: from pi.iht.com.au ([203.87.124.230]) by smtp.gmail.com with ESMTPSA id p14sm7678181pgu.7.2018.02.03.17.46.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Feb 2018 17:46:56 -0800 (PST) X-Google-Original-Sender: Received: from johan by pi.iht.com.au with local (Exim 4.89) (envelope-from ) id 1ei9Ne-000649-80; Sun, 04 Feb 2018 12:46:06 +1100 Date: Sun, 4 Feb 2018 12:46:06 +1100 From: Johan Hovold To: "Ji-Ze Hong (Peter Hong)" Cc: Johan Hovold , gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, peter_hong@fintek.com.tw, "Ji-Ze Hong (Peter Hong)" Subject: Re: [PATCH 3/5] USB: serial: f81232: enable remote wakeup via RX/RI pin Message-ID: <20180204014606.GB28684@localhost> References: <1516607927-8887-1-git-send-email-hpeter+linux_kernel@gmail.com> <1516607927-8887-3-git-send-email-hpeter+linux_kernel@gmail.com> <20180130035747.GB3434@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 01, 2018 at 11:13:01AM +0800, Ji-Ze Hong (Peter Hong) wrote: > Hi Johan, > > Johan Hovold 於 2018/1/30 上午 11:57 寫道: > > On Mon, Jan 22, 2018 at 03:58:45PM +0800, Ji-Ze Hong (Peter Hong) wrote: > >> The F81232 can do remote wakeup via RX/RI pin with pulse. > >> This patch will use device_set_wakeup_enable to enable this > >> feature. > > > > This is a policy decision that should be made by user space by setting > > the power/wakeup attribute, and not something that something that > > drivers should enable directly themselves. > > > > Perhaps you really wanted to use device_set_wakeup_capable()? But then > > you also need to honour the current setting in suspend() as well. > > > > How have you tested this feature? > > > > Our USB-To-Serial support RI/ RX remote wakeup by Modem, Fax or > other peripherals and we had tested it by following procedure with > device_set_wakeup_enable() enabled: > 1. Using pm-suspend to S3 > 2. Trigger a pulse to RI/RX to wake up system. > > In our test, we can do remote wakeup only with > device_set_wakeup_enable() enabled. Yeah, but you need to enable it though sysfs. Not every device should be able to wake the system up. That's a decision left for user space. > Should we add device_set_wakeup_capable() & device_set_wakeup_enable() > like following link?? > https://elixir.free-electrons.com/linux/latest/source/drivers/media/rc/mceusb.c#L1476 No, your driver should not call device_set_wakeup_enable() itself. Just set the wakeup capable flag in probe. And if you can disable the wake up feature, this needs to be done at suspend depending on what user space has requested. Johan