All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: possible bug in net/tc35815.c in linux-2.6.19
       [not found] <45DFEC09.3020801@cs.stanford.edu>
@ 2007-02-24 12:37 ` Michal Piotrowski
  2007-02-24 22:04   ` Jeff Garzik
  0 siblings, 1 reply; 9+ messages in thread
From: Michal Piotrowski @ 2007-02-24 12:37 UTC (permalink / raw)
  To: Philip Guo, Jeff Garzik, ahennessy, netdev

Hi Philip,

Philip Guo napisał(a):
> Hi,
> 
> I am a graduate student working on finding bugs in Linux drivers using
> an automated research tool.  I think I've found a possible bug in
> net/tc35815.c, and I'd appreciate it if you could confirm/disconfirm it.
> 
> Thanks,
> Philip
> 
> ---
> net/tc35815.c
> 
> tc35815_driver is never unregistered in tc35815_cleanup_module()
> 
> static int __init tc35815_init_module(void)
> {
>     return pci_register_driver(&tc35815_driver);
> }
> 
> static void __exit tc35815_cleanup_module(void)
> {
>     struct net_device *next_dev;
> 
>     while (root_tc35815_dev) {
>         struct net_device *dev = root_tc35815_dev;
>         next_dev = ((struct tc35815_local *)dev->priv)->next_module;
>         iounmap((void *)(dev->base_addr));
>         unregister_netdev(dev);
>         free_netdev(dev);
>         root_tc35815_dev = next_dev;
>     }
> }
> 
> 

I think that you are right, but I don't know this code.

Jeff, what do you think about this?

Regards,
Michal

PS. Philip, please sign this patch.

-- 
Michal K. K. Piotrowski
LTG - Linux Testers Group (PL)
(http://www.stardust.webpages.pl/ltg/)
LTG - Linux Testers Group (EN)
(http://www.stardust.webpages.pl/linux_testers_group_en/)

Signed-off-by: Michal Piotrowski <michal.k.k.piotrowski@gmail.com>

--- linux-mm-clean/drivers/net/tc35815.c	2007-02-04 19:44:54.000000000 +0100
+++ linux-mm/drivers/net/tc35815.c	2007-02-24 13:07:34.000000000 +0100
@@ -1740,6 +1740,8 @@ static void __exit tc35815_cleanup_modul
 		free_netdev(dev);
 		root_tc35815_dev = next_dev;
 	}
+
+	pci_unregister_driver(&tc35815_driver);
 }
 module_init(tc35815_init_module);
 module_exit(tc35815_cleanup_module);

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: possible bug in net/tc35815.c in linux-2.6.19
  2007-02-24 12:37 ` possible bug in net/tc35815.c in linux-2.6.19 Michal Piotrowski
@ 2007-02-24 22:04   ` Jeff Garzik
  2007-02-26 10:26     ` Ralf Baechle
  0 siblings, 1 reply; 9+ messages in thread
From: Jeff Garzik @ 2007-02-24 22:04 UTC (permalink / raw)
  To: Michal Piotrowski; +Cc: Philip Guo, ahennessy, netdev, Ralf Baechle

Michal Piotrowski wrote:
> Hi Philip,
> 
> Philip Guo napisał(a):
>> Hi,
>>
>> I am a graduate student working on finding bugs in Linux drivers using
>> an automated research tool.  I think I've found a possible bug in
>> net/tc35815.c, and I'd appreciate it if you could confirm/disconfirm it.
>>
>> Thanks,
>> Philip
>>
>> ---
>> net/tc35815.c
>>
>> tc35815_driver is never unregistered in tc35815_cleanup_module()
>>
>> static int __init tc35815_init_module(void)
>> {
>>     return pci_register_driver(&tc35815_driver);
>> }
>>
>> static void __exit tc35815_cleanup_module(void)
>> {
>>     struct net_device *next_dev;
>>
>>     while (root_tc35815_dev) {
>>         struct net_device *dev = root_tc35815_dev;
>>         next_dev = ((struct tc35815_local *)dev->priv)->next_module;
>>         iounmap((void *)(dev->base_addr));
>>         unregister_netdev(dev);
>>         free_netdev(dev);
>>         root_tc35815_dev = next_dev;
>>     }
>> }
>>
>>
> 
> I think that you are right, but I don't know this code.
> 
> Jeff, what do you think about this?
> 
> Regards,
> Michal

I created my own patch for this (and one other bug), and checked it in.

Really, though, someone in MIPS-land should give this driver some loving 
care.  It is filled with bugs and 2.4-era anachronisms.

	Jeff




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: possible bug in net/tc35815.c in linux-2.6.19
  2007-02-24 22:04   ` Jeff Garzik
@ 2007-02-26 10:26     ` Ralf Baechle
  2007-02-26 11:05       ` Atsushi Nemoto
  0 siblings, 1 reply; 9+ messages in thread
From: Ralf Baechle @ 2007-02-26 10:26 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: Michal Piotrowski, Philip Guo, ahennessy, netdev, linux-mips,
	Atsushi Nemoto

