diff options
Diffstat (limited to 'drivers/s390/crypto/ap_bus.c')
-rw-r--r-- | drivers/s390/crypto/ap_bus.c | 81 |
1 files changed, 45 insertions, 36 deletions
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c index d9b804943d19..1986243f9cd3 100644 --- a/drivers/s390/crypto/ap_bus.c +++ b/drivers/s390/crypto/ap_bus.c @@ -61,6 +61,10 @@ static char *aqm_str; module_param_named(aqmask, aqm_str, charp, 0440); MODULE_PARM_DESC(aqmask, "AP bus domain mask."); +static int ap_useirq = 1; +module_param_named(useirq, ap_useirq, int, 0440); +MODULE_PARM_DESC(useirq, "Use interrupt if available, default is 1 (on)."); + atomic_t ap_max_msg_size = ATOMIC_INIT(AP_DEFAULT_MAX_MSG_SIZE); EXPORT_SYMBOL(ap_max_msg_size); @@ -725,7 +729,7 @@ static void ap_check_bindings_complete(void) if (bound == apqns) { if (!completion_done(&ap_init_apqn_bindings_complete)) { complete_all(&ap_init_apqn_bindings_complete); - AP_DBF(DBF_INFO, "%s complete\n", __func__); + AP_DBF_INFO("%s complete\n", __func__); } ap_send_bindings_complete_uevent(); } @@ -786,9 +790,12 @@ static int __ap_revise_reserved(struct device *dev, void *dummy) drvres = to_ap_drv(dev->driver)->flags & AP_DRIVER_FLAG_DEFAULT; if (!!devres != !!drvres) { - AP_DBF_DBG("reprobing queue=%02x.%04x\n", - card, queue); + AP_DBF_DBG("%s reprobing queue=%02x.%04x\n", + __func__, card, queue); rc = device_reprobe(dev); + if (rc) + AP_DBF_WARN("%s reprobing queue=%02x.%04x failed\n", + __func__, card, queue); } } @@ -1118,7 +1125,8 @@ static ssize_t ap_domain_store(struct bus_type *bus, ap_domain_index = domain; spin_unlock_bh(&ap_domain_lock); - AP_DBF_INFO("stored new default domain=%d\n", domain); + AP_DBF_INFO("%s stored new default domain=%d\n", + __func__, domain); return count; } @@ -1433,8 +1441,9 @@ static int ap_get_compatible_type(ap_qid_t qid, int rawtype, unsigned int func) /* < CEX2A is not supported */ if (rawtype < AP_DEVICE_TYPE_CEX2A) { - AP_DBF_WARN("get_comp_type queue=%02x.%04x unsupported type %d\n", - AP_QID_CARD(qid), AP_QID_QUEUE(qid), rawtype); + AP_DBF_WARN("%s queue=%02x.%04x unsupported type %d\n", + __func__, AP_QID_CARD(qid), + AP_QID_QUEUE(qid), rawtype); return 0; } /* up to CEX7 known and fully supported */ @@ -1458,11 +1467,12 @@ static int ap_get_compatible_type(ap_qid_t qid, int rawtype, unsigned int func) comp_type = apinfo.cat; } if (!comp_type) - AP_DBF_WARN("get_comp_type queue=%02x.%04x unable to map type %d\n", - AP_QID_CARD(qid), AP_QID_QUEUE(qid), rawtype); + AP_DBF_WARN("%s queue=%02x.%04x unable to map type %d\n", + __func__, AP_QID_CARD(qid), + AP_QID_QUEUE(qid), rawtype); else if (comp_type != rawtype) - AP_DBF_INFO("get_comp_type queue=%02x.%04x map type %d to %d\n", - AP_QID_CARD(qid), AP_QID_QUEUE(qid), + AP_DBF_INFO("%s queue=%02x.%04x map type %d to %d\n", + __func__, AP_QID_CARD(qid), AP_QID_QUEUE(qid), rawtype, comp_type); return comp_type; } @@ -1535,7 +1545,7 @@ static inline void ap_scan_domains(struct ap_card *ac) aq = dev ? to_ap_queue(dev) : NULL; if (!ap_test_config_usage_domain(dom)) { if (dev) { - AP_DBF_INFO("%s(%d,%d) not in config any more, rm queue device\n", + AP_DBF_INFO("%s(%d,%d) not in config anymore, rm queue dev\n", __func__, ac->id, dom); device_unregister(dev); put_device(dev); @@ -1545,9 +1555,8 @@ static inline void ap_scan_domains(struct ap_card *ac) /* domain is valid, get info from this APQN */ if (!ap_queue_info(qid, &type, &func, &depth, &ml, &decfg)) { if (aq) { - AP_DBF_INFO( - "%s(%d,%d) ap_queue_info() not successful, rm queue device\n", - __func__, ac->id, dom); + AP_DBF_INFO("%s(%d,%d) queue_info() failed, rm queue dev\n", + __func__, ac->id, dom); device_unregister(dev); put_device(dev); } @@ -1577,10 +1586,10 @@ static inline void ap_scan_domains(struct ap_card *ac) /* get it and thus adjust reference counter */ get_device(dev); if (decfg) - AP_DBF_INFO("%s(%d,%d) new (decfg) queue device created\n", + AP_DBF_INFO("%s(%d,%d) new (decfg) queue dev created\n", __func__, ac->id, dom); else - AP_DBF_INFO("%s(%d,%d) new queue device created\n", + AP_DBF_INFO("%s(%d,%d) new queue dev created\n", __func__, ac->id, dom); goto put_dev_and_continue; } @@ -1594,7 +1603,7 @@ static inline void ap_scan_domains(struct ap_card *ac) aq->last_err_rc = AP_RESPONSE_DECONFIGURED; } spin_unlock_bh(&aq->lock); - AP_DBF_INFO("%s(%d,%d) queue device config off\n", + AP_DBF_INFO("%s(%d,%d) queue dev config off\n", __func__, ac->id, dom); ap_send_config_uevent(&aq->ap_dev, aq->config); /* 'receive' pending messages with -EAGAIN */ @@ -1609,7 +1618,7 @@ static inline void ap_scan_domains(struct ap_card *ac) aq->sm_state = AP_SM_STATE_RESET_START; } spin_unlock_bh(&aq->lock); - AP_DBF_INFO("%s(%d,%d) queue device config on\n", + AP_DBF_INFO("%s(%d,%d) queue dev config on\n", __func__, ac->id, dom); ap_send_config_uevent(&aq->ap_dev, aq->config); goto put_dev_and_continue; @@ -1621,7 +1630,7 @@ static inline void ap_scan_domains(struct ap_card *ac) ap_flush_queue(aq); /* re-init (with reset) the queue device */ ap_queue_init_state(aq); - AP_DBF_INFO("%s(%d,%d) queue device reinit enforced\n", + AP_DBF_INFO("%s(%d,%d) queue dev reinit enforced\n", __func__, ac->id, dom); goto put_dev_and_continue; } @@ -1653,7 +1662,7 @@ static inline void ap_scan_adapter(int ap) /* Adapter not in configuration ? */ if (!ap_test_config_card_id(ap)) { if (ac) { - AP_DBF_INFO("%s(%d) ap not in config any more, rm card and queue devices\n", + AP_DBF_INFO("%s(%d) ap not in config any more, rm card and queue devs\n", __func__, ap); ap_scan_rm_card_dev_and_queue_devs(ac); put_device(dev); @@ -1678,9 +1687,8 @@ static inline void ap_scan_adapter(int ap) if (dom > ap_max_domain_id) { /* Could not find a valid APQN for this adapter */ if (ac) { - AP_DBF_INFO( - "%s(%d) no type info (no APQN found), rm card and queue devices\n", - __func__, ap); + AP_DBF_INFO("%s(%d) no type info (no APQN found), rm card and queue devs\n", + __func__, ap); ap_scan_rm_card_dev_and_queue_devs(ac); put_device(dev); } else { @@ -1692,7 +1700,7 @@ static inline void ap_scan_adapter(int ap) if (!type) { /* No apdater type info available, an unusable adapter */ if (ac) { - AP_DBF_INFO("%s(%d) no valid type (0) info, rm card and queue devices\n", + AP_DBF_INFO("%s(%d) no valid type (0) info, rm card and queue devs\n", __func__, ap); ap_scan_rm_card_dev_and_queue_devs(ac); put_device(dev); @@ -1706,13 +1714,13 @@ static inline void ap_scan_adapter(int ap) if (ac) { /* Check APQN against existing card device for changes */ if (ac->raw_hwtype != type) { - AP_DBF_INFO("%s(%d) hwtype %d changed, rm card and queue devices\n", + AP_DBF_INFO("%s(%d) hwtype %d changed, rm card and queue devs\n", __func__, ap, type); ap_scan_rm_card_dev_and_queue_devs(ac); put_device(dev); ac = NULL; } else if (ac->functions != func) { - AP_DBF_INFO("%s(%d) functions 0x%08x changed, rm card and queue devices\n", + AP_DBF_INFO("%s(%d) functions 0x%08x changed, rm card and queue devs\n", __func__, ap, type); ap_scan_rm_card_dev_and_queue_devs(ac); put_device(dev); @@ -1720,13 +1728,13 @@ static inline void ap_scan_adapter(int ap) } else { if (decfg && ac->config) { ac->config = false; - AP_DBF_INFO("%s(%d) card device config off\n", + AP_DBF_INFO("%s(%d) card dev config off\n", __func__, ap); ap_send_config_uevent(&ac->ap_dev, ac->config); } if (!decfg && !ac->config) { ac->config = true; - AP_DBF_INFO("%s(%d) card device config on\n", + AP_DBF_INFO("%s(%d) card dev config on\n", __func__, ap); ap_send_config_uevent(&ac->ap_dev, ac->config); } @@ -1756,7 +1764,8 @@ static inline void ap_scan_adapter(int ap) if (ac->maxmsgsize > atomic_read(&ap_max_msg_size)) { atomic_set(&ap_max_msg_size, ac->maxmsgsize); AP_DBF_INFO("%s(%d) ap_max_msg_size update to %d byte\n", - __func__, ap, atomic_read(&ap_max_msg_size)); + __func__, ap, + atomic_read(&ap_max_msg_size)); } /* Register the new card device with AP bus */ rc = device_register(dev); @@ -1769,10 +1778,10 @@ static inline void ap_scan_adapter(int ap) /* get it and thus adjust reference counter */ get_device(dev); if (decfg) - AP_DBF_INFO("%s(%d) new (decfg) card device type=%d func=0x%08x created\n", + AP_DBF_INFO("%s(%d) new (decfg) card dev type=%d func=0x%08x created\n", __func__, ap, type, func); else - AP_DBF_INFO("%s(%d) new card device type=%d func=0x%08x created\n", + AP_DBF_INFO("%s(%d) new card dev type=%d func=0x%08x created\n", __func__, ap, type, func); } @@ -1810,12 +1819,12 @@ static void ap_scan_bus(struct work_struct *unused) if (dev) put_device(dev); else - AP_DBF_INFO("no queue device with default domain %d available\n", - ap_domain_index); + AP_DBF_INFO("%s no queue device with default domain %d available\n", + __func__, ap_domain_index); } if (atomic64_inc_return(&ap_scan_bus_count) == 1) { - AP_DBF(DBF_DEBUG, "%s init scan complete\n", __func__); + AP_DBF_DBG("%s init scan complete\n", __func__); ap_send_init_scan_done_uevent(); ap_check_bindings_complete(); } @@ -1830,7 +1839,7 @@ static void ap_config_timeout(struct timer_list *unused) static int __init ap_debug_init(void) { - ap_dbf_info = debug_register("ap", 1, 1, + ap_dbf_info = debug_register("ap", 2, 1, DBF_MAX_SPRINTF_ARGS * sizeof(long)); debug_register_view(ap_dbf_info, &debug_sprintf_view); debug_set_level(ap_dbf_info, DBF_ERR); @@ -1897,7 +1906,7 @@ static int __init ap_module_init(void) } /* enable interrupts if available */ - if (ap_interrupts_available()) { + if (ap_interrupts_available() && ap_useirq) { rc = register_adapter_interrupt(&ap_airq); ap_irq_flag = (rc == 0); } |