From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=192.198.163.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796413648; b=PpUkEMNWHB0rS9Sby83SK8CeSddGiCtW3ADfd2+ykgUXEAFJ/yqPniHaLFpb8+oFhU/x WZ+ZlxOUhpA+GMrF7Ju5Hf59bc/QE0csjGXGaaX5AWtJkMx3J8J2+MOkE02v7qeHU4jEf /t298Wh/3gYodXgdUrsD7WbRHEPgGUYfonO8Q2nhsCDWl4Tn9EsmqZ07uLQIhYkq3sQMM 87uZEbxRCZfOUepv05JMt+QtskaN3IVDDs4d1IjOLUJnNIH22PEkDh/i01rQmQir9obPU uRM8UkZGzhEIqGT5qUYU7meqfi2AVUQ6Rx7kpzedwJIdqKQykZ+4NNImSkfBAibSfgA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796413648; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:Organization; bh=6Fj/bZHJZZUYmbDfP0vxiwzPLbI9U6bni7hHmJSXAas=; b=mjGnoqBlZzB/0z3PAr6U7263QV+sZ1Qi8bf3pi4T1lXhOzuIFnOf1/BXNNdVgkoiqb9m BDOVp8NHEu95elDmCLluFjXs6JrpvtmvLSM/NMuC85OHAcM8ITpLkVABTXAK1fO+HhTwb FrMYl7XFdqsO6xCCnxwrYIWw/VIersi1w4sds0X4DzrlJKCWF2AjvAuTQvEMa+9XOLA3i FoSAKJNOKMshNWu/A6Or5Z/rwb5xxS+CYKuVTTZPd+hgX+O1if4Co5+RRozKdXzitDYtn WL0M5koP2tlwa2fvwxcRf7sSrrmyjkAAAdJEJv7emB3hEI61WMSevrQbIHouZ+KHc4w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=nxvc7uKG; arc=none smtp.remote-ip=192.198.163.18 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3FC23606A336; Fri, 4 Dec 2026 19:47:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3FC23606A336 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.a=rsa-sha256 header.s=Intel header.b=nxvc7uKG DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796413648; x=1827949648; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=6Fj/bZHJZZUYmbDfP0vxiwzPLbI9U6bni7hHmJSXAas=; b=nxvc7uKGGjDTe5FNsj0ZNVnb+g0aQFOidy7JLwlELK2QFMp+bqfbagzm XsG/a3bOdVXd7Y1tXBFaYigt/a1wL+AgahFUdY7VMU2yZirkTUn3STiAi KOY7ZhE4zsSgsw4tr1xJsz+oUjy4bFBUTu7N9qoG1nbWp19+pypfSOp65 7QB25XDUuOxX8CN3w8S0TW0w7HDozi1grt/+hUXLcdRR40gzDcngSJT/6 yAQTKk/jQozTzR5Zuw5yF1wP8s1KG4KRbIqEve1A6LbItylclRcJfFbUW HImRj3fx0FJO3S4NbQQ8nj1410sM6lVFD1VW2x1TXP3K3lnlzfHQPIDOk g==; X-CSE-ConnectionGUID: ZnPIqfeURriDWNMDOHpS9w== X-CSE-MsgGUID: 9gEjTlKtRYi+pNRSIXmp0w== X-IronPort-AV: E=McAfee;i="6800,10657,11986"; a="5411996" X-IronPort-AV: E=Sophos;i="6.29,79,1794902400"; d="scan'208";a="5411996" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 11:47:21 -0800 X-CSE-ConnectionGUID: QYswNzctQougC5NKled7Iw== X-CSE-MsgGUID: oKW2u2rKQvyHswl9qTW3xw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,79,1794902400"; d="scan'208";a="14722378" Received: from alekseim-mobl.ger.corp.intel.com (HELO localhost) ([10.245.245.10]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 11:47:17 -0800 Date: Fri, 4 Dec 2026 21:47:14 +0200 From: Andy Shevchenko To: Cesar Cibrian , Dmitry Torokhov Cc: Lee Jones , mfd@lists.linux.dev, Heikki Krogerus , linux-i2c@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Danilo Krummrich , Bartosz Golaszewski , Johan Hovold Subject: Re: [PATCH] mfd: core: Remove software node after unregistering platform device Message-ID: References: <20261204181605.22364-1-cesarcibrian.ai@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261204181605.22364-1-cesarcibrian.ai@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo On Fri, Dec 04, 2026 at 10:16:05AM -0800, Cesar Cibrian wrote: > mfd_add_device() attaches cell->swnode before calling > platform_device_add(), but mfd_remove_devices_fn() calls > device_remove_software_node() before platform_device_unregister(). > > If the child driver propagates dev_fwnode() to a sub-device (for > example, i2c-designware sharing its fwnode with the i2c_adapter > device on Intel LPSS), removing the software node first clears > fwnode->secondary while the sub-device is still registered. When > platform_device_unregister() subsequently tears down the child, > software_node_notify_remove() sees dev_to_swnode() == NULL on the > sub-device and skips cleanup, leaking a swnode reference and > leaving a stale sysfs symlink that triggers a warning on rebind: > > sysfs: cannot create duplicate filename '/kernel/software_nodes/node0/i2c-0' > > Move device_remove_software_node() after platform_device_unregister() > (device_for_each_child_reverse() holds a reference on dev throughout > mfd_remove_devices_fn()). Because acpi_unbind_one() calls > set_primary_fwnode(dev, NULL), which skips clearing fn->secondary > when fn == dev->parent->fwnode, also clear the parent's secondary > fwnode when the child shared its parent's fwnode so rebinding does > not fail with -EBUSY. I believe it's a local hack against bigger issue which is discussed here https://lore.kernel.org/lkml/20261202-swnode-shared-primary-fix-v1-0-7ff23caaa1ed@gmail.com/ I Cc'ed people from that thread. Meanwhile, can you test the proposed series and confirm if it fixes your issue or not? -- With Best Regards, Andy Shevchenko