From patchwork Fri Dec 4 08:48:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bert Kenward X-Patchwork-Id: 552610 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3CDD01402A1 for ; Fri, 4 Dec 2015 19:49:05 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755528AbbLDIs7 (ORCPT ); Fri, 4 Dec 2015 03:48:59 -0500 Received: from nbfkord-smmo01.seg.att.com ([209.65.160.76]:46698 "EHLO nbfkord-smmo01.seg.att.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755372AbbLDIs6 (ORCPT ); Fri, 4 Dec 2015 03:48:58 -0500 Received: from unknown [12.187.104.26] (EHLO webmail.solarflare.com) by nbfkord-smmo01.seg.att.com(mxl_mta-7.2.4-6) with ESMTP id a7351665.2ae62d81b940.1645341.00-2470.3962452.nbfkord-smmo01.seg.att.com (envelope-from ); Fri, 04 Dec 2015 08:48:58 +0000 (UTC) X-MXL-Hash: 5661537a6cf2f4b6-9b40e5e642db8f986cbfe2a63ebaeb1b0f4b8a63 Received: from unknown [12.187.104.26] (EHLO webmail.solarflare.com) by nbfkord-smmo01.seg.att.com(mxl_mta-7.2.4-6) over TLS secured channel with ESMTP id 37351665.0.1645327.00-2331.3962409.nbfkord-smmo01.seg.att.com (envelope-from ); Fri, 04 Dec 2015 08:48:52 +0000 (UTC) X-MXL-Hash: 566153740086f2bc-677fce08f26d25f92d46475b84d230e59f209f17 Received: from hgk-desktop.uk.level5networks.com (10.17.20.82) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Fri, 4 Dec 2015 00:48:42 -0800 From: Bert Kenward Subject: [PATCH net-next] sfc: check warm_boot_count after other functions have been reset To: David Miller CC: , Solarflare linux maintainers , Daniel Pieczko Organization: Solarflare Message-ID: <56615367.30002@solarflare.com> Date: Fri, 4 Dec 2015 08:48:39 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 X-Originating-IP: [10.17.20.82] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ocex03.SolarFlarecom.com (10.20.40.36) X-AnalysisOut: [v=2.0 cv=boD78jmi c=1 sm=1 a=8BlWFWvVlq5taO8ncb8nKg==:17 a] X-AnalysisOut: [=zRKbQ67AAAAA:8 a=OjXlt12Agc0A:10 a=wUQvQvOEmiQA:10 a=DHE8] X-AnalysisOut: [91H7Gske2VlohvUA:9 a=pILNOxqGKmIA:10] X-Spam: [F=0.2000000000; CM=0.500; S=0.200(2015072901)] X-MAIL-FROM: X-SOURCE-IP: [12.187.104.26] Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Daniel Pieczko A change in MCFW behaviour means that the net driver must update its record of the warm_boot_count by reading it from the ER_DZ_BIU_MC_SFT_STATUS register. On v4.6.x MCFW the global boot count was incremented when some functions needed to be reset to enable multicast chaining, so all functions saw the same value. In that case, the driver needed to increment its warm_boot_count when other functions were reset, to avoid noticing it later and then trying to reset itself to recover unnecessarily. With v4.7+ MCFW, the boot count in firmware doesn't change as that is unnecessary since the PFs that have been reset will each receive an MC reboot notification. In that case, the driver re-reads the unchanged value. Signed-off-by: Bert Kenward --- drivers/net/ethernet/sfc/ef10.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c index 425df3d..c4a0e8a 100644 --- a/drivers/net/ethernet/sfc/ef10.c +++ b/drivers/net/ethernet/sfc/ef10.c @@ -2374,8 +2374,19 @@ static int efx_ef10_ev_init(struct efx_channel *channel) 1 << MC_CMD_WORKAROUND_EXT_OUT_FLR_DONE_LBN) { netif_info(efx, drv, efx->net_dev, "other functions on NIC have been reset\n"); - /* MC's boot count has incremented */ - ++nic_data->warm_boot_count; + + /* With MCFW v4.6.x and earlier, the + * boot count will have incremented, + * so re-read the warm_boot_count + * value now to ensure this function + * doesn't think it has changed next + * time it checks. + */ + rc = efx_ef10_get_warm_boot_count(efx); + if (rc >= 0) { + nic_data->warm_boot_count = rc; + rc = 0; + } } nic_data->workaround_26807 = true; } else if (rc == -EPERM) {