linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] usb: typec: ucsi: Check connection on resume
@ 2022-09-07 11:56 Heikki Krogerus
  2022-09-07 11:56 ` [RFC PATCH 1/2] usb: typec: ucsi: Check the " Heikki Krogerus
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Heikki Krogerus @ 2022-09-07 11:56 UTC (permalink / raw)
  To: linux-usb
  Cc: linux-kernel, grzegorz.alibozek, bastian, andrew.co, meven29,
	pchernik, jorge.cep.mart, danielmorgan, bernie,
	saipavanchitta1998, rubin, maniette, nate

Hi,

I'm sending these as an RFC first because I'm not done testing.

I made a small modification to my original proposal (in the bug
report). Now also connection during suspend should be covered.

I would appreciate if you guys could test these again. If everything
works, and the bug is fixed, let me know, and I'll add your Tested-by
tags to the patches.

thanks,

Heikki Krogerus (2):
  usb: typec: ucsi: Check the connection on resume
  usb: typec: ucsi: acpi: Add PM hooks

 drivers/usb/typec/ucsi/ucsi.c      | 42 +++++++++++++++++++++---------
 drivers/usb/typec/ucsi/ucsi_acpi.c | 15 +++++++++++
 2 files changed, 44 insertions(+), 13 deletions(-)

-- 
2.35.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [RFC PATCH 1/2] usb: typec: ucsi: Check the connection on resume
  2022-09-07 11:56 [RFC PATCH 0/2] usb: typec: ucsi: Check connection on resume Heikki Krogerus
@ 2022-09-07 11:56 ` Heikki Krogerus
  2022-09-07 11:56 ` [RFC PATCH 2/2] usb: typec: ucsi: acpi: Add PM hooks Heikki Krogerus
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Heikki Krogerus @ 2022-09-07 11:56 UTC (permalink / raw)
  To: linux-usb
  Cc: linux-kernel, grzegorz.alibozek, bastian, andrew.co, meven29,
	pchernik, jorge.cep.mart, danielmorgan, bernie,
	saipavanchitta1998, rubin, maniette, nate

This fixes an issue where the partner device is not unregistered
properly after resume if it's unplugged during suspend.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=210425
Fixes: a94ecde41f7e ("usb: typec: ucsi: ccg: enable runtime pm support")
Cc: <stable@vger.kernel.org>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 drivers/usb/typec/ucsi/ucsi.c | 42 ++++++++++++++++++++++++-----------
 1 file changed, 29 insertions(+), 13 deletions(-)

diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index 7f2624f427241..33e1cee9dc184 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -183,16 +183,6 @@ int ucsi_send_command(struct ucsi *ucsi, u64 command,
 }
 EXPORT_SYMBOL_GPL(ucsi_send_command);
 
-int ucsi_resume(struct ucsi *ucsi)
-{
-	u64 command;
-
-	/* Restore UCSI notification enable mask after system resume */
-	command = UCSI_SET_NOTIFICATION_ENABLE | ucsi->ntfy;
-
-	return ucsi_send_command(ucsi, command, NULL, 0);
-}
-EXPORT_SYMBOL_GPL(ucsi_resume);
 /* -------------------------------------------------------------------------- */
 
 struct ucsi_work {
@@ -746,6 +736,7 @@ static void ucsi_partner_change(struct ucsi_connector *con)
 
 static int ucsi_check_connection(struct ucsi_connector *con)
 {
+	u8 prev_flags = con->status.flags;
 	u64 command;
 	int ret;
 
@@ -756,10 +747,13 @@ static int ucsi_check_connection(struct ucsi_connector *con)
 		return ret;
 	}
 
+	if (con->status.flags == prev_flags)
+		return 0;
+
 	if (con->status.flags & UCSI_CONSTAT_CONNECTED) {
-		if (UCSI_CONSTAT_PWR_OPMODE(con->status.flags) ==
-		    UCSI_CONSTAT_PWR_OPMODE_PD)
-			ucsi_partner_task(con, ucsi_check_altmodes, 30, 0);
+		ucsi_register_partner(con);
+		ucsi_pwr_opmode_change(con);
+		ucsi_partner_change(con);
 	} else {
 		ucsi_partner_change(con);
 		ucsi_port_psy_changed(con);
@@ -1280,6 +1274,28 @@ static int ucsi_init(struct ucsi *ucsi)
 	return ret;
 }
 
+int ucsi_resume(struct ucsi *ucsi)
+{
+	struct ucsi_connector *con;
+	u64 command;
+	int ret;
+
+	/* Restore UCSI notification enable mask after system resume */
+	command = UCSI_SET_NOTIFICATION_ENABLE | ucsi->ntfy;
+	ret = ucsi_send_command(ucsi, command, NULL, 0);
+	if (ret < 0)
+		return ret;
+
+	for (con = ucsi->connector; con->port; con++) {
+		mutex_lock(&con->lock);
+		ucsi_check_connection(con);
+		mutex_unlock(&con->lock);
+	}
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(ucsi_resume);
+
 static void ucsi_init_work(struct work_struct *work)
 {
 	struct ucsi *ucsi = container_of(work, struct ucsi, work.work);
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [RFC PATCH 2/2] usb: typec: ucsi: acpi: Add PM hooks
  2022-09-07 11:56 [RFC PATCH 0/2] usb: typec: ucsi: Check connection on resume Heikki Krogerus
  2022-09-07 11:56 ` [RFC PATCH 1/2] usb: typec: ucsi: Check the " Heikki Krogerus
