Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp178008imd; Wed, 31 Oct 2018 16:53:42 -0700 (PDT) X-Google-Smtp-Source: AJdET5ckYyPi2B4Wuu721iulhBUSr7otvVZmC6qX6M45K1M2SEYu+zxW5XpEule62OUOOCBF+INY X-Received: by 2002:a63:da57:: with SMTP id l23-v6mr5087554pgj.179.1541030022142; Wed, 31 Oct 2018 16:53:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541030022; cv=none; d=google.com; s=arc-20160816; b=ameFJEmiphcqlc8whiFw6W8oiXMkyowWeZO4AmYwcxW49eFKk7Z6t3ij6NJmcys/P/ WG6W8/+V5cI6SRb2mP+sLrIY/m2yZG/QvBgdd3h1HsEaZ6QWgrHwDg70IfTby+r4rkjZ WNtCqU5OxQ8ac7A9FHVEaXZB7oj1SXIPGJLp9vsYjC/RqZSV9Q58916bMzWNbDrMgdXI Aap0SCfjcqFbfLxgrDliIWyx4LuXH6oMFZifFZEcEMADcfWo/Cl2rvuxxtkLxOdhQtOF wXl2uduLhRnKX//of4Z2Gomt/MaFwSQriLmrPovRqD4+woHlhtnEdkDTp+kenmpb3Obr TC6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=KTDclf4ZV3uQwXy8KHCPSl2zozi7uWhvSmmtAqHXycE=; b=D0ZV1QiniVwd1iaPmawwL/KfnLv2mBdpmKLJzEAulaRgVqLj67nzwlWIO0nCrZvbLj UqG25gJV44V0Nt8Wpihv4CWKGHQ8RmoCwlkiVYl6Nx2NyRNbGBUHF9NwulabJdNcUBCg 3XYthJsGrVQWhwoKCLeMQ7yx9LtGgFJ6tikOzP1igrrtiA4Y6vJVLNPM5ZUKdYXSru81 wvTDe9beoO0Fe5o+3wAcn4r1rUmFSYcak5u/jlKN/CVwb/tTMz2EYy0hdyAqFgsZwJSI qWSxY463gWBlt0NBeovbWzn2rHc932WYvCMFskAB8UTz4ybaTN1FOeoO0Bscgp8g39L3 0Qeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=f7kFzAZT; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x15-v6si27086661pln.425.2018.10.31.16.53.27; Wed, 31 Oct 2018 16:53:42 -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=f7kFzAZT; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727722AbeKAIGP (ORCPT + 99 others); Thu, 1 Nov 2018 04:06:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:53056 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727597AbeKAIGP (ORCPT ); Thu, 1 Nov 2018 04:06:15 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3BCDF20843; Wed, 31 Oct 2018 23:06:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027164; bh=Klm8WRRhOZ6oLg8g9G5uscjrkCKtQOIuCOic5+Hy/gY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f7kFzAZTsvMoVNZKuJWkjxDdWzrVQBlwmxShXkvKcW+5oaQnphnh6rjvg6GAjMY58 OfxSUpZTkw90T8UU+SZRgOmEK63Q7T7I+UyUmWsozUTaXAf5ytOA01m5fKN/3jkwp2 8zzsGfJmmEHVhzJdw3dbkCDFaHHC8/1VIxq6qh3g= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Yu Zhao , Ulf Hansson , Sasha Levin Subject: [PATCH AUTOSEL 4.19 024/146] mmc: sdhci-pci-o2micro: Add quirk for O2 Micro dev 0x8620 rev 0x01 Date: Wed, 31 Oct 2018 19:03:39 -0400 Message-Id: <20181031230541.28822-24-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031230541.28822-1-sashal@kernel.org> References: <20181031230541.28822-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yu Zhao [ Upstream commit 5169894982bb67486d93cc1e10151712bb86bcb6 ] This device reports SDHCI_CLOCK_INT_STABLE even though it's not ready to take SDHCI_CLOCK_CARD_EN. The symptom is that reading SDHCI_CLOCK_CONTROL after enabling the clock shows absence of the bit from the register (e.g. expecting 0x0000fa07 = 0x0000fa03 | SDHCI_CLOCK_CARD_EN but only observed the first operand). mmc1: Timeout waiting for hardware cmd interrupt. mmc1: sdhci: ============ SDHCI REGISTER DUMP =========== mmc1: sdhci: Sys addr: 0x00000000 | Version: 0x00000603 mmc1: sdhci: Blk size: 0x00000000 | Blk cnt: 0x00000000 mmc1: sdhci: Argument: 0x00000000 | Trn mode: 0x00000000 mmc1: sdhci: Present: 0x01ff0001 | Host ctl: 0x00000001 mmc1: sdhci: Power: 0x0000000f | Blk gap: 0x00000000 mmc1: sdhci: Wake-up: 0x00000000 | Clock: 0x0000fa03 mmc1: sdhci: Timeout: 0x00000000 | Int stat: 0x00000000 mmc1: sdhci: Int enab: 0x00ff0083 | Sig enab: 0x00ff0083 mmc1: sdhci: AC12 err: 0x00000000 | Slot int: 0x00000000 mmc1: sdhci: Caps: 0x25fcc8bf | Caps_1: 0x00002077 mmc1: sdhci: Cmd: 0x00000000 | Max curr: 0x005800c8 mmc1: sdhci: Resp[0]: 0x00000000 | Resp[1]: 0x00000000 mmc1: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000000 mmc1: sdhci: Host ctl2: 0x00000008 mmc1: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x00000000 mmc1: sdhci: ============================================ The problem happens during wakeup from S3. Adding a delay quirk after power up reliably fixes the problem. Signed-off-by: Yu Zhao Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/mmc/host/sdhci-pci-o2micro.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mmc/host/sdhci-pci-o2micro.c b/drivers/mmc/host/sdhci-pci-o2micro.c index 77e9bc4aaee9..cc3ffeffd7a2 100644 --- a/drivers/mmc/host/sdhci-pci-o2micro.c +++ b/drivers/mmc/host/sdhci-pci-o2micro.c @@ -490,6 +490,9 @@ int sdhci_pci_o2_probe(struct sdhci_pci_chip *chip) pci_write_config_byte(chip->pdev, O2_SD_LOCK_WP, scratch); break; case PCI_DEVICE_ID_O2_SEABIRD0: + if (chip->pdev->revision == 0x01) + chip->quirks |= SDHCI_QUIRK_DELAY_AFTER_POWER; + /* fall through */ case PCI_DEVICE_ID_O2_SEABIRD1: /* UnLock WP */ ret = pci_read_config_byte(chip->pdev, -- 2.17.1