public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 3/4] bas_gigaset: suspend support (v2)
       [not found] ` <20071112-patch3@xenon.ts.pxnet.com>
@ 2007-11-15 22:50   ` Andrew Morton
  2007-11-15 23:51     ` Tilman Schmidt
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Morton @ 2007-11-15 22:50 UTC (permalink / raw)
  To: Tilman Schmidt
  Cc: linux-kernel, gregkh, linux-usb-devel, hjlipp, kkeil,
	i4ldeveloper

On Tue, 13 Nov 2007 18:30:30 +0100 (CET)
Tilman Schmidt <tilman@imap.cc> wrote:

> From: Tilman Schmidt <tilman@imap.cc>
> 
> This patch adds basic suspend/resume support to the bas_gigaset ISDN
> driver for the Siemens Gigaset SX255 series of ISDN DECT bases.
> 
> Only the USB aspects are handled so far; the ISDN subsystem is not
> notified  in any way, for lack of information about how to do that.
> The driver will refuse to suspend if a connection is active.
> 
> ...
>
> +	if (atomic_read(&cs->hw.bas->basstate) & BS_SUSPEND) {

that's pretty peculiar.  We'd only expect to see atomics being used in
conjunction with atomic_add/sub/inc/etc.  Here the driver is using an
atomic_t as a state variable.  And here's the magic bit:

	spin_lock_irqsave(&ucs->lock, flags);
	state = atomic_read(&ucs->basstate);
	atomic_set(&ucs->basstate, (state & ~clear) | set);
	spin_unlock_irqrestore(&ucs->lock, flags);

I'm suspecting that a plain old `int' would be more appropriate here.

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

* Re: [PATCH 3/4] bas_gigaset: suspend support (v2)
  2007-11-15 22:50   ` [PATCH 3/4] bas_gigaset: suspend support (v2) Andrew Morton
@ 2007-11-15 23:51     ` Tilman Schmidt
  0 siblings, 0 replies; 2+ messages in thread
From: Tilman Schmidt @ 2007-11-15 23:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, gregkh, linux-usb-devel, hjlipp, kkeil,
	i4ldeveloper

[-- Attachment #1: Type: text/plain, Size: 1033 bytes --]

Am 15.11.2007 23:50 schrieb Andrew Morton:
>> ...
>>
>> +	if (atomic_read(&cs->hw.bas->basstate) & BS_SUSPEND) {
> 
> that's pretty peculiar.  We'd only expect to see atomics being used in
> conjunction with atomic_add/sub/inc/etc.  Here the driver is using an
> atomic_t as a state variable.  And here's the magic bit:
> 
> 	spin_lock_irqsave(&ucs->lock, flags);
> 	state = atomic_read(&ucs->basstate);
> 	atomic_set(&ucs->basstate, (state & ~clear) | set);
> 	spin_unlock_irqrestore(&ucs->lock, flags);
> 
> I'm suspecting that a plain old `int' would be more appropriate here.

You're right. That's a prehistoric leftover. That variable was
originally accessed using atomic_set_mask() and atomic_clear_mask()
which are unfortunately x86 platform specific.

I'll prepare a cleanup patch.

Thanks,
Tilman

-- 
Tilman Schmidt                          E-Mail: tilman@imap.cc
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Ungeöffnet mindestens haltbar bis: (siehe Rückseite)


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 253 bytes --]

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

end of thread, other threads:[~2007-11-15 23:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20071112-patch0@xenon.ts.pxnet.com>
     [not found] ` <20071112-patch3@xenon.ts.pxnet.com>
2007-11-15 22:50   ` [PATCH 3/4] bas_gigaset: suspend support (v2) Andrew Morton
2007-11-15 23:51     ` Tilman Schmidt

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