From patchwork Tue Apr 14 16:13:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 185402 Delivered-To: patches@linaro.org Received: by 2002:a92:3d9a:0:0:0:0:0 with SMTP id k26csp1601384ilf; Tue, 14 Apr 2020 09:14:18 -0700 (PDT) X-Received: by 2002:a2e:914c:: with SMTP id q12mr576459ljg.124.1586880858672; Tue, 14 Apr 2020 09:14:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586880858; cv=none; d=google.com; s=arc-20160816; b=FWHapXZ8cfXv8tIxeaEUV/fGrzUrzjI3bOz3d1hRCYeqv7BtttKJ5W8aSZbfrJH4HG XsbQDrzgI8GSyDOdrNGc9vxfoS27ofW8B4y333g90dFkiraLgfcEpPdYuwgG6Ui2JOd9 zMLgwpduxE5/Yj5WLjFrUmSv7GD0mj9FV2/rvPSsZ9YMnhE2e8dJdkDa6og2SxfF7G0W JJY2Cn0MO7UIVZdlBhJuNcqmgEyPaEJ2xwSw9gcC0kotGgq58l/TgUfs2jkfT6r/RX9Y /0VwGoGNskq5RKWyJl1k2dttxEuS9PBuJFPU86aQcU8uanWQGoDG2rtBjOcLSNKtt7N7 vQ4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=ofxdCuIxfi4VwJPFI7E0O8iIllI/SqzGq8DUbhk0hrk=; b=beA6ecv16+2BXY97hVV0juEpXOYS+QsGPT6CHAZX3YEsyqfguoFbkIDT4Jtw/6Edct q6OeEsnkgqzcI2BnyUL7Ij3eGh61gBbbVXZHbxnc9fR7i3Jv9Gd9b2ZQKWUmOaJv6mwV SgY5rIh2W0ttf5rk2b6IZy9HArz3zuRzW9LI8jkjFNg4ZDXZAkEOspfco44aF+bRi6ZQ dFjhcKg+zif252CWs3xLWf0Js/OJdOCb7BgKE94FSWbIakwf0+wz1tDR34TEVTWPaAJC a4ptjaAR49dPFkAyo/lg/Z2xuMmzpJ+ohT+ebHzek7ls7A/ZEuDM8bdrkpztgpafRcpV rDtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LPbdwnKN; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id e9sor7827900ljn.15.2020.04.14.09.14.18 for (Google Transport Security); Tue, 14 Apr 2020 09:14:18 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LPbdwnKN; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ofxdCuIxfi4VwJPFI7E0O8iIllI/SqzGq8DUbhk0hrk=; b=LPbdwnKN8ICt++aO2TSsqXjSmIsgZx7GP5D+L4sm+2RIPp445kkQREv2PMMftCypeu LDVJWEZmYU72XKyNATVLPQ+BZRT/JylxEE9UTW4qatoq0MSymq1CsCKIXcJtzDGuW9Ij igGYn0k4+6P+Wcct2yF8qo8S6thWMuM/oKdfkICOYa3/t/UzglVXAxtMQJ8pOWimv36t mkJkofrmc0NtK2cgkfvLrnDiHvlgs39D0f5w68yqYhpoWzPAY8r9jqzStGYoZJaf6nS6 UJZdvwZZDghg9wnTHAJuHgfMVZ5GeRb67fnbomElhioBH0CnQCNvtB654b/o2vG9wRHJ R6zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ofxdCuIxfi4VwJPFI7E0O8iIllI/SqzGq8DUbhk0hrk=; b=h8a3Z0mtebUZ+tT0mKe48I7bzoJRV2aPEJz0d4gcDVmo42Et0g7rUYAswVKbLiLmwJ 4PiW6kRHSnteGFqxB/GJ1RGp0aeI2km/LNiFhHK+ytaB3bhfkvrgNPrznnhK2ami3iys bhWqBhxaHKZG3A+/VImHG0MEp97HbuobJkIE9AkoIIaN6YQovl3qiXt1cQ7jNSD7mtbR Dyv9yN+lQRFVPdgTTWwMbnmxftt0PAC9ryJWUx00tCbmFvZXjc1Zbv+5LN2PW9alCFf9 0tNOyWULcQQsayvI5zdCvR5DADcUacPFjahvBZaGm9QE07GDjV8HWNQB8fiZUhZV4KLl xS1Q== X-Gm-Message-State: AGi0Pub6wSUeZjMAPPLQvp1D2Jw+RSsLg94ftBL/Tdp3QDLM9YDJeANL HwhV1xIBrQ69fqCNlslO0+4hcv6m X-Google-Smtp-Source: APiQypL1hB/Tm7z9X3vfM2HUhIoic0WefEK/E3+ekVGuAtxgBpx3HI7aGlXaGUqgzPQFhsDVzPNB8w== X-Received: by 2002:a2e:9b41:: with SMTP id o1mr558595ljj.145.1586880857969; Tue, 14 Apr 2020 09:14:17 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-98-128-181-131.NA.cust.bahnhof.se. [98.128.181.131]) by smtp.gmail.com with ESMTPSA id a26sm9330669ljn.22.2020.04.14.09.14.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Apr 2020 09:14:17 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Adrian Hunter , Linus Walleij , Rui Miguel Silva , Johan Hovold , Alex Elder , Greg Kroah-Hartman , =?utf-8?q?Jonathan_Neusch=C3=A4fer?= , Bruce Chang , Harald Welte , Alex Dubov , Sascha Sommer , Manivannan Sadhasivam , mirq-linux@rere.qmqm.pl, Jesper Nilsson , Lars Persson , Paul Cercueil , Ludovic Desroches , Nicolas Ferre Subject: [PATCH 00/19] mmc: Improve host driver's support for R1B responses Date: Tue, 14 Apr 2020 18:13:54 +0200 Message-Id: <20200414161413.3036-1-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Some MMC/SD commands uses R1B responses, which means the card may assert the DAT0 line to signal busy for a period of time, after it has received the command. The mmc core normally specifies the busy period for the command in the cmd->busy_timeout. Ideally the driver should respect it, but that isn't always the case, for several reasons. For example, the mmc host may not even support HW busy signal detection, the HW may have a build-in upper limit of the timeout and the driver simply uses that or it uses some other internal command/request SW timeout mechanism with another timeout value. In cases when the host driver can't support a cmd->busy_timeout, the core implements a fallback method, which is based upon sending CMD13 to poll the card about the status instead. However, to make this work, the host driver need to specify the mmc->max_busy_timeout, as to make the core aware of when to use the fallback method with CMD13 polling. Step by step, host drivers has been improved to better cope with the above scenarios. Although in this series, I have walked through *all* host drivers and those that looked particularly suspicious I have fixed. Note, none of the changes has been tested on HW, so I am relying on help with this. The next step beyond this series is to make MMC_CAP_ERASE default enabled, as that would trigger CMD38 to be used. CMD38 uses the R1B response and may typically require longer busy periods to be supported. Kind regards Ulf Hanssom Ulf Hansson (19): mmc: atmel-mci: Keep timer enabled when queuing a next request mmc: atmel-mci: Set the timer per command rather than per request mmc: atmel-mci: Respect the cmd->busy_timeout from the mmc core mmc: jz4740: Inform the mmc core about the maximum busy timeout mmc: usdhi6rol0: Inform the mmc core about the maximum busy timeout mmc: cb710: Inform the mmc core about the maximum busy timeout mmc: owl-mmc: Respect the cmd->busy_timeout from the mmc core mmc: sdricoh_cs: Drop unused defines mmc: sdricoh_cs: Use MMC_APP_CMD rather than a hardcoded number mmc: sdricoh_cs: Move MMC_APP_CMD handling to sdricoh_mmc_cmd() mmc: sdricoh_cs: Drop redundant in-parameter to sdricoh_query_status() mmc: sdricoh_cs: Throttle polling rate for data transfers mmc: sdricoh_cs: Throttle polling rate for commands mmc: sdricoh_cs: Respect the cmd->busy_timeout from the mmc core mmc: tifm_sd: Inform the mmc core about the maximum busy timeout mmc: via-sdmmc: Respect the cmd->busy_timeout from the mmc core mmc: mmc_spi: Add/rename defines for timeouts mmc: mmc_spi: Respect the cmd->busy_timeout from the mmc core staging: greybus: sdio: Respect the cmd->busy_timeout from the mmc core drivers/mmc/host/atmel-mci.c | 12 ++-- drivers/mmc/host/cb710-mmc.c | 8 +++ drivers/mmc/host/jz4740_mmc.c | 13 ++++- drivers/mmc/host/mmc_spi.c | 20 +++---- drivers/mmc/host/owl-mmc.c | 8 ++- drivers/mmc/host/sdricoh_cs.c | 103 +++++++++++++++++---------------- drivers/mmc/host/tifm_sd.c | 9 ++- drivers/mmc/host/usdhi6rol0.c | 9 ++- drivers/mmc/host/via-sdmmc.c | 7 ++- drivers/staging/greybus/sdio.c | 10 +++- 10 files changed, 125 insertions(+), 74 deletions(-) -- 2.20.1