From owner-freebsd-drivers@FreeBSD.ORG Mon Feb 3 01:22:50 2014 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B8845F6; Mon, 3 Feb 2014 01:22:50 +0000 (UTC) Received: from mail-pb0-x22a.google.com (mail-pb0-x22a.google.com [IPv6:2607:f8b0:400e:c01::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0C87C19A9; Mon, 3 Feb 2014 01:22:50 +0000 (UTC) Received: by mail-pb0-f42.google.com with SMTP id jt11so6505137pbb.1 for ; Sun, 02 Feb 2014 17:22:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=JeWLj1wWx/rIWm8R5ugVLqg0v6a6L9f3i7DmRI83vmQ=; b=ElgshM+XLHClNgY2aWPAzpdEc1e88eAo83BdDWOZJUzB2GzSKZ1wDEy2GHCzclgZ/5 49eEEpZD5TJU70/BA09cjhO5EA/MQsmJ8P7/qCUXYGZWGYdnkMHfzO2b4Zdzj1ks7SYS pyL5sDmcBBD6c+JQlDEQMV5F0oyY6QESdW5G9QYU35LkDAujpku70K/CQEVV8xGzIl90 iTSoo7Z9MsEALkX7rlxlmAEOXrL9LWMQtDavdBaPbv0DaT6KChe1vn1lhiC9Z8PMGkVN Do5LXlAnzQNYfMfydmRm2KQBvzLmZMa0zsbX/y8bW3AOb+5TMQNQy8C5DNdWHL14PaKq 71+g== MIME-Version: 1.0 X-Received: by 10.68.202.8 with SMTP id ke8mr34569071pbc.86.1391390569639; Sun, 02 Feb 2014 17:22:49 -0800 (PST) Received: by 10.68.235.68 with HTTP; Sun, 2 Feb 2014 17:22:49 -0800 (PST) Date: Sun, 2 Feb 2014 20:22:49 -0500 Message-ID: Subject: snd_hda autodetection From: "Brian M. Waters" To: freebsd-drivers@freebsd.org, freebsd-questions@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 01:22:50 -0000 Cross-post from freebsd-hardware@: I have been messing around trying to get the snd_hda driver to work 100% on my ThinkPad. There are a lot of HDA chips out there, and it turns out laptop manufacturers are real "cowboy" about wiring them up - pins x, y, z on one machine may not have the same function as pins x, y, z on another machine. To make matters worse, these quirks are never documented. However, Linux (and Windows) "just work" on these platforms - while FreeBSD (at least on my X230) requires manually experimenting with the snd_hda driver's configuration via device.hints. I am not sure exactly how Linux/Windows handle this - perhaps they do some kind of probing, or perhaps they ship with a long list of known quirks. My question is: is there some technical reason this has not been implemented in FreeBSD, or is it simply something waiting to be implemented? Is there any way I can help out? BW From owner-freebsd-drivers@FreeBSD.ORG Mon Feb 3 05:00:21 2014 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E5DC1875 for ; Mon, 3 Feb 2014 05:00:21 +0000 (UTC) Received: from gproxy3-pub.mail.unifiedlayer.com (gproxy3-pub.mail.unifiedlayer.com [69.89.30.42]) by mx1.freebsd.org (Postfix) with SMTP id AB7B01B15 for ; Mon, 3 Feb 2014 05:00:21 +0000 (UTC) Received: (qmail 22564 invoked by uid 0); 3 Feb 2014 04:53:41 -0000 Received: from unknown (HELO CMOut01) (10.0.90.82) by gproxy3.mail.unifiedlayer.com with SMTP; 3 Feb 2014 04:53:41 -0000 Received: from host180.hostmonster.com ([74.220.207.180]) by CMOut01 with id Mgtc1n0093u44n601gtfbc; Sun, 02 Feb 2014 21:53:41 -0700 X-Authority-Analysis: v=2.1 cv=F57EKMRN c=1 sm=1 tr=0 a=elpMfSYGy1g+Sy6iSrFI9g==:117 a=elpMfSYGy1g+Sy6iSrFI9g==:17 a=DsvgjBjRAAAA:8 a=f5113yIGAAAA:8 a=1Hn6g5MNOI0A:10 a=jjoFiYHgTOAA:10 a=8nJEP1OIZ-IA:10 a=WGPMFDq8AAAA:8 a=XPnOrMr7Qc8A:10 a=09zAN61smS0A:10 a=6I5d2MoRAAAA:8 a=VwQbUJbxAAAA:8 a=yc9gciF6umbWnv9ttVwA:9 a=wPNLvfGTeEIA:10 a=SV7veod9ZcQA:10 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hostedyou.com; s=default; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID; bh=Qatm5ooWxXjRMNi0IpvsQYq1/SkKCorDay7EphKWB8Y=; b=iGVIy64uWMGviGThNAvFWVoCeQQTrh9bldBKBCHp7rlcK35wiChNRlhRDpaHzj20SbowdnpljqV5+fWvvujPKdrPQIV+O567V/UY2Zfpxg0P7NVkolowBqyAGD9XC6vV; Received: from [72.197.231.41] (port=53052 helo=[192.168.0.2]) by host180.hostmonster.com with esmtpa (Exim 4.80) (envelope-from ) id 1WABXM-0007C6-So; Sun, 02 Feb 2014 21:53:37 -0700 Message-ID: <52EF20CD.6000102@hostedyou.com> Date: Sun, 02 Feb 2014 20:53:33 -0800 From: Maverick User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: freebsd-drivers@freebsd.org, freebsd-questions@freebsd.org Subject: Re: snd_hda autodetection References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Identified-User: {1009:host180.hostmonster.com:hostedyo:hostedyou.com} {sentby:smtp auth 72.197.231.41 authed with mmavipc@hostedyou.com} X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2014 05:00:22 -0000 On 2/2/2014 5:22 PM, Brian M. Waters wrote: > Cross-post from freebsd-hardware@: > > I have been messing around trying to get the snd_hda driver to work > 100% on my ThinkPad. There are a lot of HDA chips out there, and it > turns out laptop manufacturers are real "cowboy" about wiring them up > - pins x, y, z on one machine may not have the same function as pins > x, y, z on another machine. To make matters worse, these quirks are > never documented. However, Linux (and Windows) "just work" on these > platforms - while FreeBSD (at least on my X230) requires manually > experimenting with the snd_hda driver's configuration via > device.hints. I am not sure exactly how Linux/Windows handle this - > perhaps they do some kind of probing, or perhaps they ship with a long > list of known quirks. My question is: is there some technical reason > this has not been implemented in FreeBSD, or is it simply something > waiting to be implemented? Is there any way I can help out? > > BW > _______________________________________________ > freebsd-drivers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-drivers > To unsubscribe, send any mail to "freebsd-drivers-unsubscribe@freebsd.org" According to https://www.kernel.org/doc/Documentation/sound/alsa/HD-Audio.txt the BIOS sets the default config for each pin, but the driver has a static configuration table with "several preset models, either to override the BIOS setup or to provide more comprehensive features" From owner-freebsd-drivers@FreeBSD.ORG Fri Feb 7 08:45:45 2014 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 897D127E for ; Fri, 7 Feb 2014 08:45:45 +0000 (UTC) Received: from mail-ea0-x230.google.com (mail-ea0-x230.google.com [IPv6:2a00:1450:4013:c01::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1DAFF11F8 for ; Fri, 7 Feb 2014 08:45:44 +0000 (UTC) Received: by mail-ea0-f176.google.com with SMTP id h14so1371453eaj.21 for ; Fri, 07 Feb 2014 00:45:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=YLFsxAAQgJ3a6n0TqQVRFudhjnuUNScLRs2RTPOu2Sw=; b=QwHCGvxmwc3AK69T4ZiUK1prKccEk71OOaitO9NJZh8h2IlhWifPlPYK34QOxC42nP knXa9wZCMN1t309Mz0yjQoW4Qvly0Gp2i69YQErVKep98dovYR5W1Z3feXKi3WgOU/iy K2DyHjDPr7nI+SLf18zEZ5f1C0fdrxug6Gtf8yUJkxg4wH8aWpZtDlqs7okrSyCunAJP cbZugNza489tW2YWzid8Yo+V2YBzEwln9HNvkx8OC5a/Uxte/Bjbe/yyQ1VEIp9RwDZN ltzoSoOFcECoG2qjgMuGZELdxxahGA8N5xiOGr8515mbUCeU6mJygJQDynHEKQ5uyANO RfhQ== X-Received: by 10.14.98.193 with SMTP id v41mr365762eef.112.1391762743473; Fri, 07 Feb 2014 00:45:43 -0800 (PST) Received: from ?IPv6:2001:67c:2154:ffff:951e:2b6:ce23:542e? ([2001:67c:2154:ffff:951e:2b6:ce23:542e]) by mx.google.com with ESMTPSA id s46sm13698877eeb.0.2014.02.07.00.45.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Feb 2014 00:45:43 -0800 (PST) Message-ID: <52F49D36.8000103@gmail.com> Date: Fri, 07 Feb 2014 10:45:42 +0200 From: Viktor User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: freebsd-drivers@freebsd.org Subject: Receiving jumbo frames Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 08:45:45 -0000 Hi, folks! I'm writing an extension functionality to not-yet published network driver. I'm receiving the typical ethernet frames without problems. Considering the datasheet of the device, I'm capable of receiving jumbo frames. When I try to do that, e.g. to send jumbo frame of 8000 bytes, I'm receiving only a limited count of them - 105, then the kernel crashes with the following message: "panic: vm_fault: fault on nofault entry, addr: cfcec000". I have inspected a kernel dump with kgdb and the problem occurs at the function bus_dmamap_sync. Some background information: To enable the jumbo frame, one must set the appropriate register. At the software level, a ring buffer with the descriptors is implemented. The device, under which the driver runs, is arm-based. The freebsd version is 8.0. The device uses SerialDMA queues for transmitting and receiving. To receive packets, the CPU must perform the following: 1. Prepare a linked list of descriptors 2. Configure a given queue with the address of the first descriptor in the list, 3. enable SerialDMA; With the transmission - I don't have any problems. The logic is the same as by the reception of packets - ring buffer with descriptors. Any ideas what can cause this type of crashes? From owner-freebsd-drivers@FreeBSD.ORG Fri Feb 7 16:41:29 2014 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A4FD625 for ; Fri, 7 Feb 2014 16:41:29 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1BFD2113E for ; Fri, 7 Feb 2014 16:41:28 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s17GfNSi075282 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 7 Feb 2014 08:41:23 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s17GfMYf075281; Fri, 7 Feb 2014 08:41:22 -0800 (PST) (envelope-from jmg) Date: Fri, 7 Feb 2014 08:41:22 -0800 From: John-Mark Gurney To: Viktor Subject: Re: Receiving jumbo frames Message-ID: <20140207164122.GE89104@funkthat.com> Mail-Followup-To: Viktor , freebsd-drivers@freebsd.org References: <52F49D36.8000103@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52F49D36.8000103@gmail.com> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Fri, 07 Feb 2014 08:41:23 -0800 (PST) Cc: freebsd-drivers@freebsd.org X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 16:41:29 -0000 Viktor wrote this message on Fri, Feb 07, 2014 at 10:45 +0200: > Hi, folks! I'm writing an extension functionality to not-yet published > network driver. > I'm receiving the typical ethernet frames without problems. Considering > the datasheet of the device, > I'm capable of receiving jumbo frames. When I try to do that, e.g. to > send jumbo frame of 8000 bytes, I'm receiving only a limited count of > them - 105, then the kernel crashes with the following message: > "panic: vm_fault: fault on nofault entry, addr: cfcec000". This happens when you access an address in kmem (kernel space) that no longer has a page mapped... This is probably due to a pointer that was previously valid, but then you aren't suppose to have and the kernel unmapped the page because the subsystem free'd it... > I have inspected a kernel dump with kgdb and the problem occurs at the > function bus_dmamap_sync. What part of this? It could be that you are trying to _sync a buffer that doesn't belong to you anymore... Are you making sure that you allocate new frames to replace them in the receive buffer? > Some background information: > To enable the jumbo frame, one must set the appropriate register. > At the software level, a ring buffer with the descriptors is implemented. > The device, under which the driver runs, is arm-based. > The freebsd version is 8.0. The device uses SerialDMA queues for > transmitting and receiving. > To receive packets, the CPU must perform the following: > 1. Prepare a linked list of descriptors > 2. Configure a given queue with the address of the first descriptor > in the list, > 3. enable SerialDMA; > > With the transmission - I don't have any problems. The logic is the same > as by the reception of packets - ring buffer with descriptors. > > Any ideas what can cause this type of crashes? With out better idea of what the driver is doing, or a line on which the panic happens, the above is about all I can think of... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."