@ 2022-09-07 11:56 ` Heikki Krogerus
  2022-09-07 21:33 ` [RFC PATCH 0/2] usb: typec: ucsi: Check connection on resume Grzegorz Alibożek
  2022-09-08  5:01 ` Bastian Rieck
  3 siblings, 0 replies; 9+ messages in thread
From: Heikki Krogerus @ 2022-09-07 11:56 UTC (permalink / raw)
  To: linux-usb
  Cc: linux-kernel, grzegorz.alibozek, bastian, andrew.co, meven29,
	pchernik, jorge.cep.mart, danielmorgan, bernie,
	saipavanchitta1998, rubin, maniette, nate

Some systems notify the driver separately after resume if
the state of the connection changed during suspend, but
there is no way we can rely on that.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=210425
Fixes: a94ecde41f7e ("usb: typec: ucsi: ccg: enable runtime pm support")
Cc: <stable@vger.kernel.org>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 drivers/usb/typec/ucsi/ucsi_acpi.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/usb/typec/ucsi/ucsi_acpi.c b/drivers/usb/typec/ucsi/ucsi_acpi.c
index 8873c1644a295..8c7008cc9942e 100644
--- a/drivers/usb/typec/ucsi/ucsi_acpi.c
+++ b/drivers/usb/typec/ucsi/ucsi_acpi.c
@@ -185,6 +185,20 @@ static int ucsi_acpi_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static int ucsi_acpi_suspend(struct device *dev)
+{
+	return 0;
+}
+
+static int ucsi_acpi_resume(struct device *dev)
+{
+	struct ucsi_acpi *ua = dev_get_drvdata(dev);
+
+	return ucsi_resume(ua->ucsi);
+}
+
+static DEFINE_SIMPLE_DEV_PM_OPS(ucsi_acpi_pm_ops, ucsi_acpi_suspend, ucsi_acpi_resume);
+
 static const struct acpi_device_id ucsi_acpi_match[] = {
 	{ "PNP0CA0", 0 },
 	{ },
@@ -194,6 +208,7 @@ MODULE_DEVICE_TABLE(acpi, ucsi_acpi_match);
 static struct platform_driver ucsi_acpi_platform_driver = {
 	.driver = {
 		.name = "ucsi_acpi",
+		.pm = pm_ptr(&ucsi_acpi_pm_ops),
 		.acpi_match_table = ACPI_PTR(ucsi_acpi_match),
 	},
 	.probe = ucsi_acpi_probe,
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [RFC PATCH 0/2] usb: typec: ucsi: Check connection on resume
  2022-09-07 11:56 [RFC PATCH 0/2] usb: typec: ucsi: Check connection on resume Heikki Krogerus
  2022-09-07 11:56 ` [RFC PATCH 1/2] usb: typec: ucsi: Check the " Heikki Krogerus
  2022-09-07 11:56 ` [RFC PATCH 2/2] usb: typec: ucsi: acpi: Add PM hooks Heikki Krogerus
@ 2022-09-07 21:33 ` Grzegorz Alibożek
  2022-09-08  5:01 ` Bastian Rieck
  3 siblings, 0 replies; 9+ messages in thread
From: Grzegorz Alibożek @ 2022-09-07 21:33 UTC (permalink / raw)
  To: linux-usb, Heikki Krogerus
  Cc: linux-kernel, bastian, andrew.co, meven29, pchernik,
	jorge.cep.mart, danielmorgan, bernie, saipavanchitta1998, rubin,
	maniette, nate

Hi,
> Hi,
> 
> I'm sending these as an RFC first because I'm not done testing.
> 
> I made a small modification to my original proposal (in the bug
> report). Now also connection during suspend should be covered.
> 
> I would appreciate if you guys could test these again. If everything
> works, and the bug is fixed, let me know, and I'll add your Tested-by
> tags to the patches.
> 
> thanks,
> 
> Heikki Krogerus (2):
>   usb: typec: ucsi: Check the connection on resume
>   usb: typec: ucsi: acpi: Add PM hooks
> 
>  drivers/usb/typec/ucsi/ucsi.c      | 42 +++++++++++++++++++++---------
>  drivers/usb/typec/ucsi/ucsi_acpi.c | 15 +++++++++++
>  2 files changed, 44 insertions(+), 13 deletions(-)

I have tested this patch on Lenovo T14 Gen2i with ac adapter and everything 
looks good. I applied patch on linux 5.19.7.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC PATCH 0/2] usb: typec: ucsi: Check connection on resume
  2022-09-07 11:56 [RFC PATCH 0/2] usb: typec: ucsi: Check connection on resume Heikki Krogerus
                   ` (2 preceding siblings ...)
  2022-09-07 21:33 ` [RFC PATCH 0/2] usb: typec: ucsi: Check connection on resume Grzegorz Alibożek
@ 2022-09-08  5:01 ` Bastian Rieck
  2022-09-09  6:22   ` Heikki Krogerus
  3 siblings, 1 reply; 9+ messages in thread
From: Bastian Rieck @ 2022-09-08  5:01 UTC (permalink / raw)
  To: linux-usb, Heikki Krogerus
  Cc: linux-kernel, grzegorz.alibozek, andrew.co, meven29, pchernik,
	jorge.cep.mart, danielmorgan, bernie, saipavanchitta1998, rubin,
	maniette, nate

[-- Attachment #1: Type: text/plain, Size: 1114 bytes --]

Dear Heikki,

> I'm sending these as an RFC first because I'm not done testing.
> 
> I made a small modification to my original proposal (in the bug
> report). Now also connection during suspend should be covered.
> 
> I would appreciate if you guys could test these again. If
> everything works, and the bug is fixed, let me know, and I'll add
> your Tested-by tags to the patches.
>

Thanks so much for these changes—that's awesome! I have just finished 
testing this against 5.19.7 (Arch Linux) with a Lenovo X1 (Gen 9).

I am very happy to see that, as far as I can tell, the issue 
disappeared completely!

However, I am receiving additional warnings via `journalctl` that I 
did not receive before; I have attached this trace as an additional 
log file. Nothing in there seems critical and I can confirm that the 
system continues to operate normally. I merely wanted to provide you 
with this additional information in case it is of relevance.

Please let me know if there's anything else I can do here; I really 
appreciate the time you spent on this!

All the best,
  Bastian

[-- Attachment #2: trace.log --]
[-- Type: text/x-log, Size: 6554 bytes --]

ep 08 06:41:34 nimue kernel: ------------[ cut here ]------------
Sep 08 06:41:34 nimue kernel: WARNING: CPU: 0 PID: 448 at kernel/module/main.c:849 module_put+0x8f/0xa0
Sep 08 06:41:34 nimue kernel: Modules linked in: r8153_ecm cdc_ether usbnet r8152 mii typec_displayport rfcomm snd_ctl_led snd_soc_skl_hda_dsp snd_soc_intel_hda_dsp_common snd_soc_hdac_hdmi snd_sof_probes snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_soc_dmic snd_sof_pci_intel_tgl snd_sof_intel_hda_common soundwire_intel soundwire_generic_allocation ccm soundwire_cadence snd_sof_intel_hda algif_aead snd_sof_pci snd_sof_xtensa_dsp des_generic libdes snd_sof ecb snd_sof_utils algif_skcipher snd_soc_hdac_hda snd_hda_ext_core snd_soc_acpi_intel_match cmac snd_soc_acpi soundwire_bus md4 algif_hash bnep snd_soc_core af_alg snd_compress joydev mousedev intel_tcc_cooling iwlmvm ac97_bus x86_pkg_temp_thermal snd_pcm_dmaengine intel_powerclamp coretemp hid_multitouch mac80211 snd_hda_intel iTCO_wdt pmt_telemetry intel_pmc_bxt snd_intel_dspcfg kvm_intel spi_nor snd_intel_sdw_acpi libarc4 iTCO_vendor_support mtd mei_hdcp mei_pxp intel_rapl_msr pmt_class think_lmi snd_hda_codec iwlwifi
Sep 08 06:41:34 nimue kernel:  firmware_attributes_class wmi_bmof kvm snd_hda_core irqbypass intel_cstate intel_uncore pcspkr uvcvideo psmouse iwlmei snd_hwdep vfat i2c_i801 spi_intel_pci videobuf2_vmalloc fat snd_pcm btusb spi_intel i2c_smbus videobuf2_memops intel_lpss_pci btrtl snd_timer btbcm mei_me cfg80211 intel_lpss videobuf2_v4l2 btintel idma64 videobuf2_common btmtk mei videodev mc bluetooth processor_thermal_device_pci_legacy processor_thermal_device processor_thermal_rfim ecdh_generic processor_thermal_mbox crc16 thunderbolt intel_vsec thinkpad_acpi processor_thermal_rapl ucsi_acpi intel_rapl_common ledtrig_audio typec_ucsi platform_profile igen6_edac intel_soc_dts_iosf typec rfkill roles snd wmi soundcore int3403_thermal soc_button_array int340x_thermal_zone i2c_hid_acpi i2c_hid essiv authenc mac_hid intel_hid int3400_thermal acpi_pad sparse_keymap acpi_thermal_rel acpi_tad pkcs8_key_parser crypto_user fuse bpf_preload ip_tables x_tables btrfs blake2b_generic libcrc32c crc32c_generic xor
Sep 08 06:41:34 nimue kernel:  raid6_pq dm_crypt cbc encrypted_keys trusted asn1_encoder tee tpm rng_core dm_mod serio_raw crct10dif_pclmul atkbd crc32_pclmul crc32c_intel libps2 ghash_clmulni_intel vivaldi_fmap nvme aesni_intel crypto_simd cryptd nvme_core xhci_pci xhci_pci_renesas i8042 serio i915 intel_gtt drm_buddy video drm_display_helper cec ttm
Sep 08 06:41:34 nimue kernel: Unloaded tainted modules: pcc_cpufreq():1 acpi_cpufreq():1 acpi_cpufreq():1 acpi_cpufreq():1 acpi_cpufreq():1 pcc_cpufreq():1 acpi_cpufreq():1 pcc_cpufreq():1 acpi_cpufreq():1 pcc_cpufreq():1 acpi_cpufreq():1 acpi_cpufreq():1 acpi_cpufreq():1 pcc_cpufreq():1 acpi_cpufreq():1 pcc_cpufreq():1 pcc_cpufreq():1 acpi_cpufreq():1 acpi_cpufreq():1 pcc_cpufreq():1 acpi_cpufreq():1 pcc_cpufreq():1 acpi_cpufreq():1 pcc_cpufreq():1 pcc_cpufreq():1 acpi_cpufreq():1 acpi_cpufreq():1 pcc_cpufreq():1 acpi_cpufreq():1 pcc_cpufreq():1 acpi_cpufreq():1 pcc_cpufreq():1 acpi_cpufreq():1 pcc_cpufreq():1 acpi_cpufreq():1 pcc_cpufreq():1 acpi_cpufreq():1 acpi_cpufreq():1 pcc_cpufreq():1 acpi_cpufreq():1 pcc_cpufreq():1 fjes():1 fjes():1 acpi_cpufreq():1 asus_ec_sensors():1 pcc_cpufreq():1 acpi_cpufreq():1 fjes():1 pcc_cpufreq():1 fjes():1 pcc_cpufreq():1 acpi_cpufreq():1 fjes():1 acpi_cpufreq():1 pcc_cpufreq():1 acpi_cpufreq():1 pcc_cpufreq():1 acpi_cpufreq():1 fjes():1 acpi_cpufreq():1
Sep 08 06:41:34 nimue kernel:  asus_ec_sensors():1 acpi_cpufreq():1 fjes():1 pcc_cpufreq():1 fjes():1 acpi_cpufreq():1
Sep 08 06:41:34 nimue kernel: CPU: 0 PID: 448 Comm: kworker/0:2 Tainted: G        W         5.19.7-arch1-1-ucsi-patch #1 7e4375cb15cb2751a8ce700399419d2870882116
Sep 08 06:41:34 nimue kernel: Hardware name: LENOVO 20XXS33A00/20XXS33A00, BIOS N32ET75W (1.51 ) 12/02/2021
Sep 08 06:41:34 nimue kernel: Workqueue: events ucsi_handle_connector_change [typec_ucsi]
Sep 08 06:41:34 nimue kernel: RIP: 0010:module_put+0x8f/0xa0
Sep 08 06:41:34 nimue kernel: Code: 0f 48 8b 40 08 48 89 fe 48 89 c7 e8 8b fa ff ff 65 ff 0d 84 05 0e 61 75 b4 e8 45 40 ec ff eb ad e8 22 40 ec ff c3 cc cc cc cc <0f> 0b eb 99 66 66 2e 0f 1f 84 00 00 00 00 00 66 90 f3 0f 1e fa 55
Sep 08 06:41:34 nimue kernel: RSP: 0018:ffffb61000487d18 EFLAGS: 00010297
Sep 08 06:41:34 nimue kernel: RAX: 0000000000000000 RBX: ffff8db49cf5b008 RCX: 0000000000000000
Sep 08 06:41:34 nimue kernel: RDX: 00000000ffffffff RSI: 0000000000000000 RDI: ffffffffc08bb180
Sep 08 06:41:34 nimue kernel: RBP: 0000000000000000 R08: ffff8db480401758 R09: ffffffffa0a51fb0
Sep 08 06:41:34 nimue kernel: R10: 0000000000000000 R11: 0000000000000000 R12: ffffffffc08bb018
Sep 08 06:41:34 nimue kernel: R13: ffff8db49cf5b088 R14: 0000000000000080 R15: ffff8db484364388
Sep 08 06:41:34 nimue kernel: FS:  0000000000000000(0000) GS:ffff8dbbbf600000(0000) knlGS:0000000000000000
Sep 08 06:41:34 nimue kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Sep 08 06:41:34 nimue kernel: CR2: 00007f2ef985a000 CR3: 00000003d7210001 CR4: 0000000000f70ef0
Sep 08 06:41:34 nimue kernel: PKRU: 55555554
Sep 08 06:41:34 nimue kernel: Call Trace:
Sep 08 06:41:34 nimue kernel:  <TASK>
Sep 08 06:41:34 nimue kernel:  typec_altmode_update_active+0x6f/0x110 [typec 4340e8e184497847e0034f471886b5beb7adb48f]
Sep 08 06:41:34 nimue kernel:  typec_remove+0xf0/0x110 [typec 4340e8e184497847e0034f471886b5beb7adb48f]
Sep 08 06:41:34 nimue kernel:  device_release_driver_internal+0x1b6/0x230
Sep 08 06:41:34 nimue kernel:  bus_remove_device+0xdc/0x150
Sep 08 06:41:34 nimue kernel:  device_del+0x18f/0x410
Sep 08 06:41:34 nimue kernel:  device_unregister+0x17/0x60
Sep 08 06:41:34 nimue kernel:  ucsi_unregister_altmodes+0x41/0xa0 [typec_ucsi 91402ff21fa7795a95552024a8006e70bdb35a49]
Sep 08 06:41:34 nimue kernel:  ucsi_handle_connector_change+0x219/0x2a0 [typec_ucsi 91402ff21fa7795a95552024a8006e70bdb35a49]
Sep 08 06:41:34 nimue kernel:  ? kfree+0x2e5/0x300
Sep 08 06:41:34 nimue kernel:  process_one_work+0x1c4/0x380
Sep 08 06:41:34 nimue kernel:  worker_thread+0x51/0x390
Sep 08 06:41:34 nimue kernel:  ? rescuer_thread+0x3b0/0x3b0
Sep 08 06:41:34 nimue kernel:  kthread+0xdb/0x110
Sep 08 06:41:34 nimue kernel:  ? kthread_complete_and_exit+0x20/0x20
Sep 08 06:41:34 nimue kernel:  ret_from_fork+0x1f/0x30
Sep 08 06:41:34 nimue kernel:  </TASK>
Sep 08 06:41:34 nimue kernel: ---[ end trace 0000000000000000 ]---


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC PATCH 0/2] usb: typec: ucsi: Check connection on resume
  2022-09-08  5:01 ` Bastian Rieck
