Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp400961rdb; Thu, 5 Oct 2023 09:04:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGMCyy7xwjP63CeoVF6eqBedXXVBtvanH8i38Cm6IBts97V2kQNOrQ0AEyTdIaeSEpudF93 X-Received: by 2002:a17:902:b28c:b0:1bd:f69e:6630 with SMTP id u12-20020a170902b28c00b001bdf69e6630mr5263701plr.65.1696521860301; Thu, 05 Oct 2023 09:04:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696521860; cv=none; d=google.com; s=arc-20160816; b=LJjd/Lj+8QXfenyyzw37vzaAQKFjBMeBr+Sc9a1R/OXS9l5EAqk2tbifq6Au5PJJwp zZrY7X0YAR3irhUCf8gawBc6pHenXzztFowT9XAunAv8+HCqzPk0AT2+whkRGZ+BbEBH ZzDe6SPclzOn8283iZp9BOfbs2AmCDaDuMvRaEC0t+FjIlIjHVTP8uvdeP9+Tj2NPHEO w9vbUBb9jC/PJkFr6cMU8xFOYz0s0RXaFx9Sr2h01jC698DAzZrS1yZ7gjL2a6mVs0ZT XLFLKFKcrtKLr6OEzIZRZCkWy3ipoCVCavRp8zR9hpJdmEgv1+V/5Zmd5Wjir4xJA1Sr he5Q== 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:dkim-signature; bh=u9pnp+ZY/KgTHh20p8opH0SSQL8nx37bWqmpGi43Vl4=; fh=kVr+Cu5E0fcgygYoh3YFgez8hZQQx4bFHzlW6MTehmA=; b=YByCurPhpTTzl/Stig5fHmCMHEfGmDR+ZEPkpi1B5ewHNViFqJp625cxn9gxa8BWCQ 487dWaMqUXi6tTtogpb7/JgGITZDEBaVTWQd3L0RCyGO2U3UoCq2clUwtIm/chZkMXtz iCcQoMOOLTVwrMQGogSqzFKZ1M6/SEJDA0vsuAI4QE7WwIkqRUe6fUSSKfpB/+fzZxJf 2YOZlD8S0x73W7iNJm6uWW8UkcO9TlcT3lqIE2Cl/mfh6yl0PAMBoZS0r5Ec0RizAnJ3 9hVScp6t7lxoT1/yMDVtgG2sZ7AR8Z+stxDrU1xP7dfhjoMc+dWEnU3TuBAppc5YUYvn UJqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=eiIHUyLw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id n5-20020a170903110500b001bb2093efb6si1915494plh.45.2023.10.05.09.04.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 09:04:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=eiIHUyLw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 42A9183BB1C0; Thu, 5 Oct 2023 09:03:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234812AbjJEQCt (ORCPT + 99 others); Thu, 5 Oct 2023 12:02:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237633AbjJEQBN (ORCPT ); Thu, 5 Oct 2023 12:01:13 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 360743C03 for ; Thu, 5 Oct 2023 06:51:33 -0700 (PDT) Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 395AaqFo031880; Thu, 5 Oct 2023 10:49:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=qcppdkim1; bh=u9pnp+ZY/KgTHh20p8opH0SSQL8nx37bWqmpGi43Vl4=; b=eiIHUyLwOmH849o2EgJDemhFTjoQR77LpYUEMvY+0zODgQ3ZqH1IDfA4e2/mo7nKdBtH GK7yC5UbIXTYChqPjiU7Hrrc3P10o1YKVl7RZECskSQtjsH3CSKsg1U/+Mp4l2kRm1fO kO755DPsXzSf7TRBy/Q9wCDelQ+Ld57/oIZBq/t5rlI9ONaHa+wSsfASa9i9027umZS7 tr6wI17ijysW0rDM7188j5xoOC6pC9vTx5/0uLtFBTgTkPa1TlWd4DOJFBTUmwn9DIpm tS1cWusSL87A8C08oz4hRcb4LmUsqyz0DQ3sUYKlx9L+d4ym1b42omqHfC5RfPNk4zbr tQ== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3thn058puq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 05 Oct 2023 10:49:50 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 395AnnNT018849 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 5 Oct 2023 10:49:49 GMT Received: from hu-pkondeti-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.36; Thu, 5 Oct 2023 03:49:47 -0700 Date: Thu, 5 Oct 2023 16:19:44 +0530 From: Pavan Kondeti To: Greg KH CC: Zhenhua Huang , , , , , Subject: Re: [RESEND PATCH] driver core: Clear FWNODE_FLAG_LINKS_ADDED in device_links_purge() Message-ID: <50508cf9-fd4f-4199-9df3-e42ebb489499@quicinc.com> References: <1695781810-5700-1-git-send-email-quic_zhenhuah@quicinc.com> <2023100501-entourage-bounce-3364@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <2023100501-entourage-bounce-3364@gregkh> X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: RUN43ddnq3qfOwBT9bT7pFoYL4MvnC1i X-Proofpoint-GUID: RUN43ddnq3qfOwBT9bT7pFoYL4MvnC1i X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-05_08,2023-10-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 suspectscore=0 impostorscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 priorityscore=1501 mlxscore=0 malwarescore=0 lowpriorityscore=0 phishscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310050083 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 05 Oct 2023 09:03:53 -0700 (PDT) On Thu, Oct 05, 2023 at 11:32:22AM +0200, Greg KH wrote: > On Wed, Sep 27, 2023 at 10:30:10AM +0800, Zhenhua Huang wrote: > > Flag FWNODE_FLAG_LINKS_ADDED stops fwnode links creation. Current kernel > > only adds it once after fwnode links creation in fw_devlink_parse_fwnode(). > > After that even device links being purged, the flag will not be cleared. > > > > Fwnode links are converted to device links and will not be added back > > forever in normal case. Essentially if a device is registered and > > unregisted (also deleted) before it is probed (due to missing fwlink > > dependencies, abort in device_links_check_suppliers), the fwlink is not > > setup next when device is newly created again. This means the probe gets > > called without meeting all dependencies. > > > > It usuallly happens in the case of a glue driver. > > What exact glue driver is causing this to happen? Why can't we fix that > up instead? > Yes, we are looking at fixing the glue driver and/or the probe order of drivers involed by controlling modules load order. To answer your question, It is observed with dwc3-qcom on a downstream kernel based on Android GKI 6.1 kernel. usb_1: usb@a6f8800 { ... usb_1_dwc3: usb@a600000 { compatible = "snps,dwc3"; iommus = <&apps_smmu 0x40 0x0>; ... }; }; The parent device has no dependency on IOMMU but the child has dependency. The parent probe gets called before IOMMU is probed. The parent glue driver adds the child device and removes it since its probe is not completed. Once the child is unregistered, all the fwlinks are lost. Next time when the child is added, its probe gets called before IOMMU is ready (since the fwlinks are lost). Thanks, Pavan