Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3561148pxf; Mon, 29 Mar 2021 05:47:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZvaGwn1OQG6etsI3GIwd7L5BllEF+70UBjsyEQKYS37hG5nyFUzoVaf30+YYcIMDBLBl2 X-Received: by 2002:a05:6402:1d1a:: with SMTP id dg26mr28004418edb.266.1617022035203; Mon, 29 Mar 2021 05:47:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617022035; cv=none; d=google.com; s=arc-20160816; b=wCOMG5sBpLyj+e9edIKhBflqNOBpxmzhiVvQUkHObJwrb4+YvT43DdRNYVkLfkQ6cR 94T4KejybZJ9cnBW7hY6Dy/Lp4GthpeCdG/IlzK5to4/5WBIZhMHnWpfzsokgerQrD9o BQ4nvLbfNne4uw0u0L46CeFy6/6psv3BcQp03XNImbKr5YlfpK+DgUkshwiPPOC/FHkl QN8nW+nlhc2Ont4UJc3Ds+E2qBqV/RHtn9M5BMs0GRxu9Si6VnDxbEqOqzOGZ695iPXA 9Mv8BKGJ7qfp6yMEZExHncuOJ69KDwAd1w9rH354fsxiXqhil9KsoWSqtbfJGwf2Sv2s t0vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=PRjvtr4F64Lfhlb500oBv4oKg6yHpyCw2SlD0qWwryU=; b=Opt/Q70IwyTScdaKUCo1FX9hJphhPr+MPKTFQqwDxXOOb5gL4D7JYKDtAgleVXjPl6 4ZYBrPur2r7JHXhJvkkmSjC1b5Y50bqEAiYxOEdrE7gnVul1hJcuY8EKrJ7vzdrJeNsS J2HAZp08lHuwtq+bn/dkyqB1R0zDMNWwo/pvGyBwDGnIxZtuCGATHHTfg1e9YmRtpIPy 7nbdLj94mVTbVNvPWiAL9Q+tWY1mT9rpCo/9Ss9GebJYbvCfxn/5ZHRKgWgWr4C4vO9+ XzfRS+Htbtq/X1XWbxHZGtfzQOO/rNcbYjhDD99SMDXgDjXWct+6/O0R3vzIxRuMWA5d vLqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XK57e1dC; 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 kl9si13354598ejc.271.2021.03.29.05.46.53; Mon, 29 Mar 2021 05:47:15 -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=pass header.i=@gmail.com header.s=20161025 header.b=XK57e1dC; 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 S229468AbhC2Mpk (ORCPT + 99 others); Mon, 29 Mar 2021 08:45:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231363AbhC2MpN (ORCPT ); Mon, 29 Mar 2021 08:45:13 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF319C061574; Mon, 29 Mar 2021 05:45:12 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id a7so19240756ejs.3; Mon, 29 Mar 2021 05:45:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PRjvtr4F64Lfhlb500oBv4oKg6yHpyCw2SlD0qWwryU=; b=XK57e1dCm3jZAiJj1Hq1O9xpkLK+sjO6QIX20Xy5urts752G58q13Ey2E0AbxR6mEN QObTaMS54TQo3/dDAl4CyiTympMoqOcljosYp9tPC3bqJawZa6pM6wSiyRbqkp4Yda+z 4Lsc9n+65sP7ibXp/gmHA/XOka3nVOcuTELm2/GIP4lYvabNKHe9YNQOd+JKK5G+rJ8u LfkY94E/MfXvXhRPnqbMwvJkA62+sGivKE1c5tl/nK1rlBqIZNjGKJ8uwHC4v8GsKo1G t6hsxWNYQsjkXIlxmP6IdUGxqN11vN4sxKJmiom6aixIUr1o10xC1JFWO4B8gXaouxqY dhOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PRjvtr4F64Lfhlb500oBv4oKg6yHpyCw2SlD0qWwryU=; b=jC/7d7znEN9F9TO9/BtgjG8rQTS6YPZt7dYqiJZKQVBY240RPNZhh3yNARQUJ88CvX tLcvzoFHKGdEldhZzAwlOkuJPetHfJZ6nnZ+V/0wBkrP1f+QwJb3yuBJm+OriOPOlxF+ frsoJhDR0oIdWBhfzCPgQFsZCXb+BNCRjXlUs1v2Ev3TcrOwE7PTTkvb7U4VuOQcPYmh nxeYUr2ORUBnA7/x2BJBuWsxW+vuAZkvn0mOScpW89VoepERXzMyKcosEONvHPRm23t1 xl8pCiRRspHp8dSbXb9W27C7BHluCpiLaKMMU7DTsNzVYhV3lS1l45wlM7Xpo3iMAXmN UN1Q== X-Gm-Message-State: AOAM533H2oz5g1RaTNZy8FTtyviNL/EFNLbuhK4hmu4rIQ2GnDRSvKg/ 0CpaMhyZCfeCdoOvsFF0Q9VgKjWyHF+XRCoAlU4= X-Received: by 2002:a17:906:ae8d:: with SMTP id md13mr28348994ejb.275.1617021911347; Mon, 29 Mar 2021 05:45:11 -0700 (PDT) MIME-Version: 1.0 References: <20210224115146.9131-1-aford173@gmail.com> <20210224115146.9131-4-aford173@gmail.com> In-Reply-To: From: Adam Ford Date: Mon, 29 Mar 2021 07:45:00 -0500 Message-ID: Subject: Re: [PATCH V3 4/5] net: ethernet: ravb: Enable optional refclk To: Geert Uytterhoeven Cc: netdev , Adam Ford-BE , Sergei Shtylyov , "David S. Miller" , Jakub Kicinski , Rob Herring , Geert Uytterhoeven , Magnus Damm , Linux-Renesas , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 4, 2021 at 2:08 AM Geert Uytterhoeven wrote: > > Hi Adam, > > On Wed, Feb 24, 2021 at 12:52 PM Adam Ford wrote: > > For devices that use a programmable clock for the AVB reference clock, > > the driver may need to enable them. Add code to find the optional clock > > and enable it when available. > > > > Signed-off-by: Adam Ford > > Thanks for your patch! > > > --- a/drivers/net/ethernet/renesas/ravb_main.c > > +++ b/drivers/net/ethernet/renesas/ravb_main.c > > @@ -2148,6 +2148,13 @@ static int ravb_probe(struct platform_device *pdev) > > goto out_release; > > } > > > > + priv->refclk = devm_clk_get_optional(&pdev->dev, "refclk"); > > + if (IS_ERR(priv->refclk)) { > > + error = PTR_ERR(priv->refclk); > > + goto out_release; > > + } > > + clk_prepare_enable(priv->refclk); > > + > > Shouldn't the reference clock be disabled in case of any failure below? > I'll generate a V4. Should I just regenerate this patch since it seems like the rest are OK, or should I regenerate the whole series? adam > > ndev->max_mtu = 2048 - (ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN); > > ndev->min_mtu = ETH_MIN_MTU; > > > > @@ -2260,6 +2267,9 @@ static int ravb_remove(struct platform_device *pdev) > > if (priv->chip_id != RCAR_GEN2) > > ravb_ptp_stop(ndev); > > > > + if (priv->refclk) > > + clk_disable_unprepare(priv->refclk); > > + > > dma_free_coherent(ndev->dev.parent, priv->desc_bat_size, priv->desc_bat, > > priv->desc_bat_dma); > > /* Set reset mode */ > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds