The NetBSD Project

CVS log for src/sys/dev/sdmmc/ld_sdmmc.c

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

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.41 / (download) - annotate - [select for diffs], Sun Aug 2 01:17:56 2020 UTC (17 months, 4 weeks ago) by riastradh
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-futex, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, HEAD
Changes since 1.40: +15 -13 lines
Diff to previous 1.40 (unified)

Remove unnecessary wait in ldbegindetach.

Like disk_begindetach, ldbegindetach only commits to detaching but
doesn't wait for existing xfers to drain; it is up to the driver to
abort them, once we are committed, and then ldenddetach to wait for
them to drain.

Revision 1.40 / (download) - annotate - [select for diffs], Wed Jul 22 17:18:10 2020 UTC (18 months, 1 week ago) by riastradh
Branch: MAIN
Changes since 1.39: +11 -9 lines
Diff to previous 1.39 (unified)

Sort #includes.  Nix trailing whitespace.

No functional change intended.

Revision 1.39 / (download) - annotate - [select for diffs], Wed Jul 22 17:17:37 2020 UTC (18 months, 1 week ago) by riastradh
Branch: MAIN
Changes since 1.38: +3 -3 lines
Diff to previous 1.38 (unified)

Omit needless <sys/pcq.h>.

Revision 1.38 / (download) - annotate - [select for diffs], Sun May 24 17:26:18 2020 UTC (20 months ago) by riastradh
Branch: MAIN
Changes since 1.37: +241 -54 lines
Diff to previous 1.37 (unified)

Fix races in sdmmc tasks and teach ld@sdmmc to abort xfers on detach.

- Teach sdmmc_add_task to queue it only if not already queued.
- Remove now-redundant logic to avoid repeated queueing elsewhere.
- Teach sdmmc_del_task to wait until task has completed.
- Call sdmmc_del_task in various needful places.
- Replace abuse of pcq by a lock and a tailq.
  (pcq is multi-producer, _single_-consumer, but there are potentially
  multiple consumers here and really only one producer.)
- Teach ld_sdmmc to abort xfers on detach.
  (Mechanism is kinda kludgey but it'll do for now; any effort one is
  tempted to spend overhauling this should be spent overhauling sdmmc
  to support proper asynchronous commands.)
- Make sure ld_sdmmc_discard either returns failure or eventually calls
  ldenddiscard.

XXX Currently ld_sdmmc_detach aborts xfers _before_ ldbegindetach has
has committed to detaching or not.  This is currently necessary to
avoid a deadlock because ldbegindetach waits for xfers to drain --
which strikes me as wrong; ldbegindetach shouldn't wait for anything,
and should only make the decision to commit to detaching or not so
the caller can decide whether to abort xfers before we actually wait
for them in ldenddetach.

