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

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

 



Hi Tejun, 

> -----Original Message-----
> From: Tejun Heo [mailto:tj@xxxxxxxxxx] 
> 
> >>> +	/* check FBS capability */
> >>> +	if ((hpriv->cap & HOST_CAP_FBS) && sata_pmp_supported(ap)) {
> >>> +		void __iomem *port_mmio = ahci_port_base(ap);
> >>> +		u32 cmd = readl(port_mmio + PORT_CMD);
> >>> +		if (cmd & PORT_CMD_FBSCP)
> >>> +			pp->fbs_supported = true;
> >> Maybe whine a bit if CAP indicates FBS but PORT_CMD doesn't?
> > 
> > Sure, updated as below:
> > 	if (cmd & PORT_CMD_FBSCP)
> > 		pp->fbs_supported = true;
> > 	else
> > 		WARN_ON(1);
> 
> WARN_ON() would be a tad bit too scary.  Given that on certain
> hardwares it would always trigger.  A dev_printk() would be better.

Well..., then:
	if (cmd & PORT_CMD_FBSCP)
		pp->fbs_supported = true;
	else
		dev_printk(KERN_WARNING, ap->host->dev,
			   "The port is not capable of FBS\n");


Quoting myself:
> 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;
> 
> 	WARN_ON(!pp->fbs_enabled);
> 
> 	rc = ahci_stop_engine(ap);

I find that ahci_pmp_detach() will be called for each SATA port
during the initialization, right after print:
> ahci 0000:00:11.0: flags: 64bit ncq sntf ilck pm led clo pmp fbs...

so will ahci_disable_fbs() be called, which leads to the trigger
of WARN_ON().

I'll also add the condition sata_pmp_attached() as below:
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 || !sata_pmp_attached(ap))
		return;

	WARN_ON(!pp->fbs_enabled);

	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