Re: 2.6.23-rc2-mm2

2007-08-10 Thread Andrew Morton
On Fri, 10 Aug 2007 14:35:01 +0200 Gabriel C [EMAIL PROTECTED] wrote:

 In file included from include/linux/blkdev.h:17,
  from kernel/sched.c:45:
 include/linux/bsg.h:67: warning: 'struct request_queue' declared inside 
 parameter list
 include/linux/bsg.h:67: warning: its scope is only this definition or 
 declaration, which is probably not what you want
 include/linux/bsg.h:71: warning: 'struct request_queue' declared inside 
 parameter list

Thanks, I'll fix that up.
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH] [MEGARAID_SAS]: Use pr_info

2007-08-10 Thread Patro, Sumant
 
Hello Arnaldo,

Throughout the megaraid_sas driver code there are printk's with
appropriate flags (that includes KERN_INFO). What is the incentive to
change printk with KERN_INFO to pr_info?

Regards,

Sumant

-Original Message-
From: Arnaldo Carvalho de Melo [mailto:[EMAIL PROTECTED] On Behalf
Of Arnaldo Carvalho de Melo
Sent: Wednesday, August 08, 2007 4:15 PM
To: DL-MegaRAID Linux
Cc: linux-scsi@vger.kernel.org; James Bottomley
Subject: [PATCH] [MEGARAID_SAS]: Use pr_info

Signed-off-by: Arnaldo Carvalho de Melo [EMAIL PROTECTED]
---
 drivers/scsi/megaraid/megaraid_sas.c |   14 ++
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas.c
b/drivers/scsi/megaraid/megaraid_sas.c
index 59099da..4a8cf06 100644
--- a/drivers/scsi/megaraid/megaraid_sas.c
+++ b/drivers/scsi/megaraid/megaraid_sas.c
@@ -1341,8 +1341,7 @@ megasas_transition_to_ready(struct
megasas_instance* instance)
fw_state =
instance-instancet-read_fw_status_reg(instance-reg_set) 
MFI_STATE_MASK;
 
if (fw_state != MFI_STATE_READY)
-   printk(KERN_INFO megasas: Waiting for FW to come to
ready
-   state\n);
+   pr_info(megasas: Waiting for FW to come to ready
state\n);
 
while (fw_state != MFI_STATE_READY) {
 
@@ -1444,7 +1443,7 @@ megasas_transition_to_ready(struct
megasas_instance* instance)
return -ENODEV;
}
};
-   printk(KERN_INFO megasas: FW now in Ready state\n);
+   pr_info(megasas: FW now in Ready state\n);
 
return 0;
 }
@@ -2277,9 +2276,9 @@ megasas_probe_one(struct pci_dev *pdev, const
struct pci_device_id *id)
/*
 * Announce PCI information
 */
-   printk(KERN_INFO megasas: %#4.04x:%#4.04x:%#4.04x:%#4.04x: ,
-  pdev-vendor, pdev-device, pdev-subsystem_vendor,
-  pdev-subsystem_device);
+   pr_info(megasas: %#4.04x:%#4.04x:%#4.04x:%#4.04x: ,
+   pdev-vendor, pdev-device, pdev-subsystem_vendor,
+   pdev-subsystem_device);
 
printk(bus %d:slot %d:func %d\n,
   pdev-bus-number, PCI_SLOT(pdev-devfn),
PCI_FUNC(pdev-devfn)); @@ -3030,8 +3029,7 @@ static int __init
megasas_init(void)
/*
 * Announce driver version and other information
 */
-   printk(KERN_INFO megasas: %s %s\n, MEGASAS_VERSION,
-  MEGASAS_EXT_VERSION);
+   pr_info(megasas: %s %s\n, MEGASAS_VERSION,
MEGASAS_EXT_VERSION);
 
/*
 * Register character device node
--
1.5.2.2

-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Partition information lost on reboot.

2007-08-10 Thread Michal Piotrowski
[Adding linux-scsi and Adaptec support to CC]

On 10/08/07, Jegadeesh [EMAIL PROTECTED] wrote:
 Hi,

 I have a scsi disk on Adaptec ASC-29320 U320. I have created a linux
 partition and ext3 filesystem over it.
 Now the problem is, whenever the machine is rebooted, the partition
 information to the OS is lost and I get an error saying it as a not valid
 block device.
 But fdisk tool shows the partitions, but cat /proc/partitions doesnt have
 this. I need to do a partprobe and then have to mount it explicitly.

 What could be causing this problem. Given below are some of the command
 outputs.

 # uname -a
 Linux pr.vionline.net 2.6.18-1.2798.fc6 #1 SMP Mon Oct 16 14:37:32 EDT 2006
 i686 i686 i386 GNU/Linux

 # mount /dev/sda1 /disk1
 mount: /dev/sda1 is not a valid block device

 # fdisk -l /dev/sda

 Disk /dev/sda: 73.4 GB, 73407900160 bytes
 255 heads, 63 sectors/track, 8924 cylinders
 Units = cylinders of 16065 * 512 = 8225280 bytes

 Device Boot Start End Blocks Id System
 /dev/sda1 1 7417 59577021 83 Linux
 /dev/sda2 7418 8924 12104977+ 83 Linux

 # cat /proc/partitions
 major minor #blocks name

 3 0 60051600 hda
 3 1 409626 hda1
 3 2 10482412 hda2
 3 3 10482412 hda3
 3 4 1 hda4
 3 5 10482381 hda5
 3 6 2096451 hda6
 3 7 2096451 hda7
 3 8 2096451 hda8
 8 0 71687402 sda

 Thanks
 -Jag
 -
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/


Regards,
Michal

-- 
LOG
http://www.stardust.webpages.pl/log/
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH][Take2] PCI legacy I/O port free driver - Making Emulex lpfc driver legacy I/O port free

2007-08-10 Thread Tomohiro Kusumi
Hi

This patch makes Emulex lpfc driver legacy I/O port free.
It has already been acked quite long time ago.
So I resubmit the patch.
http://lkml.org/lkml/2006/11/22/28

Current lpfc driver is already using pci_select_bars()
and pci_enable_device_bars() when the PCI bus has been reset.
So I think this patch should also be acked.

Tomohiro Kusumi

Signed-off-by: Tomohiro Kusumi [EMAIL PROTECTED]

---
diff -Nurp linux-2.6.22.org/drivers/scsi/lpfc/lpfc_init.c 
linux-2.6.22/drivers/scsi/lpfc/lpfc_init.c
--- linux-2.6.22.org/drivers/scsi/lpfc/lpfc_init.c  2007-07-09 
08:32:17.0 +0900
+++ linux-2.6.22/drivers/scsi/lpfc/lpfc_init.c  2007-08-10 17:11:55.0 
+0900
@@ -1356,6 +1356,7 @@ lpfc_scsi_free(struct lpfc_hba * phba)
 void lpfc_remove_device(struct lpfc_hba *phba)
 {
unsigned long iflag;
+   int bars = pci_select_bars(phba-pcidev, IORESOURCE_MEM);

lpfc_free_sysfs_attr(phba);

@@ -1400,7 +1401,7 @@ void lpfc_remove_device(struct lpfc_hba
iounmap(phba-ctrl_regs_memmap_p);
iounmap(phba-slim_memmap_p);

-   pci_release_regions(phba-pcidev);
+   pci_release_selected_regions(phba-pcidev, bars);
pci_disable_device(phba-pcidev);

idr_remove(lpfc_hba_index, phba-brd_no);
@@ -1515,10 +1516,11 @@ lpfc_pci_probe_one(struct pci_dev *pdev,
int error = -ENODEV, retval;
int i;
uint16_t iotag;
+   int bars = pci_select_bars(pdev, IORESOURCE_MEM);

-   if (pci_enable_device(pdev))
+   if (pci_enable_device_bars(pdev, bars))
goto out;
-   if (pci_request_regions(pdev, LPFC_DRIVER_NAME))
+   if (pci_request_selected_regions(pdev, bars, LPFC_DRIVER_NAME))
goto out_disable_device;

host = scsi_host_alloc(lpfc_template, sizeof (struct lpfc_hba));
@@ -1748,7 +1750,7 @@ out_put_host:
phba-host = NULL;
scsi_host_put(host);
 out_release_regions:
-   pci_release_regions(pdev);
+   pci_release_selected_regions(pdev, bars);
 out_disable_device:
pci_disable_device(pdev);

-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] [MEGARAID_SAS]: Use pr_info

2007-08-10 Thread Brian King
Patro, Sumant wrote:
 Hello Arnaldo,
   
   Throughout the megaraid_sas driver code there are printk's with
 appropriate flags (that includes KERN_INFO). What is the incentive to
 change printk with KERN_INFO to pr_info?

And why not change most of these to dev_printk and friends?

-Brian

 
 Regards,
 
 Sumant
 
 -Original Message-
 From: Arnaldo Carvalho de Melo [mailto:[EMAIL PROTECTED] On Behalf
 Of Arnaldo Carvalho de Melo
 Sent: Wednesday, August 08, 2007 4:15 PM
 To: DL-MegaRAID Linux
 Cc: linux-scsi@vger.kernel.org; James Bottomley
 Subject: [PATCH] [MEGARAID_SAS]: Use pr_info
 
 Signed-off-by: Arnaldo Carvalho de Melo [EMAIL PROTECTED]
 ---
  drivers/scsi/megaraid/megaraid_sas.c |   14 ++
  1 files changed, 6 insertions(+), 8 deletions(-)
 
 diff --git a/drivers/scsi/megaraid/megaraid_sas.c
 b/drivers/scsi/megaraid/megaraid_sas.c
 index 59099da..4a8cf06 100644
 --- a/drivers/scsi/megaraid/megaraid_sas.c
 +++ b/drivers/scsi/megaraid/megaraid_sas.c
 @@ -1341,8 +1341,7 @@ megasas_transition_to_ready(struct
 megasas_instance* instance)
   fw_state =
 instance-instancet-read_fw_status_reg(instance-reg_set) 
 MFI_STATE_MASK;
 
   if (fw_state != MFI_STATE_READY)
 - printk(KERN_INFO megasas: Waiting for FW to come to
 ready
 - state\n);
 + pr_info(megasas: Waiting for FW to come to ready
 state\n);
 
   while (fw_state != MFI_STATE_READY) {
 
 @@ -1444,7 +1443,7 @@ megasas_transition_to_ready(struct
 megasas_instance* instance)
   return -ENODEV;
   }
   };
 - printk(KERN_INFO megasas: FW now in Ready state\n);
 + pr_info(megasas: FW now in Ready state\n);
 
   return 0;
  }
 @@ -2277,9 +2276,9 @@ megasas_probe_one(struct pci_dev *pdev, const
 struct pci_device_id *id)
   /*
* Announce PCI information
*/
 - printk(KERN_INFO megasas: %#4.04x:%#4.04x:%#4.04x:%#4.04x: ,
 -pdev-vendor, pdev-device, pdev-subsystem_vendor,
 -pdev-subsystem_device);
 + pr_info(megasas: %#4.04x:%#4.04x:%#4.04x:%#4.04x: ,
 + pdev-vendor, pdev-device, pdev-subsystem_vendor,
 + pdev-subsystem_device);
 
   printk(bus %d:slot %d:func %d\n,
  pdev-bus-number, PCI_SLOT(pdev-devfn),
 PCI_FUNC(pdev-devfn)); @@ -3030,8 +3029,7 @@ static int __init
 megasas_init(void)
   /*
* Announce driver version and other information
*/
 - printk(KERN_INFO megasas: %s %s\n, MEGASAS_VERSION,
 -MEGASAS_EXT_VERSION);
 + pr_info(megasas: %s %s\n, MEGASAS_VERSION,
 MEGASAS_EXT_VERSION);
 
   /*
* Register character device node
 --
 1.5.2.2
 
 -
 To unsubscribe from this list: send the line unsubscribe linux-scsi in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html


-- 
Brian King
Linux on Power Virtualization
IBM Linux Technology Center
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: 2.6.23-rc2-mm2

2007-08-10 Thread Gabriel C
Some new warnings here :

...

In file included from include/linux/blkdev.h:17,
 from kernel/sched.c:45:
include/linux/bsg.h:67: warning: 'struct request_queue' declared inside 
parameter list
include/linux/bsg.h:67: warning: its scope is only this definition or 
declaration, which is probably not what you want
include/linux/bsg.h:71: warning: 'struct request_queue' declared inside 
parameter list

...

In file included from include/linux/blkdev.h:17,
 from mm/filemap.c:29:
include/linux/bsg.h:67: warning: 'struct request_queue' declared inside 
parameter list
include/linux/bsg.h:67: warning: its scope is only this definition or 
declaration, which is probably not what you want
include/linux/bsg.h:71: warning: 'struct request_queue' declared inside 
parameter list

...

Some more of these , all from bsg.h:{67,71}

config there :

http://194.231.229.228/kernel/mm/2.6.23-rc2-mm2/randconfig-auto-5







-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 01/30] bsg: declare request_queue

2007-08-10 Thread akpm
From: Andrew Morton [EMAIL PROTECTED]

include/linux/bsg.h:67: warning: 'struct request_queue' declared inside 
parameter list
include/linux/bsg.h:67: warning: its scope is only this definition or 
declaration, which is probably not what you want
include/linux/bsg.h:71: warning: 'struct request_queue' declared inside 
parameter list

Cc: James Bottomley [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 include/linux/bsg.h |3 +++
 1 files changed, 3 insertions(+)

diff -puN include/linux/bsg.h~bsg-declare-request_queue include/linux/bsg.h
--- a/include/linux/bsg.h~bsg-declare-request_queue
+++ a/include/linux/bsg.h
@@ -53,6 +53,9 @@ struct sg_io_v4 {
 
 #ifdef __KERNEL__
 
+struct request_queue;
+struct device;
+
 #if defined(CONFIG_BLK_DEV_BSG)
 struct bsg_class_device {
struct class_device *class_dev;
_
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 05/30] drivers/scsi/pcmcia/nsp_cs.c: remove kernel 2.4 code

2007-08-10 Thread akpm
From: Adrian Bunk [EMAIL PROTECTED]

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/scsi/pcmcia/nsp_cs.c |  159 +
 drivers/scsi/pcmcia/nsp_cs.h |8 -
 2 files changed, 5 insertions(+), 162 deletions(-)

diff -puN 
drivers/scsi/pcmcia/nsp_cs.c~drivers-scsi-pcmcia-nsp_csc-remove-kernel-24-code 
drivers/scsi/pcmcia/nsp_cs.c
--- 
a/drivers/scsi/pcmcia/nsp_cs.c~drivers-scsi-pcmcia-nsp_csc-remove-kernel-24-code
+++ a/drivers/scsi/pcmcia/nsp_cs.c
@@ -25,8 +25,6 @@
 
 ***/
 
