freebsd-dev/sys
Andriy Gapon 4c7d1ab06d hdac_intr_handler: keep working until global interrupt status clears
It is plausible that the hardware interrupts a host only when GIS goes
from zero to one.  GIS is formed by OR-ing multiple hardware statuses,
so it's possible that a previously cleared status gets set again while
another status has not been cleared yet.  Thus, there will be no new
interrupt as GIS always stayed set.  If we don't re-examine GIS then we
can leave it set and never get another interrupt again.

Without this change I frequently saw a problem where snd_hda would stop
working.  Setting dev.hdac.1.polling=1 would bring it back to life and
afterwards I could set polling back to zero.  Sometimes the problem
started right after a boot, sometimes it happened after resuming from
S3, frequently it would occur when sound output and input are active
concurrently (such as during conferencing).  I looked at HDAC_INTSTS
while the sound was not working and I saw that both HDAC_INTSTS_GIS and
HDAC_INTSTS_CIS were set, but there were no interrupts.

I have collected some statistics over a period of several days about how
many loops (calls to hdac_one_intr) the new code did for a single
interrupt:
+--------+--------------+
|Loops   |Times Happened|
+--------+--------------+
|0       |301           |
|1       |12857746      |
|2       |280           |
|3       |2             |
|4+      |0             |
+--------+--------------+
I believe that previously the sound would get stuck each time we had to loop
more than once.

The tested hardware is:
hdac1: <AMD (0x15e3) HDA Controller> mem 0xfe680000-0xfe687fff at device 0.6 on pci4
hdacc1: <Realtek ALC269 HDA CODEC> at cad 0 on hdac1

No objections:	mav
MFC after:	5 weeks
Differential Revision: https://reviews.freebsd.org/D25128
2020-06-18 06:12:06 +00:00
..
amd64 Control for Special Register Buffer Data Sampling mitigation. 2020-06-12 22:14:45 +00:00
arm Simplify MACHINE_ARCH to be a single string. 2020-06-15 18:57:43 +00:00
arm64 Support pmap_extract_and_hold on arm64 stage 2 mappings 2020-06-17 19:45:05 +00:00
bsm bsm: add AUE_CLOSERANGE 2020-04-24 01:27:25 +00:00
cam Implement zero-copy iSCSI target transmission/read. 2020-06-08 20:53:57 +00:00
cddl Fix export_args ex_flags field so that is 64bits, the same as mnt_flags. 2020-06-14 00:10:18 +00:00
compat Make Linux uname(2) return x86_64 to 32-bit apps. This helps Steam. 2020-06-15 20:12:10 +00:00
conf Complete the ACPI support for ARM Coresight: 2020-06-17 15:54:51 +00:00
contrib Document upgrade procedure in FREEBSD-upgrade 2020-06-04 20:48:57 +00:00
crypto Fix AES-CCM requests with an AAD size smaller than a single block. 2020-06-12 21:33:02 +00:00
ddb kernel: provide panicky version of __unreachable 2020-05-13 18:07:37 +00:00
dev hdac_intr_handler: keep working until global interrupt status clears 2020-06-18 06:12:06 +00:00
dts Remove licenses 2020-06-04 17:20:58 +00:00
fs Remove vfs_statfs and vnode_mount macros from NFS 2020-06-17 16:20:19 +00:00
gdb Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
geom Add a crypto capability flag for accelerated software drivers. 2020-06-09 22:26:07 +00:00
gnu dts: patch the am33xx dts for upcoming clock support 2020-06-05 20:14:54 +00:00
i386 FPU init: allocate initial state from UMA to ensure alignment 2020-06-12 21:17:56 +00:00
isa sc(4) md bits: stop setting sc->kbd entirely 2019-12-30 02:07:55 +00:00
kern Apply default security flavor in vfs_export 2020-06-16 21:30:30 +00:00
kgssapi Add support for optional separate output buffers to in-kernel crypto. 2020-05-25 22:12:04 +00:00
libkern libkern: Add arc4random_uniform 2020-05-23 17:51:06 +00:00
mips Various fixes to TLS for MIPS. 2020-06-12 21:21:18 +00:00
modules Hard-code the ice_ddp firmware version. 2020-06-11 00:36:35 +00:00
net iflib: netmap: enter/exit netmap mode after device stops 2020-06-14 21:07:12 +00:00
net80211 [net80211] Add missing commit to previous-1 uapsd commit. 2020-06-16 00:28:45 +00:00
netgraph Update event masks constant to Bluetooth core spec V5.2 2020-06-15 14:58:40 +00:00
netinet When converting the static arrays to mallocarray() in r356621 I missed 2020-06-17 21:04:38 +00:00
netinet6 Retire SCTP_SO_LOCK_TESTING. 2020-06-07 14:39:20 +00:00
netipsec Consistently include opt_ipsec.h for consumers of <netipsec/ipsec.h>. 2020-05-29 19:22:40 +00:00
netpfil ipfw: unbreak matching with big table type flow. 2020-06-04 14:15:39 +00:00
netsmb Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
nfs Use epoch(9) for rtentries to simplify control plane operations. 2020-05-23 10:21:02 +00:00
nfsclient
nfsserver
nlm Fix export_args ex_flags field so that is 64bits, the same as mnt_flags. 2020-06-14 00:10:18 +00:00
ofed Convert OFED rtable interactions to the new routing KPI. 2020-04-15 13:06:55 +00:00
opencrypto Various optimizations to software AES-CCM and AES-GCM. 2020-06-12 23:10:30 +00:00
powerpc powerpc/pmap: Fix pte_find_next() iterators for booke64 pmap 2020-06-10 23:03:35 +00:00
riscv riscv: Use SBI shutdown call to implement RB_POWEROFF 2020-06-08 17:57:21 +00:00
rpc Add the .h file that describes the operations for the rpctls_syscall. 2020-05-31 01:12:52 +00:00
security mac_veriexec_fingerprint_check_vnode: v_writecount > 0 means active writers 2020-06-12 21:51:20 +00:00
sys Expose UID_xxx and GID_xxx definitions to userspace. 2020-06-16 02:31:22 +00:00
teken
tests Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
tools vfs: stop null checking routines in vop wrappers 2020-01-26 00:41:38 +00:00
ufs Move all of the functions in ffs_subr.c that are only used by the ufs kernel 2020-06-17 23:39:52 +00:00
vm vm: Drop vm_map_clip_{start,end} macro wrappers 2020-06-16 22:53:56 +00:00
x86 Control for Special Register Buffer Data Sampling mitigation. 2020-06-12 22:14:45 +00:00
xdr Split XDR into separate kernel module. Make krpc depend on xdr. 2020-04-17 06:04:20 +00:00
xen Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (16 of many) 2020-02-25 19:04:39 +00:00
Makefile Remove sparc64 kernel support 2020-02-03 17:35:11 +00:00