From patchwork Fri Apr 4 16:25:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Merello X-Patchwork-Id: 3939521 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B927E9F1EE for ; Fri, 4 Apr 2014 16:26:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 042E820381 for ; Fri, 4 Apr 2014 16:26:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 333C92035C for ; Fri, 4 Apr 2014 16:26:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753469AbaDDQ0Y (ORCPT ); Fri, 4 Apr 2014 12:26:24 -0400 Received: from mail-we0-f179.google.com ([74.125.82.179]:41407 "EHLO mail-we0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753459AbaDDQ0W (ORCPT ); Fri, 4 Apr 2014 12:26:22 -0400 Received: by mail-we0-f179.google.com with SMTP id x48so3666905wes.38 for ; Fri, 04 Apr 2014 09:26:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=KQZncyjESOPbB4Jk4/E3+lwOutgp0FoTrrSzdEna6Z8=; b=0baLsP3A6inaN/pi9b8Pb1RkLFpWSFgp4EYND2zm73BW2XBto6GTpFHYQw6+um1B8F A2UitWUaYWojpam2NRFeuBqeqcG+/fFReHEXkFMUqOGDMDGibqDOZxD9dt2y0uxy3QMv bv/u+Wcn5LT16HodgmT+a+v9SI78suuYFpgG5EH13Fk8xJ50PYMiwganx1Z9SOCbHP+i n1u+yuoaYgRk2//mjSck3D1vMbnJ6YbgefjMO95YMM572ZhqKT1x3RJbpo12TzF8rciz EqtJdBpnAPJAazv+kj41UXDhYWM7OHrSjZNkeAAv/zotvPQOBO+47/S9ykeXBUd+zCZf TRPA== X-Received: by 10.194.104.197 with SMTP id gg5mr21656269wjb.26.1396628781185; Fri, 04 Apr 2014 09:26:21 -0700 (PDT) Received: from localhost.localdomain (host90-15-dynamic.249-95-r.retail.telecomitalia.it. [95.249.15.90]) by mx.google.com with ESMTPSA id e42sm20525891eev.32.2014.04.04.09.26.19 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Apr 2014 09:26:20 -0700 (PDT) From: Andrea Merello To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, Larry.Finger@lwfinger.net, bernhard@schiffner-limbach.de, dan.carpenter@oracle.com, andrea.merello@gmail.com Subject: [PATCH 4/4] rtl8180: be paranoid in stopping unused queues. Date: Fri, 4 Apr 2014 18:25:51 +0200 Message-Id: <1396628751-14564-1-git-send-email-andrea.merello@gmail.com> X-Mailer: git-send-email 1.8.3.2 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.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 HW should never attempt to perform DMA for unused queues. For rtl8187se this is ensured by setting a dedicated register at init time, before enabling TX. In rtl8180/5 the register is only written at the first TX (because in rtl8180/5 it serves also to kick DMA for used queues). This should be enough, but it's worth to add a register write at init time, before enabling TX. Signed-off-by: Andrea Merello --- drivers/net/wireless/rtl818x/rtl8180/dev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/rtl818x/rtl8180/dev.c b/drivers/net/wireless/rtl818x/rtl8180/dev.c index cb8275f..50d69b1 100644 --- a/drivers/net/wireless/rtl818x/rtl8180/dev.c +++ b/drivers/net/wireless/rtl818x/rtl8180/dev.c @@ -910,7 +910,10 @@ static int rtl8180_init_hw(struct ieee80211_hw *dev) reg32 &= 0x00ffff00; reg32 |= 0xb8000054; rtl818x_iowrite32(priv, &priv->map->RF_PARA, reg32); - } + } else + /* stop unused queus (no dma alloc) */ + rtl818x_iowrite8(priv, &priv->map->TX_DMA_POLLING, + (1<<1) | (1<<2)); priv->rf->init(dev);