Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp339546ybh; Wed, 18 Mar 2020 00:37:23 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu1xHg8EnIetpqfrq2L6v1r6lGT/RPNGwAW928V6PpkqPodVJvzz1rKoMHSvbMn9nmVrwRv X-Received: by 2002:aca:ac89:: with SMTP id v131mr2177244oie.7.1584517042907; Wed, 18 Mar 2020 00:37:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584517042; cv=none; d=google.com; s=arc-20160816; b=LzuQ22EBKhLvrw216hFvA3uOeYHZWRHYD8N8sIpC1gVwJ/OkFX7ba8prcYIoSMgY3B pNPMMTBRKe/RAWAqP49GCprDiAwboUHlCbNzEU6xJUCPxfjKn9h7NSxr0WeWlP/FGA9K Cy0ml/+LXWe8/xB/BqEYcqD21d2csiBZrp05muLVjrfEHGiOyLIhRKtywpBVSNfjK1wx yfCfodB8wkZE1Eq0I539nXpXOQPxVa6kumbqqVOOL6crSAOkvqx+WQ1rlrxaUW0kRHJd u16c+TB0g066RHmAiCZ8HVvz7o0S85K/Wo8tG8Mk8vBK9z7FrrcfSZd/WzCOMV/dt3QY z7Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=k7ojDd8bH4rHuUROHL8yQ33iky3lTQUOUIq9HFOqbw0=; b=C3yiWV4MqRd+cOpIW4xLKq0d7NTQARkUn+zybuPA2glKMqWVutvMDkvG5FoIk+bMND 5DtY1inWhvghH3iBym5CnzbKtXSsREh2rZaESRmjRWk19d/X8316KNJH5TCqZwRgq5Ec gjJvBzeAlGrnayhGAaAJTXDElLeHeCPyf8r2dWmgceLBi/fisha1e3rsRWKLimSz3Fbd xG/V8Rx87TZ/x4ZUjmNy28a25nVohAY2Uz8pTChwvJ0+zQyghfOBWiJPGR5tGKjVAZIh U4xpO7PB0O3R/J2FKBC0VjWL+OVsQgYwnQmcIf3N0eNdRs9jYmtLT0Mes4s+WmzTcsIE eRrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fvNwNyny; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h12si3008822otn.285.2020.03.18.00.37.11; Wed, 18 Mar 2020 00:37:22 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fvNwNyny; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727238AbgCRHfa (ORCPT + 99 others); Wed, 18 Mar 2020 03:35:30 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:40472 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726452AbgCRHf3 (ORCPT ); Wed, 18 Mar 2020 03:35:29 -0400 Received: by mail-lj1-f194.google.com with SMTP id 19so25781654ljj.7; Wed, 18 Mar 2020 00:35:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=k7ojDd8bH4rHuUROHL8yQ33iky3lTQUOUIq9HFOqbw0=; b=fvNwNynyOikKBbNMPLWFivb8+f/I6G7r6/sGEbmTWHGmzpQjeP9wsYYAXLZOy0ELEs uQxerWZnBTiM6a9jVTPHhErJlqLNLYHgux/6v9CSDe9kf1nez6AXTEiyIlPDWkyT4pYr bQuatnuTbQSpLCEqyTaJeltoOLQ6fNNUCh9YOnaErd5yfyvoIBHRhsg5geZ5yd54bYun 0KXbm6R18BztDKMtycbA4Xd04h/VK2yJh/A9Pcfe5LRneZXcwA2Sz5iYx0MDHKstqVx4 oxyyrUVcF9wRb5FplwuzoHbs2aqwGM3m0P1Kqcp8TLCLHROj2YlHxbw11gR7/Q8FqApB +CzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=k7ojDd8bH4rHuUROHL8yQ33iky3lTQUOUIq9HFOqbw0=; b=TvgfDkQ1myW+0N9bsvhBEEefZP1oK5euf/hW2XPx3StBZvHCaECckJO+6JJ5d8ZnGX PETUynC4ph6m7gdl10RFKnEvGNMQeiZuasZYp164X6i8A6WxMlMoQ8u6/JPKhu2yA4Ve R6lW7jQhwYEon/fystqrFN0NMvkipBqz2Jk5nhhCE3X1OzQgpiIEM9eCgfNvk4bKzO14 r8tPSOYbZcuqGK0WW7xG2sMikDWTWGaCVXfJq65D4Ib5c6H99g4j3JULr8iBDhvywaxK nU9FOm+joHqgajRXOb1JZgb46i9SbSZ1bmKtyesNzeOqgJ9WZ3trZgH4qppQQx4Mo7ot hDYg== X-Gm-Message-State: ANhLgQ1LT84SLVNxnhHMeHHp0xTbZa3TjgRw1QBL513hU1RwYap2B1Tp Hg1eGUNVyWFUZqMN6Oha1ZFu2bfIX4xUAK11YdE= X-Received: by 2002:a2e:8059:: with SMTP id p25mr1565366ljg.196.1584516927469; Wed, 18 Mar 2020 00:35:27 -0700 (PDT) MIME-Version: 1.0 References: <7866e519-80ad-8678-6708-7726a53ea4f5@intel.com> In-Reply-To: From: Baolin Wang Date: Wed, 18 Mar 2020 15:35:15 +0800 Message-ID: Subject: Re: [PATCH v2 0/3] Introduce the request_atomic() for the host To: Adrian Hunter Cc: Ulf Hansson , Orson Zhai , Chunyan Zhang , Arnd Bergmann , linux-mmc , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 17, 2020 at 11:07 PM Adrian Hunter wrote: > > 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. OK. I will try in next version. Thanks. > > > >>> > >>> 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(-) > >>> > >> > > > > > -- Baolin Wang