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
3c441baa
Commit
3c441baa
authored
Oct 28, 2007
by
David Woodhouse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MTD] Skip bad blocks when checking for RedBoot partition table
Signed-off-by:
David Woodhouse
<
dwmw2@infradead.org
>
parent
9c37f332
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
5 deletions
+20
-5
drivers/mtd/redboot.c
drivers/mtd/redboot.c
+20
-5
No files found.
drivers/mtd/redboot.c
View file @
3c441baa
...
...
@@ -59,16 +59,31 @@ static int parse_redboot_partitions(struct mtd_info *master,
static
char
nullstring
[]
=
"unallocated"
;
#endif
if
(
directory
<
0
)
{
offset
=
master
->
size
+
directory
*
master
->
erasesize
;
while
(
master
->
block_isbad
&&
master
->
block_isbad
(
master
,
offset
))
{
if
(
!
offset
)
{
nogood:
printk
(
KERN_NOTICE
"Failed to find a non-bad block to check for RedBoot partition table
\n
"
);
return
-
EIO
;
}
offset
-=
master
->
erasesize
;
}
}
else
{
offset
=
directory
*
master
->
erasesize
;
while
(
master
->
block_isbad
&&
master
->
block_isbad
(
master
,
offset
))
{
offset
+=
master
->
erasesize
;
if
(
offset
==
master
->
size
)
goto
nogood
;
}
}
buf
=
vmalloc
(
master
->
erasesize
);
if
(
!
buf
)
return
-
ENOMEM
;
if
(
directory
<
0
)
offset
=
master
->
size
+
directory
*
master
->
erasesize
;
else
offset
=
directory
*
master
->
erasesize
;
printk
(
KERN_NOTICE
"Searching for RedBoot partition table in %s at offset 0x%lx
\n
"
,
master
->
name
,
offset
);
...
...
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