* Bugreports.to..: <Linux390@de.ibm.com>
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
*
- * $Revision: 1.36 $
*/
#include <linux/config.h>
if (private == NULL) {
private = kmalloc(sizeof(struct dasd_fba_private), GFP_KERNEL);
if (private == NULL) {
- MESSAGE(KERN_WARNING, "%s",
- "memory allocation failed for private data");
+ DEV_MESSAGE(KERN_WARNING, device, "%s",
+ "memory allocation failed for private "
+ "data");
return -ENOMEM;
}
device->private = (void *) private;
rdc_data = (void *) &(private->rdc_data);
rc = read_dev_chars(device->cdev, &rdc_data, 32);
if (rc) {
- MESSAGE(KERN_WARNING,
- "Read device characteristics returned error %d", rc);
+ DEV_MESSAGE(KERN_WARNING, device,
+ "Read device characteristics returned error %d",
+ rc);
return rc;
}
if (cqr->function == dasd_default_erp_action)
return dasd_default_erp_postaction;
- MESSAGE(KERN_WARNING, "unknown ERP action %p", cqr->function);
-
+ DEV_MESSAGE(KERN_WARNING, cqr->device, "unknown ERP action %p",
+ cqr->function);
return NULL;
}
/* Fba can only do full blocks. */
return ERR_PTR(-EINVAL);
count += bv->bv_len >> (device->s2b_shift + 9);
-#if defined(CONFIG_ARCH_S390X)
- if (idal_is_needed (page_address(bv->bv_page), bv->bv_len))
+#if defined(CONFIG_64BIT)
+ if (idal_is_needed (page_address(bv->bv_page),
+ bv->bv_len))
cidaw += bv->bv_len / blksize;
#endif
}
dst = page_address(bv->bv_page) + bv->bv_offset;
if (dasd_page_cache) {
char *copy = kmem_cache_alloc(dasd_page_cache,
- SLAB_ATOMIC | SLAB_DMA | __GFP_NOWARN);
+ SLAB_DMA | __GFP_NOWARN);
if (copy && rq_data_dir(req) == WRITE)
memcpy(copy + bv->bv_offset, dst, bv->bv_len);
if (copy)
recid++;
}
}
+ if (req->flags & REQ_FAILFAST)
+ set_bit(DASD_CQR_FLAGS_FAILFAST, &cqr->flags);
cqr->device = device;
cqr->expires = 5 * 60 * HZ; /* 5 minutes */
+ cqr->retries = 32;
+ cqr->buildclk = get_clock();
cqr->status = DASD_CQR_FILLED;
return cqr;
}
struct irb *irb)
{
char *page;
+ struct ccw1 *act, *end, *last;
+ int len, sl, sct, count;
- page = (char *) get_zeroed_page(GFP_KERNEL);
+ page = (char *) get_zeroed_page(GFP_ATOMIC);
if (page == NULL) {
- MESSAGE(KERN_ERR, "%s", "No memory to dump sense data");
+ DEV_MESSAGE(KERN_ERR, device, " %s",
+ "No memory to dump sense data");
return;
}
- sprintf(page, KERN_WARNING PRINTK_HEADER
- "device %s: I/O status report:\n",
- device->cdev->dev.bus_id);
+ len = sprintf(page, KERN_ERR PRINTK_HEADER
+ " I/O status report for device %s:\n",
+ device->cdev->dev.bus_id);
+ len += sprintf(page + len, KERN_ERR PRINTK_HEADER
+ " in req: %p CS: 0x%02X DS: 0x%02X\n", req,
+ irb->scsw.cstat, irb->scsw.dstat);
+ len += sprintf(page + len, KERN_ERR PRINTK_HEADER
+ " device %s: Failing CCW: %p\n",
+ device->cdev->dev.bus_id,
+ (void *) (addr_t) irb->scsw.cpa);
+ if (irb->esw.esw0.erw.cons) {
+ for (sl = 0; sl < 4; sl++) {
+ len += sprintf(page + len, KERN_ERR PRINTK_HEADER
+ " Sense(hex) %2d-%2d:",
+ (8 * sl), ((8 * sl) + 7));
+
+ for (sct = 0; sct < 8; sct++) {
+ len += sprintf(page + len, " %02x",
+ irb->ecw[8 * sl + sct]);
+ }
+ len += sprintf(page + len, "\n");
+ }
+ } else {
+ len += sprintf(page + len, KERN_ERR PRINTK_HEADER
+ " SORRY - NO VALID SENSE AVAILABLE\n");
+ }
+ MESSAGE_LOG(KERN_ERR, "%s",
+ page + sizeof(KERN_ERR PRINTK_HEADER));
+
+ /* dump the Channel Program */
+ /* print first CCWs (maximum 8) */
+ act = req->cpaddr;
+ for (last = act; last->flags & (CCW_FLAG_CC | CCW_FLAG_DC); last++);
+ end = min(act + 8, last);
+ len = sprintf(page, KERN_ERR PRINTK_HEADER
+ " Related CP in req: %p\n", req);
+ while (act <= end) {
+ len += sprintf(page + len, KERN_ERR PRINTK_HEADER
+ " CCW %p: %08X %08X DAT:",
+ act, ((int *) act)[0], ((int *) act)[1]);
+ for (count = 0; count < 32 && count < act->count;
+ count += sizeof(int))
+ len += sprintf(page + len, " %08X",
+ ((int *) (addr_t) act->cda)
+ [(count>>2)]);
+ len += sprintf(page + len, "\n");
+ act++;
+ }
+ MESSAGE_LOG(KERN_ERR, "%s",
+ page + sizeof(KERN_ERR PRINTK_HEADER));
- MESSAGE(KERN_ERR, "Sense data:\n%s", page);
+ /* print failing CCW area */
+ len = 0;
+ if (act < ((struct ccw1 *)(addr_t) irb->scsw.cpa) - 2) {
+ act = ((struct ccw1 *)(addr_t) irb->scsw.cpa) - 2;
+ len += sprintf(page + len, KERN_ERR PRINTK_HEADER "......\n");
+ }
+ end = min((struct ccw1 *)(addr_t) irb->scsw.cpa + 2, last);
+ while (act <= end) {
+ len += sprintf(page + len, KERN_ERR PRINTK_HEADER
+ " CCW %p: %08X %08X DAT:",
+ act, ((int *) act)[0], ((int *) act)[1]);
+ for (count = 0; count < 32 && count < act->count;
+ count += sizeof(int))
+ len += sprintf(page + len, " %08X",
+ ((int *) (addr_t) act->cda)
+ [(count>>2)]);
+ len += sprintf(page + len, "\n");
+ act++;
+ }
+
+ /* print last CCWs */
+ if (act < last - 2) {
+ act = last - 2;
+ len += sprintf(page + len, KERN_ERR PRINTK_HEADER "......\n");
+ }
+ while (act <= last) {
+ len += sprintf(page + len, KERN_ERR PRINTK_HEADER
+ " CCW %p: %08X %08X DAT:",
+ act, ((int *) act)[0], ((int *) act)[1]);
+ for (count = 0; count < 32 && count < act->count;
+ count += sizeof(int))
+ len += sprintf(page + len, " %08X",
+ ((int *) (addr_t) act->cda)
+ [(count>>2)]);
+ len += sprintf(page + len, "\n");
+ act++;
+ }
+ if (len > 0)
+ MESSAGE_LOG(KERN_ERR, "%s",
+ page + sizeof(KERN_ERR PRINTK_HEADER));
free_page((unsigned long) page);
}