aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/rtsx
Commit message (Collapse)AuthorAgeFilesLines
* mmc: Use bus_topo_lock and taskqueue_bus while adding/removing child devicesJohn Baldwin2025-03-101-7/+11
| | | | | | | | | | | Some drivers held regular mutexes across some new-bus calls; instead depend on bus_topo_lock to protect the relevant softc members. This also fixes the bus_topo_lock to be explicit in these drivers rather than relying on the implicit Giant from taskqueue_swi_giant. It avoids calling sleepable routines like device_probe_and_attach from an swi context. Differential Revision: https://reviews.freebsd.org/D49270
* Use bus_generic_detach instead of device_delete_children in detachJohn Baldwin2025-01-021-2/+2
| | | | | | | While here, check for errors from bus_generic_detach and move it to the start of detach if necessary. Differential Revision: https://reviews.freebsd.org/D47969
* rtsw: Break out as soon as we find we're doing the inversion workaroundWarner Losh2024-11-201-0/+1
| | | | | | | | | Once we set that we're doing the inversion workaround, there's no sense continuing to search for the inversion workaround. Sponsored by: Netflix Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D47686
* newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANYWarner Losh2024-07-251-1/+1
| | | | Sponsored by: Netflix
* Fix new users of MAXPHYS and hide it from the kernel namespaceAndrew Gallatin2024-04-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In cd8537910406, kib made maxphys a load-time tunable. This made the #define MAXPHYS in sys/param.h almost entirely obsolete, as it could now be overridden by kern.maxphys at boot time, or by opt_maxphys.h. However, decades of tradition have led to several new, incorrect, uses of MAXPHYS in other parts of the kernel, mostly by seasoned developers. I've corrected those uses here in a mechanical fashion, and verified that it fixes a bug in the md driver that I was experiencing. Since using MAXPHYS is such an easy mistake to make, it is best to hide it from the kernel namespace. So I've moved its definition to _maxphys.h, which is now included in param.h only for userspace. That brings up the fact that lots of userspace programs use MAXPHYS for different reasons, most of them probably wrong. Userspace consumers that really need to know the value of maxphys should probably be changed to use the kern.maxphys sysctl. But that's outside the scope of this change. Reviewed by: imp, jkim, kib, markj Fixes: 30038a8b4efc ("md: Get rid of the pbuf zone") Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D44986
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-1/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-122-2/+2
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* rtsx: Add plug-and-play infoHenri Hennebert2023-04-131-24/+25
| | | | | | | | Add MODULE_PNP_INFO() to the driver to make it autoload if not linked statically into the kernel. Remove the device from amd64/i386 GENERIC. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D35074
* rtsx: purge EOL release compatibilityElliott Mitchell2023-02-041-4/+0
| | | | | | | | Remove support for FreeBSD 11 and earlier Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/603 Differential Revision: https://reviews.freebsd.org/D35560
* rtsx: Remove unused devclass argument to DRIVER_MODULE.John Baldwin2022-05-061-3/+1
|
* rtsx: Number of tweaks for RTS5260.Henri Hennebert2022-04-272-23/+63
| | | | MFC after: 2 weeks
* rtsx: Remove update of softc during probe and some var rename.Henri Hennebert2022-03-251-28/+30
| | | | MFC after: 1 week
* rtsx: Display error if rtsx_read()/rtsx_write() fail.Henri Hennebert2022-03-241-12/+22
| | | | MFC after: 1 week
* rtsx: Don't detach during shutdownHenri Hennebert2022-03-241-2/+0
| | | | MFC after: 1 week
* rtsx: Call rtsx_init() on resume.hlh-restart2022-03-191-1/+3
| | | | MFC after: 3 days
* rtsx: Add RTS5260 support and replace bootverbose with sysctl.Henri Hennebert2022-02-192-72/+185
| | | | | | Tested by: mav MFC after: 4 days Differential Revision: https://reviews.freebsd.org/D34246
* rtsx: Update driver version number to 2.1cHenri Hennebert2022-02-031-1/+1
| | | | Differential Revision: https://reviews.freebsd.org/D32154
* rtsx: Do not display pci_read_config() errors during rtsx_init()Henri Hennebert2022-02-031-6/+6
| | | | Differential Revision: https://reviews.freebsd.org/D32154
* rtsx: Add CTLFLAG_STATS flag for read and write countersHenri Hennebert2022-02-031-2/+2
| | | | Differential Revision: https://reviews.freebsd.org/D32154
* rtsx: Prefer __FreeBSD_version over __FreeBSD__Henri Hennebert2022-02-031-2/+2
| | | | | | No functional change. Differential Revision: https://reviews.freebsd.org/D32154
* rtsx: Convert driver to use the mmc_sim interfaceHenri Hennebert2022-02-031-216/+70
| | | | | | | | A lot more generic cam related things were done in mmc_sim so this simplifies the driver a lot. Differential Revision: https://reviews.freebsd.org/D32154 Reviewed by: imp
* rtsx: Call taskqueue sooner, adjust DELAY(9) calls, add an inversion heuristicHenri Hennebert2021-09-091-43/+89
| | | | | | | | | | | | | | | | | | | | | | - Some configurations, e.g. HP EliteBook 840 G3, come with a dummy card in the card slot which is detected as a valid SD card. This added long timeout at boot time. To alleviate the problem, the default timeout is reduced to one second during the setup phase. [1] - Some configurations crash at boot if rtsx(4) is defined in the kernel config. At boot time, without a card inserted, the driver found that a card is present and just after that a "spontaneous" interrupt is generated showing that no card is present. To solve this problem, DELAY(9) is set to one quarter of a second before checking card presence during driver attach. - As advised by adrian, taskqueue and DMA are set up sooner during the driver attach. A heuristic to try to detect configuration needing inversion was added. PR: 255130 [1] MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30499
* Fix some common typos in source code commentsGordon Bergling2021-08-281-1/+1
| | | | | | | | | - s/priviledged/privileged/ - s/funtion/function/ - s/doens't/doesn't/ - s/sychronization/synchronization/ MFC after: 3 days
* rtsx: Fix wakeup race similar to sdhci one fixed in 35547df5c786Warner Losh2021-08-101-1/+1
| | | | | | | rtsx copied code from sdhci, and has the same wakeup race bug that was fixed in 35547df5c786, so apply a similar fix here. Sponsored by: Netflix
* Port rtsx(4) driver for Realtek SD card reader from OpenBSD.Jung-uk Kim2020-11-242-0/+4671
This driver provides support for Realtek PCI SD card readers. It attaches mmc(4) bus on card insertion and detaches it on card removal. It has been tested with RTS5209, RTS5227, RTS5229, RTS522A, RTS525A and RTL8411B. It should also work with RTS5249, RTL8402 and RTL8411. PR: 204521 Submitted by: Henri Hennebert (hlh at restart dot be) Reviewed by: imp, jkim Differential Revision: https://reviews.freebsd.org/D26435 Notes: svn path=/head/; revision=367998