Lines Matching refs:ap
194 struct ata_link *ata_link_next(struct ata_link *link, struct ata_port *ap, in ata_link_next() argument
205 if (sata_pmp_attached(ap)) in ata_link_next()
206 return ap->pmp_link; in ata_link_next()
209 return &ap->link; in ata_link_next()
213 if (link == &ap->link) in ata_link_next()
216 if (sata_pmp_attached(ap)) in ata_link_next()
217 return ap->pmp_link; in ata_link_next()
220 if (unlikely(ap->slave_link)) in ata_link_next()
221 return ap->slave_link; in ata_link_next()
228 if (unlikely(link == ap->slave_link)) in ata_link_next()
232 if (++link < ap->pmp_link + ap->nr_pmp_links) in ata_link_next()
236 return &ap->link; in ata_link_next()
310 struct ata_port *ap = dev->link->ap; in ata_dev_phys_link() local
312 if (!ap->slave_link) in ata_dev_phys_link()
315 return &ap->link; in ata_dev_phys_link()
316 return ap->slave_link; in ata_dev_phys_link()
332 void ata_force_cbl(struct ata_port *ap) in ata_force_cbl() argument
339 if (fe->port != -1 && fe->port != ap->print_id) in ata_force_cbl()
345 ap->cbl = fe->param.cbl; in ata_force_cbl()
346 ata_port_notice(ap, "FORCE: cable set to %s\n", fe->param.name); in ata_force_cbl()
379 if (fe->port != -1 && fe->port != link->ap->print_id) in ata_force_link_limits()
428 if (fe->port != -1 && fe->port != dev->link->ap->print_id) in ata_force_xfermask()
481 if (fe->port != -1 && fe->port != dev->link->ap->print_id) in ata_force_horkage()
665 } else if (lba48 && (dev->link->ap->flags & ATA_FLAG_PIO_LBA48)) { in ata_rwcmd_protocol()
1559 struct ata_port *ap = link->ap; in ata_exec_internal_sg() local
1571 spin_lock_irqsave(ap->lock, flags); in ata_exec_internal_sg()
1574 if (ap->pflags & ATA_PFLAG_FROZEN) { in ata_exec_internal_sg()
1575 spin_unlock_irqrestore(ap->lock, flags); in ata_exec_internal_sg()
1586 if (ap->ops->error_handler) in ata_exec_internal_sg()
1591 qc = __ata_qc_from_tag(ap, tag); in ata_exec_internal_sg()
1595 qc->ap = ap; in ata_exec_internal_sg()
1601 preempted_qc_active = ap->qc_active; in ata_exec_internal_sg()
1602 preempted_nr_active_links = ap->nr_active_links; in ata_exec_internal_sg()
1605 ap->qc_active = 0; in ata_exec_internal_sg()
1606 ap->nr_active_links = 0; in ata_exec_internal_sg()
1636 spin_unlock_irqrestore(ap->lock, flags); in ata_exec_internal_sg()
1647 if (ap->ops->error_handler) in ata_exec_internal_sg()
1648 ata_eh_release(ap); in ata_exec_internal_sg()
1652 if (ap->ops->error_handler) in ata_exec_internal_sg()
1653 ata_eh_acquire(ap); in ata_exec_internal_sg()
1655 ata_sff_flush_pio_task(ap); in ata_exec_internal_sg()
1658 spin_lock_irqsave(ap->lock, flags); in ata_exec_internal_sg()
1668 if (ap->ops->error_handler) in ata_exec_internal_sg()
1669 ata_port_freeze(ap); in ata_exec_internal_sg()
1673 if (ata_msg_warn(ap)) in ata_exec_internal_sg()
1678 spin_unlock_irqrestore(ap->lock, flags); in ata_exec_internal_sg()
1682 if (ap->ops->post_internal_cmd) in ata_exec_internal_sg()
1683 ap->ops->post_internal_cmd(qc); in ata_exec_internal_sg()
1698 spin_lock_irqsave(ap->lock, flags); in ata_exec_internal_sg()
1706 ap->qc_active = preempted_qc_active; in ata_exec_internal_sg()
1707 ap->nr_active_links = preempted_nr_active_links; in ata_exec_internal_sg()
1709 spin_unlock_irqrestore(ap->lock, flags); in ata_exec_internal_sg()
1768 if (adev->link->ap->pflags & ATA_PFLAG_RESETTING) in ata_pio_need_iordy()
1773 if (adev->link->ap->flags & ATA_FLAG_NO_IORDY) in ata_pio_need_iordy()
1852 struct ata_port *ap = dev->link->ap; in ata_dev_read_id() local
1861 if (ata_msg_ctl(ap)) in ata_dev_read_id()
1895 if (ap->ops->read_id) in ata_dev_read_id()
1896 err_mask = ap->ops->read_id(dev, &tf, id); in ata_dev_read_id()
1966 if (ap->host->flags & ATA_HOST_IGNORE_ATA && in ata_dev_read_id()
2032 if (ata_msg_warn(ap)) in ata_dev_read_id()
2073 struct ata_port *ap = dev->link->ap; in ata_dev_knobble() local
2078 return ((ap->cbl == ATA_CBL_SATA) && (!ata_id_is_sata(dev->id))); in ata_dev_knobble()
2084 struct ata_port *ap = dev->link->ap; in ata_dev_config_ncq() local
2097 if (ap->flags & ATA_FLAG_NCQ) { in ata_dev_config_ncq()
2098 hdepth = min(ap->scsi_host->can_queue, ATA_MAX_QUEUE - 1); in ata_dev_config_ncq()
2103 (ap->flags & ATA_FLAG_FPDMA_AA) && in ata_dev_config_ncq()
2125 if ((ap->flags & ATA_FLAG_FPDMA_AUX) && in ata_dev_config_ncq()
2128 0, ap->sector_buf, 1); in ata_dev_config_ncq()
2137 memcpy(cmds, ap->sector_buf, ATA_LOG_NCQ_SEND_RECV_SIZE); in ata_dev_config_ncq()
2165 struct ata_port *ap = dev->link->ap; in ata_dev_configure() local
2176 if (!ata_dev_enabled(dev) && ata_msg_info(ap)) { in ata_dev_configure()
2181 if (ata_msg_probe(ap)) in ata_dev_configure()
2194 if ((!atapi_enabled || (ap->flags & ATA_FLAG_NO_ATAPI)) && in ata_dev_configure()
2214 dev->link->ap->target_lpm_policy = ATA_LPM_MAX_POWER; in ata_dev_configure()
2228 if (ata_msg_probe(ap)) in ata_dev_configure()
2253 if (ata_msg_probe(ap)) in ata_dev_configure()
2312 if (ata_msg_drv(ap) && print_info) { in ata_dev_configure()
2337 if (ata_msg_drv(ap) && print_info) { in ata_dev_configure()
2353 u8 *sata_setting = ap->sector_buf; in ata_dev_configure()
2385 if (ata_msg_warn(ap)) in ata_dev_configure()
2398 (ap->flags & ATA_FLAG_AN) && ata_id_has_atapi_AN(id) && in ata_dev_configure()
2399 (!sata_pmp_attached(ap) || in ata_dev_configure()
2400 sata_scr_read(&ap->link, SCR_NOTIFICATION, &sntf) == 0)) { in ata_dev_configure()
2430 if (ata_msg_drv(ap) && print_info) in ata_dev_configure()
2447 if (ata_msg_drv(ap) && print_info) in ata_dev_configure()
2470 if (ap->ops->dev_config) in ata_dev_configure()
2471 ap->ops->dev_config(dev); in ata_dev_configure()
2496 if (ata_msg_probe(ap)) in ata_dev_configure()
2509 int ata_cable_40wire(struct ata_port *ap) in ata_cable_40wire() argument
2522 int ata_cable_80wire(struct ata_port *ap) in ata_cable_80wire() argument
2534 int ata_cable_unknown(struct ata_port *ap) in ata_cable_unknown() argument
2546 int ata_cable_ignore(struct ata_port *ap) in ata_cable_ignore() argument
2558 int ata_cable_sata(struct ata_port *ap) in ata_cable_sata() argument
2578 int ata_bus_probe(struct ata_port *ap) in ata_bus_probe() argument
2585 ata_for_each_dev(dev, &ap->link, ALL) in ata_bus_probe()
2589 ata_for_each_dev(dev, &ap->link, ALL) { in ata_bus_probe()
2605 if (ap->ops->set_piomode) in ata_bus_probe()
2606 ap->ops->set_piomode(ap, dev); in ata_bus_probe()
2610 ap->ops->phy_reset(ap); in ata_bus_probe()
2612 ata_for_each_dev(dev, &ap->link, ALL) { in ata_bus_probe()
2625 ata_for_each_dev(dev, &ap->link, ALL_REVERSE) { in ata_bus_probe()
2639 if (ap->ops->cable_detect) in ata_bus_probe()
2640 ap->cbl = ap->ops->cable_detect(ap); in ata_bus_probe()
2647 ata_for_each_dev(dev, &ap->link, ENABLED) in ata_bus_probe()
2649 ap->cbl = ATA_CBL_SATA; in ata_bus_probe()
2654 ata_for_each_dev(dev, &ap->link, ENABLED) { in ata_bus_probe()
2655 ap->link.eh_context.i.flags |= ATA_EHI_PRINTINFO; in ata_bus_probe()
2657 ap->link.eh_context.i.flags &= ~ATA_EHI_PRINTINFO; in ata_bus_probe()
2663 rc = ata_set_mode(&ap->link, &dev); in ata_bus_probe()
2667 ata_for_each_dev(dev, &ap->link, ENABLED) in ata_bus_probe()
2689 sata_down_spd_limit(&ap->link, 0); in ata_bus_probe()
2820 struct ata_link *host_link = &link->ap->link; in __sata_set_spd_needed()
3205 struct ata_port *ap = dev->link->ap; in ata_dev_set_mode() local
3217 if (nosetxfer && ap->flags & ATA_FLAG_SATA && ata_id_is_sata(dev->id)) in ata_dev_set_mode()
3303 struct ata_port *ap = link->ap; in ata_do_set_mode() local
3349 if (ap->ops->set_piomode) in ata_do_set_mode()
3350 ap->ops->set_piomode(ap, dev); in ata_do_set_mode()
3360 if (ap->ops->set_dmamode) in ata_do_set_mode()
3361 ap->ops->set_dmamode(ap, dev); in ata_do_set_mode()
3374 if (used_dma && (ap->host->flags & ATA_HOST_SIMPLEX)) in ata_do_set_mode()
3375 ap->host->simplex_claimed = ap; in ata_do_set_mode()
3411 if (link->ap->host->flags & ATA_HOST_PARALLEL_SCAN) in ata_wait_ready()
3420 WARN_ON(link == link->ap->slave_link); in ata_wait_ready()
3447 else if ((link->ap->flags & ATA_FLAG_SATA) && in ata_wait_ready()
3466 ata_msleep(link->ap, 50); in ata_wait_ready()
3487 ata_msleep(link->ap, ATA_WAIT_AFTER_RESET); in ata_wait_after_reset()
3535 ata_msleep(link->ap, interval); in sata_link_debounce()
3600 ata_msleep(link->ap, 200); in sata_link_resume()
3718 struct ata_port *ap = link->ap; in ata_std_prereset() local
3728 if (ap->flags & ATA_FLAG_SATA) { in ata_std_prereset()
3809 ata_msleep(link->ap, 1); in sata_link_hardreset()
3823 if (sata_pmp_supported(link->ap) && ata_is_host_link(link)) { in sata_link_hardreset()
3976 u16 *id = (void *)dev->link->ap->sector_buf; in ata_dev_reread_id()
4313 if ((dev->link->ap->flags & ATA_FLAG_PIO_POLLING) && in ata_dma_blacklisted()
4347 static int cable_is_40wire(struct ata_port *ap) in cable_is_40wire() argument
4353 if (ap->cbl == ATA_CBL_PATA40) in cable_is_40wire()
4357 if (ap->cbl == ATA_CBL_PATA80 || ap->cbl == ATA_CBL_SATA) in cable_is_40wire()
4364 if (ap->cbl == ATA_CBL_PATA40_SHORT) in cable_is_40wire()
4376 ata_for_each_link(link, ap, EDGE) { in cable_is_40wire()
4400 struct ata_port *ap = link->ap; in ata_dev_xfermask() local
4401 struct ata_host *host = ap->host; in ata_dev_xfermask()
4405 xfer_mask = ata_pack_xfermask(ap->pio_mask, in ata_dev_xfermask()
4406 ap->mwdma_mask, ap->udma_mask); in ata_dev_xfermask()
4431 host->simplex_claimed && host->simplex_claimed != ap) { in ata_dev_xfermask()
4437 if (ap->flags & ATA_FLAG_NO_IORDY) in ata_dev_xfermask()
4440 if (ap->ops->mode_filter) in ata_dev_xfermask()
4441 xfer_mask = ap->ops->mode_filter(dev, xfer_mask); in ata_dev_xfermask()
4453 if (cable_is_40wire(ap)) { in ata_dev_xfermask()
4600 struct ata_port *ap = qc->ap; in ata_sg_clean() local
4609 dma_unmap_sg(ap->dev, sg, qc->orig_n_elem, dir); in ata_sg_clean()
4631 struct ata_port *ap = qc->ap; in atapi_check_dma() local
4640 if (ap->ops->check_atapi_dma) in atapi_check_dma()
4641 return ap->ops->check_atapi_dma(qc); in atapi_check_dma()
4714 struct ata_port *ap = qc->ap; in ata_sg_setup() local
4717 VPRINTK("ENTER, ata%u\n", ap->print_id); in ata_sg_setup()
4719 n_elem = dma_map_sg(ap->dev, qc->sg, qc->n_elem, qc->dma_dir); in ata_sg_setup()
4764 struct ata_port *ap = dev->link->ap; in ata_qc_new_init() local
4768 if (unlikely(ap->pflags & ATA_PFLAG_FROZEN)) in ata_qc_new_init()
4772 if (ap->flags & ATA_FLAG_SAS_HOST) { in ata_qc_new_init()
4773 tag = ata_sas_allocate_tag(ap); in ata_qc_new_init()
4778 qc = __ata_qc_from_tag(ap, tag); in ata_qc_new_init()
4781 qc->ap = ap; in ata_qc_new_init()
4801 struct ata_port *ap; in ata_qc_free() local
4805 ap = qc->ap; in ata_qc_free()
4811 if (ap->flags & ATA_FLAG_SAS_HOST) in ata_qc_free()
4812 ata_sas_free_tag(tag, ap); in ata_qc_free()
4818 struct ata_port *ap; in __ata_qc_complete() local
4823 ap = qc->ap; in __ata_qc_complete()
4833 ap->nr_active_links--; in __ata_qc_complete()
4836 ap->nr_active_links--; in __ata_qc_complete()
4841 ap->excl_link == link)) in __ata_qc_complete()
4842 ap->excl_link = NULL; in __ata_qc_complete()
4849 ap->qc_active &= ~(1 << qc->tag); in __ata_qc_complete()
4857 struct ata_port *ap = qc->ap; in fill_result_tf() local
4860 ap->ops->qc_fill_rtf(qc); in fill_result_tf()
4893 struct ata_port *ap = qc->ap; in ata_qc_complete() local
4908 if (ap->ops->error_handler) { in ata_qc_complete()
4937 WARN_ON_ONCE(ap->pflags & ATA_PFLAG_FROZEN); in ata_qc_complete()
4957 ata_port_schedule_eh(ap); in ata_qc_complete()
5001 int ata_qc_complete_multiple(struct ata_port *ap, u32 qc_active) in ata_qc_complete_multiple() argument
5006 done_mask = ap->qc_active ^ qc_active; in ata_qc_complete_multiple()
5009 ata_port_err(ap, "illegal qc_active transition (%08x->%08x)\n", in ata_qc_complete_multiple()
5010 ap->qc_active, qc_active); in ata_qc_complete_multiple()
5018 qc = ata_qc_from_tag(ap, tag); in ata_qc_complete_multiple()
5043 struct ata_port *ap = qc->ap; in ata_qc_issue() local
5051 WARN_ON_ONCE(ap->ops->error_handler && ata_tag_valid(link->active_tag)); in ata_qc_issue()
5057 ap->nr_active_links++; in ata_qc_issue()
5062 ap->nr_active_links++; in ata_qc_issue()
5067 ap->qc_active |= 1 << qc->tag; in ata_qc_issue()
5078 (ap->flags & ATA_FLAG_PIO_DMA))) in ata_qc_issue()
5090 ap->ops->qc_prep(qc); in ata_qc_issue()
5092 qc->err_mask |= ap->ops->qc_issue(qc); in ata_qc_issue()
5117 struct ata_port *ap = link->ap; in sata_scr_valid() local
5119 return (ap->flags & ATA_FLAG_SATA) && ap->ops->scr_read; in sata_scr_valid()
5142 return link->ap->ops->scr_read(link, reg, val); in sata_scr_read()
5169 return link->ap->ops->scr_write(link, reg, val); in sata_scr_write()
5197 rc = link->ap->ops->scr_write(link, reg, val); in sata_scr_write_flush()
5199 rc = link->ap->ops->scr_read(link, reg, &val); in sata_scr_write_flush()
5274 struct ata_link *slave = link->ap->slave_link; in ata_link_online()
5300 struct ata_link *slave = link->ap->slave_link; in ata_link_offline()
5309 static void ata_port_request_pm(struct ata_port *ap, pm_message_t mesg, in ata_port_request_pm() argument
5319 if (ap->pflags & ATA_PFLAG_PM_PENDING) { in ata_port_request_pm()
5320 ata_port_wait_eh(ap); in ata_port_request_pm()
5321 WARN_ON(ap->pflags & ATA_PFLAG_PM_PENDING); in ata_port_request_pm()
5325 spin_lock_irqsave(ap->lock, flags); in ata_port_request_pm()
5327 ap->pm_mesg = mesg; in ata_port_request_pm()
5328 ap->pflags |= ATA_PFLAG_PM_PENDING; in ata_port_request_pm()
5329 ata_for_each_link(link, ap, HOST_FIRST) { in ata_port_request_pm()
5334 ata_port_schedule_eh(ap); in ata_port_request_pm()
5336 spin_unlock_irqrestore(ap->lock, flags); in ata_port_request_pm()
5339 ata_port_wait_eh(ap); in ata_port_request_pm()
5340 WARN_ON(ap->pflags & ATA_PFLAG_PM_PENDING); in ata_port_request_pm()
5355 static void ata_port_suspend(struct ata_port *ap, pm_message_t mesg) in ata_port_suspend() argument
5357 ata_port_request_pm(ap, mesg, 0, ata_port_suspend_ehi, false); in ata_port_suspend()
5360 static void ata_port_suspend_async(struct ata_port *ap, pm_message_t mesg) in ata_port_suspend_async() argument
5362 ata_port_request_pm(ap, mesg, 0, ata_port_suspend_ehi, true); in ata_port_suspend_async()
5367 struct ata_port *ap = to_ata_port(dev); in ata_port_pm_suspend() local
5372 ata_port_suspend(ap, PMSG_SUSPEND); in ata_port_pm_suspend()
5378 struct ata_port *ap = to_ata_port(dev); in ata_port_pm_freeze() local
5383 ata_port_suspend(ap, PMSG_FREEZE); in ata_port_pm_freeze()
5396 static void ata_port_resume(struct ata_port *ap, pm_message_t mesg) in ata_port_resume() argument
5398 ata_port_request_pm(ap, mesg, ATA_EH_RESET, ata_port_resume_ehi, false); in ata_port_resume()
5401 static void ata_port_resume_async(struct ata_port *ap, pm_message_t mesg) in ata_port_resume_async() argument
5403 ata_port_request_pm(ap, mesg, ATA_EH_RESET, ata_port_resume_ehi, true); in ata_port_resume_async()
5425 struct ata_port *ap = to_ata_port(dev); in ata_port_runtime_idle() local
5429 ata_for_each_link(link, ap, HOST_FIRST) { in ata_port_runtime_idle()
5469 void ata_sas_port_suspend(struct ata_port *ap) in ata_sas_port_suspend() argument
5471 ata_port_suspend_async(ap, PMSG_SUSPEND); in ata_sas_port_suspend()
5475 void ata_sas_port_resume(struct ata_port *ap) in ata_sas_port_resume() argument
5477 ata_port_resume_async(ap, PMSG_RESUME); in ata_sas_port_resume()
5525 struct ata_port *ap = link->ap; in ata_dev_init() local
5536 spin_lock_irqsave(ap->lock, flags); in ata_dev_init()
5539 spin_unlock_irqrestore(ap->lock, flags); in ata_dev_init()
5559 void ata_link_init(struct ata_port *ap, struct ata_link *link, int pmp) in ata_link_init() argument
5567 link->ap = ap; in ata_link_init()
5632 struct ata_port *ap; in ata_port_alloc() local
5636 ap = kzalloc(sizeof(*ap), GFP_KERNEL); in ata_port_alloc()
5637 if (!ap) in ata_port_alloc()
5640 ap->pflags |= ATA_PFLAG_INITIALIZING | ATA_PFLAG_FROZEN; in ata_port_alloc()
5641 ap->lock = &host->lock; in ata_port_alloc()
5642 ap->print_id = -1; in ata_port_alloc()
5643 ap->local_port_no = -1; in ata_port_alloc()
5644 ap->host = host; in ata_port_alloc()
5645 ap->dev = host->dev; in ata_port_alloc()
5649 ap->msg_enable = 0x00FF; in ata_port_alloc()
5651 ap->msg_enable = ATA_MSG_DRV | ATA_MSG_INFO | ATA_MSG_CTL | ATA_MSG_WARN | ATA_MSG_ERR; in ata_port_alloc()
5653 ap->msg_enable = ATA_MSG_DRV | ATA_MSG_ERR | ATA_MSG_WARN; in ata_port_alloc()
5656 mutex_init(&ap->scsi_scan_mutex); in ata_port_alloc()
5657 INIT_DELAYED_WORK(&ap->hotplug_task, ata_scsi_hotplug); in ata_port_alloc()
5658 INIT_WORK(&ap->scsi_rescan_task, ata_scsi_dev_rescan); in ata_port_alloc()
5659 INIT_LIST_HEAD(&ap->eh_done_q); in ata_port_alloc()
5660 init_waitqueue_head(&ap->eh_wait_q); in ata_port_alloc()
5661 init_completion(&ap->park_req_pending); in ata_port_alloc()
5662 init_timer_deferrable(&ap->fastdrain_timer); in ata_port_alloc()
5663 ap->fastdrain_timer.function = ata_eh_fastdrain_timerfn; in ata_port_alloc()
5664 ap->fastdrain_timer.data = (unsigned long)ap; in ata_port_alloc()
5666 ap->cbl = ATA_CBL_NONE; in ata_port_alloc()
5668 ata_link_init(ap, &ap->link, 0); in ata_port_alloc()
5671 ap->stats.unhandled_irq = 1; in ata_port_alloc()
5672 ap->stats.idle_irq = 1; in ata_port_alloc()
5674 ata_sff_port_init(ap); in ata_port_alloc()
5676 return ap; in ata_port_alloc()
5685 struct ata_port *ap = host->ports[i]; in ata_host_release() local
5687 if (!ap) in ata_host_release()
5690 if (ap->scsi_host) in ata_host_release()
5691 scsi_host_put(ap->scsi_host); in ata_host_release()
5693 kfree(ap->pmp_link); in ata_host_release()
5694 kfree(ap->slave_link); in ata_host_release()
5695 kfree(ap); in ata_host_release()
5750 struct ata_port *ap; in ata_host_alloc() local
5752 ap = ata_port_alloc(host); in ata_host_alloc()
5753 if (!ap) in ata_host_alloc()
5756 ap->port_no = i; in ata_host_alloc()
5757 host->ports[i] = ap; in ata_host_alloc()
5797 struct ata_port *ap = host->ports[i]; in ata_host_alloc_pinfo() local
5802 ap->pio_mask = pi->pio_mask; in ata_host_alloc_pinfo()
5803 ap->mwdma_mask = pi->mwdma_mask; in ata_host_alloc_pinfo()
5804 ap->udma_mask = pi->udma_mask; in ata_host_alloc_pinfo()
5805 ap->flags |= pi->flags; in ata_host_alloc_pinfo()
5806 ap->link.flags |= pi->link_flags; in ata_host_alloc_pinfo()
5807 ap->ops = pi->port_ops; in ata_host_alloc_pinfo()
5862 int ata_slave_link_init(struct ata_port *ap) in ata_slave_link_init() argument
5866 WARN_ON(ap->slave_link); in ata_slave_link_init()
5867 WARN_ON(ap->flags & ATA_FLAG_PMP); in ata_slave_link_init()
5873 ata_link_init(ap, link, 1); in ata_slave_link_init()
5874 ap->slave_link = link; in ata_slave_link_init()
5886 struct ata_port *ap = host->ports[i]; in ata_host_stop() local
5888 if (ap->ops->port_stop) in ata_host_stop()
5889 ap->ops->port_stop(ap); in ata_host_stop()
5974 struct ata_port *ap = host->ports[i]; in ata_host_start() local
5976 ata_finalize_port_ops(ap->ops); in ata_host_start()
5978 if (!host->ops && !ata_port_is_dummy(ap)) in ata_host_start()
5979 host->ops = ap->ops; in ata_host_start()
5981 if (ap->ops->port_stop) in ata_host_start()
5995 struct ata_port *ap = host->ports[i]; in ata_host_start() local
5997 if (ap->ops->port_start) { in ata_host_start()
5998 rc = ap->ops->port_start(ap); in ata_host_start()
6007 ata_eh_freeze_port(ap); in ata_host_start()
6017 struct ata_port *ap = host->ports[i]; in ata_host_start() local
6019 if (ap->ops->port_stop) in ata_host_start()
6020 ap->ops->port_stop(ap); in ata_host_start()
6043 void __ata_port_probe(struct ata_port *ap) in __ata_port_probe() argument
6045 struct ata_eh_info *ehi = &ap->link.eh_info; in __ata_port_probe()
6049 spin_lock_irqsave(ap->lock, flags); in __ata_port_probe()
6055 ap->pflags &= ~ATA_PFLAG_INITIALIZING; in __ata_port_probe()
6056 ap->pflags |= ATA_PFLAG_LOADING; in __ata_port_probe()
6057 ata_port_schedule_eh(ap); in __ata_port_probe()
6059 spin_unlock_irqrestore(ap->lock, flags); in __ata_port_probe()
6062 int ata_port_probe(struct ata_port *ap) in ata_port_probe() argument
6066 if (ap->ops->error_handler) { in ata_port_probe()
6067 __ata_port_probe(ap); in ata_port_probe()
6068 ata_port_wait_eh(ap); in ata_port_probe()
6070 DPRINTK("ata%u: bus probe begin\n", ap->print_id); in ata_port_probe()
6071 rc = ata_bus_probe(ap); in ata_port_probe()
6072 DPRINTK("ata%u: bus probe end\n", ap->print_id); in ata_port_probe()
6080 struct ata_port *ap = data; in async_port_probe() local
6089 if (!(ap->host->flags & ATA_HOST_PARALLEL_SCAN) && ap->port_no != 0) in async_port_probe()
6092 (void)ata_port_probe(ap); in async_port_probe()
6097 ata_scsi_scan_host(ap, 1); in async_port_probe()
6156 struct ata_port *ap = host->ports[i]; in ata_host_register() local
6160 if (ap->cbl == ATA_CBL_NONE && (ap->flags & ATA_FLAG_SATA)) in ata_host_register()
6161 ap->cbl = ATA_CBL_SATA; in ata_host_register()
6164 sata_link_init_spd(&ap->link); in ata_host_register()
6165 if (ap->slave_link) in ata_host_register()
6166 sata_link_init_spd(ap->slave_link); in ata_host_register()
6169 xfer_mask = ata_pack_xfermask(ap->pio_mask, ap->mwdma_mask, in ata_host_register()
6170 ap->udma_mask); in ata_host_register()
6172 if (!ata_port_is_dummy(ap)) { in ata_host_register()
6173 ata_port_info(ap, "%cATA max %s %s\n", in ata_host_register()
6174 (ap->flags & ATA_FLAG_SATA) ? 'S' : 'P', in ata_host_register()
6176 ap->link.eh_info.desc); in ata_host_register()
6177 ata_ehi_clear_desc(&ap->link.eh_info); in ata_host_register()
6179 ata_port_info(ap, "DUMMY\n"); in ata_host_register()
6184 struct ata_port *ap = host->ports[i]; in ata_host_register() local
6185 async_schedule(async_port_probe, ap); in ata_host_register()
6264 static void ata_port_detach(struct ata_port *ap) in ata_port_detach() argument
6270 if (!ap->ops->error_handler) in ata_port_detach()
6274 spin_lock_irqsave(ap->lock, flags); in ata_port_detach()
6275 ap->pflags |= ATA_PFLAG_UNLOADING; in ata_port_detach()
6276 ata_port_schedule_eh(ap); in ata_port_detach()
6277 spin_unlock_irqrestore(ap->lock, flags); in ata_port_detach()
6280 ata_port_wait_eh(ap); in ata_port_detach()
6283 WARN_ON(!(ap->pflags & ATA_PFLAG_UNLOADED)); in ata_port_detach()
6285 cancel_delayed_work_sync(&ap->hotplug_task); in ata_port_detach()
6289 ata_for_each_link(link, ap, HOST_FIRST) { in ata_port_detach()
6295 if (ap->pmp_link) { in ata_port_detach()
6298 ata_tlink_delete(&ap->pmp_link[i]); in ata_port_detach()
6301 scsi_remove_host(ap->scsi_host); in ata_port_detach()
6302 ata_tport_delete(ap); in ata_port_detach()
6693 void ata_msleep(struct ata_port *ap, unsigned int msecs) in ata_msleep() argument
6695 bool owns_eh = ap && ap->host->eh_owner == current; in ata_msleep()
6698 ata_eh_release(ap); in ata_msleep()
6703 ata_eh_acquire(ap); in ata_msleep()
6730 u32 ata_wait_register(struct ata_port *ap, void __iomem *reg, u32 mask, u32 val, in ata_wait_register() argument
6745 ata_msleep(ap, interval); in ata_wait_register()
6792 static void ata_dummy_error_handler(struct ata_port *ap) in ata_dummy_error_handler() argument
6812 void ata_port_printk(const struct ata_port *ap, const char *level, in ata_port_printk() argument
6823 printk("%sata%u: %pV", level, ap->print_id, &vaf); in ata_port_printk()
6840 if (sata_pmp_attached(link->ap) || link->ap->slave_link) in ata_link_printk()
6842 level, link->ap->print_id, link->pmp, &vaf); in ata_link_printk()
6845 level, link->ap->print_id, &vaf); in ata_link_printk()
6863 level, dev->link->ap->print_id, dev->link->pmp + dev->devno, in ata_dev_printk()