The NetBSD Project

CVS log for src/sys/dev/usb/ualea.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / dev / usb

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.19: download - view: text, markup, annotated - select for diffs
Sun Mar 20 13:18:30 2022 UTC (4 years, 7 months ago) by riastradh
Branches: MAIN
CVS tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, perseant-exfatfs-base-20261102, perseant-exfatfs-base-20250801, perseant-exfatfs-base-20240630, perseant-exfatfs-base, perseant-exfatfs, netbsd-11-base, netbsd-11-1-RELEASE, netbsd-11-0-RELEASE, netbsd-11-0-RC7, netbsd-11-0-RC6, netbsd-11-0-RC5, netbsd-11-0-RC4, netbsd-11-0-RC3, netbsd-11-0-RC2, netbsd-11-0-RC1, netbsd-11, netbsd-10-base, netbsd-10-2-RELEASE, netbsd-10-1-RELEASE, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, bouyer-sunxi-drm-base, bouyer-sunxi-drm, HEAD
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +11 -7 lines
ualea(4): Enter the data under the softc lock.

This avoids a race with a concurrent ualea_get updating sc_needed,
which could lead to hang when requesting more entropy.

ualea(4) now survives

sysctl -w kern.entropy.depletion=1
cat </dev/random >/dev/null &
cat </dev/random >/dev/null &

without hanging for longer (even if yanked and reinserted in the
middle, although the detach path is not relevant to the bug this
change fixes).

