From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B9D23A1E9A for ; Tue, 30 Dec 2025 11:26:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767094004; cv=none; b=c4UzTwFrqagsujXzagNKuuK5WB2knwvHuXWn6W5cLud2z+vIEeN0ThGrWqOeNneQ18alm0bWh+dGqr5/caGMyk3X8VkwdpI9pdHvPefX630Xv4OPvNNrdTKGeubrDlYb/Zv+9rpDlpsH6QqtxT37YxfEnOZqTDQM1weT0jDz8f0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767094004; c=relaxed/simple; bh=KYfxjXq9J6AVt3eKknhB4OWOV8+O4kCM2eoYg1/0q9M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZY9/YjupSLnT7TcLlLkmc5iD0gykVMbpS5ugPgHTGda6J1hFy60M9bI6J6VyVOixZr/U3U2I8FYCwPX1z5ihwfuJXWZ0U2mava9PRU4vWf5VRDsCyaMiq11OjeTq6XKgVD/jELzzwSqQAPDLcPxY/+yUkmC4lWY6yD3CeeoicM0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=kz9vZYLS; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="kz9vZYLS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1767094002; x=1798630002; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=KYfxjXq9J6AVt3eKknhB4OWOV8+O4kCM2eoYg1/0q9M=; b=kz9vZYLS7zKm6qx9LGPwyaW7YVTj5emrwZP1xFpDbwxEO4melFB8vjSQ 5g4u4me3ONlYomQ2lkz79demM968iGbj9cnOxdfJdS0G4fQAhhas2JC6t ExqB91hnOpFUINDQXVpainVDJzRPcg+s3lqbdskrCnfOHYF4g0Q/xUSdK DOABSL2smPDESfcrz7baI7MzEZtsuf6/PMPecTm/CnAPoXPZ05EnzG7wj y5R7VZgK0cyPHEcbh77f9zZP5ou5qBMS1HX0sHNoSR+oa68XIUuW88FkG 2Km+aFDDoLi3mZ4nxwtKpoAPEl1c/A3yillkLYnO/FKat0p7M5uXBPv0I Q==; X-CSE-ConnectionGUID: 63MMEJVLQWCwjoGiJS9mLA== X-CSE-MsgGUID: rh4Lk3FhSIa2rE868QmF2Q== X-IronPort-AV: E=McAfee;i="6800,10657,11656"; a="68574727" X-IronPort-AV: E=Sophos;i="6.21,188,1763452800"; d="scan'208";a="68574727" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Dec 2025 03:26:42 -0800 X-CSE-ConnectionGUID: yUBeaH2sQiGGK28linQH1A== X-CSE-MsgGUID: 6zgjnLlITHe3zah+Qn74LQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,188,1763452800"; d="scan'208";a="201665824" Received: from egrumbac-mobl6.ger.corp.intel.com (HELO localhost) ([10.245.245.103]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Dec 2025 03:26:40 -0800 Date: Tue, 30 Dec 2025 13:26:37 +0200 From: Andy Shevchenko To: Diederik de Haas Cc: Michael Wu , myungjoo.ham@samsung.com, cw00.choi@samsung.com, linux-kernel@vger.kernel.org, Dragan Simic , linux-rockchip@lists.infradead.org Subject: Re: [PATCH v3] extcon: Fixed sysfs duplicate filename issue Message-ID: References: <20251024024946.16618-1-michael@allwinnertech.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo On Tue, Dec 30, 2025 at 12:31:17AM +0100, Diederik de Haas wrote: > On Sun Dec 28, 2025 at 6:26 PM CET, Andy Shevchenko wrote: > > On Sun, Dec 28, 2025 at 12:01:54PM +0100, Diederik de Haas wrote: > >> On Sat Dec 27, 2025 at 4:08 PM CET, Andy Shevchenko wrote: > >> > On Sun, Dec 21, 2025 at 03:01:11PM +0100, Diederik de Haas wrote: > >> >> On Fri Oct 24, 2025 at 4:49 AM CEST, Michael Wu wrote: > >> >> > With current extcon_dev_unregister() timing, ida_free is before > >> >> > device_unregister(), that may cause current id re-alloc to another > >> >> > device in extcon_dev_register() context but sysfs filename path not > >> >> > removal completed yet. > >> >> > >> >> I periodically get errors like this: > >> >> > >> >> [ 7.116152] rockchip-usb2phy fe8a0000.usb2phy: error -EEXIST: failed to register extcon device > >> >> [ 7.117005] rockchip-usb2phy fe8a0000.usb2phy: probe with driver rockchip-usb2phy failed with error -17 > >> >> > >> >> This was today on a NanoPi R5S (rk3568), but I have seen it before and > >> >> on multiple devices. They are all Rockchip based, but that's (quite) > >> >> possible because that's what I use the most (and where I pay quite a bit > >> >> of attention to dmesg). > >> >> > >> >> Slightly fuller dmesg output of the above error is here: > >> >> https://paste.sr.ht/~diederik/42c6b3405386c823cd9f837d73a9a32e810361be > >> >> And via 'journalctl' I hopefully got the full dmesg output: > >> >> https://paste.sr.ht/~diederik/7a6109115b1ad85290de482db091dad3759ec159 > >> >> > >> >> Here are 2 similar logs, this time on PineTab2 and Quartz64-A (both rk3566) > >> >> https://paste.sr.ht/~diederik/cfe606801d3dab0267bea7049687d24c0d6e8d71 > >> >> > >> >> Those are all the logs I have saved, but it has happened several times > >> >> besides that. But most times I just rebooted and didn't save the log. > >> >> Today I looked a bit further, found commit 7bba9e81a6fb, searched on > >> >> lore.k.o and found this patch. > >> >> > >> >> So I'm wondering whether this patch would also fix 'my' issue? > >> >> Or is this a different issue? > >> > > >> > But have you had a chance to test it? The code looks correct after this patch > >> > as the first we remove the struct device and all associated data (including > >> > sysfs nodes) and then remove the ID from the list. Without that there is a > >> > window to get the same id for the devices that is pending to be removed. > >> > >> I've build a kernel with it and it will be part of my kernels going > >> forward. But it can take many months before the issue shows up again. > >> So if I don't get it in a year, then I'm going to *assume* it's probably > >> fixed. > > > > I believe you may speed up the test case by creating two shell scripts that > > trying insmod / rmmod the same module in parallel. > > I checked on several devices and the phy_rockchip_inno_usb2 module is > used by various other modules on all of them, so I can't just 'rmmod' it. > I guess it should technically be possible to remove all its dependencies > and then remove that module. I don't know if my skills are sufficient > for that and it feels like I'm mostly testing the robustness of the USB > subsystem. > > As I regularly already get the following kernel warning > ``Warning! ehci_hcd should always be loaded before uhci_hcd and ohci_hcd, not after`` > which often results in USB 2 ports not working, I have my doubts about > the robustness anyway. This is interesting issue, have you reported it to USB people (such as Alan Stern)? > So I'll just keep an eye out if the ``sysfs: cannot create duplicate > filename`` error pops up again 'naturally' and report if/when it does. Good, please monitor it and try to collect logs for the further investigations, if required. -- With Best Regards, Andy Shevchenko