Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
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
Commits
cdbbde14
Commit
cdbbde14
authored
May 26, 2005
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge of 'misc-fixes' branch from
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
parents
284e4238
32529e01
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
drivers/scsi/libata-core.c
drivers/scsi/libata-core.c
+7
-6
No files found.
drivers/scsi/libata-core.c
View file @
cdbbde14
...
...
@@ -2071,7 +2071,7 @@ void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, unsigned int buflen)
sg
=
qc
->
sg
;
sg
->
page
=
virt_to_page
(
buf
);
sg
->
offset
=
(
unsigned
long
)
buf
&
~
PAGE_MASK
;
sg
_dma_len
(
sg
)
=
buflen
;
sg
->
length
=
buflen
;
}
void
ata_sg_init
(
struct
ata_queued_cmd
*
qc
,
struct
scatterlist
*
sg
,
...
...
@@ -2101,11 +2101,12 @@ static int ata_sg_setup_one(struct ata_queued_cmd *qc)
dma_addr_t
dma_address
;
dma_address
=
dma_map_single
(
ap
->
host_set
->
dev
,
qc
->
buf_virt
,
sg
_dma_len
(
sg
)
,
dir
);
sg
->
length
,
dir
);
if
(
dma_mapping_error
(
dma_address
))
return
-
1
;
sg_dma_address
(
sg
)
=
dma_address
;
sg_dma_len
(
sg
)
=
sg
->
length
;
DPRINTK
(
"mapped buffer of %d bytes for %s
\n
"
,
sg_dma_len
(
sg
),
qc
->
tf
.
flags
&
ATA_TFLAG_WRITE
?
"write"
:
"read"
);
...
...
@@ -2310,7 +2311,7 @@ static void ata_pio_sector(struct ata_queued_cmd *qc)
qc
->
cursect
++
;
qc
->
cursg_ofs
++
;
if
((
qc
->
cursg_ofs
*
ATA_SECT_SIZE
)
==
sg_dma_len
(
&
sg
[
qc
->
cursg
])
)
{
if
((
qc
->
cursg_ofs
*
ATA_SECT_SIZE
)
==
(
&
sg
[
qc
->
cursg
])
->
length
)
{
qc
->
cursg
++
;
qc
->
cursg_ofs
=
0
;
}
...
...
@@ -2347,7 +2348,7 @@ next_page:
page
=
nth_page
(
page
,
(
offset
>>
PAGE_SHIFT
));
offset
%=
PAGE_SIZE
;
count
=
min
(
sg
_dma_len
(
sg
)
-
qc
->
cursg_ofs
,
bytes
);
count
=
min
(
sg
->
length
-
qc
->
cursg_ofs
,
bytes
);
/* don't cross page boundaries */
count
=
min
(
count
,
(
unsigned
int
)
PAGE_SIZE
-
offset
);
...
...
@@ -2358,7 +2359,7 @@ next_page:
qc
->
curbytes
+=
count
;
qc
->
cursg_ofs
+=
count
;
if
(
qc
->
cursg_ofs
==
sg
_dma_len
(
sg
)
)
{
if
(
qc
->
cursg_ofs
==
sg
->
length
)
{
qc
->
cursg
++
;
qc
->
cursg_ofs
=
0
;
}
...
...
@@ -2371,7 +2372,7 @@ next_page:
kunmap
(
page
);
if
(
bytes
)
{
if
(
qc
->
cursg_ofs
<
sg
_dma_len
(
sg
)
)
if
(
qc
->
cursg_ofs
<
sg
->
length
)
goto
next_page
;
goto
next_sg
;
}
...
...
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