Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp978277pxb; Fri, 15 Apr 2022 17:13:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhK3LtQlqmHdUeRk3W3+IYFD6VQLWb+22PcOEHl0WmD9HGhyG5LMYEmtKyBkR8QOnkEQJD X-Received: by 2002:a65:460a:0:b0:399:24bb:c9ea with SMTP id v10-20020a65460a000000b0039924bbc9eamr1110751pgq.410.1650068028946; Fri, 15 Apr 2022 17:13:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650068028; cv=none; d=google.com; s=arc-20160816; b=ww6kbJzlVMku11YDni6ZFpCArMIOvTZIfDWPoDE0S1weUHQfkSQf+0iaM7U6cNoXzE A2MInP2BOBwUfq9/ny/+5TkN1i9A1Mq8yUFBPfmBAyV5bvfvGqwu/3dM/NU5hqMGU/4T 1DjoyFU+tUZlBx6MHai/KSMHq/rUdeej8d9IxhDxc+9TS9V9vlXZXFhUuXGDZ8Y7dudh fOTwCBdFrEg7cVy31QlsopToH7AGdYvwWV0+33n55lLBAN2t4MSCrdcmjqK5vqocA8yN utPsV2GT1lSHSdpy6EhJyuLyx+k3PlXgOsxbSgVs0NwyZL/t+BQ8TdvPT4SZC24RrF6Y P6og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=aQRTF3v6WmLQmOeCEhYv0QQbxEyOXWbbjzXVmNY/wkY=; b=pEfVxAG/h1e10+4TrYYXZsmRrkdi13EYo60fINoO37K9yFVGJmfPCepeTZ1ZCm8SP1 ALDJHF9MXZDznGO7TGaXQi7n/XZ22VXGYg+uJ7bcXNnV0a7JDL9v0ZKdfFqnomqkse43 Og6vAT5yhMCU5g1286HqedIk5Ug5FrAAOx9A1DuliUGvQcjf8js5QWglgfgboigieSz6 bfmc2bfe72lClmgoIPa/pC//XyJhQ3RffT9DfyjE5RCfDmKaFLSNwZxI7D2N8SkxIVlY 7actztvewTN7ilY4q7bZHsrA8RtGdum5FPFbKk3gWhr550P5x8hF1hGGTWc/EtHWUqPf vPpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=llHpHdqz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id t188-20020a632dc5000000b00398586b09e0si2555187pgt.278.2022.04.15.17.13.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 17:13:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=llHpHdqz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 55CB65E772; Fri, 15 Apr 2022 17:13:39 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344198AbiDNR6c (ORCPT + 99 others); Thu, 14 Apr 2022 13:58:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242987AbiDNR6a (ORCPT ); Thu, 14 Apr 2022 13:58:30 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40C6EEBAE9; Thu, 14 Apr 2022 10:56:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=aQRTF3v6WmLQmOeCEhYv0QQbxEyOXWbbjzXVmNY/wkY=; b=llHpHdqzvNcD5E/zBlEkbGwDwZ awyXGRCalKzGpXgpJTKnZ1Rx/jFaigc2ycwIal82CfULTfB8c8gFABKUaog+NQp4WzZii1IHVQvcW btE28fS7pwXTvi6nR1tRlX5C1gea8womMd8aK4vhZJrp6RJfTyCNZuCT5xsWLxk1EoBw=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1nf3hD-00FrML-U9; Thu, 14 Apr 2022 19:55:55 +0200 Date: Thu, 14 Apr 2022 19:55:55 +0200 From: Andrew Lunn To: =?iso-8859-1?Q?Cl=E9ment_L=E9ger?= Cc: Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S . Miller" , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Geert Uytterhoeven , Magnus Damm , Heiner Kallweit , Russell King , Thomas Petazzoni , Herve Codina , =?iso-8859-1?Q?Miqu=E8l?= Raynal , Milan Stevanovic , Jimmy Lalande , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org, Laurent Gonzales , Jean-Pierre Geslin , Phil Edworthy Subject: Re: [PATCH net-next 06/12] net: dsa: rzn1-a5psw: add Renesas RZ/N1 advanced 5 port switch driver Message-ID: References: <20220414122250.158113-1-clement.leger@bootlin.com> <20220414122250.158113-7-clement.leger@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220414122250.158113-7-clement.leger@bootlin.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +static int a5psw_mdio_reset(struct mii_bus *bus) > +{ > + struct a5psw *a5psw = bus->priv; > + unsigned long rate; > + unsigned long div; > + u32 cfgstatus; > + > + rate = clk_get_rate(a5psw->hclk); > + div = ((rate / a5psw->mdio_freq) / 2); > + if (div >= 511 || div <= 5) { > + dev_err(a5psw->dev, "MDIO clock div %ld out of range\n", div); > + return -ERANGE; > + } > + > + cfgstatus = FIELD_PREP(A5PSW_MDIO_CFG_STATUS_CLKDIV, div); > + > + a5psw_reg_writel(a5psw, A5PSW_MDIO_CFG_STATUS, cfgstatus); I don't see anything here which does an actual reset. So i think this function has the wrong name. Please also pass the frequency as a parameter, because at a quick glance it was not easy to see where it was used. There does not seem to be any need to store it in a5psw. > +static int a5psw_probe_mdio(struct a5psw *a5psw) > +{ > + struct device *dev = a5psw->dev; > + struct device_node *mdio_node; > + struct mii_bus *bus; > + int err; > + > + if (of_property_read_u32(dev->of_node, "clock-frequency", > + &a5psw->mdio_freq)) > + a5psw->mdio_freq = A5PSW_MDIO_DEF_FREQ; > + > + bus = devm_mdiobus_alloc(dev); > + if (!bus) > + return -ENOMEM; > + > + bus->name = "a5psw_mdio"; > + bus->read = a5psw_mdio_read; > + bus->write = a5psw_mdio_write; > + bus->reset = a5psw_mdio_reset; As far as i can see, the read and write functions don't support C45. Please return -EOPNOTSUPP if they are passed C45 addresses. Andrew