Received: by 10.223.185.116 with SMTP id b49csp1446791wrg; Sun, 11 Feb 2018 12:13:16 -0800 (PST) X-Google-Smtp-Source: AH8x2267AjV0DBBha3EfX3f4c2t8DUw0AVOUEfLYHV4O/MGXWzVLoY14tXgNTo5y1Sl0LerPv62K X-Received: by 2002:a17:902:7808:: with SMTP id p8-v6mr7693821pll.161.1518379996788; Sun, 11 Feb 2018 12:13:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518379996; cv=none; d=google.com; s=arc-20160816; b=KKo9DL7+XFuP3qvn4RCZUMt44wNdjsvfIRObrOvYKLhnSyGHddFv9iOEpsTtUtsnvW jj3OJ4vJGCpgtH7u7KoxxIXnq8vAiCSY/JpHE4vZ4ZnOQfTAh8d85noNiPlSVm1FdgQb U1hv2SCSk5Q6ezlteOkIxEnJuwtYALs56fH0ufq88ccSneE1B+NfhXlgBopb3hbw0A+I XPnkvszDkN0kq07EFlYaF2PpwHq+cxIrZr0evid/48qeidBVkSjseGK/s0AVueSZgfCV ud9zpjFju2jIlgpAkyN/qwHT8ZzMIbg6U5HAM3mN+oVrdviZHOB/zW2bizE9FWuFjFpa w5zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=s0zjmAnMFPe+D7yagbjVNghdPcHiuSrGOEceyOqDWY4=; b=XMA4HfBD8AwRiAHCAN3GR3NzkwlYlr5qbeBmOPBa5W16ISUHNPaXwQ7Aon8mpv7bms ileCtfuP1B+xKxe+WaREUA5wRelUDlkZsbr5l8uUTUfBS3g9oC4x7HticCcSBgrFHXip GYH2GjaqiD3zXQlySWoWuD/wV5KPQCDnbzDtxLadv137KGmYA7jwGTM1XvJV2khvoHs1 tYisgqMwqvHTAxEK4SNYr6Ascxa3KJo819xK3A8Rg3VNApqpNvkEr5GE++fq9nKquZtC KCoLTfXCyLSopem5tV62wZ/DSZ7ULYjkfh9G4DKbJc6D05gFoU3DCETWHlF8VE4uERLY scbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=qu2QkXnq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si4294576pgr.525.2018.02.11.12.13.02; Sun, 11 Feb 2018 12:13:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=qu2QkXnq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932148AbeBKUM0 (ORCPT + 99 others); Sun, 11 Feb 2018 15:12:26 -0500 Received: from mail-pl0-f66.google.com ([209.85.160.66]:38425 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932090AbeBKUMY (ORCPT ); Sun, 11 Feb 2018 15:12:24 -0500 Received: by mail-pl0-f66.google.com with SMTP id 13so4036441plb.5; Sun, 11 Feb 2018 12:12:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=s0zjmAnMFPe+D7yagbjVNghdPcHiuSrGOEceyOqDWY4=; b=qu2QkXnqAoRrx7BJisMCtZt0HOSwdeBtOfHEwQnATo0v+INdexaaffUX8a5Kb2cNTv bofeBBBGBBPKOpnz9jPDcXvLgIJLN0oj4NTEZq4c8gplwGDAGRjFw/L/jUt1QG/3Mj+S wj62nM8V7DcwCIN5ArkHjm9LVBUWNOPl5QFF/ShT/H1pod3LhED665hUkabYN+a2sT/V 2UM4t0qaJtkMSs2QxCZALtu8bJWiwzK7lCqv64858V7EPefrR7JATI3Q891guyCkksoE UK1G/W4CsXJfUIisXWWJy9l3+RSZPAbD/YHx1HcGxrbIS4DyRSy5yVeEZxE25RF1mioV nHhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=s0zjmAnMFPe+D7yagbjVNghdPcHiuSrGOEceyOqDWY4=; b=fulIIeSidvB7px2vOZIALFn5fVbW5XmYTtdU+FBd9ACkAfS+Yr/pZBj8XGRwx1Al6g 2cMfV88d+zt3rfWS/ThAhOAv8dk9+jNbWMlsCsXrGZiRZ7xALJYQB3m3o7EMxaA/IZ0C fXxxLPZHmj0hfRLx6sVl6av/7VixN/YqY3oavX8evDOVxWRGXl2F1Ali0Njs7PDJegZG Oz8tfugj1H+T8cNp0aJkegCZHIlLiLQlrHFYKwvSUlDzm6zohyweVcwi4aSuXRYmznB5 ajEZ7PbiOoK2czaQBvnahiDfGAhbwbcKfiTpjRWnwBdq6miQ0+Zrol5rc0hWB2KD9Q4Z VFYA== X-Gm-Message-State: APf1xPAwugT757a5Ct58ZP0MpRGaTOj05nLz46ZhjV7xkvXRq4VGxFsr VzXfTbQUpjFiR7hkB9y2cafc+Q== X-Received: by 2002:a17:902:7841:: with SMTP id e1-v6mr8804628pln.130.1518379944350; Sun, 11 Feb 2018 12:12:24 -0800 (PST) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by smtp.gmail.com with ESMTPSA id z90sm23988472pfd.78.2018.02.11.12.12.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Feb 2018 12:12:23 -0800 (PST) Date: Sun, 11 Feb 2018 12:12:22 -0800 From: Guenter Roeck To: Wolfram Sang Cc: Jean Delvare , =?iso-8859-1?B?Wm9sdOFuIEL2c3r2cm3pbnlp?= , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [2/2] i2c: piix4: Use usleep_range() Message-ID: <20180211201222.GA29596@roeck-us.net> References: <1514652658-6228-2-git-send-email-linux@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1514652658-6228-2-git-send-email-linux@roeck-us.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Dec 30, 2017 at 08:50:58AM -0800, Guenter Roeck wrote: > The piix4 i2c driver is extremely slow. Replacing msleep() > with usleep_range() increases its speed substantially. > > Signed-off-by: Guenter Roeck Any comments or concerns ? Thanks, Guenter > --- > drivers/i2c/busses/i2c-piix4.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c > index 78dd5951d6e7..52a8b1c5c110 100644 > --- a/drivers/i2c/busses/i2c-piix4.c > +++ b/drivers/i2c/busses/i2c-piix4.c > @@ -467,13 +467,13 @@ static int piix4_transaction(struct i2c_adapter *piix4_adapter) > > /* We will always wait for a fraction of a second! (See PIIX4 docs errata) */ > if (srvrworks_csb5_delay) /* Extra delay for SERVERWORKS_CSB5 */ > - msleep(2); > + usleep_range(2000, 2000); > else > - msleep(1); > + usleep_range(500, 1000); > > while ((++timeout < MAX_TIMEOUT) && > ((temp = inb_p(SMBHSTSTS)) & 0x01)) > - msleep(1); > + usleep_range(200, 500); > > /* If the SMBus is still busy, we give up */ > if (timeout == MAX_TIMEOUT) {