s390/dasd: remove unused pm related functions

The power-management related functions are unused since the
'commit 394216275c ("s390: remove broken hibernate / power management
support")'. Remove them from dasd drivers.

Signed-off-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
This commit is contained in:
Vineeth Vijayan 2020-11-10 09:28:33 +01:00 committed by Heiko Carstens
parent 5db44cfe2e
commit 127fca6093
4 changed files with 2 additions and 198 deletions

View File

@ -75,7 +75,6 @@ static int dasd_flush_block_queue(struct dasd_block *);
static void dasd_device_tasklet(unsigned long); static void dasd_device_tasklet(unsigned long);
static void dasd_block_tasklet(unsigned long); static void dasd_block_tasklet(unsigned long);
static void do_kick_device(struct work_struct *); static void do_kick_device(struct work_struct *);
static void do_restore_device(struct work_struct *);
static void do_reload_device(struct work_struct *); static void do_reload_device(struct work_struct *);
static void do_requeue_requests(struct work_struct *); static void do_requeue_requests(struct work_struct *);
static void dasd_return_cqr_cb(struct dasd_ccw_req *, void *); static void dasd_return_cqr_cb(struct dasd_ccw_req *, void *);
@ -138,7 +137,6 @@ struct dasd_device *dasd_alloc_device(void)
INIT_LIST_HEAD(&device->ccw_queue); INIT_LIST_HEAD(&device->ccw_queue);
timer_setup(&device->timer, dasd_device_timeout, 0); timer_setup(&device->timer, dasd_device_timeout, 0);
INIT_WORK(&device->kick_work, do_kick_device); INIT_WORK(&device->kick_work, do_kick_device);
INIT_WORK(&device->restore_device, do_restore_device);
INIT_WORK(&device->reload_device, do_reload_device); INIT_WORK(&device->reload_device, do_reload_device);
INIT_WORK(&device->requeue_requests, do_requeue_requests); INIT_WORK(&device->requeue_requests, do_requeue_requests);
device->state = DASD_STATE_NEW; device->state = DASD_STATE_NEW;
@ -620,26 +618,6 @@ void dasd_reload_device(struct dasd_device *device)
} }
EXPORT_SYMBOL(dasd_reload_device); EXPORT_SYMBOL(dasd_reload_device);
/*
* dasd_restore_device will schedule a call do do_restore_device to the kernel
* event daemon.
*/
static void do_restore_device(struct work_struct *work)
{
struct dasd_device *device = container_of(work, struct dasd_device,
restore_device);
device->cdev->drv->restore(device->cdev);
dasd_put_device(device);
}
void dasd_restore_device(struct dasd_device *device)
{
dasd_get_device(device);
/* queue call to dasd_restore_device to the kernel event daemon. */
if (!schedule_work(&device->restore_device))
dasd_put_device(device);
}
/* /*
* Set the target state for a device and starts the state change. * Set the target state for a device and starts the state change.
*/ */
@ -1514,7 +1492,6 @@ int dasd_start_IO(struct dasd_ccw_req *cqr)
"start_IO: -EIO device gone, retry"); "start_IO: -EIO device gone, retry");
break; break;
case -EINVAL: case -EINVAL:
/* most likely caused in power management context */
DBF_DEV_EVENT(DBF_WARNING, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"start_IO: -EINVAL device currently " "start_IO: -EINVAL device currently "
"not accessible"); "not accessible");
@ -2048,7 +2025,7 @@ static void __dasd_device_check_expire(struct dasd_device *device)
static int __dasd_device_is_unusable(struct dasd_device *device, static int __dasd_device_is_unusable(struct dasd_device *device,
struct dasd_ccw_req *cqr) struct dasd_ccw_req *cqr)
{ {
int mask = ~(DASD_STOPPED_DC_WAIT | DASD_UNRESUMED_PM | DASD_STOPPED_NOSPC); int mask = ~(DASD_STOPPED_DC_WAIT | DASD_STOPPED_NOSPC);
if (test_bit(DASD_FLAG_OFFLINE, &device->flags) && if (test_bit(DASD_FLAG_OFFLINE, &device->flags) &&
!test_bit(DASD_FLAG_SAFE_OFFLINE_RUNNING, &device->flags)) { !test_bit(DASD_FLAG_SAFE_OFFLINE_RUNNING, &device->flags)) {
@ -2112,8 +2089,7 @@ static void __dasd_device_check_path_events(struct dasd_device *device)
if (!dasd_path_get_tbvpm(device)) if (!dasd_path_get_tbvpm(device))
return; return;
if (device->stopped & if (device->stopped & ~(DASD_STOPPED_DC_WAIT))
~(DASD_STOPPED_DC_WAIT | DASD_UNRESUMED_PM))
return; return;
rc = device->discipline->verify_path(device, rc = device->discipline->verify_path(device,
dasd_path_get_tbvpm(device)); dasd_path_get_tbvpm(device));
@ -3788,11 +3764,6 @@ int dasd_generic_path_operational(struct dasd_device *device)
"operational\n"); "operational\n");
DBF_DEV_EVENT(DBF_WARNING, device, "%s", "path operational"); DBF_DEV_EVENT(DBF_WARNING, device, "%s", "path operational");
dasd_device_remove_stop_bits(device, DASD_STOPPED_DC_WAIT); dasd_device_remove_stop_bits(device, DASD_STOPPED_DC_WAIT);
if (device->stopped & DASD_UNRESUMED_PM) {
dasd_device_remove_stop_bits(device, DASD_UNRESUMED_PM);
dasd_restore_device(device);
return 1;
}
dasd_schedule_device_bh(device); dasd_schedule_device_bh(device);
if (device->block) { if (device->block) {
dasd_schedule_block_bh(device->block); dasd_schedule_block_bh(device->block);
@ -4052,66 +4023,6 @@ void dasd_schedule_requeue(struct dasd_device *device)
} }
EXPORT_SYMBOL(dasd_schedule_requeue); EXPORT_SYMBOL(dasd_schedule_requeue);
int dasd_generic_pm_freeze(struct ccw_device *cdev)
{
struct dasd_device *device = dasd_device_from_cdev(cdev);
if (IS_ERR(device))
return PTR_ERR(device);
/* mark device as suspended */
set_bit(DASD_FLAG_SUSPENDED, &device->flags);
if (device->discipline->freeze)
device->discipline->freeze(device);
/* disallow new I/O */
dasd_device_set_stop_bits(device, DASD_STOPPED_PM);
return dasd_generic_requeue_all_requests(device);
}
EXPORT_SYMBOL_GPL(dasd_generic_pm_freeze);
int dasd_generic_restore_device(struct ccw_device *cdev)
{
struct dasd_device *device = dasd_device_from_cdev(cdev);
int rc = 0;
if (IS_ERR(device))
return PTR_ERR(device);
/* allow new IO again */
dasd_device_remove_stop_bits(device,
(DASD_STOPPED_PM | DASD_UNRESUMED_PM));
dasd_schedule_device_bh(device);
/*
* call discipline restore function
* if device is stopped do nothing e.g. for disconnected devices
*/
if (device->discipline->restore && !(device->stopped))
rc = device->discipline->restore(device);
if (rc || device->stopped)
/*
* if the resume failed for the DASD we put it in
* an UNRESUMED stop state
*/
device->stopped |= DASD_UNRESUMED_PM;
if (device->block) {
dasd_schedule_block_bh(device->block);
if (device->block->request_queue)
blk_mq_run_hw_queues(device->block->request_queue,
true);
}
clear_bit(DASD_FLAG_SUSPENDED, &device->flags);
dasd_put_device(device);
return 0;
}
EXPORT_SYMBOL_GPL(dasd_generic_restore_device);
static struct dasd_ccw_req *dasd_generic_build_rdc(struct dasd_device *device, static struct dasd_ccw_req *dasd_generic_build_rdc(struct dasd_device *device,
int rdc_buffer_size, int rdc_buffer_size,
int magic) int magic)

View File

@ -5716,95 +5716,6 @@ static void dasd_eckd_dump_sense(struct dasd_device *device,
} }
} }
static int dasd_eckd_pm_freeze(struct dasd_device *device)
{
/*
* the device should be disconnected from our LCU structure
* on restore we will reconnect it and reread LCU specific
* information like PAV support that might have changed
*/
dasd_alias_remove_device(device);
dasd_alias_disconnect_device_from_lcu(device);
return 0;
}
static int dasd_eckd_restore_device(struct dasd_device *device)
{
struct dasd_eckd_private *private = device->private;
struct dasd_eckd_characteristics temp_rdc_data;
int rc;
struct dasd_uid temp_uid;
unsigned long flags;
unsigned long cqr_flags = 0;
/* Read Configuration Data */
rc = dasd_eckd_read_conf(device);
if (rc) {
DBF_EVENT_DEVID(DBF_WARNING, device->cdev,
"Read configuration data failed, rc=%d", rc);
goto out_err;
}
dasd_eckd_get_uid(device, &temp_uid);
/* Generate device unique id */
rc = dasd_eckd_generate_uid(device);
spin_lock_irqsave(get_ccwdev_lock(device->cdev), flags);
if (memcmp(&private->uid, &temp_uid, sizeof(struct dasd_uid)) != 0)
dev_err(&device->cdev->dev, "The UID of the DASD has "
"changed\n");
spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags);
if (rc)
goto out_err;
/* register lcu with alias handling, enable PAV if this is a new lcu */
rc = dasd_alias_make_device_known_to_lcu(device);
if (rc)
goto out_err;
set_bit(DASD_CQR_FLAGS_FAILFAST, &cqr_flags);
dasd_eckd_validate_server(device, cqr_flags);
/* RE-Read Configuration Data */
rc = dasd_eckd_read_conf(device);
if (rc) {
DBF_EVENT_DEVID(DBF_WARNING, device->cdev,
"Read configuration data failed, rc=%d", rc);
goto out_err2;
}
/* Read Feature Codes */
dasd_eckd_read_features(device);
/* Read Volume Information */
dasd_eckd_read_vol_info(device);
/* Read Extent Pool Information */
dasd_eckd_read_ext_pool_info(device);
/* Read Device Characteristics */
rc = dasd_generic_read_dev_chars(device, DASD_ECKD_MAGIC,
&temp_rdc_data, 64);
if (rc) {
DBF_EVENT_DEVID(DBF_WARNING, device->cdev,
"Read device characteristic failed, rc=%d", rc);
goto out_err2;
}
spin_lock_irqsave(get_ccwdev_lock(device->cdev), flags);
memcpy(&private->rdc_data, &temp_rdc_data, sizeof(temp_rdc_data));
spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags);
/* add device to alias management */
dasd_alias_add_device(device);
return 0;
out_err2:
dasd_alias_disconnect_device_from_lcu(device);
out_err:
return -1;
}
static int dasd_eckd_reload_device(struct dasd_device *device) static int dasd_eckd_reload_device(struct dasd_device *device)
{ {
struct dasd_eckd_private *private = device->private; struct dasd_eckd_private *private = device->private;
@ -6668,9 +6579,6 @@ static struct ccw_driver dasd_eckd_driver = {
.notify = dasd_generic_notify, .notify = dasd_generic_notify,
.path_event = dasd_generic_path_event, .path_event = dasd_generic_path_event,
.shutdown = dasd_generic_shutdown, .shutdown = dasd_generic_shutdown,
.freeze = dasd_generic_pm_freeze,
.thaw = dasd_generic_restore_device,
.restore = dasd_generic_restore_device,
.uc_handler = dasd_generic_uc_handler, .uc_handler = dasd_generic_uc_handler,
.int_class = IRQIO_DAS, .int_class = IRQIO_DAS,
}; };
@ -6702,8 +6610,6 @@ static struct dasd_discipline dasd_eckd_discipline = {
.dump_sense_dbf = dasd_eckd_dump_sense_dbf, .dump_sense_dbf = dasd_eckd_dump_sense_dbf,
.fill_info = dasd_eckd_fill_info, .fill_info = dasd_eckd_fill_info,
.ioctl = dasd_eckd_ioctl, .ioctl = dasd_eckd_ioctl,
.freeze = dasd_eckd_pm_freeze,
.restore = dasd_eckd_restore_device,
.reload = dasd_eckd_reload_device, .reload = dasd_eckd_reload_device,
.get_uid = dasd_eckd_get_uid, .get_uid = dasd_eckd_get_uid,
.kick_validate = dasd_eckd_kick_validate_server, .kick_validate = dasd_eckd_kick_validate_server,

View File

@ -79,9 +79,6 @@ static struct ccw_driver dasd_fba_driver = {
.set_online = dasd_fba_set_online, .set_online = dasd_fba_set_online,
.notify = dasd_generic_notify, .notify = dasd_generic_notify,
.path_event = dasd_generic_path_event, .path_event = dasd_generic_path_event,
.freeze = dasd_generic_pm_freeze,
.thaw = dasd_generic_restore_device,
.restore = dasd_generic_restore_device,
.int_class = IRQIO_DAS, .int_class = IRQIO_DAS,
}; };

View File

@ -355,10 +355,6 @@ struct dasd_discipline {
int (*fill_info) (struct dasd_device *, struct dasd_information2_t *); int (*fill_info) (struct dasd_device *, struct dasd_information2_t *);
int (*ioctl) (struct dasd_block *, unsigned int, void __user *); int (*ioctl) (struct dasd_block *, unsigned int, void __user *);
/* suspend/resume functions */
int (*freeze) (struct dasd_device *);
int (*restore) (struct dasd_device *);
/* reload device after state change */ /* reload device after state change */
int (*reload) (struct dasd_device *); int (*reload) (struct dasd_device *);
@ -520,7 +516,6 @@ struct dasd_device {
atomic_t tasklet_scheduled; atomic_t tasklet_scheduled;
struct tasklet_struct tasklet; struct tasklet_struct tasklet;
struct work_struct kick_work; struct work_struct kick_work;
struct work_struct restore_device;
struct work_struct reload_device; struct work_struct reload_device;
struct work_struct kick_validate; struct work_struct kick_validate;
struct work_struct suc_work; struct work_struct suc_work;
@ -592,8 +587,6 @@ struct dasd_queue {
#define DASD_STOPPED_PENDING 4 /* long busy */ #define DASD_STOPPED_PENDING 4 /* long busy */
#define DASD_STOPPED_DC_WAIT 8 /* disconnected, wait */ #define DASD_STOPPED_DC_WAIT 8 /* disconnected, wait */
#define DASD_STOPPED_SU 16 /* summary unit check handling */ #define DASD_STOPPED_SU 16 /* summary unit check handling */
#define DASD_STOPPED_PM 32 /* pm state transition */
#define DASD_UNRESUMED_PM 64 /* pm resume failed state */
#define DASD_STOPPED_NOSPC 128 /* no space left */ #define DASD_STOPPED_NOSPC 128 /* no space left */
/* per device flags */ /* per device flags */
@ -753,7 +746,6 @@ enum blk_eh_timer_return dasd_times_out(struct request *req, bool reserved);
void dasd_enable_device(struct dasd_device *); void dasd_enable_device(struct dasd_device *);
void dasd_set_target_state(struct dasd_device *, int); void dasd_set_target_state(struct dasd_device *, int);
void dasd_kick_device(struct dasd_device *); void dasd_kick_device(struct dasd_device *);
void dasd_restore_device(struct dasd_device *);
void dasd_reload_device(struct dasd_device *); void dasd_reload_device(struct dasd_device *);
void dasd_schedule_requeue(struct dasd_device *); void dasd_schedule_requeue(struct dasd_device *);
@ -785,8 +777,6 @@ int dasd_generic_path_operational(struct dasd_device *);
void dasd_generic_shutdown(struct ccw_device *); void dasd_generic_shutdown(struct ccw_device *);
void dasd_generic_handle_state_change(struct dasd_device *); void dasd_generic_handle_state_change(struct dasd_device *);
int dasd_generic_pm_freeze(struct ccw_device *);
int dasd_generic_restore_device(struct ccw_device *);
enum uc_todo dasd_generic_uc_handler(struct ccw_device *, struct irb *); enum uc_todo dasd_generic_uc_handler(struct ccw_device *, struct irb *);
void dasd_generic_path_event(struct ccw_device *, int *); void dasd_generic_path_event(struct ccw_device *, int *);
int dasd_generic_verify_path(struct dasd_device *, __u8); int dasd_generic_verify_path(struct dasd_device *, __u8);