<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/w1/masters/ds2490.c, branch linux-6.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2023-12-20T08:25:23Z</updated>
<entry>
<title>w1: ds2490: support block sizes larger than 128 bytes in ds_read_block</title>
<updated>2023-12-20T08:25:23Z</updated>
<author>
<name>Marc Ferland</name>
<email>marc.ferland@sonatest.com</email>
</author>
<published>2023-12-18T15:02:26Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d605ba72e9c04efc35fcf225df59d4ccb1d4061f'/>
<id>urn:sha1:d605ba72e9c04efc35fcf225df59d4ccb1d4061f</id>
<content type='text'>
The current ds_read_block function only supports block sizes up to
128 bytes, which is the depth of the 'data out' fifo on the ds2490.

Reading larger blocks will fail with a: -110 (ETIMEDOUT) from
usb_control_msg(). Example:

    $ dd if=/sys/bus/w1/devices/43-000000478756/eeprom bs=256 count=1

yields to the following message from the kernel:

    usb 5-1: Failed to write 1-wire data to ep0x2: err=-110.

I discovered this issue while implementing support for the ds28ec20
eeprom in the w1-2433 driver. This driver accepts reading blocks of
sizes up to the size of the entire memory (2560 bytes in the case of
the ds28ec20). Note that this issue _does not_ arise when the kernel
is configured with CONFIG_W1_SLAVE_DS2433_CRC enabled since in this
mode the driver reads one 32 byte block at a time (a single memory
page).

Also, from the ds2490 datasheet (2995.pdf, page 22, BLOCK I/O
command):

     For a block write sequence the EP2 FIFO must be pre-filled with
     data before command execution. Additionally, for block sizes
     greater then the FIFO size, the FIFO content status must be
     monitored by host SW so that additional data can be sent to the
     FIFO when necessary. A similar EP3 FIFO content monitoring
     requirement exists for block read sequences. During a block read
     the number of bytes loaded into the EP3 FIFO must be monitored so
     that the data can be read before the FIFO overflows.

Breaking the block in smaller 128 bytes chunks and simply calling the
original code sequence has solved the issue for me.

Tested with a DS1490F usb&lt;-&gt;one-wire adapter and both the DS28EC20 and
DS2433 eeprom memories.

