Lines Matching refs:ap
63 static ssize_t ahci_led_show(struct ata_port *ap, char *buf);
64 static ssize_t ahci_led_store(struct ata_port *ap, const char *buf,
66 static ssize_t ahci_transmit_led_message(struct ata_port *ap, u32 state,
74 static int ahci_port_start(struct ata_port *ap);
75 static void ahci_port_stop(struct ata_port *ap);
78 static void ahci_freeze(struct ata_port *ap);
79 static void ahci_thaw(struct ata_port *ap);
80 static void ahci_set_aggressive_devslp(struct ata_port *ap, bool sleep);
81 static void ahci_enable_fbs(struct ata_port *ap);
82 static void ahci_disable_fbs(struct ata_port *ap);
83 static void ahci_pmp_attach(struct ata_port *ap);
84 static void ahci_pmp_detach(struct ata_port *ap);
95 static int ahci_port_suspend(struct ata_port *ap, pm_message_t mesg);
238 static int ahci_rpm_get_port(struct ata_port *ap) in ahci_rpm_get_port() argument
240 return pm_runtime_get_sync(ap->dev); in ahci_rpm_get_port()
250 static void ahci_rpm_put_port(struct ata_port *ap) in ahci_rpm_put_port() argument
252 pm_runtime_put(ap->dev); in ahci_rpm_put_port()
259 struct ata_port *ap = ata_shost_to_port(shost); in ahci_show_host_caps() local
260 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_show_host_caps()
269 struct ata_port *ap = ata_shost_to_port(shost); in ahci_show_host_cap2() local
270 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_show_host_cap2()
279 struct ata_port *ap = ata_shost_to_port(shost); in ahci_show_host_version() local
280 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_show_host_version()
289 struct ata_port *ap = ata_shost_to_port(shost); in ahci_show_port_cmd() local
290 void __iomem *port_mmio = ahci_port_base(ap); in ahci_show_port_cmd()
293 ahci_rpm_get_port(ap); in ahci_show_port_cmd()
295 ahci_rpm_put_port(ap); in ahci_show_port_cmd()
304 struct ata_port *ap = ata_shost_to_port(shost); in ahci_read_em_buffer() local
305 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_read_em_buffer()
313 ahci_rpm_get_port(ap); in ahci_read_em_buffer()
314 spin_lock_irqsave(ap->lock, flags); in ahci_read_em_buffer()
317 if (!(ap->flags & ATA_FLAG_EM) || em_ctl & EM_CTL_XMT || in ahci_read_em_buffer()
319 spin_unlock_irqrestore(ap->lock, flags); in ahci_read_em_buffer()
320 ahci_rpm_put_port(ap); in ahci_read_em_buffer()
325 spin_unlock_irqrestore(ap->lock, flags); in ahci_read_em_buffer()
326 ahci_rpm_put_port(ap); in ahci_read_em_buffer()
338 ata_port_warn(ap, in ahci_read_em_buffer()
353 spin_unlock_irqrestore(ap->lock, flags); in ahci_read_em_buffer()
354 ahci_rpm_put_port(ap); in ahci_read_em_buffer()
364 struct ata_port *ap = ata_shost_to_port(shost); in ahci_store_em_buffer() local
365 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_store_em_buffer()
374 if (!(ap->flags & ATA_FLAG_EM) || in ahci_store_em_buffer()
379 ahci_rpm_get_port(ap); in ahci_store_em_buffer()
380 spin_lock_irqsave(ap->lock, flags); in ahci_store_em_buffer()
384 spin_unlock_irqrestore(ap->lock, flags); in ahci_store_em_buffer()
385 ahci_rpm_put_port(ap); in ahci_store_em_buffer()
397 spin_unlock_irqrestore(ap->lock, flags); in ahci_store_em_buffer()
398 ahci_rpm_put_port(ap); in ahci_store_em_buffer()
407 struct ata_port *ap = ata_shost_to_port(shost); in ahci_show_em_supported() local
408 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_show_em_supported()
412 ahci_rpm_get_port(ap); in ahci_show_em_supported()
414 ahci_rpm_put_port(ap); in ahci_show_em_supported()
593 static unsigned ahci_scr_offset(struct ata_port *ap, unsigned int sc_reg) in ahci_scr_offset() argument
602 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_scr_offset()
612 void __iomem *port_mmio = ahci_port_base(link->ap); in ahci_scr_read()
613 int offset = ahci_scr_offset(link->ap, sc_reg); in ahci_scr_read()
624 void __iomem *port_mmio = ahci_port_base(link->ap); in ahci_scr_write()
625 int offset = ahci_scr_offset(link->ap, sc_reg); in ahci_scr_write()
634 void ahci_start_engine(struct ata_port *ap) in ahci_start_engine() argument
636 void __iomem *port_mmio = ahci_port_base(ap); in ahci_start_engine()
647 int ahci_stop_engine(struct ata_port *ap) in ahci_stop_engine() argument
649 void __iomem *port_mmio = ahci_port_base(ap); in ahci_stop_engine()
650 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_stop_engine()
660 (ap->link.lpm_policy > ATA_LPM_MAX_POWER) && in ahci_stop_engine()
661 ahci_set_lpm(&ap->link, ATA_LPM_MAX_POWER, ATA_LPM_WAKE_ONLY)) { in ahci_stop_engine()
662 dev_err(ap->host->dev, "Failed to wake up port before engine stop\n"); in ahci_stop_engine()
678 dev_err(ap->host->dev, "AHCI controller unavailable!\n"); in ahci_stop_engine()
687 tmp = ata_wait_register(ap, port_mmio + PORT_CMD, in ahci_stop_engine()
696 void ahci_start_fis_rx(struct ata_port *ap) in ahci_start_fis_rx() argument
698 void __iomem *port_mmio = ahci_port_base(ap); in ahci_start_fis_rx()
699 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_start_fis_rx()
700 struct ahci_port_priv *pp = ap->private_data; in ahci_start_fis_rx()
724 static int ahci_stop_fis_rx(struct ata_port *ap) in ahci_stop_fis_rx() argument
726 void __iomem *port_mmio = ahci_port_base(ap); in ahci_stop_fis_rx()
735 tmp = ata_wait_register(ap, port_mmio + PORT_CMD, PORT_CMD_FIS_ON, in ahci_stop_fis_rx()
743 static void ahci_power_up(struct ata_port *ap) in ahci_power_up() argument
745 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_power_up()
746 void __iomem *port_mmio = ahci_port_base(ap); in ahci_power_up()
764 struct ata_port *ap = link->ap; in ahci_set_lpm() local
765 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_set_lpm()
766 struct ahci_port_priv *pp = ap->private_data; in ahci_set_lpm()
767 void __iomem *port_mmio = ahci_port_base(ap); in ahci_set_lpm()
796 ata_msleep(ap, 10); in ahci_set_lpm()
818 ahci_set_aggressive_devslp(ap, true); in ahci_set_lpm()
820 ahci_set_aggressive_devslp(ap, false); in ahci_set_lpm()
835 static void ahci_power_down(struct ata_port *ap) in ahci_power_down() argument
837 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_power_down()
838 void __iomem *port_mmio = ahci_port_base(ap); in ahci_power_down()
856 static void ahci_start_port(struct ata_port *ap) in ahci_start_port() argument
858 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_start_port()
859 struct ahci_port_priv *pp = ap->private_data; in ahci_start_port()
866 ahci_start_fis_rx(ap); in ahci_start_port()
870 hpriv->start_engine(ap); in ahci_start_port()
873 if (ap->flags & ATA_FLAG_EM) { in ahci_start_port()
874 ata_for_each_link(link, ap, EDGE) { in ahci_start_port()
879 rc = ap->ops->transmit_led_message(ap, in ahci_start_port()
898 if (ap->flags & ATA_FLAG_SW_ACTIVITY) in ahci_start_port()
899 ata_for_each_link(link, ap, EDGE) in ahci_start_port()
904 static int ahci_deinit_port(struct ata_port *ap, const char **emsg) in ahci_deinit_port() argument
907 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_deinit_port()
910 rc = hpriv->stop_engine(ap); in ahci_deinit_port()
917 rc = ahci_stop_fis_rx(ap); in ahci_deinit_port()
977 struct ata_port *ap = link->ap; in ahci_sw_activity() local
978 struct ahci_port_priv *pp = ap->private_data; in ahci_sw_activity()
993 struct ata_port *ap = link->ap; in ahci_sw_activity_blink() local
1000 led_message |= ap->port_no | (link->pmp << 8); in ahci_sw_activity_blink()
1006 spin_lock_irqsave(ap->lock, flags); in ahci_sw_activity_blink()
1029 spin_unlock_irqrestore(ap->lock, flags); in ahci_sw_activity_blink()
1030 ap->ops->transmit_led_message(ap, led_message, 4); in ahci_sw_activity_blink()
1035 struct ata_port *ap = link->ap; in ahci_init_sw_activity() local
1036 struct ahci_port_priv *pp = ap->private_data; in ahci_init_sw_activity()
1064 static ssize_t ahci_transmit_led_message(struct ata_port *ap, u32 state, in ahci_transmit_led_message() argument
1067 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_transmit_led_message()
1068 struct ahci_port_priv *pp = ap->private_data; in ahci_transmit_led_message()
1083 ahci_rpm_get_port(ap); in ahci_transmit_led_message()
1084 spin_lock_irqsave(ap->lock, flags); in ahci_transmit_led_message()
1092 spin_unlock_irqrestore(ap->lock, flags); in ahci_transmit_led_message()
1093 ahci_rpm_put_port(ap); in ahci_transmit_led_message()
1105 message[1] = ((state & ~EM_MSG_LED_HBA_PORT) | ap->port_no); in ahci_transmit_led_message()
1120 spin_unlock_irqrestore(ap->lock, flags); in ahci_transmit_led_message()
1121 ahci_rpm_put_port(ap); in ahci_transmit_led_message()
1126 static ssize_t ahci_led_show(struct ata_port *ap, char *buf) in ahci_led_show() argument
1128 struct ahci_port_priv *pp = ap->private_data; in ahci_led_show()
1133 ata_for_each_link(link, ap, EDGE) { in ahci_led_show()
1140 static ssize_t ahci_led_store(struct ata_port *ap, const char *buf, in ahci_led_store() argument
1145 struct ahci_port_priv *pp = ap->private_data; in ahci_led_store()
1167 return ap->ops->transmit_led_message(ap, state, size); in ahci_led_store()
1173 struct ata_port *ap = link->ap; in ahci_activity_store() local
1174 struct ahci_port_priv *pp = ap->private_data; in ahci_activity_store()
1185 port_led_state |= (ap->port_no | (link->pmp << 8)); in ahci_activity_store()
1186 ap->ops->transmit_led_message(ap, port_led_state, 4); in ahci_activity_store()
1192 port_led_state |= (ap->port_no | (link->pmp << 8)); in ahci_activity_store()
1194 ap->ops->transmit_led_message(ap, port_led_state, 4); in ahci_activity_store()
1204 struct ata_port *ap = link->ap; in ahci_activity_show() local
1205 struct ahci_port_priv *pp = ap->private_data; in ahci_activity_show()
1214 static void ahci_port_init(struct device *dev, struct ata_port *ap, in ahci_port_init() argument
1218 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_port_init()
1224 rc = ahci_deinit_port(ap, &emsg); in ahci_port_init()
1244 ap->pflags |= ATA_PFLAG_EXTERNAL; in ahci_port_init()
1256 struct ata_port *ap = host->ports[i]; in ahci_init_controller() local
1258 port_mmio = ahci_port_base(ap); in ahci_init_controller()
1259 if (ata_port_is_dummy(ap)) in ahci_init_controller()
1262 ahci_port_init(host->dev, ap, i, mmio, port_mmio); in ahci_init_controller()
1275 struct ahci_host_priv *hpriv = dev->link->ap->host->private_data; in ahci_dev_config()
1284 unsigned int ahci_dev_classify(struct ata_port *ap) in ahci_dev_classify() argument
1286 void __iomem *port_mmio = ahci_port_base(ap); in ahci_dev_classify()
1314 int ahci_kick_engine(struct ata_port *ap) in ahci_kick_engine() argument
1316 void __iomem *port_mmio = ahci_port_base(ap); in ahci_kick_engine()
1317 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_kick_engine()
1323 rc = hpriv->stop_engine(ap); in ahci_kick_engine()
1331 if (!busy && !sata_pmp_attached(ap)) { in ahci_kick_engine()
1347 tmp = ata_wait_register(ap, port_mmio + PORT_CMD, in ahci_kick_engine()
1354 hpriv->start_engine(ap); in ahci_kick_engine()
1359 static int ahci_exec_polled_cmd(struct ata_port *ap, int pmp, in ahci_exec_polled_cmd() argument
1364 struct ahci_port_priv *pp = ap->private_data; in ahci_exec_polled_cmd()
1365 void __iomem *port_mmio = ahci_port_base(ap); in ahci_exec_polled_cmd()
1386 tmp = ata_wait_register(ap, port_mmio + PORT_CMD_ISSUE, in ahci_exec_polled_cmd()
1389 ahci_kick_engine(ap); in ahci_exec_polled_cmd()
1402 struct ata_port *ap = link->ap; in ahci_do_softreset() local
1403 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_do_softreset()
1404 struct ahci_port_priv *pp = ap->private_data; in ahci_do_softreset()
1414 rc = ahci_kick_engine(ap); in ahci_do_softreset()
1424 ahci_disable_fbs(ap); in ahci_do_softreset()
1437 if (ahci_exec_polled_cmd(ap, pmp, &tf, 0, in ahci_do_softreset()
1445 ata_msleep(ap, 1); in ahci_do_softreset()
1449 ahci_exec_polled_cmd(ap, pmp, &tf, 0, 0, 0); in ahci_do_softreset()
1466 *class = ahci_dev_classify(ap); in ahci_do_softreset()
1470 ahci_enable_fbs(ap); in ahci_do_softreset()
1482 void __iomem *port_mmio = ahci_port_base(link->ap); in ahci_check_ready()
1502 void __iomem *port_mmio = ahci_port_base(link->ap); in ahci_bad_pmp_check_ready()
1519 struct ata_port *ap = link->ap; in ahci_pmp_retry_softreset() local
1520 void __iomem *port_mmio = ahci_port_base(ap); in ahci_pmp_retry_softreset()
1553 struct ata_port *ap = link->ap; in ahci_do_hardreset() local
1554 struct ahci_port_priv *pp = ap->private_data; in ahci_do_hardreset()
1555 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_do_hardreset()
1562 hpriv->stop_engine(ap); in ahci_do_hardreset()
1572 hpriv->start_engine(ap); in ahci_do_hardreset()
1575 *class = ahci_dev_classify(ap); in ahci_do_hardreset()
1592 struct ata_port *ap = link->ap; in ahci_postreset() local
1593 void __iomem *port_mmio = ahci_port_base(ap); in ahci_postreset()
1635 struct ata_port *ap = qc->ap; in ahci_pmp_qc_defer() local
1636 struct ahci_port_priv *pp = ap->private_data; in ahci_pmp_qc_defer()
1638 if (!sata_pmp_attached(ap) || pp->fbs_enabled) in ahci_pmp_qc_defer()
1646 struct ata_port *ap = qc->ap; in ahci_qc_prep() local
1647 struct ahci_port_priv *pp = ap->private_data; in ahci_qc_prep()
1682 static void ahci_fbs_dec_intr(struct ata_port *ap) in ahci_fbs_dec_intr() argument
1684 struct ahci_port_priv *pp = ap->private_data; in ahci_fbs_dec_intr()
1685 void __iomem *port_mmio = ahci_port_base(ap); in ahci_fbs_dec_intr()
1703 dev_err(ap->host->dev, "failed to clear device error\n"); in ahci_fbs_dec_intr()
1706 static void ahci_error_intr(struct ata_port *ap, u32 irq_stat) in ahci_error_intr() argument
1708 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_error_intr()
1709 struct ahci_port_priv *pp = ap->private_data; in ahci_error_intr()
1710 struct ata_eh_info *host_ehi = &ap->link.eh_info; in ahci_error_intr()
1719 void __iomem *port_mmio = ahci_port_base(ap); in ahci_error_intr()
1723 if ((fbs & PORT_FBS_SDE) && (pmp < ap->nr_pmp_links)) { in ahci_error_intr()
1724 link = &ap->pmp_link[pmp]; in ahci_error_intr()
1729 ata_for_each_link(link, ap, EDGE) in ahci_error_intr()
1734 link = &ap->link; in ahci_error_intr()
1736 active_qc = ata_qc_from_tag(ap, link->active_tag); in ahci_error_intr()
1744 ahci_scr_read(&ap->link, SCR_ERROR, &serror); in ahci_error_intr()
1745 ahci_scr_write(&ap->link, SCR_ERROR, serror); in ahci_error_intr()
1776 if (sata_pmp_attached(ap) && (irq_stat & PORT_IRQ_BAD_PMP)) { in ahci_error_intr()
1809 ata_port_freeze(ap); in ahci_error_intr()
1812 ahci_fbs_dec_intr(ap); in ahci_error_intr()
1814 ata_port_abort(ap); in ahci_error_intr()
1817 static void ahci_handle_port_interrupt(struct ata_port *ap, in ahci_handle_port_interrupt() argument
1820 struct ata_eh_info *ehi = &ap->link.eh_info; in ahci_handle_port_interrupt()
1821 struct ahci_port_priv *pp = ap->private_data; in ahci_handle_port_interrupt()
1822 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_handle_port_interrupt()
1823 int resetting = !!(ap->pflags & ATA_PFLAG_RESETTING); in ahci_handle_port_interrupt()
1831 if (sata_lpm_ignore_phy_events(&ap->link)) { in ahci_handle_port_interrupt()
1833 ahci_scr_write(&ap->link, SCR_ERROR, SERR_PHYRDY_CHG); in ahci_handle_port_interrupt()
1837 ahci_error_intr(ap, status); in ahci_handle_port_interrupt()
1852 sata_async_notification(ap); in ahci_handle_port_interrupt()
1868 sata_async_notification(ap); in ahci_handle_port_interrupt()
1878 if (ap->qc_active) { in ahci_handle_port_interrupt()
1884 if (ap->qc_active && pp->active_link->sactive) in ahci_handle_port_interrupt()
1891 rc = ata_qc_complete_multiple(ap, qc_active); in ahci_handle_port_interrupt()
1897 ata_port_freeze(ap); in ahci_handle_port_interrupt()
1901 static void ahci_port_intr(struct ata_port *ap) in ahci_port_intr() argument
1903 void __iomem *port_mmio = ahci_port_base(ap); in ahci_port_intr()
1909 ahci_handle_port_interrupt(ap, port_mmio, status); in ahci_port_intr()
1914 struct ata_port *ap = dev_instance; in ahci_multi_irqs_intr_hard() local
1915 void __iomem *port_mmio = ahci_port_base(ap); in ahci_multi_irqs_intr_hard()
1923 spin_lock(ap->lock); in ahci_multi_irqs_intr_hard()
1924 ahci_handle_port_interrupt(ap, port_mmio, status); in ahci_multi_irqs_intr_hard()
1925 spin_unlock(ap->lock); in ahci_multi_irqs_intr_hard()
1937 struct ata_port *ap; in ahci_handle_port_intr() local
1942 ap = host->ports[i]; in ahci_handle_port_intr()
1943 if (ap) { in ahci_handle_port_intr()
1944 ahci_port_intr(ap); in ahci_handle_port_intr()
2004 struct ata_port *ap = qc->ap; in ahci_qc_issue() local
2005 void __iomem *port_mmio = ahci_port_base(ap); in ahci_qc_issue()
2006 struct ahci_port_priv *pp = ap->private_data; in ahci_qc_issue()
2035 struct ahci_port_priv *pp = qc->ap->private_data; in ahci_qc_fill_rtf()
2057 static void ahci_freeze(struct ata_port *ap) in ahci_freeze() argument
2059 void __iomem *port_mmio = ahci_port_base(ap); in ahci_freeze()
2065 static void ahci_thaw(struct ata_port *ap) in ahci_thaw() argument
2067 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_thaw()
2069 void __iomem *port_mmio = ahci_port_base(ap); in ahci_thaw()
2071 struct ahci_port_priv *pp = ap->private_data; in ahci_thaw()
2076 writel(1 << ap->port_no, mmio + HOST_IRQ_STAT); in ahci_thaw()
2082 void ahci_error_handler(struct ata_port *ap) in ahci_error_handler() argument
2084 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_error_handler()
2086 if (!(ap->pflags & ATA_PFLAG_FROZEN)) { in ahci_error_handler()
2088 hpriv->stop_engine(ap); in ahci_error_handler()
2089 hpriv->start_engine(ap); in ahci_error_handler()
2092 sata_pmp_error_handler(ap); in ahci_error_handler()
2094 if (!ata_dev_enabled(ap->link.device)) in ahci_error_handler()
2095 hpriv->stop_engine(ap); in ahci_error_handler()
2101 struct ata_port *ap = qc->ap; in ahci_post_internal_cmd() local
2105 ahci_kick_engine(ap); in ahci_post_internal_cmd()
2108 static void ahci_set_aggressive_devslp(struct ata_port *ap, bool sleep) in ahci_set_aggressive_devslp() argument
2110 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_set_aggressive_devslp()
2111 void __iomem *port_mmio = ahci_port_base(ap); in ahci_set_aggressive_devslp()
2112 struct ata_device *dev = ap->link.device; in ahci_set_aggressive_devslp()
2119 dev_info(ap->host->dev, "port does not support device sleep\n"); in ahci_set_aggressive_devslp()
2149 rc = hpriv->stop_engine(ap); in ahci_set_aggressive_devslp()
2178 hpriv->start_engine(ap); in ahci_set_aggressive_devslp()
2188 static void ahci_enable_fbs(struct ata_port *ap) in ahci_enable_fbs() argument
2190 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_enable_fbs()
2191 struct ahci_port_priv *pp = ap->private_data; in ahci_enable_fbs()
2192 void __iomem *port_mmio = ahci_port_base(ap); in ahci_enable_fbs()
2206 rc = hpriv->stop_engine(ap); in ahci_enable_fbs()
2213 dev_info(ap->host->dev, "FBS is enabled\n"); in ahci_enable_fbs()
2217 dev_err(ap->host->dev, "Failed to enable FBS\n"); in ahci_enable_fbs()
2219 hpriv->start_engine(ap); in ahci_enable_fbs()
2222 static void ahci_disable_fbs(struct ata_port *ap) in ahci_disable_fbs() argument
2224 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_disable_fbs()
2225 struct ahci_port_priv *pp = ap->private_data; in ahci_disable_fbs()
2226 void __iomem *port_mmio = ahci_port_base(ap); in ahci_disable_fbs()
2239 rc = hpriv->stop_engine(ap); in ahci_disable_fbs()
2246 dev_err(ap->host->dev, "Failed to disable FBS\n"); in ahci_disable_fbs()
2248 dev_info(ap->host->dev, "FBS is disabled\n"); in ahci_disable_fbs()
2252 hpriv->start_engine(ap); in ahci_disable_fbs()
2255 static void ahci_pmp_attach(struct ata_port *ap) in ahci_pmp_attach() argument
2257 void __iomem *port_mmio = ahci_port_base(ap); in ahci_pmp_attach()
2258 struct ahci_port_priv *pp = ap->private_data; in ahci_pmp_attach()
2265 ahci_enable_fbs(ap); in ahci_pmp_attach()
2277 if (!(ap->pflags & ATA_PFLAG_FROZEN)) in ahci_pmp_attach()
2281 static void ahci_pmp_detach(struct ata_port *ap) in ahci_pmp_detach() argument
2283 void __iomem *port_mmio = ahci_port_base(ap); in ahci_pmp_detach()
2284 struct ahci_port_priv *pp = ap->private_data; in ahci_pmp_detach()
2287 ahci_disable_fbs(ap); in ahci_pmp_detach()
2296 if (!(ap->pflags & ATA_PFLAG_FROZEN)) in ahci_pmp_detach()
2300 int ahci_port_resume(struct ata_port *ap) in ahci_port_resume() argument
2302 ahci_rpm_get_port(ap); in ahci_port_resume()
2304 ahci_power_up(ap); in ahci_port_resume()
2305 ahci_start_port(ap); in ahci_port_resume()
2307 if (sata_pmp_attached(ap)) in ahci_port_resume()
2308 ahci_pmp_attach(ap); in ahci_port_resume()
2310 ahci_pmp_detach(ap); in ahci_port_resume()
2317 static int ahci_port_suspend(struct ata_port *ap, pm_message_t mesg) in ahci_port_suspend() argument
2322 rc = ahci_deinit_port(ap, &emsg); in ahci_port_suspend()
2324 ahci_power_down(ap); in ahci_port_suspend()
2326 ata_port_err(ap, "%s (%d)\n", emsg, rc); in ahci_port_suspend()
2327 ata_port_freeze(ap); in ahci_port_suspend()
2330 ahci_rpm_put_port(ap); in ahci_port_suspend()
2335 static int ahci_port_start(struct ata_port *ap) in ahci_port_start() argument
2337 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_port_start()
2338 struct device *dev = ap->host->dev; in ahci_port_start()
2348 if (ap->host->n_ports > 1) { in ahci_port_start()
2355 "%s%d", dev_driver_string(dev), ap->port_no); in ahci_port_start()
2359 if ((hpriv->cap & HOST_CAP_FBS) && sata_pmp_supported(ap)) { in ahci_port_start()
2360 void __iomem *port_mmio = ahci_port_base(ap); in ahci_port_start()
2366 ap->port_no); in ahci_port_start()
2370 ap->port_no); in ahci_port_start()
2423 ap->lock = &pp->lock; in ahci_port_start()
2426 ap->private_data = pp; in ahci_port_start()
2429 return ahci_port_resume(ap); in ahci_port_start()
2432 static void ahci_port_stop(struct ata_port *ap) in ahci_port_stop() argument
2435 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_port_stop()
2440 rc = ahci_deinit_port(ap, &emsg); in ahci_port_stop()
2442 ata_port_warn(ap, "%s (%d)\n", emsg, rc); in ahci_port_stop()
2448 writel(1 << ap->port_no, host_mmio + HOST_IRQ_STAT); in ahci_port_stop()
2450 ahci_rpm_put_port(ap); in ahci_port_stop()