Date: Wed, 08 Dec 2010 00:48:52 +0200 From: Andriy Gapon <avg@freebsd.org> To: freebsd-scsi@freebsd.org Subject: atomic_set_xxx(&x, 0) in arcmsr Message-ID: <4CFEB9D4.9090808@freebsd.org>
next in thread | raw e-mail | index | archive | help
Can somebody please take a look at the following report? Looks like that use of atomic_set_int() could cause problems in driver's reset/shutdown logic. Thanks! -------- Original Message -------- From: John Baldwin <jhb@freebsd.org> To: freebsd-hackers@freebsd.org Subject: Re: atomic_set_xxx(&x, 0) Date: Tue, 7 Dec 2010 16:24:59 -0500 Cc: Andriy Gapon <avg@freebsd.org> References: <4CFE75D3.4050009@freebsd.org> In-Reply-To: <4CFE75D3.4050009@freebsd.org> On Tuesday, December 07, 2010 12:58:43 pm Andriy Gapon wrote: > > $ glimpse atomic_set_ | fgrep -w 0 > /usr/src/sys/dev/arcmsr/arcmsr.c: atomic_set_int(&acb->srboutstandingcount, 0); > /usr/src/sys/dev/arcmsr/arcmsr.c: atomic_set_int(&acb->srboutstandingcount, 0); > /usr/src/sys/dev/jme/if_jme.c: atomic_set_int(&sc->jme_morework, 0); > /usr/src/sys/dev/jme/if_jme.c: atomic_set_int(&sc->jme_morework, 0); > /usr/src/sys/dev/ale/if_ale.c: atomic_set_int(&sc->ale_morework, 0); > /usr/src/sys/mips/rmi/dev/xlr/rge.c: > atomic_set_int(&(priv->frin_to_be_sent[i]), 0); > /usr/src/sys/dev/drm/drm_irq.c: > atomic_set_rel_32(&dev->vblank[i].count, 0); > /usr/src/sys/dev/cxgb/ulp/tom/cxgb_tom.c: atomic_set_int(&t->tids_in_use, 0); > > I wonder if these are all bugs and atomic_store_xxx() was actually intended? They are most likely bugs. You can probably ask yongari@ about jme(4) and ale(4) and np@ about cxgb(4). drm_irq looks to want to be an atomic_store_rel(). Not sure who to ask about arcmsr(4). I'm not sure arcmsr(4) really needs the atomic ops at all, but it should be using atomic_fetchadd() and atomic_readandclear() instead of some of the current atomic ops. -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4CFEB9D4.9090808>