Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754622AbbHXUPZ (ORCPT ); Mon, 24 Aug 2015 16:15:25 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:35768 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754564AbbHXUPU (ORCPT ); Mon, 24 Aug 2015 16:15:20 -0400 MIME-Version: 1.0 In-Reply-To: <55DB6BF6.1030206@amd.com> References: <1439459925-2361-1-git-send-email-Suravee.Suthikulpanit@amd.com> <20150814015004.GA26431@google.com> <55DB6BF6.1030206@amd.com> From: Bjorn Helgaas Date: Mon, 24 Aug 2015 13:14:59 -0700 Message-ID: Subject: Re: [PATCH] pci: acpi: Generic function for setting up PCI device DMA coherency To: Suravee Suthikulpanit Cc: Rafael Wysocki , Len Brown , Catalin Marinas , Will Deacon , Hanjun Guo , "linux-acpi@vger.kernel.org" , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , linux-arm , Rob Herring , Murali Karicheri , Jeremy Linton Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1913 Lines: 48 On Mon, Aug 24, 2015 at 12:09 PM, Suravee Suthikulpanit wrote: >>> commit 84cfb2213cd400fef227ec0d7829ec4e12895da9 >>> Author: Bjorn Helgaas >>> 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 > > > 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@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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/