From patchwork Tue Sep 1 00:16:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 7102071 X-Patchwork-Delegate: kvalo@adurom.com 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B8F4B9F1B9 for ; Tue, 1 Sep 2015 00:16:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EDB7D2049E for ; Tue, 1 Sep 2015 00:16:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C86A7204D1 for ; Tue, 1 Sep 2015 00:16:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753385AbbIAAQu (ORCPT ); Mon, 31 Aug 2015 20:16:50 -0400 Received: from mail-ob0-f176.google.com ([209.85.214.176]:33484 "EHLO mail-ob0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753082AbbIAAQt (ORCPT ); Mon, 31 Aug 2015 20:16:49 -0400 Received: by obcji4 with SMTP id ji4so11422315obc.0 for ; Mon, 31 Aug 2015 17:16:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type; bh=wKiXy4A9EzTyAIwX/Cxxv03LxQzInzctMqMGQ+53vpE=; b=EmHsXWMqxKAuWZGlRQkel8GgFDktlzhToEbs959M2p8zQHkJ5vv8+oY5exqLFkgvWe PhgxBPSGc2mYt9zLi1LnngVmCxjyj8u0ObsDGetW3aG6NU2MnggRq5/cqr5dOhomE+DD 72jrWNtL69u6WPLQM9HghkOqkoenco2VFsdq7mCVbx7H9CfUly+3QhxVmpXKcnB66bU7 BTyNfVXoZWAlbQU6jVPBYJ/04hmW9D/C101wkY+bLrGLPaeZFO9wnyuHjqqCpxMrpHVj aLpfKd20xpeoTBrm/Mf2DW8tKsHt+Eupv8ophUGgkVLphRSGE7eOpu/y7cXDf7bCS5f4 8kow== X-Received: by 10.182.60.230 with SMTP id k6mr15944840obr.83.1441066609261; Mon, 31 Aug 2015 17:16:49 -0700 (PDT) Received: from linux.site (cpe-24-31-249-175.kc.res.rr.com. [24.31.249.175]) by smtp.gmail.com with ESMTPSA id i7sm11463612obe.8.2015.08.31.17.16.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Aug 2015 17:16:48 -0700 (PDT) Subject: Re: [PATCH 1/1] New driver: rtl8xxxu (mac80211) To: Jes Sorensen References: <1440883083-32498-1-git-send-email-Jes.Sorensen@redhat.com> <1440883083-32498-2-git-send-email-Jes.Sorensen@redhat.com> <55E289A3.6030001@lwfinger.net> <55E39707.60101@lwfinger.net> <55E476A0.4080601@lwfinger.net> Cc: linux-wireless@vger.kernel.org, kvalo@codeaurora.org, johannes@sipsolutions.net From: Larry Finger Message-ID: <55E4EE6F.2010008@lwfinger.net> Date: Mon, 31 Aug 2015 19:16:47 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,T_TVD_MIME_EPI, 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 On 08/31/2015 06:43 PM, Jes Sorensen wrote: > Larry Finger writes: >> On 08/30/2015 09:39 PM, Jes Sorensen wrote: >>> Larry Finger writes: >>>> On 08/30/2015 01:41 PM, Jes Sorensen wrote: >>>>>>> +{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x817e, 0xff, >>>>>> 0xff, 0xff), >>>>>>> + .driver_info = (unsigned long)&rtl8192cu_fops}, >>>>>> >>>>>> I have tested a device with USB ID 0x0bda (USB_VENDOR_ID_REALTEK):0x817e. >>>>> >>>>> Were you happy with the results, or did it cause problems? Ie. did you >>>>> try on x86 or on PPC32? >>>> >>>> As covered in the other mail, it works very well at G rates. >>> >>> I see - I am a little confused, it works well on G rates but not on N >>> rates, or was this due to the AP used? >> >> The AP is AC1200. It supports full N rates on other devices. > > You only manage to make it work on G rates against this AP? Urgh, I > don't like that at all. > > I thought you reported 30+Mbps performances though?, thats more than you > get on G. OK, I get a bit better than the top G rate of 27 Mbps, but the connection reports a 54 Mbps raw rate. My Intel 7260 gets RX of 95 and TX of 53 Mbps from the same location relative to the AP. For the Intel, the listed raw rate is 300 Mbps. >>>>> I don't think any of this is showstopper material for inclusion right >>>>> now, albeit I do want to address them. >>>> >>>> The scheduling while atomic problems do need to be fixed, and I am >>>> still working on the failure to get a wifi device on PPC. >>> >>> It's already fixed :) >> >> A full debug=0x3fff showed me one problem on the PPC. I will be >> testing a patch later today. > > Interesting, let me know what you find. Thanks for the fixes. I'm still getting the sleeping while atomic BUG splat from rtl8723a_h2c_cmd+0x48. Today I know that is not a lock dependency issue. I have one in VirtualBox that fires and disables further checking, but that driver is not loading now. I have made some progress on the big-endian issues. When the firmware file is read from disk, the first byte read must be the first byte written to the device. In the slow write N routine, four bytes are picked and written using the write32 routine, which does a cpu_to_32() byte swap. As a result, the order of bytes to the device is 03, 02, 01, 00! Rather than byte swap twice, I am calling the regular writeN routine with each hunk. After a bit of thinking about the best blocksize to use, I settled on 64. That reduces the number of full-size hunks that are written without unduly increasing the worst-case number of writes needed for the remainder. On PPC, I now get a device registered; however, the scan data are garbled. That shouldn't be too difficult to debug, but just in case, I have attached the patch for rtl8xxxu_slow_writeN(). Larry diff --git a/drivers/net/wireless/rtl8xxxu.c b/drivers/net/wireless/rtl8xxxu.c index 8773884..80602b8 100644 --- a/drivers/net/wireless/rtl8xxxu.c +++ b/drivers/net/wireless/rtl8xxxu.c @@ -1099,17 +1099,18 @@ rtl8xxxu_writeN(struct rtl8xxxu_priv *priv, u16 addr, u8 *buf, u16 len) static int rtl8xxxu_slow_writeN(struct rtl8xxxu_priv *priv, u16 addr, u8 *buf, u16 len) { - u32 blocksize = sizeof(u32); - u32 *buf4 = (u32 *)buf; + u32 blocksize = 64; int i, offset, count, remainder; + /* This routine does not do any btye swapping on big-endian machines. + * It should be used for writing firmware, and nothing else */ count = len / blocksize; remainder = len % blocksize; for (i = 0; i < count; i++) { offset = i * blocksize; - rtl8xxxu_write32(priv, (REG_FW_START_ADDRESS + offset), - buf4[i]); + rtl8xxxu_writeN(priv, (REG_FW_START_ADDRESS + offset), + (buf + offset), blocksize); } if (remainder) {