Messages in this thread | | | Date | Sun, 3 Nov 2002 23:56:56 +0100 | From | Pavel Machek <> | Subject | Re: swsusp: don't eat ide disks |
| |
Hi!
> > How do I quiesce a queue? Is it ll_rw_blk stuff? > > Just send a request down the request list, and make sure that > > - the command is marked as being non-mergeable or re-orderable by > software (as all special commands are) > > - the command is not re-orderable / mergeable by hardware (and since the > command in question would be something like "flush" or "spindown", > hardware really would be quite broken if it re-ordered it ;) > > and then just wait for its completion.
Okay, so it can be done.
Is that really the right way to prepare disks for suspend?
I sleep all devices by telling driverfs to sleep them. Should I tell all block devices, then tell driverfs? Seems hacky to me. Or should idedisk_suspend generate request for itself, then pass it through queues?
> The code is not that complicated, it looks roughly something like > > struct request *rq; > > rq = blk_get_request(q, WRITE, __GFP_WAIT); > rq->flags = REQ_BLOCK_PC; > rq->data = NULL; > rq->data_len = 0; > rq->timeout = 5*HZ; /* Or whatever */ > memset(rq->cmd, 0, sizeof(rq->cmd)); > rq->cmd[0] = SYNCHRONIZE_CACHE; > .. fill in whatever bytes the SYNCHRONIZE_CACHE cmd needs .. > rq->cmd_len = 10; > err = blk_do_rq(q, bdev, rq); > blk_put_request(rq);
Thanx. Pavel -- Casualities in World Trade Center: ~3k dead inside the building, cryptography in U.S.A. and free speech in Czech Republic. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |