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
0e242816
Commit
0e242816
authored
Sep 08, 2016
by
Mikhail Karpenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move IRQ processing to tasklet, use single flag for disk access
parent
a8fbc767
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
130 additions
and
81 deletions
+130
-81
ahci_elphel.c
src/drivers/ata/ahci_elphel.c
+114
-63
ahci_elphel.h
src/drivers/ata/ahci_elphel.h
+16
-18
No files found.
src/drivers/ata/ahci_elphel.c
View file @
0e242816
This diff is collapsed.
Click to expand it.
src/drivers/ata/ahci_elphel.h
View file @
0e242816
...
...
@@ -24,22 +24,20 @@
#ifndef _AHCI_ELPHEL_EXT
#define _AHCI_ELPHEL_EXT
/** Flag indicating that IRQ should not be processed in ahci_handle_port_interrupt */
/** Flag indicating that IRQ corresponds to internal command and should not be
* processed in ahci_handle_port_interrupt */
#define IRQ_SIMPLE (1 << 0)
/** Flag indicating that driver's internal command is in progress. This flag is set when
* driver performs write on its own and is mutually exclusive with #NATIVE_CMD flag */
#define INTERNAL_CMD (1 << 1)
/** Flag indicating that libahci command is in progress. This flag is set when
* driver performs write from the system calls and is mutually exclusive with #INTERNAL_CMD flag */
#define NATIVE_CMD (1 << 2)
/** Flag indicating that disk is currently busy. Access to this flag should be protected by
* spin locks to prevent race conditions */
#define DISK_BUSY (1 << 1)
/** Processing driver's internal command is in progress */
#define PROC_CMD (1 <<
3
)
/** Flag indicating that the remaining chunk of data will be recorde
r
*/
#define LAST_BLOCK (1 <<
4
)
#define PROC_CMD (1 <<
2
)
/** Flag indicating that the remaining chunk of data will be recorde
d
*/
#define LAST_BLOCK (1 <<
3
)
/** Flag indicating that recording should be stopped right after the last chunk of data
* is written */
#define DELAYED_FINISH (1 <<
5
)
#define LOCK_TAIL (1 <<
6
)
#define DELAYED_FINISH (1 <<
4
)
#define LOCK_TAIL (1 <<
5
)
/** The length of a command FIS in double words */
#define CMD_FIS_LEN 5
/** This is used to get 28-bit address from 64-bit value */
...
...
@@ -125,12 +123,12 @@ struct elphel_ahci_priv {
size_t
curr_data_offset
;
///< offset of the last byte in a data chunk pointed to by @e curr_data_chunk
size_t
head_ptr
;
///< pointer to command slot which will be written next
size_t
tail_ptr
;
///< pointer to next free command slot
spinlock_t
flags_lock
;
///< controls access to
two flags in @e flags variable:
///< #INTERNAL_CMD and #NATIVE_CMD. These flags control access to disk
///< write operations either from the the driver itself or from the system an
d
///< thus are mutually exclusive. Only flags set operation should be
///> protected by this spin lock. Mutex is not used because these flags are accessed
///> from interrupt context
spinlock_t
flags_lock
;
///< controls access to
#DISK_BUSY flag in @e flags variable.
///< This flag controls access to disk write operations either from
///< the the driver itself or from the system. Mutex is not use
d
///< because this flag is accessed from interrupt context
struct
tasklet_struct
bh
;
///< command processing tasklet
struct
device
*
dev
;
///< pointer to parent device structure
};
#endif
/* _AHCI_ELPHEL_EXT */
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