From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753489AbdBMRKc (ORCPT ); Mon, 13 Feb 2017 12:10:32 -0500 Received: from mail-ve1eur01on0067.outbound.protection.outlook.com ([104.47.1.67]:60240 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752009AbdBMRKa (ORCPT ); Mon, 13 Feb 2017 12:10:30 -0500 From: Claudiu Manoil To: Thomas Graziadei , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 1/2] gianfar: Deal with link state changes during GFAR_RESETTING dev state Thread-Topic: [PATCH 1/2] gianfar: Deal with link state changes during GFAR_RESETTING dev state Thread-Index: AQHShfPc2lfKV0TSCUmeYPzRs6qM0aFnKfHA Date: Mon, 13 Feb 2017 17:10:25 +0000 Message-ID: References: <1486988529-24924-1-git-send-email-thomas.graziadei@omicronenergy.com> In-Reply-To: <1486988529-24924-1-git-send-email-thomas.graziadei@omicronenergy.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=claudiu.manoil@nxp.com; x-originating-ip: [192.88.146.1] x-ms-office365-filtering-correlation-id: 89bc2bfa-500d-43bd-4d74-08d4543333df x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(48565401081);SRVR:AM5PR0401MB2562; x-microsoft-exchange-diagnostics: 1;AM5PR0401MB2562;7:uuSU00DKZNETYybLv/Zx6k9o56xzu0jo9g8aHG1QBKCxIKS2VSlM5AHrHZGN0ikw8wohOOQTCX9ECT+QC8rNkQD50I3M00DwGxJ/9Vr/LvrQ93g94CuI1U1rMLsWPluE/5MpK4MIXtF2kEIXyJWsoh4GeHPQND9qbASplap7mAsLVnSg4YpFWNbLCm4jRp0wMRqVLdMFvpOHOqWLnyIN5rGUULeM2P7nozpjszMM+UPa/u3txo8q44POWigcwAD5T1KMKk93YvcNchQ0pSHShcHqN9VByLDwXmzy26qT69LFaRfKw6o7kFUz2CxwPwtf7+DX1+LSmj79xei2c0JvROp0hvHc+Ew0FwAq61Mw74Ryj6vp2IHJX+GEuUZk6xrsehBJVHRa1ZL6HG2vTfMS+xwIZix/R6Ngmole3100bqQmS+FSWPdUGWzyacMen+AuP+0JGsKVeUcU88/3AJecfof1lqrlSETPCiOMipXd5Z12l5WmxqIlvboYkS165hCnacQZFpj5zPikESCFkKVJsw== x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(20558992708506)(9452136761055)(101931422205132); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123564025)(20161123562025)(20161123558025)(20161123555025)(20161123560025)(6072148);SRVR:AM5PR0401MB2562;BCL:0;PCL:0;RULEID:;SRVR:AM5PR0401MB2562; x-forefront-prvs: 02176E2458 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(39410400002)(39860400002)(39850400002)(39450400003)(39840400002)(199003)(377454003)(189002)(13464003)(9686003)(3660700001)(2950100002)(3280700002)(6506006)(97736004)(76176999)(54356999)(6436002)(99286003)(55016002)(50986999)(53936002)(81156014)(81166006)(229853002)(8676002)(2900100001)(38730400002)(92566002)(189998001)(8936002)(6246003)(305945005)(7736002)(77096006)(101416001)(33656002)(5660300001)(2906002)(105586002)(7696004)(106356001)(106116001)(2201001)(74316002)(86362001)(2501003)(102836003)(3846002)(66066001)(122556002)(25786008)(68736007)(6116002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM5PR0401MB2562;H:AM5PR0401MB2561.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Feb 2017 17:10:25.4768 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0401MB2562 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v1DHAa5m006834 >-----Original Message----- >From: Thomas Graziadei [mailto:thomas.graziadei@omicronenergy.com] >Sent: Monday, February 13, 2017 2:22 PM >To: claudiu.manoil@freescale.com; netdev@vger.kernel.org; linux- >kernel@vger.kernel.org >Cc: Thomas Graziadei >Subject: [PATCH 1/2] gianfar: Deal with link state changes during GFAR_RESETTING >dev state > >From: Thomas Graziadei > >The link state is not correctly set in the case that the network driver >is reconfigured while the link state changes. The phy informs the gianfar >driver, but gfar_update_link_state just exits and therefore looses the >change event. The network driver remains in the old state until a new link >event is sent. > >A trace log from a possible scenario at bootup, when the link state in the >network driver stays down even though the phy reports an up link. The test >sends a SIOCSHWTSTAMP ioctl at the right moment (which calls reset_gfar): > ip-1196 [000] 5.389270: phy_start: state: READY -> UP >kworker/0:2-1195 [000] 5.389784: phy_start_aneg: state: UP -> AN >kworker/0:2-1195 [000] 5.389788: phy_state_machine: state: UP -> AN >kworker/0:2-1195 [000] 6.828064: adjust_link: eth0, link 0 -> 0 >kworker/0:2-1195 [000] 6.828599: phy_state_machine: state: AN -> NOLINK > test-1470 [000] 7.460422: reset_gfar: before locking GFAR_RESETTING > test-1470 [000] 7.470806: phy_stop: state: NOLINK -> HALTED > test-1470 [000] 7.478806: phy_start: state: HALTED -> RESUMING >kworker/0:2-1195 [000] 7.479478: adjust_link: eth0, link 0 -> 1 >kworker/0:2-1195 [000] 7.479482: phy_state_machine: state: RESUMING -> >RUNNING > test-1470 [000] 7.479826: reset_gfar: after locking GFAR_RESETTING > >To resolve the issue adjust_link is called after every GFAR_RESETTING lock >section. Adjust_link itself checks if anything has changed and updates the >link accordingly. > Hi, Interesting findings. I need more time to check the patches. Btw, we don't use "//" for comments on netdev. Thanks, Claudiu