* [PATCH 2/3] pata_serverworks: cleanup cable detection
@ 2011-10-11 18:11 Bartlomiej Zolnierkiewicz
2011-10-11 19:51 ` Alan Cox
0 siblings, 1 reply; 6+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2011-10-11 18:11 UTC (permalink / raw)
To: Jeff Garzik; +Cc: linux-ide, linux-kernel
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] pata_serverworks: cleanup cable detection
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
earlier references:
https://lkml.org/lkml/2010/1/18/324
drivers/ata/pata_serverworks.c | 37 +++++++------------------------------
1 file changed, 7 insertions(+), 30 deletions(-)
Index: b/drivers/ata/pata_serverworks.c
===================================================================
--- a/drivers/ata/pata_serverworks.c
+++ b/drivers/ata/pata_serverworks.c
@@ -57,32 +57,14 @@ static const char *csb_bad_ata100[] = {
};
/**
- * dell_cable - Dell serverworks cable detection
+ * oem_cable - Dell/Sun serverworks cable detection
* @ap: ATA port to do cable detect
*
- * Dell hide the 40/80 pin select for their interfaces in the top two
- * bits of the subsystem ID.
+ * Dell PowerEdge and Sun Cobalt 'Alpine' hide the 40/80 pin select
+ * for their interfaces in the top two bits of the subsystem ID.
*/
-static int dell_cable(struct ata_port *ap)
-{
- struct pci_dev *pdev = to_pci_dev(ap->host->dev);
-
- if (pdev->subsystem_device & (1 << (ap->port_no + 14)))
- return ATA_CBL_PATA80;
- return ATA_CBL_PATA40;
-}
-
-/**
- * sun_cable - Sun Cobalt 'Alpine' cable detection
- * @ap: ATA port to do cable select
- *
- * Cobalt CSB5 IDE hides the 40/80pin in the top two bits of the
- * subsystem ID the same as dell. We could use one function but we may
- * need to extend the Dell one in future
- */
-
-static int sun_cable(struct ata_port *ap)
+static int oem_cable(struct ata_port *ap)
{
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
@@ -97,15 +79,10 @@ struct sv_cable_table {
int (*cable_detect)(struct ata_port *ap);
};
-/*
- * Note that we don't copy the old serverworks code because the old
- * code contains obvious mistakes
- */
-
static struct sv_cable_table cable_detect[] = {
- { PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_VENDOR_ID_DELL, dell_cable },
- { PCI_DEVICE_ID_SERVERWORKS_CSB6IDE, PCI_VENDOR_ID_DELL, dell_cable },
- { PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_VENDOR_ID_SUN, sun_cable },
+ { PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_VENDOR_ID_DELL, oem_cable },
+ { PCI_DEVICE_ID_SERVERWORKS_CSB6IDE, PCI_VENDOR_ID_DELL, oem_cable },
+ { PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_VENDOR_ID_SUN, oem_cable },
{ PCI_DEVICE_ID_SERVERWORKS_OSB4IDE, PCI_ANY_ID, ata_cable_40wire },
{ PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_ANY_ID, ata_cable_unknown },
{ PCI_DEVICE_ID_SERVERWORKS_CSB6IDE, PCI_ANY_ID, ata_cable_unknown },
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/3] pata_serverworks: cleanup cable detection
2011-10-11 18:11 [PATCH 2/3] pata_serverworks: cleanup cable detection Bartlomiej Zolnierkiewicz
@ 2011-10-11 19:51 ` Alan Cox
2011-10-12 15:05 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 6+ messages in thread
From: Alan Cox @ 2011-10-11 19:51 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz; +Cc: Jeff Garzik, linux-ide, linux-kernel
On Tue, 11 Oct 2011 20:11:44 +0200
Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote:
> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH] pata_serverworks: cleanup cable detection
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Again no documentation although its at least a bit more obvious why
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/3] pata_serverworks: cleanup cable detection
2011-10-11 19:51 ` Alan Cox
@ 2011-10-12 15:05 ` Bartlomiej Zolnierkiewicz
2011-10-12 17:55 ` Alan Cox
0 siblings, 1 reply; 6+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2011-10-12 15:05 UTC (permalink / raw)
To: Alan Cox; +Cc: Jeff Garzik, linux-ide, linux-kernel
Alan Cox wrote:
> On Tue, 11 Oct 2011 20:11:44 +0200
> Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote:
>
> > From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> > Subject: [PATCH] pata_serverworks: cleanup cable detection
> >
> > Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
>
> Again no documentation although its at least a bit more obvious why
The patch only merges identical cable routines for Dell and Sun
systems into common oem_cable() one. No behavior changes here.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/3] pata_serverworks: cleanup cable detection
2011-10-12 15:05 ` Bartlomiej Zolnierkiewicz
@ 2011-10-12 17:55 ` Alan Cox
2011-10-13 10:32 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 6+ messages in thread
From: Alan Cox @ 2011-10-12 17:55 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz; +Cc: Jeff Garzik, linux-ide, linux-kernel
On Wed, 12 Oct 2011 17:05:38 +0200
Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote:
> Alan Cox wrote:
>
> > On Tue, 11 Oct 2011 20:11:44 +0200
> > Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote:
> >
> > > From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> > > Subject: [PATCH] pata_serverworks: cleanup cable detection
> > >
> > > Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> >
> > Again no documentation although its at least a bit more obvious why
>
> The patch only merges identical cable routines for Dell and Sun
> systems into common oem_cable() one. No behavior changes here.
So put that that in the patch info. It seems fine to me but it ought to
be there
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/3] pata_serverworks: cleanup cable detection
2011-10-12 17:55 ` Alan Cox
@ 2011-10-13 10:32 ` Bartlomiej Zolnierkiewicz
2011-10-13 12:50 ` Alan Cox
0 siblings, 1 reply; 6+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2011-10-13 10:32 UTC (permalink / raw)
To: Alan Cox; +Cc: Jeff Garzik, linux-ide, linux-kernel
Alan Cox wrote:
> On Wed, 12 Oct 2011 17:05:38 +0200
> Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote:
>
> > Alan Cox wrote:
> >
> > > On Tue, 11 Oct 2011 20:11:44 +0200
> > > Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote:
> > >
> > > > From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> > > > Subject: [PATCH] pata_serverworks: cleanup cable detection
> > > >
> > > > Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> > >
> > > Again no documentation although its at least a bit more obvious why
> >
> > The patch only merges identical cable routines for Dell and Sun
> > systems into common oem_cable() one. No behavior changes here.
>
> So put that that in the patch info. It seems fine to me but it ought to
> be there
Ok.
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH v2] pata_serverworks: cleanup cable detection
Merge identical cable routines for Dell and Sun systems into
common oem_cable() one.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
v2: updated patch description
earlier references:
https://lkml.org/lkml/2010/1/18/324
drivers/ata/pata_serverworks.c | 37 +++++++------------------------------
1 file changed, 7 insertions(+), 30 deletions(-)
Index: b/drivers/ata/pata_serverworks.c
===================================================================
--- a/drivers/ata/pata_serverworks.c
+++ b/drivers/ata/pata_serverworks.c
@@ -57,32 +57,14 @@ static const char *csb_bad_ata100[] = {
};
/**
- * dell_cable - Dell serverworks cable detection
+ * oem_cable - Dell/Sun serverworks cable detection
* @ap: ATA port to do cable detect
*
- * Dell hide the 40/80 pin select for their interfaces in the top two
- * bits of the subsystem ID.
+ * Dell PowerEdge and Sun Cobalt 'Alpine' hide the 40/80 pin select
+ * for their interfaces in the top two bits of the subsystem ID.
*/
-static int dell_cable(struct ata_port *ap)
-{
- struct pci_dev *pdev = to_pci_dev(ap->host->dev);
-
- if (pdev->subsystem_device & (1 << (ap->port_no + 14)))
- return ATA_CBL_PATA80;
- return ATA_CBL_PATA40;
-}
-
-/**
- * sun_cable - Sun Cobalt 'Alpine' cable detection
- * @ap: ATA port to do cable select
- *
- * Cobalt CSB5 IDE hides the 40/80pin in the top two bits of the
- * subsystem ID the same as dell. We could use one function but we may
- * need to extend the Dell one in future
- */
-
-static int sun_cable(struct ata_port *ap)
+static int oem_cable(struct ata_port *ap)
{
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
@@ -97,15 +79,10 @@ struct sv_cable_table {
int (*cable_detect)(struct ata_port *ap);
};
-/*
- * Note that we don't copy the old serverworks code because the old
- * code contains obvious mistakes
- */
-
static struct sv_cable_table cable_detect[] = {
- { PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_VENDOR_ID_DELL, dell_cable },
- { PCI_DEVICE_ID_SERVERWORKS_CSB6IDE, PCI_VENDOR_ID_DELL, dell_cable },
- { PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_VENDOR_ID_SUN, sun_cable },
+ { PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_VENDOR_ID_DELL, oem_cable },
+ { PCI_DEVICE_ID_SERVERWORKS_CSB6IDE, PCI_VENDOR_ID_DELL, oem_cable },
+ { PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_VENDOR_ID_SUN, oem_cable },
{ PCI_DEVICE_ID_SERVERWORKS_OSB4IDE, PCI_ANY_ID, ata_cable_40wire },
{ PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_ANY_ID, ata_cable_unknown },
{ PCI_DEVICE_ID_SERVERWORKS_CSB6IDE, PCI_ANY_ID, ata_cable_unknown },
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/3] pata_serverworks: cleanup cable detection
2011-10-13 10:32 ` Bartlomiej Zolnierkiewicz
@ 2011-10-13 12:50 ` Alan Cox
0 siblings, 0 replies; 6+ messages in thread
From: Alan Cox @ 2011-10-13 12:50 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz; +Cc: Jeff Garzik, linux-ide, linux-kernel
> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH v2] pata_serverworks: cleanup cable detection
>
> Merge identical cable routines for Dell and Sun systems into
> common oem_cable() one.
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> ---
> v2: updated patch description
>
> earlier references:
> https://lkml.org/lkml/2010/1/18/324
Acked-by: Alan Cox <alan@linux.intel.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-10-13 12:51 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-11 18:11 [PATCH 2/3] pata_serverworks: cleanup cable detection Bartlomiej Zolnierkiewicz
2011-10-11 19:51 ` Alan Cox
2011-10-12 15:05 ` Bartlomiej Zolnierkiewicz
2011-10-12 17:55 ` Alan Cox
2011-10-13 10:32 ` Bartlomiej Zolnierkiewicz
2011-10-13 12:50 ` Alan Cox
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.