Received: by 10.223.176.5 with SMTP id f5csp899720wra; Sat, 3 Feb 2018 12:56:51 -0800 (PST) X-Google-Smtp-Source: AH8x224NAbjLcxYN2QpI07Fxyk1avJIRloy4bmLedTiN2kTk7j229fzLutw6o+CtwkfQNnMYR3CN X-Received: by 2002:a17:902:6115:: with SMTP id t21-v6mr40229020plj.322.1517691411228; Sat, 03 Feb 2018 12:56:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517691411; cv=none; d=google.com; s=arc-20160816; b=dYwL8epQ8PvajSbN3SQG9I9uHLrYvwhJUGPHkdfWw1oBl7FDbj9rAHzqCNjZAgvgRH 34sk1ViCiCx40SzYJuxn4c/69KX0W/keRA6kqJnoxXywK0By+vvVLBtnqCrrpFtQenFR p4NGw1RvCc2Bqj6pVn8Ri5qRkTYUvuBtACKiMr0CSB015Dpp+hZh/hfB4nHzlIds1QK/ p7UjeaGggo6oUq1WSpdfFpl2QCz7ey1ywmmGfaSeYAPJ4ggKfaDEdy/E4OWuKELco1fs /bvdA9qpHsunayesQtGP43pZYTk3MP4B3HIaOwwgPqhUYqQ/hsSApFGcebPpF0npkMHf lcXA== 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=WBh3YDIL+jhNSGFyqD7keCK93aighNiej90SxJGdq3o=; b=ANVLESLyxxY8BgBPkcXDqmYbP6ZYU6l14/fUx14FKPnDG22qIHhRtKRJYZs5z0Y+3h qwU3O3/Xc/FtJNIAkfig5t8vCRvazTApUBeZe3GcNBuD5ySwOJSN/tJTj6wwlaYOSoEy S8QaSdoNxaWfPoWT3jVRiGuB+V6TbV5wcCGT9g29imEmcrovZZm6rX0TDCty60oDU4Xe eceVkA06/g6BYjBGcR5rLcRAkvMToxECQtKNSIpV1uDXCPNvWk24xOWnJM2P8E0iRwOF Cm3/7uQ+IkfKz1id3XrDWrWp1plJWQxyuFiRbrRR1BYrlrM/PMfiitRpTQ9s5EkdaEIu LY7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=aCrPUhps; 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 q4-v6si2143679plb.124.2018.02.03.12.56.36; Sat, 03 Feb 2018 12:56:51 -0800 (PST) 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=aCrPUhps; 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 S1754954AbeBCSjm (ORCPT + 99 others); Sat, 3 Feb 2018 13:39:42 -0500 Received: from mail-bl2nam02on0109.outbound.protection.outlook.com ([104.47.38.109]:45293 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752802AbeBCSDi (ORCPT ); Sat, 3 Feb 2018 13:03:38 -0500 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=WBh3YDIL+jhNSGFyqD7keCK93aighNiej90SxJGdq3o=; b=aCrPUhpsSuehOmGtRckTtzZpIy9QpDUyNkbqj+UPv0GQKUPJSsIrfWWbNjHsz50SJckq48+3G57i8sIzck+Tdn8SXhvRQ2i2rnTPPSD/S3n92HcSXtQmU+ZUCUSJl0rRMMdU/TF9HmlG1UhLFZha9YNI+57oWkS0wyoaFYPH7Tw= Received: from BL0PR2101MB1027.namprd21.prod.outlook.com (52.132.20.161) by BL0PR2101MB1041.namprd21.prod.outlook.com (52.132.23.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.506.3; Sat, 3 Feb 2018 18:02:14 +0000 Received: from BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9]) by BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9%3]) with mapi id 15.20.0485.006; Sat, 3 Feb 2018 18:02:14 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Netanel Belgazal , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 086/110] net: ena: unmask MSI-X only after device initialization is completed Thread-Topic: [PATCH AUTOSEL for 4.14 086/110] net: ena: unmask MSI-X only after device initialization is completed Thread-Index: AQHTnRkAfapAp5r/bkq/8NzfXEU4Vg== Date: Sat, 3 Feb 2018 18:01:24 +0000 Message-ID: <20180203180015.29073-86-alexander.levin@microsoft.com> References: <20180203180015.29073-1-alexander.levin@microsoft.com> In-Reply-To: <20180203180015.29073-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;BL0PR2101MB1041;7:pwE6asl7LIrlFeQVWYjL/kGzLUaiX1yaPEoYiPo8P/YOj2qpPD5ul1udtlZEOnNEjbKXz7R1fhiRMu4Y/FuDtZWk2WKBQoF2kXy/TzMdMn8Hg0nqdo3kzBAoyIH3YtpADcAkq19SDlLv6eQF05FG1EbW7PGbVqz/Clubtxvk1/eLYwpFVngbofJgvznnaPM3iVRTLhx8fjUYMoS0x0WgQTCIRxeI0+1BdKP+4oKLgI0d2VFowPdcp/Ybo4KoQBoQ x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: b790b33a-902b-4030-958e-08d56b304162 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7193020);SRVR:BL0PR2101MB1041; x-ms-traffictypediagnostic: BL0PR2101MB1041: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(33061846794335)(47284530071512); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040501)(2401047)(5005006)(8121501046)(3231101)(2400082)(944501161)(93006095)(93001095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(6072148)(201708071742011);SRVR:BL0PR2101MB1041;BCL:0;PCL:0;RULEID:;SRVR:BL0PR2101MB1041; x-forefront-prvs: 05724A8921 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39380400002)(396003)(366004)(39860400002)(376002)(346002)(189003)(199004)(2501003)(305945005)(3660700001)(5250100002)(81156014)(99286004)(81166006)(36756003)(7736002)(10290500003)(106356001)(53936002)(5660300001)(316002)(22452003)(8936002)(54906003)(110136005)(3280700002)(478600001)(72206003)(4326008)(25786009)(107886003)(102836004)(97736004)(76176011)(59450400001)(6666003)(66066001)(6506007)(2950100002)(2900100001)(68736007)(8676002)(6116002)(3846002)(186003)(1076002)(6346003)(105586002)(26005)(10090500001)(2906002)(6512007)(86612001)(14454004)(575784001)(86362001)(6436002)(6486002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:BL0PR2101MB1041;H:BL0PR2101MB1027.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: jHVvej+0Unw7xDIxqL6VcJ+iAPzFOYDnWy7WjlKkIkgxBhMYGB09DOyDxJEy48u039Rm9zjlPFJcsjwiWLj77A== 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: b790b33a-902b-4030-958e-08d56b304162 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Feb 2018 18:01:24.0346 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR2101MB1041 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Netanel Belgazal [ Upstream commit 7853b49ce8e0ef6364d24512b287463841d71bd3 ] Under certain conditions MSI-X interrupt might arrive right after it was unmasked in ena_up(). There is a chance it would be processed by the driver before device ENA_FLAG_DEV_UP flag is set. In such a case the interrupt is ignored. ENA device operates in auto-masked mode, therefore ignoring interrupt leaves it masked for good. Moving unmask of interrupt to be the last step in ena_up(). Signed-off-by: Netanel Belgazal Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 26 +++++++++++++-----------= -- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/eth= ernet/amazon/ena/ena_netdev.c index c6bd5e24005d..67df5053dc30 100644 --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c @@ -1565,7 +1565,7 @@ static int ena_rss_configure(struct ena_adapter *adap= ter) =20 static int ena_up_complete(struct ena_adapter *adapter) { - int rc, i; + int rc; =20 rc =3D ena_rss_configure(adapter); if (rc) @@ -1584,17 +1584,6 @@ static int ena_up_complete(struct ena_adapter *adapt= er) =20 ena_napi_enable_all(adapter); =20 - /* Enable completion queues interrupt */ - for (i =3D 0; i < adapter->num_queues; i++) - ena_unmask_interrupt(&adapter->tx_ring[i], - &adapter->rx_ring[i]); - - /* schedule napi in case we had pending packets - * from the last time we disable napi - */ - for (i =3D 0; i < adapter->num_queues; i++) - napi_schedule(&adapter->ena_napi[i].napi); - return 0; } =20 @@ -1731,7 +1720,7 @@ create_err: =20 static int ena_up(struct ena_adapter *adapter) { - int rc; + int rc, i; =20 netdev_dbg(adapter->netdev, "%s\n", __func__); =20 @@ -1774,6 +1763,17 @@ static int ena_up(struct ena_adapter *adapter) =20 set_bit(ENA_FLAG_DEV_UP, &adapter->flags); =20 + /* Enable completion queues interrupt */ + for (i =3D 0; i < adapter->num_queues; i++) + ena_unmask_interrupt(&adapter->tx_ring[i], + &adapter->rx_ring[i]); + + /* schedule napi in case we had pending packets + * from the last time we disable napi + */ + for (i =3D 0; i < adapter->num_queues; i++) + napi_schedule(&adapter->ena_napi[i].napi); + return rc; =20 err_up: --=20 2.11.0