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: <20121219150925.8262E3E0AD7@localhost>
Date:	Wed, 19 Dec 2012 15:09:25 +0000
From:	Grant Likely <grant.likely@...retlab.ca>
To:	Federico Vaga <federico.vaga@...il.com>
Cc:	spi-devel-general@...ts.sourceforge.net,
	linux-kernel@...r.kernel.org,
	Federico Vaga <federico.vaga@...il.com>
Subject: Re: [PATCH RFC] spidev.c: add sysfs attributes for SPI configuration

On Sat, 24 Nov 2012 18:20:08 +0100, Federico Vaga <federico.vaga@...il.com> wrote:
> This patch introduce the use of the sysfs attribute for the spidev
> configuration. This avoid the user to have a specific program which does
> ioctl() on spidev. The user can easily does cat (to read) and echo (to
> write) on the sysfs file and configure SPI.
> 
> The patch exports the following attributes: bits-per-word, lsb-first,
> mode and speed-hz.
> 
> Example:
>     # cat /sys/bus/spi/devices/spi1.0/speed-hz
>     500000
>     # echo 450000 > /sys/bus/spi/devices/spi1.0/speed-hz
>     # dmesg | tail -n 4
>     spidev spi1.0: DEactivate 60, mr 000f0011
>     spidev spi1.0: setup: 449447 Hz bpw 8 mode 0x0 -> csr0 0000dd02
>     spidev spi1.0: setup mode 0, 8 bits/w, 450000 Hz max --> 0
>     spidev spi1.0: 450000 Hz (max)
> 
> Signed-off-by: Federico Vaga <federico.vaga@...il.com>

Not a good idea. sysfs is not a good place for operational interfaces.
Please use the spi character devices for direct manipulation of the SPI
configuration.

g.
--
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