From patchwork Mon Feb 28 13:31:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mao Jinlong X-Patchwork-Id: 12763303 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64717C433F5 for ; Mon, 28 Feb 2022 13:31:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234349AbiB1NcW (ORCPT ); Mon, 28 Feb 2022 08:32:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231643AbiB1NcR (ORCPT ); Mon, 28 Feb 2022 08:32:17 -0500 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE1707C799; Mon, 28 Feb 2022 05:31:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1646055095; x=1677591095; h=from:to:cc:subject:date:message-id:mime-version; bh=seL8w24Rs2hJ5D/EQMqMwiD72YuTr6yhj+1HA6vGq7c=; b=ZSYbSEwzhBA8WZwoySfIWtuM2KjQMK7N8/j3uns2n+GPF06v83zKnxo+ mSIbyZjhU6arZeZI+h/S0esQ6wK2xYXQgkV3Cbtrfkl7jnxuYisJtnpnR rtcYKMxEC7cN+a6LsUm8PhnGzmkUMFAhAQLB/iEJJ0HfiTI9bNyAYgU2c 8=; Received: from unknown (HELO ironmsg-SD-alpha.qualcomm.com) ([10.53.140.30]) by alexa-out-sd-01.qualcomm.com with ESMTP; 28 Feb 2022 05:31:35 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg-SD-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2022 05:31:34 -0800 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.15; Mon, 28 Feb 2022 05:31:34 -0800 Received: from jinlmao-gv.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.986.15; Mon, 28 Feb 2022 05:31:30 -0800 From: Mao Jinlong To: Mathieu Poirier , Suzuki K Poulose , Mike Leach , Leo Yan , Alexander Shishkin CC: Mao Jinlong , , , , , Tingwei Zhang , Jinlong Mao , Yuanfang Zhang , Tao Zhang , Hao Zhang Subject: [PATCH] coresight: Defer probe when the child dev is not probed Date: Mon, 28 Feb 2022 21:31:12 +0800 Message-ID: <20220228133112.3987-1-quic_jinlmao@quicinc.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Mao Jinlong It is possible that when device probe, its child device is not probed. Then it will fail when add sysfs connection for the device. Make device defer probe when the child device is not probed. Signed-off-by: Mao Jinlong --- drivers/hwtracing/coresight/coresight-sysfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-sysfs.c b/drivers/hwtracing/coresight/coresight-sysfs.c index 34d2a2d31d00..7df9eb59bf2c 100644 --- a/drivers/hwtracing/coresight/coresight-sysfs.c +++ b/drivers/hwtracing/coresight/coresight-sysfs.c @@ -73,8 +73,10 @@ int coresight_add_sysfs_link(struct coresight_sysfs_link *info) if (!info->orig || !info->target || !info->orig_name || !info->target_name) return -EINVAL; - if (!info->orig->has_conns_grp || !info->target->has_conns_grp) + if (!info->orig->has_conns_grp) return -EINVAL; + if (!info->target->has_conns_grp) + return -EPROBE_DEFER; /* first link orig->target */ ret = sysfs_add_link_to_group(&info->orig->dev.kobj,