Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4433092imw; Tue, 12 Jul 2022 07:53:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t6D8lXl16Zofa50wzR8nGxRfkkJQtKDxUg7nBxU4caZzuE31u1A4/gDEy/WRO9tmS6kT4A X-Received: by 2002:a17:903:11d2:b0:167:8a0f:8d33 with SMTP id q18-20020a17090311d200b001678a0f8d33mr24254342plh.95.1657637593042; Tue, 12 Jul 2022 07:53:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657637593; cv=none; d=google.com; s=arc-20160816; b=hN7eLMSArQNPGT4PKlMiBa0CZTUERTjg+4rvlZ62/DlAgPubmsv+6iMAIEZD1wysyD Jc6dMI00l6oiPM/8tzAIga09rS/XpdT6jz8N/MQgCE5OpNzZVELnF0qhgOeExdTwBKvF 5so8BrPi1A9gn1mtequK2k/OxIy3QtEeBfcG5KSavMJxFj/rI/g9EW4RgM7LH7CKFrx1 gdqzbNyIF8rADBY28b3IpohUB96V2T/2ejw/a365/RB2cDoBf0i7AcdlATQbLEowbAXr Xu+doPfU7b/E9Ol/fngjmXqaT2/VD7jZgQUb4cFEyASlm2J07fI3yWgzVTKl4K47bDmy TRaQ== 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=Bz0PcuOH3F3TpxrPIFnZ0d7iabvLHgV5HqTNMqei5wg=; b=AIkqQaPcF5gX3Hssy+381FiVwZOo2p3SXuMb822hv45BEkHCEzWsubzjD74GfspIFO b6zVVFqwKOLlSr+5C8uVb2KdOxHTOBAhBbMBpWeguShvjiOitz+3J3H97uY5UsirmLZ2 /lsjQyhCB3oYg5CmvTDrusKYhzNTEBzA+LPWr0NO/F2wjbZPIMJzwl95UZ9tgR38tvsh 7wwi7eAqI8LrWsO2qYyTy/LUe6LN4noonQ250EqztIpxlEptehJch6FIXFU834zoENUh M/KGvXHhwNgdA6Oask8DYdEIAyDANX/r27adnvhoD4veiXBtQNqMkB+RWSxmlvp1o3PR F3hA== 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w79-20020a627b52000000b0051bbac76b99si13072860pfc.195.2022.07.12.07.53.01; Tue, 12 Jul 2022 07:53:13 -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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233175AbiGLOgA (ORCPT + 99 others); Tue, 12 Jul 2022 10:36:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232548AbiGLOfa (ORCPT ); Tue, 12 Jul 2022 10:35:30 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AA0D24F12 for ; Tue, 12 Jul 2022 07:35:28 -0700 (PDT) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Lj3Cg4LvdzlVpR; Tue, 12 Jul 2022 22:33:51 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 12 Jul 2022 22:35:25 +0800 Received: from [10.174.177.243] (10.174.177.243) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 12 Jul 2022 22:35:24 +0800 Message-ID: <8efb2c6f-f00a-ea02-d5ae-ac454bb721f5@huawei.com> Date: Tue, 12 Jul 2022 22:35:24 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v4] amba: Remove deferred device addition Content-Language: en-US To: Saravana Kannan , Russell King , Philipp Zabel CC: Rob Herring , Ulf Hansson , "John Stultz" , Linus Walleij , Sudeep Holla , Nicolas Saenz Julienne , Geert Uytterhoeven , "Marek Szyprowski" , , References: <20220705083934.3974140-1-saravanak@google.com> From: Kefeng Wang In-Reply-To: <20220705083934.3974140-1-saravanak@google.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.243] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 2022/7/5 16:39, Saravana Kannan wrote: > The uevents generated for an amba device need PID and CID information > that's available only when the amba device is powered on, clocked and > out of reset. So, if those resources aren't available, the information > can't be read to generate the uevents. To workaround this requirement, > if the resources weren't available, the device addition was deferred and > retried periodically. > > However, this deferred addition retry isn't based on resources becoming > available. Instead, it's retried every 5 seconds and causes arbitrary > probe delays for amba devices and their consumers. > > Also, maintaining a separate deferred-probe like mechanism is > maintenance headache. > > With this commit, instead of deferring the device addition, we simply > defer the generation of uevents for the device and probing of the device > (because drivers needs PID and CID to match) until the PID and CID > information can be read. This allows us to delete all the amba specific > deferring code and also avoid the arbitrary probing delays. > > Cc: Rob Herring > Cc: Ulf Hansson > Cc: John Stultz > Cc: Saravana Kannan > Cc: Linus Walleij > Cc: Sudeep Holla > Cc: Nicolas Saenz Julienne > Cc: Geert Uytterhoeven > Cc: Marek Szyprowski > Cc: Kefeng Wang > Cc: Russell King > Signed-off-by: Saravana Kannan > --- > > v1 -> v2: > - Dropped RFC tag > - Complete rewrite to not use stub devices. > > v2 -> v3: > - Flipped the if() condition for hard-coded periphids. > - Added a stub driver to handle the case where all amba drivers are > modules loaded by uevents. > - Cc Marek after I realized I forgot to add him. > > v3 -> v4: > - Finally figured out and fixed the issue reported by Kefeng (bus match > can't return an error other than -EPROBE_DEFER). > - I tested the patch on "V2P-CA15" on qemu > - Marek tested v3, but that was so long ago and the rebase wasn't clean, > so I didn't include the tested-by. > > Marek/Kefeng, > > Mind giving a Tested-by? Hi Saravana, I tested on my qemu, and previous panic[1] disappeared, so Tested-by: Kefeng Wang [1] https://lore.kernel.org/linux-arm-kernel/CAGETcx8RLor0JcboBuMrB96xUot14P1CAcqoen7ZHnYRi7KMEQ@mail.gmail.com/