Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4768613pxj; Tue, 22 Jun 2021 07:39:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRg93IM0rKcVzDbs8mGMNxzFy3Xy46pCXVWTWfyrKMqEyNw5qck1cTYPNwKggdCnb/p4p6 X-Received: by 2002:a17:907:20f7:: with SMTP id rh23mr1531087ejb.64.1624372766074; Tue, 22 Jun 2021 07:39:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624372766; cv=none; d=google.com; s=arc-20160816; b=Tl4dMHRFl/i6iQ6RKsLuF/wGpzPnTVOt2TAb0sn/ez9LAGIJmbR0tB3Mzgrj9Jv82M dKe18V3/DTbYNkzw+eiKdH7prmartycVsXpzYySYajMLaRYirLMdUiLLkpCwkuYvdozm ZvKhsfLMHETHXA5SVWMBUHgogr+A3OqmqlPZJvXtLToA3Y9fhCeJRkPh2BVNBrOWgqk0 fN9U0S665+qTgXAiS5huSWTsTk/0n3+Jad7L75QNwitA2GQpYfPRQASfxRAD4b49t3Q+ rCOYtAtLG5X9Xud097w1XTsokTufCwOHmZ/qzqzamZOiKC/itEHwEU+eoWzH/Z0aRXev fb/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=NdGSjPCu4ag1+WbYl1pQ4ni/4S61T8d8xOwDlpo2s1I=; b=z3HqsWuIvoysPaAqw14FO9fAtIASlxRz7Loopk5wJ2gg6bR7is/mmpdlOaS8wbfwcJ 8F1nIj54Wrdu5NcBZSVsqk5yiyr7+hxH+EU1Iq1OJVkbLo2nb++hotUo11pDJmcwUBSf l6j5dmTKOEZkAHHJmSh7WAxbB9grrV1me15+aUeLGST5NfNpLz7sb+C/l+qn9zkGVQLT nvkWp6QXJoi890/M4x0oTxQCnZlw+pZ0nM7L7MZ/PlLIupiva+MzAsOETRW88FFdx6my 4Q5Kn/6Qw+wNUMKvcZCDqB/fIDNWRw2F2PYvXiUGSF8pZvb3xeD+09tcin4zQvw+O8dV Cxog== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e17si15232913ejm.271.2021.06.22.07.39.02; Tue, 22 Jun 2021 07:39:26 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231936AbhFVOjQ (ORCPT + 99 others); Tue, 22 Jun 2021 10:39:16 -0400 Received: from isilmar-4.linta.de ([136.243.71.142]:36080 "EHLO isilmar-4.linta.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231860AbhFVOjP (ORCPT ); Tue, 22 Jun 2021 10:39:15 -0400 X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES Received: from owl.dominikbrodowski.net (owl.brodo.linta [10.2.0.111]) by isilmar-4.linta.de (Postfix) with ESMTPSA id 5A12B2012D1; Tue, 22 Jun 2021 14:36:58 +0000 (UTC) Received: by owl.dominikbrodowski.net (Postfix, from userid 1000) id 0C55780162; Tue, 22 Jun 2021 16:36:31 +0200 (CEST) Date: Tue, 22 Jun 2021 16:36:30 +0200 From: Dominik Brodowski To: Heikki Krogerus Cc: Andy Shevchenko , Lee Jones , Linux Kernel Mailing List Subject: Re: v5.13-rcX regression - NULL pointer dereference - MFD and software node API Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Tue, Jun 22, 2021 at 05:10:44PM +0300 schrieb Heikki Krogerus: > On Tue, Jun 22, 2021 at 11:09:58AM +0300, Heikki Krogerus wrote: > > On Mon, Jun 21, 2021 at 05:31:50PM +0200, Dominik Brodowski wrote: > > > Am Mon, Jun 21, 2021 at 01:37:59PM +0300 schrieb Heikki Krogerus: > > > > On Mon, Jun 21, 2021 at 01:00:06PM +0300, Andy Shevchenko wrote: > > > > > Can you, please, attach this to the bug report? > > > > > > > > > > Long story here is that the device creation fails but we already have added > > > > > swnode to it. Meanwhile, device itself is not completely instantiated (yet) > > > > > and dev_name(dev) is NULL. The software_node_notify() is called with such > > > > > device and Oopses in the following line > > > > > > > > > > sysfs_remove_link(&swnode->kobj, dev_name(dev)); > > > > > > > > > > My patch fixes another issue that might happen before this and in the code > > > > > that retrieves swnode itself in the device_remove_software_node(). > > > > > > > > > > Of course my patch won't fix this issue. > > > > > > > > > > I have heard that Heikki is looking how to fix the issue in your case and > > > > > potentially in any other cases where device_add_software_node() is called > > > > > against not formed object instance. > > > > > > > > Dominik, can you test the attached patch to confirm if this really is > > > > the case. > > > > > > With this patch applied, the panic disappears. > > > > Thanks Dominik. I'll clean it and send it out today. > > Before I send the patch to Rafael and Greg, can you confirm that the > appropriate API (device_is_registered()) also works? I'm attaching > patch that should be the final version (if it works). Heikki, that works perfectly. Many thanks, especially for the speedy development of the bugfix! Best, Dominik