Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3874198ybh; Tue, 17 Mar 2020 08:08:37 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsZBwa8dA24vqOw7TVUahlaVUSEWj91AQ5kogSpfeAEqK50pX3tkWcmDB+zf8PEc/WoldTZ X-Received: by 2002:a9d:6a47:: with SMTP id h7mr4174408otn.297.1584457717045; Tue, 17 Mar 2020 08:08:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584457717; cv=none; d=google.com; s=arc-20160816; b=m7ywNANlCiTwILKy3kc9nc9605Py4k6YsOM0/PQ3hm8WANcoGFYkKL5cG4iChYqfR+ QTaQJw0eXi2qBMdyhyhyw7bcEYizr1l34d7KAu8rTkWwNmoCIXGdM/E+xW34ja++tr57 qabFtUQBQ+TNmY65NfmYwQ0L1hGdwRk8CJC7Q9W8pe+uaXKdtwlzOJI+2Js+QkOIAIbr xtHXGe5VIeGrUCvXA2pWyZ6Z5SXFjMDjLbNprN8GN8dSnVW6oPJ6OkOsxTFS0jD1cHuM aUIPU530qI9gDNnrtGQsoXQ49d5mYCigd3ZcDf8DCeUNvuEZKlbUM5EhJwRArgxmPNVV Pvsw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject:ironport-sdr :ironport-sdr; bh=zsK7vEEoB4r0cPAVY/qLIWjC7u3cFN94CjK/n5WCdfI=; b=B3EQMA4MeeShLj2bQWqyeF2WCnaLBgNmbWV/RKdtyPfzfeAmSeln07jEqFCI4J5rmo lJxg9afU/H8gQmIoG1zdHDOtu1B1ktYQ8l0drFs3MMh8I0W99E3XM+PJk5uU+RMRL2cP Pfe/1KTl2JRuH+oXuy+9H1JTLHoS2i6Ie3acgZ1t00p7onyYsGyraW+qaSVznuVsgG3j /Uh9hYuX7Eg/dYZH3yj3ulmp1S/kAcNPGvZ552uyijCa2X0WAXQDPhCCRtm5WNDtTdfD I+0baQgBwcHoUGyc25dI7r/334rwXUVNw1ygygWF80NjQvkdBldb2daK1X91M/7lrV82 GiDQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q3si1708930oij.157.2020.03.17.08.08.15; Tue, 17 Mar 2020 08:08:37 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726757AbgCQPHK (ORCPT + 99 others); Tue, 17 Mar 2020 11:07:10 -0400 Received: from mga07.intel.com ([134.134.136.100]:23049 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726189AbgCQPHK (ORCPT ); Tue, 17 Mar 2020 11:07:10 -0400 IronPort-SDR: W+pmRMzMsWWIonsSDVOoS0JiKVoVBdMnAEqGhq1KB+/RK2vfyOjQSmkwwkKbpsAWLqD+41LJl9 TXCIaMyYNgtg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2020 08:07:09 -0700 IronPort-SDR: +8+4g4cTydYa/j7bUY6QqCEIpWQSFEJnJ6LCC7IGQCOV3sCnsQhbFyB0u4NH4Op51mh7L5JV/y J0Zwp5bkIa7g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,564,1574150400"; d="scan'208";a="445524084" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.87]) ([10.237.72.87]) by fmsmga006.fm.intel.com with ESMTP; 17 Mar 2020 08:07:07 -0700 Subject: Re: [PATCH v2 0/3] Introduce the request_atomic() for the host To: Baolin Wang Cc: Ulf Hansson , Orson Zhai , Chunyan Zhang , Arnd Bergmann , linux-mmc , LKML References: <7866e519-80ad-8678-6708-7726a53ea4f5@intel.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: Date: Tue, 17 Mar 2020 17:06:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17/03/20 3:49 pm, Baolin Wang wrote: > On Tue, Mar 17, 2020 at 9:25 PM Adrian Hunter wrote: >> >> On 17/03/20 12:14 pm, Baolin Wang wrote: >>> This patch set introduces a new request_atomic() interface for the >>> MMC host controller, which is used to submit a request to host in >>> the atomic context, such as in the irq hard handler, to reduce the >>> request latency. >>> >>> Any comments are welcome. Thanks. >>> >>> Note: Adrian pointed out that it is not good if moving the polling of >>> inhibit bits in sdhci_send_command() into the interrupt context, but >>> now I have not found a better way to address Adrian's concern. Moveover >>> this is an unusual abnormal case and the original code has the same >>> problem, so I plan to create another patch set to talk about and fix >>> this issue. >> >> I tend to think the API requires the possibility for host controllers to >> return "busy", so that should be sorted out first. > > If request_atomic() can return 'busy', the HSQ need queue a work to > dispatch this request to host again? Sounds reasonable > > I am thinking if I can introduce a new flag to avoid polling the > status before sending commands, cause from the datasheet, I did not > see we should need do this if the command complete and transfer > complete interrupts are processed normally. At least on my platfrom, I > did not see the inhibit bits are set. If we meet this issue, I think > some abormal things are happened, we should give out errors. How do > you think? For the atomic path, some kind of warning would be ok. > >>> >>> Changes from v1: >>> - Re-split the changes to make them more clear suggested by Ulf. >>> - Factor out the auto CMD23 checking into a separate function. >>> >>> Baolin Wang (3): >>> mmc: host: Introduce the request_atomic() for the host >>> mmc: host: sdhci: Implement the request_atomic() API >>> mmc: host: sdhci-sprd: Implement the request_atomic() API >>> >>> drivers/mmc/host/mmc_hsq.c | 5 ++++- >>> drivers/mmc/host/sdhci-sprd.c | 23 ++++++++++++++++++++--- >>> drivers/mmc/host/sdhci.c | 27 +++++++++++++++++++-------- >>> drivers/mmc/host/sdhci.h | 1 + >>> include/linux/mmc/host.h | 3 +++ >>> 5 files changed, 47 insertions(+), 12 deletions(-) >>> >> > >