From: Hanjun Guo <guohanjun@huawei.com>
To: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
linux-acpi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Hanjun Guo <hanjun.guo@linaro.org>,
Sudeep Holla <sudeep.holla@arm.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>
Subject: Re: [PATCH] ACPI: Remove misplaced acpi_dma_deconfigure() call in acpi_bind_one()
Date: Sat, 24 Dec 2016 15:46:56 +0800 [thread overview]
Message-ID: <585E27F0.6070703@huawei.com> (raw)
In-Reply-To: <20161216144356.24628-1-lorenzo.pieralisi@arm.com>
On 2016/12/16 22:43, Lorenzo Pieralisi wrote:
> The acpi_bind_one() error return path can be hit either on physical node
> allocation failure or if the device being configured is already
> associated with an ACPI node and its ACPI companion does not match the
> one acpi_bind_one() is setting it up with. In both cases the error
> return path is executed before DMA is configured for a device therefore
> there is no need to call acpi_dma_deconfigure() on the function error
> return path.
>
> Furthermore, if acpi_bind_one() does configure DMA for a device (ie it
> successfully executes acpi_dma_configure()) acpi_bind_one() always
> completes execution successfully hence there is no need to add an exit
> path to deconfigure the DMA set-up (ie by calling acpi_dma_deconfigure()).
>
> Remove the misplaced acpi_dma_deconfigure() in acpi_bind_one() to
> reinstate its correct error return path behaviour.
>
> Fixes: d760a1baf20e ("ACPI: Implement acpi_dma_configure")
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Hanjun Guo <hanjun.guo@linaro.org>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> ---
> drivers/acpi/glue.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
> index f8d6564..eb709e7 100644
> --- a/drivers/acpi/glue.c
> +++ b/drivers/acpi/glue.c
> @@ -250,7 +250,6 @@ int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev)
> return 0;
>
> err:
> - acpi_dma_deconfigure(dev);
> ACPI_COMPANION_SET(dev, NULL);
> put_device(dev);
> put_device(&acpi_dev->dev);
Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
Thanks
Hanjun
WARNING: multiple messages have this Message-ID (diff)
From: Hanjun Guo <guohanjun@huawei.com>
To: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
<linux-acpi@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>,
Hanjun Guo <hanjun.guo@linaro.org>,
"Sudeep Holla" <sudeep.holla@arm.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>
Subject: Re: [PATCH] ACPI: Remove misplaced acpi_dma_deconfigure() call in acpi_bind_one()
Date: Sat, 24 Dec 2016 15:46:56 +0800 [thread overview]
Message-ID: <585E27F0.6070703@huawei.com> (raw)
In-Reply-To: <20161216144356.24628-1-lorenzo.pieralisi@arm.com>
On 2016/12/16 22:43, Lorenzo Pieralisi wrote:
> The acpi_bind_one() error return path can be hit either on physical node
> allocation failure or if the device being configured is already
> associated with an ACPI node and its ACPI companion does not match the
> one acpi_bind_one() is setting it up with. In both cases the error
> return path is executed before DMA is configured for a device therefore
> there is no need to call acpi_dma_deconfigure() on the function error
> return path.
>
> Furthermore, if acpi_bind_one() does configure DMA for a device (ie it
> successfully executes acpi_dma_configure()) acpi_bind_one() always
> completes execution successfully hence there is no need to add an exit
> path to deconfigure the DMA set-up (ie by calling acpi_dma_deconfigure()).
>
> Remove the misplaced acpi_dma_deconfigure() in acpi_bind_one() to
> reinstate its correct error return path behaviour.
>
> Fixes: d760a1baf20e ("ACPI: Implement acpi_dma_configure")
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Hanjun Guo <hanjun.guo@linaro.org>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> ---
> drivers/acpi/glue.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
> index f8d6564..eb709e7 100644
> --- a/drivers/acpi/glue.c
> +++ b/drivers/acpi/glue.c
> @@ -250,7 +250,6 @@ int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev)
> return 0;
>
> err:
> - acpi_dma_deconfigure(dev);
> ACPI_COMPANION_SET(dev, NULL);
> put_device(dev);
> put_device(&acpi_dev->dev);
Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
Thanks
Hanjun
next prev parent reply other threads:[~2016-12-24 7:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-16 14:43 [PATCH] ACPI: Remove misplaced acpi_dma_deconfigure() call in acpi_bind_one() Lorenzo Pieralisi
2016-12-24 7:46 ` Hanjun Guo [this message]
2016-12-24 7:46 ` Hanjun Guo
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=585E27F0.6070703@huawei.com \
--to=guohanjun@huawei.com \
--cc=hanjun.guo@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=rjw@rjwysocki.net \
--cc=sudeep.holla@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.