Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932869AbdCUPTq (ORCPT ); Tue, 21 Mar 2017 11:19:46 -0400 Received: from mail-sn1nam02on0065.outbound.protection.outlook.com ([104.47.36.65]:61616 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757021AbdCUPTm (ORCPT ); Tue, 21 Mar 2017 11:19:42 -0400 Authentication-Results: cavium.com; dkim=none (message not signed) header.d=none;cavium.com; dmarc=none action=none header.from=caviumnetworks.com; Subject: Re: [PATCH v12 4/9] mmc: cavium: Work-around hardware bug on cn6xxx and cnf7xxx To: Arnd Bergmann References: <20170310132507.32025-1-jglauber@cavium.com> <20170310132507.32025-5-jglauber@cavium.com> <6dc8a2a3-ca79-745a-c716-2188319b9378@caviumnetworks.com> Cc: Ulf Hansson , Jan Glauber , "linux-mmc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Steven J . Hill" , David Daney From: David Daney Message-ID: <67481a9f-f7b5-4ec0-22cc-f6e019dc131e@caviumnetworks.com> Date: Tue, 21 Mar 2017 08:19:38 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: MWHPR07CA0023.namprd07.prod.outlook.com (10.172.94.33) To BY2PR07MB2424.namprd07.prod.outlook.com (10.166.115.16) X-MS-Office365-Filtering-Correlation-Id: c5f10445-8553-4af4-5004-08d4706db1ac X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BY2PR07MB2424; X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB2424;3:w92pv54fL6iyDClp6Hv0Xoeo2uzT8+BrN9Gtjhj1hV/3SeLYNQ2rjMLhK6yq7NnjsOQLYkLkcwW9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uI5qxmy0KIZRXMgjfTqI+Iph+bVESCiLIHxz2nUXeA0c+0uNaexPGJabD9AHIf3K28lbVSum5a9NKBAvG7gXhReVYwKVpsOEs8i74p7nwn5RONxzZpNIKnzV8FMx0h3NQ60aphj5Ge7dxPHTrYX8caJo+8xu6WuYSt7Zl4ZFSdCRu81/wzObVYKdbWVJF8EDqJ//lBUF3eCrBF1HvFLsUOvstHGw2/DmSpwNf/1Iu7oCiKRPemreYw8Ipt8cyHjap2WGAg1OG88Pv2dLgOLz+koso40mQTEl8T8ghDvUe28A0GlqoDGdV0mYkvFpOQX2fR2jvI2Bx0EvXmCAZW/rCoT3RSxi/vI0wS/bjyK7OuFx8pNCLjhDtYjwo13RKa8vNqg91E+6XHBWqqsGXdHbY4sH0w+3fBBo11TX4LqOO+4ufK1ZMkPxZpcTRNQv224we0hWJoeVSxjeHqSmiBiGioUrgX1hcGmkgHnpQnazkk2RBDWGR5aT7skhAlI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123562025)(20161123555025)(20161123558025)(20161123564025)(20161123560025)(6072148);SRVR:BY2PR07MB2424;BCL:0;PCL:0;RULEID:;SRVR:BY2PR07MB2424; X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB2424;4:gh/CDGw3cHozrVIxyizHAC/okgi2lOp091oDibQjFwt9iODIwiuelXw97I+EdWb9uWhGAaZENWCMTPoWAFWAIQJr0j8vItY7/wlsrQHUjhF0vpa9Zw4HkLZG+1WIkTq4HsVpaPJppjK7pAsdw6sb68dSKxV17JC1vv2isDRsJqccVfTdr8cwuuhmz2FcbtQfd+sVebg8Gv4XD0SQWchut+xYyCDIH4Hzav1iVfLExXnws2cjhnu1gO52eaLNpFP2G5rVfH28Nz0lQSepGBKMmjGLoLauW6h12FlJk/t20N+jVCEYD/h+nJNI0XsDlw/u8k3hekISfroWckwmhBbyi2/MziHAvatpfm+Hf1v1Kru9NWKrKU78QhNSlbJLpbcBHZo1PJ8wl1FyaV2h0zVnwW0onm1uZrL9l9VBV9IpDEJZB/K47CV0pl4VaOPGprFb/siXtD08kJ9k82dnnukovaCnuD5elwVu/ilLM8OB4ZqeZe7Mno9UApMuXACtyocSrJgw9fZYop+aJEcEKNZKA65iaRP/fUw8E9O+Szu8DwbAG0f/qzrymKM7UWFKRYJP7IXgY45Pr52JEUZVHqR6A1g85O6G7a76vPHd+J7ZHOo= X-Forefront-PRVS: 02530BD3AA X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(39450400003)(24454002)(377454003)(31696002)(65806001)(66066001)(65956001)(4001350100001)(47776003)(7736002)(36756003)(50986999)(76176999)(305945005)(54356999)(54906002)(50466002)(93886004)(64126003)(6506006)(23676002)(6486002)(53936002)(25786008)(6512007)(8676002)(31686004)(53416004)(33646002)(2906002)(2950100002)(42882006)(4326008)(6916009)(81166006)(6116002)(3846002)(42186005)(230700001)(83506001)(5660300001)(229853002)(38730400002)(110136004)(189998001)(107886003)(53546009)(6246003)(32563001);DIR:OUT;SFP:1101;SCL:1;SRVR:BY2PR07MB2424;H:ddl.caveonetworks.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCWTJQUjA3TUIyNDI0OzIzOkt1ZURMVUt0RjhraklFRTd0WnBZdGM0aEFG?= =?utf-8?B?Zy92SHhrUVZLaFdhbFBtcGhvKzQ3bkhKcTFBNHdUK1Q0WCtOSDQySW54YkNH?= =?utf-8?B?VmFxQ1RIL0I5MFVQTXNIWldzYUpkN2M0b1orcmVmVHB5V0RUaVBROGVQYSt0?= =?utf-8?B?cFBSRC8wREt2aExiK0lHQWlXbmJiTitGVFVwYlRQNnFvQThTR2tzVmYrem5B?= =?utf-8?B?dVNJN3VlSnBlMTVLL1p1eERNZS9neENHamFZSDU4QWRzS1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bcnCyk7z5Qfi9g==;5:ZE5qIZO+w7ggmiuYtiFShlBi81rikU6xUJvP7Bk6KME2MUWnGhZ9X9xICHPgM4lViEYdwuLkBRK10j1KLj5X80OyuacrHCwDi0XfeSOF4GAtWhg5AGfIu2IQMUJHiu8NiQIkdoY2gJRxSSoz8pLTtw==;24:92XZzeGYxWRn0drlG7rxKRBNzTMeBNbUeycKBgxlc9yl/HLAzqsvU19no4SlPAKSEHUo57rcdomNld5l0uSMduTN1cbaaFtUrdTZvwE7a2c= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB2424;7:D3of3l5l6qC9Gg1NZYysjgVEk1SX9sUPoszATmYP7OORGo6u5+Cg2TuZNUa2oq2CvhtucngL3D0v4hA2w3lJG8z9BfkJDLSFxNZWvbGWTol4FOKa5STvkkRo5UiCLDv8DyaQz4a1lN3RJYLEPZmNO7pqeQREDDFXYnAVGyY5ufo++3U2/rTObGF9oRReEUGQaNTX6DRs/a0/kJD0wkgLKKifEnYvJCYZ6S8clFx9hoxYzolpdeDMJgG5iqmxd3l8a4269zmxnbRxT9Wyrvacc3EIFnw89WXHp2c3jKKfyB6KbNBMvrW40urJ8uL58LoEi9DJJ4N/vZFnIEdg24Pp0Q== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2017 15:19:39.6205 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR07MB2424 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1781 Lines: 34 On 03/21/2017 01:58 AM, Arnd Bergmann wrote: > On Mon, Mar 20, 2017 at 9:45 PM, David Daney wrote: >> On 03/17/2017 07:13 AM, Ulf Hansson wrote: >>> My point is really that we should avoid exporting SoC specific APIs >>> which shall be called from drivers. This is old fashion. >> >> >> Some people find it objectionable to see 1-off architecture specific in-line >> asm in a driver file, but I agree that putting it as close to the user as >> possible makes sense. > > The proper solution might be to create an architecture independent interface > for it, what it is that the function does. Can you explain what the purpose > of locking/unlocking the cache line for MMC is? Is this something that > could be done more generally in the dma_map_ops implementation? It is a 1-off erratum workaround that is only needed on fewer than five models/revisions of a mips64 based SoC family. As such, creating a general purpose, architecture independent, framework is clearly not the proper approach. This is a problem that effects only the Cavium MMC bus hardware block as implemented on a mips64 based SoC. The arm64 based SoCs do not have this problem, and and future users of the block will also not contain the erratum. That is what it is. At a high level, its purpose is to eliminate data corruption when doing DMA write operations to transfer data into the SD/MMC devices. The specific details and RTL code for effected SoCs will not be made public. It should be enough to know that the 2nd-to-last cache block of a transfer must be locked in the L2 cache to ensure reliable operation on DMA writes. This is not some empirically derived workaround, but rather it is based on a well understood root cause of the failure case. David.