From patchwork Sat Feb 17 10:02:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 202596 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp241236dyc; Sat, 17 Feb 2024 02:03:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVGYrlAmqNCr44H4bsyVF/UlYrBzxemBYOUZw3Cv8LGGd09iWy5GmzmiNwEmaJQp+MA87A6wxuC+OcaLNaTzEPzQw2y/Q== X-Google-Smtp-Source: AGHT+IG6dWRAtXnSESwZoHAVVOpoCyeK0LVblMljVC3wNg1JuBhHsxMISJmGIJk54FjlTYSoSLgD X-Received: by 2002:a50:fb84:0:b0:564:2518:adfd with SMTP id e4-20020a50fb84000000b005642518adfdmr874715edq.10.1708164199460; Sat, 17 Feb 2024 02:03:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708164199; cv=pass; d=google.com; s=arc-20160816; b=kQKkPpskcnYRR8CqY9TkAR9UW4M7Zt67yRdCNVeA7UmLFYohg5YqvgLJoyEVLDK6fJ UrxZDP/+yLt0wvRTlZvQ6/iAKnv9/RKeoa9ajEhmzE23mtnUIXxdBrXA0bC2Jmxmn5NM 9K2Qd0Xxm1/DQ4RrWqpckHFGw6c2kFqTrWfNxtjJ+sMcAO/LspTay3UQTuO1eopuUXBa XySVrEFxKUoAl5U68JjYzj3rMH1gSs3XStaUoN/8d4Jes6MkV6oxOaG4UOm5P5z2r4Wn EIA/YU5qlrGg/Jzt6YKi/eAEg6VIKBUYYU0vw9sloFYc5GHWayOy1PRoHE1JHc2IpjfT Axfg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=nqfx68Stq1v6Qf4tIPhse4R7f6lQzjIJhU0OnU94194=; fh=EHKOgJmdmpht9PE+IXQYTwcm+mhzf+PgV92P2467Nl4=; b=mo5U/rK2JQK9otIeDSXkWI3N8Q7F9afDNHzogp86KzawXjeYig6EaoDwGs04Wl/hNf o5hBaWvUjBPjkEnn8rJG6rF4WEoj4gzATXFAF838f85A1UmZDNFdK++dEhomoP9HSsrp Lj7oTEm0uftIv7gWY6/0XcTftwg9WIqCVSSkYf6K5JDEuy5gMZ7aSy+JBd5w1sxteYMM uovhoW5NZ5oHl3njAcu+8EmfsVSnKhMDwO9x0W/Y74gETKnMag4eAEGN1iFKSN2f+JJu syLsGeMa0clYswirn+We+VWvq6p2ds7c71ogvrgjFrsVupDdaaauZkjxRXRc/gr0K46B d7Mg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20230601 header.b=UIIUWUCS; arc=pass (i=1 spf=pass spfdomain=googlemail.com dkim=pass dkdomain=googlemail.com dmarc=pass fromdomain=googlemail.com); spf=pass (google.com: domain of linux-kernel+bounces-69784-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69784-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gy6-20020a0564025bc600b00563d4d9cf60si756201edb.478.2024.02.17.02.03.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Feb 2024 02:03:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69784-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20230601 header.b=UIIUWUCS; arc=pass (i=1 spf=pass spfdomain=googlemail.com dkim=pass dkdomain=googlemail.com dmarc=pass fromdomain=googlemail.com); spf=pass (google.com: domain of linux-kernel+bounces-69784-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69784-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E42471F21FC2 for ; Sat, 17 Feb 2024 10:03:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 570D120312; Sat, 17 Feb 2024 10:02:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=googlemail.com header.i=@googlemail.com header.b="UIIUWUCS" Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0900A1CAA5; Sat, 17 Feb 2024 10:02:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708164141; cv=none; b=FiUetxSgwnh40kk5iPKrzaLHK1t0eR9m7b7eREoYqzFnqTwiE+eXsQ5f8tS+hqPr8/RCAp3OJxmSzIe18MkMFv2zoenKMuUxfXXZg2pxIXfL300B/VBcmLZW2CXgxnRQqeCD3ArnLIt2Oqc47es3+QLfiLuzFAiKKgedKm3URao= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708164141; c=relaxed/simple; bh=c7c1Q3/20PbpOtZUY4apUCKgz6BG6WLPvFsA+YNlXP0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Jl0Uysgbcbh6mJaLATJsqqSin5AqanPilkkA4GeEAwRIXMTTw8Ggprienc0DYSkG+QGMxRAU8o8DNPL04FYi4a6pXHTc8BfWdGAiMueavDPyMDFo1syqI0ZGjAyZ06HtgcRcO1UZe1vAQH+GoUivjfRhMguUYb3G0EydlwJ/eCw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=googlemail.com; spf=pass smtp.mailfrom=googlemail.com; dkim=pass (2048-bit key) header.d=googlemail.com header.i=@googlemail.com header.b=UIIUWUCS; arc=none smtp.client-ip=209.85.218.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=googlemail.com Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-a2f79e79f0cso426924766b.2; Sat, 17 Feb 2024 02:02:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20230601; t=1708164134; x=1708768934; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nqfx68Stq1v6Qf4tIPhse4R7f6lQzjIJhU0OnU94194=; b=UIIUWUCSQLDGpM2qU+d8pfLd7YjfRehKfr7N11eQc5S3EHfZNMejDfQqutXuGRr9Om WfOl/OFU6g4nS7cRT6ewI2a1qdF+FvTKuP56z8d+eyGFJ8hn99YIIkia2GL/Pgf468p3 peijXMuXCLiLJ16E9P2j2uf/UQH7FPKeVgH5eRolokWUJMumE+hmzODJNvQzbHv9ARKy eRMftZ23e+TzWk8rOtRaFYK0zk5Z/blIb6BsFx0mgZnFC5lrjkmNQOK6ALPeKANQvbZM 0oaRKkKW/hVSqfqvN4Vw3koOiOKi/VsC/O9N5XvLct6S8o/fTw+bop/lSIHDxv0b1kcz 6INA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708164134; x=1708768934; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nqfx68Stq1v6Qf4tIPhse4R7f6lQzjIJhU0OnU94194=; b=r60UKr7KBgDwbx5T/N38CeX+iI06uSJ1rd8sycb02b3JebPj46qvyWPPexSNa6EPQe HwjVXl+U/fpK+jZdF1KRCXkLj7QLpmAz1xWKR7lPHvrEpCnRE6maq/moqE7fgl8LsT3r oja205CW0jyn+b5QgzLkvI1yI1Ux8jQM7NdV+z7XYBkKHrab5btBjaZVqFzwnzXqM7HZ OW7xI6RFs5zBg81nd6G5PZ6M0W40Wi2aU5uIpua7ON0kUE6dVIvFREj8kB1cOAtO+Tpn MJYaaUDrQi1J/3W8MvvIT6+D84qe6kH7FOUt3yW2mukN7x05jEfwZBw64wvLIWcRCL2x DdkA== X-Forwarded-Encrypted: i=1; AJvYcCV/+aTxZZfvppDlPpx8lgW2CYG44n1DMeWFMtw25rFvHhqOEYqxn7RmE1uaPtiOezU1Tzph2l75fNw3nB6o9AuypvJBrdTIrZcLMZspICyjtol3mPHB+kifiaBPxKKdfvJdzUm0Vy0v X-Gm-Message-State: AOJu0YzxOjt4byl8W8Wpj/qQf4GwgEgwRfLSNf/7Extwdl0joz86oKGW u5D5/qLBbljMyrtgvSrtOLwPnbLueqAgDffN4kwLbC+gx32xVUKK X-Received: by 2002:a17:906:694b:b0:a3d:590:195e with SMTP id c11-20020a170906694b00b00a3d0590195emr6136810ejs.4.1708164134317; Sat, 17 Feb 2024 02:02:14 -0800 (PST) Received: from localhost.localdomain (dynamic-2a01-0c23-c18b-3d00-0000-0000-0000-0e63.c23.pool.telefonica.de. [2a01:c23:c18b:3d00::e63]) by smtp.googlemail.com with ESMTPSA id vu2-20020a170907a64200b00a3d2e690abfsm832444ejc.122.2024.02.17.02.02.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Feb 2024 02:02:13 -0800 (PST) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, linux-mmc@vger.kernel.org, ulf.hansson@linaro.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Blumenstingl Subject: [PATCH v1 2/2] mmc: meson-mx-sdhc: Remove .card_hw_reset callback Date: Sat, 17 Feb 2024 11:02:00 +0100 Message-ID: <20240217100200.1494980-3-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240217100200.1494980-1-martin.blumenstingl@googlemail.com> References: <20240217100200.1494980-1-martin.blumenstingl@googlemail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791139983757919041 X-GMAIL-MSGID: 1791139983757919041 Commit 32f18e596141 ("mmc: improve API to make clear hw_reset callback is for cards") made it clear that the hw_reset callback is intended for resetting the card. Remove the .card_hw_reset callback from the meson-mx-sdhc-mmc driver because it's purpose is to reset the SDHC controller (FIFOs, PHY, DMA interface, ...). While here also rename and change the argument of meson_mx_sdhc_hw_reset so it cannot be called by accident as a replacement for card_hw_reset in the future. Signed-off-by: Martin Blumenstingl --- drivers/mmc/host/meson-mx-sdhc-mmc.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/host/meson-mx-sdhc-mmc.c b/drivers/mmc/host/meson-mx-sdhc-mmc.c index 1ed9731e77ef..31f750301dc1 100644 --- a/drivers/mmc/host/meson-mx-sdhc-mmc.c +++ b/drivers/mmc/host/meson-mx-sdhc-mmc.c @@ -65,10 +65,8 @@ static const struct regmap_config meson_mx_sdhc_regmap_config = { .max_register = MESON_SDHC_CLK2, }; -static void meson_mx_sdhc_hw_reset(struct mmc_host *mmc) +static void meson_mx_sdhc_reset(struct meson_mx_sdhc_host *host) { - struct meson_mx_sdhc_host *host = mmc_priv(mmc); - regmap_write(host->regmap, MESON_SDHC_SRST, MESON_SDHC_SRST_MAIN_CTRL | MESON_SDHC_SRST_RXFIFO | MESON_SDHC_SRST_TXFIFO | MESON_SDHC_SRST_DPHY_RX | MESON_SDHC_SRST_DPHY_TX | @@ -116,7 +114,7 @@ static void meson_mx_sdhc_wait_cmd_ready(struct mmc_host *mmc) dev_warn(mmc_dev(mmc), "Failed to poll for CMD_BUSY while processing CMD%d\n", host->cmd->opcode); - meson_mx_sdhc_hw_reset(mmc); + meson_mx_sdhc_reset(host); } ret = regmap_read_poll_timeout(host->regmap, MESON_SDHC_ESTA, esta, @@ -127,7 +125,7 @@ static void meson_mx_sdhc_wait_cmd_ready(struct mmc_host *mmc) dev_warn(mmc_dev(mmc), "Failed to poll for ESTA[13:11] while processing CMD%d\n", host->cmd->opcode); - meson_mx_sdhc_hw_reset(mmc); + meson_mx_sdhc_reset(host); } } @@ -495,7 +493,6 @@ static int meson_mx_sdhc_execute_tuning(struct mmc_host *mmc, u32 opcode) } static const struct mmc_host_ops meson_mx_sdhc_ops = { - .card_hw_reset = meson_mx_sdhc_hw_reset, .request = meson_mx_sdhc_request, .set_ios = meson_mx_sdhc_set_ios, .card_busy = meson_mx_sdhc_card_busy, @@ -618,7 +615,7 @@ static irqreturn_t meson_mx_sdhc_irq_thread(int irq, void *irq_data) } if (cmd->error == -EIO || cmd->error == -ETIMEDOUT) - meson_mx_sdhc_hw_reset(host->mmc); + meson_mx_sdhc_reset(host); else if (cmd->data) /* * Clear the FIFOs after completing data transfers to prevent @@ -728,7 +725,7 @@ static void meson_mx_sdhc_init_hw(struct mmc_host *mmc) { struct meson_mx_sdhc_host *host = mmc_priv(mmc); - meson_mx_sdhc_hw_reset(mmc); + meson_mx_sdhc_reset(host); regmap_write(host->regmap, MESON_SDHC_CTRL, FIELD_PREP(MESON_SDHC_CTRL_RX_PERIOD, 0xf) |