* [PATCH 2/2] cciss: fix regression in procfs display fw version, obsoletes previous patch 2 of 2 @ 2008-10-16 21:50 Mike Miller 2008-10-16 21:56 ` Andrew Morton 0 siblings, 1 reply; 6+ messages in thread From: Mike Miller @ 2008-10-16 21:50 UTC (permalink / raw) To: Andrew Morton, JensAxboejens.axboe; +Cc: LKML, LKML-scsi Patch 2 of 2 This patch obsoletes patch 2/2 from yesterday. It fixes a regression in procfs where the controller firmware version is not displayed. The previous patch also addressed the problem but the code would be called whenever anything changed on the array such as the number of logical volumes, etc. This patch only gets called once for each controller. Please consider this for inclusion. Signed-of-by: Mike Miller <mike.miller@hp.com> diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 0f367b1..efa5414 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c @@ -3404,7 +3404,8 @@ static int __devinit cciss_init_one(struct pci_dev *pdev, int i; int j = 0; int rc; - int dac; + int dac, return_code; + InquiryData_struct *inq_buff = NULL; i = alloc_cciss_hba(); if (i < 0) @@ -3510,6 +3511,25 @@ static int __devinit cciss_init_one(struct pci_dev *pdev, /* Turn the interrupts on so we can service requests */ hba[i]->access.set_intr_mask(hba[i], CCISS_INTR_ON); + /* Get the firmware version */ + inq_buff = kzalloc(sizeof(InquiryData_struct), GFP_KERNEL); + if (inq_buff == NULL) { + printk(KERN_ERR "cciss: out of memory\n"); + return ENOMEM; + } + + return_code = sendcmd_withirq(CISS_INQUIRY, i, inq_buff, + sizeof(InquiryData_struct), 0, 0 ,0, TYPE_CMD); + if (return_code == IO_OK) { + hba[i]->firm_ver[0] = inq_buff->data_byte[32]; + hba[i]->firm_ver[1] = inq_buff->data_byte[33]; + hba[i]->firm_ver[2] = inq_buff->data_byte[34]; + hba[i]->firm_ver[3] = inq_buff->data_byte[35]; + } else { /* send command failed */ + printk(KERN_WARNING "cciss: unable to determine firmware" + " version of controller\n"); + } + cciss_procinit(i); hba[i]->cciss_max_sectors = 2048; ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] cciss: fix regression in procfs display fw version, obsoletes previous patch 2 of 2 2008-10-16 21:50 [PATCH 2/2] cciss: fix regression in procfs display fw version, obsoletes previous patch 2 of 2 Mike Miller @ 2008-10-16 21:56 ` Andrew Morton 2008-10-16 22:21 ` Miller, Mike (OS Dev) 0 siblings, 1 reply; 6+ messages in thread From: Andrew Morton @ 2008-10-16 21:56 UTC (permalink / raw) To: Mike Miller; +Cc: JensAxboejens.axboe, linux-kernel, linux-scsi On Thu, 16 Oct 2008 16:50:16 -0500 Mike Miller <mike.miller@hp.com> wrote: > > Patch 2 of 2 > > This patch obsoletes patch 2/2 from yesterday. It fixes a regression in > procfs where the controller firmware version is not displayed. The previous > patch also addressed the problem but the code would be called whenever > anything changed on the array such as the number of logical volumes, etc. > This patch only gets called once for each controller. > Please consider this for inclusion. > Again, this description doesn't contain enough information for us to work out which kernels need patching. > > diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c > index 0f367b1..efa5414 100644 > --- a/drivers/block/cciss.c > +++ b/drivers/block/cciss.c > @@ -3404,7 +3404,8 @@ static int __devinit cciss_init_one(struct pci_dev *pdev, > int i; > int j = 0; > int rc; > - int dac; > + int dac, return_code; > + InquiryData_struct *inq_buff = NULL; This initialisation is not needed. > i = alloc_cciss_hba(); > if (i < 0) > @@ -3510,6 +3511,25 @@ static int __devinit cciss_init_one(struct pci_dev *pdev, > /* Turn the interrupts on so we can service requests */ > hba[i]->access.set_intr_mask(hba[i], CCISS_INTR_ON); > > + /* Get the firmware version */ > + inq_buff = kzalloc(sizeof(InquiryData_struct), GFP_KERNEL); > + if (inq_buff == NULL) { > + printk(KERN_ERR "cciss: out of memory\n"); Whitespace is all screwed up. > + return ENOMEM; Should be -ENOMEM. > + } > + > + return_code = sendcmd_withirq(CISS_INQUIRY, i, inq_buff, > + sizeof(InquiryData_struct), 0, 0 ,0, TYPE_CMD); > + if (return_code == IO_OK) { > + hba[i]->firm_ver[0] = inq_buff->data_byte[32]; > + hba[i]->firm_ver[1] = inq_buff->data_byte[33]; > + hba[i]->firm_ver[2] = inq_buff->data_byte[34]; > + hba[i]->firm_ver[3] = inq_buff->data_byte[35]; > + } else { /* send command failed */ > + printk(KERN_WARNING "cciss: unable to determine firmware" > + " version of controller\n"); > + } > + > cciss_procinit(i); > > hba[i]->cciss_max_sectors = 2048; ^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH 2/2] cciss: fix regression in procfs display fw version, obsoletes previous patch 2 of 2 2008-10-16 21:56 ` Andrew Morton @ 2008-10-16 22:21 ` Miller, Mike (OS Dev) 2008-10-16 22:32 ` Alexey Dobriyan 0 siblings, 1 reply; 6+ messages in thread From: Miller, Mike (OS Dev) @ 2008-10-16 22:21 UTC (permalink / raw) To: Andrew Morton Cc: Jens Axboe, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org > -----Original Message----- > From: Andrew Morton [mailto:akpm@linux-foundation.org] > Sent: Thursday, October 16, 2008 4:57 PM > To: Miller, Mike (OS Dev) > Cc: JensAxboejens.axboe@oracle.com; > linux-kernel@vger.kernel.org; linux-scsi@vger.kernel.org > Subject: Re: [PATCH 2/2] cciss: fix regression in procfs > display fw version, obsoletes previous patch 2 of 2 > > On Thu, 16 Oct 2008 16:50:16 -0500 > Mike Miller <mike.miller@hp.com> wrote: > > > > > Patch 2 of 2 > > > > This patch obsoletes patch 2/2 from yesterday. It fixes a > regression > > in procfs where the controller firmware version is not > displayed. The > > previous patch also addressed the problem but the code > would be called > > whenever anything changed on the array such as the number > of logical volumes, etc. > > This patch only gets called once for each controller. > > Please consider this for inclusion. > > > > Again, this description doesn't contain enough information > for us to work out which kernels need patching. > > > > > diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index > > 0f367b1..efa5414 100644 > > --- a/drivers/block/cciss.c > > +++ b/drivers/block/cciss.c > > @@ -3404,7 +3404,8 @@ static int __devinit > cciss_init_one(struct pci_dev *pdev, > > int i; > > int j = 0; > > int rc; > > - int dac; > > + int dac, return_code; > > + InquiryData_struct *inq_buff = NULL; > > This initialisation is not needed. > > > i = alloc_cciss_hba(); > > if (i < 0) > > @@ -3510,6 +3511,25 @@ static int __devinit > cciss_init_one(struct pci_dev *pdev, > > /* Turn the interrupts on so we can service requests */ > > hba[i]->access.set_intr_mask(hba[i], CCISS_INTR_ON); > > > > + /* Get the firmware version */ > > + inq_buff = kzalloc(sizeof(InquiryData_struct), GFP_KERNEL); > > + if (inq_buff == NULL) { > > + printk(KERN_ERR "cciss: out of memory\n"); > > Whitespace is all screwed up. > > > + return ENOMEM; > > Should be -ENOMEM. > > > + } > > + > > + return_code = sendcmd_withirq(CISS_INQUIRY, i, inq_buff, > > + sizeof(InquiryData_struct), 0, 0 ,0, TYPE_CMD); > > + if (return_code == IO_OK) { > > + hba[i]->firm_ver[0] = inq_buff->data_byte[32]; > > + hba[i]->firm_ver[1] = inq_buff->data_byte[33]; > > + hba[i]->firm_ver[2] = inq_buff->data_byte[34]; > > + hba[i]->firm_ver[3] = inq_buff->data_byte[35]; > > + } else { /* send command failed */ > > + printk(KERN_WARNING "cciss: unable to > determine firmware" > > + " version of controller\n"); > > + } > > + > > cciss_procinit(i); > > > > hba[i]->cciss_max_sectors = 2048; Sorry, in too much of a hurry. I'll fix (again). mikem > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] cciss: fix regression in procfs display fw version, obsoletes previous patch 2 of 2 2008-10-16 22:21 ` Miller, Mike (OS Dev) @ 2008-10-16 22:32 ` Alexey Dobriyan 2008-10-16 22:56 ` Miller, Mike (OS Dev) 0 siblings, 1 reply; 6+ messages in thread From: Alexey Dobriyan @ 2008-10-16 22:32 UTC (permalink / raw) To: Miller, Mike (OS Dev) Cc: Andrew Morton, Jens Axboe, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org On Thu, Oct 16, 2008 at 10:21:22PM +0000, Miller, Mike (OS Dev) wrote: > > > > -----Original Message----- > > From: Andrew Morton [mailto:akpm@linux-foundation.org] > > Sent: Thursday, October 16, 2008 4:57 PM > > To: Miller, Mike (OS Dev) > > Cc: JensAxboejens.axboe@oracle.com; > > linux-kernel@vger.kernel.org; linux-scsi@vger.kernel.org > > Subject: Re: [PATCH 2/2] cciss: fix regression in procfs > > display fw version, obsoletes previous patch 2 of 2 > > > > On Thu, 16 Oct 2008 16:50:16 -0500 > > Mike Miller <mike.miller@hp.com> wrote: > > > > > > > > Patch 2 of 2 > > > > > > This patch obsoletes patch 2/2 from yesterday. It fixes a > > regression > > > in procfs where the controller firmware version is not > > displayed. The > > > previous patch also addressed the problem but the code > > would be called > > > whenever anything changed on the array such as the number > > of logical volumes, etc. > > > This patch only gets called once for each controller. > > > Please consider this for inclusion. > > > > > > > Again, this description doesn't contain enough information > > for us to work out which kernels need patching. > > > > > > > > diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index > > > 0f367b1..efa5414 100644 > > > --- a/drivers/block/cciss.c > > > +++ b/drivers/block/cciss.c > > > @@ -3404,7 +3404,8 @@ static int __devinit > > cciss_init_one(struct pci_dev *pdev, > > > int i; > > > int j = 0; > > > int rc; > > > - int dac; > > > + int dac, return_code; > > > + InquiryData_struct *inq_buff = NULL; > > > > This initialisation is not needed. > > > > > i = alloc_cciss_hba(); > > > if (i < 0) > > > @@ -3510,6 +3511,25 @@ static int __devinit > > cciss_init_one(struct pci_dev *pdev, > > > /* Turn the interrupts on so we can service requests */ > > > hba[i]->access.set_intr_mask(hba[i], CCISS_INTR_ON); > > > > > > + /* Get the firmware version */ > > > + inq_buff = kzalloc(sizeof(InquiryData_struct), GFP_KERNEL); > > > + if (inq_buff == NULL) { > > > + printk(KERN_ERR "cciss: out of memory\n"); > > > > Whitespace is all screwed up. > > > > > + return ENOMEM; > > > > Should be -ENOMEM. > > > > > + } > > > + > > > + return_code = sendcmd_withirq(CISS_INQUIRY, i, inq_buff, > > > + sizeof(InquiryData_struct), 0, 0 ,0, TYPE_CMD); > > > + if (return_code == IO_OK) { > > > + hba[i]->firm_ver[0] = inq_buff->data_byte[32]; > > > + hba[i]->firm_ver[1] = inq_buff->data_byte[33]; > > > + hba[i]->firm_ver[2] = inq_buff->data_byte[34]; > > > + hba[i]->firm_ver[3] = inq_buff->data_byte[35]; > > > + } else { /* send command failed */ > > > + printk(KERN_WARNING "cciss: unable to > > determine firmware" > > > + " version of controller\n"); > > > + } > > > + > > > cciss_procinit(i); > > > > > > hba[i]->cciss_max_sectors = 2048; > > Sorry, in too much of a hurry. I'll fix (again). And inq_buff is leaked, if I'm not missing simething. ^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH 2/2] cciss: fix regression in procfs display fw version, obsoletes previous patch 2 of 2 2008-10-16 22:32 ` Alexey Dobriyan @ 2008-10-16 22:56 ` Miller, Mike (OS Dev) 2008-10-16 23:17 ` Alexey Dobriyan 0 siblings, 1 reply; 6+ messages in thread From: Miller, Mike (OS Dev) @ 2008-10-16 22:56 UTC (permalink / raw) To: Alexey Dobriyan Cc: Andrew Morton, Jens Axboe, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org > > > + return_code = sendcmd_withirq(CISS_INQUIRY, i, inq_buff, > > > > + sizeof(InquiryData_struct), 0, 0 ,0, TYPE_CMD); > > > > + if (return_code == IO_OK) { > > > > + hba[i]->firm_ver[0] = inq_buff->data_byte[32]; > > > > + hba[i]->firm_ver[1] = inq_buff->data_byte[33]; > > > > + hba[i]->firm_ver[2] = inq_buff->data_byte[34]; > > > > + hba[i]->firm_ver[3] = inq_buff->data_byte[35]; > > > > + } else { /* send command failed */ > > > > + printk(KERN_WARNING "cciss: unable to > > > determine firmware" > > > > + " version of controller\n"); > > > > + } > > > > + > > > > cciss_procinit(i); > > > > > > > > hba[i]->cciss_max_sectors = 2048; > > > > Sorry, in too much of a hurry. I'll fix (again). > > And inq_buff is leaked, if I'm not missing simething. > Sorry, Alexy, I can't see the leak. Is it in the failure case? ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] cciss: fix regression in procfs display fw version, obsoletes previous patch 2 of 2 2008-10-16 22:56 ` Miller, Mike (OS Dev) @ 2008-10-16 23:17 ` Alexey Dobriyan 0 siblings, 0 replies; 6+ messages in thread From: Alexey Dobriyan @ 2008-10-16 23:17 UTC (permalink / raw) To: Miller, Mike (OS Dev) Cc: Andrew Morton, Jens Axboe, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org On Thu, Oct 16, 2008 at 10:56:58PM +0000, Miller, Mike (OS Dev) wrote: > > > > + return_code = sendcmd_withirq(CISS_INQUIRY, i, inq_buff, > > > > > + sizeof(InquiryData_struct), 0, 0 ,0, TYPE_CMD); > > > > > + if (return_code == IO_OK) { > > > > > + hba[i]->firm_ver[0] = inq_buff->data_byte[32]; > > > > > + hba[i]->firm_ver[1] = inq_buff->data_byte[33]; > > > > > + hba[i]->firm_ver[2] = inq_buff->data_byte[34]; > > > > > + hba[i]->firm_ver[3] = inq_buff->data_byte[35]; > > > > > + } else { /* send command failed */ > > > > > + printk(KERN_WARNING "cciss: unable to > > > > determine firmware" > > > > > + " version of controller\n"); > > > > > + } > > > > > + > > > > > cciss_procinit(i); > > > > > > > > > > hba[i]->cciss_max_sectors = 2048; > > > > > > Sorry, in too much of a hurry. I'll fix (again). > > > > And inq_buff is leaked, if I'm not missing simething. > > > Sorry, Alexy, I can't see the leak. Is it in the failure case? Where "inq_buff" is freed? ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-10-16 23:14 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-10-16 21:50 [PATCH 2/2] cciss: fix regression in procfs display fw version, obsoletes previous patch 2 of 2 Mike Miller 2008-10-16 21:56 ` Andrew Morton 2008-10-16 22:21 ` Miller, Mike (OS Dev) 2008-10-16 22:32 ` Alexey Dobriyan 2008-10-16 22:56 ` Miller, Mike (OS Dev) 2008-10-16 23:17 ` Alexey Dobriyan
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox