Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D366C678D5 for ; Wed, 22 Feb 2023 19:51:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232776AbjBVTvG (ORCPT ); Wed, 22 Feb 2023 14:51:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232744AbjBVTvA (ORCPT ); Wed, 22 Feb 2023 14:51:00 -0500 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2045.outbound.protection.outlook.com [40.107.92.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B18A042BC9; Wed, 22 Feb 2023 11:50:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NvasscICHGs42atfy2NN/cbUV193IN9TmALDEMGV3JB+0QndZ0ARXY8WiQrh02G58Eg0rt0tH384o0ckKICKJCAFaFuP6eapKaCe09LzUhf/OW584NOlBMqe905Pob11YfUhhiCzY98fZ5hNDoJpC1ZSE/UVBgVMCzc0Bek3gSYTqrvbdVa3k/J2DgR10bUCbuga8bmw9RL+/t2VkltZQ3TwWjEeGURrZd3PMxPiS2zN2ApREGhxrKrcYYVagkW+HnfFo8FZJaqZYgNgggYSxM2NNiKU25pEfJMxNVgGtr591/H/CdraBIa3qLXsNu5c/gHHx8UZfwvumLy7NcqPJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oZvjnY7266cYr5lYlUaA7lihhb8+FxwWRtSGQnTUitA=; b=TxubQq5DSfOy7BPhwvemIiq951olxUSThi6eA6fdpYXNlIYAAt7ZNMuazH7jIFRPMfuJda0wLyE6uVPSZfzA+eEfrhcV58h8Q4aUS1itqaIDI3cDTyYdbSxl4DKfNaqZOvxf6lBu9aF9eQeD9cNq2ysiOw7rBNSWylcQ7lu3cVD66ouB9txuRpPbyuAaccbVnd2NfZFu2jtuVRGLi7zpdh2gpkO0Gt2pcY3y1MYiEBj4Kg8Y2h98HzN0GpQ3C2P/gW6MHWFsa8TcJtTrCE5ZnnWxEWh4UOZsPqYCE8HjMBO8IlWgCQZk8vHIrBlZImge7Bo8jrweJ+b1owBnUopwNg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oZvjnY7266cYr5lYlUaA7lihhb8+FxwWRtSGQnTUitA=; b=xfqtiQBk/HpLrIdUqQVrJ7MFpVw3qmRcuAYcsDwIN9Ce1N9OUVC8t1IN7FbKBi7GR2HkEBVgLqL3afvxFpnKF31cUWhdQT3yrYvph5YI40p7uFN0a3VmIekezp7QgbqXSGBnAcBnktXLVYenRBWMiKL7V88IaWuyDzhs06tPEWk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from MN0PR12MB6101.namprd12.prod.outlook.com (2603:10b6:208:3cb::10) by PH7PR12MB6763.namprd12.prod.outlook.com (2603:10b6:510:1ad::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.21; Wed, 22 Feb 2023 19:50:50 +0000 Received: from MN0PR12MB6101.namprd12.prod.outlook.com ([fe80::a59e:bafb:f202:313c]) by MN0PR12MB6101.namprd12.prod.outlook.com ([fe80::a59e:bafb:f202:313c%5]) with mapi id 15.20.6134.019; Wed, 22 Feb 2023 19:50:50 +0000 Message-ID: Date: Wed, 22 Feb 2023 13:50:31 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH] HID: usbhid: enable remote wakeup for mice Content-Language: en-US To: Greg KH , Michael Wu , Richard Gong Cc: jikos@kernel.org, benjamin.tissoires@redhat.com, linux-usb@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230222013944.31095-1-michael@allwinnertech.com> From: "Limonciello, Mario" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: CH0PR07CA0030.namprd07.prod.outlook.com (2603:10b6:610:32::35) To MN0PR12MB6101.namprd12.prod.outlook.com (2603:10b6:208:3cb::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN0PR12MB6101:EE_|PH7PR12MB6763:EE_ X-MS-Office365-Filtering-Correlation-Id: 7cce9d2d-c834-4099-54fb-08db150e1955 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Fe9Wzg+N3/7251Qcu1fSgnulchTurNkJdZHqmrYNfqoHvOpxs2tdMoM/BiM2J9K0JczmB+RTQJ1hOUCjAmGz4Jbt3MOfZWnV/g5OdmlZ53D8PVNdO6Po8azAgaxs3/+KjnnQedlySt+iJRf8+tmZorTjLKOfKglyvuR+KMYxsknYWAvmgeTPziO38szyELcHcyqIYT1P8I1iEFEHleuFossA6xHgCs+2S8YuZJW3E8Qu2CGJdzE7FO68NJhGRFXMbCul1eE0eZmqcO8eO0tvSHGlGcaITgyUd8Dy4f+IOXP5wfnmIPSQnEC83sz2zkhTkw84I477gjWFLdW+Xikt6LnancBmorAkhWZ7O8M/6pN4xDVB7ecvD8aUd+dQmpRtXIkdoCXdBXkM9mKlNBZZVFMWvY6Hwe5e2TzNq3ZlSugjGuwc2GUU1ZIlEVRn28GjHGZXe+x7AzRPBkbXrBc31mEpWLQsdoH7Xa/7PHXv3U1FdMPKMevMQPU2AYYf9rE1NBZgih8F8s6zRL+nXMDL/BKdDWjKv1Te4fQtcJwSoguhITiQ9BfcxkaHgz4uNsfinFdbhygdCwz5j4nxofcU2uNYigEjZ9ad52kpq5rLf6IbbedBA49vR2MZQ7w0wd0cf65s9Um9k8wtOqo93VJ7zf9oCDBeKexRO20+BM4BPZeQQ1GtMsLlovn+1niShtI8Z3EWFM0NuiOF/i40rvI486MsFV6Es8uqd6XO1Vp2SbghrcRkTDQrJ4rDnbKm1AsXjrqF7f+Pn+lyoZFYnrPbiw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR12MB6101.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(366004)(346002)(396003)(376002)(136003)(39860400002)(451199018)(8936002)(5660300002)(66476007)(8676002)(66946007)(31696002)(86362001)(36756003)(316002)(478600001)(6636002)(110136005)(83380400001)(41300700001)(2616005)(4326008)(66556008)(966005)(6506007)(6512007)(53546011)(186003)(26005)(31686004)(2906002)(38100700002)(6486002)(6666004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aWUzVzZ6dDlici9VODA3YjhoZmg2cUhwWGNBTEhtVTZBRlA0REQ1bnpSeWM0?= =?utf-8?B?bnBWU29aaFlpSDNsU0t4dWREMkU3M3VXbTNRNXNBUEtzaUsrdUZPMGNlK2U1?= =?utf-8?B?cUtpTXJvZGFHeEdITzFrUElNSEdRUVZqZmFoUFhkTUlrRE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hyVzFtTUkxUjVFdXFCREhIYTZvQVNpTTJWY3BEOHhlQ2dIZi9JTDJa?= =?utf-8?B?STgzVEdRZmNNT1VuczErYTdHSDFQb0c0MmJOVVZ2SkcvZElPN2JRdjVKTWV1?= =?utf-8?B?MkFSc2pIaytDN05MenFLbnYzNXozUEtxRWtibHV3R1MzUjRhUGtSL1VuOVdG?= =?utf-8?Q?ysCtMDZ72Mo+Qv1lZ9byVzXTo?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7cce9d2d-c834-4099-54fb-08db150e1955 X-MS-Exchange-CrossTenant-AuthSource: MN0PR12MB6101.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2023 19:50:50.4461 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: LLxckJ7hG2JfXdeQwFrZDrPcu/hkRrfojqEXnW+u7JHy2evQZzeoNgTmNV5X7iY8ddxurlyowziTuyvC10P2kQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6763 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +Richard On 2/22/2023 00:04, Greg KH wrote: > On Wed, Feb 22, 2023 at 09:39:44AM +0800, Michael Wu wrote: >> This patch fixes a problem that USB mouse can't wake up the device that >> enters standby. > > This not a problem, it is that way by design. > >> At present, the kernel only checks whether certain USB manufacturers >> support wake-up, which will easily cause inconvenience to the >> development work of other manufacturers and add unnecessary work to the >> maintenance of kernel. >> >> The USB protocol supports judging whether a usb supports the wake-up >> function, so it should be more reasonable to add a wake-up source by >> directly checking the settings from the USB protocol. > > But you do not do that in this patch, why not? > >> There was a similar issue on the keyboard before, which was fixed by >> this patch (3d61510f4eca), but now the problem happened on the mouse. >> This patch uses a similar idea to fix this problem. >> >> Signed-off-by: Michael Wu >> --- >> drivers/hid/usbhid/hid-core.c | 8 ++++++++ >> drivers/hid/usbhid/usbmouse.c | 1 + >> 2 files changed, 9 insertions(+) >> >> diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c >> index be4c731aaa65..d3a6755cca09 100644 >> --- a/drivers/hid/usbhid/hid-core.c >> +++ b/drivers/hid/usbhid/hid-core.c >> @@ -1189,6 +1189,14 @@ static int usbhid_start(struct hid_device *hid) >> device_set_wakeup_enable(&dev->dev, 1); >> } >> >> + /** >> + * NOTE: enable remote wakeup by default for all mouse devices >> + * supporting the boot protocol. >> + */ >> + if (interface->desc.bInterfaceSubClass == USB_INTERFACE_SUBCLASS_BOOT && >> + interface->desc.bInterfaceProtocol == USB_INTERFACE_PROTOCOL_MOUSE) >> + device_set_wakeup_enable(&dev->dev, 1); > > Sorry, but we can not take this unless it is proven that this will work > properly for all of these devices. Other operating systems do not do > this last I checked, so there will be problems. > > thanks, > > greg k-h > Richard and I both sent out relatively similar patches in the past, but they never went anywhere. We did confirm that Windows does set a similar policy as well though, which is what prompted us to attempt this. As there is more interest again maybe we can revive that discussion and merge together some ideas from the sets of patches. Previous submissions: v4: https://lore.kernel.org/linux-usb/20220825045517.16791-1-mario.limonciello@amd.com/ v3: https://lore.kernel.org/linux-usb/20220701023328.2783-10-mario.limonciello@amd.com/ v2: https://lore.kernel.org/linux-usb/20220616183142.14472-1-mario.limonciello@amd.com/ v1: https://lore.kernel.org/linux-usb/20220404214557.3329796-1-richard.gong@amd.com/