Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1276801rwr; Thu, 27 Apr 2023 15:19:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4XVB5lmWmIH+SiEDbd8RZttnbpNKJQ4uJZD4yUOqo6oCchQL/NBQXe+bqlzoKysKpBWaxA X-Received: by 2002:a17:90a:e7d2:b0:234:31f3:e00f with SMTP id kb18-20020a17090ae7d200b0023431f3e00fmr3169697pjb.43.1682633949157; Thu, 27 Apr 2023 15:19:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682633949; cv=none; d=google.com; s=arc-20160816; b=0vjfCoLv2hzf3mwf4zmtnr5qViBmnM2C0x1DtreDV0smPBustlDlzU7JAn/3HdB/3V Mn1Lb01c1XlaNpmFyynTBW8c5ROCbUA+lcsKtFrlTml/K4ND0jaTBMhRb5I5hIFdBGBf JjPGRGygKmQZjLXHKJ/IbMdBuysjD5ySlczJ2Lr1+mr4FaXeLLG/xECkH36G/vOpddfl aV818LXHequnuw+Za57ZeyWCkqon4XVpaRX2AnqWO/YWjVtzhTl4xGzmpJjMb+ohGiw6 7ozskOjWMYkBs6g+MVaxP6pz18xR9fSliCbKNuD3L9Cs9EIQ7/XCIODf4KcbFaysRFVd CPmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=wgxbPMJ7xUQDEudjDb2tgUkteEVXo/Z62mLiKg0b33g=; b=Q5k8+9OmaVUCigS1zWJ3Aed32h+S4ehbgulkkN3ELy8hTrFK0871qC1i58Ts8INY83 YrvMV4aAtGJM4lnvozxPgOh/cmj8f5wythrgrTQTewQjJTkVORYb8KJTTpEUZbmiRwto lK5OalPgFI4cBNoMnBMm6gOsvlkti/ZeWR/frkUtxOQtPZ23vBYpkUauY49mzAor9dlO wEyIOlZbw1gXNKs3Lk6mD5zAU26f4+/KmQTNIM8AfjpibVueVcpr6L2yFPhxAb5AHF82 fLvRQChkvy4xdThpkCgIrUPbumuFtXpP/Cowzje7gZ590h2DX5y5OO41ikPFmmqoGBbI 8Buw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Z5eao2yl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x5-20020a654145000000b00518521c5a33si19840804pgp.891.2023.04.27.15.18.57; Thu, 27 Apr 2023 15:19:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Z5eao2yl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344179AbjD0WSJ (ORCPT + 99 others); Thu, 27 Apr 2023 18:18:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229783AbjD0WSG (ORCPT ); Thu, 27 Apr 2023 18:18:06 -0400 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E78FC30EE; Thu, 27 Apr 2023 15:18:01 -0700 (PDT) Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-517c01edaaaso6686526a12.3; Thu, 27 Apr 2023 15:18:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682633881; x=1685225881; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=wgxbPMJ7xUQDEudjDb2tgUkteEVXo/Z62mLiKg0b33g=; b=Z5eao2yloeRGKjFH79FDobwF4GBZyz/El+hwcAktCg26P3OkFYrJ7nMe5ZQKD3tjVL 4NYP58f09Che6fBHQ+jJ3uCI56k+2WJvbSXb1sVp7bJkDb4EobiWttlTHa6zsSRipyol 07q/pm0WqBMYJIKszuGd6Cv7qK1/Y/h7ykBatvFSedb+ApiDXlrKZuUtXL4JtH9YbAHH PBbc9iPZIPjyhZGX66vB5MMYF1/da+kQTop1ldLiL9/9U5daQVz6GJI35qEFaiFebxCe XLkuroA89QMqM2vE2pjgSVnSO087ZoAq3jNsT+OY3XCRmXQ0ooaFg0KMQAq8n9bftrX7 ELgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682633881; x=1685225881; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wgxbPMJ7xUQDEudjDb2tgUkteEVXo/Z62mLiKg0b33g=; b=ROstWA5TkLtOOP/j03RqMruL9TxmCaysA3RPHPQaZoEv7Mlie3/1pUHVFmsVtx4XeZ yxTBIQWz+SbpiTD2a3AEQKDN9n36YjcT0tFnmr3CUBhjtN9159PxqpJtq3KSsDA7A9w3 SoaHWmuHOWfj+BwK78q1PxGYh44eYeQlV6mDjX1etOEIvfsxEGqp9SaATvKY/SJe/a+N Qg8qb09+gF3JYMheSbcBD1eKlDCmzgPX8NfH5lsWii64erxQGoyw+FvgEYp1b4HtjfOL aXgA2xPJcWuXk9xgweKMOLi3jLPcBMzchsN3ecK3KrNwfazu1oRvX6qoCX64LT5GqK8P KpEw== X-Gm-Message-State: AC+VfDyMtgDkkDGExL/1Z4S7LkMrEmljOKMg+jjRLOJ8k6pq0NsYuM7J 2d2XDKBSxrza9d1LZuA3NCQ= X-Received: by 2002:a17:902:f20b:b0:19f:3b86:4715 with SMTP id m11-20020a170902f20b00b0019f3b864715mr2916598plc.8.1682633881183; Thu, 27 Apr 2023 15:18:01 -0700 (PDT) Received: from stbirv-lnx-1.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id w8-20020a1709027b8800b001a661000398sm12022783pll.103.2023.04.27.15.17.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Apr 2023 15:18:00 -0700 (PDT) From: Doug Berger To: Greg Kroah-Hartman , "Rafael J. Wysocki" , Dmitry Torokhov Cc: Lad Prabhakar , Gergo Koteles , Jonathan Cameron , Andy Shevchenko , Dan Williams , Hans de Goede , Thomas Gleixner , Kees Cook , Kishon Vijay Abraham I , Saravana Kannan , Florian Fainelli , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Doug Berger Subject: [RFC PATCH 0/3] input: gpio-keys - fix pm ordering Date: Thu, 27 Apr 2023 15:16:22 -0700 Message-Id: <20230427221625.116050-1-opendmb@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 52cdbdd49853 ("driver core: correct device's shutdown order") allowed for proper sequencing of the gpio-keys device shutdown callbacks by moving the device to the end of the devices_kset list at probe which was delayed by child dependencies. However, commit 722e5f2b1eec ("driver core: Partially revert "driver core: correct device's shutdown order"") removed this portion of that commit causing a reversion in the gpio-keys behavior which can prevent waking from shutdown. This RFC is an attempt to find a better solution for properly creating gpio-keys device links to ensure its suspend/resume and shutdown services are invoked before those of its suppliers. The first patch here is pretty brute force but simple and has the advantage that it should be easily backportable to the versions where the regression first occurred. The second patch is perhaps better in spirit though still a bit inelegant, but it can only be backported to versions of the kernel that contain the commit in its 'Fixes:' tag. That isn't really a valid 'Fixes:' tag since that commit did not cause the regression, but it does represent how far the patch could be backported. Both commits shouldn't really exist in the same kernel so the third patch reverts the first in an attempt to make that clear (though it may be a source of confusion for some). Hopefully someone with a better understanding of device links will see a less intrusive way to automatically capture these dependencies for parent device drivers that implement the functions of child node devices. Doug Berger (3): input: gpio-keys - use device_pm_move_to_tail input: gpio-keys - add device links of children Revert "input: gpio-keys - use device_pm_move_to_tail" drivers/input/keyboard/gpio_keys.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.34.1