linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] coresight: Defer probe when the child dev is not probed
@ 2022-02-28 13:31 Mao Jinlong
  2022-02-28 14:51 ` Suzuki K Poulose
  0 siblings, 1 reply; 7+ messages in thread
From: Mao Jinlong @ 2022-02-28 13:31 UTC (permalink / raw)
  To: Mathieu Poirier, Suzuki K Poulose, Mike Leach, Leo Yan,
	Alexander Shishkin
  Cc: Mao Jinlong, coresight, linux-arm-kernel, linux-kernel,
	linux-arm-msm, Tingwei Zhang, Jinlong Mao, Yuanfang Zhang,
	Tao Zhang, Hao Zhang

From: Mao Jinlong <jinlmao@qti.qualcomm.com>

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 <jinlmao@qti.qualcomm.com>
---
 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,
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-03-02  8:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-28 13:31 [PATCH] coresight: Defer probe when the child dev is not probed Mao Jinlong
2022-02-28 14:51 ` Suzuki K Poulose
     [not found]   ` <a63abe13-793e-323f-e214-1dd9826c8a9a@quicinc.com>
2022-03-01 13:15     ` Mike Leach
2022-03-01 13:30       ` Jinlong Mao
2022-03-01 15:03         ` Suzuki K Poulose
2022-03-02  2:29           ` Jinlong Mao
2022-03-02  8:05             ` Jinlong Mao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).