Skip to contentSkip to conversation

bas_gigaset: suspend support (v2)

PATCH Andrew Morton 2 participants 2 messages Nov 15, 2007 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

Review

Quoted 12 lines · On Tue, 13 Nov 2007 18:30:30 +0100 (CET) Tilman Schmidt <[email protected]> wrote:

From: Tilman Schmidt <[email protected]>

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.

...

(quoted diff) +1 -0
+	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.

#3 lore raw

Am 15.11.2007 23:50 schrieb Andrew Morton:

Quoted 8 lines

Review

Quoted 3 lines

...

(quoted diff) +1 -0
+	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:

Quoted 6 lines
	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

Signature · 4 lines
Tilman Schmidt                          E-Mail: [email protected]
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Ungeöffnet mindestens haltbar bis: (siehe Rückseite)