summaryrefslogtreecommitdiff
path: root/sys/dev
AgeCommit message (Collapse)Author
2020-09-03The "USL" VT switch and keyboard ioctls are a hack and don't follow theMark Kettenis
proper BSD way where the third argument is always a pointer and data is transferred between userland and kernel using copyin(9) and copyout(9). Intead an int is encoded in the thirs argument. This works on 32-bit architectures and little-endian 64-bit architectures. But not on big-endian 64-bit architectures. Deal with this by handling the argument as long (which matches the size of a pointer). Hopefully we can eliminate these ioctls in the near future. ok deraadt@
2020-09-03Replace '.response_format = 2' with '.response_format = SID_SCSI2_RESPONSE'.Kenneth R Westerback
2020-09-02When building emulated INQUIRY results use the SCSI_REV_* #define's toKenneth R Westerback
initialize the 'version' field. Not numbers.
2020-09-02When building emulated INQUIRY results use the SCSI_REV_* #define's toKenneth R Westerback
initialize the 'version' field. Not numbers.
2020-09-02Don't rely on wTotalLength for usbd_get_cdesc() malloc/free but on theMarcus Glocker
actual length which has been allocated. We saw cases where the wTotalLength value is changing on a second read, e.g. when a USB device was waked up from sleep mode. ok mpi@
2020-09-01Rename [READ|WRITE]_BIG to [READ|WRITE]_10. Rename struct scsi_rw_big toKenneth R Westerback
struct scsi_rw_10. ok gnezdo@ jmatthew@ (who also did sparc64 compile test)
2020-08-31Backout clear endpoint stall on open(2). It seems to break an illuminatedPatrick Wildt
Logitech keyboard for unknown reasons. Reported by denis@ ok djm@
2020-08-30add missing wakeup for the unlikely dying caseanton
2020-08-30use unique wait messages with msleep_nsec()anton
2020-08-30avoid a invalid pointer deref in hvn_stop()Jonathan Gray
intr_barrier() now uses the argument so directly call sched_barrier(NULL) which is what intr_barrier() used to do until recently. problem reported by and fix tested by Andre Stoebe
2020-08-30PLL1(CPU_PLL) stability improvement for Allwinner H3/H2+SASANO Takayoshi
Due to unstable of PLL1, sometimes the system has hanged up especially at boot. This is observed at Allwinner H3/H2+ processor. To solve the problem, PLL1 setting procedure is same as Linux. 1. change clock source to 24MHz 2. wait 1usec (new) 3. disable PLL1 (new) 4. set new NKMP value, but M should be 1 5. re-enable PLL1 (new) 6. wait PLL1 stable (modified) 7. change clock source to PLL1 8. wait 1usec (new) Once disable PLL1 before setting NKMP is very important. And, sometimes LOCK flag is set even if PLL has not locked yet so wait for PLL is modified with simple delay() by the value of PLL_STABLE_TIME_REG1 register. Not only Allwinner H3/H2+ but also all (i.e. A64) Allwinner processors datasheet has "If the clock source is changed, at most to wait for 8 present running clock cycles." sentence at CPU clock source selection field of CPU/AXI configuration register. But this is ambiguous that _who_ should do _what_ during that cycles. It is unclear that changing clock source itself invoke PLL1 unstability. For safety, added 1usec wait after changing clock source like Linux. ok by kettenis@, thanks to adr at sdf dot org
2020-08-29Before clearing the kcov descriptor associated with a thread make sureanton
no other thread is currently within a remote section. Otherwise, the remote subsystem could end up in a broken state where it doesn't reset the necessary bits upon leaving the remote section. Therefore introduce the kr_barrier() routine which waits until all ongoing remote sections have been left. Also, extend the scope of the mutex to also cover fields of struct kcov_dev. This is necessary to ensure correctness. Reported-by: syzbot+64122a5f01be1b1abb96@syzkaller.appspotmail.com
2020-08-29Prepare to extend the scope of the kcov remote mutex by renaming it toanton
something more generic. It will soon cover the whole kcov subsystem.
2020-08-28free the correct object when a remote subsystem already is presentanton
2020-08-27Fix a potential panic during free(9) which can be caused by an USBMarcus Glocker
device which returns a spurious value for wTotalLength on a configuration descriptor request. Therefore don't relay on wTotalLength for free(9) but on the length variable which was used for the malloc(9) before. The issue was reported by Mikolaj Kucharski <mikolaj (at) kucharski (dot) name> on bugs@. Discussed and ok deraadt@
2020-08-27usbd_get_cdesc() returns usb_config_descriptor_t *. Therefore returnMarcus Glocker
'NULL' instead of '0'. ok deraadt@
2020-08-27Clear endpoint stall on open(2) of /dev/uhidX to synchronize toggle bitPatrick Wildt
as needed on xhci(4) machines. On non-xhci(4) we save and restore the toggle bit on close/open of a pipe. With xhci(4) this does not seem to be possible, at least I haven't yet found it. This means that on those machines with xhci(4), after a pipe close/open, the device will use the previous state, while xhci(4)'s state is reset to default. By issuing a clear endpoint stall we reset the device's toggle bit. Now every time a /dev/uhid is (re-)opened the state should be synchronized. Discussed with damien@, mpi@ and Pedro Marteletto ok markus@
2020-08-27bring back local #undef DEBUG changes lost in drm 5.7 updateJonathan Gray
fixes errors building with option DEBUG reported by phessler@
2020-08-27Reorder the acpi attach process so we look at Processor() CPU nodesJonathan Matthew
after Device() ones, since we should prefer the newer node type. If we see any Device() nodes, don't attach acpicpu(4) to any Processor() nodes if they're also present. This also makes acpitz(4) and acpipwrres(4) devices attach slightly later. ok kettenis@, also tested by jmc@
2020-08-26Reset the Rx block ack session counter when an iwm/iwx interface disassociatesStefan Sperling
from an access point or is put down via ifconfig. Otherwise new Rx block ack sessions could be refused upon reassociation due to a bogus counter value. Found by zxystd from the OpenIntelWireless project (drivers for macOS). Testing by jmc@, kevlo@, and Sven Falempin. ok phessler@ mpi@ kevlo@
2020-08-26Let aml_copyvalue() handle AML_OBJTYPE_DEVICE.Mark Kettenis
ok jmatthew@
2020-08-26Remove needless uses of SDEV_ONLYBIG. It was always set when SDEV_UMASS was set,Kenneth R Westerback
and was always checked in concert with SDEV_ATAPI. Just rely on SDEV_ATAPI and SDEV_UMASS in all but the one place sd(4) where SDEV_ONLYBIG is set independently of SDEV_ATAPI/_UMASS. ok jmatthew@
2020-08-26Revert "drm/amd/display: Improve DisplayPort monitor interop"Jonathan Gray
From Alex Deucher 813b2c197929540e700dc3d42b2c8136795c5d4c in linux 5.7.y/5.7.18
2020-08-26drm/ttm: fix offset in VMAs with a pg_offs in ttm_bo_vm_accessJonathan Gray
From Felix Kuehling be580abecf13ebdcf6c16ec79d941c35017c94be in linux 5.7.y/5.7.18 c0001213d195d1bac83e0744c06ff06dd5a8ba53 in mainline linux
2020-08-26drm/amd/display: fix pow() crashing when given base 0Jonathan Gray
From Krunoslav Kovac b9d077f3781412f304968cf806f636ee91b4470e in linux 5.7.y/5.7.18 d2e59d0ff4c44d1f6f8ed884a5bea7d1bb7fd98c in mainline linux
2020-08-26drm/amd/display: Fix DFPstate hang due to view port changedJonathan Gray
From Paul Hsieh 3f88e2e7a7943ef07a384f653f01832600bb91dd in linux 5.7.y/5.7.18 8e80d482608a4e6a97c75272ef8b4bcfc5d0c490 in mainline linux
2020-08-26drm/amd/display: Blank stream before destroying HDCP sessionJonathan Gray
From Jaehyun Chung cdda25b43e0efb8df20a6f9956ff9091a1355328 in linux 5.7.y/5.7.18 79940e4d10df9c737a394630968471c632246ee0 in mainline linux
2020-08-26drm/amd/display: Fix EDID parsing after resume from suspendJonathan Gray
From Stylon Wang a4615f3893f39560dd3e71865e80bccd20330321 in linux 5.7.y/5.7.18 b24bdc37d03a0478189e20a50286092840f414fa in mainline linux
2020-08-26drm/amdgpu/display: use GFP_ATOMIC in dcn20_validate_bandwidth_internalJonathan Gray
From Daniel Kolesa 9917538295f9319dc7c6cf63d25eef89f302d81e in linux 5.7.y/5.7.18 f41ed88cbd6f025f7a683a11a74f901555fba11c in mainline linux
2020-08-26Declare hw_{prod,serial,uuid,vendor,ver} in <sys/systm.h>.Visa Hankala
OK deraadt@, mpi@
2020-08-25usbd_set_idle() use requires prototype from usbdi_util.hTheo de Raadt
2020-08-25enable more of the syncobj codeJonathan Gray
avoids unimplemented function warnings when running Mesa iris driver
2020-08-24Enable UHS-I support. No SDR104 support though since it doesn't seem to workMark Kettenis
reliably.
2020-08-24Implement UHS-I support in the sdmmc(4) midlayer.Mark Kettenis
ok mglocker@
2020-08-23regenMark Kettenis
2020-08-23Add IBM POWER8 host bridge.Mark Kettenis
2020-08-23fix unused variable warning gcc4 complains aboutJonathan Gray
found the hard way by deraadt@
2020-08-23uhidev(4) does apply the SET_IDLE request to all its child driversMarcus Glocker
today. This doesn't seem to be right, since SET_IDLE limits the reporting frequency for interrupt IN endpoints, normally only required on keyboard and mouse-like input devices. We noticed recently that other device types, like e.g. the Cyrus soundKey uaudio(4), will stall after the SET_IDLE request has been issued. Therefore we move the SET_IDLE request only to the uhidev(4) child drivers which seem to require this request. Those we have identified to be; ukbd(4), ums(4), umstc(4), umt(4), utpms(4), and uwacom(4). Suggested and ok mpi@
2020-08-22Don't complain when child nodes don't have a _CRS method. This happens forMark Kettenis
example for control method batteries that are attached to I2C but use an OperationRegion() to access the I2C device. ok jcs@, gnedzo@
2020-08-22Rework unicast/multicast configuration. Keep note that this only changesPatrick Wildt
the code configuring the parser, we do not yet add the proper multicast filters.
2020-08-22Correct oversize rxq initialization in the classifier.Patrick Wildt
2020-08-22IPv4 protocol parser init fixup and a few whitespace fixes.Patrick Wildt
2020-08-22Consistently use sizeof(pe) or sizeof(*pe) for the parser entry struct.Patrick Wildt
2020-08-22Use sizeof(variable) instead of using a macro for the length parameter.Patrick Wildt
2020-08-22Simplify some code by getting rid of an extra variable.Patrick Wildt
2020-08-22More consistent use of the BIT() macro.Patrick Wildt
2020-08-22Simplify check for return code.Patrick Wildt
2020-08-22drm/amd/display: dchubbub p-state warning during surface planes switchJonathan Gray
From hersen wu adc8db21719668a4bf25ef0bef72c575d0a81cf5 in linux 5.7.y/5.7.17 8b0379a85762b516c7b46aed7dbf2a4947c00564 in mainline linux
2020-08-22drm/amd/display: Fix dmesg warning from setting abm levelJonathan Gray
From Stylon Wang bab191af99bd97db80ba19aafeea8081949bbe53 in linux 5.7.y/5.7.17 c5892a10218214d729699ab61bad6fc109baf0ce in mainline linux
2020-08-22drm/amdgpu: Fix bug where DPM is not enabled after hibernate and resumeJonathan Gray
From Sandeep Raghuraman bac04cf4ea5cd6819828b33567f23431e2468708 in linux 5.7.y/5.7.17 f87812284172a9809820d10143b573d833cd3f75 in mainline linux