XXX pullup -- although this changes some kernel symbols (sdmmc_add_task
and sdmmc_del_task), it shouldn't affect any existing modules; the only
module that uses sdmmc is ld_sdmmc.kmod, which is `.if 0' in the build
so there shouldn't be any of them floating around.

Revision 1.37 / (download) - annotate - [select for diffs], Mon Oct 28 06:31:39 2019 UTC (2 years, 3 months ago) by mlelstv
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, 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
Changes since 1.36: +5 -5 lines
Diff to previous 1.36 (unified)

Whitespace police

Revision 1.36 / (download) - annotate - [select for diffs], Tue Mar 19 07:08:43 2019 UTC (2 years, 10 months ago) by mlelstv
Branch: MAIN
CVS Tags: phil-wifi-20190609, netbsd-9-base, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, isaki-audio2-base, isaki-audio2
Branch point for: netbsd-9
Changes since 1.35: +8 -2 lines
Diff to previous 1.35 (unified)

Provide CID data (manufacturer/product id/product name) as disk type.

Revision 1.35 / (download) - annotate - [select for diffs], Fri Nov 9 14:39:19 2018 UTC (3 years, 2 months ago) by jmcneill
Branch: MAIN
CVS Tags: pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126
Changes since 1.34: +57 -5 lines
Diff to previous 1.34 (unified)

Defer DIOCCACHESYNC to the sdmmc task queue so they are serialized with other requests.

Revision 1.34 / (download) - annotate - [select for diffs], Sun Aug 20 15:58:43 2017 UTC (4 years, 5 months ago) by mlelstv
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202, phil-wifi-base, pgoyette-compat-base, 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, nick-nhusb-base-20170825, jdolecek-ncqfixes-base, jdolecek-ncqfixes
Branch point for: phil-wifi, pgoyette-compat
Changes since 1.33: +17 -15 lines
Diff to previous 1.33 (unified)

make the sc_discard interface for the ld backend asynchronous and
signal completion through new callback lddiscardend. Use a standard
struct buf to pass disk address and range instead of two off_t values.

make lddiscard synchronous again. This is a requirement of the current
ffs discard code.

Revision 1.33 / (download) - annotate - [select for diffs], Fri Aug 11 18:41:42 2017 UTC (4 years, 5 months ago) by jmcneill
Branch: MAIN
Changes since 1.32: +60 -5 lines
Diff to previous 1.32 (unified)

Defer sdmmc discard operations to the sdmmc task queue. Fixes a panic
introduced by ld.c r1.102.

Revision 1.32 / (download) - annotate - [select for diffs], Wed Aug 9 16:44:40 2017 UTC (4 years, 5 months ago) by mlelstv
Branch: MAIN
Changes since 1.31: +3 -3 lines
Diff to previous 1.31 (unified)

While ld(4) is MP safe, many backends are not.

Add a flag for backends that are MP safe. Take KERNEL_LOCK when calling
into a backend that doesn't have the flag set. Do the same for the
discard routine.

Fixes PR 52462.

Revision 1.31 / (download) - annotate - [select for diffs], Sun Jul 16 17:11:46 2017 UTC (4 years, 6 months ago) by jmcneill
Branch: MAIN
CVS Tags: perseant-stdc-iso10646-base
Branch point for: perseant-stdc-iso10646
Changes since 1.30: +26 -2 lines
Diff to previous 1.30 (unified)

Add support for eMMC 4.5's optional cache feature. If a cache is present,
and the host controller reports the SMC_CAPS_POLLING capability (needed
to flush cache at shutdown), it will be automatically enabled and used.

Revision 1.30 / (download) - annotate - [select for diffs], Mon Jul 10 10:35:07 2017 UTC (4 years, 6 months ago) by mlelstv
Branch: MAIN
Changes since 1.29: +9 -4 lines
Diff to previous 1.29 (unified)

Decrypt comment about the attach thread. No functional change.

Revision 1.29 / (download) - annotate - [select for diffs], Sat Jul 8 18:38:57 2017 UTC (4 years, 6 months ago) by jmcneill
Branch: MAIN
Changes since 1.28: +3 -3 lines
Diff to previous 1.28 (unified)

The config_* APIs are not MPSAFE, so make sure the deferred attach
thread holds KERNEL_LOCK.

Revision 1.28 / (download) - annotate - [select for diffs], Sat Jun 24 11:27:33 2017 UTC (4 years, 7 months ago) by jmcneill
Branch: MAIN
Changes since 1.27: +12 -2 lines
Diff to previous 1.27 (unified)

Add discard support to ld@sdmmc using the ERASE (CMD38) command.

Revision 1.27 / (download) - annotate - [select for diffs], Tue Jun 6 21:01:07 2017 UTC (4 years, 7 months ago) by jmcneill
Branch: MAIN
Changes since 1.26: +15 -10 lines
Diff to previous 1.26 (unified)

Fix a race between ld_sdmmc_start and ld_sdmmc_dobio that could result in
tasks getting lost from the task queue. The symptom of this is a NULL
deref in ld_sdmmc_start since the code assumes that a task will always be
available from the pool.

This changes the code to use pcq(9) instead of a TAILQ to manage the free
task list.

Revision 1.26 / (download) - annotate - [select for diffs], Sat Apr 22 14:19:36 2017 UTC (4 years, 9 months ago) by jmcneill
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, netbsd-8-base
Branch point for: netbsd-8
Changes since 1.25: +5 -4 lines
Diff to previous 1.25 (unified)

Ensure that the task is returned to the free task list in an error branch.

Revision 1.25 / (download) - annotate - [select for diffs], Sat Jan 7 16:24:40 2017 UTC (5 years ago) by martin
Branch: MAIN
CVS Tags: pgoyette-localcount-20170320, nick-nhusb-base-20170204, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Changes since 1.24: +4 -2 lines
Diff to previous 1.24 (unified)

Add missing includes

Revision 1.24 / (download) - annotate - [select for diffs], Sat Jan 7 14:49:53 2017 UTC (5 years ago) by kiyohara
Branch: MAIN
Changes since 1.23: +51 -10 lines
Diff to previous 1.23 (unified)

Support retry when error.  like wd(4).

Revision 1.23 / (download) - annotate - [select for diffs], Tue Sep 27 03:33:33 2016 UTC (5 years, 4 months ago) by pgoyette
Branch: MAIN
CVS Tags: pgoyette-localcount-20170107, pgoyette-localcount-20161104, nick-nhusb-base-20161204, nick-nhusb-base-20161004
Changes since 1.22: +48 -2 lines
Diff to previous 1.22 (unified)

Modularize the ld driver and all of its attachments.  Ensure that all
parents are capable of rescan (or otherwise provide a means of attaching
children post-initialization).

Revision 1.22 / (download) - annotate - [select for diffs], Fri Sep 16 15:20:50 2016 UTC (5 years, 4 months ago) by jdolecek
Branch: MAIN
Changes since 1.21: +3 -3 lines
Diff to previous 1.21 (unified)

modify ldattach() to have default strategy as a parameter

Revision 1.21 / (download) - annotate - [select for diffs], Fri Aug 28 06:04:43 2015 UTC (6 years, 5 months ago) by mlelstv
Branch: MAIN
CVS Tags: pgoyette-localcount-base, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20160907, nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226, nick-nhusb-base-20150921, localcount-20160914
Branch point for: pgoyette-localcount
Changes since 1.20: +2 -3 lines
Diff to previous 1.20 (unified)

remove unused include sys/rndsource.h

Revision 1.20 / (download) - annotate - [select for diffs], Sun Aug 9 13:49:18 2015 UTC (6 years, 5 months ago) by mlelstv
Branch: MAIN
Changes since 1.19: +11 -5 lines
Diff to previous 1.19 (unified)

Add small command queue to reduce latency between ld driver and
sdmmc I/O thread.

Revision 1.19 / (download) - annotate - [select for diffs], Mon Aug 3 10:09:08 2015 UTC (6 years, 5 months ago) by jmcneill
Branch: MAIN
Changes since 1.18: +5 -4 lines
Diff to previous 1.18 (unified)

Print the selected transfer mode if known.

Revision 1.18 / (download) - annotate - [select for diffs], Mon Aug 3 05:32:50 2015 UTC (6 years, 5 months ago) by mlelstv
Branch: MAIN
Changes since 1.17: +3 -7 lines
Diff to previous 1.17 (unified)

use mutex locking for MP safety.

Revision 1.17 / (download) - annotate - [select for diffs], Mon Jul 27 07:53:46 2015 UTC (6 years, 6 months ago) by skrll
Branch: MAIN
Changes since 1.16: +2 -33 lines
Diff to previous 1.16 (unified)

Don't timeout waiting for ld_sdmmc_dobio in the IO thread to start.

XXX why does it take >1s to get scheduled?

Revision 1.16 / (download) - annotate - [select for diffs], Wed May 20 13:09:34 2015 UTC (6 years, 8 months ago) by jmcneill
Branch: MAIN
CVS Tags: nick-nhusb-base-20150606
Changes since 1.15: +7 -5 lines
Diff to previous 1.15 (unified)

need to call lddone with splbio and kernel lock held

Revision 1.15 / (download) - annotate - [select for diffs], Mon Apr 13 16:33:25 2015 UTC (6 years, 9 months ago) by riastradh
Branch: MAIN
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (unified)

Convert sys/dev to use <sys/rndsource.h>.

Revision 1.14 / (download) - annotate - [select for diffs], Thu Oct 2 21:49:22 2014 UTC (7 years, 3 months ago) by jmcneill
Branch: MAIN
CVS Tags: nick-nhusb-base-20150406, nick-nhusb-base
Branch point for: nick-nhusb
Changes since 1.13: +3 -3 lines
Diff to previous 1.13 (unified)

debug ld_sdmmc with LD_SDMMC_DEBUG instead of SDMMC_DEBUG

Revision 1.13 / (download) - annotate - [select for diffs], Thu Oct 2 18:16:13 2014 UTC (7 years, 3 months ago) by mlelstv
Branch: MAIN
Changes since 1.12: +9 -6 lines
Diff to previous 1.12 (unified)

Be a bit more verbose about errors, also pass through error code
from lower layer like other drivers.

Revision 1.12 / (download) - annotate - [select for diffs], Sat Oct 12 16:49:01 2013 UTC (8 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, netbsd-7-base
Branch point for: netbsd-7
Changes since 1.11: +4 -4 lines
Diff to previous 1.11 (unified)

Pass the device name in, so we can debug what deferred drivers did not work.

Revision 1.11 / (download) - annotate - [select for diffs], Fri Dec 14 23:53:56 2012 UTC (9 years, 1 month ago) by jakllsch
Branch: MAIN
CVS Tags: yamt-pagecache-base8, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, khorben-n900, agc-symver-base, agc-symver
Branch point for: rmind-smpnet
Changes since 1.10: +6 -4 lines
Diff to previous 1.10 (unified)

Display the whole CID register upon attach as "<MID:OID:PNM:PRV:PSN:MDT>"
instead of just "<PNM>".  Probably should figure out a way to stuff this
into the device properties database too, but not everything has
pseudo-device drvctl enabled.

Also, drop trailing whitespace.

Revision 1.10 / (download) - annotate - [select for diffs], Thu Feb 2 19:43:06 2012 UTC (9 years, 11 months ago) by tls
Branch: MAIN
CVS Tags: yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base10
Branch point for: tls-maxphys
Changes since 1.9: +2 -5 lines
Diff to previous 1.9 (unified)

Entropy-pool implementation move and cleanup.

1) Move core entropy-pool code and source/sink/sample management code
   to sys/kern from sys/dev.

2) Remove use of NRND as test for presence of entropy-pool code throughout
   source tree.

3) Remove use of RND_ENABLED in device drivers as microoptimization to
   avoid expensive operations on disabled entropy sources; make the
   rnd_add calls do this directly so all callers benefit.

4) Fix bug in recent rnd_add_data()/rnd_add_uint32() changes that might
   have lead to slight entropy overestimation for some sources.

5) Add new source types for environmental sensors, power sensors, VM
   system events, and skew between clocks, with a sample implementation
   for each.

ok releng to go in before the branch due to the difficulty of later
pullup (widespread #ifdef removal and moved files).  Tested with release
builds on amd64 and evbarm and live testing on amd64.

Revision 1.9 / (download) - annotate - [select for diffs], Wed Feb 1 22:34:42 2012 UTC (9 years, 11 months ago) by matt
Branch: MAIN
Changes since 1.8: +5 -2 lines
Diff to previous 1.8 (unified)

Use "opt_sdmmc.h" for SDMMC_DEBUG, etc.

Revision 1.8 / (download) - annotate - [select for diffs], Fri Jan 27 14:28:33 2012 UTC (10 years ago) by tsutsui
Branch: MAIN
Changes since 1.7: +4 -2 lines
Diff to previous 1.7 (unified)

Protect ldattach ops with config_pending_intr(9)/config_pending_decr(9)
so that "boot device: ld0" detection works properly even on slower zaurus.

Revision 1.7 / (download) - annotate - [select for diffs], Sat Nov 13 13:52:11 2010 UTC (11 years, 2 months ago) by uebayasi
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, rmind-uvmplock-nbase, rmind-uvmplock-base, matt-mips64-premerge-20101231, jruoho-x86intr-base, jruoho-x86intr, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base, jmcneill-audiomp3-base, jmcneill-audiomp3, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: yamt-pagecache, jmcneill-usbmp
Changes since 1.6: +2 -4 lines
Diff to previous 1.6 (unified)

Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants.  These are provided by sys/param.h now.

Revision 1.6 / (download) - annotate - [select for diffs], Thu Sep 23 12:03:27 2010 UTC (11 years, 4 months ago) by kiyohara
Branch: MAIN
CVS Tags: yamt-nfs-mp-base11, uebayasi-xip-base4, uebayasi-xip-base3
Changes since 1.5: +10 -2 lines
Diff to previous 1.5 (unified)

Print bus width and clock for feature(High speed support).

Revision 1.5 / (download) - annotate - [select for diffs], Mon Sep 20 09:03:33 2010 UTC (11 years, 4 months ago) by kiyohara
Branch: MAIN
Changes since 1.4: +3 -3 lines
Diff to previous 1.4 (unified)

Print product name.  like sd(4), wd(4) and etc...

Revision 1.4 / (download) - annotate - [select for diffs], Sat Nov 28 10:00:24 2009 UTC (12 years, 2 months ago) by nonaka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9, yamt-nfs-mp-base10, uebayasi-xip-base2, uebayasi-xip-base1, uebayasi-xip-base, matt-premerge-20091211
Branch point for: uebayasi-xip, rmind-uvmplock, matt-nb5-mips64
Changes since 1.3: +3 -3 lines
Diff to previous 1.3 (unified)

Always sector size is treated as 512 bytes.

Revision 1.3 / (download) - annotate - [select for diffs], Fri May 29 22:27:40 2009 UTC (12 years, 8 months ago) by nonaka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base8, yamt-nfs-mp-base7, yamt-nfs-mp-base6, yamt-nfs-mp-base5, jymxensuspend-base, jym-xensuspend-nbase
Branch point for: netbsd-5
Changes since 1.2: +22 -2 lines
Diff to previous 1.2 (unified)

It is avoided that the error occurs when the card attaches it,
when wedge is supported.

Revision 1.2 / (download) - annotate - [select for diffs], Wed May 6 08:20:49 2009 UTC (12 years, 8 months ago) by cegger
Branch: MAIN
CVS Tags: yamt-nfs-mp-base4, jym-xensuspend-base
Branch point for: jym-xensuspend
Changes since 1.1: +4 -4 lines
Diff to previous 1.1 (unified)

struct cfdata * -> cfdata_t, no functional changes intended.

Revision 1.1 / (download) - annotate - [select for diffs], Tue Apr 21 03:00:30 2009 UTC (12 years, 9 months ago) by nonaka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base
Branch point for: yamt-nfs-mp, nick-hppapmap

Added SD/MMC support from OpenBSD.
tested on i386, amd64 at current-users ML by pgoyette@.
tested on zaurus by myself.

This form allows you to request diff's 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.




CVSweb <webmaster@jp.NetBSD.org>