RE: [PATCH #upstream, v2] ahci: Implement SATA AHCI FIS-based switching support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tejun,
 

> -----Original Message-----
> From: Tejun Heo [mailto:tj@xxxxxxxxxx] 
> > 
> > 
> > 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;
> 
> This can leave pp->fbs_enabled out of sync, right?  Just don't check
> and set the bit anyway.
> Ditto.

Yes, it can leave pp->fbs_enabled out of sync, but just removing the
check and setting the bit anyway will still lead to the print of this
message for each SATA port:
ahci 0000:00:11.0: FBS is disabled.

So I would suggest to keep the check and also add the sync of
pp->fbs_enabled, which can also save the restart of DMA engine:

static void ahci_disable_fbs(struct ata_port *ap)
{
	......
	if (!pp->fbs_supported)
		return;

	fbs = readl(port_mmio + PORT_FBS);
	if ((fbs & PORT_FBS_EN) == 0) {
		pp->fbs_enabled = false;
		return;
	}

	rc = ahci_stop_engine(ap);



static void ahci_enable_fbs(struct ata_port *ap)
{
	......
	if (!pp->fbs_supported)
		return;

	fbs = readl(port_mmio + PORT_FBS);
	if (fbs & PORT_FBS_EN) {
		pp->fbs_enabled = true;
		pp->fbs_last_dev = -1; /* initialization */
		return;
	}

	rc = ahci_stop_engine(ap);



Thanks,
Shane

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux