Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp381279ybe; Wed, 4 Sep 2019 00:56:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqxz+LRNO+qFZJGFScqsr9ORmFpCejo0hiW8Qbhg/cTNmVBJQShO/zY7DJVjxJkvQ9zBOEjr X-Received: by 2002:a62:1d57:: with SMTP id d84mr6868457pfd.99.1567583765628; Wed, 04 Sep 2019 00:56:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567583765; cv=none; d=google.com; s=arc-20160816; b=mh6k495y+yfM/D5QDVUdKeDRLfdbTyV7rJ2XInXd0v8HNvyRGTajc7TvaIyqliSdoh hMXM7uIozpYAjb0tM/E6T6t0MW5Uo8ITKA7+3yltdaXlg3pu8abk6isebDeMpf5ssUFr EYX+uSoeNSecydR0W3WYLyHboBIErJyyd1u+lt1x4vj6c+2GzA6ny2G6wus24osJ836D JrZ8zisxF1nNmV9vxToYmiR9R8F8GQng6TSzSgJnEWLnZdLvjQI0upLdngami8cFuNVr wbShN5KGa93C0Cs+LxLrf6e/GqzQDyfuCI8HsN7tJKP73Huj73fH7mmnFwFPzUD3upb3 W6NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=HVAiWveBlTPQx1QctPkhkLiwTgHpLBtSzZBHSUrmwEU=; b=nEavLbrSSQAcDzfkIzyKAc9/kKHfJhe61qvNCuNElBLDVwY3UWxdO3LGEtVc42UNGx bUZQ78Db1JBnKGw/0/kyGRWnhvqTVWiO1f55W3Qcu05KbGSOaeY0sELV15GAjUKxYGGL rrd7y8Vz5zOdw7U3KvT7/xdU4aACjkGj9zuG2/ZKNAneCKXWqAbTss8/OBteDM8G+Asg Ge+mpb0zJjNm3/snlm89BrE8wgqikWev+Ie/MNXFIw5Y7Pmagp47daAKqJFXPsTzQjQd Qt4ICbbyO1usDLtOhPYhkNhiHtL/iPswBh4Wm8qWRRqFMfMd4DCfvG+42cgHCCAPZgcG +KSg== 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=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si16922665pgu.504.2019.09.04.00.55.50; Wed, 04 Sep 2019 00:56:05 -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=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729304AbfIDHy5 (ORCPT + 99 others); Wed, 4 Sep 2019 03:54:57 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:6610 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728526AbfIDHy4 (ORCPT ); Wed, 4 Sep 2019 03:54:56 -0400 X-UUID: 1efd1c7eb3e042c095d333210c7fff4b-20190904 X-UUID: 1efd1c7eb3e042c095d333210c7fff4b-20190904 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 322975283; Wed, 04 Sep 2019 15:54:50 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 4 Sep 2019 15:54:46 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 4 Sep 2019 15:54:45 +0800 From: Chaotian Jing To: Ulf Hansson CC: Matthias Brugger , Jens Axboe , Hannes Reinecke , Chaotian Jing , Avri Altman , YueHaibing , Wolfram Sang , Ming Lei , Chris Boot , Zachary Hays , , , , , Subject: fix device in programming state after ioctl() Date: Wed, 4 Sep 2019 15:54:42 +0800 Message-ID: <20190904075444.2163-1-chaotian.jing@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org the user space program may access eMMC by ioctl(), after the ioctl() was completed, it should ensure that eMMC is in transfer state, or it will cause other thread which access eMMC got timeout error, as it assume that card was in transfer state. this patch add CMD13 polling for R1B command to avoid this issue. Chaotian Jing (2): mmc: block: make the card_busy_detect() more generic mmc: block: add CMD13 polling for ioctl() cmd with R1B response drivers/mmc/core/block.c | 111 ++++++++++++++++++++------------------- 1 file changed, 57 insertions(+), 54 deletions(-) -- 2.18.0