How to support partitions in driver?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear all,

I have few basic queries regarding my partition implementation in my Sd
driver. 
Sorry for asking such petty things here. But, somehow it's not working &
I am made to ask it here.

I am working on 2.6.10 kernel(x86 architecture).
I have a working SD driver for my multimedia controller.
I have four interfaces for my board.
I call then tfa0, tfa1, tfa2, tfa3 respectively.

I defined then as below...

mknod /dev/tfa0 b 252 0	//device node for first partition of socket 0
mknod /dev/tfa0p1 b 252 1
mknod /dev/tfa0p2 b 252 2
.....
mknod /dev/tfa1 b 252 4	 //device node for first partition of socket 1
....
mknod /dev/tfa2 b 252 8	 //device node for first partition of socket 2
.....
mknod /dev/tfa3 b 252 12 //device node for first partition of socket 3
.....

I implemented the gendisk partition support with the following calls in
the driver.

#define MAX_PARTS 4 // maximum no partitions per device
alloc_disk (4);
gend.first_minor = (SockNo*MAX_PARTS); // SockNo: Current socket card is
// inserted 

Socket 0 & 3 support SD interfaces.
I am able to mount the SD with when inserted in socket 0.
At the same time, I am NOT able to mount the SD when inserted in socket
3. It fails as follows.

mount /dev/tfa3 /mnt 
/dev/tfa3: No such device or address
sfdisk: cannot open /dev/tfa3 for reading.

/proc/Partitions looks ok.
Cat/proc/partitions
252 0 14336 tfa3	// first inserted
252 0 14336 tfa0	 
252 0 14336 tfa2	

The updates to the /proc/partitions are done on and when the card is
inserted into that particular socket.

Can you please update me if I am missing anything that has to be
implemented in the driver apart from the above code?

Why am I not able to mount card in socket 3?

Regards,
Mukund Jampala

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux