From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932755AbcGHRXy (ORCPT ); Fri, 8 Jul 2016 13:23:54 -0400 Received: from conssluserg-02.nifty.com ([210.131.2.81]:32734 "EHLO conssluserg-02.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932371AbcGHRXe (ORCPT ); Fri, 8 Jul 2016 13:23:34 -0400 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com u68HNUIa001365 X-Nifty-SrcIP: [209.85.161.171] MIME-Version: 1.0 From: Masahiro Yamada Date: Sat, 9 Jul 2016 02:23:29 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: of_clk_add_(hw_)providers multipule times for one node? To: linux-clk@vger.kernel.org, Stephen Boyd , Michael Turquette Cc: Linux Kernel Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi. I think the current code allows to add clk_providers multiple times against one DT node. Are there cases that really need to do so? I am thinking the behavior of __of_clk_get_from_provider() is strange. The result of __of_clk_get_from_provider() has three patterns: [1] success [2] return -EPROBE_DEFER [3] return -EINVAL (if clkspec == NULL) [3] is a rare case. So, almost all error cases are treated as -EPROBE_DEFER. A strange scenario ------------------ If a too big clock index is passed in clkspec, of_clk_src_onecell_get() returns -EINVAL. This is reasonable. But, __of_clk_get_from_provider() tries to search next nodes despite that it has already failed to get a clk. Then, it reaches the end of list_for_each_entry() loop, and returns -EPROBE_DEFER. This is not deferred probe at all! In this case, __of_clk_get_from_provider() should return -EINVAL. If this is a bug, I am happy to volunteer to fix it. Thanks. -- Best Regards Masahiro Yamada