@ 2022-09-09  6:22   ` Heikki Krogerus
  2022-09-16 10:46     ` Heikki Krogerus
  0 siblings, 1 reply; 9+ messages in thread
From: Heikki Krogerus @ 2022-09-09  6:22 UTC (permalink / raw)
  To: Bastian Rieck
  Cc: linux-usb, linux-kernel, grzegorz.alibozek, andrew.co, meven29,
	pchernik, jorge.cep.mart, danielmorgan, bernie,
	saipavanchitta1998, rubin, maniette, nate

On Thu, Sep 08, 2022 at 07:01:34AM +0200, Bastian Rieck wrote:
> Dear Heikki,
> 
> > I'm sending these as an RFC first because I'm not done testing.
> > 
> > I made a small modification to my original proposal (in the bug
> > report). Now also connection during suspend should be covered.
> > 
> > I would appreciate if you guys could test these again. If
> > everything works, and the bug is fixed, let me know, and I'll add
> > your Tested-by tags to the patches.
> >
> 
> Thanks so much for these changes—that's awesome! I have just finished 
> testing this against 5.19.7 (Arch Linux) with a Lenovo X1 (Gen 9).
> 
> I am very happy to see that, as far as I can tell, the issue 
> disappeared completely!
> 
> However, I am receiving additional warnings via `journalctl` that I 
> did not receive before; I have attached this trace as an additional 
> log file. Nothing in there seems critical and I can confirm that the 
> system continues to operate normally. I merely wanted to provide you 
> with this additional information in case it is of relevance.
> 
> Please let me know if there's anything else I can do here; I really 
> appreciate the time you spent on this!

