From nobody Tue Mar 08 23:59:11 2022 X-Original-To: freebsd-usb@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 823041A06FB1 for ; Tue, 8 Mar 2022 23:59:15 +0000 (UTC) (envelope-from farhan@farhan.codes) Received: from wforward1-smtp.messagingengine.com (wforward1-smtp.messagingengine.com [64.147.123.30]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4KCskB5Mbbz4kJk for ; Tue, 8 Mar 2022 23:59:14 +0000 (UTC) (envelope-from farhan@farhan.codes) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailforward.west.internal (Postfix) with ESMTP id 629DC1AC247B for ; Tue, 8 Mar 2022 18:59:12 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 08 Mar 2022 18:59:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:from:from:in-reply-to:message-id:mime-version :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=1JxIj+F3jEoCZ2qxB 42/S4uMk0mR9CfwSdcYKDZpJq4=; b=B/81eIWZqm850wU/WcRjlFRmOZzH5aDCG fF/0/Fc5a2f8aXSOO+qZjy8Qi/BgwESOqyL16gcvHCrfvYLHOoiFKB4YxGvwq51G goVuL74oSkvD0k2t1vUwE4A4TzHfapcynNfpgpDbw/dFnbTeF/MSLAl7axmGanSt QRwUm7aXHRv1/hWwdZzOq6cAssNw6godcZpYV/14ImwOV/MN69VMvYS/aypzDAps RGELDMQaUfoi5uiZVVUbp7ENSbmZY+J3eXexM1T8Osk1Zobg4MxJAKMqzPfVGuoZ vxdlWAII1UweGRbBVq5KueAkwqpgOjSwYDi0ynyMsR4Wgh3Ye+xuQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddruddujedgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpegfggfgtgfuhfffvffksehtqhertd dtreejnecuhfhrohhmpefhrghrhhgrnhcumfhhrghnuceofhgrrhhhrghnsehfrghrhhgr nhdrtghouggvsheqnecuggftrfgrthhtvghrnhepgeelvdfhleehvdfftefftedtheekhe fgvdelffeuheevheffveeggeffjefguedvnecuvehluhhsthgvrhfuihiivgeptdenucfr rghrrghmpehmrghilhhfrhhomhepfhgrrhhhrghnsehfrghrhhgrnhdrtghouggvsh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 8 Mar 2022 18:59:11 -0500 (EST) X-Blue-Identity: !l=770&o=0&pl=721&po=0&qs=PREFIX&f=HTML&p=721&q=NONE X-Is-Generated-Message-Id: true User-Agent: Android List-Id: FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-usb List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Subject: Understanding USB callback + assertion panic From: Farhan Khan Date: Tue, 08 Mar 2022 18:59:11 -0500 To: freebsd-usb@freebsd.org Message-ID: <69696561-822a-4808-b142-4a22d3f6b6b2@farhan.codes> X-Rspamd-Queue-Id: 4KCskB5Mbbz4kJk X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=messagingengine.com header.s=fm2 header.b="B/81eIWZ"; dmarc=none; spf=none (mx1.freebsd.org: domain of farhan@farhan.codes has no SPF policy when checking 64.147.123.30) smtp.mailfrom=farhan@farhan.codes X-Spamd-Result: default: False [-4.39 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[messagingengine.com:s=fm2]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-usb@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; DWL_DNSWL_LOW(-1.00)[messagingengine.com:dkim]; RCVD_COUNT_THREE(0.00)[4]; DMARC_NA(0.00)[farhan.codes]; DKIM_TRACE(0.00)[messagingengine.com:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; MLMMJ_DEST(0.00)[freebsd-usb]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:29838, ipnet:64.147.123.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[64.147.123.30:from] X-ThisMailContainsUnwantedMimeParts: N Hi all, I am trying to understand how FreeBSD's USB subsystem works and appear to b= e running into a kernel panic due to a failed assertion that I do not under= stand. the assertion in question is /usr/src/sys/dev/usb/usb_transfer.c:195= 4. My understanding is that you first configure usbd_transfer_setup(9). To sta= rt a bulk transfer, you populate the appropriate list (typically an STAIL_*= list), then initiate a transfer by calling usbd_transfer_start(9) with the= correct transfer. In my case, my callback is a simple printf(). Upon the usbd_transfer_start(9) call, I am hitting the assertion error. I h= ave looked at other device drivers and have not identified what they are do= ing differently. Any suggestions? Thanks! Farhan