Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5564876pxb; Mon, 14 Feb 2022 02:04:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJzx48r0l4waySLpDqv6v5WfuSm9+cnQHsi8kqdwsDi3JH3YVk0tR3qtcXtXpdJMWeRHa68P X-Received: by 2002:a17:907:97d0:: with SMTP id js16mr10806682ejc.67.1644833095220; Mon, 14 Feb 2022 02:04:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644833095; cv=none; d=google.com; s=arc-20160816; b=APa88TUG/Jr1z/z0QkShU7npkXEYYRAhN/nxJn3/W83SyBjgpaynYzZ6XWVuhsbXol B6vS0CK2+WYuMu7UznGYGrSwbHYlqYNIAiSIrEOh297JVYRgGez14Hn/XFa8UAc14QDW Ksk+JKRCcUdzMkqsdULohHLMAKUS9l4FKiwmNx/sp+/B4hrOzMv3wpkp02i5uyEvEVaH artv5nUCICNBctzGzDq35kUxB9+s19MzFg6s0jleyIi44+HVAlvnv0sDcUw9xLlIAFdc z117+jAHMCx/cSEFm8SVQnXilT1BPjlM9mAIEfXzU1tpCvxRYL1VapP8D0Q0XcWMhy2a DCmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=gPLN3t4GWJps2sZsL0ZhCY1w6K+/NAS9stc8kPi4Oek=; b=UyBiObtMyC6OPMhvDwHOa16B5Z72/U5uZDyPbqnsb/qyZ/ZWl8Snv/62YadVGuFFEv Kle0lh7UThvFLpAESl2M4R709BK1hYK0lDvX55sF/qd8EQ/1cYDC27TzWr++ot+3enjk 0gxiFi7os5R+VIQe8NthobnPwpLETG8O8zu1pKWvnetn3GzuY+1Cye03lwYLW5SiD3Oj VvOTQN2V88SU4Q4BZtIuwMB0o0ee1B5z4Ihzoa2FDkON8mSJuWqnO4Dso1uU9YpEOFRg Q7t6z1VWSEHuaMg4dtrB8Krpzs4mfGD60PwRUCJjdvdD8RiWgrAHlCIJfcwqvYOZp4pm RQ5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MBDsZDMW; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v8si19913717ejv.536.2022.02.14.02.04.31; Mon, 14 Feb 2022 02:04:55 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=MBDsZDMW; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242541AbiBNI54 (ORCPT + 99 others); Mon, 14 Feb 2022 03:57:56 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:52786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242531AbiBNI5y (ORCPT ); Mon, 14 Feb 2022 03:57:54 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DE2615F8F9 for ; Mon, 14 Feb 2022 00:57:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644829066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gPLN3t4GWJps2sZsL0ZhCY1w6K+/NAS9stc8kPi4Oek=; b=MBDsZDMWjuuGgJr+T46Jn5qlP5fUGEmMXk80VtzUFQ2vgTLoHJjtawMQ6yWazdGv6L2tn1 AJe9SXn7asX4Xth5WyF7RDc7yKNkb2hkQouL212WsXIZE43oU9A5ttnQgaDG/cfhDs+G6E a4b7kbjoKtb8tRoK/qtJJ1jigy8XuOI= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-139-nz6GHrX_MvS-dNAvt4tgBw-1; Mon, 14 Feb 2022 03:57:44 -0500 X-MC-Unique: nz6GHrX_MvS-dNAvt4tgBw-1 Received: by mail-ed1-f71.google.com with SMTP id f9-20020a056402354900b0040fb9c35a02so9848294edd.18 for ; Mon, 14 Feb 2022 00:57:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=gPLN3t4GWJps2sZsL0ZhCY1w6K+/NAS9stc8kPi4Oek=; b=N89YPq7SHp3PUmq9DIjvtk8UaJGOInWb5A9s4HCWRhRKgzjxoLu22xOu74hXsRn4Wx ajziXdRffA2OPSMsY9sd73rTRGMli+o5nfdUUnII2GHEe1Vm56GiasIwlnx3+hWPaXse 7B59gmrHu8Y2DRh895S8ha2a3ORJI2vtv+LaLjSgBFVXKjv/DBCOcNB3GYsdJ9esWany OF2vE8nXmDI2j7m8awlu198nh9gYT38X7x1sH36aP8OJ9QDZ+3P7BOLv4brqMJAax8M2 YyuukGr7P1AMqFJHYHtRZN28rYPDehabKlc5vD2z0FhmvyjIfpuEkAplWC6LVHRr1wTg PGbA== X-Gm-Message-State: AOAM53157MGVljeYWsGtL2wT3pOmnncmMwLsM6pynwQvUjQFCs9ZkLp9 wmRydR+gfJK1J360YsJposLqCKplYazjh66fH0P4xZ/h4sf/Rwj8KoF0hQhqy7yVklmqq3sk64K GVD3iPud5GhO6fe3plismlU+a X-Received: by 2002:a17:906:77dc:: with SMTP id m28mr9013483ejn.408.1644829063558; Mon, 14 Feb 2022 00:57:43 -0800 (PST) X-Received: by 2002:a17:906:77dc:: with SMTP id m28mr9013471ejn.408.1644829063285; Mon, 14 Feb 2022 00:57:43 -0800 (PST) Received: from [10.40.98.142] ([78.108.130.194]) by smtp.gmail.com with ESMTPSA id p16sm4987870ejn.54.2022.02.14.00.57.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Feb 2022 00:57:42 -0800 (PST) Message-ID: <302db75c-8f5a-13af-42e7-6a47863ccefd@redhat.com> Date: Mon, 14 Feb 2022 09:57:41 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: 5.17-rc regression: rmi4 clients cannot deal with asynchronous suspend? (was: X1 Carbon touchpad not resumed) Content-Language: en-US To: Dmitry Torokhov , Jarkko Nikula , Benjamin Tissoires Cc: Hugh Dickins , Rajat Jain , Wolfram Sang , Derek Basehore , Thorsten Leemhuis , Linux Kernel Mailing List , linux-i2c , "loic.poulain@linaro.org" , Andrew Duggan , vincent.huang@tw.synaptics.com, cheiny@synaptics.com, "Rafael J. Wysocki" , linux-input References: <89456fcd-a113-4c82-4b10-a9bcaefac68f@google.com> <6f1103af-595c-ed0a-b946-97a9331ed148@linux.intel.com> From: Hans de Goede In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,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 Hi All, On 2/14/22 03:31, Dmitry Torokhov wrote: > Hi Hugh, Jarkko, > > On Tue, Feb 08, 2022 at 04:57:53PM +0200, Jarkko Nikula wrote: >> Hi >> >> On 2/8/22 04:50, Hugh Dickins wrote: >>> On Mon, 7 Feb 2022, Dmitry Torokhov wrote: >>>> On Mon, Feb 07, 2022 at 01:41:36PM -0800, Rajat Jain wrote: >>>>>>>> Bisection led to 172d931910e1db800f4e71e8ed92281b6f8c6ee2 >>>>>>>> ("i2c: enable async suspend/resume on i2c client devices") >>>>>>>> and reverting that fixes it for me. >>>>>>> >>>>>>> Thank you for the report plus bisection and sorry for the regression! >>>>>> >>>>>> +1, Thanks for the bisection, and apologies for the inconveniences. >>>>>> >>>>>> The problem here seems to be that for some reason, some devices (all >>>>>> connected to rmi4 adapter) failed to resume, but only when >>>>>> asynchronous suspend is enabled (by 172d931910e1): >>>>>> >>>>>> [ 79.221064] rmi4_smbus 6-002c: failed to get SMBus version number! >>>>>> [ 79.265074] rmi4_physical rmi4-00: rmi_driver_reset_handler: Failed >>>>>> to read current IRQ mask. >>>>>> [ 79.308330] rmi4_f01 rmi4-00.fn01: Failed to restore normal operation: -6. >>>>>> [ 79.308335] rmi4_f01 rmi4-00.fn01: Resume failed with code -6. >>>>>> [ 79.308339] rmi4_physical rmi4-00: Failed to suspend functions: -6 >>>>>> [ 79.308342] rmi4_smbus 6-002c: Failed to resume device: -6 >>>>>> [ 79.351967] rmi4_physical rmi4-00: Failed to read irqs, code=-6 >>>>>> >> >> v5.17-rc3 on Lenovo ThinkPad X1 Carbon 8th don't even suspend due the same >> commit 172d931910e1. Sadly I tested the original patch on other machine(s) >> but not on this one with rmi4 :-( >> >> [ 39.957293] PM: suspend entry (s2idle) >> [ 40.938666] Filesystems sync: 0.980 seconds >> [ 40.942751] Freezing user space processes ... (elapsed 0.001 seconds) >> done. >> [ 40.945511] OOM killer disabled. >> [ 40.946111] Freezing remaining freezable tasks ... (elapsed 0.001 >> seconds) done. >> [ 40.948590] printk: Suspending console(s) (use no_console_suspend to >> debug) >> [ 40.993123] i801_smbus 0000:00:1f.4: No response >> [ 40.993218] rmi4_f01 rmi4-00.fn01: Failed to write sleep mode: -6. >> [ 40.993232] rmi4_f01 rmi4-00.fn01: Suspend failed with code -6. >> [ 40.993241] rmi4_physical rmi4-00: Failed to suspend functions: -6 >> [ 40.993404] rmi4_smbus 1-002c: Failed to suspend device: -6 >> [ 40.993414] PM: dpm_run_callback(): rmi_smb_suspend+0x0/0x30 [rmi_smbus] >> returns -6 >> [ 40.993438] rmi4_smbus 1-002c: PM: failed to suspend async: error -6 >> [ 41.014198] PM: Some devices failed to suspend, or early wake event >> detected >> [ 41.021544] i801_smbus 0000:00:1f.4: No response >> [ 41.021612] rmi4_f03 rmi4-00.fn03: rmi_f03_pt_write: Failed to write to >> F03 TX register (-6). >> [ 41.022189] i801_smbus 0000:00:1f.4: No response >> [ 41.022230] rmi4_f03 rmi4-00.fn03: rmi_f03_pt_write: Failed to write to >> F03 TX register (-6). >> [ 41.023480] i801_smbus 0000:00:1f.4: No response >> [ 41.023542] rmi4_physical rmi4-00: rmi_driver_clear_irq_bits: Failed to >> change enabled interrupts! >> [ 41.033850] i801_smbus 0000:00:1f.4: No response >> [ 41.034006] OOM killer enabled. >> [ 41.035449] i801_smbus 0000:00:1f.4: No response >> [ 41.035722] Restarting tasks ... >> [ 41.036705] rmi4_physical rmi4-00: rmi_driver_set_irq_bits: Failed to >> change enabled interrupts! >> [ 41.038367] done. >> [ 41.039003] psmouse: probe of serio2 failed with error -1 >> [ 41.071700] PM: suspend exit > > Sorry for the delay, but I wonder if you could try the patch below and > tell me if that also fixes the issue for you? > > Also adding Hans as to make sure changes to psmouse_smbus make sense to > him. I'm not really familiar with the whole psmouse intertouch code. I've added Benjamin Tissoires to the Cc who knows this code a lot better then I do. Regards, Hans > diff --git a/drivers/input/mouse/psmouse-smbus.c b/drivers/input/mouse/psmouse-smbus.c > index a472489ccbad..164f6c757f6b 100644 > --- a/drivers/input/mouse/psmouse-smbus.c > +++ b/drivers/input/mouse/psmouse-smbus.c > @@ -75,6 +75,8 @@ static void psmouse_smbus_detach_i2c_client(struct i2c_client *client) > "Marking SMBus companion %s as gone\n", > dev_name(&smbdev->client->dev)); > smbdev->dead = true; > + device_link_remove(&smbdev->client->dev, > + &smbdev->psmouse->ps2dev.serio->dev); > serio_rescan(smbdev->psmouse->ps2dev.serio); > } else { > list_del(&smbdev->node); > @@ -174,6 +176,8 @@ static void psmouse_smbus_disconnect(struct psmouse *psmouse) > kfree(smbdev); > } else { > smbdev->dead = true; > + device_link_remove(&smbdev->client->dev, > + &psmouse->ps2dev.serio->dev); > psmouse_dbg(smbdev->psmouse, > "posting removal request for SMBus companion %s\n", > dev_name(&smbdev->client->dev)); > @@ -270,6 +274,12 @@ int psmouse_smbus_init(struct psmouse *psmouse, > > if (smbdev->client) { > /* We have our companion device */ > + if (!device_link_add(&smbdev->client->dev, > + &psmouse->ps2dev.serio->dev, > + DL_FLAG_STATELESS)) > + psmouse_warn(psmouse, > + "failed to set up link with iSMBus companion %s\n", > + dev_name(&smbdev->client->dev)); > return 0; > } > >