Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2653735imj; Mon, 11 Feb 2019 06:31:33 -0800 (PST) X-Google-Smtp-Source: AHgI3IYWO/aHvoKSUxNQLmnayQr19TYfrGZd3rO8ogYyzTPAV4nsi28e6Atefg6nIqe+7kZzIW6o X-Received: by 2002:a62:2c4d:: with SMTP id s74mr36653237pfs.6.1549895493062; Mon, 11 Feb 2019 06:31:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549895493; cv=none; d=google.com; s=arc-20160816; b=HJ+BZMECQ58FQFN+rb2NfyULqXEPXgbNz7Lc3a+5hnW1O5nAE+OZsUKDMMFfhmU7ko i+HV50CSMldR53+TTZHIvWcMLLpGvbpXAPAvjMrhYGcSyafgnsYkwIevYi/QbxtitrUO w0pIAHUStemXpdTOvqAq6ND9niQ23YBUfAalz/meJjISv69L+RIge7b80f2pgD193h/V k7I0mbGhbPmkvYpAXuCpnTxg2PsFrXZHWrWE7dtXzPJnNRqoinJugxiF5oog49bZWjzx dZkDFsuXoQd0JFLBsSJ77fo+Do9lrT3O535xy2AkGmE/ZPzlmjrV/p461kXa5YmXn4ep mLhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=s+1QIOnMC0J46auR62MtrsfRj35A+yv/1awONb/k5Ow=; b=Cy/fakwx05SNyQiNhfnCuA+sDZWF5bjf7lcmj3pmy7W4Yo5adnpw6xoUkkDcd4axwH 7cE2ZiKr0L3p+hCFJHZu+efgOcd9LHn3I4koYue2PZUFkyUXIhG52xd1DQYyNxxP+eYN JQACaC3/IADkQ0rOhg/7lPk2jNvcpd9izXlrmNuYIZo/c1jCSFZl0T7/m5fZypg+/D+y aLpcK6P+xrT4fAxX2iLbEHd+m/5mrRWUiEUxZiquK7/U+OnbSsW7ohp48QnI7alpExgD 5CU9Eo0FYEiAng03ZpcpWCEMUst8I68MCaRhDd36IQSreBlczRFRSEfZb6pdySdcJnh/ 31tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oQfZ4Ma7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a6si1225622pff.199.2019.02.11.06.31.16; Mon, 11 Feb 2019 06:31:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oQfZ4Ma7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730196AbfBKOax (ORCPT + 99 others); Mon, 11 Feb 2019 09:30:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:37386 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730187AbfBKOaw (ORCPT ); Mon, 11 Feb 2019 09:30:52 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 27E6120844; Mon, 11 Feb 2019 14:30:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895451; bh=GAQHXKYCus6kzfE8npf8N/mWqU7J1VcDwLbyFb9HHX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oQfZ4Ma7dcsZWu+SlO+1dZ8uriaT8NHGLrtmpWgKWcDKv6//D57l+NZbcy/aYzAgi mSxWej75F7v/cc8x9hHwTIHBoF1ss9q+dBiji9rHmhtxK3GLH5/XMWIa+zofUamiSC wcCNxUqq9QaQ8mYnJVQsz3VvMv3ZLuNhFRtmQw8U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ondrej Jirman , Chen-Yu Tsai , Marcel Holtmann , Sasha Levin Subject: [PATCH 4.20 208/352] Bluetooth: hci_bcm: Handle deferred probing for the clock supply Date: Mon, 11 Feb 2019 15:17:15 +0100 Message-Id: <20190211141900.404024176@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 28ac03b9ac3f784c2f048a910c8d0a7a87483b66 ] On some systems that actually have the bluetooth controller wired up with an extra clock signal, it's possible the bluetooth controller probes before the clock provider. clk_get would return a defer probe error, which was not handled by this driver. Handle this properly, so that these systems can work reliably. Tested-by: Ondrej Jirman Signed-off-by: Chen-Yu Tsai Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- drivers/bluetooth/hci_bcm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c index ddbd8c6a0ceb..800132369134 100644 --- a/drivers/bluetooth/hci_bcm.c +++ b/drivers/bluetooth/hci_bcm.c @@ -907,6 +907,10 @@ static int bcm_get_resources(struct bcm_device *dev) dev->clk = devm_clk_get(dev->dev, NULL); + /* Handle deferred probing */ + if (dev->clk == ERR_PTR(-EPROBE_DEFER)) + return PTR_ERR(dev->clk); + dev->device_wakeup = devm_gpiod_get_optional(dev->dev, "device-wakeup", GPIOD_OUT_LOW); if (IS_ERR(dev->device_wakeup)) -- 2.19.1