Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp22833pxb; Fri, 15 Jan 2021 04:57:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJwgC5OLtLy0PG5tYibQmo4l7+P2ntPKkoHGsoBH6kS8ByOgsh54u55zMamdczPajPLd45uj X-Received: by 2002:a17:907:175c:: with SMTP id lf28mr8445732ejc.110.1610715476375; Fri, 15 Jan 2021 04:57:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610715476; cv=none; d=google.com; s=arc-20160816; b=Sf1EnCcAEZb2qAbcRVQKWC2Fln/O0dBGISqfMQKbsefEfNS0N8R9kNvuaaxUUw63xX 8ZQBCuTL6n8U1Vt+X90kE/eoLiyesuO6Os89+K3jY6UbitswK68bwRCAmeuasgLDRg8T EtYLO7ysXMki21LcDDztcpFy45b3gQiauNHcpmZLOTeZunEPOX5a29YcDLvRY9+wCzq8 yqAN8kuv/yan9B8fFz9pDqJ7k9DBjoT7WKmNtG2TUohG7ulOFv4XG7bh8pq7Z6LlJ9pF JE3stSu1S0LRfTp4+G/geiV+jz2O66F5fMyUwgaWz0MAW14yVpxkUtT98HxphaoLbHUx nLHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=REXd2ToWCABoTNC9waFZz8tSdJx0V4xH14tqHLUjT9c=; b=zIb1w4reDe/UIa+XhD5c7rq6aEZJIPs/AF3oxjBpsWABZQUpzTA3gh3PpTOmUv/62S 3Q9lvNa3SG1RfJ9pJgvd1/s5ObCM9+/dgvzXe9Z1zKr9YlB037QCW7kO1VFRhbB28J+H 0MDg+AkqnZsQM/VJ3ST+pDugRd1YOj3Aa6eLIBgx2qnW9okiZjrlYyqFTxzLsp6H74VT K4m7rL6Ys6AdJB4aFpm8qpyFRKmpBBLekUUCTG7PGYWuP2Z/ZSAHKz/uc9qw15ylubSd sBsC5b7ys8yU5PVqP+9agwOOVlXYolRfRu1E2+fzN9KyvpaMPENSVzVxnNj1mE90IfCr 7xMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ny7508z+; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c10si3860057ejf.281.2021.01.15.04.57.32; Fri, 15 Jan 2021 04:57:56 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=Ny7508z+; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387476AbhAOM46 (ORCPT + 99 others); Fri, 15 Jan 2021 07:56:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:41338 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387486AbhAOMe2 (ORCPT ); Fri, 15 Jan 2021 07:34:28 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id BFDAB23359; Fri, 15 Jan 2021 12:33:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610714028; bh=gZfwmeGsudtwa0WwYkqE0TmHjgAHmIsTdMI71jPhMck=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ny7508z+tZAk85otLwekxX91Z/ktZIimsLVArGbl/DvTiCyQej7MIGrjq+cLvuLLt AmEp2ls6GcD4odCRlikN4PRkYbRGEN1unGvx8FuphbPfV8Xm3LbFGx36T5P9paVzJI i+Ffbojepok25qNjtQ8QEL6iH31DZ3lxVepbcBEg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yonglong Liu , Huazhong Tan , "David S. Miller" Subject: [PATCH 5.4 05/62] net: hns3: fix a phy loopback fail issue Date: Fri, 15 Jan 2021 13:27:27 +0100 Message-Id: <20210115121958.663845018@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121958.391610178@linuxfoundation.org> References: <20210115121958.391610178@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yonglong Liu [ Upstream commit f04bbcbf1e38d192e94bbfa126731a52332c40b1 ] When phy driver does not implement the set_loopback interface, phy loopback test will return -EOPNOTSUPP, and the loopback test will fail. So when phy driver does not implement the set_loopback interface, don't do phy loopback test. Fixes: c9765a89d142 ("net: hns3: add phy selftest function") Signed-off-by: Yonglong Liu Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -746,7 +746,8 @@ static int hclge_get_sset_count(struct h handle->flags |= HNAE3_SUPPORT_SERDES_SERIAL_LOOPBACK; handle->flags |= HNAE3_SUPPORT_SERDES_PARALLEL_LOOPBACK; - if (hdev->hw.mac.phydev) { + if (hdev->hw.mac.phydev && hdev->hw.mac.phydev->drv && + hdev->hw.mac.phydev->drv->set_loopback) { count += 1; handle->flags |= HNAE3_SUPPORT_PHY_LOOPBACK; }