From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9473 invoked by alias); 2 Mar 2013 18:08:35 -0000 Received: (qmail 9442 invoked by uid 22791); 2 Mar 2013 18:08:33 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from hagrid.ecoscentric.com (HELO mail.ecoscentric.com) (212.13.207.197) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 02 Mar 2013 18:08:28 +0000 Received: from localhost (hagrid.ecoscentric.com [127.0.0.1]) by mail.ecoscentric.com (Postfix) with ESMTP id E5A49151A06C for ; Sat, 2 Mar 2013 18:08:26 +0000 (GMT) Received: from mail.ecoscentric.com ([127.0.0.1]) by localhost (hagrid.ecoscentric.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kB1N6LQ-uTO6; Sat, 2 Mar 2013 18:08:22 +0000 (GMT) From: bugzilla-daemon@bugs.ecos.sourceware.org To: ecos-patches@ecos.sourceware.org Subject: [Bug 1001397] I2C driver for Kinetic microcontrollers Date: Sat, 02 Mar 2013 18:08:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: eCos X-Bugzilla-Component: Patches and contributions X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: mjones@linear.com X-Bugzilla-Status: NEEDINFO X-Bugzilla-Priority: low X-Bugzilla-Assigned-To: unassigned@bugs.ecos.sourceware.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://bugs.ecos.sourceware.org/ Auto-Submitted: auto-generated MIME-Version: 1.0 Mailing-List: contact ecos-patches-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-patches-owner@ecos.sourceware.org X-SW-Source: 2013-03/txt/msg00006.txt.bz2 Please do not reply to this email, use the link below. http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001397 --- Comment #40 from Mike Jones --- Created attachment 2112 --> http://bugs.ecos.sourceware.org/attachment.cgi?id=2112&action=edit Control clock rate, fix race condition, bug fix This patch contains new code for managing clock speed that was added by Ilija. He can provide a ChangeLog for that if desired. I tested/modified his code and fixed bugs. There was a race condition that caused the driver to lockup if bits were not set/cleared at the right time, and a few other small things. I don't remember the exact changes any more without a fresh diff against the original patch, but I remember the 3 days on the bench with a scope hunting it down :-) The original author can diff against this version if desired. The actual bug fixes are just a few lines of critical code. I have run this on three PMBus devices extensively including a several day 24 hour telemetry run, meaning constant traffic reading and writing. There were no errors. If anyone wants to do more testing, I suggest testing something faster than PMBus which maxes out at 400Khz. In the future this could be improved to add API to manage SMBus features such as the timeout mechanism. I don't have time at the moment to do that. I suggest the original author (or others( apply the patch and test their existing application. If nobody has any problems, I feel this code is safe to commit to CVS. Some example code: const cyg_uint32 i2c_bus_time = 10000; cyg_i2c_device device = { \ .i2c_bus = &cyg_i2c0_bus, \ .i2c_address = address, \ .i2c_flags = 0, \ .i2c_delay = i2c_bus_time \ }; cyg_uint8 buffer[1]; cyg_uint8 input[1]; buffer[0] = command; cyg_i2c_transaction_begin(&device); if(!cyg_i2c_transaction_tx(&device, true, &buffer[0], 1, false)) { diag_printf("Read Byte: fail TX.\n"); } else if(!cyg_i2c_transaction_rx(&device, true, &input[0], 1, true, true)) { diag_printf("Read Byte: fail RX.\n"); } cyg_i2c_transaction_end(&device); return input[0]; -- You are receiving this mail because: You are on the CC list for the bug.