Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp800501ybz; Fri, 1 May 2020 08:46:41 -0700 (PDT) X-Google-Smtp-Source: APiQypJfRO7rkxQURURgmOq8th+kh+D/cBMUhesZtsHytlexHs8+nyvFj/vjIkRSMOE0eHSQOV57 X-Received: by 2002:a17:907:9e5:: with SMTP id ce5mr3680260ejc.123.1588348001235; Fri, 01 May 2020 08:46:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588348001; cv=none; d=google.com; s=arc-20160816; b=F4f4lxCGOnENKpeXD2APlM4Y2FUcmC27exhrEtcCLZrPnHnFQeXrHAc0sqqWbnTIO9 7czWF/QqPcxH56l044MPmZ/y0oO8mfyQFLWMcJWX6tyB5Hhj+YIHlCY+V7O1DuZ9w4qn SnIFAtwbFC+4xLdJFvP6DPDbAFwCUf6ZV9iNUnanyo0DQenjfO+O+7tdHl7J4gz9c5SC R/piPeGJDOCI9EsUmBxZv4/lOdPAuekeIy2ltHWRBoWRU3spXeEhiMdLQJkjeyRMv+ES w3were7keF4C7nhHem6bxkTt8kc80MKl4sHTtpubs+epGN9eI+cVfwLSlJNpSbrX8mFT NQRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=zq53wD1ebttWy9Fs+bAkUBp+KMkAbk1gvP4L0POpNiA=; b=z6llWw2nvIflQeJ1o0dfnJfQ0FndzbCXLkUf/u+1Py3RSFnVMPba6tFw0sgWkhTopP mqo+0Sj3XRlQmkEMNX+CNN5/noZ98qfCI6HoznMOfj/tX2c6P//Em3MFd8Q6Jdmbs6kE xq9F8q+8oGEUzGdjdU+COrxCfsTSrI2JmMjBaOvh9mtdwcCBO2EkWhAjNvanxCVxe3hH vWVVrj0RFo688cEyH//vEZEwqn7mFado0QZePv2G8fea0cAR1VntieNxH6WcvV1n0OZa mVpNWD+zIr4kLcveTTezv2PX/3CHnfosUEIwONe9E8TYdyNxsDoKp/m6MjjM+pxc7ccg RTAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=g9Y63QfC; 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 t26si2559306edf.183.2020.05.01.08.46.17; Fri, 01 May 2020 08:46:41 -0700 (PDT) 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; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=g9Y63QfC; 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 S1729731AbgEAPoz (ORCPT + 99 others); Fri, 1 May 2020 11:44:55 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:36546 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728495AbgEAPoz (ORCPT ); Fri, 1 May 2020 11:44:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=zq53wD1ebttWy9Fs+bAkUBp+KMkAbk1gvP4L0POpNiA=; b=g9Y63QfCt8YuvaP45/GWgzLNj8 no//b6ULwxrn4pBY9MHOk89RSiunJY/l98hVSjVfsLNrIuLgM/KQfMzLn1fYX+lQW0qRLzMOvy1Ta lFnR3/T4p7PWi6B/VbYak39g5tqWm4oIXxzQB5PjCtHV+QNLsdO/I3HQoav+YkAlNQd4=; Received: from andrew by vps0.lunn.ch with local (Exim 4.93) (envelope-from ) id 1jUXqK-000YMy-7n; Fri, 01 May 2020 17:44:48 +0200 Date: Fri, 1 May 2020 17:44:48 +0200 From: Andrew Lunn To: Martin Blumenstingl Cc: robh+dt@kernel.org, f.fainelli@gmail.com, linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, jianxin.pan@amlogic.com, davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH RFC v2 08/11] net: stmmac: dwmac-meson8b: add support for the RX delay configuration Message-ID: <20200501154448.GH128733@lunn.ch> References: <20200429201644.1144546-1-martin.blumenstingl@googlemail.com> <20200429201644.1144546-9-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200429201644.1144546-9-martin.blumenstingl@googlemail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > + if (rx_dly_config & PRG_ETH0_ADJ_ENABLE) { > + /* The timing adjustment logic is driven by a separate clock */ > + ret = meson8b_devm_clk_prepare_enable(dwmac, > + dwmac->timing_adj_clk); > + if (ret) { > + dev_err(dwmac->dev, > + "Failed to enable the timing-adjustment clock\n"); > + return ret; > + } > + } Hi Martin It is a while since i used the clk API. I thought the get_optional() call returned a NULL pointer if the clock does not exist. clk_prepare_enable() passed a NULL pointer is a NOP, but it also does not return an error. So if the clock does not exist, you won't get this error, the code keeps going, configures the hardware, but it does not work. I think you need to check dwmac->timing_adj_clk != NULL here, and error out if DT has properties which require it. Andrew