From nobody Sat Sep 26 20:51:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1789564907; cv=none; d=zohomail.com; s=zohoarc; b=SEQD/AnInL2SlwQl5Yns5LJkCKbgpRPV6rBshD8nUPC0blxfv7qc0hiJjFbbB3HO2pZb5aG75emaE6Dtwth7n/78bQwZWnv1P3EL5mMGIRvnR80Xeo0qLTXveDJz2/pyBLPEH8te3PvdE9rG0qIVWCn1yfJcFclB5WEt+DR37yE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789564907; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=4REO1qBeWuk8/clBHJch74Ty6Oz13hhJb9h5IHDXZ44=; b=V9dCq/Sqce9p/hxwFmG2c1X3i3qqp+1hRVNmChvwGo8O2ASABFvZYLZYs1CJy0fGqEBBxa1orK04h0+lAeGRvr1Q0yCkNUIxCNtS7uLqo1Xp/7JHQSFWPmgmxpBjCZ8llnpPjgXclxnGuNPV4LAAxeUV/QN7YiRopQTnCm1dRRw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789564907504764.1304830011748; Wed, 16 Sep 2026 06:21:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6pZr-0005xX-Nr; Wed, 16 Sep 2026 09:21:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6pZq-0005x3-GL for qemu-devel@nongnu.org; Wed, 16 Sep 2026 09:21:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6pZo-00032U-Ks for qemu-devel@nongnu.org; Wed, 16 Sep 2026 09:21:30 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-314-V0XdP7S5O1ezDJ_YPBdvLQ-1; Wed, 16 Sep 2026 09:21:25 -0400 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-49ccfad90f1so32696965e9.0 for ; Wed, 16 Sep 2026 06:21:25 -0700 (PDT) Received: from [192.168.10.48] ([151.49.232.249]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49e83a8d6e2sm81816535e9.1.2026.09.16.06.21.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2026 06:21:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1789564887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4REO1qBeWuk8/clBHJch74Ty6Oz13hhJb9h5IHDXZ44=; b=N35+Z0kHy+qOcHlpkNSiJLLYyTqhPwY1ElBQknMnorkFt5lkWJZVXOYVV+r0RFWqZjCW95 0CtD1lg4E/V1udlV/tol7Uff5rfhxuVusu3V3Rww5PzRUuNtPxUHhjIWMBvRaVpund+EYC UjEYvQjsBnnAl6Ve4ec21h53UBidJic= X-MC-Unique: V0XdP7S5O1ezDJ_YPBdvLQ-1 X-Mimecast-MFC-AGG-ID: V0XdP7S5O1ezDJ_YPBdvLQ_1789564884 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1789564884; x=1790169684; 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:content-type; bh=4REO1qBeWuk8/clBHJch74Ty6Oz13hhJb9h5IHDXZ44=; b=epjxzLD+P/0EhwfC4rjzZ5gxBNV/GhX3JqYHtbjkEAhKwJrousbNkIW6m/3nYTRQCI 2UzVmmY2QED+2H5Uuxdezsvwx1nyiCy1SLPluGdv6s2BaPRoT63CaEGZP15uo7f9c95S 2v7P/gbCXNatYzTtALRZCN7VRcUKfxB+BPFQZG1WpRAsBKyFsPP3BiZEl7BkXxHRzLka 7H26nEABZ/bNvlUr2tTv0jTmb7ytmJ0PGHq3GV9vCMzkOCkJnU8tUVt3cMvPW0i5XwPy +fCihzobxOWo+i/4MxMWIJm+84Qdb3dOBPaa33kIT6cBtQYb/DJo9oB3UkVRktKmLexb 6uZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789564884; x=1790169684; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=4REO1qBeWuk8/clBHJch74Ty6Oz13hhJb9h5IHDXZ44=; b=fnLY8EoRMcR2vQByV5m5SwuaAKsRcWyS4nja92sFzPXeZYIx8gnT4kAhrzKv7+0h9a QfgnR6qh+06BkasR74FHP/d2icTWJH22/khBBkJBW7y6eHl3/zvSkfyEViQxcYdtjYS3 ygBS/F+p3ECoD3SijGX+S/tkMV/hlw612Pb0JHBjgiyGdED8z9SphdIEL2x7bL6PSfb5 DD0R06iPWH+3undxF3XJk2Pk5RwNslvavdYyRKBchVoUMaUWxwI1k/H4G3PlwYk/+R6P oAYiqV1YXNCQPo/jrEYqavmpvpmx5Izaf8ucUOv57bKfh9PSjdiDCDsseGSiJ5l1UXt+ mQOQ== X-Gm-Message-State: AFuF++mIcfO6BIV1y4IvBTenfo4furnBN9xnFvW53EUQhF4oxVmf3Oci s26ZsiYF5Q8uoJAPo8ENDu147TEpUB5ebnN7jTL8TlYL6U3Q2IAPTRmWZBpzmwzJ0euSfeQh32i GsQK0TTlXaCTG5Bi2IcdTciUls3nMwyRhaK7fuw69bl44XWemVlZX7wnZQ0UXakD6wFKbf4Ue3c TiEh3n9vV2s2IymbsvrORpjPs97KMNn3Z5/uLNJ6Ee X-Gm-Gg: AYBFou0FyZwZ059/jVr6yv3Gk3KtYSWwiEbw8Z2X4jnlWrIfl06IZiuID+UdGXaRiN2 cz1QtOZ4vfZohoOGrpFwPAvCOxWCx9xCySYliXKrwfMaUZKRlhzSh29LHYDxMAHX3gnwFbPzWB4 JB0mFe/lccyqkJj+5wngxMqdB7WBH1LP4wjZ+THyj9BYvSOvRsVFyodil1WZ3y0x2Ya1eeK+Kse SAtZLYoWg0wAoOSRkqQ/rHw3UPxqXPLOj+VT50CitWsEwh+/7sosGrDBVeOOTsqmN3ZJfW5tovt dT3KP9FMDu821NHxCxpPJ0oVaOoQpBCx4QSVLNUsOqrfJvI1D+sqMiwclx3sHNjnwx+L2TsV4u4 ilVP/LSb0YMjzFMaHXPSxxbHiE0K+zNKNOghhGT0WPbeogswXsJIhpR3op0onkGkJeuLfRvQkAT Ihrkdc X-Received: by 2002:a05:600c:6085:b0:49c:dca2:ac47 with SMTP id 5b1f17b1804b1-49eac45c06bmr30124885e9.2.1789564884427; Wed, 16 Sep 2026 06:21:24 -0700 (PDT) X-Received: by 2002:a05:600c:6085:b0:49c:dca2:ac47 with SMTP id 5b1f17b1804b1-49eac45c06bmr30124345e9.2.1789564883890; Wed, 16 Sep 2026 06:21:23 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 1/8] ncr710: simplify ncr710_clear_pending_irq Date: Wed, 16 Sep 2026 15:21:13 +0200 Message-ID: <20260916132120.860910-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260916132120.860910-1-pbonzini@redhat.com> References: <20260916132120.860910-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1789564909002158500 Content-Type: text/plain; charset="utf-8" The same checks are done in ncr710_request_free. If req->hba_private is anything, it is the NCR710Request that points to req, so it would be cleared. Signed-off-by: Paolo Bonzini --- hw/scsi/ncr53c710.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/hw/scsi/ncr53c710.c b/hw/scsi/ncr53c710.c index 57967e7a84f..b87fed05a4d 100644 --- a/hw/scsi/ncr53c710.c +++ b/hw/scsi/ncr53c710.c @@ -316,11 +316,7 @@ static inline int ncr710_irq_on_rsl(NCR710State *s) static void ncr710_clear_pending_irq(NCR710State *s) { if (s->current) { - if (s->current->req) { - s->current->req->hba_private =3D NULL; - } ncr710_request_free(s, s->current); - s->current =3D NULL; } } =20 @@ -739,9 +735,6 @@ static void ncr710_add_msg_byte(NCR710State *s, uint8_t= data) =20 static void ncr710_request_free(NCR710State *s, NCR710Request *p) { - if (!p) { - return; - } if (p->req && p->req->hba_private =3D=3D p) { p->req->hba_private =3D NULL; } --=20 2.55.0 From nobody Sat Sep 26 20:51:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1789564931; cv=none; d=zohomail.com; s=zohoarc; b=WzPr0xlk7jZMux1fEa9WzdNzYj7atp70fkK+8C++Pf724Vj3Yvcspu1nFA2InbTYZ544sMhxsZoNoIC2aatderRfEa16qpKc3JKnjrnLHHws/cWRMg0HVvhCT0j0vk+RlxIVcQiIMBqBcd4o3Qq4QGNHaIFduPYSfyE3fmZx7nQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789564931; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=39cvH491Kj2qhfCGhVeMqkgEYTvIuzsvjq1PpKmD+oE=; b=R52NxtK+DpJ6oqTiGNW4a3AQoP8CJUuVgpAV9rlv/zB1S3DGfrcdanNXzRnVAhUr0j0aWvyfXQJMjftvRy1P32AyPeRfLOSWWIvVnpYmKxrl9Xkw+w7SgQQLqzMox5lLzfDlP5YX8MHHh3HphuIB1bupCNHYVtbK4L+EXsrMFq4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789564931631579.0832622125213; Wed, 16 Sep 2026 06:22:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6pZw-0005yK-E1; Wed, 16 Sep 2026 09:21:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6pZu-0005y3-2J for qemu-devel@nongnu.org; Wed, 16 Sep 2026 09:21:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6pZs-00033P-Nq for qemu-devel@nongnu.org; Wed, 16 Sep 2026 09:21:33 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-622-HbbupPdCMvWDFHpKKRjpsA-1; Wed, 16 Sep 2026 09:21:30 -0400 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-49e76a80fe5so42314345e9.2 for ; Wed, 16 Sep 2026 06:21:30 -0700 (PDT) Received: from [192.168.10.48] ([151.49.232.249]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49e83b02245sm98581695e9.10.2026.09.16.06.21.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2026 06:21:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1789564892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=39cvH491Kj2qhfCGhVeMqkgEYTvIuzsvjq1PpKmD+oE=; b=hwHl8yQ25tpZpPsIBA2Kpab3rfz1lRkIzGRsaOt3HOQ0Uk4n0lCzLQM9tVRV79Fu9RSJR4 qAForYzptogPFJCmZdBNjmlQc4GsbIowKCsxVHg9LV5FXLE9i0Ieimt4rIwlKNTaH5TxW8 uLQBBwx8QpKDXTnCvbVEdWVDWBeG7/8= X-MC-Unique: HbbupPdCMvWDFHpKKRjpsA-1 X-Mimecast-MFC-AGG-ID: HbbupPdCMvWDFHpKKRjpsA_1789564889 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1789564889; x=1790169689; 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:content-type; bh=39cvH491Kj2qhfCGhVeMqkgEYTvIuzsvjq1PpKmD+oE=; b=PX97e8bUWL4P4DSYyOp1ykkfDMyLaKvY2SxBJccmbetWnW6yjQg1AtG3dr7R7d/u0r J8w3l4sn2mptj94h1OMek8b/GY8fmlDYpfhW06zrmRwHM7q3urtZlHyDYFHMAOzBq4KX VLyQ1DGoIM2MiPygAspxfdymoa7R8yCCFK/nnkPftMqHbqqnVxIlPaYMH9gWeB7c08+S KusvORwPaSbDsiwUzpwJNodiPqTC46jivXNNpJ81opSbpx0fKXWoH1wq30aVwa/D//ls bfHJHPntJm+50uzXxT1vw/NUJMmqABH0xtY6xQn3lL3smQ+f8LZpqAHXUtBOyQW0l0uc 5OQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789564889; x=1790169689; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=39cvH491Kj2qhfCGhVeMqkgEYTvIuzsvjq1PpKmD+oE=; b=aqu1h33wlCddrl5I24lRHcxMCEeieuUoszeqsCk74vJpe5jQicgrnMCsDy9T4NcBg/ CSqQoq5xFe9w6it458/BtABMklpu19T2Igmn+kzIaM0nHpT3EVbwnjuZTO44Rvch2rkj jmAhl7SRSY6Z+6Zpclz9JSsZSN2paVNFrmZxCPxYQNFM/nqekSxXsNsFcTo+kBBr5vMK AtHujYD9/MoIXwKMpYcxP8YEJ3yyUaBFpnKCpO+pZ5PbuN6bl11vNrAx4WhdnW9r6kdA 341cTDQHaX0yCZxMtYYdqe6PhvWhaaf0TBqLNgFojwUKf3P2EzJWmGeb3CqnvX8lfhv9 ES5A== X-Gm-Message-State: AFuF++npWgVpxbsNwDwafeLt5wQTeXC3JkU+x2ZQlz29Nj4y2XaHv2ld 76lBbCsT6/xxTyjw8ZIAlLq5fegki0ANHNuuCGN8UDldEZfPsZxxPjDRvW21aZDDUczZnGf5yF4 EQL6woYQ9z8PgAoSrcT7i8xCJ9NogJSBYHcAf3X6IwYV9EyGGR9vLN5+iMGyK2FhqUTBzdLpI/y MJU5T9OWHQtUM/AvcIXq9wA6jtxs4vHFy/eCcDL16N X-Gm-Gg: AYBFou2seEHPdTd9NXKwfy7emBtfYEdTYA79qYxSKcP7VjTButSqv+dDYY0fvg7goED 1txoEmoYpZBLsBc8m4kn3hSjuVV6ZXEOlRt7S+oTCoZbecanPhaVHen1yQoxxDq02vLtJJ8476u zfSRcJapM1wUBN5Miawbn/mAewRdbAG0xo+VL7psvSQ7o9yexTloB4yU9a43VjapaY58yoUFeke cT+dgpzxYXn/mvW9+iLWoA18pyZvTsPEl98jpLz7pLNWPxPw6QlZmgF/+2v/ecA9J3ARhZd+tlP utGAxGzuWw/FZDzCYH9zkEUdsT/8XzNGN1CoKY1ANpuoEbPS3gdqbBxsp8puJrVoT1djszk8eGk VQygRFvDo5VBFWeMBmdANth7UOQYP5HLPiPJwIVIUZ7gMucT+xmlZiKZh5xeefURTaA== X-Received: by 2002:a05:600c:354a:b0:49c:ffab:551f with SMTP id 5b1f17b1804b1-49eb73477edmr31610635e9.22.1789564889370; Wed, 16 Sep 2026 06:21:29 -0700 (PDT) X-Received: by 2002:a05:600c:354a:b0:49c:ffab:551f with SMTP id 5b1f17b1804b1-49eb73477edmr31610145e9.22.1789564888858; Wed, 16 Sep 2026 06:21:28 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 2/8] ncr710: reuse ncr710_clear_pending_irq in ncr10_do_command Date: Wed, 16 Sep 2026 15:21:14 +0200 Message-ID: <20260916132120.860910-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260916132120.860910-1-pbonzini@redhat.com> References: <20260916132120.860910-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1789564932609158500 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- hw/scsi/ncr53c710.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/scsi/ncr53c710.c b/hw/scsi/ncr53c710.c index b87fed05a4d..12a9b69336a 100644 --- a/hw/scsi/ncr53c710.c +++ b/hw/scsi/ncr53c710.c @@ -928,10 +928,7 @@ static void ncr710_do_command(NCR710State *s) return; } =20 - if (s->current) { - ncr710_request_free(s, s->current); - s->current =3D NULL; - } + ncr710_clear_pending_irq(s); =20 s->current =3D g_new0(NCR710Request, 1); s->current->tag =3D s->select_tag; --=20 2.55.0 From nobody Sat Sep 26 20:51:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1789564946; cv=none; d=zohomail.com; s=zohoarc; b=DXOOy1E1LWBXX8ncaiqYGsw6PlydYd2xwlmesN6kq7qwB4OSsIyJveGS+M3LY29sbYl+jnY98lfJo06PmQlVCuowJA1jwjCo3j1+4YcSz+WgS1b+Oq9eRpZ+SroLFU/53zG4P/aT6ixBdCI6oI9sDyXJrQTqMUDTsYc93MXqcM4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789564946; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=I4zCgCofAbSIwBV7LwLzPbmwRhQRvzJQGav11HNAOOQ=; b=iZyyu7pJMJWc8QF9OCV/v62NjiX18McFpA7n2dqbrI6z8HLKzbA64454l9NkD/uCNUMbVjxyce3raGgLgCGYfPJnWg3yCeGqcAs8ZEh5Y175cFcYl0Qv+djU5Q6/sENEDl7gPoUXbOByKZuS9RtLo7ZDm58tM0dZ1H0qHPcFVmI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789564946902157.0894249841641; Wed, 16 Sep 2026 06:22:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6pZy-0005z5-Q6; Wed, 16 Sep 2026 09:21:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6pZx-0005yi-0d for qemu-devel@nongnu.org; Wed, 16 Sep 2026 09:21:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6pZv-00033m-I8 for qemu-devel@nongnu.org; Wed, 16 Sep 2026 09:21:36 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-56-2R5RzYCTNzmZvLSLNDZnrQ-1; Wed, 16 Sep 2026 09:21:32 -0400 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-495689bfcc8so46654645e9.1 for ; Wed, 16 Sep 2026 06:21:32 -0700 (PDT) Received: from [192.168.10.48] ([151.49.232.249]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4870bf26c8dsm7349604f8f.14.2026.09.16.06.21.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2026 06:21:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1789564894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=I4zCgCofAbSIwBV7LwLzPbmwRhQRvzJQGav11HNAOOQ=; b=BwecgD+qy27WaSfkXURGPF712O9gMNBmRYUWxeGKkaLM4gprF5TGlug7uckRnfGdCwLayF QGRG4PDtKC5xpZLaL7fDoATkNlUMgbfC14hw4k0/mBKbNmDy3A83IZZI0IXsnRD7WGBhQ8 S7GR8T9WE/qF5Ct8zBDlQrPlVwG2TQw= X-MC-Unique: 2R5RzYCTNzmZvLSLNDZnrQ-1 X-Mimecast-MFC-AGG-ID: 2R5RzYCTNzmZvLSLNDZnrQ_1789564892 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1789564891; x=1790169691; 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:content-type; bh=I4zCgCofAbSIwBV7LwLzPbmwRhQRvzJQGav11HNAOOQ=; b=Q8sy2+3wLN9c9X1IUn8UOuixQ3bO13qTQkmmosnTE5WDvnBDHEEuuif+NNCx9WRI4k yjZ8Ts0F2/+1K8MR6mZWIlsLtUg/nUGZhB9a+ubReVMeuqxgb0L0LmQLmjkPTMOESVoM PPxM3micyTkvT9d0V3jAgg1TjKbt5W8wzOXdT/VPtWpSpR10Od19irgx6IZvESncd6M9 zGDWK/GOhgpTy9S0NhYndo2w4XccsTvSe+0U0asNW1chLyj7wIysPyB08+ZOvGNhMvRa 5ART1d5xzEl+rN+I2rpC7JUvZ9Em8xD3eAWa8WZYGWhEdqzYABR/RNMJWfJOcl1WOk4A RVTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789564891; x=1790169691; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=I4zCgCofAbSIwBV7LwLzPbmwRhQRvzJQGav11HNAOOQ=; b=w2jGuet7ZoRb/gDu4Yhyh1NYMYr9IdxgO3Fh6quoSQeNjM+ZeKE34tmXcPwtFNpDHG Q1FR8l0n8Kzu5D8Sy3rJ8IzpjBd72NZZpML92GBMgoZO0jGGdfNfDB9xPZ4xLcTznYy6 uTN/UQBT2MBIcB8v1gfnLOPDBlydoxDIi3LnHOr7IvJzeTg81wquxIu2dbNbgZXNacwi Eg7//UQNKg8/z580XTnygsp6IjYt2Or8JjtF/9OwgOKw/rCzsf1m6TyflFjmHw+f8Wo/ S5AqsoCRRb+fYV3y0UTKmVLPOyXKbcveSIF12ZIP/eW2JaQdqvvKcT+K+vPLVrHPTn3/ IkQQ== X-Gm-Message-State: AFuF++l+YYhK+vrQgLpJqewyrld7O2O1SZVf8MpBy40+Mlrca7R3OjLy f7XlgZVCHG+XYCW68bDRpWW4VePoMRRxeheoDiNlvOEokWNoTHD0zYBeEmplzwqGmsoHyS4qI0g uRPM1SW6jCr2/+2ey6EZG6mWfzROL9rVoR+YUduXFSlN5JA7aKoFffJ0E/zYyCCAvQK2FnqlrcE RxvaBc7NlqDeipL7zFG1uewGHW96Aez/ZExVmFfMiY X-Gm-Gg: AYBFou2VIRS6Tt5DfUk870Gjz8Lp1n1CI8OnDVhDWVCfHALTmtgiZl0KT+ZGJGDQ/jz oMhVR5hQsbVsYVAAHpIFz5XIBXAGSf7M8SonOiHOqipbJn1MOFqN+Liwn6N7h8rxcLMdrTaUy2E CcncRu/hT5DR1VzY2xfX4J+B9Y980iyJq5ODGufFIyrv0NTAEOPBboUUaJz5LwfURBYIPx8Wi65 NyQi6s0QDnK6I6pk1frJb3SxMbnKL6ytEV6yy1cjyRijkhifgAfvV8Jqh7ZLutaBaW11H9SCg6A 6EI+j5nZJa4gwvtYsW3eLsp1NetuxJUjYMX5hzCoOjAQ48pzv2ysau1ymm1eTMdtrxM+5xiqstu CbYDxMfS5jvN4gRxoncOqxkHFcg/b2LIleUg2YFyEyD0xXJe0Rx8vFE5ZjfFu+fRtv1b6ETKl6V 2ytbOU X-Received: by 2002:a05:600c:8b61:b0:49e:6891:27a8 with SMTP id 5b1f17b1804b1-49eb732e411mr27612475e9.25.1789564891596; Wed, 16 Sep 2026 06:21:31 -0700 (PDT) X-Received: by 2002:a05:600c:8b61:b0:49e:6891:27a8 with SMTP id 5b1f17b1804b1-49eb732e411mr27612025e9.25.1789564891093; Wed, 16 Sep 2026 06:21:31 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 3/8] ncr710: remove weird p->req == NULL case Date: Wed, 16 Sep 2026 15:21:15 +0200 Message-ID: <20260916132120.860910-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260916132120.860910-1-pbonzini@redhat.com> References: <20260916132120.860910-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1789564948765158500 Content-Type: text/plain; charset="utf-8" Setting p->req to NULL in ncr710_request_cancelled and ncr710_command_compl= ete only protects from clearing p->req->hba_private in ncr_request_free. Howev= er, in this case p->req->hba_private must have been already cleared (by the same ncr710_request_cancelled and ncr710_command_complete); so the reference to = the SCSIRequest can be kept until ncr710_request_free (called eventually by e.g. ncr710_do_command) and that assignment can be made unconditional in ncr710_request_free. Signed-off-by: Paolo Bonzini --- hw/scsi/ncr53c710.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/hw/scsi/ncr53c710.c b/hw/scsi/ncr53c710.c index 12a9b69336a..ac44e99dd90 100644 --- a/hw/scsi/ncr53c710.c +++ b/hw/scsi/ncr53c710.c @@ -735,12 +735,11 @@ static void ncr710_add_msg_byte(NCR710State *s, uint8= _t data) =20 static void ncr710_request_free(NCR710State *s, NCR710Request *p) { - if (p->req && p->req->hba_private =3D=3D p) { - p->req->hba_private =3D NULL; - } + p->req->hba_private =3D NULL; if (p =3D=3D s->current) { s->current =3D NULL; } + scsi_req_unref(p->req); g_free(p); } =20 @@ -749,11 +748,8 @@ void ncr710_request_cancelled(SCSIRequest *req) NCR710State *s =3D ncr710_from_scsi_bus(req->bus); NCR710Request *p =3D (NCR710Request *)req->hba_private; if (p) { - req->hba_private =3D NULL; - p->req =3D NULL; ncr710_request_free(s, p); } - scsi_req_unref(req); } =20 static int ncr710_queue_req(NCR710State *s, SCSIRequest *req, uint32_t len) @@ -794,13 +790,11 @@ void ncr710_command_complete(SCSIRequest *req, size_t= resid) ncr710_set_phase(s, PHASE_ST); =20 if (p) { - req->hba_private =3D NULL; if (p =3D=3D s->current) { - p->req =3D NULL; + req->hba_private =3D NULL; } else { ncr710_request_free(s, p); } - scsi_req_unref(req); } =20 if (s->waiting =3D=3D NCR710_WAIT_RESELECT || s->waiting =3D=3D NCR710= _WAIT_DMA) { --=20 2.55.0 From nobody Sat Sep 26 20:51:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1789564917; cv=none; d=zohomail.com; s=zohoarc; b=ioUvH4gYvszUPlm6WKXzyyKBOIzCadoPd72v9WO5uj3jmcuRwd0DCb+tsrcFXQv0YZEHjWmBagn9l3n+jGaLf/n7lVRppbICAMEJrt+w79T4jj+rNjHcrQa2P8YxNUW/Ntg33QXSadhwzSerkQf/86sn1FYyO66tLyNZI733sQc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789564917; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+zBW25gKUyiE/snsk8aXKtC3LP8ALTPiyrh6mxfmGyk=; b=CCIUYl6qxSql6G0M7xM3qIovdrbuFSH7a8astL2/XwN8QJE/CrHyf2jYOFZISFyGrbZWBRZ385EF78HrLkko1NxBVsP4WTxPl7byJIXtmhH4WNagynyLEBSK23hdwKFnDlkTuuCxRZ2VimZ3fImAZiX5/8LP06OSKDOeSVIr0BA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789564917561702.6273142298666; Wed, 16 Sep 2026 06:21:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6pa5-00060s-Q5; Wed, 16 Sep 2026 09:21:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6pa1-0005zu-V5 for qemu-devel@nongnu.org; Wed, 16 Sep 2026 09:21:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6pa0-00034F-Ed for qemu-devel@nongnu.org; Wed, 16 Sep 2026 09:21:41 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-572-2GwZjtUBMrOs49J6UbUOXw-1; Wed, 16 Sep 2026 09:21:35 -0400 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-49e65f2f1baso45010885e9.3 for ; Wed, 16 Sep 2026 06:21:35 -0700 (PDT) Received: from [192.168.10.48] ([151.49.232.249]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49e83b11691sm88193685e9.12.2026.09.16.06.21.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2026 06:21:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1789564899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+zBW25gKUyiE/snsk8aXKtC3LP8ALTPiyrh6mxfmGyk=; b=fM3iuSHn8oxGnJJLHtcCXbdyl/5obSsdIcgomvBiiEEZtZGrt/ho4+pi+vetyS+BOQMA7y LDW8IWMbtAE/69+lIn+XFRIU9TDxYx2VRYDTMcOOZddi8gBOjRBvs8qkntpblZm6trNcZ/ PDIepQEG/Zcev9KrUL0aKswRGUChwLs= X-MC-Unique: 2GwZjtUBMrOs49J6UbUOXw-1 X-Mimecast-MFC-AGG-ID: 2GwZjtUBMrOs49J6UbUOXw_1789564894 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1789564894; x=1790169694; 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:content-type; bh=+zBW25gKUyiE/snsk8aXKtC3LP8ALTPiyrh6mxfmGyk=; b=joJrFdRF6y+4HxfqmUaIGTFnivTVMNJfcwVK41S3R4bW/c9DLJiz0NixL6fLEDTwnE J01Nlr3ScqGjILC3pZdQzO5R/5H8nKodH8yuxRVuCa4t5EjqDC8IIUADeWV7AMnr47mx wJl+X6eHm9fZqSWnevsuxXJrkSwu7YH+uhHQ7Nk+ZYRgCImvgDeqHMKGsk44wr7c+4Et vA6ukmQR9vcrTUAD5ab8TaLMgp5fHEry5PydI+icOrW7tUHvOFNC4DsuoNuAxFhq8raP 3kH+0pJOoJZ/igAhfmnyHKOmcJ7fhYnftGvby3T3r+0fHXABp4xLH3HdmeQ30FQtCJp3 Bhcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789564894; x=1790169694; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=+zBW25gKUyiE/snsk8aXKtC3LP8ALTPiyrh6mxfmGyk=; b=DIbyBIUoNCPwwppMpRvZe0l7AoPkxRrXkyddE44DRpeBC1+gmsGrj/u1JbH+gcMTQ3 Z7uE/gTyy+TVzbiRWzLnzFfrPTW3tKN8pLDCP91P2IQvNHDTlpKhF8AyOzwtRwDjd/yl rjo98IyA9qtZUNGnH7cJ+ujqQ+c4Lz6c3/4ON7kFigQsGiUMxjX3+qD2dXC2OSe0HFf/ 5WVVcBEpieYPV+dyEr0CVIAMke4T02QIKaibgbW/wV8spb3Z+f5V4LIo8Szc0i4bE4gr CFr9kAbsG/BqKMWhpTgFuNc3c+LrsgfplIuFxq/pOjXu2kF2iNAyOTI8NJbPYvF1CymV kH3g== X-Gm-Message-State: AFuF++k9jsEpLVUeQFD1bd2mJmSOgHJCGjVwNPiQkX2JNXNx9n/PTWzK hIoiaitclDCkhQJb95K/KE84Mkgf5KeI8mEtJGDqFy2GnrxcbUxrYbQMjOtejzrJ3muRO54rFzu EaPGNdxXn5dboELmLPLODXiXgQscaqmQTL9GQXRZPTk0XDXwRbuSX8d60UnCk8xYphYfM1X1F39 k0X7SlCoXMoa4df+4xBc8WHUgc+T9CLWz8lFquUKq6 X-Gm-Gg: AYBFou0gUNWdmG49Ts5ZGRXg2mA0Mw8SB1MmlhivSH9TVLD8EyW6t/0D3IsjjG0Mztf SFvtxZJ9t0Ms3EUWRDRTdq0TtX4cGIL1YTFr/3Xs6NrObtsulTrpHetNu7GZRiTibJMutZbQ5jF 6WEk9EJhFgN0xI9lDDiVNnCwiK3pmE5Oypm7307CqU3afodNk5/e67jwZP4cVmyWlsCrj/oHt8E IPc/N2HswKqhyPxTuBBgFDGKv2sKFvcd2kEa2U4LQ5hhMImjh2n2QI6ES7WRwIvSTI+PZWQzNNf eTNR19BGvJFrjibM9GMTB1hb74+iEyyyuoxm5ZvzbZ8t+Dofl9uRddXXEMVzfGW8sGspfX4rGc/ 4909wMVa1aLrlXXuRS7AG1Q1J9XSHAW6Ps+5OTsIf5RaQyd82+lSY1QnGg9Z9Txnr9t8nvvirC/ 5K8+pl X-Received: by 2002:a05:600c:83c4:b0:49c:ff9f:f6b6 with SMTP id 5b1f17b1804b1-49eac463960mr32560785e9.6.1789564894113; Wed, 16 Sep 2026 06:21:34 -0700 (PDT) X-Received: by 2002:a05:600c:83c4:b0:49c:ff9f:f6b6 with SMTP id 5b1f17b1804b1-49eac463960mr32560275e9.6.1789564893664; Wed, 16 Sep 2026 06:21:33 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 4/8] ncr710: clean up ncr710_transfer_data Date: Wed, 16 Sep 2026 15:21:16 +0200 Message-ID: <20260916132120.860910-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260916132120.860910-1-pbonzini@redhat.com> References: <20260916132120.860910-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1789564918729158500 Content-Type: text/plain; charset="utf-8" Move the short ncr710_execute_script case first. Remove redundant s->current check. Signed-off-by: Paolo Bonzini --- hw/scsi/ncr53c710.c | 65 ++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/hw/scsi/ncr53c710.c b/hw/scsi/ncr53c710.c index ac44e99dd90..9939d2e2813 100644 --- a/hw/scsi/ncr53c710.c +++ b/hw/scsi/ncr53c710.c @@ -842,43 +842,42 @@ void ncr710_transfer_data(SCSIRequest *req, uint32_t = len) } s->current->dma_len =3D len; =20 - if (s->waiting) { - s->scntl1 |=3D NCR710_SCNTL1_CON; - s->istat |=3D NCR710_ISTAT_CON; - s->sbcl =3D NCR710_SBCL_IO | NCR710_SBCL_CD | NCR710_SBCL_MSG | - NCR710_SBCL_BSY | NCR710_SBCL_SEL | NCR710_SBCL_REQ; - uint8_t host_id =3D (s->scid & 0x07); - - /* Special case: both target and host are ID 0 */ - if (req->dev->id =3D=3D 0 && host_id =3D=3D 0) { - s->sfbr =3D 0x00; - } else { - s->sfbr =3D (req->dev->id =3D=3D 0 ? 0 : (1 << req->dev->id)) | - (host_id =3D=3D 0 ? 0 : (1 << host_id)); + if (!s->waiting) { + if (!s->script_active) { + ncr710_execute_script(s); } - - ncr710_set_phase(s, PHASE_MI); - - if (s->current) { - uint8_t identify_msg =3D 0x80 | (req->lun & 0x07); - ncr710_add_msg_byte(s, identify_msg); - - if (s->current->tag) { - ncr710_add_msg_byte(s, 0x20); /* SIMPLE_TAG_MSG */ - ncr710_add_msg_byte(s, s->current->tag & 0xff); - } - } - - s->sstat0 |=3D NCR710_SSTAT0_SEL; - s->istat |=3D NCR710_ISTAT_SIP; - s->dsps =3D RESELECTED_DURING_SELECTION; - s->waiting =3D NCR710_WAIT_NONE; - ncr710_update_irq(s); return; } - if (!s->script_active && !s->waiting) { - ncr710_execute_script(s); + + s->scntl1 |=3D NCR710_SCNTL1_CON; + s->istat |=3D NCR710_ISTAT_CON; + s->sbcl =3D NCR710_SBCL_IO | NCR710_SBCL_CD | NCR710_SBCL_MSG | + NCR710_SBCL_BSY | NCR710_SBCL_SEL | NCR710_SBCL_REQ; + uint8_t host_id =3D (s->scid & 0x07); + + /* Special case: both target and host are ID 0 */ + if (req->dev->id =3D=3D 0 && host_id =3D=3D 0) { + s->sfbr =3D 0x00; + } else { + s->sfbr =3D (req->dev->id =3D=3D 0 ? 0 : (1 << req->dev->id)) | + (host_id =3D=3D 0 ? 0 : (1 << host_id)); } + + ncr710_set_phase(s, PHASE_MI); + + uint8_t identify_msg =3D 0x80 | (req->lun & 0x07); + ncr710_add_msg_byte(s, identify_msg); + + if (s->current->tag) { + ncr710_add_msg_byte(s, 0x20); /* SIMPLE_TAG_MSG */ + ncr710_add_msg_byte(s, s->current->tag & 0xff); + } + + s->sstat0 |=3D NCR710_SSTAT0_SEL; + s->istat |=3D NCR710_ISTAT_SIP; + s->dsps =3D RESELECTED_DURING_SELECTION; + s->waiting =3D NCR710_WAIT_NONE; + ncr710_update_irq(s); } =20 static int idbitstonum(uint8_t id) --=20 2.55.0 From nobody Sat Sep 26 20:51:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1789564946; cv=none; d=zohomail.com; s=zohoarc; b=R4UChKEG0dLucVN7SiDzIjPVKyMiF1+jEORSoyOKacOek6aagn/+frBOamBi+LLLFLdxvY7HSydkrwHZxttjqVhxeSKS45IxIH0LAdirY0iTWkQO5BEhV50zyvwceWUF6/b85fNlEnj1ZTi+Ig8GOZyUOKc7EVt2B5xVtF1x80g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789564946; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iyyduBU03DJCFgy9GNHUIma7DAM8Mym2KtDJiobAzUc=; b=nsa9dkTyLvIV+5M5WlGyz+SsUOtwMXcce5o5l+Q3JuQmfgBwXWaikg/mT4WXa5yexTtiVFSEwLPrm/sZNNFIIcHZJAlSHjwC9n0UBUnIvlVGbZXJ/gl+6o0tPdXmaoeeaQ/fRssG3Fw37/LT68/JSXzjL8WawDdy7KdNdiJvqjY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789564946954663.4347461677613; Wed, 16 Sep 2026 06:22:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6pa3-00060B-DZ; Wed, 16 Sep 2026 09:21:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6pa1-0005zq-Qm for qemu-devel@nongnu.org; Wed, 16 Sep 2026 09:21:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6pa0-00034V-Gt for qemu-devel@nongnu.org; Wed, 16 Sep 2026 09:21:41 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-624-XaMtA-vtPJC6U-Te6nCmOQ-1; Wed, 16 Sep 2026 09:21:38 -0400 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-49e65bee41aso19744345e9.0 for ; Wed, 16 Sep 2026 06:21:38 -0700 (PDT) Received: from [192.168.10.48] ([151.49.232.249]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49e83da071asm97284495e9.8.2026.09.16.06.21.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2026 06:21:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1789564899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iyyduBU03DJCFgy9GNHUIma7DAM8Mym2KtDJiobAzUc=; b=VUC+TAdtqPyncoxBkgQIdTGK9riXvfkRbV8h2RrOMQ6iq+7DXjssXmLEfaTrSMsJlAVNJ8 w860QEjOpZJ5QPgDdsyI9B/oaThh9fFm8K9ELOQlDyacV6aEIdjFcsLl3GrFJB5B53JOg7 q1zQkUWmlCKfSI6qW2WE0bsVW6aey9A= X-MC-Unique: XaMtA-vtPJC6U-Te6nCmOQ-1 X-Mimecast-MFC-AGG-ID: XaMtA-vtPJC6U-Te6nCmOQ_1789564897 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1789564897; x=1790169697; 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:content-type; bh=iyyduBU03DJCFgy9GNHUIma7DAM8Mym2KtDJiobAzUc=; b=epltWdih5sxwxNj64NeErwyivi8df4/z7EsCr/Vtkl6J/nUaM0kYsnS09nS4ZuLhHQ 5+pw+BFExmgYY/JFIhQofcFZD854PeBIyqLJ72P4qQZP4HXjzAswd3TT5wA29ej/QZ2X iNATaZVYrochL5b/2rspuWaGgPBQ6M9BKNbBlN/I+n4z21SmOwJoCMvdVCRvrxrqvBtg 9WsXJxMmWe1uBk66Su1y01BPP3MflRdCPHLsDErvX2vC7rfA1S+nZLah82Og7AOks5JV 7X/n74T8eNBZTdksm1105pTStaU/2pTWmO+el1yxYJImoJ3y8hec+0fm03HihOV0VAML SWxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789564897; x=1790169697; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=iyyduBU03DJCFgy9GNHUIma7DAM8Mym2KtDJiobAzUc=; b=qua9a4yGCW28oHLrWC9ykfsJMLfC+OB+RNBWfjliT6BL0Wq67PWSbBK4hnt/Fa49s7 DJCPpawutHT8vxUXCEU0yBpBym3tI+jZ6i5BzA6w48BWHR3GmXqA1lvUzFoQtjEdhOA2 M9eQPMBtIUN0IMm09LZMZQQalrgF0DyogKAniaOKii4GurUjjqhN134lqvxpB08WIIzc JTUrqs8tJ6+eyf6f8Ztqel4IqgiVf6STfT4+RjPuSbm72vctJ5USNd7S54eXesrY9ndd Nac8icCycD+etj60iBcq6xCrw4Po+agMO9yzPpJ6gzeLDWGXgF5QZkqgDMNKfN+Klral +9Iw== X-Gm-Message-State: AFuF++kqLfBwPJeLTglymI2mv9GXOrtIMp+Oj7Z28dNr4zdWW7EgOITA 1aP3T0ziFR8TZDW0FmqK9A6jjF8LFggE7Wv+tOpIPi7P/v2JTHSFRBMtEcx49EJzxizlnZbTTxf K8BR2wZspHxjOcfVjrwtx1Z+PDl/2801x3DnufX7th/adWEAGy3rL0+GQY1ddHbhsdtB2aZy80k 4msu3n3zRsAjAgCttB8m3WBahj6dc7UWDpLzAzccEb X-Gm-Gg: AYBFou2nh0EdnZG3+sTYzXWGI7Pu8uRiLJrTv2mdGJX0zGpRyNqelBiQRPIaihVKgr9 EOrnqzgG76SLQw0zOyYQjLuRjzYhvVb72hAaxVX5UGDgEdhbuQoh+y/UnPzf7dVkC0clioaSyKZ ZWKfR1nipdP5ZCEXbAwtOoOBLmmVYR64OAzwXrAKN9x2p99c47B9qEU36o4Xjstw1VcI9cJWCaL OcU0cw/8AT2DhpgGO9y9TmeABlKcvYyQO/9xWzlmUVIXV+RDB63j+i2MfigNzW5RyjRliX9cmxY TcY//kn1s/2zMdeAwjriNIlnoxBOoFhQlGK+qXpsU6Vpt8SizAwEsrW3VxHDE24FO1P3+94MkaV eH84vP+ixW5MJeHmO4C/fF0PI5C6hKfqf1S5pidK/4oozEMuSjWlpZGmBILkLCqyclMsOamnkOk i4OMR2 X-Received: by 2002:a05:600c:3507:b0:49c:f13e:e52 with SMTP id 5b1f17b1804b1-49ea20b48c2mr30748135e9.15.1789564897003; Wed, 16 Sep 2026 06:21:37 -0700 (PDT) X-Received: by 2002:a05:600c:3507:b0:49c:f13e:e52 with SMTP id 5b1f17b1804b1-49ea20b48c2mr30747685e9.15.1789564896452; Wed, 16 Sep 2026 06:21:36 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 5/8] ncr710: do not load s->current in advance Date: Wed, 16 Sep 2026 15:21:17 +0200 Message-ID: <20260916132120.860910-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260916132120.860910-1-pbonzini@redhat.com> References: <20260916132120.860910-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1789564948753158500 Content-Type: text/plain; charset="utf-8" It is unnnecessary and potentially could use stale data. Load s->current just before use. Signed-off-by: Paolo Bonzini --- hw/scsi/ncr53c710.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/scsi/ncr53c710.c b/hw/scsi/ncr53c710.c index 9939d2e2813..4b20afa7e33 100644 --- a/hw/scsi/ncr53c710.c +++ b/hw/scsi/ncr53c710.c @@ -1040,8 +1040,6 @@ static void ncr710_do_msgin(NCR710State *s) =20 static void ncr710_do_msgout(NCR710State *s) { - NCR710Request *current_req =3D s->current; - while (s->dbc > 0) { int to_move =3D MIN((int)s->dbc, NCR710_SCSI_FIFO_SIZE); uint8_t temp_buf[NCR710_SCSI_FIFO_SIZE]; @@ -1169,8 +1167,8 @@ static void ncr710_do_msgout(NCR710State *s) break; =20 case 0x0d: /* ABORT TAG */ - if (current_req) { - scsi_req_cancel(current_req->req); + if (s->current) { + scsi_req_cancel(s->current->req); } ncr710_disconnect(s); break; --=20 2.55.0 From nobody Sat Sep 26 20:51:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1789564936; cv=none; d=zohomail.com; s=zohoarc; b=Qry36hybY9VPfaUslowcWyUBH7yUwlonpaAg94izI2+kAIB4dafumK7DkysMG8IMSNkExNPDJsuNyUlrNBA7wBc8dE4f6Ty3VjScmqZ0LV8L4D24lFIausMUsWvgQSA2+tocUeWu85XDPc2KzTxZazDC2UXnllFao5WGATBgA28= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789564936; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qbDTV79hKw2WSZhcto0ou4JyiENGFfJ16eNkhC8Ca+Y=; b=jOEzLtG6ElUNLmuguzwLaMg9D422OSVgqTza/xdeOENpLFRrJOQisT0/abucHzCaEtigipoAK1XRATY21sGOjT7mUBEBm5TcWcU6k9/EXpEJWQsXMkssPDsize0RUlVX1yY3h4wkYmopuCK2r1mJLXKk2gyxi+lOqUNtJxINVfo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789564936765277.42633507773405; Wed, 16 Sep 2026 06:22:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6pa5-00060f-EU; Wed, 16 Sep 2026 09:21:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6pa4-00060X-1k for qemu-devel@nongnu.org; Wed, 16 Sep 2026 09:21:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6pa2-000351-IE for qemu-devel@nongnu.org; Wed, 16 Sep 2026 09:21:43 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-620-P8GoUMOHNbusbSMyHdYG5Q-1; Wed, 16 Sep 2026 09:21:40 -0400 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-49e73659ac5so41666145e9.2 for ; Wed, 16 Sep 2026 06:21:40 -0700 (PDT) Received: from [192.168.10.48] ([151.49.232.249]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49e83a89258sm82229215e9.2.2026.09.16.06.21.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2026 06:21:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1789564902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qbDTV79hKw2WSZhcto0ou4JyiENGFfJ16eNkhC8Ca+Y=; b=eOiMej5NlM6djAC3zgs7jou8yN+IRW7nN1P3hYAVbRXYiyoDXpl5OSeOKs0/oHPlTX1Sug B0ZK/oBoLnBTsQUW/k9DBpKy1nT9qE4anOC3aMFI9fTMf1f5r5t3a+zg4OnPZNSA1LQNu1 1Lh4zQBhcDRPdVN5APU7IxMapAD3TkA= X-MC-Unique: P8GoUMOHNbusbSMyHdYG5Q-1 X-Mimecast-MFC-AGG-ID: P8GoUMOHNbusbSMyHdYG5Q_1789564899 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1789564899; x=1790169699; 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:content-type; bh=qbDTV79hKw2WSZhcto0ou4JyiENGFfJ16eNkhC8Ca+Y=; b=RmefnllSH98EpXN2npnj0fuQLPu9HWTN95a9SYnWgZ408DKSEWVo8orKWYtmp8LmSF DoTYprEohCg33zFwh7E4LbpFhO+hkAden/HBl0QCBq/6eul6yn/5yv9PV+M8uiv7/u3N loYz8XMofPHfR9dHBWbbhFhGAVhjlVsNfg3wlY0tK7rYJZKrFfs3Gx0CL4l8MvKheQn9 15glJwr36Pm7rToppfzfWu8qF7OIJeGwfAj59m7WtAn9q7Qg3GbqZ3VWDQR66sISPmgZ X9vuHF+j6OOrDcQpg2py05UQhqFXI5ca5HPpHjdr689IB0jcNaKz63StdPj8XbzRHbNb JW6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789564899; x=1790169699; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=qbDTV79hKw2WSZhcto0ou4JyiENGFfJ16eNkhC8Ca+Y=; b=lR3qQsztYZsYyMYQeri6ACcOEEq9qk+7vug4C+ONvsJs+KUiUl9KgaTRkXh3rdtdO7 7X8xtJqklw8mKWLT79kPtuhuLLm4RlwqLiNk7guk9ocu3z81API2Xv2IrxhJIDBMFcza /hVQoQ+q2r72aiwTxi9vYa4ejgKv2Q8glGPhFCsSYvHNkEz/arb3A75AsJq4rZQRaRN2 RswlJmUc7g0P/IFs8OoTJ4wwPmirqJkaiW+kDlkIYKy1p6jEJZr8HFpLzhBysCVPRc+j oA0Bcci1RUZ/qjRvyVdkKelZvYSbB3RiyvMwDbbCCUxwvkiL4z06HUDX/TiJJG9RfG79 HJWQ== X-Gm-Message-State: AFuF++mzre3JwSI7Y1KQQ3EEGnxoVjH1LNnzDTh/tZKtX+8B7/AvSFbF 1RSF9oThSvNn9o+dP//hy85yWOJ4kr7PHVPhT0u7gXCPt1M6dXwGdPCsDA8oPwsI48P+acHe6yr lTJ3rv74Zcz3H/e8VzfSooNaXelaOZKtiaH5gGGsp8VJpZL6QeBFKgCE85hx/VvTdNKEPravlTK MgIH9ZSq7D32e8FDibd3PcGSvlJ6aHLsuVscVpw9z4 X-Gm-Gg: AYBFou02JRea6dTVglHfi54WlNtpqCw2l3VAVVcYOxNSZwbkntUpicPTNDDiyAzLNFC rVlXRrN0sl4WqNgQxyQ+MeQ7RWlOAIVA+biAM7f0300caJ8h4czxsayld5onF3z5HfMigZZ/sW8 Cj+dLUSLhcAUfbuTv2Dlcj68wMBdezsc6Pf4IdqrFCj2NlIIKseaqr6tijf4XFKHLqcDXw+Ynnz +l+AQcSeShpFzfVpCXIEA6hJnZuDoB2GrTKR5PiiZufcspXsLb4FCsnEVtw1PvV36c65x1sxtFT zpRuB++0n/9sAhnkaucIFBUPYJFPuKaWwZCcsAwr+qyU9LG0mUdH3mpQoR22rABbqSo/R9k1353 zM4O4Wfb0jVFtPuB/UiwRO7U24uQUNUn+kAdXMLQISYc0ux4TM8n07//HDnBhGxjkWTosi0KeJD zdrnu1 X-Received: by 2002:a05:600c:83c4:b0:49c:ff9f:f6b6 with SMTP id 5b1f17b1804b1-49eac463960mr32566065e9.6.1789564899192; Wed, 16 Sep 2026 06:21:39 -0700 (PDT) X-Received: by 2002:a05:600c:83c4:b0:49c:ff9f:f6b6 with SMTP id 5b1f17b1804b1-49eac463960mr32565265e9.6.1789564898553; Wed, 16 Sep 2026 06:21:38 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 6/8] ncr710: remove dead message in actions Date: Wed, 16 Sep 2026 15:21:18 +0200 Message-ID: <20260916132120.860910-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260916132120.860910-1-pbonzini@redhat.com> References: <20260916132120.860910-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1789564938752158501 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- hw/scsi/ncr53c710.h | 2 -- hw/scsi/ncr53c710.c | 6 ------ 2 files changed, 8 deletions(-) diff --git a/hw/scsi/ncr53c710.h b/hw/scsi/ncr53c710.h index 00b6a01577c..2a658a00138 100644 --- a/hw/scsi/ncr53c710.h +++ b/hw/scsi/ncr53c710.h @@ -108,8 +108,6 @@ typedef enum { typedef enum { NCR710_MSG_ACTION_NONE =3D 0, NCR710_MSG_ACTION_DISCONNECT =3D 1, - NCR710_MSG_ACTION_DATA_OUT =3D 2, - NCR710_MSG_ACTION_DATA_IN =3D 3 } NCR710MessageAction; =20 typedef struct NCR710State NCR710State; diff --git a/hw/scsi/ncr53c710.c b/hw/scsi/ncr53c710.c index 4b20afa7e33..25cde311b70 100644 --- a/hw/scsi/ncr53c710.c +++ b/hw/scsi/ncr53c710.c @@ -1027,12 +1027,6 @@ static void ncr710_do_msgin(NCR710State *s) case NCR710_MSG_ACTION_DISCONNECT: s->sstat2 &=3D ~PHASE_MASK; break; - case NCR710_MSG_ACTION_DATA_OUT: - ncr710_set_phase(s, PHASE_DO); - break; - case NCR710_MSG_ACTION_DATA_IN: - ncr710_set_phase(s, PHASE_DI); - break; default: abort(); } --=20 2.55.0 From nobody Sat Sep 26 20:51:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1789564937; cv=none; d=zohomail.com; s=zohoarc; b=WzrfsvKZhsLkDJZiKSmKBab7qJwaqj3w20nTICjgzsLBAaoYPYSkcnwPt6Dw+ClEnbOwDfj8MwiYsEwhUX6kr2ovyoV28iVGjPlpwo1tzvMm0d9B8QMZvhL0R3vR4VfEcOsEvpShJM1bv0nCM3RfsMIyQLJW8k6ipLJRX9I5e9o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789564937; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=NEapkFoc3/SS/ruroSAmQFU1e206ax8sjMrw6J1moDU=; b=k3+gEuts19omN0b9OzIrylmyzu53+eAYpap1BjZIB5TeB0yGsQjVd2Jjn12wwvPYbr0F1Ypp+DgqS73HfsDownTs6s/1LL48Wm2RyhLpJkWCgsyPMptDYVvItvAvCzGQvjJtEIULdBpKOmSK/fFM1vJmqYd/mhqM7Fmt6aCsR+o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789564937873170.70992053529892; Wed, 16 Sep 2026 06:22:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6paC-00065K-1F; Wed, 16 Sep 2026 09:21:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6paA-00064k-8e for qemu-devel@nongnu.org; Wed, 16 Sep 2026 09:21:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6pa8-00035V-AI for qemu-devel@nongnu.org; Wed, 16 Sep 2026 09:21:49 -0400 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-249-ukMOpWz7M-uIIXiVO_p5cg-1; Wed, 16 Sep 2026 09:21:43 -0400 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-487038a4a88so1347362f8f.0 for ; Wed, 16 Sep 2026 06:21:43 -0700 (PDT) Received: from [192.168.10.48] ([151.49.232.249]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4870bf27ce2sm7432592f8f.20.2026.09.16.06.21.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2026 06:21:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1789564907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NEapkFoc3/SS/ruroSAmQFU1e206ax8sjMrw6J1moDU=; b=erTmFqfc9TuJMGJmiAFUunBoBSAqYYh3LOwActUSyAM3fmdS2MH0YbxKEjvaTHjSEHOfZg 6p65K/zATkSX+/h6iOLXhboU1aCvQTrhNuiRJ279A2TROdmok9LNubVRlp+/53kH488WZW Zupi6pwnr82DVFWjhj9cCBfy0x/ToXY= X-MC-Unique: ukMOpWz7M-uIIXiVO_p5cg-1 X-Mimecast-MFC-AGG-ID: ukMOpWz7M-uIIXiVO_p5cg_1789564903 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1789564902; x=1790169702; 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:content-type; bh=NEapkFoc3/SS/ruroSAmQFU1e206ax8sjMrw6J1moDU=; b=i4sPqmd8p8cL6t7dcQrREq5vIwtFTwkw8HAfYyA/zweHALr0S3dSimWwJGUYzlpDET Frgr+rSfGUubDC/hm3HtwdFwQrqii6q8utNf8MU9JxZxyPZ34eKCoZovv8lwy6FO4Ocw o4ZGS/aX4hi/zUbwx8+N0nkLh9ExdrAAbwsYIscICe1WAxLgGFzbJrJigE5D0e4wJWxV t2rFQab72TteYa3QeT6jzFglQ9JZYD6qfD3uMVGol266BDarTTgc6TuYlpMH8XdVBfWj vlD4JAysPYdqdxBTSfavpUiGCIgY37JYgAAaVBgV4a0Jhe4nks1/tL3DqKs8gGmXtA0A zKxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789564902; x=1790169702; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=NEapkFoc3/SS/ruroSAmQFU1e206ax8sjMrw6J1moDU=; b=2eS355uHvWNQf9H2eLDMuUJI1uc1udh+Qjcw26Bsj9NN09Tar77hhikm9JJoRUSnry 7yg7LT4vfjm3FF0lwiumB09WZz5RKBB3FbRnUCmvcDNXA/9oW8fOeuWlX0JZjrTu4hcG etLFyz+47hC1H8qvdo2K8//1qy6QcSG0DUViNfxgci5bUqoXhdDvMOUjKtJGrdztLZuB 2xvAIq6D+LFcC9qzDBjWpggHt/ZjypOtOCTEIWlM7P49Az+i/IUg7EcoqGhF0GcJrH9C /gN7741+OHjzFTsWmKMQ6qbEWlGcej3yBCn+LL1TzSEuHbfhxGW3al6wsOJ6qNPKtGF9 llPQ== X-Gm-Message-State: AFuF++mx4J35i157zgSL9SkxmtzU9AZEzvJvgSrkVnU4FbSDbBS0FMQE WX51s5a76p8Ux1OKCc7jiESbzB9EF89spypo4uL/LBqTrBRgNsyRMqZbadeQXURtnM7tvlarNv3 7EMozsPmFWCGuTKNRxmVXvFcDiBieMD6ih2QeLAmwmFkPz3MVC2oq8rKui0Z1CiDqhPT+ojHgp+ wQhu+9uApQ0KjMvriUEiW087EEd6MAouOBZnbPj/jR X-Gm-Gg: AYBFou1PMiZE8QtFNwBTj36PeaQTTGcvsqooVdada54cr2Jzr9jjPfmDW4EtrXnUWA3 sNip9VWN0IhAkzWwqAQW6aUl/kR5b9bko/Vx8I4lpXztOpcKkXeeE4y1S2AvvmhiXD/ofEHOIK0 MB3rwqBKobmGxBR2r5gOnjt8MQlP0mY/cHd1ONgPnBzBjG0rEWNJt6xARl5hm22ow9QU9vfLpNG La0L7OiiT+QBXsXBlyqe/dr3em6OwJ4ns4A7Gbi59t9JTG8xIUKlqjA45DTvYpbHZ9uG4aOya2A 0InuqxNAONcqPFx2QCfTuVTVAkTVXQYpJUpeYQeY8K+mkvKqKjvgf78G6FdIAI7xwa3PfBJvVT2 6yoR8XbCx1oWRJWylu5Yw1ApzyD6VTazi8ISYQ/dtPIJoBhEjG6FPS2qPzoQ1uZBKqvJxZW6uZw xGDIy6 X-Received: by 2002:a05:6000:41d3:b0:486:f767:8be0 with SMTP id ffacd0b85a97d-4870cee660fmr3104090f8f.12.1789564902320; Wed, 16 Sep 2026 06:21:42 -0700 (PDT) X-Received: by 2002:a05:6000:41d3:b0:486:f767:8be0 with SMTP id ffacd0b85a97d-4870cee660fmr3104027f8f.12.1789564901571; Wed, 16 Sep 2026 06:21:41 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 7/8] ncr710: copy reference counting fixes over from lsi53c895a Date: Wed, 16 Sep 2026 15:21:19 +0200 Message-ID: <20260916132120.860910-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260916132120.860910-1-pbonzini@redhat.com> References: <20260916132120.860910-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, SPF_HELO_PASS=-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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1789564938903158500 Content-Type: text/plain; charset="utf-8" These are mostly the smae, with only the "if (p =3D=3D s->current) case of ncr710_command_complete needing some care to check that it's safe to remove. s->current is dereferenced: - in ncr710_clear_pending_irq - guarded by if (s->current), just to free it - in ncr710_do_dma - guarded by assert (s->current); only called from Data In/Data Out phases, which are entered after scsi_req_new and left after scsi_req_cancel - in ncr710_command_complete - guarded by if (p), command is not complete - in ncr710_transfer_data - coming from the req field of NCR710Request, with assertion that !p->orphan - in ncr710_transfer_data, later - guarded by if (!s->current) return - in ncr710_do_command, after assignment - in ncr710_do_msgout - guarded by if (current_req), would be bad if the request is already complete - in ncr710_reselection_retry_callback - guarded by short-circuiting s->current check - in ncr710_execute_script - guarded by if (s->current) - in ncr710_reg_readb - guarded by short-circuiting s->current check Nothing relies on the post-completion s->current being alive, so get rid of this case and clear s->current immediately as in the lsi53c895a device. Signed-off-by: Paolo Bonzini --- hw/scsi/ncr53c710.h | 1 + hw/scsi/ncr53c710.c | 65 ++++++++++++++++++++++++++------------------- 2 files changed, 39 insertions(+), 27 deletions(-) diff --git a/hw/scsi/ncr53c710.h b/hw/scsi/ncr53c710.h index 2a658a00138..d5bc3de6f2d 100644 --- a/hw/scsi/ncr53c710.h +++ b/hw/scsi/ncr53c710.h @@ -133,6 +133,7 @@ struct NCR710Request { bool active; uint8_t *dma_buf; bool out; + bool orphan; uint32_t resume_offset; uint32_t saved_dnad; }; diff --git a/hw/scsi/ncr53c710.c b/hw/scsi/ncr53c710.c index 25cde311b70..18c3a4e8c51 100644 --- a/hw/scsi/ncr53c710.c +++ b/hw/scsi/ncr53c710.c @@ -299,7 +299,7 @@ static const char *ncr710_reg_name(int offset); static void ncr710_script_scsi_interrupt(NCR710State *s, int stat0); static void ncr710_update_irq(NCR710State *s); static void ncr710_script_dma_interrupt(NCR710State *s, int stat); -static void ncr710_request_free(NCR710State *s, NCR710Request *p); +static void ncr710_request_orphan(NCR710State *s, NCR710Request *p); static inline void ncr710_dma_read(NCR710State *s, uint32_t addr, void *buf, uint32_t len); static inline void ncr710_dma_write(NCR710State *s, uint32_t addr, @@ -316,7 +316,7 @@ static inline int ncr710_irq_on_rsl(NCR710State *s) static void ncr710_clear_pending_irq(NCR710State *s) { if (s->current) { - ncr710_request_free(s, s->current); + ncr710_request_orphan(s, s->current); } } =20 @@ -683,42 +683,52 @@ static void ncr710_do_dma(NCR710State *s, int out) uint32_t count; uint32_t addr; SCSIDevice *dev; + SCSIRequest *req; + NCR710Request *p; + assert(s->current); if (!s->current->dma_len) { /* We wait until data is available. */ return; } =20 - dev =3D s->current->req->dev; + p =3D s->current; + req =3D scsi_req_ref(p->req); + dev =3D req->dev; assert(dev); =20 count =3D s->dbc; - if (count > s->current->dma_len) { - count =3D s->current->dma_len; + if (count > p->dma_len) { + count =3D p->dma_len; } =20 addr =3D s->dnad; =20 s->dnad +=3D count; s->dbc -=3D count; - if (s->current->dma_buf =3D=3D NULL) { - s->current->dma_buf =3D scsi_req_get_buf(s->current->req); + if (p->dma_buf =3D=3D NULL) { + p->dma_buf =3D scsi_req_get_buf(req); } /* ??? Set SFBR to first data byte. */ if (out) { - ncr710_dma_read(s, addr, s->current->dma_buf, count); + ncr710_dma_read(s, addr, p->dma_buf, count); } else { - ncr710_dma_write(s, addr, s->current->dma_buf, count); + ncr710_dma_write(s, addr, p->dma_buf, count); } - s->current->dma_len -=3D count; - if (s->current->dma_len =3D=3D 0) { - s->current->dma_buf =3D NULL; - s->current->pending =3D 0; - s->waiting =3D NCR710_WAIT_DMA; - scsi_req_continue(s->current->req); + if (p->orphan) { + scsi_req_unref(req); return; + } + scsi_req_unref(req); + + p->dma_len -=3D count; + if (p->dma_len =3D=3D 0) { + p->dma_buf =3D NULL; + p->pending =3D 0; + s->waiting =3D NCR710_WAIT_DMA; + scsi_req_continue(req); } else { - s->current->dma_buf +=3D count; + p->dma_buf +=3D count; s->waiting =3D NCR710_WAIT_NONE; ncr710_execute_script(s); } @@ -733,14 +743,18 @@ static void ncr710_add_msg_byte(NCR710State *s, uint8= _t data) } } =20 -static void ncr710_request_free(NCR710State *s, NCR710Request *p) +static void ncr710_request_orphan(NCR710State *s, NCR710Request *p) { - p->req->hba_private =3D NULL; + p->orphan =3D true; if (p =3D=3D s->current) { s->current =3D NULL; } scsi_req_unref(p->req); - g_free(p); +} + +static void ncr710_free_request(SCSIBus *bus, void *priv) +{ + g_free(priv); } =20 void ncr710_request_cancelled(SCSIRequest *req) @@ -748,7 +762,7 @@ void ncr710_request_cancelled(SCSIRequest *req) NCR710State *s =3D ncr710_from_scsi_bus(req->bus); NCR710Request *p =3D (NCR710Request *)req->hba_private; if (p) { - ncr710_request_free(s, p); + ncr710_request_orphan(s, p); } } =20 @@ -790,11 +804,7 @@ void ncr710_command_complete(SCSIRequest *req, size_t = resid) ncr710_set_phase(s, PHASE_ST); =20 if (p) { - if (p =3D=3D s->current) { - req->hba_private =3D NULL; - } else { - ncr710_request_free(s, p); - } + ncr710_request_orphan(s, p); } =20 if (s->waiting =3D=3D NCR710_WAIT_RESELECT || s->waiting =3D=3D NCR710= _WAIT_DMA) { @@ -806,11 +816,11 @@ void ncr710_command_complete(SCSIRequest *req, size_t= resid) void ncr710_transfer_data(SCSIRequest *req, uint32_t len) { NCR710State *s =3D ncr710_from_scsi_bus(req->bus); + NCR710Request *p =3D (NCR710Request *)req->hba_private; =20 - assert(req->hba_private); + assert(!p->orphan); =20 if (s->waiting =3D=3D NCR710_WAIT_DMA) { - NCR710Request *p =3D (NCR710Request *)req->hba_private; if (p) { p->dma_len =3D len; } @@ -2248,6 +2258,7 @@ static const struct SCSIBusInfo ncr710_scsi_info =3D { .transfer_data =3D ncr710_transfer_data, .complete =3D ncr710_command_complete, .cancel =3D ncr710_request_cancelled, + .free_request =3D ncr710_free_request, }; =20 static const MemoryRegionOps ncr710_mmio_ops =3D { --=20 2.55.0 From nobody Sat Sep 26 20:51:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1789564949; cv=none; d=zohomail.com; s=zohoarc; b=SAjAiFQNn1RQerM/+74VFIorW65T1n8L4V8bbwFSM3K9Uvt3SbnWTRWriDkn0eV39wpIrIZsCl1slSc1+L1hbWmXv2+hzcOEIKTemwgMTEhftbk+LZVR6yOgPubYvrbfTyuGfhI9lfJFgXCsUp5sMooQ5XoVTUk0YlExT2D7fpg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789564949; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=i3ab9f4ObETvK0c9uUipMHw3PnKmaGztWZYlVMHBWk0=; b=BgbLD5bMQMWA7LXEVShl3GH1TAD39ky3yNUcbOyQOwrmuV0QxADQZXWDRJWuwVnSaUTWenW1UfNPGbIVI9eqnF1CNVZCe0Buua90JP8G0y0NDY4OLQqeuzldMj8xm16G6cNkGxy6K8/LxktMn0/UUsjQ2izgogCuiqLPI5ZQIyc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789564949949319.79425753957537; Wed, 16 Sep 2026 06:22:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6paA-00064j-Ao; Wed, 16 Sep 2026 09:21:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6pa8-00064G-N0 for qemu-devel@nongnu.org; Wed, 16 Sep 2026 09:21:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6pa7-00035Q-BZ for qemu-devel@nongnu.org; Wed, 16 Sep 2026 09:21:48 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-302-NvPLE4WdPBS4yd3JnXh6Ig-1; Wed, 16 Sep 2026 09:21:45 -0400 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-49e82768ac2so9270385e9.0 for ; Wed, 16 Sep 2026 06:21:44 -0700 (PDT) Received: from [192.168.10.48] ([151.49.232.249]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49e83b02211sm82792655e9.9.2026.09.16.06.21.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2026 06:21:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1789564906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i3ab9f4ObETvK0c9uUipMHw3PnKmaGztWZYlVMHBWk0=; b=ahLb5Tos/k4TJl0LZIjcWZ+VLEHejR5BZB/0ri7+cWUCXWQ6kjFx4Yc/8h4n/D1Ikh2WBp grGUsdaKTRoP+SD+aCC7sQFoHEwJz0X255zKSZvzFJ94zuWiiAhkoL1AJ5EHpgdObEoSQ0 0ygG887Q1OyNVSjyUNjO470+K7KazMA= X-MC-Unique: NvPLE4WdPBS4yd3JnXh6Ig-1 X-Mimecast-MFC-AGG-ID: NvPLE4WdPBS4yd3JnXh6Ig_1789564904 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1789564904; x=1790169704; 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:content-type; bh=i3ab9f4ObETvK0c9uUipMHw3PnKmaGztWZYlVMHBWk0=; b=lauCwFsiyrnyIU2pImqObRa4v82pk1ymJiFHraZa6+AUcbBgpGJB+Qs01QtHQjk8lR GzCw/GC2knLkyTLqf/AZfitCf96mGl+2H8sMD/CxfawwdhxPafR0VWadtuXelMx5GRWV Z5G7gsJyrqPzfd8ij4QQfAxXnJmYoQKbgPKORv2/TEkK2uL3ly6A/NoDl3vOWO55Weng xEdq7xz4Z5UQxmukARsABVDZa9oKvvKcw/fhMj5C9rsn4+5PniZoG9JSM+ICiqlqgJZh 17Dtt9RD9LW69qp/zrT3iWM9AeEFiPXnhuufR3YY7F+ZATYvV7jD9Gtr1N1yO0qCFCjr IjCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789564904; x=1790169704; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=i3ab9f4ObETvK0c9uUipMHw3PnKmaGztWZYlVMHBWk0=; b=BCLuyvn0qCruTNy2VNPEiDLBD81EgbYQVqCwZ1xOW2vUIbPggX0VglcQGHqR8K0rOC d35MSlZyBCD63KIidkD2KP3/NA3mvddlKCVSYtngrE/FnCGsR129vyngit8RziSpFf3n q1g+bYONPA2Y8qTPZvxkuUYI+c0RPY8ETsTesNIxu2f/gx1A0UG1W7md0j4hxY9iRV+m 72HoiYp12DQgCMpqOHtk6Of8Q3oFTNC3gdzDJfJEtCEWh/uswZPq0ptlSLFGgi8/iqVa 4TK5VGeDcdXZNOlWEnM4dy0V+OUcv8P/LBUfcp+Fb7uL0AKlhDtTXkTFc7T2LpRpJa5c XSpQ== X-Gm-Message-State: AFuF++ljE//hq6CnJsI4Yx+p/tfEo8iK16yM0Y5DG5mcvETmR+1tvDis 9DPxHGDFvMo5yfHsjJa3WVzfPu0mr0u7S+K3Ps1gqiEjNsaev8UcSW0AkuaxnS4iJ1vhfR/aKmQ ONI3MxBcouDR239wyxwa3vp1aDFw69x5XvUJknTLO5q8vybkiaFw1soPXa+WyRSLtW7gq0eUIuc BeUVAHvLg6sgf8ZQZJwxS2m6pXW+VaPIoixiqg3ozw X-Gm-Gg: AYBFou37ngpC8vEt0qN8D4f7CMv6yh32osJKZVLtuxGbZWEriCJoMGHWDlHClf5o+W7 Jzru38uXQnEiZdYZ2XzU+PMUwemikxAU4xguWbylOhWTTR3HGMNaOLM670uviM5KpnE9B7vMOh6 F4rGlabUn+iPyZr1nkD9avJMqzBFtC1bUYd91MduYf7b0C4WS67W/FLbBz2ey7EmiF/1trhrq9j ehtZCMtEksWDZ2TGTiOvkeeKJvXpF0WQN6wpupAnrz2MuninbE2ffQE4Iwjb0bC6FdCVs97o8j0 FrB6IjTC9sk79Qk/cRqoJUsJOqX+gHXTUCCZGfa+tLq8xbouVpcnGyktZPsOecuF4et4l1O2Zz1 UChdiWJWGCAH1RIY0EXFlvEXxUDO9Na1YcXIjPvbZMV/t02VnaW85oy2mpHTLfSSsA/6c6kkA8D SR4RJX X-Received: by 2002:a05:600c:630a:b0:49c:e37e:4389 with SMTP id 5b1f17b1804b1-49e9663bbf2mr32670675e9.4.1789564903980; Wed, 16 Sep 2026 06:21:43 -0700 (PDT) X-Received: by 2002:a05:600c:630a:b0:49c:e37e:4389 with SMTP id 5b1f17b1804b1-49e9663bbf2mr32670365e9.4.1789564903642; Wed, 16 Sep 2026 06:21:43 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 8/8] ncr710: unify two conditionals Date: Wed, 16 Sep 2026 15:21:20 +0200 Message-ID: <20260916132120.860910-9-pbonzini@redhat.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260916132120.860910-1-pbonzini@redhat.com> References: <20260916132120.860910-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1789564950817158500 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- hw/scsi/ncr53c710.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/scsi/ncr53c710.c b/hw/scsi/ncr53c710.c index 18c3a4e8c51..fad3d3113e5 100644 --- a/hw/scsi/ncr53c710.c +++ b/hw/scsi/ncr53c710.c @@ -797,13 +797,10 @@ void ncr710_command_complete(SCSIRequest *req, size_t= resid) s->status =3D req->status; s->command_complete =3D NCR710_CMD_COMPLETE; =20 - if (p) { - p->pending =3D 0; - } - ncr710_set_phase(s, PHASE_ST); =20 if (p) { + p->pending =3D 0; ncr710_request_orphan(s, p); } =20 --=20 2.55.0