Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3632557imu; Mon, 28 Jan 2019 08:09:27 -0800 (PST) X-Google-Smtp-Source: ALg8bN56yMOdKGvJM3+AI7M/24ICbnUq427+6Wk82H+XFjob0mBoVnaFT/BoJDzYnf06wWNqHQ2d X-Received: by 2002:a63:cd4c:: with SMTP id a12mr20695581pgj.252.1548691767339; Mon, 28 Jan 2019 08:09:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548691767; cv=none; d=google.com; s=arc-20160816; b=kQEZHJAe7evtgp+fVL72rrHcBDXJsNsgmNP2iYZBXH2ap0oq08D3rHjkpOPM5chc+M PDp939LiVGRiB05z+qVQyQ7gbXoa5PojGbvd1v2vLDD5BcuwEiJKu/4264As2stkcUt1 InJ9f0sKR/X60GFwYCUeF2TagIjIGql+wM2VZ8LwR6UhdirKREdPbYwCHdcKHv6B7AX8 v/9Gdl8nOg04Q5LQoByfnzn1m01+IP/BuYtDFngm2Z+toCL0xTOTUVEyNBqZmsOa5+Yt ZmlISgBlyIuoJRIFRueO6mG3r3SJpgCP9rclOf4lr4dyTBJL8cgF6b2DSYMgVneCTVjk QmQg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LqE5tDjdBl6JN9vJZgeXb1GaLDNvfagyvNxO9tPcCwY=; b=WHRDVG87PEGqzYrYcsRd0XEMtv1fIURR0LSP/Uf5i3LLqV57EDcjomxGoGSQlYb7q1 lq1lt9BY1TbT4pJz14Ev70F02BdFHTHjyxgye+co8JLu6aKknU83eW2RY1O4BftNdCau gR88oRDQlJPWgU+Ek+DfjoytaJmh/0cZePrAocAKPJEGmAblVps8VGFiW//P4AvzlArN 2zex5K8c3tzR6xBC+DB8yN1y8hWHQcL9vfJgW0dfd7IvZo8qwgWdBFuwb9xIQfKhtv4W ntGnutE69v5liaYYH7rWwX/8ftks5b+pP/X85tn819Lg6NfT9WaLKEvyxi1d5tKdUSa2 bXXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=u+mBuCvR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f124si8832102pfa.1.2019.01.28.08.09.11; Mon, 28 Jan 2019 08:09:27 -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=u+mBuCvR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731616AbfA1QIH (ORCPT + 99 others); Mon, 28 Jan 2019 11:08:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:59412 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732316AbfA1QID (ORCPT ); Mon, 28 Jan 2019 11:08:03 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3959B2171F; Mon, 28 Jan 2019 16:08:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691682; bh=M/L/KkkVWTaMFTlnaCMwvmp7gOGTNLIncZpVATojgJc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u+mBuCvRUlbKbW8Qb5mtK8wMuQCeCN3PSG5esRkhY44tdPeMs1MZjQCQiFRfNGrca azNJ0RpcXUPruPnnJEUjvfwDZNLDIM2zAKW1TdcoRAGTKvD00zZ8Zk1yaacSLHfjId sj55QytWkaTIszQSEMtK8LcbKM8cevEXOfZhKV9A= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Chen-Yu Tsai , Marcel Holtmann , Sasha Levin , linux-bluetooth@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 184/258] Bluetooth: hci_bcm: Handle deferred probing for the clock supply Date: Mon, 28 Jan 2019 10:58:10 -0500 Message-Id: <20190128155924.51521-184-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chen-Yu Tsai [ 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