Commit Graph

12 Commits

Author SHA1 Message Date
Bill Jordan ccd5abfbfd Add zesDeviceReset ULTs.
This patch adds two ULTs.

Verify that an IN USE error is returned if the device is open by another
process.

Verify that reset succeeds if device is not in use.

Verify that reset with force succeeds if device is in use.

Verify that reset without force succeeds if device is opened during
reset, and process is killed.

Verify that reset with force fails with device in use
if device is opened during reset, and process will not die

Change-Id: I232572c192bc481d8d63ef39c7494976100325ff
Signed-off-by: Bill Jordan <bill.jordan@intel.com>
2020-10-19 15:01:19 +02:00
Bill Jordan 909107cab6 Fix zesDeviceReset for Spec version 1.
This patch does the following:
- Fixes a bug in FsAccess::listDirectory that could return
ZE_RESULT_UNKNOWN_ERROR when no error has occurred.
- Fixes a bug in zesDeviceReset that would reset the device
if force was set to false, even if the device was in use.
- Fixes a bug in zesDeviceReset that would reset the device
if force was set to false without closing the file descriptor.
- Added a releaseResources method method to Device object.
This method does the same thing as the DeviceImp
destructor except it does not free the DeviceImp object
and it does not free the SysmanDeviceImp object.
- Added the releaseResources methods to Mock<Device> object.
- Moved the reset of the debugger out of DriverHandleImp
destructor and into DeviceImp releaseResources.
- Added a releaseEngine method to the EngineHandleContext. This
method frees all the Engine handles.
- On reset, I call the Devcie->releaseResources and
EngineHandleContext->releaseEngines before resetting the device.
- Added a -r (--reset) option to zello_sysman so I
could easily test resets.

With these patches, the L0 Sysman CTS for zesDeviceReset
both pass.

Change-Id: I31fad1b27bc5cc6befe31cd6f9319748e2683424
2020-10-05 19:55:14 +02:00
Vilvaraj, T J Vivek a6ea7ab7db update Sysman PCI APIs to lastest Spec
Change-Id: Ie4daf2eb3596f05f824579eff3fe811ebb2f2032
2020-08-05 18:01:37 +02:00
T.J. Vivek Vilvaraj 6224db771a PCI driver fix for Discrete devices
Change-Id: I91e444c88b5e72463c7f181ece535da4150a2665
Signed-off-by: Vilvaraj, T J Vivek <t.j.vivek.vilvaraj@intel.com>
2020-07-15 23:33:59 +02:00
Jitendra Sharma c43759cc48 Cleanup and fixes in sysman source
In this Change:
 - Initialize local variables used in pci source.
 - Move setting of temperature handle's type to constructor of
   TemperatureImp class as temperature handle's type is used in
   init() of TemperatureImp class.
 - Allow only ENOENT  errno at the end of FsAccess::listDirectory function.
   Because in this function all directory entries will be read in a
   loop. And loop will exit only after readdir() finished reading
   all entries in directory and thus readdir() will exit, when it fails
   reading any further entry. Thus system will return ENOENT for readdir.

Change-Id: Ibd3ac3f841b114fd87edea1410750b33f3a14e5b
Signed-off-by: Jitendra Sharma <jitendra.sharma@intel.com>
2020-06-25 18:32:33 +02:00
Vilvaraj, T J Vivek 0c9c55cd17 add counter support for RAS.
- added dual handle support for RAS Correctable and Uncorrectable Errors.
- added reset counter for RAS.
- added Os Specific ULT for RAS

Change-Id: Ia10115bf6720ab211f549571e810ec0d6c0801ec
2020-06-25 08:48:11 +02:00
Jitendra Sharma 1618a25d71 Fix error returning to user from zetSysmanProcessesGetState API
If after reading clients directory, while actually trying to
access the individual clients file, we receive a error
ZET_RESULT_ERROR_NOT_AVAILABLE, then it means that this process/client
might be killed/removed. Hence dont return error to user.
Instead simply skip that client's traversal further and move on
to next available client.

Change-Id: If86610a89d7b2421fd85560e5a223391b76d78a0
Signed-off-by: Jitendra Sharma <jitendra.sharma@intel.com>
2020-06-17 07:02:35 +02:00
Jitendra Sharma 596c1a8e70 Implement zetSysmanProcessesGetState API
This change does the following:
 - Implement API zetSysmanProcessesGetState.
 - Implement ULT to validate zetSysmanProcessesGetState's implementation
 - Redesign ULTs for zetSysmanDeviceGetProperties to mock only OS specific
   classes, and validate zetSysmanDeviceGetProperties's implementation end
   to end.
 - Some bug fixes in code that are caught by these new ULTs

Change-Id: I4a83789771d32978576ff62859628df2c0c795ad
Signed-off-by: Jitendra Sharma <jitendra.sharma@intel.com>
2020-05-14 19:33:46 +02:00
Vilvaraj, T J Vivek 5c029b4471 Implement RAS APIs
- Implemented zetSysmanGetProperties
- Implemented zetSysmanGetState

Change-Id: Id40a1cb036693156c31c6e9ee78c3113ef35e5c2
Signed-off-by: Vilvaraj, T J Vivek <t.j.vivek.vilvaraj@intel.com>
2020-04-29 18:03:05 +02:00
Jitendra Sharma 5374a0ffc1 Implement scheduler APIs
Add logic to implement following scheduler APIs
-zetSysmanSchedulerGetCurrentMode
-zetSysmanSchedulerGetTimeoutModeProperties
-zetSysmanSchedulerGetTimesliceModeProperties
-zetSysmanSchedulerSetTimeoutMode
-zetSysmanSchedulerSetTimesliceMode
-zetSysmanSchedulerSetExclusiveMode

Change-Id: I134b200ffd6b13bc50b1f38e955dd584455b4b38
Signed-off-by: Jitendra Sharma <jitendra.sharma@intel.com>
2020-04-22 20:26:57 +05:30
Bill Jordan 5d756b7b15 Add FsAccess::getFileMode and SysfsAccess::getFileMode methods
Change-Id: I4dddf1b3983e63ef6ad664009ebd20d474c8cc17
Signed-off-by: Bill Jordan <bill.jordan@intel.com>
2020-04-01 09:14:40 +02:00
Bill Jordan 7c489ac60d Implement zetSysmanDeviceReset
Implemented function level reset.

Implementation is:
Make sure we are root (otherwise, return insufficient permissions)
Make sure no one has the device open
    (otherwise, return hande object in use)
Close our file handle
Unbind the device from the kernel driver
Make sure no one still has the device open
    (otherwise, kill them)
Perform function level reset (FLR)
Rebind the device to the kernel driver

Change-Id: Ic57b95487e73b5a5f2d03e619d813bf4199adf40
Signed-off-by: Bill Jordan <bill.jordan@intel.com>
2020-03-24 18:26:45 +01:00