Thank you for the report. That warning certainly needs to be sorted
out before I send the final versions. I'll try to reproduce that.

thanks,

-- 
heikki

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC PATCH 0/2] usb: typec: ucsi: Check connection on resume
  2022-09-09  6:22   ` Heikki Krogerus
@ 2022-09-16 10:46     ` Heikki Krogerus
  2022-10-07 10:00       ` Bastian Rieck
  0 siblings, 1 reply; 9+ messages in thread
From: Heikki Krogerus @ 2022-09-16 10:46 UTC (permalink / raw)
  To: Bastian Rieck
  Cc: linux-usb, linux-kernel, grzegorz.alibozek, andrew.co, meven29,
	pchernik, jorge.cep.mart, danielmorgan, bernie,
	saipavanchitta1998, rubin, maniette, nate

Hi Bastian,

On Fri, Sep 09, 2022 at 09:22:50AM +0300, Heikki Krogerus wrote:
> On Thu, Sep 08, 2022 at 07:01:34AM +0200, Bastian Rieck wrote:
> > Dear Heikki,
> > 
> > > I'm sending these as an RFC first because I'm not done testing.
> > > 
> > > I made a small modification to my original proposal (in the bug
> > > report). Now also connection during suspend should be covered.
> > > 
> > > I would appreciate if you guys could test these again. If
> > > everything works, and the bug is fixed, let me know, and I'll add
> > > your Tested-by tags to the patches.
> > >
> > 
> > Thanks so much for these changes—that's awesome! I have just finished 
> > testing this against 5.19.7 (Arch Linux) with a Lenovo X1 (Gen 9).
> > 
> > I am very happy to see that, as far as I can tell, the issue 
> > disappeared completely!
> > 
> > However, I am receiving additional warnings via `journalctl` that I 
> > did not receive before; I have attached this trace as an additional 
> > log file. Nothing in there seems critical and I can confirm that the 
> > system continues to operate normally. I merely wanted to provide you 
> > with this additional information in case it is of relevance.
> > 
> > Please let me know if there's anything else I can do here; I really 
> > appreciate the time you spent on this!
> 
> Thank you for the report. That warning certainly needs to be sorted
> out before I send the final versions. I'll try to reproduce that.

I'm not getting anywhere with this one. Could you provide me with the
trace output from both module and ucsi events?

To enable those events - assuming debugfs is mounted to
/sys/kernel/debug:

        % echo 1 > /sys/kernel/debug/tracing/events/ucsi/enable
        % echo 1 > /sys/kernel/debug/tracing/events/module/enable

Run the suspend resume cycle, and then dump the trace output to a
file:

        % cat /sys/kernel/debug/tracing/trace > ucsi_trace

thanks,

-- 
heikki

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC PATCH 0/2] usb: typec: ucsi: Check connection on resume
  2022-09-16 10:46     ` Heikki Krogerus
