From patchwork Wed Mar 15 20:27:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iyappan Subramanian X-Patchwork-Id: 9626609 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 0C9C360244 for ; Wed, 15 Mar 2017 20:27:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0E1E26E81 for ; Wed, 15 Mar 2017 20:27:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5BDF28610; Wed, 15 Mar 2017 20:27:12 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2401826E81 for ; Wed, 15 Mar 2017 20:27:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=k1W/POgE+mf30FAxsn4GWstoUHr8OvQcM194Mj44LJc=; b=Mz5K4ZLtWoGQ+8icqOnW/kzx0W Y7HQUc9ZuKjGZVvnVdpZ+4djOoC4/Flmj7tRL2nUz5IoiLVuSyA0+8x7QAuLw25EsiTfQSvysBvcl /KfBm/7b01M322g4kiQr73F1xifxOy33sJ/k3SY/JknlkYHaGVtdEXS4R7/YojRonyZXg1/P+n9SW XCevjXs2Hu1puLyICL/wtiE5r/iCEMAiu5fNcIAxYGuP43AS4YEqmnwQBNyS9a1iHFAEVTsBhW+c1 h1PgUl8Edlmmu/Z7PJTETs1j3eZoig+H52DwLGfUucQKofk8GbbU27zDihY+yb/CZWo5fwfmBv2dc 41hv8hFA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1coFVi-0001aV-TA; Wed, 15 Mar 2017 20:27:06 +0000 Received: from mail-pf0-x230.google.com ([2607:f8b0:400e:c00::230]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1coFV6-0000mp-KK for linux-arm-kernel@lists.infradead.org; Wed, 15 Mar 2017 20:26:31 +0000 Received: by mail-pf0-x230.google.com with SMTP id o126so13690284pfb.3 for ; Wed, 15 Mar 2017 13:26:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apm.com; s=apm; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1FP7a2E3NJyJ+4MjZDTSS9uBl6us0smN1v7J7ZZ8S6I=; b=kEjiqc9bhO3nVn6yCny6j4hsI7RJOOFhB2K0tfSI+xazGCsjwfXeh4jPFIictUVWP2 YYf2SgyFWQM9SJZDSc46J2WebMtajUjnm1QDEcxGC0mp5cDMl88WlgKkWKrGgberZlEr E2PVFPbLMouLta4T2vmUf8uqU520LT93hDp3U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1FP7a2E3NJyJ+4MjZDTSS9uBl6us0smN1v7J7ZZ8S6I=; b=m3xCd3Src7fx06LCj9RcmkITNGlLCBWiEBOOftJ/RLpixZVGTvbG8feUwiOpqNh6mB J+YGLO4rSEiUhYhaueIcRcglzRrNYZvpKAbuLm78Zr3J5tpRYdAh+K4pzB4enBjkmYCI GG6YNk1ZySCv2Aw4NmNVLExG180G8I0/1dZfME/KDFbSdyFVLwiQW73m5mKJOvYGB46x jsDg15HsoDK1P1Di4M1hmEEa/IvjsessztSsDwETfa0bJ5d9bo6dF7Yme5BxiITVf4Qv bZg2zEgRbqMJIxYlujrVy4cuii8fzL3NswJBncLAWEcbE5ie+OFXsSOdM8RSWifrALCn xorg== X-Gm-Message-State: AFeK/H0VdIO166dPtnYClBJYJlcshZpsxNwxPnY8EWpfZgeDHuR0DHGpm92QJHuRthr5QQdz X-Received: by 10.98.111.129 with SMTP id k123mr5890445pfc.18.1489609567550; Wed, 15 Mar 2017 13:26:07 -0700 (PDT) Received: from isubrama-dev.amcc.com ([206.80.4.98]) by smtp.gmail.com with ESMTPSA id r67sm5922281pfb.125.2017.03.15.13.26.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 15 Mar 2017 13:26:06 -0700 (PDT) From: Iyappan Subramanian To: davem@davemloft.net, netdev@vger.kernel.org Subject: [PATCH net-next 3/7] drivers: net: xgene: Fix wrong logical operation Date: Wed, 15 Mar 2017 13:27:17 -0700 Message-Id: <1489609641-31557-4-git-send-email-isubramanian@apm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1489609641-31557-1-git-send-email-isubramanian@apm.com> References: <1489609641-31557-1-git-send-email-isubramanian@apm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170315_132628_733791_81AD49CB X-CRM114-Status: GOOD ( 12.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kchudgar@apm.com, Iyappan Subramanian , patches@apm.com, linux-arm-kernel@lists.infradead.org, qnguyen@apm.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Quan Nguyen This patch fixes the wrong logical OR operation by changing it to bit-wise OR operation. Fixes: 3bb502f83080 ("drivers: net: xgene: fix statistics counters race condition") Signed-off-by: Iyappan Subramanian Signed-off-by: Quan Nguyen --- drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c index b3568c4..ec43278 100644 --- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c @@ -677,9 +677,9 @@ static int xgene_enet_rx_frame(struct xgene_enet_desc_ring *rx_ring, buf_pool->rx_skb[skb_index] = NULL; /* checking for error */ - status = (GET_VAL(ELERR, le64_to_cpu(raw_desc->m0)) << LERR_LEN) || + status = (GET_VAL(ELERR, le64_to_cpu(raw_desc->m0)) << LERR_LEN) | GET_VAL(LERR, le64_to_cpu(raw_desc->m0)); - if (unlikely(status > 2)) { + if (unlikely(status)) { dev_kfree_skb_any(skb); xgene_enet_free_pagepool(page_pool, raw_desc, exp_desc); xgene_enet_parse_error(rx_ring, netdev_priv(rx_ring->ndev),