Re: ucsi debugfs oops (current Linus pre-6.6-rc1)

From: Dave Hansen
Date: Tue Sep 05 2023 - 15:19:49 EST


On 9/5/23 12:10, Dave Hansen wrote:
> I'm having some problems booting Linus's current tree. It seems to have
> happened in some content between commit 3f86ed6ec0b3 and df0383ffad.
>
> I'm suspecting this commit:
>
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=df0383ffad64dc09954a60873c1e202b47f08d90

The attached patch works around the problem for me and at least lets me
get booting again. I do see this in dmesg (from my patch):

[ 7.818203] no ucsi->debugfs
diff --git a/drivers/usb/typec/ucsi/debugfs.c b/drivers/usb/typec/ucsi/debugfs.c
index 0c7bf88d4a7f..f99d84165f3e 100644
--- a/drivers/usb/typec/ucsi/debugfs.c
+++ b/drivers/usb/typec/ucsi/debugfs.c
@@ -84,6 +84,14 @@ void ucsi_debugfs_register(struct ucsi *ucsi)

void ucsi_debugfs_unregister(struct ucsi *ucsi)
{
+ if (!ucsi) {
+ printk("no ucsi");
+ return;
+ }
+ if (!ucsi->debugfs) {
+ printk("no ucsi->debugfs");
+ return;
+ }
debugfs_remove_recursive(ucsi->debugfs->dentry);
kfree(ucsi->debugfs);
}