Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3799399ybh; Tue, 17 Mar 2020 06:51:13 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsAtO4IA8YfSuhhBNBA8zjFz08SojFAHYw5kntNBcjj149NNdGBGs9GKkyIfby30o8OlHHY X-Received: by 2002:aca:cf8a:: with SMTP id f132mr3381894oig.151.1584453072879; Tue, 17 Mar 2020 06:51:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584453072; cv=none; d=google.com; s=arc-20160816; b=CxDWNflBLrscFpUCuwCw46+MSTGe5Sho1D01eQ0mddBlPo8Yfj24hd9UcULTgU7Hqh 1F6BcADo64LJteLDw8KRVB7E50HdigiZfizy2sYUsbzyXMFjdiLwu14qUVDzn4hVlpBl gx9CHLF4HkRtm1uqXdca863EwAARCLq42kHXoiTc6Hq1cMbU+nFfqsIKFZ0xE69pbCyf vHK5NB4PlGn7kmiwnxWrFzgVoNcsZ6ma/6DPnyCGeefwYa83OeVNoD060L1uv0Rzf3Vs pcW2CzE67YNg3b6vWpwEaRdzCGRybDTKFBN3w8rZQQket7kSwWtQLu164iEnicKorFDi 3z5Q== 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=NMhZnwDq2qotNqPmQZZVrp6gVfefOgqlfj5FYdCn0kw=; b=IPZgVLBNdX6syUgNvqS2we5szOlJas3CYItj4cdtW//LtVmT+0EwAM79HmJAaD8uN9 8Hvc70vvvvl6QeSXHSnQaOZa82VfmkR+RT7GjxC7eOCHMJ5bgVdPbDO54EGiMDVpl7Ek 5739e6VCVjlenfl54sjOO1Ji+ZZom9FKj3RnZCaJ/UzuckvGg4I2nGhc+AWfuUiNAQng amMSINwttbNmmaAkVFbtpqGsxLO1kHAT/0v46jqwTL4JZM1rCvcw2a0KgLLxw89C5PYF 0XnB10qwntZiOeLF6R7bxH/V1H75iyobaGDy2MSQ7kRBDi8KbbKUWgIVNRPDACfcRJQX aCrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dUTXGkGQ; 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 j2si1664502oii.195.2020.03.17.06.50.58; Tue, 17 Mar 2020 06:51:12 -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=dUTXGkGQ; 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 S1726760AbgCQNtd (ORCPT + 99 others); Tue, 17 Mar 2020 09:49:33 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:40590 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726189AbgCQNta (ORCPT ); Tue, 17 Mar 2020 09:49:30 -0400 Received: by mail-qt1-f194.google.com with SMTP id n5so17413870qtv.7; Tue, 17 Mar 2020 06:49:29 -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=NMhZnwDq2qotNqPmQZZVrp6gVfefOgqlfj5FYdCn0kw=; b=dUTXGkGQKSMol7XycTuVd8DQ4L9zuSOham+JSFulc/UR+FEK2sbjrW7suHNtwgYHhm +Yab+P3ocuqosksvlhbzsmTlBCts7+5EoPklDLfcs+/QA95HsOWH9Y+WS/ls+vXPBCjE c1bAeqatXWBxEqHlMyetwqIEsZa4cm4vXQ2+wH/w3ar0FKhblPOFkd4e02xWelZy5+uh xe8/XQngc+RDk84yPAzAN8w9sd/4d8X5V0MmLXrVHRYV0UpLBAqEzsePbicAkiMx/N58 zP7My8YsdmQSdKrYebbOzfu+/kklS2CDsQjczMJPbGo0eJ6yht7YB+YGXNMW7M/7+R9Z tqEA== 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=NMhZnwDq2qotNqPmQZZVrp6gVfefOgqlfj5FYdCn0kw=; b=sZ1QpBmGkmqKF1SAhEWVmRPGx20NgL+RxaoSrpPjNi+cjQmDzpiJRIdxt9h5Ankr9U biOMI4EeEqDJSHhWSrltrnebw9Fj6H3bNvq7j9HRvhUI5Z/DioyOZc26bpHkKWyS4VK+ XBPTnLNexkpVcqFcykhRIGh6Mzy7/KsIIfY+zgt3Tn6BcVuGoxxclXb4gUaVjDDcsHPB fTA8d+62LdN4XF8J/hxvESnEuIWiwF5NhKyDb/Ikl9CY87Y2LnZ8Mb+yXCTiZME4Piq5 VRijTc96kwsoqg6+U4XopQPDpNH30n6bJ3dWOf0X5X/TQhHnKb0GbXSj6KEgzGZl+KHM sWpw== X-Gm-Message-State: ANhLgQ2Gvg8t9hS+vadaCk0roaO7DdSKNVbGtUGWPOEyekklwkymMB7R 4083XM8eSPZy108k5BDKrE84OnJNtGzLbT0FzEY= X-Received: by 2002:ac8:1add:: with SMTP id h29mr5566351qtk.258.1584452969030; Tue, 17 Mar 2020 06:49:29 -0700 (PDT) MIME-Version: 1.0 References: <7866e519-80ad-8678-6708-7726a53ea4f5@intel.com> In-Reply-To: <7866e519-80ad-8678-6708-7726a53ea4f5@intel.com> From: Baolin Wang Date: Tue, 17 Mar 2020 21:49:17 +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 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? 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? > > > > 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