LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 04-05-2017, 03:00 AM   #1
Mechi
LQ Newbie
 
Registered: Aug 2014
Posts: 8

Rep: Reputation: Disabled
SDHC card not always "partitioned" BusyBox Kernel 2.6.37 IPNC


Hi,
I'm using IPNC_RDK 3.8.0 with kernel 2.6.37 on a proprietary IP camera board.
Until recently, when the kernel comes up, I get:
mmc1: new high speed SDHC card at address aaaa
mmcblk0: mmc1:aaaa SC32G 29.7 GiB
mmcblk0: p1
With the same SDHC card, I started getting the message:
mmc1: new high speed SDHC card at address aaaa
mmcblk0: mmc1:aaaa SC32G 29.7 GiB
mmcblk0: unknown partition table
We only work with MSDOS partitions and I found the place in the kernel where the partition place is checked.
kernel/fs/partitions/msdos.c (or /block/partitions/msdos.c in later versions)

After printing out where it fails, I've narrowed the error to:
#define MSDOS_LABEL_MAGIC1 0x55
#define MSDOS_LABEL_MAGIC2 0xAA

static inline int
msdos_magic_present(unsigned char *p)
{
return (p[0] == MSDOS_LABEL_MAGIC1 && p[1] == MSDOS_LABEL_MAGIC2);
}
What I can't figure out is why the same microSD card (32G) sometimes is OK and sometimes isn't - even without formatting, etc.
Is there anything that I can do to ensure that the partition table will always be OK?
The same SD card, when opened in Windows shows *.avi files that were recorded by the IP camera and they can be played back.


Any help on this would be greatly appreciated.
Thanks,
Mechi
 
Old 04-05-2017, 03:47 AM   #2
Mechi
LQ Newbie
 
Registered: Aug 2014
Posts: 8

Original Poster
Rep: Reputation: Disabled
I'm going to comment out the check of 0x55 0xAA - the "magic number".
I hope this is OK...
 
Old 04-06-2017, 03:01 AM   #3
Mechi
LQ Newbie
 
Registered: Aug 2014
Posts: 8

Original Poster
Rep: Reputation: Disabled
Solved - bug in dma.h caused SD to misfunction

I inadvertently made a change in the dma.h file and seems to have caused the problem.

Lesson learned -
  1. SD card uses DMA for reading
  2. When looking for an error - first look at what changes YOU made
  3. Don't make changes unless you're 100% sure they're necessary. I thought it was a buggy definition, so I changed something and introduced a REAL bug.

Closing this thread...
 
  


Reply

Tags
busybox, kernel 2.6.37.6, partition table, sdhc



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Stuck reboot @ "BusyBox v1.21.1" then "initramfs" prompt, plz help?! Wolfshadow Linux - Newbie 2 05-20-2015 10:08 PM
[SOLVED] error "mixed implicit and normal rules" while trying to build busybox Keith Hedger Linux - Software 7 01-02-2015 11:24 PM
2.4.36.3: busybox's Init hangs at "Freeing unused kernel memory: " tilman1 Linux - Kernel 6 06-16-2008 02:01 AM
Box wont boot after kernel upgrade "Dump Card State Ends" error with scsi card abefroman Mandriva 0 03-25-2004 03:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 05:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration