From patchwork Thu Apr 28 01:09:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jianqun Xu X-Patchwork-Id: 12829872 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1D128C433EF for ; Thu, 28 Apr 2022 01:10:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ah88IOd+t/uHZwlCsuZtzCQx2u7K2gRcF1VYl3GapwA=; b=VRwh1kF2pXErs2 Qx78zg7I1xRqGdjjQKfOGvtyfgMjp5diYx76tcIGG9rVh4VHrySlnSeaIldDSKAzllQTQRuhBAREh AIfTfDYhkFLiqLq1FKNZbvLNrNwKh6gr83xT8x5sl84YVmlcDwiLVGDlELs8F80TGKrZUUmabTC2K lrNhD/9Bsn/to2HzXJ5ycvFi5bMIB2jm+vRXcxEpxJrZ5H0Z+sXMsLNaNzulvNWp/N3CvBVEMuYD4 EZQwTXj0FX08p3AzOb7gM1bVoD1HSwgBZM3V5I9sr79XYlvw6wk4bIKGIWmyaRgm6QjD/q7Zw5RJj 3aOsFFNb7WKLBMlWLvOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1njsf2-004GQb-25; Thu, 28 Apr 2022 01:09:36 +0000 Received: from mail-m121145.qiye.163.com ([115.236.121.145]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1njsey-004GPC-Du for linux-arm-kernel@lists.infradead.org; Thu, 28 Apr 2022 01:09:33 +0000 Received: from localhost.localdomain (unknown [58.22.7.114]) by mail-m121145.qiye.163.com (Hmail) with ESMTPA id CCD26800371; Thu, 28 Apr 2022 09:09:29 +0800 (CST) From: Jianqun Xu To: peppe.cavallaro@st.com, alexandre.torgue@st.com, joabreu@synopsys.com Cc: davem@davemloft.net, kuba@kernel.org, mcoquelin.stm32@gmail.com, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jianqun Xu Subject: [PATCH RESEND] ethernet: stmmac: fix for none child queue node for tx node Date: Thu, 28 Apr 2022 09:09:27 +0800 Message-Id: <20220428010927.526310-1-jay.xu@rock-chips.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgPGg8OCBgUHx5ZQUlOS1dZCBgUCR5ZQVlLVUtZV1 kWDxoPAgseWUFZKDYvK1lXWShZQUlKS0tKN1dZLVlBSVdZDwkaFQgSH1lBWUIeS0NWQhpIH0seHk hJSUNLVRMBExYaEhckFA4PWVdZFhoPEhUdFFlBWU9LSFVKSktISkNVS1kG X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6PxQ6Thw5Mz03PhNRLw42CDZN KisKFBJVSlVKTU5KSktDSkxLSExNVTMWGhIXVREaAlUDDjsJFBgQVhgTEgsIVRgUFkVZV1kSC1lB WU5DVUlJVUxVSkpPWVdZCAFZQUlLTUo3Bg++ X-HM-Tid: 0a806db7496cb03akuuuccd26800371 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220427_180932_643575_2D3CDE5D X-CRM114-Status: GOOD ( 10.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In case of nothing to be set for tx node result in no child queue node for the tx node, this patch init the queue to tx_queues_to_use instead of 0 to support dt file set no queue node for tx node. Signed-off-by: Jianqun Xu --- drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 2d8c095f3856..4f01a41c485c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -279,7 +279,7 @@ static int stmmac_mtl_setup(struct platform_device *pdev, queue++; } - if (queue != plat->tx_queues_to_use) { + if (queue != plat->tx_queues_to_use && of_get_child_count(tx_node)) { ret = -EINVAL; dev_err(&pdev->dev, "Not all TX queues were configured\n"); goto out;