From patchwork Mon Feb 10 11:47:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eliad Peller X-Patchwork-Id: 3618241 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 40437BF418 for ; Mon, 10 Feb 2014 11:47:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 77C35201B6 for ; Mon, 10 Feb 2014 11:47:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A91AE20138 for ; Mon, 10 Feb 2014 11:47:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752492AbaBJLrs (ORCPT ); Mon, 10 Feb 2014 06:47:48 -0500 Received: from mail-wg0-f54.google.com ([74.125.82.54]:61885 "EHLO mail-wg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752107AbaBJLrr (ORCPT ); Mon, 10 Feb 2014 06:47:47 -0500 Received: by mail-wg0-f54.google.com with SMTP id x13so4168362wgg.9 for ; Mon, 10 Feb 2014 03:47:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=stRpC8NRq36ZYEgdUZZHlmNXPt0lwkvaISjryyaPDW0=; b=djtjP9ErK1d/WsMd3Bo1pCftD31ksV64ZCQuLjIip3g71RuFEEe8CxhfNmUUoIN8ca 0V+o4NyH0AMSd1W5vwTAlWdXcD8XpgFM/mmNy59Db6gTYIj04eY6BdQo76TAewves+yv IpblCw/+00gADQYRigmXFaI10K8cVWOg0hoMpzxWEjc0PQ57uhYQPOpPDC++bf7tVJPC RF/QPhVbuC20HdLmFAQDcgNzvOyDyo236UlkznqpPkc/a8f3SSHvi1MC0iQEo6apfes5 1p1JcolEO3s6lj2hZwXws4brcl+OknVETJ+3PCXpxcad7N8sOtnFulQqAjGQdd6rRZa8 A1Yg== X-Gm-Message-State: ALoCoQlgWa4ydGjfunaaF4XUg0iVJ5hK9IISHW5ViYR/bL7tIUSrkLP80W2FmrZsZBFFKYIB9R9D X-Received: by 10.194.58.132 with SMTP id r4mr1647806wjq.45.1392032866182; Mon, 10 Feb 2014 03:47:46 -0800 (PST) Received: from muse.amr.corp.intel.com (93-173-177-113.bb.netvision.net.il. [93.173.177.113]) by mx.google.com with ESMTPSA id ju6sm34687484wjc.1.2014.02.10.03.47.44 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Feb 2014 03:47:45 -0800 (PST) From: Eliad Peller To: "John W. Linville" Cc: Subject: [PATCH 03/18] wlcore: block read/writes to FW during ELP Date: Mon, 10 Feb 2014 13:47:19 +0200 Message-Id: <1392032854-28126-4-git-send-email-eliad@wizery.com> X-Mailer: git-send-email 1.8.5.2.229.g4448466.dirty In-Reply-To: <1392032854-28126-1-git-send-email-eliad@wizery.com> References: <1392032854-28126-1-git-send-email-eliad@wizery.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Barak Bercovitz When the chip is in ELP mode read/write to FW is invalid and may cause the lower layers to get stuck. The reads/writes concerning ELP wakeup are the exception here and are checked for. In addition to blocking the IO, produce a warning. Signed-off-by: Barak Bercovitz Signed-off-by: Eliad Peller --- drivers/net/wireless/ti/wlcore/io.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ti/wlcore/io.h b/drivers/net/wireless/ti/wlcore/io.h index 07e3d6a..0305729 100644 --- a/drivers/net/wireless/ti/wlcore/io.h +++ b/drivers/net/wireless/ti/wlcore/io.h @@ -60,7 +60,9 @@ static inline int __must_check wlcore_raw_write(struct wl1271 *wl, int addr, { int ret; - if (test_bit(WL1271_FLAG_IO_FAILED, &wl->flags)) + if (test_bit(WL1271_FLAG_IO_FAILED, &wl->flags) || + WARN_ON((test_bit(WL1271_FLAG_IN_ELP, &wl->flags) && + addr != HW_ACCESS_ELP_CTRL_REG))) return -EIO; ret = wl->if_ops->write(wl->dev, addr, buf, len, fixed); @@ -76,7 +78,9 @@ static inline int __must_check wlcore_raw_read(struct wl1271 *wl, int addr, { int ret; - if (test_bit(WL1271_FLAG_IO_FAILED, &wl->flags)) + if (test_bit(WL1271_FLAG_IO_FAILED, &wl->flags) || + WARN_ON((test_bit(WL1271_FLAG_IN_ELP, &wl->flags) && + addr != HW_ACCESS_ELP_CTRL_REG))) return -EIO; ret = wl->if_ops->read(wl->dev, addr, buf, len, fixed);