From patchwork Thu Mar 17 15:49:05 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Gardiner X-Patchwork-Id: 641571 Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2HFpXee011078 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 17 Mar 2011 15:51:55 GMT Received: from dlep34.itg.ti.com ([157.170.170.115]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id p2HFnIUg022938 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 17 Mar 2011 10:49:19 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep34.itg.ti.com (8.13.7/8.13.7) with ESMTP id p2HFnISq010884; Thu, 17 Mar 2011 10:49:18 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 34CA480627; Thu, 17 Mar 2011 09:49:18 -0600 (CST) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp52.itg.ti.com (dflp52.itg.ti.com [128.247.22.96]) by linux.omap.com (Postfix) with ESMTP id 6C0A980626 for ; Thu, 17 Mar 2011 09:49:16 -0600 (CST) Received: from white.ext.ti.com (localhost [127.0.0.1]) by dflp52.itg.ti.com (8.13.7/8.13.7) with ESMTP id p2HFnGrJ023050 for ; Thu, 17 Mar 2011 10:49:16 -0500 (CDT) Received: from psmtp.com (na3sys009amx177.postini.com [74.125.149.158]) by white.ext.ti.com (8.13.7/8.13.7) with SMTP id p2HFnFWs026589 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 17 Mar 2011 10:49:15 -0500 Received: from source ([74.125.149.67]) (using TLSv1) by na3sys009amx177.postini.com ([74.125.148.10]) with SMTP; Thu, 17 Mar 2011 08:49:15 PDT Received: from source ([209.85.212.48]) (using TLSv1) by na3sys009aob101.postini.com ([74.125.148.12]) with SMTP ID DSNKTYItcwu+5XQKGncpBgiPlsMfjuHGYgAK@postini.com; Thu, 17 Mar 2011 08:49:15 PDT Received: by vws7 with SMTP id 7so3299170vws.35 for ; Thu, 17 Mar 2011 08:49:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nanometrics.ca; s=google; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=/eI3fdlm5ICwYc9J8KXyDSONKgvxNcP09D321o9gfpo=; b=Nixj7u8U/q66GU8Pl+dvuWA+R4N/AlcinZQ5ExHwdUj514+JSBMqytn7fvm1wCSE24 E2ayxNro+FGQdahWg/KNjV3OEa4kEyBOrX8B0G666qG2FvgpdkCRZfH0dHLEZCctTnaw WqutVM+2fQ5uyGpSu0ZGL/9ZZH68mB8rsFSrk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=nanometrics.ca; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=bMzXLm/5rj8PyT2v9vskeRukEf1zaSQHGDh4fxmpqmKjBVnqMC3NCiUuQm2E8K/3Uc f4QhGwUn546pRNjWe16/Ys1nXqeY4MLmzMGVZTbJKtjyxUGXexhTJtP4D5QzJPonrDjR ZufZIYruRk2Eyn9p5bntfdgNsej6wJsnz1xzU= MIME-Version: 1.0 Received: by 10.52.68.100 with SMTP id v4mr2004610vdt.111.1300376946624; Thu, 17 Mar 2011 08:49:06 -0700 (PDT) Received: by 10.52.168.225 with HTTP; Thu, 17 Mar 2011 08:49:05 -0700 (PDT) In-Reply-To: References: Date: Thu, 17 Mar 2011 11:49:05 -0400 Message-ID: Subject: Re: How to put extra clock cycles on i2c cavinci, problems on omapl138 (logic pd som) From: Ben Gardiner To: "Nori, Sekhar" X-pstn-neptune: 0/0/0.00/0 X-pstn-levels: (S:99.90000/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-settings: 2 (0.5000:0.0750) s cv GT3 gt2 gt1 r p m c X-pstn-addresses: from [db-null] Cc: "davinci-linux-open-source@linux.davincidsp.com" , "Bastian.Ruppert@sewerin.de" , "pjohn@in.mvista.com" , "linux-i2c@vger.kernel.org" , "khali@linux-fr.org" X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Greylist: Sender succeeded STARTTLS authentication, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 17 Mar 2011 15:51:55 +0000 (UTC) X-MIME-Autoconverted: from quoted-printable to 8bit by demeter1.kernel.org id p2HFpXee011078 diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c index 5795c83..ab8e0f3 100644 --- a/drivers/i2c/busses/i2c-davinci.c +++ b/drivers/i2c/busses/i2c-davinci.c @@ -44,7 +44,7 @@ /* ----- global defines ----------------------------------------------- */ -#define DAVINCI_I2C_TIMEOUT (1*HZ) +#define DAVINCI_I2C_TIMEOUT (2*HZ) #define DAVINCI_I2C_MAX_TRIES 2 #define I2C_DAVINCI_INTR_ALL (DAVINCI_I2C_IMR_AAS | \ DAVINCI_I2C_IMR_SCD | \ @@ -282,7 +282,10 @@ static int i2c_davinci_wait_bus_not_busy(struct davinci_i2c_dev *dev, while (davinci_i2c_read_reg(dev, DAVINCI_I2C_STR_REG) & DAVINCI_I2C_STR_BB) { if (to_cnt <= DAVINCI_I2C_MAX_TRIES) { - if (time_after(jiffies, timeout)) { + if (time_after(jiffies, timeout) + && (davinci_i2c_read_reg(dev, + DAVINCI_I2C_STR_REG) + & DAVINCI_I2C_STR_BB)) { dev_warn(dev->dev, "timeout waiting for bus ready\n");