Signed-off-by: Marc Ferland &lt;marc.ferland@sonatest.com&gt;
Link: https://lore.kernel.org/r/20231218150230.1992448-2-marc.ferland@sonatest.com
[krzysztof: fix checkpatch 'spaces preferred around']
Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@linaro.org&gt;
</content>
</entry>
<entry>
<title>w1: minor white-space and code style fixes</title>
<updated>2023-04-20T12:15:06Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>krzysztof.kozlowski@linaro.org</email>
</author>
<published>2023-04-15T10:42:52Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ad9c36be1f78f2990310cdcf902eba64cd2b2cf3'/>
<id>urn:sha1:ad9c36be1f78f2990310cdcf902eba64cd2b2cf3</id>
<content type='text'>
Correct several coding convention violations around white-spaces:

  ERROR: spaces required around that '=' (ctx:VxV)
  WARNING: Missing a blank line after declarations
  ERROR: "foo* bar" should be "foo *bar"
  ERROR: "(foo*)" should be "(foo *)"
  WARNING: Block comments use * on subsequent lines
  WARNING: Block comments use a trailing */ on a separate line
  WARNING: please, no space before tabs
  WARNING: Missing a blank line after declarations
  ERROR: open brace '{' following struct go on the same line
  ERROR: that open brace { should be on the previous line

Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@linaro.org&gt;
Link: https://lore.kernel.org/r/20230415104304.104134-4-krzysztof.kozlowski@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>w1/ds2490: remove dump from ds_recv_status, pr_ to dev_XXX logging.</title>
<updated>2022-04-24T15:30:22Z</updated>
<author>
<name>Christian Vogel</name>
<email>vogelchr@vogel.cx</email>
</author>
<published>2022-03-24T19:32:46Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f76a9ae61628fe3bf182318054ddc9e6f501b1a1'/>
<id>urn:sha1:f76a9ae61628fe3bf182318054ddc9e6f501b1a1</id>
<content type='text'>
Changed all remaining pr_XXX calls that write out debugging info into
dev_XXX calls, changed the needlessly verbose decoding of status bits
into dev_dbg(), so that it's supressed by the logging levels by default.

Forthermore the ds_recv_status function has a "dump" parameter that
enables extremely verbose logging, and that's used only once.
This has been factored out, and called explicitly at that one place.

Signed-off-by: Christian Vogel &lt;vogelchr@vogel.cx&gt;
Link: https://lore.kernel.org/r/20220324193246.16814-2-vogelchr@vogel.cx
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>w1/ds2490: remove spurious newlines within hexdump</title>
<updated>2022-03-18T13:07:01Z</updated>
<author>
<name>Christian Vogel</name>
<email>vogelchr@vogel.cx</email>
</author>
<published>2022-03-11T19:28:32Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=6caf745d6172dc187d87438d753e187b0b68fed3'/>
<id>urn:sha1:6caf745d6172dc187d87438d753e187b0b68fed3</id>
<content type='text'>
Multiple pr_infos generate newlines, so the hexdump looks like...

&gt; 0x81: count=16, status:
&gt; 01
&gt; 00
&gt; 20
(...16 lines...)

We switch to a single %*ph hexdump, using the built-in %ph format,
which leads to this:

	[52769.348789] usb 2-1.3.1: Clearing ep0x83.
	[52769.349729] usb 2-1.3.1: ep_status=0x81, count=16,...
		...status=01:00:20:40:05:04:04:00:20:53:00:00:00:00:00:00

Signed-off-by: Christian Vogel &lt;vogelchr@vogel.cx&gt;
Link: https://lore.kernel.org/r/20220311192833.1792-2-vogelchr@vogel.cx
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>w1/masters/ds2490: queue up found IDs during scan</title>
<updated>2021-01-20T17:50:21Z</updated>
<author>
<name>Christian Vogel</name>
<email>vogelchr@vogel.cx</email>
</author>
<published>2021-01-13T19:50:18Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e3fe0e89fec6965342434e7acae7ed6e6f021d08'/>
<id>urn:sha1:e3fe0e89fec6965342434e7acae7ed6e6f021d08</id>
<content type='text'>
Queue up found IDs in a buffer and run the callback once for each found ID
at the end. This is necessary because we hold the bus_mutex during the
whole scan, and some of the "add-device" callbacks deadlock as they
themselves want to mutex_lock(bus_mutex).

Acked-by: Evgeniy Polyakov &lt;zbr@ioremap.net&gt;
Signed-off-by: Christian Vogel &lt;vogelchr@vogel.cx&gt;
Link: https://lore.kernel.org/r/20210113195018.7498-3-vogelchr@vogel.cx
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156</title>
<updated>2019-05-30T18:26:35Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2019-05-27T06:55:05Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1a59d1b8e05ea6ab45f7e18897de1ef0e6bc3da6'/>
<id>urn:sha1:1a59d1b8e05ea6ab45f7e18897de1ef0e6bc3da6</id>
<content type='text'>
Based on 1 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license as published by
  the free software foundation either version 2 of the license or at
  your option any later version this program is distributed in the
  hope that it will be useful but without any warranty without even
  the implied warranty of merchantability or fitness for a particular
  purpose see the gnu general public license for more details you
  should have received a copy of the gnu general public license along
  with this program if not write to the free software foundation inc
  59 temple place suite 330 boston ma 02111 1307 usa

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 1334 file(s).

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Reviewed-by: Richard Fontana &lt;rfontana@redhat.com&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070033.113240726@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: w1 ds2490: Fix bug caused by improper use of altsetting array</title>
<updated>2019-04-25T09:11:41Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2019-04-22T15:16:04Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c114944d7d67f24e71562fcfc18d550ab787e4d4'/>
<id>urn:sha1:c114944d7d67f24e71562fcfc18d550ab787e4d4</id>
<content type='text'>
The syzkaller USB fuzzer spotted a slab-out-of-bounds bug in the
ds2490 driver.  This bug is caused by improper use of the altsetting
array in the usb_interface structure (the array's entries are not
always stored in numerical order), combined with a naive assumption
that all interfaces probed by the driver will have the expected number
of altsettings.

The bug can be fixed by replacing references to the possibly
non-existent intf-&gt;altsetting[alt] entry with the guaranteed-to-exist
intf-&gt;cur_altsetting entry.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reported-and-tested-by: syzbot+d65f673b847a1a96cdba@syzkaller.appspotmail.com
CC: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ds2490.c: Move struct open braces to previous line</title>
<updated>2018-07-07T15:27:13Z</updated>
<author>
<name>Henriette Hofmeier</name>
<email>passt@h-hofmeier.de</email>
</author>
<published>2018-06-14T15:20:41Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7b4bcbcdb2a9c16ec8d83f43c04c4dd4db0df032'/>
<id>urn:sha1:7b4bcbcdb2a9c16ec8d83f43c04c4dd4db0df032</id>
<content type='text'>
Move open braces of two structs to the declaration line,
as criticized by checkpatch.

Signed-off-by: Henriette Hofmeier &lt;passt@h-hofmeier.de&gt;
Signed-off-by: Florian Harbecke &lt;florian.harbecke@fau.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ds2490.c: Remove unnecessary whitespace</title>
<updated>2018-07-07T15:27:13Z</updated>
<author>
<name>Henriette Hofmeier</name>
<email>passt@h-hofmeier.de</email>
</author>
<published>2018-06-14T15:20:40Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b2dd10ce8b620f6aaafe0874c7eec4b2e275a497'/>
<id>urn:sha1:b2dd10ce8b620f6aaafe0874c7eec4b2e275a497</id>
<content type='text'>
Remove unnecessary whitespace criticized by
checkpatch.

Signed-off-by: Henriette Hofmeier &lt;passt@h-hofmeier.de&gt;
Signed-off-by: Florian Harbecke &lt;florian.harbecke@fau.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ds2490.c: Add required spaces</title>
<updated>2018-07-07T15:27:13Z</updated>
<author>
<name>Henriette Hofmeier</name>
<email>passt@h-hofmeier.de</email>
</author>
<published>2018-06-14T15:20:39Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=98860b7b605ce6b5017b5870dba4492155128280'/>
<id>urn:sha1:98860b7b605ce6b5017b5870dba4492155128280</id>
<content type='text'>
Add missing spaces in for- and while-loops
reported missing by checkpatch.

Signed-off-by: Henriette Hofmeier &lt;passt@h-hofmeier.de&gt;
Signed-off-by: Florian Harbecke &lt;florian.harbecke@fau.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
