From nobody Tue Feb 10 19:00:25 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1621419148; cv=none; d=zohomail.com; s=zohoarc; b=kgagZoYfnTbyOEezuXxzgSPYaPwpw0IGJFIldRusaDzkjsbZZQXPJ/cbNHIBFwYhRQpu3WGmrEWTrlnLVWyFegURBA8s8z6Eh+QulpkBWF5wQ6EoNrwax6/93UiVyzAhVziR7VjVJsMh4znH5E3MI8LxWUxe5JhIZpJZaYl6YRE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621419148; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=o9KuidqtrrC/e8JfPvoFn+nHC6yX9wZpNPmfQsnbJQ0=; b=WenPkT5EANXZFy49lTmAjERiXpwuh9/NTYu/kc+wwhsUW5OCtM7hXLMjBa4ziwVvsN8O8Jir48CJ3qy19FnQGDMdC7EhU3Co9mupEiagHrY+FNv8sYhqOgHiCOCScrigatCB5vscQbLuuig56b80JfQ2frNLvV994ORQjbOUtBk= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16214191489761005.2139925674978; Wed, 19 May 2021 03:12:28 -0700 (PDT) Received: from localhost ([::1]:38650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljJBj-0005jN-S0 for importer@patchew.org; Wed, 19 May 2021 06:12:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50090) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljJ7k-0002fE-Nq for qemu-devel@nongnu.org; Wed, 19 May 2021 06:08:20 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:37242 helo=mail.default.ilande.bv.iomart.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljJ7g-0003H9-QH for qemu-devel@nongnu.org; Wed, 19 May 2021 06:08:20 -0400 Received: from host217-39-58-213.range217-39.btcentralplus.com ([217.39.58.213] helo=kentang.home) by mail.default.ilande.bv.iomart.io with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ljJ7Z-0001Gv-IV; Wed, 19 May 2021 11:08:13 +0100 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, pbonzini@redhat.com, fam@euphon.net, laurent@vivier.eu, hpoussin@reactos.org Date: Wed, 19 May 2021 11:07:59 +0100 Message-Id: <20210519100803.10293-2-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210519100803.10293-1-mark.cave-ayland@ilande.co.uk> References: <20210519100803.10293-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 217.39.58.213 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH 1/5] esp: allow non-DMA callback in esp_transfer_data() initial transfer X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.bv.iomart.io) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.default.ilande.bv.iomart.io X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The current implementation only resumes DMA transfers when incoming data is received from the target device, but this is also required for non-DMA tran= sfers with the next set of non-DMA changes. Rather than duplicate the DMA/non-DMA dispatch logic in the initial transfer section, update the code so that the initial transfer section can just fallthrough to the main DMA/non-DMA dispatch logic. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index b668acef82..a611718769 100644 --- a/hw/scsi/esp.c +++ b/hw/scsi/esp.c @@ -804,16 +804,6 @@ void esp_transfer_data(SCSIRequest *req, uint32_t len) s->rregs[ESP_RSTAT] |=3D STAT_TC; s->rregs[ESP_RINTR] |=3D INTR_BS; esp_raise_irq(s); - - /* - * If data is ready to transfer and the TI command has already - * been executed, start DMA immediately. Otherwise DMA will start - * when host sends the TI command - */ - if (s->ti_size && (s->rregs[ESP_CMD] =3D=3D (CMD_TI | CMD_DMA))) { - esp_do_dma(s); - } - return; } =20 if (s->ti_cmd =3D=3D 0) { @@ -827,7 +817,7 @@ void esp_transfer_data(SCSIRequest *req, uint32_t len) return; } =20 - if (s->ti_cmd & CMD_DMA) { + if (s->ti_cmd =3D=3D (CMD_TI | CMD_DMA)) { if (dmalen) { esp_do_dma(s); } else if (s->ti_size <=3D 0) { @@ -838,7 +828,7 @@ void esp_transfer_data(SCSIRequest *req, uint32_t len) esp_dma_done(s); esp_lower_drq(s); } - } else { + } else if (s->ti_cmd =3D=3D CMD_TI) { esp_do_nodma(s); } } --=20 2.20.1