* [PATCH resend] mpt2sas: use pci_dev->revision
@ 2011-05-13 15:07 Sergei Shtylyov
2011-07-21 15:42 ` [PATCH v2 " Sergei Shtylyov
0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2011-05-13 15:07 UTC (permalink / raw)
To: linux-scsi, James.Bottomley
The driver reads PCI revision ID from the PCI configuration register while it's
already stored by PCI subsystem in the 'revision' field of 'struct pci_dev'...
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
---
The patch is against the recent Linus' tree.
It wasn't merged in 2.6.39 time, I hope it can be merged to 2.6.40...
drivers/scsi/mpt2sas/mpt2sas_base.c | 4 +---
drivers/scsi/mpt2sas/mpt2sas_ctl.c | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
Index: linux-2.6/drivers/scsi/mpt2sas/mpt2sas_base.c
===================================================================
--- linux-2.6.orig/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ linux-2.6/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -1806,10 +1806,8 @@ _base_display_ioc_capabilities(struct MP
{
int i = 0;
char desc[16];
- u8 revision;
u32 iounit_pg1_flags;
- pci_read_config_byte(ioc->pdev, PCI_CLASS_REVISION, &revision);
strncpy(desc, ioc->manu_pg0.ChipName, 16);
printk(MPT2SAS_INFO_FMT "%s: FWVersion(%02d.%02d.%02d.%02d), "
"ChipRevision(0x%02x), BiosVersion(%02d.%02d.%02d.%02d)\n",
@@ -1818,7 +1816,7 @@ _base_display_ioc_capabilities(struct MP
(ioc->facts.FWVersion.Word & 0x00FF0000) >> 16,
(ioc->facts.FWVersion.Word & 0x0000FF00) >> 8,
ioc->facts.FWVersion.Word & 0x000000FF,
- revision,
+ ioc->pdev->revision,
(ioc->bios_pg3.BiosVersion & 0xFF000000) >> 24,
(ioc->bios_pg3.BiosVersion & 0x00FF0000) >> 16,
(ioc->bios_pg3.BiosVersion & 0x0000FF00) >> 8,
Index: linux-2.6/drivers/scsi/mpt2sas/mpt2sas_ctl.c
===================================================================
--- linux-2.6.orig/drivers/scsi/mpt2sas/mpt2sas_ctl.c
+++ linux-2.6/drivers/scsi/mpt2sas/mpt2sas_ctl.c
@@ -1027,7 +1027,6 @@ _ctl_getiocinfo(void __user *arg)
{
struct mpt2_ioctl_iocinfo karg;
struct MPT2SAS_ADAPTER *ioc;
- u8 revision;
if (copy_from_user(&karg, arg, sizeof(karg))) {
printk(KERN_ERR "failure at %s:%d/%s()!\n",
@@ -1044,8 +1043,7 @@ _ctl_getiocinfo(void __user *arg)
karg.adapter_type = MPT2_IOCTL_INTERFACE_SAS2;
if (ioc->pfacts)
karg.port_number = ioc->pfacts[0].PortNumber;
- pci_read_config_byte(ioc->pdev, PCI_CLASS_REVISION, &revision);
- karg.hw_rev = revision;
+ karg.hw_rev = ioc->pdev->revision;
karg.pci_id = ioc->pdev->device;
karg.subsystem_device = ioc->pdev->subsystem_device;
karg.subsystem_vendor = ioc->pdev->subsystem_vendor;
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2 resend] mpt2sas: use pci_dev->revision
2011-05-13 15:07 [PATCH resend] mpt2sas: use pci_dev->revision Sergei Shtylyov
@ 2011-07-21 15:42 ` Sergei Shtylyov
2011-10-05 15:08 ` [PATCH v3] " Sergei Shtylyov
0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2011-07-21 15:42 UTC (permalink / raw)
To: linux-scsi, James.Bottomley
The driver reads PCI revision ID from the PCI configuration register while it's
already stored by PCI subsystem in the 'revision' field of 'struct pci_dev'...
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
---
The patch is against the recent Linus' tree.
It wasn't merged in either 2.6.39 or 3.0 time, hopefully it can be merged to
3.1...
drivers/scsi/mpt2sas/mpt2sas_base.c | 4 +---
drivers/scsi/mpt2sas/mpt2sas_ctl.c | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
Index: linux-2.6/drivers/scsi/mpt2sas/mpt2sas_base.c
===================================================================
--- linux-2.6.orig/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ linux-2.6/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -1806,10 +1806,8 @@ _base_display_ioc_capabilities(struct MP
{
int i = 0;
char desc[16];
- u8 revision;
u32 iounit_pg1_flags;
- pci_read_config_byte(ioc->pdev, PCI_CLASS_REVISION, &revision);
strncpy(desc, ioc->manu_pg0.ChipName, 16);
printk(MPT2SAS_INFO_FMT "%s: FWVersion(%02d.%02d.%02d.%02d), "
"ChipRevision(0x%02x), BiosVersion(%02d.%02d.%02d.%02d)\n",
@@ -1818,7 +1816,7 @@ _base_display_ioc_capabilities(struct MP
(ioc->facts.FWVersion.Word & 0x00FF0000) >> 16,
(ioc->facts.FWVersion.Word & 0x0000FF00) >> 8,
ioc->facts.FWVersion.Word & 0x000000FF,
- revision,
+ ioc->pdev->revision,
(ioc->bios_pg3.BiosVersion & 0xFF000000) >> 24,
(ioc->bios_pg3.BiosVersion & 0x00FF0000) >> 16,
(ioc->bios_pg3.BiosVersion & 0x0000FF00) >> 8,
Index: linux-2.6/drivers/scsi/mpt2sas/mpt2sas_ctl.c
===================================================================
--- linux-2.6.orig/drivers/scsi/mpt2sas/mpt2sas_ctl.c
+++ linux-2.6/drivers/scsi/mpt2sas/mpt2sas_ctl.c
@@ -1027,7 +1027,6 @@ _ctl_getiocinfo(void __user *arg)
{
struct mpt2_ioctl_iocinfo karg;
struct MPT2SAS_ADAPTER *ioc;
- u8 revision;
if (copy_from_user(&karg, arg, sizeof(karg))) {
printk(KERN_ERR "failure at %s:%d/%s()!\n",
@@ -1044,8 +1043,7 @@ _ctl_getiocinfo(void __user *arg)
karg.adapter_type = MPT2_IOCTL_INTERFACE_SAS2;
if (ioc->pfacts)
karg.port_number = ioc->pfacts[0].PortNumber;
- pci_read_config_byte(ioc->pdev, PCI_CLASS_REVISION, &revision);
- karg.hw_rev = revision;
+ karg.hw_rev = ioc->pdev->revision;
karg.pci_id = ioc->pdev->device;
karg.subsystem_device = ioc->pdev->subsystem_device;
karg.subsystem_vendor = ioc->pdev->subsystem_vendor;
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v3] mpt2sas: use pci_dev->revision
2011-07-21 15:42 ` [PATCH v2 " Sergei Shtylyov
@ 2011-10-05 15:08 ` Sergei Shtylyov
0 siblings, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2011-10-05 15:08 UTC (permalink / raw)
To: linux-scsi; +Cc: James.Bottomley, akpm
The driver reads PCI revision ID from the PCI configuration register while it's
already stored by PCI subsystem in the 'revision' field of 'struct pci_dev'...
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
---
The patch is against the recent Linus' tree.
It wasn't merged in either 2.6.39, 3.0, or 3.1 time, hopefully it can be merged
to 3.2...
Andrew, the SCSI maintainer seems to ignore this patch, maybe you can queue it?
drivers/scsi/mpt2sas/mpt2sas_base.c | 4 +---
drivers/scsi/mpt2sas/mpt2sas_ctl.c | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
Index: linux-2.6/drivers/scsi/mpt2sas/mpt2sas_base.c
===================================================================
--- linux-2.6.orig/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ linux-2.6/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -1830,12 +1830,10 @@ _base_display_ioc_capabilities(struct MP
{
int i = 0;
char desc[16];
- u8 revision;
u32 iounit_pg1_flags;
u32 bios_version;
bios_version = le32_to_cpu(ioc->bios_pg3.BiosVersion);
- pci_read_config_byte(ioc->pdev, PCI_CLASS_REVISION, &revision);
strncpy(desc, ioc->manu_pg0.ChipName, 16);
printk(MPT2SAS_INFO_FMT "%s: FWVersion(%02d.%02d.%02d.%02d), "
"ChipRevision(0x%02x), BiosVersion(%02d.%02d.%02d.%02d)\n",
@@ -1844,7 +1842,7 @@ _base_display_ioc_capabilities(struct MP
(ioc->facts.FWVersion.Word & 0x00FF0000) >> 16,
(ioc->facts.FWVersion.Word & 0x0000FF00) >> 8,
ioc->facts.FWVersion.Word & 0x000000FF,
- revision,
+ ioc->pdev->revision,
(bios_version & 0xFF000000) >> 24,
(bios_version & 0x00FF0000) >> 16,
(bios_version & 0x0000FF00) >> 8,
Index: linux-2.6/drivers/scsi/mpt2sas/mpt2sas_ctl.c
===================================================================
--- linux-2.6.orig/drivers/scsi/mpt2sas/mpt2sas_ctl.c
+++ linux-2.6/drivers/scsi/mpt2sas/mpt2sas_ctl.c
@@ -1027,7 +1027,6 @@ _ctl_getiocinfo(void __user *arg)
{
struct mpt2_ioctl_iocinfo karg;
struct MPT2SAS_ADAPTER *ioc;
- u8 revision;
if (copy_from_user(&karg, arg, sizeof(karg))) {
printk(KERN_ERR "failure at %s:%d/%s()!\n",
@@ -1047,8 +1046,7 @@ _ctl_getiocinfo(void __user *arg)
karg.adapter_type = MPT2_IOCTL_INTERFACE_SAS2;
if (ioc->pfacts)
karg.port_number = ioc->pfacts[0].PortNumber;
- pci_read_config_byte(ioc->pdev, PCI_CLASS_REVISION, &revision);
- karg.hw_rev = revision;
+ karg.hw_rev = ioc->pdev->revision;
karg.pci_id = ioc->pdev->device;
karg.subsystem_device = ioc->pdev->subsystem_device;
karg.subsystem_vendor = ioc->pdev->subsystem_vendor;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-10-05 15:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-13 15:07 [PATCH resend] mpt2sas: use pci_dev->revision Sergei Shtylyov
2011-07-21 15:42 ` [PATCH v2 " Sergei Shtylyov
2011-10-05 15:08 ` [PATCH v3] " Sergei Shtylyov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox