Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
3dc036d2
Commit
3dc036d2
authored
Aug 30, 2004
by
Russell King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MMC] MMCI: use bio_kmap_irq() rather than req->buffer
This is in preparation for SG data IO.
parent
0b364777
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
22 deletions
+41
-22
drivers/mmc/mmci.c
drivers/mmc/mmci.c
+41
-22
No files found.
drivers/mmc/mmci.c
View file @
3dc036d2
...
...
@@ -196,7 +196,7 @@ static int mmci_pio_read(struct mmci_host *host, struct request *req, u32 status
int
ret
=
0
;
do
{
unsigned
int
count
;
unsigned
long
flags
;
char
*
buffer
;
/*
...
...
@@ -205,18 +205,27 @@ static int mmci_pio_read(struct mmci_host *host, struct request *req, u32 status
if
(
!
(
status
&
MCI_RXDATAAVLBL
))
break
;
buffer
=
req
->
buffer
;
count
=
host
->
size
-
(
readl
(
base
+
MMCIFIFOCNT
)
<<
2
);
/*
* Map the BIO buffer.
*/
buffer
=
bio_kmap_irq
(
req
->
bio
,
&
flags
);
if
(
count
>
0
)
{
ret
=
1
;
readsl
(
base
+
MMCIFIFO
,
buffer
+
host
->
offset
,
count
>>
2
);
host
->
offset
+=
count
;
host
->
size
-=
count
;
}
do
{
int
count
=
host
->
size
-
(
readl
(
base
+
MMCIFIFOCNT
)
<<
2
);
if
(
count
>
0
)
{
ret
=
1
;
readsl
(
base
+
MMCIFIFO
,
buffer
+
host
->
offset
,
count
>>
2
);
host
->
offset
+=
count
;
host
->
size
-=
count
;
}
status
=
readl
(
base
+
MMCISTATUS
);
}
while
(
status
&
MCI_RXDATAAVLBL
);
status
=
readl
(
base
+
MMCISTATUS
);
}
while
(
status
&
MCI_RXDATAAVLBL
&&
host
->
size
);
bio_kunmap_irq
(
buffer
,
&
flags
);
break
;
}
while
(
1
);
return
ret
;
}
...
...
@@ -227,7 +236,7 @@ static int mmci_pio_write(struct mmci_host *host, struct request *req, u32 statu
int
ret
=
0
;
do
{
unsigned
int
count
,
maxcnt
;
unsigned
long
flags
;
char
*
buffer
;
/*
...
...
@@ -238,20 +247,30 @@ static int mmci_pio_write(struct mmci_host *host, struct request *req, u32 statu
if
(
!
(
status
&
MCI_TXFIFOHALFEMPTY
))
break
;
buffer
=
req
->
buffer
;
maxcnt
=
status
&
MCI_TXFIFOEMPTY
?
MCI_FIFOSIZE
:
MCI_FIFOHALFSIZE
;
count
=
min
(
host
->
size
,
maxcnt
);
/*
* Map the BIO buffer.
*/
buffer
=
bio_kmap_irq
(
req
->
bio
,
&
flags
);
writesl
(
base
+
MMCIFIFO
,
buffer
+
host
->
offset
,
count
>>
2
);
do
{
unsigned
int
count
,
maxcnt
;
host
->
offset
+=
count
;
host
->
size
-=
count
;
maxcnt
=
status
&
MCI_TXFIFOEMPTY
?
MCI_FIFOSIZE
:
MCI_FIFOHALFSIZE
;
count
=
min
(
host
->
size
,
maxcnt
);
ret
=
1
;
writesl
(
base
+
MMCIFIFO
,
buffer
+
host
->
offset
,
count
>>
2
);
host
->
offset
+=
count
;
host
->
size
-=
count
;
status
=
readl
(
base
+
MMCISTATUS
);
}
while
(
status
&
MCI_TXFIFOHALFEMPTY
);
ret
=
1
;
status
=
readl
(
base
+
MMCISTATUS
);
}
while
(
status
&
MCI_TXFIFOHALFEMPTY
&&
host
->
size
);
bio_kunmap_irq
(
buffer
,
&
flags
);
break
;
}
while
(
1
);
return
ret
;
}
...
...
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