From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: Re: [PATCH #upstream, v2] ahci: Implement SATA AHCI FIS-based switching support Date: Wed, 02 Sep 2009 11:40:40 +0900 Message-ID: <4A9DDB28.7070709@kernel.org> References: <1250570756.5207.15.camel@zm-desktop> <4A9B8368.1080807@kernel.org> <4A9D1387.6040709@kernel.org> <4A9D1E2A.9000209@kernel.org> <4A9DD153.5050106@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from hera.kernel.org ([140.211.167.34]:36176 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751856AbZIBCkn (ORCPT ); Tue, 1 Sep 2009 22:40:43 -0400 In-Reply-To: Sender: linux-ide-owner@vger.kernel.org List-Id: linux-ide@vger.kernel.org To: "Huang, Shane" Cc: jgarzik@pobox.com, linux-ide@vger.kernel.org Hello, Shane. Huang, Shane wrote: > static void ahci_enable_fbs(struct ata_port *ap) > { > struct ahci_port_priv *pp = ap->private_data; > void __iomem *port_mmio = ahci_port_base(ap); > u32 fbs; > int rc; > > if (!pp->fbs_supported) > return; > > fbs = readl(port_mmio + PORT_FBS); > if (fbs & PORT_FBS_EN) > return; This can leave pp->fbs_enabled out of sync, right? Just don't check and set the bit anyway. > rc = ahci_stop_engine(ap); > if (rc) > return; > > writel(fbs | PORT_FBS_EN, port_mmio + PORT_FBS); > fbs = readl(port_mmio + PORT_FBS); > if (fbs & PORT_FBS_EN) { > dev_printk(KERN_INFO, ap->host->dev, "FBS is > enabled.\n"); > pp->fbs_enabled = true; > pp->fbs_last_dev = -1; /* initialization */ > } else > dev_printk(KERN_ERR, ap->host->dev, "Failed to enable > FBS\n"); > > ahci_start_engine(ap); > } > > > static void ahci_disable_fbs(struct ata_port *ap) > { > struct ahci_port_priv *pp = ap->private_data; > void __iomem *port_mmio = ahci_port_base(ap); > u32 fbs; > int rc; > > if (!pp->fbs_supported) > return; > > fbs = readl(port_mmio + PORT_FBS); > if ((fbs & PORT_FBS_EN) == 0) > return; Ditto. Thanks. -- tejun