lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 1 Mar 2007 09:09:57 -0500
From:	"Mike Frysinger" <vapier.adi@...il.com>
To:	"Paul Mundt" <lethal@...ux-sh.org>,
	"Wu, Bryan" <bryan.wu@...log.com>,
	"Andrew Morton" <akpm@...ux-foundation.org>, a.zummo@...ertech.it,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH -mm 5/5] Blackfin: on-chip RTC controller driver

On 3/1/07, Paul Mundt <lethal@...ux-sh.org> wrote:
> On Thu, Mar 01, 2007 at 12:15:46PM +0800, Wu, Bryan wrote:
> > +#define stamp(fmt, args...) pr_debug("%s:%i: " fmt "\n", __FUNCTION__, __LINE__, ## args)
> > +#define stampit() stamp("here i am")
>
> Are these really necessary for the final driver? It's littered all over
> the place, and presumably the driver should be functional enough to not
> need this sort of debugging instrumentation.

is there really such a thing as a "final driver" ? :)

keeping the stampit()'s in place means i dont have to re-add and
re-delete them every time some one reports a bug ...

> > +static void rtc_bfin_sync_pending(void)
> > +{
> > +     stampit();
> > +     while (!(bfin_read_RTC_ISTAT() & RTC_ISTAT_WRITE_COMPLETE)) {
> > +             if (!(bfin_read_RTC_ISTAT() & RTC_ISTAT_WRITE_PENDING))
> > +                     break;
> > +     }
> > +     bfin_write_RTC_ISTAT(RTC_ISTAT_WRITE_COMPLETE);
> > +}
>
> No timeout? (and superfluous braces)

the ISTAT is reset every clock tick by the hardware itself ... so the
timeout is implicit

> > +     case RTC_PIE_ON:
> > +             stampit();
> > +             spin_lock_irq(&rtc->lock);
> > +             rtc_bfin_sync_pending();
>
> And it's also called under a spinlock each time.. this is a disaster
> waiting to happen.

i noted the logic behind this decision in the comments in the driver
... i too think it sucks, but i cant fathom a better idea so i'm
certainly open to suggestions :)
-mike
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