From patchwork Thu Feb 23 15:01:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dupuis, Chad" X-Patchwork-Id: 9588435 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 0344560210 for ; Thu, 23 Feb 2017 15:01:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4F6928305 for ; Thu, 23 Feb 2017 15:01:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9D8D2879E; Thu, 23 Feb 2017 15:01:39 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI 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 9E8B828305 for ; Thu, 23 Feb 2017 15:01:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751169AbdBWPB1 (ORCPT ); Thu, 23 Feb 2017 10:01:27 -0500 Received: from mail-cys01nam02on0072.outbound.protection.outlook.com ([104.47.37.72]:6626 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751099AbdBWPBY (ORCPT ); Thu, 23 Feb 2017 10:01:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=I1rPc2oFMGlXy99+JcilT3rHGPY8i8H2Ls1NLErTIXw=; b=dOTpfanqhFCWzhqVy9fWxdUml7GpMC3roIj9JJzYQC/Xj42uWnVQYqhtccGCtYlFiaSo4Ua5yOKZFqKlfIbkawAwXeNs0fdfOVc1Y6kGThtU9WXa3GeiECCVFvggqh4EzaqtIjWzl/BpF0qUJ3aD3ammemc+hf5352gO3S6Olp0= Received: from BN6PR07CA0040.namprd07.prod.outlook.com (10.172.104.26) by BN3PR0701MB1378.namprd07.prod.outlook.com (10.160.118.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.919.13; Thu, 23 Feb 2017 15:01:07 +0000 Received: from BY2FFO11FD003.protection.gbl (2a01:111:f400:7c0c::156) by BN6PR07CA0040.outlook.office365.com (2603:10b6:404:a3::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.12 via Frontend Transport; Thu, 23 Feb 2017 15:01:06 +0000 Authentication-Results: spf=none (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; suse.de; dkim=none (message not signed) header.d=none; suse.de; dmarc=none action=none header.from=cavium.com; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BY2FFO11FD003.mail.protection.outlook.com (10.1.14.125) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.919.10 via Frontend Transport; Thu, 23 Feb 2017 15:01:05 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.309.2; Thu, 23 Feb 2017 07:01:05 -0800 Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id v1NF15ja028187; Thu, 23 Feb 2017 07:01:05 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id v1NF136b028186; Thu, 23 Feb 2017 07:01:03 -0800 From: "Dupuis, Chad" To: CC: , , , Subject: [PATCH] qedf: fixup compilation warning about atomic_t usage Date: Thu, 23 Feb 2017 07:01:03 -0800 Message-ID: <1487862063-28158-1-git-send-email-chad.dupuis@cavium.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39450400003)(2980300002)(428002)(199003)(189002)(81166006)(2351001)(105586002)(5003940100001)(80596001)(356003)(8936002)(50226002)(626004)(110136004)(575784001)(86362001)(38730400002)(69596002)(107886003)(81156014)(50466002)(48376002)(33646002)(2906002)(106466001)(4720700003)(4326007)(47776003)(42186005)(50986999)(189998001)(5660300001)(305945005)(6916009)(101416001)(36756003)(8676002)(54906002)(92566002)(87636001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1378; H:CAEXCH02.caveonetworks.com; FPR:; SPF:None; PTR:50-232-66-26-static.hfc.comcastbusiness.net; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD003; 1:uMDvMhKUh0Ph+bod9cibWhFYJo9Tw5QoJcwQcktPXfNZhHz9M2eg/0VUZqfQ+lPSGYaPuCilgVjO+cCni/2g+KwxaRSYUe2EOp0JF7T7FgE9nDCP7vVA/mVNvlGpem2avf51xhbUQBsNY74HwZ3gz+0mXljAzrYr4xmETnIsFq3NQWkG/1dydM5Jw1iGs+1Nh7wB4xqXrPLMUWK/DaPsUk8YIBd8Q4cy7IYKe3HsadnvnDaejBjPPxg3vfQrkBSh2Y7GIdaItmFhhYzPdkl2lcciJFCCGTRlLvniqpYV3TtwYy6aRRe4VuSC4T3k55MEbPPcQwrPNbX0WYI5xJrsHrTV+5OVKUQyxY1OkuMFsfbzu3z3p7E9VurvULvJX1qeAjIy0PKcIMl/OCc+It+JPRN69liP9ePvV2/PMnzvQY6M+pdrRTRpzwwfJRJtqDoyv1OWbIr2Obl4bHvJEHMhPk04Xh6y6k+b11keZ43GKcx79Ef9q3M4gH203mm58mLabZvZQFaw7609jfC/MMJrYA== X-MS-Office365-Filtering-Correlation-Id: eb2b1933-8edb-4d95-9a94-08d45bfccaf7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1378; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1378; 3:fGmL1R7r/xjzV2hYcZIf4gF9z4XVMMjsD/9VD9LD1GABS7BkL3wzMKnNh0Ts4nLIiIuAV/gNSmHhhiTd7peeiqU4JFAJ90GeHgwigCw71pKgs9Lotho294orodxyXqBcpKb2I2rn3I/G+eGV3rXatTGQtmAyHQ8Nd8wQXwvaMQb4rKkxYR36g/1n0m2ZD2jI0iPX6c/BHvEeQmutEIul0USy26deAZSk4FE2IDpH3FZdRfgUy6MiXPtWmgX5jXRMEDpDVwyNeQ2NQa6wZ+H3Q1gf+MEQKgB2xkI/2wyIddKlcs961ziL6hHvGV4+h7k9HEPVg/dR8w+rD6nFwLB3LoRwTzxTEe4dzgqRPLImY2Vban9BjTHask2bdXbX/YJM; 25:npb1G1ICt0iKFo1FqAtlnzB/2VHPNp0KA2681jZGXhKRZXlAjwbynVLxNMiFQ3LdKhyLg6hxXW7XSKTNMJUxejwozDu9XU3lvkvImAjapXd0dN1JcyMEgHiSmrly8Zez8kiBbsWJxCq/omx0Zf80b5WlqHXXy+obxuyhEHCMPRCyQMwUYdgyAfgj8RDI2mTX+6MnYSvkmwmf8TqCqtHQDyCCX92haBKrL/nhrIALHqWZHjyvMwetBqXgWBWhL13yNURqlFYt43YsWpi0lxVMclYFi/EwDZOzll4LuoMxxvR7ts7+GMtWYIbyECFbUe+OgZFICtmOruJ3qnSnmuvFEQ9peTMSZSNAMGWYgzb3+uEIVN8g2BlaLSwR9h3WNpeOPuuZ4kU0PvpvmntaQm4q64ynAywvg7xmltHBCWMwlxse+RG70rz6216x+7uc6eglTZ9rWu6AuemfKZj49QIYWQ== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1378; 31:mzDZOFS0hwsKL4g2TWMuV0BI19iQsZQXKG+EDgHQEJk0nzygFRplb7F2v9FL1cVTLsdRVMWr4jjsSOyqm1MbatXDAXS3pHqCknvt485BITdlbFW9deUpAA3KXocvPMSL5nAHA3C1nxEkTOuEC/mGF75HosXs7rGm6w0PEAXhKPbKNE9HMyYoLSYmc5irFoA3BS2dAB9lhGEnWvmY3AoQDXeWM0CNDS/K79WB0Da1YRRoTy/pTcl6AkXOVexaPqTjA7DzITL95uiYkANhMEFzma1tlUCsLQ8jdxXSqJO3D4w=; 20:yTgXXQ4qFWhRsUvnE7OpjhvTjkZ+BX2EcqcA8D7M1QczkETiq5WQFjFZGkOoBAXlm/Bj+ucrmwBYUMzCmX0Pvplg0Wq+CiV8zwXcOoIgUlmiyFJhKyd6BZPdd4rutotKKA/cN6VpaMsw4j4/aBEEd8c4XwlongzYbEsFoYEvo+Xc9fjJ5gyqo2CWH2Y5+wfaRah5f0n2AhrKDX8kz8Got0Wt8pAn8g3whw/cA2Q8TJnvFwvm3P6veivW9R4/uitPHMKUJY7riMQkvWQYY2+oSozaiRo3jZI3nGuWFyIddz8hux+De9WVDneJifzt4oLYqyDgrE2Eiv7uUlA6haYLk9LVPPwGKMpF/6GHsp3qVK50d0dJy7w4V1bX8HtMXg0A96XgO0uDdSu88oWlH60gh8eag42thE9iqM+ZMMpNhDfNr9bFAiQXP5+zECkEx9FvXLAITOFN/l1PBsH/C4jFg3j9ZRHMeDTsWjVD/e8pL8+WHRq2qLb2G8rlkSI4p2dC X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13017025)(13023025)(13024025)(13018025)(5005006)(8121501046)(13015025)(3002001)(10201501046)(6041248)(20161123555025)(20161123564025)(20161123562025)(20161123558025)(20161123560025)(6072148); SRVR:BN3PR0701MB1378; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1378; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1378; 4:CFIs+jwUcHJCb2eRYIW3qV3gKKLP3AMAEj7HtIu8mp1M4I50t2h69yBKM0wi20/xmc65ChEeSFdCafLA7+WaA7qHHKDxLEkTaa5ildGTTtNRA+QQEzIVj+bPbh0qeZ4ik8IFdNKpQtNZr5aHlTAoqXu4cFV6nUxVLXd49uejxouz3s8BoAOY54A0kEkJv3X2HlftUNIjegxHqlZ+/VFDKQ2bayPQ/Ty+I359gaOXyZZedLKNgESPxSMtg9wZl+QfcP0an12XGiUePDI9IgR/wQvypN6QW8mngpVRlzZmjRMYstmTLgFSgbOYy/w9RlpSmX6pIQCzlnQu1P/SIuL3ZIQO14aoQarTIFxqW5t8S5FcB8fn+etb/XFDVYkb2tgGcWNO90mkMy3FcUxsFYxMeTdL/ZhfL03RmPcwOlbtIZBnVAghGH5IqAqaHKvBpJMp9OPF+fqGUc4Ft37iYGACnU+wlmwNzAGnPzjiUh0+VaFznYF2ogBneS81zXke7s8F0aOsnjbPhBlXoUwK/Ojqb1BMIXqOkOGKNkLa5Pdhhg8ZLqrYLbu9IPxbRsGcUcSXmILBxbsp7+8iliIqX/hiTENo2jadxJQgGSWFCWfUNoMw4m9c5c3vnEpirvI4BYdPWpJRuim0aUj5e4E9P+lTXjB/z6UFL855A4kq36inHjcu/P/sdTJysQJNKuv7YoVUBojckHg3WTKlPlrtZQJb6PMifVpKG9IbwKxJFJumNfKnIqumkXNBRyT3T/eRq/NB X-Forefront-PRVS: 02272225C5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0701MB1378; 23:5GpFuEf4B5ZX2UumSrKMKBT7p07Gw4P6AM6LmXe?= =?us-ascii?Q?Qw3WVLPQjeIw285KpJ2TSxTPNB2K0ta25ckce+fOPZvgk14QPYMVIGszNps1?= =?us-ascii?Q?oZLgLvl+EZ8gKzVWQ4+7l7M4Y5ouKEntiT7jzygPXjXXhHUjh4/aWzoNwbOo?= =?us-ascii?Q?RyuNPKFcdF/inLEBDIY22ztvDgDTueFI7Aau0rhbbFNITjaCZWohu/9KS/rg?= =?us-ascii?Q?0jEwj2udy9+ntQxw9pVXWjgXMLoPCpt4clEgb9aSa7DKs7o36gDFT/jMWSsa?= =?us-ascii?Q?vvB1t7gB4NyGhy7av/HB3wGzPMHJ5cdGMfyRVyaz1ziFfAQNM/bPeEiDSh7c?= =?us-ascii?Q?4PnsvCxL3mnFZfSN8/Ar5Xqo2xU+NryPZkISOA+4XkS7t1bGA4nVfSf+d1CC?= =?us-ascii?Q?jXlm+dvlCVQGWBFwL4K1nsDBrpsRC4EmD+4JZvYiONYKRUzsh1VNUO4n2EJ6?= =?us-ascii?Q?FaLKGLXp2ACtkaC6V2n3JtXj/Glf3sgNwBxH2+wpbAUIu+yRCSs3mVN5w9nN?= =?us-ascii?Q?+m5Nf4va6zQgbetqZh145dG5IEgq0s/h6xiVZQb7C9RZXk0bDN4NQwTPsrBV?= =?us-ascii?Q?AOt5fvREBHqCZ7T5lFCRKVqUKKwWM4uZGoWYVfNvc7TODLslixYNbGnHVryU?= =?us-ascii?Q?IkMNqwc0Qy5LT4zdoZY4A++t5IVfS9AqHfvfKflhCsfyUOASj/X/JfSOR0cb?= =?us-ascii?Q?M1OlN39XfpBDEvcMh6War3TREkkv7BOrWVjz7aI2F2oBmbpWc/GZu0niyG15?= =?us-ascii?Q?PGzKc1LFeAH20xbN1Q7vT8OJ3bhrupqI/DO6o4gBpIMjxPf5Rqfu75KDhfj4?= =?us-ascii?Q?GB73vcs0Gyu9bVcQJlZBit9matIKi5Y6VrHSoEHiXFM9FdmMMxtZPVyrWHlc?= =?us-ascii?Q?Wi0fp05k0Z9C5YAeH/EOC+wDOziFhdSl6Hpc/WEkBMooG7lhuS9mbA9x0PAb?= =?us-ascii?Q?owUXVe5QvQ0Fw0AMxZfdvEZR1BGHqsoXn0EIeh82nwMotSoHWO6yBjsuV19b?= =?us-ascii?Q?Um710dEqdWWl3GZtFgmjP47xnOwwI4PmKW1ymX7f17JsfBcQ4eZCT+tO7YGU?= =?us-ascii?Q?Me9zO1mY=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1378; 6:E4wTqjdo9NTVKv9eIQL8+CfFzrbr26pHGQRV46wyq52nx+jkelYRrXYjfy26haU9MXvjDKNvfiU//XDojzQQ0X7zp0pOX8FPCRHR/aKZOVccBpq92vsACgsngKC7h2lbP78IWOGSvOeXkikN5XtGvoq+v+XAubZAzfoxKTrxu5lvGTndzWlnSmnsYZQCJUDI73FW/fJAm544j6ythbXkTPjDH8zp1CSGm9D6ASxFRmmUo/UymJ3uXK9zXeW+AJYnHrmXqJZ8kbco8GdVSToPp8DPtQHkBqaof5FHSKklonDciaCLoPmRYdVW1MXA2XQmyfkAxTQaoBk+Q1dW7AmSDQOYIqx2CJRilIVgwcnfxaB8ErkLrFxJyYnQd35k20RR1FKArSm4IhoVdy2DhRXdRg==; 5:tTLNbR9WOwKyI1RG8kS7n2LU1hZX/Jcb0qA9EnK36UFtSylOe06dwoXwafl4ENDlu7ckJiWKRDmy7Aru7osIGyYWExs2FOwyobMOlBPwnhx36p4u9n5mwp54gGM4ClsMMl4/HRRiK3F3uFZfrer9pA==; 24:PGBfWf3F6cJFfiZD2Azep3emfQlu8CuE94JH2JmLfuNc6RJxPkjBlB2QUmiv6m0f336Uo+PHn40Ge+Sus28HoINK/Dnpl3DsReM3SAF8gr4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1378; 7:53B5k1XgbBZEK1w+5E0krq2Oj+iA5V91UVnXERn9aKuOfQ7pDiDXjOY1MHGQu8YPGIsnKL/GQg3cYpm2htXu9A9PjcHl87RqzT+Vwp+n9ZWz3FpyStzVRXiLqn5Z63OgVv789cAtCzkSxByN+Z73/0hyb3F4dWIc2NMk3xnriuHs/m4XNNRaIWftFO3fcJwFHtcJbACkyVC0l6SpzZYfAyDVBdjgrLqGnQjUfJ8UIaBpU/cJUW9xsHT9Qfbo9V7QYAmAPoTqufQG9EVILD1uzdT4HKBOEyacJfF7UKy60DHMTP+JSXgDuEluI+ETf3yYmNag9JIeG6ac8wrgaMgi3w== X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2017 15:01:05.9009 (UTC) X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194; Ip=[50.232.66.26]; Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1378 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "Dupuis, Chad" Based on an original patch by Hannes Reinecke. The driver didn't follow the atomic_t vs refcount_t change, and anyway one should be using kref_read() instead of accessing the counter inside an kref. Fixes: 61d8658b4a435e ("scsi: qedf: Add QLogic FastLinQ offload FCoE driver framework.) Cc: Hannes Reinecke Cc: Nilesh Javali Signed-off-by: Dupuis, Chad --- drivers/scsi/qedf/qedf_els.c | 6 +++--- drivers/scsi/qedf/qedf_io.c | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/qedf/qedf_els.c b/drivers/scsi/qedf/qedf_els.c index 78f1c25..59f3e5c 100644 --- a/drivers/scsi/qedf/qedf_els.c +++ b/drivers/scsi/qedf/qedf_els.c @@ -183,7 +183,7 @@ static void qedf_rrq_compl(struct qedf_els_cb_arg *cb_arg) rrq_req->event != QEDF_IOREQ_EV_ELS_ERR_DETECT) cancel_delayed_work_sync(&orig_io_req->timeout_work); - refcount = atomic_read(&orig_io_req->refcount.refcount); + refcount = kref_read(&orig_io_req->refcount); QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_ELS, "rrq_compl: orig io = %p," " orig xid = 0x%x, rrq_xid = 0x%x, refcount=%d\n", orig_io_req, orig_io_req->xid, rrq_req->xid, refcount); @@ -474,7 +474,7 @@ static void qedf_srr_compl(struct qedf_els_cb_arg *cb_arg) srr_req->event != QEDF_IOREQ_EV_ELS_ERR_DETECT) cancel_delayed_work_sync(&orig_io_req->timeout_work); - refcount = atomic_read(&orig_io_req->refcount.refcount); + refcount = kref_read(&orig_io_req->refcount); QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_ELS, "Entered: orig_io=%p," " orig_io_xid=0x%x, rec_xid=0x%x, refcount=%d\n", orig_io_req, orig_io_req->xid, srr_req->xid, refcount); @@ -758,7 +758,7 @@ static void qedf_rec_compl(struct qedf_els_cb_arg *cb_arg) rec_req->event != QEDF_IOREQ_EV_ELS_ERR_DETECT) cancel_delayed_work_sync(&orig_io_req->timeout_work); - refcount = atomic_read(&orig_io_req->refcount.refcount); + refcount = kref_read(&orig_io_req->refcount); QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_ELS, "Entered: orig_io=%p," " orig_io_xid=0x%x, rec_xid=0x%x, refcount=%d\n", orig_io_req, orig_io_req->xid, rec_req->xid, refcount); diff --git a/drivers/scsi/qedf/qedf_io.c b/drivers/scsi/qedf/qedf_io.c index 486c045..ee0dcf9 100644 --- a/drivers/scsi/qedf/qedf_io.c +++ b/drivers/scsi/qedf/qedf_io.c @@ -998,7 +998,7 @@ static void qedf_trace_io(struct qedf_rport *fcport, struct qedf_ioreq *io_req, io_log->sg_count = scsi_sg_count(sc_cmd); io_log->result = sc_cmd->result; io_log->jiffies = jiffies; - io_log->refcount = atomic_read(&io_req->refcount.refcount); + io_log->refcount = kref_read(&io_req->refcount); if (direction == QEDF_IO_TRACE_REQ) { /* For requests we only care abot the submission CPU */ @@ -1340,7 +1340,7 @@ void qedf_scsi_completion(struct qedf_ctx *qedf, struct fcoe_cqe *cqe, /* Good I/O completion */ sc_cmd->result = DID_OK << 16; } else { - refcount = atomic_read(&io_req->refcount.refcount); + refcount = kref_read(&io_req->refcount); QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_IO, "%d:0:%d:%d xid=0x%0x op=0x%02x " "lba=%02x%02x%02x%02x cdb_status=%d " @@ -1425,7 +1425,7 @@ void qedf_scsi_done(struct qedf_ctx *qedf, struct qedf_ioreq *io_req, qedf_unmap_sg_list(qedf, io_req); sc_cmd->result = result << 16; - refcount = atomic_read(&io_req->refcount.refcount); + refcount = kref_read(&io_req->refcount); QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_IO, "%d:0:%d:%d: Completing " "sc_cmd=%p result=0x%08x op=0x%02x lba=0x%02x%02x%02x%02x, " "allowed=%d retries=%d refcount=%d.\n", @@ -1556,7 +1556,7 @@ static void qedf_flush_els_req(struct qedf_ctx *qedf, { QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_IO, "Flushing ELS request xid=0x%x refcount=%d.\n", els_req->xid, - atomic_read(&els_req->refcount.refcount)); + kref_read(&els_req->refcount)); /* * Need to distinguish this from a timeout when calling the