Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp717980pxb; Tue, 14 Sep 2021 07:18:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxehF+Mj92zhpLURbPOixShztO2ziMm4Xva4UQaeiSD2+xsOiEf4I3nzyMAzmwant/CTZVU X-Received: by 2002:a05:6512:3409:: with SMTP id i9mr12262244lfr.659.1631629121146; Tue, 14 Sep 2021 07:18:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631629121; cv=none; d=google.com; s=arc-20160816; b=gz6RO0ZbPGa+aaC69nqvsffCqGosOv8mMQqBF6n+iUobRAbRzuW96Jwk6x0xnzfrZ8 uPypLw9IRRXrWo9bp2uZObuWftCAwjFH2sGJ+M48FAG1+FEqteMySZHKhP3BiSmTkRgE DgfaNtSHIyVg0sDgw92oE3IZK/Peqg4XaAOThGTEFJet2mah9aTbS2vz+J++Wx55rzoZ 4auZazP2fKU06o7r8WldJATVnDxzg9UHhXFJrV7wihbIH/04A6bcCPp6FDsRDsywWMV4 2y/WFOeDf0bAm1XaCtoq0j/7BIakQTnmuPe3VCaVeOGY63CrfOh993WuDffNpMh90QOU +PIA== 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=+IIjApvgBNjJQd+G0mTx4Xziy+7892N4jmgRLKgmIWo=; b=od6IgjLVoj/E0/ktwO1Qwp8pzbOJfEXZlg9vX+YE8/m9h0/NweO/QBpvwio3bp2HMp G+d1qy5Rbeg6TvAS2L2QcmRu0aAK918A8Qt9QWl2B1VJtNMitQfgsini71loEtsYdU9Q 4Bu+JzIgc2XoOCDhaQPjG5qAXsCbWJ6BXn/Ib3YFbUckumWB+WpZq9wEkPE9oOQYd2KF +hvgapcdQUF5bpahKM3N5nAUIrMcpZqbruvV2O6JDl71GQkgAN79vprj4aLNa9FyiIEc Bhp2qMvroecKqu1xZJ+KEKdgaSRBf2qoCn5z0X6Z3jpg98UggZmohq77ukBT81IcQd5C tSWg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k1si17175520lfr.539.2021.09.14.07.18.11; Tue, 14 Sep 2021 07:18:41 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233354AbhINOOd (ORCPT + 99 others); Tue, 14 Sep 2021 10:14:33 -0400 Received: from mga06.intel.com ([134.134.136.31]:28113 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233300AbhINOOc (ORCPT ); Tue, 14 Sep 2021 10:14:32 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10106"; a="283006157" X-IronPort-AV: E=Sophos;i="5.85,292,1624345200"; d="scan'208";a="283006157" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Sep 2021 07:13:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,292,1624345200"; d="scan'208";a="609642663" Received: from kuha.fi.intel.com ([10.237.72.162]) by fmsmga001.fm.intel.com with SMTP; 14 Sep 2021 07:13:05 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Tue, 14 Sep 2021 17:13:05 +0300 Date: Tue, 14 Sep 2021 17:13:04 +0300 From: Heikki Krogerus To: Laurentiu Tudor Cc: Andy Shevchenko , Andy Shevchenko , Jon Nettleton , Greg Kroah-Hartman , "Rafael J . Wysocki" , ACPI Devel Maling List , Linux Kernel Mailing List , Lorenzo Pieralisi Subject: Re: [PATCH] software node: balance refcount for managed sw nodes Message-ID: References: <2a0f7fa6-b164-eeb4-118a-acd57d79a484@nxp.com> <2485ac73-6df6-3939-5ee5-ef650d951054@nxp.com> <56544211-7407-3de2-e30d-d1dbb7b2aeb2@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56544211-7407-3de2-e30d-d1dbb7b2aeb2@nxp.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 10, 2021 at 04:00:49PM +0300, Laurentiu Tudor wrote: > >> I've spent some time looking into this and it turns out that in the > >> ACPI case, device_create_managed_software_node() ends up being called > >> twice, first here [1] and after that, in the IORT code here [2]. With > >> the proposed patch this causes software_node_notify(KOBJ_ADD) being > >> called twice thus triggering the dup sysfs entry warning. > >> Any comments / ideas welcomed. > >> > >> [1] https://elixir.bootlin.com/linux/latest/source/drivers/usb/dwc3/host.c#L111 > > > > I think the problem here is that the secondary fwnode get's replaced > > because the primary fwnode is shared. Can you test it with this, just > > to see if the problem goes away: > > > > diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c > > index f29a264635aa1..e4b40f8b8f242 100644 > > --- a/drivers/usb/dwc3/host.c > > +++ b/drivers/usb/dwc3/host.c > > @@ -76,7 +76,6 @@ int dwc3_host_init(struct dwc3 *dwc) > > } > > > > xhci->dev.parent = dwc->dev; > > - ACPI_COMPANION_SET(&xhci->dev, ACPI_COMPANION(dwc->dev)); > > > > dwc->xhci = xhci; > > > Thanks for looking into this! Yes, this does make the issue go away. We need to think about how to solve this one. The problem is that we have to share the ACPI node between the parent dwc3 device and child xHCI, but at the same xHCI needs to have its own software node. The fwnode->secondary pointer does not quite bend to this. If the primary fwnode is shared, the secondary fwnode has to be shared as well. thanks, -- heikki