From patchwork Wed Jul 12 14:13:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 119210 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp1182991vqm; Wed, 12 Jul 2023 07:17:20 -0700 (PDT) X-Google-Smtp-Source: APBJJlHAbd3ddt8iH6qrashzEAmw9tdJD8z1tsJIa2CQgXuv5s7zXMJDzlnLtq27+CThEmzQW2Zn X-Received: by 2002:aa7:88ce:0:b0:668:71a1:2e68 with SMTP id k14-20020aa788ce000000b0066871a12e68mr17573876pff.11.1689171439738; Wed, 12 Jul 2023 07:17:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689171439; cv=none; d=google.com; s=arc-20160816; b=P/wsBfejWmPtH043dQmQFFXkq6X/b3OQ4f6wMkpYEot8VoWhmuzdjAEvQLbrFRdWwu jZM62GiobOAzncei6WeYR3zlWKfO5XkYp8MQ12zrDXX5IQUf3Nl/bxPhD+o0mbwAlXGG sTrrDaeSEM/knt5BiIJgz2PgAh4ddUsrcZFfrDROgR37/H8CViZSydtsKWYPJniCWR1N OLHWM8sF000VcKSDYpdKOcHKrk3IB1TMlTlgBRkAPuMUb1Tce6bc3uJHttHsOgTbr8wS E7datHfW5ncu6neQ4iBhFSO86EM4aK61Hgn1MpNsNMTBjH/Te3h8GroPmhZVd5Ds3zx4 ry7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Y9d7J5CMu7DEbdNW56Qy+zSGey/4BIQ3iYwBhkjkJZo=; fh=LRW8jLYUcl/gC8cQnPbPUP7tvKCoVYDbxaK6ZwM/3wo=; b=w7+ECFjtxGQXNjJh9A/kKclLAKBQCJcGiS4J8kt6YsNIf+Vc0/ctCO7eKUzZzLzKGT 9Na2u5h0yO6yBGPVUg523xNeTG0VT8lhjDFpnYGiTpgggVARFy1hS1257CVqUkgP+twb k73pPkoizZ3aCngOrySMUJZv8Zlvgy1dk6EXj9EM11ZZ45AkzmfBTlZUVgFniCOnPnGv AW6Hz8uIo0xzlgcK9VB8umfHrbsOGt2OryBTRHvE+SfLJ0nICALtoLhMO55qWkXk44Hv nf3YoQxvvOVNWnpWMtfEjGOdyjqS9LJO30abPGjbWyz9GjHVBv4mv4lbciCayTQR+sG0 21dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b="dh4/Vz56"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k9-20020aa788c9000000b0067396db45a8si3368146pff.52.2023.07.12.07.17.07; Wed, 12 Jul 2023 07:17:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b="dh4/Vz56"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232846AbjGLONs (ORCPT + 99 others); Wed, 12 Jul 2023 10:13:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232957AbjGLONo (ORCPT ); Wed, 12 Jul 2023 10:13:44 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D43FE1BCC for ; Wed, 12 Jul 2023 07:13:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= sang-engineering.com; h=from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; s=k1; bh=Y9d7J5CMu7DEbd NW56Qy+zSGey/4BIQ3iYwBhkjkJZo=; b=dh4/Vz56pLuFgMhFRIfv5GtZ7W+kDL /EVyjamxjoTPCrMWt+Cdz48KbAPC41ymC3wkyFkUiQCxdXfKmxGHjnJaPF8b6aqt VwN0Z9YkqFljmcUoUop75LErqibhkuNp97feiVzjXjvRv0hpggSo8YbCoBH9Y/Eo WoRDz3M1amdOT9uMdvd8tXgF6s2jQnXCJERJ7LcgTAMiZLDJK5v/U0TCURWkLQtq 1320y2lIosZIXQsAXE6NVrtOCiFPEypyouKw5IwUZ2G40NcuQXrTq5OYIu7wfssC 8C5G34d3OY2ZAISiREgKVGtyKrhW/ZqOtXjPzBEkAJ81AjVgXoM7BBKQ== Received: (qmail 1639935 invoked from network); 12 Jul 2023 16:13:37 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 12 Jul 2023 16:13:37 +0200 X-UD-Smtp-Session: l3s3148p1@W05l0koAurkujnvL From: Wolfram Sang To: linux-renesas-soc@vger.kernel.org Cc: Wolfram Sang , Ulf Hansson , Kunihiko Hayashi , Masami Hiramatsu , linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH RFT] mmc: uniphier-sd: register irqs before registering controller Date: Wed, 12 Jul 2023 16:13:27 +0200 Message-Id: <20230712141327.20827-1-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771224631696348770 X-GMAIL-MSGID: 1771224631696348770 IRQs should be ready to serve when we call mmc_add_host() via tmio_mmc_host_probe(). To achieve that, ensure that all irqs are masked before registering the handlers. Signed-off-by: Wolfram Sang --- So, I converted this other TMIO core user as well. But I don't have HW to test, so it would be great if someone could step up and test it. drivers/mmc/host/uniphier-sd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/uniphier-sd.c b/drivers/mmc/host/uniphier-sd.c index 61acd69fac0e..4dc079f74c1b 100644 --- a/drivers/mmc/host/uniphier-sd.c +++ b/drivers/mmc/host/uniphier-sd.c @@ -706,19 +706,19 @@ static int uniphier_sd_probe(struct platform_device *pdev) tmio_data->max_segs = 1; tmio_data->max_blk_count = U16_MAX; - ret = tmio_mmc_host_probe(host); - if (ret) - goto disable_clk; + sd_ctrl_write32_as_16_and_16(host, CTL_IRQ_MASK, TMIO_MASK_ALL); ret = devm_request_irq(dev, irq, tmio_mmc_irq, IRQF_SHARED, dev_name(dev), host); if (ret) - goto remove_host; + goto disable_clk; + + ret = tmio_mmc_host_probe(host); + if (ret) + goto disable_clk; return 0; -remove_host: - tmio_mmc_host_remove(host); disable_clk: uniphier_sd_clk_disable(host); free_host: