mmc: spi: Fix card detection during probe
Jonathan Neuschäfer authored
commit c9bd505d

 upstream.

When using the mmc_spi driver with a card-detect pin, I noticed that the
card was not detected immediately after probe, but only after it was
unplugged and plugged back in (and the CD IRQ fired).

The call tree looks something like this:

mmc_spi_probe
  mmc_add_host
    mmc_start_host
      _mmc_detect_change
        mmc_schedule_delayed_work(&host->detect, 0)
          mmc_rescan
            host->bus_ops->detect(host)
              mmc_detect
                _mmc_detect_card_removed
                  host->ops->get_cd(host)
                    mmc_gpio_get_cd -> -ENOSYS (ctx->cd_gpio not set)
  mmc_gpiod_request_cd
    ctx->cd_gpio = desc

To fix this issue, call mmc_detect_change after the card-detect GPIO/IRQ
is registered.
Signed-off-by: default avatarJonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansso...
c69e07a8
Name Last commit Last update
Documentation dt-bindings: eeprom: at24: add "atmel,24c2048" compatible string
LICENSES LICENSES: Remove CC-BY-SA-4.0 license text
arch KVM: nSVM: clear events pending from svm_complete_interrupts() when exiting to L1
block blk-mq: fix a hung issue when fsync
certs export.h: remove VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR()
crypto net: crypto set sk to NULL when af_alg_release.
drivers mmc: spi: Fix card detection during probe
firmware kbuild: remove all dummy assignments to obj-
fs writeback: synchronize sync(2) against cgroup writeback membership switches
include net: dev_is_mac_header_xmit() true for ARPHRD_RAWIP
init kbuild: Disable LD_DEAD_CODE_DATA_ELIMINATION with ftrace & GCC <= 4.7
ipc ipc/shm.c: use ERR_CAST() for shm_lock() error return
kernel locking/rwsem: Fix (possible) missed wakeup
lib lib/test_rhashtable: Make test_insert_dup() allocate its hash table dynamically
mm writeback: synchronize sync(2) against cgroup writeback membership switches
net cfg80211: extend range deviation for DMG
samples samples: mei: use /dev/mei0 instead of /dev/mei
scripts scripts/gdb: fix lx-version string output
security KEYS: always initialize keyring_index_key::desc_len
sound ASoC: imx-audmux: change snprintf to scnprintf for possible overflow
tools kvm: selftests: Fix region overlap check in kvm_util
usr initramfs: move gen_initramfs_list.sh from scripts/ to usr/
virt kvm: fix kvm_ioctl_create_device() reference counting (CVE-2019-6974)
.clang-format clang-format: Set IndentWrappedFunctionNames false
.cocciconfig scripts: add Linux .cocciconfig for coccinelle
.get_maintainer.ignore Add hch to .get_maintainer.ignore
.gitattributes .gitattributes: set git diff driver for C source code files
.gitignore Merge tag 'kbuild-v4.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
.mailmap Merge tag 'libnvdimm-for-4.19_misc' of gitolite.kernel.org:pub/scm/linux/kernel/git/nvdimm/nvdimm
COPYING COPYING: use the new text with points to the license files
CREDITS 9p: remove Ron Minnich from MAINTAINERS
Kbuild Merge tag 'kbuild-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Kconfig kconfig: move the "Executable file formats" menu to fs/Kconfig.binfmt
MAINTAINERS MAINTAINERS: Add Sasha as a stable branch maintainer
Makefile Linux 4.19.26
README Docs: Added a pointer to the formatted docs to README
Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.