From patchwork Thu Oct 13 13:16:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 119502 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 7B199B6F80 for ; Fri, 14 Oct 2011 00:21:21 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755400Ab1JMNU6 (ORCPT ); Thu, 13 Oct 2011 09:20:58 -0400 Received: from mail-ey0-f174.google.com ([209.85.215.174]:57043 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755252Ab1JMNU4 (ORCPT ); Thu, 13 Oct 2011 09:20:56 -0400 Received: by mail-ey0-f174.google.com with SMTP id 27so1825802eye.19 for ; Thu, 13 Oct 2011 06:20:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:mime-version:content-type :content-transfer-encoding:message-id; bh=Sav57+/cVWcPXYMQjQicEaRYrU/KdwfZCK6zpdfBBig=; b=Up3pYkZbHrknhHLP1wWQekEog9WXQsxAlxkjlBGDGNDX5cElqS0d824ygMJOi/BkGa MhHmqnwlO6GvhBl5ettjU74xdW/dc1FXibKmScvqViWqAWHpBZdEGCGpG7KihrO6zuZS XIU1+fsHKVqEy7Bm44rHzt4h8/23aXTdF3VwI= Received: by 10.223.17.3 with SMTP id q3mr6076704faa.28.1318512055430; Thu, 13 Oct 2011 06:20:55 -0700 (PDT) Received: from linux-mhg7.site (89-74-122-41.dynamic.chello.pl. [89.74.122.41]) by mx.google.com with ESMTPS id n1sm9908527fad.20.2011.10.13.06.20.53 (version=SSLv3 cipher=OTHER); Thu, 13 Oct 2011 06:20:54 -0700 (PDT) From: Bartlomiej Zolnierkiewicz To: David Miller Subject: [PATCH v2] ide: fix for ide_timing quantisation errors Date: Thu, 13 Oct 2011 15:16:03 +0200 User-Agent: KMail/1.13.6 (Linux/2.6.37.6-0.7-desktop-dirty; KDE/4.6.0; x86_64; ; ) Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-Id: <201110131516.03408.bzolnier@gmail.com> Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org From: Bartlomiej Zolnierkiewicz Subject: [PATCH v2] ide: fix for ide_timing quantisation errors Based on commit 4f701d1 ("ata_timing: ensure t->cycle is always correct") for libata. Signed-off-by: Bartlomiej Zolnierkiewicz --- v2: fixed comment style earlier references: https://lkml.org/lkml/2010/1/18/274 drivers/ide/ide-timings.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: b/drivers/ide/ide-timings.c =================================================================== --- a/drivers/ide/ide-timings.c +++ b/drivers/ide/ide-timings.c @@ -206,6 +206,14 @@ int ide_timing_compute(ide_drive_t *driv t->recover = t->cycle - t->active; } + /* + * In a few cases quantisation may produce enough errors to + * leave t->cycle too low for the sum of active and recovery + * if so we must correct this + */ + if (t->active + t->recover > t->cycle) + t->cycle = t->active + t->recover; + return 0; } EXPORT_SYMBOL_GPL(ide_timing_compute);