On Sat, Feb 24, 2007 at 05:04:01PM -0500, Jeff Garzik wrote:

> >>I am a graduate student working on finding bugs in Linux drivers using
> >>an automated research tool.  I think I've found a possible bug in
> >>net/tc35815.c, and I'd appreciate it if you could confirm/disconfirm it.
> >>
> >>Thanks,
> >>Philip
> >>
> >>---
> >>net/tc35815.c
> >>
> >>tc35815_driver is never unregistered in tc35815_cleanup_module()
> >>
> >>static int __init tc35815_init_module(void)
> >>{
> >>    return pci_register_driver(&tc35815_driver);
> >>}
> >>
> >>static void __exit tc35815_cleanup_module(void)
> >>{
> >>    struct net_device *next_dev;
> >>
> >>    while (root_tc35815_dev) {
> >>        struct net_device *dev = root_tc35815_dev;
> >>        next_dev = ((struct tc35815_local *)dev->priv)->next_module;
> >>        iounmap((void *)(dev->base_addr));
> >>        unregister_netdev(dev);
> >>        free_netdev(dev);
> >>        root_tc35815_dev = next_dev;
> >>    }
> >>}
> >>
> >>
> >
> >I think that you are right, but I don't know this code.
> >
> >Jeff, what do you think about this?
> >
> >Regards,
> >Michal
> 
> I created my own patch for this (and one other bug), and checked it in.
> 
> Really, though, someone in MIPS-land should give this driver some loving 
> care.  It is filled with bugs and 2.4-era anachronisms.

Took a look at it.  It's sort of a non-bug because the driver cannot be
compiled as module, so the module_exit function cannot possibly be
executed.  The board support code is calling into the driver which makes
it impossible to build this driver as a module, yet it's possible to
select building this driver as a module ...  Oh yeah, that root_tc35815_dev
stuff is also pretty ugly.

Atsushi?

  Ralf

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: possible bug in net/tc35815.c in linux-2.6.19
  2007-02-26 10:26     ` Ralf Baechle
@ 2007-02-26 11:05       ` Atsushi Nemoto
  2007-02-26 20:07         ` Sergei Shtylyov
  0 siblings, 1 reply; 9+ messages in thread
From: Atsushi Nemoto @ 2007-02-26 11:05 UTC (permalink / raw)
  To: ralf
  Cc: jeff, michal.k.k.piotrowski, pg, ahennessy, netdev, linux-mips,
	Sergei Shtylyov

On Mon, 26 Feb 2007 10:26:59 +0000, Ralf Baechle <ralf@linux-mips.org> wrote:
> > I created my own patch for this (and one other bug), and checked it in.
> > 
> > Really, though, someone in MIPS-land should give this driver some loving 
> > care.  It is filled with bugs and 2.4-era anachronisms.
> 
> Took a look at it.  It's sort of a non-bug because the driver cannot be
> compiled as module, so the module_exit function cannot possibly be
> executed.  The board support code is calling into the driver which makes
> it impossible to build this driver as a module, yet it's possible to
> select building this driver as a module ...  Oh yeah, that root_tc35815_dev
> stuff is also pretty ugly.

Yes, the driver is quite obsoleted.  It was added long ago with
arch/mips/jmr3927 and not maintained long time, as like as the board
itself.

I know both MontaVista and CELF have new driver for the chip.  If
anybody in MontaVista did not complain I can send CELF's one available
at http://tree.celinuxforum.org/pubwiki/moin.cgi/PatchArchive.  (it
needs some changes for recent kernel, for example pt_regs removal, but
it would be easy).

Sergei?

---
Atsushi Nemoto

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: possible bug in net/tc35815.c in linux-2.6.19
  2007-02-26 11:05       ` Atsushi Nemoto
@ 2007-02-26 20:07         ` Sergei Shtylyov
  2007-02-27 14:55           ` Atsushi Nemoto
  2007-02-27 14:58           ` rbhma4500_defconfig Atsushi Nemoto
  0 siblings, 2 replies; 9+ messages in thread
From: Sergei Shtylyov @ 2007-02-26 20:07 UTC (permalink / raw)
  To: Atsushi Nemoto
  Cc: ralf, jeff, michal.k.k.piotrowski, pg, ahennessy, netdev, linux-mips

Hello.

Atsushi Nemoto wrote:

> I know both MontaVista and CELF have new driver for the chip.  If
> anybody in MontaVista did not complain I can send CELF's one available
> at http://tree.celinuxforum.org/pubwiki/moin.cgi/PatchArchive.  (it

    Yeah, tc35815_1.c in our looks like the one in the CELF archive (what I 
didn't get is why they decided to keep both drivers around?)

> needs some changes for recent kernel, for example pt_regs removal, but
> it would be easy).

> Sergei?

    I think everybody would be just thankful. :-)
    There's quite a lot of other TX4938 patches that need pushing into 
Linux/MIPS -- unfortunetely, this hasn't been done by MV... :-<

> ---
> Atsushi Nemoto

    BTW, does RBTX4938 boot the recent kernels for you? If so, what .config 
are you using -- I'm afraid something's up with rbhma4500_defconfig?

WBR, Sergei

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: possible bug in net/tc35815.c in linux-2.6.19
  2007-02-26 20:07         ` Sergei Shtylyov
@ 2007-02-27 14:55           ` Atsushi Nemoto
  2007-02-27 14:58           ` rbhma4500_defconfig Atsushi Nemoto
  1 sibling, 0 replies; 9+ messages in thread
From: Atsushi Nemoto @ 2007-02-27 14:55 UTC (permalink / raw)
  To: sshtylyov
  Cc: ralf, jeff, michal.k.k.piotrowski, pg, ahennessy, netdev, linux-mips

On Mon, 26 Feb 2007 23:07:47 +0300, Sergei Shtylyov <sshtylyov@ru.mvista.com> wrote:
>     Yeah, tc35815_1.c in our looks like the one in the CELF archive (what I 
> didn't get is why they decided to keep both drivers around?)

I think tc35815_1.c can just replace old tc35815.c.  New one lacks
tc35815_killall() which is currently called by arch/mips/jmr3927 code,
but there would be no point doing a such thing.  arch/mips/jmr3927
should be fixed.

>     I think everybody would be just thankful. :-)

OK, I'll prepare a patch after some cleanup.

---
Atsushi Nemoto

^ permalink raw reply	[flat|nested] 9+ messages in thread

* rbhma4500_defconfig
  2007-02-26 20:07         ` Sergei Shtylyov
  2007-02-27 14:55           ` Atsushi Nemoto
@ 2007-02-27 14:58           ` Atsushi Nemoto
  2007-02-27 15:21             ` rbhma4500_defconfig Sergei Shtylyov
  1 sibling, 1 reply; 9+ messages in thread
From: Atsushi Nemoto @ 2007-02-27 14:58 UTC (permalink / raw)
  To: sshtylyov; +Cc: ralf, linux-mips

CC list trimmed.

On Mon, 26 Feb 2007 23:07:47 +0300, Sergei Shtylyov <sshtylyov@ru.mvista.com> wrote:
>     BTW, does RBTX4938 boot the recent kernels for you? If so, what .config 
> are you using -- I'm afraid something's up with rbhma4500_defconfig?

I have not tried recently.  I'll try later, but what's the problem?

---
Atsushi Nemoto

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: rbhma4500_defconfig
  2007-02-27 14:58           ` rbhma4500_defconfig Atsushi Nemoto
@ 2007-02-27 15:21             ` Sergei Shtylyov
  2007-02-28 14:07               ` rbhma4500_defconfig Atsushi Nemoto
  0 siblings, 1 reply; 9+ messages in thread
From: Sergei Shtylyov @ 2007-02-27 15:21 UTC (permalink / raw)
  To: Atsushi Nemoto; +Cc: ralf, linux-mips

Hello.

Atsushi Nemoto wrote:
> On Mon, 26 Feb 2007 23:07:47 +0300, Sergei Shtylyov <sshtylyov@ru.mvista.com> wrote:

>>    BTW, does RBTX4938 boot the recent kernels for you? If so, what .config 
>>are you using -- I'm afraid something's up with rbhma4500_defconfig?

> I have not tried recently.  I'll try later, but what's the problem?

    No console output, IIRC.

> ---
> Atsushi Nemoto

WBR, Sergei

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: rbhma4500_defconfig
  2007-02-27 15:21             ` rbhma4500_defconfig Sergei Shtylyov
@ 2007-02-28 14:07               ` Atsushi Nemoto
  0 siblings, 0 replies; 9+ messages in thread
From: Atsushi Nemoto @ 2007-02-28 14:07 UTC (permalink / raw)
  To: sshtylyov; +Cc: ralf, linux-mips

On Tue, 27 Feb 2007 18:21:45 +0300, Sergei Shtylyov <sshtylyov@ru.mvista.com> wrote:
> > I have not tried recently.  I'll try later, but what's the problem?
> 
>     No console output, IIRC.

CONFIG_SERIAL_TXX9_CONSOLE=y
CONFIG_SERIAL_TXX9_STDSERIAL=y

and

CONFIG_VGA_CONSOLE=n
CONFIG_KEYBOARD_ATKBD=n
CONFIG_SERIO_I8042=n

Would help?
---
Atsushi Nemoto

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-02-28 14:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <45DFEC09.3020801@cs.stanford.edu>
2007-02-24 12:37 ` possible bug in net/tc35815.c in linux-2.6.19 Michal Piotrowski
2007-02-24 22:04   ` Jeff Garzik
2007-02-26 10:26     ` Ralf Baechle
2007-02-26 11:05       ` Atsushi Nemoto
2007-02-26 20:07         ` Sergei Shtylyov
2007-02-27 14:55           ` Atsushi Nemoto
2007-02-27 14:58           ` rbhma4500_defconfig Atsushi Nemoto
2007-02-27 15:21             ` rbhma4500_defconfig Sergei Shtylyov
2007-02-28 14:07               ` rbhma4500_defconfig Atsushi Nemoto

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.