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: <531D92F7.7080509@topic.nl>
Date:	Mon, 10 Mar 2014 11:24:55 +0100
From:	Mike Looijmans <mike.looijmans@...ic.nl>
To:	Wolfram Sang <wsa@...-dreams.de>
CC:	<linux-i2c@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<nsekhar@...com>, <khilman@...prootsystems.com>,
	<davinci-linux-open-source@...ux.davincidsp.com>
Subject: Re: [PATCH] i2c-davinci: Handle signals gracefully

On 03/09/2014 09:21 PM, Wolfram Sang wrote:
> On Thu, Jan 09, 2014 at 12:11:25PM +0100, Mike Looijmans wrote:
>> When a signal is caught while the i2c-davinci bus driver is transferring,
>> the drive just "abandons" the transfer and leaves the controller to fend
>> for itself. The next I2C transaction will find the controller in an
>> undefined state and often results in a stream of "initiating i2c bus recovery"
>> messages until the controller arrives in a defined state. This behaviour
>> also sends out "half" or possibly even mixed messages to I2C client
>> devices which may put them in an undesired state as well.
>>
>> This patch fixes this issue by always attempting to finish the current
>> transaction, and then check on a pending signal. It either reports
>> success if all data has been transferred, or it returns failure when
>> the transaction was aborted. This keeps the controller in a defined
>> state, and is also much friendlier towards client devices, because
>> it will only send complete messages.
>
> Even more, you should complete the whole transfer. There are devices
> where things can really go wrong if you send a half-complete command and
> then start with the next one. So, not checking signals at all is the way
> to go for I2C drivers. There is some cruft left, so I am happy about
> patches fixing that, with testing on real HW. Like yours here.

I agree.

I know the Zynq (using a cadence controller) also lets signals interrupt I2C 
transfers, so I'll propose a patch to Xilinx and CC to you and linux-i2c to 
completely remove signal handling from that driver as well.

Mike


Met vriendelijke groet / kind regards,

Mike Looijmans

TOPIC Embedded Systems
Eindhovenseweg 32-C, NL-5683 KH Best
Postbus 440, NL-5680 AK Best
Telefoon: (+31) (0) 499 33 69 79
Telefax:  (+31) (0) 499 33 69 70
E-mail: mike.looijmans@...ic.nl
Website: www.topic.nl

Please consider the environment before printing this e-mail

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