From patchwork Tue Nov 20 23:08:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 10691393 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 B7A4113BB for ; Tue, 20 Nov 2018 23:08:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7411289D3 for ; Tue, 20 Nov 2018 23:08:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B53F2A9C6; Tue, 20 Nov 2018 23:08:44 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C45B52ABCE for ; Tue, 20 Nov 2018 23:08:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726790AbeKUJkS (ORCPT ); Wed, 21 Nov 2018 04:40:18 -0500 Received: from sauhun.de ([88.99.104.3]:58272 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726021AbeKUJkR (ORCPT ); Wed, 21 Nov 2018 04:40:17 -0500 Received: from localhost (p54B3346D.dip0.t-ipconnect.de [84.179.52.109]) by pokefinder.org (Postfix) with ESMTPSA id CFB354C0E9C; Wed, 21 Nov 2018 00:08:37 +0100 (CET) From: Wolfram Sang To: linux-mmc@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Wolfram Sang Subject: [RFC PATCH 0/3] mmc: refactor RPMB block count handling Date: Wed, 21 Nov 2018 00:08:29 +0100 Message-Id: <20181120230832.1840-1-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.11.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Renesas R-Car SDHI hardware, we sometimes had timeouts accessing the RPMB. This is because AutoCMD23/12 features needs a properly filled sbc to work correctly. But RPMB sends an individual CMD23. I could have fixed the driver but after some research concluded that fixing the core seems the proper thing to do. I also added some sanity checking while here. Please let me know what you think. Tested on a R-Car M3-N. No timeouts showed up anymore. I'll try to improve the testing, though, to check if I can make the occasional timeouts from before more reproducible. And then confirm that this patchset improves the situation :) Wolfram Sang (3): mmc: core: validate user input for RPMB block count mmc: core: use mrq->sbc when sending CMD23 for RPMB mmc: core: remove obsolete mmc_set_blockcount() function drivers/mmc/core/block.c | 14 +++++++++----- drivers/mmc/core/core.c | 14 -------------- drivers/mmc/core/core.h | 2 -- 3 files changed, 9 insertions(+), 21 deletions(-)