Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1100683ybk; Wed, 13 May 2020 23:54:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtF8bjkD/Bzg1O0Tt3iBGtjXK37OMLNQcsq9iZyNByMM9hG3t9qJAm6zSH/V32Lk8Ct4A7 X-Received: by 2002:a05:6402:3053:: with SMTP id bu19mr2774348edb.138.1589439291388; Wed, 13 May 2020 23:54:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589439291; cv=none; d=google.com; s=arc-20160816; b=sT5z3SJETnYSCfZdnS2w1A9EDZT50GFn1L3QmEK6N3VXxomkz+fFQ1uBYmP3TeiNHy 7MEk+rM+C/FCuQOyOxAAlAx1rGbF89oRqbMOpYQ7LH1czR5z3WYmHxYoMHTmXf3MuDOt Fyw8E/YUY/A4pvMN7Yv4V2Y5lURYWox/rkJnvM+jzN852H/QLj4Itl7mtifOBFvupPm2 aph1Ni3E4Qog2e6G+ezXLwW8Ak/I3/vhEXHHoP8S2+wUEZbMNPEo3Q4kzdBdxkdJps8D Geq5rZwUW2WEk/NZAvA8KSQ8VXIZd3hct5EA3KNavkgHVz8gbX2IS6mLvCShk5NPlzeH 4g2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=AD73/gyPw537Xp1vDJOYvLHr7JMtBDUrFsijP0WuRks=; b=y1repp86rSvs49hcgpigCSn2rJjHEBUNi61DJOpHXub3BPVZUitEba63YLzArRkqur 4xAJo2guWlk+jgjV4S2jHxry70l8Q73iAnVodP7Yn6eV+lef6pyGVaaDrAQzTJl1U7qt zq2PQMDg9rFgS92hD5qPEsMigs+8qwjgAyJHMHVZtWrwrIXIJwgmAMwkCtmmgYKeJTyg FN87Jxa/U0BxWd9Se8A25iRq/gtz7Cbc9mmzXIhcV/Usm+YKKaHWxLBzhvytLfiIO2f/ qqIN/TynWwMpjoRVWUna9U63br47XQw1BKLKIptpxuvvVBhiNhgaYQSwcgS7S5kQ17t6 SpRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verdurent-com.20150623.gappssmtp.com header.s=20150623 header.b=RdSLSskx; 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 gz16si1262700ejb.384.2020.05.13.23.54.29; Wed, 13 May 2020 23:54:51 -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=@verdurent-com.20150623.gappssmtp.com header.s=20150623 header.b=RdSLSskx; 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 S1725935AbgENGxO (ORCPT + 99 others); Thu, 14 May 2020 02:53:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725831AbgENGxN (ORCPT ); Thu, 14 May 2020 02:53:13 -0400 Received: from mail-vk1-xa41.google.com (mail-vk1-xa41.google.com [IPv6:2607:f8b0:4864:20::a41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47E34C061A0C for ; Wed, 13 May 2020 23:53:13 -0700 (PDT) Received: by mail-vk1-xa41.google.com with SMTP id m18so492620vkk.9 for ; Wed, 13 May 2020 23:53:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verdurent-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AD73/gyPw537Xp1vDJOYvLHr7JMtBDUrFsijP0WuRks=; b=RdSLSskx2Wvw3alRl86UnDw5dnN1+ZHo+jEuOiDqNYvb3EfRrfuQ1fjHd8pEofVcmx OSOsg5Ki+jgXdahzTq8BYmydYLkEp/D/1CWEiD9WIoLB/oyMT0/XdOe73UgI9Xo/PX8Z vAsKTrb1XOhLWFCweUDfv5clUyY9/Ct0OqoS4jylDHfwnX2dZaBf96hPr9UjJyc9qJ54 LfhUMigof8LCnYdiDSe3krEkaZ0cdi5WNh7X76KkQjTeQbosgpRBGY0UM/FYTbyUC8gZ fAmJrAfp1zGCiCU5/M/YWEfBTBFrgSdaXqABtBbjTfwTGLLBBjxmcCGYThD0EubKLklL Y/WQ== 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=AD73/gyPw537Xp1vDJOYvLHr7JMtBDUrFsijP0WuRks=; b=iYu+o5O8g2KJ5zIWSuOoNwwMrzoyUqHKrIlcOyuZvFceNll2tLytIwHbbHivDzYRWA S2qlegQY+8fsyx6wehgjtoGGLE39xYmgOg4jHLEil/qnp8RITaKFOMToJzyjYDb0QERw m+xrcaW/LXchzoxECSXOy9g+1/jxNTLnEST07WHPKQ+I3k/V9j+Ku9fQyuPQwGiU+ZCp 5FxP0n3zWFhSaF3c6lL33EdLJsTB9j5XfOshJJEy4RgiFn6qXUU3oLElV6g9nWlkas/x Y6IZKY4RXBfMhdv1hdDimSxAIwMeuRvypgFmXoyAJuSBJNZAbnfCwLWIsLU/Un4hS+zw ZYYA== X-Gm-Message-State: AOAM5315EGvrBkRhh3nv5yLnRSy68VDunyQoGbvIGfCTPjHjpnEOJXCq e9m8RZMZ7OdgTCW6xJFRLqHmaPOieK/gwsFUJCjgkw== X-Received: by 2002:a1f:a786:: with SMTP id q128mr2448341vke.86.1589439192297; Wed, 13 May 2020 23:53:12 -0700 (PDT) MIME-Version: 1.0 References: <20200514062836.190194-1-vkoul@kernel.org> In-Reply-To: <20200514062836.190194-1-vkoul@kernel.org> From: Amit Kucheria Date: Thu, 14 May 2020 12:22:33 +0530 Message-ID: Subject: Re: [PATCH] net: stmmac: fix num_por initialization To: Vinod Koul Cc: "David S. Miller" , linux-arm-msm , Bjorn Andersson , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, lakml , LKML , Rahul Ankushrao Kawadgave Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 14, 2020 at 11:59 AM Vinod Koul wrote: > > Driver missed initializing num_por which is por values that driver Nit: s/is/is one of the/ ? > configures to hardware. In order to get this values, add a new structure Nit: s/this/these > ethqos_emac_driver_data which holds por and num_por values and populate > that in driver probe. > > Fixes: a7c30e62d4b8 ("net: stmmac: Add driver for Qualcomm ethqos") > Reported-by: Rahul Ankushrao Kawadgave > Signed-off-by: Vinod Koul Otherwise, Reviewed-by: Amit Kucheria > --- > .../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 17 +++++++++++++++-- > 1 file changed, 15 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c > index e0a5fe83d8e0..bfc4a92f1d92 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c > @@ -75,6 +75,11 @@ struct ethqos_emac_por { > unsigned int value; > }; > > +struct ethqos_emac_driver_data { > + const struct ethqos_emac_por *por; > + unsigned int num_por; > +}; > + > struct qcom_ethqos { > struct platform_device *pdev; > void __iomem *rgmii_base; > @@ -171,6 +176,11 @@ static const struct ethqos_emac_por emac_v2_3_0_por[] = { > { .offset = RGMII_IO_MACRO_CONFIG2, .value = 0x00002060 }, > }; > > +static const struct ethqos_emac_driver_data emac_v2_3_0_data = { > + .por = emac_v2_3_0_por, > + .num_por = ARRAY_SIZE(emac_v2_3_0_por), > +}; > + > static int ethqos_dll_configure(struct qcom_ethqos *ethqos) > { > unsigned int val; > @@ -442,6 +452,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev) > struct device_node *np = pdev->dev.of_node; > struct plat_stmmacenet_data *plat_dat; > struct stmmac_resources stmmac_res; > + const struct ethqos_emac_driver_data *data; > struct qcom_ethqos *ethqos; > struct resource *res; > int ret; > @@ -471,7 +482,9 @@ static int qcom_ethqos_probe(struct platform_device *pdev) > goto err_mem; > } > > - ethqos->por = of_device_get_match_data(&pdev->dev); > + data = of_device_get_match_data(&pdev->dev); > + ethqos->por = data->por; > + ethqos->num_por = data->num_por; > > ethqos->rgmii_clk = devm_clk_get(&pdev->dev, "rgmii"); > if (IS_ERR(ethqos->rgmii_clk)) { > @@ -526,7 +539,7 @@ static int qcom_ethqos_remove(struct platform_device *pdev) > } > > static const struct of_device_id qcom_ethqos_match[] = { > - { .compatible = "qcom,qcs404-ethqos", .data = &emac_v2_3_0_por}, > + { .compatible = "qcom,qcs404-ethqos", .data = &emac_v2_3_0_data}, > { } > }; > MODULE_DEVICE_TABLE(of, qcom_ethqos_match); > -- > 2.25.4 >