[PATCH] remove geometry support from ps3 storage driver

STALE7042d

8 messages, 4 authors, 2007-05-30 · open the first message on its own page

[PATCH] remove geometry support from ps3 storage driver

From: Olaf Hering <hidden>
Date: 2007-05-21 14:12:51

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

Signed-off-by: Olaf Hering <redacted>


Index: linux-2.6.22-rc2/drivers/block/ps3disk.c
===================================================================
--- linux-2.6.22-rc2.orig/drivers/block/ps3disk.c
+++ 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,

[PATCH] set module owner in ps3 modules

From: Olaf Hering <hidden>
Date: 2007-05-21 14:12:51

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


Signed-off-by: Olaf Hering <redacted>


Index: linux-2.6.22-rc2/drivers/block/ps3disk.c
===================================================================
--- linux-2.6.22-rc2.orig/drivers/block/ps3disk.c
+++ 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,
Index: linux-2.6.22-rc2/drivers/char/ps3flash.c
===================================================================
--- linux-2.6.22-rc2.orig/drivers/char/ps3flash.c
+++ 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,
Index: linux-2.6.22-rc2/drivers/net/gelic_net.c
===================================================================
--- linux-2.6.22-rc2.orig/drivers/net/gelic_net.c
+++ 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,
 	},
 };
 
Index: linux-2.6.22-rc2/drivers/scsi/ps3rom.c
===================================================================
--- linux-2.6.22-rc2.orig/drivers/scsi/ps3rom.c
+++ 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
 };
Index: linux-2.6.22-rc2/drivers/usb/host/ehci-ps3.c
===================================================================
--- linux-2.6.22-rc2.orig/drivers/usb/host/ehci-ps3.c
+++ 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,
Index: linux-2.6.22-rc2/drivers/usb/host/ohci-ps3.c
===================================================================
--- linux-2.6.22-rc2.orig/drivers/usb/host/ohci-ps3.c
+++ 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,
Index: linux-2.6.22-rc2/sound/ppc/snd_ps3.c
===================================================================
--- linux-2.6.22-rc2.orig/sound/ppc/snd_ps3.c
+++ 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,
 	},
 };
 

Re: [PATCH] remove geometry support from ps3 storage driver

From: Geert Uytterhoeven <hidden>
Date: 2007-05-21 14:36:45

	Hi Olaf,

On Mon, 21 May 2007, Olaf Hering wrote:
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)
Geert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1
Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium

Re: [PATCH] remove geometry support from ps3 storage driver

From: Christoph Hellwig <hch@lst.de>
Date: 2007-05-21 14:39:44

On Mon, May 21, 2007 at 02:53:11PM +0200, Olaf Hering wrote:
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.

Re: [PATCH] set module owner in ps3 modules

From: Geoff Levand <hidden>
Date: 2007-05-21 15:52:52

Olaf Hering wrote:
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

Re: [PATCH] remove geometry support from ps3 storage driver

From: Olaf Hering <hidden>
Date: 2007-05-21 17:14:06

On Mon, May 21, Christoph Hellwig wrote:
On Mon, May 21, 2007 at 02:53:11PM +0200, Olaf Hering wrote:
quoted
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.

Re: [PATCH] remove geometry support from ps3 storage driver

From: Geert Uytterhoeven <hidden>
Date: 2007-05-29 09:15:19

On Mon, 21 May 2007, Christoph Hellwig wrote:
On Mon, May 21, 2007 at 02:53:11PM +0200, Olaf Hering wrote:
quoted
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)
Geert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1
Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium

Re: [PATCH] remove geometry support from ps3 storage driver

From: Christoph Hellwig <hch@lst.de>
Date: 2007-05-30 10:12:22

On Tue, May 29, 2007 at 11:15:14AM +0200, Geert Uytterhoeven wrote:
On Mon, 21 May 2007, Christoph Hellwig wrote:
quoted
On Mon, May 21, 2007 at 02:53:11PM +0200, Olaf Hering wrote:
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help