From patchwork Thu Feb 25 21:35:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Baumann X-Patchwork-Id: 8426871 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 093F4C0553 for ; Thu, 25 Feb 2016 21:37:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 706F9202EB for ; Thu, 25 Feb 2016 21:37:09 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B7801202E9 for ; Thu, 25 Feb 2016 21:37:08 +0000 (UTC) Received: from localhost ([::1]:46020 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZ3au-0005KE-6G for patchwork-qemu-devel@patchwork.kernel.org; Thu, 25 Feb 2016 16:37:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47442) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZ3ZV-0003Ly-5l for qemu-devel@nongnu.org; Thu, 25 Feb 2016 16:35:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aZ3ZS-0003y7-HQ for qemu-devel@nongnu.org; Thu, 25 Feb 2016 16:35:41 -0500 Received: from mail-by2on0144.outbound.protection.outlook.com ([207.46.100.144]:27680 helo=na01-by2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZ3ZS-0003xl-AM for qemu-devel@nongnu.org; Thu, 25 Feb 2016 16:35:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=k3d0G2SUWAfe87j6SURIaBVbfQ1VJbjmFJFdaTMmSYs=; b=CKLVBuBXGbh3x2uJKbNHUjT3xSo2+SG+Lr4fZyt7BK21CJt2XGQnTyjsudkfpmUcje6HwIEfAfCMjv24Uje6mIj7jYFRZuYAgGUgNML42aJ5h0CB3MH6A/zfhOda/Bjiq55Mbo84+f89qezUtIlSkOuA8m4C4CuhTfHb+jD+CC0= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none; nongnu.org; dmarc=none action=none header.from=microsoft.com; Received: from baumann-desk.redmond.corp.microsoft.com (2001:4898:80e8:a::724) by BY2PR0301MB2039.namprd03.prod.outlook.com (10.163.196.153) with Microsoft SMTP Server (TLS) id 15.1.409.15; Thu, 25 Feb 2016 21:35:36 +0000 From: Andrew Baumann To: Date: Thu, 25 Feb 2016 13:35:29 -0800 Message-ID: <1456436130-7048-2-git-send-email-Andrew.Baumann@microsoft.com> X-Mailer: git-send-email 2.5.1 In-Reply-To: <1456436130-7048-1-git-send-email-Andrew.Baumann@microsoft.com> References: <1456436130-7048-1-git-send-email-Andrew.Baumann@microsoft.com> MIME-Version: 1.0 X-Originating-IP: [2001:4898:80e8:a::724] X-ClientProxiedBy: BY1PR10CA0020.namprd10.prod.outlook.com (25.160.197.30) To BY2PR0301MB2039.namprd03.prod.outlook.com (25.163.196.153) X-MS-Office365-Filtering-Correlation-Id: 7d80b9a5-fc0a-42c1-2a6c-08d33e2b9969 X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB2039; 2:pgzUm0z6Nps+FFB44UE6vQPRduJU7BTWBW7bpAO2YB7ZUkgzAGHFjwcSvyD77J5+OKLIsM4msE0kza+jql+13rrZvi0/c/c4S2fwl8CQ9Vji2bYYQB32iEIagN/4HNd7CxNE8UbAnfBGzm/tooQ6K5QOxumdzs5rbXrHRfFMKkdfqAR9BmwPaZA+iiICalNM; 3:bYdOt257uuOiVu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tw6S92T61ClqVJIc2a4bgA7n3HBZiXp0PY1cuO51RZs6rQQgQDbCIHwMZPvaNavLpwqqXsEu9j6wT40xXngnoFno1NMiNaLxhR1EuupTEvl97V/kXRwOJH2EyLwlQAqzxJmoV3S1/+ly4ScQAAJi23GgmG+K10ziefTrYqo2LQ86L6psmNXFE9vTAbAHn1aknnxPe+wbqACMq8xkqwduxVtNkZP7BA7EYw1LS/a6/gVkbaUTKGdhPF/50jveUNwEGPVNQWnpgAwW5wHFh37G0Vaf7N9BVZ+SiZmyNtjfKfFw8Cc7D/JMeODqgpNPTYVfc79q6Lo6GCu1KfhjbSBhcwTMsLbUCWBU1vyVzBFJNCsBBFzClfDcDEj X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046); SRVR:BY2PR0301MB2039; BCL:0; PCL:0; RULEID:; SRVR:BY2PR0301MB2039; X-Forefront-PRVS: 08635C03D4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(50226001)(5004730100002)(229853001)(2351001)(92566002)(48376002)(6116002)(50466002)(19580405001)(19580395003)(77096005)(10290500002)(86362001)(40100003)(5005710100001)(2950100001)(86612001)(122386002)(2906002)(5003940100001)(189998001)(76176999)(5001960100002)(87976001)(107886002)(110136002)(42186005)(50986999)(5008740100001)(4326007)(47776003)(1096002)(586003)(4001430100002)(36756003)(7059030)(3826002); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR0301MB2039; H:baumann-desk.redmond.corp.microsoft.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB2039; 23:TcD08MKELRP946Ohr/DmhwtH67x1TjXWoMV563T?= =?us-ascii?Q?EWdp7NZTfiZyunS1MEfL4NvOSlwVjsyJ0UGe+0HEkm5Kgkxzf/mToVnSg+04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sYYEqfN1JXK8ggBQrwh39937ZAl7IRHMF2FYr?= =?us-ascii?Q?2hQ3GffOl7KOe671a1oQ3mxB97ceL7+MCx2EdNJCR6M+vL5HMQYv2OMRL64A?= =?us-ascii?Q?JjVdPlKNmeNyqrInFDb2TNzspPle4?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB2039; 5:FQdTL04d5Q8EU08IcSDoalrowUBFIs9/3cX32aLM70aRu7QL8P6AWetYBdcaYSS+01QxiyOhSPiUgpyBTNcEwldC1bBGJnuaZN2tOVsx/a1aRUUMHaTpvozPPqipDcHU8MhTltfDexpLXuzsp48uXA==; 24:vLNkQZz3HdyjO0P+bfCOBGgc5LhYKV4YetMf8eYnMTsppHa8RkobFRlZB0r8DSVKMW+veAuu3x+RC6SogSluqvkuv0erOojzZzIYZyqLLkc= X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Feb 2016 21:35:36.5662 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB2039 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 207.46.100.144 Cc: Peter Maydell , Igor Mitsyanko , Andrew Baumann , Sai Pavan Boddu , Peter Crosthwaite , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH v4 1/2] sdhci: Revert "add optional quirk property to disable card insertion/removal interrupts" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This reverts commit 723697551a7e926abe7d3c7f2966012b8075143d. This change was poorly tested on my part. It squelched card insertion interrupts on reset, but that was not necessary because sdhci_reset() clears all the registers (via the call to memset), so the subsequent sdhci_insert_eject_cb() call never sees the card insert interrupt enabled. However, not calling the insert_eject_cb results in prnsts remaining 0, when it actually needs to be updated to indicate card presence and R/O status. Signed-off-by: Andrew Baumann --- hw/sd/sdhci.c | 9 +++------ include/hw/sd/sdhci.h | 1 - 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index 73e7c87..f175b30 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -198,11 +198,9 @@ static void sdhci_reset(SDHCIState *s) * initialization */ memset(&s->sdmasysad, 0, (uintptr_t)&s->capareg - (uintptr_t)&s->sdmasysad); - if (!s->noeject_quirk) { - /* Reset other state based on current card insertion/readonly status */ - sdhci_set_inserted(dev, sdbus_get_inserted(&s->sdbus)); - sdhci_set_readonly(dev, sdbus_get_readonly(&s->sdbus)); - } + /* Reset other state based on current card insertion/readonly status */ + sdhci_set_inserted(dev, sdbus_get_inserted(&s->sdbus)); + sdhci_set_readonly(dev, sdbus_get_readonly(&s->sdbus)); s->data_count = 0; s->stopped_state = sdhc_not_stopped; @@ -1275,7 +1273,6 @@ static Property sdhci_sysbus_properties[] = { DEFINE_PROP_UINT32("capareg", SDHCIState, capareg, SDHC_CAPAB_REG_DEFAULT), DEFINE_PROP_UINT32("maxcurr", SDHCIState, maxcurr, 0), - DEFINE_PROP_BOOL("noeject-quirk", SDHCIState, noeject_quirk, false), DEFINE_PROP_END_OF_LIST(), }; diff --git a/include/hw/sd/sdhci.h b/include/hw/sd/sdhci.h index 607a83e..4816516 100644 --- a/include/hw/sd/sdhci.h +++ b/include/hw/sd/sdhci.h @@ -76,7 +76,6 @@ typedef struct SDHCIState { uint32_t buf_maxsz; uint16_t data_count; /* current element in FIFO buffer */ uint8_t stopped_state;/* Current SDHC state */ - bool noeject_quirk;/* Quirk to disable card insert/remove interrupts */ /* Buffer Data Port Register - virtual access point to R and W buffers */ /* Software Reset Register - always reads as 0 */ /* Force Event Auto CMD12 Error Interrupt Reg - write only */