Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2926681ybk; Mon, 18 May 2020 11:17:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8ReODz6IwekvuwBGipM4K7M4Fiph9G1eCE2631THL8NQi3LN3oKceqmSVKj/MYZ6DB9Kd X-Received: by 2002:a50:a985:: with SMTP id n5mr14768491edc.338.1589825834457; Mon, 18 May 2020 11:17:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589825834; cv=none; d=google.com; s=arc-20160816; b=Jwr5yK4tpg50BzCyPOupP4VXCdbQmf7Cc/KkNWMAgRuLlkA0N+4+iz57sh0oRhXzg1 9/x6un6tub+HE5HQAgt3kcMsDMrIn/O7BqzODN5/y8TsLNJDoejOGg7oJVRxuQNw4Geg 69IAarwGysx6ADw2qtVL5Ba3rLy0NTNwBcNWpq1TOsrYESBJz17a5b1X6h7s/VAVgXyl kvY3ItOPZX+fhW/rhNZWqjGMR3YAyAPS5dMubbsWH6zQkzClFdSoAiHH+5KT6DuU1Icq rDVqFmO8Q2ky00WBmnzrEmnOR3JOlxf+TanMWPH5mmUrGS7n/u5DsFYadlnksnEGMTuv cr+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WdoE9ldYgnXFdF4pQrGN5ITR6WTpaFJZ1s6S5tN8FTw=; b=NdSPoKQp64JY7yfS3GgcUW/Ki7MClwmE1F/IeYIB8r68U+iIs6fOvpeft51gozwYQc 6A00N7X84yInznQs1aPrBaDTQ3Oe2Sgv9DfP80WOtR3fWPi9Q/X8UIkVw+e3tbrfLM46 T9Jw8wDW5wGaErQKY0YQ3rmyyJCEwBDSBaOIykFEx4OgBCFxdGwWtJQoSPEw2g4AEXv9 9XBWjC/+wnOeqbhtHyMI6GkQrOK9j2KMVKcnNE+4oPRnocsvYerlkAc6X0/sPgXqinHp /eCNSHRJXQSU2UkBw3R8qmdx1BcJSi41gRbvSvZCMGTAzOAXkxnrOGB1iiedKA9CYIqy 06RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jSjr0OPQ; 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 t12si2829648edc.551.2020.05.18.11.16.52; Mon, 18 May 2020 11:17:14 -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=@kernel.org header.s=default header.b=jSjr0OPQ; 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 S1731499AbgERSBP (ORCPT + 99 others); Mon, 18 May 2020 14:01:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:43276 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732362AbgERSBK (ORCPT ); Mon, 18 May 2020 14:01:10 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9F76C20826; Mon, 18 May 2020 18:01:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589824869; bh=q+c7ReZyw8cKraevnY75es7TAUo/GWn3VMPlGiTmqps=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jSjr0OPQA2vXkmQfdd/U4FqLql0ZS+9DX/LmYYY6Rmx+FBfx0ZWwoKil+j0YEikbe 5w8GjePkpsGu0Z4LKkxvlOUAUSbJF1A3nLv8UEcFbxVRYtIXBGv84VrU7hdCbEqEeK DfDS2+R7usVtnd2hjXWRZ10HJjdEsJlq6kU1y3kA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rahul Ankushrao Kawadgave , Vinod Koul , Amit Kucheria , "David S. Miller" Subject: [PATCH 5.6 035/194] net: stmmac: fix num_por initialization Date: Mon, 18 May 2020 19:35:25 +0200 Message-Id: <20200518173534.557926933@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200518173531.455604187@linuxfoundation.org> References: <20200518173531.455604187@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vinod Koul [ Upstream commit fd4a5177382230d39e0d95632d98103fb2938383 ] Driver missed initializing num_por which is one of the por values that driver configures to hardware. In order to get these values, add a new structure 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 Reviewed-by: Amit Kucheria Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 17 ++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) --- 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 { .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 plat 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 plat 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 pla } 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);