Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2273677pxb; Mon, 11 Jan 2021 05:46:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJzZ5ltmWy2pItshg2whH9/fgM8dQ1tk006Ev28aVN4kNiCxwz0bvvAYRWOPrW7W03Dlm8yN X-Received: by 2002:a50:8741:: with SMTP id 1mr14496281edv.349.1610372787232; Mon, 11 Jan 2021 05:46:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610372787; cv=none; d=google.com; s=arc-20160816; b=WH7ocvZm1zWk3dSvnFJ9RbNyCxyjcuaMdS4NGgDNgM2ZN02ot1bP//uvprcbpIvKvU CldUwerBxXAkUTf4hkPGhJYL0A6cTGKieLqyYVudxyEfzhx32Xo5kOEbUt3wWc39bS8A wS0ZUaaCYo3sw23SHsllYodWWuctintdh2h3tH948rI7qqlGQYZp77mkxxXUEJ5z4+EY Fm8bz3+gVM1XjCzvsASOxfZcsNO6iHwwVXtldduDbdlG6BFZKRmnqTilCKvEvrxofR7g jQ7GSusizMTOPUlhhomFRymIBkn4meOXPcbz0M0nDo4FTPAQ+lMEHB/kAcS0ZR6cZOpu GJvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=VtI56arTmvPDds1bUHvrFG9JNVtaZLCU5E2c0yjQpUo=; b=obh0wqpyJw8qeEm87qlzhjK51xHte4QlL9NtyyKIkUqm63ad/3dZ/ueZzMr0j5qISc 4yUJR6xef93eBpmJcW1xn1WfsnqK3dNSntsVNEf4pYrCMg1t0CCAGSr1ZV68LGm77hP+ JrHYPoTIhcebbu5C2TiYGQuJtIDhfC53sD/Ho511a9X78U4kBIn1jQsmcOLN7Kdb43vs 9TGCAoxxqTAIDGHRDSrujnVeP5qe6J+y+m0420M0s6C6WhpPZJGgSrYuDV6LTfaQjAZC K5U1t+MIMD1VSxbDDX8TRPcnDDWz4rRcCPAbjqPMxXnQnV7d0WQym+XiYctuOAxstlYO U4aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=B8wFtRoZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i3si6767417edj.120.2021.01.11.05.46.01; Mon, 11 Jan 2021 05:46:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=B8wFtRoZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387539AbhAKNoC (ORCPT + 99 others); Mon, 11 Jan 2021 08:44:02 -0500 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:10628 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730736AbhAKNnx (ORCPT ); Mon, 11 Jan 2021 08:43:53 -0500 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Mon, 11 Jan 2021 05:43:12 -0800 Received: from localhost (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 11 Jan 2021 13:43:12 +0000 Date: Mon, 11 Jan 2021 14:43:09 +0100 From: Thierry Reding To: Hugh Dickins CC: "Rafael J. Wysocki" , Jonathan Hunter , Saravana Kannan , "Greg Kroah-Hartman" , , Subject: Re: 5.11-rc device reordering breaks ThinkPad rmi4 suspend Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lN+kFVj2Dd+ypR5G" Content-Disposition: inline In-Reply-To: X-NVConfidentiality: public User-Agent: Mutt/2.0.3 (a51f058f) (2020-12-04) X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1610372592; bh=VtI56arTmvPDds1bUHvrFG9JNVtaZLCU5E2c0yjQpUo=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To:X-NVConfidentiality: User-Agent:X-Originating-IP:X-ClientProxiedBy; b=B8wFtRoZgODFUGcc0Xan/ISDzie6Pqg/3b8dr4v8QD47i4N435lnshuSPyNEmuV19 GQZv9taXUIKF+kjwPdSp/8/MA4SUutYE+En/EFeDjQ1fJOfKYAPsYQjlclxmv2W46R xFSgqNx3QE6ThP2T3QcIpgAPwRsekSDOMT1teBUgpGE05gJlWSHvJRJX6BlevAE75e N0bOVVdN9Qr6mZSjeeaOKA62ySUjG9ZhxdEspHkIX1tpGXhxUjgWI9JHQ4NZ45s2Qq zzrgJ87A95mgvaGuCX9RYrf14TytF8iialUNsn8UID47XRvsypNxA2nv6kTWcvHIYE zC/HR4SqNKS/w== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --lN+kFVj2Dd+ypR5G Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 10, 2021 at 08:44:13PM -0800, Hugh Dickins wrote: > Hi Rafael, >=20 > Synaptics RMI4 SMBus touchpad on ThinkPad X1 Carbon (5th generation) > fails to suspend when running 5.11-rc kernels: bisected to=20 > 5b6164d3465f ("driver core: Reorder devices on successful probe"), > and reverting that fixes it. dmesg.xz attached, but go ahead and ask > me to switch on a debug option to extract further info if that may help. Hi Hugh, Quoting what I think are the relevant parts of that log: [ 34.373742] printk: Suspending console(s) (use no_console_suspend to deb= ug) [ 34.429015] rmi4_physical rmi4-00: Failed to read irqs, code=3D-6 [ 34.474973] rmi4_f01 rmi4-00.fn01: Failed to write sleep mode: -6. [ 34.474994] rmi4_f01 rmi4-00.fn01: Suspend failed with code -6. [ 34.475001] rmi4_physical rmi4-00: Failed to suspend functions: -6 [ 34.475105] rmi4_smbus 6-002c: Failed to suspend device: -6 [ 34.475113] PM: dpm_run_callback(): rmi_smb_suspend+0x0/0x3c returns -6 [ 34.475130] PM: Device 6-002c failed to suspend: error -6 [ 34.475187] PM: Some devices failed to suspend, or early wake event dete= cted [ 34.480324] rmi4_f03 rmi4-00.fn03: rmi_f03_pt_write: Failed to write to = F03 TX register (-6). [ 34.480748] rmi4_f03 rmi4-00.fn03: rmi_f03_pt_write: Failed to write to = F03 TX register (-6). [ 34.481558] rmi4_physical rmi4-00: rmi_driver_clear_irq_bits: Failed to = change enabled interrupts! [ 34.487935] acpi LNXPOWER:02: Turning OFF [ 34.488707] acpi LNXPOWER:01: Turning OFF [ 34.489554] rmi4_physical rmi4-00: rmi_driver_set_irq_bits: Failed to ch= ange enabled interrupts! [ 34.489669] psmouse: probe of serio2 failed with error -1 [ 34.489882] OOM killer enabled. [ 34.489891] Restarting tasks ... done. [ 34.589183] PM: suspend exit [ 34.589839] PM: suspend entry (s2idle) [ 34.605884] Filesystems sync: 0.017 seconds [ 34.607594] Freezing user space processes ... (elapsed 0.006 seconds) do= ne. [ 34.613645] OOM killer disabled. [ 34.613650] Freezing remaining freezable tasks ... (elapsed 0.001 second= s) done. [ 34.615482] printk: Suspending console(s) (use no_console_suspend to deb= ug) [ 34.653097] rmi4_f01 rmi4-00.fn01: Failed to write sleep mode: -6. [ 34.653108] rmi4_f01 rmi4-00.fn01: Suspend failed with code -6. [ 34.653115] rmi4_physical rmi4-00: Failed to suspend functions: -6 [ 34.653123] rmi4_smbus 6-002c: Failed to suspend device: -6 [ 34.653129] PM: dpm_run_callback(): rmi_smb_suspend+0x0/0x3c returns -6 [ 34.653160] PM: Device 6-002c failed to suspend: error -6 [ 34.653174] PM: Some devices failed to suspend, or early wake event dete= cted [ 34.660515] OOM killer enabled. [ 34.660524] Restarting tasks ... [ 34.661456] rmi4_physical rmi4-00: rmi_driver_set_irq_bits: Failed to ch= ange enabled interrupts! [ 34.661591] psmouse: probe of serio2 failed with error -1 [ 34.669469] done. [ 34.748386] PM: suspend exit I think what might be happening here is that the offending patch causes some devices to be reordered in a way different to how they were ordered originally and the rmi4 driver currently depends on that implicit order. Interestingly one of the bugs that the offending patch fixes is similar in the failure mode but for the reverse reason: the implicit order causes suspend/resume to fail. I suspect that the underlying reason here is that rmi4 needs something in order to successfully suspend (i.e. read the IRQ status registers) that has already been suspended where it hadn't prior to the offending patch. It can't be the I2C controller itself that has been suspended, because the parent/child relationship should prevent that from happening. I'm not familiar with how exactly rmi4 works, so I'll have to do some digging to hopefully pinpoint exactly what's going wrong here. In the meantime, it would be useful to know what exactly the I2C hierarchy looks like. For example, what's the I2C controller that the RMI4 device is hooked up to. According to the above, that's I2C bus 6, so you should be able to find out some details about it by inspecting the corresponding sysfs nodes: $ ls -l /sys/class/i2c-adapter/i2c-6/ $ cat /sys/class/i2c-adapter/i2c-6/name $ ls -l /sys/class/i2c-adapter/i2c-6/device/ Thierry --lN+kFVj2Dd+ypR5G Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAl/8VesACgkQ3SOs138+ s6Ft5Q/9HcqSA6B75qme4KuUeNVezjsP1jchYDUCdqNDWup+tyCiGQBWBxfq/lZ5 ggDpCzIS5aDv/awCwet/qzm5M8b5a4NJyZ3mEX91tcOaYa4Ah2TVwqgg0e0GOhad xpM2VSfnymZOdXiF8zGzs9h1tYyy3P6HY0cKWNY96qu6DX87E1YDg98rEtPmX32Q YcvD1xJMtwZFj1hP1VF2v5niQjFQge98sWR+X6oxaqnp4X6JOwQD9m+qGqDORbGX ApuB9sUs3HA7kYGQ+jjDJONLIyJipW5sK4b2U6rC7M5GRTZ++WxrtR8dn5YBjRYh Isj6OFUccKM35tAUBFmygbA1FXpJaylYJxocOowEwIRFlkCoWCx4LPu0DDfcM0nw m7H3Ygt7VM2hM10K+z6iGUGEGmjBbK9p0jsu5GNz5rvKwb2fBJ1C1NPp0hIxscKc PyPOfoVuiMeyaGNq1tLzxloSuCViQXpTrjdA05TUmBBq4YIIycD6DO0dZ2AFiL3h 0AE1SwLmeOLYs4ELf3QbMoETvNoFinPYjzba9c4cmV56ZFLPngKQRTtdGvfxHXC7 iox6O48PudVOZrZlMDUJKMHsDj9WFWDFtTaEbxSMAzVU0AyEtsk/lTCqmWOc8yHF i7Ta5ZR7rOnDhqGcbwMOPTd4232s1Lcv/mRmphYIYlqt/W5h88E= =Spe+ -----END PGP SIGNATURE----- --lN+kFVj2Dd+ypR5G--