From patchwork Thu Feb 23 01:22:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adit Ranadive X-Patchwork-Id: 9587631 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 30A4260578 for ; Thu, 23 Feb 2017 01:24:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F31428725 for ; Thu, 23 Feb 2017 01:24:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12FEC28737; Thu, 23 Feb 2017 01:24:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3450928725 for ; Thu, 23 Feb 2017 01:24:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933417AbdBWBYk (ORCPT ); Wed, 22 Feb 2017 20:24:40 -0500 Received: from mail-cys01nam02on0059.outbound.protection.outlook.com ([104.47.37.59]:31345 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933015AbdBWBY0 (ORCPT ); Wed, 22 Feb 2017 20:24:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=onevmw.onmicrosoft.com; s=selector1-vmware-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=FQHPINGRQSFhxlDkEizKZ9MJy6MS6oJ7T3MrmkAASVU=; b=swN48Us4aw3X24YFCRMDO9i8oUaZfP/dogDNBB9E3Lf0vqlcx7DKv1QLCT74Dl3anrqRzDiQfNKymUEcCk06MjDSW8rS9g9/Dr1diLVT+MsxIba6AxqmOLKi5jzxE8mXaZulJ8e7lKEsBtCgkrJ8MMCxcN8fUROnT0IOjI3bevI= Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none; redhat.com; dmarc=none action=none header.from=vmware.com; Received: from promb-2s-dhcp95-136.eng.vmware.com (208.91.1.34) by CO2PR05MB2421.namprd05.prod.outlook.com (10.166.95.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.7; Thu, 23 Feb 2017 01:23:19 +0000 From: Adit Ranadive To: , CC: Aditya Sarwade , , Adit Ranadive Subject: [PATCH 3/3] RDMA/vmw_pvrdma: Activate device on ethernet link up Date: Wed, 22 Feb 2017 17:22:58 -0800 Message-ID: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [208.91.1.34] X-ClientProxiedBy: CY1PR1201CA0032.namprd12.prod.outlook.com (10.169.17.170) To CO2PR05MB2421.namprd05.prod.outlook.com (10.166.95.21) X-MS-Office365-Filtering-Correlation-Id: 4c5df028-2a29-4f29-9950-08d45b8a8d85 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CO2PR05MB2421; X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB2421; 3:uF0egw9GcXTybaqD/7W6qlW3AKE2YZgY+N5EAEpqQpRPBioF5P8JG6pbQYDT3ti3BjArK6jbo7kGLy+PdNR6tAC9jNcgTLNF1Oy0DqA5WVgHmK7uaxqwQU2KYyJClTfQYb8+NLsMzZsWM262JgXyZEp1IFFjSIdlQ2WCxUobuLD58yxtQAaLp0BRCh/+x2akC6hpzFlcb+EAi/lHiGJNmBjDfRVg7cOYOImZbaIVs8oKRv7rMKa/u25xtgqKbk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fIxBKfA/r5yBVD2HhFLQiXt2QFdZURcLoRqTLlPNkyd9tl9aOsh6KtWkfoxlf/p9gPbxaeeynm0UWnBwegBHZ5aFWY15oALYkvu9vm495u+yky9ZmuBvxWFh3mZjpsDFjrUZ3ApiPRJs6hb4tiUbWxU44s3BJnNU9N0BrDar3VqlYdUDHhzFJqOM6VxeqXgxGahokcGe1XXJXVeSc09 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(61668805478150); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123558025)(20161123560025)(20161123564025)(20161123555025)(20161123562025)(6072148); SRVR:CO2PR05MB2421; BCL:0; PCL:0; RULEID:; SRVR:CO2PR05MB2421; X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB2421; 4:VX6pgNhOQI61Vqs4LVLDwLKBXO7dYEbZp80c2KEiUu0Gxv8FRhwfoe6cxBSK97eju7wFMbPU4nv6KqJ1li/Tr3q9NRm0tPzHGrEvxN3ORk55TmZ4cTGq7rB845M3y9VYGl2k6KUlTDWsNTTeuZAlUCeOFzBQ9yzc2cQPr9u/A8D1+aWNYbAWfMzmbpVh8qodlFcrjty1HmyIZHIfB9u1Xe/rjOB1XvJAP35mgDbtvk6ojbJ3sOSXYSxa3dycPS/TyWKBq02AX7u6A5ZQpCZeKAGESUHJ2SzsJu9KnNqXodExTVIwGZ4SZLcjxSWADyhloD27zKzFnXSQOUj/ZiJCU/Z5/VwZTWhy5jBqOOArdwACojw82Ts5aEQuhRgj6QgpMzROqfqgyfUwB91Y/R2IOGf3tzOddHQVlYfu5Nm513JK5mK1LzFFv6XnsFs0tEarDe1OagO3ArEAVJsrXFCgcbHVO0MzbLTbQ1LX5uUT+wXS7F6z1J0riHX27rYkaW5f8eOzOBEqiUMNfEA2KS66qnro4/ZHc5pr6gv2Z52Vd+ebYbV6g7QDmw1XXw8llgBE/7NioZAr2pMquNVebBZf3Hv7tctpJ8Xckpfv95WMwVkx72e7n/pdnP3EcXpFjjMyDFCNS25CgphmiIWLJfiB7Q== X-Forefront-PRVS: 02272225C5 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(36756003)(5660300001)(4326007)(47776003)(305945005)(66066001)(118296001)(50986999)(76176999)(7736002)(50226002)(2906002)(6486002)(8676002)(81166006)(25786008)(54906002)(3846002)(6116002)(48376002)(50466002)(42186005)(86362001)(92566002)(38730400002)(33646002)(107886003)(189998001)(5003940100001)(2950100002)(6666003)(53936002)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR05MB2421; H:promb-2s-dhcp95-136.eng.vmware.com; FPR:; SPF:None; MLV:nspm; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB2421; 23:njYWMSlOuX6wn4iu2x3J+Vq98k7BXk3j2xQxpgsKWpcOdyR28gZ3poG150fYuny1g8qksCp3Ce8Xt7sC+PV0BipYPtIxe47GZp23IUyT05WFeS9yUF1AqLy814AACKKm934j8/bFu0V0wQ32zLygofAJsaEfDXfRwfqmau588Z1YRDfoCq8MRs6BUMiiK5jXzaDMPeW72NqyBpkmCQuAN1KkkHTE/HrjckQaYB0Im/W+rSzpjj1/CNSL4CGsLXAW+LqWmdkXpLXFiMlpVj6ri4T4nfDa+dMnbirJMVDOpIGvRyOLTXM6pN4LAKQFbDaJyVZvxz0YCeH/bh/G/jRDCs/Db05RhrBSWOnOPvJWwhXZc83eNyR1DYyjcOVmlJG12AtlxT+CgGaYu5N6U4leEv8bzgDRLD/yErOOhSJ/0W5ex20Y7JZjFOWhOqEv9hMcwvninQilq/f5kGXO9FIuk1RXQbU+nl48WzMr5e1QKPwt+Ncs6wWYNTyK4OMq7tXOsYQx5s4L4bDzoLqwmCmxGLcC4M2RgTmNBgNyYFo6F8eF4SscIJipBSBmnQLhk5qgL3eEres49MObncCB1IcbjzFxhU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NJh8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB2421; 7:mkuX8iCQeSuQ2r28ad6vN296+mPRF7TdJfgtHQpfSrZiqSgvWEVYTuKU6IiWiHJo2nZpib2gCxe6eWU/pfNfUw6MC/3h2v55vh2SLuGoj5YthuCaqpgtCmVsIFuLKZrc5fje/2dkt7iqx7jbUAULfJR8tBswcZ9MRB7w+/8o4AF8RIow9bPyMNEwrqSxsi9OMJkM7LTfUz8C3ijsR/cyuawzXl5b+Cq8w87xk/k/fW05cHk5vESKUjkKdmTAY3vBH/Vg8fk70uIEIWchoVp4DKpAiOi8gyi2TYK9gCvt2Mkc4FxP5bi9tyorBcdGF78lGCo++U8/JLNsyk32lX6ktA==; 20:pP3uDbkh2xG1rh1UA5sflA+/vj6thWlbB1HCR5fvbmBEtbwumxBr5h0RJSrejaPxd2q5sf4KdIiLLZdBrPxxVt+inF80DJdjPdNtUWvzoFKvFLqzjsJ3vBWnfhgrw1Uf/miz0XXDS1E5OSOFCht1++u/2Ca1JtLRIN4FtE4ARbQ= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2017 01:23:19.9536 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR05MB2421 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Aditya Sarwade Restore device state when ethernet link changes to active. Acked-by: George Zhang Acked-by: Jorgen Hansen Acked-by: Bryan Tan Signed-off-by: Aditya Sarwade Signed-off-by: Adit Ranadive --- drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h | 2 +- drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h index e69d6f3..09078cc 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h @@ -132,7 +132,7 @@ enum pvrdma_pci_resource { enum pvrdma_device_ctl { PVRDMA_DEVICE_CTL_ACTIVATE, /* Activate device. */ - PVRDMA_DEVICE_CTL_QUIESCE, /* Quiesce device. */ + PVRDMA_DEVICE_CTL_UNQUIESCE, /* Unquiesce device. */ PVRDMA_DEVICE_CTL_RESET, /* Reset device. */ }; diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c index 4380d3d..bc4ec3a 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c @@ -56,7 +56,7 @@ #include "pvrdma.h" #define DRV_NAME "vmw_pvrdma" -#define DRV_VERSION "1.0.0.0-k" +#define DRV_VERSION "1.0.1.0-k" static DEFINE_MUTEX(pvrdma_device_list_lock); static LIST_HEAD(pvrdma_device_list); @@ -659,7 +659,16 @@ static void pvrdma_netdevice_event_handle(struct pvrdma_dev *dev, pvrdma_dispatch_event(dev, 1, IB_EVENT_PORT_ERR); break; case NETDEV_UP: - pvrdma_dispatch_event(dev, 1, IB_EVENT_PORT_ACTIVE); + pvrdma_write_reg(dev, PVRDMA_REG_CTL, + PVRDMA_DEVICE_CTL_UNQUIESCE); + + mb(); + + if (pvrdma_read_reg(dev, PVRDMA_REG_ERR)) + dev_err(&dev->pdev->dev, + "failed to activate device during link up\n"); + else + pvrdma_dispatch_event(dev, 1, IB_EVENT_PORT_ACTIVE); break; default: dev_dbg(&dev->pdev->dev, "ignore netdevice event %ld on %s\n",