From patchwork Wed Jul 24 19:20:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 169637 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp10654679ilk; Wed, 24 Jul 2019 12:37:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqx01laofBeTo3u4fHeacH8wrYh0BylNRjZx93qmptVdjwr8EFUgxpEtCpMwfwcdZu0nOr8x X-Received: by 2002:a62:b411:: with SMTP id h17mr12327222pfn.99.1563997069782; Wed, 24 Jul 2019 12:37:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563997069; cv=none; d=google.com; s=arc-20160816; b=qR3Mz3ACLeZjiZmysIh+2KP1MO5duln22fK2c0Gk5/ol484idLBPwzqdGH4P4bkph8 Y2wcBNGI59rW8i1zobG7Jr/4R60oAGLZsp4tsH0Nv9FyyjQqqmSa3e6xLaUgPpQFGZl3 gGPQo+xfKsSxS1DeJ9/vhMBMysjhFNM0NGt7vUrtv/oPb/ZdCMIQ0K12rLnXsbj/E/8p djUwcPI09oottMUChGF7fAkHoLtzXHAy8RfvZA40/17o1hBfphw7SNyGR+J6wXBoqBTL K6AdHYtwsT6oT0gREFetWzaaOwOKPc9Ka5FMFXMjx7wdLZM5A3HzxwBn0vgGbJDOo55q K1JQ== 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=EABL7CmIo691Dfo8+XtO0ZyCRY2ddydBJIiMtCnPnqY=; b=i2+/CDjCq8DdNWaTet7cWre1KzMfV0Uspj3iBVS9u4DdJhJMPozfPTBF9wsd4wP/gM Mg7e0BOrDOEcdfgJPSS05xfUe7EYHsJovLRvCWtjJoN8xeEnwotTsZbWFr0WnAJu6k79 3P31dbf41Ahj5GLkbws1xU88TDFc5Vm5efvmMzTOEdvjuc/JMdVGEfdRrFyAVY3hvHst yXKx1+AKStnzwGXtvN9lVRqD/koBfPbJKiyXJJDS91pUqv4X/MAqxQdDd0a8li8Zvyxg 3cf34m1Ub95P64ohoaRC/w6ukY3qv6MQ7QjHVDWTIRx9j/KLs/PNOqsdrJYdadh9miPg NGDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ytGCzFmO; 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 x131si17860759pfd.116.2019.07.24.12.37.49; Wed, 24 Jul 2019 12:37:49 -0700 (PDT) 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=ytGCzFmO; 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 S2389521AbfGXThs (ORCPT + 29 others); Wed, 24 Jul 2019 15:37:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:38068 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389512AbfGXThp (ORCPT ); Wed, 24 Jul 2019 15:37:45 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 A260F20665; Wed, 24 Jul 2019 19:37:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563997065; bh=/K8p8bk94uWfx74QDvrAiJkViwJ0FKebaIXNiDp2qYU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ytGCzFmOzk1dIMLbDCKgKPY7BuGH2/3eQqNDFhNpmQE7m+8hHdm2zDo48jVn6GLaP 5fz7DANSiS2NTuolOd7SUDPGlMBPK0WYuUxK62NwF+St/Y5arth2CKHJNQ3eEKdvf5 sdrnZ4sOca0y0qUd67m36ZWSGIeNJJxOJ3YHDei0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Brown Subject: [PATCH 5.2 310/413] ASoC: dapm: Adapt for debugfs API change Date: Wed, 24 Jul 2019 21:20:01 +0200 Message-Id: <20190724191757.934708464@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mark Brown commit ceaea851b9ea75f9ea2bbefb53ff0d4b27cd5a6e upstream. Back in ff9fb72bc07705c (debugfs: return error values, not NULL) the debugfs APIs were changed to return error pointers rather than NULL pointers on error, breaking the error checking in ASoC. Update the code to use IS_ERR() and log the codes that are returned as part of the error messages. Fixes: ff9fb72bc07705c (debugfs: return error values, not NULL) Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/soc-dapm.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -2155,23 +2155,25 @@ void snd_soc_dapm_debugfs_init(struct sn { struct dentry *d; - if (!parent) + if (!parent || IS_ERR(parent)) return; dapm->debugfs_dapm = debugfs_create_dir("dapm", parent); - if (!dapm->debugfs_dapm) { + if (IS_ERR(dapm->debugfs_dapm)) { dev_warn(dapm->dev, - "ASoC: Failed to create DAPM debugfs directory\n"); + "ASoC: Failed to create DAPM debugfs directory %ld\n", + PTR_ERR(dapm->debugfs_dapm)); return; } d = debugfs_create_file("bias_level", 0444, dapm->debugfs_dapm, dapm, &dapm_bias_fops); - if (!d) + if (IS_ERR(d)) dev_warn(dapm->dev, - "ASoC: Failed to create bias level debugfs file\n"); + "ASoC: Failed to create bias level debugfs file: %ld\n", + PTR_ERR(d)); } static void dapm_debugfs_add_widget(struct snd_soc_dapm_widget *w) @@ -2185,10 +2187,10 @@ static void dapm_debugfs_add_widget(stru d = debugfs_create_file(w->name, 0444, dapm->debugfs_dapm, w, &dapm_widget_power_fops); - if (!d) + if (IS_ERR(d)) dev_warn(w->dapm->dev, - "ASoC: Failed to create %s debugfs file\n", - w->name); + "ASoC: Failed to create %s debugfs file: %ld\n", + w->name, PTR_ERR(d)); } static void dapm_debugfs_cleanup(struct snd_soc_dapm_context *dapm) From patchwork Wed Jul 24 19:20:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 169638 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp10654726ilk; Wed, 24 Jul 2019 12:37:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwEr1E79QoxbhOnSlwB9RiBfnj1QcYDR6VaI074L30GZJ0IrXcXKtM6ydsiN00j/k5rAInb X-Received: by 2002:a17:902:7087:: with SMTP id z7mr36126480plk.184.1563997074144; Wed, 24 Jul 2019 12:37:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563997074; cv=none; d=google.com; s=arc-20160816; b=UZ6rfcogb+VBhSCGk/V61+CT2zGnseyG0vCOtIarXOog4dJtSuma1DVJkhjJ30faX8 uOdntHlv3rpFPY0LU9DwFKnundQAOk4edAB7FdNaWyIDpdANCVvHk3GNgjB0Z8zAH7vJ 1ZpdNgtlzWl/QR2Adwhlwi6sQzY+qT8LJ8IgjyJRmCBlruzE1RqTCGLHhXzs3JTM6IFN mUYQwI5Xy0L5zc8iUkCBwsgkg/tWZN1Ak8h+FPz7AlH1l9bo6qckckGJWo/RaD8UmCa6 mXmuj4AdotfgUhYqfwofDbDr3tPqjV3Fiq2YfURTQ8GaEnh4MUFQxHC/90RzakFiBPeO 3EdQ== 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=fe+p10YfnyqcFUyaZQKDg/pc4hRRGQ7ZskTdE32j60w=; b=SRaj1/g3RocZTJXm7iHuqWMRNJc4pLVs1pm345mHceeflx00g7hGBq6ZOcKC74haBc TGfoIow7fpcsLyUkoIZQ0AHu6lmfRSfMNZByOQGxCf7mXFi0zjY11LiyzQSXdNU19k6t ezhPFbo5sTyBx8srVp0sygulmkUu06v3uFJUZMxYiEucFSfRVI+o4oxbgrOEGGqJewsK hlO3ykBFi24IfHuojbUk75sRbCiHnGavXWc5WU1jS7vXX/wLyetlicL/z2elNTqsHa7E vko9rUvFj5GhAeX5td5qyYagtOSuqj5hzBJeiKpSLotztI4jDaGNAM2eGa3m443Pggrd 595w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UY3rwoUL; 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 x131si17860759pfd.116.2019.07.24.12.37.53; Wed, 24 Jul 2019 12:37:54 -0700 (PDT) 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=UY3rwoUL; 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 S2389536AbfGXThw (ORCPT + 29 others); Wed, 24 Jul 2019 15:37:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:38166 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388939AbfGXTht (ORCPT ); Wed, 24 Jul 2019 15:37:49 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 31D5020665; Wed, 24 Jul 2019 19:37:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563997068; bh=2HnvleEuQXWEcpKX9BILP/+xkRxnVYQLF0R4G6X7+yo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UY3rwoULXTC0+s2kh/1yFUHtwPxpqZVG5FGG5kcKvbdSGVBc0urZuG+UhygTfdn7c n7MtjV3Mi5cx75w/Dip6IemMS/CTHHfZ3YDcwyKjrkIsi/gRlTJQa6yu/H0g3XhS+t /FWdaw1Fkf8O3ZicnwAemLh4CpgD/mSRLUwWQnNY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Brown Subject: [PATCH 5.2 311/413] ASoC: core: Adapt for debugfs API change Date: Wed, 24 Jul 2019 21:20:02 +0200 Message-Id: <20190724191758.010507754@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mark Brown commit c2c928c93173f220955030e8440517b87ec7df92 upstream. Back in ff9fb72bc07705c (debugfs: return error values, not NULL) the debugfs APIs were changed to return error pointers rather than NULL pointers on error, breaking the error checking in ASoC. Update the code to use IS_ERR() and log the codes that are returned as part of the error messages. Fixes: ff9fb72bc07705c (debugfs: return error values, not NULL) Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/soc-core.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -158,9 +158,10 @@ static void soc_init_component_debugfs(s component->card->debugfs_card_root); } - if (!component->debugfs_root) { + if (IS_ERR(component->debugfs_root)) { dev_warn(component->dev, - "ASoC: Failed to create component debugfs directory\n"); + "ASoC: Failed to create component debugfs directory: %ld\n", + PTR_ERR(component->debugfs_root)); return; } @@ -212,18 +213,21 @@ static void soc_init_card_debugfs(struct card->debugfs_card_root = debugfs_create_dir(card->name, snd_soc_debugfs_root); - if (!card->debugfs_card_root) { + if (IS_ERR(card->debugfs_card_root)) { dev_warn(card->dev, - "ASoC: Failed to create card debugfs directory\n"); + "ASoC: Failed to create card debugfs directory: %ld\n", + PTR_ERR(card->debugfs_card_root)); + card->debugfs_card_root = NULL; return; } card->debugfs_pop_time = debugfs_create_u32("dapm_pop_time", 0644, card->debugfs_card_root, &card->pop_time); - if (!card->debugfs_pop_time) + if (IS_ERR(card->debugfs_pop_time)) dev_warn(card->dev, - "ASoC: Failed to create pop time debugfs file\n"); + "ASoC: Failed to create pop time debugfs file: %ld\n", + PTR_ERR(card->debugfs_pop_time)); } static void soc_cleanup_card_debugfs(struct snd_soc_card *card) From patchwork Wed Jul 24 19:21:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 169641 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp10658172ilk; Wed, 24 Jul 2019 12:42:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhgMFA1RkJzZwUIWSjR8NXbrriOpA5xJWbavuICzXne6ZCUaQ8emRugzo70sPefZxGglCC X-Received: by 2002:a17:902:8d97:: with SMTP id v23mr85080980plo.157.1563997322001; Wed, 24 Jul 2019 12:42:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563997321; cv=none; d=google.com; s=arc-20160816; b=Cz+BCWY6duXLvj8zM0xIVJ9MRepZejQEilKiVFQ70+6tey4zYT4nGtzbnWhfb5jTWZ vN/1Lq0U3Fkl5CXK0jRaVskfJ9FQwej8FUmZonJzdGHNZv7lqH7ya5Gi5n+RhijU9+37 tePgBJeS0XYN9jjUWudEjcf3OEFXDyswfNFdJsz0B3MShG0ym8MAEdY5MqpMUSuRpw9/ tN2IqTrqCkRE/Hns1vAdjVCZCx/kcgWW4FUeoVCSj/lqysVgr34bhPJXUVERP0Et12Zm AlPSoFGa3mKyyuSb0bYcDlUCoGjLxtPERHGK3vxg9QVYceQaKX1YMAOjEguNKGGNjBNH Gorg== 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=ppXW+Co0Fqx1dG/WgNZVPsQg9c3jCdGNpd/K0tcohcc=; b=p1XVjjGo+LWAAHEA0/SZkzIHX9r/yBtSiSDrNWSB0xqp8U9gbgfqwnIoECE7yq6gsf w09QQlZG9FjCwBFBKm092H2qYN42EOuuf94p34+lSViCYpj95u10mJBUp7wvpZTOc60o UNdBrdhdqgPOpzjJkjONmh+swPnEuzpEb/Mbzb55G5qAOClRMfiMaIBQ5K5rdQ3GPNIn 4YLnsG2Fv0kKASDbYnyMbkiQK/v//RJNwrokySm458WyF6ETETC74t8K8S5b0//ikTdr V4/LWCdw0RwKew7Gh9wBGhoqjYkgJmyZkn5y6GkDRWxtlh9HxnKQjQZe536EK6tnKd6w m+9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FQZNcEuY; 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 s29si15927656pfd.147.2019.07.24.12.42.01; Wed, 24 Jul 2019 12:42:01 -0700 (PDT) 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=FQZNcEuY; 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 S2390306AbfGXTmA (ORCPT + 29 others); Wed, 24 Jul 2019 15:42:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:43476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390281AbfGXTl5 (ORCPT ); Wed, 24 Jul 2019 15:41:57 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 2BF5121873; Wed, 24 Jul 2019 19:41:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563997316; bh=J9HdMSmkiQUZ4Qu2ZXSJWgTueX7RlrcvLmJnS4/xEEc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FQZNcEuYRXWryVVMJFHB5kF7H7DOalrlIYH4d5GYPynxF1VcCWeqhH8ZRJn1mpjDK gRMVfrLzM0hx+2ODe2IAdSR4SsTb0cEawxYtaEcjvOKL1rtkSC3qN4K31uvmzSDNWo KjxzQOlQjoknijkqtvtzfUFZCsruetrCwZVcP7VQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jorge Ramirez-Ortiz , Bjorn Andersson , Vinod Koul , Adrian Hunter , Ulf Hansson Subject: [PATCH 5.2 395/413] mmc: sdhci-msm: fix mutex while in spinlock Date: Wed, 24 Jul 2019 21:21:26 +0200 Message-Id: <20190724191803.257024943@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jorge Ramirez-Ortiz commit 5e6b6651d22de109ebf48ca00d0373bc2c0cc080 upstream. mutexes can sleep and therefore should not be taken while holding a spinlock. move clk_get_rate (can sleep) outside the spinlock protected region. Fixes: 83736352e0ca ("mmc: sdhci-msm: Update DLL reset sequence") Cc: stable@vger.kernel.org Signed-off-by: Jorge Ramirez-Ortiz Reviewed-by: Bjorn Andersson Reviewed-by: Vinod Koul Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/sdhci-msm.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- a/drivers/mmc/host/sdhci-msm.c +++ b/drivers/mmc/host/sdhci-msm.c @@ -575,11 +575,14 @@ static int msm_init_cm_dll(struct sdhci_ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); struct sdhci_msm_host *msm_host = sdhci_pltfm_priv(pltfm_host); int wait_cnt = 50; - unsigned long flags; + unsigned long flags, xo_clk = 0; u32 config; const struct sdhci_msm_offset *msm_offset = msm_host->offset; + if (msm_host->use_14lpp_dll_reset && !IS_ERR_OR_NULL(msm_host->xo_clk)) + xo_clk = clk_get_rate(msm_host->xo_clk); + spin_lock_irqsave(&host->lock, flags); /* @@ -627,10 +630,10 @@ static int msm_init_cm_dll(struct sdhci_ config &= CORE_FLL_CYCLE_CNT; if (config) mclk_freq = DIV_ROUND_CLOSEST_ULL((host->clock * 8), - clk_get_rate(msm_host->xo_clk)); + xo_clk); else mclk_freq = DIV_ROUND_CLOSEST_ULL((host->clock * 4), - clk_get_rate(msm_host->xo_clk)); + xo_clk); config = readl_relaxed(host->ioaddr + msm_offset->core_dll_config_2); From patchwork Wed Jul 24 19:21:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 169650 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp10698083ilk; Wed, 24 Jul 2019 13:23:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqw3lisiETRqhWKTHqFcsNszVQYK4vN3w3q36QxvX1OaD20JhNDOTK2zaG2Aj+a4af8PLDsI X-Received: by 2002:a17:90a:4806:: with SMTP id a6mr89723401pjh.38.1563999814059; Wed, 24 Jul 2019 13:23:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563999814; cv=none; d=google.com; s=arc-20160816; b=d4+W/OGXWTTIOgGuA4/a4T2ug6SrCgz/gaCZlhPul2f0RFxhkT+Yc4UUJEaLbFBz+1 ycFQMIfnMLjRA7ARmYxkJ47eByzCyj0mbvzOgJPzZKGHGjlW1iLLkDLYe7CYOwoPvlml 03jmLYdsYEikHMUrG9l0PglT44U1O2z/Y4FgkwK0QvmsVrdk73fJKO/1bRounw5JC6Se 88ci6ZyKso1JD3LCtNyJv/50tUH4dlidDeE/RwldsZHmglHB853l+AeKGvR4/+b+I9d7 AkYuRXk/SG+Gwv8m3RoPEo5S69VR2bVbTRJjnbaPsDIRWwxK4ml920pcT3HtWUEYxfmY 2Txg== 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=SiN8sQ1sUXU64rpN5cED0idk/ZYYhiwAWj7CYskw9Eo=; b=U+DqsnUaY9yHIwC6NM4X3H9evv5b2fDMHh6DqCol41eYbYDCvSuoCcLrdDTqYDakRw EdUyXDzOQCNPwdoaKMr2KtVfGQjgjkXuB0D6GD1Fv7a48Efk9S7D4uIkK3kWM/z4pBtN 8VuL1vjsm6dLGeT1Ob+NvitJFwiUbEYvWmg+/PZlY9mIeY1ZR0qtNXCgQ2tLxL7t8RFB J6LeYxRoxWx7XtyQKwcbb+1E7es948NxDs56JZT26lrd2b6ObLON3dJLxJxKNsXFAL9z bBfdPnUYRXwsbwrM1AkF28baGZpeGyw/05qoDYciEaYw0eUHiixCXB0xVQNH3WGKvcJQ XvhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KydtvRas; 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 o2si31359849pgp.288.2019.07.24.13.23.33; Wed, 24 Jul 2019 13:23:34 -0700 (PDT) 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=KydtvRas; 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 S2390414AbfGXTms (ORCPT + 29 others); Wed, 24 Jul 2019 15:42:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:44578 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390409AbfGXTmq (ORCPT ); Wed, 24 Jul 2019 15:42:46 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 42AAD20665; Wed, 24 Jul 2019 19:42:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563997364; bh=aKEnaZ7Q19gHsX4lVgdncCYO5iiTFGDI+R4d4ch3Riw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KydtvRasS0UhI8RR1N1baE8p+rGN7EXj9Tu2NmNmxZ7LxIlGnIbRj6MhTVeizVMqL zo2ILwDeXd/v34VCjXSrUVYkvvV+7+tt2BKEUXSmoF9z22ELowcanD7OhXcW7KXUk4 KmRpOnhc6jSRkbC11DRcfslZKpfcKDVhzoHwE1G0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Evan Green , Marc Gonzalez , Vivek Gautam , Niklas Cassel , Bjorn Andersson , Kishon Vijay Abraham I Subject: [PATCH 5.2 411/413] phy: qcom-qmp: Correct READY_STATUS poll break condition Date: Wed, 24 Jul 2019 21:21:42 +0200 Message-Id: <20190724191803.918536116@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bjorn Andersson commit 885bd765963b42c380db442db7f1c0f2a26076fa upstream. After issuing a PHY_START request to the QMP, the hardware documentation states that the software should wait for the PCS_READY_STATUS to become 1. With the introduction of commit c9b589791fc1 ("phy: qcom: Utilize UFS reset controller") an additional 1ms delay was introduced between the start request and the check of the status bit. This greatly increases the chances for the hardware to actually becoming ready before the status bit is read. The result can be seen in that UFS PHY enabling is now reported as a failure in 10% of the boots on SDM845, which is a clear regression from the previous rare/occasional failure. This patch fixes the "break condition" of the poll to check for the correct state of the status bit. Unfortunately PCIe on 8996 and 8998 does not specify the mask_pcs_ready register, which means that the code checks a bit that's always 0. So the patch also fixes these, in order to not regress these targets. Fixes: 73d7ec899bd8 ("phy: qcom-qmp: Add msm8998 PCIe QMP PHY support") Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets") Cc: stable@vger.kernel.org Cc: Evan Green Cc: Marc Gonzalez Cc: Vivek Gautam Reviewed-by: Evan Green Reviewed-by: Niklas Cassel Reviewed-by: Marc Gonzalez Tested-by: Marc Gonzalez Signed-off-by: Bjorn Andersson Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Greg Kroah-Hartman --- drivers/phy/qualcomm/phy-qcom-qmp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/phy/qualcomm/phy-qcom-qmp.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp.c @@ -1074,6 +1074,7 @@ static const struct qmp_phy_cfg msm8996_ .start_ctrl = PCS_START | PLL_READY_GATE_EN, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, + .mask_pcs_ready = PHYSTATUS, .mask_com_pcs_ready = PCS_READY, .has_phy_com_ctrl = true, @@ -1253,6 +1254,7 @@ static const struct qmp_phy_cfg msm8998_ .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, + .mask_pcs_ready = PHYSTATUS, .mask_com_pcs_ready = PCS_READY, }; @@ -1547,7 +1549,7 @@ static int qcom_qmp_phy_enable(struct ph status = pcs + cfg->regs[QPHY_PCS_READY_STATUS]; mask = cfg->mask_pcs_ready; - ret = readl_poll_timeout(status, val, !(val & mask), 1, + ret = readl_poll_timeout(status, val, val & mask, 1, PHY_INIT_COMPLETE_TIMEOUT); if (ret) { dev_err(qmp->dev, "phy initialization timed-out\n");