Thread (9 messages) 9 messages, 2 authors, 2015-08-25

[PATCH] pci: acpi: Generic function for setting up PCI device DMA coherency

From: suravee.suthikulpanit@amd.com (Suthikulpanit, Suravee)
Date: 2015-08-25 11:26:23
Also in: linux-acpi, linux-pci, lkml

Hi Bjorn,

On 8/25/2015 3:14 AM, Bjorn Helgaas wrote:
On Mon, Aug 24, 2015 at 12:09 PM, Suravee Suthikulpanit
[off-list ref] wrote:
quoted
quoted
quoted
commit 84cfb2213cd400fef227ec0d7829ec4e12895da9
Author: Bjorn Helgaas [off-list ref]
Date:   Thu Aug 13 19:49:52 2015 -0500

      ACPI / scan: Rename acpi_check_dma() to acpi_dma_is_coherent()

      The name "acpi_check_dma()" doesn't give any much indication about
what
      exactly it checks.  The function also returns information both as a
normal
      return value and as the "bool *coherent" return parameter.  But
"*coherent"
      doesn't actually give any extra information: it is unchanged when
returning
      false and set to true when returning true.

      Rename acpi_check_dma() to acpi_dma_is_coherent() so the callers
read more
      naturally.  Drop the return parameter and just use the function
return
      value.

      Signed-off-by: Bjorn Helgaas [off-list ref]

This was because, at one point, we wanted to be able to differentiate
between the case _CCA=0 and missing _CCA in ARM64, where we would support
DMA (using arch-specific cache maintenance) if _CCA=0, and disable DMA when
missing _CCA on ARM64.

It seems like the logic is now required (please see
https://www.mail-archive.com/linux-usb at vger.kernel.org/msg62735.html). So,
we would need the true/false return, and the coherent variable to be able to
differentiate between the two cases.

Please let me know what you think.
It's hard for me to comment without seeing the actual patches.  I
think returning two values (_CCA-seen and coherent) is a confusing
interface.
Ok. Let me simplify this and send out V2.

Thanks,
Suravee
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help