Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp673652img; Fri, 22 Mar 2019 06:20:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqzwmOV2i+3dyXryuqHFejPS6g0/uEYcyl2gz/qBs8SO2TJUrsA9SfF0fzqZ67KhR2LLB1bu X-Received: by 2002:a62:20d2:: with SMTP id m79mr9365850pfj.135.1553260833974; Fri, 22 Mar 2019 06:20:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553260833; cv=none; d=google.com; s=arc-20160816; b=z9ukBQHZ/VtIyREvkrwufqN0HFKTo7u1jBI6NEgLkJY41o9O7hKr4pfz/BDREGM4JQ VHIQt9oX2BLMHVzVhmX1Hr/lPd/46kxFAGXV+cKKJnBnyOIWA5NtZVZrY+5fsutzvH2c 7lljNbvGMOWSxN5uDX0sJglmYQ4va1U9q8zEnWOJnGWxvhH94D0REu7D755xkDdGqCjl 0yELGYI0M2q7Vrk3d66eoxm7M1QLVmaEsZR6D9JBj+vMd6W4SbwaoiuMxzySkJI01swe k/uLbtuIQhJjm4ZMt1tezkDh27rdKvZ1DxhjlxJmCg0MR3QV42POQamenz4Rwp4sgcgV Dk6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gv54j5oiFZ3hE+J1idWO/lUuHkRFJq0/uzQ9qmSI+u4=; b=ui6MrUqjZ+VfOUg1O3GNrfg6/veY6lc9cq8o/TBjmz141GZlFgy4g6vc0WuC8QUruU qmfYoPgj0EIJVNQ9bcVrwhLoAyGSy8Q+BI3/EAAXmna5IGFdDqdZ2+jBJyg8gwZG6Yd6 dGDdyQJa/eIco+NFo6BTUcphCbQ6SbBnL2emQkwW0oQiTvJNsRavSIrCN9IovwK8IB0K PuaXjthQl51RRLUphyjHlhnLvpolWpuKLoGG4r8TUN5cgRCruU+WqMkdLdaesoEM8J9T oj44YYDqKD41yDOF8VYbPiVLo3sjRka9zlXBrGdp4E9KMyt3oi98//IFCwYqBynjmEaL DKmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hzE2L1tC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 193si6666673pga.251.2019.03.22.06.20.19; Fri, 22 Mar 2019 06:20:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hzE2L1tC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728793AbfCVLW0 (ORCPT + 99 others); Fri, 22 Mar 2019 07:22:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:49096 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728072AbfCVLWX (ORCPT ); Fri, 22 Mar 2019 07:22:23 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C8CD2218D4; Fri, 22 Mar 2019 11:22:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553253742; bh=41TRVpiVFnxbv2ygo9WsDQT5PRbWlirCMdb/MvHvXFw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hzE2L1tCoqRt5m0+rENAmRx9PkbKQqj/Qw9TQDuc4xXM4QevvKNcQjYCH9+SBN8Xx rmSxZFOUjeOBAa8Be/h8bEt1deeuWHT9az/bSGkdpBFZmz0RbbS6/4WzEQptXkfFtt muHcqNM22pYBybiKblBqTEWY1TBX+YjDu1dpCj0o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= , Linus Walleij , Ulf Hansson Subject: [PATCH 3.18 041/134] mmc: spi: Fix card detection during probe Date: Fri, 22 Mar 2019 12:14:14 +0100 Message-Id: <20190322111212.862771690@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190322111210.465931067@linuxfoundation.org> References: <20190322111210.465931067@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jonathan Neuschäfer commit c9bd505dbd9d3dc80c496f88eafe70affdcf1ba6 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: Jonathan Neuschäfer Reviewed-by: Linus Walleij Cc: stable@vger.kernel.org Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/mmc_spi.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/mmc/host/mmc_spi.c +++ b/drivers/mmc/host/mmc_spi.c @@ -1451,6 +1451,7 @@ static int mmc_spi_probe(struct spi_devi if (status != 0) goto fail_add_host; } + mmc_detect_change(mmc, 0); dev_info(&spi->dev, "SD/MMC host %s%s%s%s%s\n", dev_name(&mmc->class_dev),