public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <jdelvare@suse.de>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Jean Delvare <jdelvare@suse.com>, Takashi Iwai <tiwai@suse.de>,
	russianneuromancer@ya.ru, linux-mmc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] mmc: sdhci-acpi: Check device status before calling fix_up_power()
Date: Fri, 3 Mar 2017 10:09:05 +0100	[thread overview]
Message-ID: <20170303100905.090e0364@endymion> (raw)
In-Reply-To: <20170225172357.26294-3-hdegoede@redhat.com>

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

  parent reply	other threads:[~2017-03-03  9:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-25 17:23 [PATCH 0/3] Allow setting dmi-product-name on the cmdline + dmi sdhci quirk Hans de Goede
2017-02-25 17:23 ` [PATCH 1/3] firmware: dmi_scan: Add dmi_product_name kernel cmdline option Hans de Goede
2017-03-03  9:24   ` Jean Delvare
2017-03-03 14:27     ` Hans de Goede
2017-03-09  9:59       ` Jean Delvare
2017-03-09 10:43         ` Hans de Goede
2017-03-20 17:35           ` Takashi Iwai
2017-04-04 10:21           ` Hans de Goede
2017-02-25 17:23 ` [PATCH 2/3] mmc: sdhci-acpi: Check device status before calling fix_up_power() Hans de Goede
2017-02-25 18:31   ` Hans de Goede
2017-03-02 11:53   ` Adrian Hunter
2017-03-03  9:09   ` Jean Delvare [this message]
2017-03-03 13:59     ` Hans de Goede
2017-02-25 17:23 ` [PATCH 3/3] mmc: sdhci-acpi: Add a quirk to not break wifi on GPD WIN I55 machines Hans de Goede

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=20170303100905.090e0364@endymion \
    --to=jdelvare@suse.de \
    --cc=adrian.hunter@intel.com \
    --cc=hdegoede@redhat.com \
    --cc=jdelvare@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=russianneuromancer@ya.ru \
    --cc=tiwai@suse.de \
    --cc=ulf.hansson@linaro.org \
    /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