Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-10]: src/sys/dev/sdmmc Pull up following revision(s) (requested b...



details:   https://anonhg.NetBSD.org/src/rev/4648a80e0fa7
branches:  netbsd-10
changeset: 374531:4648a80e0fa7
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Apr 30 10:58:07 2023 +0000

description:
Pull up following revision(s) (requested by jmcneill in ticket #151):

        sys/dev/sdmmc/sdmmc_mem.c: revision 1.75

sdmmc: Only check chipset WP status for SD cards.

The sdmmc_chip_write_protect callback returns the write protect switch
status from the controller (SDWP#). This signal does not exist for eMMC;
instead, write protect is signaled using card registers (CSD). So lets
skip asking the chipset for WP status on eMMC cards for each write
request.

diffstat:

 sys/dev/sdmmc/sdmmc_mem.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 7893cdb2b634 -r 4648a80e0fa7 sys/dev/sdmmc/sdmmc_mem.c
--- a/sys/dev/sdmmc/sdmmc_mem.c Tue Apr 25 16:17:59 2023 +0000
+++ b/sys/dev/sdmmc/sdmmc_mem.c Sun Apr 30 10:58:07 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdmmc_mem.c,v 1.74 2021/08/03 07:54:39 msaitoh Exp $   */
+/*     $NetBSD: sdmmc_mem.c,v 1.74.8.1 2023/04/30 10:58:07 martin Exp $        */
 /*     $OpenBSD: sdmmc_mem.c,v 1.10 2009/01/09 10:55:22 jsg Exp $      */
 
 /*
@@ -45,7 +45,7 @@
 /* Routines for SD/MMC memory cards. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sdmmc_mem.c,v 1.74 2021/08/03 07:54:39 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdmmc_mem.c,v 1.74.8.1 2023/04/30 10:58:07 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -2125,7 +2125,8 @@ sdmmc_mem_write_block(struct sdmmc_funct
        SDMMC_LOCK(sc);
        mutex_enter(&sc->sc_mtx);
 
-       if (sdmmc_chip_write_protect(sc->sc_sct, sc->sc_sch)) {
+       if (ISSET(sc->sc_flags, SMF_SD_MODE) &&
+           sdmmc_chip_write_protect(sc->sc_sct, sc->sc_sch)) {
                aprint_normal_dev(sc->sc_dev, "write-protected\n");
                error = EIO;
                goto out;



Home | Main Index | Thread Index | Old Index