aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libahci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/libahci.c')
-rw-r--r--drivers/ata/libahci.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index 81e772a94d59..8eea309ea212 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -121,7 +121,7 @@ static DEVICE_ATTR(ahci_port_cmd, S_IRUGO, ahci_show_port_cmd, NULL);
121static DEVICE_ATTR(em_buffer, S_IWUSR | S_IRUGO, 121static DEVICE_ATTR(em_buffer, S_IWUSR | S_IRUGO,
122 ahci_read_em_buffer, ahci_store_em_buffer); 122 ahci_read_em_buffer, ahci_store_em_buffer);
123 123
124static struct device_attribute *ahci_shost_attrs[] = { 124struct device_attribute *ahci_shost_attrs[] = {
125 &dev_attr_link_power_management_policy, 125 &dev_attr_link_power_management_policy,
126 &dev_attr_em_message_type, 126 &dev_attr_em_message_type,
127 &dev_attr_em_message, 127 &dev_attr_em_message,
@@ -132,22 +132,14 @@ static struct device_attribute *ahci_shost_attrs[] = {
132 &dev_attr_em_buffer, 132 &dev_attr_em_buffer,
133 NULL 133 NULL
134}; 134};
135EXPORT_SYMBOL_GPL(ahci_shost_attrs);
135 136
136static struct device_attribute *ahci_sdev_attrs[] = { 137struct device_attribute *ahci_sdev_attrs[] = {
137 &dev_attr_sw_activity, 138 &dev_attr_sw_activity,
138 &dev_attr_unload_heads, 139 &dev_attr_unload_heads,
139 NULL 140 NULL
140}; 141};
141 142EXPORT_SYMBOL_GPL(ahci_sdev_attrs);
142struct scsi_host_template ahci_sht = {
143 ATA_NCQ_SHT("ahci"),
144 .can_queue = AHCI_MAX_CMDS - 1,
145 .sg_tablesize = AHCI_MAX_SG,
146 .dma_boundary = AHCI_DMA_BOUNDARY,
147 .shost_attrs = ahci_shost_attrs,
148 .sdev_attrs = ahci_sdev_attrs,
149};
150EXPORT_SYMBOL_GPL(ahci_sht);
151 143
152struct ata_port_operations ahci_ops = { 144struct ata_port_operations ahci_ops = {
153 .inherits = &sata_pmp_port_ops, 145 .inherits = &sata_pmp_port_ops,
@@ -430,6 +422,12 @@ void ahci_save_initial_config(struct device *dev,
430 cap &= ~HOST_CAP_SNTF; 422 cap &= ~HOST_CAP_SNTF;
431 } 423 }
432 424
425 if (!(cap & HOST_CAP_FBS) && (hpriv->flags & AHCI_HFLAG_YES_FBS)) {
426 dev_printk(KERN_INFO, dev,
427 "controller can do FBS, turning on CAP_FBS\n");
428 cap |= HOST_CAP_FBS;
429 }
430
433 if (force_port_map && port_map != force_port_map) { 431 if (force_port_map && port_map != force_port_map) {
434 dev_printk(KERN_INFO, dev, "forcing port_map 0x%x -> 0x%x\n", 432 dev_printk(KERN_INFO, dev, "forcing port_map 0x%x -> 0x%x\n",
435 port_map, force_port_map); 433 port_map, force_port_map);
@@ -1320,7 +1318,7 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class,
1320 /* issue the first D2H Register FIS */ 1318 /* issue the first D2H Register FIS */
1321 msecs = 0; 1319 msecs = 0;
1322 now = jiffies; 1320 now = jiffies;
1323 if (time_after(now, deadline)) 1321 if (time_after(deadline, now))
1324 msecs = jiffies_to_msecs(deadline - now); 1322 msecs = jiffies_to_msecs(deadline - now);
1325 1323
1326 tf.ctl |= ATA_SRST; 1324 tf.ctl |= ATA_SRST;
@@ -2036,9 +2034,15 @@ static int ahci_port_start(struct ata_port *ap)
2036 u32 cmd = readl(port_mmio + PORT_CMD); 2034 u32 cmd = readl(port_mmio + PORT_CMD);
2037 if (cmd & PORT_CMD_FBSCP) 2035 if (cmd & PORT_CMD_FBSCP)
2038 pp->fbs_supported = true; 2036 pp->fbs_supported = true;
2039 else 2037 else if (hpriv->flags & AHCI_HFLAG_YES_FBS) {
2038 dev_printk(KERN_INFO, dev,
2039 "port %d can do FBS, forcing FBSCP\n",
2040 ap->port_no);
2041 pp->fbs_supported = true;
2042 } else
2040 dev_printk(KERN_WARNING, dev, 2043 dev_printk(KERN_WARNING, dev,
2041 "The port is not capable of FBS\n"); 2044 "port %d is not capable of FBS\n",
2045 ap->port_no);
2042 } 2046 }
2043 2047
2044 if (pp->fbs_supported) { 2048 if (pp->fbs_supported) {