From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Subject: [BUG] mt76x0u: Probing issues on Raspberry Pi 3 B+ From: Stanislaw Gruszka Message-Id: <20190214095420.GB17273@redhat.com> Date: Thu, 14 Feb 2019 10:54:20 +0100 To: Stefan Wahren Cc: Lorenzo Bianconi , Alan Stern , Felix Fietkau , Doug Anderson , Minas Harutyunyan , USB list , linux-wireless List-ID: T24gVGh1LCBGZWIgMTQsIDIwMTkgYXQgMTA6NDg6MTVBTSArMDEwMCwgU3RlZmFuIFdhaHJlbiB3 cm90ZToKPiBIaSBTdGFuaXNsYXcsCj4gCj4gQW0gMTQuMDIuMTkgdW0gMTA6MjUgc2NocmllYiBT dGFuaXNsYXcgR3J1c3prYToKPiA+IE9uIFRodSwgRmViIDE0LCAyMDE5IGF0IDA3OjQ5OjU3QU0g KzAxMDAsIFN0ZWZhbiBXYWhyZW4gd3JvdGU6Cj4gPj4gSGkgU3RhbmlzbGF3LAo+ID4+Cj4gPj4+ IFN0YW5pc2xhdyBHcnVzemthIDxzZ3J1c3prYUByZWRoYXQuY29tPiBoYXQgYW0gMTIuIEZlYnJ1 YXIgMjAxOSB1bSAxMDozMCBnZXNjaHJpZWJlbjoKPiA+Pj4KPiA+Pj4KPiA+Pj4KPiA+Pj4gSW4g dXNiX3NnX2luaXQoKSB1cmItPm51bV9zZ3MgaXMgc2V0IDAgZm9yIHNnX3RhYmxlc2l6ZSA9IDAg Y29udHJvbGxlcnMuCj4gPj4+IEluIG10NzYgd2Ugc2V0IHVyYi0+bnVtX3NncyB0byAxLiBJIHRo b3VnaHQgaXQgaXMgZmluZSwgYnV0IG5vdyBJIHRoaW5rCj4gPj4+IHRoaXMgaXMgYnVnLiBXZSBj YW4gZml4IHRoYXQgd2l0aG91dCBjaGFuZ2luZyBhbGxvY2F0aW9uIG1ldGhvZCBhbmQKPiA+Pj4g c3RpbGwgdXNlIFNHIGFsbG9j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m IHJ4IHVyYiBmYWlsZWQgb24gZGlzY29ubmVjdC4gVGhlIGRyaXZlciBzZWVtcyB0byBwcm9iZSBi dXQgaXNuJ3QgZnVuY3Rpb25hbCBldmVuIGFmdGVyIDIgdHJpZXMuCj4gPj4KPiA+PiBVc2luZyBh cm02NF9kZWZjb25maWcgaSBkb24ndCBnZXQgYW55IHdhcm5pbmcuIEJ1dCBleGNlcHQgb2YgdGhp cyBpJ20gZ2V0dGluZyBzaW1pbGlhciByZXN1bHRzIHRvIG11bHRpX3Y3X2RlZmNvbmZpZy4KPiA+ Pgo+ID4+IFNvIGluIGNvbXBhcmlzb24sIExvcmVuem8ncyB3b3JrYXJvdW5kIGJlaGF2ZXMgYmV0 dGVyLgo+ID4gSSdtIHByZXR0eSBzdXJlIHByb2JsZW0gaXMgbXQ3NngwdSA0LjE5IC0+IDQuMjAg cmVncmVzc2lvbiBpbnRyZHVjZWQgYnkKPiA+IGludGVncmF0aW5nIG10NzZ4MHUgaW4gbXQ3Ni11 c2IgKHRoaW5ncyBkbyBub3Qgd29yayBmcm9tIGRheSAwCj4gPiBmb3IgbXQ3NngydSkuIFdlIHNo b3VsZCBmaW5kIGZpeChlcykgdGhhdCB3aWxsIGJlIHByb3BlciBmb3IgLXN0YWJsZS4KPiBTbyBp IHNob3VsZCBhbHNvIHRyeSA0LjE5IHdpdGhvdXQgYW55IHBhdGNoZXM/CgpUaGF0IHdvdWxkIGJl IGdvb2QuIFRoYW5rcy4KClN0YW5pc2xhdwo= From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 938DEC43381 for ; Thu, 14 Feb 2019 09:54:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6AFFD20835 for ; Thu, 14 Feb 2019 09:54:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438088AbfBNJyZ (ORCPT ); Thu, 14 Feb 2019 04:54:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35198 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437796AbfBNJyY (ORCPT ); Thu, 14 Feb 2019 04:54:24 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 68802B272B; Thu, 14 Feb 2019 09:54:24 +0000 (UTC) Received: from localhost (ovpn-204-123.brq.redhat.com [10.40.204.123]) by smtp.corp.redhat.com (Postfix) with ESMTP id B05445D704; Thu, 14 Feb 2019 09:54:21 +0000 (UTC) Date: Thu, 14 Feb 2019 10:54:20 +0100 From: Stanislaw Gruszka To: Stefan Wahren Cc: Lorenzo Bianconi , Alan Stern , Felix Fietkau , Doug Anderson , Minas Harutyunyan , USB list , linux-wireless Subject: Re: [BUG] mt76x0u: Probing issues on Raspberry Pi 3 B+ Message-ID: <20190214095420.GB17273@redhat.com> References: <20190211173315.GE6292@redhat.com> <20190212093035.GB12906@redhat.com> <404607590.373282.1550126997144@email.ionos.de> <20190214092530.GA17273@redhat.com> <878a7160-2e91-d057-6d27-c6b9d85f700e@i2se.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <878a7160-2e91-d057-6d27-c6b9d85f700e@i2se.com> User-Agent: Mutt/1.8.3 (2017-05-23) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 14 Feb 2019 09:54:24 +0000 (UTC) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Thu, Feb 14, 2019 at 10:48:15AM +0100, Stefan Wahren wrote: > Hi Stanislaw, > > Am 14.02.19 um 10:25 schrieb Stanislaw Gruszka: > > On Thu, Feb 14, 2019 at 07:49:57AM +0100, Stefan Wahren wrote: > >> Hi Stanislaw, > >> > >>> Stanislaw Gruszka hat am 12. Februar 2019 um 10:30 geschrieben: > >>> > >>> > >>> > >>> In usb_sg_init() urb->num_sgs is set 0 for sg_tablesize = 0 controllers. > >>> In mt76 we set urb->num_sgs to 1. I thought it is fine, but now I think > >>> this is bug. We can fix that without changing allocation method and > >>> still use SG allocation. Attached patch do this, please check if it works > >>> on rpi. Patch is on top of your error path fixes. > >> your patch didn't apply cleanly to yesterdays next. After some minor manual fixup, i was able to build them and here are the results starting from boot (please ignore the invalid time in the kernel log): > >> https://gist.github.com/lategoodbye/33bd5bc75b9fc935faa231bc472defa8 > > I think this is due to urb->transfer_length and sg[0]->length mismatch, > > which should be addressed by my other patch. I'm attaching the patch > > rebased on -next with this line integrated, please test. > > > > But there could be other bug's in mt76-usb SG code. > Will retry > > > >> Using multi_v7_defconfig i'm getting a warning on the first connect and always this flood of rx urb failed on disconnect. The driver seems to probe but isn't functional even after 2 tries. > >> > >> Using arm64_defconfig i don't get any warning. But except of this i'm getting similiar results to multi_v7_defconfig. > >> > >> So in comparison, Lorenzo's workaround behaves better. > > I'm pretty sure problem is mt76x0u 4.19 -> 4.20 regression intrduced by > > integrating mt76x0u in mt76-usb (things do not work from day 0 > > for mt76x2u). We should find fix(es) that will be proper for -stable. > So i should also try 4.19 without any patches? That would be good. Thanks. Stanislaw