Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp508977rwl; Wed, 29 Mar 2023 05:13:10 -0700 (PDT) X-Google-Smtp-Source: AKy350ZaV/eVneeIAqNsYNdJhkmfN4brzTCO8lE/wQF52LYhyOhevzCA9PkEWL+oqCWDF0Ws/9Au X-Received: by 2002:a17:90b:4b0f:b0:234:721e:51e5 with SMTP id lx15-20020a17090b4b0f00b00234721e51e5mr2079455pjb.10.1680091990537; Wed, 29 Mar 2023 05:13:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680091990; cv=none; d=google.com; s=arc-20160816; b=si/xuG68DUjCdqYjF2ig89vzEI7nKqCzEaFgYZTD454j1bk801q+0lodNDBEXD3Jyd FYzNC5hOpsSGBrfk/PqEcsesy/t4EO0vc6+ypVD3Z2kB5xg2s8DeP4b+9g2hsQ3HPPhg sRFRRgWOCHrampb8BVk5QKAGIKaTpnDlZKwsiXoqer7smmkStWZoAAYUKLRLYb69Oe0L R5wBGjwUDiekn8Busffgbc1xt0rirAk2NOLzG7ivorxb6H9SoS74mJPuLE9GjnF9ksDr q6y19//fsK77ujAqHyY1MfM4NHt35SwTbriZvkOGbra84O3q0KKWzoHe4yVfyVQ73elR A7VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=oPaqtfq2++v/eo96kYfemL+SGt1TsVdxXq5WB6eSenk=; b=CZFGRNMUy2WZ+cB9pMWRNS3ZRetpcfHBcza5eoW2q8YPFIjlmYvEUvATSZSgrOqWjX 915Yb0TCuEMOHrMX48Wau4lVCkDBlhB2Lt3ub7OWrT61opHaf7tFBbYbGOLV+DMe38U6 394x3Z1rvpktl5HilTuNCqrziNOzL/mXYsExKmrO0nvOeXc1+S9bbta3AEWgNtFd0ii4 pmB60cmc3fZXxnjjaP9hlj+HAF9LI2o6pPV71SjlhbsnXNQDavA9OA2nVJO+AU36TBhI OGt1Bx9h53pTsZJWKXA4/8wEBBS7uM+2mM1q98mRFWgp4MLB5vNdoN4Y/Udj0oNzAV9D Nurg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u2-20020a170902b28200b0019904cba3b6si30473841plr.459.2023.03.29.05.12.56; Wed, 29 Mar 2023 05:13:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230011AbjC2MHP (ORCPT + 99 others); Wed, 29 Mar 2023 08:07:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229585AbjC2MHH (ORCPT ); Wed, 29 Mar 2023 08:07:07 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 56EE54ED3 for ; Wed, 29 Mar 2023 05:06:54 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 594AE1FB; Wed, 29 Mar 2023 05:07:38 -0700 (PDT) Received: from [10.57.20.1] (unknown [10.57.20.1]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1205B3F6C4; Wed, 29 Mar 2023 05:06:52 -0700 (PDT) Message-ID: Date: Wed, 29 Mar 2023 13:06:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v2 6/9] coresight: Store in-connections as well as out-connections Content-Language: en-US To: Jinlong Mao , coresight@lists.linaro.org Cc: Mathieu Poirier , Mike Leach , Alexander Shishkin , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20230310160610.742382-1-james.clark@arm.com> <20230310160610.742382-7-james.clark@arm.com> From: James Clark In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/03/2023 05:35, Jinlong Mao wrote: > > On 3/11/2023 12:06 AM, James Clark wrote: >> This will allow CATU to get its associated ETR in a generic way where >> currently the enable path has some hard coded searches which avoid >> the need to store input connections. >> >> Signed-off-by: James Clark >> --- >>   drivers/hwtracing/coresight/coresight-core.c  | 56 +++++++++++++++-- >>   .../hwtracing/coresight/coresight-platform.c  | 61 ++++++++++++++++--- >>   drivers/hwtracing/coresight/coresight-sysfs.c |  1 - >>   include/linux/coresight.h                     | 25 ++++++++ >>   4 files changed, 130 insertions(+), 13 deletions(-) >> >> diff --git a/drivers/hwtracing/coresight/coresight-core.c >> b/drivers/hwtracing/coresight/coresight-core.c >> index f457914e445e..a8ba7493c09a 100644 >> --- a/drivers/hwtracing/coresight/coresight-core.c >> +++ b/drivers/hwtracing/coresight/coresight-core.c >> @@ -59,6 +59,7 @@ const u32 coresight_barrier_pkt[4] = {0x7fffffff, >> 0x7fffffff, 0x7fffffff, 0x7fff >>   EXPORT_SYMBOL_GPL(coresight_barrier_pkt); >>     static const struct cti_assoc_op *cti_assoc_ops; >> +static int coresight_fixup_inputs(struct coresight_device *csdev); >>     ssize_t coresight_simple_show_pair(struct device *_dev, >>                     struct device_attribute *attr, char *buf) >> @@ -1369,6 +1370,35 @@ static int coresight_fixup_orphan_conns(struct >> coresight_device *csdev) >>                csdev, coresight_orphan_match); >>   } >>   +/* >> + * Device connections are discovered before one/both devices have >> been created, >> + * so inputs must be added later. >> + */ >> +static int coresight_fixup_inputs(struct coresight_device *csdev) >> +{ >> +    int i, ret = 0; >> +    struct coresight_connection *out_conn; >> +    struct coresight_connection in_conn; >> + >> +    for (i = 0; i < csdev->pdata->nr_outconns; i++) { >> +        out_conn = &csdev->pdata->out_conns[i]; >> +        if (!out_conn->remote_dev || !out_conn->remote_dev->pdata) >> +            continue; > > Hi James, > > If out_conn->remote_dev is null here,  the in_conn of > out_conn->remote_dev->pdata will never be set. > For example, device A is connected to in_port 0 of device B. If device A > is probed first, the in_conn of device > B will not be set. > Do we need to add Defer probe return here ? I tested with defer probe > return, it works. > >         for (i = 0; i < csdev->pdata->nr_outconns; i++) { >                 out_conn = &csdev->pdata->out_conns[i]; >                 if (!out_conn->remote_dev || !out_conn->remote_dev->pdata) > -                       continue; > +                        return -EPROBE_DEFER; > > Thanks > Jinlong Mao I think you are right but I thought that EPROBE_DEFER was too big of a change and that it might break something in some unexpected way. In V3 I used the orphan mechanism for inputs in the same way as outputs so the problem should be gone now but without having to defer loading.