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] [thread-next>] [day] [month] [year] [list]
Message-Id: <201312142159.40250.arnd@arndb.de>
Date:	Sat, 14 Dec 2013 21:59:39 +0100
From:	Arnd Bergmann <arnd@...db.de>
To:	Sergei Ianovich <ynvich@...il.com>
Cc:	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	Rob Landley <rob@...dley.net>,
	"Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
	"open list:DOCUMENTATION" <linux-doc@...r.kernel.org>
Subject: Re: [PATCH v2 16/16] misc: support for I-8024 in LP-8x4x

On Friday 13 December 2013, Sergei Ianovich wrote:
> +void nsleep(unsigned long nanosec)
> +{
> +       ktime_t t = ns_to_ktime(nanosec);
> +       long state = current->state;
> +
> +       __set_current_state(TASK_UNINTERRUPTIBLE);
> +       schedule_hrtimeout(&t, HRTIMER_MODE_REL);
> +       __set_current_state(state);
> +}
> +
> +static void lp8x4x_slot_reset_AO(struct lp8x4x_slot *s)
> +{
> +       int i;
> +       mutex_lock(&s->lock);
> +       for (i = 0; i < s->AO_len; i++)
> +               s->AO[i] = 0x2000;
> +       iowrite8(0x00, s->data_addr);
> +       nsleep(450);
> +       iowrite8(0xff, s->data_addr);
> +       mutex_unlock(&s->lock);
> +}

Have you checked that the nsleep definition actually does the
right thing here? 450 nanoseconds must be close the latency
you get from calling schedule_hrtimeout(). I'd suggest using
either ndelay() or usleep_range() instead, depending on your
needs.

If nsleep is really useful here, we should probably add that
as a generic API rather than having it in one driver.

	Arnd
--
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