ATA mkIII suspend problem

Søren Schmidt sos at DeepCore.dk
Tue May 3 08:56:18 PDT 2005


Andrew Heybey wrote:
> I just tried RELENG_5 as of last week and the latest (April 13) ATA
> mkIII patches from http://people.freebsd.org/~sos/ATA/ on my laptop. 
> Unfortunately, it breaks suspend-to-RAM (S3).
> 
> History:
> 
> I first tried RELENG_5 on the laptop (a Toshiba Tecra M2V) in January
> and suspend did not work (the laptop hung after reinitializing the ATA
> controller). Then I tried the first release of ATA mkIII. That first
> version of the new ATA code made suspend work, and I was happy.
> 
> Last week, I tried upgrading to the latest RELENG_5 and the newest ATA
> mkIII code, and now after suspending the kernel panics when reiniting
> the ATA device(s) in ata-all.c:ata_reinit(), about line 217:
> 
>     /* reinit the children and delete any that fails */
>     if (!device_get_children(dev, &children, &nchildren)) {
> 	mtx_lock(&Giant);       /* newbus suckage it needs Giant */
> 	for (i = 0; i < nchildren; i++) {
> 	    if (children[i] && device_is_attached(children[i]))
> 		if (ATA_REINIT(children[i])) {
> 		    if (ch->running->dev == children[i]) {
> 			^^^^^^^^^^^^^^^^
> 			device_printf(ch->running->dev,
> 				      "FAILURE - device detached\n");
> 			ch->running->dev = NULL;
> 			ch->running = NULL;
> 		    }
> 		    device_delete_child(dev, children[i]);
> 		}
> 	}
> 	free(children, M_TEMP);
> 	mtx_unlock(&Giant);     /* newbus suckage dealt with, release Giant */
>     }
> 
> The problem is that ch->running is NULL at this point.
> 
> Any suggestions on how to further debug or fix?

Thats been fixed since in -current just replace the line with:

if (ch->running && ch->running->dev == children[i]) {

-- 

-Søren




More information about the freebsd-stable mailing list