aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
Commit message (Collapse)AuthorAgeFilesLines
* MFC 12148d4300db:Hans Petter Selasky2021-03-031-6/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix for locking order reversal in USB audio driver, when using mmap(). Locking the second lock which causes the LOR, can be skipped because the code updating the shared variables is always executing from the same USB thread. lock order reversal: 1st 0xfffff80005cc3840 pcm7:play:dsp7.p0 (pcm play channel, sleep mutex) @ usb_transfer.c:2342 2nd 0xfffff80005cc3860 pcm7:record:dsp7.r0 (pcm record channel, sleep mutex) @ uaudio.c:2317 lock order pcm record channel -> pcm play channel established at: witness_checkorder+0x461 __mtx_lock_flags+0x98 dsp_mmap_single+0x151 vm_mmap_cdev+0x65 devfs_mmap_f+0x143 kern_mmap_req+0x594 sys_mmap+0x46 amd64_syscall+0x12e fast_syscall_common+0xf8 lock order pcm play channel -> pcm record channel attempted at: witness_checkorder+0xd82 __mtx_lock_flags+0x98 uaudio_chan_play_callback+0xeb usbd_callback_wrapper+0x7ec usb_command_wrapper+0x7e usb_callback_proc+0x8e usb_process+0xf3 fork_exit+0x80 fork_trampoline+0xe Found by: Stefan Ehmann <shoesoft@gmx.net> Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit 12148d4300dbbd93260bf2801cdb9eda8b3b05a4)
* MFC r362045:Hans Petter Selasky2020-06-181-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure packets generated by raw IP code is let through by mlx5en(4). Allow the TCP header to reside in the mbuf following the IP header. Else such packets will get dropped. Backtrace: mlx5e_sq_xmit() mlx5e_xmit() ether_output_frame() ether_output() ip_output_send() ip_output() rip_output() sosend_generic() sosend() kern_sendit() sendit() sys_sendto() amd64_syscall() fast_syscall_common() Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=362313
* MFC r362044:Hans Petter Selasky2020-06-181-7/+12
| | | | | | | | | | | | | | Extend use of unlikely() in the fast path, in mlx5en(4). Typically the TCP/IP headers fit within the first mbuf and should not trigger any of the error cases. Use unlikely() for these cases. No functional change. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=362310
* MFC r362043:Hans Petter Selasky2020-06-181-9/+17
| | | | | | | | | | | | | | | Use const keyword when parsing the TCP/IP header in the fast path in mlx5en(4). When parsing the TCP/IP header in the fast path, make it clear by using the const keyword, no fields are to be modified inside the transmitted packet. No functional change. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=362307
* MFC r362056:Hans Petter Selasky2020-06-141-2/+11
| | | | | | | | | | Add missing range checks when receiving USB ethernet packets. Found by: Ilja Van Sprundel, IOActive Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=362168
* MFC r361827:Hans Petter Selasky2020-06-081-26/+26
| | | | | | | | | | | | | | | | | | USB HID descriptors may push/pop the current state to allow description of items residing in a so-called union. FreeBSD currently only supports 4 such push levels. If the push level is not restored within the processing of the same HID item, an invalid memory location may be used for subsequent HID item processing. Verify that the push level is always valid when processing HID items. Reported by: Andy Nguyen (Google) Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=361921
* MFC r361581:Hans Petter Selasky2020-06-082-0/+78
| | | | | | | | | | Implement helper function, usbd_get_max_frame_length(), which allows kernel device drivers to correctly predict the default USB transfer frame length. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=361912
* MFC r361577:Hans Petter Selasky2020-06-081-1/+1
| | | | | | | | | | Don't allow USB device drivers to parent own interface. It will prevent proper USB device detach. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=361908
* MFC r360075:Hans Petter Selasky2020-04-261-17/+0
| | | | | | | | | | | | | | Set the maximum exit latency to 0 for XHCI USB 3.0 devices, because we don't implement link power management, LPM. This fixes error code XHCI_TRB_ERROR_BANDWIDTH for isochronous USB 3.0 transactions. Submitted by: Horse Ma <Shichun.Ma@dell.com> Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=360335
* MFC r348445 (by lwhsu):Dimitry Andric2020-04-251-2/+3
| | | | | | | | | | | | Add the missing braces to fix the code not guarded by the if clause and has misleading indentation. This is found by gcc -Wmisleading-indentation Approved by: erj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20428 Notes: svn path=/stable/10/; revision=360304
* Fix misleading indentation in sys/dev/drm2/radeon/evergreen.cDimitry Andric2020-04-251-1/+1
| | | | | | | | | | | | This fixes the following warning from recent versions of clang and gcc: sys/dev/drm2/radeon/evergreen.c:554:4: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] Direct commit to stable/{10,11,12}, since this driver has been removed from FreeBSD 13. Notes: svn path=/stable/10/; revision=360303
* MFC r359446:Hans Petter Selasky2020-04-133-145/+251
| | | | | | | | | | | | | | | Add support for multiple playback and recording devices per physical USB audio device. This requires some structural refactoring inside the driver, mostly about converting existing audio channel structures into arrays. The main audio mixer is provided by the first PCM instance. The non-first audio instances may only have a software mixer for PCM playback. Tested by: Horse Ma <Shichun.Ma@dell.com> Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=359890
* MFC r359440:Hans Petter Selasky2020-04-132-0/+9
| | | | | | | | | Implement new mixer API to return the device pointer based on the mixer pointer. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=359887
* MFC r359356:Hans Petter Selasky2020-04-131-1/+1
| | | | | | | | | | Change default microphone level from 0 to 25. Discussed with: Horse Ma <Shichun.Ma@dell.com> Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=359884
* MFC r359355:Hans Petter Selasky2020-04-131-389/+254
| | | | | | | | | | | | | | | | Improve USB audio mixer support for USB audio class 1 and 2. - make sure volume controls are correctly mapped to "pcm" and "rec" depending on how they deliver audio to the USB host. - make sure there are no duplicate record selections. - remove internal only mixer class type. - don't add software volume controls for recording only. - some minor mixer code cleanup. Tested by: Horse Ma <Shichun.Ma@dell.com> Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=359881
* MFC r359323:Hans Petter Selasky2020-04-131-27/+36
| | | | | | | | | | Be more intelligent when classifying USB audio terminal types, so that we don't end up using SOUND_MIXER_VOLUME for all undefined types. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=359878
* MFC r359322:Hans Petter Selasky2020-04-131-2/+2
| | | | | | | | | | Make mute controls available for USB audio mixers. Submitted by: Horse Ma <Shichun.Ma@dell.com> Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=359875
* MFC r359321:Hans Petter Selasky2020-04-131-12/+6
| | | | | | | | | Factor out USB audio mixer value range check. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=359872
* MFC r359320:Hans Petter Selasky2020-04-131-8/+4
| | | | | | | | | Avoid scaling USB audio mixer values twice. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=359869
* MFC r359653:Hans Petter Selasky2020-04-132-1/+5
| | | | | | | | | | Count number of times transmit ring is out of buffers in mlx5en(4). Differential Revision: https://reviews.freebsd.org/D24273 Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=359855
* MFC r359654:Hans Petter Selasky2020-04-131-5/+13
| | | | | | | | | | | | | | | | Ensure a minimum inline size of 16 bytes in mlx5en(4). This includes 14 bytes of ethernet header and 2 bytes of VLAN header. This allows for making assumptions about the inline size limit in the fast transmit path later on. Use a signed integer variable to catch underflow. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=359847
* MFC r359120:Hans Petter Selasky2020-03-262-6/+52
| | | | | | | | | | Correctly implement support for remote wakeup for USB 3.0 device. Submitted by: Horse Ma <Shichun.Ma@dell.com> Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=359318
* MFC r338422: Adding support for CS46xx MIDI output.Tai-hwa Liang2020-03-202-4/+290
| | | | | | | | | | | | With this patch, users can play the MIDI files through /dev/sequencer device with tools like playmidi. The audio output will go through the external MIDI device such like wavetable synthesis card. Reviewed by: matk (a long time ago), kib Tested with: Terratec SiXPack 5.1+ + Yamaha DB50XG Notes: svn path=/stable/10/; revision=359161
* MFC r358629:Hans Petter Selasky2020-03-114-21/+20
| | | | | | | | | | | | | | | | | | Implement a detaching flag for the sound(4) subsystem to take appropriate actions when we are trying to detach an audio device, but cannot because someone is using it. This avoids applications having to wait for the DSP read data timeout before they receive any error indication. Tested with virtual_oss(8). Remove some unused definitions while at it. PR: 194727 Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=358879
* MFC r358738:Hans Petter Selasky2020-03-112-9/+6
| | | | | | | | | | | | | | | Remove the power bit from the super speed root hub port status register because it clobbers the super speed link status when a device is in super speed mode. Currently the power bit is not needed for anything in the USB hub driver. This fixes USB warm reset for super speed devices. Tested by: Shichun.Ma@dell.com Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=358875
* MFC r356952:Hans Petter Selasky2020-02-032-0/+2
| | | | | | | | | | | Add new USB ID to uslcom(4). Submitted by: Oleg Sharoyko <osharoiko@gmail.com> PR: 243494 Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=357432
* MFC r356545:Hans Petter Selasky2020-01-162-8/+25
| | | | | | | | | | | | | | | | | | | | Fix a XHCI driver issue with Intel's Gemini Lake SOC. Do not configure any endpoint twice, but instead keep track of which endpoints are configured on a per device basis, and use an evaluate endpoint context command instead. When changing the configuration make sure all endpoints get deconfigured and the configured endpoint mask is reset. This fixes an issue where an endpoint might stop working if there is an error and the endpoint needs to be reconfigured as a part of the error recovery mechanism in the FreeBSD USB stack. Tested by: Shichun.Ma@dell.com Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=356783
* MFC r356409:Hans Petter Selasky2020-01-132-1/+5
| | | | | | | | | | | | Add own counter for cancelled USB transfers. Do not count these as errors. Bump the FreeBSD version to force recompilation of external modules. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=356681
* MFC r356201:Hans Petter Selasky2020-01-061-1/+1
| | | | | | | | | | Fix spelling. PR: 242891 Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=356412
* MFC r356135:Hans Petter Selasky2020-01-064-16/+17
| | | | | | | | | | | | Make USB statistics per device instead of per bus. Bump the FreeBSD version due to structure change to force recompilation of external USB modules. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=356396
* MFC r355447:Hans Petter Selasky2019-12-251-5/+2
| | | | | | | | | | | Fix compilation issue with mlx5core and sparc64 (gcc48): sys/dev/mlx5/mlx5_en/mlx5_en_tx.c:335: error: requested alignment is not a constant Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=356074
* MFC: r353778 (partial)Marius Strobl2019-10-301-2/+3
| | | | | | | | | | In em_handle_link(), only re-arm the link state change interrupt for 82574 and also only if such a device uses MSI-X, i. e. takes advantage of autoclearing. In case of INTx and MSI re-arming isn't appropriate here and setting EM_MSIX_LINK isn't either. Notes: svn path=/stable/10/; revision=354209
* MFC r319872, r321063, r321582, r322034, r322425, r322962, r322985,Navdeep Parhar2019-10-1014-33556/+35134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r325596, r326026, r328420, r331472, r333276, r333650, r333652, r334406, r334409-r334410, r334489, r336042, r340651, r342603, and r345083. This updates the cxgbe firmwares in stable/10 and also pulls in support for some newer boards and flash parts. r319872: cxgbe(4): Do not request an FEC setting that the port does not support. r321063: cxgbe(4): Various link/media related improvements. r321582: cxgbe(4): Some updates to the common code. r322034: cxgbe(4): Always use the first and not the last virtual interface associated with a port in begin_synchronized_op. r322425: cxgbe(4): Save the last reported link parameters and compare them with the current state to determine whether to generate a link-state change notification. This fixes a bug introduced in r321063 that caused the driver to sometimes skip these notifications. r322962: cxgbe(4): Remove write only variable from t4_port_init. r322985: cxgbe(4): Maintain one ifmedia per physical port instead of one per Virtual Interface (VI). All autonomous VIs that share a port share the same media. r325596: cxgbe(4): Do not request settings not supported by the port. r326026: cxgbe(4): Add a custom board to the device id list. r328420: cxgbe(4): Do not display harmless warning in non-debug builds. r331472: cxgbe(4): Always initialize requested_speed to a valid value. This fixes an avoidable EINVAL when the user tries to disable AN after the port is initialized but l1cfg doesn't have a valid speed to use. r333276: cxgbe(4): Update all firmwares to 1.19.1.0. r333650: cxgbe(4): Claim some more T5 and T6 boards. r333652: cxgbe(4): Add support for two more flash parts. r334406: cxgbe(4): Consider all supported speeds when building the ifmedia list for a port. Fix other related issues while here: - Require port lock for access to link_config. - Allow 100Mbps operation by tracking the speed in Mbps. Yes, really. - New port flag to indicate that the media list is immutable. It will be used in future refinements. This also fixes a bug where the driver reports incorrect media with recent firmwares. r334409: cxgbe(4): Implement ifm_change callback. r334410: cxgbe(4): Use ifm for ifmedia just like the rest of the kernel. No functional change. r334489: cxgbe(4): Include full duplex mediaopt in media that can be reported as active. Always report full duplex in active media. r336042: cxgbe(4): Assume that any unknown flash on the card is 4MB and has 64KB sectors, instead of refusing to attach to the card. r340651: cxgbe(4): Update T4/5/6 firmwares to 1.22.0.3. r342603: cxgbe(4): Attach to two T540 variants. r345083: cxgbe(4): Update T4/5/6 firmwares to 1.23.0.0. Notes: svn path=/stable/10/; revision=353418
* MFC r352556:Hans Petter Selasky2019-10-073-2/+35
| | | | | | | | | | | | | | | Add quirk for XHCI(4) controllers to support USB control transfers above 1Kbyte. It might look like some XHCI(4) controllers do not support when the USB control transfer is split using a link TRB. The next NORMAL TRB after the link TRB is simply failing with XHCI error code 4. The quirk ensures we allocate a 64Kbyte buffer so that the data stage TRB is not broken with a link TRB. Found at: EuroBSDcon 2019 Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=353179
* MFC r352555:Hans Petter Selasky2019-10-071-1/+1
| | | | | | | | | | | | Increase the maximum user-space buffer size from 256kBytes to 32MBytes for libusb. This is useful for speeding up large data transfers while reducing the interrupt rate. Found at: EuroBSDcon 2019 Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=353175
* MFC r352554:Hans Petter Selasky2019-10-071-1/+1
| | | | | | | | | | The maximum TD size is 31 and not 15. Found at: EuroBSDcon 2019 Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=353171
* MFC r350396:Hans Petter Selasky2019-08-141-0/+3
| | | | | | | | | | Add support for tethering with Nokia 7 plus and the alike. PR: 239495 Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=351017
* MFC r348631:Hans Petter Selasky2019-06-101-4/+47
| | | | | | | | | | | | | In usb(4) fix a lost completion event issue towards libusb(3). It may happen if a USB transfer is cancelled that we need to fake a completion event. Implement missing support in ugen_fs_copy_out() to handle this. This fixes issues with webcamd(8) and firefox. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=348857
* MFC r348604:Hans Petter Selasky2019-06-101-13/+13
| | | | | | | | | | | In xhci(4) there is no stream ID in the completion TRB. Instead iterate all the stream IDs in stream mode to find the matching USB transfer. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=348853
* MFC r348603:Hans Petter Selasky2019-06-091-0/+2
| | | | | | | | | Make sure the DMA tags get freed in mlx5en(4). Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=348832
* MFC r346229 and r346248:Hans Petter Selasky2019-04-251-1/+1
| | | | | | | | | | Fix spelling and remove superfluous USB keyword. Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=346669
* MFC r345611:Ravi Pokala2019-04-031-9/+19
| | | | | | | | | | | Teach jedec_dimm(4) to be more forgiving of non-fatal errors. It looks like some DIMMs claim to have a TSOD, but actually don't. Some claim they weren't able to change the SPD page, but they did. Neither of those should be fatal errors. Notes: svn path=/stable/10/; revision=345838
* MFC r342961:Hans Petter Selasky2019-03-264-4/+7
| | | | | | | | | | | | | snd_uaudio: Add quirks for Edirol UA-25EX in advanced driver mode. Extend the vendor class USB audio quirk to cover devices without the USB audio control descriptor. PR: 234794 Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=345546
* MFC r345009:David Bright2019-03-251-1/+3
| | | | | | | | | | | | | | | | Fix a scribbler in the PMS driver. The ESGL bit was left uninitialized when executing the REPORT LUNS ioctl. This could allow a zeroed data buffer to be treated as a scatter/gather list. The firmware would eventually walk past the end of the data buffer, potentially find what looked like a valid address/length pair, and write the result to semi-random memory. Obtained from: Dell EMC Isilon Sponsored by: Dell EMC Isilon Notes: svn path=/stable/10/; revision=345508
* MFC r344477:Hans Petter Selasky2019-03-012-0/+3
| | | | | | | | | | Add new USB quirk. PR: 235897 Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=344695
* MFC r344473:David Bright2019-02-271-6/+0
| | | | | | | | | | | | | | | CID 1332000: Logically dead code in sys/dev/pms/RefTisa/tisa/sassata/sas/ini/itdio.c A pointer is first tested for NULL. If non-NULL, another pointer is set equal to the first. The second pointer is then checked for NULL and an error path taken if so. This second test and the associated path is dead code as the pointer value, having just been checked for NULL, cannot be NULL at this point. Remove the dead code. Sponsored by: Dell EMC Isilon Notes: svn path=/stable/10/; revision=344646
* MFC r344198:Andriy Voskoboinyk2019-02-211-4/+0
| | | | | | | | | | | GC ATA_REQUEST_TIMEOUT option remnants It was removed from code in r249083 and from sys/conf/options in r249213. PR: 193935, 222170 Notes: svn path=/stable/10/; revision=344431
* MFC r343604:Andriy Voskoboinyk2019-02-081-11/+2
| | | | | | | bwn(4): reuse ieee80211_tx_complete function Notes: svn path=/stable/10/; revision=343910
* MFC r343603:Andriy Voskoboinyk2019-02-081-4/+1
| | | | | | | | | ipw(4): reuse ieee80211_tx_complete function This should partially fix 'netstat -b -I wlan0' output Notes: svn path=/stable/10/; revision=343907
* MFC r337272:Bryan Drewery2019-02-072-49/+36
| | | | | | | Fix some filemon path logging issues. Notes: svn path=/stable/10/; revision=343886