From patchwork Tue Mar 19 09:12:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Lin X-Patchwork-Id: 10859141 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E6B4C15AC for ; Tue, 19 Mar 2019 09:15:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C17BD295DA for ; Tue, 19 Mar 2019 09:15:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF2D228BF8; Tue, 19 Mar 2019 09:15:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_WEB autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 61F7328BF8 for ; Tue, 19 Mar 2019 09:15:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=cLtVJVtvwTCJEPGyXp4ph7J5sfyafXzbLxtwsfJuchU=; b=Qwi vcg1NRiuLtropEbRtmp4cap1xaSjYTcltcmde9L8cvz74N3gbxjM+cQ5OWn3gd6ORWzglQ8c8fchN brShu3O7HaGGi8lKPOb5JpHe7J7oIWH2px6tGCnGDqJtANr6kUSEVmMkEksklTFt3lXw67M3yy3QX 88ICfO56ItiMve8g6CdT5zxiG00JXGneIAoAgAnoO2VoVOHlnNwErWZ8QBU8VJyBh03xKrHUBhCnk NiJZG8R4xcMt6WHDol0rS6GpxlIsi1Akr6mtf7P+9VRDFaC0foJtY4b8TyjlVYAR6Ul8YgvEHU0Vo /ddgAn5v7UypWw0JUJiDa5MNj5T+izw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6Apl-0008Md-NK; Tue, 19 Mar 2019 09:14:57 +0000 Received: from lucky1.263xmail.com ([211.157.147.130]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6Api-0008Ch-Ce for linux-rockchip@lists.infradead.org; Tue, 19 Mar 2019 09:14:55 +0000 Received: from shawn.lin?rock-chips.com (unknown [192.168.167.230]) by lucky1.263xmail.com (Postfix) with ESMTP id 2CD9B55DF3; Tue, 19 Mar 2019 17:14:48 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P5590T140485355104000S1552986885594231_; Tue, 19 Mar 2019 17:14:47 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <7f8e08fd86dc6a810387c8b248d814f0> X-RL-SENDER: shawn.lin@rock-chips.com X-SENDER: lintao@rock-chips.com X-LOGIN-NAME: shawn.lin@rock-chips.com X-FST-TO: jh80.chung@samsung.com X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 From: Shawn Lin To: Jaehoon Chung , Ulf Hansson Subject: [PATCH v3 0/3] Add hardware unbusy interrupt support for dw_mmc Date: Tue, 19 Mar 2019 17:12:55 +0800 Message-Id: <1552986778-33904-1-git-send-email-shawn.lin@rock-chips.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190319_021454_612764_DB3F7161 X-CRM114-Status: GOOD ( 13.22 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rockchip@lists.infradead.org, Shawn Lin , linux-mmc@vger.kernel.org, Douglas Anderson MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP DesignWare MMC controler lacks proper hardware wait busy support, so the software must check the busy state if the following tranfser need use data line. And dw_mci_wait_while_busy() now use busy check mostly with host's lock hold, and we can't relinguish CPU at this moment, which makes it rather painful when used in low-end platform. To solve this, Rockchip invent a new hardware unbusy interrupt module, which could generate interrupt if the state machine runs from busy state into idle state. Changes in v3: - remove unused irqflags and check hw_unbusy_int in dw_mci_wait_hw_unbusy() as well. Changes in v2: - add tag from Ziyuan Xu - remove lock for checking event since it's already atomic operation Shawn Lin (3): mmc: dw_mmc: Check busy state in dw_mci_request() mmc: dw_mmc: Add hardware unbusy interrupt support mmc: dw_mmc-rockchip: Enable hardware unbusy interrupt support drivers/mmc/host/dw_mmc-rockchip.c | 30 ++++++++++++++++++++ drivers/mmc/host/dw_mmc.c | 56 +++++++++++++++++++++++++++++++++++++- drivers/mmc/host/dw_mmc.h | 6 ++++ 3 files changed, 91 insertions(+), 1 deletion(-)