From patchwork Mon Jan 18 17:21:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 43106 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 69AB9B7C8E for ; Tue, 19 Jan 2010 04:23:48 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755421Ab0ARRW2 (ORCPT ); Mon, 18 Jan 2010 12:22:28 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755407Ab0ARRW1 (ORCPT ); Mon, 18 Jan 2010 12:22:27 -0500 Received: from mail-ew0-f214.google.com ([209.85.219.214]:51627 "EHLO mail-ew0-f214.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755305Ab0ARRWZ (ORCPT ); Mon, 18 Jan 2010 12:22:25 -0500 Received: by mail-ew0-f214.google.com with SMTP id 6so3712947ewy.29 for ; Mon, 18 Jan 2010 09:22:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :in-reply-to:references:subject; bh=j0oWkJlyQM4kPcH+2s++WB6DB2L4st/tlO86F+fEtz4=; b=ot+TdY3gL4B2P9X7WT6UQp1/Iy8mKjmlSEzhklTWjX6MHQ9LgLN+vjw/fnnlqLU13W STzAFmiojS16mEUxCdlVYp4ahXwsAAxCYZiDUukWKQXnqqxA9W+12gu5Het8LGJmOKb/ sUvoEO1d7zMOoSK6b1cZD7pnnfhiMNcRUzh/s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:in-reply-to:references:subject; b=g/9FmGQDtZwx71EHgoNmK+ak+pk9rlU2sZEAv2tEH0PCHLTsEY34T1geN9F5SVmyLF Mfl7pokVTqsnNyrJhfxzaEta3FDQw9BSnsbxLfUBTu8YZCPGHaXnHO1OD3Ri1cm95G5M 82aHQerJL3NhLbyjB3p3V0LR14XgvtsmNVzUA= Received: by 10.216.89.149 with SMTP id c21mr2304335wef.224.1263835334250; Mon, 18 Jan 2010 09:22:14 -0800 (PST) Received: from ?127.0.0.1? (chello089079027028.chello.pl [89.79.27.28]) by mx.google.com with ESMTPS id p10sm9418997gvf.28.2010.01.18.09.22.13 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 18 Jan 2010 09:22:13 -0800 (PST) From: Bartlomiej Zolnierkiewicz To: linux-ide@vger.kernel.org Cc: Bartlomiej Zolnierkiewicz , linux-kernel@vger.kernel.org Date: Mon, 18 Jan 2010 18:21:05 +0100 Message-Id: <20100118172105.14623.5133.sendpatchset@localhost> In-Reply-To: <20100118171349.14623.90030.sendpatchset@localhost> References: <20100118171349.14623.90030.sendpatchset@localhost> Subject: [PATCH 51/64] alim15x3: fix handling of address setup timings Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org From: Bartlomiej Zolnierkiewicz Subject: [PATCH] alim15x3: fix handling of address setup timings Account for the requirements of the other device on the port. Based on libata pata_ali host driver. Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/alim15x3.c | 11 +++++++++++ 1 file changed, 11 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/alim15x3.c =================================================================== --- a/drivers/ide/alim15x3.c +++ b/drivers/ide/alim15x3.c @@ -72,6 +72,7 @@ static void ali_fifo_control(ide_hwif_t static void ali_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive) { struct pci_dev *dev = to_pci_dev(hwif->dev); + ide_drive_t *pair = ide_get_pair_dev(drive); int bus_speed = ide_pci_clk ? ide_pci_clk : 33; unsigned long T = 1000000 / bus_speed; /* PCI clock based */ int port = hwif->channel ? 0x5c : 0x58; @@ -79,6 +80,16 @@ static void ali_set_pio_mode(ide_hwif_t struct ide_timing t; ide_timing_compute(drive, drive->pio_mode, &t, T, 1); + if (pair) { + struct ide_timing p; + + ide_timing_compute(pair, pair->pio_mode, &p, T, 1); + ide_timing_merge(&p, &t, &t, IDE_TIMING_SETUP); + if (pair->dma_mode) { + ide_timing_compute(pair, pair->dma_mode, &p, T, 1); + ide_timing_merge(&p, &t, &t, IDE_TIMING_SETUP); + } + } t.setup = clamp_val(t.setup, 1, 8) & 7; t.active = clamp_val(t.active, 1, 8) & 7;