Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1947640pxu; Sun, 13 Dec 2020 08:28:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJzsdNTMi2vHknd0+5p8mdxU231Gf4c6zUqx55gXXIga/K3zHCbdItRPl7ckmwz5jZwCGhAy X-Received: by 2002:a17:906:77dc:: with SMTP id m28mr18918948ejn.64.1607876891916; Sun, 13 Dec 2020 08:28:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607876891; cv=none; d=google.com; s=arc-20160816; b=oDbuR/6L/4XpZOMqftkVjPM2rSmbarHickkfIT+gpl1BO4zs3jgcJUf3PrFe2GrMyb SUr5Cq8Df7MjQ+tuvgoN8PzdqAyR1CSfo0L0Q68SEHZs1VdXNFfXn6REDfTZXzTzYIK4 ix1i0bSql3iuGvmBc9G5QGGiZSLfN4mXUZfT1shKRHB7VhqF9DQTXFlB8C0PJTbs0RLn NvVZF9uzUpXh9OSxA6UCcZuYHC1/bJuBkhHJArbzR7F1WTQBKN7WmgPBidOuJkrZtQsu I/itAI01Dw9k2sG2gIyAExXI1ILr/WlZ+vI6wK4LTmFI2leSInaT9l/rktotW0snGGuH OH3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=t/n/SZO57zH+6NrngqhLDU18rnISd3B9T8WfYcT9OVY=; b=cQ/2reiCFOgNavtf/nGHBI+5eRvKpf3k7347TYExvNoCN/uZ5LeSgI3nq2xAM8JG9y wSVGL1zNjOtgZjcFhoKuDhVnrwBoYNqxK2/n46Nwu2OyPggwT2cDCljB5rndd9HRYwH/ 7jyVgYSEnmJ7Yx2KPHLRda77/nWQMtl2al9ID9puPMfDN3BOci2Q+Ss/5JiIa8FVTtzn /N+A8fLkUYeiBXhGfHzn5qpi3s80Ddjd5LcK3ZkaXRm8pP/3fgnNiqS/sjqtBdhlhxAk op+ncsSuLmam5ypDd48Z1ka2vH3YizQwXWvAG/K59v0gVh5JDzQD2ei2jC/b19mg8CjZ /gMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Az53OnX2; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x13si7963037ejo.619.2020.12.13.08.27.49; Sun, 13 Dec 2020 08:28:11 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Az53OnX2; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439568AbgLLRzo (ORCPT + 99 others); Sat, 12 Dec 2020 12:55:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727514AbgLLRzn (ORCPT ); Sat, 12 Dec 2020 12:55:43 -0500 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 662FDC0613CF; Sat, 12 Dec 2020 09:55:03 -0800 (PST) Received: by mail-lf1-x12a.google.com with SMTP id a8so19731575lfb.3; Sat, 12 Dec 2020 09:55:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=t/n/SZO57zH+6NrngqhLDU18rnISd3B9T8WfYcT9OVY=; b=Az53OnX215u3j5WV+PfOQiLX82i72LtCP7dvEQ96A8kK3qS8C3Yv4xUDOQWladxXs9 2SkA373eLzlsNOLBxk4M/73cAVEALP6c9NrqovDL5ZgLf93wbEVJwB+fOjdgbU3d8WLw ibdYNObpMFPqCF7iRkEC9uVt5PV6NLsdHDKH5Mf37lkPsn+068an5K7wFCR4Quc221X0 5a76gyRf8R9oSvTwnuBYqMDBX92VLARbOd2fYRqP6ioFKCvghQhuZB1kTReh1DVcMsCJ JYoeb8GDnrBHwj8sQDto795RDI+Kl+FZEBUgUSl1H7A+huK96BUAnoS1RULfbbfam+l1 B4rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=t/n/SZO57zH+6NrngqhLDU18rnISd3B9T8WfYcT9OVY=; b=Y9fnv8rKCnjEaK+yLlO75LSh2rkg0hb3An3AZHrmNmiebX3BaazFGX9lnphUobNl36 lkPErQVt0CJs/+pwFVrl1M6fdCf7jayiKuXb/0qn/JPwRB0IcZUY7l8Yrbex1i6aJhgH iWsbT0Jub98QXJOq/rl/ipyObj2fNQw12UJbfrLoLKkHIChkbg+lZnfFIOWxZRVQsuig o8VF8X852b+SaQ1rHGPXAUeMGneJdovvJn4JELOX/5TYngib73KMmmXcqq+4Q0rQeLWq h0hgjC3kQ3j+DNW9PIdvrOXwodj/qqDB/m5g8w0EIJPJmM4t67qQ9EFrCrbUGzrH6/5M g48g== X-Gm-Message-State: AOAM532tLO9WY1GelwjKho/89WOcJvC5dcO2J05vrow4gWZ4I4c4xKhd z3fRZVftGUaO6tZZaFtOaLSh0u3hkuU= X-Received: by 2002:ac2:5691:: with SMTP id 17mr7391498lfr.537.1607795701603; Sat, 12 Dec 2020 09:55:01 -0800 (PST) Received: from [192.168.1.100] ([31.173.85.216]) by smtp.gmail.com with ESMTPSA id k11sm1353981lfj.170.2020.12.12.09.55.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 12 Dec 2020 09:55:01 -0800 (PST) Subject: Re: [RFC] ravb: Add support for optional txc_refclk To: Adam Ford , linux-renesas-soc@vger.kernel.org Cc: aford@beaconembedded.com, charles.stevens@logicpd.com, "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20201212165648.166220-1-aford173@gmail.com> From: Sergei Shtylyov Organization: Brain-dead Software Message-ID: <7f5f8ef2-3e4f-5076-0558-26b48e75b674@gmail.com> Date: Sat, 12 Dec 2020 20:54:58 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <20201212165648.166220-1-aford173@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello! On 12.12.2020 19:56, Adam Ford wrote: > The SoC expects the txv_refclk is provided, but if it is provided > by a programmable clock, there needs to be a way to get and enable > this clock to operate. It needs to be optional since it's only > necessary for those with programmable clocks. > > Signed-off-by: Adam Ford [...] > diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c > index bd30505fbc57..4c3f95923ef2 100644 > --- a/drivers/net/ethernet/renesas/ravb_main.c > +++ b/drivers/net/ethernet/renesas/ravb_main.c > @@ -2148,6 +2148,18 @@ static int ravb_probe(struct platform_device *pdev) > goto out_release; > } > > + priv->ref_clk = devm_clk_get(&pdev->dev, "txc_refclk"); Why not devm_clk_get_optional()? > + if (IS_ERR(priv->ref_clk)) { > + if (PTR_ERR(priv->ref_clk) == -EPROBE_DEFER) { > + /* for Probe defer return error */ > + error = PTR_ERR(priv->ref_clk); > + goto out_release; > + } > + /* Ignore other errors since it's optional */ > + } else { > + (void)clk_prepare_enable(priv->ref_clk); > + } > + > ndev->max_mtu = 2048 - (ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN); > ndev->min_mtu = ETH_MIN_MTU; > MBR, Sergei