* [KJ] [PATCH] drivers/scsi/qlogicfc.c: It's changes pci_find_device
@ 2005-07-07 1:05 Rodrigo P. do Nascimento
2005-07-07 19:01 ` [KJ] [PATCH] drivers/scsi/qlogicfc.c: It's changes Greg KH
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Rodrigo P. do Nascimento @ 2005-07-07 1:05 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 719 bytes --]
Hi All,
I'm trying again. This time I checked whether the code isn't into the
#ifdef or #ifndef block. :)
I hope that it's right. My apologies whether something is wrong. I only
want to help the project.
I'm a newbie, so far. :)
--- /usr/src/linux/drivers/scsi/qlogicfc.c 2005-06-22 16:33:05.000000000 -0300
+++ /usr/src/linux-kj/drivers/scsi/qlogicfc.c 2005-07-05 19:03:39.000000000 -0300
@@ -732,7 +732,7 @@ static int isp2x00_detect(Scsi_Host_Temp
for (i=0; i<2; i++){
pdev = NULL;
- while ((pdev = pci_find_device(PCI_VENDOR_ID_QLOGIC, device_ids[i], pdev))) {
+ while ((pdev = pci_get_device(PCI_VENDOR_ID_QLOGIC, device_ids[i], pdev))) {
if (pci_enable_device(pdev))
continue;
[-- Attachment #2: Type: text/plain, Size: 168 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [KJ] [PATCH] drivers/scsi/qlogicfc.c: It's changes
2005-07-07 1:05 [KJ] [PATCH] drivers/scsi/qlogicfc.c: It's changes pci_find_device Rodrigo P. do Nascimento
@ 2005-07-07 19:01 ` Greg KH
2005-07-07 19:25 ` Matthew Wilcox
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2005-07-07 19:01 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 1320 bytes --]
On Wed, Jul 06, 2005 at 10:05:26PM -0300, Rodrigo P. do Nascimento wrote:
> Hi All,
>
> I'm trying again. This time I checked whether the code isn't into the
> #ifdef or #ifndef block. :)
> I hope that it's right. My apologies whether something is wrong. I only
> want to help the project.
> I'm a newbie, so far. :)
Nice try, but here is why this task is so tough :(
This patch will leak a reference count for the pci device.
> --- /usr/src/linux/drivers/scsi/qlogicfc.c 2005-06-22 16:33:05.000000000 -0300
> +++ /usr/src/linux-kj/drivers/scsi/qlogicfc.c 2005-07-05 19:03:39.000000000 -0300
> @@ -732,7 +732,7 @@ static int isp2x00_detect(Scsi_Host_Temp
>
> for (i=0; i<2; i++){
> pdev = NULL;
> - while ((pdev = pci_find_device(PCI_VENDOR_ID_QLOGIC, device_ids[i], pdev))) {
> + while ((pdev = pci_get_device(PCI_VENDOR_ID_QLOGIC, device_ids[i], pdev))) {
Please read the description of how pci_get_device() works. In short it
increments the reference count of the pci_dev that is returned. Later
on in this function, that pointer is saved off into a structure, which
is fine. Problem happens when that larger structure is freed when the
device or driver is removed. You need to decrement the usage count of
that structure at that point in time.
Care to redo this?
thanks,
greg k-h
[-- Attachment #2: Type: text/plain, Size: 168 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [KJ] [PATCH] drivers/scsi/qlogicfc.c: It's changes
2005-07-07 1:05 [KJ] [PATCH] drivers/scsi/qlogicfc.c: It's changes pci_find_device Rodrigo P. do Nascimento
2005-07-07 19:01 ` [KJ] [PATCH] drivers/scsi/qlogicfc.c: It's changes Greg KH
@ 2005-07-07 19:25 ` Matthew Wilcox
2005-07-07 20:56 ` Greg KH
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Matthew Wilcox @ 2005-07-07 19:25 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 1001 bytes --]
On Thu, Jul 07, 2005 at 12:01:38PM -0700, Greg KH wrote:
> Please read the description of how pci_get_device() works. In short it
> increments the reference count of the pci_dev that is returned. Later
> on in this function, that pointer is saved off into a structure, which
> is fine. Problem happens when that larger structure is freed when the
> device or driver is removed. You need to decrement the usage count of
> that structure at that point in time.
>
> Care to redo this?
Have we given up on getting people to convert drivers to the pci_driver
model then?
--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain
[-- Attachment #2: Type: text/plain, Size: 168 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [KJ] [PATCH] drivers/scsi/qlogicfc.c: It's changes
2005-07-07 1:05 [KJ] [PATCH] drivers/scsi/qlogicfc.c: It's changes pci_find_device Rodrigo P. do Nascimento
2005-07-07 19:01 ` [KJ] [PATCH] drivers/scsi/qlogicfc.c: It's changes Greg KH
2005-07-07 19:25 ` Matthew Wilcox
@ 2005-07-07 20:56 ` Greg KH
2005-07-07 21:23 ` Patrick Mansfield
2005-07-07 21:40 ` Rodrigo Nascimento
4 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2005-07-07 20:56 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 726 bytes --]
On Thu, Jul 07, 2005 at 08:25:56PM +0100, Matthew Wilcox wrote:
> On Thu, Jul 07, 2005 at 12:01:38PM -0700, Greg KH wrote:
> > Please read the description of how pci_get_device() works. In short it
> > increments the reference count of the pci_dev that is returned. Later
> > on in this function, that pointer is saved off into a structure, which
> > is fine. Problem happens when that larger structure is freed when the
> > device or driver is removed. You need to decrement the usage count of
> > that structure at that point in time.
> >
> > Care to redo this?
>
> Have we given up on getting people to convert drivers to the pci_driver
> model then?
Not at all. But that's a much harder task :(
thanks,
greg k-h
[-- Attachment #2: Type: text/plain, Size: 168 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [KJ] [PATCH] drivers/scsi/qlogicfc.c: It's changes
2005-07-07 1:05 [KJ] [PATCH] drivers/scsi/qlogicfc.c: It's changes pci_find_device Rodrigo P. do Nascimento
` (2 preceding siblings ...)
2005-07-07 20:56 ` Greg KH
@ 2005-07-07 21:23 ` Patrick Mansfield
2005-07-07 21:40 ` Rodrigo Nascimento
4 siblings, 0 replies; 6+ messages in thread
From: Patrick Mansfield @ 2005-07-07 21:23 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 1040 bytes --]
On Thu, Jul 07, 2005 at 01:56:51PM -0700, Greg KH wrote:
> On Thu, Jul 07, 2005 at 08:25:56PM +0100, Matthew Wilcox wrote:
> > On Thu, Jul 07, 2005 at 12:01:38PM -0700, Greg KH wrote:
> > > Please read the description of how pci_get_device() works. In short it
> > > increments the reference count of the pci_dev that is returned. Later
> > > on in this function, that pointer is saved off into a structure, which
> > > is fine. Problem happens when that larger structure is freed when the
> > > device or driver is removed. You need to decrement the usage count of
> > > that structure at that point in time.
> > >
> > > Care to redo this?
qlogicfc is nearly dead, don't bother updating it, use the qla2xxx driver
instead. hch sent a patch to mark it broken, AFAICT patch was not included
anywhere, mabye because some people are still using it (well at least one
open-ended complaint on the thread).
Reference this thread (from February 2005):
http://marc.theaimsgroup.com/?l=linux-scsi&m=110805956618612&w=2
-- Patrick Mansfield
[-- Attachment #2: Type: text/plain, Size: 168 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [KJ] [PATCH] drivers/scsi/qlogicfc.c: It's changes
2005-07-07 1:05 [KJ] [PATCH] drivers/scsi/qlogicfc.c: It's changes pci_find_device Rodrigo P. do Nascimento
` (3 preceding siblings ...)
2005-07-07 21:23 ` Patrick Mansfield
@ 2005-07-07 21:40 ` Rodrigo Nascimento
4 siblings, 0 replies; 6+ messages in thread
From: Rodrigo Nascimento @ 2005-07-07 21:40 UTC (permalink / raw)
To: kernel-janitors
qla2xxx is OK!
So, I need to redo qlogicfc.c, or not?
--
Rodrigo Nascimento
On 7/7/05, Patrick Mansfield <patmans@us.ibm.com> wrote:
> On Thu, Jul 07, 2005 at 01:56:51PM -0700, Greg KH wrote:
> > On Thu, Jul 07, 2005 at 08:25:56PM +0100, Matthew Wilcox wrote:
> > > On Thu, Jul 07, 2005 at 12:01:38PM -0700, Greg KH wrote:
> > > > Please read the description of how pci_get_device() works. In short it
> > > > increments the reference count of the pci_dev that is returned. Later
> > > > on in this function, that pointer is saved off into a structure, which
> > > > is fine. Problem happens when that larger structure is freed when the
> > > > device or driver is removed. You need to decrement the usage count of
> > > > that structure at that point in time.
> > > >
> > > > Care to redo this?
>
> qlogicfc is nearly dead, don't bother updating it, use the qla2xxx driver
> instead. hch sent a patch to mark it broken, AFAICT patch was not included
> anywhere, mabye because some people are still using it (well at least one
> open-ended complaint on the thread).
>
> Reference this thread (from February 2005):
>
> http://marc.theaimsgroup.com/?l=linux-scsi&m\x110805956618612&w=2
>
> -- Patrick Mansfield
>
>
> _______________________________________________
> Kernel-janitors mailing list
> Kernel-janitors@lists.osdl.org
> https://lists.osdl.org/mailman/listinfo/kernel-janitors
>
>
>
--
Rodrigo Nascimento
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-07-07 21:40 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-07 1:05 [KJ] [PATCH] drivers/scsi/qlogicfc.c: It's changes pci_find_device Rodrigo P. do Nascimento
2005-07-07 19:01 ` [KJ] [PATCH] drivers/scsi/qlogicfc.c: It's changes Greg KH
2005-07-07 19:25 ` Matthew Wilcox
2005-07-07 20:56 ` Greg KH
2005-07-07 21:23 ` Patrick Mansfield
2005-07-07 21:40 ` Rodrigo Nascimento
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.