From patchwork Wed Nov 25 17:03:44 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 39391 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 A93BA1007F5 for ; Thu, 26 Nov 2009 04:28:38 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759087AbZKYREZ (ORCPT ); Wed, 25 Nov 2009 12:04:25 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759079AbZKYREY (ORCPT ); Wed, 25 Nov 2009 12:04:24 -0500 Received: from mail-fx0-f213.google.com ([209.85.220.213]:53682 "EHLO mail-fx0-f213.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759082AbZKYREW (ORCPT ); Wed, 25 Nov 2009 12:04:22 -0500 Received: by mail-fx0-f213.google.com with SMTP id 5so7204645fxm.28 for ; Wed, 25 Nov 2009 09:04:28 -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=TL5xrYEoEukMMqLbd7n7mrAd6Z41NnXqvmn8OjiYL4M=; b=R1YoQIrzNYPZMOYJitPsGjsxIruV6xYfjoU+w5OA7tl+akgZmqUsx9Cd9Kdq1Ge22w BYQcHvj4qTAiDn0EIDi+A+o8ZRPT3mtu9FA45hNjCUTVY9kev5REED8s3PlDzaYGncnu w0BqV7kz+iZn15r8vKy/CxR5MgwVZ1Iz2EZoc= 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=Gi2UIu42K0EozT4GXC1E1GXQ9xIeZqmiJJS1Cwl5D4WRYqUNhBZie8SRJW3wvAgRSL 6q2K2btq9iuqysbGdSyKbjjQgiMEmoxw/774JS1EBmq+AgEpeOAktDx+h7WQjCR87hx2 gpeOqA2vPTRtKLGHtmyqa50pCFl/m+EPX+64s= Received: by 10.216.93.17 with SMTP id k17mr246018wef.31.1259168668059; Wed, 25 Nov 2009 09:04:28 -0800 (PST) Received: from ?127.0.0.1? (chello089079027028.chello.pl [89.79.27.28]) by mx.google.com with ESMTPS id m5sm13764458gve.27.2009.11.25.09.04.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 25 Nov 2009 09:04:27 -0800 (PST) From: Bartlomiej Zolnierkiewicz To: linux-ide@vger.kernel.org Cc: Bartlomiej Zolnierkiewicz , linux-kernel@vger.kernel.org Date: Wed, 25 Nov 2009 18:03:44 +0100 Message-Id: <20091125170344.5446.54715.sendpatchset@localhost> In-Reply-To: <20091125170218.5446.13513.sendpatchset@localhost> References: <20091125170218.5446.13513.sendpatchset@localhost> Subject: [PATCH 12/86] pata_atiixp: add proper ->prereset method Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org From: Bartlomiej Zolnierkiewicz Subject: [PATCH] pata_atiixp: add proper ->prereset method Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ata/pata_atiixp.c | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) -- 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_atiixp.c =================================================================== --- a/drivers/ata/pata_atiixp.c +++ b/drivers/ata/pata_atiixp.c @@ -47,6 +47,31 @@ static int atiixp_cable_detect(struct at } /** + * atiixp_prereset - perform reset handling + * @link: ATA link + * @deadline: deadline jiffies for the operation + * + * Reset sequence checking enable bits to see which ports are + * active. + */ + +static int atiixp_prereset(struct ata_link *link, unsigned long deadline) +{ + static const struct pci_bits atiixp_enable_bits[] = { + { 0x48, 1, 0x01, 0x00 }, + { 0x48, 1, 0x08, 0x00 } + }; + + struct ata_port *ap = link->ap; + struct pci_dev *pdev = to_pci_dev(ap->host->dev); + + if (!pci_test_config_bits(pdev, &atiixp_enable_bits[ap->port_no])) + return -ENOENT; + + return ata_sff_prereset(link, deadline); +} + +/** * atiixp_set_pio_timing - set initial PIO mode data * @ap: ATA interface * @adev: ATA device @@ -151,6 +176,7 @@ static struct ata_port_operations atiixp .qc_prep = ata_sff_dumb_qc_prep, + .prereset = atiixp_prereset, .cable_detect = atiixp_cable_detect, .set_piomode = atiixp_set_piomode, .set_dmamode = atiixp_set_dmamode, @@ -165,16 +191,7 @@ static int atiixp_init_one(struct pci_de .udma_mask = ATA_UDMA5, .port_ops = &atiixp_port_ops }; - static const struct pci_bits atiixp_enable_bits[] = { - { 0x48, 1, 0x01, 0x00 }, - { 0x48, 1, 0x08, 0x00 } - }; const struct ata_port_info *ppi[] = { &info, &info }; - int i; - - for (i = 0; i < 2; i++) - if (!pci_test_config_bits(pdev, &atiixp_enable_bits[i])) - ppi[i] = &ata_dummy_port_info; return ata_pci_sff_init_one(pdev, ppi, &atiixp_sht, NULL); }