From patchwork Tue Sep 3 20:04:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 824956 Delivered-To: patch@linaro.org Received: by 2002:adf:a445:0:b0:367:895a:4699 with SMTP id e5csp60398wra; Tue, 3 Sep 2024 13:06:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXXT08qaiMQTMWNZ+BKSdIC7d2ctTcnXV76GUBGaA6uRAnL589DGX3XQlgHbJXCRSzs0yixTg==@linaro.org X-Google-Smtp-Source: AGHT+IEgoHtKnvBN8lKFTS7fqshfzzICucDraY/NtkvdM74nXYjHkPTXoy4w6tZqPHgmrdUDBajo X-Received: by 2002:a05:6122:7d0:b0:4f5:abe4:50e2 with SMTP id 71dfb90a1353d-500d5c0a34bmr5269060e0c.6.1725393975251; Tue, 03 Sep 2024 13:06:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725393975; cv=none; d=google.com; s=arc-20160816; b=uJYue1iEZhfuSoavKbQ8BWy09l8wu/LwIgJzm3slx5PiHlMv2cqJaPogIKgw0Vqlca VZqGIbbbPC+K1E8YKplbBGsF47TuKJn1/jDIOkIWThL6ehOAuQ1abn+Off6Q+rezOfHn nA6MiLsgTmegXidNNgaiV+ez1IKeh4Ac3Wi+a1xk2z5S5eWea5rtK1EZFn8E+Tr4ibTh li78LembtO+euED41/HimjmCknyUKTJDVHVKUEJVwybzwtBUhlIzvKkoGXBgX4HeeMPz /yBx4fd4C5fNLaBmJpzjm6RzBIAqu44+LGh+FMVoK5mXqtE60e8SWntNuAKlrZV+pJb4 QtSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ydW/DUmoEhTycpzh2ZqhDuCiUbu+QsaUgEgBthr/XBE=; fh=OmRXobCs3bPNTRU6kpc0pRVCDxBvtJVIDliITGsqtGw=; b=07tD427XpbfrdHJzkVwm1IyPbm6opWmeFaDUvaZ9z6fYNT0WRrugyllxPIpjlV9i2s rYp6o/ZUR88LwAJVLI83TQSnHGGsRMJpa/XBFedxx3eCyUUltRpnU0xstpDxN6f884R3 AZM00grGrNBU2f4DnA1q7JqPzXB19c5oCp2NEyJo4G1G2BvbJ5xlaj6cBi7vTucBlpyU XRzOHTm34wExh2RN3dsYDIN/S39MFz9bej+O00qc4BGPTUI6Jmo+ouhF/03Rn1elK1Zc Hr3r2FH2Bz0CmHV8caE03xjA8tnYvboaEy5Q6hwh7rYCZ+QAhcaZ6M/EgedUrA7i7PZd puVw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tmJz+0ia; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-49a5f57b19asi2640056137.600.2024.09.03.13.06.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Sep 2024 13:06:15 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tmJz+0ia; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1slZlt-0001AA-G3; Tue, 03 Sep 2024 16:05:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1slZlp-0000zi-4l for qemu-devel@nongnu.org; Tue, 03 Sep 2024 16:04:57 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1slZln-0003P5-IJ for qemu-devel@nongnu.org; Tue, 03 Sep 2024 16:04:56 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-428e1915e18so47840395e9.1 for ; Tue, 03 Sep 2024 13:04:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725393894; x=1725998694; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ydW/DUmoEhTycpzh2ZqhDuCiUbu+QsaUgEgBthr/XBE=; b=tmJz+0iaAR2OskddzQDBGF3OchDkNScHMkRq7LBsDyiuju7bVvm6dXTl/Fo6PCyiW2 2NKKXUSukgYOvcLmLe0NkySY0pORIMNitSeD5ikZx4AxPJAapcposE3C/MVXjp37TzPl rZjNsAAHDk9Qo71CZ11Ifx0ae+EnBdS/X3ToldViV10l0UhykvyJgDMe+zGJcOPAn5s5 MFarTn2+eo1EOsKzZBvqLz+SDN2JjaGv6WBhtUrKY73uFRkMnyEAgIgN0ddg4oQ0imnW m3/nIWECOLdvlpZM7/AlVTp2DUvlPk+v/OA67dkEJ+dcQhcsNJbs1lEkhLTDWTCEbvz5 qVPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725393894; x=1725998694; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ydW/DUmoEhTycpzh2ZqhDuCiUbu+QsaUgEgBthr/XBE=; b=QpzmP5L4il6Cv5N0XwE1p52XwmHlbG2WKh5Laj+P3s7Vx9ecc3Rm0Qtp+MXnJU08NL A07pab/mrE4paSqNCDilRZylUDVRIwXNkdsyOiL6mT4zjkjXZLK8wVVTlWThJOzaRfde o+eO3toWAjdhV5uu4lW0pd//r/cBN6Oyn9y33r52JgMY22dAsdXbUcVuID/zLKL28b6D vvT4AqyK0mtqWTO0W3Lbv3ijz1I2tUAYUjoqOZnzdEBUcZcC5aPGmMV7lwVxWezoJqfO kBN0drl2roCdxC1bI8tFDuKKa2BY7en+zwHiQUbhpzcwAndo3bXDWlbxH3MIVmt9b/TX hUBg== X-Gm-Message-State: AOJu0YyYpWGlRu3efKuc8YDcIL8yilHnaGMbSjwCZzbcy+vh6lVjrtIz 6rtPJjNLfD3+HX94pDjJ6RVKQWxorBoC2bldk7r4yu++MVXouDRl0zfdcy66ZEH4txlvS37gjXx S X-Received: by 2002:a05:600c:5493:b0:428:52a:3580 with SMTP id 5b1f17b1804b1-42c7b59e329mr72825255e9.3.1725393893472; Tue, 03 Sep 2024 13:04:53 -0700 (PDT) Received: from localhost.localdomain ([78.196.4.158]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6deb1ebsm181070985e9.3.2024.09.03.13.04.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 03 Sep 2024 13:04:53 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , qemu-block@nongnu.org, Bin Meng Subject: [PATCH 1/2] hw/sd: Remove legacy sd_set_cb() Date: Tue, 3 Sep 2024 22:04:45 +0200 Message-ID: <20240903200446.25921-2-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240903200446.25921-1-philmd@linaro.org> References: <20240903200446.25921-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org sd_set_cb() was only used by omap2_mmc_init() which got recently removed. Time to remove it. For historical background on the me_no_qdev_me_kill_mammoth_with_rocks kludge, see commit 007d1dbf72 ("sd: Hide the qdev-but-not-quite thing created by sd_init()"). Signed-off-by: Philippe Mathieu-Daudé --- include/hw/sd/sdcard_legacy.h | 1 - hw/sd/sd.c | 30 ++++-------------------------- 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/include/hw/sd/sdcard_legacy.h b/include/hw/sd/sdcard_legacy.h index 0dc3889555..a121232560 100644 --- a/include/hw/sd/sdcard_legacy.h +++ b/include/hw/sd/sdcard_legacy.h @@ -36,7 +36,6 @@ SDState *sd_init(BlockBackend *blk, bool is_spi); int sd_do_command(SDState *card, SDRequest *request, uint8_t *response); void sd_write_byte(SDState *card, uint8_t value); uint8_t sd_read_byte(SDState *card); -void sd_set_cb(SDState *card, qemu_irq readonly, qemu_irq insert); /* sd_enable should not be used -- it is only used on the nseries boards, * where it is part of a broken implementation of the MMC card slot switch diff --git a/hw/sd/sd.c b/hw/sd/sd.c index a140a32ccd..8a30c61ce0 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -112,10 +112,6 @@ typedef struct SDProto { struct SDState { DeviceState parent_obj; - /* If true, created by sd_init() for a non-qdevified caller */ - /* TODO purge them with fire */ - bool me_no_qdev_me_kill_mammoth_with_rocks; - /* SD Memory Card Registers */ uint32_t ocr; uint8_t scr[8]; @@ -169,8 +165,6 @@ struct SDState { uint32_t data_offset; size_t data_size; uint8_t data[512]; - qemu_irq readonly_cb; - qemu_irq inserted_cb; QEMUTimer *ocr_power_timer; bool enable; uint8_t dat_lines; @@ -889,17 +883,10 @@ static void sd_cardchange(void *opaque, bool load, Error **errp) trace_sdcard_ejected(); } - if (sd->me_no_qdev_me_kill_mammoth_with_rocks) { - qemu_set_irq(sd->inserted_cb, inserted); - if (inserted) { - qemu_set_irq(sd->readonly_cb, readonly); - } - } else { - sdbus = SD_BUS(qdev_get_parent_bus(dev)); - sdbus_set_inserted(sdbus, inserted); - if (inserted) { - sdbus_set_readonly(sdbus, readonly); - } + sdbus = SD_BUS(qdev_get_parent_bus(dev)); + sdbus_set_inserted(sdbus, inserted); + if (inserted) { + sdbus_set_readonly(sdbus, readonly); } } @@ -1027,18 +1014,9 @@ SDState *sd_init(BlockBackend *blk, bool is_spi) } sd = SD_CARD(dev); - sd->me_no_qdev_me_kill_mammoth_with_rocks = true; return sd; } -void sd_set_cb(SDState *sd, qemu_irq readonly, qemu_irq insert) -{ - sd->readonly_cb = readonly; - sd->inserted_cb = insert; - qemu_set_irq(readonly, sd->blk ? !blk_is_writable(sd->blk) : 0); - qemu_set_irq(insert, sd->blk ? blk_is_inserted(sd->blk) : 0); -} - static void sd_blk_read(SDState *sd, uint64_t addr, uint32_t len) { trace_sdcard_read_block(addr, len);