From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 44EC540F729 for ; Wed, 12 Aug 2026 09:41:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786527707; cv=none; b=GX9AHNfIqglRmUOaKeNqjmfiTltWIxtBYy6eYvY7aGbDhAjMJYhXy2VqYw/HQhGNr7M1AiAGHdYqNtQhHseVnTqfB5sZVouTOrpdzQCjikNJBhY3j7ONUUpvqYQ5eyjRJWwj2KZhjqqyG1dJ/sE3v5KdH8LadVO1dpMtJHXe4DQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786527707; c=relaxed/simple; bh=XaKUIdZO2DCDFVav7621HKbSJtQG99IRFpmyYJN2OgQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BqJOxR/0Bl7i1j8m4Mo16CLMK26WHzVTwpMlPheEJPmNj8MI+AM9R9aAYv+ideDfbWcEpimFBOitFdtSuebehyFv4RiMLpr4PPYTjAXGS5IiMIcsPvVxAHIRb3PM9ID0boFuxWKL4p3gHKwPm18U6fV9ZqWFJWLEiYoLgWP3HF0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b=dtA51W+R; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b="dtA51W+R" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-490cf322ed0so6563865e9.1 for ; Wed, 12 Aug 2026 02:41:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1786527702; x=1787132502; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=IxNosE7yHoDF9GtVXHnGVn0+pksROVpd1JFq4JpMO38=; b=dtA51W+RNOLwLPUU6x62B3iUUApgaDlKx8t6v5FdW+JUTAGv84csKCPUpjjK6issne lkS+xpvEDGTc1cBCrBZaZZXDc26lNooPx5Lsh+/ofK+Uk5O1Zusw8/q8HiHuAdC7sB5G IyWwCX4P6qRPIW5G9S+zCDI+X+vVoNOx6qxdV1ivOIACLp4VcIpnx7NfdNFNid1nXS6s pMmjM+PX79w42Jj+T6YCvEB0kQ9HNBwag6WbO9H6EW9MLnSmidsOz3HNaW76Sqy7GXJt 5QZ4LLBFObAC+6/OZLKtKliOgjLUzZHOzFRWShGDX7E+grbiPWAvUiCJWyxrm6DvM75f Vwmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786527702; x=1787132502; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=IxNosE7yHoDF9GtVXHnGVn0+pksROVpd1JFq4JpMO38=; b=o3m2iGeR0Q9UAA8RHz7rXHUStzgRot2KUoMFLGttlXXIon0Eg4+xSALfcEX7niAdcA WXCGNy1REMYtRHbwY4TZtqDhjHfc/Wx58xVvh74BhcUlAL5/uPMshZ03VuXSJC6/4zh1 n6V5UQtUV75xmuFgeg/v5DZUt9fzM8Mt9R2YSB+aOOT7HySMR1S+aV8ZIZQ4PdZEgrh2 lftZiFmHIG6hsAbjYdSCAVtgul1zjPVyTvoCysHAMJD4Aq6H+1fgsHaqJ+wkJGmS0a9g T7K5Ck0d5rCktZrrr3iVlZDraciT0Bf6M9MPMVfr96ytNr/rCOOwkALkNtsNjTgWEViW U0aQ== X-Forwarded-Encrypted: i=1; AHgh+Rqf9nrnqMkaWSqVktnlSqxo1wwvhMGr8o6yN88iGCz3ikhEWncez0WbKdU3lNXpIr2HL6N1EYjMKjE1UpE=@vger.kernel.org X-Gm-Message-State: AOJu0YwJmjE60Wz+zRAQmttJCflCy0KiA1QWg4RHt6Zfi5zkSwpMLlZq MImer8y8VZQFVUYir0tHW3HqqnUvPVRbEprubx8EtW1gR2f9VQUtbRWvBp5XRZZeO7k= X-Gm-Gg: AR+sD10vDNhr7InImwD7kWlhXhIHC4i075LOM0TAoqHBtaqWe7Wtp9ZGGlflCK8MZgp JA8a1fIgwWxNNTMcA4NuBJwloa7mTK8jDmAzdQZPdZb77abUFJLvmjm6www1nO9asga81VC7Sya qEKZPiw2UPLI8zY6k7n4lmiscr4ZE3/cE/hcyMhS0eTKzwiFyAQHoUOr7P4FiNryTfSsRaJ8GFQ MxlGEMyBw2Yy2Wg7Uk6S5/4nJ+QiqGVxo8MTVmt38ybvTPGbFbt1sAsCb2ytwk7MgvPPhqaL7uT R8Hh7C1oK+nVrDpx+0k14/Kin4PTiU7rzp5ESE9J/tOakMNbPbBjHpp3kXvKVUXKaUSWFJb3Vnr xuDfR2PdP+FcRYg4G8hc/QV7j4OQeMLpoHQadaWq397Et+RLNvjl4fd++DXz3xqLsQcyWQ0X7WD U+tDKtnGGHTL768SQ+sFC7ctgIrbhhpuC01yUFgUBEjbNX3JIjKEpikl8K8lzBKYJ2uA== X-Received: by 2002:a05:600c:4690:b0:499:728c:4704 with SMTP id 5b1f17b1804b1-4997c0fe705mr38677725e9.12.1786527702586; Wed, 12 Aug 2026 02:41:42 -0700 (PDT) Received: from localhost ([2a02:8071:56d1:2de0:1d24:d58d:2b65:c291]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-4997c9944ecsm34404005e9.14.2026.08.12.02.41.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Aug 2026 02:41:41 -0700 (PDT) Date: Wed, 12 Aug 2026 11:41:39 +0200 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Damien Le Moal Cc: Rosen Penev , linux-ide@vger.kernel.org, Niklas Cassel , Jeff Garzik , Mark Miesfeld , Rupjyoti Sarmah , Prodyut Hazarika , open list Subject: Re: [PATCHv4 0/4] ata: sata_dwc_460ex: cleanups Message-ID: References: <20260712213728.824420-1-rosenp@gmail.com> <7c69e55c-1877-4bdd-aa18-9154acada32f@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="vqe64owdcccwyybr" Content-Disposition: inline In-Reply-To: <7c69e55c-1877-4bdd-aa18-9154acada32f@kernel.org> --vqe64owdcccwyybr Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCHv4 0/4] ata: sata_dwc_460ex: cleanups MIME-Version: 1.0 Hello, On Mon, Jul 13, 2026 at 04:31:53PM +0900, Damien Le Moal wrote: > On 7/13/26 06:37, Rosen Penev wrote: > > Fix various issues flagged by Sashiko against the original submission o= f this driver. > >=20 > > v4: remove interrupt fix > > v3: Shrink series to Fixes on the initial commit. > > v2: sashiko fixes. > >=20 > > Rosen Penev (4): > > ata: sata_dwc_460ex: use platform_get_irq() > > ata: sata_dwc_460ex: enable SATA interrupts only after IRQ handler is > > registered > > ata: sata_dwc_460ex: fix clear_interrupt_bit() clearing all pending > > interrupts > > ata: sata_dwc_460ex: fix infinite loop in NCQ tag completion > > bit-scanning > >=20 > > drivers/ata/sata_dwc_460ex.c | 38 ++++++++++++------------------------ > > 1 file changed, 12 insertions(+), 26 deletions(-) >=20 > I applied this to for-7.2-fixes, but I reversed the first 2 patches. > Thanks! >=20 > (if you have time, please send further cleanups to address the other issu= es > that sashiko signaled). I think the analysis for the fourth patch is wrong (or incomplete), the original code was (a bit simplified): unsigned char tag; unsigned int tag_mask; ... tag_mask =3D ...; ... tag =3D 0; while (tag_mask) { while (!(tag_mask & 0x1)) { tag++; tag_mask <<=3D 1; } tag_mask &=3D ~0x1; ... } Given that tag_mask is shifted left (and not right) the inner while loop yields an endless loop whenever tag_mask's least significant bit isn't set initially. Given the outer loop this results in a hang if tag_mask !=3D 1. So the issue doesn't only trigger for tag_mask =3D 0x80000000. Either this never worked, or the problem doesn't trigger reaching that code with tag_mask !=3D 1 easily. And I also wonder if the change's urgency was considered carefully enough to justify a commit in -rc4 to fix a bug that is already roughly 16 years old. And similar for the 3 parents of that change (c2130f6553f4a5cbdc259de069600117a995f197): For 4bbc16a353a98023e5ddfca7c1fc0e49971cf4d0 I wonder: Does ata_host_activate() already need the irqs enabled? If yes, the commit is wrong. For a4af122106f73ea510bb35a9ea1dedd980fc0db7 I think it's bold to claim "Also fix unused variable when CONFIG_SATA_DWC_OLD_DMA is disabled." given that the unused variable warning (I guess about np) was only introduced during development of this patch. For 66c4e310ad71f41e41736d33dd8a1fb5eaaec7f3 it disturbs me that the commit log has: "If INTPR uses standard Write-1-to-Clear semantics, [...]". Without that the justification of the patch goes away, nobody checked that? All four commits have an Assisted-by tag, and I have the impression that nobody involved in these commits has the hardware or even the hardware documentation. But maybe I'm just to picky about changes that enter the mainline in the stabilization phase. =F0=9F=A4=B7 Best regards Uwe --vqe64owdcccwyybr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmp8P9AACgkQj4D7WH0S /k6Xdwf8CNCxVpd6AXAmUdbCpzWXDN15EM97qTSDUG2qItEkGWbDLLwPiGYeSW1l rFWsA31M09Xtn5VMVSpH21izjJY6W1eI+zDPGAUPvxe5jehm7ACznW9LPI9eDcgc rznNvFwqp9rdY1P4yRjADxq46H9kQaPhgRfZSr216R0FgI8xt9KA2cmhsG+Lcijq BxV4Dj+wDA46S/v9lmBD0PbB2CmrM0ghBIi0cRuCSePFpBITm4Y5zpFV8j8B4qa7 ufUAMLh1g4UNStQUvCcDMpxgoFgQozPbc7z4N/jtOlo6wwAKQo2Sghfx06meZfC5 TJlVZTVAm5AXbCcXGV0LdDiKtJBO9Q== =W1WM -----END PGP SIGNATURE----- --vqe64owdcccwyybr--