From patchwork Fri Nov 27 18:55:52 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 39636 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.176.167]) by ozlabs.org (Postfix) with ESMTP id 7D1231007D1 for ; Sat, 28 Nov 2009 05:59:11 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752716AbZK0S6S (ORCPT ); Fri, 27 Nov 2009 13:58:18 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752660AbZK0S6R (ORCPT ); Fri, 27 Nov 2009 13:58:17 -0500 Received: from mail-ew0-f219.google.com ([209.85.219.219]:62522 "EHLO mail-ew0-f219.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751003AbZK0S6O (ORCPT ); Fri, 27 Nov 2009 13:58:14 -0500 Received: by mail-ew0-f219.google.com with SMTP id 19so1731406ewy.21 for ; Fri, 27 Nov 2009 10:58:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:cc:mime-version:content-type:content-transfer-encoding :message-id; bh=L+9QRd1Ax3Ftqw+9yxE+ohr2Fd6B13+q7bpsCsATA/4=; b=m3LPoog9wiHakdmLArcrSMjot5+ng/EMnstWPIwxsKXyFZtWCEZGrUzMvd0t4QUeTe +OGHIE4DufQVVb2LAH1M+FpCgSDu7j0A8Py+4lMqS/C699MVQ3lnab3onDkCD6JARBKx m4H9ATidbhK10mrfvPIe7F3iYFGem/iPvMk+s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:mime-version:content-type :content-transfer-encoding:message-id; b=KLWc3V27gAWj7GbqOZCUAw6fkFtsl01vVVMIsXcvOd09kYJCdUS3ZAADdFMrXG9Ca4 Hze77oMJ2U5d2if3mLoBx8g5uBH+FDQ8Kh+CzRo+3x2cbfcsFcrjLjGf3QD41isAld8H OOtUkmmYAGvQGArA4Lm0h8/kcLtLIJ1TmGrvg= Received: by 10.216.90.139 with SMTP id e11mr426264wef.111.1259348300008; Fri, 27 Nov 2009 10:58:20 -0800 (PST) Received: from szaki.localnet (chello089079027028.chello.pl [89.79.27.28]) by mx.google.com with ESMTPS id t12sm4513208gvd.20.2009.11.27.10.58.19 (version=SSLv3 cipher=RC4-MD5); Fri, 27 Nov 2009 10:58:19 -0800 (PST) From: Bartlomiej Zolnierkiewicz To: linux-ide@vger.kernel.org Subject: [PATCH] pata_hpt3x2n: add enablebits checking Date: Fri, 27 Nov 2009 19:55:52 +0100 User-Agent: KMail/1.12.2 (Linux/2.6.31.5-0.1-desktop; KDE/4.3.1; x86_64; ; ) Cc: linux-kernel@vger.kernel.org, Sergei Shtylyov MIME-Version: 1.0 Message-Id: <200911271955.52643.bzolnier@gmail.com> Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org There shouldn't be any problems with it as IDE hpt366 host driver has been supporting enablebits checking for years. Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ata/pata_hpt3x2n.c | 9 +++++++++ 1 file changed, 9 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/ata/pata_hpt3x2n.c =================================================================== --- a/drivers/ata/pata_hpt3x2n.c +++ b/drivers/ata/pata_hpt3x2n.c @@ -153,8 +153,17 @@ static int hpt3x2n_cable_detect(struct a static int hpt3x2n_pre_reset(struct ata_link *link, unsigned long deadline) { + static const struct pci_bits hpt37x_enable_bits[] = { + { 0x50, 1, 0x04, 0x04 }, + { 0x54, 1, 0x04, 0x04 } + }; + struct ata_port *ap = link->ap; struct pci_dev *pdev = to_pci_dev(ap->host->dev); + + if (!pci_test_config_bits(pdev, &hpt37x_enable_bits[ap->port_no])) + return -ENOENT; + /* Reset the state machine */ pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37); udelay(100);