Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752671AbdDIVWw (ORCPT ); Sun, 9 Apr 2017 17:22:52 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:34839 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751272AbdDIVWp (ORCPT ); Sun, 9 Apr 2017 17:22:45 -0400 Subject: Re: [PATCH v4 19/23] drivers/fsi: Add GPIO based FSI master To: Benjamin Herrenschmidt , Joel Stanley References: <20170329174340.89109-1-cbostic@linux.vnet.ibm.com> <20170329174340.89109-20-cbostic@linux.vnet.ibm.com> <0e1bcf3a-e8d7-9f50-bdf7-2a1e7466665b@linux.vnet.ibm.com> <1490907014.3177.207.camel@kernel.crashing.org> <93b21624-11fc-b71b-aa78-6cb4371c87ae@linux.vnet.ibm.com> <1491344360.4166.68.camel@kernel.crashing.org> Cc: Rob Herring , Mark Rutland , Russell King , rostedt@goodmis.org, mingo@redhat.com, Greg KH , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Linux Kernel Mailing List , Andrew Jeffery , Alistair Popple , "Edward A . James" , Jeremy Kerr From: Christopher Bostic Date: Sun, 9 Apr 2017 16:22:28 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <1491344360.4166.68.camel@kernel.crashing.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17040921-0052-0000-0000-000001CEC11A X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006907; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000208; SDB=6.00845250; UDB=6.00416788; IPR=6.00623675; BA=6.00005276; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014980; XFM=3.00000013; UTC=2017-04-09 21:22:42 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17040921-0053-0000-0000-00004FCFA251 Message-Id: <5344146a-f450-7959-4688-a83ee022574b@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-04-09_14:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1704090192 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2191 Lines: 51 On 4/4/17 5:19 PM, Benjamin Herrenschmidt wrote: > On Tue, 2017-04-04 at 12:32 -0500, Christopher Bostic wrote: >> Agreed that there is room for improvement. I intend to look further >> into your suggestions from here and our private conversation on the >> matter and make changes as appropriate. I have an open issue to track >> this. As it exists in this patch reads/writes from master to slave >> fundamentally work. > My understanding is they "seem to work if you get lucky with the timing > and fall apart under load". Or did I hear wrong ? > >> Given the pervasiveness and time to fully evaluate >> and test any protocol updates I intend address this in the near future >> with a separate follow on patch. > Please try the simple change I proposed in my email. It's a 4 or 5 > lines change max to your clock_toggle function and how it's called in > send and receive. It should be trivial to check if things still "seem > to work" to begin with. Hi Benjamin, I did try reordering the clock delays from: delay, clock 0, delay clock 1 to: clock 0, delay, clock 1, delay. This worked fine. Making this change also removes the need for having a third delay I had in place prior to sampling SDA when in slave response mode. A 3 microsecond delay is required, however, to prevent occasional issues during heavy FSI bus load stress testing. A 1 nanosecond delay using ndelay(1) had been specified prior to this but after looking more closely at real time performance it turned out to actually be roughly 1-2 microseconds. This appears to be the minimum resolution using the delay() linux libraries on the AST2400/2500. Given this, increasing delay to 3 microseconds doesn't impact performance much considering I can now remove the sample input delay based on your recommendations to re-order the two clock delays. Thanks for your input. Chris > > Do you have some kind of test mechanism that hammers the FSI > continuously ? Such as doing a series of putmemproc/getmemproc & > checking the values ? > > Then you can run that while hammering the LPC bus and generally putting > the BMC under load and you'll quickly see if it's reliable or not. > > Cheers, > Ben. >