Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
linux-elphel
Commits
048506cc
Commit
048506cc
authored
Nov 28, 2016
by
Mikhail Karpenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Detect and report IO error from AHCI driver
parent
26f42591
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
189 additions
and
2 deletions
+189
-2
ahci_elphel.c
src/drivers/ata/ahci_elphel.c
+178
-2
ahci_elphel.h
src/drivers/ata/ahci_elphel.h
+7
-0
ahci_cmd.h
src/include/uapi/elphel/ahci_cmd.h
+4
-0
No files found.
src/drivers/ata/ahci_elphel.c
View file @
048506cc
This diff is collapsed.
Click to expand it.
src/drivers/ata/ahci_elphel.h
View file @
048506cc
...
...
@@ -19,6 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <linux/timer.h>
#include <uapi/elphel/ahci_cmd.h>
#include <uapi/elphel/c313a.h>
#include "../elphel/circbuf.h"
...
...
@@ -36,6 +37,7 @@
#define LAST_BLOCK (1 << 3) ///< Flag indicating that the remaining chunk of data will be recorded
#define DELAYED_FINISH (1 << 4) ///< Flag indicating that recording should be stopped right after the last chunk of data is written
#define LOCK_TAIL (1 << 5) ///< Lock current command slot until all data buffers are assigned and the frame is aligned
#define START_EH (1 << 6) ///< start error handling procedure
#define CMD_FIS_LEN 5 ///< The length of a command FIS in double words
#define ADDR_MASK_28_BIT ((u64)0xfffffff)///< This is used to get 28-bit address from 64-bit value
#define MAX_PRDT_LEN 0x3fffff ///< A maximum of length of 4MB may exist for PRDT entry
...
...
@@ -58,6 +60,7 @@
#define INCLUDE_REM 1 ///< Include REM buffer to total size calculation
#define EXCLUDE_REM 0 ///< Exclude REM buffer from total size calculation
#define SPEED_SAMPLES_NUM 5 ///< Maximum number of samples for disk recording speed measurement
#define DEFAULT_CMD_TIMEOUT 500 ///< Default timeout for commands, in ms
/** This structure is for collecting some recording statistics */
struct
rec_stat
{
...
...
@@ -123,6 +126,10 @@ struct elphel_ahci_priv {
struct
tasklet_struct
bh
;
///< command processing tasklet
struct
device
*
dev
;
///< pointer to parent device structure
struct
rec_stat
stat
;
///< recording statistics
struct
timer_list
cmd_timer
;
///< command execution guard timer
unsigned
int
cmd_timeout
;
///< command timeout, in ms
unsigned
int
io_error_flag
;
///< flag indicating IO error was detected, this is flag is exported via sysfs
};
#endif
/* _AHCI_ELPHEL_EXT */
src/include/uapi/elphel/ahci_cmd.h
View file @
048506cc
...
...
@@ -40,6 +40,8 @@
#define SYSFS_AHCI_FNAME_CURR lba_current
/** sysfs entry name, no double quotes. This macro is used to populate <em>struct attribute</em> in #ahci_elphel.c */
#define SYSFS_AHCI_FNAME_WRSPEED wr_speed
/** sysfs entry name, no double quotes. This macro is used to populate <em>struct attribute</em> in #ahci_elphel.c */
#define SYSFS_AHCI_FNAME_TIMEOUT cmd_timeout
/** This file is used to send commands to AHCI driver from user space applications (camogm as for now). */
#define SYSFS_AHCI_WRITE SYSFS_AHCI_ENTRY NAME_TO_STR(SYSFS_AHCI_FNAME_WRITE)
/** This file is used to control starting LBA of a disk buffer (R/W). */
...
...
@@ -51,6 +53,8 @@
#define SYSFS_AHCI_LBA_CURRENT SYSFS_AHCI_ENTRY NAME_TO_STR(SYSFS_AHCI_FNAME_CURR)
/** This file shows avarage write speed */
#define SYSFS_AHCI_WR_SPEED SYSFS_AHCI_ENTRY_NAME_TO_STR(SYSFS_AHCI_FNAME_WRSPEED)
/** Command execution timeout */
#define SYSFS_AHCI_CMD_TIMEOUT SYSFS_AHCI_ENTRY_NAME_TO_STR(SUSFS_AHCI_FNAME_TIMEOUT)
struct
frame_data
{
unsigned
int
sensor_port
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment