linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: <bhelgaas@google.com>, <lenb@kernel.org>,
	<catalin.marinas@arm.com>, <will.deacon@arm.com>,
	<hanjun.guo@linaro.org>, <linux-acpi@vger.kernel.org>,
	<linux-pci@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	Rob Herring <robh+dt@kernel.org>
Subject: Re: [PATCH V2 2/4] ACPI/scan: Clean up acpi_check_dma
Date: Wed, 26 Aug 2015 09:00:23 +0700	[thread overview]
Message-ID: <55DD1DB7.1020203@amd.com> (raw)
In-Reply-To: <1659571.paO1iYcMuM@vostro.rjw.lan>

Hi Rafael,

On 8/26/15 06:48, Rafael J. Wysocki wrote:

>[...]
> On Wednesday, August 26, 2015 12:33:27 AM Suravee Suthikulpanit wrote:
>> diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
>> index b9657af..55cf916 100644
>> --- a/drivers/acpi/glue.c
>> +++ b/drivers/acpi/glue.c
>> @@ -168,7 +168,7 @@ int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev)
>>   	struct list_head *physnode_list;
>>   	unsigned int node_id;
>>   	int retval = -EINVAL;
>> -	bool coherent;
>> +	int coherent;
>
> enum, anyone?  With clearly defined values?

Originally I had defined

enum acpi_dma_coherency {
	ACPI_DMA_NON_COHERENT,
	ACPI_DMA_COHERENT,
	APCI_DMA_NOT_SUPPORTED = -1,
};

Although, this would need to be defined in the include/linux/acpi.h, and 
will be used also for #ifndef CONFIG_ACPI code to return errors. I was 
not sure if this would be too much. If this is preferred, I'll add this 
back in.

>>
>>   	if (has_acpi_companion(dev)) {
>>   		if (acpi_dev) {
>> @@ -225,7 +225,8 @@ int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev)
>>   	if (!has_acpi_companion(dev))
>>   		ACPI_COMPANION_SET(dev, acpi_dev);
>>
>> -	if (acpi_check_dma(acpi_dev, &coherent))
>> +	coherent = acpi_check_dma_coherency(acpi_dev);
>> +	if (coherent != -1)
>
> Like here I'm not sure why -1 is special?

It's just another value to communicate that DMA is not supported. :)

Thanks,
Suravee
>
>>   		arch_setup_dma_ops(dev, 0, 0, NULL, coherent);
>>
>>   	acpi_physnode_link_name(physical_node_name, node_id);
>
> Thanks,
> Rafael
>

  reply	other threads:[~2015-08-26  2:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-25 17:33 [PATCH V2 0/4] PCI: ACPI: Setting up DMA coherency for PCI device from _CCA attribute Suravee Suthikulpanit
2015-08-25 17:33 ` [PATCH V2 1/4] Honor ACPI _CCA attribute setting Suravee Suthikulpanit
2015-08-25 17:33 ` [PATCH V2 2/4] ACPI/scan: Clean up acpi_check_dma Suravee Suthikulpanit
2015-08-25 23:48   ` Rafael J. Wysocki
2015-08-26  2:00     ` Suravee Suthikulpanit [this message]
2015-08-26  2:44       ` Rafael J. Wysocki
2015-08-25 17:33 ` [PATCH V2 3/4] PCI: OF: Move of_pci_dma_configure() to pci_dma_configure() Suravee Suthikulpanit
2015-08-25 19:27   ` Rob Herring
2015-08-25 17:33 ` [PATCH V2 4/4] PCI: ACPI: Add support for PCI device DMA coherency Suravee Suthikulpanit
2015-08-25 23:48   ` Rafael J. Wysocki
2015-08-26  2:01     ` Suravee Suthikulpanit
2015-08-25 18:48 ` [PATCH V2 0/4] PCI: ACPI: Setting up DMA coherency for PCI device from _CCA attribute Arnd Bergmann
2015-08-26  2:36   ` Suravee Suthikulpanit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55DD1DB7.1020203@amd.com \
    --to=suravee.suthikulpanit@amd.com \
    --cc=bhelgaas@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=hanjun.guo@linaro.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=robh+dt@kernel.org \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).