From patchwork Tue Jul 12 03:02:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Walter Mack X-Patchwork-Id: 9224553 X-Patchwork-Delegate: stefan@osg.samsung.com 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 550C76086B for ; Tue, 12 Jul 2016 03:28:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A5D927813 for ; Tue, 12 Jul 2016 03:28:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EECF27F8E; Tue, 12 Jul 2016 03:28:10 +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,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 DBF6F27813 for ; Tue, 12 Jul 2016 03:28:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932943AbcGLD2J (ORCPT ); Mon, 11 Jul 2016 23:28:09 -0400 Received: from p3plsmtpa06-02.prod.phx3.secureserver.net ([173.201.192.103]:34960 "EHLO p3plsmtpa06-02.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932161AbcGLD2I (ORCPT ); Mon, 11 Jul 2016 23:28:08 -0400 X-Greylist: delayed 435 seconds by postgrey-1.27 at vger.kernel.org; Mon, 11 Jul 2016 23:28:08 EDT Received: from csi-office.componentsw.com ([70.166.123.228]) by p3plsmtpa06-02.prod.phx3.secureserver.net with id HfLs1t0044vmnz201fLsMa; Mon, 11 Jul 2016 20:20:52 -0700 Received: by csi-office.componentsw.com (Postfix, from userid 1000) id F2D441C012F; Mon, 11 Jul 2016 20:20:51 -0700 (MST) From: Walter Mack Date: Mon, 11 Jul 2016 20:02:16 -0700 Subject: [PATCH] net: ieee802154: mrf24j40: avoid uninitialized byte in SPI transfer to radio. Message-Id: <20160712032051.F2D441C012F@csi-office.componentsw.com> To: unlisted-recipients:; (no To-header on input) Sender: linux-wpan-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wpan@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP isr function issues SPI read command to mrf to obtain INTSTAT. SPI transfer is 2 bytes, but value of 2nd byte is not defined. This had the effect that only the first ISR worked as intended. The second ISR read incorrect INTSTAT values. Observed on Raspberry PI B+. Signed-off-by: Walter Mack --- drivers/net/ieee802154/mrf24j40.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ieee802154/mrf24j40.c b/drivers/net/ieee802154/mrf24j40.c index f446db8..7b131f8 100644 --- a/drivers/net/ieee802154/mrf24j40.c +++ b/drivers/net/ieee802154/mrf24j40.c @@ -1054,6 +1054,8 @@ static irqreturn_t mrf24j40_isr(int irq, void *data) disable_irq_nosync(irq); devrec->irq_buf[0] = MRF24J40_READSHORT(REG_INTSTAT); + devrec->irq_buf[1] = 0; + /* Read the interrupt status */ ret = spi_async(devrec->spi, &devrec->irq_msg); if (ret) {