Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8972163ybl; Wed, 25 Dec 2019 10:27:45 -0800 (PST) X-Google-Smtp-Source: APXvYqyocCCt+Bomgk7ROnr5cxLOltpDUfdNGN61x452SBxpnGJsiA2fHdELX4/Pkyuwj25mB1Px X-Received: by 2002:a9d:21f4:: with SMTP id s107mr45496180otb.102.1577298465052; Wed, 25 Dec 2019 10:27:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577298465; cv=none; d=google.com; s=arc-20160816; b=dSfK37JvdPk8yvuCYZD8wh0G/ShCDYozUhhABuf8Xc70D962Tczh5dJO0TnWWrTGPU can9A/7qwfmH7ozBtYlFV8w80trVluQRokQIBDIXhXzssh9UuKZFFyAsHjZjXOI5fuFB TC2AQspQFKHOV3ihBsDLp2mBsZ7w0Psf16V+kU7pkem5YT0CM9gv4gnED5pDb51BYuJ0 A6piRrcUEBFh/Vj5LFeVmxX31pr/UozBqzd1GUiUt+FCxqrl4n3bWxCX7G2t1LpA4vFd 1FPmFdvDX4tBP7aagcV1qwmkHqUkpgSYgl7Y0w1406RXG6dz5JKCk+22ZUMrlJjXrW6A sC7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=cJYp9ftX998bOD2V8Vxk7qy7RjelI9Sr1IIEWlQTCXQ=; b=ZLpy5+OIlw75URlRYaaOlTqcTm142TOUKRa8tP6Ez3F6/se36qvODKa7sUz3PL0Gz4 Kmztc10vMZEegRCmrbFOWiI2vG3STorsFE36a+eL2zLzSJjF1XDsP7GPOD3ppyM9vCLU Mu7W89TmEf2qDq30ocpwyVklg3AQTj/shc9kJFi65qUBgxRvVkdoyqvq++dq5rGi1ub+ oOq0LurFsIfArR3FEHw9AaPfPb1Z9rLXR/Tsc2E9SoeTxeOjjlQW0o1ubvUb6p2nT/1Q XEQ2LyiuiHwwABVpvCRJ+ECOW9+OK48gyHvtx5y8a3qui63SqCdq7UtmB8seYbMPMWeX CHdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=ky9gPXYe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g26si14913040otn.180.2019.12.25.10.27.32; Wed, 25 Dec 2019 10:27:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=ky9gPXYe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726455AbfLYS0u (ORCPT + 99 others); Wed, 25 Dec 2019 13:26:50 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:32907 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726353AbfLYS0u (ORCPT ); Wed, 25 Dec 2019 13:26:50 -0500 Received: by mail-pl1-f195.google.com with SMTP id c13so9657458pls.0 for ; Wed, 25 Dec 2019 10:26:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=cJYp9ftX998bOD2V8Vxk7qy7RjelI9Sr1IIEWlQTCXQ=; b=ky9gPXYeEpV+D3g7hOpEEvUPYTARCflLE+a5L1hDI3yIVTtN168Dcea1lIZf2xFI5R WK0UExCzY5Iay0lfVz9dRmMnYY4JMTRUrybskWcQ5UgQLlg+zNiHBRL9fTsgSt6hL2Tg ZZGaR2LaJFs0GVsNc10fSCvjpYZwxUc13UMu7lTubusA0o5/+ZDK/xGiNTdRvBc+sZ2V r8u2q/O8CF/UbNI2fSwTyl+AQhV8WNhuBJGusFjknPV8hN2kngHl3yodff5OS71xNGt4 RflsCZcI4neH3y1guWJ9C/HgdOjly1EeDWZTasbJabNYZuhvLmVqA9sh+lm6esuhM2Kd w4Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=cJYp9ftX998bOD2V8Vxk7qy7RjelI9Sr1IIEWlQTCXQ=; b=bESCCAZq1uoGE+nV9rOfpu9xnyyut//7mjBNRs746RqVX/9+/ryLoM5ZkT0+uumfff NGNarMAXCeeQi3Dthd58ZZO1Ir0SJeKS5Nk9itXUahj2SoEiqOYsedmLt6YrMXdnSwMH 8rLeYm5+6UzgAOj0AX0TF1uURcTemYkRMags4nKVFgjz3EcuguBO2MZY/df1xTrbg+d5 a7eaqeMeCQqBGCWAztP4WZKK3PGaVJnxOe5WEDi1sOH2ufkZ9u8dfp94IkAHKnrT/dmP Z5lMVmInP8pNkxbnJADq/U/cKx8MOVM6EyGda/128TPdHgWRO7oVBUuzfytClvKrup31 yM7Q== X-Gm-Message-State: APjAAAXuEI0kUUbsMAwXEIQg915SHPBF99oWcGdvLyQKCCoqFxw3YWJD b+pcjvJGR6Vg9IjGFEtPlS0BeRhs9ZAJug== X-Received: by 2002:a17:90a:ad48:: with SMTP id w8mr14422989pjv.19.1577298409752; Wed, 25 Dec 2019 10:26:49 -0800 (PST) Received: from [192.168.1.188] ([66.219.217.145]) by smtp.gmail.com with ESMTPSA id i23sm12227476pfo.11.2019.12.25.10.26.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Dec 2019 10:26:49 -0800 (PST) Subject: Re: [PATCH v2] libata: Fix retrieving of active qcs To: =?UTF-8?Q?Pali_Roh=c3=a1r?= , Sascha Hauer Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de References: <20191213080408.27032-1-s.hauer@pengutronix.de> <20191225181840.ooo6mw5rffghbmu2@pali> From: Jens Axboe Message-ID: Date: Wed, 25 Dec 2019 11:26:47 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20191225181840.ooo6mw5rffghbmu2@pali> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/25/19 11:18 AM, Pali Rohár wrote: > Hello Sascha! > > On Friday 13 December 2019 09:04:08 Sascha Hauer wrote: >> ata_qc_complete_multiple() is called with a mask of the still active >> tags. >> >> mv_sata doesn't have this information directly and instead calculates >> the still active tags from the started tags (ap->qc_active) and the >> finished tags as (ap->qc_active ^ done_mask) >> >> Since 28361c40368 the hw_tag and tag are no longer the same and the >> equation is no longer valid. In ata_exec_internal_sg() ap->qc_active is >> initialized as 1ULL << ATA_TAG_INTERNAL, but in hardware tag 0 is >> started and this will be in done_mask on completion. ap->qc_active ^ >> done_mask becomes 0x100000000 ^ 0x1 = 0x100000001 and thus tag 0 used as >> the internal tag will never be reported as completed. >> >> This is fixed by introducing ata_qc_get_active() which returns the >> active hardware tags and calling it where appropriate. >> >> This is tested on mv_sata, but sata_fsl and sata_nv suffer from the same >> problem. There is another case in sata_nv that most likely needs fixing >> as well, but this looks a little different, so I wasn't confident enough >> to change that. > > I can confirm that sata_nv.ko does not work in 4.18 (and new) kernel > version correctly. More details are in email: > > https://lore.kernel.org/linux-ide/20191225180824.bql2o5whougii4ch@pali/T/ > > I tried this patch and it fixed above problems with sata_nv.ko. It just > needs small modification (see below). > > So you can add my: > > Tested-by: Pali Rohár > > And I hope that patch would be backported to 4.18 and 4.19 stable > branches soon as distributions kernels are broken for machines with > these nvidia sata controllers. > > Anyway, what is that another case in sata_nv which needs to be fixed > too? Thanks for testing, I've applied this for 5.5 and marked it for stable. -- Jens Axboe