Skip to contentSkip to conversation

remove geometry support from ps3 storage driver

PATCH In review Olaf Hering 4 participants 8 messages May 21, 2007 – May 30, 2007

Subsystems (10)
Network drivers SCSI USB Sound +6 more subsystems
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remove geometry support from ps3 storage driver

The old ps3_storage driver did not support DOS geometry, so there is no point to start adding code for it.

drivers/block/ps3disk.c +0 -14
Index: linux-2.6.22-rc2/drivers/block/ps3disk.c
===================================================================
@@ -43,10 +43,6 @@
 
 #define KERNEL_SECTOR_SIZE	512
 
-// FIXME SCSI uses H=64, S=32. Can we still repartition disks partitioned using
-//       the old driver?
-#define PS3DISK_HEADS		255
-#define PS3DISK_SECTORS		63
 
 #define PS3DISK_NAME		"ps3d%c"
 
@@ -70,21 +66,11 @@ static int ps3disk_open(struct inode *in
 	return 0;
 }
 
-static int ps3disk_getgeo(struct block_device *bdev, struct hd_geometry *geo)
-{
-	geo->heads = PS3DISK_HEADS;
-	geo->sectors = PS3DISK_SECTORS;
-	geo->cylinders = min(65535UL,
-			     get_capacity(bdev->bd_disk) /
-			     (PS3DISK_HEADS * PS3DISK_SECTORS));
-	return 0;
-}
 
 
 static struct block_device_operations ps3disk_fops = {
 	.owner		= THIS_MODULE,
 	.open		= ps3disk_open,
-	.getgeo		= ps3disk_getgeo,
 };
 
 static void ps3disk_scatter_gather(struct ps3_storage_device *dev,
#1 lore raw

PATCH 1/1 set module owner in ps3 modules

setting ->owner will help with refcounting (?) and it provides proper symlinks in sysfs.

drivers/block/ps3disk.c +1 -0
Index: linux-2.6.22-rc2/drivers/block/ps3disk.c
===================================================================
@@ -425,6 +411,7 @@ static int ps3disk_remove(struct ps3_sys
 static struct ps3_system_bus_driver ps3disk = {
 	.match_id	= PS3_MATCH_ID_STOR_DISK,
 	.core.name	= DEVICE_NAME,
+	.core.owner	= THIS_MODULE,
 	.probe		= ps3disk_probe,
 	.remove		= ps3disk_remove,
 	.shutdown	= ps3disk_remove,
drivers/char/ps3flash.c +1 -0
Index: linux-2.6.22-rc2/drivers/char/ps3flash.c
===================================================================
@@ -467,6 +467,7 @@ static int ps3flash_remove(struct ps3_sy
 static struct ps3_system_bus_driver ps3flash = {
 	.match_id	= PS3_MATCH_ID_STOR_FLASH,
 	.core.name	= DEVICE_NAME,
+	.core.owner	= THIS_MODULE,
 	.probe		= ps3flash_probe,
 	.remove		= ps3flash_remove,
 	.shutdown	= ps3flash_remove,
drivers/net/gelic_net.c +1 -0
Index: linux-2.6.22-rc2/drivers/net/gelic_net.c
===================================================================
@@ -1576,6 +1576,7 @@ static struct ps3_system_bus_driver ps3_
 	.shutdown = ps3_gelic_driver_remove,
 	.core = {
 		.name = "ps3_gelic_driver",
+		.owner = THIS_MODULE,
 	},
 };
 
drivers/scsi/ps3rom.c +1 -0
Index: linux-2.6.22-rc2/drivers/scsi/ps3rom.c
===================================================================
@@ -907,6 +907,7 @@ static int ps3rom_remove(struct ps3_syst
 static struct ps3_system_bus_driver ps3rom = {
 	.match_id	= PS3_MATCH_ID_STOR_ROM,
 	.core.name	= DEVICE_NAME,
+	.core.owner	= THIS_MODULE,
 	.probe		= ps3rom_probe,
 	.remove		= ps3rom_remove
 };
drivers/usb/host/ehci-ps3.c +1 -0
Index: linux-2.6.22-rc2/drivers/usb/host/ehci-ps3.c
===================================================================
@@ -229,6 +229,7 @@ static struct ps3_system_bus_driver ps3_
 	.match_id = PS3_MATCH_ID_EHCI,
 	.core = {
 		.name = "ps3-ehci-driver",
+		.owner = THIS_MODULE,
 	},
 	.probe = ps3_ehci_probe,
 	.remove = ps3_ehci_remove,
drivers/usb/host/ohci-ps3.c +1 -0
Index: linux-2.6.22-rc2/drivers/usb/host/ohci-ps3.c
===================================================================
@@ -233,6 +233,7 @@ static struct ps3_system_bus_driver ps3_
 	.match_id = PS3_MATCH_ID_OHCI,
 	.core = {
 		.name = "ps3-ohci-driver",
+		.owner = THIS_MODULE,
 	},
 	.probe = ps3_ohci_probe,
 	.remove = ps3_ohci_remove,
sound/ppc/snd_ps3.c +1 -0
Index: linux-2.6.22-rc2/sound/ppc/snd_ps3.c
===================================================================
@@ -1020,6 +1020,7 @@ static struct ps3_system_bus_driver snd_
 	.shutdown = snd_ps3_driver_remove,
 	.core = {
 		.name = SND_PS3_DRIVER_NAME,
+		.owner = THIS_MODULE,
 	},
 };
 
#2 lore raw

Re: [PATCH] set module owner in ps3 modules

Quoted 2 lines · Olaf Hering

setting ->owner will help with refcounting (?) and it provides proper symlinks in sysfs.

Thanks. I'm in the middle of re-doing the system bus and drivers to work as loadable modules, and this will help.

-Geoff

#3 lore raw
In reply to Olaf Hering

Hi Olaf,

Quoted 2 lines · Olaf Hering

The old ps3_storage driver did not support DOS geometry, so there is no point to start adding code for it.

Thanks! I didn't know the .getgeo() routine is optional. I thought it was used by disk partitioning software.

cfdisk seems to be happy after this change.
sfdisk complains it cannot get the geometry, but it continuous, assuming H=64 and S=32.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE) [email protected] ------- The Corporate Village, Da Vincilaan 7-D1 Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium

#4 lore raw
In reply to Olaf Hering
Quoted 3 lines · Olaf Hering

The old ps3_storage driver did not support DOS geometry, so there is no point to start adding code for it.

That's not quite true. sd applies some heuristics and has a default geometry if there is no ->bios_param method. Then again this whole gemetry thing really only makes sense on x86.

#5 lore raw
Quoted 8 lines · Christoph Hellwig
Quoted 3 lines · Olaf Hering

The old ps3_storage driver did not support DOS geometry, so there is no point to start adding code for it.

That's not quite true. sd applies some heuristics and has a default geometry if there is no ->bios_param method. Then again this whole gemetry thing really only makes sense on x86.

Ok, if it really matters, the values should match sd.

#6 lore raw
In reply to Christoph Hellwig
Quoted 7 lines · Christoph Hellwig
Quoted 2 lines · Olaf Hering

The old ps3_storage driver did not support DOS geometry, so there is no point to start adding code for it.

That's not quite true. sd applies some heuristics and has a default geometry if there is no ->bios_param method. Then again this whole gemetry thing really only makes sense on x86.

Would it make sense to have a default implementation in block/ioctl.c?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE) [email protected] ------- The Corporate Village, Da Vincilaan 7-D1 Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium

#7 lore raw
Quoted 10 lines · Geert Uytterhoeven
Quoted 7 lines · Christoph Hellwig
Quoted 2 lines · Olaf Hering

The old ps3_storage driver did not support DOS geometry, so there is no point to start adding code for it.

That's not quite true. sd applies some heuristics and has a default geometry if there is no ->bios_param method. Then again this whole gemetry thing really only makes sense on x86.

Would it make sense to have a default implementation in block/ioctl.c?

Maybe. Someone would have to look all over block drivers if there is something common enough to be considered default. Also some drivers that never ran on x86 never supported it so they'd need a new method that always returns an error. I'm not sure whether it'll be worth it in the end.