-/* $Id: nsp_cs.c,v 1.23 2003/08/18 11:09:19 elca Exp $ */
-
 #include linux/version.h
 #include linux/module.h
 #include linux/kernel.h
@@ -59,7 +57,7 @@
 #include nsp_cs.h
 
 MODULE_AUTHOR(YOKOTA Hiroshi [EMAIL PROTECTED]);
-MODULE_DESCRIPTION(WorkBit NinjaSCSI-3 / NinjaSCSI-32Bi(16bit) PCMCIA SCSI 
host adapter module $Revision: 1.23 $);
+MODULE_DESCRIPTION(WorkBit NinjaSCSI-3 / NinjaSCSI-32Bi(16bit) PCMCIA SCSI 
host adapter module);
 MODULE_SUPPORTED_DEVICE(sd,sr,sg,st);
 #ifdef MODULE_LICENSE
 MODULE_LICENSE(GPL);
@@ -83,10 +81,6 @@ static struct scsi_host_template nsp_dri
.proc_name   = nsp_cs,
.proc_info   = nsp_proc_info,
.name= WorkBit NinjaSCSI-3/32Bi(16bit),
-#if (LINUX_VERSION_CODE  KERNEL_VERSION(2,5,0))
-   .detect  = nsp_detect_old,
-   .release = nsp_release_old,
-#endif
.info= nsp_info,
.queuecommand= nsp_queuecommand,
 /* .eh_abort_handler= nsp_eh_abort,*/
@@ -97,9 +91,6 @@ static struct scsi_host_template nsp_dri
.sg_tablesize= SG_ALL,
.cmd_per_lun = 1,
.use_clustering  = DISABLE_CLUSTERING,
-#if (LINUX_VERSION_CODE  KERNEL_VERSION(2,5,2))
-   .use_new_eh_code = 1,
-#endif
 };
 
 static nsp_hw_data nsp_data_base; /* attach - detect glue */
