Lines Matching refs:dev
170 struct device *dev; member
228 dev_warn(anv->dev, "RTKit crashed; unable to recover without a reboot"); in apple_nvme_rtkit_crashed()
244 dma_alloc_coherent(anv->dev, bfr->size, &bfr->iova, GFP_KERNEL); in apple_nvme_sart_dma_setup()
250 dma_free_coherent(anv->dev, bfr->size, bfr->buffer, bfr->iova); in apple_nvme_sart_dma_setup()
264 dma_free_coherent(anv->dev, bfr->size, bfr->buffer, bfr->iova); in apple_nvme_sart_dma_destroy()
279 dev_warn_ratelimited(anv->dev, in apple_nvmmu_inval()
363 dma_unmap_page(anv->dev, iod->first_dma, iod->dma_len, in apple_nvme_unmap_data()
370 dma_unmap_sg(anv->dev, iod->sg, iod->nents, rq_dma_dir(req)); in apple_nvme_unmap_data()
496 iod->first_dma = dma_map_bvec(anv->dev, bv, rq_dma_dir(req), 0); in apple_nvme_setup_prp_simple()
497 if (dma_mapping_error(anv->dev, iod->first_dma)) in apple_nvme_setup_prp_simple()
532 nr_mapped = dma_map_sg_attrs(anv->dev, iod->sg, iod->nents, in apple_nvme_map_data()
543 dma_unmap_sg(anv->dev, iod->sg, iod->nents, rq_dma_dir(req)); in apple_nvme_map_data()
597 dev_warn(anv->dev, "invalid id %d completed", command_id); in apple_nvme_handle_cqe()
899 dev_warn(anv->dev, in apple_nvme_timeout()
917 dev_warn(anv->dev, in apple_nvme_timeout()
928 dev_warn(anv->dev, "I/O %d(aq:%d) timeout: resetting controller\n", in apple_nvme_timeout()
990 dev_warn(anv->dev, "ctrl state %d is not RESETTING\n", in apple_nvme_reset_work()
998 dev_err(anv->dev, in apple_nvme_reset_work()
1009 dev_dbg(anv->dev, "Trying to shut down RTKit before reset."); in apple_nvme_reset_work()
1033 dev_err(anv->dev, "ANS did not boot"); in apple_nvme_reset_work()
1042 dev_err(anv->dev, "ANS did not initialize"); in apple_nvme_reset_work()
1046 dev_dbg(anv->dev, "ANS booted successfully."); in apple_nvme_reset_work()
1053 dma_max_mapping_size(anv->dev) >> 9); in apple_nvme_reset_work()
1056 dma_set_max_seg_size(anv->dev, 0xffffffff); in apple_nvme_reset_work()
1103 dev_dbg(anv->dev, "Enabling controller now"); in apple_nvme_reset_work()
1108 dev_dbg(anv->dev, "Starting admin queue"); in apple_nvme_reset_work()
1123 dev_dbg(anv->dev, "Creating IOCQ"); in apple_nvme_reset_work()
1127 dev_dbg(anv->dev, "Creating IOSQ"); in apple_nvme_reset_work()
1158 dev_dbg(anv->dev, "ANS boot and NVMe init completed."); in apple_nvme_reset_work()
1181 device_release_driver(anv->dev); in apple_nvme_remove_dead_ctrl_work()
1204 struct device *dev = ctrl_to_apple_nvme(ctrl)->dev; in apple_nvme_get_address() local
1206 return snprintf(buf, size, "%s\n", dev_name(dev)); in apple_nvme_get_address()
1215 put_device(anv->dev); in apple_nvme_free_ctrl()
1259 ret = devm_add_action_or_reset(anv->dev, devm_apple_nvme_put_tag_set, in apple_nvme_alloc_tagsets()
1283 ret = devm_add_action_or_reset(anv->dev, devm_apple_nvme_put_tag_set, in apple_nvme_alloc_tagsets()
1299 q->cqes = dmam_alloc_coherent(anv->dev, in apple_nvme_queue_alloc()
1305 q->sqes = dmam_alloc_coherent(anv->dev, in apple_nvme_queue_alloc()
1315 q->tcbs = dmam_alloc_coherent(anv->dev, in apple_nvme_queue_alloc()
1347 struct device *dev = anv->dev; in apple_nvme_attach_genpd() local
1351 dev->of_node, "power-domains", "#power-domain-cells"); in apple_nvme_attach_genpd()
1355 anv->pd_dev = devm_kcalloc(dev, anv->pd_count, sizeof(*anv->pd_dev), in apple_nvme_attach_genpd()
1360 anv->pd_link = devm_kcalloc(dev, anv->pd_count, sizeof(*anv->pd_link), in apple_nvme_attach_genpd()
1366 anv->pd_dev[i] = dev_pm_domain_attach_by_id(dev, i); in apple_nvme_attach_genpd()
1372 anv->pd_link[i] = device_link_add(dev, anv->pd_dev[i], in apple_nvme_attach_genpd()
1392 struct device *dev = &pdev->dev; in apple_nvme_probe() local
1396 anv = devm_kzalloc(dev, sizeof(*anv), GFP_KERNEL); in apple_nvme_probe()
1400 anv->dev = get_device(dev); in apple_nvme_probe()
1406 dev_err_probe(dev, ret, "Failed to attach power domains"); in apple_nvme_probe()
1409 if (dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64))) { in apple_nvme_probe()
1440 anv->sart = devm_apple_sart_get(dev); in apple_nvme_probe()
1442 ret = dev_err_probe(dev, PTR_ERR(anv->sart), in apple_nvme_probe()
1447 anv->reset = devm_reset_control_array_get_exclusive(anv->dev); in apple_nvme_probe()
1449 ret = dev_err_probe(dev, PTR_ERR(anv->reset), in apple_nvme_probe()
1465 anv->prp_page_pool = dmam_pool_create("prp list page", anv->dev, in apple_nvme_probe()
1474 dmam_pool_create("prp list 256", anv->dev, 256, 256, 0); in apple_nvme_probe()
1487 ret = devm_add_action_or_reset(anv->dev, in apple_nvme_probe()
1496 ret = devm_request_irq(anv->dev, anv->irq, apple_nvme_irq, 0, in apple_nvme_probe()
1499 dev_err_probe(dev, ret, "Failed to request IRQ"); in apple_nvme_probe()
1504 devm_apple_rtkit_init(dev, anv, NULL, 0, &apple_nvme_rtkit_ops); in apple_nvme_probe()
1506 ret = dev_err_probe(dev, PTR_ERR(anv->rtk), in apple_nvme_probe()
1511 ret = nvme_init_ctrl(&anv->ctrl, anv->dev, &nvme_ctrl_ops, in apple_nvme_probe()
1514 dev_err_probe(dev, ret, "Failed to initialize nvme_ctrl"); in apple_nvme_probe()
1530 put_device(anv->dev); in apple_nvme_probe()
1562 static int apple_nvme_resume(struct device *dev) in apple_nvme_resume() argument
1564 struct apple_nvme *anv = dev_get_drvdata(dev); in apple_nvme_resume()
1569 static int apple_nvme_suspend(struct device *dev) in apple_nvme_suspend() argument
1571 struct apple_nvme *anv = dev_get_drvdata(dev); in apple_nvme_suspend()