ufs_device.cc (10912:b99a6662d7c2) | ufs_device.cc (10913:38dbdeea7f1f) |
---|---|
1/* 2 * Copyright (c) 2013-2015 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 719 unchanged lines hidden (view full) --- 728 readPendingNum(0), 729 writePendingNum(0), 730 activeDoorbells(0), 731 pendingDoorbells(0), 732 countInt(0), 733 transferTrack(0), 734 taskCommandTrack(0), 735 idlePhaseStart(0), | 1/* 2 * Copyright (c) 2013-2015 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 719 unchanged lines hidden (view full) --- 728 readPendingNum(0), 729 writePendingNum(0), 730 activeDoorbells(0), 731 pendingDoorbells(0), 732 countInt(0), 733 transferTrack(0), 734 taskCommandTrack(0), 735 idlePhaseStart(0), |
736 drainManager(NULL), | |
737 SCSIResumeEvent(this), 738 UTPEvent(this) 739{ 740 DPRINTF(UFSHostDevice, "The hostcontroller hosts %d Logic units\n", 741 lunAvail); 742 UFSDevice.resize(lunAvail); 743 744 transferDoneCallback = new MakeCallback<UFSHostDevice, --- 1566 unchanged lines hidden (view full) --- 2311 assert(lunAvail == lun_avail); 2312} 2313 2314 2315/** 2316 * Drain; needed to enable checkpoints 2317 */ 2318 | 736 SCSIResumeEvent(this), 737 UTPEvent(this) 738{ 739 DPRINTF(UFSHostDevice, "The hostcontroller hosts %d Logic units\n", 740 lunAvail); 741 UFSDevice.resize(lunAvail); 742 743 transferDoneCallback = new MakeCallback<UFSHostDevice, --- 1566 unchanged lines hidden (view full) --- 2310 assert(lunAvail == lun_avail); 2311} 2312 2313 2314/** 2315 * Drain; needed to enable checkpoints 2316 */ 2317 |
2319unsigned int 2320UFSHostDevice::drain(DrainManager *dm) | 2318DrainState 2319UFSHostDevice::drain() |
2321{ 2322 if (UFSHCIMem.TRUTRLDBR) { | 2320{ 2321 if (UFSHCIMem.TRUTRLDBR) { |
2323 drainManager = dm; | |
2324 DPRINTF(UFSHostDevice, "UFSDevice is draining...\n"); | 2322 DPRINTF(UFSHostDevice, "UFSDevice is draining...\n"); |
2325 setDrainState(DrainState::Draining); 2326 return 1; | 2323 return DrainState::Draining; |
2327 } else { 2328 DPRINTF(UFSHostDevice, "UFSDevice drained\n"); | 2324 } else { 2325 DPRINTF(UFSHostDevice, "UFSDevice drained\n"); |
2329 setDrainState(DrainState::Drained); 2330 return 0; | 2326 return DrainState::Drained; |
2331 } 2332} 2333 2334/** 2335 * Checkdrain; needed to enable checkpoints 2336 */ 2337 2338void 2339UFSHostDevice::checkDrain() 2340{ | 2327 } 2328} 2329 2330/** 2331 * Checkdrain; needed to enable checkpoints 2332 */ 2333 2334void 2335UFSHostDevice::checkDrain() 2336{ |
2341 if (drainManager == NULL) { | 2337 if (drainState() != DrainState::Draining) |
2342 return; | 2338 return; |
2343 } | |
2344 2345 if (UFSHCIMem.TRUTRLDBR) { 2346 DPRINTF(UFSHostDevice, "UFSDevice is still draining; with %d active" 2347 " doorbells\n", activeDoorbells); 2348 } else { 2349 DPRINTF(UFSHostDevice, "UFSDevice is done draining\n"); | 2339 2340 if (UFSHCIMem.TRUTRLDBR) { 2341 DPRINTF(UFSHostDevice, "UFSDevice is still draining; with %d active" 2342 " doorbells\n", activeDoorbells); 2343 } else { 2344 DPRINTF(UFSHostDevice, "UFSDevice is done draining\n"); |
2350 drainManager->signalDrainDone(); 2351 drainManager = NULL; | 2345 signalDrainDone(); |
2352 } 2353} | 2346 } 2347} |