linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthias Kaehlcke <mka@chromium.org>
To: Brian Norris <briannorris@chromium.org>
Cc: Marcel Holtmann <marcel@holtmann.org>,
	Johan Hedberg <johan.hedberg@gmail.com>,
	linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org,
	Rajat Jain <rajatja@google.com>, Heiko Stuebner <heiko@sntech.de>
Subject: Re: [PATCH] Bluetooth: btusb: request wake pin with NOAUTOEN
Date: Fri, 22 Feb 2019 10:35:22 -0800	[thread overview]
Message-ID: <20190222183522.GD223791@google.com> (raw)
In-Reply-To: <20190222003051.127006-1-briannorris@chromium.org>

On Thu, Feb 21, 2019 at 04:30:51PM -0800, Brian Norris wrote:
> Badly-designed systems might have (for example) active-high wake pins
> that default to high (e.g., because of external pull ups) until they
> have an active firmware which starts driving it low. This can cause an
> interrupt storm in the time between request_irq() and disable_irq().
> 
> We don't support shared interrupts here, so let's just pre-configure the
> interrupt to avoid auto-enabling it.
> 
> Fixes: fd913ef7ce61 ("Bluetooth: btusb: Add out-of-band wakeup support")
> Signed-off-by: Brian Norris <briannorris@chromium.org>
> ---
>  drivers/bluetooth/btusb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index 4761499db9ee..470ee68555d9 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -2885,6 +2885,7 @@ static int btusb_config_oob_wake(struct hci_dev *hdev)
>  		return 0;
>  	}
>  
> +	irq_set_status_flags(irq, IRQ_NOAUTOEN);
>  	ret = devm_request_irq(&hdev->dev, irq, btusb_oob_wake_handler,
>  			       0, "OOB Wake-on-BT", data);
>  	if (ret) {
> @@ -2899,7 +2900,6 @@ static int btusb_config_oob_wake(struct hci_dev *hdev)
>  	}
>  
>  	data->oob_wake_irq = irq;
> -	disable_irq(irq);
>  	bt_dev_info(hdev, "OOB Wake-on-BT configured at IRQ %u", irq);
>  	return 0;
>  }

Reviewed-by: Matthias Kaehlcke <mka@chromium.org>

  reply	other threads:[~2019-02-22 18:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-22  0:30 Brian Norris
2019-02-22 18:35 ` Matthias Kaehlcke [this message]
2019-03-26 18:48 ` Brian Norris
2019-04-01 18:07   ` Brian Norris

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=20190222183522.GD223791@google.com \
    --to=mka@chromium.org \
    --cc=briannorris@chromium.org \
    --cc=heiko@sntech.de \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=rajatja@google.com \
    --subject='Re: [PATCH] Bluetooth: btusb: request wake pin with NOAUTOEN' \
    /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

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).