Commit fc19f381 authored by Stefan Haberland's avatar Stefan Haberland Committed by Martin Schwidefsky

[S390] dasd: message cleanup

Moved some Messages into s390 debug feature and changed remaining
messages to use the dev_xxx and pr_xxx macros.
Signed-off-by: default avatarStefan Haberland <stefan.haberland@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent f3eb5384
This diff is collapsed.
This diff is collapsed.
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
* Author(s): Stefan Weinhuber <wein@de.ibm.com> * Author(s): Stefan Weinhuber <wein@de.ibm.com>
*/ */
#define KMSG_COMPONENT "dasd"
#include <linux/list.h> #include <linux/list.h>
#include <asm/ebcdic.h> #include <asm/ebcdic.h>
#include "dasd_int.h" #include "dasd_int.h"
...@@ -503,7 +505,7 @@ static void lcu_update_work(struct work_struct *work) ...@@ -503,7 +505,7 @@ static void lcu_update_work(struct work_struct *work)
*/ */
spin_lock_irqsave(&lcu->lock, flags); spin_lock_irqsave(&lcu->lock, flags);
if (rc || (lcu->flags & NEED_UAC_UPDATE)) { if (rc || (lcu->flags & NEED_UAC_UPDATE)) {
DEV_MESSAGE(KERN_WARNING, device, "could not update" DBF_DEV_EVENT(DBF_WARNING, device, "could not update"
" alias data in lcu (rc = %d), retry later", rc); " alias data in lcu (rc = %d), retry later", rc);
schedule_delayed_work(&lcu->ruac_data.dwork, 30*HZ); schedule_delayed_work(&lcu->ruac_data.dwork, 30*HZ);
} else { } else {
...@@ -875,7 +877,7 @@ void dasd_alias_handle_summary_unit_check(struct dasd_device *device, ...@@ -875,7 +877,7 @@ void dasd_alias_handle_summary_unit_check(struct dasd_device *device,
lcu = private->lcu; lcu = private->lcu;
if (!lcu) { if (!lcu) {
DEV_MESSAGE(KERN_WARNING, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"device not ready to handle summary" "device not ready to handle summary"
" unit check (no lcu structure)"); " unit check (no lcu structure)");
return; return;
...@@ -888,7 +890,7 @@ void dasd_alias_handle_summary_unit_check(struct dasd_device *device, ...@@ -888,7 +890,7 @@ void dasd_alias_handle_summary_unit_check(struct dasd_device *device,
* the next interrupt on a different device * the next interrupt on a different device
*/ */
if (list_empty(&device->alias_list)) { if (list_empty(&device->alias_list)) {
DEV_MESSAGE(KERN_WARNING, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"device is in offline processing," "device is in offline processing,"
" don't do summary unit check handling"); " don't do summary unit check handling");
spin_unlock(&lcu->lock); spin_unlock(&lcu->lock);
...@@ -896,7 +898,7 @@ void dasd_alias_handle_summary_unit_check(struct dasd_device *device, ...@@ -896,7 +898,7 @@ void dasd_alias_handle_summary_unit_check(struct dasd_device *device,
} }
if (lcu->suc_data.device) { if (lcu->suc_data.device) {
/* already scheduled or running */ /* already scheduled or running */
DEV_MESSAGE(KERN_WARNING, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"previous instance of summary unit check worker" "previous instance of summary unit check worker"
" still pending"); " still pending");
spin_unlock(&lcu->lock); spin_unlock(&lcu->lock);
......
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
* *
*/ */
#define KMSG_COMPONENT "dasd"
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -127,6 +129,7 @@ __setup ("dasd=", dasd_call_setup); ...@@ -127,6 +129,7 @@ __setup ("dasd=", dasd_call_setup);
* Read a device busid/devno from a string. * Read a device busid/devno from a string.
*/ */
static int static int
dasd_busid(char **str, int *id0, int *id1, int *devno) dasd_busid(char **str, int *id0, int *id1, int *devno)
{ {
int val, old_style; int val, old_style;
...@@ -134,8 +137,7 @@ dasd_busid(char **str, int *id0, int *id1, int *devno) ...@@ -134,8 +137,7 @@ dasd_busid(char **str, int *id0, int *id1, int *devno)
/* Interpret ipldev busid */ /* Interpret ipldev busid */
if (strncmp(DASD_IPLDEV, *str, strlen(DASD_IPLDEV)) == 0) { if (strncmp(DASD_IPLDEV, *str, strlen(DASD_IPLDEV)) == 0) {
if (ipl_info.type != IPL_TYPE_CCW) { if (ipl_info.type != IPL_TYPE_CCW) {
MESSAGE(KERN_ERR, "%s", "ipl device is not a ccw " pr_err("The IPL device is not a CCW device\n");
"device");
return -EINVAL; return -EINVAL;
} }
*id0 = 0; *id0 = 0;
...@@ -211,9 +213,8 @@ dasd_feature_list(char *str, char **endp) ...@@ -211,9 +213,8 @@ dasd_feature_list(char *str, char **endp)
else if (len == 8 && !strncmp(str, "failfast", 8)) else if (len == 8 && !strncmp(str, "failfast", 8))
features |= DASD_FEATURE_FAILFAST; features |= DASD_FEATURE_FAILFAST;
else { else {
MESSAGE(KERN_WARNING, pr_warning("%*s is not a supported device option\n",
"unsupported feature: %*s, " len, str);
"ignoring setting", len, str);
rc = -EINVAL; rc = -EINVAL;
} }
str += len; str += len;
...@@ -222,8 +223,8 @@ dasd_feature_list(char *str, char **endp) ...@@ -222,8 +223,8 @@ dasd_feature_list(char *str, char **endp)
str++; str++;
} }
if (*str != ')') { if (*str != ')') {
MESSAGE(KERN_WARNING, "%s", pr_warning("A closing parenthesis ')' is missing in the "
"missing ')' in dasd parameter string\n"); "dasd= parameter\n");
rc = -EINVAL; rc = -EINVAL;
} else } else
str++; str++;
...@@ -255,28 +256,27 @@ dasd_parse_keyword( char *parsestring ) { ...@@ -255,28 +256,27 @@ dasd_parse_keyword( char *parsestring ) {
} }
if (strncmp("autodetect", parsestring, length) == 0) { if (strncmp("autodetect", parsestring, length) == 0) {
dasd_autodetect = 1; dasd_autodetect = 1;
MESSAGE (KERN_INFO, "%s", pr_info("The autodetection mode has been activated\n");
"turning to autodetection mode");
return residual_str; return residual_str;
} }
if (strncmp("probeonly", parsestring, length) == 0) { if (strncmp("probeonly", parsestring, length) == 0) {
dasd_probeonly = 1; dasd_probeonly = 1;
MESSAGE(KERN_INFO, "%s", pr_info("The probeonly mode has been activated\n");
"turning to probeonly mode");
return residual_str; return residual_str;
} }
if (strncmp("nopav", parsestring, length) == 0) { if (strncmp("nopav", parsestring, length) == 0) {
if (MACHINE_IS_VM) if (MACHINE_IS_VM)
MESSAGE(KERN_INFO, "%s", "'nopav' not supported on VM"); pr_info("'nopav' is not supported on z/VM\n");
else { else {
dasd_nopav = 1; dasd_nopav = 1;
MESSAGE(KERN_INFO, "%s", "disable PAV mode"); pr_info("PAV support has be deactivated\n");
} }
return residual_str; return residual_str;
} }
if (strncmp("nofcx", parsestring, length) == 0) { if (strncmp("nofcx", parsestring, length) == 0) {
dasd_nofcx = 1; dasd_nofcx = 1;
MESSAGE(KERN_INFO, "%s", "disable High Performance Ficon"); pr_info("High Performance FICON support has been "
"deactivated\n");
return residual_str; return residual_str;
} }
if (strncmp("fixedbuffers", parsestring, length) == 0) { if (strncmp("fixedbuffers", parsestring, length) == 0) {
...@@ -287,10 +287,10 @@ dasd_parse_keyword( char *parsestring ) { ...@@ -287,10 +287,10 @@ dasd_parse_keyword( char *parsestring ) {
PAGE_SIZE, SLAB_CACHE_DMA, PAGE_SIZE, SLAB_CACHE_DMA,
NULL); NULL);
if (!dasd_page_cache) if (!dasd_page_cache)
MESSAGE(KERN_WARNING, "%s", "Failed to create slab, " DBF_EVENT(DBF_WARNING, "%s", "Failed to create slab, "
"fixed buffer mode disabled."); "fixed buffer mode disabled.");
else else
MESSAGE (KERN_INFO, "%s", DBF_EVENT(DBF_INFO, "%s",
"turning on fixed buffer mode"); "turning on fixed buffer mode");
return residual_str; return residual_str;
} }
...@@ -328,7 +328,7 @@ dasd_parse_range( char *parsestring ) { ...@@ -328,7 +328,7 @@ dasd_parse_range( char *parsestring ) {
(from_id0 != to_id0 || from_id1 != to_id1 || from > to)) (from_id0 != to_id0 || from_id1 != to_id1 || from > to))
rc = -EINVAL; rc = -EINVAL;
if (rc) { if (rc) {
MESSAGE(KERN_ERR, "Invalid device range %s", parsestring); pr_err("%s is not a valid device range\n", parsestring);
return ERR_PTR(rc); return ERR_PTR(rc);
} }
features = dasd_feature_list(str, &str); features = dasd_feature_list(str, &str);
...@@ -347,8 +347,8 @@ dasd_parse_range( char *parsestring ) { ...@@ -347,8 +347,8 @@ dasd_parse_range( char *parsestring ) {
return str + 1; return str + 1;
if (*str == '\0') if (*str == '\0')
return str; return str;
MESSAGE(KERN_WARNING, pr_warning("The dasd= parameter value %s has an invalid ending\n",
"junk at end of dasd parameter string: %s\n", str); str);
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
* *
*/ */
#define KMSG_COMPONENT "dasd"
#include <linux/stddef.h> #include <linux/stddef.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -144,8 +146,8 @@ dasd_diag_erp(struct dasd_device *device) ...@@ -144,8 +146,8 @@ dasd_diag_erp(struct dasd_device *device)
mdsk_term_io(device); mdsk_term_io(device);
rc = mdsk_init_io(device, device->block->bp_block, 0, NULL); rc = mdsk_init_io(device, device->block->bp_block, 0, NULL);
if (rc) if (rc)
DEV_MESSAGE(KERN_WARNING, device, "DIAG ERP unsuccessful, " dev_warn(&device->cdev->dev, "DIAG ERP failed with "
"rc=%d", rc); "rc=%d\n", rc);
} }
/* Start a given request at the device. Return zero on success, non-zero /* Start a given request at the device. Return zero on success, non-zero
...@@ -160,7 +162,7 @@ dasd_start_diag(struct dasd_ccw_req * cqr) ...@@ -160,7 +162,7 @@ dasd_start_diag(struct dasd_ccw_req * cqr)
device = cqr->startdev; device = cqr->startdev;
if (cqr->retries < 0) { if (cqr->retries < 0) {
DEV_MESSAGE(KERN_WARNING, device, "DIAG start_IO: request %p " DBF_DEV_EVENT(DBF_ERR, device, "DIAG start_IO: request %p "
"- no retry left)", cqr); "- no retry left)", cqr);
cqr->status = DASD_CQR_ERROR; cqr->status = DASD_CQR_ERROR;
return -EIO; return -EIO;
...@@ -195,7 +197,7 @@ dasd_start_diag(struct dasd_ccw_req * cqr) ...@@ -195,7 +197,7 @@ dasd_start_diag(struct dasd_ccw_req * cqr)
break; break;
default: /* Error condition */ default: /* Error condition */
cqr->status = DASD_CQR_QUEUED; cqr->status = DASD_CQR_QUEUED;
DEV_MESSAGE(KERN_WARNING, device, "dia250 returned rc=%d", rc); DBF_DEV_EVENT(DBF_WARNING, device, "dia250 returned rc=%d", rc);
dasd_diag_erp(device); dasd_diag_erp(device);
rc = -EIO; rc = -EIO;
break; break;
...@@ -243,13 +245,14 @@ dasd_ext_handler(__u16 code) ...@@ -243,13 +245,14 @@ dasd_ext_handler(__u16 code)
return; return;
} }
if (!ip) { /* no intparm: unsolicited interrupt */ if (!ip) { /* no intparm: unsolicited interrupt */
MESSAGE(KERN_DEBUG, "%s", "caught unsolicited interrupt"); DBF_EVENT(DBF_NOTICE, "%s", "caught unsolicited "
"interrupt");
return; return;
} }
cqr = (struct dasd_ccw_req *) ip; cqr = (struct dasd_ccw_req *) ip;
device = (struct dasd_device *) cqr->startdev; device = (struct dasd_device *) cqr->startdev;
if (strncmp(device->discipline->ebcname, (char *) &cqr->magic, 4)) { if (strncmp(device->discipline->ebcname, (char *) &cqr->magic, 4)) {
DEV_MESSAGE(KERN_WARNING, device, DBF_DEV_EVENT(DBF_WARNING, device,
" magic number of dasd_ccw_req 0x%08X doesn't" " magic number of dasd_ccw_req 0x%08X doesn't"
" match discipline 0x%08X", " match discipline 0x%08X",
cqr->magic, *(int *) (&device->discipline->name)); cqr->magic, *(int *) (&device->discipline->name));
...@@ -281,15 +284,11 @@ dasd_ext_handler(__u16 code) ...@@ -281,15 +284,11 @@ dasd_ext_handler(__u16 code)
rc = dasd_start_diag(next); rc = dasd_start_diag(next);
if (rc == 0) if (rc == 0)
expires = next->expires; expires = next->expires;
else if (rc != -EACCES)
DEV_MESSAGE(KERN_WARNING, device, "%s",
"Interrupt fastpath "
"failed!");
} }
} }
} else { } else {
cqr->status = DASD_CQR_QUEUED; cqr->status = DASD_CQR_QUEUED;
DEV_MESSAGE(KERN_WARNING, device, "interrupt status for " DBF_DEV_EVENT(DBF_DEBUG, device, "interrupt status for "
"request %p was %d (%d retries left)", cqr, status, "request %p was %d (%d retries left)", cqr, status,
cqr->retries); cqr->retries);
dasd_diag_erp(device); dasd_diag_erp(device);
...@@ -322,8 +321,9 @@ dasd_diag_check_device(struct dasd_device *device) ...@@ -322,8 +321,9 @@ dasd_diag_check_device(struct dasd_device *device)
if (private == NULL) { if (private == NULL) {
private = kzalloc(sizeof(struct dasd_diag_private),GFP_KERNEL); private = kzalloc(sizeof(struct dasd_diag_private),GFP_KERNEL);
if (private == NULL) { if (private == NULL) {
DEV_MESSAGE(KERN_WARNING, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"memory allocation failed for private data"); "Allocating memory for private DASD data "
"failed\n");
return -ENOMEM; return -ENOMEM;
} }
ccw_device_get_id(device->cdev, &private->dev_id); ccw_device_get_id(device->cdev, &private->dev_id);
...@@ -331,7 +331,7 @@ dasd_diag_check_device(struct dasd_device *device) ...@@ -331,7 +331,7 @@ dasd_diag_check_device(struct dasd_device *device)
} }
block = dasd_alloc_block(); block = dasd_alloc_block();
if (IS_ERR(block)) { if (IS_ERR(block)) {
DEV_MESSAGE(KERN_WARNING, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"could not allocate dasd block structure"); "could not allocate dasd block structure");
device->private = NULL; device->private = NULL;
kfree(private); kfree(private);
...@@ -347,7 +347,7 @@ dasd_diag_check_device(struct dasd_device *device) ...@@ -347,7 +347,7 @@ dasd_diag_check_device(struct dasd_device *device)
rc = diag210((struct diag210 *) rdc_data); rc = diag210((struct diag210 *) rdc_data);
if (rc) { if (rc) {
DEV_MESSAGE(KERN_WARNING, device, "failed to retrieve device " DBF_DEV_EVENT(DBF_WARNING, device, "failed to retrieve device "
"information (rc=%d)", rc); "information (rc=%d)", rc);
rc = -EOPNOTSUPP; rc = -EOPNOTSUPP;
goto out; goto out;
...@@ -362,8 +362,8 @@ dasd_diag_check_device(struct dasd_device *device) ...@@ -362,8 +362,8 @@ dasd_diag_check_device(struct dasd_device *device)
private->pt_block = 2; private->pt_block = 2;
break; break;
default: default:
DEV_MESSAGE(KERN_WARNING, device, "unsupported device class " dev_warn(&device->cdev->dev, "Device type %d is not supported "
"(class=%d)", private->rdc_data.vdev_class); "in DIAG mode\n", private->rdc_data.vdev_class);
rc = -EOPNOTSUPP; rc = -EOPNOTSUPP;
goto out; goto out;
} }
...@@ -380,7 +380,7 @@ dasd_diag_check_device(struct dasd_device *device) ...@@ -380,7 +380,7 @@ dasd_diag_check_device(struct dasd_device *device)
/* figure out blocksize of device */ /* figure out blocksize of device */
label = (struct vtoc_cms_label *) get_zeroed_page(GFP_KERNEL); label = (struct vtoc_cms_label *) get_zeroed_page(GFP_KERNEL);
if (label == NULL) { if (label == NULL) {
DEV_MESSAGE(KERN_WARNING, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"No memory to allocate initialization request"); "No memory to allocate initialization request");
rc = -ENOMEM; rc = -ENOMEM;
goto out; goto out;
...@@ -404,8 +404,8 @@ dasd_diag_check_device(struct dasd_device *device) ...@@ -404,8 +404,8 @@ dasd_diag_check_device(struct dasd_device *device)
private->iob.flaga = DASD_DIAG_FLAGA_DEFAULT; private->iob.flaga = DASD_DIAG_FLAGA_DEFAULT;
rc = dia250(&private->iob, RW_BIO); rc = dia250(&private->iob, RW_BIO);
if (rc == 3) { if (rc == 3) {
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"DIAG call failed"); "A 64-bit DIAG call failed\n");
rc = -EOPNOTSUPP; rc = -EOPNOTSUPP;
goto out_label; goto out_label;
} }
...@@ -414,8 +414,8 @@ dasd_diag_check_device(struct dasd_device *device) ...@@ -414,8 +414,8 @@ dasd_diag_check_device(struct dasd_device *device)
break; break;
} }
if (bsize > PAGE_SIZE) { if (bsize > PAGE_SIZE) {
DEV_MESSAGE(KERN_WARNING, device, "device access failed " dev_warn(&device->cdev->dev, "Accessing the DASD failed because"
"(rc=%d)", rc); " of an incorrect format (rc=%d)\n", rc);
rc = -EIO; rc = -EIO;
goto out_label; goto out_label;
} }
...@@ -433,15 +433,15 @@ dasd_diag_check_device(struct dasd_device *device) ...@@ -433,15 +433,15 @@ dasd_diag_check_device(struct dasd_device *device)
block->s2b_shift++; block->s2b_shift++;
rc = mdsk_init_io(device, block->bp_block, 0, NULL); rc = mdsk_init_io(device, block->bp_block, 0, NULL);
if (rc) { if (rc) {
DEV_MESSAGE(KERN_WARNING, device, "DIAG initialization " dev_warn(&device->cdev->dev, "DIAG initialization "
"failed (rc=%d)", rc); "failed with rc=%d\n", rc);
rc = -EIO; rc = -EIO;
} else { } else {
DEV_MESSAGE(KERN_INFO, device, dev_info(&device->cdev->dev,
"(%ld B/blk): %ldkB", "New DASD with %ld byte/block, total size %ld KB\n",
(unsigned long) block->bp_block, (unsigned long) block->bp_block,
(unsigned long) (block->blocks << (unsigned long) (block->blocks <<
block->s2b_shift) >> 1); block->s2b_shift) >> 1);
} }
out_label: out_label:
free_page((long) label); free_page((long) label);
...@@ -595,7 +595,7 @@ static void ...@@ -595,7 +595,7 @@ static void
dasd_diag_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, dasd_diag_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
struct irb *stat) struct irb *stat)
{ {
DEV_MESSAGE(KERN_ERR, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"dump sense not available for DIAG data"); "dump sense not available for DIAG data");
} }
...@@ -621,10 +621,8 @@ static int __init ...@@ -621,10 +621,8 @@ static int __init
dasd_diag_init(void) dasd_diag_init(void)
{ {
if (!MACHINE_IS_VM) { if (!MACHINE_IS_VM) {
MESSAGE_LOG(KERN_INFO, pr_info("Discipline %s cannot be used without z/VM\n",
"Machine is not VM: %s " dasd_diag_discipline.name);
"discipline not initializing",
dasd_diag_discipline.name);
return -ENODEV; return -ENODEV;
} }
ASCEBC(dasd_diag_discipline.ebcname, 4); ASCEBC(dasd_diag_discipline.ebcname, 4);
......
This diff is collapsed.
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
* Author(s): Stefan Weinhuber <wein@de.ibm.com> * Author(s): Stefan Weinhuber <wein@de.ibm.com>
*/ */
#define KMSG_COMPONENT "dasd"
#include <linux/init.h> #include <linux/init.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/kernel.h> #include <linux/kernel.h>
...@@ -539,7 +541,7 @@ static int dasd_eer_open(struct inode *inp, struct file *filp) ...@@ -539,7 +541,7 @@ static int dasd_eer_open(struct inode *inp, struct file *filp)
if (eerb->buffer_page_count < 1 || if (eerb->buffer_page_count < 1 ||
eerb->buffer_page_count > INT_MAX / PAGE_SIZE) { eerb->buffer_page_count > INT_MAX / PAGE_SIZE) {
kfree(eerb); kfree(eerb);
MESSAGE(KERN_WARNING, "can't open device since module " DBF_EVENT(DBF_WARNING, "can't open device since module "
"parameter eer_pages is smaller than 1 or" "parameter eer_pages is smaller than 1 or"
" bigger than %d", (int)(INT_MAX / PAGE_SIZE)); " bigger than %d", (int)(INT_MAX / PAGE_SIZE));
unlock_kernel(); unlock_kernel();
...@@ -692,7 +694,7 @@ int __init dasd_eer_init(void) ...@@ -692,7 +694,7 @@ int __init dasd_eer_init(void)
if (rc) { if (rc) {
kfree(dasd_eer_dev); kfree(dasd_eer_dev);
dasd_eer_dev = NULL; dasd_eer_dev = NULL;
MESSAGE(KERN_ERR, "%s", "dasd_eer_init could not " DBF_EVENT(DBF_ERR, "%s", "dasd_eer_init could not "
"register misc device"); "register misc device");
return rc; return rc;
} }
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
* *
*/ */
#define KMSG_COMPONENT "dasd"
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -91,14 +93,14 @@ dasd_default_erp_action(struct dasd_ccw_req *cqr) ...@@ -91,14 +93,14 @@ dasd_default_erp_action(struct dasd_ccw_req *cqr)
/* just retry - there is nothing to save ... I got no sense data.... */ /* just retry - there is nothing to save ... I got no sense data.... */
if (cqr->retries > 0) { if (cqr->retries > 0) {
DEV_MESSAGE (KERN_DEBUG, device, DBF_DEV_EVENT(DBF_DEBUG, device,
"default ERP called (%i retries left)", "default ERP called (%i retries left)",
cqr->retries); cqr->retries);
cqr->lpm = LPM_ANYPATH; cqr->lpm = LPM_ANYPATH;
cqr->status = DASD_CQR_FILLED; cqr->status = DASD_CQR_FILLED;
} else { } else {
DEV_MESSAGE (KERN_WARNING, device, "%s", dev_err(&device->cdev->dev,
"default ERP called (NO retry left)"); "default ERP has run out of retries and failed\n");
cqr->status = DASD_CQR_FAILED; cqr->status = DASD_CQR_FAILED;
cqr->stopclk = get_clock(); cqr->stopclk = get_clock();
} }
...@@ -162,8 +164,21 @@ dasd_log_sense(struct dasd_ccw_req *cqr, struct irb *irb) ...@@ -162,8 +164,21 @@ dasd_log_sense(struct dasd_ccw_req *cqr, struct irb *irb)
device->discipline->dump_sense(device, cqr, irb); device->discipline->dump_sense(device, cqr, irb);
} }
void
dasd_log_sense_dbf(struct dasd_ccw_req *cqr, struct irb *irb)
{
struct dasd_device *device;
device = cqr->startdev;
/* dump sense data to s390 debugfeature*/
if (device->discipline && device->discipline->dump_sense_dbf)
device->discipline->dump_sense_dbf(device, cqr, irb, "log");
}
EXPORT_SYMBOL(dasd_log_sense_dbf);
EXPORT_SYMBOL(dasd_default_erp_action); EXPORT_SYMBOL(dasd_default_erp_action);
EXPORT_SYMBOL(dasd_default_erp_postaction); EXPORT_SYMBOL(dasd_default_erp_postaction);
EXPORT_SYMBOL(dasd_alloc_erp_request); EXPORT_SYMBOL(dasd_alloc_erp_request);
EXPORT_SYMBOL(dasd_free_erp_request); EXPORT_SYMBOL(dasd_free_erp_request);
EXPORT_SYMBOL(dasd_log_sense); EXPORT_SYMBOL(dasd_log_sense);
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
* *
*/ */
#define KMSG_COMPONENT "dasd"
#include <linux/stddef.h> #include <linux/stddef.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <asm/debug.h> #include <asm/debug.h>
...@@ -128,17 +130,18 @@ dasd_fba_check_characteristics(struct dasd_device *device) ...@@ -128,17 +130,18 @@ dasd_fba_check_characteristics(struct dasd_device *device)
private = kzalloc(sizeof(struct dasd_fba_private), private = kzalloc(sizeof(struct dasd_fba_private),
GFP_KERNEL | GFP_DMA); GFP_KERNEL | GFP_DMA);
if (private == NULL) { if (private == NULL) {
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"memory allocation failed for private " "Allocating memory for private DASD "
"data"); "data failed\n");
return -ENOMEM; return -ENOMEM;
} }
device->private = (void *) private; device->private = (void *) private;
} }
block = dasd_alloc_block(); block = dasd_alloc_block();
if (IS_ERR(block)) { if (IS_ERR(block)) {
DEV_MESSAGE(KERN_WARNING, device, "%s", DBF_EVENT(DBF_WARNING, "could not allocate dasd block "
"could not allocate dasd block structure"); "structure for device: %s",
dev_name(&device->cdev->dev));
device->private = NULL; device->private = NULL;
kfree(private); kfree(private);
return PTR_ERR(block); return PTR_ERR(block);
...@@ -150,9 +153,9 @@ dasd_fba_check_characteristics(struct dasd_device *device) ...@@ -150,9 +153,9 @@ dasd_fba_check_characteristics(struct dasd_device *device)
rdc_data = (void *) &(private->rdc_data); rdc_data = (void *) &(private->rdc_data);
rc = dasd_generic_read_dev_chars(device, "FBA ", &rdc_data, 32); rc = dasd_generic_read_dev_chars(device, "FBA ", &rdc_data, 32);
if (rc) { if (rc) {
DEV_MESSAGE(KERN_WARNING, device, DBF_EVENT(DBF_WARNING, "Read device characteristics returned "
"Read device characteristics returned error %d", "error %d for device: %s",
rc); rc, dev_name(&device->cdev->dev));
device->block = NULL; device->block = NULL;
dasd_free_block(block); dasd_free_block(block);
device->private = NULL; device->private = NULL;
...@@ -160,15 +163,16 @@ dasd_fba_check_characteristics(struct dasd_device *device) ...@@ -160,15 +163,16 @@ dasd_fba_check_characteristics(struct dasd_device *device)
return rc; return rc;
} }
DEV_MESSAGE(KERN_INFO, device, dev_info(&device->cdev->dev,
"%04X/%02X(CU:%04X/%02X) %dMB at(%d B/blk)", "New FBA DASD %04X/%02X (CU %04X/%02X) with %d MB "
cdev->id.dev_type, "and %d B/blk\n",
cdev->id.dev_model, cdev->id.dev_type,
cdev->id.cu_type, cdev->id.dev_model,
cdev->id.cu_model, cdev->id.cu_type,
((private->rdc_data.blk_bdsa * cdev->id.cu_model,
(private->rdc_data.blk_size >> 9)) >> 11), ((private->rdc_data.blk_bdsa *
private->rdc_data.blk_size); (private->rdc_data.blk_size >> 9)) >> 11),
private->rdc_data.blk_size);
return 0; return 0;
} }
...@@ -180,7 +184,7 @@ static int dasd_fba_do_analysis(struct dasd_block *block) ...@@ -180,7 +184,7 @@ static int dasd_fba_do_analysis(struct dasd_block *block)
private = (struct dasd_fba_private *) block->base->private; private = (struct dasd_fba_private *) block->base->private;
rc = dasd_check_blocksize(private->rdc_data.blk_size); rc = dasd_check_blocksize(private->rdc_data.blk_size);
if (rc) { if (rc) {
DEV_MESSAGE(KERN_INFO, block->base, "unknown blocksize %d", DBF_DEV_EVENT(DBF_WARNING, block->base, "unknown blocksize %d",
private->rdc_data.blk_size); private->rdc_data.blk_size);
return rc; return rc;
} }
...@@ -215,7 +219,7 @@ dasd_fba_erp_postaction(struct dasd_ccw_req * cqr) ...@@ -215,7 +219,7 @@ dasd_fba_erp_postaction(struct dasd_ccw_req * cqr)
if (cqr->function == dasd_default_erp_action) if (cqr->function == dasd_default_erp_action)
return dasd_default_erp_postaction; return dasd_default_erp_postaction;
DEV_MESSAGE(KERN_WARNING, cqr->startdev, "unknown ERP action %p", DBF_DEV_EVENT(DBF_WARNING, cqr->startdev, "unknown ERP action %p",
cqr->function); cqr->function);
return NULL; return NULL;
} }
...@@ -233,9 +237,9 @@ static void dasd_fba_handle_unsolicited_interrupt(struct dasd_device *device, ...@@ -233,9 +237,9 @@ static void dasd_fba_handle_unsolicited_interrupt(struct dasd_device *device,
} }
/* check for unsolicited interrupts */ /* check for unsolicited interrupts */
DEV_MESSAGE(KERN_DEBUG, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"unsolicited interrupt received"); "unsolicited interrupt received");
device->discipline->dump_sense(device, NULL, irb); device->discipline->dump_sense_dbf(device, NULL, irb, "unsolicited");
dasd_schedule_device_bh(device); dasd_schedule_device_bh(device);
return; return;
}; };
...@@ -436,6 +440,25 @@ dasd_fba_fill_info(struct dasd_device * device, ...@@ -436,6 +440,25 @@ dasd_fba_fill_info(struct dasd_device * device,
return 0; return 0;
} }
static void
dasd_fba_dump_sense_dbf(struct dasd_device *device, struct dasd_ccw_req *req,
struct irb *irb, char *reason)
{
int sl;
if (irb->esw.esw0.erw.cons) {
for (sl = 0; sl < 4; sl++) {
DBF_DEV_EVENT(DBF_EMERG, device,
"%s: %08x %08x %08x %08x",
reason, irb->ecw[8 * 0], irb->ecw[8 * 1],
irb->ecw[8 * 2], irb->ecw[8 * 3]);
}
} else {
DBF_DEV_EVENT(DBF_EMERG, device, "%s",
"SORRY - NO VALID SENSE AVAILABLE\n");
}
}
static void static void
dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
struct irb *irb) struct irb *irb)
...@@ -446,7 +469,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, ...@@ -446,7 +469,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
page = (char *) get_zeroed_page(GFP_ATOMIC); page = (char *) get_zeroed_page(GFP_ATOMIC);
if (page == NULL) { if (page == NULL) {
DEV_MESSAGE(KERN_ERR, device, " %s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"No memory to dump sense data"); "No memory to dump sense data");
return; return;
} }
...@@ -476,8 +499,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, ...@@ -476,8 +499,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
len += sprintf(page + len, KERN_ERR PRINTK_HEADER len += sprintf(page + len, KERN_ERR PRINTK_HEADER
" SORRY - NO VALID SENSE AVAILABLE\n"); " SORRY - NO VALID SENSE AVAILABLE\n");
} }
MESSAGE_LOG(KERN_ERR, "%s", printk(KERN_ERR "%s", page);
page + sizeof(KERN_ERR PRINTK_HEADER));
/* dump the Channel Program */ /* dump the Channel Program */
/* print first CCWs (maximum 8) */ /* print first CCWs (maximum 8) */
...@@ -498,8 +520,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, ...@@ -498,8 +520,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
len += sprintf(page + len, "\n"); len += sprintf(page + len, "\n");
act++; act++;
} }
MESSAGE_LOG(KERN_ERR, "%s", printk(KERN_ERR "%s", page);
page + sizeof(KERN_ERR PRINTK_HEADER));
/* print failing CCW area */ /* print failing CCW area */
...@@ -540,8 +561,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, ...@@ -540,8 +561,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
act++; act++;
} }
if (len > 0) if (len > 0)
MESSAGE_LOG(KERN_ERR, "%s", printk(KERN_ERR "%s", page);
page + sizeof(KERN_ERR PRINTK_HEADER));
free_page((unsigned long) page); free_page((unsigned long) page);
} }
...@@ -576,6 +596,7 @@ static struct dasd_discipline dasd_fba_discipline = { ...@@ -576,6 +596,7 @@ static struct dasd_discipline dasd_fba_discipline = {
.build_cp = dasd_fba_build_cp, .build_cp = dasd_fba_build_cp,
.free_cp = dasd_fba_free_cp, .free_cp = dasd_fba_free_cp,
.dump_sense = dasd_fba_dump_sense, .dump_sense = dasd_fba_dump_sense,
.dump_sense_dbf = dasd_fba_dump_sense_dbf,
.fill_info = dasd_fba_fill_info, .fill_info = dasd_fba_fill_info,
}; };
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
* *
*/ */
#define KMSG_COMPONENT "dasd"
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/blkpg.h> #include <linux/blkpg.h>
...@@ -163,9 +165,8 @@ int dasd_gendisk_init(void) ...@@ -163,9 +165,8 @@ int dasd_gendisk_init(void)
/* Register to static dasd major 94 */ /* Register to static dasd major 94 */
rc = register_blkdev(DASD_MAJOR, "dasd"); rc = register_blkdev(DASD_MAJOR, "dasd");
if (rc != 0) { if (rc != 0) {
MESSAGE(KERN_WARNING, pr_warning("Registering the device driver with major number "
"Couldn't register successfully to " "%d failed\n", DASD_MAJOR);
"major no %d", DASD_MAJOR);
return rc; return rc;
} }
return 0; return 0;
......
...@@ -112,6 +112,9 @@ do { \ ...@@ -112,6 +112,9 @@ do { \
d_data); \ d_data); \
} while(0) } while(0)
/* limit size for an errorstring */
#define ERRORLENGTH 30
/* definition of dbf debug levels */ /* definition of dbf debug levels */
#define DBF_EMERG 0 /* system is unusable */ #define DBF_EMERG 0 /* system is unusable */
#define DBF_ALERT 1 /* action must be taken immediately */ #define DBF_ALERT 1 /* action must be taken immediately */
...@@ -281,6 +284,8 @@ struct dasd_discipline { ...@@ -281,6 +284,8 @@ struct dasd_discipline {
dasd_erp_fn_t(*erp_postaction) (struct dasd_ccw_req *); dasd_erp_fn_t(*erp_postaction) (struct dasd_ccw_req *);
void (*dump_sense) (struct dasd_device *, struct dasd_ccw_req *, void (*dump_sense) (struct dasd_device *, struct dasd_ccw_req *,
struct irb *); struct irb *);
void (*dump_sense_dbf) (struct dasd_device *, struct dasd_ccw_req *,
struct irb *, char *);
void (*handle_unsolicited_interrupt) (struct dasd_device *, void (*handle_unsolicited_interrupt) (struct dasd_device *,
struct irb *); struct irb *);
...@@ -626,6 +631,7 @@ struct dasd_ccw_req *dasd_alloc_erp_request(char *, int, int, ...@@ -626,6 +631,7 @@ struct dasd_ccw_req *dasd_alloc_erp_request(char *, int, int,
struct dasd_device *); struct dasd_device *);
void dasd_free_erp_request(struct dasd_ccw_req *, struct dasd_device *); void dasd_free_erp_request(struct dasd_ccw_req *, struct dasd_device *);
void dasd_log_sense(struct dasd_ccw_req *, struct irb *); void dasd_log_sense(struct dasd_ccw_req *, struct irb *);
void dasd_log_sense_dbf(struct dasd_ccw_req *cqr, struct irb *irb);
/* externals in dasd_3990_erp.c */ /* externals in dasd_3990_erp.c */
struct dasd_ccw_req *dasd_3990_erp_action(struct dasd_ccw_req *); struct dasd_ccw_req *dasd_3990_erp_action(struct dasd_ccw_req *);
......
...@@ -9,6 +9,9 @@ ...@@ -9,6 +9,9 @@
* *
* i/o controls for the dasd driver. * i/o controls for the dasd driver.
*/ */
#define KMSG_COMPONENT "dasd"
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/major.h> #include <linux/major.h>
#include <linux/fs.h> #include <linux/fs.h>
...@@ -94,7 +97,8 @@ static int dasd_ioctl_quiesce(struct dasd_block *block) ...@@ -94,7 +97,8 @@ static int dasd_ioctl_quiesce(struct dasd_block *block)
if (!capable (CAP_SYS_ADMIN)) if (!capable (CAP_SYS_ADMIN))
return -EACCES; return -EACCES;
DEV_MESSAGE(KERN_DEBUG, base, "%s", "Quiesce IO on device"); dev_info(&base->cdev->dev, "The DASD has been put in the quiesce "
"state\n");
spin_lock_irqsave(get_ccwdev_lock(base->cdev), flags); spin_lock_irqsave(get_ccwdev_lock(base->cdev), flags);
base->stopped |= DASD_STOPPED_QUIESCE; base->stopped |= DASD_STOPPED_QUIESCE;
spin_unlock_irqrestore(get_ccwdev_lock(base->cdev), flags); spin_unlock_irqrestore(get_ccwdev_lock(base->cdev), flags);
...@@ -103,7 +107,7 @@ static int dasd_ioctl_quiesce(struct dasd_block *block) ...@@ -103,7 +107,7 @@ static int dasd_ioctl_quiesce(struct dasd_block *block)
/* /*
* Quiesce device. * Resume device.
*/ */
static int dasd_ioctl_resume(struct dasd_block *block) static int dasd_ioctl_resume(struct dasd_block *block)
{ {
...@@ -114,7 +118,8 @@ static int dasd_ioctl_resume(struct dasd_block *block) ...@@ -114,7 +118,8 @@ static int dasd_ioctl_resume(struct dasd_block *block)
if (!capable (CAP_SYS_ADMIN)) if (!capable (CAP_SYS_ADMIN))
return -EACCES; return -EACCES;
DEV_MESSAGE(KERN_DEBUG, base, "%s", "resume IO on device"); dev_info(&base->cdev->dev, "I/O operations have been resumed "
"on the DASD\n");
spin_lock_irqsave(get_ccwdev_lock(base->cdev), flags); spin_lock_irqsave(get_ccwdev_lock(base->cdev), flags);
base->stopped &= ~DASD_STOPPED_QUIESCE; base->stopped &= ~DASD_STOPPED_QUIESCE;
spin_unlock_irqrestore(get_ccwdev_lock(base->cdev), flags); spin_unlock_irqrestore(get_ccwdev_lock(base->cdev), flags);
...@@ -140,8 +145,8 @@ static int dasd_format(struct dasd_block *block, struct format_data_t *fdata) ...@@ -140,8 +145,8 @@ static int dasd_format(struct dasd_block *block, struct format_data_t *fdata)
return -EPERM; return -EPERM;
if (base->state != DASD_STATE_BASIC) { if (base->state != DASD_STATE_BASIC) {
DEV_MESSAGE(KERN_WARNING, base, "%s", dev_warn(&base->cdev->dev,
"dasd_format: device is not disabled! "); "The DASD cannot be formatted while it is enabled\n");
return -EBUSY; return -EBUSY;
} }
...@@ -169,10 +174,9 @@ static int dasd_format(struct dasd_block *block, struct format_data_t *fdata) ...@@ -169,10 +174,9 @@ static int dasd_format(struct dasd_block *block, struct format_data_t *fdata)
dasd_sfree_request(cqr, cqr->memdev); dasd_sfree_request(cqr, cqr->memdev);
if (rc) { if (rc) {
if (rc != -ERESTARTSYS) if (rc != -ERESTARTSYS)
DEV_MESSAGE(KERN_ERR, base, dev_err(&base->cdev->dev,
" Formatting of unit %u failed " "Formatting unit %d failed with "
"with rc = %d", "rc=%d\n", fdata->start_unit, rc);
fdata->start_unit, rc);
return rc; return rc;
} }
fdata->start_unit++; fdata->start_unit++;
...@@ -199,8 +203,9 @@ dasd_ioctl_format(struct block_device *bdev, void __user *argp) ...@@ -199,8 +203,9 @@ dasd_ioctl_format(struct block_device *bdev, void __user *argp)
if (copy_from_user(&fdata, argp, sizeof(struct format_data_t))) if (copy_from_user(&fdata, argp, sizeof(struct format_data_t)))
return -EFAULT; return -EFAULT;
if (bdev != bdev->bd_contains) { if (bdev != bdev->bd_contains) {
DEV_MESSAGE(KERN_WARNING, block->base, "%s", dev_warn(&block->base->cdev->dev,
"Cannot low-level format a partition"); "The specified DASD is a partition and cannot be "
"formatted\n");
return -EINVAL; return -EINVAL;
} }
return dasd_format(block, &fdata); return dasd_format(block, &fdata);
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
* *
*/ */
#define KMSG_COMPONENT "dasd"
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
...@@ -267,7 +269,7 @@ dasd_statistics_write(struct file *file, const char __user *user_buf, ...@@ -267,7 +269,7 @@ dasd_statistics_write(struct file *file, const char __user *user_buf,
buffer = dasd_get_user_string(user_buf, user_len); buffer = dasd_get_user_string(user_buf, user_len);
if (IS_ERR(buffer)) if (IS_ERR(buffer))
return PTR_ERR(buffer); return PTR_ERR(buffer);
MESSAGE_LOG(KERN_INFO, "/proc/dasd/statictics: '%s'", buffer); DBF_EVENT(DBF_DEBUG, "/proc/dasd/statictics: '%s'\n", buffer);
/* check for valid verbs */ /* check for valid verbs */
for (str = buffer; isspace(*str); str++); for (str = buffer; isspace(*str); str++);
...@@ -277,33 +279,33 @@ dasd_statistics_write(struct file *file, const char __user *user_buf, ...@@ -277,33 +279,33 @@ dasd_statistics_write(struct file *file, const char __user *user_buf,
if (strcmp(str, "on") == 0) { if (strcmp(str, "on") == 0) {
/* switch on statistics profiling */ /* switch on statistics profiling */
dasd_profile_level = DASD_PROFILE_ON; dasd_profile_level = DASD_PROFILE_ON;
MESSAGE(KERN_INFO, "%s", "Statistics switched on"); pr_info("The statistics feature has been switched "
"on\n");
} else if (strcmp(str, "off") == 0) { } else if (strcmp(str, "off") == 0) {
/* switch off and reset statistics profiling */ /* switch off and reset statistics profiling */
memset(&dasd_global_profile, memset(&dasd_global_profile,
0, sizeof (struct dasd_profile_info_t)); 0, sizeof (struct dasd_profile_info_t));
dasd_profile_level = DASD_PROFILE_OFF; dasd_profile_level = DASD_PROFILE_OFF;
MESSAGE(KERN_INFO, "%s", "Statistics switched off"); pr_info("The statistics feature has been switched "
"off\n");
} else } else
goto out_error; goto out_error;
} else if (strncmp(str, "reset", 5) == 0) { } else if (strncmp(str, "reset", 5) == 0) {
/* reset the statistics */ /* reset the statistics */
memset(&dasd_global_profile, 0, memset(&dasd_global_profile, 0,
sizeof (struct dasd_profile_info_t)); sizeof (struct dasd_profile_info_t));
MESSAGE(KERN_INFO, "%s", "Statistics reset"); pr_info("The statistics have been reset\n");
} else } else
goto out_error; goto out_error;
kfree(buffer); kfree(buffer);
return user_len; return user_len;
out_error: out_error:
MESSAGE(KERN_WARNING, "%s", pr_warning("%s is not a supported value for /proc/dasd/statistics\n",
"/proc/dasd/statistics: only 'set on', 'set off' " str);
"and 'reset' are supported verbs");
kfree(buffer); kfree(buffer);
return -EINVAL; return -EINVAL;
#else #else
MESSAGE(KERN_WARNING, "%s", pr_warning("/proc/dasd/statistics: is not activated in this kernel\n");
"/proc/dasd/statistics: is not activated in this kernel");
return user_len; return user_len;
#endif /* CONFIG_DASD_PROFILE */ #endif /* CONFIG_DASD_PROFILE */
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment