Skip to content

Commit

Permalink
[S390] dasd: message cleanup
Browse files Browse the repository at this point in the history
Moved some Messages into s390 debug feature and changed remaining
messages to use the dev_xxx and pr_xxx macros.

Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Stefan Haberland authored and Martin Schwidefsky committed Mar 26, 2009
1 parent f3eb538 commit fc19f38
Show file tree
Hide file tree
Showing 13 changed files with 743 additions and 637 deletions.
176 changes: 88 additions & 88 deletions drivers/s390/block/dasd.c

Large diffs are not rendered by default.

730 changes: 366 additions & 364 deletions drivers/s390/block/dasd_3990_erp.c

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions drivers/s390/block/dasd_alias.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Author(s): Stefan Weinhuber <wein@de.ibm.com>
*/

#define KMSG_COMPONENT "dasd"

#include <linux/list.h>
#include <asm/ebcdic.h>
#include "dasd_int.h"
Expand Down Expand Up @@ -503,7 +505,7 @@ static void lcu_update_work(struct work_struct *work)
*/
spin_lock_irqsave(&lcu->lock, flags);
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);
schedule_delayed_work(&lcu->ruac_data.dwork, 30*HZ);
} else {
Expand Down Expand Up @@ -875,7 +877,7 @@ void dasd_alias_handle_summary_unit_check(struct dasd_device *device,

lcu = private->lcu;
if (!lcu) {
DEV_MESSAGE(KERN_WARNING, device, "%s",
DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"device not ready to handle summary"
" unit check (no lcu structure)");
return;
Expand All @@ -888,15 +890,15 @@ void dasd_alias_handle_summary_unit_check(struct dasd_device *device,
* the next interrupt on a different device
*/
if (list_empty(&device->alias_list)) {
DEV_MESSAGE(KERN_WARNING, device, "%s",
DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"device is in offline processing,"
" don't do summary unit check handling");
spin_unlock(&lcu->lock);
return;
}
if (lcu->suc_data.device) {
/* already scheduled or running */
DEV_MESSAGE(KERN_WARNING, device, "%s",
DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"previous instance of summary unit check worker"
" still pending");
spin_unlock(&lcu->lock);
Expand Down
38 changes: 19 additions & 19 deletions drivers/s390/block/dasd_devmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
*/

#define KMSG_COMPONENT "dasd"

#include <linux/ctype.h>
#include <linux/init.h>
#include <linux/module.h>
Expand Down Expand Up @@ -127,15 +129,15 @@ __setup ("dasd=", dasd_call_setup);
* Read a device busid/devno from a string.
*/
static int

dasd_busid(char **str, int *id0, int *id1, int *devno)
{
int val, old_style;

/* Interpret ipldev busid */
if (strncmp(DASD_IPLDEV, *str, strlen(DASD_IPLDEV)) == 0) {
if (ipl_info.type != IPL_TYPE_CCW) {
MESSAGE(KERN_ERR, "%s", "ipl device is not a ccw "
"device");
pr_err("The IPL device is not a CCW device\n");
return -EINVAL;
}
*id0 = 0;
Expand Down Expand Up @@ -211,9 +213,8 @@ dasd_feature_list(char *str, char **endp)
else if (len == 8 && !strncmp(str, "failfast", 8))
features |= DASD_FEATURE_FAILFAST;
else {
MESSAGE(KERN_WARNING,
"unsupported feature: %*s, "
"ignoring setting", len, str);
pr_warning("%*s is not a supported device option\n",
len, str);
rc = -EINVAL;
}
str += len;
Expand All @@ -222,8 +223,8 @@ dasd_feature_list(char *str, char **endp)
str++;
}
if (*str != ')') {
MESSAGE(KERN_WARNING, "%s",
"missing ')' in dasd parameter string\n");
pr_warning("A closing parenthesis ')' is missing in the "
"dasd= parameter\n");
rc = -EINVAL;
} else
str++;
Expand Down Expand Up @@ -255,28 +256,27 @@ dasd_parse_keyword( char *parsestring ) {
}
if (strncmp("autodetect", parsestring, length) == 0) {
dasd_autodetect = 1;
MESSAGE (KERN_INFO, "%s",
"turning to autodetection mode");
pr_info("The autodetection mode has been activated\n");
return residual_str;
}
if (strncmp("probeonly", parsestring, length) == 0) {
dasd_probeonly = 1;
MESSAGE(KERN_INFO, "%s",
"turning to probeonly mode");
pr_info("The probeonly mode has been activated\n");
return residual_str;
}
if (strncmp("nopav", parsestring, length) == 0) {
if (MACHINE_IS_VM)
MESSAGE(KERN_INFO, "%s", "'nopav' not supported on VM");
pr_info("'nopav' is not supported on z/VM\n");
else {
dasd_nopav = 1;
MESSAGE(KERN_INFO, "%s", "disable PAV mode");
pr_info("PAV support has be deactivated\n");
}
return residual_str;
}
if (strncmp("nofcx", parsestring, length) == 0) {
dasd_nofcx = 1;
MESSAGE(KERN_INFO, "%s", "disable High Performance Ficon");
pr_info("High Performance FICON support has been "
"deactivated\n");
return residual_str;
}
if (strncmp("fixedbuffers", parsestring, length) == 0) {
Expand All @@ -287,10 +287,10 @@ dasd_parse_keyword( char *parsestring ) {
PAGE_SIZE, SLAB_CACHE_DMA,
NULL);
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.");
else
MESSAGE (KERN_INFO, "%s",
DBF_EVENT(DBF_INFO, "%s",
"turning on fixed buffer mode");
return residual_str;
}
Expand Down Expand Up @@ -328,7 +328,7 @@ dasd_parse_range( char *parsestring ) {
(from_id0 != to_id0 || from_id1 != to_id1 || from > to))
rc = -EINVAL;
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);
}
features = dasd_feature_list(str, &str);
Expand All @@ -347,8 +347,8 @@ dasd_parse_range( char *parsestring ) {
return str + 1;
if (*str == '\0')
return str;
MESSAGE(KERN_WARNING,
"junk at end of dasd parameter string: %s\n", str);
pr_warning("The dasd= parameter value %s has an invalid ending\n",
str);
return ERR_PTR(-EINVAL);
}

Expand Down
66 changes: 32 additions & 34 deletions drivers/s390/block/dasd_diag.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
*
*/

#define KMSG_COMPONENT "dasd"

#include <linux/stddef.h>
#include <linux/kernel.h>
#include <linux/slab.h>
Expand Down Expand Up @@ -144,8 +146,8 @@ dasd_diag_erp(struct dasd_device *device)
mdsk_term_io(device);
rc = mdsk_init_io(device, device->block->bp_block, 0, NULL);
if (rc)
DEV_MESSAGE(KERN_WARNING, device, "DIAG ERP unsuccessful, "
"rc=%d", rc);
dev_warn(&device->cdev->dev, "DIAG ERP failed with "
"rc=%d\n", rc);
}

/* Start a given request at the device. Return zero on success, non-zero
Expand All @@ -160,7 +162,7 @@ dasd_start_diag(struct dasd_ccw_req * cqr)

device = cqr->startdev;
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);
cqr->status = DASD_CQR_ERROR;
return -EIO;
Expand Down Expand Up @@ -195,7 +197,7 @@ dasd_start_diag(struct dasd_ccw_req * cqr)
break;
default: /* Error condition */
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);
rc = -EIO;
break;
Expand Down Expand Up @@ -243,13 +245,14 @@ dasd_ext_handler(__u16 code)
return;
}
if (!ip) { /* no intparm: unsolicited interrupt */
MESSAGE(KERN_DEBUG, "%s", "caught unsolicited interrupt");
DBF_EVENT(DBF_NOTICE, "%s", "caught unsolicited "
"interrupt");
return;
}
cqr = (struct dasd_ccw_req *) ip;
device = (struct dasd_device *) cqr->startdev;
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"
" match discipline 0x%08X",
cqr->magic, *(int *) (&device->discipline->name));
Expand Down Expand Up @@ -281,15 +284,11 @@ dasd_ext_handler(__u16 code)
rc = dasd_start_diag(next);
if (rc == 0)
expires = next->expires;
else if (rc != -EACCES)
DEV_MESSAGE(KERN_WARNING, device, "%s",
"Interrupt fastpath "
"failed!");
}
}
} else {
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,
cqr->retries);
dasd_diag_erp(device);
Expand Down Expand Up @@ -322,16 +321,17 @@ dasd_diag_check_device(struct dasd_device *device)
if (private == NULL) {
private = kzalloc(sizeof(struct dasd_diag_private),GFP_KERNEL);
if (private == NULL) {
DEV_MESSAGE(KERN_WARNING, device, "%s",
"memory allocation failed for private data");
DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"Allocating memory for private DASD data "
"failed\n");
return -ENOMEM;
}
ccw_device_get_id(device->cdev, &private->dev_id);
device->private = (void *) private;
}
block = dasd_alloc_block();
if (IS_ERR(block)) {
DEV_MESSAGE(KERN_WARNING, device, "%s",
DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"could not allocate dasd block structure");
device->private = NULL;
kfree(private);
Expand All @@ -347,7 +347,7 @@ dasd_diag_check_device(struct dasd_device *device)

rc = diag210((struct diag210 *) rdc_data);
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);
rc = -EOPNOTSUPP;
goto out;
Expand All @@ -362,8 +362,8 @@ dasd_diag_check_device(struct dasd_device *device)
private->pt_block = 2;
break;
default:
DEV_MESSAGE(KERN_WARNING, device, "unsupported device class "
"(class=%d)", private->rdc_data.vdev_class);
dev_warn(&device->cdev->dev, "Device type %d is not supported "
"in DIAG mode\n", private->rdc_data.vdev_class);
rc = -EOPNOTSUPP;
goto out;
}
Expand All @@ -380,7 +380,7 @@ dasd_diag_check_device(struct dasd_device *device)
/* figure out blocksize of device */
label = (struct vtoc_cms_label *) get_zeroed_page(GFP_KERNEL);
if (label == NULL) {
DEV_MESSAGE(KERN_WARNING, device, "%s",
DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"No memory to allocate initialization request");
rc = -ENOMEM;
goto out;
Expand All @@ -404,8 +404,8 @@ dasd_diag_check_device(struct dasd_device *device)
private->iob.flaga = DASD_DIAG_FLAGA_DEFAULT;
rc = dia250(&private->iob, RW_BIO);
if (rc == 3) {
DEV_MESSAGE(KERN_WARNING, device, "%s",
"DIAG call failed");
dev_warn(&device->cdev->dev,
"A 64-bit DIAG call failed\n");
rc = -EOPNOTSUPP;
goto out_label;
}
Expand All @@ -414,8 +414,8 @@ dasd_diag_check_device(struct dasd_device *device)
break;
}
if (bsize > PAGE_SIZE) {
DEV_MESSAGE(KERN_WARNING, device, "device access failed "
"(rc=%d)", rc);
dev_warn(&device->cdev->dev, "Accessing the DASD failed because"
" of an incorrect format (rc=%d)\n", rc);
rc = -EIO;
goto out_label;
}
Expand All @@ -433,15 +433,15 @@ dasd_diag_check_device(struct dasd_device *device)
block->s2b_shift++;
rc = mdsk_init_io(device, block->bp_block, 0, NULL);
if (rc) {
DEV_MESSAGE(KERN_WARNING, device, "DIAG initialization "
"failed (rc=%d)", rc);
dev_warn(&device->cdev->dev, "DIAG initialization "
"failed with rc=%d\n", rc);
rc = -EIO;
} else {
DEV_MESSAGE(KERN_INFO, device,
"(%ld B/blk): %ldkB",
(unsigned long) block->bp_block,
(unsigned long) (block->blocks <<
block->s2b_shift) >> 1);
dev_info(&device->cdev->dev,
"New DASD with %ld byte/block, total size %ld KB\n",
(unsigned long) block->bp_block,
(unsigned long) (block->blocks <<
block->s2b_shift) >> 1);
}
out_label:
free_page((long) label);
Expand Down Expand Up @@ -595,7 +595,7 @@ static void
dasd_diag_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
struct irb *stat)
{
DEV_MESSAGE(KERN_ERR, device, "%s",
DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"dump sense not available for DIAG data");
}

Expand All @@ -621,10 +621,8 @@ static int __init
dasd_diag_init(void)
{
if (!MACHINE_IS_VM) {
MESSAGE_LOG(KERN_INFO,
"Machine is not VM: %s "
"discipline not initializing",
dasd_diag_discipline.name);
pr_info("Discipline %s cannot be used without z/VM\n",
dasd_diag_discipline.name);
return -ENODEV;
}
ASCEBC(dasd_diag_discipline.ebcname, 4);
Expand Down
Loading

0 comments on commit fc19f38

Please sign in to comment.