Received: by 10.213.65.68 with SMTP id h4csp1671477imn; Mon, 19 Mar 2018 10:09:52 -0700 (PDT) X-Google-Smtp-Source: AG47ELsaCPiuq0H4MYn08TVeXOKceX64affqBZ0Y6BujvUmhBY0wC8qfRa5xjdUAQXbTj+X7F1uL X-Received: by 2002:a17:902:96a:: with SMTP id 97-v6mr13154539plm.183.1521479392410; Mon, 19 Mar 2018 10:09:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521479392; cv=none; d=google.com; s=arc-20160816; b=jmuZ97zLtUPl2DntfCMbIdgb7XNYn7R9W0mwLJUnyQCKnPnlyFsEPXwqISd4VKRUqq 3VNb8zq+M5foSPgqc3UuDWCE6HGQ5IzwmeFxM+l9wLCe9xiqGxmatkkOat3TbPO911t9 +F499u+/2mZwOYiPTVTsrF5BZkHu6WsekRsCwbnF2uKLLKjKGIe6XiIkxFTnCe0cJGXQ 9KSz7MA0JZr2R47X8gKwFYjx+ineAph+rGssoUBAJBZwflxrRvMoCSppwzGS4/WCC18O QAZ38uu3iRdR+5fTgtRg7SY0YSDHIARvMfpyCrUJyDC6/DkvMkBSc5u4xH2X1RPSh8lw hkOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=ibPEZK4/1aNR26IyxG7GjNCH7TpXziv+Hq8tK3mgr48=; b=GBgcfCl4eF3pbIMhI+CxbRI6RrxTE7J4PljNa55oJlLOopoTZUOjkjQg+lW5aSZael PoJDlaZvyeRGzeg77SKbf/njxvnOaP93AD3kG3dvhDSX4D9K10df7rHNVufqv6oFcec7 6iO0k/gjUn5xs3U46gN8TjkYS+iYpCugDGFsZy7UU4rSbJsm0kfxlgbFU1eOgPlOGcZZ 4CkCLTVGEyFW63tsRbY6hQbAK3/pmIfV8WSOzKq1R8RjEh2i7ROm12gSuGV9nh+7SojQ dE/HMM88VnWOZzDX4c8I4dQZOasjvgqqMnWteRJytetfaxGgfqM5KtRp1MgLMwxjhUAr er4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=T8JJICuA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n66si249892pfa.17.2018.03.19.10.09.37; Mon, 19 Mar 2018 10:09:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=T8JJICuA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967794AbeCSRHq (ORCPT + 99 others); Mon, 19 Mar 2018 13:07:46 -0400 Received: from mail-bn3nam01on0125.outbound.protection.outlook.com ([104.47.33.125]:62326 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S966057AbeCSQKs (ORCPT ); Mon, 19 Mar 2018 12:10:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ibPEZK4/1aNR26IyxG7GjNCH7TpXziv+Hq8tK3mgr48=; b=T8JJICuAx9KCfubBqSor5xH5oBy6CEQcpnedfxnSD1Zgnc1hUOXblgPeJaLaLPUVGdKDkcedmTI30/WhPe60VJlMTmv8S6spOA/j9uxqIt0um5++N2CvC5BManK9hB8F7UQNPRtHApHmznhwxbijEVuWy1+gh5VX9kyGotwjmzQ= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1045.namprd21.prod.outlook.com (52.132.128.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.0; Mon, 19 Mar 2018 16:10:39 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62%5]) with mapi id 15.20.0631.004; Mon, 19 Mar 2018 16:10:39 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Russell King , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.4 131/167] net: phy: avoid genphy_aneg_done() for PHYs without clause 22 support Thread-Topic: [PATCH AUTOSEL for 4.4 131/167] net: phy: avoid genphy_aneg_done() for PHYs without clause 22 support Thread-Index: AQHTv5x3yTLIIOOp5UmaAgOmDvcTyQ== Date: Mon, 19 Mar 2018 16:08:07 +0000 Message-ID: <20180319160513.16384-131-alexander.levin@microsoft.com> References: <20180319160513.16384-1-alexander.levin@microsoft.com> In-Reply-To: <20180319160513.16384-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1045;7:CRUBGUNTSklp/z6IBoSFP57e5vCrhHCpfUp1zS6fYm3mOOgVcmKFPP14VE3H6AwWGiOlu+Teh/KWDJRWgTlpTg7mB6tM0ySrnjFhQgvttSDCxX0oW/Cyg2UfEYeNmAGors0hbII5PyNGPiajHzaBcsYHV7PEu2F0FMjZMq8AqWIVZ0leUat8m8dI597lB476ekcLzuuPDNGScoHSukYzRo1kzMA/GR0+K4KVUmP46xo0MMCbU+hHmPOZ5+JnyFQ2;20:WHv012DVoPNDTiGIULQt1jomvACCE8bt3c1+wAZBPd6PkAW4u1zm3Vmn8y805+sLRuhBogbeipiELPNL0HMkXx2h1Vd8dq2g8c0fCtFY/hMen+tBsHayhKq/4OqWmsJf31w2EdDdSg/zMnM9dLX3avLCVwweO8YqdHfwERZdCic= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: ceaf6c28-8124-4327-4c24-08d58db3f503 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1045; x-ms-traffictypediagnostic: DM5PR2101MB1045: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(85827821059158); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501300)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:DM5PR2101MB1045;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1045; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(376002)(366004)(39380400002)(39860400002)(396003)(199004)(189003)(86612001)(66066001)(6436002)(76176011)(10290500003)(6666003)(2950100002)(305945005)(8676002)(97736004)(6486002)(86362001)(25786009)(26005)(102836004)(8936002)(6512007)(7736002)(3280700002)(106356001)(107886003)(110136005)(68736007)(81156014)(22452003)(6506007)(186003)(54906003)(10090500001)(2900100001)(4326008)(2906002)(14454004)(81166006)(316002)(105586002)(6116002)(3846002)(5660300001)(36756003)(72206003)(1076002)(59450400001)(53936002)(3660700001)(99286004)(2501003)(5250100002)(478600001)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1045;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: rLrY7WMNuT0rq8bsb+oQqxVCMiEx5ETsrY6Z58wNziRdP8MSqmY1JXg0uaurK/xaUVzN5TWTcWIqi2OBEyQn7tcDnb1zr8gyDp34P94UhxA9uMKtY3YUB+THXE0+HxwJtSHFXrZ0BK1PiH9CcwBZ8vlP6LeH/04yDAnlFV7oZTs7d+oIjA3gAaBeOu2Nsx4iPVE0z9iRM0ChphEdTTsxWyTTYUIVHdp84BL92QfQlLvCP94X5dMxrktnsetmB8mPf/gAEWqU27ZLzATuvtIEBsOhGVYY+ZURL3dAkzoDmLjeB3KLXAPG9qcHsmcg+9KRXIovGPjfKCWhSpfgSx0EkA== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: ceaf6c28-8124-4327-4c24-08d58db3f503 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 16:08:07.0471 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1045 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Russell King [ Upstream commit 41408ad519f7a2a1c5229e61f2a97f4df1b61adc ] Avoid calling genphy_aneg_done() for PHYs that do not implement the Clause 22 register set. Clause 45 PHYs may implement the Clause 22 register set along with the Clause 22 extension MMD. Hence, we can't simply block access to the Clause 22 functions based on the PHY being a Clause 45 PHY. Signed-off-by: Russell King Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/phy/phy.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 7d0690433ee0..7d2cf015c5e7 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -148,6 +148,12 @@ static inline int phy_aneg_done(struct phy_device *phy= dev) if (phydev->drv->aneg_done) return phydev->drv->aneg_done(phydev); =20 + /* Avoid genphy_aneg_done() if the Clause 45 PHY does not + * implement Clause 22 registers + */ + if (phydev->is_c45 && !(phydev->c45_ids.devices_in_package & BIT(0))) + return -EINVAL; + return genphy_aneg_done(phydev); } =20 --=20 2.14.1