Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci-2.6.23
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci-2.6.23
Commits
52aa536f
Commit
52aa536f
authored
Feb 21, 2006
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'upstream-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev
parents
5914811a
2e242fa9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
9 deletions
+24
-9
drivers/scsi/libata-core.c
drivers/scsi/libata-core.c
+9
-6
drivers/scsi/sata_qstor.c
drivers/scsi/sata_qstor.c
+1
-1
include/linux/libata.h
include/linux/libata.h
+14
-2
No files found.
drivers/scsi/libata-core.c
View file @
52aa536f
...
...
@@ -2514,7 +2514,7 @@ static void ata_sg_clean(struct ata_queued_cmd *qc)
assert
(
sg
!=
NULL
);
if
(
qc
->
flags
&
ATA_QCFLAG_SINGLE
)
assert
(
qc
->
n_elem
=
=
1
);
assert
(
qc
->
n_elem
<
=
1
);
VPRINTK
(
"unmapping %u sg elements
\n
"
,
qc
->
n_elem
);
...
...
@@ -2537,7 +2537,7 @@ static void ata_sg_clean(struct ata_queued_cmd *qc)
kunmap_atomic
(
addr
,
KM_IRQ0
);
}
}
else
{
if
(
sg_dma_len
(
&
sg
[
0
])
>
0
)
if
(
qc
->
n_elem
)
dma_unmap_single
(
ap
->
host_set
->
dev
,
sg_dma_address
(
&
sg
[
0
]),
sg_dma_len
(
&
sg
[
0
]),
dir
);
...
...
@@ -2570,7 +2570,7 @@ static void ata_fill_sg(struct ata_queued_cmd *qc)
unsigned
int
idx
;
assert
(
qc
->
__sg
!=
NULL
);
assert
(
qc
->
n_elem
>
0
);
assert
(
qc
->
n_elem
>
0
||
qc
->
pad_len
>
0
);
idx
=
0
;
ata_for_each_sg
(
sg
,
qc
)
{
...
...
@@ -2715,6 +2715,7 @@ static int ata_sg_setup_one(struct ata_queued_cmd *qc)
int
dir
=
qc
->
dma_dir
;
struct
scatterlist
*
sg
=
qc
->
__sg
;
dma_addr_t
dma_address
;
int
trim_sg
=
0
;
/* we must lengthen transfers to end on a 32-bit boundary */
qc
->
pad_len
=
sg
->
length
&
3
;
...
...
@@ -2734,13 +2735,15 @@ static int ata_sg_setup_one(struct ata_queued_cmd *qc)
sg_dma_len
(
psg
)
=
ATA_DMA_PAD_SZ
;
/* trim sg */
sg
->
length
-=
qc
->
pad_len
;
if
(
sg
->
length
==
0
)
trim_sg
=
1
;
DPRINTK
(
"padding done, sg->length=%u pad_len=%u
\n
"
,
sg
->
length
,
qc
->
pad_len
);
}
if
(
!
sg
->
length
)
{
sg_dma_address
(
sg
)
=
0
;
if
(
trim_sg
)
{
qc
->
n_elem
--
;
goto
skip_map
;
}
...
...
@@ -2753,9 +2756,9 @@ static int ata_sg_setup_one(struct ata_queued_cmd *qc)
}
sg_dma_address
(
sg
)
=
dma_address
;
skip_map:
sg_dma_len
(
sg
)
=
sg
->
length
;
skip_map:
DPRINTK
(
"mapped buffer of %d bytes for %s
\n
"
,
sg_dma_len
(
sg
),
qc
->
tf
.
flags
&
ATA_TFLAG_WRITE
?
"write"
:
"read"
);
...
...
drivers/scsi/sata_qstor.c
View file @
52aa536f
...
...
@@ -277,7 +277,7 @@ static unsigned int qs_fill_sg(struct ata_queued_cmd *qc)
u8
*
prd
=
pp
->
pkt
+
QS_CPB_BYTES
;
assert
(
qc
->
__sg
!=
NULL
);
assert
(
qc
->
n_elem
>
0
);
assert
(
qc
->
n_elem
>
0
||
qc
->
pad_len
>
0
);
nelem
=
0
;
ata_for_each_sg
(
sg
,
qc
)
{
...
...
include/linux/libata.h
View file @
52aa536f
...
...
@@ -556,6 +556,16 @@ ata_sg_is_last(struct scatterlist *sg, struct ata_queued_cmd *qc)
return
0
;
}
static
inline
struct
scatterlist
*
ata_qc_first_sg
(
struct
ata_queued_cmd
*
qc
)
{
if
(
qc
->
n_elem
)
return
qc
->
__sg
;
if
(
qc
->
pad_len
)
return
&
qc
->
pad_sgent
;
return
NULL
;
}
static
inline
struct
scatterlist
*
ata_qc_next_sg
(
struct
scatterlist
*
sg
,
struct
ata_queued_cmd
*
qc
)
{
...
...
@@ -563,11 +573,13 @@ ata_qc_next_sg(struct scatterlist *sg, struct ata_queued_cmd *qc)
return
NULL
;
if
(
++
sg
-
qc
->
__sg
<
qc
->
n_elem
)
return
sg
;
return
qc
->
pad_len
?
&
qc
->
pad_sgent
:
NULL
;
if
(
qc
->
pad_len
)
return
&
qc
->
pad_sgent
;
return
NULL
;
}
#define ata_for_each_sg(sg, qc) \
for (sg =
qc->__sg
; sg; sg = ata_qc_next_sg(sg, qc))
for (sg =
ata_qc_first_sg(qc)
; sg; sg = ata_qc_next_sg(sg, qc))
static
inline
unsigned
int
ata_tag_valid
(
unsigned
int
tag
)
{
...
...
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