From patchwork Tue Oct 17 07:30:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 10010951 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8EB3560211 for ; Tue, 17 Oct 2017 07:34:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 80C49286A9 for ; Tue, 17 Oct 2017 07:34:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 75ADA28716; Tue, 17 Oct 2017 07:34:26 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham 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 F13DE286A9 for ; Tue, 17 Oct 2017 07:34:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933057AbdJQHeY (ORCPT ); Tue, 17 Oct 2017 03:34:24 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:20302 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933031AbdJQHeU (ORCPT ); Tue, 17 Oct 2017 03:34:20 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie2.idc.renesas.com with ESMTP; 17 Oct 2017 16:34:18 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 4E6B8465A9; Tue, 17 Oct 2017 16:34:18 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.43,389,1503327600"; d="scan'208";a="260764980" Received: from mail-pu1apc01lp0017.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.17]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 17 Oct 2017 16:34:17 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=51kxPCAbIKCoeZmOKz5heNP+O2PCaudzED8lcDtjYE4=; b=a0tHqnW3bLFfjcyQsYDh52cWBVusQEGiMIERhn64UtNIT9cU4nsW9Kiu2Xbf8HvfTvcjdNfagoNFn/pwNofigrW+6Iaor9520Y8A+buC8Bq4AXdnaRjds4o/TosAXsdm8+j9ibaYV7ExYQPlqB9OY+I2P5hw0ip5+rSqmWDDIzs= Received: from localhost.localdomain (211.11.155.138) by HK2PR06MB0979.apcprd06.prod.outlook.com (2a01:111:e400:589d::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Tue, 17 Oct 2017 07:34:14 +0000 From: Yoshihiro Shimoda To: wsa+renesas@sang-engineering.com, ulf.hansson@linaro.org Cc: linux-mmc@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Yoshihiro Shimoda Subject: [PATCH 1/2] mmc: renesas_sdhi: fix swiotlb buffer is full Date: Tue, 17 Oct 2017 16:30:20 +0900 Message-Id: <1508225421-25405-2-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508225421-25405-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1508225421-25405-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.138] X-ClientProxiedBy: SG2PR06CA0102.apcprd06.prod.outlook.com (2603:1096:3:14::28) To HK2PR06MB0979.apcprd06.prod.outlook.com (2a01:111:e400:589d::25) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c21f39aa-e5ec-4b4b-6b03-08d515317800 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081); SRVR:HK2PR06MB0979; X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB0979; 3:9NGk4Uft8AvxOUGVnGqhXCkr5mOZsnZYmrPztag7RX4FeUcgcz4Yy/YIlmgYaYkjzV6xPjsE8cc440f1nd1CkjXjH4HKVPH7nrK+2s3w+IjhurNeISk4zEnfo33U8fkEpQJIO9Rq6M63ZOBti5paknQ69UwyNO3Yxjsy6xqJarJXpS7mpNTXpF/uLgSED7t53lHjWbbP5I3rhUouJvCiM54rUpC4RAYS5PTb31p90odvXO21MpzkcZUqhqBH1+x/; 25:+qfEs2r8LJIc4N8LlCYJ/m+3GjQX6L4Yc+yZbby/xMDKuz8UpbCMuFniQmL9mMLbwzsC/lfmDfCvQk0hGYxV2STGcthZHhFNI2XEyXIlIB/oNSW8Ydo4kkU9ghf/JxNYW2LRH+DPPNhKBy2N1dgowGoCW4UAGGFqsR4khRqLBvImuN045VE9wOODkdjHHSV8tDSl6UHODr1Dk7cHlotcxZ8UK8wWMyaBQEhRgPA4UQ27LF3Lf+D9rs692exMIu+3BIsytuRhijaavuvJRxcog0NkootQCohUrRYJn/Rz4gJ07gxqXLP/EByRfEFebI9vRKI7Xw+2N1XkWq3KpuA68Q==; 31:++PAmAMqOyfhYSG5rFbPVT2lU6Yv5GLlZvky8vQVYer0si+tFknbskjIoYx5yMp/kH2YKJudqwISamsBzocailYuJnCLmVNa/Y4bEuW2dYwiwE3WiSIbeo6O9+76Q+j2fRUYo5iynKCOi1ICFaOTFK80gTeoDEn+nirXsrSOnf8pdcy/5Q489daTyoVH6AXRCpyNdJ8AXbjkVImT/+OJf8QGZEpQxaoHSxUbK26/0oc= X-MS-TrafficTypeDiagnostic: HK2PR06MB0979: X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB0979; 20:dvdP7OXlRobGFg3m9PtLiY7n3Z6NRNZ+uilL9SIQUcteki7s8WzFqcZOWAr1vB2GzpN3ZLiWXF01DzVYK9BaxMjyk1JnZLsUbB9FXZ1mO8BPzwr4dja4FkZ8QssRqDxAfTJ6RVTe++f6oVglETF+fI1BRcNXVIs0CEt9xop5tc1Yhe0TRzbGlqx1Zg4M9W9Qm/TtBiyMk4t7B1DrhyPvViYHWQDI7TedxF+qFwgaECKJx2d/5QvJhn6AvXpqF+GOs384O3kzyZHMQeXUrP+CY62zjvzL7c9mkg6IEa3frTSEkb6L+tOFZzcwWN4UKbT+0V3vSv5IBf+kQF8+HeqnASto4DIiugs7y5aMxTsX4MmzTqe3EDeJGdTcSK9nynoD7jl1VPF9y6sgLug706u9nf/4HFSY08/xr29kK9STrYC3SDMeb6levZZy0SAwmzdpV1Kur0hH255FU9G9WvH/6d/PeGt5sC66cnSgQ1jFFgJtI7knLkmsmiZml3if3XnV; 4:cFwmpubrw/khuemalCadd8z8Vqmfa/bo78v9MrGwyC/bgqQ2Tex1lCZxrrkZ+IznKq1uKFDqDWKZ2xNN4867GKePvfBf2Mzn0WIjyCEKR8kTVrcIw3oYTbwHf10KKiDjd3DCuiegtcGqwnwlJdn5s9WlUZyrs+QJXGL0vMz29H6TqL3go9kTqCL01uMZ1SzDKJyGjC+gUrfLItSmB2HeoI0SuIqgl3AsVNrebJljdthEcoOqiCMlRI4TKGK+eykD X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(10201501046)(100000703101)(100105400095)(93006095)(3002001)(6055026)(6041248)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061750153)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HK2PR06MB0979; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HK2PR06MB0979; X-Forefront-PRVS: 04631F8F77 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(6069001)(376002)(346002)(189002)(199003)(42882006)(2950100002)(5660300001)(66066001)(76176999)(8676002)(101416001)(68736007)(50986999)(305945005)(50226002)(33646002)(189998001)(105586002)(6116002)(4326008)(3846002)(47776003)(498600001)(81166006)(81156014)(6666003)(78352004)(7736002)(6486002)(106356001)(36756003)(25786009)(6506006)(50466002)(16526018)(48376002)(316002)(16586007)(2906002)(97736004)(6512007)(107886003)(8936002)(53936002)(5003940100001)(3720700003); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR06MB0979; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:0; A:0; LANG:en; Received-SPF: None (protection.outlook.com: localhost.localdomain does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HK2PR06MB0979; 23:WKbxBN9I0Nvc8MfksFD8jt9lvbxlOh15e15JDRysy?= =?us-ascii?Q?92nDUIGoqoqLxFbUCsXoffyXXpaz2cJU1eTuTmeKcs13Czp70QmsOHsHRKeK?= =?us-ascii?Q?4tBGNChUQ9GoZ8XwBxEOfu0n5BiBGUF6/WTEVMehZONYm6beoZx2wDjG4PKN?= =?us-ascii?Q?0Iy8qUMV8MxEn9NS19owmilXMwQbuOIMvzb0HvO8vjsN21zG1q02YnRq5xJW?= =?us-ascii?Q?g1Ctb+jlaDfUHgxUYBrIam8pCUO09KNHLPQInP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?Q?weMXVS5PIk=3D?= X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB0979; 6:Dpau9duHYB5jsqidVyZGfisOgRF+8GUctmCZV3eDZZXsDbknja6Mr1vCRNK0wF9RwxsYoSNs3A2iQOQHVlJx82g2fCcp89IgchXRX6Ek8SiUFBx/qwY/2xJMdaC/br3MXv4BtzniJwbMMWi0AaWSc8DTSHeG0s1uWon3yG4P9XaLsqc5B8gourht4YiOpErChn5W1R7K7rvCpgLy+3+zTF179ET09xMdGW9i3cOmFkrfs6dhrNwRBm9q4pzEL70H8FTg9dj5d8duXI34y4D9XBrGjD7YpBkyMtDIc0fbtnJVP4PpfRwG/iaX69XZz0e7W9pLzSvBHG8PEF2n7neEKg==; 5:WQyRNWQUEaMU7znY9K/nZ+h8ljLN+0P0RmprRGNlh3KJtFFHE7C85UKxb9y7eEx23QhluNTHWlC4xa+R+o5BuadwRiZ4B+xF+PgzcM6HavYsHxX9e5KH1rZ6ocGoTzMnkA0tIeUuNaq2heZgMkbEv8KatXa439IBnd2JrnM/gm0=; 24:5SCbIAf9hnuV2ng99hHqWH01Pjv8ZiUs2SnCtMEMdaDLhihHjnjHy4TFZkzu7BkDHHQ9VWspYv0G/hC8l4iggoJRPPkJZa7xOgZ3m2lBX+M=; 7:QOLjfQrqMgvdih4L7zl+xWrUSAOQJp+ta2j60oDmXbAifEYuICJfz1KImUNldKp0OmvtsxHs89i9Kvn65uz44d/i7b4I/d8laQ2kqxcy3P4PcnerKekQ2JaaW+YDDOhvO1ijJaeCN+A9t3mAf58Od/XXmz0q4cXI8TlmC4Qu+sYBqteL/pVGYDEwTrYk6FBwIF+mJEG/TtrJ2DalbzVGD3DMyPjTE6Z6WcjeJH0wvhQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB0979; 20:vIfynPI3zBiQnx9KPPVPwK3J2QDq15u1zGiE+PPd9wbU9lU19NunpAfcggL+j22imsR/07goWAa1pTKsDQaA0ZGogi6ir+oFKgNaR7asgxOi6FHehL6Oi+j/MgdAhZ+JIMsiDJNd3wY0ENrIr271o8/PHi84VqxNkYNGqi+tIL8= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2017 07:34:14.5854 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR06MB0979 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 Since the commit de3ee99b097d ("mmc: Delete bounce buffer handling") deletes the bounce buffer handling, a request data size will be referred to max_{req,seg}_size instead of MMC_QUEUE_BOUNCESZ (64k bytes). In other hand, renesas_sdhi_internal_dmac.c will set very big value of max_{req,seg}_size because the max_blk_count is set to 0xffffffff. And then, "swiotlb buffer is full" happens because swiotlb can handle a memory size up to 256k bytes only (IO_TLB_SEGSIZE = 128 and IO_TLB_SHIFT = 11). So, this patch fixes the issue to set max_blk_count to 512. Then, the max_{req,seg}_size will be set to 256k bytes. Reported-by: Dirk Behme Signed-off-by: Yoshihiro Shimoda --- drivers/mmc/host/renesas_sdhi_internal_dmac.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c index f905f23..6c9b4b2 100644 --- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c +++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c @@ -80,8 +80,9 @@ .scc_offset = 0x1000, .taps = rcar_gen3_scc_taps, .taps_num = ARRAY_SIZE(rcar_gen3_scc_taps), - /* Gen3 SDHI DMAC can handle 0xffffffff blk count, but seg = 1 */ - .max_blk_count = 0xffffffff, + /* The swiotlb can handle memory size up to 256 kbytes for now. */ + .max_blk_count = 512, + /* Gen3 SDHI DMAC cannot handle scatter-gather. So, max_segs = 1 */ .max_segs = 1, };