Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp212542rdb; Tue, 5 Dec 2023 03:28:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IGB2KXrjhWAx3zZEGHuhbzN5byAifMx2L99sUjrC9OqqsGOmQsS/Y8FzrBPFVitECUJPt3V X-Received: by 2002:a05:6358:4320:b0:170:1037:8c25 with SMTP id r32-20020a056358432000b0017010378c25mr2591402rwc.30.1701775719185; Tue, 05 Dec 2023 03:28:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701775719; cv=none; d=google.com; s=arc-20160816; b=mv+GGaK4fX4nF5tETBR5unWPGLzS18gH00yIzEAnqY4RO5xcg3d4LdTTiuL5GpPBTS HP/Dpn8ub1+v8Xnw12QbkuwFaw4P4xxcU2ACOnC51iAFze/+Gn+HIow8k+285Zda5aGb ejCEpePf4NbBe/7MyZDW97CaPWF4mNOOVXMKrx8Kaq6RmsRfLGL0Q1jDTw6v2u1725Ns dcbujgNdRjA+8HQ1Xz0VDsrYM1CoU4miappPEQmmkdUO8tQi+Jv/0dXSI+VvMt/Edcz5 FxYjLmA47gq41o6KbDqRmOqAJolHK8OSaT1kJp2weBSq/p2vY7MfEQxlSuEL33yt73vH 7buQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=8JpibuCCrZznsYrKWmf5FuNObd3UVy8RAR9VzHlTwT0=; fh=aBvetHouOHscQaSNeirPq1axjNptTVM8PjePGPzY7NE=; b=exqCRhu0SOo8992DTQPTgHqZH7VFjrzybjUTPH0uz9WLmznoC897+Tv6AkKZrGjxFe Bq57XOTJ8bm/byzCE58aomWGsiZh/uaBuYwZhshjl43kW9x6ispZhe9Qswug7m/3XZ04 h1oFswLF0vbHjen3l7D0+EvOC3062erABSSl+0zNgZX1T1iEsEPglOh1WbUp0NvwP4OL QDsW9XxaPe3FXSRlG3vAWIv7dbKXKN3ZcgIuyxMnv6q4jD+rAv7/a0D6Pu7tIU2mmltQ cm8obkrew+edwZ5jCZnuGm3xlAtxRbgoeXCjWdszgW0a2QZhIvEAAXBvSXQ0a9q/2R2Z rJmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="mab/ITuX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id bt15-20020a056a00438f00b006ce563b23cdsi2835585pfb.136.2023.12.05.03.28.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 03:28:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="mab/ITuX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 164E180C03AF; Tue, 5 Dec 2023 03:28:38 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346984AbjLEL22 (ORCPT + 99 others); Tue, 5 Dec 2023 06:28:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346969AbjLEL2M (ORCPT ); Tue, 5 Dec 2023 06:28:12 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E1FD26AC; Tue, 5 Dec 2023 03:26:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701775617; x=1733311617; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=OWPD/eGzPxDr4/kQ5lviw+9wKyBmE2JGu/aOr799fyU=; b=mab/ITuXuETG4xRc/stKaz2hS7DHlTFDYX6qglo4wP64EF8LZaxxeGW5 eoIF71egxVsMI50KQqObnM5BXCcper0UQAVHGeVLmqGOusuaTg5fYQZEW ZUFO8AyACfALGnabts5t3PsdMMEl6XZ7ELg5D3QZqQTtGxffwuBpEirzU dVnPf6sX/cQIBFEe+bslLhrgB7TMiVvux+TLg8aWfLHWyZh0DVJ7B0ghL wdReVcGkkzltuwjZbzA3ukbXQhaZmnuGFpQrvKqxdqlQ3jE/DV2JONXuP Ae8Y3WD7o9CDakakRJPcjefzGTGe9S8CAOy+C5pOXWgznfcxVwFsgXnOz g==; X-IronPort-AV: E=McAfee;i="6600,9927,10914"; a="943605" X-IronPort-AV: E=Sophos;i="6.04,252,1695711600"; d="scan'208";a="943605" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Dec 2023 03:26:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10914"; a="1018194403" X-IronPort-AV: E=Sophos;i="6.04,252,1695711600"; d="scan'208";a="1018194403" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.252.46.77]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Dec 2023 03:26:51 -0800 Message-ID: <8e7b6ac2-9d92-4f37-97c4-ae295f7cdbd4@intel.com> Date: Tue, 5 Dec 2023 13:26:47 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7][2/4] mmc: Add Synopsys DesignWare mmc cmdq host driver Content-Language: en-US To: =?UTF-8?B?SnlhbiBDaG91IFvlkajoirflrold?= , "ulf.hansson@linaro.org" , "jh80.chung@samsung.com" , "riteshh@codeaurora.org" , "robh+dt@kernel.org" , "krzysztof.kozlowski+dt@linaro.org" Cc: "conor+dt@kernel.org" , "asutoshd@codeaurora.org" , "p.zabel@pengutronix.de" , "linux-mmc@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "arnd@arndb.de" , "briannorris@chromium.org" , "doug@schmorgal.com" , "tonyhuang.sunplus@gmail.com" , "abel.vesa@linaro.org" , "william.qiu@starfivetech.com" References: <20231121091101.5540-1-jyanchou@realtek.com> <20231121091101.5540-3-jyanchou@realtek.com> <655c5964-0917-4021-b254-7917b368b05f@intel.com> <7b4b7219c2b6430b9c320c8d9ac1cc8b@realtek.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: <7b4b7219c2b6430b9c320c8d9ac1cc8b@realtek.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 05 Dec 2023 03:28:38 -0800 (PST) On 5/12/23 11:19, Jyan Chou [周芷安] wrote: >>> + >>> +static irqreturn_t dw_mci_cqe_interrupt(int irq, void *dev_id) { >>> + struct dw_mci *host = dev_id; >>> + struct mmc_host *mmc = host->slot->mmc; >>> + struct cqhci_host *cq_host = NULL; >>> + int cmd_error = 0, data_error = 0; >>> + >>> + if (host->pdata && (host->pdata->caps2 & MMC_CAP2_CQE)) >>> + cq_host = mmc->cqe_private; >>> + >>> + dw_mci_get_int(host); >>> + >>> + if (host->pdata && (host->pdata->caps2 & MMC_CAP2_CQE)) { >>> + if (!mmc->cqe_on && !cq_host->activated) >> >> Shouldn't really look at internals like mmc->cqe_on or cq_host->activated. >> There are the cqhci_host_ops ->enable() and ->disable() callbacks to keep track >> of whether cqhci is expecting interrupts. > > Does this means we need to use cqhci_host_ops ->enable() and ->disable() callbacks > instead of mmc->cqe_on && !cq_host->activated? Thanks. Yes. ->enable() is always called before cqhci operation and ->disable() before non-cqhci operation, so they can be used to determine if an interrupt is for cqhci.