public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sym53c8xx_2: Add bios_param to sym_glue.c
@ 2006-02-17 14:10 Seewer Philippe
  2006-02-17 14:37 ` Matthew Wilcox
  0 siblings, 1 reply; 3+ messages in thread
From: Seewer Philippe @ 2006-02-17 14:10 UTC (permalink / raw)
  To: matthew; +Cc: linux-kernel, linux-scsi


This patch adds the scsi common function bios_param to the sym53c8xx
driver. For simplicity i just copied the code from the sym53c416 driver.

Patch applies to 2.6.16-rc3

Signed-off-by: Seewer Philippe <philippe.seewer@bfh.ch>


--- linux-2.6.16-rc3/drivers/scsi/sym53c8xx_2/sym_glue.c.orig   2006-02-17 14:49:12.000000000 +0100
+++ linux-2.6.16-rc3/drivers/scsi/sym53c8xx_2/sym_glue.c        2006-02-17 14:50:55.000000000 +0100
@@ -1963,6 +1963,28 @@ static int sym_detach(struct sym_hcb *np
 }

 /*
+ * Bios param for sd.
+ * Copied from sym53c416 driver
+ */
+static int sym53c8xx_bios_param(struct scsi_device *sdev,
+               struct block_device *dev,
+               sector_t capacity, int *ip)
+{
+       int size;
+
+       size = capacity;
+       ip[0] = 64;                             /* heads                        */
+       ip[1] = 32;                             /* sectors                      */
+       if((ip[2] = size >> 11) > 1024)         /* cylinders, test for big disk */
+       {
+               ip[0] = 255;                    /* heads                        */
+               ip[1] = 63;                     /* sectors                      */
+               ip[2] = size / (255 * 63);      /* cylinders                    */
+       }
+       return 0;
+}
+
+/*
  * Driver host template.
  */
 static struct scsi_host_template sym2_template = {
@@ -1977,6 +1999,7 @@ static struct scsi_host_template sym2_te
        .eh_device_reset_handler = sym53c8xx_eh_device_reset_handler,
        .eh_bus_reset_handler   = sym53c8xx_eh_bus_reset_handler,
        .eh_host_reset_handler  = sym53c8xx_eh_host_reset_handler,
+       .bios_param             = sym53c8xx_bios_param,
        .this_id                = 7,
        .use_clustering         = DISABLE_CLUSTERING,
 #ifdef SYM_LINUX_PROC_INFO_SUPPORT

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sym53c8xx_2: Add bios_param to sym_glue.c
  2006-02-17 14:10 [PATCH] sym53c8xx_2: Add bios_param to sym_glue.c Seewer Philippe
@ 2006-02-17 14:37 ` Matthew Wilcox
  2006-02-17 14:41   ` Seewer Philippe
  0 siblings, 1 reply; 3+ messages in thread
From: Matthew Wilcox @ 2006-02-17 14:37 UTC (permalink / raw)
  To: Seewer Philippe; +Cc: linux-kernel, linux-scsi

On Fri, Feb 17, 2006 at 03:10:43PM +0100, Seewer Philippe wrote:
> This patch adds the scsi common function bios_param to the sym53c8xx
> driver. For simplicity i just copied the code from the sym53c416 driver.

If the driver doesn't define bios_param, the scsi core calls
scsicam_bios_param, which seems to do everything this patch does,
and more.

A quick survey suggests that most drivers should have their bios_param
methods deleted.  Was there a particular problem you found with the
default scsicam_bios_param implementation?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sym53c8xx_2: Add bios_param to sym_glue.c
  2006-02-17 14:37 ` Matthew Wilcox
@ 2006-02-17 14:41   ` Seewer Philippe
  0 siblings, 0 replies; 3+ messages in thread
From: Seewer Philippe @ 2006-02-17 14:41 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: linux-kernel, linux-scsi



Matthew Wilcox wrote:
> On Fri, Feb 17, 2006 at 03:10:43PM +0100, Seewer Philippe wrote:
> 
>>This patch adds the scsi common function bios_param to the sym53c8xx
>>driver. For simplicity i just copied the code from the sym53c416 driver.
> 
> 
> If the driver doesn't define bios_param, the scsi core calls
> scsicam_bios_param, which seems to do everything this patch does,
> and more.
> 
> A quick survey suggests that most drivers should have their bios_param
> methods deleted.  Was there a particular problem you found with the
> default scsicam_bios_param implementation?
Yes. Using scsicam_bios_parm and other defaults result in a geometry of
64 heads and 32 sectors even for big disks, which is not what the pc bios
"gets" from the controller. That is more along the lines of 255/63.

Returning a geometry of x/255/63 seems to be the default for bigger disks
withing scsi drivers, so i just copied the code...


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-02-17 14:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-17 14:10 [PATCH] sym53c8xx_2: Add bios_param to sym_glue.c Seewer Philippe
2006-02-17 14:37 ` Matthew Wilcox
2006-02-17 14:41   ` Seewer Philippe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox