Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936118Ab3DJVks (ORCPT ); Wed, 10 Apr 2013 17:40:48 -0400 Received: from lan.nucleusys.com ([92.247.61.126]:58342 "EHLO zztop.nucleusys.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751985Ab3DJVkr (ORCPT ); Wed, 10 Apr 2013 17:40:47 -0400 Date: Thu, 11 Apr 2013 00:05:50 +0300 (EEST) From: Petko Manolov X-X-Sender: petkan@fry To: "David S. Miller" cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Sarah Sharp Subject: [PATCH] net: usb: active URB submitted multiple times Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-1463750422-834436910-1365627458=:9358" Content-ID: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 54251 Lines: 908 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1463750422-834436910-1365627458=:9358 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Content-ID: From: Petko Manolov Pegasus driver used single callback for sync and async control URBs. Special flags were employed to distinguish between both, but due to flawed logic it didn't always work. Now [get|set]_registers() are much simpler. Async write is also leaner and does not use single, statically allocated memory for usb_ctrlrequest, which is another potential race when asynchronously submitting control URBs. The socket buffer pool in the receive path is removed. It's existence didn't make much difference (performance-wise) and the code is better off without the spinlocks protecting it. Largely duplicated code in routines reading and writing MII registers is now packed in __mi_op(). The rest of the patch is pretty much Lindent's fault. Signed-off-by: Petko Manolov --- drivers/net/usb/pegasus.c | 601 +++++++++++++++++++++++++++++++--------------------------------------------------------------------------- drivers/net/usb/pegasus.h | 10 +- 2 files changed, 177 insertions(+), 434 deletions(-) ---1463750422-834436910-1365627458=:9358 Content-Type: TEXT/X-DIFF; name=pegasus.h.diff; charset=us-ascii Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=pegasus.h.diff ZGlmZiAtLWdpdCBhL2RyaXZlcnMvbmV0L3VzYi9wZWdhc3VzLmggYi9kcml2 ZXJzL25ldC91c2IvcGVnYXN1cy5oDQppbmRleCA2NWI3OGIzLi44MDllNTYw IDEwMDY0NA0KLS0tIGEvZHJpdmVycy9uZXQvdXNiL3BlZ2FzdXMuaA0KKysr IGIvZHJpdmVycy9uZXQvdXNiL3BlZ2FzdXMuaA0KQEAgLTEsNSArMSw1IEBA DQogLyoNCi0gKiBDb3B5cmlnaHQgKGMpIDE5OTktMjAwMyBQZXRrbyBNYW5v bG92IC0gUGV0a2FuIChwZXRrYW5AdXNlcnMuc291cmNlZm9yZ2UubmV0KQ0K KyAqIENvcHlyaWdodCAoYykgMTk5OS0yMDEzIFBldGtvIE1hbm9sb3YgLSBQ ZXRrYW4gKHBldGthbkBudWNsZXVzeXMuY29tKQ0KICAqDQogICogVGhpcyBw cm9ncmFtIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRl IGl0IGFuZC9vciBtb2RpZnkNCiAgKiBpdCB1bmRlciB0aGUgdGVybXMgb2Yg dGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIHZlcnNpb24gMiBhcyBw dWJsaXNoZWQNCkBAIC0zNCw4ICszNCw2IEBADQogI2RlZmluZQlDVFJMX1VS Ql9TTEVFUAkJMHgwMDAwMDAyMA0KICNkZWZpbmUJUEVHQVNVU19VTlBMVUcJ CTB4MDAwMDAwNDANCiAjZGVmaW5lCVBFR0FTVVNfUlhfVVJCX0ZBSUwJMHgw MDAwMDA4MA0KLSNkZWZpbmUJRVRIX1JFR1NfQ0hBTkdFCQkweDQwMDAwMDAw DQotI2RlZmluZQlFVEhfUkVHU19DSEFOR0VECTB4ODAwMDAwMDANCiANCiAj ZGVmaW5lCVJYX01VTFRJQ0FTVAkJMg0KICNkZWZpbmUJUlhfUFJPTUlTQ1VP VVMJCTQNCkBAIC05NiwxMiArOTQsOCBAQCB0eXBlZGVmIHN0cnVjdCBwZWdh c3VzIHsNCiAJaW50CQkJaW50cl9pbnRlcnZhbDsNCiAJc3RydWN0IHRhc2ts ZXRfc3RydWN0CXJ4X3RsOw0KIAlzdHJ1Y3QgZGVsYXllZF93b3JrCWNhcnJp ZXJfY2hlY2s7DQotCXN0cnVjdCB1cmIJCSpjdHJsX3VyYiwgKnJ4X3VyYiwg KnR4X3VyYiwgKmludHJfdXJiOw0KLQlzdHJ1Y3Qgc2tfYnVmZgkJKnJ4X3Bv b2xbUlhfU0tCU107DQorCXN0cnVjdCB1cmIJCSpyeF91cmIsICp0eF91cmIs ICppbnRyX3VyYjsNCiAJc3RydWN0IHNrX2J1ZmYJCSpyeF9za2I7DQotCXN0 cnVjdCB1c2JfY3RybHJlcXVlc3QJZHI7DQotCXdhaXRfcXVldWVfaGVhZF90 CWN0cmxfd2FpdDsNCi0Jc3BpbmxvY2tfdAkJcnhfcG9vbF9sb2NrOw0KIAlp bnQJCQljaGlwOw0KIAl1bnNpZ25lZCBjaGFyCQlpbnRyX2J1ZmZbOF07DQog CV9fdTgJCQl0eF9idWZmW1BFR0FTVVNfTVRVXTsNCg== ---1463750422-834436910-1365627458=:9358 Content-Type: TEXT/X-DIFF; name=pegasus.c.diff; charset=us-ascii Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=pegasus.c.diff ZGlmZiAtLWdpdCBhL2RyaXZlcnMvbmV0L3VzYi9wZWdhc3VzLmMgYi9kcml2 ZXJzL25ldC91c2IvcGVnYXN1cy5jDQppbmRleCA3MzA1MWQxLi41MDFkYjIw IDEwMDY0NA0KLS0tIGEvZHJpdmVycy9uZXQvdXNiL3BlZ2FzdXMuYw0KKysr IGIvZHJpdmVycy9uZXQvdXNiL3BlZ2FzdXMuYw0KQEAgLTEsNSArMSw1IEBA DQogLyoNCi0gKiAgQ29weXJpZ2h0IChjKSAxOTk5LTIwMDU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QogCQl2ZW5kb3JfaWQgPSBzaW1wbGVfc3RydG91 bCh0b2tlbiwgTlVMTCwgMTYpOw0KIAlpZiAoKHRva2VuID0gc3Ryc2VwKCZp ZCwgIjoiKSkgIT0gTlVMTCkNCkBAIC0xNTE0LDcgKzEyNjMsNyBAQCBzdGF0 aWMgdm9pZCBfX2luaXQgcGFyc2VfaWQoY2hhciAqaWQpDQogCWlmIChkZXZp Y2VfaWQgPiAweDEwMDAwIHx8IGRldmljZV9pZCA9PSAwKQ0KIAkJcmV0dXJu Ow0KIA0KLQlmb3IgKGkgPSAwOyB1c2JfZGV2X2lkW2ldLm5hbWU7IGkrKyk7 DQorCWZvciAoaSA9IDA7IHVzYl9kZXZfaWRbaV0ubmFtZTsgaSsrKSA7DQog CXVzYl9kZXZfaWRbaV0ubmFtZSA9IG5hbWU7DQogCXVzYl9kZXZfaWRbaV0u dmVuZG9yID0gdmVuZG9yX2lkOw0KIAl1c2JfZGV2X2lkW2ldLmRldmljZSA9 IGRldmljZV9pZDsNCg== ---1463750422-834436910-1365627458=:9358-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/