@@ -1313,11 +1304,7 @@ static struct Scsi_Host *nsp_detect(stru
nsp_hw_data *data_b = nsp_data_base, *data;
 
nsp_dbg(NSP_DEBUG_INIT, this_id=%d, sht-this_id);
-#if (LINUX_VERSION_CODE  KERNEL_VERSION(2,5,73))
host = scsi_host_alloc(nsp_driver_template, sizeof(nsp_hw_data));
-#else
-   host = scsi_register(sht, sizeof(nsp_hw_data));
-#endif
if (host == NULL) {
nsp_dbg(NSP_DEBUG_INIT, host failed);
return NULL;
@@ -1354,37 +1341,6 @@ static struct Scsi_Host *nsp_detect(stru
return host; /* detect done. */
 }
 
-#if (LINUX_VERSION_CODE  KERNEL_VERSION(2,5,0))
-static int nsp_detect_old(struct scsi_host_template *sht)
-{
-   if (nsp_detect(sht) == NULL) {
-   return 0;
-   } else {
-   //MOD_INC_USE_COUNT;
-   return 1;
-   }
-}
-
-
-static int nsp_release_old(struct Scsi_Host *shpnt)
-{
-   //nsp_hw_data *data = (nsp_hw_data *)shpnt-hostdata;
-
-   /* PCMCIA Card Service dose same things below. */
-   /* So we do nothing.   */
-   //if (shpnt-irq) {
-   //  free_irq(shpnt-irq, data-ScsiInfo);
-   //}
-   //if (shpnt-io_port) {
-   //  release_region(shpnt-io_port, shpnt-n_io_port);
-   //}
-
-   //MOD_DEC_USE_COUNT;
-
-   return 0;
-}
-#endif
-
 /**/
 /* return info string*/
 /**/
@@ -1403,19 +1359,9 @@ static const char *nsp_info(struct Scsi_
nsp_dbg(NSP_DEBUG_PROC, buffer=0x%p pos=0x%p length=%d 
%d\n, buffer, pos, length,  length - (pos - buffer));\
} \
} while(0)
-static int
-nsp_proc_info(
-#if (LINUX_VERSION_CODE  KERNEL_VERSION(2,5,73))
-   struct Scsi_Host *host,
-#endif
-   char  *buffer,
-   char **start,
-   off_t  offset,
-   intlength,
-#if !(LINUX_VERSION_CODE  KERNEL_VERSION(2,5,73))
-   inthostno,
-#endif
-   intinout)
+
+static int nsp_proc_info(struct Scsi_Host *host, char *buffer, char **start,
+off_t offset, int length, int inout)
 {
int id;
char *pos = buffer;
@@ -1423,24 +1369,13 @@ nsp_proc_info(
int speed;
unsigned long flags;
nsp_hw_data *data;
-#if !(LINUX_VERSION_CODE  KERNEL_VERSION(2,5,73))
-   struct Scsi_Host *host;
-#else
int hostno;
-#endif
+
if (inout) {
return -EINVAL;
}
 
-#if (LINUX_VERSION_CODE  KERNEL_VERSION(2,5,73))
hostno = host-host_no;
-#else
-   /* search this HBA host */
-   host = scsi_host_hn_get(hostno);
-   if (host == NULL) {
-   return -ESRCH;
-   }
-#endif
data = (nsp_hw_data *)host-hostdata;
 
 
@@ -1675,10 +1610,6 @@ static int 

[patch 02/30] aacraid: rename check_reset

2007-08-10 Thread akpm
From: Andrew Morton [EMAIL PROTECTED]

Too generic, clashes with ISDN.

Acked-by: Mark Salyzyn [EMAIL PROTECTED]
Cc: James Bottomley [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/scsi/aacraid/aachba.c  |8 
 drivers/scsi/aacraid/aacraid.h |2 +-
 drivers/scsi/aacraid/commsup.c |5 +++--
 3 files changed, 8 insertions(+), 7 deletions(-)

diff -puN drivers/scsi/aacraid/aachba.c~aacraid-rename-check_reset 
drivers/scsi/aacraid/aachba.c
--- a/drivers/scsi/aacraid/aachba.c~aacraid-rename-check_reset
+++ a/drivers/scsi/aacraid/aachba.c
@@ -177,9 +177,9 @@ int check_interval = 24 * 60 * 60;
 module_param(check_interval, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(check_interval, Interval in seconds between adapter health 
checks.);
 
-int check_reset = 1;
-module_param(check_reset, int, S_IRUGO|S_IWUSR);
-MODULE_PARM_DESC(check_reset, If adapter fails health check, reset the 
adapter.);
+int aac_check_reset = 1;
+module_param_named(check_reset, aac_check_reset, int, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(aac_check_reset, If adapter fails health check, reset the 
adapter.);
 
 int expose_physicals = -1;
 module_param(expose_physicals, int, S_IRUGO|S_IWUSR);
@@ -1305,7 +1305,7 @@ int aac_get_adapter_info(struct aac_dev*
  
(int)sizeof(dev-supplement_adapter_info.VpdInfo.Tsid),
  dev-supplement_adapter_info.VpdInfo.Tsid);
}
-   if (!check_reset ||
+   if (!aac_check_reset ||
  (dev-supplement_adapter_info.SupportedOptions2 
  le32_to_cpu(AAC_OPTION_IGNORE_RESET))) {
printk(KERN_INFO %s%d: Reset Adapter Ignored\n,
diff -puN drivers/scsi/aacraid/aacraid.h~aacraid-rename-check_reset 
drivers/scsi/aacraid/aacraid.h
--- a/drivers/scsi/aacraid/aacraid.h~aacraid-rename-check_reset
+++ a/drivers/scsi/aacraid/aacraid.h
@@ -1871,4 +1871,4 @@ extern int aac_reset_devices;
 extern int aac_commit;
 extern int update_interval;
 extern int check_interval;
-extern int check_reset;
+extern int aac_check_reset;
diff -puN drivers/scsi/aacraid/commsup.c~aacraid-rename-check_reset 
drivers/scsi/aacraid/commsup.c
--- a/drivers/scsi/aacraid/commsup.c~aacraid-rename-check_reset
+++ a/drivers/scsi/aacraid/commsup.c
@@ -1372,8 +1372,9 @@ int aac_check_health(struct aac_dev * aa
 
printk(KERN_ERR %s: Host adapter BLINK LED 0x%x\n, aac-name, 
BlinkLED);
 
-   if (!check_reset || (aac-supplement_adapter_info.SupportedOptions2 
- le32_to_cpu(AAC_OPTION_IGNORE_RESET)))
+   if (!aac_check_reset ||
+   (aac-supplement_adapter_info.SupportedOptions2 
+   le32_to_cpu(AAC_OPTION_IGNORE_RESET)))
goto out;
host = aac-scsi_host_ptr;
if (aac-thread-pid != current-pid)
_
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 06/30] Remove dead references to MODULE_PARM macro

2007-08-10 Thread akpm
From: Robert P. J. Day [EMAIL PROTECTED]

Remove the useless references to the obsolete MODULE_PARM macro.

Signed-off-by: Robert P. J. Day [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/scsi/ibmmca.c |7 ---
 1 files changed, 7 deletions(-)

diff -puN drivers/scsi/ibmmca.c~remove-dead-references-to-module_parm-macro 
drivers/scsi/ibmmca.c
--- a/drivers/scsi/ibmmca.c~remove-dead-references-to-module_parm-macro
+++ a/drivers/scsi/ibmmca.c
@@ -460,13 +460,6 @@ module_param(boot_options, charp, 0);
 module_param_array(io_port, int, NULL, 0);
 module_param_array(scsi_id, int, NULL, 0);
 
-#if 0 /* FIXME: No longer exist? --RR */
-MODULE_PARM(display, 1i);
-MODULE_PARM(adisplay, 1i);
-MODULE_PARM(normal, 1i);
-MODULE_PARM(ansi, 1i);
-#endif
-
 MODULE_LICENSE(GPL);
 #endif
 /*counter of concurrent disk read/writes, to turn on/off disk led */
_
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 07/30] Incorrect SCSI transfer length computation from odd sized scsi_execute_async() transfers.

2007-08-10 Thread akpm
From: Jeremy Linton [EMAIL PROTECTED]

Any function which use scsi_execute_async() and transfers odd sized data
that doesn't align correctly with the segment sizes may have its transfer
length padded out to the closest segment size.

For writes, this results in unnecessary data being transfered to the SCSI
target.  For reads, it affects the residual data length being returned to
the application since the residual length will be based on the padded
transfer size rather than the actual request size.

The easiest way to see this is by trying to read using the SG_IO ioctl a
large (32k) buffer size from a tape device that only has a few bytes of
data stored for the current block.  The resulting resid will generally be
incorrect.

I've fixed this simply by changing scsi_req_map_sg() so that it places the
requested transfer length in rq-data_len rather than the sum of all the sg
segments.

Signed-off-by: Jeremy Linton [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/scsi/scsi_lib.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN 
drivers/scsi/scsi_lib.c~incorrect-scsi-transfer-length-computation-from-odd 
drivers/scsi/scsi_lib.c
--- 
a/drivers/scsi/scsi_lib.c~incorrect-scsi-transfer-length-computation-from-odd
+++ a/drivers/scsi/scsi_lib.c
@@ -355,7 +355,7 @@ static int scsi_req_map_sg(struct reques
}
 
rq-buffer = rq-data = NULL;
-   rq-data_len = data_len;
+   rq-data_len = bufflen;
return 0;
 
 free_bios:
_
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 09/30] Clean up duplicate includes in drivers/scsi/

2007-08-10 Thread akpm
From: Jesper Juhl [EMAIL PROTECTED]

This patch cleans up duplicate includes in
drivers/scsi/

Signed-off-by: Jesper Juhl [EMAIL PROTECTED]
Acked-by: James Smart [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/scsi/NCR_D700.c  |1 -
 drivers/scsi/lpfc/lpfc_debugfs.c |1 -
 drivers/scsi/lpfc/lpfc_init.c|1 -
 3 files changed, 3 deletions(-)

diff -puN drivers/scsi/NCR_D700.c~clean-up-duplicate-includes-in-drivers-scsi 
drivers/scsi/NCR_D700.c
--- a/drivers/scsi/NCR_D700.c~clean-up-duplicate-includes-in-drivers-scsi
+++ a/drivers/scsi/NCR_D700.c
@@ -97,7 +97,6 @@
 #include linux/kernel.h
 #include linux/module.h
 #include linux/mca.h
-#include linux/interrupt.h
 #include asm/io.h
 #include scsi/scsi_host.h
 #include scsi/scsi_device.h
diff -puN 
drivers/scsi/lpfc/lpfc_debugfs.c~clean-up-duplicate-includes-in-drivers-scsi 
drivers/scsi/lpfc/lpfc_debugfs.c
--- 
a/drivers/scsi/lpfc/lpfc_debugfs.c~clean-up-duplicate-includes-in-drivers-scsi
+++ a/drivers/scsi/lpfc/lpfc_debugfs.c
@@ -43,7 +43,6 @@
 #include lpfc_crtn.h
 #include lpfc_vport.h
 #include lpfc_version.h
-#include lpfc_vport.h
 #include lpfc_debugfs.h
 
 #ifdef CONFIG_LPFC_DEBUG_FS
diff -puN 
drivers/scsi/lpfc/lpfc_init.c~clean-up-duplicate-includes-in-drivers-scsi 
drivers/scsi/lpfc/lpfc_init.c
--- a/drivers/scsi/lpfc/lpfc_init.c~clean-up-duplicate-includes-in-drivers-scsi
+++ a/drivers/scsi/lpfc/lpfc_init.c
@@ -43,7 +43,6 @@
 #include lpfc_crtn.h
 #include lpfc_vport.h
 #include lpfc_version.h
-#include lpfc_vport.h
 
 static int lpfc_parse_vpd(struct lpfc_hba *, uint8_t *, int);
 static void lpfc_get_hba_model_desc(struct lpfc_hba *, uint8_t *, uint8_t *);
_
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 08/30] Use menuconfig objects: Fusion

2007-08-10 Thread akpm
From: Jan Engelhardt [EMAIL PROTECTED]

Change Kconfig objects from menu, config into menuconfig so
that the user can disable the whole feature without having to
enter the menu first.

Signed-off-by: Jan Engelhardt [EMAIL PROTECTED]
Cc: Moore, Eric Dean [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/message/fusion/Kconfig |   19 ++-
 1 files changed, 10 insertions(+), 9 deletions(-)

diff -puN drivers/message/fusion/Kconfig~use-menuconfig-objects-fusion 
drivers/message/fusion/Kconfig
--- a/drivers/message/fusion/Kconfig~use-menuconfig-objects-fusion
+++ a/drivers/message/fusion/Kconfig
@@ -1,15 +1,19 @@
 
-menu Fusion MPT device support
+menuconfig FUSION
+   bool Fusion MPT device support
depends on PCI
+   ---help---
+   Say Y here to get to see options for Fusion Message
+   Passing Technology (MPT) drivers.
+   This option alone does not add any kernel code.
+
+   If you say N, all options in this submenu will be skipped and disabled.
 
-config FUSION
-   bool
-   default n
+if FUSION
 
 config FUSION_SPI
tristate Fusion MPT ScsiHost drivers for SPI
depends on PCI  SCSI
-   select FUSION
select SCSI_SPI_ATTRS
---help---
  SCSI HOST support for a parallel SCSI host adapters.
@@ -24,7 +28,6 @@ config FUSION_SPI
 config FUSION_FC
tristate Fusion MPT ScsiHost drivers for FC
depends on PCI  SCSI
-   select FUSION
select SCSI_FC_ATTRS
---help---
  SCSI HOST support for a Fiber Channel host adapters.
@@ -42,7 +45,6 @@ config FUSION_FC
 config FUSION_SAS
tristate Fusion MPT ScsiHost drivers for SAS
depends on PCI  SCSI
-   select FUSION
select SCSI_SAS_ATTRS
---help---
  SCSI HOST support for a SAS host adapters.
@@ -56,7 +58,6 @@ config FUSION_SAS
 
 config FUSION_MAX_SGE
int Maximum number of scatter gather entries (16 - 128)
-   depends on FUSION
default 128
range 16 128
help
@@ -116,4 +117,4 @@ config FUSION_LOGGING
  There are various debug levels that an be found in the source:
  file:drivers/message/fusion/mptdebug.h
 
-endmenu
+endif # FUSION
_
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 03/30] PCI Error Recovery: Symbios SCSI base support

2007-08-10 Thread akpm
From: Linas Vepstas [EMAIL PROTECTED]

Various PCI bus errors can be signaled by newer PCI controllers.  This
patch adds the PCI error recovery callbacks to the Symbios SCSI device
driver.  The patch has been tested, and appears to work well.

Signed-off-by: Linas Vepstas [EMAIL PROTECTED]
Cc: Matthew Wilcox [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/scsi/sym53c8xx_2/sym_glue.c |  136 ++
 drivers/scsi/sym53c8xx_2/sym_glue.h |4 
 drivers/scsi/sym53c8xx_2/sym_hipd.c |6 +
 3 files changed, 146 insertions(+)

diff -puN 
drivers/scsi/sym53c8xx_2/sym_glue.c~pci-error-recovery-symbios-scsi-base-support
 drivers/scsi/sym53c8xx_2/sym_glue.c
--- 
a/drivers/scsi/sym53c8xx_2/sym_glue.c~pci-error-recovery-symbios-scsi-base-support
+++ a/drivers/scsi/sym53c8xx_2/sym_glue.c
@@ -596,6 +596,10 @@ static irqreturn_t sym53c8xx_intr(int ir
unsigned long flags;
struct sym_hcb *np = (struct sym_hcb *)dev_id;
 
+   /* Avoid spinloop trying to handle interrupts on frozen device */
+   if (pci_channel_offline(np-s.device))
+   return IRQ_HANDLED;
+
if (DEBUG_FLAGS  DEBUG_TINY) printf_debug ([);
 
spin_lock_irqsave(np-s.host-host_lock, flags);
@@ -665,6 +669,20 @@ static int sym_eh_handler(int op, char *
 
dev_warn(cmd-device-sdev_gendev, %s operation started.\n, opname);
 
+   /* We may be in an error condition because the PCI bus
+* went down. In this case, we need to wait until the
+* PCI bus is reset, the card is reset, and only then
+* proceed with the scsi error recovery.  There's no
+* point in hurrying; take a leisurely wait.
+*/
+#define WAIT_FOR_PCI_RECOVERY  35
+   if (pci_channel_offline(np-s.device)) {
+   int finished_reset = wait_for_completion_timeout(
+   np-s.io_reset_wait, WAIT_FOR_PCI_RECOVERY*HZ);
+   if (!finished_reset)
+   return SCSI_FAILED;
+   }
+
spin_lock_irq(host-host_lock);
/* This one is queued in some place - to wait for completion */
FOR_EACH_QUEUED_ELEMENT(np-busy_ccbq, qp) {
@@ -1449,6 +1467,7 @@ static struct Scsi_Host * __devinit sym_
np-maxoffs = dev-chip.offset_max;
np-maxburst= dev-chip.burst_max;
np-myaddr  = dev-host_id;
+   init_completion(np-s.io_reset_wait);
 
/*
 *  Edit its name.
@@ -1887,6 +1906,116 @@ static void __devexit sym2_remove(struct
attach_count--;
 }
 
+/**
+ * sym2_io_error_detected() -- called when PCI error is detected
+ * @pdev: pointer to PCI device
+ * @state: current state of the PCI slot
+ */
+static pci_ers_result_t sym2_io_error_detected(struct pci_dev *pdev,
+ enum pci_channel_state state)
+{
+   struct sym_hcb *np = pci_get_drvdata(pdev);
+
+   /* If slot is permanently frozen, turn everything off */
+   if (state == pci_channel_io_perm_failure) {
+   sym2_remove(pdev);
+   return PCI_ERS_RESULT_DISCONNECT;
+   }
+
+   init_completion(np-s.io_reset_wait);
+   disable_irq(pdev-irq);
+   pci_disable_device(pdev);
+
+   /* Request a slot reset. */
+   return PCI_ERS_RESULT_NEED_RESET;
+}
+
+/**
+ * sym2_reset_workarounds -- hardware-specific work-arounds
+ *
+ * This routine is similar to sym_set_workarounds(), except
+ * that, at this point, we already know that the device was
+ * succesfully intialized at least once before, and so most
+ * of the steps taken there are un-needed here.
+ */
+static void sym2_reset_workarounds(struct pci_dev *pdev)
+{
+   u_char revision;
+   u_short status_reg;
+   struct sym_chip *chip;
+
+   pci_read_config_byte(pdev, PCI_CLASS_REVISION, revision);
+   chip = sym_lookup_chip_table(pdev-device, revision);
+
+   /* Work around for errant bit in 895A, in a fashion
+* similar to what is done in sym_set_workarounds().
+*/
+   pci_read_config_word(pdev, PCI_STATUS, status_reg);
+   if (!(chip-features  FE_66MHZ)  (status_reg  PCI_STATUS_66MHZ)) {
+   status_reg = PCI_STATUS_66MHZ;
+   pci_write_config_word(pdev, PCI_STATUS, status_reg);
+   pci_read_config_word(pdev, PCI_STATUS, status_reg);
+   }
+}
+
+/**
+ * sym2_io_slot_reset() -- called when the pci bus has been reset.
+ * @pdev: pointer to PCI device
+ *
+ * Restart the card from scratch.
+ */
+static pci_ers_result_t sym2_io_slot_reset(struct pci_dev *pdev)
+{
+   struct sym_hcb *np = pci_get_drvdata(pdev);
+
+   printk(KERN_INFO %s: recovering from a PCI slot reset\n,
+ sym_name(np));
+
+   if (pci_enable_device(pdev)) {
+   printk(KERN_ERR %s: Unable to enable afer PCI reset\n,
+   sym_name(np));
+   return PCI_ERS_RESULT_DISCONNECT;
+   }
+
+   pci_set_master(pdev);
+   

[patch 04/30] PCI Error Recovery: Symbios SCSI First Failure

2007-08-10 Thread akpm
From: Linas Vepstas [EMAIL PROTECTED]

Implement the so-called first failure data capture (FFDC) for the symbios
PCI error recovery.  After a PCI error event is reported, the driver
requests that MMIO be enabled.  Once enabled, it then reads and dumps
assorted status registers, and concludes by requesting the usual reset
sequence.

(includes a whitespace fix for bad indentation).

Signed-off-by: Linas Vepstas [EMAIL PROTECTED]
Cc: Matthew Wilcox [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/scsi/sym53c8xx_2/sym_glue.c |   15 +++
 drivers/scsi/sym53c8xx_2/sym_glue.h |1 +
 drivers/scsi/sym53c8xx_2/sym_hipd.c |   18 ++
 3 files changed, 30 insertions(+), 4 deletions(-)

diff -puN 
drivers/scsi/sym53c8xx_2/sym_glue.c~pci-error-recovery-symbios-scsi-first-failure
 drivers/scsi/sym53c8xx_2/sym_glue.c
--- 
a/drivers/scsi/sym53c8xx_2/sym_glue.c~pci-error-recovery-symbios-scsi-first-failure
+++ a/drivers/scsi/sym53c8xx_2/sym_glue.c
@@ -1926,6 +1926,20 @@ static pci_ers_result_t sym2_io_error_de
disable_irq(pdev-irq);
pci_disable_device(pdev);
 
+   /* Request that MMIO be enabled, so register dump can be taken. */
+   return PCI_ERS_RESULT_CAN_RECOVER;
+}
+
+/**
+ * sym2_io_slot_dump -- Enable MMIO and dump debug registers
+ * @pdev: pointer to PCI device
+ */
+static pci_ers_result_t sym2_io_slot_dump(struct pci_dev *pdev)
+{
+   struct sym_hcb *np = pci_get_drvdata(pdev);
+
+   sym_dump_registers(np);
+
/* Request a slot reset. */
return PCI_ERS_RESULT_NEED_RESET;
 }
@@ -2180,6 +2194,7 @@ MODULE_DEVICE_TABLE(pci, sym2_id_table);
 
 static struct pci_error_handlers sym2_err_handler = {
.error_detected = sym2_io_error_detected,
+   .mmio_enabled = sym2_io_slot_dump,
.slot_reset = sym2_io_slot_reset,
.resume = sym2_io_resume,
 };
diff -puN 
drivers/scsi/sym53c8xx_2/sym_glue.h~pci-error-recovery-symbios-scsi-first-failure
 drivers/scsi/sym53c8xx_2/sym_glue.h
--- 
a/drivers/scsi/sym53c8xx_2/sym_glue.h~pci-error-recovery-symbios-scsi-first-failure
+++ a/drivers/scsi/sym53c8xx_2/sym_glue.h
@@ -270,5 +270,6 @@ void sym_xpt_async_bus_reset(struct sym_
 void sym_xpt_async_sent_bdr(struct sym_hcb *np, int target);
 int  sym_setup_data_and_start (struct sym_hcb *np, struct scsi_cmnd *csio, 
struct sym_ccb *cp);
 void sym_log_bus_error(struct sym_hcb *np);
+void sym_dump_registers(struct sym_hcb *np);
 
 #endif /* SYM_GLUE_H */
diff -puN 
drivers/scsi/sym53c8xx_2/sym_hipd.c~pci-error-recovery-symbios-scsi-first-failure
 drivers/scsi/sym53c8xx_2/sym_hipd.c
--- 
a/drivers/scsi/sym53c8xx_2/sym_hipd.c~pci-error-recovery-symbios-scsi-first-failure
+++ a/drivers/scsi/sym53c8xx_2/sym_hipd.c
@@ -1180,10 +1180,10 @@ static void sym_log_hard_error(struct sy
scr_to_cpu((int) *(u32 *)(script_base + script_ofs)));
}
 
-printf (%s: regdump:, sym_name(np));
-for (i=0; i24;i++)
-printf ( %02x, (unsigned)INB_OFF(np, i));
-printf (.\n);
+   printf(%s: regdump:, sym_name(np));
+   for (i = 0; i  24; i++)
+   printf( %02x, (unsigned)INB_OFF(np, i));
+   printf(.\n);
 
/*
 *  PCI BUS error.
@@ -1192,6 +1192,16 @@ static void sym_log_hard_error(struct sy
sym_log_bus_error(np);
 }
 
+void sym_dump_registers(struct sym_hcb *np)
+{
+   u_short sist;
+   u_char dstat;
+
+   sist = INW(np, nc_sist);
+   dstat = INB(np, nc_dstat);
+   sym_log_hard_error(np, sist, dstat);
+}
+
 static struct sym_chip sym_dev_table[] = {
  {PCI_DEVICE_ID_NCR_53C810, 0x0f, 810, 4, 8, 4, 64,
  FE_ERL}
_
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 15/30] drivers/scsi/scsi_error.c should #include scsi_transport_api.h

2007-08-10 Thread akpm
From: Adrian Bunk [EMAIL PROTECTED]

Every file should #include the headers containing the prototypes for its
global functions (in this case for scsi_schedule_eh()).

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/scsi/scsi_error.c |1 +
 1 files changed, 1 insertion(+)

diff -puN drivers/scsi/scsi_error.c~drivers-scsi-scsi_errorc-should-include 
drivers/scsi/scsi_error.c
--- a/drivers/scsi/scsi_error.c~drivers-scsi-scsi_errorc-should-include
+++ a/drivers/scsi/scsi_error.c
@@ -37,6 +37,7 @@
 
 #include scsi_priv.h
 #include scsi_logging.h
+#include scsi_transport_api.h
 
 #define SENSE_TIMEOUT  (10*HZ)
 
_
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 11/30] drivers/scsi/g_NCR5380.c: NCR53C400_PSEUDO_DMA is not defined

2007-08-10 Thread akpm
From: Gabriel C [EMAIL PROTECTED]

Got this warning with current git:

...

In file included from drivers/scsi/g_NCR5380_mmio.c:9:
drivers/scsi/g_NCR5380.c:559:5: warning: NCR53C400_PSEUDO_DMA is not defined

...

Signed-off-by: Gabriel Craciunescu [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/scsi/g_NCR5380.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN 
drivers/scsi/g_NCR5380.c~drivers-scsi-g_ncr5380c-ncr53c400_pseudo_dma-is-not 
drivers/scsi/g_NCR5380.c
--- 
a/drivers/scsi/g_NCR5380.c~drivers-scsi-g_ncr5380c-ncr53c400_pseudo_dma-is-not
+++ a/drivers/scsi/g_NCR5380.c
@@ -556,7 +556,7 @@ generic_NCR5380_biosparam(struct scsi_de
 }
 #endif
 
-#if NCR53C400_PSEUDO_DMA
+#ifdef NCR53C400_PSEUDO_DMA
 
 /**
  * NCR5380_pread   -   pseudo DMA read
_
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 16/30] drivers/scsi/constants.c: make 2 functions static

2007-08-10 Thread akpm
From: Adrian Bunk [EMAIL PROTECTED]

This patch makes two needlessly global functions static.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/scsi/constants.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff -puN 
drivers/scsi/constants.c~drivers-scsi-constantsc-make-2-functions-static 
drivers/scsi/constants.c
--- a/drivers/scsi/constants.c~drivers-scsi-constantsc-make-2-functions-static
+++ a/drivers/scsi/constants.c
@@ -1235,7 +1235,7 @@ scsi_print_sense_hdr(const char *name, s
 }
 EXPORT_SYMBOL(scsi_print_sense_hdr);
 
-void
+static void
 scsi_decode_sense_buffer(const unsigned char *sense_buffer, int sense_len,
   struct scsi_sense_hdr *sshdr)
 {
@@ -1258,7 +1258,7 @@ scsi_decode_sense_buffer(const unsigned 
}
 }
 
-void
+static void
 scsi_decode_sense_extras(const unsigned char *sense_buffer, int sense_len,
 struct scsi_sense_hdr *sshdr)
 {
_
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 20/30] drivers/scsi/gdth.c: kmalloc + memset conversion to kzalloc

2007-08-10 Thread akpm
From: Mariusz Kozlowski [EMAIL PROTECTED]

 drivers/scsi/gdth.c | 189401 - 189342 (-59 bytes)
 drivers/scsi/gdth.o | 331028 - 330324 (-704 bytes)

Signed-off-by: Mariusz Kozlowski [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/scsi/gdth.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff -puN 
drivers/scsi/gdth.c~drivers-scsi-gdthc-kmalloc-memset-conversion-to-kzalloc 
drivers/scsi/gdth.c
--- 
a/drivers/scsi/gdth.c~drivers-scsi-gdthc-kmalloc-memset-conversion-to-kzalloc
+++ a/drivers/scsi/gdth.c
@@ -726,10 +726,10 @@ int __gdth_execute(struct scsi_device *s
 DECLARE_COMPLETION_ONSTACK(wait);
 int rval;
 
-scp = kmalloc(sizeof(*scp), GFP_KERNEL);
+scp = kzalloc(sizeof(*scp), GFP_KERNEL);
 if (!scp)
 return -ENOMEM;
-memset(scp, 0, sizeof(*scp));
+
 scp-device = sdev;
 /* use request field to save the ptr. to completion struct. */
 scp-request = (struct request *)wait;
_
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 28/30] Fix a potential NULL pointer deref in the aic7xxx, ahc_print_register() function

2007-08-10 Thread akpm
From: Jesper Juhl [EMAIL PROTECTED]

The Coverity checker noticed that we have a potential NULL pointer
deref in drivers/scsi/aic7xxx/aic7xxx_core.c::ahc_print_register().
This patch handles it by adding the same test against NULL that is
used elsewhere in the same function.

Signed-off-by: Jesper Juhl [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/scsi/aic7xxx/aic7xxx_core.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -puN 
drivers/scsi/aic7xxx/aic7xxx_core.c~fix-a-potential-null-pointer-deref-in-the-aic7xxx-ahc_print_register-function
 drivers/scsi/aic7xxx/aic7xxx_core.c
--- 
a/drivers/scsi/aic7xxx/aic7xxx_core.c~fix-a-potential-null-pointer-deref-in-the-aic7xxx-ahc_print_register-function
+++ a/drivers/scsi/aic7xxx/aic7xxx_core.c
@@ -6557,7 +6557,8 @@ ahc_print_register(ahc_reg_parse_entry_t
printed = printf(%s[0x%x], name, value);
if (table == NULL) {
printed += printf( );
-   *cur_column += printed;
+   if (cur_column != NULL)
+   *cur_column += printed;
return (printed);
}
printed_mask = 0;
_
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 24/30] drivers/scsi/megaraid.c: kmalloc + memset conversion to kzalloc

2007-08-10 Thread akpm
From: Mariusz Kozlowski [EMAIL PROTECTED]

This patch does kmalloc + memset conversion to kzalloc and adds missing check
for kzalloc return value.

 drivers/scsi/megaraid.c | 116109 - 116094 (-15 bytes)
 drivers/scsi/megaraid.o | 257872 - 257772 (-100 bytes)

Signed-off-by: Mariusz Kozlowski [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/scsi/megaraid.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff -puN 
drivers/scsi/megaraid.c~drivers-scsi-megaraidc-kmalloc-memset-conversion-to-kzalloc
 drivers/scsi/megaraid.c
--- 
a/drivers/scsi/megaraid.c~drivers-scsi-megaraidc-kmalloc-memset-conversion-to-kzalloc
+++ a/drivers/scsi/megaraid.c
@@ -4408,8 +4408,10 @@ mega_internal_command(adapter_t *adapter
scmd = adapter-int_scmd;
memset(scmd, 0, sizeof(Scsi_Cmnd));
 
-   sdev = kmalloc(sizeof(struct scsi_device), GFP_KERNEL);
-   memset(sdev, 0, sizeof(struct scsi_device));
+   sdev = kzalloc(sizeof(struct scsi_device), GFP_KERNEL);
+   if (!sdev)
+   return -ENOMEM;
+
scmd-device = sdev;
 
scmd-device-host = adapter-host;
_
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 19/30] drivers/scsi/bvme6000_scsi.c: kmalloc + memset conversion to kzalloc

2007-08-10 Thread akpm
From: Mariusz Kozlowski [EMAIL PROTECTED]

 drivers/scsi/bvme6000_scsi.c | 3330 - 3253 (-77 bytes)

Signed-off-by: Mariusz Kozlowski [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/scsi/bvme6000_scsi.c |7 +++
 1 files changed, 3 insertions(+), 4 deletions(-)

diff -puN 
drivers/scsi/bvme6000_scsi.c~drivers-scsi-bvme6000_scsic-kmalloc-memset-conversion-to-kzalloc
 drivers/scsi/bvme6000_scsi.c
--- 
a/drivers/scsi/bvme6000_scsi.c~drivers-scsi-bvme6000_scsic-kmalloc-memset-conversion-to-kzalloc
+++ a/drivers/scsi/bvme6000_scsi.c
@@ -36,19 +36,18 @@ static struct platform_device *bvme6000_
 static __devinit int
 bvme6000_probe(struct device *dev)
 {
-   struct Scsi_Host * host = NULL;
+   struct Scsi_Host *host;
struct NCR_700_Host_Parameters *hostdata;
 
if (!MACH_IS_BVME6000)
goto out;
 
-   hostdata = kmalloc(sizeof(struct NCR_700_Host_Parameters), GFP_KERNEL);
-   if (hostdata == NULL) {
+   hostdata = kzalloc(sizeof(struct NCR_700_Host_Parameters), GFP_KERNEL);
+   if (!hostdata) {
printk(KERN_ERR bvme6000-scsi: 
Failed to allocate host data\n);
goto out;
}
-   memset(hostdata, 0, sizeof(struct NCR_700_Host_Parameters));
 
/* Fill in the required pieces of hostdata */
hostdata-base = (void __iomem *)BVME_NCR53C710_BASE;
_
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 18/30] drivers/scsi/a4000t.c: kmalloc + memset conversion to kzalloc

2007-08-10 Thread akpm
From: Mariusz Kozlowski [EMAIL PROTECTED]

 drivers/scsi/a4000t.c | 3534 - 3457 (-77 bytes)

Signed-off-by: Mariusz Kozlowski [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/scsi/a4000t.c |7 +++
 1 files changed, 3 insertions(+), 4 deletions(-)

diff -puN 
drivers/scsi/a4000t.c~drivers-scsi-a4000tc-kmalloc-memset-conversion-to-kzalloc 
drivers/scsi/a4000t.c
--- 
a/drivers/scsi/a4000t.c~drivers-scsi-a4000tc-kmalloc-memset-conversion-to-kzalloc
+++ a/drivers/scsi/a4000t.c
@@ -37,7 +37,7 @@ static struct platform_device *a4000t_sc
 
 static int __devinit a4000t_probe(struct device *dev)
 {
-   struct Scsi_Host * host = NULL;
+   struct Scsi_Host *host;
struct NCR_700_Host_Parameters *hostdata;
 
if (!(MACH_IS_AMIGA  AMIGAHW_PRESENT(A4000_SCSI)))
@@ -47,12 +47,11 @@ static int __devinit a4000t_probe(struct
A4000T builtin SCSI))
goto out;
 
-   hostdata = kmalloc(sizeof(struct NCR_700_Host_Parameters), GFP_KERNEL);
-   if (hostdata == NULL) {
+   hostdata = kzalloc(sizeof(struct NCR_700_Host_Parameters), GFP_KERNEL);
+   if (!hostdata) {
printk(KERN_ERR a4000t-scsi: Failed to allocate host data\n);
goto out_release;
}
-   memset(hostdata, 0, sizeof(struct NCR_700_Host_Parameters));
 
/* Fill in the required pieces of hostdata */
hostdata-base = (void __iomem *)ZTWO_VADDR(A4000T_SCSI_ADDR);
_
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 12/30] Fix drivers/scsi/fdomain.c CONFIG_PCI=n warnings

2007-08-10 Thread akpm
From: Gabriel C [EMAIL PROTECTED]

I get this warnings on current git when CONFIG_PCI is not set :

drivers/scsi/fdomain.c:390: warning: 'PCI_dev' defined but not used
drivers/scsi/fdomain.c:1768: warning: 'fdomain_pci_tbl' defined but not used

Signed-off-by: Gabriel Craciunescu [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/scsi/fdomain.c |5 -
 1 files changed, 4 insertions(+), 1 deletion(-)

diff -puN 
drivers/scsi/fdomain.c~fix-drivers-scsi-fdomainc-config_pci=n-warnings 
drivers/scsi/fdomain.c
--- a/drivers/scsi/fdomain.c~fix-drivers-scsi-fdomainc-config_pci=n-warnings
+++ a/drivers/scsi/fdomain.c
@@ -387,7 +387,9 @@ static void __iomem *bios_mem;
 static int   bios_major;
 static int   bios_minor;
 static int   PCI_bus;
+#ifdef CONFIG_PCI
 static struct pci_dev  *PCI_dev;
+#endif
 static int   Quantum;  /* Quantum board variant */
 static int   interrupt_level;
 static volatile int  in_command;
@@ -1764,6 +1766,7 @@ struct scsi_host_template fdomain_driver
 };
 
 #ifndef PCMCIA
+#ifdef CONFIG_PCI
 
 static struct pci_device_id fdomain_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_FD, PCI_DEVICE_ID_FD_36C70,
@@ -1771,7 +1774,7 @@ static struct pci_device_id fdomain_pci_
{ }
 };
 MODULE_DEVICE_TABLE(pci, fdomain_pci_tbl);
-
+#endif
 #define driver_template fdomain_driver_template
 #include scsi_module.c
 
_
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 23/30] drivers/scsi/lpfc/lpfc_scsi.c: kmalloc + memset conversion to kzalloc

2007-08-10 Thread akpm
From: Mariusz Kozlowski [EMAIL PROTECTED]

 drivers/scsi/lpfc/lpfc_scsi.c | 42769 - 42721 (-48 bytes)
 drivers/scsi/lpfc/lpfc_scsi.o | 191332 - 191240 (-92 bytes)

Signed-off-by: Mariusz Kozlowski [EMAIL PROTECTED]
Acked-by: James Smart [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/scsi/lpfc/lpfc_scsi.c |3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)

diff -puN 
drivers/scsi/lpfc/lpfc_scsi.c~drivers-scsi-lpfc-lpfc_scsic-kmalloc-memset-conversion-to-kzalloc
 drivers/scsi/lpfc/lpfc_scsi.c
--- 
a/drivers/scsi/lpfc/lpfc_scsi.c~drivers-scsi-lpfc-lpfc_scsic-kmalloc-memset-conversion-to-kzalloc
+++ a/drivers/scsi/lpfc/lpfc_scsi.c
@@ -202,10 +202,9 @@ lpfc_new_scsi_buf(struct lpfc_vport *vpo
dma_addr_t pdma_phys;
uint16_t iotag;
 
-   psb = kmalloc(sizeof(struct lpfc_scsi_buf), GFP_KERNEL);
+   psb = kzalloc(sizeof(struct lpfc_scsi_buf), GFP_KERNEL);
if (!psb)
return NULL;
-   memset(psb, 0, sizeof (struct lpfc_scsi_buf));
 
/*
 * Get memory from the pci pool to map the virt space to pci bus space
_
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 21/30] drivers/scsi/lpfc/lpfc_debugfs.c: kmalloc + memset conversion to kcalloc

2007-08-10 Thread akpm
From: Mariusz Kozlowski [EMAIL PROTECTED]

 drivers/scsi/lpfc/lpfc_debugfs.c | 13809 - 13716 (-93 bytes)
 drivers/scsi/lpfc/lpfc_debugfs.o | 146124 - 146124 (0 bytes)

Signed-off-by: Mariusz Kozlowski [EMAIL PROTECTED]
Acked-by: James Smart [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/scsi/lpfc/lpfc_debugfs.c |4 +---
 1 files changed, 1 insertion(+), 3 deletions(-)

diff -puN 
drivers/scsi/lpfc/lpfc_debugfs.c~drivers-scsi-lpfc-lpfc_debugfsc-kmalloc-memset-conversion-to-kcalloc
 drivers/scsi/lpfc/lpfc_debugfs.c
--- 
a/drivers/scsi/lpfc/lpfc_debugfs.c~drivers-scsi-lpfc-lpfc_debugfsc-kmalloc-memset-conversion-to-kcalloc
+++ a/drivers/scsi/lpfc/lpfc_debugfs.c
@@ -901,7 +901,7 @@ lpfc_debugfs_initialize(struct lpfc_vpor
}
}
 
-   vport-disc_trc = kmalloc(
+   vport-disc_trc = kzalloc(
(sizeof(struct lpfc_debugfs_trc) * lpfc_debugfs_max_disc_trc),
GFP_KERNEL);
 
@@ -912,8 +912,6 @@ lpfc_debugfs_initialize(struct lpfc_vpor
goto debug_failed;
}
atomic_set(vport-disc_trc_cnt, 0);
-   memset(vport-disc_trc, 0,
-   (sizeof(struct lpfc_debugfs_trc) * lpfc_debugfs_max_disc_trc));
 
snprintf(name, sizeof(name), discovery_trace);
vport-debug_disc_trc =
_
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 22/30] drivers/scsi/lpfc/lpfc_init.c: kmalloc + memset conversion to kcalloc

2007-08-10 Thread akpm
From: Mariusz Kozlowski [EMAIL PROTECTED]

 drivers/scsi/lpfc/lpfc_init.c | 65932 - 65881 (-51 bytes)
 drivers/scsi/lpfc/lpfc_init.o | 219760 - 219616 (-144 bytes)

Signed-off-by: Mariusz Kozlowski [EMAIL PROTECTED]
Acked-by: James Smart [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/scsi/lpfc/lpfc_init.c |3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)

diff -puN 
drivers/scsi/lpfc/lpfc_init.c~drivers-scsi-lpfc-lpfc_initc-kmalloc-memset-conversion-to-kcalloc
 drivers/scsi/lpfc/lpfc_init.c
--- 
a/drivers/scsi/lpfc/lpfc_init.c~drivers-scsi-lpfc-lpfc_initc-kmalloc-memset-conversion-to-kcalloc
+++ a/drivers/scsi/lpfc/lpfc_init.c
@@ -1265,11 +1265,10 @@ lpfc_hba_init(struct lpfc_hba *phba, uin
uint32_t *HashWorking;
uint32_t *pwwnn = (uint32_t *) phba-wwnn;
 
-   HashWorking = kmalloc(80 * sizeof(uint32_t), GFP_KERNEL);
+   HashWorking = kcalloc(80, sizeof(uint32_t), GFP_KERNEL);
if (!HashWorking)
return;
 
-   memset(HashWorking, 0, (80 * sizeof(uint32_t)));
HashWorking[0] = HashWorking[78] = *pwwnn++;
HashWorking[1] = HashWorking[79] = *pwwnn;
 
_
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 13/30] nsp32_restart_autoscsi(): remove error check

2007-08-10 Thread akpm
From: Adrian Bunk [EMAIL PROTECTED]

The Coverity checker noted that we'll anyway Oops later when we ran into
this condition - and the error check didn't prevent that.

Considering that the error condition shouldn't be possible, and we are
not able to handle it easily, this patch simply removes the pointless
error check.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/scsi/nsp32.c |4 
 1 files changed, 4 deletions(-)

diff -puN drivers/scsi/nsp32.c~nsp32_restart_autoscsi-remove-error-check 
drivers/scsi/nsp32.c
--- a/drivers/scsi/nsp32.c~nsp32_restart_autoscsi-remove-error-check
+++ a/drivers/scsi/nsp32.c
@@ -1905,10 +1905,6 @@ static void nsp32_restart_autoscsi(struc
 
nsp32_dbg(NSP32_DEBUG_RESTART, enter);
 
-   if (data-cur_target == NULL || data-cur_lunt == NULL) {
-   nsp32_msg(KERN_ERR, Target or Lun is invalid);
-   }
-
/*
 * set SYNC_REG
 * Don't set BM_START_ADR before setting this register.
_
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 10/30] megaraid: add CERC_ATA100 support

2007-08-10 Thread akpm
From: Torsten Krah [EMAIL PROTECTED]

Taken from http://bugzilla.kernel.org/show_bug.cgi?id=6695

Add support for this device to the old megaraid driver.

Cc: Natalie Protasevich [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/scsi/megaraid.c |2 ++
 drivers/scsi/megaraid.h |2 ++
 2 files changed, 4 insertions(+)

diff -puN drivers/scsi/megaraid.c~megaraid-add-cerc_ata100-support 
drivers/scsi/megaraid.c
--- a/drivers/scsi/megaraid.c~megaraid-add-cerc_ata100-support
+++ a/drivers/scsi/megaraid.c
@@ -4967,6 +4967,8 @@ static struct pci_device_id megaraid_pci
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{PCI_VENDOR_ID_AMI, PCI_DEVICE_ID_AMI_MEGARAID2,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+   {PCI_VENDOR_ID_AMI, PCI_DEVICE_ID_AMI_MEGARAID3,
+   PCI_VENDOR_ID_DELL, PCI_SUBSYS_ID_CERC_ATA100, 0, 0, 0},
{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_AMI_MEGARAID3,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{0,}
diff -puN drivers/scsi/megaraid.h~megaraid-add-cerc_ata100-support 
drivers/scsi/megaraid.h
--- a/drivers/scsi/megaraid.h~megaraid-add-cerc_ata100-support
+++ a/drivers/scsi/megaraid.h
@@ -84,6 +84,8 @@
 #define LSI_SUBSYS_VID 0x1000
 #define INTEL_SUBSYS_VID   0x8086
 
+#define PCI_SUBSYS_ID_CERC_ATA100  0x0511
+
 #define HBA_SIGNATURE  0x3344
 #define HBA_SIGNATURE_471  0x
 #define HBA_SIGNATURE_64BIT0x0299
_
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 30/30] message/fusion: remove redundant memset

2007-08-10 Thread akpm
From: Mariusz Kozlowski [EMAIL PROTECTED]

alloc_fcdev() calls alloc_netdev() which uses kzalloc to alloc all the
memory together with dev-priv region hence no zeroing of structs inside
struct mpt_lan_priv needed.

Signed-off-by: Mariusz Kozlowski [EMAIL PROTECTED]
Cc: Moore, Eric Dean [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/message/fusion/mptlan.c |8 +++-
 1 files changed, 3 insertions(+), 5 deletions(-)

diff -puN 
drivers/message/fusion/mptlan.c~message-fusion-remove-redundant-memset 
drivers/message/fusion/mptlan.c
--- a/drivers/message/fusion/mptlan.c~message-fusion-remove-redundant-memset
+++ a/drivers/message/fusion/mptlan.c
@@ -1351,10 +1351,11 @@ mpt_lan_post_receive_buckets_work(struct
 static struct net_device *
 mpt_register_lan_device (MPT_ADAPTER *mpt_dev, int pnum)
 {
-   struct net_device *dev = alloc_fcdev(sizeof(struct mpt_lan_priv));
-   struct mpt_lan_priv *priv = NULL;
+   struct net_device *dev;
+   struct mpt_lan_priv *priv;
u8 HWaddr[FC_ALEN], *a;
 
+   dev = alloc_fcdev(sizeof(struct mpt_lan_priv));
if (!dev)
return NULL;
 
@@ -1366,7 +1367,6 @@ mpt_register_lan_device (MPT_ADAPTER *mp
priv-mpt_dev = mpt_dev;
priv-pnum = pnum;
 
-   memset(priv-post_buckets_task, 0, sizeof(priv-post_buckets_task));
INIT_DELAYED_WORK(priv-post_buckets_task,
  mpt_lan_post_receive_buckets_work);
priv-post_buckets_active = 0;
@@ -1391,8 +1391,6 @@ mpt_register_lan_device (MPT_ADAPTER *mp
spin_lock_init(priv-txfidx_lock);
spin_lock_init(priv-rxfidx_lock);
 
-   memset(priv-stats, 0, sizeof(priv-stats));
-
/*  Grab pre-fetched LANPage1 stuff. :-) */
a = (u8 *) mpt_dev-lan_cnfg_page1.HardwareAddressLow;
 
_
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 27/30] mpt-fusion: fix two potential mem leaks

2007-08-10 Thread akpm
From: Jesper Juhl [EMAIL PROTECTED]

The Coverity checker spotted two potential memory leaks in
drivers/message/fusion/mptbase.c::mpt_attach().

There are two returns that may leak the storage allocated for 'ioc'
(sizeof(MPT_ADAPTER) bytes).

A simple fix would be to simply add two kfree() calls before the return
statements, but a better fix (that this patch implements) is to reorder the
code so that if we hit the first return condition we don't have to do the
allocation at all and then just add a kfree() call for the second case.

Signed-off-by: Jesper Juhl [EMAIL PROTECTED]
Cc: Moore, Eric Dean [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/message/fusion/mptbase.c |   13 +++--
 1 files changed, 7 insertions(+), 6 deletions(-)

diff -puN 
drivers/message/fusion/mptbase.c~mpt-fusion-fix-two-potential-mem-leaks 
drivers/message/fusion/mptbase.c
--- a/drivers/message/fusion/mptbase.c~mpt-fusion-fix-two-potential-mem-leaks
+++ a/drivers/message/fusion/mptbase.c
@@ -1408,18 +1408,18 @@ mpt_attach(struct pci_dev *pdev, const s
struct proc_dir_entry *dent, *ent;
 #endif
 
+   if (mpt_debug_level)
+   printk(KERN_INFO MYNAM : mpt_debug_level=%xh\n, 
mpt_debug_level);
+
+   if (pci_enable_device(pdev))
+   return r;
+
ioc = kzalloc(sizeof(MPT_ADAPTER), GFP_ATOMIC);
if (ioc == NULL) {
printk(KERN_ERR MYNAM : ERROR - Insufficient memory to add 
adapter!\n);
return -ENOMEM;
}
-
ioc-debug_level = mpt_debug_level;
-   if (mpt_debug_level)
-   printk(KERN_INFO MYNAM : mpt_debug_level=%xh\n, 
mpt_debug_level);
-
-   if (pci_enable_device(pdev))
-   return r;
 
dinitprintk(ioc, printk(KERN_WARNING MYNAM : mpt_adapter_install\n));
 
@@ -1428,6 +1428,7 @@ mpt_attach(struct pci_dev *pdev, const s
: 64 BIT PCI BUS DMA ADDRESSING SUPPORTED\n));
} else if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
printk(KERN_WARNING MYNAM : 32 BIT PCI BUS DMA ADDRESSING NOT 
SUPPORTED\n);
+   kfree(ioc);
return r;
}
 
_
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 14/30] dtc: clean up indent damage and add printk levels

2007-08-10 Thread akpm
From: Alan Cox [EMAIL PROTECTED]

Signed-off-by: Alan Cox [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/scsi/dtc.c |   16 +++-
 1 files changed, 7 insertions(+), 9 deletions(-)

diff -puN drivers/scsi/dtc.c~dtc-clean-up-indent-damage-and-add-printk-levels 
drivers/scsi/dtc.c
--- a/drivers/scsi/dtc.c~dtc-clean-up-indent-damage-and-add-printk-levels
+++ a/drivers/scsi/dtc.c
@@ -137,11 +137,9 @@ static struct override {
 #ifdef OVERRIDE
 [] __initdata = OVERRIDE;
 #else
-[4] __initdata = { {
-0, IRQ_AUTO}, {
-0, IRQ_AUTO}, {
-0, IRQ_AUTO}, {
-0, IRQ_AUTO}};
+[4] __initdata = {
+   { 0, IRQ_AUTO }, { 0, IRQ_AUTO }, { 0, IRQ_AUTO }, { 0, IRQ_AUTO }
+};
 #endif
 
 #define NO_OVERRIDES ARRAY_SIZE(overrides)
@@ -176,7 +174,7 @@ static const struct signature {
  * Inputs : str - unused, ints - array of integer parameters with ints[0]
  * equal to the number of ints.
  *
-*/
+ */
 
 static void __init dtc_setup(char *str, int *ints)
 {
@@ -233,7 +231,7 @@ static int __init dtc_detect(struct scsi
} else
for (; !addr  (current_base  NO_BASES); 
++current_base) {
 #if (DTCDEBUG  DTCDEBUG_INIT)
-   printk(scsi-dtc : probing address %08x\n, 
bases[current_base].address);
+   printk(KERN_DEBUG scsi-dtc : probing address 
%08x\n, bases[current_base].address);
 #endif
if (bases[current_base].noauto)
continue;
@@ -244,7 +242,7 @@ static int __init dtc_detect(struct scsi
if (check_signature(base + 
signatures[sig].offset, signatures[sig].string, 
strlen(signatures[sig].string))) {
addr = 
bases[current_base].address;
 #if (DTCDEBUG  DTCDEBUG_INIT)
-   printk(scsi-dtc : detected 
board.\n);
+   printk(KERB_DEBUG scsi-dtc : 
detected board.\n);
 #endif
goto found;
}
@@ -253,7 +251,7 @@ static int __init dtc_detect(struct scsi
}
 
 #if defined(DTCDEBUG)  (DTCDEBUG  DTCDEBUG_INIT)
-   printk(scsi-dtc : base = %08x\n, addr);
+   printk(KERN_DEBUG scsi-dtc : base = %08x\n, addr);
 #endif
 
if (!addr)
_
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 17/30] Use mutex instead of semaphore in the OnStream SCSI Tape driver

2007-08-10 Thread akpm
From: Matthias Kaehlcke [EMAIL PROTECTED]

The OnStream SCSI Tape driver uses a semaphore as mutex.  Use the mutex API
instead of the (binary) semaphore.

Signed-off-by: Matthias Kaehlcke [EMAIL PROTECTED]
Reviewed-by: Satyam Sharma [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/scsi/osst.c |   16 
 drivers/scsi/osst.h |3 ++-
 2 files changed, 10 insertions(+), 9 deletions(-)

diff -puN 
drivers/scsi/osst.c~use-mutex-instead-of-semaphore-in-the-onstream-scsi-tape-driver
 drivers/scsi/osst.c
--- 
a/drivers/scsi/osst.c~use-mutex-instead-of-semaphore-in-the-onstream-scsi-tape-driver
+++ a/drivers/scsi/osst.c
@@ -3298,7 +3298,7 @@ static ssize_t osst_write(struct file * 
char* name = tape_name(STp);
 
 
-   if (down_interruptible(STp-lock))
+   if (mutex_lock_interruptible(STp-lock))
return (-ERESTARTSYS);
 
/*
@@ -3600,7 +3600,7 @@ if (SRpnt) printk(KERN_ERR %s:A: Not su
 out:
if (SRpnt != NULL) osst_release_request(SRpnt);
 
-   up(STp-lock);
+   mutex_unlock(STp-lock);
 
return retval;
 }
@@ -3619,7 +3619,7 @@ static ssize_t osst_read(struct file * f
char* name  = tape_name(STp);
 
 
-   if (down_interruptible(STp-lock))
+   if (mutex_lock_interruptible(STp-lock))
return (-ERESTARTSYS);
 
/*
@@ -3785,7 +3785,7 @@ static ssize_t osst_read(struct file * f
 out:
if (SRpnt != NULL) osst_release_request(SRpnt);
 
-   up(STp-lock);
+   mutex_unlock(STp-lock);
 
return retval;
 }
@@ -4852,7 +4852,7 @@ static int osst_ioctl(struct inode * ino
char* name  = tape_name(STp);
void__user  * p = (void __user *)arg;
 
-   if (down_interruptible(STp-lock))
+   if (mutex_lock_interruptible(STp-lock))
return -ERESTARTSYS;
 
 #if DEBUG
@@ -5163,14 +5163,14 @@ static int osst_ioctl(struct inode * ino
}
if (SRpnt) osst_release_request(SRpnt);
 
-   up(STp-lock);
+   mutex_unlock(STp-lock);
 
return scsi_ioctl(STp-device, cmd_in, p);
 
 out:
if (SRpnt) osst_release_request(SRpnt);
 
-   up(STp-lock);
+   mutex_unlock(STp-lock);
 
return retval;
 }
@@ -5866,7 +5866,7 @@ static int osst_probe(struct device *dev
tpnt-modes[2].defined = 1;
tpnt-density_changed = tpnt-compression_changed = 
tpnt-blksize_changed = 0;
 
-   init_MUTEX(tpnt-lock);
+   mutex_init(tpnt-lock);
osst_nr_dev++;
write_unlock(os_scsi_tapes_lock);
 
diff -puN 
drivers/scsi/osst.h~use-mutex-instead-of-semaphore-in-the-onstream-scsi-tape-driver
 drivers/scsi/osst.h
--- 
a/drivers/scsi/osst.h~use-mutex-instead-of-semaphore-in-the-onstream-scsi-tape-driver
+++ a/drivers/scsi/osst.h
@@ -4,6 +4,7 @@
 
 #include asm/byteorder.h
 #include linux/completion.h
+#include linux/mutex.h
 
 /* FIXME - rename and use the following two types or delete them!
  *  and the types really should go to st.h anyway...
@@ -532,7 +533,7 @@ struct osst_tape {
   struct scsi_driver *driver;
   unsigned capacity;
   struct scsi_device *device;
-  struct semaphore lock;   /* for serialization */
+  struct mutex lock;   /* for serialization */
   struct completion wait;  /* for SCSI commands */
   struct osst_buffer * buffer;
 
_
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [patch 24/30] drivers/scsi/megaraid.c: kmalloc + memset conversion to kzalloc

2007-08-10 Thread Patro, Sumant
ACK.

--Sumant
 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Friday, August 10, 2007 2:51 PM
To: [EMAIL PROTECTED]
Cc: linux-scsi@vger.kernel.org; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: [patch 24/30] drivers/scsi/megaraid.c: kmalloc + memset
conversion to kzalloc

From: Mariusz Kozlowski [EMAIL PROTECTED]

This patch does kmalloc + memset conversion to kzalloc and adds missing
check for kzalloc return value.

 drivers/scsi/megaraid.c | 116109 - 116094 (-15 bytes)
drivers/scsi/megaraid.o | 257872 - 257772 (-100 bytes)

Signed-off-by: Mariusz Kozlowski [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/scsi/megaraid.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff -puN
drivers/scsi/megaraid.c~drivers-scsi-megaraidc-kmalloc-memset-conversion
-to-kzalloc drivers/scsi/megaraid.c
---
a/drivers/scsi/megaraid.c~drivers-scsi-megaraidc-kmalloc-memset-conversi
on-to-kzalloc
+++ a/drivers/scsi/megaraid.c
@@ -4408,8 +4408,10 @@ mega_internal_command(adapter_t *adapter
scmd = adapter-int_scmd;
memset(scmd, 0, sizeof(Scsi_Cmnd));
 
-   sdev = kmalloc(sizeof(struct scsi_device), GFP_KERNEL);
-   memset(sdev, 0, sizeof(struct scsi_device));
+   sdev = kzalloc(sizeof(struct scsi_device), GFP_KERNEL);
+   if (!sdev)
+   return -ENOMEM;
+
scmd-device = sdev;
 
scmd-device-host = adapter-host;
_
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED] More majordomo info
at  http://vger.kernel.org/majordomo-info.html
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 10/30] megaraid: add CERC_ATA100 support

2007-08-10 Thread Andrew Morton
On Fri, 10 Aug 2007 16:20:54 -0600
Patro, Sumant [EMAIL PROTECTED] wrote:

 ID being added is already supported in megaraid_mbox driver.

umm, why should that cause us to avoid supporting it in the old driver?
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Partition information lost on reboot.

2007-08-10 Thread Rene Herman

On 08/10/2007 02:30 PM, Michal Piotrowski wrote:


[Adding linux-scsi and Adaptec support to CC]

On 10/08/07, Jegadeesh [EMAIL PROTECTED] wrote:

Hi,

I have a scsi disk on Adaptec ASC-29320 U320. I have created a linux
partition and ext3 filesystem over it.
Now the problem is, whenever the machine is rebooted, the partition
information to the OS is lost and I get an error saying it as a not valid
block device.
But fdisk tool shows the partitions, but cat /proc/partitions doesnt have
this. I need to do a partprobe and then have to mount it explicitly.

What could be causing this problem. Given below are some of the command
outputs.


Is that the Adaptec AIC79xx U320 support (CONFIG_SCSI_AIC79XX) driver? If 
so, did you lower the Initial bus reset delay (default is 5000 ms) in the 
kernel configuration?


Rene.
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [patch 10/30] megaraid: add CERC_ATA100 support

2007-08-10 Thread Patro, Sumant
 

 -Original Message-
 From: Andrew Morton [mailto:[EMAIL PROTECTED] 
 Sent: Friday, August 10, 2007 3:36 PM
 To: Patro, Sumant
 Cc: [EMAIL PROTECTED]; linux-scsi@vger.kernel.org; 
 [EMAIL PROTECTED]; [EMAIL PROTECTED]; 
 Kolli, Neela; Yang, Bo
 Subject: Re: [patch 10/30] megaraid: add CERC_ATA100 support
 
 On Fri, 10 Aug 2007 16:20:54 -0600
 Patro, Sumant [EMAIL PROTECTED] wrote:
 
  ID being added is already supported in megaraid_mbox driver.
 
 umm, why should that cause us to avoid supporting it in the 
 old driver?
 

With overlapping ids it will be indeterminate which one (megaraid
legacy/mbox) claims the device.
All overlapping IDS were removed from megaraid legacy/megaraid_mbox
driver about 2 years back.  

--Sumant
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 20/30] drivers/scsi/gdth.c: kmalloc + memset conversion to kzalloc

2007-08-10 Thread James Bottomley
On Fri, 2007-08-10 at 14:50 -0700, [EMAIL PROTECTED] wrote:
 From: Mariusz Kozlowski [EMAIL PROTECTED]
 
  drivers/scsi/gdth.c | 189401 - 189342 (-59 bytes)
  drivers/scsi/gdth.o | 331028 - 330324 (-704 bytes)

For the second time of asking, could I just have a single patch doing
this globally for the entirety of SCSI with reasonable assurance of
mechanical checking.

There's no real need to collect maintainer acks for something as trivial
as this.

James


-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 05/30] drivers/scsi/pcmcia/nsp_cs.c: remove kernel 2.4 code

2007-08-10 Thread James Bottomley
On Fri, 2007-08-10 at 14:50 -0700, [EMAIL PROTECTED] wrote:
 From: Adrian Bunk [EMAIL PROTECTED]

You're not just removing the 2.4 code ... you're also removing the rcs
tags ... that's OK if the maintainer is fine with this, but it would
help to say this in the change log.

James


-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 13/30] nsp32_restart_autoscsi(): remove error check

2007-08-10 Thread James Bottomley
On Fri, 2007-08-10 at 14:50 -0700, [EMAIL PROTECTED] wrote:
 From: Adrian Bunk [EMAIL PROTECTED]
 
 The Coverity checker noted that we'll anyway Oops later when we ran into
 this condition - and the error check didn't prevent that.
 
 Considering that the error condition shouldn't be possible, and we are
 not able to handle it easily, this patch simply removes the pointless
 error check.
 
 Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Signed-off-by: Andrew Morton [EMAIL PROTECTED]
 ---
 
  drivers/scsi/nsp32.c |4 
  1 files changed, 4 deletions(-)
 
 diff -puN drivers/scsi/nsp32.c~nsp32_restart_autoscsi-remove-error-check 
 drivers/scsi/nsp32.c
 --- a/drivers/scsi/nsp32.c~nsp32_restart_autoscsi-remove-error-check
 +++ a/drivers/scsi/nsp32.c
 @@ -1905,10 +1905,6 @@ static void nsp32_restart_autoscsi(struc
  
   nsp32_dbg(NSP32_DEBUG_RESTART, enter);
  
 - if (data-cur_target == NULL || data-cur_lunt == NULL) {
 - nsp32_msg(KERN_ERR, Target or Lun is invalid);
 - }
 -

I disagree pretty strongly with this ... you're not removing an error
check, you're removing a warning printk.  Before the driver would say
what the problem is and oops.  After, it will oops and you won't
necessarily know why.  I think that's a retrograde step.

James


-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 10/30] megaraid: add CERC_ATA100 support

2007-08-10 Thread James Bottomley
On Fri, 2007-08-10 at 15:36 -0700, Andrew Morton wrote:
 On Fri, 10 Aug 2007 16:20:54 -0600
 Patro, Sumant [EMAIL PROTECTED] wrote:
 
  ID being added is already supported in megaraid_mbox driver.
 
 umm, why should that cause us to avoid supporting it in the old driver?

Because we'll have the identical ID exported from two drivers and the
automatic matching logic in the bootloaders will get confused.

If there's evidence that megaraid_mbox doesn't work for this, then we
can move the id across, but really the legacy megaraid driver isn't very
well maintained at this point so its in our interest to move as many
devices as possible to it not away.

James


-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 05/30] drivers/scsi/pcmcia/nsp_cs.c: remove kernel 2.4 code

2007-08-10 Thread Adrian Bunk
On Fri, Aug 10, 2007 at 09:01:59PM -0400, James Bottomley wrote:
 On Fri, 2007-08-10 at 14:50 -0700, [EMAIL PROTECTED] wrote:
  From: Adrian Bunk [EMAIL PROTECTED]
 
 You're not just removing the 2.4 code ... you're also removing the rcs
 tags ... that's OK if the maintainer is fine with this, but it would
 help to say this in the change log.

It was in the patch description when I sent the patch [1, 2], but it 
seems the patch description got lost somewhere.

 James

cu
Adrian

[1] http://lkml.org/lkml/2007/3/26/2
[2] http://lkml.org/lkml/2007/4/26/654

-- 

   Is there not promise of rain? Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
   Only a promise, Lao Er said.
   Pearl S. Buck - Dragon Seed

-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 13/30] nsp32_restart_autoscsi(): remove error check

2007-08-10 Thread Adrian Bunk
On Fri, Aug 10, 2007 at 09:03:52PM -0400, James Bottomley wrote:
 On Fri, 2007-08-10 at 14:50 -0700, [EMAIL PROTECTED] wrote:
  From: Adrian Bunk [EMAIL PROTECTED]
  
  The Coverity checker noted that we'll anyway Oops later when we ran into
  this condition - and the error check didn't prevent that.
  
  Considering that the error condition shouldn't be possible, and we are
  not able to handle it easily, this patch simply removes the pointless
  error check.
  
  Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
  Cc: [EMAIL PROTECTED]
  Signed-off-by: Andrew Morton [EMAIL PROTECTED]
  ---
  
   drivers/scsi/nsp32.c |4 
   1 files changed, 4 deletions(-)
  
  diff -puN drivers/scsi/nsp32.c~nsp32_restart_autoscsi-remove-error-check 
  drivers/scsi/nsp32.c
  --- a/drivers/scsi/nsp32.c~nsp32_restart_autoscsi-remove-error-check
  +++ a/drivers/scsi/nsp32.c
  @@ -1905,10 +1905,6 @@ static void nsp32_restart_autoscsi(struc
   
  nsp32_dbg(NSP32_DEBUG_RESTART, enter);
   
  -   if (data-cur_target == NULL || data-cur_lunt == NULL) {
  -   nsp32_msg(KERN_ERR, Target or Lun is invalid);
  -   }
  -
 
 I disagree pretty strongly with this ... you're not removing an error
 check, you're removing a warning printk.  Before the driver would say
 what the problem is and oops.  After, it will oops and you won't
 necessarily know why.  I think that's a retrograde step.

Target or Lun is invalid isn't a precise problem description either.

But the main point is:

An Oops indicates a programming error in the kernel (or kernel 
corruption), and for this purpose an Oops is a good error message.

We can't put printk()'s in front of all pointer dereferences in the 
kernel.

Is there any legal way how any of these could be NULL at this point?
My impression was there isn't.
But if there is we don't need only a printk(), we'd need an error 
handling that returns from the function without Oops'ing plus an error 
handling in the caller.

 James

cu
Adrian

-- 

   Is there not promise of rain? Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
   Only a promise, Lao Er said.
   Pearl S. Buck - Dragon Seed

-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html