From patchwork Tue Feb 18 17:18:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 231168 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06E0DC34026 for ; Tue, 18 Feb 2020 17:19:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CE67E20801 for ; Tue, 18 Feb 2020 17:19:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UwFbv5bi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726556AbgBRRTB (ORCPT ); Tue, 18 Feb 2020 12:19:01 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:41239 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726402AbgBRRTB (ORCPT ); Tue, 18 Feb 2020 12:19:01 -0500 Received: by mail-pl1-f195.google.com with SMTP id t14so8337590plr.8 for ; Tue, 18 Feb 2020 09:19:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=ZWlQ1WjSgxA8I4ZY+yApt3ugQrYnwUE+3N99MUezcM0=; b=UwFbv5bi3bE75iKX5zzcsmKcVRLqjL5E4AvkAlKZ73z1axVtt1IFjpF/0MOkyHMmAs X9p2WgRVtQ2ObKETCtMyl0I1vh0AQdPPpZ648/GPGE1YbtAET6ksbsFftQUqW82U8LjI OERBQ19crtH/fY8cQ1pwlK17WjVVTtNlJBbAAX/IO0SE+wo67Dnrbe2Y8Zhqa1rIxSr8 2kK57PN29rhvcYTL4kJCdXWTWMNGk5HJEepK9tY9rki5otdlJCo7P77+VySq6ASBymmE i7+dwSRmpmQi5Um3oVr/3xPqrZPWF/0nZnXqYko1+mId/GhOAd6ZBzTFJ3GbTG4VC3Bd ywYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mime-version:content-disposition:user-agent; bh=ZWlQ1WjSgxA8I4ZY+yApt3ugQrYnwUE+3N99MUezcM0=; b=WX0U7ehwvL9IEVtCh+3OZysfuky43+6TrCnqFd6tAMwt5LbX7FqJC448iGT1d0fsn9 1mOIU3og5HEtFdWPl8ZC7gmA2jKTn9sjQuwQcB5aB/rBKKcVjg/QOb9JZQiMnS0l4MDu CEc91wrz3+W3s//yiwd5MvhybbLi6w/nLedBOqUbeVDsBhZLYyDlZNYELO+OsqwzzjrX 3LpIo7wkAAxl1ItW0wpdOY8rl2zv1rCxt61/KTq8ucOK3ji9ahQAqsubwi6K/MHUpW3+ SsLIhB78Oh/b+pZFxH8TgRIX6G4zQp6DNdz8ba1CIRrfTIyng+1Z8TvFKaPqFLOdkcS8 T/xw== X-Gm-Message-State: APjAAAUgRCcvvsTHaQ6UBxQjC1LiPx1sM3eRG6zOM4ac03jt7af+qOmL +ZQ8LjdB0BT5PMErl/+iBarw71Jj X-Google-Smtp-Source: APXvYqxmkdaRI2jVVq9qvZOmjP+pgVq5HNAizl8F8FXSgTO/fyR/RUygOQqSjXFt5Upa+ppfyaLh0A== X-Received: by 2002:a17:90b:4382:: with SMTP id in2mr3926709pjb.29.1582046339581; Tue, 18 Feb 2020 09:18:59 -0800 (PST) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id a5sm3786736pjh.7.2020.02.18.09.18.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Feb 2020 09:18:58 -0800 (PST) Date: Tue, 18 Feb 2020 09:18:57 -0800 From: Guenter Roeck To: stable@vger.kernel.org, Greg Kroah-Hartman Cc: Linus Walleij , Robert Jarzmik , Ulf Hansson , =?utf-8?q?Micha=C5=82_Mi?= =?utf-8?q?ros=C5=82aw?= Subject: mmc patches for v5.4.y, v5.5.y Message-ID: <20200218171857.GA25822@roeck-us.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Hi Greg, please apply the following two patches to v5.4.y and v5.5.y to fix a problem when trying to boot various pxa machines from MMC. d3a5bcb4a17f gpio: add gpiod_toggle_active_low() 9073d10b0989 mmc: core: Rework wp-gpio handling The second patch fixes the problem, the first patch is necessary for the second patch to compile. Background: Commit 9073d10b0989 claims "No functional changes intended". However, it does include the following functional code change. effect of making the the card read-only, thus preventing the system from booting if it was mounted (and expected to be mounted) read-write. This is seen when trying to boot "spitz" and similar qemu machines from mmc. I bisected the problem to commit c914a27c92f91 ("mmc: pxamci: Support getting GPIO descs for RO and WP), affecting v5.0 and later kernels. Thanks, Guenter --- a/drivers/mmc/host/pxamci.c +++ b/drivers/mmc/host/pxamci.c @@ -740,16 +740,16 @@ static int pxamci_probe(struct platform_device *pdev) goto out; } + if (!host->pdata->gpio_card_ro_invert) + mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH; + ret = mmc_gpiod_request_ro(mmc, "wp", 0, 0, NULL); if (ret && ret != -ENOENT) { dev_err(dev, "Failed requesting gpio_ro\n"); goto out; } - if (!ret) { + if (!ret) host->use_ro_gpio = true; - mmc->caps2 |= host->pdata->gpio_card_ro_invert ? - 0 : MMC_CAP2_RO_ACTIVE_HIGH; - } This _is_ a functional change: Previously, if there was no "ro" gpio pin, caps2 was never updated to active-high. This can have the practical