Example #1
0
/*
 * s390_init_machine_check
 *
 * initialize machine check handling
 */
static int
machine_check_init(void)
{
    init_MUTEX_LOCKED(&m_sem);
    ctl_clear_bit(14, 25);	/* disable damage MCH */
    ctl_set_bit(14, 26);	/* enable degradation MCH */
    ctl_set_bit(14, 27);	/* enable system recovery MCH */
#ifdef CONFIG_MACHCHK_WARNING
    ctl_set_bit(14, 24);	/* enable warning MCH */
#endif
    return 0;
}
Example #2
0
struct subchannel *
cio_probe_console(void)
{
	int irq, ret;

	if (xchg(&console_subchannel_in_use, 1) != 0)
		return ERR_PTR(-EBUSY);
	irq = cio_console_irq();
	if (irq == -1) {
		console_subchannel_in_use = 0;
		return ERR_PTR(-ENODEV);
	}
	memset(&console_subchannel, 0, sizeof(struct subchannel));
	ret = cio_validate_subchannel(&console_subchannel, irq);
	if (ret) {
		console_subchannel_in_use = 0;
		return ERR_PTR(-ENODEV);
	}

	/*
	 * enable console I/O-interrupt subclass 7
	 */
	ctl_set_bit(6, 24);
	console_subchannel.schib.pmcw.isc = 7;
	console_subchannel.schib.pmcw.intparm =
		(__u32)(unsigned long)&console_subchannel;
	ret = cio_modify(&console_subchannel);
	if (ret) {
		console_subchannel_in_use = 0;
		return ERR_PTR(ret);
	}
	return &console_subchannel;
}
Example #3
0
/*
 * Machine checks for the channel subsystem must be enabled
 * after the channel subsystem is initialized
 */
static int __init
machine_check_crw_init (void)
{
    kernel_thread(s390_collect_crw_info, &m_sem, CLONE_FS|CLONE_FILES);
    ctl_set_bit(14, 28);	/* enable channel report MCH */
    return 0;
}
Example #4
0
/*
 * Machine checks for the channel subsystem must be enabled
 * after the channel subsystem is initialized
 */
static int __init crw_machine_check_init(void)
{
	struct task_struct *task;

	task = kthread_run(crw_collect_info, NULL, "kmcheck");
	if (IS_ERR(task))
		return PTR_ERR(task);
	ctl_set_bit(14, 28);	/* enable channel report MCH */
	return 0;
}
Example #5
0
void isc_register(unsigned int isc)
{
	if (isc > MAX_ISC) {
		WARN_ON(1);
		return;
	}

	spin_lock(&isc_ref_lock);
	if (isc_refs[isc] == 0)
		ctl_set_bit(6, 31 - isc);
	isc_refs[isc]++;
	spin_unlock(&isc_ref_lock);
}
Example #6
0
struct subchannel *
cio_probe_console(void)
{
	int sch_no, ret;
	struct subchannel_id schid;

	if (xchg(&console_subchannel_in_use, 1) != 0)
		return ERR_PTR(-EBUSY);
	sch_no = cio_get_console_sch_no();
	if (sch_no == -1) {
		console_subchannel_in_use = 0;
		return ERR_PTR(-ENODEV);
	}
	memset(&console_subchannel, 0, sizeof(struct subchannel));
	init_subchannel_id(&schid);
	schid.sch_no = sch_no;
	ret = cio_validate_subchannel(&console_subchannel, schid);
	if (ret) {
		console_subchannel_in_use = 0;
		return ERR_PTR(-ENODEV);
	}

	/*
	 * enable console I/O-interrupt subclass 7
	 */
	ctl_set_bit(6, 24);
	console_subchannel.schib.pmcw.isc = 7;
	console_subchannel.schib.pmcw.intparm =
		(__u32)(unsigned long)&console_subchannel;
	ret = cio_modify(&console_subchannel);
	if (ret) {
		console_subchannel_in_use = 0;
		return ERR_PTR(ret);
	}
	return &console_subchannel;
}
Example #7
0
/*
 * s390_init_machine_check
 *
 * initialize machine check handling
 */
void s390_init_machine_check( void )
{
	crwe_t  *pcrwe;	 /* CRW buffer element pointer */
	mache_t *pmache;   /* machine check element pointer */

	init_MUTEX_LOCKED( &s_sem );

	pcrwe = kmalloc( MAX_CRW_PENDING * sizeof( crwe_t), GFP_KERNEL);

	if ( pcrwe )
	{
		int i;

		crw_buffer_anchor = pcrwe;

		for ( i=0; i < MAX_CRW_PENDING-1; i++)
		{
			pcrwe->crwe_next = (crwe_t *)((unsigned long)pcrwe + sizeof(crwe_t));
   		pcrwe            = pcrwe->crwe_next;

		} /* endfor */	

		pcrwe->crwe_next = NULL;

	}
	else
	{
		panic( "s390_init_machine_check : unable to obtain memory\n");		

	} /* endif */

	pmache = kmalloc( MAX_MACH_PENDING * sizeof( mache_t), GFP_KERNEL);

	if ( pmache )
	{
		int i;

		for ( i=0; i < MAX_MACH_PENDING; i++)
		{
			s390_enqueue_free_mchchk( pmache );
		   pmache = (mache_t *)((unsigned long)pmache + sizeof(mache_t));

		} /* endfor */	
	}
	else
	{
		panic( "s390_init_machine_check : unable to obtain memory\n");		

	} /* endif */

#ifdef S390_MACHCHK_DEBUG
	printk( KERN_NOTICE "init_mach : starting machine check handler\n");
#endif	

	kernel_thread( s390_machine_check_handler, &s_sem, CLONE_FS | CLONE_FILES);

	ctl_clear_bit( 14, 25 );  // disable damage MCH 	

	ctl_set_bit( 14, 26 ); /* enable degradation MCH */
	ctl_set_bit( 14, 27 ); /* enable system recovery MCH */
#if 1
  	ctl_set_bit( 14, 28 );		// enable channel report MCH
#endif
#ifdef CONFIG_MACHCHK_WARNING
	ctl_set_bit( 14, 24);   /* enable warning MCH */
#endif

#ifdef S390_MACHCHK_DEBUG
	printk( KERN_DEBUG "init_mach : machine check buffer : head = %08X\n",
            (unsigned)&mchchk_queue_head);
	printk( KERN_DEBUG "init_mach : machine check buffer : tail = %08X\n",
            (unsigned)&mchchk_queue_tail);
	printk( KERN_DEBUG "init_mach : machine check buffer : free = %08X\n",
            (unsigned)&mchchk_queue_free);
	printk( KERN_DEBUG "init_mach : CRW entry buffer anchor = %08X\n",
            (unsigned)&crw_buffer_anchor);
	printk( KERN_DEBUG "init_mach : machine check handler ready\n");
#endif	

	return;
}