Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1592034
| From | Jean Delvare <jdelvare@suse.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 2/3] mmc: sdhci-acpi: Check device status before calling fix_up_power() |
| Date | 2017-03-03 16:10 +0100 |
| Message-ID | <tgW4a-2iG-11@gated-at.bofh.it> (permalink) |
| References | <teOkp-2Fm-5@gated-at.bofh.it> <teOkp-2Fm-7@gated-at.bofh.it> |
| Organization | SUSE Linux |
Hi Hans, Adrian,
On Sat, 25 Feb 2017 18:23:56 +0100, Hans de Goede wrote:
> Calling acpi_device_fix_up_power() on a device which is not present
> is not a good idea.
How bad is it?
This was introduced by commit e5bbf30733f9, which was backported to
several stable branches. If it causes real trouble then this fix-up
patch should be annotated with
Fixes: e5bbf30733f9 ("mmc: sdhci-acpi: Ensure connected devices are powered when")
and Cc's to stable@, so it can be propagated to all affected trees.
> While at it also call acpi_bus_get_status() on the children before
> the status check to make sure that child->status contains valid data.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> drivers/mmc/host/sdhci-acpi.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
> index 96465ff..873beae 100644
> --- a/drivers/mmc/host/sdhci-acpi.c
> +++ b/drivers/mmc/host/sdhci-acpi.c
> @@ -394,15 +394,15 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
> if (acpi_bus_get_device(handle, &device))
> return -ENODEV;
>
> + if (acpi_bus_get_status(device) || !device->status.present)
> + return -ENODEV;
> +
> /* Power on the SDHCI controller and its children */
> acpi_device_fix_up_power(device);
> list_for_each_entry(child, &device->children, node)
> if (child->status.present && child->status.enabled)
> acpi_device_fix_up_power(child);
>
> - if (acpi_bus_get_status(device) || !device->status.present)
> - return -ENODEV;
> -
> if (sdhci_acpi_byt_defer(dev))
> return -EPROBE_DEFER;
>
--
Jean Delvare
SUSE L3 Support
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
Re: [PATCH 2/3] mmc: sdhci-acpi: Check device status before calling fix_up_power() Jean Delvare <jdelvare@suse.de> - 2017-03-03 16:10 +0100
csiph-web