[RFC] suspend and reset_physical, resume and reset

Dominik Brodowski linux at dominikbrodowski.net
Fri Jul 1 02:46:08 EDT 2005


Hi,

Currently there exist four "mid-operation" callbacks in pccmia:
CS_EVENT_RESET_PHYSICAL, CS_EVENT_CARD_RESET, CS_EVENT_PM_SUSPEND and
CS_EVENT_PM_RESUME. On the very most drivers,

CS_EVENT_RESET_PHYSICAL and CS_EVENT_PM_SUSPEND on the one side, and
CS_EVENT_RESET and CS_EVENT_PM_RESUME are the same code path, the only
exception being a flag being set or not (which is not evaluated elsewhere).
Therefore, in the process of splitting up the event handler, I intend to do
the following:

	.suspend()	is being called both on CS_EVENT_PM_SUSPEND and
				_RESET_PHYSICAL

	.resume()	is being called both on CS_EVENT_PM_RESUME and
				_RESET

Any objections to this? Specifically from you, Russell, as the serial_cs
driver is the only one doing things differently:

	case CS_EVENT_PM_SUSPEND:
		serial_suspend(link);
		break;

	case CS_EVENT_RESET_PHYSICAL:
		break;

	case CS_EVENT_PM_RESUME:
		serial_resume(link);
		break;

	case CS_EVENT_CARD_RESET:
		if (DEV_OK(link) && !info->slave)
			pcmcia_request_configuration(link->handle,
&link->conf);
		break;

would changing this to

static int serial_cs_suspend(struct pcmcia_device *p_dev)
{
	...
	serial_suspend(link)
	if ((link->state & DEV_CONFIG) && !info->slave)
		pcmcia_release_configuration(link->handle);
	return 0;
}

static int serial_cs_resume(struct pcmcia_device *p_dev)
{
	...
	serial_resume(link)
	if (DEV_OK(link) && !info->slave)
		pcmcia_request_configuration(link->handle, &link->conf);
	return 0;
}

be OK?

Thanks,
	Dominik



More information about the linux-pcmcia mailing list