Received: by 2002:ab2:5c0e:0:b0:1ef:a325:1205 with SMTP id i14csp128203lqk; Wed, 13 Mar 2024 19:51:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUiRjnM1q4pchL8S98c4GFX074Kvn7x3AXxV2nPn7ma1D2Xhbk2fEAvkkMSV8OQHduJqU8Qmv/HFI1VdGmzfxHcQicEcvRm7ypZEEXvIQ== X-Google-Smtp-Source: AGHT+IEA8rK+1MDKWVjS46rkNm1ByQgModUuKWKYnyNAhwVsj29QOB1amHuZqbCcI4icnUak/6AM X-Received: by 2002:a05:6402:3603:b0:566:6c6e:385c with SMTP id el3-20020a056402360300b005666c6e385cmr180418edb.34.1710384703350; Wed, 13 Mar 2024 19:51:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710384703; cv=pass; d=google.com; s=arc-20160816; b=NUhTurqJF+IJSfTU27saIa7pJVsbxpIkplKsVMy1zCz1w9r01/C8fupD78d9lKW16F 7xRYNI4pcUPZ/E+qv1v5acUdJ9FQArywO2VbBi7bDBH40xCJENjBXsGbB9Ps1Jy7IxL2 kpFneKyb6HE0An4mYRfar/jwR+ce/wZnnyHhuIUcnvzov7BTkPzE/mB6EF4eqD2h3Tjq tpu6oEvZBaAvnu3PZcNPj7ed239Rv0ZahaOeJn1ESOdi8ED40jtNaKdlKN6UCnXbbyfv 1EMVmR6G7LBLUQj25Z3zxClb2qHz5vdVkrK0DoT32g8xQ1p51XaorcfCVpQ6NZ/Y4xlw zDPA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=3jBLwcqqyzl0KD+WrAZS8F5rERxIMqtAba3cH4UOZ2w=; fh=7LV3CBdra5WOd/zL8EJjGFqlIVecEZ8ajdraNh/LTxA=; b=PTkW0ZaEJlAVHVC6soeYjwDsX3B808j6rNa13stFCk7Onwj0mHFtnPYPpJT5bG9eqe 4G2fZxDSHxnigSmX8ZuTRyHILPP/KptzMIqBRJV2shp0iH4eMBipObHd8iVaDg9g7IaS gZZ/KTtCm0JFvoZBZRhtTDgj1rhdjl+bn0rKDGaJ215RkIC+Yy+ylUza2j7RwbH3znc/ bHzJcgFe7MYpk32boTRhl7QsrcFXxB/D4LGMONuHPLUE/dJ52qtj8g0PanJuXQiYhh7d Nap9dEHVhTdyshzV8axLFSS8Yqg8rkNZ4gJDG6RBmQ+0S2XkZsUBCAk4eIwjaml/hv6Q 10/Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=A0HeexND; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-102725-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102725-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id c3-20020aa7d603000000b005688020db5dsi261105edr.568.2024.03.13.19.51.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 19:51:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-102725-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=A0HeexND; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-102725-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102725-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 193E81F217AE for ; Thu, 14 Mar 2024 02:51:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D76B4C96; Thu, 14 Mar 2024 02:51:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="A0HeexND" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E4338F55; Thu, 14 Mar 2024 02:51:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710384693; cv=none; b=mZgIgRfbrpSYACbXJjuSn0VY+QMZPVw5zZXrXGigVGBqOaRDLg2YjtQznf379y6rmYxtaK29dvbj/OQNgRE38R4NWEL/pVmARVIKe3So/6ozBigKJFVvaisX2MdHuPvf4l2PKPZCJ2ahxMRR629lxXJefc+fpLAYL+xQqVdMyHQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710384693; c=relaxed/simple; bh=4odLktmp/nCGkS6wqpUh5pVSGO+4MNahhOcH2uJT5hM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RR9tQTJ09MBLR+yEjk8JcUg9Aj4V1/MEg46w44ZBhWsy1/Am70paGx8rDOFK8rwtEgUEC5WFB25ob0N3es723v9KTlRBJE30vBVhff19cHrp/e3uxYvJV1IKS7ROo9KlDIaJZlWIYA9nA1wpZCvgCLBC0eNGO6/x0rx/fLJekpo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=A0HeexND; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD98CC433F1; Thu, 14 Mar 2024 02:51:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710384693; bh=4odLktmp/nCGkS6wqpUh5pVSGO+4MNahhOcH2uJT5hM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=A0HeexNDAgwbgoYMvpeTm+qMmCVWRL6Oe61CkNkbuyctGpXmd0P3bUZ4cy/0AEeZk Q2OWaDxG32trUQETBlNaPyXZmMapYFIwuJ3zbEUMk9lUTT39J3j0a93GSp4eM1np2A Y5vm+ElQFFqQSX7VLJ8Mhe5a/3dBAFf49UgZdMqwJTm6DOPCGNe8Wany3HfIEQMURy reDE7HNN5TjKJdy01Izl182GcmEWNc0BCR6LtFwjpcqWkQM4eyTh2YXw5lajNP+Kdl EQsFJWIJOObZo75cpLdgZb9rOR5sY1ZeQhytJXLDjssOF0TVtEmYhQy+d3mOiHZUQS BMvwbGqMwmgCQ== Date: Wed, 13 Mar 2024 20:51:29 -0600 From: Keith Busch To: Kevin Xie Cc: Lorenzo Pieralisi , Palmer Dabbelt , Minda Chen , Conor Dooley , "kw@linux.com" , "robh+dt@kernel.org" , "bhelgaas@google.com" , "tglx@linutronix.de" , "daire.mcnamara@microchip.com" , "emil.renner.berthing@canonical.com" , "krzysztof.kozlowski+dt@linaro.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-riscv@lists.infradead.org" , "linux-pci@vger.kernel.org" , Paul Walmsley , "aou@eecs.berkeley.edu" , "p.zabel@pengutronix.de" , Mason Huo , Leyfoon Tan Subject: Re: [PATCH v15,RESEND 22/23] PCI: starfive: Offload the NVMe timeout workaround to host drivers. Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Mar 14, 2024 at 02:18:38AM +0000, Kevin Xie wrote: > > Re: [PATCH v15,RESEND 22/23] PCI: starfive: Offload the NVMe timeout > > workaround to host drivers. > > > > On Mon, Mar 04, 2024 at 10:08:06AM -0800, Palmer Dabbelt wrote: > > > On Thu, 29 Feb 2024 07:08:43 PST (-0800), lpieralisi@kernel.org wrote: > > > > On Tue, Feb 27, 2024 at 06:35:21PM +0800, Minda Chen wrote: > > > > > From: Kevin Xie > > > > > > > > > > As the Starfive JH7110 hardware can't keep two inbound post write > > > > > in order all the time, such as MSI messages and NVMe completions. > > > > > If the NVMe completion update later than the MSI, an NVMe IRQ handle > > will miss. > > > > > > > > Please explain what the problem is and what "NVMe completions" means > > > > given that you are talking about posted writes. > > Sorry, we made a casual conclusion here. > Not any two of inbound post requests can`t be kept in order in JH7110 SoC, > the only one case we found is NVMe completions with MSI interrupts. > To be more precise, they are the pending status in nvme_completion struct and > nvme_irq handler in nvme/host/pci.c. > > We have shown the original workaround patch before: > https://lore.kernel.org/lkml/CAJM55Z9HtBSyCq7rDEDFdw644pOWCKJfPqhmi3SD1x6p3g2SLQ@mail.gmail.com/ > We put it in our github branch and works fine for a long time. > Looking forward to better advices from someone familiar with NVMe drivers. So this platform treats strictly ordered writes the same as if relaxed ordering was enabled? I am not sure if we could reasonably work around such behavior. An arbitrary delay is likely too long for most cases, and too short for the worst case. I suppose we could quirk a non-posted transaction in the interrupt handler to force flush pending memory updates, but that will noticeably harm your nvme performance. Maybe if you constrain such behavior to the spurious IRQ_NONE condition, then it might be okay? I don't know.