Revision 1.18: download - view: text, markup, annotated - select for diffs
Sun Mar 20 13:13:10 2022 UTC (4 years, 7 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +19 -21 lines
ualea(4): Simplify xfer error branches.

- Avoid going into a loop in case the transfer fails repeatedly --
  just give up immediately if it fails.

- Assert result size is reasonable; no need to assume usbdi(9) is
  malicious.  If it can return ux_actlen > ux_length, that's a bug in
  usbdi(9) that we should fix.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Sun Mar 20 00:41:01 2022 UTC (4 years, 7 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +14 -7 lines
ualea(4): Fix detach and error paths.

- Set sc_needed before aborting the pipe to prevent the xfer callback
  from rescheduling itself.

- Make sure all paths out of the xfer callback clear sc_inflight.

While here, use device_printf instead of aprint_* after attach.

Now my system survives repeated insertion and yanking of ualea(4)
during:

sysctl -w kern.entropy.depletion=1
cat </dev/random >/dev/null

Revision 1.16: download - view: text, markup, annotated - select for diffs
Sat Mar 19 11:37:06 2022 UTC (4 years, 7 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +3 -3 lines
rnd(9): Adjust IPL of locks used by rndsource callbacks.

These no longer ever run from hard interrupt context or with a spin
lock held, so there is no longer any need to have them at IPL_VM to
block hard interrupts.  Instead, lower them to IPL_SOFTSERIAL.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Thu Mar 3 06:06:52 2022 UTC (4 years, 8 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +3 -3 lines
usb: usbd_close_pipe never fails.  Make it return void.

Prune dead branches as a result of this change.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Thu Mar 3 06:05:38 2022 UTC (4 years, 8 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +3 -3 lines
usb: usbd_abort_pipe never fails.  Make it return void.

Prune dead branches as a result of this change.

Revision 1.9.10.3: download - view: text, markup, annotated - select for diffs
Mon Jun 21 17:15:38 2021 UTC (5 years, 4 months ago) by martin
Branches: netbsd-9
CVS tags: netbsd-9-5-RELEASE, netbsd-9-4-RELEASE, netbsd-9-3-RELEASE
Diff to: previous 1.9.10.2: preferred, colored; branchpoint 1.9: preferred, colored; next MAIN 1.10: preferred, colored
Changes since revision 1.9.10.2: +6 -2 lines
Pull up following revision(s) (requested by riastradh in ticket #1302):

	sys/dev/usb/ualea.c: revision 1.13

ualea(4): Null suspend/resume handler.

Revision 1.12.6.1: download - view: text, markup, annotated - select for diffs
Thu Jun 17 04:46:30 2021 UTC (5 years, 5 months ago) by thorpej
Branches: thorpej-i2c-spi-conf
Diff to: previous 1.12: preferred, colored; next MAIN 1.13: preferred, colored
Changes since revision 1.12: +6 -2 lines
Sync w/ HEAD.

Revision 1.12.8.1: download - view: text, markup, annotated - select for diffs
Mon May 31 22:15:19 2021 UTC (5 years, 5 months ago) by cjep
Branches: cjep_staticlib_x
Diff to: previous 1.12: preferred, colored; next MAIN 1.13: preferred, colored
Changes since revision 1.12: +6 -2 lines
sync with head

Revision 1.13: download - view: text, markup, annotated - select for diffs
Sat May 29 08:45:19 2021 UTC (5 years, 5 months ago) by riastradh
Branches: MAIN
CVS tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-futex2-base, thorpej-futex2, thorpej-cfargs2-base, thorpej-cfargs2, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +6 -2 lines
ualea(4): Null suspend/resume handler.

Revision 1.9.10.2: download - view: text, markup, annotated - select for diffs
Wed Jul 15 13:52:05 2020 UTC (6 years, 4 months ago) by martin
Branches: netbsd-9
CVS tags: netbsd-9-2-RELEASE, netbsd-9-1-RELEASE
Diff to: previous 1.9.10.1: preferred, colored; branchpoint 1.9: preferred, colored
Changes since revision 1.9.10.1: +4 -7 lines
Pull up following revision(s) (requested by riastradh in ticket #1008):

	sys/dev/usb/ualea.c: revision 1.10

Turn XXX comment into KASSERT.

Revision 1.6.8.2: download - view: text, markup, annotated - select for diffs
Mon Jul 13 14:35:29 2020 UTC (6 years, 4 months ago) by martin
Branches: netbsd-8
CVS tags: netbsd-8-3-RELEASE
Diff to: previous 1.6.8.1: preferred, colored; branchpoint 1.6: preferred, colored; next MAIN 1.7: preferred, colored
Changes since revision 1.6.8.1: +7 -7 lines
Pull up following revision(s) (requested by simonb in ticket #1573):

	sys/dev/usb/ualea.c: revision 1.12

Set up the USB xfer for every transfer, not just once in the attach
function.  Caught by DIAGNOSTIC on a similar driver.  Thanks to mrg@
for USB xfer clue and martin@ for testing.

Revision 1.9.10.1: download - view: text, markup, annotated - select for diffs
Mon Jul 13 14:32:20 2020 UTC (6 years, 4 months ago) by martin
Branches: netbsd-9
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +7 -7 lines
Pull up following revision(s) (requested by simonb in ticket #1003):

	sys/dev/usb/ualea.c: revision 1.12

Set up the USB xfer for every transfer, not just once in the attach
function.  Caught by DIAGNOSTIC on a similar driver.  Thanks to mrg@
for USB xfer clue and martin@ for testing.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Mon Jul 13 13:53:04 2020 UTC (6 years, 4 months ago) by simonb
Branches: MAIN
CVS tags: thorpej-futex-base, thorpej-futex, thorpej-cfargs-base, thorpej-cfargs, cjep_staticlib_x-base
Branch point for: thorpej-i2c-spi-conf, cjep_staticlib_x
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +7 -7 lines
Set up the USB xfer for every transfer, not just once in the attach
function.  Caught by DIAGNOSTIC on a similar driver.  Thanks to phone@
for USB xfer clue and martin@ for testing.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Thu Apr 30 03:40:53 2020 UTC (6 years, 6 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +10 -31 lines
rnd_attach_source calls the callback itself now.

No need for every driver to explicitly call it to prime the pool.

Eliminate now-unused <sys/rndpool.h>.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Thu Apr 30 03:24:28 2020 UTC (6 years, 6 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +4 -7 lines
Turn XXX comment into KASSERT.

Revision 1.6.8.1: download - view: text, markup, annotated - select for diffs
Wed Jan 31 18:01:54 2018 UTC (8 years, 9 months ago) by martin
Branches: netbsd-8
CVS tags: netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +72 -25 lines
Pull up following revision(s) (requested by skrll in ticket #509):
	sys/dev/usb/if_ural.c: revision 1.53
	sys/dev/usb/if_run.c: revision 1.25
	sys/dev/usb/ustir.c: revision 1.39
	sys/dev/usb/irmce.c: revision 1.4
	sys/dev/usb/if_urtwn.c: revision 1.56
	sys/dev/usb/pseye.c: revision 1.24
	sys/dev/usb/if_rum.c: revision 1.59
	sys/dev/usb/if_upl.c: revision 1.61
	sys/dev/usb/ucom.c: revision 1.120
	sys/dev/usb/if_zyd.c: revision 1.45
	sys/dev/usb/if_axen.c: revision 1.12
	sys/dev/usb/umidi.c: revision 1.74
	sys/dev/usb/if_udav.c: revision 1.52
	sys/dev/usb/if_athn_usb.c: revision 1.25
	sys/dev/usb/usscanner.c: revision 1.43
	sys/dev/usb/ualea.c: revision 1.6 - 1.9
	sys/dev/usb/if_upgt.c: revision 1.18
	sys/dev/usb/if_atu.c: revision 1.56
	sys/dev/usb/utoppy.c: revision 1.30
	sys/dev/usb/ubt.c: revision 1.60
	sys/dev/usb/if_urtw.c: revision 1.14
	sys/dev/usb/uirda.c: revision 1.43
	sys/dev/usb/umass.c: revision 1.163
	sys/dev/usb/if_cdce.c: revision 1.45
	sys/dev/usb/if_cue.c: revision 1.77
	sys/dev/usb/if_kue.c: revision 1.91
	sys/dev/usb/uvideo.c: revision 1.46
	sys/dev/usb/uhso.c: revision 1.27
	sys/dev/usb/if_smsc.c: revision 1.33
	sys/dev/usb/ugen.c: revision 1.137
	sys/dev/usb/if_axe.c: revision 1.84
	sys/dev/usb/if_aue.c: revision 1.142
	sys/dev/usb/uscanner.c: revision 1.82
	sys/dev/usb/if_urndis.c: revision 1.17
	sys/dev/usb/udsir.c: revision 1.6
	sys/dev/usb/if_url.c: revision 1.57
	sys/dev/usb/if_otus.c: revision 1.32
	sys/dev/usb/ulpt.c: revision 1.99

PR kern/52931 Kernel panics with Atheros usb wireless interface
Audit the flags to usbd_create_xfer so that USBD_FORCE_SHORT_XFER is
supplied wherever such a transfer is setup.  We can drop
USBD_SHORT_XFER_OK as it has not bearing on number of TDs

ualea: Tidy up a bit.  Fulfil requests completely.
Don't subtract uninitialized pktsize in error path.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Sun Jan 21 13:57:12 2018 UTC (8 years, 9 months ago) by skrll
Branches: MAIN
CVS tags: phil-wifi-base, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, phil-wifi, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, netbsd-9-base, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, jdolecek-ncqfixes-base, jdolecek-ncqfixes, isaki-audio2-base, isaki-audio2, is-mlppp-base, is-mlppp, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh, ad-namecache-base3, ad-namecache-base2, ad-namecache-base1, ad-namecache-base, ad-namecache
Branch point for: netbsd-9
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +4 -4 lines
PR kern/52931 Kernel panics with Atheros usb wireless interface

Audit the flags to usbd_create_xfer so that USBD_FORCE_SHORT_XFER is
supplied wherever such a transfer is setup.  We can drop
USBD_SHORT_XFER_OK as it has not bearing on number of TDs

Revision 1.8.4.2: download - view: text, markup, annotated - select for diffs
Sun Dec 3 11:37:34 2017 UTC (8 years, 11 months ago) by jdolecek
Branches: tls-maxphys
Diff to: previous 1.8.4.1: preferred, colored; branchpoint 1.8: preferred, colored; next MAIN 1.9: preferred, colored
Changes since revision 1.8.4.1: +309 -0 lines
update from HEAD

Revision 1.8.2.2: download - view: text, markup, annotated - select for diffs
Mon Aug 28 17:52:27 2017 UTC (9 years, 2 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.8.2.1: preferred, colored; branchpoint 1.8: preferred, colored; next MAIN 1.9: preferred, colored
Changes since revision 1.8.2.1: +309 -0 lines
Sync with HEAD

Revision 1.8.4.1
Tue Jul 18 23:11:01 2017 UTC (9 years, 4 months ago) by jdolecek
Branches: tls-maxphys
FILE REMOVED
Changes since revision 1.8: +0 -309 lines
file ualea.c was added on branch tls-maxphys on 2017-12-03 11:37:34 +0000

Revision 1.8.2.1
Tue Jul 18 23:11:01 2017 UTC (9 years, 4 months ago) by skrll
Branches: nick-nhusb
FILE REMOVED
Changes since revision 1.8: +0 -309 lines
file ualea.c was added on branch nick-nhusb on 2017-08-28 17:52:27 +0000

Revision 1.8: download - view: text, markup, annotated - select for diffs
Tue Jul 18 23:11:01 2017 UTC (9 years, 4 months ago) by christos
Branches: MAIN
CVS tags: tls-maxphys-base-20171202, nick-nhusb-base-20170825
Branch point for: tls-maxphys, nick-nhusb
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +3 -3 lines
don't subtract uninitialized pktsize in error path.

Revision 1.7.2.2: download - view: text, markup, annotated - select for diffs
Sat Jul 15 05:46:10 2017 UTC (9 years, 4 months ago) by riastradh
Branches: perseant-stdc-iso10646
Diff to: previous 1.7.2.1: preferred, colored; branchpoint 1.7: preferred, colored; next MAIN 1.8: preferred, colored
Changes since revision 1.7.2.1: +309 -0 lines
2992172

Revision 1.7.2.1
Sat Jul 15 05:46:09 2017 UTC (9 years, 4 months ago) by riastradh
Branches: perseant-stdc-iso10646
FILE REMOVED
Changes since revision 1.7: +0 -309 lines
file ualea.c was added on branch perseant-stdc-iso10646 on 2017-07-15 05:46:10 +0000

Revision 1.7: download - view: text, markup, annotated - select for diffs
Sat Jul 15 05:46:09 2017 UTC (9 years, 4 months ago) by riastradh
Branches: MAIN
CVS tags: perseant-stdc-iso10646-base
Branch point for: perseant-stdc-iso10646
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +70 -23 lines
Tidy up a bit.  Fulfil requests completely.

Revision 1.6.4.2: download - view: text, markup, annotated - select for diffs
Wed Apr 26 02:53:23 2017 UTC (9 years, 6 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.6.4.1: preferred, colored; branchpoint 1.6: preferred, colored; next MAIN 1.7: preferred, colored
Changes since revision 1.6.4.1: +262 -0 lines
Sync with HEAD

Revision 1.6.2.2: download - view: text, markup, annotated - select for diffs
Fri Apr 21 16:53:53 2017 UTC (9 years, 6 months ago) by bouyer
Branches: bouyer-socketcan
Diff to: previous 1.6.2.1: preferred, colored; branchpoint 1.6: preferred, colored; next MAIN 1.7: preferred, colored
Changes since revision 1.6.2.1: +262 -0 lines
Sync with HEAD

Revision 1.6.4.1
Wed Apr 19 00:01:38 2017 UTC (9 years, 7 months ago) by pgoyette
Branches: pgoyette-localcount
FILE REMOVED
Changes since revision 1.6: +0 -262 lines
file ualea.c was added on branch pgoyette-localcount on 2017-04-26 02:53:23 +0000

Revision 1.6.2.1
Wed Apr 19 00:01:38 2017 UTC (9 years, 7 months ago) by bouyer
Branches: bouyer-socketcan
FILE REMOVED
Changes since revision 1.6: +0 -262 lines
file ualea.c was added on branch bouyer-socketcan on 2017-04-21 16:53:53 +0000

Revision 1.6: download - view: text, markup, annotated - select for diffs
Wed Apr 19 00:01:38 2017 UTC (9 years, 7 months ago) by riastradh
Branches: MAIN
CVS tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, netbsd-8-base, matt-nb8-mediatek-base, matt-nb8-mediatek, bouyer-socketcan-base1
Branch point for: pgoyette-localcount, netbsd-8, bouyer-socketcan
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +32 -2 lines
Modularize ualea(4).

Unclear why we have a separate xyz.ioconf for module and XYZ.ioconf
for rump component, but at least xyz_modcmd obviates the need for
xyz_component.c (though evidently the latter could have been replaced
anyway by RUMP_COMPONENT=ioconf in the rump component Makefile).

Revision 1.5: download - view: text, markup, annotated - select for diffs
Tue Apr 18 19:09:12 2017 UTC (9 years, 7 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +3 -3 lines
gson@ informs me the Alea I and II have the same USB product id.

Thus, ualea(4) should work for both of them.  Rename USB product id
ARANEUS ALEA_II to ARANEUS ALEA to reflect this.

No functional change intended, except perhaps via usbdevs.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Mon Apr 17 16:42:07 2017 UTC (9 years, 7 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +3 -3 lines
IPL_SOFTUSB suffices here to synchronize with usb xfer callback.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Mon Apr 17 15:43:40 2017 UTC (9 years, 7 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +4 -2 lines
Follow my own locking rules.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Mon Apr 17 09:16:13 2017 UTC (9 years, 7 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +5 -7 lines
Tweak locking rule.  Fix broken unlocked rmw.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Mon Apr 17 08:59:37 2017 UTC (9 years, 7 months ago) by riastradh
Branches: MAIN
New rndsource driver for Araneus Alea II TRNG USB devices.

Disabled by default in x86/GENERIC and usbdevices.config pending
review and testing without rump ugenhc in the way, but enabled in
x86/ALL for compile-testing.

(Hi gson!  Finally found a round tuit in my pocket, next to a certain
rectangular one.)

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

CVSweb <webmaster@jp.NetBSD.org>