Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp374878pxb; Tue, 1 Feb 2022 01:36:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJwJiCi/S5Z6v5hOFSnWTvwVUW7cyONdiOrYUJjZ90RvIkQWHRD/ibCLWplxjYylCfA4bN9m X-Received: by 2002:a17:906:c110:: with SMTP id do16mr19806088ejc.175.1643708198538; Tue, 01 Feb 2022 01:36:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643708198; cv=none; d=google.com; s=arc-20160816; b=rxpDCAiAKno9zM3vU0gnhQVn8H7zc5gxqRPCO73ibzIMPTUYBR8ZF6KpreO0vAm0Sb ptLLdHAIikP9dv9JAc+P4Kyau5rz67X+EBTYNdlpp9rU+ZO3FbcN01g5PIV4RdojLzSy fWhKaUIW6sbrnGy9EVl2mp9TIVHR4FvY4udxiv5JpnR9ZKNDe0LuwxlW+Dob00UqT+gx mDtnJ7rsxC9mh8SjJpYtJ8UbvvExsWX/0RjDTwlAqIz1eauvZwZnMp0GLfYPtpD8vHe7 /yrCM9cZkBIO8XXAqgIDzMf2441NPDDAZ4eg661yHYOZq49uAHPoyD6l4a7gtp9oPLeO xEbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=/cP2N1OhpAympW9IXgxZ/UqyPNnujd9/A496hh+nSls=; b=eCcM1W1mr7rBE7FoxpAPwRpHMEqoCY+pzJNZVe8u+WINdkYMQ6AbtvMmWxrHObgEhr HMV9Qr88Qs0Hiu4qdXAlS4ucf1/LFWsJ2ItJ7b1200npCtfp9F9rFLANXljblrxcBt4n 42c0M5vZ/j3n74eLGrjTbxob2LqwteF7zWG225EqGKEL0bEhNXS/O6iIbYBZvSmtR1ld dvQ6kFTqnydEXI5rXrv0isv1U4qtsJb9hh7vtm46GjpoWr4qQM9XjIJO2JchJtmVjZV6 9GyLq3WEyHts9naaaAN9f/2taOHYqpVYspQ9/AZHlVUi/xMoQh9ONutBQ5YA/TT3bbZe Yhkw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f22si10251814edf.623.2022.02.01.01.36.13; Tue, 01 Feb 2022 01:36:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353816AbiA3CoQ (ORCPT + 99 others); Sat, 29 Jan 2022 21:44:16 -0500 Received: from smtp21.cstnet.cn ([159.226.251.21]:48826 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230484AbiA3CoG (ORCPT ); Sat, 29 Jan 2022 21:44:06 -0500 Received: from localhost.localdomain (unknown [124.16.138.126]) by APP-01 (Coremail) with SMTP id qwCowACHJsRY+_VhYiYuAA--.39477S2; Sun, 30 Jan 2022 10:43:36 +0800 (CST) From: Jiasheng Jiang To: justinkb@gmail.com Cc: frank-w@public-files.de, broonie@kernel.org, gregkh@linuxfoundation.org, lgirdwood@gmail.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, matthias.bgg@gmail.com, Jiasheng Jiang Subject: Re: BUG: [PATCH v2] isoc: mediatek: Check for error clk pointer Date: Sun, 30 Jan 2022 10:43:35 +0800 Message-Id: <20220130024335.114461-1-jiasheng@iscas.ac.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Enco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IYCTnIWI evJa73UjIFyTuYvjfUO_MaUUUUU X-Originating-IP: [124.16.138.126] X-CM-SenderInfo: pmld2xxhqjqxpvfd2hldfou0/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 28, 2022 at 10:26:51PM +0800, Paul Mulders wrote: > I guess this breaks all MT7622 SoCs since it'll prematurely exit > init_clks (and subsequently init_scp) completely once devm_clk_get > fails to get a reference to the mm clock producer (which happens to be > the first one tried). This is because MT7623 has a GPU (so no mm > clock) and MT7622 doesn't, and as a result the other clock producer > pointers never get initialized (and other stuff in init_scp after > returning from the error never happens). > > The patch seems fundamentally flawed, I guess it was either not tested > at all, or only tested on a MT7623. The initialization functions seem > designed with the idea that it's ok if some clocks aren't present, so > stopping the initialization when one of them isn't present seems > wrong. (For example, there is also a MT7622B variant of the MT7622 > which probably also lacks some clocks MT7622(A) does have). I don't think the patch for init_clks() is flawed. At most it is incompleted. What it did is like fixing a potential error in the tool platform providing service for the upper application, like what you said, MT7623 and MT7622. We should not keep the error in the platform because of the upper application. And it seems like it is MT7622 that is flawed. The better way is to fix both the bug in init_clks() and its caller, MT7622. Sincerely thanks, Jiang