[haiku-commits] AW: haiku: hrev47800 - src/add-ons/kernel/drivers/audio/hda

  • From: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
  • To: <haiku-commits@xxxxxxxxxxxxx>
  • Date: Wed, 3 Sep 2014 09:08:29 +0200

Julian wrote:
> 84dfba2: Preserve reserved bits in registers

Is that actually necessary? Usually you are allowed to keep these to zero, or 
even should set them to zero (I haven't looked at the specs, though, lazy me).

>     After setting up the buffer descriptor list for a stream, it was a
>     gamble whether these writes would be visible to the HDA controller
>     when subsequently enabling the stream. On some boots it was unlucky
>     and then the HDA controller's DMA engine would go haywire and start
>     overwriting random kernel memory with audio input data. The
>     scheduler was usually the first victim and caused page fault KDLs
>     due to corrupted data structures.

Very nice catch!

>       (gPci->write_pci_config)(controller->pci_info.bus,
>               controller->pci_info.device, controller->pci_info.function,
>               reg, size, (originalValue & mask) | value);
> +
> +     if (!check)
> +             return true;
> +
> +     uint32 newValue = (gPci->read_pci_config)(controller->pci_info.bus,
> +             controller->pci_info.device, controller->pci_info.function,

You obviously just copied that issue, but the parenthesis around 
gPci->read_pci_config are superfluous.

> +     dprintf("hda: DMA snooping: %s\n", controller->dma_snooping ?
> "yes" :
> +"no");

Something happened here to the formatting.

Bye,
   Axel.



Other related posts: