public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] dz.c 64 bit locking issues
@ 2001-08-16  4:26 jes
  2001-08-17 14:40 ` Ralf Baechle
  0 siblings, 1 reply; 5+ messages in thread
From: jes @ 2001-08-16  4:26 UTC (permalink / raw)
  To: olivier.lebaillif; +Cc: alan, torvalds, linux-kernel

Hi

The dz.c driver has an instance where it does save_flags() to a 32 bit
type which isn't safe for 64 bit boxen.

Jes

--- drivers/char/dz.c~	Wed Jul  4 17:41:33 2001
+++ drivers/char/dz.c	Thu Aug 16 00:24:48 2001
@@ -1279,7 +1279,8 @@
 
 int __init dz_init(void)
 {
-  int i, flags;
+  int i;
+  unsigned long flags;
   struct dz_serial *info;
 
   /* Setup base handler, and timer table. */

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

* [patch] dz.c 64 bit locking issues
@ 2001-08-16  4:30 jes
  0 siblings, 0 replies; 5+ messages in thread
From: jes @ 2001-08-16  4:30 UTC (permalink / raw)
  To: torvalds; +Cc: alan, linux-kernel

Hi

Another 64 bit flags bug.

Cheers
Jes

--- drivers/char/n_r3964.c~	Wed Jun 27 17:13:01 2001
+++ drivers/char/n_r3964.c	Thu Aug 16 00:29:13 2001
@@ -1421,7 +1421,7 @@
    int pid=current->pid;
    struct r3964_client_info *pClient;
    struct r3964_message *pMsg=NULL;
-   unsigned int flags;
+   unsigned long flags;
    int result = POLLOUT;
 
    TRACE_L("POLL");

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

* Re: [patch] dz.c 64 bit locking issues
  2001-08-16  4:26 [patch] dz.c 64 bit locking issues jes
@ 2001-08-17 14:40 ` Ralf Baechle
  2001-08-17 15:57   ` Maciej W. Rozycki
  0 siblings, 1 reply; 5+ messages in thread
From: Ralf Baechle @ 2001-08-17 14:40 UTC (permalink / raw)
  To: jes; +Cc: olivier.lebaillif, alan, torvalds, linux-kernel

On Thu, Aug 16, 2001 at 12:26:36AM -0400, jes@trained-monkey.org wrote:

> The dz.c driver has an instance where it does save_flags() to a 32 bit
> type which isn't safe for 64 bit boxen.

It's safe because a MIPS only driver.

  Ralf

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

* Re: [patch] dz.c 64 bit locking issues
  2001-08-17 14:40 ` Ralf Baechle
@ 2001-08-17 15:57   ` Maciej W. Rozycki
  2001-08-17 15:59     ` Jes Sorensen
  0 siblings, 1 reply; 5+ messages in thread
From: Maciej W. Rozycki @ 2001-08-17 15:57 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: jes, olivier.lebaillif, alan, torvalds, linux-kernel

On Fri, 17 Aug 2001, Ralf Baechle wrote:

> > The dz.c driver has an instance where it does save_flags() to a 32 bit
> > type which isn't safe for 64 bit boxen.
> 
> It's safe because a MIPS only driver.

 Not necessarily.  It might be safe now, but there is a TURBOchannel
serial card with DZ11-compatible chipset that could be driven by the dz.c
code after a few tweaks.  And chances are someone will finish writing
support for TURBOchannel Alphas one day...

 The change is harmless anyway.

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +


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

* Re: [patch] dz.c 64 bit locking issues
  2001-08-17 15:57   ` Maciej W. Rozycki
@ 2001-08-17 15:59     ` Jes Sorensen
  0 siblings, 0 replies; 5+ messages in thread
From: Jes Sorensen @ 2001-08-17 15:59 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: Ralf Baechle, linux-kernel

>>>>> "Maciej" == Maciej W Rozycki <macro@ds2.pg.gda.pl> writes:

Maciej> On Fri, 17 Aug 2001, Ralf Baechle wrote:
>> > The dz.c driver has an instance where it does save_flags() to a 32
>> bit > type which isn't safe for 64 bit boxen.
>> 
>> It's safe because a MIPS only driver.

Maciej>  Not necessarily.  It might be safe now, but there is a
Maciej> TURBOchannel serial card with DZ11-compatible chipset that could
Maciej> be driven by the dz.c code after a few tweaks.  And chances are
Maciej> someone will finish writing support for TURBOchannel Alphas one
Maciej> day...

Maciej>  The change is harmless anyway.

Yep, I also think it's better for cosmetic reasons that we make all
drivers use unsigned long. That way the chance of someone else copying
bad code for a new driver is less likely.

Jes

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

end of thread, other threads:[~2001-08-17 16:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-08-16  4:26 [patch] dz.c 64 bit locking issues jes
2001-08-17 14:40 ` Ralf Baechle
2001-08-17 15:57   ` Maciej W. Rozycki
2001-08-17 15:59     ` Jes Sorensen
  -- strict thread matches above, loose matches on Subject: below --
2001-08-16  4:30 jes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox