Exemplo n.º 1
0
static int slow_eval_unknown_fn(struct subchannel_id schid, void *data)
{
	int eval;
	int rc = 0;

	spin_lock_irq(&slow_subchannel_lock);
	eval = idset_sch_contains(slow_subchannel_set, schid);
	idset_sch_del(slow_subchannel_set, schid);
	spin_unlock_irq(&slow_subchannel_lock);
	if (eval) {
		rc = css_evaluate_new_subchannel(schid, 1);
		switch (rc) {
		case -EAGAIN:
			css_schedule_eval(schid);
			rc = 0;
			break;
		case -ENXIO:
		case -ENOMEM:
		case -EIO:
			/* These should abort looping */
			spin_lock_irq(&slow_subchannel_lock);
			idset_sch_del_subseq(slow_subchannel_set, schid);
			spin_unlock_irq(&slow_subchannel_lock);
			break;
		default:
			rc = 0;
		}
		/* Allow scheduling here since the containing loop might
		 * take a while.  */
		cond_resched();
	}
	return rc;
}
Exemplo n.º 2
0
static int
__s390_vary_chpid_on(struct subchannel_id schid, void *data)
{
    struct schib schib;

    if (stsch_err(schid, &schib))
        /* We're through */
        return -ENXIO;
    /* Put it on the slow path. */
    css_schedule_eval(schid);
    return 0;
}
Exemplo n.º 3
0
static void css_evaluate_subchannel(struct subchannel_id schid, int slow)
{
	struct subchannel *sch;
	int ret;

	sch = get_subchannel_by_schid(schid);
	if (sch) {
		ret = css_evaluate_known_subchannel(sch, slow);
		put_device(&sch->dev);
	} else
		ret = css_evaluate_new_subchannel(schid, slow);
	if (ret == -EAGAIN)
		css_schedule_eval(schid);
}
Exemplo n.º 4
0
static int s390_subchannel_remove_chpid(struct subchannel *sch, void *data)
{
    spin_lock_irq(sch->lock);
    if (sch->driver && sch->driver->chp_event)
        if (sch->driver->chp_event(sch, data, CHP_OFFLINE) != 0)
            goto out_unreg;
    spin_unlock_irq(sch->lock);
    return 0;

out_unreg:
    sch->lpm = 0;
    spin_unlock_irq(sch->lock);
    css_schedule_eval(sch->schid);
    return 0;
}
Exemplo n.º 5
0
static int slow_eval_known_fn(struct subchannel *sch, void *data)
{
	int eval;
	int rc;

	spin_lock_irq(&slow_subchannel_lock);
	eval = idset_sch_contains(slow_subchannel_set, sch->schid);
	idset_sch_del(slow_subchannel_set, sch->schid);
	spin_unlock_irq(&slow_subchannel_lock);
	if (eval) {
		rc = css_evaluate_known_subchannel(sch, 1);
		if (rc == -EAGAIN)
			css_schedule_eval(sch->schid);
	}
	return 0;
}
Exemplo n.º 6
0
static int s390_process_res_acc_new_sch(struct subchannel_id schid, void *data)
{
    struct schib schib;
    /*
     * We don't know the device yet, but since a path
     * may be available now to the device we'll have
     * to do recognition again.
     * Since we don't have any idea about which chpid
     * that beast may be on we'll have to do a stsch
     * on all devices, grr...
     */
    if (stsch_err(schid, &schib))
        /* We're through */
        return -ENXIO;

    /* Put it on the slow path. */
    css_schedule_eval(schid);
    return 0;
}