From patchwork Fri Aug 30 09:02:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1155784 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46KYSh3wSsz9s7T for ; Fri, 30 Aug 2019 19:04:20 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="Uw+aX94S"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="j8QZHO/1"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46KYSh12GQzDqVr for ; Fri, 30 Aug 2019 19:04:20 +1000 (AEST) X-Original-To: openbmc@lists.ozlabs.org Delivered-To: openbmc@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="Uw+aX94S"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="j8QZHO/1"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46KYQp6VMhzDqB5 for ; Fri, 30 Aug 2019 19:02:42 +1000 (AEST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 7F1232202A; Fri, 30 Aug 2019 05:02:40 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 30 Aug 2019 05:02:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=N+/xHfrW3aULX QCqVybged8XEa4ya5xZpQyzoYwgBTM=; b=Uw+aX94SOlLPM1U3DFp/+EEDXWbdA kTJ82sO4tBCBPLTJU5988b+gpOhRAueukhiwqjwpaJDsOaJmPvq5Qn36QG/7Sacf c4LvGYie0iYWpKG7LZT2l2GJpom12BEOeLksZs7w/DPLOgY5CG9WKpxXTFNRzist uEGbKUIOMv/v6SSPakDiO8V9/vmc6Jk3vsEdFCioGunJSP7qE7thmuwM/X2v9R4q LeCeX6218zmW5aqw6HSJ06PGZsa/tIjx/nkrmDS+JV1I6uN+ySDWGxUFr4s4a09H f3fmOh7wpkNytTC7XQQ4QqtjhwCNsWo72xIGlY7NbJQbSjWaDuzGDUVCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=N+/xHfrW3aULXQCqVybged8XEa4ya5xZpQyzoYwgBTM=; b=j8QZHO/1 NE1knNdBbk2JRWPFraUjEbkxnqGoWnOMKG05BQ9PNcWhzk4k8nn4SLyGPex+AK61 MIZZOE/6ewzyMjyA4CquLBZmnK2TcPa5KlPix+EIu8Z7e12OL5s15XqYU/rvJkmW nHcRUyet1OlXiooogRw1SA2djUb/7lzdea/EY/8CWkPlWLRlPkJKfZaILgaJkeVD zW8KEqqEZIZZvhamjXHbmnE0P75T1v9N4c9V2hGRrJywkQjbpxtjmY2CyQjfhjs8 FkIpHlBu/aD8/lVCJYOXqRd9rB5W7pPvhUZvzgGyMojRbJzACOBn5/IMQgvDDKux yj/m+R2zZL4Tqw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudeigedgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeetnhgurhgv ficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfkphepvddtfe drheejrddvudehrddujeeknecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfies rghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost.localdomain (203-57-215-178.dyn.iinet.net.au [203.57.215.178]) by mail.messagingengine.com (Postfix) with ESMTPA id 6DF14D60062; Fri, 30 Aug 2019 05:02:38 -0400 (EDT) From: Andrew Jeffery To: openbmc@lists.ozlabs.org Subject: [PATCH linux dev-5.2 1/5] mmc: sdhci-of-aspeed: Fix return value check in aspeed_sdc_probe() Date: Fri, 30 Aug 2019 18:32:40 +0930 Message-Id: <20190830090244.13566-2-andrew@aj.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190830090244.13566-1-andrew@aj.id.au> References: <20190830090244.13566-1-andrew@aj.id.au> MIME-Version: 1.0 X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery , Wei Yongjun Errors-To: openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "openbmc" From: Wei Yongjun In case of error, the function of_platform_device_create() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun Reviewed-by: Andrew Jeffery Signed-off-by: Ulf Hansson (cherry picked from commit 7b7de08a14b59d45cc4720bfb21732063ccfc8f6) Signed-off-by: Andrew Jeffery Reviewed-by: Joel Stanley --- drivers/mmc/host/sdhci-of-aspeed.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-aspeed.c b/drivers/mmc/host/sdhci-of-aspeed.c index 8bb095ca2fa9..d5acb5afc50f 100644 --- a/drivers/mmc/host/sdhci-of-aspeed.c +++ b/drivers/mmc/host/sdhci-of-aspeed.c @@ -261,9 +261,9 @@ static int aspeed_sdc_probe(struct platform_device *pdev) struct platform_device *cpdev; cpdev = of_platform_device_create(child, NULL, &pdev->dev); - if (IS_ERR(cpdev)) { + if (!cpdev) { of_node_put(child); - ret = PTR_ERR(cpdev); + ret = -ENODEV; goto err_clk; } } From patchwork Fri Aug 30 09:02:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1155785 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46KYTg6Lb1z9s5b for ; Fri, 30 Aug 2019 19:05:11 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="SP4jZYZ9"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="V7MZosv8"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46KYTg3tTbzDqLs for ; Fri, 30 Aug 2019 19:05:11 +1000 (AEST) X-Original-To: openbmc@lists.ozlabs.org Delivered-To: openbmc@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="SP4jZYZ9"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="V7MZosv8"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46KYQr5k3ZzDqB5 for ; Fri, 30 Aug 2019 19:02:44 +1000 (AEST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 6650B21B5A; Fri, 30 Aug 2019 05:02:42 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 30 Aug 2019 05:02:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=qgxOet6Vexw+I T/mOjeCHK3/miy/vj59++UWzoy9f4w=; b=SP4jZYZ9Ajnwz1uaDubvlgdgTYzVC 6VaT1bBbQshujl6FVfdkvBNlwwGrvtTvZQXwNkixL/4E0dU0AlB1lWC6/4gj44Pp BuXrQ86HT01UBIim3/aXW8tNbHpADio9F8fT0hZoZ0vIiKinQDa4S0z/hPj6TdKh LmCfFr5f1nnDcLSBx9hLWpwPqhNp5Y/1Yx5+0W4cCy+P6nrQ46c/OFnO7PaPAUnl KGG4aHM2FFesXL6Wakhri6H9WS2HIgLSH5o1l63o+DSuhljEDRLe5q2xeYQr4mrs kINqUowmCXTt8K+sYodiZZeArFBE3g+kxZ1V0nPV4DimpuyV/HPPdLQMw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=qgxOet6Vexw+IT/mOjeCHK3/miy/vj59++UWzoy9f4w=; b=V7MZosv8 WTqCjFNL/ZoIjf5Hl4A/DuU2v2ALxeAZmR8VCYFEe7hjzKo99ZXH+lp/culPBP+1 rbPG2OO23x00fNk/Rk4Ky6UGzERA86Uk0bm3bi3lSQxj0i1uDkmP7piRGLREAzkd KQoHwPn7cbVjtskRIrymnxzXbGhvv6J6jlcM3qn9AUFooh39tQgmBfRLtbMyi+uo /G7SmmrGTkxkr4OXPaW5CAKwi+uT6LR4SLqiR1nH1zoDZ+6fkesJYA9wxiWMM29v vazIPPSN+fWWVtHg+Qb7gBpUOfOrQ8jsYDW34BDWyZADyCxo1yOxyiEpEgXQtVxl vRv/OJMN4pC5kQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudeigedgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtdefrdehjedrvdduhedrudejkeenucfrrghrrghmpe hmrghilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhi iigvpedt X-ME-Proxy: Received: from localhost.localdomain (203-57-215-178.dyn.iinet.net.au [203.57.215.178]) by mail.messagingengine.com (Postfix) with ESMTPA id C47D7D60062; Fri, 30 Aug 2019 05:02:40 -0400 (EDT) From: Andrew Jeffery To: openbmc@lists.ozlabs.org Subject: [PATCH linux dev-5.2 2/5] mmc: sdhci-of-aspeed: Drop redundant assignment to host->clock Date: Fri, 30 Aug 2019 18:32:41 +0930 Message-Id: <20190830090244.13566-3-andrew@aj.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190830090244.13566-1-andrew@aj.id.au> References: <20190830090244.13566-1-andrew@aj.id.au> MIME-Version: 1.0 X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "openbmc" host->clock is already managed by sdhci_set_ios(). Suggested-by: Ulf Hansson Signed-off-by: Andrew Jeffery Reviewed-by: Joel Stanley --- drivers/mmc/host/sdhci-of-aspeed.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-aspeed.c b/drivers/mmc/host/sdhci-of-aspeed.c index d5acb5afc50f..6ae81c8af431 100644 --- a/drivers/mmc/host/sdhci-of-aspeed.c +++ b/drivers/mmc/host/sdhci-of-aspeed.c @@ -61,7 +61,7 @@ static void aspeed_sdhci_set_clock(struct sdhci_host *host, unsigned int clock) sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL); if (clock == 0) - goto out; + return; for (div = 1; div < 256; div *= 2) { if ((host->max_clk / div) <= clock) @@ -72,9 +72,6 @@ static void aspeed_sdhci_set_clock(struct sdhci_host *host, unsigned int clock) clk = div << SDHCI_DIVIDER_SHIFT; sdhci_enable_clk(host, clk); - -out: - host->clock = clock; } static void aspeed_sdhci_set_bus_width(struct sdhci_host *host, int width) From patchwork Fri Aug 30 09:02:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1155786 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46KYVq4vp2z9s7T for ; Fri, 30 Aug 2019 19:06:11 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="OvMiF7uW"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="1fmC+GT5"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46KYVq32bMzDqBG for ; Fri, 30 Aug 2019 19:06:11 +1000 (AEST) X-Original-To: openbmc@lists.ozlabs.org Delivered-To: openbmc@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="OvMiF7uW"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="1fmC+GT5"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46KYQt6YDczDqZq for ; Fri, 30 Aug 2019 19:02:46 +1000 (AEST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 97C5D21C7D; Fri, 30 Aug 2019 05:02:44 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 30 Aug 2019 05:02:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=RDwyLwvHbByVw BGEjdoYpYdD89qsWbvbK620dSvHQ74=; b=OvMiF7uWbEFAI/W026SgK/92sVZsB i9hd1P92tPTe4zZXBrl3rxLVslEZ2altgFg45d9ro9AgyCNNxt6lhNIUCTpsm95D UcxOB5UJjAz4OLZTE5SLxmNZcg4zyxZmF9fhdlxhUyPbAP8f1Aa3gyOEhpjqgrFn XMviIQOudA1iyU/9Z1uEhkXTbTHc6BKv9xnlNGj40sew8pqB+YsyS5CLUjCsvgFb 2IkgR+iqJalS9JFju9D7zZks7k8k2Qh7noX6iVu0xZR+dHTM2EEkob8gTOy8vuhl ogQXP4JLMZyREH8cu3pzR+0prLfkOgbofom6+R5IdMsUteh1Ddj1v14DQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=RDwyLwvHbByVwBGEjdoYpYdD89qsWbvbK620dSvHQ74=; b=1fmC+GT5 y+K+d7AEc5eU8xIFwtog4Qam4XvSROBSUPNeF5sutXXv25lbumnY7dLoGeUa1a/G moPa00CdUwkUma9AtwPYJRASQNJjBRRtX/9cResisR30l9ve+nohPM0uUFHL1Yfl KaZZA+WxBXwwF/96IpGooOF17OUfYxsSVa92pas5hTfkNv9KaGdms1uxfn3aehY7 f4o531GeCpAdAmPXFs1DIbsWy0BYdn0TExB6IjxNjrOijeMHWYhciEBHGQ+5lWcd qIvu7uGqO6Z+sh7C/Op6T5EpxM8ca3ug9LGZpX2HW/gz6rYU0M8DehJ4hA9Soq+4 6n4pqKN7cnYOgA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudeigedgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtdefrdehjedrvdduhedrudejkeenucfrrghrrghmpe hmrghilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhi iigvpedv X-ME-Proxy: Received: from localhost.localdomain (203-57-215-178.dyn.iinet.net.au [203.57.215.178]) by mail.messagingengine.com (Postfix) with ESMTPA id D050ED60065; Fri, 30 Aug 2019 05:02:42 -0400 (EDT) From: Andrew Jeffery To: openbmc@lists.ozlabs.org Subject: [PATCH linux dev-5.2 3/5] mmc: sdhci-of-aspeed: Uphold clocks-on post-condition of set_clock() Date: Fri, 30 Aug 2019 18:32:42 +0930 Message-Id: <20190830090244.13566-4-andrew@aj.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190830090244.13566-1-andrew@aj.id.au> References: <20190830090244.13566-1-andrew@aj.id.au> MIME-Version: 1.0 X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "openbmc" The early-exit didn't seem to matter on the AST2500, but on the AST2600 the SD clock genuinely may not be running on entry to aspeed_sdhci_set_clock(). Remove the early exit to ensure we always run sdhci_enable_clk(). Signed-off-by: Andrew Jeffery Tested-by: Joel Stanley --- drivers/mmc/host/sdhci-of-aspeed.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-aspeed.c b/drivers/mmc/host/sdhci-of-aspeed.c index 6ae81c8af431..0b75806ed69d 100644 --- a/drivers/mmc/host/sdhci-of-aspeed.c +++ b/drivers/mmc/host/sdhci-of-aspeed.c @@ -55,9 +55,6 @@ static void aspeed_sdhci_set_clock(struct sdhci_host *host, unsigned int clock) int div; u16 clk; - if (clock == host->clock) - return; - sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL); if (clock == 0) From patchwork Fri Aug 30 09:02:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1155787 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46KYWx3CC0z9s5b for ; Fri, 30 Aug 2019 19:07:09 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="gbXyYUaM"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="cvbt9QVX"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46KYWx1sk0zDr4g for ; Fri, 30 Aug 2019 19:07:09 +1000 (AEST) X-Original-To: openbmc@lists.ozlabs.org Delivered-To: openbmc@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="gbXyYUaM"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="cvbt9QVX"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46KYQx0nbfzDqtn for ; Fri, 30 Aug 2019 19:02:49 +1000 (AEST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 967E421C7A; Fri, 30 Aug 2019 05:02:46 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 30 Aug 2019 05:02:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=ws3fEvRN8j+zc dsqzJ6ZF8TPOCs6WkRGoLeC8W2y70E=; b=gbXyYUaMDGHpcGo/JsyQcGr+Gq5qu D7V8bU3oKiuyPok52rIkEYmCokOI3my0i+vs8iVcCrjpSTVZP6wnFGDSUPJz0l7w 93TR8mQLoXZqtC2jfNz0fa9d/iMX+q7WLVHqdHR2MUpuq/yGV7lJyP1hyAub0//Y m5m0Pl/YjkCaOAXm08RTRhfPOJQh5b98vEcjL7rMqxvw0Uf3VEtNHOvB+/nzU8L8 vjm2KGBGf8oOgfB3jojhnvHlHj9a3sle/HeU7s6PjkJNa5UoHQ3Kc1dQXDHJDBb4 cYIALvexm2sLP0QUw2Vo9HiEljwfhcSy9R2fEnr9uPkU8UpVMP4+vT6Aw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=ws3fEvRN8j+zcdsqzJ6ZF8TPOCs6WkRGoLeC8W2y70E=; b=cvbt9QVX tFDOHaFmQGktFdc0hgnZ3WReSnitUjzo4M8z5PImSXrT/+H33zHgLL9I/b04kIB9 5v7wtFb4oZasVpwSuAEJx5EFi0VG9kPmIiClqfPslB0IdAfUdRRjzq/PKsUwSCfs /ZqA/gHN45FEw1kC0D/RxCpfsnw++GFdKzGnnuGgoGt5k7npUsgtwN3ZzE7td7i7 yRjmtO1IeurVy+CJTTfiVYPdA7h8OSmNhl0ipPazeaMhGbotJE0/rJgmcOIXWfII uG2QTpj7Kk85Rn3Ojjf382A4j5gDI8SqFMOLd/Bc3NTFmLtFs5a3Ldl88KVHqNFy w1d7aL17ocs8UQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudeigedgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtdefrdehjedrvdduhedrudejkeenucfrrghrrghmpe hmrghilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhi iigvpedv X-ME-Proxy: Received: from localhost.localdomain (203-57-215-178.dyn.iinet.net.au [203.57.215.178]) by mail.messagingengine.com (Postfix) with ESMTPA id E7030D6005B; Fri, 30 Aug 2019 05:02:44 -0400 (EDT) From: Andrew Jeffery To: openbmc@lists.ozlabs.org Subject: [PATCH linux dev-5.2 4/5] mmc: sdhci-of-aspeed: Allow max-frequency limitation of SDCLK Date: Fri, 30 Aug 2019 18:32:43 +0930 Message-Id: <20190830090244.13566-5-andrew@aj.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190830090244.13566-1-andrew@aj.id.au> References: <20190830090244.13566-1-andrew@aj.id.au> MIME-Version: 1.0 X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "openbmc" Add a get_max_clock() handler to sdhci-of-aspeed to report f_max as the maximum clock rate if it is set. This enables artificial limitation of the bus speed via max-frequency in the devicetree for e.g. the AST2600 evaluation board where I am seeing errors at 200MHz. Signed-off-by: Andrew Jeffery Reviewed-by: Joel Stanley --- drivers/mmc/host/sdhci-of-aspeed.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-aspeed.c b/drivers/mmc/host/sdhci-of-aspeed.c index 0b75806ed69d..8962f6664381 100644 --- a/drivers/mmc/host/sdhci-of-aspeed.c +++ b/drivers/mmc/host/sdhci-of-aspeed.c @@ -52,16 +52,24 @@ static void aspeed_sdc_configure_8bit_mode(struct aspeed_sdc *sdc, static void aspeed_sdhci_set_clock(struct sdhci_host *host, unsigned int clock) { + struct sdhci_pltfm_host *pltfm_host; + unsigned long parent; int div; u16 clk; + pltfm_host = sdhci_priv(host); + parent = clk_get_rate(pltfm_host->clk); + sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL); if (clock == 0) return; + if (WARN_ON(clock > host->max_clk)) + clock = host->max_clk; + for (div = 1; div < 256; div *= 2) { - if ((host->max_clk / div) <= clock) + if ((parent / div) <= clock) break; } div >>= 1; @@ -71,6 +79,14 @@ static void aspeed_sdhci_set_clock(struct sdhci_host *host, unsigned int clock) sdhci_enable_clk(host, clk); } +static unsigned int aspeed_sdhci_get_max_clock(struct sdhci_host *host) +{ + if (host->mmc->f_max) + return host->mmc->f_max; + + return sdhci_pltfm_clk_get_max_clock(host); +} + static void aspeed_sdhci_set_bus_width(struct sdhci_host *host, int width) { struct sdhci_pltfm_host *pltfm_priv; @@ -97,7 +113,7 @@ static void aspeed_sdhci_set_bus_width(struct sdhci_host *host, int width) static const struct sdhci_ops aspeed_sdhci_ops = { .set_clock = aspeed_sdhci_set_clock, - .get_max_clock = sdhci_pltfm_clk_get_max_clock, + .get_max_clock = aspeed_sdhci_get_max_clock, .set_bus_width = aspeed_sdhci_set_bus_width, .get_timeout_clock = sdhci_pltfm_clk_get_max_clock, .reset = sdhci_reset, From patchwork Fri Aug 30 09:02:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1155788 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46KYXw4bc3z9s5b for ; Fri, 30 Aug 2019 19:08:00 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="lo4zR/78"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="CWUE7K9P"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46KYXw3nD8zDr2w for ; Fri, 30 Aug 2019 19:08:00 +1000 (AEST) X-Original-To: openbmc@lists.ozlabs.org Delivered-To: openbmc@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="lo4zR/78"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="CWUE7K9P"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46KYQz0hHDzDr2h for ; Fri, 30 Aug 2019 19:02:51 +1000 (AEST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id AC55D21E44; Fri, 30 Aug 2019 05:02:48 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 30 Aug 2019 05:02:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=rm+5UcMSfAOhK YwVFY13EEfKfl+FUXza08LZQXvzmmY=; b=lo4zR/78mgaV2NjVxyuwfT5UFuXUF bDge13WPb2wHW1Lc+a8PSqsKUgx28IAFIx+pqVuKu3RBY2EUzfMzOiLKnhjNHe+K 1qHq6iY0HsZOoyab+dcuPn1vboNwpRhQFIDHAhC0bUtLlFkcPcn+bNZ2u8ujZe7j 2IlZwRmLFxCPuenlkMYgDfTftzvP5Ln3CN5UVPWodasyb3Vw+YKv3eDmQQ5Z8Fm1 wWFY3Smhk0lGIQIRqjX1ICCqozRJy78GdA5tNdUHin0AQlY8mRzCDbZjXWM+J3os glC67ku5w7ZfS3E48YuiOP5tpIVzi0YrCxmvnw9sPIuGvWnWbDf3RTUyA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=rm+5UcMSfAOhKYwVFY13EEfKfl+FUXza08LZQXvzmmY=; b=CWUE7K9P 3dx/eC42K9e/Bj0QMnAVm0FBOhtcIV3X/QnJIDju2QhJLZjgp+RNDui+B88lpRN7 z0Tg0HDy+l69V90DZs5lrWkxdRWegEZoxrV7A87EpMm18Yk6iGgELmZZCn+vQvRT XiW+ojYRBGKugwRs3rVVWxuC0aOlTF6FDMHxr2XbEwEcsp2fEdDpowsaITFvTMw0 +DqImqvvF+IC1OLJRiGS+22z/purOPeQZk/0DjJ2iARScDuQFtiXB96ZYCtVwOpV M9pEKJ6vtLHej5pF+wrPaAJgtofg340+1HIoiGx04O2lqA6tnuAgb3ZoVYt8N4uF 8qf+B6UYsDxcBA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudeigedgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtdefrdehjedrvdduhedrudejkeenucfrrghrrghmpe hmrghilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhi iigvpedv X-ME-Proxy: Received: from localhost.localdomain (203-57-215-178.dyn.iinet.net.au [203.57.215.178]) by mail.messagingengine.com (Postfix) with ESMTPA id 04DDAD6005B; Fri, 30 Aug 2019 05:02:46 -0400 (EDT) From: Andrew Jeffery To: openbmc@lists.ozlabs.org Subject: [PATCH linux dev-5.2 5/5] ARM: dts: ast2600-evb: eMMC configuration Date: Fri, 30 Aug 2019 18:32:44 +0930 Message-Id: <20190830090244.13566-6-andrew@aj.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190830090244.13566-1-andrew@aj.id.au> References: <20190830090244.13566-1-andrew@aj.id.au> MIME-Version: 1.0 X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "openbmc" Enable the eMMC controller and limit it to 52MHz to avoid the host controller reporting error conditions. Signed-off-by: Andrew Jeffery Reviewed-by: Joel Stanley --- arch/arm/boot/dts/aspeed-ast2600-evb.dts | 8 +++++++- arch/arm/boot/dts/aspeed-g6.dtsi | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/aspeed-ast2600-evb.dts b/arch/arm/boot/dts/aspeed-ast2600-evb.dts index 2cb92d2a1041..9613cff2ce3a 100644 --- a/arch/arm/boot/dts/aspeed-ast2600-evb.dts +++ b/arch/arm/boot/dts/aspeed-ast2600-evb.dts @@ -39,8 +39,14 @@ phy-handle = <ðphy1>; }; +&emmc_controller { + status = "okay"; +}; + &emmc { - status = "disabled"; + non-removable; + bus-width = <4>; + max-frequency = <52000000>; }; &fsim0 { diff --git a/arch/arm/boot/dts/aspeed-g6.dtsi b/arch/arm/boot/dts/aspeed-g6.dtsi index d0507f797981..12569e502678 100644 --- a/arch/arm/boot/dts/aspeed-g6.dtsi +++ b/arch/arm/boot/dts/aspeed-g6.dtsi @@ -235,7 +235,7 @@ }; }; - emmc: sdc@1e750000 { + emmc_controller: sdc@1e750000 { compatible = "aspeed,ast2600-sd-controller"; reg = <0x1e750000 0x100>; #address-cells = <1>; @@ -244,7 +244,7 @@ clocks = <&syscon ASPEED_CLK_GATE_EMMCCLK>; status = "disabled"; - sdhci@1e750100 { + emmc: sdhci@1e750100 { compatible = "aspeed,ast2600-sdhci"; reg = <0x100 0x100>; sdhci,auto-cmd12;