Received: by mail.netbsd.org (Postfix, from userid 605) id 6C11684DA7; Wed, 28 Aug 2019 01:44:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id DC9D184DA2 for ; Wed, 28 Aug 2019 01:44:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id u6zOG89GDSZa for ; Wed, 28 Aug 2019 01:44:39 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 6C4F584D9C for ; Wed, 28 Aug 2019 01:44:39 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 5AF70FBF4; Wed, 28 Aug 2019 01:44:39 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Wed, 28 Aug 2019 01:44:39 +0000 From: "matthew green" Subject: CVS commit: src/sys/dev/usb To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20190828014439.5AF70FBF4@cvs.NetBSD.org> Sender: source-changes-owner@NetBSD.org List-Id: source-changes.NetBSD.org Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "matthew green" Mail-Followup-To: source-changes-d@NetBSD.org List-Unsubscribe: Module Name: src Committed By: mrg Date: Wed Aug 28 01:44:39 UTC 2019 Modified Files: src/sys/dev/usb: usb_subr.c usbdi.c usbdi.h Log Message: add new usbd_do_request_len() that can allocate a larger than request size buffer. reimplement usbd_do_request_flags() in terms of this. use this for fetching string descriptors. fixes a very strange problem where an axe(4) attaching (either has ugen(4) or axe(4)) would ask for 2 bytes, usb_mem.c would allocate a 2 byte fragment, perform the operation, and sometime shortly afterwards (usually by the time the next allocation is made for this fragment), would become corrupted (usually two bytes were written with 0x0304.) (initial request of 4 bytes also avoids the problem on this device. it really seems like a HC problem -- host should not allow the device to write more than req.wLength! nor should it allow this write to happen after completion.) avoid an (almost) always double-log in usbd_transfer(). To generate a diff of this commit: cvs rdiff -u -r1.238 -r1.239 src/sys/dev/usb/usb_subr.c cvs rdiff -u -r1.185 -r1.186 src/sys/dev/usb/usbdi.c cvs rdiff -u -r1.96 -r1.97 src/sys/dev/usb/usbdi.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.