Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp568896ybe; Thu, 5 Sep 2019 02:23:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwzVDM8DCvZWiCAf1QygftuzSvWAE2t02tIEsVleVwHn9kgKJj2IqcPq7zCsfFihjlAM/J8 X-Received: by 2002:a65:51c5:: with SMTP id i5mr2244158pgq.312.1567675423685; Thu, 05 Sep 2019 02:23:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567675423; cv=none; d=google.com; s=arc-20160816; b=qdMoZvNnC3LsfROD/V1fw35Bo/ONLGxc7dMbMzrNgi0WU3Ckpsy1e8Y9tYGyzwyh8V aKp8mbRj9BUal4NCn9roTX80HNuzDZXykqumvOrsQYwQdtb88b6T6gF6FFvbKpHEtihK Wi6egdYG4j8eunkeb5kwpWh1i2RZ5GK7hjHBiTylRjrFJsHGyj60vP22xyMSJBaicDIE azsMjmR7pS0ja1GQQDeCLyPnEv3Y0Cf0Do/qGv7pRbeK5BaHJClFyIzlqZYA+vl7Xair RpGCZwwLGKAZnhmbHBl+xFCTQ413x7u0a147fwymY04WYRDXDi0eE+7zB9+2wF1xmALJ Ufwg== 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=gRlpwW1Ynq4TXZgniSdJLobG6yoAS63J0P04j4ijkFY=; b=eIrGUxlOjZG1G2g5G3pinbV6Rcn2692C0NHmqm1FPSf7997Cc6R4UiPZQyGTo/nKg2 syp04kaYuxn/86fcAWWlfFmg4fN/wNWp1522yD5JkR3TNTtROs7hLuH477GnNp0kY08y UCMxt3Z5zOvoXCOud3uhq3mc8IT+ibxdyFvU7CYektTasXhS4LoqPr7O95m9aePIJAEd YX36DxRh+u+i3E2Ck1izr8Mye7prqwNV7GhLiBhRweQjox293a+e8vvJd7S+4AX8/Igh 4rzj788/MrTk2ZBe+U6FX3TS8SD/VHJbko5M0juX/c8ynR0s6NhPoCgSSya6KhEUzqu6 Gm/Q== 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 n9si1272625pgp.338.2019.09.05.02.23.23; Thu, 05 Sep 2019 02:23:43 -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 S1732337AbfIEHx3 (ORCPT + 99 others); Thu, 5 Sep 2019 03:53:29 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:43556 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729366AbfIEHx2 (ORCPT ); Thu, 5 Sep 2019 03:53:28 -0400 X-UUID: c510fcd413834ba6bf1fd53ee9a77ea9-20190905 X-UUID: c510fcd413834ba6bf1fd53ee9a77ea9-20190905 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 932262458; Thu, 05 Sep 2019 15:53:22 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 5 Sep 2019 15:53:19 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 5 Sep 2019 15:53:18 +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: [PATCH v2] fix device in programming state after ioctl() Date: Thu, 5 Sep 2019 15:53:16 +0800 Message-ID: <20190905075318.15554-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 v2 vs v1: base on Avri's comment, drop the ioctl_rpmb_card_status_poll() 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 | 150 +++++++++++++++------------------------ 1 file changed, 57 insertions(+), 93 deletions(-) -- 2.18.0