@ 2022-10-07 10:00       ` Bastian Rieck
  2022-10-07 10:04         ` Heikki Krogerus
  0 siblings, 1 reply; 9+ messages in thread
From: Bastian Rieck @ 2022-10-07 10:00 UTC (permalink / raw)
  To: Heikki Krogerus
  Cc: linux-usb, linux-kernel, grzegorz.alibozek, andrew.co, meven29,
	pchernik, jorge.cep.mart, danielmorgan, bernie,
	saipavanchitta1998, rubin, maniette, nate

Dear Heikki, dear all,

I am still unable to reproduce the previous error messages I 
mentioned. In the meantime, the UCSI issues disappeared with 5.19.9 
for me (!). I think this is related to a revert by Takashi Iwai  [1] 
in 5.19.8.

Given these data, would it be useful to test your patch against 
5.19.9 or a more recent version?

Thanks for all your efforts in supporting us here!

All the best,
 Bastian

[1] https://www.spinics.net/lists/linux-usb/msg230368.html

On Friday, September 16, 2022 12:46:47 PM CEST Heikki Krogerus 
wrote:
> Hi Bastian,
> 
> On Fri, Sep 09, 2022 at 09:22:50AM +0300, Heikki Krogerus wrote:
> > On Thu, Sep 08, 2022 at 07:01:34AM +0200, Bastian Rieck wrote:
> > > Dear Heikki,
> > > 
> > > > I'm sending these as an RFC first because I'm not done
> > > > testing.
> > > > 
> > > > I made a small modification to my original proposal (in the
> > > > bug
> > > > report). Now also connection during suspend should be
> > > > covered.
> > > > 
> > > > I would appreciate if you guys could test these again. If
> > > > everything works, and the bug is fixed, let me know, and
> > > > I'll add
> > > > your Tested-by tags to the patches.
> > > 
> > > Thanks so much for these changes—that's awesome! I have just
> > > finished testing this against 5.19.7 (Arch Linux) with a
> > > Lenovo X1 (Gen 9).
> > > 
> > > I am very happy to see that, as far as I can tell, the issue
> > > disappeared completely!
> > > 
> > > However, I am receiving additional warnings via `journalctl`
> > > that I did not receive before; I have attached this trace as
> > > an additional log file. Nothing in there seems critical and I
> > > can confirm that the system continues to operate normally. I
> > > merely wanted to provide you with this additional information
> > > in case it is of relevance.
> > > 
> > > Please let me know if there's anything else I can do here; I
> > > really appreciate the time you spent on this!
> > 
> > Thank you for the report. That warning certainly needs to be
> > sorted out before I send the final versions. I'll try to
> > reproduce that.
> I'm not getting anywhere with this one. Could you provide me with
> the trace output from both module and ucsi events?
> 
> To enable those events - assuming debugfs is mounted to
> /sys/kernel/debug:
> 
>         % echo 1 > /sys/kernel/debug/tracing/events/ucsi/enable
>         % echo 1 > /sys/kernel/debug/tracing/events/module/enable
> 
> Run the suspend resume cycle, and then dump the trace output to a
> file:
> 
>         % cat /sys/kernel/debug/tracing/trace > ucsi_trace
> 
> thanks,





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC PATCH 0/2] usb: typec: ucsi: Check connection on resume
  2022-10-07 10:00       ` Bastian Rieck
@ 2022-10-07 10:04         ` Heikki Krogerus
  0 siblings, 0 replies; 9+ messages in thread
