/*
* drivers/s390/cio/device.c
* bus driver for ccw devices
- * $Revision: 1.128 $
+ * $Revision: 1.129 $
*
* Copyright (C) 2002 IBM Deutschland Entwicklung GmbH,
* IBM Corporation
cdev = to_ccwdev(dev);
if ((cdev->private->state == DEV_STATE_DISCONNECTED) &&
(cdev->private->devno == devno) &&
- (!strncmp(cdev->dev.bus_id, sibling->dev.bus_id,
- BUS_ID_SIZE))) {
+ (cdev != sibling)) {
cdev->private->state = DEV_STATE_NOT_OPER;
break;
}
return cdev;
}
+static void
+ccw_device_add_changed(void *data)
+{
+
+ struct ccw_device *cdev;
+
+ cdev = (struct ccw_device *)data;
+ if (device_add(&cdev->dev)) {
+ put_device(&cdev->dev);
+ return;
+ }
+ set_bit(1, &cdev->private->registered);
+ if (device_add_files(&cdev->dev)) {
+ if (test_and_clear_bit(1, &cdev->private->registered))
+ device_unregister(&cdev->dev);
+ }
+}
+
extern int css_get_ssd_info(struct subchannel *sch);
void
if (need_rename)
snprintf (cdev->dev.bus_id, BUS_ID_SIZE, "0.0.%04x",
sch->schib.pmcw.dev);
- if (device_add(&cdev->dev)) {
- put_device(&cdev->dev);
- return;
- }
- set_bit(1, &cdev->private->registered);
- if (device_add_files(&cdev->dev)) {
- if (test_and_clear_bit(1, &cdev->private->registered))
- device_unregister(&cdev->dev);
- }
+ PREPARE_WORK(&cdev->private->kick_work,
+ ccw_device_add_changed, (void *)cdev);
+ queue_work(ccw_device_work, &cdev->private->kick_work);
}
static void
panic("Can't stop i/o on subchannel.\n");
}
-static void
+static int
ccw_device_handle_oper(struct ccw_device *cdev)
{
struct subchannel *sch;
PREPARE_WORK(&cdev->private->kick_work,
ccw_device_do_unreg_rereg, (void *)cdev);
queue_work(ccw_device_work, &cdev->private->kick_work);
- return;
+ return 0;
}
cdev->private->flags.donotify = 1;
+ return 1;
}
/*
ccw_device_recog_done(struct ccw_device *cdev, int state)
{
struct subchannel *sch;
- int notify, old_lpm;
+ int notify, old_lpm, same_dev;
sch = to_subchannel(cdev->dev.parent);
/* Boxed devices don't need extra treatment. */
}
notify = 0;
+ same_dev = 0; /* Keep the compiler quiet... */
switch (state) {
case DEV_STATE_NOT_OPER:
CIO_DEBUG(KERN_WARNING, 2,
break;
case DEV_STATE_OFFLINE:
if (cdev->private->state == DEV_STATE_DISCONNECTED_SENSE_ID) {
- ccw_device_handle_oper(cdev);
+ same_dev = ccw_device_handle_oper(cdev);
notify = 1;
}
/* fill out sense information */
.dev_model = cdev->private->senseid.dev_model,
};
if (notify) {
- /* Get device online again. */
cdev->private->state = DEV_STATE_OFFLINE;
- ccw_device_online(cdev);
- wake_up(&cdev->private->wait_q);
+ if (same_dev) {
+ /* Get device online again. */
+ ccw_device_online(cdev);
+ wake_up(&cdev->private->wait_q);
+ }
return;
}
/* Issue device info message. */
#include "ioasm.h"
#include "chsc.h"
-#define VERSION_QDIO_C "$Revision: 1.89 $"
+#define VERSION_QDIO_C "$Revision: 1.93 $"
/****************** MODULE PARAMETER VARIABLES ********************/
MODULE_AUTHOR("Utz Bacher <utz.bacher@de.ibm.com>");
sprintf(dbf_text,"%4x%2x%2x",q->irq,q->q_no,
atomic_read(&q->busy_siga_counter));
QDIO_DBF_TEXT3(0,trace,dbf_text);
- q->timing.busy_start=0;
#endif /* CONFIG_QDIO_DEBUG */
+ q->timing.busy_start=0;
break;
case (2|QDIO_SIGA_ERROR_B_BIT_SET):
/* cc=2 and busy bit: */
u32 kc:4;
u32 reserved4:21;
u32 isc:3;
- u32 reserved5[2];
+ u32 word_with_d_bit;
+ /* set to 0x10000000 to enable
+ * time delay disablement facility */
+ u32 reserved5;
u32 subsystem_id;
u32 reserved6[1004];
struct chsc_header response;
scssc_area->kc = QDIO_STORAGE_KEY;
scssc_area->isc = TIQDIO_THININT_ISC;
scssc_area->subsystem_id = (1<<16) + irq_ptr->irq;
+ /* enables the time delay disablement facility. Don't care
+ * whether it is really there (i.e. we haven't checked for
+ * it) */
+ scssc_area->word_with_d_bit = 0x10000000;
+
+
result = chsc(scssc_area);
if (result) {
init_MUTEX(&irq_ptr->setting_up_sema);
+ /* QDR must be in DMA area since CCW data address is only 32 bit */
irq_ptr->qdr=kmalloc(sizeof(struct qdr), GFP_KERNEL | GFP_DMA);
if (!(irq_ptr->qdr)) {
kfree(irq_ptr);