Received: from eggs.gnu.org ([2001:4830:134:3::10]:42665) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9aQP-0002Pk-3P for qemu-devel@nongnu.org; Mon, 29 Jun 2015 10:52:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9aQJ-0007rp-7e for qemu-devel@nongnu.org; Mon, 29 Jun 2015 10:52:45 -0400 Date: Mon, 29 Jun 2015 15:52:35 +0100 From: Stefan Hajnoczi Message-ID: <20150629145235.GK32151@stefanha-thinkpad.redhat.com> References: <1435018875-22527-1-git-send-email-jsnow@redhat.com> <1435018875-22527-17-git-send-email-jsnow@redhat.com> <20150626161112.GG31186@stefanha-thinkpad.redhat.com> <558D8D97.1080403@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aziWXe2aaRGlkyg3" Content-Disposition: inline In-Reply-To: <558D8D97.1080403@redhat.com> Subject: Re: [Qemu-devel] [Qemu-block] [PATCH 16/16] ahci: fix sdb fis semantics List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org, Stefan Hajnoczi --aziWXe2aaRGlkyg3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 26, 2015 at 01:36:23PM -0400, John Snow wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 >=20 >=20 >=20 > On 06/26/2015 12:11 PM, Stefan Hajnoczi wrote: > > On Mon, Jun 22, 2015 at 08:21:15PM -0400, John Snow wrote: > >> @@ -682,19 +680,22 @@ static void ahci_write_fis_sdb(AHCIState > >> *s, int port, uint32_t finished) > >>=20 > >> sdb_fis->type =3D SATA_FIS_TYPE_SDB; /* Interrupt pending & > >> Notification bit */ - sdb_fis->flags =3D > >> (ad->hba->control_regs.irqstatus ? (1 << 6) : 0); + > >> sdb_fis->flags =3D 0x40; /* Interrupt bit, always 1 for NCQ */ > > ... > >> - ahci_trigger_irq(s, ad, PORT_IRQ_SDB_FIS); + if > >> (sdb_fis->flags & 0x40) { + ahci_trigger_irq(s, ad, > >> PORT_IRQ_SDB_FIS); + } > >=20 > > This if statement is always true. > >=20 >=20 > Yes. I did that on purpose. Maybe that was too weird. >=20 > The idea was to emphasize that the IRQ is definitely only triggered > *IF* the interrupt bit is set. It just so happens that we currently > always set it. >=20 > The generation and trigger mechanics are supposed to be separate, but > we currently have no use case for them being separate (because we are > an omniscient HBA-HDD amalgamation), so they're mushed together here. >=20 > This is kind of like a documentation "NB." >=20 > I can replace it with: >=20 > /* Trigger IRQ if interrupt bit is set, which currently it always is: */ > ahci_trigger_irq(...); Good idea, that makes it clear. --aziWXe2aaRGlkyg3 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVkVuzAAoJEJykq7OBq3PIiOEIAJPWfCWoAB+BabnoqcPu/8JO 4TQewKbp2SJnUoHsF53lmxhDBJoKZ43aGugGx27ywu6CjMtciKTt1Uy803twcb5f kdc/p3VDdHPIWSN9HqzvrUqJs8VoGX6+f6dYE6ngaJohjoyfxdX1ixSuiXYq3Tip aK+IViocINATt01XERCtPyjyNX1fYq2z22OsR9Oxt1nHgpDgc/uMJPutwUlZzCkz p9jk3Qb/h9JsPdFt63AYD+9n20bPnVzQcHbklf8L7jIUIWLlR2bKR+jj8cjLqllR FM/57Fm+08qwRp7Y1GGEDn1NRyk7wKQ0u88aq5Bg2vB1NTB7cxzWpN1bNj7vkCU= =axTC -----END PGP SIGNATURE----- --aziWXe2aaRGlkyg3--