From: Heikki Krogerus @ 2022-10-07 10:04 UTC (permalink / raw)
  To: Bastian Rieck
  Cc: linux-usb, linux-kernel, grzegorz.alibozek, andrew.co, meven29,
	pchernik, jorge.cep.mart, danielmorgan, bernie,
	saipavanchitta1998, rubin, maniette, nate

On Fri, Oct 07, 2022 at 12:00:16PM +0200, Bastian Rieck wrote:
> Dear Heikki, dear all,
> 
> I am still unable to reproduce the previous error messages I 
> mentioned. In the meantime, the UCSI issues disappeared with 5.19.9 
> for me (!). I think this is related to a revert by Takashi Iwai  [1] 
> in 5.19.8.
> 
> Given these data, would it be useful to test your patch against 
> 5.19.9 or a more recent version?

No need. I'm just about to resend these.

thanks,

-- 
heikki

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-10-07 10:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-07 11:56 [RFC PATCH 0/2] usb: typec: ucsi: Check connection on resume Heikki Krogerus
2022-09-07 11:56 ` [RFC PATCH 1/2] usb: typec: ucsi: Check the " Heikki Krogerus
2022-09-07 11:56 ` [RFC PATCH 2/2] usb: typec: ucsi: acpi: Add PM hooks Heikki Krogerus
2022-09-07 21:33 ` [RFC PATCH 0/2] usb: typec: ucsi: Check connection on resume Grzegorz Alibożek
2022-09-08  5:01 ` Bastian Rieck
2022-09-09  6:22   ` Heikki Krogerus
2022-09-16 10:46     ` Heikki Krogerus
2022-10-07 10:00       ` Bastian Rieck
2022-10-07 10:04         ` Heikki Krogerus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).