aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
Commit message (Collapse)AuthorAgeFilesLines
* cxgbe(4): check if the firmware supports FW_RI_FR_NSMR_TPTE_WR workNavdeep Parhar2019-12-181-0/+8
| | | | | | | | | | | | request. This is used by iw_cxgbe to figure out how best to register memory. MFC after: 1 month Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=355886
* oce: Tighten input validation in the SIOCGI2C handler.Mark Johnston2019-12-181-9/+8
| | | | | | | | | | | | | | Missing validation meant that it was possible to read 8 bytes beyond the end of sfp_vpd_dump_buffer. Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com> Reviewed by: delphij, ram MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22859 Notes: svn path=/head/; revision=355885
* acpi(4): Add _CID to PNP info stringConrad Meyer2019-12-181-2/+5
| | | | | | | | | | | | | | While a given ACPI device may have 0-N compatibility IDs, in practice most seem to have 0 or 1. If one is present, emit it as part of the PNP info string associated with a device. This could enable MODULE_PNP_INFO-based automatic kldload for ACPI drivers associated with a given _CID (but without a good _HID or _UID identifier). Reviewed by: imp, jhb Differential Revision: https://reviews.freebsd.org/D22846 Notes: svn path=/head/; revision=355876
* an(4): Require privileges for all SIOCGAIRONET requests.Mark Johnston2019-12-171-8/+15
| | | | | | | | | | | | | | | | SIOCGAIRONET allows userspace to query an(4) for various device properties and configuration, which appears to potentially include sensitive information such as WEP keys (an(4) seems to predate WPA). Also avoid races by copying in the request structure to a temporary buffer before locking and modifying the device softc. Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com> MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=355864
* Update owc_gpiobus (one-wire over gpio) to the modern gpio_pin interface.Ian Lepore2019-12-171-105/+88
| | | | | | | | | | | | | | | | | | It used to be required that a device be a child of gpiobus(4) to manipulate gpio pins. That requirement didn't work well for FDT-based systems with many cross-hierarchy users of gpio, so a more modern framework was created that removed the old hierarchy requirement. These changes adapt the owc_gpiobus driver to use the newer gpio_pin_* functions to acquire, release, and manipulate gpio pins. This allows a single driver to work for both hinted-attachment and fdt-based systems, and removes the requirement that any one-wire fdt nodes must appear at the root of the devicetree. Differential Revision: https://reviews.freebsd.org/D22710 Notes: svn path=/head/; revision=355858
* kbd: const'ify a couple of keyboard_driver fieldsKyle Evans2019-12-171-4/+9
| | | | | | | | | | Nothing modifies these things, but const'ify out of an abundance of caution. If we could const'ify the definition in each keyboard driver, I likely would- improper mutations here can lead to misbehavior or slightly more annoying to debug state. Notes: svn path=/head/; revision=355842
* Avoid a tautological bitwise compare.Brooks Davis2019-12-171-1/+1
| | | | | | | | | | | | | | This looks like a bit of debugging code that sliped into the initial import of the new ATA framework. This changes the behavior to omit a line of output that appears to have been intended for omission. Reviewed by: mav MFC after: 3 days Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22845 Notes: svn path=/head/; revision=355830
* Add back accidentally dropped masking...Warner Losh2019-12-161-3/+2
| | | | | | | | | | | | | | - PCI_MASK_CONFIG(sc->dev, CBBR_BRIDGECTRL, - & ~CBBM_BRIDGECTRL_INTR_IREQ_ISA_EN, 2); was accidentally dropped from r355822 in the refactor. Restore it since 16-bit cards may fail without it (some bridges autodetect this properly, so my laptop worked when I tested it). Noticed by: rpokala@ Notes: svn path=/head/; revision=355827
* Move attachment of pccard children into exca library. Attach theWarner Losh2019-12-162-13/+14
| | | | | | | | cardbus and pccard children before the sysctls are added rather than after. Notes: svn path=/head/; revision=355824
* Add slot number ivar to return which slot number the child is attached to.Warner Losh2019-12-162-0/+18
| | | | | | | | This will always be 0 for pccbb, but may be non-zero for other kinds of bridges, should they show up in the tree. Make querying it generic. Notes: svn path=/head/; revision=355823
* We'll never have multiple slots a cardbus bridge. So, replace excaWarner Losh2019-12-163-41/+37
| | | | | | | | | | | array with a singleton. Also, pccbb isa attachment is never going to happen, do disconnect it from the build (will delete this in future commit). It would need to be updated as well, but since this code is effectively dead code, remove it from the build instead. Notes: svn path=/head/; revision=355822
* kbd drivers: don't double register keyboard driversKyle Evans2019-12-166-0/+28
| | | | | | | | | | | | | | | | | | Keyboard drivers are generally registered via linker set. In these cases, they're also available as kmods which use KPI for registering/unregistering keyboard drivers outside of the linker set. For built-in modules, we still fire off MOD_LOAD and maybe even MOD_UNLOAD if an error occurs, leading to registration via linker set and at MOD_LOAD time. This is a minor optimization at best, but it keeps the internal kbd driver tidy as a future change will merge the linker set driver list into its internal keyboard_drivers list via SYSINIT and simplify driver lookup by removing the need to consult the linker set. Notes: svn path=/head/; revision=355806
* kbd: patch linker set methods, tooKyle Evans2019-12-161-0/+17
| | | | | | | | | | This is needed after r355796. Some double-registration of kbd drivers needs to be sorted out, then this sysinit will simply add these drivers into the normal list and kill off any other bits in the driver that are aware of the linker set, for simplicity. Notes: svn path=/head/; revision=355799
* kbd: remove kbdsw, store pointer to driver in each keyboard_tKyle Evans2019-12-162-92/+77
| | | | | | | | | | | | | | | | | | The previous implementation relied on a kbdsw array that mirrored the global keyboards array. This is fine, but also requires extra locking consideration when accessing to ensure that it's not being resized as new keyboards are added. The extra pointer costs little in a struct that there are relatively few of on any given system, and simplifies locking requirements ever-so-slightly as we only need to consider the locking requirements of whichever method is being invoked. __FreeBSD_version is bumped as any kbd modules will need rebuilt following this change. Notes: svn path=/head/; revision=355798
* kbd: provide default implementations of get_fkeystr/diagKyle Evans2019-12-1610-20/+9
| | | | | | | | | Most keyboard drivers are using the genkbd implementations as it is; formally use them for any that aren't set and make genkbd_get_fkeystr/genkbd_diag private. Notes: svn path=/head/; revision=355796
* keyboard switch definitions: standardize on c99 initializersKyle Evans2019-12-164-76/+76
| | | | | | | | | A future change will provide default implementations for some of these where it makes sense and most of them are already using the genkbd implementation (e.g. get_fkeystr, diag). Notes: svn path=/head/; revision=355794
* kbd drivers: use kbdd_* indirection for diag invocationKyle Evans2019-12-163-3/+3
| | | | | | | | | | | These invocations were directly calling enkbd_diag(), rather than indirection back through kbdd_diag/kbdsw. While they're functionally equivent, invoking kbdd_diag where feasible (i.e. not in a diag implementation) makes it easier to visually identify locking needs in these other drivers. Notes: svn path=/head/; revision=355793
* schedlock 4/4Jeff Roberson2019-12-152-4/+2
| | | | | | | | | | | | | | | | | | | | | Don't hold the scheduler lock while doing context switches. Instead we unlock after selecting the new thread and switch within a spinlock section leaving interrupts and preemption disabled to prevent local concurrency. This means that mi_switch() is entered with the thread locked but returns without. This dramatically simplifies scheduler locking because we will not hold the schedlock while spinning on blocked lock in switch. This change has not been made to 4BSD but in principle it would be more straightforward. Discussed with: markj Reviewed by: kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D22778 Notes: svn path=/head/; revision=355784
* schedlock 1/4Jeff Roberson2019-12-151-0/+2
| | | | | | | | | | | | | | | Eliminate recursion from most thread_lock consumers. Return from sched_add() without the thread_lock held. This eliminates unnecessary atomics and lock word loads as well as reducing the hold time for scheduler locks. This will eventually allow for lockless remote adds. Discussed with: kib Reviewed by: jhb Tested by: pho Differential Revision: https://reviews.freebsd.org/D22626 Notes: svn path=/head/; revision=355779
* kbd: convert kbdd_* macros to inline functionsKyle Evans2019-12-151-47/+140
| | | | | | | | This reduces the noise when interested parties wish to de-Giant kbd; these accesses to kbdsw will need to be properly locked. Notes: svn path=/head/; revision=355775
* Properly synchronize completion DMA buffers.Michal Meloun2019-12-151-5/+9
| | | | | | | | | | | Within command completion processing the callback function may access DMAed data buffer. Synchronize it before use, not after. This allows to use NVMe disk on non-DMA coherent arm64 system. MFC after: 3 weeks Notes: svn path=/head/; revision=355774
* kbd: drop _KERNEL #ifdef in kbdreg.hKyle Evans2019-12-151-4/+0
| | | | | | | | | | This #ifdef is misleading as there are actually no user-serviceable parts inside and, as far as I can tell, there is no pollution leading from userland to this header. Furthermore, it becomes a slight nuisance when attempting to move things around in this header. Notes: svn path=/head/; revision=355769
* Add a deferred free mechanism for freeing swap space that does not requireJeff Roberson2019-12-151-8/+2
| | | | | | | | | | | | | | | | | | | | | | an exclusive object lock. Previously swap space was freed on a best effort basis when a page that had valid swap was dirtied, thus invalidating the swap copy. This may be done inconsistently and requires the object lock which is not always convenient. Instead, track when swap space is present. The first dirty is responsible for deleting space or setting PGA_SWAP_FREE which will trigger background scans to free the swap space. Simplify the locking in vm_fault_dirty() now that we can reliably identify the first dirty. Discussed with: alc, kib, markj Differential Revision: https://reviews.freebsd.org/D22654 Notes: svn path=/head/; revision=355765
* Add accessors for the Vendor Specific Extended Capability (VSEC)Scott Long2019-12-131-0/+7
| | | | | | | | | | | | | Parse out the VSEC. If the user invokes a second -c command line option, do a hex dump of the vendor data. Reviewed by: imp MFC after: 3 days Sponsored by: Intel Differential Revision: http://reviews.freebsd.org/D22808 Notes: svn path=/head/; revision=355741
* Expand net epoch in the cxgbe TOE driver to satisfy assertions.John Baldwin2019-12-132-6/+22
| | | | | | | | | Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D22483 Notes: svn path=/head/; revision=355740
* Be consistent about checking return value from bus_delayed_attach_children.Warner Losh2019-12-131-3/+1
| | | | | | | | | | Most places checked, but a couple last minute changes didn't. Make them all use the return value. Noticed by: rpokala@ Notes: svn path=/head/; revision=355735
* cxgbe(4): Use the _XT variant of the CPL used to transmit NIC traffic.Navdeep Parhar2019-12-133-123/+126
| | | | | | | | | | | | | | | | | | CPL_TX_PKT_XT disables the internal parser on the chip and instead relies on the driver to provide the exact length of the L2 and L3 headers. This allows hw checksumming and TSO to be used with L2 and L3 encapsulations that the chip doesn't understand directly. Note that netmap tx still uses the old CPL as it never uses the hw to generate the checksum on tx. Reviewed by: jhb@ MFC after: 1 month Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D22788 Notes: svn path=/head/; revision=355730
* Use callout(9) instead of deprecated timeout(9).John Baldwin2019-12-133-15/+14
| | | | | | | | | Reviewed by: imp Tested by: Scott Benesh Differential Revision: https://reviews.freebsd.org/D22598 Notes: svn path=/head/; revision=355728
* Create new wrapper function: bus_delayed_attach_children()Warner Losh2019-12-133-8/+4
| | | | | | | | | | | | | Delay the attachment of children, when requested, until after interrutps are running. This is often needed to allow children to run transactions on i2c or spi busses. It's a common enough idiom that it will be useful to have its own wrapper. Reviewed by: ian Differential Revision: https://reviews.freebsd.org/D21465 Notes: svn path=/head/; revision=355727
* Move to using bool instead of boolean_tWarner Losh2019-12-133-15/+15
| | | | | | | | | | | | While there are subtle semantic differences between bool and boolean_t, none of them matter in these cases. Prefer true/false when dealing with bool type. Preserve a couple of TRUEs since they are passed into int args into CAM. Preserve a couple of FALSEs when used for status.done, an int. Differential Revision: https://reviews.freebsd.org/D20999 Notes: svn path=/head/; revision=355721
* If device_delete_children() returns an error, bail on the rest of theIan Lepore2019-12-131-2/+3
| | | | | | | | | detach work and return the error. Especially don't call iicbus_reset() since the most likely cause of failing to detach children is that one of them has IO in progress. Notes: svn path=/head/; revision=355688
* Clean up some of my copyrights; add SPDX tag and remove All rights reserved.Ian Lepore2019-12-137-6/+16
| | | | Notes: svn path=/head/; revision=355685
* cxgbe(4): Never use hardware checksumming in netmap tx.Navdeep Parhar2019-12-121-10/+5
| | | | | | | | MFC after: 1 week Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=355673
* Move reset to the interrutp processing stageWarner Losh2019-12-112-19/+19
| | | | | | | | | | | This trims the boot time a bit more for AWS and other platforms that have nvme drives. There's no reason too do this inline. This has been in my tree a while, but IIRC I talked to Jim Harris about this at one of our face to face meetings. MFC After: 2 weeks Notes: svn path=/head/; revision=355631
* dwmmc: Use device_delete_childrenEmmanuel Vadot2019-12-111-7/+1
| | | | | | | | | | | Instead of first detaching the children(s) and then delete them, use the device_delete_children function that does all of that. MFC after: 1 month Suggested by: ian Notes: svn path=/head/; revision=355629
* dwmmc: Handle the card detect interruptEmmanuel Vadot2019-12-116-4/+81
| | | | | | | | | | | | | | | | | The driver used to always add the mmc device as it's child even it no card was detected. Add a function that will detect if the card is present or not and that will attach/detach the mmc device. The function is either call on attach (as we won't have the interrupt fired) or from two taskqueues. The first taskqueue will directly call the function when the sdcard was present and is now removed and the other one will delay a bit the attach when we didn't had a card and now have one. This is mostly based on comments from the sdhci driver where it describe a situation when the CD pin is detected before the others pins are connected. MFC after: 1 month Notes: svn path=/head/; revision=355627
* dwmmc: Add a detach methodEmmanuel Vadot2019-12-113-1/+63
| | | | | | | | | | | | | This method will disable the regulators, clocks and assert the reset of the module. It will also detach it's children (the mmc device) and release it's resources. While here enable the regulators on attach as we need them to power up the sdcard or emmc. MFC after: 1 month Notes: svn path=/head/; revision=355625
* Use callout_func_t instead of the deprecated timeout_t.John Baldwin2019-12-1011-16/+16
| | | | | | | | Reviewed by: kib, imp Differential Revision: https://reviews.freebsd.org/D22752 Notes: svn path=/head/; revision=355601
* Do not attach children of owc_gpiobus until interrupts are working.Ian Lepore2019-12-101-1/+1
| | | | | | | | | | | | The children of the bus need to do IO on the bus to probe for hardware presence. Doing IO means timing the bus states using sbinuptime(), and that requires working timecounters, which are not initialized until after device attachment has completed. PR: 242526 Notes: svn path=/head/; revision=355598
* [ig4] Remove unused methods from bus interfaceVladimir Kondratyev2019-12-102-4/+0
| | | | | | | | | | | bus_get/set_resource methods are implemented in child device (iicbus). As their implementation with bus_generic_rl_get/set calls do not recurse up the tree, the versions in ig4 are never called. Suggested by: jhb Notes: svn path=/head/; revision=355596
* cxgbe(4): Simplify the firmware version checks a bit.Navdeep Parhar2019-12-101-9/+4
| | | | | | | | | No functional change. MFC after: 1 week Notes: svn path=/head/; revision=355595
* Introduce vm_page_astate.Mark Johnston2019-12-101-1/+1
| | | | | | | | | | | | | | | | | This is a 32-bit structure embedded in each vm_page, consisting mostly of page queue state. The use of a structure makes it easy to store a snapshot of a page's queue state in a stack variable and use cmpset loops to update that state without requiring the page lock. This change merely adds the structure and updates references to atomic state fields. No functional change intended. Reviewed by: alc, jeff, kib Sponsored by: Netflix, Intel Differential Revision: https://reviews.freebsd.org/D22650 Notes: svn path=/head/; revision=355586
* cxgbe(4): Use TX_PKTS2 work requests in netmap Tx if it's available.Navdeep Parhar2019-12-103-4/+16
| | | | | | | | | | | TX_PKTS2 is more efficient within the firmware and this improves netmap Tx by a few Mpps in some common scenarios. MFC after: 1 week Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=355580
* cxgbe(4): Update T4/5/6 firmwares to 1.24.11.0.Navdeep Parhar2019-12-108-33834/+30
| | | | | | | | | | | | | These were obtained from the Chelsio Unified Wire v3.12.0.1 beta release. Note that the firmwares are not uuencoded any more. MFH: 1 month Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=355579
* Allow baud rates of 1,228,800 and 1,843,200 on CP2101/2/3 usb-serial adapters.Ian Lepore2019-12-091-1/+5
| | | | | | | | | | The datasheets for these chips claim the maximum is 921,600, but testing shows these two higher rates also work (but no rates above 921,600 other than these two work; these represent dividing the base buad clock by 3 and 2 respectively). Notes: svn path=/head/; revision=355572
* Configure headphone redirection for the Dell L780 and X1 Carbon 7th gen.Mark Johnston2019-12-092-2/+6
| | | | | | | | | | | | As we do for many other laptops, put the headphone jack and speakers in the same association by default so that the generic sound device automatically switches between them. MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=355570
* cxgbe/iw_cxgbe: Support 64b length in the memory registration routines.Navdeep Parhar2019-12-091-6/+5
| | | | | | | | | Submitted by: bharat @ chelsio MFC after: 1 week Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=355566
* Switch gpioths(4) from using a callout to a taskqueue for periodic pollingIan Lepore2019-12-091-10/+17
| | | | | | | | | | | of the sensor hardware. Part of the polling process involves signalling the chip then waiting 20 milliseconds. This was being done with DELAY(), which is a pretty rude thing to do in a callout. Now a taskqueue_thread task is scheduled to do the polling, and because sleeping is allowed in the task context, pause_sbt() replaces DELAY() for the 20ms wait. Notes: svn path=/head/; revision=355565
* Enable use of ofwcons for early debugLeandro Lupori2019-12-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | This change enables the use of OpenFirmware Console (ofwcons), even when VGA is available, allowing early kernel messages to be seen, that is important in case of crashes before VGA console initialization. This is specially useful in virtualized environments, where the user/developer doesn't have full control of the virtualization engine (e.g. OpenStack). The old behavior is preserved by default and, in order to use ofwcons, a few tunables that have been introduced need to be set: - hw.ofwfb.disable=1 - disable OFW FrameBuffer device - machdep.ofw.mtx_spin=1 - change PPC OFW mutex to SPIN type, to match kernel console's mutex type - debug.quiesce_ofw=0 - don't call OFW quiesce, needed to keep ofwcons I/O working More details can be found at differential revision D20640. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D20640 Notes: svn path=/head/; revision=355556
* Paste things correctly so that I'm added to the *end* of the copyright list.Ian Lepore2019-12-091-1/+1
| | | | Notes: svn path=/head/; revision=355550