void qdio_allocate_dbf(struct qdio_initialize *init_data, struct qdio_irq *irq_ptr) { char text[20]; DBF_EVENT("qfmt:%1d", init_data->q_format); DBF_HEX(init_data->adapter_name, 8); DBF_EVENT("qpff%4x", init_data->qib_param_field_format); DBF_HEX(&init_data->qib_param_field, sizeof(void *)); DBF_HEX(&init_data->input_slib_elements, sizeof(void *)); DBF_HEX(&init_data->output_slib_elements, sizeof(void *)); DBF_EVENT("niq:%1d noq:%1d", init_data->no_input_qs, init_data->no_output_qs); DBF_HEX(&init_data->input_handler, sizeof(void *)); DBF_HEX(&init_data->output_handler, sizeof(void *)); DBF_HEX(&init_data->int_parm, sizeof(long)); DBF_HEX(&init_data->input_sbal_addr_array, sizeof(void *)); DBF_HEX(&init_data->output_sbal_addr_array, sizeof(void *)); DBF_EVENT("irq:%8lx", (unsigned long)irq_ptr); /* allocate trace view for the interface */ snprintf(text, 20, "qdio_%s", dev_name(&init_data->cdev->dev)); irq_ptr->debug_area = debug_register(text, 2, 1, 16); debug_register_view(irq_ptr->debug_area, &debug_hex_ascii_view); debug_set_level(irq_ptr->debug_area, DBF_WARN); DBF_DEV_EVENT(DBF_ERR, irq_ptr, "dbf created"); }
/* * dasd_default_erp_action just retries the current cqr */ struct dasd_ccw_req * dasd_default_erp_action(struct dasd_ccw_req *cqr) { struct dasd_device *device; device = cqr->startdev; /* just retry - there is nothing to save ... I got no sense data.... */ if (cqr->retries > 0) { DBF_DEV_EVENT(DBF_DEBUG, device, "default ERP called (%i retries left)", cqr->retries); <<<<<<< HEAD
/* * performs formatting of _device_ according to _fdata_ * Note: The discipline's format_function is assumed to deliver formatting * commands to format a single unit of the device. In terms of the ECKD * devices this means CCWs are generated to format a single track. */ static int dasd_format(struct dasd_block *block, struct format_data_t *fdata) { struct dasd_ccw_req *cqr; struct dasd_device *base; int rc; base = block->base; if (base->discipline->format_device == NULL) return -EPERM; if (base->state != DASD_STATE_BASIC) { DEV_MESSAGE(KERN_WARNING, base, "%s", "dasd_format: device is not disabled! "); return -EBUSY; } DBF_DEV_EVENT(DBF_NOTICE, base, "formatting units %d to %d (%d B blocks) flags %d", fdata->start_unit, fdata->stop_unit, fdata->blksize, fdata->intensity); /* Since dasdfmt keeps the device open after it was disabled, * there still exists an inode for this device. * We must update i_blkbits, otherwise we might get errors when * enabling the device later. */ if (fdata->start_unit == 0) { struct block_device *bdev = bdget_disk(block->gdp, 0); bdev->bd_inode->i_blkbits = blksize_bits(fdata->blksize); bdput(bdev); } while (fdata->start_unit <= fdata->stop_unit) { cqr = base->discipline->format_device(base, fdata); if (IS_ERR(cqr)) return PTR_ERR(cqr); rc = dasd_sleep_on_interruptible(cqr); dasd_sfree_request(cqr, cqr->memdev); if (rc) { if (rc != -ERESTARTSYS) DEV_MESSAGE(KERN_ERR, base, " Formatting of unit %d failed " "with rc = %d", fdata->start_unit, rc); return rc; } fdata->start_unit++; } return 0; }
/* * performs formatting of _device_ according to _fdata_ * Note: The discipline's format_function is assumed to deliver formatting * commands to format a single unit of the device. In terms of the ECKD * devices this means CCWs are generated to format a single track. */ static int dasd_format(struct dasd_block *block, struct format_data_t *fdata) { struct dasd_ccw_req *cqr; struct dasd_device *base; int rc; base = block->base; if (base->discipline->format_device == NULL) return -EPERM; if (base->state != DASD_STATE_BASIC) { pr_warning("%s: The DASD cannot be formatted while it is " "enabled\n", dev_name(&base->cdev->dev)); return -EBUSY; } DBF_DEV_EVENT(DBF_NOTICE, base, "formatting units %u to %u (%u B blocks) flags %u", fdata->start_unit, fdata->stop_unit, fdata->blksize, fdata->intensity); /* Since dasdfmt keeps the device open after it was disabled, * there still exists an inode for this device. * We must update i_blkbits, otherwise we might get errors when * enabling the device later. */ if (fdata->start_unit == 0) { struct block_device *bdev = bdget_disk(block->gdp, 0); bdev->bd_inode->i_blkbits = blksize_bits(fdata->blksize); bdput(bdev); } while (fdata->start_unit <= fdata->stop_unit) { cqr = base->discipline->format_device(base, fdata); if (IS_ERR(cqr)) return PTR_ERR(cqr); rc = dasd_sleep_on_interruptible(cqr); dasd_sfree_request(cqr, cqr->memdev); if (rc) { if (rc != -ERESTARTSYS) pr_err("%s: Formatting unit %d failed with " "rc=%d\n", dev_name(&base->cdev->dev), fdata->start_unit, rc); return rc; } fdata->start_unit++; } return 0; }
/* * dasd_default_erp_action just retries the current cqr */ struct dasd_ccw_req * dasd_default_erp_action(struct dasd_ccw_req *cqr) { struct dasd_device *device; device = cqr->startdev; /* just retry - there is nothing to save ... I got no sense data.... */ if (cqr->retries > 0) { DBF_DEV_EVENT(DBF_DEBUG, device, "default ERP called (%i retries left)", cqr->retries); cqr->lpm = LPM_ANYPATH; cqr->status = DASD_CQR_FILLED; } else { dev_err(&device->cdev->dev, "default ERP has run out of retries and failed\n"); cqr->status = DASD_CQR_FAILED; cqr->stopclk = get_clock(); } return cqr; } /* end dasd_default_erp_action */
/* * dasd_default_erp_action just retries the current cqr */ struct dasd_ccw_req * dasd_default_erp_action(struct dasd_ccw_req *cqr) { struct dasd_device *device; device = cqr->startdev; /* just retry - there is nothing to save ... I got no sense data.... */ if (cqr->retries > 0) { DBF_DEV_EVENT(DBF_DEBUG, device, "default ERP called (%i retries left)", cqr->retries); if (!test_bit(DASD_CQR_VERIFY_PATH, &cqr->flags)) cqr->lpm = dasd_path_get_opm(device); cqr->status = DASD_CQR_FILLED; } else { pr_err("%s: default ERP has run out of retries and failed\n", dev_name(&device->cdev->dev)); cqr->status = DASD_CQR_FAILED; cqr->stopclk = get_tod_clock(); } return cqr; } /* end dasd_default_erp_action */